From: support Date: Wed, 21 Sep 2022 22:32:54 +0000 (+0000) Subject: Built motion from commit 19288580.|2.6.15 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=70f046cb12a4697dff7f8154dde59baf5dbb87d8;p=motion2.git Built motion from commit 19288580.|2.6.15 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 5fc00b6..ac3274c 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-21T16:54:29.047Z", + "time": "2022-09-21T22:24:27.084Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7e8c3b8..012dd6b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-21T16:54:29.047Z", + "time": "2022-09-21T22:24:27.084Z", "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 3432617..256c064 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 _0xd765=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xd765,0xdf));var _0x5d76=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd765[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x5d76('0x0'));module[_0x5d76('0x1')]={'name':{'type':Sequelize[_0x5d76('0x2')],'get':function(_0x3c74e1){return this[_0x5d76('0x3')](_0x5d76('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x5d76('0x5'),'integration',_0x5d76('0x6'),_0x5d76('0x7'),'urlForward',_0x5d76('0x8'),_0x5d76('0x9'),_0x5d76('0xa')]],'msg':_0x5d76('0xb')}},'comment':_0x5d76('0xb')},'data1':{'type':Sequelize[_0x5d76('0xc')](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['STRING'](0x1000),'comment':_0x5d76('0xd')},'data3':{'type':Sequelize[_0x5d76('0xc')](0x1000),'comment':_0x5d76('0xe')},'data4':{'type':Sequelize[_0x5d76('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x5d76('0xf')},'data6':{'type':Sequelize[_0x5d76('0xc')],'comments':_0x5d76('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x03f0=['TEXT','urlForward[body]','exports','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','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]'];(function(_0x48a836,_0xa1d010){var _0x249dc8=function(_0x2a95a0){while(--_0x2a95a0){_0x48a836['push'](_0x48a836['shift']());}};_0x249dc8(++_0xa1d010);}(_0x03f0,0x1b2));var _0x003f=function(_0x4f9d84,_0x3c2d86){_0x4f9d84=_0x4f9d84-0x0;var _0x3567e4=_0x03f0[_0x4f9d84];return _0x3567e4;};'use strict';var Sequelize=require('sequelize');module[_0x003f('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x584498){return this[_0x003f('0x1')](_0x003f('0x2'));}},'action':{'type':Sequelize[_0x003f('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x003f('0x4'),_0x003f('0x5'),_0x003f('0x6'),'jscripty',_0x003f('0x7'),_0x003f('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x003f('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x003f('0xa')},'data2':{'type':Sequelize[_0x003f('0x3')](0x1000),'comment':_0x003f('0xb')},'data3':{'type':Sequelize[_0x003f('0x3')](0x1000),'comment':_0x003f('0xc')},'data4':{'type':Sequelize[_0x003f('0x3')](0x1000),'comments':_0x003f('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x003f('0xe')},'data6':{'type':Sequelize[_0x003f('0x3')],'comments':_0x003f('0xf')},'data7':{'type':Sequelize[_0x003f('0x10')],'comments':_0x003f('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a846593..1ced7f2 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 _0x2430=['then','stack','name','send','body','Action','catch','destroy','params','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update'];(function(_0x3cfd5a,_0x2cf2a3){var _0x5720e0=function(_0x4e6827){while(--_0x4e6827){_0x3cfd5a['push'](_0x3cfd5a['shift']());}};_0x5720e0(++_0x2cf2a3);}(_0x2430,0x105));var _0x0243=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x2430[_0x172133];return _0x2460e5;};'use strict';var emlformat=require(_0x0243('0x0'));var rimraf=require(_0x0243('0x1'));var zipdir=require(_0x0243('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0243('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0243('0x4'));var util=require('util');var path=require(_0x0243('0x5'));var sox=require(_0x0243('0x6'));var csv=require(_0x0243('0x7'));var ejs=require(_0x0243('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0243('0x9'));var squel=require('squel');var crypto=require(_0x0243('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0243('0xb'));var toCsv=require(_0x0243('0x7'));var querystring=require(_0x0243('0xc'));var Papa=require(_0x0243('0xd'));var Redis=require(_0x0243('0xe'));var authService=require(_0x0243('0xf'));var qs=require(_0x0243('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0243('0x11'));var logger=require(_0x0243('0x12'))(_0x0243('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0243('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2e44,_0x252b17){_0x252b17=_0x252b17||0xcc;return function(_0x3b87a4){if(_0x3b87a4){return _0x4c2e44[_0x0243('0x15')](_0x252b17);}return _0x4c2e44[_0x0243('0x16')](_0x252b17)[_0x0243('0x17')]();};}function respondWithResult(_0x5da01e,_0xa24698){_0xa24698=_0xa24698||0xc8;return function(_0x48d2f6){if(_0x48d2f6){return _0x5da01e['status'](_0xa24698)[_0x0243('0x18')](_0x48d2f6);}};}function respondWithFilteredResult(_0x4b4bd6,_0x5966c3){return function(_0xda55a4){if(_0xda55a4){var _0x2f59e6=typeof _0x5966c3[_0x0243('0x19')]===_0x0243('0x1a')&&typeof _0x5966c3['limit']==='undefined';var _0x2434a7=_0xda55a4[_0x0243('0x1b')];var _0x17dcf4=_0x2f59e6?0x0:_0x5966c3['offset'];var _0x1c9229=_0x2f59e6?_0xda55a4[_0x0243('0x1b')]:_0x5966c3['offset']+_0x5966c3[_0x0243('0x1c')];var _0x4e275a;if(_0x1c9229>=_0x2434a7){_0x1c9229=_0x2434a7;_0x4e275a=0xc8;}else{_0x4e275a=0xce;}_0x4b4bd6[_0x0243('0x16')](_0x4e275a);return _0x4b4bd6['set'](_0x0243('0x1d'),_0x17dcf4+'-'+_0x1c9229+'/'+_0x2434a7)[_0x0243('0x18')](_0xda55a4);}return null;};}function patchUpdates(_0x56d842){return function(_0x417296){try{jsonpatch['apply'](_0x417296,_0x56d842,!![]);}catch(_0x1d8807){return BPromise[_0x0243('0x1e')](_0x1d8807);}return _0x417296[_0x0243('0x1f')]();};}function saveUpdates(_0x57d53c,_0x539c20){return function(_0x33616f){if(_0x33616f){return _0x33616f[_0x0243('0x20')](_0x57d53c)[_0x0243('0x21')](function(_0x266f26){return _0x266f26;});}return null;};}function removeEntity(_0xee0781,_0x431959){return function(_0x1ccbd0){if(_0x1ccbd0){return _0x1ccbd0['destroy']()[_0x0243('0x21')](function(){_0xee0781[_0x0243('0x16')](0xcc)[_0x0243('0x17')]();});}};}function handleEntityNotFound(_0x3e1714,_0x48d071){return function(_0x4296d3){if(!_0x4296d3){_0x3e1714[_0x0243('0x15')](0x194);}return _0x4296d3;};}function handleError(_0xaf1707,_0x568155){_0x568155=_0x568155||0x1f4;return function(_0x27310a){logger['error'](_0x27310a[_0x0243('0x22')]);if(_0x27310a['name']){delete _0x27310a[_0x0243('0x23')];}_0xaf1707[_0x0243('0x16')](_0x568155)[_0x0243('0x24')](_0x27310a);};}exports[_0x0243('0x20')]=function(_0x29dda1,_0x2adf9b){if(_0x29dda1[_0x0243('0x25')]['id']){delete _0x29dda1[_0x0243('0x25')]['id'];}return db[_0x0243('0x26')]['find']({'where':{'id':_0x29dda1['params']['id']}})[_0x0243('0x21')](handleEntityNotFound(_0x2adf9b,null))[_0x0243('0x21')](saveUpdates(_0x29dda1['body'],null))[_0x0243('0x21')](respondWithResult(_0x2adf9b,null))[_0x0243('0x27')](handleError(_0x2adf9b,null));};exports[_0x0243('0x28')]=function(_0xc0b772,_0x34f289){return db[_0x0243('0x26')]['find']({'where':{'id':_0xc0b772[_0x0243('0x29')]['id']}})[_0x0243('0x21')](handleEntityNotFound(_0x34f289,null))[_0x0243('0x21')](removeEntity(_0x34f289,null))[_0x0243('0x27')](handleError(_0x34f289,null));}; \ No newline at end of file +var _0xe63f=['request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xe63f,0x1be));var _0xfe63=function(_0x4fc259,_0x2ca38d){_0x4fc259=_0x4fc259-0x0;var _0x34f140=_0xe63f[_0x4fc259];return _0x34f140;};'use strict';var emlformat=require(_0xfe63('0x0'));var rimraf=require(_0xfe63('0x1'));var zipdir=require(_0xfe63('0x2'));var jsonpatch=require(_0xfe63('0x3'));var rp=require(_0xfe63('0x4'));var moment=require(_0xfe63('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfe63('0x6'));var util=require(_0xfe63('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfe63('0x8'));var ejs=require(_0xfe63('0x9'));var fs=require('fs');var fs_extra=require(_0xfe63('0xa'));var _=require(_0xfe63('0xb'));var squel=require(_0xfe63('0xc'));var crypto=require('crypto');var jsforce=require(_0xfe63('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfe63('0x8'));var querystring=require('querystring');var Papa=require(_0xfe63('0xe'));var Redis=require('ioredis');var authService=require(_0xfe63('0xf'));var qs=require(_0xfe63('0x10'));var as=require(_0xfe63('0x11'));var hardwareService=require(_0xfe63('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfe63('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfe63('0x14'));var db=require(_0xfe63('0x15'))['db'];function respondWithStatusCode(_0x3cf0e5,_0x151589){_0x151589=_0x151589||0xcc;return function(_0x168c52){if(_0x168c52){return _0x3cf0e5[_0xfe63('0x16')](_0x151589);}return _0x3cf0e5[_0xfe63('0x17')](_0x151589)[_0xfe63('0x18')]();};}function respondWithResult(_0xbd2a80,_0x1dbd2d){_0x1dbd2d=_0x1dbd2d||0xc8;return function(_0x776b5a){if(_0x776b5a){return _0xbd2a80[_0xfe63('0x17')](_0x1dbd2d)['json'](_0x776b5a);}};}function respondWithFilteredResult(_0x1628e8,_0xf2290b){return function(_0x4844e4){if(_0x4844e4){var _0x3d1603=typeof _0xf2290b[_0xfe63('0x19')]==='undefined'&&typeof _0xf2290b['limit']===_0xfe63('0x1a');var _0x31e332=_0x4844e4[_0xfe63('0x1b')];var _0x35c511=_0x3d1603?0x0:_0xf2290b['offset'];var _0x3bd013=_0x3d1603?_0x4844e4[_0xfe63('0x1b')]:_0xf2290b['offset']+_0xf2290b[_0xfe63('0x1c')];var _0x2ad102;if(_0x3bd013>=_0x31e332){_0x3bd013=_0x31e332;_0x2ad102=0xc8;}else{_0x2ad102=0xce;}_0x1628e8[_0xfe63('0x17')](_0x2ad102);return _0x1628e8[_0xfe63('0x1d')](_0xfe63('0x1e'),_0x35c511+'-'+_0x3bd013+'/'+_0x31e332)['json'](_0x4844e4);}return null;};}function patchUpdates(_0x5eaa47){return function(_0x9ac56d){try{jsonpatch[_0xfe63('0x1f')](_0x9ac56d,_0x5eaa47,!![]);}catch(_0x27a132){return BPromise[_0xfe63('0x20')](_0x27a132);}return _0x9ac56d[_0xfe63('0x21')]();};}function saveUpdates(_0x559f5e,_0x5a4540){return function(_0x94e5a6){if(_0x94e5a6){return _0x94e5a6['update'](_0x559f5e)[_0xfe63('0x22')](function(_0x15f0b6){return _0x15f0b6;});}return null;};}function removeEntity(_0x466b08,_0x16bb5d){return function(_0x43578c){if(_0x43578c){return _0x43578c[_0xfe63('0x23')]()[_0xfe63('0x22')](function(){_0x466b08[_0xfe63('0x17')](0xcc)[_0xfe63('0x18')]();});}};}function handleEntityNotFound(_0x102a2b,_0x1a698d){return function(_0x1574e8){if(!_0x1574e8){_0x102a2b['sendStatus'](0x194);}return _0x1574e8;};}function handleError(_0x5edf03,_0x5bda77){_0x5bda77=_0x5bda77||0x1f4;return function(_0x1854e2){logger['error'](_0x1854e2[_0xfe63('0x24')]);if(_0x1854e2[_0xfe63('0x25')]){delete _0x1854e2[_0xfe63('0x25')];}_0x5edf03[_0xfe63('0x17')](_0x5bda77)[_0xfe63('0x26')](_0x1854e2);};}exports[_0xfe63('0x27')]=function(_0x369718,_0x3bf448){if(_0x369718['body']['id']){delete _0x369718[_0xfe63('0x28')]['id'];}return db[_0xfe63('0x29')][_0xfe63('0x2a')]({'where':{'id':_0x369718[_0xfe63('0x2b')]['id']}})[_0xfe63('0x22')](handleEntityNotFound(_0x3bf448,null))['then'](saveUpdates(_0x369718[_0xfe63('0x28')],null))['then'](respondWithResult(_0x3bf448,null))[_0xfe63('0x2c')](handleError(_0x3bf448,null));};exports[_0xfe63('0x23')]=function(_0x2d2d72,_0x35b2d9){return db[_0xfe63('0x29')][_0xfe63('0x2a')]({'where':{'id':_0x2d2d72[_0xfe63('0x2b')]['id']}})[_0xfe63('0x22')](handleEntityNotFound(_0x35b2d9,null))[_0xfe63('0x22')](removeEntity(_0x35b2d9,null))[_0xfe63('0x2c')](handleError(_0x35b2d9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 73a6f21..889ec0f 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 _0xa2bb=['./action.attributes','exports','define','Action','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x89fd95,_0x33e1e4){var _0x2748c1=function(_0x45263){while(--_0x45263){_0x89fd95['push'](_0x89fd95['shift']());}};_0x2748c1(++_0x33e1e4);}(_0xa2bb,0xfe));var _0xba2b=function(_0x3c868a,_0xc90036){_0x3c868a=_0x3c868a-0x0;var _0x138783=_0xa2bb[_0x3c868a];return _0x138783;};'use strict';var _=require('lodash');var util=require(_0xba2b('0x0'));var logger=require(_0xba2b('0x1'))(_0xba2b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba2b('0x3'));var rimraf=require(_0xba2b('0x4'));var config=require(_0xba2b('0x5'));var attributes=require(_0xba2b('0x6'));module[_0xba2b('0x7')]=function(_0x58c966,_0x93a369){return _0x58c966[_0xba2b('0x8')](_0xba2b('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00bf=['moment','path','rimraf','../../config/environment','./action.attributes','exports','Action','util','../../config/logger','api'];(function(_0x44d17d,_0x1b8590){var _0x5da69c=function(_0x23b094){while(--_0x23b094){_0x44d17d['push'](_0x44d17d['shift']());}};_0x5da69c(++_0x1b8590);}(_0x00bf,0x7f));var _0xf00b=function(_0x1a81c4,_0x55fe60){_0x1a81c4=_0x1a81c4-0x0;var _0x1dbb26=_0x00bf[_0x1a81c4];return _0x1dbb26;};'use strict';var _=require('lodash');var util=require(_0xf00b('0x0'));var logger=require(_0xf00b('0x1'))(_0xf00b('0x2'));var moment=require(_0xf00b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf00b('0x4'));var rimraf=require(_0xf00b('0x5'));var config=require(_0xf00b('0x6'));var attributes=require(_0xf00b('0x7'));module[_0xf00b('0x8')]=function(_0x55fbec,_0x257029){return _0x55fbec['define'](_0xf00b('0x9'),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 8337030..e81e036 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x5121b4,_0xb7a2b5){var _0x38c3ad=function(_0x4babc0){while(--_0x4babc0){_0x5121b4['push'](_0x5121b4['shift']());}};_0x38c3ad(++_0xb7a2b5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x814b,0x1a2));var _0xb814=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0x814b[_0x5a7618];return _0x12dc65;};'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')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index adbeef9..8e413fe 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 _0xbad5=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d9242,_0x385b6e){var _0x59301e=function(_0x54d2ef){while(--_0x54d2ef){_0x4d9242['push'](_0x4d9242['shift']());}};_0x59301e(++_0x385b6e);}(_0xbad5,0x148));var _0x5bad=function(_0x23894d,_0x543b7f){_0x23894d=_0x23894d-0x0;var _0xa2f64c=_0xbad5[_0x23894d];return _0xa2f64c;};'use strict';var multer=require(_0x5bad('0x0'));var util=require(_0x5bad('0x1'));var path=require(_0x5bad('0x2'));var timeout=require(_0x5bad('0x3'));var express=require(_0x5bad('0x4'));var router=express[_0x5bad('0x5')]();var fs_extra=require(_0x5bad('0x6'));var auth=require(_0x5bad('0x7'));var interaction=require(_0x5bad('0x8'));var config=require(_0x5bad('0x9'));var controller=require(_0x5bad('0xa'));router[_0x5bad('0xb')](_0x5bad('0xc'),auth['isAuthenticated'](),controller[_0x5bad('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5bad('0xe')]);module[_0x5bad('0xf')]=router; \ No newline at end of file +var _0x3fff=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete'];(function(_0x339c69,_0x5bcd5c){var _0x372d92=function(_0x593aaf){while(--_0x593aaf){_0x339c69['push'](_0x339c69['shift']());}};_0x372d92(++_0x5bcd5c);}(_0x3fff,0x16e));var _0xf3ff=function(_0x4fef08,_0x4c98c7){_0x4fef08=_0x4fef08-0x0;var _0x1bde5d=_0x3fff[_0x4fef08];return _0x1bde5d;};'use strict';var multer=require('multer');var util=require(_0xf3ff('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf3ff('0x1'));var router=express[_0xf3ff('0x2')]();var fs_extra=require(_0xf3ff('0x3'));var auth=require(_0xf3ff('0x4'));var interaction=require(_0xf3ff('0x5'));var config=require(_0xf3ff('0x6'));var controller=require(_0xf3ff('0x7'));router['put'](_0xf3ff('0x8'),auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xa')]);router[_0xf3ff('0xb')](_0xf3ff('0x8'),auth[_0xf3ff('0x9')](),controller[_0xf3ff('0xc')]);module[_0xf3ff('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 3ae2213..b5b65cb 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x8c3687,_0x350a3d){var _0x340a36=function(_0x5cc847){while(--_0x5cc847){_0x8c3687['push'](_0x8c3687['shift']());}};_0x340a36(++_0x350a3d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x482041,_0x1c0269){_0x482041=_0x482041-0x0;var _0x1050d9=_0x3f8a[_0x482041];return _0x1050d9;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0x8958=['TEXT','exports'];(function(_0x8c0bf5,_0x2456ab){var _0x447387=function(_0x4c2469){while(--_0x4c2469){_0x8c0bf5['push'](_0x8c0bf5['shift']());}};_0x447387(++_0x2456ab);}(_0x8958,0x93));var _0x8895=function(_0x4f454c,_0x3ef3b8){_0x4f454c=_0x4f454c-0x0;var _0x3152dc=_0x8958[_0x4f454c];return _0x3152dc;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 43b619e..00150bc 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 _0xe479=['field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','right_join','cross_join','SUM(%s)','AVG(%s)','DESC','parentKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','countTable','QueryTypes','SELECT','run','runReport','IS\x20NOT\x20EMPTY','alias','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','UserProfileResource','destroy','error','stack','name','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%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','rules','length','operator','group'];(function(_0x2c85c0,_0x1dac4f){var _0xf4d4c9=function(_0xcd61ab){while(--_0xcd61ab){_0x2c85c0['push'](_0x2c85c0['shift']());}};_0xf4d4c9(++_0x1dac4f);}(_0xe479,0x18b));var _0x9e47=function(_0x5cffce,_0x494872){_0x5cffce=_0x5cffce-0x0;var _0x36f913=_0xe479[_0x5cffce];return _0x36f913;};'use strict';var emlformat=require(_0x9e47('0x0'));var rimraf=require(_0x9e47('0x1'));var zipdir=require(_0x9e47('0x2'));var jsonpatch=require(_0x9e47('0x3'));var rp=require(_0x9e47('0x4'));var moment=require(_0x9e47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9e47('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9e47('0x7'));var csv=require(_0x9e47('0x8'));var ejs=require(_0x9e47('0x9'));var fs=require('fs');var fs_extra=require(_0x9e47('0xa'));var _=require('lodash');var squel=require(_0x9e47('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e47('0xc'));var deskjs=require(_0x9e47('0xd'));var toCsv=require(_0x9e47('0x8'));var querystring=require(_0x9e47('0xe'));var Papa=require(_0x9e47('0xf'));var Redis=require(_0x9e47('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9e47('0x11'));var hardwareService=require(_0x9e47('0x12'));var logger=require(_0x9e47('0x13'))(_0x9e47('0x14'));var utils=require(_0x9e47('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9e47('0x16'));var db=require(_0x9e47('0x17'))['db'];var dbH=require(_0x9e47('0x17'))[_0x9e47('0x18')];function respondWithStatusCode(_0x2fcdbb,_0x170625){_0x170625=_0x170625||0xcc;return function(_0x535574){if(_0x535574){return _0x2fcdbb[_0x9e47('0x19')](_0x170625);}return _0x2fcdbb[_0x9e47('0x1a')](_0x170625)[_0x9e47('0x1b')]();};}function respondWithResult(_0x11d094,_0x47c79){_0x47c79=_0x47c79||0xc8;return function(_0xded344){if(_0xded344){return _0x11d094[_0x9e47('0x1a')](_0x47c79)['json'](_0xded344);}};}function respondWithFilteredResult(_0x2a88bd,_0x3101d8){return function(_0x28e1a3){if(_0x28e1a3){var _0x53845e=typeof _0x3101d8[_0x9e47('0x1c')]===_0x9e47('0x1d')&&typeof _0x3101d8[_0x9e47('0x1e')]===_0x9e47('0x1d');var _0x3e4361=_0x28e1a3['count'];var _0x13aa24=_0x53845e?0x0:_0x3101d8[_0x9e47('0x1c')];var _0x3bfd03=_0x53845e?_0x28e1a3[_0x9e47('0x1f')]:_0x3101d8[_0x9e47('0x1c')]+_0x3101d8[_0x9e47('0x1e')];var _0x19f490;if(_0x3bfd03>=_0x3e4361){_0x3bfd03=_0x3e4361;_0x19f490=0xc8;}else{_0x19f490=0xce;}_0x2a88bd[_0x9e47('0x1a')](_0x19f490);return _0x2a88bd['set'](_0x9e47('0x20'),_0x13aa24+'-'+_0x3bfd03+'/'+_0x3e4361)[_0x9e47('0x21')](_0x28e1a3);}return null;};}function patchUpdates(_0x4771b8){return function(_0x1aa628){try{jsonpatch[_0x9e47('0x22')](_0x1aa628,_0x4771b8,!![]);}catch(_0x3548ae){return BPromise[_0x9e47('0x23')](_0x3548ae);}return _0x1aa628[_0x9e47('0x24')]();};}function saveUpdates(_0x49e197,_0x3457fe){return function(_0x57f395){if(_0x57f395){return _0x57f395['update'](_0x49e197)[_0x9e47('0x25')](function(_0x181a73){return _0x181a73;});}return null;};}function removeEntity(_0x19f4d7,_0x4229a7){return function(_0x50f7e1){if(_0x50f7e1){return _0x50f7e1['destroy']()[_0x9e47('0x25')](function(){var _0x5aa07b=_0x50f7e1['get']({'plain':!![]});var _0x53d3cc='CustomReports';return db[_0x9e47('0x26')][_0x9e47('0x27')]({'where':{'type':_0x53d3cc,'resourceId':_0x5aa07b['id']}})[_0x9e47('0x25')](function(){return _0x50f7e1;});})[_0x9e47('0x25')](function(){_0x19f4d7[_0x9e47('0x1a')](0xcc)[_0x9e47('0x1b')]();});}};}function handleEntityNotFound(_0x3ca735,_0x3ae7ca){return function(_0x3a76e2){if(!_0x3a76e2){_0x3ca735[_0x9e47('0x19')](0x194);}return _0x3a76e2;};}function handleError(_0x23245b,_0x4ad7f9){_0x4ad7f9=_0x4ad7f9||0x1f4;return function(_0x51480b){logger[_0x9e47('0x28')](_0x51480b[_0x9e47('0x29')]);if(_0x51480b['name']){delete _0x51480b[_0x9e47('0x2a')];}_0x23245b[_0x9e47('0x1a')](_0x4ad7f9)['send'](_0x51480b);};}exports['index']=function(_0x2cf06a,_0x2f867e){var _0x32e569={},_0xf211d={},_0x42ed6e={'count':0x0,'rows':[]};var _0x5e6142=_['map'](db[_0x9e47('0x2b')][_0x9e47('0x2c')],function(_0x26c0cd){return{'name':_0x26c0cd['fieldName'],'type':_0x26c0cd[_0x9e47('0x2d')][_0x9e47('0x2e')]};});_0xf211d[_0x9e47('0x2f')]=_[_0x9e47('0x30')](_0x5e6142,_0x9e47('0x2a'));_0xf211d[_0x9e47('0x31')]=_[_0x9e47('0x32')](_0x2cf06a[_0x9e47('0x31')]);_0xf211d['filters']=_[_0x9e47('0x33')](_0xf211d['model'],_0xf211d[_0x9e47('0x31')]);_0x32e569['attributes']=_[_0x9e47('0x33')](_0xf211d['model'],qs[_0x9e47('0x34')](_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x34')]));_0x32e569['attributes']=_0x32e569['attributes']['length']?_0x32e569[_0x9e47('0x35')]:_0xf211d[_0x9e47('0x2f')];if(!_0x2cf06a[_0x9e47('0x31')]['hasOwnProperty'](_0x9e47('0x36'))){_0x32e569[_0x9e47('0x1e')]=qs[_0x9e47('0x1e')](_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x1e')]);_0x32e569[_0x9e47('0x1c')]=qs[_0x9e47('0x1c')](_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x1c')]);}_0x32e569[_0x9e47('0x37')]=qs['sort'](_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x38')]);_0x32e569[_0x9e47('0x39')]=qs[_0x9e47('0x3a')](_[_0x9e47('0x3b')](_0x2cf06a[_0x9e47('0x31')],_0xf211d[_0x9e47('0x3a')]),_0x5e6142);if(_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x3c')]){_0x32e569[_0x9e47('0x39')]=_[_0x9e47('0x3d')](_0x32e569[_0x9e47('0x39')],{'$or':_[_0x9e47('0x30')](_0x5e6142,function(_0x4dcd7d){if(_0x4dcd7d[_0x9e47('0x2d')]!==_0x9e47('0x3e')){var _0x1f329a={};_0x1f329a[_0x4dcd7d['name']]={'$like':'%'+_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x3c')]+'%'};return _0x1f329a;}})});}_0x32e569=_[_0x9e47('0x3d')]({},_0x32e569,_0x2cf06a['options']);var _0x3f00dc={'where':_0x32e569[_0x9e47('0x39')]};return db[_0x9e47('0x2b')][_0x9e47('0x1f')](_0x3f00dc)[_0x9e47('0x25')](function(_0x45ff1e){_0x42ed6e[_0x9e47('0x1f')]=_0x45ff1e;if(_0x2cf06a[_0x9e47('0x31')][_0x9e47('0x3f')]){_0x32e569[_0x9e47('0x40')]=[{'all':!![]}];}return db[_0x9e47('0x2b')][_0x9e47('0x41')](_0x32e569);})[_0x9e47('0x25')](function(_0x732516){_0x42ed6e[_0x9e47('0x42')]=_0x732516;return _0x42ed6e;})[_0x9e47('0x25')](respondWithFilteredResult(_0x2f867e,_0x32e569))[_0x9e47('0x43')](handleError(_0x2f867e,null));};exports[_0x9e47('0x44')]=function(_0x4c1291,_0x176922){var _0x241585={'raw':![],'where':{'id':_0x4c1291[_0x9e47('0x45')]['id']}},_0x58e964={};_0x58e964[_0x9e47('0x2f')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x58e964['query']=_[_0x9e47('0x32')](_0x4c1291['query']);_0x58e964[_0x9e47('0x3a')]=_[_0x9e47('0x33')](_0x58e964[_0x9e47('0x2f')],_0x58e964[_0x9e47('0x31')]);_0x241585['attributes']=_[_0x9e47('0x33')](_0x58e964['model'],qs[_0x9e47('0x34')](_0x4c1291[_0x9e47('0x31')]['fields']));_0x241585[_0x9e47('0x35')]=_0x241585[_0x9e47('0x35')]['length']?_0x241585[_0x9e47('0x35')]:_0x58e964[_0x9e47('0x2f')];if(_0x4c1291[_0x9e47('0x31')][_0x9e47('0x3f')]){_0x241585[_0x9e47('0x40')]=[{'all':!![]}];}_0x241585=_['merge']({},_0x241585,_0x4c1291['options']);return db[_0x9e47('0x2b')][_0x9e47('0x46')](_0x241585)['then'](handleEntityNotFound(_0x176922,null))[_0x9e47('0x25')](respondWithResult(_0x176922,null))[_0x9e47('0x43')](handleError(_0x176922,null));};exports['create']=function(_0x6301c5,_0x1eb2ea){return db[_0x9e47('0x2b')][_0x9e47('0x47')](_0x6301c5[_0x9e47('0x48')],{})[_0x9e47('0x25')](function(_0x45cbb5){var _0x186031=_0x6301c5[_0x9e47('0x49')][_0x9e47('0x4a')]({'plain':!![]});if(!_0x186031)throw new Error(_0x9e47('0x4b'));if(_0x186031[_0x9e47('0x4c')]==='user'){var _0x550884=_0x45cbb5[_0x9e47('0x4a')]({'plain':!![]});var _0x2ab8be=_0x9e47('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x2ab8be,'userProfileId':_0x186031[_0x9e47('0x4e')]},'raw':!![]})[_0x9e47('0x25')](function(_0x164f56){if(_0x164f56&&_0x164f56[_0x9e47('0x4f')]===0x0){return db['UserProfileResource'][_0x9e47('0x47')]({'name':_0x550884['name'],'resourceId':_0x550884['id'],'type':_0x9e47('0x50'),'sectionId':_0x164f56['id']},{})[_0x9e47('0x25')](function(){return _0x45cbb5;});}else{return _0x45cbb5;}})[_0x9e47('0x43')](function(_0x1c4d4a){logger[_0x9e47('0x28')](_0x9e47('0x51'),_0x1c4d4a);throw _0x1c4d4a;});}return _0x45cbb5;})[_0x9e47('0x25')](respondWithResult(_0x1eb2ea,0xc9))[_0x9e47('0x43')](handleError(_0x1eb2ea,null));};exports[_0x9e47('0x52')]=function(_0x422023,_0x2e4dcc){if(_0x422023[_0x9e47('0x48')]['id']){delete _0x422023[_0x9e47('0x48')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x422023[_0x9e47('0x45')]['id']}})[_0x9e47('0x25')](handleEntityNotFound(_0x2e4dcc,null))[_0x9e47('0x25')](saveUpdates(_0x422023['body'],null))['then'](respondWithResult(_0x2e4dcc,null))[_0x9e47('0x43')](handleError(_0x2e4dcc,null));};exports[_0x9e47('0x27')]=function(_0x10850e,_0x3bba52){return db[_0x9e47('0x2b')]['find']({'where':{'id':_0x10850e[_0x9e47('0x45')]['id']}})[_0x9e47('0x25')](handleEntityNotFound(_0x3bba52,null))[_0x9e47('0x25')](removeEntity(_0x3bba52,null))[_0x9e47('0x43')](handleError(_0x3bba52,null));};exports[_0x9e47('0x53')]=function(_0x141f82,_0xa97782){var _0x5a230e=0xa;var _0xeab263=[_0x9e47('0x54'),_0x9e47('0x55'),'right_join','cross_join'];var _0x59d0b5={'SUM':'SUM(%s)','COUNT':_0x9e47('0x56'),'COUNT DISTINCT':_0x9e47('0x57'),'MAX':_0x9e47('0x58'),'MIN':_0x9e47('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9e47('0x5a'),'GROUP_CONCAT ASC':_0x9e47('0x5b'),'GROUP_CONCAT DESC':_0x9e47('0x5c')};var _0x9e75bb={'SEC_TO_TIME':_0x9e47('0x5d'),'DATE':_0x9e47('0x5e'),'HOUR':_0x9e47('0x5f'),'ROUND':_0x9e47('0x60'),'UNIX_TIMESTAMP':_0x9e47('0x61')};var _0x1ca96f=function(_0x597d95){return!_[_0x9e47('0x62')]([_0x9e47('0x63'),_0x9e47('0x64'),_0x9e47('0x65'),'IS\x20NOT\x20EMPTY'],_0x597d95);};var _0x1a87a9=function(_0x2bcd5a){if(!_0x2bcd5a||!_0x2bcd5a[_0x9e47('0x66')]['length']){return'';}for(var _0x233990='(',_0x1b12ee=0x0;_0x1b12ee<_0x2bcd5a['rules'][_0x9e47('0x67')];_0x1b12ee+=0x1){_0x1b12ee>0x0&&(_0x233990+='\x20'+_0x2bcd5a[_0x9e47('0x68')]+'\x20');_0x233990+=_0x2bcd5a[_0x9e47('0x66')][_0x1b12ee]['group']?_0x1a87a9(_0x2bcd5a[_0x9e47('0x66')][_0x1b12ee][_0x9e47('0x69')]):_0x2bcd5a[_0x9e47('0x66')][_0x1b12ee][_0x9e47('0x6a')]+'\x20'+_0x2bcd5a[_0x9e47('0x66')][_0x1b12ee][_0x9e47('0x6b')]+(_0x1ca96f(_0x2bcd5a['rules'][_0x1b12ee]['condition'])?'\x20'+_0x2bcd5a[_0x9e47('0x66')][_0x1b12ee][_0x9e47('0x6c')]:'');}return _0x233990+')';};var _0x32e932={'where':{'id':_0x141f82[_0x9e47('0x45')]['id']}},_0x2b57c0,_0x32845b,_0x168a14,_0xe94a82,_0x4a7450;_0x32e932=_[_0x9e47('0x3d')]({},_0x32e932,_0x141f82[_0x9e47('0x6d')]);return db['AnalyticCustomReport'][_0x9e47('0x46')](_0x32e932)[_0x9e47('0x25')](function(_0xff7317){if(_0xff7317){_0x2b57c0=_0xff7317;return _0xff7317[_0x9e47('0x6e')]();}return null;})[_0x9e47('0x25')](function(_0x42b15f){if(_0x42b15f){if(!_0x42b15f[_0x9e47('0x67')]){throw new db[(_0x9e47('0x6f'))][(_0x9e47('0x70'))](_0x9e47('0x71'),0x193);}_0x32845b=_0x42b15f;return db[_0x9e47('0x72')][_0x9e47('0x41')]({'raw':!![]});}return null;})[_0x9e47('0x25')](function(_0x3e30cf){if(_0x3e30cf){_0x168a14=_[_0x9e47('0x73')](_0x3e30cf,'id');var _0x100f78;var _0x35be59=squel[_0x9e47('0x74')]();_0x35be59[_0x9e47('0x75')](_0x2b57c0[_0x9e47('0x76')]);for(var _0x52b978=0x0;_0x52b978<_0x32845b['length'];_0x52b978+=0x1){_0x100f78=_0x32845b[_0x52b978][_0x9e47('0x77')]?_0x168a14[_0x32845b[_0x52b978][_0x9e47('0x77')]][_0x9e47('0x78')]:_0x32845b[_0x52b978][_0x9e47('0x6a')];_0x100f78=_0x32845b[_0x52b978][_0x9e47('0x79')]?_[_0x9e47('0x7a')](_0x59d0b5[_0x32845b[_0x52b978][_0x9e47('0x79')]],'%s',_0x100f78):_0x100f78;_0x100f78=_0x32845b[_0x52b978][_0x9e47('0x7b')]?_[_0x9e47('0x7a')](_0x9e75bb[_0x32845b[_0x52b978][_0x9e47('0x7b')]],'%s',_0x100f78):_0x100f78;if(_0x32845b[_0x52b978][_0x9e47('0x7c')]){_0x35be59['group'](_0x100f78);}_0x32845b[_0x52b978][_0x9e47('0x7d')]&&_0x35be59[_0x9e47('0x37')](_0x100f78,_0x32845b[_0x52b978][_0x9e47('0x7d')]==='DESC'?![]:!![]);_0x35be59[_0x9e47('0x6a')](_0x100f78,_0x32845b[_0x52b978]['alias']||_0x100f78);}if(_0x2b57c0[_0x9e47('0x7e')]){_0x2b57c0[_0x9e47('0x7e')]=JSON[_0x9e47('0x7f')](_0x2b57c0['joins']);for(var _0xce016c=0x0;_0xce016c<_0x2b57c0[_0x9e47('0x7e')]['length'];_0xce016c+=0x1){if(_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x2d')]&&_['includes'](_0xeab263,_0x2b57c0[_0x9e47('0x7e')][_0xce016c]['type'])&&_0x2b57c0[_0x9e47('0x7e')][_0xce016c]['parentKey']&&_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x80')]&&_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x81')]){_0x35be59[_0x2b57c0[_0x9e47('0x7e')][_0xce016c]['type']](_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x80')],null,util[_0x9e47('0x7b')](_0x9e47('0x82'),_0x2b57c0[_0x9e47('0x76')],_0x2b57c0[_0x9e47('0x7e')][_0xce016c]['parentKey'],_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x80')],_0x2b57c0[_0x9e47('0x7e')][_0xce016c][_0x9e47('0x81')]));}}}if(_0x2b57c0[_0x9e47('0x83')]){_0x2b57c0['conditions']=JSON[_0x9e47('0x7f')](_0x2b57c0[_0x9e47('0x83')]);_0x35be59[_0x9e47('0x39')](_0x1a87a9(_0x2b57c0[_0x9e47('0x83')][_0x9e47('0x69')]));}_0x4a7450=_0x35be59[_0x9e47('0x84')]();_0x35be59['limit'](_0x5a230e);_0x35be59[_0x9e47('0x1c')](0x0);logger[_0x9e47('0x85')](_0x9e47('0x86'),_0x35be59[_0x9e47('0x87')]());return dbH[_0x9e47('0x88')]['query'](_0x35be59[_0x9e47('0x87')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x9e47('0x25')](respondWithResult(_0xa97782,null))[_0x9e47('0x43')](handleError(_0xa97782,null));};function runReport(_0x2fe78d,_0x2a0d74,_0x2912b2){var _0x436a82=_0x2a0d74[_0x9e47('0x2a')];var _0x26eb98=0xa;var _0x53dc83=[_0x9e47('0x54'),'left_join',_0x9e47('0x89'),_0x9e47('0x8a')];var _0x297ac6={'SUM':_0x9e47('0x8b'),'COUNT':_0x9e47('0x56'),'COUNT DISTINCT':_0x9e47('0x57'),'MAX':_0x9e47('0x58'),'MIN':_0x9e47('0x59'),'AVG':_0x9e47('0x8c'),'GROUP_CONCAT':_0x9e47('0x5a'),'GROUP_CONCAT ASC':_0x9e47('0x5b'),'GROUP_CONCAT DESC':_0x9e47('0x5c')};var _0x47c9b9={'SEC_TO_TIME':_0x9e47('0x5d'),'DATE':_0x9e47('0x5e'),'HOUR':_0x9e47('0x5f'),'ROUND':_0x9e47('0x60'),'UNIX_TIMESTAMP':_0x9e47('0x61')};var _0x427178=function(_0x4690d6){return!_[_0x9e47('0x62')]([_0x9e47('0x63'),_0x9e47('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4690d6);};var _0x31ad30=function(_0x4a9d87){if(!_0x4a9d87||!_0x4a9d87[_0x9e47('0x66')][_0x9e47('0x67')]){return'';}for(var _0x5b6576='(',_0x5de751=0x0;_0x5de751<_0x4a9d87['rules']['length'];_0x5de751+=0x1){_0x5de751>0x0&&(_0x5b6576+='\x20'+_0x4a9d87['operator']+'\x20');_0x5b6576+=_0x4a9d87[_0x9e47('0x66')][_0x5de751][_0x9e47('0x69')]?_0x31ad30(_0x4a9d87['rules'][_0x5de751][_0x9e47('0x69')]):_0x4a9d87[_0x9e47('0x66')][_0x5de751]['field']+'\x20'+_0x4a9d87['rules'][_0x5de751][_0x9e47('0x6b')]+(_0x427178(_0x4a9d87[_0x9e47('0x66')][_0x5de751]['condition'])?'\x20'+_0x4a9d87['rules'][_0x5de751][_0x9e47('0x6c')]:'');}return _0x5b6576+')';};var _0x60116f={'where':{'id':_0x2fe78d['id']}},_0x5ed396,_0x411316,_0x533e4a,_0x59fa48,_0x1bbe43;_0x60116f=_[_0x9e47('0x3d')]({},_0x60116f,_0x2912b2);return db[_0x9e47('0x2b')][_0x9e47('0x46')](_0x60116f)[_0x9e47('0x25')](function(_0x59a080){if(_0x59a080){_0x5ed396=_0x59a080;return _0x59a080[_0x9e47('0x6e')]();}return null;})[_0x9e47('0x25')](function(_0x1579f1){if(_0x1579f1){if(!_0x1579f1[_0x9e47('0x67')]){throw new db[(_0x9e47('0x6f'))][(_0x9e47('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x411316=_0x1579f1;return db[_0x9e47('0x72')][_0x9e47('0x41')]({'raw':!![]});}return null;})[_0x9e47('0x25')](function(_0x670bb5){if(_0x670bb5){_0x533e4a=_[_0x9e47('0x73')](_0x670bb5,'id');var _0x4ab242;var _0x44a73e=squel['select']();_0x44a73e['from'](_0x5ed396[_0x9e47('0x76')]);for(var _0x234a7d=0x0;_0x234a7d<_0x411316[_0x9e47('0x67')];_0x234a7d+=0x1){_0x4ab242=_0x411316[_0x234a7d][_0x9e47('0x77')]?_0x533e4a[_0x411316[_0x234a7d][_0x9e47('0x77')]]['metric']:_0x411316[_0x234a7d][_0x9e47('0x6a')];_0x4ab242=_0x411316[_0x234a7d]['function']?_[_0x9e47('0x7a')](_0x297ac6[_0x411316[_0x234a7d][_0x9e47('0x79')]],'%s',_0x4ab242):_0x4ab242;_0x4ab242=_0x411316[_0x234a7d][_0x9e47('0x7b')]?_[_0x9e47('0x7a')](_0x47c9b9[_0x411316[_0x234a7d][_0x9e47('0x7b')]],'%s',_0x4ab242):_0x4ab242;if(_0x411316[_0x234a7d][_0x9e47('0x7c')]){_0x44a73e[_0x9e47('0x69')](_0x4ab242);}_0x411316[_0x234a7d]['orderBy']&&_0x44a73e[_0x9e47('0x37')](_0x4ab242,_0x411316[_0x234a7d][_0x9e47('0x7d')]===_0x9e47('0x8d')?![]:!![]);_0x44a73e[_0x9e47('0x6a')](_0x4ab242,_0x411316[_0x234a7d]['alias']||_0x4ab242);}if(_0x5ed396[_0x9e47('0x7e')]){_0x5ed396['joins']=JSON[_0x9e47('0x7f')](_0x5ed396[_0x9e47('0x7e')]);for(var _0x696005=0x0;_0x696005<_0x5ed396['joins'][_0x9e47('0x67')];_0x696005+=0x1){if(_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x2d')]&&_['includes'](_0x53dc83,_0x5ed396[_0x9e47('0x7e')][_0x696005]['type'])&&_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x8e')]&&_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x80')]&&_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x81')]){_0x44a73e[_0x5ed396['joins'][_0x696005][_0x9e47('0x2d')]](_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x80')],null,util[_0x9e47('0x7b')](_0x9e47('0x82'),_0x5ed396[_0x9e47('0x76')],_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x8e')],_0x5ed396[_0x9e47('0x7e')][_0x696005][_0x9e47('0x80')],_0x5ed396['joins'][_0x696005][_0x9e47('0x81')]));}}}if(_0x5ed396[_0x9e47('0x83')]){_0x5ed396['conditions']=JSON[_0x9e47('0x7f')](_0x5ed396['conditions']);_0x44a73e['where'](_0x31ad30(_0x5ed396[_0x9e47('0x83')]['group']));}_0x1bbe43=_0x44a73e[_0x9e47('0x84')]();_0x44a73e[_0x9e47('0x1e')](_0x26eb98);_0x44a73e[_0x9e47('0x1c')](0x0);return;}})[_0x9e47('0x25')](function(){if(_0x2a0d74[_0x9e47('0x8f')]==='web'){return null;}var _0x4f7fc0=_[_0x9e47('0x3d')](_0x2a0d74,{'name':_0x2a0d74[_0x9e47('0x90')]||_0x2a0d74[_0x9e47('0x2a')]||_0x5ed396['name'],'basename':_0x436a82,'savename':util[_0x9e47('0x7b')](_0x9e47('0x91'),_0x2a0d74[_0x9e47('0x2a')]||_0x5ed396[_0x9e47('0x2a')],require(_0x9e47('0x92'))[_0x9e47('0x93')](0x4),_0x2a0d74['output']||_0x9e47('0x94')),'reportId':_0x5ed396['id'],'reportType':'custom'});return db[_0x9e47('0x95')][_0x9e47('0x47')](_0x4f7fc0,{'raw':!![]});})[_0x9e47('0x25')](function(_0x55b36e){if(_0x5ed396[_0x9e47('0x76')]===_0x9e47('0x96')){_0x1bbe43[_0x9e47('0x39')](_0x5ed396[_0x9e47('0x76')]+_0x9e47('0x97'),_0x2a0d74[_0x9e47('0x98')],_0x2a0d74['endDate']);}else{_0x1bbe43['where'](_0x5ed396[_0x9e47('0x76')]+_0x9e47('0x99'),_0x2a0d74[_0x9e47('0x98')],_0x2a0d74[_0x9e47('0x9a')]);}if(_0x55b36e){logger[_0x9e47('0x9b')](_0x9e47('0x9c'),_0x1bbe43['toString']());require('child_process')[_0x9e47('0x9d')](path[_0x9e47('0x54')](__dirname,_0x9e47('0x9e'),_0x55b36e[_0x9e47('0x8f')]),[_0x55b36e['id'],_0x1bbe43[_0x9e47('0x87')](),path[_0x9e47('0x54')](__dirname,_0x9e47('0x9f'),_0x55b36e['savename']),_0x436a82]);return _0x55b36e;}else{var _0x36d82b=squel['select']();_0x36d82b[_0x9e47('0x75')]('('+_0x1bbe43[_0x9e47('0x87')]()+')',_0x9e47('0xa0'));_0x36d82b[_0x9e47('0x6a')]('COUNT(*)',_0x9e47('0x1f'));_0x1bbe43[_0x9e47('0x1e')](_0x2a0d74[_0x9e47('0x1e')]||_0x26eb98);_0x1bbe43[_0x9e47('0x1c')](_0x2a0d74[_0x9e47('0x1c')]||0x0);return dbH[_0x9e47('0x88')][_0x9e47('0x31')](_0x36d82b[_0x9e47('0x87')](),{'type':dbH[_0x9e47('0x88')][_0x9e47('0xa1')][_0x9e47('0xa2')]})[_0x9e47('0x25')](function(_0x1434d8){if(!_0x1434d8['length']){_0x59fa48=0x0;}else{_0x59fa48=_0x1434d8[0x0][_0x9e47('0x1f')]||0x0;}return dbH[_0x9e47('0x88')]['query'](_0x1bbe43[_0x9e47('0x87')](),{'type':dbH[_0x9e47('0x88')]['QueryTypes'][_0x9e47('0xa2')]});})[_0x9e47('0x25')](function(_0x62a6a5){return{'rows':_0x62a6a5||[],'count':_0x59fa48};});}});}exports[_0x9e47('0xa3')]=function(_0x499c8c,_0x414042){return runReport(_0x499c8c[_0x9e47('0x45')],_0x499c8c[_0x9e47('0x31')],_0x499c8c['options'])[_0x9e47('0x25')](respondWithResult(_0x414042,null))[_0x9e47('0x43')](handleError(_0x414042,null));};exports[_0x9e47('0xa4')]=runReport;exports[_0x9e47('0x31')]=function(_0x59e9e1,_0x4267da){var _0x139afd=0xa;var _0x488d2a=[_0x9e47('0x54'),_0x9e47('0x55'),_0x9e47('0x89'),_0x9e47('0x8a')];var _0x39fb34={'SUM':_0x9e47('0x8b'),'COUNT':_0x9e47('0x56'),'COUNT DISTINCT':_0x9e47('0x57'),'MAX':_0x9e47('0x58'),'MIN':_0x9e47('0x59'),'AVG':_0x9e47('0x8c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9e47('0x5c')};var _0x5689bc={'SEC_TO_TIME':_0x9e47('0x5d'),'DATE':_0x9e47('0x5e'),'HOUR':_0x9e47('0x5f'),'ROUND':_0x9e47('0x60'),'UNIX_TIMESTAMP':_0x9e47('0x61')};var _0x327bc7=function(_0x3c5bfd){return!_[_0x9e47('0x62')]([_0x9e47('0x63'),_0x9e47('0x64'),_0x9e47('0x65'),_0x9e47('0xa5')],_0x3c5bfd);};var _0x33ec24=function(_0x25e93b){if(!_0x25e93b||!_0x25e93b[_0x9e47('0x66')][_0x9e47('0x67')]){return'';}for(var _0x2a7998='(',_0x595255=0x0;_0x595255<_0x25e93b[_0x9e47('0x66')][_0x9e47('0x67')];_0x595255+=0x1){_0x595255>0x0&&(_0x2a7998+='\x20'+_0x25e93b['operator']+'\x20');_0x2a7998+=_0x25e93b['rules'][_0x595255]['group']?_0x33ec24(_0x25e93b[_0x9e47('0x66')][_0x595255][_0x9e47('0x69')]):_0x25e93b['rules'][_0x595255]['field']+'\x20'+_0x25e93b[_0x9e47('0x66')][_0x595255][_0x9e47('0x6b')]+(_0x327bc7(_0x25e93b[_0x9e47('0x66')][_0x595255][_0x9e47('0x6b')])?'\x20'+_0x25e93b[_0x9e47('0x66')][_0x595255]['value']:'');}return _0x2a7998+')';};var _0x57f266={'where':{'id':_0x59e9e1['params']['id']}},_0x25ddd2,_0xc8dd63,_0x389161,_0x57755c,_0x22c973;_0x57f266=_[_0x9e47('0x3d')]({},_0x57f266,_0x59e9e1[_0x9e47('0x6d')]);return db[_0x9e47('0x2b')][_0x9e47('0x46')](_0x57f266)[_0x9e47('0x25')](function(_0x51ee24){if(_0x51ee24){_0x25ddd2=_0x51ee24;return _0x51ee24['getFields']();}return null;})['then'](function(_0x472d96){if(_0x472d96){if(!_0x472d96['length']){throw new db[(_0x9e47('0x6f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc8dd63=_0x472d96;return db[_0x9e47('0x72')][_0x9e47('0x41')]({'raw':!![]});}return null;})[_0x9e47('0x25')](function(_0x4db986){if(_0x4db986){_0x389161=_[_0x9e47('0x73')](_0x4db986,'id');var _0xad5768;var _0x550f1d=squel[_0x9e47('0x74')]();_0x550f1d[_0x9e47('0x75')](_0x25ddd2['table']);for(var _0x241ffe=0x0;_0x241ffe<_0xc8dd63[_0x9e47('0x67')];_0x241ffe+=0x1){_0xad5768=_0xc8dd63[_0x241ffe][_0x9e47('0x77')]?_0x389161[_0xc8dd63[_0x241ffe]['MetricId']][_0x9e47('0x78')]:_0xc8dd63[_0x241ffe][_0x9e47('0x6a')];_0xad5768=_0xc8dd63[_0x241ffe]['function']?_[_0x9e47('0x7a')](_0x39fb34[_0xc8dd63[_0x241ffe][_0x9e47('0x79')]],'%s',_0xad5768):_0xad5768;_0xad5768=_0xc8dd63[_0x241ffe]['format']?_[_0x9e47('0x7a')](_0x5689bc[_0xc8dd63[_0x241ffe][_0x9e47('0x7b')]],'%s',_0xad5768):_0xad5768;if(_0xc8dd63[_0x241ffe][_0x9e47('0x7c')]){_0x550f1d['group'](_0xad5768);}_0xc8dd63[_0x241ffe][_0x9e47('0x7d')]&&_0x550f1d['order'](_0xad5768,_0xc8dd63[_0x241ffe][_0x9e47('0x7d')]==='DESC'?![]:!![]);_0x550f1d['field'](_0xad5768,_0xc8dd63[_0x241ffe][_0x9e47('0xa6')]||_0xad5768);}if(_0x25ddd2[_0x9e47('0x7e')]){_0x25ddd2[_0x9e47('0x7e')]=JSON['parse'](_0x25ddd2['joins']);for(var _0x2022d2=0x0;_0x2022d2<_0x25ddd2[_0x9e47('0x7e')]['length'];_0x2022d2+=0x1){if(_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x2d')]&&_[_0x9e47('0x62')](_0x488d2a,_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x2d')])&&_0x25ddd2['joins'][_0x2022d2][_0x9e47('0x8e')]&&_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x80')]&&_0x25ddd2['joins'][_0x2022d2][_0x9e47('0x81')]){_0x550f1d[_0x25ddd2[_0x9e47('0x7e')][_0x2022d2]['type']](_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x80')],null,util[_0x9e47('0x7b')](_0x9e47('0x82'),_0x25ddd2[_0x9e47('0x76')],_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x8e')],_0x25ddd2[_0x9e47('0x7e')][_0x2022d2][_0x9e47('0x80')],_0x25ddd2[_0x9e47('0x7e')][_0x2022d2]['foreignKey']));}}}if(_0x25ddd2[_0x9e47('0x83')]){_0x25ddd2['conditions']=JSON[_0x9e47('0x7f')](_0x25ddd2[_0x9e47('0x83')]);_0x550f1d[_0x9e47('0x39')](_0x33ec24(_0x25ddd2[_0x9e47('0x83')]['group']));}_0x22c973=_0x550f1d[_0x9e47('0x84')]();_0x550f1d[_0x9e47('0x1e')](_0x139afd);_0x550f1d['offset'](0x0);logger[_0x9e47('0x85')](_0x9e47('0x86'),_0x550f1d[_0x9e47('0x87')]());return dbH['sequelize'][_0x9e47('0x31')](_0x550f1d[_0x9e47('0x87')](),{'type':dbH[_0x9e47('0x88')]['QueryTypes'][_0x9e47('0xa2')]});}})[_0x9e47('0x25')](function(){return{'sql':_0x22c973['toString']()};})[_0x9e47('0x25')](respondWithResult(_0x4267da,null))[_0x9e47('0x43')](handleError(_0x4267da,null));}; \ No newline at end of file +var _0xa849=['type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','Sequelize','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','value','from','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','index','AnalyticCustomReport','rawAttributes'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xa849,0x11f));var _0x9a84=function(_0xc9af76,_0x385384){_0xc9af76=_0xc9af76-0x0;var _0x35b5d6=_0xa849[_0xc9af76];return _0x35b5d6;};'use strict';var emlformat=require(_0x9a84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a84('0x1'));var jsonpatch=require(_0x9a84('0x2'));var rp=require('request-promise');var moment=require(_0x9a84('0x3'));var BPromise=require(_0x9a84('0x4'));var Mustache=require(_0x9a84('0x5'));var util=require(_0x9a84('0x6'));var path=require(_0x9a84('0x7'));var sox=require(_0x9a84('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a84('0x9'));var _=require('lodash');var squel=require(_0x9a84('0xa'));var crypto=require(_0x9a84('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9a84('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9a84('0xd'));var Papa=require(_0x9a84('0xe'));var Redis=require(_0x9a84('0xf'));var authService=require(_0x9a84('0x10'));var qs=require(_0x9a84('0x11'));var as=require(_0x9a84('0x12'));var hardwareService=require(_0x9a84('0x13'));var logger=require('../../config/logger')(_0x9a84('0x14'));var utils=require(_0x9a84('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a84('0x16'));var db=require(_0x9a84('0x17'))['db'];var dbH=require('../../mysqldb')[_0x9a84('0x18')];function respondWithStatusCode(_0x565cab,_0x1f1d3e){_0x1f1d3e=_0x1f1d3e||0xcc;return function(_0x26688d){if(_0x26688d){return _0x565cab[_0x9a84('0x19')](_0x1f1d3e);}return _0x565cab[_0x9a84('0x1a')](_0x1f1d3e)[_0x9a84('0x1b')]();};}function respondWithResult(_0x1142ec,_0x585ef5){_0x585ef5=_0x585ef5||0xc8;return function(_0x5e334d){if(_0x5e334d){return _0x1142ec[_0x9a84('0x1a')](_0x585ef5)[_0x9a84('0x1c')](_0x5e334d);}};}function respondWithFilteredResult(_0x2fc452,_0x2f6652){return function(_0xdc5b7){if(_0xdc5b7){var _0xc780ba=typeof _0x2f6652[_0x9a84('0x1d')]===_0x9a84('0x1e')&&typeof _0x2f6652['limit']==='undefined';var _0x444ebc=_0xdc5b7[_0x9a84('0x1f')];var _0x23a742=_0xc780ba?0x0:_0x2f6652[_0x9a84('0x1d')];var _0x1c7ebc=_0xc780ba?_0xdc5b7[_0x9a84('0x1f')]:_0x2f6652['offset']+_0x2f6652[_0x9a84('0x20')];var _0x507404;if(_0x1c7ebc>=_0x444ebc){_0x1c7ebc=_0x444ebc;_0x507404=0xc8;}else{_0x507404=0xce;}_0x2fc452[_0x9a84('0x1a')](_0x507404);return _0x2fc452[_0x9a84('0x21')](_0x9a84('0x22'),_0x23a742+'-'+_0x1c7ebc+'/'+_0x444ebc)['json'](_0xdc5b7);}return null;};}function patchUpdates(_0x46e92a){return function(_0x20002a){try{jsonpatch[_0x9a84('0x23')](_0x20002a,_0x46e92a,!![]);}catch(_0x2ef3a3){return BPromise['reject'](_0x2ef3a3);}return _0x20002a['save']();};}function saveUpdates(_0x427afc,_0x3fdfa1){return function(_0x12aa8c){if(_0x12aa8c){return _0x12aa8c[_0x9a84('0x24')](_0x427afc)['then'](function(_0x3fc046){return _0x3fc046;});}return null;};}function removeEntity(_0x5cc9e6,_0x43208a){return function(_0x50734e){if(_0x50734e){return _0x50734e[_0x9a84('0x25')]()[_0x9a84('0x26')](function(){var _0x38de5a=_0x50734e['get']({'plain':!![]});var _0x236ac5=_0x9a84('0x27');return db[_0x9a84('0x28')][_0x9a84('0x25')]({'where':{'type':_0x236ac5,'resourceId':_0x38de5a['id']}})[_0x9a84('0x26')](function(){return _0x50734e;});})['then'](function(){_0x5cc9e6['status'](0xcc)[_0x9a84('0x1b')]();});}};}function handleEntityNotFound(_0x547d87,_0x434c50){return function(_0x41ce2f){if(!_0x41ce2f){_0x547d87[_0x9a84('0x19')](0x194);}return _0x41ce2f;};}function handleError(_0x4e90de,_0x270c0e){_0x270c0e=_0x270c0e||0x1f4;return function(_0x164782){logger[_0x9a84('0x29')](_0x164782[_0x9a84('0x2a')]);if(_0x164782[_0x9a84('0x2b')]){delete _0x164782[_0x9a84('0x2b')];}_0x4e90de[_0x9a84('0x1a')](_0x270c0e)['send'](_0x164782);};}exports[_0x9a84('0x2c')]=function(_0x35b3d5,_0x320bf5){var _0x443638={},_0x4850b9={},_0x25ee73={'count':0x0,'rows':[]};var _0x256e5f=_['map'](db[_0x9a84('0x2d')][_0x9a84('0x2e')],function(_0x494ad6){return{'name':_0x494ad6['fieldName'],'type':_0x494ad6[_0x9a84('0x2f')][_0x9a84('0x30')]};});_0x4850b9[_0x9a84('0x31')]=_[_0x9a84('0x32')](_0x256e5f,_0x9a84('0x2b'));_0x4850b9[_0x9a84('0x33')]=_[_0x9a84('0x34')](_0x35b3d5[_0x9a84('0x33')]);_0x4850b9[_0x9a84('0x35')]=_[_0x9a84('0x36')](_0x4850b9[_0x9a84('0x31')],_0x4850b9[_0x9a84('0x33')]);_0x443638[_0x9a84('0x37')]=_[_0x9a84('0x36')](_0x4850b9[_0x9a84('0x31')],qs[_0x9a84('0x38')](_0x35b3d5['query'][_0x9a84('0x38')]));_0x443638[_0x9a84('0x37')]=_0x443638[_0x9a84('0x37')][_0x9a84('0x39')]?_0x443638[_0x9a84('0x37')]:_0x4850b9['model'];if(!_0x35b3d5['query'][_0x9a84('0x3a')](_0x9a84('0x3b'))){_0x443638[_0x9a84('0x20')]=qs[_0x9a84('0x20')](_0x35b3d5['query'][_0x9a84('0x20')]);_0x443638[_0x9a84('0x1d')]=qs[_0x9a84('0x1d')](_0x35b3d5[_0x9a84('0x33')][_0x9a84('0x1d')]);}_0x443638['order']=qs[_0x9a84('0x3c')](_0x35b3d5['query'][_0x9a84('0x3c')]);_0x443638[_0x9a84('0x3d')]=qs[_0x9a84('0x35')](_[_0x9a84('0x3e')](_0x35b3d5[_0x9a84('0x33')],_0x4850b9['filters']),_0x256e5f);if(_0x35b3d5[_0x9a84('0x33')][_0x9a84('0x3f')]){_0x443638['where']=_[_0x9a84('0x40')](_0x443638[_0x9a84('0x3d')],{'$or':_['map'](_0x256e5f,function(_0x2bfe38){if(_0x2bfe38[_0x9a84('0x2f')]!==_0x9a84('0x41')){var _0x2bd77f={};_0x2bd77f[_0x2bfe38[_0x9a84('0x2b')]]={'$like':'%'+_0x35b3d5[_0x9a84('0x33')][_0x9a84('0x3f')]+'%'};return _0x2bd77f;}})});}_0x443638=_['merge']({},_0x443638,_0x35b3d5['options']);var _0x4786b8={'where':_0x443638[_0x9a84('0x3d')]};return db[_0x9a84('0x2d')][_0x9a84('0x1f')](_0x4786b8)[_0x9a84('0x26')](function(_0x482cf5){_0x25ee73[_0x9a84('0x1f')]=_0x482cf5;if(_0x35b3d5[_0x9a84('0x33')][_0x9a84('0x42')]){_0x443638[_0x9a84('0x43')]=[{'all':!![]}];}return db[_0x9a84('0x2d')][_0x9a84('0x44')](_0x443638);})[_0x9a84('0x26')](function(_0x432629){_0x25ee73['rows']=_0x432629;return _0x25ee73;})[_0x9a84('0x26')](respondWithFilteredResult(_0x320bf5,_0x443638))[_0x9a84('0x45')](handleError(_0x320bf5,null));};exports[_0x9a84('0x46')]=function(_0x1e021e,_0x297bb2){var _0x29d410={'raw':![],'where':{'id':_0x1e021e[_0x9a84('0x47')]['id']}},_0x1f1370={};_0x1f1370[_0x9a84('0x31')]=_['keys'](db[_0x9a84('0x2d')][_0x9a84('0x2e')]);_0x1f1370[_0x9a84('0x33')]=_[_0x9a84('0x34')](_0x1e021e[_0x9a84('0x33')]);_0x1f1370['filters']=_['intersection'](_0x1f1370[_0x9a84('0x31')],_0x1f1370[_0x9a84('0x33')]);_0x29d410[_0x9a84('0x37')]=_['intersection'](_0x1f1370[_0x9a84('0x31')],qs[_0x9a84('0x38')](_0x1e021e[_0x9a84('0x33')][_0x9a84('0x38')]));_0x29d410['attributes']=_0x29d410['attributes'][_0x9a84('0x39')]?_0x29d410[_0x9a84('0x37')]:_0x1f1370[_0x9a84('0x31')];if(_0x1e021e['query'][_0x9a84('0x42')]){_0x29d410['include']=[{'all':!![]}];}_0x29d410=_['merge']({},_0x29d410,_0x1e021e[_0x9a84('0x48')]);return db['AnalyticCustomReport']['find'](_0x29d410)[_0x9a84('0x26')](handleEntityNotFound(_0x297bb2,null))[_0x9a84('0x26')](respondWithResult(_0x297bb2,null))[_0x9a84('0x45')](handleError(_0x297bb2,null));};exports[_0x9a84('0x49')]=function(_0xe80e0c,_0x283b8c){return db[_0x9a84('0x2d')]['create'](_0xe80e0c['body'],{})['then'](function(_0xff6373){var _0x5db644=_0xe80e0c[_0x9a84('0x4a')][_0x9a84('0x4b')]({'plain':!![]});if(!_0x5db644)throw new Error(_0x9a84('0x4c'));if(_0x5db644[_0x9a84('0x4d')]===_0x9a84('0x4a')){var _0x2d9d44=_0xff6373['get']({'plain':!![]});var _0x314f47=_0x9a84('0x4e');return db[_0x9a84('0x4f')][_0x9a84('0x50')]({'where':{'name':_0x314f47,'userProfileId':_0x5db644[_0x9a84('0x51')]},'raw':!![]})[_0x9a84('0x26')](function(_0x11a5d7){if(_0x11a5d7&&_0x11a5d7[_0x9a84('0x52')]===0x0){return db[_0x9a84('0x28')]['create']({'name':_0x2d9d44['name'],'resourceId':_0x2d9d44['id'],'type':_0x9a84('0x27'),'sectionId':_0x11a5d7['id']},{})[_0x9a84('0x26')](function(){return _0xff6373;});}else{return _0xff6373;}})[_0x9a84('0x45')](function(_0x4d98bd){logger['error'](_0x9a84('0x53'),_0x4d98bd);throw _0x4d98bd;});}return _0xff6373;})[_0x9a84('0x26')](respondWithResult(_0x283b8c,0xc9))[_0x9a84('0x45')](handleError(_0x283b8c,null));};exports['update']=function(_0x2e43d2,_0x13ff9e){if(_0x2e43d2[_0x9a84('0x54')]['id']){delete _0x2e43d2[_0x9a84('0x54')]['id'];}return db[_0x9a84('0x2d')][_0x9a84('0x50')]({'where':{'id':_0x2e43d2[_0x9a84('0x47')]['id']}})[_0x9a84('0x26')](handleEntityNotFound(_0x13ff9e,null))[_0x9a84('0x26')](saveUpdates(_0x2e43d2[_0x9a84('0x54')],null))[_0x9a84('0x26')](respondWithResult(_0x13ff9e,null))[_0x9a84('0x45')](handleError(_0x13ff9e,null));};exports[_0x9a84('0x25')]=function(_0xf25ef5,_0x157520){return db['AnalyticCustomReport'][_0x9a84('0x50')]({'where':{'id':_0xf25ef5[_0x9a84('0x47')]['id']}})[_0x9a84('0x26')](handleEntityNotFound(_0x157520,null))[_0x9a84('0x26')](removeEntity(_0x157520,null))[_0x9a84('0x45')](handleError(_0x157520,null));};exports[_0x9a84('0x55')]=function(_0x1eaeab,_0x1096d0){var _0x223805=0xa;var _0x5ef115=[_0x9a84('0x56'),_0x9a84('0x57'),_0x9a84('0x58'),_0x9a84('0x59')];var _0x2a7195={'SUM':_0x9a84('0x5a'),'COUNT':_0x9a84('0x5b'),'COUNT DISTINCT':_0x9a84('0x5c'),'MAX':_0x9a84('0x5d'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x9a84('0x5e'),'GROUP_CONCAT ASC':_0x9a84('0x5f'),'GROUP_CONCAT DESC':_0x9a84('0x60')};var _0x58f31f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x9a84('0x61'),'ROUND':_0x9a84('0x62'),'UNIX_TIMESTAMP':_0x9a84('0x63')};var _0x470842=function(_0x26ddf7){return!_[_0x9a84('0x64')]([_0x9a84('0x65'),_0x9a84('0x66'),_0x9a84('0x67'),_0x9a84('0x68')],_0x26ddf7);};var _0x30b4c8=function(_0xa8e22e){if(!_0xa8e22e||!_0xa8e22e[_0x9a84('0x69')]['length']){return'';}for(var _0x1acf1a='(',_0x22aa9=0x0;_0x22aa9<_0xa8e22e[_0x9a84('0x69')][_0x9a84('0x39')];_0x22aa9+=0x1){_0x22aa9>0x0&&(_0x1acf1a+='\x20'+_0xa8e22e[_0x9a84('0x6a')]+'\x20');_0x1acf1a+=_0xa8e22e['rules'][_0x22aa9][_0x9a84('0x6b')]?_0x30b4c8(_0xa8e22e[_0x9a84('0x69')][_0x22aa9][_0x9a84('0x6b')]):_0xa8e22e[_0x9a84('0x69')][_0x22aa9][_0x9a84('0x6c')]+'\x20'+_0xa8e22e[_0x9a84('0x69')][_0x22aa9][_0x9a84('0x6d')]+(_0x470842(_0xa8e22e[_0x9a84('0x69')][_0x22aa9][_0x9a84('0x6d')])?'\x20'+_0xa8e22e['rules'][_0x22aa9]['value']:'');}return _0x1acf1a+')';};var _0x4f08aa={'where':{'id':_0x1eaeab['params']['id']}},_0x1b0af3,_0x1540cc,_0x31958d,_0x5add03,_0x614ef7;_0x4f08aa=_[_0x9a84('0x40')]({},_0x4f08aa,_0x1eaeab[_0x9a84('0x48')]);return db[_0x9a84('0x2d')][_0x9a84('0x50')](_0x4f08aa)[_0x9a84('0x26')](function(_0x25bf26){if(_0x25bf26){_0x1b0af3=_0x25bf26;return _0x25bf26[_0x9a84('0x6e')]();}return null;})[_0x9a84('0x26')](function(_0x83abca){if(_0x83abca){if(!_0x83abca[_0x9a84('0x39')]){throw new db['Sequelize'][(_0x9a84('0x6f'))](_0x9a84('0x70'),0x193);}_0x1540cc=_0x83abca;return db['AnalyticMetric'][_0x9a84('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1196ff){if(_0x1196ff){_0x31958d=_[_0x9a84('0x71')](_0x1196ff,'id');var _0x5775d4;var _0x3f86e5=squel[_0x9a84('0x72')]();_0x3f86e5['from'](_0x1b0af3[_0x9a84('0x73')]);for(var _0x4697b9=0x0;_0x4697b9<_0x1540cc['length'];_0x4697b9+=0x1){_0x5775d4=_0x1540cc[_0x4697b9][_0x9a84('0x74')]?_0x31958d[_0x1540cc[_0x4697b9][_0x9a84('0x74')]][_0x9a84('0x75')]:_0x1540cc[_0x4697b9][_0x9a84('0x6c')];_0x5775d4=_0x1540cc[_0x4697b9][_0x9a84('0x76')]?_[_0x9a84('0x77')](_0x2a7195[_0x1540cc[_0x4697b9]['function']],'%s',_0x5775d4):_0x5775d4;_0x5775d4=_0x1540cc[_0x4697b9][_0x9a84('0x78')]?_['replace'](_0x58f31f[_0x1540cc[_0x4697b9]['format']],'%s',_0x5775d4):_0x5775d4;if(_0x1540cc[_0x4697b9][_0x9a84('0x79')]){_0x3f86e5['group'](_0x5775d4);}_0x1540cc[_0x4697b9][_0x9a84('0x7a')]&&_0x3f86e5[_0x9a84('0x7b')](_0x5775d4,_0x1540cc[_0x4697b9][_0x9a84('0x7a')]===_0x9a84('0x7c')?![]:!![]);_0x3f86e5['field'](_0x5775d4,_0x1540cc[_0x4697b9][_0x9a84('0x7d')]||_0x5775d4);}if(_0x1b0af3['joins']){_0x1b0af3[_0x9a84('0x7e')]=JSON[_0x9a84('0x7f')](_0x1b0af3[_0x9a84('0x7e')]);for(var _0x12ec8a=0x0;_0x12ec8a<_0x1b0af3[_0x9a84('0x7e')]['length'];_0x12ec8a+=0x1){if(_0x1b0af3['joins'][_0x12ec8a][_0x9a84('0x2f')]&&_[_0x9a84('0x64')](_0x5ef115,_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x2f')])&&_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x80')]&&_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a]['foreignTable']&&_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x81')]){_0x3f86e5[_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x2f')]](_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x82')],null,util[_0x9a84('0x78')](_0x9a84('0x83'),_0x1b0af3[_0x9a84('0x73')],_0x1b0af3['joins'][_0x12ec8a][_0x9a84('0x80')],_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x82')],_0x1b0af3[_0x9a84('0x7e')][_0x12ec8a][_0x9a84('0x81')]));}}}if(_0x1b0af3[_0x9a84('0x84')]){_0x1b0af3[_0x9a84('0x84')]=JSON['parse'](_0x1b0af3[_0x9a84('0x84')]);_0x3f86e5['where'](_0x30b4c8(_0x1b0af3[_0x9a84('0x84')]['group']));}_0x614ef7=_0x3f86e5[_0x9a84('0x85')]();_0x3f86e5[_0x9a84('0x20')](_0x223805);_0x3f86e5[_0x9a84('0x1d')](0x0);logger[_0x9a84('0x86')](_0x9a84('0x87'),_0x3f86e5[_0x9a84('0x88')]());return dbH[_0x9a84('0x89')][_0x9a84('0x33')](_0x3f86e5[_0x9a84('0x88')](),{'type':dbH['sequelize'][_0x9a84('0x8a')]['SELECT']});}})[_0x9a84('0x26')](respondWithResult(_0x1096d0,null))[_0x9a84('0x45')](handleError(_0x1096d0,null));};function runReport(_0x3c32c9,_0x27e1fa,_0x4a12ad){var _0x41551e=_0x27e1fa[_0x9a84('0x2b')];var _0x4b2d28=0xa;var _0x56edc3=[_0x9a84('0x56'),_0x9a84('0x57'),_0x9a84('0x58'),_0x9a84('0x59')];var _0x546705={'SUM':_0x9a84('0x5a'),'COUNT':_0x9a84('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9a84('0x5d'),'MIN':_0x9a84('0x8b'),'AVG':_0x9a84('0x8c'),'GROUP_CONCAT':_0x9a84('0x5e'),'GROUP_CONCAT ASC':_0x9a84('0x5f'),'GROUP_CONCAT DESC':_0x9a84('0x60')};var _0x20b986={'SEC_TO_TIME':_0x9a84('0x8d'),'DATE':_0x9a84('0x8e'),'HOUR':_0x9a84('0x61'),'ROUND':_0x9a84('0x62'),'UNIX_TIMESTAMP':_0x9a84('0x63')};var _0x36b53e=function(_0x229c0c){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9a84('0x68')],_0x229c0c);};var _0x3b26fa=function(_0x25f0ef){if(!_0x25f0ef||!_0x25f0ef['rules'][_0x9a84('0x39')]){return'';}for(var _0x17af6b='(',_0x25fc9f=0x0;_0x25fc9f<_0x25f0ef[_0x9a84('0x69')][_0x9a84('0x39')];_0x25fc9f+=0x1){_0x25fc9f>0x0&&(_0x17af6b+='\x20'+_0x25f0ef[_0x9a84('0x6a')]+'\x20');_0x17af6b+=_0x25f0ef[_0x9a84('0x69')][_0x25fc9f][_0x9a84('0x6b')]?_0x3b26fa(_0x25f0ef[_0x9a84('0x69')][_0x25fc9f]['group']):_0x25f0ef['rules'][_0x25fc9f][_0x9a84('0x6c')]+'\x20'+_0x25f0ef[_0x9a84('0x69')][_0x25fc9f][_0x9a84('0x6d')]+(_0x36b53e(_0x25f0ef['rules'][_0x25fc9f][_0x9a84('0x6d')])?'\x20'+_0x25f0ef[_0x9a84('0x69')][_0x25fc9f]['value']:'');}return _0x17af6b+')';};var _0x291a36={'where':{'id':_0x3c32c9['id']}},_0x5e4e29,_0x3de8e3,_0x1148f1,_0x1c6be2,_0x112884;_0x291a36=_[_0x9a84('0x40')]({},_0x291a36,_0x4a12ad);return db[_0x9a84('0x2d')][_0x9a84('0x50')](_0x291a36)[_0x9a84('0x26')](function(_0x510665){if(_0x510665){_0x5e4e29=_0x510665;return _0x510665[_0x9a84('0x6e')]();}return null;})['then'](function(_0x295b8a){if(_0x295b8a){if(!_0x295b8a['length']){throw new db[(_0x9a84('0x8f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3de8e3=_0x295b8a;return db['AnalyticMetric'][_0x9a84('0x44')]({'raw':!![]});}return null;})[_0x9a84('0x26')](function(_0x336772){if(_0x336772){_0x1148f1=_[_0x9a84('0x71')](_0x336772,'id');var _0x24f3ae;var _0x121016=squel[_0x9a84('0x72')]();_0x121016['from'](_0x5e4e29[_0x9a84('0x73')]);for(var _0x257ef1=0x0;_0x257ef1<_0x3de8e3[_0x9a84('0x39')];_0x257ef1+=0x1){_0x24f3ae=_0x3de8e3[_0x257ef1][_0x9a84('0x74')]?_0x1148f1[_0x3de8e3[_0x257ef1][_0x9a84('0x74')]][_0x9a84('0x75')]:_0x3de8e3[_0x257ef1]['field'];_0x24f3ae=_0x3de8e3[_0x257ef1][_0x9a84('0x76')]?_[_0x9a84('0x77')](_0x546705[_0x3de8e3[_0x257ef1][_0x9a84('0x76')]],'%s',_0x24f3ae):_0x24f3ae;_0x24f3ae=_0x3de8e3[_0x257ef1][_0x9a84('0x78')]?_[_0x9a84('0x77')](_0x20b986[_0x3de8e3[_0x257ef1][_0x9a84('0x78')]],'%s',_0x24f3ae):_0x24f3ae;if(_0x3de8e3[_0x257ef1]['groupBy']){_0x121016[_0x9a84('0x6b')](_0x24f3ae);}_0x3de8e3[_0x257ef1][_0x9a84('0x7a')]&&_0x121016[_0x9a84('0x7b')](_0x24f3ae,_0x3de8e3[_0x257ef1]['orderBy']==='DESC'?![]:!![]);_0x121016[_0x9a84('0x6c')](_0x24f3ae,_0x3de8e3[_0x257ef1][_0x9a84('0x7d')]||_0x24f3ae);}if(_0x5e4e29[_0x9a84('0x7e')]){_0x5e4e29['joins']=JSON['parse'](_0x5e4e29[_0x9a84('0x7e')]);for(var _0x58266e=0x0;_0x58266e<_0x5e4e29[_0x9a84('0x7e')][_0x9a84('0x39')];_0x58266e+=0x1){if(_0x5e4e29[_0x9a84('0x7e')][_0x58266e][_0x9a84('0x2f')]&&_[_0x9a84('0x64')](_0x56edc3,_0x5e4e29[_0x9a84('0x7e')][_0x58266e]['type'])&&_0x5e4e29['joins'][_0x58266e][_0x9a84('0x80')]&&_0x5e4e29['joins'][_0x58266e][_0x9a84('0x82')]&&_0x5e4e29['joins'][_0x58266e]['foreignKey']){_0x121016[_0x5e4e29[_0x9a84('0x7e')][_0x58266e][_0x9a84('0x2f')]](_0x5e4e29[_0x9a84('0x7e')][_0x58266e][_0x9a84('0x82')],null,util['format'](_0x9a84('0x83'),_0x5e4e29[_0x9a84('0x73')],_0x5e4e29[_0x9a84('0x7e')][_0x58266e][_0x9a84('0x80')],_0x5e4e29['joins'][_0x58266e][_0x9a84('0x82')],_0x5e4e29[_0x9a84('0x7e')][_0x58266e]['foreignKey']));}}}if(_0x5e4e29['conditions']){_0x5e4e29[_0x9a84('0x84')]=JSON['parse'](_0x5e4e29['conditions']);_0x121016[_0x9a84('0x3d')](_0x3b26fa(_0x5e4e29[_0x9a84('0x84')][_0x9a84('0x6b')]));}_0x112884=_0x121016[_0x9a84('0x85')]();_0x121016[_0x9a84('0x20')](_0x4b2d28);_0x121016[_0x9a84('0x1d')](0x0);return;}})[_0x9a84('0x26')](function(){if(_0x27e1fa[_0x9a84('0x90')]==='web'){return null;}var _0x3c8c4e=_[_0x9a84('0x40')](_0x27e1fa,{'name':_0x27e1fa[_0x9a84('0x91')]||_0x27e1fa[_0x9a84('0x2b')]||_0x5e4e29[_0x9a84('0x2b')],'basename':_0x41551e,'savename':util['format'](_0x9a84('0x92'),_0x27e1fa['name']||_0x5e4e29['name'],require(_0x9a84('0x93'))[_0x9a84('0x94')](0x4),_0x27e1fa[_0x9a84('0x90')]||_0x9a84('0x95')),'reportId':_0x5e4e29['id'],'reportType':_0x9a84('0x96')});return db[_0x9a84('0x97')][_0x9a84('0x49')](_0x3c8c4e,{'raw':!![]});})[_0x9a84('0x26')](function(_0x599ca3){if(_0x5e4e29[_0x9a84('0x73')]===_0x9a84('0x98')){_0x112884[_0x9a84('0x3d')](_0x5e4e29[_0x9a84('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x27e1fa[_0x9a84('0x99')],_0x27e1fa[_0x9a84('0x9a')]);}else{_0x112884[_0x9a84('0x3d')](_0x5e4e29[_0x9a84('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x27e1fa[_0x9a84('0x99')],_0x27e1fa['endDate']);}if(_0x599ca3){logger[_0x9a84('0x9b')](_0x9a84('0x9c'),_0x112884[_0x9a84('0x88')]());require(_0x9a84('0x9d'))[_0x9a84('0x9e')](path['join'](__dirname,_0x9a84('0x9f'),_0x599ca3['output']),[_0x599ca3['id'],_0x112884[_0x9a84('0x88')](),path[_0x9a84('0x56')](__dirname,_0x9a84('0xa0'),_0x599ca3['savename']),_0x41551e]);return _0x599ca3;}else{var _0x23dd9d=squel[_0x9a84('0x72')]();_0x23dd9d['from']('('+_0x112884[_0x9a84('0x88')]()+')',_0x9a84('0xa1'));_0x23dd9d[_0x9a84('0x6c')](_0x9a84('0xa2'),_0x9a84('0x1f'));_0x112884[_0x9a84('0x20')](_0x27e1fa[_0x9a84('0x20')]||_0x4b2d28);_0x112884[_0x9a84('0x1d')](_0x27e1fa['offset']||0x0);return dbH['sequelize'][_0x9a84('0x33')](_0x23dd9d[_0x9a84('0x88')](),{'type':dbH['sequelize']['QueryTypes'][_0x9a84('0xa3')]})[_0x9a84('0x26')](function(_0x5b324b){if(!_0x5b324b[_0x9a84('0x39')]){_0x1c6be2=0x0;}else{_0x1c6be2=_0x5b324b[0x0][_0x9a84('0x1f')]||0x0;}return dbH[_0x9a84('0x89')]['query'](_0x112884[_0x9a84('0x88')](),{'type':dbH[_0x9a84('0x89')]['QueryTypes'][_0x9a84('0xa3')]});})['then'](function(_0x52dbfe){return{'rows':_0x52dbfe||[],'count':_0x1c6be2};});}});}exports[_0x9a84('0xa4')]=function(_0xf1da16,_0x2c8b62){return runReport(_0xf1da16['params'],_0xf1da16[_0x9a84('0x33')],_0xf1da16[_0x9a84('0x48')])['then'](respondWithResult(_0x2c8b62,null))['catch'](handleError(_0x2c8b62,null));};exports['runReport']=runReport;exports[_0x9a84('0x33')]=function(_0xbc357d,_0x276be0){var _0x90e22b=0xa;var _0x5117c1=['join',_0x9a84('0x57'),'right_join',_0x9a84('0x59')];var _0x34c779={'SUM':_0x9a84('0x5a'),'COUNT':_0x9a84('0x5b'),'COUNT DISTINCT':_0x9a84('0x5c'),'MAX':_0x9a84('0x5d'),'MIN':'MIN(%s)','AVG':_0x9a84('0x8c'),'GROUP_CONCAT':_0x9a84('0x5e'),'GROUP_CONCAT ASC':_0x9a84('0x5f'),'GROUP_CONCAT DESC':_0x9a84('0x60')};var _0x327fda={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9a84('0x8e'),'HOUR':_0x9a84('0x61'),'ROUND':_0x9a84('0x62'),'UNIX_TIMESTAMP':_0x9a84('0x63')};var _0x4d2dfb=function(_0x39f7c3){return!_[_0x9a84('0x64')]([_0x9a84('0x65'),_0x9a84('0x66'),_0x9a84('0x67'),_0x9a84('0x68')],_0x39f7c3);};var _0x5959f6=function(_0x9159f4){if(!_0x9159f4||!_0x9159f4[_0x9a84('0x69')]['length']){return'';}for(var _0x4d837e='(',_0x464675=0x0;_0x464675<_0x9159f4[_0x9a84('0x69')][_0x9a84('0x39')];_0x464675+=0x1){_0x464675>0x0&&(_0x4d837e+='\x20'+_0x9159f4['operator']+'\x20');_0x4d837e+=_0x9159f4[_0x9a84('0x69')][_0x464675]['group']?_0x5959f6(_0x9159f4[_0x9a84('0x69')][_0x464675][_0x9a84('0x6b')]):_0x9159f4['rules'][_0x464675][_0x9a84('0x6c')]+'\x20'+_0x9159f4[_0x9a84('0x69')][_0x464675][_0x9a84('0x6d')]+(_0x4d2dfb(_0x9159f4[_0x9a84('0x69')][_0x464675][_0x9a84('0x6d')])?'\x20'+_0x9159f4[_0x9a84('0x69')][_0x464675][_0x9a84('0xa5')]:'');}return _0x4d837e+')';};var _0x24b3c1={'where':{'id':_0xbc357d[_0x9a84('0x47')]['id']}},_0x253695,_0x2ad96a,_0x10065a,_0x45f389,_0x38ca29;_0x24b3c1=_[_0x9a84('0x40')]({},_0x24b3c1,_0xbc357d[_0x9a84('0x48')]);return db[_0x9a84('0x2d')][_0x9a84('0x50')](_0x24b3c1)[_0x9a84('0x26')](function(_0x4eb672){if(_0x4eb672){_0x253695=_0x4eb672;return _0x4eb672[_0x9a84('0x6e')]();}return null;})[_0x9a84('0x26')](function(_0x4e49b6){if(_0x4e49b6){if(!_0x4e49b6[_0x9a84('0x39')]){throw new db[(_0x9a84('0x8f'))][(_0x9a84('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2ad96a=_0x4e49b6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x40f41b){if(_0x40f41b){_0x10065a=_['keyBy'](_0x40f41b,'id');var _0x466dcb;var _0x3b9e4d=squel['select']();_0x3b9e4d[_0x9a84('0xa6')](_0x253695[_0x9a84('0x73')]);for(var _0x405eff=0x0;_0x405eff<_0x2ad96a[_0x9a84('0x39')];_0x405eff+=0x1){_0x466dcb=_0x2ad96a[_0x405eff]['MetricId']?_0x10065a[_0x2ad96a[_0x405eff][_0x9a84('0x74')]][_0x9a84('0x75')]:_0x2ad96a[_0x405eff][_0x9a84('0x6c')];_0x466dcb=_0x2ad96a[_0x405eff]['function']?_['replace'](_0x34c779[_0x2ad96a[_0x405eff][_0x9a84('0x76')]],'%s',_0x466dcb):_0x466dcb;_0x466dcb=_0x2ad96a[_0x405eff]['format']?_[_0x9a84('0x77')](_0x327fda[_0x2ad96a[_0x405eff][_0x9a84('0x78')]],'%s',_0x466dcb):_0x466dcb;if(_0x2ad96a[_0x405eff][_0x9a84('0x79')]){_0x3b9e4d[_0x9a84('0x6b')](_0x466dcb);}_0x2ad96a[_0x405eff][_0x9a84('0x7a')]&&_0x3b9e4d['order'](_0x466dcb,_0x2ad96a[_0x405eff]['orderBy']===_0x9a84('0x7c')?![]:!![]);_0x3b9e4d[_0x9a84('0x6c')](_0x466dcb,_0x2ad96a[_0x405eff]['alias']||_0x466dcb);}if(_0x253695[_0x9a84('0x7e')]){_0x253695[_0x9a84('0x7e')]=JSON[_0x9a84('0x7f')](_0x253695[_0x9a84('0x7e')]);for(var _0x4aaffd=0x0;_0x4aaffd<_0x253695['joins'][_0x9a84('0x39')];_0x4aaffd+=0x1){if(_0x253695[_0x9a84('0x7e')][_0x4aaffd]['type']&&_[_0x9a84('0x64')](_0x5117c1,_0x253695[_0x9a84('0x7e')][_0x4aaffd][_0x9a84('0x2f')])&&_0x253695[_0x9a84('0x7e')][_0x4aaffd][_0x9a84('0x80')]&&_0x253695[_0x9a84('0x7e')][_0x4aaffd]['foreignTable']&&_0x253695[_0x9a84('0x7e')][_0x4aaffd][_0x9a84('0x81')]){_0x3b9e4d[_0x253695[_0x9a84('0x7e')][_0x4aaffd]['type']](_0x253695[_0x9a84('0x7e')][_0x4aaffd]['foreignTable'],null,util[_0x9a84('0x78')](_0x9a84('0x83'),_0x253695[_0x9a84('0x73')],_0x253695[_0x9a84('0x7e')][_0x4aaffd][_0x9a84('0x80')],_0x253695['joins'][_0x4aaffd][_0x9a84('0x82')],_0x253695['joins'][_0x4aaffd][_0x9a84('0x81')]));}}}if(_0x253695['conditions']){_0x253695[_0x9a84('0x84')]=JSON['parse'](_0x253695[_0x9a84('0x84')]);_0x3b9e4d[_0x9a84('0x3d')](_0x5959f6(_0x253695['conditions'][_0x9a84('0x6b')]));}_0x38ca29=_0x3b9e4d[_0x9a84('0x85')]();_0x3b9e4d['limit'](_0x90e22b);_0x3b9e4d[_0x9a84('0x1d')](0x0);logger['debug']('Limited\x20Query:',_0x3b9e4d[_0x9a84('0x88')]());return dbH[_0x9a84('0x89')][_0x9a84('0x33')](_0x3b9e4d['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x9a84('0xa3')]});}})[_0x9a84('0x26')](function(){return{'sql':_0x38ca29['toString']()};})['then'](respondWithResult(_0x276be0,null))[_0x9a84('0x45')](handleError(_0x276be0,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 21e10d2..b2e8ece 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 _0xcbb4=['define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xcbb4,0x17c));var _0x4cbb=function(_0x33aded,_0x173eb7){_0x33aded=_0x33aded-0x0;var _0x3e1558=_0xcbb4[_0x33aded];return _0x3e1558;};'use strict';var _=require(_0x4cbb('0x0'));var util=require('util');var logger=require(_0x4cbb('0x1'))(_0x4cbb('0x2'));var moment=require(_0x4cbb('0x3'));var BPromise=require(_0x4cbb('0x4'));var rp=require(_0x4cbb('0x5'));var fs=require('fs');var path=require(_0x4cbb('0x6'));var rimraf=require(_0x4cbb('0x7'));var config=require(_0x4cbb('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x4cbb('0x9')]=function(_0x56d048,_0x358850){return _0x56d048[_0x4cbb('0xa')](_0x4cbb('0xb'),attributes,{'tableName':_0x4cbb('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc125=['../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','../../config/logger','bluebird','request-promise','path'];(function(_0x51dd23,_0x460d0a){var _0x1cb243=function(_0x18cedd){while(--_0x18cedd){_0x51dd23['push'](_0x51dd23['shift']());}};_0x1cb243(++_0x460d0a);}(_0xc125,0x6c));var _0x5c12=function(_0x58dbe8,_0xfcf155){_0x58dbe8=_0x58dbe8-0x0;var _0x502bc3=_0xc125[_0x58dbe8];return _0x502bc3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c12('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5c12('0x1'));var rp=require(_0x5c12('0x2'));var fs=require('fs');var path=require(_0x5c12('0x3'));var rimraf=require('rimraf');var config=require(_0x5c12('0x4'));var attributes=require(_0x5c12('0x5'));module['exports']=function(_0x3f101e,_0x4565ab){return _0x3f101e['define'](_0x5c12('0x6'),attributes,{'tableName':_0x5c12('0x7'),'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 89eae03..a21cf18 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 _0xc8ec=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x6e35e0,_0x104832){var _0x13ca24=function(_0x302814){while(--_0x302814){_0x6e35e0['push'](_0x6e35e0['shift']());}};_0x13ca24(++_0x104832);}(_0xc8ec,0x16a));var _0xcc8e=function(_0x19c1d2,_0x29f30b){_0x19c1d2=_0x19c1d2-0x0;var _0x1a61bc=_0xc8ec[_0x19c1d2];return _0x1a61bc;};'use strict';var _=require(_0xcc8e('0x0'));var util=require(_0xcc8e('0x1'));var moment=require('moment');var BPromise=require(_0xcc8e('0x2'));var rs=require(_0xcc8e('0x3'));var fs=require('fs');var Redis=require(_0xcc8e('0x4'));var db=require(_0xcc8e('0x5'))['db'];var utils=require(_0xcc8e('0x6'));var logger=require('../../config/logger')(_0xcc8e('0x7'));var config=require(_0xcc8e('0x8'));var jayson=require(_0xcc8e('0x9'));var client=jayson['client'][_0xcc8e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x181859,_0x45b4d8,_0x201fdf){return new BPromise(function(_0x48eb7c,_0x56da17){return client['request'](_0x181859,_0x201fdf)[_0xcc8e('0xb')](function(_0x3b2fd7){logger['info'](_0xcc8e('0xc'),_0x45b4d8,_0xcc8e('0xd'));logger[_0xcc8e('0xe')](_0xcc8e('0xf'),_0x45b4d8,_0xcc8e('0xd'),JSON[_0xcc8e('0x10')](_0x3b2fd7));if(_0x3b2fd7['error']){if(_0x3b2fd7[_0xcc8e('0x11')][_0xcc8e('0x12')]===0x1f4){logger[_0xcc8e('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x45b4d8,_0x3b2fd7['error'][_0xcc8e('0x13')]);return _0x56da17(_0x3b2fd7[_0xcc8e('0x11')][_0xcc8e('0x13')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x45b4d8,_0x3b2fd7[_0xcc8e('0x11')][_0xcc8e('0x13')]);return _0x48eb7c(_0x3b2fd7['error']['message']);}else{logger['info'](_0xcc8e('0xc'),_0x45b4d8,_0xcc8e('0xd'));_0x48eb7c(_0x3b2fd7[_0xcc8e('0x14')]['message']);}})[_0xcc8e('0x15')](function(_0x20f22a){logger[_0xcc8e('0x11')](_0xcc8e('0xc'),_0x45b4d8,_0x20f22a);_0x56da17(_0x20f22a);});});} \ No newline at end of file +var _0x184a=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x184a,0x10c));var _0xa184=function(_0x117f48,_0xf2708c){_0x117f48=_0x117f48-0x0;var _0x41785a=_0x184a[_0x117f48];return _0x41785a;};'use strict';var _=require('lodash');var util=require(_0xa184('0x0'));var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require(_0xa184('0x3'));var fs=require('fs');var Redis=require(_0xa184('0x4'));var db=require(_0xa184('0x5'))['db'];var utils=require(_0xa184('0x6'));var logger=require('../../config/logger')(_0xa184('0x7'));var config=require('../../config/environment');var jayson=require(_0xa184('0x8'));var client=jayson[_0xa184('0x9')][_0xa184('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x195d64,_0x45b46b,_0x36baa7){return new BPromise(function(_0x529427,_0x533dc7){return client['request'](_0x195d64,_0x36baa7)[_0xa184('0xb')](function(_0x1f493f){logger[_0xa184('0xc')](_0xa184('0xd'),_0x45b46b,_0xa184('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x45b46b,_0xa184('0xe'),JSON[_0xa184('0xf')](_0x1f493f));if(_0x1f493f[_0xa184('0x10')]){if(_0x1f493f[_0xa184('0x10')]['code']===0x1f4){logger[_0xa184('0x10')](_0xa184('0xd'),_0x45b46b,_0x1f493f['error'][_0xa184('0x11')]);return _0x533dc7(_0x1f493f[_0xa184('0x10')]['message']);}logger['error'](_0xa184('0xd'),_0x45b46b,_0x1f493f['error'][_0xa184('0x11')]);return _0x529427(_0x1f493f['error'][_0xa184('0x11')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x45b46b,'request\x20sent');_0x529427(_0x1f493f[_0xa184('0x12')]['message']);}})[_0xa184('0x13')](function(_0x369c45){logger[_0xa184('0x10')](_0xa184('0xd'),_0x45b46b,_0x369c45);_0x533dc7(_0x369c45);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2ba12df..ec665a1 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 _0x26b1=['preview','run','/:id/query','query','create','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x26b1,0xd0));var _0x126b=function(_0x5abd64,_0x274f04){_0x5abd64=_0x5abd64-0x0;var _0x199d62=_0x26b1[_0x5abd64];return _0x199d62;};'use strict';var multer=require(_0x126b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x126b('0x1'));var express=require(_0x126b('0x2'));var router=express[_0x126b('0x3')]();var fs_extra=require(_0x126b('0x4'));var auth=require(_0x126b('0x5'));var interaction=require(_0x126b('0x6'));var config=require(_0x126b('0x7'));var controller=require(_0x126b('0x8'));router[_0x126b('0x9')]('/',auth[_0x126b('0xa')](),controller['index']);router[_0x126b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x126b('0xb')]);router[_0x126b('0x9')]('/:id/preview',auth[_0x126b('0xa')](),controller[_0x126b('0xc')]);router[_0x126b('0x9')]('/:id/run',auth[_0x126b('0xa')](),controller[_0x126b('0xd')]);router['get'](_0x126b('0xe'),auth['isAuthenticated'](),controller[_0x126b('0xf')]);router['post']('/',auth[_0x126b('0xa')](),controller[_0x126b('0x10')]);router[_0x126b('0x11')](_0x126b('0x12'),auth[_0x126b('0xa')](),controller[_0x126b('0x13')]);router[_0x126b('0x14')](_0x126b('0x12'),auth[_0x126b('0xa')](),controller[_0x126b('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd566=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','/:id','update','destroy','exports'];(function(_0x57d97b,_0x4e0e17){var _0x7e7826=function(_0x166721){while(--_0x166721){_0x57d97b['push'](_0x57d97b['shift']());}};_0x7e7826(++_0x4e0e17);}(_0xd566,0x1a2));var _0x6d56=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd566[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x6d56('0x0'));var util=require('util');var path=require(_0x6d56('0x1'));var timeout=require(_0x6d56('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d56('0x3'));var interaction=require(_0x6d56('0x4'));var config=require('../../config/environment');var controller=require(_0x6d56('0x5'));router[_0x6d56('0x6')]('/',auth[_0x6d56('0x7')](),controller[_0x6d56('0x8')]);router['get']('/:id',auth[_0x6d56('0x7')](),controller[_0x6d56('0x9')]);router['get'](_0x6d56('0xa'),auth['isAuthenticated'](),controller[_0x6d56('0xb')]);router[_0x6d56('0x6')](_0x6d56('0xc'),auth[_0x6d56('0x7')](),controller[_0x6d56('0xd')]);router['get'](_0x6d56('0xe'),auth[_0x6d56('0x7')](),controller['query']);router[_0x6d56('0xf')]('/',auth[_0x6d56('0x7')](),controller[_0x6d56('0x10')]);router[_0x6d56('0x11')](_0x6d56('0x12'),auth['isAuthenticated'](),controller[_0x6d56('0x13')]);router['delete']('/:id',auth[_0x6d56('0x7')](),controller[_0x6d56('0x14')]);module[_0x6d56('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 67eda56..35eb1a1 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 _0x2bd8=['TEXT','sequelize','STRING'];(function(_0xcc639b,_0x2806fa){var _0x426ed8=function(_0x5cbc54){while(--_0x5cbc54){_0xcc639b['push'](_0xcc639b['shift']());}};_0x426ed8(++_0x2806fa);}(_0x2bd8,0x130));var _0x82bd=function(_0x412500,_0x320050){_0x412500=_0x412500-0x0;var _0x22561e=_0x2bd8[_0x412500];return _0x22561e;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'name':{'type':Sequelize[_0x82bd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x82bd('0x1')]},'parent':{'type':Sequelize[_0x82bd('0x1')]},'table':{'type':Sequelize[_0x82bd('0x1')]},'conditions':{'type':Sequelize[_0x82bd('0x2')]},'joins':{'type':Sequelize[_0x82bd('0x2')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x131205,_0x57575c){var _0x305300=function(_0x179eea){while(--_0x179eea){_0x131205['push'](_0x131205['shift']());}};_0x305300(++_0x57575c);}(_0x24ca,0x1bc));var _0xa24c=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x24ca[_0x35f7f5];return _0x5567a4;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 06c3b7d..4a7b0fc 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 _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x4d3e20,_0x22ca17){var _0x4902d8=function(_0x52dccd){while(--_0x52dccd){_0x4d3e20['push'](_0x4d3e20['shift']());}};_0x4902d8(++_0x22ca17);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x5fc3[_0x3861f7];return _0x50879f;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 6074fad..275a776 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 _0x71a9=['bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','lodash','util','moment'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x71a9,0xd9));var _0x971a=function(_0x252fec,_0x21dfd6){_0x252fec=_0x252fec-0x0;var _0x1b3256=_0x71a9[_0x252fec];return _0x1b3256;};'use strict';var _=require(_0x971a('0x0'));var util=require(_0x971a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x971a('0x2'));var BPromise=require(_0x971a('0x3'));var rp=require(_0x971a('0x4'));var fs=require('fs');var path=require(_0x971a('0x5'));var rimraf=require('rimraf');var config=require(_0x971a('0x6'));var attributes=require(_0x971a('0x7'));module[_0x971a('0x8')]=function(_0x3c1e25,_0x1c41d3){return _0x3c1e25[_0x971a('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd70a=['bluebird','request-promise','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xd70a,0x1d0));var _0xad70=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0xd70a[_0x27031e];return _0xfd46b3;};'use strict';var _=require(_0xad70('0x0'));var util=require('util');var logger=require(_0xad70('0x1'))(_0xad70('0x2'));var moment=require(_0xad70('0x3'));var BPromise=require(_0xad70('0x4'));var rp=require(_0xad70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xad70('0x6'));var config=require('../../config/environment');var attributes=require(_0xad70('0x7'));module[_0xad70('0x8')]=function(_0x3459d4,_0x26055e){return _0x3459d4[_0xad70('0x9')](_0xad70('0xa'),attributes,{'tableName':_0xad70('0xb'),'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 69e8e0e..7fee6c0 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 _0x9e2f=['stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x9e2f,0x18c));var _0xf9e2=function(_0x5617be,_0x4c3632){_0x5617be=_0x5617be-0x0;var _0xedfec8=_0x9e2f[_0x5617be];return _0xedfec8;};'use strict';var _=require('lodash');var util=require(_0xf9e2('0x0'));var moment=require(_0xf9e2('0x1'));var BPromise=require(_0xf9e2('0x2'));var rs=require(_0xf9e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9e2('0x4'))['db'];var utils=require(_0xf9e2('0x5'));var logger=require(_0xf9e2('0x6'))(_0xf9e2('0x7'));var config=require(_0xf9e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf9e2('0x9')][_0xf9e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a888b,_0x3622b9,_0x5b7d24){return new BPromise(function(_0x1afead,_0x3f2fd0){return client[_0xf9e2('0xb')](_0x4a888b,_0x5b7d24)[_0xf9e2('0xc')](function(_0x17f165){logger[_0xf9e2('0xd')](_0xf9e2('0xe'),_0x3622b9,_0xf9e2('0xf'));logger[_0xf9e2('0x10')](_0xf9e2('0x11'),_0x3622b9,_0xf9e2('0xf'),JSON[_0xf9e2('0x12')](_0x17f165));if(_0x17f165[_0xf9e2('0x13')]){if(_0x17f165['error'][_0xf9e2('0x14')]===0x1f4){logger[_0xf9e2('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3622b9,_0x17f165['error'][_0xf9e2('0x15')]);return _0x3f2fd0(_0x17f165[_0xf9e2('0x13')]['message']);}logger[_0xf9e2('0x13')](_0xf9e2('0xe'),_0x3622b9,_0x17f165[_0xf9e2('0x13')][_0xf9e2('0x15')]);return _0x1afead(_0x17f165[_0xf9e2('0x13')][_0xf9e2('0x15')]);}else{logger[_0xf9e2('0xd')](_0xf9e2('0xe'),_0x3622b9,'request\x20sent');_0x1afead(_0x17f165[_0xf9e2('0x16')][_0xf9e2('0x15')]);}})['catch'](function(_0x92b4e3){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3622b9,_0x92b4e3);_0x3f2fd0(_0x92b4e3);});});} \ No newline at end of file +var _0x9554=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x3cb12c,_0x3530f9){var _0x166ef4=function(_0x3e0da){while(--_0x3e0da){_0x3cb12c['push'](_0x3cb12c['shift']());}};_0x166ef4(++_0x3530f9);}(_0x9554,0x105));var _0x4955=function(_0x237c30,_0x4f9ab4){_0x237c30=_0x237c30-0x0;var _0x82d572=_0x9554[_0x237c30];return _0x82d572;};'use strict';var _=require(_0x4955('0x0'));var util=require(_0x4955('0x1'));var moment=require(_0x4955('0x2'));var BPromise=require(_0x4955('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4955('0x4'));var db=require(_0x4955('0x5'))['db'];var utils=require(_0x4955('0x6'));var logger=require(_0x4955('0x7'))(_0x4955('0x8'));var config=require('../../config/environment');var jayson=require(_0x4955('0x9'));var client=jayson['client'][_0x4955('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5632f8,_0x21229e,_0x205d9a){return new BPromise(function(_0x4e51f6,_0x26c61d){return client['request'](_0x5632f8,_0x205d9a)['then'](function(_0x11eac4){logger['info'](_0x4955('0xb'),_0x21229e,'request\x20sent');logger[_0x4955('0xc')](_0x4955('0xd'),_0x21229e,_0x4955('0xe'),JSON[_0x4955('0xf')](_0x11eac4));if(_0x11eac4[_0x4955('0x10')]){if(_0x11eac4['error'][_0x4955('0x11')]===0x1f4){logger['error'](_0x4955('0xb'),_0x21229e,_0x11eac4['error'][_0x4955('0x12')]);return _0x26c61d(_0x11eac4[_0x4955('0x10')]['message']);}logger['error'](_0x4955('0xb'),_0x21229e,_0x11eac4[_0x4955('0x10')]['message']);return _0x4e51f6(_0x11eac4[_0x4955('0x10')][_0x4955('0x12')]);}else{logger['info'](_0x4955('0xb'),_0x21229e,'request\x20sent');_0x4e51f6(_0x11eac4[_0x4955('0x13')][_0x4955('0x12')]);}})[_0x4955('0x14')](function(_0x5e9a2e){logger[_0x4955('0x10')](_0x4955('0xb'),_0x21229e,_0x5e9a2e);_0x26c61d(_0x5e9a2e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 83d28b0..788d517 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 _0xa93a=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','run','/:id/query','query','create','update','delete','destroy','path','Router','../../components/auth/service'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xa93a,0xb8));var _0xaa93=function(_0x25b579,_0x1849bf){_0x25b579=_0x25b579-0x0;var _0x406cbf=_0xa93a[_0x25b579];return _0x406cbf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa93('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa93('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xaa93('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xaa93('0x3'));var controller=require(_0xaa93('0x4'));router[_0xaa93('0x5')]('/',auth[_0xaa93('0x6')](),controller[_0xaa93('0x7')]);router['get'](_0xaa93('0x8'),auth[_0xaa93('0x6')](),controller['show']);router[_0xaa93('0x5')]('/:id/preview',auth[_0xaa93('0x6')](),controller[_0xaa93('0x9')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0xaa93('0xa')]);router['get'](_0xaa93('0xb'),auth[_0xaa93('0x6')](),controller[_0xaa93('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa93('0xd')]);router['put'](_0xaa93('0x8'),auth['isAuthenticated'](),controller[_0xaa93('0xe')]);router[_0xaa93('0xf')](_0xaa93('0x8'),auth[_0xaa93('0x6')](),controller[_0xaa93('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf9d8=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x13e42f,_0x3296e5){var _0x415720=function(_0xd6c1eb){while(--_0xd6c1eb){_0x13e42f['push'](_0x13e42f['shift']());}};_0x415720(++_0x3296e5);}(_0xf9d8,0xc4));var _0x8f9d=function(_0x4ae304,_0x1b8e8e){_0x4ae304=_0x4ae304-0x0;var _0x3c1a76=_0xf9d8[_0x4ae304];return _0x3c1a76;};'use strict';var multer=require(_0x8f9d('0x0'));var util=require(_0x8f9d('0x1'));var path=require(_0x8f9d('0x2'));var timeout=require(_0x8f9d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8f9d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f9d('0x5'));var controller=require(_0x8f9d('0x6'));router[_0x8f9d('0x7')]('/',auth[_0x8f9d('0x8')](),controller[_0x8f9d('0x9')]);router['get'](_0x8f9d('0xa'),auth[_0x8f9d('0x8')](),controller[_0x8f9d('0xb')]);router['get'](_0x8f9d('0xc'),auth['isAuthenticated'](),controller[_0x8f9d('0xd')]);router[_0x8f9d('0x7')](_0x8f9d('0xe'),auth[_0x8f9d('0x8')](),controller[_0x8f9d('0xf')]);router[_0x8f9d('0x7')](_0x8f9d('0x10'),auth['isAuthenticated'](),controller[_0x8f9d('0x11')]);router[_0x8f9d('0x12')]('/',auth['isAuthenticated'](),controller[_0x8f9d('0x13')]);router[_0x8f9d('0x14')](_0x8f9d('0xa'),auth[_0x8f9d('0x8')](),controller[_0x8f9d('0x15')]);router[_0x8f9d('0x16')](_0x8f9d('0xa'),auth[_0x8f9d('0x8')](),controller[_0x8f9d('0x17')]);module[_0x8f9d('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 70695d3..de91e10 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 _0x35cd=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x2c3dee,_0x7cb043){var _0x12bf0c=function(_0x11d6eb){while(--_0x11d6eb){_0x2c3dee['push'](_0x2c3dee['shift']());}};_0x12bf0c(++_0x7cb043);}(_0x35cd,0xe3));var _0xd35c=function(_0x49da24,_0x124150){_0x49da24=_0x49da24-0x0;var _0x440e19=_0x35cd[_0x49da24];return _0x440e19;};'use strict';var Sequelize=require(_0xd35c('0x0'));var moment=require(_0xd35c('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd35c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd35c('0x3')](_0xd35c('0x4'),_0xd35c('0x5'),_0xd35c('0x6')),'allowNull':![],'defaultValue':_0xd35c('0x4')},'savename':{'type':Sequelize[_0xd35c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd35c('0x7')]},'endDate':{'type':Sequelize[_0xd35c('0x7')]},'status':{'type':Sequelize[_0xd35c('0x2')],'defaultValue':_0xd35c('0x8')},'type':{'type':Sequelize[_0xd35c('0x3')](_0xd35c('0x9'),_0xd35c('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xd35c('0xb')](0xb)[_0xd35c('0xc')]},'reportType':{'type':Sequelize[_0xd35c('0x2')]}}; \ No newline at end of file +var _0x632c=['INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','scheduled','manual'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x632c,0x1a2));var _0xc632=function(_0x3d69f4,_0x44ab9d){_0x3d69f4=_0x3d69f4-0x0;var _0x23e86c=_0x632c[_0x3d69f4];return _0x23e86c;};'use strict';var Sequelize=require(_0xc632('0x0'));var moment=require(_0xc632('0x1'));module[_0xc632('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc632('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xc632('0x4')](_0xc632('0x5'),_0xc632('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0xc632('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xc632('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xc632('0x3')],'defaultValue':_0xc632('0x8')},'type':{'type':Sequelize[_0xc632('0x4')]('manual',_0xc632('0x9')),'allowNull':![],'defaultValue':_0xc632('0xa')},'reportId':{'type':Sequelize[_0xc632('0xb')](0xb)[_0xc632('0xc')]},'reportType':{'type':Sequelize[_0xc632('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4736efd..c34f079 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 _0xf2e5=['../../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','get','name','send','index','map','AnalyticExtractedReport','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','download','basename','savename','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','output','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x230a0f,_0xca813e){var _0x10370c=function(_0x100505){while(--_0x100505){_0x230a0f['push'](_0x230a0f['shift']());}};_0x10370c(++_0xca813e);}(_0xf2e5,0x175));var _0x5f2e=function(_0x49d40d,_0x30e0ea){_0x49d40d=_0x49d40d-0x0;var _0x5ec463=_0xf2e5[_0x49d40d];return _0x5ec463;};'use strict';var emlformat=require(_0x5f2e('0x0'));var rimraf=require(_0x5f2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5f2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f2e('0x3'));var util=require(_0x5f2e('0x4'));var path=require(_0x5f2e('0x5'));var sox=require(_0x5f2e('0x6'));var csv=require(_0x5f2e('0x7'));var ejs=require(_0x5f2e('0x8'));var fs=require('fs');var fs_extra=require(_0x5f2e('0x9'));var _=require(_0x5f2e('0xa'));var squel=require('squel');var crypto=require(_0x5f2e('0xb'));var jsforce=require(_0x5f2e('0xc'));var deskjs=require(_0x5f2e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5f2e('0xe'));var Papa=require(_0x5f2e('0xf'));var Redis=require(_0x5f2e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5f2e('0x11'));var as=require(_0x5f2e('0x12'));var hardwareService=require(_0x5f2e('0x13'));var logger=require('../../config/logger')(_0x5f2e('0x14'));var utils=require(_0x5f2e('0x15'));var config=require(_0x5f2e('0x16'));var licenseUtil=require(_0x5f2e('0x17'));var db=require(_0x5f2e('0x18'))['db'];function respondWithStatusCode(_0x5b5cbf,_0xb16f81){_0xb16f81=_0xb16f81||0xcc;return function(_0x756f7b){if(_0x756f7b){return _0x5b5cbf[_0x5f2e('0x19')](_0xb16f81);}return _0x5b5cbf[_0x5f2e('0x1a')](_0xb16f81)[_0x5f2e('0x1b')]();};}function respondWithResult(_0x279f73,_0x17673b){_0x17673b=_0x17673b||0xc8;return function(_0x3c90ca){if(_0x3c90ca){return _0x279f73[_0x5f2e('0x1a')](_0x17673b)[_0x5f2e('0x1c')](_0x3c90ca);}};}function respondWithFilteredResult(_0x1df115,_0x1d571a){return function(_0x28ffe1){if(_0x28ffe1){var _0x1a336d=typeof _0x1d571a[_0x5f2e('0x1d')]===_0x5f2e('0x1e')&&typeof _0x1d571a[_0x5f2e('0x1f')]===_0x5f2e('0x1e');var _0x585672=_0x28ffe1[_0x5f2e('0x20')];var _0x7a70ac=_0x1a336d?0x0:_0x1d571a[_0x5f2e('0x1d')];var _0x3c4ff9=_0x1a336d?_0x28ffe1[_0x5f2e('0x20')]:_0x1d571a[_0x5f2e('0x1d')]+_0x1d571a['limit'];var _0x561f08;if(_0x3c4ff9>=_0x585672){_0x3c4ff9=_0x585672;_0x561f08=0xc8;}else{_0x561f08=0xce;}_0x1df115[_0x5f2e('0x1a')](_0x561f08);return _0x1df115[_0x5f2e('0x21')](_0x5f2e('0x22'),_0x7a70ac+'-'+_0x3c4ff9+'/'+_0x585672)['json'](_0x28ffe1);}return null;};}function patchUpdates(_0xb168f6){return function(_0x4fa8a9){try{jsonpatch[_0x5f2e('0x23')](_0x4fa8a9,_0xb168f6,!![]);}catch(_0xa2b403){return BPromise[_0x5f2e('0x24')](_0xa2b403);}return _0x4fa8a9['save']();};}function saveUpdates(_0x50a353,_0x1742b7){return function(_0x5567d3){if(_0x5567d3){return _0x5567d3[_0x5f2e('0x25')](_0x50a353)[_0x5f2e('0x26')](function(_0x23534c){return _0x23534c;});}return null;};}function removeEntity(_0x3a3e4a,_0x47ac32){return function(_0x268393){if(_0x268393){return _0x268393[_0x5f2e('0x27')]()[_0x5f2e('0x26')](function(){var _0x1a8e2b=_0x268393[_0x5f2e('0x28')]({'plain':!![]});var _0x52556a='ExtractedReports';return db['UserProfileResource'][_0x5f2e('0x27')]({'where':{'type':_0x52556a,'resourceId':_0x1a8e2b['id']}})[_0x5f2e('0x26')](function(){return _0x268393;});})[_0x5f2e('0x26')](function(){_0x3a3e4a['status'](0xcc)[_0x5f2e('0x1b')]();});}};}function handleEntityNotFound(_0x50f955,_0x44bba7){return function(_0x1765ce){if(!_0x1765ce){_0x50f955[_0x5f2e('0x19')](0x194);}return _0x1765ce;};}function handleError(_0x3e70ea,_0x43c6e9){_0x43c6e9=_0x43c6e9||0x1f4;return function(_0x1a9159){logger['error'](_0x1a9159['stack']);if(_0x1a9159[_0x5f2e('0x29')]){delete _0x1a9159['name'];}_0x3e70ea['status'](_0x43c6e9)[_0x5f2e('0x2a')](_0x1a9159);};}exports[_0x5f2e('0x2b')]=function(_0x79272a,_0x2a670a){var _0x5780a0={},_0x6b2fef={},_0x442956={'count':0x0,'rows':[]};var _0x39e167=_[_0x5f2e('0x2c')](db[_0x5f2e('0x2d')]['rawAttributes'],function(_0xffb034){return{'name':_0xffb034['fieldName'],'type':_0xffb034[_0x5f2e('0x2e')][_0x5f2e('0x2f')]};});_0x6b2fef[_0x5f2e('0x30')]=_[_0x5f2e('0x2c')](_0x39e167,_0x5f2e('0x29'));_0x6b2fef['query']=_[_0x5f2e('0x31')](_0x79272a[_0x5f2e('0x32')]);_0x6b2fef['filters']=_[_0x5f2e('0x33')](_0x6b2fef[_0x5f2e('0x30')],_0x6b2fef[_0x5f2e('0x32')]);_0x5780a0[_0x5f2e('0x34')]=_['intersection'](_0x6b2fef['model'],qs[_0x5f2e('0x35')](_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x35')]));_0x5780a0[_0x5f2e('0x34')]=_0x5780a0[_0x5f2e('0x34')][_0x5f2e('0x36')]?_0x5780a0[_0x5f2e('0x34')]:_0x6b2fef[_0x5f2e('0x30')];if(!_0x79272a['query'][_0x5f2e('0x37')](_0x5f2e('0x38'))){_0x5780a0[_0x5f2e('0x1f')]=qs[_0x5f2e('0x1f')](_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x1f')]);_0x5780a0[_0x5f2e('0x1d')]=qs[_0x5f2e('0x1d')](_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x1d')]);}_0x5780a0[_0x5f2e('0x39')]=qs[_0x5f2e('0x3a')](_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x3a')]);_0x5780a0['where']=qs[_0x5f2e('0x3b')](_[_0x5f2e('0x3c')](_0x79272a[_0x5f2e('0x32')],_0x6b2fef['filters']),_0x39e167);if(_0x79272a['query'][_0x5f2e('0x3d')]){_0x5780a0['where']=_[_0x5f2e('0x3e')](_0x5780a0[_0x5f2e('0x3f')],{'$or':_[_0x5f2e('0x2c')](_0x39e167,function(_0x487f77){if(_0x487f77['type']!==_0x5f2e('0x40')){var _0x115dd6={};_0x115dd6[_0x487f77[_0x5f2e('0x29')]]={'$like':'%'+_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x3d')]+'%'};return _0x115dd6;}})});}_0x5780a0=_['merge']({},_0x5780a0,_0x79272a[_0x5f2e('0x41')]);var _0x31626b={'where':_0x5780a0['where']};return db[_0x5f2e('0x2d')][_0x5f2e('0x20')](_0x31626b)[_0x5f2e('0x26')](function(_0x21b4d6){_0x442956[_0x5f2e('0x20')]=_0x21b4d6;if(_0x79272a[_0x5f2e('0x32')][_0x5f2e('0x42')]){_0x5780a0[_0x5f2e('0x43')]=[{'all':!![]}];}return db[_0x5f2e('0x2d')][_0x5f2e('0x44')](_0x5780a0);})['then'](function(_0x53ca59){_0x442956[_0x5f2e('0x45')]=_0x53ca59;return _0x442956;})[_0x5f2e('0x26')](respondWithFilteredResult(_0x2a670a,_0x5780a0))[_0x5f2e('0x46')](handleError(_0x2a670a,null));};exports[_0x5f2e('0x47')]=function(_0x1dfa57,_0x3ebfa9){var _0x581325={'raw':!![],'where':{'id':_0x1dfa57['params']['id']}},_0x36da98={};_0x36da98[_0x5f2e('0x30')]=_[_0x5f2e('0x31')](db['AnalyticExtractedReport'][_0x5f2e('0x48')]);_0x36da98[_0x5f2e('0x32')]=_[_0x5f2e('0x31')](_0x1dfa57[_0x5f2e('0x32')]);_0x36da98[_0x5f2e('0x3b')]=_[_0x5f2e('0x33')](_0x36da98[_0x5f2e('0x30')],_0x36da98['query']);_0x581325[_0x5f2e('0x34')]=_[_0x5f2e('0x33')](_0x36da98['model'],qs[_0x5f2e('0x35')](_0x1dfa57[_0x5f2e('0x32')][_0x5f2e('0x35')]));_0x581325[_0x5f2e('0x34')]=_0x581325[_0x5f2e('0x34')][_0x5f2e('0x36')]?_0x581325[_0x5f2e('0x34')]:_0x36da98[_0x5f2e('0x30')];if(_0x1dfa57[_0x5f2e('0x32')][_0x5f2e('0x42')]){_0x581325[_0x5f2e('0x43')]=[{'all':!![]}];}_0x581325=_['merge']({},_0x581325,_0x1dfa57[_0x5f2e('0x41')]);return db[_0x5f2e('0x2d')]['find'](_0x581325)[_0x5f2e('0x26')](handleEntityNotFound(_0x3ebfa9,null))[_0x5f2e('0x26')](respondWithResult(_0x3ebfa9,null))[_0x5f2e('0x46')](handleError(_0x3ebfa9,null));};exports[_0x5f2e('0x49')]=function(_0x10fc7e,_0x1e8dda){return db[_0x5f2e('0x2d')][_0x5f2e('0x49')](_0x10fc7e[_0x5f2e('0x4a')],{})[_0x5f2e('0x26')](function(_0x196386){var _0x402278=_0x10fc7e[_0x5f2e('0x4b')][_0x5f2e('0x28')]({'plain':!![]});if(!_0x402278)throw new Error(_0x5f2e('0x4c'));if(_0x402278[_0x5f2e('0x4d')]===_0x5f2e('0x4b')){var _0x3700a2=_0x196386[_0x5f2e('0x28')]({'plain':!![]});var _0x3ec2cc=_0x5f2e('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x3ec2cc,'userProfileId':_0x402278[_0x5f2e('0x4f')]},'raw':!![]})['then'](function(_0x13be2e){if(_0x13be2e&&_0x13be2e['autoAssociation']===0x0){return db[_0x5f2e('0x50')][_0x5f2e('0x49')]({'name':_0x3700a2[_0x5f2e('0x29')],'resourceId':_0x3700a2['id'],'type':_0x13be2e[_0x5f2e('0x29')],'sectionId':_0x13be2e['id']},{})[_0x5f2e('0x26')](function(){return _0x196386;});}else{return _0x196386;}})[_0x5f2e('0x46')](function(_0x4aefa8){logger[_0x5f2e('0x51')](_0x5f2e('0x52'),_0x4aefa8);throw _0x4aefa8;});}return _0x196386;})[_0x5f2e('0x26')](respondWithResult(_0x1e8dda,0xc9))[_0x5f2e('0x46')](handleError(_0x1e8dda,null));};exports['update']=function(_0x45e7e0,_0x17c3ad){if(_0x45e7e0[_0x5f2e('0x4a')]['id']){delete _0x45e7e0[_0x5f2e('0x4a')]['id'];}return db[_0x5f2e('0x2d')][_0x5f2e('0x53')]({'where':{'id':_0x45e7e0['params']['id']}})['then'](handleEntityNotFound(_0x17c3ad,null))[_0x5f2e('0x26')](saveUpdates(_0x45e7e0[_0x5f2e('0x4a')],null))[_0x5f2e('0x26')](respondWithResult(_0x17c3ad,null))['catch'](handleError(_0x17c3ad,null));};exports[_0x5f2e('0x27')]=function(_0x99d85e,_0x5cb929){return db[_0x5f2e('0x2d')][_0x5f2e('0x53')]({'where':{'id':_0x99d85e[_0x5f2e('0x54')]['id']}})[_0x5f2e('0x26')](handleEntityNotFound(_0x5cb929,null))['then'](removeEntity(_0x5cb929,null))[_0x5f2e('0x46')](handleError(_0x5cb929,null));};exports[_0x5f2e('0x55')]=function(_0x458ca6,_0x3f1451,_0x507be8){return db[_0x5f2e('0x2d')][_0x5f2e('0x53')]({'where':{'id':_0x458ca6['params']['id']},'attributes':[_0x5f2e('0x29'),_0x5f2e('0x56'),_0x5f2e('0x57'),'output'],'raw':!![]})[_0x5f2e('0x26')](handleEntityNotFound(_0x3f1451,null))[_0x5f2e('0x26')](function(_0x5a7d15){if(_0x5a7d15){if(!fs['existsSync'](path[_0x5f2e('0x58')](config['root'],_0x5f2e('0x59'),_0x5a7d15[_0x5f2e('0x57')]))){throw new db[(_0x5f2e('0x5a'))][(_0x5f2e('0x5b'))](_0x5f2e('0x5c'));}if(_0x458ca6['query'][_0x5f2e('0x5d')]){return _0x3f1451[_0x5f2e('0x19')](0xc8);}return _0x3f1451[_0x5f2e('0x55')](path[_0x5f2e('0x58')](config[_0x5f2e('0x5e')],_0x5f2e('0x59'),_0x5a7d15[_0x5f2e('0x57')]),util[_0x5f2e('0x5f')](_0x5f2e('0x60'),_0x5a7d15[_0x5f2e('0x56')]||_0x5a7d15['name'],_0x5a7d15[_0x5f2e('0x61')]['toLowerCase']()));}})['catch'](handleError(_0x3f1451,null));}; \ No newline at end of file +var _0xd1a3=['Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset'];(function(_0x4ed061,_0xc87b06){var _0x191d7b=function(_0x44e192){while(--_0x44e192){_0x4ed061['push'](_0x4ed061['shift']());}};_0x191d7b(++_0xc87b06);}(_0xd1a3,0x1d2));var _0x3d1a=function(_0x127074,_0x5ee68c){_0x127074=_0x127074-0x0;var _0x573d19=_0xd1a3[_0x127074];return _0x573d19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d1a('0x0'));var zipdir=require(_0x3d1a('0x1'));var jsonpatch=require(_0x3d1a('0x2'));var rp=require(_0x3d1a('0x3'));var moment=require('moment');var BPromise=require(_0x3d1a('0x4'));var Mustache=require(_0x3d1a('0x5'));var util=require(_0x3d1a('0x6'));var path=require(_0x3d1a('0x7'));var sox=require(_0x3d1a('0x8'));var csv=require(_0x3d1a('0x9'));var ejs=require(_0x3d1a('0xa'));var fs=require('fs');var fs_extra=require(_0x3d1a('0xb'));var _=require(_0x3d1a('0xc'));var squel=require(_0x3d1a('0xd'));var crypto=require(_0x3d1a('0xe'));var jsforce=require(_0x3d1a('0xf'));var deskjs=require(_0x3d1a('0x10'));var toCsv=require(_0x3d1a('0x9'));var querystring=require(_0x3d1a('0x11'));var Papa=require(_0x3d1a('0x12'));var Redis=require(_0x3d1a('0x13'));var authService=require(_0x3d1a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3d1a('0x15'));var hardwareService=require(_0x3d1a('0x16'));var logger=require('../../config/logger')(_0x3d1a('0x17'));var utils=require(_0x3d1a('0x18'));var config=require(_0x3d1a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d1a('0x1a'))['db'];function respondWithStatusCode(_0x299d5b,_0x46d7ea){_0x46d7ea=_0x46d7ea||0xcc;return function(_0x521278){if(_0x521278){return _0x299d5b[_0x3d1a('0x1b')](_0x46d7ea);}return _0x299d5b[_0x3d1a('0x1c')](_0x46d7ea)[_0x3d1a('0x1d')]();};}function respondWithResult(_0x324478,_0x4ad15c){_0x4ad15c=_0x4ad15c||0xc8;return function(_0x215f56){if(_0x215f56){return _0x324478['status'](_0x4ad15c)['json'](_0x215f56);}};}function respondWithFilteredResult(_0x3eb82e,_0xcbbc18){return function(_0x255588){if(_0x255588){var _0x3f9814=typeof _0xcbbc18['offset']==='undefined'&&typeof _0xcbbc18[_0x3d1a('0x1e')]===_0x3d1a('0x1f');var _0x5026a5=_0x255588[_0x3d1a('0x20')];var _0x4ea6c2=_0x3f9814?0x0:_0xcbbc18[_0x3d1a('0x21')];var _0x423966=_0x3f9814?_0x255588['count']:_0xcbbc18[_0x3d1a('0x21')]+_0xcbbc18[_0x3d1a('0x1e')];var _0x34b793;if(_0x423966>=_0x5026a5){_0x423966=_0x5026a5;_0x34b793=0xc8;}else{_0x34b793=0xce;}_0x3eb82e['status'](_0x34b793);return _0x3eb82e['set'](_0x3d1a('0x22'),_0x4ea6c2+'-'+_0x423966+'/'+_0x5026a5)[_0x3d1a('0x23')](_0x255588);}return null;};}function patchUpdates(_0x528c31){return function(_0x229d86){try{jsonpatch[_0x3d1a('0x24')](_0x229d86,_0x528c31,!![]);}catch(_0x4bf2e6){return BPromise[_0x3d1a('0x25')](_0x4bf2e6);}return _0x229d86[_0x3d1a('0x26')]();};}function saveUpdates(_0x725ada,_0x2ad9a5){return function(_0x1a5d53){if(_0x1a5d53){return _0x1a5d53[_0x3d1a('0x27')](_0x725ada)[_0x3d1a('0x28')](function(_0x2afc9b){return _0x2afc9b;});}return null;};}function removeEntity(_0x55bc50,_0x5b8f30){return function(_0x4b1beb){if(_0x4b1beb){return _0x4b1beb[_0x3d1a('0x29')]()['then'](function(){var _0x4f1bc5=_0x4b1beb[_0x3d1a('0x2a')]({'plain':!![]});var _0x4a1cd2='ExtractedReports';return db[_0x3d1a('0x2b')][_0x3d1a('0x29')]({'where':{'type':_0x4a1cd2,'resourceId':_0x4f1bc5['id']}})[_0x3d1a('0x28')](function(){return _0x4b1beb;});})[_0x3d1a('0x28')](function(){_0x55bc50[_0x3d1a('0x1c')](0xcc)[_0x3d1a('0x1d')]();});}};}function handleEntityNotFound(_0x46ffbf,_0x423716){return function(_0x4be454){if(!_0x4be454){_0x46ffbf[_0x3d1a('0x1b')](0x194);}return _0x4be454;};}function handleError(_0x401de6,_0x4cedb8){_0x4cedb8=_0x4cedb8||0x1f4;return function(_0x233bcb){logger[_0x3d1a('0x2c')](_0x233bcb['stack']);if(_0x233bcb['name']){delete _0x233bcb[_0x3d1a('0x2d')];}_0x401de6[_0x3d1a('0x1c')](_0x4cedb8)[_0x3d1a('0x2e')](_0x233bcb);};}exports[_0x3d1a('0x2f')]=function(_0x5e8b6b,_0x13928c){var _0x3fe989={},_0x55f6dc={},_0x3a8fa0={'count':0x0,'rows':[]};var _0x402fa7=_[_0x3d1a('0x30')](db[_0x3d1a('0x31')][_0x3d1a('0x32')],function(_0x338a3f){return{'name':_0x338a3f[_0x3d1a('0x33')],'type':_0x338a3f[_0x3d1a('0x34')][_0x3d1a('0x35')]};});_0x55f6dc['model']=_[_0x3d1a('0x30')](_0x402fa7,'name');_0x55f6dc[_0x3d1a('0x36')]=_['keys'](_0x5e8b6b[_0x3d1a('0x36')]);_0x55f6dc[_0x3d1a('0x37')]=_[_0x3d1a('0x38')](_0x55f6dc[_0x3d1a('0x39')],_0x55f6dc[_0x3d1a('0x36')]);_0x3fe989[_0x3d1a('0x3a')]=_[_0x3d1a('0x38')](_0x55f6dc['model'],qs[_0x3d1a('0x3b')](_0x5e8b6b[_0x3d1a('0x36')][_0x3d1a('0x3b')]));_0x3fe989[_0x3d1a('0x3a')]=_0x3fe989['attributes']['length']?_0x3fe989[_0x3d1a('0x3a')]:_0x55f6dc[_0x3d1a('0x39')];if(!_0x5e8b6b[_0x3d1a('0x36')][_0x3d1a('0x3c')](_0x3d1a('0x3d'))){_0x3fe989[_0x3d1a('0x1e')]=qs[_0x3d1a('0x1e')](_0x5e8b6b['query'][_0x3d1a('0x1e')]);_0x3fe989[_0x3d1a('0x21')]=qs[_0x3d1a('0x21')](_0x5e8b6b[_0x3d1a('0x36')]['offset']);}_0x3fe989[_0x3d1a('0x3e')]=qs[_0x3d1a('0x3f')](_0x5e8b6b[_0x3d1a('0x36')]['sort']);_0x3fe989['where']=qs[_0x3d1a('0x37')](_[_0x3d1a('0x40')](_0x5e8b6b[_0x3d1a('0x36')],_0x55f6dc[_0x3d1a('0x37')]),_0x402fa7);if(_0x5e8b6b[_0x3d1a('0x36')][_0x3d1a('0x41')]){_0x3fe989['where']=_[_0x3d1a('0x42')](_0x3fe989[_0x3d1a('0x43')],{'$or':_[_0x3d1a('0x30')](_0x402fa7,function(_0xaa8da0){if(_0xaa8da0[_0x3d1a('0x34')]!==_0x3d1a('0x44')){var _0x19d27b={};_0x19d27b[_0xaa8da0[_0x3d1a('0x2d')]]={'$like':'%'+_0x5e8b6b[_0x3d1a('0x36')][_0x3d1a('0x41')]+'%'};return _0x19d27b;}})});}_0x3fe989=_['merge']({},_0x3fe989,_0x5e8b6b[_0x3d1a('0x45')]);var _0x3e2870={'where':_0x3fe989[_0x3d1a('0x43')]};return db[_0x3d1a('0x31')][_0x3d1a('0x20')](_0x3e2870)[_0x3d1a('0x28')](function(_0x3dc1a1){_0x3a8fa0['count']=_0x3dc1a1;if(_0x5e8b6b[_0x3d1a('0x36')][_0x3d1a('0x46')]){_0x3fe989['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3d1a('0x47')](_0x3fe989);})[_0x3d1a('0x28')](function(_0x28e4c6){_0x3a8fa0[_0x3d1a('0x48')]=_0x28e4c6;return _0x3a8fa0;})[_0x3d1a('0x28')](respondWithFilteredResult(_0x13928c,_0x3fe989))[_0x3d1a('0x49')](handleError(_0x13928c,null));};exports[_0x3d1a('0x4a')]=function(_0x9a23b6,_0x12396d){var _0x49e008={'raw':!![],'where':{'id':_0x9a23b6[_0x3d1a('0x4b')]['id']}},_0x55943f={};_0x55943f[_0x3d1a('0x39')]=_[_0x3d1a('0x4c')](db[_0x3d1a('0x31')][_0x3d1a('0x32')]);_0x55943f[_0x3d1a('0x36')]=_[_0x3d1a('0x4c')](_0x9a23b6['query']);_0x55943f[_0x3d1a('0x37')]=_['intersection'](_0x55943f[_0x3d1a('0x39')],_0x55943f['query']);_0x49e008[_0x3d1a('0x3a')]=_[_0x3d1a('0x38')](_0x55943f[_0x3d1a('0x39')],qs['fields'](_0x9a23b6[_0x3d1a('0x36')][_0x3d1a('0x3b')]));_0x49e008[_0x3d1a('0x3a')]=_0x49e008['attributes']['length']?_0x49e008[_0x3d1a('0x3a')]:_0x55943f[_0x3d1a('0x39')];if(_0x9a23b6['query']['includeAll']){_0x49e008['include']=[{'all':!![]}];}_0x49e008=_[_0x3d1a('0x42')]({},_0x49e008,_0x9a23b6['options']);return db[_0x3d1a('0x31')]['find'](_0x49e008)[_0x3d1a('0x28')](handleEntityNotFound(_0x12396d,null))[_0x3d1a('0x28')](respondWithResult(_0x12396d,null))['catch'](handleError(_0x12396d,null));};exports[_0x3d1a('0x4d')]=function(_0x2e83a2,_0x3a1a57){return db['AnalyticExtractedReport'][_0x3d1a('0x4d')](_0x2e83a2[_0x3d1a('0x4e')],{})[_0x3d1a('0x28')](function(_0x55bcbc){var _0x3194a7=_0x2e83a2[_0x3d1a('0x4f')][_0x3d1a('0x2a')]({'plain':!![]});if(!_0x3194a7)throw new Error(_0x3d1a('0x50'));if(_0x3194a7['role']==='user'){var _0x269ffe=_0x55bcbc[_0x3d1a('0x2a')]({'plain':!![]});var _0x3f7464=_0x3d1a('0x51');return db[_0x3d1a('0x52')][_0x3d1a('0x53')]({'where':{'name':_0x3f7464,'userProfileId':_0x3194a7[_0x3d1a('0x54')]},'raw':!![]})[_0x3d1a('0x28')](function(_0x4be0f2){if(_0x4be0f2&&_0x4be0f2[_0x3d1a('0x55')]===0x0){return db[_0x3d1a('0x2b')][_0x3d1a('0x4d')]({'name':_0x269ffe['name'],'resourceId':_0x269ffe['id'],'type':_0x4be0f2['name'],'sectionId':_0x4be0f2['id']},{})[_0x3d1a('0x28')](function(){return _0x55bcbc;});}else{return _0x55bcbc;}})[_0x3d1a('0x49')](function(_0x3d06eb){logger[_0x3d1a('0x2c')](_0x3d1a('0x56'),_0x3d06eb);throw _0x3d06eb;});}return _0x55bcbc;})[_0x3d1a('0x28')](respondWithResult(_0x3a1a57,0xc9))[_0x3d1a('0x49')](handleError(_0x3a1a57,null));};exports[_0x3d1a('0x27')]=function(_0x1c2004,_0x404a39){if(_0x1c2004[_0x3d1a('0x4e')]['id']){delete _0x1c2004['body']['id'];}return db[_0x3d1a('0x31')][_0x3d1a('0x53')]({'where':{'id':_0x1c2004[_0x3d1a('0x4b')]['id']}})[_0x3d1a('0x28')](handleEntityNotFound(_0x404a39,null))['then'](saveUpdates(_0x1c2004['body'],null))['then'](respondWithResult(_0x404a39,null))[_0x3d1a('0x49')](handleError(_0x404a39,null));};exports[_0x3d1a('0x29')]=function(_0x52298e,_0x1e717f){return db[_0x3d1a('0x31')]['find']({'where':{'id':_0x52298e['params']['id']}})[_0x3d1a('0x28')](handleEntityNotFound(_0x1e717f,null))['then'](removeEntity(_0x1e717f,null))[_0x3d1a('0x49')](handleError(_0x1e717f,null));};exports['download']=function(_0x2dc8ca,_0x519cfe,_0xb0e71b){return db[_0x3d1a('0x31')][_0x3d1a('0x53')]({'where':{'id':_0x2dc8ca[_0x3d1a('0x4b')]['id']},'attributes':[_0x3d1a('0x2d'),'basename',_0x3d1a('0x57'),_0x3d1a('0x58')],'raw':!![]})[_0x3d1a('0x28')](handleEntityNotFound(_0x519cfe,null))[_0x3d1a('0x28')](function(_0x4df37c){if(_0x4df37c){if(!fs[_0x3d1a('0x59')](path[_0x3d1a('0x5a')](config[_0x3d1a('0x5b')],'server/files/reports',_0x4df37c[_0x3d1a('0x57')]))){throw new db[(_0x3d1a('0x5c'))][(_0x3d1a('0x5d'))](_0x3d1a('0x5e'));}if(_0x2dc8ca[_0x3d1a('0x36')][_0x3d1a('0x5f')]){return _0x519cfe[_0x3d1a('0x1b')](0xc8);}return _0x519cfe['download'](path[_0x3d1a('0x5a')](config[_0x3d1a('0x5b')],'server/files/reports',_0x4df37c[_0x3d1a('0x57')]),util[_0x3d1a('0x60')](_0x3d1a('0x61'),_0x4df37c[_0x3d1a('0x62')]||_0x4df37c[_0x3d1a('0x2d')],_0x4df37c[_0x3d1a('0x58')][_0x3d1a('0x63')]()));}})['catch'](handleError(_0x519cfe,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index aa727de..3ba620b 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 _0x49ee=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x1c127a,_0x2c2dc5){var _0x392b19=function(_0x5d5ec8){while(--_0x5d5ec8){_0x1c127a['push'](_0x1c127a['shift']());}};_0x392b19(++_0x2c2dc5);}(_0x49ee,0x1e3));var _0xe49e=function(_0x165346,_0x3c0412){_0x165346=_0x165346-0x0;var _0x1fdf12=_0x49ee[_0x165346];return _0x1fdf12;};'use strict';var _=require(_0xe49e('0x0'));var util=require(_0xe49e('0x1'));var logger=require(_0xe49e('0x2'))(_0xe49e('0x3'));var moment=require(_0xe49e('0x4'));var BPromise=require(_0xe49e('0x5'));var rp=require(_0xe49e('0x6'));var fs=require('fs');var path=require(_0xe49e('0x7'));var rimraf=require(_0xe49e('0x8'));var config=require(_0xe49e('0x9'));var attributes=require(_0xe49e('0xa'));module[_0xe49e('0xb')]=function(_0x263658,_0x3866e9){return _0x263658[_0xe49e('0xc')](_0xe49e('0xd'),attributes,{'tableName':_0xe49e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0435=['bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','util','../../config/logger','api','moment'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0x0435,0x193));var _0x5043=function(_0x36c174,_0xa233ec){_0x36c174=_0x36c174-0x0;var _0x4ec6c3=_0x0435[_0x36c174];return _0x4ec6c3;};'use strict';var _=require('lodash');var util=require(_0x5043('0x0'));var logger=require(_0x5043('0x1'))(_0x5043('0x2'));var moment=require(_0x5043('0x3'));var BPromise=require(_0x5043('0x4'));var rp=require(_0x5043('0x5'));var fs=require('fs');var path=require(_0x5043('0x6'));var rimraf=require('rimraf');var config=require(_0x5043('0x7'));var attributes=require(_0x5043('0x8'));module[_0x5043('0x9')]=function(_0x57a5c5,_0x501c66){return _0x57a5c5['define'](_0x5043('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index ef23010..2120453 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 _0x38e9=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x38e9,0x1c5));var _0x938e=function(_0x2acd64,_0x4e8ce8){_0x2acd64=_0x2acd64-0x0;var _0x3d3fce=_0x38e9[_0x2acd64];return _0x3d3fce;};'use strict';var _=require(_0x938e('0x0'));var util=require(_0x938e('0x1'));var moment=require('moment');var BPromise=require(_0x938e('0x2'));var rs=require(_0x938e('0x3'));var fs=require('fs');var Redis=require(_0x938e('0x4'));var db=require(_0x938e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x938e('0x6'))(_0x938e('0x7'));var config=require(_0x938e('0x8'));var jayson=require(_0x938e('0x9'));var client=jayson[_0x938e('0xa')][_0x938e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58aa0d,_0x456d41,_0x3fc1d9){return new BPromise(function(_0x39d56a,_0x2a1a6f){return client[_0x938e('0xc')](_0x58aa0d,_0x3fc1d9)[_0x938e('0xd')](function(_0x10df46){logger[_0x938e('0xe')](_0x938e('0xf'),_0x456d41,'request\x20sent');logger[_0x938e('0x10')](_0x938e('0x11'),_0x456d41,_0x938e('0x12'),JSON[_0x938e('0x13')](_0x10df46));if(_0x10df46[_0x938e('0x14')]){if(_0x10df46[_0x938e('0x14')][_0x938e('0x15')]===0x1f4){logger[_0x938e('0x14')](_0x938e('0xf'),_0x456d41,_0x10df46[_0x938e('0x14')][_0x938e('0x16')]);return _0x2a1a6f(_0x10df46['error']['message']);}logger[_0x938e('0x14')](_0x938e('0xf'),_0x456d41,_0x10df46[_0x938e('0x14')]['message']);return _0x39d56a(_0x10df46[_0x938e('0x14')][_0x938e('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x456d41,_0x938e('0x12'));_0x39d56a(_0x10df46[_0x938e('0x17')][_0x938e('0x16')]);}})[_0x938e('0x18')](function(_0xccf09c){logger[_0x938e('0x14')](_0x938e('0xf'),_0x456d41,_0xccf09c);_0x2a1a6f(_0xccf09c);});});} \ No newline at end of file +var _0xfc33=['code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xfc33,0xab));var _0x3fc3=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfc33[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x3fc3('0x0'));var util=require('util');var moment=require(_0x3fc3('0x1'));var BPromise=require(_0x3fc3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc3('0x3'));var db=require(_0x3fc3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc3('0x5'));var config=require(_0x3fc3('0x6'));var jayson=require(_0x3fc3('0x7'));var client=jayson['client'][_0x3fc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43f5bd,_0x1e5622,_0x9b12e0){return new BPromise(function(_0x3c630c,_0x4ee702){return client[_0x3fc3('0x9')](_0x43f5bd,_0x9b12e0)[_0x3fc3('0xa')](function(_0x10566d){logger[_0x3fc3('0xb')](_0x3fc3('0xc'),_0x1e5622,_0x3fc3('0xd'));logger[_0x3fc3('0xe')](_0x3fc3('0xf'),_0x1e5622,'request\x20sent',JSON[_0x3fc3('0x10')](_0x10566d));if(_0x10566d['error']){if(_0x10566d[_0x3fc3('0x11')][_0x3fc3('0x12')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e5622,_0x10566d[_0x3fc3('0x11')][_0x3fc3('0x13')]);return _0x4ee702(_0x10566d[_0x3fc3('0x11')][_0x3fc3('0x13')]);}logger['error'](_0x3fc3('0xc'),_0x1e5622,_0x10566d[_0x3fc3('0x11')]['message']);return _0x3c630c(_0x10566d[_0x3fc3('0x11')]['message']);}else{logger[_0x3fc3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e5622,_0x3fc3('0xd'));_0x3c630c(_0x10566d[_0x3fc3('0x14')][_0x3fc3('0x13')]);}})['catch'](function(_0x11724f){logger[_0x3fc3('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e5622,_0x11724f);_0x4ee702(_0x11724f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 68b180c..e1f5985 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 _0x5b37=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','download','create','put','update','delete','destroy','exports','multer'];(function(_0x1dad17,_0x45e26d){var _0x1796ec=function(_0x5d1f44){while(--_0x5d1f44){_0x1dad17['push'](_0x1dad17['shift']());}};_0x1796ec(++_0x45e26d);}(_0x5b37,0x125));var _0x75b3=function(_0x90ae4b,_0x40a3b6){_0x90ae4b=_0x90ae4b-0x0;var _0x23e212=_0x5b37[_0x90ae4b];return _0x23e212;};'use strict';var multer=require(_0x75b3('0x0'));var util=require(_0x75b3('0x1'));var path=require(_0x75b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x75b3('0x3'));var router=express[_0x75b3('0x4')]();var fs_extra=require(_0x75b3('0x5'));var auth=require(_0x75b3('0x6'));var interaction=require(_0x75b3('0x7'));var config=require(_0x75b3('0x8'));var controller=require(_0x75b3('0x9'));router['get']('/',auth[_0x75b3('0xa')](),controller['index']);router[_0x75b3('0xb')](_0x75b3('0xc'),auth[_0x75b3('0xa')](),controller['show']);router[_0x75b3('0xb')](_0x75b3('0xd'),auth[_0x75b3('0xa')](),controller[_0x75b3('0xe')]);router['post']('/',auth[_0x75b3('0xa')](),controller[_0x75b3('0xf')]);router[_0x75b3('0x10')](_0x75b3('0xc'),auth[_0x75b3('0xa')](),controller[_0x75b3('0x11')]);router[_0x75b3('0x12')](_0x75b3('0xc'),auth[_0x75b3('0xa')](),controller[_0x75b3('0x13')]);module[_0x75b3('0x14')]=router; \ No newline at end of file +var _0x4448=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x42d1c8,_0xc13c44){var _0x22f990=function(_0x3ce85f){while(--_0x3ce85f){_0x42d1c8['push'](_0x42d1c8['shift']());}};_0x22f990(++_0xc13c44);}(_0x4448,0x18e));var _0x8444=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4448[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8444('0x0'));var util=require(_0x8444('0x1'));var path=require(_0x8444('0x2'));var timeout=require(_0x8444('0x3'));var express=require(_0x8444('0x4'));var router=express[_0x8444('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8444('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x8444('0x7')]('/',auth[_0x8444('0x8')](),controller[_0x8444('0x9')]);router['get'](_0x8444('0xa'),auth[_0x8444('0x8')](),controller[_0x8444('0xb')]);router['get']('/:id/download',auth[_0x8444('0x8')](),controller['download']);router[_0x8444('0xc')]('/',auth[_0x8444('0x8')](),controller['create']);router[_0x8444('0xd')](_0x8444('0xa'),auth[_0x8444('0x8')](),controller[_0x8444('0xe')]);router[_0x8444('0xf')](_0x8444('0xa'),auth['isAuthenticated'](),controller[_0x8444('0x10')]);module[_0x8444('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index de5f4fb..8050398 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 _0x0a39=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a39,0x14d));var _0x90a3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0a39[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x90a3('0x0'));module['exports']={'field':{'type':Sequelize[_0x90a3('0x1')]},'alias':{'type':Sequelize[_0x90a3('0x2')]},'function':{'type':Sequelize[_0x90a3('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x90a3('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x90a3('0x2')]},'custom':{'type':Sequelize[_0x90a3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x24b7=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x40d032,_0x86acd4){var _0x2cdec1=function(_0x21b4f6){while(--_0x21b4f6){_0x40d032['push'](_0x40d032['shift']());}};_0x2cdec1(++_0x86acd4);}(_0x24b7,0xb4));var _0x724b=function(_0x27d854,_0x26df5e){_0x27d854=_0x27d854-0x0;var _0x482ff6=_0x24b7[_0x27d854];return _0x482ff6;};'use strict';var Sequelize=require(_0x724b('0x0'));module[_0x724b('0x1')]={'field':{'type':Sequelize[_0x724b('0x2')]},'alias':{'type':Sequelize[_0x724b('0x3')]},'function':{'type':Sequelize[_0x724b('0x3')]},'format':{'type':Sequelize[_0x724b('0x3')]},'groupBy':{'type':Sequelize[_0x724b('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x724b('0x3')]},'custom':{'type':Sequelize[_0x724b('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 084d9cb..11c45ee 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 _0xeabc=['mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','bulkCreate','eml-format','rimraf','zip-dir','moment','bluebird'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0xeabc,0x9b));var _0xceab=function(_0x3b9234,_0x416809){_0x3b9234=_0x3b9234-0x0;var _0x59d12e=_0xeabc[_0x3b9234];return _0x59d12e;};'use strict';var emlformat=require(_0xceab('0x0'));var rimraf=require(_0xceab('0x1'));var zipdir=require(_0xceab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xceab('0x3'));var BPromise=require(_0xceab('0x4'));var Mustache=require(_0xceab('0x5'));var util=require(_0xceab('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xceab('0x7'));var ejs=require(_0xceab('0x8'));var fs=require('fs');var fs_extra=require(_0xceab('0x9'));var _=require(_0xceab('0xa'));var squel=require('squel');var crypto=require(_0xceab('0xb'));var jsforce=require(_0xceab('0xc'));var deskjs=require(_0xceab('0xd'));var toCsv=require(_0xceab('0x7'));var querystring=require(_0xceab('0xe'));var Papa=require(_0xceab('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xceab('0x10'));var hardwareService=require(_0xceab('0x11'));var logger=require(_0xceab('0x12'))(_0xceab('0x13'));var utils=require(_0xceab('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xceab('0x15'));var db=require(_0xceab('0x16'))['db'];function respondWithStatusCode(_0x4e4b9b,_0x29f8bb){_0x29f8bb=_0x29f8bb||0xcc;return function(_0x4ad261){if(_0x4ad261){return _0x4e4b9b['sendStatus'](_0x29f8bb);}return _0x4e4b9b[_0xceab('0x17')](_0x29f8bb)[_0xceab('0x18')]();};}function respondWithResult(_0x28c1aa,_0x509358){_0x509358=_0x509358||0xc8;return function(_0x1fc188){if(_0x1fc188){return _0x28c1aa[_0xceab('0x17')](_0x509358)[_0xceab('0x19')](_0x1fc188);}};}function respondWithFilteredResult(_0x36a50e,_0x20b9d9){return function(_0x33bfc3){if(_0x33bfc3){var _0x398ce5=typeof _0x20b9d9[_0xceab('0x1a')]===_0xceab('0x1b')&&typeof _0x20b9d9['limit']===_0xceab('0x1b');var _0x82ecc3=_0x33bfc3[_0xceab('0x1c')];var _0x266a33=_0x398ce5?0x0:_0x20b9d9['offset'];var _0x100598=_0x398ce5?_0x33bfc3[_0xceab('0x1c')]:_0x20b9d9[_0xceab('0x1a')]+_0x20b9d9[_0xceab('0x1d')];var _0x26b21a;if(_0x100598>=_0x82ecc3){_0x100598=_0x82ecc3;_0x26b21a=0xc8;}else{_0x26b21a=0xce;}_0x36a50e[_0xceab('0x17')](_0x26b21a);return _0x36a50e[_0xceab('0x1e')](_0xceab('0x1f'),_0x266a33+'-'+_0x100598+'/'+_0x82ecc3)[_0xceab('0x19')](_0x33bfc3);}return null;};}function patchUpdates(_0x27105a){return function(_0x5c33e4){try{jsonpatch['apply'](_0x5c33e4,_0x27105a,!![]);}catch(_0x3a512c){return BPromise[_0xceab('0x20')](_0x3a512c);}return _0x5c33e4[_0xceab('0x21')]();};}function saveUpdates(_0x350f20,_0x3c2b58){return function(_0x20f3ab){if(_0x20f3ab){return _0x20f3ab[_0xceab('0x22')](_0x350f20)[_0xceab('0x23')](function(_0x4ba91c){return _0x4ba91c;});}return null;};}function removeEntity(_0x43f056,_0x544281){return function(_0x34def6){if(_0x34def6){return _0x34def6[_0xceab('0x24')]()[_0xceab('0x23')](function(){_0x43f056['status'](0xcc)[_0xceab('0x18')]();});}};}function handleEntityNotFound(_0x236ed2,_0x476778){return function(_0x29e5ee){if(!_0x29e5ee){_0x236ed2[_0xceab('0x25')](0x194);}return _0x29e5ee;};}function handleError(_0x41b580,_0x6b85e3){_0x6b85e3=_0x6b85e3||0x1f4;return function(_0x14a53a){logger[_0xceab('0x26')](_0x14a53a[_0xceab('0x27')]);if(_0x14a53a['name']){delete _0x14a53a[_0xceab('0x28')];}_0x41b580[_0xceab('0x17')](_0x6b85e3)[_0xceab('0x29')](_0x14a53a);};}exports[_0xceab('0x2a')]=function(_0x15aa79,_0x1ec5af){var _0x439f3b={},_0x1eaaf8={},_0x5764e6={'count':0x0,'rows':[]};var _0x3e5314=_[_0xceab('0x2b')](db[_0xceab('0x2c')][_0xceab('0x2d')],function(_0x110410){return{'name':_0x110410['fieldName'],'type':_0x110410[_0xceab('0x2e')][_0xceab('0x2f')]};});_0x1eaaf8[_0xceab('0x30')]=_[_0xceab('0x2b')](_0x3e5314,_0xceab('0x28'));_0x1eaaf8[_0xceab('0x31')]=_[_0xceab('0x32')](_0x15aa79[_0xceab('0x31')]);_0x1eaaf8[_0xceab('0x33')]=_[_0xceab('0x34')](_0x1eaaf8[_0xceab('0x30')],_0x1eaaf8['query']);_0x439f3b['attributes']=_['intersection'](_0x1eaaf8[_0xceab('0x30')],qs[_0xceab('0x35')](_0x15aa79[_0xceab('0x31')][_0xceab('0x35')]));_0x439f3b[_0xceab('0x36')]=_0x439f3b['attributes']['length']?_0x439f3b[_0xceab('0x36')]:_0x1eaaf8['model'];if(!_0x15aa79[_0xceab('0x31')][_0xceab('0x37')](_0xceab('0x38'))){_0x439f3b[_0xceab('0x1d')]=qs[_0xceab('0x1d')](_0x15aa79[_0xceab('0x31')][_0xceab('0x1d')]);_0x439f3b[_0xceab('0x1a')]=qs['offset'](_0x15aa79['query'][_0xceab('0x1a')]);}_0x439f3b[_0xceab('0x39')]=qs[_0xceab('0x3a')](_0x15aa79[_0xceab('0x31')]['sort']);_0x439f3b[_0xceab('0x3b')]=qs[_0xceab('0x33')](_[_0xceab('0x3c')](_0x15aa79[_0xceab('0x31')],_0x1eaaf8[_0xceab('0x33')]),_0x3e5314);if(_0x15aa79[_0xceab('0x31')][_0xceab('0x3d')]){_0x439f3b[_0xceab('0x3b')]=_[_0xceab('0x3e')](_0x439f3b['where'],{'$or':_[_0xceab('0x2b')](_0x3e5314,function(_0x5b8ff6){if(_0x5b8ff6[_0xceab('0x2e')]!==_0xceab('0x3f')){var _0x4f7353={};_0x4f7353[_0x5b8ff6[_0xceab('0x28')]]={'$like':'%'+_0x15aa79[_0xceab('0x31')][_0xceab('0x3d')]+'%'};return _0x4f7353;}})});}_0x439f3b=_[_0xceab('0x3e')]({},_0x439f3b,_0x15aa79[_0xceab('0x40')]);var _0x133703={'where':_0x439f3b['where']};return db[_0xceab('0x2c')][_0xceab('0x1c')](_0x133703)[_0xceab('0x23')](function(_0x5a4d0e){_0x5764e6[_0xceab('0x1c')]=_0x5a4d0e;if(_0x15aa79[_0xceab('0x31')][_0xceab('0x41')]){_0x439f3b['include']=[{'all':!![]}];}return db[_0xceab('0x2c')][_0xceab('0x42')](_0x439f3b);})['then'](function(_0x39a244){_0x5764e6[_0xceab('0x43')]=_0x39a244;return _0x5764e6;})[_0xceab('0x23')](respondWithFilteredResult(_0x1ec5af,_0x439f3b))[_0xceab('0x44')](handleError(_0x1ec5af,null));};exports['show']=function(_0x190ca5,_0x2670b7){var _0x48762e={'raw':![],'where':{'id':_0x190ca5[_0xceab('0x45')]['id']}},_0x296998={};_0x296998['model']=_[_0xceab('0x32')](db[_0xceab('0x2c')][_0xceab('0x2d')]);_0x296998[_0xceab('0x31')]=_[_0xceab('0x32')](_0x190ca5[_0xceab('0x31')]);_0x296998[_0xceab('0x33')]=_[_0xceab('0x34')](_0x296998[_0xceab('0x30')],_0x296998[_0xceab('0x31')]);_0x48762e[_0xceab('0x36')]=_[_0xceab('0x34')](_0x296998[_0xceab('0x30')],qs['fields'](_0x190ca5['query'][_0xceab('0x35')]));_0x48762e[_0xceab('0x36')]=_0x48762e[_0xceab('0x36')]['length']?_0x48762e[_0xceab('0x36')]:_0x296998[_0xceab('0x30')];if(_0x190ca5[_0xceab('0x31')]['includeAll']){_0x48762e[_0xceab('0x46')]=[{'all':!![]}];}_0x48762e=_[_0xceab('0x3e')]({},_0x48762e,_0x190ca5['options']);return db[_0xceab('0x2c')][_0xceab('0x47')](_0x48762e)['then'](handleEntityNotFound(_0x2670b7,null))[_0xceab('0x23')](respondWithResult(_0x2670b7,null))[_0xceab('0x44')](handleError(_0x2670b7,null));};exports[_0xceab('0x48')]=function(_0xf3b051,_0x225290){return db[_0xceab('0x2c')][_0xceab('0x48')](_0xf3b051[_0xceab('0x49')],{})['then'](respondWithResult(_0x225290,0xc9))['catch'](handleError(_0x225290,null));};exports['bulkCreate']=function(_0x313283,_0x3978e5){return db[_0xceab('0x2c')]['bulkCreate'](_0x313283[_0xceab('0x49')],{'raw':![],'individualHooks':!![]})[_0xceab('0x23')](respondWithResult(_0x3978e5,0xc9))[_0xceab('0x44')](handleError(_0x3978e5,null));};exports[_0xceab('0x22')]=function(_0x15d1f4,_0x2fafc7){if(_0x15d1f4[_0xceab('0x49')]['id']){delete _0x15d1f4[_0xceab('0x49')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x15d1f4[_0xceab('0x45')]['id']}})[_0xceab('0x23')](handleEntityNotFound(_0x2fafc7,null))[_0xceab('0x23')](saveUpdates(_0x15d1f4[_0xceab('0x49')],null))[_0xceab('0x23')](respondWithResult(_0x2fafc7,null))['catch'](handleError(_0x2fafc7,null));};exports[_0xceab('0x24')]=function(_0x2d4732,_0x5128c5){return db[_0xceab('0x2c')][_0xceab('0x47')]({'where':{'id':_0x2d4732[_0xceab('0x45')]['id']}})[_0xceab('0x23')](handleEntityNotFound(_0x5128c5,null))[_0xceab('0x23')](removeEntity(_0x5128c5,null))[_0xceab('0x44')](handleError(_0x5128c5,null));};exports['bulkDestroy']=function(_0x599370,_0x17bfa5){return db[_0xceab('0x2c')][_0xceab('0x24')]({'where':{'id':_0x599370[_0xceab('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x17bfa5,0xcc))[_0xceab('0x44')](handleError(_0x17bfa5,null));};exports['addFields']=function(_0x32ac26,_0x5556ee,_0x525333){return db[_0xceab('0x4a')][_0xceab('0x4b')]({'where':{'id':_0x32ac26['params']['id']}})[_0xceab('0x23')](handleEntityNotFound(_0x5556ee,null))[_0xceab('0x23')](function(_0x1c893d){if(_0x1c893d){return db[_0xceab('0x4c')][_0xceab('0x4d')](function(_0x516885){return db[_0xceab('0x2c')][_0xceab('0x24')]({'where':{'CustomReportId':_0x32ac26['params']['id']},'transaction':_0x516885})['then'](function(_0x4814ce){var _0x530eed=_['map'](_0x32ac26[_0xceab('0x49')],function(_0x313803){delete _0x313803['id'];_0x313803[_0xceab('0x4e')]=_0x32ac26[_0xceab('0x45')]['id'];return _0x313803;});return db[_0xceab('0x2c')][_0xceab('0x4f')](_0x530eed,{'transaction':_0x516885});});})[_0xceab('0x23')](function(){return db[_0xceab('0x2c')][_0xceab('0x42')]({'where':{'CustomReportId':_0x32ac26[_0xceab('0x45')]['id']}});});}})[_0xceab('0x23')](respondWithResult(_0x5556ee,null))['catch'](handleError(_0x5556ee,null));}; \ No newline at end of file +var _0x1214=['sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','bulkCreate','update','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order'];(function(_0x4edaf7,_0x1c2c64){var _0x151cea=function(_0x49db41){while(--_0x49db41){_0x4edaf7['push'](_0x4edaf7['shift']());}};_0x151cea(++_0x1c2c64);}(_0x1214,0x6e));var _0x4121=function(_0x24bbd5,_0x34a7c4){_0x24bbd5=_0x24bbd5-0x0;var _0x8fb737=_0x1214[_0x24bbd5];return _0x8fb737;};'use strict';var emlformat=require(_0x4121('0x0'));var rimraf=require(_0x4121('0x1'));var zipdir=require(_0x4121('0x2'));var jsonpatch=require(_0x4121('0x3'));var rp=require('request-promise');var moment=require(_0x4121('0x4'));var BPromise=require(_0x4121('0x5'));var Mustache=require(_0x4121('0x6'));var util=require(_0x4121('0x7'));var path=require(_0x4121('0x8'));var sox=require('sox');var csv=require(_0x4121('0x9'));var ejs=require(_0x4121('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4121('0xb'));var squel=require(_0x4121('0xc'));var crypto=require(_0x4121('0xd'));var jsforce=require(_0x4121('0xe'));var deskjs=require(_0x4121('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4121('0x10'));var Redis=require(_0x4121('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4121('0x12'));var as=require(_0x4121('0x13'));var hardwareService=require(_0x4121('0x14'));var logger=require(_0x4121('0x15'))('api');var utils=require(_0x4121('0x16'));var config=require(_0x4121('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4121('0x18'))['db'];function respondWithStatusCode(_0x1db5a5,_0x2d59da){_0x2d59da=_0x2d59da||0xcc;return function(_0x22987c){if(_0x22987c){return _0x1db5a5[_0x4121('0x19')](_0x2d59da);}return _0x1db5a5[_0x4121('0x1a')](_0x2d59da)['end']();};}function respondWithResult(_0x414f7b,_0x5325a7){_0x5325a7=_0x5325a7||0xc8;return function(_0x2452ce){if(_0x2452ce){return _0x414f7b['status'](_0x5325a7)[_0x4121('0x1b')](_0x2452ce);}};}function respondWithFilteredResult(_0x145593,_0x1d8e54){return function(_0x216bba){if(_0x216bba){var _0x18aff6=typeof _0x1d8e54[_0x4121('0x1c')]===_0x4121('0x1d')&&typeof _0x1d8e54[_0x4121('0x1e')]===_0x4121('0x1d');var _0x5391f8=_0x216bba[_0x4121('0x1f')];var _0x1c4b05=_0x18aff6?0x0:_0x1d8e54[_0x4121('0x1c')];var _0x5acf79=_0x18aff6?_0x216bba[_0x4121('0x1f')]:_0x1d8e54[_0x4121('0x1c')]+_0x1d8e54[_0x4121('0x1e')];var _0x4f43d7;if(_0x5acf79>=_0x5391f8){_0x5acf79=_0x5391f8;_0x4f43d7=0xc8;}else{_0x4f43d7=0xce;}_0x145593[_0x4121('0x1a')](_0x4f43d7);return _0x145593[_0x4121('0x20')]('Content-Range',_0x1c4b05+'-'+_0x5acf79+'/'+_0x5391f8)[_0x4121('0x1b')](_0x216bba);}return null;};}function patchUpdates(_0x1c667c){return function(_0x5efdb3){try{jsonpatch[_0x4121('0x21')](_0x5efdb3,_0x1c667c,!![]);}catch(_0x3b7937){return BPromise[_0x4121('0x22')](_0x3b7937);}return _0x5efdb3[_0x4121('0x23')]();};}function saveUpdates(_0x595c00,_0xc7439b){return function(_0x4327e3){if(_0x4327e3){return _0x4327e3['update'](_0x595c00)['then'](function(_0x2b3c02){return _0x2b3c02;});}return null;};}function removeEntity(_0x548048,_0x3b87d0){return function(_0x3e0c90){if(_0x3e0c90){return _0x3e0c90[_0x4121('0x24')]()[_0x4121('0x25')](function(){_0x548048[_0x4121('0x1a')](0xcc)[_0x4121('0x26')]();});}};}function handleEntityNotFound(_0x4c3695,_0x2f405e){return function(_0x436779){if(!_0x436779){_0x4c3695[_0x4121('0x19')](0x194);}return _0x436779;};}function handleError(_0x5c9328,_0x20ac78){_0x20ac78=_0x20ac78||0x1f4;return function(_0x10a1d7){logger[_0x4121('0x27')](_0x10a1d7[_0x4121('0x28')]);if(_0x10a1d7[_0x4121('0x29')]){delete _0x10a1d7['name'];}_0x5c9328[_0x4121('0x1a')](_0x20ac78)[_0x4121('0x2a')](_0x10a1d7);};}exports[_0x4121('0x2b')]=function(_0x2e88e6,_0x4d8742){var _0xc213b2={},_0x19952b={},_0x43750f={'count':0x0,'rows':[]};var _0x568b72=_[_0x4121('0x2c')](db[_0x4121('0x2d')][_0x4121('0x2e')],function(_0x29f372){return{'name':_0x29f372[_0x4121('0x2f')],'type':_0x29f372[_0x4121('0x30')][_0x4121('0x31')]};});_0x19952b[_0x4121('0x32')]=_[_0x4121('0x2c')](_0x568b72,_0x4121('0x29'));_0x19952b['query']=_[_0x4121('0x33')](_0x2e88e6['query']);_0x19952b['filters']=_[_0x4121('0x34')](_0x19952b['model'],_0x19952b['query']);_0xc213b2[_0x4121('0x35')]=_[_0x4121('0x34')](_0x19952b['model'],qs[_0x4121('0x36')](_0x2e88e6[_0x4121('0x37')][_0x4121('0x36')]));_0xc213b2[_0x4121('0x35')]=_0xc213b2[_0x4121('0x35')][_0x4121('0x38')]?_0xc213b2[_0x4121('0x35')]:_0x19952b[_0x4121('0x32')];if(!_0x2e88e6['query'][_0x4121('0x39')](_0x4121('0x3a'))){_0xc213b2[_0x4121('0x1e')]=qs['limit'](_0x2e88e6['query'][_0x4121('0x1e')]);_0xc213b2[_0x4121('0x1c')]=qs['offset'](_0x2e88e6[_0x4121('0x37')]['offset']);}_0xc213b2[_0x4121('0x3b')]=qs[_0x4121('0x3c')](_0x2e88e6['query']['sort']);_0xc213b2['where']=qs[_0x4121('0x3d')](_[_0x4121('0x3e')](_0x2e88e6[_0x4121('0x37')],_0x19952b[_0x4121('0x3d')]),_0x568b72);if(_0x2e88e6[_0x4121('0x37')]['filter']){_0xc213b2['where']=_[_0x4121('0x3f')](_0xc213b2[_0x4121('0x40')],{'$or':_[_0x4121('0x2c')](_0x568b72,function(_0x4b14c8){if(_0x4b14c8['type']!==_0x4121('0x41')){var _0x3bebcb={};_0x3bebcb[_0x4b14c8[_0x4121('0x29')]]={'$like':'%'+_0x2e88e6[_0x4121('0x37')][_0x4121('0x42')]+'%'};return _0x3bebcb;}})});}_0xc213b2=_[_0x4121('0x3f')]({},_0xc213b2,_0x2e88e6[_0x4121('0x43')]);var _0x1665ac={'where':_0xc213b2[_0x4121('0x40')]};return db[_0x4121('0x2d')][_0x4121('0x1f')](_0x1665ac)[_0x4121('0x25')](function(_0x9e5a8c){_0x43750f[_0x4121('0x1f')]=_0x9e5a8c;if(_0x2e88e6[_0x4121('0x37')][_0x4121('0x44')]){_0xc213b2[_0x4121('0x45')]=[{'all':!![]}];}return db[_0x4121('0x2d')][_0x4121('0x46')](_0xc213b2);})[_0x4121('0x25')](function(_0x16c8ac){_0x43750f['rows']=_0x16c8ac;return _0x43750f;})[_0x4121('0x25')](respondWithFilteredResult(_0x4d8742,_0xc213b2))['catch'](handleError(_0x4d8742,null));};exports[_0x4121('0x47')]=function(_0x30613b,_0x1f4510){var _0x4071e9={'raw':![],'where':{'id':_0x30613b[_0x4121('0x48')]['id']}},_0x398d1b={};_0x398d1b[_0x4121('0x32')]=_[_0x4121('0x33')](db[_0x4121('0x2d')][_0x4121('0x2e')]);_0x398d1b['query']=_['keys'](_0x30613b[_0x4121('0x37')]);_0x398d1b[_0x4121('0x3d')]=_['intersection'](_0x398d1b[_0x4121('0x32')],_0x398d1b[_0x4121('0x37')]);_0x4071e9[_0x4121('0x35')]=_['intersection'](_0x398d1b[_0x4121('0x32')],qs['fields'](_0x30613b['query'][_0x4121('0x36')]));_0x4071e9[_0x4121('0x35')]=_0x4071e9[_0x4121('0x35')][_0x4121('0x38')]?_0x4071e9['attributes']:_0x398d1b['model'];if(_0x30613b[_0x4121('0x37')][_0x4121('0x44')]){_0x4071e9['include']=[{'all':!![]}];}_0x4071e9=_['merge']({},_0x4071e9,_0x30613b['options']);return db[_0x4121('0x2d')][_0x4121('0x49')](_0x4071e9)[_0x4121('0x25')](handleEntityNotFound(_0x1f4510,null))['then'](respondWithResult(_0x1f4510,null))[_0x4121('0x4a')](handleError(_0x1f4510,null));};exports[_0x4121('0x4b')]=function(_0x47e7c1,_0xe89141){return db[_0x4121('0x2d')][_0x4121('0x4b')](_0x47e7c1[_0x4121('0x4c')],{})[_0x4121('0x25')](respondWithResult(_0xe89141,0xc9))['catch'](handleError(_0xe89141,null));};exports[_0x4121('0x4d')]=function(_0x5a8256,_0x4689f6){return db[_0x4121('0x2d')][_0x4121('0x4d')](_0x5a8256[_0x4121('0x4c')],{'raw':![],'individualHooks':!![]})[_0x4121('0x25')](respondWithResult(_0x4689f6,0xc9))[_0x4121('0x4a')](handleError(_0x4689f6,null));};exports[_0x4121('0x4e')]=function(_0x2ce6fb,_0x5d0766){if(_0x2ce6fb['body']['id']){delete _0x2ce6fb[_0x4121('0x4c')]['id'];}return db[_0x4121('0x2d')][_0x4121('0x49')]({'where':{'id':_0x2ce6fb[_0x4121('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d0766,null))[_0x4121('0x25')](saveUpdates(_0x2ce6fb[_0x4121('0x4c')],null))[_0x4121('0x25')](respondWithResult(_0x5d0766,null))[_0x4121('0x4a')](handleError(_0x5d0766,null));};exports[_0x4121('0x24')]=function(_0x456791,_0x2e24b5){return db[_0x4121('0x2d')][_0x4121('0x49')]({'where':{'id':_0x456791[_0x4121('0x48')]['id']}})[_0x4121('0x25')](handleEntityNotFound(_0x2e24b5,null))[_0x4121('0x25')](removeEntity(_0x2e24b5,null))[_0x4121('0x4a')](handleError(_0x2e24b5,null));};exports[_0x4121('0x4f')]=function(_0x3dd2c3,_0x4a3e27){return db[_0x4121('0x2d')][_0x4121('0x24')]({'where':{'id':_0x3dd2c3[_0x4121('0x37')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4121('0x25')](respondWithResult(_0x4a3e27,0xcc))[_0x4121('0x4a')](handleError(_0x4a3e27,null));};exports[_0x4121('0x50')]=function(_0xac38de,_0x45afd6,_0x985f8d){return db['AnalyticCustomReport'][_0x4121('0x51')]({'where':{'id':_0xac38de[_0x4121('0x48')]['id']}})[_0x4121('0x25')](handleEntityNotFound(_0x45afd6,null))[_0x4121('0x25')](function(_0x582b0b){if(_0x582b0b){return db[_0x4121('0x52')][_0x4121('0x53')](function(_0x4152b6){return db[_0x4121('0x2d')]['destroy']({'where':{'CustomReportId':_0xac38de[_0x4121('0x48')]['id']},'transaction':_0x4152b6})[_0x4121('0x25')](function(_0x4a9ee9){var _0x29d6c7=_[_0x4121('0x2c')](_0xac38de[_0x4121('0x4c')],function(_0x52db82){delete _0x52db82['id'];_0x52db82[_0x4121('0x54')]=_0xac38de[_0x4121('0x48')]['id'];return _0x52db82;});return db['AnalyticFieldReport']['bulkCreate'](_0x29d6c7,{'transaction':_0x4152b6});});})['then'](function(){return db[_0x4121('0x2d')][_0x4121('0x46')]({'where':{'CustomReportId':_0xac38de[_0x4121('0x48')]['id']}});});}})['then'](respondWithResult(_0x45afd6,null))[_0x4121('0x4a')](handleError(_0x45afd6,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 33fffb0..9fea6dc 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 _0x67b8=['analytics_report_fields','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x2f0dd6,_0x5a3621){var _0x51dcef=function(_0x4c7369){while(--_0x4c7369){_0x2f0dd6['push'](_0x2f0dd6['shift']());}};_0x51dcef(++_0x5a3621);}(_0x67b8,0x1e1));var _0x867b=function(_0x3f7f2c,_0x5abb60){_0x3f7f2c=_0x3f7f2c-0x0;var _0x26e7a3=_0x67b8[_0x3f7f2c];return _0x26e7a3;};'use strict';var _=require('lodash');var util=require(_0x867b('0x0'));var logger=require(_0x867b('0x1'))(_0x867b('0x2'));var moment=require(_0x867b('0x3'));var BPromise=require('bluebird');var rp=require(_0x867b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x867b('0x5'));var config=require(_0x867b('0x6'));var attributes=require(_0x867b('0x7'));module[_0x867b('0x8')]=function(_0x13c1aa,_0x49a13d){return _0x13c1aa[_0x867b('0x9')](_0x867b('0xa'),attributes,{'tableName':_0x867b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa19d=['request-promise','path','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird'];(function(_0x5281ce,_0x210279){var _0x138d09=function(_0x421445){while(--_0x421445){_0x5281ce['push'](_0x5281ce['shift']());}};_0x138d09(++_0x210279);}(_0xa19d,0xc2));var _0xda19=function(_0x138373,_0x56a59a){_0x138373=_0x138373-0x0;var _0x4f0be6=_0xa19d[_0x138373];return _0x4f0be6;};'use strict';var _=require(_0xda19('0x0'));var util=require('util');var logger=require(_0xda19('0x1'))('api');var moment=require(_0xda19('0x2'));var BPromise=require(_0xda19('0x3'));var rp=require(_0xda19('0x4'));var fs=require('fs');var path=require(_0xda19('0x5'));var rimraf=require(_0xda19('0x6'));var config=require('../../config/environment');var attributes=require(_0xda19('0x7'));module[_0xda19('0x8')]=function(_0x426ff1,_0x24aace){return _0x426ff1['define'](_0xda19('0x9'),attributes,{'tableName':_0xda19('0xa'),'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 7ecbf95..f146404 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 _0xecaf=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x23d5dd,_0x4fbb78){var _0x108428=function(_0x204803){while(--_0x204803){_0x23d5dd['push'](_0x23d5dd['shift']());}};_0x108428(++_0x4fbb78);}(_0xecaf,0x155));var _0xfeca=function(_0x15697d,_0x183e23){_0x15697d=_0x15697d-0x0;var _0x504517=_0xecaf[_0x15697d];return _0x504517;};'use strict';var _=require(_0xfeca('0x0'));var util=require(_0xfeca('0x1'));var moment=require('moment');var BPromise=require(_0xfeca('0x2'));var rs=require(_0xfeca('0x3'));var fs=require('fs');var Redis=require(_0xfeca('0x4'));var db=require(_0xfeca('0x5'))['db'];var utils=require(_0xfeca('0x6'));var logger=require(_0xfeca('0x7'))(_0xfeca('0x8'));var config=require(_0xfeca('0x9'));var jayson=require(_0xfeca('0xa'));var client=jayson[_0xfeca('0xb')][_0xfeca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x443b6e,_0x37abd6,_0x37be09){return new BPromise(function(_0x2e657a,_0x2eeb66){return client[_0xfeca('0xd')](_0x443b6e,_0x37be09)[_0xfeca('0xe')](function(_0x3f7961){logger[_0xfeca('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x37abd6,_0xfeca('0x10'));logger[_0xfeca('0x11')](_0xfeca('0x12'),_0x37abd6,'request\x20sent',JSON['stringify'](_0x3f7961));if(_0x3f7961['error']){if(_0x3f7961[_0xfeca('0x13')][_0xfeca('0x14')]===0x1f4){logger['error'](_0xfeca('0x15'),_0x37abd6,_0x3f7961['error'][_0xfeca('0x16')]);return _0x2eeb66(_0x3f7961['error']['message']);}logger[_0xfeca('0x13')](_0xfeca('0x15'),_0x37abd6,_0x3f7961['error'][_0xfeca('0x16')]);return _0x2e657a(_0x3f7961[_0xfeca('0x13')][_0xfeca('0x16')]);}else{logger[_0xfeca('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x37abd6,_0xfeca('0x10'));_0x2e657a(_0x3f7961[_0xfeca('0x17')][_0xfeca('0x16')]);}})[_0xfeca('0x18')](function(_0x4ab7d0){logger[_0xfeca('0x13')](_0xfeca('0x15'),_0x37abd6,_0x4ab7d0);_0x2eeb66(_0x4ab7d0);});});} \ No newline at end of file +var _0x5aa1=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x182eaa,_0x44f613){var _0x323622=function(_0x412f50){while(--_0x412f50){_0x182eaa['push'](_0x182eaa['shift']());}};_0x323622(++_0x44f613);}(_0x5aa1,0x12d));var _0x15aa=function(_0x22f36d,_0x190e0d){_0x22f36d=_0x22f36d-0x0;var _0x175159=_0x5aa1[_0x22f36d];return _0x175159;};'use strict';var _=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var moment=require(_0x15aa('0x2'));var BPromise=require('bluebird');var rs=require(_0x15aa('0x3'));var fs=require('fs');var Redis=require(_0x15aa('0x4'));var db=require(_0x15aa('0x5'))['db'];var utils=require(_0x15aa('0x6'));var logger=require('../../config/logger')(_0x15aa('0x7'));var config=require(_0x15aa('0x8'));var jayson=require(_0x15aa('0x9'));var client=jayson[_0x15aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4822ae,_0x95939e,_0x26cf73){return new BPromise(function(_0x4933c0,_0x1bfc68){return client[_0x15aa('0xb')](_0x4822ae,_0x26cf73)[_0x15aa('0xc')](function(_0x385c66){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x95939e,_0x15aa('0xd'));logger['debug'](_0x15aa('0xe'),_0x95939e,'request\x20sent',JSON[_0x15aa('0xf')](_0x385c66));if(_0x385c66[_0x15aa('0x10')]){if(_0x385c66[_0x15aa('0x10')][_0x15aa('0x11')]===0x1f4){logger['error'](_0x15aa('0x12'),_0x95939e,_0x385c66[_0x15aa('0x10')]['message']);return _0x1bfc68(_0x385c66[_0x15aa('0x10')][_0x15aa('0x13')]);}logger['error'](_0x15aa('0x12'),_0x95939e,_0x385c66[_0x15aa('0x10')]['message']);return _0x4933c0(_0x385c66[_0x15aa('0x10')][_0x15aa('0x13')]);}else{logger[_0x15aa('0x14')](_0x15aa('0x12'),_0x95939e,_0x15aa('0xd'));_0x4933c0(_0x385c66[_0x15aa('0x15')][_0x15aa('0x13')]);}})[_0x15aa('0x16')](function(_0x3137c8){logger[_0x15aa('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x95939e,_0x3137c8);_0x1bfc68(_0x3137c8);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index fb6da9d..9d768c8 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(_0x156054,_0x5e1241){var _0x725b33=function(_0x47a5bb){while(--_0x47a5bb){_0x156054['push'](_0x156054['shift']());}};_0x725b33(++_0x5e1241);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x2db845,_0x38d794){var _0x247735=function(_0x3a97b0){while(--_0x3a97b0){_0x2db845['push'](_0x2db845['shift']());}};_0x247735(++_0x38d794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 1cf2961..117560d 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 _0x4517=['TEXT','exports','STRING'];(function(_0x5232bb,_0x4fcb6c){var _0x2ba6d1=function(_0x508383){while(--_0x508383){_0x5232bb['push'](_0x5232bb['shift']());}};_0x2ba6d1(++_0x4fcb6c);}(_0x4517,0x112));var _0x7451=function(_0x191637,_0x389c75){_0x191637=_0x191637-0x0;var _0x3a0c91=_0x4517[_0x191637];return _0x3a0c91;};'use strict';var Sequelize=require('sequelize');module[_0x7451('0x0')]={'name':{'type':Sequelize[_0x7451('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7451('0x1')]},'metric':{'type':Sequelize[_0x7451('0x2')]},'description':{'type':Sequelize[_0x7451('0x1')]}}; \ No newline at end of file +var _0x639a=['exports','STRING','name','TEXT'];(function(_0x442b1b,_0xff3a1f){var _0x3b08f8=function(_0x3b2e68){while(--_0x3b2e68){_0x442b1b['push'](_0x442b1b['shift']());}};_0x3b08f8(++_0xff3a1f);}(_0x639a,0xec));var _0xa639=function(_0x5d0e40,_0x11e0e7){_0x5d0e40=_0x5d0e40-0x0;var _0x1fbfa7=_0x639a[_0x5d0e40];return _0x1fbfa7;};'use strict';var Sequelize=require('sequelize');module[_0xa639('0x0')]={'name':{'type':Sequelize[_0xa639('0x1')],'allowNull':![],'unique':_0xa639('0x2')},'table':{'type':Sequelize[_0xa639('0x1')]},'metric':{'type':Sequelize[_0xa639('0x3')]},'description':{'type':Sequelize[_0xa639('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 6a991de..b3e69ed 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 _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x340bf1,_0x28154e){var _0x5d6835=function(_0x2b688e){while(--_0x2b688e){_0x340bf1['push'](_0x340bf1['shift']());}};_0x5d6835(++_0x28154e);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x554d86,_0x2baf79){_0x554d86=_0x554d86-0x0;var _0x2ef387=_0x8d0e[_0x554d86];return _0x2ef387;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','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','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','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x40f072,_0x7d0300){var _0x372aa0=function(_0x53bbb6){while(--_0x53bbb6){_0x40f072['push'](_0x40f072['shift']());}};_0x372aa0(++_0x7d0300);}(_0x425d,0x1e0));var _0xd425=function(_0x5e765f,_0x2f0668){_0x5e765f=_0x5e765f-0x0;var _0x12cda6=_0x425d[_0x5e765f];return _0x12cda6;};'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(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d60acde..d13f67d 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 _0x1298=['request-promise','path','rimraf','../../config/environment','exports','AnalyticMetric','analytics_metrics','util','api','moment','bluebird'];(function(_0x485352,_0x269f0b){var _0x331cac=function(_0x211897){while(--_0x211897){_0x485352['push'](_0x485352['shift']());}};_0x331cac(++_0x269f0b);}(_0x1298,0x19e));var _0x8129=function(_0xeabc6c,_0x4e0bfa){_0xeabc6c=_0xeabc6c-0x0;var _0x55cc1a=_0x1298[_0xeabc6c];return _0x55cc1a;};'use strict';var _=require('lodash');var util=require(_0x8129('0x0'));var logger=require('../../config/logger')(_0x8129('0x1'));var moment=require(_0x8129('0x2'));var BPromise=require(_0x8129('0x3'));var rp=require(_0x8129('0x4'));var fs=require('fs');var path=require(_0x8129('0x5'));var rimraf=require(_0x8129('0x6'));var config=require(_0x8129('0x7'));var attributes=require('./analyticMetric.attributes');module[_0x8129('0x8')]=function(_0x193d60,_0x579301){return _0x193d60['define'](_0x8129('0x9'),attributes,{'tableName':_0x8129('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1d3=['AnalyticMetric','analytics_metrics','lodash','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1d3,0xe8));var _0x3b1d=function(_0x8e1c83,_0x49a46c){_0x8e1c83=_0x8e1c83-0x0;var _0x1b4010=_0xb1d3[_0x8e1c83];return _0x1b4010;};'use strict';var _=require(_0x3b1d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3b1d('0x1'));var BPromise=require(_0x3b1d('0x2'));var rp=require(_0x3b1d('0x3'));var fs=require('fs');var path=require(_0x3b1d('0x4'));var rimraf=require('rimraf');var config=require(_0x3b1d('0x5'));var attributes=require(_0x3b1d('0x6'));module[_0x3b1d('0x7')]=function(_0x477115,_0x524e93){return _0x477115['define'](_0x3b1d('0x8'),attributes,{'tableName':_0x3b1d('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 86b3455..f04832f 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 _0xfc74=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfc74,0xc2));var _0x4fc7=function(_0x147c53,_0x4afcb7){_0x147c53=_0x147c53-0x0;var _0x386c94=_0xfc74[_0x147c53];return _0x386c94;};'use strict';var _=require(_0x4fc7('0x0'));var util=require(_0x4fc7('0x1'));var moment=require(_0x4fc7('0x2'));var BPromise=require(_0x4fc7('0x3'));var rs=require(_0x4fc7('0x4'));var fs=require('fs');var Redis=require(_0x4fc7('0x5'));var db=require(_0x4fc7('0x6'))['db'];var utils=require(_0x4fc7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4fc7('0x8'));var jayson=require(_0x4fc7('0x9'));var client=jayson['client'][_0x4fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3edad4,_0x4ca0c8,_0x5bc29b){return new BPromise(function(_0x4e2b8c,_0xeccd39){return client['request'](_0x3edad4,_0x5bc29b)[_0x4fc7('0xb')](function(_0x8a80b0){logger[_0x4fc7('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x4ca0c8,_0x4fc7('0xd'));logger[_0x4fc7('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4ca0c8,_0x4fc7('0xd'),JSON[_0x4fc7('0xf')](_0x8a80b0));if(_0x8a80b0['error']){if(_0x8a80b0['error'][_0x4fc7('0x10')]===0x1f4){logger[_0x4fc7('0x11')](_0x4fc7('0x12'),_0x4ca0c8,_0x8a80b0[_0x4fc7('0x11')][_0x4fc7('0x13')]);return _0xeccd39(_0x8a80b0[_0x4fc7('0x11')][_0x4fc7('0x13')]);}logger[_0x4fc7('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x4ca0c8,_0x8a80b0[_0x4fc7('0x11')][_0x4fc7('0x13')]);return _0x4e2b8c(_0x8a80b0[_0x4fc7('0x11')][_0x4fc7('0x13')]);}else{logger[_0x4fc7('0xc')](_0x4fc7('0x12'),_0x4ca0c8,_0x4fc7('0xd'));_0x4e2b8c(_0x8a80b0['result'][_0x4fc7('0x13')]);}})['catch'](function(_0x557f49){logger[_0x4fc7('0x11')](_0x4fc7('0x12'),_0x4ca0c8,_0x557f49);_0xeccd39(_0x557f49);});});} \ No newline at end of file +var _0x2241=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0xf70201,_0x58cf09){var _0x485339=function(_0x37994d){while(--_0x37994d){_0xf70201['push'](_0xf70201['shift']());}};_0x485339(++_0x58cf09);}(_0x2241,0xee));var _0x1224=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2241[_0x432682];return _0x463d05;};'use strict';var _=require(_0x1224('0x0'));var util=require(_0x1224('0x1'));var moment=require(_0x1224('0x2'));var BPromise=require(_0x1224('0x3'));var rs=require(_0x1224('0x4'));var fs=require('fs');var Redis=require(_0x1224('0x5'));var db=require(_0x1224('0x6'))['db'];var utils=require(_0x1224('0x7'));var logger=require(_0x1224('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1224('0x9'));var client=jayson[_0x1224('0xa')][_0x1224('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cfe59,_0x127522,_0x5288ec){return new BPromise(function(_0x5796c5,_0x3a05b3){return client[_0x1224('0xc')](_0x1cfe59,_0x5288ec)[_0x1224('0xd')](function(_0x212556){logger[_0x1224('0xe')](_0x1224('0xf'),_0x127522,_0x1224('0x10'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x127522,_0x1224('0x10'),JSON['stringify'](_0x212556));if(_0x212556[_0x1224('0x11')]){if(_0x212556['error'][_0x1224('0x12')]===0x1f4){logger[_0x1224('0x11')](_0x1224('0xf'),_0x127522,_0x212556[_0x1224('0x11')]['message']);return _0x3a05b3(_0x212556[_0x1224('0x11')][_0x1224('0x13')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x127522,_0x212556[_0x1224('0x11')]['message']);return _0x5796c5(_0x212556[_0x1224('0x11')][_0x1224('0x13')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x127522,'request\x20sent');_0x5796c5(_0x212556[_0x1224('0x14')][_0x1224('0x13')]);}})[_0x1224('0x15')](function(_0x2b85e5){logger[_0x1224('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x127522,_0x2b85e5);_0x3a05b3(_0x2b85e5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c15edb7..4243563 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 _0x3d6d=['./analyticMetric.controller','index','get','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x159fb6,_0x149fda){var _0x36ae73=function(_0x21c4eb){while(--_0x21c4eb){_0x159fb6['push'](_0x159fb6['shift']());}};_0x36ae73(++_0x149fda);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0x3d6d[_0x5e9a69];return _0x5979c8;};'use strict';var multer=require(_0xd3d6('0x0'));var util=require(_0xd3d6('0x1'));var path=require(_0xd3d6('0x2'));var timeout=require(_0xd3d6('0x3'));var express=require(_0xd3d6('0x4'));var router=express[_0xd3d6('0x5')]();var fs_extra=require(_0xd3d6('0x6'));var auth=require(_0xd3d6('0x7'));var interaction=require(_0xd3d6('0x8'));var config=require(_0xd3d6('0x9'));var controller=require(_0xd3d6('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xd3d6('0xb')]);router[_0xd3d6('0xc')](_0xd3d6('0xd'),auth[_0xd3d6('0xe')](),controller[_0xd3d6('0xf')]);router['post']('/',auth[_0xd3d6('0xe')](),controller[_0xd3d6('0x10')]);router[_0xd3d6('0x11')](_0xd3d6('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd3d6('0x12')](_0xd3d6('0xd'),auth[_0xd3d6('0xe')](),controller[_0xd3d6('0x13')]);module[_0xd3d6('0x14')]=router; \ No newline at end of file +var _0x96aa=['get','/:id','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index'];(function(_0x15d9c9,_0x33ea68){var _0xd8ef55=function(_0xcbc418){while(--_0xcbc418){_0x15d9c9['push'](_0x15d9c9['shift']());}};_0xd8ef55(++_0x33ea68);}(_0x96aa,0x67));var _0xa96a=function(_0xd32824,_0x4ebda0){_0xd32824=_0xd32824-0x0;var _0x5c7217=_0x96aa[_0xd32824];return _0x5c7217;};'use strict';var multer=require(_0xa96a('0x0'));var util=require(_0xa96a('0x1'));var path=require('path');var timeout=require(_0xa96a('0x2'));var express=require(_0xa96a('0x3'));var router=express[_0xa96a('0x4')]();var fs_extra=require(_0xa96a('0x5'));var auth=require(_0xa96a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa96a('0x7'));var controller=require(_0xa96a('0x8'));router['get']('/',auth[_0xa96a('0x9')](),controller[_0xa96a('0xa')]);router[_0xa96a('0xb')](_0xa96a('0xc'),auth[_0xa96a('0x9')](),controller[_0xa96a('0xd')]);router[_0xa96a('0xe')]('/',auth[_0xa96a('0x9')](),controller[_0xa96a('0xf')]);router[_0xa96a('0x10')](_0xa96a('0xc'),auth['isAuthenticated'](),controller[_0xa96a('0x11')]);router['delete'](_0xa96a('0xc'),auth[_0xa96a('0x9')](),controller['destroy']);module[_0xa96a('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 960667e..f269387 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 _0x19ec=['exports','TEXT','sequelize'];(function(_0xfb845c,_0x1945ff){var _0x3ca188=function(_0x28fbc6){while(--_0x28fbc6){_0xfb845c['push'](_0xfb845c['shift']());}};_0x3ca188(++_0x1945ff);}(_0x19ec,0x1d6));var _0xc19e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x19ec[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xc19e('0x0'));module[_0xc19e('0x1')]={'tree':{'type':Sequelize[_0xc19e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x98e7=['exports','TEXT'];(function(_0x30da54,_0xb7cf20){var _0x390d61=function(_0x4cc728){while(--_0x4cc728){_0x30da54['push'](_0x30da54['shift']());}};_0x390d61(++_0xb7cf20);}(_0x98e7,0x96));var _0x798e=function(_0x1c08f6,_0x14c077){_0x1c08f6=_0x1c08f6-0x0;var _0xbc156a=_0x98e7[_0x1c08f6];return _0xbc156a;};'use strict';var Sequelize=require('sequelize');module[_0x798e('0x0')]={'tree':{'type':Sequelize[_0x798e('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 c1955c6..1ab03fa 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 _0xe9eb=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4eafff,_0x3e19d6){var _0x4885b7=function(_0x3af376){while(--_0x3af376){_0x4eafff['push'](_0x4eafff['shift']());}};_0x4885b7(++_0x3e19d6);}(_0xe9eb,0xcd));var _0xbe9e=function(_0x207b19,_0xdd060b){_0x207b19=_0x207b19-0x0;var _0x29f05b=_0xe9eb[_0x207b19];return _0x29f05b;};'use strict';var emlformat=require(_0xbe9e('0x0'));var rimraf=require(_0xbe9e('0x1'));var zipdir=require(_0xbe9e('0x2'));var jsonpatch=require(_0xbe9e('0x3'));var rp=require(_0xbe9e('0x4'));var moment=require(_0xbe9e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbe9e('0x6'));var csv=require(_0xbe9e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe9e('0x8'));var _=require(_0xbe9e('0x9'));var squel=require(_0xbe9e('0xa'));var crypto=require(_0xbe9e('0xb'));var jsforce=require(_0xbe9e('0xc'));var deskjs=require(_0xbe9e('0xd'));var toCsv=require(_0xbe9e('0x7'));var querystring=require(_0xbe9e('0xe'));var Papa=require(_0xbe9e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe9e('0x10'));var as=require(_0xbe9e('0x11'));var hardwareService=require(_0xbe9e('0x12'));var logger=require(_0xbe9e('0x13'))(_0xbe9e('0x14'));var utils=require('../../config/utils');var config=require(_0xbe9e('0x15'));var licenseUtil=require(_0xbe9e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42cd4b,_0x121525){_0x121525=_0x121525||0xcc;return function(_0x74a377){if(_0x74a377){return _0x42cd4b[_0xbe9e('0x17')](_0x121525);}return _0x42cd4b[_0xbe9e('0x18')](_0x121525)[_0xbe9e('0x19')]();};}function respondWithResult(_0x1f6249,_0x59d4cb){_0x59d4cb=_0x59d4cb||0xc8;return function(_0xa344fe){if(_0xa344fe){return _0x1f6249[_0xbe9e('0x18')](_0x59d4cb)[_0xbe9e('0x1a')](_0xa344fe);}};}function respondWithFilteredResult(_0xdb31b6,_0x45ee2f){return function(_0x31a20f){if(_0x31a20f){var _0xc3ad25=typeof _0x45ee2f['offset']===_0xbe9e('0x1b')&&typeof _0x45ee2f[_0xbe9e('0x1c')]===_0xbe9e('0x1b');var _0x1f7c1e=_0x31a20f[_0xbe9e('0x1d')];var _0x2c34ec=_0xc3ad25?0x0:_0x45ee2f[_0xbe9e('0x1e')];var _0x835869=_0xc3ad25?_0x31a20f[_0xbe9e('0x1d')]:_0x45ee2f[_0xbe9e('0x1e')]+_0x45ee2f[_0xbe9e('0x1c')];var _0x48598c;if(_0x835869>=_0x1f7c1e){_0x835869=_0x1f7c1e;_0x48598c=0xc8;}else{_0x48598c=0xce;}_0xdb31b6[_0xbe9e('0x18')](_0x48598c);return _0xdb31b6[_0xbe9e('0x1f')](_0xbe9e('0x20'),_0x2c34ec+'-'+_0x835869+'/'+_0x1f7c1e)['json'](_0x31a20f);}return null;};}function patchUpdates(_0x54aa57){return function(_0x190c14){try{jsonpatch['apply'](_0x190c14,_0x54aa57,!![]);}catch(_0x5600a3){return BPromise['reject'](_0x5600a3);}return _0x190c14[_0xbe9e('0x21')]();};}function saveUpdates(_0x110a66,_0x55056e){return function(_0x9f9082){if(_0x9f9082){return _0x9f9082[_0xbe9e('0x22')](_0x110a66)[_0xbe9e('0x23')](function(_0x36dd1c){return _0x36dd1c;});}return null;};}function removeEntity(_0x163e9c,_0x8033dd){return function(_0x2b4065){if(_0x2b4065){return _0x2b4065[_0xbe9e('0x24')]()['then'](function(){_0x163e9c[_0xbe9e('0x18')](0xcc)[_0xbe9e('0x19')]();});}};}function handleEntityNotFound(_0x1f6c15,_0x234929){return function(_0x44305b){if(!_0x44305b){_0x1f6c15[_0xbe9e('0x17')](0x194);}return _0x44305b;};}function handleError(_0x27bdac,_0x28486b){_0x28486b=_0x28486b||0x1f4;return function(_0x270cbf){logger[_0xbe9e('0x25')](_0x270cbf[_0xbe9e('0x26')]);if(_0x270cbf[_0xbe9e('0x27')]){delete _0x270cbf[_0xbe9e('0x27')];}_0x27bdac[_0xbe9e('0x18')](_0x28486b)[_0xbe9e('0x28')](_0x270cbf);};}exports['index']=function(_0x14ef94,_0x16f37b){var _0x5dee26={},_0x5662f9={},_0x2fc61c={'count':0x0,'rows':[]};var _0x4db6d6=_[_0xbe9e('0x29')](db[_0xbe9e('0x2a')][_0xbe9e('0x2b')],function(_0x23e656){return{'name':_0x23e656[_0xbe9e('0x2c')],'type':_0x23e656[_0xbe9e('0x2d')][_0xbe9e('0x2e')]};});_0x5662f9[_0xbe9e('0x2f')]=_[_0xbe9e('0x29')](_0x4db6d6,'name');_0x5662f9[_0xbe9e('0x30')]=_['keys'](_0x14ef94[_0xbe9e('0x30')]);_0x5662f9[_0xbe9e('0x31')]=_[_0xbe9e('0x32')](_0x5662f9[_0xbe9e('0x2f')],_0x5662f9[_0xbe9e('0x30')]);_0x5dee26['attributes']=_['intersection'](_0x5662f9[_0xbe9e('0x2f')],qs['fields'](_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x33')]));_0x5dee26[_0xbe9e('0x34')]=_0x5dee26[_0xbe9e('0x34')][_0xbe9e('0x35')]?_0x5dee26[_0xbe9e('0x34')]:_0x5662f9[_0xbe9e('0x2f')];if(!_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x36')](_0xbe9e('0x37'))){_0x5dee26[_0xbe9e('0x1c')]=qs[_0xbe9e('0x1c')](_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x1c')]);_0x5dee26[_0xbe9e('0x1e')]=qs[_0xbe9e('0x1e')](_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x1e')]);}_0x5dee26[_0xbe9e('0x38')]=qs['sort'](_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x39')]);_0x5dee26[_0xbe9e('0x3a')]=qs[_0xbe9e('0x31')](_['pick'](_0x14ef94[_0xbe9e('0x30')],_0x5662f9['filters']),_0x4db6d6);if(_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x3b')]){_0x5dee26[_0xbe9e('0x3a')]=_[_0xbe9e('0x3c')](_0x5dee26['where'],{'$or':_[_0xbe9e('0x29')](_0x4db6d6,function(_0x495bd7){if(_0x495bd7[_0xbe9e('0x2d')]!==_0xbe9e('0x3d')){var _0x32fbd1={};_0x32fbd1[_0x495bd7[_0xbe9e('0x27')]]={'$like':'%'+_0x14ef94[_0xbe9e('0x30')]['filter']+'%'};return _0x32fbd1;}})});}_0x5dee26=_['merge']({},_0x5dee26,_0x14ef94[_0xbe9e('0x3e')]);var _0x5a733f={'where':_0x5dee26['where']};return db[_0xbe9e('0x2a')][_0xbe9e('0x1d')](_0x5a733f)['then'](function(_0x54aa8b){_0x2fc61c[_0xbe9e('0x1d')]=_0x54aa8b;if(_0x14ef94[_0xbe9e('0x30')][_0xbe9e('0x3f')]){_0x5dee26[_0xbe9e('0x40')]=[{'all':!![]}];}return db[_0xbe9e('0x2a')][_0xbe9e('0x41')](_0x5dee26);})['then'](function(_0x59de73){_0x2fc61c['rows']=_0x59de73;return _0x2fc61c;})[_0xbe9e('0x23')](respondWithFilteredResult(_0x16f37b,_0x5dee26))[_0xbe9e('0x42')](handleError(_0x16f37b,null));};exports[_0xbe9e('0x43')]=function(_0x52ea7b,_0x5e02a8){var _0xc361d={'raw':!![],'where':{'id':_0x52ea7b['params']['id']}},_0x125c74={};_0x125c74[_0xbe9e('0x2f')]=_[_0xbe9e('0x44')](db[_0xbe9e('0x2a')]['rawAttributes']);_0x125c74['query']=_[_0xbe9e('0x44')](_0x52ea7b[_0xbe9e('0x30')]);_0x125c74[_0xbe9e('0x31')]=_[_0xbe9e('0x32')](_0x125c74[_0xbe9e('0x2f')],_0x125c74[_0xbe9e('0x30')]);_0xc361d[_0xbe9e('0x34')]=_[_0xbe9e('0x32')](_0x125c74[_0xbe9e('0x2f')],qs['fields'](_0x52ea7b[_0xbe9e('0x30')][_0xbe9e('0x33')]));_0xc361d['attributes']=_0xc361d[_0xbe9e('0x34')][_0xbe9e('0x35')]?_0xc361d[_0xbe9e('0x34')]:_0x125c74[_0xbe9e('0x2f')];if(_0x52ea7b[_0xbe9e('0x30')][_0xbe9e('0x3f')]){_0xc361d[_0xbe9e('0x40')]=[{'all':!![]}];}_0xc361d=_[_0xbe9e('0x3c')]({},_0xc361d,_0x52ea7b['options']);return db[_0xbe9e('0x2a')][_0xbe9e('0x45')](_0xc361d)['then'](handleEntityNotFound(_0x5e02a8,null))[_0xbe9e('0x23')](respondWithResult(_0x5e02a8,null))['catch'](handleError(_0x5e02a8,null));};exports[_0xbe9e('0x46')]=function(_0x571cb4,_0x2ab472){return db[_0xbe9e('0x2a')]['create'](_0x571cb4['body'],{})['then'](respondWithResult(_0x2ab472,0xc9))[_0xbe9e('0x42')](handleError(_0x2ab472,null));};exports[_0xbe9e('0x22')]=function(_0xff1862,_0x5ce9ed){if(_0xff1862[_0xbe9e('0x47')]['id']){delete _0xff1862[_0xbe9e('0x47')]['id'];}return db[_0xbe9e('0x2a')][_0xbe9e('0x45')]({'where':{'id':_0xff1862[_0xbe9e('0x48')]['id']}})[_0xbe9e('0x23')](handleEntityNotFound(_0x5ce9ed,null))[_0xbe9e('0x23')](saveUpdates(_0xff1862[_0xbe9e('0x47')],null))[_0xbe9e('0x23')](respondWithResult(_0x5ce9ed,null))[_0xbe9e('0x42')](handleError(_0x5ce9ed,null));};exports['destroy']=function(_0x1f2e80,_0x586a5a){return db['AnalyticTreeReport'][_0xbe9e('0x45')]({'where':{'id':_0x1f2e80[_0xbe9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x586a5a,null))['then'](removeEntity(_0x586a5a,null))[_0xbe9e('0x42')](handleError(_0x586a5a,null));}; \ No newline at end of file +var _0x74ca=['squel','crypto','desk.js','to-csv','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','AnalyticTreeReport','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','include','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash'];(function(_0x5ee724,_0x415d2f){var _0x599c8b=function(_0x222fb4){while(--_0x222fb4){_0x5ee724['push'](_0x5ee724['shift']());}};_0x599c8b(++_0x415d2f);}(_0x74ca,0x122));var _0xa74c=function(_0x195513,_0xd158ee){_0x195513=_0x195513-0x0;var _0x4f5542=_0x74ca[_0x195513];return _0x4f5542;};'use strict';var emlformat=require(_0xa74c('0x0'));var rimraf=require(_0xa74c('0x1'));var zipdir=require(_0xa74c('0x2'));var jsonpatch=require(_0xa74c('0x3'));var rp=require(_0xa74c('0x4'));var moment=require(_0xa74c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa74c('0x6'));var util=require('util');var path=require(_0xa74c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa74c('0x8'));var _=require(_0xa74c('0x9'));var squel=require(_0xa74c('0xa'));var crypto=require(_0xa74c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa74c('0xc'));var toCsv=require(_0xa74c('0xd'));var querystring=require('querystring');var Papa=require(_0xa74c('0xe'));var Redis=require(_0xa74c('0xf'));var authService=require(_0xa74c('0x10'));var qs=require(_0xa74c('0x11'));var as=require(_0xa74c('0x12'));var hardwareService=require(_0xa74c('0x13'));var logger=require(_0xa74c('0x14'))(_0xa74c('0x15'));var utils=require(_0xa74c('0x16'));var config=require(_0xa74c('0x17'));var licenseUtil=require(_0xa74c('0x18'));var db=require(_0xa74c('0x19'))['db'];function respondWithStatusCode(_0x595add,_0x3704e0){_0x3704e0=_0x3704e0||0xcc;return function(_0xd52057){if(_0xd52057){return _0x595add[_0xa74c('0x1a')](_0x3704e0);}return _0x595add[_0xa74c('0x1b')](_0x3704e0)['end']();};}function respondWithResult(_0x1ec460,_0x397c83){_0x397c83=_0x397c83||0xc8;return function(_0x2dd79e){if(_0x2dd79e){return _0x1ec460['status'](_0x397c83)[_0xa74c('0x1c')](_0x2dd79e);}};}function respondWithFilteredResult(_0x56d16c,_0x15d9f9){return function(_0x25309c){if(_0x25309c){var _0x3fa50a=typeof _0x15d9f9[_0xa74c('0x1d')]===_0xa74c('0x1e')&&typeof _0x15d9f9[_0xa74c('0x1f')]===_0xa74c('0x1e');var _0x5daf99=_0x25309c[_0xa74c('0x20')];var _0x365fa3=_0x3fa50a?0x0:_0x15d9f9[_0xa74c('0x1d')];var _0x243b46=_0x3fa50a?_0x25309c['count']:_0x15d9f9[_0xa74c('0x1d')]+_0x15d9f9[_0xa74c('0x1f')];var _0x247664;if(_0x243b46>=_0x5daf99){_0x243b46=_0x5daf99;_0x247664=0xc8;}else{_0x247664=0xce;}_0x56d16c['status'](_0x247664);return _0x56d16c['set'](_0xa74c('0x21'),_0x365fa3+'-'+_0x243b46+'/'+_0x5daf99)[_0xa74c('0x1c')](_0x25309c);}return null;};}function patchUpdates(_0x3188fd){return function(_0x4c633e){try{jsonpatch[_0xa74c('0x22')](_0x4c633e,_0x3188fd,!![]);}catch(_0x5eda0d){return BPromise[_0xa74c('0x23')](_0x5eda0d);}return _0x4c633e[_0xa74c('0x24')]();};}function saveUpdates(_0x5c2af4,_0x161c6b){return function(_0x17fce6){if(_0x17fce6){return _0x17fce6['update'](_0x5c2af4)[_0xa74c('0x25')](function(_0x5c00da){return _0x5c00da;});}return null;};}function removeEntity(_0x15ff13,_0x101ab4){return function(_0x3b9984){if(_0x3b9984){return _0x3b9984[_0xa74c('0x26')]()[_0xa74c('0x25')](function(){_0x15ff13[_0xa74c('0x1b')](0xcc)[_0xa74c('0x27')]();});}};}function handleEntityNotFound(_0x6e04b6,_0x1b7709){return function(_0xfd3f6f){if(!_0xfd3f6f){_0x6e04b6[_0xa74c('0x1a')](0x194);}return _0xfd3f6f;};}function handleError(_0x218ae7,_0x1c75a4){_0x1c75a4=_0x1c75a4||0x1f4;return function(_0x19d678){logger[_0xa74c('0x28')](_0x19d678[_0xa74c('0x29')]);if(_0x19d678['name']){delete _0x19d678[_0xa74c('0x2a')];}_0x218ae7['status'](_0x1c75a4)[_0xa74c('0x2b')](_0x19d678);};}exports[_0xa74c('0x2c')]=function(_0x4f9aff,_0xd6ea94){var _0x3905a8={},_0x265b14={},_0x49a929={'count':0x0,'rows':[]};var _0xd77674=_['map'](db[_0xa74c('0x2d')]['rawAttributes'],function(_0x26dfee){return{'name':_0x26dfee['fieldName'],'type':_0x26dfee[_0xa74c('0x2e')][_0xa74c('0x2f')]};});_0x265b14[_0xa74c('0x30')]=_[_0xa74c('0x31')](_0xd77674,_0xa74c('0x2a'));_0x265b14[_0xa74c('0x32')]=_[_0xa74c('0x33')](_0x4f9aff[_0xa74c('0x32')]);_0x265b14[_0xa74c('0x34')]=_[_0xa74c('0x35')](_0x265b14[_0xa74c('0x30')],_0x265b14['query']);_0x3905a8['attributes']=_['intersection'](_0x265b14[_0xa74c('0x30')],qs[_0xa74c('0x36')](_0x4f9aff['query'][_0xa74c('0x36')]));_0x3905a8['attributes']=_0x3905a8['attributes'][_0xa74c('0x37')]?_0x3905a8[_0xa74c('0x38')]:_0x265b14['model'];if(!_0x4f9aff[_0xa74c('0x32')][_0xa74c('0x39')](_0xa74c('0x3a'))){_0x3905a8['limit']=qs[_0xa74c('0x1f')](_0x4f9aff[_0xa74c('0x32')]['limit']);_0x3905a8['offset']=qs['offset'](_0x4f9aff['query'][_0xa74c('0x1d')]);}_0x3905a8[_0xa74c('0x3b')]=qs[_0xa74c('0x3c')](_0x4f9aff[_0xa74c('0x32')]['sort']);_0x3905a8[_0xa74c('0x3d')]=qs['filters'](_[_0xa74c('0x3e')](_0x4f9aff[_0xa74c('0x32')],_0x265b14['filters']),_0xd77674);if(_0x4f9aff[_0xa74c('0x32')][_0xa74c('0x3f')]){_0x3905a8['where']=_[_0xa74c('0x40')](_0x3905a8[_0xa74c('0x3d')],{'$or':_['map'](_0xd77674,function(_0x54eca7){if(_0x54eca7[_0xa74c('0x2e')]!==_0xa74c('0x41')){var _0x472498={};_0x472498[_0x54eca7['name']]={'$like':'%'+_0x4f9aff['query'][_0xa74c('0x3f')]+'%'};return _0x472498;}})});}_0x3905a8=_[_0xa74c('0x40')]({},_0x3905a8,_0x4f9aff[_0xa74c('0x42')]);var _0x4a7606={'where':_0x3905a8[_0xa74c('0x3d')]};return db['AnalyticTreeReport']['count'](_0x4a7606)[_0xa74c('0x25')](function(_0x6f106e){_0x49a929[_0xa74c('0x20')]=_0x6f106e;if(_0x4f9aff[_0xa74c('0x32')][_0xa74c('0x43')]){_0x3905a8['include']=[{'all':!![]}];}return db[_0xa74c('0x2d')]['findAll'](_0x3905a8);})[_0xa74c('0x25')](function(_0x1d414b){_0x49a929['rows']=_0x1d414b;return _0x49a929;})[_0xa74c('0x25')](respondWithFilteredResult(_0xd6ea94,_0x3905a8))[_0xa74c('0x44')](handleError(_0xd6ea94,null));};exports[_0xa74c('0x45')]=function(_0x42968e,_0x5ccacb){var _0x47fdce={'raw':!![],'where':{'id':_0x42968e['params']['id']}},_0x28d493={};_0x28d493[_0xa74c('0x30')]=_[_0xa74c('0x33')](db['AnalyticTreeReport']['rawAttributes']);_0x28d493[_0xa74c('0x32')]=_[_0xa74c('0x33')](_0x42968e[_0xa74c('0x32')]);_0x28d493[_0xa74c('0x34')]=_[_0xa74c('0x35')](_0x28d493[_0xa74c('0x30')],_0x28d493[_0xa74c('0x32')]);_0x47fdce[_0xa74c('0x38')]=_['intersection'](_0x28d493[_0xa74c('0x30')],qs['fields'](_0x42968e['query']['fields']));_0x47fdce['attributes']=_0x47fdce[_0xa74c('0x38')]['length']?_0x47fdce[_0xa74c('0x38')]:_0x28d493[_0xa74c('0x30')];if(_0x42968e[_0xa74c('0x32')][_0xa74c('0x43')]){_0x47fdce[_0xa74c('0x46')]=[{'all':!![]}];}_0x47fdce=_[_0xa74c('0x40')]({},_0x47fdce,_0x42968e[_0xa74c('0x42')]);return db['AnalyticTreeReport'][_0xa74c('0x47')](_0x47fdce)[_0xa74c('0x25')](handleEntityNotFound(_0x5ccacb,null))[_0xa74c('0x25')](respondWithResult(_0x5ccacb,null))['catch'](handleError(_0x5ccacb,null));};exports[_0xa74c('0x48')]=function(_0x377b90,_0x5eab11){return db[_0xa74c('0x2d')][_0xa74c('0x48')](_0x377b90['body'],{})[_0xa74c('0x25')](respondWithResult(_0x5eab11,0xc9))[_0xa74c('0x44')](handleError(_0x5eab11,null));};exports[_0xa74c('0x49')]=function(_0x3a0edf,_0x5c6483){if(_0x3a0edf['body']['id']){delete _0x3a0edf[_0xa74c('0x4a')]['id'];}return db[_0xa74c('0x2d')]['find']({'where':{'id':_0x3a0edf['params']['id']}})[_0xa74c('0x25')](handleEntityNotFound(_0x5c6483,null))[_0xa74c('0x25')](saveUpdates(_0x3a0edf[_0xa74c('0x4a')],null))[_0xa74c('0x25')](respondWithResult(_0x5c6483,null))[_0xa74c('0x44')](handleError(_0x5c6483,null));};exports[_0xa74c('0x26')]=function(_0x4cc485,_0x2ca9e4){return db[_0xa74c('0x2d')][_0xa74c('0x47')]({'where':{'id':_0x4cc485['params']['id']}})[_0xa74c('0x25')](handleEntityNotFound(_0x2ca9e4,null))[_0xa74c('0x25')](removeEntity(_0x2ca9e4,null))[_0xa74c('0x44')](handleError(_0x2ca9e4,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index c70cb6f..e7bf44a 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 _0xa56f=['analytics_report_trees','util','api','moment','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x3bcf4f,_0x507a7b){var _0x26d549=function(_0x12c34f){while(--_0x12c34f){_0x3bcf4f['push'](_0x3bcf4f['shift']());}};_0x26d549(++_0x507a7b);}(_0xa56f,0x1da));var _0xfa56=function(_0x5dd12d,_0x2689a7){_0x5dd12d=_0x5dd12d-0x0;var _0x1b3136=_0xa56f[_0x5dd12d];return _0x1b3136;};'use strict';var _=require('lodash');var util=require(_0xfa56('0x0'));var logger=require('../../config/logger')(_0xfa56('0x1'));var moment=require(_0xfa56('0x2'));var BPromise=require(_0xfa56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfa56('0x4'));var config=require(_0xfa56('0x5'));var attributes=require(_0xfa56('0x6'));module[_0xfa56('0x7')]=function(_0x46b2e9,_0x993441){return _0x46b2e9[_0xfa56('0x8')](_0xfa56('0x9'),attributes,{'tableName':_0xfa56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x862e=['lodash','../../config/logger','moment','bluebird','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x29fd16,_0x404af3){var _0x45d208=function(_0x450c55){while(--_0x450c55){_0x29fd16['push'](_0x29fd16['shift']());}};_0x45d208(++_0x404af3);}(_0x862e,0x6e));var _0xe862=function(_0x209d2a,_0x59a302){_0x209d2a=_0x209d2a-0x0;var _0x2d2a4a=_0x862e[_0x209d2a];return _0x2d2a4a;};'use strict';var _=require(_0xe862('0x0'));var util=require('util');var logger=require(_0xe862('0x1'))('api');var moment=require(_0xe862('0x2'));var BPromise=require(_0xe862('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe862('0x4'));var attributes=require(_0xe862('0x5'));module[_0xe862('0x6')]=function(_0x3fe678,_0x388906){return _0x3fe678[_0xe862('0x7')](_0xe862('0x8'),attributes,{'tableName':_0xe862('0x9'),'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 ad3a627..d4305a9 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3604d5,_0x5908e2){var _0x2d6d43=function(_0x25b7b7){while(--_0x25b7b7){_0x3604d5['push'](_0x3604d5['shift']());}};_0x2d6d43(++_0x5908e2);}(_0xdb28,0x106));var _0x8db2=function(_0xffd502,_0xa66a60){_0xffd502=_0xffd502-0x0;var _0xe699b7=_0xdb28[_0xffd502];return _0xe699b7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x561389,_0x174e1a){_0x561389=_0x561389-0x0;var _0x21ff8d=_0x7a54[_0x561389];return _0x21ff8d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c911476..f82fc0a 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 _0xa957=['delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','show','post','create'];(function(_0x3eae20,_0x3078d9){var _0x58921b=function(_0x28c5cf){while(--_0x28c5cf){_0x3eae20['push'](_0x3eae20['shift']());}};_0x58921b(++_0x3078d9);}(_0xa957,0x199));var _0x7a95=function(_0x413e3c,_0x3fa409){_0x413e3c=_0x413e3c-0x0;var _0xd57f0c=_0xa957[_0x413e3c];return _0xd57f0c;};'use strict';var multer=require(_0x7a95('0x0'));var util=require('util');var path=require(_0x7a95('0x1'));var timeout=require(_0x7a95('0x2'));var express=require('express');var router=express[_0x7a95('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7a95('0x4'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x7a95('0x5')]('/',auth[_0x7a95('0x6')](),controller[_0x7a95('0x7')]);router[_0x7a95('0x5')]('/:id',auth[_0x7a95('0x6')](),controller[_0x7a95('0x8')]);router[_0x7a95('0x9')]('/',auth[_0x7a95('0x6')](),controller[_0x7a95('0xa')]);router['put']('/:id',auth[_0x7a95('0x6')](),controller['update']);router[_0x7a95('0xb')](_0x7a95('0xc'),auth['isAuthenticated'](),controller[_0x7a95('0xd')]);module[_0x7a95('0xe')]=router; \ No newline at end of file +var _0xfa89=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ac1be,_0x54f7fc){var _0x24cdb2=function(_0x26cc5d){while(--_0x26cc5d){_0x3ac1be['push'](_0x3ac1be['shift']());}};_0x24cdb2(++_0x54f7fc);}(_0xfa89,0x76));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9fa8('0x0'));var util=require(_0x9fa8('0x1'));var path=require(_0x9fa8('0x2'));var timeout=require(_0x9fa8('0x3'));var express=require(_0x9fa8('0x4'));var router=express['Router']();var fs_extra=require(_0x9fa8('0x5'));var auth=require(_0x9fa8('0x6'));var interaction=require(_0x9fa8('0x7'));var config=require(_0x9fa8('0x8'));var controller=require(_0x9fa8('0x9'));router[_0x9fa8('0xa')]('/',auth[_0x9fa8('0xb')](),controller['index']);router[_0x9fa8('0xa')](_0x9fa8('0xc'),auth[_0x9fa8('0xb')](),controller[_0x9fa8('0xd')]);router[_0x9fa8('0xe')]('/',auth[_0x9fa8('0xb')](),controller[_0x9fa8('0xf')]);router[_0x9fa8('0x10')](_0x9fa8('0xc'),auth[_0x9fa8('0xb')](),controller[_0x9fa8('0x11')]);router[_0x9fa8('0x12')](_0x9fa8('0xc'),auth['isAuthenticated'](),controller[_0x9fa8('0x13')]);module[_0x9fa8('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 16b3209..7586087 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 _0x0eaa=['sequelize','exports','STRING'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x506762,_0x5c2639){_0x506762=_0x506762-0x0;var _0x559d09=_0x0eaa[_0x506762];return _0x559d09;};'use strict';var Sequelize=require(_0xa0ea('0x0'));module[_0xa0ea('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa0ea('0x2')]}}; \ No newline at end of file +var _0x05b0=['STRING'];(function(_0xbe74d5,_0x3cafa4){var _0x16f9b7=function(_0xf91a32){while(--_0xf91a32){_0xbe74d5['push'](_0xbe74d5['shift']());}};_0x16f9b7(++_0x3cafa4);}(_0x05b0,0x188));var _0x005b=function(_0xa19a0b,_0x22ce7b){_0xa19a0b=_0xa19a0b-0x0;var _0x30534c=_0x05b0[_0xa19a0b];return _0x30534c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x005b('0x0')]},'basename':{'type':Sequelize[_0x005b('0x0')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 63460bd..1e68b88 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 _0xb7de=['order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','updatedAt','body','createdAt','create','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xb7de,0x1d3));var _0xeb7d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xb7de[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb7d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb7d('0x1'));var moment=require(_0xeb7d('0x2'));var BPromise=require(_0xeb7d('0x3'));var Mustache=require(_0xeb7d('0x4'));var util=require('util');var path=require(_0xeb7d('0x5'));var sox=require('sox');var csv=require(_0xeb7d('0x6'));var ejs=require(_0xeb7d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb7d('0x8'));var crypto=require(_0xeb7d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xeb7d('0xa'));var toCsv=require(_0xeb7d('0x6'));var querystring=require(_0xeb7d('0xb'));var Papa=require(_0xeb7d('0xc'));var Redis=require(_0xeb7d('0xd'));var authService=require(_0xeb7d('0xe'));var qs=require(_0xeb7d('0xf'));var as=require(_0xeb7d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb7d('0x11'))('api');var utils=require(_0xeb7d('0x12'));var config=require(_0xeb7d('0x13'));var licenseUtil=require(_0xeb7d('0x14'));var db=require(_0xeb7d('0x15'))['db'];function respondWithStatusCode(_0x39cb6c,_0x3de671){_0x3de671=_0x3de671||0xcc;return function(_0x3642f3){if(_0x3642f3){return _0x39cb6c['sendStatus'](_0x3de671);}return _0x39cb6c[_0xeb7d('0x16')](_0x3de671)[_0xeb7d('0x17')]();};}function respondWithResult(_0x2adc66,_0x59dffd){_0x59dffd=_0x59dffd||0xc8;return function(_0x11a5a8){if(_0x11a5a8){return _0x2adc66[_0xeb7d('0x16')](_0x59dffd)['json'](_0x11a5a8);}};}function respondWithFilteredResult(_0x462d3e,_0x482e8f){return function(_0x209961){if(_0x209961){var _0x328218=typeof _0x482e8f[_0xeb7d('0x18')]===_0xeb7d('0x19')&&typeof _0x482e8f[_0xeb7d('0x1a')]===_0xeb7d('0x19');var _0x2ae46e=_0x209961[_0xeb7d('0x1b')];var _0x50ba79=_0x328218?0x0:_0x482e8f[_0xeb7d('0x18')];var _0x569257=_0x328218?_0x209961['count']:_0x482e8f[_0xeb7d('0x18')]+_0x482e8f[_0xeb7d('0x1a')];var _0x14e28e;if(_0x569257>=_0x2ae46e){_0x569257=_0x2ae46e;_0x14e28e=0xc8;}else{_0x14e28e=0xce;}_0x462d3e[_0xeb7d('0x16')](_0x14e28e);return _0x462d3e[_0xeb7d('0x1c')](_0xeb7d('0x1d'),_0x50ba79+'-'+_0x569257+'/'+_0x2ae46e)[_0xeb7d('0x1e')](_0x209961);}return null;};}function patchUpdates(_0x5d8122){return function(_0x464a15){try{jsonpatch[_0xeb7d('0x1f')](_0x464a15,_0x5d8122,!![]);}catch(_0x11a4ac){return BPromise[_0xeb7d('0x20')](_0x11a4ac);}return _0x464a15[_0xeb7d('0x21')]();};}function saveUpdates(_0x58fe5c,_0x4f336a){return function(_0x42a039){if(_0x42a039){return _0x42a039[_0xeb7d('0x22')](_0x58fe5c)[_0xeb7d('0x23')](function(_0x42ad58){return _0x42ad58;});}return null;};}function removeEntity(_0x285787,_0xf88a58){return function(_0x23486f){if(_0x23486f){return _0x23486f['destroy']()[_0xeb7d('0x23')](function(){_0x285787[_0xeb7d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dd527,_0x4f8502){return function(_0x25382e){if(!_0x25382e){_0x5dd527[_0xeb7d('0x24')](0x194);}return _0x25382e;};}function handleError(_0x5d7045,_0x272da4){_0x272da4=_0x272da4||0x1f4;return function(_0x1f89a4){logger[_0xeb7d('0x25')](_0x1f89a4[_0xeb7d('0x26')]);if(_0x1f89a4['name']){delete _0x1f89a4[_0xeb7d('0x27')];}_0x5d7045[_0xeb7d('0x16')](_0x272da4)[_0xeb7d('0x28')](_0x1f89a4);};}exports[_0xeb7d('0x29')]=function(_0x4bd2f2,_0x2a5d68){var _0x5e9f43={},_0x5655ad={},_0x252088={'count':0x0,'rows':[]};var _0x10cc15=_[_0xeb7d('0x2a')](db[_0xeb7d('0x2b')][_0xeb7d('0x2c')],function(_0x13bf46){return{'name':_0x13bf46[_0xeb7d('0x2d')],'type':_0x13bf46[_0xeb7d('0x2e')]['key']};});_0x5655ad[_0xeb7d('0x2f')]=_[_0xeb7d('0x2a')](_0x10cc15,_0xeb7d('0x27'));_0x5655ad[_0xeb7d('0x30')]=_['keys'](_0x4bd2f2[_0xeb7d('0x30')]);_0x5655ad[_0xeb7d('0x31')]=_[_0xeb7d('0x32')](_0x5655ad[_0xeb7d('0x2f')],_0x5655ad['query']);_0x5e9f43[_0xeb7d('0x33')]=_[_0xeb7d('0x32')](_0x5655ad['model'],qs['fields'](_0x4bd2f2[_0xeb7d('0x30')][_0xeb7d('0x34')]));_0x5e9f43[_0xeb7d('0x33')]=_0x5e9f43[_0xeb7d('0x33')][_0xeb7d('0x35')]?_0x5e9f43[_0xeb7d('0x33')]:_0x5655ad[_0xeb7d('0x2f')];if(!_0x4bd2f2[_0xeb7d('0x30')]['hasOwnProperty'](_0xeb7d('0x36'))){_0x5e9f43[_0xeb7d('0x1a')]=qs[_0xeb7d('0x1a')](_0x4bd2f2['query']['limit']);_0x5e9f43['offset']=qs[_0xeb7d('0x18')](_0x4bd2f2[_0xeb7d('0x30')][_0xeb7d('0x18')]);}_0x5e9f43[_0xeb7d('0x37')]=qs['sort'](_0x4bd2f2[_0xeb7d('0x30')]['sort']);_0x5e9f43[_0xeb7d('0x38')]=qs['filters'](_['pick'](_0x4bd2f2[_0xeb7d('0x30')],_0x5655ad['filters']),_0x10cc15);if(_0x4bd2f2[_0xeb7d('0x30')][_0xeb7d('0x39')]){_0x5e9f43[_0xeb7d('0x38')]=_[_0xeb7d('0x3a')](_0x5e9f43[_0xeb7d('0x38')],{'$or':_[_0xeb7d('0x2a')](_0x10cc15,function(_0x431fe4){if(_0x431fe4[_0xeb7d('0x2e')]!==_0xeb7d('0x3b')){var _0x3cb0b6={};_0x3cb0b6[_0x431fe4[_0xeb7d('0x27')]]={'$like':'%'+_0x4bd2f2['query'][_0xeb7d('0x39')]+'%'};return _0x3cb0b6;}})});}_0x5e9f43=_[_0xeb7d('0x3a')]({},_0x5e9f43,_0x4bd2f2[_0xeb7d('0x3c')]);var _0x52c77a={'where':_0x5e9f43[_0xeb7d('0x38')]};return db[_0xeb7d('0x2b')][_0xeb7d('0x1b')](_0x52c77a)['then'](function(_0x314fd9){_0x252088[_0xeb7d('0x1b')]=_0x314fd9;if(_0x4bd2f2[_0xeb7d('0x30')][_0xeb7d('0x3d')]){_0x5e9f43[_0xeb7d('0x3e')]=[{'all':!![]}];}return db[_0xeb7d('0x2b')][_0xeb7d('0x3f')](_0x5e9f43);})[_0xeb7d('0x23')](function(_0x53dd29){_0x252088[_0xeb7d('0x40')]=_0x53dd29;return _0x252088;})['then'](respondWithFilteredResult(_0x2a5d68,_0x5e9f43))[_0xeb7d('0x41')](handleError(_0x2a5d68,null));};exports[_0xeb7d('0x42')]=function(_0x197b89,_0x52ca4a){var _0x1cab04={'raw':!![],'where':{'id':_0x197b89[_0xeb7d('0x43')]['id']}},_0x53f2ba={};_0x53f2ba[_0xeb7d('0x2f')]=_[_0xeb7d('0x44')](db[_0xeb7d('0x2b')][_0xeb7d('0x2c')]);_0x53f2ba[_0xeb7d('0x30')]=_['keys'](_0x197b89['query']);_0x53f2ba[_0xeb7d('0x31')]=_['intersection'](_0x53f2ba[_0xeb7d('0x2f')],_0x53f2ba[_0xeb7d('0x30')]);_0x1cab04[_0xeb7d('0x33')]=_[_0xeb7d('0x32')](_0x53f2ba[_0xeb7d('0x2f')],qs[_0xeb7d('0x34')](_0x197b89[_0xeb7d('0x30')][_0xeb7d('0x34')]));_0x1cab04[_0xeb7d('0x33')]=_0x1cab04[_0xeb7d('0x33')][_0xeb7d('0x35')]?_0x1cab04[_0xeb7d('0x33')]:_0x53f2ba[_0xeb7d('0x2f')];if(_0x197b89[_0xeb7d('0x30')][_0xeb7d('0x3d')]){_0x1cab04[_0xeb7d('0x3e')]=[{'all':!![]}];}_0x1cab04=_[_0xeb7d('0x3a')]({},_0x1cab04,_0x197b89[_0xeb7d('0x3c')]);return db[_0xeb7d('0x2b')][_0xeb7d('0x45')](_0x1cab04)[_0xeb7d('0x23')](handleEntityNotFound(_0x52ca4a,null))['then'](respondWithResult(_0x52ca4a,null))[_0xeb7d('0x41')](handleError(_0x52ca4a,null));};exports[_0xeb7d('0x46')]=function(_0x1b2df3,_0x5f232e){var _0x37f710={'where':{'id':_0x1b2df3[_0xeb7d('0x43')]['id']}},_0x4c9f1a={};_0x4c9f1a[_0xeb7d('0x2f')]=_[_0xeb7d('0x44')](db[_0xeb7d('0x2b')][_0xeb7d('0x2c')]);_0x37f710[_0xeb7d('0x33')]=_['intersection'](_0x4c9f1a[_0xeb7d('0x2f')],qs[_0xeb7d('0x34')](_0x1b2df3[_0xeb7d('0x30')]['fields']));_0x37f710[_0xeb7d('0x33')]=_0x37f710[_0xeb7d('0x33')][_0xeb7d('0x35')]?_0x37f710[_0xeb7d('0x33')]:_0x4c9f1a[_0xeb7d('0x2f')];if(_0x1b2df3['query'][_0xeb7d('0x3d')]){_0x37f710[_0xeb7d('0x3e')]=[{'all':!![]}];}_0x37f710=_[_0xeb7d('0x3a')]({},_0x37f710,_0x1b2df3[_0xeb7d('0x3c')]);return db['Attachment'][_0xeb7d('0x45')](_0x37f710)['then'](handleEntityNotFound(_0x5f232e,null))[_0xeb7d('0x23')](function(_0x1edcad){if(_0x1edcad){var _0x3d8d8c=_0x1edcad['get']({'plain':!![]});_0x3d8d8c=qs['omit'](_0x3d8d8c,['id','createdAt',_0xeb7d('0x47')]);_0x1b2df3[_0xeb7d('0x48')]=_['omit'](_0x1b2df3['body'],['id',_0xeb7d('0x49'),_0xeb7d('0x47')]);return db[_0xeb7d('0x2b')][_0xeb7d('0x4a')](_[_0xeb7d('0x3a')](_0x3d8d8c,_0x1b2df3[_0xeb7d('0x48')]),{'include':_0x1b2df3[_0xeb7d('0x30')][_0xeb7d('0x3d')]?[{'all':!![]}]:undefined});}})[_0xeb7d('0x23')](respondWithResult(_0x5f232e,0xc9))[_0xeb7d('0x41')](handleError(_0x5f232e,null));};exports[_0xeb7d('0x22')]=function(_0x65c02a,_0x35b9b0){if(_0x65c02a[_0xeb7d('0x48')]['id']){delete _0x65c02a['body']['id'];}return db[_0xeb7d('0x2b')][_0xeb7d('0x45')]({'where':{'id':_0x65c02a[_0xeb7d('0x43')]['id']}})[_0xeb7d('0x23')](handleEntityNotFound(_0x35b9b0,null))[_0xeb7d('0x23')](saveUpdates(_0x65c02a['body'],null))['then'](respondWithResult(_0x35b9b0,null))[_0xeb7d('0x41')](handleError(_0x35b9b0,null));};exports[_0xeb7d('0x4b')]=function(_0x1a540a,_0x418ee6){return db['Attachment'][_0xeb7d('0x45')]({'where':{'id':_0x1a540a[_0xeb7d('0x43')]['id']}})[_0xeb7d('0x23')](handleEntityNotFound(_0x418ee6,null))[_0xeb7d('0x23')](removeEntity(_0x418ee6,null))['catch'](handleError(_0x418ee6,null));};exports[_0xeb7d('0x4a')]=function(_0xaf2dbe,_0x348875,_0x3d6ad3){_0xaf2dbe[_0xeb7d('0x48')][_0xeb7d('0x27')]=_0xaf2dbe[_0xeb7d('0x4c')][_0xeb7d('0x4d')];_0xaf2dbe[_0xeb7d('0x48')][_0xeb7d('0x4e')]=_0xaf2dbe[_0xeb7d('0x4c')][_0xeb7d('0x4f')];_0xaf2dbe[_0xeb7d('0x48')][_0xeb7d('0x2e')]=_0xaf2dbe[_0xeb7d('0x4c')][_0xeb7d('0x50')];return db[_0xeb7d('0x2b')][_0xeb7d('0x4a')](_0xaf2dbe['body'])[_0xeb7d('0x23')](respondWithResult(_0x348875,0xc9))[_0xeb7d('0x41')](handleError(_0x348875,null));};exports[_0xeb7d('0x51')]=function(_0x31fc74,_0x3ee9ad,_0x374a1b){return db['Attachment'][_0xeb7d('0x52')]({'where':{'id':_0x31fc74[_0xeb7d('0x43')]['id']},'raw':!![]})[_0xeb7d('0x23')](handleEntityNotFound(_0x3ee9ad,null))[_0xeb7d('0x23')](function(_0x20233f){if(_0x20233f){var _0x5f037a=_0x20233f[_0xeb7d('0x53')]!==null;var _0x4bec02=path[_0xeb7d('0x54')](config[_0xeb7d('0x55')],_0xeb7d('0x56'));if(_0x5f037a){_0x4bec02=path[_0xeb7d('0x54')](_0x4bec02,'offline-chat/');}var _0x93158=path[_0xeb7d('0x54')](_0x4bec02,_0x20233f['basename']);return _0x3ee9ad['download'](_0x93158);}})[_0xeb7d('0x41')](handleError(_0x3ee9ad,null));}; \ No newline at end of file +var _0x09c0=['offset','undefined','count','limit','status','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','clone','get','createdAt','updatedAt','body','omit','create','basename','file','mimetype','download','findOne','ChatOfflineMessageId','offline-chat/','join','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0xa89cb1,_0xbf2ea6){var _0x5257c1=function(_0x55a5c8){while(--_0x55a5c8){_0xa89cb1['push'](_0xa89cb1['shift']());}};_0x5257c1(++_0xbf2ea6);}(_0x09c0,0x19d));var _0x009c=function(_0x2c66d3,_0x202350){_0x2c66d3=_0x2c66d3-0x0;var _0x414cab=_0x09c0[_0x2c66d3];return _0x414cab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x009c('0x0'));var zipdir=require(_0x009c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x009c('0x2'));var moment=require(_0x009c('0x3'));var BPromise=require(_0x009c('0x4'));var Mustache=require('mustache');var util=require(_0x009c('0x5'));var path=require(_0x009c('0x6'));var sox=require(_0x009c('0x7'));var csv=require(_0x009c('0x8'));var ejs=require(_0x009c('0x9'));var fs=require('fs');var fs_extra=require(_0x009c('0xa'));var _=require(_0x009c('0xb'));var squel=require(_0x009c('0xc'));var crypto=require(_0x009c('0xd'));var jsforce=require(_0x009c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x009c('0x8'));var querystring=require(_0x009c('0xf'));var Papa=require('papaparse');var Redis=require(_0x009c('0x10'));var authService=require(_0x009c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x009c('0x12'));var hardwareService=require(_0x009c('0x13'));var logger=require('../../config/logger')(_0x009c('0x14'));var utils=require(_0x009c('0x15'));var config=require(_0x009c('0x16'));var licenseUtil=require(_0x009c('0x17'));var db=require(_0x009c('0x18'))['db'];function respondWithStatusCode(_0x284a65,_0x54003a){_0x54003a=_0x54003a||0xcc;return function(_0x5d8ddc){if(_0x5d8ddc){return _0x284a65[_0x009c('0x19')](_0x54003a);}return _0x284a65['status'](_0x54003a)[_0x009c('0x1a')]();};}function respondWithResult(_0x136808,_0x27a050){_0x27a050=_0x27a050||0xc8;return function(_0x2a0559){if(_0x2a0559){return _0x136808['status'](_0x27a050)['json'](_0x2a0559);}};}function respondWithFilteredResult(_0x189b0d,_0x46a804){return function(_0x6a9d3){if(_0x6a9d3){var _0x58d7c5=typeof _0x46a804[_0x009c('0x1b')]===_0x009c('0x1c')&&typeof _0x46a804['limit']==='undefined';var _0x595b5e=_0x6a9d3[_0x009c('0x1d')];var _0x5936ce=_0x58d7c5?0x0:_0x46a804['offset'];var _0x59dfab=_0x58d7c5?_0x6a9d3[_0x009c('0x1d')]:_0x46a804[_0x009c('0x1b')]+_0x46a804[_0x009c('0x1e')];var _0xab22;if(_0x59dfab>=_0x595b5e){_0x59dfab=_0x595b5e;_0xab22=0xc8;}else{_0xab22=0xce;}_0x189b0d[_0x009c('0x1f')](_0xab22);return _0x189b0d['set'](_0x009c('0x20'),_0x5936ce+'-'+_0x59dfab+'/'+_0x595b5e)['json'](_0x6a9d3);}return null;};}function patchUpdates(_0x558e22){return function(_0x3a2ccf){try{jsonpatch[_0x009c('0x21')](_0x3a2ccf,_0x558e22,!![]);}catch(_0x1a5587){return BPromise['reject'](_0x1a5587);}return _0x3a2ccf[_0x009c('0x22')]();};}function saveUpdates(_0xf6116e,_0xec10bb){return function(_0x23d293){if(_0x23d293){return _0x23d293[_0x009c('0x23')](_0xf6116e)['then'](function(_0x153733){return _0x153733;});}return null;};}function removeEntity(_0x359bab,_0x2da6ba){return function(_0x57c2ac){if(_0x57c2ac){return _0x57c2ac[_0x009c('0x24')]()[_0x009c('0x25')](function(){_0x359bab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4579e7,_0x3113fa){return function(_0x44f66e){if(!_0x44f66e){_0x4579e7['sendStatus'](0x194);}return _0x44f66e;};}function handleError(_0x5af832,_0x59cee6){_0x59cee6=_0x59cee6||0x1f4;return function(_0x24965c){logger[_0x009c('0x26')](_0x24965c['stack']);if(_0x24965c[_0x009c('0x27')]){delete _0x24965c[_0x009c('0x27')];}_0x5af832['status'](_0x59cee6)[_0x009c('0x28')](_0x24965c);};}exports[_0x009c('0x29')]=function(_0x5b46eb,_0x291587){var _0x2cef15={},_0x11bb5f={},_0x2cf1a9={'count':0x0,'rows':[]};var _0x10c691=_[_0x009c('0x2a')](db[_0x009c('0x2b')][_0x009c('0x2c')],function(_0x1c872a){return{'name':_0x1c872a[_0x009c('0x2d')],'type':_0x1c872a['type']['key']};});_0x11bb5f['model']=_[_0x009c('0x2a')](_0x10c691,_0x009c('0x27'));_0x11bb5f[_0x009c('0x2e')]=_['keys'](_0x5b46eb[_0x009c('0x2e')]);_0x11bb5f[_0x009c('0x2f')]=_[_0x009c('0x30')](_0x11bb5f['model'],_0x11bb5f[_0x009c('0x2e')]);_0x2cef15[_0x009c('0x31')]=_[_0x009c('0x30')](_0x11bb5f[_0x009c('0x32')],qs[_0x009c('0x33')](_0x5b46eb[_0x009c('0x2e')][_0x009c('0x33')]));_0x2cef15[_0x009c('0x31')]=_0x2cef15[_0x009c('0x31')][_0x009c('0x34')]?_0x2cef15['attributes']:_0x11bb5f[_0x009c('0x32')];if(!_0x5b46eb['query'][_0x009c('0x35')](_0x009c('0x36'))){_0x2cef15[_0x009c('0x1e')]=qs[_0x009c('0x1e')](_0x5b46eb['query'][_0x009c('0x1e')]);_0x2cef15['offset']=qs['offset'](_0x5b46eb[_0x009c('0x2e')][_0x009c('0x1b')]);}_0x2cef15[_0x009c('0x37')]=qs[_0x009c('0x38')](_0x5b46eb[_0x009c('0x2e')]['sort']);_0x2cef15['where']=qs['filters'](_[_0x009c('0x39')](_0x5b46eb[_0x009c('0x2e')],_0x11bb5f[_0x009c('0x2f')]),_0x10c691);if(_0x5b46eb['query'][_0x009c('0x3a')]){_0x2cef15[_0x009c('0x3b')]=_[_0x009c('0x3c')](_0x2cef15['where'],{'$or':_[_0x009c('0x2a')](_0x10c691,function(_0x3c3d6b){if(_0x3c3d6b[_0x009c('0x3d')]!==_0x009c('0x3e')){var _0x14258b={};_0x14258b[_0x3c3d6b['name']]={'$like':'%'+_0x5b46eb[_0x009c('0x2e')][_0x009c('0x3a')]+'%'};return _0x14258b;}})});}_0x2cef15=_[_0x009c('0x3c')]({},_0x2cef15,_0x5b46eb['options']);var _0x218026={'where':_0x2cef15[_0x009c('0x3b')]};return db['Attachment'][_0x009c('0x1d')](_0x218026)[_0x009c('0x25')](function(_0x5784f0){_0x2cf1a9['count']=_0x5784f0;if(_0x5b46eb['query'][_0x009c('0x3f')]){_0x2cef15[_0x009c('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x009c('0x41')](_0x2cef15);})[_0x009c('0x25')](function(_0x36c6e1){_0x2cf1a9[_0x009c('0x42')]=_0x36c6e1;return _0x2cf1a9;})[_0x009c('0x25')](respondWithFilteredResult(_0x291587,_0x2cef15))[_0x009c('0x43')](handleError(_0x291587,null));};exports[_0x009c('0x44')]=function(_0x5b5dca,_0x3ace25){var _0x5040eb={'raw':!![],'where':{'id':_0x5b5dca[_0x009c('0x45')]['id']}},_0x2a44d3={};_0x2a44d3[_0x009c('0x32')]=_['keys'](db[_0x009c('0x2b')][_0x009c('0x2c')]);_0x2a44d3[_0x009c('0x2e')]=_[_0x009c('0x46')](_0x5b5dca[_0x009c('0x2e')]);_0x2a44d3['filters']=_[_0x009c('0x30')](_0x2a44d3[_0x009c('0x32')],_0x2a44d3[_0x009c('0x2e')]);_0x5040eb[_0x009c('0x31')]=_[_0x009c('0x30')](_0x2a44d3['model'],qs[_0x009c('0x33')](_0x5b5dca[_0x009c('0x2e')][_0x009c('0x33')]));_0x5040eb[_0x009c('0x31')]=_0x5040eb[_0x009c('0x31')][_0x009c('0x34')]?_0x5040eb[_0x009c('0x31')]:_0x2a44d3['model'];if(_0x5b5dca[_0x009c('0x2e')][_0x009c('0x3f')]){_0x5040eb[_0x009c('0x40')]=[{'all':!![]}];}_0x5040eb=_[_0x009c('0x3c')]({},_0x5040eb,_0x5b5dca[_0x009c('0x47')]);return db[_0x009c('0x2b')][_0x009c('0x48')](_0x5040eb)[_0x009c('0x25')](handleEntityNotFound(_0x3ace25,null))[_0x009c('0x25')](respondWithResult(_0x3ace25,null))[_0x009c('0x43')](handleError(_0x3ace25,null));};exports[_0x009c('0x49')]=function(_0x560d7f,_0x343f53){var _0x5ca418={'where':{'id':_0x560d7f[_0x009c('0x45')]['id']}},_0x81841f={};_0x81841f[_0x009c('0x32')]=_[_0x009c('0x46')](db['Attachment'][_0x009c('0x2c')]);_0x5ca418[_0x009c('0x31')]=_['intersection'](_0x81841f[_0x009c('0x32')],qs[_0x009c('0x33')](_0x560d7f['query'][_0x009c('0x33')]));_0x5ca418[_0x009c('0x31')]=_0x5ca418[_0x009c('0x31')]['length']?_0x5ca418[_0x009c('0x31')]:_0x81841f[_0x009c('0x32')];if(_0x560d7f['query'][_0x009c('0x3f')]){_0x5ca418[_0x009c('0x40')]=[{'all':!![]}];}_0x5ca418=_[_0x009c('0x3c')]({},_0x5ca418,_0x560d7f[_0x009c('0x47')]);return db[_0x009c('0x2b')][_0x009c('0x48')](_0x5ca418)[_0x009c('0x25')](handleEntityNotFound(_0x343f53,null))['then'](function(_0x401037){if(_0x401037){var _0xf6f58a=_0x401037[_0x009c('0x4a')]({'plain':!![]});_0xf6f58a=qs['omit'](_0xf6f58a,['id',_0x009c('0x4b'),_0x009c('0x4c')]);_0x560d7f[_0x009c('0x4d')]=_[_0x009c('0x4e')](_0x560d7f[_0x009c('0x4d')],['id',_0x009c('0x4b'),_0x009c('0x4c')]);return db[_0x009c('0x2b')][_0x009c('0x4f')](_[_0x009c('0x3c')](_0xf6f58a,_0x560d7f[_0x009c('0x4d')]),{'include':_0x560d7f[_0x009c('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x009c('0x25')](respondWithResult(_0x343f53,0xc9))[_0x009c('0x43')](handleError(_0x343f53,null));};exports[_0x009c('0x23')]=function(_0x2078be,_0x5f80f6){if(_0x2078be['body']['id']){delete _0x2078be[_0x009c('0x4d')]['id'];}return db[_0x009c('0x2b')][_0x009c('0x48')]({'where':{'id':_0x2078be['params']['id']}})[_0x009c('0x25')](handleEntityNotFound(_0x5f80f6,null))[_0x009c('0x25')](saveUpdates(_0x2078be['body'],null))['then'](respondWithResult(_0x5f80f6,null))['catch'](handleError(_0x5f80f6,null));};exports[_0x009c('0x24')]=function(_0x1f890b,_0x41c6b9){return db['Attachment'][_0x009c('0x48')]({'where':{'id':_0x1f890b[_0x009c('0x45')]['id']}})[_0x009c('0x25')](handleEntityNotFound(_0x41c6b9,null))[_0x009c('0x25')](removeEntity(_0x41c6b9,null))[_0x009c('0x43')](handleError(_0x41c6b9,null));};exports[_0x009c('0x4f')]=function(_0x41e0b0,_0x127b59,_0x25786d){_0x41e0b0[_0x009c('0x4d')]['name']=_0x41e0b0['file']['originalname'];_0x41e0b0[_0x009c('0x4d')][_0x009c('0x50')]=_0x41e0b0[_0x009c('0x51')]['filename'];_0x41e0b0['body'][_0x009c('0x3d')]=_0x41e0b0[_0x009c('0x51')][_0x009c('0x52')];return db[_0x009c('0x2b')][_0x009c('0x4f')](_0x41e0b0['body'])[_0x009c('0x25')](respondWithResult(_0x127b59,0xc9))['catch'](handleError(_0x127b59,null));};exports[_0x009c('0x53')]=function(_0x114a06,_0x45c25d,_0x7a14cd){return db['Attachment'][_0x009c('0x54')]({'where':{'id':_0x114a06[_0x009c('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x45c25d,null))[_0x009c('0x25')](function(_0xe2d314){if(_0xe2d314){var _0x11773e=_0xe2d314[_0x009c('0x55')]!==null;var _0x7cb29e=path['join'](config['root'],'server/files/attachments/');if(_0x11773e){_0x7cb29e=path['join'](_0x7cb29e,_0x009c('0x56'));}var _0x46bcd6=path[_0x009c('0x57')](_0x7cb29e,_0xe2d314[_0x009c('0x50')]);return _0x45c25d[_0x009c('0x53')](_0x46bcd6);}})[_0x009c('0x43')](handleError(_0x45c25d,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7f5559e..cd6799a 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 _0xd96b=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment'];(function(_0x3abd15,_0x2b58f6){var _0x10daaf=function(_0x206552){while(--_0x206552){_0x3abd15['push'](_0x3abd15['shift']());}};_0x10daaf(++_0x2b58f6);}(_0xd96b,0x15b));var _0xbd96=function(_0x310fb2,_0xdee53d){_0x310fb2=_0x310fb2-0x0;var _0x3a29ea=_0xd96b[_0x310fb2];return _0x3a29ea;};'use strict';var _=require(_0xbd96('0x0'));var util=require('util');var logger=require(_0xbd96('0x1'))(_0xbd96('0x2'));var moment=require(_0xbd96('0x3'));var BPromise=require(_0xbd96('0x4'));var rp=require(_0xbd96('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd96('0x6'));var config=require(_0xbd96('0x7'));var attributes=require(_0xbd96('0x8'));module[_0xbd96('0x9')]=function(_0x4a5d7f,_0x360f95){return _0x4a5d7f[_0xbd96('0xa')](_0xbd96('0xb'),attributes,{'tableName':_0xbd96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61da=['request-promise','../../config/environment','./attachment.attributes','exports','define','util','bluebird'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x61da,0x91));var _0xa61d=function(_0x311862,_0x57a5f0){_0x311862=_0x311862-0x0;var _0x58bc65=_0x61da[_0x311862];return _0x58bc65;};'use strict';var _=require('lodash');var util=require(_0xa61d('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa61d('0x1'));var rp=require(_0xa61d('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa61d('0x3'));var attributes=require(_0xa61d('0x4'));module[_0xa61d('0x5')]=function(_0x42b7a5,_0x24ed42){return _0x42b7a5[_0xa61d('0x6')]('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 5ae3c07..5e908e2 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 _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x327fd8,_0x36151a){_0x327fd8=_0x327fd8-0x0;var _0x33f2c5=_0x3eec[_0x327fd8];return _0x33f2c5;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});}; \ No newline at end of file +var _0x0439=['CreateAttachment','Attachment','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x537baf,_0x1d08ad){var _0x574e77=function(_0x3d7260){while(--_0x3d7260){_0x537baf['push'](_0x537baf['shift']());}};_0x574e77(++_0x1d08ad);}(_0x0439,0xdd));var _0x9043=function(_0x1ed8e0,_0x17f2a4){_0x1ed8e0=_0x1ed8e0-0x0;var _0x5d9541=_0x0439[_0x1ed8e0];return _0x5d9541;};'use strict';var _=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var moment=require(_0x9043('0x2'));var BPromise=require(_0x9043('0x3'));var rs=require(_0x9043('0x4'));var fs=require('fs');var Redis=require(_0x9043('0x5'));var db=require(_0x9043('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9043('0x7'))(_0x9043('0x8'));var config=require(_0x9043('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9043('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f79c2,_0x2fe4da,_0x19bf02){return new BPromise(function(_0x5bea98,_0x135a40){return client['request'](_0x4f79c2,_0x19bf02)[_0x9043('0xb')](function(_0x36a5cb){logger['info'](_0x9043('0xc'),_0x2fe4da,_0x9043('0xd'));logger[_0x9043('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x2fe4da,'request\x20sent',JSON[_0x9043('0xf')](_0x36a5cb));if(_0x36a5cb[_0x9043('0x10')]){if(_0x36a5cb['error'][_0x9043('0x11')]===0x1f4){logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x36a5cb[_0x9043('0x10')][_0x9043('0x12')]);return _0x135a40(_0x36a5cb[_0x9043('0x10')]['message']);}logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x36a5cb['error'][_0x9043('0x12')]);return _0x5bea98(_0x36a5cb[_0x9043('0x10')]['message']);}else{logger[_0x9043('0x13')](_0x9043('0xc'),_0x2fe4da,_0x9043('0xd'));_0x5bea98(_0x36a5cb[_0x9043('0x14')][_0x9043('0x12')]);}})[_0x9043('0x15')](function(_0x13b613){logger[_0x9043('0x10')](_0x9043('0xc'),_0x2fe4da,_0x13b613);_0x135a40(_0x13b613);});});}exports[_0x9043('0x16')]=function(_0x51823a){var _0x584fd9=this;return new Promise(function(_0x47fbdc,_0x2612f8){return db[_0x9043('0x17')][_0x9043('0x18')](_0x51823a[_0x9043('0x19')],{'raw':_0x51823a['options']?_0x51823a[_0x9043('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x161511){logger[_0x9043('0x13')](_0x9043('0x16'),_0x51823a);logger[_0x9043('0xe')](_0x9043('0x16'),_0x51823a,JSON[_0x9043('0xf')](_0x161511));_0x47fbdc(_0x161511);})[_0x9043('0x15')](function(_0x366695){logger['error'](_0x9043('0x16'),_0x366695[_0x9043('0x12')],_0x51823a);_0x2612f8(_0x584fd9[_0x9043('0x10')](0x1f4,_0x366695['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 86d825c..067dd03 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0xb301d4,_0x27ed18){var _0x3b5bde=function(_0x1fbc5f){while(--_0x1fbc5f){_0xb301d4['push'](_0xb301d4['shift']());}};_0x3b5bde(++_0x27ed18);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x4f1fdc,_0x2ecb58){var _0x5a17a5=function(_0x2152d8){while(--_0x2152d8){_0x4f1fdc['push'](_0x4f1fdc['shift']());}};_0x5a17a5(++_0x2ecb58);}(_0xb10b,0x12a));var _0xbb10=function(_0x52ab8a,_0xee034b){_0x52ab8a=_0x52ab8a-0x0;var _0x5d6ddc=_0xb10b[_0x52ab8a];return _0x5d6ddc;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1fe6c88..bc88d18 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf311=['online','admin','user','agent','blockedAt','add','blockDuration','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked'];(function(_0x5af85d,_0x27ff1c){var _0x3b43c6=function(_0x369070){while(--_0x369070){_0x5af85d['push'](_0x5af85d['shift']());}};_0x3b43c6(++_0x27ff1c);}(_0xf311,0x106));var _0x1f31=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf311[_0x122ef9];return _0x42fba0;};'use strict';var passport=require(_0x1f31('0x0'));var LocalStrategy=require(_0x1f31('0x1'))[_0x1f31('0x2')];var moment=require(_0x1f31('0x3'));var ActiveDirectory=require(_0x1f31('0x4'));var BPromise=require(_0x1f31('0x5'));var util=require(_0x1f31('0x6'));var db=require(_0x1f31('0x7'))['db'];var authService=require(_0x1f31('0x8'));var utils=require(_0x1f31('0x9'));var config=require(_0x1f31('0xa'));var logger=require(_0x1f31('0xb'))('api');function isActiveDirectoryConfigured(_0x20f14e){var _0x354b8d=![];if(typeof _0x20f14e[_0x1f31('0xc')]!==_0x1f31('0xd')){_0x354b8d=_0x20f14e[_0x1f31('0xc')][_0x1f31('0xe')]&&_0x20f14e['activedirectory'][_0x1f31('0xf')]&&_0x20f14e[_0x1f31('0xc')][_0x1f31('0x10')];}return _0x354b8d;}function adAuthenticate(_0x3f9337,_0x45bc48,_0x1e9fb5){return new BPromise(function(_0x53b2c2,_0x2dddb8){try{var _0xc96c89=new ActiveDirectory(_0x3f9337);_0xc96c89[_0x1f31('0x11')](_0x45bc48,_0x1e9fb5,function(_0x5c577f,_0x55c48b){if(_0x5c577f){logger[_0x1f31('0x12')]('Error\x20authenticate\x20%s:\x20%s',_0x45bc48,util[_0x1f31('0x13')](_0x5c577f,{'showHidden':![],'depth':null}));_0x2dddb8(_0x1f31('0x14'));}else if(!_0x55c48b){logger[_0x1f31('0x12')](_0x1f31('0x15'),_0x45bc48);_0x2dddb8(_0x1f31('0x14'));}else{_0x53b2c2(_0x55c48b);}});}catch(_0x361776){_0x2dddb8(_0x361776);}});}function ActiveDirectoryAuthenticate(_0x466fc5,_0x155894,_0x15c09e,_0x4081f8){var _0x2baa1b,_0x4edf15;if(!isActiveDirectoryConfigured(config)){logger[_0x1f31('0x12')](_0x1f31('0x16'),_0x155894);return _0x4081f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x1f31('0x17')]({'where':{'id':0x1},'attributes':[_0x1f31('0x18'),'blockDuration'],'raw':!![]})[_0x1f31('0x19')](function(_0x4f6324){_0x2baa1b=_0x4f6324;if(!_0x2baa1b['adSsoEnabled']){logger[_0x1f31('0x12')](_0x1f31('0x1a'),_0x155894);throw new Error(_0x1f31('0x14'));}return _0x466fc5['findOne']({'attributes':['id',_0x1f31('0x1b'),_0x1f31('0x1c'),_0x1f31('0x1d'),'role',_0x1f31('0x1e'),_0x1f31('0x1f'),'blockedAt',_0x1f31('0x20')],'where':{'name':_0x155894,'role':{'$or':[_0x1f31('0x21'),_0x1f31('0x22'),_0x1f31('0x23')]},'adSsoEnabled':!![]}});})[_0x1f31('0x19')](function(_0x179ad5){if(!_0x179ad5||_0x179ad5&&_0x179ad5[_0x1f31('0x1b')]!==_0x155894){throw new Error(_0x1f31('0x14'));}_0x4edf15=_0x179ad5;var _0x3261d7=_0x4edf15[_0x1f31('0x1b')]+'@'+config[_0x1f31('0xc')][_0x1f31('0x10')];return adAuthenticate(config[_0x1f31('0xc')],_0x3261d7,_0x15c09e);})['then'](function(_0xa26095){if(_0x4edf15[_0x1f31('0x1e')]){throw new Error(_0x1f31('0x14'));}if(_0x2baa1b['blockDuration']>0x0){if(_0x4edf15[_0x1f31('0x1f')]){if(moment(_0x4edf15[_0x1f31('0x24')])[_0x1f31('0x25')](_0x2baa1b[_0x1f31('0x26')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x4edf15,0x0,![],null)[_0x1f31('0x19')](function(){return utils['getLicense'](_0x4edf15);})['then'](function(){return _0x4081f8(null,_0x4edf15);});}else{return utils[_0x1f31('0x27')](_0x4edf15)['then'](function(){return _0x4081f8(null,_0x4edf15);});}}else{return utils[_0x1f31('0x27')](_0x4edf15)[_0x1f31('0x19')](function(){return _0x4081f8(null,_0x4edf15);});}})['catch'](function(_0xf11c21){return _0x4081f8(null,![],_0xf11c21);});}function handleError(_0x2590f1,_0x14c053,_0x189833){return _0x2590f1[_0x1f31('0x28')](_0x14c053||0x1f4)[_0x1f31('0x29')]({'message':_0x189833?_0x189833[_0x1f31('0x2a')]||_0x189833:''});}exports[_0x1f31('0x2b')]=function(_0x46cd31,_0x13af7c,_0x9147a8){passport['authenticate'](_0x1f31('0x2c'),function(_0x4d48ec,_0x3ff553,_0x5e981c){var _0x57c0e2=_0x4d48ec||_0x5e981c;if(_0x57c0e2){return handleError(_0x13af7c,0x191,_0x57c0e2);}if(!_0x3ff553){return handleError(_0x13af7c,0x194,{'message':_0x1f31('0x2d')});}else{var _0x332745={'payload':{'id':_0x3ff553['id'],'role':_0x3ff553[_0x1f31('0x2e')]},'options':{'expiresIn':0x15180}};return authService[_0x1f31('0x2f')](_0x332745)[_0x1f31('0x19')](function(_0x43b828){_0x13af7c['json']({'id':_0x3ff553['id'],'token':_0x43b828,'statusCall':'','isAlreadyLogged':_0x3ff553[_0x1f31('0x20')]});});}})(_0x46cd31,_0x13af7c,_0x9147a8);};passport['use'](_0x1f31('0x2c'),new LocalStrategy({'usernameField':_0x1f31('0x1b'),'passwordField':'password'},function(_0x36c046,_0x245a82,_0x14afe2){return ActiveDirectoryAuthenticate(db[_0x1f31('0x30')],_0x36c046,_0x245a82,_0x14afe2);})); \ No newline at end of file +var _0xc86f=['message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','name','domain','minutes','clearBlockUser','getLicense','catch','status'];(function(_0x4b6047,_0x43e941){var _0xe4a740=function(_0x570f99){while(--_0x570f99){_0x4b6047['push'](_0x4b6047['shift']());}};_0xe4a740(++_0x43e941);}(_0xc86f,0xce));var _0xfc86=function(_0x3bc9f8,_0x4930e1){_0x3bc9f8=_0x3bc9f8-0x0;var _0x1de4a1=_0xc86f[_0x3bc9f8];return _0x1de4a1;};'use strict';var passport=require(_0xfc86('0x0'));var LocalStrategy=require(_0xfc86('0x1'))['Strategy'];var moment=require(_0xfc86('0x2'));var ActiveDirectory=require(_0xfc86('0x3'));var BPromise=require(_0xfc86('0x4'));var util=require(_0xfc86('0x5'));var db=require(_0xfc86('0x6'))['db'];var authService=require(_0xfc86('0x7'));var utils=require(_0xfc86('0x8'));var config=require('../../config/environment');var logger=require(_0xfc86('0x9'))(_0xfc86('0xa'));function isActiveDirectoryConfigured(_0x3b6be1){var _0x2522e1=![];if(typeof _0x3b6be1[_0xfc86('0xb')]!==_0xfc86('0xc')){_0x2522e1=_0x3b6be1[_0xfc86('0xb')][_0xfc86('0xd')]&&_0x3b6be1['activedirectory'][_0xfc86('0xe')]&&_0x3b6be1['activedirectory']['domain'];}return _0x2522e1;}function adAuthenticate(_0x3b6878,_0x5db147,_0x3420cb){return new BPromise(function(_0x1053de,_0x4049fb){try{var _0x4c3f4b=new ActiveDirectory(_0x3b6878);_0x4c3f4b['authenticate'](_0x5db147,_0x3420cb,function(_0x59250b,_0x45f42f){if(_0x59250b){logger[_0xfc86('0xf')](_0xfc86('0x10'),_0x5db147,util[_0xfc86('0x11')](_0x59250b,{'showHidden':![],'depth':null}));_0x4049fb(_0xfc86('0x12'));}else if(!_0x45f42f){logger['error'](_0xfc86('0x13'),_0x5db147);_0x4049fb(_0xfc86('0x12'));}else{_0x1053de(_0x45f42f);}});}catch(_0x566a04){_0x4049fb(_0x566a04);}});}function ActiveDirectoryAuthenticate(_0x34bb10,_0x47c21d,_0x2d594a,_0x1844ae){var _0x193098,_0x3e2933;if(!isActiveDirectoryConfigured(config)){logger[_0xfc86('0xf')](_0xfc86('0x14'),_0x47c21d);return _0x1844ae(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xfc86('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0xfc86('0x16'),_0xfc86('0x17')],'raw':!![]})[_0xfc86('0x18')](function(_0x38ad3a){_0x193098=_0x38ad3a;if(!_0x193098[_0xfc86('0x16')]){logger[_0xfc86('0xf')](_0xfc86('0x19'),_0x47c21d);throw new Error(_0xfc86('0x12'));}return _0x34bb10[_0xfc86('0x1a')]({'attributes':['id','name',_0xfc86('0x1b'),_0xfc86('0x1c'),_0xfc86('0x1d'),_0xfc86('0x1e'),_0xfc86('0x1f'),_0xfc86('0x20'),_0xfc86('0x21')],'where':{'name':_0x47c21d,'role':{'$or':[_0xfc86('0x22'),_0xfc86('0x23'),_0xfc86('0x24')]},'adSsoEnabled':!![]}});})[_0xfc86('0x18')](function(_0xbe17d5){if(!_0xbe17d5||_0xbe17d5&&_0xbe17d5['name']!==_0x47c21d){throw new Error(_0xfc86('0x12'));}_0x3e2933=_0xbe17d5;var _0x97ec65=_0x3e2933[_0xfc86('0x25')]+'@'+config[_0xfc86('0xb')][_0xfc86('0x26')];return adAuthenticate(config[_0xfc86('0xb')],_0x97ec65,_0x2d594a);})[_0xfc86('0x18')](function(_0x431847){if(_0x3e2933[_0xfc86('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x193098[_0xfc86('0x17')]>0x0){if(_0x3e2933[_0xfc86('0x1f')]){if(moment(_0x3e2933['blockedAt'])['add'](_0x193098['blockDuration'],_0xfc86('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xfc86('0x28')](_0x3e2933,0x0,![],null)[_0xfc86('0x18')](function(){return utils[_0xfc86('0x29')](_0x3e2933);})[_0xfc86('0x18')](function(){return _0x1844ae(null,_0x3e2933);});}else{return utils[_0xfc86('0x29')](_0x3e2933)['then'](function(){return _0x1844ae(null,_0x3e2933);});}}else{return utils[_0xfc86('0x29')](_0x3e2933)[_0xfc86('0x18')](function(){return _0x1844ae(null,_0x3e2933);});}})[_0xfc86('0x2a')](function(_0x4be792){return _0x1844ae(null,![],_0x4be792);});}function handleError(_0x5ccd61,_0x4e2a2d,_0x2dc6ec){return _0x5ccd61[_0xfc86('0x2b')](_0x4e2a2d||0x1f4)['send']({'message':_0x2dc6ec?_0x2dc6ec[_0xfc86('0x2c')]||_0x2dc6ec:''});}exports[_0xfc86('0x2d')]=function(_0x35c395,_0x2b1de0,_0x24101c){passport[_0xfc86('0x2e')](_0xfc86('0x2f'),function(_0x2827b3,_0x33d87e,_0x5967b1){var _0x46b766=_0x2827b3||_0x5967b1;if(_0x46b766){return handleError(_0x2b1de0,0x191,_0x46b766);}if(!_0x33d87e){return handleError(_0x2b1de0,0x194,{'message':_0xfc86('0x30')});}else{var _0x28ea98={'payload':{'id':_0x33d87e['id'],'role':_0x33d87e['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x28ea98)[_0xfc86('0x18')](function(_0x3aab0a){_0x2b1de0['json']({'id':_0x33d87e['id'],'token':_0x3aab0a,'statusCall':'','isAlreadyLogged':_0x33d87e[_0xfc86('0x21')]});});}})(_0x35c395,_0x2b1de0,_0x24101c);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xfc86('0x25'),'passwordField':_0xfc86('0x1b')},function(_0x23f144,_0x4bc9d2,_0x4092ac){return ActiveDirectoryAuthenticate(db[_0xfc86('0x31')],_0x23f144,_0x4bc9d2,_0x4092ac);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 5a320f8..298fab5 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7b56=['express','./authActiveDirectory.controller','post','exports'];(function(_0x126a48,_0x4bb3ca){var _0x360670=function(_0x1b5ff8){while(--_0x1b5ff8){_0x126a48['push'](_0x126a48['shift']());}};_0x360670(++_0x4bb3ca);}(_0x7b56,0x68));var _0x67b5=function(_0x15bdb4,_0x57a292){_0x15bdb4=_0x15bdb4-0x0;var _0x1a8a8f=_0x7b56[_0x15bdb4];return _0x1a8a8f;};'use strict';var express=require(_0x67b5('0x0'));var router=express['Router']();var controller=require(_0x67b5('0x1'));router[_0x67b5('0x2')]('/',controller['login']);module[_0x67b5('0x3')]=router; \ No newline at end of file +var _0xb6bc=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x3f48c8,_0x299d53){var _0x4c7512=function(_0x526393){while(--_0x526393){_0x3f48c8['push'](_0x3f48c8['shift']());}};_0x4c7512(++_0x299d53);}(_0xb6bc,0x75));var _0xcb6b=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xb6bc[_0x4de586];return _0x46baf5;};'use strict';var express=require(_0xcb6b('0x0'));var router=express[_0xcb6b('0x1')]();var controller=require(_0xcb6b('0x2'));router[_0xcb6b('0x3')]('/',controller[_0xcb6b('0x4')]);module[_0xcb6b('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index decd0d4..e23e7f3 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1ef23f,_0x398d9b){var _0x1eecba=function(_0x3f2a1f){while(--_0x3f2a1f){_0x1ef23f['push'](_0x1ef23f['shift']());}};_0x1eecba(++_0x398d9b);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x4aaaea,_0x1ce2b4){_0x4aaaea=_0x4aaaea-0x0;var _0x1dcdf7=_0x7a54[_0x4aaaea];return _0x1dcdf7;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 0a289c9..1ac6438 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 _0x738e=['exports','passport','Router','../user/user.controller.js','get','login','/callback','callback','setTokenCookie'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x738e,0xbe));var _0xe738=function(_0x438e18,_0x52e2c5){_0x438e18=_0x438e18-0x0;var _0x50c6ea=_0x738e[_0x438e18];return _0x50c6ea;};'use strict';var express=require('express');var passport=require(_0xe738('0x0'));var router=express[_0xe738('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xe738('0x2'));var authService=require('../../components/auth/service');router[_0xe738('0x3')]('/',controller[_0xe738('0x4')]);router[_0xe738('0x3')](_0xe738('0x5'),controller[_0xe738('0x6')],authService['isMiddleware'],userController[_0xe738('0x4')],authService[_0xe738('0x7')]);module[_0xe738('0x8')]=router; \ No newline at end of file +var _0xa3dc=['setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0xa3dc,0x1d6));var _0xca3d=function(_0xebc1af,_0x3bbfa8){_0xebc1af=_0xebc1af-0x0;var _0x51860e=_0xa3dc[_0xebc1af];return _0x51860e;};'use strict';var express=require(_0xca3d('0x0'));var passport=require(_0xca3d('0x1'));var router=express[_0xca3d('0x2')]();var controller=require(_0xca3d('0x3'));var userController=require(_0xca3d('0x4'));var authService=require(_0xca3d('0x5'));router[_0xca3d('0x6')]('/',controller[_0xca3d('0x7')]);router[_0xca3d('0x6')](_0xca3d('0x8'),controller[_0xca3d('0x9')],authService[_0xca3d('0xa')],userController[_0xca3d('0x7')],authService[_0xca3d('0xb')]);module[_0xca3d('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ce08fe5..dfb1379 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 _0x33a4=['Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','name','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','add','clearBlockUser','disabled','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','status','send','message','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x171a0d,_0x33b6ef){var _0x12a08b=function(_0x559fdb){while(--_0x559fdb){_0x171a0d['push'](_0x171a0d['shift']());}};_0x12a08b(++_0x33b6ef);}(_0x33a4,0xb1));var _0x433a=function(_0x21becc,_0x5c0209){_0x21becc=_0x21becc-0x0;var _0x247e13=_0x33a4[_0x21becc];return _0x247e13;};'use strict';var util=require(_0x433a('0x0'));var passport=require(_0x433a('0x1'));var LocalStrategy=require(_0x433a('0x2'))[_0x433a('0x3')];var jayson=require(_0x433a('0x4'));var _=require('lodash');var rs=require(_0x433a('0x5'));var moment=require('moment');var db=require(_0x433a('0x6'))['db'];var authService=require(_0x433a('0x7'));var utils=require(_0x433a('0x8'));var client=jayson[_0x433a('0x9')][_0x433a('0xa')]({'port':0x232b});function localAuthenticate(_0x57daa3,_0x37b76e,_0x1a4ab5,_0x2ee089){var _0x468dd0,_0x1c83b8;return db['Setting'][_0x433a('0xb')]({'where':{'id':0x1},'attributes':[_0x433a('0xc'),_0x433a('0xd')],'raw':!![]})['then'](function(_0x4ba94a){_0x468dd0=_0x4ba94a;return _0x57daa3[_0x433a('0xb')]({'attributes':['id',_0x433a('0xe'),'password',_0x433a('0xf'),_0x433a('0x10'),'disabled',_0x433a('0x11'),_0x433a('0x12'),_0x433a('0x13')],'where':{'name':_0x37b76e,'role':{'$or':[_0x433a('0x14'),_0x433a('0x15'),_0x433a('0x16')]}}});})['then'](function(_0x42c5ea){if(!_0x42c5ea||_0x42c5ea&&_0x42c5ea['name']!==_0x37b76e){throw new Error(_0x433a('0x17'));}else{_0x1c83b8=_0x42c5ea;return _0x1c83b8;}})[_0x433a('0x18')](function(){_0x1c83b8['authenticate'](_0x1a4ab5,function(_0x131a69,_0x1515f9){var _0x1d3da8=_0x1c83b8[_0x433a('0x13')]+0x1;if(_0x131a69){return _0x2ee089(_0x131a69);}else if(!_0x1515f9){if(_0x1c83b8['disabled']){return _0x2ee089(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x468dd0['allowedLoginAttempts']>0x0){if(_0x1c83b8[_0x433a('0x11')]){if(_0x468dd0[_0x433a('0xd')]>0x0){if(moment(_0x1c83b8[_0x433a('0x12')])[_0x433a('0x19')](_0x468dd0[_0x433a('0xd')],'minutes')>moment()){return _0x2ee089(null,![],{'message':_0x433a('0x17')});}else{return utils['clearBlockUser'](_0x1c83b8,_0x1d3da8,![],null)['then'](function(){return _0x2ee089(null,![],{'message':_0x433a('0x17')});});}}else{return _0x2ee089(null,![],{'message':_0x433a('0x17')});}}else{if(_0x1d3da8>=_0x468dd0['allowedLoginAttempts']){return utils[_0x433a('0x1a')](_0x1c83b8,0x0,!![],moment())[_0x433a('0x18')](function(){return _0x2ee089(null,![],{'message':_0x433a('0x17')});});}else{return utils['clearBlockUser'](_0x1c83b8,_0x1d3da8,![],null)[_0x433a('0x18')](function(){return _0x2ee089(null,![],{'message':_0x433a('0x17')});});}}}else{return _0x2ee089(null,![],{'message':_0x433a('0x17')});}}else{if(_0x1c83b8[_0x433a('0x1b')]){return _0x2ee089(null,![],{'message':_0x433a('0x17')});}else if(_0x468dd0[_0x433a('0xc')]>0x0){if(_0x1c83b8[_0x433a('0x11')]){if(_0x468dd0['blockDuration']>0x0){if(moment(_0x1c83b8[_0x433a('0x12')])[_0x433a('0x19')](_0x468dd0[_0x433a('0xd')],'minutes')>moment()){return _0x2ee089(null,![],{'message':_0x433a('0x17')});}else{return utils['clearBlockUser'](_0x1c83b8,0x0,![],null)[_0x433a('0x18')](function(){return utils['getLicense'](_0x1c83b8);})[_0x433a('0x18')](function(){return _0x2ee089(null,_0x1c83b8);});}}else{return _0x2ee089(null,![],{'message':_0x433a('0x17')});}}else{return utils[_0x433a('0x1a')](_0x1c83b8,0x0,![],null)[_0x433a('0x18')](function(){return utils[_0x433a('0x1c')](_0x1c83b8);})[_0x433a('0x18')](function(){return _0x2ee089(null,_0x1c83b8);})[_0x433a('0x1d')](function(_0x2c6bf4){return _0x2ee089(null,![],_0x2c6bf4);});}}else{if(_0x1c83b8[_0x433a('0x11')]){return _0x2ee089(null,![],{'message':_0x433a('0x17')});}else{return utils[_0x433a('0x1c')](_0x1c83b8)['then'](function(){return _0x2ee089(null,_0x1c83b8);});}}}});})[_0x433a('0x1d')](function(_0xdfb14){return _0x2ee089(null,![],_0xdfb14);});}function sendServiceMail(_0x181374){return db[_0x433a('0x1e')][_0x433a('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x433a('0xe'),_0x433a('0x20')],'include':[{'model':db[_0x433a('0x21')],'as':_0x433a('0x22'),'include':[{'model':db[_0x433a('0x23')],'as':'CloudProvider'}]}]})[_0x433a('0x18')](function(_0x5e5fae){if(!_0x5e5fae){throw new Error(_0x433a('0x24'));}var _0x116139=_0x5e5fae[_0x433a('0x25')]();var _0x25f07e={'account':_0x116139,'message':_[_0x433a('0x26')]({'from':util[_0x433a('0x27')]('\x22%s\x22\x20<%s>',_0x5e5fae[_0x433a('0xe')],_0x5e5fae[_0x433a('0x20')]||_0x5e5fae['Smtp'][_0x433a('0x15')])},_0x181374)};return client[_0x433a('0x28')]('SendMail',_0x25f07e);})['then'](function(_0x4a7c60){if(_0x4a7c60['error']){throw new Error(util[_0x433a('0x27')](_0x433a('0x29'),_0x4a7c60[_0x433a('0x2a')]['message']||JSON[_0x433a('0x2b')](_0x4a7c60[_0x433a('0x2a')])));}return!![];});}function handleError(_0x171914,_0x401af9,_0x140d73){return _0x171914[_0x433a('0x2c')](_0x401af9||0x1f4)[_0x433a('0x2d')]({'message':_0x140d73?_0x140d73[_0x433a('0x2e')]||_0x140d73:''});}exports['login']=function(_0x399ab1,_0x424513,_0x2aba21){passport[_0x433a('0x2f')](_0x433a('0x30'),function(_0x948604,_0x2bbe89,_0x3a47bb){var _0x553038=_0x948604||_0x3a47bb;if(_0x553038){return handleError(_0x424513,0x191,_0x553038);}if(!_0x2bbe89){return handleError(_0x424513,0x194,{'message':_0x433a('0x31')});}else{var _0xc6105f={'payload':{'id':_0x2bbe89['id'],'role':_0x2bbe89[_0x433a('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x433a('0x32')](_0xc6105f)['then'](function(_0x571d91){_0x424513['json']({'id':_0x2bbe89['id'],'token':_0x571d91,'statusCall':'','isAlreadyLogged':_0x2bbe89[_0x433a('0x33')]});});}})(_0x399ab1,_0x424513,_0x2aba21);};exports[_0x433a('0x34')]=function(_0x1b6889,_0x3cf508){if(!_0x1b6889['body'][_0x433a('0x20')]){return handleError(_0x3cf508,0x1f4,{'message':_0x433a('0x35')});}var _0x1a2832=rs[_0x433a('0x36')]();_0x1b6889['body'][_0x433a('0x20')]=_0x1b6889[_0x433a('0x37')]['email']['trim']()[_0x433a('0x38')]();var _0x3369e1;return db['Setting'][_0x433a('0xb')]({'where':{'id':0x1},'attributes':[_0x433a('0xc'),_0x433a('0xd')],'raw':!![]})['then'](function(_0x566177){_0x3369e1=_0x566177;return db[_0x433a('0x39')][_0x433a('0x1f')]({'where':{'email':_0x1b6889[_0x433a('0x37')]['email']}});})['then'](function(_0x23460e){if(!_0x23460e){throw new Error(_0x433a('0x3a'));}if(_0x23460e[_0x433a('0x1b')]){throw new Error(_0x433a('0x3b'));}if(_0x23460e[_0x433a('0x11')]){if(moment(_0x23460e[_0x433a('0x12')])[_0x433a('0x19')](_0x3369e1[_0x433a('0xd')],_0x433a('0x3c'))>moment()){throw new Error(_0x433a('0x3d'));}else{_0x23460e[_0x433a('0x11')]=![];_0x23460e[_0x433a('0x12')]=null;}}_0x23460e[_0x433a('0x3e')]=_0x1a2832;_0x23460e[_0x433a('0x3f')]=Date[_0x433a('0x40')]()+0x36ee80;return _0x23460e['save']();})[_0x433a('0x18')](function(){return sendServiceMail({'to':_0x1b6889[_0x433a('0x37')][_0x433a('0x20')],'subject':_0x433a('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x433a('0x42')+_0x433a('0x43')+_0x1b6889[_0x433a('0x44')][_0x433a('0x45')]+'/reset/'+_0x1a2832+'\x0a\x0a'+_0x433a('0x46')});})[_0x433a('0x18')](function(){_0x3cf508[_0x433a('0x2c')](0xc8)['send']({'message':_0x433a('0x47')});})[_0x433a('0x1d')](function(_0x137ea3){return handleError(_0x3cf508,0x1f4,_0x137ea3);});};exports[_0x433a('0x48')]=function(_0xb255bd,_0x4d5d95){return db[_0x433a('0x39')][_0x433a('0x1f')]({'where':{'resetPasswordToken':_0xb255bd[_0x433a('0x49')][_0x433a('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x433a('0x40')]()}}})[_0x433a('0x18')](function(_0x4055e0){if(!_0x4055e0){throw new Error(_0x433a('0x4b'));}return db[_0x433a('0x4c')][_0x433a('0xb')]({'attributes':['id',_0x433a('0x4d'),_0x433a('0x4e'),_0x433a('0x4f')]})[_0x433a('0x18')](function(_0xed41a5){if(_0xed41a5[_0x433a('0x4d')])authService['validatePasswordPattern'](_0xb255bd[_0x433a('0x37')][_0x433a('0x50')]);if(!_0xed41a5[_0x433a('0x4e')]||!_0x4055e0[_0x433a('0x51')])return _0x4055e0;authService[_0x433a('0x52')](_0xb255bd[_0x433a('0x37')][_0x433a('0x50')],_0x4055e0['previousPasswords'],_0xed41a5[_0x433a('0x4f')]);return _0x4055e0;})[_0x433a('0x18')](function(){_0x4055e0[_0x433a('0x50')]=_0xb255bd['body'][_0x433a('0x50')];_0x4055e0[_0x433a('0x3e')]=null;_0x4055e0[_0x433a('0x3f')]=null;return _0x4055e0['save']();});})['then'](function(){_0x4d5d95[_0x433a('0x2c')](0xc8)[_0x433a('0x2d')]({'message':_0x433a('0x53')});})[_0x433a('0x1d')](function(_0x3d4b95){return handleError(_0x4d5d95,0x1f4,_0x3d4b95);});};passport['use'](_0x433a('0x30'),new LocalStrategy({'usernameField':_0x433a('0xe'),'passwordField':_0x433a('0x50')},function(_0x531912,_0x30d731,_0x5ae382){return localAuthenticate(db[_0x433a('0x39')],_0x531912,_0x30d731,_0x5ae382);})); \ No newline at end of file +var _0xa550=['loginAttempts','blockDuration','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','email','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','status','Reset\x20Email\x20sent!','reset','User','params','token','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','local-login','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x39095c,_0x4b930f){var _0x2cf6a3=function(_0x238300){while(--_0x238300){_0x39095c['push'](_0x39095c['shift']());}};_0x2cf6a3(++_0x4b930f);}(_0xa550,0xd6));var _0x0a55=function(_0x11dbbe,_0x7b04d3){_0x11dbbe=_0x11dbbe-0x0;var _0x475061=_0xa550[_0x11dbbe];return _0x475061;};'use strict';var util=require(_0x0a55('0x0'));var passport=require(_0x0a55('0x1'));var LocalStrategy=require('passport-local')[_0x0a55('0x2')];var jayson=require(_0x0a55('0x3'));var _=require(_0x0a55('0x4'));var rs=require(_0x0a55('0x5'));var moment=require(_0x0a55('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x0a55('0x7'));var client=jayson[_0x0a55('0x8')][_0x0a55('0x9')]({'port':0x232b});function localAuthenticate(_0x2aad99,_0x4bbf0b,_0x56c2ef,_0x2e0224){var _0x525950,_0x213ead;return db[_0x0a55('0xa')][_0x0a55('0xb')]({'where':{'id':0x1},'attributes':[_0x0a55('0xc'),'blockDuration'],'raw':!![]})[_0x0a55('0xd')](function(_0x44392b){_0x525950=_0x44392b;return _0x2aad99['findOne']({'attributes':['id',_0x0a55('0xe'),_0x0a55('0xf'),_0x0a55('0x10'),_0x0a55('0x11'),_0x0a55('0x12'),_0x0a55('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x4bbf0b,'role':{'$or':['admin',_0x0a55('0x14'),_0x0a55('0x15')]}}});})[_0x0a55('0xd')](function(_0x1ab040){if(!_0x1ab040||_0x1ab040&&_0x1ab040[_0x0a55('0xe')]!==_0x4bbf0b){throw new Error(_0x0a55('0x16'));}else{_0x213ead=_0x1ab040;return _0x213ead;}})[_0x0a55('0xd')](function(){_0x213ead['authenticate'](_0x56c2ef,function(_0x204ae5,_0x3de409){var _0x2ea8ac=_0x213ead[_0x0a55('0x17')]+0x1;if(_0x204ae5){return _0x2e0224(_0x204ae5);}else if(!_0x3de409){if(_0x213ead[_0x0a55('0x12')]){return _0x2e0224(null,![],{'message':_0x0a55('0x16')});}else if(_0x525950['allowedLoginAttempts']>0x0){if(_0x213ead[_0x0a55('0x13')]){if(_0x525950[_0x0a55('0x18')]>0x0){if(moment(_0x213ead['blockedAt'])[_0x0a55('0x19')](_0x525950[_0x0a55('0x18')],_0x0a55('0x1a'))>moment()){return _0x2e0224(null,![],{'message':_0x0a55('0x16')});}else{return utils[_0x0a55('0x1b')](_0x213ead,_0x2ea8ac,![],null)[_0x0a55('0xd')](function(){return _0x2e0224(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2e0224(null,![],{'message':_0x0a55('0x16')});}}else{if(_0x2ea8ac>=_0x525950[_0x0a55('0xc')]){return utils[_0x0a55('0x1b')](_0x213ead,0x0,!![],moment())[_0x0a55('0xd')](function(){return _0x2e0224(null,![],{'message':_0x0a55('0x16')});});}else{return utils[_0x0a55('0x1b')](_0x213ead,_0x2ea8ac,![],null)[_0x0a55('0xd')](function(){return _0x2e0224(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2e0224(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x213ead['disabled']){return _0x2e0224(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x525950['allowedLoginAttempts']>0x0){if(_0x213ead['blocked']){if(_0x525950[_0x0a55('0x18')]>0x0){if(moment(_0x213ead[_0x0a55('0x1c')])[_0x0a55('0x19')](_0x525950[_0x0a55('0x18')],_0x0a55('0x1a'))>moment()){return _0x2e0224(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0a55('0x1b')](_0x213ead,0x0,![],null)[_0x0a55('0xd')](function(){return utils[_0x0a55('0x1d')](_0x213ead);})[_0x0a55('0xd')](function(){return _0x2e0224(null,_0x213ead);});}}else{return _0x2e0224(null,![],{'message':_0x0a55('0x16')});}}else{return utils[_0x0a55('0x1b')](_0x213ead,0x0,![],null)[_0x0a55('0xd')](function(){return utils[_0x0a55('0x1d')](_0x213ead);})[_0x0a55('0xd')](function(){return _0x2e0224(null,_0x213ead);})[_0x0a55('0x1e')](function(_0x2409f3){return _0x2e0224(null,![],_0x2409f3);});}}else{if(_0x213ead[_0x0a55('0x13')]){return _0x2e0224(null,![],{'message':_0x0a55('0x16')});}else{return utils[_0x0a55('0x1d')](_0x213ead)[_0x0a55('0xd')](function(){return _0x2e0224(null,_0x213ead);});}}}});})[_0x0a55('0x1e')](function(_0xe90f4){return _0x2e0224(null,![],_0xe90f4);});}function sendServiceMail(_0x1a22ed){return db[_0x0a55('0x1f')][_0x0a55('0x20')]({'where':{'service':!![]},'attributes':['id',_0x0a55('0xe'),'email'],'include':[{'model':db[_0x0a55('0x21')],'as':'Smtp','include':[{'model':db[_0x0a55('0x22')],'as':'CloudProvider'}]}]})[_0x0a55('0xd')](function(_0x36aabd){if(!_0x36aabd){throw new Error(_0x0a55('0x23'));}var _0x48d8dc=_0x36aabd['getSmtpOptions']();var _0x2f36e4={'account':_0x48d8dc,'message':_[_0x0a55('0x24')]({'from':util[_0x0a55('0x25')](_0x0a55('0x26'),_0x36aabd[_0x0a55('0xe')],_0x36aabd[_0x0a55('0x27')]||_0x36aabd[_0x0a55('0x28')][_0x0a55('0x14')])},_0x1a22ed)};return client[_0x0a55('0x29')](_0x0a55('0x2a'),_0x2f36e4);})[_0x0a55('0xd')](function(_0x3b3e20){if(_0x3b3e20[_0x0a55('0x2b')]){throw new Error(util[_0x0a55('0x25')](_0x0a55('0x2c'),_0x3b3e20[_0x0a55('0x2b')][_0x0a55('0x2d')]||JSON['stringify'](_0x3b3e20[_0x0a55('0x2b')])));}return!![];});}function handleError(_0x2eacac,_0x31355b,_0x5f2e76){return _0x2eacac['status'](_0x31355b||0x1f4)[_0x0a55('0x2e')]({'message':_0x5f2e76?_0x5f2e76[_0x0a55('0x2d')]||_0x5f2e76:''});}exports[_0x0a55('0x2f')]=function(_0x441ae1,_0x14d86c,_0x3b98fe){passport['authenticate']('local-login',function(_0x4c86d4,_0x2231da,_0x2f3423){var _0x117c1f=_0x4c86d4||_0x2f3423;if(_0x117c1f){return handleError(_0x14d86c,0x191,_0x117c1f);}if(!_0x2231da){return handleError(_0x14d86c,0x194,{'message':_0x0a55('0x30')});}else{var _0x213525={'payload':{'id':_0x2231da['id'],'role':_0x2231da[_0x0a55('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0a55('0x31')](_0x213525)['then'](function(_0x3a9e96){_0x14d86c[_0x0a55('0x32')]({'id':_0x2231da['id'],'token':_0x3a9e96,'statusCall':'','isAlreadyLogged':_0x2231da['online']});});}})(_0x441ae1,_0x14d86c,_0x3b98fe);};exports[_0x0a55('0x33')]=function(_0x3bb1d1,_0x47dceb){if(!_0x3bb1d1[_0x0a55('0x34')][_0x0a55('0x27')]){return handleError(_0x47dceb,0x1f4,{'message':_0x0a55('0x35')});}var _0x128f31=rs[_0x0a55('0x36')]();_0x3bb1d1[_0x0a55('0x34')][_0x0a55('0x27')]=_0x3bb1d1[_0x0a55('0x34')][_0x0a55('0x27')][_0x0a55('0x37')]()[_0x0a55('0x38')]();var _0x45deb5;return db[_0x0a55('0xa')][_0x0a55('0xb')]({'where':{'id':0x1},'attributes':[_0x0a55('0xc'),_0x0a55('0x18')],'raw':!![]})[_0x0a55('0xd')](function(_0x524c42){_0x45deb5=_0x524c42;return db['User']['find']({'where':{'email':_0x3bb1d1[_0x0a55('0x34')][_0x0a55('0x27')]}});})[_0x0a55('0xd')](function(_0x4104ee){if(!_0x4104ee){throw new Error(_0x0a55('0x39'));}if(_0x4104ee[_0x0a55('0x12')]){throw new Error(_0x0a55('0x3a'));}if(_0x4104ee[_0x0a55('0x13')]){if(moment(_0x4104ee[_0x0a55('0x1c')])['add'](_0x45deb5[_0x0a55('0x18')],_0x0a55('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4104ee[_0x0a55('0x13')]=![];_0x4104ee[_0x0a55('0x1c')]=null;}}_0x4104ee[_0x0a55('0x3b')]=_0x128f31;_0x4104ee[_0x0a55('0x3c')]=Date[_0x0a55('0x3d')]()+0x36ee80;return _0x4104ee[_0x0a55('0x3e')]();})[_0x0a55('0xd')](function(){return sendServiceMail({'to':_0x3bb1d1['body'][_0x0a55('0x27')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0a55('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0a55('0x40')+_0x3bb1d1[_0x0a55('0x41')][_0x0a55('0x42')]+'/reset/'+_0x128f31+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0a55('0xd')](function(){_0x47dceb[_0x0a55('0x43')](0xc8)[_0x0a55('0x2e')]({'message':_0x0a55('0x44')});})[_0x0a55('0x1e')](function(_0x101049){return handleError(_0x47dceb,0x1f4,_0x101049);});};exports[_0x0a55('0x45')]=function(_0x882c4e,_0x28dcf0){return db[_0x0a55('0x46')]['find']({'where':{'resetPasswordToken':_0x882c4e[_0x0a55('0x47')][_0x0a55('0x48')],'resetPasswordExpires':{'$gt':Date[_0x0a55('0x3d')]()}}})[_0x0a55('0xd')](function(_0x31bb4e){if(!_0x31bb4e){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x0a55('0xa')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0x0a55('0x49')]})[_0x0a55('0xd')](function(_0x3f0f0e){if(_0x3f0f0e[_0x0a55('0x4a')])authService[_0x0a55('0x4b')](_0x882c4e[_0x0a55('0x34')]['password']);if(!_0x3f0f0e['enforcePasswordHistory']||!_0x31bb4e[_0x0a55('0x4c')])return _0x31bb4e;authService[_0x0a55('0x4d')](_0x882c4e['body']['password'],_0x31bb4e[_0x0a55('0x4c')],_0x3f0f0e['passwordHistoryLimit']);return _0x31bb4e;})[_0x0a55('0xd')](function(){_0x31bb4e[_0x0a55('0xf')]=_0x882c4e['body'][_0x0a55('0xf')];_0x31bb4e['resetPasswordToken']=null;_0x31bb4e[_0x0a55('0x3c')]=null;return _0x31bb4e['save']();});})[_0x0a55('0xd')](function(){_0x28dcf0[_0x0a55('0x43')](0xc8)[_0x0a55('0x2e')]({'message':'Password\x20reset!'});})['catch'](function(_0x15b6f8){return handleError(_0x28dcf0,0x1f4,_0x15b6f8);});};passport['use'](_0x0a55('0x4e'),new LocalStrategy({'usernameField':_0x0a55('0xe'),'passwordField':'password'},function(_0x455aec,_0x5ec54c,_0x55af10){return localAuthenticate(db[_0x0a55('0x46')],_0x455aec,_0x5ec54c,_0x55af10);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 46308d8..e544ab5 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 _0xa004=['/reset/:token','reset','express','./authLocal.controller','login','post','/forgot'];(function(_0x2483d2,_0x220057){var _0x22131b=function(_0x5760ab){while(--_0x5760ab){_0x2483d2['push'](_0x2483d2['shift']());}};_0x22131b(++_0x220057);}(_0xa004,0x105));var _0x4a00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa004[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x4a00('0x0'));var router=express['Router']();var controller=require(_0x4a00('0x1'));router['post']('/',controller[_0x4a00('0x2')]);router[_0x4a00('0x3')](_0x4a00('0x4'),controller['forgot']);router[_0x4a00('0x3')](_0x4a00('0x5'),controller[_0x4a00('0x6')]);module['exports']=router; \ No newline at end of file +var _0x5184=['reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0x1661e6,_0x271d77){var _0x14428e=function(_0x2733ba){while(--_0x2733ba){_0x1661e6['push'](_0x1661e6['shift']());}};_0x14428e(++_0x271d77);}(_0x5184,0x7a));var _0x4518=function(_0x246ad1,_0xf22da6){_0x246ad1=_0x246ad1-0x0;var _0x5d8277=_0x5184[_0x246ad1];return _0x5d8277;};'use strict';var express=require(_0x4518('0x0'));var router=express[_0x4518('0x1')]();var controller=require(_0x4518('0x2'));router[_0x4518('0x3')]('/',controller[_0x4518('0x4')]);router['post'](_0x4518('0x5'),controller[_0x4518('0x6')]);router[_0x4518('0x3')](_0x4518('0x7'),controller[_0x4518('0x8')]);module[_0x4518('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 69c33c6..635eee3 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 _0x2b61=['STRING','BOOLEAN','INTEGER'];(function(_0x1326f6,_0x5ae320){var _0xa495b7=function(_0x36d908){while(--_0x36d908){_0x1326f6['push'](_0x1326f6['shift']());}};_0xa495b7(++_0x5ae320);}(_0x2b61,0xb4));var _0x12b6=function(_0x118da4,_0x2e192e){_0x118da4=_0x118da4-0x0;var _0x40dfbb=_0x2b61[_0x118da4];return _0x40dfbb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x12b6('0x0')]},'description':{'type':Sequelize[_0x12b6('0x0')]},'status':{'type':Sequelize[_0x12b6('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x12b6('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x75c2=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x545b64,_0x31d015){var _0x4a282e=function(_0x38ec28){while(--_0x38ec28){_0x545b64['push'](_0x545b64['shift']());}};_0x4a282e(++_0x31d015);}(_0x75c2,0x10a));var _0x275c=function(_0x319928,_0x234286){_0x319928=_0x319928-0x0;var _0x232fac=_0x75c2[_0x319928];return _0x232fac;};'use strict';var Sequelize=require('sequelize');module[_0x275c('0x0')]={'name':{'type':Sequelize[_0x275c('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x275c('0x1')]},'description':{'type':Sequelize[_0x275c('0x1')]},'status':{'type':Sequelize[_0x275c('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x275c('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8cb9c17..0e69629 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 _0x9b25=['mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','model','keys','intersection','attributes','fields','query','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','length','find','catch','create','body','addConditions','ids','getConditions','findOne','addActions','Action','omit','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0x9b25,0x19a));var _0x59b2=function(_0x27e54a,_0xc66b8d){_0x27e54a=_0x27e54a-0x0;var _0x40f5fe=_0x9b25[_0x27e54a];return _0x40f5fe;};'use strict';var emlformat=require(_0x59b2('0x0'));var rimraf=require(_0x59b2('0x1'));var zipdir=require(_0x59b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x59b2('0x3'));var BPromise=require(_0x59b2('0x4'));var Mustache=require(_0x59b2('0x5'));var util=require(_0x59b2('0x6'));var path=require(_0x59b2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x59b2('0x8'));var fs=require('fs');var fs_extra=require(_0x59b2('0x9'));var _=require(_0x59b2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x59b2('0xb'));var deskjs=require(_0x59b2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x59b2('0xd'));var Papa=require(_0x59b2('0xe'));var Redis=require(_0x59b2('0xf'));var authService=require(_0x59b2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x59b2('0x11'));var hardwareService=require(_0x59b2('0x12'));var logger=require(_0x59b2('0x13'))(_0x59b2('0x14'));var utils=require(_0x59b2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x59b2('0x16'));var db=require(_0x59b2('0x17'))['db'];function respondWithStatusCode(_0x4c9910,_0xae5f1e){_0xae5f1e=_0xae5f1e||0xcc;return function(_0x2d6870){if(_0x2d6870){return _0x4c9910[_0x59b2('0x18')](_0xae5f1e);}return _0x4c9910[_0x59b2('0x19')](_0xae5f1e)[_0x59b2('0x1a')]();};}function respondWithResult(_0x23da91,_0x598633){_0x598633=_0x598633||0xc8;return function(_0x18e825){if(_0x18e825){return _0x23da91['status'](_0x598633)[_0x59b2('0x1b')](_0x18e825);}};}function respondWithFilteredResult(_0x5c9422,_0x26fcaf){return function(_0x28b4fd){if(_0x28b4fd){var _0x5afdd0=typeof _0x26fcaf[_0x59b2('0x1c')]===_0x59b2('0x1d')&&typeof _0x26fcaf[_0x59b2('0x1e')]==='undefined';var _0x3ce536=_0x28b4fd[_0x59b2('0x1f')];var _0x4a80b7=_0x5afdd0?0x0:_0x26fcaf['offset'];var _0x35a4fe=_0x5afdd0?_0x28b4fd[_0x59b2('0x1f')]:_0x26fcaf[_0x59b2('0x1c')]+_0x26fcaf[_0x59b2('0x1e')];var _0x54580c;if(_0x35a4fe>=_0x3ce536){_0x35a4fe=_0x3ce536;_0x54580c=0xc8;}else{_0x54580c=0xce;}_0x5c9422[_0x59b2('0x19')](_0x54580c);return _0x5c9422[_0x59b2('0x20')](_0x59b2('0x21'),_0x4a80b7+'-'+_0x35a4fe+'/'+_0x3ce536)[_0x59b2('0x1b')](_0x28b4fd);}return null;};}function patchUpdates(_0x15e302){return function(_0x1d13b1){try{jsonpatch['apply'](_0x1d13b1,_0x15e302,!![]);}catch(_0x4b1bc8){return BPromise[_0x59b2('0x22')](_0x4b1bc8);}return _0x1d13b1[_0x59b2('0x23')]();};}function saveUpdates(_0x481ad8,_0x5a9b64){return function(_0x50c24d){if(_0x50c24d){return _0x50c24d[_0x59b2('0x24')](_0x481ad8)[_0x59b2('0x25')](function(_0x42b529){return _0x42b529;});}return null;};}function removeEntity(_0x1740fc,_0x45b2b8){return function(_0x31e244){if(_0x31e244){return _0x31e244[_0x59b2('0x26')]()[_0x59b2('0x25')](function(){_0x1740fc[_0x59b2('0x19')](0xcc)[_0x59b2('0x1a')]();});}};}function handleEntityNotFound(_0x64f53f,_0x235282){return function(_0x5404e4){if(!_0x5404e4){_0x64f53f[_0x59b2('0x18')](0x194);}return _0x5404e4;};}function handleError(_0x291c9a,_0x2b77cc){_0x2b77cc=_0x2b77cc||0x1f4;return function(_0x27b285){logger[_0x59b2('0x27')](_0x27b285[_0x59b2('0x28')]);if(_0x27b285[_0x59b2('0x29')]){delete _0x27b285['name'];}_0x291c9a['status'](_0x2b77cc)[_0x59b2('0x2a')](_0x27b285);};}exports[_0x59b2('0x2b')]=function(_0x2020ce,_0x4fcdc5){var _0x2bd70e={},_0x1e43ee={},_0xad2edf={'count':0x0,'rows':[]};var _0x1fa034=_[_0x59b2('0x2c')](db[_0x59b2('0x2d')][_0x59b2('0x2e')],function(_0xe6c7ac){return{'name':_0xe6c7ac[_0x59b2('0x2f')],'type':_0xe6c7ac[_0x59b2('0x30')]['key']};});_0x1e43ee[_0x59b2('0x31')]=_[_0x59b2('0x2c')](_0x1fa034,_0x59b2('0x29'));_0x1e43ee['query']=_[_0x59b2('0x32')](_0x2020ce['query']);_0x1e43ee['filters']=_[_0x59b2('0x33')](_0x1e43ee[_0x59b2('0x31')],_0x1e43ee['query']);_0x2bd70e[_0x59b2('0x34')]=_[_0x59b2('0x33')](_0x1e43ee[_0x59b2('0x31')],qs[_0x59b2('0x35')](_0x2020ce[_0x59b2('0x36')][_0x59b2('0x35')]));_0x2bd70e[_0x59b2('0x34')]=_0x2bd70e[_0x59b2('0x34')]['length']?_0x2bd70e[_0x59b2('0x34')]:_0x1e43ee[_0x59b2('0x31')];if(!_0x2020ce[_0x59b2('0x36')]['hasOwnProperty'](_0x59b2('0x37'))){_0x2bd70e[_0x59b2('0x1e')]=qs['limit'](_0x2020ce[_0x59b2('0x36')]['limit']);_0x2bd70e[_0x59b2('0x1c')]=qs['offset'](_0x2020ce['query']['offset']);}_0x2bd70e[_0x59b2('0x38')]=qs[_0x59b2('0x39')](_0x2020ce[_0x59b2('0x36')][_0x59b2('0x39')]);_0x2bd70e['where']=qs[_0x59b2('0x3a')](_[_0x59b2('0x3b')](_0x2020ce[_0x59b2('0x36')],_0x1e43ee[_0x59b2('0x3a')]),_0x1fa034);if(_0x2020ce[_0x59b2('0x36')]['filter']){_0x2bd70e[_0x59b2('0x3c')]=_[_0x59b2('0x3d')](_0x2bd70e[_0x59b2('0x3c')],{'$or':_[_0x59b2('0x2c')](_0x1fa034,function(_0x1c49b1){if(_0x1c49b1[_0x59b2('0x30')]!==_0x59b2('0x3e')){var _0x4e7fd5={};_0x4e7fd5[_0x1c49b1['name']]={'$like':'%'+_0x2020ce['query'][_0x59b2('0x3f')]+'%'};return _0x4e7fd5;}})});}_0x2bd70e=_[_0x59b2('0x3d')]({},_0x2bd70e,_0x2020ce[_0x59b2('0x40')]);var _0xe7f59={'where':_0x2bd70e['where']};return db[_0x59b2('0x2d')]['count'](_0xe7f59)[_0x59b2('0x25')](function(_0xc97313){_0xad2edf['count']=_0xc97313;if(_0x2020ce['query'][_0x59b2('0x41')]){_0x2bd70e[_0x59b2('0x42')]=[{'all':!![]}];}return db[_0x59b2('0x2d')]['findAll'](_0x2bd70e);})[_0x59b2('0x25')](function(_0x4cfdbe){_0xad2edf[_0x59b2('0x43')]=_0x4cfdbe;return _0xad2edf;})[_0x59b2('0x25')](respondWithFilteredResult(_0x4fcdc5,_0x2bd70e))['catch'](handleError(_0x4fcdc5,null));};exports['show']=function(_0x5acc37,_0x3d1d66){var _0x52ca09={'raw':![],'where':{'id':_0x5acc37[_0x59b2('0x44')]['id']}},_0x128a88={};_0x128a88[_0x59b2('0x31')]=_[_0x59b2('0x32')](db[_0x59b2('0x2d')][_0x59b2('0x2e')]);_0x128a88['query']=_['keys'](_0x5acc37['query']);_0x128a88[_0x59b2('0x3a')]=_[_0x59b2('0x33')](_0x128a88[_0x59b2('0x31')],_0x128a88[_0x59b2('0x36')]);_0x52ca09[_0x59b2('0x34')]=_[_0x59b2('0x33')](_0x128a88[_0x59b2('0x31')],qs[_0x59b2('0x35')](_0x5acc37[_0x59b2('0x36')][_0x59b2('0x35')]));_0x52ca09[_0x59b2('0x34')]=_0x52ca09['attributes'][_0x59b2('0x45')]?_0x52ca09['attributes']:_0x128a88[_0x59b2('0x31')];if(_0x5acc37[_0x59b2('0x36')][_0x59b2('0x41')]){_0x52ca09[_0x59b2('0x42')]=[{'all':!![]}];}_0x52ca09=_[_0x59b2('0x3d')]({},_0x52ca09,_0x5acc37[_0x59b2('0x40')]);return db[_0x59b2('0x2d')][_0x59b2('0x46')](_0x52ca09)[_0x59b2('0x25')](handleEntityNotFound(_0x3d1d66,null))[_0x59b2('0x25')](respondWithResult(_0x3d1d66,null))[_0x59b2('0x47')](handleError(_0x3d1d66,null));};exports['create']=function(_0x618086,_0x4a1d7f){return db[_0x59b2('0x2d')][_0x59b2('0x48')](_0x618086[_0x59b2('0x49')],{})[_0x59b2('0x25')](respondWithResult(_0x4a1d7f,0xc9))[_0x59b2('0x47')](handleError(_0x4a1d7f,null));};exports['update']=function(_0x2ca091,_0x3a2f55){if(_0x2ca091[_0x59b2('0x49')]['id']){delete _0x2ca091[_0x59b2('0x49')]['id'];}return db[_0x59b2('0x2d')][_0x59b2('0x46')]({'where':{'id':_0x2ca091['params']['id']}})[_0x59b2('0x25')](handleEntityNotFound(_0x3a2f55,null))[_0x59b2('0x25')](saveUpdates(_0x2ca091[_0x59b2('0x49')],null))['then'](respondWithResult(_0x3a2f55,null))[_0x59b2('0x47')](handleError(_0x3a2f55,null));};exports[_0x59b2('0x26')]=function(_0x4ba870,_0x3e47bd){return db[_0x59b2('0x2d')][_0x59b2('0x46')]({'where':{'id':_0x4ba870[_0x59b2('0x44')]['id']}})[_0x59b2('0x25')](handleEntityNotFound(_0x3e47bd,null))['then'](removeEntity(_0x3e47bd,null))[_0x59b2('0x47')](handleError(_0x3e47bd,null));};exports[_0x59b2('0x4a')]=function(_0x210a99,_0x32829c,_0x531e2f){return db['Condition']['find']({'where':{'id':_0x210a99['params']['id']}})['then'](handleEntityNotFound(_0x32829c,null))[_0x59b2('0x25')](function(_0x5066b4){if(_0x5066b4){return _0x5066b4[_0x59b2('0x4a')](_0x210a99[_0x59b2('0x49')]['ids'],_['omit'](_0x210a99['body'],[_0x59b2('0x4b'),'id'])||{});}})[_0x59b2('0x25')](respondWithResult(_0x32829c,null))[_0x59b2('0x47')](handleError(_0x32829c,null));};exports[_0x59b2('0x4c')]=function(_0x37534f,_0x151833,_0xfc1513){var _0x25f443={};var _0x248471={};var _0x42c52b;var _0x5037c4;return db[_0x59b2('0x2d')][_0x59b2('0x4d')]({'where':{'id':_0x37534f[_0x59b2('0x44')]['id']}})[_0x59b2('0x25')](handleEntityNotFound(_0x151833,null))[_0x59b2('0x25')](function(_0x4a5b69){if(_0x4a5b69){_0x42c52b=_0x4a5b69;_0x248471[_0x59b2('0x31')]=_['keys'](db['Condition'][_0x59b2('0x2e')]);_0x248471[_0x59b2('0x36')]=_[_0x59b2('0x32')](_0x37534f['query']);_0x248471[_0x59b2('0x3a')]=_['intersection'](_0x248471[_0x59b2('0x31')],_0x248471[_0x59b2('0x36')]);_0x25f443['attributes']=_[_0x59b2('0x33')](_0x248471[_0x59b2('0x31')],qs[_0x59b2('0x35')](_0x37534f['query'][_0x59b2('0x35')]));_0x25f443[_0x59b2('0x34')]=_0x25f443[_0x59b2('0x34')][_0x59b2('0x45')]?_0x25f443[_0x59b2('0x34')]:_0x248471[_0x59b2('0x31')];_0x25f443[_0x59b2('0x38')]=qs['sort'](_0x37534f[_0x59b2('0x36')]['sort']);_0x25f443[_0x59b2('0x3c')]=qs[_0x59b2('0x3a')](_[_0x59b2('0x3b')](_0x37534f['query'],_0x248471['filters']));if(_0x37534f[_0x59b2('0x36')][_0x59b2('0x3f')]){_0x25f443[_0x59b2('0x3c')]=_[_0x59b2('0x3d')](_0x25f443[_0x59b2('0x3c')],{'$or':_[_0x59b2('0x2c')](_0x25f443[_0x59b2('0x34')],function(_0x9d3a6b){var _0x59c7ea={};_0x59c7ea[_0x9d3a6b]={'$like':'%'+_0x37534f[_0x59b2('0x36')][_0x59b2('0x3f')]+'%'};return _0x59c7ea;})});}_0x25f443=_[_0x59b2('0x3d')]({},_0x25f443,_0x37534f[_0x59b2('0x40')]);return _0x42c52b['getConditions'](_0x25f443);}})[_0x59b2('0x25')](function(_0x11ba40){if(_0x11ba40){_0x5037c4=_0x11ba40[_0x59b2('0x45')];if(!_0x37534f[_0x59b2('0x36')]['hasOwnProperty'](_0x59b2('0x37'))){_0x25f443[_0x59b2('0x1e')]=qs[_0x59b2('0x1e')](_0x37534f['query'][_0x59b2('0x1e')]);_0x25f443[_0x59b2('0x1c')]=qs[_0x59b2('0x1c')](_0x37534f[_0x59b2('0x36')][_0x59b2('0x1c')]);}return _0x42c52b[_0x59b2('0x4c')](_0x25f443);}})[_0x59b2('0x25')](function(_0x357aca){if(_0x357aca){return _0x357aca?{'count':_0x5037c4,'rows':_0x357aca}:null;}})[_0x59b2('0x25')](respondWithResult(_0x151833,null))['catch'](handleError(_0x151833,null));};exports[_0x59b2('0x4e')]=function(_0x220f99,_0x12a79b,_0x2d68a6){return db[_0x59b2('0x4f')]['find']({'where':{'id':_0x220f99[_0x59b2('0x44')]['id']}})[_0x59b2('0x25')](handleEntityNotFound(_0x12a79b,null))[_0x59b2('0x25')](function(_0x5c9cf3){if(_0x5c9cf3){return _0x5c9cf3['addActions'](_0x220f99[_0x59b2('0x49')]['ids'],_[_0x59b2('0x50')](_0x220f99[_0x59b2('0x49')],[_0x59b2('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x12a79b,null))[_0x59b2('0x47')](handleError(_0x12a79b,null));};exports['getActions']=function(_0x570e53,_0x311e87,_0x1fbbaa){var _0x14f0e4={};var _0x2406c9={};var _0x373443;var _0x1b8e90;return db[_0x59b2('0x2d')][_0x59b2('0x4d')]({'where':{'id':_0x570e53['params']['id']}})[_0x59b2('0x25')](handleEntityNotFound(_0x311e87,null))['then'](function(_0x4dc1ce){if(_0x4dc1ce){_0x373443=_0x4dc1ce;_0x2406c9[_0x59b2('0x31')]=_[_0x59b2('0x32')](db['Action'][_0x59b2('0x2e')]);_0x2406c9[_0x59b2('0x36')]=_[_0x59b2('0x32')](_0x570e53[_0x59b2('0x36')]);_0x2406c9['filters']=_[_0x59b2('0x33')](_0x2406c9['model'],_0x2406c9[_0x59b2('0x36')]);_0x14f0e4['attributes']=_['intersection'](_0x2406c9['model'],qs['fields'](_0x570e53[_0x59b2('0x36')][_0x59b2('0x35')]));_0x14f0e4[_0x59b2('0x34')]=_0x14f0e4[_0x59b2('0x34')][_0x59b2('0x45')]?_0x14f0e4['attributes']:_0x2406c9[_0x59b2('0x31')];_0x14f0e4[_0x59b2('0x38')]=qs['sort'](_0x570e53[_0x59b2('0x36')][_0x59b2('0x39')]);_0x14f0e4[_0x59b2('0x3c')]=qs['filters'](_[_0x59b2('0x3b')](_0x570e53[_0x59b2('0x36')],_0x2406c9[_0x59b2('0x3a')]));if(_0x570e53['query'][_0x59b2('0x3f')]){_0x14f0e4[_0x59b2('0x3c')]=_['merge'](_0x14f0e4[_0x59b2('0x3c')],{'$or':_['map'](_0x14f0e4[_0x59b2('0x34')],function(_0x920f02){var _0xaaeb74={};_0xaaeb74[_0x920f02]={'$like':'%'+_0x570e53['query'][_0x59b2('0x3f')]+'%'};return _0xaaeb74;})});}_0x14f0e4=_['merge']({},_0x14f0e4,_0x570e53['options']);return _0x373443[_0x59b2('0x51')](_0x14f0e4);}})['then'](function(_0x2f1998){if(_0x2f1998){_0x1b8e90=_0x2f1998['length'];if(!_0x570e53[_0x59b2('0x36')][_0x59b2('0x52')](_0x59b2('0x37'))){_0x14f0e4[_0x59b2('0x1e')]=qs[_0x59b2('0x1e')](_0x570e53[_0x59b2('0x36')][_0x59b2('0x1e')]);_0x14f0e4[_0x59b2('0x1c')]=qs['offset'](_0x570e53[_0x59b2('0x36')][_0x59b2('0x1c')]);}return _0x373443['getActions'](_0x14f0e4);}})[_0x59b2('0x25')](function(_0x2d469b){if(_0x2d469b){return _0x2d469b?{'count':_0x1b8e90,'rows':_0x2d469b}:null;}})[_0x59b2('0x25')](respondWithResult(_0x311e87,null))[_0x59b2('0x47')](handleError(_0x311e87,null));}; \ No newline at end of file +var _0x70df=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','destroy','Condition','addConditions','ids','getConditions','findOne','order','addActions','Action','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','stack','name','send','index','map','Automation','type','key','model','query','filters','intersection'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x70df,0x122));var _0xf70d=function(_0x2d54c2,_0x333c45){_0x2d54c2=_0x2d54c2-0x0;var _0x2f9d51=_0x70df[_0x2d54c2];return _0x2f9d51;};'use strict';var emlformat=require(_0xf70d('0x0'));var rimraf=require(_0xf70d('0x1'));var zipdir=require(_0xf70d('0x2'));var jsonpatch=require(_0xf70d('0x3'));var rp=require(_0xf70d('0x4'));var moment=require(_0xf70d('0x5'));var BPromise=require(_0xf70d('0x6'));var Mustache=require(_0xf70d('0x7'));var util=require('util');var path=require(_0xf70d('0x8'));var sox=require(_0xf70d('0x9'));var csv=require(_0xf70d('0xa'));var ejs=require(_0xf70d('0xb'));var fs=require('fs');var fs_extra=require(_0xf70d('0xc'));var _=require(_0xf70d('0xd'));var squel=require('squel');var crypto=require(_0xf70d('0xe'));var jsforce=require(_0xf70d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf70d('0x10'));var Papa=require(_0xf70d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf70d('0x12'));var as=require(_0xf70d('0x13'));var hardwareService=require(_0xf70d('0x14'));var logger=require(_0xf70d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf70d('0x16'));var licenseUtil=require(_0xf70d('0x17'));var db=require(_0xf70d('0x18'))['db'];function respondWithStatusCode(_0xf60a54,_0x41be1c){_0x41be1c=_0x41be1c||0xcc;return function(_0x331f1a){if(_0x331f1a){return _0xf60a54['sendStatus'](_0x41be1c);}return _0xf60a54[_0xf70d('0x19')](_0x41be1c)[_0xf70d('0x1a')]();};}function respondWithResult(_0x32b3ae,_0x1c6ffa){_0x1c6ffa=_0x1c6ffa||0xc8;return function(_0x425234){if(_0x425234){return _0x32b3ae['status'](_0x1c6ffa)[_0xf70d('0x1b')](_0x425234);}};}function respondWithFilteredResult(_0x5f3188,_0x1fe56e){return function(_0x2501d9){if(_0x2501d9){var _0x4ef432=typeof _0x1fe56e[_0xf70d('0x1c')]===_0xf70d('0x1d')&&typeof _0x1fe56e[_0xf70d('0x1e')]===_0xf70d('0x1d');var _0x7625ad=_0x2501d9[_0xf70d('0x1f')];var _0x1c7aad=_0x4ef432?0x0:_0x1fe56e['offset'];var _0x409d89=_0x4ef432?_0x2501d9[_0xf70d('0x1f')]:_0x1fe56e[_0xf70d('0x1c')]+_0x1fe56e[_0xf70d('0x1e')];var _0xceeea4;if(_0x409d89>=_0x7625ad){_0x409d89=_0x7625ad;_0xceeea4=0xc8;}else{_0xceeea4=0xce;}_0x5f3188['status'](_0xceeea4);return _0x5f3188[_0xf70d('0x20')](_0xf70d('0x21'),_0x1c7aad+'-'+_0x409d89+'/'+_0x7625ad)[_0xf70d('0x1b')](_0x2501d9);}return null;};}function patchUpdates(_0x369de5){return function(_0x406035){try{jsonpatch['apply'](_0x406035,_0x369de5,!![]);}catch(_0x2214f3){return BPromise['reject'](_0x2214f3);}return _0x406035[_0xf70d('0x22')]();};}function saveUpdates(_0x3f5d81,_0x36da87){return function(_0x3d4d14){if(_0x3d4d14){return _0x3d4d14[_0xf70d('0x23')](_0x3f5d81)[_0xf70d('0x24')](function(_0x399c5e){return _0x399c5e;});}return null;};}function removeEntity(_0x457935,_0x398ea1){return function(_0x164af3){if(_0x164af3){return _0x164af3['destroy']()[_0xf70d('0x24')](function(){_0x457935[_0xf70d('0x19')](0xcc)[_0xf70d('0x1a')]();});}};}function handleEntityNotFound(_0x1afffa,_0x2e403c){return function(_0x57a861){if(!_0x57a861){_0x1afffa[_0xf70d('0x25')](0x194);}return _0x57a861;};}function handleError(_0x2087e6,_0x50e4d2){_0x50e4d2=_0x50e4d2||0x1f4;return function(_0x3157f){logger['error'](_0x3157f[_0xf70d('0x26')]);if(_0x3157f[_0xf70d('0x27')]){delete _0x3157f['name'];}_0x2087e6['status'](_0x50e4d2)[_0xf70d('0x28')](_0x3157f);};}exports[_0xf70d('0x29')]=function(_0x3bfc51,_0x24ce64){var _0x16ace8={},_0x21f491={},_0xabbb98={'count':0x0,'rows':[]};var _0x2e9a79=_[_0xf70d('0x2a')](db[_0xf70d('0x2b')]['rawAttributes'],function(_0x26c304){return{'name':_0x26c304['fieldName'],'type':_0x26c304[_0xf70d('0x2c')][_0xf70d('0x2d')]};});_0x21f491[_0xf70d('0x2e')]=_[_0xf70d('0x2a')](_0x2e9a79,_0xf70d('0x27'));_0x21f491[_0xf70d('0x2f')]=_['keys'](_0x3bfc51[_0xf70d('0x2f')]);_0x21f491[_0xf70d('0x30')]=_[_0xf70d('0x31')](_0x21f491[_0xf70d('0x2e')],_0x21f491['query']);_0x16ace8['attributes']=_[_0xf70d('0x31')](_0x21f491[_0xf70d('0x2e')],qs[_0xf70d('0x32')](_0x3bfc51[_0xf70d('0x2f')][_0xf70d('0x32')]));_0x16ace8['attributes']=_0x16ace8[_0xf70d('0x33')][_0xf70d('0x34')]?_0x16ace8[_0xf70d('0x33')]:_0x21f491[_0xf70d('0x2e')];if(!_0x3bfc51['query'][_0xf70d('0x35')](_0xf70d('0x36'))){_0x16ace8['limit']=qs[_0xf70d('0x1e')](_0x3bfc51['query'][_0xf70d('0x1e')]);_0x16ace8[_0xf70d('0x1c')]=qs[_0xf70d('0x1c')](_0x3bfc51['query']['offset']);}_0x16ace8['order']=qs[_0xf70d('0x37')](_0x3bfc51[_0xf70d('0x2f')][_0xf70d('0x37')]);_0x16ace8['where']=qs[_0xf70d('0x30')](_[_0xf70d('0x38')](_0x3bfc51['query'],_0x21f491[_0xf70d('0x30')]),_0x2e9a79);if(_0x3bfc51[_0xf70d('0x2f')]['filter']){_0x16ace8['where']=_[_0xf70d('0x39')](_0x16ace8[_0xf70d('0x3a')],{'$or':_[_0xf70d('0x2a')](_0x2e9a79,function(_0x2eb004){if(_0x2eb004['type']!==_0xf70d('0x3b')){var _0x4d5388={};_0x4d5388[_0x2eb004['name']]={'$like':'%'+_0x3bfc51[_0xf70d('0x2f')][_0xf70d('0x3c')]+'%'};return _0x4d5388;}})});}_0x16ace8=_[_0xf70d('0x39')]({},_0x16ace8,_0x3bfc51[_0xf70d('0x3d')]);var _0x3451e6={'where':_0x16ace8[_0xf70d('0x3a')]};return db[_0xf70d('0x2b')][_0xf70d('0x1f')](_0x3451e6)[_0xf70d('0x24')](function(_0x5cd4b1){_0xabbb98[_0xf70d('0x1f')]=_0x5cd4b1;if(_0x3bfc51[_0xf70d('0x2f')][_0xf70d('0x3e')]){_0x16ace8[_0xf70d('0x3f')]=[{'all':!![]}];}return db[_0xf70d('0x2b')][_0xf70d('0x40')](_0x16ace8);})[_0xf70d('0x24')](function(_0x5583c9){_0xabbb98[_0xf70d('0x41')]=_0x5583c9;return _0xabbb98;})[_0xf70d('0x24')](respondWithFilteredResult(_0x24ce64,_0x16ace8))[_0xf70d('0x42')](handleError(_0x24ce64,null));};exports[_0xf70d('0x43')]=function(_0x5981af,_0xf299c6){var _0x3ce4b5={'raw':![],'where':{'id':_0x5981af['params']['id']}},_0x9f76bb={};_0x9f76bb[_0xf70d('0x2e')]=_[_0xf70d('0x44')](db[_0xf70d('0x2b')][_0xf70d('0x45')]);_0x9f76bb[_0xf70d('0x2f')]=_[_0xf70d('0x44')](_0x5981af[_0xf70d('0x2f')]);_0x9f76bb[_0xf70d('0x30')]=_[_0xf70d('0x31')](_0x9f76bb[_0xf70d('0x2e')],_0x9f76bb[_0xf70d('0x2f')]);_0x3ce4b5[_0xf70d('0x33')]=_[_0xf70d('0x31')](_0x9f76bb['model'],qs[_0xf70d('0x32')](_0x5981af['query'][_0xf70d('0x32')]));_0x3ce4b5['attributes']=_0x3ce4b5['attributes'][_0xf70d('0x34')]?_0x3ce4b5[_0xf70d('0x33')]:_0x9f76bb[_0xf70d('0x2e')];if(_0x5981af[_0xf70d('0x2f')][_0xf70d('0x3e')]){_0x3ce4b5['include']=[{'all':!![]}];}_0x3ce4b5=_[_0xf70d('0x39')]({},_0x3ce4b5,_0x5981af[_0xf70d('0x3d')]);return db[_0xf70d('0x2b')][_0xf70d('0x46')](_0x3ce4b5)[_0xf70d('0x24')](handleEntityNotFound(_0xf299c6,null))[_0xf70d('0x24')](respondWithResult(_0xf299c6,null))[_0xf70d('0x42')](handleError(_0xf299c6,null));};exports[_0xf70d('0x47')]=function(_0xa239b8,_0x88c81){return db[_0xf70d('0x2b')][_0xf70d('0x47')](_0xa239b8['body'],{})[_0xf70d('0x24')](respondWithResult(_0x88c81,0xc9))['catch'](handleError(_0x88c81,null));};exports[_0xf70d('0x23')]=function(_0x26c1ff,_0x10832a){if(_0x26c1ff['body']['id']){delete _0x26c1ff[_0xf70d('0x48')]['id'];}return db[_0xf70d('0x2b')][_0xf70d('0x46')]({'where':{'id':_0x26c1ff[_0xf70d('0x49')]['id']}})['then'](handleEntityNotFound(_0x10832a,null))[_0xf70d('0x24')](saveUpdates(_0x26c1ff['body'],null))['then'](respondWithResult(_0x10832a,null))[_0xf70d('0x42')](handleError(_0x10832a,null));};exports[_0xf70d('0x4a')]=function(_0x30e1b0,_0x458ed2){return db[_0xf70d('0x2b')]['find']({'where':{'id':_0x30e1b0[_0xf70d('0x49')]['id']}})[_0xf70d('0x24')](handleEntityNotFound(_0x458ed2,null))[_0xf70d('0x24')](removeEntity(_0x458ed2,null))[_0xf70d('0x42')](handleError(_0x458ed2,null));};exports['addConditions']=function(_0x245bb0,_0x11f2a7,_0x2703d3){return db[_0xf70d('0x4b')][_0xf70d('0x46')]({'where':{'id':_0x245bb0[_0xf70d('0x49')]['id']}})['then'](handleEntityNotFound(_0x11f2a7,null))[_0xf70d('0x24')](function(_0x27f99a){if(_0x27f99a){return _0x27f99a[_0xf70d('0x4c')](_0x245bb0['body'][_0xf70d('0x4d')],_['omit'](_0x245bb0[_0xf70d('0x48')],[_0xf70d('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x11f2a7,null))[_0xf70d('0x42')](handleError(_0x11f2a7,null));};exports[_0xf70d('0x4e')]=function(_0x1fc2ad,_0x329929,_0x5b4ff6){var _0x31b344={};var _0x3a5daf={};var _0x13042f;var _0x4e29e4;return db[_0xf70d('0x2b')][_0xf70d('0x4f')]({'where':{'id':_0x1fc2ad['params']['id']}})[_0xf70d('0x24')](handleEntityNotFound(_0x329929,null))['then'](function(_0x2cfb51){if(_0x2cfb51){_0x13042f=_0x2cfb51;_0x3a5daf[_0xf70d('0x2e')]=_[_0xf70d('0x44')](db['Condition'][_0xf70d('0x45')]);_0x3a5daf[_0xf70d('0x2f')]=_[_0xf70d('0x44')](_0x1fc2ad[_0xf70d('0x2f')]);_0x3a5daf[_0xf70d('0x30')]=_[_0xf70d('0x31')](_0x3a5daf[_0xf70d('0x2e')],_0x3a5daf[_0xf70d('0x2f')]);_0x31b344[_0xf70d('0x33')]=_[_0xf70d('0x31')](_0x3a5daf[_0xf70d('0x2e')],qs[_0xf70d('0x32')](_0x1fc2ad[_0xf70d('0x2f')][_0xf70d('0x32')]));_0x31b344['attributes']=_0x31b344[_0xf70d('0x33')]['length']?_0x31b344[_0xf70d('0x33')]:_0x3a5daf[_0xf70d('0x2e')];_0x31b344[_0xf70d('0x50')]=qs[_0xf70d('0x37')](_0x1fc2ad[_0xf70d('0x2f')]['sort']);_0x31b344['where']=qs['filters'](_[_0xf70d('0x38')](_0x1fc2ad[_0xf70d('0x2f')],_0x3a5daf['filters']));if(_0x1fc2ad[_0xf70d('0x2f')][_0xf70d('0x3c')]){_0x31b344[_0xf70d('0x3a')]=_['merge'](_0x31b344[_0xf70d('0x3a')],{'$or':_[_0xf70d('0x2a')](_0x31b344[_0xf70d('0x33')],function(_0x1a177b){var _0x327bd9={};_0x327bd9[_0x1a177b]={'$like':'%'+_0x1fc2ad[_0xf70d('0x2f')][_0xf70d('0x3c')]+'%'};return _0x327bd9;})});}_0x31b344=_[_0xf70d('0x39')]({},_0x31b344,_0x1fc2ad[_0xf70d('0x3d')]);return _0x13042f[_0xf70d('0x4e')](_0x31b344);}})[_0xf70d('0x24')](function(_0x11643f){if(_0x11643f){_0x4e29e4=_0x11643f[_0xf70d('0x34')];if(!_0x1fc2ad['query']['hasOwnProperty'](_0xf70d('0x36'))){_0x31b344['limit']=qs[_0xf70d('0x1e')](_0x1fc2ad[_0xf70d('0x2f')]['limit']);_0x31b344['offset']=qs[_0xf70d('0x1c')](_0x1fc2ad[_0xf70d('0x2f')]['offset']);}return _0x13042f[_0xf70d('0x4e')](_0x31b344);}})[_0xf70d('0x24')](function(_0x5b8fe6){if(_0x5b8fe6){return _0x5b8fe6?{'count':_0x4e29e4,'rows':_0x5b8fe6}:null;}})[_0xf70d('0x24')](respondWithResult(_0x329929,null))[_0xf70d('0x42')](handleError(_0x329929,null));};exports[_0xf70d('0x51')]=function(_0x32ac09,_0x3e956e,_0x459d98){return db[_0xf70d('0x52')][_0xf70d('0x46')]({'where':{'id':_0x32ac09[_0xf70d('0x49')]['id']}})[_0xf70d('0x24')](handleEntityNotFound(_0x3e956e,null))[_0xf70d('0x24')](function(_0x5de0e3){if(_0x5de0e3){return _0x5de0e3[_0xf70d('0x51')](_0x32ac09[_0xf70d('0x48')][_0xf70d('0x4d')],_[_0xf70d('0x53')](_0x32ac09[_0xf70d('0x48')],[_0xf70d('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x3e956e,null))['catch'](handleError(_0x3e956e,null));};exports[_0xf70d('0x54')]=function(_0x35da93,_0x4e6dea,_0x2af4f8){var _0x256d55={};var _0x27abe4={};var _0x39f5f7;var _0x28bab5;return db[_0xf70d('0x2b')]['findOne']({'where':{'id':_0x35da93[_0xf70d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e6dea,null))[_0xf70d('0x24')](function(_0x201d7d){if(_0x201d7d){_0x39f5f7=_0x201d7d;_0x27abe4[_0xf70d('0x2e')]=_[_0xf70d('0x44')](db[_0xf70d('0x52')]['rawAttributes']);_0x27abe4['query']=_[_0xf70d('0x44')](_0x35da93[_0xf70d('0x2f')]);_0x27abe4[_0xf70d('0x30')]=_[_0xf70d('0x31')](_0x27abe4[_0xf70d('0x2e')],_0x27abe4[_0xf70d('0x2f')]);_0x256d55[_0xf70d('0x33')]=_[_0xf70d('0x31')](_0x27abe4[_0xf70d('0x2e')],qs[_0xf70d('0x32')](_0x35da93[_0xf70d('0x2f')][_0xf70d('0x32')]));_0x256d55[_0xf70d('0x33')]=_0x256d55[_0xf70d('0x33')]['length']?_0x256d55[_0xf70d('0x33')]:_0x27abe4[_0xf70d('0x2e')];_0x256d55['order']=qs['sort'](_0x35da93[_0xf70d('0x2f')][_0xf70d('0x37')]);_0x256d55[_0xf70d('0x3a')]=qs['filters'](_[_0xf70d('0x38')](_0x35da93['query'],_0x27abe4['filters']));if(_0x35da93[_0xf70d('0x2f')][_0xf70d('0x3c')]){_0x256d55[_0xf70d('0x3a')]=_[_0xf70d('0x39')](_0x256d55['where'],{'$or':_['map'](_0x256d55[_0xf70d('0x33')],function(_0x20536f){var _0x4741d0={};_0x4741d0[_0x20536f]={'$like':'%'+_0x35da93[_0xf70d('0x2f')][_0xf70d('0x3c')]+'%'};return _0x4741d0;})});}_0x256d55=_[_0xf70d('0x39')]({},_0x256d55,_0x35da93['options']);return _0x39f5f7[_0xf70d('0x54')](_0x256d55);}})[_0xf70d('0x24')](function(_0x3a4938){if(_0x3a4938){_0x28bab5=_0x3a4938[_0xf70d('0x34')];if(!_0x35da93['query'][_0xf70d('0x35')](_0xf70d('0x36'))){_0x256d55[_0xf70d('0x1e')]=qs['limit'](_0x35da93[_0xf70d('0x2f')][_0xf70d('0x1e')]);_0x256d55[_0xf70d('0x1c')]=qs[_0xf70d('0x1c')](_0x35da93[_0xf70d('0x2f')][_0xf70d('0x1c')]);}return _0x39f5f7[_0xf70d('0x54')](_0x256d55);}})[_0xf70d('0x24')](function(_0x316e44){if(_0x316e44){return _0x316e44?{'count':_0x28bab5,'rows':_0x316e44}:null;}})[_0xf70d('0x24')](respondWithResult(_0x4e6dea,null))[_0xf70d('0x42')](handleError(_0x4e6dea,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index de99e92..8c7e2b6 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 _0xc92b=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0x125853,_0xb6377){var _0x2e6bf5=function(_0x429788){while(--_0x429788){_0x125853['push'](_0x125853['shift']());}};_0x2e6bf5(++_0xb6377);}(_0xc92b,0x11b));var _0xbc92=function(_0x5d7791,_0x4bb33a){_0x5d7791=_0x5d7791-0x0;var _0x39cdc3=_0xc92b[_0x5d7791];return _0x39cdc3;};'use strict';var _=require(_0xbc92('0x0'));var util=require(_0xbc92('0x1'));var logger=require(_0xbc92('0x2'))(_0xbc92('0x3'));var moment=require(_0xbc92('0x4'));var BPromise=require(_0xbc92('0x5'));var rp=require(_0xbc92('0x6'));var fs=require('fs');var path=require(_0xbc92('0x7'));var rimraf=require('rimraf');var config=require(_0xbc92('0x8'));var attributes=require(_0xbc92('0x9'));module[_0xbc92('0xa')]=function(_0x5810ec,_0x26190b){return _0x5810ec[_0xbc92('0xb')](_0xbc92('0xc'),attributes,{'tableName':_0xbc92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeace=['define','Automation','tools_automations','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x212c17,_0x4c994e){var _0x18f6cd=function(_0x1464b8){while(--_0x1464b8){_0x212c17['push'](_0x212c17['shift']());}};_0x18f6cd(++_0x4c994e);}(_0xeace,0x1bb));var _0xeeac=function(_0x311d81,_0x237598){_0x311d81=_0x311d81-0x0;var _0x4851e9=_0xeace[_0x311d81];return _0x4851e9;};'use strict';var _=require(_0xeeac('0x0'));var util=require('util');var logger=require(_0xeeac('0x1'))(_0xeeac('0x2'));var moment=require(_0xeeac('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeac('0x4'));var rimraf=require(_0xeeac('0x5'));var config=require(_0xeeac('0x6'));var attributes=require(_0xeeac('0x7'));module['exports']=function(_0x19ed36,_0x3b3d6b){return _0x19ed36[_0xeeac('0x8')](_0xeeac('0x9'),attributes,{'tableName':_0xeeac('0xa'),'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 eede6fd..72db06b 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 _0x3de3=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x44799d,_0x26c23a){var _0x4f4a20=function(_0x298a71){while(--_0x298a71){_0x44799d['push'](_0x44799d['shift']());}};_0x4f4a20(++_0x26c23a);}(_0x3de3,0x1ce));var _0x33de=function(_0x49a914,_0x34d540){_0x49a914=_0x49a914-0x0;var _0xc86ee8=_0x3de3[_0x49a914];return _0xc86ee8;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x587be8,_0x13afea,_0x35ee93){return new BPromise(function(_0x7ceca6,_0x486ab6){return client[_0x33de('0xa')](_0x587be8,_0x35ee93)[_0x33de('0xb')](function(_0x2e0419){logger['info'](_0x33de('0xc'),_0x13afea,_0x33de('0xd'));logger[_0x33de('0xe')](_0x33de('0xf'),_0x13afea,_0x33de('0xd'),JSON[_0x33de('0x10')](_0x2e0419));if(_0x2e0419[_0x33de('0x11')]){if(_0x2e0419[_0x33de('0x11')][_0x33de('0x12')]===0x1f4){logger[_0x33de('0x11')](_0x33de('0xc'),_0x13afea,_0x2e0419['error'][_0x33de('0x13')]);return _0x486ab6(_0x2e0419[_0x33de('0x11')]['message']);}logger['error'](_0x33de('0xc'),_0x13afea,_0x2e0419[_0x33de('0x11')][_0x33de('0x13')]);return _0x7ceca6(_0x2e0419[_0x33de('0x11')]['message']);}else{logger[_0x33de('0x14')](_0x33de('0xc'),_0x13afea,'request\x20sent');_0x7ceca6(_0x2e0419['result'][_0x33de('0x13')]);}})[_0x33de('0x15')](function(_0x13e832){logger['error'](_0x33de('0xc'),_0x13afea,_0x13e832);_0x486ab6(_0x13e832);});});} \ No newline at end of file +var _0x5ed9=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','Automation,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5ed9[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require('moment');var BPromise=require(_0x95ed('0x2'));var rs=require(_0x95ed('0x3'));var fs=require('fs');var Redis=require(_0x95ed('0x4'));var db=require(_0x95ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x6'))(_0x95ed('0x7'));var config=require(_0x95ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf25,_0xaa1eb1,_0x3753b5){return new BPromise(function(_0x1df51f,_0x46ed43){return client[_0x95ed('0xa')](_0x32bf25,_0x3753b5)['then'](function(_0x2b59f5){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,'request\x20sent');logger[_0x95ed('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0xaa1eb1,_0x95ed('0xe'),JSON[_0x95ed('0xf')](_0x2b59f5));if(_0x2b59f5[_0x95ed('0x10')]){if(_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x11')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x46ed43(_0x2b59f5['error']['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x1df51f(_0x2b59f5['error'][_0x95ed('0x12')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,_0x95ed('0xe'));_0x1df51f(_0x2b59f5[_0x95ed('0x13')]['message']);}})[_0x95ed('0x14')](function(_0x54ad78){logger['error']('Automation,\x20%s,\x20%s',_0xaa1eb1,_0x54ad78);_0x46ed43(_0x54ad78);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c82c2d8..819df68 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 _0x5096=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions','addActions','put'];(function(_0x5f0f23,_0x13f8d6){var _0x98369f=function(_0x5c2689){while(--_0x5c2689){_0x5f0f23['push'](_0x5f0f23['shift']());}};_0x98369f(++_0x13f8d6);}(_0x5096,0x6c));var _0x6509=function(_0x4e15f4,_0x5a72f2){_0x4e15f4=_0x4e15f4-0x0;var _0x5a9643=_0x5096[_0x4e15f4];return _0x5a9643;};'use strict';var multer=require(_0x6509('0x0'));var util=require(_0x6509('0x1'));var path=require(_0x6509('0x2'));var timeout=require(_0x6509('0x3'));var express=require(_0x6509('0x4'));var router=express['Router']();var fs_extra=require(_0x6509('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6509('0x6'));var config=require(_0x6509('0x7'));var controller=require(_0x6509('0x8'));router[_0x6509('0x9')]('/',auth[_0x6509('0xa')](),controller[_0x6509('0xb')]);router['get'](_0x6509('0xc'),auth[_0x6509('0xa')](),controller['show']);router[_0x6509('0x9')](_0x6509('0xd'),auth[_0x6509('0xa')](),controller[_0x6509('0xe')]);router[_0x6509('0x9')]('/:id/actions',auth[_0x6509('0xa')](),controller[_0x6509('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6509('0x10')]);router[_0x6509('0x11')](_0x6509('0xd'),auth[_0x6509('0xa')](),controller[_0x6509('0x12')]);router[_0x6509('0x11')](_0x6509('0x13'),auth[_0x6509('0xa')](),controller[_0x6509('0x14')]);router[_0x6509('0x15')]('/:id',auth[_0x6509('0xa')](),controller[_0x6509('0x16')]);router[_0x6509('0x17')]('/:id',auth[_0x6509('0xa')](),controller[_0x6509('0x18')]);module[_0x6509('0x19')]=router; \ No newline at end of file +var _0xe5f7=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xe5f7,0x178));var _0x7e5f=function(_0x24db01,_0x4659cc){_0x24db01=_0x24db01-0x0;var _0x2fc923=_0xe5f7[_0x24db01];return _0x2fc923;};'use strict';var multer=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var path=require(_0x7e5f('0x2'));var timeout=require(_0x7e5f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7e5f('0x4'));var auth=require(_0x7e5f('0x5'));var interaction=require(_0x7e5f('0x6'));var config=require('../../config/environment');var controller=require(_0x7e5f('0x7'));router[_0x7e5f('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e5f('0x9')]);router[_0x7e5f('0x8')](_0x7e5f('0xa'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0xc')]);router[_0x7e5f('0x8')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x7e5f('0xd')]);router[_0x7e5f('0x8')](_0x7e5f('0xe'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0xf')]);router[_0x7e5f('0x10')]('/',auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x11')]);router[_0x7e5f('0x10')](_0x7e5f('0x12'),auth['isAuthenticated'](),controller[_0x7e5f('0x13')]);router['post'](_0x7e5f('0xe'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x14')]);router[_0x7e5f('0x15')](_0x7e5f('0xa'),auth[_0x7e5f('0xb')](),controller[_0x7e5f('0x16')]);router[_0x7e5f('0x17')](_0x7e5f('0xa'),auth[_0x7e5f('0xb')](),controller['destroy']);module[_0x7e5f('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 77729e4..8ee8131 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 _0x7e43=['#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','STRING','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence'];(function(_0x51302c,_0x376113){var _0x20f6c1=function(_0x530cb3){while(--_0x530cb3){_0x51302c['push'](_0x51302c['shift']());}};_0x20f6c1(++_0x376113);}(_0x7e43,0xda));var _0x37e4=function(_0x59995f,_0x10e51c){_0x59995f=_0x59995f-0x0;var _0x30feb7=_0x7e43[_0x59995f];return _0x30feb7;};'use strict';var Sequelize=require(_0x37e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x37e4('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x37e4('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x37e4('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x37e4('0x4')},'limitCalls':{'type':Sequelize[_0x37e4('0x5')](0x4)[_0x37e4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x37e4('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x37e4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'comment':_0x37e4('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x37e4('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x37e4('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x37e4('0x2')](_0x37e4('0xf'),_0x37e4('0x10'),'onlyIfOpen'),'defaultValue':_0x37e4('0xf')},'dialAMDActive':{'type':Sequelize[_0x37e4('0x11')],'defaultValue':0x0,'comment':_0x37e4('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x37e4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x37e4('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x37e4('0x5')](0x9)[_0x37e4('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x37e4('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x37e4('0x5')](0x9)[_0x37e4('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x37e4('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x37e4('0x5')](0x9)[_0x37e4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x37e4('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x37e4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x37e4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x37e4('0x5')](0x5)[_0x37e4('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x37e4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x37e4('0x5')](0x9)[_0x37e4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x37e4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x37e4('0x2')](_0x37e4('0x19'),_0x37e4('0x1a')),'defaultValue':_0x37e4('0x19')},'dialPrefix':{'type':Sequelize[_0x37e4('0x1b')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x37e4('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x37e4('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x37e4('0x5')](0x5)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x37e4('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x37e4('0x5')](0x3)[_0x37e4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x37e4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x4b3f=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Max\x20200\x20calls.','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)'];(function(_0x4e36b2,_0x19464f){var _0x3210bf=function(_0x3135dd){while(--_0x3135dd){_0x4e36b2['push'](_0x4e36b2['shift']());}};_0x3210bf(++_0x19464f);}(_0x4b3f,0x1ef));var _0xf4b3=function(_0x26b9c4,_0x35f840){_0x26b9c4=_0x26b9c4-0x0;var _0x2bd259=_0x4b3f[_0x26b9c4];return _0x2bd259;};'use strict';var Sequelize=require(_0xf4b3('0x0'));module[_0xf4b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf4b3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf4b3('0x3')](_0xf4b3('0x4')),'allowNull':![],'defaultValue':_0xf4b3('0x4')},'description':{'type':Sequelize[_0xf4b3('0x5')]},'active':{'type':Sequelize[_0xf4b3('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4b3('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4b3('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf4b3('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b3('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b3('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'comment':_0xf4b3('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4b3('0xf')},'dialTimezone':{'type':Sequelize[_0xf4b3('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4b3('0x5')],'defaultValue':_0xf4b3('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4b3('0x3')](_0xf4b3('0x11'),'never',_0xf4b3('0x12')),'defaultValue':_0xf4b3('0x11')},'dialAMDActive':{'type':Sequelize[_0xf4b3('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf4b3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf4b3('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4b3('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4b3('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4b3('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4b3('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf4b3('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf4b3('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4b3('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf4b3('0x8')](0x9)[_0xf4b3('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4b3('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4b3('0x3')](_0xf4b3('0x1b'),_0xf4b3('0x1c')),'defaultValue':_0xf4b3('0x1b')},'dialPrefix':{'type':Sequelize[_0xf4b3('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4b3('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4b3('0x1d')},'dialCutDigit':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4b3('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b3('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b3('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf4b3('0x8')](0x3)[_0xf4b3('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b3('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4b3('0x8')](0x5)[_0xf4b3('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b3('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 19e4e38..4b41143 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 _0xd909=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','end','stack','name','send','index','map','Campaign','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','destroy','findOne','hasOwnProperty','nolimit','order','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','insert','into','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x42f663,_0x4c6f36){var _0x443091=function(_0xed1b0a){while(--_0xed1b0a){_0x42f663['push'](_0x42f663['shift']());}};_0x443091(++_0x4c6f36);}(_0xd909,0x1c1));var _0x9d90=function(_0x59860e,_0x18b7e1){_0x59860e=_0x59860e-0x0;var _0x181e64=_0xd909[_0x59860e];return _0x181e64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d90('0x0'));var zipdir=require(_0x9d90('0x1'));var jsonpatch=require(_0x9d90('0x2'));var rp=require(_0x9d90('0x3'));var moment=require('moment');var BPromise=require(_0x9d90('0x4'));var Mustache=require(_0x9d90('0x5'));var util=require(_0x9d90('0x6'));var path=require(_0x9d90('0x7'));var sox=require(_0x9d90('0x8'));var csv=require(_0x9d90('0x9'));var ejs=require(_0x9d90('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d90('0xb'));var squel=require(_0x9d90('0xc'));var crypto=require(_0x9d90('0xd'));var jsforce=require(_0x9d90('0xe'));var deskjs=require(_0x9d90('0xf'));var toCsv=require(_0x9d90('0x9'));var querystring=require(_0x9d90('0x10'));var Papa=require(_0x9d90('0x11'));var Redis=require(_0x9d90('0x12'));var authService=require(_0x9d90('0x13'));var qs=require(_0x9d90('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d90('0x15'));var logger=require(_0x9d90('0x16'))('api');var utils=require(_0x9d90('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d90('0x18'))['db'];function respondWithStatusCode(_0xb13b46,_0x2a2349){_0x2a2349=_0x2a2349||0xcc;return function(_0x4ba977){if(_0x4ba977){return _0xb13b46[_0x9d90('0x19')](_0x2a2349);}return _0xb13b46['status'](_0x2a2349)['end']();};}function respondWithResult(_0x3b3bf4,_0x19d331){_0x19d331=_0x19d331||0xc8;return function(_0x14119b){if(_0x14119b){return _0x3b3bf4[_0x9d90('0x1a')](_0x19d331)[_0x9d90('0x1b')](_0x14119b);}};}function respondWithFilteredResult(_0x4fd791,_0x783172){return function(_0x1fc38c){if(_0x1fc38c){var _0x201752=typeof _0x783172[_0x9d90('0x1c')]===_0x9d90('0x1d')&&typeof _0x783172[_0x9d90('0x1e')]===_0x9d90('0x1d');var _0x3e9ba9=_0x1fc38c[_0x9d90('0x1f')];var _0x6d042f=_0x201752?0x0:_0x783172[_0x9d90('0x1c')];var _0x64a9d=_0x201752?_0x1fc38c[_0x9d90('0x1f')]:_0x783172[_0x9d90('0x1c')]+_0x783172[_0x9d90('0x1e')];var _0x4738b7;if(_0x64a9d>=_0x3e9ba9){_0x64a9d=_0x3e9ba9;_0x4738b7=0xc8;}else{_0x4738b7=0xce;}_0x4fd791[_0x9d90('0x1a')](_0x4738b7);return _0x4fd791[_0x9d90('0x20')](_0x9d90('0x21'),_0x6d042f+'-'+_0x64a9d+'/'+_0x3e9ba9)[_0x9d90('0x1b')](_0x1fc38c);}return null;};}function patchUpdates(_0x5e5916){return function(_0x3d4be2){try{jsonpatch[_0x9d90('0x22')](_0x3d4be2,_0x5e5916,!![]);}catch(_0x20f227){return BPromise[_0x9d90('0x23')](_0x20f227);}return _0x3d4be2[_0x9d90('0x24')]();};}function saveUpdates(_0x271b35,_0x3c9f49){return function(_0x12c455){if(_0x12c455){return _0x12c455[_0x9d90('0x25')](_0x271b35)['then'](function(_0x3fd778){return _0x3fd778;});}return null;};}function removeEntity(_0x4882a9,_0x5e8c24){return function(_0xea86c){if(_0xea86c){return _0xea86c['destroy']()[_0x9d90('0x26')](function(){var _0x245327=_0xea86c[_0x9d90('0x27')]({'plain':!![]});var _0x4b6e17='IvrCampaigns';return db[_0x9d90('0x28')]['destroy']({'where':{'type':_0x4b6e17,'resourceId':_0x245327['id']}})[_0x9d90('0x26')](function(){return _0xea86c;});})['then'](function(){_0x4882a9[_0x9d90('0x1a')](0xcc)[_0x9d90('0x29')]();});}};}function handleEntityNotFound(_0x44fde1,_0xf03195){return function(_0x302237){if(!_0x302237){_0x44fde1['sendStatus'](0x194);}return _0x302237;};}function handleError(_0x571e3c,_0x2142ca){_0x2142ca=_0x2142ca||0x1f4;return function(_0x4f8c63){logger['error'](_0x4f8c63[_0x9d90('0x2a')]);if(_0x4f8c63['name']){delete _0x4f8c63[_0x9d90('0x2b')];}_0x571e3c[_0x9d90('0x1a')](_0x2142ca)[_0x9d90('0x2c')](_0x4f8c63);};}exports[_0x9d90('0x2d')]=function(_0x3b76df,_0x58d5eb){var _0x5b4f16={},_0x24445a={},_0x4bc4fc={'count':0x0,'rows':[]};var _0x1c1f9a=_[_0x9d90('0x2e')](db[_0x9d90('0x2f')]['rawAttributes'],function(_0x3a1bdf){return{'name':_0x3a1bdf[_0x9d90('0x30')],'type':_0x3a1bdf[_0x9d90('0x31')][_0x9d90('0x32')]};});_0x24445a[_0x9d90('0x33')]=_['map'](_0x1c1f9a,_0x9d90('0x2b'));_0x24445a['query']=_[_0x9d90('0x34')](_0x3b76df[_0x9d90('0x35')]);_0x24445a[_0x9d90('0x36')]=_[_0x9d90('0x37')](_0x24445a[_0x9d90('0x33')],_0x24445a[_0x9d90('0x35')]);_0x5b4f16[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x24445a[_0x9d90('0x33')],qs[_0x9d90('0x39')](_0x3b76df[_0x9d90('0x35')][_0x9d90('0x39')]));_0x5b4f16[_0x9d90('0x38')]=_0x5b4f16[_0x9d90('0x38')][_0x9d90('0x3a')]?_0x5b4f16[_0x9d90('0x38')]:_0x24445a[_0x9d90('0x33')];if(!_0x3b76df[_0x9d90('0x35')]['hasOwnProperty']('nolimit')){_0x5b4f16[_0x9d90('0x1e')]=qs['limit'](_0x3b76df[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x5b4f16['offset']=qs[_0x9d90('0x1c')](_0x3b76df[_0x9d90('0x35')][_0x9d90('0x1c')]);}_0x5b4f16['order']=qs[_0x9d90('0x3b')](_0x3b76df[_0x9d90('0x35')][_0x9d90('0x3b')]);_0x5b4f16[_0x9d90('0x3c')]=qs['filters'](_[_0x9d90('0x3d')](_0x3b76df[_0x9d90('0x35')],_0x24445a[_0x9d90('0x36')]),_0x1c1f9a);if(_0x3b76df['query'][_0x9d90('0x3e')]){_0x5b4f16[_0x9d90('0x3c')]=_['merge'](_0x5b4f16['where'],{'$or':_['map'](_0x1c1f9a,function(_0xb5754b){if(_0xb5754b[_0x9d90('0x31')]!==_0x9d90('0x3f')){var _0x95d49a={};_0x95d49a[_0xb5754b[_0x9d90('0x2b')]]={'$like':'%'+_0x3b76df['query'][_0x9d90('0x3e')]+'%'};return _0x95d49a;}})});}_0x5b4f16=_['merge']({},_0x5b4f16,_0x3b76df[_0x9d90('0x40')]);var _0x55a106={'where':_0x5b4f16[_0x9d90('0x3c')]};return db[_0x9d90('0x2f')][_0x9d90('0x1f')](_0x55a106)[_0x9d90('0x26')](function(_0x28e815){_0x4bc4fc[_0x9d90('0x1f')]=_0x28e815;if(_0x3b76df['query']['includeAll']){_0x5b4f16[_0x9d90('0x41')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x5b4f16);})[_0x9d90('0x26')](function(_0x57a25b){_0x4bc4fc[_0x9d90('0x42')]=_0x57a25b;return _0x4bc4fc;})[_0x9d90('0x26')](respondWithFilteredResult(_0x58d5eb,_0x5b4f16))[_0x9d90('0x43')](handleError(_0x58d5eb,null));};exports[_0x9d90('0x44')]=function(_0x44a3fd,_0xf87a0a){var _0x235ee5={'raw':![],'where':{'id':_0x44a3fd[_0x9d90('0x45')]['id']}},_0x4414de={};_0x4414de['model']=_['keys'](db[_0x9d90('0x2f')][_0x9d90('0x46')]);_0x4414de[_0x9d90('0x35')]=_['keys'](_0x44a3fd[_0x9d90('0x35')]);_0x4414de[_0x9d90('0x36')]=_[_0x9d90('0x37')](_0x4414de[_0x9d90('0x33')],_0x4414de[_0x9d90('0x35')]);_0x235ee5[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x4414de['model'],qs[_0x9d90('0x39')](_0x44a3fd['query'][_0x9d90('0x39')]));_0x235ee5[_0x9d90('0x38')]=_0x235ee5['attributes'][_0x9d90('0x3a')]?_0x235ee5[_0x9d90('0x38')]:_0x4414de[_0x9d90('0x33')];if(_0x44a3fd[_0x9d90('0x35')][_0x9d90('0x47')]){_0x235ee5[_0x9d90('0x41')]=[{'all':!![]}];}_0x235ee5=_[_0x9d90('0x48')]({},_0x235ee5,_0x44a3fd[_0x9d90('0x40')]);return db[_0x9d90('0x2f')][_0x9d90('0x49')](_0x235ee5)['then'](handleEntityNotFound(_0xf87a0a,null))[_0x9d90('0x26')](respondWithResult(_0xf87a0a,null))['catch'](handleError(_0xf87a0a,null));};exports['create']=function(_0x580b10,_0x3413a8){return db['Campaign'][_0x9d90('0x4a')](_0x580b10[_0x9d90('0x4b')],{})['then'](function(_0xac4fe){var _0x148308=_0x580b10['user'][_0x9d90('0x27')]({'plain':!![]});if(!_0x148308)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x148308[_0x9d90('0x4c')]===_0x9d90('0x4d')){var _0x31ab4c=_0xac4fe[_0x9d90('0x27')]({'plain':!![]});var _0x155f55=_0x9d90('0x4e');return db[_0x9d90('0x4f')]['find']({'where':{'name':_0x155f55,'userProfileId':_0x148308[_0x9d90('0x50')]},'raw':!![]})['then'](function(_0x18f832){if(_0x18f832&&_0x18f832[_0x9d90('0x51')]===0x0){return db['UserProfileResource'][_0x9d90('0x4a')]({'name':_0x31ab4c[_0x9d90('0x2b')],'resourceId':_0x31ab4c['id'],'type':_0x18f832[_0x9d90('0x2b')],'sectionId':_0x18f832['id']},{})[_0x9d90('0x26')](function(){return _0xac4fe;});}else{return _0xac4fe;}})['catch'](function(_0x38589d){logger[_0x9d90('0x52')](_0x9d90('0x53'),_0x38589d);throw _0x38589d;});}return _0xac4fe;})['then'](respondWithResult(_0x3413a8,0xc9))[_0x9d90('0x43')](handleError(_0x3413a8,null));};exports[_0x9d90('0x54')]=function(_0x26c092,_0x3dd6b1){var _0x33ed01={'where':{'id':_0x26c092[_0x9d90('0x45')]['id']}},_0x457868={};_0x457868[_0x9d90('0x33')]=_[_0x9d90('0x34')](db[_0x9d90('0x2f')][_0x9d90('0x46')]);_0x33ed01[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x457868['model'],qs[_0x9d90('0x39')](_0x26c092[_0x9d90('0x35')][_0x9d90('0x39')]));_0x33ed01[_0x9d90('0x38')]=_0x33ed01[_0x9d90('0x38')][_0x9d90('0x3a')]?_0x33ed01[_0x9d90('0x38')]:_0x457868['model'];if(_0x26c092[_0x9d90('0x35')]['includeAll']){_0x33ed01[_0x9d90('0x41')]=[{'all':!![]}];}_0x33ed01=_[_0x9d90('0x48')]({},_0x33ed01,_0x26c092[_0x9d90('0x40')]);return db[_0x9d90('0x2f')]['find'](_0x33ed01)[_0x9d90('0x26')](handleEntityNotFound(_0x3dd6b1,null))['then'](function(_0x23b0be){if(_0x23b0be){var _0x428a93=_0x23b0be[_0x9d90('0x27')]({'plain':!![]});_0x428a93=qs[_0x9d90('0x55')](_0x428a93,['id',_0x9d90('0x56'),_0x9d90('0x57')]);_0x26c092[_0x9d90('0x4b')]=_[_0x9d90('0x55')](_0x26c092['body'],['id',_0x9d90('0x56'),'updatedAt']);return db[_0x9d90('0x2f')][_0x9d90('0x4a')](_[_0x9d90('0x48')](_0x428a93,_0x26c092[_0x9d90('0x4b')]),{'include':_0x26c092[_0x9d90('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x9d90('0x26')](function(_0xad45c0){var _0x47820b=_0x26c092['user'][_0x9d90('0x27')]({'plain':!![]});if(!_0x47820b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47820b['role']===_0x9d90('0x4d')){var _0x2fa29b=_0xad45c0['get']({'plain':!![]});var _0x17c206=_0x9d90('0x4e');return db[_0x9d90('0x4f')][_0x9d90('0x49')]({'where':{'name':_0x17c206,'userProfileId':_0x47820b[_0x9d90('0x50')]},'raw':!![]})[_0x9d90('0x26')](function(_0x53a293){if(_0x53a293&&_0x53a293['autoAssociation']===0x0){return db[_0x9d90('0x28')][_0x9d90('0x4a')]({'name':_0x2fa29b['name'],'resourceId':_0x2fa29b['id'],'type':_0x53a293[_0x9d90('0x2b')],'sectionId':_0x53a293['id']},{})[_0x9d90('0x26')](function(){return _0xad45c0;});}else{return _0xad45c0;}})[_0x9d90('0x43')](function(_0x308007){logger[_0x9d90('0x52')](_0x9d90('0x53'),_0x308007);throw _0x308007;});}return _0xad45c0;});}})[_0x9d90('0x26')](respondWithResult(_0x3dd6b1,0xc9))[_0x9d90('0x43')](handleError(_0x3dd6b1,null));};exports['update']=function(_0x3aad51,_0x36c3a6){if(_0x3aad51[_0x9d90('0x4b')]['id']){delete _0x3aad51['body']['id'];}return db[_0x9d90('0x2f')][_0x9d90('0x49')]({'where':{'id':_0x3aad51[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x36c3a6,null))[_0x9d90('0x26')](saveUpdates(_0x3aad51[_0x9d90('0x4b')],null))[_0x9d90('0x26')](respondWithResult(_0x36c3a6,null))[_0x9d90('0x43')](handleError(_0x36c3a6,null));};exports[_0x9d90('0x58')]=function(_0xf6d3be,_0x5bb08a){return db[_0x9d90('0x2f')]['find']({'where':{'id':_0xf6d3be[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x5bb08a,null))[_0x9d90('0x26')](removeEntity(_0x5bb08a,null))[_0x9d90('0x43')](handleError(_0x5bb08a,null));};exports['getHoppers']=function(_0x5717a9,_0x3a6de5,_0x1cda47){var _0x5c970e={'raw':!![],'where':{}};var _0x105ef9={};var _0x5ef328={'count':0x0,'rows':[]};return db[_0x9d90('0x2f')][_0x9d90('0x59')]({'where':{'id':_0x5717a9[_0x9d90('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a6de5,null))[_0x9d90('0x26')](function(_0x3e1c60){if(_0x3e1c60){_0x105ef9[_0x9d90('0x33')]=_[_0x9d90('0x34')](db['CmHopper'][_0x9d90('0x46')]);_0x105ef9['query']=_[_0x9d90('0x34')](_0x5717a9['query']);_0x105ef9['filters']=_['intersection'](_0x105ef9[_0x9d90('0x33')],_0x105ef9[_0x9d90('0x35')]);_0x5c970e[_0x9d90('0x38')]=_['intersection'](_0x105ef9[_0x9d90('0x33')],qs[_0x9d90('0x39')](_0x5717a9[_0x9d90('0x35')][_0x9d90('0x39')]));_0x5c970e[_0x9d90('0x38')]=_0x5c970e['attributes'][_0x9d90('0x3a')]?_0x5c970e[_0x9d90('0x38')]:_0x105ef9[_0x9d90('0x33')];if(!_0x5717a9['query'][_0x9d90('0x5a')](_0x9d90('0x5b'))){_0x5c970e[_0x9d90('0x1e')]=qs[_0x9d90('0x1e')](_0x5717a9[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x5c970e['offset']=qs[_0x9d90('0x1c')](_0x5717a9[_0x9d90('0x35')][_0x9d90('0x1c')]);}_0x5c970e[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0x5717a9['query'][_0x9d90('0x3b')]);_0x5c970e[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_[_0x9d90('0x3d')](_0x5717a9[_0x9d90('0x35')],_0x105ef9[_0x9d90('0x36')]));_0x5c970e[_0x9d90('0x3c')][_0x9d90('0x5d')]=_0x3e1c60['id'];if(_0x5717a9[_0x9d90('0x35')]['filter']){_0x5c970e[_0x9d90('0x3c')]=_[_0x9d90('0x48')](_0x5c970e['where'],{'$or':_['map'](_0x5c970e[_0x9d90('0x38')],function(_0x11ac50){var _0x4a4cb5={};_0x4a4cb5[_0x11ac50]={'$like':'%'+_0x5717a9[_0x9d90('0x35')][_0x9d90('0x3e')]+'%'};return _0x4a4cb5;})});}_0x5c970e=_[_0x9d90('0x48')]({},_0x5c970e,_0x5717a9[_0x9d90('0x40')]);return db[_0x9d90('0x5e')][_0x9d90('0x1f')]({'where':_0x5c970e['where']})[_0x9d90('0x26')](function(_0x877a52){_0x5ef328[_0x9d90('0x1f')]=_0x877a52;if(_0x5717a9['query'][_0x9d90('0x47')]){_0x5c970e[_0x9d90('0x41')]=[{'all':!![]}];}return db[_0x9d90('0x5e')][_0x9d90('0x5f')](_0x5c970e);})[_0x9d90('0x26')](function(_0x2374ed){_0x5ef328[_0x9d90('0x42')]=_0x2374ed;return _0x5ef328;});}})['then'](respondWithFilteredResult(_0x3a6de5,_0x5c970e))['catch'](handleError(_0x3a6de5,null));};exports[_0x9d90('0x60')]=function(_0x4dc48a,_0x58b7bf,_0x315eea){var _0x417370={'raw':!![],'where':{}};var _0x2713c4={};var _0x539dbe={'count':0x0,'rows':[]};return db[_0x9d90('0x2f')][_0x9d90('0x59')]({'where':{'id':_0x4dc48a[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x58b7bf,null))[_0x9d90('0x26')](function(_0xf8236d){if(_0xf8236d){_0x2713c4[_0x9d90('0x33')]=_['keys'](db[_0x9d90('0x61')][_0x9d90('0x46')]);_0x2713c4['query']=_[_0x9d90('0x34')](_0x4dc48a[_0x9d90('0x35')]);_0x2713c4['filters']=_[_0x9d90('0x37')](_0x2713c4[_0x9d90('0x33')],_0x2713c4['query']);_0x417370[_0x9d90('0x38')]=_['intersection'](_0x2713c4['model'],qs[_0x9d90('0x39')](_0x4dc48a['query'][_0x9d90('0x39')]));_0x417370[_0x9d90('0x38')]=_0x417370[_0x9d90('0x38')][_0x9d90('0x3a')]?_0x417370[_0x9d90('0x38')]:_0x2713c4[_0x9d90('0x33')];if(!_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x5a')]('nolimit')){_0x417370['limit']=qs[_0x9d90('0x1e')](_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x417370[_0x9d90('0x1c')]=qs[_0x9d90('0x1c')](_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x1c')]);}_0x417370[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x3b')]);_0x417370[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_[_0x9d90('0x3d')](_0x4dc48a[_0x9d90('0x35')],_0x2713c4['filters']));_0x417370['where'][_0x9d90('0x5d')]=_0xf8236d['id'];if(_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x3e')]){_0x417370[_0x9d90('0x3c')]=_[_0x9d90('0x48')](_0x417370['where'],{'$or':_[_0x9d90('0x2e')](_0x417370[_0x9d90('0x38')],function(_0x38b128){var _0x5df62f={};_0x5df62f[_0x38b128]={'$like':'%'+_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x3e')]+'%'};return _0x5df62f;})});}_0x417370=_[_0x9d90('0x48')]({},_0x417370,_0x4dc48a[_0x9d90('0x40')]);return db[_0x9d90('0x61')][_0x9d90('0x1f')]({'where':_0x417370[_0x9d90('0x3c')]})[_0x9d90('0x26')](function(_0x456f9d){_0x539dbe['count']=_0x456f9d;if(_0x4dc48a[_0x9d90('0x35')][_0x9d90('0x47')]){_0x417370[_0x9d90('0x41')]=[{'all':!![]}];}return db[_0x9d90('0x61')]['findAll'](_0x417370);})[_0x9d90('0x26')](function(_0x46a0af){_0x539dbe[_0x9d90('0x42')]=_0x46a0af;return _0x539dbe;});}})['then'](respondWithFilteredResult(_0x58b7bf,_0x417370))['catch'](handleError(_0x58b7bf,null));};exports[_0x9d90('0x62')]=function(_0x1a8f45,_0x54da2e,_0x2710d1){var _0x5f092d={'raw':!![],'where':{}};var _0x4ce566={};var _0x2e9007={'count':0x0,'rows':[]};return db[_0x9d90('0x2f')][_0x9d90('0x59')]({'where':{'id':_0x1a8f45[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x54da2e,null))[_0x9d90('0x26')](function(_0x2114a9){if(_0x2114a9){_0x4ce566[_0x9d90('0x33')]=_['keys'](db['CmHopperFinal'][_0x9d90('0x46')]);_0x4ce566[_0x9d90('0x35')]=_[_0x9d90('0x34')](_0x1a8f45['query']);_0x4ce566[_0x9d90('0x36')]=_['intersection'](_0x4ce566['model'],_0x4ce566['query']);_0x5f092d[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x4ce566[_0x9d90('0x33')],qs['fields'](_0x1a8f45[_0x9d90('0x35')]['fields']));_0x5f092d[_0x9d90('0x38')]=_0x5f092d[_0x9d90('0x38')]['length']?_0x5f092d['attributes']:_0x4ce566['model'];if(!_0x1a8f45['query']['hasOwnProperty']('nolimit')){_0x5f092d[_0x9d90('0x1e')]=qs[_0x9d90('0x1e')](_0x1a8f45[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x5f092d[_0x9d90('0x1c')]=qs['offset'](_0x1a8f45[_0x9d90('0x35')][_0x9d90('0x1c')]);}_0x5f092d[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0x1a8f45[_0x9d90('0x35')]['sort']);_0x5f092d[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_[_0x9d90('0x3d')](_0x1a8f45['query'],_0x4ce566[_0x9d90('0x36')]));_0x5f092d[_0x9d90('0x3c')][_0x9d90('0x5d')]=_0x2114a9['id'];if(_0x1a8f45[_0x9d90('0x35')][_0x9d90('0x3e')]){_0x5f092d[_0x9d90('0x3c')]=_['merge'](_0x5f092d[_0x9d90('0x3c')],{'$or':_[_0x9d90('0x2e')](_0x5f092d[_0x9d90('0x38')],function(_0x2715d6){var _0x5f27f9={};_0x5f27f9[_0x2715d6]={'$like':'%'+_0x1a8f45[_0x9d90('0x35')][_0x9d90('0x3e')]+'%'};return _0x5f27f9;})});}_0x5f092d=_[_0x9d90('0x48')]({},_0x5f092d,_0x1a8f45[_0x9d90('0x40')]);return db[_0x9d90('0x63')]['count']({'where':_0x5f092d[_0x9d90('0x3c')]})[_0x9d90('0x26')](function(_0x18880d){_0x2e9007[_0x9d90('0x1f')]=_0x18880d;if(_0x1a8f45[_0x9d90('0x35')][_0x9d90('0x47')]){_0x5f092d[_0x9d90('0x41')]=[{'all':!![]}];}return db[_0x9d90('0x63')][_0x9d90('0x5f')](_0x5f092d);})['then'](function(_0x6a28e3){_0x2e9007[_0x9d90('0x42')]=_0x6a28e3;return _0x2e9007;});}})[_0x9d90('0x26')](respondWithFilteredResult(_0x54da2e,_0x5f092d))['catch'](handleError(_0x54da2e,null));};exports['getHopperBlacks']=function(_0xc72aa1,_0x36d278,_0xea5b94){var _0x43c0bc={'raw':!![],'where':{}};var _0x244120={};var _0x6c2092={'count':0x0,'rows':[]};return db[_0x9d90('0x2f')][_0x9d90('0x59')]({'where':{'id':_0xc72aa1[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x36d278,null))[_0x9d90('0x26')](function(_0x1f788b){if(_0x1f788b){_0x244120[_0x9d90('0x33')]=_[_0x9d90('0x34')](db[_0x9d90('0x64')][_0x9d90('0x46')]);_0x244120[_0x9d90('0x35')]=_[_0x9d90('0x34')](_0xc72aa1[_0x9d90('0x35')]);_0x244120['filters']=_[_0x9d90('0x37')](_0x244120['model'],_0x244120[_0x9d90('0x35')]);_0x43c0bc[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x244120[_0x9d90('0x33')],qs['fields'](_0xc72aa1[_0x9d90('0x35')][_0x9d90('0x39')]));_0x43c0bc[_0x9d90('0x38')]=_0x43c0bc['attributes'][_0x9d90('0x3a')]?_0x43c0bc[_0x9d90('0x38')]:_0x244120[_0x9d90('0x33')];if(!_0xc72aa1[_0x9d90('0x35')][_0x9d90('0x5a')](_0x9d90('0x5b'))){_0x43c0bc['limit']=qs['limit'](_0xc72aa1[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x43c0bc[_0x9d90('0x1c')]=qs[_0x9d90('0x1c')](_0xc72aa1['query'][_0x9d90('0x1c')]);}_0x43c0bc[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0xc72aa1['query'][_0x9d90('0x3b')]);_0x43c0bc[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_['pick'](_0xc72aa1[_0x9d90('0x35')],_0x244120[_0x9d90('0x36')]));_0x43c0bc[_0x9d90('0x3c')][_0x9d90('0x5d')]=_0x1f788b['id'];if(_0xc72aa1['query'][_0x9d90('0x3e')]){_0x43c0bc[_0x9d90('0x3c')]=_[_0x9d90('0x48')](_0x43c0bc['where'],{'$or':_[_0x9d90('0x2e')](_0x43c0bc[_0x9d90('0x38')],function(_0x2ee9aa){var _0x1a4cbc={};_0x1a4cbc[_0x2ee9aa]={'$like':'%'+_0xc72aa1['query'][_0x9d90('0x3e')]+'%'};return _0x1a4cbc;})});}_0x43c0bc=_[_0x9d90('0x48')]({},_0x43c0bc,_0xc72aa1[_0x9d90('0x40')]);return db[_0x9d90('0x64')]['count']({'where':_0x43c0bc['where']})[_0x9d90('0x26')](function(_0x4bce9b){_0x6c2092['count']=_0x4bce9b;if(_0xc72aa1[_0x9d90('0x35')][_0x9d90('0x47')]){_0x43c0bc['include']=[{'all':!![]}];}return db[_0x9d90('0x64')][_0x9d90('0x5f')](_0x43c0bc);})[_0x9d90('0x26')](function(_0x3d0aad){_0x6c2092['rows']=_0x3d0aad;return _0x6c2092;});}})[_0x9d90('0x26')](respondWithFilteredResult(_0x36d278,_0x43c0bc))[_0x9d90('0x43')](handleError(_0x36d278,null));};exports[_0x9d90('0x65')]=function(_0x5e7e47,_0x3d8cd1,_0x30bf1b){var _0x5c9109={};var _0x4c57e0={};var _0x32f81c;var _0x37bf78;return db['Campaign'][_0x9d90('0x59')]({'where':{'id':_0x5e7e47[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x3d8cd1,null))['then'](function(_0x57b8fb){if(_0x57b8fb){_0x32f81c=_0x57b8fb;_0x4c57e0['model']=_[_0x9d90('0x34')](db['CmList'][_0x9d90('0x46')]);_0x4c57e0[_0x9d90('0x35')]=_[_0x9d90('0x34')](_0x5e7e47['query']);_0x4c57e0[_0x9d90('0x36')]=_['intersection'](_0x4c57e0['model'],_0x4c57e0[_0x9d90('0x35')]);_0x5c9109[_0x9d90('0x38')]=_[_0x9d90('0x37')](_0x4c57e0[_0x9d90('0x33')],qs[_0x9d90('0x39')](_0x5e7e47['query'][_0x9d90('0x39')]));_0x5c9109['attributes']=_0x5c9109['attributes'][_0x9d90('0x3a')]?_0x5c9109['attributes']:_0x4c57e0[_0x9d90('0x33')];_0x5c9109[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0x5e7e47[_0x9d90('0x35')][_0x9d90('0x3b')]);_0x5c9109[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_['pick'](_0x5e7e47['query'],_0x4c57e0[_0x9d90('0x36')]));if(_0x5e7e47[_0x9d90('0x35')][_0x9d90('0x3e')]){_0x5c9109[_0x9d90('0x3c')]=_[_0x9d90('0x48')](_0x5c9109[_0x9d90('0x3c')],{'$or':_[_0x9d90('0x2e')](_0x5c9109['attributes'],function(_0x14bdef){var _0x128813={};_0x128813[_0x14bdef]={'$like':'%'+_0x5e7e47[_0x9d90('0x35')][_0x9d90('0x3e')]+'%'};return _0x128813;})});}_0x5c9109=_[_0x9d90('0x48')]({},_0x5c9109,_0x5e7e47['options']);return _0x32f81c['getLists'](_0x5c9109);}})[_0x9d90('0x26')](function(_0x5d1e36){if(_0x5d1e36){_0x37bf78=_0x5d1e36[_0x9d90('0x3a')];if(!_0x5e7e47[_0x9d90('0x35')][_0x9d90('0x5a')](_0x9d90('0x5b'))){_0x5c9109[_0x9d90('0x1e')]=qs[_0x9d90('0x1e')](_0x5e7e47[_0x9d90('0x35')][_0x9d90('0x1e')]);_0x5c9109[_0x9d90('0x1c')]=qs[_0x9d90('0x1c')](_0x5e7e47['query'][_0x9d90('0x1c')]);}return _0x32f81c['getLists'](_0x5c9109);}})[_0x9d90('0x26')](function(_0xa322db){if(_0xa322db){return _0xa322db?{'count':_0x37bf78,'rows':_0xa322db}:null;}})[_0x9d90('0x26')](respondWithResult(_0x3d8cd1,null))[_0x9d90('0x43')](handleError(_0x3d8cd1,null));};exports[_0x9d90('0x66')]=function(_0x3e8236,_0xb5d86f,_0x2e2470){var _0xe18f8c,_0x2cf40d;var _0x1a82f1=[];var _0x2d08b7=moment()[_0x9d90('0x67')](_0x9d90('0x68'));return db[_0x9d90('0x2f')]['find']({'where':{'id':_0x3e8236[_0x9d90('0x45')]['id']}})['then'](handleEntityNotFound(_0xb5d86f,null))[_0x9d90('0x26')](function(_0x1884ff){if(_0x1884ff){_0x2cf40d=_0x1884ff;return _0x1884ff[_0x9d90('0x66')](_0x3e8236[_0x9d90('0x4b')][_0x9d90('0x69')],_[_0x9d90('0x55')](_0x3e8236['body'],[_0x9d90('0x69'),'id'])||{});}return null;})[_0x9d90('0x6a')](function(_0x69c69c){var _0x226aa0;var _0x1cc2c7;_0xe18f8c=_0x69c69c||[];var _0x23fbb3=[];if(_0x69c69c){for(var _0x125090=0x0;_0x125090<_0x69c69c[_0x9d90('0x3a')];_0x125090+=0x1){var _0x4a5648=_0x69c69c[_0x125090]['get']({'plain':!![]});_0x2cf40d[_0x9d90('0x6b')]=_0x3e8236[_0x9d90('0x4b')][_0x9d90('0x6b')]?_0x3e8236[_0x9d90('0x4b')][_0x9d90('0x6b')]:_0x2cf40d[_0x9d90('0x6b')];switch(_0x2cf40d['dialCheckDuplicateType']){case _0x9d90('0x6c'):_0x226aa0=squel['insert']()['into'](_0x9d90('0x6d'))[_0x9d90('0x6e')]([_0x9d90('0x6f'),_0x9d90('0x70'),_0x9d90('0x71'),_0x9d90('0x72'),_0x9d90('0x5d'),'createdAt',_0x9d90('0x57')],squel[_0x9d90('0x73')]()[_0x9d90('0x74')](_0x9d90('0x6f'),'phone')['field'](_0x9d90('0x75'),_0x9d90('0x70'))[_0x9d90('0x74')]('id',_0x9d90('0x71'))['field'](_0x4a5648[_0x9d90('0x76')][_0x9d90('0x77')](),_0x9d90('0x72'))[_0x9d90('0x74')](_0x3e8236['params']['id'][_0x9d90('0x77')](),_0x9d90('0x5d'))[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x56'))[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x57'))[_0x9d90('0x78')](_0x9d90('0x79'))[_0x9d90('0x3c')](_0x9d90('0x7a'))[_0x9d90('0x3c')](_0x9d90('0x7b'),_0x4a5648[_0x9d90('0x76')][_0x9d90('0x77')]())[_0x9d90('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x9d90('0x3c')](_0x9d90('0x7c'),squel[_0x9d90('0x73')]()[_0x9d90('0x74')](_0x9d90('0x7d'))[_0x9d90('0x78')](_0x9d90('0x7e'))[_0x9d90('0x3c')](_0x9d90('0x7f'),_0x3e8236[_0x9d90('0x45')]['id'][_0x9d90('0x77')]()))[_0x9d90('0x3c')](_0x9d90('0x7c'),squel[_0x9d90('0x73')]()[_0x9d90('0x74')](_0x9d90('0x80'))['from']('cm_hopper')[_0x9d90('0x3c')]('CampaignId\x20=\x20?',_0x3e8236[_0x9d90('0x45')]['id'][_0x9d90('0x77')]())))[_0x9d90('0x77')]();break;case _0x9d90('0x81'):_0x226aa0=squel['insert']()['into'](_0x9d90('0x6d'))[_0x9d90('0x6e')](['phone','scheduledAt',_0x9d90('0x71'),_0x9d90('0x72'),_0x9d90('0x5d'),_0x9d90('0x56'),'updatedAt'],squel[_0x9d90('0x73')]()[_0x9d90('0x74')]('phone',_0x9d90('0x6f'))[_0x9d90('0x74')](_0x9d90('0x75'),'scheduledAt')[_0x9d90('0x74')]('id',_0x9d90('0x71'))[_0x9d90('0x74')](_0x4a5648['CmListId'][_0x9d90('0x77')](),_0x9d90('0x72'))[_0x9d90('0x74')](_0x3e8236[_0x9d90('0x45')]['id'][_0x9d90('0x77')](),'CampaignId')[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x56'))['field']('\x27'+_0x2d08b7+'\x27',_0x9d90('0x57'))[_0x9d90('0x78')](_0x9d90('0x79'))[_0x9d90('0x3c')](_0x9d90('0x7a'))[_0x9d90('0x3c')](_0x9d90('0x7b'),_0x4a5648['CmListId']['toString']())[_0x9d90('0x3c')](_0x9d90('0x82'))[_0x9d90('0x3c')](_0x9d90('0x7c'),squel[_0x9d90('0x73')]()[_0x9d90('0x74')]('COALESCE(phone,\x27\x27)')[_0x9d90('0x78')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x3e8236[_0x9d90('0x45')]['id'][_0x9d90('0x77')]())))[_0x9d90('0x77')]();break;default:_0x226aa0=squel[_0x9d90('0x83')]()[_0x9d90('0x84')](_0x9d90('0x6d'))['fromQuery'](['phone','scheduledAt',_0x9d90('0x71'),_0x9d90('0x72'),_0x9d90('0x5d'),_0x9d90('0x56'),_0x9d90('0x57')],squel[_0x9d90('0x73')]()[_0x9d90('0x74')](_0x9d90('0x6f'),_0x9d90('0x6f'))[_0x9d90('0x74')](_0x9d90('0x75'),_0x9d90('0x70'))['field']('id',_0x9d90('0x71'))[_0x9d90('0x74')](_0x4a5648[_0x9d90('0x76')][_0x9d90('0x77')](),_0x9d90('0x72'))[_0x9d90('0x74')](_0x3e8236['params']['id'][_0x9d90('0x77')](),_0x9d90('0x5d'))[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x56'))[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x57'))['from']('cm_contacts')['where'](_0x9d90('0x7a'))['where'](_0x9d90('0x7b'),_0x4a5648[_0x9d90('0x76')][_0x9d90('0x77')]())[_0x9d90('0x3c')](_0x9d90('0x82')))['toString']();}_0x1cc2c7=squel[_0x9d90('0x83')]()[_0x9d90('0x84')](_0x9d90('0x85'))[_0x9d90('0x6e')]([_0x9d90('0x86'),_0x9d90('0x70'),_0x9d90('0x6f'),_0x9d90('0x87'),_0x9d90('0x56'),_0x9d90('0x57')],squel[_0x9d90('0x73')]()['field'](_0x9d90('0x88'),'id')[_0x9d90('0x74')](_0x9d90('0x75'),_0x9d90('0x70'))[_0x9d90('0x74')](_0x9d90('0x89'),_0x9d90('0x6f'))[_0x9d90('0x74')](_0x9d90('0x8a'),_0x9d90('0x87'))['field']('\x27'+_0x2d08b7+'\x27',_0x9d90('0x56'))[_0x9d90('0x74')]('\x27'+_0x2d08b7+'\x27',_0x9d90('0x57'))[_0x9d90('0x78')]('cm_contact_has_items','ci')[_0x9d90('0x8b')](_0x9d90('0x6d'),'h',_0x9d90('0x8c'))[_0x9d90('0x3c')](_0x9d90('0x8d'),_0x4a5648['CmListId'][_0x9d90('0x77')]())[_0x9d90('0x3c')](_0x9d90('0x8e'),_0x3e8236['params']['id'][_0x9d90('0x77')]())[_0x9d90('0x3c')]('h.createdAt\x20=\x20?',_0x2d08b7))[_0x9d90('0x77')]();_0x23fbb3[_0x9d90('0x8f')](db[_0x9d90('0x90')][_0x9d90('0x35')](_0x226aa0));_0x1a82f1[_0x9d90('0x8f')](db[_0x9d90('0x90')][_0x9d90('0x35')](_0x1cc2c7));}return BPromise[_0x9d90('0x91')](_0x23fbb3);}})[_0x9d90('0x26')](function(){return BPromise[_0x9d90('0x91')](_0x1a82f1);})[_0x9d90('0x26')](function(){return _0xe18f8c;})['then'](respondWithResult(_0xb5d86f,null))[_0x9d90('0x43')](handleError(_0xb5d86f,null));};exports[_0x9d90('0x92')]=function(_0x2e4f4f,_0x3fd2b7,_0x59e701){return db['Campaign']['find']({'where':{'id':_0x2e4f4f[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x3fd2b7,null))[_0x9d90('0x26')](function(_0x520747){if(_0x520747){return _0x520747[_0x9d90('0x92')](_0x2e4f4f['query'][_0x9d90('0x69')]);}})[_0x9d90('0x26')](function(_0x2adc50){if(_0x2adc50){return db['CmHopper'][_0x9d90('0x58')]({'where':{'ListId':_0x2e4f4f[_0x9d90('0x35')][_0x9d90('0x69')],'CampaignId':_0x2e4f4f[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](function(){return _0x2adc50;});}})[_0x9d90('0x26')](respondWithStatusCode(_0x3fd2b7,null))['catch'](handleError(_0x3fd2b7,null));};exports[_0x9d90('0x93')]=function(_0x3a1aef,_0x43310a,_0x5a4888){var _0x3d025d={};var _0x5e4674={};var _0x318841;var _0x505237;return db[_0x9d90('0x2f')][_0x9d90('0x59')]({'where':{'id':_0x3a1aef[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x43310a,null))[_0x9d90('0x26')](function(_0xb820f0){if(_0xb820f0){_0x318841=_0xb820f0;_0x5e4674[_0x9d90('0x33')]=_[_0x9d90('0x34')](db['CmList'][_0x9d90('0x46')]);_0x5e4674[_0x9d90('0x35')]=_[_0x9d90('0x34')](_0x3a1aef[_0x9d90('0x35')]);_0x5e4674[_0x9d90('0x36')]=_['intersection'](_0x5e4674[_0x9d90('0x33')],_0x5e4674[_0x9d90('0x35')]);_0x3d025d['attributes']=_[_0x9d90('0x37')](_0x5e4674[_0x9d90('0x33')],qs[_0x9d90('0x39')](_0x3a1aef[_0x9d90('0x35')][_0x9d90('0x39')]));_0x3d025d[_0x9d90('0x38')]=_0x3d025d['attributes']['length']?_0x3d025d[_0x9d90('0x38')]:_0x5e4674['model'];_0x3d025d[_0x9d90('0x5c')]=qs[_0x9d90('0x3b')](_0x3a1aef[_0x9d90('0x35')][_0x9d90('0x3b')]);_0x3d025d[_0x9d90('0x3c')]=qs[_0x9d90('0x36')](_[_0x9d90('0x3d')](_0x3a1aef[_0x9d90('0x35')],_0x5e4674['filters']));if(_0x3a1aef[_0x9d90('0x35')]['filter']){_0x3d025d[_0x9d90('0x3c')]=_[_0x9d90('0x48')](_0x3d025d['where'],{'$or':_[_0x9d90('0x2e')](_0x3d025d[_0x9d90('0x38')],function(_0x2853a2){var _0x4cea39={};_0x4cea39[_0x2853a2]={'$like':'%'+_0x3a1aef[_0x9d90('0x35')][_0x9d90('0x3e')]+'%'};return _0x4cea39;})});}_0x3d025d=_[_0x9d90('0x48')]({},_0x3d025d,_0x3a1aef['options']);return _0x318841[_0x9d90('0x93')](_0x3d025d);}})[_0x9d90('0x26')](function(_0x11a1bc){if(_0x11a1bc){_0x505237=_0x11a1bc[_0x9d90('0x3a')];if(!_0x3a1aef[_0x9d90('0x35')][_0x9d90('0x5a')](_0x9d90('0x5b'))){_0x3d025d[_0x9d90('0x1e')]=qs[_0x9d90('0x1e')](_0x3a1aef['query'][_0x9d90('0x1e')]);_0x3d025d[_0x9d90('0x1c')]=qs[_0x9d90('0x1c')](_0x3a1aef[_0x9d90('0x35')]['offset']);}return _0x318841['getBlackLists'](_0x3d025d);}})[_0x9d90('0x26')](function(_0x241c2c){if(_0x241c2c){return _0x241c2c?{'count':_0x505237,'rows':_0x241c2c}:null;}})[_0x9d90('0x26')](respondWithResult(_0x43310a,null))[_0x9d90('0x43')](handleError(_0x43310a,null));};exports[_0x9d90('0x94')]=function(_0x4914ee,_0x167ced,_0x1f3e95){var _0x46b04b,_0x38a77f;var _0x1810cc=[];var _0x218150=moment()[_0x9d90('0x67')](_0x9d90('0x68'));return db['Campaign'][_0x9d90('0x49')]({'where':{'id':_0x4914ee['params']['id']}})['then'](handleEntityNotFound(_0x167ced,null))['then'](function(_0x4d2ea4){if(_0x4d2ea4){_0x38a77f=_0x4d2ea4;return _0x4d2ea4[_0x9d90('0x94')](_0x4914ee[_0x9d90('0x4b')][_0x9d90('0x69')],_[_0x9d90('0x55')](_0x4914ee['body'],[_0x9d90('0x69'),'id'])||{});}return null;})[_0x9d90('0x6a')](function(_0xa4d83c){var _0x24abfc;var _0x4a2863;_0x46b04b=_0xa4d83c||[];var _0xf88e4e=[];if(_0xa4d83c){for(var _0xcdc741=0x0;_0xcdc741<_0xa4d83c[_0x9d90('0x3a')];_0xcdc741+=0x1){var _0x2e8f32=_0xa4d83c[_0xcdc741][_0x9d90('0x27')]({'plain':!![]});_0x24abfc=squel[_0x9d90('0x83')]()[_0x9d90('0x84')](_0x9d90('0x95'))[_0x9d90('0x6e')]([_0x9d90('0x6f'),_0x9d90('0x71'),_0x9d90('0x72'),_0x9d90('0x5d'),_0x9d90('0x56'),_0x9d90('0x57')],squel[_0x9d90('0x73')]()[_0x9d90('0x74')](_0x9d90('0x6f'),_0x9d90('0x6f'))[_0x9d90('0x74')]('id','ContactId')['field'](_0x2e8f32[_0x9d90('0x76')][_0x9d90('0x77')](),_0x9d90('0x72'))[_0x9d90('0x74')](_0x4914ee[_0x9d90('0x45')]['id'][_0x9d90('0x77')](),_0x9d90('0x5d'))[_0x9d90('0x74')](_0x9d90('0x75'),'createdAt')[_0x9d90('0x74')]('NOW()','updatedAt')[_0x9d90('0x78')](_0x9d90('0x79'))[_0x9d90('0x3c')]('deletedAt\x20IS\x20NULL')[_0x9d90('0x3c')](_0x9d90('0x7b'),_0x2e8f32[_0x9d90('0x76')][_0x9d90('0x77')]())['where'](_0x9d90('0x82')))['toString']();_0xf88e4e[_0x9d90('0x8f')](db[_0x9d90('0x90')][_0x9d90('0x35')](_0x24abfc));}return BPromise[_0x9d90('0x91')](_0xf88e4e);}})[_0x9d90('0x26')](function(){return _0x46b04b;})[_0x9d90('0x26')](respondWithResult(_0x167ced,null))['catch'](handleError(_0x167ced,null));};exports['removeBlackLists']=function(_0x51ab48,_0x5343d0,_0x16414b){return db[_0x9d90('0x2f')][_0x9d90('0x49')]({'where':{'id':_0x51ab48[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](handleEntityNotFound(_0x5343d0,null))[_0x9d90('0x26')](function(_0x5564c0){if(_0x5564c0){return _0x5564c0[_0x9d90('0x96')](_0x51ab48[_0x9d90('0x35')][_0x9d90('0x69')]);}})[_0x9d90('0x26')](function(_0x504dbb){if(_0x504dbb){return db[_0x9d90('0x64')]['destroy']({'where':{'ListId':_0x51ab48[_0x9d90('0x35')][_0x9d90('0x69')],'CampaignId':_0x51ab48[_0x9d90('0x45')]['id']}})[_0x9d90('0x26')](function(){return _0x504dbb;});}})[_0x9d90('0x26')](respondWithStatusCode(_0x5343d0,null))[_0x9d90('0x43')](handleError(_0x5343d0,null));}; \ No newline at end of file +var _0x94d2=['CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','CmHopper','rows','getHopperHistories','findOne','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x94d2,0x1cd));var _0x294d=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x94d2[_0x2bda14];return _0xb5dd49;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x294d('0x0'));var jsonpatch=require(_0x294d('0x1'));var rp=require(_0x294d('0x2'));var moment=require(_0x294d('0x3'));var BPromise=require(_0x294d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x294d('0x5'));var sox=require(_0x294d('0x6'));var csv=require(_0x294d('0x7'));var ejs=require(_0x294d('0x8'));var fs=require('fs');var fs_extra=require(_0x294d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x294d('0xa'));var jsforce=require(_0x294d('0xb'));var deskjs=require(_0x294d('0xc'));var toCsv=require(_0x294d('0x7'));var querystring=require(_0x294d('0xd'));var Papa=require('papaparse');var Redis=require(_0x294d('0xe'));var authService=require(_0x294d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x294d('0x10'));var hardwareService=require(_0x294d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x294d('0x12'));var config=require(_0x294d('0x13'));var licenseUtil=require(_0x294d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d44ba,_0x3f0f3a){_0x3f0f3a=_0x3f0f3a||0xcc;return function(_0x4119da){if(_0x4119da){return _0x3d44ba[_0x294d('0x15')](_0x3f0f3a);}return _0x3d44ba['status'](_0x3f0f3a)[_0x294d('0x16')]();};}function respondWithResult(_0x49c38f,_0x5adc9c){_0x5adc9c=_0x5adc9c||0xc8;return function(_0xed0e10){if(_0xed0e10){return _0x49c38f[_0x294d('0x17')](_0x5adc9c)[_0x294d('0x18')](_0xed0e10);}};}function respondWithFilteredResult(_0x28f7f6,_0x4bf3ae){return function(_0x42d290){if(_0x42d290){var _0x4fddfe=typeof _0x4bf3ae['offset']==='undefined'&&typeof _0x4bf3ae['limit']===_0x294d('0x19');var _0x15dce0=_0x42d290[_0x294d('0x1a')];var _0x46d9c5=_0x4fddfe?0x0:_0x4bf3ae[_0x294d('0x1b')];var _0x26563e=_0x4fddfe?_0x42d290[_0x294d('0x1a')]:_0x4bf3ae[_0x294d('0x1b')]+_0x4bf3ae['limit'];var _0x3ccc78;if(_0x26563e>=_0x15dce0){_0x26563e=_0x15dce0;_0x3ccc78=0xc8;}else{_0x3ccc78=0xce;}_0x28f7f6[_0x294d('0x17')](_0x3ccc78);return _0x28f7f6['set'](_0x294d('0x1c'),_0x46d9c5+'-'+_0x26563e+'/'+_0x15dce0)[_0x294d('0x18')](_0x42d290);}return null;};}function patchUpdates(_0x429da3){return function(_0xffe147){try{jsonpatch[_0x294d('0x1d')](_0xffe147,_0x429da3,!![]);}catch(_0x31fd1c){return BPromise[_0x294d('0x1e')](_0x31fd1c);}return _0xffe147[_0x294d('0x1f')]();};}function saveUpdates(_0x82ad78,_0x11df11){return function(_0x419717){if(_0x419717){return _0x419717[_0x294d('0x20')](_0x82ad78)[_0x294d('0x21')](function(_0x2b2a1e){return _0x2b2a1e;});}return null;};}function removeEntity(_0x4aa60,_0x524ff2){return function(_0x546a59){if(_0x546a59){return _0x546a59[_0x294d('0x22')]()[_0x294d('0x21')](function(){var _0x10fb2e=_0x546a59[_0x294d('0x23')]({'plain':!![]});var _0x1cf383=_0x294d('0x24');return db['UserProfileResource'][_0x294d('0x22')]({'where':{'type':_0x1cf383,'resourceId':_0x10fb2e['id']}})['then'](function(){return _0x546a59;});})[_0x294d('0x21')](function(){_0x4aa60[_0x294d('0x17')](0xcc)[_0x294d('0x16')]();});}};}function handleEntityNotFound(_0x1f2dd7,_0x160c42){return function(_0x316bb6){if(!_0x316bb6){_0x1f2dd7[_0x294d('0x15')](0x194);}return _0x316bb6;};}function handleError(_0x4ad67d,_0xc15349){_0xc15349=_0xc15349||0x1f4;return function(_0x2b2072){logger[_0x294d('0x25')](_0x2b2072[_0x294d('0x26')]);if(_0x2b2072[_0x294d('0x27')]){delete _0x2b2072[_0x294d('0x27')];}_0x4ad67d[_0x294d('0x17')](_0xc15349)[_0x294d('0x28')](_0x2b2072);};}exports['index']=function(_0x33cb73,_0x4539d6){var _0x194f02={},_0x3cf02d={},_0x594c76={'count':0x0,'rows':[]};var _0x5bb1d4=_[_0x294d('0x29')](db[_0x294d('0x2a')][_0x294d('0x2b')],function(_0x10ed0f){return{'name':_0x10ed0f[_0x294d('0x2c')],'type':_0x10ed0f[_0x294d('0x2d')][_0x294d('0x2e')]};});_0x3cf02d[_0x294d('0x2f')]=_[_0x294d('0x29')](_0x5bb1d4,'name');_0x3cf02d[_0x294d('0x30')]=_[_0x294d('0x31')](_0x33cb73[_0x294d('0x30')]);_0x3cf02d['filters']=_[_0x294d('0x32')](_0x3cf02d[_0x294d('0x2f')],_0x3cf02d['query']);_0x194f02[_0x294d('0x33')]=_[_0x294d('0x32')](_0x3cf02d['model'],qs['fields'](_0x33cb73[_0x294d('0x30')][_0x294d('0x34')]));_0x194f02[_0x294d('0x33')]=_0x194f02['attributes'][_0x294d('0x35')]?_0x194f02[_0x294d('0x33')]:_0x3cf02d[_0x294d('0x2f')];if(!_0x33cb73[_0x294d('0x30')][_0x294d('0x36')](_0x294d('0x37'))){_0x194f02[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x33cb73[_0x294d('0x30')][_0x294d('0x38')]);_0x194f02[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x33cb73['query'][_0x294d('0x1b')]);}_0x194f02[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x33cb73['query'][_0x294d('0x3a')]);_0x194f02[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x33cb73['query'],_0x3cf02d[_0x294d('0x3c')]),_0x5bb1d4);if(_0x33cb73[_0x294d('0x30')][_0x294d('0x3e')]){_0x194f02['where']=_[_0x294d('0x3f')](_0x194f02[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x5bb1d4,function(_0x54268a){if(_0x54268a[_0x294d('0x2d')]!==_0x294d('0x40')){var _0x11a1c7={};_0x11a1c7[_0x54268a[_0x294d('0x27')]]={'$like':'%'+_0x33cb73[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x11a1c7;}})});}_0x194f02=_[_0x294d('0x3f')]({},_0x194f02,_0x33cb73[_0x294d('0x41')]);var _0x2b961a={'where':_0x194f02[_0x294d('0x3b')]};return db[_0x294d('0x2a')][_0x294d('0x1a')](_0x2b961a)[_0x294d('0x21')](function(_0xbd48cd){_0x594c76[_0x294d('0x1a')]=_0xbd48cd;if(_0x33cb73[_0x294d('0x30')][_0x294d('0x42')]){_0x194f02[_0x294d('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x294d('0x44')](_0x194f02);})[_0x294d('0x21')](function(_0x2be6fd){_0x594c76['rows']=_0x2be6fd;return _0x594c76;})[_0x294d('0x21')](respondWithFilteredResult(_0x4539d6,_0x194f02))[_0x294d('0x45')](handleError(_0x4539d6,null));};exports['show']=function(_0x96e509,_0xad8563){var _0x82008d={'raw':![],'where':{'id':_0x96e509[_0x294d('0x46')]['id']}},_0x4b3b5b={};_0x4b3b5b[_0x294d('0x2f')]=_[_0x294d('0x31')](db[_0x294d('0x2a')][_0x294d('0x2b')]);_0x4b3b5b[_0x294d('0x30')]=_['keys'](_0x96e509['query']);_0x4b3b5b['filters']=_[_0x294d('0x32')](_0x4b3b5b[_0x294d('0x2f')],_0x4b3b5b[_0x294d('0x30')]);_0x82008d[_0x294d('0x33')]=_[_0x294d('0x32')](_0x4b3b5b['model'],qs[_0x294d('0x34')](_0x96e509['query']['fields']));_0x82008d[_0x294d('0x33')]=_0x82008d[_0x294d('0x33')][_0x294d('0x35')]?_0x82008d[_0x294d('0x33')]:_0x4b3b5b[_0x294d('0x2f')];if(_0x96e509[_0x294d('0x30')][_0x294d('0x42')]){_0x82008d['include']=[{'all':!![]}];}_0x82008d=_['merge']({},_0x82008d,_0x96e509['options']);return db['Campaign'][_0x294d('0x47')](_0x82008d)[_0x294d('0x21')](handleEntityNotFound(_0xad8563,null))[_0x294d('0x21')](respondWithResult(_0xad8563,null))[_0x294d('0x45')](handleError(_0xad8563,null));};exports[_0x294d('0x48')]=function(_0x82590d,_0x160904){return db[_0x294d('0x2a')][_0x294d('0x48')](_0x82590d[_0x294d('0x49')],{})[_0x294d('0x21')](function(_0x4cb805){var _0x15249a=_0x82590d[_0x294d('0x4a')][_0x294d('0x23')]({'plain':!![]});if(!_0x15249a)throw new Error(_0x294d('0x4b'));if(_0x15249a[_0x294d('0x4c')]==='user'){var _0x91b2da=_0x4cb805[_0x294d('0x23')]({'plain':!![]});var _0x2e82fb='IvrCampaigns';return db[_0x294d('0x4d')][_0x294d('0x47')]({'where':{'name':_0x2e82fb,'userProfileId':_0x15249a[_0x294d('0x4e')]},'raw':!![]})[_0x294d('0x21')](function(_0x4ed1e5){if(_0x4ed1e5&&_0x4ed1e5[_0x294d('0x4f')]===0x0){return db[_0x294d('0x50')][_0x294d('0x48')]({'name':_0x91b2da['name'],'resourceId':_0x91b2da['id'],'type':_0x4ed1e5[_0x294d('0x27')],'sectionId':_0x4ed1e5['id']},{})[_0x294d('0x21')](function(){return _0x4cb805;});}else{return _0x4cb805;}})['catch'](function(_0x4e3380){logger[_0x294d('0x25')](_0x294d('0x51'),_0x4e3380);throw _0x4e3380;});}return _0x4cb805;})[_0x294d('0x21')](respondWithResult(_0x160904,0xc9))[_0x294d('0x45')](handleError(_0x160904,null));};exports['clone']=function(_0x5d2dcc,_0xe62080){var _0x4f8a45={'where':{'id':_0x5d2dcc[_0x294d('0x46')]['id']}},_0x34b9b0={};_0x34b9b0[_0x294d('0x2f')]=_[_0x294d('0x31')](db[_0x294d('0x2a')][_0x294d('0x2b')]);_0x4f8a45[_0x294d('0x33')]=_['intersection'](_0x34b9b0[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x5d2dcc[_0x294d('0x30')][_0x294d('0x34')]));_0x4f8a45[_0x294d('0x33')]=_0x4f8a45['attributes'][_0x294d('0x35')]?_0x4f8a45['attributes']:_0x34b9b0[_0x294d('0x2f')];if(_0x5d2dcc[_0x294d('0x30')]['includeAll']){_0x4f8a45[_0x294d('0x43')]=[{'all':!![]}];}_0x4f8a45=_[_0x294d('0x3f')]({},_0x4f8a45,_0x5d2dcc[_0x294d('0x41')]);return db[_0x294d('0x2a')][_0x294d('0x47')](_0x4f8a45)['then'](handleEntityNotFound(_0xe62080,null))['then'](function(_0x32d0ae){if(_0x32d0ae){var _0x34f6b3=_0x32d0ae[_0x294d('0x23')]({'plain':!![]});_0x34f6b3=qs[_0x294d('0x52')](_0x34f6b3,['id',_0x294d('0x53'),_0x294d('0x54')]);_0x5d2dcc[_0x294d('0x49')]=_[_0x294d('0x52')](_0x5d2dcc['body'],['id',_0x294d('0x53'),_0x294d('0x54')]);return db[_0x294d('0x2a')]['create'](_[_0x294d('0x3f')](_0x34f6b3,_0x5d2dcc[_0x294d('0x49')]),{'include':_0x5d2dcc[_0x294d('0x30')][_0x294d('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x9a7275){var _0x412fce=_0x5d2dcc['user'][_0x294d('0x23')]({'plain':!![]});if(!_0x412fce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x412fce['role']===_0x294d('0x4a')){var _0x4e9785=_0x9a7275['get']({'plain':!![]});var _0x11cc4d='IvrCampaigns';return db[_0x294d('0x4d')]['find']({'where':{'name':_0x11cc4d,'userProfileId':_0x412fce[_0x294d('0x4e')]},'raw':!![]})[_0x294d('0x21')](function(_0x1b4d1e){if(_0x1b4d1e&&_0x1b4d1e[_0x294d('0x4f')]===0x0){return db[_0x294d('0x50')][_0x294d('0x48')]({'name':_0x4e9785['name'],'resourceId':_0x4e9785['id'],'type':_0x1b4d1e['name'],'sectionId':_0x1b4d1e['id']},{})['then'](function(){return _0x9a7275;});}else{return _0x9a7275;}})['catch'](function(_0x5786f8){logger[_0x294d('0x25')](_0x294d('0x51'),_0x5786f8);throw _0x5786f8;});}return _0x9a7275;});}})[_0x294d('0x21')](respondWithResult(_0xe62080,0xc9))['catch'](handleError(_0xe62080,null));};exports['update']=function(_0x4b815e,_0x45fde1){if(_0x4b815e[_0x294d('0x49')]['id']){delete _0x4b815e[_0x294d('0x49')]['id'];}return db[_0x294d('0x2a')][_0x294d('0x47')]({'where':{'id':_0x4b815e[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x45fde1,null))[_0x294d('0x21')](saveUpdates(_0x4b815e[_0x294d('0x49')],null))['then'](respondWithResult(_0x45fde1,null))[_0x294d('0x45')](handleError(_0x45fde1,null));};exports[_0x294d('0x22')]=function(_0x20abb0,_0x18a2ce){return db[_0x294d('0x2a')][_0x294d('0x47')]({'where':{'id':_0x20abb0[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x18a2ce,null))[_0x294d('0x21')](removeEntity(_0x18a2ce,null))[_0x294d('0x45')](handleError(_0x18a2ce,null));};exports['getHoppers']=function(_0x21cca3,_0x5bfcdc,_0x395814){var _0x1c66d4={'raw':!![],'where':{}};var _0x4f519b={};var _0x3f60f0={'count':0x0,'rows':[]};return db[_0x294d('0x2a')]['findOne']({'where':{'id':_0x21cca3['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x5bfcdc,null))['then'](function(_0x59d43d){if(_0x59d43d){_0x4f519b['model']=_[_0x294d('0x31')](db[_0x294d('0x55')][_0x294d('0x2b')]);_0x4f519b[_0x294d('0x30')]=_['keys'](_0x21cca3['query']);_0x4f519b['filters']=_[_0x294d('0x32')](_0x4f519b[_0x294d('0x2f')],_0x4f519b[_0x294d('0x30')]);_0x1c66d4[_0x294d('0x33')]=_[_0x294d('0x32')](_0x4f519b['model'],qs[_0x294d('0x34')](_0x21cca3[_0x294d('0x30')][_0x294d('0x34')]));_0x1c66d4[_0x294d('0x33')]=_0x1c66d4['attributes'][_0x294d('0x35')]?_0x1c66d4[_0x294d('0x33')]:_0x4f519b[_0x294d('0x2f')];if(!_0x21cca3[_0x294d('0x30')][_0x294d('0x36')](_0x294d('0x37'))){_0x1c66d4[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x21cca3[_0x294d('0x30')][_0x294d('0x38')]);_0x1c66d4[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x21cca3[_0x294d('0x30')]['offset']);}_0x1c66d4[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x21cca3[_0x294d('0x30')]['sort']);_0x1c66d4[_0x294d('0x3b')]=qs['filters'](_[_0x294d('0x3d')](_0x21cca3[_0x294d('0x30')],_0x4f519b[_0x294d('0x3c')]));_0x1c66d4[_0x294d('0x3b')]['CampaignId']=_0x59d43d['id'];if(_0x21cca3['query']['filter']){_0x1c66d4[_0x294d('0x3b')]=_['merge'](_0x1c66d4[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x1c66d4[_0x294d('0x33')],function(_0x5c8e5d){var _0x1a3914={};_0x1a3914[_0x5c8e5d]={'$like':'%'+_0x21cca3[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x1a3914;})});}_0x1c66d4=_[_0x294d('0x3f')]({},_0x1c66d4,_0x21cca3[_0x294d('0x41')]);return db[_0x294d('0x55')][_0x294d('0x1a')]({'where':_0x1c66d4['where']})[_0x294d('0x21')](function(_0x2b207c){_0x3f60f0[_0x294d('0x1a')]=_0x2b207c;if(_0x21cca3[_0x294d('0x30')][_0x294d('0x42')]){_0x1c66d4[_0x294d('0x43')]=[{'all':!![]}];}return db[_0x294d('0x55')][_0x294d('0x44')](_0x1c66d4);})[_0x294d('0x21')](function(_0x3eac29){_0x3f60f0[_0x294d('0x56')]=_0x3eac29;return _0x3f60f0;});}})[_0x294d('0x21')](respondWithFilteredResult(_0x5bfcdc,_0x1c66d4))[_0x294d('0x45')](handleError(_0x5bfcdc,null));};exports[_0x294d('0x57')]=function(_0x165938,_0x1e8e65,_0x1783f6){var _0x15362c={'raw':!![],'where':{}};var _0x5ec37e={};var _0x196737={'count':0x0,'rows':[]};return db['Campaign'][_0x294d('0x58')]({'where':{'id':_0x165938[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x1e8e65,null))['then'](function(_0x2e9452){if(_0x2e9452){_0x5ec37e['model']=_[_0x294d('0x31')](db['CmHopperHistory'][_0x294d('0x2b')]);_0x5ec37e['query']=_[_0x294d('0x31')](_0x165938[_0x294d('0x30')]);_0x5ec37e[_0x294d('0x3c')]=_['intersection'](_0x5ec37e[_0x294d('0x2f')],_0x5ec37e[_0x294d('0x30')]);_0x15362c[_0x294d('0x33')]=_['intersection'](_0x5ec37e[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x165938[_0x294d('0x30')][_0x294d('0x34')]));_0x15362c['attributes']=_0x15362c[_0x294d('0x33')][_0x294d('0x35')]?_0x15362c[_0x294d('0x33')]:_0x5ec37e[_0x294d('0x2f')];if(!_0x165938[_0x294d('0x30')][_0x294d('0x36')]('nolimit')){_0x15362c['limit']=qs['limit'](_0x165938[_0x294d('0x30')][_0x294d('0x38')]);_0x15362c[_0x294d('0x1b')]=qs['offset'](_0x165938[_0x294d('0x30')][_0x294d('0x1b')]);}_0x15362c[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x165938['query'][_0x294d('0x3a')]);_0x15362c[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x165938[_0x294d('0x30')],_0x5ec37e['filters']));_0x15362c[_0x294d('0x3b')][_0x294d('0x59')]=_0x2e9452['id'];if(_0x165938[_0x294d('0x30')]['filter']){_0x15362c[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x15362c[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x15362c['attributes'],function(_0x56adee){var _0x17e34c={};_0x17e34c[_0x56adee]={'$like':'%'+_0x165938[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x17e34c;})});}_0x15362c=_[_0x294d('0x3f')]({},_0x15362c,_0x165938[_0x294d('0x41')]);return db[_0x294d('0x5a')][_0x294d('0x1a')]({'where':_0x15362c[_0x294d('0x3b')]})[_0x294d('0x21')](function(_0x4dbcad){_0x196737[_0x294d('0x1a')]=_0x4dbcad;if(_0x165938[_0x294d('0x30')][_0x294d('0x42')]){_0x15362c[_0x294d('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x294d('0x44')](_0x15362c);})[_0x294d('0x21')](function(_0x25b1db){_0x196737['rows']=_0x25b1db;return _0x196737;});}})['then'](respondWithFilteredResult(_0x1e8e65,_0x15362c))['catch'](handleError(_0x1e8e65,null));};exports[_0x294d('0x5b')]=function(_0x3bd118,_0x3191e0,_0x2a3267){var _0x1caa61={'raw':!![],'where':{}};var _0x2cbb35={};var _0x56920f={'count':0x0,'rows':[]};return db[_0x294d('0x2a')][_0x294d('0x58')]({'where':{'id':_0x3bd118[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x3191e0,null))[_0x294d('0x21')](function(_0x48dfe7){if(_0x48dfe7){_0x2cbb35[_0x294d('0x2f')]=_[_0x294d('0x31')](db[_0x294d('0x5c')][_0x294d('0x2b')]);_0x2cbb35['query']=_[_0x294d('0x31')](_0x3bd118[_0x294d('0x30')]);_0x2cbb35['filters']=_[_0x294d('0x32')](_0x2cbb35[_0x294d('0x2f')],_0x2cbb35[_0x294d('0x30')]);_0x1caa61[_0x294d('0x33')]=_[_0x294d('0x32')](_0x2cbb35['model'],qs[_0x294d('0x34')](_0x3bd118[_0x294d('0x30')][_0x294d('0x34')]));_0x1caa61[_0x294d('0x33')]=_0x1caa61[_0x294d('0x33')][_0x294d('0x35')]?_0x1caa61[_0x294d('0x33')]:_0x2cbb35[_0x294d('0x2f')];if(!_0x3bd118['query'][_0x294d('0x36')](_0x294d('0x37'))){_0x1caa61[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x3bd118[_0x294d('0x30')][_0x294d('0x38')]);_0x1caa61[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x3bd118['query']['offset']);}_0x1caa61[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x3bd118['query'][_0x294d('0x3a')]);_0x1caa61[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x3bd118[_0x294d('0x30')],_0x2cbb35[_0x294d('0x3c')]));_0x1caa61[_0x294d('0x3b')]['CampaignId']=_0x48dfe7['id'];if(_0x3bd118[_0x294d('0x30')]['filter']){_0x1caa61[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x1caa61[_0x294d('0x3b')],{'$or':_['map'](_0x1caa61['attributes'],function(_0xb1c4d8){var _0x193d98={};_0x193d98[_0xb1c4d8]={'$like':'%'+_0x3bd118[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x193d98;})});}_0x1caa61=_[_0x294d('0x3f')]({},_0x1caa61,_0x3bd118[_0x294d('0x41')]);return db[_0x294d('0x5c')][_0x294d('0x1a')]({'where':_0x1caa61[_0x294d('0x3b')]})['then'](function(_0x4d328f){_0x56920f[_0x294d('0x1a')]=_0x4d328f;if(_0x3bd118[_0x294d('0x30')][_0x294d('0x42')]){_0x1caa61[_0x294d('0x43')]=[{'all':!![]}];}return db[_0x294d('0x5c')][_0x294d('0x44')](_0x1caa61);})[_0x294d('0x21')](function(_0x57b374){_0x56920f[_0x294d('0x56')]=_0x57b374;return _0x56920f;});}})[_0x294d('0x21')](respondWithFilteredResult(_0x3191e0,_0x1caa61))[_0x294d('0x45')](handleError(_0x3191e0,null));};exports[_0x294d('0x5d')]=function(_0x46320c,_0x104a49,_0x299f2d){var _0x160b88={'raw':!![],'where':{}};var _0x19e89b={};var _0xa19451={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x46320c[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x104a49,null))[_0x294d('0x21')](function(_0x57229b){if(_0x57229b){_0x19e89b['model']=_['keys'](db[_0x294d('0x5e')][_0x294d('0x2b')]);_0x19e89b[_0x294d('0x30')]=_[_0x294d('0x31')](_0x46320c['query']);_0x19e89b[_0x294d('0x3c')]=_[_0x294d('0x32')](_0x19e89b[_0x294d('0x2f')],_0x19e89b[_0x294d('0x30')]);_0x160b88[_0x294d('0x33')]=_[_0x294d('0x32')](_0x19e89b[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x46320c[_0x294d('0x30')]['fields']));_0x160b88[_0x294d('0x33')]=_0x160b88[_0x294d('0x33')][_0x294d('0x35')]?_0x160b88['attributes']:_0x19e89b[_0x294d('0x2f')];if(!_0x46320c[_0x294d('0x30')][_0x294d('0x36')](_0x294d('0x37'))){_0x160b88[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x46320c[_0x294d('0x30')][_0x294d('0x38')]);_0x160b88[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x46320c[_0x294d('0x30')][_0x294d('0x1b')]);}_0x160b88[_0x294d('0x39')]=qs['sort'](_0x46320c['query'][_0x294d('0x3a')]);_0x160b88['where']=qs['filters'](_[_0x294d('0x3d')](_0x46320c[_0x294d('0x30')],_0x19e89b[_0x294d('0x3c')]));_0x160b88['where'][_0x294d('0x59')]=_0x57229b['id'];if(_0x46320c[_0x294d('0x30')][_0x294d('0x3e')]){_0x160b88[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x160b88[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x160b88[_0x294d('0x33')],function(_0x4a44f4){var _0xfd6c8b={};_0xfd6c8b[_0x4a44f4]={'$like':'%'+_0x46320c['query']['filter']+'%'};return _0xfd6c8b;})});}_0x160b88=_['merge']({},_0x160b88,_0x46320c[_0x294d('0x41')]);return db[_0x294d('0x5e')][_0x294d('0x1a')]({'where':_0x160b88['where']})[_0x294d('0x21')](function(_0x39ee25){_0xa19451[_0x294d('0x1a')]=_0x39ee25;if(_0x46320c['query'][_0x294d('0x42')]){_0x160b88['include']=[{'all':!![]}];}return db[_0x294d('0x5e')][_0x294d('0x44')](_0x160b88);})[_0x294d('0x21')](function(_0x4f30a5){_0xa19451['rows']=_0x4f30a5;return _0xa19451;});}})['then'](respondWithFilteredResult(_0x104a49,_0x160b88))[_0x294d('0x45')](handleError(_0x104a49,null));};exports['getLists']=function(_0x3c1572,_0xc1fa99,_0x50a35f){var _0x34825e={};var _0x54f363={};var _0x22db44;var _0x44100c;return db[_0x294d('0x2a')]['findOne']({'where':{'id':_0x3c1572[_0x294d('0x46')]['id']}})['then'](handleEntityNotFound(_0xc1fa99,null))[_0x294d('0x21')](function(_0x5456e9){if(_0x5456e9){_0x22db44=_0x5456e9;_0x54f363['model']=_['keys'](db[_0x294d('0x5f')]['rawAttributes']);_0x54f363[_0x294d('0x30')]=_[_0x294d('0x31')](_0x3c1572['query']);_0x54f363[_0x294d('0x3c')]=_[_0x294d('0x32')](_0x54f363[_0x294d('0x2f')],_0x54f363[_0x294d('0x30')]);_0x34825e[_0x294d('0x33')]=_['intersection'](_0x54f363[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x3c1572['query'][_0x294d('0x34')]));_0x34825e[_0x294d('0x33')]=_0x34825e[_0x294d('0x33')][_0x294d('0x35')]?_0x34825e['attributes']:_0x54f363['model'];_0x34825e[_0x294d('0x39')]=qs[_0x294d('0x3a')](_0x3c1572[_0x294d('0x30')][_0x294d('0x3a')]);_0x34825e[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x3c1572[_0x294d('0x30')],_0x54f363[_0x294d('0x3c')]));if(_0x3c1572[_0x294d('0x30')]['filter']){_0x34825e[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x34825e[_0x294d('0x3b')],{'$or':_[_0x294d('0x29')](_0x34825e['attributes'],function(_0xda4f28){var _0x38896e={};_0x38896e[_0xda4f28]={'$like':'%'+_0x3c1572[_0x294d('0x30')][_0x294d('0x3e')]+'%'};return _0x38896e;})});}_0x34825e=_[_0x294d('0x3f')]({},_0x34825e,_0x3c1572[_0x294d('0x41')]);return _0x22db44[_0x294d('0x60')](_0x34825e);}})[_0x294d('0x21')](function(_0x4bc498){if(_0x4bc498){_0x44100c=_0x4bc498['length'];if(!_0x3c1572[_0x294d('0x30')]['hasOwnProperty'](_0x294d('0x37'))){_0x34825e[_0x294d('0x38')]=qs['limit'](_0x3c1572[_0x294d('0x30')]['limit']);_0x34825e[_0x294d('0x1b')]=qs[_0x294d('0x1b')](_0x3c1572[_0x294d('0x30')]['offset']);}return _0x22db44[_0x294d('0x60')](_0x34825e);}})[_0x294d('0x21')](function(_0x4cd5f4){if(_0x4cd5f4){return _0x4cd5f4?{'count':_0x44100c,'rows':_0x4cd5f4}:null;}})['then'](respondWithResult(_0xc1fa99,null))[_0x294d('0x45')](handleError(_0xc1fa99,null));};exports[_0x294d('0x61')]=function(_0x55aebf,_0x2c62de,_0x55aafd){var _0x582bc0,_0x21c461;var _0x3bbb12=[];var _0xf4b124=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x294d('0x2a')][_0x294d('0x47')]({'where':{'id':_0x55aebf['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x2c62de,null))[_0x294d('0x21')](function(_0x2d1a9f){if(_0x2d1a9f){_0x21c461=_0x2d1a9f;return _0x2d1a9f[_0x294d('0x61')](_0x55aebf[_0x294d('0x49')]['ids'],_[_0x294d('0x52')](_0x55aebf[_0x294d('0x49')],[_0x294d('0x62'),'id'])||{});}return null;})['spread'](function(_0x54175c){var _0x3e347d;var _0x2715e2;_0x582bc0=_0x54175c||[];var _0xba8e14=[];if(_0x54175c){for(var _0x2e347a=0x0;_0x2e347a<_0x54175c['length'];_0x2e347a+=0x1){var _0x5f3d07=_0x54175c[_0x2e347a]['get']({'plain':!![]});_0x21c461[_0x294d('0x63')]=_0x55aebf[_0x294d('0x49')]['dialCheckDuplicateType']?_0x55aebf[_0x294d('0x49')][_0x294d('0x63')]:_0x21c461[_0x294d('0x63')];switch(_0x21c461[_0x294d('0x63')]){case _0x294d('0x64'):_0x3e347d=squel['insert']()['into'](_0x294d('0x65'))[_0x294d('0x66')](['phone',_0x294d('0x67'),_0x294d('0x68'),_0x294d('0x69'),_0x294d('0x59'),_0x294d('0x53'),_0x294d('0x54')],squel[_0x294d('0x6a')]()[_0x294d('0x6b')](_0x294d('0x6c'),'phone')[_0x294d('0x6b')](_0x294d('0x6d'),_0x294d('0x67'))[_0x294d('0x6b')]('id',_0x294d('0x68'))[_0x294d('0x6b')](_0x5f3d07[_0x294d('0x6e')][_0x294d('0x6f')](),_0x294d('0x69'))[_0x294d('0x6b')](_0x55aebf[_0x294d('0x46')]['id'][_0x294d('0x6f')](),_0x294d('0x59'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x53'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x54'))[_0x294d('0x70')](_0x294d('0x71'))['where']('deletedAt\x20IS\x20NULL')[_0x294d('0x3b')](_0x294d('0x72'),_0x5f3d07[_0x294d('0x6e')]['toString']())[_0x294d('0x3b')](_0x294d('0x73'))[_0x294d('0x3b')](_0x294d('0x74'),squel[_0x294d('0x6a')]()[_0x294d('0x6b')](_0x294d('0x75'))[_0x294d('0x70')](_0x294d('0x76'))[_0x294d('0x3b')](_0x294d('0x77'),_0x55aebf[_0x294d('0x46')]['id'][_0x294d('0x6f')]()))[_0x294d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x294d('0x6b')](_0x294d('0x78'))[_0x294d('0x70')](_0x294d('0x65'))['where'](_0x294d('0x77'),_0x55aebf[_0x294d('0x46')]['id'][_0x294d('0x6f')]())))[_0x294d('0x6f')]();break;case _0x294d('0x79'):_0x3e347d=squel[_0x294d('0x7a')]()[_0x294d('0x7b')](_0x294d('0x65'))[_0x294d('0x66')]([_0x294d('0x6c'),_0x294d('0x67'),_0x294d('0x68'),_0x294d('0x69'),_0x294d('0x59'),_0x294d('0x53'),_0x294d('0x54')],squel['select']()['field']('phone',_0x294d('0x6c'))[_0x294d('0x6b')]('NOW()','scheduledAt')[_0x294d('0x6b')]('id',_0x294d('0x68'))[_0x294d('0x6b')](_0x5f3d07['CmListId'][_0x294d('0x6f')](),_0x294d('0x69'))['field'](_0x55aebf[_0x294d('0x46')]['id'][_0x294d('0x6f')](),_0x294d('0x59'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x53'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x54'))[_0x294d('0x70')](_0x294d('0x71'))['where'](_0x294d('0x7c'))[_0x294d('0x3b')](_0x294d('0x72'),_0x5f3d07['CmListId'][_0x294d('0x6f')]())['where'](_0x294d('0x73'))[_0x294d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x294d('0x6a')]()[_0x294d('0x6b')](_0x294d('0x78'))[_0x294d('0x70')](_0x294d('0x65'))[_0x294d('0x3b')](_0x294d('0x77'),_0x55aebf[_0x294d('0x46')]['id']['toString']())))[_0x294d('0x6f')]();break;default:_0x3e347d=squel['insert']()['into'](_0x294d('0x65'))['fromQuery']([_0x294d('0x6c'),'scheduledAt',_0x294d('0x68'),_0x294d('0x69'),'CampaignId',_0x294d('0x53'),_0x294d('0x54')],squel[_0x294d('0x6a')]()['field'](_0x294d('0x6c'),_0x294d('0x6c'))['field'](_0x294d('0x6d'),_0x294d('0x67'))['field']('id','ContactId')[_0x294d('0x6b')](_0x5f3d07[_0x294d('0x6e')][_0x294d('0x6f')](),_0x294d('0x69'))['field'](_0x55aebf[_0x294d('0x46')]['id']['toString'](),'CampaignId')[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x53'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x54'))[_0x294d('0x70')](_0x294d('0x71'))[_0x294d('0x3b')](_0x294d('0x7c'))['where'](_0x294d('0x72'),_0x5f3d07[_0x294d('0x6e')][_0x294d('0x6f')]())[_0x294d('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x294d('0x6f')]();}_0x2715e2=squel['insert']()[_0x294d('0x7b')](_0x294d('0x7d'))['fromQuery']([_0x294d('0x7e'),_0x294d('0x67'),'phone',_0x294d('0x7f'),_0x294d('0x53'),_0x294d('0x54')],squel[_0x294d('0x6a')]()[_0x294d('0x6b')](_0x294d('0x80'),'id')[_0x294d('0x6b')](_0x294d('0x6d'),_0x294d('0x67'))['field'](_0x294d('0x81'),'phone')['field']('ci.OrderBY','OrderBy')['field']('\x27'+_0xf4b124+'\x27',_0x294d('0x53'))[_0x294d('0x6b')]('\x27'+_0xf4b124+'\x27',_0x294d('0x54'))['from'](_0x294d('0x82'),'ci')[_0x294d('0x83')](_0x294d('0x65'),'h',_0x294d('0x84'))[_0x294d('0x3b')](_0x294d('0x85'),_0x5f3d07[_0x294d('0x6e')][_0x294d('0x6f')]())[_0x294d('0x3b')]('h.CampaignId=?',_0x55aebf[_0x294d('0x46')]['id']['toString']())[_0x294d('0x3b')](_0x294d('0x86'),_0xf4b124))[_0x294d('0x6f')]();_0xba8e14[_0x294d('0x87')](db[_0x294d('0x88')][_0x294d('0x30')](_0x3e347d));_0x3bbb12['push'](db[_0x294d('0x88')]['query'](_0x2715e2));}return BPromise[_0x294d('0x89')](_0xba8e14);}})[_0x294d('0x21')](function(){return BPromise[_0x294d('0x89')](_0x3bbb12);})[_0x294d('0x21')](function(){return _0x582bc0;})[_0x294d('0x21')](respondWithResult(_0x2c62de,null))[_0x294d('0x45')](handleError(_0x2c62de,null));};exports[_0x294d('0x8a')]=function(_0x453dd7,_0x2e3672,_0x56a63e){return db['Campaign'][_0x294d('0x47')]({'where':{'id':_0x453dd7[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x2e3672,null))[_0x294d('0x21')](function(_0x367593){if(_0x367593){return _0x367593['removeLists'](_0x453dd7[_0x294d('0x30')]['ids']);}})[_0x294d('0x21')](function(_0x62cb6f){if(_0x62cb6f){return db[_0x294d('0x55')][_0x294d('0x22')]({'where':{'ListId':_0x453dd7[_0x294d('0x30')]['ids'],'CampaignId':_0x453dd7[_0x294d('0x46')]['id']}})['then'](function(){return _0x62cb6f;});}})[_0x294d('0x21')](respondWithStatusCode(_0x2e3672,null))['catch'](handleError(_0x2e3672,null));};exports['getBlackLists']=function(_0x5daec9,_0x37c592,_0x6bb66e){var _0x41b74b={};var _0x1913d4={};var _0x38d137;var _0x43ac59;return db[_0x294d('0x2a')][_0x294d('0x58')]({'where':{'id':_0x5daec9[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x37c592,null))[_0x294d('0x21')](function(_0x255b69){if(_0x255b69){_0x38d137=_0x255b69;_0x1913d4['model']=_[_0x294d('0x31')](db[_0x294d('0x5f')]['rawAttributes']);_0x1913d4[_0x294d('0x30')]=_[_0x294d('0x31')](_0x5daec9[_0x294d('0x30')]);_0x1913d4[_0x294d('0x3c')]=_[_0x294d('0x32')](_0x1913d4['model'],_0x1913d4['query']);_0x41b74b[_0x294d('0x33')]=_[_0x294d('0x32')](_0x1913d4[_0x294d('0x2f')],qs[_0x294d('0x34')](_0x5daec9[_0x294d('0x30')][_0x294d('0x34')]));_0x41b74b[_0x294d('0x33')]=_0x41b74b[_0x294d('0x33')][_0x294d('0x35')]?_0x41b74b[_0x294d('0x33')]:_0x1913d4[_0x294d('0x2f')];_0x41b74b['order']=qs[_0x294d('0x3a')](_0x5daec9[_0x294d('0x30')][_0x294d('0x3a')]);_0x41b74b[_0x294d('0x3b')]=qs[_0x294d('0x3c')](_[_0x294d('0x3d')](_0x5daec9['query'],_0x1913d4[_0x294d('0x3c')]));if(_0x5daec9['query'][_0x294d('0x3e')]){_0x41b74b[_0x294d('0x3b')]=_[_0x294d('0x3f')](_0x41b74b['where'],{'$or':_[_0x294d('0x29')](_0x41b74b[_0x294d('0x33')],function(_0x2cf58e){var _0x3ce06f={};_0x3ce06f[_0x2cf58e]={'$like':'%'+_0x5daec9[_0x294d('0x30')]['filter']+'%'};return _0x3ce06f;})});}_0x41b74b=_[_0x294d('0x3f')]({},_0x41b74b,_0x5daec9['options']);return _0x38d137[_0x294d('0x8b')](_0x41b74b);}})[_0x294d('0x21')](function(_0x5d2f16){if(_0x5d2f16){_0x43ac59=_0x5d2f16[_0x294d('0x35')];if(!_0x5daec9['query'][_0x294d('0x36')]('nolimit')){_0x41b74b[_0x294d('0x38')]=qs[_0x294d('0x38')](_0x5daec9['query'][_0x294d('0x38')]);_0x41b74b[_0x294d('0x1b')]=qs['offset'](_0x5daec9[_0x294d('0x30')][_0x294d('0x1b')]);}return _0x38d137[_0x294d('0x8b')](_0x41b74b);}})[_0x294d('0x21')](function(_0x13d552){if(_0x13d552){return _0x13d552?{'count':_0x43ac59,'rows':_0x13d552}:null;}})['then'](respondWithResult(_0x37c592,null))[_0x294d('0x45')](handleError(_0x37c592,null));};exports[_0x294d('0x8c')]=function(_0x286821,_0x589dfb,_0x556905){var _0x1139a3,_0x58c704;var _0x362363=[];var _0x52af8a=moment()[_0x294d('0x8d')](_0x294d('0x8e'));return db[_0x294d('0x2a')]['find']({'where':{'id':_0x286821['params']['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x589dfb,null))[_0x294d('0x21')](function(_0x3b6df3){if(_0x3b6df3){_0x58c704=_0x3b6df3;return _0x3b6df3[_0x294d('0x8c')](_0x286821[_0x294d('0x49')][_0x294d('0x62')],_[_0x294d('0x52')](_0x286821[_0x294d('0x49')],[_0x294d('0x62'),'id'])||{});}return null;})['spread'](function(_0xf41de7){var _0x27ae41;var _0x33d377;_0x1139a3=_0xf41de7||[];var _0x6025bf=[];if(_0xf41de7){for(var _0x3a32a1=0x0;_0x3a32a1<_0xf41de7[_0x294d('0x35')];_0x3a32a1+=0x1){var _0x3f7738=_0xf41de7[_0x3a32a1][_0x294d('0x23')]({'plain':!![]});_0x27ae41=squel[_0x294d('0x7a')]()[_0x294d('0x7b')](_0x294d('0x8f'))[_0x294d('0x66')]([_0x294d('0x6c'),_0x294d('0x68'),_0x294d('0x69'),_0x294d('0x59'),_0x294d('0x53'),_0x294d('0x54')],squel[_0x294d('0x6a')]()[_0x294d('0x6b')](_0x294d('0x6c'),_0x294d('0x6c'))['field']('id',_0x294d('0x68'))[_0x294d('0x6b')](_0x3f7738[_0x294d('0x6e')][_0x294d('0x6f')](),'ListId')[_0x294d('0x6b')](_0x286821['params']['id'][_0x294d('0x6f')](),'CampaignId')[_0x294d('0x6b')](_0x294d('0x6d'),_0x294d('0x53'))[_0x294d('0x6b')]('NOW()',_0x294d('0x54'))[_0x294d('0x70')](_0x294d('0x71'))[_0x294d('0x3b')](_0x294d('0x7c'))[_0x294d('0x3b')](_0x294d('0x72'),_0x3f7738[_0x294d('0x6e')][_0x294d('0x6f')]())[_0x294d('0x3b')](_0x294d('0x73')))[_0x294d('0x6f')]();_0x6025bf[_0x294d('0x87')](db[_0x294d('0x88')][_0x294d('0x30')](_0x27ae41));}return BPromise[_0x294d('0x89')](_0x6025bf);}})[_0x294d('0x21')](function(){return _0x1139a3;})[_0x294d('0x21')](respondWithResult(_0x589dfb,null))[_0x294d('0x45')](handleError(_0x589dfb,null));};exports['removeBlackLists']=function(_0x4c4e30,_0x371866,_0x101a86){return db['Campaign'][_0x294d('0x47')]({'where':{'id':_0x4c4e30[_0x294d('0x46')]['id']}})[_0x294d('0x21')](handleEntityNotFound(_0x371866,null))[_0x294d('0x21')](function(_0x2fcb95){if(_0x2fcb95){return _0x2fcb95[_0x294d('0x90')](_0x4c4e30[_0x294d('0x30')][_0x294d('0x62')]);}})[_0x294d('0x21')](function(_0xf937c2){if(_0xf937c2){return db[_0x294d('0x5e')][_0x294d('0x22')]({'where':{'ListId':_0x4c4e30[_0x294d('0x30')][_0x294d('0x62')],'CampaignId':_0x4c4e30['params']['id']}})[_0x294d('0x21')](function(){return _0xf937c2;});}})[_0x294d('0x21')](respondWithStatusCode(_0x371866,null))[_0x294d('0x45')](handleError(_0x371866,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 0245ec9..b16d4e3 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x556d11,_0xa8cb9){var _0x144975=function(_0x1c2f08){while(--_0x1c2f08){_0x556d11['push'](_0x556d11['shift']());}};_0x144975(++_0xa8cb9);}(_0x7a54,0x106));var _0x47a5=function(_0x50c1a8,_0x3e601d){_0x50c1a8=_0x50c1a8-0x0;var _0x257fa0=_0x7a54[_0x50c1a8];return _0x257fa0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x240ad5,_0x5e125b){var _0x9cc8f5=function(_0x1e376e){while(--_0x1e376e){_0x240ad5['push'](_0x240ad5['shift']());}};_0x9cc8f5(++_0x5e125b);}(_0x7a54,0x106));var _0x47a5=function(_0x5bdde3,_0x4b134f){_0x5bdde3=_0x5bdde3-0x0;var _0xbe9b3f=_0x7a54[_0x5bdde3];return _0xbe9b3f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index fcf288d..86e8572 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 _0x9ef8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','debug','lodash'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x9ef8,0x17f));var _0x89ef=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x9ef8[_0xc7348b];return _0x307cec;};'use strict';var _=require(_0x89ef('0x0'));var util=require(_0x89ef('0x1'));var moment=require('moment');var BPromise=require(_0x89ef('0x2'));var rs=require(_0x89ef('0x3'));var fs=require('fs');var Redis=require(_0x89ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ef('0x5'));var logger=require(_0x89ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x89ef('0x7')][_0x89ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24439e,_0x90b5bf,_0x46c0da){return new BPromise(function(_0x373288,_0x16e8c3){return client[_0x89ef('0x9')](_0x24439e,_0x46c0da)[_0x89ef('0xa')](function(_0x5683b6){logger[_0x89ef('0xb')](_0x89ef('0xc'),_0x90b5bf,_0x89ef('0xd'));logger['debug'](_0x89ef('0xe'),_0x90b5bf,_0x89ef('0xd'),JSON[_0x89ef('0xf')](_0x5683b6));if(_0x5683b6[_0x89ef('0x10')]){if(_0x5683b6[_0x89ef('0x10')]['code']===0x1f4){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x16e8c3(_0x5683b6['error'][_0x89ef('0x11')]);}logger[_0x89ef('0x10')](_0x89ef('0xc'),_0x90b5bf,_0x5683b6[_0x89ef('0x10')][_0x89ef('0x11')]);return _0x373288(_0x5683b6['error'][_0x89ef('0x11')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x89ef('0xd'));_0x373288(_0x5683b6[_0x89ef('0x12')]['message']);}})[_0x89ef('0x13')](function(_0x490877){logger[_0x89ef('0x10')]('Campaign,\x20%s,\x20%s',_0x90b5bf,_0x490877);_0x16e8c3(_0x490877);});});}exports[_0x89ef('0x14')]=function(_0x2c5f51){var _0x2aa140=this;return new Promise(function(_0x1189d7,_0x5e3aed){return db[_0x89ef('0x15')][_0x89ef('0x16')]({'raw':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x18')]===undefined?!![]:![]:!![],'where':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x19')]||null:null,'attributes':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1a')]||null:null,'limit':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1b')]||null:null,'include':_0x2c5f51[_0x89ef('0x17')]?_0x2c5f51[_0x89ef('0x17')][_0x89ef('0x1c')]?_['map'](_0x2c5f51['options']['include'],function(_0x5c9242){return{'model':db[_0x5c9242[_0x89ef('0x1d')]],'as':_0x5c9242['as'],'attributes':_0x5c9242[_0x89ef('0x1a')],'include':_0x5c9242['include']?_['map'](_0x5c9242[_0x89ef('0x1c')],function(_0x10bb22){return{'model':db[_0x10bb22['model']],'as':_0x10bb22['as'],'attributes':_0x10bb22['attributes'],'include':_0x10bb22[_0x89ef('0x1c')]?_[_0x89ef('0x1e')](_0x10bb22[_0x89ef('0x1c')],function(_0x3efb34){return{'model':db[_0x3efb34[_0x89ef('0x1d')]],'as':_0x3efb34['as'],'attributes':_0x3efb34[_0x89ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x89ef('0xa')](function(_0x5e8108){logger[_0x89ef('0xb')](_0x89ef('0x14'),_0x2c5f51);logger[_0x89ef('0x1f')](_0x89ef('0x14'),_0x2c5f51,JSON['stringify'](_0x5e8108));_0x1189d7(_0x5e8108);})['catch'](function(_0x51245a){logger[_0x89ef('0x10')](_0x89ef('0x14'),_0x51245a['message'],_0x2c5f51);_0x5e3aed(_0x2aa140[_0x89ef('0x10')](0x1f4,_0x51245a[_0x89ef('0x11')]));});});}; \ No newline at end of file +var _0x55e0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird'];(function(_0x237eca,_0x23ab86){var _0x5a89d2=function(_0x200c97){while(--_0x200c97){_0x237eca['push'](_0x237eca['shift']());}};_0x5a89d2(++_0x23ab86);}(_0x55e0,0xdc));var _0x055e=function(_0x4895f0,_0x5fb03d){_0x4895f0=_0x4895f0-0x0;var _0x427a47=_0x55e0[_0x4895f0];return _0x427a47;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});}exports[_0x055e('0x16')]=function(_0x4c85dd){var _0x36ef10=this;return new Promise(function(_0x2cf3de,_0x2f4a06){return db[_0x055e('0x17')]['findAll']({'raw':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x19')]||null:null,'attributes':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1a')]||null:null,'limit':_0x4c85dd['options']?_0x4c85dd[_0x055e('0x18')][_0x055e('0x1b')]||null:null,'include':_0x4c85dd[_0x055e('0x18')]?_0x4c85dd['options'][_0x055e('0x1c')]?_[_0x055e('0x1d')](_0x4c85dd[_0x055e('0x18')][_0x055e('0x1c')],function(_0x51df23){return{'model':db[_0x51df23[_0x055e('0x1e')]],'as':_0x51df23['as'],'attributes':_0x51df23['attributes'],'include':_0x51df23[_0x055e('0x1c')]?_[_0x055e('0x1d')](_0x51df23[_0x055e('0x1c')],function(_0x1a76c6){return{'model':db[_0x1a76c6[_0x055e('0x1e')]],'as':_0x1a76c6['as'],'attributes':_0x1a76c6[_0x055e('0x1a')],'include':_0x1a76c6['include']?_[_0x055e('0x1d')](_0x1a76c6[_0x055e('0x1c')],function(_0x2a82f8){return{'model':db[_0x2a82f8['model']],'as':_0x2a82f8['as'],'attributes':_0x2a82f8[_0x055e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x055e('0xb')](function(_0x42f2df){logger[_0x055e('0xc')]('GetCampaign',_0x4c85dd);logger[_0x055e('0xf')]('GetCampaign',_0x4c85dd,JSON[_0x055e('0x1f')](_0x42f2df));_0x2cf3de(_0x42f2df);})[_0x055e('0x15')](function(_0x23a506){logger[_0x055e('0x11')](_0x055e('0x16'),_0x23a506['message'],_0x4c85dd);_0x2f4a06(_0x36ef10[_0x055e('0x11')](0x1f4,_0x23a506[_0x055e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e87baf2..df0d0f0 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 _0x4676=['isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','clone','addBlackLists','update','delete','destroy','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','/:id/hoppers'];(function(_0x4eb770,_0x4d318e){var _0x353fac=function(_0x4b6c77){while(--_0x4b6c77){_0x4eb770['push'](_0x4eb770['shift']());}};_0x353fac(++_0x4d318e);}(_0x4676,0x1e4));var _0x6467=function(_0x575b1e,_0x50c2b1){_0x575b1e=_0x575b1e-0x0;var _0x55e4f2=_0x4676[_0x575b1e];return _0x55e4f2;};'use strict';var multer=require(_0x6467('0x0'));var util=require('util');var path=require(_0x6467('0x1'));var timeout=require(_0x6467('0x2'));var express=require(_0x6467('0x3'));var router=express[_0x6467('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6467('0x5'));var interaction=require(_0x6467('0x6'));var config=require(_0x6467('0x7'));var controller=require(_0x6467('0x8'));router[_0x6467('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6467('0x9')](_0x6467('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6467('0x9')](_0x6467('0xb'),auth[_0x6467('0xc')](),controller[_0x6467('0xd')]);router[_0x6467('0x9')]('/:id/hopper_histories',auth[_0x6467('0xc')](),controller[_0x6467('0xe')]);router[_0x6467('0x9')](_0x6467('0xf'),auth[_0x6467('0xc')](),controller[_0x6467('0x10')]);router[_0x6467('0x9')](_0x6467('0x11'),auth[_0x6467('0xc')](),controller[_0x6467('0x12')]);router[_0x6467('0x9')](_0x6467('0x13'),auth[_0x6467('0xc')](),controller[_0x6467('0x14')]);router[_0x6467('0x9')](_0x6467('0x15'),auth[_0x6467('0xc')](),controller['getBlackLists']);router[_0x6467('0x16')]('/',auth[_0x6467('0xc')](),controller[_0x6467('0x17')]);router[_0x6467('0x16')]('/:id/clone',auth[_0x6467('0xc')](),controller[_0x6467('0x18')]);router[_0x6467('0x16')](_0x6467('0x13'),auth['isAuthenticated'](),controller['addLists']);router[_0x6467('0x16')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x6467('0x19')]);router['put']('/:id',auth[_0x6467('0xc')](),controller[_0x6467('0x1a')]);router[_0x6467('0x1b')](_0x6467('0xa'),auth['isAuthenticated'](),controller[_0x6467('0x1c')]);router[_0x6467('0x1b')]('/:id/lists',auth[_0x6467('0xc')](),controller['removeLists']);router[_0x6467('0x1b')](_0x6467('0x15'),auth[_0x6467('0xc')](),controller[_0x6467('0x1d')]);module[_0x6467('0x1e')]=router; \ No newline at end of file +var _0xb01a=['/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addBlackLists','put','/:id','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','show'];(function(_0x351290,_0x2b09f4){var _0x496a7c=function(_0x5c781f){while(--_0x5c781f){_0x351290['push'](_0x351290['shift']());}};_0x496a7c(++_0x2b09f4);}(_0xb01a,0xe0));var _0xab01=function(_0x4bee2,_0x25edd6){_0x4bee2=_0x4bee2-0x0;var _0xaaa997=_0xb01a[_0x4bee2];return _0xaaa997;};'use strict';var multer=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var path=require(_0xab01('0x2'));var timeout=require(_0xab01('0x3'));var express=require(_0xab01('0x4'));var router=express[_0xab01('0x5')]();var fs_extra=require(_0xab01('0x6'));var auth=require(_0xab01('0x7'));var interaction=require(_0xab01('0x8'));var config=require(_0xab01('0x9'));var controller=require(_0xab01('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab01('0xb')]('/:id',auth[_0xab01('0xc')](),controller[_0xab01('0xd')]);router[_0xab01('0xb')](_0xab01('0xe'),auth[_0xab01('0xc')](),controller['getHoppers']);router[_0xab01('0xb')](_0xab01('0xf'),auth[_0xab01('0xc')](),controller[_0xab01('0x10')]);router[_0xab01('0xb')](_0xab01('0x11'),auth['isAuthenticated'](),controller[_0xab01('0x12')]);router['get'](_0xab01('0x13'),auth[_0xab01('0xc')](),controller[_0xab01('0x14')]);router[_0xab01('0xb')](_0xab01('0x15'),auth[_0xab01('0xc')](),controller[_0xab01('0x16')]);router['get'](_0xab01('0x17'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xab01('0x18')]('/',auth[_0xab01('0xc')](),controller[_0xab01('0x19')]);router['post'](_0xab01('0x1a'),auth[_0xab01('0xc')](),controller['clone']);router[_0xab01('0x18')]('/:id/lists',auth[_0xab01('0xc')](),controller['addLists']);router[_0xab01('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xab01('0x1b')]);router[_0xab01('0x1c')](_0xab01('0x1d'),auth['isAuthenticated'](),controller['update']);router[_0xab01('0x1e')](_0xab01('0x1d'),auth['isAuthenticated'](),controller[_0xab01('0x1f')]);router[_0xab01('0x1e')](_0xab01('0x15'),auth[_0xab01('0xc')](),controller['removeLists']);router[_0xab01('0x1e')](_0xab01('0x17'),auth[_0xab01('0xc')](),controller[_0xab01('0x20')]);module[_0xab01('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 0e93d03..e99b334 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 _0xb092=['exports','TEXT','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x39c684,_0x1e0093){var _0x3da800=function(_0x2ac946){while(--_0x2ac946){_0x39c684['push'](_0x39c684['shift']());}};_0x3da800(++_0x1e0093);}(_0xb092,0x11e));var _0x2b09=function(_0x11520a,_0x29c546){_0x11520a=_0x11520a-0x0;var _0x430b0b=_0xb092[_0x11520a];return _0x430b0b;};'use strict';var Sequelize=require(_0x2b09('0x0'));module[_0x2b09('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2b09('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2b09('0x3')]},'name':{'type':Sequelize[_0x2b09('0x4')],'get':function(){return this[_0x2b09('0x5')](_0x2b09('0x6'));}}}; \ No newline at end of file +var _0xb84b=['getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x104a66,_0x1deeab){var _0x3c3c76=function(_0x3beb9f){while(--_0x3beb9f){_0x104a66['push'](_0x104a66['shift']());}};_0x3c3c76(++_0x1deeab);}(_0xb84b,0x191));var _0xbb84=function(_0x41801f,_0x348c7a){_0x41801f=_0x41801f-0x0;var _0xb3d2ec=_0xb84b[_0x41801f];return _0xb3d2ec;};'use strict';var Sequelize=require(_0xbb84('0x0'));module[_0xbb84('0x1')]={'key':{'type':Sequelize[_0xbb84('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xbb84('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbb84('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index a921cc7..cc53182 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 _0x3700=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','catch','show','length','includeAll','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CannedAnswers','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x21be47,_0x1edbe3){var _0x5088e=function(_0x4570b0){while(--_0x4570b0){_0x21be47['push'](_0x21be47['shift']());}};_0x5088e(++_0x1edbe3);}(_0x3700,0x185));var _0x0370=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x3700[_0x12b83d];return _0x1fd39d;};'use strict';var emlformat=require(_0x0370('0x0'));var rimraf=require(_0x0370('0x1'));var zipdir=require(_0x0370('0x2'));var jsonpatch=require(_0x0370('0x3'));var rp=require(_0x0370('0x4'));var moment=require(_0x0370('0x5'));var BPromise=require(_0x0370('0x6'));var Mustache=require(_0x0370('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0370('0x8'));var csv=require('to-csv');var ejs=require(_0x0370('0x9'));var fs=require('fs');var fs_extra=require(_0x0370('0xa'));var _=require(_0x0370('0xb'));var squel=require(_0x0370('0xc'));var crypto=require(_0x0370('0xd'));var jsforce=require(_0x0370('0xe'));var deskjs=require(_0x0370('0xf'));var toCsv=require(_0x0370('0x10'));var querystring=require('querystring');var Papa=require(_0x0370('0x11'));var Redis=require(_0x0370('0x12'));var authService=require(_0x0370('0x13'));var qs=require(_0x0370('0x14'));var as=require(_0x0370('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0370('0x16'))(_0x0370('0x17'));var utils=require(_0x0370('0x18'));var config=require(_0x0370('0x19'));var licenseUtil=require(_0x0370('0x1a'));var db=require(_0x0370('0x1b'))['db'];function respondWithStatusCode(_0x472803,_0x1711b9){_0x1711b9=_0x1711b9||0xcc;return function(_0x580e50){if(_0x580e50){return _0x472803[_0x0370('0x1c')](_0x1711b9);}return _0x472803[_0x0370('0x1d')](_0x1711b9)[_0x0370('0x1e')]();};}function respondWithResult(_0x4106d6,_0x3adbd9){_0x3adbd9=_0x3adbd9||0xc8;return function(_0x3ab6ca){if(_0x3ab6ca){return _0x4106d6[_0x0370('0x1d')](_0x3adbd9)['json'](_0x3ab6ca);}};}function respondWithFilteredResult(_0x492134,_0x37fea6){return function(_0x2f6a0b){if(_0x2f6a0b){var _0x2fc73d=typeof _0x37fea6['offset']===_0x0370('0x1f')&&typeof _0x37fea6[_0x0370('0x20')]===_0x0370('0x1f');var _0x2b8539=_0x2f6a0b['count'];var _0x132534=_0x2fc73d?0x0:_0x37fea6[_0x0370('0x21')];var _0x5816f9=_0x2fc73d?_0x2f6a0b[_0x0370('0x22')]:_0x37fea6[_0x0370('0x21')]+_0x37fea6[_0x0370('0x20')];var _0x4d31d6;if(_0x5816f9>=_0x2b8539){_0x5816f9=_0x2b8539;_0x4d31d6=0xc8;}else{_0x4d31d6=0xce;}_0x492134['status'](_0x4d31d6);return _0x492134[_0x0370('0x23')](_0x0370('0x24'),_0x132534+'-'+_0x5816f9+'/'+_0x2b8539)[_0x0370('0x25')](_0x2f6a0b);}return null;};}function patchUpdates(_0x355f1b){return function(_0x4e5b29){try{jsonpatch['apply'](_0x4e5b29,_0x355f1b,!![]);}catch(_0x1dfc25){return BPromise[_0x0370('0x26')](_0x1dfc25);}return _0x4e5b29[_0x0370('0x27')]();};}function saveUpdates(_0x50f711,_0x3c79b0){return function(_0x1266c1){if(_0x1266c1){return _0x1266c1[_0x0370('0x28')](_0x50f711)[_0x0370('0x29')](function(_0x4b4f2f){return _0x4b4f2f;});}return null;};}function removeEntity(_0x12033f,_0x23e971){return function(_0x2c9cd4){if(_0x2c9cd4){return _0x2c9cd4[_0x0370('0x2a')]()[_0x0370('0x29')](function(){var _0x2f8c17=_0x2c9cd4[_0x0370('0x2b')]({'plain':!![]});var _0x1cfdb4='CannedAnswers';return db[_0x0370('0x2c')][_0x0370('0x2a')]({'where':{'type':_0x1cfdb4,'resourceId':_0x2f8c17['id']}})[_0x0370('0x29')](function(){return _0x2c9cd4;});})[_0x0370('0x29')](function(){_0x12033f[_0x0370('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1954e9,_0x22cfd3){return function(_0x2f9bde){if(!_0x2f9bde){_0x1954e9[_0x0370('0x1c')](0x194);}return _0x2f9bde;};}function handleError(_0x23499a,_0x29281e){_0x29281e=_0x29281e||0x1f4;return function(_0x4b4446){logger['error'](_0x4b4446[_0x0370('0x2d')]);if(_0x4b4446[_0x0370('0x2e')]){delete _0x4b4446[_0x0370('0x2e')];}_0x23499a['status'](_0x29281e)[_0x0370('0x2f')](_0x4b4446);};}exports[_0x0370('0x30')]=function(_0x1e7f50,_0x12e46c){var _0x2a6b72={},_0x11276e={},_0x1bab1b={'count':0x0,'rows':[]};var _0x41083a=_['map'](db[_0x0370('0x31')][_0x0370('0x32')],function(_0x44ace5){return{'name':_0x44ace5[_0x0370('0x33')],'type':_0x44ace5[_0x0370('0x34')][_0x0370('0x35')]};});_0x11276e[_0x0370('0x36')]=_[_0x0370('0x37')](_0x41083a,_0x0370('0x2e'));_0x11276e[_0x0370('0x38')]=_[_0x0370('0x39')](_0x1e7f50[_0x0370('0x38')]);_0x11276e[_0x0370('0x3a')]=_[_0x0370('0x3b')](_0x11276e[_0x0370('0x36')],_0x11276e[_0x0370('0x38')]);_0x2a6b72[_0x0370('0x3c')]=_[_0x0370('0x3b')](_0x11276e[_0x0370('0x36')],qs[_0x0370('0x3d')](_0x1e7f50[_0x0370('0x38')][_0x0370('0x3d')]));_0x2a6b72[_0x0370('0x3c')]=_0x2a6b72[_0x0370('0x3c')]['length']?_0x2a6b72['attributes']:_0x11276e[_0x0370('0x36')];if(!_0x1e7f50[_0x0370('0x38')][_0x0370('0x3e')](_0x0370('0x3f'))){_0x2a6b72[_0x0370('0x20')]=qs[_0x0370('0x20')](_0x1e7f50[_0x0370('0x38')]['limit']);_0x2a6b72[_0x0370('0x21')]=qs[_0x0370('0x21')](_0x1e7f50['query'][_0x0370('0x21')]);}_0x2a6b72[_0x0370('0x40')]=qs[_0x0370('0x41')](_0x1e7f50[_0x0370('0x38')][_0x0370('0x41')]);_0x2a6b72[_0x0370('0x42')]=qs[_0x0370('0x3a')](_[_0x0370('0x43')](_0x1e7f50[_0x0370('0x38')],_0x11276e[_0x0370('0x3a')]),_0x41083a);if(_0x1e7f50[_0x0370('0x38')][_0x0370('0x44')]){_0x2a6b72[_0x0370('0x42')]=_['merge'](_0x2a6b72[_0x0370('0x42')],{'$or':[{'key':{'$like':'%'+_0x1e7f50[_0x0370('0x38')][_0x0370('0x44')]+'%'}},{'value':{'$like':'%'+_0x1e7f50[_0x0370('0x38')][_0x0370('0x44')]+'%'}}]});}_0x2a6b72=_['merge']({},_0x2a6b72,_0x1e7f50[_0x0370('0x45')]);var _0x101c96={'where':_0x2a6b72['where']};return db[_0x0370('0x31')][_0x0370('0x22')](_0x101c96)[_0x0370('0x29')](function(_0x252a69){_0x1bab1b[_0x0370('0x22')]=_0x252a69;if(_0x1e7f50[_0x0370('0x38')]['includeAll']){_0x2a6b72[_0x0370('0x46')]=[{'all':!![]}];}return db[_0x0370('0x31')]['findAll'](_0x2a6b72);})[_0x0370('0x29')](function(_0x1f0efd){_0x1bab1b['rows']=_0x1f0efd;return _0x1bab1b;})[_0x0370('0x29')](respondWithFilteredResult(_0x12e46c,_0x2a6b72))[_0x0370('0x47')](handleError(_0x12e46c,null));};exports[_0x0370('0x48')]=function(_0xd7158f,_0x40e636){var _0xbb724a={'raw':!![],'where':{'id':_0xd7158f['params']['id']}},_0x2c9780={};_0x2c9780['model']=_[_0x0370('0x39')](db[_0x0370('0x31')][_0x0370('0x32')]);_0x2c9780['query']=_[_0x0370('0x39')](_0xd7158f['query']);_0x2c9780[_0x0370('0x3a')]=_[_0x0370('0x3b')](_0x2c9780[_0x0370('0x36')],_0x2c9780[_0x0370('0x38')]);_0xbb724a['attributes']=_[_0x0370('0x3b')](_0x2c9780[_0x0370('0x36')],qs[_0x0370('0x3d')](_0xd7158f['query'][_0x0370('0x3d')]));_0xbb724a[_0x0370('0x3c')]=_0xbb724a[_0x0370('0x3c')][_0x0370('0x49')]?_0xbb724a[_0x0370('0x3c')]:_0x2c9780['model'];if(_0xd7158f[_0x0370('0x38')][_0x0370('0x4a')]){_0xbb724a[_0x0370('0x46')]=[{'all':!![]}];}_0xbb724a=_['merge']({},_0xbb724a,_0xd7158f[_0x0370('0x45')]);return db[_0x0370('0x31')][_0x0370('0x4b')](_0xbb724a)['then'](handleEntityNotFound(_0x40e636,null))[_0x0370('0x29')](respondWithResult(_0x40e636,null))[_0x0370('0x47')](handleError(_0x40e636,null));};exports[_0x0370('0x28')]=function(_0x54e5e0,_0x2e060d){if(_0x54e5e0['body']['id']){delete _0x54e5e0[_0x0370('0x4c')]['id'];}return db[_0x0370('0x31')][_0x0370('0x4b')]({'where':{'id':_0x54e5e0[_0x0370('0x4d')]['id']}})[_0x0370('0x29')](handleEntityNotFound(_0x2e060d,null))[_0x0370('0x29')](saveUpdates(_0x54e5e0['body'],null))[_0x0370('0x29')](respondWithResult(_0x2e060d,null))['catch'](handleError(_0x2e060d,null));};exports['destroy']=function(_0x16aeea,_0xdfb1f8){return db[_0x0370('0x31')]['find']({'where':{'id':_0x16aeea[_0x0370('0x4d')]['id']}})[_0x0370('0x29')](handleEntityNotFound(_0xdfb1f8,null))[_0x0370('0x29')](removeEntity(_0xdfb1f8,null))[_0x0370('0x47')](handleError(_0xdfb1f8,null));};exports[_0x0370('0x4e')]=function(_0x13f963,_0x4e0c9f){var _0x4c96dd={'key':_0x13f963[_0x0370('0x4c')][_0x0370('0x35')]};if(_0x13f963[_0x0370('0x4c')]['MailAccountId']){_0x4c96dd['MailAccountId']=_0x13f963[_0x0370('0x4c')][_0x0370('0x4f')];}else if(_0x13f963[_0x0370('0x4c')][_0x0370('0x50')]){_0x4c96dd[_0x0370('0x50')]=_0x13f963[_0x0370('0x4c')][_0x0370('0x50')];}else if(_0x13f963[_0x0370('0x4c')][_0x0370('0x51')]){_0x4c96dd['OpenchannelAccountId']=_0x13f963[_0x0370('0x4c')][_0x0370('0x51')];}else if(_0x13f963['body'][_0x0370('0x52')]){_0x4c96dd[_0x0370('0x52')]=_0x13f963[_0x0370('0x4c')]['ChatWebsiteId'];}return db[_0x0370('0x31')]['find']({'where':_0x4c96dd})[_0x0370('0x29')](function(_0x5a3ac8){if(_0x5a3ac8){throw new db['Sequelize'][(_0x0370('0x53'))](_0x0370('0x54'));}return db[_0x0370('0x31')][_0x0370('0x4e')](_0x13f963[_0x0370('0x4c')]);})['then'](function(_0x4b66be){var _0x4db758=_0x13f963[_0x0370('0x55')]['get']({'plain':!![]});if(!_0x4db758)throw new Error(_0x0370('0x56'));if(_0x4db758['role']===_0x0370('0x55')){var _0x3198f4=_0x4b66be[_0x0370('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0x0370('0x4b')]({'where':{'name':_0x0370('0x57'),'userProfileId':_0x4db758[_0x0370('0x58')]},'raw':!![]})[_0x0370('0x29')](function(_0xf4c679){if(_0xf4c679&&_0xf4c679['autoAssociation']===0x0){return db[_0x0370('0x2c')][_0x0370('0x4e')]({'name':_0x3198f4['name'],'resourceId':_0x3198f4['id'],'type':_0xf4c679['name'],'sectionId':_0xf4c679['id']},{})[_0x0370('0x29')](function(){return _0x4b66be;});}else{return _0x4b66be;}})[_0x0370('0x47')](function(_0x59af13){logger[_0x0370('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59af13);throw _0x59af13;});}return _0x4b66be;})[_0x0370('0x29')](respondWithResult(_0x4e0c9f,0xc9))[_0x0370('0x47')](handleError(_0x4e0c9f,null));}; \ No newline at end of file +var _0xcdd8=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x25c1e1,_0x2201f6){var _0x1ce9ac=function(_0x1765bf){while(--_0x1765bf){_0x25c1e1['push'](_0x25c1e1['shift']());}};_0x1ce9ac(++_0x2201f6);}(_0xcdd8,0x1a6));var _0x8cdd=function(_0x596415,_0x51cc1d){_0x596415=_0x596415-0x0;var _0x3aa028=_0xcdd8[_0x596415];return _0x3aa028;};'use strict';var emlformat=require(_0x8cdd('0x0'));var rimraf=require(_0x8cdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cdd('0x2'));var rp=require(_0x8cdd('0x3'));var moment=require('moment');var BPromise=require(_0x8cdd('0x4'));var Mustache=require(_0x8cdd('0x5'));var util=require(_0x8cdd('0x6'));var path=require('path');var sox=require(_0x8cdd('0x7'));var csv=require(_0x8cdd('0x8'));var ejs=require(_0x8cdd('0x9'));var fs=require('fs');var fs_extra=require(_0x8cdd('0xa'));var _=require(_0x8cdd('0xb'));var squel=require(_0x8cdd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8cdd('0xd'));var toCsv=require(_0x8cdd('0x8'));var querystring=require(_0x8cdd('0xe'));var Papa=require(_0x8cdd('0xf'));var Redis=require('ioredis');var authService=require(_0x8cdd('0x10'));var qs=require(_0x8cdd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cdd('0x12'));var logger=require(_0x8cdd('0x13'))('api');var utils=require(_0x8cdd('0x14'));var config=require(_0x8cdd('0x15'));var licenseUtil=require(_0x8cdd('0x16'));var db=require(_0x8cdd('0x17'))['db'];function respondWithStatusCode(_0x3f8d0b,_0x2bad72){_0x2bad72=_0x2bad72||0xcc;return function(_0x45604d){if(_0x45604d){return _0x3f8d0b[_0x8cdd('0x18')](_0x2bad72);}return _0x3f8d0b[_0x8cdd('0x19')](_0x2bad72)[_0x8cdd('0x1a')]();};}function respondWithResult(_0x339fad,_0x2033fd){_0x2033fd=_0x2033fd||0xc8;return function(_0x2bf0ca){if(_0x2bf0ca){return _0x339fad[_0x8cdd('0x19')](_0x2033fd)['json'](_0x2bf0ca);}};}function respondWithFilteredResult(_0x3885f7,_0x4bd1ba){return function(_0x2d5aec){if(_0x2d5aec){var _0x1a982c=typeof _0x4bd1ba['offset']===_0x8cdd('0x1b')&&typeof _0x4bd1ba[_0x8cdd('0x1c')]===_0x8cdd('0x1b');var _0x3f7342=_0x2d5aec['count'];var _0x3aed9e=_0x1a982c?0x0:_0x4bd1ba[_0x8cdd('0x1d')];var _0x93b7cb=_0x1a982c?_0x2d5aec[_0x8cdd('0x1e')]:_0x4bd1ba['offset']+_0x4bd1ba[_0x8cdd('0x1c')];var _0x4fed38;if(_0x93b7cb>=_0x3f7342){_0x93b7cb=_0x3f7342;_0x4fed38=0xc8;}else{_0x4fed38=0xce;}_0x3885f7[_0x8cdd('0x19')](_0x4fed38);return _0x3885f7[_0x8cdd('0x1f')](_0x8cdd('0x20'),_0x3aed9e+'-'+_0x93b7cb+'/'+_0x3f7342)[_0x8cdd('0x21')](_0x2d5aec);}return null;};}function patchUpdates(_0x1350bc){return function(_0x32dd8c){try{jsonpatch[_0x8cdd('0x22')](_0x32dd8c,_0x1350bc,!![]);}catch(_0x22b3de){return BPromise[_0x8cdd('0x23')](_0x22b3de);}return _0x32dd8c[_0x8cdd('0x24')]();};}function saveUpdates(_0x4b9a1c,_0x3ce4fa){return function(_0x2a3a81){if(_0x2a3a81){return _0x2a3a81['update'](_0x4b9a1c)[_0x8cdd('0x25')](function(_0x4b2c85){return _0x4b2c85;});}return null;};}function removeEntity(_0x290ffe,_0x12e3a5){return function(_0x51fc3b){if(_0x51fc3b){return _0x51fc3b[_0x8cdd('0x26')]()[_0x8cdd('0x25')](function(){var _0x4152df=_0x51fc3b[_0x8cdd('0x27')]({'plain':!![]});var _0xd5d2c4=_0x8cdd('0x28');return db[_0x8cdd('0x29')]['destroy']({'where':{'type':_0xd5d2c4,'resourceId':_0x4152df['id']}})['then'](function(){return _0x51fc3b;});})['then'](function(){_0x290ffe[_0x8cdd('0x19')](0xcc)[_0x8cdd('0x1a')]();});}};}function handleEntityNotFound(_0x2f6951,_0x3cf9c4){return function(_0x1f0ed1){if(!_0x1f0ed1){_0x2f6951[_0x8cdd('0x18')](0x194);}return _0x1f0ed1;};}function handleError(_0x519dbf,_0x53e2e6){_0x53e2e6=_0x53e2e6||0x1f4;return function(_0x3f6ca6){logger[_0x8cdd('0x2a')](_0x3f6ca6[_0x8cdd('0x2b')]);if(_0x3f6ca6[_0x8cdd('0x2c')]){delete _0x3f6ca6[_0x8cdd('0x2c')];}_0x519dbf[_0x8cdd('0x19')](_0x53e2e6)[_0x8cdd('0x2d')](_0x3f6ca6);};}exports['index']=function(_0x1bc950,_0x3c1757){var _0x2fdf3a={},_0x179648={},_0x1cb7cb={'count':0x0,'rows':[]};var _0x28bded=_['map'](db[_0x8cdd('0x2e')][_0x8cdd('0x2f')],function(_0x1b1310){return{'name':_0x1b1310[_0x8cdd('0x30')],'type':_0x1b1310[_0x8cdd('0x31')][_0x8cdd('0x32')]};});_0x179648['model']=_[_0x8cdd('0x33')](_0x28bded,_0x8cdd('0x2c'));_0x179648['query']=_[_0x8cdd('0x34')](_0x1bc950['query']);_0x179648[_0x8cdd('0x35')]=_[_0x8cdd('0x36')](_0x179648[_0x8cdd('0x37')],_0x179648[_0x8cdd('0x38')]);_0x2fdf3a[_0x8cdd('0x39')]=_[_0x8cdd('0x36')](_0x179648[_0x8cdd('0x37')],qs[_0x8cdd('0x3a')](_0x1bc950['query'][_0x8cdd('0x3a')]));_0x2fdf3a['attributes']=_0x2fdf3a[_0x8cdd('0x39')][_0x8cdd('0x3b')]?_0x2fdf3a[_0x8cdd('0x39')]:_0x179648['model'];if(!_0x1bc950[_0x8cdd('0x38')][_0x8cdd('0x3c')](_0x8cdd('0x3d'))){_0x2fdf3a['limit']=qs[_0x8cdd('0x1c')](_0x1bc950[_0x8cdd('0x38')]['limit']);_0x2fdf3a[_0x8cdd('0x1d')]=qs[_0x8cdd('0x1d')](_0x1bc950[_0x8cdd('0x38')][_0x8cdd('0x1d')]);}_0x2fdf3a['order']=qs[_0x8cdd('0x3e')](_0x1bc950['query'][_0x8cdd('0x3e')]);_0x2fdf3a['where']=qs[_0x8cdd('0x35')](_['pick'](_0x1bc950['query'],_0x179648[_0x8cdd('0x35')]),_0x28bded);if(_0x1bc950['query'][_0x8cdd('0x3f')]){_0x2fdf3a[_0x8cdd('0x40')]=_['merge'](_0x2fdf3a[_0x8cdd('0x40')],{'$or':[{'key':{'$like':'%'+_0x1bc950[_0x8cdd('0x38')][_0x8cdd('0x3f')]+'%'}},{'value':{'$like':'%'+_0x1bc950[_0x8cdd('0x38')][_0x8cdd('0x3f')]+'%'}}]});}_0x2fdf3a=_[_0x8cdd('0x41')]({},_0x2fdf3a,_0x1bc950[_0x8cdd('0x42')]);var _0x17cac7={'where':_0x2fdf3a[_0x8cdd('0x40')]};return db[_0x8cdd('0x2e')][_0x8cdd('0x1e')](_0x17cac7)[_0x8cdd('0x25')](function(_0x29457e){_0x1cb7cb[_0x8cdd('0x1e')]=_0x29457e;if(_0x1bc950[_0x8cdd('0x38')][_0x8cdd('0x43')]){_0x2fdf3a[_0x8cdd('0x44')]=[{'all':!![]}];}return db[_0x8cdd('0x2e')][_0x8cdd('0x45')](_0x2fdf3a);})[_0x8cdd('0x25')](function(_0x36e9f0){_0x1cb7cb[_0x8cdd('0x46')]=_0x36e9f0;return _0x1cb7cb;})[_0x8cdd('0x25')](respondWithFilteredResult(_0x3c1757,_0x2fdf3a))[_0x8cdd('0x47')](handleError(_0x3c1757,null));};exports[_0x8cdd('0x48')]=function(_0x42a4a6,_0x336496){var _0x5833ee={'raw':!![],'where':{'id':_0x42a4a6[_0x8cdd('0x49')]['id']}},_0x321f17={};_0x321f17[_0x8cdd('0x37')]=_[_0x8cdd('0x34')](db['CannedAnswer']['rawAttributes']);_0x321f17[_0x8cdd('0x38')]=_[_0x8cdd('0x34')](_0x42a4a6[_0x8cdd('0x38')]);_0x321f17[_0x8cdd('0x35')]=_[_0x8cdd('0x36')](_0x321f17[_0x8cdd('0x37')],_0x321f17[_0x8cdd('0x38')]);_0x5833ee[_0x8cdd('0x39')]=_[_0x8cdd('0x36')](_0x321f17[_0x8cdd('0x37')],qs[_0x8cdd('0x3a')](_0x42a4a6[_0x8cdd('0x38')][_0x8cdd('0x3a')]));_0x5833ee[_0x8cdd('0x39')]=_0x5833ee[_0x8cdd('0x39')][_0x8cdd('0x3b')]?_0x5833ee[_0x8cdd('0x39')]:_0x321f17[_0x8cdd('0x37')];if(_0x42a4a6['query'][_0x8cdd('0x43')]){_0x5833ee['include']=[{'all':!![]}];}_0x5833ee=_['merge']({},_0x5833ee,_0x42a4a6['options']);return db['CannedAnswer'][_0x8cdd('0x4a')](_0x5833ee)[_0x8cdd('0x25')](handleEntityNotFound(_0x336496,null))[_0x8cdd('0x25')](respondWithResult(_0x336496,null))[_0x8cdd('0x47')](handleError(_0x336496,null));};exports['update']=function(_0x3a57de,_0x4cc134){if(_0x3a57de[_0x8cdd('0x4b')]['id']){delete _0x3a57de[_0x8cdd('0x4b')]['id'];}return db['CannedAnswer'][_0x8cdd('0x4a')]({'where':{'id':_0x3a57de['params']['id']}})[_0x8cdd('0x25')](handleEntityNotFound(_0x4cc134,null))[_0x8cdd('0x25')](saveUpdates(_0x3a57de['body'],null))[_0x8cdd('0x25')](respondWithResult(_0x4cc134,null))[_0x8cdd('0x47')](handleError(_0x4cc134,null));};exports['destroy']=function(_0x18f7fe,_0x530b00){return db[_0x8cdd('0x2e')]['find']({'where':{'id':_0x18f7fe[_0x8cdd('0x49')]['id']}})[_0x8cdd('0x25')](handleEntityNotFound(_0x530b00,null))['then'](removeEntity(_0x530b00,null))['catch'](handleError(_0x530b00,null));};exports[_0x8cdd('0x4c')]=function(_0x56a33a,_0x5c31e7){var _0x462775={'key':_0x56a33a[_0x8cdd('0x4b')][_0x8cdd('0x32')]};if(_0x56a33a[_0x8cdd('0x4b')][_0x8cdd('0x4d')]){_0x462775[_0x8cdd('0x4d')]=_0x56a33a[_0x8cdd('0x4b')]['MailAccountId'];}else if(_0x56a33a[_0x8cdd('0x4b')]['SmsAccountId']){_0x462775['SmsAccountId']=_0x56a33a[_0x8cdd('0x4b')]['SmsAccountId'];}else if(_0x56a33a[_0x8cdd('0x4b')][_0x8cdd('0x4e')]){_0x462775[_0x8cdd('0x4e')]=_0x56a33a['body'][_0x8cdd('0x4e')];}else if(_0x56a33a[_0x8cdd('0x4b')][_0x8cdd('0x4f')]){_0x462775['ChatWebsiteId']=_0x56a33a[_0x8cdd('0x4b')][_0x8cdd('0x4f')];}return db['CannedAnswer'][_0x8cdd('0x4a')]({'where':_0x462775})[_0x8cdd('0x25')](function(_0x266dd9){if(_0x266dd9){throw new db[(_0x8cdd('0x50'))]['ValidationError'](_0x8cdd('0x51'));}return db[_0x8cdd('0x2e')][_0x8cdd('0x4c')](_0x56a33a[_0x8cdd('0x4b')]);})[_0x8cdd('0x25')](function(_0x53ef46){var _0x469ce0=_0x56a33a[_0x8cdd('0x52')][_0x8cdd('0x27')]({'plain':!![]});if(!_0x469ce0)throw new Error(_0x8cdd('0x53'));if(_0x469ce0['role']===_0x8cdd('0x52')){var _0x4a911f=_0x53ef46[_0x8cdd('0x27')]({'plain':!![]});return db[_0x8cdd('0x54')][_0x8cdd('0x4a')]({'where':{'name':_0x8cdd('0x28'),'userProfileId':_0x469ce0['userProfileId']},'raw':!![]})[_0x8cdd('0x25')](function(_0x2460c8){if(_0x2460c8&&_0x2460c8[_0x8cdd('0x55')]===0x0){return db['UserProfileResource'][_0x8cdd('0x4c')]({'name':_0x4a911f[_0x8cdd('0x2c')],'resourceId':_0x4a911f['id'],'type':_0x2460c8[_0x8cdd('0x2c')],'sectionId':_0x2460c8['id']},{})[_0x8cdd('0x25')](function(){return _0x53ef46;});}else{return _0x53ef46;}})[_0x8cdd('0x47')](function(_0x3a8fa8){logger[_0x8cdd('0x2a')](_0x8cdd('0x56'),_0x3a8fa8);throw _0x3a8fa8;});}return _0x53ef46;})[_0x8cdd('0x25')](respondWithResult(_0x5c31e7,0xc9))[_0x8cdd('0x47')](handleError(_0x5c31e7,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a7ed00d..2bfd425 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 _0x54aa=['./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x2a75cd,_0x247962){var _0x2319bc=function(_0x47d0c5){while(--_0x47d0c5){_0x2a75cd['push'](_0x2a75cd['shift']());}};_0x2319bc(++_0x247962);}(_0x54aa,0x116));var _0xa54a=function(_0x2e9bfb,_0x14cfdb){_0x2e9bfb=_0x2e9bfb-0x0;var _0x15bfe5=_0x54aa[_0x2e9bfb];return _0x15bfe5;};'use strict';var _=require(_0xa54a('0x0'));var util=require(_0xa54a('0x1'));var logger=require(_0xa54a('0x2'))(_0xa54a('0x3'));var moment=require('moment');var BPromise=require(_0xa54a('0x4'));var rp=require(_0xa54a('0x5'));var fs=require('fs');var path=require(_0xa54a('0x6'));var rimraf=require('rimraf');var config=require(_0xa54a('0x7'));var attributes=require(_0xa54a('0x8'));module['exports']=function(_0x4b938c,_0x2d8700){return _0x4b938c[_0xa54a('0x9')]('CannedAnswer',attributes,{'tableName':_0xa54a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa54a('0xb'),'collate':_0xa54a('0xc')});}; \ No newline at end of file +var _0xe5ad=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x58a5e7,_0x36717e){var _0x39626a=function(_0x14ae95){while(--_0x14ae95){_0x58a5e7['push'](_0x58a5e7['shift']());}};_0x39626a(++_0x36717e);}(_0xe5ad,0x110));var _0xde5a=function(_0x377e52,_0x40896d){_0x377e52=_0x377e52-0x0;var _0x199e7e=_0xe5ad[_0x377e52];return _0x199e7e;};'use strict';var _=require(_0xde5a('0x0'));var util=require(_0xde5a('0x1'));var logger=require('../../config/logger')(_0xde5a('0x2'));var moment=require(_0xde5a('0x3'));var BPromise=require(_0xde5a('0x4'));var rp=require(_0xde5a('0x5'));var fs=require('fs');var path=require(_0xde5a('0x6'));var rimraf=require(_0xde5a('0x7'));var config=require(_0xde5a('0x8'));var attributes=require(_0xde5a('0x9'));module[_0xde5a('0xa')]=function(_0x3799b1,_0x5eb5e4){return _0x3799b1[_0xde5a('0xb')](_0xde5a('0xc'),attributes,{'tableName':_0xde5a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xde5a('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 4470304..611e343 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(_0x1c683d,_0x18dc11){var _0x1a0a0f=function(_0xd1ec62){while(--_0xd1ec62){_0x1c683d['push'](_0x1c683d['shift']());}};_0x1a0a0f(++_0x18dc11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x3829f4,_0x2cc733){var _0x40f678=function(_0x3229d9){while(--_0x3229d9){_0x3829f4['push'](_0x3829f4['shift']());}};_0x40f678(++_0x2cc733);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index a387d35..1b29be5 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 _0xdcd0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','update','delete','destroy','multer'];(function(_0x2c96dc,_0x70bf1e){var _0x57faa8=function(_0x18e474){while(--_0x18e474){_0x2c96dc['push'](_0x2c96dc['shift']());}};_0x57faa8(++_0x70bf1e);}(_0xdcd0,0x1b4));var _0x0dcd=function(_0x5f55ad,_0x2aee2a){_0x5f55ad=_0x5f55ad-0x0;var _0x154987=_0xdcd0[_0x5f55ad];return _0x154987;};'use strict';var multer=require(_0x0dcd('0x0'));var util=require(_0x0dcd('0x1'));var path=require(_0x0dcd('0x2'));var timeout=require(_0x0dcd('0x3'));var express=require(_0x0dcd('0x4'));var router=express[_0x0dcd('0x5')]();var fs_extra=require(_0x0dcd('0x6'));var auth=require(_0x0dcd('0x7'));var interaction=require(_0x0dcd('0x8'));var config=require(_0x0dcd('0x9'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0dcd('0xa')]);router[_0x0dcd('0xb')](_0x0dcd('0xc'),auth[_0x0dcd('0xd')](),controller[_0x0dcd('0xe')]);router[_0x0dcd('0xf')]('/',auth[_0x0dcd('0xd')](),controller['create']);router['put'](_0x0dcd('0xc'),auth[_0x0dcd('0xd')](),controller[_0x0dcd('0x10')]);router[_0x0dcd('0x11')](_0x0dcd('0xc'),auth[_0x0dcd('0xd')](),controller[_0x0dcd('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb3bc=['multer','connect-timeout','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','post','create','put','/:id','update','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb3bc,0x12c));var _0xcb3b=function(_0x158e0a,_0x44316d){_0x158e0a=_0x158e0a-0x0;var _0x20b46c=_0xb3bc[_0x158e0a];return _0x20b46c;};'use strict';var multer=require(_0xcb3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb3b('0x1'));var express=require('express');var router=express[_0xcb3b('0x2')]();var fs_extra=require(_0xcb3b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcb3b('0x4'));var config=require('../../config/environment');var controller=require(_0xcb3b('0x5'));router[_0xcb3b('0x6')]('/',auth[_0xcb3b('0x7')](),controller[_0xcb3b('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xcb3b('0x9')]('/',auth[_0xcb3b('0x7')](),controller[_0xcb3b('0xa')]);router[_0xcb3b('0xb')](_0xcb3b('0xc'),auth[_0xcb3b('0x7')](),controller[_0xcb3b('0xd')]);router['delete']('/:id',auth[_0xcb3b('0x7')](),controller['destroy']);module[_0xcb3b('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9362840..67a0cb2 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 _0xc034=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','DATE'];(function(_0x1ddf8d,_0x20a381){var _0x4d3621=function(_0x4a4c38){while(--_0x4a4c38){_0x1ddf8d['push'](_0x1ddf8d['shift']());}};_0x4d3621(++_0x20a381);}(_0xc034,0x170));var _0x4c03=function(_0x45f129,_0x3f7b36){_0x45f129=_0x45f129-0x0;var _0x1ef02e=_0xc034[_0x45f129];return _0x1ef02e;};'use strict';var Sequelize=require(_0x4c03('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x4c03('0x1')],'allowNull':![],'defaultValue':_0x4c03('0x2')},'clid':{'type':Sequelize[_0x4c03('0x3')]},'src':{'type':Sequelize[_0x4c03('0x3')]},'dst':{'type':Sequelize[_0x4c03('0x3')]},'dcontext':{'type':Sequelize[_0x4c03('0x3')]},'channel':{'type':Sequelize[_0x4c03('0x3')]},'dstchannel':{'type':Sequelize[_0x4c03('0x3')]},'lastapp':{'type':Sequelize[_0x4c03('0x3')]},'lastdata':{'type':Sequelize[_0x4c03('0x3')]},'duration':{'type':Sequelize[_0x4c03('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4c03('0x3')]},'amaflags':{'type':Sequelize[_0x4c03('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x4c03('0x3')]},'sequence':{'type':Sequelize[_0x4c03('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa20a=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x18222c,_0x15909e){var _0x3c908f=function(_0x185c04){while(--_0x185c04){_0x18222c['push'](_0x18222c['shift']());}};_0x3c908f(++_0x15909e);}(_0xa20a,0x74));var _0xaa20=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xa20a[_0xef8146];return _0x5a6cb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xaa20('0x0')],'allowNull':![],'defaultValue':_0xaa20('0x1')},'clid':{'type':Sequelize[_0xaa20('0x2')]},'src':{'type':Sequelize[_0xaa20('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xaa20('0x2')]},'channel':{'type':Sequelize[_0xaa20('0x2')]},'dstchannel':{'type':Sequelize[_0xaa20('0x2')]},'lastapp':{'type':Sequelize[_0xaa20('0x2')]},'lastdata':{'type':Sequelize[_0xaa20('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaa20('0x2')]},'amaflags':{'type':Sequelize[_0xaa20('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaa20('0x2')]},'userfield':{'type':Sequelize[_0xaa20('0x2')]},'uniqueid':{'type':Sequelize[_0xaa20('0x2')]},'linkedid':{'type':Sequelize[_0xaa20('0x2')]},'sequence':{'type':Sequelize[_0xaa20('0x2')]},'peeraccount':{'type':Sequelize[_0xaa20('0x2')]},'type':{'type':Sequelize[_0xaa20('0x2')]},'tag':{'type':Sequelize[_0xaa20('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c7812af..8fa6d59 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 _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x28b301,_0x1dd9f9){var _0x4febe0=function(_0x32d2aa){while(--_0x32d2aa){_0x28b301['push'](_0x28b301['shift']());}};_0x4febe0(++_0x1dd9f9);}(_0x8375,0xa8));var _0x5837=function(_0x2ef695,_0x265b2b){_0x2ef695=_0x2ef695-0x0;var _0xab543f=_0x8375[_0x2ef695];return _0xab543f;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file +var _0x0e85=['json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x1e6565,_0x4546d7){var _0x36b792=function(_0x3ae025){while(--_0x3ae025){_0x1e6565['push'](_0x1e6565['shift']());}};_0x36b792(++_0x4546d7);}(_0x0e85,0x7c));var _0x50e8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0e85[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['map'](_0x126c99,'name');_0x4f0b88[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x30fedf[_0x50e8('0x2e')]);_0x4f0b88['filters']=_['intersection'](_0x4f0b88[_0x50e8('0x2d')],_0x4f0b88[_0x50e8('0x2e')]);_0x42bbef['attributes']=_[_0x50e8('0x30')](_0x4f0b88[_0x50e8('0x2d')],qs[_0x50e8('0x31')](_0x30fedf[_0x50e8('0x2e')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef['attributes'][_0x50e8('0x33')]?_0x42bbef[_0x50e8('0x32')]:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf['query'][_0x50e8('0x34')](_0x50e8('0x35'))){_0x42bbef['limit']=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1d')]);_0x42bbef[_0x50e8('0x1b')]=qs['offset'](_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x1b')]);}_0x42bbef[_0x50e8('0x36')]=qs[_0x50e8('0x37')](_0x30fedf['query'][_0x50e8('0x37')]);_0x42bbef[_0x50e8('0x38')]=qs[_0x50e8('0x39')](_['pick'](_0x30fedf['query'],_0x4f0b88['filters']),_0x126c99);if(_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]){_0x42bbef[_0x50e8('0x38')]=_[_0x50e8('0x3b')](_0x42bbef[_0x50e8('0x38')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0xb566c2){if(_0xb566c2[_0x50e8('0x3c')]!==_0x50e8('0x3d')){var _0x3a1b4d={};_0x3a1b4d[_0xb566c2['name']]={'$like':'%'+_0x30fedf[_0x50e8('0x2e')][_0x50e8('0x3a')]+'%'};return _0x3a1b4d;}})});}_0x42bbef=_[_0x50e8('0x3b')]({},_0x42bbef,_0x30fedf[_0x50e8('0x3e')]);var _0x5dbbe1={'where':_0x42bbef[_0x50e8('0x38')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x5dbbe1)[_0x50e8('0x23')](function(_0x8e8a97){_0x1041b9['count']=_0x8e8a97;if(_0x30fedf['query'][_0x50e8('0x3f')]){_0x42bbef[_0x50e8('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x50e8('0x41')](_0x42bbef);})[_0x50e8('0x23')](function(_0x3db1ab){_0x1041b9[_0x50e8('0x42')]=_0x3db1ab;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x43')](handleError(_0x39c0c6,null));};exports[_0x50e8('0x44')]=function(_0x172049,_0x5e9da3){var _0x3d26bd={'raw':!![],'where':{'id':_0x172049[_0x50e8('0x45')]['id']}},_0x44e0ca={};_0x44e0ca[_0x50e8('0x2d')]=_['keys'](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x44e0ca[_0x50e8('0x2e')]=_[_0x50e8('0x2f')](_0x172049['query']);_0x44e0ca[_0x50e8('0x39')]=_['intersection'](_0x44e0ca['model'],_0x44e0ca['query']);_0x3d26bd[_0x50e8('0x32')]=_[_0x50e8('0x30')](_0x44e0ca['model'],qs[_0x50e8('0x31')](_0x172049[_0x50e8('0x2e')][_0x50e8('0x31')]));_0x3d26bd[_0x50e8('0x32')]=_0x3d26bd[_0x50e8('0x32')][_0x50e8('0x33')]?_0x3d26bd['attributes']:_0x44e0ca[_0x50e8('0x2d')];if(_0x172049['query'][_0x50e8('0x3f')]){_0x3d26bd[_0x50e8('0x40')]=[{'all':!![]}];}_0x3d26bd=_['merge']({},_0x3d26bd,_0x172049[_0x50e8('0x3e')]);return db['Cdr'][_0x50e8('0x46')](_0x3d26bd)[_0x50e8('0x23')](handleEntityNotFound(_0x5e9da3,null))[_0x50e8('0x23')](respondWithResult(_0x5e9da3,null))[_0x50e8('0x43')](handleError(_0x5e9da3,null));};exports[_0x50e8('0x47')]=function(_0x3f72ea,_0x229d60){return db[_0x50e8('0x29')][_0x50e8('0x47')](_0x3f72ea[_0x50e8('0x48')],{})[_0x50e8('0x23')](respondWithResult(_0x229d60,0xc9))['catch'](handleError(_0x229d60,null));};exports[_0x50e8('0x22')]=function(_0x275a1b,_0x479431){if(_0x275a1b[_0x50e8('0x48')]['id']){delete _0x275a1b['body']['id'];}return db[_0x50e8('0x29')]['find']({'where':{'id':_0x275a1b[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x479431,null))[_0x50e8('0x23')](saveUpdates(_0x275a1b[_0x50e8('0x48')],null))[_0x50e8('0x23')](respondWithResult(_0x479431,null))[_0x50e8('0x43')](handleError(_0x479431,null));};exports[_0x50e8('0x49')]=function(_0x5f256a,_0x3410f3){return db[_0x50e8('0x29')][_0x50e8('0x46')]({'where':{'id':_0x5f256a[_0x50e8('0x45')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x3410f3,null))[_0x50e8('0x23')](removeEntity(_0x3410f3,null))['catch'](handleError(_0x3410f3,null));};exports[_0x50e8('0x4a')]=function(_0x250b28,_0xff2e24){return db[_0x50e8('0x29')]['describe']()[_0x50e8('0x23')](respondWithResult(_0xff2e24,null))[_0x50e8('0x43')](handleError(_0xff2e24,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9476dd9..2f868c2 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(_0x185c8e,_0x586eef){var _0x2857d8=function(_0x32442f){while(--_0x32442f){_0x185c8e['push'](_0x185c8e['shift']());}};_0x2857d8(++_0x586eef);}(_0x7a54,0x106));var _0x47a5=function(_0xfdafc4,_0x130b99){_0xfdafc4=_0xfdafc4-0x0;var _0x207546=_0x7a54[_0xfdafc4];return _0x207546;};'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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4894d0,_0x12806b){var _0x2c7f01=function(_0x417984){while(--_0x417984){_0x4894d0['push'](_0x4894d0['shift']());}};_0x2c7f01(++_0x12806b);}(_0x7a54,0x106));var _0x47a5=function(_0x1e1673,_0x2650fb){_0x1e1673=_0x1e1673-0x0;var _0x511e50=_0x7a54[_0x1e1673];return _0x511e50;};'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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 98a6638..d860f28 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 _0x653b=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x59b26a,_0x46044f){var _0x3d85b2=function(_0x1e88cf){while(--_0x1e88cf){_0x59b26a['push'](_0x59b26a['shift']());}};_0x3d85b2(++_0x46044f);}(_0x653b,0xd8));var _0xb653=function(_0x2b441f,_0x249bac){_0x2b441f=_0x2b441f-0x0;var _0x1cc771=_0x653b[_0x2b441f];return _0x1cc771;};'use strict';var _=require(_0xb653('0x0'));var util=require('util');var moment=require(_0xb653('0x1'));var BPromise=require(_0xb653('0x2'));var rs=require(_0xb653('0x3'));var fs=require('fs');var Redis=require(_0xb653('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb653('0x5'));var logger=require(_0xb653('0x6'))('rpc');var config=require(_0xb653('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb653('0x8')][_0xb653('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x388cc8,_0x261757,_0x25f515){return new BPromise(function(_0x4045bb,_0x5576fe){return client[_0xb653('0xa')](_0x388cc8,_0x25f515)['then'](function(_0x42f00f){logger[_0xb653('0xb')](_0xb653('0xc'),_0x261757,_0xb653('0xd'));logger[_0xb653('0xe')](_0xb653('0xf'),_0x261757,_0xb653('0xd'),JSON[_0xb653('0x10')](_0x42f00f));if(_0x42f00f['error']){if(_0x42f00f[_0xb653('0x11')][_0xb653('0x12')]===0x1f4){logger[_0xb653('0x11')](_0xb653('0xc'),_0x261757,_0x42f00f['error']['message']);return _0x5576fe(_0x42f00f[_0xb653('0x11')][_0xb653('0x13')]);}logger[_0xb653('0x11')](_0xb653('0xc'),_0x261757,_0x42f00f[_0xb653('0x11')][_0xb653('0x13')]);return _0x4045bb(_0x42f00f[_0xb653('0x11')]['message']);}else{logger[_0xb653('0xb')]('Cdr,\x20%s,\x20%s',_0x261757,'request\x20sent');_0x4045bb(_0x42f00f['result'][_0xb653('0x13')]);}})[_0xb653('0x14')](function(_0x4a1ba6){logger[_0xb653('0x11')](_0xb653('0xc'),_0x261757,_0x4a1ba6);_0x5576fe(_0x4a1ba6);});});} \ No newline at end of file +var _0xbb46=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','Cdr,\x20%s,\x20%s','debug'];(function(_0x2ddbee,_0x1e4cd8){var _0x39a1c9=function(_0x5a0ed4){while(--_0x5a0ed4){_0x2ddbee['push'](_0x2ddbee['shift']());}};_0x39a1c9(++_0x1e4cd8);}(_0xbb46,0x6b));var _0x6bb4=function(_0x42692d,_0x4f0431){_0x42692d=_0x42692d-0x0;var _0xa025c4=_0xbb46[_0x42692d];return _0xa025c4;};'use strict';var _=require(_0x6bb4('0x0'));var util=require(_0x6bb4('0x1'));var moment=require(_0x6bb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bb4('0x3'));var fs=require('fs');var Redis=require(_0x6bb4('0x4'));var db=require(_0x6bb4('0x5'))['db'];var utils=require(_0x6bb4('0x6'));var logger=require(_0x6bb4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6bb4('0x8'));var client=jayson['client'][_0x6bb4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59061f,_0x11ecc4,_0x452ae9){return new BPromise(function(_0x5c29c8,_0x507a93){return client[_0x6bb4('0xa')](_0x59061f,_0x452ae9)['then'](function(_0x2a9215){logger['info'](_0x6bb4('0xb'),_0x11ecc4,'request\x20sent');logger[_0x6bb4('0xc')](_0x6bb4('0xd'),_0x11ecc4,_0x6bb4('0xe'),JSON['stringify'](_0x2a9215));if(_0x2a9215[_0x6bb4('0xf')]){if(_0x2a9215[_0x6bb4('0xf')][_0x6bb4('0x10')]===0x1f4){logger[_0x6bb4('0xf')](_0x6bb4('0xb'),_0x11ecc4,_0x2a9215[_0x6bb4('0xf')][_0x6bb4('0x11')]);return _0x507a93(_0x2a9215[_0x6bb4('0xf')][_0x6bb4('0x11')]);}logger[_0x6bb4('0xf')](_0x6bb4('0xb'),_0x11ecc4,_0x2a9215[_0x6bb4('0xf')][_0x6bb4('0x11')]);return _0x5c29c8(_0x2a9215['error'][_0x6bb4('0x11')]);}else{logger[_0x6bb4('0x12')](_0x6bb4('0xb'),_0x11ecc4,_0x6bb4('0xe'));_0x5c29c8(_0x2a9215['result']['message']);}})[_0x6bb4('0x13')](function(_0x461d3c){logger[_0x6bb4('0xf')](_0x6bb4('0xb'),_0x11ecc4,_0x461d3c);_0x507a93(_0x461d3c);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 322bec2..41acb25 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_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'));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 46f1078..82240d1 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 _0x00e1=['noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x00e1,0x160));var _0x100e=function(_0x39b11e,_0x5f515d){_0x39b11e=_0x39b11e-0x0;var _0x565d50=_0x00e1[_0x39b11e];return _0x565d50;};'use strict';var Sequelize=require(_0x100e('0x0'));module[_0x100e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x100e('0x2')},'appdata':{'type':Sequelize[_0x100e('0x3')]()},'description':{'type':Sequelize[_0x100e('0x4')]},'interval':{'type':Sequelize[_0x100e('0x4')],'defaultValue':_0x100e('0x5')}}; \ No newline at end of file +var _0xa883=['TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x2c38be,_0xaaf1a2){var _0x119ec7=function(_0x2e4ebe){while(--_0x2e4ebe){_0x2c38be['push'](_0x2c38be['shift']());}};_0x119ec7(++_0xaaf1a2);}(_0xa883,0xe8));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a88('0x0'));module[_0x3a88('0x1')]={'priority':{'type':Sequelize[_0x3a88('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3a88('0x3')]()},'description':{'type':Sequelize[_0x3a88('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9a2e991..4795616 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 _0x67da=['end','sendStatus','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x67da,0x192));var _0xa67d=function(_0x3b1e38,_0x3c1b55){_0x3b1e38=_0x3b1e38-0x0;var _0x4523ce=_0x67da[_0x3b1e38];return _0x4523ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa67d('0x0'));var zipdir=require(_0xa67d('0x1'));var jsonpatch=require(_0xa67d('0x2'));var rp=require(_0xa67d('0x3'));var moment=require(_0xa67d('0x4'));var BPromise=require(_0xa67d('0x5'));var Mustache=require(_0xa67d('0x6'));var util=require(_0xa67d('0x7'));var path=require(_0xa67d('0x8'));var sox=require(_0xa67d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa67d('0xa'));var _=require('lodash');var squel=require(_0xa67d('0xb'));var crypto=require(_0xa67d('0xc'));var jsforce=require(_0xa67d('0xd'));var deskjs=require(_0xa67d('0xe'));var toCsv=require(_0xa67d('0xf'));var querystring=require(_0xa67d('0x10'));var Papa=require(_0xa67d('0x11'));var Redis=require(_0xa67d('0x12'));var authService=require(_0xa67d('0x13'));var qs=require(_0xa67d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa67d('0x15'));var logger=require(_0xa67d('0x16'))(_0xa67d('0x17'));var utils=require(_0xa67d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa67d('0x19'));var db=require(_0xa67d('0x1a'))['db'];function respondWithStatusCode(_0x560485,_0x4e86f6){_0x4e86f6=_0x4e86f6||0xcc;return function(_0x304ee2){if(_0x304ee2){return _0x560485['sendStatus'](_0x4e86f6);}return _0x560485[_0xa67d('0x1b')](_0x4e86f6)['end']();};}function respondWithResult(_0x5d757b,_0x22dcc7){_0x22dcc7=_0x22dcc7||0xc8;return function(_0x3b99e3){if(_0x3b99e3){return _0x5d757b['status'](_0x22dcc7)[_0xa67d('0x1c')](_0x3b99e3);}};}function respondWithFilteredResult(_0x267a67,_0x1cfe81){return function(_0x288e5f){if(_0x288e5f){var _0x5a47de=typeof _0x1cfe81['offset']==='undefined'&&typeof _0x1cfe81['limit']===_0xa67d('0x1d');var _0x553811=_0x288e5f[_0xa67d('0x1e')];var _0xf8422c=_0x5a47de?0x0:_0x1cfe81[_0xa67d('0x1f')];var _0x1b58c3=_0x5a47de?_0x288e5f[_0xa67d('0x1e')]:_0x1cfe81[_0xa67d('0x1f')]+_0x1cfe81[_0xa67d('0x20')];var _0x5538a5;if(_0x1b58c3>=_0x553811){_0x1b58c3=_0x553811;_0x5538a5=0xc8;}else{_0x5538a5=0xce;}_0x267a67[_0xa67d('0x1b')](_0x5538a5);return _0x267a67[_0xa67d('0x21')](_0xa67d('0x22'),_0xf8422c+'-'+_0x1b58c3+'/'+_0x553811)[_0xa67d('0x1c')](_0x288e5f);}return null;};}function patchUpdates(_0x28f38b){return function(_0x1c3498){try{jsonpatch['apply'](_0x1c3498,_0x28f38b,!![]);}catch(_0x3f1898){return BPromise[_0xa67d('0x23')](_0x3f1898);}return _0x1c3498[_0xa67d('0x24')]();};}function saveUpdates(_0xed6c3e,_0x48f240){return function(_0x276ef7){if(_0x276ef7){return _0x276ef7['update'](_0xed6c3e)[_0xa67d('0x25')](function(_0x415141){return _0x415141;});}return null;};}function removeEntity(_0x46bbc8,_0x9c2935){return function(_0x559009){if(_0x559009){return _0x559009[_0xa67d('0x26')]()[_0xa67d('0x25')](function(){_0x46bbc8['status'](0xcc)[_0xa67d('0x27')]();});}};}function handleEntityNotFound(_0x3dd0b9,_0x2b890c){return function(_0xe0c7b2){if(!_0xe0c7b2){_0x3dd0b9[_0xa67d('0x28')](0x194);}return _0xe0c7b2;};}function handleError(_0x1d6e68,_0x5ef92a){_0x5ef92a=_0x5ef92a||0x1f4;return function(_0x435e56){logger[_0xa67d('0x29')](_0x435e56['stack']);if(_0x435e56[_0xa67d('0x2a')]){delete _0x435e56[_0xa67d('0x2a')];}_0x1d6e68[_0xa67d('0x1b')](_0x5ef92a)[_0xa67d('0x2b')](_0x435e56);};}exports[_0xa67d('0x2c')]=function(_0x8793cf,_0x42c858){var _0xf4fc64={'raw':!![],'where':{'id':_0x8793cf[_0xa67d('0x2d')]['id']}},_0x204f83={};_0x204f83[_0xa67d('0x2e')]=_[_0xa67d('0x2f')](db[_0xa67d('0x30')][_0xa67d('0x31')]);_0x204f83['query']=_[_0xa67d('0x2f')](_0x8793cf[_0xa67d('0x32')]);_0x204f83[_0xa67d('0x33')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],_0x204f83['query']);_0xf4fc64[_0xa67d('0x35')]=_[_0xa67d('0x34')](_0x204f83[_0xa67d('0x2e')],qs[_0xa67d('0x36')](_0x8793cf[_0xa67d('0x32')][_0xa67d('0x36')]));_0xf4fc64[_0xa67d('0x35')]=_0xf4fc64[_0xa67d('0x35')][_0xa67d('0x37')]?_0xf4fc64[_0xa67d('0x35')]:_0x204f83['model'];if(_0x8793cf[_0xa67d('0x32')]['includeAll']){_0xf4fc64[_0xa67d('0x38')]=[{'all':!![]}];}_0xf4fc64=_[_0xa67d('0x39')]({},_0xf4fc64,_0x8793cf[_0xa67d('0x3a')]);return db['ChatApplication'][_0xa67d('0x3b')](_0xf4fc64)[_0xa67d('0x25')](handleEntityNotFound(_0x42c858,null))[_0xa67d('0x25')](respondWithResult(_0x42c858,null))[_0xa67d('0x3c')](handleError(_0x42c858,null));};exports[_0xa67d('0x3d')]=function(_0x199e8f,_0x4ded76){if(_0x199e8f[_0xa67d('0x3e')]['id']){delete _0x199e8f[_0xa67d('0x3e')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x199e8f['params']['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x4ded76,null))['then'](saveUpdates(_0x199e8f[_0xa67d('0x3e')],null))[_0xa67d('0x25')](respondWithResult(_0x4ded76,null))[_0xa67d('0x3c')](handleError(_0x4ded76,null));};exports[_0xa67d('0x26')]=function(_0x35a0a0,_0x44310e){return db[_0xa67d('0x30')][_0xa67d('0x3b')]({'where':{'id':_0x35a0a0[_0xa67d('0x2d')]['id']}})[_0xa67d('0x25')](handleEntityNotFound(_0x44310e,null))[_0xa67d('0x25')](removeEntity(_0x44310e,null))[_0xa67d('0x3c')](handleError(_0x44310e,null));}; \ No newline at end of file +var _0x9d9b=['querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','include','merge','options','find','catch','body','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4b449a,_0x35e8a7){var _0x1fadad=function(_0x3e39ec){while(--_0x3e39ec){_0x4b449a['push'](_0x4b449a['shift']());}};_0x1fadad(++_0x35e8a7);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x5293f7,_0x22fc1e){_0x5293f7=_0x5293f7-0x0;var _0x3e042f=_0x9d9b[_0x5293f7];return _0x3e042f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9d9('0x0'));var zipdir=require(_0xb9d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d9('0x2'));var moment=require('moment');var BPromise=require(_0xb9d9('0x3'));var Mustache=require(_0xb9d9('0x4'));var util=require(_0xb9d9('0x5'));var path=require('path');var sox=require(_0xb9d9('0x6'));var csv=require('to-csv');var ejs=require(_0xb9d9('0x7'));var fs=require('fs');var fs_extra=require(_0xb9d9('0x8'));var _=require('lodash');var squel=require(_0xb9d9('0x9'));var crypto=require(_0xb9d9('0xa'));var jsforce=require(_0xb9d9('0xb'));var deskjs=require(_0xb9d9('0xc'));var toCsv=require(_0xb9d9('0xd'));var querystring=require(_0xb9d9('0xe'));var Papa=require(_0xb9d9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9d9('0x10'));var logger=require(_0xb9d9('0x11'))(_0xb9d9('0x12'));var utils=require('../../config/utils');var config=require(_0xb9d9('0x13'));var licenseUtil=require(_0xb9d9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cc03d,_0x5e3782){_0x5e3782=_0x5e3782||0xcc;return function(_0x1245e0){if(_0x1245e0){return _0x3cc03d[_0xb9d9('0x15')](_0x5e3782);}return _0x3cc03d[_0xb9d9('0x16')](_0x5e3782)[_0xb9d9('0x17')]();};}function respondWithResult(_0x26ef71,_0x1d26cf){_0x1d26cf=_0x1d26cf||0xc8;return function(_0x4f0c77){if(_0x4f0c77){return _0x26ef71[_0xb9d9('0x16')](_0x1d26cf)['json'](_0x4f0c77);}};}function respondWithFilteredResult(_0x4c8864,_0x3db648){return function(_0x2c9039){if(_0x2c9039){var _0x3909ab=typeof _0x3db648[_0xb9d9('0x18')]==='undefined'&&typeof _0x3db648['limit']===_0xb9d9('0x19');var _0x5617f1=_0x2c9039['count'];var _0x2b5e26=_0x3909ab?0x0:_0x3db648[_0xb9d9('0x18')];var _0x1e775d=_0x3909ab?_0x2c9039['count']:_0x3db648[_0xb9d9('0x18')]+_0x3db648[_0xb9d9('0x1a')];var _0x493552;if(_0x1e775d>=_0x5617f1){_0x1e775d=_0x5617f1;_0x493552=0xc8;}else{_0x493552=0xce;}_0x4c8864[_0xb9d9('0x16')](_0x493552);return _0x4c8864[_0xb9d9('0x1b')]('Content-Range',_0x2b5e26+'-'+_0x1e775d+'/'+_0x5617f1)[_0xb9d9('0x1c')](_0x2c9039);}return null;};}function patchUpdates(_0x36d55e){return function(_0x50f0ec){try{jsonpatch[_0xb9d9('0x1d')](_0x50f0ec,_0x36d55e,!![]);}catch(_0x42ca87){return BPromise[_0xb9d9('0x1e')](_0x42ca87);}return _0x50f0ec[_0xb9d9('0x1f')]();};}function saveUpdates(_0x288ccd,_0x362104){return function(_0x4c4230){if(_0x4c4230){return _0x4c4230[_0xb9d9('0x20')](_0x288ccd)[_0xb9d9('0x21')](function(_0x53c82a){return _0x53c82a;});}return null;};}function removeEntity(_0x45520b,_0x3d61bf){return function(_0x43bcab){if(_0x43bcab){return _0x43bcab[_0xb9d9('0x22')]()['then'](function(){_0x45520b[_0xb9d9('0x16')](0xcc)[_0xb9d9('0x17')]();});}};}function handleEntityNotFound(_0x6fa6af,_0x436cb7){return function(_0x2650f7){if(!_0x2650f7){_0x6fa6af[_0xb9d9('0x15')](0x194);}return _0x2650f7;};}function handleError(_0x56b394,_0x321937){_0x321937=_0x321937||0x1f4;return function(_0x42181d){logger[_0xb9d9('0x23')](_0x42181d['stack']);if(_0x42181d[_0xb9d9('0x24')]){delete _0x42181d[_0xb9d9('0x24')];}_0x56b394[_0xb9d9('0x16')](_0x321937)[_0xb9d9('0x25')](_0x42181d);};}exports[_0xb9d9('0x26')]=function(_0x402968,_0x89f901){var _0x5c74eb={'raw':!![],'where':{'id':_0x402968[_0xb9d9('0x27')]['id']}},_0x39f006={};_0x39f006[_0xb9d9('0x28')]=_[_0xb9d9('0x29')](db[_0xb9d9('0x2a')][_0xb9d9('0x2b')]);_0x39f006['query']=_[_0xb9d9('0x29')](_0x402968[_0xb9d9('0x2c')]);_0x39f006[_0xb9d9('0x2d')]=_[_0xb9d9('0x2e')](_0x39f006['model'],_0x39f006[_0xb9d9('0x2c')]);_0x5c74eb[_0xb9d9('0x2f')]=_[_0xb9d9('0x2e')](_0x39f006[_0xb9d9('0x28')],qs[_0xb9d9('0x30')](_0x402968[_0xb9d9('0x2c')]['fields']));_0x5c74eb['attributes']=_0x5c74eb[_0xb9d9('0x2f')]['length']?_0x5c74eb[_0xb9d9('0x2f')]:_0x39f006[_0xb9d9('0x28')];if(_0x402968[_0xb9d9('0x2c')]['includeAll']){_0x5c74eb[_0xb9d9('0x31')]=[{'all':!![]}];}_0x5c74eb=_[_0xb9d9('0x32')]({},_0x5c74eb,_0x402968[_0xb9d9('0x33')]);return db[_0xb9d9('0x2a')][_0xb9d9('0x34')](_0x5c74eb)[_0xb9d9('0x21')](handleEntityNotFound(_0x89f901,null))[_0xb9d9('0x21')](respondWithResult(_0x89f901,null))[_0xb9d9('0x35')](handleError(_0x89f901,null));};exports[_0xb9d9('0x20')]=function(_0x4d3a2b,_0x4f3d78){if(_0x4d3a2b['body']['id']){delete _0x4d3a2b[_0xb9d9('0x36')]['id'];}return db[_0xb9d9('0x2a')][_0xb9d9('0x34')]({'where':{'id':_0x4d3a2b[_0xb9d9('0x27')]['id']}})[_0xb9d9('0x21')](handleEntityNotFound(_0x4f3d78,null))[_0xb9d9('0x21')](saveUpdates(_0x4d3a2b['body'],null))['then'](respondWithResult(_0x4f3d78,null))['catch'](handleError(_0x4f3d78,null));};exports[_0xb9d9('0x22')]=function(_0x248168,_0x1f042f){return db[_0xb9d9('0x2a')][_0xb9d9('0x34')]({'where':{'id':_0x248168[_0xb9d9('0x27')]['id']}})[_0xb9d9('0x21')](handleEntityNotFound(_0x1f042f,null))[_0xb9d9('0x21')](removeEntity(_0x1f042f,null))[_0xb9d9('0x35')](handleError(_0x1f042f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9ec46c6..8b1affe 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 _0x35f9=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x35f9,0x1df));var _0x935f=function(_0x46be82,_0x3b5590){_0x46be82=_0x46be82-0x0;var _0x56dcd7=_0x35f9[_0x46be82];return _0x56dcd7;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var logger=require(_0x935f('0x2'))(_0x935f('0x3'));var moment=require('moment');var BPromise=require(_0x935f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x287043,_0x4403e1){return _0x287043[_0x935f('0x7')](_0x935f('0x8'),attributes,{'tableName':_0x935f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x935f('0xa'),'collate':_0x935f('0xb')});}; \ No newline at end of file +var _0xd3c6=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x40cbac,_0x20e179){var _0x33eaee=function(_0x15f461){while(--_0x15f461){_0x40cbac['push'](_0x40cbac['shift']());}};_0x33eaee(++_0x20e179);}(_0xd3c6,0x121));var _0x6d3c=function(_0x581c38,_0x7888d9){_0x581c38=_0x581c38-0x0;var _0x17bd29=_0xd3c6[_0x581c38];return _0x17bd29;};'use strict';var _=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var logger=require(_0x6d3c('0x2'))(_0x6d3c('0x3'));var moment=require(_0x6d3c('0x4'));var BPromise=require(_0x6d3c('0x5'));var rp=require(_0x6d3c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var attributes=require('./chatApplication.attributes');module[_0x6d3c('0x9')]=function(_0x28bc65,_0xbc627e){return _0x28bc65[_0x6d3c('0xa')](_0x6d3c('0xb'),attributes,{'tableName':_0x6d3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d3c('0xd'),'collate':_0x6d3c('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1108f31..cd1657f 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 _0x8e59=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x173228,_0x425401){var _0x13e0ef=function(_0x5f013a){while(--_0x5f013a){_0x173228['push'](_0x173228['shift']());}};_0x13e0ef(++_0x425401);}(_0x8e59,0x85));var _0x98e5=function(_0x45ca01,_0x2ca800){_0x45ca01=_0x45ca01-0x0;var _0x2215a6=_0x8e59[_0x45ca01];return _0x2215a6;};'use strict';var _=require(_0x98e5('0x0'));var util=require(_0x98e5('0x1'));var moment=require('moment');var BPromise=require(_0x98e5('0x2'));var rs=require(_0x98e5('0x3'));var fs=require('fs');var Redis=require(_0x98e5('0x4'));var db=require(_0x98e5('0x5'))['db'];var utils=require(_0x98e5('0x6'));var logger=require(_0x98e5('0x7'))(_0x98e5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x98e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e4cb2,_0x54350c,_0x345631){return new BPromise(function(_0x4ac289,_0x2e42fd){return client[_0x98e5('0xa')](_0x2e4cb2,_0x345631)[_0x98e5('0xb')](function(_0x33926d){logger[_0x98e5('0xc')](_0x98e5('0xd'),_0x54350c,_0x98e5('0xe'));logger[_0x98e5('0xf')](_0x98e5('0x10'),_0x54350c,_0x98e5('0xe'),JSON[_0x98e5('0x11')](_0x33926d));if(_0x33926d[_0x98e5('0x12')]){if(_0x33926d['error']['code']===0x1f4){logger[_0x98e5('0x12')]('ChatApplication,\x20%s,\x20%s',_0x54350c,_0x33926d[_0x98e5('0x12')][_0x98e5('0x13')]);return _0x2e42fd(_0x33926d[_0x98e5('0x12')][_0x98e5('0x13')]);}logger[_0x98e5('0x12')](_0x98e5('0xd'),_0x54350c,_0x33926d[_0x98e5('0x12')][_0x98e5('0x13')]);return _0x4ac289(_0x33926d['error']['message']);}else{logger['info'](_0x98e5('0xd'),_0x54350c,'request\x20sent');_0x4ac289(_0x33926d[_0x98e5('0x14')][_0x98e5('0x13')]);}})[_0x98e5('0x15')](function(_0x3d3ad7){logger[_0x98e5('0x12')](_0x98e5('0xd'),_0x54350c,_0x3d3ad7);_0x2e42fd(_0x3d3ad7);});});} \ No newline at end of file +var _0x7726=['catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7726,0xf3));var _0x6772=function(_0x133ea1,_0x337441){_0x133ea1=_0x133ea1-0x0;var _0xaa1252=_0x7726[_0x133ea1];return _0xaa1252;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6772('0x0'));var BPromise=require(_0x6772('0x1'));var rs=require(_0x6772('0x2'));var fs=require('fs');var Redis=require(_0x6772('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6772('0x4'));var logger=require(_0x6772('0x5'))(_0x6772('0x6'));var config=require(_0x6772('0x7'));var jayson=require(_0x6772('0x8'));var client=jayson[_0x6772('0x9')][_0x6772('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18a406,_0x4f9d4a,_0x309a80){return new BPromise(function(_0x579b82,_0x7cb360){return client[_0x6772('0xb')](_0x18a406,_0x309a80)['then'](function(_0xf36512){logger[_0x6772('0xc')](_0x6772('0xd'),_0x4f9d4a,_0x6772('0xe'));logger[_0x6772('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4f9d4a,_0x6772('0xe'),JSON[_0x6772('0x10')](_0xf36512));if(_0xf36512[_0x6772('0x11')]){if(_0xf36512[_0x6772('0x11')][_0x6772('0x12')]===0x1f4){logger[_0x6772('0x11')](_0x6772('0xd'),_0x4f9d4a,_0xf36512[_0x6772('0x11')][_0x6772('0x13')]);return _0x7cb360(_0xf36512[_0x6772('0x11')][_0x6772('0x13')]);}logger['error'](_0x6772('0xd'),_0x4f9d4a,_0xf36512[_0x6772('0x11')][_0x6772('0x13')]);return _0x579b82(_0xf36512[_0x6772('0x11')][_0x6772('0x13')]);}else{logger[_0x6772('0xc')](_0x6772('0xd'),_0x4f9d4a,_0x6772('0xe'));_0x579b82(_0xf36512[_0x6772('0x14')][_0x6772('0x13')]);}})[_0x6772('0x15')](function(_0x522e06){logger[_0x6772('0x11')](_0x6772('0xd'),_0x4f9d4a,_0x522e06);_0x7cb360(_0x522e06);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 2f3e6f9..8d85d9b 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 _0xbebf=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17e1c0,_0x276eec){var _0x3ea9df=function(_0x212c66){while(--_0x212c66){_0x17e1c0['push'](_0x17e1c0['shift']());}};_0x3ea9df(++_0x276eec);}(_0xbebf,0x186));var _0xfbeb=function(_0x251a3e,_0x25fa71){_0x251a3e=_0x251a3e-0x0;var _0x46f2b2=_0xbebf[_0x251a3e];return _0x46f2b2;};'use strict';var multer=require(_0xfbeb('0x0'));var util=require(_0xfbeb('0x1'));var path=require(_0xfbeb('0x2'));var timeout=require(_0xfbeb('0x3'));var express=require(_0xfbeb('0x4'));var router=express[_0xfbeb('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfbeb('0x6'));var interaction=require(_0xfbeb('0x7'));var config=require(_0xfbeb('0x8'));var controller=require(_0xfbeb('0x9'));router[_0xfbeb('0xa')](_0xfbeb('0xb'),auth[_0xfbeb('0xc')](),controller[_0xfbeb('0xd')]);router[_0xfbeb('0xe')](_0xfbeb('0xb'),auth['isAuthenticated'](),controller[_0xfbeb('0xf')]);router[_0xfbeb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfbeb('0x11')]);module[_0xfbeb('0x12')]=router; \ No newline at end of file +var _0x0a58=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x584ba9,_0x43f019){var _0x53864c=function(_0x1a35e0){while(--_0x1a35e0){_0x584ba9['push'](_0x584ba9['shift']());}};_0x53864c(++_0x43f019);}(_0x0a58,0xf7));var _0x80a5=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0a58[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x80a5('0x0'));var util=require(_0x80a5('0x1'));var path=require(_0x80a5('0x2'));var timeout=require(_0x80a5('0x3'));var express=require(_0x80a5('0x4'));var router=express[_0x80a5('0x5')]();var fs_extra=require(_0x80a5('0x6'));var auth=require(_0x80a5('0x7'));var interaction=require(_0x80a5('0x8'));var config=require(_0x80a5('0x9'));var controller=require(_0x80a5('0xa'));router[_0x80a5('0xb')](_0x80a5('0xc'),auth[_0x80a5('0xd')](),controller[_0x80a5('0xe')]);router[_0x80a5('0xf')](_0x80a5('0xc'),auth[_0x80a5('0xd')](),controller[_0x80a5('0x10')]);router['delete'](_0x80a5('0xc'),auth[_0x80a5('0xd')](),controller[_0x80a5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 91b11dd..70a8961 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 _0x98f0=['BOOLEAN','exports'];(function(_0x1133cd,_0x2e7a9d){var _0x419c90=function(_0x15eaa0){while(--_0x15eaa0){_0x1133cd['push'](_0x1133cd['shift']());}};_0x419c90(++_0x2e7a9d);}(_0x98f0,0xdd));var _0x098f=function(_0x320b2d,_0x37f9d8){_0x320b2d=_0x320b2d-0x0;var _0x14d918=_0x98f0[_0x320b2d];return _0x14d918;};'use strict';var Sequelize=require('sequelize');module[_0x098f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x098f('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4656=['STRING','BOOLEAN','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4656,0x110));var _0x6465=function(_0x50bf5a,_0x807bba){_0x50bf5a=_0x50bf5a-0x0;var _0x4ddc1d=_0x4656[_0x50bf5a];return _0x4ddc1d;};'use strict';var Sequelize=require('sequelize');module[_0x6465('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6465('0x1')]},'write':{'type':Sequelize[_0x6465('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index d69c9ad..d4e2594 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 _0x5440=['register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','ChatGroup','findAll','rows','params','length','include','find','create','body','catch','describe','getUnread','count','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','order','pick','options','addMessage','ChatGroupId','ChatInternalMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2408c5,_0x3af6d8){var _0x5a78d4=function(_0x331614){while(--_0x331614){_0x2408c5['push'](_0x2408c5['shift']());}};_0x5a78d4(++_0x3af6d8);}(_0x5440,0x10f));var _0x0544=function(_0x37a4ff,_0x9f11f3){_0x37a4ff=_0x37a4ff-0x0;var _0x35bf83=_0x5440[_0x37a4ff];return _0x35bf83;};'use strict';var emlformat=require(_0x0544('0x0'));var rimraf=require(_0x0544('0x1'));var zipdir=require(_0x0544('0x2'));var jsonpatch=require(_0x0544('0x3'));var rp=require(_0x0544('0x4'));var moment=require(_0x0544('0x5'));var BPromise=require(_0x0544('0x6'));var Mustache=require(_0x0544('0x7'));var util=require(_0x0544('0x8'));var path=require('path');var sox=require(_0x0544('0x9'));var csv=require(_0x0544('0xa'));var ejs=require(_0x0544('0xb'));var fs=require('fs');var fs_extra=require(_0x0544('0xc'));var _=require(_0x0544('0xd'));var squel=require('squel');var crypto=require(_0x0544('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0544('0xf'));var toCsv=require(_0x0544('0xa'));var querystring=require('querystring');var Papa=require(_0x0544('0x10'));var Redis=require(_0x0544('0x11'));var authService=require(_0x0544('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0544('0x13'));var hardwareService=require(_0x0544('0x14'));var logger=require(_0x0544('0x15'))(_0x0544('0x16'));var utils=require(_0x0544('0x17'));var config=require(_0x0544('0x18'));var licenseUtil=require(_0x0544('0x19'));var db=require(_0x0544('0x1a'))['db'];config['redis']=_[_0x0544('0x1b')](config[_0x0544('0x1c')],{'host':_0x0544('0x1d'),'port':0x18eb});var socket=require(_0x0544('0x1e'))(new Redis(config['redis']));require(_0x0544('0x1f'))[_0x0544('0x20')](socket);function respondWithStatusCode(_0x4d11fc,_0x477637){_0x477637=_0x477637||0xcc;return function(_0x319fc7){if(_0x319fc7){return _0x4d11fc[_0x0544('0x21')](_0x477637);}return _0x4d11fc[_0x0544('0x22')](_0x477637)[_0x0544('0x23')]();};}function respondWithResult(_0x3d0d4b,_0x2c28c8){_0x2c28c8=_0x2c28c8||0xc8;return function(_0x29713f){if(_0x29713f){return _0x3d0d4b['status'](_0x2c28c8)[_0x0544('0x24')](_0x29713f);}};}function respondWithFilteredResult(_0x56f22a,_0x4df5a0){return function(_0x1fc231){if(_0x1fc231){var _0x5d55c0=typeof _0x4df5a0[_0x0544('0x25')]==='undefined'&&typeof _0x4df5a0[_0x0544('0x26')]==='undefined';var _0x156264=_0x1fc231['count'];var _0x21985e=_0x5d55c0?0x0:_0x4df5a0[_0x0544('0x25')];var _0x350948=_0x5d55c0?_0x1fc231['count']:_0x4df5a0[_0x0544('0x25')]+_0x4df5a0[_0x0544('0x26')];var _0x12041a;if(_0x350948>=_0x156264){_0x350948=_0x156264;_0x12041a=0xc8;}else{_0x12041a=0xce;}_0x56f22a[_0x0544('0x22')](_0x12041a);return _0x56f22a[_0x0544('0x27')](_0x0544('0x28'),_0x21985e+'-'+_0x350948+'/'+_0x156264)['json'](_0x1fc231);}return null;};}function patchUpdates(_0x354b5e){return function(_0x15f7f5){try{jsonpatch[_0x0544('0x29')](_0x15f7f5,_0x354b5e,!![]);}catch(_0x6131b1){return BPromise[_0x0544('0x2a')](_0x6131b1);}return _0x15f7f5[_0x0544('0x2b')]();};}function saveUpdates(_0x4c7dd3,_0x7b612f){return function(_0xc7a84b){if(_0xc7a84b){return _0xc7a84b[_0x0544('0x2c')](_0x4c7dd3)['then'](function(_0x5640dc){return _0x5640dc;});}return null;};}function removeEntity(_0x4fa63d,_0x5371f8){return function(_0x353929){if(_0x353929){return _0x353929[_0x0544('0x2d')]()[_0x0544('0x2e')](function(){_0x4fa63d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb5be,_0x5ab76a){return function(_0xa72a42){if(!_0xa72a42){_0x1cb5be['sendStatus'](0x194);}return _0xa72a42;};}function handleError(_0x148ef4,_0x2e86d2){_0x2e86d2=_0x2e86d2||0x1f4;return function(_0x351611){logger[_0x0544('0x2f')](_0x351611[_0x0544('0x30')]);if(_0x351611[_0x0544('0x31')]){delete _0x351611[_0x0544('0x31')];}_0x148ef4['status'](_0x2e86d2)[_0x0544('0x32')](_0x351611);};}exports[_0x0544('0x33')]=function(_0x572fba,_0x54cea5){var _0x175168={},_0x457ddb={},_0xa9f0a9={'count':0x0,'rows':[]};var _0x235d7a=_['map'](db['ChatGroup'][_0x0544('0x34')],function(_0x57c1ec){return{'name':_0x57c1ec['fieldName'],'type':_0x57c1ec[_0x0544('0x35')][_0x0544('0x36')]};});_0x457ddb['model']=_[_0x0544('0x37')](_0x235d7a,'name');_0x457ddb[_0x0544('0x38')]=_[_0x0544('0x39')](_0x572fba[_0x0544('0x38')]);_0x457ddb['filters']=_[_0x0544('0x3a')](_0x457ddb[_0x0544('0x3b')],_0x457ddb[_0x0544('0x38')]);_0x175168[_0x0544('0x3c')]=_[_0x0544('0x3a')](_0x457ddb[_0x0544('0x3b')],qs['fields'](_0x572fba[_0x0544('0x38')][_0x0544('0x3d')]));_0x175168['attributes']=_0x175168[_0x0544('0x3c')]['length']?_0x175168[_0x0544('0x3c')]:_0x457ddb[_0x0544('0x3b')];if(!_0x572fba[_0x0544('0x38')][_0x0544('0x3e')](_0x0544('0x3f'))){_0x175168['limit']=qs[_0x0544('0x26')](_0x572fba[_0x0544('0x38')][_0x0544('0x26')]);_0x175168[_0x0544('0x25')]=qs[_0x0544('0x25')](_0x572fba[_0x0544('0x38')][_0x0544('0x25')]);}_0x175168['order']=qs[_0x0544('0x40')](_0x572fba[_0x0544('0x38')]['sort']);_0x175168[_0x0544('0x41')]=qs[_0x0544('0x42')](_['pick'](_0x572fba[_0x0544('0x38')],_0x457ddb['filters']),_0x235d7a);if(_0x572fba[_0x0544('0x38')][_0x0544('0x43')]){_0x175168[_0x0544('0x41')]=_[_0x0544('0x44')](_0x175168[_0x0544('0x41')],{'$or':_[_0x0544('0x37')](_0x235d7a,function(_0x59cf16){if(_0x59cf16[_0x0544('0x35')]!==_0x0544('0x45')){var _0x35aafd={};_0x35aafd[_0x59cf16[_0x0544('0x31')]]={'$like':'%'+_0x572fba[_0x0544('0x38')]['filter']+'%'};return _0x35aafd;}})});}_0x175168=_[_0x0544('0x44')]({},_0x175168,_0x572fba['options']);var _0x339863={'where':_0x175168[_0x0544('0x41')]};return db['ChatGroup']['count'](_0x339863)[_0x0544('0x2e')](function(_0x27bca2){_0xa9f0a9['count']=_0x27bca2;if(_0x572fba[_0x0544('0x38')][_0x0544('0x46')]){_0x175168['include']=[{'all':!![]}];}return db[_0x0544('0x47')][_0x0544('0x48')](_0x175168);})['then'](function(_0x4a2578){_0xa9f0a9[_0x0544('0x49')]=_0x4a2578;return _0xa9f0a9;})[_0x0544('0x2e')](respondWithFilteredResult(_0x54cea5,_0x175168))['catch'](handleError(_0x54cea5,null));};exports['show']=function(_0x35b326,_0x20a66b){var _0x48070d={'raw':!![],'where':{'id':_0x35b326[_0x0544('0x4a')]['id']}},_0x57a350={};_0x57a350[_0x0544('0x3b')]=_[_0x0544('0x39')](db[_0x0544('0x47')]['rawAttributes']);_0x57a350['query']=_[_0x0544('0x39')](_0x35b326[_0x0544('0x38')]);_0x57a350[_0x0544('0x42')]=_[_0x0544('0x3a')](_0x57a350[_0x0544('0x3b')],_0x57a350[_0x0544('0x38')]);_0x48070d[_0x0544('0x3c')]=_['intersection'](_0x57a350[_0x0544('0x3b')],qs[_0x0544('0x3d')](_0x35b326['query']['fields']));_0x48070d[_0x0544('0x3c')]=_0x48070d[_0x0544('0x3c')][_0x0544('0x4b')]?_0x48070d[_0x0544('0x3c')]:_0x57a350['model'];if(_0x35b326[_0x0544('0x38')][_0x0544('0x46')]){_0x48070d[_0x0544('0x4c')]=[{'all':!![]}];}_0x48070d=_[_0x0544('0x44')]({},_0x48070d,_0x35b326['options']);return db[_0x0544('0x47')][_0x0544('0x4d')](_0x48070d)[_0x0544('0x2e')](handleEntityNotFound(_0x20a66b,null))[_0x0544('0x2e')](respondWithResult(_0x20a66b,null))['catch'](handleError(_0x20a66b,null));};exports[_0x0544('0x4e')]=function(_0x15abfe,_0x3d6d5b){return db[_0x0544('0x47')][_0x0544('0x4e')](_0x15abfe[_0x0544('0x4f')],{})[_0x0544('0x2e')](respondWithResult(_0x3d6d5b,0xc9))[_0x0544('0x50')](handleError(_0x3d6d5b,null));};exports[_0x0544('0x2c')]=function(_0x166a04,_0x147e09){if(_0x166a04[_0x0544('0x4f')]['id']){delete _0x166a04[_0x0544('0x4f')]['id'];}return db[_0x0544('0x47')]['find']({'where':{'id':_0x166a04[_0x0544('0x4a')]['id']}})[_0x0544('0x2e')](handleEntityNotFound(_0x147e09,null))[_0x0544('0x2e')](saveUpdates(_0x166a04[_0x0544('0x4f')],null))[_0x0544('0x2e')](respondWithResult(_0x147e09,null))[_0x0544('0x50')](handleError(_0x147e09,null));};exports[_0x0544('0x2d')]=function(_0x4b58e8,_0x46786e){return db['ChatGroup'][_0x0544('0x4d')]({'where':{'id':_0x4b58e8['params']['id']}})[_0x0544('0x2e')](handleEntityNotFound(_0x46786e,null))[_0x0544('0x2e')](removeEntity(_0x46786e,null))[_0x0544('0x50')](handleError(_0x46786e,null));};exports['describe']=function(_0x1cf309,_0x4cf1c1){return db[_0x0544('0x47')][_0x0544('0x51')]()[_0x0544('0x2e')](respondWithResult(_0x4cf1c1,null))[_0x0544('0x50')](handleError(_0x4cf1c1,null));};exports[_0x0544('0x52')]=function(_0x2a7c79,_0x76295a,_0x36af13){return db['ChatInternalMessage'][_0x0544('0x53')]({'where':{'ChatGroupId':_0x2a7c79['params']['id'],'ToId':_0x2a7c79[_0x0544('0x54')]['id'],'read':![]}})[_0x0544('0x2e')](function(_0x43c6ed){return{'id':_[_0x0544('0x55')](_0x2a7c79[_0x0544('0x4a')]['id']),'count':_0x43c6ed};})['then'](respondWithResult(_0x76295a,null))[_0x0544('0x50')](handleError(_0x76295a,null));};exports[_0x0544('0x56')]=function(_0x3fec3c,_0x55ce49,_0x4605b9){return db['ChatGroup']['find']({'where':{'id':_0x3fec3c['params']['id']}})[_0x0544('0x2e')](handleEntityNotFound(_0x55ce49,null))[_0x0544('0x2e')](function(_0x25df62){if(_0x25df62){return _0x25df62[_0x0544('0x56')](_0x3fec3c[_0x0544('0x4f')]['ids'],_[_0x0544('0x57')](_0x3fec3c[_0x0544('0x4f')],[_0x0544('0x58'),'id'])||{});}})[_0x0544('0x2e')](respondWithResult(_0x55ce49,null))['catch'](handleError(_0x55ce49,null));};exports[_0x0544('0x59')]=function(_0x298a49,_0x55a9ee,_0x20e23b){var _0x5af0b2={};var _0x61fec9={};var _0x551b7f;var _0x476b4a;return db[_0x0544('0x47')][_0x0544('0x5a')]({'where':{'id':_0x298a49[_0x0544('0x4a')]['id']}})[_0x0544('0x2e')](handleEntityNotFound(_0x55a9ee,null))[_0x0544('0x2e')](function(_0x2591ef){if(_0x2591ef){_0x551b7f=_0x2591ef;_0x61fec9[_0x0544('0x3b')]=_['keys'](db[_0x0544('0x5b')][_0x0544('0x34')]);_0x61fec9[_0x0544('0x38')]=_[_0x0544('0x39')](_0x298a49[_0x0544('0x38')]);_0x61fec9[_0x0544('0x42')]=_['intersection'](_0x61fec9[_0x0544('0x3b')],_0x61fec9[_0x0544('0x38')]);_0x5af0b2[_0x0544('0x3c')]=_['intersection'](_0x61fec9[_0x0544('0x3b')],qs[_0x0544('0x3d')](_0x298a49[_0x0544('0x38')][_0x0544('0x3d')]));_0x5af0b2[_0x0544('0x3c')]=_0x5af0b2[_0x0544('0x3c')][_0x0544('0x4b')]?_0x5af0b2['attributes']:_0x61fec9['model'];_0x5af0b2[_0x0544('0x5c')]=qs['sort'](_0x298a49['query'][_0x0544('0x40')]);_0x5af0b2[_0x0544('0x41')]=qs[_0x0544('0x42')](_[_0x0544('0x5d')](_0x298a49[_0x0544('0x38')],_0x61fec9[_0x0544('0x42')]));if(_0x298a49[_0x0544('0x38')]['filter']){_0x5af0b2[_0x0544('0x41')]=_[_0x0544('0x44')](_0x5af0b2['where'],{'$or':_[_0x0544('0x37')](_0x5af0b2[_0x0544('0x3c')],function(_0x5402fb){var _0x592b4b={};_0x592b4b[_0x5402fb]={'$like':'%'+_0x298a49[_0x0544('0x38')][_0x0544('0x43')]+'%'};return _0x592b4b;})});}_0x5af0b2=_['merge']({},_0x5af0b2,_0x298a49[_0x0544('0x5e')]);return _0x551b7f[_0x0544('0x59')](_0x5af0b2);}})[_0x0544('0x2e')](function(_0x564554){if(_0x564554){_0x476b4a=_0x564554[_0x0544('0x4b')];if(!_0x298a49['query'][_0x0544('0x3e')](_0x0544('0x3f'))){_0x5af0b2[_0x0544('0x26')]=qs[_0x0544('0x26')](_0x298a49['query']['limit']);_0x5af0b2[_0x0544('0x25')]=qs[_0x0544('0x25')](_0x298a49[_0x0544('0x38')][_0x0544('0x25')]);}return _0x551b7f[_0x0544('0x59')](_0x5af0b2);}})[_0x0544('0x2e')](function(_0x121a32){if(_0x121a32){return _0x121a32?{'count':_0x476b4a,'rows':_0x121a32}:null;}})[_0x0544('0x2e')](respondWithResult(_0x55a9ee,null))[_0x0544('0x50')](handleError(_0x55a9ee,null));};exports['removeMembers']=function(_0x133598,_0x5c3022,_0x2a6b88){return db[_0x0544('0x47')][_0x0544('0x4d')]({'where':{'id':_0x133598[_0x0544('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c3022,null))[_0x0544('0x2e')](function(_0x25a26b){if(_0x25a26b){return _0x25a26b['removeMembers'](_0x133598[_0x0544('0x38')][_0x0544('0x58')]);}})[_0x0544('0x2e')](respondWithStatusCode(_0x5c3022,null))[_0x0544('0x50')](handleError(_0x5c3022,null));};exports[_0x0544('0x5f')]=function(_0x2b3303,_0x4c1261,_0x51a425){if(_0x2b3303['body']['id']){delete _0x2b3303['body']['id'];}return db[_0x0544('0x47')][_0x0544('0x4d')]({'where':{'id':_0x2b3303[_0x0544('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c1261,null))[_0x0544('0x2e')](function(_0x2950ae){if(_0x2950ae){_0x2b3303[_0x0544('0x4f')][_0x0544('0x60')]=_0x2950ae['id'];return db[_0x0544('0x61')]['create'](_0x2b3303[_0x0544('0x4f')]);}})[_0x0544('0x2e')](respondWithResult(_0x4c1261,null))[_0x0544('0x50')](handleError(_0x4c1261,null));};exports['getMessages']=function(_0x423c24,_0x3056fc,_0x14074b){var _0x1c3682={};var _0x4aaf87={};var _0x10e8eb;var _0x3bbfc3;return db[_0x0544('0x47')][_0x0544('0x5a')]({'where':{'id':_0x423c24[_0x0544('0x4a')]['id']}})[_0x0544('0x2e')](handleEntityNotFound(_0x3056fc,null))['then'](function(_0x927734){if(_0x927734){_0x10e8eb=_0x927734;_0x4aaf87['model']=_['keys'](db['ChatInternalMessage'][_0x0544('0x34')]);_0x4aaf87[_0x0544('0x38')]=_[_0x0544('0x39')](_0x423c24['query']);_0x4aaf87[_0x0544('0x42')]=_[_0x0544('0x3a')](_0x4aaf87['model'],_0x4aaf87[_0x0544('0x38')]);_0x1c3682[_0x0544('0x3c')]=_[_0x0544('0x3a')](_0x4aaf87[_0x0544('0x3b')],qs['fields'](_0x423c24[_0x0544('0x38')]['fields']));_0x1c3682[_0x0544('0x3c')]=_0x1c3682[_0x0544('0x3c')][_0x0544('0x4b')]?_0x1c3682[_0x0544('0x3c')]:_0x4aaf87[_0x0544('0x3b')];_0x1c3682['order']=qs[_0x0544('0x40')](_0x423c24[_0x0544('0x38')][_0x0544('0x40')]);_0x1c3682['where']=qs['filters'](_[_0x0544('0x5d')](_0x423c24[_0x0544('0x38')],_0x4aaf87[_0x0544('0x42')]));if(_0x423c24[_0x0544('0x38')][_0x0544('0x43')]){_0x1c3682[_0x0544('0x41')]=_[_0x0544('0x44')](_0x1c3682['where'],{'$or':_[_0x0544('0x37')](_0x1c3682[_0x0544('0x3c')],function(_0x226881){var _0x14afb3={};_0x14afb3[_0x226881]={'$like':'%'+_0x423c24['query'][_0x0544('0x43')]+'%'};return _0x14afb3;})});}if(_0x423c24[_0x0544('0x38')][_0x0544('0x62')]){var _0x450d26=_0x423c24[_0x0544('0x38')][_0x0544('0x62')]['split'](',');var _0x1d1f30={};_0x1d1f30[_0x450d26[0x0]]={'$gte':moment(_0x450d26[0x1])['format'](_0x0544('0x63'))};_0x1c3682['where']=_[_0x0544('0x44')](_0x1c3682[_0x0544('0x41')],_0x1d1f30);}_0x1c3682=_[_0x0544('0x44')]({},_0x1c3682,_0x423c24[_0x0544('0x5e')]);return _0x10e8eb[_0x0544('0x64')](_0x1c3682);}})[_0x0544('0x2e')](function(_0x274ed4){if(_0x274ed4){_0x3bbfc3=_0x274ed4[_0x0544('0x4b')];if(!_0x423c24['query']['hasOwnProperty'](_0x0544('0x3f'))){_0x1c3682[_0x0544('0x26')]=qs['limit'](_0x423c24[_0x0544('0x38')][_0x0544('0x26')]);_0x1c3682['offset']=qs['offset'](_0x423c24['query']['offset']);}return _0x10e8eb[_0x0544('0x64')](_0x1c3682);}})[_0x0544('0x2e')](function(_0xd03b63){if(_0xd03b63){return _0xd03b63?{'count':_0x3bbfc3,'rows':_0xd03b63}:null;}})[_0x0544('0x2e')](respondWithResult(_0x3056fc,null))[_0x0544('0x50')](handleError(_0x3056fc,null));}; \ No newline at end of file +var _0x6d42=['count','set','Content-Range','reject','update','destroy','error','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','findAll','rows','catch','keys','includeAll','include','find','create','body','params','describe','getUnread','toInteger','addMembers','getMembers','findOne','removeMembers','ids','ChatGroupId','ChatInternalMessage','split','format','getMessages','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x5049a7,_0xad7685){var _0x2f8aa9=function(_0x513a47){while(--_0x513a47){_0x5049a7['push'](_0x5049a7['shift']());}};_0x2f8aa9(++_0xad7685);}(_0x6d42,0xf0));var _0x26d4=function(_0x3c44fb,_0x15784c){_0x3c44fb=_0x3c44fb-0x0;var _0x338641=_0x6d42[_0x3c44fb];return _0x338641;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26d4('0x0'));var jsonpatch=require(_0x26d4('0x1'));var rp=require(_0x26d4('0x2'));var moment=require(_0x26d4('0x3'));var BPromise=require(_0x26d4('0x4'));var Mustache=require('mustache');var util=require(_0x26d4('0x5'));var path=require(_0x26d4('0x6'));var sox=require(_0x26d4('0x7'));var csv=require(_0x26d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26d4('0x9'));var _=require(_0x26d4('0xa'));var squel=require('squel');var crypto=require(_0x26d4('0xb'));var jsforce=require(_0x26d4('0xc'));var deskjs=require(_0x26d4('0xd'));var toCsv=require(_0x26d4('0x8'));var querystring=require(_0x26d4('0xe'));var Papa=require(_0x26d4('0xf'));var Redis=require(_0x26d4('0x10'));var authService=require(_0x26d4('0x11'));var qs=require(_0x26d4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26d4('0x13'));var logger=require(_0x26d4('0x14'))(_0x26d4('0x15'));var utils=require(_0x26d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x26d4('0x17'));var db=require(_0x26d4('0x18'))['db'];config[_0x26d4('0x19')]=_[_0x26d4('0x1a')](config[_0x26d4('0x19')],{'host':_0x26d4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x26d4('0x1c'))['register'](socket);function respondWithStatusCode(_0xb2d516,_0x5c6146){_0x5c6146=_0x5c6146||0xcc;return function(_0x3d2879){if(_0x3d2879){return _0xb2d516[_0x26d4('0x1d')](_0x5c6146);}return _0xb2d516[_0x26d4('0x1e')](_0x5c6146)[_0x26d4('0x1f')]();};}function respondWithResult(_0x243116,_0x4088f9){_0x4088f9=_0x4088f9||0xc8;return function(_0x50fc53){if(_0x50fc53){return _0x243116[_0x26d4('0x1e')](_0x4088f9)[_0x26d4('0x20')](_0x50fc53);}};}function respondWithFilteredResult(_0xf9b387,_0x1e6f5c){return function(_0x5384b7){if(_0x5384b7){var _0x1c3c2c=typeof _0x1e6f5c[_0x26d4('0x21')]===_0x26d4('0x22')&&typeof _0x1e6f5c[_0x26d4('0x23')]===_0x26d4('0x22');var _0x54a358=_0x5384b7[_0x26d4('0x24')];var _0x2cc6c8=_0x1c3c2c?0x0:_0x1e6f5c[_0x26d4('0x21')];var _0x50848c=_0x1c3c2c?_0x5384b7[_0x26d4('0x24')]:_0x1e6f5c['offset']+_0x1e6f5c[_0x26d4('0x23')];var _0x543940;if(_0x50848c>=_0x54a358){_0x50848c=_0x54a358;_0x543940=0xc8;}else{_0x543940=0xce;}_0xf9b387[_0x26d4('0x1e')](_0x543940);return _0xf9b387[_0x26d4('0x25')](_0x26d4('0x26'),_0x2cc6c8+'-'+_0x50848c+'/'+_0x54a358)['json'](_0x5384b7);}return null;};}function patchUpdates(_0x37c6b3){return function(_0x1c3869){try{jsonpatch['apply'](_0x1c3869,_0x37c6b3,!![]);}catch(_0x5b0776){return BPromise[_0x26d4('0x27')](_0x5b0776);}return _0x1c3869['save']();};}function saveUpdates(_0x49b460,_0x3bfed2){return function(_0x1b0851){if(_0x1b0851){return _0x1b0851[_0x26d4('0x28')](_0x49b460)['then'](function(_0x1d4276){return _0x1d4276;});}return null;};}function removeEntity(_0x428a69,_0x5eca70){return function(_0x74abb6){if(_0x74abb6){return _0x74abb6[_0x26d4('0x29')]()['then'](function(){_0x428a69[_0x26d4('0x1e')](0xcc)[_0x26d4('0x1f')]();});}};}function handleEntityNotFound(_0x33c78b,_0x58cb99){return function(_0x31a39b){if(!_0x31a39b){_0x33c78b[_0x26d4('0x1d')](0x194);}return _0x31a39b;};}function handleError(_0x5e7358,_0x129701){_0x129701=_0x129701||0x1f4;return function(_0x55d8a5){logger[_0x26d4('0x2a')](_0x55d8a5['stack']);if(_0x55d8a5[_0x26d4('0x2b')]){delete _0x55d8a5[_0x26d4('0x2b')];}_0x5e7358[_0x26d4('0x1e')](_0x129701)['send'](_0x55d8a5);};}exports[_0x26d4('0x2c')]=function(_0x11eda0,_0x1b34a9){var _0x414000={},_0x1211ed={},_0x366302={'count':0x0,'rows':[]};var _0xf35d47=_['map'](db[_0x26d4('0x2d')][_0x26d4('0x2e')],function(_0x511a9a){return{'name':_0x511a9a[_0x26d4('0x2f')],'type':_0x511a9a[_0x26d4('0x30')][_0x26d4('0x31')]};});_0x1211ed[_0x26d4('0x32')]=_[_0x26d4('0x33')](_0xf35d47,_0x26d4('0x2b'));_0x1211ed[_0x26d4('0x34')]=_['keys'](_0x11eda0[_0x26d4('0x34')]);_0x1211ed[_0x26d4('0x35')]=_[_0x26d4('0x36')](_0x1211ed[_0x26d4('0x32')],_0x1211ed['query']);_0x414000[_0x26d4('0x37')]=_[_0x26d4('0x36')](_0x1211ed[_0x26d4('0x32')],qs[_0x26d4('0x38')](_0x11eda0['query'][_0x26d4('0x38')]));_0x414000['attributes']=_0x414000['attributes'][_0x26d4('0x39')]?_0x414000[_0x26d4('0x37')]:_0x1211ed[_0x26d4('0x32')];if(!_0x11eda0[_0x26d4('0x34')][_0x26d4('0x3a')](_0x26d4('0x3b'))){_0x414000[_0x26d4('0x23')]=qs[_0x26d4('0x23')](_0x11eda0[_0x26d4('0x34')][_0x26d4('0x23')]);_0x414000[_0x26d4('0x21')]=qs['offset'](_0x11eda0[_0x26d4('0x34')][_0x26d4('0x21')]);}_0x414000[_0x26d4('0x3c')]=qs[_0x26d4('0x3d')](_0x11eda0[_0x26d4('0x34')][_0x26d4('0x3d')]);_0x414000['where']=qs[_0x26d4('0x35')](_[_0x26d4('0x3e')](_0x11eda0[_0x26d4('0x34')],_0x1211ed['filters']),_0xf35d47);if(_0x11eda0['query'][_0x26d4('0x3f')]){_0x414000[_0x26d4('0x40')]=_['merge'](_0x414000['where'],{'$or':_['map'](_0xf35d47,function(_0x59e6fd){if(_0x59e6fd[_0x26d4('0x30')]!==_0x26d4('0x41')){var _0x523bd7={};_0x523bd7[_0x59e6fd[_0x26d4('0x2b')]]={'$like':'%'+_0x11eda0[_0x26d4('0x34')][_0x26d4('0x3f')]+'%'};return _0x523bd7;}})});}_0x414000=_[_0x26d4('0x42')]({},_0x414000,_0x11eda0[_0x26d4('0x43')]);var _0x6c001b={'where':_0x414000[_0x26d4('0x40')]};return db[_0x26d4('0x2d')][_0x26d4('0x24')](_0x6c001b)[_0x26d4('0x44')](function(_0x556140){_0x366302[_0x26d4('0x24')]=_0x556140;if(_0x11eda0['query']['includeAll']){_0x414000['include']=[{'all':!![]}];}return db[_0x26d4('0x2d')][_0x26d4('0x45')](_0x414000);})['then'](function(_0x353c67){_0x366302[_0x26d4('0x46')]=_0x353c67;return _0x366302;})[_0x26d4('0x44')](respondWithFilteredResult(_0x1b34a9,_0x414000))[_0x26d4('0x47')](handleError(_0x1b34a9,null));};exports['show']=function(_0x2ef78a,_0x2e550d){var _0x5f6898={'raw':!![],'where':{'id':_0x2ef78a['params']['id']}},_0x55fe34={};_0x55fe34[_0x26d4('0x32')]=_[_0x26d4('0x48')](db['ChatGroup']['rawAttributes']);_0x55fe34[_0x26d4('0x34')]=_[_0x26d4('0x48')](_0x2ef78a['query']);_0x55fe34['filters']=_[_0x26d4('0x36')](_0x55fe34[_0x26d4('0x32')],_0x55fe34[_0x26d4('0x34')]);_0x5f6898[_0x26d4('0x37')]=_[_0x26d4('0x36')](_0x55fe34[_0x26d4('0x32')],qs[_0x26d4('0x38')](_0x2ef78a[_0x26d4('0x34')][_0x26d4('0x38')]));_0x5f6898[_0x26d4('0x37')]=_0x5f6898[_0x26d4('0x37')][_0x26d4('0x39')]?_0x5f6898['attributes']:_0x55fe34[_0x26d4('0x32')];if(_0x2ef78a['query'][_0x26d4('0x49')]){_0x5f6898[_0x26d4('0x4a')]=[{'all':!![]}];}_0x5f6898=_[_0x26d4('0x42')]({},_0x5f6898,_0x2ef78a[_0x26d4('0x43')]);return db[_0x26d4('0x2d')][_0x26d4('0x4b')](_0x5f6898)['then'](handleEntityNotFound(_0x2e550d,null))[_0x26d4('0x44')](respondWithResult(_0x2e550d,null))[_0x26d4('0x47')](handleError(_0x2e550d,null));};exports['create']=function(_0x188d53,_0x2ad1a3){return db['ChatGroup'][_0x26d4('0x4c')](_0x188d53[_0x26d4('0x4d')],{})[_0x26d4('0x44')](respondWithResult(_0x2ad1a3,0xc9))['catch'](handleError(_0x2ad1a3,null));};exports[_0x26d4('0x28')]=function(_0x6b6f05,_0x45a71d){if(_0x6b6f05[_0x26d4('0x4d')]['id']){delete _0x6b6f05[_0x26d4('0x4d')]['id'];}return db[_0x26d4('0x2d')][_0x26d4('0x4b')]({'where':{'id':_0x6b6f05[_0x26d4('0x4e')]['id']}})[_0x26d4('0x44')](handleEntityNotFound(_0x45a71d,null))[_0x26d4('0x44')](saveUpdates(_0x6b6f05[_0x26d4('0x4d')],null))[_0x26d4('0x44')](respondWithResult(_0x45a71d,null))[_0x26d4('0x47')](handleError(_0x45a71d,null));};exports[_0x26d4('0x29')]=function(_0x2ec730,_0x46d6f2){return db[_0x26d4('0x2d')]['find']({'where':{'id':_0x2ec730[_0x26d4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x46d6f2,null))[_0x26d4('0x44')](removeEntity(_0x46d6f2,null))[_0x26d4('0x47')](handleError(_0x46d6f2,null));};exports[_0x26d4('0x4f')]=function(_0x1204ac,_0x3f4975){return db[_0x26d4('0x2d')][_0x26d4('0x4f')]()[_0x26d4('0x44')](respondWithResult(_0x3f4975,null))[_0x26d4('0x47')](handleError(_0x3f4975,null));};exports[_0x26d4('0x50')]=function(_0x8c5b85,_0x4675f6,_0x39f658){return db['ChatInternalMessage'][_0x26d4('0x24')]({'where':{'ChatGroupId':_0x8c5b85['params']['id'],'ToId':_0x8c5b85['user']['id'],'read':![]}})['then'](function(_0x22e560){return{'id':_[_0x26d4('0x51')](_0x8c5b85[_0x26d4('0x4e')]['id']),'count':_0x22e560};})[_0x26d4('0x44')](respondWithResult(_0x4675f6,null))[_0x26d4('0x47')](handleError(_0x4675f6,null));};exports[_0x26d4('0x52')]=function(_0x3a750e,_0x44fba4,_0x17bd56){return db[_0x26d4('0x2d')][_0x26d4('0x4b')]({'where':{'id':_0x3a750e[_0x26d4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x44fba4,null))['then'](function(_0x537e99){if(_0x537e99){return _0x537e99[_0x26d4('0x52')](_0x3a750e[_0x26d4('0x4d')]['ids'],_['omit'](_0x3a750e[_0x26d4('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x44fba4,null))[_0x26d4('0x47')](handleError(_0x44fba4,null));};exports[_0x26d4('0x53')]=function(_0x4e0034,_0x277377,_0x17a826){var _0x200e33={};var _0x4c2069={};var _0x53e86e;var _0x37a777;return db[_0x26d4('0x2d')][_0x26d4('0x54')]({'where':{'id':_0x4e0034['params']['id']}})['then'](handleEntityNotFound(_0x277377,null))[_0x26d4('0x44')](function(_0x44f3e6){if(_0x44f3e6){_0x53e86e=_0x44f3e6;_0x4c2069[_0x26d4('0x32')]=_[_0x26d4('0x48')](db['User']['rawAttributes']);_0x4c2069[_0x26d4('0x34')]=_[_0x26d4('0x48')](_0x4e0034[_0x26d4('0x34')]);_0x4c2069[_0x26d4('0x35')]=_[_0x26d4('0x36')](_0x4c2069[_0x26d4('0x32')],_0x4c2069['query']);_0x200e33[_0x26d4('0x37')]=_['intersection'](_0x4c2069[_0x26d4('0x32')],qs['fields'](_0x4e0034[_0x26d4('0x34')][_0x26d4('0x38')]));_0x200e33[_0x26d4('0x37')]=_0x200e33[_0x26d4('0x37')][_0x26d4('0x39')]?_0x200e33[_0x26d4('0x37')]:_0x4c2069[_0x26d4('0x32')];_0x200e33['order']=qs[_0x26d4('0x3d')](_0x4e0034['query'][_0x26d4('0x3d')]);_0x200e33[_0x26d4('0x40')]=qs['filters'](_[_0x26d4('0x3e')](_0x4e0034[_0x26d4('0x34')],_0x4c2069[_0x26d4('0x35')]));if(_0x4e0034['query'][_0x26d4('0x3f')]){_0x200e33[_0x26d4('0x40')]=_['merge'](_0x200e33[_0x26d4('0x40')],{'$or':_[_0x26d4('0x33')](_0x200e33[_0x26d4('0x37')],function(_0x20cf5d){var _0xb2265e={};_0xb2265e[_0x20cf5d]={'$like':'%'+_0x4e0034[_0x26d4('0x34')][_0x26d4('0x3f')]+'%'};return _0xb2265e;})});}_0x200e33=_[_0x26d4('0x42')]({},_0x200e33,_0x4e0034[_0x26d4('0x43')]);return _0x53e86e[_0x26d4('0x53')](_0x200e33);}})['then'](function(_0x350804){if(_0x350804){_0x37a777=_0x350804['length'];if(!_0x4e0034[_0x26d4('0x34')][_0x26d4('0x3a')](_0x26d4('0x3b'))){_0x200e33[_0x26d4('0x23')]=qs[_0x26d4('0x23')](_0x4e0034[_0x26d4('0x34')][_0x26d4('0x23')]);_0x200e33['offset']=qs[_0x26d4('0x21')](_0x4e0034[_0x26d4('0x34')][_0x26d4('0x21')]);}return _0x53e86e[_0x26d4('0x53')](_0x200e33);}})[_0x26d4('0x44')](function(_0x412f35){if(_0x412f35){return _0x412f35?{'count':_0x37a777,'rows':_0x412f35}:null;}})[_0x26d4('0x44')](respondWithResult(_0x277377,null))['catch'](handleError(_0x277377,null));};exports[_0x26d4('0x55')]=function(_0x45afc3,_0x16841e,_0x55f956){return db[_0x26d4('0x2d')][_0x26d4('0x4b')]({'where':{'id':_0x45afc3['params']['id']}})[_0x26d4('0x44')](handleEntityNotFound(_0x16841e,null))[_0x26d4('0x44')](function(_0x49977a){if(_0x49977a){return _0x49977a['removeMembers'](_0x45afc3['query'][_0x26d4('0x56')]);}})[_0x26d4('0x44')](respondWithStatusCode(_0x16841e,null))[_0x26d4('0x47')](handleError(_0x16841e,null));};exports['addMessage']=function(_0xf04c2b,_0x13ac4b,_0x4320e3){if(_0xf04c2b[_0x26d4('0x4d')]['id']){delete _0xf04c2b[_0x26d4('0x4d')]['id'];}return db[_0x26d4('0x2d')]['find']({'where':{'id':_0xf04c2b[_0x26d4('0x4e')]['id']}})[_0x26d4('0x44')](handleEntityNotFound(_0x13ac4b,null))[_0x26d4('0x44')](function(_0x28c51f){if(_0x28c51f){_0xf04c2b[_0x26d4('0x4d')][_0x26d4('0x57')]=_0x28c51f['id'];return db[_0x26d4('0x58')][_0x26d4('0x4c')](_0xf04c2b['body']);}})[_0x26d4('0x44')](respondWithResult(_0x13ac4b,null))[_0x26d4('0x47')](handleError(_0x13ac4b,null));};exports['getMessages']=function(_0x149942,_0x20e910,_0x4612df){var _0x32af9f={};var _0x1f4305={};var _0x5c648a;var _0x43d9ac;return db[_0x26d4('0x2d')][_0x26d4('0x54')]({'where':{'id':_0x149942[_0x26d4('0x4e')]['id']}})[_0x26d4('0x44')](handleEntityNotFound(_0x20e910,null))[_0x26d4('0x44')](function(_0x114aa0){if(_0x114aa0){_0x5c648a=_0x114aa0;_0x1f4305['model']=_[_0x26d4('0x48')](db[_0x26d4('0x58')][_0x26d4('0x2e')]);_0x1f4305[_0x26d4('0x34')]=_[_0x26d4('0x48')](_0x149942['query']);_0x1f4305[_0x26d4('0x35')]=_[_0x26d4('0x36')](_0x1f4305[_0x26d4('0x32')],_0x1f4305[_0x26d4('0x34')]);_0x32af9f[_0x26d4('0x37')]=_[_0x26d4('0x36')](_0x1f4305['model'],qs[_0x26d4('0x38')](_0x149942[_0x26d4('0x34')][_0x26d4('0x38')]));_0x32af9f[_0x26d4('0x37')]=_0x32af9f['attributes'][_0x26d4('0x39')]?_0x32af9f[_0x26d4('0x37')]:_0x1f4305[_0x26d4('0x32')];_0x32af9f[_0x26d4('0x3c')]=qs[_0x26d4('0x3d')](_0x149942['query'][_0x26d4('0x3d')]);_0x32af9f[_0x26d4('0x40')]=qs['filters'](_[_0x26d4('0x3e')](_0x149942[_0x26d4('0x34')],_0x1f4305[_0x26d4('0x35')]));if(_0x149942[_0x26d4('0x34')][_0x26d4('0x3f')]){_0x32af9f[_0x26d4('0x40')]=_['merge'](_0x32af9f[_0x26d4('0x40')],{'$or':_[_0x26d4('0x33')](_0x32af9f['attributes'],function(_0x414c83){var _0x24b710={};_0x24b710[_0x414c83]={'$like':'%'+_0x149942[_0x26d4('0x34')]['filter']+'%'};return _0x24b710;})});}if(_0x149942[_0x26d4('0x34')]['$gte']){var _0x248960=_0x149942['query']['$gte'][_0x26d4('0x59')](',');var _0x68e656={};_0x68e656[_0x248960[0x0]]={'$gte':moment(_0x248960[0x1])[_0x26d4('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x32af9f['where']=_['merge'](_0x32af9f[_0x26d4('0x40')],_0x68e656);}_0x32af9f=_[_0x26d4('0x42')]({},_0x32af9f,_0x149942['options']);return _0x5c648a[_0x26d4('0x5b')](_0x32af9f);}})[_0x26d4('0x44')](function(_0x570617){if(_0x570617){_0x43d9ac=_0x570617[_0x26d4('0x39')];if(!_0x149942[_0x26d4('0x34')][_0x26d4('0x3a')](_0x26d4('0x3b'))){_0x32af9f[_0x26d4('0x23')]=qs[_0x26d4('0x23')](_0x149942['query']['limit']);_0x32af9f[_0x26d4('0x21')]=qs[_0x26d4('0x21')](_0x149942[_0x26d4('0x34')][_0x26d4('0x21')]);}return _0x5c648a['getMessages'](_0x32af9f);}})[_0x26d4('0x44')](function(_0x30df09){if(_0x30df09){return _0x30df09?{'count':_0x43d9ac,'rows':_0x30df09}:null;}})[_0x26d4('0x44')](respondWithResult(_0x20e910,null))['catch'](handleError(_0x20e910,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f2080a8..45451f7 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 _0xc18f=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x54948b,_0x3a8048){var _0x5d8803=function(_0x2195aa){while(--_0x2195aa){_0x54948b['push'](_0x54948b['shift']());}};_0x5d8803(++_0x3a8048);}(_0xc18f,0x1dc));var _0xfc18=function(_0x12a4ba,_0x1cd254){_0x12a4ba=_0x12a4ba-0x0;var _0x2c0806=_0xc18f[_0x12a4ba];return _0x2c0806;};'use strict';var EventEmitter=require(_0xfc18('0x0'));var ChatGroup=require(_0xfc18('0x1'))['db'][_0xfc18('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfc18('0x3')](0x0);var events={'afterCreate':_0xfc18('0x4'),'afterUpdate':_0xfc18('0x5'),'afterDestroy':_0xfc18('0x6')};function emitEvent(_0x3fa9f){return function(_0x49bcd3,_0x346625,_0x5e761f){ChatGroupEvents[_0xfc18('0x7')](_0x3fa9f+':'+_0x49bcd3['id'],_0x49bcd3);ChatGroupEvents[_0xfc18('0x7')](_0x3fa9f,_0x49bcd3);_0x5e761f(null);};}for(var e in events){if(events[_0xfc18('0x8')](e)){var event=events[e];ChatGroup[_0xfc18('0x9')](e,emitEvent(event));}}module[_0xfc18('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x737c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','ChatGroup'];(function(_0x57433b,_0x4a6782){var _0x5f2f44=function(_0x28f486){while(--_0x28f486){_0x57433b['push'](_0x57433b['shift']());}};_0x5f2f44(++_0x4a6782);}(_0x737c,0x1d2));var _0xc737=function(_0xf64026,_0x43afd3){_0xf64026=_0xf64026-0x0;var _0x1050be=_0x737c[_0xf64026];return _0x1050be;};'use strict';var EventEmitter=require(_0xc737('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xc737('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc737('0x2')](0x0);var events={'afterCreate':_0xc737('0x3'),'afterUpdate':_0xc737('0x4'),'afterDestroy':_0xc737('0x5')};function emitEvent(_0x19e4f8){return function(_0x221e8d,_0x4b9970,_0x46ce96){ChatGroupEvents['emit'](_0x19e4f8+':'+_0x221e8d['id'],_0x221e8d);ChatGroupEvents[_0xc737('0x6')](_0x19e4f8,_0x221e8d);_0x46ce96(null);};}for(var e in events){if(events[_0xc737('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xc737('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 02ae621..3eb5b97 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 _0xd81d=['request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird'];(function(_0x2ae1bc,_0x3b5e39){var _0x583808=function(_0x1d0b31){while(--_0x1d0b31){_0x2ae1bc['push'](_0x2ae1bc['shift']());}};_0x583808(++_0x3b5e39);}(_0xd81d,0x7d));var _0xdd81=function(_0x1c34e1,_0x4ebefc){_0x1c34e1=_0x1c34e1-0x0;var _0x183422=_0xd81d[_0x1c34e1];return _0x183422;};'use strict';var _=require(_0xdd81('0x0'));var util=require(_0xdd81('0x1'));var logger=require(_0xdd81('0x2'))(_0xdd81('0x3'));var moment=require('moment');var BPromise=require(_0xdd81('0x4'));var rp=require(_0xdd81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdd81('0x6'));var config=require(_0xdd81('0x7'));var attributes=require(_0xdd81('0x8'));module[_0xdd81('0x9')]=function(_0x1fb537,_0x37a878){return _0x1fb537[_0xdd81('0xa')](_0xdd81('0xb'),attributes,{'tableName':_0xdd81('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3be6=['path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x245eaa,_0x315370){var _0x3b09be=function(_0x112d74){while(--_0x112d74){_0x245eaa['push'](_0x245eaa['shift']());}};_0x3b09be(++_0x315370);}(_0x3be6,0xc9));var _0x63be=function(_0x27b7d2,_0x56c091){_0x27b7d2=_0x27b7d2-0x0;var _0x3ef6be=_0x3be6[_0x27b7d2];return _0x3ef6be;};'use strict';var _=require(_0x63be('0x0'));var util=require(_0x63be('0x1'));var logger=require(_0x63be('0x2'))(_0x63be('0x3'));var moment=require(_0x63be('0x4'));var BPromise=require(_0x63be('0x5'));var rp=require(_0x63be('0x6'));var fs=require('fs');var path=require(_0x63be('0x7'));var rimraf=require('rimraf');var config=require(_0x63be('0x8'));var attributes=require(_0x63be('0x9'));module[_0x63be('0xa')]=function(_0x5f0f6b,_0x3b6eef){return _0x5f0f6b[_0x63be('0xb')](_0x63be('0xc'),attributes,{'tableName':'chat_groups','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 8a04bf2..81c17dc 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 _0x31e7=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x582787,_0xa70c94){var _0x1b6cf8=function(_0x2f2bdd){while(--_0x2f2bdd){_0x582787['push'](_0x582787['shift']());}};_0x1b6cf8(++_0xa70c94);}(_0x31e7,0x74));var _0x731e=function(_0x2a8ea2,_0x9a68e){_0x2a8ea2=_0x2a8ea2-0x0;var _0xf2090b=_0x31e7[_0x2a8ea2];return _0xf2090b;};'use strict';var _=require('lodash');var util=require(_0x731e('0x0'));var moment=require('moment');var BPromise=require(_0x731e('0x1'));var rs=require(_0x731e('0x2'));var fs=require('fs');var Redis=require(_0x731e('0x3'));var db=require(_0x731e('0x4'))['db'];var utils=require(_0x731e('0x5'));var logger=require(_0x731e('0x6'))(_0x731e('0x7'));var config=require(_0x731e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x731e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x731e('0xa')](config[_0x731e('0xb')],{'host':_0x731e('0xc'),'port':0x18eb});var socket=require(_0x731e('0xd'))(new Redis(config[_0x731e('0xb')]));require(_0x731e('0xe'))[_0x731e('0xf')](socket);function respondWithRpcPromise(_0x5ed856,_0x56896a,_0x4e5784){return new BPromise(function(_0x3b4e6f,_0x1966c9){return client[_0x731e('0x10')](_0x5ed856,_0x4e5784)[_0x731e('0x11')](function(_0x2db10e){logger[_0x731e('0x12')](_0x731e('0x13'),_0x56896a,_0x731e('0x14'));logger[_0x731e('0x15')](_0x731e('0x16'),_0x56896a,_0x731e('0x14'),JSON['stringify'](_0x2db10e));if(_0x2db10e[_0x731e('0x17')]){if(_0x2db10e[_0x731e('0x17')]['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x56896a,_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);return _0x1966c9(_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);}logger[_0x731e('0x17')](_0x731e('0x13'),_0x56896a,_0x2db10e[_0x731e('0x17')][_0x731e('0x18')]);return _0x3b4e6f(_0x2db10e['error'][_0x731e('0x18')]);}else{logger[_0x731e('0x12')](_0x731e('0x13'),_0x56896a,'request\x20sent');_0x3b4e6f(_0x2db10e[_0x731e('0x19')]['message']);}})[_0x731e('0x1a')](function(_0x1a3ab9){logger['error'](_0x731e('0x13'),_0x56896a,_0x1a3ab9);_0x1966c9(_0x1a3ab9);});});} \ No newline at end of file +var _0xf041=['rpc','client','redis','defaults','localhost','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x43422c,_0x17388f){var _0x5f20b8=function(_0x60c8b4){while(--_0x60c8b4){_0x43422c['push'](_0x43422c['shift']());}};_0x5f20b8(++_0x17388f);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f04('0x0'));var BPromise=require(_0x1f04('0x1'));var rs=require(_0x1f04('0x2'));var fs=require('fs');var Redis=require(_0x1f04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f04('0x4'));var logger=require('../../config/logger')(_0x1f04('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f04('0x6')]['http']({'port':0x232a});config[_0x1f04('0x7')]=_[_0x1f04('0x8')](config[_0x1f04('0x7')],{'host':_0x1f04('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f04('0x7')]));require(_0x1f04('0xa'))[_0x1f04('0xb')](socket);function respondWithRpcPromise(_0x150ec6,_0x181529,_0x2c9aca){return new BPromise(function(_0x1982dd,_0x42b333){return client['request'](_0x150ec6,_0x2c9aca)['then'](function(_0x1022df){logger[_0x1f04('0xc')](_0x1f04('0xd'),_0x181529,_0x1f04('0xe'));logger[_0x1f04('0xf')](_0x1f04('0x10'),_0x181529,_0x1f04('0xe'),JSON[_0x1f04('0x11')](_0x1022df));if(_0x1022df[_0x1f04('0x12')]){if(_0x1022df[_0x1f04('0x12')][_0x1f04('0x13')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x181529,_0x1022df[_0x1f04('0x12')][_0x1f04('0x14')]);return _0x42b333(_0x1022df[_0x1f04('0x12')]['message']);}logger[_0x1f04('0x12')]('ChatGroup,\x20%s,\x20%s',_0x181529,_0x1022df[_0x1f04('0x12')][_0x1f04('0x14')]);return _0x1982dd(_0x1022df[_0x1f04('0x12')][_0x1f04('0x14')]);}else{logger[_0x1f04('0xc')](_0x1f04('0xd'),_0x181529,'request\x20sent');_0x1982dd(_0x1022df['result'][_0x1f04('0x14')]);}})[_0x1f04('0x15')](function(_0x413c24){logger[_0x1f04('0x12')](_0x1f04('0xd'),_0x181529,_0x413c24);_0x42b333(_0x413c24);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d1f7b42..35f9a2c 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 _0xf916=['remove','update','emit','removeListener','register','./chatGroup.events','save'];(function(_0x4a5363,_0x2e9674){var _0x47d623=function(_0x29b510){while(--_0x29b510){_0x4a5363['push'](_0x4a5363['shift']());}};_0x47d623(++_0x2e9674);}(_0xf916,0x1c5));var _0x6f91=function(_0x574353,_0x286415){_0x574353=_0x574353-0x0;var _0x1422bc=_0xf916[_0x574353];return _0x1422bc;};'use strict';var ChatGroupEvents=require(_0x6f91('0x0'));var events=[_0x6f91('0x1'),_0x6f91('0x2'),_0x6f91('0x3')];function createListener(_0x252e17,_0x41a68a){return function(_0x3a90eb){_0x41a68a[_0x6f91('0x4')](_0x252e17,_0x3a90eb);};}function removeListener(_0x1dcee7,_0x116231){return function(){ChatGroupEvents[_0x6f91('0x5')](_0x1dcee7,_0x116231);};}exports[_0x6f91('0x6')]=function(_0xed0276){for(var _0x20cf79=0x0,_0x4d9c32=events['length'];_0x20cf79<_0x4d9c32;_0x20cf79++){var _0x5ed5b0=events[_0x20cf79];var _0x50301a=createListener('chatGroup:'+_0x5ed5b0,_0xed0276);ChatGroupEvents['on'](_0x5ed5b0,_0x50301a);}}; \ No newline at end of file +var _0x04d7=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x3a0746,_0x1c624d){var _0x29d3dc=function(_0x10e3ba){while(--_0x10e3ba){_0x3a0746['push'](_0x3a0746['shift']());}};_0x29d3dc(++_0x1c624d);}(_0x04d7,0x164));var _0x704d=function(_0x373d08,_0x18fe97){_0x373d08=_0x373d08-0x0;var _0x20c20e=_0x04d7[_0x373d08];return _0x20c20e;};'use strict';var ChatGroupEvents=require(_0x704d('0x0'));var events=[_0x704d('0x1'),_0x704d('0x2'),_0x704d('0x3')];function createListener(_0x563b57,_0x306f25){return function(_0x24f3dc){_0x306f25['emit'](_0x563b57,_0x24f3dc);};}function removeListener(_0x402c93,_0x4cfc21){return function(){ChatGroupEvents[_0x704d('0x4')](_0x402c93,_0x4cfc21);};}exports[_0x704d('0x5')]=function(_0x332f65){for(var _0x4e2aa8=0x0,_0x27384b=events[_0x704d('0x6')];_0x4e2aa8<_0x27384b;_0x4e2aa8++){var _0x21a9f3=events[_0x4e2aa8];var _0x23d556=createListener(_0x704d('0x7')+_0x21a9f3,_0x332f65);ChatGroupEvents['on'](_0x21a9f3,_0x23d556);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index eb12335..a106063 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 _0x9ffa=['show','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x95b3f3,_0x382b44){var _0x2d30c7=function(_0x131328){while(--_0x131328){_0x95b3f3['push'](_0x95b3f3['shift']());}};_0x2d30c7(++_0x382b44);}(_0x9ffa,0x109));var _0xa9ff=function(_0x553fdb,_0x57c3f7){_0x553fdb=_0x553fdb-0x0;var _0x265e65=_0x9ffa[_0x553fdb];return _0x265e65;};'use strict';var multer=require(_0xa9ff('0x0'));var util=require(_0xa9ff('0x1'));var path=require(_0xa9ff('0x2'));var timeout=require(_0xa9ff('0x3'));var express=require(_0xa9ff('0x4'));var router=express['Router']();var fs_extra=require(_0xa9ff('0x5'));var auth=require(_0xa9ff('0x6'));var interaction=require(_0xa9ff('0x7'));var config=require('../../config/environment');var controller=require(_0xa9ff('0x8'));router[_0xa9ff('0x9')]('/',auth[_0xa9ff('0xa')](),controller[_0xa9ff('0xb')]);router[_0xa9ff('0x9')](_0xa9ff('0xc'),auth['isAuthenticated'](),controller[_0xa9ff('0xd')]);router['get'](_0xa9ff('0xe'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0xf')]);router[_0xa9ff('0x9')]('/:id/unread',auth[_0xa9ff('0xa')](),controller['getUnread']);router['get'](_0xa9ff('0x10'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x11')]);router[_0xa9ff('0x9')](_0xa9ff('0x12'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x13')]);router[_0xa9ff('0x14')]('/',auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x15')]);router['post'](_0xa9ff('0x10'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x16')]);router[_0xa9ff('0x14')](_0xa9ff('0x12'),auth[_0xa9ff('0xa')](),controller['addMessage']);router[_0xa9ff('0x17')](_0xa9ff('0xe'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x18')]);router[_0xa9ff('0x19')](_0xa9ff('0xe'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x1a')]);router[_0xa9ff('0x19')](_0xa9ff('0x10'),auth[_0xa9ff('0xa')](),controller[_0xa9ff('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x408a=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','/:id','update','delete','destroy'];(function(_0x350dbe,_0x3597c6){var _0x26cffc=function(_0x184a05){while(--_0x184a05){_0x350dbe['push'](_0x350dbe['shift']());}};_0x26cffc(++_0x3597c6);}(_0x408a,0x1b0));var _0xa408=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x408a[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xa408('0x0'));var util=require(_0xa408('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa408('0x2'));var router=express[_0xa408('0x3')]();var fs_extra=require(_0xa408('0x4'));var auth=require(_0xa408('0x5'));var interaction=require(_0xa408('0x6'));var config=require(_0xa408('0x7'));var controller=require('./chatGroup.controller');router[_0xa408('0x8')]('/',auth[_0xa408('0x9')](),controller[_0xa408('0xa')]);router[_0xa408('0x8')]('/describe',auth[_0xa408('0x9')](),controller[_0xa408('0xb')]);router[_0xa408('0x8')]('/:id',auth[_0xa408('0x9')](),controller[_0xa408('0xc')]);router[_0xa408('0x8')](_0xa408('0xd'),auth[_0xa408('0x9')](),controller[_0xa408('0xe')]);router[_0xa408('0x8')](_0xa408('0xf'),auth[_0xa408('0x9')](),controller[_0xa408('0x10')]);router['get'](_0xa408('0x11'),auth[_0xa408('0x9')](),controller[_0xa408('0x12')]);router[_0xa408('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa408('0x13')](_0xa408('0xf'),auth[_0xa408('0x9')](),controller[_0xa408('0x14')]);router[_0xa408('0x13')](_0xa408('0x11'),auth[_0xa408('0x9')](),controller[_0xa408('0x15')]);router[_0xa408('0x16')](_0xa408('0x17'),auth[_0xa408('0x9')](),controller[_0xa408('0x18')]);router[_0xa408('0x19')](_0xa408('0x17'),auth[_0xa408('0x9')](),controller[_0xa408('0x1a')]);router[_0xa408('0x19')](_0xa408('0xf'),auth[_0xa408('0x9')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3f7a965..56c345e 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 _0x065e=['sequelize','ENUM','star','thumb','TEXT','STRING','long','DATE','BOOLEAN'];(function(_0x7fcd0a,_0x2f5413){var _0x428e0d=function(_0x1eca9e){while(--_0x1eca9e){_0x7fcd0a['push'](_0x7fcd0a['shift']());}};_0x428e0d(++_0x2f5413);}(_0x065e,0x1a7));var _0xe065=function(_0x59bfeb,_0x3c7c50){_0x59bfeb=_0x59bfeb-0x0;var _0x550d4f=_0x065e[_0x59bfeb];return _0x550d4f;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe065('0x1')](_0xe065('0x2'),_0xe065('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xe065('0x4')]},'mailTranscript':{'type':Sequelize[_0xe065('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe065('0x5')]},'secondDisposition':{'type':Sequelize[_0xe065('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe065('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xe065('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe065('0x5')]},'osVersion':{'type':Sequelize[_0xe065('0x5')]},'deviceModel':{'type':Sequelize[_0xe065('0x5')]},'deviceVendor':{'type':Sequelize[_0xe065('0x5')]},'deviceType':{'type':Sequelize[_0xe065('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe065('0x5')]},'formData':{'type':Sequelize[_0xe065('0x4')](_0xe065('0x6'))},'read1stAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe065('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe065('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xe065('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xe065('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe065('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x55ea=['long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING'];(function(_0x55d1b9,_0x5a7b15){var _0x29e266=function(_0x5be949){while(--_0x5be949){_0x55d1b9['push'](_0x55d1b9['shift']());}};_0x29e266(++_0x5a7b15);}(_0x55ea,0xc9));var _0xa55e=function(_0x4ef608,_0x3db289){_0x4ef608=_0x4ef608-0x0;var _0x467389=_0x55ea[_0x4ef608];return _0x467389;};'use strict';var Sequelize=require(_0xa55e('0x0'));module[_0xa55e('0x1')]={'closed':{'type':Sequelize[_0xa55e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa55e('0x3')](_0xa55e('0x4'),_0xa55e('0x5')),'defaultValue':_0xa55e('0x4')},'ratingMessage':{'type':Sequelize[_0xa55e('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa55e('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa55e('0x7')]},'browserName':{'type':Sequelize[_0xa55e('0x7')]},'browserVersion':{'type':Sequelize[_0xa55e('0x7')]},'osName':{'type':Sequelize[_0xa55e('0x7')]},'osVersion':{'type':Sequelize[_0xa55e('0x7')]},'deviceModel':{'type':Sequelize[_0xa55e('0x7')]},'deviceVendor':{'type':Sequelize[_0xa55e('0x7')]},'deviceType':{'type':Sequelize[_0xa55e('0x7')]},'referer':{'type':Sequelize[_0xa55e('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xa55e('0x8'))},'read1stAt':{'type':Sequelize[_0xa55e('0x9')]},'lastMsgAt':{'type':Sequelize[_0xa55e('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xa55e('0x3')]('in',_0xa55e('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa55e('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa55e('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 0d9e97d..2cf718e 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 _0xab49=['localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','destroy','name','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','user','show','params','model','keys','fields','attributes','length','includeAll','include','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','mimetype','Attachment','ChatOfflineMessageId','join','root','offline-chat/','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','User','ChatWebsiteId','ContactId','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','ChatInteractionId','includeAgent','push','alias','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','lastName','direction','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','unlinkSync','rimraf','zip-dir','request-promise','util','ejs','lodash','ioredis','../../config/logger','../../config/environment','redis','defaults'];(function(_0x3c7e07,_0x569001){var _0x482454=function(_0x377487){while(--_0x377487){_0x3c7e07['push'](_0x3c7e07['shift']());}};_0x482454(++_0x569001);}(_0xab49,0x18d));var _0x9ab4=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xab49[_0x286726];return _0xcd4fe9;};'use strict';var rimraf=require(_0x9ab4('0x0'));var zipdir=require(_0x9ab4('0x1'));var rp=require(_0x9ab4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9ab4('0x3'));var path=require('path');var ejs=require(_0x9ab4('0x4'));var fs=require('fs');var _=require(_0x9ab4('0x5'));var Redis=require(_0x9ab4('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x9ab4('0x7'))('api');var config=require(_0x9ab4('0x8'));var db=require('../../mysqldb')['db'];config[_0x9ab4('0x9')]=_[_0x9ab4('0xa')](config[_0x9ab4('0x9')],{'host':_0x9ab4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ab4('0x9')]));require(_0x9ab4('0xc'))[_0x9ab4('0xd')](socket);var jayson=require(_0x9ab4('0xe'));var client=jayson[_0x9ab4('0xf')][_0x9ab4('0x10')]({'port':0x232b});var client9004=jayson[_0x9ab4('0xf')][_0x9ab4('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x269db7,_0x3174ae,_0x3c243a,_0x16debc){return new BPromise(function(_0x2b6e33,_0x51995b){var _0x31b6c6=_0x16debc||client;return _0x31b6c6[_0x9ab4('0x11')](_0x269db7,_0x3c243a)[_0x9ab4('0x12')](function(_0x2013ee){logger[_0x9ab4('0x13')](_0x9ab4('0x14'),_0x3174ae,'request\x20sent');logger['debug'](_0x9ab4('0x15'),_0x3174ae,_0x9ab4('0x16'),JSON[_0x9ab4('0x17')](_0x2013ee));if(_0x2013ee[_0x9ab4('0x18')]){if(_0x2013ee['error']['code']===0x1f4){logger['error'](_0x9ab4('0x14'),_0x3174ae,_0x2013ee[_0x9ab4('0x18')]['message']);return _0x51995b(_0x2013ee[_0x9ab4('0x18')]['message']);}logger[_0x9ab4('0x18')](_0x9ab4('0x14'),_0x3174ae,_0x2013ee[_0x9ab4('0x18')][_0x9ab4('0x19')]);return _0x2b6e33(_0x2013ee['error']['message']);}else{logger['info'](_0x9ab4('0x14'),_0x3174ae,_0x9ab4('0x16'));_0x2b6e33(_0x2013ee[_0x9ab4('0x1a')]['message']);}})[_0x9ab4('0x1b')](function(_0x493f19){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3174ae,_0x493f19);_0x51995b(_0x493f19);});});}function respondWithStatusCode(_0x642f2c,_0x23451b){_0x23451b=_0x23451b||0xcc;return function(_0x260fc3){if(_0x260fc3){return _0x642f2c[_0x9ab4('0x1c')](_0x23451b);}return _0x642f2c[_0x9ab4('0x1d')](_0x23451b)[_0x9ab4('0x1e')]();};}function respondWithResult(_0x4abbaa,_0x5e98d0){_0x5e98d0=_0x5e98d0||0xc8;return function(_0x16cba3){if(_0x16cba3){return _0x4abbaa[_0x9ab4('0x1d')](_0x5e98d0)['json'](_0x16cba3);}};}function respondWithFilteredResult(_0x192726,_0x240611){return function(_0x4c2f37){if(_0x4c2f37){var _0x5c6383=typeof _0x240611[_0x9ab4('0x1f')]===_0x9ab4('0x20')&&typeof _0x240611[_0x9ab4('0x21')]==='undefined';var _0x1cf76d=_0x4c2f37[_0x9ab4('0x22')];var _0x702194=_0x5c6383?0x0:_0x240611[_0x9ab4('0x1f')];var _0x2acd9a=_0x5c6383?_0x4c2f37[_0x9ab4('0x22')]:_0x240611[_0x9ab4('0x1f')]+_0x240611[_0x9ab4('0x21')];var _0x37ecc8;if(_0x2acd9a>=_0x1cf76d){_0x2acd9a=_0x1cf76d;_0x37ecc8=0xc8;}else{_0x37ecc8=0xce;}_0x192726[_0x9ab4('0x1d')](_0x37ecc8);return _0x192726['set']('Content-Range',_0x702194+'-'+_0x2acd9a+'/'+_0x1cf76d)[_0x9ab4('0x23')](_0x4c2f37);}return null;};}function saveUpdates(_0x5421a1){return function(_0x2f19f8){if(_0x2f19f8){return _0x2f19f8['update'](_0x5421a1)[_0x9ab4('0x12')](function(_0x3a7032){return _0x3a7032;});}return null;};}function removeEntity(_0x1b25e9){return function(_0x57729a){if(_0x57729a){return _0x57729a[_0x9ab4('0x24')]()[_0x9ab4('0x12')](function(){_0x1b25e9[_0x9ab4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321da3){return function(_0x39f0e5){if(!_0x39f0e5){_0x321da3[_0x9ab4('0x1c')](0x194);}return _0x39f0e5;};}function handleError(_0x184c57,_0x48707e){_0x48707e=_0x48707e||0x1f4;return function(_0x26efd5){logger[_0x9ab4('0x18')](_0x26efd5['stack']);if(_0x26efd5[_0x9ab4('0x25')]){delete _0x26efd5[_0x9ab4('0x25')];}_0x184c57[_0x9ab4('0x1d')](_0x48707e)['send'](_0x26efd5);};}function getMustacheRender(_0x41b942,_0x1c510a){return Mustache[_0x9ab4('0x26')](_0x41b942,_[_0x9ab4('0x27')](_0x1c510a[_0x9ab4('0x28')],{'contact':_0x1c510a[_0x9ab4('0x29')],'message':_0x1c510a[_0x9ab4('0x19')],'agent':_0x1c510a[_0x9ab4('0x2a')],'interaction':_0x1c510a[_0x9ab4('0x2b')],'account':_0x1c510a[_0x9ab4('0x2c')]}))||'';}exports['index']=function(_0x18b426,_0x33015f){var _0x36cb2b={};var _0x1732bf=_[_0x9ab4('0x2d')](db[_0x9ab4('0x2e')][_0x9ab4('0x2f')],function(_0x4bbacb){return{'name':_0x4bbacb[_0x9ab4('0x30')],'type':_0x4bbacb[_0x9ab4('0x31')]['key']};});_0x36cb2b=qs[_0x9ab4('0x32')](_0x1732bf,_0x18b426);return interaction[_0x9ab4('0x33')](_0x9ab4('0x34'),_0x18b426[_0x9ab4('0x35')],_0x18b426[_0x9ab4('0x36')],_0x36cb2b,_0x1732bf)['then'](respondWithFilteredResult(_0x33015f,_0x36cb2b))[_0x9ab4('0x1b')](handleError(_0x33015f,null));};exports[_0x9ab4('0x37')]=function(_0x5d7dd0,_0x1ea574){var _0x3ac596={'raw':![],'where':{'id':_0x5d7dd0[_0x9ab4('0x38')]['id']}},_0x5e97b2={};_0x5e97b2[_0x9ab4('0x39')]=_[_0x9ab4('0x3a')](db[_0x9ab4('0x2e')][_0x9ab4('0x2f')]);_0x5e97b2[_0x9ab4('0x35')]=_['keys'](_0x5d7dd0['query']);_0x5e97b2['filters']=_['intersection'](_0x5e97b2[_0x9ab4('0x39')],_0x5e97b2[_0x9ab4('0x35')]);_0x3ac596['attributes']=_['intersection'](_0x5e97b2[_0x9ab4('0x39')],qs[_0x9ab4('0x3b')](_0x5d7dd0[_0x9ab4('0x35')][_0x9ab4('0x3b')]));_0x3ac596[_0x9ab4('0x3c')]=_0x3ac596[_0x9ab4('0x3c')][_0x9ab4('0x3d')]?_0x3ac596[_0x9ab4('0x3c')]:_0x5e97b2[_0x9ab4('0x39')];if(_0x5d7dd0[_0x9ab4('0x35')][_0x9ab4('0x3e')]){_0x3ac596[_0x9ab4('0x3f')]=[{'all':!![]}];}_0x3ac596=_[_0x9ab4('0x27')]({},_0x3ac596,_0x5d7dd0[_0x9ab4('0x40')]);return db[_0x9ab4('0x2e')][_0x9ab4('0x41')](_0x3ac596)[_0x9ab4('0x12')](handleEntityNotFound(_0x1ea574,null))['then'](respondWithResult(_0x1ea574,null))[_0x9ab4('0x1b')](handleError(_0x1ea574,null));};exports[_0x9ab4('0x42')]=function(_0x18b921,_0x1129df){return db[_0x9ab4('0x2e')][_0x9ab4('0x42')](_0x18b921[_0x9ab4('0x28')],{})[_0x9ab4('0x12')](respondWithResult(_0x1129df,0xc9))['catch'](handleError(_0x1129df,null));};exports[_0x9ab4('0x43')]=function(_0x31b675,_0x24b58b){if(_0x31b675[_0x9ab4('0x28')]['id']){delete _0x31b675[_0x9ab4('0x28')]['id'];}return db[_0x9ab4('0x2e')][_0x9ab4('0x41')]({'where':{'id':_0x31b675[_0x9ab4('0x38')]['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x24b58b,null))[_0x9ab4('0x12')](saveUpdates(_0x31b675[_0x9ab4('0x28')],null))['then'](respondWithResult(_0x24b58b,null))[_0x9ab4('0x1b')](handleError(_0x24b58b,null));};exports[_0x9ab4('0x24')]=function(_0x4ede93,_0x155a8d){return db[_0x9ab4('0x2e')][_0x9ab4('0x41')]({'where':{'id':_0x4ede93['params']['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x155a8d,null))[_0x9ab4('0x12')](removeEntity(_0x155a8d,null))[_0x9ab4('0x1b')](handleError(_0x155a8d,null));};exports[_0x9ab4('0x44')]=function(_0x20ca90,_0x3cab14){return db[_0x9ab4('0x2e')][_0x9ab4('0x44')]()[_0x9ab4('0x12')](respondWithResult(_0x3cab14,null))[_0x9ab4('0x1b')](handleError(_0x3cab14,null));};exports[_0x9ab4('0x45')]=function(_0x20b57b,_0x2af2eb){var _0xa8ebd1=_0x20b57b[_0x9ab4('0x38')]['id'];var _0x34c380;var _0xd0d69;var _0x1f15fb;return db[_0x9ab4('0x2e')][_0x9ab4('0x46')]({'where':{'id':_0xa8ebd1}})['then'](function(_0xebe391){_0x34c380=_0xebe391;return db[_0x9ab4('0x47')]['findOne']({'where':{'id':_0xebe391['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x9ab4('0x48'),_0x9ab4('0x49'),_0x9ab4('0x4a'),_0x9ab4('0x4b')],'raw':!![]});})['then'](function(_0x33553b){if(_0x33553b&&_0x33553b[_0x9ab4('0x4c')]&&_0x33553b[_0x9ab4('0x48')]){_0xd0d69=_0x33553b;var _0x510203={'interaction':{'id':_0xa8ebd1},'agent':{'id':_0x20b57b[_0x9ab4('0x36')]['id'],'name':_0x20b57b[_0x9ab4('0x36')]['name'],'fullname':_0x20b57b[_0x9ab4('0x36')][_0x9ab4('0x4d')],'email':_0x20b57b[_0x9ab4('0x36')][_0x9ab4('0x4e')]},'contact':_0x20b57b['body']['contact'],'account':_0x20b57b[_0x9ab4('0x28')][_0x9ab4('0x2c')]};var _0x554328={'rejectUnauthorized':![],'method':_0x9ab4('0x4f'),'url':_0x9ab4('0x50'),'headers':{'X-APIKEY':_0x33553b[_0x9ab4('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x20b57b[_0x9ab4('0x36')]['email']],'buttons':null,'topic':_0xd0d69[_0x9ab4('0x49')],'note':_[_0x9ab4('0x51')](_0xd0d69[_0x9ab4('0x4a')])?null:getMustacheRender(_0xd0d69['vidaooNote'],_0x510203),'metadata':null},'redirect':_0x9ab4('0x52'),'json':!![]};try{if(!_[_0x9ab4('0x51')](_0xd0d69[_0x9ab4('0x4b')])){var _0x5aa698=getMustacheRender(_0xd0d69[_0x9ab4('0x4b')],_0x510203);var _0x1ed375=JSON[_0x9ab4('0x53')](_0x5aa698);_0x554328['body'][_0x9ab4('0x54')]=_0x1ed375;}}catch(_0x367081){throw new db[(_0x9ab4('0x55'))][(_0x9ab4('0x56'))](_0x9ab4('0x57'));}return rp(_0x554328);}else{throw new db['Sequelize'][(_0x9ab4('0x56'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9ab4('0x12')](function(_0x51d3ed){_0x1f15fb=_0x51d3ed;if(_0x1f15fb['id']){var _0x5e29e8={'body':_0x1f15fb[_0x9ab4('0x58')],'ChatWebsiteId':_0xd0d69['id'],'ChatInteractionId':_0x34c380['id'],'direction':_0x9ab4('0x59'),'UserId':_0x20b57b[_0x9ab4('0x36')]['id']};return db[_0x9ab4('0x5a')][_0x9ab4('0x42')](_0x5e29e8,{});}else{throw new db[(_0x9ab4('0x55'))]['ValidationError'](_0x9ab4('0x5b'));}})[_0x9ab4('0x12')](function(){return _0x34c380[_0x9ab4('0x5c')]({'vidaooSessionId':_0x1f15fb['id']});})[_0x9ab4('0x12')](respondWithResult(_0x2af2eb,null))[_0x9ab4('0x1b')](handleError(_0x2af2eb,null));};exports[_0x9ab4('0x5d')]=function(_0x2419a0,_0xd85e16){if(_0x2419a0[_0x9ab4('0x28')]['id']){delete _0x2419a0['body']['id'];}return db[_0x9ab4('0x2e')]['find']({'where':{'id':_0x2419a0[_0x9ab4('0x38')]['id']},'include':[{'model':db[_0x9ab4('0x5e')],'as':'Contact'}]})['then'](handleEntityNotFound(_0xd85e16,null))[_0x9ab4('0x12')](saveUpdates(_0x2419a0[_0x9ab4('0x28')],null))['then'](respondWithResult(_0xd85e16,null))[_0x9ab4('0x1b')](handleError(_0xd85e16,null));};exports['abandon']=function(_0x412b7f,_0x429af6){if(_0x412b7f[_0x9ab4('0x28')]['id']){delete _0x412b7f[_0x9ab4('0x28')]['id'];}return db[_0x9ab4('0x2e')][_0x9ab4('0x41')]({'where':{'id':_0x412b7f[_0x9ab4('0x38')]['id']}})['then'](function(_0x3af829){if(!_0x3af829){logger[_0x9ab4('0x18')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x9ab4('0x5f'));_0x429af6['sendStatus'](0x194);}else{if(_0x3af829[_0x9ab4('0x60')]){throw new db['Sequelize'][(_0x9ab4('0x56'))](_0x9ab4('0x61'));}}return _0x3af829;})['then'](function(_0x502aba){if(_0x502aba){return _0x502aba[_0x9ab4('0x43')]({'closed':_0x412b7f['body'][_0x9ab4('0x62')],'disposition':_0x412b7f[_0x9ab4('0x28')]['disposition']})[_0x9ab4('0x12')](function(_0x3f2db3){return _0x3f2db3;});}})['then'](function(){return respondWithRpcPromise(_0x9ab4('0x63'),_0x9ab4('0x64'),_0x412b7f[_0x9ab4('0x28')],client9004);})[_0x9ab4('0x12')](respondWithResult(_0x429af6,null))[_0x9ab4('0x1b')](handleError(_0x429af6,null));};exports[_0x9ab4('0x65')]=function(_0x33de55,_0x39cb40){_0x33de55[_0x9ab4('0x28')][_0x9ab4('0x25')]=_0x33de55[_0x9ab4('0x66')][_0x9ab4('0x67')];_0x33de55[_0x9ab4('0x28')][_0x9ab4('0x68')]=_0x33de55['file']['filename'];_0x33de55[_0x9ab4('0x28')][_0x9ab4('0x31')]=_0x33de55[_0x9ab4('0x66')][_0x9ab4('0x69')];return db[_0x9ab4('0x6a')][_0x9ab4('0x42')](_0x33de55[_0x9ab4('0x28')])['then'](respondWithResult(_0x39cb40,0xc9))[_0x9ab4('0x1b')](handleError(_0x39cb40,null));};exports['attachmentDownload']=function(_0x3a012b,_0x22293d){return db[_0x9ab4('0x2e')][_0x9ab4('0x46')]({'where':{'id':_0x3a012b[_0x9ab4('0x38')]['id']},'raw':!![]})[_0x9ab4('0x12')](handleEntityNotFound(_0x22293d,null))['then'](function(_0x504e4f){if(_0x504e4f){if(_0x504e4f[_0x9ab4('0x62')]){return _0x22293d[_0x9ab4('0x1d')](0x193)[_0x9ab4('0x23')]({'status':0x193,'message':'Unauthorized'});}return db[_0x9ab4('0x6a')][_0x9ab4('0x46')]({'where':{'id':_0x3a012b[_0x9ab4('0x35')]['attachId']},'raw':!![]})[_0x9ab4('0x12')](handleEntityNotFound(_0x22293d,null));}})[_0x9ab4('0x12')](function(_0x3a18f9){if(_0x3a18f9){var _0x406b5f=_0x3a18f9[_0x9ab4('0x6b')]!==null;var _0x5b91c1=path[_0x9ab4('0x6c')](config[_0x9ab4('0x6d')],'server/files/attachments/');if(_0x406b5f){_0x5b91c1=path[_0x9ab4('0x6c')](_0x5b91c1,_0x9ab4('0x6e'));}var _0x169e4a=path[_0x9ab4('0x6c')](_0x5b91c1,_0x3a18f9[_0x9ab4('0x68')]);return _0x22293d['download'](_0x169e4a);}})[_0x9ab4('0x1b')](handleError(_0x22293d,null));};exports['close']=function(_0x5c01e7,_0x1b2f70){var _0x386ba8=null;var _0x479943=null;var _0x3d03ab=null;if(_0x5c01e7[_0x9ab4('0x28')]['id']){delete _0x5c01e7[_0x9ab4('0x28')]['id'];}if(_0x5c01e7[_0x9ab4('0x28')][_0x9ab4('0x6f')]){_0x3d03ab=path[_0x9ab4('0x6c')](config[_0x9ab4('0x6d')],_0x9ab4('0x70'),util['format']('transcript-%s.txt',Date['now']()));_0x5c01e7[_0x9ab4('0x28')][_0x9ab4('0x71')]=_0x3d03ab;}return db[_0x9ab4('0x2e')]['find']({'where':{'id':_0x5c01e7['params']['id']},'include':[{'model':db[_0x9ab4('0x5a')],'as':_0x9ab4('0x72'),'include':[{'model':db['User'],'as':_0x9ab4('0x73')}]}]})[_0x9ab4('0x12')](handleEntityNotFound(_0x1b2f70,null))[_0x9ab4('0x12')](saveUpdates(_0x5c01e7['body'],null))[_0x9ab4('0x12')](function(_0x3ada2d){if(_0x3ada2d){_0x386ba8=_0x3ada2d;return db['ChatWebsite'][_0x9ab4('0x41')]({'where':{'id':_0x386ba8[_0x9ab4('0x74')]}});}})[_0x9ab4('0x12')](function(_0xb0d5e6){if(_0xb0d5e6){_0x479943=_0xb0d5e6;return db[_0x9ab4('0x5e')][_0x9ab4('0x41')]({'where':{'id':_0x386ba8[_0x9ab4('0x75')]}});}})[_0x9ab4('0x12')](function(_0x1fadb9){if(_0x1fadb9){if(_0x3d03ab){var _0x5bd5b9=null;for(var _0x270c95=0x1;_0x270c95<_0x386ba8[_0x9ab4('0x72')]['length'];++_0x270c95){_0x5bd5b9=_0x386ba8[_0x9ab4('0x72')][_0x270c95];var _0x836ffe=_0x5bd5b9['UserId']?util[_0x9ab4('0x76')](_0x9ab4('0x77'),_0x479943[_0x9ab4('0x78')],_0x5bd5b9[_0x9ab4('0x60')]):'System';var _0x3170f3=_0x5c01e7[_0x9ab4('0x28')][_0x9ab4('0x79')]||util[_0x9ab4('0x76')]('%s%d',_0x9ab4('0x7a'),_0x5bd5b9['ContactId']);switch(_0x479943[_0x9ab4('0x7b')]){case _0x9ab4('0x7c'):_0x836ffe=_0x5bd5b9[_0x9ab4('0x60')]?util[_0x9ab4('0x76')](_0x9ab4('0x77'),_0x479943[_0x9ab4('0x78')],_0x5bd5b9[_0x9ab4('0x60')]):_0x9ab4('0x7d');break;case'agent_alias':_0x836ffe=_0x5bd5b9[_0x9ab4('0x60')]?_0x5bd5b9['User']['alias']||_0x5bd5b9[_0x9ab4('0x73')]['fullname']:_0x9ab4('0x7d');break;case _0x9ab4('0x7e'):_0x836ffe=_0x5bd5b9['UserId']?_0x5bd5b9[_0x9ab4('0x73')][_0x9ab4('0x4d')]:_0x9ab4('0x7d');break;default:_0x836ffe=_0x5bd5b9['UserId']?util[_0x9ab4('0x76')](_0x9ab4('0x77'),_0x479943[_0x9ab4('0x78')],_0x5bd5b9[_0x9ab4('0x60')]):_0x9ab4('0x7d');}var _0x52be47=util[_0x9ab4('0x76')](_0x9ab4('0x7f'),moment(_0x5bd5b9[_0x9ab4('0x80')])['format'](_0x9ab4('0x81')),_0x5bd5b9['direction']==='in'?_0x3170f3:_0x836ffe,_0x5bd5b9[_0x9ab4('0x28')]);if(!_0x5bd5b9[_0x9ab4('0x82')]){fs['appendFileSync'](_0x3d03ab,_0x52be47);}}return db['MailAccount'][_0x9ab4('0x46')]({'where':{'service':!![]},'include':[{'model':db[_0x9ab4('0x83')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x9ab4('0x84')],'as':_0x9ab4('0x84'),'raw':!![]}]}]});}}})[_0x9ab4('0x12')](function(_0x19c155){if(!_0x19c155||!_0x19c155[_0x9ab4('0x85')]||!_0x5c01e7[_0x9ab4('0x28')])return _0x386ba8;var _0x20f534=_0x19c155[_0x9ab4('0x86')]();return respondWithRpcPromise(_0x9ab4('0x87'),_0x9ab4('0x88'),{'account':_0x20f534,'message':{'from':util[_0x9ab4('0x76')](_0x9ab4('0x89'),_0x19c155['name'],_0x19c155[_0x9ab4('0x4e')]||_0x19c155[_0x9ab4('0x85')][_0x9ab4('0x36')]),'to':_0x5c01e7['body'][_0x9ab4('0x6f')],'subject':_0x9ab4('0x8a'),'text':util[_0x9ab4('0x76')](_0x9ab4('0x8b'),_0x5c01e7[_0x9ab4('0x28')]['mailTranscript']),'attachments':[{'path':_0x3d03ab}]}})[_0x9ab4('0x12')](function(){return _0x386ba8;})[_0x9ab4('0x1b')](function(_0x3ce36a){logger[_0x9ab4('0x18')](_0x3ce36a);});})[_0x9ab4('0x12')](respondWithStatusCode(_0x1b2f70,0xc8))[_0x9ab4('0x1b')](handleError(_0x1b2f70,null));};exports[_0x9ab4('0x8c')]=function(_0x1617e9,_0x2444e7){return db[_0x9ab4('0x5a')][_0x9ab4('0x41')]({'where':{'id':_0x1617e9[_0x9ab4('0x38')]['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x2444e7,null))['then'](function(_0x386eb8){if(_0x386eb8){return _0x386eb8[_0x9ab4('0x8c')](_0x1617e9[_0x9ab4('0x28')][_0x9ab4('0x8d')],_[_0x9ab4('0x8e')](_0x1617e9[_0x9ab4('0x28')],[_0x9ab4('0x8d'),'id'])||{});}})[_0x9ab4('0x12')](respondWithResult(_0x2444e7,null))[_0x9ab4('0x1b')](handleError(_0x2444e7,null));};exports[_0x9ab4('0x8f')]=function(_0x4ec4ae,_0x5a5053){var _0x56bee4={'raw':![],'where':{}};var _0x29648e={};var _0x30b922={'count':0x0,'rows':[]};return db[_0x9ab4('0x2e')]['findOne']({'where':{'id':_0x4ec4ae[_0x9ab4('0x38')]['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x5a5053,null))[_0x9ab4('0x12')](function(_0x3b5597){if(_0x3b5597){_0x29648e['model']=_['keys'](db[_0x9ab4('0x5a')]['rawAttributes']);_0x29648e['query']=_[_0x9ab4('0x3a')](_0x4ec4ae[_0x9ab4('0x35')]);_0x29648e[_0x9ab4('0x90')]=_['intersection'](_0x29648e[_0x9ab4('0x39')],_0x29648e[_0x9ab4('0x35')]);_0x56bee4['attributes']=_[_0x9ab4('0x91')](_0x29648e[_0x9ab4('0x39')],qs['fields'](_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x3b')]));_0x56bee4['attributes']=_0x56bee4[_0x9ab4('0x3c')][_0x9ab4('0x3d')]?_0x56bee4[_0x9ab4('0x3c')]:_0x29648e[_0x9ab4('0x39')];if(!_0x4ec4ae['query'][_0x9ab4('0x92')](_0x9ab4('0x93'))){_0x56bee4[_0x9ab4('0x21')]=qs[_0x9ab4('0x21')](_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x21')]);_0x56bee4[_0x9ab4('0x1f')]=qs[_0x9ab4('0x1f')](_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x1f')]);}_0x56bee4[_0x9ab4('0x94')]=qs['sort'](_0x4ec4ae['query'][_0x9ab4('0x95')]);_0x56bee4[_0x9ab4('0x96')]=qs[_0x9ab4('0x90')](_[_0x9ab4('0x97')](_0x4ec4ae['query'],_0x29648e[_0x9ab4('0x90')]));_0x56bee4[_0x9ab4('0x96')]['ChatInteractionId']=_0x3b5597['id'];if(_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x98')]){_0x56bee4[_0x9ab4('0x96')]=_[_0x9ab4('0x27')](_0x56bee4['where'],{'$or':_['map'](_0x56bee4[_0x9ab4('0x3c')],function(_0x10a7ad){var _0x2b2de4={};_0x2b2de4[_0x10a7ad]={'$like':'%'+_0x4ec4ae['query'][_0x9ab4('0x98')]+'%'};return _0x2b2de4;})});}if(_0x4ec4ae[_0x9ab4('0x35')]['$gte']){var _0x4b0929=_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x99')][_0x9ab4('0x9a')](',');var _0x21860e={};_0x21860e[_0x4b0929[0x0]]={'$gte':moment(_0x4b0929[0x1])[_0x9ab4('0x76')](_0x9ab4('0x9b'))};_0x56bee4[_0x9ab4('0x96')]=_[_0x9ab4('0x27')](_0x56bee4[_0x9ab4('0x96')],_0x21860e);}_0x56bee4=_[_0x9ab4('0x27')]({},_0x56bee4,_0x4ec4ae[_0x9ab4('0x40')]);return db[_0x9ab4('0x5a')][_0x9ab4('0x22')]({'where':_0x56bee4[_0x9ab4('0x96')]})['then'](function(_0x45bcbc){_0x30b922['count']=_0x45bcbc;if(_0x4ec4ae[_0x9ab4('0x35')][_0x9ab4('0x3e')]){_0x56bee4[_0x9ab4('0x3f')]=[{'all':!![]}];}return db[_0x9ab4('0x5a')][_0x9ab4('0x33')](_0x56bee4);})[_0x9ab4('0x12')](function(_0x4867d2){_0x30b922[_0x9ab4('0x9c')]=_0x4867d2;return _0x30b922;});}})['then'](respondWithFilteredResult(_0x5a5053,_0x56bee4))[_0x9ab4('0x1b')](handleError(_0x5a5053,null));};exports[_0x9ab4('0x9d')]=function(_0x162bb2,_0x565427){var _0x413e3a={'where':{}},_0x502230={},_0x24b5cf={'count':0x0,'rows':[]};return db[_0x9ab4('0x2e')][_0x9ab4('0x46')]({'where':{'id':_0x162bb2[_0x9ab4('0x38')]['id']}})['then'](handleEntityNotFound(_0x565427,null))[_0x9ab4('0x12')](function(_0xe8fe3b){if(_0xe8fe3b){_0x502230[_0x9ab4('0x39')]=_[_0x9ab4('0x3a')](db[_0x9ab4('0x5a')][_0x9ab4('0x2f')]);_0x502230['query']=_[_0x9ab4('0x3a')](_0x162bb2[_0x9ab4('0x35')]);_0x502230[_0x9ab4('0x90')]=_['intersection'](_0x502230[_0x9ab4('0x39')],_0x502230['query']);_0x413e3a['attributes']=_[_0x9ab4('0x91')](_0x502230[_0x9ab4('0x39')],qs[_0x9ab4('0x3b')](_0x162bb2[_0x9ab4('0x35')][_0x9ab4('0x3b')]));_0x413e3a[_0x9ab4('0x3c')]=_0x413e3a[_0x9ab4('0x3c')][_0x9ab4('0x3d')]?_0x413e3a['attributes']:_0x502230[_0x9ab4('0x39')];if(!_0x162bb2[_0x9ab4('0x35')]['hasOwnProperty'](_0x9ab4('0x93'))){_0x413e3a[_0x9ab4('0x21')]=qs[_0x9ab4('0x21')](_0x162bb2[_0x9ab4('0x35')]['limit']);_0x413e3a[_0x9ab4('0x1f')]=qs[_0x9ab4('0x1f')](_0x162bb2[_0x9ab4('0x35')][_0x9ab4('0x1f')]);}_0x413e3a[_0x9ab4('0x94')]=qs[_0x9ab4('0x95')](_0x162bb2['query'][_0x9ab4('0x95')]);_0x413e3a[_0x9ab4('0x96')]=qs['filters'](_[_0x9ab4('0x97')](_0x162bb2[_0x9ab4('0x35')],_0x502230['filters']));_0x413e3a['where'][_0x9ab4('0x9e')]=_0xe8fe3b['id'];if(_0x162bb2['query'][_0x9ab4('0x98')]){_0x413e3a[_0x9ab4('0x96')]=_[_0x9ab4('0x27')](_0x413e3a['where'],{'$or':_[_0x9ab4('0x2d')](_0x413e3a[_0x9ab4('0x3c')],function(_0x4f66cd){var _0x528090={};_0x528090[_0x4f66cd]={'$like':'%'+_0x162bb2[_0x9ab4('0x35')]['filter']+'%'};return _0x528090;})});}_0x413e3a[_0x9ab4('0x96')][_0x9ab4('0x82')]=![];if(_0x162bb2[_0x9ab4('0x35')]['id']){_0x413e3a[_0x9ab4('0x96')]['id']={'$gt':_0x162bb2['query']['id']};}_0x413e3a=_[_0x9ab4('0x27')]({},_0x413e3a,_0x162bb2[_0x9ab4('0x40')]);return db['ChatMessage'][_0x9ab4('0x22')]({'where':_0x413e3a[_0x9ab4('0x96')]})[_0x9ab4('0x12')](function(_0xb024b5){_0x24b5cf[_0x9ab4('0x22')]=_0xb024b5;_0x413e3a['include']=[];if(_0x162bb2['query'][_0x9ab4('0x9f')]){_0x413e3a[_0x9ab4('0x3f')][_0x9ab4('0xa0')]({'model':db['User'],'as':'User','attributes':['id',_0x9ab4('0x4d'),_0x9ab4('0xa1')]});}if(_0x162bb2[_0x9ab4('0x35')][_0x9ab4('0x3e')]){_0x413e3a[_0x9ab4('0x3f')]=[{'all':!![]}];}return db['ChatMessage'][_0x9ab4('0x33')](_0x413e3a);})[_0x9ab4('0x12')](function(_0x5782c6){_0x24b5cf['rows']=_0x5782c6;return _0x24b5cf;});}})[_0x9ab4('0x12')](respondWithFilteredResult(_0x565427,_0x413e3a))[_0x9ab4('0x1b')](handleError(_0x565427,null));};exports[_0x9ab4('0xa2')]=function(_0x421931,_0x2097f1){return db['ChatInteraction'][_0x9ab4('0x41')]({'where':{'id':_0x421931[_0x9ab4('0x38')]['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x2097f1,null))[_0x9ab4('0x12')](function(_0xf53c50){if(_0xf53c50){return _0xf53c50[_0x9ab4('0xa3')](_0x421931['body'][_0x9ab4('0x8d')],_[_0x9ab4('0x8e')](_0x421931[_0x9ab4('0x28')],['ids','id'])||{})[_0x9ab4('0xa4')](function(){return db[_0x9ab4('0xa5')][_0x9ab4('0x33')]({'attributes':['id',_0x9ab4('0x25'),_0x9ab4('0xa6')],'where':{'id':_0x421931[_0x9ab4('0x28')][_0x9ab4('0x8d')]}});})[_0x9ab4('0x12')](function(_0x376e9b){socket[_0x9ab4('0xa7')](_0x9ab4('0xa8'),{'id':Number(_0x421931[_0x9ab4('0x38')]['id']),'tags':_0x376e9b||[]});return{'id':Number(_0x421931['params']['id']),'tags':_0x376e9b||[]};});}})['then'](respondWithResult(_0x2097f1,null))[_0x9ab4('0x1b')](handleError(_0x2097f1,null));};exports[_0x9ab4('0xa9')]=function(_0x4718b5,_0x29e891){return db[_0x9ab4('0x2e')]['find']({'where':{'id':_0x4718b5['params']['id']}})[_0x9ab4('0x12')](handleEntityNotFound(_0x29e891,null))[_0x9ab4('0x12')](function(_0x3eb753){if(_0x3eb753){return _0x3eb753[_0x9ab4('0xa9')](_0x4718b5[_0x9ab4('0x35')]['ids']);}})[_0x9ab4('0x12')](respondWithStatusCode(_0x29e891,null))[_0x9ab4('0x1b')](handleError(_0x29e891,null));};exports['download']=function(_0x23939d,_0x33ab56){var _0x396fd9=moment()['unix']()[_0x9ab4('0xaa')]();var _0x87bd5e=path['join'](config[_0x9ab4('0x6d')],_0x9ab4('0xab'),_0x9ab4('0xac'),_0x9ab4('0xad'));var _0xbb92fb=path[_0x9ab4('0x6c')](config[_0x9ab4('0x6d')],_0x9ab4('0xab'),'files',_0x9ab4('0xae'));var _0x1b44c4=path[_0x9ab4('0x6c')](_0x87bd5e,_0x396fd9);var _0x15c5c1=util[_0x9ab4('0x76')](_0x9ab4('0xaf'),_0x23939d[_0x9ab4('0x38')]['id'],_0x396fd9);var _0x304c1c=path[_0x9ab4('0x6c')](_0x87bd5e,_0x15c5c1);var _0xf59d98=[];_0xf59d98['push']({'model':db['User'],'as':'User','attributes':['id',_0x9ab4('0x4d')],'raw':!![]});_0xf59d98[_0x9ab4('0xa0')]({'model':db[_0x9ab4('0x5e')],'as':_0x9ab4('0xb0'),'attributes':['id','firstName',_0x9ab4('0xb1')],'raw':!![]});if(_0x23939d['query'][_0x9ab4('0xae')]){_0xf59d98['push']({'model':db[_0x9ab4('0x6a')],'as':_0x9ab4('0x6a'),'raw':!![]});}var _0x2a9a3e=[{'model':db[_0x9ab4('0x5a')],'as':_0x9ab4('0x72'),'attributes':['id',_0x9ab4('0x28'),_0x9ab4('0x80'),_0x9ab4('0xb2'),_0x9ab4('0x82'),'read'],'include':_0xf59d98}];_0x2a9a3e[_0x9ab4('0xa0')]({'model':db[_0x9ab4('0x47')],'as':'Account','attributes':['id',_0x9ab4('0x25')]});_0x2a9a3e[_0x9ab4('0xa0')]({'model':db[_0x9ab4('0x73')],'as':_0x9ab4('0xb3'),'attributes':['id','fullname']});return db[_0x9ab4('0x2e')][_0x9ab4('0x41')]({'where':{'id':_0x23939d['params']['id']},'include':_0x2a9a3e})[_0x9ab4('0x12')](handleEntityNotFound(_0x33ab56,null))['then'](function(_0x1980e3){if(_0x1980e3){var _0x16d107=_0x1980e3[_0x9ab4('0xb4')]({'plain':!![]});fs[_0x9ab4('0xb5')](_0x1b44c4);var _0x299c3f={'channel':_0x9ab4('0xb6'),'account':_0x16d107['Account'][_0x9ab4('0x25')],'agent':_0x16d107[_0x9ab4('0xb3')]?_0x16d107[_0x9ab4('0xb3')][_0x9ab4('0x4d')]:_0x9ab4('0xb7'),'createdAt':moment(_0x16d107[_0x9ab4('0x80')])['format'](_0x9ab4('0x9b'))[_0x9ab4('0xaa')](),'closedAt':_0x16d107[_0x9ab4('0x62')]?moment(_0x16d107[_0x9ab4('0xb8')])['format'](_0x9ab4('0x9b'))[_0x9ab4('0xaa')]():'','disposition':_0x16d107['disposition'],'chatInfo':{'browser':_0x16d107[_0x9ab4('0xb9')],'os':_0x16d107[_0x9ab4('0xba')],'referer':_0x16d107[_0x9ab4('0xbb')],'customerIp':_0x16d107[_0x9ab4('0xbc')],'customerPort':_0x16d107['customerPort']?_0x16d107[_0x9ab4('0xbd')]:'N.A.'},'messages':_(_0x16d107[_0x9ab4('0x72')])[_0x9ab4('0xbe')]()['filter']({'secret':![]})[_0x9ab4('0x2d')](function(_0x3a32f1){if(_0x3a32f1['Attachment']){var _0x1aafd2=path[_0x9ab4('0x6c')](_0xbb92fb,_0x3a32f1[_0x9ab4('0x6a')]['basename']);if(fs[_0x9ab4('0xbf')](_0x1aafd2)){fs[_0x9ab4('0xc0')](_0x1aafd2)[_0x9ab4('0xc1')](fs[_0x9ab4('0xc2')](path[_0x9ab4('0x6c')](_0x1b44c4,_0x3a32f1[_0x9ab4('0x6a')][_0x9ab4('0x68')])));}}return{'date':moment(_0x3a32f1[_0x9ab4('0x80')])[_0x9ab4('0x76')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x3a32f1['direction']===_0x9ab4('0x59')?_0x3a32f1['User']?_0x3a32f1[_0x9ab4('0x73')][_0x9ab4('0x4d')]:_0x9ab4('0x7d'):_0x3a32f1['Contact']['firstName']+(_0x3a32f1[_0x9ab4('0xb0')]['lastName']?'\x20'+_0x3a32f1[_0x9ab4('0xb0')]['lastName']:''),'body':_0x3a32f1['Attachment']?_0x3a32f1[_0x9ab4('0x6a')]['basename']:_0x3a32f1[_0x9ab4('0x28')],'direction':_0x3a32f1['direction']==='out'?'A':'C','secret':_0x3a32f1[_0x9ab4('0x82')],'read':_0x3a32f1[_0x9ab4('0xc3')],'attachment':_0x3a32f1[_0x9ab4('0x6a')]};})[_0x9ab4('0xc4')]()};return ejs[_0x9ab4('0xc5')](path[_0x9ab4('0x6c')](config[_0x9ab4('0x6d')],'server','views',_0x9ab4('0xc6')),{'interaction':_0x299c3f})[_0x9ab4('0x12')](function(_0x65805c){var _0x50de59=path[_0x9ab4('0x6c')](_0x1b44c4,_0x9ab4('0xc7')+_0x16d107['id']+'-'+_0x396fd9+_0x9ab4('0xc8'));var _0x4c894f={'path':_0x50de59,'channel':'Chat','interactionId':_0x16d107['id']};return pdf[_0x9ab4('0xc9')](_0x65805c,_0x4c894f);})[_0x9ab4('0x12')](function(){return new Promise(function(_0x34ff82,_0x8a7881){zipdir(_0x1b44c4,{'saveTo':_0x304c1c},function(_0x42b064,_0x5c2bdc){if(_0x42b064)return _0x8a7881(_0x42b064);return _0x34ff82(_0x5c2bdc);});})[_0x9ab4('0x12')](function(){return new BPromise(function(_0x278691,_0x58a828){rimraf(_0x1b44c4,function(_0x4efa06){if(_0x4efa06)_0x58a828(_0x4efa06);return _0x278691();});});})[_0x9ab4('0x12')](function(){return _0x33ab56[_0x9ab4('0xca')](_0x304c1c,_0x15c5c1,function(_0x17e98e){if(_0x17e98e){logger['error']('err',_0x17e98e);}else{fs[_0x9ab4('0xcb')](_0x304c1c);}});});});}else{return _0x33ab56[_0x9ab4('0x1c')](0xc8);}})[_0x9ab4('0x1b')](handleError(_0x33ab56,null));}; \ No newline at end of file +var _0xa3bb=['spread','Tag','removeTags','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','redis','defaults','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','client','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','end','stack','name','send','render','merge','contact','account','index','map','ChatInteraction','rawAttributes','fieldName','key','getOptions','user','show','model','keys','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','params','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','type','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','System','customer','%s%d','agentIdentifier','website_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','where','findAll','rows','getMyMessages','include','includeAgent','push','addTags','setTags'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa3bb,0x1c8));var _0xba3b=function(_0x58220d,_0x1840f4){_0x58220d=_0x58220d-0x0;var _0x363db2=_0xa3bb[_0x58220d];return _0x363db2;};'use strict';var rimraf=require(_0xba3b('0x0'));var zipdir=require(_0xba3b('0x1'));var rp=require(_0xba3b('0x2'));var moment=require(_0xba3b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xba3b('0x4'));var util=require(_0xba3b('0x5'));var path=require(_0xba3b('0x6'));var ejs=require(_0xba3b('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xba3b('0x8'));var qs=require(_0xba3b('0x9'));var pdf=require(_0xba3b('0xa'));var logger=require(_0xba3b('0xb'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xba3b('0xc')]=_[_0xba3b('0xd')](config[_0xba3b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xba3b('0xe'))(new Redis(config[_0xba3b('0xc')]));require(_0xba3b('0xf'))['register'](socket);var jayson=require(_0xba3b('0x10'));var client=jayson['client'][_0xba3b('0x11')]({'port':0x232b});var client9004=jayson[_0xba3b('0x12')][_0xba3b('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x58d73e,_0x2b5e13,_0x4dae43,_0x1a7cd1){return new BPromise(function(_0x2aeae7,_0x431a01){var _0x2e49ca=_0x1a7cd1||client;return _0x2e49ca[_0xba3b('0x13')](_0x58d73e,_0x4dae43)['then'](function(_0x219694){logger[_0xba3b('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2b5e13,_0xba3b('0x15'));logger[_0xba3b('0x16')](_0xba3b('0x17'),_0x2b5e13,_0xba3b('0x15'),JSON[_0xba3b('0x18')](_0x219694));if(_0x219694['error']){if(_0x219694[_0xba3b('0x19')][_0xba3b('0x1a')]===0x1f4){logger[_0xba3b('0x19')](_0xba3b('0x1b'),_0x2b5e13,_0x219694[_0xba3b('0x19')][_0xba3b('0x1c')]);return _0x431a01(_0x219694[_0xba3b('0x19')][_0xba3b('0x1c')]);}logger[_0xba3b('0x19')](_0xba3b('0x1b'),_0x2b5e13,_0x219694[_0xba3b('0x19')][_0xba3b('0x1c')]);return _0x2aeae7(_0x219694[_0xba3b('0x19')][_0xba3b('0x1c')]);}else{logger[_0xba3b('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2b5e13,_0xba3b('0x15'));_0x2aeae7(_0x219694[_0xba3b('0x1d')][_0xba3b('0x1c')]);}})[_0xba3b('0x1e')](function(_0xe50405){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x2b5e13,_0xe50405);_0x431a01(_0xe50405);});});}function respondWithStatusCode(_0x1905bb,_0x582c13){_0x582c13=_0x582c13||0xcc;return function(_0x4f1b26){if(_0x4f1b26){return _0x1905bb[_0xba3b('0x1f')](_0x582c13);}return _0x1905bb[_0xba3b('0x20')](_0x582c13)['end']();};}function respondWithResult(_0x5c912b,_0x1925e0){_0x1925e0=_0x1925e0||0xc8;return function(_0x4d1b7d){if(_0x4d1b7d){return _0x5c912b[_0xba3b('0x20')](_0x1925e0)['json'](_0x4d1b7d);}};}function respondWithFilteredResult(_0x429592,_0x257000){return function(_0x310031){if(_0x310031){var _0x42786d=typeof _0x257000[_0xba3b('0x21')]===_0xba3b('0x22')&&typeof _0x257000[_0xba3b('0x23')]===_0xba3b('0x22');var _0xe36e90=_0x310031[_0xba3b('0x24')];var _0x5c0bf6=_0x42786d?0x0:_0x257000[_0xba3b('0x21')];var _0x294ba9=_0x42786d?_0x310031[_0xba3b('0x24')]:_0x257000['offset']+_0x257000[_0xba3b('0x23')];var _0x495b7d;if(_0x294ba9>=_0xe36e90){_0x294ba9=_0xe36e90;_0x495b7d=0xc8;}else{_0x495b7d=0xce;}_0x429592[_0xba3b('0x20')](_0x495b7d);return _0x429592['set'](_0xba3b('0x25'),_0x5c0bf6+'-'+_0x294ba9+'/'+_0xe36e90)[_0xba3b('0x26')](_0x310031);}return null;};}function saveUpdates(_0xa875bb){return function(_0x593e53){if(_0x593e53){return _0x593e53[_0xba3b('0x27')](_0xa875bb)[_0xba3b('0x28')](function(_0x2c55a3){return _0x2c55a3;});}return null;};}function removeEntity(_0x34a41a){return function(_0x2e7ca5){if(_0x2e7ca5){return _0x2e7ca5[_0xba3b('0x29')]()['then'](function(){_0x34a41a[_0xba3b('0x20')](0xcc)[_0xba3b('0x2a')]();});}};}function handleEntityNotFound(_0x3ee7c0){return function(_0x3a1f75){if(!_0x3a1f75){_0x3ee7c0[_0xba3b('0x1f')](0x194);}return _0x3a1f75;};}function handleError(_0x1b0b46,_0x3c74e5){_0x3c74e5=_0x3c74e5||0x1f4;return function(_0x1be9e8){logger[_0xba3b('0x19')](_0x1be9e8[_0xba3b('0x2b')]);if(_0x1be9e8[_0xba3b('0x2c')]){delete _0x1be9e8[_0xba3b('0x2c')];}_0x1b0b46[_0xba3b('0x20')](_0x3c74e5)[_0xba3b('0x2d')](_0x1be9e8);};}function getMustacheRender(_0x274d14,_0xc4c6a9){return Mustache[_0xba3b('0x2e')](_0x274d14,_[_0xba3b('0x2f')](_0xc4c6a9['body'],{'contact':_0xc4c6a9[_0xba3b('0x30')],'message':_0xc4c6a9['message'],'agent':_0xc4c6a9['agent'],'interaction':_0xc4c6a9['interaction'],'account':_0xc4c6a9[_0xba3b('0x31')]}))||'';}exports[_0xba3b('0x32')]=function(_0x2c1dfc,_0x211263){var _0x37ed4f={};var _0x1eb2cf=_[_0xba3b('0x33')](db[_0xba3b('0x34')][_0xba3b('0x35')],function(_0x29435e){return{'name':_0x29435e[_0xba3b('0x36')],'type':_0x29435e['type'][_0xba3b('0x37')]};});_0x37ed4f=qs[_0xba3b('0x38')](_0x1eb2cf,_0x2c1dfc);return interaction['findAll']('chat',_0x2c1dfc['query'],_0x2c1dfc[_0xba3b('0x39')],_0x37ed4f,_0x1eb2cf)[_0xba3b('0x28')](respondWithFilteredResult(_0x211263,_0x37ed4f))['catch'](handleError(_0x211263,null));};exports[_0xba3b('0x3a')]=function(_0x4a7e56,_0x55b6fe){var _0x4a81b5={'raw':![],'where':{'id':_0x4a7e56['params']['id']}},_0x33713b={};_0x33713b[_0xba3b('0x3b')]=_[_0xba3b('0x3c')](db[_0xba3b('0x34')][_0xba3b('0x35')]);_0x33713b[_0xba3b('0x3d')]=_[_0xba3b('0x3c')](_0x4a7e56[_0xba3b('0x3d')]);_0x33713b[_0xba3b('0x3e')]=_[_0xba3b('0x3f')](_0x33713b[_0xba3b('0x3b')],_0x33713b['query']);_0x4a81b5[_0xba3b('0x40')]=_['intersection'](_0x33713b[_0xba3b('0x3b')],qs[_0xba3b('0x41')](_0x4a7e56[_0xba3b('0x3d')][_0xba3b('0x41')]));_0x4a81b5['attributes']=_0x4a81b5[_0xba3b('0x40')][_0xba3b('0x42')]?_0x4a81b5[_0xba3b('0x40')]:_0x33713b[_0xba3b('0x3b')];if(_0x4a7e56[_0xba3b('0x3d')][_0xba3b('0x43')]){_0x4a81b5['include']=[{'all':!![]}];}_0x4a81b5=_[_0xba3b('0x2f')]({},_0x4a81b5,_0x4a7e56[_0xba3b('0x44')]);return db[_0xba3b('0x34')][_0xba3b('0x45')](_0x4a81b5)[_0xba3b('0x28')](handleEntityNotFound(_0x55b6fe,null))[_0xba3b('0x28')](respondWithResult(_0x55b6fe,null))[_0xba3b('0x1e')](handleError(_0x55b6fe,null));};exports[_0xba3b('0x46')]=function(_0x15d5a0,_0x1cf4b4){return db['ChatInteraction'][_0xba3b('0x46')](_0x15d5a0[_0xba3b('0x47')],{})[_0xba3b('0x28')](respondWithResult(_0x1cf4b4,0xc9))[_0xba3b('0x1e')](handleError(_0x1cf4b4,null));};exports[_0xba3b('0x27')]=function(_0xc761a1,_0x234fb2){if(_0xc761a1['body']['id']){delete _0xc761a1[_0xba3b('0x47')]['id'];}return db[_0xba3b('0x34')][_0xba3b('0x45')]({'where':{'id':_0xc761a1[_0xba3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x234fb2,null))[_0xba3b('0x28')](saveUpdates(_0xc761a1[_0xba3b('0x47')],null))['then'](respondWithResult(_0x234fb2,null))[_0xba3b('0x1e')](handleError(_0x234fb2,null));};exports[_0xba3b('0x29')]=function(_0x2c2f07,_0xfa9bb7){return db['ChatInteraction'][_0xba3b('0x45')]({'where':{'id':_0x2c2f07[_0xba3b('0x48')]['id']}})[_0xba3b('0x28')](handleEntityNotFound(_0xfa9bb7,null))[_0xba3b('0x28')](removeEntity(_0xfa9bb7,null))['catch'](handleError(_0xfa9bb7,null));};exports[_0xba3b('0x49')]=function(_0xfa4bc9,_0x56d3d9){return db[_0xba3b('0x34')][_0xba3b('0x49')]()[_0xba3b('0x28')](respondWithResult(_0x56d3d9,null))[_0xba3b('0x1e')](handleError(_0x56d3d9,null));};exports[_0xba3b('0x4a')]=function(_0x3bd0cf,_0x46a602){var _0x4c605e=_0x3bd0cf[_0xba3b('0x48')]['id'];var _0x33efdc;var _0x38f177;var _0x34a71a;return db[_0xba3b('0x34')]['findOne']({'where':{'id':_0x4c605e}})[_0xba3b('0x28')](function(_0x37c12b){_0x33efdc=_0x37c12b;return db[_0xba3b('0x4b')][_0xba3b('0x4c')]({'where':{'id':_0x37c12b[_0xba3b('0x4d')]},'attributes':['id','vidaooApiKey',_0xba3b('0x4e'),_0xba3b('0x4f'),_0xba3b('0x50'),_0xba3b('0x51')],'raw':!![]});})[_0xba3b('0x28')](function(_0x910cd){if(_0x910cd&&_0x910cd[_0xba3b('0x52')]&&_0x910cd[_0xba3b('0x4e')]){_0x38f177=_0x910cd;var _0x5e35df={'interaction':{'id':_0x4c605e},'agent':{'id':_0x3bd0cf['user']['id'],'name':_0x3bd0cf['user'][_0xba3b('0x2c')],'fullname':_0x3bd0cf[_0xba3b('0x39')][_0xba3b('0x53')],'email':_0x3bd0cf[_0xba3b('0x39')][_0xba3b('0x54')]},'contact':_0x3bd0cf[_0xba3b('0x47')][_0xba3b('0x30')],'account':_0x3bd0cf['body']['account']};var _0x19e805={'rejectUnauthorized':![],'method':_0xba3b('0x55'),'url':_0xba3b('0x56'),'headers':{'X-APIKEY':_0x910cd[_0xba3b('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3bd0cf[_0xba3b('0x39')]['email']],'buttons':null,'topic':_0x38f177[_0xba3b('0x4f')],'note':_['isNull'](_0x38f177[_0xba3b('0x50')])?null:getMustacheRender(_0x38f177['vidaooNote'],_0x5e35df),'metadata':null},'redirect':_0xba3b('0x57'),'json':!![]};try{if(!_[_0xba3b('0x58')](_0x38f177['vidaooMetadata'])){var _0x4f8fa1=getMustacheRender(_0x38f177[_0xba3b('0x51')],_0x5e35df);var _0x1b5931=JSON['parse'](_0x4f8fa1);_0x19e805[_0xba3b('0x47')][_0xba3b('0x59')]=_0x1b5931;}}catch(_0x30463c){throw new db[(_0xba3b('0x5a'))][(_0xba3b('0x5b'))](_0xba3b('0x5c'));}return rp(_0x19e805);}else{throw new db[(_0xba3b('0x5a'))][(_0xba3b('0x5b'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xba3b('0x28')](function(_0x12b7d3){_0x34a71a=_0x12b7d3;if(_0x34a71a['id']){var _0x17ae83={'body':_0x34a71a[_0xba3b('0x5d')],'ChatWebsiteId':_0x38f177['id'],'ChatInteractionId':_0x33efdc['id'],'direction':_0xba3b('0x5e'),'UserId':_0x3bd0cf[_0xba3b('0x39')]['id']};return db[_0xba3b('0x5f')]['create'](_0x17ae83,{});}else{throw new db['Sequelize'][(_0xba3b('0x5b'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x33efdc[_0xba3b('0x60')]({'vidaooSessionId':_0x34a71a['id']});})[_0xba3b('0x28')](respondWithResult(_0x46a602,null))[_0xba3b('0x1e')](handleError(_0x46a602,null));};exports[_0xba3b('0x61')]=function(_0x509d9c,_0x2f033f){if(_0x509d9c['body']['id']){delete _0x509d9c[_0xba3b('0x47')]['id'];}return db[_0xba3b('0x34')][_0xba3b('0x45')]({'where':{'id':_0x509d9c['params']['id']},'include':[{'model':db[_0xba3b('0x62')],'as':_0xba3b('0x63')}]})[_0xba3b('0x28')](handleEntityNotFound(_0x2f033f,null))[_0xba3b('0x28')](saveUpdates(_0x509d9c[_0xba3b('0x47')],null))[_0xba3b('0x28')](respondWithResult(_0x2f033f,null))[_0xba3b('0x1e')](handleError(_0x2f033f,null));};exports[_0xba3b('0x64')]=function(_0x501f9b,_0x3c3b58){if(_0x501f9b['body']['id']){delete _0x501f9b['body']['id'];}return db[_0xba3b('0x34')][_0xba3b('0x45')]({'where':{'id':_0x501f9b[_0xba3b('0x48')]['id']}})[_0xba3b('0x28')](function(_0x1e3e18){if(!_0x1e3e18){logger['error'](_0xba3b('0x65'),'abandon',0x194,_0xba3b('0x66'));_0x3c3b58['sendStatus'](0x194);}else{if(_0x1e3e18[_0xba3b('0x67')]){throw new db['Sequelize']['ValidationError'](_0xba3b('0x68'));}}return _0x1e3e18;})[_0xba3b('0x28')](function(_0x3a61a9){if(_0x3a61a9){return _0x3a61a9[_0xba3b('0x27')]({'closed':_0x501f9b[_0xba3b('0x47')][_0xba3b('0x69')],'disposition':_0x501f9b[_0xba3b('0x47')]['disposition']})[_0xba3b('0x28')](function(_0x41e57b){return _0x41e57b;});}})['then'](function(){return respondWithRpcPromise(_0xba3b('0x6a'),'abandon',_0x501f9b['body'],client9004);})[_0xba3b('0x28')](respondWithResult(_0x3c3b58,null))['catch'](handleError(_0x3c3b58,null));};exports[_0xba3b('0x6b')]=function(_0x4dc2f3,_0x229a65){_0x4dc2f3[_0xba3b('0x47')][_0xba3b('0x2c')]=_0x4dc2f3[_0xba3b('0x6c')][_0xba3b('0x6d')];_0x4dc2f3[_0xba3b('0x47')][_0xba3b('0x6e')]=_0x4dc2f3[_0xba3b('0x6c')]['filename'];_0x4dc2f3[_0xba3b('0x47')][_0xba3b('0x6f')]=_0x4dc2f3['file'][_0xba3b('0x70')];return db[_0xba3b('0x71')][_0xba3b('0x46')](_0x4dc2f3['body'])[_0xba3b('0x28')](respondWithResult(_0x229a65,0xc9))[_0xba3b('0x1e')](handleError(_0x229a65,null));};exports[_0xba3b('0x72')]=function(_0x2b2910,_0x22cf40){return db[_0xba3b('0x34')][_0xba3b('0x4c')]({'where':{'id':_0x2b2910[_0xba3b('0x48')]['id']},'raw':!![]})[_0xba3b('0x28')](handleEntityNotFound(_0x22cf40,null))[_0xba3b('0x28')](function(_0x666fee){if(_0x666fee){if(_0x666fee[_0xba3b('0x69')]){return _0x22cf40['status'](0x193)[_0xba3b('0x26')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xba3b('0x4c')]({'where':{'id':_0x2b2910[_0xba3b('0x3d')][_0xba3b('0x73')]},'raw':!![]})['then'](handleEntityNotFound(_0x22cf40,null));}})['then'](function(_0x55ecd9){if(_0x55ecd9){var _0x1e14c0=_0x55ecd9[_0xba3b('0x74')]!==null;var _0x377503=path[_0xba3b('0x75')](config[_0xba3b('0x76')],'server/files/attachments/');if(_0x1e14c0){_0x377503=path[_0xba3b('0x75')](_0x377503,_0xba3b('0x77'));}var _0x1364f6=path[_0xba3b('0x75')](_0x377503,_0x55ecd9[_0xba3b('0x6e')]);return _0x22cf40[_0xba3b('0x78')](_0x1364f6);}})['catch'](handleError(_0x22cf40,null));};exports[_0xba3b('0x79')]=function(_0xeec75d,_0x5eacbd){var _0x5a402a=null;var _0x347025=null;var _0xbcad9c=null;if(_0xeec75d['body']['id']){delete _0xeec75d[_0xba3b('0x47')]['id'];}if(_0xeec75d[_0xba3b('0x47')][_0xba3b('0x7a')]){_0xbcad9c=path[_0xba3b('0x75')](config[_0xba3b('0x76')],_0xba3b('0x7b'),util[_0xba3b('0x7c')](_0xba3b('0x7d'),Date[_0xba3b('0x7e')]()));_0xeec75d[_0xba3b('0x47')][_0xba3b('0x7f')]=_0xbcad9c;}return db[_0xba3b('0x34')]['find']({'where':{'id':_0xeec75d[_0xba3b('0x48')]['id']},'include':[{'model':db[_0xba3b('0x5f')],'as':'Messages','include':[{'model':db[_0xba3b('0x80')],'as':_0xba3b('0x80')}]}]})[_0xba3b('0x28')](handleEntityNotFound(_0x5eacbd,null))[_0xba3b('0x28')](saveUpdates(_0xeec75d['body'],null))['then'](function(_0x565ed4){if(_0x565ed4){_0x5a402a=_0x565ed4;return db[_0xba3b('0x4b')][_0xba3b('0x45')]({'where':{'id':_0x5a402a[_0xba3b('0x4d')]}});}})[_0xba3b('0x28')](function(_0x35b135){if(_0x35b135){_0x347025=_0x35b135;return db[_0xba3b('0x62')][_0xba3b('0x45')]({'where':{'id':_0x5a402a[_0xba3b('0x81')]}});}})[_0xba3b('0x28')](function(_0x301238){if(_0x301238){if(_0xbcad9c){var _0x3b8bd6=null;for(var _0x2da2eb=0x1;_0x2da2eb<_0x5a402a[_0xba3b('0x82')][_0xba3b('0x42')];++_0x2da2eb){_0x3b8bd6=_0x5a402a[_0xba3b('0x82')][_0x2da2eb];var _0x7737c3=_0x3b8bd6[_0xba3b('0x67')]?util['format']('%s%d',_0x347025['agentAlias'],_0x3b8bd6[_0xba3b('0x67')]):_0xba3b('0x83');var _0x52abb5=_0xeec75d[_0xba3b('0x47')][_0xba3b('0x84')]||util['format'](_0xba3b('0x85'),'Visitor',_0x3b8bd6[_0xba3b('0x81')]);switch(_0x347025[_0xba3b('0x86')]){case _0xba3b('0x87'):_0x7737c3=_0x3b8bd6[_0xba3b('0x67')]?util[_0xba3b('0x7c')]('%s%d',_0x347025['agentAlias'],_0x3b8bd6[_0xba3b('0x67')]):'System';break;case'agent_alias':_0x7737c3=_0x3b8bd6[_0xba3b('0x67')]?_0x3b8bd6[_0xba3b('0x80')][_0xba3b('0x88')]||_0x3b8bd6[_0xba3b('0x80')][_0xba3b('0x53')]:_0xba3b('0x83');break;case _0xba3b('0x89'):_0x7737c3=_0x3b8bd6[_0xba3b('0x67')]?_0x3b8bd6[_0xba3b('0x80')][_0xba3b('0x53')]:_0xba3b('0x83');break;default:_0x7737c3=_0x3b8bd6[_0xba3b('0x67')]?util[_0xba3b('0x7c')](_0xba3b('0x85'),_0x347025[_0xba3b('0x8a')],_0x3b8bd6[_0xba3b('0x67')]):_0xba3b('0x83');}var _0x5790de=util[_0xba3b('0x7c')](_0xba3b('0x8b'),moment(_0x3b8bd6[_0xba3b('0x8c')])[_0xba3b('0x7c')]('MM/DD/YYYY\x20HH:mm:ss'),_0x3b8bd6[_0xba3b('0x8d')]==='in'?_0x52abb5:_0x7737c3,_0x3b8bd6[_0xba3b('0x47')]);if(!_0x3b8bd6[_0xba3b('0x8e')]){fs[_0xba3b('0x8f')](_0xbcad9c,_0x5790de);}}return db[_0xba3b('0x90')][_0xba3b('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xba3b('0x91')],'as':_0xba3b('0x92'),'raw':!![],'include':[{'model':db[_0xba3b('0x93')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xba3b('0x28')](function(_0xa38f74){if(!_0xa38f74||!_0xa38f74[_0xba3b('0x92')]||!_0xeec75d[_0xba3b('0x47')])return _0x5a402a;var _0x155d09=_0xa38f74[_0xba3b('0x94')]();return respondWithRpcPromise(_0xba3b('0x95'),_0xba3b('0x96'),{'account':_0x155d09,'message':{'from':util[_0xba3b('0x7c')](_0xba3b('0x97'),_0xa38f74[_0xba3b('0x2c')],_0xa38f74[_0xba3b('0x54')]||_0xa38f74[_0xba3b('0x92')]['user']),'to':_0xeec75d[_0xba3b('0x47')][_0xba3b('0x7a')],'subject':_0xba3b('0x98'),'text':util[_0xba3b('0x7c')](_0xba3b('0x99'),_0xeec75d[_0xba3b('0x47')][_0xba3b('0x7a')]),'attachments':[{'path':_0xbcad9c}]}})['then'](function(){return _0x5a402a;})[_0xba3b('0x1e')](function(_0x5132cd){logger[_0xba3b('0x19')](_0x5132cd);});})[_0xba3b('0x28')](respondWithStatusCode(_0x5eacbd,0xc8))[_0xba3b('0x1e')](handleError(_0x5eacbd,null));};exports[_0xba3b('0x9a')]=function(_0x1ee7cb,_0x2dc63c){return db[_0xba3b('0x5f')]['find']({'where':{'id':_0x1ee7cb[_0xba3b('0x48')]['id']}})[_0xba3b('0x28')](handleEntityNotFound(_0x2dc63c,null))[_0xba3b('0x28')](function(_0x41811c){if(_0x41811c){return _0x41811c[_0xba3b('0x9a')](_0x1ee7cb[_0xba3b('0x47')][_0xba3b('0x9b')],_[_0xba3b('0x9c')](_0x1ee7cb[_0xba3b('0x47')],[_0xba3b('0x9b'),'id'])||{});}})[_0xba3b('0x28')](respondWithResult(_0x2dc63c,null))[_0xba3b('0x1e')](handleError(_0x2dc63c,null));};exports[_0xba3b('0x9d')]=function(_0x89c69a,_0x487afd){var _0x5768dd={'raw':![],'where':{}};var _0x4c4426={};var _0x87f3a7={'count':0x0,'rows':[]};return db[_0xba3b('0x34')][_0xba3b('0x4c')]({'where':{'id':_0x89c69a['params']['id']}})[_0xba3b('0x28')](handleEntityNotFound(_0x487afd,null))[_0xba3b('0x28')](function(_0x4d44c7){if(_0x4d44c7){_0x4c4426[_0xba3b('0x3b')]=_[_0xba3b('0x3c')](db['ChatMessage'][_0xba3b('0x35')]);_0x4c4426['query']=_['keys'](_0x89c69a[_0xba3b('0x3d')]);_0x4c4426[_0xba3b('0x3e')]=_[_0xba3b('0x3f')](_0x4c4426[_0xba3b('0x3b')],_0x4c4426[_0xba3b('0x3d')]);_0x5768dd[_0xba3b('0x40')]=_[_0xba3b('0x3f')](_0x4c4426[_0xba3b('0x3b')],qs[_0xba3b('0x41')](_0x89c69a[_0xba3b('0x3d')]['fields']));_0x5768dd[_0xba3b('0x40')]=_0x5768dd['attributes'][_0xba3b('0x42')]?_0x5768dd[_0xba3b('0x40')]:_0x4c4426[_0xba3b('0x3b')];if(!_0x89c69a[_0xba3b('0x3d')][_0xba3b('0x9e')](_0xba3b('0x9f'))){_0x5768dd['limit']=qs['limit'](_0x89c69a[_0xba3b('0x3d')][_0xba3b('0x23')]);_0x5768dd[_0xba3b('0x21')]=qs[_0xba3b('0x21')](_0x89c69a[_0xba3b('0x3d')]['offset']);}_0x5768dd[_0xba3b('0xa0')]=qs['sort'](_0x89c69a[_0xba3b('0x3d')][_0xba3b('0xa1')]);_0x5768dd['where']=qs['filters'](_[_0xba3b('0xa2')](_0x89c69a[_0xba3b('0x3d')],_0x4c4426[_0xba3b('0x3e')]));_0x5768dd['where'][_0xba3b('0xa3')]=_0x4d44c7['id'];if(_0x89c69a['query']['filter']){_0x5768dd['where']=_[_0xba3b('0x2f')](_0x5768dd['where'],{'$or':_[_0xba3b('0x33')](_0x5768dd[_0xba3b('0x40')],function(_0x46bc1e){var _0x5d9f9b={};_0x5d9f9b[_0x46bc1e]={'$like':'%'+_0x89c69a['query'][_0xba3b('0xa4')]+'%'};return _0x5d9f9b;})});}if(_0x89c69a[_0xba3b('0x3d')][_0xba3b('0xa5')]){var _0x392800=_0x89c69a['query'][_0xba3b('0xa5')][_0xba3b('0xa6')](',');var _0x51413d={};_0x51413d[_0x392800[0x0]]={'$gte':moment(_0x392800[0x1])[_0xba3b('0x7c')](_0xba3b('0xa7'))};_0x5768dd[_0xba3b('0xa8')]=_[_0xba3b('0x2f')](_0x5768dd['where'],_0x51413d);}_0x5768dd=_['merge']({},_0x5768dd,_0x89c69a[_0xba3b('0x44')]);return db[_0xba3b('0x5f')]['count']({'where':_0x5768dd[_0xba3b('0xa8')]})[_0xba3b('0x28')](function(_0x19d7f6){_0x87f3a7[_0xba3b('0x24')]=_0x19d7f6;if(_0x89c69a['query']['includeAll']){_0x5768dd['include']=[{'all':!![]}];}return db[_0xba3b('0x5f')][_0xba3b('0xa9')](_0x5768dd);})['then'](function(_0x56378c){_0x87f3a7[_0xba3b('0xaa')]=_0x56378c;return _0x87f3a7;});}})[_0xba3b('0x28')](respondWithFilteredResult(_0x487afd,_0x5768dd))[_0xba3b('0x1e')](handleError(_0x487afd,null));};exports[_0xba3b('0xab')]=function(_0x4716bf,_0x68e8a8){var _0x4cc9b6={'where':{}},_0x590390={},_0x55daaa={'count':0x0,'rows':[]};return db[_0xba3b('0x34')][_0xba3b('0x4c')]({'where':{'id':_0x4716bf[_0xba3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x68e8a8,null))[_0xba3b('0x28')](function(_0x44c5b1){if(_0x44c5b1){_0x590390[_0xba3b('0x3b')]=_[_0xba3b('0x3c')](db[_0xba3b('0x5f')][_0xba3b('0x35')]);_0x590390[_0xba3b('0x3d')]=_['keys'](_0x4716bf[_0xba3b('0x3d')]);_0x590390[_0xba3b('0x3e')]=_[_0xba3b('0x3f')](_0x590390[_0xba3b('0x3b')],_0x590390[_0xba3b('0x3d')]);_0x4cc9b6[_0xba3b('0x40')]=_[_0xba3b('0x3f')](_0x590390[_0xba3b('0x3b')],qs[_0xba3b('0x41')](_0x4716bf[_0xba3b('0x3d')]['fields']));_0x4cc9b6[_0xba3b('0x40')]=_0x4cc9b6['attributes']['length']?_0x4cc9b6['attributes']:_0x590390[_0xba3b('0x3b')];if(!_0x4716bf[_0xba3b('0x3d')][_0xba3b('0x9e')](_0xba3b('0x9f'))){_0x4cc9b6[_0xba3b('0x23')]=qs[_0xba3b('0x23')](_0x4716bf[_0xba3b('0x3d')][_0xba3b('0x23')]);_0x4cc9b6[_0xba3b('0x21')]=qs[_0xba3b('0x21')](_0x4716bf[_0xba3b('0x3d')][_0xba3b('0x21')]);}_0x4cc9b6['order']=qs['sort'](_0x4716bf[_0xba3b('0x3d')]['sort']);_0x4cc9b6[_0xba3b('0xa8')]=qs[_0xba3b('0x3e')](_['pick'](_0x4716bf[_0xba3b('0x3d')],_0x590390[_0xba3b('0x3e')]));_0x4cc9b6[_0xba3b('0xa8')][_0xba3b('0xa3')]=_0x44c5b1['id'];if(_0x4716bf[_0xba3b('0x3d')][_0xba3b('0xa4')]){_0x4cc9b6[_0xba3b('0xa8')]=_['merge'](_0x4cc9b6[_0xba3b('0xa8')],{'$or':_['map'](_0x4cc9b6['attributes'],function(_0xfcc8af){var _0xc02d10={};_0xc02d10[_0xfcc8af]={'$like':'%'+_0x4716bf[_0xba3b('0x3d')][_0xba3b('0xa4')]+'%'};return _0xc02d10;})});}_0x4cc9b6['where'][_0xba3b('0x8e')]=![];if(_0x4716bf[_0xba3b('0x3d')]['id']){_0x4cc9b6[_0xba3b('0xa8')]['id']={'$gt':_0x4716bf[_0xba3b('0x3d')]['id']};}_0x4cc9b6=_[_0xba3b('0x2f')]({},_0x4cc9b6,_0x4716bf['options']);return db['ChatMessage'][_0xba3b('0x24')]({'where':_0x4cc9b6[_0xba3b('0xa8')]})[_0xba3b('0x28')](function(_0x144afb){_0x55daaa[_0xba3b('0x24')]=_0x144afb;_0x4cc9b6[_0xba3b('0xac')]=[];if(_0x4716bf['query'][_0xba3b('0xad')]){_0x4cc9b6['include'][_0xba3b('0xae')]({'model':db[_0xba3b('0x80')],'as':_0xba3b('0x80'),'attributes':['id',_0xba3b('0x53'),_0xba3b('0x88')]});}if(_0x4716bf[_0xba3b('0x3d')]['includeAll']){_0x4cc9b6[_0xba3b('0xac')]=[{'all':!![]}];}return db[_0xba3b('0x5f')]['findAll'](_0x4cc9b6);})[_0xba3b('0x28')](function(_0xa76bbb){_0x55daaa[_0xba3b('0xaa')]=_0xa76bbb;return _0x55daaa;});}})['then'](respondWithFilteredResult(_0x68e8a8,_0x4cc9b6))['catch'](handleError(_0x68e8a8,null));};exports[_0xba3b('0xaf')]=function(_0x4523db,_0x3323f2){return db[_0xba3b('0x34')][_0xba3b('0x45')]({'where':{'id':_0x4523db[_0xba3b('0x48')]['id']}})[_0xba3b('0x28')](handleEntityNotFound(_0x3323f2,null))[_0xba3b('0x28')](function(_0x1b2461){if(_0x1b2461){return _0x1b2461[_0xba3b('0xb0')](_0x4523db['body']['ids'],_['omit'](_0x4523db[_0xba3b('0x47')],[_0xba3b('0x9b'),'id'])||{})[_0xba3b('0xb1')](function(){return db[_0xba3b('0xb2')]['findAll']({'attributes':['id',_0xba3b('0x2c'),'color'],'where':{'id':_0x4523db['body'][_0xba3b('0x9b')]}});})[_0xba3b('0x28')](function(_0x3178c9){socket['emit']('chatInteractionTags:save',{'id':Number(_0x4523db[_0xba3b('0x48')]['id']),'tags':_0x3178c9||[]});return{'id':Number(_0x4523db['params']['id']),'tags':_0x3178c9||[]};});}})[_0xba3b('0x28')](respondWithResult(_0x3323f2,null))[_0xba3b('0x1e')](handleError(_0x3323f2,null));};exports[_0xba3b('0xb3')]=function(_0x28b47b,_0x375943){return db['ChatInteraction'][_0xba3b('0x45')]({'where':{'id':_0x28b47b['params']['id']}})[_0xba3b('0x28')](handleEntityNotFound(_0x375943,null))['then'](function(_0x4f916d){if(_0x4f916d){return _0x4f916d['removeTags'](_0x28b47b[_0xba3b('0x3d')][_0xba3b('0x9b')]);}})[_0xba3b('0x28')](respondWithStatusCode(_0x375943,null))[_0xba3b('0x1e')](handleError(_0x375943,null));};exports[_0xba3b('0x78')]=function(_0x21be51,_0x40cade){var _0x49ee96=moment()['unix']()[_0xba3b('0xb4')]();var _0x42c4bd=path['join'](config[_0xba3b('0x76')],_0xba3b('0xb5'),_0xba3b('0xb6'),_0xba3b('0xb7'));var _0xdb3446=path[_0xba3b('0x75')](config[_0xba3b('0x76')],'server','files',_0xba3b('0xb8'));var _0xffb02e=path[_0xba3b('0x75')](_0x42c4bd,_0x49ee96);var _0x4f77b3=util[_0xba3b('0x7c')](_0xba3b('0xb9'),_0x21be51[_0xba3b('0x48')]['id'],_0x49ee96);var _0xbde99c=path[_0xba3b('0x75')](_0x42c4bd,_0x4f77b3);var _0x471023=[];_0x471023[_0xba3b('0xae')]({'model':db[_0xba3b('0x80')],'as':_0xba3b('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x471023[_0xba3b('0xae')]({'model':db['CmContact'],'as':_0xba3b('0x63'),'attributes':['id',_0xba3b('0xba'),_0xba3b('0xbb')],'raw':!![]});if(_0x21be51[_0xba3b('0x3d')]['attachments']){_0x471023[_0xba3b('0xae')]({'model':db[_0xba3b('0x71')],'as':_0xba3b('0x71'),'raw':!![]});}var _0x2cd693=[{'model':db[_0xba3b('0x5f')],'as':_0xba3b('0x82'),'attributes':['id','body','createdAt',_0xba3b('0x8d'),'secret',_0xba3b('0xbc')],'include':_0x471023}];_0x2cd693[_0xba3b('0xae')]({'model':db[_0xba3b('0x4b')],'as':_0xba3b('0xbd'),'attributes':['id',_0xba3b('0x2c')]});_0x2cd693['push']({'model':db['User'],'as':_0xba3b('0xbe'),'attributes':['id','fullname']});return db[_0xba3b('0x34')][_0xba3b('0x45')]({'where':{'id':_0x21be51['params']['id']},'include':_0x2cd693})[_0xba3b('0x28')](handleEntityNotFound(_0x40cade,null))[_0xba3b('0x28')](function(_0x2e65ac){if(_0x2e65ac){var _0x50a5aa=_0x2e65ac[_0xba3b('0xbf')]({'plain':!![]});fs[_0xba3b('0xc0')](_0xffb02e);var _0x1416fd={'channel':_0xba3b('0xc1'),'account':_0x50a5aa[_0xba3b('0xbd')]['name'],'agent':_0x50a5aa[_0xba3b('0xbe')]?_0x50a5aa[_0xba3b('0xbe')][_0xba3b('0x53')]:_0xba3b('0xc2'),'createdAt':moment(_0x50a5aa[_0xba3b('0x8c')])[_0xba3b('0x7c')](_0xba3b('0xa7'))[_0xba3b('0xb4')](),'closedAt':_0x50a5aa[_0xba3b('0x69')]?moment(_0x50a5aa['closedAt'])[_0xba3b('0x7c')](_0xba3b('0xa7'))['toString']():'','disposition':_0x50a5aa[_0xba3b('0xc3')],'chatInfo':{'browser':_0x50a5aa[_0xba3b('0xc4')],'os':_0x50a5aa[_0xba3b('0xc5')],'referer':_0x50a5aa['referer'],'customerIp':_0x50a5aa[_0xba3b('0xc6')],'customerPort':_0x50a5aa[_0xba3b('0xc7')]?_0x50a5aa[_0xba3b('0xc7')]:_0xba3b('0xc2')},'messages':_(_0x50a5aa[_0xba3b('0x82')])[_0xba3b('0xc8')]()[_0xba3b('0xa4')]({'secret':![]})[_0xba3b('0x33')](function(_0x331dca){if(_0x331dca[_0xba3b('0x71')]){var _0x549d4a=path[_0xba3b('0x75')](_0xdb3446,_0x331dca['Attachment'][_0xba3b('0x6e')]);if(fs['existsSync'](_0x549d4a)){fs[_0xba3b('0xc9')](_0x549d4a)[_0xba3b('0xca')](fs[_0xba3b('0xcb')](path['join'](_0xffb02e,_0x331dca[_0xba3b('0x71')][_0xba3b('0x6e')])));}}return{'date':moment(_0x331dca[_0xba3b('0x8c')])['format'](_0xba3b('0xa7'))[_0xba3b('0xb4')](),'sender':_0x331dca['direction']===_0xba3b('0x5e')?_0x331dca[_0xba3b('0x80')]?_0x331dca['User'][_0xba3b('0x53')]:'System':_0x331dca[_0xba3b('0x63')][_0xba3b('0xba')]+(_0x331dca['Contact'][_0xba3b('0xbb')]?'\x20'+_0x331dca[_0xba3b('0x63')][_0xba3b('0xbb')]:''),'body':_0x331dca[_0xba3b('0x71')]?_0x331dca[_0xba3b('0x71')][_0xba3b('0x6e')]:_0x331dca[_0xba3b('0x47')],'direction':_0x331dca[_0xba3b('0x8d')]===_0xba3b('0x5e')?'A':'C','secret':_0x331dca['secret'],'read':_0x331dca[_0xba3b('0xbc')],'attachment':_0x331dca[_0xba3b('0x71')]};})[_0xba3b('0xcc')]()};return ejs[_0xba3b('0xcd')](path[_0xba3b('0x75')](config['root'],'server',_0xba3b('0xce'),_0xba3b('0xcf')),{'interaction':_0x1416fd})['then'](function(_0x2e5703){var _0x458c0e=path[_0xba3b('0x75')](_0xffb02e,_0xba3b('0xd0')+_0x50a5aa['id']+'-'+_0x49ee96+'.pdf');var _0x3a34cd={'path':_0x458c0e,'channel':_0xba3b('0xc1'),'interactionId':_0x50a5aa['id']};return pdf['createPdfFromHTML'](_0x2e5703,_0x3a34cd);})[_0xba3b('0x28')](function(){return new Promise(function(_0x46696f,_0x556694){zipdir(_0xffb02e,{'saveTo':_0xbde99c},function(_0x31aa69,_0x508f7b){if(_0x31aa69)return _0x556694(_0x31aa69);return _0x46696f(_0x508f7b);});})['then'](function(){return new BPromise(function(_0x43bb38,_0x525c2d){rimraf(_0xffb02e,function(_0x4576bf){if(_0x4576bf)_0x525c2d(_0x4576bf);return _0x43bb38();});});})[_0xba3b('0x28')](function(){return _0x40cade[_0xba3b('0x78')](_0xbde99c,_0x4f77b3,function(_0x19c413){if(_0x19c413){logger['error'](_0xba3b('0xd1'),_0x19c413);}else{fs[_0xba3b('0xd2')](_0xbde99c);}});});});}else{return _0x40cade[_0xba3b('0x1f')](0xc8);}})['catch'](handleError(_0x40cade,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f0fca05..b71dbbd 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 _0x150b=['update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x540c79,_0x4ca285){var _0x2a422a=function(_0xec4f9){while(--_0xec4f9){_0x540c79['push'](_0x540c79['shift']());}};_0x2a422a(++_0x4ca285);}(_0x150b,0x118));var _0xb150=function(_0x43026b,_0x928d8c){_0x43026b=_0x43026b-0x0;var _0x4a96cd=_0x150b[_0x43026b];return _0x4a96cd;};'use strict';var EventEmitter=require(_0xb150('0x0'));var ChatInteraction=require(_0xb150('0x1'))['db'][_0xb150('0x2')];var ChatMessage=require(_0xb150('0x1'))['db'][_0xb150('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb150('0x4'),'afterUpdate':_0xb150('0x5'),'afterDestroy':'remove'};function emitEvent(_0x249d11){return function(_0x3288bb,_0x279cd6,_0x392253){_0x3288bb[_0xb150('0x6')]({'attributes':['id'],'raw':!![]})[_0xb150('0x7')](function(_0x4bcac5){_0x3288bb[_0xb150('0x8')](_0xb150('0x9'),_0x4bcac5[_0xb150('0xa')](function(_0x3212e6){return{'id':_0x3212e6['id']};}));return ChatMessage[_0xb150('0xb')]({'where':{'ChatInteractionId':_0x3288bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb150('0x7')](function(_0x589787){_0x3288bb[_0xb150('0x8')](_0xb150('0xc'),_0x589787[_0xb150('0xd')]);ChatInteractionEvents['emit'](_0x249d11+':'+_0x3288bb['id'],_0x3288bb);ChatInteractionEvents[_0xb150('0xe')](_0x249d11,_0x3288bb);_0x392253(null);})[_0xb150('0xf')](_0x392253(null));};}for(var e in events){if(events[_0xb150('0x10')](e)){var event=events[e];ChatInteraction[_0xb150('0x11')](e,emitEvent(event));}}module[_0xb150('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x1d56=['ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x6030e4,_0xf34dd5){var _0x45175=function(_0x1161e4){while(--_0x1161e4){_0x6030e4['push'](_0x6030e4['shift']());}};_0x45175(++_0xf34dd5);}(_0x1d56,0xc9));var _0x61d5=function(_0x4769cf,_0x28fe2f){_0x4769cf=_0x4769cf-0x0;var _0x36ccd5=_0x1d56[_0x4769cf];return _0x36ccd5;};'use strict';var EventEmitter=require(_0x61d5('0x0'));var ChatInteraction=require(_0x61d5('0x1'))['db'][_0x61d5('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x61d5('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x61d5('0x4')](0x0);var events={'afterCreate':_0x61d5('0x5'),'afterUpdate':_0x61d5('0x6'),'afterDestroy':_0x61d5('0x7')};function emitEvent(_0x547948){return function(_0x64a13e,_0x423f4e,_0x806ebf){_0x64a13e['getUsers']({'attributes':['id'],'raw':!![]})[_0x61d5('0x8')](function(_0x356085){_0x64a13e[_0x61d5('0x9')]('Users',_0x356085[_0x61d5('0xa')](function(_0x786dd9){return{'id':_0x786dd9['id']};}));return ChatMessage[_0x61d5('0xb')]({'where':{'ChatInteractionId':_0x64a13e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x61d5('0x8')](function(_0x32dc97){_0x64a13e[_0x61d5('0x9')]('unreadMessages',_0x32dc97[_0x61d5('0xc')]);ChatInteractionEvents[_0x61d5('0xd')](_0x547948+':'+_0x64a13e['id'],_0x64a13e);ChatInteractionEvents[_0x61d5('0xd')](_0x547948,_0x64a13e);_0x806ebf(null);})[_0x61d5('0xe')](_0x806ebf(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x61d5('0xf')](e,emitEvent(event));}}module[_0x61d5('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 24c499b..1873f94 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 _0xdafa=['utf8mb4','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3b1e3f,_0xf8826b){var _0x3b1cd3=function(_0x26ad44){while(--_0x26ad44){_0x3b1e3f['push'](_0x3b1e3f['shift']());}};_0x3b1cd3(++_0xf8826b);}(_0xdafa,0x1ee));var _0xadaf=function(_0x138700,_0x4036f4){_0x138700=_0x138700-0x0;var _0x5ab351=_0xdafa[_0x138700];return _0x5ab351;};'use strict';var _=require('lodash');var util=require(_0xadaf('0x0'));var logger=require(_0xadaf('0x1'))('api');var moment=require(_0xadaf('0x2'));var BPromise=require(_0xadaf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadaf('0x4'));var rimraf=require(_0xadaf('0x5'));var config=require(_0xadaf('0x6'));var attributes=require(_0xadaf('0x7'));module[_0xadaf('0x8')]=function(_0x33c051,_0x2862c6){return _0x33c051[_0xadaf('0x9')](_0xadaf('0xa'),attributes,{'tableName':_0xadaf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c633f,_0x5a1198,_0x2205b7){if(_0x4c633f['changed'](_0xadaf('0xc'))){_0x4c633f[_0xadaf('0xd')]=moment()[_0xadaf('0xe')](_0xadaf('0xf'));}_0x2205b7(null,_0x4c633f);}},'charset':_0xadaf('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x40a3=['../../config/logger','api','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x255140,_0x13124c){var _0x55032a=function(_0x38e7c4){while(--_0x38e7c4){_0x255140['push'](_0x255140['shift']());}};_0x55032a(++_0x13124c);}(_0x40a3,0x1c0));var _0x340a=function(_0x6ccf5b,_0x445dcd){_0x6ccf5b=_0x6ccf5b-0x0;var _0x8a57db=_0x40a3[_0x6ccf5b];return _0x8a57db;};'use strict';var _=require(_0x340a('0x0'));var util=require(_0x340a('0x1'));var logger=require(_0x340a('0x2'))(_0x340a('0x3'));var moment=require('moment');var BPromise=require(_0x340a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x340a('0x5'));var rimraf=require(_0x340a('0x6'));var config=require('../../config/environment');var attributes=require(_0x340a('0x7'));module[_0x340a('0x8')]=function(_0x2f593e,_0xd953a4){return _0x2f593e[_0x340a('0x9')](_0x340a('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a674b,_0x4524c9,_0x163450){if(_0x2a674b[_0x340a('0xb')](_0x340a('0xc'))){_0x2a674b[_0x340a('0xd')]=moment()[_0x340a('0xe')](_0x340a('0xf'));}_0x163450(null,_0x2a674b);}},'charset':_0x340a('0x10'),'collate':_0x340a('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index a9d5d32..21217a8 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 _0x7d79=['body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update'];(function(_0x40e228,_0x51a09e){var _0xbb250f=function(_0x520728){while(--_0x520728){_0x40e228['push'](_0x40e228['shift']());}};_0xbb250f(++_0x51a09e);}(_0x7d79,0x1a2));var _0x97d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7d79[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x97d7('0x0'));var util=require(_0x97d7('0x1'));var moment=require('moment');var BPromise=require(_0x97d7('0x2'));var rs=require(_0x97d7('0x3'));var fs=require('fs');var Redis=require(_0x97d7('0x4'));var db=require(_0x97d7('0x5'))['db'];var utils=require(_0x97d7('0x6'));var logger=require(_0x97d7('0x7'))(_0x97d7('0x8'));var config=require(_0x97d7('0x9'));var jayson=require(_0x97d7('0xa'));var client=jayson[_0x97d7('0xb')]['http']({'port':0x232a});config[_0x97d7('0xc')]=_[_0x97d7('0xd')](config[_0x97d7('0xc')],{'host':_0x97d7('0xe'),'port':0x18eb});var socket=require(_0x97d7('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x97d7('0x10')](socket);function respondWithRpcPromise(_0x557b0f,_0x26251a,_0x968aa9){return new BPromise(function(_0x3b0b3b,_0x348e01){return client[_0x97d7('0x11')](_0x557b0f,_0x968aa9)[_0x97d7('0x12')](function(_0x1e75af){logger['info'](_0x97d7('0x13'),_0x26251a,_0x97d7('0x14'));logger[_0x97d7('0x15')](_0x97d7('0x16'),_0x26251a,'request\x20sent',JSON['stringify'](_0x1e75af));if(_0x1e75af[_0x97d7('0x17')]){if(_0x1e75af[_0x97d7('0x17')][_0x97d7('0x18')]===0x1f4){logger[_0x97d7('0x17')](_0x97d7('0x13'),_0x26251a,_0x1e75af['error'][_0x97d7('0x19')]);return _0x348e01(_0x1e75af[_0x97d7('0x17')][_0x97d7('0x19')]);}logger['error'](_0x97d7('0x13'),_0x26251a,_0x1e75af[_0x97d7('0x17')][_0x97d7('0x19')]);return _0x3b0b3b(_0x1e75af[_0x97d7('0x17')][_0x97d7('0x19')]);}else{logger[_0x97d7('0x1a')](_0x97d7('0x13'),_0x26251a,'request\x20sent');_0x3b0b3b(_0x1e75af[_0x97d7('0x1b')][_0x97d7('0x19')]);}})[_0x97d7('0x1c')](function(_0x358884){logger['error'](_0x97d7('0x13'),_0x26251a,_0x358884);_0x348e01(_0x358884);});});}exports[_0x97d7('0x1d')]=function(_0x3fb8ad){var _0x2c38a5=this;return new Promise(function(_0x2d7610,_0x42b852){return db[_0x97d7('0x1e')][_0x97d7('0x1f')](_0x3fb8ad[_0x97d7('0x20')],{'raw':_0x3fb8ad['options']?_0x3fb8ad[_0x97d7('0x21')][_0x97d7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb8ad[_0x97d7('0x21')]?_0x3fb8ad['options'][_0x97d7('0x23')]||null:null,'attributes':_0x3fb8ad['options']?_0x3fb8ad['options'][_0x97d7('0x24')]||null:null,'limit':_0x3fb8ad[_0x97d7('0x21')]?_0x3fb8ad[_0x97d7('0x21')][_0x97d7('0x25')]||null:null})['then'](function(_0xcaa25){logger['info'](_0x97d7('0x1d'),_0x3fb8ad);logger[_0x97d7('0x15')](_0x97d7('0x1d'),_0x3fb8ad,JSON[_0x97d7('0x26')](_0xcaa25));_0x2d7610(_0xcaa25);})[_0x97d7('0x1c')](function(_0x193f47){logger[_0x97d7('0x17')]('UpdateChatInteraction',_0x193f47[_0x97d7('0x19')],_0x3fb8ad);_0x42b852(_0x2c38a5[_0x97d7('0x17')](0x1f4,_0x193f47['message']));});});};exports[_0x97d7('0x27')]=function(_0xc826d8){return new Promise(function(_0x54ac03,_0x173617){return db['ChatInteraction'][_0x97d7('0x28')]({'where':_0xc826d8[_0x97d7('0x21')]?_0xc826d8[_0x97d7('0x21')][_0x97d7('0x23')]||null:null})[_0x97d7('0x12')](function(_0x5cbb45){if(_0x5cbb45){return _0x5cbb45[_0x97d7('0x29')](_0xc826d8['body'][_0x97d7('0x2a')],_[_0x97d7('0x2b')](_0xc826d8[_0x97d7('0x20')],['ids','id'])||{});}})['spread'](function(_0x2c845b){logger[_0x97d7('0x1a')](_0x97d7('0x2c'),_0xc826d8);logger[_0x97d7('0x15')](_0x97d7('0x2c'),_0xc826d8,JSON[_0x97d7('0x26')](_0x2c845b));_0x54ac03(_0x2c845b);})[_0x97d7('0x1c')](function(_0x23ccfa){logger['error'](_0x97d7('0x2c'),_0x23ccfa[_0x97d7('0x19')],_0xc826d8);_0x173617(_this[_0x97d7('0x17')](0x1f4,_0x23ccfa['message']));});});}; \ No newline at end of file +var _0xd367=['../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x364aa7,_0x246d24){var _0x2e3e05=function(_0x7b0836){while(--_0x7b0836){_0x364aa7['push'](_0x364aa7['shift']());}};_0x2e3e05(++_0x246d24);}(_0xd367,0xc8));var _0x7d36=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd367[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7d36('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d36('0x1'));var db=require(_0x7d36('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d36('0x3'))(_0x7d36('0x4'));var config=require(_0x7d36('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d36('0x6')][_0x7d36('0x7')]({'port':0x232a});config['redis']=_[_0x7d36('0x8')](config[_0x7d36('0x9')],{'host':_0x7d36('0xa'),'port':0x18eb});var socket=require(_0x7d36('0xb'))(new Redis(config['redis']));require(_0x7d36('0xc'))[_0x7d36('0xd')](socket);function respondWithRpcPromise(_0x3a3c96,_0x335ce5,_0x78eb33){return new BPromise(function(_0x585af6,_0x1a36ee){return client[_0x7d36('0xe')](_0x3a3c96,_0x78eb33)[_0x7d36('0xf')](function(_0x4bbddb){logger['info'](_0x7d36('0x10'),_0x335ce5,_0x7d36('0x11'));logger[_0x7d36('0x12')](_0x7d36('0x13'),_0x335ce5,'request\x20sent',JSON[_0x7d36('0x14')](_0x4bbddb));if(_0x4bbddb[_0x7d36('0x15')]){if(_0x4bbddb[_0x7d36('0x15')][_0x7d36('0x16')]===0x1f4){logger[_0x7d36('0x15')](_0x7d36('0x10'),_0x335ce5,_0x4bbddb[_0x7d36('0x15')]['message']);return _0x1a36ee(_0x4bbddb['error'][_0x7d36('0x17')]);}logger[_0x7d36('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x335ce5,_0x4bbddb[_0x7d36('0x15')][_0x7d36('0x17')]);return _0x585af6(_0x4bbddb[_0x7d36('0x15')]['message']);}else{logger[_0x7d36('0x18')](_0x7d36('0x10'),_0x335ce5,_0x7d36('0x11'));_0x585af6(_0x4bbddb['result']['message']);}})[_0x7d36('0x19')](function(_0x3c07b4){logger[_0x7d36('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x335ce5,_0x3c07b4);_0x1a36ee(_0x3c07b4);});});}exports[_0x7d36('0x1a')]=function(_0x50df1f){var _0x2f89f4=this;return new Promise(function(_0x3b3088,_0x488793){return db[_0x7d36('0x1b')][_0x7d36('0x1c')](_0x50df1f[_0x7d36('0x1d')],{'raw':_0x50df1f[_0x7d36('0x1e')]?_0x50df1f[_0x7d36('0x1e')][_0x7d36('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50df1f['options']?_0x50df1f['options'][_0x7d36('0x20')]||null:null,'attributes':_0x50df1f[_0x7d36('0x1e')]?_0x50df1f[_0x7d36('0x1e')][_0x7d36('0x21')]||null:null,'limit':_0x50df1f[_0x7d36('0x1e')]?_0x50df1f['options'][_0x7d36('0x22')]||null:null})[_0x7d36('0xf')](function(_0x1994f9){logger['info']('UpdateChatInteraction',_0x50df1f);logger[_0x7d36('0x12')](_0x7d36('0x1a'),_0x50df1f,JSON['stringify'](_0x1994f9));_0x3b3088(_0x1994f9);})[_0x7d36('0x19')](function(_0x161e25){logger[_0x7d36('0x15')](_0x7d36('0x1a'),_0x161e25[_0x7d36('0x17')],_0x50df1f);_0x488793(_0x2f89f4[_0x7d36('0x15')](0x1f4,_0x161e25[_0x7d36('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x49ff8d){return new Promise(function(_0x5b9be8,_0x546de9){return db[_0x7d36('0x1b')][_0x7d36('0x23')]({'where':_0x49ff8d[_0x7d36('0x1e')]?_0x49ff8d['options'][_0x7d36('0x20')]||null:null})[_0x7d36('0xf')](function(_0x5dbf23){if(_0x5dbf23){return _0x5dbf23[_0x7d36('0x24')](_0x49ff8d[_0x7d36('0x1d')][_0x7d36('0x25')],_[_0x7d36('0x26')](_0x49ff8d[_0x7d36('0x1d')],[_0x7d36('0x25'),'id'])||{});}})[_0x7d36('0x27')](function(_0x50fe2d){logger[_0x7d36('0x18')](_0x7d36('0x28'),_0x49ff8d);logger[_0x7d36('0x12')](_0x7d36('0x28'),_0x49ff8d,JSON[_0x7d36('0x14')](_0x50fe2d));_0x5b9be8(_0x50fe2d);})['catch'](function(_0x418cb7){logger[_0x7d36('0x15')](_0x7d36('0x28'),_0x418cb7['message'],_0x49ff8d);_0x546de9(_this[_0x7d36('0x15')](0x1f4,_0x418cb7[_0x7d36('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index ebc0c46..a723fed 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 _0x1373=['./chatInteraction.events','save','remove','update','removeListener','length'];(function(_0x518ea6,_0x5d7886){var _0x1bd832=function(_0x2d12c1){while(--_0x2d12c1){_0x518ea6['push'](_0x518ea6['shift']());}};_0x1bd832(++_0x5d7886);}(_0x1373,0xa2));var _0x3137=function(_0x48aa07,_0x131990){_0x48aa07=_0x48aa07-0x0;var _0x57879a=_0x1373[_0x48aa07];return _0x57879a;};'use strict';var ChatInteractionEvents=require(_0x3137('0x0'));var events=[_0x3137('0x1'),_0x3137('0x2'),_0x3137('0x3')];function createListener(_0x22e434,_0x2cf7ec){return function(_0xdca7a0){_0x2cf7ec['emit'](_0x22e434,_0xdca7a0);};}function removeListener(_0x358729,_0x2b0e25){return function(){ChatInteractionEvents[_0x3137('0x4')](_0x358729,_0x2b0e25);};}exports['register']=function(_0x1c4663){for(var _0x2833aa=0x0,_0x8f5387=events[_0x3137('0x5')];_0x2833aa<_0x8f5387;_0x2833aa++){var _0x3a2e22=events[_0x2833aa];var _0x53d09d=createListener('chatInteraction:'+_0x3a2e22,_0x1c4663);ChatInteractionEvents['on'](_0x3a2e22,_0x53d09d);}}; \ No newline at end of file +var _0x5d01=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','remove'];(function(_0x4314d7,_0x355218){var _0x5c599b=function(_0x556354){while(--_0x556354){_0x4314d7['push'](_0x4314d7['shift']());}};_0x5c599b(++_0x355218);}(_0x5d01,0xe5));var _0x15d0=function(_0xa20571,_0x49a4b9){_0xa20571=_0xa20571-0x0;var _0x16beae=_0x5d01[_0xa20571];return _0x16beae;};'use strict';var ChatInteractionEvents=require(_0x15d0('0x0'));var events=['save',_0x15d0('0x1'),_0x15d0('0x2')];function createListener(_0x580bc6,_0xe135d0){return function(_0x665632){_0xe135d0['emit'](_0x580bc6,_0x665632);};}function removeListener(_0x53abcf,_0x1a067d){return function(){ChatInteractionEvents[_0x15d0('0x3')](_0x53abcf,_0x1a067d);};}exports[_0x15d0('0x4')]=function(_0x1b0e27){for(var _0x2af55d=0x0,_0x38d2f4=events[_0x15d0('0x5')];_0x2af55d<_0x38d2f4;_0x2af55d++){var _0x336c8c=events[_0x2af55d];var _0x4e5c50=createListener(_0x15d0('0x6')+_0x336c8c,_0x1b0e27);ChatInteractionEvents['on'](_0x336c8c,_0x4e5c50);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 0e1573b..82c42eb 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 _0x429d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','createVidaooSession','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','update','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5cc07e,_0x336510){var _0x14fb8e=function(_0x5414ab){while(--_0x5414ab){_0x5cc07e['push'](_0x5cc07e['shift']());}};_0x14fb8e(++_0x336510);}(_0x429d,0x108));var _0xd429=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x429d[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xd429('0x0'));var path=require(_0xd429('0x1'));var timeout=require(_0xd429('0x2'));var express=require(_0xd429('0x3'));var router=express[_0xd429('0x4')]();var fs_extra=require(_0xd429('0x5'));var auth=require(_0xd429('0x6'));var interaction=require(_0xd429('0x7'));var config=require(_0xd429('0x8'));var controller=require(_0xd429('0x9'));router[_0xd429('0xa')]('/',auth[_0xd429('0xb')](),controller[_0xd429('0xc')]);router[_0xd429('0xa')](_0xd429('0xd'),auth[_0xd429('0xb')](),controller[_0xd429('0xe')]);router['get'](_0xd429('0xf'),auth[_0xd429('0x10')](),controller['show']);router[_0xd429('0xa')](_0xd429('0x11'),auth[_0xd429('0x10')](),controller[_0xd429('0x12')]);router['get'](_0xd429('0x13'),auth['isAuthenticated'](),controller[_0xd429('0x14')]);router[_0xd429('0xa')](_0xd429('0x15'),auth[_0xd429('0x10')](),controller[_0xd429('0x16')]);router[_0xd429('0xa')](_0xd429('0x17'),auth[_0xd429('0xb')](),controller[_0xd429('0x18')]);router['post']('/',auth[_0xd429('0xb')](),controller[_0xd429('0x19')]);router[_0xd429('0x1a')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xd429('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e5ca9,_0xf9fb10,_0x233f32){_0x233f32(null,path['join'](config[_0xd429('0x1c')],_0xd429('0x1d')));},'filename':function(_0x5d2c08,_0x1d1866,_0x13b5f1){_0x13b5f1(null,util[_0xd429('0x1e')](_0xd429('0x1f'),Date[_0xd429('0x20')](),_0x1d1866[_0xd429('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd429('0x1a')](_0xd429('0x22'),upload[_0xd429('0x23')](_0xd429('0x24')),controller[_0xd429('0x25')]);router[_0xd429('0x1a')](_0xd429('0x13'),auth[_0xd429('0x10')](),controller[_0xd429('0x26')]);router[_0xd429('0x1a')]('/:id/tags',auth[_0xd429('0xb')](),interaction[_0xd429('0x27')](_0xd429('0x28'),_0xd429('0x29')),controller[_0xd429('0x2a')]);router['put'](_0xd429('0xf'),auth[_0xd429('0xb')](),interaction[_0xd429('0x27')](_0xd429('0x28'),'chatinteraction:update'),controller[_0xd429('0x2b')]);router['put'](_0xd429('0x2c'),controller[_0xd429('0x2d')]);router[_0xd429('0x2e')](_0xd429('0x2f'),auth[_0xd429('0x10')](),controller[_0xd429('0x30')]);router['put'](_0xd429('0x31'),controller[_0xd429('0x32')]);router['delete'](_0xd429('0xf'),auth['isAuthenticated'](),interaction[_0xd429('0x27')]('chat',_0xd429('0x33')),controller[_0xd429('0x34')]);router[_0xd429('0x35')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x118a=['delete','/:id','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','abandon'];(function(_0x2b36f5,_0x5732dc){var _0x5f06b6=function(_0x5def4f){while(--_0x5def4f){_0x2b36f5['push'](_0x2b36f5['shift']());}};_0x5f06b6(++_0x5732dc);}(_0x118a,0x144));var _0xa118=function(_0x1c2d79,_0x53ca9b){_0x1c2d79=_0x1c2d79-0x0;var _0x1c4ff1=_0x118a[_0x1c2d79];return _0x1c4ff1;};'use strict';var multer=require(_0xa118('0x0'));var util=require(_0xa118('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa118('0x2'));var router=express[_0xa118('0x3')]();var fs_extra=require(_0xa118('0x4'));var auth=require(_0xa118('0x5'));var interaction=require(_0xa118('0x6'));var config=require('../../config/environment');var controller=require(_0xa118('0x7'));router[_0xa118('0x8')]('/',auth[_0xa118('0x9')](),controller[_0xa118('0xa')]);router[_0xa118('0x8')](_0xa118('0xb'),auth['isAuthenticated'](),controller[_0xa118('0xc')]);router[_0xa118('0x8')]('/:id',auth[_0xa118('0xd')](),controller[_0xa118('0xe')]);router[_0xa118('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xa118('0xf')]);router[_0xa118('0x8')](_0xa118('0x10'),auth[_0xa118('0x9')](),controller['getMessages']);router['get']('/:id/my_messages',auth[_0xa118('0xd')](),controller[_0xa118('0x11')]);router[_0xa118('0x8')](_0xa118('0x12'),auth['isAuthenticated'](),controller[_0xa118('0x13')]);router[_0xa118('0x14')]('/',auth[_0xa118('0x9')](),controller[_0xa118('0x15')]);router['post'](_0xa118('0x16'),auth[_0xa118('0x9')](),controller[_0xa118('0x17')]);var upload=multer({'storage':multer[_0xa118('0x18')]({'destination':function(_0x3bf90d,_0xf81ea,_0x28bafd){_0x28bafd(null,path[_0xa118('0x19')](config[_0xa118('0x1a')],_0xa118('0x1b')));},'filename':function(_0x4aa09e,_0x543a02,_0x179fdd){_0x179fdd(null,util[_0xa118('0x1c')](_0xa118('0x1d'),Date[_0xa118('0x1e')](),_0x543a02['originalname'][_0xa118('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa118('0x14')](_0xa118('0x20'),upload[_0xa118('0x21')](_0xa118('0x22')),controller[_0xa118('0x23')]);router[_0xa118('0x14')](_0xa118('0x10'),auth[_0xa118('0xd')](),controller[_0xa118('0x24')]);router[_0xa118('0x14')](_0xa118('0x25'),auth[_0xa118('0x9')](),interaction['tracked'](_0xa118('0x26'),_0xa118('0x27')),controller[_0xa118('0x28')]);router[_0xa118('0x29')]('/:id',auth[_0xa118('0x9')](),interaction[_0xa118('0x2a')](_0xa118('0x26'),_0xa118('0x2b')),controller[_0xa118('0x2c')]);router[_0xa118('0x29')](_0xa118('0x2d'),controller['customUpdate']);router['put']('/:id/abandon',auth[_0xa118('0xd')](),controller[_0xa118('0x2e')]);router[_0xa118('0x29')]('/:id/close',controller['close']);router[_0xa118('0x2f')](_0xa118('0x30'),auth[_0xa118('0x9')](),interaction[_0xa118('0x2a')](_0xa118('0x26'),_0xa118('0x31')),controller[_0xa118('0x32')]);router[_0xa118('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa118('0x33')]);module[_0xa118('0x34')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7105f75..9bf74b7 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 _0x25ed=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x1bb4bb,_0x59d00a){var _0x162e95=function(_0x23a302){while(--_0x23a302){_0x1bb4bb['push'](_0x1bb4bb['shift']());}};_0x162e95(++_0x59d00a);}(_0x25ed,0xf2));var _0xd25e=function(_0x207061,_0xe38cda){_0x207061=_0x207061-0x0;var _0x4a2833=_0x25ed[_0x207061];return _0x4a2833;};'use strict';var Sequelize=require(_0xd25e('0x0'));module[_0xd25e('0x1')]={'body':{'type':Sequelize[_0xd25e('0x2')](_0xd25e('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd25e('0x4')]}}; \ No newline at end of file +var _0x68a5=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x3bb707,_0x20308c){var _0x4c8d94=function(_0x48fd5f){while(--_0x48fd5f){_0x3bb707['push'](_0x3bb707['shift']());}};_0x4c8d94(++_0x20308c);}(_0x68a5,0xba));var _0x568a=function(_0x4935ac,_0x2fec9b){_0x4935ac=_0x4935ac-0x0;var _0x10392d=_0x68a5[_0x4935ac];return _0x10392d;};'use strict';var Sequelize=require(_0x568a('0x0'));module[_0x568a('0x1')]={'body':{'type':Sequelize[_0x568a('0x2')](_0x568a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x568a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x568a('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 4aacfc5..4c67dd0 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 _0xf95d=['agent','admin','user','fullname','role','userpic','internal','online','showWebBar','sort','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','save','then','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','User'];(function(_0x49897a,_0x4b97a9){var _0x366826=function(_0x5b11db){while(--_0x5b11db){_0x49897a['push'](_0x49897a['shift']());}};_0x366826(++_0x4b97a9);}(_0xf95d,0x83));var _0xdf95=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf95d[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0xdf95('0x0'));var rimraf=require(_0xdf95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdf95('0x2'));var Mustache=require(_0xdf95('0x3'));var util=require(_0xdf95('0x4'));var path=require(_0xdf95('0x5'));var sox=require(_0xdf95('0x6'));var csv=require(_0xdf95('0x7'));var ejs=require(_0xdf95('0x8'));var fs=require('fs');var fs_extra=require(_0xdf95('0x9'));var _=require(_0xdf95('0xa'));var squel=require('squel');var crypto=require(_0xdf95('0xb'));var jsforce=require(_0xdf95('0xc'));var deskjs=require(_0xdf95('0xd'));var toCsv=require(_0xdf95('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf95('0xe'));var authService=require(_0xdf95('0xf'));var qs=require(_0xdf95('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf95('0x11'));var logger=require(_0xdf95('0x12'))(_0xdf95('0x13'));var utils=require('../../config/utils');var config=require(_0xdf95('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf95('0x15'))['db'];config[_0xdf95('0x16')]=_[_0xdf95('0x17')](config[_0xdf95('0x16')],{'host':_0xdf95('0x18'),'port':0x18eb});var socket=require(_0xdf95('0x19'))(new Redis(config[_0xdf95('0x16')]));require('./chatInternalMessage.socket')[_0xdf95('0x1a')](socket);function respondWithStatusCode(_0x2e98d8,_0x36f928){_0x36f928=_0x36f928||0xcc;return function(_0x55e39e){if(_0x55e39e){return _0x2e98d8[_0xdf95('0x1b')](_0x36f928);}return _0x2e98d8[_0xdf95('0x1c')](_0x36f928)[_0xdf95('0x1d')]();};}function respondWithResult(_0x5ac227,_0x28f561){_0x28f561=_0x28f561||0xc8;return function(_0x2a8d38){if(_0x2a8d38){return _0x5ac227[_0xdf95('0x1c')](_0x28f561)[_0xdf95('0x1e')](_0x2a8d38);}};}function respondWithFilteredResult(_0x329533,_0x2450aa){return function(_0x537df8){if(_0x537df8){var _0xc24b8e=typeof _0x2450aa['offset']===_0xdf95('0x1f')&&typeof _0x2450aa[_0xdf95('0x20')]===_0xdf95('0x1f');var _0x1444f3=_0x537df8[_0xdf95('0x21')];var _0x3d9293=_0xc24b8e?0x0:_0x2450aa['offset'];var _0x1ffe86=_0xc24b8e?_0x537df8[_0xdf95('0x21')]:_0x2450aa['offset']+_0x2450aa[_0xdf95('0x20')];var _0x2fbb4d;if(_0x1ffe86>=_0x1444f3){_0x1ffe86=_0x1444f3;_0x2fbb4d=0xc8;}else{_0x2fbb4d=0xce;}_0x329533[_0xdf95('0x1c')](_0x2fbb4d);return _0x329533['set'](_0xdf95('0x22'),_0x3d9293+'-'+_0x1ffe86+'/'+_0x1444f3)[_0xdf95('0x1e')](_0x537df8);}return null;};}function patchUpdates(_0x3a82f2){return function(_0x3deb33){try{jsonpatch['apply'](_0x3deb33,_0x3a82f2,!![]);}catch(_0x294e78){return BPromise[_0xdf95('0x23')](_0x294e78);}return _0x3deb33[_0xdf95('0x24')]();};}function saveUpdates(_0x5c6045,_0xee9541){return function(_0x447bfe){if(_0x447bfe){return _0x447bfe['update'](_0x5c6045)[_0xdf95('0x25')](function(_0x4a8ed2){return _0x4a8ed2;});}return null;};}function removeEntity(_0x22bcc8,_0x5b4dcc){return function(_0x5db3ca){if(_0x5db3ca){return _0x5db3ca['destroy']()[_0xdf95('0x25')](function(){_0x22bcc8[_0xdf95('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265de9,_0x40deda){return function(_0x18cbc8){if(!_0x18cbc8){_0x265de9[_0xdf95('0x1b')](0x194);}return _0x18cbc8;};}function handleError(_0x1ece8,_0x433a66){_0x433a66=_0x433a66||0x1f4;return function(_0x43d6f6){logger[_0xdf95('0x26')](_0x43d6f6['stack']);if(_0x43d6f6['name']){delete _0x43d6f6[_0xdf95('0x27')];}_0x1ece8[_0xdf95('0x1c')](_0x433a66)[_0xdf95('0x28')](_0x43d6f6);};}exports[_0xdf95('0x29')]=function(_0x839138,_0x56899e){var _0xe92de9={},_0x43be6d={},_0x198aa9={'count':0x0,'rows':[]};var _0x29b831=_[_0xdf95('0x2a')](db[_0xdf95('0x2b')][_0xdf95('0x2c')],function(_0x5318c9){return{'name':_0x5318c9['fieldName'],'type':_0x5318c9[_0xdf95('0x2d')][_0xdf95('0x2e')]};});_0x43be6d[_0xdf95('0x2f')]=_[_0xdf95('0x2a')](_0x29b831,'name');_0x43be6d[_0xdf95('0x30')]=_[_0xdf95('0x31')](_0x839138['query']);_0x43be6d['filters']=_[_0xdf95('0x32')](_0x43be6d[_0xdf95('0x2f')],_0x43be6d[_0xdf95('0x30')]);_0xe92de9[_0xdf95('0x33')]=_['intersection'](_0x43be6d[_0xdf95('0x2f')],qs[_0xdf95('0x34')](_0x839138[_0xdf95('0x30')][_0xdf95('0x34')]));_0xe92de9[_0xdf95('0x33')]=_0xe92de9[_0xdf95('0x33')]['length']?_0xe92de9[_0xdf95('0x33')]:_0x43be6d[_0xdf95('0x2f')];if(!_0x839138[_0xdf95('0x30')][_0xdf95('0x35')](_0xdf95('0x36'))){_0xe92de9[_0xdf95('0x20')]=qs[_0xdf95('0x20')](_0x839138[_0xdf95('0x30')]['limit']);_0xe92de9[_0xdf95('0x37')]=qs[_0xdf95('0x37')](_0x839138['query'][_0xdf95('0x37')]);}_0xe92de9[_0xdf95('0x38')]=qs['sort'](_0x839138[_0xdf95('0x30')]['sort']);_0xe92de9[_0xdf95('0x39')]=qs['filters'](_['pick'](_0x839138[_0xdf95('0x30')],_0x43be6d[_0xdf95('0x3a')]),_0x29b831);if(_0x839138[_0xdf95('0x30')][_0xdf95('0x3b')]){_0xe92de9['where']=_[_0xdf95('0x3c')](_0xe92de9[_0xdf95('0x39')],{'$or':_['map'](_0x29b831,function(_0x5aa31c){if(_0x5aa31c[_0xdf95('0x2d')]!==_0xdf95('0x3d')){var _0x42254e={};_0x42254e[_0x5aa31c[_0xdf95('0x27')]]={'$like':'%'+_0x839138[_0xdf95('0x30')][_0xdf95('0x3b')]+'%'};return _0x42254e;}})});}_0xe92de9=_[_0xdf95('0x3c')]({},_0xe92de9,_0x839138['options']);var _0x17f9bc={'where':_0xe92de9['where']};return db[_0xdf95('0x2b')][_0xdf95('0x21')](_0x17f9bc)[_0xdf95('0x25')](function(_0x28e32f){_0x198aa9[_0xdf95('0x21')]=_0x28e32f;if(_0x839138[_0xdf95('0x30')][_0xdf95('0x3e')]){_0xe92de9[_0xdf95('0x3f')]=[{'all':!![]}];}return db[_0xdf95('0x2b')][_0xdf95('0x40')](_0xe92de9);})[_0xdf95('0x25')](function(_0x346c57){_0x198aa9[_0xdf95('0x41')]=_0x346c57;return _0x198aa9;})[_0xdf95('0x25')](respondWithFilteredResult(_0x56899e,_0xe92de9))[_0xdf95('0x42')](handleError(_0x56899e,null));};exports[_0xdf95('0x43')]=function(_0x5f8849,_0x307166){var _0x851418={'raw':!![],'where':{'id':_0x5f8849[_0xdf95('0x44')]['id']}},_0x3252f3={};_0x3252f3['model']=_[_0xdf95('0x31')](db['ChatInternalMessage'][_0xdf95('0x2c')]);_0x3252f3[_0xdf95('0x30')]=_[_0xdf95('0x31')](_0x5f8849[_0xdf95('0x30')]);_0x3252f3[_0xdf95('0x3a')]=_[_0xdf95('0x32')](_0x3252f3[_0xdf95('0x2f')],_0x3252f3['query']);_0x851418[_0xdf95('0x33')]=_[_0xdf95('0x32')](_0x3252f3[_0xdf95('0x2f')],qs[_0xdf95('0x34')](_0x5f8849[_0xdf95('0x30')][_0xdf95('0x34')]));_0x851418[_0xdf95('0x33')]=_0x851418[_0xdf95('0x33')][_0xdf95('0x45')]?_0x851418[_0xdf95('0x33')]:_0x3252f3[_0xdf95('0x2f')];if(_0x5f8849[_0xdf95('0x30')][_0xdf95('0x3e')]){_0x851418[_0xdf95('0x3f')]=[{'all':!![]}];}_0x851418=_[_0xdf95('0x3c')]({},_0x851418,_0x5f8849['options']);return db[_0xdf95('0x2b')][_0xdf95('0x46')](_0x851418)['then'](handleEntityNotFound(_0x307166,null))[_0xdf95('0x25')](respondWithResult(_0x307166,null))[_0xdf95('0x42')](handleError(_0x307166,null));};exports[_0xdf95('0x47')]=function(_0x537c1f,_0x15d57e){return db[_0xdf95('0x2b')][_0xdf95('0x47')](_0x537c1f[_0xdf95('0x48')],{})[_0xdf95('0x25')](respondWithResult(_0x15d57e,0xc9))['catch'](handleError(_0x15d57e,null));};exports[_0xdf95('0x49')]=function(_0x51ec3d,_0x406181){if(_0x51ec3d[_0xdf95('0x48')]['id']){delete _0x51ec3d[_0xdf95('0x48')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x51ec3d[_0xdf95('0x44')]['id']}})[_0xdf95('0x25')](handleEntityNotFound(_0x406181,null))['then'](saveUpdates(_0x51ec3d['body'],null))[_0xdf95('0x25')](respondWithResult(_0x406181,null))[_0xdf95('0x42')](handleError(_0x406181,null));};exports[_0xdf95('0x4a')]=function(_0x5a02f4,_0x4be564){return db[_0xdf95('0x2b')][_0xdf95('0x46')]({'where':{'id':_0x5a02f4[_0xdf95('0x44')]['id']}})[_0xdf95('0x25')](handleEntityNotFound(_0x4be564,null))[_0xdf95('0x25')](removeEntity(_0x4be564,null))[_0xdf95('0x42')](handleError(_0x4be564,null));};exports[_0xdf95('0x4b')]=function(_0x7cedf4,_0x529438){return db[_0xdf95('0x2b')]['describe']()[_0xdf95('0x25')](respondWithResult(_0x529438,null))['catch'](handleError(_0x529438,null));};function wrapUser(_0x4a6130){return function(_0x694b37){var _0x2343df=_0x4a6130[_0xdf95('0x4c')]({'plain':!![]});_0x2343df[_0xdf95('0x4d')]=[];if(_0x694b37){_0x2343df[_0xdf95('0x4e')]=_0x694b37[_0xdf95('0x4f')];_0x2343df[_0xdf95('0x50')]=_0x694b37;}else{_0x2343df['lastMessageAt']=moment(0x0)[_0xdf95('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x2343df[_0xdf95('0x50')]={};}return _0x2343df;};}exports['getUsers']=function(_0xd4644c,_0x5d284b,_0x202edc){var _0x4fbed6=[];return db[_0xdf95('0x52')][_0xdf95('0x40')]({'where':{'role':[_0xdf95('0x53'),_0xdf95('0x54'),_0xdf95('0x55')]},'attributes':['id',_0xdf95('0x56'),_0xdf95('0x27'),_0xdf95('0x57'),_0xdf95('0x58'),_0xdf95('0x59'),_0xdf95('0x5a'),'lastLoginAt','allowmessenger',_0xdf95('0x5b')],'order':qs[_0xdf95('0x5c')](_0xdf95('0x5d')),'include':[{'model':db[_0xdf95('0x5e')],'as':_0xdf95('0x5f'),'attributes':['id',_0xdf95('0x27'),_0xdf95('0x2d')],'through':{'attributes':[]}}]})[_0xdf95('0x25')](function(_0xafb799){if(_0xafb799){var _0x536f27=_0xd4644c[_0xdf95('0x55')]['get']({'plain':!![]});if(!_0x536f27)throw new Error(_0xdf95('0x60'));if(_0x536f27[_0xdf95('0x57')]===_0xdf95('0x55')){return db[_0xdf95('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x536f27['userProfileId']},'raw':!![]})[_0xdf95('0x25')](function(_0x22d7fd){if(_0x22d7fd){if(_0x22d7fd[_0xdf95('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x22d7fd['id']},'raw':!![]})['then'](function(_0x2f8984){var _0x186d6c=[];if(_[_0xdf95('0x63')](_0x2f8984)){_0x186d6c=_['filter'](_0xafb799,function(_0x1808a2){if(_0x1808a2[_0xdf95('0x57')]!=='agent'){return _0x1808a2;}});return _0x186d6c;}else{for(var _0x321fc5=0x0;_0x321fc5<_0xafb799[_0xdf95('0x45')];_0x321fc5++){var _0x461b59=_0xafb799[_0x321fc5];if(_0x461b59['role']==='agent'){var _0x4a489d=_[_0xdf95('0x46')](_0x2f8984,function(_0x17e854){return _0x17e854[_0xdf95('0x64')]===_0x461b59['id'];});if(_0x4a489d)_0x186d6c[_0xdf95('0x65')](_0x461b59);}else{_0x186d6c[_0xdf95('0x65')](_0x461b59);}}return _0x186d6c;}});}else{return _0xafb799;}}else{var _0x4ad655=_[_0xdf95('0x3b')](_0xafb799,function(_0x4852b6){if(_0x4852b6[_0xdf95('0x57')]!==_0xdf95('0x53')){return _0x4852b6;}});return _0x4ad655;}});}else{return _0xafb799;}}})['then'](function(_0x31bc30){var _0x444833=[];if(_0x31bc30){_0x4fbed6=_0x31bc30;for(var _0x2e0172=0x0;_0x2e0172<_0x31bc30[_0xdf95('0x45')];_0x2e0172+=0x1){_0x4fbed6[_0x2e0172]['messages']=[];_0x444833[_0xdf95('0x65')](db[_0xdf95('0x2b')][_0xdf95('0x46')]({'where':{'FromId':[_0xd4644c[_0xdf95('0x55')]['id'],_0x31bc30[_0x2e0172]['id']],'ToId':[_0xd4644c['user']['id'],_0x31bc30[_0x2e0172]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xdf95('0x66'),_0xdf95('0x67'),_0xdf95('0x68'),_0xdf95('0x48')],'order':qs['sort'](_0xdf95('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdf95('0x25')](wrapUser(_0x31bc30[_0x2e0172])));}return BPromise[_0xdf95('0x6a')](_0x444833);}return[];})[_0xdf95('0x25')](function(_0x424d14){return{'rows':_0x424d14,'count':_0x424d14[_0xdf95('0x45')]};})['then'](respondWithResult(_0x5d284b,null))['catch'](handleError(_0x5d284b,null));}; \ No newline at end of file +var _0x6a8e=['FromId','ToId','read','-createdAt','all','eml-format','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','findAll','agent','admin','user','role','userpic','lastLoginAt','allowmessenger','sort','-online','VoiceQueue','get','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push'];(function(_0x45fb76,_0x35fd5d){var _0x338556=function(_0x526a58){while(--_0x526a58){_0x45fb76['push'](_0x45fb76['shift']());}};_0x338556(++_0x35fd5d);}(_0x6a8e,0x1a1));var _0xe6a8=function(_0x5cfbd1,_0x2a5877){_0x5cfbd1=_0x5cfbd1-0x0;var _0x206ad5=_0x6a8e[_0x5cfbd1];return _0x206ad5;};'use strict';var emlformat=require(_0xe6a8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe6a8('0x1'));var rp=require(_0xe6a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe6a8('0x3'));var sox=require(_0xe6a8('0x4'));var csv=require(_0xe6a8('0x5'));var ejs=require(_0xe6a8('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6a8('0x7'));var squel=require(_0xe6a8('0x8'));var crypto=require(_0xe6a8('0x9'));var jsforce=require(_0xe6a8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe6a8('0x5'));var querystring=require(_0xe6a8('0xb'));var Papa=require(_0xe6a8('0xc'));var Redis=require('ioredis');var authService=require(_0xe6a8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe6a8('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6a8('0xf'))('api');var utils=require(_0xe6a8('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xe6a8('0x11'));var db=require(_0xe6a8('0x12'))['db'];config[_0xe6a8('0x13')]=_['defaults'](config[_0xe6a8('0x13')],{'host':_0xe6a8('0x14'),'port':0x18eb});var socket=require(_0xe6a8('0x15'))(new Redis(config[_0xe6a8('0x13')]));require(_0xe6a8('0x16'))[_0xe6a8('0x17')](socket);function respondWithStatusCode(_0x4c2fe7,_0x30afa6){_0x30afa6=_0x30afa6||0xcc;return function(_0x157eaf){if(_0x157eaf){return _0x4c2fe7[_0xe6a8('0x18')](_0x30afa6);}return _0x4c2fe7[_0xe6a8('0x19')](_0x30afa6)[_0xe6a8('0x1a')]();};}function respondWithResult(_0x4ab06d,_0x39030a){_0x39030a=_0x39030a||0xc8;return function(_0x45f7d4){if(_0x45f7d4){return _0x4ab06d[_0xe6a8('0x19')](_0x39030a)['json'](_0x45f7d4);}};}function respondWithFilteredResult(_0x4a2030,_0x17e0ff){return function(_0x443c26){if(_0x443c26){var _0x406f42=typeof _0x17e0ff[_0xe6a8('0x1b')]==='undefined'&&typeof _0x17e0ff[_0xe6a8('0x1c')]===_0xe6a8('0x1d');var _0x367e59=_0x443c26['count'];var _0x4ccd0e=_0x406f42?0x0:_0x17e0ff[_0xe6a8('0x1b')];var _0x79d474=_0x406f42?_0x443c26[_0xe6a8('0x1e')]:_0x17e0ff[_0xe6a8('0x1b')]+_0x17e0ff[_0xe6a8('0x1c')];var _0x512d0f;if(_0x79d474>=_0x367e59){_0x79d474=_0x367e59;_0x512d0f=0xc8;}else{_0x512d0f=0xce;}_0x4a2030[_0xe6a8('0x19')](_0x512d0f);return _0x4a2030[_0xe6a8('0x1f')](_0xe6a8('0x20'),_0x4ccd0e+'-'+_0x79d474+'/'+_0x367e59)[_0xe6a8('0x21')](_0x443c26);}return null;};}function patchUpdates(_0x147b9e){return function(_0xe37f85){try{jsonpatch[_0xe6a8('0x22')](_0xe37f85,_0x147b9e,!![]);}catch(_0x590c55){return BPromise['reject'](_0x590c55);}return _0xe37f85[_0xe6a8('0x23')]();};}function saveUpdates(_0x4b9c51,_0x98a96){return function(_0x37276d){if(_0x37276d){return _0x37276d[_0xe6a8('0x24')](_0x4b9c51)[_0xe6a8('0x25')](function(_0x5d1470){return _0x5d1470;});}return null;};}function removeEntity(_0x1fac20,_0x4d40df){return function(_0x43f83c){if(_0x43f83c){return _0x43f83c[_0xe6a8('0x26')]()['then'](function(){_0x1fac20[_0xe6a8('0x19')](0xcc)[_0xe6a8('0x1a')]();});}};}function handleEntityNotFound(_0x418e60,_0xe05dbe){return function(_0x51ef2f){if(!_0x51ef2f){_0x418e60[_0xe6a8('0x18')](0x194);}return _0x51ef2f;};}function handleError(_0x48c136,_0x9e0125){_0x9e0125=_0x9e0125||0x1f4;return function(_0x3e3943){logger[_0xe6a8('0x27')](_0x3e3943['stack']);if(_0x3e3943[_0xe6a8('0x28')]){delete _0x3e3943['name'];}_0x48c136[_0xe6a8('0x19')](_0x9e0125)[_0xe6a8('0x29')](_0x3e3943);};}exports['index']=function(_0x322033,_0x2ce04f){var _0x3fef68={},_0x52e895={},_0x50833e={'count':0x0,'rows':[]};var _0x45bbc6=_[_0xe6a8('0x2a')](db[_0xe6a8('0x2b')][_0xe6a8('0x2c')],function(_0x862237){return{'name':_0x862237[_0xe6a8('0x2d')],'type':_0x862237[_0xe6a8('0x2e')][_0xe6a8('0x2f')]};});_0x52e895['model']=_[_0xe6a8('0x2a')](_0x45bbc6,_0xe6a8('0x28'));_0x52e895[_0xe6a8('0x30')]=_[_0xe6a8('0x31')](_0x322033[_0xe6a8('0x30')]);_0x52e895[_0xe6a8('0x32')]=_[_0xe6a8('0x33')](_0x52e895[_0xe6a8('0x34')],_0x52e895[_0xe6a8('0x30')]);_0x3fef68['attributes']=_['intersection'](_0x52e895[_0xe6a8('0x34')],qs[_0xe6a8('0x35')](_0x322033[_0xe6a8('0x30')]['fields']));_0x3fef68[_0xe6a8('0x36')]=_0x3fef68[_0xe6a8('0x36')]['length']?_0x3fef68[_0xe6a8('0x36')]:_0x52e895[_0xe6a8('0x34')];if(!_0x322033[_0xe6a8('0x30')][_0xe6a8('0x37')]('nolimit')){_0x3fef68['limit']=qs[_0xe6a8('0x1c')](_0x322033[_0xe6a8('0x30')][_0xe6a8('0x1c')]);_0x3fef68[_0xe6a8('0x1b')]=qs['offset'](_0x322033[_0xe6a8('0x30')][_0xe6a8('0x1b')]);}_0x3fef68[_0xe6a8('0x38')]=qs['sort'](_0x322033[_0xe6a8('0x30')]['sort']);_0x3fef68['where']=qs['filters'](_['pick'](_0x322033[_0xe6a8('0x30')],_0x52e895['filters']),_0x45bbc6);if(_0x322033['query'][_0xe6a8('0x39')]){_0x3fef68[_0xe6a8('0x3a')]=_[_0xe6a8('0x3b')](_0x3fef68[_0xe6a8('0x3a')],{'$or':_[_0xe6a8('0x2a')](_0x45bbc6,function(_0x237beb){if(_0x237beb[_0xe6a8('0x2e')]!==_0xe6a8('0x3c')){var _0x54e6ac={};_0x54e6ac[_0x237beb[_0xe6a8('0x28')]]={'$like':'%'+_0x322033['query'][_0xe6a8('0x39')]+'%'};return _0x54e6ac;}})});}_0x3fef68=_[_0xe6a8('0x3b')]({},_0x3fef68,_0x322033[_0xe6a8('0x3d')]);var _0x428ec5={'where':_0x3fef68[_0xe6a8('0x3a')]};return db['ChatInternalMessage'][_0xe6a8('0x1e')](_0x428ec5)['then'](function(_0x33cfbb){_0x50833e[_0xe6a8('0x1e')]=_0x33cfbb;if(_0x322033['query']['includeAll']){_0x3fef68[_0xe6a8('0x3e')]=[{'all':!![]}];}return db[_0xe6a8('0x2b')]['findAll'](_0x3fef68);})[_0xe6a8('0x25')](function(_0x3785b0){_0x50833e[_0xe6a8('0x3f')]=_0x3785b0;return _0x50833e;})[_0xe6a8('0x25')](respondWithFilteredResult(_0x2ce04f,_0x3fef68))[_0xe6a8('0x40')](handleError(_0x2ce04f,null));};exports[_0xe6a8('0x41')]=function(_0x20c49f,_0x464eef){var _0x33c850={'raw':!![],'where':{'id':_0x20c49f[_0xe6a8('0x42')]['id']}},_0x4ec7d2={};_0x4ec7d2[_0xe6a8('0x34')]=_[_0xe6a8('0x31')](db[_0xe6a8('0x2b')][_0xe6a8('0x2c')]);_0x4ec7d2['query']=_[_0xe6a8('0x31')](_0x20c49f['query']);_0x4ec7d2['filters']=_['intersection'](_0x4ec7d2['model'],_0x4ec7d2[_0xe6a8('0x30')]);_0x33c850[_0xe6a8('0x36')]=_['intersection'](_0x4ec7d2[_0xe6a8('0x34')],qs[_0xe6a8('0x35')](_0x20c49f[_0xe6a8('0x30')][_0xe6a8('0x35')]));_0x33c850[_0xe6a8('0x36')]=_0x33c850[_0xe6a8('0x36')][_0xe6a8('0x43')]?_0x33c850[_0xe6a8('0x36')]:_0x4ec7d2['model'];if(_0x20c49f[_0xe6a8('0x30')][_0xe6a8('0x44')]){_0x33c850[_0xe6a8('0x3e')]=[{'all':!![]}];}_0x33c850=_[_0xe6a8('0x3b')]({},_0x33c850,_0x20c49f['options']);return db[_0xe6a8('0x2b')][_0xe6a8('0x45')](_0x33c850)['then'](handleEntityNotFound(_0x464eef,null))[_0xe6a8('0x25')](respondWithResult(_0x464eef,null))['catch'](handleError(_0x464eef,null));};exports[_0xe6a8('0x46')]=function(_0x48e1e3,_0x1a20fc){return db['ChatInternalMessage'][_0xe6a8('0x46')](_0x48e1e3['body'],{})[_0xe6a8('0x25')](respondWithResult(_0x1a20fc,0xc9))['catch'](handleError(_0x1a20fc,null));};exports[_0xe6a8('0x24')]=function(_0x4ae598,_0x4cf777){if(_0x4ae598[_0xe6a8('0x47')]['id']){delete _0x4ae598[_0xe6a8('0x47')]['id'];}return db[_0xe6a8('0x2b')][_0xe6a8('0x45')]({'where':{'id':_0x4ae598['params']['id']}})[_0xe6a8('0x25')](handleEntityNotFound(_0x4cf777,null))[_0xe6a8('0x25')](saveUpdates(_0x4ae598['body'],null))[_0xe6a8('0x25')](respondWithResult(_0x4cf777,null))[_0xe6a8('0x40')](handleError(_0x4cf777,null));};exports[_0xe6a8('0x26')]=function(_0x3597ce,_0x2449c6){return db[_0xe6a8('0x2b')][_0xe6a8('0x45')]({'where':{'id':_0x3597ce[_0xe6a8('0x42')]['id']}})[_0xe6a8('0x25')](handleEntityNotFound(_0x2449c6,null))[_0xe6a8('0x25')](removeEntity(_0x2449c6,null))[_0xe6a8('0x40')](handleError(_0x2449c6,null));};exports[_0xe6a8('0x48')]=function(_0x1d1497,_0x4d2fa5){return db['ChatInternalMessage']['describe']()[_0xe6a8('0x25')](respondWithResult(_0x4d2fa5,null))['catch'](handleError(_0x4d2fa5,null));};function wrapUser(_0x1351e4){return function(_0x4e629c){var _0x25bff7=_0x1351e4['get']({'plain':!![]});_0x25bff7[_0xe6a8('0x49')]=[];if(_0x4e629c){_0x25bff7[_0xe6a8('0x4a')]=_0x4e629c[_0xe6a8('0x4b')];_0x25bff7['lastMessage']=_0x4e629c;}else{_0x25bff7[_0xe6a8('0x4a')]=moment(0x0)[_0xe6a8('0x4c')](_0xe6a8('0x4d'));_0x25bff7['lastMessage']={};}return _0x25bff7;};}exports['getUsers']=function(_0xf03584,_0x44b7d5,_0x2dd299){var _0xb0e361=[];return db['User'][_0xe6a8('0x4e')]({'where':{'role':[_0xe6a8('0x4f'),_0xe6a8('0x50'),_0xe6a8('0x51')]},'attributes':['id','fullname',_0xe6a8('0x28'),_0xe6a8('0x52'),_0xe6a8('0x53'),'internal','online',_0xe6a8('0x54'),_0xe6a8('0x55'),'showWebBar'],'order':qs[_0xe6a8('0x56')](_0xe6a8('0x57')),'include':[{'model':db[_0xe6a8('0x58')],'as':'VoiceQueues','attributes':['id',_0xe6a8('0x28'),_0xe6a8('0x2e')],'through':{'attributes':[]}}]})[_0xe6a8('0x25')](function(_0x3dc650){if(_0x3dc650){var _0x353dae=_0xf03584[_0xe6a8('0x51')][_0xe6a8('0x59')]({'plain':!![]});if(!_0x353dae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x353dae[_0xe6a8('0x52')]===_0xe6a8('0x51')){return db[_0xe6a8('0x5a')]['find']({'where':{'name':_0xe6a8('0x5b'),'userProfileId':_0x353dae[_0xe6a8('0x5c')]},'raw':!![]})['then'](function(_0x1e9928){if(_0x1e9928){if(_0x1e9928[_0xe6a8('0x5d')]===0x0){return db[_0xe6a8('0x5e')][_0xe6a8('0x4e')]({'where':{'sectionId':_0x1e9928['id']},'raw':!![]})['then'](function(_0x5e927a){var _0x4462e6=[];if(_[_0xe6a8('0x5f')](_0x5e927a)){_0x4462e6=_['filter'](_0x3dc650,function(_0x36596f){if(_0x36596f[_0xe6a8('0x52')]!==_0xe6a8('0x4f')){return _0x36596f;}});return _0x4462e6;}else{for(var _0x55ad07=0x0;_0x55ad07<_0x3dc650[_0xe6a8('0x43')];_0x55ad07++){var _0x175d22=_0x3dc650[_0x55ad07];if(_0x175d22[_0xe6a8('0x52')]===_0xe6a8('0x4f')){var _0x33a9a0=_[_0xe6a8('0x45')](_0x5e927a,function(_0x53eada){return _0x53eada[_0xe6a8('0x60')]===_0x175d22['id'];});if(_0x33a9a0)_0x4462e6[_0xe6a8('0x61')](_0x175d22);}else{_0x4462e6[_0xe6a8('0x61')](_0x175d22);}}return _0x4462e6;}});}else{return _0x3dc650;}}else{var _0x1461e2=_['filter'](_0x3dc650,function(_0x5610bb){if(_0x5610bb[_0xe6a8('0x52')]!==_0xe6a8('0x4f')){return _0x5610bb;}});return _0x1461e2;}});}else{return _0x3dc650;}}})[_0xe6a8('0x25')](function(_0x4bb3c7){var _0x27d4db=[];if(_0x4bb3c7){_0xb0e361=_0x4bb3c7;for(var _0x54c3e7=0x0;_0x54c3e7<_0x4bb3c7[_0xe6a8('0x43')];_0x54c3e7+=0x1){_0xb0e361[_0x54c3e7][_0xe6a8('0x49')]=[];_0x27d4db['push'](db[_0xe6a8('0x2b')][_0xe6a8('0x45')]({'where':{'FromId':[_0xf03584[_0xe6a8('0x51')]['id'],_0x4bb3c7[_0x54c3e7]['id']],'ToId':[_0xf03584[_0xe6a8('0x51')]['id'],_0x4bb3c7[_0x54c3e7]['id']],'ChatGroupId':null},'attributes':['id',_0xe6a8('0x4b'),_0xe6a8('0x62'),_0xe6a8('0x63'),_0xe6a8('0x64'),_0xe6a8('0x47')],'order':qs[_0xe6a8('0x56')](_0xe6a8('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe6a8('0x25')](wrapUser(_0x4bb3c7[_0x54c3e7])));}return BPromise[_0xe6a8('0x66')](_0x27d4db);}return[];})[_0xe6a8('0x25')](function(_0x1f70b6){return{'rows':_0x1f70b6,'count':_0x1f70b6[_0xe6a8('0x43')]};})[_0xe6a8('0x25')](respondWithResult(_0x44b7d5,null))[_0xe6a8('0x40')](handleError(_0x44b7d5,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ff6f50e..b23a7b2 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 _0x53d5=['setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x2dafaf,_0x42711c){var _0x5e9b37=function(_0x4c6ae7){while(--_0x4c6ae7){_0x2dafaf['push'](_0x2dafaf['shift']());}};_0x5e9b37(++_0x42711c);}(_0x53d5,0x68));var _0x553d=function(_0x16ffe2,_0x2f73ed){_0x16ffe2=_0x16ffe2-0x0;var _0x4193e5=_0x53d5[_0x16ffe2];return _0x4193e5;};'use strict';var EventEmitter=require(_0x553d('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x553d('0x1')](0x0);var events={'afterCreate':_0x553d('0x2'),'afterUpdate':_0x553d('0x3'),'afterDestroy':_0x553d('0x4')};function emitEvent(_0x124dc2){return function(_0x1da3ad,_0x38c3b5,_0x3b21a2){ChatInternalMessageEvents[_0x553d('0x5')](_0x124dc2+':'+_0x1da3ad['id'],_0x1da3ad);ChatInternalMessageEvents[_0x553d('0x5')](_0x124dc2,_0x1da3ad);_0x3b21a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x553d('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x16a2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x5d6280,_0x3f72ab){var _0x77b738=function(_0x1b8208){while(--_0x1b8208){_0x5d6280['push'](_0x5d6280['shift']());}};_0x77b738(++_0x3f72ab);}(_0x16a2,0xaa));var _0x216a=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x16a2[_0x4c260a];return _0x17bbdd;};'use strict';var EventEmitter=require(_0x216a('0x0'));var ChatInternalMessage=require(_0x216a('0x1'))['db'][_0x216a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x216a('0x3')](0x0);var events={'afterCreate':_0x216a('0x4'),'afterUpdate':_0x216a('0x5'),'afterDestroy':_0x216a('0x6')};function emitEvent(_0x5e5559){return function(_0x467c54,_0x5d4fb2,_0x337ac9){ChatInternalMessageEvents[_0x216a('0x7')](_0x5e5559+':'+_0x467c54['id'],_0x467c54);ChatInternalMessageEvents[_0x216a('0x7')](_0x5e5559,_0x467c54);_0x337ac9(null);};}for(var e in events){if(events[_0x216a('0x8')](e)){var event=events[e];ChatInternalMessage[_0x216a('0x9')](e,emitEvent(event));}}module[_0x216a('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 89e5874..0304334 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 _0xa72b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x569756,_0x29a598){var _0x24f0f6=function(_0x458a1f){while(--_0x458a1f){_0x569756['push'](_0x569756['shift']());}};_0x24f0f6(++_0x29a598);}(_0xa72b,0x1d3));var _0xba72=function(_0x30c1dd,_0x23a13c){_0x30c1dd=_0x30c1dd-0x0;var _0x57dfaf=_0xa72b[_0x30c1dd];return _0x57dfaf;};'use strict';var _=require(_0xba72('0x0'));var util=require(_0xba72('0x1'));var logger=require(_0xba72('0x2'))(_0xba72('0x3'));var moment=require(_0xba72('0x4'));var BPromise=require(_0xba72('0x5'));var rp=require(_0xba72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xba72('0x7'));var attributes=require(_0xba72('0x8'));module[_0xba72('0x9')]=function(_0xfd8f78,_0x3e3835){return _0xfd8f78[_0xba72('0xa')](_0xba72('0xb'),attributes,{'tableName':_0xba72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba72('0xd'),'collate':_0xba72('0xe')});}; \ No newline at end of file +var _0x83fb=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util'];(function(_0x182c4e,_0x5586da){var _0x4fd822=function(_0x31ec55){while(--_0x31ec55){_0x182c4e['push'](_0x182c4e['shift']());}};_0x4fd822(++_0x5586da);}(_0x83fb,0x85));var _0xb83f=function(_0x440af5,_0x558acf){_0x440af5=_0x440af5-0x0;var _0x2addc8=_0x83fb[_0x440af5];return _0x2addc8;};'use strict';var _=require(_0xb83f('0x0'));var util=require(_0xb83f('0x1'));var logger=require(_0xb83f('0x2'))(_0xb83f('0x3'));var moment=require(_0xb83f('0x4'));var BPromise=require(_0xb83f('0x5'));var rp=require(_0xb83f('0x6'));var fs=require('fs');var path=require(_0xb83f('0x7'));var rimraf=require(_0xb83f('0x8'));var config=require(_0xb83f('0x9'));var attributes=require(_0xb83f('0xa'));module[_0xb83f('0xb')]=function(_0x4f12e9,_0x5de344){return _0x4f12e9['define'](_0xb83f('0xc'),attributes,{'tableName':_0xb83f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb83f('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index d18d7e1..2942c21 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 _0xd331=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','./chatInternalMessage.socket','register','request','then'];(function(_0x56a404,_0x56e54e){var _0x2740f3=function(_0x513c2e){while(--_0x513c2e){_0x56a404['push'](_0x56a404['shift']());}};_0x2740f3(++_0x56e54e);}(_0xd331,0xed));var _0x1d33=function(_0x4fbf58,_0x388959){_0x4fbf58=_0x4fbf58-0x0;var _0x2339c5=_0xd331[_0x4fbf58];return _0x2339c5;};'use strict';var _=require(_0x1d33('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1d33('0x1'));var rs=require(_0x1d33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d33('0x3'))['db'];var utils=require(_0x1d33('0x4'));var logger=require(_0x1d33('0x5'))(_0x1d33('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d33('0x7'));var client=jayson[_0x1d33('0x8')]['http']({'port':0x232a});config['redis']=_[_0x1d33('0x9')](config[_0x1d33('0xa')],{'host':_0x1d33('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d33('0xa')]));require(_0x1d33('0xc'))[_0x1d33('0xd')](socket);function respondWithRpcPromise(_0x2b5662,_0x547c0b,_0x65091e){return new BPromise(function(_0x328b93,_0x4ee8e7){return client[_0x1d33('0xe')](_0x2b5662,_0x65091e)[_0x1d33('0xf')](function(_0x40974f){logger['info'](_0x1d33('0x10'),_0x547c0b,_0x1d33('0x11'));logger[_0x1d33('0x12')](_0x1d33('0x13'),_0x547c0b,_0x1d33('0x11'),JSON['stringify'](_0x40974f));if(_0x40974f[_0x1d33('0x14')]){if(_0x40974f['error']['code']===0x1f4){logger[_0x1d33('0x14')](_0x1d33('0x10'),_0x547c0b,_0x40974f[_0x1d33('0x14')][_0x1d33('0x15')]);return _0x4ee8e7(_0x40974f[_0x1d33('0x14')][_0x1d33('0x15')]);}logger[_0x1d33('0x14')](_0x1d33('0x10'),_0x547c0b,_0x40974f[_0x1d33('0x14')][_0x1d33('0x15')]);return _0x328b93(_0x40974f[_0x1d33('0x14')][_0x1d33('0x15')]);}else{logger['info'](_0x1d33('0x10'),_0x547c0b,_0x1d33('0x11'));_0x328b93(_0x40974f[_0x1d33('0x16')][_0x1d33('0x15')]);}})['catch'](function(_0x2c910f){logger['error'](_0x1d33('0x10'),_0x547c0b,_0x2c910f);_0x4ee8e7(_0x2c910f);});});} \ No newline at end of file +var _0x1360=['request\x20sent','debug','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1360,0xd6));var _0x0136=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x1360[_0x3747ae];return _0x339035;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0136('0x0'));var BPromise=require(_0x0136('0x1'));var rs=require(_0x0136('0x2'));var fs=require('fs');var Redis=require(_0x0136('0x3'));var db=require(_0x0136('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0136('0x5'))(_0x0136('0x6'));var config=require(_0x0136('0x7'));var jayson=require(_0x0136('0x8'));var client=jayson[_0x0136('0x9')][_0x0136('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0136('0xb')],{'host':_0x0136('0xc'),'port':0x18eb});var socket=require(_0x0136('0xd'))(new Redis(config[_0x0136('0xb')]));require(_0x0136('0xe'))[_0x0136('0xf')](socket);function respondWithRpcPromise(_0x1a6998,_0x16c9ee,_0x23bb49){return new BPromise(function(_0x1453f3,_0x5cdd79){return client[_0x0136('0x10')](_0x1a6998,_0x23bb49)[_0x0136('0x11')](function(_0x1f89fb){logger[_0x0136('0x12')](_0x0136('0x13'),_0x16c9ee,_0x0136('0x14'));logger[_0x0136('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x16c9ee,'request\x20sent',JSON['stringify'](_0x1f89fb));if(_0x1f89fb[_0x0136('0x16')]){if(_0x1f89fb[_0x0136('0x16')][_0x0136('0x17')]===0x1f4){logger[_0x0136('0x16')](_0x0136('0x13'),_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x5cdd79(_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);}logger[_0x0136('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x16c9ee,_0x1f89fb[_0x0136('0x16')][_0x0136('0x18')]);return _0x1453f3(_0x1f89fb['error'][_0x0136('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x16c9ee,_0x0136('0x14'));_0x1453f3(_0x1f89fb[_0x0136('0x19')]['message']);}})['catch'](function(_0x3d7595){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x16c9ee,_0x3d7595);_0x5cdd79(_0x3d7595);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index b0dbd66..872676a 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 _0x83c4=['removeListener','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x1353bc,_0x432b07){var _0x3097a6=function(_0x1ab3c2){while(--_0x1ab3c2){_0x1353bc['push'](_0x1353bc['shift']());}};_0x3097a6(++_0x432b07);}(_0x83c4,0x13a));var _0x483c=function(_0x53f92a,_0x3b7682){_0x53f92a=_0x53f92a-0x0;var _0x1f0769=_0x83c4[_0x53f92a];return _0x1f0769;};'use strict';var ChatInternalMessageEvents=require(_0x483c('0x0'));var events=[_0x483c('0x1'),_0x483c('0x2'),_0x483c('0x3')];function createListener(_0xde7741,_0x551e84){return function(_0x2d59a7){_0x551e84['emit'](_0xde7741,_0x2d59a7);};}function removeListener(_0x1f68f3,_0x41c76d){return function(){ChatInternalMessageEvents[_0x483c('0x4')](_0x1f68f3,_0x41c76d);};}exports['register']=function(_0x4bb775){for(var _0x148ace=0x0,_0x663b77=events['length'];_0x148ace<_0x663b77;_0x148ace++){var _0x3c216d=events[_0x148ace];var _0x370523=createListener(_0x483c('0x5')+_0x3c216d,_0x4bb775);ChatInternalMessageEvents['on'](_0x3c216d,_0x370523);}}; \ No newline at end of file +var _0xfbfe=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit'];(function(_0x8a50fd,_0x6d3613){var _0x5b565a=function(_0x2d6893){while(--_0x2d6893){_0x8a50fd['push'](_0x8a50fd['shift']());}};_0x5b565a(++_0x6d3613);}(_0xfbfe,0xcc));var _0xefbf=function(_0x59c1e9,_0x5cf14f){_0x59c1e9=_0x59c1e9-0x0;var _0x58d216=_0xfbfe[_0x59c1e9];return _0x58d216;};'use strict';var ChatInternalMessageEvents=require(_0xefbf('0x0'));var events=['save',_0xefbf('0x1'),_0xefbf('0x2')];function createListener(_0x35939f,_0x258d8e){return function(_0x334298){_0x258d8e[_0xefbf('0x3')](_0x35939f,_0x334298);};}function removeListener(_0xc09d65,_0x1064bd){return function(){ChatInternalMessageEvents[_0xefbf('0x4')](_0xc09d65,_0x1064bd);};}exports[_0xefbf('0x5')]=function(_0x240741){for(var _0x445736=0x0,_0x3a0245=events[_0xefbf('0x6')];_0x445736<_0x3a0245;_0x445736++){var _0x317dbc=events[_0x445736];var _0x54ac84=createListener(_0xefbf('0x7')+_0x317dbc,_0x240741);ChatInternalMessageEvents['on'](_0x317dbc,_0x54ac84);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index b2fcdd8..2c04aef 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 _0x249a=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/users','isAuthenticated','/:id','post','create','put','update','delete'];(function(_0x41d948,_0x5cf7cf){var _0x454e58=function(_0x5e5464){while(--_0x5e5464){_0x41d948['push'](_0x41d948['shift']());}};_0x454e58(++_0x5cf7cf);}(_0x249a,0x105));var _0xa249=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x249a[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0xa249('0x0'));var util=require('util');var path=require(_0xa249('0x1'));var timeout=require(_0xa249('0x2'));var express=require(_0xa249('0x3'));var router=express[_0xa249('0x4')]();var fs_extra=require(_0xa249('0x5'));var auth=require(_0xa249('0x6'));var interaction=require(_0xa249('0x7'));var config=require(_0xa249('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xa249('0x9')]('/',auth['isAuthenticated'](),controller[_0xa249('0xa')]);router[_0xa249('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa249('0x9')](_0xa249('0xb'),auth[_0xa249('0xc')](),controller['getUsers']);router['get'](_0xa249('0xd'),auth[_0xa249('0xc')](),controller['show']);router[_0xa249('0xe')]('/',auth[_0xa249('0xc')](),controller[_0xa249('0xf')]);router[_0xa249('0x10')](_0xa249('0xd'),controller[_0xa249('0x11')]);router[_0xa249('0x12')]('/:id',auth[_0xa249('0xc')](),controller['destroy']);module[_0xa249('0x13')]=router; \ No newline at end of file +var _0x7d6b=['exports','multer','express','Router','fs-extra','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','destroy'];(function(_0xff9b1d,_0x2b5114){var _0x972396=function(_0x2b43e1){while(--_0x2b43e1){_0xff9b1d['push'](_0xff9b1d['shift']());}};_0x972396(++_0x2b5114);}(_0x7d6b,0xfd));var _0xb7d6=function(_0xc757ef,_0x59c05c){_0xc757ef=_0xc757ef-0x0;var _0x552324=_0x7d6b[_0xc757ef];return _0x552324;};'use strict';var multer=require(_0xb7d6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb7d6('0x1'));var router=express[_0xb7d6('0x2')]();var fs_extra=require(_0xb7d6('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb7d6('0x4'));var controller=require(_0xb7d6('0x5'));router[_0xb7d6('0x6')]('/',auth[_0xb7d6('0x7')](),controller[_0xb7d6('0x8')]);router['get'](_0xb7d6('0x9'),auth[_0xb7d6('0x7')](),controller[_0xb7d6('0xa')]);router[_0xb7d6('0x6')]('/users',auth[_0xb7d6('0x7')](),controller['getUsers']);router['get']('/:id',auth[_0xb7d6('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb7d6('0xb')]);router[_0xb7d6('0xc')](_0xb7d6('0xd'),controller[_0xb7d6('0xe')]);router[_0xb7d6('0xf')](_0xb7d6('0xd'),auth['isAuthenticated'](),controller[_0xb7d6('0x10')]);module[_0xb7d6('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index f7b1fb8..87f2b06 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 _0x5eb1=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x5eb1,0x7c));var _0x15eb=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0x5eb1[_0x91384];return _0x44daa0;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'body':{'type':Sequelize[_0x15eb('0x1')](_0x15eb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x15eb('0x4')]('in','out'),'defaultValue':_0x15eb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x15eb('0x6')]},'providerName':{'type':Sequelize[_0x15eb('0x7')]},'providerResponse':{'type':Sequelize[_0x15eb('0x1')]}}; \ No newline at end of file +var _0xb6fa=['STRING','TEXT','sequelize','medium','ENUM','out','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xb6fa[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0xab6f('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xab6f('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xab6f('0x2')]('in',_0xab6f('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xab6f('0x4')]},'providerName':{'type':Sequelize[_0xab6f('0x5')]},'providerResponse':{'type':Sequelize[_0xab6f('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1218ede..fefded7 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 _0xddbc=['show','params','keys','intersection','length','merge','create','body','find','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','email','internal','SIP/%s','channel','motionChannel','EventManager','acceptmessage','interaction','formData','chat-interactions','ChatInteraction','ChatInteractionId','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','User','fullname','interface','event','parse','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','Content-Range','apply','reject','save','update','destroy','name','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','filters','attributes','fields','nolimit','limit','order','sort','where','pick','filter','options','count','includeAll','include','findAll','rows'];(function(_0x32bb57,_0x210fd4){var _0x588ce6=function(_0x464526){while(--_0x464526){_0x32bb57['push'](_0x32bb57['shift']());}};_0x588ce6(++_0x210fd4);}(_0xddbc,0x1b4));var _0xcddb=function(_0x46373b,_0x4a0e5d){_0x46373b=_0x46373b-0x0;var _0x123824=_0xddbc[_0x46373b];return _0x123824;};'use strict';var emlformat=require(_0xcddb('0x0'));var rimraf=require(_0xcddb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcddb('0x2'));var rp=require(_0xcddb('0x3'));var moment=require('moment');var BPromise=require(_0xcddb('0x4'));var Mustache=require('mustache');var util=require(_0xcddb('0x5'));var path=require('path');var sox=require(_0xcddb('0x6'));var csv=require(_0xcddb('0x7'));var ejs=require(_0xcddb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcddb('0x9'));var squel=require(_0xcddb('0xa'));var crypto=require('crypto');var jsforce=require(_0xcddb('0xb'));var deskjs=require(_0xcddb('0xc'));var toCsv=require(_0xcddb('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcddb('0xd'));var authService=require(_0xcddb('0xe'));var qs=require(_0xcddb('0xf'));var as=require(_0xcddb('0x10'));var hardwareService=require(_0xcddb('0x11'));var logger=require(_0xcddb('0x12'))(_0xcddb('0x13'));var utils=require(_0xcddb('0x14'));var config=require(_0xcddb('0x15'));var licenseUtil=require(_0xcddb('0x16'));var db=require(_0xcddb('0x17'))['db'];config['redis']=_[_0xcddb('0x18')](config['redis'],{'host':_0xcddb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcddb('0x1a'))[_0xcddb('0x1b')](socket);var jayson=require(_0xcddb('0x1c'));var client=jayson[_0xcddb('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xcddb('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x99410d,_0x5d82c3,_0xb1816f,_0x2736b0){return new BPromise(function(_0x7232e8,_0x5bd998){var _0x3285cc=_0x2736b0||client;return _0x3285cc[_0xcddb('0x1e')](_0x99410d,_0xb1816f)[_0xcddb('0x1f')](function(_0x2f4a9d){logger[_0xcddb('0x20')](_0xcddb('0x21'),_0x5d82c3,_0xcddb('0x22'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5d82c3,'request\x20sent',JSON[_0xcddb('0x23')](_0x2f4a9d));if(_0x2f4a9d[_0xcddb('0x24')]){if(_0x2f4a9d['error'][_0xcddb('0x25')]===0x1f4){logger[_0xcddb('0x24')](_0xcddb('0x21'),_0x5d82c3,_0x2f4a9d[_0xcddb('0x24')][_0xcddb('0x26')]);return _0x5bd998(_0x2f4a9d[_0xcddb('0x24')][_0xcddb('0x26')]);}logger[_0xcddb('0x24')](_0xcddb('0x21'),_0x5d82c3,_0x2f4a9d[_0xcddb('0x24')][_0xcddb('0x26')]);return _0x7232e8(_0x2f4a9d[_0xcddb('0x24')][_0xcddb('0x26')]);}else{logger[_0xcddb('0x20')](_0xcddb('0x21'),_0x5d82c3,_0xcddb('0x22'));_0x7232e8(_0x2f4a9d['result'][_0xcddb('0x26')]);}})[_0xcddb('0x27')](function(_0x52e286){logger[_0xcddb('0x24')](_0xcddb('0x21'),_0x5d82c3,_0x52e286);_0x5bd998(_0x52e286);});});}function respondWithStatusCode(_0x5620b3,_0xf0ffce){_0xf0ffce=_0xf0ffce||0xcc;return function(_0x677a67){if(_0x677a67){return _0x5620b3[_0xcddb('0x28')](_0xf0ffce);}return _0x5620b3['status'](_0xf0ffce)['end']();};}function respondWithResult(_0x4ca972,_0x17b23f){_0x17b23f=_0x17b23f||0xc8;return function(_0x41643e){if(_0x41643e){return _0x4ca972[_0xcddb('0x29')](_0x17b23f)[_0xcddb('0x2a')](_0x41643e);}};}function respondWithFilteredResult(_0x19a805,_0x54324b){return function(_0x35a015){if(_0x35a015){var _0x119359=typeof _0x54324b[_0xcddb('0x2b')]===_0xcddb('0x2c')&&typeof _0x54324b['limit']===_0xcddb('0x2c');var _0x51fe51=_0x35a015['count'];var _0x5442cf=_0x119359?0x0:_0x54324b[_0xcddb('0x2b')];var _0x23f794=_0x119359?_0x35a015['count']:_0x54324b['offset']+_0x54324b['limit'];var _0x43bde6;if(_0x23f794>=_0x51fe51){_0x23f794=_0x51fe51;_0x43bde6=0xc8;}else{_0x43bde6=0xce;}_0x19a805['status'](_0x43bde6);return _0x19a805['set'](_0xcddb('0x2d'),_0x5442cf+'-'+_0x23f794+'/'+_0x51fe51)['json'](_0x35a015);}return null;};}function patchUpdates(_0x30dfde){return function(_0x4fa2c2){try{jsonpatch[_0xcddb('0x2e')](_0x4fa2c2,_0x30dfde,!![]);}catch(_0x20f452){return BPromise[_0xcddb('0x2f')](_0x20f452);}return _0x4fa2c2[_0xcddb('0x30')]();};}function saveUpdates(_0x4145fa,_0x2d44ba){return function(_0x1ee073){if(_0x1ee073){return _0x1ee073[_0xcddb('0x31')](_0x4145fa)['then'](function(_0x11a659){return _0x11a659;});}return null;};}function removeEntity(_0xf331f1,_0x1c3d16){return function(_0xf58874){if(_0xf58874){return _0xf58874[_0xcddb('0x32')]()['then'](function(){_0xf331f1[_0xcddb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x466c3d,_0x299550){return function(_0x2702e4){if(!_0x2702e4){_0x466c3d['sendStatus'](0x194);}return _0x2702e4;};}function handleError(_0x19a1bf,_0x514a81){_0x514a81=_0x514a81||0x1f4;return function(_0x4f49b5){logger['error'](_0x4f49b5['stack']);if(_0x4f49b5[_0xcddb('0x33')]){delete _0x4f49b5[_0xcddb('0x33')];}_0x19a1bf[_0xcddb('0x29')](_0x514a81)['send'](_0x4f49b5);};}exports[_0xcddb('0x34')]=function(_0x557d92,_0x236950){var _0x115088={},_0x5468d3={},_0x563129={'count':0x0,'rows':[]};var _0x2e6305=_[_0xcddb('0x35')](db[_0xcddb('0x36')][_0xcddb('0x37')],function(_0x17c3ff){return{'name':_0x17c3ff[_0xcddb('0x38')],'type':_0x17c3ff[_0xcddb('0x39')]['key']};});_0x5468d3[_0xcddb('0x3a')]=_[_0xcddb('0x35')](_0x2e6305,'name');_0x5468d3[_0xcddb('0x3b')]=_['keys'](_0x557d92[_0xcddb('0x3b')]);_0x5468d3[_0xcddb('0x3c')]=_['intersection'](_0x5468d3[_0xcddb('0x3a')],_0x5468d3[_0xcddb('0x3b')]);_0x115088[_0xcddb('0x3d')]=_['intersection'](_0x5468d3[_0xcddb('0x3a')],qs['fields'](_0x557d92[_0xcddb('0x3b')][_0xcddb('0x3e')]));_0x115088[_0xcddb('0x3d')]=_0x115088['attributes']['length']?_0x115088[_0xcddb('0x3d')]:_0x5468d3['model'];if(!_0x557d92[_0xcddb('0x3b')]['hasOwnProperty'](_0xcddb('0x3f'))){_0x115088['limit']=qs['limit'](_0x557d92['query'][_0xcddb('0x40')]);_0x115088[_0xcddb('0x2b')]=qs['offset'](_0x557d92[_0xcddb('0x3b')][_0xcddb('0x2b')]);}_0x115088[_0xcddb('0x41')]=qs[_0xcddb('0x42')](_0x557d92[_0xcddb('0x3b')][_0xcddb('0x42')]);_0x115088[_0xcddb('0x43')]=qs[_0xcddb('0x3c')](_[_0xcddb('0x44')](_0x557d92['query'],_0x5468d3['filters']),_0x2e6305);if(_0x557d92[_0xcddb('0x3b')][_0xcddb('0x45')]){_0x115088[_0xcddb('0x43')]=_['merge'](_0x115088[_0xcddb('0x43')],{'$or':_[_0xcddb('0x35')](_0x2e6305,function(_0x482494){if(_0x482494['type']!=='VIRTUAL'){var _0x53d53={};_0x53d53[_0x482494['name']]={'$like':'%'+_0x557d92[_0xcddb('0x3b')][_0xcddb('0x45')]+'%'};return _0x53d53;}})});}_0x115088=_['merge']({},_0x115088,_0x557d92[_0xcddb('0x46')]);var _0x4b3685={'where':_0x115088[_0xcddb('0x43')]};return db[_0xcddb('0x36')]['count'](_0x4b3685)[_0xcddb('0x1f')](function(_0x2866ba){_0x563129[_0xcddb('0x47')]=_0x2866ba;if(_0x557d92[_0xcddb('0x3b')][_0xcddb('0x48')]){_0x115088[_0xcddb('0x49')]=[{'all':!![]}];}return db[_0xcddb('0x36')][_0xcddb('0x4a')](_0x115088);})[_0xcddb('0x1f')](function(_0x1cbbcb){_0x563129[_0xcddb('0x4b')]=_0x1cbbcb;return _0x563129;})['then'](respondWithFilteredResult(_0x236950,_0x115088))[_0xcddb('0x27')](handleError(_0x236950,null));};exports[_0xcddb('0x4c')]=function(_0x589b10,_0xf8815b){var _0x33801c={'raw':!![],'where':{'id':_0x589b10[_0xcddb('0x4d')]['id']}},_0x1b1448={};_0x1b1448['model']=_[_0xcddb('0x4e')](db[_0xcddb('0x36')]['rawAttributes']);_0x1b1448[_0xcddb('0x3b')]=_['keys'](_0x589b10[_0xcddb('0x3b')]);_0x1b1448[_0xcddb('0x3c')]=_[_0xcddb('0x4f')](_0x1b1448[_0xcddb('0x3a')],_0x1b1448[_0xcddb('0x3b')]);_0x33801c['attributes']=_[_0xcddb('0x4f')](_0x1b1448[_0xcddb('0x3a')],qs[_0xcddb('0x3e')](_0x589b10[_0xcddb('0x3b')][_0xcddb('0x3e')]));_0x33801c[_0xcddb('0x3d')]=_0x33801c[_0xcddb('0x3d')][_0xcddb('0x50')]?_0x33801c[_0xcddb('0x3d')]:_0x1b1448[_0xcddb('0x3a')];if(_0x589b10['query'][_0xcddb('0x48')]){_0x33801c[_0xcddb('0x49')]=[{'all':!![]}];}_0x33801c=_[_0xcddb('0x51')]({},_0x33801c,_0x589b10[_0xcddb('0x46')]);return db['ChatMessage']['find'](_0x33801c)[_0xcddb('0x1f')](handleEntityNotFound(_0xf8815b,null))[_0xcddb('0x1f')](respondWithResult(_0xf8815b,null))[_0xcddb('0x27')](handleError(_0xf8815b,null));};exports[_0xcddb('0x52')]=function(_0x4b69a9,_0x1c6634){return db[_0xcddb('0x36')][_0xcddb('0x52')](_0x4b69a9[_0xcddb('0x53')],{})[_0xcddb('0x1f')](respondWithResult(_0x1c6634,0xc9))['catch'](handleError(_0x1c6634,null));};exports[_0xcddb('0x31')]=function(_0x11b5f2,_0x31d3ec){if(_0x11b5f2['body']['id']){delete _0x11b5f2['body']['id'];}return db[_0xcddb('0x36')][_0xcddb('0x54')]({'where':{'id':_0x11b5f2[_0xcddb('0x4d')]['id']}})[_0xcddb('0x1f')](handleEntityNotFound(_0x31d3ec,null))[_0xcddb('0x1f')](saveUpdates(_0x11b5f2['body'],null))[_0xcddb('0x1f')](respondWithResult(_0x31d3ec,null))[_0xcddb('0x27')](handleError(_0x31d3ec,null));};exports[_0xcddb('0x32')]=function(_0x5de250,_0x27a826){return db[_0xcddb('0x36')][_0xcddb('0x54')]({'where':{'id':_0x5de250[_0xcddb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27a826,null))['then'](removeEntity(_0x27a826,null))[_0xcddb('0x27')](handleError(_0x27a826,null));};exports[_0xcddb('0x55')]=function(_0x79a6ed,_0x2eb250){return db['ChatMessage'][_0xcddb('0x55')]()[_0xcddb('0x1f')](respondWithResult(_0x2eb250,null))[_0xcddb('0x27')](handleError(_0x2eb250,null));};var interaction_log=require(_0xcddb('0x12'))('chat-interactions');exports[_0xcddb('0x56')]=function(_0x33fada,_0x5628c0,_0x35b994){var _0x3c673b={'agent':{},'channel':_0xcddb('0x57')};if(_0x33fada[_0xcddb('0x53')]['id']){delete _0x33fada[_0xcddb('0x53')]['id'];}_0x33fada[_0xcddb('0x53')][_0xcddb('0x58')]=!![];_0x33fada[_0xcddb('0x53')]['readAt']=moment()[_0xcddb('0x59')](_0xcddb('0x5a'));_0x33fada['body'][_0xcddb('0x5b')]=_0x33fada[_0xcddb('0x53')]['UserId']||_0x33fada['user']['id'];_0x3c673b[_0xcddb('0x5c')]['id']=_0x33fada[_0xcddb('0x53')][_0xcddb('0x5b')];return db['ChatMessage'][_0xcddb('0x54')]({'where':{'id':_0x33fada[_0xcddb('0x4d')]['id'],'UserId':null}})[_0xcddb('0x1f')](handleEntityNotFound(_0x5628c0,null))[_0xcddb('0x1f')](saveUpdates(_0x33fada[_0xcddb('0x53')],null))[_0xcddb('0x1f')](function(_0xdbfd5f){if(_0xdbfd5f){_0x3c673b['message']=_0xdbfd5f['get']({'plain':!![]});return db['ChatInteraction'][_0xcddb('0x54')]({'where':{'id':_0xdbfd5f['ChatInteractionId']}});}return null;})[_0xcddb('0x1f')](handleEntityNotFound(_0x5628c0,null))[_0xcddb('0x1f')](function(_0x32f6eb){if(_0x32f6eb){return _0x32f6eb[_0xcddb('0x31')]({'UserId':_0x33fada[_0xcddb('0x53')][_0xcddb('0x5b')],'read1stAt':_[_0xcddb('0x5d')](_0x32f6eb[_0xcddb('0x5e')])?moment()[_0xcddb('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xcddb('0x1f')](function(_0x18982f){if(_0x18982f){_0x3c673b['interaction']=_0x18982f['get']({'plain':!![]});interaction_log['info'](_0xcddb('0x5f'),_0x33fada[_0xcddb('0x60')]['id'],_0x33fada['user'][_0xcddb('0x33')],_0x33fada[_0xcddb('0x60')][_0xcddb('0x61')],_0x3c673b['interaction']['id'],_0x33fada[_0xcddb('0x53')]?JSON[_0xcddb('0x23')](_0x33fada[_0xcddb('0x53')]):_0xcddb('0x62'));return respondWithRpcPromise(_0xcddb('0x63'),_0xcddb('0x64'),_0x3c673b);}return null;})[_0xcddb('0x1f')](function(_0x3622db){var _0x1cb196='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3622db[_0xcddb('0x26')][_0xcddb('0x65')];return db[_0xcddb('0x66')][_0xcddb('0x3b')](_0x1cb196,{'type':db[_0xcddb('0x67')]['QueryTypes'][_0xcddb('0x68')],'raw':!![]})['then'](function(_0xba07e9){return _0xba07e9;});})[_0xcddb('0x1f')](function(_0x1901c9){if(_0x1901c9){_0x3c673b[_0xcddb('0x26')][_0xcddb('0x69')]=_0x1901c9[0x0];if(!_0x33fada[_0xcddb('0x53')][_0xcddb('0x5b')])return;return db['User']['find']({'where':{'id':_0x33fada[_0xcddb('0x53')][_0xcddb('0x5b')],'role':_0xcddb('0x5c')},'attributes':['id',_0xcddb('0x33'),'fullname',_0xcddb('0x6a'),_0xcddb('0x6b')],'raw':!![]});}return null;})[_0xcddb('0x1f')](function(_0x1505b9){if(!_0x1505b9)return null;_0x3c673b[_0xcddb('0x26')]['agent']=_0x1505b9;return _0x3c673b;})[_0xcddb('0x1f')](function(_0x1c4494){if(_0x1c4494){if(_0x33fada['body']['manual']){_0x3c673b[_0xcddb('0x26')]['interface']=util['format'](_0xcddb('0x6c'),_0x33fada[_0xcddb('0x60')][_0xcddb('0x33')]);_0x3c673b[_0xcddb('0x26')][_0xcddb('0x6d')]=_0x3c673b['channel'];_0x3c673b['message'][_0xcddb('0x6e')]=_0x3c673b['channel'];_0x3c673b['message']['event']=_0xcddb('0x56');return respondWithRpcPromise('EventManager',_0xcddb('0x6f'),{'event':_0xcddb('0x70'),'message':_[_0xcddb('0x51')](_0x3c673b[_0xcddb('0x26')],JSON['parse'](_0x3c673b[_0xcddb('0x71')][_0xcddb('0x72')]))},client9002)['then'](function(){return _0x3c673b;});}return _0x3c673b;}return null;})[_0xcddb('0x1f')](respondWithResult(_0x5628c0,null))[_0xcddb('0x27')](handleError(_0x5628c0,null));};var interaction_log=require(_0xcddb('0x12'))(_0xcddb('0x73'));exports[_0xcddb('0x2f')]=function(_0x6ee5d0,_0x5af710,_0x2c360f){var _0x12daa2={'agent':{},'channel':_0xcddb('0x57')};if(_0x6ee5d0['body']['id']){delete _0x6ee5d0['body']['id'];}_0x6ee5d0[_0xcddb('0x53')][_0xcddb('0x5b')]=_0x6ee5d0['body'][_0xcddb('0x5b')]||_0x6ee5d0[_0xcddb('0x60')]['id'];_0x12daa2['agent']['id']=_0x6ee5d0[_0xcddb('0x53')]['UserId'];return db[_0xcddb('0x36')][_0xcddb('0x54')]({'where':{'id':_0x6ee5d0[_0xcddb('0x4d')]['id'],'UserId':null}})[_0xcddb('0x1f')](handleEntityNotFound(_0x5af710,null))[_0xcddb('0x1f')](function(_0x3e6913){if(_0x3e6913){_0x12daa2[_0xcddb('0x26')]=_0x3e6913['get']({'plain':!![]});return db[_0xcddb('0x74')][_0xcddb('0x54')]({'where':{'id':_0x3e6913[_0xcddb('0x75')]}});}return null;})[_0xcddb('0x1f')](handleEntityNotFound(_0x5af710,null))[_0xcddb('0x1f')](function(_0x12237f){if(_0x12237f){_0x12daa2['interaction']=_0x12237f[_0xcddb('0x76')]({'plain':!![]});interaction_log[_0xcddb('0x20')](_0xcddb('0x77'),_0x6ee5d0['user']['id'],_0x6ee5d0[_0xcddb('0x60')][_0xcddb('0x33')],_0x6ee5d0[_0xcddb('0x60')]['role'],_0x12daa2['interaction']['id'],_0x6ee5d0['body']?JSON[_0xcddb('0x23')](_0x6ee5d0[_0xcddb('0x53')]):_0xcddb('0x62'));return respondWithRpcPromise(_0xcddb('0x78'),_0xcddb('0x79'),_0x12daa2);}return null;})[_0xcddb('0x1f')](function(_0x13e922){var _0x223ced='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13e922[_0xcddb('0x26')][_0xcddb('0x65')];return db[_0xcddb('0x66')][_0xcddb('0x3b')](_0x223ced,{'type':db['Sequelize'][_0xcddb('0x7a')]['SELECT'],'raw':!![]})[_0xcddb('0x1f')](function(_0x894c3c){return _0x894c3c;});})[_0xcddb('0x1f')](function(_0x31e968){if(_0x31e968){_0x12daa2[_0xcddb('0x26')][_0xcddb('0x69')]=_0x31e968[0x0];if(!_0x6ee5d0[_0xcddb('0x53')][_0xcddb('0x5b')])return;return db[_0xcddb('0x7b')][_0xcddb('0x54')]({'where':{'id':_0x6ee5d0[_0xcddb('0x53')][_0xcddb('0x5b')],'role':'agent'},'attributes':['id',_0xcddb('0x33'),_0xcddb('0x7c'),_0xcddb('0x6a'),_0xcddb('0x6b')],'raw':!![]});}return null;})[_0xcddb('0x1f')](function(_0x8ed316){if(!_0x8ed316)return null;_0x12daa2[_0xcddb('0x26')][_0xcddb('0x5c')]=_0x8ed316;return _0x12daa2;})[_0xcddb('0x1f')](function(_0x593ce3){if(_0x593ce3){_0x593ce3[_0xcddb('0x26')][_0xcddb('0x7d')]=util['format']('SIP/%s',_0x6ee5d0[_0xcddb('0x60')]['name']);_0x593ce3[_0xcddb('0x26')][_0xcddb('0x6d')]=_0x12daa2['channel'];_0x593ce3[_0xcddb('0x26')]['motionChannel']=_0x12daa2['channel'];_0x593ce3[_0xcddb('0x26')][_0xcddb('0x7e')]=_0xcddb('0x2f');respondWithRpcPromise(_0xcddb('0x6f'),_0xcddb('0x6f'),{'event':'rejectmessage','message':_[_0xcddb('0x51')](_0x12daa2[_0xcddb('0x26')],JSON[_0xcddb('0x7f')](_0x12daa2['interaction'][_0xcddb('0x72')]))},client9002);return _0x12daa2;}return null;})['then'](respondWithResult(_0x5af710,null))[_0xcddb('0x27')](handleError(_0x5af710,null));}; \ No newline at end of file +var _0xdc10=['undefined','count','save','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','update','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','event','reject','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset'];(function(_0x2f574b,_0x5dc9d7){var _0x285cd1=function(_0x523096){while(--_0x523096){_0x2f574b['push'](_0x2f574b['shift']());}};_0x285cd1(++_0x5dc9d7);}(_0xdc10,0x15f));var _0x0dc1=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xdc10[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0x0dc1('0x0'));var rimraf=require(_0x0dc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0dc1('0x2'));var rp=require(_0x0dc1('0x3'));var moment=require(_0x0dc1('0x4'));var BPromise=require(_0x0dc1('0x5'));var Mustache=require('mustache');var util=require(_0x0dc1('0x6'));var path=require('path');var sox=require(_0x0dc1('0x7'));var csv=require(_0x0dc1('0x8'));var ejs=require(_0x0dc1('0x9'));var fs=require('fs');var fs_extra=require(_0x0dc1('0xa'));var _=require(_0x0dc1('0xb'));var squel=require(_0x0dc1('0xc'));var crypto=require(_0x0dc1('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0dc1('0xe'));var Papa=require(_0x0dc1('0xf'));var Redis=require(_0x0dc1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0dc1('0x11'));var as=require(_0x0dc1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0dc1('0x13'))(_0x0dc1('0x14'));var utils=require(_0x0dc1('0x15'));var config=require(_0x0dc1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0dc1('0x17'))['db'];config[_0x0dc1('0x18')]=_['defaults'](config['redis'],{'host':_0x0dc1('0x19'),'port':0x18eb});var socket=require(_0x0dc1('0x1a'))(new Redis(config[_0x0dc1('0x18')]));require(_0x0dc1('0x1b'))[_0x0dc1('0x1c')](socket);var jayson=require(_0x0dc1('0x1d'));var client=jayson[_0x0dc1('0x1e')][_0x0dc1('0x1f')]({'port':0x232c});var client9002=jayson[_0x0dc1('0x1e')][_0x0dc1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x411c03,_0x26fb2b,_0x39930f,_0x3c6869){return new BPromise(function(_0x51641c,_0x11ab00){var _0x143821=_0x3c6869||client;return _0x143821[_0x0dc1('0x20')](_0x411c03,_0x39930f)[_0x0dc1('0x21')](function(_0x3d566d){logger['info'](_0x0dc1('0x22'),_0x26fb2b,'request\x20sent');logger[_0x0dc1('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x26fb2b,_0x0dc1('0x24'),JSON[_0x0dc1('0x25')](_0x3d566d));if(_0x3d566d[_0x0dc1('0x26')]){if(_0x3d566d[_0x0dc1('0x26')][_0x0dc1('0x27')]===0x1f4){logger[_0x0dc1('0x26')](_0x0dc1('0x22'),_0x26fb2b,_0x3d566d[_0x0dc1('0x26')][_0x0dc1('0x28')]);return _0x11ab00(_0x3d566d['error'][_0x0dc1('0x28')]);}logger[_0x0dc1('0x26')](_0x0dc1('0x22'),_0x26fb2b,_0x3d566d['error'][_0x0dc1('0x28')]);return _0x51641c(_0x3d566d[_0x0dc1('0x26')][_0x0dc1('0x28')]);}else{logger[_0x0dc1('0x29')](_0x0dc1('0x22'),_0x26fb2b,_0x0dc1('0x24'));_0x51641c(_0x3d566d[_0x0dc1('0x2a')]['message']);}})['catch'](function(_0x5df717){logger[_0x0dc1('0x26')](_0x0dc1('0x22'),_0x26fb2b,_0x5df717);_0x11ab00(_0x5df717);});});}function respondWithStatusCode(_0x59997d,_0x3bc675){_0x3bc675=_0x3bc675||0xcc;return function(_0x36829f){if(_0x36829f){return _0x59997d[_0x0dc1('0x2b')](_0x3bc675);}return _0x59997d[_0x0dc1('0x2c')](_0x3bc675)[_0x0dc1('0x2d')]();};}function respondWithResult(_0xa40d76,_0x2a6068){_0x2a6068=_0x2a6068||0xc8;return function(_0x7412bb){if(_0x7412bb){return _0xa40d76[_0x0dc1('0x2c')](_0x2a6068)[_0x0dc1('0x2e')](_0x7412bb);}};}function respondWithFilteredResult(_0x11f0d5,_0x4939a3){return function(_0x52e6a2){if(_0x52e6a2){var _0x34ce47=typeof _0x4939a3[_0x0dc1('0x2f')]===_0x0dc1('0x30')&&typeof _0x4939a3['limit']===_0x0dc1('0x30');var _0x17c84a=_0x52e6a2[_0x0dc1('0x31')];var _0x5a3fe9=_0x34ce47?0x0:_0x4939a3[_0x0dc1('0x2f')];var _0x51028e=_0x34ce47?_0x52e6a2[_0x0dc1('0x31')]:_0x4939a3['offset']+_0x4939a3['limit'];var _0x56d48c;if(_0x51028e>=_0x17c84a){_0x51028e=_0x17c84a;_0x56d48c=0xc8;}else{_0x56d48c=0xce;}_0x11f0d5['status'](_0x56d48c);return _0x11f0d5['set']('Content-Range',_0x5a3fe9+'-'+_0x51028e+'/'+_0x17c84a)[_0x0dc1('0x2e')](_0x52e6a2);}return null;};}function patchUpdates(_0x220321){return function(_0x453b48){try{jsonpatch['apply'](_0x453b48,_0x220321,!![]);}catch(_0x1cced8){return BPromise['reject'](_0x1cced8);}return _0x453b48[_0x0dc1('0x32')]();};}function saveUpdates(_0x2b0264,_0x1dc383){return function(_0x5afd31){if(_0x5afd31){return _0x5afd31['update'](_0x2b0264)[_0x0dc1('0x21')](function(_0x628420){return _0x628420;});}return null;};}function removeEntity(_0x1e9e78,_0x2a14f6){return function(_0x5a45cd){if(_0x5a45cd){return _0x5a45cd[_0x0dc1('0x33')]()[_0x0dc1('0x21')](function(){_0x1e9e78[_0x0dc1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x497172,_0x6b89af){return function(_0x25a686){if(!_0x25a686){_0x497172['sendStatus'](0x194);}return _0x25a686;};}function handleError(_0x58e51a,_0x2e06f2){_0x2e06f2=_0x2e06f2||0x1f4;return function(_0x422718){logger['error'](_0x422718[_0x0dc1('0x34')]);if(_0x422718['name']){delete _0x422718[_0x0dc1('0x35')];}_0x58e51a[_0x0dc1('0x2c')](_0x2e06f2)[_0x0dc1('0x36')](_0x422718);};}exports[_0x0dc1('0x37')]=function(_0x58b587,_0x3f8436){var _0x5094df={},_0x1b8d83={},_0x43c2ea={'count':0x0,'rows':[]};var _0x2013da=_['map'](db[_0x0dc1('0x38')][_0x0dc1('0x39')],function(_0x736f5e){return{'name':_0x736f5e[_0x0dc1('0x3a')],'type':_0x736f5e['type'][_0x0dc1('0x3b')]};});_0x1b8d83[_0x0dc1('0x3c')]=_[_0x0dc1('0x3d')](_0x2013da,_0x0dc1('0x35'));_0x1b8d83[_0x0dc1('0x3e')]=_[_0x0dc1('0x3f')](_0x58b587[_0x0dc1('0x3e')]);_0x1b8d83['filters']=_[_0x0dc1('0x40')](_0x1b8d83[_0x0dc1('0x3c')],_0x1b8d83[_0x0dc1('0x3e')]);_0x5094df['attributes']=_[_0x0dc1('0x40')](_0x1b8d83[_0x0dc1('0x3c')],qs['fields'](_0x58b587[_0x0dc1('0x3e')][_0x0dc1('0x41')]));_0x5094df[_0x0dc1('0x42')]=_0x5094df['attributes']['length']?_0x5094df[_0x0dc1('0x42')]:_0x1b8d83[_0x0dc1('0x3c')];if(!_0x58b587[_0x0dc1('0x3e')][_0x0dc1('0x43')](_0x0dc1('0x44'))){_0x5094df['limit']=qs['limit'](_0x58b587[_0x0dc1('0x3e')][_0x0dc1('0x45')]);_0x5094df[_0x0dc1('0x2f')]=qs[_0x0dc1('0x2f')](_0x58b587[_0x0dc1('0x3e')][_0x0dc1('0x2f')]);}_0x5094df['order']=qs['sort'](_0x58b587['query'][_0x0dc1('0x46')]);_0x5094df['where']=qs[_0x0dc1('0x47')](_[_0x0dc1('0x48')](_0x58b587[_0x0dc1('0x3e')],_0x1b8d83[_0x0dc1('0x47')]),_0x2013da);if(_0x58b587[_0x0dc1('0x3e')][_0x0dc1('0x49')]){_0x5094df[_0x0dc1('0x4a')]=_[_0x0dc1('0x4b')](_0x5094df[_0x0dc1('0x4a')],{'$or':_['map'](_0x2013da,function(_0x28e53d){if(_0x28e53d[_0x0dc1('0x4c')]!==_0x0dc1('0x4d')){var _0x195e63={};_0x195e63[_0x28e53d[_0x0dc1('0x35')]]={'$like':'%'+_0x58b587['query'][_0x0dc1('0x49')]+'%'};return _0x195e63;}})});}_0x5094df=_[_0x0dc1('0x4b')]({},_0x5094df,_0x58b587['options']);var _0x4200d6={'where':_0x5094df[_0x0dc1('0x4a')]};return db[_0x0dc1('0x38')][_0x0dc1('0x31')](_0x4200d6)[_0x0dc1('0x21')](function(_0x5e8327){_0x43c2ea[_0x0dc1('0x31')]=_0x5e8327;if(_0x58b587['query'][_0x0dc1('0x4e')]){_0x5094df[_0x0dc1('0x4f')]=[{'all':!![]}];}return db[_0x0dc1('0x38')][_0x0dc1('0x50')](_0x5094df);})[_0x0dc1('0x21')](function(_0x3be5a6){_0x43c2ea[_0x0dc1('0x51')]=_0x3be5a6;return _0x43c2ea;})[_0x0dc1('0x21')](respondWithFilteredResult(_0x3f8436,_0x5094df))[_0x0dc1('0x52')](handleError(_0x3f8436,null));};exports[_0x0dc1('0x53')]=function(_0xd6fe82,_0x44b2a2){var _0x40001d={'raw':!![],'where':{'id':_0xd6fe82[_0x0dc1('0x54')]['id']}},_0x3abf61={};_0x3abf61[_0x0dc1('0x3c')]=_['keys'](db[_0x0dc1('0x38')][_0x0dc1('0x39')]);_0x3abf61[_0x0dc1('0x3e')]=_[_0x0dc1('0x3f')](_0xd6fe82[_0x0dc1('0x3e')]);_0x3abf61[_0x0dc1('0x47')]=_[_0x0dc1('0x40')](_0x3abf61['model'],_0x3abf61['query']);_0x40001d['attributes']=_['intersection'](_0x3abf61[_0x0dc1('0x3c')],qs[_0x0dc1('0x41')](_0xd6fe82[_0x0dc1('0x3e')]['fields']));_0x40001d[_0x0dc1('0x42')]=_0x40001d[_0x0dc1('0x42')][_0x0dc1('0x55')]?_0x40001d[_0x0dc1('0x42')]:_0x3abf61[_0x0dc1('0x3c')];if(_0xd6fe82[_0x0dc1('0x3e')][_0x0dc1('0x4e')]){_0x40001d[_0x0dc1('0x4f')]=[{'all':!![]}];}_0x40001d=_[_0x0dc1('0x4b')]({},_0x40001d,_0xd6fe82[_0x0dc1('0x56')]);return db['ChatMessage'][_0x0dc1('0x57')](_0x40001d)['then'](handleEntityNotFound(_0x44b2a2,null))[_0x0dc1('0x21')](respondWithResult(_0x44b2a2,null))[_0x0dc1('0x52')](handleError(_0x44b2a2,null));};exports[_0x0dc1('0x58')]=function(_0x18575b,_0x36458f){return db['ChatMessage'][_0x0dc1('0x58')](_0x18575b[_0x0dc1('0x59')],{})[_0x0dc1('0x21')](respondWithResult(_0x36458f,0xc9))[_0x0dc1('0x52')](handleError(_0x36458f,null));};exports['update']=function(_0x9be7f1,_0xe8f5d7){if(_0x9be7f1[_0x0dc1('0x59')]['id']){delete _0x9be7f1['body']['id'];}return db[_0x0dc1('0x38')][_0x0dc1('0x57')]({'where':{'id':_0x9be7f1[_0x0dc1('0x54')]['id']}})[_0x0dc1('0x21')](handleEntityNotFound(_0xe8f5d7,null))[_0x0dc1('0x21')](saveUpdates(_0x9be7f1[_0x0dc1('0x59')],null))[_0x0dc1('0x21')](respondWithResult(_0xe8f5d7,null))[_0x0dc1('0x52')](handleError(_0xe8f5d7,null));};exports[_0x0dc1('0x33')]=function(_0x3dea47,_0x5f0728){return db['ChatMessage'][_0x0dc1('0x57')]({'where':{'id':_0x3dea47[_0x0dc1('0x54')]['id']}})[_0x0dc1('0x21')](handleEntityNotFound(_0x5f0728,null))[_0x0dc1('0x21')](removeEntity(_0x5f0728,null))[_0x0dc1('0x52')](handleError(_0x5f0728,null));};exports[_0x0dc1('0x5a')]=function(_0x17cc59,_0x56a098){return db[_0x0dc1('0x38')][_0x0dc1('0x5a')]()['then'](respondWithResult(_0x56a098,null))[_0x0dc1('0x52')](handleError(_0x56a098,null));};var interaction_log=require(_0x0dc1('0x13'))(_0x0dc1('0x5b'));exports[_0x0dc1('0x5c')]=function(_0x65dc75,_0x8a0f15,_0x428137){var _0x5252ce={'agent':{},'channel':_0x0dc1('0x5d')};if(_0x65dc75['body']['id']){delete _0x65dc75[_0x0dc1('0x59')]['id'];}_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x5e')]=!![];_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x5f')]=moment()['format'](_0x0dc1('0x60'));_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x61')]=_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x61')]||_0x65dc75[_0x0dc1('0x62')]['id'];_0x5252ce[_0x0dc1('0x63')]['id']=_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x61')];return db[_0x0dc1('0x38')][_0x0dc1('0x57')]({'where':{'id':_0x65dc75[_0x0dc1('0x54')]['id'],'UserId':null}})[_0x0dc1('0x21')](handleEntityNotFound(_0x8a0f15,null))['then'](saveUpdates(_0x65dc75[_0x0dc1('0x59')],null))[_0x0dc1('0x21')](function(_0x4d49e6){if(_0x4d49e6){_0x5252ce[_0x0dc1('0x28')]=_0x4d49e6[_0x0dc1('0x64')]({'plain':!![]});return db[_0x0dc1('0x65')]['find']({'where':{'id':_0x4d49e6['ChatInteractionId']}});}return null;})[_0x0dc1('0x21')](handleEntityNotFound(_0x8a0f15,null))[_0x0dc1('0x21')](function(_0x1b2f0c){if(_0x1b2f0c){return _0x1b2f0c[_0x0dc1('0x66')]({'UserId':_0x65dc75[_0x0dc1('0x59')]['UserId'],'read1stAt':_['isNil'](_0x1b2f0c['read1stAt'])?moment()[_0x0dc1('0x67')](_0x0dc1('0x60')):undefined});}return null;})[_0x0dc1('0x21')](function(_0x5835bf){if(_0x5835bf){_0x5252ce[_0x0dc1('0x68')]=_0x5835bf[_0x0dc1('0x64')]({'plain':!![]});interaction_log[_0x0dc1('0x29')](_0x0dc1('0x69'),_0x65dc75[_0x0dc1('0x62')]['id'],_0x65dc75['user'][_0x0dc1('0x35')],_0x65dc75[_0x0dc1('0x62')][_0x0dc1('0x6a')],_0x5252ce['interaction']['id'],_0x65dc75[_0x0dc1('0x59')]?JSON[_0x0dc1('0x25')](_0x65dc75['body']):_0x0dc1('0x6b'));return respondWithRpcPromise(_0x0dc1('0x6c'),_0x0dc1('0x6d'),_0x5252ce);}return null;})[_0x0dc1('0x21')](function(_0x31ea84){var _0x476047='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31ea84[_0x0dc1('0x28')]['ContactId'];return db['sequelize']['query'](_0x476047,{'type':db[_0x0dc1('0x6e')][_0x0dc1('0x6f')][_0x0dc1('0x70')],'raw':!![]})['then'](function(_0x4ae770){return _0x4ae770;});})[_0x0dc1('0x21')](function(_0x3c4924){if(_0x3c4924){_0x5252ce[_0x0dc1('0x28')]['contact']=_0x3c4924[0x0];if(!_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x61')])return;return db[_0x0dc1('0x71')][_0x0dc1('0x57')]({'where':{'id':_0x65dc75[_0x0dc1('0x59')][_0x0dc1('0x61')],'role':_0x0dc1('0x63')},'attributes':['id',_0x0dc1('0x35'),_0x0dc1('0x72'),_0x0dc1('0x73'),_0x0dc1('0x74')],'raw':!![]});}return null;})[_0x0dc1('0x21')](function(_0x1b106d){if(!_0x1b106d)return null;_0x5252ce[_0x0dc1('0x28')][_0x0dc1('0x63')]=_0x1b106d;return _0x5252ce;})[_0x0dc1('0x21')](function(_0xc7c13d){if(_0xc7c13d){if(_0x65dc75['body'][_0x0dc1('0x75')]){_0x5252ce['message'][_0x0dc1('0x76')]=util['format'](_0x0dc1('0x77'),_0x65dc75[_0x0dc1('0x62')][_0x0dc1('0x35')]);_0x5252ce[_0x0dc1('0x28')][_0x0dc1('0x78')]=_0x5252ce[_0x0dc1('0x78')];_0x5252ce[_0x0dc1('0x28')][_0x0dc1('0x79')]=_0x5252ce[_0x0dc1('0x78')];_0x5252ce[_0x0dc1('0x28')]['event']='accept';return respondWithRpcPromise(_0x0dc1('0x7a'),_0x0dc1('0x7a'),{'event':_0x0dc1('0x7b'),'message':_['merge'](_0x5252ce[_0x0dc1('0x28')],JSON[_0x0dc1('0x7c')](_0x5252ce[_0x0dc1('0x68')]['formData']))},client9002)['then'](function(){return _0x5252ce;});}return _0x5252ce;}return null;})['then'](respondWithResult(_0x8a0f15,null))[_0x0dc1('0x52')](handleError(_0x8a0f15,null));};var interaction_log=require(_0x0dc1('0x13'))(_0x0dc1('0x5b'));exports['reject']=function(_0x565745,_0x373033,_0x126a43){var _0x2051c5={'agent':{},'channel':'chat'};if(_0x565745[_0x0dc1('0x59')]['id']){delete _0x565745[_0x0dc1('0x59')]['id'];}_0x565745[_0x0dc1('0x59')][_0x0dc1('0x61')]=_0x565745[_0x0dc1('0x59')]['UserId']||_0x565745[_0x0dc1('0x62')]['id'];_0x2051c5['agent']['id']=_0x565745[_0x0dc1('0x59')][_0x0dc1('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x565745[_0x0dc1('0x54')]['id'],'UserId':null}})[_0x0dc1('0x21')](handleEntityNotFound(_0x373033,null))[_0x0dc1('0x21')](function(_0x12ef2a){if(_0x12ef2a){_0x2051c5[_0x0dc1('0x28')]=_0x12ef2a[_0x0dc1('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x0dc1('0x57')]({'where':{'id':_0x12ef2a[_0x0dc1('0x7d')]}});}return null;})['then'](handleEntityNotFound(_0x373033,null))[_0x0dc1('0x21')](function(_0x84fd15){if(_0x84fd15){_0x2051c5[_0x0dc1('0x68')]=_0x84fd15[_0x0dc1('0x64')]({'plain':!![]});interaction_log[_0x0dc1('0x29')](_0x0dc1('0x7e'),_0x565745[_0x0dc1('0x62')]['id'],_0x565745[_0x0dc1('0x62')][_0x0dc1('0x35')],_0x565745[_0x0dc1('0x62')][_0x0dc1('0x6a')],_0x2051c5['interaction']['id'],_0x565745[_0x0dc1('0x59')]?JSON[_0x0dc1('0x25')](_0x565745[_0x0dc1('0x59')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x2051c5);}return null;})[_0x0dc1('0x21')](function(_0x1228f7){var _0x226ece=_0x0dc1('0x7f')+_0x1228f7['message'][_0x0dc1('0x80')];return db[_0x0dc1('0x81')]['query'](_0x226ece,{'type':db[_0x0dc1('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x59d3e2){return _0x59d3e2;});})[_0x0dc1('0x21')](function(_0x253b6b){if(_0x253b6b){_0x2051c5[_0x0dc1('0x28')]['contact']=_0x253b6b[0x0];if(!_0x565745['body']['UserId'])return;return db[_0x0dc1('0x71')][_0x0dc1('0x57')]({'where':{'id':_0x565745[_0x0dc1('0x59')][_0x0dc1('0x61')],'role':_0x0dc1('0x63')},'attributes':['id','name',_0x0dc1('0x72'),_0x0dc1('0x73'),_0x0dc1('0x74')],'raw':!![]});}return null;})[_0x0dc1('0x21')](function(_0xd6bde1){if(!_0xd6bde1)return null;_0x2051c5[_0x0dc1('0x28')][_0x0dc1('0x63')]=_0xd6bde1;return _0x2051c5;})[_0x0dc1('0x21')](function(_0x449d95){if(_0x449d95){_0x449d95[_0x0dc1('0x28')]['interface']=util[_0x0dc1('0x67')](_0x0dc1('0x77'),_0x565745['user']['name']);_0x449d95['message'][_0x0dc1('0x78')]=_0x2051c5['channel'];_0x449d95[_0x0dc1('0x28')]['motionChannel']=_0x2051c5[_0x0dc1('0x78')];_0x449d95['message'][_0x0dc1('0x82')]=_0x0dc1('0x83');respondWithRpcPromise(_0x0dc1('0x7a'),_0x0dc1('0x7a'),{'event':_0x0dc1('0x84'),'message':_[_0x0dc1('0x4b')](_0x2051c5['message'],JSON[_0x0dc1('0x7c')](_0x2051c5[_0x0dc1('0x68')]['formData']))},client9002);return _0x2051c5;}return null;})['then'](respondWithResult(_0x373033,null))['catch'](handleError(_0x373033,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index b57ecfd..d155224 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 _0x20ef=['update','remove','emit','hasOwnProperty','exports','events','ChatMessage','setMaxListeners'];(function(_0xb3fcef,_0x2d3fcc){var _0x1bcf86=function(_0x2f0e6b){while(--_0x2f0e6b){_0xb3fcef['push'](_0xb3fcef['shift']());}};_0x1bcf86(++_0x2d3fcc);}(_0x20ef,0x11d));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf20e('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xf20e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf20e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf20e('0x3'),'afterDestroy':_0xf20e('0x4')};function emitEvent(_0x1b98e1){return function(_0xb6fd1b,_0x442944,_0x232798){ChatMessageEvents[_0xf20e('0x5')](_0x1b98e1+':'+_0xb6fd1b['id'],_0xb6fd1b);ChatMessageEvents[_0xf20e('0x5')](_0x1b98e1,_0xb6fd1b);_0x232798(null);};}for(var e in events){if(events[_0xf20e('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf20e('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x9d70=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x9d70,0xd5));var _0x09d7=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x9d70[_0x40220a];return _0x3903cc;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x09d7('0x0'))['db'][_0x09d7('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x09d7('0x2')](0x0);var events={'afterCreate':_0x09d7('0x3'),'afterUpdate':_0x09d7('0x4'),'afterDestroy':_0x09d7('0x5')};function emitEvent(_0xd2207f){return function(_0x426e08,_0xb9cf99,_0x3639ec){ChatMessageEvents[_0x09d7('0x6')](_0xd2207f+':'+_0x426e08['id'],_0x426e08);ChatMessageEvents[_0x09d7('0x6')](_0xd2207f,_0x426e08);_0x3639ec(null);};}for(var e in events){if(events[_0x09d7('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x09d7('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index d5d8a91..be7e045 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 _0x9ff7=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','models','get','toLowerCase','direction','out','secret'];(function(_0x787d44,_0x36fea9){var _0x1c1430=function(_0x18bcd6){while(--_0x18bcd6){_0x787d44['push'](_0x787d44['shift']());}};_0x1c1430(++_0x36fea9);}(_0x9ff7,0x160));var _0x79ff=function(_0x1ab467,_0x38d2a6){_0x1ab467=_0x1ab467-0x0;var _0x3d40d7=_0x9ff7[_0x1ab467];return _0x3d40d7;};'use strict';var _=require(_0x79ff('0x0'));var util=require(_0x79ff('0x1'));var logger=require(_0x79ff('0x2'))('api');var moment=require(_0x79ff('0x3'));var BPromise=require(_0x79ff('0x4'));var rp=require(_0x79ff('0x5'));var fs=require('fs');var path=require(_0x79ff('0x6'));var rimraf=require(_0x79ff('0x7'));var config=require('../../config/environment');var attributes=require(_0x79ff('0x8'));module[_0x79ff('0x9')]=function(_0x2975cc,_0x59fafa){return _0x2975cc[_0x79ff('0xa')](_0x79ff('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x79ff('0xc'),'fields':[_0x79ff('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40859b,_0x2025ce,_0x3c4475){var _0x348597=_0x2975cc[_0x79ff('0xe')];var _0x556435=_0x40859b[_0x79ff('0xf')]({'plain':!![]});if(_0x556435['direction'][_0x79ff('0x10')]()==='in'||_0x556435[_0x79ff('0x11')]['toLowerCase']()===_0x79ff('0x12')&&!_0x556435[_0x79ff('0x13')]&&!_[_0x79ff('0x14')](_0x556435[_0x79ff('0x15')])){_0x348597[_0x79ff('0x16')][_0x79ff('0x17')]({'where':{'id':_0x556435[_0x79ff('0x18')]}})[_0x79ff('0x19')](function(_0x326b97){if(_0x326b97){_0x326b97[_0x79ff('0x1a')]({'lastMsgAt':_0x556435[_0x79ff('0x1b')],'lastMsgDirection':_0x556435['direction'][_0x79ff('0x10')]()});}})[_0x79ff('0x1c')](function(_0x1742f4){console['error'](_0x1742f4);});}_0x3c4475();}},'charset':_0x79ff('0x1d'),'collate':_0x79ff('0x1e')});}; \ No newline at end of file +var _0xff16=['direction','toLowerCase','out','secret','ChatInteraction','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get'];(function(_0x286658,_0x48f2c4){var _0x4dd1e6=function(_0x1cd8cb){while(--_0x1cd8cb){_0x286658['push'](_0x286658['shift']());}};_0x4dd1e6(++_0x48f2c4);}(_0xff16,0x7f));var _0x6ff1=function(_0x1a17a0,_0x2d06c1){_0x1a17a0=_0x1a17a0-0x0;var _0x25778f=_0xff16[_0x1a17a0];return _0x25778f;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var logger=require('../../config/logger')(_0x6ff1('0x2'));var moment=require(_0x6ff1('0x3'));var BPromise=require(_0x6ff1('0x4'));var rp=require(_0x6ff1('0x5'));var fs=require('fs');var path=require(_0x6ff1('0x6'));var rimraf=require(_0x6ff1('0x7'));var config=require(_0x6ff1('0x8'));var attributes=require(_0x6ff1('0x9'));module['exports']=function(_0x153a91,_0x4f8f24){return _0x153a91[_0x6ff1('0xa')](_0x6ff1('0xb'),attributes,{'tableName':_0x6ff1('0xc'),'paranoid':![],'indexes':[{'name':_0x6ff1('0xd'),'fields':[_0x6ff1('0xe')],'type':_0x6ff1('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41e99f,_0x172393,_0x514f83){var _0x2bbd50=_0x153a91[_0x6ff1('0x10')];var _0x41bcca=_0x41e99f[_0x6ff1('0x11')]({'plain':!![]});if(_0x41bcca[_0x6ff1('0x12')][_0x6ff1('0x13')]()==='in'||_0x41bcca[_0x6ff1('0x12')][_0x6ff1('0x13')]()===_0x6ff1('0x14')&&!_0x41bcca[_0x6ff1('0x15')]&&!_['isNil'](_0x41bcca['UserId'])){_0x2bbd50[_0x6ff1('0x16')]['findOne']({'where':{'id':_0x41bcca[_0x6ff1('0x17')]}})[_0x6ff1('0x18')](function(_0x1451af){if(_0x1451af){_0x1451af['update']({'lastMsgAt':_0x41bcca['createdAt'],'lastMsgDirection':_0x41bcca['direction'][_0x6ff1('0x13')]()});}})[_0x6ff1('0x19')](function(_0x23112d){console[_0x6ff1('0x1a')](_0x23112d);});}_0x514f83();}},'charset':_0x6ff1('0x1b'),'collate':_0x6ff1('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e23cc1f..5ff2b75 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 _0x0639=['jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','randomstring','ioredis','../../config/logger'];(function(_0x1e5c30,_0x3c3df1){var _0x135477=function(_0x2d0ee5){while(--_0x2d0ee5){_0x1e5c30['push'](_0x1e5c30['shift']());}};_0x135477(++_0x3c3df1);}(_0x0639,0x1ae));var _0x9063=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0639[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0x9063('0x0'));var moment=require(_0x9063('0x1'));var BPromise=require('bluebird');var rs=require(_0x9063('0x2'));var fs=require('fs');var Redis=require(_0x9063('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9063('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9063('0x5'));var client=jayson[_0x9063('0x6')][_0x9063('0x7')]({'port':0x232a});config[_0x9063('0x8')]=_[_0x9063('0x9')](config['redis'],{'host':_0x9063('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9063('0x8')]));require(_0x9063('0xb'))['register'](socket);function respondWithRpcPromise(_0x1f2bbf,_0x560af7,_0x5b56f6){return new BPromise(function(_0x50a435,_0x26dac0){return client['request'](_0x1f2bbf,_0x5b56f6)['then'](function(_0x547106){logger[_0x9063('0xc')](_0x9063('0xd'),_0x560af7,_0x9063('0xe'));logger[_0x9063('0xf')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x560af7,_0x9063('0xe'),JSON[_0x9063('0x10')](_0x547106));if(_0x547106[_0x9063('0x11')]){if(_0x547106[_0x9063('0x11')][_0x9063('0x12')]===0x1f4){logger['error'](_0x9063('0xd'),_0x560af7,_0x547106['error'][_0x9063('0x13')]);return _0x26dac0(_0x547106['error'][_0x9063('0x13')]);}logger['error'](_0x9063('0xd'),_0x560af7,_0x547106[_0x9063('0x11')][_0x9063('0x13')]);return _0x50a435(_0x547106[_0x9063('0x11')][_0x9063('0x13')]);}else{logger['info'](_0x9063('0xd'),_0x560af7,_0x9063('0xe'));_0x50a435(_0x547106[_0x9063('0x14')]['message']);}})[_0x9063('0x15')](function(_0x21e34f){logger[_0x9063('0x11')]('ChatMessage,\x20%s,\x20%s',_0x560af7,_0x21e34f);_0x26dac0(_0x21e34f);});});}exports[_0x9063('0x16')]=function(_0x29d369){var _0x178bc5=this;return new Promise(function(_0x1f9805,_0x13bc45){return db[_0x9063('0x17')][_0x9063('0x18')](_0x29d369[_0x9063('0x19')],{'raw':_0x29d369[_0x9063('0x1a')]?_0x29d369[_0x9063('0x1a')][_0x9063('0x1b')]===undefined?!![]:![]:!![]})[_0x9063('0x1c')](function(_0x5d610e){logger[_0x9063('0xc')]('CreateChatMessage',_0x29d369);logger[_0x9063('0xf')](_0x9063('0x16'),_0x29d369,JSON[_0x9063('0x10')](_0x5d610e));_0x1f9805(_0x5d610e);})[_0x9063('0x15')](function(_0x25e5a0){logger[_0x9063('0x11')](_0x9063('0x16'),_0x25e5a0[_0x9063('0x13')],_0x29d369);_0x13bc45(_0x178bc5[_0x9063('0x11')](0x1f4,_0x25e5a0[_0x9063('0x13')]));});});}; \ No newline at end of file +var _0x41d7=['catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x346587,_0x3b78c9){var _0x39f770=function(_0x3199fa){while(--_0x3199fa){_0x346587['push'](_0x346587['shift']());}};_0x39f770(++_0x3b78c9);}(_0x41d7,0x194));var _0x741d=function(_0x5cd290,_0x393e66){_0x5cd290=_0x5cd290-0x0;var _0x2d3166=_0x41d7[_0x5cd290];return _0x2d3166;};'use strict';var _=require('lodash');var util=require(_0x741d('0x0'));var moment=require(_0x741d('0x1'));var BPromise=require(_0x741d('0x2'));var rs=require(_0x741d('0x3'));var fs=require('fs');var Redis=require(_0x741d('0x4'));var db=require(_0x741d('0x5'))['db'];var utils=require(_0x741d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x741d('0x7'));var jayson=require(_0x741d('0x8'));var client=jayson['client'][_0x741d('0x9')]({'port':0x232a});config[_0x741d('0xa')]=_[_0x741d('0xb')](config['redis'],{'host':_0x741d('0xc'),'port':0x18eb});var socket=require(_0x741d('0xd'))(new Redis(config['redis']));require(_0x741d('0xe'))[_0x741d('0xf')](socket);function respondWithRpcPromise(_0x41a071,_0x5a711e,_0x5a1b32){return new BPromise(function(_0x1a7e91,_0x20bdb5){return client[_0x741d('0x10')](_0x41a071,_0x5a1b32)['then'](function(_0x71df37){logger[_0x741d('0x11')]('ChatMessage,\x20%s,\x20%s',_0x5a711e,_0x741d('0x12'));logger[_0x741d('0x13')](_0x741d('0x14'),_0x5a711e,_0x741d('0x12'),JSON['stringify'](_0x71df37));if(_0x71df37[_0x741d('0x15')]){if(_0x71df37[_0x741d('0x15')][_0x741d('0x16')]===0x1f4){logger[_0x741d('0x15')](_0x741d('0x17'),_0x5a711e,_0x71df37[_0x741d('0x15')][_0x741d('0x18')]);return _0x20bdb5(_0x71df37[_0x741d('0x15')][_0x741d('0x18')]);}logger[_0x741d('0x15')](_0x741d('0x17'),_0x5a711e,_0x71df37[_0x741d('0x15')][_0x741d('0x18')]);return _0x1a7e91(_0x71df37[_0x741d('0x15')][_0x741d('0x18')]);}else{logger[_0x741d('0x11')](_0x741d('0x17'),_0x5a711e,'request\x20sent');_0x1a7e91(_0x71df37['result'][_0x741d('0x18')]);}})[_0x741d('0x19')](function(_0x174dc4){logger[_0x741d('0x15')](_0x741d('0x17'),_0x5a711e,_0x174dc4);_0x20bdb5(_0x174dc4);});});}exports[_0x741d('0x1a')]=function(_0x49750c){var _0x279ff1=this;return new Promise(function(_0x2b9871,_0x1f0acb){return db[_0x741d('0x1b')][_0x741d('0x1c')](_0x49750c[_0x741d('0x1d')],{'raw':_0x49750c[_0x741d('0x1e')]?_0x49750c['options'][_0x741d('0x1f')]===undefined?!![]:![]:!![]})[_0x741d('0x20')](function(_0x5c6550){logger['info'](_0x741d('0x1a'),_0x49750c);logger[_0x741d('0x13')](_0x741d('0x1a'),_0x49750c,JSON['stringify'](_0x5c6550));_0x2b9871(_0x5c6550);})[_0x741d('0x19')](function(_0x581d2d){logger[_0x741d('0x15')](_0x741d('0x1a'),_0x581d2d['message'],_0x49750c);_0x1f0acb(_0x279ff1[_0x741d('0x15')](0x1f4,_0x581d2d[_0x741d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 501a016..07ee609 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 _0xcea5=['save','remove','update','emit','register','chatMessage:','./chatMessage.events'];(function(_0x567463,_0x37ad5a){var _0x35f0bf=function(_0x3ea3bb){while(--_0x3ea3bb){_0x567463['push'](_0x567463['shift']());}};_0x35f0bf(++_0x37ad5a);}(_0xcea5,0xed));var _0x5cea=function(_0x2c81f4,_0x208f8c){_0x2c81f4=_0x2c81f4-0x0;var _0x28d018=_0xcea5[_0x2c81f4];return _0x28d018;};'use strict';var ChatMessageEvents=require(_0x5cea('0x0'));var events=[_0x5cea('0x1'),_0x5cea('0x2'),_0x5cea('0x3')];function createListener(_0x2c6970,_0x52a9b8){return function(_0x20a2d9){_0x52a9b8[_0x5cea('0x4')](_0x2c6970,_0x20a2d9);};}function removeListener(_0x382c21,_0x319dba){return function(){ChatMessageEvents['removeListener'](_0x382c21,_0x319dba);};}exports[_0x5cea('0x5')]=function(_0x31e6f3){for(var _0x599bc5=0x0,_0x49db13=events['length'];_0x599bc5<_0x49db13;_0x599bc5++){var _0x502d95=events[_0x599bc5];var _0x3b6fbc=createListener(_0x5cea('0x6')+_0x502d95,_0x31e6f3);ChatMessageEvents['on'](_0x502d95,_0x3b6fbc);}}; \ No newline at end of file +var _0x9fc5=['save','remove','emit','removeListener','register','length','chatMessage:'];(function(_0x3fbb40,_0x408c22){var _0x3a9c8=function(_0x454e9c){while(--_0x454e9c){_0x3fbb40['push'](_0x3fbb40['shift']());}};_0x3a9c8(++_0x408c22);}(_0x9fc5,0xb6));var _0x59fc=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0x9fc5[_0x54b062];return _0x255e41;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x59fc('0x0'),_0x59fc('0x1'),'update'];function createListener(_0x4647c5,_0x24cd55){return function(_0x46c819){_0x24cd55[_0x59fc('0x2')](_0x4647c5,_0x46c819);};}function removeListener(_0x44979c,_0x1b0778){return function(){ChatMessageEvents[_0x59fc('0x3')](_0x44979c,_0x1b0778);};}exports[_0x59fc('0x4')]=function(_0x4cb94d){for(var _0x3bde0b=0x0,_0x13897f=events[_0x59fc('0x5')];_0x3bde0b<_0x13897f;_0x3bde0b++){var _0x55fa6d=events[_0x3bde0b];var _0xdd2bb9=createListener(_0x59fc('0x6')+_0x55fa6d,_0x4cb94d);ChatMessageEvents['on'](_0x55fa6d,_0xdd2bb9);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 596b596..956ac7c 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 _0xdc52=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','isAuthenticated','show','post','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdc52,0xc3));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dc5('0x0'));var util=require(_0x2dc5('0x1'));var path=require(_0x2dc5('0x2'));var timeout=require(_0x2dc5('0x3'));var express=require(_0x2dc5('0x4'));var router=express[_0x2dc5('0x5')]();var fs_extra=require(_0x2dc5('0x6'));var auth=require(_0x2dc5('0x7'));var interaction=require(_0x2dc5('0x8'));var config=require(_0x2dc5('0x9'));var controller=require(_0x2dc5('0xa'));router[_0x2dc5('0xb')]('/',auth['isAuthenticated'](),controller[_0x2dc5('0xc')]);router[_0x2dc5('0xb')](_0x2dc5('0xd'),auth['isAuthenticated'](),controller[_0x2dc5('0xe')]);router[_0x2dc5('0xb')]('/:id',auth[_0x2dc5('0xf')](),controller[_0x2dc5('0x10')]);router[_0x2dc5('0x11')]('/',auth[_0x2dc5('0xf')](),interaction[_0x2dc5('0x12')](_0x2dc5('0x13'),_0x2dc5('0x14')),controller[_0x2dc5('0x15')]);router[_0x2dc5('0x16')](_0x2dc5('0x17'),controller[_0x2dc5('0x18')]);router[_0x2dc5('0x16')](_0x2dc5('0x19'),auth[_0x2dc5('0xf')](),controller[_0x2dc5('0x1a')]);router[_0x2dc5('0x16')](_0x2dc5('0x1b'),auth['isAuthenticated'](),controller[_0x2dc5('0x1c')]);router[_0x2dc5('0x1d')](_0x2dc5('0x17'),auth[_0x2dc5('0xf')](),controller[_0x2dc5('0x1e')]);module[_0x2dc5('0x1f')]=router; \ No newline at end of file +var _0xe35a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','describe','get','/:id','show','post','tracked','chatmessage:create','put','update','/:id/reject','reject','exports','multer','util','path'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xe35a,0x16d));var _0xae35=function(_0x28f0a8,_0x2cfd26){_0x28f0a8=_0x28f0a8-0x0;var _0x33db97=_0xe35a[_0x28f0a8];return _0x33db97;};'use strict';var multer=require(_0xae35('0x0'));var util=require(_0xae35('0x1'));var path=require(_0xae35('0x2'));var timeout=require(_0xae35('0x3'));var express=require('express');var router=express[_0xae35('0x4')]();var fs_extra=require(_0xae35('0x5'));var auth=require(_0xae35('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae35('0x7'));var controller=require(_0xae35('0x8'));router['get']('/',auth[_0xae35('0x9')](),controller[_0xae35('0xa')]);router['get']('/describe',auth[_0xae35('0x9')](),controller[_0xae35('0xb')]);router[_0xae35('0xc')](_0xae35('0xd'),auth[_0xae35('0x9')](),controller[_0xae35('0xe')]);router[_0xae35('0xf')]('/',auth[_0xae35('0x9')](),interaction[_0xae35('0x10')]('chat',_0xae35('0x11')),controller['create']);router[_0xae35('0x12')](_0xae35('0xd'),controller[_0xae35('0x13')]);router[_0xae35('0x12')]('/:id/accept',auth[_0xae35('0x9')](),controller['accept']);router[_0xae35('0x12')](_0xae35('0x14'),auth[_0xae35('0x9')](),controller[_0xae35('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xae35('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 1f6489d..528e454 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x2f2b73,_0x4be42e){var _0x46903f=function(_0x5454d2){while(--_0x5454d2){_0x2f2b73['push'](_0x2f2b73['shift']());}};_0x46903f(++_0x4be42e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e90a0,_0x5c381e){_0x4e90a0=_0x4e90a0-0x0;var _0x3e1d60=_0x5f2f[_0x4e90a0];return _0x3e1d60;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['medium','TEXT','exports'];(function(_0x5758a9,_0x9b8d6a){var _0x124453=function(_0x34b011){while(--_0x34b011){_0x5758a9['push'](_0x5758a9['shift']());}};_0x124453(++_0x9b8d6a);}(_0xadb5,0xad));var _0x5adb=function(_0x1a3b2c,_0x700a46){_0x1a3b2c=_0x1a3b2c-0x0;var _0x2d17d1=_0xadb5[_0x1a3b2c];return _0x2d17d1;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 4022e3b..9f3ce5d 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(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x7a54,0x106));var _0x47a5=function(_0x5d5e8c,_0x202c81){_0x5d5e8c=_0x5d5e8c-0x0;var _0x37dda1=_0x7a54[_0x5d5e8c];return _0x37dda1;};'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 _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(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7a54,0x106));var _0x47a5=function(_0x210a22,_0x49b215){_0x210a22=_0x210a22-0x0;var _0x10ca4d=_0x7a54[_0x210a22];return _0x10ca4d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 603adbe..100c2ff 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45a4=['remove','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x2ac2de,_0x109a1e){var _0xf453a1=function(_0x44a302){while(--_0x44a302){_0x2ac2de['push'](_0x2ac2de['shift']());}};_0xf453a1(++_0x109a1e);}(_0x45a4,0xf3));var _0x445a=function(_0x17e006,_0x2886a6){_0x17e006=_0x17e006-0x0;var _0x527f32=_0x45a4[_0x17e006];return _0x527f32;};'use strict';var EventEmitter=require(_0x445a('0x0'));var ChatOfflineMessage=require(_0x445a('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x445a('0x2')](0x0);var events={'afterCreate':_0x445a('0x3'),'afterUpdate':_0x445a('0x4'),'afterDestroy':_0x445a('0x5')};function emitEvent(_0x8956e2){return function(_0x4c8b6c,_0x29892d,_0x5dcce2){ChatOfflineMessageEvents['emit'](_0x8956e2+':'+_0x4c8b6c['id'],_0x4c8b6c);ChatOfflineMessageEvents['emit'](_0x8956e2,_0x4c8b6c);_0x5dcce2(null);};}for(var e in events){if(events[_0x445a('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x445a('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x0186=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x179a0c,_0x2ca073){var _0x1c8b9a=function(_0xfa6124){while(--_0xfa6124){_0x179a0c['push'](_0x179a0c['shift']());}};_0x1c8b9a(++_0x2ca073);}(_0x0186,0x1f1));var _0x6018=function(_0x26b60a,_0x367a36){_0x26b60a=_0x26b60a-0x0;var _0x197815=_0x0186[_0x26b60a];return _0x197815;};'use strict';var EventEmitter=require(_0x6018('0x0'));var ChatOfflineMessage=require(_0x6018('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6018('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6018('0x3'),'afterDestroy':_0x6018('0x4')};function emitEvent(_0x48df36){return function(_0x1e93cc,_0x4cdde3,_0x56b6eb){ChatOfflineMessageEvents[_0x6018('0x5')](_0x48df36+':'+_0x1e93cc['id'],_0x1e93cc);ChatOfflineMessageEvents[_0x6018('0x5')](_0x48df36,_0x1e93cc);_0x56b6eb(null);};}for(var e in events){if(events[_0x6018('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x6018('0x7')](e,emitEvent(event));}}module[_0x6018('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 5b82450..fad775f 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 _0x2ed1=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x12d514,_0x17f823){var _0xa58573=function(_0x485748){while(--_0x485748){_0x12d514['push'](_0x12d514['shift']());}};_0xa58573(++_0x17f823);}(_0x2ed1,0xf3));var _0x12ed=function(_0x2abb5c,_0xf59bd){_0x2abb5c=_0x2abb5c-0x0;var _0x17ec75=_0x2ed1[_0x2abb5c];return _0x17ec75;};'use strict';var attributes=require(_0x12ed('0x0'));module[_0x12ed('0x1')]=function(_0x57176a){return _0x57176a['define'](_0x12ed('0x2'),attributes,{'tableName':_0x12ed('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12ed('0x4'),'collate':_0x12ed('0x5')});}; \ No newline at end of file +var _0xf83a=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x186ef9,_0x52607e){var _0x2aabf7=function(_0x53b782){while(--_0x53b782){_0x186ef9['push'](_0x186ef9['shift']());}};_0x2aabf7(++_0x52607e);}(_0xf83a,0x1d5));var _0xaf83=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xf83a[_0x1fdb40];return _0x281f93;};'use strict';var attributes=require(_0xaf83('0x0'));module[_0xaf83('0x1')]=function(_0x4069ed){return _0x4069ed[_0xaf83('0x2')](_0xaf83('0x3'),attributes,{'tableName':_0xaf83('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf83('0x5'),'collate':_0xaf83('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 69db1f4..9be4d74 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 _0xa994=['jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xbba12d,_0x17b51c){var _0x8d5a98=function(_0x58270e){while(--_0x58270e){_0xbba12d['push'](_0xbba12d['shift']());}};_0x8d5a98(++_0x17b51c);}(_0xa994,0x108));var _0x4a99=function(_0x69af90,_0x46c99d){_0x69af90=_0x69af90-0x0;var _0x3cc1d4=_0xa994[_0x69af90];return _0x3cc1d4;};'use strict';var _=require(_0x4a99('0x0'));var util=require(_0x4a99('0x1'));var moment=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var rs=require(_0x4a99('0x4'));var fs=require('fs');var Redis=require(_0x4a99('0x5'));var db=require(_0x4a99('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));var config=require('../../config/environment');var jayson=require(_0x4a99('0x9'));var client=jayson['client'][_0x4a99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x280804,_0x2fda1d,_0x699bfc){return new BPromise(function(_0x17195c,_0x3ff23c){return client[_0x4a99('0xb')](_0x280804,_0x699bfc)[_0x4a99('0xc')](function(_0x20c347){logger[_0x4a99('0xd')](_0x4a99('0xe'),_0x2fda1d,_0x4a99('0xf'));logger[_0x4a99('0x10')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2fda1d,_0x4a99('0xf'),JSON[_0x4a99('0x11')](_0x20c347));if(_0x20c347[_0x4a99('0x12')]){if(_0x20c347[_0x4a99('0x12')]['code']===0x1f4){logger['error'](_0x4a99('0xe'),_0x2fda1d,_0x20c347[_0x4a99('0x12')][_0x4a99('0x13')]);return _0x3ff23c(_0x20c347[_0x4a99('0x12')][_0x4a99('0x13')]);}logger[_0x4a99('0x12')](_0x4a99('0xe'),_0x2fda1d,_0x20c347['error']['message']);return _0x17195c(_0x20c347[_0x4a99('0x12')][_0x4a99('0x13')]);}else{logger[_0x4a99('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2fda1d,'request\x20sent');_0x17195c(_0x20c347[_0x4a99('0x14')][_0x4a99('0x13')]);}})['catch'](function(_0x4d9088){logger[_0x4a99('0x12')](_0x4a99('0xe'),_0x2fda1d,_0x4d9088);_0x3ff23c(_0x4d9088);});});} \ No newline at end of file +var _0xb7b6=['then','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0xac9730,_0xc2ae15){var _0x5378a4=function(_0x602edd){while(--_0x602edd){_0xac9730['push'](_0xac9730['shift']());}};_0x5378a4(++_0xc2ae15);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x844c1b,_0x28bd7f){_0x844c1b=_0x844c1b-0x0;var _0x11ad15=_0xb7b6[_0x844c1b];return _0x11ad15;};'use strict';var _=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b7b('0x2'));var fs=require('fs');var Redis=require(_0x6b7b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b7b('0x4'));var logger=require(_0x6b7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b7b('0x6'));var client=jayson[_0x6b7b('0x7')][_0x6b7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xff519e,_0x24359f,_0x483b9c){return new BPromise(function(_0x49a6c8,_0x2bb86d){return client[_0x6b7b('0x9')](_0xff519e,_0x483b9c)[_0x6b7b('0xa')](function(_0x115f2d){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x24359f,'request\x20sent');logger[_0x6b7b('0xb')](_0x6b7b('0xc'),_0x24359f,_0x6b7b('0xd'),JSON[_0x6b7b('0xe')](_0x115f2d));if(_0x115f2d[_0x6b7b('0xf')]){if(_0x115f2d[_0x6b7b('0xf')]['code']===0x1f4){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x115f2d['error'][_0x6b7b('0x11')]);return _0x2bb86d(_0x115f2d[_0x6b7b('0xf')]['message']);}logger[_0x6b7b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x24359f,_0x115f2d[_0x6b7b('0xf')][_0x6b7b('0x11')]);return _0x49a6c8(_0x115f2d[_0x6b7b('0xf')]['message']);}else{logger['info'](_0x6b7b('0x10'),_0x24359f,'request\x20sent');_0x49a6c8(_0x115f2d['result'][_0x6b7b('0x11')]);}})[_0x6b7b('0x12')](function(_0x4ef35b){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x4ef35b);_0x2bb86d(_0x4ef35b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3a40dfa..24436c2 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 _0x9288=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','post','create','update','destroy','exports','util','connect-timeout'];(function(_0x32f38b,_0x1b4fc7){var _0x15ec9b=function(_0x1331da){while(--_0x1331da){_0x32f38b['push'](_0x32f38b['shift']());}};_0x15ec9b(++_0x1b4fc7);}(_0x9288,0x1c9));var _0x8928=function(_0x10529b,_0x187296){_0x10529b=_0x10529b-0x0;var _0x3548ef=_0x9288[_0x10529b];return _0x3548ef;};'use strict';var multer=require('multer');var util=require(_0x8928('0x0'));var path=require('path');var timeout=require(_0x8928('0x1'));var express=require(_0x8928('0x2'));var router=express[_0x8928('0x3')]();var fs_extra=require(_0x8928('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8928('0x5'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x8928('0x6')]('/',auth[_0x8928('0x7')](),controller[_0x8928('0x8')]);router['get']('/describe',auth[_0x8928('0x7')](),controller[_0x8928('0x9')]);router[_0x8928('0x6')](_0x8928('0xa'),auth['isAuthenticated'](),controller[_0x8928('0xb')]);router[_0x8928('0xc')]('/',auth['isAuthenticated'](),controller[_0x8928('0xd')]);router['put'](_0x8928('0xa'),auth['isAuthenticated'](),controller[_0x8928('0xe')]);router['delete'](_0x8928('0xa'),auth[_0x8928('0x7')](),controller[_0x8928('0xf')]);module[_0x8928('0x10')]=router; \ No newline at end of file +var _0xc199=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x4a73dd,_0x58e46c){var _0x279e6b=function(_0x25254b){while(--_0x25254b){_0x4a73dd['push'](_0x4a73dd['shift']());}};_0x279e6b(++_0x58e46c);}(_0xc199,0x172));var _0x9c19=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc199[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x9c19('0x0'));var util=require('util');var path=require(_0x9c19('0x1'));var timeout=require(_0x9c19('0x2'));var express=require(_0x9c19('0x3'));var router=express[_0x9c19('0x4')]();var fs_extra=require(_0x9c19('0x5'));var auth=require(_0x9c19('0x6'));var interaction=require(_0x9c19('0x7'));var config=require(_0x9c19('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x9c19('0x9')](),controller[_0x9c19('0xa')]);router[_0x9c19('0xb')](_0x9c19('0xc'),auth[_0x9c19('0x9')](),controller[_0x9c19('0xd')]);router[_0x9c19('0xb')]('/:id',auth[_0x9c19('0x9')](),controller[_0x9c19('0xe')]);router[_0x9c19('0xf')]('/',auth[_0x9c19('0x9')](),controller[_0x9c19('0x10')]);router[_0x9c19('0x11')](_0x9c19('0x12'),auth['isAuthenticated'](),controller[_0x9c19('0x13')]);router[_0x9c19('0x14')](_0x9c19('0x12'),auth['isAuthenticated'](),controller[_0x9c19('0x15')]);module[_0x9c19('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 14988a9..671b0db 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 _0x88a1=['ENUM','mouseOver','timeout','STRING','INTEGER','exports'];(function(_0x293881,_0x485041){var _0x2c7e9f=function(_0x5359bc){while(--_0x5359bc){_0x293881['push'](_0x293881['shift']());}};_0x2c7e9f(++_0x485041);}(_0x88a1,0x149));var _0x188a=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x88a1[_0x45c262];return _0x4f2ba6;};'use strict';var Sequelize=require('sequelize');module[_0x188a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x188a('0x1')](_0x188a('0x2'),_0x188a('0x3')),'defaultValue':_0x188a('0x2')},'selector':{'type':Sequelize[_0x188a('0x4')]},'timeout':{'type':Sequelize[_0x188a('0x5')]}}; \ No newline at end of file +var _0x4da7=['mouseOver'];(function(_0x3c6207,_0x3c9b77){var _0x3ea118=function(_0x232fcf){while(--_0x232fcf){_0x3c6207['push'](_0x3c6207['shift']());}};_0x3ea118(++_0x3c9b77);}(_0x4da7,0xec));var _0x74da=function(_0x2c6659,_0x562ebd){_0x2c6659=_0x2c6659-0x0;var _0x3c5675=_0x4da7[_0x2c6659];return _0x3c5675;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x74da('0x0')},'selector':{'type':Sequelize['STRING']},'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 5f23056..846a2e5 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 _0x0ec6=['query','filters','attributes','intersection','fields','length','includeAll','merge','options','ChatProactiveAction','find','then','catch','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','show','params','model','rawAttributes'];(function(_0x281413,_0x12e45f){var _0x4784dd=function(_0x470ca2){while(--_0x470ca2){_0x281413['push'](_0x281413['shift']());}};_0x4784dd(++_0x12e45f);}(_0x0ec6,0x1f1));var _0x60ec=function(_0xb0773e,_0x191d43){_0xb0773e=_0xb0773e-0x0;var _0x2a7f49=_0x0ec6[_0xb0773e];return _0x2a7f49;};'use strict';var emlformat=require(_0x60ec('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ec('0x1'));var rp=require(_0x60ec('0x2'));var moment=require(_0x60ec('0x3'));var BPromise=require(_0x60ec('0x4'));var Mustache=require(_0x60ec('0x5'));var util=require(_0x60ec('0x6'));var path=require(_0x60ec('0x7'));var sox=require('sox');var csv=require(_0x60ec('0x8'));var ejs=require(_0x60ec('0x9'));var fs=require('fs');var fs_extra=require(_0x60ec('0xa'));var _=require(_0x60ec('0xb'));var squel=require('squel');var crypto=require(_0x60ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60ec('0xd'));var toCsv=require(_0x60ec('0x8'));var querystring=require(_0x60ec('0xe'));var Papa=require(_0x60ec('0xf'));var Redis=require(_0x60ec('0x10'));var authService=require(_0x60ec('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60ec('0x12'));var logger=require(_0x60ec('0x13'))(_0x60ec('0x14'));var utils=require(_0x60ec('0x15'));var config=require(_0x60ec('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28cabb,_0x41621a){_0x41621a=_0x41621a||0xcc;return function(_0x103a72){if(_0x103a72){return _0x28cabb[_0x60ec('0x17')](_0x41621a);}return _0x28cabb[_0x60ec('0x18')](_0x41621a)['end']();};}function respondWithResult(_0x21af57,_0x456fb5){_0x456fb5=_0x456fb5||0xc8;return function(_0x22fdb1){if(_0x22fdb1){return _0x21af57[_0x60ec('0x18')](_0x456fb5)[_0x60ec('0x19')](_0x22fdb1);}};}function respondWithFilteredResult(_0x23298f,_0x1f7c76){return function(_0x19dd55){if(_0x19dd55){var _0x448553=typeof _0x1f7c76['offset']===_0x60ec('0x1a')&&typeof _0x1f7c76[_0x60ec('0x1b')]===_0x60ec('0x1a');var _0x155bdc=_0x19dd55[_0x60ec('0x1c')];var _0x222c38=_0x448553?0x0:_0x1f7c76[_0x60ec('0x1d')];var _0x13052c=_0x448553?_0x19dd55[_0x60ec('0x1c')]:_0x1f7c76[_0x60ec('0x1d')]+_0x1f7c76[_0x60ec('0x1b')];var _0x1bdc45;if(_0x13052c>=_0x155bdc){_0x13052c=_0x155bdc;_0x1bdc45=0xc8;}else{_0x1bdc45=0xce;}_0x23298f['status'](_0x1bdc45);return _0x23298f[_0x60ec('0x1e')](_0x60ec('0x1f'),_0x222c38+'-'+_0x13052c+'/'+_0x155bdc)[_0x60ec('0x19')](_0x19dd55);}return null;};}function patchUpdates(_0x278ae3){return function(_0x5cace8){try{jsonpatch[_0x60ec('0x20')](_0x5cace8,_0x278ae3,!![]);}catch(_0x3e152c){return BPromise[_0x60ec('0x21')](_0x3e152c);}return _0x5cace8[_0x60ec('0x22')]();};}function saveUpdates(_0x3ab7ef,_0x354f08){return function(_0x492dfa){if(_0x492dfa){return _0x492dfa['update'](_0x3ab7ef)['then'](function(_0x1476c6){return _0x1476c6;});}return null;};}function removeEntity(_0x1080c0,_0x1f0ce7){return function(_0x1fd96e){if(_0x1fd96e){return _0x1fd96e['destroy']()['then'](function(){_0x1080c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x317b9a,_0x474374){return function(_0x42d1c2){if(!_0x42d1c2){_0x317b9a[_0x60ec('0x17')](0x194);}return _0x42d1c2;};}function handleError(_0xd4ac40,_0x3d31b7){_0x3d31b7=_0x3d31b7||0x1f4;return function(_0x155c82){logger[_0x60ec('0x23')](_0x155c82[_0x60ec('0x24')]);if(_0x155c82['name']){delete _0x155c82[_0x60ec('0x25')];}_0xd4ac40[_0x60ec('0x18')](_0x3d31b7)[_0x60ec('0x26')](_0x155c82);};}exports[_0x60ec('0x27')]=function(_0xf3817d,_0x3423fb){var _0x1b912c={'raw':!![],'where':{'id':_0xf3817d[_0x60ec('0x28')]['id']}},_0x4440c7={};_0x4440c7[_0x60ec('0x29')]=_['keys'](db['ChatProactiveAction'][_0x60ec('0x2a')]);_0x4440c7[_0x60ec('0x2b')]=_['keys'](_0xf3817d['query']);_0x4440c7[_0x60ec('0x2c')]=_['intersection'](_0x4440c7[_0x60ec('0x29')],_0x4440c7[_0x60ec('0x2b')]);_0x1b912c[_0x60ec('0x2d')]=_[_0x60ec('0x2e')](_0x4440c7[_0x60ec('0x29')],qs['fields'](_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x2f')]));_0x1b912c[_0x60ec('0x2d')]=_0x1b912c[_0x60ec('0x2d')][_0x60ec('0x30')]?_0x1b912c[_0x60ec('0x2d')]:_0x4440c7['model'];if(_0xf3817d[_0x60ec('0x2b')][_0x60ec('0x31')]){_0x1b912c['include']=[{'all':!![]}];}_0x1b912c=_[_0x60ec('0x32')]({},_0x1b912c,_0xf3817d[_0x60ec('0x33')]);return db[_0x60ec('0x34')][_0x60ec('0x35')](_0x1b912c)['then'](handleEntityNotFound(_0x3423fb,null))[_0x60ec('0x36')](respondWithResult(_0x3423fb,null))[_0x60ec('0x37')](handleError(_0x3423fb,null));};exports[_0x60ec('0x38')]=function(_0x3c0903,_0x3dc544){return db[_0x60ec('0x34')][_0x60ec('0x38')](_0x3c0903[_0x60ec('0x39')],{})[_0x60ec('0x36')](respondWithResult(_0x3dc544,0xc9))[_0x60ec('0x37')](handleError(_0x3dc544,null));};exports[_0x60ec('0x3a')]=function(_0x36f3bf,_0x38e5c4){if(_0x36f3bf[_0x60ec('0x39')]['id']){delete _0x36f3bf[_0x60ec('0x39')]['id'];}return db[_0x60ec('0x34')][_0x60ec('0x35')]({'where':{'id':_0x36f3bf['params']['id']}})[_0x60ec('0x36')](handleEntityNotFound(_0x38e5c4,null))[_0x60ec('0x36')](saveUpdates(_0x36f3bf['body'],null))[_0x60ec('0x36')](respondWithResult(_0x38e5c4,null))['catch'](handleError(_0x38e5c4,null));};exports[_0x60ec('0x3b')]=function(_0x2a44cc,_0x1b11fd){return db[_0x60ec('0x34')][_0x60ec('0x35')]({'where':{'id':_0x2a44cc[_0x60ec('0x28')]['id']}})[_0x60ec('0x36')](handleEntityNotFound(_0x1b11fd,null))['then'](removeEntity(_0x1b11fd,null))['catch'](handleError(_0x1b11fd,null));}; \ No newline at end of file +var _0x2427=['sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','include','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','set','apply','reject','save','update','destroy','then'];(function(_0x1be3f6,_0x31704a){var _0x50336a=function(_0x285e56){while(--_0x285e56){_0x1be3f6['push'](_0x1be3f6['shift']());}};_0x50336a(++_0x31704a);}(_0x2427,0x165));var _0x7242=function(_0x4828b8,_0xaf9d1e){_0x4828b8=_0x4828b8-0x0;var _0x3cbb3f=_0x2427[_0x4828b8];return _0x3cbb3f;};'use strict';var emlformat=require(_0x7242('0x0'));var rimraf=require(_0x7242('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7242('0x2'));var rp=require('request-promise');var moment=require(_0x7242('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7242('0x4'));var util=require(_0x7242('0x5'));var path=require(_0x7242('0x6'));var sox=require('sox');var csv=require(_0x7242('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7242('0x8'));var _=require(_0x7242('0x9'));var squel=require(_0x7242('0xa'));var crypto=require(_0x7242('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7242('0xc'));var toCsv=require(_0x7242('0x7'));var querystring=require('querystring');var Papa=require(_0x7242('0xd'));var Redis=require(_0x7242('0xe'));var authService=require(_0x7242('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7242('0x10'));var hardwareService=require(_0x7242('0x11'));var logger=require(_0x7242('0x12'))(_0x7242('0x13'));var utils=require('../../config/utils');var config=require(_0x7242('0x14'));var licenseUtil=require(_0x7242('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2efc1e,_0x406138){_0x406138=_0x406138||0xcc;return function(_0x438ff5){if(_0x438ff5){return _0x2efc1e['sendStatus'](_0x406138);}return _0x2efc1e['status'](_0x406138)[_0x7242('0x16')]();};}function respondWithResult(_0x4e8042,_0x22af73){_0x22af73=_0x22af73||0xc8;return function(_0x375ca6){if(_0x375ca6){return _0x4e8042[_0x7242('0x17')](_0x22af73)[_0x7242('0x18')](_0x375ca6);}};}function respondWithFilteredResult(_0x461f20,_0x13e8c9){return function(_0x3ef574){if(_0x3ef574){var _0x4db26b=typeof _0x13e8c9[_0x7242('0x19')]==='undefined'&&typeof _0x13e8c9[_0x7242('0x1a')]===_0x7242('0x1b');var _0x4828a0=_0x3ef574['count'];var _0x58ccfc=_0x4db26b?0x0:_0x13e8c9[_0x7242('0x19')];var _0xf7f7f9=_0x4db26b?_0x3ef574['count']:_0x13e8c9['offset']+_0x13e8c9['limit'];var _0x1214c4;if(_0xf7f7f9>=_0x4828a0){_0xf7f7f9=_0x4828a0;_0x1214c4=0xc8;}else{_0x1214c4=0xce;}_0x461f20['status'](_0x1214c4);return _0x461f20[_0x7242('0x1c')]('Content-Range',_0x58ccfc+'-'+_0xf7f7f9+'/'+_0x4828a0)[_0x7242('0x18')](_0x3ef574);}return null;};}function patchUpdates(_0x32f42b){return function(_0xb3a27f){try{jsonpatch[_0x7242('0x1d')](_0xb3a27f,_0x32f42b,!![]);}catch(_0xd68b73){return BPromise[_0x7242('0x1e')](_0xd68b73);}return _0xb3a27f[_0x7242('0x1f')]();};}function saveUpdates(_0x4bf6a6,_0x2fd572){return function(_0x36fc79){if(_0x36fc79){return _0x36fc79[_0x7242('0x20')](_0x4bf6a6)['then'](function(_0x32cef6){return _0x32cef6;});}return null;};}function removeEntity(_0x69b776,_0xee9c58){return function(_0x28ea5d){if(_0x28ea5d){return _0x28ea5d[_0x7242('0x21')]()[_0x7242('0x22')](function(){_0x69b776[_0x7242('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce2b2,_0x42ad68){return function(_0x41e5a5){if(!_0x41e5a5){_0x4ce2b2[_0x7242('0x23')](0x194);}return _0x41e5a5;};}function handleError(_0x2b2c95,_0x111bf6){_0x111bf6=_0x111bf6||0x1f4;return function(_0x241ec1){logger[_0x7242('0x24')](_0x241ec1['stack']);if(_0x241ec1[_0x7242('0x25')]){delete _0x241ec1[_0x7242('0x25')];}_0x2b2c95[_0x7242('0x17')](_0x111bf6)['send'](_0x241ec1);};}exports[_0x7242('0x26')]=function(_0x37b063,_0x1c59d0){var _0x32ccf2={'raw':!![],'where':{'id':_0x37b063[_0x7242('0x27')]['id']}},_0x140a72={};_0x140a72['model']=_[_0x7242('0x28')](db[_0x7242('0x29')][_0x7242('0x2a')]);_0x140a72[_0x7242('0x2b')]=_['keys'](_0x37b063[_0x7242('0x2b')]);_0x140a72[_0x7242('0x2c')]=_[_0x7242('0x2d')](_0x140a72[_0x7242('0x2e')],_0x140a72[_0x7242('0x2b')]);_0x32ccf2['attributes']=_[_0x7242('0x2d')](_0x140a72[_0x7242('0x2e')],qs['fields'](_0x37b063[_0x7242('0x2b')][_0x7242('0x2f')]));_0x32ccf2[_0x7242('0x30')]=_0x32ccf2['attributes'][_0x7242('0x31')]?_0x32ccf2['attributes']:_0x140a72['model'];if(_0x37b063[_0x7242('0x2b')]['includeAll']){_0x32ccf2[_0x7242('0x32')]=[{'all':!![]}];}_0x32ccf2=_['merge']({},_0x32ccf2,_0x37b063[_0x7242('0x33')]);return db[_0x7242('0x29')][_0x7242('0x34')](_0x32ccf2)['then'](handleEntityNotFound(_0x1c59d0,null))['then'](respondWithResult(_0x1c59d0,null))[_0x7242('0x35')](handleError(_0x1c59d0,null));};exports[_0x7242('0x36')]=function(_0x33eead,_0x164a6a){return db[_0x7242('0x29')][_0x7242('0x36')](_0x33eead['body'],{})[_0x7242('0x22')](respondWithResult(_0x164a6a,0xc9))['catch'](handleError(_0x164a6a,null));};exports[_0x7242('0x20')]=function(_0x2cc7f8,_0x2645eb){if(_0x2cc7f8[_0x7242('0x37')]['id']){delete _0x2cc7f8[_0x7242('0x37')]['id'];}return db['ChatProactiveAction'][_0x7242('0x34')]({'where':{'id':_0x2cc7f8[_0x7242('0x27')]['id']}})[_0x7242('0x22')](handleEntityNotFound(_0x2645eb,null))[_0x7242('0x22')](saveUpdates(_0x2cc7f8[_0x7242('0x37')],null))[_0x7242('0x22')](respondWithResult(_0x2645eb,null))[_0x7242('0x35')](handleError(_0x2645eb,null));};exports[_0x7242('0x21')]=function(_0xf409f7,_0x54bb65){return db[_0x7242('0x29')][_0x7242('0x34')]({'where':{'id':_0xf409f7[_0x7242('0x27')]['id']}})[_0x7242('0x22')](handleEntityNotFound(_0x54bb65,null))['then'](removeEntity(_0x54bb65,null))['catch'](handleError(_0x54bb65,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7aaf46f..2fe78b7 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 _0xb142=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb142,0x191));var _0x2b14=function(_0x21da87,_0xa9aac7){_0x21da87=_0x21da87-0x0;var _0x4e65d6=_0xb142[_0x21da87];return _0x4e65d6;};'use strict';var _=require(_0x2b14('0x0'));var util=require(_0x2b14('0x1'));var logger=require(_0x2b14('0x2'))(_0x2b14('0x3'));var moment=require(_0x2b14('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b14('0x5'));var fs=require('fs');var path=require(_0x2b14('0x6'));var rimraf=require(_0x2b14('0x7'));var config=require(_0x2b14('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x2b14('0x9')]=function(_0x128884,_0x29f68a){return _0x128884[_0x2b14('0xa')](_0x2b14('0xb'),attributes,{'tableName':_0x2b14('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x744d=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x22cc9b,_0x4db415){var _0x51aa40=function(_0xa18962){while(--_0xa18962){_0x22cc9b['push'](_0x22cc9b['shift']());}};_0x51aa40(++_0x4db415);}(_0x744d,0x154));var _0xd744=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x744d[_0x3430aa];return _0x2ac5c;};'use strict';var _=require(_0xd744('0x0'));var util=require(_0xd744('0x1'));var logger=require(_0xd744('0x2'))('api');var moment=require(_0xd744('0x3'));var BPromise=require(_0xd744('0x4'));var rp=require(_0xd744('0x5'));var fs=require('fs');var path=require(_0xd744('0x6'));var rimraf=require(_0xd744('0x7'));var config=require(_0xd744('0x8'));var attributes=require(_0xd744('0x9'));module[_0xd744('0xa')]=function(_0x55c4c0,_0x2de0db){return _0x55c4c0['define'](_0xd744('0xb'),attributes,{'tableName':_0xd744('0xc'),'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 ad92bff..5658bde 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 _0x4af4=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x139c54,_0x37be95){var _0x27bba0=function(_0x167f08){while(--_0x167f08){_0x139c54['push'](_0x139c54['shift']());}};_0x27bba0(++_0x37be95);}(_0x4af4,0xb9));var _0x44af=function(_0x15996c,_0x284970){_0x15996c=_0x15996c-0x0;var _0x1b235a=_0x4af4[_0x15996c];return _0x1b235a;};'use strict';var _=require(_0x44af('0x0'));var util=require(_0x44af('0x1'));var moment=require(_0x44af('0x2'));var BPromise=require(_0x44af('0x3'));var rs=require(_0x44af('0x4'));var fs=require('fs');var Redis=require(_0x44af('0x5'));var db=require(_0x44af('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x44af('0x7'));var config=require(_0x44af('0x8'));var jayson=require(_0x44af('0x9'));var client=jayson[_0x44af('0xa')][_0x44af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25f658,_0x7d23d8,_0x20b74e){return new BPromise(function(_0x8f7152,_0x517a94){return client[_0x44af('0xc')](_0x25f658,_0x20b74e)[_0x44af('0xd')](function(_0x2bd2a8){logger[_0x44af('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x7d23d8,'request\x20sent');logger[_0x44af('0xf')](_0x44af('0x10'),_0x7d23d8,_0x44af('0x11'),JSON[_0x44af('0x12')](_0x2bd2a8));if(_0x2bd2a8[_0x44af('0x13')]){if(_0x2bd2a8['error'][_0x44af('0x14')]===0x1f4){logger[_0x44af('0x13')](_0x44af('0x15'),_0x7d23d8,_0x2bd2a8[_0x44af('0x13')][_0x44af('0x16')]);return _0x517a94(_0x2bd2a8[_0x44af('0x13')][_0x44af('0x16')]);}logger['error'](_0x44af('0x15'),_0x7d23d8,_0x2bd2a8[_0x44af('0x13')][_0x44af('0x16')]);return _0x8f7152(_0x2bd2a8['error'][_0x44af('0x16')]);}else{logger[_0x44af('0xe')](_0x44af('0x15'),_0x7d23d8,'request\x20sent');_0x8f7152(_0x2bd2a8['result']['message']);}})['catch'](function(_0x2d08b1){logger[_0x44af('0x13')](_0x44af('0x15'),_0x7d23d8,_0x2d08b1);_0x517a94(_0x2d08b1);});});} \ No newline at end of file +var _0x2e43=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2e43,0x182));var _0x32e4=function(_0x43a251,_0x2ca1b8){_0x43a251=_0x43a251-0x0;var _0x15f782=_0x2e43[_0x43a251];return _0x15f782;};'use strict';var _=require('lodash');var util=require(_0x32e4('0x0'));var moment=require(_0x32e4('0x1'));var BPromise=require(_0x32e4('0x2'));var rs=require(_0x32e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32e4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32e4('0x5'));var config=require(_0x32e4('0x6'));var jayson=require(_0x32e4('0x7'));var client=jayson[_0x32e4('0x8')][_0x32e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x231bc6,_0x257af,_0x3cccc3){return new BPromise(function(_0x2c71df,_0x498fe1){return client[_0x32e4('0xa')](_0x231bc6,_0x3cccc3)[_0x32e4('0xb')](function(_0x4b56db){logger[_0x32e4('0xc')](_0x32e4('0xd'),_0x257af,_0x32e4('0xe'));logger['debug'](_0x32e4('0xf'),_0x257af,_0x32e4('0xe'),JSON[_0x32e4('0x10')](_0x4b56db));if(_0x4b56db[_0x32e4('0x11')]){if(_0x4b56db[_0x32e4('0x11')][_0x32e4('0x12')]===0x1f4){logger[_0x32e4('0x11')](_0x32e4('0xd'),_0x257af,_0x4b56db['error'][_0x32e4('0x13')]);return _0x498fe1(_0x4b56db[_0x32e4('0x11')][_0x32e4('0x13')]);}logger[_0x32e4('0x11')](_0x32e4('0xd'),_0x257af,_0x4b56db[_0x32e4('0x11')][_0x32e4('0x13')]);return _0x2c71df(_0x4b56db[_0x32e4('0x11')][_0x32e4('0x13')]);}else{logger[_0x32e4('0xc')](_0x32e4('0xd'),_0x257af,_0x32e4('0xe'));_0x2c71df(_0x4b56db[_0x32e4('0x14')]['message']);}})[_0x32e4('0x15')](function(_0x597db0){logger[_0x32e4('0x11')](_0x32e4('0xd'),_0x257af,_0x597db0);_0x498fe1(_0x597db0);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 660a76d..dba9a3f 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 _0xc4aa=['show','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x4f749a,_0x2fd382){var _0x5a737e=function(_0x1af93b){while(--_0x1af93b){_0x4f749a['push'](_0x4f749a['shift']());}};_0x5a737e(++_0x2fd382);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4aa[_0x465a0c];return _0x1e202e;};'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')](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xb')]);router[_0xac4a('0xc')]('/',auth[_0xac4a('0xa')](),controller['create']);router['put'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xd')]);router['delete'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x63c794,_0x14f52c){var _0x16f319=function(_0x149940){while(--_0x149940){_0x63c794['push'](_0x63c794['shift']());}};_0x16f319(++_0x14f52c);}(_0x4819,0xcd));var _0x9481=function(_0x47d1ae,_0x41e056){_0x47d1ae=_0x47d1ae-0x0;var _0x47328a=_0x4819[_0x47d1ae];return _0x47328a;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('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 bd60898..d5e585e 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 _0x9a37=['beepall','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x34d1c7,_0x3684ef){var _0x34ad44=function(_0x30886e){while(--_0x30886e){_0x34d1c7['push'](_0x34d1c7['shift']());}};_0x34ad44(++_0x3684ef);}(_0x9a37,0xec));var _0x79a3=function(_0x4f4c11,_0xdb6add){_0x4f4c11=_0x4f4c11-0x0;var _0x4dfd33=_0x9a37[_0x4f4c11];return _0x4dfd33;};'use strict';var Sequelize=require('sequelize');module[_0x79a3('0x0')]={'name':{'type':Sequelize[_0x79a3('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x79a3('0x1')]},'timeout':{'type':Sequelize[_0x79a3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x79a3('0x3')]('rrmemory',_0x79a3('0x4'),_0x79a3('0x5'))}}; \ No newline at end of file +var _0xfa52=['sequelize','exports','name','STRING','rrmemory','beepall'];(function(_0x5527c5,_0x472828){var _0x3cf085=function(_0x4bbdb2){while(--_0x4bbdb2){_0x5527c5['push'](_0x5527c5['shift']());}};_0x3cf085(++_0x472828);}(_0xfa52,0x162));var _0x2fa5=function(_0x18bce2,_0x8fba74){_0x18bce2=_0x18bce2-0x0;var _0x10f149=_0xfa52[_0x18bce2];return _0x10f149;};'use strict';var Sequelize=require(_0x2fa5('0x0'));module[_0x2fa5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2fa5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2fa5('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2fa5('0x4'),_0x2fa5('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index e18901e..28b13a9 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 _0xfec4=['QueryTypes','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','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','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','get','ChatQueues','destroy','stack','name','send','index','rawAttributes','type','key','map','query','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','findAll','rows','params','keys','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','UserId','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','options','getTeams','addTeams','User','Agents','online','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString'];(function(_0x255c64,_0x26b3dc){var _0x4816df=function(_0x595571){while(--_0x595571){_0x255c64['push'](_0x255c64['shift']());}};_0x4816df(++_0x26b3dc);}(_0xfec4,0xaf));var _0x4fec=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xfec4[_0x16629d];return _0x56ccee;};'use strict';var emlformat=require(_0x4fec('0x0'));var rimraf=require(_0x4fec('0x1'));var zipdir=require(_0x4fec('0x2'));var jsonpatch=require(_0x4fec('0x3'));var rp=require(_0x4fec('0x4'));var moment=require(_0x4fec('0x5'));var BPromise=require(_0x4fec('0x6'));var Mustache=require('mustache');var util=require(_0x4fec('0x7'));var path=require(_0x4fec('0x8'));var sox=require(_0x4fec('0x9'));var csv=require(_0x4fec('0xa'));var ejs=require(_0x4fec('0xb'));var fs=require('fs');var fs_extra=require(_0x4fec('0xc'));var _=require(_0x4fec('0xd'));var squel=require(_0x4fec('0xe'));var crypto=require(_0x4fec('0xf'));var jsforce=require(_0x4fec('0x10'));var deskjs=require(_0x4fec('0x11'));var toCsv=require(_0x4fec('0xa'));var querystring=require(_0x4fec('0x12'));var Papa=require(_0x4fec('0x13'));var Redis=require(_0x4fec('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x4fec('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fec('0x16'));var logger=require(_0x4fec('0x17'))(_0x4fec('0x18'));var utils=require(_0x4fec('0x19'));var config=require(_0x4fec('0x1a'));var licenseUtil=require(_0x4fec('0x1b'));var db=require(_0x4fec('0x1c'))['db'];config[_0x4fec('0x1d')]=_[_0x4fec('0x1e')](config[_0x4fec('0x1d')],{'host':_0x4fec('0x1f'),'port':0x18eb});var socket=require(_0x4fec('0x20'))(new Redis(config['redis']));require(_0x4fec('0x21'))[_0x4fec('0x22')](socket);var jayson=require(_0x4fec('0x23'));var client=jayson[_0x4fec('0x24')][_0x4fec('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x17c26d,_0x2cde1c,_0x2b11e4,_0x5443fb){return new BPromise(function(_0x320949,_0x2278e3){var _0x5c0918=_0x5443fb||client;return _0x5c0918[_0x4fec('0x26')](_0x17c26d,_0x2b11e4)[_0x4fec('0x27')](function(_0x478e82){logger[_0x4fec('0x28')](_0x4fec('0x29'),_0x2cde1c,_0x4fec('0x2a'));logger[_0x4fec('0x2b')](_0x4fec('0x2c'),_0x2cde1c,'request\x20sent',JSON[_0x4fec('0x2d')](_0x478e82));if(_0x478e82[_0x4fec('0x2e')]){if(_0x478e82['error'][_0x4fec('0x2f')]===0x1f4){logger[_0x4fec('0x2e')](_0x4fec('0x29'),_0x2cde1c,_0x478e82[_0x4fec('0x2e')][_0x4fec('0x30')]);return _0x2278e3(_0x478e82[_0x4fec('0x2e')][_0x4fec('0x30')]);}logger[_0x4fec('0x2e')]('ChatQueue,\x20%s,\x20%s',_0x2cde1c,_0x478e82[_0x4fec('0x2e')][_0x4fec('0x30')]);return _0x320949(_0x478e82[_0x4fec('0x2e')][_0x4fec('0x30')]);}else{logger[_0x4fec('0x28')](_0x4fec('0x29'),_0x2cde1c,_0x4fec('0x2a'));_0x320949(_0x478e82['result'][_0x4fec('0x30')]);}})[_0x4fec('0x31')](function(_0x17f5aa){logger[_0x4fec('0x2e')]('ChatQueue,\x20%s,\x20%s',_0x2cde1c,_0x17f5aa);_0x2278e3(_0x17f5aa);});});}function respondWithStatusCode(_0x344af1,_0x2b5812){_0x2b5812=_0x2b5812||0xcc;return function(_0x2c0701){if(_0x2c0701){return _0x344af1[_0x4fec('0x32')](_0x2b5812);}return _0x344af1[_0x4fec('0x33')](_0x2b5812)[_0x4fec('0x34')]();};}function respondWithResult(_0x362972,_0x51f1bf){_0x51f1bf=_0x51f1bf||0xc8;return function(_0x1ada44){if(_0x1ada44){return _0x362972[_0x4fec('0x33')](_0x51f1bf)[_0x4fec('0x35')](_0x1ada44);}};}function respondWithFilteredResult(_0x58aa1e,_0x468e7a){return function(_0x4da6b7){if(_0x4da6b7){var _0x10f00e=typeof _0x468e7a[_0x4fec('0x36')]==='undefined'&&typeof _0x468e7a[_0x4fec('0x37')]===_0x4fec('0x38');var _0x2e9488=_0x4da6b7[_0x4fec('0x39')];var _0x5e8630=_0x10f00e?0x0:_0x468e7a[_0x4fec('0x36')];var _0x59ac84=_0x10f00e?_0x4da6b7[_0x4fec('0x39')]:_0x468e7a[_0x4fec('0x36')]+_0x468e7a['limit'];var _0x5e071c;if(_0x59ac84>=_0x2e9488){_0x59ac84=_0x2e9488;_0x5e071c=0xc8;}else{_0x5e071c=0xce;}_0x58aa1e['status'](_0x5e071c);return _0x58aa1e['set'](_0x4fec('0x3a'),_0x5e8630+'-'+_0x59ac84+'/'+_0x2e9488)['json'](_0x4da6b7);}return null;};}function patchUpdates(_0x2b0a9a){return function(_0x1e5fb7){try{jsonpatch[_0x4fec('0x3b')](_0x1e5fb7,_0x2b0a9a,!![]);}catch(_0x1df778){return BPromise[_0x4fec('0x3c')](_0x1df778);}return _0x1e5fb7[_0x4fec('0x3d')]();};}function saveUpdates(_0x1e9d6d,_0x21c5db){return function(_0x9379cc){if(_0x9379cc){return _0x9379cc['update'](_0x1e9d6d)[_0x4fec('0x27')](function(_0x59ac21){return _0x59ac21;});}return null;};}function removeEntity(_0x5f4a9a,_0x1c0f52){return function(_0x417dc0){if(_0x417dc0){return _0x417dc0['destroy']()[_0x4fec('0x27')](function(){var _0x331980=_0x417dc0[_0x4fec('0x3e')]({'plain':!![]});var _0x21607b=_0x4fec('0x3f');return db['UserProfileResource'][_0x4fec('0x40')]({'where':{'type':_0x21607b,'resourceId':_0x331980['id']}})[_0x4fec('0x27')](function(){return _0x417dc0;});})['then'](function(){_0x5f4a9a[_0x4fec('0x33')](0xcc)[_0x4fec('0x34')]();});}};}function handleEntityNotFound(_0x21d56f,_0x53e9c2){return function(_0x2ee80a){if(!_0x2ee80a){_0x21d56f[_0x4fec('0x32')](0x194);}return _0x2ee80a;};}function handleError(_0x49e7de,_0x3a9888){_0x3a9888=_0x3a9888||0x1f4;return function(_0x5635bf){logger[_0x4fec('0x2e')](_0x5635bf[_0x4fec('0x41')]);if(_0x5635bf[_0x4fec('0x42')]){delete _0x5635bf[_0x4fec('0x42')];}_0x49e7de[_0x4fec('0x33')](_0x3a9888)[_0x4fec('0x43')](_0x5635bf);};}exports[_0x4fec('0x44')]=function(_0x136bf2,_0x6d1224){var _0x11477c={},_0x1b76b0={},_0x54460c={'count':0x0,'rows':[]};var _0xc4cef=_['map'](db['ChatQueue'][_0x4fec('0x45')],function(_0x40e09b){return{'name':_0x40e09b['fieldName'],'type':_0x40e09b[_0x4fec('0x46')][_0x4fec('0x47')]};});_0x1b76b0['model']=_[_0x4fec('0x48')](_0xc4cef,_0x4fec('0x42'));_0x1b76b0[_0x4fec('0x49')]=_['keys'](_0x136bf2['query']);_0x1b76b0['filters']=_['intersection'](_0x1b76b0[_0x4fec('0x4a')],_0x1b76b0[_0x4fec('0x49')]);_0x11477c[_0x4fec('0x4b')]=_['intersection'](_0x1b76b0[_0x4fec('0x4a')],qs[_0x4fec('0x4c')](_0x136bf2[_0x4fec('0x49')][_0x4fec('0x4c')]));_0x11477c[_0x4fec('0x4b')]=_0x11477c[_0x4fec('0x4b')][_0x4fec('0x4d')]?_0x11477c[_0x4fec('0x4b')]:_0x1b76b0[_0x4fec('0x4a')];if(!_0x136bf2[_0x4fec('0x49')]['hasOwnProperty'](_0x4fec('0x4e'))){_0x11477c['limit']=qs[_0x4fec('0x37')](_0x136bf2[_0x4fec('0x49')][_0x4fec('0x37')]);_0x11477c[_0x4fec('0x36')]=qs[_0x4fec('0x36')](_0x136bf2[_0x4fec('0x49')][_0x4fec('0x36')]);}_0x11477c[_0x4fec('0x4f')]=qs['sort'](_0x136bf2['query'][_0x4fec('0x50')]);_0x11477c[_0x4fec('0x51')]=qs[_0x4fec('0x52')](_[_0x4fec('0x53')](_0x136bf2['query'],_0x1b76b0[_0x4fec('0x52')]),_0xc4cef);if(_0x136bf2[_0x4fec('0x49')][_0x4fec('0x54')]){_0x11477c['where']=_[_0x4fec('0x55')](_0x11477c[_0x4fec('0x51')],{'$or':_[_0x4fec('0x48')](_0xc4cef,function(_0xd9de93){if(_0xd9de93[_0x4fec('0x46')]!==_0x4fec('0x56')){var _0x3b2e64={};_0x3b2e64[_0xd9de93[_0x4fec('0x42')]]={'$like':'%'+_0x136bf2[_0x4fec('0x49')][_0x4fec('0x54')]+'%'};return _0x3b2e64;}})});}_0x11477c=_[_0x4fec('0x55')]({},_0x11477c,_0x136bf2['options']);var _0x180fe4={'where':_0x11477c[_0x4fec('0x51')]};return db[_0x4fec('0x57')][_0x4fec('0x39')](_0x180fe4)[_0x4fec('0x27')](function(_0x12a6d6){_0x54460c[_0x4fec('0x39')]=_0x12a6d6;if(_0x136bf2[_0x4fec('0x49')][_0x4fec('0x58')]){_0x11477c[_0x4fec('0x59')]=[{'all':!![]}];}return db[_0x4fec('0x57')][_0x4fec('0x5a')](_0x11477c);})[_0x4fec('0x27')](function(_0x5687cb){_0x54460c[_0x4fec('0x5b')]=_0x5687cb;return _0x54460c;})['then'](respondWithFilteredResult(_0x6d1224,_0x11477c))[_0x4fec('0x31')](handleError(_0x6d1224,null));};exports['show']=function(_0x5a6226,_0x1fe719){var _0x14e926={'raw':!![],'where':{'id':_0x5a6226[_0x4fec('0x5c')]['id']}},_0x1f4cd5={};_0x1f4cd5[_0x4fec('0x4a')]=_[_0x4fec('0x5d')](db[_0x4fec('0x57')][_0x4fec('0x45')]);_0x1f4cd5['query']=_[_0x4fec('0x5d')](_0x5a6226[_0x4fec('0x49')]);_0x1f4cd5[_0x4fec('0x52')]=_[_0x4fec('0x5e')](_0x1f4cd5[_0x4fec('0x4a')],_0x1f4cd5[_0x4fec('0x49')]);_0x14e926['attributes']=_['intersection'](_0x1f4cd5['model'],qs[_0x4fec('0x4c')](_0x5a6226['query'][_0x4fec('0x4c')]));_0x14e926[_0x4fec('0x4b')]=_0x14e926[_0x4fec('0x4b')][_0x4fec('0x4d')]?_0x14e926[_0x4fec('0x4b')]:_0x1f4cd5[_0x4fec('0x4a')];if(_0x5a6226[_0x4fec('0x49')][_0x4fec('0x58')]){_0x14e926[_0x4fec('0x59')]=[{'all':!![]}];}_0x14e926=_['merge']({},_0x14e926,_0x5a6226['options']);return db[_0x4fec('0x57')][_0x4fec('0x5f')](_0x14e926)['then'](handleEntityNotFound(_0x1fe719,null))[_0x4fec('0x27')](respondWithResult(_0x1fe719,null))[_0x4fec('0x31')](handleError(_0x1fe719,null));};exports[_0x4fec('0x60')]=function(_0x261faa,_0x4c465a){return db[_0x4fec('0x57')][_0x4fec('0x60')](_0x261faa['body'],{})[_0x4fec('0x27')](function(_0x24b78f){var _0x5a4b22=_0x261faa[_0x4fec('0x61')][_0x4fec('0x3e')]({'plain':!![]});if(!_0x5a4b22)throw new Error(_0x4fec('0x62'));if(_0x5a4b22['role']==='user'){var _0x227cac=_0x24b78f[_0x4fec('0x3e')]({'plain':!![]});var _0xb9996f='ChatQueues';return db[_0x4fec('0x63')]['find']({'where':{'name':_0xb9996f,'userProfileId':_0x5a4b22[_0x4fec('0x64')]},'raw':!![]})[_0x4fec('0x27')](function(_0x1c757e){if(_0x1c757e&&_0x1c757e['autoAssociation']===0x0){return db[_0x4fec('0x65')]['create']({'name':_0x227cac[_0x4fec('0x42')],'resourceId':_0x227cac['id'],'type':_0x1c757e[_0x4fec('0x42')],'sectionId':_0x1c757e['id']},{})[_0x4fec('0x27')](function(){return _0x24b78f;});}else{return _0x24b78f;}})['catch'](function(_0x2dc53b){logger['error'](_0x4fec('0x66'),_0x2dc53b);throw _0x2dc53b;});}return _0x24b78f;})[_0x4fec('0x27')](respondWithResult(_0x4c465a,0xc9))[_0x4fec('0x31')](handleError(_0x4c465a,null));};exports[_0x4fec('0x67')]=function(_0x1efa51,_0x2e2aae){if(_0x1efa51['body']['id']){delete _0x1efa51[_0x4fec('0x68')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x1efa51[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0x2e2aae,null))['then'](saveUpdates(_0x1efa51[_0x4fec('0x68')],null))[_0x4fec('0x27')](respondWithResult(_0x2e2aae,null))[_0x4fec('0x31')](handleError(_0x2e2aae,null));};exports[_0x4fec('0x40')]=function(_0x3337a3,_0x4f1af4){return db['ChatQueue'][_0x4fec('0x5f')]({'where':{'id':_0x3337a3['params']['id']}})['then'](handleEntityNotFound(_0x4f1af4,null))['then'](removeEntity(_0x4f1af4,null))['catch'](handleError(_0x4f1af4,null));};exports[_0x4fec('0x69')]=function(_0x366626,_0x259670){return db[_0x4fec('0x57')][_0x4fec('0x69')]()[_0x4fec('0x27')](respondWithResult(_0x259670,null))['catch'](handleError(_0x259670,null));};exports[_0x4fec('0x6a')]=function(_0x50b233,_0x37005d,_0x5e6531){var _0x44d41d={'raw':!![],'where':{}},_0x59f1ad={},_0x187af6;return db[_0x4fec('0x57')][_0x4fec('0x6b')]({'where':{'id':_0x50b233[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0x37005d,null))[_0x4fec('0x27')](function(_0x5b2efa){if(_0x5b2efa){_0x187af6=_0x5b2efa[_0x4fec('0x3e')]({'plain':!![]});_0x59f1ad[_0x4fec('0x4a')]=_['keys'](db[_0x4fec('0x6c')][_0x4fec('0x45')]);_0x59f1ad[_0x4fec('0x49')]=_['keys'](_0x50b233[_0x4fec('0x49')]);_0x59f1ad[_0x4fec('0x52')]=_[_0x4fec('0x5e')](_0x59f1ad['model'],_0x59f1ad['query']);_0x44d41d[_0x4fec('0x4b')]=_['intersection'](_0x59f1ad[_0x4fec('0x4a')],qs[_0x4fec('0x4c')](_0x50b233[_0x4fec('0x49')][_0x4fec('0x4c')]));_0x44d41d[_0x4fec('0x4b')]=_0x44d41d[_0x4fec('0x4b')]['length']?_0x44d41d[_0x4fec('0x4b')]:_0x59f1ad[_0x4fec('0x4a')];if(!_0x50b233['query'][_0x4fec('0x6d')](_0x4fec('0x4e'))){_0x44d41d[_0x4fec('0x37')]=qs['limit'](_0x50b233[_0x4fec('0x49')][_0x4fec('0x37')]);_0x44d41d['offset']=qs['offset'](_0x50b233['query'][_0x4fec('0x36')]);}_0x44d41d[_0x4fec('0x4f')]=qs[_0x4fec('0x50')](_0x50b233[_0x4fec('0x49')][_0x4fec('0x50')]);_0x44d41d[_0x4fec('0x51')]=qs[_0x4fec('0x52')](_[_0x4fec('0x53')](_0x50b233[_0x4fec('0x49')],_0x59f1ad[_0x4fec('0x52')]));_0x44d41d[_0x4fec('0x51')]['ChatQueueId']=_0x5b2efa['id'];if(_0x50b233['query']['filter']){_0x44d41d['where']=_[_0x4fec('0x55')](_0x44d41d['where'],{'$or':_[_0x4fec('0x48')](_0x44d41d['attributes'],function(_0x4fc60e){var _0x55f2a5={};_0x55f2a5[_0x4fc60e]={'$like':'%'+_0x50b233['query'][_0x4fec('0x54')]+'%'};return _0x55f2a5;})});}_0x44d41d=_[_0x4fec('0x55')]({},_0x44d41d,_0x50b233['options']);return db[_0x4fec('0x6c')][_0x4fec('0x5a')](_0x44d41d);}})[_0x4fec('0x27')](function(_0x29b334){if(_0x29b334){return db['User']['findAndCountAll']({'where':{'id':_[_0x4fec('0x48')](_0x29b334,_0x4fec('0x6e')),'role':'agent'},'attributes':['id',_0x4fec('0x42'),_0x4fec('0x6f'),_0x4fec('0x70'),_0x4fec('0x71')]});}})['then'](function(_0xca151d){if(_0xca151d){return{'count':_0xca151d['count'],'rows':_[_0x4fec('0x48')](_0xca151d[_0x4fec('0x5b')],function(_0x135d0e){return{'membername':_0x135d0e['name'],'UserId':_0x135d0e['id'],'queue_name':_0x187af6[_0x4fec('0x42')],'ChatQueueId':_0x187af6['id'],'interface':util['format'](_0x4fec('0x72'),_0x4fec('0x73'),_0x135d0e['name']),'penalty':0x0,'paused':_0x135d0e['chatPause'],'createdAt':_0x135d0e[_0x4fec('0x71')],'updatedAt':_0x135d0e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4fec('0x27')](respondWithFilteredResult(_0x37005d,_0x44d41d))[_0x4fec('0x31')](handleError(_0x37005d,null));};exports['getTeams']=function(_0x58c3ae,_0x55234c,_0x5765ee){var _0x69cf08={};var _0x34af22={};var _0x4f2476;var _0x582d9d;return db['ChatQueue'][_0x4fec('0x6b')]({'where':{'id':_0x58c3ae[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0x55234c,null))[_0x4fec('0x27')](function(_0x44c072){if(_0x44c072){_0x4f2476=_0x44c072;_0x34af22['model']=_[_0x4fec('0x5d')](db[_0x4fec('0x74')][_0x4fec('0x45')]);_0x34af22[_0x4fec('0x49')]=_[_0x4fec('0x5d')](_0x58c3ae[_0x4fec('0x49')]);_0x34af22[_0x4fec('0x52')]=_['intersection'](_0x34af22[_0x4fec('0x4a')],_0x34af22[_0x4fec('0x49')]);_0x69cf08[_0x4fec('0x4b')]=_[_0x4fec('0x5e')](_0x34af22['model'],qs[_0x4fec('0x4c')](_0x58c3ae[_0x4fec('0x49')][_0x4fec('0x4c')]));_0x69cf08['attributes']=_0x69cf08[_0x4fec('0x4b')][_0x4fec('0x4d')]?_0x69cf08[_0x4fec('0x4b')]:_0x34af22[_0x4fec('0x4a')];_0x69cf08[_0x4fec('0x4f')]=qs['sort'](_0x58c3ae['query'][_0x4fec('0x50')]);_0x69cf08['where']=qs[_0x4fec('0x52')](_[_0x4fec('0x53')](_0x58c3ae[_0x4fec('0x49')],_0x34af22[_0x4fec('0x52')]));if(_0x58c3ae[_0x4fec('0x49')][_0x4fec('0x54')]){_0x69cf08[_0x4fec('0x51')]=_[_0x4fec('0x55')](_0x69cf08[_0x4fec('0x51')],{'$or':_[_0x4fec('0x48')](_0x69cf08['attributes'],function(_0x3913a1){var _0x2d5d33={};_0x2d5d33[_0x3913a1]={'$like':'%'+_0x58c3ae[_0x4fec('0x49')][_0x4fec('0x54')]+'%'};return _0x2d5d33;})});}_0x69cf08=_['merge']({},_0x69cf08,_0x58c3ae[_0x4fec('0x75')]);return _0x4f2476[_0x4fec('0x76')](_0x69cf08);}})[_0x4fec('0x27')](function(_0x4b29c8){if(_0x4b29c8){_0x582d9d=_0x4b29c8['length'];if(!_0x58c3ae[_0x4fec('0x49')]['hasOwnProperty'](_0x4fec('0x4e'))){_0x69cf08[_0x4fec('0x37')]=qs[_0x4fec('0x37')](_0x58c3ae[_0x4fec('0x49')]['limit']);_0x69cf08['offset']=qs['offset'](_0x58c3ae['query'][_0x4fec('0x36')]);}return _0x4f2476['getTeams'](_0x69cf08);}})[_0x4fec('0x27')](function(_0x3e88fe){if(_0x3e88fe){return _0x3e88fe?{'count':_0x582d9d,'rows':_0x3e88fe}:null;}})['then'](respondWithResult(_0x55234c,null))[_0x4fec('0x31')](handleError(_0x55234c,null));};exports[_0x4fec('0x77')]=function(_0x6ed113,_0x3fb5b0,_0x5c2d8a){var _0x543a83=_0x6ed113[_0x4fec('0x68')]['ids'];return db[_0x4fec('0x74')][_0x4fec('0x5a')]({'where':{'id':_0x543a83},'attributes':['id'],'include':[{'model':db[_0x4fec('0x78')],'as':_0x4fec('0x79'),'attributes':['id',_0x4fec('0x42'),_0x4fec('0x7a'),'voicePause',_0x4fec('0x7b')],'raw':!![]}]})[_0x4fec('0x27')](function(_0x273794){if(_0x273794){var _0x24b17b=_[_0x4fec('0x7c')](_0x273794,function(_0x292ce3){var _0x373158=_0x292ce3[_0x4fec('0x3e')]({'plain':!![]});return _0x373158['Agents'];});return db[_0x4fec('0x57')][_0x4fec('0x5f')]({'where':{'id':_0x6ed113['params']['id']}})[_0x4fec('0x27')](function(_0xeb87d2){return db[_0x4fec('0x7d')]['transaction'](function(_0x37c79d){return _0xeb87d2['addTeams'](_0x543a83,{'transaction':_0x37c79d})[_0x4fec('0x27')](function(){return BPromise[_0x4fec('0x7e')](_0x24b17b,function(_0x5c6a32){return db[_0x4fec('0x6c')][_0x4fec('0x7f')]({'where':{'UserId':_0x5c6a32['id'],'ChatQueueId':_0x6ed113[_0x4fec('0x5c')]['id']},'transaction':_0x37c79d});});})[_0x4fec('0x27')](function(){_0x24b17b[_0x4fec('0x80')](function(_0x6295e4){socket[_0x4fec('0x81')](_0x4fec('0x82'),{'UserId':_0x6295e4['id'],'ChatQueueId':_0xeb87d2['id']});});});});});}})['then'](respondWithStatusCode(_0x3fb5b0,null))['catch'](handleError(_0x3fb5b0,null));};exports[_0x4fec('0x83')]=function(_0x1f7511,_0x5c1186,_0x386b10){return db['Team'][_0x4fec('0x5a')]({'where':{'id':_0x1f7511[_0x4fec('0x49')][_0x4fec('0x84')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4fec('0x79'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5c1186,null))[_0x4fec('0x27')](function(_0x17e4e3){var _0x469dc6=_[_0x4fec('0x48')](_0x17e4e3,'id');var _0x1e6ba3=[];var _0x4a5540=[];var _0x219875=squel['select']();_0x219875[_0x4fec('0x85')](_0x4fec('0x86'))['from'](_0x4fec('0x87'),'tq')[_0x4fec('0x88')](_0x4fec('0x89'),'ut',_0x4fec('0x8a'))[_0x4fec('0x51')](_0x4fec('0x8b'),_0x1f7511['params']['id']);for(var _0x494581=0x0;_0x494581<_0x17e4e3[_0x4fec('0x4d')];_0x494581+=0x1){let _0x35b0b7=_0x17e4e3[_0x494581];for(var _0x21ab70=0x0;_0x21ab70<_0x35b0b7[_0x4fec('0x79')][_0x4fec('0x4d')];_0x21ab70+=0x1){let _0x50d5a9=_0x35b0b7[_0x4fec('0x79')][_0x21ab70];var _0x1ddaef=_0x219875[_0x4fec('0x8c')]();_0x1ddaef[_0x4fec('0x51')](_0x4fec('0x8d'),_0x50d5a9['id']);_0x4a5540['push'](db[_0x4fec('0x7d')][_0x4fec('0x49')](_0x1ddaef[_0x4fec('0x8e')](),{'type':db[_0x4fec('0x7d')][_0x4fec('0x8f')]['SELECT']})['then'](function(_0xf1bc30){if(_0xf1bc30[_0x4fec('0x4d')]===0x1){return _0x50d5a9['id'];}else{var _0x305cf9=_[_0x4fec('0x90')](_[_0x4fec('0x48')](_0xf1bc30,_0x4fec('0x91')),function(_0x291f50){return _[_0x4fec('0x92')](_0x469dc6,_0x291f50);});if(_0x305cf9){return _0x50d5a9['id'];}}}));}}return BPromise['all'](_0x4a5540)[_0x4fec('0x27')](function(_0x107f98){_0x1e6ba3=_(_0x1e6ba3)[_0x4fec('0x93')](_0x107f98)[_0x4fec('0x94')]()[_0x4fec('0x95')]();return db['ChatQueue'][_0x4fec('0x5f')]({'where':{'id':_0x1f7511[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](function(_0x55daad){return db['sequelize'][_0x4fec('0x96')](function(_0x4ab96d){return _0x55daad[_0x4fec('0x83')](_0x1f7511['query'][_0x4fec('0x84')],{'transaction':_0x4ab96d})['then'](function(){if(!_[_0x4fec('0x97')](_0x1e6ba3)){return _0x55daad[_0x4fec('0x98')](_0x1e6ba3,{'transaction':_0x4ab96d});}})[_0x4fec('0x27')](function(){_0x1e6ba3['forEach'](function(_0x63fde7){socket['emit'](_0x4fec('0x99'),{'UserId':_0x63fde7,'ChatQueueId':_0x55daad['id']});});});});});});})['then'](respondWithStatusCode(_0x5c1186,null))[_0x4fec('0x31')](handleError(_0x5c1186,null));};exports[_0x4fec('0x9a')]=function(_0x18f7c7,_0x20659a,_0x350dab){return db['ChatQueue'][_0x4fec('0x5f')]({'where':{'id':_0x18f7c7['params']['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0x20659a,null))[_0x4fec('0x27')](function(_0xf8ace6){if(_0xf8ace6){return _0xf8ace6[_0x4fec('0x9a')](_0x18f7c7[_0x4fec('0x68')][_0x4fec('0x84')],_[_0x4fec('0x9b')](_0x18f7c7[_0x4fec('0x68')],[_0x4fec('0x84'),'id'])||{})[_0x4fec('0x9c')](function(_0x229a38){for(var _0x201b3d=0x0;_0x201b3d<_0x18f7c7[_0x4fec('0x68')][_0x4fec('0x84')][_0x4fec('0x4d')];_0x201b3d+=0x1){socket[_0x4fec('0x81')]('userChatQueue:save',{'UserId':Number(_0x18f7c7[_0x4fec('0x68')][_0x4fec('0x84')][_0x201b3d]),'ChatQueueId':Number(_0x18f7c7['params']['id'])});}return _0x229a38;});}})[_0x4fec('0x27')](respondWithResult(_0x20659a,null))['catch'](handleError(_0x20659a,null));};exports['removeAgents']=function(_0x17d018,_0x43bfb0,_0x5c102a){return db[_0x4fec('0x57')]['find']({'where':{'id':_0x17d018[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0x43bfb0,null))[_0x4fec('0x27')](function(_0x508faa){if(_0x508faa){return _0x508faa[_0x4fec('0x98')](_0x17d018[_0x4fec('0x49')]['ids'])[_0x4fec('0x27')](function(){if(_[_0x4fec('0x9d')](_0x17d018[_0x4fec('0x49')][_0x4fec('0x84')])){for(var _0x42a6f2=0x0;_0x42a6f2<_0x17d018[_0x4fec('0x49')][_0x4fec('0x84')]['length'];_0x42a6f2+=0x1){socket[_0x4fec('0x81')](_0x4fec('0x99'),{'UserId':Number(_0x17d018[_0x4fec('0x49')][_0x4fec('0x84')][_0x42a6f2]),'ChatQueueId':Number(_0x17d018[_0x4fec('0x5c')]['id'])});}}else{socket[_0x4fec('0x81')](_0x4fec('0x99'),{'UserId':Number(_0x17d018[_0x4fec('0x49')][_0x4fec('0x84')]),'ChatQueueId':Number(_0x17d018[_0x4fec('0x5c')]['id'])});}});}})[_0x4fec('0x27')](respondWithStatusCode(_0x43bfb0,null))[_0x4fec('0x31')](handleError(_0x43bfb0,null));};exports[_0x4fec('0x9e')]=function(_0xe2c943,_0xe1259a,_0x4200aa){var _0x2951c4={};var _0x14e4c8={};var _0x573ef6;var _0x38f901;return db[_0x4fec('0x57')]['findOne']({'where':{'id':_0xe2c943[_0x4fec('0x5c')]['id']}})[_0x4fec('0x27')](handleEntityNotFound(_0xe1259a,null))[_0x4fec('0x27')](function(_0x12c988){if(_0x12c988){_0x573ef6=_0x12c988;_0x14e4c8[_0x4fec('0x4a')]=_[_0x4fec('0x5d')](db[_0x4fec('0x78')]['rawAttributes']);_0x14e4c8[_0x4fec('0x49')]=_[_0x4fec('0x5d')](_0xe2c943[_0x4fec('0x49')]);_0x14e4c8[_0x4fec('0x52')]=_[_0x4fec('0x5e')](_0x14e4c8[_0x4fec('0x4a')],_0x14e4c8[_0x4fec('0x49')]);_0x2951c4[_0x4fec('0x4b')]=_[_0x4fec('0x5e')](_0x14e4c8[_0x4fec('0x4a')],qs[_0x4fec('0x4c')](_0xe2c943[_0x4fec('0x49')][_0x4fec('0x4c')]));_0x2951c4[_0x4fec('0x4b')]=_0x2951c4[_0x4fec('0x4b')][_0x4fec('0x4d')]?_0x2951c4[_0x4fec('0x4b')]:_0x14e4c8[_0x4fec('0x4a')];_0x2951c4[_0x4fec('0x4f')]=qs[_0x4fec('0x50')](_0xe2c943[_0x4fec('0x49')][_0x4fec('0x50')]);_0x2951c4[_0x4fec('0x51')]=qs[_0x4fec('0x52')](_[_0x4fec('0x53')](_0xe2c943[_0x4fec('0x49')],_0x14e4c8[_0x4fec('0x52')]));if(_0xe2c943[_0x4fec('0x49')][_0x4fec('0x54')]){_0x2951c4['where']=_[_0x4fec('0x55')](_0x2951c4[_0x4fec('0x51')],{'$or':_[_0x4fec('0x48')](_0x2951c4['attributes'],function(_0x5b4045){var _0x5e7dca={};_0x5e7dca[_0x5b4045]={'$like':'%'+_0xe2c943['query'][_0x4fec('0x54')]+'%'};return _0x5e7dca;})});}_0x2951c4=_[_0x4fec('0x55')]({},_0x2951c4,_0xe2c943['options']);return _0x573ef6[_0x4fec('0x9e')](_0x2951c4);}})[_0x4fec('0x27')](function(_0xc8f6eb){if(_0xc8f6eb){_0x38f901=_0xc8f6eb[_0x4fec('0x4d')];if(!_0xe2c943[_0x4fec('0x49')][_0x4fec('0x6d')](_0x4fec('0x4e'))){_0x2951c4['limit']=qs[_0x4fec('0x37')](_0xe2c943[_0x4fec('0x49')][_0x4fec('0x37')]);_0x2951c4[_0x4fec('0x36')]=qs[_0x4fec('0x36')](_0xe2c943['query'][_0x4fec('0x36')]);}return _0x573ef6['getAgents'](_0x2951c4);}})[_0x4fec('0x27')](function(_0x163db9){if(_0x163db9){return _0x163db9?{'count':_0x38f901,'rows':_0x163db9}:null;}})[_0x4fec('0x27')](respondWithResult(_0xe1259a,null))[_0x4fec('0x31')](handleError(_0xe1259a,null));}; \ No newline at end of file +var _0x6009=['ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','sequelize','transaction','findOrCreate','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','TeamId','includes','all','union','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/license/util','localhost','redis','./chatQueue.socket','register','client','http','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','get','UserProfileResource','destroy','name','send','map','ChatQueue','rawAttributes','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','find','describe','getMembers','UserChatQueue','order','pick'];(function(_0x44784c,_0x4498c1){var _0x4bbfb1=function(_0x5d5ef7){while(--_0x5d5ef7){_0x44784c['push'](_0x44784c['shift']());}};_0x4bbfb1(++_0x4498c1);}(_0x6009,0xbf));var _0x9600=function(_0x26659f,_0x32f426){_0x26659f=_0x26659f-0x0;var _0x42667f=_0x6009[_0x26659f];return _0x42667f;};'use strict';var emlformat=require(_0x9600('0x0'));var rimraf=require(_0x9600('0x1'));var zipdir=require(_0x9600('0x2'));var jsonpatch=require(_0x9600('0x3'));var rp=require(_0x9600('0x4'));var moment=require('moment');var BPromise=require(_0x9600('0x5'));var Mustache=require(_0x9600('0x6'));var util=require(_0x9600('0x7'));var path=require(_0x9600('0x8'));var sox=require(_0x9600('0x9'));var csv=require(_0x9600('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9600('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9600('0xc'));var jsforce=require(_0x9600('0xd'));var deskjs=require(_0x9600('0xe'));var toCsv=require(_0x9600('0xa'));var querystring=require(_0x9600('0xf'));var Papa=require(_0x9600('0x10'));var Redis=require(_0x9600('0x11'));var authService=require(_0x9600('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9600('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9600('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9600('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9600('0x16')]));require(_0x9600('0x17'))[_0x9600('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9600('0x19')][_0x9600('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x116891,_0x51784f,_0x5276bf,_0x210c24){return new BPromise(function(_0x36a9b,_0x24f9d1){var _0x199a94=_0x210c24||client;return _0x199a94['request'](_0x116891,_0x5276bf)[_0x9600('0x1b')](function(_0x3fbb40){logger[_0x9600('0x1c')]('ChatQueue,\x20%s,\x20%s',_0x51784f,'request\x20sent');logger[_0x9600('0x1d')](_0x9600('0x1e'),_0x51784f,_0x9600('0x1f'),JSON[_0x9600('0x20')](_0x3fbb40));if(_0x3fbb40[_0x9600('0x21')]){if(_0x3fbb40[_0x9600('0x21')][_0x9600('0x22')]===0x1f4){logger[_0x9600('0x21')](_0x9600('0x23'),_0x51784f,_0x3fbb40[_0x9600('0x21')][_0x9600('0x24')]);return _0x24f9d1(_0x3fbb40['error'][_0x9600('0x24')]);}logger['error'](_0x9600('0x23'),_0x51784f,_0x3fbb40[_0x9600('0x21')]['message']);return _0x36a9b(_0x3fbb40['error'][_0x9600('0x24')]);}else{logger['info'](_0x9600('0x23'),_0x51784f,'request\x20sent');_0x36a9b(_0x3fbb40['result'][_0x9600('0x24')]);}})['catch'](function(_0x390615){logger['error'](_0x9600('0x23'),_0x51784f,_0x390615);_0x24f9d1(_0x390615);});});}function respondWithStatusCode(_0x5abb4d,_0x34b88c){_0x34b88c=_0x34b88c||0xcc;return function(_0x238919){if(_0x238919){return _0x5abb4d[_0x9600('0x25')](_0x34b88c);}return _0x5abb4d[_0x9600('0x26')](_0x34b88c)[_0x9600('0x27')]();};}function respondWithResult(_0x467e14,_0x344a4a){_0x344a4a=_0x344a4a||0xc8;return function(_0x1f2f66){if(_0x1f2f66){return _0x467e14['status'](_0x344a4a)[_0x9600('0x28')](_0x1f2f66);}};}function respondWithFilteredResult(_0x698a75,_0x1df06f){return function(_0x212d5c){if(_0x212d5c){var _0x56e17f=typeof _0x1df06f[_0x9600('0x29')]===_0x9600('0x2a')&&typeof _0x1df06f[_0x9600('0x2b')]===_0x9600('0x2a');var _0x1a2c88=_0x212d5c['count'];var _0x4c5588=_0x56e17f?0x0:_0x1df06f['offset'];var _0x312079=_0x56e17f?_0x212d5c['count']:_0x1df06f['offset']+_0x1df06f[_0x9600('0x2b')];var _0x241219;if(_0x312079>=_0x1a2c88){_0x312079=_0x1a2c88;_0x241219=0xc8;}else{_0x241219=0xce;}_0x698a75['status'](_0x241219);return _0x698a75['set']('Content-Range',_0x4c5588+'-'+_0x312079+'/'+_0x1a2c88)[_0x9600('0x28')](_0x212d5c);}return null;};}function patchUpdates(_0x224721){return function(_0x4c357a){try{jsonpatch[_0x9600('0x2c')](_0x4c357a,_0x224721,!![]);}catch(_0x2bd6e3){return BPromise[_0x9600('0x2d')](_0x2bd6e3);}return _0x4c357a[_0x9600('0x2e')]();};}function saveUpdates(_0x1e7878,_0x195e99){return function(_0x287a97){if(_0x287a97){return _0x287a97[_0x9600('0x2f')](_0x1e7878)[_0x9600('0x1b')](function(_0x2c744b){return _0x2c744b;});}return null;};}function removeEntity(_0x48fe00,_0x2d25ce){return function(_0x37f2b9){if(_0x37f2b9){return _0x37f2b9['destroy']()[_0x9600('0x1b')](function(){var _0x3cc91a=_0x37f2b9[_0x9600('0x30')]({'plain':!![]});var _0x34b389='ChatQueues';return db[_0x9600('0x31')][_0x9600('0x32')]({'where':{'type':_0x34b389,'resourceId':_0x3cc91a['id']}})['then'](function(){return _0x37f2b9;});})[_0x9600('0x1b')](function(){_0x48fe00[_0x9600('0x26')](0xcc)[_0x9600('0x27')]();});}};}function handleEntityNotFound(_0x8e711f,_0x24ed8e){return function(_0x10dd06){if(!_0x10dd06){_0x8e711f['sendStatus'](0x194);}return _0x10dd06;};}function handleError(_0xc366eb,_0x3d9926){_0x3d9926=_0x3d9926||0x1f4;return function(_0x912fd8){logger[_0x9600('0x21')](_0x912fd8['stack']);if(_0x912fd8[_0x9600('0x33')]){delete _0x912fd8[_0x9600('0x33')];}_0xc366eb['status'](_0x3d9926)[_0x9600('0x34')](_0x912fd8);};}exports['index']=function(_0x27ac3c,_0x3f68e0){var _0x2a907b={},_0x369e18={},_0x5f33f4={'count':0x0,'rows':[]};var _0x2fb936=_[_0x9600('0x35')](db[_0x9600('0x36')][_0x9600('0x37')],function(_0x3d9238){return{'name':_0x3d9238['fieldName'],'type':_0x3d9238[_0x9600('0x38')]['key']};});_0x369e18['model']=_[_0x9600('0x35')](_0x2fb936,_0x9600('0x33'));_0x369e18['query']=_[_0x9600('0x39')](_0x27ac3c[_0x9600('0x3a')]);_0x369e18['filters']=_[_0x9600('0x3b')](_0x369e18[_0x9600('0x3c')],_0x369e18[_0x9600('0x3a')]);_0x2a907b[_0x9600('0x3d')]=_['intersection'](_0x369e18[_0x9600('0x3c')],qs['fields'](_0x27ac3c[_0x9600('0x3a')][_0x9600('0x3e')]));_0x2a907b[_0x9600('0x3d')]=_0x2a907b['attributes'][_0x9600('0x3f')]?_0x2a907b[_0x9600('0x3d')]:_0x369e18[_0x9600('0x3c')];if(!_0x27ac3c[_0x9600('0x3a')][_0x9600('0x40')](_0x9600('0x41'))){_0x2a907b['limit']=qs[_0x9600('0x2b')](_0x27ac3c['query']['limit']);_0x2a907b[_0x9600('0x29')]=qs[_0x9600('0x29')](_0x27ac3c[_0x9600('0x3a')][_0x9600('0x29')]);}_0x2a907b['order']=qs[_0x9600('0x42')](_0x27ac3c['query'][_0x9600('0x42')]);_0x2a907b['where']=qs[_0x9600('0x43')](_['pick'](_0x27ac3c['query'],_0x369e18['filters']),_0x2fb936);if(_0x27ac3c[_0x9600('0x3a')][_0x9600('0x44')]){_0x2a907b[_0x9600('0x45')]=_['merge'](_0x2a907b[_0x9600('0x45')],{'$or':_[_0x9600('0x35')](_0x2fb936,function(_0x583f42){if(_0x583f42[_0x9600('0x38')]!==_0x9600('0x46')){var _0xe499a5={};_0xe499a5[_0x583f42[_0x9600('0x33')]]={'$like':'%'+_0x27ac3c[_0x9600('0x3a')][_0x9600('0x44')]+'%'};return _0xe499a5;}})});}_0x2a907b=_['merge']({},_0x2a907b,_0x27ac3c['options']);var _0x11f1e1={'where':_0x2a907b[_0x9600('0x45')]};return db[_0x9600('0x36')]['count'](_0x11f1e1)['then'](function(_0x5e3e97){_0x5f33f4[_0x9600('0x47')]=_0x5e3e97;if(_0x27ac3c['query'][_0x9600('0x48')]){_0x2a907b[_0x9600('0x49')]=[{'all':!![]}];}return db[_0x9600('0x36')][_0x9600('0x4a')](_0x2a907b);})[_0x9600('0x1b')](function(_0x127cc0){_0x5f33f4[_0x9600('0x4b')]=_0x127cc0;return _0x5f33f4;})[_0x9600('0x1b')](respondWithFilteredResult(_0x3f68e0,_0x2a907b))[_0x9600('0x4c')](handleError(_0x3f68e0,null));};exports['show']=function(_0x199ba4,_0x29071a){var _0x36775f={'raw':!![],'where':{'id':_0x199ba4[_0x9600('0x4d')]['id']}},_0x1b0807={};_0x1b0807[_0x9600('0x3c')]=_['keys'](db[_0x9600('0x36')][_0x9600('0x37')]);_0x1b0807[_0x9600('0x3a')]=_['keys'](_0x199ba4[_0x9600('0x3a')]);_0x1b0807[_0x9600('0x43')]=_[_0x9600('0x3b')](_0x1b0807[_0x9600('0x3c')],_0x1b0807[_0x9600('0x3a')]);_0x36775f[_0x9600('0x3d')]=_['intersection'](_0x1b0807[_0x9600('0x3c')],qs['fields'](_0x199ba4[_0x9600('0x3a')][_0x9600('0x3e')]));_0x36775f[_0x9600('0x3d')]=_0x36775f[_0x9600('0x3d')][_0x9600('0x3f')]?_0x36775f['attributes']:_0x1b0807['model'];if(_0x199ba4[_0x9600('0x3a')][_0x9600('0x48')]){_0x36775f[_0x9600('0x49')]=[{'all':!![]}];}_0x36775f=_[_0x9600('0x4e')]({},_0x36775f,_0x199ba4[_0x9600('0x4f')]);return db['ChatQueue']['find'](_0x36775f)[_0x9600('0x1b')](handleEntityNotFound(_0x29071a,null))[_0x9600('0x1b')](respondWithResult(_0x29071a,null))[_0x9600('0x4c')](handleError(_0x29071a,null));};exports[_0x9600('0x50')]=function(_0x13609d,_0x54b073){return db[_0x9600('0x36')][_0x9600('0x50')](_0x13609d[_0x9600('0x51')],{})[_0x9600('0x1b')](function(_0x2cfa54){var _0x520eeb=_0x13609d['user'][_0x9600('0x30')]({'plain':!![]});if(!_0x520eeb)throw new Error(_0x9600('0x52'));if(_0x520eeb[_0x9600('0x53')]===_0x9600('0x54')){var _0x379a3e=_0x2cfa54[_0x9600('0x30')]({'plain':!![]});var _0x5e2f76=_0x9600('0x55');return db[_0x9600('0x56')]['find']({'where':{'name':_0x5e2f76,'userProfileId':_0x520eeb[_0x9600('0x57')]},'raw':!![]})[_0x9600('0x1b')](function(_0x59e6a5){if(_0x59e6a5&&_0x59e6a5[_0x9600('0x58')]===0x0){return db[_0x9600('0x31')][_0x9600('0x50')]({'name':_0x379a3e[_0x9600('0x33')],'resourceId':_0x379a3e['id'],'type':_0x59e6a5[_0x9600('0x33')],'sectionId':_0x59e6a5['id']},{})[_0x9600('0x1b')](function(){return _0x2cfa54;});}else{return _0x2cfa54;}})[_0x9600('0x4c')](function(_0x15952f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15952f);throw _0x15952f;});}return _0x2cfa54;})[_0x9600('0x1b')](respondWithResult(_0x54b073,0xc9))['catch'](handleError(_0x54b073,null));};exports[_0x9600('0x2f')]=function(_0x328f56,_0x5788f9){if(_0x328f56[_0x9600('0x51')]['id']){delete _0x328f56['body']['id'];}return db[_0x9600('0x36')][_0x9600('0x59')]({'where':{'id':_0x328f56[_0x9600('0x4d')]['id']}})[_0x9600('0x1b')](handleEntityNotFound(_0x5788f9,null))[_0x9600('0x1b')](saveUpdates(_0x328f56[_0x9600('0x51')],null))['then'](respondWithResult(_0x5788f9,null))[_0x9600('0x4c')](handleError(_0x5788f9,null));};exports[_0x9600('0x32')]=function(_0x339f1e,_0x1b8e59){return db[_0x9600('0x36')][_0x9600('0x59')]({'where':{'id':_0x339f1e[_0x9600('0x4d')]['id']}})[_0x9600('0x1b')](handleEntityNotFound(_0x1b8e59,null))[_0x9600('0x1b')](removeEntity(_0x1b8e59,null))[_0x9600('0x4c')](handleError(_0x1b8e59,null));};exports['describe']=function(_0x3ae73b,_0x4e0c8d){return db['ChatQueue'][_0x9600('0x5a')]()[_0x9600('0x1b')](respondWithResult(_0x4e0c8d,null))[_0x9600('0x4c')](handleError(_0x4e0c8d,null));};exports[_0x9600('0x5b')]=function(_0x45dd68,_0x2abc75,_0x447e32){var _0x16514d={'raw':!![],'where':{}},_0x2ae96e={},_0x54ef7b;return db[_0x9600('0x36')]['findOne']({'where':{'id':_0x45dd68[_0x9600('0x4d')]['id']}})[_0x9600('0x1b')](handleEntityNotFound(_0x2abc75,null))[_0x9600('0x1b')](function(_0x2fa9a9){if(_0x2fa9a9){_0x54ef7b=_0x2fa9a9[_0x9600('0x30')]({'plain':!![]});_0x2ae96e[_0x9600('0x3c')]=_[_0x9600('0x39')](db[_0x9600('0x5c')][_0x9600('0x37')]);_0x2ae96e[_0x9600('0x3a')]=_[_0x9600('0x39')](_0x45dd68['query']);_0x2ae96e['filters']=_[_0x9600('0x3b')](_0x2ae96e[_0x9600('0x3c')],_0x2ae96e[_0x9600('0x3a')]);_0x16514d[_0x9600('0x3d')]=_[_0x9600('0x3b')](_0x2ae96e[_0x9600('0x3c')],qs[_0x9600('0x3e')](_0x45dd68[_0x9600('0x3a')][_0x9600('0x3e')]));_0x16514d[_0x9600('0x3d')]=_0x16514d[_0x9600('0x3d')][_0x9600('0x3f')]?_0x16514d[_0x9600('0x3d')]:_0x2ae96e['model'];if(!_0x45dd68[_0x9600('0x3a')]['hasOwnProperty'](_0x9600('0x41'))){_0x16514d[_0x9600('0x2b')]=qs['limit'](_0x45dd68[_0x9600('0x3a')][_0x9600('0x2b')]);_0x16514d[_0x9600('0x29')]=qs['offset'](_0x45dd68[_0x9600('0x3a')][_0x9600('0x29')]);}_0x16514d[_0x9600('0x5d')]=qs[_0x9600('0x42')](_0x45dd68[_0x9600('0x3a')][_0x9600('0x42')]);_0x16514d['where']=qs[_0x9600('0x43')](_[_0x9600('0x5e')](_0x45dd68[_0x9600('0x3a')],_0x2ae96e[_0x9600('0x43')]));_0x16514d[_0x9600('0x45')][_0x9600('0x5f')]=_0x2fa9a9['id'];if(_0x45dd68[_0x9600('0x3a')][_0x9600('0x44')]){_0x16514d[_0x9600('0x45')]=_[_0x9600('0x4e')](_0x16514d[_0x9600('0x45')],{'$or':_[_0x9600('0x35')](_0x16514d[_0x9600('0x3d')],function(_0x1b0d7f){var _0x5ded13={};_0x5ded13[_0x1b0d7f]={'$like':'%'+_0x45dd68[_0x9600('0x3a')][_0x9600('0x44')]+'%'};return _0x5ded13;})});}_0x16514d=_['merge']({},_0x16514d,_0x45dd68[_0x9600('0x4f')]);return db[_0x9600('0x5c')][_0x9600('0x4a')](_0x16514d);}})['then'](function(_0x5a16de){if(_0x5a16de){return db[_0x9600('0x60')][_0x9600('0x61')]({'where':{'id':_[_0x9600('0x35')](_0x5a16de,_0x9600('0x62')),'role':_0x9600('0x63')},'attributes':['id',_0x9600('0x33'),_0x9600('0x64'),_0x9600('0x65'),_0x9600('0x66')]});}})['then'](function(_0x4ac8c6){if(_0x4ac8c6){return{'count':_0x4ac8c6['count'],'rows':_[_0x9600('0x35')](_0x4ac8c6[_0x9600('0x4b')],function(_0x3378df){return{'membername':_0x3378df[_0x9600('0x33')],'UserId':_0x3378df['id'],'queue_name':_0x54ef7b[_0x9600('0x33')],'ChatQueueId':_0x54ef7b['id'],'interface':util[_0x9600('0x67')](_0x9600('0x68'),_0x9600('0x69'),_0x3378df['name']),'penalty':0x0,'paused':_0x3378df['chatPause'],'createdAt':_0x3378df[_0x9600('0x66')],'updatedAt':_0x3378df[_0x9600('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9600('0x1b')](respondWithFilteredResult(_0x2abc75,_0x16514d))[_0x9600('0x4c')](handleError(_0x2abc75,null));};exports['getTeams']=function(_0x4bcb31,_0x602073,_0x3cd6a7){var _0x5c1513={};var _0x3be243={};var _0x5adcea;var _0x38107a;return db['ChatQueue'][_0x9600('0x6a')]({'where':{'id':_0x4bcb31[_0x9600('0x4d')]['id']}})['then'](handleEntityNotFound(_0x602073,null))[_0x9600('0x1b')](function(_0x371b33){if(_0x371b33){_0x5adcea=_0x371b33;_0x3be243['model']=_[_0x9600('0x39')](db[_0x9600('0x6b')][_0x9600('0x37')]);_0x3be243[_0x9600('0x3a')]=_['keys'](_0x4bcb31[_0x9600('0x3a')]);_0x3be243[_0x9600('0x43')]=_[_0x9600('0x3b')](_0x3be243[_0x9600('0x3c')],_0x3be243[_0x9600('0x3a')]);_0x5c1513['attributes']=_[_0x9600('0x3b')](_0x3be243[_0x9600('0x3c')],qs['fields'](_0x4bcb31[_0x9600('0x3a')][_0x9600('0x3e')]));_0x5c1513[_0x9600('0x3d')]=_0x5c1513[_0x9600('0x3d')][_0x9600('0x3f')]?_0x5c1513['attributes']:_0x3be243[_0x9600('0x3c')];_0x5c1513[_0x9600('0x5d')]=qs[_0x9600('0x42')](_0x4bcb31[_0x9600('0x3a')][_0x9600('0x42')]);_0x5c1513[_0x9600('0x45')]=qs[_0x9600('0x43')](_['pick'](_0x4bcb31[_0x9600('0x3a')],_0x3be243[_0x9600('0x43')]));if(_0x4bcb31[_0x9600('0x3a')][_0x9600('0x44')]){_0x5c1513[_0x9600('0x45')]=_[_0x9600('0x4e')](_0x5c1513[_0x9600('0x45')],{'$or':_[_0x9600('0x35')](_0x5c1513[_0x9600('0x3d')],function(_0x3c5cab){var _0xa8b027={};_0xa8b027[_0x3c5cab]={'$like':'%'+_0x4bcb31[_0x9600('0x3a')][_0x9600('0x44')]+'%'};return _0xa8b027;})});}_0x5c1513=_[_0x9600('0x4e')]({},_0x5c1513,_0x4bcb31['options']);return _0x5adcea[_0x9600('0x6c')](_0x5c1513);}})[_0x9600('0x1b')](function(_0x470c31){if(_0x470c31){_0x38107a=_0x470c31[_0x9600('0x3f')];if(!_0x4bcb31[_0x9600('0x3a')][_0x9600('0x40')](_0x9600('0x41'))){_0x5c1513[_0x9600('0x2b')]=qs[_0x9600('0x2b')](_0x4bcb31[_0x9600('0x3a')][_0x9600('0x2b')]);_0x5c1513['offset']=qs[_0x9600('0x29')](_0x4bcb31[_0x9600('0x3a')][_0x9600('0x29')]);}return _0x5adcea['getTeams'](_0x5c1513);}})[_0x9600('0x1b')](function(_0x1f6cb1){if(_0x1f6cb1){return _0x1f6cb1?{'count':_0x38107a,'rows':_0x1f6cb1}:null;}})[_0x9600('0x1b')](respondWithResult(_0x602073,null))[_0x9600('0x4c')](handleError(_0x602073,null));};exports[_0x9600('0x6d')]=function(_0x30d14b,_0x5cacce,_0x4e8bbd){var _0x396793=_0x30d14b[_0x9600('0x51')][_0x9600('0x6e')];return db['Team']['findAll']({'where':{'id':_0x396793},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9600('0x6f'),'attributes':['id',_0x9600('0x33'),_0x9600('0x70'),_0x9600('0x71'),'interface'],'raw':!![]}]})[_0x9600('0x1b')](function(_0x44b09d){if(_0x44b09d){var _0xa411c3=_['flatMap'](_0x44b09d,function(_0x5cdef0){var _0x3b350a=_0x5cdef0[_0x9600('0x30')]({'plain':!![]});return _0x3b350a[_0x9600('0x6f')];});return db[_0x9600('0x36')]['find']({'where':{'id':_0x30d14b['params']['id']}})[_0x9600('0x1b')](function(_0x1700e9){return db[_0x9600('0x72')][_0x9600('0x73')](function(_0x4ec0d7){return _0x1700e9[_0x9600('0x6d')](_0x396793,{'transaction':_0x4ec0d7})[_0x9600('0x1b')](function(){return BPromise['each'](_0xa411c3,function(_0x4bde6c){return db[_0x9600('0x5c')][_0x9600('0x74')]({'where':{'UserId':_0x4bde6c['id'],'ChatQueueId':_0x30d14b['params']['id']},'transaction':_0x4ec0d7});});})[_0x9600('0x1b')](function(){_0xa411c3['forEach'](function(_0x567440){socket[_0x9600('0x75')](_0x9600('0x76'),{'UserId':_0x567440['id'],'ChatQueueId':_0x1700e9['id']});});});});});}})[_0x9600('0x1b')](respondWithStatusCode(_0x5cacce,null))[_0x9600('0x4c')](handleError(_0x5cacce,null));};exports[_0x9600('0x77')]=function(_0x4a9c88,_0x201e11,_0x4e059){return db[_0x9600('0x6b')][_0x9600('0x4a')]({'where':{'id':_0x4a9c88[_0x9600('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9600('0x60')],'as':_0x9600('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x9600('0x1b')](handleEntityNotFound(_0x201e11,null))[_0x9600('0x1b')](function(_0x2e92db){var _0x47628c=_[_0x9600('0x35')](_0x2e92db,'id');var _0x1cfba3=[];var _0x3a4c7d=[];var _0x45e445=squel['select']();_0x45e445[_0x9600('0x78')](_0x9600('0x79'))[_0x9600('0x7a')](_0x9600('0x7b'),'tq')[_0x9600('0x7c')](_0x9600('0x7d'),'ut',_0x9600('0x7e'))[_0x9600('0x45')](_0x9600('0x7f'),_0x4a9c88[_0x9600('0x4d')]['id']);for(var _0x11eb23=0x0;_0x11eb23<_0x2e92db[_0x9600('0x3f')];_0x11eb23+=0x1){let _0x34386e=_0x2e92db[_0x11eb23];for(var _0x1938dc=0x0;_0x1938dc<_0x34386e[_0x9600('0x6f')][_0x9600('0x3f')];_0x1938dc+=0x1){let _0x28a1c7=_0x34386e[_0x9600('0x6f')][_0x1938dc];var _0x4e9953=_0x45e445[_0x9600('0x80')]();_0x4e9953['where']('ut.UserId\x20=\x20?',_0x28a1c7['id']);_0x3a4c7d[_0x9600('0x81')](db[_0x9600('0x72')]['query'](_0x4e9953[_0x9600('0x82')](),{'type':db[_0x9600('0x72')]['QueryTypes'][_0x9600('0x83')]})[_0x9600('0x1b')](function(_0x156feb){if(_0x156feb[_0x9600('0x3f')]===0x1){return _0x28a1c7['id'];}else{var _0x542c21=_['every'](_[_0x9600('0x35')](_0x156feb,_0x9600('0x84')),function(_0x2f989d){return _[_0x9600('0x85')](_0x47628c,_0x2f989d);});if(_0x542c21){return _0x28a1c7['id'];}}}));}}return BPromise[_0x9600('0x86')](_0x3a4c7d)[_0x9600('0x1b')](function(_0x459296){_0x1cfba3=_(_0x1cfba3)[_0x9600('0x87')](_0x459296)['compact']()['value']();return db[_0x9600('0x36')]['find']({'where':{'id':_0x4a9c88['params']['id']}})[_0x9600('0x1b')](function(_0x25bb4a){return db[_0x9600('0x72')][_0x9600('0x73')](function(_0x3cdcaf){return _0x25bb4a[_0x9600('0x77')](_0x4a9c88[_0x9600('0x3a')][_0x9600('0x6e')],{'transaction':_0x3cdcaf})['then'](function(){if(!_[_0x9600('0x88')](_0x1cfba3)){return _0x25bb4a[_0x9600('0x89')](_0x1cfba3,{'transaction':_0x3cdcaf});}})[_0x9600('0x1b')](function(){_0x1cfba3['forEach'](function(_0xe9b15f){socket[_0x9600('0x75')](_0x9600('0x8a'),{'UserId':_0xe9b15f,'ChatQueueId':_0x25bb4a['id']});});});});});});})['then'](respondWithStatusCode(_0x201e11,null))['catch'](handleError(_0x201e11,null));};exports[_0x9600('0x8b')]=function(_0x6415d3,_0x5c5e9e,_0x170a10){return db['ChatQueue'][_0x9600('0x59')]({'where':{'id':_0x6415d3['params']['id']}})['then'](handleEntityNotFound(_0x5c5e9e,null))['then'](function(_0x276f10){if(_0x276f10){return _0x276f10[_0x9600('0x8b')](_0x6415d3[_0x9600('0x51')][_0x9600('0x6e')],_[_0x9600('0x8c')](_0x6415d3[_0x9600('0x51')],[_0x9600('0x6e'),'id'])||{})['spread'](function(_0x5cdd94){for(var _0x38bac0=0x0;_0x38bac0<_0x6415d3[_0x9600('0x51')]['ids'][_0x9600('0x3f')];_0x38bac0+=0x1){socket['emit'](_0x9600('0x76'),{'UserId':Number(_0x6415d3[_0x9600('0x51')][_0x9600('0x6e')][_0x38bac0]),'ChatQueueId':Number(_0x6415d3[_0x9600('0x4d')]['id'])});}return _0x5cdd94;});}})[_0x9600('0x1b')](respondWithResult(_0x5c5e9e,null))['catch'](handleError(_0x5c5e9e,null));};exports[_0x9600('0x89')]=function(_0x23b4be,_0x3234ff,_0x2ca32c){return db[_0x9600('0x36')][_0x9600('0x59')]({'where':{'id':_0x23b4be[_0x9600('0x4d')]['id']}})[_0x9600('0x1b')](handleEntityNotFound(_0x3234ff,null))[_0x9600('0x1b')](function(_0x30c1cf){if(_0x30c1cf){return _0x30c1cf[_0x9600('0x89')](_0x23b4be[_0x9600('0x3a')]['ids'])[_0x9600('0x1b')](function(){if(_[_0x9600('0x8d')](_0x23b4be[_0x9600('0x3a')][_0x9600('0x6e')])){for(var _0x4c3d98=0x0;_0x4c3d98<_0x23b4be[_0x9600('0x3a')][_0x9600('0x6e')][_0x9600('0x3f')];_0x4c3d98+=0x1){socket[_0x9600('0x75')](_0x9600('0x8a'),{'UserId':Number(_0x23b4be[_0x9600('0x3a')][_0x9600('0x6e')][_0x4c3d98]),'ChatQueueId':Number(_0x23b4be[_0x9600('0x4d')]['id'])});}}else{socket['emit'](_0x9600('0x8a'),{'UserId':Number(_0x23b4be[_0x9600('0x3a')][_0x9600('0x6e')]),'ChatQueueId':Number(_0x23b4be['params']['id'])});}});}})[_0x9600('0x1b')](respondWithStatusCode(_0x3234ff,null))[_0x9600('0x4c')](handleError(_0x3234ff,null));};exports['getAgents']=function(_0x467531,_0x4c1a66,_0x3f9e9a){var _0x4a32e0={};var _0x3200ac={};var _0x4ec23e;var _0xded492;return db['ChatQueue'][_0x9600('0x6a')]({'where':{'id':_0x467531[_0x9600('0x4d')]['id']}})[_0x9600('0x1b')](handleEntityNotFound(_0x4c1a66,null))['then'](function(_0x2edf23){if(_0x2edf23){_0x4ec23e=_0x2edf23;_0x3200ac['model']=_[_0x9600('0x39')](db[_0x9600('0x60')][_0x9600('0x37')]);_0x3200ac[_0x9600('0x3a')]=_[_0x9600('0x39')](_0x467531[_0x9600('0x3a')]);_0x3200ac[_0x9600('0x43')]=_[_0x9600('0x3b')](_0x3200ac['model'],_0x3200ac[_0x9600('0x3a')]);_0x4a32e0['attributes']=_['intersection'](_0x3200ac[_0x9600('0x3c')],qs[_0x9600('0x3e')](_0x467531['query'][_0x9600('0x3e')]));_0x4a32e0[_0x9600('0x3d')]=_0x4a32e0[_0x9600('0x3d')][_0x9600('0x3f')]?_0x4a32e0[_0x9600('0x3d')]:_0x3200ac[_0x9600('0x3c')];_0x4a32e0[_0x9600('0x5d')]=qs[_0x9600('0x42')](_0x467531[_0x9600('0x3a')][_0x9600('0x42')]);_0x4a32e0[_0x9600('0x45')]=qs[_0x9600('0x43')](_[_0x9600('0x5e')](_0x467531[_0x9600('0x3a')],_0x3200ac[_0x9600('0x43')]));if(_0x467531[_0x9600('0x3a')][_0x9600('0x44')]){_0x4a32e0['where']=_[_0x9600('0x4e')](_0x4a32e0[_0x9600('0x45')],{'$or':_[_0x9600('0x35')](_0x4a32e0[_0x9600('0x3d')],function(_0x30dcba){var _0x2e10f7={};_0x2e10f7[_0x30dcba]={'$like':'%'+_0x467531[_0x9600('0x3a')][_0x9600('0x44')]+'%'};return _0x2e10f7;})});}_0x4a32e0=_[_0x9600('0x4e')]({},_0x4a32e0,_0x467531[_0x9600('0x4f')]);return _0x4ec23e['getAgents'](_0x4a32e0);}})[_0x9600('0x1b')](function(_0x476182){if(_0x476182){_0xded492=_0x476182[_0x9600('0x3f')];if(!_0x467531['query']['hasOwnProperty'](_0x9600('0x41'))){_0x4a32e0['limit']=qs[_0x9600('0x2b')](_0x467531['query']['limit']);_0x4a32e0[_0x9600('0x29')]=qs[_0x9600('0x29')](_0x467531['query']['offset']);}return _0x4ec23e[_0x9600('0x8e')](_0x4a32e0);}})['then'](function(_0x127c81){if(_0x127c81){return _0x127c81?{'count':_0xded492,'rows':_0x127c81}:null;}})[_0x9600('0x1b')](respondWithResult(_0x4c1a66,null))[_0x9600('0x4c')](handleError(_0x4c1a66,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 55ff578..cb48512 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 _0x06de=['update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x246c61,_0x4d2c57){var _0x46ae58=function(_0x161e7d){while(--_0x161e7d){_0x246c61['push'](_0x246c61['shift']());}};_0x46ae58(++_0x4d2c57);}(_0x06de,0x1a3));var _0xe06d=function(_0x5a5276,_0x262d69){_0x5a5276=_0x5a5276-0x0;var _0x3e8ee2=_0x06de[_0x5a5276];return _0x3e8ee2;};'use strict';var EventEmitter=require(_0xe06d('0x0'));var ChatQueue=require(_0xe06d('0x1'))['db'][_0xe06d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe06d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe06d('0x4'),'afterDestroy':_0xe06d('0x5')};function emitEvent(_0x44edae){return function(_0x290f1d,_0x480f4f,_0x178eb2){ChatQueueEvents[_0xe06d('0x6')](_0x44edae+':'+_0x290f1d['id'],_0x290f1d);ChatQueueEvents[_0xe06d('0x6')](_0x44edae,_0x290f1d);_0x178eb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xe06d('0x7')](e,emitEvent(event));}}module[_0xe06d('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0xbc6c=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0xbc6c,0x1b1));var _0xcbc6=function(_0x157e54,_0x1c14ab){_0x157e54=_0x157e54-0x0;var _0x8a1271=_0xbc6c[_0x157e54];return _0x8a1271;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xcbc6('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcbc6('0x1'),'afterUpdate':_0xcbc6('0x2'),'afterDestroy':_0xcbc6('0x3')};function emitEvent(_0x20205f){return function(_0x40f649,_0x35bf9e,_0x4dfe4e){ChatQueueEvents[_0xcbc6('0x4')](_0x20205f+':'+_0x40f649['id'],_0x40f649);ChatQueueEvents['emit'](_0x20205f,_0x40f649);_0x4dfe4e(null);};}for(var e in events){if(events[_0xcbc6('0x5')](e)){var event=events[e];ChatQueue[_0xcbc6('0x6')](e,emitEvent(event));}}module[_0xcbc6('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 80c153d..7786816 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 _0x9d08=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','util'];(function(_0x2b41b4,_0x18d3b1){var _0x1af3f1=function(_0x2f41e3){while(--_0x2f41e3){_0x2b41b4['push'](_0x2b41b4['shift']());}};_0x1af3f1(++_0x18d3b1);}(_0x9d08,0xf9));var _0x89d0=function(_0x1ec79c,_0x13377c){_0x1ec79c=_0x1ec79c-0x0;var _0x3ffaa8=_0x9d08[_0x1ec79c];return _0x3ffaa8;};'use strict';var _=require('lodash');var util=require(_0x89d0('0x0'));var logger=require(_0x89d0('0x1'))(_0x89d0('0x2'));var moment=require(_0x89d0('0x3'));var BPromise=require(_0x89d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x89d0('0x5'));var config=require(_0x89d0('0x6'));var attributes=require(_0x89d0('0x7'));module['exports']=function(_0x432592,_0x2f666f){return _0x432592['define'](_0x89d0('0x8'),attributes,{'tableName':_0x89d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb566=['chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x90f34f,_0x404021){var _0x4b18cf=function(_0x25112d){while(--_0x25112d){_0x90f34f['push'](_0x90f34f['shift']());}};_0x4b18cf(++_0x404021);}(_0xb566,0x83));var _0x6b56=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0xb566[_0x46361e];return _0x14e302;};'use strict';var _=require(_0x6b56('0x0'));var util=require('util');var logger=require(_0x6b56('0x1'))(_0x6b56('0x2'));var moment=require('moment');var BPromise=require(_0x6b56('0x3'));var rp=require(_0x6b56('0x4'));var fs=require('fs');var path=require(_0x6b56('0x5'));var rimraf=require(_0x6b56('0x6'));var config=require(_0x6b56('0x7'));var attributes=require(_0x6b56('0x8'));module[_0x6b56('0x9')]=function(_0x1b2558,_0x1f9457){return _0x1b2558[_0x6b56('0xa')](_0x6b56('0xb'),attributes,{'tableName':_0x6b56('0xc'),'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 3f3b95f..c5d2446 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 _0x3de3=['ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','GetChatQueue','ChatQueue','findAll','raw','options','limit','include','map','model','attributes','catch','ShowChatQueue','find','where','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatQueue.socket','register','request','then','info'];(function(_0x230bb8,_0xa1718){var _0x16cb9a=function(_0x2848fe){while(--_0x2848fe){_0x230bb8['push'](_0x230bb8['shift']());}};_0x16cb9a(++_0xa1718);}(_0x3de3,0x1ce));var _0x33de=function(_0x454985,_0x7a6431){_0x454985=_0x454985-0x0;var _0x5964bf=_0x3de3[_0x454985];return _0x5964bf;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});config['redis']=_[_0x33de('0xa')](config[_0x33de('0xb')],{'host':_0x33de('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33de('0xb')]));require(_0x33de('0xd'))[_0x33de('0xe')](socket);function respondWithRpcPromise(_0x5e1be7,_0x2cbf35,_0x348720){return new BPromise(function(_0x8b655d,_0x241211){return client[_0x33de('0xf')](_0x5e1be7,_0x348720)[_0x33de('0x10')](function(_0x8dfa3b){logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,_0x33de('0x13'));logger[_0x33de('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2cbf35,_0x33de('0x13'),JSON[_0x33de('0x15')](_0x8dfa3b));if(_0x8dfa3b['error']){if(_0x8dfa3b['error'][_0x33de('0x16')]===0x1f4){logger[_0x33de('0x17')](_0x33de('0x12'),_0x2cbf35,_0x8dfa3b[_0x33de('0x17')]['message']);return _0x241211(_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2cbf35,_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);return _0x8b655d(_0x8dfa3b[_0x33de('0x17')]['message']);}else{logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,'request\x20sent');_0x8b655d(_0x8dfa3b[_0x33de('0x19')][_0x33de('0x18')]);}})['catch'](function(_0x5bb74e){logger[_0x33de('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2cbf35,_0x5bb74e);_0x241211(_0x5bb74e);});});}exports[_0x33de('0x1a')]=function(_0x2f0529){var _0x3810b5=this;return new Promise(function(_0x315c9b,_0xc4f1a4){return db[_0x33de('0x1b')][_0x33de('0x1c')]({'raw':_0x2f0529['options']?_0x2f0529['options'][_0x33de('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f0529['options']?_0x2f0529[_0x33de('0x1e')]['where']||null:null,'attributes':_0x2f0529[_0x33de('0x1e')]?_0x2f0529[_0x33de('0x1e')]['attributes']||null:null,'limit':_0x2f0529[_0x33de('0x1e')]?_0x2f0529['options'][_0x33de('0x1f')]||null:null,'include':_0x2f0529['options']?_0x2f0529[_0x33de('0x1e')][_0x33de('0x20')]?_[_0x33de('0x21')](_0x2f0529['options'][_0x33de('0x20')],function(_0x2d206b){return{'model':db[_0x2d206b[_0x33de('0x22')]],'as':_0x2d206b['as'],'attributes':_0x2d206b['attributes'],'include':_0x2d206b[_0x33de('0x20')]?_['map'](_0x2d206b['include'],function(_0x1c8de9){return{'model':db[_0x1c8de9[_0x33de('0x22')]],'as':_0x1c8de9['as'],'attributes':_0x1c8de9[_0x33de('0x23')],'include':_0x1c8de9[_0x33de('0x20')]?_[_0x33de('0x21')](_0x1c8de9[_0x33de('0x20')],function(_0x3f22fb){return{'model':db[_0x3f22fb[_0x33de('0x22')]],'as':_0x3f22fb['as'],'attributes':_0x3f22fb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2755e6){logger[_0x33de('0x11')](_0x33de('0x1a'),_0x2f0529);logger[_0x33de('0x14')](_0x33de('0x1a'),_0x2f0529,JSON[_0x33de('0x15')](_0x2755e6));_0x315c9b(_0x2755e6);})[_0x33de('0x24')](function(_0x4e1898){logger[_0x33de('0x17')](_0x33de('0x1a'),_0x4e1898[_0x33de('0x18')],_0x2f0529);_0xc4f1a4(_0x3810b5[_0x33de('0x17')](0x1f4,_0x4e1898['message']));});});};exports[_0x33de('0x25')]=function(_0xf5d78a){var _0x5a9c43=this;return new Promise(function(_0x5d2da4,_0x57fcf3){return db[_0x33de('0x1b')][_0x33de('0x26')]({'raw':_0xf5d78a['options']?_0xf5d78a[_0x33de('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xf5d78a['options']?_0xf5d78a[_0x33de('0x1e')][_0x33de('0x27')]||null:null,'attributes':_0xf5d78a[_0x33de('0x1e')]?_0xf5d78a[_0x33de('0x1e')][_0x33de('0x23')]||null:null,'include':_0xf5d78a[_0x33de('0x1e')]?_0xf5d78a[_0x33de('0x1e')][_0x33de('0x20')]?_['map'](_0xf5d78a[_0x33de('0x1e')]['include'],function(_0x12defc){return{'model':db[_0x12defc['model']],'as':_0x12defc['as'],'attributes':_0x12defc['attributes'],'include':_0x12defc[_0x33de('0x20')]?_[_0x33de('0x21')](_0x12defc[_0x33de('0x20')],function(_0x213c84){return{'model':db[_0x213c84[_0x33de('0x22')]],'as':_0x213c84['as'],'attributes':_0x213c84[_0x33de('0x23')],'include':_0x213c84['include']?_[_0x33de('0x21')](_0x213c84[_0x33de('0x20')],function(_0x1380ff){return{'model':db[_0x1380ff[_0x33de('0x22')]],'as':_0x1380ff['as'],'attributes':_0x1380ff[_0x33de('0x23')]};}):[]};}):[]};}):[]:[]})[_0x33de('0x10')](function(_0x59c618){logger['info'](_0x33de('0x25'),_0xf5d78a);logger[_0x33de('0x14')](_0x33de('0x25'),_0xf5d78a,JSON[_0x33de('0x15')](_0x59c618));_0x5d2da4(_0x59c618);})[_0x33de('0x24')](function(_0x35064e){logger[_0x33de('0x17')]('ShowChatQueue',_0x35064e[_0x33de('0x18')],_0xf5d78a);_0x57fcf3(_0x5a9c43[_0x33de('0x17')](0x1f4,_0x35064e[_0x33de('0x18')]));});});}; \ No newline at end of file +var _0xb847=['http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb847,0x17e));var _0x7b84=function(_0x41d364,_0xdfdc1a){_0x41d364=_0x41d364-0x0;var _0x5ace98=_0xb847[_0x41d364];return _0x5ace98;};'use strict';var _=require(_0x7b84('0x0'));var util=require(_0x7b84('0x1'));var moment=require('moment');var BPromise=require(_0x7b84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b84('0x3'));var db=require(_0x7b84('0x4'))['db'];var utils=require(_0x7b84('0x5'));var logger=require(_0x7b84('0x6'))(_0x7b84('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7b84('0x8')]({'port':0x232a});config[_0x7b84('0x9')]=_[_0x7b84('0xa')](config[_0x7b84('0x9')],{'host':_0x7b84('0xb'),'port':0x18eb});var socket=require(_0x7b84('0xc'))(new Redis(config[_0x7b84('0x9')]));require(_0x7b84('0xd'))[_0x7b84('0xe')](socket);function respondWithRpcPromise(_0x5c5d19,_0x20d3a6,_0x2677c2){return new BPromise(function(_0x21b420,_0x47e2f0){return client['request'](_0x5c5d19,_0x2677c2)[_0x7b84('0xf')](function(_0x5a7c18){logger[_0x7b84('0x10')](_0x7b84('0x11'),_0x20d3a6,_0x7b84('0x12'));logger[_0x7b84('0x13')](_0x7b84('0x14'),_0x20d3a6,'request\x20sent',JSON['stringify'](_0x5a7c18));if(_0x5a7c18['error']){if(_0x5a7c18[_0x7b84('0x15')][_0x7b84('0x16')]===0x1f4){logger[_0x7b84('0x15')](_0x7b84('0x11'),_0x20d3a6,_0x5a7c18[_0x7b84('0x15')][_0x7b84('0x17')]);return _0x47e2f0(_0x5a7c18[_0x7b84('0x15')][_0x7b84('0x17')]);}logger[_0x7b84('0x15')](_0x7b84('0x11'),_0x20d3a6,_0x5a7c18[_0x7b84('0x15')][_0x7b84('0x17')]);return _0x21b420(_0x5a7c18[_0x7b84('0x15')][_0x7b84('0x17')]);}else{logger[_0x7b84('0x10')]('ChatQueue,\x20%s,\x20%s',_0x20d3a6,'request\x20sent');_0x21b420(_0x5a7c18[_0x7b84('0x18')][_0x7b84('0x17')]);}})['catch'](function(_0x52058d){logger['error'](_0x7b84('0x11'),_0x20d3a6,_0x52058d);_0x47e2f0(_0x52058d);});});}exports[_0x7b84('0x19')]=function(_0x35121e){var _0x467132=this;return new Promise(function(_0x1f6edf,_0x2239ba){return db[_0x7b84('0x1a')][_0x7b84('0x1b')]({'raw':_0x35121e['options']?_0x35121e[_0x7b84('0x1c')][_0x7b84('0x1d')]===undefined?!![]:![]:!![],'where':_0x35121e[_0x7b84('0x1c')]?_0x35121e['options'][_0x7b84('0x1e')]||null:null,'attributes':_0x35121e[_0x7b84('0x1c')]?_0x35121e['options'][_0x7b84('0x1f')]||null:null,'limit':_0x35121e['options']?_0x35121e[_0x7b84('0x1c')][_0x7b84('0x20')]||null:null,'include':_0x35121e[_0x7b84('0x1c')]?_0x35121e['options']['include']?_['map'](_0x35121e[_0x7b84('0x1c')][_0x7b84('0x21')],function(_0x5abb6e){return{'model':db[_0x5abb6e[_0x7b84('0x22')]],'as':_0x5abb6e['as'],'attributes':_0x5abb6e[_0x7b84('0x1f')],'include':_0x5abb6e['include']?_['map'](_0x5abb6e['include'],function(_0x3bea0c){return{'model':db[_0x3bea0c[_0x7b84('0x22')]],'as':_0x3bea0c['as'],'attributes':_0x3bea0c[_0x7b84('0x1f')],'include':_0x3bea0c[_0x7b84('0x21')]?_[_0x7b84('0x23')](_0x3bea0c['include'],function(_0x50fd74){return{'model':db[_0x50fd74['model']],'as':_0x50fd74['as'],'attributes':_0x50fd74['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b84('0xf')](function(_0x2903f2){logger['info'](_0x7b84('0x19'),_0x35121e);logger[_0x7b84('0x13')](_0x7b84('0x19'),_0x35121e,JSON['stringify'](_0x2903f2));_0x1f6edf(_0x2903f2);})[_0x7b84('0x24')](function(_0x5c836e){logger[_0x7b84('0x15')](_0x7b84('0x19'),_0x5c836e['message'],_0x35121e);_0x2239ba(_0x467132[_0x7b84('0x15')](0x1f4,_0x5c836e['message']));});});};exports[_0x7b84('0x25')]=function(_0x193095){var _0x20c388=this;return new Promise(function(_0x11eb5e,_0x287e6e){return db['ChatQueue'][_0x7b84('0x26')]({'raw':_0x193095['options']?_0x193095[_0x7b84('0x1c')][_0x7b84('0x1d')]===undefined?!![]:![]:!![],'where':_0x193095['options']?_0x193095[_0x7b84('0x1c')][_0x7b84('0x1e')]||null:null,'attributes':_0x193095[_0x7b84('0x1c')]?_0x193095[_0x7b84('0x1c')]['attributes']||null:null,'include':_0x193095['options']?_0x193095[_0x7b84('0x1c')][_0x7b84('0x21')]?_[_0x7b84('0x23')](_0x193095['options'][_0x7b84('0x21')],function(_0xa8220e){return{'model':db[_0xa8220e[_0x7b84('0x22')]],'as':_0xa8220e['as'],'attributes':_0xa8220e[_0x7b84('0x1f')],'include':_0xa8220e[_0x7b84('0x21')]?_['map'](_0xa8220e[_0x7b84('0x21')],function(_0x5d5c70){return{'model':db[_0x5d5c70[_0x7b84('0x22')]],'as':_0x5d5c70['as'],'attributes':_0x5d5c70[_0x7b84('0x1f')],'include':_0x5d5c70[_0x7b84('0x21')]?_[_0x7b84('0x23')](_0x5d5c70['include'],function(_0x148504){return{'model':db[_0x148504[_0x7b84('0x22')]],'as':_0x148504['as'],'attributes':_0x148504[_0x7b84('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7b84('0xf')](function(_0x34f4f3){logger[_0x7b84('0x10')]('ShowChatQueue',_0x193095);logger['debug'](_0x7b84('0x25'),_0x193095,JSON['stringify'](_0x34f4f3));_0x11eb5e(_0x34f4f3);})[_0x7b84('0x24')](function(_0x12fb73){logger[_0x7b84('0x15')](_0x7b84('0x25'),_0x12fb73['message'],_0x193095);_0x287e6e(_0x20c388[_0x7b84('0x15')](0x1f4,_0x12fb73['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 387da3e..4d90715 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 _0xcea2=['chatQueue:','./chatQueue.events','remove','removeListener','length'];(function(_0x2313e8,_0x332e97){var _0x482a35=function(_0xe736a0){while(--_0xe736a0){_0x2313e8['push'](_0x2313e8['shift']());}};_0x482a35(++_0x332e97);}(_0xcea2,0x15a));var _0x2cea=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xcea2[_0x5f3f88];return _0xd08119;};'use strict';var ChatQueueEvents=require(_0x2cea('0x0'));var events=['save',_0x2cea('0x1'),'update'];function createListener(_0x3e22c2,_0x7f1f5a){return function(_0x60a793){_0x7f1f5a['emit'](_0x3e22c2,_0x60a793);};}function removeListener(_0x3ff73f,_0x46060b){return function(){ChatQueueEvents[_0x2cea('0x2')](_0x3ff73f,_0x46060b);};}exports['register']=function(_0x34f0f2){for(var _0x485c26=0x0,_0x2d69ff=events[_0x2cea('0x3')];_0x485c26<_0x2d69ff;_0x485c26++){var _0x805a1b=events[_0x485c26];var _0x160cca=createListener(_0x2cea('0x4')+_0x805a1b,_0x34f0f2);ChatQueueEvents['on'](_0x805a1b,_0x160cca);}}; \ No newline at end of file +var _0x81bd=['save','remove','update','removeListener','./chatQueue.events'];(function(_0x1d2ef2,_0x1a7599){var _0x345183=function(_0x21384d){while(--_0x21384d){_0x1d2ef2['push'](_0x1d2ef2['shift']());}};_0x345183(++_0x1a7599);}(_0x81bd,0x7c));var _0xd81b=function(_0x4441cf,_0x4509a6){_0x4441cf=_0x4441cf-0x0;var _0x3b8877=_0x81bd[_0x4441cf];return _0x3b8877;};'use strict';var ChatQueueEvents=require(_0xd81b('0x0'));var events=[_0xd81b('0x1'),_0xd81b('0x2'),_0xd81b('0x3')];function createListener(_0x2d27cb,_0x2ec03a){return function(_0x111a9c){_0x2ec03a['emit'](_0x2d27cb,_0x111a9c);};}function removeListener(_0x16e8de,_0x2c3d9e){return function(){ChatQueueEvents[_0xd81b('0x4')](_0x16e8de,_0x2c3d9e);};}exports['register']=function(_0x42a0aa){for(var _0x34eb73=0x0,_0x1f3f2c=events['length'];_0x34eb73<_0x1f3f2c;_0x34eb73++){var _0x5e14e8=events[_0x34eb73];var _0xa4cf97=createListener('chatQueue:'+_0x5e14e8,_0x42a0aa);ChatQueueEvents['on'](_0x5e14e8,_0xa4cf97);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index f56bf75..111e058 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4fcc5b,_0x2fe9ef){var _0x48cb49=function(_0x47fc29){while(--_0x47fc29){_0x4fcc5b['push'](_0x4fcc5b['shift']());}};_0x48cb49(++_0x2fe9ef);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x5fc3[_0x533110];return _0xc3c866;};'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 bcfce8b..667713d 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 _0x1efb=['sequelize','exports','STRING','DATE','moment'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x1efb,0x149));var _0xb1ef=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1efb[_0x465a0c];return _0x1e202e;};'use strict';var moment=require(_0xb1ef('0x0'));var Sequelize=require(_0xb1ef('0x1'));module[_0xb1ef('0x2')]={'uniqueid':{'type':Sequelize[_0xb1ef('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb1ef('0x3')]},'joinAt':{'type':Sequelize[_0xb1ef('0x4')]},'leaveAt':{'type':Sequelize[_0xb1ef('0x4')]},'acceptAt':{'type':Sequelize[_0xb1ef('0x4')]},'exitAt':{'type':Sequelize[_0xb1ef('0x4')]},'reason':{'type':Sequelize[_0xb1ef('0x3')]}}; \ No newline at end of file +var _0x36c3=['STRING','DATE','sequelize','exports'];(function(_0x2552b9,_0x5e66f7){var _0x54394e=function(_0x26993e){while(--_0x26993e){_0x2552b9['push'](_0x2552b9['shift']());}};_0x54394e(++_0x5e66f7);}(_0x36c3,0x132));var _0x336c=function(_0x10d244,_0x49c680){_0x10d244=_0x10d244-0x0;var _0x67755d=_0x36c3[_0x10d244];return _0x67755d;};'use strict';var moment=require('moment');var Sequelize=require(_0x336c('0x0'));module[_0x336c('0x1')]={'uniqueid':{'type':Sequelize[_0x336c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x336c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x336c('0x3')]},'acceptAt':{'type':Sequelize[_0x336c('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x336c('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index ad87a90..cf90988 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 _0x27eb=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x27eb,0xd0));var _0xb27e=function(_0x4a0311,_0x4bb96f){_0x4a0311=_0x4a0311-0x0;var _0x4d34d1=_0x27eb[_0x4a0311];return _0x4d34d1;};'use strict';var emlformat=require(_0xb27e('0x0'));var rimraf=require(_0xb27e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require(_0xb27e('0x4'));var Mustache=require('mustache');var util=require(_0xb27e('0x5'));var path=require(_0xb27e('0x6'));var sox=require(_0xb27e('0x7'));var csv=require(_0xb27e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb27e('0x9'));var _=require(_0xb27e('0xa'));var squel=require(_0xb27e('0xb'));var crypto=require(_0xb27e('0xc'));var jsforce=require(_0xb27e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb27e('0x8'));var querystring=require(_0xb27e('0xe'));var Papa=require(_0xb27e('0xf'));var Redis=require(_0xb27e('0x10'));var authService=require(_0xb27e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb27e('0x12'));var hardwareService=require(_0xb27e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb27e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb27e('0x15'));var db=require(_0xb27e('0x16'))['db'];function respondWithStatusCode(_0x4d0b5d,_0x58b37f){_0x58b37f=_0x58b37f||0xcc;return function(_0x48c914){if(_0x48c914){return _0x4d0b5d[_0xb27e('0x17')](_0x58b37f);}return _0x4d0b5d['status'](_0x58b37f)[_0xb27e('0x18')]();};}function respondWithResult(_0x54657b,_0x1b55e2){_0x1b55e2=_0x1b55e2||0xc8;return function(_0x5aa86f){if(_0x5aa86f){return _0x54657b[_0xb27e('0x19')](_0x1b55e2)[_0xb27e('0x1a')](_0x5aa86f);}};}function respondWithFilteredResult(_0x28cc6d,_0x522bbf){return function(_0x26ec32){if(_0x26ec32){var _0x1d14bb=typeof _0x522bbf[_0xb27e('0x1b')]===_0xb27e('0x1c')&&typeof _0x522bbf[_0xb27e('0x1d')]===_0xb27e('0x1c');var _0x25ce70=_0x26ec32[_0xb27e('0x1e')];var _0x317f4e=_0x1d14bb?0x0:_0x522bbf['offset'];var _0x8be243=_0x1d14bb?_0x26ec32[_0xb27e('0x1e')]:_0x522bbf[_0xb27e('0x1b')]+_0x522bbf['limit'];var _0x352856;if(_0x8be243>=_0x25ce70){_0x8be243=_0x25ce70;_0x352856=0xc8;}else{_0x352856=0xce;}_0x28cc6d['status'](_0x352856);return _0x28cc6d['set'](_0xb27e('0x1f'),_0x317f4e+'-'+_0x8be243+'/'+_0x25ce70)[_0xb27e('0x1a')](_0x26ec32);}return null;};}function patchUpdates(_0x4ec66c){return function(_0x2a78c0){try{jsonpatch[_0xb27e('0x20')](_0x2a78c0,_0x4ec66c,!![]);}catch(_0x16c950){return BPromise[_0xb27e('0x21')](_0x16c950);}return _0x2a78c0['save']();};}function saveUpdates(_0x3c9e21,_0x5a3cdf){return function(_0x19c0f2){if(_0x19c0f2){return _0x19c0f2[_0xb27e('0x22')](_0x3c9e21)['then'](function(_0x58fc84){return _0x58fc84;});}return null;};}function removeEntity(_0x2146c0,_0xfbc258){return function(_0x3703ab){if(_0x3703ab){return _0x3703ab[_0xb27e('0x23')]()[_0xb27e('0x24')](function(){_0x2146c0['status'](0xcc)[_0xb27e('0x18')]();});}};}function handleEntityNotFound(_0x4cba0b,_0x3972bc){return function(_0x1ac460){if(!_0x1ac460){_0x4cba0b[_0xb27e('0x17')](0x194);}return _0x1ac460;};}function handleError(_0x3fbc78,_0x3254fb){_0x3254fb=_0x3254fb||0x1f4;return function(_0x4dab95){logger[_0xb27e('0x25')](_0x4dab95['stack']);if(_0x4dab95[_0xb27e('0x26')]){delete _0x4dab95[_0xb27e('0x26')];}_0x3fbc78[_0xb27e('0x19')](_0x3254fb)[_0xb27e('0x27')](_0x4dab95);};}exports[_0xb27e('0x28')]=function(_0x35169a,_0xd27061){var _0x125c0b={},_0x42c5de={},_0x4ef0e6={'count':0x0,'rows':[]};var _0x377d79=_[_0xb27e('0x29')](db[_0xb27e('0x2a')][_0xb27e('0x2b')],function(_0x58a1a9){return{'name':_0x58a1a9[_0xb27e('0x2c')],'type':_0x58a1a9[_0xb27e('0x2d')][_0xb27e('0x2e')]};});_0x42c5de[_0xb27e('0x2f')]=_[_0xb27e('0x29')](_0x377d79,_0xb27e('0x26'));_0x42c5de[_0xb27e('0x30')]=_['keys'](_0x35169a['query']);_0x42c5de[_0xb27e('0x31')]=_['intersection'](_0x42c5de[_0xb27e('0x2f')],_0x42c5de['query']);_0x125c0b[_0xb27e('0x32')]=_[_0xb27e('0x33')](_0x42c5de[_0xb27e('0x2f')],qs[_0xb27e('0x34')](_0x35169a[_0xb27e('0x30')][_0xb27e('0x34')]));_0x125c0b['attributes']=_0x125c0b[_0xb27e('0x32')]['length']?_0x125c0b[_0xb27e('0x32')]:_0x42c5de['model'];if(!_0x35169a[_0xb27e('0x30')]['hasOwnProperty'](_0xb27e('0x35'))){_0x125c0b[_0xb27e('0x1d')]=qs['limit'](_0x35169a['query'][_0xb27e('0x1d')]);_0x125c0b['offset']=qs['offset'](_0x35169a['query'][_0xb27e('0x1b')]);}_0x125c0b[_0xb27e('0x36')]=qs['sort'](_0x35169a[_0xb27e('0x30')][_0xb27e('0x37')]);_0x125c0b['where']=qs['filters'](_[_0xb27e('0x38')](_0x35169a['query'],_0x42c5de[_0xb27e('0x31')]),_0x377d79);if(_0x35169a['query'][_0xb27e('0x39')]){_0x125c0b[_0xb27e('0x3a')]=_[_0xb27e('0x3b')](_0x125c0b[_0xb27e('0x3a')],{'$or':_[_0xb27e('0x29')](_0x377d79,function(_0x1239d4){if(_0x1239d4[_0xb27e('0x2d')]!==_0xb27e('0x3c')){var _0x533343={};_0x533343[_0x1239d4[_0xb27e('0x26')]]={'$like':'%'+_0x35169a[_0xb27e('0x30')][_0xb27e('0x39')]+'%'};return _0x533343;}})});}_0x125c0b=_[_0xb27e('0x3b')]({},_0x125c0b,_0x35169a[_0xb27e('0x3d')]);var _0x564699={'where':_0x125c0b['where']};return db[_0xb27e('0x2a')][_0xb27e('0x1e')](_0x564699)[_0xb27e('0x24')](function(_0x5c7742){_0x4ef0e6[_0xb27e('0x1e')]=_0x5c7742;if(_0x35169a[_0xb27e('0x30')][_0xb27e('0x3e')]){_0x125c0b[_0xb27e('0x3f')]=[{'all':!![]}];}return db[_0xb27e('0x2a')][_0xb27e('0x40')](_0x125c0b);})[_0xb27e('0x24')](function(_0x4d90bf){_0x4ef0e6['rows']=_0x4d90bf;return _0x4ef0e6;})[_0xb27e('0x24')](respondWithFilteredResult(_0xd27061,_0x125c0b))[_0xb27e('0x41')](handleError(_0xd27061,null));};exports[_0xb27e('0x42')]=function(_0x3272ba,_0x11fafd){var _0x42f5e3={'raw':!![],'where':{'id':_0x3272ba[_0xb27e('0x43')]['id']}},_0x2959f5={};_0x2959f5['model']=_[_0xb27e('0x44')](db[_0xb27e('0x2a')][_0xb27e('0x2b')]);_0x2959f5[_0xb27e('0x30')]=_['keys'](_0x3272ba[_0xb27e('0x30')]);_0x2959f5['filters']=_['intersection'](_0x2959f5[_0xb27e('0x2f')],_0x2959f5[_0xb27e('0x30')]);_0x42f5e3['attributes']=_[_0xb27e('0x33')](_0x2959f5[_0xb27e('0x2f')],qs[_0xb27e('0x34')](_0x3272ba[_0xb27e('0x30')][_0xb27e('0x34')]));_0x42f5e3[_0xb27e('0x32')]=_0x42f5e3[_0xb27e('0x32')]['length']?_0x42f5e3[_0xb27e('0x32')]:_0x2959f5['model'];if(_0x3272ba[_0xb27e('0x30')][_0xb27e('0x3e')]){_0x42f5e3[_0xb27e('0x3f')]=[{'all':!![]}];}_0x42f5e3=_[_0xb27e('0x3b')]({},_0x42f5e3,_0x3272ba[_0xb27e('0x3d')]);return db[_0xb27e('0x2a')]['find'](_0x42f5e3)['then'](handleEntityNotFound(_0x11fafd,null))[_0xb27e('0x24')](respondWithResult(_0x11fafd,null))[_0xb27e('0x41')](handleError(_0x11fafd,null));};exports[_0xb27e('0x45')]=function(_0x15b5cb,_0x238bb9){return db['ChatQueueReport'][_0xb27e('0x45')](_0x15b5cb[_0xb27e('0x46')],{})[_0xb27e('0x24')](respondWithResult(_0x238bb9,0xc9))[_0xb27e('0x41')](handleError(_0x238bb9,null));};exports[_0xb27e('0x22')]=function(_0x16a71b,_0x320b9c){if(_0x16a71b[_0xb27e('0x46')]['id']){delete _0x16a71b[_0xb27e('0x46')]['id'];}return db[_0xb27e('0x2a')][_0xb27e('0x47')]({'where':{'id':_0x16a71b['params']['id']}})[_0xb27e('0x24')](handleEntityNotFound(_0x320b9c,null))['then'](saveUpdates(_0x16a71b[_0xb27e('0x46')],null))[_0xb27e('0x24')](respondWithResult(_0x320b9c,null))[_0xb27e('0x41')](handleError(_0x320b9c,null));};exports[_0xb27e('0x23')]=function(_0x91095,_0x1af27d){return db[_0xb27e('0x2a')][_0xb27e('0x47')]({'where':{'id':_0x91095['params']['id']}})['then'](handleEntityNotFound(_0x1af27d,null))[_0xb27e('0x24')](removeEntity(_0x1af27d,null))[_0xb27e('0x41')](handleError(_0x1af27d,null));};exports[_0xb27e('0x48')]=function(_0x583293,_0x1c4846){return db['ChatQueueReport'][_0xb27e('0x48')]()[_0xb27e('0x24')](respondWithResult(_0x1c4846,null))[_0xb27e('0x41')](handleError(_0x1c4846,null));}; \ No newline at end of file +var _0x9ab0=['length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x5b5ffe,_0x1c5874){var _0x2d12bc=function(_0x14d075){while(--_0x14d075){_0x5b5ffe['push'](_0x5b5ffe['shift']());}};_0x2d12bc(++_0x1c5874);}(_0x9ab0,0x195));var _0x09ab=function(_0x53a441,_0x1760aa){_0x53a441=_0x53a441-0x0;var _0xea5ff9=_0x9ab0[_0x53a441];return _0xea5ff9;};'use strict';var emlformat=require(_0x09ab('0x0'));var rimraf=require(_0x09ab('0x1'));var zipdir=require(_0x09ab('0x2'));var jsonpatch=require(_0x09ab('0x3'));var rp=require(_0x09ab('0x4'));var moment=require(_0x09ab('0x5'));var BPromise=require(_0x09ab('0x6'));var Mustache=require(_0x09ab('0x7'));var util=require(_0x09ab('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x09ab('0x9'));var fs=require('fs');var fs_extra=require(_0x09ab('0xa'));var _=require(_0x09ab('0xb'));var squel=require(_0x09ab('0xc'));var crypto=require(_0x09ab('0xd'));var jsforce=require(_0x09ab('0xe'));var deskjs=require(_0x09ab('0xf'));var toCsv=require(_0x09ab('0x10'));var querystring=require(_0x09ab('0x11'));var Papa=require('papaparse');var Redis=require(_0x09ab('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x09ab('0x13'));var as=require(_0x09ab('0x14'));var hardwareService=require(_0x09ab('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x09ab('0x16'));var config=require(_0x09ab('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cd3d7,_0x1a667a){_0x1a667a=_0x1a667a||0xcc;return function(_0x367bc4){if(_0x367bc4){return _0x3cd3d7[_0x09ab('0x18')](_0x1a667a);}return _0x3cd3d7[_0x09ab('0x19')](_0x1a667a)[_0x09ab('0x1a')]();};}function respondWithResult(_0x18ecda,_0x25bb6b){_0x25bb6b=_0x25bb6b||0xc8;return function(_0x10971){if(_0x10971){return _0x18ecda[_0x09ab('0x19')](_0x25bb6b)[_0x09ab('0x1b')](_0x10971);}};}function respondWithFilteredResult(_0x27cf42,_0x5ac9da){return function(_0x24db01){if(_0x24db01){var _0x3ff3b2=typeof _0x5ac9da[_0x09ab('0x1c')]==='undefined'&&typeof _0x5ac9da[_0x09ab('0x1d')]===_0x09ab('0x1e');var _0x2f75a8=_0x24db01['count'];var _0x3d77d6=_0x3ff3b2?0x0:_0x5ac9da[_0x09ab('0x1c')];var _0x88f781=_0x3ff3b2?_0x24db01[_0x09ab('0x1f')]:_0x5ac9da[_0x09ab('0x1c')]+_0x5ac9da[_0x09ab('0x1d')];var _0x5c053b;if(_0x88f781>=_0x2f75a8){_0x88f781=_0x2f75a8;_0x5c053b=0xc8;}else{_0x5c053b=0xce;}_0x27cf42[_0x09ab('0x19')](_0x5c053b);return _0x27cf42[_0x09ab('0x20')]('Content-Range',_0x3d77d6+'-'+_0x88f781+'/'+_0x2f75a8)[_0x09ab('0x1b')](_0x24db01);}return null;};}function patchUpdates(_0x6a3b15){return function(_0x1be6af){try{jsonpatch[_0x09ab('0x21')](_0x1be6af,_0x6a3b15,!![]);}catch(_0x403d30){return BPromise[_0x09ab('0x22')](_0x403d30);}return _0x1be6af[_0x09ab('0x23')]();};}function saveUpdates(_0x1bde95,_0x48d46c){return function(_0x30304f){if(_0x30304f){return _0x30304f[_0x09ab('0x24')](_0x1bde95)[_0x09ab('0x25')](function(_0x33e2d8){return _0x33e2d8;});}return null;};}function removeEntity(_0x3314b8,_0x35ea70){return function(_0x597beb){if(_0x597beb){return _0x597beb[_0x09ab('0x26')]()[_0x09ab('0x25')](function(){_0x3314b8[_0x09ab('0x19')](0xcc)[_0x09ab('0x1a')]();});}};}function handleEntityNotFound(_0x293e54,_0x4c776b){return function(_0x50a95b){if(!_0x50a95b){_0x293e54[_0x09ab('0x18')](0x194);}return _0x50a95b;};}function handleError(_0x40932c,_0x5138d4){_0x5138d4=_0x5138d4||0x1f4;return function(_0x429b1b){logger[_0x09ab('0x27')](_0x429b1b[_0x09ab('0x28')]);if(_0x429b1b[_0x09ab('0x29')]){delete _0x429b1b[_0x09ab('0x29')];}_0x40932c[_0x09ab('0x19')](_0x5138d4)[_0x09ab('0x2a')](_0x429b1b);};}exports[_0x09ab('0x2b')]=function(_0x55c5f0,_0x1f4eed){var _0x2d4028={},_0x300e2a={},_0x333684={'count':0x0,'rows':[]};var _0x177069=_[_0x09ab('0x2c')](db[_0x09ab('0x2d')][_0x09ab('0x2e')],function(_0x222892){return{'name':_0x222892[_0x09ab('0x2f')],'type':_0x222892[_0x09ab('0x30')][_0x09ab('0x31')]};});_0x300e2a[_0x09ab('0x32')]=_['map'](_0x177069,_0x09ab('0x29'));_0x300e2a[_0x09ab('0x33')]=_[_0x09ab('0x34')](_0x55c5f0[_0x09ab('0x33')]);_0x300e2a[_0x09ab('0x35')]=_[_0x09ab('0x36')](_0x300e2a[_0x09ab('0x32')],_0x300e2a[_0x09ab('0x33')]);_0x2d4028[_0x09ab('0x37')]=_['intersection'](_0x300e2a['model'],qs[_0x09ab('0x38')](_0x55c5f0[_0x09ab('0x33')]['fields']));_0x2d4028[_0x09ab('0x37')]=_0x2d4028[_0x09ab('0x37')][_0x09ab('0x39')]?_0x2d4028['attributes']:_0x300e2a[_0x09ab('0x32')];if(!_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x3a')]('nolimit')){_0x2d4028['limit']=qs[_0x09ab('0x1d')](_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x1d')]);_0x2d4028[_0x09ab('0x1c')]=qs[_0x09ab('0x1c')](_0x55c5f0['query'][_0x09ab('0x1c')]);}_0x2d4028[_0x09ab('0x3b')]=qs['sort'](_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x3c')]);_0x2d4028['where']=qs['filters'](_['pick'](_0x55c5f0['query'],_0x300e2a[_0x09ab('0x35')]),_0x177069);if(_0x55c5f0[_0x09ab('0x33')]['filter']){_0x2d4028[_0x09ab('0x3d')]=_[_0x09ab('0x3e')](_0x2d4028[_0x09ab('0x3d')],{'$or':_[_0x09ab('0x2c')](_0x177069,function(_0x5e2597){if(_0x5e2597[_0x09ab('0x30')]!==_0x09ab('0x3f')){var _0x3f8011={};_0x3f8011[_0x5e2597[_0x09ab('0x29')]]={'$like':'%'+_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x40')]+'%'};return _0x3f8011;}})});}_0x2d4028=_[_0x09ab('0x3e')]({},_0x2d4028,_0x55c5f0[_0x09ab('0x41')]);var _0x3d8a67={'where':_0x2d4028[_0x09ab('0x3d')]};return db[_0x09ab('0x2d')][_0x09ab('0x1f')](_0x3d8a67)['then'](function(_0x24a7c6){_0x333684[_0x09ab('0x1f')]=_0x24a7c6;if(_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x42')]){_0x2d4028[_0x09ab('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x09ab('0x44')](_0x2d4028);})['then'](function(_0x12f859){_0x333684[_0x09ab('0x45')]=_0x12f859;return _0x333684;})[_0x09ab('0x25')](respondWithFilteredResult(_0x1f4eed,_0x2d4028))[_0x09ab('0x46')](handleError(_0x1f4eed,null));};exports[_0x09ab('0x47')]=function(_0x5ded5d,_0x171383){var _0x277ea6={'raw':!![],'where':{'id':_0x5ded5d[_0x09ab('0x48')]['id']}},_0x4430f2={};_0x4430f2[_0x09ab('0x32')]=_[_0x09ab('0x34')](db[_0x09ab('0x2d')][_0x09ab('0x2e')]);_0x4430f2[_0x09ab('0x33')]=_[_0x09ab('0x34')](_0x5ded5d[_0x09ab('0x33')]);_0x4430f2[_0x09ab('0x35')]=_[_0x09ab('0x36')](_0x4430f2[_0x09ab('0x32')],_0x4430f2[_0x09ab('0x33')]);_0x277ea6[_0x09ab('0x37')]=_[_0x09ab('0x36')](_0x4430f2[_0x09ab('0x32')],qs[_0x09ab('0x38')](_0x5ded5d['query']['fields']));_0x277ea6[_0x09ab('0x37')]=_0x277ea6[_0x09ab('0x37')]['length']?_0x277ea6[_0x09ab('0x37')]:_0x4430f2[_0x09ab('0x32')];if(_0x5ded5d['query'][_0x09ab('0x42')]){_0x277ea6[_0x09ab('0x43')]=[{'all':!![]}];}_0x277ea6=_['merge']({},_0x277ea6,_0x5ded5d[_0x09ab('0x41')]);return db[_0x09ab('0x2d')][_0x09ab('0x49')](_0x277ea6)[_0x09ab('0x25')](handleEntityNotFound(_0x171383,null))[_0x09ab('0x25')](respondWithResult(_0x171383,null))[_0x09ab('0x46')](handleError(_0x171383,null));};exports[_0x09ab('0x4a')]=function(_0x361424,_0x4a582c){return db[_0x09ab('0x2d')][_0x09ab('0x4a')](_0x361424[_0x09ab('0x4b')],{})['then'](respondWithResult(_0x4a582c,0xc9))[_0x09ab('0x46')](handleError(_0x4a582c,null));};exports[_0x09ab('0x24')]=function(_0x3e45a1,_0xc2a33b){if(_0x3e45a1['body']['id']){delete _0x3e45a1['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3e45a1[_0x09ab('0x48')]['id']}})[_0x09ab('0x25')](handleEntityNotFound(_0xc2a33b,null))[_0x09ab('0x25')](saveUpdates(_0x3e45a1['body'],null))[_0x09ab('0x25')](respondWithResult(_0xc2a33b,null))[_0x09ab('0x46')](handleError(_0xc2a33b,null));};exports['destroy']=function(_0x21b10c,_0xee2f7b){return db[_0x09ab('0x2d')][_0x09ab('0x49')]({'where':{'id':_0x21b10c['params']['id']}})[_0x09ab('0x25')](handleEntityNotFound(_0xee2f7b,null))[_0x09ab('0x25')](removeEntity(_0xee2f7b,null))[_0x09ab('0x46')](handleError(_0xee2f7b,null));};exports[_0x09ab('0x4c')]=function(_0x2002c2,_0x55fd92){return db[_0x09ab('0x2d')][_0x09ab('0x4c')]()[_0x09ab('0x25')](respondWithResult(_0x55fd92,null))[_0x09ab('0x46')](handleError(_0x55fd92,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3baf713..d35dfcd 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2c0668,_0x56f1ec){var _0x3e83d4=function(_0x5522b0){while(--_0x5522b0){_0x2c0668['push'](_0x2c0668['shift']());}};_0x3e83d4(++_0x56f1ec);}(_0x757a,0xde));var _0xa757=function(_0x1fb627,_0x50d72b){_0x1fb627=_0x1fb627-0x0;var _0x27f296=_0x757a[_0x1fb627];return _0x27f296;};'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 +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x459b74,_0x5773bd){var _0x46cb16=function(_0x97867f){while(--_0x97867f){_0x459b74['push'](_0x459b74['shift']());}};_0x46cb16(++_0x5773bd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d086655..950e638 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 _0x79d1=['result','ChatQueueReport','create','body','options','then','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x51001a,_0x34fd24){var _0x23a3db=function(_0x563198){while(--_0x563198){_0x51001a['push'](_0x51001a['shift']());}};_0x23a3db(++_0x34fd24);}(_0x79d1,0x136));var _0x179d=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x79d1[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x179d('0x0'));var BPromise=require(_0x179d('0x1'));var rs=require(_0x179d('0x2'));var fs=require('fs');var Redis=require(_0x179d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x179d('0x4'));var logger=require(_0x179d('0x5'))(_0x179d('0x6'));var config=require(_0x179d('0x7'));var jayson=require(_0x179d('0x8'));var client=jayson['client'][_0x179d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33982f,_0x3853c6,_0x1f0351){return new BPromise(function(_0x3b022e,_0x1f8b27){return client[_0x179d('0xa')](_0x33982f,_0x1f0351)['then'](function(_0x3bb590){logger[_0x179d('0xb')](_0x179d('0xc'),_0x3853c6,'request\x20sent');logger[_0x179d('0xd')](_0x179d('0xe'),_0x3853c6,_0x179d('0xf'),JSON[_0x179d('0x10')](_0x3bb590));if(_0x3bb590[_0x179d('0x11')]){if(_0x3bb590[_0x179d('0x11')][_0x179d('0x12')]===0x1f4){logger['error'](_0x179d('0xc'),_0x3853c6,_0x3bb590[_0x179d('0x11')][_0x179d('0x13')]);return _0x1f8b27(_0x3bb590[_0x179d('0x11')][_0x179d('0x13')]);}logger[_0x179d('0x11')](_0x179d('0xc'),_0x3853c6,_0x3bb590['error'][_0x179d('0x13')]);return _0x3b022e(_0x3bb590['error']['message']);}else{logger[_0x179d('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x3853c6,_0x179d('0xf'));_0x3b022e(_0x3bb590[_0x179d('0x14')][_0x179d('0x13')]);}})['catch'](function(_0x1ecbaa){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3853c6,_0x1ecbaa);_0x1f8b27(_0x1ecbaa);});});}exports['CreateChatQueueReport']=function(_0x1fefe4){var _0x10da39=this;return new Promise(function(_0x2e17b8,_0x5cd586){return db[_0x179d('0x15')][_0x179d('0x16')](_0x1fefe4[_0x179d('0x17')],{'raw':_0x1fefe4[_0x179d('0x18')]?_0x1fefe4[_0x179d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x179d('0x19')](function(_0x22b096){logger[_0x179d('0xb')]('CreateChatQueueReport',_0x1fefe4);logger[_0x179d('0xd')]('CreateChatQueueReport',_0x1fefe4,JSON['stringify'](_0x22b096));_0x2e17b8(_0x22b096);})['catch'](function(_0x13a6d8){logger[_0x179d('0x11')](_0x179d('0x1a'),_0x13a6d8[_0x179d('0x13')],_0x1fefe4);_0x5cd586(_0x10da39[_0x179d('0x11')](0x1f4,_0x13a6d8['message']));});});};exports[_0x179d('0x1b')]=function(_0x117473){var _0xd5c8f6=this;return new Promise(function(_0xfd5f85,_0x407ca0){return db[_0x179d('0x15')][_0x179d('0x1c')](_0x117473[_0x179d('0x17')],{'raw':_0x117473[_0x179d('0x18')]?_0x117473['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x117473['options']?_0x117473[_0x179d('0x18')][_0x179d('0x1d')]||null:null,'attributes':_0x117473[_0x179d('0x18')]?_0x117473[_0x179d('0x18')][_0x179d('0x1e')]||null:null,'limit':_0x117473[_0x179d('0x18')]?_0x117473['options'][_0x179d('0x1f')]||null:null})['then'](function(_0x32b8ac){logger['info'](_0x179d('0x1b'),_0x117473);logger[_0x179d('0xd')](_0x179d('0x1b'),_0x117473,JSON[_0x179d('0x10')](_0x32b8ac));_0xfd5f85(_0x32b8ac);})[_0x179d('0x20')](function(_0x1d444b){logger[_0x179d('0x11')](_0x179d('0x1b'),_0x1d444b[_0x179d('0x13')],_0x117473);_0x407ca0(_0xd5c8f6[_0x179d('0x11')](0x1f4,_0x1d444b['message']));});});}; \ No newline at end of file +var _0x66bf=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis'];(function(_0x4c4fcb,_0xf87b0d){var _0x1041db=function(_0x283f62){while(--_0x283f62){_0x4c4fcb['push'](_0x4c4fcb['shift']());}};_0x1041db(++_0xf87b0d);}(_0x66bf,0x1c9));var _0xf66b=function(_0x1693e1,_0xcd6a2e){_0x1693e1=_0x1693e1-0x0;var _0x29ccb0=_0x66bf[_0x1693e1];return _0x29ccb0;};'use strict';var _=require(_0xf66b('0x0'));var util=require(_0xf66b('0x1'));var moment=require(_0xf66b('0x2'));var BPromise=require(_0xf66b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf66b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf66b('0x5'))(_0xf66b('0x6'));var config=require(_0xf66b('0x7'));var jayson=require(_0xf66b('0x8'));var client=jayson['client'][_0xf66b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21407a,_0x2d86bc,_0xa6edc5){return new BPromise(function(_0x17a66f,_0x561c87){return client[_0xf66b('0xa')](_0x21407a,_0xa6edc5)[_0xf66b('0xb')](function(_0xfde58a){logger['info'](_0xf66b('0xc'),_0x2d86bc,_0xf66b('0xd'));logger['debug'](_0xf66b('0xe'),_0x2d86bc,_0xf66b('0xd'),JSON[_0xf66b('0xf')](_0xfde58a));if(_0xfde58a[_0xf66b('0x10')]){if(_0xfde58a[_0xf66b('0x10')]['code']===0x1f4){logger[_0xf66b('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x2d86bc,_0xfde58a[_0xf66b('0x10')][_0xf66b('0x11')]);return _0x561c87(_0xfde58a[_0xf66b('0x10')][_0xf66b('0x11')]);}logger[_0xf66b('0x10')](_0xf66b('0xc'),_0x2d86bc,_0xfde58a[_0xf66b('0x10')][_0xf66b('0x11')]);return _0x17a66f(_0xfde58a[_0xf66b('0x10')][_0xf66b('0x11')]);}else{logger[_0xf66b('0x12')](_0xf66b('0xc'),_0x2d86bc,_0xf66b('0xd'));_0x17a66f(_0xfde58a[_0xf66b('0x13')]['message']);}})['catch'](function(_0x34afb6){logger['error'](_0xf66b('0xc'),_0x2d86bc,_0x34afb6);_0x561c87(_0x34afb6);});});}exports[_0xf66b('0x14')]=function(_0x48fb98){var _0x545330=this;return new Promise(function(_0x342a6f,_0x4a5530){return db[_0xf66b('0x15')][_0xf66b('0x16')](_0x48fb98[_0xf66b('0x17')],{'raw':_0x48fb98[_0xf66b('0x18')]?_0x48fb98[_0xf66b('0x18')][_0xf66b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x268492){logger[_0xf66b('0x12')]('CreateChatQueueReport',_0x48fb98);logger['debug']('CreateChatQueueReport',_0x48fb98,JSON[_0xf66b('0xf')](_0x268492));_0x342a6f(_0x268492);})[_0xf66b('0x1a')](function(_0x501f9c){logger[_0xf66b('0x10')](_0xf66b('0x14'),_0x501f9c[_0xf66b('0x11')],_0x48fb98);_0x4a5530(_0x545330[_0xf66b('0x10')](0x1f4,_0x501f9c['message']));});});};exports[_0xf66b('0x1b')]=function(_0x2f3d08){var _0x1cde32=this;return new Promise(function(_0x493163,_0x2d68d9){return db[_0xf66b('0x15')][_0xf66b('0x1c')](_0x2f3d08[_0xf66b('0x17')],{'raw':_0x2f3d08[_0xf66b('0x18')]?_0x2f3d08[_0xf66b('0x18')][_0xf66b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f3d08[_0xf66b('0x18')]?_0x2f3d08['options'][_0xf66b('0x1d')]||null:null,'attributes':_0x2f3d08[_0xf66b('0x18')]?_0x2f3d08[_0xf66b('0x18')][_0xf66b('0x1e')]||null:null,'limit':_0x2f3d08[_0xf66b('0x18')]?_0x2f3d08['options'][_0xf66b('0x1f')]||null:null})[_0xf66b('0xb')](function(_0x348d81){logger[_0xf66b('0x12')]('UpdateChatQueueReport',_0x2f3d08);logger[_0xf66b('0x20')](_0xf66b('0x1b'),_0x2f3d08,JSON[_0xf66b('0xf')](_0x348d81));_0x493163(_0x348d81);})['catch'](function(_0x593fad){logger[_0xf66b('0x10')]('UpdateChatQueueReport',_0x593fad[_0xf66b('0x11')],_0x2f3d08);_0x2d68d9(_0x1cde32['error'](0x1f4,_0x593fad['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 569f746..76ab85b 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 _0xa0e0=['get','isAuthenticated','index','/describe','/:id','show','put','update','path','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa0e0,0xb1));var _0x0a0e=function(_0x1c8ee2,_0x566902){_0x1c8ee2=_0x1c8ee2-0x0;var _0x356fa7=_0xa0e0[_0x1c8ee2];return _0x356fa7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a0e('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a0e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x0a0e('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x0a0e('0x3'));var controller=require(_0x0a0e('0x4'));router[_0x0a0e('0x5')]('/',auth[_0x0a0e('0x6')](),controller[_0x0a0e('0x7')]);router[_0x0a0e('0x5')](_0x0a0e('0x8'),auth[_0x0a0e('0x6')](),controller['describe']);router[_0x0a0e('0x5')](_0x0a0e('0x9'),auth['isAuthenticated'](),controller[_0x0a0e('0xa')]);router['post']('/',auth[_0x0a0e('0x6')](),controller['create']);router[_0x0a0e('0xb')]('/:id',auth[_0x0a0e('0x6')](),controller[_0x0a0e('0xc')]);router['delete'](_0x0a0e('0x9'),auth[_0x0a0e('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9886=['put','delete','multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x3baf61,_0x187408){var _0x515476=function(_0x450f8f){while(--_0x450f8f){_0x3baf61['push'](_0x3baf61['shift']());}};_0x515476(++_0x187408);}(_0x9886,0x89));var _0x6988=function(_0x5a0e2f,_0x2d039e){_0x5a0e2f=_0x5a0e2f-0x0;var _0x4e05ae=_0x9886[_0x5a0e2f];return _0x4e05ae;};'use strict';var multer=require(_0x6988('0x0'));var util=require(_0x6988('0x1'));var path=require(_0x6988('0x2'));var timeout=require('connect-timeout');var express=require(_0x6988('0x3'));var router=express[_0x6988('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6988('0x5'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x6988('0x6')]('/',auth[_0x6988('0x7')](),controller[_0x6988('0x8')]);router[_0x6988('0x6')](_0x6988('0x9'),auth[_0x6988('0x7')](),controller['describe']);router[_0x6988('0x6')](_0x6988('0xa'),auth[_0x6988('0x7')](),controller['show']);router[_0x6988('0xb')]('/',auth[_0x6988('0x7')](),controller[_0x6988('0xc')]);router[_0x6988('0xd')]('/:id',auth[_0x6988('0x7')](),controller['update']);router[_0x6988('0xe')](_0x6988('0xa'),auth[_0x6988('0x7')](),controller['destroy']);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 67237f4..e72350c 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x22d045,_0x13fd64){var _0x2460b1=function(_0x3e0ddf){while(--_0x3e0ddf){_0x22d045['push'](_0x22d045['shift']());}};_0x2460b1(++_0x13fd64);}(_0x54ef,0x112));var _0xf54e=function(_0x377b61,_0x4c03f3){_0x377b61=_0x377b61-0x0;var _0x3a940c=_0x54ef[_0x377b61];return _0x3a940c;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 26e9b20..47c8dd4 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 _0x7ac6=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x7ac6,0x12b));var _0x67ac=function(_0x286c46,_0xb5c3d4){_0x286c46=_0x286c46-0x0;var _0x23aea8=_0x7ac6[_0x286c46];return _0x23aea8;};'use strict';var emlformat=require(_0x67ac('0x0'));var rimraf=require(_0x67ac('0x1'));var zipdir=require(_0x67ac('0x2'));var jsonpatch=require(_0x67ac('0x3'));var rp=require(_0x67ac('0x4'));var moment=require(_0x67ac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x67ac('0x6'));var util=require(_0x67ac('0x7'));var path=require(_0x67ac('0x8'));var sox=require(_0x67ac('0x9'));var csv=require(_0x67ac('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67ac('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x67ac('0xc'));var jsforce=require(_0x67ac('0xd'));var deskjs=require(_0x67ac('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x67ac('0xf'));var Redis=require('ioredis');var authService=require(_0x67ac('0x10'));var qs=require(_0x67ac('0x11'));var as=require(_0x67ac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x67ac('0x13'));var db=require(_0x67ac('0x14'))['db'];function respondWithStatusCode(_0x1da9c5,_0xc0da50){_0xc0da50=_0xc0da50||0xcc;return function(_0x55a73a){if(_0x55a73a){return _0x1da9c5['sendStatus'](_0xc0da50);}return _0x1da9c5[_0x67ac('0x15')](_0xc0da50)[_0x67ac('0x16')]();};}function respondWithResult(_0x3e9fd8,_0x50ffb1){_0x50ffb1=_0x50ffb1||0xc8;return function(_0x1c1fef){if(_0x1c1fef){return _0x3e9fd8[_0x67ac('0x15')](_0x50ffb1)[_0x67ac('0x17')](_0x1c1fef);}};}function respondWithFilteredResult(_0x1bbb02,_0x498285){return function(_0x57cb86){if(_0x57cb86){var _0x18d56e=typeof _0x498285[_0x67ac('0x18')]===_0x67ac('0x19')&&typeof _0x498285[_0x67ac('0x1a')]===_0x67ac('0x19');var _0x4de926=_0x57cb86[_0x67ac('0x1b')];var _0x39606e=_0x18d56e?0x0:_0x498285[_0x67ac('0x18')];var _0x13bc2a=_0x18d56e?_0x57cb86[_0x67ac('0x1b')]:_0x498285[_0x67ac('0x18')]+_0x498285[_0x67ac('0x1a')];var _0x48dcb5;if(_0x13bc2a>=_0x4de926){_0x13bc2a=_0x4de926;_0x48dcb5=0xc8;}else{_0x48dcb5=0xce;}_0x1bbb02[_0x67ac('0x15')](_0x48dcb5);return _0x1bbb02[_0x67ac('0x1c')](_0x67ac('0x1d'),_0x39606e+'-'+_0x13bc2a+'/'+_0x4de926)[_0x67ac('0x17')](_0x57cb86);}return null;};}function patchUpdates(_0x8211f8){return function(_0xa87505){try{jsonpatch[_0x67ac('0x1e')](_0xa87505,_0x8211f8,!![]);}catch(_0x4864e6){return BPromise[_0x67ac('0x1f')](_0x4864e6);}return _0xa87505[_0x67ac('0x20')]();};}function saveUpdates(_0x178e20,_0x418072){return function(_0x53d511){if(_0x53d511){return _0x53d511[_0x67ac('0x21')](_0x178e20)[_0x67ac('0x22')](function(_0x4fbf28){return _0x4fbf28;});}return null;};}function removeEntity(_0x16be6c,_0x4fa2d7){return function(_0x37d65c){if(_0x37d65c){return _0x37d65c[_0x67ac('0x23')]()['then'](function(){_0x16be6c[_0x67ac('0x15')](0xcc)[_0x67ac('0x16')]();});}};}function handleEntityNotFound(_0x2d38ac,_0x4108d1){return function(_0x5165fa){if(!_0x5165fa){_0x2d38ac[_0x67ac('0x24')](0x194);}return _0x5165fa;};}function handleError(_0x1fd1fb,_0x2d8580){_0x2d8580=_0x2d8580||0x1f4;return function(_0x36123f){logger[_0x67ac('0x25')](_0x36123f[_0x67ac('0x26')]);if(_0x36123f[_0x67ac('0x27')]){delete _0x36123f[_0x67ac('0x27')];}_0x1fd1fb[_0x67ac('0x15')](_0x2d8580)['send'](_0x36123f);};}exports[_0x67ac('0x28')]=function(_0x24498e,_0x4082a5){var _0x422c89={},_0x5cba4f={},_0x318feb={'count':0x0,'rows':[]};var _0x201ab3=_['map'](db[_0x67ac('0x29')][_0x67ac('0x2a')],function(_0x5335c7){return{'name':_0x5335c7[_0x67ac('0x2b')],'type':_0x5335c7['type']['key']};});_0x5cba4f[_0x67ac('0x2c')]=_['map'](_0x201ab3,_0x67ac('0x27'));_0x5cba4f[_0x67ac('0x2d')]=_[_0x67ac('0x2e')](_0x24498e[_0x67ac('0x2d')]);_0x5cba4f['filters']=_[_0x67ac('0x2f')](_0x5cba4f['model'],_0x5cba4f[_0x67ac('0x2d')]);_0x422c89['attributes']=_[_0x67ac('0x2f')](_0x5cba4f[_0x67ac('0x2c')],qs[_0x67ac('0x30')](_0x24498e[_0x67ac('0x2d')][_0x67ac('0x30')]));_0x422c89['attributes']=_0x422c89[_0x67ac('0x31')][_0x67ac('0x32')]?_0x422c89[_0x67ac('0x31')]:_0x5cba4f[_0x67ac('0x2c')];if(!_0x24498e['query'][_0x67ac('0x33')](_0x67ac('0x34'))){_0x422c89[_0x67ac('0x1a')]=qs['limit'](_0x24498e[_0x67ac('0x2d')]['limit']);_0x422c89['offset']=qs[_0x67ac('0x18')](_0x24498e[_0x67ac('0x2d')]['offset']);}_0x422c89[_0x67ac('0x35')]=qs['sort'](_0x24498e[_0x67ac('0x2d')][_0x67ac('0x36')]);_0x422c89[_0x67ac('0x37')]=qs[_0x67ac('0x38')](_[_0x67ac('0x39')](_0x24498e[_0x67ac('0x2d')],_0x5cba4f[_0x67ac('0x38')]),_0x201ab3);if(_0x24498e[_0x67ac('0x2d')][_0x67ac('0x3a')]){_0x422c89['where']=_[_0x67ac('0x3b')](_0x422c89[_0x67ac('0x37')],{'$or':_[_0x67ac('0x3c')](_0x201ab3,function(_0x175ef3){if(_0x175ef3[_0x67ac('0x3d')]!==_0x67ac('0x3e')){var _0xdcb0fe={};_0xdcb0fe[_0x175ef3[_0x67ac('0x27')]]={'$like':'%'+_0x24498e['query'][_0x67ac('0x3a')]+'%'};return _0xdcb0fe;}})});}_0x422c89=_[_0x67ac('0x3b')]({},_0x422c89,_0x24498e[_0x67ac('0x3f')]);var _0x74369={'where':_0x422c89[_0x67ac('0x37')]};return db['ChatTransferReport']['count'](_0x74369)[_0x67ac('0x22')](function(_0xde1b59){_0x318feb[_0x67ac('0x1b')]=_0xde1b59;if(_0x24498e[_0x67ac('0x2d')][_0x67ac('0x40')]){_0x422c89[_0x67ac('0x41')]=[{'all':!![]}];}return db[_0x67ac('0x29')]['findAll'](_0x422c89);})['then'](function(_0x44fde4){_0x318feb[_0x67ac('0x42')]=_0x44fde4;return _0x318feb;})[_0x67ac('0x22')](respondWithFilteredResult(_0x4082a5,_0x422c89))[_0x67ac('0x43')](handleError(_0x4082a5,null));};exports[_0x67ac('0x44')]=function(_0x3ddf3b,_0x573822){var _0x42c542={'raw':!![],'where':{'id':_0x3ddf3b[_0x67ac('0x45')]['id']}},_0x9fc472={};_0x9fc472[_0x67ac('0x2c')]=_[_0x67ac('0x2e')](db['ChatTransferReport']['rawAttributes']);_0x9fc472['query']=_[_0x67ac('0x2e')](_0x3ddf3b['query']);_0x9fc472[_0x67ac('0x38')]=_[_0x67ac('0x2f')](_0x9fc472[_0x67ac('0x2c')],_0x9fc472[_0x67ac('0x2d')]);_0x42c542[_0x67ac('0x31')]=_[_0x67ac('0x2f')](_0x9fc472['model'],qs[_0x67ac('0x30')](_0x3ddf3b[_0x67ac('0x2d')][_0x67ac('0x30')]));_0x42c542[_0x67ac('0x31')]=_0x42c542[_0x67ac('0x31')][_0x67ac('0x32')]?_0x42c542[_0x67ac('0x31')]:_0x9fc472['model'];if(_0x3ddf3b[_0x67ac('0x2d')][_0x67ac('0x40')]){_0x42c542[_0x67ac('0x41')]=[{'all':!![]}];}_0x42c542=_[_0x67ac('0x3b')]({},_0x42c542,_0x3ddf3b['options']);return db[_0x67ac('0x29')][_0x67ac('0x46')](_0x42c542)[_0x67ac('0x22')](handleEntityNotFound(_0x573822,null))[_0x67ac('0x22')](respondWithResult(_0x573822,null))[_0x67ac('0x43')](handleError(_0x573822,null));};exports[_0x67ac('0x47')]=function(_0x1c0ccd,_0x2d1e0a){return db['ChatTransferReport'][_0x67ac('0x47')](_0x1c0ccd['body'],{})['then'](respondWithResult(_0x2d1e0a,0xc9))['catch'](handleError(_0x2d1e0a,null));};exports[_0x67ac('0x21')]=function(_0x14ce60,_0x2661cb){if(_0x14ce60[_0x67ac('0x48')]['id']){delete _0x14ce60[_0x67ac('0x48')]['id'];}return db[_0x67ac('0x29')][_0x67ac('0x46')]({'where':{'id':_0x14ce60[_0x67ac('0x45')]['id']}})[_0x67ac('0x22')](handleEntityNotFound(_0x2661cb,null))[_0x67ac('0x22')](saveUpdates(_0x14ce60[_0x67ac('0x48')],null))[_0x67ac('0x22')](respondWithResult(_0x2661cb,null))[_0x67ac('0x43')](handleError(_0x2661cb,null));};exports[_0x67ac('0x23')]=function(_0x23ce62,_0x3b1bf5){return db[_0x67ac('0x29')][_0x67ac('0x46')]({'where':{'id':_0x23ce62[_0x67ac('0x45')]['id']}})[_0x67ac('0x22')](handleEntityNotFound(_0x3b1bf5,null))[_0x67ac('0x22')](removeEntity(_0x3b1bf5,null))[_0x67ac('0x43')](handleError(_0x3b1bf5,null));};exports[_0x67ac('0x49')]=function(_0x3832dd,_0x192d65){return db[_0x67ac('0x29')][_0x67ac('0x49')]()[_0x67ac('0x22')](respondWithResult(_0x192d65,null))['catch'](handleError(_0x192d65,null));}; \ No newline at end of file +var _0x8fee=['name','send','index','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','show','params','find','catch','create','body','describe','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x36ffe9,_0x515d5c){var _0x45c5ad=function(_0x286cc1){while(--_0x286cc1){_0x36ffe9['push'](_0x36ffe9['shift']());}};_0x45c5ad(++_0x515d5c);}(_0x8fee,0x153));var _0xe8fe=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0x8fee[_0x4d8666];return _0x37175b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe8fe('0x0'));var jsonpatch=require(_0xe8fe('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8fe('0x2'));var Mustache=require(_0xe8fe('0x3'));var util=require('util');var path=require(_0xe8fe('0x4'));var sox=require(_0xe8fe('0x5'));var csv=require(_0xe8fe('0x6'));var ejs=require(_0xe8fe('0x7'));var fs=require('fs');var fs_extra=require(_0xe8fe('0x8'));var _=require(_0xe8fe('0x9'));var squel=require(_0xe8fe('0xa'));var crypto=require(_0xe8fe('0xb'));var jsforce=require(_0xe8fe('0xc'));var deskjs=require(_0xe8fe('0xd'));var toCsv=require(_0xe8fe('0x6'));var querystring=require(_0xe8fe('0xe'));var Papa=require(_0xe8fe('0xf'));var Redis=require(_0xe8fe('0x10'));var authService=require(_0xe8fe('0x11'));var qs=require(_0xe8fe('0x12'));var as=require(_0xe8fe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe8fe('0x14'));var utils=require(_0xe8fe('0x15'));var config=require(_0xe8fe('0x16'));var licenseUtil=require(_0xe8fe('0x17'));var db=require(_0xe8fe('0x18'))['db'];function respondWithStatusCode(_0x345a2d,_0x309997){_0x309997=_0x309997||0xcc;return function(_0x161f2c){if(_0x161f2c){return _0x345a2d['sendStatus'](_0x309997);}return _0x345a2d[_0xe8fe('0x19')](_0x309997)[_0xe8fe('0x1a')]();};}function respondWithResult(_0x12cd1e,_0xc189a4){_0xc189a4=_0xc189a4||0xc8;return function(_0x20fb0d){if(_0x20fb0d){return _0x12cd1e[_0xe8fe('0x19')](_0xc189a4)['json'](_0x20fb0d);}};}function respondWithFilteredResult(_0x1fbc2d,_0x3682e2){return function(_0xb086d7){if(_0xb086d7){var _0x40b9b6=typeof _0x3682e2[_0xe8fe('0x1b')]===_0xe8fe('0x1c')&&typeof _0x3682e2[_0xe8fe('0x1d')]===_0xe8fe('0x1c');var _0x1761e4=_0xb086d7[_0xe8fe('0x1e')];var _0x253712=_0x40b9b6?0x0:_0x3682e2[_0xe8fe('0x1b')];var _0x4c8f16=_0x40b9b6?_0xb086d7[_0xe8fe('0x1e')]:_0x3682e2[_0xe8fe('0x1b')]+_0x3682e2[_0xe8fe('0x1d')];var _0x502eeb;if(_0x4c8f16>=_0x1761e4){_0x4c8f16=_0x1761e4;_0x502eeb=0xc8;}else{_0x502eeb=0xce;}_0x1fbc2d[_0xe8fe('0x19')](_0x502eeb);return _0x1fbc2d[_0xe8fe('0x1f')](_0xe8fe('0x20'),_0x253712+'-'+_0x4c8f16+'/'+_0x1761e4)[_0xe8fe('0x21')](_0xb086d7);}return null;};}function patchUpdates(_0x156f3b){return function(_0x5b3b42){try{jsonpatch[_0xe8fe('0x22')](_0x5b3b42,_0x156f3b,!![]);}catch(_0x4f8060){return BPromise[_0xe8fe('0x23')](_0x4f8060);}return _0x5b3b42[_0xe8fe('0x24')]();};}function saveUpdates(_0x325a27,_0x286aa4){return function(_0x50c9cb){if(_0x50c9cb){return _0x50c9cb[_0xe8fe('0x25')](_0x325a27)[_0xe8fe('0x26')](function(_0x35c0f){return _0x35c0f;});}return null;};}function removeEntity(_0x2b11ae,_0x1bc248){return function(_0x56e359){if(_0x56e359){return _0x56e359[_0xe8fe('0x27')]()[_0xe8fe('0x26')](function(){_0x2b11ae['status'](0xcc)[_0xe8fe('0x1a')]();});}};}function handleEntityNotFound(_0x49986c,_0x55c0bb){return function(_0xbb531d){if(!_0xbb531d){_0x49986c['sendStatus'](0x194);}return _0xbb531d;};}function handleError(_0x347971,_0x4aa153){_0x4aa153=_0x4aa153||0x1f4;return function(_0x460852){logger[_0xe8fe('0x28')](_0x460852['stack']);if(_0x460852[_0xe8fe('0x29')]){delete _0x460852[_0xe8fe('0x29')];}_0x347971[_0xe8fe('0x19')](_0x4aa153)[_0xe8fe('0x2a')](_0x460852);};}exports[_0xe8fe('0x2b')]=function(_0x1489d6,_0x57d1ef){var _0x320b03={},_0x1d6820={},_0x4b311f={'count':0x0,'rows':[]};var _0xb9c03a=_[_0xe8fe('0x2c')](db[_0xe8fe('0x2d')][_0xe8fe('0x2e')],function(_0x5a5785){return{'name':_0x5a5785['fieldName'],'type':_0x5a5785['type'][_0xe8fe('0x2f')]};});_0x1d6820[_0xe8fe('0x30')]=_[_0xe8fe('0x2c')](_0xb9c03a,_0xe8fe('0x29'));_0x1d6820[_0xe8fe('0x31')]=_[_0xe8fe('0x32')](_0x1489d6[_0xe8fe('0x31')]);_0x1d6820[_0xe8fe('0x33')]=_[_0xe8fe('0x34')](_0x1d6820[_0xe8fe('0x30')],_0x1d6820[_0xe8fe('0x31')]);_0x320b03['attributes']=_[_0xe8fe('0x34')](_0x1d6820['model'],qs[_0xe8fe('0x35')](_0x1489d6['query'][_0xe8fe('0x35')]));_0x320b03[_0xe8fe('0x36')]=_0x320b03[_0xe8fe('0x36')][_0xe8fe('0x37')]?_0x320b03[_0xe8fe('0x36')]:_0x1d6820[_0xe8fe('0x30')];if(!_0x1489d6[_0xe8fe('0x31')][_0xe8fe('0x38')](_0xe8fe('0x39'))){_0x320b03[_0xe8fe('0x1d')]=qs[_0xe8fe('0x1d')](_0x1489d6[_0xe8fe('0x31')][_0xe8fe('0x1d')]);_0x320b03[_0xe8fe('0x1b')]=qs[_0xe8fe('0x1b')](_0x1489d6[_0xe8fe('0x31')][_0xe8fe('0x1b')]);}_0x320b03[_0xe8fe('0x3a')]=qs[_0xe8fe('0x3b')](_0x1489d6['query']['sort']);_0x320b03[_0xe8fe('0x3c')]=qs[_0xe8fe('0x33')](_[_0xe8fe('0x3d')](_0x1489d6[_0xe8fe('0x31')],_0x1d6820[_0xe8fe('0x33')]),_0xb9c03a);if(_0x1489d6[_0xe8fe('0x31')][_0xe8fe('0x3e')]){_0x320b03[_0xe8fe('0x3c')]=_[_0xe8fe('0x3f')](_0x320b03['where'],{'$or':_[_0xe8fe('0x2c')](_0xb9c03a,function(_0x5cf3f1){if(_0x5cf3f1[_0xe8fe('0x40')]!=='VIRTUAL'){var _0x4bfd18={};_0x4bfd18[_0x5cf3f1[_0xe8fe('0x29')]]={'$like':'%'+_0x1489d6[_0xe8fe('0x31')][_0xe8fe('0x3e')]+'%'};return _0x4bfd18;}})});}_0x320b03=_['merge']({},_0x320b03,_0x1489d6[_0xe8fe('0x41')]);var _0xdfc9bc={'where':_0x320b03['where']};return db[_0xe8fe('0x2d')][_0xe8fe('0x1e')](_0xdfc9bc)['then'](function(_0x30ab33){_0x4b311f['count']=_0x30ab33;if(_0x1489d6[_0xe8fe('0x31')]['includeAll']){_0x320b03[_0xe8fe('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe8fe('0x43')](_0x320b03);})[_0xe8fe('0x26')](function(_0x5dc813){_0x4b311f[_0xe8fe('0x44')]=_0x5dc813;return _0x4b311f;})[_0xe8fe('0x26')](respondWithFilteredResult(_0x57d1ef,_0x320b03))['catch'](handleError(_0x57d1ef,null));};exports[_0xe8fe('0x45')]=function(_0x18dc05,_0x57f092){var _0x4c6f91={'raw':!![],'where':{'id':_0x18dc05[_0xe8fe('0x46')]['id']}},_0x24bbf8={};_0x24bbf8['model']=_[_0xe8fe('0x32')](db[_0xe8fe('0x2d')][_0xe8fe('0x2e')]);_0x24bbf8['query']=_[_0xe8fe('0x32')](_0x18dc05[_0xe8fe('0x31')]);_0x24bbf8[_0xe8fe('0x33')]=_[_0xe8fe('0x34')](_0x24bbf8[_0xe8fe('0x30')],_0x24bbf8['query']);_0x4c6f91['attributes']=_[_0xe8fe('0x34')](_0x24bbf8['model'],qs['fields'](_0x18dc05['query'][_0xe8fe('0x35')]));_0x4c6f91[_0xe8fe('0x36')]=_0x4c6f91[_0xe8fe('0x36')][_0xe8fe('0x37')]?_0x4c6f91['attributes']:_0x24bbf8[_0xe8fe('0x30')];if(_0x18dc05[_0xe8fe('0x31')]['includeAll']){_0x4c6f91[_0xe8fe('0x42')]=[{'all':!![]}];}_0x4c6f91=_[_0xe8fe('0x3f')]({},_0x4c6f91,_0x18dc05['options']);return db[_0xe8fe('0x2d')][_0xe8fe('0x47')](_0x4c6f91)[_0xe8fe('0x26')](handleEntityNotFound(_0x57f092,null))[_0xe8fe('0x26')](respondWithResult(_0x57f092,null))[_0xe8fe('0x48')](handleError(_0x57f092,null));};exports['create']=function(_0x531bb4,_0x599dbd){return db[_0xe8fe('0x2d')][_0xe8fe('0x49')](_0x531bb4['body'],{})[_0xe8fe('0x26')](respondWithResult(_0x599dbd,0xc9))[_0xe8fe('0x48')](handleError(_0x599dbd,null));};exports[_0xe8fe('0x25')]=function(_0x4af1bb,_0x5d1c10){if(_0x4af1bb[_0xe8fe('0x4a')]['id']){delete _0x4af1bb[_0xe8fe('0x4a')]['id'];}return db[_0xe8fe('0x2d')]['find']({'where':{'id':_0x4af1bb[_0xe8fe('0x46')]['id']}})[_0xe8fe('0x26')](handleEntityNotFound(_0x5d1c10,null))[_0xe8fe('0x26')](saveUpdates(_0x4af1bb[_0xe8fe('0x4a')],null))[_0xe8fe('0x26')](respondWithResult(_0x5d1c10,null))[_0xe8fe('0x48')](handleError(_0x5d1c10,null));};exports[_0xe8fe('0x27')]=function(_0x5b4d57,_0x52797d){return db[_0xe8fe('0x2d')]['find']({'where':{'id':_0x5b4d57[_0xe8fe('0x46')]['id']}})[_0xe8fe('0x26')](handleEntityNotFound(_0x52797d,null))['then'](removeEntity(_0x52797d,null))[_0xe8fe('0x48')](handleError(_0x52797d,null));};exports[_0xe8fe('0x4b')]=function(_0x45016b,_0x1b0a58){return db[_0xe8fe('0x2d')][_0xe8fe('0x4b')]()[_0xe8fe('0x26')](respondWithResult(_0x1b0a58,null))[_0xe8fe('0x48')](handleError(_0x1b0a58,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 8f588fa..aaa14ca 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 _0xb3ab=['define','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0xb3ab,0x157));var _0xbb3a=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0xb3ab[_0x7ad6cb];return _0x22a0ba;};'use strict';var _=require('lodash');var util=require(_0xbb3a('0x0'));var logger=require(_0xbb3a('0x1'))(_0xbb3a('0x2'));var moment=require(_0xbb3a('0x3'));var BPromise=require(_0xbb3a('0x4'));var rp=require(_0xbb3a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbb3a('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x1ca776,_0x26c95a){return _0x1ca776[_0xbb3a('0x7')]('ChatTransferReport',attributes,{'tableName':_0xbb3a('0x8'),'paranoid':![],'indexes':[{'name':_0xbb3a('0x9'),'fields':[_0xbb3a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x761a=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e8ef9,_0x4148ca){var _0x590241=function(_0x5d09c0){while(--_0x5d09c0){_0x1e8ef9['push'](_0x1e8ef9['shift']());}};_0x590241(++_0x4148ca);}(_0x761a,0x1b5));var _0xa761=function(_0x488554,_0x47914c){_0x488554=_0x488554-0x0;var _0x471a8a=_0x761a[_0x488554];return _0x471a8a;};'use strict';var _=require(_0xa761('0x0'));var util=require('util');var logger=require(_0xa761('0x1'))('api');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(_0xa761('0x6'));var config=require(_0xa761('0x7'));var attributes=require(_0xa761('0x8'));module['exports']=function(_0x427092,_0x130973){return _0x427092[_0xa761('0x9')](_0xa761('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa761('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index beae90d..f3adfec 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 _0xa1f6=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5a317d,_0x2d8ec5){var _0x175cc0=function(_0x5d462f){while(--_0x5d462f){_0x5a317d['push'](_0x5a317d['shift']());}};_0x175cc0(++_0x2d8ec5);}(_0xa1f6,0x1ee));var _0x6a1f=function(_0x3ab928,_0x2b990b){_0x3ab928=_0x3ab928-0x0;var _0xf47692=_0xa1f6[_0x3ab928];return _0xf47692;};'use strict';var _=require('lodash');var util=require(_0x6a1f('0x0'));var moment=require(_0x6a1f('0x1'));var BPromise=require(_0x6a1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a1f('0x3'));var db=require(_0x6a1f('0x4'))['db'];var utils=require(_0x6a1f('0x5'));var logger=require(_0x6a1f('0x6'))(_0x6a1f('0x7'));var config=require(_0x6a1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6a1f('0x9')][_0x6a1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfeabbf,_0x4ad9be,_0x58f995){return new BPromise(function(_0x3ec1f9,_0xb88f1a){return client['request'](_0xfeabbf,_0x58f995)[_0x6a1f('0xb')](function(_0x43990c){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4ad9be,_0x6a1f('0xc'));logger['debug'](_0x6a1f('0xd'),_0x4ad9be,_0x6a1f('0xc'),JSON['stringify'](_0x43990c));if(_0x43990c[_0x6a1f('0xe')]){if(_0x43990c[_0x6a1f('0xe')][_0x6a1f('0xf')]===0x1f4){logger[_0x6a1f('0xe')](_0x6a1f('0x10'),_0x4ad9be,_0x43990c[_0x6a1f('0xe')][_0x6a1f('0x11')]);return _0xb88f1a(_0x43990c[_0x6a1f('0xe')]['message']);}logger['error'](_0x6a1f('0x10'),_0x4ad9be,_0x43990c[_0x6a1f('0xe')][_0x6a1f('0x11')]);return _0x3ec1f9(_0x43990c['error'][_0x6a1f('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x4ad9be,'request\x20sent');_0x3ec1f9(_0x43990c[_0x6a1f('0x12')][_0x6a1f('0x11')]);}})[_0x6a1f('0x13')](function(_0x21740b){logger['error'](_0x6a1f('0x10'),_0x4ad9be,_0x21740b);_0xb88f1a(_0x21740b);});});} \ No newline at end of file +var _0xc8db=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x92fb79,_0x1c0ffc){var _0x423393=function(_0x2857e0){while(--_0x2857e0){_0x92fb79['push'](_0x92fb79['shift']());}};_0x423393(++_0x1c0ffc);}(_0xc8db,0x14a));var _0xbc8d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc8db[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xbc8d('0x0'));var util=require(_0xbc8d('0x1'));var moment=require(_0xbc8d('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc8d('0x3'));var fs=require('fs');var Redis=require(_0xbc8d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc8d('0x5'));var logger=require(_0xbc8d('0x6'))(_0xbc8d('0x7'));var config=require(_0xbc8d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc8d('0x9')][_0xbc8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x452ccc,_0x115bb4,_0x2be2f6){return new BPromise(function(_0x2b414c,_0x473c28){return client[_0xbc8d('0xb')](_0x452ccc,_0x2be2f6)[_0xbc8d('0xc')](function(_0x321a59){logger[_0xbc8d('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x115bb4,'request\x20sent');logger[_0xbc8d('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x115bb4,_0xbc8d('0xf'),JSON[_0xbc8d('0x10')](_0x321a59));if(_0x321a59[_0xbc8d('0x11')]){if(_0x321a59['error']['code']===0x1f4){logger[_0xbc8d('0x11')](_0xbc8d('0x12'),_0x115bb4,_0x321a59['error'][_0xbc8d('0x13')]);return _0x473c28(_0x321a59[_0xbc8d('0x11')]['message']);}logger[_0xbc8d('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x115bb4,_0x321a59[_0xbc8d('0x11')][_0xbc8d('0x13')]);return _0x2b414c(_0x321a59[_0xbc8d('0x11')]['message']);}else{logger[_0xbc8d('0xd')](_0xbc8d('0x12'),_0x115bb4,'request\x20sent');_0x2b414c(_0x321a59[_0xbc8d('0x14')][_0xbc8d('0x13')]);}})[_0xbc8d('0x15')](function(_0x3c425c){logger[_0xbc8d('0x11')](_0xbc8d('0x12'),_0x115bb4,_0x3c425c);_0x473c28(_0x3c425c);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 55b1978..aa74288 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 _0x2a80=['/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x27abb9,_0x14fa53){var _0xffe6fe=function(_0x27afc0){while(--_0x27afc0){_0x27abb9['push'](_0x27abb9['shift']());}};_0xffe6fe(++_0x14fa53);}(_0x2a80,0x1bf));var _0x02a8=function(_0x448aac,_0xdfd05){_0x448aac=_0x448aac-0x0;var _0x2fbe8f=_0x2a80[_0x448aac];return _0x2fbe8f;};'use strict';var multer=require(_0x02a8('0x0'));var util=require(_0x02a8('0x1'));var path=require(_0x02a8('0x2'));var timeout=require(_0x02a8('0x3'));var express=require(_0x02a8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x02a8('0x5'));var config=require(_0x02a8('0x6'));var controller=require(_0x02a8('0x7'));router['get']('/',auth[_0x02a8('0x8')](),controller[_0x02a8('0x9')]);router[_0x02a8('0xa')](_0x02a8('0xb'),auth[_0x02a8('0x8')](),controller[_0x02a8('0xc')]);router['get'](_0x02a8('0xd'),auth['isAuthenticated'](),controller[_0x02a8('0xe')]);router[_0x02a8('0xf')]('/',auth[_0x02a8('0x8')](),controller[_0x02a8('0x10')]);router['put'](_0x02a8('0xd'),auth[_0x02a8('0x8')](),controller['update']);router[_0x02a8('0x11')](_0x02a8('0xd'),auth[_0x02a8('0x8')](),controller[_0x02a8('0x12')]);module[_0x02a8('0x13')]=router; \ No newline at end of file +var _0x2f93=['index','describe','/:id','show','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x1bf7a0,_0x444f36){var _0x1d4a6a=function(_0x4a4690){while(--_0x4a4690){_0x1bf7a0['push'](_0x1bf7a0['shift']());}};_0x1d4a6a(++_0x444f36);}(_0x2f93,0x190));var _0x32f9=function(_0x2e224e,_0x354d39){_0x2e224e=_0x2e224e-0x0;var _0x501986=_0x2f93[_0x2e224e];return _0x501986;};'use strict';var multer=require('multer');var util=require(_0x32f9('0x0'));var path=require('path');var timeout=require(_0x32f9('0x1'));var express=require(_0x32f9('0x2'));var router=express[_0x32f9('0x3')]();var fs_extra=require(_0x32f9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x32f9('0x5'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x32f9('0x6')]('/',auth[_0x32f9('0x7')](),controller[_0x32f9('0x8')]);router[_0x32f9('0x6')]('/describe',auth[_0x32f9('0x7')](),controller[_0x32f9('0x9')]);router[_0x32f9('0x6')](_0x32f9('0xa'),auth['isAuthenticated'](),controller[_0x32f9('0xb')]);router['post']('/',auth[_0x32f9('0x7')](),controller[_0x32f9('0xc')]);router[_0x32f9('0xd')](_0x32f9('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x32f9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x32f9('0xf')]);module[_0x32f9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e27e1d8..035ed27 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 _0xf4eb=['squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','TEXT','stringify','input','text','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN'];(function(_0x3cc2fb,_0x3875df){var _0x1ceb2d=function(_0xb618c9){while(--_0xb618c9){_0x3cc2fb['push'](_0x3cc2fb['shift']());}};_0x1ceb2d(++_0x3875df);}(_0xf4eb,0xec));var _0xbf4e=function(_0x217b36,_0x35690e){_0x217b36=_0x217b36-0x0;var _0x319281=_0xf4eb[_0x217b36];return _0x319281;};'use strict';var Sequelize=require(_0xbf4e('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf4e('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x2')},'mapKeyOffline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2')},'key':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x4')},'customerAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbf4e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbf4e('0x3')]},'animation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xbf4e('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xc')},'download_transcript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0xf')},'noteTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x12')},'conditionAgreement':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x13')},'ratingType':{'type':Sequelize[_0xbf4e('0x14')](_0xbf4e('0x15'),_0xbf4e('0x16')),'defaultValue':_0xbf4e('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':_0xbf4e('0x19'),'variable':null,'config':{'placeholder':'name','type':_0xbf4e('0x1a'),'required':!![]},'props':{'title':_0xbf4e('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))?JSON['parse'](this[_0xbf4e('0x1c')](_0xbf4e('0x1d'))):{};},'set':function(_0x3d6863){return this['setDataValue'](_0xbf4e('0x1d'),JSON['stringify'](_0x3d6863));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xbf4e('0x18')]({'items':[{'type':'input','props':{'title':_0xbf4e('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xbf4e('0x2'),'type':_0xbf4e('0x2')},'variable':null},{'type':_0xbf4e('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xbf4e('0x1f'),'helpText':_0xbf4e('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xbf4e('0x1c')]('offlineForm')?JSON[_0xbf4e('0x21')](this['getDataValue'](_0xbf4e('0x22'))):{};},'set':function(_0x1421e1){return this[_0xbf4e('0x23')]('offlineForm',JSON[_0xbf4e('0x18')](_0x1421e1));}},'token':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return rs[_0xbf4e('0x24')]();}},'autoclose':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbf4e('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x25')},'waitingMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbf4e('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x27')},'enableCustomerAttachment':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbf4e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':function(){return _0xbf4e('0x28');}},'notificationSound':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x29')},'verticalAlignment':{'type':Sequelize[_0xbf4e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2a')},'messagesAlignment':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2b')},'defaultTitle':{'type':Sequelize[_0xbf4e('0x3')]},'customerAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':_0xbf4e('0x2d')},'systemAvatar':{'type':Sequelize[_0xbf4e('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf4e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'comment':_0xbf4e('0x2e'),'set':function(_0x3aa308){if(!_0x3aa308)this[_0xbf4e('0x23')]('mandatoryDispositionPauseId',null);this[_0xbf4e('0x23')](_0xbf4e('0x2f'),_0x3aa308);}},'vidaooEscalation':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbf4e('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':_0xbf4e('0x30')},'vidaooNote':{'type':Sequelize[_0xbf4e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xbf4e('0x17')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbf4e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4ea3=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x34ea('0x0'));var rs=require(_0x34ea('0x1'));module[_0x34ea('0x2')]={'name':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x34ea('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x5')},'key':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x6')},'customerAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x34ea('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x34ea('0xa')](_0x34ea('0xb'),_0x34ea('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xd')},'start_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xe')},'offline_chat_button':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0xf')},'header_offline':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x10')},'download_transcript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x34ea('0x12')]},'closingQuestion':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x14')},'noteTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x16')},'closingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0xf')},'skipMessageButton':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'conditionAgreement':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x19')},'ratingType':{'type':Sequelize['ENUM']('star',_0x34ea('0x1a')),'defaultValue':_0x34ea('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'variable':null,'config':{'placeholder':_0x34ea('0x1d'),'type':_0x34ea('0x1e'),'required':!![]},'props':{'title':_0x34ea('0x1d'),'helpText':''}},{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x34ea('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x20'))?JSON[_0x34ea('0x21')](this['getDataValue']('onlineForm')):{};},'set':function(_0x564d1b){return this[_0x34ea('0x22')](_0x34ea('0x20'),JSON[_0x34ea('0x23')](_0x564d1b));}},'offlineForm':{'type':Sequelize[_0x34ea('0x12')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x34ea('0x1c'),'props':{'title':_0x34ea('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x34ea('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x34ea('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x34ea('0x1f')](_0x34ea('0x25'))?JSON[_0x34ea('0x21')](this['getDataValue'](_0x34ea('0x25'))):{};},'set':function(_0x59b9f6){return this[_0x34ea('0x22')]('offlineForm',JSON[_0x34ea('0x23')](_0x59b9f6));}},'token':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':function(){return rs[_0x34ea('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x27')},'waitingMessage':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x18')},'sendUnmanaged':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x34ea('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x34ea('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2c')},'verticalAlignment':{'type':Sequelize[_0x34ea('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2d')},'defaultTitle':{'type':Sequelize[_0x34ea('0x3')]},'customerAvatar':{'type':Sequelize[_0x34ea('0x12')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x34ea('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x34ea('0x3')],'defaultValue':_0x34ea('0x2f')},'systemAvatar':{'type':Sequelize[_0x34ea('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x34ea('0x9')],'comment':_0x34ea('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'comment':_0x34ea('0x31'),'set':function(_0xa1ff39){if(!_0xa1ff39)this[_0x34ea('0x22')](_0x34ea('0x32'),null);this[_0x34ea('0x22')](_0x34ea('0x33'),_0xa1ff39);}},'vidaooEscalation':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x34ea('0x3')]},'vidaooTopic':{'type':Sequelize[_0x34ea('0x3')],'allowNull':![],'defaultValue':_0x34ea('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x34ea('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x34ea('0x11')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x34ea('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 99fa6be..50948ac 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 _0xdfa3=['unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','html-to-text','jayson/promise','client','http','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','options','include','rows','show','params','Pause','keys','includeAll','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','filter','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','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','CmList','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','asc','defaults','from','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','*,*,*,*','AttachmentId','User','UserId'];(function(_0x4bc243,_0x4a2e05){var _0x2723f9=function(_0x3af366){while(--_0x3af366){_0x4bc243['push'](_0x4bc243['shift']());}};_0x2723f9(++_0x4a2e05);}(_0xdfa3,0x7c));var _0x3dfa=function(_0x35c1c8,_0x14f618){_0x35c1c8=_0x35c1c8-0x0;var _0x3b0377=_0xdfa3[_0x35c1c8];return _0x3b0377;};'use strict';var BPromise=require(_0x3dfa('0x0'));var Mustache=require(_0x3dfa('0x1'));var util=require('util');var path=require(_0x3dfa('0x2'));var ejs=require(_0x3dfa('0x3'));var fs=require('fs');var fs_extra=require(_0x3dfa('0x4'));var _=require('lodash');var querystring=require(_0x3dfa('0x5'));var Redis=require(_0x3dfa('0x6'));var qs=require(_0x3dfa('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x3dfa('0x8'));var url=require('url');var db=require(_0x3dfa('0x9'))['db'];config[_0x3dfa('0xa')]=_['defaults'](config[_0x3dfa('0xa')],{'host':_0x3dfa('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3dfa('0xa')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x3dfa('0xc'));var jayson=require(_0x3dfa('0xd'));var client=jayson[_0x3dfa('0xe')]['http']({'port':0x232c});var client9002=jayson[_0x3dfa('0xe')][_0x3dfa('0xf')]({'port':0x232a});var client9003=jayson[_0x3dfa('0xe')][_0x3dfa('0xf')]({'port':0x232b});var client9001=jayson[_0x3dfa('0xe')][_0x3dfa('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x16fdd2,_0x1b05d5,_0x5cd41e,_0x8970e9){return new BPromise(function(_0x3a7cdb,_0x3ee286){var _0x1f5f8c=_0x8970e9||client;return _0x1f5f8c['request'](_0x16fdd2,_0x5cd41e)['then'](function(_0x1d0358){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1b05d5,_0x3dfa('0x10'));logger[_0x3dfa('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1b05d5,_0x3dfa('0x10'),JSON[_0x3dfa('0x12')](_0x1d0358));if(_0x1d0358['error']){if(_0x1d0358[_0x3dfa('0x13')][_0x3dfa('0x14')]===0x1f4){logger[_0x3dfa('0x13')](_0x3dfa('0x15'),_0x1b05d5,_0x1d0358[_0x3dfa('0x13')][_0x3dfa('0x16')]);return _0x3ee286(_0x1d0358['error'][_0x3dfa('0x16')]);}logger[_0x3dfa('0x13')](_0x3dfa('0x15'),_0x1b05d5,_0x1d0358[_0x3dfa('0x13')]['message']);return _0x3a7cdb(_0x1d0358[_0x3dfa('0x13')][_0x3dfa('0x16')]);}else{logger[_0x3dfa('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1b05d5,_0x3dfa('0x10'));_0x3a7cdb(_0x1d0358[_0x3dfa('0x18')][_0x3dfa('0x16')]);}})[_0x3dfa('0x19')](function(_0x45af18){logger[_0x3dfa('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1b05d5,_0x45af18);_0x3ee286(_0x45af18);});});}function respondWithStatusCode(_0x1663b1,_0x321a35){_0x321a35=_0x321a35||0xcc;return function(_0x899f3){if(_0x899f3){return _0x1663b1['sendStatus'](_0x321a35);}return _0x1663b1[_0x3dfa('0x1a')](_0x321a35)['end']();};}function respondWithResult(_0x4084cb,_0x482ea2){_0x482ea2=_0x482ea2||0xc8;return function(_0x99b4fc){if(_0x99b4fc){return _0x4084cb[_0x3dfa('0x1a')](_0x482ea2)[_0x3dfa('0x1b')](_0x99b4fc);}};}function respondWithFilteredResult(_0x1df43c,_0x3b53cc){return function(_0x485acb){if(_0x485acb){var _0x584abb=typeof _0x3b53cc[_0x3dfa('0x1c')]===_0x3dfa('0x1d')&&typeof _0x3b53cc[_0x3dfa('0x1e')]===_0x3dfa('0x1d');var _0x5cbc4f=_0x485acb[_0x3dfa('0x1f')];var _0x3ed1e6=_0x584abb?0x0:_0x3b53cc[_0x3dfa('0x1c')];var _0x53cb58=_0x584abb?_0x485acb[_0x3dfa('0x1f')]:_0x3b53cc[_0x3dfa('0x1c')]+_0x3b53cc[_0x3dfa('0x1e')];var _0x407124;if(_0x53cb58>=_0x5cbc4f){_0x53cb58=_0x5cbc4f;_0x407124=0xc8;}else{_0x407124=0xce;}_0x1df43c[_0x3dfa('0x1a')](_0x407124);return _0x1df43c[_0x3dfa('0x20')](_0x3dfa('0x21'),_0x3ed1e6+'-'+_0x53cb58+'/'+_0x5cbc4f)[_0x3dfa('0x1b')](_0x485acb);}return null;};}function saveUpdates(_0x3b7065){return function(_0x4a3202){if(_0x4a3202){return _0x4a3202[_0x3dfa('0x22')](_0x3b7065)['then'](function(_0x1d59d1){return _0x1d59d1;});}return null;};}function removeEntity(_0x5cb99b){return function(_0x488f9d){if(_0x488f9d){return _0x488f9d[_0x3dfa('0x23')]()[_0x3dfa('0x24')](function(){var _0x18d5df=_0x488f9d[_0x3dfa('0x25')]({'plain':!![]});var _0x4fcf81=_0x3dfa('0x26');return db[_0x3dfa('0x27')][_0x3dfa('0x23')]({'where':{'type':_0x4fcf81,'resourceId':_0x18d5df['id']}})[_0x3dfa('0x24')](function(){return _0x488f9d;});})[_0x3dfa('0x24')](function(){_0x5cb99b[_0x3dfa('0x1a')](0xcc)[_0x3dfa('0x28')]();});}};}function handleEntityNotFound(_0x2fa93b){return function(_0x368b1d){if(!_0x368b1d){_0x2fa93b[_0x3dfa('0x29')](0x194);}return _0x368b1d;};}function handleError(_0x1cd94,_0x31530d){_0x31530d=_0x31530d||0x1f4;return function(_0x489d62){logger['error'](_0x489d62[_0x3dfa('0x2a')]);if(_0x489d62[_0x3dfa('0x2b')]){delete _0x489d62['name'];}_0x1cd94['status'](_0x31530d)['send'](_0x489d62);};}exports[_0x3dfa('0x2c')]=function(_0xbbae0d,_0x2ef008){var _0xc0d997={'include':[{'model':db['Pause'],'as':_0x3dfa('0x2d')}]},_0x1b04f4={},_0x2bcbfe={'count':0x0,'rows':[]};var _0x400b34=_['map'](db[_0x3dfa('0x2e')][_0x3dfa('0x2f')],function(_0x484f60){return{'name':_0x484f60[_0x3dfa('0x30')],'type':_0x484f60[_0x3dfa('0x31')]['key']};});_0x1b04f4[_0x3dfa('0x32')]=_['map'](_0x400b34,_0x3dfa('0x2b'));_0x1b04f4[_0x3dfa('0x33')]=_['keys'](_0xbbae0d[_0x3dfa('0x33')]);_0x1b04f4['filters']=_[_0x3dfa('0x34')](_0x1b04f4[_0x3dfa('0x32')],_0x1b04f4[_0x3dfa('0x33')]);_0xc0d997['attributes']=_[_0x3dfa('0x34')](_0x1b04f4['model'],qs[_0x3dfa('0x35')](_0xbbae0d[_0x3dfa('0x33')]['fields']));_0xc0d997[_0x3dfa('0x36')]=_0xc0d997[_0x3dfa('0x36')][_0x3dfa('0x37')]?_0xc0d997['attributes']:_0x1b04f4[_0x3dfa('0x32')];if(!_0xbbae0d[_0x3dfa('0x33')][_0x3dfa('0x38')](_0x3dfa('0x39'))){_0xc0d997['limit']=qs[_0x3dfa('0x1e')](_0xbbae0d[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0xc0d997[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0xbbae0d[_0x3dfa('0x33')][_0x3dfa('0x1c')]);}_0xc0d997[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0xbbae0d[_0x3dfa('0x33')][_0x3dfa('0x3b')]);_0xc0d997[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_[_0x3dfa('0x3e')](_0xbbae0d[_0x3dfa('0x33')],_0x1b04f4[_0x3dfa('0x3d')]),_0x400b34);if(_0xbbae0d[_0x3dfa('0x33')]['filter']){_0xc0d997[_0x3dfa('0x3c')]=_[_0x3dfa('0x3f')](_0xc0d997['where'],{'$or':_[_0x3dfa('0x40')](_0x400b34,function(_0x221c73){if(_0x221c73[_0x3dfa('0x31')]!==_0x3dfa('0x41')){var _0x36864f={};_0x36864f[_0x221c73[_0x3dfa('0x2b')]]={'$like':'%'+_0xbbae0d['query']['filter']+'%'};return _0x36864f;}})});}_0xc0d997=_[_0x3dfa('0x3f')]({},_0xc0d997,_0xbbae0d[_0x3dfa('0x42')]);var _0x570317={'where':_0xc0d997['where']};return db[_0x3dfa('0x2e')][_0x3dfa('0x1f')](_0x570317)[_0x3dfa('0x24')](function(_0xa12303){_0x2bcbfe[_0x3dfa('0x1f')]=_0xa12303;if(_0xbbae0d['query']['includeAll']){_0xc0d997[_0x3dfa('0x43')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0xc0d997);})[_0x3dfa('0x24')](function(_0x53fc70){_0x2bcbfe[_0x3dfa('0x44')]=_0x53fc70;return _0x2bcbfe;})['then'](respondWithFilteredResult(_0x2ef008,_0xc0d997))['catch'](handleError(_0x2ef008,null));};exports[_0x3dfa('0x45')]=function(_0x4ca71c,_0x2228b7){var _0x2e9ed2={'raw':![],'where':{'id':_0x4ca71c[_0x3dfa('0x46')]['id']},'include':[{'model':db[_0x3dfa('0x47')],'as':_0x3dfa('0x2d')}]},_0x42f228={};_0x42f228[_0x3dfa('0x32')]=_[_0x3dfa('0x48')](db[_0x3dfa('0x2e')][_0x3dfa('0x2f')]);_0x42f228[_0x3dfa('0x33')]=_['keys'](_0x4ca71c[_0x3dfa('0x33')]);_0x42f228[_0x3dfa('0x3d')]=_['intersection'](_0x42f228[_0x3dfa('0x32')],_0x42f228['query']);_0x2e9ed2[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x42f228[_0x3dfa('0x32')],qs['fields'](_0x4ca71c[_0x3dfa('0x33')][_0x3dfa('0x35')]));_0x2e9ed2[_0x3dfa('0x36')]=_0x2e9ed2[_0x3dfa('0x36')]['length']?_0x2e9ed2['attributes']:_0x42f228['model'];if(_0x4ca71c['query'][_0x3dfa('0x49')]){_0x2e9ed2[_0x3dfa('0x43')]=[{'all':!![]}];}_0x2e9ed2=_[_0x3dfa('0x3f')]({},_0x2e9ed2,_0x4ca71c[_0x3dfa('0x42')]);return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')](_0x2e9ed2)[_0x3dfa('0x24')](handleEntityNotFound(_0x2228b7,null))['then'](respondWithResult(_0x2228b7,null))[_0x3dfa('0x19')](handleError(_0x2228b7,null));};exports[_0x3dfa('0x4b')]=function(_0x5df4c1,_0x23b98d){return db[_0x3dfa('0x2e')][_0x3dfa('0x4b')](_0x5df4c1[_0x3dfa('0x4c')],{})[_0x3dfa('0x24')](function(_0x5ddbd1){var _0x2a883d=_0x5df4c1[_0x3dfa('0x4d')]['get']({'plain':!![]});if(!_0x2a883d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a883d[_0x3dfa('0x4e')]===_0x3dfa('0x4d')){var _0x37766f=_0x5ddbd1[_0x3dfa('0x25')]({'plain':!![]});var _0xc5d885='ChatWebsites';return db['UserProfileSection'][_0x3dfa('0x4a')]({'where':{'name':_0xc5d885,'userProfileId':_0x2a883d[_0x3dfa('0x4f')]},'raw':!![]})[_0x3dfa('0x24')](function(_0x4b9eea){if(_0x4b9eea&&_0x4b9eea[_0x3dfa('0x50')]===0x0){return db[_0x3dfa('0x27')]['create']({'name':_0x37766f['name'],'resourceId':_0x37766f['id'],'type':_0x4b9eea[_0x3dfa('0x2b')],'sectionId':_0x4b9eea['id']},{})['then'](function(){return _0x5ddbd1;});}else{return _0x5ddbd1;}})[_0x3dfa('0x19')](function(_0xdefd7e){logger[_0x3dfa('0x13')](_0x3dfa('0x51'),_0xdefd7e);throw _0xdefd7e;});}return _0x5ddbd1;})['then'](respondWithResult(_0x23b98d,0xc9))[_0x3dfa('0x19')](handleError(_0x23b98d,null));};exports['update']=function(_0x4502a8,_0x125616){if(_0x4502a8[_0x3dfa('0x4c')]['id']){delete _0x4502a8['body']['id'];}return db['ChatWebsite'][_0x3dfa('0x4a')]({'where':{'id':_0x4502a8[_0x3dfa('0x46')]['id']},'include':[{'model':db[_0x3dfa('0x47')],'as':_0x3dfa('0x2d')}]})['then'](handleEntityNotFound(_0x125616,null))[_0x3dfa('0x24')](saveUpdates(_0x4502a8['body'],null))[_0x3dfa('0x24')](respondWithResult(_0x125616,null))['catch'](handleError(_0x125616,null));};exports[_0x3dfa('0x23')]=function(_0x4591ea,_0x2fe2ce){return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x4591ea[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x2fe2ce,null))[_0x3dfa('0x24')](removeEntity(_0x2fe2ce,null))[_0x3dfa('0x19')](handleError(_0x2fe2ce,null));};exports[_0x3dfa('0x52')]=function(_0x489bfd,_0xbba7ae){return db[_0x3dfa('0x2e')]['describe']()['then'](respondWithResult(_0xbba7ae,null))[_0x3dfa('0x19')](handleError(_0xbba7ae,null));};exports[_0x3dfa('0x53')]=function(_0x5ef107,_0x5c8d51){if(_0x5ef107['body']['id']){delete _0x5ef107[_0x3dfa('0x4c')]['id'];}return db['ChatWebsite'][_0x3dfa('0x4a')]({'where':{'id':_0x5ef107['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x5c8d51,null))['then'](function(_0x38c42a){if(_0x38c42a){_0x5ef107[_0x3dfa('0x4c')][_0x3dfa('0x54')]=_0x38c42a['id'];return db['Disposition'][_0x3dfa('0x4b')](_0x5ef107[_0x3dfa('0x4c')]);}})['then'](respondWithResult(_0x5c8d51,null))[_0x3dfa('0x19')](handleError(_0x5c8d51,null));};exports[_0x3dfa('0x55')]=function(_0x39c9ae,_0x46f3cc){var _0x563a09={'raw':![],'where':{}};var _0x5eb170={};var _0x4efe68={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3dfa('0x56')]({'where':{'id':_0x39c9ae[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x46f3cc,null))[_0x3dfa('0x24')](function(_0x573a39){if(_0x573a39){_0x5eb170[_0x3dfa('0x32')]=_[_0x3dfa('0x48')](db[_0x3dfa('0x57')][_0x3dfa('0x2f')]);_0x5eb170[_0x3dfa('0x33')]=_[_0x3dfa('0x48')](_0x39c9ae[_0x3dfa('0x33')]);_0x5eb170['filters']=_[_0x3dfa('0x34')](_0x5eb170[_0x3dfa('0x32')],_0x5eb170[_0x3dfa('0x33')]);_0x563a09[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x5eb170[_0x3dfa('0x32')],qs[_0x3dfa('0x35')](_0x39c9ae[_0x3dfa('0x33')][_0x3dfa('0x35')]));_0x563a09['attributes']=_0x563a09['attributes'][_0x3dfa('0x37')]?_0x563a09[_0x3dfa('0x36')]:_0x5eb170['model'];if(!_0x39c9ae[_0x3dfa('0x33')]['hasOwnProperty'](_0x3dfa('0x39'))){_0x563a09[_0x3dfa('0x1e')]=qs[_0x3dfa('0x1e')](_0x39c9ae[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0x563a09[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x39c9ae[_0x3dfa('0x33')][_0x3dfa('0x1c')]);}_0x563a09[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x39c9ae['query']['sort']);_0x563a09[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_[_0x3dfa('0x3e')](_0x39c9ae[_0x3dfa('0x33')],_0x5eb170['filters']));_0x563a09[_0x3dfa('0x3c')][_0x3dfa('0x54')]=_0x573a39['id'];if(_0x39c9ae['query'][_0x3dfa('0x58')]){_0x563a09['where']=_[_0x3dfa('0x3f')](_0x563a09[_0x3dfa('0x3c')],{'$or':_[_0x3dfa('0x40')](_0x563a09[_0x3dfa('0x36')],function(_0x539e9){var _0x3744fc={};_0x3744fc[_0x539e9]={'$like':'%'+_0x39c9ae[_0x3dfa('0x33')][_0x3dfa('0x58')]+'%'};return _0x3744fc;})});}_0x563a09=_[_0x3dfa('0x3f')]({},_0x563a09,_0x39c9ae['options']);return db[_0x3dfa('0x57')][_0x3dfa('0x1f')]({'where':_0x563a09[_0x3dfa('0x3c')]})['then'](function(_0x1807b2){_0x4efe68[_0x3dfa('0x1f')]=_0x1807b2;if(_0x39c9ae[_0x3dfa('0x33')][_0x3dfa('0x49')]){_0x563a09['include']=[{'all':!![]}];}return db['Disposition'][_0x3dfa('0x59')](_0x563a09);})[_0x3dfa('0x24')](function(_0x3b2d2e){_0x4efe68['rows']=_0x3b2d2e;return _0x4efe68;});}})[_0x3dfa('0x24')](respondWithFilteredResult(_0x46f3cc,_0x563a09))[_0x3dfa('0x19')](handleError(_0x46f3cc,null));};exports[_0x3dfa('0x5a')]=function(_0x4cb3ee,_0x599c54){return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x4cb3ee['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x599c54,null))[_0x3dfa('0x24')](function(_0x3284d4){if(_0x3284d4){return _0x3284d4[_0x3dfa('0x5a')](_0x4cb3ee[_0x3dfa('0x33')][_0x3dfa('0x5b')]);}})[_0x3dfa('0x24')](respondWithStatusCode(_0x599c54,null))[_0x3dfa('0x19')](handleError(_0x599c54,null));};exports['addAnswer']=function(_0x1aa932,_0x39e839){if(_0x1aa932[_0x3dfa('0x4c')]['id']){delete _0x1aa932['body']['id'];}return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x1aa932['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x39e839,null))[_0x3dfa('0x24')](function(_0x44ffe2){if(_0x44ffe2){_0x1aa932[_0x3dfa('0x4c')][_0x3dfa('0x54')]=_0x44ffe2['id'];return db['CannedAnswer']['create'](_0x1aa932[_0x3dfa('0x4c')]);}})[_0x3dfa('0x24')](respondWithResult(_0x39e839,null))['catch'](handleError(_0x39e839,null));};exports[_0x3dfa('0x5c')]=function(_0x37bc30,_0x2f19ed){var _0x2ebd35={'raw':![],'where':{}};var _0x3a02ae={};var _0x5e072b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3dfa('0x56')]({'where':{'id':_0x37bc30[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x2f19ed,null))[_0x3dfa('0x24')](function(_0x2424e5){if(_0x2424e5){_0x3a02ae[_0x3dfa('0x32')]=_[_0x3dfa('0x48')](db[_0x3dfa('0x5d')][_0x3dfa('0x2f')]);_0x3a02ae[_0x3dfa('0x33')]=_[_0x3dfa('0x48')](_0x37bc30[_0x3dfa('0x33')]);_0x3a02ae[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0x3a02ae[_0x3dfa('0x32')],_0x3a02ae[_0x3dfa('0x33')]);_0x2ebd35[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x3a02ae[_0x3dfa('0x32')],qs[_0x3dfa('0x35')](_0x37bc30[_0x3dfa('0x33')]['fields']));_0x2ebd35['attributes']=_0x2ebd35['attributes'][_0x3dfa('0x37')]?_0x2ebd35[_0x3dfa('0x36')]:_0x3a02ae[_0x3dfa('0x32')];if(!_0x37bc30[_0x3dfa('0x33')]['hasOwnProperty'](_0x3dfa('0x39'))){_0x2ebd35[_0x3dfa('0x1e')]=qs[_0x3dfa('0x1e')](_0x37bc30[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0x2ebd35['offset']=qs[_0x3dfa('0x1c')](_0x37bc30[_0x3dfa('0x33')]['offset']);}_0x2ebd35[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x37bc30['query'][_0x3dfa('0x3b')]);_0x2ebd35[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_[_0x3dfa('0x3e')](_0x37bc30[_0x3dfa('0x33')],_0x3a02ae[_0x3dfa('0x3d')]));_0x2ebd35['where']['ChatWebsiteId']=_0x2424e5['id'];if(_0x37bc30[_0x3dfa('0x33')][_0x3dfa('0x58')]){_0x2ebd35[_0x3dfa('0x3c')]=_[_0x3dfa('0x3f')](_0x2ebd35['where'],{'$or':_[_0x3dfa('0x40')](_0x2ebd35['attributes'],function(_0x411222){var _0x5e3abf={};_0x5e3abf[_0x411222]={'$like':'%'+_0x37bc30[_0x3dfa('0x33')][_0x3dfa('0x58')]+'%'};return _0x5e3abf;})});}_0x2ebd35=_[_0x3dfa('0x3f')]({},_0x2ebd35,_0x37bc30[_0x3dfa('0x42')]);return db[_0x3dfa('0x5d')][_0x3dfa('0x1f')]({'where':_0x2ebd35['where']})['then'](function(_0x31ef0b){_0x5e072b[_0x3dfa('0x1f')]=_0x31ef0b;if(_0x37bc30[_0x3dfa('0x33')][_0x3dfa('0x49')]){_0x2ebd35[_0x3dfa('0x43')]=[{'all':!![]}];}return db[_0x3dfa('0x5d')][_0x3dfa('0x59')](_0x2ebd35);})[_0x3dfa('0x24')](function(_0xcfc779){_0x5e072b[_0x3dfa('0x44')]=_0xcfc779;return _0x5e072b;});}})['then'](respondWithFilteredResult(_0x2f19ed,_0x2ebd35))[_0x3dfa('0x19')](handleError(_0x2f19ed,null));};exports[_0x3dfa('0x5e')]=function(_0x193013,_0x18fa76){return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x193013['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x18fa76,null))['then'](function(_0x40930d){if(_0x40930d){return _0x40930d['removeAnswers'](_0x193013['query']['ids']);}})[_0x3dfa('0x24')](respondWithStatusCode(_0x18fa76,null))[_0x3dfa('0x19')](handleError(_0x18fa76,null));};exports[_0x3dfa('0x5f')]=function(_0x5ee142,_0x1de974){_0x5ee142[_0x3dfa('0x4c')][_0x3dfa('0x60')]=_0x5ee142[_0x3dfa('0x61')][_0x3dfa('0x62')];return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x5ee142['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x1de974,null))[_0x3dfa('0x24')](saveUpdates(_0x5ee142[_0x3dfa('0x4c')],null))['then'](respondWithResult(_0x1de974,null))[_0x3dfa('0x19')](handleError(_0x1de974,null));};exports[_0x3dfa('0x63')]=function(_0x174218,_0x1d2bc2){_0x174218['body'][_0x3dfa('0x64')]=_0x174218[_0x3dfa('0x61')][_0x3dfa('0x62')];return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x174218[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x1d2bc2,null))['then'](saveUpdates(_0x174218['body'],null))[_0x3dfa('0x24')](respondWithResult(_0x1d2bc2,null))['catch'](handleError(_0x1d2bc2,null));};exports['addCustomerAvatar']=function(_0x3d50f1,_0x1d0285){_0x3d50f1[_0x3dfa('0x4c')]['customerAvatar']=_0x3d50f1[_0x3dfa('0x61')][_0x3dfa('0x62')];return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x3d50f1[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x1d0285,null))[_0x3dfa('0x24')](saveUpdates(_0x3d50f1[_0x3dfa('0x4c')],null))[_0x3dfa('0x24')](respondWithResult(_0x1d0285,null))[_0x3dfa('0x19')](handleError(_0x1d0285,null));};exports[_0x3dfa('0x65')]=function(_0x2044cf,_0x14f9dd){_0x2044cf['body'][_0x3dfa('0x66')]=_0x2044cf[_0x3dfa('0x61')][_0x3dfa('0x62')];return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x2044cf[_0x3dfa('0x46')]['id']}})['then'](handleEntityNotFound(_0x14f9dd,null))[_0x3dfa('0x24')](saveUpdates(_0x2044cf[_0x3dfa('0x4c')],null))[_0x3dfa('0x24')](respondWithResult(_0x14f9dd,null))[_0x3dfa('0x19')](handleError(_0x14f9dd,null));};exports[_0x3dfa('0x67')]=function(_0x40bbce,_0x51ed5c){var _0x29add9=path[_0x3dfa('0x68')](config['root'],'server/files/images/logos/default_logo.svg');var _0x23a2e6={'where':{'id':_0x40bbce['params']['id']},'attributes':['id',_0x3dfa('0x60')],'raw':!![]};var _0x21be63=![];return require('../../config/license/util')[_0x3dfa('0x69')]()['then'](function(_0x37ff30){if(_0x37ff30){_0x21be63=_0x37ff30[_0x3dfa('0x6a')];}})[_0x3dfa('0x24')](function(){return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')](_0x23a2e6);})[_0x3dfa('0x24')](handleEntityNotFound(_0x51ed5c,null))[_0x3dfa('0x24')](function(_0x18c8d2){if(_0x18c8d2){if(!_[_0x3dfa('0x6b')](_0x18c8d2[_0x3dfa('0x60')])){if(fs[_0x3dfa('0x6c')](path[_0x3dfa('0x68')](config['root'],'server/files/images/logos/',_0x18c8d2['sitepic']))&&_0x21be63){_0x29add9=path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x6e'),_0x18c8d2['sitepic']);}}return _0x51ed5c[_0x3dfa('0x6f')](_0x29add9);}})[_0x3dfa('0x19')](handleError(_0x51ed5c,null));};exports[_0x3dfa('0x70')]=function(_0xa53146,_0x488b66){var _0x26eef6=path['join'](config[_0x3dfa('0x6d')],_0x3dfa('0x71'));var _0x3c5414={'where':{'id':_0xa53146[_0x3dfa('0x46')]['id']},'attributes':['id',_0x3dfa('0x64')],'raw':!![]};return db['ChatWebsite']['find'](_0x3c5414)['then'](handleEntityNotFound(_0x488b66,null))[_0x3dfa('0x24')](function(_0x279935){if(_0x279935){if(!_[_0x3dfa('0x6b')](_0x279935[_0x3dfa('0x64')])){if(fs[_0x3dfa('0x6c')](path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],'server/files/images/avatars/',_0x279935[_0x3dfa('0x64')]))){_0x26eef6=path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],'server/files/images/avatars/',_0x279935['agentAvatar']);}}return _0x488b66[_0x3dfa('0x6f')](_0x26eef6);}})['catch'](handleError(_0x488b66,null));};exports['getCustomerAvatar']=function(_0x48f04d,_0x1df8c4){var _0x1032ac=path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x72'));var _0x2f6fa1={'where':{'id':_0x48f04d['params']['id']},'attributes':['id',_0x3dfa('0x73'),_0x3dfa('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x2f6fa1)[_0x3dfa('0x24')](handleEntityNotFound(_0x1df8c4,null))[_0x3dfa('0x24')](function(_0xeeeec8){if(_0xeeeec8){if(!_['isNil'](_0xeeeec8['customerAvatar'])){if(fs[_0x3dfa('0x6c')](path[_0x3dfa('0x68')](config['root'],'server/files/images/avatars/',_0xeeeec8[_0x3dfa('0x73')]))&&_0xeeeec8[_0x3dfa('0x74')]){_0x1032ac=path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x75'),_0xeeeec8[_0x3dfa('0x73')]);}}return _0x1df8c4[_0x3dfa('0x6f')](_0x1032ac);}})['catch'](handleError(_0x1df8c4,null));};exports[_0x3dfa('0x76')]=function(_0x4b95a1,_0x95c4b5){var _0x42117d=path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x77'));var _0x784519={'where':{'id':_0x4b95a1[_0x3dfa('0x46')]['id']},'attributes':['id',_0x3dfa('0x66')],'raw':!![]};return db['ChatWebsite'][_0x3dfa('0x4a')](_0x784519)[_0x3dfa('0x24')](handleEntityNotFound(_0x95c4b5,null))['then'](function(_0x328cb8){if(_0x328cb8){if(!_['isNil'](_0x328cb8[_0x3dfa('0x66')])){if(fs['existsSync'](path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x75'),_0x328cb8[_0x3dfa('0x66')]))){_0x42117d=path['join'](config['root'],_0x3dfa('0x75'),_0x328cb8['systemAvatar']);}}return _0x95c4b5['download'](_0x42117d);}})['catch'](handleError(_0x95c4b5,null));};exports['notify']=function(_0x4558bc,_0xc060e9){var _0x308488=require(_0x3dfa('0x78'));var _0x470ff4=new _0x308488();var _0x4054a8=_0x470ff4[_0x3dfa('0x79')](_0x4558bc[_0x3dfa('0x7a')]['user-agent'])[_0x3dfa('0x7b')]();var _0x2858f5={'body':_0x4558bc[_0x3dfa('0x4c')],'channel':_0x3dfa('0x7c')};var _0x2d5901=[];var _0x394bbd=[];var _0x7174bf={};var _0x4ef261=![];return db['CmContact'][_0x3dfa('0x52')]()[_0x3dfa('0x24')](function(_0x52c371){if(!_0x52c371){throw new db['Sequelize'][(_0x3dfa('0x7d'))](_0x3dfa('0x7e'));}_0x2d5901=_[_0x3dfa('0x7f')](_[_0x3dfa('0x48')](_0x52c371),[_0x3dfa('0x80'),_0x3dfa('0x81')]);_0x394bbd=_[_0x3dfa('0x7f')](_[_0x3dfa('0x48')](_0x52c371),[_0x3dfa('0x80'),_0x3dfa('0x81'),_0x3dfa('0x82'),'ListId']);if(_0x4558bc[_0x3dfa('0x4c')]['id']){delete _0x4558bc[_0x3dfa('0x4c')]['id'];}if(_[_0x3dfa('0x6b')](_0x4558bc[_0x3dfa('0x4c')]['from'])){throw new db[(_0x3dfa('0x83'))]['ValidationError'](_0x3dfa('0x84'));}if(_[_0x3dfa('0x6b')](_0x4558bc['body'][_0x3dfa('0x4c')])||_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x4c')]===''){throw new db[(_0x3dfa('0x83'))]['ValidationError'](_0x3dfa('0x85'));}if(_[_0x3dfa('0x6b')](_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x86')])){throw new db[(_0x3dfa('0x83'))][(_0x3dfa('0x7d'))](_0x3dfa('0x87')+_0x394bbd);}if(!_[_0x3dfa('0x88')](_0x394bbd,_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x86')])){throw new db['Sequelize']['ValidationError'](_0x3dfa('0x89')+_0x394bbd);}_0x7174bf[_0x4558bc['body'][_0x3dfa('0x86')]]=_0x4558bc[_0x3dfa('0x4c')]['from'];})[_0x3dfa('0x24')](function(){return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x4558bc['params']['id']},'include':[{'model':db[_0x3dfa('0x8a')],'as':_0x3dfa('0x8b'),'include':[{'model':db[_0x3dfa('0x8c')],'as':_0x3dfa('0x8d'),'where':_0x7174bf,'limit':0x1,'order':[[_0x3dfa('0x81'),_0x3dfa('0x8e')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x3dfa('0x24')](handleEntityNotFound(_0xc060e9,null))['then'](function(_0x2134b0){if(_0x2134b0&&_0x2134b0[_0x3dfa('0x8b')]){_0x2858f5[_0x3dfa('0x8f')]=_0x2134b0;_0x2858f5[_0x3dfa('0x90')]=_0x2134b0[_0x3dfa('0x91')];_0x2858f5[_0x3dfa('0x92')]=_0x2134b0[_0x3dfa('0x8b')];_0x2858f5[_0x3dfa('0x90')]=_[_0x3dfa('0x93')](_0x2858f5[_0x3dfa('0x90')],['priority'],[_0x3dfa('0x94')]);if(_0x2858f5[_0x3dfa('0x8f')]['Applications']){delete _0x2858f5[_0x3dfa('0x8f')][_0x3dfa('0x91')];}if(_0x2858f5[_0x3dfa('0x8f')]['List']&&_0x2858f5['account']['List'][_0x3dfa('0x8d')][_0x3dfa('0x37')]){return _0x2858f5[_0x3dfa('0x8f')][_0x3dfa('0x8b')][_0x3dfa('0x8d')][0x0];}var _0x584f8a=_[_0x3dfa('0x95')](_0x4558bc[_0x3dfa('0x4c')],{'firstName':_0x4558bc['body'][_0x3dfa('0x96')],'ListId':_0x2134b0[_0x3dfa('0x97')]});_0x584f8a[_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x86')]]=_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x96')];return db[_0x3dfa('0x8c')]['create'](_0x584f8a,{'fields':_0x2d5901,'raw':!![]});}})[_0x3dfa('0x24')](handleEntityNotFound(_0xc060e9,null))['then'](function(_0x456676){_0x2858f5[_0x3dfa('0x98')]=_0x456676;var _0x1ad406=_0x4558bc['body'][_0x3dfa('0x99')];if(_0x4558bc[_0x3dfa('0x7a')][_0x3dfa('0x9a')]){_0x1ad406=_0x4558bc[_0x3dfa('0x7a')]['cf-connecting-ip'];}else if(_0x4558bc[_0x3dfa('0x7a')][_0x3dfa('0x9b')]){_0x1ad406=_[_0x3dfa('0x9c')](_0x4558bc[_0x3dfa('0x7a')][_0x3dfa('0x9b')][_0x3dfa('0x9d')](','));}if(_0x456676){var _0x5e0352={'ContactId':_0x456676['id'],'ChatWebsiteId':_0x4558bc['params']['id'],'from':(_0x456676[_0x3dfa('0x9e')]||'')+'\x20'+(_0x456676[_0x3dfa('0x9f')]||''),'customerIp':_0x1ad406,'customerPort':_0x4558bc['headers']['x-real-port']?_0x4558bc['headers'][_0x3dfa('0xa0')]:null,'referer':_0x4558bc['body'][_0x3dfa('0xa1')],'browserName':_0x4054a8[_0x3dfa('0xa2')][_0x3dfa('0x2b')]&&_0x4054a8[_0x3dfa('0xa2')][_0x3dfa('0xa3')]?util[_0x3dfa('0xa4')](_0x3dfa('0xa5'),_0x4054a8[_0x3dfa('0xa2')][_0x3dfa('0x2b')],_0x4054a8['browser'][_0x3dfa('0xa3')]):_0x3dfa('0xa6'),'browserVersion':_0x4054a8[_0x3dfa('0xa2')][_0x3dfa('0xa3')]||_0x3dfa('0xa6'),'osName':util[_0x3dfa('0xa4')]('%s\x20%s',_0x4054a8['os']['name'],_0x4054a8['os']['version']),'osVersion':_0x4054a8['os']['version'],'deviceModel':_0x4054a8[_0x3dfa('0xa7')]['model']&&_0x4054a8[_0x3dfa('0xa7')]['vendor']?util[_0x3dfa('0xa4')](_0x3dfa('0xa8'),_0x4054a8['device'][_0x3dfa('0x32')],_0x4054a8['device'][_0x3dfa('0xa9')],_0x4054a8['device']['type']):null,'deviceVendor':_0x4054a8[_0x3dfa('0xa7')][_0x3dfa('0xa9')],'deviceType':_0x4054a8[_0x3dfa('0xa7')][_0x3dfa('0x31')],'formData':JSON[_0x3dfa('0x12')](_0x4558bc[_0x3dfa('0x4c')])};var _0x301000={'ChatWebsiteId':_0x4558bc[_0x3dfa('0x46')]['id'],'closed':![]};if(_0x4558bc['body'][_0x3dfa('0xaa')]){_0x301000['threadId']=_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xaa')];return db['ChatInteraction'][_0x3dfa('0x4a')]({'where':_0x301000})[_0x3dfa('0x24')](function(_0x5da19f){if(_0x5da19f){return[_0x5da19f,![]];}_0x5e0352[_0x3dfa('0xaa')]=_0x4558bc[_0x3dfa('0x4c')]['threadId'];_0x5e0352[_0x3dfa('0xab')]=_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xab')];return db[_0x3dfa('0xac')]['create'](_0x5e0352)[_0x3dfa('0x24')](function(_0x5dcb2e){return[_0x5dcb2e,!![]];});});}_0x301000[_0x3dfa('0xad')]=_0x456676['id'];if(_0x4558bc['body']['interaction']&&_0x4558bc[_0x3dfa('0x4c')]['interaction']['id']){_0x301000['id']=_0x4558bc['body'][_0x3dfa('0xae')]['id'];return db['ChatInteraction'][_0x3dfa('0x4a')]({'where':_0x301000})['then'](function(_0x2c55fb){if(_0x2c55fb){return[_0x2c55fb,![]];}return db['ChatInteraction'][_0x3dfa('0x4b')](_0x5e0352)[_0x3dfa('0x24')](function(_0x521ba9){return[_0x521ba9,!![]];});});}return db['ChatInteraction'][_0x3dfa('0x4b')](_0x5e0352)['then'](function(_0x444264){return[_0x444264,!![]];});}})[_0x3dfa('0xaf')](function(_0x12734d,_0x298812){if(_0x12734d){_0x4ef261=_0x298812;if(!_0x298812){var _0x2a139d={'from':(_0x2858f5[_0x3dfa('0x98')][_0x3dfa('0x9e')]||'')+'\x20'+(_0x2858f5[_0x3dfa('0x98')][_0x3dfa('0x9f')]||'')};if(_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xaa')]&&_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xb0')]&&_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xaa')]!=_0x4558bc[_0x3dfa('0x4c')]['messageId']){_0x2a139d[_0x3dfa('0xaa')]=_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xb0')];}return _0x12734d[_0x3dfa('0x22')](_0x2a139d);}else{return _0x12734d;}}})[_0x3dfa('0x24')](function(_0x7d15ad){_0x2858f5[_0x3dfa('0xae')]=_0x7d15ad[_0x3dfa('0x25')]({'plain':!![]});_0x2858f5[_0x3dfa('0xae')][_0x3dfa('0xb1')]=_0x4ef261;if(_0x2858f5[_0x3dfa('0xae')][_0x3dfa('0xb1')]){if(_0x2858f5[_0x3dfa('0x8f')]['autoclose']){_0x2858f5[_0x3dfa('0x90')]['push']({'id':0x0,'priority':_0x2858f5[_0x3dfa('0x90')]['length']+0x1,'app':_0x3dfa('0xb2'),'appdata':_0x3dfa('0xb3'),'interval':_0x3dfa('0xb4')});}}return db['ChatMessage']['create']({'body':_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0x4c')],'ChatWebsiteId':_0x4558bc['params']['id'],'ChatInteractionId':_0x7d15ad['id'],'direction':'in','ContactId':_0x2858f5['contact']['id'],'AttachmentId':_0x4558bc[_0x3dfa('0x4c')][_0x3dfa('0xb5')]});})[_0x3dfa('0x24')](function(_0x5e8d50){_0x2858f5[_0x3dfa('0x16')]=_0x5e8d50;if(_0x2858f5[_0x3dfa('0xae')]['UserId']){return db[_0x3dfa('0xb6')][_0x3dfa('0x4a')]({'attributes':['id',_0x3dfa('0x2b')],'where':{'id':_0x2858f5[_0x3dfa('0xae')][_0x3dfa('0xb7')]}})['then'](function(_0x3aaa96){if(_0x3aaa96){_0x2858f5['applications'][_0x3dfa('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3aaa96['name']+','+(_0x2858f5[_0x3dfa('0x8f')][_0x3dfa('0xb9')]||0xa),'interval':_0x3dfa('0xb4')});_0x2858f5[_0x3dfa('0xba')]=!![];}return respondWithRpcPromise(_0x3dfa('0xbb'),_0x3dfa('0xbc'),_0x2858f5);});}return respondWithRpcPromise(_0x3dfa('0xbb'),'startRouting',_0x2858f5);})[_0x3dfa('0x24')](function(_0x19ef2b){respondWithRpcPromise(_0x3dfa('0xbd'),_0x3dfa('0xbd'),{'event':_0x3dfa('0xbe'),'message':_0x19ef2b},client9002);return _0x19ef2b;})[_0x3dfa('0x24')](respondWithResult(_0xc060e9,null))['catch'](handleError(_0xc060e9,null));};exports[_0x3dfa('0xbf')]=function(_0x417f4c,_0x255c4a){var _0x1406af,_0x4c0828,_0x2413ea;var _0x1144be=[];var _0x4cac17={};var _0x39d132=_0x417f4c[_0x3dfa('0xc0')]||[];var _0x23cba8=[];var _0x35ee38;return db[_0x3dfa('0x8c')][_0x3dfa('0x52')]()[_0x3dfa('0x24')](function(_0x33858d){if(!_0x33858d){throw new db[(_0x3dfa('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x1144be=_[_0x3dfa('0x7f')](_[_0x3dfa('0x48')](_0x33858d),[_0x3dfa('0x80'),_0x3dfa('0x81'),_0x3dfa('0x82'),'ListId']);if(_0x417f4c[_0x3dfa('0x4c')]['id']){delete _0x417f4c[_0x3dfa('0x4c')]['id'];}if(_['isNil'](_0x417f4c['body'][_0x3dfa('0x96')])){throw _0x255c4a[_0x3dfa('0x1a')](0x1f4)['send'](new db[(_0x3dfa('0x83'))][(_0x3dfa('0x7d'))]('from\x20is\x20mandatory'));}if(_[_0x3dfa('0x6b')](_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0x4c')])||_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0x4c')]===''){throw _0x255c4a[_0x3dfa('0x1a')](0x1f4)[_0x3dfa('0xc1')](new db[(_0x3dfa('0x83'))][(_0x3dfa('0x7d'))](_0x3dfa('0x85')));}if(_['isNil'](_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0xc2')])){throw _0x255c4a[_0x3dfa('0x1a')](0x1f4)['send'](new db[(_0x3dfa('0x83'))][(_0x3dfa('0x7d'))](_0x3dfa('0xc3')+_0x1144be));}if(!_[_0x3dfa('0x88')](_0x1144be,_0x417f4c[_0x3dfa('0x4c')]['mapKeyOffline'])){throw _0x255c4a[_0x3dfa('0x1a')](0x1f4)[_0x3dfa('0xc1')](new db[(_0x3dfa('0x83'))][(_0x3dfa('0x7d'))](_0x3dfa('0xc4')+_0x1144be));}_0x4cac17[_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0xc2')]]=_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0x96')];})[_0x3dfa('0x24')](function(){return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x417f4c[_0x3dfa('0x46')]['id']},'include':[{'model':db['CmList'],'as':_0x3dfa('0x8b')},{'model':db[_0x3dfa('0xc5')],'as':_0x3dfa('0xc5')}]});})[_0x3dfa('0x24')](handleEntityNotFound(_0x255c4a,null))['then'](function(_0x5c12af){if(_0x5c12af&&_0x5c12af[_0x3dfa('0x8b')]){_0x4c0828=_0x5c12af;var _0x36e7d0=_[_0x3dfa('0x95')](_0x417f4c['body'],{'firstName':_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0x96')],'phone':_0x417f4c['body'][_0x3dfa('0x96')],'ListId':_0x5c12af[_0x3dfa('0x97')]});_0x36e7d0[_0x417f4c[_0x3dfa('0x4c')][_0x3dfa('0xc2')]]=_0x417f4c['body'][_0x3dfa('0x96')];return db['CmContact'][_0x3dfa('0xc6')]({'where':_0x4cac17,'defaults':_0x36e7d0});}})[_0x3dfa('0xaf')](function(_0x9ba6a4){if(_0x9ba6a4){_0x2413ea=_0x9ba6a4;var _0x5ebb1a=fs['readFileSync'](path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0xc7')),_0x3dfa('0xc8'));var _0x2917dc=ejs[_0x3dfa('0xc9')](_0x5ebb1a,{'body':_[_0x3dfa('0xca')](_0x417f4c[_0x3dfa('0x4c')]['body']),'bodyTitle':_0x4c0828[_0x3dfa('0xcb')]});return db[_0x3dfa('0xcc')][_0x3dfa('0x4b')]({'body':_0x2917dc,'plainBody':htmlToText['fromString'](_0x2917dc),'ContactId':_0x9ba6a4['id'],'ChatWebsiteId':_0x4c0828['id']});}})[_0x3dfa('0x24')](function(_0x5dd2ca){_0x35ee38=_0x5dd2ca;if(_0x39d132[_0x3dfa('0x37')]){var _0x5e2577=_0x39d132['map'](function(_0xedb54f){return{'name':_0xedb54f[_0x3dfa('0xcd')],'basename':_0xedb54f[_0x3dfa('0x62')],'type':_0xedb54f[_0x3dfa('0xce')],'ChatOfflineMessageId':_0x5dd2ca['id']};});_0x23cba8=_0x5e2577['map'](_0x9902ed=>{var _0x323a17={'filename':_0x9902ed[_0x3dfa('0x2b')],'path':path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],'server',_0x3dfa('0xc0'),_0x3dfa('0xcf'),_0x3dfa('0xd0'),_0x9902ed[_0x3dfa('0xd1')])};return _0x323a17;});if(!_0x4c0828[_0x3dfa('0xd2')]){return db[_0x3dfa('0xd3')]['transaction'](function(_0x1a6408){return db[_0x3dfa('0xd4')][_0x3dfa('0xd5')](_0x5e2577,{'transaction':_0x1a6408});});}}})[_0x3dfa('0x24')](function(){if(_0x35ee38){_0x1406af=_0x35ee38;return db['MailAccount'][_0x3dfa('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x3dfa('0xd6')],'as':_0x3dfa('0xd7'),'raw':!![],'include':[{'model':db[_0x3dfa('0xd8')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x3dfa('0x24')](function(_0x12c6ba){if(_0x12c6ba&&_0x12c6ba[_0x3dfa('0xd7')]&&_0x4c0828[_0x3dfa('0xd9')]&&_0x4c0828[_0x3dfa('0xda')]){var _0x2fb270=_0x12c6ba[_0x3dfa('0xdb')]();return respondWithRpcPromise(_0x3dfa('0xdc'),_0x3dfa('0xdd'),{'account':_0x2fb270,'message':{'from':util['format'](_0x3dfa('0xde'),_0x12c6ba[_0x3dfa('0x2b')],_0x12c6ba[_0x3dfa('0xdf')]||_0x12c6ba[_0x3dfa('0xd7')][_0x3dfa('0x4d')]),'to':_0x4c0828[_0x3dfa('0xda')],'subject':_0x4c0828['offlineMessageSubject'],'html':_0x1406af[_0x3dfa('0x4c')],'attachments':_0x23cba8}},client9003)[_0x3dfa('0x24')](function(){return _0x1406af;})['catch'](function(_0x208405){logger[_0x3dfa('0x13')](_0x208405);});}})[_0x3dfa('0x24')](function(){if(_0x4c0828&&_0x4c0828[_0x3dfa('0xd2')]&&_0x4c0828[_0x3dfa('0xe0')]){var _0x16193e=[];if(_0x39d132[_0x3dfa('0x37')]){_0x16193e=_0x39d132[_0x3dfa('0x40')](function(_0x5054fe){return{'name':_0x5054fe[_0x3dfa('0xcd')],'basename':_0x5054fe[_0x3dfa('0x62')],'type':_0x5054fe[_0x3dfa('0xce')],'ChatOfflineMessageId':_0x35ee38['id']};});}var _0x16f9ea;if(!_[_0x3dfa('0x6b')](_0x4c0828[_0x3dfa('0xe1')])){var _0x20adc0=_[_0x3dfa('0x40')](_0x417f4c['body'],function(_0x5a9a2f){return _0x5a9a2f;});var _0x498b8b=_[_0x3dfa('0xe2')](_0x20adc0)[0x0];var _0x30db7a=_[_0x3dfa('0xe3')](_0x498b8b,function(_0x299f5a){return _0x299f5a;});_0x16f9ea=_0x30db7a[0x1][_0x4c0828[_0x3dfa('0xe1')]];}var _0x400025={'from':_0x2413ea[_0x3dfa('0xdf')],'firstName':_0x2413ea['firstName'],'lastName':_0x2413ea[_0x3dfa('0x9f')],'mapKey':_0x3dfa('0xdf'),'message':{'from':_0x2413ea[_0x3dfa('0xdf')],'to':_0x4c0828[_0x3dfa('0xc5')]['email'],'cc':'','subject':_[_0x3dfa('0x6b')](_0x16f9ea)?_0x4c0828[_0x3dfa('0xe4')]:_0x16f9ea,'messageId':'','sentAt':new Date(),'attach':_0x16193e[_0x3dfa('0x37')],'attachments':_0x16193e,'originChannel':_0x3dfa('0xe5'),'ChatWebsiteId':_0x4c0828['id'],'ChatOfflineMessageId':_0x1406af['id'],'originTo':_0x4c0828['MailAccount'][_0x3dfa('0xdf')]},'body':_0x1406af[_0x3dfa('0x4c')]};var _0x18ded6={'account':{'id':_0x4c0828[_0x3dfa('0xe0')]},'body':_0x400025,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x3dfa('0xe6'),_0x3dfa('0xe7'),_0x18ded6,client9001)[_0x3dfa('0x24')](function(){return _0x1406af;})['catch'](function(_0x3ec458){logger[_0x3dfa('0x13')](_0x3ec458);});}return;})['then'](function(){if(_0x1406af){return _0x1406af;}})[_0x3dfa('0x24')](respondWithResult(_0x255c4a,null))[_0x3dfa('0x19')](function(_0x437ceb){logger['error']('catch',_0x437ceb);for(var _0x1d37bb of _0x39d132){var _0x366a18=path[_0x3dfa('0x68')](config['root'],_0x3dfa('0xe8'),_0x3dfa('0xc0'),'attachments',_0x3dfa('0xd0'),_0x1d37bb[_0x3dfa('0x62')]);fs_extra['remove'](_0x366a18)[_0x3dfa('0x19')](function(_0xfc896d){logger[_0x3dfa('0x13')](_0x3dfa('0xe9'),_0x366a18,_0xfc896d);});}});};exports['addInteraction']=function(_0x5d2d52,_0x385e75){return db[_0x3dfa('0xac')][_0x3dfa('0x4a')]({'where':{'id':_0x5d2d52[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x385e75,null))[_0x3dfa('0x24')](function(_0x5170d8){if(_0x5170d8){return _0x5170d8['addInteraction'](_0x5d2d52[_0x3dfa('0x4c')][_0x3dfa('0x5b')],_[_0x3dfa('0xea')](_0x5d2d52[_0x3dfa('0x4c')],[_0x3dfa('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x385e75,null))['catch'](handleError(_0x385e75,null));};exports[_0x3dfa('0xeb')]=function(_0x4b4c9a,_0x848c97){var _0x3e9aab={'raw':![],'where':{}};var _0x56dc4a={};var _0x1d45d6={'count':0x0,'rows':[]};return db[_0x3dfa('0x2e')][_0x3dfa('0x56')]({'where':{'id':_0x4b4c9a[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x848c97,null))['then'](function(_0x54cb20){if(_0x54cb20){_0x56dc4a[_0x3dfa('0x32')]=_['keys'](db[_0x3dfa('0xac')][_0x3dfa('0x2f')]);_0x56dc4a[_0x3dfa('0x33')]=_[_0x3dfa('0x48')](_0x4b4c9a[_0x3dfa('0x33')]);_0x56dc4a[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0x56dc4a[_0x3dfa('0x32')],_0x56dc4a['query']);_0x3e9aab[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x56dc4a[_0x3dfa('0x32')],qs[_0x3dfa('0x35')](_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0x35')]));_0x3e9aab[_0x3dfa('0x36')]=_0x3e9aab[_0x3dfa('0x36')][_0x3dfa('0x37')]?_0x3e9aab[_0x3dfa('0x36')]:_0x56dc4a[_0x3dfa('0x32')];if(!_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0x38')]('nolimit')){_0x3e9aab[_0x3dfa('0x1e')]=qs[_0x3dfa('0x1e')](_0x4b4c9a[_0x3dfa('0x33')]['limit']);_0x3e9aab[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x4b4c9a['query'][_0x3dfa('0x1c')]);}_0x3e9aab[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0x3b')]);_0x3e9aab[_0x3dfa('0x3c')]=qs['filters'](_[_0x3dfa('0x3e')](_0x4b4c9a[_0x3dfa('0x33')],_0x56dc4a[_0x3dfa('0x3d')]));_0x3e9aab[_0x3dfa('0x3c')][_0x3dfa('0x54')]=_0x54cb20['id'];if(_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0x58')]){_0x3e9aab['where']=_[_0x3dfa('0x3f')](_0x3e9aab[_0x3dfa('0x3c')],{'$or':_[_0x3dfa('0x40')](_0x3e9aab[_0x3dfa('0x36')],function(_0x57d6b5){var _0x1f907a={};_0x1f907a[_0x57d6b5]={'$like':'%'+_0x4b4c9a[_0x3dfa('0x33')]['filter']+'%'};return _0x1f907a;})});}_0x3e9aab=_[_0x3dfa('0x3f')]({},_0x3e9aab,_0x4b4c9a[_0x3dfa('0x42')]);return db[_0x3dfa('0xac')][_0x3dfa('0x1f')]({'where':_0x3e9aab[_0x3dfa('0x3c')]})[_0x3dfa('0x24')](function(_0x39f661){_0x1d45d6[_0x3dfa('0x1f')]=_0x39f661;if(_0x4b4c9a[_0x3dfa('0x33')]['includeAll']){_0x3e9aab[_0x3dfa('0x43')]=[{'model':db[_0x3dfa('0x8c')],'as':_0x3dfa('0xec'),'required':![]},{'model':db[_0x3dfa('0xb6')],'as':_0x3dfa('0xed'),'attributes':[_0x3dfa('0x2b'),_0x3dfa('0xee'),_0x3dfa('0xef')],'required':![]},{'model':db[_0x3dfa('0xf0')],'as':_0x3dfa('0xf1'),'attributes':['id','name',_0x3dfa('0xf2')],'where':_0x4b4c9a['query'][_0x3dfa('0xf3')]?{'id':_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0xf3')]}:undefined,'required':_0x4b4c9a[_0x3dfa('0x33')][_0x3dfa('0xf3')]?!![]:![]}];}return db[_0x3dfa('0xac')]['findAll'](_0x3e9aab);})[_0x3dfa('0x24')](function(_0x178cb6){_0x1d45d6[_0x3dfa('0x44')]=_0x178cb6;return _0x1d45d6;});}})[_0x3dfa('0x24')](respondWithFilteredResult(_0x848c97,_0x3e9aab))[_0x3dfa('0x19')](handleError(_0x848c97,null));};function iftimePromise(_0x55a1a1,_0x544a51){return respondWithRpcPromise(_0x3dfa('0xf4'),_0x3dfa('0xf5'),{'command':_0x544a51[_0x3dfa('0xf6')]?util[_0x3dfa('0xa4')]('iftime\x20%s,%s',_0x55a1a1[_0x3dfa('0xf7')],_0x544a51[_0x3dfa('0xf6')]):util[_0x3dfa('0xa4')]('iftime\x20%s',_0x55a1a1['interval'])},client9002)[_0x3dfa('0x24')](function(_0x332512){var _0x29d848=_0x332512&&_0x332512[_0x3dfa('0xf8')](_0x3dfa('0xf9'))>=0x0?!![]:![];logger[_0x3dfa('0x17')](_0x3dfa('0xfa'),_0x544a51['id'],_0x55a1a1['id'],_0x55a1a1[_0x3dfa('0xf7')],_0x29d848?_0x3dfa('0xfb'):_0x3dfa('0xfc'),_0x544a51['timezone']?_0x544a51[_0x3dfa('0xf6')]:'No\x20timezone');return _0x29d848;})['catch'](function(_0x59b3b7){logger[_0x3dfa('0x13')](_0x3dfa('0xfa'),_0x544a51['id'],_0x55a1a1['id'],_0x55a1a1[_0x3dfa('0xf7')],util[_0x3dfa('0xfd')](_0x59b3b7,{'showHidden':![],'depth':null}),_0x544a51[_0x3dfa('0xf6')]?_0x544a51[_0x3dfa('0xf6')]:'No\x20timezone');return![];});}exports[_0x3dfa('0xf5')]=function(_0x517e30,_0x2c3d9e){var _0x2f4b4e=0x0;var _0x19a891=0x0;var _0xbacf3d=![];var _0x597a0e;var _0x3138b5;return db[_0x3dfa('0x2e')]['find']({'where':{'id':_0x517e30[_0x3dfa('0x46')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x3dfa('0xfe')],'as':_0x3dfa('0xff'),'attributes':['id',_0x3dfa('0xf7')],'raw':!![]}]}]})[_0x3dfa('0x24')](handleEntityNotFound(_0x2c3d9e,null))[_0x3dfa('0x24')](function(_0x2f90e0){if(_0x2f90e0){_0x597a0e=_0x2f90e0;return _0x2f90e0[_0x3dfa('0x100')]({'raw':!![]});}})[_0x3dfa('0x24')](function(_0x3eaf60){if(_0x597a0e){if(_0x3eaf60){_0x3138b5=_0x3eaf60;}}return require(_0x3dfa('0x101'))[_0x3dfa('0x69')]();})[_0x3dfa('0x24')](function(_0x1df7e8){if(_0x1df7e8){_0x19a891=_0x1df7e8[_0x3dfa('0x102')];_0xbacf3d=_0x1df7e8[_0x3dfa('0x6a')];}})[_0x3dfa('0x24')](function(){return db[_0x3dfa('0xac')]['count']({'where':{'closed':![]}});})[_0x3dfa('0x24')](function(_0x28e82d){_0x2f4b4e=_0x28e82d;if(_0x19a891&&_0x28e82d>_0x19a891){return db[_0x3dfa('0x103')][_0x3dfa('0x56')]({'where':{'id':0x1}})[_0x3dfa('0x24')](function(_0x31a687){if(_0x31a687){_0x31a687[_0x3dfa('0x104')](_0x3dfa('0x105'));}});}})[_0x3dfa('0x24')](function(){if(_0x597a0e[_0x3dfa('0xfe')]&&_0x597a0e['Interval'][_0x3dfa('0xff')]){var _0x2dbd76=[];for(var _0x4f0c56=0x0;_0x4f0c56<_0x597a0e['Interval'][_0x3dfa('0xff')]['length'];_0x4f0c56++){var _0x104477=_0x597a0e[_0x3dfa('0xfe')]['Intervals'][_0x4f0c56][_0x3dfa('0x25')]({'plain':!![]});_0x2dbd76['push'](iftimePromise(_0x104477,_0x597a0e));}return BPromise['all'](_0x2dbd76)[_0x3dfa('0x24')](function(_0x481803){return _[_0x3dfa('0x106')](_0x481803);});}else{return!![];}})[_0x3dfa('0x24')](function(_0x5bf2c9){var _0x507b95=fs[_0x3dfa('0x107')](path[_0x3dfa('0x68')](config[_0x3dfa('0x6d')],_0x3dfa('0x108')),_0x3dfa('0xc8'));var _0x2aa58e=new url[(_0x3dfa('0x109'))](_0x597a0e[_0x3dfa('0x10a')])[_0x3dfa('0x10b')];var _0x233eb4=_0x3dfa('0x10c');var _0x52e6d8=![];var _0x485af5={'chatVersion':_0x233eb4,'chatWebsiteAddressOrigin':_0x2aa58e,'remote':_0x597a0e[_0x3dfa('0x10d')],'query':querystring['stringify'](_[_0x3dfa('0x3f')](_0x597a0e[_0x3dfa('0x25')]({'plain':!![]}),{'customerIp':_0x517e30[_0x3dfa('0x7a')]['x-forwarded-for']||_0x517e30[_0x3dfa('0x7a')][_0x3dfa('0x10e')]||_0x517e30[_0x3dfa('0x10f')][_0x3dfa('0x110')]||_0x517e30['ip'],'referer':_0x517e30['headers']['referer'],'openedInteractions':_0x2f4b4e,'maxInteractions':_0x19a891,'virtual':_0xbacf3d['virtual'],'online':_0x5bf2c9,'custom':_0xbacf3d}))[_0x3dfa('0x111')](/'/g,'\x5c\x27')};_0x2c3d9e[_0x3dfa('0xc1')](ejs[_0x3dfa('0xc9')](Mustache['render'](_0x507b95,_0x485af5),{'proactiveActions':_0x3138b5,'alignment':_0x597a0e[_0x3dfa('0x112')],'verticalAlignment':_0x597a0e[_0x3dfa('0x113')],'div_color':_0x597a0e[_0x3dfa('0xf2')],'labelText':_0x597a0e['labelText'],'text_color':_0x597a0e[_0x3dfa('0x114')],'text_button_color':_0x597a0e['textButtonColor'],'button_color':_0x597a0e[_0x3dfa('0x115')],'background_color':_0x597a0e[_0x3dfa('0x116')],'hideWhenOffline':_0x597a0e[_0x3dfa('0x117')],'intervalId':_0x597a0e[_0x3dfa('0x118')],'isDevelopment':_0x52e6d8,'chatVersion':_0x233eb4}));})[_0x3dfa('0x19')](handleError(_0x2c3d9e,null));};exports[_0x3dfa('0x119')]=function(_0x397aa4,_0xc78c2e){var _0x257085=_0x397aa4[_0x3dfa('0x46')]['id'];var _0x2b7d77=_0x397aa4[_0x3dfa('0x4c')];var _0x7e7549=0xc8;var _0xb417c3=null;return db[_0x3dfa('0xd3')][_0x3dfa('0x11a')]({'isolationLevel':db['sequelize'][_0x3dfa('0x11b')][_0x3dfa('0x11c')][_0x3dfa('0x11d')]},function(_0x32b5ec){return db['ChatWebsite'][_0x3dfa('0x56')]({'where':{'id':_0x257085},'transaction':_0x32b5ec})[_0x3dfa('0x24')](function(_0xba3f20){if(_0xba3f20){return db[_0x3dfa('0x11e')]['destroy']({'where':{'ChatWebsiteId':_0x257085},'transaction':_0x32b5ec})[_0x3dfa('0x24')](function(){var _0x2216a7=_[_0x3dfa('0x40')](_0x2b7d77,function(_0x3d256f){_0x3d256f['ChatWebsiteId']=_0x257085;return _0x3d256f;});return db[_0x3dfa('0x11e')]['bulkCreate'](_0x2216a7,{'transaction':_0x32b5ec});});}else{_0x7e7549=0x194;_0xb417c3=[];}});})[_0x3dfa('0x24')](function(){if(_0x7e7549!==0x194){return db['ChatApplication'][_0x3dfa('0x11f')]({'where':{'ChatWebsiteId':_0x257085},'order':_0x3dfa('0x120')})[_0x3dfa('0x24')](function(_0x45a8c6){_0xb417c3=_0x45a8c6;});}})[_0x3dfa('0x19')](function(_0x6a70b1){_0x7e7549=0x1f4;logger[_0x3dfa('0x13')](_0x6a70b1[_0x3dfa('0x2a')]);if(_0x6a70b1['name']){delete _0x6a70b1[_0x3dfa('0x2b')];}_0xb417c3=_0x6a70b1;})[_0x3dfa('0x121')](function(){if(_0xb417c3===null){_0xc78c2e[_0x3dfa('0x29')](_0x7e7549);}else{if(_0x7e7549===0x1f4){_0xc78c2e[_0x3dfa('0x1a')](_0x7e7549)[_0x3dfa('0xc1')](_0xb417c3);}else{_0xc78c2e[_0x3dfa('0x1a')](_0x7e7549)[_0x3dfa('0x1b')](_0xb417c3);}}});};exports[_0x3dfa('0x122')]=function(_0x390fa7,_0x52a9c9){var _0x1e189c={};var _0x32af24={};var _0x247825;var _0x6b18c9;return db[_0x3dfa('0x2e')][_0x3dfa('0x56')]({'where':{'id':_0x390fa7[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x52a9c9,null))[_0x3dfa('0x24')](function(_0x25cfe2){if(_0x25cfe2){_0x247825=_0x25cfe2;_0x32af24[_0x3dfa('0x32')]=_[_0x3dfa('0x48')](db[_0x3dfa('0x11e')][_0x3dfa('0x2f')]);_0x32af24[_0x3dfa('0x33')]=_[_0x3dfa('0x48')](_0x390fa7[_0x3dfa('0x33')]);_0x32af24[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0x32af24['model'],_0x32af24[_0x3dfa('0x33')]);_0x1e189c[_0x3dfa('0x36')]=_['intersection'](_0x32af24[_0x3dfa('0x32')],qs[_0x3dfa('0x35')](_0x390fa7[_0x3dfa('0x33')][_0x3dfa('0x35')]));_0x1e189c[_0x3dfa('0x36')]=_0x1e189c['attributes'][_0x3dfa('0x37')]?_0x1e189c[_0x3dfa('0x36')]:_0x32af24[_0x3dfa('0x32')];_0x1e189c[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x390fa7[_0x3dfa('0x33')][_0x3dfa('0x3b')]);_0x1e189c[_0x3dfa('0x3c')]=qs['filters'](_[_0x3dfa('0x3e')](_0x390fa7[_0x3dfa('0x33')],_0x32af24[_0x3dfa('0x3d')]));if(_0x390fa7['query'][_0x3dfa('0x58')]){_0x1e189c[_0x3dfa('0x3c')]=_[_0x3dfa('0x3f')](_0x1e189c[_0x3dfa('0x3c')],{'$or':_[_0x3dfa('0x40')](_0x1e189c['attributes'],function(_0x4c12e2){var _0x2e2cb1={};_0x2e2cb1[_0x4c12e2]={'$like':'%'+_0x390fa7[_0x3dfa('0x33')][_0x3dfa('0x58')]+'%'};return _0x2e2cb1;})});}_0x1e189c=_['merge']({},_0x1e189c,_0x390fa7[_0x3dfa('0x42')]);return _0x247825['getApplications'](_0x1e189c);}})[_0x3dfa('0x24')](function(_0x28b2af){if(_0x28b2af){_0x6b18c9=_0x28b2af[_0x3dfa('0x37')];if(!_0x390fa7['query']['hasOwnProperty'](_0x3dfa('0x39'))){_0x1e189c[_0x3dfa('0x1e')]=qs['limit'](_0x390fa7[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0x1e189c[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x390fa7[_0x3dfa('0x33')][_0x3dfa('0x1c')]);}return _0x247825[_0x3dfa('0x122')](_0x1e189c);}})['then'](function(_0x5e12ea){if(_0x5e12ea){return _0x5e12ea?{'count':_0x6b18c9,'rows':_0x5e12ea}:null;}})[_0x3dfa('0x24')](respondWithResult(_0x52a9c9,null))[_0x3dfa('0x19')](handleError(_0x52a9c9,null));};exports['addProactiveActions']=function(_0x57f793,_0xde630f){return db[_0x3dfa('0x123')][_0x3dfa('0x4a')]({'where':{'id':_0x57f793[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0xde630f,null))['then'](function(_0x3aadf9){if(_0x3aadf9){return _0x3aadf9[_0x3dfa('0x124')](_0x57f793['body']['ids'],_[_0x3dfa('0xea')](_0x57f793[_0x3dfa('0x4c')],[_0x3dfa('0x5b'),'id'])||{});}})[_0x3dfa('0x24')](respondWithResult(_0xde630f,null))[_0x3dfa('0x19')](handleError(_0xde630f,null));};exports[_0x3dfa('0x100')]=function(_0x307ca6,_0x3cb833){var _0x32d6e0={};var _0x189813={};var _0x215fe6;var _0x50181c;return db['ChatWebsite'][_0x3dfa('0x56')]({'where':{'id':_0x307ca6[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x3cb833,null))[_0x3dfa('0x24')](function(_0x34dc4a){if(_0x34dc4a){_0x215fe6=_0x34dc4a;_0x189813[_0x3dfa('0x32')]=_['keys'](db[_0x3dfa('0x125')][_0x3dfa('0x2f')]);_0x189813[_0x3dfa('0x33')]=_[_0x3dfa('0x48')](_0x307ca6[_0x3dfa('0x33')]);_0x189813[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0x189813[_0x3dfa('0x32')],_0x189813[_0x3dfa('0x33')]);_0x32d6e0[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x189813[_0x3dfa('0x32')],qs[_0x3dfa('0x35')](_0x307ca6[_0x3dfa('0x33')][_0x3dfa('0x35')]));_0x32d6e0[_0x3dfa('0x36')]=_0x32d6e0['attributes'][_0x3dfa('0x37')]?_0x32d6e0[_0x3dfa('0x36')]:_0x189813[_0x3dfa('0x32')];_0x32d6e0[_0x3dfa('0x3a')]=qs['sort'](_0x307ca6[_0x3dfa('0x33')][_0x3dfa('0x3b')]);_0x32d6e0[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_['pick'](_0x307ca6[_0x3dfa('0x33')],_0x189813[_0x3dfa('0x3d')]));if(_0x307ca6[_0x3dfa('0x33')][_0x3dfa('0x58')]){_0x32d6e0[_0x3dfa('0x3c')]=_['merge'](_0x32d6e0['where'],{'$or':_['map'](_0x32d6e0[_0x3dfa('0x36')],function(_0x257f17){var _0x26789b={};_0x26789b[_0x257f17]={'$like':'%'+_0x307ca6[_0x3dfa('0x33')][_0x3dfa('0x58')]+'%'};return _0x26789b;})});}_0x32d6e0=_[_0x3dfa('0x3f')]({},_0x32d6e0,_0x307ca6['options']);return _0x215fe6['getProactiveActions'](_0x32d6e0);}})[_0x3dfa('0x24')](function(_0xbd31cf){if(_0xbd31cf){_0x50181c=_0xbd31cf[_0x3dfa('0x37')];if(!_0x307ca6['query']['hasOwnProperty'](_0x3dfa('0x39'))){_0x32d6e0[_0x3dfa('0x1e')]=qs[_0x3dfa('0x1e')](_0x307ca6[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0x32d6e0[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x307ca6[_0x3dfa('0x33')]['offset']);}return _0x215fe6['getProactiveActions'](_0x32d6e0);}})['then'](function(_0x1e28ab){if(_0x1e28ab){return _0x1e28ab?{'count':_0x50181c,'rows':_0x1e28ab}:null;}})[_0x3dfa('0x24')](respondWithResult(_0x3cb833,null))[_0x3dfa('0x19')](handleError(_0x3cb833,null));};exports[_0x3dfa('0x126')]=function(_0x172305,_0x356a44){var _0x5acabf=_0x172305['query'][_0x3dfa('0x127')]===_0x3dfa('0x128')?_0x3dfa('0x129'):_0x3dfa('0x12a');return db['ChatWebsite'][_0x3dfa('0x4a')]({'attributes':['id',_0x5acabf],'where':{'id':_0x172305['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x356a44,null))[_0x3dfa('0x24')](function(_0x475639){if(_0x475639){var _0x542f75=_0x475639[_0x5acabf];var _0x577c27=_0x542f75&&_0x542f75['items']?_0x542f75[_0x3dfa('0x12b')]:[];_0x356a44[_0x3dfa('0xc1')]({'fromKey':_[_0x3dfa('0x6b')](_0x542f75[_0x3dfa('0x12c')])?undefined:_0x542f75[_0x3dfa('0x12c')],'count':_0x577c27[_0x3dfa('0x37')],'rows':_0x577c27});}})['catch'](handleError(_0x356a44,null));};exports['getOfflineMessages']=function(_0x11daac,_0x36724a){var _0x5ea62f={'raw':![],'where':{}};var _0xeeb78e={};var _0x5b3975={'count':0x0,'rows':[]};return db[_0x3dfa('0x2e')]['findOne']({'where':{'id':_0x11daac[_0x3dfa('0x46')]['id']}})['then'](handleEntityNotFound(_0x36724a,null))['then'](function(_0x4eafcf){if(_0x4eafcf){_0xeeb78e[_0x3dfa('0x32')]=_['keys'](db[_0x3dfa('0xcc')][_0x3dfa('0x2f')]);_0xeeb78e[_0x3dfa('0x33')]=_['keys'](_0x11daac[_0x3dfa('0x33')]);_0xeeb78e[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0xeeb78e['model'],_0xeeb78e[_0x3dfa('0x33')]);_0x5ea62f[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0xeeb78e[_0x3dfa('0x32')],qs['fields'](_0x11daac['query']['fields']));_0x5ea62f['attributes']=_0x5ea62f['attributes'][_0x3dfa('0x37')]?_0x5ea62f['attributes']:_0xeeb78e['model'];if(!_0x11daac[_0x3dfa('0x33')][_0x3dfa('0x38')](_0x3dfa('0x39'))){_0x5ea62f['limit']=qs[_0x3dfa('0x1e')](_0x11daac[_0x3dfa('0x33')][_0x3dfa('0x1e')]);_0x5ea62f[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x11daac[_0x3dfa('0x33')][_0x3dfa('0x1c')]);}_0x5ea62f[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x11daac[_0x3dfa('0x33')]['sort']);_0x5ea62f[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_[_0x3dfa('0x3e')](_0x11daac[_0x3dfa('0x33')],_0xeeb78e[_0x3dfa('0x3d')]));_0x5ea62f[_0x3dfa('0x3c')]['ChatWebsiteId']=_0x4eafcf['id'];if(_0x11daac['query']['filter']){_0x5ea62f[_0x3dfa('0x3c')]=_[_0x3dfa('0x3f')](_0x5ea62f['where'],{'$or':_['map'](_0x5ea62f[_0x3dfa('0x36')],function(_0x2bb6c2){var _0x10eb9d={};_0x10eb9d[_0x2bb6c2]={'$like':'%'+_0x11daac[_0x3dfa('0x33')][_0x3dfa('0x58')]+'%'};return _0x10eb9d;})});}_0x5ea62f=_['merge']({},_0x5ea62f,_0x11daac[_0x3dfa('0x42')]);return db[_0x3dfa('0xcc')]['count']({'where':_0x5ea62f[_0x3dfa('0x3c')]})[_0x3dfa('0x24')](function(_0x56a05e){_0x5b3975[_0x3dfa('0x1f')]=_0x56a05e;if(_0x11daac[_0x3dfa('0x33')][_0x3dfa('0x49')]){_0x5ea62f['include']=[{'all':!![]}];}else{_0x5ea62f[_0x3dfa('0x43')]=[{'model':db[_0x3dfa('0x8c')],'as':_0x3dfa('0xec'),'required':![]},{'model':db['Attachment'],'as':_0x3dfa('0x12d'),'required':![]}];}return db[_0x3dfa('0xcc')]['findAll'](_0x5ea62f);})[_0x3dfa('0x24')](function(_0x393e80){_0x5b3975['rows']=_0x393e80;return _0x5b3975;});}})[_0x3dfa('0x24')](respondWithFilteredResult(_0x36724a,_0x5ea62f))[_0x3dfa('0x19')](handleError(_0x36724a,null));};exports[_0x3dfa('0x12e')]=function(_0xaa56b9,_0x585afc){return db['ChatWebsite'][_0x3dfa('0x4a')]({'where':{'id':_0xaa56b9[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x585afc,null))['then'](function(_0x30fd3f){if(_0x30fd3f){return _0x30fd3f[_0x3dfa('0x12e')](_0xaa56b9['body'][_0x3dfa('0x5b')],_[_0x3dfa('0xea')](_0xaa56b9[_0x3dfa('0x4c')],['ids','id'])||{})[_0x3dfa('0xaf')](function(_0x462a23){for(var _0x32bfd2=0x0;_0x32bfd2<_0xaa56b9[_0x3dfa('0x4c')][_0x3dfa('0x5b')]['length'];_0x32bfd2+=0x1){socket[_0x3dfa('0x12f')]('userChatWebsite:save',{'UserId':Number(_0xaa56b9[_0x3dfa('0x4c')][_0x3dfa('0x5b')][_0x32bfd2]),'ChatWebsiteId':Number(_0xaa56b9['params']['id'])});}return _0x462a23;});}})[_0x3dfa('0x24')](respondWithResult(_0x585afc,null))['catch'](handleError(_0x585afc,null));};exports[_0x3dfa('0x130')]=function(_0x2c4ff6,_0x21a2b4){return db[_0x3dfa('0x2e')][_0x3dfa('0x4a')]({'where':{'id':_0x2c4ff6[_0x3dfa('0x46')]['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x21a2b4,null))['then'](function(_0x21efeb){if(_0x21efeb){return _0x21efeb[_0x3dfa('0x130')](_0x2c4ff6[_0x3dfa('0x33')][_0x3dfa('0x5b')])[_0x3dfa('0x24')](function(){if(_[_0x3dfa('0x131')](_0x2c4ff6[_0x3dfa('0x33')][_0x3dfa('0x5b')])){for(var _0x44efc4=0x0;_0x44efc4<_0x2c4ff6[_0x3dfa('0x33')][_0x3dfa('0x5b')]['length'];_0x44efc4+=0x1){socket[_0x3dfa('0x12f')](_0x3dfa('0x132'),{'UserId':Number(_0x2c4ff6[_0x3dfa('0x33')][_0x3dfa('0x5b')][_0x44efc4]),'ChatWebsiteId':Number(_0x2c4ff6[_0x3dfa('0x46')]['id'])});}}else{socket['emit'](_0x3dfa('0x132'),{'UserId':Number(_0x2c4ff6[_0x3dfa('0x33')]['ids']),'ChatWebsiteId':Number(_0x2c4ff6[_0x3dfa('0x46')]['id'])});}});}})[_0x3dfa('0x24')](respondWithStatusCode(_0x21a2b4,null))[_0x3dfa('0x19')](handleError(_0x21a2b4,null));};exports[_0x3dfa('0x133')]=function(_0x1cd93a,_0x58a309){var _0x2830f7={};var _0x595f24={};var _0x4c1f70;var _0x16f8a8;return db[_0x3dfa('0x2e')][_0x3dfa('0x56')]({'where':{'id':_0x1cd93a['params']['id']}})[_0x3dfa('0x24')](handleEntityNotFound(_0x58a309,null))[_0x3dfa('0x24')](function(_0x170a49){if(_0x170a49){_0x4c1f70=_0x170a49;_0x595f24[_0x3dfa('0x32')]=_[_0x3dfa('0x48')](db['User'][_0x3dfa('0x2f')]);_0x595f24['query']=_[_0x3dfa('0x48')](_0x1cd93a['query']);_0x595f24[_0x3dfa('0x3d')]=_[_0x3dfa('0x34')](_0x595f24[_0x3dfa('0x32')],_0x595f24['query']);_0x2830f7[_0x3dfa('0x36')]=_[_0x3dfa('0x34')](_0x595f24[_0x3dfa('0x32')],qs['fields'](_0x1cd93a['query'][_0x3dfa('0x35')]));_0x2830f7['attributes']=_0x2830f7[_0x3dfa('0x36')][_0x3dfa('0x37')]?_0x2830f7[_0x3dfa('0x36')]:_0x595f24['model'];_0x2830f7[_0x3dfa('0x3a')]=qs[_0x3dfa('0x3b')](_0x1cd93a['query'][_0x3dfa('0x3b')]);_0x2830f7[_0x3dfa('0x3c')]=qs[_0x3dfa('0x3d')](_[_0x3dfa('0x3e')](_0x1cd93a[_0x3dfa('0x33')],_0x595f24[_0x3dfa('0x3d')]));if(_0x1cd93a[_0x3dfa('0x33')]['filter']){_0x2830f7[_0x3dfa('0x3c')]=_['merge'](_0x2830f7['where'],{'$or':_[_0x3dfa('0x40')](_0x2830f7[_0x3dfa('0x36')],function(_0x41de4f){var _0x17349d={};_0x17349d[_0x41de4f]={'$like':'%'+_0x1cd93a['query'][_0x3dfa('0x58')]+'%'};return _0x17349d;})});}_0x2830f7=_[_0x3dfa('0x3f')]({},_0x2830f7,_0x1cd93a[_0x3dfa('0x42')]);return _0x4c1f70[_0x3dfa('0x133')](_0x2830f7);}})[_0x3dfa('0x24')](function(_0x44a7be){if(_0x44a7be){_0x16f8a8=_0x44a7be[_0x3dfa('0x37')];if(!_0x1cd93a[_0x3dfa('0x33')][_0x3dfa('0x38')](_0x3dfa('0x39'))){_0x2830f7[_0x3dfa('0x1e')]=qs[_0x3dfa('0x1e')](_0x1cd93a[_0x3dfa('0x33')]['limit']);_0x2830f7[_0x3dfa('0x1c')]=qs[_0x3dfa('0x1c')](_0x1cd93a['query'][_0x3dfa('0x1c')]);}return _0x4c1f70[_0x3dfa('0x133')](_0x2830f7);}})[_0x3dfa('0x24')](function(_0x18619a){if(_0x18619a){return _0x18619a?{'count':_0x16f8a8,'rows':_0x18619a}:null;}})[_0x3dfa('0x24')](respondWithResult(_0x58a309,null))[_0x3dfa('0x19')](handleError(_0x58a309,null));}; \ No newline at end of file +var _0x2e56=['close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','openNewInteraction','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','addInteraction','ids','getInteractions','Owner','fullname','internal','color','tag','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','x-real-ip','connection','virtual','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','stack','name','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','pick','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','join','root','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','list','orderBy','priority','asc','contact','customerIp','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','autoclose','push'];(function(_0xc298ad,_0xea4dc2){var _0x11b2e6=function(_0xe2314f){while(--_0xe2314f){_0xc298ad['push'](_0xc298ad['shift']());}};_0x11b2e6(++_0xea4dc2);}(_0x2e56,0x75));var _0x62e5=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x2e56[_0x3d1244];return _0x5d6372;};'use strict';var BPromise=require(_0x62e5('0x0'));var Mustache=require('mustache');var util=require(_0x62e5('0x1'));var path=require(_0x62e5('0x2'));var ejs=require(_0x62e5('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62e5('0x4'));var querystring=require('querystring');var Redis=require(_0x62e5('0x5'));var qs=require(_0x62e5('0x6'));var logger=require(_0x62e5('0x7'))(_0x62e5('0x8'));var config=require('../../config/environment');var url=require(_0x62e5('0x9'));var db=require(_0x62e5('0xa'))['db'];config[_0x62e5('0xb')]=_[_0x62e5('0xc')](config[_0x62e5('0xb')],{'host':_0x62e5('0xd'),'port':0x18eb});var socket=require(_0x62e5('0xe'))(new Redis(config[_0x62e5('0xb')]));require(_0x62e5('0xf'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0x62e5('0x10'));var client=jayson[_0x62e5('0x11')][_0x62e5('0x12')]({'port':0x232c});var client9002=jayson[_0x62e5('0x11')][_0x62e5('0x12')]({'port':0x232a});var client9003=jayson[_0x62e5('0x11')][_0x62e5('0x12')]({'port':0x232b});var client9001=jayson[_0x62e5('0x11')][_0x62e5('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x3391c9,_0x500b8d,_0x37752a,_0x145061){return new BPromise(function(_0x9cc5ad,_0x402765){var _0x37f6b3=_0x145061||client;return _0x37f6b3[_0x62e5('0x13')](_0x3391c9,_0x37752a)[_0x62e5('0x14')](function(_0x4797ce){logger['info'](_0x62e5('0x15'),_0x500b8d,_0x62e5('0x16'));logger[_0x62e5('0x17')](_0x62e5('0x18'),_0x500b8d,'request\x20sent',JSON[_0x62e5('0x19')](_0x4797ce));if(_0x4797ce[_0x62e5('0x1a')]){if(_0x4797ce[_0x62e5('0x1a')][_0x62e5('0x1b')]===0x1f4){logger[_0x62e5('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x500b8d,_0x4797ce[_0x62e5('0x1a')][_0x62e5('0x1c')]);return _0x402765(_0x4797ce[_0x62e5('0x1a')][_0x62e5('0x1c')]);}logger['error'](_0x62e5('0x15'),_0x500b8d,_0x4797ce[_0x62e5('0x1a')][_0x62e5('0x1c')]);return _0x9cc5ad(_0x4797ce[_0x62e5('0x1a')][_0x62e5('0x1c')]);}else{logger[_0x62e5('0x1d')](_0x62e5('0x15'),_0x500b8d,_0x62e5('0x16'));_0x9cc5ad(_0x4797ce[_0x62e5('0x1e')]['message']);}})[_0x62e5('0x1f')](function(_0x2bf07e){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x500b8d,_0x2bf07e);_0x402765(_0x2bf07e);});});}function respondWithStatusCode(_0x45cac2,_0x13557c){_0x13557c=_0x13557c||0xcc;return function(_0x3c0e82){if(_0x3c0e82){return _0x45cac2[_0x62e5('0x20')](_0x13557c);}return _0x45cac2[_0x62e5('0x21')](_0x13557c)[_0x62e5('0x22')]();};}function respondWithResult(_0x568fc5,_0x42bbc3){_0x42bbc3=_0x42bbc3||0xc8;return function(_0x2d1cf5){if(_0x2d1cf5){return _0x568fc5['status'](_0x42bbc3)['json'](_0x2d1cf5);}};}function respondWithFilteredResult(_0x55c897,_0x2ed8fc){return function(_0x540e94){if(_0x540e94){var _0x319155=typeof _0x2ed8fc[_0x62e5('0x23')]===_0x62e5('0x24')&&typeof _0x2ed8fc[_0x62e5('0x25')]==='undefined';var _0x31bc35=_0x540e94[_0x62e5('0x26')];var _0x58b5bc=_0x319155?0x0:_0x2ed8fc[_0x62e5('0x23')];var _0x351d6a=_0x319155?_0x540e94['count']:_0x2ed8fc[_0x62e5('0x23')]+_0x2ed8fc[_0x62e5('0x25')];var _0x1d9f3d;if(_0x351d6a>=_0x31bc35){_0x351d6a=_0x31bc35;_0x1d9f3d=0xc8;}else{_0x1d9f3d=0xce;}_0x55c897[_0x62e5('0x21')](_0x1d9f3d);return _0x55c897[_0x62e5('0x27')](_0x62e5('0x28'),_0x58b5bc+'-'+_0x351d6a+'/'+_0x31bc35)['json'](_0x540e94);}return null;};}function saveUpdates(_0x26a25b){return function(_0x50e772){if(_0x50e772){return _0x50e772[_0x62e5('0x29')](_0x26a25b)['then'](function(_0x204de5){return _0x204de5;});}return null;};}function removeEntity(_0x3f66a9){return function(_0x37eb8c){if(_0x37eb8c){return _0x37eb8c['destroy']()[_0x62e5('0x14')](function(){var _0x167e0b=_0x37eb8c[_0x62e5('0x2a')]({'plain':!![]});var _0x14d34f=_0x62e5('0x2b');return db[_0x62e5('0x2c')][_0x62e5('0x2d')]({'where':{'type':_0x14d34f,'resourceId':_0x167e0b['id']}})[_0x62e5('0x14')](function(){return _0x37eb8c;});})[_0x62e5('0x14')](function(){_0x3f66a9[_0x62e5('0x21')](0xcc)[_0x62e5('0x22')]();});}};}function handleEntityNotFound(_0x593d59){return function(_0x4f4dbb){if(!_0x4f4dbb){_0x593d59[_0x62e5('0x20')](0x194);}return _0x4f4dbb;};}function handleError(_0x70fdc9,_0x356f65){_0x356f65=_0x356f65||0x1f4;return function(_0x4f3f17){logger['error'](_0x4f3f17[_0x62e5('0x2e')]);if(_0x4f3f17[_0x62e5('0x2f')]){delete _0x4f3f17[_0x62e5('0x2f')];}_0x70fdc9[_0x62e5('0x21')](_0x356f65)['send'](_0x4f3f17);};}exports['index']=function(_0x2d8663,_0x3ea308){var _0x434427={'include':[{'model':db[_0x62e5('0x30')],'as':'mandatoryDispositionPause'}]},_0x16c815={},_0x46eec7={'count':0x0,'rows':[]};var _0x4c3ecb=_[_0x62e5('0x31')](db[_0x62e5('0x32')][_0x62e5('0x33')],function(_0x26ac11){return{'name':_0x26ac11[_0x62e5('0x34')],'type':_0x26ac11[_0x62e5('0x35')][_0x62e5('0x36')]};});_0x16c815[_0x62e5('0x37')]=_[_0x62e5('0x31')](_0x4c3ecb,_0x62e5('0x2f'));_0x16c815[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x2d8663[_0x62e5('0x38')]);_0x16c815[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x16c815[_0x62e5('0x37')],_0x16c815['query']);_0x434427[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x16c815['model'],qs[_0x62e5('0x3d')](_0x2d8663[_0x62e5('0x38')][_0x62e5('0x3d')]));_0x434427[_0x62e5('0x3c')]=_0x434427['attributes'][_0x62e5('0x3e')]?_0x434427[_0x62e5('0x3c')]:_0x16c815['model'];if(!_0x2d8663['query'][_0x62e5('0x3f')](_0x62e5('0x40'))){_0x434427[_0x62e5('0x25')]=qs[_0x62e5('0x25')](_0x2d8663[_0x62e5('0x38')][_0x62e5('0x25')]);_0x434427[_0x62e5('0x23')]=qs['offset'](_0x2d8663[_0x62e5('0x38')][_0x62e5('0x23')]);}_0x434427[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x2d8663[_0x62e5('0x38')][_0x62e5('0x42')]);_0x434427[_0x62e5('0x43')]=qs['filters'](_['pick'](_0x2d8663[_0x62e5('0x38')],_0x16c815[_0x62e5('0x3a')]),_0x4c3ecb);if(_0x2d8663[_0x62e5('0x38')][_0x62e5('0x44')]){_0x434427[_0x62e5('0x43')]=_['merge'](_0x434427[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x4c3ecb,function(_0x386482){if(_0x386482['type']!==_0x62e5('0x45')){var _0x4a37a1={};_0x4a37a1[_0x386482[_0x62e5('0x2f')]]={'$like':'%'+_0x2d8663[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x4a37a1;}})});}_0x434427=_[_0x62e5('0x46')]({},_0x434427,_0x2d8663[_0x62e5('0x47')]);var _0x47c97f={'where':_0x434427['where']};return db[_0x62e5('0x32')][_0x62e5('0x26')](_0x47c97f)['then'](function(_0x511c86){_0x46eec7[_0x62e5('0x26')]=_0x511c86;if(_0x2d8663[_0x62e5('0x38')][_0x62e5('0x48')]){_0x434427[_0x62e5('0x49')]=[{'all':!![]}];}return db[_0x62e5('0x32')][_0x62e5('0x4a')](_0x434427);})[_0x62e5('0x14')](function(_0x1a3b57){_0x46eec7[_0x62e5('0x4b')]=_0x1a3b57;return _0x46eec7;})[_0x62e5('0x14')](respondWithFilteredResult(_0x3ea308,_0x434427))[_0x62e5('0x1f')](handleError(_0x3ea308,null));};exports[_0x62e5('0x4c')]=function(_0x277bfd,_0x3dbe16){var _0x44d207={'raw':![],'where':{'id':_0x277bfd['params']['id']},'include':[{'model':db[_0x62e5('0x30')],'as':_0x62e5('0x4d')}]},_0x123bae={};_0x123bae[_0x62e5('0x37')]=_['keys'](db[_0x62e5('0x32')][_0x62e5('0x33')]);_0x123bae[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x277bfd[_0x62e5('0x38')]);_0x123bae[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x123bae[_0x62e5('0x37')],_0x123bae[_0x62e5('0x38')]);_0x44d207[_0x62e5('0x3c')]=_['intersection'](_0x123bae[_0x62e5('0x37')],qs[_0x62e5('0x3d')](_0x277bfd[_0x62e5('0x38')]['fields']));_0x44d207['attributes']=_0x44d207['attributes'][_0x62e5('0x3e')]?_0x44d207[_0x62e5('0x3c')]:_0x123bae[_0x62e5('0x37')];if(_0x277bfd[_0x62e5('0x38')][_0x62e5('0x48')]){_0x44d207[_0x62e5('0x49')]=[{'all':!![]}];}_0x44d207=_[_0x62e5('0x46')]({},_0x44d207,_0x277bfd['options']);return db[_0x62e5('0x32')][_0x62e5('0x4e')](_0x44d207)[_0x62e5('0x14')](handleEntityNotFound(_0x3dbe16,null))[_0x62e5('0x14')](respondWithResult(_0x3dbe16,null))['catch'](handleError(_0x3dbe16,null));};exports[_0x62e5('0x4f')]=function(_0x25d391,_0x3ec16f){return db[_0x62e5('0x32')][_0x62e5('0x4f')](_0x25d391['body'],{})[_0x62e5('0x14')](function(_0x1d5363){var _0x4e8ef9=_0x25d391[_0x62e5('0x50')][_0x62e5('0x2a')]({'plain':!![]});if(!_0x4e8ef9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e8ef9['role']===_0x62e5('0x50')){var _0x19f52c=_0x1d5363[_0x62e5('0x2a')]({'plain':!![]});var _0x23276f=_0x62e5('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x23276f,'userProfileId':_0x4e8ef9[_0x62e5('0x51')]},'raw':!![]})[_0x62e5('0x14')](function(_0x132059){if(_0x132059&&_0x132059[_0x62e5('0x52')]===0x0){return db[_0x62e5('0x2c')][_0x62e5('0x4f')]({'name':_0x19f52c['name'],'resourceId':_0x19f52c['id'],'type':_0x132059[_0x62e5('0x2f')],'sectionId':_0x132059['id']},{})['then'](function(){return _0x1d5363;});}else{return _0x1d5363;}})[_0x62e5('0x1f')](function(_0x1ec476){logger[_0x62e5('0x1a')](_0x62e5('0x53'),_0x1ec476);throw _0x1ec476;});}return _0x1d5363;})['then'](respondWithResult(_0x3ec16f,0xc9))[_0x62e5('0x1f')](handleError(_0x3ec16f,null));};exports[_0x62e5('0x29')]=function(_0x174d6c,_0x4aac3f){if(_0x174d6c[_0x62e5('0x54')]['id']){delete _0x174d6c[_0x62e5('0x54')]['id'];}return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x174d6c[_0x62e5('0x55')]['id']},'include':[{'model':db[_0x62e5('0x30')],'as':_0x62e5('0x4d')}]})[_0x62e5('0x14')](handleEntityNotFound(_0x4aac3f,null))[_0x62e5('0x14')](saveUpdates(_0x174d6c[_0x62e5('0x54')],null))[_0x62e5('0x14')](respondWithResult(_0x4aac3f,null))[_0x62e5('0x1f')](handleError(_0x4aac3f,null));};exports[_0x62e5('0x2d')]=function(_0x53f1e8,_0x130cd4){return db[_0x62e5('0x32')]['find']({'where':{'id':_0x53f1e8[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x130cd4,null))[_0x62e5('0x14')](removeEntity(_0x130cd4,null))[_0x62e5('0x1f')](handleError(_0x130cd4,null));};exports[_0x62e5('0x56')]=function(_0xc6da0f,_0x23a8ad){return db[_0x62e5('0x32')]['describe']()['then'](respondWithResult(_0x23a8ad,null))['catch'](handleError(_0x23a8ad,null));};exports[_0x62e5('0x57')]=function(_0x549aa7,_0x53f733){if(_0x549aa7[_0x62e5('0x54')]['id']){delete _0x549aa7['body']['id'];}return db['ChatWebsite'][_0x62e5('0x4e')]({'where':{'id':_0x549aa7[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x53f733,null))[_0x62e5('0x14')](function(_0x498cbe){if(_0x498cbe){_0x549aa7['body'][_0x62e5('0x58')]=_0x498cbe['id'];return db[_0x62e5('0x59')]['create'](_0x549aa7[_0x62e5('0x54')]);}})[_0x62e5('0x14')](respondWithResult(_0x53f733,null))[_0x62e5('0x1f')](handleError(_0x53f733,null));};exports[_0x62e5('0x5a')]=function(_0x5b4041,_0x420e15){var _0x3991ae={'raw':![],'where':{}};var _0x532205={};var _0x476212={'count':0x0,'rows':[]};return db[_0x62e5('0x32')][_0x62e5('0x5b')]({'where':{'id':_0x5b4041[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x420e15,null))[_0x62e5('0x14')](function(_0x3ed409){if(_0x3ed409){_0x532205[_0x62e5('0x37')]=_[_0x62e5('0x39')](db[_0x62e5('0x59')][_0x62e5('0x33')]);_0x532205[_0x62e5('0x38')]=_['keys'](_0x5b4041[_0x62e5('0x38')]);_0x532205[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x532205[_0x62e5('0x37')],_0x532205[_0x62e5('0x38')]);_0x3991ae[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x532205['model'],qs[_0x62e5('0x3d')](_0x5b4041[_0x62e5('0x38')][_0x62e5('0x3d')]));_0x3991ae[_0x62e5('0x3c')]=_0x3991ae['attributes'][_0x62e5('0x3e')]?_0x3991ae['attributes']:_0x532205[_0x62e5('0x37')];if(!_0x5b4041[_0x62e5('0x38')]['hasOwnProperty'](_0x62e5('0x40'))){_0x3991ae[_0x62e5('0x25')]=qs['limit'](_0x5b4041[_0x62e5('0x38')][_0x62e5('0x25')]);_0x3991ae[_0x62e5('0x23')]=qs[_0x62e5('0x23')](_0x5b4041[_0x62e5('0x38')]['offset']);}_0x3991ae[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x5b4041['query'][_0x62e5('0x42')]);_0x3991ae[_0x62e5('0x43')]=qs['filters'](_[_0x62e5('0x5c')](_0x5b4041[_0x62e5('0x38')],_0x532205['filters']));_0x3991ae[_0x62e5('0x43')][_0x62e5('0x58')]=_0x3ed409['id'];if(_0x5b4041[_0x62e5('0x38')]['filter']){_0x3991ae[_0x62e5('0x43')]=_['merge'](_0x3991ae[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x3991ae[_0x62e5('0x3c')],function(_0x340fd5){var _0xf0e581={};_0xf0e581[_0x340fd5]={'$like':'%'+_0x5b4041[_0x62e5('0x38')]['filter']+'%'};return _0xf0e581;})});}_0x3991ae=_['merge']({},_0x3991ae,_0x5b4041[_0x62e5('0x47')]);return db[_0x62e5('0x59')]['count']({'where':_0x3991ae[_0x62e5('0x43')]})[_0x62e5('0x14')](function(_0x40f07f){_0x476212[_0x62e5('0x26')]=_0x40f07f;if(_0x5b4041['query']['includeAll']){_0x3991ae[_0x62e5('0x49')]=[{'all':!![]}];}return db[_0x62e5('0x59')][_0x62e5('0x4a')](_0x3991ae);})[_0x62e5('0x14')](function(_0x544869){_0x476212['rows']=_0x544869;return _0x476212;});}})['then'](respondWithFilteredResult(_0x420e15,_0x3991ae))[_0x62e5('0x1f')](handleError(_0x420e15,null));};exports['removeDispositions']=function(_0x57d40a,_0x4b19c3){return db['ChatWebsite'][_0x62e5('0x4e')]({'where':{'id':_0x57d40a[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x4b19c3,null))[_0x62e5('0x14')](function(_0xcb1d6f){if(_0xcb1d6f){return _0xcb1d6f[_0x62e5('0x5d')](_0x57d40a[_0x62e5('0x38')]['ids']);}})[_0x62e5('0x14')](respondWithStatusCode(_0x4b19c3,null))['catch'](handleError(_0x4b19c3,null));};exports[_0x62e5('0x5e')]=function(_0x200ac8,_0x1b68fa){if(_0x200ac8[_0x62e5('0x54')]['id']){delete _0x200ac8[_0x62e5('0x54')]['id'];}return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x200ac8[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x1b68fa,null))['then'](function(_0x5762f5){if(_0x5762f5){_0x200ac8[_0x62e5('0x54')]['ChatWebsiteId']=_0x5762f5['id'];return db['CannedAnswer']['create'](_0x200ac8[_0x62e5('0x54')]);}})[_0x62e5('0x14')](respondWithResult(_0x1b68fa,null))[_0x62e5('0x1f')](handleError(_0x1b68fa,null));};exports[_0x62e5('0x5f')]=function(_0x4e8791,_0x369982){var _0x46b3bf={'raw':![],'where':{}};var _0x5141fc={};var _0x340b79={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x62e5('0x5b')]({'where':{'id':_0x4e8791['params']['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x369982,null))[_0x62e5('0x14')](function(_0x1d1c2f){if(_0x1d1c2f){_0x5141fc[_0x62e5('0x37')]=_[_0x62e5('0x39')](db[_0x62e5('0x60')]['rawAttributes']);_0x5141fc[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x4e8791['query']);_0x5141fc[_0x62e5('0x3a')]=_['intersection'](_0x5141fc[_0x62e5('0x37')],_0x5141fc['query']);_0x46b3bf[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x5141fc['model'],qs[_0x62e5('0x3d')](_0x4e8791[_0x62e5('0x38')]['fields']));_0x46b3bf['attributes']=_0x46b3bf[_0x62e5('0x3c')][_0x62e5('0x3e')]?_0x46b3bf[_0x62e5('0x3c')]:_0x5141fc[_0x62e5('0x37')];if(!_0x4e8791['query'][_0x62e5('0x3f')](_0x62e5('0x40'))){_0x46b3bf['limit']=qs[_0x62e5('0x25')](_0x4e8791[_0x62e5('0x38')][_0x62e5('0x25')]);_0x46b3bf[_0x62e5('0x23')]=qs[_0x62e5('0x23')](_0x4e8791[_0x62e5('0x38')]['offset']);}_0x46b3bf[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x4e8791[_0x62e5('0x38')][_0x62e5('0x42')]);_0x46b3bf[_0x62e5('0x43')]=qs[_0x62e5('0x3a')](_[_0x62e5('0x5c')](_0x4e8791[_0x62e5('0x38')],_0x5141fc[_0x62e5('0x3a')]));_0x46b3bf[_0x62e5('0x43')][_0x62e5('0x58')]=_0x1d1c2f['id'];if(_0x4e8791['query'][_0x62e5('0x44')]){_0x46b3bf[_0x62e5('0x43')]=_[_0x62e5('0x46')](_0x46b3bf[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x46b3bf[_0x62e5('0x3c')],function(_0x8e7d4){var _0x2d0e92={};_0x2d0e92[_0x8e7d4]={'$like':'%'+_0x4e8791[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x2d0e92;})});}_0x46b3bf=_[_0x62e5('0x46')]({},_0x46b3bf,_0x4e8791[_0x62e5('0x47')]);return db[_0x62e5('0x60')][_0x62e5('0x26')]({'where':_0x46b3bf['where']})['then'](function(_0x49de90){_0x340b79['count']=_0x49de90;if(_0x4e8791['query'][_0x62e5('0x48')]){_0x46b3bf[_0x62e5('0x49')]=[{'all':!![]}];}return db[_0x62e5('0x60')]['findAll'](_0x46b3bf);})[_0x62e5('0x14')](function(_0x286900){_0x340b79['rows']=_0x286900;return _0x340b79;});}})['then'](respondWithFilteredResult(_0x369982,_0x46b3bf))[_0x62e5('0x1f')](handleError(_0x369982,null));};exports[_0x62e5('0x61')]=function(_0x56d9f2,_0x13952a){return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x56d9f2[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x13952a,null))['then'](function(_0x3a413f){if(_0x3a413f){return _0x3a413f[_0x62e5('0x61')](_0x56d9f2[_0x62e5('0x38')]['ids']);}})[_0x62e5('0x14')](respondWithStatusCode(_0x13952a,null))[_0x62e5('0x1f')](handleError(_0x13952a,null));};exports[_0x62e5('0x62')]=function(_0x1f4787,_0x321edc){_0x1f4787['body'][_0x62e5('0x63')]=_0x1f4787[_0x62e5('0x64')][_0x62e5('0x65')];return db[_0x62e5('0x32')]['find']({'where':{'id':_0x1f4787[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x321edc,null))[_0x62e5('0x14')](saveUpdates(_0x1f4787['body'],null))[_0x62e5('0x14')](respondWithResult(_0x321edc,null))[_0x62e5('0x1f')](handleError(_0x321edc,null));};exports[_0x62e5('0x66')]=function(_0x1ab534,_0x130253){_0x1ab534[_0x62e5('0x54')][_0x62e5('0x67')]=_0x1ab534[_0x62e5('0x64')][_0x62e5('0x65')];return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x1ab534[_0x62e5('0x55')]['id']}})['then'](handleEntityNotFound(_0x130253,null))[_0x62e5('0x14')](saveUpdates(_0x1ab534[_0x62e5('0x54')],null))[_0x62e5('0x14')](respondWithResult(_0x130253,null))['catch'](handleError(_0x130253,null));};exports[_0x62e5('0x68')]=function(_0x281dc2,_0x1861d2){_0x281dc2[_0x62e5('0x54')][_0x62e5('0x69')]=_0x281dc2[_0x62e5('0x64')][_0x62e5('0x65')];return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x281dc2[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x1861d2,null))[_0x62e5('0x14')](saveUpdates(_0x281dc2[_0x62e5('0x54')],null))['then'](respondWithResult(_0x1861d2,null))[_0x62e5('0x1f')](handleError(_0x1861d2,null));};exports['addSystemAvatar']=function(_0x1fc1cb,_0x40f674){_0x1fc1cb[_0x62e5('0x54')][_0x62e5('0x6a')]=_0x1fc1cb[_0x62e5('0x64')][_0x62e5('0x65')];return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x1fc1cb[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x40f674,null))[_0x62e5('0x14')](saveUpdates(_0x1fc1cb[_0x62e5('0x54')],null))[_0x62e5('0x14')](respondWithResult(_0x40f674,null))[_0x62e5('0x1f')](handleError(_0x40f674,null));};exports['getLogo']=function(_0x228ea3,_0x1a8c3e){var _0x300de5=path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],'server/files/images/logos/default_logo.svg');var _0x41d4a0={'where':{'id':_0x228ea3[_0x62e5('0x55')]['id']},'attributes':['id',_0x62e5('0x63')],'raw':!![]};var _0x39cf52=![];return require(_0x62e5('0x6d'))[_0x62e5('0x6e')]()[_0x62e5('0x14')](function(_0x267c8a){if(_0x267c8a){_0x39cf52=_0x267c8a[_0x62e5('0x6f')];}})[_0x62e5('0x14')](function(){return db[_0x62e5('0x32')][_0x62e5('0x4e')](_0x41d4a0);})[_0x62e5('0x14')](handleEntityNotFound(_0x1a8c3e,null))[_0x62e5('0x14')](function(_0x32e5fa){if(_0x32e5fa){if(!_[_0x62e5('0x70')](_0x32e5fa[_0x62e5('0x63')])){if(fs[_0x62e5('0x71')](path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0x72'),_0x32e5fa['sitepic']))&&_0x39cf52){_0x300de5=path[_0x62e5('0x6b')](config['root'],'server/files/images/logos/',_0x32e5fa[_0x62e5('0x63')]);}}return _0x1a8c3e['download'](_0x300de5);}})[_0x62e5('0x1f')](handleError(_0x1a8c3e,null));};exports[_0x62e5('0x73')]=function(_0x4db52a,_0x1ceb18){var _0x2fee94=path[_0x62e5('0x6b')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x48f663={'where':{'id':_0x4db52a['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x62e5('0x32')][_0x62e5('0x4e')](_0x48f663)[_0x62e5('0x14')](handleEntityNotFound(_0x1ceb18,null))[_0x62e5('0x14')](function(_0x26dedb){if(_0x26dedb){if(!_[_0x62e5('0x70')](_0x26dedb['agentAvatar'])){if(fs[_0x62e5('0x71')](path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0x74'),_0x26dedb[_0x62e5('0x67')]))){_0x2fee94=path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0x74'),_0x26dedb['agentAvatar']);}}return _0x1ceb18[_0x62e5('0x75')](_0x2fee94);}})[_0x62e5('0x1f')](handleError(_0x1ceb18,null));};exports[_0x62e5('0x76')]=function(_0x123502,_0x1f2bdd){var _0x6c0dac=path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0x77'));var _0x4a3c44={'where':{'id':_0x123502[_0x62e5('0x55')]['id']},'attributes':['id','customerAvatar',_0x62e5('0x78')],'raw':!![]};return db[_0x62e5('0x32')][_0x62e5('0x4e')](_0x4a3c44)[_0x62e5('0x14')](handleEntityNotFound(_0x1f2bdd,null))[_0x62e5('0x14')](function(_0x1e7736){if(_0x1e7736){if(!_['isNil'](_0x1e7736[_0x62e5('0x69')])){if(fs[_0x62e5('0x71')](path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0x74'),_0x1e7736[_0x62e5('0x69')]))&&_0x1e7736[_0x62e5('0x78')]){_0x6c0dac=path[_0x62e5('0x6b')](config['root'],_0x62e5('0x74'),_0x1e7736[_0x62e5('0x69')]);}}return _0x1f2bdd[_0x62e5('0x75')](_0x6c0dac);}})['catch'](handleError(_0x1f2bdd,null));};exports[_0x62e5('0x79')]=function(_0x364e88,_0x1dc31a){var _0x592fbd=path['join'](config[_0x62e5('0x6c')],_0x62e5('0x7a'));var _0x28d45e={'where':{'id':_0x364e88[_0x62e5('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x62e5('0x32')][_0x62e5('0x4e')](_0x28d45e)[_0x62e5('0x14')](handleEntityNotFound(_0x1dc31a,null))[_0x62e5('0x14')](function(_0x250362){if(_0x250362){if(!_[_0x62e5('0x70')](_0x250362[_0x62e5('0x6a')])){if(fs[_0x62e5('0x71')](path['join'](config['root'],_0x62e5('0x74'),_0x250362[_0x62e5('0x6a')]))){_0x592fbd=path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],'server/files/images/avatars/',_0x250362[_0x62e5('0x6a')]);}}return _0x1dc31a[_0x62e5('0x75')](_0x592fbd);}})[_0x62e5('0x1f')](handleError(_0x1dc31a,null));};exports['notify']=function(_0x20eac0,_0x2978ba){var _0x4f5266=require('user-agent-parser');var _0x5c76dd=new _0x4f5266();var _0x5ad401=_0x5c76dd[_0x62e5('0x7b')](_0x20eac0['headers']['user-agent'])[_0x62e5('0x7c')]();var _0x32cf38={'body':_0x20eac0[_0x62e5('0x54')],'channel':'chat'};var _0x1f3f83=[];var _0x275c63=[];var _0x4af7bf={};var _0x1cb5cf=![];return db[_0x62e5('0x7d')][_0x62e5('0x56')]()[_0x62e5('0x14')](function(_0x3cd0fb){if(!_0x3cd0fb){throw new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))]('no\x20available\x20attributes');}_0x1f3f83=_[_0x62e5('0x80')](_['keys'](_0x3cd0fb),[_0x62e5('0x81'),_0x62e5('0x82')]);_0x275c63=_['difference'](_[_0x62e5('0x39')](_0x3cd0fb),[_0x62e5('0x81'),_0x62e5('0x82'),_0x62e5('0x83'),_0x62e5('0x84')]);if(_0x20eac0['body']['id']){delete _0x20eac0['body']['id'];}if(_[_0x62e5('0x70')](_0x20eac0[_0x62e5('0x54')][_0x62e5('0x85')])){throw new db['Sequelize'][(_0x62e5('0x7f'))](_0x62e5('0x86'));}if(_[_0x62e5('0x70')](_0x20eac0[_0x62e5('0x54')]['body'])||_0x20eac0[_0x62e5('0x54')]['body']===''){throw new db['Sequelize'][(_0x62e5('0x7f'))](_0x62e5('0x87'));}if(_[_0x62e5('0x70')](_0x20eac0['body']['mapKey'])){throw new db['Sequelize'][(_0x62e5('0x7f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x275c63);}if(!_[_0x62e5('0x88')](_0x275c63,_0x20eac0[_0x62e5('0x54')][_0x62e5('0x89')])){throw new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))](_0x62e5('0x8a')+_0x275c63);}_0x4af7bf[_0x20eac0['body']['mapKey']]=_0x20eac0[_0x62e5('0x54')]['from'];})[_0x62e5('0x14')](function(){return db[_0x62e5('0x32')]['find']({'where':{'id':_0x20eac0[_0x62e5('0x55')]['id']},'include':[{'model':db[_0x62e5('0x8b')],'as':_0x62e5('0x8c'),'include':[{'model':db[_0x62e5('0x7d')],'as':_0x62e5('0x8d'),'where':_0x4af7bf,'limit':0x1,'order':[[_0x62e5('0x82'),_0x62e5('0x8e')]]}]},{'model':db[_0x62e5('0x8f')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x2978ba,null))['then'](function(_0x42a138){if(_0x42a138&&_0x42a138[_0x62e5('0x8c')]){_0x32cf38[_0x62e5('0x90')]=_0x42a138;_0x32cf38[_0x62e5('0x91')]=_0x42a138['Applications'];_0x32cf38[_0x62e5('0x92')]=_0x42a138[_0x62e5('0x8c')];_0x32cf38[_0x62e5('0x91')]=_[_0x62e5('0x93')](_0x32cf38['applications'],[_0x62e5('0x94')],[_0x62e5('0x95')]);if(_0x32cf38[_0x62e5('0x90')]['Applications']){delete _0x32cf38['account']['Applications'];}if(_0x32cf38[_0x62e5('0x90')][_0x62e5('0x8c')]&&_0x32cf38[_0x62e5('0x90')]['List']['Contacts'][_0x62e5('0x3e')]){return _0x32cf38[_0x62e5('0x90')][_0x62e5('0x8c')]['Contacts'][0x0];}var _0x4e45f2=_[_0x62e5('0xc')](_0x20eac0[_0x62e5('0x54')],{'firstName':_0x20eac0[_0x62e5('0x54')][_0x62e5('0x85')],'ListId':_0x42a138[_0x62e5('0x84')]});_0x4e45f2[_0x20eac0[_0x62e5('0x54')][_0x62e5('0x89')]]=_0x20eac0[_0x62e5('0x54')][_0x62e5('0x85')];return db[_0x62e5('0x7d')][_0x62e5('0x4f')](_0x4e45f2,{'fields':_0x1f3f83,'raw':!![]});}})[_0x62e5('0x14')](handleEntityNotFound(_0x2978ba,null))['then'](function(_0x23650c){_0x32cf38[_0x62e5('0x96')]=_0x23650c;var _0xae9460=_0x20eac0[_0x62e5('0x54')][_0x62e5('0x97')];if(_0x20eac0[_0x62e5('0x98')]['cf-connecting-ip']){_0xae9460=_0x20eac0[_0x62e5('0x98')]['cf-connecting-ip'];}else if(_0x20eac0[_0x62e5('0x98')][_0x62e5('0x99')]){_0xae9460=_[_0x62e5('0x9a')](_0x20eac0[_0x62e5('0x98')][_0x62e5('0x99')][_0x62e5('0x9b')](','));}if(_0x23650c){var _0x2aa0ae={'ContactId':_0x23650c['id'],'ChatWebsiteId':_0x20eac0['params']['id'],'from':(_0x23650c[_0x62e5('0x9c')]||'')+'\x20'+(_0x23650c[_0x62e5('0x9d')]||''),'customerIp':_0xae9460,'customerPort':_0x20eac0[_0x62e5('0x98')][_0x62e5('0x9e')]?_0x20eac0[_0x62e5('0x98')][_0x62e5('0x9e')]:null,'referer':_0x20eac0[_0x62e5('0x54')][_0x62e5('0x9f')],'browserName':_0x5ad401[_0x62e5('0xa0')]['name']&&_0x5ad401[_0x62e5('0xa0')][_0x62e5('0xa1')]?util['format'](_0x62e5('0xa2'),_0x5ad401['browser']['name'],_0x5ad401[_0x62e5('0xa0')][_0x62e5('0xa1')]):'unknown','browserVersion':_0x5ad401[_0x62e5('0xa0')][_0x62e5('0xa1')]||'unknown','osName':util['format'](_0x62e5('0xa2'),_0x5ad401['os'][_0x62e5('0x2f')],_0x5ad401['os'][_0x62e5('0xa1')]),'osVersion':_0x5ad401['os']['version'],'deviceModel':_0x5ad401[_0x62e5('0xa3')][_0x62e5('0x37')]&&_0x5ad401[_0x62e5('0xa3')][_0x62e5('0xa4')]?util[_0x62e5('0xa5')](_0x62e5('0xa6'),_0x5ad401[_0x62e5('0xa3')]['model'],_0x5ad401[_0x62e5('0xa3')][_0x62e5('0xa4')],_0x5ad401[_0x62e5('0xa3')][_0x62e5('0x35')]):null,'deviceVendor':_0x5ad401[_0x62e5('0xa3')]['vendor'],'deviceType':_0x5ad401[_0x62e5('0xa3')][_0x62e5('0x35')],'formData':JSON['stringify'](_0x20eac0[_0x62e5('0x54')])};var _0x5e5b8b={'ChatWebsiteId':_0x20eac0[_0x62e5('0x55')]['id'],'closed':![]};if(_0x20eac0[_0x62e5('0x54')][_0x62e5('0xa7')]){_0x5e5b8b['threadId']=_0x20eac0['body'][_0x62e5('0xa7')];return db[_0x62e5('0xa8')][_0x62e5('0x4e')]({'where':_0x5e5b8b})['then'](function(_0x2c3004){if(_0x2c3004){return[_0x2c3004,![]];}_0x2aa0ae[_0x62e5('0xa7')]=_0x20eac0[_0x62e5('0x54')][_0x62e5('0xa7')];_0x2aa0ae[_0x62e5('0xa9')]=_0x20eac0[_0x62e5('0x54')]['externalUrl'];return db[_0x62e5('0xa8')][_0x62e5('0x4f')](_0x2aa0ae)[_0x62e5('0x14')](function(_0x281b84){return[_0x281b84,!![]];});});}_0x5e5b8b[_0x62e5('0xaa')]=_0x23650c['id'];if(_0x20eac0['body'][_0x62e5('0xab')]&&_0x20eac0[_0x62e5('0x54')]['interaction']['id']){_0x5e5b8b['id']=_0x20eac0[_0x62e5('0x54')]['interaction']['id'];return db['ChatInteraction'][_0x62e5('0x4e')]({'where':_0x5e5b8b})[_0x62e5('0x14')](function(_0x193583){if(_0x193583){return[_0x193583,![]];}return db['ChatInteraction']['create'](_0x2aa0ae)[_0x62e5('0x14')](function(_0x1ab365){return[_0x1ab365,!![]];});});}return db[_0x62e5('0xa8')][_0x62e5('0x4f')](_0x2aa0ae)[_0x62e5('0x14')](function(_0x23f7fd){return[_0x23f7fd,!![]];});}})[_0x62e5('0xac')](function(_0x580ac9,_0x7b7934){if(_0x580ac9){_0x1cb5cf=_0x7b7934;if(!_0x7b7934){var _0x2f24d0={'from':(_0x32cf38[_0x62e5('0x96')][_0x62e5('0x9c')]||'')+'\x20'+(_0x32cf38[_0x62e5('0x96')][_0x62e5('0x9d')]||'')};if(_0x20eac0['body']['threadId']&&_0x20eac0[_0x62e5('0x54')]['messageId']&&_0x20eac0[_0x62e5('0x54')][_0x62e5('0xa7')]!=_0x20eac0[_0x62e5('0x54')][_0x62e5('0xad')]){_0x2f24d0[_0x62e5('0xa7')]=_0x20eac0['body'][_0x62e5('0xad')];}return _0x580ac9[_0x62e5('0x29')](_0x2f24d0);}else{return _0x580ac9;}}})['then'](function(_0x62bb47){_0x32cf38[_0x62e5('0xab')]=_0x62bb47[_0x62e5('0x2a')]({'plain':!![]});_0x32cf38[_0x62e5('0xab')]['created']=_0x1cb5cf;if(_0x32cf38[_0x62e5('0xab')]['created']){if(_0x32cf38['account'][_0x62e5('0xae')]){_0x32cf38[_0x62e5('0x91')][_0x62e5('0xaf')]({'id':0x0,'priority':_0x32cf38[_0x62e5('0x91')][_0x62e5('0x3e')]+0x1,'app':_0x62e5('0xb0'),'appdata':_0x62e5('0xb1'),'interval':_0x62e5('0xb2')});}}return db[_0x62e5('0xb3')]['create']({'body':_0x20eac0[_0x62e5('0x54')][_0x62e5('0x54')],'ChatWebsiteId':_0x20eac0[_0x62e5('0x55')]['id'],'ChatInteractionId':_0x62bb47['id'],'direction':'in','ContactId':_0x32cf38[_0x62e5('0x96')]['id'],'AttachmentId':_0x20eac0[_0x62e5('0x54')][_0x62e5('0xb4')]});})[_0x62e5('0x14')](function(_0x2870a1){_0x32cf38[_0x62e5('0x1c')]=_0x2870a1;if(_0x32cf38[_0x62e5('0xab')][_0x62e5('0xb5')]){return db[_0x62e5('0xb6')]['find']({'attributes':['id','name'],'where':{'id':_0x32cf38[_0x62e5('0xab')][_0x62e5('0xb5')]}})[_0x62e5('0x14')](function(_0x2ff5e6){if(_0x2ff5e6){_0x32cf38[_0x62e5('0x91')][_0x62e5('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2ff5e6[_0x62e5('0x2f')]+','+(_0x32cf38[_0x62e5('0x90')][_0x62e5('0xb8')]||0xa),'interval':_0x62e5('0xb2')});_0x32cf38['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x62e5('0xb9'),_0x32cf38);});}return respondWithRpcPromise('Start',_0x62e5('0xb9'),_0x32cf38);})[_0x62e5('0x14')](function(_0x2f8840){respondWithRpcPromise(_0x62e5('0xba'),_0x62e5('0xba'),{'event':'notify','message':_0x2f8840},client9002);return _0x2f8840;})['then'](respondWithResult(_0x2978ba,null))[_0x62e5('0x1f')](handleError(_0x2978ba,null));};exports[_0x62e5('0xbb')]=function(_0x28cb62,_0xdab765){var _0x2dbe86,_0x342dd6,_0x434f4c;var _0x2bcb6f=[];var _0x3bd536={};var _0x1833d0=_0x28cb62[_0x62e5('0xbc')]||[];var _0x205ddd=[];var _0x3a382e;return db[_0x62e5('0x7d')][_0x62e5('0x56')]()[_0x62e5('0x14')](function(_0x4edfb4){if(!_0x4edfb4){throw new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))](_0x62e5('0xbd'));}_0x2bcb6f=_[_0x62e5('0x80')](_[_0x62e5('0x39')](_0x4edfb4),[_0x62e5('0x81'),_0x62e5('0x82'),'CompanyId',_0x62e5('0x84')]);if(_0x28cb62[_0x62e5('0x54')]['id']){delete _0x28cb62[_0x62e5('0x54')]['id'];}if(_[_0x62e5('0x70')](_0x28cb62[_0x62e5('0x54')][_0x62e5('0x85')])){throw _0xdab765['status'](0x1f4)[_0x62e5('0xbe')](new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))](_0x62e5('0x86')));}if(_[_0x62e5('0x70')](_0x28cb62[_0x62e5('0x54')][_0x62e5('0x54')])||_0x28cb62[_0x62e5('0x54')][_0x62e5('0x54')]===''){throw _0xdab765[_0x62e5('0x21')](0x1f4)[_0x62e5('0xbe')](new db['Sequelize']['ValidationError'](_0x62e5('0x87')));}if(_['isNil'](_0x28cb62[_0x62e5('0x54')]['mapKeyOffline'])){throw _0xdab765[_0x62e5('0x21')](0x1f4)[_0x62e5('0xbe')](new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))](_0x62e5('0xbf')+_0x2bcb6f));}if(!_['includes'](_0x2bcb6f,_0x28cb62[_0x62e5('0x54')]['mapKeyOffline'])){throw _0xdab765['status'](0x1f4)['send'](new db[(_0x62e5('0x7e'))][(_0x62e5('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bcb6f));}_0x3bd536[_0x28cb62['body']['mapKeyOffline']]=_0x28cb62[_0x62e5('0x54')][_0x62e5('0x85')];})[_0x62e5('0x14')](function(){return db[_0x62e5('0x32')]['find']({'where':{'id':_0x28cb62[_0x62e5('0x55')]['id']},'include':[{'model':db[_0x62e5('0x8b')],'as':_0x62e5('0x8c')},{'model':db[_0x62e5('0xc0')],'as':_0x62e5('0xc0')}]});})[_0x62e5('0x14')](handleEntityNotFound(_0xdab765,null))['then'](function(_0x4709dd){if(_0x4709dd&&_0x4709dd['List']){_0x342dd6=_0x4709dd;var _0x150c1a=_['defaults'](_0x28cb62['body'],{'firstName':_0x28cb62[_0x62e5('0x54')]['from'],'phone':_0x28cb62['body']['from'],'ListId':_0x4709dd[_0x62e5('0x84')]});_0x150c1a[_0x28cb62[_0x62e5('0x54')]['mapKeyOffline']]=_0x28cb62[_0x62e5('0x54')][_0x62e5('0x85')];return db['CmContact']['findOrCreate']({'where':_0x3bd536,'defaults':_0x150c1a});}})['spread'](function(_0x3c9e77){if(_0x3c9e77){_0x434f4c=_0x3c9e77;var _0x327573=fs[_0x62e5('0xc1')](path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0xc2')),_0x62e5('0xc3'));var _0x293a63=ejs[_0x62e5('0xc4')](_0x327573,{'body':_[_0x62e5('0xc5')](_0x28cb62[_0x62e5('0x54')]['body']),'bodyTitle':_0x342dd6['offlineMessageBody']});return db[_0x62e5('0xc6')]['create']({'body':_0x293a63,'plainBody':htmlToText[_0x62e5('0xc7')](_0x293a63),'ContactId':_0x3c9e77['id'],'ChatWebsiteId':_0x342dd6['id']});}})['then'](function(_0x53ac50){_0x3a382e=_0x53ac50;if(_0x1833d0['length']){var _0x22fbf6=_0x1833d0['map'](function(_0xbcf32f){return{'name':_0xbcf32f[_0x62e5('0xc8')],'basename':_0xbcf32f[_0x62e5('0x65')],'type':_0xbcf32f[_0x62e5('0xc9')],'ChatOfflineMessageId':_0x53ac50['id']};});_0x205ddd=_0x22fbf6[_0x62e5('0x31')](_0x29354e=>{var _0x46a13a={'filename':_0x29354e['name'],'path':path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0xca'),_0x62e5('0xbc'),_0x62e5('0xcb'),'offline-chat',_0x29354e[_0x62e5('0xcc')])};return _0x46a13a;});if(!_0x342dd6['openNewInteraction']){return db[_0x62e5('0xcd')][_0x62e5('0xce')](function(_0x4b6838){return db[_0x62e5('0xcf')][_0x62e5('0xd0')](_0x22fbf6,{'transaction':_0x4b6838});});}}})[_0x62e5('0x14')](function(){if(_0x3a382e){_0x2dbe86=_0x3a382e;return db['MailAccount'][_0x62e5('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x62e5('0xd1')],'as':_0x62e5('0xd2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x62e5('0xd3'),'raw':!![]}]}]});}})['then'](function(_0x131180){if(_0x131180&&_0x131180[_0x62e5('0xd2')]&&_0x342dd6[_0x62e5('0xd4')]&&_0x342dd6[_0x62e5('0xd5')]){var _0x5f0ec1=_0x131180[_0x62e5('0xd6')]();return respondWithRpcPromise(_0x62e5('0xd7'),'sendMail',{'account':_0x5f0ec1,'message':{'from':util[_0x62e5('0xa5')](_0x62e5('0xd8'),_0x131180[_0x62e5('0x2f')],_0x131180['email']||_0x131180[_0x62e5('0xd2')][_0x62e5('0x50')]),'to':_0x342dd6[_0x62e5('0xd5')],'subject':_0x342dd6['offlineMessageSubject'],'html':_0x2dbe86[_0x62e5('0x54')],'attachments':_0x205ddd}},client9003)['then'](function(){return _0x2dbe86;})[_0x62e5('0x1f')](function(_0xe28606){logger['error'](_0xe28606);});}})[_0x62e5('0x14')](function(){if(_0x342dd6&&_0x342dd6[_0x62e5('0xd9')]&&_0x342dd6['MailAccountId']){var _0x1bba93=[];if(_0x1833d0[_0x62e5('0x3e')]){_0x1bba93=_0x1833d0['map'](function(_0x31f94d){return{'name':_0x31f94d[_0x62e5('0xc8')],'basename':_0x31f94d[_0x62e5('0x65')],'type':_0x31f94d[_0x62e5('0xc9')],'ChatOfflineMessageId':_0x3a382e['id']};});}var _0x44f7b9;if(!_[_0x62e5('0x70')](_0x342dd6['subjectOffline'])){var _0x40d901=_[_0x62e5('0x31')](_0x28cb62['body'],function(_0x4aff00){return _0x4aff00;});var _0x2b80da=_[_0x62e5('0xda')](_0x40d901)[0x0];var _0x1292b0=_[_0x62e5('0xdb')](_0x2b80da,function(_0x369aff){return _0x369aff;});_0x44f7b9=_0x1292b0[0x1][_0x342dd6['subjectOffline']];}var _0x1acff0={'from':_0x434f4c[_0x62e5('0xdc')],'firstName':_0x434f4c[_0x62e5('0x9c')],'lastName':_0x434f4c['lastName'],'mapKey':_0x62e5('0xdc'),'message':{'from':_0x434f4c[_0x62e5('0xdc')],'to':_0x342dd6[_0x62e5('0xc0')][_0x62e5('0xdc')],'cc':'','subject':_['isNil'](_0x44f7b9)?_0x342dd6['offlineMessageSubject']:_0x44f7b9,'messageId':'','sentAt':new Date(),'attach':_0x1bba93[_0x62e5('0x3e')],'attachments':_0x1bba93,'originChannel':_0x62e5('0xdd'),'ChatWebsiteId':_0x342dd6['id'],'ChatOfflineMessageId':_0x2dbe86['id'],'originTo':_0x342dd6['MailAccount'][_0x62e5('0xdc')]},'body':_0x2dbe86[_0x62e5('0x54')]};var _0x5cb915={'account':{'id':_0x342dd6[_0x62e5('0xde')]},'body':_0x1acff0,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x62e5('0xdf'),_0x62e5('0xe0'),_0x5cb915,client9001)[_0x62e5('0x14')](function(){return _0x2dbe86;})[_0x62e5('0x1f')](function(_0x16045b){logger[_0x62e5('0x1a')](_0x16045b);});}return;})['then'](function(){if(_0x2dbe86){return _0x2dbe86;}})[_0x62e5('0x14')](respondWithResult(_0xdab765,null))[_0x62e5('0x1f')](function(_0x3c5580){logger[_0x62e5('0x1a')](_0x62e5('0x1f'),_0x3c5580);for(var _0xa596e0 of _0x1833d0){var _0x1f7bd1=path['join'](config['root'],_0x62e5('0xca'),_0x62e5('0xbc'),'attachments',_0x62e5('0xe1'),_0xa596e0[_0x62e5('0x65')]);fs_extra['remove'](_0x1f7bd1)[_0x62e5('0x1f')](function(_0x514100){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x1f7bd1,_0x514100);});}});};exports[_0x62e5('0xe2')]=function(_0x333943,_0x10435f){return db[_0x62e5('0xa8')][_0x62e5('0x4e')]({'where':{'id':_0x333943[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x10435f,null))[_0x62e5('0x14')](function(_0x1693e4){if(_0x1693e4){return _0x1693e4['addInteraction'](_0x333943[_0x62e5('0x54')][_0x62e5('0xe3')],_['omit'](_0x333943[_0x62e5('0x54')],[_0x62e5('0xe3'),'id'])||{});}})[_0x62e5('0x14')](respondWithResult(_0x10435f,null))[_0x62e5('0x1f')](handleError(_0x10435f,null));};exports[_0x62e5('0xe4')]=function(_0x4e21a2,_0x87c5ab){var _0x897109={'raw':![],'where':{}};var _0x16287a={};var _0x2dbfc4={'count':0x0,'rows':[]};return db[_0x62e5('0x32')][_0x62e5('0x5b')]({'where':{'id':_0x4e21a2['params']['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x87c5ab,null))[_0x62e5('0x14')](function(_0x233894){if(_0x233894){_0x16287a[_0x62e5('0x37')]=_[_0x62e5('0x39')](db[_0x62e5('0xa8')][_0x62e5('0x33')]);_0x16287a[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x4e21a2['query']);_0x16287a[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x16287a[_0x62e5('0x37')],_0x16287a[_0x62e5('0x38')]);_0x897109[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x16287a['model'],qs[_0x62e5('0x3d')](_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x3d')]));_0x897109['attributes']=_0x897109[_0x62e5('0x3c')]['length']?_0x897109[_0x62e5('0x3c')]:_0x16287a[_0x62e5('0x37')];if(!_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x3f')](_0x62e5('0x40'))){_0x897109[_0x62e5('0x25')]=qs[_0x62e5('0x25')](_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x25')]);_0x897109[_0x62e5('0x23')]=qs['offset'](_0x4e21a2[_0x62e5('0x38')]['offset']);}_0x897109[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x42')]);_0x897109['where']=qs[_0x62e5('0x3a')](_['pick'](_0x4e21a2[_0x62e5('0x38')],_0x16287a[_0x62e5('0x3a')]));_0x897109[_0x62e5('0x43')][_0x62e5('0x58')]=_0x233894['id'];if(_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x44')]){_0x897109[_0x62e5('0x43')]=_[_0x62e5('0x46')](_0x897109[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x897109[_0x62e5('0x3c')],function(_0x7cd930){var _0x2aa5ba={};_0x2aa5ba[_0x7cd930]={'$like':'%'+_0x4e21a2[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x2aa5ba;})});}_0x897109=_[_0x62e5('0x46')]({},_0x897109,_0x4e21a2[_0x62e5('0x47')]);return db['ChatInteraction'][_0x62e5('0x26')]({'where':_0x897109['where']})['then'](function(_0x3ac5b7){_0x2dbfc4[_0x62e5('0x26')]=_0x3ac5b7;if(_0x4e21a2[_0x62e5('0x38')]['includeAll']){_0x897109['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x62e5('0xb6')],'as':_0x62e5('0xe5'),'attributes':[_0x62e5('0x2f'),_0x62e5('0xe6'),_0x62e5('0xe7')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x62e5('0x2f'),_0x62e5('0xe8')],'where':_0x4e21a2[_0x62e5('0x38')][_0x62e5('0xe9')]?{'id':_0x4e21a2['query'][_0x62e5('0xe9')]}:undefined,'required':_0x4e21a2[_0x62e5('0x38')][_0x62e5('0xe9')]?!![]:![]}];}return db[_0x62e5('0xa8')][_0x62e5('0x4a')](_0x897109);})[_0x62e5('0x14')](function(_0x18aab9){_0x2dbfc4[_0x62e5('0x4b')]=_0x18aab9;return _0x2dbfc4;});}})[_0x62e5('0x14')](respondWithFilteredResult(_0x87c5ab,_0x897109))['catch'](handleError(_0x87c5ab,null));};function iftimePromise(_0xeaff20,_0x56b4ae){return respondWithRpcPromise('Command','getSnippet',{'command':_0x56b4ae[_0x62e5('0xea')]?util[_0x62e5('0xa5')](_0x62e5('0xeb'),_0xeaff20[_0x62e5('0xec')],_0x56b4ae[_0x62e5('0xea')]):util['format'](_0x62e5('0xed'),_0xeaff20[_0x62e5('0xec')])},client9002)[_0x62e5('0x14')](function(_0x1f706a){var _0x471a4d=_0x1f706a&&_0x1f706a[_0x62e5('0xee')](_0x62e5('0xef'))>=0x0?!![]:![];logger[_0x62e5('0x1d')](_0x62e5('0xf0'),_0x56b4ae['id'],_0xeaff20['id'],_0xeaff20[_0x62e5('0xec')],_0x471a4d?_0x62e5('0xf1'):_0x62e5('0xf2'),_0x56b4ae[_0x62e5('0xea')]?_0x56b4ae['timezone']:_0x62e5('0xf3'));return _0x471a4d;})[_0x62e5('0x1f')](function(_0x289a7a){logger[_0x62e5('0x1a')](_0x62e5('0xf0'),_0x56b4ae['id'],_0xeaff20['id'],_0xeaff20[_0x62e5('0xec')],util[_0x62e5('0xf4')](_0x289a7a,{'showHidden':![],'depth':null}),_0x56b4ae[_0x62e5('0xea')]?_0x56b4ae[_0x62e5('0xea')]:_0x62e5('0xf3'));return![];});}exports[_0x62e5('0xf5')]=function(_0x5913d5,_0x5b74cd){var _0x5462b3=0x0;var _0x4ae02b=0x0;var _0xa9bce6=![];var _0xe36df9;var _0x154d0d;return db['ChatWebsite']['find']({'where':{'id':_0x5913d5['params']['id']},'include':[{'model':db[_0x62e5('0xf6')],'as':'Interval','include':[{'model':db[_0x62e5('0xf6')],'as':_0x62e5('0xf7'),'attributes':['id',_0x62e5('0xec')],'raw':!![]}]}]})[_0x62e5('0x14')](handleEntityNotFound(_0x5b74cd,null))[_0x62e5('0x14')](function(_0x208dca){if(_0x208dca){_0xe36df9=_0x208dca;return _0x208dca[_0x62e5('0xf8')]({'raw':!![]});}})[_0x62e5('0x14')](function(_0x5892f2){if(_0xe36df9){if(_0x5892f2){_0x154d0d=_0x5892f2;}}return require(_0x62e5('0x6d'))['getLicense']();})[_0x62e5('0x14')](function(_0x510836){if(_0x510836){_0x4ae02b=_0x510836['virtual'];_0xa9bce6=_0x510836[_0x62e5('0x6f')];}})[_0x62e5('0x14')](function(){return db[_0x62e5('0xa8')][_0x62e5('0x26')]({'where':{'closed':![]}});})[_0x62e5('0x14')](function(_0x2bc6bc){_0x5462b3=_0x2bc6bc;if(_0x4ae02b&&_0x2bc6bc>_0x4ae02b){return db[_0x62e5('0xf9')][_0x62e5('0x5b')]({'where':{'id':0x1}})[_0x62e5('0x14')](function(_0x64bd21){if(_0x64bd21){_0x64bd21[_0x62e5('0xfa')](_0x62e5('0xfb'));}});}})[_0x62e5('0x14')](function(){if(_0xe36df9[_0x62e5('0xf6')]&&_0xe36df9[_0x62e5('0xf6')][_0x62e5('0xf7')]){var _0xcf37c6=[];for(var _0x5283fa=0x0;_0x5283fa<_0xe36df9[_0x62e5('0xf6')][_0x62e5('0xf7')][_0x62e5('0x3e')];_0x5283fa++){var _0x47fd1e=_0xe36df9[_0x62e5('0xf6')][_0x62e5('0xf7')][_0x5283fa][_0x62e5('0x2a')]({'plain':!![]});_0xcf37c6['push'](iftimePromise(_0x47fd1e,_0xe36df9));}return BPromise[_0x62e5('0xfc')](_0xcf37c6)[_0x62e5('0x14')](function(_0xac5d72){return _[_0x62e5('0xfd')](_0xac5d72);});}else{return!![];}})['then'](function(_0x2e8e8b){var _0x13cfd3=fs[_0x62e5('0xc1')](path[_0x62e5('0x6b')](config[_0x62e5('0x6c')],_0x62e5('0xfe')),'utf8');var _0x3d96c0=new url[(_0x62e5('0xff'))](_0xe36df9[_0x62e5('0x100')])[_0x62e5('0x101')];var _0x5b84df=_0x62e5('0x102');var _0x2eda41=![];var _0x30db6d={'chatVersion':_0x5b84df,'chatWebsiteAddressOrigin':_0x3d96c0,'remote':_0xe36df9['remote'],'query':querystring[_0x62e5('0x19')](_[_0x62e5('0x46')](_0xe36df9['get']({'plain':!![]}),{'customerIp':_0x5913d5[_0x62e5('0x98')]['x-forwarded-for']||_0x5913d5[_0x62e5('0x98')][_0x62e5('0x103')]||_0x5913d5[_0x62e5('0x104')]['remoteAddress']||_0x5913d5['ip'],'referer':_0x5913d5[_0x62e5('0x98')]['referer'],'openedInteractions':_0x5462b3,'maxInteractions':_0x4ae02b,'virtual':_0xa9bce6[_0x62e5('0x105')],'online':_0x2e8e8b,'custom':_0xa9bce6}))['replace'](/'/g,'\x5c\x27')};_0x5b74cd[_0x62e5('0xbe')](ejs[_0x62e5('0xc4')](Mustache[_0x62e5('0xc4')](_0x13cfd3,_0x30db6d),{'proactiveActions':_0x154d0d,'alignment':_0xe36df9[_0x62e5('0x106')],'verticalAlignment':_0xe36df9[_0x62e5('0x107')],'div_color':_0xe36df9['color'],'labelText':_0xe36df9[_0x62e5('0x108')],'text_color':_0xe36df9[_0x62e5('0x109')],'text_button_color':_0xe36df9[_0x62e5('0x10a')],'button_color':_0xe36df9[_0x62e5('0x10b')],'background_color':_0xe36df9[_0x62e5('0x10c')],'hideWhenOffline':_0xe36df9[_0x62e5('0x10d')],'intervalId':_0xe36df9['IntervalId'],'isDevelopment':_0x2eda41,'chatVersion':_0x5b84df}));})['catch'](handleError(_0x5b74cd,null));};exports[_0x62e5('0x10e')]=function(_0xa5aa91,_0x3223ba){var _0x4b4182=_0xa5aa91[_0x62e5('0x55')]['id'];var _0xfc10e5=_0xa5aa91[_0x62e5('0x54')];var _0x2aad12=0xc8;var _0x5a21fc=null;return db[_0x62e5('0xcd')]['transaction']({'isolationLevel':db[_0x62e5('0xcd')][_0x62e5('0x10f')]['ISOLATION_LEVELS'][_0x62e5('0x110')]},function(_0x528ec9){return db[_0x62e5('0x32')][_0x62e5('0x5b')]({'where':{'id':_0x4b4182},'transaction':_0x528ec9})[_0x62e5('0x14')](function(_0x5cc664){if(_0x5cc664){return db['ChatApplication'][_0x62e5('0x2d')]({'where':{'ChatWebsiteId':_0x4b4182},'transaction':_0x528ec9})['then'](function(){var _0x141714=_[_0x62e5('0x31')](_0xfc10e5,function(_0x4c1918){_0x4c1918[_0x62e5('0x58')]=_0x4b4182;return _0x4c1918;});return db[_0x62e5('0x8f')][_0x62e5('0xd0')](_0x141714,{'transaction':_0x528ec9});});}else{_0x2aad12=0x194;_0x5a21fc=[];}});})[_0x62e5('0x14')](function(){if(_0x2aad12!==0x194){return db['ChatApplication'][_0x62e5('0x111')]({'where':{'ChatWebsiteId':_0x4b4182},'order':_0x62e5('0x94')})['then'](function(_0x386bfc){_0x5a21fc=_0x386bfc;});}})[_0x62e5('0x1f')](function(_0x495f5f){_0x2aad12=0x1f4;logger[_0x62e5('0x1a')](_0x495f5f[_0x62e5('0x2e')]);if(_0x495f5f[_0x62e5('0x2f')]){delete _0x495f5f[_0x62e5('0x2f')];}_0x5a21fc=_0x495f5f;})['finally'](function(){if(_0x5a21fc===null){_0x3223ba[_0x62e5('0x20')](_0x2aad12);}else{if(_0x2aad12===0x1f4){_0x3223ba[_0x62e5('0x21')](_0x2aad12)['send'](_0x5a21fc);}else{_0x3223ba[_0x62e5('0x21')](_0x2aad12)['json'](_0x5a21fc);}}});};exports['getApplications']=function(_0x338592,_0x37d023){var _0x259ac9={};var _0x2cad59={};var _0xbf5437;var _0x5b3565;return db['ChatWebsite'][_0x62e5('0x5b')]({'where':{'id':_0x338592['params']['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x37d023,null))[_0x62e5('0x14')](function(_0x1c7545){if(_0x1c7545){_0xbf5437=_0x1c7545;_0x2cad59['model']=_[_0x62e5('0x39')](db[_0x62e5('0x8f')][_0x62e5('0x33')]);_0x2cad59[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x338592[_0x62e5('0x38')]);_0x2cad59[_0x62e5('0x3a')]=_['intersection'](_0x2cad59[_0x62e5('0x37')],_0x2cad59[_0x62e5('0x38')]);_0x259ac9[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x2cad59[_0x62e5('0x37')],qs[_0x62e5('0x3d')](_0x338592[_0x62e5('0x38')][_0x62e5('0x3d')]));_0x259ac9[_0x62e5('0x3c')]=_0x259ac9[_0x62e5('0x3c')][_0x62e5('0x3e')]?_0x259ac9[_0x62e5('0x3c')]:_0x2cad59[_0x62e5('0x37')];_0x259ac9[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x338592[_0x62e5('0x38')][_0x62e5('0x42')]);_0x259ac9['where']=qs['filters'](_[_0x62e5('0x5c')](_0x338592[_0x62e5('0x38')],_0x2cad59[_0x62e5('0x3a')]));if(_0x338592['query'][_0x62e5('0x44')]){_0x259ac9[_0x62e5('0x43')]=_['merge'](_0x259ac9[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x259ac9[_0x62e5('0x3c')],function(_0x2cfe9f){var _0x4cf0ab={};_0x4cf0ab[_0x2cfe9f]={'$like':'%'+_0x338592['query'][_0x62e5('0x44')]+'%'};return _0x4cf0ab;})});}_0x259ac9=_['merge']({},_0x259ac9,_0x338592['options']);return _0xbf5437[_0x62e5('0x112')](_0x259ac9);}})[_0x62e5('0x14')](function(_0xc3adc3){if(_0xc3adc3){_0x5b3565=_0xc3adc3[_0x62e5('0x3e')];if(!_0x338592[_0x62e5('0x38')][_0x62e5('0x3f')]('nolimit')){_0x259ac9['limit']=qs[_0x62e5('0x25')](_0x338592[_0x62e5('0x38')][_0x62e5('0x25')]);_0x259ac9[_0x62e5('0x23')]=qs[_0x62e5('0x23')](_0x338592['query'][_0x62e5('0x23')]);}return _0xbf5437[_0x62e5('0x112')](_0x259ac9);}})['then'](function(_0x3d0edf){if(_0x3d0edf){return _0x3d0edf?{'count':_0x5b3565,'rows':_0x3d0edf}:null;}})[_0x62e5('0x14')](respondWithResult(_0x37d023,null))[_0x62e5('0x1f')](handleError(_0x37d023,null));};exports[_0x62e5('0x113')]=function(_0xaf1909,_0x2b8138){return db[_0x62e5('0x114')][_0x62e5('0x4e')]({'where':{'id':_0xaf1909[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x2b8138,null))[_0x62e5('0x14')](function(_0x5986f6){if(_0x5986f6){return _0x5986f6['addProactiveActions'](_0xaf1909[_0x62e5('0x54')][_0x62e5('0xe3')],_[_0x62e5('0x115')](_0xaf1909[_0x62e5('0x54')],[_0x62e5('0xe3'),'id'])||{});}})['then'](respondWithResult(_0x2b8138,null))[_0x62e5('0x1f')](handleError(_0x2b8138,null));};exports[_0x62e5('0xf8')]=function(_0x2f313d,_0xbeb1d0){var _0x51e909={};var _0x261ff1={};var _0x12f973;var _0x4d4109;return db['ChatWebsite'][_0x62e5('0x5b')]({'where':{'id':_0x2f313d[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0xbeb1d0,null))[_0x62e5('0x14')](function(_0x5b27cf){if(_0x5b27cf){_0x12f973=_0x5b27cf;_0x261ff1[_0x62e5('0x37')]=_[_0x62e5('0x39')](db[_0x62e5('0x116')][_0x62e5('0x33')]);_0x261ff1[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x2f313d[_0x62e5('0x38')]);_0x261ff1[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x261ff1[_0x62e5('0x37')],_0x261ff1[_0x62e5('0x38')]);_0x51e909[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x261ff1[_0x62e5('0x37')],qs[_0x62e5('0x3d')](_0x2f313d['query'][_0x62e5('0x3d')]));_0x51e909[_0x62e5('0x3c')]=_0x51e909['attributes']['length']?_0x51e909[_0x62e5('0x3c')]:_0x261ff1['model'];_0x51e909[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x2f313d[_0x62e5('0x38')][_0x62e5('0x42')]);_0x51e909[_0x62e5('0x43')]=qs['filters'](_['pick'](_0x2f313d[_0x62e5('0x38')],_0x261ff1[_0x62e5('0x3a')]));if(_0x2f313d[_0x62e5('0x38')][_0x62e5('0x44')]){_0x51e909[_0x62e5('0x43')]=_[_0x62e5('0x46')](_0x51e909[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x51e909[_0x62e5('0x3c')],function(_0x3518b1){var _0x45e037={};_0x45e037[_0x3518b1]={'$like':'%'+_0x2f313d[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x45e037;})});}_0x51e909=_[_0x62e5('0x46')]({},_0x51e909,_0x2f313d[_0x62e5('0x47')]);return _0x12f973[_0x62e5('0xf8')](_0x51e909);}})[_0x62e5('0x14')](function(_0x145e03){if(_0x145e03){_0x4d4109=_0x145e03[_0x62e5('0x3e')];if(!_0x2f313d[_0x62e5('0x38')][_0x62e5('0x3f')](_0x62e5('0x40'))){_0x51e909[_0x62e5('0x25')]=qs['limit'](_0x2f313d['query'][_0x62e5('0x25')]);_0x51e909[_0x62e5('0x23')]=qs[_0x62e5('0x23')](_0x2f313d[_0x62e5('0x38')][_0x62e5('0x23')]);}return _0x12f973[_0x62e5('0xf8')](_0x51e909);}})['then'](function(_0x5bc46f){if(_0x5bc46f){return _0x5bc46f?{'count':_0x4d4109,'rows':_0x5bc46f}:null;}})[_0x62e5('0x14')](respondWithResult(_0xbeb1d0,null))[_0x62e5('0x1f')](handleError(_0xbeb1d0,null));};exports[_0x62e5('0x117')]=function(_0xa4d3a4,_0x22852e){var _0x5812a6=_0xa4d3a4[_0x62e5('0x38')][_0x62e5('0x118')]===_0x62e5('0x119')?_0x62e5('0x11a'):'onlineForm';return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'attributes':['id',_0x5812a6],'where':{'id':_0xa4d3a4['params']['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x22852e,null))[_0x62e5('0x14')](function(_0x5a9751){if(_0x5a9751){var _0x25a493=_0x5a9751[_0x5812a6];var _0x3c7631=_0x25a493&&_0x25a493[_0x62e5('0x11b')]?_0x25a493[_0x62e5('0x11b')]:[];_0x22852e['send']({'fromKey':_['isNil'](_0x25a493[_0x62e5('0x11c')])?undefined:_0x25a493[_0x62e5('0x11c')],'count':_0x3c7631[_0x62e5('0x3e')],'rows':_0x3c7631});}})['catch'](handleError(_0x22852e,null));};exports['getOfflineMessages']=function(_0x4366a3,_0x40a263){var _0x5f3987={'raw':![],'where':{}};var _0x59ef0b={};var _0x147ff0={'count':0x0,'rows':[]};return db[_0x62e5('0x32')]['findOne']({'where':{'id':_0x4366a3[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x40a263,null))[_0x62e5('0x14')](function(_0x517871){if(_0x517871){_0x59ef0b['model']=_[_0x62e5('0x39')](db[_0x62e5('0xc6')][_0x62e5('0x33')]);_0x59ef0b['query']=_['keys'](_0x4366a3[_0x62e5('0x38')]);_0x59ef0b[_0x62e5('0x3a')]=_['intersection'](_0x59ef0b[_0x62e5('0x37')],_0x59ef0b[_0x62e5('0x38')]);_0x5f3987[_0x62e5('0x3c')]=_[_0x62e5('0x3b')](_0x59ef0b['model'],qs[_0x62e5('0x3d')](_0x4366a3[_0x62e5('0x38')]['fields']));_0x5f3987[_0x62e5('0x3c')]=_0x5f3987[_0x62e5('0x3c')][_0x62e5('0x3e')]?_0x5f3987[_0x62e5('0x3c')]:_0x59ef0b[_0x62e5('0x37')];if(!_0x4366a3['query'][_0x62e5('0x3f')]('nolimit')){_0x5f3987[_0x62e5('0x25')]=qs[_0x62e5('0x25')](_0x4366a3[_0x62e5('0x38')]['limit']);_0x5f3987[_0x62e5('0x23')]=qs[_0x62e5('0x23')](_0x4366a3[_0x62e5('0x38')][_0x62e5('0x23')]);}_0x5f3987[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x4366a3[_0x62e5('0x38')]['sort']);_0x5f3987[_0x62e5('0x43')]=qs[_0x62e5('0x3a')](_[_0x62e5('0x5c')](_0x4366a3['query'],_0x59ef0b[_0x62e5('0x3a')]));_0x5f3987[_0x62e5('0x43')][_0x62e5('0x58')]=_0x517871['id'];if(_0x4366a3[_0x62e5('0x38')]['filter']){_0x5f3987[_0x62e5('0x43')]=_[_0x62e5('0x46')](_0x5f3987[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x5f3987['attributes'],function(_0x159d9f){var _0x4288e7={};_0x4288e7[_0x159d9f]={'$like':'%'+_0x4366a3[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x4288e7;})});}_0x5f3987=_[_0x62e5('0x46')]({},_0x5f3987,_0x4366a3[_0x62e5('0x47')]);return db[_0x62e5('0xc6')][_0x62e5('0x26')]({'where':_0x5f3987['where']})[_0x62e5('0x14')](function(_0x1861e6){_0x147ff0[_0x62e5('0x26')]=_0x1861e6;if(_0x4366a3[_0x62e5('0x38')][_0x62e5('0x48')]){_0x5f3987[_0x62e5('0x49')]=[{'all':!![]}];}else{_0x5f3987[_0x62e5('0x49')]=[{'model':db[_0x62e5('0x7d')],'as':_0x62e5('0x11d'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x62e5('0xc6')][_0x62e5('0x4a')](_0x5f3987);})[_0x62e5('0x14')](function(_0x49cac6){_0x147ff0[_0x62e5('0x4b')]=_0x49cac6;return _0x147ff0;});}})['then'](respondWithFilteredResult(_0x40a263,_0x5f3987))[_0x62e5('0x1f')](handleError(_0x40a263,null));};exports['addAgents']=function(_0x4dd6f4,_0x5f43d6){return db[_0x62e5('0x32')][_0x62e5('0x4e')]({'where':{'id':_0x4dd6f4[_0x62e5('0x55')]['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x5f43d6,null))[_0x62e5('0x14')](function(_0xdbc0be){if(_0xdbc0be){return _0xdbc0be[_0x62e5('0x11e')](_0x4dd6f4[_0x62e5('0x54')]['ids'],_[_0x62e5('0x115')](_0x4dd6f4[_0x62e5('0x54')],[_0x62e5('0xe3'),'id'])||{})[_0x62e5('0xac')](function(_0x3145f8){for(var _0xe4e6c7=0x0;_0xe4e6c7<_0x4dd6f4['body'][_0x62e5('0xe3')]['length'];_0xe4e6c7+=0x1){socket[_0x62e5('0x11f')](_0x62e5('0x120'),{'UserId':Number(_0x4dd6f4['body']['ids'][_0xe4e6c7]),'ChatWebsiteId':Number(_0x4dd6f4['params']['id'])});}return _0x3145f8;});}})['then'](respondWithResult(_0x5f43d6,null))[_0x62e5('0x1f')](handleError(_0x5f43d6,null));};exports[_0x62e5('0x121')]=function(_0x516599,_0x1fe39f){return db['ChatWebsite']['find']({'where':{'id':_0x516599[_0x62e5('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fe39f,null))[_0x62e5('0x14')](function(_0x447d20){if(_0x447d20){return _0x447d20[_0x62e5('0x121')](_0x516599[_0x62e5('0x38')]['ids'])['then'](function(){if(_[_0x62e5('0x122')](_0x516599[_0x62e5('0x38')]['ids'])){for(var _0x3fbf8d=0x0;_0x3fbf8d<_0x516599[_0x62e5('0x38')]['ids'][_0x62e5('0x3e')];_0x3fbf8d+=0x1){socket[_0x62e5('0x11f')](_0x62e5('0x123'),{'UserId':Number(_0x516599[_0x62e5('0x38')]['ids'][_0x3fbf8d]),'ChatWebsiteId':Number(_0x516599[_0x62e5('0x55')]['id'])});}}else{socket[_0x62e5('0x11f')](_0x62e5('0x123'),{'UserId':Number(_0x516599[_0x62e5('0x38')]['ids']),'ChatWebsiteId':Number(_0x516599[_0x62e5('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1fe39f,null))[_0x62e5('0x1f')](handleError(_0x1fe39f,null));};exports[_0x62e5('0x124')]=function(_0x14e1bb,_0x3e1045){var _0x22a74e={};var _0x537f97={};var _0x3d7b4d;var _0x1cd0e0;return db[_0x62e5('0x32')][_0x62e5('0x5b')]({'where':{'id':_0x14e1bb['params']['id']}})[_0x62e5('0x14')](handleEntityNotFound(_0x3e1045,null))[_0x62e5('0x14')](function(_0x1bed1d){if(_0x1bed1d){_0x3d7b4d=_0x1bed1d;_0x537f97['model']=_[_0x62e5('0x39')](db[_0x62e5('0xb6')][_0x62e5('0x33')]);_0x537f97[_0x62e5('0x38')]=_[_0x62e5('0x39')](_0x14e1bb[_0x62e5('0x38')]);_0x537f97[_0x62e5('0x3a')]=_[_0x62e5('0x3b')](_0x537f97[_0x62e5('0x37')],_0x537f97[_0x62e5('0x38')]);_0x22a74e['attributes']=_['intersection'](_0x537f97[_0x62e5('0x37')],qs[_0x62e5('0x3d')](_0x14e1bb['query'][_0x62e5('0x3d')]));_0x22a74e[_0x62e5('0x3c')]=_0x22a74e[_0x62e5('0x3c')][_0x62e5('0x3e')]?_0x22a74e['attributes']:_0x537f97[_0x62e5('0x37')];_0x22a74e[_0x62e5('0x41')]=qs[_0x62e5('0x42')](_0x14e1bb['query']['sort']);_0x22a74e['where']=qs[_0x62e5('0x3a')](_[_0x62e5('0x5c')](_0x14e1bb[_0x62e5('0x38')],_0x537f97[_0x62e5('0x3a')]));if(_0x14e1bb[_0x62e5('0x38')][_0x62e5('0x44')]){_0x22a74e[_0x62e5('0x43')]=_[_0x62e5('0x46')](_0x22a74e[_0x62e5('0x43')],{'$or':_[_0x62e5('0x31')](_0x22a74e['attributes'],function(_0x3cb6ec){var _0x16d118={};_0x16d118[_0x3cb6ec]={'$like':'%'+_0x14e1bb[_0x62e5('0x38')][_0x62e5('0x44')]+'%'};return _0x16d118;})});}_0x22a74e=_[_0x62e5('0x46')]({},_0x22a74e,_0x14e1bb[_0x62e5('0x47')]);return _0x3d7b4d[_0x62e5('0x124')](_0x22a74e);}})[_0x62e5('0x14')](function(_0x4a761e){if(_0x4a761e){_0x1cd0e0=_0x4a761e['length'];if(!_0x14e1bb['query']['hasOwnProperty']('nolimit')){_0x22a74e['limit']=qs['limit'](_0x14e1bb[_0x62e5('0x38')][_0x62e5('0x25')]);_0x22a74e[_0x62e5('0x23')]=qs['offset'](_0x14e1bb[_0x62e5('0x38')][_0x62e5('0x23')]);}return _0x3d7b4d[_0x62e5('0x124')](_0x22a74e);}})[_0x62e5('0x14')](function(_0x35fc93){if(_0x35fc93){return _0x35fc93?{'count':_0x1cd0e0,'rows':_0x35fc93}:null;}})[_0x62e5('0x14')](respondWithResult(_0x3e1045,null))['catch'](handleError(_0x3e1045,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 363aa02..db3ad90 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 _0x5645=['events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x26bd8e,_0x2a9fdf){var _0x3a659d=function(_0x1b82cd){while(--_0x1b82cd){_0x26bd8e['push'](_0x26bd8e['shift']());}};_0x3a659d(++_0x2a9fdf);}(_0x5645,0x19e));var _0x5564=function(_0x41833e,_0x1c2c4d){_0x41833e=_0x41833e-0x0;var _0x4d8c98=_0x5645[_0x41833e];return _0x4d8c98;};'use strict';var EventEmitter=require(_0x5564('0x0'));var ChatWebsite=require(_0x5564('0x1'))['db'][_0x5564('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5564('0x3')](0x0);var events={'afterCreate':_0x5564('0x4'),'afterUpdate':'update','afterDestroy':_0x5564('0x5')};function emitEvent(_0x64ae4d){return function(_0x1240cd,_0x821a1a,_0x24d3a0){ChatWebsiteEvents[_0x5564('0x6')](_0x64ae4d+':'+_0x1240cd['id'],_0x1240cd);ChatWebsiteEvents[_0x5564('0x6')](_0x64ae4d,_0x1240cd);_0x24d3a0(null);};}for(var e in events){if(events[_0x5564('0x7')](e)){var event=events[e];ChatWebsite[_0x5564('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xf822=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x118ebd,_0x336277){var _0xa21b14=function(_0x4acf8c){while(--_0x4acf8c){_0x118ebd['push'](_0x118ebd['shift']());}};_0xa21b14(++_0x336277);}(_0xf822,0x19e));var _0x2f82=function(_0x337b35,_0x462348){_0x337b35=_0x337b35-0x0;var _0x175c9d=_0xf822[_0x337b35];return _0x175c9d;};'use strict';var EventEmitter=require(_0x2f82('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x2f82('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2f82('0x2')](0x0);var events={'afterCreate':_0x2f82('0x3'),'afterUpdate':_0x2f82('0x4'),'afterDestroy':_0x2f82('0x5')};function emitEvent(_0x260206){return function(_0x48a05c,_0x12e2d7,_0xd4688e){ChatWebsiteEvents[_0x2f82('0x6')](_0x260206+':'+_0x48a05c['id'],_0x48a05c);ChatWebsiteEvents['emit'](_0x260206,_0x48a05c);_0xd4688e(null);};}for(var e in events){if(events[_0x2f82('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x2f82('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 36d2374..3dad375 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 _0x9a77=['chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x472772,_0x288297){var _0x14bbc9=function(_0xec6a61){while(--_0xec6a61){_0x472772['push'](_0x472772['shift']());}};_0x14bbc9(++_0x288297);}(_0x9a77,0x169));var _0x79a7=function(_0x219932,_0x1574d2){_0x219932=_0x219932-0x0;var _0x558c1b=_0x9a77[_0x219932];return _0x558c1b;};'use strict';var _=require(_0x79a7('0x0'));var util=require(_0x79a7('0x1'));var logger=require(_0x79a7('0x2'))(_0x79a7('0x3'));var moment=require('moment');var BPromise=require(_0x79a7('0x4'));var rp=require(_0x79a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a7('0x6'));var config=require('../../config/environment');var attributes=require(_0x79a7('0x7'));module[_0x79a7('0x8')]=function(_0x1f1f9b,_0x458acf){return _0x1f1f9b[_0x79a7('0x9')](_0x79a7('0xa'),attributes,{'tableName':_0x79a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaceb=['../../config/environment','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaceb,0x137));var _0xbace=function(_0x142f7f,_0x4dfb94){_0x142f7f=_0x142f7f-0x0;var _0x3cc8ed=_0xaceb[_0x142f7f];return _0x3cc8ed;};'use strict';var _=require(_0xbace('0x0'));var util=require(_0xbace('0x1'));var logger=require(_0xbace('0x2'))(_0xbace('0x3'));var moment=require(_0xbace('0x4'));var BPromise=require('bluebird');var rp=require(_0xbace('0x5'));var fs=require('fs');var path=require(_0xbace('0x6'));var rimraf=require(_0xbace('0x7'));var config=require(_0xbace('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x329dd8,_0x5b2774){return _0x329dd8['define'](_0xbace('0x9'),attributes,{'tableName':_0xbace('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 291accd..67145fc 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 _0xa9ac=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x6acc50,_0x42d623){var _0x286b94=function(_0x43a3dc){while(--_0x43a3dc){_0x6acc50['push'](_0x6acc50['shift']());}};_0x286b94(++_0x42d623);}(_0xa9ac,0x108));var _0xca9a=function(_0x3f0831,_0x50f8d2){_0x3f0831=_0x3f0831-0x0;var _0x11bd61=_0xa9ac[_0x3f0831];return _0x11bd61;};'use strict';var _=require(_0xca9a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca9a('0x1'));var rs=require(_0xca9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca9a('0x4'))(_0xca9a('0x5'));var config=require(_0xca9a('0x6'));var jayson=require(_0xca9a('0x7'));var client=jayson[_0xca9a('0x8')][_0xca9a('0x9')]({'port':0x232a});config[_0xca9a('0xa')]=_[_0xca9a('0xb')](config['redis'],{'host':_0xca9a('0xc'),'port':0x18eb});var socket=require(_0xca9a('0xd'))(new Redis(config[_0xca9a('0xa')]));require(_0xca9a('0xe'))[_0xca9a('0xf')](socket);function respondWithRpcPromise(_0xe3888b,_0x2db3ee,_0x1155e6){return new BPromise(function(_0x5a1b39,_0xd77acd){return client[_0xca9a('0x10')](_0xe3888b,_0x1155e6)[_0xca9a('0x11')](function(_0x28994f){logger[_0xca9a('0x12')](_0xca9a('0x13'),_0x2db3ee,_0xca9a('0x14'));logger[_0xca9a('0x15')](_0xca9a('0x16'),_0x2db3ee,_0xca9a('0x14'),JSON['stringify'](_0x28994f));if(_0x28994f['error']){if(_0x28994f['error'][_0xca9a('0x17')]===0x1f4){logger[_0xca9a('0x18')](_0xca9a('0x13'),_0x2db3ee,_0x28994f[_0xca9a('0x18')][_0xca9a('0x19')]);return _0xd77acd(_0x28994f[_0xca9a('0x18')][_0xca9a('0x19')]);}logger[_0xca9a('0x18')](_0xca9a('0x13'),_0x2db3ee,_0x28994f[_0xca9a('0x18')][_0xca9a('0x19')]);return _0x5a1b39(_0x28994f[_0xca9a('0x18')][_0xca9a('0x19')]);}else{logger['info'](_0xca9a('0x13'),_0x2db3ee,_0xca9a('0x14'));_0x5a1b39(_0x28994f['result']['message']);}})[_0xca9a('0x1a')](function(_0x2355b7){logger[_0xca9a('0x18')](_0xca9a('0x13'),_0x2db3ee,_0x2355b7);_0xd77acd(_0x2355b7);});});} \ No newline at end of file +var _0xbe8d=['message','result','catch','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbe8d,0xc3));var _0xdbe8=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0xbe8d[_0x4c7d8b];return _0x187158;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbe8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbe8('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbe8('0x2'))(_0xdbe8('0x3'));var config=require(_0xdbe8('0x4'));var jayson=require(_0xdbe8('0x5'));var client=jayson['client'][_0xdbe8('0x6')]({'port':0x232a});config['redis']=_[_0xdbe8('0x7')](config[_0xdbe8('0x8')],{'host':_0xdbe8('0x9'),'port':0x18eb});var socket=require(_0xdbe8('0xa'))(new Redis(config[_0xdbe8('0x8')]));require(_0xdbe8('0xb'))[_0xdbe8('0xc')](socket);function respondWithRpcPromise(_0x31ac8f,_0x33f2c8,_0x1c4ae7){return new BPromise(function(_0x513f20,_0x1b0402){return client[_0xdbe8('0xd')](_0x31ac8f,_0x1c4ae7)['then'](function(_0x211dba){logger[_0xdbe8('0xe')](_0xdbe8('0xf'),_0x33f2c8,_0xdbe8('0x10'));logger['debug'](_0xdbe8('0x11'),_0x33f2c8,_0xdbe8('0x10'),JSON[_0xdbe8('0x12')](_0x211dba));if(_0x211dba[_0xdbe8('0x13')]){if(_0x211dba[_0xdbe8('0x13')][_0xdbe8('0x14')]===0x1f4){logger[_0xdbe8('0x13')](_0xdbe8('0xf'),_0x33f2c8,_0x211dba[_0xdbe8('0x13')][_0xdbe8('0x15')]);return _0x1b0402(_0x211dba[_0xdbe8('0x13')][_0xdbe8('0x15')]);}logger[_0xdbe8('0x13')](_0xdbe8('0xf'),_0x33f2c8,_0x211dba[_0xdbe8('0x13')][_0xdbe8('0x15')]);return _0x513f20(_0x211dba[_0xdbe8('0x13')]['message']);}else{logger['info'](_0xdbe8('0xf'),_0x33f2c8,_0xdbe8('0x10'));_0x513f20(_0x211dba[_0xdbe8('0x16')][_0xdbe8('0x15')]);}})[_0xdbe8('0x17')](function(_0x2d456b){logger[_0xdbe8('0x13')](_0xdbe8('0xf'),_0x33f2c8,_0x2d456b);_0x1b0402(_0x2d456b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 24e3888..e8fdea3 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 _0x10b2=['register','length','save','remove','update','emit','removeListener'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x10b2,0xdb));var _0x210b=function(_0x4fbb0c,_0x3bce16){_0x4fbb0c=_0x4fbb0c-0x0;var _0x4a616f=_0x10b2[_0x4fbb0c];return _0x4a616f;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x210b('0x0'),_0x210b('0x1'),_0x210b('0x2')];function createListener(_0x2c200b,_0x613830){return function(_0x275a4f){_0x613830[_0x210b('0x3')](_0x2c200b,_0x275a4f);};}function removeListener(_0x90968c,_0xf9939f){return function(){ChatWebsiteEvents[_0x210b('0x4')](_0x90968c,_0xf9939f);};}exports[_0x210b('0x5')]=function(_0x3e8fae){for(var _0xd7c2b0=0x0,_0x19cd5d=events[_0x210b('0x6')];_0xd7c2b0<_0x19cd5d;_0xd7c2b0++){var _0x2c1bb2=events[_0xd7c2b0];var _0x195ea2=createListener('chatWebsite:'+_0x2c1bb2,_0x3e8fae);ChatWebsiteEvents['on'](_0x2c1bb2,_0x195ea2);}}; \ No newline at end of file +var _0xd013=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','register'];(function(_0x10b4d3,_0x12e69b){var _0x12615b=function(_0x36eb54){while(--_0x36eb54){_0x10b4d3['push'](_0x10b4d3['shift']());}};_0x12615b(++_0x12e69b);}(_0xd013,0x132));var _0x3d01=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xd013[_0x110c3d];return _0x226d67;};'use strict';var ChatWebsiteEvents=require(_0x3d01('0x0'));var events=[_0x3d01('0x1'),_0x3d01('0x2'),_0x3d01('0x3')];function createListener(_0x133aef,_0x2418ae){return function(_0x2458e9){_0x2418ae[_0x3d01('0x4')](_0x133aef,_0x2458e9);};}function removeListener(_0x163035,_0x27c14c){return function(){ChatWebsiteEvents['removeListener'](_0x163035,_0x27c14c);};}exports[_0x3d01('0x5')]=function(_0x3da28c){for(var _0x5872b4=0x0,_0x5bc1d2=events[_0x3d01('0x6')];_0x5872b4<_0x5bc1d2;_0x5872b4++){var _0x5b622a=events[_0x5872b4];var _0x976bb=createListener(_0x3d01('0x7')+_0x5b622a,_0x3da28c);ChatWebsiteEvents['on'](_0x5b622a,_0x976bb);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 4736596..4a52398 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 _0x2114=['addInteraction','addProactiveActions','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','single','file','addLogo','server/files/images/avatars/','%s-%s','now','originalname','addAvatar','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','/:id/offline','any','offline','/:id/interactions'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x2114,0x171));var _0x4211=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2114[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x4211('0x0'));var util=require('util');var path=require(_0x4211('0x1'));var timeout=require(_0x4211('0x2'));var express=require(_0x4211('0x3'));var router=express[_0x4211('0x4')]();var fs_extra=require(_0x4211('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4211('0x6'));var config=require('../../config/environment');var controller=require(_0x4211('0x7'));router[_0x4211('0x8')]('/',auth[_0x4211('0x9')](),controller[_0x4211('0xa')]);router[_0x4211('0x8')](_0x4211('0xb'),auth['isAuthenticated'](),controller[_0x4211('0xc')]);router[_0x4211('0x8')](_0x4211('0xd'),auth['isAuthenticated'](),controller[_0x4211('0xe')]);router[_0x4211('0x8')](_0x4211('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x4211('0x9')](),controller[_0x4211('0x10')]);router[_0x4211('0x8')](_0x4211('0x11'),controller[_0x4211('0x12')]);router[_0x4211('0x8')](_0x4211('0x13'),controller['getAvatar']);router[_0x4211('0x8')](_0x4211('0x14'),controller[_0x4211('0x15')]);router['get'](_0x4211('0x16'),controller[_0x4211('0x17')]);router[_0x4211('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x4211('0x18')]);router[_0x4211('0x8')]('/:id/snippet',controller['getSnippet']);router['get'](_0x4211('0x19'),auth['isAuthenticated'](),controller[_0x4211('0x1a')]);router['get'](_0x4211('0x1b'),auth[_0x4211('0x9')](),controller[_0x4211('0x1c')]);router['get']('/:id/fields',controller['getFields']);router['get'](_0x4211('0x1d'),auth['isAuthenticated'](),controller[_0x4211('0x1e')]);router[_0x4211('0x8')](_0x4211('0x1f'),auth[_0x4211('0x9')](),controller[_0x4211('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4211('0x21')]);router[_0x4211('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4211('0x23')]);router[_0x4211('0x22')](_0x4211('0x24'),auth[_0x4211('0x9')](),controller[_0x4211('0x25')]);var upload=multer({'storage':multer[_0x4211('0x26')]({'destination':function(_0x4d78a3,_0x5db6dd,_0x5b5160){_0x5b5160(null,path[_0x4211('0x27')](config[_0x4211('0x28')],_0x4211('0x29')));},'filename':function(_0x152b4a,_0x26e604,_0x4e9261){_0x4e9261(null,util['format']('%s-%s',Date['now'](),_0x26e604['originalname']));}})});router[_0x4211('0x22')](_0x4211('0x11'),upload[_0x4211('0x2a')](_0x4211('0x2b')),controller[_0x4211('0x2c')]);var upload=multer({'storage':multer[_0x4211('0x26')]({'destination':function(_0x350d06,_0x3ba664,_0xc04370){_0xc04370(null,path[_0x4211('0x27')](config[_0x4211('0x28')],_0x4211('0x2d')));},'filename':function(_0xe4070d,_0x3b381b,_0x4221f0){_0x4221f0(null,util['format'](_0x4211('0x2e'),Date[_0x4211('0x2f')](),_0x3b381b[_0x4211('0x30')]));}})});router['post'](_0x4211('0x13'),upload['single']('file'),controller[_0x4211('0x31')]);var upload=multer({'storage':multer[_0x4211('0x26')]({'destination':function(_0x1c835e,_0x50ae64,_0x5e1899){_0x5e1899(null,path['join'](config[_0x4211('0x28')],_0x4211('0x2d')));},'filename':function(_0x434242,_0x5a5e18,_0x214539){_0x214539(null,util[_0x4211('0x32')](_0x4211('0x2e'),Date[_0x4211('0x2f')](),_0x5a5e18['originalname']));}})});router[_0x4211('0x22')](_0x4211('0x14'),upload[_0x4211('0x2a')](_0x4211('0x2b')),controller[_0x4211('0x33')]);var upload=multer({'storage':multer[_0x4211('0x26')]({'destination':function(_0x114ad4,_0x51ed07,_0x4f8b22){_0x4f8b22(null,path[_0x4211('0x27')](config['root'],_0x4211('0x2d')));},'filename':function(_0x212077,_0x2f029a,_0x2d4cd0){_0x2d4cd0(null,util['format'](_0x4211('0x2e'),Date[_0x4211('0x2f')](),_0x2f029a[_0x4211('0x30')]));}})});router[_0x4211('0x22')](_0x4211('0x16'),upload[_0x4211('0x2a')]('file'),controller[_0x4211('0x34')]);router[_0x4211('0x22')](_0x4211('0x35'),controller[_0x4211('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x4211('0x26')]({'destination':function(_0x2e367f,_0x4c8b7b,_0x112d3e){const _0xf6d637=path[_0x4211('0x27')](config[_0x4211('0x28')],_0x4211('0x37'),_0x4211('0x38'),_0x4211('0x39'));fs_extra['ensureDir'](_0xf6d637,function(){_0x112d3e(null,_0xf6d637);});},'filename':function(_0x205185,_0x3ece42,_0x3cda43){const _0x42a5ee=_0x3ece42[_0x4211('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8b09cf=path[_0x4211('0x3a')](_0x42a5ee);const _0x1b244e=Date['now']()+'-'+_0x42a5ee['replace'](_0x8b09cf,'')+_0x8b09cf;_0x3cda43(null,_0x1b244e);}})});router[_0x4211('0x22')](_0x4211('0x3b'),offlineUploadMulter[_0x4211('0x3c')](),controller[_0x4211('0x3d')]);router[_0x4211('0x22')](_0x4211('0x3e'),auth[_0x4211('0x9')](),controller[_0x4211('0x3f')]);router['post'](_0x4211('0x19'),auth[_0x4211('0x9')](),controller['addApplications']);router[_0x4211('0x22')](_0x4211('0x1b'),auth[_0x4211('0x9')](),controller[_0x4211('0x40')]);router[_0x4211('0x22')]('/:id/users',auth[_0x4211('0x9')](),controller['addAgents']);router[_0x4211('0x41')](_0x4211('0xd'),auth[_0x4211('0x9')](),controller[_0x4211('0x42')]);router[_0x4211('0x43')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x4211('0xf'),auth[_0x4211('0x9')](),controller[_0x4211('0x44')]);router[_0x4211('0x43')](_0x4211('0x24'),auth[_0x4211('0x9')](),controller[_0x4211('0x45')]);router[_0x4211('0x43')](_0x4211('0x1f'),auth[_0x4211('0x9')](),controller[_0x4211('0x46')]);module[_0x4211('0x47')]=router; \ No newline at end of file +var _0x01af=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','addLogo','server/files/images/avatars/','/:id/avatar','file','addAvatar','now','single','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','any','addInteraction','/:id/applications','addProactiveActions','put','update','destroy','delete','removeDispositions','/:id/users','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x17e88d,_0x5330f7){var _0x52137a=function(_0x250385){while(--_0x250385){_0x17e88d['push'](_0x17e88d['shift']());}};_0x52137a(++_0x5330f7);}(_0x01af,0xcc));var _0xf01a=function(_0x213d25,_0x25b8ab){_0x213d25=_0x213d25-0x0;var _0xebc989=_0x01af[_0x213d25];return _0xebc989;};'use strict';var multer=require(_0xf01a('0x0'));var util=require(_0xf01a('0x1'));var path=require(_0xf01a('0x2'));var timeout=require(_0xf01a('0x3'));var express=require(_0xf01a('0x4'));var router=express['Router']();var fs_extra=require(_0xf01a('0x5'));var auth=require(_0xf01a('0x6'));var interaction=require(_0xf01a('0x7'));var config=require(_0xf01a('0x8'));var controller=require(_0xf01a('0x9'));router[_0xf01a('0xa')]('/',auth[_0xf01a('0xb')](),controller[_0xf01a('0xc')]);router['get'](_0xf01a('0xd'),auth[_0xf01a('0xb')](),controller[_0xf01a('0xe')]);router[_0xf01a('0xa')](_0xf01a('0xf'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x10')]);router[_0xf01a('0xa')](_0xf01a('0x11'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x12')]);router[_0xf01a('0xa')](_0xf01a('0x13'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x14')]);router['get'](_0xf01a('0x15'),controller['getLogo']);router['get']('/:id/avatar',controller['getAvatar']);router[_0xf01a('0xa')](_0xf01a('0x16'),controller[_0xf01a('0x17')]);router[_0xf01a('0xa')]('/:id/system_avatar',controller[_0xf01a('0x18')]);router['get'](_0xf01a('0x19'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x1a')]);router[_0xf01a('0xa')]('/:id/snippet',controller[_0xf01a('0x1b')]);router[_0xf01a('0xa')]('/:id/applications',auth[_0xf01a('0xb')](),controller['getApplications']);router[_0xf01a('0xa')](_0xf01a('0x1c'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x1d')]);router['get'](_0xf01a('0x1e'),controller['getFields']);router[_0xf01a('0xa')](_0xf01a('0x1f'),auth[_0xf01a('0xb')](),controller['getOfflineMessages']);router[_0xf01a('0xa')]('/:id/users',auth[_0xf01a('0xb')](),controller[_0xf01a('0x20')]);router[_0xf01a('0x21')]('/',auth[_0xf01a('0xb')](),controller[_0xf01a('0x22')]);router[_0xf01a('0x21')](_0xf01a('0x11'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x23')]);router[_0xf01a('0x21')](_0xf01a('0x13'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x24')]);var upload=multer({'storage':multer[_0xf01a('0x25')]({'destination':function(_0x814aa6,_0x3e2292,_0x3153c9){_0x3153c9(null,path[_0xf01a('0x26')](config[_0xf01a('0x27')],_0xf01a('0x28')));},'filename':function(_0x274b16,_0x28087c,_0x17f5c5){_0x17f5c5(null,util[_0xf01a('0x29')](_0xf01a('0x2a'),Date['now'](),_0x28087c[_0xf01a('0x2b')]));}})});router[_0xf01a('0x21')](_0xf01a('0x15'),upload['single']('file'),controller[_0xf01a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x70019a,_0x2e8024,_0x3a21c1){_0x3a21c1(null,path[_0xf01a('0x26')](config[_0xf01a('0x27')],_0xf01a('0x2d')));},'filename':function(_0x3c81d0,_0x398307,_0x2242f0){_0x2242f0(null,util[_0xf01a('0x29')](_0xf01a('0x2a'),Date['now'](),_0x398307['originalname']));}})});router[_0xf01a('0x21')](_0xf01a('0x2e'),upload['single'](_0xf01a('0x2f')),controller[_0xf01a('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3cf6b1,_0xfdf0df,_0x583664){_0x583664(null,path[_0xf01a('0x26')](config[_0xf01a('0x27')],_0xf01a('0x2d')));},'filename':function(_0x5a9955,_0x319581,_0x11af3f){_0x11af3f(null,util['format'](_0xf01a('0x2a'),Date[_0xf01a('0x31')](),_0x319581[_0xf01a('0x2b')]));}})});router[_0xf01a('0x21')](_0xf01a('0x16'),upload[_0xf01a('0x32')](_0xf01a('0x2f')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xf01a('0x25')]({'destination':function(_0x3ba483,_0x1e9136,_0x2339c3){_0x2339c3(null,path[_0xf01a('0x26')](config[_0xf01a('0x27')],_0xf01a('0x2d')));},'filename':function(_0x43a06e,_0x8560ef,_0x5047f1){_0x5047f1(null,util[_0xf01a('0x29')](_0xf01a('0x2a'),Date['now'](),_0x8560ef['originalname']));}})});router['post'](_0xf01a('0x33'),upload[_0xf01a('0x32')](_0xf01a('0x2f')),controller[_0xf01a('0x34')]);router['post'](_0xf01a('0x35'),controller[_0xf01a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xf01a('0x25')]({'destination':function(_0xa81cb9,_0x763895,_0x1cc4d8){const _0x559d2f=path[_0xf01a('0x26')](config[_0xf01a('0x27')],_0xf01a('0x37'),_0xf01a('0x38'),'offline-chat');fs_extra[_0xf01a('0x39')](_0x559d2f,function(){_0x1cc4d8(null,_0x559d2f);});},'filename':function(_0x2cf8df,_0xbcd55f,_0xef4b3){const _0x4613fd=_0xbcd55f['originalname'][_0xf01a('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6db998=path['extname'](_0x4613fd);const _0x3a090f=Date[_0xf01a('0x31')]()+'-'+_0x4613fd[_0xf01a('0x3a')](_0x6db998,'')+_0x6db998;_0xef4b3(null,_0x3a090f);}})});router[_0xf01a('0x21')]('/:id/offline',offlineUploadMulter[_0xf01a('0x3b')](),controller['offline']);router[_0xf01a('0x21')]('/:id/interactions',auth[_0xf01a('0xb')](),controller[_0xf01a('0x3c')]);router['post'](_0xf01a('0x3d'),auth['isAuthenticated'](),controller['addApplications']);router[_0xf01a('0x21')](_0xf01a('0x1c'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x3e')]);router[_0xf01a('0x21')]('/:id/users',auth[_0xf01a('0xb')](),controller['addAgents']);router[_0xf01a('0x3f')](_0xf01a('0xf'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x40')]);router['delete'](_0xf01a('0xf'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x41')]);router[_0xf01a('0x42')](_0xf01a('0x11'),auth[_0xf01a('0xb')](),controller[_0xf01a('0x43')]);router['delete']('/:id/canned_answers',auth[_0xf01a('0xb')](),controller['removeAnswers']);router[_0xf01a('0x42')](_0xf01a('0x44'),auth[_0xf01a('0xb')](),controller['removeAgents']);module[_0xf01a('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 30c6cef..d40e92a 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x163c=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','app','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x733cc0,_0x3cae70){var _0x6ec0cd=function(_0x36cb1a){while(--_0x36cb1a){_0x733cc0['push'](_0x733cc0['shift']());}};_0x6ec0cd(++_0x3cae70);}(_0x163c,0x128));var _0xc163=function(_0x4b2d84,_0x399e3c){_0x4b2d84=_0x4b2d84-0x0;var _0x23d1bc=_0x163c[_0x4b2d84];return _0x23d1bc;};var beaverLogger=require(_0xc163('0x0'));var express=require(_0xc163('0x1'));var auth=require(_0xc163('0x2'));var config=require(_0xc163('0x3'));var router=express[_0xc163('0x4')]();var isProduction=config[_0xc163('0x5')]==='production'||![];function clientSideLogs(_0xdda025,_0x74d4f9,_0x170395){var _0x134f9e=_0xdda025[_0xc163('0x6')][_0xc163('0x7')]('client-side-logger');if(!_0x134f9e){throw new Error(_0xc163('0x8'));}return beaverLogger[_0xc163('0x9')]({'uri':_0xc163('0xa'),'logger':_0x134f9e,'enableCors':!isProduction})(_0xdda025,_0x74d4f9,_0x170395);}router[_0xc163('0xb')](auth[_0xc163('0xc')](),clientSideLogs);module[_0xc163('0xd')]=router; \ No newline at end of file +var _0xdd18=['get','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','app'];(function(_0x181cc8,_0x2dd891){var _0x41a5fc=function(_0x42fc1a){while(--_0x42fc1a){_0x181cc8['push'](_0x181cc8['shift']());}};_0x41a5fc(++_0x2dd891);}(_0xdd18,0x10d));var _0x8dd1=function(_0x12a5c7,_0x5b43ff){_0x12a5c7=_0x12a5c7-0x0;var _0x2b07bf=_0xdd18[_0x12a5c7];return _0x2b07bf;};var beaverLogger=require('beaver-logger/server');var express=require(_0x8dd1('0x0'));var auth=require(_0x8dd1('0x1'));var config=require(_0x8dd1('0x2'));var router=express[_0x8dd1('0x3')]();var isProduction=config[_0x8dd1('0x4')]==='production'||![];function clientSideLogs(_0x3c0f77,_0x4e75e6,_0x5a50d1){var _0x1ce4b1=_0x3c0f77[_0x8dd1('0x5')][_0x8dd1('0x6')]('client-side-logger');if(!_0x1ce4b1){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x8dd1('0x7')]({'uri':_0x8dd1('0x8'),'logger':_0x1ce4b1,'enableCors':!isProduction})(_0x3c0f77,_0x4e75e6,_0x5a50d1);}router['use'](auth[_0x8dd1('0x9')](),clientSideLogs);module[_0x8dd1('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index ba94526..346b523 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 _0xbfd9=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x1c44aa,_0xb777a4){var _0xca8651=function(_0x20ff4a){while(--_0x20ff4a){_0x1c44aa['push'](_0x1c44aa['shift']());}};_0xca8651(++_0xb777a4);}(_0xbfd9,0xf1));var _0x9bfd=function(_0x2fd2cb,_0x437c0){_0x2fd2cb=_0x2fd2cb-0x0;var _0x3fc2b9=_0xbfd9[_0x2fd2cb];return _0x3fc2b9;};'use strict';var Sequelize=require(_0x9bfd('0x0'));module[_0x9bfd('0x1')]={'name':{'type':Sequelize[_0x9bfd('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9bfd('0x3')](_0x9bfd('0x4'),_0x9bfd('0x5'),_0x9bfd('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9bfd('0x3')](_0x9bfd('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x9bfd('0x2')],'comment':_0x9bfd('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x9bfd('0x2')],'comment':_0x9bfd('0x9')},'data4':{'type':Sequelize[_0x9bfd('0x2')],'comment':_0x9bfd('0xa')},'data5':{'type':Sequelize[_0x9bfd('0xb')],'comment':_0x9bfd('0xc')},'data6':{'type':Sequelize[_0x9bfd('0xb')],'comment':_0x9bfd('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x9bfd('0xe')}}; \ No newline at end of file +var _0x88af=['STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x3cf61b,_0x150a07){var _0x1f7aee=function(_0x4f7f1c){while(--_0x4f7f1c){_0x3cf61b['push'](_0x3cf61b['shift']());}};_0x1f7aee(++_0x150a07);}(_0x88af,0xdf));var _0xf88a=function(_0x1af482,_0x1af5b7){_0x1af482=_0x1af482-0x0;var _0x7e7580=_0x88af[_0x1af482];return _0x7e7580;};'use strict';var Sequelize=require('sequelize');module[_0xf88a('0x0')]={'name':{'type':Sequelize[_0xf88a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf88a('0x2'),_0xf88a('0x3'),_0xf88a('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf88a('0x5')]('Outlook365',_0xf88a('0x6'))},'data1':{'type':Sequelize[_0xf88a('0x1')],'comment':_0xf88a('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0xf88a('0x8')},'data3':{'type':Sequelize[_0xf88a('0x1')],'comment':_0xf88a('0x9')},'data4':{'type':Sequelize[_0xf88a('0x1')],'comment':_0xf88a('0xa')},'data5':{'type':Sequelize[_0xf88a('0xb')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xf88a('0xb')],'comment':_0xf88a('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0xf88a('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9a29dc0..b01735f 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 _0x5526=['map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','length','include','body','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','find','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','parse','from','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','slice','index','CloudProvider','rawAttributes','fieldName','type','key','model'];(function(_0x5e913f,_0x265fc0){var _0x472cc4=function(_0x49df8d){while(--_0x49df8d){_0x5e913f['push'](_0x5e913f['shift']());}};_0x472cc4(++_0x265fc0);}(_0x5526,0xfa));var _0x6552=function(_0xd07e81,_0x1ccacd){_0xd07e81=_0xd07e81-0x0;var _0x379364=_0x5526[_0xd07e81];return _0x379364;};'use strict';var _=require(_0x6552('0x0'));var Redis=require('ioredis');var qs=require(_0x6552('0x1'));var encryptor=require(_0x6552('0x2'));var config=require(_0x6552('0x3'));var logger=require(_0x6552('0x4'))(_0x6552('0x5'));var db=require(_0x6552('0x6'))['db'];var oauth=require(_0x6552('0x7'));config['redis']=_[_0x6552('0x8')](config[_0x6552('0x9')],{'host':_0x6552('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x6552('0x9')]);function respondWithStatusCode(_0x32a51b,_0x192f4c){_0x192f4c=_0x192f4c||0xcc;return function(_0x16b42f){if(_0x16b42f){return _0x32a51b[_0x6552('0xb')](_0x192f4c);}return _0x32a51b[_0x6552('0xc')](_0x192f4c)[_0x6552('0xd')]();};}function respondWithResult(_0x50eac2,_0x4dac8d){_0x4dac8d=_0x4dac8d||0xc8;return function(_0x5506a9){if(_0x5506a9){return _0x50eac2[_0x6552('0xc')](_0x4dac8d)[_0x6552('0xe')](_0x5506a9);}};}function respondWithFilteredResult(_0x49830d,_0x3dc0ab){return function(_0x230c87){if(_0x230c87){var _0x3b39fd=typeof _0x3dc0ab[_0x6552('0xf')]===_0x6552('0x10')&&typeof _0x3dc0ab[_0x6552('0x11')]===_0x6552('0x10');var _0x41bbc9=_0x230c87[_0x6552('0x12')];var _0x461b81=_0x3b39fd?0x0:_0x3dc0ab[_0x6552('0xf')];var _0x30089f=_0x3b39fd?_0x230c87[_0x6552('0x12')]:_0x3dc0ab['offset']+_0x3dc0ab[_0x6552('0x11')];var _0x4a6ef8;if(_0x30089f>=_0x41bbc9){_0x30089f=_0x41bbc9;_0x4a6ef8=0xc8;}else{_0x4a6ef8=0xce;}_0x49830d[_0x6552('0xc')](_0x4a6ef8);return _0x49830d[_0x6552('0x13')](_0x6552('0x14'),_0x461b81+'-'+_0x30089f+'/'+_0x41bbc9)[_0x6552('0xe')](_0x230c87);}return null;};}function saveUpdates(_0x5c5543){return function(_0x47cb7e){if(_0x47cb7e){return _0x47cb7e[_0x6552('0x15')](_0x5c5543)[_0x6552('0x16')](function(_0x17cbea){return _0x17cbea;});}return null;};}function removeEntity(_0x35e357){return function(_0x9c7a3b){if(_0x9c7a3b){return _0x9c7a3b[_0x6552('0x17')]()[_0x6552('0x16')](function(){_0x35e357[_0x6552('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d2c8){return function(_0x26b3b2){if(!_0x26b3b2){_0x51d2c8[_0x6552('0xb')](0x194);}return _0x26b3b2;};}function handleError(_0x5577dc,_0x171ba3){_0x171ba3=_0x171ba3||0x1f4;return function(_0x10c80d){logger[_0x6552('0x18')](_0x10c80d[_0x6552('0x19')]);if(_0x10c80d['name']){delete _0x10c80d[_0x6552('0x1a')];}_0x5577dc[_0x6552('0xc')](_0x171ba3)['send'](_0x10c80d);};}function maskClientSecret(_0x387430){return _['padEnd'](_0x387430[_0x6552('0x1b')](0x0,0x3),0x14,'*');}exports[_0x6552('0x1c')]=function(_0x3804e5,_0x42c55){var _0x1c9761={},_0x1444ce={},_0x390155={'count':0x0,'rows':[]};var _0x481e61=_['map'](db[_0x6552('0x1d')][_0x6552('0x1e')],function(_0x54526b){return{'name':_0x54526b[_0x6552('0x1f')],'type':_0x54526b[_0x6552('0x20')][_0x6552('0x21')]};});_0x1444ce[_0x6552('0x22')]=_[_0x6552('0x23')](_0x481e61,_0x6552('0x1a'));_0x1444ce[_0x6552('0x24')]=_[_0x6552('0x25')](_0x3804e5[_0x6552('0x24')]);_0x1444ce['filters']=_[_0x6552('0x26')](_0x1444ce['model'],_0x1444ce['query']);_0x1c9761[_0x6552('0x27')]=_[_0x6552('0x26')](_0x1444ce['model'],qs[_0x6552('0x28')](_0x3804e5[_0x6552('0x24')][_0x6552('0x28')]));_0x1c9761[_0x6552('0x27')]=_0x1c9761[_0x6552('0x27')]['length']?_0x1c9761[_0x6552('0x27')]:_0x1444ce[_0x6552('0x22')];if(!_0x3804e5['query'][_0x6552('0x29')](_0x6552('0x2a'))){_0x1c9761['limit']=qs['limit'](_0x3804e5[_0x6552('0x24')][_0x6552('0x11')]);_0x1c9761[_0x6552('0xf')]=qs[_0x6552('0xf')](_0x3804e5[_0x6552('0x24')][_0x6552('0xf')]);}_0x1c9761[_0x6552('0x2b')]=qs['sort'](_0x3804e5[_0x6552('0x24')][_0x6552('0x2c')]);_0x1c9761[_0x6552('0x2d')]=qs[_0x6552('0x2e')](_[_0x6552('0x2f')](_0x3804e5['query'],_0x1444ce[_0x6552('0x2e')]),_0x481e61);if(_0x3804e5[_0x6552('0x24')]['filter']){_0x1c9761[_0x6552('0x2d')]=_['merge'](_0x1c9761[_0x6552('0x2d')],{'$or':_[_0x6552('0x23')](_0x481e61,function(_0x44d2cf){if(_0x44d2cf[_0x6552('0x20')]!==_0x6552('0x30')){var _0x3c50c1={};_0x3c50c1[_0x44d2cf[_0x6552('0x1a')]]={'$like':'%'+_0x3804e5[_0x6552('0x24')][_0x6552('0x31')]+'%'};return _0x3c50c1;}})});}_0x1c9761=_[_0x6552('0x32')]({},_0x1c9761,_0x3804e5[_0x6552('0x33')]);var _0x5386ba={'where':_0x1c9761[_0x6552('0x2d')]};return db[_0x6552('0x1d')][_0x6552('0x12')](_0x5386ba)['then'](function(_0x4564d8){_0x390155[_0x6552('0x12')]=_0x4564d8;if(_0x3804e5[_0x6552('0x24')][_0x6552('0x34')]){_0x1c9761['include']=[{'all':!![]}];}return db[_0x6552('0x1d')]['findAll'](_0x1c9761);})['then'](function(_0x431bde){_0x390155[_0x6552('0x35')]=_[_0x6552('0x23')](_0x431bde,function(_0x5c3fc6){if(_0x5c3fc6[_0x6552('0x36')]===_0x6552('0x37')){var _0x2bcea6=encryptor[_0x6552('0x38')](_0x5c3fc6[_0x6552('0x39')]);_0x5c3fc6['data3']=maskClientSecret(_0x2bcea6);}return _0x5c3fc6;});return _0x390155;})['then'](respondWithFilteredResult(_0x42c55,_0x1c9761))[_0x6552('0x3a')](handleError(_0x42c55,null));};exports[_0x6552('0x3b')]=function(_0x925a13,_0x49d477){var _0x4a773f={'raw':!![],'where':{'id':_0x925a13[_0x6552('0x3c')]['id']}},_0x305b37={};_0x305b37[_0x6552('0x22')]=_[_0x6552('0x25')](db[_0x6552('0x1d')][_0x6552('0x1e')]);_0x305b37[_0x6552('0x24')]=_[_0x6552('0x25')](_0x925a13[_0x6552('0x24')]);_0x305b37['filters']=_[_0x6552('0x26')](_0x305b37[_0x6552('0x22')],_0x305b37[_0x6552('0x24')]);_0x4a773f[_0x6552('0x27')]=_[_0x6552('0x26')](_0x305b37['model'],qs[_0x6552('0x28')](_0x925a13['query']['fields']));_0x4a773f[_0x6552('0x27')]=_0x4a773f[_0x6552('0x27')][_0x6552('0x3d')]?_0x4a773f[_0x6552('0x27')]:_0x305b37[_0x6552('0x22')];if(_0x925a13[_0x6552('0x24')][_0x6552('0x34')]){_0x4a773f[_0x6552('0x3e')]=[{'all':!![]}];}_0x4a773f=_[_0x6552('0x32')]({},_0x4a773f,_0x925a13[_0x6552('0x33')]);return db['CloudProvider']['find'](_0x4a773f)['then'](handleEntityNotFound(_0x49d477,null))[_0x6552('0x16')](function(_0x1aeb7a){if(_0x1aeb7a[_0x6552('0x36')]===_0x6552('0x37')){var _0x4dd995=encryptor[_0x6552('0x38')](_0x1aeb7a[_0x6552('0x39')]);_0x1aeb7a['data3']=maskClientSecret(_0x4dd995);}return _0x1aeb7a;})[_0x6552('0x16')](respondWithResult(_0x49d477,null))[_0x6552('0x3a')](handleError(_0x49d477,null));};exports['create']=function(_0x4014a9,_0x2d3aae){if(!_0x4014a9[_0x6552('0x3f')][_0x6552('0x1a')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4014a9[_0x6552('0x3f')][_0x6552('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x1480d3=db[_0x6552('0x1d')][_0x6552('0x1e')][_0x6552('0x36')]['values'];if(!_0x1480d3[_0x6552('0x40')](_0x4014a9[_0x6552('0x3f')][_0x6552('0x36')]))throw new Error(_0x6552('0x41')+_0x1480d3[_0x6552('0x42')](',\x20'));if(_0x4014a9['body'][_0x6552('0x36')]==='MicrosoftAzure'&&_0x4014a9[_0x6552('0x3f')][_0x6552('0x39')]){_0x4014a9['body'][_0x6552('0x39')]=encryptor['encryptString'](_0x4014a9[_0x6552('0x3f')]['data3']);}return db[_0x6552('0x1d')]['create'](_0x4014a9[_0x6552('0x3f')],{})[_0x6552('0x16')](respondWithResult(_0x2d3aae,0xc9))[_0x6552('0x3a')](handleError(_0x2d3aae,null));};exports['update']=function(_0x445660,_0x3a1482){if(_0x445660[_0x6552('0x3f')]['id']){delete _0x445660[_0x6552('0x3f')]['id'];}return db[_0x6552('0x1d')][_0x6552('0x43')]({'where':{'id':_0x445660[_0x6552('0x3c')]['id']}})[_0x6552('0x16')](handleEntityNotFound(_0x3a1482,null))[_0x6552('0x16')](function(_0x563553){if(_0x563553[_0x6552('0x36')]===_0x6552('0x37')&&_0x445660['body'][_0x6552('0x39')]){_0x445660['body'][_0x6552('0x39')]=encryptor['encryptString'](_0x445660['body'][_0x6552('0x39')]);}return _0x563553;})['then'](saveUpdates(_0x445660[_0x6552('0x3f')],null))[_0x6552('0x16')](respondWithResult(_0x3a1482,null))[_0x6552('0x3a')](handleError(_0x3a1482,null));};exports[_0x6552('0x17')]=function(_0x191774,_0x5c6c64){return db[_0x6552('0x1d')][_0x6552('0x43')]({'where':{'id':_0x191774[_0x6552('0x3c')]['id']}})[_0x6552('0x16')](handleEntityNotFound(_0x5c6c64,null))[_0x6552('0x16')](removeEntity(_0x5c6c64,null))[_0x6552('0x3a')](handleError(_0x5c6c64,null));};exports[_0x6552('0x44')]=function(_0x85bc55,_0x30f5f0){return db[_0x6552('0x1d')][_0x6552('0x45')]({'where':{'id':_0x85bc55['params']['id']},'raw':!![]})[_0x6552('0x16')](function(_0x3dedfa){if(!_0x3dedfa)return _0x30f5f0['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3dedfa,_0x85bc55[_0x6552('0x46')]['id'])};})[_0x6552('0x16')](respondWithResult(_0x30f5f0,null))[_0x6552('0x3a')](handleError(_0x30f5f0,null));};exports[_0x6552('0x47')]=function(_0x210df3,_0x2f2931){var _0x371ad4=_0x210df3['body'];var _0x34642a;var _0x526a71;if(_0x371ad4[_0x6552('0x18')])throw _0x371ad4;redis[_0x6552('0x48')](_0x371ad4[_0x6552('0x49')])['then'](function(_0x79ca6c){if(!_0x79ca6c)throw new Error('Invalid\x20state\x20parameter');_0x34642a=JSON[_0x6552('0x4a')](_0x79ca6c);var _0x2a15ed=Buffer[_0x6552('0x4b')](_0x371ad4[_0x6552('0x49')],'base64')[_0x6552('0x4c')](_0x6552('0x4d'));_0x526a71=JSON['parse'](_0x2a15ed);if(!oauth[_0x6552('0x4e')](_0x371ad4['id_token'],_0x34642a[_0x6552('0x4f')]))throw new Error(_0x6552('0x50'));redis[_0x6552('0x51')](_0x371ad4['state']);return oauth[_0x6552('0x52')](_0x371ad4[_0x6552('0x53')],_0x34642a);})['then'](function(_0xbf01fc){_0x34642a[_0x6552('0x54')]=_0xbf01fc['access_token'];_0x34642a['data6']=_0xbf01fc[_0x6552('0x55')];return db[_0x6552('0x1d')][_0x6552('0x15')]({'data5':_0x34642a[_0x6552('0x54')],'data6':_0x34642a[_0x6552('0x56')]},{'where':{'id':_0x34642a['id']}});})['then'](function(){oauth[_0x6552('0x57')](_0x34642a);socket['emit'](_0x6552('0x58'),{'id':_0x526a71['id']});return;})[_0x6552('0x16')](respondWithStatusCode(_0x2f2931,null))[_0x6552('0x3a')](function(_0x199046){if(_0x526a71){socket[_0x6552('0x59')](_0x6552('0x5a'),{'id':_0x526a71['id']});}if(!_0x34642a){logger[_0x6552('0x18')](_0x6552('0x5b'),_0x199046);return _0x2f2931[_0x6552('0xc')](0x1f4)[_0x6552('0x5c')](_0x199046[_0x6552('0x5d')]);}logger['error'](_0x6552('0x5e'),_0x34642a['id'],JSON['stringify'](_0x199046));});}; \ No newline at end of file +var _0xc6c5=['VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','length','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','create','find','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','toString','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data6','refresh_token','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','padEnd','index','map','CloudProvider','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type'];(function(_0xcaffe3,_0x1dea08){var _0x22b738=function(_0x1f5e54){while(--_0x1f5e54){_0xcaffe3['push'](_0xcaffe3['shift']());}};_0x22b738(++_0x1dea08);}(_0xc6c5,0xec));var _0x5c6c=function(_0x3c97de,_0x2c4098){_0x3c97de=_0x3c97de-0x0;var _0x49c77a=_0xc6c5[_0x3c97de];return _0x49c77a;};'use strict';var _=require('lodash');var Redis=require(_0x5c6c('0x0'));var qs=require(_0x5c6c('0x1'));var encryptor=require(_0x5c6c('0x2'));var config=require(_0x5c6c('0x3'));var logger=require('../../config/logger')(_0x5c6c('0x4'));var db=require(_0x5c6c('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x5c6c('0x6')]=_[_0x5c6c('0x7')](config[_0x5c6c('0x6')],{'host':_0x5c6c('0x8'),'port':0x18eb});var socket=require(_0x5c6c('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x5c6c('0x6')]);function respondWithStatusCode(_0x205d2d,_0x1c7768){_0x1c7768=_0x1c7768||0xcc;return function(_0x5d9a7c){if(_0x5d9a7c){return _0x205d2d['sendStatus'](_0x1c7768);}return _0x205d2d[_0x5c6c('0xa')](_0x1c7768)[_0x5c6c('0xb')]();};}function respondWithResult(_0x259df2,_0xf72841){_0xf72841=_0xf72841||0xc8;return function(_0x436df2){if(_0x436df2){return _0x259df2[_0x5c6c('0xa')](_0xf72841)[_0x5c6c('0xc')](_0x436df2);}};}function respondWithFilteredResult(_0x3e0764,_0x39b0c2){return function(_0x36dea4){if(_0x36dea4){var _0x47b102=typeof _0x39b0c2[_0x5c6c('0xd')]===_0x5c6c('0xe')&&typeof _0x39b0c2[_0x5c6c('0xf')]===_0x5c6c('0xe');var _0x3ec51f=_0x36dea4[_0x5c6c('0x10')];var _0x28d3da=_0x47b102?0x0:_0x39b0c2[_0x5c6c('0xd')];var _0x2e468c=_0x47b102?_0x36dea4[_0x5c6c('0x10')]:_0x39b0c2[_0x5c6c('0xd')]+_0x39b0c2[_0x5c6c('0xf')];var _0x4afbeb;if(_0x2e468c>=_0x3ec51f){_0x2e468c=_0x3ec51f;_0x4afbeb=0xc8;}else{_0x4afbeb=0xce;}_0x3e0764[_0x5c6c('0xa')](_0x4afbeb);return _0x3e0764[_0x5c6c('0x11')](_0x5c6c('0x12'),_0x28d3da+'-'+_0x2e468c+'/'+_0x3ec51f)[_0x5c6c('0xc')](_0x36dea4);}return null;};}function saveUpdates(_0x520532){return function(_0x2db51f){if(_0x2db51f){return _0x2db51f[_0x5c6c('0x13')](_0x520532)['then'](function(_0x1ba0c7){return _0x1ba0c7;});}return null;};}function removeEntity(_0x5a7e40){return function(_0x3671ba){if(_0x3671ba){return _0x3671ba[_0x5c6c('0x14')]()[_0x5c6c('0x15')](function(){_0x5a7e40['status'](0xcc)[_0x5c6c('0xb')]();});}};}function handleEntityNotFound(_0x206031){return function(_0x589df8){if(!_0x589df8){_0x206031['sendStatus'](0x194);}return _0x589df8;};}function handleError(_0x1cd421,_0x2bc1cc){_0x2bc1cc=_0x2bc1cc||0x1f4;return function(_0x30ff6e){logger[_0x5c6c('0x16')](_0x30ff6e[_0x5c6c('0x17')]);if(_0x30ff6e['name']){delete _0x30ff6e[_0x5c6c('0x18')];}_0x1cd421[_0x5c6c('0xa')](_0x2bc1cc)['send'](_0x30ff6e);};}function maskClientSecret(_0x3425cd){return _[_0x5c6c('0x19')](_0x3425cd['slice'](0x0,0x3),0x14,'*');}exports[_0x5c6c('0x1a')]=function(_0x5bbf0c,_0x3ffb1e){var _0x5123ce={},_0x4ab5ed={},_0x4ce2b6={'count':0x0,'rows':[]};var _0x288478=_[_0x5c6c('0x1b')](db[_0x5c6c('0x1c')][_0x5c6c('0x1d')],function(_0x22c2fd){return{'name':_0x22c2fd['fieldName'],'type':_0x22c2fd['type'][_0x5c6c('0x1e')]};});_0x4ab5ed[_0x5c6c('0x1f')]=_[_0x5c6c('0x1b')](_0x288478,_0x5c6c('0x18'));_0x4ab5ed[_0x5c6c('0x20')]=_[_0x5c6c('0x21')](_0x5bbf0c[_0x5c6c('0x20')]);_0x4ab5ed[_0x5c6c('0x22')]=_['intersection'](_0x4ab5ed[_0x5c6c('0x1f')],_0x4ab5ed[_0x5c6c('0x20')]);_0x5123ce[_0x5c6c('0x23')]=_[_0x5c6c('0x24')](_0x4ab5ed[_0x5c6c('0x1f')],qs[_0x5c6c('0x25')](_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0x25')]));_0x5123ce['attributes']=_0x5123ce['attributes']['length']?_0x5123ce[_0x5c6c('0x23')]:_0x4ab5ed[_0x5c6c('0x1f')];if(!_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0x26')](_0x5c6c('0x27'))){_0x5123ce[_0x5c6c('0xf')]=qs[_0x5c6c('0xf')](_0x5bbf0c[_0x5c6c('0x20')]['limit']);_0x5123ce[_0x5c6c('0xd')]=qs[_0x5c6c('0xd')](_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0xd')]);}_0x5123ce[_0x5c6c('0x28')]=qs[_0x5c6c('0x29')](_0x5bbf0c['query'][_0x5c6c('0x29')]);_0x5123ce[_0x5c6c('0x2a')]=qs[_0x5c6c('0x22')](_['pick'](_0x5bbf0c[_0x5c6c('0x20')],_0x4ab5ed[_0x5c6c('0x22')]),_0x288478);if(_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0x2b')]){_0x5123ce['where']=_[_0x5c6c('0x2c')](_0x5123ce[_0x5c6c('0x2a')],{'$or':_[_0x5c6c('0x1b')](_0x288478,function(_0x13da5f){if(_0x13da5f[_0x5c6c('0x2d')]!==_0x5c6c('0x2e')){var _0x49e11f={};_0x49e11f[_0x13da5f[_0x5c6c('0x18')]]={'$like':'%'+_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0x2b')]+'%'};return _0x49e11f;}})});}_0x5123ce=_[_0x5c6c('0x2c')]({},_0x5123ce,_0x5bbf0c[_0x5c6c('0x2f')]);var _0x21b9c8={'where':_0x5123ce[_0x5c6c('0x2a')]};return db[_0x5c6c('0x1c')][_0x5c6c('0x10')](_0x21b9c8)[_0x5c6c('0x15')](function(_0x418ec5){_0x4ce2b6[_0x5c6c('0x10')]=_0x418ec5;if(_0x5bbf0c[_0x5c6c('0x20')][_0x5c6c('0x30')]){_0x5123ce[_0x5c6c('0x31')]=[{'all':!![]}];}return db[_0x5c6c('0x1c')][_0x5c6c('0x32')](_0x5123ce);})[_0x5c6c('0x15')](function(_0x10ba61){_0x4ce2b6[_0x5c6c('0x33')]=_[_0x5c6c('0x1b')](_0x10ba61,function(_0x59edca){if(_0x59edca[_0x5c6c('0x34')]===_0x5c6c('0x35')){var _0xaa72da=encryptor[_0x5c6c('0x36')](_0x59edca[_0x5c6c('0x37')]);_0x59edca[_0x5c6c('0x37')]=maskClientSecret(_0xaa72da);}return _0x59edca;});return _0x4ce2b6;})[_0x5c6c('0x15')](respondWithFilteredResult(_0x3ffb1e,_0x5123ce))[_0x5c6c('0x38')](handleError(_0x3ffb1e,null));};exports[_0x5c6c('0x39')]=function(_0x53c840,_0x222e71){var _0x1fa10f={'raw':!![],'where':{'id':_0x53c840[_0x5c6c('0x3a')]['id']}},_0x29ec3f={};_0x29ec3f[_0x5c6c('0x1f')]=_[_0x5c6c('0x21')](db[_0x5c6c('0x1c')]['rawAttributes']);_0x29ec3f[_0x5c6c('0x20')]=_[_0x5c6c('0x21')](_0x53c840['query']);_0x29ec3f[_0x5c6c('0x22')]=_[_0x5c6c('0x24')](_0x29ec3f[_0x5c6c('0x1f')],_0x29ec3f[_0x5c6c('0x20')]);_0x1fa10f['attributes']=_['intersection'](_0x29ec3f[_0x5c6c('0x1f')],qs[_0x5c6c('0x25')](_0x53c840[_0x5c6c('0x20')][_0x5c6c('0x25')]));_0x1fa10f[_0x5c6c('0x23')]=_0x1fa10f['attributes'][_0x5c6c('0x3b')]?_0x1fa10f[_0x5c6c('0x23')]:_0x29ec3f[_0x5c6c('0x1f')];if(_0x53c840[_0x5c6c('0x20')]['includeAll']){_0x1fa10f[_0x5c6c('0x31')]=[{'all':!![]}];}_0x1fa10f=_['merge']({},_0x1fa10f,_0x53c840[_0x5c6c('0x2f')]);return db[_0x5c6c('0x1c')]['find'](_0x1fa10f)[_0x5c6c('0x15')](handleEntityNotFound(_0x222e71,null))['then'](function(_0x4e99cb){if(_0x4e99cb[_0x5c6c('0x34')]===_0x5c6c('0x35')){var _0x2f44d6=encryptor[_0x5c6c('0x36')](_0x4e99cb['data3']);_0x4e99cb[_0x5c6c('0x37')]=maskClientSecret(_0x2f44d6);}return _0x4e99cb;})[_0x5c6c('0x15')](respondWithResult(_0x222e71,null))[_0x5c6c('0x38')](handleError(_0x222e71,null));};exports['create']=function(_0x3b004d,_0x3547a0){if(!_0x3b004d[_0x5c6c('0x3c')]['name'])throw new Error(_0x5c6c('0x3d'));if(!_0x3b004d['body'][_0x5c6c('0x34')])throw new Error(_0x5c6c('0x3e'));var _0x5b81df=db['CloudProvider']['rawAttributes'][_0x5c6c('0x34')][_0x5c6c('0x3f')];if(!_0x5b81df['includes'](_0x3b004d[_0x5c6c('0x3c')]['service']))throw new Error(_0x5c6c('0x40')+_0x5b81df[_0x5c6c('0x41')](',\x20'));if(_0x3b004d[_0x5c6c('0x3c')]['service']===_0x5c6c('0x35')&&_0x3b004d['body'][_0x5c6c('0x37')]){_0x3b004d[_0x5c6c('0x3c')][_0x5c6c('0x37')]=encryptor['encryptString'](_0x3b004d['body'][_0x5c6c('0x37')]);}return db[_0x5c6c('0x1c')][_0x5c6c('0x42')](_0x3b004d[_0x5c6c('0x3c')],{})[_0x5c6c('0x15')](respondWithResult(_0x3547a0,0xc9))[_0x5c6c('0x38')](handleError(_0x3547a0,null));};exports[_0x5c6c('0x13')]=function(_0x4ffd60,_0x49fd04){if(_0x4ffd60[_0x5c6c('0x3c')]['id']){delete _0x4ffd60[_0x5c6c('0x3c')]['id'];}return db[_0x5c6c('0x1c')][_0x5c6c('0x43')]({'where':{'id':_0x4ffd60[_0x5c6c('0x3a')]['id']}})[_0x5c6c('0x15')](handleEntityNotFound(_0x49fd04,null))[_0x5c6c('0x15')](function(_0x4055db){if(_0x4055db[_0x5c6c('0x34')]==='MicrosoftAzure'&&_0x4ffd60[_0x5c6c('0x3c')][_0x5c6c('0x37')]){_0x4ffd60[_0x5c6c('0x3c')][_0x5c6c('0x37')]=encryptor[_0x5c6c('0x44')](_0x4ffd60[_0x5c6c('0x3c')][_0x5c6c('0x37')]);}return _0x4055db;})[_0x5c6c('0x15')](saveUpdates(_0x4ffd60[_0x5c6c('0x3c')],null))[_0x5c6c('0x15')](respondWithResult(_0x49fd04,null))[_0x5c6c('0x38')](handleError(_0x49fd04,null));};exports[_0x5c6c('0x14')]=function(_0x2ec252,_0x4d036f){return db[_0x5c6c('0x1c')][_0x5c6c('0x43')]({'where':{'id':_0x2ec252[_0x5c6c('0x3a')]['id']}})[_0x5c6c('0x15')](handleEntityNotFound(_0x4d036f,null))[_0x5c6c('0x15')](removeEntity(_0x4d036f,null))[_0x5c6c('0x38')](handleError(_0x4d036f,null));};exports[_0x5c6c('0x45')]=function(_0xef4851,_0x13127c){return db[_0x5c6c('0x1c')][_0x5c6c('0x46')]({'where':{'id':_0xef4851[_0x5c6c('0x3a')]['id']},'raw':!![]})[_0x5c6c('0x15')](function(_0x2c6395){if(!_0x2c6395)return _0x13127c[_0x5c6c('0x47')](0x194);return{'url':oauth[_0x5c6c('0x48')](_0x2c6395,_0xef4851[_0x5c6c('0x49')]['id'])};})[_0x5c6c('0x15')](respondWithResult(_0x13127c,null))['catch'](handleError(_0x13127c,null));};exports['oauth2MicrosoftCallback']=function(_0x2837bf,_0x101d1f){var _0x2bc8d8=_0x2837bf[_0x5c6c('0x3c')];var _0x54f971;var _0x547978;if(_0x2bc8d8[_0x5c6c('0x16')])throw _0x2bc8d8;redis[_0x5c6c('0x4a')](_0x2bc8d8['state'])['then'](function(_0x47a7b1){if(!_0x47a7b1)throw new Error(_0x5c6c('0x4b'));_0x54f971=JSON[_0x5c6c('0x4c')](_0x47a7b1);var _0x179b95=Buffer['from'](_0x2bc8d8['state'],'base64')[_0x5c6c('0x4d')]('ascii');_0x547978=JSON[_0x5c6c('0x4c')](_0x179b95);if(!oauth[_0x5c6c('0x4e')](_0x2bc8d8[_0x5c6c('0x4f')],_0x54f971[_0x5c6c('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x2bc8d8['state']);return oauth[_0x5c6c('0x51')](_0x2bc8d8[_0x5c6c('0x52')],_0x54f971);})[_0x5c6c('0x15')](function(_0x1d5298){_0x54f971['data5']=_0x1d5298['access_token'];_0x54f971[_0x5c6c('0x53')]=_0x1d5298[_0x5c6c('0x54')];return db['CloudProvider'][_0x5c6c('0x13')]({'data5':_0x54f971[_0x5c6c('0x55')],'data6':_0x54f971[_0x5c6c('0x53')]},{'where':{'id':_0x54f971['id']}});})[_0x5c6c('0x15')](function(){oauth[_0x5c6c('0x56')](_0x54f971);socket[_0x5c6c('0x57')](_0x5c6c('0x58'),{'id':_0x547978['id']});return;})[_0x5c6c('0x15')](respondWithStatusCode(_0x101d1f,null))[_0x5c6c('0x38')](function(_0xcc9e64){if(_0x547978){socket[_0x5c6c('0x57')](_0x5c6c('0x59'),{'id':_0x547978['id']});}if(!_0x54f971){logger['error'](_0x5c6c('0x5a'),_0xcc9e64);return _0x101d1f[_0x5c6c('0xa')](0x1f4)[_0x5c6c('0x5b')](_0xcc9e64[_0x5c6c('0x5c')]);}logger[_0x5c6c('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x54f971['id'],JSON[_0x5c6c('0x5d')](_0xcc9e64));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 6a9bf07..a4808b4 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 _0xa96b=['cloud_providers','util','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider'];(function(_0x174e35,_0x4251b6){var _0x34be85=function(_0xce717f){while(--_0xce717f){_0x174e35['push'](_0x174e35['shift']());}};_0x34be85(++_0x4251b6);}(_0xa96b,0xe5));var _0xba96=function(_0x4105b7,_0x325fc8){_0x4105b7=_0x4105b7-0x0;var _0xed9bf3=_0xa96b[_0x4105b7];return _0xed9bf3;};'use strict';var _=require('lodash');var util=require(_0xba96('0x0'));var logger=require('../../config/logger')(_0xba96('0x1'));var moment=require(_0xba96('0x2'));var BPromise=require(_0xba96('0x3'));var rp=require(_0xba96('0x4'));var fs=require('fs');var path=require(_0xba96('0x5'));var rimraf=require('rimraf');var config=require(_0xba96('0x6'));var attributes=require(_0xba96('0x7'));module[_0xba96('0x8')]=function(_0x5681cb,_0x21b862){return _0x5681cb[_0xba96('0x9')](_0xba96('0xa'),attributes,{'tableName':_0xba96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc480=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','../../config/logger','api'];(function(_0x49ab57,_0x5e5fc9){var _0x32c892=function(_0xc949bb){while(--_0xc949bb){_0x49ab57['push'](_0x49ab57['shift']());}};_0x32c892(++_0x5e5fc9);}(_0xc480,0x1c5));var _0x0c48=function(_0x376243,_0x17d96d){_0x376243=_0x376243-0x0;var _0x22edcc=_0xc480[_0x376243];return _0x22edcc;};'use strict';var _=require(_0x0c48('0x0'));var util=require('util');var logger=require(_0x0c48('0x1'))(_0x0c48('0x2'));var moment=require('moment');var BPromise=require(_0x0c48('0x3'));var rp=require(_0x0c48('0x4'));var fs=require('fs');var path=require(_0x0c48('0x5'));var rimraf=require(_0x0c48('0x6'));var config=require(_0x0c48('0x7'));var attributes=require(_0x0c48('0x8'));module['exports']=function(_0x224e5a,_0x75c6cc){return _0x224e5a[_0x0c48('0x9')](_0x0c48('0xa'),attributes,{'tableName':_0x0c48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 4b8487d..69a388a 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5706=['../../mysqldb','redis','localhost','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','type','Dynamics365','push','data7','{TENANT_ID}','code','id_token','from','stringify','base64','toString','client_id','response_type','join','redirect_uri','form_post','state','prompt','login','value','oauth2/','data1','set','decode','payload','issuer','nonce','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','replace','data2','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','map','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider'];(function(_0x16c38e,_0x28725f){var _0x4da421=function(_0x297272){while(--_0x297272){_0x16c38e['push'](_0x16c38e['shift']());}};_0x4da421(++_0x28725f);}(_0x5706,0xd1));var _0x6570=function(_0x1835a0,_0x2ce354){_0x1835a0=_0x1835a0-0x0;var _0x243665=_0x5706[_0x1835a0];return _0x243665;};'use strict';var _=require(_0x6570('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x6570('0x1'));var Redis=require(_0x6570('0x2'));var rp=require(_0x6570('0x3'));var util=require(_0x6570('0x4'));var encryptor=require(_0x6570('0x5'));var config=require(_0x6570('0x6'));var logger=require(_0x6570('0x7'))(_0x6570('0x8'));var schedule=require(_0x6570('0x9'));var db=require(_0x6570('0xa'))['db'];config[_0x6570('0xb')]=_['defaults'](config[_0x6570('0xb')],{'host':_0x6570('0xc'),'port':0x18eb});var redis=new Redis(config[_0x6570('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x6570('0xd'),_0x6570('0xe'),_0x6570('0xf'),_0x6570('0x10'),_0x6570('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6570('0x12'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x6570('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x6570('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3bf195){var _0x18dd13=_['map'](AZURE_AUTH_SCOPES[_0x3bf195[_0x6570('0x15')]]);if(_0x3bf195[_0x6570('0x15')]===_0x6570('0x16'))_0x18dd13[_0x6570('0x17')](_0x3bf195[_0x6570('0x18')]+'/.default');return _0x18dd13['join']('\x20');}function getAccessTokenScope(_0x2a0a7f){if(_0x2a0a7f[_0x6570('0x15')]==='Outlook365')return _0x6570('0x10');if(_0x2a0a7f[_0x6570('0x15')]===_0x6570('0x16'))return _0x2a0a7f[_0x6570('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x63d776,_0x5607cb){var _0x22b2fa=MICROSOFT_AUTH_URL['replace'](_0x6570('0x19'),_0x63d776['data2']);var _0x4aabad=[_0x6570('0x1a'),_0x6570('0x1b')];var _0xbf81d9=Buffer[_0x6570('0x1c')](JSON[_0x6570('0x1d')]({'id':_0x5607cb}))['toString'](_0x6570('0x1e'));var _0x12dc92=crypto['randomBytes'](0x10)[_0x6570('0x1f')]('hex');var _0x4e9c1a=getAuthorizationScopes(_0x63d776);var _0x4f7c7c=[{'key':_0x6570('0x20'),'value':_0x63d776['data1']},{'key':_0x6570('0x21'),'value':encodeURIComponent(_0x4aabad[_0x6570('0x22')]('\x20'))},{'key':_0x6570('0x23'),'value':_0x63d776['data4']},{'key':'response_mode','value':_0x6570('0x24')},{'key':'scope','value':encodeURIComponent(_0x4e9c1a)},{'key':_0x6570('0x25'),'value':_0xbf81d9},{'key':'nonce','value':_0x12dc92},{'key':_0x6570('0x26'),'value':_0x6570('0x27')}];var _0x4aba8c=_0x22b2fa+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4f7c7c,function(_0x579a78){return _0x579a78['key']+'='+_0x579a78[_0x6570('0x28')];})[_0x6570('0x22')]('&');_0x63d776['oauth2Claims']={'issuer':_0x22b2fa['replace'](_0x6570('0x29'),''),'audience':_0x63d776[_0x6570('0x2a')],'state':_0xbf81d9,'nonce':_0x12dc92};redis[_0x6570('0x2b')](_0xbf81d9,JSON[_0x6570('0x1d')](_0x63d776));return _0x4aba8c;}function isValidIdToken(_0x31108e,_0x447248){try{var _0x27f977=jwt[_0x6570('0x2c')](_0x31108e,{'complete':!![]});var _0x56ab49=_0x27f977[_0x6570('0x2d')];if(_0x56ab49['iss']!==_0x447248[_0x6570('0x2e')])return![];if(_0x56ab49['aud']!==_0x447248['audience'])return![];if(_0x56ab49[_0x6570('0x2f')]!==_0x447248[_0x6570('0x2f')])return![];if(moment()[_0x6570('0x30')](moment[_0x6570('0x31')](_0x56ab49[_0x6570('0x32')])))return![];return!![];}catch(_0x11f4e7){throw _0x11f4e7;}}function refreshOauth2MicrosoftAccessToken(_0x109cc2){return Promise['resolve']()[_0x6570('0x33')](function(){if(_0x109cc2[_0x6570('0x34')])return _0x109cc2;return db[_0x6570('0x35')][_0x6570('0x36')]({'where':{'id':_0x109cc2['id']},'raw':!![]});})[_0x6570('0x33')](function(_0x441d81){var _0x1f0a3f={'grant_type':_0x6570('0x37'),'refresh_token':_0x441d81[_0x6570('0x38')],'scope':getAccessTokenScope(_0x441d81),'redirect_uri':_0x441d81[_0x6570('0x39')],'client_id':_0x441d81['data1'],'client_secret':encryptor[_0x6570('0x3a')](_0x441d81[_0x6570('0x34')])};var _0xb83765={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6570('0x3b')]('{TENANT_ID}',_0x441d81[_0x6570('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f0a3f,'json':!![]};return rp(_0xb83765);})[_0x6570('0x33')](function(_0x23bfcc){_0x109cc2[_0x6570('0x3d')]=_0x23bfcc[_0x6570('0x3e')];_0x109cc2[_0x6570('0x38')]=_0x23bfcc[_0x6570('0x37')];return db[_0x6570('0x35')][_0x6570('0x3f')]({'data5':_0x109cc2[_0x6570('0x3d')],'data6':_0x109cc2[_0x6570('0x38')]},{'where':{'id':_0x109cc2['id']}});})[_0x6570('0x33')](function(){return _0x109cc2;})[_0x6570('0x40')](function(_0x40b987){logger['error'](_0x6570('0x41'),_0x109cc2['id'],_0x40b987);});}function getOauth2MicrosoftAccessToken(_0x2ec884,_0x33588e){var _0x4d3ecb={'grant_type':'authorization_code','code':_0x2ec884,'scope':getAccessTokenScope(_0x33588e),'redirect_uri':_0x33588e[_0x6570('0x39')],'client_id':_0x33588e[_0x6570('0x2a')],'client_secret':encryptor[_0x6570('0x3a')](_0x33588e[_0x6570('0x34')])};var _0x50ca6a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6570('0x3b')](_0x6570('0x19'),_0x33588e[_0x6570('0x3c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d3ecb,'json':!![]};return rp(_0x50ca6a);}function startRefreshInterval(_0x199a9e){var _0x18f85f=schedule[_0x6570('0x42')];if(_0x18f85f[_0x199a9e['id']])clearInterval(_0x18f85f[_0x199a9e['id']]);_0x18f85f[_0x199a9e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x199a9e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6570('0x42')]=_0x18f85f;}function startAllRefreshIntervals(){return db[_0x6570('0x35')][_0x6570('0x43')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x42ad1f){var _0x4d2e1f=_0x42ad1f[_0x6570('0x44')](function(_0x25e766){return refreshOauth2MicrosoftAccessToken(_0x25e766)[_0x6570('0x33')](function(_0x1d0290){startRefreshInterval(_0x1d0290);});});return Promise[_0x6570('0x45')](_0x4d2e1f);})[_0x6570('0x40')](function(_0x23151e){var _0x43bfe8=_0x23151e?util['inspect'](_0x23151e,{'showHidden':![],'depth':null}):'';logger[_0x6570('0x46')](_0x6570('0x47'),_0x43bfe8);});}module[_0x6570('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x7698=['decode','payload','iss','aud','audience','nonce','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','/.default','join','Outlook365','data7','replace','data2','code','id_token','from','toString','base64','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','login','key','value','oauth2Claims','oauth2/','stringify'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0x7698,0xc0));var _0x8769=function(_0x309ad6,_0x5a02bb){_0x309ad6=_0x309ad6-0x0;var _0x29ba4c=_0x7698[_0x309ad6];return _0x29ba4c;};'use strict';var _=require(_0x8769('0x0'));var crypto=require(_0x8769('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x8769('0x2'));var rp=require(_0x8769('0x3'));var util=require(_0x8769('0x4'));var encryptor=require(_0x8769('0x5'));var config=require(_0x8769('0x6'));var logger=require(_0x8769('0x7'))(_0x8769('0x8'));var schedule=require(_0x8769('0x9'));var db=require(_0x8769('0xa'))['db'];config['redis']=_['defaults'](config[_0x8769('0xb')],{'host':_0x8769('0xc'),'port':0x18eb});var redis=new Redis(config[_0x8769('0xb')]);var MICROSOFT_AUTH_URL=_0x8769('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x8769('0xe'),'profile',_0x8769('0xf'),_0x8769('0x10'),_0x8769('0x11'),_0x8769('0x12'),_0x8769('0x13')],'Dynamics365':[_0x8769('0xe'),_0x8769('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x8769('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2f3ece){var _0x188157=_[_0x8769('0x15')](AZURE_AUTH_SCOPES[_0x2f3ece[_0x8769('0x16')]]);if(_0x2f3ece[_0x8769('0x16')]===_0x8769('0x17'))_0x188157[_0x8769('0x18')](_0x2f3ece['data7']+_0x8769('0x19'));return _0x188157[_0x8769('0x1a')]('\x20');}function getAccessTokenScope(_0x41db69){if(_0x41db69[_0x8769('0x16')]===_0x8769('0x1b'))return _0x8769('0x11');if(_0x41db69[_0x8769('0x16')]==='Dynamics365')return _0x41db69[_0x8769('0x1c')]+_0x8769('0x19');}function generateMicrosoftAuthorizationUrl(_0x6e7de9,_0x49d5fb){var _0x4387b4=MICROSOFT_AUTH_URL[_0x8769('0x1d')]('{TENANT_ID}',_0x6e7de9[_0x8769('0x1e')]);var _0x420b6b=[_0x8769('0x1f'),_0x8769('0x20')];var _0x1994aa=Buffer[_0x8769('0x21')](JSON['stringify']({'id':_0x49d5fb}))[_0x8769('0x22')](_0x8769('0x23'));var _0xcc1bb=crypto['randomBytes'](0x10)['toString'](_0x8769('0x24'));var _0x4bfa31=getAuthorizationScopes(_0x6e7de9);var _0x251d85=[{'key':_0x8769('0x25'),'value':_0x6e7de9[_0x8769('0x26')]},{'key':_0x8769('0x27'),'value':encodeURIComponent(_0x420b6b['join']('\x20'))},{'key':'redirect_uri','value':_0x6e7de9[_0x8769('0x28')]},{'key':_0x8769('0x29'),'value':_0x8769('0x2a')},{'key':_0x8769('0x2b'),'value':encodeURIComponent(_0x4bfa31)},{'key':_0x8769('0x2c'),'value':_0x1994aa},{'key':'nonce','value':_0xcc1bb},{'key':'prompt','value':_0x8769('0x2d')}];var _0x673c96=_0x4387b4+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8769('0x15')](_0x251d85,function(_0x50dce2){return _0x50dce2[_0x8769('0x2e')]+'='+_0x50dce2[_0x8769('0x2f')];})['join']('&');_0x6e7de9[_0x8769('0x30')]={'issuer':_0x4387b4[_0x8769('0x1d')](_0x8769('0x31'),''),'audience':_0x6e7de9['data1'],'state':_0x1994aa,'nonce':_0xcc1bb};redis['set'](_0x1994aa,JSON[_0x8769('0x32')](_0x6e7de9));return _0x673c96;}function isValidIdToken(_0x5dc71f,_0x4d6ac6){try{var _0x54181b=jwt[_0x8769('0x33')](_0x5dc71f,{'complete':!![]});var _0x19b70c=_0x54181b[_0x8769('0x34')];if(_0x19b70c[_0x8769('0x35')]!==_0x4d6ac6['issuer'])return![];if(_0x19b70c[_0x8769('0x36')]!==_0x4d6ac6[_0x8769('0x37')])return![];if(_0x19b70c[_0x8769('0x38')]!==_0x4d6ac6['nonce'])return![];if(moment()[_0x8769('0x39')](moment[_0x8769('0x3a')](_0x19b70c['exp'])))return![];return!![];}catch(_0x167b24){throw _0x167b24;}}function refreshOauth2MicrosoftAccessToken(_0x27ce4f){return Promise[_0x8769('0x3b')]()[_0x8769('0x3c')](function(){if(_0x27ce4f[_0x8769('0x3d')])return _0x27ce4f;return db[_0x8769('0x3e')][_0x8769('0x3f')]({'where':{'id':_0x27ce4f['id']},'raw':!![]});})[_0x8769('0x3c')](function(_0x55cec7){var _0x5a7614={'grant_type':_0x8769('0x40'),'refresh_token':_0x55cec7[_0x8769('0x41')],'scope':getAccessTokenScope(_0x55cec7),'redirect_uri':_0x55cec7[_0x8769('0x28')],'client_id':_0x55cec7[_0x8769('0x26')],'client_secret':encryptor[_0x8769('0x42')](_0x55cec7[_0x8769('0x3d')])};var _0x413d31={'method':_0x8769('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8769('0x1d')](_0x8769('0x44'),_0x55cec7[_0x8769('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5a7614,'json':!![]};return rp(_0x413d31);})[_0x8769('0x3c')](function(_0x56787e){_0x27ce4f[_0x8769('0x45')]=_0x56787e[_0x8769('0x46')];_0x27ce4f['data6']=_0x56787e[_0x8769('0x40')];return db['CloudProvider']['update']({'data5':_0x27ce4f[_0x8769('0x45')],'data6':_0x27ce4f[_0x8769('0x41')]},{'where':{'id':_0x27ce4f['id']}});})[_0x8769('0x3c')](function(){return _0x27ce4f;})[_0x8769('0x47')](function(_0x134b88){logger[_0x8769('0x48')](_0x8769('0x49'),_0x27ce4f['id'],_0x134b88);});}function getOauth2MicrosoftAccessToken(_0x1cbbdf,_0x1800c5){var _0x252f92={'grant_type':_0x8769('0x4a'),'code':_0x1cbbdf,'scope':getAccessTokenScope(_0x1800c5),'redirect_uri':_0x1800c5['data4'],'client_id':_0x1800c5[_0x8769('0x26')],'client_secret':encryptor[_0x8769('0x42')](_0x1800c5[_0x8769('0x3d')])};var _0x37779e={'method':_0x8769('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8769('0x1d')](_0x8769('0x44'),_0x1800c5[_0x8769('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x252f92,'json':!![]};return rp(_0x37779e);}function startRefreshInterval(_0x1ad7e4){var _0x57dbe0=schedule[_0x8769('0x4b')];if(_0x57dbe0[_0x1ad7e4['id']])clearInterval(_0x57dbe0[_0x1ad7e4['id']]);_0x57dbe0[_0x1ad7e4['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1ad7e4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x57dbe0;}function startAllRefreshIntervals(){return db[_0x8769('0x3e')][_0x8769('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8769('0x3c')](function(_0x2b0100){var _0x14f731=_0x2b0100[_0x8769('0x15')](function(_0x494a3e){return refreshOauth2MicrosoftAccessToken(_0x494a3e)['then'](function(_0x186a58){startRefreshInterval(_0x186a58);});});return Promise[_0x8769('0x4d')](_0x14f731);})[_0x8769('0x47')](function(_0x130c66){var _0x4c2739=_0x130c66?util[_0x8769('0x4e')](_0x130c66,{'showHidden':![],'depth':null}):'';logger[_0x8769('0x48')](_0x8769('0x4f'),_0x4c2739);});}module[_0x8769('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 5a89a05..7c4bf1f 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 _0x11f3=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x11f3,0x149));var _0x311f=function(_0x1f8cbc,_0x404fad){_0x1f8cbc=_0x1f8cbc-0x0;var _0x26e5d6=_0x11f3[_0x1f8cbc];return _0x26e5d6;};'use strict';var _=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var moment=require(_0x311f('0x2'));var BPromise=require('bluebird');var rs=require(_0x311f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x311f('0x4'))['db'];var utils=require(_0x311f('0x5'));var logger=require(_0x311f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x311f('0x7'));var client=jayson['client'][_0x311f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcbec7b,_0x11c88d,_0x3381a7){return new BPromise(function(_0x565d4d,_0x24a3fc){return client[_0x311f('0x9')](_0xcbec7b,_0x3381a7)[_0x311f('0xa')](function(_0x21b762){logger[_0x311f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x11c88d,_0x311f('0xc'));logger[_0x311f('0xd')](_0x311f('0xe'),_0x11c88d,_0x311f('0xc'),JSON[_0x311f('0xf')](_0x21b762));if(_0x21b762[_0x311f('0x10')]){if(_0x21b762[_0x311f('0x10')][_0x311f('0x11')]===0x1f4){logger[_0x311f('0x10')](_0x311f('0x12'),_0x11c88d,_0x21b762[_0x311f('0x10')][_0x311f('0x13')]);return _0x24a3fc(_0x21b762[_0x311f('0x10')][_0x311f('0x13')]);}logger[_0x311f('0x10')](_0x311f('0x12'),_0x11c88d,_0x21b762[_0x311f('0x10')][_0x311f('0x13')]);return _0x565d4d(_0x21b762[_0x311f('0x10')]['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x11c88d,_0x311f('0xc'));_0x565d4d(_0x21b762[_0x311f('0x14')][_0x311f('0x13')]);}})[_0x311f('0x15')](function(_0xb8227e){logger[_0x311f('0x10')](_0x311f('0x12'),_0x11c88d,_0xb8227e);_0x24a3fc(_0xb8227e);});});} \ No newline at end of file +var _0xda81=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xda81,0x1c3));var _0x1da8=function(_0x4364fc,_0x3aa451){_0x4364fc=_0x4364fc-0x0;var _0xfec681=_0xda81[_0x4364fc];return _0xfec681;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index c7d168e..a4978e9 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x6ba9c6,_0x3ae523){_0x6ba9c6=_0x6ba9c6-0x0;var _0x4744ea=_0x7a54[_0x6ba9c6];return _0x4744ea;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x2fd025,_0x28bd75){var _0x210087=function(_0x350449){while(--_0x350449){_0x2fd025['push'](_0x2fd025['shift']());}};_0x210087(++_0x28bd75);}(_0x2ef3,0xba));var _0x32ef=function(_0x52f613,_0x26efb4){_0x52f613=_0x52f613-0x0;var _0x3fd852=_0x2ef3[_0x52f613];return _0x3fd852;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 2c28c07..41f1a26 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 _0x59d8=['STRING','sequelize'];(function(_0x540511,_0x201e3b){var _0x5c1ac6=function(_0xdacf37){while(--_0xdacf37){_0x540511['push'](_0x540511['shift']());}};_0x5c1ac6(++_0x201e3b);}(_0x59d8,0x119));var _0x859d=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x59d8[_0x4b03c9];return _0x161ba2;};'use strict';var Sequelize=require(_0x859d('0x0'));module['exports']={'name':{'type':Sequelize[_0x859d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x859d('0x1')]},'website':{'type':Sequelize[_0x859d('0x1')]},'phone':{'type':Sequelize[_0x859d('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x859d('0x1')]},'street':{'type':Sequelize[_0x859d('0x1')]},'postalCode':{'type':Sequelize[_0x859d('0x1')]},'city':{'type':Sequelize[_0x859d('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x859d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x859d('0x1')]},'sStreet':{'type':Sequelize[_0x859d('0x1')]},'sPostalCode':{'type':Sequelize[_0x859d('0x1')]},'sCity':{'type':Sequelize[_0x859d('0x1')]},'sCountry':{'type':Sequelize[_0x859d('0x1')]},'description':{'type':Sequelize[_0x859d('0x1')]}}; \ No newline at end of file +var _0xfc01=['sequelize','exports','STRING','name'];(function(_0x2d7daa,_0x5efc28){var _0x2d9c78=function(_0x4cfa2a){while(--_0x4cfa2a){_0x2d7daa['push'](_0x2d7daa['shift']());}};_0x2d9c78(++_0x5efc28);}(_0xfc01,0xe0));var _0x1fc0=function(_0x264105,_0x3ec79c){_0x264105=_0x264105-0x0;var _0x5121d4=_0xfc01[_0x264105];return _0x5121d4;};'use strict';var Sequelize=require(_0x1fc0('0x0'));module[_0x1fc0('0x1')]={'name':{'type':Sequelize[_0x1fc0('0x2')],'unique':_0x1fc0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1fc0('0x2')]},'companyId':{'type':Sequelize[_0x1fc0('0x2')]},'website':{'type':Sequelize[_0x1fc0('0x2')]},'phone':{'type':Sequelize[_0x1fc0('0x2')]},'fax':{'type':Sequelize[_0x1fc0('0x2')]},'type':{'type':Sequelize[_0x1fc0('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1fc0('0x2')]},'country':{'type':Sequelize[_0x1fc0('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x1fc0('0x2')]},'sPostalCode':{'type':Sequelize[_0x1fc0('0x2')]},'sCity':{'type':Sequelize[_0x1fc0('0x2')]},'sCountry':{'type':Sequelize[_0x1fc0('0x2')]},'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 e2400b0..7721679 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 _0xd793=['name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','filter','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','body','describe','addContacts','CmContact','ids','omit','getContacts','findOne','pick','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','stack'];(function(_0x4040c5,_0x139734){var _0xab356c=function(_0x459323){while(--_0x459323){_0x4040c5['push'](_0x4040c5['shift']());}};_0xab356c(++_0x139734);}(_0xd793,0x195));var _0x3d79=function(_0x6d394a,_0x58d6e7){_0x6d394a=_0x6d394a-0x0;var _0x445f53=_0xd793[_0x6d394a];return _0x445f53;};'use strict';var emlformat=require(_0x3d79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d79('0x1'));var jsonpatch=require(_0x3d79('0x2'));var rp=require(_0x3d79('0x3'));var moment=require('moment');var BPromise=require(_0x3d79('0x4'));var Mustache=require(_0x3d79('0x5'));var util=require(_0x3d79('0x6'));var path=require(_0x3d79('0x7'));var sox=require(_0x3d79('0x8'));var csv=require(_0x3d79('0x9'));var ejs=require(_0x3d79('0xa'));var fs=require('fs');var fs_extra=require(_0x3d79('0xb'));var _=require(_0x3d79('0xc'));var squel=require(_0x3d79('0xd'));var crypto=require(_0x3d79('0xe'));var jsforce=require(_0x3d79('0xf'));var deskjs=require(_0x3d79('0x10'));var toCsv=require(_0x3d79('0x9'));var querystring=require(_0x3d79('0x11'));var Papa=require(_0x3d79('0x12'));var Redis=require(_0x3d79('0x13'));var authService=require(_0x3d79('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3d79('0x15'));var hardwareService=require(_0x3d79('0x16'));var logger=require(_0x3d79('0x17'))(_0x3d79('0x18'));var utils=require(_0x3d79('0x19'));var config=require(_0x3d79('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x340a64,_0x50d601){_0x50d601=_0x50d601||0xcc;return function(_0x5435c9){if(_0x5435c9){return _0x340a64[_0x3d79('0x1b')](_0x50d601);}return _0x340a64[_0x3d79('0x1c')](_0x50d601)[_0x3d79('0x1d')]();};}function respondWithResult(_0x1328dc,_0x31e3c6){_0x31e3c6=_0x31e3c6||0xc8;return function(_0x3a5e36){if(_0x3a5e36){return _0x1328dc[_0x3d79('0x1c')](_0x31e3c6)[_0x3d79('0x1e')](_0x3a5e36);}};}function respondWithFilteredResult(_0x31d97c,_0xebf0f2){return function(_0x1a11c6){if(_0x1a11c6){var _0x41dc77=typeof _0xebf0f2['offset']===_0x3d79('0x1f')&&typeof _0xebf0f2[_0x3d79('0x20')]===_0x3d79('0x1f');var _0x1c4577=_0x1a11c6[_0x3d79('0x21')];var _0x4ff019=_0x41dc77?0x0:_0xebf0f2['offset'];var _0x4f812a=_0x41dc77?_0x1a11c6[_0x3d79('0x21')]:_0xebf0f2[_0x3d79('0x22')]+_0xebf0f2[_0x3d79('0x20')];var _0x4acda8;if(_0x4f812a>=_0x1c4577){_0x4f812a=_0x1c4577;_0x4acda8=0xc8;}else{_0x4acda8=0xce;}_0x31d97c[_0x3d79('0x1c')](_0x4acda8);return _0x31d97c[_0x3d79('0x23')](_0x3d79('0x24'),_0x4ff019+'-'+_0x4f812a+'/'+_0x1c4577)['json'](_0x1a11c6);}return null;};}function patchUpdates(_0x5604d7){return function(_0x4410c3){try{jsonpatch['apply'](_0x4410c3,_0x5604d7,!![]);}catch(_0x1a17c0){return BPromise['reject'](_0x1a17c0);}return _0x4410c3[_0x3d79('0x25')]();};}function saveUpdates(_0x5347b2,_0x27b419){return function(_0x1b7370){if(_0x1b7370){return _0x1b7370[_0x3d79('0x26')](_0x5347b2)[_0x3d79('0x27')](function(_0x481db7){return _0x481db7;});}return null;};}function removeEntity(_0xb7d56b,_0xd7a5c1){return function(_0x46b88b){if(_0x46b88b){return _0x46b88b[_0x3d79('0x28')]()[_0x3d79('0x27')](function(){var _0x4a9b47=_0x46b88b[_0x3d79('0x29')]({'plain':!![]});var _0x92fc1=_0x3d79('0x2a');return db[_0x3d79('0x2b')]['destroy']({'where':{'type':_0x92fc1,'resourceId':_0x4a9b47['id']}})[_0x3d79('0x27')](function(){return _0x46b88b;});})[_0x3d79('0x27')](function(){_0xb7d56b[_0x3d79('0x1c')](0xcc)[_0x3d79('0x1d')]();});}};}function handleEntityNotFound(_0x5e5624,_0x11fa32){return function(_0x48c0ec){if(!_0x48c0ec){_0x5e5624[_0x3d79('0x1b')](0x194);}return _0x48c0ec;};}function handleError(_0xfb05ef,_0x3b204d){_0x3b204d=_0x3b204d||0x1f4;return function(_0xec71e4){logger['error'](_0xec71e4[_0x3d79('0x2c')]);if(_0xec71e4[_0x3d79('0x2d')]){delete _0xec71e4[_0x3d79('0x2d')];}_0xfb05ef[_0x3d79('0x1c')](_0x3b204d)[_0x3d79('0x2e')](_0xec71e4);};}exports[_0x3d79('0x2f')]=function(_0x2f644f,_0x387383){var _0x121c3a={},_0x5c5872={},_0xec3259={'count':0x0,'rows':[]};return db[_0x3d79('0x30')]['describe']()[_0x3d79('0x27')](function(_0xef2027){_0x5c5872[_0x3d79('0x31')]=_[_0x3d79('0x32')](_0xef2027);_0x5c5872['query']=_[_0x3d79('0x32')](_0x2f644f[_0x3d79('0x33')]);_0x5c5872[_0x3d79('0x34')]=_[_0x3d79('0x35')](_0x5c5872[_0x3d79('0x31')],_0x5c5872['query']);_0x121c3a[_0x3d79('0x36')]=_[_0x3d79('0x35')](_0x5c5872['model'],qs[_0x3d79('0x37')](_0x2f644f['query']['fields']));_0x121c3a[_0x3d79('0x36')]=_0x121c3a[_0x3d79('0x36')][_0x3d79('0x38')]?_0x121c3a[_0x3d79('0x36')]:_0x5c5872[_0x3d79('0x31')];if(!_0x2f644f[_0x3d79('0x33')]['hasOwnProperty'](_0x3d79('0x39'))){_0x121c3a[_0x3d79('0x20')]=qs[_0x3d79('0x20')](_0x2f644f['query']['limit']);_0x121c3a['offset']=qs[_0x3d79('0x22')](_0x2f644f[_0x3d79('0x33')][_0x3d79('0x22')]);}_0x121c3a[_0x3d79('0x3a')]=qs[_0x3d79('0x3b')](_0x2f644f[_0x3d79('0x33')][_0x3d79('0x3b')]);_0x121c3a[_0x3d79('0x3c')]=qs[_0x3d79('0x34')](_['pick'](_0x2f644f['query'],_0x5c5872[_0x3d79('0x34')]),_0xef2027);if(_0x2f644f['query']['filter']){_0x121c3a[_0x3d79('0x3c')]=_[_0x3d79('0x3d')](_0x121c3a[_0x3d79('0x3c')],{'$or':_[_0x3d79('0x3e')](_0x121c3a['attributes'],function(_0x501bac){var _0x4a4b2d={};_0x4a4b2d[_0x501bac]={'$like':'%'+_0x2f644f[_0x3d79('0x33')][_0x3d79('0x3f')]+'%'};return _0x4a4b2d;})});}_0x121c3a=_[_0x3d79('0x3d')]({},_0x121c3a,_0x2f644f[_0x3d79('0x40')]);var _0x5562d6={'where':_0x121c3a[_0x3d79('0x3c')]};return db[_0x3d79('0x30')][_0x3d79('0x21')](_0x5562d6)[_0x3d79('0x27')](function(_0xee46fe){_0xec3259[_0x3d79('0x21')]=_0xee46fe;if(_0x2f644f[_0x3d79('0x33')]['includeAll']){_0x121c3a[_0x3d79('0x41')]=[{'all':!![]}];}return db[_0x3d79('0x30')][_0x3d79('0x42')](_0x121c3a);})[_0x3d79('0x27')](function(_0xc59f8f){_0xec3259['rows']=_0xc59f8f;return _0xec3259;})[_0x3d79('0x27')](respondWithFilteredResult(_0x387383,_0x121c3a))[_0x3d79('0x43')](handleError(_0x387383,null));})[_0x3d79('0x43')](handleError(_0x387383,null));};exports[_0x3d79('0x44')]=function(_0x39e086,_0x4f14c4){var _0x58bc5a={'raw':![],'where':{'id':_0x39e086[_0x3d79('0x45')]['id']}},_0x409cef={};_0x409cef[_0x3d79('0x31')]=_[_0x3d79('0x32')](db[_0x3d79('0x30')][_0x3d79('0x46')]);_0x409cef[_0x3d79('0x33')]=_['keys'](_0x39e086[_0x3d79('0x33')]);_0x409cef[_0x3d79('0x34')]=_[_0x3d79('0x35')](_0x409cef[_0x3d79('0x31')],_0x409cef[_0x3d79('0x33')]);_0x58bc5a['attributes']=_[_0x3d79('0x35')](_0x409cef[_0x3d79('0x31')],qs['fields'](_0x39e086[_0x3d79('0x33')]['fields']));_0x58bc5a[_0x3d79('0x36')]=_0x58bc5a['attributes'][_0x3d79('0x38')]?_0x58bc5a[_0x3d79('0x36')]:_0x409cef[_0x3d79('0x31')];if(_0x39e086[_0x3d79('0x33')][_0x3d79('0x47')]){_0x58bc5a[_0x3d79('0x41')]=[{'all':!![]}];}_0x58bc5a=_['merge']({},_0x58bc5a,_0x39e086[_0x3d79('0x40')]);return db['CmCompany']['find'](_0x58bc5a)[_0x3d79('0x27')](handleEntityNotFound(_0x4f14c4,null))[_0x3d79('0x27')](respondWithResult(_0x4f14c4,null))[_0x3d79('0x43')](handleError(_0x4f14c4,null));};exports[_0x3d79('0x48')]=function(_0x437ae8,_0x151c62){return db[_0x3d79('0x30')]['create'](_0x437ae8['body'],{})[_0x3d79('0x27')](function(_0x2da12e){var _0x539c32=_0x437ae8[_0x3d79('0x49')][_0x3d79('0x29')]({'plain':!![]});if(!_0x539c32)throw new Error(_0x3d79('0x4a'));if(_0x539c32[_0x3d79('0x4b')]===_0x3d79('0x49')){var _0xe140a8=_0x2da12e[_0x3d79('0x29')]({'plain':!![]});var _0x46dac3=_0x3d79('0x2a');return db[_0x3d79('0x4c')][_0x3d79('0x4d')]({'where':{'name':_0x46dac3,'userProfileId':_0x539c32['userProfileId']},'raw':!![]})[_0x3d79('0x27')](function(_0x86b66a){if(_0x86b66a&&_0x86b66a[_0x3d79('0x4e')]===0x0){return db[_0x3d79('0x2b')][_0x3d79('0x48')]({'name':_0xe140a8[_0x3d79('0x2d')],'resourceId':_0xe140a8['id'],'type':_0x86b66a[_0x3d79('0x2d')],'sectionId':_0x86b66a['id']},{})[_0x3d79('0x27')](function(){return _0x2da12e;});}else{return _0x2da12e;}})[_0x3d79('0x43')](function(_0x4372f1){logger[_0x3d79('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4372f1);throw _0x4372f1;});}return _0x2da12e;})[_0x3d79('0x27')](respondWithResult(_0x151c62,0xc9))['catch'](handleError(_0x151c62,null));};exports['update']=function(_0x38f425,_0x1f5dfe){if(_0x38f425['body']['id']){delete _0x38f425['body']['id'];}return db[_0x3d79('0x30')][_0x3d79('0x4d')]({'where':{'id':_0x38f425[_0x3d79('0x45')]['id']}})[_0x3d79('0x27')](handleEntityNotFound(_0x1f5dfe,null))[_0x3d79('0x27')](saveUpdates(_0x38f425[_0x3d79('0x50')],null))[_0x3d79('0x27')](respondWithResult(_0x1f5dfe,null))[_0x3d79('0x43')](handleError(_0x1f5dfe,null));};exports['destroy']=function(_0x3b5e51,_0x121703){return db[_0x3d79('0x30')][_0x3d79('0x4d')]({'where':{'id':_0x3b5e51[_0x3d79('0x45')]['id']}})[_0x3d79('0x27')](handleEntityNotFound(_0x121703,null))[_0x3d79('0x27')](removeEntity(_0x121703,null))[_0x3d79('0x43')](handleError(_0x121703,null));};exports[_0x3d79('0x51')]=function(_0x27878b,_0x7053ac){return db[_0x3d79('0x30')]['describe']()[_0x3d79('0x27')](respondWithResult(_0x7053ac,null))[_0x3d79('0x43')](handleError(_0x7053ac,null));};exports[_0x3d79('0x52')]=function(_0x2256ca,_0x1bb071,_0x319735){return db[_0x3d79('0x53')][_0x3d79('0x4d')]({'where':{'id':_0x2256ca['params']['id']}})[_0x3d79('0x27')](handleEntityNotFound(_0x1bb071,null))[_0x3d79('0x27')](function(_0xe76367){if(_0xe76367){return _0xe76367[_0x3d79('0x52')](_0x2256ca[_0x3d79('0x50')][_0x3d79('0x54')],_[_0x3d79('0x55')](_0x2256ca[_0x3d79('0x50')],['ids','id'])||{});}})[_0x3d79('0x27')](respondWithResult(_0x1bb071,null))[_0x3d79('0x43')](handleError(_0x1bb071,null));};exports[_0x3d79('0x56')]=function(_0x239cae,_0x10484b,_0xe2d3ec){var _0x4b9f99={};var _0x99ac71={};var _0x2040dd;var _0x3dadf8;return db[_0x3d79('0x30')][_0x3d79('0x57')]({'where':{'id':_0x239cae[_0x3d79('0x45')]['id']}})[_0x3d79('0x27')](handleEntityNotFound(_0x10484b,null))['then'](function(_0x3fb170){if(_0x3fb170){_0x2040dd=_0x3fb170;_0x99ac71[_0x3d79('0x31')]=_[_0x3d79('0x32')](db['CmContact'][_0x3d79('0x46')]);_0x99ac71[_0x3d79('0x33')]=_['keys'](_0x239cae[_0x3d79('0x33')]);_0x99ac71[_0x3d79('0x34')]=_['intersection'](_0x99ac71[_0x3d79('0x31')],_0x99ac71[_0x3d79('0x33')]);_0x4b9f99[_0x3d79('0x36')]=_[_0x3d79('0x35')](_0x99ac71['model'],qs[_0x3d79('0x37')](_0x239cae[_0x3d79('0x33')]['fields']));_0x4b9f99[_0x3d79('0x36')]=_0x4b9f99[_0x3d79('0x36')][_0x3d79('0x38')]?_0x4b9f99[_0x3d79('0x36')]:_0x99ac71[_0x3d79('0x31')];_0x4b9f99[_0x3d79('0x3a')]=qs[_0x3d79('0x3b')](_0x239cae[_0x3d79('0x33')][_0x3d79('0x3b')]);_0x4b9f99[_0x3d79('0x3c')]=qs[_0x3d79('0x34')](_[_0x3d79('0x58')](_0x239cae[_0x3d79('0x33')],_0x99ac71[_0x3d79('0x34')]));if(_0x239cae[_0x3d79('0x33')][_0x3d79('0x3f')]){_0x4b9f99[_0x3d79('0x3c')]=_[_0x3d79('0x3d')](_0x4b9f99[_0x3d79('0x3c')],{'$or':_['map'](_0x4b9f99[_0x3d79('0x36')],function(_0x1f5329){var _0x32bcaa={};_0x32bcaa[_0x1f5329]={'$like':'%'+_0x239cae[_0x3d79('0x33')][_0x3d79('0x3f')]+'%'};return _0x32bcaa;})});}_0x4b9f99=_[_0x3d79('0x3d')]({},_0x4b9f99,_0x239cae[_0x3d79('0x40')]);return _0x2040dd[_0x3d79('0x56')](_0x4b9f99);}})['then'](function(_0x486608){if(_0x486608){_0x3dadf8=_0x486608['length'];if(!_0x239cae[_0x3d79('0x33')][_0x3d79('0x59')](_0x3d79('0x39'))){_0x4b9f99[_0x3d79('0x20')]=qs[_0x3d79('0x20')](_0x239cae[_0x3d79('0x33')][_0x3d79('0x20')]);_0x4b9f99['offset']=qs[_0x3d79('0x22')](_0x239cae[_0x3d79('0x33')]['offset']);}return _0x2040dd[_0x3d79('0x56')](_0x4b9f99);}})[_0x3d79('0x27')](function(_0x1e9ae4){if(_0x1e9ae4){return _0x1e9ae4?{'count':_0x3dadf8,'rows':_0x1e9ae4}:null;}})['then'](respondWithResult(_0x10484b,null))['catch'](handleError(_0x10484b,null));}; \ No newline at end of file +var _0x83eb=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','addContacts','ids','omit','getContacts','findOne','CmContact','pick','map','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys'];(function(_0x130720,_0x48ba32){var _0x18755c=function(_0x35407a){while(--_0x35407a){_0x130720['push'](_0x130720['shift']());}};_0x18755c(++_0x48ba32);}(_0x83eb,0x1ea));var _0xb83e=function(_0x3d35a4,_0xa1d986){_0x3d35a4=_0x3d35a4-0x0;var _0x5e2374=_0x83eb[_0x3d35a4];return _0x5e2374;};'use strict';var emlformat=require(_0xb83e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb83e('0x1'));var jsonpatch=require(_0xb83e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb83e('0x3'));var Mustache=require('mustache');var util=require(_0xb83e('0x4'));var path=require(_0xb83e('0x5'));var sox=require(_0xb83e('0x6'));var csv=require(_0xb83e('0x7'));var ejs=require(_0xb83e('0x8'));var fs=require('fs');var fs_extra=require(_0xb83e('0x9'));var _=require(_0xb83e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb83e('0xb'));var deskjs=require(_0xb83e('0xc'));var toCsv=require(_0xb83e('0x7'));var querystring=require(_0xb83e('0xd'));var Papa=require(_0xb83e('0xe'));var Redis=require(_0xb83e('0xf'));var authService=require(_0xb83e('0x10'));var qs=require(_0xb83e('0x11'));var as=require(_0xb83e('0x12'));var hardwareService=require(_0xb83e('0x13'));var logger=require('../../config/logger')(_0xb83e('0x14'));var utils=require('../../config/utils');var config=require(_0xb83e('0x15'));var licenseUtil=require(_0xb83e('0x16'));var db=require(_0xb83e('0x17'))['db'];function respondWithStatusCode(_0x52b7d9,_0x23d00e){_0x23d00e=_0x23d00e||0xcc;return function(_0x57d7ea){if(_0x57d7ea){return _0x52b7d9['sendStatus'](_0x23d00e);}return _0x52b7d9['status'](_0x23d00e)[_0xb83e('0x18')]();};}function respondWithResult(_0x5a36e7,_0x1f3461){_0x1f3461=_0x1f3461||0xc8;return function(_0x4efc48){if(_0x4efc48){return _0x5a36e7['status'](_0x1f3461)[_0xb83e('0x19')](_0x4efc48);}};}function respondWithFilteredResult(_0x5b58ef,_0x2493eb){return function(_0x3060e7){if(_0x3060e7){var _0x38ae4a=typeof _0x2493eb[_0xb83e('0x1a')]===_0xb83e('0x1b')&&typeof _0x2493eb['limit']===_0xb83e('0x1b');var _0x509e8d=_0x3060e7[_0xb83e('0x1c')];var _0x2ed2d8=_0x38ae4a?0x0:_0x2493eb[_0xb83e('0x1a')];var _0x2a54eb=_0x38ae4a?_0x3060e7['count']:_0x2493eb[_0xb83e('0x1a')]+_0x2493eb[_0xb83e('0x1d')];var _0x241386;if(_0x2a54eb>=_0x509e8d){_0x2a54eb=_0x509e8d;_0x241386=0xc8;}else{_0x241386=0xce;}_0x5b58ef[_0xb83e('0x1e')](_0x241386);return _0x5b58ef[_0xb83e('0x1f')](_0xb83e('0x20'),_0x2ed2d8+'-'+_0x2a54eb+'/'+_0x509e8d)[_0xb83e('0x19')](_0x3060e7);}return null;};}function patchUpdates(_0x46cebc){return function(_0x53d082){try{jsonpatch[_0xb83e('0x21')](_0x53d082,_0x46cebc,!![]);}catch(_0x146ac1){return BPromise[_0xb83e('0x22')](_0x146ac1);}return _0x53d082['save']();};}function saveUpdates(_0x3a77a6,_0x5b14b0){return function(_0x7b7acf){if(_0x7b7acf){return _0x7b7acf['update'](_0x3a77a6)[_0xb83e('0x23')](function(_0x304892){return _0x304892;});}return null;};}function removeEntity(_0x596bfc,_0x2d1c20){return function(_0x2df54e){if(_0x2df54e){return _0x2df54e[_0xb83e('0x24')]()[_0xb83e('0x23')](function(){var _0xd0fe77=_0x2df54e[_0xb83e('0x25')]({'plain':!![]});var _0x13da02=_0xb83e('0x26');return db[_0xb83e('0x27')][_0xb83e('0x24')]({'where':{'type':_0x13da02,'resourceId':_0xd0fe77['id']}})[_0xb83e('0x23')](function(){return _0x2df54e;});})[_0xb83e('0x23')](function(){_0x596bfc['status'](0xcc)[_0xb83e('0x18')]();});}};}function handleEntityNotFound(_0x1b82ba,_0x2de75b){return function(_0x314211){if(!_0x314211){_0x1b82ba[_0xb83e('0x28')](0x194);}return _0x314211;};}function handleError(_0x4e82b7,_0x1eae3a){_0x1eae3a=_0x1eae3a||0x1f4;return function(_0x38afaa){logger[_0xb83e('0x29')](_0x38afaa[_0xb83e('0x2a')]);if(_0x38afaa[_0xb83e('0x2b')]){delete _0x38afaa[_0xb83e('0x2b')];}_0x4e82b7['status'](_0x1eae3a)[_0xb83e('0x2c')](_0x38afaa);};}exports[_0xb83e('0x2d')]=function(_0x5dbbeb,_0x19e7cf){var _0x423789={},_0x4e57fa={},_0x5b3c5e={'count':0x0,'rows':[]};return db[_0xb83e('0x2e')][_0xb83e('0x2f')]()[_0xb83e('0x23')](function(_0x450371){_0x4e57fa[_0xb83e('0x30')]=_[_0xb83e('0x31')](_0x450371);_0x4e57fa[_0xb83e('0x32')]=_['keys'](_0x5dbbeb[_0xb83e('0x32')]);_0x4e57fa[_0xb83e('0x33')]=_[_0xb83e('0x34')](_0x4e57fa[_0xb83e('0x30')],_0x4e57fa[_0xb83e('0x32')]);_0x423789[_0xb83e('0x35')]=_['intersection'](_0x4e57fa[_0xb83e('0x30')],qs[_0xb83e('0x36')](_0x5dbbeb['query'][_0xb83e('0x36')]));_0x423789[_0xb83e('0x35')]=_0x423789['attributes'][_0xb83e('0x37')]?_0x423789[_0xb83e('0x35')]:_0x4e57fa[_0xb83e('0x30')];if(!_0x5dbbeb['query'][_0xb83e('0x38')](_0xb83e('0x39'))){_0x423789['limit']=qs[_0xb83e('0x1d')](_0x5dbbeb['query'][_0xb83e('0x1d')]);_0x423789[_0xb83e('0x1a')]=qs[_0xb83e('0x1a')](_0x5dbbeb[_0xb83e('0x32')]['offset']);}_0x423789[_0xb83e('0x3a')]=qs['sort'](_0x5dbbeb[_0xb83e('0x32')][_0xb83e('0x3b')]);_0x423789['where']=qs['filters'](_['pick'](_0x5dbbeb[_0xb83e('0x32')],_0x4e57fa['filters']),_0x450371);if(_0x5dbbeb[_0xb83e('0x32')][_0xb83e('0x3c')]){_0x423789[_0xb83e('0x3d')]=_[_0xb83e('0x3e')](_0x423789[_0xb83e('0x3d')],{'$or':_['map'](_0x423789[_0xb83e('0x35')],function(_0x50dadf){var _0x15efb7={};_0x15efb7[_0x50dadf]={'$like':'%'+_0x5dbbeb[_0xb83e('0x32')]['filter']+'%'};return _0x15efb7;})});}_0x423789=_[_0xb83e('0x3e')]({},_0x423789,_0x5dbbeb[_0xb83e('0x3f')]);var _0x21e7c0={'where':_0x423789[_0xb83e('0x3d')]};return db[_0xb83e('0x2e')]['count'](_0x21e7c0)[_0xb83e('0x23')](function(_0x152595){_0x5b3c5e['count']=_0x152595;if(_0x5dbbeb[_0xb83e('0x32')][_0xb83e('0x40')]){_0x423789[_0xb83e('0x41')]=[{'all':!![]}];}return db[_0xb83e('0x2e')][_0xb83e('0x42')](_0x423789);})[_0xb83e('0x23')](function(_0x2aaa08){_0x5b3c5e[_0xb83e('0x43')]=_0x2aaa08;return _0x5b3c5e;})[_0xb83e('0x23')](respondWithFilteredResult(_0x19e7cf,_0x423789))['catch'](handleError(_0x19e7cf,null));})[_0xb83e('0x44')](handleError(_0x19e7cf,null));};exports[_0xb83e('0x45')]=function(_0x3adc57,_0x979161){var _0x3ac676={'raw':![],'where':{'id':_0x3adc57['params']['id']}},_0xb354db={};_0xb354db['model']=_[_0xb83e('0x31')](db[_0xb83e('0x2e')][_0xb83e('0x46')]);_0xb354db[_0xb83e('0x32')]=_[_0xb83e('0x31')](_0x3adc57['query']);_0xb354db[_0xb83e('0x33')]=_[_0xb83e('0x34')](_0xb354db[_0xb83e('0x30')],_0xb354db['query']);_0x3ac676[_0xb83e('0x35')]=_[_0xb83e('0x34')](_0xb354db[_0xb83e('0x30')],qs[_0xb83e('0x36')](_0x3adc57[_0xb83e('0x32')][_0xb83e('0x36')]));_0x3ac676['attributes']=_0x3ac676['attributes'][_0xb83e('0x37')]?_0x3ac676[_0xb83e('0x35')]:_0xb354db[_0xb83e('0x30')];if(_0x3adc57[_0xb83e('0x32')]['includeAll']){_0x3ac676[_0xb83e('0x41')]=[{'all':!![]}];}_0x3ac676=_['merge']({},_0x3ac676,_0x3adc57[_0xb83e('0x3f')]);return db['CmCompany']['find'](_0x3ac676)[_0xb83e('0x23')](handleEntityNotFound(_0x979161,null))[_0xb83e('0x23')](respondWithResult(_0x979161,null))[_0xb83e('0x44')](handleError(_0x979161,null));};exports[_0xb83e('0x47')]=function(_0x100779,_0xed2ba5){return db[_0xb83e('0x2e')][_0xb83e('0x47')](_0x100779[_0xb83e('0x48')],{})[_0xb83e('0x23')](function(_0x986fce){var _0x20e8ed=_0x100779[_0xb83e('0x49')]['get']({'plain':!![]});if(!_0x20e8ed)throw new Error(_0xb83e('0x4a'));if(_0x20e8ed[_0xb83e('0x4b')]===_0xb83e('0x49')){var _0x501250=_0x986fce['get']({'plain':!![]});var _0x3ab38f=_0xb83e('0x26');return db[_0xb83e('0x4c')]['find']({'where':{'name':_0x3ab38f,'userProfileId':_0x20e8ed[_0xb83e('0x4d')]},'raw':!![]})[_0xb83e('0x23')](function(_0x3ff6d0){if(_0x3ff6d0&&_0x3ff6d0[_0xb83e('0x4e')]===0x0){return db['UserProfileResource'][_0xb83e('0x47')]({'name':_0x501250['name'],'resourceId':_0x501250['id'],'type':_0x3ff6d0['name'],'sectionId':_0x3ff6d0['id']},{})[_0xb83e('0x23')](function(){return _0x986fce;});}else{return _0x986fce;}})[_0xb83e('0x44')](function(_0x15da60){logger[_0xb83e('0x29')](_0xb83e('0x4f'),_0x15da60);throw _0x15da60;});}return _0x986fce;})[_0xb83e('0x23')](respondWithResult(_0xed2ba5,0xc9))[_0xb83e('0x44')](handleError(_0xed2ba5,null));};exports['update']=function(_0x528d2e,_0x493716){if(_0x528d2e[_0xb83e('0x48')]['id']){delete _0x528d2e[_0xb83e('0x48')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x528d2e[_0xb83e('0x50')]['id']}})[_0xb83e('0x23')](handleEntityNotFound(_0x493716,null))['then'](saveUpdates(_0x528d2e['body'],null))['then'](respondWithResult(_0x493716,null))[_0xb83e('0x44')](handleError(_0x493716,null));};exports[_0xb83e('0x24')]=function(_0x33f639,_0xe96c9e){return db[_0xb83e('0x2e')][_0xb83e('0x51')]({'where':{'id':_0x33f639[_0xb83e('0x50')]['id']}})[_0xb83e('0x23')](handleEntityNotFound(_0xe96c9e,null))[_0xb83e('0x23')](removeEntity(_0xe96c9e,null))['catch'](handleError(_0xe96c9e,null));};exports[_0xb83e('0x2f')]=function(_0x482be7,_0x171e54){return db[_0xb83e('0x2e')][_0xb83e('0x2f')]()[_0xb83e('0x23')](respondWithResult(_0x171e54,null))['catch'](handleError(_0x171e54,null));};exports[_0xb83e('0x52')]=function(_0x526a48,_0x5e6546,_0x228bbe){return db['CmContact'][_0xb83e('0x51')]({'where':{'id':_0x526a48[_0xb83e('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e6546,null))[_0xb83e('0x23')](function(_0xfdb496){if(_0xfdb496){return _0xfdb496[_0xb83e('0x52')](_0x526a48[_0xb83e('0x48')][_0xb83e('0x53')],_[_0xb83e('0x54')](_0x526a48[_0xb83e('0x48')],[_0xb83e('0x53'),'id'])||{});}})[_0xb83e('0x23')](respondWithResult(_0x5e6546,null))[_0xb83e('0x44')](handleError(_0x5e6546,null));};exports[_0xb83e('0x55')]=function(_0x1f3724,_0x4860fa,_0x326112){var _0x32f5b1={};var _0x5517ea={};var _0x260c2d;var _0x4d66b4;return db['CmCompany'][_0xb83e('0x56')]({'where':{'id':_0x1f3724[_0xb83e('0x50')]['id']}})[_0xb83e('0x23')](handleEntityNotFound(_0x4860fa,null))[_0xb83e('0x23')](function(_0x255251){if(_0x255251){_0x260c2d=_0x255251;_0x5517ea['model']=_[_0xb83e('0x31')](db[_0xb83e('0x57')][_0xb83e('0x46')]);_0x5517ea[_0xb83e('0x32')]=_[_0xb83e('0x31')](_0x1f3724[_0xb83e('0x32')]);_0x5517ea[_0xb83e('0x33')]=_[_0xb83e('0x34')](_0x5517ea['model'],_0x5517ea[_0xb83e('0x32')]);_0x32f5b1[_0xb83e('0x35')]=_[_0xb83e('0x34')](_0x5517ea[_0xb83e('0x30')],qs['fields'](_0x1f3724[_0xb83e('0x32')]['fields']));_0x32f5b1[_0xb83e('0x35')]=_0x32f5b1[_0xb83e('0x35')]['length']?_0x32f5b1[_0xb83e('0x35')]:_0x5517ea[_0xb83e('0x30')];_0x32f5b1[_0xb83e('0x3a')]=qs[_0xb83e('0x3b')](_0x1f3724['query']['sort']);_0x32f5b1[_0xb83e('0x3d')]=qs[_0xb83e('0x33')](_[_0xb83e('0x58')](_0x1f3724['query'],_0x5517ea[_0xb83e('0x33')]));if(_0x1f3724[_0xb83e('0x32')][_0xb83e('0x3c')]){_0x32f5b1[_0xb83e('0x3d')]=_[_0xb83e('0x3e')](_0x32f5b1[_0xb83e('0x3d')],{'$or':_[_0xb83e('0x59')](_0x32f5b1[_0xb83e('0x35')],function(_0xea0004){var _0x22c83b={};_0x22c83b[_0xea0004]={'$like':'%'+_0x1f3724['query']['filter']+'%'};return _0x22c83b;})});}_0x32f5b1=_[_0xb83e('0x3e')]({},_0x32f5b1,_0x1f3724[_0xb83e('0x3f')]);return _0x260c2d[_0xb83e('0x55')](_0x32f5b1);}})[_0xb83e('0x23')](function(_0x31befc){if(_0x31befc){_0x4d66b4=_0x31befc['length'];if(!_0x1f3724['query']['hasOwnProperty'](_0xb83e('0x39'))){_0x32f5b1[_0xb83e('0x1d')]=qs[_0xb83e('0x1d')](_0x1f3724[_0xb83e('0x32')][_0xb83e('0x1d')]);_0x32f5b1[_0xb83e('0x1a')]=qs['offset'](_0x1f3724[_0xb83e('0x32')][_0xb83e('0x1a')]);}return _0x260c2d[_0xb83e('0x55')](_0x32f5b1);}})[_0xb83e('0x23')](function(_0x2c5d45){if(_0x2c5d45){return _0x2c5d45?{'count':_0x4d66b4,'rows':_0x2c5d45}:null;}})[_0xb83e('0x23')](respondWithResult(_0x4860fa,null))[_0xb83e('0x44')](handleError(_0x4860fa,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index bde1e06..c9be79d 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 _0x7327=['./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','rimraf'];(function(_0x6fa3d0,_0x408ce3){var _0xabfdf3=function(_0x5af796){while(--_0x5af796){_0x6fa3d0['push'](_0x6fa3d0['shift']());}};_0xabfdf3(++_0x408ce3);}(_0x7327,0x17c));var _0x7732=function(_0x2626fe,_0x52df45){_0x2626fe=_0x2626fe-0x0;var _0x15baa2=_0x7327[_0x2626fe];return _0x15baa2;};'use strict';var _=require(_0x7732('0x0'));var util=require(_0x7732('0x1'));var logger=require(_0x7732('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7732('0x3'));var config=require('../../config/environment');var attributes=require(_0x7732('0x4'));module[_0x7732('0x5')]=function(_0x2398ff,_0x4c6c21){return _0x2398ff['define'](_0x7732('0x6'),attributes,{'tableName':_0x7732('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc673=['rimraf','../../config/environment','exports','define','cm_companies','lodash','../../config/logger','api','moment','request-promise'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0xc673,0x73));var _0x3c67=function(_0x45dbf9,_0x56cfff){_0x45dbf9=_0x45dbf9-0x0;var _0x4f2a10=_0xc673[_0x45dbf9];return _0x4f2a10;};'use strict';var _=require(_0x3c67('0x0'));var util=require('util');var logger=require(_0x3c67('0x1'))(_0x3c67('0x2'));var moment=require(_0x3c67('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c67('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c67('0x5'));var config=require(_0x3c67('0x6'));var attributes=require('./cmCompany.attributes');module[_0x3c67('0x7')]=function(_0x5d29d0,_0x490335){return _0x5d29d0[_0x3c67('0x8')]('CmCompany',attributes,{'tableName':_0x3c67('0x9'),'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 8e3afe1..e96c06e 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 _0xd873=['rpc','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd873,0x1f1));var _0x3d87=function(_0x2f5baf,_0x1bd700){_0x2f5baf=_0x2f5baf-0x0;var _0x55f24b=_0xd873[_0x2f5baf];return _0x55f24b;};'use strict';var _=require(_0x3d87('0x0'));var util=require(_0x3d87('0x1'));var moment=require(_0x3d87('0x2'));var BPromise=require(_0x3d87('0x3'));var rs=require(_0x3d87('0x4'));var fs=require('fs');var Redis=require(_0x3d87('0x5'));var db=require(_0x3d87('0x6'))['db'];var utils=require(_0x3d87('0x7'));var logger=require(_0x3d87('0x8'))(_0x3d87('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9924,_0xe20fcd,_0x5317da){return new BPromise(function(_0x40e7a7,_0x387168){return client[_0x3d87('0xa')](_0x2f9924,_0x5317da)[_0x3d87('0xb')](function(_0x3bee5d){logger[_0x3d87('0xc')](_0x3d87('0xd'),_0xe20fcd,_0x3d87('0xe'));logger[_0x3d87('0xf')](_0x3d87('0x10'),_0xe20fcd,_0x3d87('0xe'),JSON[_0x3d87('0x11')](_0x3bee5d));if(_0x3bee5d['error']){if(_0x3bee5d[_0x3d87('0x12')][_0x3d87('0x13')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xe20fcd,_0x3bee5d[_0x3d87('0x12')][_0x3d87('0x14')]);return _0x387168(_0x3bee5d[_0x3d87('0x12')][_0x3d87('0x14')]);}logger[_0x3d87('0x12')](_0x3d87('0xd'),_0xe20fcd,_0x3bee5d[_0x3d87('0x12')]['message']);return _0x40e7a7(_0x3bee5d[_0x3d87('0x12')][_0x3d87('0x14')]);}else{logger[_0x3d87('0xc')](_0x3d87('0xd'),_0xe20fcd,_0x3d87('0xe'));_0x40e7a7(_0x3bee5d['result'][_0x3d87('0x14')]);}})[_0x3d87('0x15')](function(_0x422431){logger[_0x3d87('0x12')](_0x3d87('0xd'),_0xe20fcd,_0x422431);_0x387168(_0x422431);});});} \ No newline at end of file +var _0xeb40=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xeb40,0x177));var _0x0eb4=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xeb40[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x0eb4('0x0'));var util=require(_0x0eb4('0x1'));var moment=require(_0x0eb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x0eb4('0x3'));var fs=require('fs');var Redis=require(_0x0eb4('0x4'));var db=require(_0x0eb4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0eb4('0x6'));var config=require(_0x0eb4('0x7'));var jayson=require(_0x0eb4('0x8'));var client=jayson[_0x0eb4('0x9')][_0x0eb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x184e2f,_0x283d63,_0x78f97d){return new BPromise(function(_0x55c785,_0x2009bc){return client[_0x0eb4('0xb')](_0x184e2f,_0x78f97d)[_0x0eb4('0xc')](function(_0x3d1c0e){logger[_0x0eb4('0xd')](_0x0eb4('0xe'),_0x283d63,'request\x20sent');logger[_0x0eb4('0xf')](_0x0eb4('0x10'),_0x283d63,_0x0eb4('0x11'),JSON['stringify'](_0x3d1c0e));if(_0x3d1c0e[_0x0eb4('0x12')]){if(_0x3d1c0e[_0x0eb4('0x12')][_0x0eb4('0x13')]===0x1f4){logger['error'](_0x0eb4('0xe'),_0x283d63,_0x3d1c0e['error']['message']);return _0x2009bc(_0x3d1c0e['error'][_0x0eb4('0x14')]);}logger[_0x0eb4('0x12')]('CmCompany,\x20%s,\x20%s',_0x283d63,_0x3d1c0e['error'][_0x0eb4('0x14')]);return _0x55c785(_0x3d1c0e[_0x0eb4('0x12')]['message']);}else{logger[_0x0eb4('0xd')]('CmCompany,\x20%s,\x20%s',_0x283d63,_0x0eb4('0x11'));_0x55c785(_0x3d1c0e[_0x0eb4('0x15')][_0x0eb4('0x14')]);}})[_0x0eb4('0x16')](function(_0x5d6f0a){logger[_0x0eb4('0x12')](_0x0eb4('0xe'),_0x283d63,_0x5d6f0a);_0x2009bc(_0x5d6f0a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c91aa48..0ddae93 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 _0x15d7=['create','post','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0x15d7,0x1db));var _0x715d=function(_0x12986b,_0x2e4653){_0x12986b=_0x12986b-0x0;var _0x578ce6=_0x15d7[_0x12986b];return _0x578ce6;};'use strict';var multer=require(_0x715d('0x0'));var util=require(_0x715d('0x1'));var path=require(_0x715d('0x2'));var timeout=require(_0x715d('0x3'));var express=require('express');var router=express[_0x715d('0x4')]();var fs_extra=require(_0x715d('0x5'));var auth=require(_0x715d('0x6'));var interaction=require(_0x715d('0x7'));var config=require(_0x715d('0x8'));var controller=require(_0x715d('0x9'));router[_0x715d('0xa')]('/',auth[_0x715d('0xb')](),controller[_0x715d('0xc')]);router[_0x715d('0xa')](_0x715d('0xd'),auth[_0x715d('0xb')](),controller[_0x715d('0xe')]);router[_0x715d('0xa')](_0x715d('0xf'),auth[_0x715d('0xb')](),controller[_0x715d('0x10')]);router[_0x715d('0xa')](_0x715d('0x11'),auth[_0x715d('0xb')](),controller[_0x715d('0x12')]);router['post']('/',auth[_0x715d('0xb')](),controller[_0x715d('0x13')]);router[_0x715d('0x14')](_0x715d('0x11'),auth['isAuthenticated'](),controller[_0x715d('0x15')]);router[_0x715d('0x16')](_0x715d('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x715d('0x17')](_0x715d('0xf'),auth[_0x715d('0xb')](),controller[_0x715d('0x18')]);module[_0x715d('0x19')]=router; \ No newline at end of file +var _0x9888=['delete','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','create','addContacts','put','update'];(function(_0x3a84cc,_0x1da9fa){var _0x129257=function(_0x41bb44){while(--_0x41bb44){_0x3a84cc['push'](_0x3a84cc['shift']());}};_0x129257(++_0x1da9fa);}(_0x9888,0x15c));var _0x8988=function(_0x382d22,_0x2e3eb0){_0x382d22=_0x382d22-0x0;var _0x22d509=_0x9888[_0x382d22];return _0x22d509;};'use strict';var multer=require('multer');var util=require(_0x8988('0x0'));var path=require('path');var timeout=require(_0x8988('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8988('0x2'));var auth=require(_0x8988('0x3'));var interaction=require(_0x8988('0x4'));var config=require(_0x8988('0x5'));var controller=require(_0x8988('0x6'));router[_0x8988('0x7')]('/',auth[_0x8988('0x8')](),controller[_0x8988('0x9')]);router[_0x8988('0x7')](_0x8988('0xa'),auth[_0x8988('0x8')](),controller[_0x8988('0xb')]);router[_0x8988('0x7')](_0x8988('0xc'),auth[_0x8988('0x8')](),controller[_0x8988('0xd')]);router['get'](_0x8988('0xe'),auth[_0x8988('0x8')](),controller[_0x8988('0xf')]);router['post']('/',auth[_0x8988('0x8')](),controller[_0x8988('0x10')]);router['post'](_0x8988('0xe'),auth[_0x8988('0x8')](),controller[_0x8988('0x11')]);router[_0x8988('0x12')]('/:id',auth[_0x8988('0x8')](),controller[_0x8988('0x13')]);router[_0x8988('0x14')]('/:id',auth[_0x8988('0x8')](),controller[_0x8988('0x15')]);module[_0x8988('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7a9802c..e4ec448 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 _0x24b2=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','STRING','TEXT'];(function(_0x29f43c,_0x3e5b71){var _0x4ea841=function(_0x5de256){while(--_0x5de256){_0x29f43c['push'](_0x29f43c['shift']());}};_0x4ea841(++_0x3e5b71);}(_0x24b2,0x11c));var _0x224b=function(_0x59c389,_0x19e789){_0x59c389=_0x59c389-0x0;var _0x2d35c6=_0x24b2[_0x59c389];return _0x2d35c6;};'use strict';var _=require(_0x224b('0x0'));var Sequelize=require(_0x224b('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x224b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x224b('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x224b('0x2')]},'description':{'type':Sequelize[_0x224b('0x3')]},'phone':{'type':Sequelize[_0x224b('0x2')]},'mobile':{'type':Sequelize[_0x224b('0x2')]},'fax':{'type':Sequelize[_0x224b('0x2')]},'email':{'type':Sequelize[_0x224b('0x2')]},'url':{'type':Sequelize[_0x224b('0x2')]},'facebook':{'type':Sequelize[_0x224b('0x2')]},'fb_data':{'type':Sequelize[_0x224b('0x2')]},'twitter':{'type':Sequelize[_0x224b('0x2')]},'skype':{'type':Sequelize[_0x224b('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x224b('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x224b('0x2')]},'telegram':{'type':Sequelize[_0x224b('0x2')]},'UserId':{'type':Sequelize[_0x224b('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x224b('0x2')]},'priority':{'type':Sequelize[_0x224b('0x4')](0x2)[_0x224b('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x224b('0x6')],'defaultValue':Sequelize[_0x224b('0x7')]},'dialTimezone':{'type':Sequelize[_0x224b('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x84ca=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84ca,0x1b9));var _0xa84c=function(_0x35c3a6,_0x2796d4){_0x35c3a6=_0x35c3a6-0x0;var _0x11a9e6=_0x84ca[_0x35c3a6];return _0x11a9e6;};'use strict';var _=require(_0xa84c('0x0'));var Sequelize=require(_0xa84c('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xa84c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa84c('0x2')]},'street':{'type':Sequelize[_0xa84c('0x2')]},'postalCode':{'type':Sequelize[_0xa84c('0x2')]},'city':{'type':Sequelize[_0xa84c('0x2')]},'country':{'type':Sequelize[_0xa84c('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa84c('0x2')]},'description':{'type':Sequelize[_0xa84c('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa84c('0x2')]},'fax':{'type':Sequelize[_0xa84c('0x2')]},'email':{'type':Sequelize[_0xa84c('0x2')]},'url':{'type':Sequelize[_0xa84c('0x2')]},'facebook':{'type':Sequelize[_0xa84c('0x2')]},'fb_data':{'type':Sequelize[_0xa84c('0x2')]},'twitter':{'type':Sequelize[_0xa84c('0x2')]},'skype':{'type':Sequelize[_0xa84c('0x2')]},'teams':{'type':Sequelize[_0xa84c('0x2')]},'viber':{'type':Sequelize[_0xa84c('0x2')]},'line':{'type':Sequelize[_0xa84c('0x2')]},'wechat':{'type':Sequelize[_0xa84c('0x2')]},'telegram':{'type':Sequelize[_0xa84c('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xa84c('0x2')]},'priority':{'type':Sequelize[_0xa84c('0x4')](0x2)[_0xa84c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa84c('0x6')],'defaultValue':Sequelize[_0xa84c('0x7')]},'dialTimezone':{'type':Sequelize[_0xa84c('0x2')]},'utcOffset':{'type':Sequelize[_0xa84c('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 03ccac3..1d557df 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 _0xf803=['additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','all','show','find','Tag','Tags','tag','ItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','omit','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','text','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','pick','options','nolimit','getTags','setTags','ids','setAdditionalPhones','ContactItemType','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','OrderBy','ItemType.OrderBy','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','sort','ContactId','filter','include','CmHopperHistory','includeAll','rows','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','upload','parse','meta','import','agent','No\x20ListId\x20specified','binding','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','pid','importUpdates','User','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csvUpdates','exit','mail','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','destination','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','color','DESC','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','substatus','externalUrl','Interaction','sortBy','reverse','value','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','sendStatus','error','stack','name','send','index','describe','query','catch','CmContact','params','tags','keys','startsWith','columnName','displayName','CmCustomField','length','cf_','alias','custom','type','values','forEach','hasOwnProperty','merge','body','findAll','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','isNil','dialTimezone','timezones','utcOffset'];(function(_0x41dec0,_0x415215){var _0x4083ac=function(_0x45ecd6){while(--_0x45ecd6){_0x41dec0['push'](_0x41dec0['shift']());}};_0x4083ac(++_0x415215);}(_0xf803,0x196));var _0x3f80=function(_0x560cdd,_0x2667d7){_0x560cdd=_0x560cdd-0x0;var _0x10f689=_0xf803[_0x560cdd];return _0x10f689;};'use strict';var moment=require(_0x3f80('0x0'));var BPromise=require(_0x3f80('0x1'));var util=require('util');var path=require(_0x3f80('0x2'));var fs=require('fs');var _=require(_0x3f80('0x3'));var squel=require('squel');var Papa=require(_0x3f80('0x4'));var Redis=require(_0x3f80('0x5'));var contacts=require(_0x3f80('0x6'));var qs=require(_0x3f80('0x7'));var logger=require(_0x3f80('0x8'))(_0x3f80('0x9'));var config=require(_0x3f80('0xa'));var shared=require(_0x3f80('0xb'));var db=require(_0x3f80('0xc'))['db'];config[_0x3f80('0xd')]=_[_0x3f80('0xe')](config[_0x3f80('0xd')],{'host':_0x3f80('0xf'),'port':0x18eb});var socket=require(_0x3f80('0x10'))(new Redis(config[_0x3f80('0xd')]));require(_0x3f80('0x11'))['register'](socket);function respondWithResult(_0x39a901,_0x51c226){_0x51c226=_0x51c226||0xc8;return function(_0xbf9484){if(_0xbf9484){return _0x39a901['status'](_0x51c226)[_0x3f80('0x12')](_0xbf9484);}};}function respondWithFilteredResult(_0x251d07,_0x44bfa4){return function(_0x2d8a67){if(_0x2d8a67){var _0x2e05a9=typeof _0x44bfa4[_0x3f80('0x13')]===_0x3f80('0x14')&&typeof _0x44bfa4[_0x3f80('0x15')]===_0x3f80('0x14');var _0x473e28=_0x2d8a67[_0x3f80('0x16')];var _0x41608a=_0x2e05a9?0x0:_0x44bfa4[_0x3f80('0x13')];var _0x463cdc=_0x2e05a9?_0x2d8a67[_0x3f80('0x16')]:_0x44bfa4['offset']+_0x44bfa4['limit'];var _0x356483;if(_0x463cdc>=_0x473e28){_0x463cdc=_0x473e28;_0x356483=0xc8;}else{_0x356483=0xce;}_0x251d07[_0x3f80('0x17')](_0x356483);return _0x251d07[_0x3f80('0x18')](_0x3f80('0x19'),_0x41608a+'-'+_0x463cdc+'/'+_0x473e28)[_0x3f80('0x12')](_0x2d8a67);}return null;};}function saveUpdates(_0x44746c){return function(_0x5e3386){if(_0x5e3386){return _0x5e3386['update'](_0x44746c)[_0x3f80('0x1a')](function(_0x30f4de){return _0x30f4de;});}return null;};}function removeEntity(_0x31fb4f){return function(_0x12fa02){if(_0x12fa02){return _0x12fa02[_0x3f80('0x1b')]()[_0x3f80('0x1a')](function(){_0x31fb4f[_0x3f80('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x591d2e){return function(_0x40816e){if(!_0x40816e){_0x591d2e[_0x3f80('0x1c')](0x194);}return _0x40816e;};}function handleError(_0x724b1b,_0x3ed0b3){_0x3ed0b3=_0x3ed0b3||0x1f4;return function(_0x34faa0){logger[_0x3f80('0x1d')](_0x34faa0[_0x3f80('0x1e')]);if(_0x34faa0['name']){delete _0x34faa0[_0x3f80('0x1f')];}_0x724b1b[_0x3f80('0x17')](_0x3ed0b3)[_0x3f80('0x20')](_0x34faa0);};}exports[_0x3f80('0x21')]=function(_0x2d8a63,_0x16bbf6){var _0x2bb979={};return contacts[_0x3f80('0x22')]()[_0x3f80('0x1a')](function(_0x3b5403){_0x2bb979=qs['getOptions'](_0x3b5403,_0x2d8a63);return contacts['findAll'](_0x2d8a63[_0x3f80('0x23')],_0x2d8a63['user'],_0x2bb979,_0x3b5403);})[_0x3f80('0x1a')](respondWithFilteredResult(_0x16bbf6,_0x2bb979))[_0x3f80('0x24')](handleError(_0x16bbf6,null));};exports['destroy']=function(_0x1a865c,_0x2d4226){return db[_0x3f80('0x25')]['find']({'where':{'id':_0x1a865c[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0x2d4226,null))[_0x3f80('0x1a')](removeEntity(_0x2d4226,null))['catch'](handleError(_0x2d4226,null));};exports[_0x3f80('0x22')]=function(_0x43975f,_0x40b525){return db[_0x3f80('0x25')][_0x3f80('0x22')]()['then'](function(_0x182445){delete _0x182445[_0x3f80('0x27')];for(var _0x4ad59f=0x0;_0x4ad59f0x0){return new Promise(function(_0x529211){var _0x532c08=[];for(var _0x56d8bb=0x0;_0x56d8bb<_0x460f77[_0x3f80('0x2d')];_0x56d8bb++){_0x532c08[_0x3f80('0x60')](insertAdditionalPhones(_0x460f77[_0x56d8bb]['contact'],_0x460f77[_0x56d8bb][_0x3f80('0x5a')]));}Promise[_0x3f80('0x63')](_0x532c08)[_0x3f80('0x1a')](function(){_0x529211(0x1);});})['then'](function(){return{'success':_0x3423f8,'failure':_0x5ef2e4,'duplicates':_0x22d4f1};});}else{return{'success':_0x3423f8,'failure':_0x5ef2e4,'duplicates':_0x22d4f1};}}})['then'](respondWithResult(_0x41cc4a,0xc9))[_0x3f80('0x24')](handleError(_0x41cc4a,null));};exports[_0x3f80('0x64')]=function(_0x1aeff9,_0x41ef19){var _0x1d192e;return db['CmContact'][_0x3f80('0x22')]()[_0x3f80('0x1a')](function(_0x5e6fa7){return db[_0x3f80('0x25')][_0x3f80('0x65')]({'where':{'id':_0x1aeff9[_0x3f80('0x26')]['id']},'include':[{'model':db[_0x3f80('0x66')],'as':_0x3f80('0x67'),'attributes':['id',_0x3f80('0x1f'),'color'],'required':_0x1aeff9[_0x3f80('0x23')][_0x3f80('0x68')]?!![]:![]},{'model':db[_0x3f80('0x4d')],'as':'Phones','where':{'CmContactId':_0x1aeff9[_0x3f80('0x26')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x3f80('0x69')}]}],'order':[db[_0x3f80('0x6a')][_0x3f80('0x6b')](_0x3f80('0x6c'))],'attributes':_['keys'](_0x5e6fa7)});})['then'](function(_0xf9ca41){if(!_['isNil'](_0xf9ca41)){_0x1d192e=_0xf9ca41[_0x3f80('0x38')]({'plain':!![]});var _0x163c8d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf9ca41&&_0xf9ca41[_0x3f80('0x61')]){if(_0xf9ca41[_0x3f80('0x61')]){_0x163c8d['where'][_0x3f80('0x6d')][_0x3f80('0x60')]({'ListId':{'$ne':_0xf9ca41['ListId']}});}}return db['CmCustomField'][_0x3f80('0x37')](_0x163c8d);}})[_0x3f80('0x1a')](function(_0x2f3e6d){if(!_['isNil'](_0x2f3e6d)){return _['omit'](_0x1d192e,_[_0x3f80('0x6e')](_0x2f3e6d,function(_0x6a40a6){return util[_0x3f80('0x6f')](_0x3f80('0x70'),_0x6a40a6['id']);}));}})[_0x3f80('0x1a')](handleEntityNotFound(_0x41ef19,null))[_0x3f80('0x1a')](respondWithResult(_0x41ef19,null))[_0x3f80('0x24')](handleError(_0x41ef19,null));};exports[_0x3f80('0x44')]=function(_0x2a891e,_0xba0a1){var _0x587a75;if(_0x2a891e['body']['id']){delete _0x2a891e[_0x3f80('0x36')]['id'];}if(!_[_0x3f80('0x56')](_0x2a891e[_0x3f80('0x36')][_0x3f80('0x57')])){var _0x617de8=_0x2a891e[_0x3f80('0x36')][_0x3f80('0x57')];if(!_[_0x3f80('0x56')](shared[_0x3f80('0x58')][_0x617de8]))_0x2a891e[_0x3f80('0x36')][_0x3f80('0x59')]=shared[_0x3f80('0x58')][_0x617de8][_0x3f80('0x59')];}return db[_0x3f80('0x25')][_0x3f80('0x65')]({'where':{'id':_0x2a891e[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0xba0a1,null))[_0x3f80('0x1a')](saveUpdates(_0x2a891e[_0x3f80('0x36')],null))[_0x3f80('0x1a')](function(_0x343a48){_0x587a75=_0x343a48;var _0x4f795e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x343a48&&_0x343a48['ListId']){if(_0x343a48[_0x3f80('0x61')]){_0x4f795e['where'][_0x3f80('0x6d')][_0x3f80('0x60')]({'ListId':{'$ne':_0x343a48['ListId']}});}}return db[_0x3f80('0x2c')]['findAll'](_0x4f795e);})['then'](function(_0x12e20b){if(_0x12e20b){return _[_0x3f80('0x71')](_[_0x3f80('0x72')](_0x2a891e['body'],function(_0x1d60e3,_0x5d45d5){return _[_0x3f80('0x29')](_0x5d45d5,'cf_');}),_['map'](_0x12e20b,function(_0x1d3a7c){return util[_0x3f80('0x6f')]('cf_%d',_0x1d3a7c['id']);}));}})['then'](function(_0x350244){if(_0x350244&&!_['isEmpty'](_0x350244)){var _0x1cc768=squel['update']()[_0x3f80('0x73')](_0x3f80('0x74'))[_0x3f80('0x75')](_0x350244)[_0x3f80('0x5e')](_0x3f80('0x76'),_0x2a891e['params']['id'])[_0x3f80('0x77')]();return db[_0x3f80('0x6a')]['query'](_0x1cc768[_0x3f80('0x78')],{'replacements':_0x1cc768[_0x3f80('0x32')]});}})['then'](function(){if(_0x2a891e['body'][_0x3f80('0x79')]&&_0x587a75){return db['CmHopper'][_0x3f80('0x44')]({'phone':_0x2a891e[_0x3f80('0x36')][_0x3f80('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x587a75['id']}});}})[_0x3f80('0x1a')](function(){return _0x587a75;})['then'](respondWithResult(_0xba0a1,null))[_0x3f80('0x24')](handleError(_0xba0a1,null));};exports['getTags']=function(_0x2125bd,_0x91a8b){var _0x1f94ad={};var _0x51dff7={};var _0x57da99;var _0x36cb65;return db[_0x3f80('0x25')][_0x3f80('0x7a')]({'where':{'id':_0x2125bd[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0x91a8b,null))[_0x3f80('0x1a')](function(_0xb0603b){if(_0xb0603b){_0x57da99=_0xb0603b;_0x51dff7[_0x3f80('0x7b')]=_[_0x3f80('0x28')](db[_0x3f80('0x66')][_0x3f80('0x7c')]);_0x51dff7[_0x3f80('0x23')]=_['keys'](_0x2125bd[_0x3f80('0x23')]);_0x51dff7[_0x3f80('0x7d')]=_[_0x3f80('0x7e')](_0x51dff7[_0x3f80('0x7b')],_0x51dff7[_0x3f80('0x23')]);_0x1f94ad[_0x3f80('0x7f')]=_[_0x3f80('0x7e')](_0x51dff7[_0x3f80('0x7b')],qs[_0x3f80('0x80')](_0x2125bd[_0x3f80('0x23')][_0x3f80('0x80')]));_0x1f94ad[_0x3f80('0x7f')]=_0x1f94ad[_0x3f80('0x7f')][_0x3f80('0x2d')]?_0x1f94ad[_0x3f80('0x7f')]:_0x51dff7[_0x3f80('0x7b')];_0x1f94ad[_0x3f80('0x81')]=qs['sort'](_0x2125bd['query']['sort']);_0x1f94ad[_0x3f80('0x5e')]=qs[_0x3f80('0x7d')](_[_0x3f80('0x82')](_0x2125bd[_0x3f80('0x23')],_0x51dff7['filters']));if(_0x2125bd[_0x3f80('0x23')]['filter']){_0x1f94ad['where']=_[_0x3f80('0x35')](_0x1f94ad[_0x3f80('0x5e')],{'$or':_[_0x3f80('0x6e')](_0x1f94ad[_0x3f80('0x7f')],function(_0x26c326){var _0x2d74b2={};_0x2d74b2[_0x26c326]={'$like':'%'+_0x2125bd[_0x3f80('0x23')]['filter']+'%'};return _0x2d74b2;})});}_0x1f94ad=_[_0x3f80('0x35')]({},_0x1f94ad,_0x2125bd[_0x3f80('0x83')]);return _0x57da99['getTags'](_0x1f94ad);}})[_0x3f80('0x1a')](function(_0x67f9f9){if(_0x67f9f9){_0x36cb65=_0x67f9f9[_0x3f80('0x2d')];if(!_0x2125bd[_0x3f80('0x23')][_0x3f80('0x34')](_0x3f80('0x84'))){_0x1f94ad[_0x3f80('0x15')]=qs['limit'](_0x2125bd[_0x3f80('0x23')]['limit']);_0x1f94ad['offset']=qs[_0x3f80('0x13')](_0x2125bd[_0x3f80('0x23')][_0x3f80('0x13')]);}return _0x57da99[_0x3f80('0x85')](_0x1f94ad);}})[_0x3f80('0x1a')](function(_0x5d7e0e){if(_0x5d7e0e){return _0x5d7e0e?{'count':_0x36cb65,'rows':_0x5d7e0e}:null;}})[_0x3f80('0x1a')](respondWithResult(_0x91a8b,null))[_0x3f80('0x24')](handleError(_0x91a8b,null));};exports[_0x3f80('0x86')]=function(_0x323441,_0x5b20e6){if(_0x323441[_0x3f80('0x36')]['id']){delete _0x323441[_0x3f80('0x36')]['id'];}return db[_0x3f80('0x25')][_0x3f80('0x7a')]({'where':{'id':_0x323441[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0x5b20e6,null))[_0x3f80('0x1a')](function(_0xe69c1a){if(_0xe69c1a){return _0xe69c1a['setTags'](_0x323441[_0x3f80('0x36')][_0x3f80('0x87')]||[]);}return null;})[_0x3f80('0x1a')](respondWithResult(_0x5b20e6,null))['catch'](handleError(_0x5b20e6,null));};exports[_0x3f80('0x88')]=function(_0x205170,_0x11c6c7){var _0x26f761=[];_0x26f761[_0x3f80('0x60')](addAdditionalPhones(_0x205170['body']));Promise['all'](_0x26f761)['then'](function(){_0x26f761=[];_0x26f761[_0x3f80('0x60')](deleteCmHopperPhones(_0x205170[_0x3f80('0x36')]['id']));_0x26f761[_0x3f80('0x60')](addCmHopperPhones(_0x205170['body']['id']));Promise[_0x3f80('0x63')](_0x26f761)[_0x3f80('0x1a')](function(){return[0x1];})[_0x3f80('0x1a')](respondWithResult(_0x11c6c7,null));});};function addAdditionalPhones(_0x11a5cf){var _0x3bfcab;return new Promise(function(_0x5b7003){return db['CmContactHasItem'][_0x3f80('0x1b')]({'where':{'CmContactId':_0x11a5cf['id']}})[_0x3f80('0x1a')](function(){db[_0x3f80('0x89')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})[_0x3f80('0x1a')](function(_0x3cca3f){var _0x5acab8=[];for(var _0x3b9c73=0x0;_0x3b9c73<_0x11a5cf[_0x3f80('0x8a')][_0x3f80('0x2d')];_0x3b9c73++){var _0x3435be=_0x11a5cf[_0x3f80('0x8b')]?_[_0x3f80('0x56')](_0x11a5cf[_0x3f80('0x8b')][_0x3b9c73])?'':_0x11a5cf[_0x3f80('0x8b')][_0x3b9c73]:_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x8c')]?_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x8c')]:'';var _0x512156=_[_0x3f80('0x56')](_0x11a5cf['items'][_0x3b9c73][_0x3f80('0x8d')])?'':_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x8d')];var _0x1bfa76=_0x3435be+':'+_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x79')]+'§'+_0x512156;if(_[_0x3f80('0x56')](_0x3bfcab))_0x3bfcab=_0x1bfa76;else _0x3bfcab+=';'+_0x1bfa76;var _0xd8afc1=null;var _0x5c28df=null;if(_0x11a5cf[_0x3f80('0x8b')]){if(!_[_0x3f80('0x56')](_0x11a5cf[_0x3f80('0x8b')][_0x3b9c73])){_0x5c28df=_['find'](_0x3cca3f,function(_0x5e39c7){return _0x5e39c7['id']===_0x11a5cf[_0x3f80('0x8b')][_0x3b9c73];});if(!_['isNil'](_0x5c28df)){_0xd8afc1=_0x5c28df['OrderBy'];}}}else{if(!_[_0x3f80('0x56')](_0x11a5cf['items'][_0x3b9c73])){_0x5c28df=_[_0x3f80('0x65')](_0x3cca3f,function(_0x3b84f4){return _0x3b84f4['id']===_0x11a5cf['items'][_0x3b9c73][_0x3f80('0x8c')];});if(!_['isNil'](_0x5c28df)){_0xd8afc1=_0x3b9c73;}}}if(_[_0x3f80('0x56')](_0xd8afc1)){_0xd8afc1=0x64;}_0x5acab8[_0x3f80('0x60')](addAdditionalPhone(_0x11a5cf['id'],_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x79')],_0x11a5cf[_0x3f80('0x8b')]?_[_0x3f80('0x56')](_0x11a5cf[_0x3f80('0x8b')][_0x3b9c73])?null:_0x11a5cf['item_types'][_0x3b9c73]:_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73][_0x3f80('0x8c')]?_0x11a5cf[_0x3f80('0x8a')][_0x3b9c73]['ItemTypeId']:null,_0xd8afc1,_0x512156));}Promise[_0x3f80('0x63')](_0x5acab8)['then'](function(){db['CmContact'][_0x3f80('0x44')]({'AdditionalPhones':_0x3bfcab},{'where':{'id':_0x11a5cf['id']}})[_0x3f80('0x1a')](function(){_0x5b7003(0x1);});});});});});}function addAdditionalPhone(_0x2ebf24,_0x46eea1,_0x541dea,_0x597001,_0x59d47b){return db[_0x3f80('0x4d')]['find']({'where':{'CmContactId':_0x2ebf24,'item':_0x46eea1}})[_0x3f80('0x1a')](function(_0xdb3163){if(_0xdb3163)logger['info'](_0x3f80('0x8e'),_0xdb3163);else{db[_0x3f80('0x4d')]['create']({'CmContactId':_0x2ebf24,'item':_0x46eea1,'ItemTypeId':_0x541dea,'OrderBy':_0x597001,'ItemClass':_0x3f80('0x8f'),'description':_0x59d47b});}});}function deleteCmHopperPhones(_0x378ec3){return new Promise(function(_0x4cf936){return db[_0x3f80('0x3f')][_0x3f80('0x37')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x378ec3}})[_0x3f80('0x1a')](function(_0x101cfc){db[_0x3f80('0x90')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x3f80('0x6e')](_0x101cfc,'id')}}});})[_0x3f80('0x1a')](function(){_0x4cf936(0x1);});});}function addCmHopperPhones(_0x52041d){return new Promise(function(_0x360d62){return db[_0x3f80('0x3f')][_0x3f80('0x37')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x52041d}})[_0x3f80('0x1a')](function(_0x1ac7c7){var _0x51c2f6=[];_[_0x3f80('0x6e')](_0x1ac7c7,function(_0x5d7cc4){_0x51c2f6[_0x3f80('0x60')](createCmHopperPhone(_0x52041d,_0x5d7cc4['id']));});Promise[_0x3f80('0x63')](_0x51c2f6)[_0x3f80('0x1a')](function(){_0x360d62(0x1);});});});}function createCmHopperPhone(_0x738ea9,_0x4e5da1){return new Promise(function(_0x3be32a){db[_0x3f80('0x4d')][_0x3f80('0x37')]({'raw':!![],'attributes':[_0x3f80('0x91'),_0x3f80('0x92')],'where':{'CmContactId':_0x738ea9,'ItemClass':_0x3f80('0x8f')},'include':[{'model':db[_0x3f80('0x89')],'attributes':['OrderBy'],'as':'ItemType'}],'order':[_0x3f80('0x92'),db[_0x3f80('0x6a')]['literal']('`ItemType`.OrderBy')]})[_0x3f80('0x1a')](function(_0x10b10e){var _0x19cde5=0x1;var _0x122685=_['map'](_0x10b10e,function(_0x34dc8e){_0x34dc8e['CmHopperId']=_0x4e5da1;_0x34dc8e['phone']=_0x34dc8e[_0x3f80('0x91')];_0x34dc8e[_0x3f80('0x92')]=_0x19cde5;delete _0x34dc8e[_0x3f80('0x93')];_0x19cde5=_0x19cde5+0x1;return _0x34dc8e;});return db[_0x3f80('0x90')][_0x3f80('0x5b')](_0x122685,{});})[_0x3f80('0x1a')](function(){_0x3be32a(0x1);});});}function insertAdditionalPhones(_0x56c694,_0x1cd71e){return new Promise(function(_0x26f8f5){var _0x4570be=[];for(var _0x1f9470=0x0;_0x1f9470<_0x1cd71e['length'];_0x1f9470++){var _0x1427d4=_0x1cd71e[_0x1f9470];_0x4570be['push'](parseContactItemType(_0x1427d4));}Promise['all'](_0x4570be)[_0x3f80('0x1a')](function(){var _0xa68a2d={'id':_0x56c694['id'],'items':_0x1cd71e};return addAdditionalPhones(_0xa68a2d)[_0x3f80('0x1a')](function(){return addCmHopperPhones(_0x56c694['id']);});})[_0x3f80('0x1a')](function(){_0x26f8f5(_0x56c694);});});}function parseContactItemType(_0x284abb){return new Promise(function(_0x2e01bc){if(_0x284abb[_0x3f80('0x34')](_0x3f80('0x8c'))){_0x2e01bc(_0x284abb);}else{return db[_0x3f80('0x89')]['find']({'where':{'name':_0x284abb[_0x3f80('0x69')]}})[_0x3f80('0x1a')](function(_0x3e12cb){if(_['isNil'](_0x3e12cb))_0x284abb['ItemTypeId']=null;else _0x284abb[_0x3f80('0x8c')]=_0x3e12cb['id'];_0x2e01bc(_0x284abb);});}});}exports['getAdditionalPhones']=function(_0x49ffd8,_0x379614){return db[_0x3f80('0x4d')][_0x3f80('0x37')]({'raw':!![],'where':{'CmContactId':_0x49ffd8[_0x3f80('0x26')]['id'],'ItemClass':_0x3f80('0x8f')},'include':[{'model':db[_0x3f80('0x89')],'as':_0x3f80('0x69')}],'order':[[_0x3f80('0x92')],[db['sequelize'][_0x3f80('0x6b')](_0x3f80('0x94'))]]})[_0x3f80('0x1a')](function(_0x545e89){return _0x545e89;})['then'](respondWithResult(_0x379614,null))[_0x3f80('0x24')](handleError(_0x379614,null));};exports[_0x3f80('0x95')]=function(_0x4ff0f4,_0x579ebf){return db['CmContactHasItem'][_0x3f80('0x37')]({'raw':!![],'where':{'CmContactId':_0x4ff0f4[_0x3f80('0x36')][_0x3f80('0x96')]}})[_0x3f80('0x1a')](function(_0x154092){var _0x20afc5=_[_0x3f80('0x6e')](_0x154092,function(_0x5090a5){_0x5090a5['CmContactId']=_0x4ff0f4[_0x3f80('0x36')][_0x3f80('0x97')];return _0x5090a5;});return db[_0x3f80('0x4d')][_0x3f80('0x5b')](_0x20afc5,{});})[_0x3f80('0x1a')](function(){return addCmHopperPhones(_0x4ff0f4[_0x3f80('0x36')][_0x3f80('0x97')]);})[_0x3f80('0x1a')](function(){return['ok'];})[_0x3f80('0x1a')](respondWithResult(_0x579ebf,null))[_0x3f80('0x24')](handleError(_0x579ebf,null));};exports[_0x3f80('0x98')]=function(_0x341ff6,_0x28b278){var _0x2fca64=[];_0x2fca64['push'](createCmHopperPhone(_0x341ff6[_0x3f80('0x36')]['id'],_0x341ff6['body'][_0x3f80('0x99')]));Promise[_0x3f80('0x63')](_0x2fca64)['then'](function(){return[0x1];})[_0x3f80('0x1a')](respondWithResult(_0x28b278,null));};exports['getHoppers']=function(_0x548f7e,_0x103cb3){var _0xa3ad10={'raw':![],'where':{}};var _0x1e3227={};var _0x25dee9={'count':0x0,'rows':[]};return db['CmContact'][_0x3f80('0x7a')]({'where':{'id':_0x548f7e[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0x103cb3,null))[_0x3f80('0x1a')](function(_0x575e96){if(_0x575e96){_0x1e3227['model']=_['keys'](db[_0x3f80('0x3f')][_0x3f80('0x7c')]);_0x1e3227[_0x3f80('0x23')]=_['keys'](_0x548f7e[_0x3f80('0x23')]);_0x1e3227[_0x3f80('0x7d')]=_[_0x3f80('0x7e')](_0x1e3227['model'],_0x1e3227[_0x3f80('0x23')]);_0xa3ad10['attributes']=_[_0x3f80('0x7e')](_0x1e3227['model'],qs[_0x3f80('0x80')](_0x548f7e[_0x3f80('0x23')][_0x3f80('0x80')]));_0xa3ad10[_0x3f80('0x7f')]=_0xa3ad10[_0x3f80('0x7f')][_0x3f80('0x2d')]?_0xa3ad10[_0x3f80('0x7f')]:_0x1e3227['model'];if(!_0x548f7e['query'][_0x3f80('0x34')](_0x3f80('0x84'))){_0xa3ad10['limit']=qs['limit'](_0x548f7e[_0x3f80('0x23')][_0x3f80('0x15')]);_0xa3ad10['offset']=qs['offset'](_0x548f7e[_0x3f80('0x23')][_0x3f80('0x13')]);}_0xa3ad10[_0x3f80('0x81')]=qs[_0x3f80('0x9a')](_0x548f7e[_0x3f80('0x23')][_0x3f80('0x9a')]);_0xa3ad10[_0x3f80('0x5e')]=qs[_0x3f80('0x7d')](_[_0x3f80('0x82')](_0x548f7e[_0x3f80('0x23')],_0x1e3227[_0x3f80('0x7d')]));_0xa3ad10[_0x3f80('0x5e')][_0x3f80('0x9b')]=_0x575e96['id'];if(_0x548f7e['query']['filter']){_0xa3ad10['where']=_[_0x3f80('0x35')](_0xa3ad10[_0x3f80('0x5e')],{'$or':_['map'](_0xa3ad10[_0x3f80('0x7f')],function(_0x296742){var _0x127f28={};_0x127f28[_0x296742]={'$like':'%'+_0x548f7e['query'][_0x3f80('0x9c')]+'%'};return _0x127f28;})});}_0xa3ad10=_[_0x3f80('0x35')]({},_0xa3ad10,_0x548f7e[_0x3f80('0x83')]);return db[_0x3f80('0x3f')][_0x3f80('0x16')]({'where':_0xa3ad10[_0x3f80('0x5e')]})[_0x3f80('0x1a')](function(_0x8f6efd){_0x25dee9['count']=_0x8f6efd;if(_0x548f7e[_0x3f80('0x23')]['includeAll']){_0xa3ad10[_0x3f80('0x9d')]=[{'all':!![]}];}return db[_0x3f80('0x3f')][_0x3f80('0x37')](_0xa3ad10);})[_0x3f80('0x1a')](function(_0x2f377f){_0x25dee9['rows']=_0x2f377f;return _0x25dee9;});}})[_0x3f80('0x1a')](respondWithFilteredResult(_0x103cb3,_0xa3ad10))[_0x3f80('0x24')](handleError(_0x103cb3,null));};exports['getHopperHistories']=function(_0x4ef640,_0x4212bc){var _0x1850d9={'raw':!![],'where':{}};var _0xe76b4c={};var _0xd815e2={'count':0x0,'rows':[]};return db['CmContact'][_0x3f80('0x7a')]({'where':{'id':_0x4ef640[_0x3f80('0x26')]['id']}})['then'](handleEntityNotFound(_0x4212bc,null))[_0x3f80('0x1a')](function(_0x47e852){if(_0x47e852){_0xe76b4c[_0x3f80('0x7b')]=_[_0x3f80('0x28')](db[_0x3f80('0x9e')][_0x3f80('0x7c')]);_0xe76b4c[_0x3f80('0x23')]=_[_0x3f80('0x28')](_0x4ef640[_0x3f80('0x23')]);_0xe76b4c['filters']=_[_0x3f80('0x7e')](_0xe76b4c[_0x3f80('0x7b')],_0xe76b4c[_0x3f80('0x23')]);_0x1850d9[_0x3f80('0x7f')]=_['intersection'](_0xe76b4c[_0x3f80('0x7b')],qs[_0x3f80('0x80')](_0x4ef640[_0x3f80('0x23')][_0x3f80('0x80')]));_0x1850d9[_0x3f80('0x7f')]=_0x1850d9[_0x3f80('0x7f')]['length']?_0x1850d9[_0x3f80('0x7f')]:_0xe76b4c[_0x3f80('0x7b')];if(!_0x4ef640[_0x3f80('0x23')][_0x3f80('0x34')](_0x3f80('0x84'))){_0x1850d9['limit']=qs[_0x3f80('0x15')](_0x4ef640[_0x3f80('0x23')][_0x3f80('0x15')]);_0x1850d9[_0x3f80('0x13')]=qs[_0x3f80('0x13')](_0x4ef640[_0x3f80('0x23')][_0x3f80('0x13')]);}_0x1850d9[_0x3f80('0x81')]=qs[_0x3f80('0x9a')](_0x4ef640[_0x3f80('0x23')]['sort']);_0x1850d9[_0x3f80('0x5e')]=qs['filters'](_[_0x3f80('0x82')](_0x4ef640[_0x3f80('0x23')],_0xe76b4c[_0x3f80('0x7d')]));_0x1850d9[_0x3f80('0x5e')]['ContactId']=_0x47e852['id'];if(_0x4ef640[_0x3f80('0x23')]['filter']){_0x1850d9[_0x3f80('0x5e')]=_[_0x3f80('0x35')](_0x1850d9[_0x3f80('0x5e')],{'$or':_[_0x3f80('0x6e')](_0x1850d9['attributes'],function(_0x2a672c){var _0x20925d={};_0x20925d[_0x2a672c]={'$like':'%'+_0x4ef640[_0x3f80('0x23')]['filter']+'%'};return _0x20925d;})});}_0x1850d9=_[_0x3f80('0x35')]({},_0x1850d9,_0x4ef640[_0x3f80('0x83')]);return db[_0x3f80('0x9e')][_0x3f80('0x16')]({'where':_0x1850d9[_0x3f80('0x5e')]})[_0x3f80('0x1a')](function(_0x1f03b7){_0xd815e2[_0x3f80('0x16')]=_0x1f03b7;if(_0x4ef640[_0x3f80('0x23')][_0x3f80('0x9f')]){_0x1850d9[_0x3f80('0x9d')]=[{'all':!![]}];}return db[_0x3f80('0x9e')]['findAll'](_0x1850d9);})[_0x3f80('0x1a')](function(_0xbc9f92){_0xd815e2[_0x3f80('0xa0')]=_0xbc9f92;return _0xd815e2;});}})[_0x3f80('0x1a')](respondWithFilteredResult(_0x4212bc,_0x1850d9))['catch'](handleError(_0x4212bc,null));};exports[_0x3f80('0xa1')]=function(_0x33f631,_0x43f932){var _0x1fb428={'raw':!![],'where':{}};var _0x3ede83={};var _0x1bc80={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x33f631[_0x3f80('0x26')]['id']}})['then'](handleEntityNotFound(_0x43f932,null))[_0x3f80('0x1a')](function(_0x21f4dd){if(_0x21f4dd){_0x3ede83[_0x3f80('0x7b')]=_[_0x3f80('0x28')](db[_0x3f80('0x4e')]['rawAttributes']);_0x3ede83[_0x3f80('0x23')]=_['keys'](_0x33f631['query']);_0x3ede83['filters']=_[_0x3f80('0x7e')](_0x3ede83[_0x3f80('0x7b')],_0x3ede83[_0x3f80('0x23')]);_0x1fb428[_0x3f80('0x7f')]=_['intersection'](_0x3ede83[_0x3f80('0x7b')],qs['fields'](_0x33f631[_0x3f80('0x23')][_0x3f80('0x80')]));_0x1fb428[_0x3f80('0x7f')]=_0x1fb428[_0x3f80('0x7f')][_0x3f80('0x2d')]?_0x1fb428[_0x3f80('0x7f')]:_0x3ede83[_0x3f80('0x7b')];if(!_0x33f631[_0x3f80('0x23')][_0x3f80('0x34')](_0x3f80('0x84'))){_0x1fb428[_0x3f80('0x15')]=qs[_0x3f80('0x15')](_0x33f631[_0x3f80('0x23')]['limit']);_0x1fb428[_0x3f80('0x13')]=qs['offset'](_0x33f631[_0x3f80('0x23')][_0x3f80('0x13')]);}_0x1fb428[_0x3f80('0x81')]=qs['sort'](_0x33f631[_0x3f80('0x23')][_0x3f80('0x9a')]);_0x1fb428[_0x3f80('0x5e')]=qs[_0x3f80('0x7d')](_[_0x3f80('0x82')](_0x33f631[_0x3f80('0x23')],_0x3ede83[_0x3f80('0x7d')]));_0x1fb428[_0x3f80('0x5e')][_0x3f80('0x9b')]=_0x21f4dd['id'];if(_0x33f631[_0x3f80('0x23')]['filter']){_0x1fb428[_0x3f80('0x5e')]=_['merge'](_0x1fb428[_0x3f80('0x5e')],{'$or':_[_0x3f80('0x6e')](_0x1fb428['attributes'],function(_0x30654f){var _0xdf2a0={};_0xdf2a0[_0x30654f]={'$like':'%'+_0x33f631[_0x3f80('0x23')][_0x3f80('0x9c')]+'%'};return _0xdf2a0;})});}_0x1fb428=_[_0x3f80('0x35')]({},_0x1fb428,_0x33f631[_0x3f80('0x83')]);return db[_0x3f80('0x4e')]['count']({'where':_0x1fb428[_0x3f80('0x5e')]})[_0x3f80('0x1a')](function(_0x592d8c){_0x1bc80['count']=_0x592d8c;if(_0x33f631[_0x3f80('0x23')][_0x3f80('0x9f')]){_0x1fb428[_0x3f80('0x9d')]=[{'all':!![]}];}return db[_0x3f80('0x4e')]['findAll'](_0x1fb428);})[_0x3f80('0x1a')](function(_0x4bb636){_0x1bc80[_0x3f80('0xa0')]=_0x4bb636;return _0x1bc80;});}})[_0x3f80('0x1a')](respondWithFilteredResult(_0x43f932,_0x1fb428))[_0x3f80('0x24')](handleError(_0x43f932,null));};exports[_0x3f80('0xa2')]=function(_0x3f302c,_0x37e9f3){var _0x1e26d6={'raw':!![],'where':{}};var _0x47f655={};var _0x5c224d={'count':0x0,'rows':[]};return db[_0x3f80('0x25')]['findOne']({'where':{'id':_0x3f302c[_0x3f80('0x26')]['id']}})[_0x3f80('0x1a')](handleEntityNotFound(_0x37e9f3,null))[_0x3f80('0x1a')](function(_0x5d1105){if(_0x5d1105){_0x47f655[_0x3f80('0x7b')]=_['keys'](db['JscriptySessionReport'][_0x3f80('0x7c')]);_0x47f655[_0x3f80('0x23')]=_[_0x3f80('0x28')](_0x3f302c[_0x3f80('0x23')]);_0x47f655[_0x3f80('0x7d')]=_['intersection'](_0x47f655[_0x3f80('0x7b')],_0x47f655['query']);_0x1e26d6[_0x3f80('0x7f')]=_['intersection'](_0x47f655['model'],qs[_0x3f80('0x80')](_0x3f302c['query'][_0x3f80('0x80')]));_0x1e26d6[_0x3f80('0x7f')]=_0x1e26d6['attributes'][_0x3f80('0x2d')]?_0x1e26d6[_0x3f80('0x7f')]:_0x47f655[_0x3f80('0x7b')];if(!_0x3f302c['query']['hasOwnProperty']('nolimit')){_0x1e26d6[_0x3f80('0x15')]=qs[_0x3f80('0x15')](_0x3f302c['query'][_0x3f80('0x15')]);_0x1e26d6['offset']=qs[_0x3f80('0x13')](_0x3f302c[_0x3f80('0x23')][_0x3f80('0x13')]);}_0x1e26d6['order']=qs['sort'](_0x3f302c['query'][_0x3f80('0x9a')]);_0x1e26d6['where']=qs['filters'](_[_0x3f80('0x82')](_0x3f302c[_0x3f80('0x23')],_0x47f655[_0x3f80('0x7d')]));_0x1e26d6[_0x3f80('0x5e')][_0x3f80('0x9b')]=_0x5d1105['id'];if(_0x3f302c[_0x3f80('0x23')][_0x3f80('0x9c')]){_0x1e26d6[_0x3f80('0x5e')]=_[_0x3f80('0x35')](_0x1e26d6[_0x3f80('0x5e')],{'$or':_[_0x3f80('0x6e')](_0x1e26d6[_0x3f80('0x7f')],function(_0x37d886){var _0x4c2821={};_0x4c2821[_0x37d886]={'$like':'%'+_0x3f302c['query']['filter']+'%'};return _0x4c2821;})});}_0x1e26d6=_['merge']({},_0x1e26d6,_0x3f302c[_0x3f80('0x83')]);return db['JscriptySessionReport']['count']({'where':_0x1e26d6[_0x3f80('0x5e')]})[_0x3f80('0x1a')](function(_0x20fccf){_0x5c224d['count']=_0x20fccf;if(_0x3f302c[_0x3f80('0x23')]['includeAll']){_0x1e26d6['include']=[{'all':!![]}];}return db[_0x3f80('0xa3')][_0x3f80('0x37')](_0x1e26d6);})[_0x3f80('0x1a')](function(_0x332344){_0x5c224d[_0x3f80('0xa0')]=_0x332344;return _0x5c224d;});}})[_0x3f80('0x1a')](respondWithFilteredResult(_0x37e9f3,_0x1e26d6))[_0x3f80('0x24')](handleError(_0x37e9f3,null));};exports[_0x3f80('0xa4')]=function(_0x4ce365,_0x9afe5c){try{if(!_0x4ce365['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x4ce365[_0x3f80('0x36')][_0x3f80('0xa5')]){throw new Error(_0x3f80('0xa6'));}if(!_0x4ce365[_0x3f80('0x36')][_0x3f80('0xa7')]){throw new Error(_0x3f80('0xa8'));}if(!_0x4ce365['body'][_0x3f80('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x187d6a=_0x4ce365[_0x3f80('0x36')][_0x3f80('0xa5')][_0x3f80('0xaa')](',');var _0x51515c=_0x4ce365[_0x3f80('0x36')][_0x3f80('0xa7')]['split'](',');if(!_0x187d6a[_0x3f80('0x2d')]||!_0x51515c[_0x3f80('0x2d')]||_0x187d6a[_0x3f80('0x2d')]!==_0x51515c['length']){throw new Error(_0x3f80('0xab'));}_0x4ce365['body'][_0x3f80('0x80')]=_['zipObject'](_0x187d6a,_0x51515c);if(!_0x4ce365[_0x3f80('0x36')][_0x3f80('0x80')]['phone']){throw new Error(_0x3f80('0xac'));}if(!_0x4ce365[_0x3f80('0x36')][_0x3f80('0x80')][_0x3f80('0xad')]){throw new Error(_0x3f80('0xae'));}var _0x508f56=path[_0x3f80('0x3b')](config[_0x3f80('0xaf')],_0x3f80('0xb0'),_0x4ce365[_0x3f80('0xb1')][_0x3f80('0xb2')]);fs[_0x3f80('0xb3')](_0x508f56,parseInt(_0x3f80('0xb4'),0x8));var _0x5c5983=require(_0x3f80('0xb5'))[_0x3f80('0xb6')](path[_0x3f80('0x3b')](__dirname,_0x3f80('0xb7')),[_0x508f56,_0x4ce365['body'][_0x3f80('0xa5')],_0x4ce365[_0x3f80('0x36')]['binding_values'],_0x4ce365[_0x3f80('0x36')][_0x3f80('0x61')],_0x4ce365[_0x3f80('0x36')][_0x3f80('0xb8')],_0x4ce365[_0x3f80('0x36')][_0x3f80('0x5d')],_0x4ce365[_0x3f80('0x36')][_0x3f80('0xa9')]]);return _0x9afe5c[_0x3f80('0x17')](0xc8)[_0x3f80('0x12')]({'message':_0x3f80('0xb9'),'pid':_0x5c5983['pid']});}catch(_0xad5638){return _0x9afe5c[_0x3f80('0x17')](0x1f4)[_0x3f80('0x20')](_0xad5638);}};exports[_0x3f80('0xba')]=function(_0x41f8a3,_0x16fa2e){var _0x30c056=fs['createReadStream'](_0x41f8a3[_0x3f80('0xb1')][_0x3f80('0x2')]);Papa[_0x3f80('0xbb')](_0x30c056,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x173f18){return _0x16fa2e[_0x3f80('0x17')](0xc8)[_0x3f80('0x12')]({'file':_0x41f8a3[_0x3f80('0xb1')],'fields':_0x173f18[_0x3f80('0xbc')][_0x3f80('0x80')]});}});};exports[_0x3f80('0xbd')]=function(_0x10ef98,_0x58489a){return db['User'][_0x3f80('0x37')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3f80('0xbe')}})[_0x3f80('0x1a')](function(_0x50a5d0){var _0x43a03c=![];if(!_0x10ef98[_0x3f80('0x36')][_0x3f80('0x61')]){throw new Error(_0x3f80('0xbf'));}if(!_0x10ef98['body'][_0x3f80('0xc0')]['phone']){throw new Error(_0x3f80('0xac'));}if(!_0x10ef98['body']['binding'][_0x3f80('0xad')]){throw new Error(_0x3f80('0xae'));}if(!_0x10ef98['body'][_0x3f80('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x50245d=require(_0x3f80('0xb5'))[_0x3f80('0xb6')](path[_0x3f80('0x3b')](__dirname,'../../components/import/cm/csv2'),[_0x10ef98['params']['id'],JSON[_0x3f80('0xc1')](_0x10ef98[_0x3f80('0x36')]),JSON[_0x3f80('0xc1')](_0x50a5d0)]);_0x50245d['on']('message',function(){_0x43a03c=!![];return _0x58489a[_0x3f80('0x17')](0xc8)['json']({'message':_0x3f80('0xc2'),'pid':_0x50245d['pid']});});_0x50245d['on']('exit',function(_0x1d922e){if(_0x1d922e&&!_0x43a03c){return _0x58489a[_0x3f80('0x17')](0x1f4)[_0x3f80('0x12')]({'message':_0x3f80('0xc3'),'pid':_0x50245d[_0x3f80('0xc4')]});}});})[_0x3f80('0x24')](handleError(_0x58489a,null));};exports[_0x3f80('0xc5')]=function(_0x4c5a49,_0x219e40){return db[_0x3f80('0xc6')][_0x3f80('0x37')]({'raw':!![],'attributes':['id'],'where':{'role':_0x3f80('0xbe')}})[_0x3f80('0x1a')](function(_0x435c0a){var _0x55b9aa=![];if(!_0x4c5a49[_0x3f80('0x36')][_0x3f80('0x61')]){throw new Error(_0x3f80('0xbf'));}if(!_0x4c5a49[_0x3f80('0x36')][_0x3f80('0xc0')][_0x3f80('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4c5a49[_0x3f80('0x36')][_0x3f80('0xc0')][_0x3f80('0xad')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x4c5a49[_0x3f80('0x36')][_0x3f80('0xa9')]){throw new Error(_0x3f80('0xc7'));}var _0x62c4a0=require(_0x3f80('0xb5'))[_0x3f80('0xb6')](path[_0x3f80('0x3b')](__dirname,_0x3f80('0xc8')),[_0x4c5a49[_0x3f80('0x26')]['id'],JSON[_0x3f80('0xc1')](_0x4c5a49[_0x3f80('0x36')]),JSON[_0x3f80('0xc1')](_0x435c0a)]);_0x62c4a0['on']('message',function(){_0x55b9aa=!![];return _0x219e40[_0x3f80('0x17')](0xc8)[_0x3f80('0x12')]({'message':_0x3f80('0xc2'),'pid':_0x62c4a0[_0x3f80('0xc4')]});});_0x62c4a0['on'](_0x3f80('0xc9'),function(_0x5063ca){if(_0x5063ca&&!_0x55b9aa){return _0x219e40[_0x3f80('0x17')](0x1f4)[_0x3f80('0x12')]({'message':_0x3f80('0xc3'),'pid':_0x62c4a0[_0x3f80('0xc4')]});}});})['catch'](handleError(_0x219e40,null));};exports['getJourney']=function(_0x37b80e,_0x36c9be){var _0x53a2b5=[_0x3f80('0xca'),_0x3f80('0xcb'),'sms',_0x3f80('0xcc'),_0x3f80('0xcd'),_0x3f80('0xce'),_0x3f80('0xcf')];var _0x1feb32={'offset':0x0,'order':qs[_0x3f80('0x9a')](_0x3f80('0xd0'))},_0x40d0de={'count':0x0,'rows':[]};Promise[_0x3f80('0xd1')]()[_0x3f80('0x1a')](function(){if(_0x37b80e[_0x3f80('0x23')]['channel']){if(!_[_0x3f80('0xd2')](_0x53a2b5,_0x37b80e[_0x3f80('0x23')][_0x3f80('0xd3')]['toLowerCase']())){throw new Error(_0x3f80('0xd4'));}_0x53a2b5=[_0x37b80e[_0x3f80('0x23')][_0x3f80('0xd3')][_0x3f80('0xd5')]()];}if(_0x37b80e[_0x3f80('0x23')][_0x3f80('0xd6')]){try{var _0x3709ad=JSON[_0x3f80('0xbb')](_0x37b80e[_0x3f80('0x23')][_0x3f80('0xd6')]);if(!moment(_0x3709ad[_0x3f80('0x3e')])[_0x3f80('0xd7')]()){throw new Error(_0x3f80('0xd8'));}if(!moment(_0x3709ad['to'])[_0x3f80('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x1316ba){throw new Error(_0x3f80('0xd9'));}}if(!_0x37b80e['query']['hasOwnProperty'](_0x3f80('0x84'))){_0x1feb32[_0x3f80('0x15')]=qs[_0x3f80('0x15')](_0x37b80e[_0x3f80('0x23')][_0x3f80('0x15')]||0xa);_0x1feb32[_0x3f80('0x13')]=qs['offset'](_0x37b80e[_0x3f80('0x23')][_0x3f80('0x13')]);}var _0x5a9447=_0x53a2b5[_0x3f80('0x6e')](function(_0x13a8f8){if(_0x13a8f8===_0x3f80('0xcf')){var _0x39a055={'attributes':['id','uniqueid',_0x3f80('0x31'),'source',_0x3f80('0xda'),'callerid','starttime','endtime','duration',_0x3f80('0xdb'),_0x3f80('0xdc'),_0x3f80('0xdd'),_0x3f80('0xde'),_0x3f80('0xdf'),_0x3f80('0xe0')],'where':{'ContactId':_0x37b80e[_0x3f80('0x26')]['id']},'include':[{'model':db[_0x3f80('0xc6')],'as':'User','attributes':['id',_0x3f80('0x1f'),'fullname',_0x3f80('0x2f')]}],'order':[['createdAt','DESC']]};if(_0x37b80e[_0x3f80('0x23')][_0x3f80('0xd6')]){_0x39a055[_0x3f80('0x5e')]['createdAt']={'$gte':_0x3709ad['from'],'$lte':_0x3709ad['to']};}return db[_0x3f80('0x4f')]['findAndCountAll'](_0x39a055)[_0x3f80('0x1a')](function(_0x16dc4a){_0x40d0de[_0x3f80('0x16')]+=_0x16dc4a['count'];return _['map'](_0x16dc4a[_0x3f80('0xa0')],function(_0x1d8884){var _0x26ae84=_0x1d8884['get']({'plain':!![]});_0x26ae84[_0x3f80('0xd3')]=_0x13a8f8;if(_0x26ae84['User']){_0x26ae84[_0x3f80('0xc6')]={'id':_0x26ae84['User']['id'],'name':_0x26ae84[_0x3f80('0xc6')][_0x3f80('0x1f')],'fullname':_0x26ae84['User'][_0x3f80('0xe1')],'alias':_0x26ae84[_0x3f80('0xc6')]['alias']};}return _0x26ae84;});});}else{var _0x5d1461=_['startCase'](_0x13a8f8)+(_0x13a8f8===_0x3f80('0xcb')?'Website':_0x3f80('0xe2'));var _0x52f4ab={'attributes':['id','closed',_0x3f80('0xe3'),_0x3f80('0xdc'),_0x3f80('0xdb'),_0x3f80('0xe4'),_0x3f80('0xe5'),_0x3f80('0xe6'),_0x3f80('0xe0'),_0x5d1461+'Id'],'where':{'ContactId':_0x37b80e[_0x3f80('0x26')]['id']},'include':[{'model':db[_0x5d1461],'as':_0x3f80('0xe2'),'attributes':['id',_0x3f80('0x1f'),'key']},{'model':db['User'],'as':_0x3f80('0xe7'),'attributes':['id','name',_0x3f80('0xe1')]},{'model':db[_0x3f80('0x66')],'as':_0x3f80('0x67'),'attributes':['id',_0x3f80('0x1f'),_0x3f80('0xe8')],'through':{'attributes':[]}}],'order':[[_0x3f80('0xdc'),_0x3f80('0xe9')]]};if(_0x37b80e['query'][_0x3f80('0xd6')]){_0x52f4ab['where'][_0x3f80('0xdc')]={'$gte':_0x3709ad['from'],'$lte':_0x3709ad['to']};}switch(_0x13a8f8){case'chat':_0x52f4ab[_0x3f80('0x7f')]['push'](_0x3f80('0xea'),_0x3f80('0xeb'),'customerPort',_0x3f80('0xec'),_0x3f80('0xed'),_0x3f80('0xee'),_0x3f80('0xef'),_0x3f80('0xf0'),'referer');break;case'mail':_0x52f4ab[_0x3f80('0x7f')][_0x3f80('0x60')]('subject',_0x3f80('0xf1'));break;case _0x3f80('0xcc'):_0x52f4ab[_0x3f80('0x7f')]['push'](_0x3f80('0xf2'),'threadId');break;}return db[_['startCase'](_0x13a8f8)+_0x3f80('0xf3')]['findAndCountAll'](_0x52f4ab)[_0x3f80('0x1a')](function(_0x957a12){_0x40d0de[_0x3f80('0x16')]+=_0x957a12[_0x3f80('0x16')];return _[_0x3f80('0x6e')](_0x957a12['rows'],function(_0x532e4e){var _0x275752=_0x532e4e[_0x3f80('0x38')]({'plain':!![]});_0x275752[_0x3f80('0xd3')]=_0x13a8f8;if(_0x275752[_0x3f80('0xe7')]){_0x275752[_0x3f80('0xe7')]={'id':_0x275752[_0x3f80('0xe7')]['id'],'name':_0x275752[_0x3f80('0xe7')][_0x3f80('0x1f')],'fullname':_0x275752[_0x3f80('0xe7')]['fullname']};}return _0x275752;});});}});return Promise[_0x3f80('0x63')](_0x5a9447);})[_0x3f80('0x1a')](function(_0x5e2a50){return _(_0x5e2a50)['flatten']()[_0x3f80('0xf4')]('createdAt')[_0x3f80('0xf5')]()[_0x3f80('0xf6')]();})[_0x3f80('0x1a')](function(_0x49082f){_0x40d0de['rows']=_0x1feb32['limit']?_0x49082f[_0x3f80('0xf7')](_0x1feb32['offset'],_0x1feb32[_0x3f80('0x13')]+_0x1feb32[_0x3f80('0x15')]):_0x49082f;return _0x40d0de;})['then'](respondWithFilteredResult(_0x36c9be,_0x1feb32))[_0x3f80('0x24')](handleError(_0x36c9be,null));}; \ No newline at end of file +var _0xc78e=['status','json','offset','undefined','count','set','update','then','error','stack','name','send','index','describe','getOptions','findAll','query','user','destroy','CmContact','catch','tags','keys','length','startsWith','cf_','columnName','displayName','CmCustomField','alias','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','body','from','get','mergeWith','isArray','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','push','where','ListId','hasOwnProperty','all','params','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','$and','omit','map','cf_%d','format','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','phone','findOne','model','intersection','fields','attributes','order','sort','pick','filter','merge','getTags','nolimit','limit','setTags','ids','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','find','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopperId','item','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','hopperId','getHoppers','rawAttributes','filters','ContactId','includeAll','include','rows','getHopperHistories','options','getHopperFinals','getJscriptySessions','uploadCsv','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','0777','child_process','fork','CompanyId','pid','upload','createReadStream','parse','import','User','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','agent','No\x20ListId\x20specified','../../components/import/cm/csvUpdates','getJourney','sms','openchannel','fax','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','callerid','endtime','note','createdAt','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','startCase','chat','Account','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingValue','referer','mail','subject','substatus','threadId','findAndCountAll','flatten','sortBy','reverse','value','slice','moment','util','path','lodash','squel','papaparse','../../components/contacts','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','defaults','socket.io-emitter','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc78e,0x1d4));var _0xec78=function(_0x35b5fb,_0x175955){_0x35b5fb=_0x35b5fb-0x0;var _0xb76d8c=_0xc78e[_0x35b5fb];return _0xb76d8c;};'use strict';var moment=require(_0xec78('0x0'));var BPromise=require('bluebird');var util=require(_0xec78('0x1'));var path=require(_0xec78('0x2'));var fs=require('fs');var _=require(_0xec78('0x3'));var squel=require(_0xec78('0x4'));var Papa=require(_0xec78('0x5'));var Redis=require('ioredis');var contacts=require(_0xec78('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xec78('0x7'))('api');var config=require(_0xec78('0x8'));var shared=require(_0xec78('0x9'));var db=require(_0xec78('0xa'))['db'];config['redis']=_[_0xec78('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec78('0xc'))(new Redis(config[_0xec78('0xd')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x484841,_0x372eeb){_0x372eeb=_0x372eeb||0xc8;return function(_0x30663f){if(_0x30663f){return _0x484841[_0xec78('0xe')](_0x372eeb)[_0xec78('0xf')](_0x30663f);}};}function respondWithFilteredResult(_0xc4ff65,_0x79ec5){return function(_0xb91aac){if(_0xb91aac){var _0x3fdbc6=typeof _0x79ec5[_0xec78('0x10')]===_0xec78('0x11')&&typeof _0x79ec5['limit']===_0xec78('0x11');var _0x10f9a6=_0xb91aac[_0xec78('0x12')];var _0x103644=_0x3fdbc6?0x0:_0x79ec5[_0xec78('0x10')];var _0x4dbf6e=_0x3fdbc6?_0xb91aac[_0xec78('0x12')]:_0x79ec5[_0xec78('0x10')]+_0x79ec5['limit'];var _0x15bb1a;if(_0x4dbf6e>=_0x10f9a6){_0x4dbf6e=_0x10f9a6;_0x15bb1a=0xc8;}else{_0x15bb1a=0xce;}_0xc4ff65[_0xec78('0xe')](_0x15bb1a);return _0xc4ff65[_0xec78('0x13')]('Content-Range',_0x103644+'-'+_0x4dbf6e+'/'+_0x10f9a6)[_0xec78('0xf')](_0xb91aac);}return null;};}function saveUpdates(_0x52f85e){return function(_0x7eb055){if(_0x7eb055){return _0x7eb055[_0xec78('0x14')](_0x52f85e)[_0xec78('0x15')](function(_0x45de1d){return _0x45de1d;});}return null;};}function removeEntity(_0x29aa05){return function(_0x33fa5a){if(_0x33fa5a){return _0x33fa5a['destroy']()[_0xec78('0x15')](function(){_0x29aa05[_0xec78('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52acb8){return function(_0x256d20){if(!_0x256d20){_0x52acb8['sendStatus'](0x194);}return _0x256d20;};}function handleError(_0x15d2ed,_0x1203a4){_0x1203a4=_0x1203a4||0x1f4;return function(_0x451195){logger[_0xec78('0x16')](_0x451195[_0xec78('0x17')]);if(_0x451195[_0xec78('0x18')]){delete _0x451195[_0xec78('0x18')];}_0x15d2ed[_0xec78('0xe')](_0x1203a4)[_0xec78('0x19')](_0x451195);};}exports[_0xec78('0x1a')]=function(_0xc54946,_0x58aa2d){var _0x4fad41={};return contacts[_0xec78('0x1b')]()['then'](function(_0x854cf){_0x4fad41=qs[_0xec78('0x1c')](_0x854cf,_0xc54946);return contacts[_0xec78('0x1d')](_0xc54946[_0xec78('0x1e')],_0xc54946[_0xec78('0x1f')],_0x4fad41,_0x854cf);})[_0xec78('0x15')](respondWithFilteredResult(_0x58aa2d,_0x4fad41))['catch'](handleError(_0x58aa2d,null));};exports[_0xec78('0x20')]=function(_0x25e047,_0x44929c){return db[_0xec78('0x21')]['find']({'where':{'id':_0x25e047['params']['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x44929c,null))[_0xec78('0x15')](removeEntity(_0x44929c,null))[_0xec78('0x22')](handleError(_0x44929c,null));};exports[_0xec78('0x1b')]=function(_0x3c1db5,_0xa87d64){return db[_0xec78('0x21')][_0xec78('0x1b')]()[_0xec78('0x15')](function(_0x26ab9b){delete _0x26ab9b[_0xec78('0x23')];for(var _0x4f5769=0x0;_0x4f57690x0){return new Promise(function(_0x1c500e){var _0x3c28f2=[];for(var _0x3be0a1=0x0;_0x3be0a1<_0x549f4d[_0xec78('0x25')];_0x3be0a1++){_0x3c28f2[_0xec78('0x57')](insertAdditionalPhones(_0x549f4d[_0x3be0a1]['contact'],_0x549f4d[_0x3be0a1]['additionalPhones']));}Promise[_0xec78('0x5b')](_0x3c28f2)[_0xec78('0x15')](function(){_0x1c500e(0x1);});})[_0xec78('0x15')](function(){return{'success':_0x579711,'failure':_0x4a31bd,'duplicates':_0x2ad3f8};});}else{return{'success':_0x579711,'failure':_0x4a31bd,'duplicates':_0x2ad3f8};}}})['then'](respondWithResult(_0x211f11,0xc9))[_0xec78('0x22')](handleError(_0x211f11,null));};exports['show']=function(_0x1ea4e6,_0x3d7623){var _0x2cb018;return db['CmContact']['describe']()[_0xec78('0x15')](function(_0x24d39d){return db[_0xec78('0x21')]['find']({'where':{'id':_0x1ea4e6[_0xec78('0x5c')]['id']},'include':[{'model':db[_0xec78('0x5d')],'as':_0xec78('0x5e'),'attributes':['id',_0xec78('0x18'),_0xec78('0x5f')],'required':_0x1ea4e6[_0xec78('0x1e')][_0xec78('0x60')]?!![]:![]},{'model':db[_0xec78('0x42')],'as':_0xec78('0x61'),'where':{'CmContactId':_0x1ea4e6[_0xec78('0x5c')]['id']},'required':![],'include':[{'model':db[_0xec78('0x62')],'as':_0xec78('0x63')}]}],'order':[db[_0xec78('0x64')][_0xec78('0x65')]('Phones.OrderBy')],'attributes':_['keys'](_0x24d39d)});})[_0xec78('0x15')](function(_0x398842){if(!_['isNil'](_0x398842)){_0x2cb018=_0x398842[_0xec78('0x32')]({'plain':!![]});var _0x77ecc4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x398842&&_0x398842[_0xec78('0x59')]){if(_0x398842[_0xec78('0x59')]){_0x77ecc4[_0xec78('0x58')][_0xec78('0x66')]['push']({'ListId':{'$ne':_0x398842[_0xec78('0x59')]}});}}return db[_0xec78('0x2a')][_0xec78('0x1d')](_0x77ecc4);}})[_0xec78('0x15')](function(_0x14786c){if(!_['isNil'](_0x14786c)){return _[_0xec78('0x67')](_0x2cb018,_[_0xec78('0x68')](_0x14786c,function(_0x3a2880){return util['format'](_0xec78('0x69'),_0x3a2880['id']);}));}})[_0xec78('0x15')](handleEntityNotFound(_0x3d7623,null))[_0xec78('0x15')](respondWithResult(_0x3d7623,null))['catch'](handleError(_0x3d7623,null));};exports[_0xec78('0x14')]=function(_0x16d512,_0x1d0b4d){var _0x3cdf0c;if(_0x16d512['body']['id']){delete _0x16d512[_0xec78('0x30')]['id'];}if(!_[_0xec78('0x4e')](_0x16d512[_0xec78('0x30')][_0xec78('0x4f')])){var _0x4754f8=_0x16d512['body'][_0xec78('0x4f')];if(!_[_0xec78('0x4e')](shared[_0xec78('0x50')][_0x4754f8]))_0x16d512[_0xec78('0x30')]['utcOffset']=shared[_0xec78('0x50')][_0x4754f8][_0xec78('0x51')];}return db[_0xec78('0x21')]['find']({'where':{'id':_0x16d512[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x1d0b4d,null))[_0xec78('0x15')](saveUpdates(_0x16d512['body'],null))[_0xec78('0x15')](function(_0x2293c9){_0x3cdf0c=_0x2293c9;var _0x3100be={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2293c9&&_0x2293c9['ListId']){if(_0x2293c9['ListId']){_0x3100be[_0xec78('0x58')]['$and'][_0xec78('0x57')]({'ListId':{'$ne':_0x2293c9[_0xec78('0x59')]}});}}return db[_0xec78('0x2a')][_0xec78('0x1d')](_0x3100be);})[_0xec78('0x15')](function(_0x321af6){if(_0x321af6){return _['omit'](_['pickBy'](_0x16d512[_0xec78('0x30')],function(_0x336568,_0x26f8d6){return _[_0xec78('0x26')](_0x26f8d6,_0xec78('0x27'));}),_[_0xec78('0x68')](_0x321af6,function(_0x448a82){return util[_0xec78('0x6a')](_0xec78('0x69'),_0x448a82['id']);}));}})['then'](function(_0x44d983){if(_0x44d983&&!_[_0xec78('0x6b')](_0x44d983)){var _0x3f3b90=squel[_0xec78('0x14')]()[_0xec78('0x6c')](_0xec78('0x6d'))[_0xec78('0x6e')](_0x44d983)[_0xec78('0x58')](_0xec78('0x6f'),_0x16d512['params']['id'])['toParam']();return db['sequelize'][_0xec78('0x1e')](_0x3f3b90[_0xec78('0x70')],{'replacements':_0x3f3b90['values']});}})[_0xec78('0x15')](function(){if(_0x16d512['body'][_0xec78('0x71')]&&_0x3cdf0c){return db['CmHopper']['update']({'phone':_0x16d512['body'][_0xec78('0x71')],'OrderBy':0x0},{'where':{'ContactId':_0x3cdf0c['id']}});}})[_0xec78('0x15')](function(){return _0x3cdf0c;})[_0xec78('0x15')](respondWithResult(_0x1d0b4d,null))['catch'](handleError(_0x1d0b4d,null));};exports['getTags']=function(_0x1c6f6b,_0x561eba){var _0x20a1ea={};var _0x469a9e={};var _0x5bbe32;var _0xd706ae;return db[_0xec78('0x21')][_0xec78('0x72')]({'where':{'id':_0x1c6f6b[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x561eba,null))['then'](function(_0x4373a6){if(_0x4373a6){_0x5bbe32=_0x4373a6;_0x469a9e[_0xec78('0x73')]=_[_0xec78('0x24')](db[_0xec78('0x5d')]['rawAttributes']);_0x469a9e[_0xec78('0x1e')]=_[_0xec78('0x24')](_0x1c6f6b[_0xec78('0x1e')]);_0x469a9e['filters']=_[_0xec78('0x74')](_0x469a9e['model'],_0x469a9e[_0xec78('0x1e')]);_0x20a1ea['attributes']=_[_0xec78('0x74')](_0x469a9e[_0xec78('0x73')],qs[_0xec78('0x75')](_0x1c6f6b['query'][_0xec78('0x75')]));_0x20a1ea[_0xec78('0x76')]=_0x20a1ea[_0xec78('0x76')]['length']?_0x20a1ea['attributes']:_0x469a9e[_0xec78('0x73')];_0x20a1ea[_0xec78('0x77')]=qs[_0xec78('0x78')](_0x1c6f6b[_0xec78('0x1e')][_0xec78('0x78')]);_0x20a1ea[_0xec78('0x58')]=qs['filters'](_[_0xec78('0x79')](_0x1c6f6b['query'],_0x469a9e['filters']));if(_0x1c6f6b['query'][_0xec78('0x7a')]){_0x20a1ea[_0xec78('0x58')]=_[_0xec78('0x7b')](_0x20a1ea[_0xec78('0x58')],{'$or':_[_0xec78('0x68')](_0x20a1ea[_0xec78('0x76')],function(_0x40fb37){var _0x66d90a={};_0x66d90a[_0x40fb37]={'$like':'%'+_0x1c6f6b[_0xec78('0x1e')][_0xec78('0x7a')]+'%'};return _0x66d90a;})});}_0x20a1ea=_['merge']({},_0x20a1ea,_0x1c6f6b['options']);return _0x5bbe32[_0xec78('0x7c')](_0x20a1ea);}})[_0xec78('0x15')](function(_0x5703f1){if(_0x5703f1){_0xd706ae=_0x5703f1[_0xec78('0x25')];if(!_0x1c6f6b[_0xec78('0x1e')][_0xec78('0x5a')](_0xec78('0x7d'))){_0x20a1ea[_0xec78('0x7e')]=qs['limit'](_0x1c6f6b[_0xec78('0x1e')][_0xec78('0x7e')]);_0x20a1ea[_0xec78('0x10')]=qs[_0xec78('0x10')](_0x1c6f6b[_0xec78('0x1e')][_0xec78('0x10')]);}return _0x5bbe32[_0xec78('0x7c')](_0x20a1ea);}})['then'](function(_0x3998fc){if(_0x3998fc){return _0x3998fc?{'count':_0xd706ae,'rows':_0x3998fc}:null;}})[_0xec78('0x15')](respondWithResult(_0x561eba,null))['catch'](handleError(_0x561eba,null));};exports[_0xec78('0x7f')]=function(_0x17d762,_0x31b235){if(_0x17d762['body']['id']){delete _0x17d762[_0xec78('0x30')]['id'];}return db[_0xec78('0x21')][_0xec78('0x72')]({'where':{'id':_0x17d762[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x31b235,null))[_0xec78('0x15')](function(_0x3353fc){if(_0x3353fc){return _0x3353fc[_0xec78('0x7f')](_0x17d762[_0xec78('0x30')][_0xec78('0x80')]||[]);}return null;})['then'](respondWithResult(_0x31b235,null))[_0xec78('0x22')](handleError(_0x31b235,null));};exports[_0xec78('0x81')]=function(_0x32e2ce,_0x18825b){var _0x1fdd13=[];_0x1fdd13[_0xec78('0x57')](addAdditionalPhones(_0x32e2ce[_0xec78('0x30')]));Promise['all'](_0x1fdd13)[_0xec78('0x15')](function(){_0x1fdd13=[];_0x1fdd13['push'](deleteCmHopperPhones(_0x32e2ce[_0xec78('0x30')]['id']));_0x1fdd13['push'](addCmHopperPhones(_0x32e2ce[_0xec78('0x30')]['id']));Promise[_0xec78('0x5b')](_0x1fdd13)[_0xec78('0x15')](function(){return[0x1];})['then'](respondWithResult(_0x18825b,null));});};function addAdditionalPhones(_0x10df27){var _0x2fd590;return new Promise(function(_0x592d65){return db['CmContactHasItem'][_0xec78('0x20')]({'where':{'CmContactId':_0x10df27['id']}})[_0xec78('0x15')](function(){db[_0xec78('0x62')][_0xec78('0x1d')]({'raw':!![],'attributes':['id',_0xec78('0x82')]})['then'](function(_0x59226a){var _0x334472=[];for(var _0x3dd048=0x0;_0x3dd048<_0x10df27['items'][_0xec78('0x25')];_0x3dd048++){var _0x37739d=_0x10df27[_0xec78('0x83')]?_[_0xec78('0x4e')](_0x10df27[_0xec78('0x83')][_0x3dd048])?'':_0x10df27[_0xec78('0x83')][_0x3dd048]:_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x85')]?_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x85')]:'';var _0x51e781=_[_0xec78('0x4e')](_0x10df27[_0xec78('0x84')][_0x3dd048]['description'])?'':_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x86')];var _0x1220c7=_0x37739d+':'+_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x71')]+'§'+_0x51e781;if(_[_0xec78('0x4e')](_0x2fd590))_0x2fd590=_0x1220c7;else _0x2fd590+=';'+_0x1220c7;var _0x2620fa=null;var _0x58dbcb=null;if(_0x10df27[_0xec78('0x83')]){if(!_[_0xec78('0x4e')](_0x10df27[_0xec78('0x83')][_0x3dd048])){_0x58dbcb=_[_0xec78('0x87')](_0x59226a,function(_0x324236){return _0x324236['id']===_0x10df27['item_types'][_0x3dd048];});if(!_[_0xec78('0x4e')](_0x58dbcb)){_0x2620fa=_0x58dbcb[_0xec78('0x82')];}}}else{if(!_[_0xec78('0x4e')](_0x10df27[_0xec78('0x84')][_0x3dd048])){_0x58dbcb=_[_0xec78('0x87')](_0x59226a,function(_0x311de3){return _0x311de3['id']===_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x85')];});if(!_[_0xec78('0x4e')](_0x58dbcb)){_0x2620fa=_0x3dd048;}}}if(_[_0xec78('0x4e')](_0x2620fa)){_0x2620fa=0x64;}_0x334472[_0xec78('0x57')](addAdditionalPhone(_0x10df27['id'],_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x71')],_0x10df27[_0xec78('0x83')]?_[_0xec78('0x4e')](_0x10df27[_0xec78('0x83')][_0x3dd048])?null:_0x10df27[_0xec78('0x83')][_0x3dd048]:_0x10df27[_0xec78('0x84')][_0x3dd048][_0xec78('0x85')]?_0x10df27[_0xec78('0x84')][_0x3dd048]['ItemTypeId']:null,_0x2620fa,_0x51e781));}Promise[_0xec78('0x5b')](_0x334472)[_0xec78('0x15')](function(){db[_0xec78('0x21')][_0xec78('0x14')]({'AdditionalPhones':_0x2fd590},{'where':{'id':_0x10df27['id']}})[_0xec78('0x15')](function(){_0x592d65(0x1);});});});});});}function addAdditionalPhone(_0xe5ebd5,_0x46f51f,_0x1a088f,_0x13ee87,_0x48fc1a){return db[_0xec78('0x42')]['find']({'where':{'CmContactId':_0xe5ebd5,'item':_0x46f51f}})['then'](function(_0x2d7482){if(_0x2d7482)logger[_0xec78('0x2e')](_0xec78('0x88'),_0x2d7482);else{db['CmContactHasItem'][_0xec78('0x39')]({'CmContactId':_0xe5ebd5,'item':_0x46f51f,'ItemTypeId':_0x1a088f,'OrderBy':_0x13ee87,'ItemClass':_0xec78('0x89'),'description':_0x48fc1a});}});}function deleteCmHopperPhones(_0x22a55b){return new Promise(function(_0x4ef742){return db[_0xec78('0x35')][_0xec78('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x22a55b}})[_0xec78('0x15')](function(_0xcf418){db[_0xec78('0x8a')][_0xec78('0x20')]({'where':{'CmHopperId':{'$in':_['map'](_0xcf418,'id')}}});})[_0xec78('0x15')](function(){_0x4ef742(0x1);});});}function addCmHopperPhones(_0x310e82){return new Promise(function(_0x22f879){return db[_0xec78('0x35')][_0xec78('0x1d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x310e82}})[_0xec78('0x15')](function(_0x2aeb3e){var _0x3e34dd=[];_[_0xec78('0x68')](_0x2aeb3e,function(_0x4a0a63){_0x3e34dd[_0xec78('0x57')](createCmHopperPhone(_0x310e82,_0x4a0a63['id']));});Promise[_0xec78('0x5b')](_0x3e34dd)[_0xec78('0x15')](function(){_0x22f879(0x1);});});});}function createCmHopperPhone(_0x158538,_0x3fa3f3){return new Promise(function(_0x54a0fb){db[_0xec78('0x42')][_0xec78('0x1d')]({'raw':!![],'attributes':['item',_0xec78('0x82')],'where':{'CmContactId':_0x158538,'ItemClass':_0xec78('0x89')},'include':[{'model':db[_0xec78('0x62')],'attributes':['OrderBy'],'as':_0xec78('0x63')}],'order':['OrderBy',db['sequelize']['literal']('`ItemType`.OrderBy')]})[_0xec78('0x15')](function(_0x574611){var _0x594e4e=0x1;var _0x4735b0=_[_0xec78('0x68')](_0x574611,function(_0x7a261f){_0x7a261f[_0xec78('0x8b')]=_0x3fa3f3;_0x7a261f[_0xec78('0x71')]=_0x7a261f[_0xec78('0x8c')];_0x7a261f[_0xec78('0x82')]=_0x594e4e;delete _0x7a261f['ItemType.OrderBy'];_0x594e4e=_0x594e4e+0x1;return _0x7a261f;});return db[_0xec78('0x8a')][_0xec78('0x53')](_0x4735b0,{});})[_0xec78('0x15')](function(){_0x54a0fb(0x1);});});}function insertAdditionalPhones(_0x5be8bc,_0xd9e9c8){return new Promise(function(_0x158669){var _0x2cab0c=[];for(var _0x5cdaca=0x0;_0x5cdaca<_0xd9e9c8[_0xec78('0x25')];_0x5cdaca++){var _0x290757=_0xd9e9c8[_0x5cdaca];_0x2cab0c['push'](parseContactItemType(_0x290757));}Promise[_0xec78('0x5b')](_0x2cab0c)[_0xec78('0x15')](function(){var _0x59c005={'id':_0x5be8bc['id'],'items':_0xd9e9c8};return addAdditionalPhones(_0x59c005)[_0xec78('0x15')](function(){return addCmHopperPhones(_0x5be8bc['id']);});})['then'](function(){_0x158669(_0x5be8bc);});});}function parseContactItemType(_0x120664){return new Promise(function(_0x1bbd1d){if(_0x120664[_0xec78('0x5a')](_0xec78('0x85'))){_0x1bbd1d(_0x120664);}else{return db[_0xec78('0x62')][_0xec78('0x87')]({'where':{'name':_0x120664['ItemType']}})[_0xec78('0x15')](function(_0x5a79c8){if(_[_0xec78('0x4e')](_0x5a79c8))_0x120664['ItemTypeId']=null;else _0x120664[_0xec78('0x85')]=_0x5a79c8['id'];_0x1bbd1d(_0x120664);});}});}exports[_0xec78('0x8d')]=function(_0x7c599,_0x137451){return db[_0xec78('0x42')][_0xec78('0x1d')]({'raw':!![],'where':{'CmContactId':_0x7c599[_0xec78('0x5c')]['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xec78('0x62')],'as':_0xec78('0x63')}],'order':[[_0xec78('0x82')],[db[_0xec78('0x64')]['literal'](_0xec78('0x8e'))]]})['then'](function(_0xa2d03e){return _0xa2d03e;})[_0xec78('0x15')](respondWithResult(_0x137451,null))[_0xec78('0x22')](handleError(_0x137451,null));};exports[_0xec78('0x8f')]=function(_0x1a5212,_0x596396){return db['CmContactHasItem'][_0xec78('0x1d')]({'raw':!![],'where':{'CmContactId':_0x1a5212[_0xec78('0x30')][_0xec78('0x90')]}})[_0xec78('0x15')](function(_0x3e7db8){var _0x1677db=_[_0xec78('0x68')](_0x3e7db8,function(_0x529710){_0x529710[_0xec78('0x91')]=_0x1a5212['body']['toContactId'];return _0x529710;});return db['CmContactHasItem'][_0xec78('0x53')](_0x1677db,{});})['then'](function(){return addCmHopperPhones(_0x1a5212[_0xec78('0x30')]['toContactId']);})[_0xec78('0x15')](function(){return['ok'];})[_0xec78('0x15')](respondWithResult(_0x596396,null))['catch'](handleError(_0x596396,null));};exports['rescheduleAdditionalPhones']=function(_0x97ad6a,_0x2708e6){var _0x33094c=[];_0x33094c[_0xec78('0x57')](createCmHopperPhone(_0x97ad6a[_0xec78('0x30')]['id'],_0x97ad6a[_0xec78('0x30')][_0xec78('0x92')]));Promise[_0xec78('0x5b')](_0x33094c)[_0xec78('0x15')](function(){return[0x1];})[_0xec78('0x15')](respondWithResult(_0x2708e6,null));};exports[_0xec78('0x93')]=function(_0x57fd45,_0x2f6a18){var _0x4ce500={'raw':![],'where':{}};var _0x267ceb={};var _0x107ea9={'count':0x0,'rows':[]};return db[_0xec78('0x21')]['findOne']({'where':{'id':_0x57fd45[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x2f6a18,null))[_0xec78('0x15')](function(_0x5df85d){if(_0x5df85d){_0x267ceb['model']=_['keys'](db[_0xec78('0x35')][_0xec78('0x94')]);_0x267ceb[_0xec78('0x1e')]=_[_0xec78('0x24')](_0x57fd45[_0xec78('0x1e')]);_0x267ceb[_0xec78('0x95')]=_[_0xec78('0x74')](_0x267ceb[_0xec78('0x73')],_0x267ceb[_0xec78('0x1e')]);_0x4ce500[_0xec78('0x76')]=_[_0xec78('0x74')](_0x267ceb[_0xec78('0x73')],qs[_0xec78('0x75')](_0x57fd45['query'][_0xec78('0x75')]));_0x4ce500[_0xec78('0x76')]=_0x4ce500['attributes'][_0xec78('0x25')]?_0x4ce500[_0xec78('0x76')]:_0x267ceb[_0xec78('0x73')];if(!_0x57fd45[_0xec78('0x1e')][_0xec78('0x5a')](_0xec78('0x7d'))){_0x4ce500[_0xec78('0x7e')]=qs[_0xec78('0x7e')](_0x57fd45[_0xec78('0x1e')][_0xec78('0x7e')]);_0x4ce500['offset']=qs[_0xec78('0x10')](_0x57fd45[_0xec78('0x1e')][_0xec78('0x10')]);}_0x4ce500[_0xec78('0x77')]=qs['sort'](_0x57fd45[_0xec78('0x1e')][_0xec78('0x78')]);_0x4ce500[_0xec78('0x58')]=qs[_0xec78('0x95')](_[_0xec78('0x79')](_0x57fd45[_0xec78('0x1e')],_0x267ceb[_0xec78('0x95')]));_0x4ce500[_0xec78('0x58')][_0xec78('0x96')]=_0x5df85d['id'];if(_0x57fd45[_0xec78('0x1e')]['filter']){_0x4ce500['where']=_[_0xec78('0x7b')](_0x4ce500[_0xec78('0x58')],{'$or':_[_0xec78('0x68')](_0x4ce500[_0xec78('0x76')],function(_0x19b6f5){var _0x24f225={};_0x24f225[_0x19b6f5]={'$like':'%'+_0x57fd45[_0xec78('0x1e')][_0xec78('0x7a')]+'%'};return _0x24f225;})});}_0x4ce500=_[_0xec78('0x7b')]({},_0x4ce500,_0x57fd45['options']);return db[_0xec78('0x35')][_0xec78('0x12')]({'where':_0x4ce500[_0xec78('0x58')]})['then'](function(_0x5849b6){_0x107ea9[_0xec78('0x12')]=_0x5849b6;if(_0x57fd45['query'][_0xec78('0x97')]){_0x4ce500[_0xec78('0x98')]=[{'all':!![]}];}return db[_0xec78('0x35')]['findAll'](_0x4ce500);})[_0xec78('0x15')](function(_0x357eb7){_0x107ea9[_0xec78('0x99')]=_0x357eb7;return _0x107ea9;});}})[_0xec78('0x15')](respondWithFilteredResult(_0x2f6a18,_0x4ce500))['catch'](handleError(_0x2f6a18,null));};exports[_0xec78('0x9a')]=function(_0xee796e,_0xefe746){var _0x327bd3={'raw':!![],'where':{}};var _0x1ddc18={};var _0x39e721={'count':0x0,'rows':[]};return db[_0xec78('0x21')][_0xec78('0x72')]({'where':{'id':_0xee796e[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0xefe746,null))[_0xec78('0x15')](function(_0x270ac7){if(_0x270ac7){_0x1ddc18[_0xec78('0x73')]=_[_0xec78('0x24')](db[_0xec78('0x44')]['rawAttributes']);_0x1ddc18[_0xec78('0x1e')]=_['keys'](_0xee796e[_0xec78('0x1e')]);_0x1ddc18[_0xec78('0x95')]=_[_0xec78('0x74')](_0x1ddc18[_0xec78('0x73')],_0x1ddc18[_0xec78('0x1e')]);_0x327bd3[_0xec78('0x76')]=_[_0xec78('0x74')](_0x1ddc18[_0xec78('0x73')],qs['fields'](_0xee796e[_0xec78('0x1e')][_0xec78('0x75')]));_0x327bd3['attributes']=_0x327bd3['attributes'][_0xec78('0x25')]?_0x327bd3[_0xec78('0x76')]:_0x1ddc18[_0xec78('0x73')];if(!_0xee796e[_0xec78('0x1e')][_0xec78('0x5a')](_0xec78('0x7d'))){_0x327bd3['limit']=qs[_0xec78('0x7e')](_0xee796e[_0xec78('0x1e')][_0xec78('0x7e')]);_0x327bd3[_0xec78('0x10')]=qs[_0xec78('0x10')](_0xee796e[_0xec78('0x1e')][_0xec78('0x10')]);}_0x327bd3[_0xec78('0x77')]=qs['sort'](_0xee796e['query'][_0xec78('0x78')]);_0x327bd3['where']=qs[_0xec78('0x95')](_['pick'](_0xee796e['query'],_0x1ddc18[_0xec78('0x95')]));_0x327bd3[_0xec78('0x58')][_0xec78('0x96')]=_0x270ac7['id'];if(_0xee796e['query'][_0xec78('0x7a')]){_0x327bd3[_0xec78('0x58')]=_[_0xec78('0x7b')](_0x327bd3[_0xec78('0x58')],{'$or':_[_0xec78('0x68')](_0x327bd3[_0xec78('0x76')],function(_0x310837){var _0x52ba2a={};_0x52ba2a[_0x310837]={'$like':'%'+_0xee796e[_0xec78('0x1e')]['filter']+'%'};return _0x52ba2a;})});}_0x327bd3=_[_0xec78('0x7b')]({},_0x327bd3,_0xee796e[_0xec78('0x9b')]);return db[_0xec78('0x44')][_0xec78('0x12')]({'where':_0x327bd3['where']})[_0xec78('0x15')](function(_0x23b277){_0x39e721[_0xec78('0x12')]=_0x23b277;if(_0xee796e[_0xec78('0x1e')][_0xec78('0x97')]){_0x327bd3[_0xec78('0x98')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xec78('0x1d')](_0x327bd3);})[_0xec78('0x15')](function(_0x21c208){_0x39e721[_0xec78('0x99')]=_0x21c208;return _0x39e721;});}})[_0xec78('0x15')](respondWithFilteredResult(_0xefe746,_0x327bd3))[_0xec78('0x22')](handleError(_0xefe746,null));};exports[_0xec78('0x9c')]=function(_0x5cb65d,_0x7cef82){var _0x2a5c81={'raw':!![],'where':{}};var _0x2f052a={};var _0x305339={'count':0x0,'rows':[]};return db[_0xec78('0x21')][_0xec78('0x72')]({'where':{'id':_0x5cb65d[_0xec78('0x5c')]['id']}})[_0xec78('0x15')](handleEntityNotFound(_0x7cef82,null))['then'](function(_0x48a351){if(_0x48a351){_0x2f052a[_0xec78('0x73')]=_[_0xec78('0x24')](db['CmHopperFinal'][_0xec78('0x94')]);_0x2f052a[_0xec78('0x1e')]=_[_0xec78('0x24')](_0x5cb65d[_0xec78('0x1e')]);_0x2f052a[_0xec78('0x95')]=_[_0xec78('0x74')](_0x2f052a[_0xec78('0x73')],_0x2f052a[_0xec78('0x1e')]);_0x2a5c81[_0xec78('0x76')]=_[_0xec78('0x74')](_0x2f052a[_0xec78('0x73')],qs[_0xec78('0x75')](_0x5cb65d[_0xec78('0x1e')][_0xec78('0x75')]));_0x2a5c81[_0xec78('0x76')]=_0x2a5c81[_0xec78('0x76')][_0xec78('0x25')]?_0x2a5c81[_0xec78('0x76')]:_0x2f052a[_0xec78('0x73')];if(!_0x5cb65d[_0xec78('0x1e')][_0xec78('0x5a')](_0xec78('0x7d'))){_0x2a5c81['limit']=qs['limit'](_0x5cb65d[_0xec78('0x1e')][_0xec78('0x7e')]);_0x2a5c81[_0xec78('0x10')]=qs['offset'](_0x5cb65d['query'][_0xec78('0x10')]);}_0x2a5c81[_0xec78('0x77')]=qs[_0xec78('0x78')](_0x5cb65d['query'][_0xec78('0x78')]);_0x2a5c81[_0xec78('0x58')]=qs[_0xec78('0x95')](_['pick'](_0x5cb65d['query'],_0x2f052a['filters']));_0x2a5c81[_0xec78('0x58')][_0xec78('0x96')]=_0x48a351['id'];if(_0x5cb65d['query'][_0xec78('0x7a')]){_0x2a5c81['where']=_[_0xec78('0x7b')](_0x2a5c81[_0xec78('0x58')],{'$or':_[_0xec78('0x68')](_0x2a5c81[_0xec78('0x76')],function(_0x554cff){var _0x2f8c6f={};_0x2f8c6f[_0x554cff]={'$like':'%'+_0x5cb65d['query'][_0xec78('0x7a')]+'%'};return _0x2f8c6f;})});}_0x2a5c81=_['merge']({},_0x2a5c81,_0x5cb65d[_0xec78('0x9b')]);return db['CmHopperFinal']['count']({'where':_0x2a5c81[_0xec78('0x58')]})[_0xec78('0x15')](function(_0x4176c6){_0x305339[_0xec78('0x12')]=_0x4176c6;if(_0x5cb65d['query'][_0xec78('0x97')]){_0x2a5c81[_0xec78('0x98')]=[{'all':!![]}];}return db[_0xec78('0x43')][_0xec78('0x1d')](_0x2a5c81);})[_0xec78('0x15')](function(_0x386109){_0x305339[_0xec78('0x99')]=_0x386109;return _0x305339;});}})['then'](respondWithFilteredResult(_0x7cef82,_0x2a5c81))['catch'](handleError(_0x7cef82,null));};exports[_0xec78('0x9d')]=function(_0x43305a,_0x4d62c7){var _0x1a1dbf={'raw':!![],'where':{}};var _0x52619d={};var _0x31db9c={'count':0x0,'rows':[]};return db[_0xec78('0x21')][_0xec78('0x72')]({'where':{'id':_0x43305a[_0xec78('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d62c7,null))['then'](function(_0x26152f){if(_0x26152f){_0x52619d['model']=_['keys'](db['JscriptySessionReport'][_0xec78('0x94')]);_0x52619d[_0xec78('0x1e')]=_[_0xec78('0x24')](_0x43305a[_0xec78('0x1e')]);_0x52619d[_0xec78('0x95')]=_[_0xec78('0x74')](_0x52619d[_0xec78('0x73')],_0x52619d[_0xec78('0x1e')]);_0x1a1dbf[_0xec78('0x76')]=_['intersection'](_0x52619d[_0xec78('0x73')],qs['fields'](_0x43305a[_0xec78('0x1e')]['fields']));_0x1a1dbf[_0xec78('0x76')]=_0x1a1dbf[_0xec78('0x76')][_0xec78('0x25')]?_0x1a1dbf[_0xec78('0x76')]:_0x52619d[_0xec78('0x73')];if(!_0x43305a[_0xec78('0x1e')][_0xec78('0x5a')]('nolimit')){_0x1a1dbf['limit']=qs[_0xec78('0x7e')](_0x43305a[_0xec78('0x1e')][_0xec78('0x7e')]);_0x1a1dbf[_0xec78('0x10')]=qs[_0xec78('0x10')](_0x43305a[_0xec78('0x1e')]['offset']);}_0x1a1dbf[_0xec78('0x77')]=qs[_0xec78('0x78')](_0x43305a['query'][_0xec78('0x78')]);_0x1a1dbf[_0xec78('0x58')]=qs[_0xec78('0x95')](_[_0xec78('0x79')](_0x43305a[_0xec78('0x1e')],_0x52619d[_0xec78('0x95')]));_0x1a1dbf['where']['ContactId']=_0x26152f['id'];if(_0x43305a['query'][_0xec78('0x7a')]){_0x1a1dbf['where']=_['merge'](_0x1a1dbf['where'],{'$or':_[_0xec78('0x68')](_0x1a1dbf[_0xec78('0x76')],function(_0x5f4bc0){var _0x2fdb94={};_0x2fdb94[_0x5f4bc0]={'$like':'%'+_0x43305a[_0xec78('0x1e')][_0xec78('0x7a')]+'%'};return _0x2fdb94;})});}_0x1a1dbf=_[_0xec78('0x7b')]({},_0x1a1dbf,_0x43305a[_0xec78('0x9b')]);return db[_0xec78('0x4a')][_0xec78('0x12')]({'where':_0x1a1dbf[_0xec78('0x58')]})[_0xec78('0x15')](function(_0x421316){_0x31db9c[_0xec78('0x12')]=_0x421316;if(_0x43305a[_0xec78('0x1e')][_0xec78('0x97')]){_0x1a1dbf[_0xec78('0x98')]=[{'all':!![]}];}return db[_0xec78('0x4a')][_0xec78('0x1d')](_0x1a1dbf);})['then'](function(_0x4fa659){_0x31db9c[_0xec78('0x99')]=_0x4fa659;return _0x31db9c;});}})[_0xec78('0x15')](respondWithFilteredResult(_0x4d62c7,_0x1a1dbf))[_0xec78('0x22')](handleError(_0x4d62c7,null));};exports[_0xec78('0x9e')]=function(_0x525c01,_0x153c5a){try{if(!_0x525c01['body'][_0xec78('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x525c01[_0xec78('0x30')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x525c01[_0xec78('0x30')][_0xec78('0x9f')]){throw new Error(_0xec78('0xa0'));}if(!_0x525c01[_0xec78('0x30')][_0xec78('0xa1')]){throw new Error(_0xec78('0xa2'));}var _0x42a0e9=_0x525c01['body'][_0xec78('0xa3')][_0xec78('0xa4')](',');var _0x456801=_0x525c01['body'][_0xec78('0x9f')]['split'](',');if(!_0x42a0e9[_0xec78('0x25')]||!_0x456801['length']||_0x42a0e9[_0xec78('0x25')]!==_0x456801[_0xec78('0x25')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x525c01[_0xec78('0x30')][_0xec78('0x75')]=_[_0xec78('0xa5')](_0x42a0e9,_0x456801);if(!_0x525c01['body']['fields']['phone']){throw new Error(_0xec78('0xa6'));}if(!_0x525c01[_0xec78('0x30')][_0xec78('0x75')][_0xec78('0xa7')]){throw new Error(_0xec78('0xa8'));}var _0x3cfe73=path['join'](config['root'],_0xec78('0xa9'),_0x525c01[_0xec78('0xaa')]['filename']);fs['chmodSync'](_0x3cfe73,parseInt(_0xec78('0xab'),0x8));var _0x108e36=require(_0xec78('0xac'))[_0xec78('0xad')](path[_0xec78('0x4d')](__dirname,'../../components/import/cm/csv'),[_0x3cfe73,_0x525c01[_0xec78('0x30')][_0xec78('0xa3')],_0x525c01[_0xec78('0x30')][_0xec78('0x9f')],_0x525c01['body']['ListId'],_0x525c01[_0xec78('0x30')][_0xec78('0xae')],_0x525c01['body']['duplicates'],_0x525c01[_0xec78('0x30')][_0xec78('0xa1')]]);return _0x153c5a[_0xec78('0xe')](0xc8)[_0xec78('0xf')]({'message':'File\x20uploaded\x20correctly!','pid':_0x108e36[_0xec78('0xaf')]});}catch(_0x1b717e){return _0x153c5a[_0xec78('0xe')](0x1f4)['send'](_0x1b717e);}};exports[_0xec78('0xb0')]=function(_0x2a13da,_0xe2043){var _0x23c7ee=fs[_0xec78('0xb1')](_0x2a13da[_0xec78('0xaa')][_0xec78('0x2')]);Papa[_0xec78('0xb2')](_0x23c7ee,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3dd212){return _0xe2043[_0xec78('0xe')](0xc8)[_0xec78('0xf')]({'file':_0x2a13da[_0xec78('0xaa')],'fields':_0x3dd212['meta'][_0xec78('0x75')]});}});};exports[_0xec78('0xb3')]=function(_0x210962,_0x3367f1){return db[_0xec78('0xb4')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xec78('0x15')](function(_0x1a1dfd){var _0x4919ff=![];if(!_0x210962['body'][_0xec78('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x210962[_0xec78('0x30')]['binding'][_0xec78('0x71')]){throw new Error(_0xec78('0xa6'));}if(!_0x210962[_0xec78('0x30')][_0xec78('0xb5')]['firstName']){throw new Error(_0xec78('0xa8'));}if(!_0x210962['body']['socket_timestamp']){throw new Error(_0xec78('0xa2'));}var _0x9373fa=require(_0xec78('0xac'))[_0xec78('0xad')](path[_0xec78('0x4d')](__dirname,'../../components/import/cm/csv2'),[_0x210962[_0xec78('0x5c')]['id'],JSON[_0xec78('0xb6')](_0x210962[_0xec78('0x30')]),JSON['stringify'](_0x1a1dfd)]);_0x9373fa['on'](_0xec78('0xb7'),function(){_0x4919ff=!![];return _0x3367f1[_0xec78('0xe')](0xc8)[_0xec78('0xf')]({'message':_0xec78('0xb8'),'pid':_0x9373fa[_0xec78('0xaf')]});});_0x9373fa['on'](_0xec78('0xb9'),function(_0x2f8574){if(_0x2f8574&&!_0x4919ff){return _0x3367f1['status'](0x1f4)[_0xec78('0xf')]({'message':_0xec78('0xba'),'pid':_0x9373fa['pid']});}});})[_0xec78('0x22')](handleError(_0x3367f1,null));};exports[_0xec78('0xbb')]=function(_0x5f59d9,_0x267bb8){return db['User'][_0xec78('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xec78('0xbc')}})[_0xec78('0x15')](function(_0xe03b72){var _0x32a492=![];if(!_0x5f59d9[_0xec78('0x30')][_0xec78('0x59')]){throw new Error(_0xec78('0xbd'));}if(!_0x5f59d9[_0xec78('0x30')][_0xec78('0xb5')][_0xec78('0x71')]){throw new Error(_0xec78('0xa6'));}if(!_0x5f59d9[_0xec78('0x30')][_0xec78('0xb5')][_0xec78('0xa7')]){throw new Error(_0xec78('0xa8'));}if(!_0x5f59d9[_0xec78('0x30')][_0xec78('0xa1')]){throw new Error(_0xec78('0xa2'));}var _0x309a94=require(_0xec78('0xac'))[_0xec78('0xad')](path[_0xec78('0x4d')](__dirname,_0xec78('0xbe')),[_0x5f59d9[_0xec78('0x5c')]['id'],JSON['stringify'](_0x5f59d9[_0xec78('0x30')]),JSON[_0xec78('0xb6')](_0xe03b72)]);_0x309a94['on'](_0xec78('0xb7'),function(){_0x32a492=!![];return _0x267bb8[_0xec78('0xe')](0xc8)[_0xec78('0xf')]({'message':_0xec78('0xb8'),'pid':_0x309a94[_0xec78('0xaf')]});});_0x309a94['on']('exit',function(_0x193237){if(_0x193237&&!_0x32a492){return _0x267bb8[_0xec78('0xe')](0x1f4)[_0xec78('0xf')]({'message':_0xec78('0xba'),'pid':_0x309a94['pid']});}});})[_0xec78('0x22')](handleError(_0x267bb8,null));};exports[_0xec78('0xbf')]=function(_0x36fc4a,_0x301b8d){var _0x144013=['mail','chat',_0xec78('0xc0'),_0xec78('0xc1'),_0xec78('0xc2'),'whatsapp',_0xec78('0xc3')];var _0x37c8c6={'offset':0x0,'order':qs[_0xec78('0x78')](_0xec78('0xc4'))},_0x2b4407={'count':0x0,'rows':[]};Promise[_0xec78('0xc5')]()[_0xec78('0x15')](function(){if(_0x36fc4a[_0xec78('0x1e')][_0xec78('0xc6')]){if(!_[_0xec78('0xc7')](_0x144013,_0x36fc4a['query']['channel'][_0xec78('0xc8')]())){throw new Error(_0xec78('0xc9'));}_0x144013=[_0x36fc4a[_0xec78('0x1e')][_0xec78('0xc6')]['toLowerCase']()];}if(_0x36fc4a[_0xec78('0x1e')][_0xec78('0xca')]){try{var _0x521370=JSON[_0xec78('0xb2')](_0x36fc4a['query']['range']);if(!moment(_0x521370['from'])[_0xec78('0xcb')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x521370['to'])[_0xec78('0xcb')]()){throw new Error(_0xec78('0xcc'));}}catch(_0x41e10b){throw new Error(_0xec78('0xcd'));}}if(!_0x36fc4a[_0xec78('0x1e')]['hasOwnProperty'](_0xec78('0x7d'))){_0x37c8c6['limit']=qs[_0xec78('0x7e')](_0x36fc4a['query']['limit']||0xa);_0x37c8c6[_0xec78('0x10')]=qs[_0xec78('0x10')](_0x36fc4a[_0xec78('0x1e')][_0xec78('0x10')]);}var _0x52ef24=_0x144013[_0xec78('0x68')](function(_0x449ede){if(_0x449ede===_0xec78('0xc3')){var _0x4d5297={'attributes':['id','uniqueid',_0xec78('0x2d'),_0xec78('0xce'),'destination',_0xec78('0xcf'),'starttime',_0xec78('0xd0'),'duration',_0xec78('0xd1'),_0xec78('0xd2'),'userDisposition',_0xec78('0xd3'),_0xec78('0xd4'),_0xec78('0xd5')],'where':{'ContactId':_0x36fc4a['params']['id']},'include':[{'model':db[_0xec78('0xb4')],'as':'User','attributes':['id','name',_0xec78('0xd6'),_0xec78('0x2b')]}],'order':[[_0xec78('0xd2'),_0xec78('0xd7')]]};if(_0x36fc4a[_0xec78('0x1e')][_0xec78('0xca')]){_0x4d5297[_0xec78('0x58')][_0xec78('0xd2')]={'$gte':_0x521370[_0xec78('0x31')],'$lte':_0x521370['to']};}return db[_0xec78('0xd8')]['findAndCountAll'](_0x4d5297)[_0xec78('0x15')](function(_0x46da33){_0x2b4407['count']+=_0x46da33[_0xec78('0x12')];return _[_0xec78('0x68')](_0x46da33[_0xec78('0x99')],function(_0x5bbb8c){var _0x3d69c5=_0x5bbb8c[_0xec78('0x32')]({'plain':!![]});_0x3d69c5['channel']=_0x449ede;if(_0x3d69c5['User']){_0x3d69c5[_0xec78('0xb4')]={'id':_0x3d69c5[_0xec78('0xb4')]['id'],'name':_0x3d69c5[_0xec78('0xb4')][_0xec78('0x18')],'fullname':_0x3d69c5['User'][_0xec78('0xd6')],'alias':_0x3d69c5[_0xec78('0xb4')][_0xec78('0x2b')]};}return _0x3d69c5;});});}else{var _0xb6ebdc=_[_0xec78('0xd9')](_0x449ede)+(_0x449ede===_0xec78('0xda')?'Website':_0xec78('0xdb'));var _0x137e76={'attributes':['id','closed','closedAt',_0xec78('0xd2'),_0xec78('0xd1'),'disposition',_0xec78('0xdc'),_0xec78('0xdd'),_0xec78('0xd5'),_0xb6ebdc+'Id'],'where':{'ContactId':_0x36fc4a[_0xec78('0x5c')]['id']},'include':[{'model':db[_0xb6ebdc],'as':_0xec78('0xdb'),'attributes':['id','name',_0xec78('0xde')]},{'model':db[_0xec78('0xb4')],'as':_0xec78('0xdf'),'attributes':['id',_0xec78('0x18'),_0xec78('0xd6')]},{'model':db['Tag'],'as':_0xec78('0x5e'),'attributes':['id',_0xec78('0x18'),_0xec78('0x5f')],'through':{'attributes':[]}}],'order':[[_0xec78('0xd2'),_0xec78('0xd7')]]};if(_0x36fc4a['query'][_0xec78('0xca')]){_0x137e76[_0xec78('0x58')]['createdAt']={'$gte':_0x521370[_0xec78('0x31')],'$lte':_0x521370['to']};}switch(_0x449ede){case _0xec78('0xda'):_0x137e76[_0xec78('0x76')][_0xec78('0x57')](_0xec78('0xe0'),_0xec78('0xe1'),'customerPort',_0xec78('0xe2'),_0xec78('0xe3'),_0xec78('0xe4'),'ratingType',_0xec78('0xe5'),_0xec78('0xe6'));break;case _0xec78('0xe7'):_0x137e76[_0xec78('0x76')][_0xec78('0x57')](_0xec78('0xe8'),_0xec78('0xe9'));break;case'openchannel':_0x137e76[_0xec78('0x76')][_0xec78('0x57')]('externalUrl',_0xec78('0xea'));break;}return db[_[_0xec78('0xd9')](_0x449ede)+'Interaction'][_0xec78('0xeb')](_0x137e76)[_0xec78('0x15')](function(_0x49bbb5){_0x2b4407[_0xec78('0x12')]+=_0x49bbb5[_0xec78('0x12')];return _[_0xec78('0x68')](_0x49bbb5[_0xec78('0x99')],function(_0x4cd0){var _0xbcbba=_0x4cd0[_0xec78('0x32')]({'plain':!![]});_0xbcbba[_0xec78('0xc6')]=_0x449ede;if(_0xbcbba[_0xec78('0xdf')]){_0xbcbba[_0xec78('0xdf')]={'id':_0xbcbba[_0xec78('0xdf')]['id'],'name':_0xbcbba[_0xec78('0xdf')][_0xec78('0x18')],'fullname':_0xbcbba[_0xec78('0xdf')][_0xec78('0xd6')]};}return _0xbcbba;});});}});return Promise[_0xec78('0x5b')](_0x52ef24);})['then'](function(_0x2566c8){return _(_0x2566c8)[_0xec78('0xec')]()[_0xec78('0xed')](_0xec78('0xd2'))[_0xec78('0xee')]()[_0xec78('0xef')]();})['then'](function(_0x46a3c9){_0x2b4407[_0xec78('0x99')]=_0x37c8c6[_0xec78('0x7e')]?_0x46a3c9[_0xec78('0xf0')](_0x37c8c6[_0xec78('0x10')],_0x37c8c6[_0xec78('0x10')]+_0x37c8c6['limit']):_0x46a3c9;return _0x2b4407;})[_0xec78('0x15')](respondWithFilteredResult(_0x301b8d,_0x37c8c6))[_0xec78('0x22')](handleError(_0x301b8d,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 6680df0..b7a47b5 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28ef=['CmContact','setMaxListeners','save','update','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x28ef,0xb7));var _0xf28e=function(_0x3a623e,_0x351947){_0x3a623e=_0x3a623e-0x0;var _0x46a64b=_0x28ef[_0x3a623e];return _0x46a64b;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xf28e('0x0'))['db'][_0xf28e('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf28e('0x2')](0x0);var events={'afterCreate':_0xf28e('0x3'),'afterUpdate':_0xf28e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1221d9){return function(_0x17626e,_0x1fb007,_0x2f9f30){CmContactEvents['emit'](_0x1221d9+':'+_0x17626e['id'],_0x17626e);CmContactEvents['emit'](_0x1221d9,_0x17626e);_0x2f9f30(null);};}for(var e in events){if(events[_0xf28e('0x5')](e)){var event=events[e];CmContact[_0xf28e('0x6')](e,emitEvent(event));}}module[_0xf28e('0x7')]=CmContactEvents; \ No newline at end of file +var _0x59f7=['emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x1407d1,_0x4cc88c){var _0x4e6cbe=function(_0x40b958){while(--_0x40b958){_0x1407d1['push'](_0x1407d1['shift']());}};_0x4e6cbe(++_0x4cc88c);}(_0x59f7,0xc1));var _0x759f=function(_0x1692cd,_0x34ba8e){_0x1692cd=_0x1692cd-0x0;var _0x180cff=_0x59f7[_0x1692cd];return _0x180cff;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x759f('0x0'))['db'][_0x759f('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x759f('0x2')](0x0);var events={'afterCreate':_0x759f('0x3'),'afterUpdate':_0x759f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45f810){return function(_0x693f13,_0x470cc7,_0x45ac7e){CmContactEvents[_0x759f('0x5')](_0x45f810+':'+_0x693f13['id'],_0x693f13);CmContactEvents[_0x759f('0x5')](_0x45f810,_0x693f13);_0x45ac7e(null);};}for(var e in events){if(events[_0x759f('0x6')](e)){var event=events[e];CmContact[_0x759f('0x7')](e,emitEvent(event));}}module[_0x759f('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 439dc41..e2a41ef 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc0a6=['length','isEmpty','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','get','onlyIfOpen','outbound','CmHopperBlack','cmContact,\x20%s,\x20%s','message','CmList','Lists','always','BlackLists'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0xc0a6,0xe9));var _0x6c0a=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0xc0a6[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0x6c0a('0x0'));var util=require(_0x6c0a('0x1'));var logger=require(_0x6c0a('0x2'))(_0x6c0a('0x3'));var moment=require(_0x6c0a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6c0a('0x5'));var fs=require('fs');var path=require(_0x6c0a('0x6'));var rimraf=require(_0x6c0a('0x7'));var config=require(_0x6c0a('0x8'));var shared=require(_0x6c0a('0x9'));var attributes=require(_0x6c0a('0xa'));module['exports']=function(_0x48d823,_0x108e71){return _0x48d823[_0x6c0a('0xb')](_0x6c0a('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x6c0a('0xd'),'fields':[_0x6c0a('0xd')]},{'name':_0x6c0a('0xe'),'fields':[_0x6c0a('0xf'),_0x6c0a('0x10'),_0x6c0a('0xd'),_0x6c0a('0x11'),_0x6c0a('0x12'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x6c0a('0x13'),'collate':_0x6c0a('0x14'),'hooks':{'afterCreate':function(_0x12cb59,_0x1736ed,_0x540413){var _0x559a5c=_0x48d823[_0x6c0a('0x15')];var _0x2b240a=_0x12cb59['get']({'plain':!![]});function _0x2dd149(){return function(_0x376d72){logger[_0x6c0a('0x16')](_0x6c0a('0x17'),'afterCreate',util[_0x6c0a('0x18')](_0x376d72,{'showHidden':![],'depth':null}));};}function _0x1c174e(_0x25c476,_0x16addf){var _0xf87a51=_0x16addf[_0x6c0a('0x19')]?_0x16addf[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b'));return new BPromise(function(_0x1f3554,_0x31bf71){if(_[_0x6c0a('0x1c')](_0x16addf[_0x6c0a('0x1d')])){_0x1f3554({'ret':_0xf87a51});}else{_0x559a5c[_0x6c0a('0x1e')][_0x6c0a('0x1f')]({'where':{'id':_0x25c476['id']}})[_0x6c0a('0x20')](function(_0x29a120){if(!_[_0x6c0a('0x1c')](_0x29a120)){var _0x13f893=_0x29a120[_0x6c0a('0x1d')];if(!_[_0x6c0a('0x1c')](_0x13f893)){var _0x377ce1=shared[_0x6c0a('0x21')];var _0x39eb25=_0x377ce1[_0x13f893];var _0x357987=_0x377ce1[_0x16addf[_0x6c0a('0x1d')]];if(!_[_0x6c0a('0x1c')](_0x39eb25)&&!_[_0x6c0a('0x1c')](_0x357987)){var _0x5e2fc0=_0x39eb25['utcOffset']-_0x357987[_0x6c0a('0x22')];_0xf87a51=_0x16addf[_0x6c0a('0x19')]?_0x16addf[_0x6c0a('0x19')]:moment();var _0x529f58=moment(_0xf87a51)['add'](_0x5e2fc0,_0x6c0a('0x23'));_0x1f3554({'ret':_0x529f58['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1f3554({'ret':_0xf87a51});}else _0x1f3554({'ret':_0xf87a51});}else{_0x1f3554({'ret':_0xf87a51});}});}});return 0xa;}var _0x77b714=function(_0x3f02b1){return new BPromise(function(_0x328176,_0x25c2ef){_0x1c174e(_0x3f02b1,_0x2b240a)[_0x6c0a('0x20')](function(_0x5c34c3){_0x2b240a[_0x6c0a('0x19')]=_0x5c34c3[_0x6c0a('0x24')];_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x1f')]({'where':{'phone':_0x2b240a[_0x6c0a('0xd')],'VoiceQueueId':_0x3f02b1['id']}})[_0x6c0a('0x20')](function(_0x345673){if(!_[_0x6c0a('0x1c')](_0x345673)){throw new Error(_0x6c0a('0x26')+_0x2b240a[_0x6c0a('0xd')]+_0x6c0a('0x27')+_0x3f02b1['id']);}return _0x559a5c['CmHopper'][_0x6c0a('0x28')]({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a[_0x6c0a('0x29')],'priority':_0x2b240a[_0x6c0a('0x2a')]?_0x2b240a[_0x6c0a('0x2a')]:0x2,'scheduledat':_0x2b240a['scheduledat']?_0x2b240a[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')),'callback':_0x2b240a[_0x6c0a('0x2b')]?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a[_0x6c0a('0x2b')]:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3f02b1['id']});})[_0x6c0a('0x2c')](function(_0x1d4b93){_0x25c2ef(_0x1d4b93);});});});};var _0x491589=function(_0x241a88){return new BPromise(function(_0x4822c3,_0x72ddb6){_0x1c174e(_0x241a88,_0x2b240a)[_0x6c0a('0x20')](function(_0x4963cf){_0x2b240a['scheduledat']=_0x4963cf[_0x6c0a('0x24')];_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x1f')]({'where':{'phone':_0x2b240a[_0x6c0a('0xd')],'VoiceQueueId':_0x241a88['id']}})['then'](function(_0x2597ba){if(!_['isNil'](_0x2597ba)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2b240a[_0x6c0a('0xd')]+_0x6c0a('0x2d')+_0x241a88['id']);}return _0x559a5c[_0x6c0a('0x2e')]['findOne']({'where':{'calleridnum':_0x2b240a[_0x6c0a('0xd')],'VoiceQueueId':_0x241a88['id']}});})[_0x6c0a('0x20')](function(_0x12f37b){if(!_[_0x6c0a('0x1c')](_0x12f37b)){throw new Error(_0x6c0a('0x2f')+_0x2b240a['phone']+_0x6c0a('0x30')+_0x241a88['id']);}return _0x559a5c['CmHopper'][_0x6c0a('0x28')]({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a['ListId'],'priority':_0x2b240a['priority']?_0x2b240a['priority']:0x2,'scheduledat':_0x2b240a['scheduledat']?_0x2b240a[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')),'callback':_0x2b240a[_0x6c0a('0x2b')]?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a[_0x6c0a('0x2b')]:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')):undefined,'VoiceQueueId':_0x241a88['id']});})[_0x6c0a('0x2c')](function(_0x446271){_0x72ddb6(_0x446271);});});});};function _0x4b083e(){return function(_0x25efc0){logger[_0x6c0a('0x16')](_0x6c0a('0x17'),_0x6c0a('0x31'),util[_0x6c0a('0x18')](_0x25efc0,{'showHidden':![],'depth':null}));};}function _0x24441d(_0x2cd010,_0x553f0f){var _0x639f65=_0x553f0f[_0x6c0a('0x19')]?_0x553f0f[_0x6c0a('0x19')]:moment()['format'](_0x6c0a('0x1b'));return new BPromise(function(_0x4dfde9,_0x4278ea){if(_['isNil'](_0x553f0f[_0x6c0a('0x1d')])){_0x4dfde9({'ret':_0x639f65});}else{_0x559a5c[_0x6c0a('0x32')][_0x6c0a('0x1f')]({'where':{'id':_0x2cd010['id']}})[_0x6c0a('0x20')](function(_0x35321d){if(!_['isNil'](_0x35321d)){var _0xab65b2=_0x35321d[_0x6c0a('0x1d')];if(!_[_0x6c0a('0x1c')](_0xab65b2)){var _0x334217=shared[_0x6c0a('0x21')];var _0x3677a5=_0x334217[_0xab65b2];var _0x3d820a=_0x334217[_0x553f0f[_0x6c0a('0x1d')]];if(!_[_0x6c0a('0x1c')](_0x3677a5)&&!_['isNil'](_0x3d820a)){var _0x4e2a3c=_0x3677a5[_0x6c0a('0x22')]-_0x3d820a[_0x6c0a('0x22')];_0x639f65=_0x553f0f['scheduledat']?_0x553f0f[_0x6c0a('0x19')]:moment();var _0x5b3380=moment(_0x639f65)[_0x6c0a('0x33')](_0x4e2a3c,_0x6c0a('0x23'));_0x4dfde9({'ret':_0x5b3380[_0x6c0a('0x1a')](_0x6c0a('0x1b'))});}else _0x4dfde9({'ret':_0x639f65});}else _0x4dfde9({'ret':_0x639f65});}else{_0x4dfde9({'ret':_0x639f65});}});}});return 0xa;}var _0x2602da=function(_0x4a6dd8){return new BPromise(function(_0x4d0d74,_0xaabfff){_0x24441d(_0x4a6dd8,_0x2b240a)['then'](function(_0x215f4a){_0x2b240a['scheduledat']=_0x215f4a['ret'];_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x1f')]({'where':{'phone':_0x2b240a[_0x6c0a('0xd')],'CampaignId':_0x4a6dd8['id']}})[_0x6c0a('0x20')](function(_0x4cdfab){if(!_['isNil'](_0x4cdfab)){throw new Error(_0x6c0a('0x26')+_0x2b240a[_0x6c0a('0xd')]+_0x6c0a('0x34')+_0x4a6dd8['id']);}return _0x559a5c[_0x6c0a('0x25')]['create']({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a['ListId'],'priority':_0x2b240a[_0x6c0a('0x2a')]?_0x2b240a[_0x6c0a('0x2a')]:0x2,'scheduledat':_0x2b240a['scheduledat']?_0x2b240a[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')),'callback':_0x2b240a[_0x6c0a('0x2b')]?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a['callbackUniqueid']:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()['format'](_0x6c0a('0x1b')):undefined,'CampaignId':_0x4a6dd8['id']});})[_0x6c0a('0x2c')](function(_0x8a163b){_0xaabfff(_0x8a163b);});});});};var _0x3025e5=function(_0x258653){return new BPromise(function(_0xcad7a6,_0x4595ea){_0x24441d(_0x258653,_0x2b240a)[_0x6c0a('0x20')](function(_0x5d0574){_0x2b240a[_0x6c0a('0x19')]=_0x5d0574[_0x6c0a('0x24')];_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x1f')]({'where':{'phone':_0x2b240a[_0x6c0a('0xd')],'CampaignId':_0x258653['id']}})['then'](function(_0x4c8b82){if(!_[_0x6c0a('0x1c')](_0x4c8b82)){throw new Error(_0x6c0a('0x26')+_0x2b240a[_0x6c0a('0xd')]+_0x6c0a('0x35')+_0x258653['id']);}return _0x559a5c[_0x6c0a('0x2e')]['findOne']({'where':{'calleridnum':_0x2b240a['phone'],'CampaignId':_0x258653['id']}});})[_0x6c0a('0x20')](function(_0x3b1b0f){if(!_[_0x6c0a('0x1c')](_0x3b1b0f)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2b240a['phone']+_0x6c0a('0x36')+_0x258653['id']);}return _0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x28')]({'phone':_0x2b240a['phone'],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a[_0x6c0a('0x29')],'priority':_0x2b240a['priority']?_0x2b240a[_0x6c0a('0x2a')]:0x2,'scheduledat':_0x2b240a[_0x6c0a('0x19')]?_0x2b240a[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')),'callback':_0x2b240a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a['callbackUniqueid']:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')):undefined,'CampaignId':_0x258653['id']});})[_0x6c0a('0x2c')](function(_0x3f2cd5){_0x4595ea(_0x3f2cd5);});});});};if(_0x2b240a[_0x6c0a('0x29')]){_0x559a5c[_0x6c0a('0x1e')][_0x6c0a('0x37')]({'where':{'type':'outbound'},'attributes':['id',_0x6c0a('0x38'),_0x6c0a('0x1d')],'include':[{'model':_0x559a5c['CmList'],'as':'Lists','where':{'id':_0x2b240a['ListId']}}]})[_0x6c0a('0x20')](function(_0x5515fc){if(_0x5515fc){var _0x22ad29=[];for(var _0x24090c=0x0,_0x35faea;_0x24090c<_0x5515fc['length'];_0x24090c+=0x1){_0x35faea=_0x5515fc[_0x24090c][_0x6c0a('0x39')]({'plain':!![]});switch(_0x35faea[_0x6c0a('0x38')]){case'always':_0x491589(_0x35faea)[_0x6c0a('0x2c')](_0x2dd149());break;case _0x6c0a('0x3a'):_0x77b714(_0x35faea)[_0x6c0a('0x2c')](_0x2dd149());break;default:_0x24441d(_0x35faea,_0x2b240a)['then'](function(_0x25851c){_0x2b240a[_0x6c0a('0x19')]=_0x25851c[_0x6c0a('0x24')];_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x28')]({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a[_0x6c0a('0x29')],'scheduledat':_0x2b240a[_0x6c0a('0x19')]?_0x2b240a[_0x6c0a('0x19')]:moment()['format'](_0x6c0a('0x1b')),'priority':_0x2b240a[_0x6c0a('0x2a')]?_0x2b240a[_0x6c0a('0x2a')]:0x2,'callback':_0x2b240a[_0x6c0a('0x2b')]?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a[_0x6c0a('0x2b')]:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()['format'](_0x6c0a('0x1b')):undefined,'VoiceQueueId':_0x35faea['id']})[_0x6c0a('0x2c')](_0x2dd149());});}}}})[_0x6c0a('0x20')](function(){return _0x559a5c['VoiceQueue']['findAll']({'where':{'type':_0x6c0a('0x3b')},'attributes':['id'],'include':[{'model':_0x559a5c['CmList'],'as':'BlackLists','where':{'id':_0x2b240a['ListId']}}]})[_0x6c0a('0x20')](function(_0x1e9178){if(_0x1e9178){var _0x570c0b=[];for(var _0x5a29ab=0x0,_0x2f0cd5;_0x5a29ab<_0x1e9178['length'];_0x5a29ab+=0x1){_0x2f0cd5=_0x1e9178[_0x5a29ab][_0x6c0a('0x39')]({'plain':!![]});_0x559a5c[_0x6c0a('0x3c')][_0x6c0a('0x28')]({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a['ListId'],'VoiceQueueId':_0x2f0cd5['id']})['catch'](function(_0x1238dc){logger[_0x6c0a('0x16')](_0x6c0a('0x3d'),_0x6c0a('0x31'),_0x1238dc[_0x6c0a('0x3e')]);});}}});})[_0x6c0a('0x20')](function(){return _0x559a5c[_0x6c0a('0x32')][_0x6c0a('0x37')]({'attributes':['id',_0x6c0a('0x38'),'dialTimezone'],'include':[{'model':_0x559a5c[_0x6c0a('0x3f')],'as':_0x6c0a('0x40'),'where':{'id':_0x2b240a[_0x6c0a('0x29')]}}]})[_0x6c0a('0x20')](function(_0x42557a){if(_0x42557a){var _0x6db3a2=[];for(var _0x2d4ba8=0x0,_0x3709e8;_0x2d4ba8<_0x42557a['length'];_0x2d4ba8+=0x1){_0x3709e8=_0x42557a[_0x2d4ba8]['get']({'plain':!![]});switch(_0x3709e8[_0x6c0a('0x38')]){case _0x6c0a('0x41'):_0x3025e5(_0x3709e8)[_0x6c0a('0x2c')](_0x4b083e());break;case _0x6c0a('0x3a'):_0x2602da(_0x3709e8)['catch'](_0x4b083e());break;default:_0x559a5c[_0x6c0a('0x25')][_0x6c0a('0x28')]({'phone':_0x2b240a[_0x6c0a('0xd')],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a[_0x6c0a('0x29')],'scheduledat':_0x2b240a[_0x6c0a('0x19')]?_0x2b240a[_0x6c0a('0x19')]:moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')),'priority':_0x2b240a[_0x6c0a('0x2a')]?_0x2b240a[_0x6c0a('0x2a')]:0x2,'callback':_0x2b240a[_0x6c0a('0x2b')]?!![]:![],'callbackuniqueid':_0x2b240a[_0x6c0a('0x2b')]?_0x2b240a[_0x6c0a('0x2b')]:undefined,'callbackat':_0x2b240a[_0x6c0a('0x2b')]?moment()[_0x6c0a('0x1a')](_0x6c0a('0x1b')):undefined,'CampaignId':_0x3709e8['id']})[_0x6c0a('0x2c')](_0x4b083e());}}}});})[_0x6c0a('0x20')](function(){return _0x559a5c[_0x6c0a('0x32')]['findAll']({'attributes':['id'],'include':[{'model':_0x559a5c['CmList'],'as':_0x6c0a('0x42'),'where':{'id':_0x2b240a[_0x6c0a('0x29')]}}]})[_0x6c0a('0x20')](function(_0x4f5ac4){if(_0x4f5ac4){var _0x5ccf72=[];for(var _0x10abed=0x0,_0x2ff7ef;_0x10abed<_0x4f5ac4[_0x6c0a('0x43')];_0x10abed+=0x1){_0x2ff7ef=_0x4f5ac4[_0x10abed]['get']({'plain':!![]});_0x559a5c[_0x6c0a('0x3c')][_0x6c0a('0x28')]({'phone':_0x2b240a['phone'],'ContactId':_0x2b240a['id'],'ListId':_0x2b240a[_0x6c0a('0x29')],'CampaignId':_0x2ff7ef['id']})[_0x6c0a('0x2c')](function(_0x28a0e1){logger['error'](_0x6c0a('0x3d'),_0x6c0a('0x31'),_0x28a0e1[_0x6c0a('0x3e')]);});}}});})[_0x6c0a('0x20')](function(){_0x540413();})[_0x6c0a('0x2c')](function(_0x4978b1){logger[_0x6c0a('0x16')](_0x6c0a('0x3d'),_0x6c0a('0x31'),_0x4978b1[_0x6c0a('0x3e')]);_0x540413(_0x4978b1);});}else{_0x540413(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x328350,_0x24f1df,_0x3400aa){var _0x2aab55=_0x48d823[_0x6c0a('0x15')];var _0x596f08=_0x328350[_0x6c0a('0x39')]({'plain':!![]});return _0x2aab55['CmHopper'][_0x6c0a('0x37')]({'raw':!![],'where':{'ListId':_0x596f08[_0x6c0a('0x29')],'ContactId':_0x596f08['id']}})[_0x6c0a('0x20')](function(_0x5e5e89){if(!_[_0x6c0a('0x44')](_0x5e5e89)){var _0x22cacb=[];for(var _0x3617c1=0x0;_0x3617c1<_0x5e5e89[_0x6c0a('0x43')];_0x3617c1+=0x1){var _0xcbddc4=_0x2aab55[_0x6c0a('0x25')]['destroy']({'where':{'ListId':_0x5e5e89[_0x3617c1][_0x6c0a('0x29')],'ContactId':_0x5e5e89[_0x3617c1][_0x6c0a('0x45')],'VoiceQueueId':_0x5e5e89[_0x3617c1]['VoiceQueueId'],'CampaignId':_0x5e5e89[_0x3617c1]['CampaignId']}});_0x22cacb[_0x6c0a('0x46')](_0xcbddc4);}return BPromise[_0x6c0a('0x47')](_0x22cacb);}})[_0x6c0a('0x20')](function(_0x152aa0){logger[_0x6c0a('0x48')](_0x6c0a('0x49'),util[_0x6c0a('0x18')](_0x152aa0,{'showHidden':![],'depth':null}));_0x3400aa();})[_0x6c0a('0x2c')](function(_0x2da3b4){logger['error'](_0x6c0a('0x4a'),util[_0x6c0a('0x18')](_0x2da3b4,{'showHidden':![],'depth':null}));_0x3400aa(_0x2da3b4);});}}});}; \ No newline at end of file +var _0xc8e0=['CmHopperBlack','message','length','onlyIfOpen','cmContact,\x20%s,\x20%s','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','then','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','CmList','BlackLists'];(function(_0xca93f0,_0x4006be){var _0x461ee6=function(_0x4433ea){while(--_0x4433ea){_0xca93f0['push'](_0xca93f0['shift']());}};_0x461ee6(++_0x4006be);}(_0xc8e0,0xa8));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x0c8e('0x0'));var util=require(_0x0c8e('0x1'));var logger=require(_0x0c8e('0x2'))('api');var moment=require(_0x0c8e('0x3'));var BPromise=require('bluebird');var rp=require(_0x0c8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c8e('0x5'));var config=require(_0x0c8e('0x6'));var shared=require(_0x0c8e('0x7'));var attributes=require(_0x0c8e('0x8'));module[_0x0c8e('0x9')]=function(_0x2ed962,_0x132013){return _0x2ed962[_0x0c8e('0xa')](_0x0c8e('0xb'),attributes,{'tableName':_0x0c8e('0xc'),'paranoid':!![],'indexes':[{'name':_0x0c8e('0xd'),'fields':[_0x0c8e('0xd')]},{'name':_0x0c8e('0xe'),'fields':[_0x0c8e('0xf'),_0x0c8e('0x10'),'phone','mobile',_0x0c8e('0x11'),_0x0c8e('0x12')],'type':_0x0c8e('0x13')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x0c8e('0x14'),'hooks':{'afterCreate':function(_0x562be7,_0x414cb6,_0xa96274){var _0xc5adfd=_0x2ed962[_0x0c8e('0x15')];var _0x395eb2=_0x562be7[_0x0c8e('0x16')]({'plain':!![]});function _0x68b016(){return function(_0x23ccf4){logger[_0x0c8e('0x17')](_0x0c8e('0x18'),_0x0c8e('0x19'),util[_0x0c8e('0x1a')](_0x23ccf4,{'showHidden':![],'depth':null}));};}function _0x5d8437(_0x20bb98,_0xf79f42){var _0x31c93f=_0xf79f42['scheduledat']?_0xf79f42[_0x0c8e('0x1b')]:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d'));return new BPromise(function(_0x392873,_0x2235f2){if(_[_0x0c8e('0x1e')](_0xf79f42[_0x0c8e('0x1f')])){_0x392873({'ret':_0x31c93f});}else{_0xc5adfd['VoiceQueue'][_0x0c8e('0x20')]({'where':{'id':_0x20bb98['id']}})[_0x0c8e('0x21')](function(_0x39e73d){if(!_[_0x0c8e('0x1e')](_0x39e73d)){var _0x520489=_0x39e73d['dialTimezone'];if(!_[_0x0c8e('0x1e')](_0x520489)){var _0x12172a=shared['timezones'];var _0xedd773=_0x12172a[_0x520489];var _0x52909d=_0x12172a[_0xf79f42[_0x0c8e('0x1f')]];if(!_[_0x0c8e('0x1e')](_0xedd773)&&!_[_0x0c8e('0x1e')](_0x52909d)){var _0x1f1607=_0xedd773[_0x0c8e('0x22')]-_0x52909d[_0x0c8e('0x22')];_0x31c93f=_0xf79f42[_0x0c8e('0x1b')]?_0xf79f42[_0x0c8e('0x1b')]:moment();var _0x51539d=moment(_0x31c93f)[_0x0c8e('0x23')](_0x1f1607,_0x0c8e('0x24'));_0x392873({'ret':_0x51539d[_0x0c8e('0x1c')](_0x0c8e('0x1d'))});}else _0x392873({'ret':_0x31c93f});}else _0x392873({'ret':_0x31c93f});}else{_0x392873({'ret':_0x31c93f});}});}});return 0xa;}var _0x1afb9e=function(_0x2b9edd){return new BPromise(function(_0x5b0759,_0x280983){_0x5d8437(_0x2b9edd,_0x395eb2)['then'](function(_0x23d7cd){_0x395eb2[_0x0c8e('0x1b')]=_0x23d7cd['ret'];_0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x20')]({'where':{'phone':_0x395eb2[_0x0c8e('0xd')],'VoiceQueueId':_0x2b9edd['id']}})[_0x0c8e('0x21')](function(_0x28510e){if(!_[_0x0c8e('0x1e')](_0x28510e)){throw new Error(_0x0c8e('0x26')+_0x395eb2[_0x0c8e('0xd')]+_0x0c8e('0x27')+_0x2b9edd['id']);}return _0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x28')]({'phone':_0x395eb2['phone'],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2[_0x0c8e('0x29')],'priority':_0x395eb2[_0x0c8e('0x2a')]?_0x395eb2[_0x0c8e('0x2a')]:0x2,'scheduledat':_0x395eb2['scheduledat']?_0x395eb2[_0x0c8e('0x1b')]:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')),'callback':_0x395eb2[_0x0c8e('0x2b')]?!![]:![],'callbackuniqueid':_0x395eb2[_0x0c8e('0x2b')]?_0x395eb2[_0x0c8e('0x2b')]:undefined,'callbackat':_0x395eb2['callbackUniqueid']?moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')):undefined,'VoiceQueueId':_0x2b9edd['id']});})[_0x0c8e('0x2c')](function(_0x353dbb){_0x280983(_0x353dbb);});});});};var _0xdd9ca5=function(_0x118176){return new BPromise(function(_0x5bce77,_0x457948){_0x5d8437(_0x118176,_0x395eb2)[_0x0c8e('0x21')](function(_0x4e7dc0){_0x395eb2[_0x0c8e('0x1b')]=_0x4e7dc0[_0x0c8e('0x2d')];_0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x20')]({'where':{'phone':_0x395eb2[_0x0c8e('0xd')],'VoiceQueueId':_0x118176['id']}})['then'](function(_0x233df8){if(!_[_0x0c8e('0x1e')](_0x233df8)){throw new Error('cmContact,\x20afterCreate\x20'+_0x395eb2[_0x0c8e('0xd')]+_0x0c8e('0x2e')+_0x118176['id']);}return _0xc5adfd[_0x0c8e('0x2f')]['findOne']({'where':{'calleridnum':_0x395eb2[_0x0c8e('0xd')],'VoiceQueueId':_0x118176['id']}});})[_0x0c8e('0x21')](function(_0x5d4d6e){if(!_[_0x0c8e('0x1e')](_0x5d4d6e)){throw new Error(_0x0c8e('0x30')+_0x395eb2[_0x0c8e('0xd')]+_0x0c8e('0x31')+_0x118176['id']);}return _0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x28')]({'phone':_0x395eb2[_0x0c8e('0xd')],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2['ListId'],'priority':_0x395eb2[_0x0c8e('0x2a')]?_0x395eb2[_0x0c8e('0x2a')]:0x2,'scheduledat':_0x395eb2[_0x0c8e('0x1b')]?_0x395eb2['scheduledat']:moment()[_0x0c8e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x395eb2[_0x0c8e('0x2b')]?!![]:![],'callbackuniqueid':_0x395eb2[_0x0c8e('0x2b')]?_0x395eb2[_0x0c8e('0x2b')]:undefined,'callbackat':_0x395eb2[_0x0c8e('0x2b')]?moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')):undefined,'VoiceQueueId':_0x118176['id']});})[_0x0c8e('0x2c')](function(_0x34ac07){_0x457948(_0x34ac07);});});});};function _0x17e2bf(){return function(_0x40bbda){logger[_0x0c8e('0x17')](_0x0c8e('0x18'),_0x0c8e('0x19'),util[_0x0c8e('0x1a')](_0x40bbda,{'showHidden':![],'depth':null}));};}function _0x5a6140(_0x4a1232,_0x26b5c0){var _0x357f93=_0x26b5c0[_0x0c8e('0x1b')]?_0x26b5c0[_0x0c8e('0x1b')]:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d'));return new BPromise(function(_0x4746ca,_0x54fe38){if(_['isNil'](_0x26b5c0[_0x0c8e('0x1f')])){_0x4746ca({'ret':_0x357f93});}else{_0xc5adfd[_0x0c8e('0x32')][_0x0c8e('0x20')]({'where':{'id':_0x4a1232['id']}})[_0x0c8e('0x21')](function(_0xfacb4a){if(!_[_0x0c8e('0x1e')](_0xfacb4a)){var _0x131c8e=_0xfacb4a['dialTimezone'];if(!_[_0x0c8e('0x1e')](_0x131c8e)){var _0x379ca6=shared[_0x0c8e('0x33')];var _0x21882e=_0x379ca6[_0x131c8e];var _0x570bfd=_0x379ca6[_0x26b5c0[_0x0c8e('0x1f')]];if(!_['isNil'](_0x21882e)&&!_[_0x0c8e('0x1e')](_0x570bfd)){var _0x4c93c6=_0x21882e['utcOffset']-_0x570bfd[_0x0c8e('0x22')];_0x357f93=_0x26b5c0[_0x0c8e('0x1b')]?_0x26b5c0[_0x0c8e('0x1b')]:moment();var _0x545bcb=moment(_0x357f93)[_0x0c8e('0x23')](_0x4c93c6,'minutes');_0x4746ca({'ret':_0x545bcb[_0x0c8e('0x1c')](_0x0c8e('0x1d'))});}else _0x4746ca({'ret':_0x357f93});}else _0x4746ca({'ret':_0x357f93});}else{_0x4746ca({'ret':_0x357f93});}});}});return 0xa;}var _0x13c48a=function(_0x45b0dd){return new BPromise(function(_0x31c4c7,_0x176d08){_0x5a6140(_0x45b0dd,_0x395eb2)[_0x0c8e('0x21')](function(_0x2a3721){_0x395eb2[_0x0c8e('0x1b')]=_0x2a3721[_0x0c8e('0x2d')];_0xc5adfd['CmHopper'][_0x0c8e('0x20')]({'where':{'phone':_0x395eb2[_0x0c8e('0xd')],'CampaignId':_0x45b0dd['id']}})['then'](function(_0x81a0fd){if(!_[_0x0c8e('0x1e')](_0x81a0fd)){throw new Error(_0x0c8e('0x26')+_0x395eb2[_0x0c8e('0xd')]+_0x0c8e('0x34')+_0x45b0dd['id']);}return _0xc5adfd[_0x0c8e('0x25')]['create']({'phone':_0x395eb2['phone'],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2[_0x0c8e('0x29')],'priority':_0x395eb2[_0x0c8e('0x2a')]?_0x395eb2['priority']:0x2,'scheduledat':_0x395eb2['scheduledat']?_0x395eb2[_0x0c8e('0x1b')]:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')),'callback':_0x395eb2['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x395eb2['callbackUniqueid']?_0x395eb2['callbackUniqueid']:undefined,'callbackat':_0x395eb2[_0x0c8e('0x2b')]?moment()['format'](_0x0c8e('0x1d')):undefined,'CampaignId':_0x45b0dd['id']});})[_0x0c8e('0x2c')](function(_0x1b0417){_0x176d08(_0x1b0417);});});});};var _0x8e9c85=function(_0x2bc3f9){return new BPromise(function(_0xf28de3,_0x456dcd){_0x5a6140(_0x2bc3f9,_0x395eb2)[_0x0c8e('0x21')](function(_0x4c4288){_0x395eb2[_0x0c8e('0x1b')]=_0x4c4288[_0x0c8e('0x2d')];_0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x20')]({'where':{'phone':_0x395eb2[_0x0c8e('0xd')],'CampaignId':_0x2bc3f9['id']}})[_0x0c8e('0x21')](function(_0x3c6574){if(!_['isNil'](_0x3c6574)){throw new Error(_0x0c8e('0x26')+_0x395eb2[_0x0c8e('0xd')]+_0x0c8e('0x35')+_0x2bc3f9['id']);}return _0xc5adfd[_0x0c8e('0x2f')][_0x0c8e('0x20')]({'where':{'calleridnum':_0x395eb2['phone'],'CampaignId':_0x2bc3f9['id']}});})[_0x0c8e('0x21')](function(_0x198455){if(!_[_0x0c8e('0x1e')](_0x198455)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x395eb2['phone']+_0x0c8e('0x36')+_0x2bc3f9['id']);}return _0xc5adfd[_0x0c8e('0x25')][_0x0c8e('0x28')]({'phone':_0x395eb2['phone'],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2['ListId'],'priority':_0x395eb2[_0x0c8e('0x2a')]?_0x395eb2['priority']:0x2,'scheduledat':_0x395eb2[_0x0c8e('0x1b')]?_0x395eb2['scheduledat']:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')),'callback':_0x395eb2[_0x0c8e('0x2b')]?!![]:![],'callbackuniqueid':_0x395eb2[_0x0c8e('0x2b')]?_0x395eb2[_0x0c8e('0x2b')]:undefined,'callbackat':_0x395eb2['callbackUniqueid']?moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')):undefined,'CampaignId':_0x2bc3f9['id']});})[_0x0c8e('0x2c')](function(_0x3daed5){_0x456dcd(_0x3daed5);});});});};if(_0x395eb2[_0x0c8e('0x29')]){_0xc5adfd[_0x0c8e('0x37')][_0x0c8e('0x38')]({'where':{'type':_0x0c8e('0x39')},'attributes':['id',_0x0c8e('0x3a'),_0x0c8e('0x1f')],'include':[{'model':_0xc5adfd['CmList'],'as':_0x0c8e('0x3b'),'where':{'id':_0x395eb2[_0x0c8e('0x29')]}}]})[_0x0c8e('0x21')](function(_0x47be56){if(_0x47be56){var _0x592aef=[];for(var _0x3b6b37=0x0,_0x50541d;_0x3b6b37<_0x47be56['length'];_0x3b6b37+=0x1){_0x50541d=_0x47be56[_0x3b6b37][_0x0c8e('0x16')]({'plain':!![]});switch(_0x50541d['dialCheckDuplicateType']){case _0x0c8e('0x3c'):_0xdd9ca5(_0x50541d)['catch'](_0x68b016());break;case'onlyIfOpen':_0x1afb9e(_0x50541d)['catch'](_0x68b016());break;default:_0x5a6140(_0x50541d,_0x395eb2)[_0x0c8e('0x21')](function(_0x2b280c){_0x395eb2[_0x0c8e('0x1b')]=_0x2b280c[_0x0c8e('0x2d')];_0xc5adfd[_0x0c8e('0x25')]['create']({'phone':_0x395eb2['phone'],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2[_0x0c8e('0x29')],'scheduledat':_0x395eb2['scheduledat']?_0x395eb2['scheduledat']:moment()[_0x0c8e('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x395eb2['priority']?_0x395eb2['priority']:0x2,'callback':_0x395eb2[_0x0c8e('0x2b')]?!![]:![],'callbackuniqueid':_0x395eb2[_0x0c8e('0x2b')]?_0x395eb2[_0x0c8e('0x2b')]:undefined,'callbackat':_0x395eb2[_0x0c8e('0x2b')]?moment()['format'](_0x0c8e('0x1d')):undefined,'VoiceQueueId':_0x50541d['id']})[_0x0c8e('0x2c')](_0x68b016());});}}}})[_0x0c8e('0x21')](function(){return _0xc5adfd['VoiceQueue'][_0x0c8e('0x38')]({'where':{'type':_0x0c8e('0x39')},'attributes':['id'],'include':[{'model':_0xc5adfd[_0x0c8e('0x3d')],'as':_0x0c8e('0x3e'),'where':{'id':_0x395eb2[_0x0c8e('0x29')]}}]})[_0x0c8e('0x21')](function(_0x39e630){if(_0x39e630){var _0x1f3424=[];for(var _0x597c5b=0x0,_0x2c6bb6;_0x597c5b<_0x39e630['length'];_0x597c5b+=0x1){_0x2c6bb6=_0x39e630[_0x597c5b]['get']({'plain':!![]});_0xc5adfd[_0x0c8e('0x3f')]['create']({'phone':_0x395eb2[_0x0c8e('0xd')],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2[_0x0c8e('0x29')],'VoiceQueueId':_0x2c6bb6['id']})[_0x0c8e('0x2c')](function(_0x1c940b){logger[_0x0c8e('0x17')]('cmContact,\x20%s,\x20%s','afterCreate',_0x1c940b[_0x0c8e('0x40')]);});}}});})[_0x0c8e('0x21')](function(){return _0xc5adfd[_0x0c8e('0x32')][_0x0c8e('0x38')]({'attributes':['id',_0x0c8e('0x3a'),_0x0c8e('0x1f')],'include':[{'model':_0xc5adfd[_0x0c8e('0x3d')],'as':_0x0c8e('0x3b'),'where':{'id':_0x395eb2[_0x0c8e('0x29')]}}]})[_0x0c8e('0x21')](function(_0x102eef){if(_0x102eef){var _0x323c32=[];for(var _0xc2a41c=0x0,_0x45cc0e;_0xc2a41c<_0x102eef[_0x0c8e('0x41')];_0xc2a41c+=0x1){_0x45cc0e=_0x102eef[_0xc2a41c]['get']({'plain':!![]});switch(_0x45cc0e[_0x0c8e('0x3a')]){case _0x0c8e('0x3c'):_0x8e9c85(_0x45cc0e)[_0x0c8e('0x2c')](_0x17e2bf());break;case _0x0c8e('0x42'):_0x13c48a(_0x45cc0e)[_0x0c8e('0x2c')](_0x17e2bf());break;default:_0xc5adfd[_0x0c8e('0x25')]['create']({'phone':_0x395eb2['phone'],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2['ListId'],'scheduledat':_0x395eb2[_0x0c8e('0x1b')]?_0x395eb2[_0x0c8e('0x1b')]:moment()[_0x0c8e('0x1c')](_0x0c8e('0x1d')),'priority':_0x395eb2[_0x0c8e('0x2a')]?_0x395eb2[_0x0c8e('0x2a')]:0x2,'callback':_0x395eb2[_0x0c8e('0x2b')]?!![]:![],'callbackuniqueid':_0x395eb2[_0x0c8e('0x2b')]?_0x395eb2[_0x0c8e('0x2b')]:undefined,'callbackat':_0x395eb2[_0x0c8e('0x2b')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x45cc0e['id']})[_0x0c8e('0x2c')](_0x17e2bf());}}}});})['then'](function(){return _0xc5adfd[_0x0c8e('0x32')]['findAll']({'attributes':['id'],'include':[{'model':_0xc5adfd[_0x0c8e('0x3d')],'as':'BlackLists','where':{'id':_0x395eb2[_0x0c8e('0x29')]}}]})[_0x0c8e('0x21')](function(_0x550a63){if(_0x550a63){var _0x52da6b=[];for(var _0x3371a4=0x0,_0x37d11f;_0x3371a4<_0x550a63['length'];_0x3371a4+=0x1){_0x37d11f=_0x550a63[_0x3371a4][_0x0c8e('0x16')]({'plain':!![]});_0xc5adfd[_0x0c8e('0x3f')]['create']({'phone':_0x395eb2[_0x0c8e('0xd')],'ContactId':_0x395eb2['id'],'ListId':_0x395eb2['ListId'],'CampaignId':_0x37d11f['id']})['catch'](function(_0x124987){logger[_0x0c8e('0x17')](_0x0c8e('0x43'),_0x0c8e('0x19'),_0x124987[_0x0c8e('0x40')]);});}}});})[_0x0c8e('0x21')](function(){_0xa96274();})[_0x0c8e('0x2c')](function(_0x3e877e){logger[_0x0c8e('0x17')](_0x0c8e('0x43'),_0x0c8e('0x19'),_0x3e877e[_0x0c8e('0x40')]);_0xa96274(_0x3e877e);});}else{_0xa96274(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0xa7a7af,_0x5d965c,_0x4ba24f){var _0x11f70d=_0x2ed962['models'];var _0x220310=_0xa7a7af[_0x0c8e('0x16')]({'plain':!![]});return _0x11f70d[_0x0c8e('0x25')][_0x0c8e('0x38')]({'raw':!![],'where':{'ListId':_0x220310[_0x0c8e('0x29')],'ContactId':_0x220310['id']}})[_0x0c8e('0x21')](function(_0x2615e5){if(!_[_0x0c8e('0x44')](_0x2615e5)){var _0x857c6a=[];for(var _0x24aedf=0x0;_0x24aedf<_0x2615e5[_0x0c8e('0x41')];_0x24aedf+=0x1){var _0x5360be=_0x11f70d['CmHopper'][_0x0c8e('0x45')]({'where':{'ListId':_0x2615e5[_0x24aedf][_0x0c8e('0x29')],'ContactId':_0x2615e5[_0x24aedf][_0x0c8e('0x46')],'VoiceQueueId':_0x2615e5[_0x24aedf][_0x0c8e('0x47')],'CampaignId':_0x2615e5[_0x24aedf][_0x0c8e('0x48')]}});_0x857c6a[_0x0c8e('0x49')](_0x5360be);}return BPromise[_0x0c8e('0x4a')](_0x857c6a);}})['then'](function(_0x2b8772){logger['info'](_0x0c8e('0x4b'),util['inspect'](_0x2b8772,{'showHidden':![],'depth':null}));_0x4ba24f();})[_0x0c8e('0x2c')](function(_0x3a5c5b){logger[_0x0c8e('0x17')](_0x0c8e('0x4c'),util[_0x0c8e('0x1a')](_0x3a5c5b,{'showHidden':![],'depth':null}));_0x4ba24f(_0x3a5c5b);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index a9d39fe..624c2ba 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x36bcd3,_0x43bd54){var _0x415302=function(_0x3b67cf){while(--_0x3b67cf){_0x36bcd3['push'](_0x36bcd3['shift']());}};_0x415302(++_0x43bd54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index e28e34e..2e2642f 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2821=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x824a1a,_0x36abcf){var _0x4d9568=function(_0x457f63){while(--_0x457f63){_0x824a1a['push'](_0x824a1a['shift']());}};_0x4d9568(++_0x36abcf);}(_0x2821,0x87));var _0x1282=function(_0x58bafd,_0x47ccda){_0x58bafd=_0x58bafd-0x0;var _0x495169=_0x2821[_0x58bafd];return _0x495169;};'use strict';var Sequelize=require(_0x1282('0x0'));module[_0x1282('0x1')]={'CmContactId':{'type':Sequelize[_0x1282('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1282('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1282('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1282('0x3')],'defaultValue':_0x1282('0x4')},'OrderBy':{'type':Sequelize[_0x1282('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x1282('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0x3f49=['exports','STRING','INTEGER','sequelize'];(function(_0x5be043,_0x6d657a){var _0x3995e3=function(_0x1e90bd){while(--_0x1e90bd){_0x5be043['push'](_0x5be043['shift']());}};_0x3995e3(++_0x6d657a);}(_0x3f49,0x11f));var _0x93f4=function(_0x1c7616,_0x53e3a3){_0x1c7616=_0x1c7616-0x0;var _0x345055=_0x3f49[_0x1c7616];return _0x345055;};'use strict';var Sequelize=require(_0x93f4('0x0'));module[_0x93f4('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x93f4('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x93f4('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x93f4('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index adb1fdc..b12bb85 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba9=['map','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','name','send'];(function(_0x289c3c,_0x353888){var _0x2f7678=function(_0x8104c1){while(--_0x8104c1){_0x289c3c['push'](_0x289c3c['shift']());}};_0x2f7678(++_0x353888);}(_0x7ba9,0x105));var _0x97ba=function(_0x3dd0b9,_0x1d6c92){_0x3dd0b9=_0x3dd0b9-0x0;var _0x4c0351=_0x7ba9[_0x3dd0b9];return _0x4c0351;};'use strict';var emlformat=require(_0x97ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97ba('0x1'));var jsonpatch=require(_0x97ba('0x2'));var rp=require('request-promise');var moment=require(_0x97ba('0x3'));var BPromise=require(_0x97ba('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x97ba('0x5'));var csv=require('to-csv');var ejs=require(_0x97ba('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x97ba('0x7'));var crypto=require(_0x97ba('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97ba('0x9'));var querystring=require(_0x97ba('0xa'));var Papa=require(_0x97ba('0xb'));var Redis=require(_0x97ba('0xc'));var authService=require(_0x97ba('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x97ba('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x97ba('0xf'))(_0x97ba('0x10'));var utils=require('../../config/utils');var config=require(_0x97ba('0x11'));var licenseUtil=require(_0x97ba('0x12'));var db=require(_0x97ba('0x13'))['db'];function respondWithStatusCode(_0xdb23e7,_0x5ddf9a){_0x5ddf9a=_0x5ddf9a||0xcc;return function(_0x2783e1){if(_0x2783e1){return _0xdb23e7[_0x97ba('0x14')](_0x5ddf9a);}return _0xdb23e7[_0x97ba('0x15')](_0x5ddf9a)[_0x97ba('0x16')]();};}function respondWithResult(_0x2ee553,_0x3385dd){_0x3385dd=_0x3385dd||0xc8;return function(_0x11ed52){if(_0x11ed52){return _0x2ee553[_0x97ba('0x15')](_0x3385dd)[_0x97ba('0x17')](_0x11ed52);}};}function respondWithFilteredResult(_0x1534b6,_0x1238b2){return function(_0x10b4ac){if(_0x10b4ac){var _0x3b611b=typeof _0x1238b2['offset']===_0x97ba('0x18')&&typeof _0x1238b2[_0x97ba('0x19')]==='undefined';var _0x176e16=_0x10b4ac[_0x97ba('0x1a')];var _0xe52b0=_0x3b611b?0x0:_0x1238b2[_0x97ba('0x1b')];var _0x2b563b=_0x3b611b?_0x10b4ac[_0x97ba('0x1a')]:_0x1238b2[_0x97ba('0x1b')]+_0x1238b2['limit'];var _0x1fdb7b;if(_0x2b563b>=_0x176e16){_0x2b563b=_0x176e16;_0x1fdb7b=0xc8;}else{_0x1fdb7b=0xce;}_0x1534b6[_0x97ba('0x15')](_0x1fdb7b);return _0x1534b6['set'](_0x97ba('0x1c'),_0xe52b0+'-'+_0x2b563b+'/'+_0x176e16)[_0x97ba('0x17')](_0x10b4ac);}return null;};}function patchUpdates(_0x2f6a1c){return function(_0x1e4232){try{jsonpatch['apply'](_0x1e4232,_0x2f6a1c,!![]);}catch(_0x8f214){return BPromise[_0x97ba('0x1d')](_0x8f214);}return _0x1e4232['save']();};}function saveUpdates(_0xfa0eaa,_0x2a2fc4){return function(_0x5b1da2){if(_0x5b1da2){return _0x5b1da2[_0x97ba('0x1e')](_0xfa0eaa)[_0x97ba('0x1f')](function(_0xf9059c){return _0xf9059c;});}return null;};}function removeEntity(_0x2f524c,_0x16d7ce){return function(_0x11b681){if(_0x11b681){return _0x11b681[_0x97ba('0x20')]()['then'](function(){var _0x47c651=_0x11b681[_0x97ba('0x21')]({'plain':!![]});var _0x12474c=_0x97ba('0x22');return db[_0x97ba('0x23')][_0x97ba('0x20')]({'where':{'type':_0x12474c,'resourceId':_0x47c651['id']}})[_0x97ba('0x1f')](function(){return _0x11b681;});})[_0x97ba('0x1f')](function(){_0x2f524c[_0x97ba('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424143,_0x1bac83){return function(_0x22932c){if(!_0x22932c){_0x424143[_0x97ba('0x14')](0x194);}return _0x22932c;};}function handleError(_0x233c6e,_0x366dca){_0x366dca=_0x366dca||0x1f4;return function(_0x5b5d56){logger[_0x97ba('0x24')](_0x5b5d56['stack']);if(_0x5b5d56[_0x97ba('0x25')]){delete _0x5b5d56[_0x97ba('0x25')];}_0x233c6e['status'](_0x366dca)[_0x97ba('0x26')](_0x5b5d56);};}exports['index']=function(_0x38476f,_0x1bca72){var _0xa7837a={},_0x12fd9d={},_0x772e2f={'count':0x0,'rows':[]};var _0x4087a1=_[_0x97ba('0x27')](db[_0x97ba('0x28')][_0x97ba('0x29')],function(_0x3055c9){return{'name':_0x3055c9[_0x97ba('0x2a')],'type':_0x3055c9['type'][_0x97ba('0x2b')]};});_0x12fd9d[_0x97ba('0x2c')]=_[_0x97ba('0x27')](_0x4087a1,'name');_0x12fd9d[_0x97ba('0x2d')]=_[_0x97ba('0x2e')](_0x38476f['query']);_0x12fd9d[_0x97ba('0x2f')]=_['intersection'](_0x12fd9d['model'],_0x12fd9d[_0x97ba('0x2d')]);_0xa7837a[_0x97ba('0x30')]=_[_0x97ba('0x31')](_0x12fd9d[_0x97ba('0x2c')],qs[_0x97ba('0x32')](_0x38476f[_0x97ba('0x2d')]['fields']));_0xa7837a[_0x97ba('0x30')]=_0xa7837a['attributes'][_0x97ba('0x33')]?_0xa7837a['attributes']:_0x12fd9d[_0x97ba('0x2c')];if(!_0x38476f['query']['hasOwnProperty'](_0x97ba('0x34'))){_0xa7837a['limit']=qs[_0x97ba('0x19')](_0x38476f['query'][_0x97ba('0x19')]);_0xa7837a['offset']=qs['offset'](_0x38476f['query']['offset']);}_0xa7837a[_0x97ba('0x35')]=qs[_0x97ba('0x36')](_0x38476f[_0x97ba('0x2d')][_0x97ba('0x36')]);_0xa7837a[_0x97ba('0x37')]=qs['filters'](_[_0x97ba('0x38')](_0x38476f[_0x97ba('0x2d')],_0x12fd9d['filters']),_0x4087a1);if(_0x38476f[_0x97ba('0x2d')][_0x97ba('0x39')]){_0xa7837a['where']=_[_0x97ba('0x3a')](_0xa7837a['where'],{'$or':_['map'](_0x4087a1,function(_0x47c38b){if(_0x47c38b['type']!=='VIRTUAL'){var _0x4ee5de={};_0x4ee5de[_0x47c38b['name']]={'$like':'%'+_0x38476f[_0x97ba('0x2d')][_0x97ba('0x39')]+'%'};return _0x4ee5de;}})});}_0xa7837a=_[_0x97ba('0x3a')]({},_0xa7837a,_0x38476f[_0x97ba('0x3b')]);var _0x3e99fe={'where':_0xa7837a['where']};return db[_0x97ba('0x28')]['count'](_0x3e99fe)['then'](function(_0x2518c9){_0x772e2f[_0x97ba('0x1a')]=_0x2518c9;if(_0x38476f[_0x97ba('0x2d')][_0x97ba('0x3c')]){_0xa7837a['include']=[{'all':!![]}];}return db[_0x97ba('0x28')][_0x97ba('0x3d')](_0xa7837a);})[_0x97ba('0x1f')](function(_0x456d59){_0x772e2f[_0x97ba('0x3e')]=_0x456d59;return _0x772e2f;})[_0x97ba('0x1f')](respondWithFilteredResult(_0x1bca72,_0xa7837a))[_0x97ba('0x3f')](handleError(_0x1bca72,null));};exports[_0x97ba('0x40')]=function(_0x4419dd,_0x4e9dab){var _0x2d009d={'raw':!![],'where':{'id':_0x4419dd['params']['id']}},_0x3442cb={};_0x3442cb[_0x97ba('0x2c')]=_[_0x97ba('0x2e')](db[_0x97ba('0x28')][_0x97ba('0x29')]);_0x3442cb[_0x97ba('0x2d')]=_['keys'](_0x4419dd['query']);_0x3442cb[_0x97ba('0x2f')]=_['intersection'](_0x3442cb[_0x97ba('0x2c')],_0x3442cb['query']);_0x2d009d[_0x97ba('0x30')]=_[_0x97ba('0x31')](_0x3442cb['model'],qs['fields'](_0x4419dd[_0x97ba('0x2d')]['fields']));_0x2d009d[_0x97ba('0x30')]=_0x2d009d['attributes'][_0x97ba('0x33')]?_0x2d009d[_0x97ba('0x30')]:_0x3442cb[_0x97ba('0x2c')];if(_0x4419dd['query'][_0x97ba('0x3c')]){_0x2d009d[_0x97ba('0x41')]=[{'all':!![]}];}_0x2d009d=_[_0x97ba('0x3a')]({},_0x2d009d,_0x4419dd[_0x97ba('0x3b')]);return db[_0x97ba('0x28')][_0x97ba('0x42')](_0x2d009d)[_0x97ba('0x1f')](handleEntityNotFound(_0x4e9dab,null))['then'](respondWithResult(_0x4e9dab,null))[_0x97ba('0x3f')](handleError(_0x4e9dab,null));};exports[_0x97ba('0x43')]=function(_0xa2f9f,_0xe7a2ef){return db['CmContactHasItem'][_0x97ba('0x43')](_0xa2f9f[_0x97ba('0x44')],{})[_0x97ba('0x1f')](function(_0x243ae4){var _0x2f1f96=_0xa2f9f[_0x97ba('0x45')][_0x97ba('0x21')]({'plain':!![]});if(!_0x2f1f96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f1f96[_0x97ba('0x46')]===_0x97ba('0x45')){var _0x4513a6=_0x243ae4[_0x97ba('0x21')]({'plain':!![]});var _0x154d3e=_0x97ba('0x22');return db[_0x97ba('0x47')][_0x97ba('0x42')]({'where':{'name':_0x154d3e,'userProfileId':_0x2f1f96['userProfileId']},'raw':!![]})['then'](function(_0x523a4f){if(_0x523a4f&&_0x523a4f[_0x97ba('0x48')]===0x0){return db[_0x97ba('0x23')][_0x97ba('0x43')]({'name':_0x4513a6['name'],'resourceId':_0x4513a6['id'],'type':_0x523a4f[_0x97ba('0x25')],'sectionId':_0x523a4f['id']},{})[_0x97ba('0x1f')](function(){return _0x243ae4;});}else{return _0x243ae4;}})[_0x97ba('0x3f')](function(_0x2d05c4){logger[_0x97ba('0x24')](_0x97ba('0x49'),_0x2d05c4);throw _0x2d05c4;});}return _0x243ae4;})[_0x97ba('0x1f')](respondWithResult(_0xe7a2ef,0xc9))['catch'](handleError(_0xe7a2ef,null));};exports['update']=function(_0x3854c6,_0x12c059){if(_0x3854c6[_0x97ba('0x44')]['id']){delete _0x3854c6[_0x97ba('0x44')]['id'];}return db[_0x97ba('0x28')][_0x97ba('0x42')]({'where':{'id':_0x3854c6[_0x97ba('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12c059,null))[_0x97ba('0x1f')](saveUpdates(_0x3854c6['body'],null))[_0x97ba('0x1f')](respondWithResult(_0x12c059,null))['catch'](handleError(_0x12c059,null));};exports[_0x97ba('0x20')]=function(_0x51b5ac,_0x5a37c3){return db[_0x97ba('0x28')][_0x97ba('0x42')]({'where':{'id':_0x51b5ac['params']['id']}})[_0x97ba('0x1f')](handleEntityNotFound(_0x5a37c3,null))['then'](removeEntity(_0x5a37c3,null))[_0x97ba('0x3f')](handleError(_0x5a37c3,null));}; \ No newline at end of file +var _0xb679=['bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','sendStatus','name','send','index','map','CmContactHasItem','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','fast-json-patch','moment'];(function(_0x1266a7,_0x1a236d){var _0x16246a=function(_0xf83625){while(--_0xf83625){_0x1266a7['push'](_0x1266a7['shift']());}};_0x16246a(++_0x1a236d);}(_0xb679,0x140));var _0x9b67=function(_0x2c8f44,_0x5894b1){_0x2c8f44=_0x2c8f44-0x0;var _0xeee9c3=_0xb679[_0x2c8f44];return _0xeee9c3;};'use strict';var emlformat=require(_0x9b67('0x0'));var rimraf=require(_0x9b67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b67('0x2'));var rp=require('request-promise');var moment=require(_0x9b67('0x3'));var BPromise=require(_0x9b67('0x4'));var Mustache=require('mustache');var util=require(_0x9b67('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9b67('0x6'));var ejs=require(_0x9b67('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b67('0x8'));var squel=require(_0x9b67('0x9'));var crypto=require(_0x9b67('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9b67('0xb'));var toCsv=require(_0x9b67('0x6'));var querystring=require(_0x9b67('0xc'));var Papa=require(_0x9b67('0xd'));var Redis=require('ioredis');var authService=require(_0x9b67('0xe'));var qs=require(_0x9b67('0xf'));var as=require(_0x9b67('0x10'));var hardwareService=require(_0x9b67('0x11'));var logger=require('../../config/logger')(_0x9b67('0x12'));var utils=require(_0x9b67('0x13'));var config=require(_0x9b67('0x14'));var licenseUtil=require(_0x9b67('0x15'));var db=require(_0x9b67('0x16'))['db'];function respondWithStatusCode(_0x2d3274,_0x35fefa){_0x35fefa=_0x35fefa||0xcc;return function(_0x4c97f5){if(_0x4c97f5){return _0x2d3274['sendStatus'](_0x35fefa);}return _0x2d3274[_0x9b67('0x17')](_0x35fefa)[_0x9b67('0x18')]();};}function respondWithResult(_0x370b94,_0x2e34c9){_0x2e34c9=_0x2e34c9||0xc8;return function(_0x4b6f73){if(_0x4b6f73){return _0x370b94['status'](_0x2e34c9)['json'](_0x4b6f73);}};}function respondWithFilteredResult(_0x1eba5e,_0x473abb){return function(_0x42281a){if(_0x42281a){var _0x2102ec=typeof _0x473abb[_0x9b67('0x19')]===_0x9b67('0x1a')&&typeof _0x473abb[_0x9b67('0x1b')]===_0x9b67('0x1a');var _0x4f4597=_0x42281a[_0x9b67('0x1c')];var _0x33a04a=_0x2102ec?0x0:_0x473abb['offset'];var _0x4c753e=_0x2102ec?_0x42281a[_0x9b67('0x1c')]:_0x473abb[_0x9b67('0x19')]+_0x473abb[_0x9b67('0x1b')];var _0x48514f;if(_0x4c753e>=_0x4f4597){_0x4c753e=_0x4f4597;_0x48514f=0xc8;}else{_0x48514f=0xce;}_0x1eba5e['status'](_0x48514f);return _0x1eba5e[_0x9b67('0x1d')](_0x9b67('0x1e'),_0x33a04a+'-'+_0x4c753e+'/'+_0x4f4597)['json'](_0x42281a);}return null;};}function patchUpdates(_0x2cf753){return function(_0x4caa60){try{jsonpatch[_0x9b67('0x1f')](_0x4caa60,_0x2cf753,!![]);}catch(_0x4b72a0){return BPromise['reject'](_0x4b72a0);}return _0x4caa60[_0x9b67('0x20')]();};}function saveUpdates(_0x38c183,_0x3a7e2c){return function(_0x29f3ab){if(_0x29f3ab){return _0x29f3ab[_0x9b67('0x21')](_0x38c183)['then'](function(_0x1aa729){return _0x1aa729;});}return null;};}function removeEntity(_0x18c028,_0x808c15){return function(_0x15af29){if(_0x15af29){return _0x15af29[_0x9b67('0x22')]()[_0x9b67('0x23')](function(){var _0x1391d5=_0x15af29[_0x9b67('0x24')]({'plain':!![]});var _0x57bc7d=_0x9b67('0x25');return db[_0x9b67('0x26')]['destroy']({'where':{'type':_0x57bc7d,'resourceId':_0x1391d5['id']}})[_0x9b67('0x23')](function(){return _0x15af29;});})[_0x9b67('0x23')](function(){_0x18c028['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b581a,_0x49bd81){return function(_0x4c1916){if(!_0x4c1916){_0x4b581a[_0x9b67('0x27')](0x194);}return _0x4c1916;};}function handleError(_0x229618,_0x2a16a7){_0x2a16a7=_0x2a16a7||0x1f4;return function(_0x4f4d4e){logger['error'](_0x4f4d4e['stack']);if(_0x4f4d4e[_0x9b67('0x28')]){delete _0x4f4d4e['name'];}_0x229618[_0x9b67('0x17')](_0x2a16a7)[_0x9b67('0x29')](_0x4f4d4e);};}exports[_0x9b67('0x2a')]=function(_0x494146,_0x1eb5b6){var _0x10e118={},_0x307206={},_0x1436a3={'count':0x0,'rows':[]};var _0x318579=_[_0x9b67('0x2b')](db[_0x9b67('0x2c')]['rawAttributes'],function(_0xa84ba3){return{'name':_0xa84ba3[_0x9b67('0x2d')],'type':_0xa84ba3[_0x9b67('0x2e')]['key']};});_0x307206[_0x9b67('0x2f')]=_['map'](_0x318579,_0x9b67('0x28'));_0x307206[_0x9b67('0x30')]=_[_0x9b67('0x31')](_0x494146[_0x9b67('0x30')]);_0x307206[_0x9b67('0x32')]=_[_0x9b67('0x33')](_0x307206[_0x9b67('0x2f')],_0x307206[_0x9b67('0x30')]);_0x10e118[_0x9b67('0x34')]=_[_0x9b67('0x33')](_0x307206[_0x9b67('0x2f')],qs[_0x9b67('0x35')](_0x494146[_0x9b67('0x30')][_0x9b67('0x35')]));_0x10e118['attributes']=_0x10e118[_0x9b67('0x34')][_0x9b67('0x36')]?_0x10e118[_0x9b67('0x34')]:_0x307206[_0x9b67('0x2f')];if(!_0x494146['query'][_0x9b67('0x37')](_0x9b67('0x38'))){_0x10e118[_0x9b67('0x1b')]=qs[_0x9b67('0x1b')](_0x494146['query'][_0x9b67('0x1b')]);_0x10e118[_0x9b67('0x19')]=qs[_0x9b67('0x19')](_0x494146[_0x9b67('0x30')][_0x9b67('0x19')]);}_0x10e118['order']=qs['sort'](_0x494146['query'][_0x9b67('0x39')]);_0x10e118[_0x9b67('0x3a')]=qs[_0x9b67('0x32')](_[_0x9b67('0x3b')](_0x494146[_0x9b67('0x30')],_0x307206[_0x9b67('0x32')]),_0x318579);if(_0x494146[_0x9b67('0x30')][_0x9b67('0x3c')]){_0x10e118['where']=_['merge'](_0x10e118[_0x9b67('0x3a')],{'$or':_['map'](_0x318579,function(_0x1dc03f){if(_0x1dc03f[_0x9b67('0x2e')]!=='VIRTUAL'){var _0xbf89b2={};_0xbf89b2[_0x1dc03f[_0x9b67('0x28')]]={'$like':'%'+_0x494146['query'][_0x9b67('0x3c')]+'%'};return _0xbf89b2;}})});}_0x10e118=_['merge']({},_0x10e118,_0x494146[_0x9b67('0x3d')]);var _0x47a39a={'where':_0x10e118[_0x9b67('0x3a')]};return db[_0x9b67('0x2c')]['count'](_0x47a39a)[_0x9b67('0x23')](function(_0x267d79){_0x1436a3[_0x9b67('0x1c')]=_0x267d79;if(_0x494146['query'][_0x9b67('0x3e')]){_0x10e118[_0x9b67('0x3f')]=[{'all':!![]}];}return db[_0x9b67('0x2c')][_0x9b67('0x40')](_0x10e118);})[_0x9b67('0x23')](function(_0x54ba59){_0x1436a3[_0x9b67('0x41')]=_0x54ba59;return _0x1436a3;})['then'](respondWithFilteredResult(_0x1eb5b6,_0x10e118))['catch'](handleError(_0x1eb5b6,null));};exports['show']=function(_0x2958c9,_0x271e15){var _0x3e3560={'raw':!![],'where':{'id':_0x2958c9[_0x9b67('0x42')]['id']}},_0x305bb2={};_0x305bb2[_0x9b67('0x2f')]=_['keys'](db['CmContactHasItem'][_0x9b67('0x43')]);_0x305bb2[_0x9b67('0x30')]=_['keys'](_0x2958c9['query']);_0x305bb2[_0x9b67('0x32')]=_[_0x9b67('0x33')](_0x305bb2[_0x9b67('0x2f')],_0x305bb2['query']);_0x3e3560[_0x9b67('0x34')]=_['intersection'](_0x305bb2[_0x9b67('0x2f')],qs['fields'](_0x2958c9[_0x9b67('0x30')][_0x9b67('0x35')]));_0x3e3560[_0x9b67('0x34')]=_0x3e3560['attributes'][_0x9b67('0x36')]?_0x3e3560['attributes']:_0x305bb2[_0x9b67('0x2f')];if(_0x2958c9[_0x9b67('0x30')][_0x9b67('0x3e')]){_0x3e3560[_0x9b67('0x3f')]=[{'all':!![]}];}_0x3e3560=_[_0x9b67('0x44')]({},_0x3e3560,_0x2958c9[_0x9b67('0x3d')]);return db['CmContactHasItem']['find'](_0x3e3560)['then'](handleEntityNotFound(_0x271e15,null))[_0x9b67('0x23')](respondWithResult(_0x271e15,null))[_0x9b67('0x45')](handleError(_0x271e15,null));};exports[_0x9b67('0x46')]=function(_0x204407,_0x817c){return db[_0x9b67('0x2c')][_0x9b67('0x46')](_0x204407[_0x9b67('0x47')],{})[_0x9b67('0x23')](function(_0x17e481){var _0x2e8248=_0x204407[_0x9b67('0x48')][_0x9b67('0x24')]({'plain':!![]});if(!_0x2e8248)throw new Error(_0x9b67('0x49'));if(_0x2e8248[_0x9b67('0x4a')]==='user'){var _0x3deee6=_0x17e481[_0x9b67('0x24')]({'plain':!![]});var _0x5b27af=_0x9b67('0x25');return db[_0x9b67('0x4b')]['find']({'where':{'name':_0x5b27af,'userProfileId':_0x2e8248[_0x9b67('0x4c')]},'raw':!![]})[_0x9b67('0x23')](function(_0x4e8ab2){if(_0x4e8ab2&&_0x4e8ab2[_0x9b67('0x4d')]===0x0){return db[_0x9b67('0x26')][_0x9b67('0x46')]({'name':_0x3deee6[_0x9b67('0x28')],'resourceId':_0x3deee6['id'],'type':_0x4e8ab2['name'],'sectionId':_0x4e8ab2['id']},{})['then'](function(){return _0x17e481;});}else{return _0x17e481;}})['catch'](function(_0x1b759e){logger[_0x9b67('0x4e')](_0x9b67('0x4f'),_0x1b759e);throw _0x1b759e;});}return _0x17e481;})[_0x9b67('0x23')](respondWithResult(_0x817c,0xc9))[_0x9b67('0x45')](handleError(_0x817c,null));};exports['update']=function(_0x3815fa,_0x1ef362){if(_0x3815fa[_0x9b67('0x47')]['id']){delete _0x3815fa['body']['id'];}return db[_0x9b67('0x2c')]['find']({'where':{'id':_0x3815fa[_0x9b67('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ef362,null))['then'](saveUpdates(_0x3815fa[_0x9b67('0x47')],null))[_0x9b67('0x23')](respondWithResult(_0x1ef362,null))[_0x9b67('0x45')](handleError(_0x1ef362,null));};exports[_0x9b67('0x22')]=function(_0xef7bd6,_0x1ebddb){return db[_0x9b67('0x2c')][_0x9b67('0x50')]({'where':{'id':_0xef7bd6[_0x9b67('0x42')]['id']}})[_0x9b67('0x23')](handleEntityNotFound(_0x1ebddb,null))[_0x9b67('0x23')](removeEntity(_0x1ebddb,null))[_0x9b67('0x45')](handleError(_0x1ebddb,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index c7ec08d..6f25f28 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7fa=['define','CmContactHasItem','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x5b2997,_0x142134){var _0x32dc83=function(_0x4697c2){while(--_0x4697c2){_0x5b2997['push'](_0x5b2997['shift']());}};_0x32dc83(++_0x142134);}(_0xc7fa,0x7a));var _0xac7f=function(_0x2dc269,_0x2c629d){_0x2dc269=_0x2dc269-0x0;var _0x2e0b7a=_0xc7fa[_0x2dc269];return _0x2e0b7a;};'use strict';var _=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var logger=require(_0xac7f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac7f('0x3'));var rp=require(_0xac7f('0x4'));var fs=require('fs');var path=require(_0xac7f('0x5'));var rimraf=require(_0xac7f('0x6'));var config=require(_0xac7f('0x7'));var attributes=require(_0xac7f('0x8'));module[_0xac7f('0x9')]=function(_0x4b8229,_0xf84692){return _0x4b8229[_0xac7f('0xa')](_0xac7f('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ff8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','cm_contact_has_items','lodash','../../config/logger','api'];(function(_0x463697,_0xccfdc4){var _0x33cfe1=function(_0x5c74ec){while(--_0x5c74ec){_0x463697['push'](_0x463697['shift']());}};_0x33cfe1(++_0xccfdc4);}(_0x0ff8,0x11b));var _0x80ff=function(_0x5f23da,_0x52b8a7){_0x5f23da=_0x5f23da-0x0;var _0xc63b91=_0x0ff8[_0x5f23da];return _0xc63b91;};'use strict';var _=require(_0x80ff('0x0'));var util=require('util');var logger=require(_0x80ff('0x1'))(_0x80ff('0x2'));var moment=require(_0x80ff('0x3'));var BPromise=require(_0x80ff('0x4'));var rp=require(_0x80ff('0x5'));var fs=require('fs');var path=require(_0x80ff('0x6'));var rimraf=require(_0x80ff('0x7'));var config=require(_0x80ff('0x8'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0xa1a55c,_0x3f6c5d){return _0xa1a55c[_0x80ff('0x9')]('CmContactHasItem',attributes,{'tableName':_0x80ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 3a8553c..d8a07f0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf43a=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','CmContactHasItem,\x20%s,\x20%s','message','result','catch','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf43a,0x99));var _0xaf43=function(_0x14a0a8,_0x27d4d8){_0x14a0a8=_0x14a0a8-0x0;var _0x12ba2e=_0xf43a[_0x14a0a8];return _0x12ba2e;};'use strict';var _=require('lodash');var util=require(_0xaf43('0x0'));var moment=require(_0xaf43('0x1'));var BPromise=require(_0xaf43('0x2'));var rs=require(_0xaf43('0x3'));var fs=require('fs');var Redis=require(_0xaf43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf43('0x5'));var logger=require(_0xaf43('0x6'))(_0xaf43('0x7'));var config=require(_0xaf43('0x8'));var jayson=require(_0xaf43('0x9'));var client=jayson['client'][_0xaf43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x190543,_0x11ba2c,_0x1ac0c6){return new BPromise(function(_0x2d430d,_0x281d2d){return client['request'](_0x190543,_0x1ac0c6)[_0xaf43('0xb')](function(_0x534746){logger[_0xaf43('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x11ba2c,_0xaf43('0xd'));logger[_0xaf43('0xe')](_0xaf43('0xf'),_0x11ba2c,_0xaf43('0xd'),JSON[_0xaf43('0x10')](_0x534746));if(_0x534746[_0xaf43('0x11')]){if(_0x534746[_0xaf43('0x11')]['code']===0x1f4){logger[_0xaf43('0x11')](_0xaf43('0x12'),_0x11ba2c,_0x534746[_0xaf43('0x11')][_0xaf43('0x13')]);return _0x281d2d(_0x534746[_0xaf43('0x11')]['message']);}logger[_0xaf43('0x11')](_0xaf43('0x12'),_0x11ba2c,_0x534746[_0xaf43('0x11')][_0xaf43('0x13')]);return _0x2d430d(_0x534746['error'][_0xaf43('0x13')]);}else{logger[_0xaf43('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x11ba2c,_0xaf43('0xd'));_0x2d430d(_0x534746[_0xaf43('0x14')][_0xaf43('0x13')]);}})[_0xaf43('0x15')](function(_0x422ab9){logger[_0xaf43('0x11')](_0xaf43('0x12'),_0x11ba2c,_0x422ab9);_0x281d2d(_0x422ab9);});});} \ No newline at end of file +var _0xe3e7=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request'];(function(_0x3400ca,_0x27c04d){var _0x26e8d1=function(_0x2284e9){while(--_0x2284e9){_0x3400ca['push'](_0x3400ca['shift']());}};_0x26e8d1(++_0x27c04d);}(_0xe3e7,0x1c1));var _0x7e3e=function(_0x3e2055,_0x4fcc72){_0x3e2055=_0x3e2055-0x0;var _0xcee37f=_0xe3e7[_0x3e2055];return _0xcee37f;};'use strict';var _=require(_0x7e3e('0x0'));var util=require(_0x7e3e('0x1'));var moment=require(_0x7e3e('0x2'));var BPromise=require(_0x7e3e('0x3'));var rs=require(_0x7e3e('0x4'));var fs=require('fs');var Redis=require(_0x7e3e('0x5'));var db=require(_0x7e3e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7e3e('0x7'));var jayson=require(_0x7e3e('0x8'));var client=jayson['client'][_0x7e3e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4508ab,_0x54b6c3,_0x5b8127){return new BPromise(function(_0x1e0947,_0x40d059){return client[_0x7e3e('0xa')](_0x4508ab,_0x5b8127)['then'](function(_0x4c8e40){logger['info'](_0x7e3e('0xb'),_0x54b6c3,_0x7e3e('0xc'));logger[_0x7e3e('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x54b6c3,_0x7e3e('0xc'),JSON['stringify'](_0x4c8e40));if(_0x4c8e40[_0x7e3e('0xe')]){if(_0x4c8e40[_0x7e3e('0xe')][_0x7e3e('0xf')]===0x1f4){logger[_0x7e3e('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x54b6c3,_0x4c8e40['error'][_0x7e3e('0x10')]);return _0x40d059(_0x4c8e40[_0x7e3e('0xe')]['message']);}logger[_0x7e3e('0xe')](_0x7e3e('0xb'),_0x54b6c3,_0x4c8e40[_0x7e3e('0xe')]['message']);return _0x1e0947(_0x4c8e40['error'][_0x7e3e('0x10')]);}else{logger[_0x7e3e('0x11')](_0x7e3e('0xb'),_0x54b6c3,'request\x20sent');_0x1e0947(_0x4c8e40[_0x7e3e('0x12')][_0x7e3e('0x10')]);}})[_0x7e3e('0x13')](function(_0x434e7c){logger[_0x7e3e('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x54b6c3,_0x434e7c);_0x40d059(_0x434e7c);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index d9b29a1..8e2e5dc 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02f9=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x4da55a,_0x4a0462){var _0x143f59=function(_0xfbdb9a){while(--_0xfbdb9a){_0x4da55a['push'](_0x4da55a['shift']());}};_0x143f59(++_0x4a0462);}(_0x02f9,0x123));var _0x902f=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0x02f9[_0x3f22e8];return _0x368a7e;};'use strict';var multer=require(_0x902f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x902f('0x1'));var express=require(_0x902f('0x2'));var router=express[_0x902f('0x3')]();var fs_extra=require(_0x902f('0x4'));var auth=require(_0x902f('0x5'));var interaction=require(_0x902f('0x6'));var config=require(_0x902f('0x7'));var controller=require(_0x902f('0x8'));router[_0x902f('0x9')]('/',auth[_0x902f('0xa')](),controller[_0x902f('0xb')]);router[_0x902f('0x9')](_0x902f('0xc'),auth[_0x902f('0xa')](),controller[_0x902f('0xd')]);router[_0x902f('0xe')]('/',auth[_0x902f('0xa')](),controller[_0x902f('0xf')]);router['put'](_0x902f('0xc'),auth['isAuthenticated'](),controller[_0x902f('0x10')]);router[_0x902f('0x11')]('/:id',auth[_0x902f('0xa')](),controller[_0x902f('0x12')]);module[_0x902f('0x13')]=router; \ No newline at end of file +var _0x3bde=['util','path','express','Router','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','put','update','exports','multer'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0x3bde,0xb3));var _0xe3bd=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x3bde[_0x2261ce];return _0x524640;};'use strict';var multer=require(_0xe3bd('0x0'));var util=require(_0xe3bd('0x1'));var path=require(_0xe3bd('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3bd('0x3'));var router=express[_0xe3bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe3bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe3bd('0x6'));var controller=require(_0xe3bd('0x7'));router[_0xe3bd('0x8')]('/',auth[_0xe3bd('0x9')](),controller[_0xe3bd('0xa')]);router['get'](_0xe3bd('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe3bd('0x9')](),controller['create']);router[_0xe3bd('0xc')](_0xe3bd('0xb'),auth[_0xe3bd('0x9')](),controller[_0xe3bd('0xd')]);router['delete'](_0xe3bd('0xb'),auth[_0xe3bd('0x9')](),controller['destroy']);module[_0xe3bd('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4df73c8..adf6e67 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 _0x6671=['lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','TEXT','long','type','select','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize'];(function(_0x266d98,_0x45a32e){var _0x3f0f9a=function(_0x290bbb){while(--_0x290bbb){_0x266d98['push'](_0x266d98['shift']());}};_0x3f0f9a(++_0x45a32e);}(_0x6671,0x84));var _0x1667=function(_0x431bf0,_0x223e9d){_0x431bf0=_0x431bf0-0x0;var _0x2818a7=_0x6671[_0x431bf0];return _0x2818a7;};'use strict';var Sequelize=require(_0x1667('0x0'));var _=require(_0x1667('0x1'));module[_0x1667('0x2')]={'name':{'type':Sequelize[_0x1667('0x3')],'get':function(_0x1ee6fd){return this['getDataValue'](_0x1667('0x4'));}},'alias':{'type':Sequelize[_0x1667('0x5')],'allowNull':![],'set':function(_0xa3b1bc){this[_0x1667('0x6')](_0x1667('0x4'),_0xa3b1bc?_0xa3b1bc:this[_0x1667('0x7')](_0x1667('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x1667('0x9')](_0x1667('0xa')),'get':function(){if(this[_0x1667('0x7')](_0x1667('0xb'))===_0x1667('0xc')){return JSON['parse'](this[_0x1667('0x7')](_0x1667('0xd')));}else{return this[_0x1667('0x7')]('values');}},'set':function(_0x3f5476){if(Array[_0x1667('0xe')](_0x3f5476)){this[_0x1667('0x6')](_0x1667('0xd'),JSON[_0x1667('0xf')](_0x3f5476));}else{this[_0x1667('0x6')](_0x1667('0xd'),_0x3f5476);}}},'required':{'type':Sequelize[_0x1667('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1667('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x1667('0x11')](_0x1667('0x12'))}}; \ No newline at end of file +var _0x163f=['values','isArray','stringify','BOOLEAN','lodash','exports','getDataValue','alias','STRING','setDataValue','long','type'];(function(_0x53cb3f,_0x5e328c){var _0x2d60d6=function(_0x5529dc){while(--_0x5529dc){_0x53cb3f['push'](_0x53cb3f['shift']());}};_0x2d60d6(++_0x5e328c);}(_0x163f,0x1d8));var _0xf163=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x163f[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf163('0x0'));module[_0xf163('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x118b17){return this[_0xf163('0x2')](_0xf163('0x3'));}},'alias':{'type':Sequelize[_0xf163('0x4')],'allowNull':![],'set':function(_0x403fea){this[_0xf163('0x5')](_0xf163('0x3'),_0x403fea?_0x403fea:this[_0xf163('0x2')]('name'));}},'type':{'type':Sequelize[_0xf163('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xf163('0x6')),'get':function(){if(this[_0xf163('0x2')](_0xf163('0x7'))==='select'){return JSON['parse'](this[_0xf163('0x2')](_0xf163('0x8')));}else{return this[_0xf163('0x2')](_0xf163('0x8'));}},'set':function(_0x41c2be){if(Array[_0xf163('0x9')](_0x41c2be)){this[_0xf163('0x5')](_0xf163('0x8'),JSON[_0xf163('0xa')](_0x41c2be));}else{this[_0xf163('0x5')](_0xf163('0x8'),_0x41c2be);}}},'required':{'type':Sequelize[_0xf163('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf163('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 43e65d9..ef5d7d0 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 _0xc11a=['order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','update','transaction','create','body','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','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','../../mysqldb','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit'];(function(_0x2c7516,_0x2ca7f1){var _0x1d76a2=function(_0x5ce25f){while(--_0x5ce25f){_0x2c7516['push'](_0x2c7516['shift']());}};_0x1d76a2(++_0x2ca7f1);}(_0xc11a,0x7a));var _0xac11=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0xc11a[_0x7d62cb];return _0x3a6266;};'use strict';var emlformat=require(_0xac11('0x0'));var rimraf=require(_0xac11('0x1'));var zipdir=require(_0xac11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac11('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac11('0x4'));var util=require(_0xac11('0x5'));var path=require(_0xac11('0x6'));var sox=require(_0xac11('0x7'));var csv=require(_0xac11('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac11('0x9'));var _=require(_0xac11('0xa'));var squel=require(_0xac11('0xb'));var crypto=require(_0xac11('0xc'));var jsforce=require(_0xac11('0xd'));var deskjs=require(_0xac11('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac11('0xf'));var Papa=require(_0xac11('0x10'));var Redis=require(_0xac11('0x11'));var authService=require(_0xac11('0x12'));var qs=require(_0xac11('0x13'));var as=require(_0xac11('0x14'));var hardwareService=require(_0xac11('0x15'));var logger=require(_0xac11('0x16'))(_0xac11('0x17'));var utils=require(_0xac11('0x18'));var config=require(_0xac11('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xac11('0x1a'))['db'];function respondWithStatusCode(_0x128ac9,_0x5e33f9){_0x5e33f9=_0x5e33f9||0xcc;return function(_0xbf2cb4){if(_0xbf2cb4){return _0x128ac9['sendStatus'](_0x5e33f9);}return _0x128ac9[_0xac11('0x1b')](_0x5e33f9)['end']();};}function respondWithResult(_0x61e33c,_0x20b40d){_0x20b40d=_0x20b40d||0xc8;return function(_0x22988d){if(_0x22988d){return _0x61e33c[_0xac11('0x1b')](_0x20b40d)[_0xac11('0x1c')](_0x22988d);}};}function respondWithFilteredResult(_0x34855e,_0x22c90f){return function(_0x10dbf1){if(_0x10dbf1){var _0x4c2f53=typeof _0x22c90f['offset']===_0xac11('0x1d')&&typeof _0x22c90f['limit']===_0xac11('0x1d');var _0x5c17c3=_0x10dbf1[_0xac11('0x1e')];var _0x8d6287=_0x4c2f53?0x0:_0x22c90f[_0xac11('0x1f')];var _0x48bf6b=_0x4c2f53?_0x10dbf1[_0xac11('0x1e')]:_0x22c90f['offset']+_0x22c90f['limit'];var _0x2f91e5;if(_0x48bf6b>=_0x5c17c3){_0x48bf6b=_0x5c17c3;_0x2f91e5=0xc8;}else{_0x2f91e5=0xce;}_0x34855e[_0xac11('0x1b')](_0x2f91e5);return _0x34855e[_0xac11('0x20')](_0xac11('0x21'),_0x8d6287+'-'+_0x48bf6b+'/'+_0x5c17c3)[_0xac11('0x1c')](_0x10dbf1);}return null;};}function patchUpdates(_0xf1e41b){return function(_0x599b88){try{jsonpatch[_0xac11('0x22')](_0x599b88,_0xf1e41b,!![]);}catch(_0x81bdf8){return BPromise[_0xac11('0x23')](_0x81bdf8);}return _0x599b88[_0xac11('0x24')]();};}function saveUpdates(_0x23ae39,_0x503413){return function(_0x11eb7e){if(_0x11eb7e){return _0x11eb7e['update'](_0x23ae39)[_0xac11('0x25')](function(_0xccb6e8){return _0xccb6e8;});}return null;};}function removeEntity(_0x1e1358,_0x17837c){return function(_0x2902df){if(_0x2902df){return _0x2902df[_0xac11('0x26')]()['then'](function(){_0x1e1358[_0xac11('0x1b')](0xcc)[_0xac11('0x27')]();});}};}function handleEntityNotFound(_0xc5c5db,_0x28ce24){return function(_0x18fb4a){if(!_0x18fb4a){_0xc5c5db[_0xac11('0x28')](0x194);}return _0x18fb4a;};}function handleError(_0x1bfb97,_0x5667e4){_0x5667e4=_0x5667e4||0x1f4;return function(_0x53db32){logger[_0xac11('0x29')](_0x53db32['stack']);if(_0x53db32[_0xac11('0x2a')]){delete _0x53db32[_0xac11('0x2a')];}_0x1bfb97['status'](_0x5667e4)[_0xac11('0x2b')](_0x53db32);};}exports[_0xac11('0x2c')]=function(_0x79c058,_0x228948){var _0x322d54={},_0x5d7735={},_0x3c5410={'count':0x0,'rows':[]};var _0xf1225d=_[_0xac11('0x2d')](db[_0xac11('0x2e')][_0xac11('0x2f')],function(_0x8714bd){return{'name':_0x8714bd[_0xac11('0x30')],'type':_0x8714bd[_0xac11('0x31')][_0xac11('0x32')]};});_0x5d7735['model']=_[_0xac11('0x33')](_['map'](_0xf1225d,'name'),[_0xac11('0x2a')]);_0x5d7735[_0xac11('0x34')]=_[_0xac11('0x35')](_0x79c058[_0xac11('0x34')]);_0x5d7735['filters']=_[_0xac11('0x36')](_0x5d7735[_0xac11('0x37')],_0x5d7735['query']);_0x322d54['attributes']=_[_0xac11('0x36')](_0x5d7735[_0xac11('0x37')],qs[_0xac11('0x38')](_0x79c058[_0xac11('0x34')]['fields']));_0x322d54[_0xac11('0x39')]=_0x322d54[_0xac11('0x39')][_0xac11('0x3a')]?_0x322d54[_0xac11('0x39')]:_0x5d7735[_0xac11('0x37')];if(!_0x79c058[_0xac11('0x34')][_0xac11('0x3b')](_0xac11('0x3c'))){_0x322d54[_0xac11('0x3d')]=qs['limit'](_0x79c058[_0xac11('0x34')][_0xac11('0x3d')]);_0x322d54[_0xac11('0x1f')]=qs[_0xac11('0x1f')](_0x79c058[_0xac11('0x34')]['offset']);}_0x322d54[_0xac11('0x3e')]=qs[_0xac11('0x3f')](_0x79c058['query'][_0xac11('0x3f')]);_0x322d54[_0xac11('0x40')]=qs[_0xac11('0x41')](_[_0xac11('0x42')](_0x79c058['query'],_0x5d7735['filters']),_0xf1225d);if(_0x79c058['query'][_0xac11('0x43')]){_0x322d54[_0xac11('0x40')]=_['merge'](_0x322d54[_0xac11('0x40')],{'$or':_[_0xac11('0x2d')](_0xf1225d,function(_0x576770){if(_0x576770[_0xac11('0x31')]!=='VIRTUAL'){var _0x1d69e2={};_0x1d69e2[_0x576770[_0xac11('0x2a')]]={'$like':'%'+_0x79c058['query']['filter']+'%'};return _0x1d69e2;}})});}_0x322d54=_[_0xac11('0x44')]({},_0x322d54,_0x79c058[_0xac11('0x45')]);var _0x37b3ec={'where':_0x322d54[_0xac11('0x40')]};return db[_0xac11('0x2e')]['count'](_0x37b3ec)[_0xac11('0x25')](function(_0x26ba5a){_0x3c5410[_0xac11('0x1e')]=_0x26ba5a;if(_0x79c058[_0xac11('0x34')][_0xac11('0x46')]){_0x322d54[_0xac11('0x47')]=[{'all':!![]}];}return db['CmCustomField'][_0xac11('0x48')](_0x322d54);})[_0xac11('0x25')](function(_0x34bf59){_0x3c5410[_0xac11('0x49')]=_0x34bf59;return _0x3c5410;})[_0xac11('0x25')](respondWithFilteredResult(_0x228948,_0x322d54))[_0xac11('0x4a')](handleError(_0x228948,null));};exports[_0xac11('0x4b')]=function(_0xf81f14,_0x5bab0d){var _0x412668={'raw':!![],'where':{'id':_0xf81f14[_0xac11('0x4c')]['id']}},_0x124e01={};_0x124e01[_0xac11('0x37')]=_['keys'](db[_0xac11('0x2e')][_0xac11('0x2f')]);_0x124e01[_0xac11('0x34')]=_[_0xac11('0x35')](_0xf81f14['query']);_0x124e01['filters']=_[_0xac11('0x36')](_0x124e01['model'],_0x124e01[_0xac11('0x34')]);_0x412668['attributes']=_[_0xac11('0x36')](_0x124e01['model'],qs[_0xac11('0x38')](_0xf81f14[_0xac11('0x34')]['fields']));_0x412668[_0xac11('0x39')]=_0x412668['attributes'][_0xac11('0x3a')]?_0x412668[_0xac11('0x39')]:_0x124e01['model'];if(_0xf81f14[_0xac11('0x34')][_0xac11('0x46')]){_0x412668[_0xac11('0x47')]=[{'all':!![]}];}_0x412668=_['merge']({},_0x412668,_0xf81f14['options']);return db[_0xac11('0x2e')][_0xac11('0x4d')](_0x412668)[_0xac11('0x25')](handleEntityNotFound(_0x5bab0d,null))[_0xac11('0x25')](respondWithResult(_0x5bab0d,null))[_0xac11('0x4a')](handleError(_0x5bab0d,null));};exports[_0xac11('0x4e')]=function(_0x42b34e,_0x2019b0){if(_0x42b34e['body']['id']){delete _0x42b34e['body']['id'];}return db[_0xac11('0x2e')][_0xac11('0x4d')]({'where':{'id':_0x42b34e[_0xac11('0x4c')]['id']}})[_0xac11('0x25')](handleEntityNotFound(_0x2019b0,null))[_0xac11('0x25')](saveUpdates(_0x42b34e['body'],null))[_0xac11('0x25')](respondWithResult(_0x2019b0,null))['catch'](handleError(_0x2019b0,null));};exports[_0xac11('0x26')]=function(_0xf50456,_0xdea77b){return db['CmCustomField']['find']({'where':{'id':_0xf50456[_0xac11('0x4c')]['id']}})[_0xac11('0x25')](handleEntityNotFound(_0xdea77b,null))[_0xac11('0x25')](removeEntity(_0xdea77b,null))[_0xac11('0x4a')](handleError(_0xdea77b,null));};exports['create']=function(_0x1a27c9,_0x508be3){var _0x240851;return db['sequelize'][_0xac11('0x4f')](function(_0x19f6da){return db['CmCustomField'][_0xac11('0x50')](_0x1a27c9[_0xac11('0x51')],{'transaction':_0x19f6da})[_0xac11('0x25')](function(_0x275712){_0x240851=_0x275712;var _0x579344={'type':db[_0xac11('0x52')]['TEXT'],'transaction':_0x19f6da};switch(_0x1a27c9[_0xac11('0x51')][_0xac11('0x31')]){case'text':_0x579344['type']=db[_0xac11('0x52')]['TEXT'];break;case _0xac11('0x53'):_0x579344[_0xac11('0x31')]=db['Sequelize'][_0xac11('0x54')];break;case'switch':_0x579344[_0xac11('0x31')]=db[_0xac11('0x52')][_0xac11('0x55')];_0x579344[_0xac11('0x56')]=![];break;default:}return db['sequelize'][_0xac11('0x57')][_0xac11('0x58')](_0xac11('0x59'),util[_0xac11('0x5a')](_0xac11('0x5b'),_0x240851['id']),_0x579344);})[_0xac11('0x25')](function(){return _0x240851;});})[_0xac11('0x25')](respondWithResult(_0x508be3,0xc9))[_0xac11('0x4a')](handleError(_0x508be3,null));}; \ No newline at end of file +var _0x4801=['apply','save','then','destroy','sendStatus','error','stack','name','send','CmCustomField','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','update','body','params','create','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4ef40d,_0x33b7ca){var _0x128356=function(_0x24bc1a){while(--_0x24bc1a){_0x4ef40d['push'](_0x4ef40d['shift']());}};_0x128356(++_0x33b7ca);}(_0x4801,0x95));var _0x1480=function(_0x86ae3c,_0x2ad9de){_0x86ae3c=_0x86ae3c-0x0;var _0x1127a4=_0x4801[_0x86ae3c];return _0x1127a4;};'use strict';var emlformat=require(_0x1480('0x0'));var rimraf=require(_0x1480('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1480('0x2'));var rp=require(_0x1480('0x3'));var moment=require(_0x1480('0x4'));var BPromise=require(_0x1480('0x5'));var Mustache=require(_0x1480('0x6'));var util=require(_0x1480('0x7'));var path=require(_0x1480('0x8'));var sox=require(_0x1480('0x9'));var csv=require(_0x1480('0xa'));var ejs=require(_0x1480('0xb'));var fs=require('fs');var fs_extra=require(_0x1480('0xc'));var _=require('lodash');var squel=require(_0x1480('0xd'));var crypto=require(_0x1480('0xe'));var jsforce=require(_0x1480('0xf'));var deskjs=require(_0x1480('0x10'));var toCsv=require(_0x1480('0xa'));var querystring=require(_0x1480('0x11'));var Papa=require('papaparse');var Redis=require(_0x1480('0x12'));var authService=require(_0x1480('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1480('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1480('0x15'))(_0x1480('0x16'));var utils=require(_0x1480('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1480('0x18'));var db=require(_0x1480('0x19'))['db'];function respondWithStatusCode(_0x413bd1,_0x304558){_0x304558=_0x304558||0xcc;return function(_0x1f8d83){if(_0x1f8d83){return _0x413bd1['sendStatus'](_0x304558);}return _0x413bd1[_0x1480('0x1a')](_0x304558)[_0x1480('0x1b')]();};}function respondWithResult(_0xf089fe,_0x3a979b){_0x3a979b=_0x3a979b||0xc8;return function(_0x1c70c9){if(_0x1c70c9){return _0xf089fe['status'](_0x3a979b)[_0x1480('0x1c')](_0x1c70c9);}};}function respondWithFilteredResult(_0x52bedc,_0x644d7d){return function(_0x5a946b){if(_0x5a946b){var _0xe4cbf8=typeof _0x644d7d[_0x1480('0x1d')]===_0x1480('0x1e')&&typeof _0x644d7d[_0x1480('0x1f')]===_0x1480('0x1e');var _0x32b04f=_0x5a946b[_0x1480('0x20')];var _0x3cabc8=_0xe4cbf8?0x0:_0x644d7d[_0x1480('0x1d')];var _0x241bed=_0xe4cbf8?_0x5a946b[_0x1480('0x20')]:_0x644d7d['offset']+_0x644d7d[_0x1480('0x1f')];var _0x45d0d6;if(_0x241bed>=_0x32b04f){_0x241bed=_0x32b04f;_0x45d0d6=0xc8;}else{_0x45d0d6=0xce;}_0x52bedc[_0x1480('0x1a')](_0x45d0d6);return _0x52bedc[_0x1480('0x21')](_0x1480('0x22'),_0x3cabc8+'-'+_0x241bed+'/'+_0x32b04f)[_0x1480('0x1c')](_0x5a946b);}return null;};}function patchUpdates(_0x3c02a1){return function(_0x2f365c){try{jsonpatch[_0x1480('0x23')](_0x2f365c,_0x3c02a1,!![]);}catch(_0xf7075){return BPromise['reject'](_0xf7075);}return _0x2f365c[_0x1480('0x24')]();};}function saveUpdates(_0x8a0a4e,_0x1629dc){return function(_0x22b469){if(_0x22b469){return _0x22b469['update'](_0x8a0a4e)[_0x1480('0x25')](function(_0x3319df){return _0x3319df;});}return null;};}function removeEntity(_0x50e349,_0x3490f2){return function(_0x1b8cc1){if(_0x1b8cc1){return _0x1b8cc1[_0x1480('0x26')]()[_0x1480('0x25')](function(){_0x50e349[_0x1480('0x1a')](0xcc)[_0x1480('0x1b')]();});}};}function handleEntityNotFound(_0x587324,_0x57a138){return function(_0x30a5ed){if(!_0x30a5ed){_0x587324[_0x1480('0x27')](0x194);}return _0x30a5ed;};}function handleError(_0xa8e9d3,_0x2e675b){_0x2e675b=_0x2e675b||0x1f4;return function(_0x401948){logger[_0x1480('0x28')](_0x401948[_0x1480('0x29')]);if(_0x401948[_0x1480('0x2a')]){delete _0x401948[_0x1480('0x2a')];}_0xa8e9d3[_0x1480('0x1a')](_0x2e675b)[_0x1480('0x2b')](_0x401948);};}exports['index']=function(_0x39882c,_0x1c19db){var _0x34046d={},_0x15f2b7={},_0x51ef06={'count':0x0,'rows':[]};var _0x3f9288=_['map'](db[_0x1480('0x2c')]['rawAttributes'],function(_0x3ab524){return{'name':_0x3ab524['fieldName'],'type':_0x3ab524[_0x1480('0x2d')][_0x1480('0x2e')]};});_0x15f2b7[_0x1480('0x2f')]=_[_0x1480('0x30')](_['map'](_0x3f9288,_0x1480('0x2a')),[_0x1480('0x2a')]);_0x15f2b7[_0x1480('0x31')]=_[_0x1480('0x32')](_0x39882c[_0x1480('0x31')]);_0x15f2b7[_0x1480('0x33')]=_[_0x1480('0x34')](_0x15f2b7[_0x1480('0x2f')],_0x15f2b7[_0x1480('0x31')]);_0x34046d[_0x1480('0x35')]=_[_0x1480('0x34')](_0x15f2b7[_0x1480('0x2f')],qs[_0x1480('0x36')](_0x39882c[_0x1480('0x31')]['fields']));_0x34046d[_0x1480('0x35')]=_0x34046d[_0x1480('0x35')][_0x1480('0x37')]?_0x34046d[_0x1480('0x35')]:_0x15f2b7['model'];if(!_0x39882c['query'][_0x1480('0x38')](_0x1480('0x39'))){_0x34046d[_0x1480('0x1f')]=qs[_0x1480('0x1f')](_0x39882c[_0x1480('0x31')][_0x1480('0x1f')]);_0x34046d[_0x1480('0x1d')]=qs[_0x1480('0x1d')](_0x39882c['query'][_0x1480('0x1d')]);}_0x34046d[_0x1480('0x3a')]=qs[_0x1480('0x3b')](_0x39882c['query'][_0x1480('0x3b')]);_0x34046d[_0x1480('0x3c')]=qs['filters'](_[_0x1480('0x3d')](_0x39882c[_0x1480('0x31')],_0x15f2b7[_0x1480('0x33')]),_0x3f9288);if(_0x39882c[_0x1480('0x31')]['filter']){_0x34046d[_0x1480('0x3c')]=_[_0x1480('0x3e')](_0x34046d[_0x1480('0x3c')],{'$or':_[_0x1480('0x3f')](_0x3f9288,function(_0x337fa2){if(_0x337fa2[_0x1480('0x2d')]!=='VIRTUAL'){var _0x7e4397={};_0x7e4397[_0x337fa2[_0x1480('0x2a')]]={'$like':'%'+_0x39882c[_0x1480('0x31')][_0x1480('0x40')]+'%'};return _0x7e4397;}})});}_0x34046d=_['merge']({},_0x34046d,_0x39882c[_0x1480('0x41')]);var _0x5efc02={'where':_0x34046d[_0x1480('0x3c')]};return db['CmCustomField'][_0x1480('0x20')](_0x5efc02)['then'](function(_0x1de1c7){_0x51ef06['count']=_0x1de1c7;if(_0x39882c[_0x1480('0x31')][_0x1480('0x42')]){_0x34046d['include']=[{'all':!![]}];}return db[_0x1480('0x2c')][_0x1480('0x43')](_0x34046d);})[_0x1480('0x25')](function(_0xda4aad){_0x51ef06[_0x1480('0x44')]=_0xda4aad;return _0x51ef06;})['then'](respondWithFilteredResult(_0x1c19db,_0x34046d))[_0x1480('0x45')](handleError(_0x1c19db,null));};exports[_0x1480('0x46')]=function(_0x1b7d83,_0x34baba){var _0x3cfca9={'raw':!![],'where':{'id':_0x1b7d83['params']['id']}},_0x24e484={};_0x24e484[_0x1480('0x2f')]=_[_0x1480('0x32')](db['CmCustomField'][_0x1480('0x47')]);_0x24e484[_0x1480('0x31')]=_[_0x1480('0x32')](_0x1b7d83[_0x1480('0x31')]);_0x24e484[_0x1480('0x33')]=_[_0x1480('0x34')](_0x24e484[_0x1480('0x2f')],_0x24e484[_0x1480('0x31')]);_0x3cfca9[_0x1480('0x35')]=_['intersection'](_0x24e484[_0x1480('0x2f')],qs[_0x1480('0x36')](_0x1b7d83[_0x1480('0x31')][_0x1480('0x36')]));_0x3cfca9[_0x1480('0x35')]=_0x3cfca9['attributes'][_0x1480('0x37')]?_0x3cfca9[_0x1480('0x35')]:_0x24e484['model'];if(_0x1b7d83[_0x1480('0x31')][_0x1480('0x42')]){_0x3cfca9[_0x1480('0x48')]=[{'all':!![]}];}_0x3cfca9=_[_0x1480('0x3e')]({},_0x3cfca9,_0x1b7d83[_0x1480('0x41')]);return db[_0x1480('0x2c')][_0x1480('0x49')](_0x3cfca9)[_0x1480('0x25')](handleEntityNotFound(_0x34baba,null))['then'](respondWithResult(_0x34baba,null))[_0x1480('0x45')](handleError(_0x34baba,null));};exports[_0x1480('0x4a')]=function(_0x7c2998,_0x1c39bb){if(_0x7c2998[_0x1480('0x4b')]['id']){delete _0x7c2998['body']['id'];}return db['CmCustomField'][_0x1480('0x49')]({'where':{'id':_0x7c2998[_0x1480('0x4c')]['id']}})[_0x1480('0x25')](handleEntityNotFound(_0x1c39bb,null))[_0x1480('0x25')](saveUpdates(_0x7c2998[_0x1480('0x4b')],null))[_0x1480('0x25')](respondWithResult(_0x1c39bb,null))[_0x1480('0x45')](handleError(_0x1c39bb,null));};exports[_0x1480('0x26')]=function(_0x481dbf,_0x44bc77){return db['CmCustomField'][_0x1480('0x49')]({'where':{'id':_0x481dbf[_0x1480('0x4c')]['id']}})['then'](handleEntityNotFound(_0x44bc77,null))[_0x1480('0x25')](removeEntity(_0x44bc77,null))['catch'](handleError(_0x44bc77,null));};exports[_0x1480('0x4d')]=function(_0x5e9443,_0x3c7c6e){var _0x498d39;return db['sequelize'][_0x1480('0x4e')](function(_0x4ecf62){return db[_0x1480('0x2c')][_0x1480('0x4d')](_0x5e9443['body'],{'transaction':_0x4ecf62})['then'](function(_0xa244f1){_0x498d39=_0xa244f1;var _0x2daf28={'type':db[_0x1480('0x4f')][_0x1480('0x50')],'transaction':_0x4ecf62};switch(_0x5e9443[_0x1480('0x4b')][_0x1480('0x2d')]){case _0x1480('0x51'):_0x2daf28['type']=db['Sequelize'][_0x1480('0x50')];break;case _0x1480('0x52'):_0x2daf28['type']=db[_0x1480('0x4f')][_0x1480('0x53')];break;case'switch':_0x2daf28['type']=db[_0x1480('0x4f')][_0x1480('0x54')];_0x2daf28[_0x1480('0x55')]=![];break;default:}return db[_0x1480('0x56')][_0x1480('0x57')][_0x1480('0x58')](_0x1480('0x59'),util[_0x1480('0x5a')](_0x1480('0x5b'),_0x498d39['id']),_0x2daf28);})[_0x1480('0x25')](function(){return _0x498d39;});})[_0x1480('0x25')](respondWithResult(_0x3c7c6e,0xc9))[_0x1480('0x45')](handleError(_0x3c7c6e,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b19444f..dcb4d35 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 _0xc05f=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc05f,0x180));var _0xfc05=function(_0x3043fb,_0x28c1b2){_0x3043fb=_0x3043fb-0x0;var _0x23d434=_0xc05f[_0x3043fb];return _0x23d434;};'use strict';var _=require(_0xfc05('0x0'));var util=require(_0xfc05('0x1'));var logger=require('../../config/logger')(_0xfc05('0x2'));var moment=require(_0xfc05('0x3'));var BPromise=require(_0xfc05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc05('0x5'));var rimraf=require(_0xfc05('0x6'));var config=require(_0xfc05('0x7'));var attributes=require(_0xfc05('0x8'));module[_0xfc05('0x9')]=function(_0x2e4683,_0x5166af){return _0x2e4683['define'](_0xfc05('0xa'),attributes,{'tableName':_0xfc05('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d5=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x480e86,_0xee5284){var _0x17a5dd=function(_0x550469){while(--_0x550469){_0x480e86['push'](_0x480e86['shift']());}};_0x17a5dd(++_0xee5284);}(_0xa3d5,0x1bf));var _0x5a3d=function(_0x1c97c8,_0x28d564){_0x1c97c8=_0x1c97c8-0x0;var _0x2c096d=_0xa3d5[_0x1c97c8];return _0x2c096d;};'use strict';var _=require(_0x5a3d('0x0'));var util=require(_0x5a3d('0x1'));var logger=require(_0x5a3d('0x2'))(_0x5a3d('0x3'));var moment=require(_0x5a3d('0x4'));var BPromise=require(_0x5a3d('0x5'));var rp=require(_0x5a3d('0x6'));var fs=require('fs');var path=require(_0x5a3d('0x7'));var rimraf=require('rimraf');var config=require(_0x5a3d('0x8'));var attributes=require(_0x5a3d('0x9'));module[_0x5a3d('0xa')]=function(_0x1134cd,_0x5c9fc8){return _0x1134cd[_0x5a3d('0xb')](_0x5a3d('0xc'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 7b7b7aa..ab0513e 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 _0xdb12=['info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3f2dcc,_0x57e4de){var _0x3a0dc2=function(_0x4e367f){while(--_0x4e367f){_0x3f2dcc['push'](_0x3f2dcc['shift']());}};_0x3a0dc2(++_0x57e4de);}(_0xdb12,0xd2));var _0x2db1=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xdb12[_0x18afca];return _0x11603f;};'use strict';var _=require('lodash');var util=require(_0x2db1('0x0'));var moment=require('moment');var BPromise=require(_0x2db1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2db1('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2db1('0x3'))(_0x2db1('0x4'));var config=require(_0x2db1('0x5'));var jayson=require(_0x2db1('0x6'));var client=jayson[_0x2db1('0x7')][_0x2db1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41ea65,_0x35e640,_0xc6ca32){return new BPromise(function(_0x4c2b8c,_0x1dbf1c){return client[_0x2db1('0x9')](_0x41ea65,_0xc6ca32)['then'](function(_0x173716){logger[_0x2db1('0xa')]('CmCustomField,\x20%s,\x20%s',_0x35e640,_0x2db1('0xb'));logger['debug'](_0x2db1('0xc'),_0x35e640,_0x2db1('0xb'),JSON[_0x2db1('0xd')](_0x173716));if(_0x173716['error']){if(_0x173716[_0x2db1('0xe')][_0x2db1('0xf')]===0x1f4){logger[_0x2db1('0xe')](_0x2db1('0x10'),_0x35e640,_0x173716[_0x2db1('0xe')][_0x2db1('0x11')]);return _0x1dbf1c(_0x173716[_0x2db1('0xe')]['message']);}logger[_0x2db1('0xe')]('CmCustomField,\x20%s,\x20%s',_0x35e640,_0x173716[_0x2db1('0xe')][_0x2db1('0x11')]);return _0x4c2b8c(_0x173716[_0x2db1('0xe')][_0x2db1('0x11')]);}else{logger[_0x2db1('0xa')](_0x2db1('0x10'),_0x35e640,_0x2db1('0xb'));_0x4c2b8c(_0x173716[_0x2db1('0x12')][_0x2db1('0x11')]);}})[_0x2db1('0x13')](function(_0x37df4d){logger['error'](_0x2db1('0x10'),_0x35e640,_0x37df4d);_0x1dbf1c(_0x37df4d);});});} \ No newline at end of file +var _0x52bf=['CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x15ad1a,_0x2de048){var _0x228e84=function(_0x2f17c7){while(--_0x2f17c7){_0x15ad1a['push'](_0x15ad1a['shift']());}};_0x228e84(++_0x2de048);}(_0x52bf,0x106));var _0xf52b=function(_0x30f037,_0x4a57e2){_0x30f037=_0x30f037-0x0;var _0xde3167=_0x52bf[_0x30f037];return _0xde3167;};'use strict';var _=require(_0xf52b('0x0'));var util=require(_0xf52b('0x1'));var moment=require(_0xf52b('0x2'));var BPromise=require(_0xf52b('0x3'));var rs=require(_0xf52b('0x4'));var fs=require('fs');var Redis=require(_0xf52b('0x5'));var db=require(_0xf52b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf52b('0x7'))(_0xf52b('0x8'));var config=require(_0xf52b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf52b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43248e,_0x20d31d,_0x561adc){return new BPromise(function(_0x2d422b,_0x49f565){return client[_0xf52b('0xb')](_0x43248e,_0x561adc)[_0xf52b('0xc')](function(_0x223c97){logger[_0xf52b('0xd')](_0xf52b('0xe'),_0x20d31d,_0xf52b('0xf'));logger[_0xf52b('0x10')](_0xf52b('0x11'),_0x20d31d,'request\x20sent',JSON[_0xf52b('0x12')](_0x223c97));if(_0x223c97['error']){if(_0x223c97[_0xf52b('0x13')][_0xf52b('0x14')]===0x1f4){logger[_0xf52b('0x13')](_0xf52b('0xe'),_0x20d31d,_0x223c97['error'][_0xf52b('0x15')]);return _0x49f565(_0x223c97[_0xf52b('0x13')][_0xf52b('0x15')]);}logger[_0xf52b('0x13')]('CmCustomField,\x20%s,\x20%s',_0x20d31d,_0x223c97[_0xf52b('0x13')][_0xf52b('0x15')]);return _0x2d422b(_0x223c97['error'][_0xf52b('0x15')]);}else{logger[_0xf52b('0xd')](_0xf52b('0xe'),_0x20d31d,_0xf52b('0xf'));_0x2d422b(_0x223c97['result'][_0xf52b('0x15')]);}})[_0xf52b('0x16')](function(_0x549296){logger[_0xf52b('0x13')]('CmCustomField,\x20%s,\x20%s',_0x20d31d,_0x549296);_0x49f565(_0x549296);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 066b10d..d90d073 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 _0xbac8=['Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','destroy','exports','multer','util','express'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xbac8,0x140));var _0x8bac=function(_0x274590,_0x4ad5ab){_0x274590=_0x274590-0x0;var _0xba36bb=_0xbac8[_0x274590];return _0xba36bb;};'use strict';var multer=require(_0x8bac('0x0'));var util=require(_0x8bac('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8bac('0x2'));var router=express[_0x8bac('0x3')]();var fs_extra=require(_0x8bac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8bac('0x5'));var config=require(_0x8bac('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x8bac('0x7')](),controller[_0x8bac('0x8')]);router[_0x8bac('0x9')](_0x8bac('0xa'),auth[_0x8bac('0x7')](),controller[_0x8bac('0xb')]);router[_0x8bac('0xc')]('/',auth[_0x8bac('0x7')](),controller[_0x8bac('0xd')]);router['put'](_0x8bac('0xa'),auth[_0x8bac('0x7')](),controller[_0x8bac('0xe')]);router['delete'](_0x8bac('0xa'),auth['isAuthenticated'](),controller[_0x8bac('0xf')]);module[_0x8bac('0x10')]=router; \ No newline at end of file +var _0xc746=['../../config/environment','isAuthenticated','index','show','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x38aa58,_0x35a451){var _0x4839c5=function(_0x54d355){while(--_0x54d355){_0x38aa58['push'](_0x38aa58['shift']());}};_0x4839c5(++_0x35a451);}(_0xc746,0xc9));var _0x6c74=function(_0x5cf05d,_0x1eadca){_0x5cf05d=_0x5cf05d-0x0;var _0x38c424=_0xc746[_0x5cf05d];return _0x38c424;};'use strict';var multer=require(_0x6c74('0x0'));var util=require(_0x6c74('0x1'));var path=require(_0x6c74('0x2'));var timeout=require(_0x6c74('0x3'));var express=require(_0x6c74('0x4'));var router=express[_0x6c74('0x5')]();var fs_extra=require(_0x6c74('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c74('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x6c74('0x8')](),controller[_0x6c74('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6c74('0xa')]);router['post']('/',auth[_0x6c74('0x8')](),controller[_0x6c74('0xb')]);router[_0x6c74('0xc')](_0x6c74('0xd'),auth[_0x6c74('0x8')](),controller['update']);router[_0x6c74('0xe')](_0x6c74('0xd'),auth[_0x6c74('0x8')](),controller['destroy']);module[_0x6c74('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index f997b35..f2fef87 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 _0x69ce=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0x69ce,0x164));var _0xe69c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x69ce[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe69c('0x0'));var Sequelize=require(_0xe69c('0x1'));module['exports']={'phone':{'type':Sequelize[_0xe69c('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe69c('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe69c('0x4')],'defaultValue':moment()[_0xe69c('0x5')](_0xe69c('0x6'))},'countbusyretry':{'type':Sequelize[_0xe69c('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe69c('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe69c('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe69c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe69c('0x4')]},'priority':{'type':Sequelize[_0xe69c('0x7')](0x2)[_0xe69c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe69c('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe69c('0x7')],'unique':_0xe69c('0x9')},'ListId':{'type':Sequelize[_0xe69c('0x7')],'unique':_0xe69c('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xe69c('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xe69c('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe69c('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe69c('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe69c('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xe69c('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd1e5=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','exports'];(function(_0x5baf1c,_0x2a4b60){var _0x2bc6cf=function(_0x5b0bd6){while(--_0x5b0bd6){_0x5baf1c['push'](_0x5baf1c['shift']());}};_0x2bc6cf(++_0x2a4b60);}(_0xd1e5,0x1e7));var _0x5d1e=function(_0x42322a,_0x296b64){_0x42322a=_0x42322a-0x0;var _0x178dee=_0xd1e5[_0x42322a];return _0x178dee;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5d1e('0x0')]={'phone':{'type':Sequelize[_0x5d1e('0x1')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5d1e('0x2')],'defaultValue':moment()['format'](_0x5d1e('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5d1e('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5d1e('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5d1e('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5d1e('0x2')]},'priority':{'type':Sequelize[_0x5d1e('0x4')](0x2)[_0x5d1e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5d1e('0x4')],'unique':_0x5d1e('0x7')},'ListId':{'type':Sequelize[_0x5d1e('0x4')],'unique':_0x5d1e('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5d1e('0x7')},'CampaignId':{'type':Sequelize[_0x5d1e('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5d1e('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5d1e('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5d1e('0x1')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index deff6e8..71bd28e 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 _0x0bde=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','CmHopper','rows','show','params','options','catch','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','deletedat','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','scheduledat','getOpenContacts','outbound','preview','format','YYYY-MM-DD\x20HH:mm:ss','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var moment=require('moment');var _=require(_0xe0bd('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var shared=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];function respondWithResult(_0x2da4bd,_0x5541b9){_0x5541b9=_0x5541b9||0xc8;return function(_0x34df88){if(_0x34df88){return _0x2da4bd[_0xe0bd('0x5')](_0x5541b9)[_0xe0bd('0x6')](_0x34df88);}};}function respondWithFilteredResult(_0x3b712a,_0x22bfd1){return function(_0x26393f){if(_0x26393f){var _0x217145=typeof _0x22bfd1['offset']===_0xe0bd('0x7')&&typeof _0x22bfd1[_0xe0bd('0x8')]===_0xe0bd('0x7');var _0x2d32c6=_0x26393f[_0xe0bd('0x9')];var _0x3c47c4=_0x217145?0x0:_0x22bfd1[_0xe0bd('0xa')];var _0x58d892=_0x217145?_0x26393f['count']:_0x22bfd1['offset']+_0x22bfd1['limit'];var _0x44ffa9;if(_0x58d892>=_0x2d32c6){_0x58d892=_0x2d32c6;_0x44ffa9=0xc8;}else{_0x44ffa9=0xce;}_0x3b712a['status'](_0x44ffa9);return _0x3b712a['set'](_0xe0bd('0xb'),_0x3c47c4+'-'+_0x58d892+'/'+_0x2d32c6)[_0xe0bd('0x6')](_0x26393f);}return null;};}function saveUpdates(_0x54d40e,_0xc492b4){return function(_0x5272ca){if(_0x5272ca){return _0x5272ca[_0xe0bd('0xc')](_0x54d40e)[_0xe0bd('0xd')](function(_0x3b2fb1){return _0x3b2fb1;});}return null;};}function handleEntityNotFound(_0x20ab47,_0x47664e){return function(_0x335f17){if(!_0x335f17){_0x20ab47[_0xe0bd('0xe')](0x194);}return _0x335f17;};}function handleError(_0x210f20,_0x4f63fa){_0x4f63fa=_0x4f63fa||0x1f4;return function(_0x50891d){logger['error'](_0x50891d[_0xe0bd('0xf')]);if(_0x50891d[_0xe0bd('0x10')]){delete _0x50891d[_0xe0bd('0x10')];}_0x210f20[_0xe0bd('0x5')](_0x4f63fa)[_0xe0bd('0x11')](_0x50891d);};}exports['index']=function(_0x4ebe7a,_0x1becc8){var _0x4ac920={},_0x4f36f7={},_0x418d64={'count':0x0,'rows':[]};var _0xec158d=_[_0xe0bd('0x12')](db['CmHopper'][_0xe0bd('0x13')],function(_0xe1d808){return{'name':_0xe1d808[_0xe0bd('0x14')],'type':_0xe1d808['type'][_0xe0bd('0x15')]};});_0x4f36f7[_0xe0bd('0x16')]=_[_0xe0bd('0x12')](_0xec158d,'name');_0x4f36f7[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4ebe7a[_0xe0bd('0x17')]);_0x4f36f7['filters']=_[_0xe0bd('0x19')](_0x4f36f7['model'],_0x4f36f7[_0xe0bd('0x17')]);_0x4f36f7[_0xe0bd('0x1a')]=_['concat'](_0x4f36f7[_0xe0bd('0x1a')],[_0xe0bd('0x1b'),_0xe0bd('0x1c'),_0xe0bd('0x1d'),_0xe0bd('0x1e'),_0xe0bd('0x1f'),_0xe0bd('0x20'),_0xe0bd('0x21'),'$eq','$not',_0xe0bd('0x22'),_0xe0bd('0x23'),'$in','$notIn',_0xe0bd('0x24'),_0xe0bd('0x25'),_0xe0bd('0x26'),_0xe0bd('0x27'),'$like',_0xe0bd('0x28'),'$contains',_0xe0bd('0x29'),_0xe0bd('0x2a')]);_0x4ac920[_0xe0bd('0x2b')]=_[_0xe0bd('0x19')](_0x4f36f7[_0xe0bd('0x16')],qs[_0xe0bd('0x2c')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x4ac920[_0xe0bd('0x2b')]=_0x4ac920[_0xe0bd('0x2b')][_0xe0bd('0x2d')]?_0x4ac920[_0xe0bd('0x2b')]:_0x4f36f7[_0xe0bd('0x16')];if(!_0x4ebe7a['query'][_0xe0bd('0x2e')](_0xe0bd('0x2f'))){_0x4ac920[_0xe0bd('0x8')]=qs[_0xe0bd('0x8')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x8')]);_0x4ac920['offset']=qs['offset'](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0xa')]);}_0x4ac920[_0xe0bd('0x30')]=qs[_0xe0bd('0x31')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x31')]);_0x4ac920[_0xe0bd('0x32')]=qs['filters'](_[_0xe0bd('0x33')](_0x4ebe7a[_0xe0bd('0x17')],_0x4f36f7[_0xe0bd('0x1a')]),_0xec158d);if(_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]){_0x4ac920[_0xe0bd('0x32')]=_['merge'](_0x4ac920[_0xe0bd('0x32')],{'$or':_[_0xe0bd('0x12')](_0xec158d,function(_0x24b857){if(_0x24b857[_0xe0bd('0x35')]!==_0xe0bd('0x36')){var _0x5881e5={};_0x5881e5[_0x24b857['name']]={'$like':'%'+_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]+'%'};return _0x5881e5;}})});}_0x4ac920=_[_0xe0bd('0x37')]({},_0x4ac920,_0x4ebe7a['options']);var _0x8a331={'where':_0x4ac920['where']};return db['CmHopper'][_0xe0bd('0x9')](_0x8a331)[_0xe0bd('0xd')](function(_0x4d8695){_0x418d64['count']=_0x4d8695;if(_0x4ebe7a['query'][_0xe0bd('0x38')]){_0x4ac920[_0xe0bd('0x39')]=[{'all':!![]}];}return db[_0xe0bd('0x3a')]['findAll'](_0x4ac920);})[_0xe0bd('0xd')](function(_0x2b4814){_0x418d64[_0xe0bd('0x3b')]=_0x2b4814;return _0x418d64;})['then'](respondWithFilteredResult(_0x1becc8,_0x4ac920))['catch'](handleError(_0x1becc8,null));};exports[_0xe0bd('0x3c')]=function(_0x4e5247,_0x1eba8b){var _0x195f0f={'raw':!![],'where':{'id':_0x4e5247[_0xe0bd('0x3d')]['id']}},_0x5aee49={};_0x5aee49[_0xe0bd('0x16')]=_[_0xe0bd('0x18')](db[_0xe0bd('0x3a')][_0xe0bd('0x13')]);_0x5aee49[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4e5247['query']);_0x5aee49[_0xe0bd('0x1a')]=_[_0xe0bd('0x19')](_0x5aee49[_0xe0bd('0x16')],_0x5aee49[_0xe0bd('0x17')]);_0x195f0f[_0xe0bd('0x2b')]=_['intersection'](_0x5aee49['model'],qs['fields'](_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x195f0f[_0xe0bd('0x2b')]=_0x195f0f[_0xe0bd('0x2b')]['length']?_0x195f0f['attributes']:_0x5aee49[_0xe0bd('0x16')];if(_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x38')]){_0x195f0f[_0xe0bd('0x39')]=[{'all':!![]}];}_0x195f0f=_[_0xe0bd('0x37')]({},_0x195f0f,_0x4e5247[_0xe0bd('0x3e')]);return db[_0xe0bd('0x3a')]['find'](_0x195f0f)[_0xe0bd('0xd')](handleEntityNotFound(_0x1eba8b,null))['then'](respondWithResult(_0x1eba8b,null))[_0xe0bd('0x3f')](handleError(_0x1eba8b,null));};exports[_0xe0bd('0x40')]=function(_0x507876,_0x4cfad0){return db[_0xe0bd('0x3a')][_0xe0bd('0x40')](_0x507876[_0xe0bd('0x41')],{})[_0xe0bd('0xd')](respondWithResult(_0x4cfad0,0xc9))[_0xe0bd('0x3f')](handleError(_0x4cfad0,null));};exports[_0xe0bd('0xc')]=function(_0x368549,_0x37f9ea){if(_0x368549[_0xe0bd('0x41')]['id']){delete _0x368549['body']['id'];}return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x368549[_0xe0bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x37f9ea,null))[_0xe0bd('0xd')](saveUpdates(_0x368549[_0xe0bd('0x41')],null))['then'](respondWithResult(_0x37f9ea,null))[_0xe0bd('0x3f')](handleError(_0x37f9ea,null));};exports[_0xe0bd('0x43')]=function(_0x578792,_0xd14c1d){return db[_0xe0bd('0x3a')][_0xe0bd('0x43')]()['then'](respondWithResult(_0xd14c1d,null))[_0xe0bd('0x3f')](handleError(_0xd14c1d,null));};exports[_0xe0bd('0x44')]=function(_0x147438,_0x21ae20){var _0x119d5c;var _0x2eff0d=_0x147438[_0xe0bd('0x3d')]['id'];return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x147438['params']['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](function(_0x43b646){if(_0x43b646){return _0x43b646[_0xe0bd('0x44')]()['then'](function(_0xacd120){return _0xacd120;});}})[_0xe0bd('0xd')](function(_0x1ab9b0){_0x119d5c=_0x1ab9b0;if(_0x1ab9b0){if(_0x1ab9b0[_0xe0bd('0x45')]||_0x1ab9b0[_0xe0bd('0x46')]){return db[_0x1ab9b0[_0xe0bd('0x45')]?_0xe0bd('0x47'):_0xe0bd('0x48')][_0xe0bd('0x42')]({'where':{'id':_0x1ab9b0[_0xe0bd('0x45')]?_0x1ab9b0['VoiceQueueId']:_0x1ab9b0[_0xe0bd('0x46')]},'attributes':['id',_0xe0bd('0x10')],'raw':!![]});}}})[_0xe0bd('0xd')](function(_0x52573c){var _0x16dda5={};if(_0x52573c){_[_0xe0bd('0x37')](_0x16dda5,_[_0xe0bd('0x49')](_0x119d5c[_0xe0bd('0x4a')],[_0xe0bd('0x4b'),_0xe0bd('0x4c'),'id']));_0x16dda5[_0xe0bd('0x4d')]=0x15;_0x16dda5[_0xe0bd('0x4e')]=_0xe0bd('0x4f');_0x16dda5['campaign']=_0x52573c[_0xe0bd('0x10')];_0x16dda5[_0xe0bd('0x50')]=_0x147438[_0xe0bd('0x51')][_0xe0bd('0x10')];_0x16dda5['UserId']=_0x147438[_0xe0bd('0x51')]['id'];_0x16dda5[_0xe0bd('0x4f')]=!![];_0x16dda5[_0xe0bd('0x52')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x16dda5[_0xe0bd('0x53')]=_0x119d5c[_0xe0bd('0x54')];_0x16dda5['campaigntype']=_0x119d5c[_0xe0bd('0x45')]?_0xe0bd('0x55'):_0xe0bd('0x56');return db[_0xe0bd('0x57')]['find']({'where':{'id':_0x16dda5[_0xe0bd('0x58')]},'attributes':[_0xe0bd('0x59'),_0xe0bd('0x5a')]})[_0xe0bd('0xd')](function(_0x373846){if(!_[_0xe0bd('0x5b')](_0x21ae20)&&!_[_0xe0bd('0x5b')](_0x373846['firstName'])){_0x16dda5[_0xe0bd('0x5c')]=_0x373846[_0xe0bd('0x59')];if(!_[_0xe0bd('0x5b')](_0x373846[_0xe0bd('0x5a')])){_0x16dda5[_0xe0bd('0x5c')]+='\x20'+_0x373846[_0xe0bd('0x5a')];}}})[_0xe0bd('0x5d')](function(){return db[_0xe0bd('0x5e')][_0xe0bd('0x40')](_0x16dda5);});}})[_0xe0bd('0xd')](function(_0x29b248){return db[_0xe0bd('0x5f')][_0xe0bd('0x44')]({'where':{'CmHopperId':_0x2eff0d}});})[_0xe0bd('0xd')](function(){return _0x21ae20[_0xe0bd('0x5')](0xcc)[_0xe0bd('0x60')]();})[_0xe0bd('0x3f')](handleError(_0x21ae20,null));};exports[_0xe0bd('0x61')]=function(_0x178398,_0x8e61d6){var _0x9d03de=[];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x4b461a){_0x9d03de=_[_0xe0bd('0x18')](_0x4b461a);return _0x178398[_0xe0bd('0x51')][_0xe0bd('0x62')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0xe0bd('0x63')],'raw':!![]});})[_0xe0bd('0xd')](function(_0x4dfd2a){if(_0x4dfd2a&&_0x4dfd2a[_0xe0bd('0x2d')]){return db['sequelize'][_0xe0bd('0x64')](function(_0x2ede67){var _0x14bbeb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4dfd2a,'id')},'$or':[{'UserId':null},{'UserId':_0x178398[_0xe0bd('0x51')]['id']}]};var _0x1c9407={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4dfd2a)[_0xe0bd('0x34')]([_0xe0bd('0x63'),0x0])[_0xe0bd('0x12')]('id')[_0xe0bd('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x178398['user']['id']}]};var _0x338028={'$or':[_0x14bbeb,_0x1c9407]};var _0x40a584=[];if(_0x178398['body'][_0xe0bd('0x66')]&&_0x178398[_0xe0bd('0x41')][_0xe0bd('0x66')]===_0xe0bd('0x67')){if(!_[_0xe0bd('0x68')](_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')])){_0x338028['id']={'$in':_0x178398[_0xe0bd('0x41')]['hopperIds']};}_0x40a584=[[_0xe0bd('0x6a'),_0xe0bd('0x6b')],[_0xe0bd('0x6c'),_0x4dfd2a[0x0]['dialOrderByScheduledAt']===_0xe0bd('0x6b')?_0xe0bd('0x6d'):_0xe0bd('0x6b')],db[_0xe0bd('0x6e')]['literal'](_0xe0bd('0x6f')),['id',_0xe0bd('0x6d')]];}else{if(!_[_0xe0bd('0x68')](_0x178398['body'][_0xe0bd('0x69')])){_0x338028['id']={'$notIn':_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')]};}_0x40a584=[['priority',_0xe0bd('0x6d')],['scheduledAt',_0x4dfd2a[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe0bd('0x70')](_0xe0bd('0x71')),['id',_0xe0bd('0x6b')]];}return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id','scheduledat',_0xe0bd('0x54'),_0xe0bd('0x72')],'where':_0x338028,'order':_0x40a584,'transaction':_0x2ede67,'lock':_0x2ede67[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x9d03de,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db['VoiceQueue'],'as':_0xe0bd('0x79'),'attributes':['id',_0xe0bd('0x10'),_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x191423){if(_0x191423){return _0x191423[_0xe0bd('0xc')]({'UserId':_0x178398[_0xe0bd('0x51')]['id']},{'transaction':_0x2ede67});}});});}})['then'](handleEntityNotFound(_0x8e61d6,null))[_0xe0bd('0xd')](respondWithResult(_0x8e61d6,null))[_0xe0bd('0x3f')](handleError(_0x8e61d6,null));};exports['getPreviewRecall']=function(_0x4303ec,_0x2acb14,_0x1f230d){var _0x4fb0cb=[];var _0x5991e5=_0x4303ec[_0xe0bd('0x3d')]['id'];var _0x1cc0dd=_0x4303ec['user']['id'];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x485bde){_0x4fb0cb=_[_0xe0bd('0x18')](_0x485bde);return db[_0xe0bd('0x6e')][_0xe0bd('0x64')](function(_0x6e9712){const _0x4e3815={'id':_0x5991e5};return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id',_0xe0bd('0x7b'),_0xe0bd('0x72')],'where':_0x4e3815,'transaction':_0x6e9712,'lock':_0x6e9712[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x4fb0cb,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db[_0xe0bd('0x47')],'as':_0xe0bd('0x79'),'attributes':['id','name',_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x6a6012){if(_0x6a6012){return _0x6a6012[_0xe0bd('0xc')]({'UserId':_0x1cc0dd},{'transaction':_0x6e9712});}});});})[_0xe0bd('0xd')](handleEntityNotFound(_0x2acb14,null))[_0xe0bd('0xd')](respondWithResult(_0x2acb14,null))['catch'](handleError(_0x2acb14,null));};exports[_0xe0bd('0x7c')]=function(_0x378034,_0x17435d){return _0x378034[_0xe0bd('0x51')]['getVoiceQueues']({'where':{'type':_0xe0bd('0x7d'),'dialActive':!![],'dialMethod':_0xe0bd('0x7e')},'attributes':['id'],'raw':!![]})[_0xe0bd('0xd')](function(_0x3fb7f9){if(_0x3fb7f9&&_0x3fb7f9[_0xe0bd('0x2d')]){return db['CmHopper'][_0xe0bd('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe0bd('0x7f')](_0xe0bd('0x80'))},'VoiceQueueId':{'$in':_[_0xe0bd('0x12')](_0x3fb7f9,'id')},'$or':[{'UserId':null},{'UserId':_0x378034[_0xe0bd('0x51')]['id']}]}});}return 0x0;})[_0xe0bd('0xd')](function(_0x3a82a5){if(!_[_0xe0bd('0x5b')](_0x3a82a5)&&_[_0xe0bd('0x81')](_0x3a82a5)){return _0x17435d[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'contacts':_0x3a82a5});}else{logger[_0xe0bd('0x82')](_0xe0bd('0x83'),_0xe0bd('0x7c'),0x194,_0xe0bd('0x84'));_0x17435d[_0xe0bd('0xe')](0x194);}})[_0xe0bd('0x3f')](handleError(_0x17435d,null));};exports[_0xe0bd('0x85')]=function(_0x5a9a57,_0x9b312e){var _0x36ca72=shared[_0xe0bd('0x86')];var _0x52287d=[];_[_0xe0bd('0x12')](_0x36ca72,function(_0x1ae29c){_0x52287d[_0xe0bd('0x87')]({'id':_0x1ae29c[_0xe0bd('0x10')],'name':_0x1ae29c[_0xe0bd('0x10')],'utcOffset':_0x1ae29c[_0xe0bd('0x88')]});});return _0x9b312e[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'tz':_0x52287d});};exports[_0xe0bd('0x89')]=function(_0x531f39,_0x52a859){var _0x4e9fe0=shared[_0xe0bd('0x86')];var _0x42b1b4={};if(!_[_0xe0bd('0x5b')](_0x4e9fe0[_0x531f39['body']['id']]))_0x42b1b4=_0x4e9fe0[_0x531f39[_0xe0bd('0x41')]['id']];return _0x52a859[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')](_0x42b1b4);}; \ No newline at end of file +var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0x5b42fa,_0x4a9e81){var _0x1ede4f=function(_0x205c44){while(--_0x205c44){_0x5b42fa['push'](_0x5b42fa['shift']());}};_0x1ede4f(++_0x4a9e81);}(_0x6737,0xe2));var _0x7673=function(_0x13996f,_0x5d2577){_0x13996f=_0x13996f-0x0;var _0x230b2f=_0x6737[_0x13996f];return _0x230b2f;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 1b2d437..70b879c 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 _0xd8fb=['util','../../config/logger','api','path','rimraf','./cmHopper.attributes','exports','CmHopper','scheduledat','priority','lodash'];(function(_0x1ac2d8,_0xe1aa59){var _0x2744af=function(_0x37a898){while(--_0x37a898){_0x1ac2d8['push'](_0x1ac2d8['shift']());}};_0x2744af(++_0xe1aa59);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5049fe,_0x3c618f){_0x5049fe=_0x5049fe-0x0;var _0x1ebb06=_0xd8fb[_0x5049fe];return _0x1ebb06;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xbd8f('0x9'),'fields':[_0xbd8f('0x9')]},{'name':'phone','fields':['phone']},{'name':_0xbd8f('0xa'),'fields':[_0xbd8f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x53ec,0x192));var _0xc53e=function(_0x2a87e9,_0x25c03e){_0x2a87e9=_0x2a87e9-0x0;var _0x5de0e6=_0x53ec[_0x2a87e9];return _0x5de0e6;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 0125231..c455329 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 _0x6e87=['order','UPDATE','Contact','keys','User','Agent','name','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','voicePause','CmList','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmHopper','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','info','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction'];(function(_0x6f8634,_0x254758){var _0x5c4d81=function(_0x1fd1c6){while(--_0x1fd1c6){_0x6f8634['push'](_0x6f8634['shift']());}};_0x5c4d81(++_0x254758);}(_0x6e87,0x7e));var _0x76e8=function(_0x2eacf1,_0x2f747f){_0x2eacf1=_0x2eacf1-0x0;var _0x147531=_0x6e87[_0x2eacf1];return _0x147531;};'use strict';var _=require('lodash');var util=require(_0x76e8('0x0'));var moment=require(_0x76e8('0x1'));var BPromise=require(_0x76e8('0x2'));var db=require(_0x76e8('0x3'))['db'];var logger=require(_0x76e8('0x4'))(_0x76e8('0x5'));exports['GetCmHopper']=function(_0x595090){var _0x329714=this;return new Promise(function(_0x10fb54,_0x1cc955){return db[_0x76e8('0x6')][_0x76e8('0x7')]({'raw':_0x595090[_0x76e8('0x8')]?_0x595090[_0x76e8('0x8')][_0x76e8('0x9')]===undefined?!![]:![]:!![],'where':_0x595090['options']?_0x595090['options'][_0x76e8('0xa')]||null:null,'attributes':_0x595090['options']?_0x595090[_0x76e8('0x8')][_0x76e8('0xb')]||null:null,'limit':_0x595090[_0x76e8('0x8')]?_0x595090[_0x76e8('0x8')][_0x76e8('0xc')]||null:null,'include':_0x595090[_0x76e8('0x8')]?_0x595090[_0x76e8('0x8')][_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x595090[_0x76e8('0x8')][_0x76e8('0xd')],function(_0x221d7d){return{'model':db[_0x221d7d[_0x76e8('0xf')]],'as':_0x221d7d['as'],'attributes':_0x221d7d['attributes'],'include':_0x221d7d[_0x76e8('0xd')]?_['map'](_0x221d7d[_0x76e8('0xd')],function(_0x23571d){return{'model':db[_0x23571d[_0x76e8('0xf')]],'as':_0x23571d['as'],'attributes':_0x23571d[_0x76e8('0xb')],'include':_0x23571d[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x23571d[_0x76e8('0xd')],function(_0x3c0805){return{'model':db[_0x3c0805[_0x76e8('0xf')]],'as':_0x3c0805['as'],'attributes':_0x3c0805['attributes']};}):[]};}):[]};}):[]:[]})[_0x76e8('0x10')](function(_0x1140d9){logger['info'](_0x76e8('0x11'),_0x595090);logger[_0x76e8('0x12')](_0x76e8('0x11'),_0x595090,JSON[_0x76e8('0x13')](_0x1140d9));_0x10fb54(_0x1140d9);})[_0x76e8('0x14')](function(_0x498a6f){logger[_0x76e8('0x15')](_0x76e8('0x11'),_0x498a6f[_0x76e8('0x16')],_0x595090);_0x1cc955(_0x329714[_0x76e8('0x15')](0x1f4,_0x498a6f[_0x76e8('0x16')]));});});};exports[_0x76e8('0x17')]=function(_0x150da1){var _0x18bac6=this;return new Promise(function(_0x202036,_0x2d7de8){return db[_0x76e8('0x6')][_0x76e8('0x18')]({'raw':_0x150da1[_0x76e8('0x8')]?_0x150da1['options']['raw']===undefined?!![]:![]:!![],'where':_0x150da1[_0x76e8('0x8')]?_0x150da1[_0x76e8('0x8')][_0x76e8('0xa')]||null:null,'attributes':_0x150da1[_0x76e8('0x8')]?_0x150da1[_0x76e8('0x8')][_0x76e8('0xb')]||null:null,'include':_0x150da1['options']?_0x150da1[_0x76e8('0x8')][_0x76e8('0xd')]?_['map'](_0x150da1[_0x76e8('0x8')][_0x76e8('0xd')],function(_0x1a3a85){return{'model':db[_0x1a3a85[_0x76e8('0xf')]],'as':_0x1a3a85['as'],'attributes':_0x1a3a85['attributes'],'include':_0x1a3a85[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x1a3a85['include'],function(_0x3357db){return{'model':db[_0x3357db[_0x76e8('0xf')]],'as':_0x3357db['as'],'attributes':_0x3357db['attributes'],'include':_0x3357db[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x3357db[_0x76e8('0xd')],function(_0x5352a0){return{'model':db[_0x5352a0['model']],'as':_0x5352a0['as'],'attributes':_0x5352a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x76e8('0x10')](function(_0x3b9ad1){logger['info'](_0x76e8('0x17'),_0x150da1);logger['debug'](_0x76e8('0x17'),_0x150da1,JSON[_0x76e8('0x13')](_0x3b9ad1));_0x202036(_0x3b9ad1);})[_0x76e8('0x14')](function(_0x2f5f04){logger[_0x76e8('0x15')](_0x76e8('0x17'),_0x2f5f04['message'],_0x150da1);_0x2d7de8(_0x18bac6[_0x76e8('0x15')](0x1f4,_0x2f5f04[_0x76e8('0x16')]));});});};exports[_0x76e8('0x19')]=function(_0x578159){var _0x231009=this;return new Promise(function(_0x197e4f,_0x42244e){return db[_0x76e8('0x6')][_0x76e8('0x1a')](_0x578159[_0x76e8('0x1b')],{'raw':_0x578159['options']?_0x578159['options'][_0x76e8('0x9')]===undefined?!![]:![]:!![]})[_0x76e8('0x10')](function(_0x280283){logger['info'](_0x76e8('0x19'),_0x578159);logger[_0x76e8('0x12')](_0x76e8('0x19'),_0x578159,JSON[_0x76e8('0x13')](_0x280283));_0x197e4f(_0x280283);})[_0x76e8('0x14')](function(_0x5da13b){logger[_0x76e8('0x15')](_0x76e8('0x19'),_0x5da13b[_0x76e8('0x16')],_0x578159);_0x42244e(_0x231009['error'](0x1f4,_0x5da13b[_0x76e8('0x16')]));});});};exports[_0x76e8('0x1c')]=function(_0x12748a){var _0x131307=this;return new Promise(function(_0x14f7f7,_0x18db71){return db[_0x76e8('0x6')][_0x76e8('0x1d')](_0x12748a[_0x76e8('0x1b')],{'raw':_0x12748a[_0x76e8('0x8')]?_0x12748a[_0x76e8('0x8')][_0x76e8('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12748a[_0x76e8('0x8')]?_0x12748a['options'][_0x76e8('0xa')]||null:null,'attributes':_0x12748a['options']?_0x12748a['options'][_0x76e8('0xb')]||null:null,'limit':_0x12748a[_0x76e8('0x8')]?_0x12748a[_0x76e8('0x8')][_0x76e8('0xc')]||null:null})[_0x76e8('0x10')](function(_0x21eaf8){logger[_0x76e8('0x1e')]('UpdateCmHopper',_0x12748a);logger[_0x76e8('0x1e')](_0x76e8('0x1f'),JSON['stringify'](_0x12748a[_0x76e8('0x8')][_0x76e8('0xa')]),_0x12748a[_0x76e8('0x1b')][_0x76e8('0x20')]);logger['debug'](_0x76e8('0x1c'),_0x12748a,JSON[_0x76e8('0x13')](_0x21eaf8));_0x14f7f7(_0x21eaf8);})['catch'](function(_0x117743){logger['error'](_0x76e8('0x1c'),_0x117743[_0x76e8('0x16')],_0x12748a);_0x18db71(_0x131307[_0x76e8('0x15')](0x1f4,_0x117743['message']));});});};exports['DestroyCmHopper']=function(_0x37c4d8){var _0x4245b1=this;return new Promise(function(_0x4870d9,_0x296365){return db[_0x76e8('0x6')]['destroy']({'where':_0x37c4d8[_0x76e8('0x8')]?_0x37c4d8[_0x76e8('0x8')][_0x76e8('0xa')]||null:null})[_0x76e8('0x10')](function(_0x4287fd){logger[_0x76e8('0x1e')](_0x76e8('0x21'),_0x37c4d8);logger[_0x76e8('0x12')](_0x76e8('0x21'),_0x37c4d8,JSON[_0x76e8('0x13')](_0x4287fd));_0x4870d9(_0x4287fd);})[_0x76e8('0x14')](function(_0x4d57b7){logger[_0x76e8('0x15')](_0x76e8('0x21'),_0x4d57b7[_0x76e8('0x16')],_0x37c4d8);_0x296365(_0x4245b1[_0x76e8('0x15')](0x1f4,_0x4d57b7[_0x76e8('0x16')]));});});};exports[_0x76e8('0x22')]=function(_0x3b268d){var _0x36f5d6=this;return new Promise(function(_0x27d5ac,_0x1d6785){return db[_0x76e8('0x23')][_0x76e8('0x24')]()[_0x76e8('0x10')](function(_0x1363b3){return db['sequelize'][_0x76e8('0x25')](function(_0x5e32a4){return db[_0x76e8('0x6')][_0x76e8('0x7')]({'where':_0x3b268d[_0x76e8('0x8')]?_0x3b268d[_0x76e8('0x8')][_0x76e8('0xa')]||null:null,'attributes':_0x3b268d[_0x76e8('0x8')]?_0x3b268d[_0x76e8('0x8')][_0x76e8('0xb')]||null:null,'limit':_0x3b268d[_0x76e8('0x8')]?_0x3b268d[_0x76e8('0x8')][_0x76e8('0xc')]||null:null,'order':_0x3b268d[_0x76e8('0x8')]?_0x3b268d['options'][_0x76e8('0x26')]||null:null,'transaction':_0x5e32a4,'lock':_0x5e32a4['LOCK'][_0x76e8('0x27')],'include':[{'model':db[_0x76e8('0x23')],'as':_0x76e8('0x28'),'attributes':_[_0x76e8('0x29')](_0x1363b3)},{'model':db[_0x76e8('0x2a')],'as':_0x76e8('0x2b'),'attributes':['id',_0x76e8('0x2c'),'voicePause']}]})['then'](function(_0x52a862){var _0x4569ce=[];var _0x4da141=[];for(var _0x42f5dd=0x0;_0x42f5dd<_0x52a862[_0x76e8('0x2d')];_0x42f5dd+=0x1){var _0x925304=_0x52a862[_0x42f5dd][_0x76e8('0x2e')];if(_0x925304===null){_0x4569ce[_0x76e8('0x2f')](_0x52a862[_0x42f5dd][_0x76e8('0x1d')](_0x3b268d[_0x76e8('0x1b')],{'transaction':_0x5e32a4}));}else if(!_0x4da141[_0x76e8('0x30')](_0x925304)){_0x4da141[_0x76e8('0x2f')](_0x925304);_0x4569ce[_0x76e8('0x2f')](_0x52a862[_0x42f5dd][_0x76e8('0x1d')](_0x3b268d[_0x76e8('0x1b')],{'transaction':_0x5e32a4}));}}return BPromise[_0x76e8('0x31')](_0x4569ce);});})[_0x76e8('0x10')](function(_0x30044b){logger[_0x76e8('0x1e')](_0x76e8('0x22'),_0x3b268d);if(_0x30044b[_0x76e8('0x2d')]>0x0){logger[_0x76e8('0x1e')](_0x76e8('0x32'),_0x30044b[0x0]['dataValues']['id'],_0x30044b[0x0][_0x76e8('0x33')][_0x76e8('0x34')],_0x30044b[0x0][_0x76e8('0x33')]['active']);}logger[_0x76e8('0x12')](_0x76e8('0x22'),_0x3b268d,JSON[_0x76e8('0x13')](_0x30044b));_0x27d5ac(_0x30044b);})[_0x76e8('0x14')](function(_0x4cd210){logger['error'](_0x76e8('0x22'),_0x4cd210[_0x76e8('0x16')],_0x3b268d);_0x1d6785(_0x36f5d6[_0x76e8('0x15')](0x1f4,_0x4cd210[_0x76e8('0x16')]));});});});};exports[_0x76e8('0x35')]=function(_0x13e80c){var _0x3c9f75=this;return new Promise(function(_0x52ad85,_0x50ea70){return db[_0x76e8('0x36')][_0x76e8('0x25')](function(_0x5a8c2c){return db[_0x76e8('0x37')][_0x76e8('0x1a')](_0x13e80c[_0x76e8('0x1b')],{'raw':_0x13e80c['options']?_0x13e80c[_0x76e8('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5a8c2c})['then'](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x13e80c['options'][_0x76e8('0xa')]),_0x13e80c[_0x76e8('0x8')]['where'][_0x76e8('0x20')]);return db[_0x76e8('0x6')][_0x76e8('0x38')]({'where':_0x13e80c[_0x76e8('0x8')]?_0x13e80c[_0x76e8('0x8')][_0x76e8('0xa')]||null:null,'transaction':_0x5a8c2c});});})['then'](function(_0x228d60){logger[_0x76e8('0x1e')](_0x76e8('0x35'),_0x13e80c);logger[_0x76e8('0x12')](_0x76e8('0x35'),_0x13e80c,JSON[_0x76e8('0x13')](_0x228d60));_0x52ad85(_0x228d60);})[_0x76e8('0x14')](function(_0x3b1601){logger['error'](_0x76e8('0x35'),_0x3b1601['message'],_0x13e80c);_0x50ea70(_0x3c9f75[_0x76e8('0x15')](0x1f4,_0x3b1601[_0x76e8('0x16')]));});});};exports[_0x76e8('0x39')]=function(_0x2059e1){var _0x50b8cb=this;return new Promise(function(_0x59b7a9,_0xd65636){return db[_0x76e8('0x6')][_0x76e8('0x7')]({'raw':_0x2059e1['options']?_0x2059e1[_0x76e8('0x8')][_0x76e8('0x9')]===undefined?!![]:![]:!![],'where':_0x2059e1['options']?_0x2059e1[_0x76e8('0x8')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x76e8('0x3a'),db[_0x76e8('0x36')]['fn']('IF',db[_0x76e8('0x36')]['literal'](_0x76e8('0x3b')+util[_0x76e8('0x3c')](_0x76e8('0x3d'),moment()[_0x76e8('0x3c')](_0x76e8('0x3e')))+_0x76e8('0x3f')))),_0x76e8('0x40')]]})['then'](function(_0xee0fb6){logger[_0x76e8('0x1e')](_0x76e8('0x39'),_0x2059e1);logger[_0x76e8('0x12')](_0x76e8('0x39'),_0x2059e1,JSON[_0x76e8('0x13')](_0xee0fb6));_0x59b7a9(_0xee0fb6);})[_0x76e8('0x14')](function(_0x2750d1){logger['error'](_0x76e8('0x39'),_0x2750d1[_0x76e8('0x16')],_0x2059e1);_0xd65636(_0x50b8cb['error'](0x1f4,_0x2750d1[_0x76e8('0x16')]));});});};exports[_0x76e8('0x41')]=function(_0x2fc189){var _0x3e1d27=this;return new Promise(function(_0x1aa7f6,_0x4b94f4){return db[_0x76e8('0x23')][_0x76e8('0x24')]()[_0x76e8('0x10')](function(){return db[_0x76e8('0x36')][_0x76e8('0x25')](function(_0x347692){return db['CmHopper'][_0x76e8('0x7')]({'where':_0x2fc189[_0x76e8('0x8')]?_0x2fc189[_0x76e8('0x8')][_0x76e8('0xa')]||null:null,'attributes':_0x2fc189[_0x76e8('0x8')]?_0x2fc189[_0x76e8('0x8')][_0x76e8('0xb')]||null:null,'limit':0x1,'order':_0x2fc189['options']?_0x2fc189[_0x76e8('0x8')][_0x76e8('0x26')]||null:null,'group':db[_0x76e8('0x6')][_0x76e8('0x2e')],'transaction':_0x347692,'lock':_0x347692[_0x76e8('0x42')][_0x76e8('0x27')],'include':_0x2fc189['options']?_0x2fc189[_0x76e8('0x8')][_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x2fc189['options'][_0x76e8('0xd')],function(_0x127047){return{'model':db[_0x127047['model']],'as':_0x127047['as'],'attributes':_0x127047[_0x76e8('0xb')],'include':_0x127047[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x127047[_0x76e8('0xd')],function(_0x2f6b0c){return{'model':db[_0x2f6b0c[_0x76e8('0xf')]],'as':_0x2f6b0c['as'],'attributes':_0x2f6b0c[_0x76e8('0xb')],'include':_0x2f6b0c[_0x76e8('0xd')]?_['map'](_0x2f6b0c[_0x76e8('0xd')],function(_0x274ec4){return{'model':db[_0x274ec4[_0x76e8('0xf')]],'as':_0x274ec4['as'],'attributes':_0x274ec4[_0x76e8('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29b7e9){var _0xd9ab6e=[];for(var _0x1f07bc=0x0;_0x1f07bc<_0x29b7e9[_0x76e8('0x2d')];_0x1f07bc+=0x1){_0xd9ab6e[_0x76e8('0x2f')](_0x29b7e9[_0x1f07bc][_0x76e8('0x1d')](_0x2fc189['body'],{'transaction':_0x347692}));}return BPromise[_0x76e8('0x31')](_0xd9ab6e);});})[_0x76e8('0x10')](function(_0x411687){logger[_0x76e8('0x1e')](_0x76e8('0x41'),_0x2fc189);logger[_0x76e8('0x12')](_0x76e8('0x41'),_0x2fc189,JSON['stringify'](_0x411687));_0x1aa7f6(_0x411687);})[_0x76e8('0x14')](function(_0x1f89a1){logger[_0x76e8('0x15')](_0x76e8('0x41'),_0x1f89a1['message'],_0x2fc189);_0x4b94f4(_0x3e1d27[_0x76e8('0x15')](0x1f4,_0x1f89a1['message']));});});});};exports['GetCmHopperPreview']=function(_0x2f142e){var _0x51f254=this;return new Promise(function(_0xf0acf3,_0x231f8c){db[_0x76e8('0x23')]['describe']()[_0x76e8('0x10')](function(_0x112fbb){return db['CmHopper'][_0x76e8('0x7')]({'raw':_0x2f142e[_0x76e8('0x8')]?_0x2f142e[_0x76e8('0x8')][_0x76e8('0x9')]===undefined?!![]:![]:!![],'where':_0x2f142e['options']?_0x2f142e[_0x76e8('0x8')][_0x76e8('0xa')]||null:null,'attributes':_0x2f142e[_0x76e8('0x8')]?_0x2f142e['options']['attributes']||null:null,'limit':_0x2f142e['options']?_0x2f142e[_0x76e8('0x8')][_0x76e8('0xc')]||null:null,'include':_0x2f142e[_0x76e8('0x8')]?_0x2f142e[_0x76e8('0x8')][_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x2f142e['options']['include'],function(_0x4b3e83){return{'model':db[_0x4b3e83[_0x76e8('0xf')]],'as':_0x4b3e83['as'],'attributes':_0x4b3e83['as']===_0x76e8('0x28')?_[_0x76e8('0x29')](_0x112fbb):_0x4b3e83[_0x76e8('0xb')],'include':_0x4b3e83[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x4b3e83[_0x76e8('0xd')],function(_0x4e2174){return{'model':db[_0x4e2174[_0x76e8('0xf')]],'as':_0x4e2174['as'],'attributes':_0x4e2174[_0x76e8('0xb')],'include':_0x4e2174[_0x76e8('0xd')]?_[_0x76e8('0xe')](_0x4e2174[_0x76e8('0xd')],function(_0x56a90b){return{'model':db[_0x56a90b['model']],'as':_0x56a90b['as'],'attributes':_0x56a90b['attributes']};}):[]};}):[]};}):[]:[]})[_0x76e8('0x10')](function(_0x2211ab){logger[_0x76e8('0x1e')](_0x76e8('0x11'),_0x2f142e);logger[_0x76e8('0x12')](_0x76e8('0x11'),_0x2f142e,JSON[_0x76e8('0x13')](_0x2211ab));_0xf0acf3(_0x2211ab);})[_0x76e8('0x14')](function(_0x5dc04f){logger['error'](_0x76e8('0x11'),_0x5dc04f['message'],_0x2f142e);_0x231f8c(_0x51f254[_0x76e8('0x15')](0x1f4,_0x5dc04f[_0x76e8('0x16')]));});});});};exports[_0x76e8('0x43')]=function(_0x11895f){var _0x35c7d6=this;return new Promise(function(_0xf849d1,_0x3781f2){return db[_0x76e8('0x23')][_0x76e8('0x44')]({'raw':!![],'where':{'phone':_0x11895f[_0x76e8('0x8')]['where']['phone']},'attributes':['id',_0x76e8('0x45')],'order':[['id',_0x76e8('0x46')]]})['then'](function(_0x5dc23c){logger['info']('getContactByPhone',_0x11895f);logger['debug']('getContactByPhone',_0x11895f,JSON[_0x76e8('0x13')](_0x5dc23c));_0xf849d1(_0x5dc23c);})['catch'](function(_0x168aa7){logger[_0x76e8('0x15')](_0x76e8('0x47'),_0x168aa7['message'],_0x11895f);_0x3781f2(_0x35c7d6[_0x76e8('0x15')](0x1f4,_0x168aa7[_0x76e8('0x16')]));});});};exports['ResetActiveCalls']=function(_0x59a526){var _0x1ee2f6=this;return new Promise(function(_0x5aa323,_0x2de22d){return db[_0x76e8('0x36')][_0x76e8('0x25')](function(_0x24bbd4){var _0x26030a=_0x59a526[_0x76e8('0x8')]&&_0x59a526[_0x76e8('0x8')][_0x76e8('0xa')]?_0x59a526[_0x76e8('0x8')]['where']:{};return db[_0x76e8('0x6')][_0x76e8('0x1d')](_0x59a526['body'],{'where':_0x26030a,'transaction':_0x24bbd4})[_0x76e8('0x10')](function(_0x514cc2){logger[_0x76e8('0x1e')]('ResetActiveCalls',_0x59a526);logger[_0x76e8('0x12')](_0x76e8('0x48'),_0x59a526,JSON[_0x76e8('0x13')](_0x514cc2));_0x5aa323(_0x514cc2);})[_0x76e8('0x14')](function(_0x45a826){logger[_0x76e8('0x15')](_0x76e8('0x48'),_0x45a826[_0x76e8('0x16')],_0x59a526);_0x2de22d(_0x1ee2f6[_0x76e8('0x15')](0x1f4,_0x45a826['message']));});});});};exports[_0x76e8('0x49')]=function(_0x52f588){var _0x54d527=this;var _0x376db2=_0x52f588[_0x76e8('0x1b')][_0x76e8('0xa')]['voiceQueueIds'];var _0x3267c6=_0x52f588[_0x76e8('0x1b')]['where'][_0x76e8('0x4a')];var _0x523a84=_0x52f588[_0x76e8('0x1b')]['where'][_0x76e8('0x4b')];return new Promise(function(_0x2285c5,_0x34db4d){return db[_0x76e8('0x6')][_0x76e8('0x7')]({'where':{'voiceQueueId':{'$in':_0x376db2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0x76e8('0x4c')+_0x3267c6+_0x76e8('0x4d')),'$gt':db[_0x76e8('0x36')][_0x76e8('0x4e')](_0x76e8('0x4f'))}},'UserId':{'$in':_0x523a84}},'include':[{'model':db[_0x76e8('0x23')],'as':'Contact'},{'model':db[_0x76e8('0x2a')],'as':_0x76e8('0x2b'),'attributes':['id',_0x76e8('0x2c'),_0x76e8('0x50')]},{'model':db[_0x76e8('0x51')],'as':'List'}]})['then'](function(_0x296fd8){if(_0x296fd8['length']>0x0){return db[_0x76e8('0x36')][_0x76e8('0x25')](function(_0x558886){return db[_0x76e8('0x6')][_0x76e8('0x1d')]({'recallmeNotifiedDate':db['sequelize'][_0x76e8('0x4e')](_0x76e8('0x4f'))},{'where':{'id':{'$in':_[_0x76e8('0xe')](_0x296fd8,'id')}},'transaction':_0x558886})[_0x76e8('0x10')](function(){_0x2285c5(_0x296fd8);})['catch'](function(_0x1c86de){logger[_0x76e8('0x15')](_0x76e8('0x49'),_0x1c86de[_0x76e8('0x16')],_0x52f588);_0x34db4d(_0x54d527['error'](0x1f4,_0x1c86de[_0x76e8('0x16')]));});})[_0x76e8('0x14')](function(_0x576688){logger[_0x76e8('0x15')](_0x76e8('0x49'),_0x576688[_0x76e8('0x16')],_0x52f588);_0x34db4d(_0x54d527[_0x76e8('0x15')](0x1f4,_0x576688[_0x76e8('0x16')]));});}else{_0x2285c5(_0x296fd8);}});});}; \ No newline at end of file +var _0x9f91=['attributes','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','CreateCmHopper','body','update','limit','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','order','LOCK','UPDATE','CmContact','keys','User','Agent','name','voicePause','push','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','transaction','all','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','lodash','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','findAll','options','raw','where'];(function(_0x46ba52,_0x23b97c){var _0x53cf77=function(_0x5e8a11){while(--_0x5e8a11){_0x46ba52['push'](_0x46ba52['shift']());}};_0x53cf77(++_0x23b97c);}(_0x9f91,0x1e0));var _0x19f9=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x9f91[_0xea35d1];return _0x1d7a7c;};'use strict';var _=require(_0x19f9('0x0'));var util=require(_0x19f9('0x1'));var moment=require(_0x19f9('0x2'));var BPromise=require(_0x19f9('0x3'));var db=require(_0x19f9('0x4'))['db'];var logger=require('../../config/logger')(_0x19f9('0x5'));exports[_0x19f9('0x6')]=function(_0x531c1f){var _0x309c88=this;return new Promise(function(_0x27493e,_0x3d2c77){return db[_0x19f9('0x7')][_0x19f9('0x8')]({'raw':_0x531c1f[_0x19f9('0x9')]?_0x531c1f[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'where':_0x531c1f[_0x19f9('0x9')]?_0x531c1f[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'attributes':_0x531c1f['options']?_0x531c1f[_0x19f9('0x9')][_0x19f9('0xc')]||null:null,'limit':_0x531c1f['options']?_0x531c1f['options']['limit']||null:null,'include':_0x531c1f['options']?_0x531c1f[_0x19f9('0x9')][_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x531c1f[_0x19f9('0x9')][_0x19f9('0xd')],function(_0x142982){return{'model':db[_0x142982['model']],'as':_0x142982['as'],'attributes':_0x142982[_0x19f9('0xc')],'include':_0x142982[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x142982['include'],function(_0x44b4f0){return{'model':db[_0x44b4f0[_0x19f9('0xf')]],'as':_0x44b4f0['as'],'attributes':_0x44b4f0[_0x19f9('0xc')],'include':_0x44b4f0[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x44b4f0[_0x19f9('0xd')],function(_0x2454a3){return{'model':db[_0x2454a3[_0x19f9('0xf')]],'as':_0x2454a3['as'],'attributes':_0x2454a3[_0x19f9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x19f9('0x10')](function(_0x5aa573){logger[_0x19f9('0x11')](_0x19f9('0x6'),_0x531c1f);logger[_0x19f9('0x12')](_0x19f9('0x6'),_0x531c1f,JSON[_0x19f9('0x13')](_0x5aa573));_0x27493e(_0x5aa573);})[_0x19f9('0x14')](function(_0x244ef7){logger[_0x19f9('0x15')]('GetCmHopper',_0x244ef7[_0x19f9('0x16')],_0x531c1f);_0x3d2c77(_0x309c88['error'](0x1f4,_0x244ef7[_0x19f9('0x16')]));});});};exports[_0x19f9('0x17')]=function(_0x23c4aa){var _0x79c67e=this;return new Promise(function(_0x324140,_0x39088c){return db[_0x19f9('0x7')]['find']({'raw':_0x23c4aa[_0x19f9('0x9')]?_0x23c4aa[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'where':_0x23c4aa[_0x19f9('0x9')]?_0x23c4aa[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'attributes':_0x23c4aa[_0x19f9('0x9')]?_0x23c4aa[_0x19f9('0x9')][_0x19f9('0xc')]||null:null,'include':_0x23c4aa[_0x19f9('0x9')]?_0x23c4aa[_0x19f9('0x9')][_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x23c4aa['options'][_0x19f9('0xd')],function(_0x3d2041){return{'model':db[_0x3d2041[_0x19f9('0xf')]],'as':_0x3d2041['as'],'attributes':_0x3d2041[_0x19f9('0xc')],'include':_0x3d2041['include']?_[_0x19f9('0xe')](_0x3d2041['include'],function(_0x531b6e){return{'model':db[_0x531b6e[_0x19f9('0xf')]],'as':_0x531b6e['as'],'attributes':_0x531b6e[_0x19f9('0xc')],'include':_0x531b6e['include']?_[_0x19f9('0xe')](_0x531b6e[_0x19f9('0xd')],function(_0x1d698c){return{'model':db[_0x1d698c[_0x19f9('0xf')]],'as':_0x1d698c['as'],'attributes':_0x1d698c[_0x19f9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x19f9('0x10')](function(_0x17590e){logger[_0x19f9('0x11')]('ShowCmHopper',_0x23c4aa);logger['debug'](_0x19f9('0x17'),_0x23c4aa,JSON[_0x19f9('0x13')](_0x17590e));_0x324140(_0x17590e);})[_0x19f9('0x14')](function(_0x1a4dd5){logger[_0x19f9('0x15')](_0x19f9('0x17'),_0x1a4dd5[_0x19f9('0x16')],_0x23c4aa);_0x39088c(_0x79c67e[_0x19f9('0x15')](0x1f4,_0x1a4dd5[_0x19f9('0x16')]));});});};exports[_0x19f9('0x18')]=function(_0x1fc60c){var _0x4bd20f=this;return new Promise(function(_0x263bd6,_0x1aed24){return db[_0x19f9('0x7')]['create'](_0x1fc60c[_0x19f9('0x19')],{'raw':_0x1fc60c[_0x19f9('0x9')]?_0x1fc60c['options'][_0x19f9('0xa')]===undefined?!![]:![]:!![]})[_0x19f9('0x10')](function(_0x1339bd){logger[_0x19f9('0x11')]('CreateCmHopper',_0x1fc60c);logger[_0x19f9('0x12')]('CreateCmHopper',_0x1fc60c,JSON[_0x19f9('0x13')](_0x1339bd));_0x263bd6(_0x1339bd);})['catch'](function(_0xb1dcde){logger[_0x19f9('0x15')](_0x19f9('0x18'),_0xb1dcde[_0x19f9('0x16')],_0x1fc60c);_0x1aed24(_0x4bd20f[_0x19f9('0x15')](0x1f4,_0xb1dcde['message']));});});};exports['UpdateCmHopper']=function(_0x191b49){var _0x4df3d1=this;return new Promise(function(_0x20cfdd,_0x37bb1){return db[_0x19f9('0x7')][_0x19f9('0x1a')](_0x191b49[_0x19f9('0x19')],{'raw':_0x191b49[_0x19f9('0x9')]?_0x191b49[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x191b49[_0x19f9('0x9')]?_0x191b49[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'attributes':_0x191b49[_0x19f9('0x9')]?_0x191b49[_0x19f9('0x9')][_0x19f9('0xc')]||null:null,'limit':_0x191b49[_0x19f9('0x9')]?_0x191b49[_0x19f9('0x9')][_0x19f9('0x1b')]||null:null})['then'](function(_0x32b7ef){logger[_0x19f9('0x11')](_0x19f9('0x1c'),_0x191b49);logger[_0x19f9('0x11')](_0x19f9('0x1d'),JSON['stringify'](_0x191b49['options'][_0x19f9('0xb')]),_0x191b49[_0x19f9('0x19')][_0x19f9('0x1e')]);logger['debug'](_0x19f9('0x1c'),_0x191b49,JSON[_0x19f9('0x13')](_0x32b7ef));_0x20cfdd(_0x32b7ef);})['catch'](function(_0x1ab1f8){logger[_0x19f9('0x15')](_0x19f9('0x1c'),_0x1ab1f8[_0x19f9('0x16')],_0x191b49);_0x37bb1(_0x4df3d1[_0x19f9('0x15')](0x1f4,_0x1ab1f8['message']));});});};exports[_0x19f9('0x1f')]=function(_0x3af7d3){var _0x4af0f3=this;return new Promise(function(_0x1bb251,_0x4b91e4){return db[_0x19f9('0x7')][_0x19f9('0x20')]({'where':_0x3af7d3[_0x19f9('0x9')]?_0x3af7d3[_0x19f9('0x9')][_0x19f9('0xb')]||null:null})[_0x19f9('0x10')](function(_0x3a9914){logger[_0x19f9('0x11')](_0x19f9('0x1f'),_0x3af7d3);logger['debug']('DestroyCmHopper',_0x3af7d3,JSON[_0x19f9('0x13')](_0x3a9914));_0x1bb251(_0x3a9914);})['catch'](function(_0x36a45f){logger[_0x19f9('0x15')](_0x19f9('0x1f'),_0x36a45f[_0x19f9('0x16')],_0x3af7d3);_0x4b91e4(_0x4af0f3['error'](0x1f4,_0x36a45f['message']));});});};exports[_0x19f9('0x21')]=function(_0x65a629){var _0x3f67aa=this;return new Promise(function(_0x507166,_0x575e11){return db['CmContact'][_0x19f9('0x22')]()[_0x19f9('0x10')](function(_0x3a3865){return db[_0x19f9('0x23')]['transaction'](function(_0xedf55b){return db[_0x19f9('0x7')][_0x19f9('0x8')]({'where':_0x65a629[_0x19f9('0x9')]?_0x65a629[_0x19f9('0x9')]['where']||null:null,'attributes':_0x65a629[_0x19f9('0x9')]?_0x65a629[_0x19f9('0x9')]['attributes']||null:null,'limit':_0x65a629['options']?_0x65a629['options'][_0x19f9('0x1b')]||null:null,'order':_0x65a629['options']?_0x65a629[_0x19f9('0x9')][_0x19f9('0x24')]||null:null,'transaction':_0xedf55b,'lock':_0xedf55b[_0x19f9('0x25')][_0x19f9('0x26')],'include':[{'model':db[_0x19f9('0x27')],'as':'Contact','attributes':_[_0x19f9('0x28')](_0x3a3865)},{'model':db[_0x19f9('0x29')],'as':_0x19f9('0x2a'),'attributes':['id',_0x19f9('0x2b'),_0x19f9('0x2c')]}]})['then'](function(_0x44f246){var _0x27be8e=[];var _0x2163da=[];for(var _0x34e8a3=0x0;_0x34e8a3<_0x44f246['length'];_0x34e8a3+=0x1){var _0x1e7125=_0x44f246[_0x34e8a3]['UserId'];if(_0x1e7125===null){_0x27be8e['push'](_0x44f246[_0x34e8a3][_0x19f9('0x1a')](_0x65a629['body'],{'transaction':_0xedf55b}));}else if(!_0x2163da['includes'](_0x1e7125)){_0x2163da[_0x19f9('0x2d')](_0x1e7125);_0x27be8e['push'](_0x44f246[_0x34e8a3][_0x19f9('0x1a')](_0x65a629[_0x19f9('0x19')],{'transaction':_0xedf55b}));}}return BPromise['all'](_0x27be8e);});})[_0x19f9('0x10')](function(_0x2c2e01){logger['info'](_0x19f9('0x21'),_0x65a629);if(_0x2c2e01[_0x19f9('0x2e')]>0x0){logger['info'](_0x19f9('0x2f'),_0x2c2e01[0x0][_0x19f9('0x30')]['id'],_0x2c2e01[0x0]['dataValues'][_0x19f9('0x31')],_0x2c2e01[0x0][_0x19f9('0x30')][_0x19f9('0x1e')]);}logger[_0x19f9('0x12')](_0x19f9('0x21'),_0x65a629,JSON['stringify'](_0x2c2e01));_0x507166(_0x2c2e01);})[_0x19f9('0x14')](function(_0x145825){logger[_0x19f9('0x15')](_0x19f9('0x21'),_0x145825[_0x19f9('0x16')],_0x65a629);_0x575e11(_0x3f67aa[_0x19f9('0x15')](0x1f4,_0x145825[_0x19f9('0x16')]));});});});};exports[_0x19f9('0x32')]=function(_0x3a811e){var _0x4e4700=this;return new Promise(function(_0xada8bb,_0x5305e4){return db[_0x19f9('0x23')]['transaction'](function(_0x48b5f2){return db[_0x19f9('0x33')][_0x19f9('0x34')](_0x3a811e[_0x19f9('0x19')],{'raw':_0x3a811e[_0x19f9('0x9')]?_0x3a811e[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'transaction':_0x48b5f2})[_0x19f9('0x10')](function(){logger['info'](_0x19f9('0x35'),JSON['stringify'](_0x3a811e[_0x19f9('0x9')][_0x19f9('0xb')]),_0x3a811e['options'][_0x19f9('0xb')][_0x19f9('0x1e')]);return db['CmHopper']['destroy']({'where':_0x3a811e[_0x19f9('0x9')]?_0x3a811e[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'transaction':_0x48b5f2});});})[_0x19f9('0x10')](function(_0x2a7188){logger[_0x19f9('0x11')](_0x19f9('0x32'),_0x3a811e);logger['debug'](_0x19f9('0x32'),_0x3a811e,JSON[_0x19f9('0x13')](_0x2a7188));_0xada8bb(_0x2a7188);})['catch'](function(_0x5cf7d0){logger[_0x19f9('0x15')]('MoveContactManagedDialer',_0x5cf7d0['message'],_0x3a811e);_0x5305e4(_0x4e4700[_0x19f9('0x15')](0x1f4,_0x5cf7d0['message']));});});};exports[_0x19f9('0x36')]=function(_0x15156a){var _0x57372c=this;return new Promise(function(_0xd61758,_0x133845){return db[_0x19f9('0x7')][_0x19f9('0x8')]({'raw':_0x15156a[_0x19f9('0x9')]?_0x15156a[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'where':_0x15156a['options']?_0x15156a[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'attributes':[[db[_0x19f9('0x23')]['fn'](_0x19f9('0x37'),db[_0x19f9('0x23')]['fn']('IF',db['sequelize'][_0x19f9('0x38')](_0x19f9('0x39')+util[_0x19f9('0x3a')]('\x22%s\x22',moment()[_0x19f9('0x3a')](_0x19f9('0x3b')))+_0x19f9('0x3c')))),_0x19f9('0x3d')]]})[_0x19f9('0x10')](function(_0x471e59){logger['info']('CountReScheduled',_0x15156a);logger[_0x19f9('0x12')](_0x19f9('0x36'),_0x15156a,JSON['stringify'](_0x471e59));_0xd61758(_0x471e59);})['catch'](function(_0x5be5af){logger[_0x19f9('0x15')](_0x19f9('0x36'),_0x5be5af['message'],_0x15156a);_0x133845(_0x57372c[_0x19f9('0x15')](0x1f4,_0x5be5af[_0x19f9('0x16')]));});});};exports[_0x19f9('0x3e')]=function(_0x3b2c42){var _0x33c382=this;return new Promise(function(_0x5cbc8e,_0x58c32a){return db['CmContact']['describe']()['then'](function(){return db[_0x19f9('0x23')][_0x19f9('0x3f')](function(_0x2e22f1){return db[_0x19f9('0x7')]['findAll']({'where':_0x3b2c42[_0x19f9('0x9')]?_0x3b2c42[_0x19f9('0x9')]['where']||null:null,'attributes':_0x3b2c42[_0x19f9('0x9')]?_0x3b2c42[_0x19f9('0x9')][_0x19f9('0xc')]||null:null,'limit':0x1,'order':_0x3b2c42[_0x19f9('0x9')]?_0x3b2c42[_0x19f9('0x9')][_0x19f9('0x24')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x2e22f1,'lock':_0x2e22f1[_0x19f9('0x25')]['UPDATE'],'include':_0x3b2c42[_0x19f9('0x9')]?_0x3b2c42[_0x19f9('0x9')]['include']?_['map'](_0x3b2c42['options'][_0x19f9('0xd')],function(_0x208a41){return{'model':db[_0x208a41[_0x19f9('0xf')]],'as':_0x208a41['as'],'attributes':_0x208a41['attributes'],'include':_0x208a41[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x208a41['include'],function(_0x3eb011){return{'model':db[_0x3eb011[_0x19f9('0xf')]],'as':_0x3eb011['as'],'attributes':_0x3eb011[_0x19f9('0xc')],'include':_0x3eb011[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x3eb011[_0x19f9('0xd')],function(_0xb3ffaa){return{'model':db[_0xb3ffaa[_0x19f9('0xf')]],'as':_0xb3ffaa['as'],'attributes':_0xb3ffaa[_0x19f9('0xc')]};}):[]};}):[]};}):[]:[]})[_0x19f9('0x10')](function(_0x58cbe6){var _0x29ef73=[];for(var _0x47b613=0x0;_0x47b613<_0x58cbe6[_0x19f9('0x2e')];_0x47b613+=0x1){_0x29ef73[_0x19f9('0x2d')](_0x58cbe6[_0x47b613][_0x19f9('0x1a')](_0x3b2c42['body'],{'transaction':_0x2e22f1}));}return BPromise[_0x19f9('0x40')](_0x29ef73);});})[_0x19f9('0x10')](function(_0x492420){logger['info'](_0x19f9('0x3e'),_0x3b2c42);logger[_0x19f9('0x12')]('GetContactRecallMe',_0x3b2c42,JSON[_0x19f9('0x13')](_0x492420));_0x5cbc8e(_0x492420);})['catch'](function(_0x13e3cb){logger[_0x19f9('0x15')]('GetContactRecallMe',_0x13e3cb[_0x19f9('0x16')],_0x3b2c42);_0x58c32a(_0x33c382[_0x19f9('0x15')](0x1f4,_0x13e3cb[_0x19f9('0x16')]));});});});};exports[_0x19f9('0x41')]=function(_0x303175){var _0x17da98=this;return new Promise(function(_0x5a238a,_0x55885a){db[_0x19f9('0x27')][_0x19f9('0x22')]()[_0x19f9('0x10')](function(_0x5a6396){return db[_0x19f9('0x7')][_0x19f9('0x8')]({'raw':_0x303175['options']?_0x303175[_0x19f9('0x9')][_0x19f9('0xa')]===undefined?!![]:![]:!![],'where':_0x303175['options']?_0x303175[_0x19f9('0x9')][_0x19f9('0xb')]||null:null,'attributes':_0x303175[_0x19f9('0x9')]?_0x303175['options'][_0x19f9('0xc')]||null:null,'limit':_0x303175[_0x19f9('0x9')]?_0x303175[_0x19f9('0x9')][_0x19f9('0x1b')]||null:null,'include':_0x303175['options']?_0x303175[_0x19f9('0x9')]['include']?_[_0x19f9('0xe')](_0x303175[_0x19f9('0x9')][_0x19f9('0xd')],function(_0x30dda){return{'model':db[_0x30dda[_0x19f9('0xf')]],'as':_0x30dda['as'],'attributes':_0x30dda['as']===_0x19f9('0x42')?_['keys'](_0x5a6396):_0x30dda['attributes'],'include':_0x30dda[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x30dda[_0x19f9('0xd')],function(_0x2ed1b9){return{'model':db[_0x2ed1b9['model']],'as':_0x2ed1b9['as'],'attributes':_0x2ed1b9[_0x19f9('0xc')],'include':_0x2ed1b9[_0x19f9('0xd')]?_[_0x19f9('0xe')](_0x2ed1b9[_0x19f9('0xd')],function(_0x4cd48e){return{'model':db[_0x4cd48e[_0x19f9('0xf')]],'as':_0x4cd48e['as'],'attributes':_0x4cd48e[_0x19f9('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d6877){logger[_0x19f9('0x11')]('GetCmHopper',_0x303175);logger['debug'](_0x19f9('0x6'),_0x303175,JSON[_0x19f9('0x13')](_0x4d6877));_0x5a238a(_0x4d6877);})[_0x19f9('0x14')](function(_0x498101){logger['error']('GetCmHopper',_0x498101[_0x19f9('0x16')],_0x303175);_0x55885a(_0x17da98[_0x19f9('0x15')](0x1f4,_0x498101[_0x19f9('0x16')]));});});});};exports[_0x19f9('0x43')]=function(_0x103cf4){var _0x18afde=this;return new Promise(function(_0x2268b3,_0x5ac81b){return db[_0x19f9('0x27')][_0x19f9('0x44')]({'raw':!![],'where':{'phone':_0x103cf4[_0x19f9('0x9')][_0x19f9('0xb')][_0x19f9('0x45')]},'attributes':['id',_0x19f9('0x46')],'order':[['id',_0x19f9('0x47')]]})[_0x19f9('0x10')](function(_0x5e9b14){logger[_0x19f9('0x11')](_0x19f9('0x48'),_0x103cf4);logger[_0x19f9('0x12')]('getContactByPhone',_0x103cf4,JSON[_0x19f9('0x13')](_0x5e9b14));_0x2268b3(_0x5e9b14);})[_0x19f9('0x14')](function(_0x957831){logger[_0x19f9('0x15')](_0x19f9('0x48'),_0x957831[_0x19f9('0x16')],_0x103cf4);_0x5ac81b(_0x18afde[_0x19f9('0x15')](0x1f4,_0x957831[_0x19f9('0x16')]));});});};exports['ResetActiveCalls']=function(_0x302dcd){var _0x20c06f=this;return new Promise(function(_0x2abdab,_0x51502a){return db[_0x19f9('0x23')][_0x19f9('0x3f')](function(_0x4289ec){var _0x369267=_0x302dcd[_0x19f9('0x9')]&&_0x302dcd[_0x19f9('0x9')][_0x19f9('0xb')]?_0x302dcd[_0x19f9('0x9')]['where']:{};return db[_0x19f9('0x7')][_0x19f9('0x1a')](_0x302dcd[_0x19f9('0x19')],{'where':_0x369267,'transaction':_0x4289ec})[_0x19f9('0x10')](function(_0x5293a2){logger[_0x19f9('0x11')](_0x19f9('0x49'),_0x302dcd);logger[_0x19f9('0x12')](_0x19f9('0x49'),_0x302dcd,JSON[_0x19f9('0x13')](_0x5293a2));_0x2abdab(_0x5293a2);})[_0x19f9('0x14')](function(_0x4cf9e3){logger['error']('ResetActiveCalls',_0x4cf9e3[_0x19f9('0x16')],_0x302dcd);_0x51502a(_0x20c06f[_0x19f9('0x15')](0x1f4,_0x4cf9e3[_0x19f9('0x16')]));});});});};exports[_0x19f9('0x4a')]=function(_0x3e76e5){var _0x1a77e6=this;var _0x1af5f0=_0x3e76e5['body']['where'][_0x19f9('0x4b')];var _0x48aa91=_0x3e76e5[_0x19f9('0x19')][_0x19f9('0xb')][_0x19f9('0x4c')];var _0x2a27c4=_0x3e76e5[_0x19f9('0x19')][_0x19f9('0xb')][_0x19f9('0x4d')];return new Promise(function(_0x40fa10,_0x4ab3db){return db[_0x19f9('0x7')][_0x19f9('0x8')]({'where':{'voiceQueueId':{'$in':_0x1af5f0},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x19f9('0x23')][_0x19f9('0x38')](_0x19f9('0x4e')+_0x48aa91+_0x19f9('0x4f')),'$gt':db['sequelize'][_0x19f9('0x38')](_0x19f9('0x50'))}},'UserId':{'$in':_0x2a27c4}},'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db['User'],'as':_0x19f9('0x2a'),'attributes':['id',_0x19f9('0x2b'),_0x19f9('0x2c')]},{'model':db['CmList'],'as':_0x19f9('0x51')}]})[_0x19f9('0x10')](function(_0x577019){if(_0x577019[_0x19f9('0x2e')]>0x0){return db[_0x19f9('0x23')][_0x19f9('0x3f')](function(_0x108263){return db['CmHopper'][_0x19f9('0x1a')]({'recallmeNotifiedDate':db[_0x19f9('0x23')]['literal'](_0x19f9('0x50'))},{'where':{'id':{'$in':_[_0x19f9('0xe')](_0x577019,'id')}},'transaction':_0x108263})[_0x19f9('0x10')](function(){_0x40fa10(_0x577019);})[_0x19f9('0x14')](function(_0x49787d){logger[_0x19f9('0x15')](_0x19f9('0x4a'),_0x49787d[_0x19f9('0x16')],_0x3e76e5);_0x4ab3db(_0x1a77e6['error'](0x1f4,_0x49787d[_0x19f9('0x16')]));});})[_0x19f9('0x14')](function(_0x4d1904){logger[_0x19f9('0x15')](_0x19f9('0x4a'),_0x4d1904[_0x19f9('0x16')],_0x3e76e5);_0x4ab3db(_0x1a77e6[_0x19f9('0x15')](0x1f4,_0x4d1904[_0x19f9('0x16')]));});}else{_0x40fa10(_0x577019);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 45de847..6ac4052 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 _0xa4fc=['../../components/auth/service','isAuthenticated','index','get','/describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getTimezone','update','delete','exports','express','Router'];(function(_0x1a7cb4,_0x4a77db){var _0x19ee49=function(_0x59f99c){while(--_0x59f99c){_0x1a7cb4['push'](_0x1a7cb4['shift']());}};_0x19ee49(++_0x4a77db);}(_0xa4fc,0x1e2));var _0xca4f=function(_0x4d9173,_0x2bb95a){_0x4d9173=_0x4d9173-0x0;var _0x268022=_0xa4fc[_0x4d9173];return _0x268022;};'use strict';var express=require(_0xca4f('0x0'));var router=express[_0xca4f('0x1')]();var auth=require(_0xca4f('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0xca4f('0x3')](),controller[_0xca4f('0x4')]);router[_0xca4f('0x5')](_0xca4f('0x6'),auth[_0xca4f('0x3')](),controller['describe']);router['get'](_0xca4f('0x7'),auth[_0xca4f('0x3')](),controller[_0xca4f('0x8')]);router[_0xca4f('0x5')](_0xca4f('0x9'),auth[_0xca4f('0x3')](),controller[_0xca4f('0xa')]);router[_0xca4f('0x5')](_0xca4f('0xb'),auth[_0xca4f('0x3')](),controller[_0xca4f('0xc')]);router['get'](_0xca4f('0xd'),auth['isAuthenticated'](),controller[_0xca4f('0xe')]);router[_0xca4f('0xf')]('/',auth[_0xca4f('0x3')](),controller[_0xca4f('0x10')]);router[_0xca4f('0xf')](_0xca4f('0x11'),auth['isAuthenticated'](),controller['getPreview']);router[_0xca4f('0xf')]('/timezone',auth[_0xca4f('0x3')](),controller[_0xca4f('0x12')]);router['put'](_0xca4f('0xb'),auth['isAuthenticated'](),controller[_0xca4f('0x13')]);router[_0xca4f('0x14')](_0xca4f('0xb'),auth[_0xca4f('0x3')](),controller['destroy']);module[_0xca4f('0x15')]=router; \ No newline at end of file +var _0x37ff=['isAuthenticated','index','describe','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','getTimezone','update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get'];(function(_0x50c09e,_0x1c4dbb){var _0x355565=function(_0x405cf6){while(--_0x405cf6){_0x50c09e['push'](_0x50c09e['shift']());}};_0x355565(++_0x1c4dbb);}(_0x37ff,0x104));var _0xf37f=function(_0x3d8240,_0x2663d4){_0x3d8240=_0x3d8240-0x0;var _0x3d0372=_0x37ff[_0x3d8240];return _0x3d0372;};'use strict';var express=require('express');var router=express[_0xf37f('0x0')]();var auth=require(_0xf37f('0x1'));var controller=require(_0xf37f('0x2'));router[_0xf37f('0x3')]('/',auth[_0xf37f('0x4')](),controller[_0xf37f('0x5')]);router[_0xf37f('0x3')]('/describe',auth[_0xf37f('0x4')](),controller[_0xf37f('0x6')]);router[_0xf37f('0x3')](_0xf37f('0x7'),auth[_0xf37f('0x4')](),controller['getOpenContacts']);router[_0xf37f('0x3')](_0xf37f('0x8'),auth[_0xf37f('0x4')](),controller[_0xf37f('0x9')]);router[_0xf37f('0x3')](_0xf37f('0xa'),auth[_0xf37f('0x4')](),controller[_0xf37f('0xb')]);router[_0xf37f('0x3')](_0xf37f('0xc'),auth[_0xf37f('0x4')](),controller[_0xf37f('0xd')]);router[_0xf37f('0xe')]('/',auth[_0xf37f('0x4')](),controller['create']);router[_0xf37f('0xe')](_0xf37f('0xf'),auth[_0xf37f('0x4')](),controller[_0xf37f('0x10')]);router['post']('/timezone',auth[_0xf37f('0x4')](),controller[_0xf37f('0x11')]);router['put']('/:id',auth[_0xf37f('0x4')](),controller[_0xf37f('0x12')]);router[_0xf37f('0x13')](_0xf37f('0xa'),auth[_0xf37f('0x4')](),controller[_0xf37f('0x14')]);module[_0xf37f('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 94f874a..760ff2d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c07=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','DATE'];(function(_0x2ddf70,_0x8049d3){var _0xe3a8e=function(_0xc7b60e){while(--_0xc7b60e){_0x2ddf70['push'](_0x2ddf70['shift']());}};_0xe3a8e(++_0x8049d3);}(_0x9c07,0xb0));var _0x79c0=function(_0x5c798b,_0x542a44){_0x5c798b=_0x5c798b-0x0;var _0x4f1a64=_0x9c07[_0x5c798b];return _0x4f1a64;};'use strict';var moment=require(_0x79c0('0x0'));var Sequelize=require(_0x79c0('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x79c0('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x79c0('0x3')],'defaultValue':moment()[_0x79c0('0x4')](_0x79c0('0x5'))},'countbusyretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x79c0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x79f1=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x402281,_0x359520){var _0xf36b29=function(_0x2ed9cb){while(--_0x2ed9cb){_0x402281['push'](_0x402281['shift']());}};_0xf36b29(++_0x359520);}(_0x79f1,0x156));var _0x179f=function(_0x3a07d4,_0xa80b88){_0x3a07d4=_0x3a07d4-0x0;var _0x2c352=_0x79f1[_0x3a07d4];return _0x2c352;};'use strict';var moment=require(_0x179f('0x0'));var Sequelize=require(_0x179f('0x1'));module[_0x179f('0x2')]={'CmHopperId':{'type':Sequelize[_0x179f('0x3')]},'phone':{'type':Sequelize[_0x179f('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x179f('0x5')],'defaultValue':moment()[_0x179f('0x6')](_0x179f('0x7'))},'countbusyretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x179f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 69c9f21..713ba52 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3443=['UserProfileResource','error','name','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','CmHopperAdditionalPhone','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones'];(function(_0x4670fd,_0x47d0cf){var _0x50a4e2=function(_0x492041){while(--_0x492041){_0x4670fd['push'](_0x4670fd['shift']());}};_0x50a4e2(++_0x47d0cf);}(_0x3443,0x78));var _0x3344=function(_0x1626ac,_0x517818){_0x1626ac=_0x1626ac-0x0;var _0x3753ef=_0x3443[_0x1626ac];return _0x3753ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3344('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3344('0x1'));var moment=require(_0x3344('0x2'));var BPromise=require(_0x3344('0x3'));var Mustache=require('mustache');var util=require(_0x3344('0x4'));var path=require('path');var sox=require(_0x3344('0x5'));var csv=require(_0x3344('0x6'));var ejs=require(_0x3344('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3344('0x8'));var squel=require(_0x3344('0x9'));var crypto=require('crypto');var jsforce=require(_0x3344('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3344('0xb'));var Papa=require(_0x3344('0xc'));var Redis=require(_0x3344('0xd'));var authService=require(_0x3344('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3344('0xf'));var hardwareService=require(_0x3344('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x3344('0x11'));var config=require(_0x3344('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4359c7,_0x2965da){_0x2965da=_0x2965da||0xcc;return function(_0x2083ee){if(_0x2083ee){return _0x4359c7[_0x3344('0x13')](_0x2965da);}return _0x4359c7['status'](_0x2965da)[_0x3344('0x14')]();};}function respondWithResult(_0x3059bf,_0x5423a5){_0x5423a5=_0x5423a5||0xc8;return function(_0x2aa0b6){if(_0x2aa0b6){return _0x3059bf[_0x3344('0x15')](_0x5423a5)[_0x3344('0x16')](_0x2aa0b6);}};}function respondWithFilteredResult(_0x3f3f39,_0x5f5666){return function(_0x2b73ef){if(_0x2b73ef){var _0x10d74e=typeof _0x5f5666[_0x3344('0x17')]===_0x3344('0x18')&&typeof _0x5f5666[_0x3344('0x19')]===_0x3344('0x18');var _0x4f79c0=_0x2b73ef[_0x3344('0x1a')];var _0x59172d=_0x10d74e?0x0:_0x5f5666['offset'];var _0x4aa915=_0x10d74e?_0x2b73ef[_0x3344('0x1a')]:_0x5f5666[_0x3344('0x17')]+_0x5f5666['limit'];var _0x2ac521;if(_0x4aa915>=_0x4f79c0){_0x4aa915=_0x4f79c0;_0x2ac521=0xc8;}else{_0x2ac521=0xce;}_0x3f3f39[_0x3344('0x15')](_0x2ac521);return _0x3f3f39[_0x3344('0x1b')]('Content-Range',_0x59172d+'-'+_0x4aa915+'/'+_0x4f79c0)[_0x3344('0x16')](_0x2b73ef);}return null;};}function patchUpdates(_0x3045a2){return function(_0x5aec47){try{jsonpatch[_0x3344('0x1c')](_0x5aec47,_0x3045a2,!![]);}catch(_0x2d30d7){return BPromise[_0x3344('0x1d')](_0x2d30d7);}return _0x5aec47[_0x3344('0x1e')]();};}function saveUpdates(_0x4a8af4,_0x3741fb){return function(_0x178af7){if(_0x178af7){return _0x178af7[_0x3344('0x1f')](_0x4a8af4)[_0x3344('0x20')](function(_0x228675){return _0x228675;});}return null;};}function removeEntity(_0x5231ad,_0x4c18eb){return function(_0x50d819){if(_0x50d819){return _0x50d819[_0x3344('0x21')]()['then'](function(){var _0x397b20=_0x50d819[_0x3344('0x22')]({'plain':!![]});var _0xe80b81=_0x3344('0x23');return db[_0x3344('0x24')]['destroy']({'where':{'type':_0xe80b81,'resourceId':_0x397b20['id']}})[_0x3344('0x20')](function(){return _0x50d819;});})[_0x3344('0x20')](function(){_0x5231ad[_0x3344('0x15')](0xcc)[_0x3344('0x14')]();});}};}function handleEntityNotFound(_0x2676cf,_0x4a689a){return function(_0x19e2c1){if(!_0x19e2c1){_0x2676cf[_0x3344('0x13')](0x194);}return _0x19e2c1;};}function handleError(_0x38e4e3,_0x233d06){_0x233d06=_0x233d06||0x1f4;return function(_0x490971){logger[_0x3344('0x25')](_0x490971['stack']);if(_0x490971[_0x3344('0x26')]){delete _0x490971[_0x3344('0x26')];}_0x38e4e3['status'](_0x233d06)['send'](_0x490971);};}exports[_0x3344('0x27')]=function(_0x2d9555,_0x220b46){var _0x3bfb1d={},_0x2949aa={},_0x16d4a3={'count':0x0,'rows':[]};var _0x109b3d=_['map'](db['CmHopperAdditionalPhone'][_0x3344('0x28')],function(_0x157e5c){return{'name':_0x157e5c['fieldName'],'type':_0x157e5c['type'][_0x3344('0x29')]};});_0x2949aa[_0x3344('0x2a')]=_[_0x3344('0x2b')](_0x109b3d,_0x3344('0x26'));_0x2949aa[_0x3344('0x2c')]=_['keys'](_0x2d9555['query']);_0x2949aa[_0x3344('0x2d')]=_[_0x3344('0x2e')](_0x2949aa[_0x3344('0x2a')],_0x2949aa[_0x3344('0x2c')]);_0x3bfb1d[_0x3344('0x2f')]=_['intersection'](_0x2949aa[_0x3344('0x2a')],qs[_0x3344('0x30')](_0x2d9555[_0x3344('0x2c')]['fields']));_0x3bfb1d[_0x3344('0x2f')]=_0x3bfb1d[_0x3344('0x2f')][_0x3344('0x31')]?_0x3bfb1d[_0x3344('0x2f')]:_0x2949aa['model'];if(!_0x2d9555[_0x3344('0x2c')][_0x3344('0x32')](_0x3344('0x33'))){_0x3bfb1d['limit']=qs[_0x3344('0x19')](_0x2d9555[_0x3344('0x2c')]['limit']);_0x3bfb1d[_0x3344('0x17')]=qs[_0x3344('0x17')](_0x2d9555['query'][_0x3344('0x17')]);}_0x3bfb1d[_0x3344('0x34')]=qs[_0x3344('0x35')](_0x2d9555['query'][_0x3344('0x35')]);_0x3bfb1d[_0x3344('0x36')]=qs[_0x3344('0x2d')](_[_0x3344('0x37')](_0x2d9555[_0x3344('0x2c')],_0x2949aa[_0x3344('0x2d')]),_0x109b3d);if(_0x2d9555[_0x3344('0x2c')]['filter']){_0x3bfb1d[_0x3344('0x36')]=_[_0x3344('0x38')](_0x3bfb1d[_0x3344('0x36')],{'$or':_['map'](_0x109b3d,function(_0x8ceff5){if(_0x8ceff5[_0x3344('0x39')]!==_0x3344('0x3a')){var _0x3371f6={};_0x3371f6[_0x8ceff5[_0x3344('0x26')]]={'$like':'%'+_0x2d9555['query'][_0x3344('0x3b')]+'%'};return _0x3371f6;}})});}_0x3bfb1d=_['merge']({},_0x3bfb1d,_0x2d9555[_0x3344('0x3c')]);var _0x5e2062={'where':_0x3bfb1d[_0x3344('0x36')]};return db[_0x3344('0x3d')][_0x3344('0x1a')](_0x5e2062)[_0x3344('0x20')](function(_0x1b199c){_0x16d4a3[_0x3344('0x1a')]=_0x1b199c;if(_0x2d9555[_0x3344('0x2c')][_0x3344('0x3e')]){_0x3bfb1d['include']=[{'all':!![]}];}return db[_0x3344('0x3d')][_0x3344('0x3f')](_0x3bfb1d);})['then'](function(_0x338843){_0x16d4a3[_0x3344('0x40')]=_0x338843;return _0x16d4a3;})[_0x3344('0x20')](respondWithFilteredResult(_0x220b46,_0x3bfb1d))[_0x3344('0x41')](handleError(_0x220b46,null));};exports[_0x3344('0x42')]=function(_0x438080,_0x18fecc){var _0x63969b={'raw':!![],'where':{'id':_0x438080[_0x3344('0x43')]['id']}},_0x3557ef={};_0x3557ef['model']=_['keys'](db[_0x3344('0x3d')][_0x3344('0x28')]);_0x3557ef[_0x3344('0x2c')]=_[_0x3344('0x44')](_0x438080['query']);_0x3557ef[_0x3344('0x2d')]=_['intersection'](_0x3557ef[_0x3344('0x2a')],_0x3557ef['query']);_0x63969b[_0x3344('0x2f')]=_[_0x3344('0x2e')](_0x3557ef[_0x3344('0x2a')],qs[_0x3344('0x30')](_0x438080[_0x3344('0x2c')][_0x3344('0x30')]));_0x63969b[_0x3344('0x2f')]=_0x63969b[_0x3344('0x2f')]['length']?_0x63969b[_0x3344('0x2f')]:_0x3557ef['model'];if(_0x438080[_0x3344('0x2c')][_0x3344('0x3e')]){_0x63969b[_0x3344('0x45')]=[{'all':!![]}];}_0x63969b=_[_0x3344('0x38')]({},_0x63969b,_0x438080[_0x3344('0x3c')]);return db[_0x3344('0x3d')]['find'](_0x63969b)[_0x3344('0x20')](handleEntityNotFound(_0x18fecc,null))['then'](respondWithResult(_0x18fecc,null))[_0x3344('0x41')](handleError(_0x18fecc,null));};exports[_0x3344('0x46')]=function(_0x492433,_0xfe7f52){return db['CmHopperAdditionalPhone'][_0x3344('0x46')](_0x492433[_0x3344('0x47')],{})['then'](function(_0x4741a1){var _0x743d81=_0x492433[_0x3344('0x48')]['get']({'plain':!![]});if(!_0x743d81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x743d81[_0x3344('0x49')]===_0x3344('0x48')){var _0x1baf68=_0x4741a1[_0x3344('0x22')]({'plain':!![]});var _0x35317a=_0x3344('0x23');return db[_0x3344('0x4a')]['find']({'where':{'name':_0x35317a,'userProfileId':_0x743d81[_0x3344('0x4b')]},'raw':!![]})[_0x3344('0x20')](function(_0x384131){if(_0x384131&&_0x384131['autoAssociation']===0x0){return db[_0x3344('0x24')]['create']({'name':_0x1baf68[_0x3344('0x26')],'resourceId':_0x1baf68['id'],'type':_0x384131[_0x3344('0x26')],'sectionId':_0x384131['id']},{})[_0x3344('0x20')](function(){return _0x4741a1;});}else{return _0x4741a1;}})[_0x3344('0x41')](function(_0x2c5f02){logger['error'](_0x3344('0x4c'),_0x2c5f02);throw _0x2c5f02;});}return _0x4741a1;})['then'](respondWithResult(_0xfe7f52,0xc9))['catch'](handleError(_0xfe7f52,null));};exports[_0x3344('0x1f')]=function(_0x31a876,_0x42e87e){if(_0x31a876['body']['id']){delete _0x31a876[_0x3344('0x47')]['id'];}return db['CmHopperAdditionalPhone'][_0x3344('0x4d')]({'where':{'id':_0x31a876[_0x3344('0x43')]['id']}})[_0x3344('0x20')](handleEntityNotFound(_0x42e87e,null))['then'](saveUpdates(_0x31a876[_0x3344('0x47')],null))[_0x3344('0x20')](respondWithResult(_0x42e87e,null))['catch'](handleError(_0x42e87e,null));};exports[_0x3344('0x21')]=function(_0xf5cbd4,_0x359a42){return db[_0x3344('0x3d')]['find']({'where':{'id':_0xf5cbd4[_0x3344('0x43')]['id']}})[_0x3344('0x20')](handleEntityNotFound(_0x359a42,null))[_0x3344('0x20')](removeEntity(_0x359a42,null))['catch'](handleError(_0x359a42,null));}; \ No newline at end of file +var _0xb68b=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','UserProfileResource','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','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','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0xb68b,0x130));var _0xbb68=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xb68b[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0xbb68('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb68('0x1'));var jsonpatch=require(_0xbb68('0x2'));var rp=require(_0xbb68('0x3'));var moment=require(_0xbb68('0x4'));var BPromise=require(_0xbb68('0x5'));var Mustache=require(_0xbb68('0x6'));var util=require(_0xbb68('0x7'));var path=require(_0xbb68('0x8'));var sox=require(_0xbb68('0x9'));var csv=require(_0xbb68('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb68('0xb'));var _=require(_0xbb68('0xc'));var squel=require(_0xbb68('0xd'));var crypto=require(_0xbb68('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbb68('0xf'));var toCsv=require(_0xbb68('0xa'));var querystring=require(_0xbb68('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb68('0x11'));var qs=require(_0xbb68('0x12'));var as=require(_0xbb68('0x13'));var hardwareService=require(_0xbb68('0x14'));var logger=require('../../config/logger')(_0xbb68('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb68('0x16'));var db=require(_0xbb68('0x17'))['db'];function respondWithStatusCode(_0x4723b9,_0x17573c){_0x17573c=_0x17573c||0xcc;return function(_0x3c01fd){if(_0x3c01fd){return _0x4723b9[_0xbb68('0x18')](_0x17573c);}return _0x4723b9[_0xbb68('0x19')](_0x17573c)[_0xbb68('0x1a')]();};}function respondWithResult(_0x467294,_0x4b6e13){_0x4b6e13=_0x4b6e13||0xc8;return function(_0x338f29){if(_0x338f29){return _0x467294[_0xbb68('0x19')](_0x4b6e13)[_0xbb68('0x1b')](_0x338f29);}};}function respondWithFilteredResult(_0xfdcc3a,_0x3a0f95){return function(_0xad6418){if(_0xad6418){var _0x54d7d4=typeof _0x3a0f95[_0xbb68('0x1c')]===_0xbb68('0x1d')&&typeof _0x3a0f95[_0xbb68('0x1e')]===_0xbb68('0x1d');var _0x56c80d=_0xad6418['count'];var _0x444466=_0x54d7d4?0x0:_0x3a0f95[_0xbb68('0x1c')];var _0x320c11=_0x54d7d4?_0xad6418[_0xbb68('0x1f')]:_0x3a0f95[_0xbb68('0x1c')]+_0x3a0f95[_0xbb68('0x1e')];var _0x42df79;if(_0x320c11>=_0x56c80d){_0x320c11=_0x56c80d;_0x42df79=0xc8;}else{_0x42df79=0xce;}_0xfdcc3a[_0xbb68('0x19')](_0x42df79);return _0xfdcc3a[_0xbb68('0x20')]('Content-Range',_0x444466+'-'+_0x320c11+'/'+_0x56c80d)['json'](_0xad6418);}return null;};}function patchUpdates(_0x45b339){return function(_0x9e804f){try{jsonpatch['apply'](_0x9e804f,_0x45b339,!![]);}catch(_0x1ea6c3){return BPromise['reject'](_0x1ea6c3);}return _0x9e804f[_0xbb68('0x21')]();};}function saveUpdates(_0x466940,_0x29404e){return function(_0x101aa6){if(_0x101aa6){return _0x101aa6['update'](_0x466940)[_0xbb68('0x22')](function(_0x2219ac){return _0x2219ac;});}return null;};}function removeEntity(_0x26a738,_0x2c7a0f){return function(_0x4ae4a7){if(_0x4ae4a7){return _0x4ae4a7[_0xbb68('0x23')]()[_0xbb68('0x22')](function(){var _0x42d125=_0x4ae4a7['get']({'plain':!![]});var _0x4324d6='CmHopperAdditionalPhones';return db[_0xbb68('0x24')]['destroy']({'where':{'type':_0x4324d6,'resourceId':_0x42d125['id']}})['then'](function(){return _0x4ae4a7;});})[_0xbb68('0x22')](function(){_0x26a738[_0xbb68('0x19')](0xcc)[_0xbb68('0x1a')]();});}};}function handleEntityNotFound(_0x4c0878,_0xdbe8b7){return function(_0x2336fa){if(!_0x2336fa){_0x4c0878[_0xbb68('0x18')](0x194);}return _0x2336fa;};}function handleError(_0x2e5327,_0x50f96f){_0x50f96f=_0x50f96f||0x1f4;return function(_0x42f5de){logger[_0xbb68('0x25')](_0x42f5de[_0xbb68('0x26')]);if(_0x42f5de[_0xbb68('0x27')]){delete _0x42f5de[_0xbb68('0x27')];}_0x2e5327['status'](_0x50f96f)['send'](_0x42f5de);};}exports[_0xbb68('0x28')]=function(_0xfddc9b,_0x56412a){var _0x31ead4={},_0xc6dbd9={},_0x20734c={'count':0x0,'rows':[]};var _0x2851be=_[_0xbb68('0x29')](db[_0xbb68('0x2a')][_0xbb68('0x2b')],function(_0x199ac2){return{'name':_0x199ac2[_0xbb68('0x2c')],'type':_0x199ac2[_0xbb68('0x2d')][_0xbb68('0x2e')]};});_0xc6dbd9[_0xbb68('0x2f')]=_[_0xbb68('0x29')](_0x2851be,_0xbb68('0x27'));_0xc6dbd9['query']=_[_0xbb68('0x30')](_0xfddc9b[_0xbb68('0x31')]);_0xc6dbd9[_0xbb68('0x32')]=_[_0xbb68('0x33')](_0xc6dbd9[_0xbb68('0x2f')],_0xc6dbd9[_0xbb68('0x31')]);_0x31ead4[_0xbb68('0x34')]=_[_0xbb68('0x33')](_0xc6dbd9[_0xbb68('0x2f')],qs[_0xbb68('0x35')](_0xfddc9b['query'][_0xbb68('0x35')]));_0x31ead4[_0xbb68('0x34')]=_0x31ead4[_0xbb68('0x34')][_0xbb68('0x36')]?_0x31ead4['attributes']:_0xc6dbd9[_0xbb68('0x2f')];if(!_0xfddc9b[_0xbb68('0x31')][_0xbb68('0x37')](_0xbb68('0x38'))){_0x31ead4[_0xbb68('0x1e')]=qs[_0xbb68('0x1e')](_0xfddc9b['query'][_0xbb68('0x1e')]);_0x31ead4['offset']=qs[_0xbb68('0x1c')](_0xfddc9b[_0xbb68('0x31')]['offset']);}_0x31ead4['order']=qs['sort'](_0xfddc9b[_0xbb68('0x31')][_0xbb68('0x39')]);_0x31ead4['where']=qs['filters'](_[_0xbb68('0x3a')](_0xfddc9b[_0xbb68('0x31')],_0xc6dbd9[_0xbb68('0x32')]),_0x2851be);if(_0xfddc9b[_0xbb68('0x31')][_0xbb68('0x3b')]){_0x31ead4[_0xbb68('0x3c')]=_[_0xbb68('0x3d')](_0x31ead4[_0xbb68('0x3c')],{'$or':_['map'](_0x2851be,function(_0x31de7d){if(_0x31de7d[_0xbb68('0x2d')]!==_0xbb68('0x3e')){var _0x774e7e={};_0x774e7e[_0x31de7d[_0xbb68('0x27')]]={'$like':'%'+_0xfddc9b[_0xbb68('0x31')]['filter']+'%'};return _0x774e7e;}})});}_0x31ead4=_[_0xbb68('0x3d')]({},_0x31ead4,_0xfddc9b['options']);var _0x570b82={'where':_0x31ead4[_0xbb68('0x3c')]};return db[_0xbb68('0x2a')][_0xbb68('0x1f')](_0x570b82)[_0xbb68('0x22')](function(_0x21162e){_0x20734c[_0xbb68('0x1f')]=_0x21162e;if(_0xfddc9b[_0xbb68('0x31')][_0xbb68('0x3f')]){_0x31ead4[_0xbb68('0x40')]=[{'all':!![]}];}return db[_0xbb68('0x2a')][_0xbb68('0x41')](_0x31ead4);})[_0xbb68('0x22')](function(_0x5dce6e){_0x20734c[_0xbb68('0x42')]=_0x5dce6e;return _0x20734c;})[_0xbb68('0x22')](respondWithFilteredResult(_0x56412a,_0x31ead4))[_0xbb68('0x43')](handleError(_0x56412a,null));};exports['show']=function(_0x2d5c81,_0x4677fd){var _0x431b80={'raw':!![],'where':{'id':_0x2d5c81['params']['id']}},_0x346f05={};_0x346f05[_0xbb68('0x2f')]=_['keys'](db[_0xbb68('0x2a')][_0xbb68('0x2b')]);_0x346f05['query']=_['keys'](_0x2d5c81['query']);_0x346f05[_0xbb68('0x32')]=_[_0xbb68('0x33')](_0x346f05[_0xbb68('0x2f')],_0x346f05['query']);_0x431b80[_0xbb68('0x34')]=_[_0xbb68('0x33')](_0x346f05[_0xbb68('0x2f')],qs[_0xbb68('0x35')](_0x2d5c81['query']['fields']));_0x431b80['attributes']=_0x431b80[_0xbb68('0x34')]['length']?_0x431b80[_0xbb68('0x34')]:_0x346f05[_0xbb68('0x2f')];if(_0x2d5c81[_0xbb68('0x31')][_0xbb68('0x3f')]){_0x431b80[_0xbb68('0x40')]=[{'all':!![]}];}_0x431b80=_[_0xbb68('0x3d')]({},_0x431b80,_0x2d5c81[_0xbb68('0x44')]);return db['CmHopperAdditionalPhone'][_0xbb68('0x45')](_0x431b80)[_0xbb68('0x22')](handleEntityNotFound(_0x4677fd,null))[_0xbb68('0x22')](respondWithResult(_0x4677fd,null))[_0xbb68('0x43')](handleError(_0x4677fd,null));};exports[_0xbb68('0x46')]=function(_0x52060d,_0x427821){return db['CmHopperAdditionalPhone'][_0xbb68('0x46')](_0x52060d[_0xbb68('0x47')],{})[_0xbb68('0x22')](function(_0x371861){var _0x1967cc=_0x52060d['user']['get']({'plain':!![]});if(!_0x1967cc)throw new Error(_0xbb68('0x48'));if(_0x1967cc[_0xbb68('0x49')]===_0xbb68('0x4a')){var _0x134cbf=_0x371861['get']({'plain':!![]});var _0x30eb96='CmHopperAdditionalPhones';return db['UserProfileSection'][_0xbb68('0x45')]({'where':{'name':_0x30eb96,'userProfileId':_0x1967cc[_0xbb68('0x4b')]},'raw':!![]})[_0xbb68('0x22')](function(_0x499211){if(_0x499211&&_0x499211[_0xbb68('0x4c')]===0x0){return db[_0xbb68('0x24')][_0xbb68('0x46')]({'name':_0x134cbf[_0xbb68('0x27')],'resourceId':_0x134cbf['id'],'type':_0x499211[_0xbb68('0x27')],'sectionId':_0x499211['id']},{})[_0xbb68('0x22')](function(){return _0x371861;});}else{return _0x371861;}})[_0xbb68('0x43')](function(_0x5c7419){logger[_0xbb68('0x25')](_0xbb68('0x4d'),_0x5c7419);throw _0x5c7419;});}return _0x371861;})['then'](respondWithResult(_0x427821,0xc9))['catch'](handleError(_0x427821,null));};exports[_0xbb68('0x4e')]=function(_0x34b3e3,_0x442b76){if(_0x34b3e3['body']['id']){delete _0x34b3e3[_0xbb68('0x47')]['id'];}return db['CmHopperAdditionalPhone'][_0xbb68('0x45')]({'where':{'id':_0x34b3e3[_0xbb68('0x4f')]['id']}})[_0xbb68('0x22')](handleEntityNotFound(_0x442b76,null))[_0xbb68('0x22')](saveUpdates(_0x34b3e3[_0xbb68('0x47')],null))['then'](respondWithResult(_0x442b76,null))[_0xbb68('0x43')](handleError(_0x442b76,null));};exports['destroy']=function(_0x1cfb53,_0x3184fd){return db['CmHopperAdditionalPhone'][_0xbb68('0x45')]({'where':{'id':_0x1cfb53[_0xbb68('0x4f')]['id']}})[_0xbb68('0x22')](handleEntityNotFound(_0x3184fd,null))[_0xbb68('0x22')](removeEntity(_0x3184fd,null))[_0xbb68('0x43')](handleError(_0x3184fd,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index f1fff16..416acc6 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29a1=['./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3e2241,_0x470fae){var _0x922e5f=function(_0x10f687){while(--_0x10f687){_0x3e2241['push'](_0x3e2241['shift']());}};_0x922e5f(++_0x470fae);}(_0x29a1,0x118));var _0x129a=function(_0x9fcc35,_0xef663a){_0x9fcc35=_0x9fcc35-0x0;var _0x5b42ac=_0x29a1[_0x9fcc35];return _0x5b42ac;};'use strict';var _=require(_0x129a('0x0'));var util=require(_0x129a('0x1'));var logger=require(_0x129a('0x2'))('api');var moment=require(_0x129a('0x3'));var BPromise=require('bluebird');var rp=require(_0x129a('0x4'));var fs=require('fs');var path=require(_0x129a('0x5'));var rimraf=require(_0x129a('0x6'));var config=require(_0x129a('0x7'));var attributes=require(_0x129a('0x8'));module[_0x129a('0x9')]=function(_0x2731ed,_0x1dba91){return _0x2731ed['define'](_0x129a('0xa'),attributes,{'tableName':_0x129a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2cf=['request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x7ed187,_0x336b60){_0x7ed187=_0x7ed187-0x0;var _0x3a2f18=_0xb2cf[_0x7ed187];return _0x3a2f18;};'use strict';var _=require(_0xfb2c('0x0'));var util=require(_0xfb2c('0x1'));var logger=require(_0xfb2c('0x2'))(_0xfb2c('0x3'));var moment=require(_0xfb2c('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb2c('0x5'));var fs=require('fs');var path=require(_0xfb2c('0x6'));var rimraf=require('rimraf');var config=require(_0xfb2c('0x7'));var attributes=require(_0xfb2c('0x8'));module[_0xfb2c('0x9')]=function(_0x25fabe,_0xf7c813){return _0x25fabe[_0xfb2c('0xa')](_0xfb2c('0xb'),attributes,{'tableName':_0xfb2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 2430522..2239793 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x91b6=['isNil','scheduledat','add','minutes','createdAt','updatedAt','sequelize','phone','activateAdditionalPhone','update','field','IncrementPreviewCounters','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','result','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ASC','countbusyretry','countagentrejectretry','entity','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x91b6,0x1d4));var _0x691b=function(_0x5894ab,_0x18c6fd){_0x5894ab=_0x5894ab-0x0;var _0x1af2f8=_0x91b6[_0x5894ab];return _0x1af2f8;};'use strict';var _=require(_0x691b('0x0'));var util=require(_0x691b('0x1'));var moment=require('moment');var BPromise=require(_0x691b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x691b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x691b('0x4'))(_0x691b('0x5'));var config=require(_0x691b('0x6'));var jayson=require(_0x691b('0x7'));var client=jayson[_0x691b('0x8')][_0x691b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x385f2a,_0x2d6b8f,_0x42c2ae){return new BPromise(function(_0x16073e,_0x342bca){return client[_0x691b('0xa')](_0x385f2a,_0x42c2ae)[_0x691b('0xb')](function(_0x1e4873){logger[_0x691b('0xc')](_0x691b('0xd'),_0x2d6b8f,_0x691b('0xe'));logger[_0x691b('0xf')](_0x691b('0x10'),_0x2d6b8f,'request\x20sent',JSON['stringify'](_0x1e4873));if(_0x1e4873[_0x691b('0x11')]){if(_0x1e4873[_0x691b('0x11')]['code']===0x1f4){logger[_0x691b('0x11')](_0x691b('0xd'),_0x2d6b8f,_0x1e4873[_0x691b('0x11')]['message']);return _0x342bca(_0x1e4873[_0x691b('0x11')][_0x691b('0x12')]);}logger[_0x691b('0x11')](_0x691b('0xd'),_0x2d6b8f,_0x1e4873[_0x691b('0x11')][_0x691b('0x12')]);return _0x16073e(_0x1e4873[_0x691b('0x11')][_0x691b('0x12')]);}else{logger[_0x691b('0xc')](_0x691b('0xd'),_0x2d6b8f,_0x691b('0xe'));_0x16073e(_0x1e4873[_0x691b('0x13')][_0x691b('0x12')]);}})[_0x691b('0x14')](function(_0x1e79e6){logger[_0x691b('0x11')](_0x691b('0xd'),_0x2d6b8f,_0x1e79e6);_0x342bca(_0x1e79e6);});});}exports['VerifyAdditionalPhones']=function(_0x2caba7){var _0x219c59=this;return new Promise(function(_0x238a47,_0x5e5dc6){return db[_0x691b('0x15')][_0x691b('0x16')]({'raw':!![],'where':{'ContactId':_0x2caba7[_0x691b('0x17')][_0x691b('0x18')],'ListId':_0x2caba7[_0x691b('0x17')][_0x691b('0x19')],'VoiceQueueId':_0x2caba7['body'][_0x691b('0x1a')]===undefined?null:_0x2caba7['body'][_0x691b('0x1a')],'CampaignId':_0x2caba7[_0x691b('0x17')][_0x691b('0x1b')]===undefined?null:_0x2caba7[_0x691b('0x17')][_0x691b('0x1b')]}})[_0x691b('0xb')](function(_0x281d52){if(_0x281d52!=null){return db[_0x691b('0x1c')][_0x691b('0x16')]({'raw':!![],'where':{'CmHopperId':_0x281d52['id'],'OrderBy':{'$gt':_0x281d52[_0x691b('0x1d')]}},'order':[['OrderBy','ASC']]})[_0x691b('0xb')](function(_0x297d97){var _0x32b4a6=0x0;if(_0x297d97){if(_0x297d97['countbusyretry']+_0x297d97[_0x691b('0x1e')]+_0x297d97[_0x691b('0x1f')]+_0x297d97[_0x691b('0x20')]+_0x297d97[_0x691b('0x21')]+_0x297d97[_0x691b('0x22')]+_0x297d97[_0x691b('0x23')]+_0x297d97['countagentrejectretry']<_0x2caba7['entity']['dialGlobalMaxRetry'])_0x32b4a6=0x1;_0x238a47({'additional':_0x32b4a6});}else{return db[_0x691b('0x1c')][_0x691b('0x16')]({'raw':!![],'where':{'CmHopperId':_0x281d52['id']},'order':[[_0x691b('0x1d'),_0x691b('0x24')]]})[_0x691b('0xb')](function(_0x598fa7){var _0x33aae7=0x0;if(_0x598fa7){if(_0x598fa7[_0x691b('0x25')]+_0x598fa7[_0x691b('0x1e')]+_0x598fa7[_0x691b('0x1f')]+_0x598fa7[_0x691b('0x20')]+_0x598fa7[_0x691b('0x21')]+_0x598fa7[_0x691b('0x22')]+_0x598fa7[_0x691b('0x23')]+_0x598fa7[_0x691b('0x26')]<_0x2caba7[_0x691b('0x27')][_0x691b('0x28')])_0x33aae7=0x1;_0x238a47({'additional':_0x33aae7});}else{_0x238a47({'additional':0x0});}})[_0x691b('0x14')](function(_0x536e94){logger[_0x691b('0x11')](_0x691b('0x29'),_0x536e94[_0x691b('0x12')]);_0x5e5dc6(_0x219c59[_0x691b('0x11')](0x1f4,_0x536e94[_0x691b('0x12')]));});}})[_0x691b('0x14')](function(_0x4ebce7){logger[_0x691b('0x11')](_0x691b('0x29'),_0x4ebce7['message']);_0x5e5dc6(_0x219c59[_0x691b('0x11')](0x1f4,_0x4ebce7['message']));});}else _0x238a47({'additional':0x0});});});};exports[_0x691b('0x2a')]=function(_0x3c08d0){var _0x12a035=this;return new Promise(function(_0x249eaa,_0x2eef39){return db[_0x691b('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x3c08d0[_0x691b('0x17')][_0x691b('0x18')],'ListId':_0x3c08d0[_0x691b('0x17')][_0x691b('0x19')],'VoiceQueueId':_0x3c08d0['body'][_0x691b('0x1a')]===undefined?null:_0x3c08d0['body'][_0x691b('0x1a')],'CampaignId':_0x3c08d0[_0x691b('0x17')][_0x691b('0x1b')]===undefined?null:_0x3c08d0[_0x691b('0x17')][_0x691b('0x1b')]}})[_0x691b('0xb')](function(_0x2efd26){if(_0x2efd26!=null){return db['CmHopperAdditionalPhone'][_0x691b('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2efd26['id'],'OrderBy':{'$gte':_0x2efd26[_0x691b('0x1d')]}},'order':[['OrderBy',_0x691b('0x24')]]})[_0x691b('0xb')](function(_0x2fd363){if(_0x2fd363)return activateAdditionalPhone(_0x2efd26,_0x3c08d0[_0x691b('0x17')],_0x2fd363,_0x3c08d0[_0x691b('0x2b')],_0x3c08d0[_0x691b('0x2c')])[_0x691b('0xb')](function(_0x31f167){_0x249eaa(_0x31f167);});else{return db[_0x691b('0x1c')][_0x691b('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2efd26['id']},'order':[['OrderBy',_0x691b('0x24')]]})['then'](function(_0x21f714){if(_0x21f714)return activateAdditionalPhone(_0x2efd26,_0x3c08d0[_0x691b('0x17')],_0x21f714,_0x3c08d0[_0x691b('0x2b')],_0x3c08d0[_0x691b('0x2c')])[_0x691b('0xb')](function(_0x4e68cf){_0x249eaa(_0x4e68cf);});else{_0x249eaa({'id':_0x2efd26['id'],'phone':''});}})[_0x691b('0x14')](function(_0x443dc8){logger[_0x691b('0x11')]('VerifyAdditionalPhones',_0x443dc8[_0x691b('0x12')]);_0x2eef39(_0x12a035['error'](0x1f4,_0x443dc8[_0x691b('0x12')]));});}})[_0x691b('0x14')](function(_0x1aa367){logger['error'](_0x691b('0x29'),_0x1aa367[_0x691b('0x12')]);_0x2eef39(_0x12a035[_0x691b('0x11')](0x1f4,_0x1aa367['message']));});}else _0x249eaa(0x1);});});};function activateAdditionalPhone(_0x121dd5,_0x21f445,_0x413f5c,_0x5d06f4,_0x31fb6c){return new Promise(function(_0x14e7ff,_0x400f9c){var _0x432b0f;if(_[_0x691b('0x2d')](_0x413f5c['scheduledat'])){_0x413f5c[_0x691b('0x2e')]=moment();}if(moment()>moment(_0x413f5c[_0x691b('0x2e')])){_0x432b0f=moment()[_0x691b('0x2f')](_0x31fb6c||0x3,'minutes');}else{if(_0x413f5c[_0x691b('0x1d')]==0x0){_0x432b0f=moment(_0x413f5c[_0x691b('0x2e')]);}else{_0x432b0f=moment()[_0x691b('0x2f')](_0x31fb6c||0x3,_0x691b('0x30'));}}if(_[_0x691b('0x2d')](_0x432b0f)){_0x432b0f=moment()[_0x691b('0x2f')](_0x31fb6c||0x3,_0x691b('0x30'));}var _0x5eafa6={'phone':_0x121dd5['phone'],'active':0x0,'OrderBy':_['isNil'](_0x121dd5[_0x691b('0x1d')])?0x0:_0x121dd5[_0x691b('0x1d')],'scheduledat':moment()[_0x691b('0x2f')](_0x5d06f4||0x1,_0x691b('0x30')),'countbusyretry':_0x21f445[_0x691b('0x25')],'countcongestionretry':_0x21f445[_0x691b('0x1e')],'countnoanswerretry':_0x21f445['countnoanswerretry'],'countnosuchnumberretry':_0x21f445['countnosuchnumberretry'],'countdropretry':_0x21f445['countdropretry'],'countabandonedretry':_0x21f445['countabandonedretry'],'countmachineretry':_0x21f445['countmachineretry'],'countagentrejectretry':_0x21f445['countagentrejectretry'],'createdAt':_0x21f445[_0x691b('0x31')],'updatedAt':_0x21f445['updatedAt']};var _0x4e6fa7={'CmHopperId':_0x121dd5['id'],'phone':_0x413f5c['phone'],'active':0x0,'OrderBy':_[_0x691b('0x2d')](_0x413f5c[_0x691b('0x1d')])?0x0:_0x413f5c[_0x691b('0x1d')],'scheduledat':_0x432b0f,'countbusyretry':_0x413f5c[_0x691b('0x25')],'countcongestionretry':_0x413f5c[_0x691b('0x1e')],'countnoanswerretry':_0x413f5c[_0x691b('0x1f')],'countnosuchnumberretry':_0x413f5c[_0x691b('0x20')],'countdropretry':_0x413f5c[_0x691b('0x21')],'countabandonedretry':_0x413f5c[_0x691b('0x22')],'countmachineretry':_0x413f5c[_0x691b('0x23')],'countagentrejectretry':_0x413f5c[_0x691b('0x26')],'createdAt':_0x413f5c[_0x691b('0x31')],'updatedAt':_0x413f5c[_0x691b('0x32')]};return db[_0x691b('0x33')]['transaction'](function(_0x13893a){return db[_0x691b('0x1c')]['update'](_0x5eafa6,{'where':{'id':_0x413f5c['id']}},{'transaction':_0x13893a})[_0x691b('0xb')](function(){return db['CmHopper']['update'](_0x4e6fa7,{'where':{'id':_0x121dd5['id']}},{'transaction':_0x13893a});});})[_0x691b('0xb')](function(_0x515c5b){_0x14e7ff({'id':_0x121dd5['id'],'phone':_0x413f5c[_0x691b('0x34')]});})[_0x691b('0x14')](function(_0x503acd){logger[_0x691b('0x11')](_0x691b('0x35'),_0x503acd[_0x691b('0x12')]);_0x400f9c({'error':_0x503acd[_0x691b('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x40ca00){var _0x23fa73=this;return new Promise(function(_0xbdd08b,_0x1ebff3){return db[_0x691b('0x15')][_0x691b('0x36')](_0x40ca00[_0x691b('0x17')][_0x691b('0x37')],{'where':{'id':_0x40ca00['body']['id']}})['then'](function(_0x139c7a){_0xbdd08b(_0x139c7a);})[_0x691b('0x14')](function(_0x4a6592){logger[_0x691b('0x11')](_0x691b('0x38'),_0x4a6592['message']);_0x1ebff3(_0x23fa73['error'](0x1f4,_0x4a6592[_0x691b('0x12')]));});});}; \ No newline at end of file +var _0xf990=['countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','SwapAdditionalPhones','duration','waitTime','VerifyAdditionalPhones','isNil','scheduledat','add','minutes','phone','countmachineretry','createdAt','updatedAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry'];(function(_0x4d36a4,_0x303dd0){var _0x8d4548=function(_0x295887){while(--_0x295887){_0x4d36a4['push'](_0x4d36a4['shift']());}};_0x8d4548(++_0x303dd0);}(_0xf990,0x87));var _0x0f99=function(_0x479188,_0x505a1c){_0x479188=_0x479188-0x0;var _0x466b0d=_0xf990[_0x479188];return _0x466b0d;};'use strict';var _=require(_0x0f99('0x0'));var util=require('util');var moment=require(_0x0f99('0x1'));var BPromise=require(_0x0f99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f99('0x3'));var db=require(_0x0f99('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f99('0x5'))(_0x0f99('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f99('0x7'));var client=jayson[_0x0f99('0x8')][_0x0f99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43c4aa,_0x5581b7,_0x56ac4c){return new BPromise(function(_0x166219,_0x4365a3){return client[_0x0f99('0xa')](_0x43c4aa,_0x56ac4c)[_0x0f99('0xb')](function(_0x4deab6){logger[_0x0f99('0xc')](_0x0f99('0xd'),_0x5581b7,_0x0f99('0xe'));logger[_0x0f99('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x5581b7,_0x0f99('0xe'),JSON[_0x0f99('0x10')](_0x4deab6));if(_0x4deab6[_0x0f99('0x11')]){if(_0x4deab6[_0x0f99('0x11')]['code']===0x1f4){logger['error'](_0x0f99('0xd'),_0x5581b7,_0x4deab6[_0x0f99('0x11')][_0x0f99('0x12')]);return _0x4365a3(_0x4deab6[_0x0f99('0x11')][_0x0f99('0x12')]);}logger[_0x0f99('0x11')](_0x0f99('0xd'),_0x5581b7,_0x4deab6[_0x0f99('0x11')]['message']);return _0x166219(_0x4deab6[_0x0f99('0x11')]['message']);}else{logger['info'](_0x0f99('0xd'),_0x5581b7,_0x0f99('0xe'));_0x166219(_0x4deab6[_0x0f99('0x13')][_0x0f99('0x12')]);}})[_0x0f99('0x14')](function(_0x495117){logger[_0x0f99('0x11')](_0x0f99('0xd'),_0x5581b7,_0x495117);_0x4365a3(_0x495117);});});}exports['VerifyAdditionalPhones']=function(_0x382024){var _0x10c85b=this;return new Promise(function(_0x7ffaa1,_0x26ce1f){return db[_0x0f99('0x15')][_0x0f99('0x16')]({'raw':!![],'where':{'ContactId':_0x382024[_0x0f99('0x17')][_0x0f99('0x18')],'ListId':_0x382024[_0x0f99('0x17')][_0x0f99('0x19')],'VoiceQueueId':_0x382024['body'][_0x0f99('0x1a')]===undefined?null:_0x382024[_0x0f99('0x17')][_0x0f99('0x1a')],'CampaignId':_0x382024['body']['CampaignId']===undefined?null:_0x382024[_0x0f99('0x17')][_0x0f99('0x1b')]}})['then'](function(_0x2821b3){if(_0x2821b3!=null){return db[_0x0f99('0x1c')][_0x0f99('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2821b3['id'],'OrderBy':{'$gt':_0x2821b3['OrderBy']}},'order':[[_0x0f99('0x1d'),_0x0f99('0x1e')]]})[_0x0f99('0xb')](function(_0x220402){var _0x442d7e=0x0;if(_0x220402){if(_0x220402[_0x0f99('0x1f')]+_0x220402[_0x0f99('0x20')]+_0x220402[_0x0f99('0x21')]+_0x220402['countnosuchnumberretry']+_0x220402[_0x0f99('0x22')]+_0x220402[_0x0f99('0x23')]+_0x220402['countmachineretry']+_0x220402[_0x0f99('0x24')]<_0x382024[_0x0f99('0x25')][_0x0f99('0x26')])_0x442d7e=0x1;_0x7ffaa1({'additional':_0x442d7e});}else{return db[_0x0f99('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2821b3['id']},'order':[['OrderBy',_0x0f99('0x1e')]]})[_0x0f99('0xb')](function(_0x20779c){var _0x32eb8d=0x0;if(_0x20779c){if(_0x20779c['countbusyretry']+_0x20779c[_0x0f99('0x20')]+_0x20779c[_0x0f99('0x21')]+_0x20779c[_0x0f99('0x27')]+_0x20779c['countdropretry']+_0x20779c[_0x0f99('0x23')]+_0x20779c['countmachineretry']+_0x20779c['countagentrejectretry']<_0x382024[_0x0f99('0x25')]['dialGlobalMaxRetry'])_0x32eb8d=0x1;_0x7ffaa1({'additional':_0x32eb8d});}else{_0x7ffaa1({'additional':0x0});}})['catch'](function(_0x22dd4b){logger[_0x0f99('0x11')]('VerifyAdditionalPhones',_0x22dd4b[_0x0f99('0x12')]);_0x26ce1f(_0x10c85b[_0x0f99('0x11')](0x1f4,_0x22dd4b[_0x0f99('0x12')]));});}})[_0x0f99('0x14')](function(_0x42e263){logger[_0x0f99('0x11')]('VerifyAdditionalPhones',_0x42e263['message']);_0x26ce1f(_0x10c85b[_0x0f99('0x11')](0x1f4,_0x42e263[_0x0f99('0x12')]));});}else _0x7ffaa1({'additional':0x0});});});};exports[_0x0f99('0x28')]=function(_0x5ea537){var _0x1ced44=this;return new Promise(function(_0x3e35f9,_0x1d938d){return db[_0x0f99('0x15')][_0x0f99('0x16')]({'raw':!![],'where':{'ContactId':_0x5ea537[_0x0f99('0x17')][_0x0f99('0x18')],'ListId':_0x5ea537[_0x0f99('0x17')][_0x0f99('0x19')],'VoiceQueueId':_0x5ea537[_0x0f99('0x17')][_0x0f99('0x1a')]===undefined?null:_0x5ea537[_0x0f99('0x17')][_0x0f99('0x1a')],'CampaignId':_0x5ea537[_0x0f99('0x17')][_0x0f99('0x1b')]===undefined?null:_0x5ea537['body'][_0x0f99('0x1b')]}})[_0x0f99('0xb')](function(_0x2c5034){if(_0x2c5034!=null){return db[_0x0f99('0x1c')][_0x0f99('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2c5034['id'],'OrderBy':{'$gte':_0x2c5034[_0x0f99('0x1d')]}},'order':[[_0x0f99('0x1d'),_0x0f99('0x1e')]]})[_0x0f99('0xb')](function(_0x32b6b5){if(_0x32b6b5)return activateAdditionalPhone(_0x2c5034,_0x5ea537[_0x0f99('0x17')],_0x32b6b5,_0x5ea537[_0x0f99('0x29')],_0x5ea537[_0x0f99('0x2a')])['then'](function(_0x20c9f9){_0x3e35f9(_0x20c9f9);});else{return db[_0x0f99('0x1c')][_0x0f99('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2c5034['id']},'order':[['OrderBy',_0x0f99('0x1e')]]})[_0x0f99('0xb')](function(_0xe81acc){if(_0xe81acc)return activateAdditionalPhone(_0x2c5034,_0x5ea537[_0x0f99('0x17')],_0xe81acc,_0x5ea537[_0x0f99('0x29')],_0x5ea537[_0x0f99('0x2a')])[_0x0f99('0xb')](function(_0x5145df){_0x3e35f9(_0x5145df);});else{_0x3e35f9({'id':_0x2c5034['id'],'phone':''});}})['catch'](function(_0x1d33a5){logger[_0x0f99('0x11')]('VerifyAdditionalPhones',_0x1d33a5[_0x0f99('0x12')]);_0x1d938d(_0x1ced44[_0x0f99('0x11')](0x1f4,_0x1d33a5[_0x0f99('0x12')]));});}})[_0x0f99('0x14')](function(_0x2730fd){logger['error'](_0x0f99('0x2b'),_0x2730fd[_0x0f99('0x12')]);_0x1d938d(_0x1ced44[_0x0f99('0x11')](0x1f4,_0x2730fd[_0x0f99('0x12')]));});}else _0x3e35f9(0x1);});});};function activateAdditionalPhone(_0xbb5c83,_0x102d23,_0x417666,_0x506a77,_0x584823){return new Promise(function(_0x5b4516,_0x13e916){var _0x2fc4e8;if(_[_0x0f99('0x2c')](_0x417666[_0x0f99('0x2d')])){_0x417666['scheduledat']=moment();}if(moment()>moment(_0x417666[_0x0f99('0x2d')])){_0x2fc4e8=moment()[_0x0f99('0x2e')](_0x584823||0x3,_0x0f99('0x2f'));}else{if(_0x417666[_0x0f99('0x1d')]==0x0){_0x2fc4e8=moment(_0x417666[_0x0f99('0x2d')]);}else{_0x2fc4e8=moment()[_0x0f99('0x2e')](_0x584823||0x3,'minutes');}}if(_[_0x0f99('0x2c')](_0x2fc4e8)){_0x2fc4e8=moment()[_0x0f99('0x2e')](_0x584823||0x3,_0x0f99('0x2f'));}var _0x2dbb61={'phone':_0xbb5c83[_0x0f99('0x30')],'active':0x0,'OrderBy':_[_0x0f99('0x2c')](_0xbb5c83[_0x0f99('0x1d')])?0x0:_0xbb5c83[_0x0f99('0x1d')],'scheduledat':moment()[_0x0f99('0x2e')](_0x506a77||0x1,_0x0f99('0x2f')),'countbusyretry':_0x102d23['countbusyretry'],'countcongestionretry':_0x102d23[_0x0f99('0x20')],'countnoanswerretry':_0x102d23[_0x0f99('0x21')],'countnosuchnumberretry':_0x102d23[_0x0f99('0x27')],'countdropretry':_0x102d23[_0x0f99('0x22')],'countabandonedretry':_0x102d23[_0x0f99('0x23')],'countmachineretry':_0x102d23[_0x0f99('0x31')],'countagentrejectretry':_0x102d23[_0x0f99('0x24')],'createdAt':_0x102d23[_0x0f99('0x32')],'updatedAt':_0x102d23[_0x0f99('0x33')]};var _0x325db9={'CmHopperId':_0xbb5c83['id'],'phone':_0x417666[_0x0f99('0x30')],'active':0x0,'OrderBy':_[_0x0f99('0x2c')](_0x417666['OrderBy'])?0x0:_0x417666[_0x0f99('0x1d')],'scheduledat':_0x2fc4e8,'countbusyretry':_0x417666[_0x0f99('0x1f')],'countcongestionretry':_0x417666[_0x0f99('0x20')],'countnoanswerretry':_0x417666['countnoanswerretry'],'countnosuchnumberretry':_0x417666[_0x0f99('0x27')],'countdropretry':_0x417666[_0x0f99('0x22')],'countabandonedretry':_0x417666[_0x0f99('0x23')],'countmachineretry':_0x417666[_0x0f99('0x31')],'countagentrejectretry':_0x417666[_0x0f99('0x24')],'createdAt':_0x417666[_0x0f99('0x32')],'updatedAt':_0x417666[_0x0f99('0x33')]};return db[_0x0f99('0x34')]['transaction'](function(_0x92ca65){return db[_0x0f99('0x1c')][_0x0f99('0x35')](_0x2dbb61,{'where':{'id':_0x417666['id']}},{'transaction':_0x92ca65})[_0x0f99('0xb')](function(){return db[_0x0f99('0x15')][_0x0f99('0x35')](_0x325db9,{'where':{'id':_0xbb5c83['id']}},{'transaction':_0x92ca65});});})[_0x0f99('0xb')](function(_0x3b496b){_0x5b4516({'id':_0xbb5c83['id'],'phone':_0x417666['phone']});})['catch'](function(_0x428dc5){logger[_0x0f99('0x11')](_0x0f99('0x36'),_0x428dc5[_0x0f99('0x12')]);_0x13e916({'error':_0x428dc5[_0x0f99('0x12')]});});});}exports[_0x0f99('0x37')]=function(_0x4e12b7){var _0x35d2b6=this;return new Promise(function(_0xf5d47e,_0x27354d){return db[_0x0f99('0x15')]['update'](_0x4e12b7[_0x0f99('0x17')]['field'],{'where':{'id':_0x4e12b7[_0x0f99('0x17')]['id']}})['then'](function(_0x2728c4){_0xf5d47e(_0x2728c4);})[_0x0f99('0x14')](function(_0x5b2a3f){logger['error']('IncrementPreviewCounters',_0x5b2a3f['message']);_0x27354d(_0x35d2b6['error'](0x1f4,_0x5b2a3f[_0x0f99('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c678b0c..6c15b5f 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x39f28b,_0x999b31){_0x39f28b=_0x39f28b-0x0;var _0xc91de9=_0xf7b4[_0x39f28b];return _0xc91de9;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x320c=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0xbc0544,_0x5d7158){var _0x47e0ec=function(_0x57890e){while(--_0x57890e){_0xbc0544['push'](_0xbc0544['shift']());}};_0x47e0ec(++_0x5d7158);}(_0x320c,0x7b));var _0xc320=function(_0x4898b4,_0x41ca23){_0x4898b4=_0x4898b4-0x0;var _0x85539f=_0x320c[_0x4898b4];return _0x85539f;};'use strict';var multer=require(_0xc320('0x0'));var util=require(_0xc320('0x1'));var path=require(_0xc320('0x2'));var timeout=require('connect-timeout');var express=require(_0xc320('0x3'));var router=express[_0xc320('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc320('0x5'));var interaction=require(_0xc320('0x6'));var config=require(_0xc320('0x7'));var controller=require(_0xc320('0x8'));router[_0xc320('0x9')]('/',auth[_0xc320('0xa')](),controller[_0xc320('0xb')]);router[_0xc320('0x9')](_0xc320('0xc'),auth['isAuthenticated'](),controller[_0xc320('0xd')]);router[_0xc320('0xe')]('/',auth[_0xc320('0xa')](),controller['create']);router[_0xc320('0xf')](_0xc320('0xc'),auth['isAuthenticated'](),controller[_0xc320('0x10')]);router[_0xc320('0x11')]('/:id',auth[_0xc320('0xa')](),controller[_0xc320('0x12')]);module[_0xc320('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e8dbd4b..2d6a596 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 _0x2428=['contactListQueue','sequelize','exports','STRING','INTEGER'];(function(_0xec9e3b,_0x136f2e){var _0x44fe44=function(_0x412cdf){while(--_0x412cdf){_0xec9e3b['push'](_0xec9e3b['shift']());}};_0x44fe44(++_0x136f2e);}(_0x2428,0xd3));var _0x8242=function(_0x5881fe,_0x2b60ff){_0x5881fe=_0x5881fe-0x0;var _0x3404db=_0x2428[_0x5881fe];return _0x3404db;};'use strict';var moment=require('moment');var Sequelize=require(_0x8242('0x0'));module[_0x8242('0x1')]={'phone':{'type':Sequelize[_0x8242('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8242('0x3')],'unique':_0x8242('0x4')},'ListId':{'type':Sequelize[_0x8242('0x3')],'unique':_0x8242('0x4')},'VoiceQueueId':{'type':Sequelize[_0x8242('0x3')],'unique':_0x8242('0x4')}}; \ No newline at end of file +var _0x46e1=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x4d5164,_0x4e20cb){var _0x2df768=function(_0x400737){while(--_0x400737){_0x4d5164['push'](_0x4d5164['shift']());}};_0x2df768(++_0x4e20cb);}(_0x46e1,0x155));var _0x146e=function(_0x39da77,_0x7d312a){_0x39da77=_0x39da77-0x0;var _0x53934=_0x46e1[_0x39da77];return _0x53934;};'use strict';var moment=require(_0x146e('0x0'));var Sequelize=require(_0x146e('0x1'));module[_0x146e('0x2')]={'phone':{'type':Sequelize[_0x146e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'ListId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')},'VoiceQueueId':{'type':Sequelize[_0x146e('0x4')],'unique':_0x146e('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b020e32..bb7341d 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 _0x77cb=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','CmHopperBlack','fieldName','map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x77cb,0x1b2));var _0xb77c=function(_0x194cf8,_0x536123){_0x194cf8=_0x194cf8-0x0;var _0x17444f=_0x77cb[_0x194cf8];return _0x17444f;};'use strict';var emlformat=require(_0xb77c('0x0'));var rimraf=require(_0xb77c('0x1'));var zipdir=require(_0xb77c('0x2'));var jsonpatch=require(_0xb77c('0x3'));var rp=require(_0xb77c('0x4'));var moment=require(_0xb77c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb77c('0x6'));var util=require(_0xb77c('0x7'));var path=require(_0xb77c('0x8'));var sox=require(_0xb77c('0x9'));var csv=require(_0xb77c('0xa'));var ejs=require(_0xb77c('0xb'));var fs=require('fs');var fs_extra=require(_0xb77c('0xc'));var _=require(_0xb77c('0xd'));var squel=require(_0xb77c('0xe'));var crypto=require(_0xb77c('0xf'));var jsforce=require(_0xb77c('0x10'));var deskjs=require(_0xb77c('0x11'));var toCsv=require(_0xb77c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb77c('0x12'));var authService=require(_0xb77c('0x13'));var qs=require(_0xb77c('0x14'));var as=require(_0xb77c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb77c('0x16'));var utils=require(_0xb77c('0x17'));var config=require(_0xb77c('0x18'));var licenseUtil=require(_0xb77c('0x19'));var db=require(_0xb77c('0x1a'))['db'];function respondWithStatusCode(_0x158f8f,_0x1fb619){_0x1fb619=_0x1fb619||0xcc;return function(_0x262f83){if(_0x262f83){return _0x158f8f['sendStatus'](_0x1fb619);}return _0x158f8f[_0xb77c('0x1b')](_0x1fb619)[_0xb77c('0x1c')]();};}function respondWithResult(_0x421362,_0xace3f4){_0xace3f4=_0xace3f4||0xc8;return function(_0x361b82){if(_0x361b82){return _0x421362['status'](_0xace3f4)[_0xb77c('0x1d')](_0x361b82);}};}function respondWithFilteredResult(_0x1bcb21,_0x23b3ac){return function(_0x400ecc){if(_0x400ecc){var _0x16068f=typeof _0x23b3ac[_0xb77c('0x1e')]===_0xb77c('0x1f')&&typeof _0x23b3ac[_0xb77c('0x20')]===_0xb77c('0x1f');var _0x2c180a=_0x400ecc[_0xb77c('0x21')];var _0xd1f0df=_0x16068f?0x0:_0x23b3ac[_0xb77c('0x1e')];var _0x56fcbf=_0x16068f?_0x400ecc[_0xb77c('0x21')]:_0x23b3ac['offset']+_0x23b3ac[_0xb77c('0x20')];var _0x17d11f;if(_0x56fcbf>=_0x2c180a){_0x56fcbf=_0x2c180a;_0x17d11f=0xc8;}else{_0x17d11f=0xce;}_0x1bcb21[_0xb77c('0x1b')](_0x17d11f);return _0x1bcb21[_0xb77c('0x22')](_0xb77c('0x23'),_0xd1f0df+'-'+_0x56fcbf+'/'+_0x2c180a)[_0xb77c('0x1d')](_0x400ecc);}return null;};}function patchUpdates(_0x504638){return function(_0x471969){try{jsonpatch[_0xb77c('0x24')](_0x471969,_0x504638,!![]);}catch(_0x385115){return BPromise[_0xb77c('0x25')](_0x385115);}return _0x471969[_0xb77c('0x26')]();};}function saveUpdates(_0x5e4f96,_0x495c58){return function(_0x22895b){if(_0x22895b){return _0x22895b[_0xb77c('0x27')](_0x5e4f96)[_0xb77c('0x28')](function(_0x91de10){return _0x91de10;});}return null;};}function removeEntity(_0x5c4ece,_0x5dbc93){return function(_0x573c44){if(_0x573c44){return _0x573c44[_0xb77c('0x29')]()[_0xb77c('0x28')](function(){_0x5c4ece[_0xb77c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb405cd,_0x329814){return function(_0x409449){if(!_0x409449){_0xb405cd[_0xb77c('0x2a')](0x194);}return _0x409449;};}function handleError(_0x24ee4a,_0x2b9597){_0x2b9597=_0x2b9597||0x1f4;return function(_0x2e3c29){logger[_0xb77c('0x2b')](_0x2e3c29[_0xb77c('0x2c')]);if(_0x2e3c29[_0xb77c('0x2d')]){delete _0x2e3c29[_0xb77c('0x2d')];}_0x24ee4a['status'](_0x2b9597)['send'](_0x2e3c29);};}exports[_0xb77c('0x2e')]=function(_0x52e221,_0x58689c){var _0x8c2248={},_0xe99bee={},_0x266bd7={'count':0x0,'rows':[]};var _0x3ea5f8=_['map'](db[_0xb77c('0x2f')]['rawAttributes'],function(_0x25512f){return{'name':_0x25512f[_0xb77c('0x30')],'type':_0x25512f['type']['key']};});_0xe99bee['model']=_[_0xb77c('0x31')](_0x3ea5f8,_0xb77c('0x2d'));_0xe99bee[_0xb77c('0x32')]=_[_0xb77c('0x33')](_0x52e221['query']);_0xe99bee['filters']=_[_0xb77c('0x34')](_0xe99bee['model'],_0xe99bee['query']);_0x8c2248[_0xb77c('0x35')]=_[_0xb77c('0x34')](_0xe99bee[_0xb77c('0x36')],qs[_0xb77c('0x37')](_0x52e221[_0xb77c('0x32')][_0xb77c('0x37')]));_0x8c2248['attributes']=_0x8c2248['attributes'][_0xb77c('0x38')]?_0x8c2248['attributes']:_0xe99bee[_0xb77c('0x36')];if(!_0x52e221['query'][_0xb77c('0x39')](_0xb77c('0x3a'))){_0x8c2248['limit']=qs[_0xb77c('0x20')](_0x52e221['query'][_0xb77c('0x20')]);_0x8c2248[_0xb77c('0x1e')]=qs['offset'](_0x52e221[_0xb77c('0x32')][_0xb77c('0x1e')]);}_0x8c2248['order']=qs[_0xb77c('0x3b')](_0x52e221[_0xb77c('0x32')][_0xb77c('0x3b')]);_0x8c2248[_0xb77c('0x3c')]=qs['filters'](_[_0xb77c('0x3d')](_0x52e221[_0xb77c('0x32')],_0xe99bee[_0xb77c('0x3e')]),_0x3ea5f8);if(_0x52e221[_0xb77c('0x32')][_0xb77c('0x3f')]){_0x8c2248['where']=_[_0xb77c('0x40')](_0x8c2248[_0xb77c('0x3c')],{'$or':_['map'](_0x3ea5f8,function(_0x368729){if(_0x368729[_0xb77c('0x41')]!=='VIRTUAL'){var _0x1c0699={};_0x1c0699[_0x368729[_0xb77c('0x2d')]]={'$like':'%'+_0x52e221[_0xb77c('0x32')]['filter']+'%'};return _0x1c0699;}})});}_0x8c2248=_[_0xb77c('0x40')]({},_0x8c2248,_0x52e221[_0xb77c('0x42')]);var _0x12ae09={'where':_0x8c2248[_0xb77c('0x3c')]};return db[_0xb77c('0x2f')][_0xb77c('0x21')](_0x12ae09)[_0xb77c('0x28')](function(_0x30540c){_0x266bd7[_0xb77c('0x21')]=_0x30540c;if(_0x52e221[_0xb77c('0x32')][_0xb77c('0x43')]){_0x8c2248['include']=[{'all':!![]}];}return db[_0xb77c('0x2f')][_0xb77c('0x44')](_0x8c2248);})[_0xb77c('0x28')](function(_0x56d3f1){_0x266bd7[_0xb77c('0x45')]=_0x56d3f1;return _0x266bd7;})[_0xb77c('0x28')](respondWithFilteredResult(_0x58689c,_0x8c2248))[_0xb77c('0x46')](handleError(_0x58689c,null));};exports['show']=function(_0x586d53,_0x332021){var _0x1a5675={'raw':!![],'where':{'id':_0x586d53[_0xb77c('0x47')]['id']}},_0x5d1a40={};_0x5d1a40['model']=_[_0xb77c('0x33')](db[_0xb77c('0x2f')][_0xb77c('0x48')]);_0x5d1a40[_0xb77c('0x32')]=_['keys'](_0x586d53[_0xb77c('0x32')]);_0x5d1a40[_0xb77c('0x3e')]=_[_0xb77c('0x34')](_0x5d1a40[_0xb77c('0x36')],_0x5d1a40[_0xb77c('0x32')]);_0x1a5675['attributes']=_[_0xb77c('0x34')](_0x5d1a40[_0xb77c('0x36')],qs[_0xb77c('0x37')](_0x586d53[_0xb77c('0x32')]['fields']));_0x1a5675['attributes']=_0x1a5675[_0xb77c('0x35')]['length']?_0x1a5675[_0xb77c('0x35')]:_0x5d1a40[_0xb77c('0x36')];if(_0x586d53[_0xb77c('0x32')]['includeAll']){_0x1a5675[_0xb77c('0x49')]=[{'all':!![]}];}_0x1a5675=_['merge']({},_0x1a5675,_0x586d53[_0xb77c('0x42')]);return db[_0xb77c('0x2f')][_0xb77c('0x4a')](_0x1a5675)['then'](handleEntityNotFound(_0x332021,null))[_0xb77c('0x28')](respondWithResult(_0x332021,null))['catch'](handleError(_0x332021,null));};exports[_0xb77c('0x27')]=function(_0x4157e1,_0x3fcc5a){if(_0x4157e1[_0xb77c('0x4b')]['id']){delete _0x4157e1[_0xb77c('0x4b')]['id'];}return db[_0xb77c('0x2f')]['find']({'where':{'id':_0x4157e1[_0xb77c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fcc5a,null))[_0xb77c('0x28')](saveUpdates(_0x4157e1['body'],null))['then'](respondWithResult(_0x3fcc5a,null))[_0xb77c('0x46')](handleError(_0x3fcc5a,null));};exports[_0xb77c('0x29')]=function(_0x360dd6,_0x43e3fd){return db[_0xb77c('0x2f')][_0xb77c('0x4a')]({'where':{'id':_0x360dd6[_0xb77c('0x47')]['id']}})[_0xb77c('0x28')](handleEntityNotFound(_0x43e3fd,null))[_0xb77c('0x28')](removeEntity(_0x43e3fd,null))[_0xb77c('0x46')](handleError(_0x43e3fd,null));};exports['describe']=function(_0x3d29e0,_0x1cf24a){return db['CmHopperBlack'][_0xb77c('0x4c')]()[_0xb77c('0x28')](respondWithResult(_0x1cf24a,null))['catch'](handleError(_0x1cf24a,null));}; \ No newline at end of file +var _0x8a21=['attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x8a21,0x1d8));var _0x18a2=function(_0x1b97f3,_0xce63f3){_0x1b97f3=_0x1b97f3-0x0;var _0x32d818=_0x8a21[_0x1b97f3];return _0x32d818;};'use strict';var emlformat=require(_0x18a2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x18a2('0x1'));var rp=require(_0x18a2('0x2'));var moment=require(_0x18a2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x18a2('0x4'));var path=require(_0x18a2('0x5'));var sox=require(_0x18a2('0x6'));var csv=require(_0x18a2('0x7'));var ejs=require(_0x18a2('0x8'));var fs=require('fs');var fs_extra=require(_0x18a2('0x9'));var _=require(_0x18a2('0xa'));var squel=require(_0x18a2('0xb'));var crypto=require('crypto');var jsforce=require(_0x18a2('0xc'));var deskjs=require(_0x18a2('0xd'));var toCsv=require(_0x18a2('0x7'));var querystring=require('querystring');var Papa=require(_0x18a2('0xe'));var Redis=require(_0x18a2('0xf'));var authService=require(_0x18a2('0x10'));var qs=require(_0x18a2('0x11'));var as=require(_0x18a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18a2('0x13'))(_0x18a2('0x14'));var utils=require('../../config/utils');var config=require(_0x18a2('0x15'));var licenseUtil=require(_0x18a2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30ee0b,_0x27e3af){_0x27e3af=_0x27e3af||0xcc;return function(_0x538947){if(_0x538947){return _0x30ee0b[_0x18a2('0x17')](_0x27e3af);}return _0x30ee0b[_0x18a2('0x18')](_0x27e3af)[_0x18a2('0x19')]();};}function respondWithResult(_0x2d03c0,_0x589277){_0x589277=_0x589277||0xc8;return function(_0x494cf1){if(_0x494cf1){return _0x2d03c0[_0x18a2('0x18')](_0x589277)['json'](_0x494cf1);}};}function respondWithFilteredResult(_0x29e733,_0x4e7f30){return function(_0x358572){if(_0x358572){var _0x3037c6=typeof _0x4e7f30[_0x18a2('0x1a')]==='undefined'&&typeof _0x4e7f30[_0x18a2('0x1b')]===_0x18a2('0x1c');var _0x13a23c=_0x358572[_0x18a2('0x1d')];var _0x22296a=_0x3037c6?0x0:_0x4e7f30['offset'];var _0x26929f=_0x3037c6?_0x358572['count']:_0x4e7f30[_0x18a2('0x1a')]+_0x4e7f30['limit'];var _0x1bb83f;if(_0x26929f>=_0x13a23c){_0x26929f=_0x13a23c;_0x1bb83f=0xc8;}else{_0x1bb83f=0xce;}_0x29e733[_0x18a2('0x18')](_0x1bb83f);return _0x29e733[_0x18a2('0x1e')](_0x18a2('0x1f'),_0x22296a+'-'+_0x26929f+'/'+_0x13a23c)[_0x18a2('0x20')](_0x358572);}return null;};}function patchUpdates(_0x227fd0){return function(_0x19a326){try{jsonpatch[_0x18a2('0x21')](_0x19a326,_0x227fd0,!![]);}catch(_0x5f3252){return BPromise[_0x18a2('0x22')](_0x5f3252);}return _0x19a326[_0x18a2('0x23')]();};}function saveUpdates(_0x3a063a,_0x5c5164){return function(_0x1ed01f){if(_0x1ed01f){return _0x1ed01f[_0x18a2('0x24')](_0x3a063a)[_0x18a2('0x25')](function(_0x3b741c){return _0x3b741c;});}return null;};}function removeEntity(_0x3fdf6c,_0x591a4c){return function(_0x5340cc){if(_0x5340cc){return _0x5340cc['destroy']()[_0x18a2('0x25')](function(){_0x3fdf6c[_0x18a2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f573,_0x3be4db){return function(_0x531eb3){if(!_0x531eb3){_0x32f573[_0x18a2('0x17')](0x194);}return _0x531eb3;};}function handleError(_0x327d81,_0x3cecc){_0x3cecc=_0x3cecc||0x1f4;return function(_0x3689b6){logger[_0x18a2('0x26')](_0x3689b6[_0x18a2('0x27')]);if(_0x3689b6[_0x18a2('0x28')]){delete _0x3689b6[_0x18a2('0x28')];}_0x327d81[_0x18a2('0x18')](_0x3cecc)[_0x18a2('0x29')](_0x3689b6);};}exports[_0x18a2('0x2a')]=function(_0x562df1,_0x43a4f8){var _0x2df574={},_0x490410={},_0x266810={'count':0x0,'rows':[]};var _0x49f50f=_[_0x18a2('0x2b')](db[_0x18a2('0x2c')][_0x18a2('0x2d')],function(_0x56b765){return{'name':_0x56b765[_0x18a2('0x2e')],'type':_0x56b765[_0x18a2('0x2f')][_0x18a2('0x30')]};});_0x490410[_0x18a2('0x31')]=_[_0x18a2('0x2b')](_0x49f50f,'name');_0x490410[_0x18a2('0x32')]=_[_0x18a2('0x33')](_0x562df1[_0x18a2('0x32')]);_0x490410[_0x18a2('0x34')]=_['intersection'](_0x490410[_0x18a2('0x31')],_0x490410[_0x18a2('0x32')]);_0x2df574[_0x18a2('0x35')]=_[_0x18a2('0x36')](_0x490410['model'],qs[_0x18a2('0x37')](_0x562df1[_0x18a2('0x32')][_0x18a2('0x37')]));_0x2df574[_0x18a2('0x35')]=_0x2df574[_0x18a2('0x35')][_0x18a2('0x38')]?_0x2df574['attributes']:_0x490410[_0x18a2('0x31')];if(!_0x562df1[_0x18a2('0x32')][_0x18a2('0x39')](_0x18a2('0x3a'))){_0x2df574[_0x18a2('0x1b')]=qs['limit'](_0x562df1[_0x18a2('0x32')]['limit']);_0x2df574[_0x18a2('0x1a')]=qs[_0x18a2('0x1a')](_0x562df1[_0x18a2('0x32')][_0x18a2('0x1a')]);}_0x2df574['order']=qs[_0x18a2('0x3b')](_0x562df1[_0x18a2('0x32')]['sort']);_0x2df574[_0x18a2('0x3c')]=qs[_0x18a2('0x34')](_[_0x18a2('0x3d')](_0x562df1[_0x18a2('0x32')],_0x490410[_0x18a2('0x34')]),_0x49f50f);if(_0x562df1['query'][_0x18a2('0x3e')]){_0x2df574[_0x18a2('0x3c')]=_[_0x18a2('0x3f')](_0x2df574[_0x18a2('0x3c')],{'$or':_['map'](_0x49f50f,function(_0x55068a){if(_0x55068a[_0x18a2('0x2f')]!=='VIRTUAL'){var _0x345927={};_0x345927[_0x55068a[_0x18a2('0x28')]]={'$like':'%'+_0x562df1[_0x18a2('0x32')][_0x18a2('0x3e')]+'%'};return _0x345927;}})});}_0x2df574=_[_0x18a2('0x3f')]({},_0x2df574,_0x562df1[_0x18a2('0x40')]);var _0x1124db={'where':_0x2df574['where']};return db[_0x18a2('0x2c')][_0x18a2('0x1d')](_0x1124db)['then'](function(_0x1a8461){_0x266810[_0x18a2('0x1d')]=_0x1a8461;if(_0x562df1['query'][_0x18a2('0x41')]){_0x2df574[_0x18a2('0x42')]=[{'all':!![]}];}return db[_0x18a2('0x2c')][_0x18a2('0x43')](_0x2df574);})['then'](function(_0xa2953){_0x266810['rows']=_0xa2953;return _0x266810;})[_0x18a2('0x25')](respondWithFilteredResult(_0x43a4f8,_0x2df574))[_0x18a2('0x44')](handleError(_0x43a4f8,null));};exports[_0x18a2('0x45')]=function(_0x75e839,_0x3d69b7){var _0x13a032={'raw':!![],'where':{'id':_0x75e839[_0x18a2('0x46')]['id']}},_0x19d8dd={};_0x19d8dd[_0x18a2('0x31')]=_[_0x18a2('0x33')](db[_0x18a2('0x2c')]['rawAttributes']);_0x19d8dd['query']=_[_0x18a2('0x33')](_0x75e839[_0x18a2('0x32')]);_0x19d8dd[_0x18a2('0x34')]=_['intersection'](_0x19d8dd[_0x18a2('0x31')],_0x19d8dd[_0x18a2('0x32')]);_0x13a032[_0x18a2('0x35')]=_[_0x18a2('0x36')](_0x19d8dd[_0x18a2('0x31')],qs[_0x18a2('0x37')](_0x75e839[_0x18a2('0x32')][_0x18a2('0x37')]));_0x13a032[_0x18a2('0x35')]=_0x13a032[_0x18a2('0x35')][_0x18a2('0x38')]?_0x13a032[_0x18a2('0x35')]:_0x19d8dd[_0x18a2('0x31')];if(_0x75e839[_0x18a2('0x32')][_0x18a2('0x41')]){_0x13a032[_0x18a2('0x42')]=[{'all':!![]}];}_0x13a032=_[_0x18a2('0x3f')]({},_0x13a032,_0x75e839[_0x18a2('0x40')]);return db[_0x18a2('0x2c')][_0x18a2('0x47')](_0x13a032)[_0x18a2('0x25')](handleEntityNotFound(_0x3d69b7,null))['then'](respondWithResult(_0x3d69b7,null))['catch'](handleError(_0x3d69b7,null));};exports[_0x18a2('0x24')]=function(_0x57eca3,_0x592add){if(_0x57eca3[_0x18a2('0x48')]['id']){delete _0x57eca3[_0x18a2('0x48')]['id'];}return db[_0x18a2('0x2c')]['find']({'where':{'id':_0x57eca3[_0x18a2('0x46')]['id']}})[_0x18a2('0x25')](handleEntityNotFound(_0x592add,null))[_0x18a2('0x25')](saveUpdates(_0x57eca3['body'],null))[_0x18a2('0x25')](respondWithResult(_0x592add,null))['catch'](handleError(_0x592add,null));};exports[_0x18a2('0x49')]=function(_0x18d02f,_0x2d5b08){return db[_0x18a2('0x2c')][_0x18a2('0x47')]({'where':{'id':_0x18d02f[_0x18a2('0x46')]['id']}})[_0x18a2('0x25')](handleEntityNotFound(_0x2d5b08,null))[_0x18a2('0x25')](removeEntity(_0x2d5b08,null))[_0x18a2('0x44')](handleError(_0x2d5b08,null));};exports[_0x18a2('0x4a')]=function(_0x514a74,_0x18b348){return db[_0x18a2('0x2c')]['describe']()[_0x18a2('0x25')](respondWithResult(_0x18b348,null))[_0x18a2('0x44')](handleError(_0x18b348,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 73fc672..4124db9 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 _0xcfd7=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xcfd7,0x187));var _0x7cfd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfd7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7cfd('0x0'));var util=require(_0x7cfd('0x1'));var logger=require(_0x7cfd('0x2'))(_0x7cfd('0x3'));var moment=require(_0x7cfd('0x4'));var BPromise=require(_0x7cfd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cfd('0x6'));var rimraf=require(_0x7cfd('0x7'));var config=require(_0x7cfd('0x8'));var attributes=require(_0x7cfd('0x9'));module[_0x7cfd('0xa')]=function(_0x5333ad,_0x4be040){return _0x5333ad[_0x7cfd('0xb')](_0x7cfd('0xc'),attributes,{'tableName':_0x7cfd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda0d=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x4ba705,_0x2d23c3){var _0x2fd562=function(_0x4d3d57){while(--_0x4d3d57){_0x4ba705['push'](_0x4ba705['shift']());}};_0x2fd562(++_0x2d23c3);}(_0xda0d,0x1ae));var _0xdda0=function(_0x12ac04,_0x25f852){_0x12ac04=_0x12ac04-0x0;var _0x211e7c=_0xda0d[_0x12ac04];return _0x211e7c;};'use strict';var _=require(_0xdda0('0x0'));var util=require(_0xdda0('0x1'));var logger=require(_0xdda0('0x2'))(_0xdda0('0x3'));var moment=require(_0xdda0('0x4'));var BPromise=require(_0xdda0('0x5'));var rp=require(_0xdda0('0x6'));var fs=require('fs');var path=require(_0xdda0('0x7'));var rimraf=require(_0xdda0('0x8'));var config=require('../../config/environment');var attributes=require(_0xdda0('0x9'));module[_0xdda0('0xa')]=function(_0x16b68d,_0x2e390c){return _0x16b68d[_0xdda0('0xb')](_0xdda0('0xc'),attributes,{'tableName':_0xdda0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 1a10b38..34fd64f 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 _0xca51=['debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','attributes','map','include','model','update','body','where','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','destroy','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x25f2a4,_0x178542){var _0x3d4983=function(_0xacba37){while(--_0xacba37){_0x25f2a4['push'](_0x25f2a4['shift']());}};_0x3d4983(++_0x178542);}(_0xca51,0xb4));var _0x1ca5=function(_0x5a58af,_0x2fd0e0){_0x5a58af=_0x5a58af-0x0;var _0x40b593=_0xca51[_0x5a58af];return _0x40b593;};'use strict';var _=require('lodash');var util=require(_0x1ca5('0x0'));var moment=require(_0x1ca5('0x1'));var BPromise=require(_0x1ca5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ca5('0x3'));var db=require(_0x1ca5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1ca5('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ca5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x121abc,_0x4705f1,_0x21efe5){return new BPromise(function(_0x19eae6,_0x4ba4ff){return client[_0x1ca5('0x7')](_0x121abc,_0x21efe5)[_0x1ca5('0x8')](function(_0x44790a){logger[_0x1ca5('0x9')](_0x1ca5('0xa'),_0x4705f1,_0x1ca5('0xb'));logger[_0x1ca5('0xc')](_0x1ca5('0xd'),_0x4705f1,'request\x20sent',JSON['stringify'](_0x44790a));if(_0x44790a[_0x1ca5('0xe')]){if(_0x44790a[_0x1ca5('0xe')]['code']===0x1f4){logger[_0x1ca5('0xe')](_0x1ca5('0xa'),_0x4705f1,_0x44790a['error'][_0x1ca5('0xf')]);return _0x4ba4ff(_0x44790a[_0x1ca5('0xe')]['message']);}logger['error'](_0x1ca5('0xa'),_0x4705f1,_0x44790a['error'][_0x1ca5('0xf')]);return _0x19eae6(_0x44790a[_0x1ca5('0xe')]['message']);}else{logger[_0x1ca5('0x9')](_0x1ca5('0xa'),_0x4705f1,_0x1ca5('0xb'));_0x19eae6(_0x44790a[_0x1ca5('0x10')][_0x1ca5('0xf')]);}})[_0x1ca5('0x11')](function(_0x573f71){logger[_0x1ca5('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x4705f1,_0x573f71);_0x4ba4ff(_0x573f71);});});}exports[_0x1ca5('0x12')]=function(_0x36cab1){var _0x5d1459=this;return new Promise(function(_0x254b88,_0x1f6d0d){return db[_0x1ca5('0x13')]['findAll']({'raw':_0x36cab1[_0x1ca5('0x14')]?_0x36cab1[_0x1ca5('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x36cab1['options']?_0x36cab1[_0x1ca5('0x14')]['where']||null:null,'attributes':_0x36cab1[_0x1ca5('0x14')]?_0x36cab1['options'][_0x1ca5('0x15')]||null:null,'limit':_0x36cab1[_0x1ca5('0x14')]?_0x36cab1[_0x1ca5('0x14')]['limit']||null:null,'include':_0x36cab1[_0x1ca5('0x14')]?_0x36cab1['options']['include']?_[_0x1ca5('0x16')](_0x36cab1[_0x1ca5('0x14')][_0x1ca5('0x17')],function(_0x3c90b9){return{'model':db[_0x3c90b9[_0x1ca5('0x18')]],'as':_0x3c90b9['as'],'attributes':_0x3c90b9['attributes'],'include':_0x3c90b9[_0x1ca5('0x17')]?_[_0x1ca5('0x16')](_0x3c90b9[_0x1ca5('0x17')],function(_0x598781){return{'model':db[_0x598781[_0x1ca5('0x18')]],'as':_0x598781['as'],'attributes':_0x598781[_0x1ca5('0x15')],'include':_0x598781[_0x1ca5('0x17')]?_[_0x1ca5('0x16')](_0x598781['include'],function(_0x15ecb4){return{'model':db[_0x15ecb4[_0x1ca5('0x18')]],'as':_0x15ecb4['as'],'attributes':_0x15ecb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ca5('0x8')](function(_0x8ca2b){logger[_0x1ca5('0x9')](_0x1ca5('0x12'),_0x36cab1);logger['debug'](_0x1ca5('0x12'),_0x36cab1,JSON['stringify'](_0x8ca2b));_0x254b88(_0x8ca2b);})[_0x1ca5('0x11')](function(_0x1d56ad){logger[_0x1ca5('0xe')](_0x1ca5('0x12'),_0x1d56ad[_0x1ca5('0xf')],_0x36cab1);_0x1f6d0d(_0x5d1459[_0x1ca5('0xe')](0x1f4,_0x1d56ad[_0x1ca5('0xf')]));});});};exports['UpdateCmHopperBlack']=function(_0x4cae5a){var _0xbcc9d=this;return new Promise(function(_0x2668d4,_0x4ee460){return db[_0x1ca5('0x13')][_0x1ca5('0x19')](_0x4cae5a[_0x1ca5('0x1a')],{'raw':_0x4cae5a['options']?_0x4cae5a[_0x1ca5('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cae5a[_0x1ca5('0x14')]?_0x4cae5a[_0x1ca5('0x14')][_0x1ca5('0x1b')]||null:null,'attributes':_0x4cae5a['options']?_0x4cae5a[_0x1ca5('0x14')][_0x1ca5('0x15')]||null:null,'limit':_0x4cae5a[_0x1ca5('0x14')]?_0x4cae5a[_0x1ca5('0x14')]['limit']||null:null})[_0x1ca5('0x8')](function(_0x3a7489){logger['info']('UpdateCmHopperBlack',_0x4cae5a);logger[_0x1ca5('0xc')](_0x1ca5('0x1c'),_0x4cae5a,JSON[_0x1ca5('0x1d')](_0x3a7489));_0x2668d4(_0x3a7489);})[_0x1ca5('0x11')](function(_0x24b7f0){logger[_0x1ca5('0xe')](_0x1ca5('0x1c'),_0x24b7f0[_0x1ca5('0xf')],_0x4cae5a);_0x4ee460(_0xbcc9d[_0x1ca5('0xe')](0x1f4,_0x24b7f0[_0x1ca5('0xf')]));});});};exports[_0x1ca5('0x1e')]=function(_0x4fb771){var _0x182074=this;return new Promise(function(_0x1bdb7b,_0x2a8613){return db[_0x1ca5('0x13')][_0x1ca5('0x1f')]({'where':_0x4fb771[_0x1ca5('0x14')]?_0x4fb771[_0x1ca5('0x14')][_0x1ca5('0x1b')]||null:null})[_0x1ca5('0x8')](function(_0x12c242){logger[_0x1ca5('0x9')]('DestroyCmHopperBlack',_0x4fb771);logger['debug'](_0x1ca5('0x1e'),_0x4fb771,JSON['stringify'](_0x12c242));_0x1bdb7b(_0x12c242);})[_0x1ca5('0x11')](function(_0x3ad4df){logger[_0x1ca5('0xe')](_0x1ca5('0x1e'),_0x3ad4df[_0x1ca5('0xf')],_0x4fb771);_0x2a8613(_0x182074[_0x1ca5('0xe')](0x1f4,_0x3ad4df[_0x1ca5('0xf')]));});});}; \ No newline at end of file +var _0xddb7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','lodash','util'];(function(_0x100b55,_0x3b4c99){var _0x26608e=function(_0x464f82){while(--_0x464f82){_0x100b55['push'](_0x100b55['shift']());}};_0x26608e(++_0x3b4c99);}(_0xddb7,0x6a));var _0x7ddb=function(_0x41599f,_0x394e48){_0x41599f=_0x41599f-0x0;var _0x573ee8=_0xddb7[_0x41599f];return _0x573ee8;};'use strict';var _=require(_0x7ddb('0x0'));var util=require(_0x7ddb('0x1'));var moment=require(_0x7ddb('0x2'));var BPromise=require(_0x7ddb('0x3'));var rs=require(_0x7ddb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ddb('0x5'))['db'];var utils=require(_0x7ddb('0x6'));var logger=require(_0x7ddb('0x7'))(_0x7ddb('0x8'));var config=require(_0x7ddb('0x9'));var jayson=require(_0x7ddb('0xa'));var client=jayson[_0x7ddb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edd29,_0x201ca0,_0x55875a){return new BPromise(function(_0x5475b7,_0x3ab078){return client[_0x7ddb('0xc')](_0x2edd29,_0x55875a)[_0x7ddb('0xd')](function(_0x3a69d3){logger[_0x7ddb('0xe')](_0x7ddb('0xf'),_0x201ca0,'request\x20sent');logger[_0x7ddb('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x201ca0,_0x7ddb('0x11'),JSON[_0x7ddb('0x12')](_0x3a69d3));if(_0x3a69d3['error']){if(_0x3a69d3[_0x7ddb('0x13')][_0x7ddb('0x14')]===0x1f4){logger[_0x7ddb('0x13')](_0x7ddb('0xf'),_0x201ca0,_0x3a69d3[_0x7ddb('0x13')]['message']);return _0x3ab078(_0x3a69d3[_0x7ddb('0x13')]['message']);}logger['error'](_0x7ddb('0xf'),_0x201ca0,_0x3a69d3['error'][_0x7ddb('0x15')]);return _0x5475b7(_0x3a69d3['error'][_0x7ddb('0x15')]);}else{logger[_0x7ddb('0xe')](_0x7ddb('0xf'),_0x201ca0,_0x7ddb('0x11'));_0x5475b7(_0x3a69d3['result'][_0x7ddb('0x15')]);}})[_0x7ddb('0x16')](function(_0x27a159){logger[_0x7ddb('0x13')](_0x7ddb('0xf'),_0x201ca0,_0x27a159);_0x3ab078(_0x27a159);});});}exports[_0x7ddb('0x17')]=function(_0x3fc7e7){var _0x52ea36=this;return new Promise(function(_0x322f02,_0xedf522){return db[_0x7ddb('0x18')]['findAll']({'raw':_0x3fc7e7['options']?_0x3fc7e7[_0x7ddb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3fc7e7[_0x7ddb('0x19')]?_0x3fc7e7[_0x7ddb('0x19')][_0x7ddb('0x1a')]||null:null,'attributes':_0x3fc7e7[_0x7ddb('0x19')]?_0x3fc7e7[_0x7ddb('0x19')][_0x7ddb('0x1b')]||null:null,'limit':_0x3fc7e7[_0x7ddb('0x19')]?_0x3fc7e7[_0x7ddb('0x19')][_0x7ddb('0x1c')]||null:null,'include':_0x3fc7e7[_0x7ddb('0x19')]?_0x3fc7e7[_0x7ddb('0x19')][_0x7ddb('0x1d')]?_[_0x7ddb('0x1e')](_0x3fc7e7['options']['include'],function(_0x1ccdcf){return{'model':db[_0x1ccdcf[_0x7ddb('0x1f')]],'as':_0x1ccdcf['as'],'attributes':_0x1ccdcf[_0x7ddb('0x1b')],'include':_0x1ccdcf[_0x7ddb('0x1d')]?_[_0x7ddb('0x1e')](_0x1ccdcf[_0x7ddb('0x1d')],function(_0x33c40f){return{'model':db[_0x33c40f[_0x7ddb('0x1f')]],'as':_0x33c40f['as'],'attributes':_0x33c40f[_0x7ddb('0x1b')],'include':_0x33c40f[_0x7ddb('0x1d')]?_['map'](_0x33c40f['include'],function(_0x64daf7){return{'model':db[_0x64daf7[_0x7ddb('0x1f')]],'as':_0x64daf7['as'],'attributes':_0x64daf7[_0x7ddb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7ddb('0xd')](function(_0x4e50e9){logger[_0x7ddb('0xe')](_0x7ddb('0x17'),_0x3fc7e7);logger[_0x7ddb('0x10')]('GetCmHopperBlack',_0x3fc7e7,JSON[_0x7ddb('0x12')](_0x4e50e9));_0x322f02(_0x4e50e9);})[_0x7ddb('0x16')](function(_0x2e7a09){logger[_0x7ddb('0x13')](_0x7ddb('0x17'),_0x2e7a09[_0x7ddb('0x15')],_0x3fc7e7);_0xedf522(_0x52ea36[_0x7ddb('0x13')](0x1f4,_0x2e7a09['message']));});});};exports[_0x7ddb('0x20')]=function(_0x167566){var _0x4fe70d=this;return new Promise(function(_0x105905,_0x8ba929){return db['CmHopperBlack'][_0x7ddb('0x21')](_0x167566['body'],{'raw':_0x167566[_0x7ddb('0x19')]?_0x167566[_0x7ddb('0x19')][_0x7ddb('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167566[_0x7ddb('0x19')]?_0x167566[_0x7ddb('0x19')][_0x7ddb('0x1a')]||null:null,'attributes':_0x167566[_0x7ddb('0x19')]?_0x167566[_0x7ddb('0x19')]['attributes']||null:null,'limit':_0x167566['options']?_0x167566[_0x7ddb('0x19')][_0x7ddb('0x1c')]||null:null})['then'](function(_0x29e43b){logger[_0x7ddb('0xe')]('UpdateCmHopperBlack',_0x167566);logger[_0x7ddb('0x10')](_0x7ddb('0x20'),_0x167566,JSON['stringify'](_0x29e43b));_0x105905(_0x29e43b);})[_0x7ddb('0x16')](function(_0x4e3c93){logger['error'](_0x7ddb('0x20'),_0x4e3c93[_0x7ddb('0x15')],_0x167566);_0x8ba929(_0x4fe70d[_0x7ddb('0x13')](0x1f4,_0x4e3c93[_0x7ddb('0x15')]));});});};exports[_0x7ddb('0x23')]=function(_0x4b73d8){var _0x20c078=this;return new Promise(function(_0xc7fe6d,_0x1a15ea){return db['CmHopperBlack']['destroy']({'where':_0x4b73d8[_0x7ddb('0x19')]?_0x4b73d8[_0x7ddb('0x19')][_0x7ddb('0x1a')]||null:null})[_0x7ddb('0xd')](function(_0x1e047){logger['info'](_0x7ddb('0x23'),_0x4b73d8);logger[_0x7ddb('0x10')](_0x7ddb('0x23'),_0x4b73d8,JSON[_0x7ddb('0x12')](_0x1e047));_0xc7fe6d(_0x1e047);})[_0x7ddb('0x16')](function(_0x1723c9){logger[_0x7ddb('0x13')](_0x7ddb('0x23'),_0x1723c9[_0x7ddb('0x15')],_0x4b73d8);_0x1a15ea(_0x20c078['error'](0x1f4,_0x1723c9[_0x7ddb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 1a664e0..2f78acf 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 _0x2ef3=['describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x5f46af,_0x44a02b){var _0x4917=function(_0x91f18e){while(--_0x91f18e){_0x5f46af['push'](_0x5f46af['shift']());}};_0x4917(++_0x44a02b);}(_0x2ef3,0xba));var _0x32ef=function(_0x5da1c2,_0x499952){_0x5da1c2=_0x5da1c2-0x0;var _0x3d2fce=_0x2ef3[_0x5da1c2];return _0x3d2fce;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x32ef('0x10')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9fd4=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x1dea1a,_0x3e7df7){var _0x5967c2=function(_0xa84a6d){while(--_0xa84a6d){_0x1dea1a['push'](_0x1dea1a['shift']());}};_0x5967c2(++_0x3e7df7);}(_0x9fd4,0x16c));var _0x49fd=function(_0x37bed5,_0x4fcea4){_0x37bed5=_0x37bed5-0x0;var _0xfd86c3=_0x9fd4[_0x37bed5];return _0xfd86c3;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/describe',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['show']);router[_0x49fd('0xe')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['destroy']);module[_0x49fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 25d6169..ff61d12 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 _0xacc8=['DATE','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0xcfd2f3,_0x3d9f03){var _0x28ff04=function(_0xfe9cc8){while(--_0xfe9cc8){_0xcfd2f3['push'](_0xcfd2f3['shift']());}};_0x28ff04(++_0x3d9f03);}(_0xacc8,0xed));var _0x8acc=function(_0x4f9c46,_0x361afe){_0x4f9c46=_0x4f9c46-0x0;var _0x155365=_0xacc8[_0x4f9c46];return _0x155365;};'use strict';var Sequelize=require(_0x8acc('0x0'));var moment=require(_0x8acc('0x1'));module[_0x8acc('0x2')]={'state':{'type':Sequelize[_0x8acc('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8acc('0x4')]},'scheduledat':{'type':Sequelize[_0x8acc('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x8acc('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8acc('0x4')]},'calleridnum':{'type':Sequelize[_0x8acc('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8acc('0x5')]},'responsetime':{'type':Sequelize[_0x8acc('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8acc('0x5')]},'endtime':{'type':Sequelize[_0x8acc('0x5')]},'ringtime':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x8acc('0x4')]},'campaigntype':{'type':Sequelize[_0x8acc('0x4')]},'membername':{'type':Sequelize[_0x8acc('0x4')]},'reason':{'type':Sequelize[_0x8acc('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8acc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8acc('0x4')]},'dispositionat':{'type':Sequelize[_0x8acc('0x5')],'set':function(_0xd37993){var _0xfbacff=this['getDataValue'](_0x8acc('0x6'));if(_0xfbacff&&_0xd37993){this[_0x8acc('0x7')](_0x8acc('0x8'),moment(_0xd37993)['diff'](moment(_0xfbacff),_0x8acc('0x9')));}}},'amd':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8acc('0x5')]},'callback':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8acc('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8acc('0x5')]},'deleted':{'type':Sequelize[_0x8acc('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8acc('0x5')]},'recallme':{'type':Sequelize[_0x8acc('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8acc('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8acc('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e47=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','followuptime','seconds'];(function(_0x3c6741,_0x24c6f0){var _0x5d3310=function(_0x504ffb){while(--_0x504ffb){_0x3c6741['push'](_0x3c6741['shift']());}};_0x5d3310(++_0x24c6f0);}(_0x6e47,0x14e));var _0x76e4=function(_0x2c74ed,_0x2e4c92){_0x2c74ed=_0x2c74ed-0x0;var _0x29e21b=_0x6e47[_0x2c74ed];return _0x29e21b;};'use strict';var Sequelize=require(_0x76e4('0x0'));var moment=require('moment');module[_0x76e4('0x1')]={'state':{'type':Sequelize[_0x76e4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x76e4('0x3')]},'scheduledat':{'type':Sequelize[_0x76e4('0x4')]},'countbusyretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x76e4('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76e4('0x4')]},'responsetime':{'type':Sequelize[_0x76e4('0x4')]},'answertime':{'type':Sequelize[_0x76e4('0x4')]},'droptime':{'type':Sequelize[_0x76e4('0x4')]},'endtime':{'type':Sequelize[_0x76e4('0x4')]},'ringtime':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x76e4('0x3')]},'campaign':{'type':Sequelize[_0x76e4('0x3')]},'campaigntype':{'type':Sequelize[_0x76e4('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x76e4('0x3')]},'disposition':{'type':Sequelize[_0x76e4('0x3')]},'secondDisposition':{'type':Sequelize[_0x76e4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x76e4('0x4')],'set':function(_0x247244){var _0x3395a8=this[_0x76e4('0x5')]('endtime');if(_0x3395a8&&_0x247244){this['setDataValue'](_0x76e4('0x6'),moment(_0x247244)['diff'](moment(_0x3395a8),_0x76e4('0x7')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x76e4('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x76e4('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x76e4('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x76e4('0x4')]},'callback':{'type':Sequelize[_0x76e4('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x76e4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x76e4('0x4')]},'deleted':{'type':Sequelize[_0x76e4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x76e4('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e94c7ca..a030709 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 _0xbd51=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','describe','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x208,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt'];(function(_0x5983b1,_0x3649c3){var _0x570598=function(_0x42a989){while(--_0x42a989){_0x5983b1['push'](_0x5983b1['shift']());}};_0x570598(++_0x3649c3);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x47e995,_0x445e70){_0x47e995=_0x47e995-0x0;var _0x371b0f=_0xbd51[_0x47e995];return _0x371b0f;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')]()[_0x1bd5('0x40')](respondWithResult(_0xe71454,null))[_0x1bd5('0x48')](handleError(_0xe71454,null));};exports['update']=function(_0x13985e,_0x227a68){if(_0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')]){delete _0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')];}return db['CmHopperFinal'][_0x1bd5('0x4c')]({'where':{'uniqueid':_0x13985e[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x227a68,null))[_0x1bd5('0x40')](saveUpdates(_0x13985e[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x227a68,null))[_0x1bd5('0x48')](handleError(_0x227a68,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x587c46,_0x126221,_0x2d713b){return db[_0x1bd5('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x587c46[_0x1bd5('0x45')]['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x51')))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x52')))),_0x1bd5('0x53')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x1bd5('0x54')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x55')))),_0x1bd5('0x56')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),_0x1bd5('0x58')],[db['sequelize']['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),'reCallContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x126221,null))['then'](respondWithResult(_0x126221,null))['catch'](handleError(_0x126221,null));};exports[_0x1bd5('0x5c')]=function(_0xec9fac,_0x1790af,_0x54a8c4){return db['CmHopperFinal'][_0x1bd5('0x5d')]({'raw':![],'where':{'CampaignId':_0xec9fac['params']['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5e')))),'congestionContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x55')))),'dropContacts'],[db[_0x1bd5('0x4d')]['fn']('COUNT',db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),'abandonedContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),_0x1bd5('0x5f')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x1790af,null))[_0x1bd5('0x40')](respondWithResult(_0x1790af,null))[_0x1bd5('0x48')](handleError(_0x1790af,null));};exports[_0x1bd5('0x60')]=function(_0x195176,_0x393a8f,_0x1ffbab){return db[_0x1bd5('0x61')][_0x1bd5('0x4c')]({'where':{'id':_0x195176[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x393a8f,null))['then'](function(_0x3bd058){var _0x1d6223;if(_0x3bd058){_0x1d6223=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),'scheduledAt',_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x69'),_0x1bd5('0x6a'),'updatedAt'],squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),'ContactId')['field'](_0x1bd5('0x71'),'ListId')[_0x1bd5('0x6c')](_0x1bd5('0x72'),'VoiceQueueId')[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x73'))['from'](_0x1bd5('0x74'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x195176[_0x1bd5('0x4a')][_0x1bd5('0x77')][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()['field'](_0x1bd5('0x66'))[_0x1bd5('0x7a')](_0x1bd5('0x64'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')['from']('cm_hopper_final')[_0x1bd5('0x39')]('VoiceQueueId\x20=\x20?',_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')](_0x1bd5('0x7c')))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db['sequelize'][_0x1bd5('0x2f')](_0x1d6223);}return[];})['then'](respondWithResult(_0x393a8f,null))[_0x1bd5('0x48')](handleError(_0x393a8f,null));};exports[_0x1bd5('0x7e')]=function(_0x7d097,_0x50f2ac,_0x5db61c){return db[_0x1bd5('0x7f')]['find']({'where':{'id':_0x7d097[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x50f2ac,null))[_0x1bd5('0x40')](function(_0x16f996){var _0x248d66;if(_0x16f996){_0x248d66=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),_0x1bd5('0x6f'),_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x80'),_0x1bd5('0x6a'),_0x1bd5('0x73')],squel['select']()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),_0x1bd5('0x67'))[_0x1bd5('0x6c')]('ANY_VALUE(ListId)',_0x1bd5('0x68'))[_0x1bd5('0x6c')](_0x1bd5('0x81'),_0x1bd5('0x80'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')]('NOW()',_0x1bd5('0x73'))[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x7d097['body']['state'][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))[_0x1bd5('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x66'))['from'](_0x1bd5('0x64'))['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')]('state\x20=\x204'))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db[_0x1bd5('0x4d')][_0x1bd5('0x2f')](_0x248d66);}return[];})[_0x1bd5('0x40')](respondWithResult(_0x50f2ac,null))[_0x1bd5('0x48')](handleError(_0x50f2ac,null));};exports[_0x1bd5('0x83')]=function(_0x22e1f4,_0x347d06,_0x3cf023){return db[_0x1bd5('0x84')][_0x1bd5('0x85')]({'where':{'VoiceQueueId':_0x22e1f4[_0x1bd5('0x4a')]['VoiceQueueId'],'CampaignId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x80')],'ContactId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x67')]}})[_0x1bd5('0x40')](handleEntityNotFound(_0x347d06,null))[_0x1bd5('0x40')](function(_0x28f567){if(_0x28f567){return _0x28f567;}return null;})[_0x1bd5('0x40')](respondWithResult(_0x347d06,null))[_0x1bd5('0x48')](handleError(_0x347d06,null));}; \ No newline at end of file +var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../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','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x5d17,0x114));var _0x75d1=function(_0x158876,_0x8600fe){_0x158876=_0x158876-0x0;var _0x51c285=_0x5d17[_0x158876];return _0x51c285;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1b29800..2e2eed7 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 _0x7a5c=['../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x7a5c,0x1d8));var _0xc7a5=function(_0x382a9c,_0x2ba948){_0x382a9c=_0x382a9c-0x0;var _0x1043ac=_0x7a5c[_0x382a9c];return _0x1043ac;};'use strict';var _=require(_0xc7a5('0x0'));var util=require('util');var logger=require(_0xc7a5('0x1'))('api');var moment=require(_0xc7a5('0x2'));var BPromise=require(_0xc7a5('0x3'));var rp=require(_0xc7a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc7a5('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0xc7a5('0x6')]=function(_0x1ee510,_0x44dee4){return _0x1ee510[_0xc7a5('0x7')]('CmHopperFinal',attributes,{'tableName':_0xc7a5('0x8'),'paranoid':![],'indexes':[{'name':_0xc7a5('0x9'),'fields':[_0xc7a5('0x9')]},{'name':'uniqueid','fields':[_0xc7a5('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9eab=['bluebird','path','rimraf','../../config/environment','define','calleridnum','uniqueid','lodash','util','api'];(function(_0x5895e2,_0x57816c){var _0x3ebdd2=function(_0x17e4b8){while(--_0x17e4b8){_0x5895e2['push'](_0x5895e2['shift']());}};_0x3ebdd2(++_0x57816c);}(_0x9eab,0x183));var _0xb9ea=function(_0x1590c4,_0x2186b0){_0x1590c4=_0x1590c4-0x0;var _0x1c728a=_0x9eab[_0x1590c4];return _0x1c728a;};'use strict';var _=require(_0xb9ea('0x0'));var util=require(_0xb9ea('0x1'));var logger=require('../../config/logger')(_0xb9ea('0x2'));var moment=require('moment');var BPromise=require(_0xb9ea('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9ea('0x4'));var rimraf=require(_0xb9ea('0x5'));var config=require(_0xb9ea('0x6'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x28a52b,_0x445657){return _0x28a52b[_0xb9ea('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xb9ea('0x8'),'fields':[_0xb9ea('0x8')]},{'name':_0xb9ea('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 8593e69..94d6fce 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(_0x5a5a6c,_0x590506){var _0x76b539=function(_0x5749e0){while(--_0x5749e0){_0x5a5a6c['push'](_0x5a5a6c['shift']());}};_0x76b539(++_0x590506);}(_0xb10b,0x12a));var _0xbb10=function(_0x53e4fd,_0xe40fa8){_0x53e4fd=_0x53e4fd-0x0;var _0x4df112=_0xb10b[_0x53e4fd];return _0x4df112;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x381d21,_0x25471a){var _0x54a3a3=function(_0x1abbbd){while(--_0x1abbbd){_0x381d21['push'](_0x381d21['shift']());}};_0x54a3a3(++_0x25471a);}(_0xb10b,0x12a));var _0xbb10=function(_0xb260f8,_0xc008c5){_0xb260f8=_0xb260f8-0x0;var _0x63096d=_0xb10b[_0xb260f8];return _0x63096d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d2bebd8..f398e4a 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 _0xff89=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer'];(function(_0x299c35,_0x2cef34){var _0x17e51d=function(_0x3bd9e4){while(--_0x3bd9e4){_0x299c35['push'](_0x299c35['shift']());}};_0x17e51d(++_0x2cef34);}(_0xff89,0x149));var _0x9ff8=function(_0x37b764,_0x309845){_0x37b764=_0x37b764-0x0;var _0x35a1ef=_0xff89[_0x37b764];return _0x35a1ef;};'use strict';var multer=require(_0x9ff8('0x0'));var util=require(_0x9ff8('0x1'));var path=require(_0x9ff8('0x2'));var timeout=require(_0x9ff8('0x3'));var express=require(_0x9ff8('0x4'));var router=express[_0x9ff8('0x5')]();var fs_extra=require(_0x9ff8('0x6'));var auth=require(_0x9ff8('0x7'));var interaction=require(_0x9ff8('0x8'));var config=require(_0x9ff8('0x9'));var controller=require(_0x9ff8('0xa'));router[_0x9ff8('0xb')]('/',auth['isAuthenticated'](),controller[_0x9ff8('0xc')]);router[_0x9ff8('0xb')](_0x9ff8('0xd'),auth['isAuthenticated'](),controller[_0x9ff8('0xe')]);router[_0x9ff8('0xb')](_0x9ff8('0xf'),auth[_0x9ff8('0x10')](),controller[_0x9ff8('0x11')]);router[_0x9ff8('0xb')](_0x9ff8('0x12'),auth[_0x9ff8('0x10')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x9ff8('0xb')](_0x9ff8('0x13'),auth[_0x9ff8('0x10')](),controller[_0x9ff8('0x14')]);router['post'](_0x9ff8('0x15'),auth[_0x9ff8('0x10')](),controller[_0x9ff8('0x16')]);router['post'](_0x9ff8('0x17'),auth[_0x9ff8('0x10')](),controller[_0x9ff8('0x18')]);router['post'](_0x9ff8('0x19'),auth['isAuthenticated'](),controller[_0x9ff8('0x1a')]);router[_0x9ff8('0x1b')](_0x9ff8('0xf'),auth['isAuthenticated'](),controller[_0x9ff8('0x1c')]);module[_0x9ff8('0x1d')]=router; \ No newline at end of file +var _0x020c=['get','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','index'];(function(_0x910989,_0x2abee0){var _0x5d49df=function(_0x11d3bc){while(--_0x11d3bc){_0x910989['push'](_0x910989['shift']());}};_0x5d49df(++_0x2abee0);}(_0x020c,0xf8));var _0xc020=function(_0x4ff3d1,_0x15c737){_0x4ff3d1=_0x4ff3d1-0x0;var _0x32af0c=_0x020c[_0x4ff3d1];return _0x32af0c;};'use strict';var multer=require(_0xc020('0x0'));var util=require(_0xc020('0x1'));var path=require(_0xc020('0x2'));var timeout=require(_0xc020('0x3'));var express=require(_0xc020('0x4'));var router=express[_0xc020('0x5')]();var fs_extra=require(_0xc020('0x6'));var auth=require(_0xc020('0x7'));var interaction=require(_0xc020('0x8'));var config=require(_0xc020('0x9'));var controller=require(_0xc020('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc020('0xb')]);router[_0xc020('0xc')](_0xc020('0xd'),auth[_0xc020('0xe')](),controller[_0xc020('0xf')]);router[_0xc020('0xc')](_0xc020('0x10'),auth['isAuthenticated'](),controller[_0xc020('0x11')]);router[_0xc020('0xc')](_0xc020('0x12'),auth[_0xc020('0xe')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xc020('0xc')](_0xc020('0x13'),auth[_0xc020('0xe')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xc020('0x14')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xc020('0x14')](_0xc020('0x15'),auth[_0xc020('0xe')](),controller[_0xc020('0x16')]);router[_0xc020('0x14')](_0xc020('0x17'),auth['isAuthenticated'](),controller['checkContactHopper']);router['put']('/:id',auth[_0xc020('0xe')](),controller[_0xc020('0x18')]);module[_0xc020('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2d50018..c18eda6 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 _0x62b8=['STRING','INTEGER','DATE','BOOLEAN','sequelize','exports'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x62b8,0x142));var _0x862b=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x62b8[_0x207a02];return _0xd995c3;};'use strict';var Sequelize=require(_0x862b('0x0'));module[_0x862b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x862b('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x862b('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x862b('0x2')]},'calleridnum':{'type':Sequelize[_0x862b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x862b('0x4')]},'responsetime':{'type':Sequelize[_0x862b('0x4')]},'answertime':{'type':Sequelize[_0x862b('0x4')]},'droptime':{'type':Sequelize[_0x862b('0x4')]},'endtime':{'type':Sequelize[_0x862b('0x4')]},'ringtime':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x862b('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x862b('0x2')]},'membername':{'type':Sequelize[_0x862b('0x2')]},'reason':{'type':Sequelize[_0x862b('0x2')]},'amd':{'type':Sequelize[_0x862b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x862b('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x862b('0x4')]},'edited':{'type':Sequelize[_0x862b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x862b('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c4a=['STRING','BOOLEAN','sequelize','exports','INTEGER','DATE'];(function(_0x4d35fe,_0x3ba8f7){var _0x10e0d7=function(_0x484439){while(--_0x484439){_0x4d35fe['push'](_0x4d35fe['shift']());}};_0x10e0d7(++_0x3ba8f7);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x47434e,_0x2b6808){_0x47434e=_0x47434e-0x0;var _0xb964a8=_0x4c4a[_0x47434e];return _0xb964a8;};'use strict';var Sequelize=require(_0xa4c4('0x0'));module[_0xa4c4('0x1')]={'state':{'type':Sequelize[_0xa4c4('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xa4c4('0x3')]},'countbusyretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa4c4('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa4c4('0x4')]},'calleridnum':{'type':Sequelize[_0xa4c4('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa4c4('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xa4c4('0x3')]},'endtime':{'type':Sequelize[_0xa4c4('0x3')]},'ringtime':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa4c4('0x4')]},'campaign':{'type':Sequelize[_0xa4c4('0x4')]},'campaigntype':{'type':Sequelize[_0xa4c4('0x4')]},'membername':{'type':Sequelize[_0xa4c4('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xa4c4('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xa4c4('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa4c4('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa4c4('0x3')]},'recallme':{'type':Sequelize[_0xa4c4('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa4c4('0x3')]},'edited':{'type':Sequelize[_0xa4c4('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa4c4('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa4c4('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index dd79596..ed3b5a9 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 _0x9552=['../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','update','uniqueid','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x4e508d,_0x201941){var _0x41bef2=function(_0x1571c1){while(--_0x1571c1){_0x4e508d['push'](_0x4e508d['shift']());}};_0x41bef2(++_0x201941);}(_0x9552,0x166));var _0x2955=function(_0x23fe52,_0x522b22){_0x23fe52=_0x23fe52-0x0;var _0x37cdcb=_0x9552[_0x23fe52];return _0x37cdcb;};'use strict';var emlformat=require(_0x2955('0x0'));var rimraf=require(_0x2955('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2955('0x2'));var rp=require('request-promise');var moment=require(_0x2955('0x3'));var BPromise=require(_0x2955('0x4'));var Mustache=require(_0x2955('0x5'));var util=require('util');var path=require(_0x2955('0x6'));var sox=require(_0x2955('0x7'));var csv=require('to-csv');var ejs=require(_0x2955('0x8'));var fs=require('fs');var fs_extra=require(_0x2955('0x9'));var _=require(_0x2955('0xa'));var squel=require(_0x2955('0xb'));var crypto=require(_0x2955('0xc'));var jsforce=require(_0x2955('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2955('0xe'));var querystring=require(_0x2955('0xf'));var Papa=require(_0x2955('0x10'));var Redis=require('ioredis');var authService=require(_0x2955('0x11'));var qs=require(_0x2955('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2955('0x13'))('api');var utils=require(_0x2955('0x14'));var config=require(_0x2955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2955('0x16'))['db'];function respondWithStatusCode(_0x33aebf,_0xdc4b47){_0xdc4b47=_0xdc4b47||0xcc;return function(_0x276e6a){if(_0x276e6a){return _0x33aebf[_0x2955('0x17')](_0xdc4b47);}return _0x33aebf[_0x2955('0x18')](_0xdc4b47)[_0x2955('0x19')]();};}function respondWithResult(_0x22c433,_0x349ff5){_0x349ff5=_0x349ff5||0xc8;return function(_0x11a828){if(_0x11a828){return _0x22c433[_0x2955('0x18')](_0x349ff5)['json'](_0x11a828);}};}function respondWithFilteredResult(_0x3d26d3,_0x285b14){return function(_0x5859a1){if(_0x5859a1){var _0x406efd=typeof _0x285b14[_0x2955('0x1a')]==='undefined'&&typeof _0x285b14[_0x2955('0x1b')]===_0x2955('0x1c');var _0x24f1f4=_0x5859a1[_0x2955('0x1d')];var _0x6c7855=_0x406efd?0x0:_0x285b14[_0x2955('0x1a')];var _0x3fc854=_0x406efd?_0x5859a1[_0x2955('0x1d')]:_0x285b14[_0x2955('0x1a')]+_0x285b14[_0x2955('0x1b')];var _0x5e2984;if(_0x3fc854>=_0x24f1f4){_0x3fc854=_0x24f1f4;_0x5e2984=0xc8;}else{_0x5e2984=0xce;}_0x3d26d3[_0x2955('0x18')](_0x5e2984);return _0x3d26d3[_0x2955('0x1e')]('Content-Range',_0x6c7855+'-'+_0x3fc854+'/'+_0x24f1f4)[_0x2955('0x1f')](_0x5859a1);}return null;};}function patchUpdates(_0x4d9f1b){return function(_0x328553){try{jsonpatch[_0x2955('0x20')](_0x328553,_0x4d9f1b,!![]);}catch(_0x216d34){return BPromise[_0x2955('0x21')](_0x216d34);}return _0x328553['save']();};}function saveUpdates(_0x41608d,_0x957dfe){return function(_0x57fef8){if(_0x57fef8){return _0x57fef8['update'](_0x41608d)[_0x2955('0x22')](function(_0x2ee8d6){return _0x2ee8d6;});}return null;};}function removeEntity(_0x29768d,_0x2d795f){return function(_0x59a538){if(_0x59a538){return _0x59a538[_0x2955('0x23')]()[_0x2955('0x22')](function(){_0x29768d[_0x2955('0x18')](0xcc)[_0x2955('0x19')]();});}};}function handleEntityNotFound(_0x1dd947,_0x38c356){return function(_0x29e1bf){if(!_0x29e1bf){_0x1dd947[_0x2955('0x17')](0x194);}return _0x29e1bf;};}function handleError(_0x504be8,_0x4b33d6){_0x4b33d6=_0x4b33d6||0x1f4;return function(_0x969175){logger[_0x2955('0x24')](_0x969175[_0x2955('0x25')]);if(_0x969175[_0x2955('0x26')]){delete _0x969175[_0x2955('0x26')];}_0x504be8[_0x2955('0x18')](_0x4b33d6)[_0x2955('0x27')](_0x969175);};}exports[_0x2955('0x28')]=function(_0x2e3aa5,_0x45eb15){var _0x492aad={},_0x565306={},_0x5cf947={'count':0x0,'rows':[]};var _0x35b88a=_['map'](db[_0x2955('0x29')][_0x2955('0x2a')],function(_0x5b8bf3){return{'name':_0x5b8bf3[_0x2955('0x2b')],'type':_0x5b8bf3[_0x2955('0x2c')][_0x2955('0x2d')]};});_0x565306[_0x2955('0x2e')]=_[_0x2955('0x2f')](_0x35b88a,_0x2955('0x26'));_0x565306[_0x2955('0x30')]=_[_0x2955('0x31')](_0x2e3aa5[_0x2955('0x30')]);_0x565306[_0x2955('0x32')]=_[_0x2955('0x33')](_0x565306[_0x2955('0x2e')],_0x565306[_0x2955('0x30')]);_0x492aad[_0x2955('0x34')]=_[_0x2955('0x33')](_0x565306['model'],qs[_0x2955('0x35')](_0x2e3aa5[_0x2955('0x30')][_0x2955('0x35')]));_0x492aad[_0x2955('0x34')]=_0x492aad[_0x2955('0x34')][_0x2955('0x36')]?_0x492aad['attributes']:_0x565306[_0x2955('0x2e')];if(!_0x2e3aa5[_0x2955('0x30')][_0x2955('0x37')]('nolimit')){_0x492aad['limit']=qs['limit'](_0x2e3aa5[_0x2955('0x30')]['limit']);_0x492aad[_0x2955('0x1a')]=qs[_0x2955('0x1a')](_0x2e3aa5['query'][_0x2955('0x1a')]);}_0x492aad['order']=qs['sort'](_0x2e3aa5[_0x2955('0x30')][_0x2955('0x38')]);_0x492aad[_0x2955('0x39')]=qs[_0x2955('0x32')](_[_0x2955('0x3a')](_0x2e3aa5['query'],_0x565306[_0x2955('0x32')]),_0x35b88a);if(_0x2e3aa5['query'][_0x2955('0x3b')]){_0x492aad[_0x2955('0x39')]=_['merge'](_0x492aad[_0x2955('0x39')],{'$or':_[_0x2955('0x2f')](_0x35b88a,function(_0x47b2f2){if(_0x47b2f2[_0x2955('0x2c')]!==_0x2955('0x3c')){var _0x212686={};_0x212686[_0x47b2f2['name']]={'$like':'%'+_0x2e3aa5[_0x2955('0x30')][_0x2955('0x3b')]+'%'};return _0x212686;}})});}_0x492aad=_[_0x2955('0x3d')]({},_0x492aad,_0x2e3aa5['options']);var _0x5931b9={'where':_0x492aad[_0x2955('0x39')]};return db[_0x2955('0x29')]['count'](_0x5931b9)[_0x2955('0x22')](function(_0x1ceec1){_0x5cf947[_0x2955('0x1d')]=_0x1ceec1;if(_0x2e3aa5['query']['includeAll']){_0x492aad[_0x2955('0x3e')]=[{'all':!![]}];}return db[_0x2955('0x29')][_0x2955('0x3f')](_0x492aad);})[_0x2955('0x22')](function(_0x21d64c){_0x5cf947[_0x2955('0x40')]=_0x21d64c;return _0x5cf947;})[_0x2955('0x22')](respondWithFilteredResult(_0x45eb15,_0x492aad))[_0x2955('0x41')](handleError(_0x45eb15,null));};exports['show']=function(_0x3c6645,_0x30d2df){var _0x310cf8={'raw':!![],'where':{'id':_0x3c6645[_0x2955('0x42')]['id']}},_0x1da45d={};_0x1da45d[_0x2955('0x2e')]=_[_0x2955('0x31')](db[_0x2955('0x29')]['rawAttributes']);_0x1da45d['query']=_[_0x2955('0x31')](_0x3c6645[_0x2955('0x30')]);_0x1da45d[_0x2955('0x32')]=_['intersection'](_0x1da45d['model'],_0x1da45d[_0x2955('0x30')]);_0x310cf8['attributes']=_[_0x2955('0x33')](_0x1da45d[_0x2955('0x2e')],qs[_0x2955('0x35')](_0x3c6645[_0x2955('0x30')][_0x2955('0x35')]));_0x310cf8[_0x2955('0x34')]=_0x310cf8['attributes'][_0x2955('0x36')]?_0x310cf8[_0x2955('0x34')]:_0x1da45d[_0x2955('0x2e')];if(_0x3c6645[_0x2955('0x30')][_0x2955('0x43')]){_0x310cf8[_0x2955('0x3e')]=[{'all':!![]}];}_0x310cf8=_[_0x2955('0x3d')]({},_0x310cf8,_0x3c6645[_0x2955('0x44')]);return db['CmHopperHistory'][_0x2955('0x45')](_0x310cf8)[_0x2955('0x22')](handleEntityNotFound(_0x30d2df,null))[_0x2955('0x22')](respondWithResult(_0x30d2df,null))[_0x2955('0x41')](handleError(_0x30d2df,null));};exports['create']=function(_0x4b97a3,_0x2c9fe1){return db[_0x2955('0x29')][_0x2955('0x46')](_0x4b97a3[_0x2955('0x47')],{})['then'](respondWithResult(_0x2c9fe1,0xc9))[_0x2955('0x41')](handleError(_0x2c9fe1,null));};exports[_0x2955('0x48')]=function(_0x45c874,_0x20f75d){return db[_0x2955('0x29')][_0x2955('0x48')]()[_0x2955('0x22')](respondWithResult(_0x20f75d,null))[_0x2955('0x41')](handleError(_0x20f75d,null));};exports[_0x2955('0x49')]=function(_0x310179,_0x13876e){if(_0x310179[_0x2955('0x47')][_0x2955('0x4a')]){delete _0x310179[_0x2955('0x47')][_0x2955('0x4a')];}return db['CmHopperHistory'][_0x2955('0x45')]({'where':{'uniqueid':_0x310179[_0x2955('0x42')]['id']}})[_0x2955('0x22')](handleEntityNotFound(_0x13876e,null))[_0x2955('0x22')](saveUpdates(_0x310179[_0x2955('0x47')],null))[_0x2955('0x22')](respondWithResult(_0x13876e,null))[_0x2955('0x41')](handleError(_0x13876e,null));}; \ No newline at end of file +var _0x47fd=['merge','options','includeAll','include','findAll','rows','length','find','catch','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','limit','undefined','count','offset','set','json','apply','reject','update','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL'];(function(_0x3ecfa5,_0x20084e){var _0x546596=function(_0x5aac75){while(--_0x5aac75){_0x3ecfa5['push'](_0x3ecfa5['shift']());}};_0x546596(++_0x20084e);}(_0x47fd,0x1e8));var _0xd47f=function(_0x42334c,_0x379771){_0x42334c=_0x42334c-0x0;var _0x4feed7=_0x47fd[_0x42334c];return _0x4feed7;};'use strict';var emlformat=require(_0xd47f('0x0'));var rimraf=require(_0xd47f('0x1'));var zipdir=require(_0xd47f('0x2'));var jsonpatch=require(_0xd47f('0x3'));var rp=require(_0xd47f('0x4'));var moment=require(_0xd47f('0x5'));var BPromise=require(_0xd47f('0x6'));var Mustache=require(_0xd47f('0x7'));var util=require(_0xd47f('0x8'));var path=require(_0xd47f('0x9'));var sox=require('sox');var csv=require(_0xd47f('0xa'));var ejs=require(_0xd47f('0xb'));var fs=require('fs');var fs_extra=require(_0xd47f('0xc'));var _=require(_0xd47f('0xd'));var squel=require(_0xd47f('0xe'));var crypto=require('crypto');var jsforce=require(_0xd47f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd47f('0xa'));var querystring=require(_0xd47f('0x10'));var Papa=require(_0xd47f('0x11'));var Redis=require('ioredis');var authService=require(_0xd47f('0x12'));var qs=require(_0xd47f('0x13'));var as=require(_0xd47f('0x14'));var hardwareService=require(_0xd47f('0x15'));var logger=require(_0xd47f('0x16'))(_0xd47f('0x17'));var utils=require(_0xd47f('0x18'));var config=require(_0xd47f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd47f('0x1a'))['db'];function respondWithStatusCode(_0x3fce26,_0x521d9b){_0x521d9b=_0x521d9b||0xcc;return function(_0x4bc770){if(_0x4bc770){return _0x3fce26[_0xd47f('0x1b')](_0x521d9b);}return _0x3fce26[_0xd47f('0x1c')](_0x521d9b)[_0xd47f('0x1d')]();};}function respondWithResult(_0x493b9b,_0x57350f){_0x57350f=_0x57350f||0xc8;return function(_0x1e83ee){if(_0x1e83ee){return _0x493b9b[_0xd47f('0x1c')](_0x57350f)['json'](_0x1e83ee);}};}function respondWithFilteredResult(_0x5174b9,_0x59965b){return function(_0x1e711d){if(_0x1e711d){var _0x3a7847=typeof _0x59965b['offset']==='undefined'&&typeof _0x59965b[_0xd47f('0x1e')]===_0xd47f('0x1f');var _0x18178e=_0x1e711d['count'];var _0x2a5a56=_0x3a7847?0x0:_0x59965b['offset'];var _0x43441e=_0x3a7847?_0x1e711d[_0xd47f('0x20')]:_0x59965b[_0xd47f('0x21')]+_0x59965b['limit'];var _0xbaa0ad;if(_0x43441e>=_0x18178e){_0x43441e=_0x18178e;_0xbaa0ad=0xc8;}else{_0xbaa0ad=0xce;}_0x5174b9[_0xd47f('0x1c')](_0xbaa0ad);return _0x5174b9[_0xd47f('0x22')]('Content-Range',_0x2a5a56+'-'+_0x43441e+'/'+_0x18178e)[_0xd47f('0x23')](_0x1e711d);}return null;};}function patchUpdates(_0x1e949c){return function(_0x113512){try{jsonpatch[_0xd47f('0x24')](_0x113512,_0x1e949c,!![]);}catch(_0x3b0539){return BPromise[_0xd47f('0x25')](_0x3b0539);}return _0x113512['save']();};}function saveUpdates(_0x1fd88e,_0x6e425d){return function(_0x2ca9a9){if(_0x2ca9a9){return _0x2ca9a9[_0xd47f('0x26')](_0x1fd88e)[_0xd47f('0x27')](function(_0x4d1917){return _0x4d1917;});}return null;};}function removeEntity(_0x528c08,_0x156e94){return function(_0x158f8f){if(_0x158f8f){return _0x158f8f['destroy']()[_0xd47f('0x27')](function(){_0x528c08[_0xd47f('0x1c')](0xcc)[_0xd47f('0x1d')]();});}};}function handleEntityNotFound(_0x34216f,_0x165990){return function(_0x5774c9){if(!_0x5774c9){_0x34216f['sendStatus'](0x194);}return _0x5774c9;};}function handleError(_0x1ea68b,_0x3e93c6){_0x3e93c6=_0x3e93c6||0x1f4;return function(_0x22892b){logger['error'](_0x22892b[_0xd47f('0x28')]);if(_0x22892b[_0xd47f('0x29')]){delete _0x22892b[_0xd47f('0x29')];}_0x1ea68b[_0xd47f('0x1c')](_0x3e93c6)[_0xd47f('0x2a')](_0x22892b);};}exports[_0xd47f('0x2b')]=function(_0x507147,_0x2936af){var _0x307e5a={},_0x24ebb7={},_0x236a14={'count':0x0,'rows':[]};var _0xedfeac=_[_0xd47f('0x2c')](db[_0xd47f('0x2d')][_0xd47f('0x2e')],function(_0x51df76){return{'name':_0x51df76[_0xd47f('0x2f')],'type':_0x51df76[_0xd47f('0x30')][_0xd47f('0x31')]};});_0x24ebb7[_0xd47f('0x32')]=_[_0xd47f('0x2c')](_0xedfeac,'name');_0x24ebb7[_0xd47f('0x33')]=_[_0xd47f('0x34')](_0x507147[_0xd47f('0x33')]);_0x24ebb7[_0xd47f('0x35')]=_[_0xd47f('0x36')](_0x24ebb7['model'],_0x24ebb7[_0xd47f('0x33')]);_0x307e5a[_0xd47f('0x37')]=_[_0xd47f('0x36')](_0x24ebb7[_0xd47f('0x32')],qs[_0xd47f('0x38')](_0x507147[_0xd47f('0x33')][_0xd47f('0x38')]));_0x307e5a[_0xd47f('0x37')]=_0x307e5a[_0xd47f('0x37')]['length']?_0x307e5a[_0xd47f('0x37')]:_0x24ebb7['model'];if(!_0x507147[_0xd47f('0x33')][_0xd47f('0x39')](_0xd47f('0x3a'))){_0x307e5a[_0xd47f('0x1e')]=qs[_0xd47f('0x1e')](_0x507147[_0xd47f('0x33')][_0xd47f('0x1e')]);_0x307e5a[_0xd47f('0x21')]=qs[_0xd47f('0x21')](_0x507147[_0xd47f('0x33')][_0xd47f('0x21')]);}_0x307e5a[_0xd47f('0x3b')]=qs['sort'](_0x507147[_0xd47f('0x33')][_0xd47f('0x3c')]);_0x307e5a['where']=qs[_0xd47f('0x35')](_[_0xd47f('0x3d')](_0x507147['query'],_0x24ebb7[_0xd47f('0x35')]),_0xedfeac);if(_0x507147[_0xd47f('0x33')][_0xd47f('0x3e')]){_0x307e5a[_0xd47f('0x3f')]=_['merge'](_0x307e5a['where'],{'$or':_[_0xd47f('0x2c')](_0xedfeac,function(_0x332474){if(_0x332474[_0xd47f('0x30')]!==_0xd47f('0x40')){var _0xb20c99={};_0xb20c99[_0x332474[_0xd47f('0x29')]]={'$like':'%'+_0x507147[_0xd47f('0x33')][_0xd47f('0x3e')]+'%'};return _0xb20c99;}})});}_0x307e5a=_[_0xd47f('0x41')]({},_0x307e5a,_0x507147[_0xd47f('0x42')]);var _0x336b2a={'where':_0x307e5a[_0xd47f('0x3f')]};return db[_0xd47f('0x2d')]['count'](_0x336b2a)[_0xd47f('0x27')](function(_0x57eef0){_0x236a14['count']=_0x57eef0;if(_0x507147[_0xd47f('0x33')][_0xd47f('0x43')]){_0x307e5a[_0xd47f('0x44')]=[{'all':!![]}];}return db[_0xd47f('0x2d')][_0xd47f('0x45')](_0x307e5a);})[_0xd47f('0x27')](function(_0x3cfb36){_0x236a14[_0xd47f('0x46')]=_0x3cfb36;return _0x236a14;})[_0xd47f('0x27')](respondWithFilteredResult(_0x2936af,_0x307e5a))['catch'](handleError(_0x2936af,null));};exports['show']=function(_0x76c329,_0x3c1683){var _0x170b8f={'raw':!![],'where':{'id':_0x76c329['params']['id']}},_0x36c7f5={};_0x36c7f5[_0xd47f('0x32')]=_['keys'](db[_0xd47f('0x2d')][_0xd47f('0x2e')]);_0x36c7f5[_0xd47f('0x33')]=_['keys'](_0x76c329[_0xd47f('0x33')]);_0x36c7f5[_0xd47f('0x35')]=_[_0xd47f('0x36')](_0x36c7f5[_0xd47f('0x32')],_0x36c7f5[_0xd47f('0x33')]);_0x170b8f[_0xd47f('0x37')]=_[_0xd47f('0x36')](_0x36c7f5[_0xd47f('0x32')],qs[_0xd47f('0x38')](_0x76c329[_0xd47f('0x33')][_0xd47f('0x38')]));_0x170b8f[_0xd47f('0x37')]=_0x170b8f['attributes'][_0xd47f('0x47')]?_0x170b8f['attributes']:_0x36c7f5[_0xd47f('0x32')];if(_0x76c329[_0xd47f('0x33')][_0xd47f('0x43')]){_0x170b8f[_0xd47f('0x44')]=[{'all':!![]}];}_0x170b8f=_[_0xd47f('0x41')]({},_0x170b8f,_0x76c329[_0xd47f('0x42')]);return db[_0xd47f('0x2d')][_0xd47f('0x48')](_0x170b8f)[_0xd47f('0x27')](handleEntityNotFound(_0x3c1683,null))[_0xd47f('0x27')](respondWithResult(_0x3c1683,null))[_0xd47f('0x49')](handleError(_0x3c1683,null));};exports[_0xd47f('0x4a')]=function(_0x1a5cf4,_0x2d3b8b){return db['CmHopperHistory'][_0xd47f('0x4a')](_0x1a5cf4[_0xd47f('0x4b')],{})['then'](respondWithResult(_0x2d3b8b,0xc9))[_0xd47f('0x49')](handleError(_0x2d3b8b,null));};exports[_0xd47f('0x4c')]=function(_0x5a4747,_0x58f213){return db[_0xd47f('0x2d')][_0xd47f('0x4c')]()[_0xd47f('0x27')](respondWithResult(_0x58f213,null))['catch'](handleError(_0x58f213,null));};exports[_0xd47f('0x26')]=function(_0x40ac53,_0x3a57e5){if(_0x40ac53[_0xd47f('0x4b')][_0xd47f('0x4d')]){delete _0x40ac53[_0xd47f('0x4b')][_0xd47f('0x4d')];}return db[_0xd47f('0x2d')][_0xd47f('0x48')]({'where':{'uniqueid':_0x40ac53[_0xd47f('0x4e')]['id']}})[_0xd47f('0x27')](handleEntityNotFound(_0x3a57e5,null))[_0xd47f('0x27')](saveUpdates(_0x40ac53[_0xd47f('0x4b')],null))[_0xd47f('0x27')](respondWithResult(_0x3a57e5,null))[_0xd47f('0x49')](handleError(_0x3a57e5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index ecf8a99..7b03c37 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 _0x46c1=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x4d8c7c,_0x2dd161){var _0x1e1405=function(_0x328aba){while(--_0x328aba){_0x4d8c7c['push'](_0x4d8c7c['shift']());}};_0x1e1405(++_0x2dd161);}(_0x46c1,0x7c));var _0x146c=function(_0x4b1c4d,_0xaa863e){_0x4b1c4d=_0x4b1c4d-0x0;var _0x23a8f9=_0x46c1[_0x4b1c4d];return _0x23a8f9;};'use strict';var _=require('lodash');var util=require(_0x146c('0x0'));var logger=require(_0x146c('0x1'))(_0x146c('0x2'));var moment=require(_0x146c('0x3'));var BPromise=require(_0x146c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x146c('0x5'));var rimraf=require(_0x146c('0x6'));var config=require(_0x146c('0x7'));var attributes=require(_0x146c('0x8'));module[_0x146c('0x9')]=function(_0x49f94f,_0x5ae2f3){return _0x49f94f[_0x146c('0xa')](_0x146c('0xb'),attributes,{'tableName':_0x146c('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x146c('0xd')]},{'name':'uniqueid','fields':[_0x146c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72d7=['define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','./cmHopperHistory.attributes','exports'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x72d7,0x19b));var _0x772d=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x72d7[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x772d('0x0'));var util=require(_0x772d('0x1'));var logger=require(_0x772d('0x2'))(_0x772d('0x3'));var moment=require(_0x772d('0x4'));var BPromise=require(_0x772d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x772d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x772d('0x7'));module[_0x772d('0x8')]=function(_0x2b014d,_0x527450){return _0x2b014d[_0x772d('0x9')](_0x772d('0xa'),attributes,{'tableName':_0x772d('0xb'),'paranoid':![],'indexes':[{'name':_0x772d('0xc'),'fields':[_0x772d('0xc')]},{'name':_0x772d('0xd'),'fields':[_0x772d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index cf369a0..984ae27 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 _0x7dc2=['jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','stringify','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27dc('0x0'));var BPromise=require(_0x27dc('0x1'));var rs=require(_0x27dc('0x2'));var fs=require('fs');var Redis=require(_0x27dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27dc('0x4'));var logger=require(_0x27dc('0x5'))('rpc');var config=require(_0x27dc('0x6'));var jayson=require(_0x27dc('0x7'));var client=jayson['client'][_0x27dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d2e10,_0x95bbb6,_0x3b3eee){return new BPromise(function(_0x5181ab,_0x45aa07){return client[_0x27dc('0x9')](_0x4d2e10,_0x3b3eee)[_0x27dc('0xa')](function(_0x242997){logger['info'](_0x27dc('0xb'),_0x95bbb6,'request\x20sent');logger[_0x27dc('0xc')](_0x27dc('0xd'),_0x95bbb6,_0x27dc('0xe'),JSON['stringify'](_0x242997));if(_0x242997['error']){if(_0x242997[_0x27dc('0xf')][_0x27dc('0x10')]===0x1f4){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x242997['error'][_0x27dc('0x11')]);return _0x45aa07(_0x242997['error'][_0x27dc('0x11')]);}logger['error'](_0x27dc('0xb'),_0x95bbb6,_0x242997[_0x27dc('0xf')][_0x27dc('0x11')]);return _0x5181ab(_0x242997[_0x27dc('0xf')]['message']);}else{logger[_0x27dc('0x12')](_0x27dc('0xb'),_0x95bbb6,_0x27dc('0xe'));_0x5181ab(_0x242997[_0x27dc('0x13')][_0x27dc('0x11')]);}})['catch'](function(_0x3ff8f8){logger[_0x27dc('0xf')](_0x27dc('0xb'),_0x95bbb6,_0x3ff8f8);_0x45aa07(_0x3ff8f8);});});}exports[_0x27dc('0x14')]=function(_0x5d308b){var _0x5ecb19=this;return new Promise(function(_0x1ff9a2,_0x225b2c){return db[_0x27dc('0x15')][_0x27dc('0x16')](_0x5d308b[_0x27dc('0x17')],{'raw':_0x5d308b[_0x27dc('0x18')]?_0x5d308b[_0x27dc('0x18')][_0x27dc('0x19')]===undefined?!![]:![]:!![]})[_0x27dc('0xa')](function(_0x5064d5){logger[_0x27dc('0x12')](_0x27dc('0x14'),_0x5d308b);logger['debug'](_0x27dc('0x14'),_0x5d308b,JSON['stringify'](_0x5064d5));_0x1ff9a2(_0x5064d5);})['catch'](function(_0x2843b1){logger['error'](_0x27dc('0x14'),_0x2843b1['message'],_0x5d308b);_0x225b2c(_0x5ecb19['error'](0x1f4,_0x2843b1[_0x27dc('0x11')]));});});};exports['AvgHandleTime']=function(_0x37917e){var _0x506130=this;return new Promise(function(_0x38640d,_0x1eb83d){return db[_0x27dc('0x15')][_0x27dc('0x1a')]({'raw':_0x37917e['options']?_0x37917e[_0x27dc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x37917e['options']?_0x37917e[_0x27dc('0x18')][_0x27dc('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')][_0x27dc('0x1e')]('id')),_0x27dc('0x1f')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x21')))),_0x27dc('0x22')],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x23')))),_0x27dc('0x24')],[db[_0x27dc('0x1d')]['fn']('COUNT',db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0x27dc('0x25')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x26'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x27')))),_0x27dc('0x28')],[db['sequelize']['fn'](_0x27dc('0x26'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x27dc('0xa')](function(_0x416a15){logger[_0x27dc('0x12')](_0x27dc('0x2a'),_0x37917e);logger[_0x27dc('0xc')]('AvgHandleTime',_0x37917e,JSON['stringify'](_0x416a15));_0x38640d(_0x416a15);})[_0x27dc('0x2b')](function(_0x35fbda){logger[_0x27dc('0xf')](_0x27dc('0x2a'),_0x35fbda['message'],_0x37917e);_0x1eb83d(_0x506130['error'](0x1f4,_0x35fbda[_0x27dc('0x11')]));});});};exports[_0x27dc('0x2c')]=function(_0x9b49b5){var _0x55ac93=this;return new Promise(function(_0x1059d1,_0x5c7e6b){return db[_0x27dc('0x15')]['findAll']({'raw':_0x9b49b5[_0x27dc('0x18')]?_0x9b49b5[_0x27dc('0x18')][_0x27dc('0x19')]===undefined?!![]:![]:!![],'where':_0x9b49b5[_0x27dc('0x18')]?_0x9b49b5[_0x27dc('0x18')][_0x27dc('0x1b')]||null:null,'attributes':[[_0x27dc('0x2d'),_0x27dc('0x2e')],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x2f')))),_0x27dc('0x30')],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0x27dc('0x31')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x27dc('0x1d')]['fn']('COUNT',db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')]('`state`\x20=\x208,\x201,\x20null'))),_0x27dc('0x32')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x33')))),'outboundDropCallsDayTimeout'],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x34')))),_0x27dc('0x35')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db['sequelize']['fn']('IF',db[_0x27dc('0x1d')]['literal'](_0x27dc('0x36')))),_0x27dc('0x37')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x38')))),_0x27dc('0x39')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x3a')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db['sequelize'][_0x27dc('0x20')](_0x27dc('0x3b')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x27dc('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x27dc('0x3c')))),_0x27dc('0x3d')],[db[_0x27dc('0x1d')]['fn']('COUNT',db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')]['literal'](_0x27dc('0x3e')))),_0x27dc('0x3f')],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x40')))),_0x27dc('0x41')]],'group':['campaign']})[_0x27dc('0xa')](function(_0x32143a){logger['info'](_0x27dc('0x2c'),_0x9b49b5);logger[_0x27dc('0xc')]('GetVoiceQueueHopperHistory',_0x9b49b5,JSON[_0x27dc('0x42')](_0x32143a));_0x1059d1(_0x32143a);})['catch'](function(_0x32ee93){logger[_0x27dc('0xf')]('GetVoiceQueueHopperHistory',_0x32ee93[_0x27dc('0x11')],_0x9b49b5);_0x5c7e6b(_0x55ac93[_0x27dc('0xf')](0x1f4,_0x32ee93[_0x27dc('0x11')]));});});};exports[_0x27dc('0x43')]=function(_0x5af93a){var _0x4c133c=this;return new Promise(function(_0x2f0c69,_0x312982){return db['CmHopperHistory'][_0x27dc('0x1a')]({'raw':_0x5af93a['options']?_0x5af93a[_0x27dc('0x18')][_0x27dc('0x19')]===undefined?!![]:![]:!![],'where':_0x5af93a['options']?_0x5af93a[_0x27dc('0x18')][_0x27dc('0x1b')]||null:null,'attributes':[[_0x27dc('0x2d'),_0x27dc('0x2e')],[db['sequelize']['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')][_0x27dc('0x1e')]('id')),_0x27dc('0x44')],[db[_0x27dc('0x1d')]['fn'](_0x27dc('0x1c'),db[_0x27dc('0x1d')]['fn']('IF',db[_0x27dc('0x1d')][_0x27dc('0x20')](_0x27dc('0x21')))),_0x27dc('0x45')]],'group':[_0x27dc('0x2d')]})[_0x27dc('0xa')](function(_0x7e47a5){logger[_0x27dc('0x12')](_0x27dc('0x43'),_0x5af93a);logger['debug'](_0x27dc('0x43'),_0x5af93a,JSON['stringify'](_0x7e47a5));_0x2f0c69(_0x7e47a5);})[_0x27dc('0x2b')](function(_0x193121){logger['error'](_0x27dc('0x43'),_0x193121['message'],_0x5af93a);_0x312982(_0x4c133c['error'](0x1f4,_0x193121[_0x27dc('0x11')]));});});}; \ No newline at end of file +var _0xad53=['code','message','result','CmHopperHistory','body','options','raw','CreateCmHopperHistory','debug','AvgHandleTime','findAll','where','col','predictiveIntervalTotalCalls','sequelize','predictiveIntervalAnsweredCalls','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','catch','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11decf,_0x46d65d){var _0x35bb52=function(_0x3325d6){while(--_0x3325d6){_0x11decf['push'](_0x11decf['shift']());}};_0x35bb52(++_0x46d65d);}(_0xad53,0x1ea));var _0x3ad5=function(_0x592864,_0x20bb1d){_0x592864=_0x592864-0x0;var _0x416298=_0xad53[_0x592864];return _0x416298;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var moment=require(_0x3ad5('0x2'));var BPromise=require(_0x3ad5('0x3'));var rs=require(_0x3ad5('0x4'));var fs=require('fs');var Redis=require(_0x3ad5('0x5'));var db=require(_0x3ad5('0x6'))['db'];var utils=require(_0x3ad5('0x7'));var logger=require('../../config/logger')(_0x3ad5('0x8'));var config=require(_0x3ad5('0x9'));var jayson=require(_0x3ad5('0xa'));var client=jayson[_0x3ad5('0xb')][_0x3ad5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a7780,_0x5e8e41,_0x5c40d7){return new BPromise(function(_0x1ef667,_0x1262a4){return client[_0x3ad5('0xd')](_0x5a7780,_0x5c40d7)[_0x3ad5('0xe')](function(_0x17fd04){logger[_0x3ad5('0xf')](_0x3ad5('0x10'),_0x5e8e41,_0x3ad5('0x11'));logger['debug'](_0x3ad5('0x12'),_0x5e8e41,_0x3ad5('0x11'),JSON[_0x3ad5('0x13')](_0x17fd04));if(_0x17fd04[_0x3ad5('0x14')]){if(_0x17fd04['error'][_0x3ad5('0x15')]===0x1f4){logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x17fd04['error'][_0x3ad5('0x16')]);return _0x1262a4(_0x17fd04[_0x3ad5('0x14')][_0x3ad5('0x16')]);}logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x17fd04[_0x3ad5('0x14')]['message']);return _0x1ef667(_0x17fd04['error'][_0x3ad5('0x16')]);}else{logger[_0x3ad5('0xf')](_0x3ad5('0x10'),_0x5e8e41,_0x3ad5('0x11'));_0x1ef667(_0x17fd04[_0x3ad5('0x17')][_0x3ad5('0x16')]);}})['catch'](function(_0x56123a){logger[_0x3ad5('0x14')](_0x3ad5('0x10'),_0x5e8e41,_0x56123a);_0x1262a4(_0x56123a);});});}exports['CreateCmHopperHistory']=function(_0x5d557e){var _0x445741=this;return new Promise(function(_0xd8775,_0x179cda){return db[_0x3ad5('0x18')]['create'](_0x5d557e[_0x3ad5('0x19')],{'raw':_0x5d557e[_0x3ad5('0x1a')]?_0x5d557e[_0x3ad5('0x1a')][_0x3ad5('0x1b')]===undefined?!![]:![]:!![]})[_0x3ad5('0xe')](function(_0x1c37c7){logger[_0x3ad5('0xf')](_0x3ad5('0x1c'),_0x5d557e);logger[_0x3ad5('0x1d')]('CreateCmHopperHistory',_0x5d557e,JSON[_0x3ad5('0x13')](_0x1c37c7));_0xd8775(_0x1c37c7);})['catch'](function(_0x936a29){logger['error'](_0x3ad5('0x1c'),_0x936a29[_0x3ad5('0x16')],_0x5d557e);_0x179cda(_0x445741[_0x3ad5('0x14')](0x1f4,_0x936a29[_0x3ad5('0x16')]));});});};exports[_0x3ad5('0x1e')]=function(_0x26b402){var _0x4c59dc=this;return new Promise(function(_0x437b4c,_0x1aa2e9){return db['CmHopperHistory'][_0x3ad5('0x1f')]({'raw':_0x26b402[_0x3ad5('0x1a')]?_0x26b402[_0x3ad5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x26b402[_0x3ad5('0x1a')]?_0x26b402[_0x3ad5('0x1a')][_0x3ad5('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x3ad5('0x21')]('id')),_0x3ad5('0x22')],[db[_0x3ad5('0x23')]['fn']('COUNT',db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x3ad5('0x24')],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')]('`state`\x20=\x2011,\x201,\x20null'))),_0x3ad5('0x28')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x29'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x2a')))),_0x3ad5('0x2b')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x29'),db['sequelize']['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x2c')))),_0x3ad5('0x2d')]]})[_0x3ad5('0xe')](function(_0x41240f){logger[_0x3ad5('0xf')]('AvgHandleTime',_0x26b402);logger['debug'](_0x3ad5('0x1e'),_0x26b402,JSON[_0x3ad5('0x13')](_0x41240f));_0x437b4c(_0x41240f);})['catch'](function(_0x1005ac){logger[_0x3ad5('0x14')](_0x3ad5('0x1e'),_0x1005ac[_0x3ad5('0x16')],_0x26b402);_0x1aa2e9(_0x4c59dc[_0x3ad5('0x14')](0x1f4,_0x1005ac[_0x3ad5('0x16')]));});});};exports[_0x3ad5('0x2e')]=function(_0x2f8bea){var _0x247f0c=this;return new Promise(function(_0x256c59,_0x13de0d){return db[_0x3ad5('0x18')][_0x3ad5('0x1f')]({'raw':_0x2f8bea['options']?_0x2f8bea[_0x3ad5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2f8bea[_0x3ad5('0x1a')]?_0x2f8bea[_0x3ad5('0x1a')][_0x3ad5('0x20')]||null:null,'attributes':[[_0x3ad5('0x2f'),_0x3ad5('0x30')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x3ad5('0x26')](_0x3ad5('0x31')))),_0x3ad5('0x32')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x33')))),_0x3ad5('0x34')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x35')))),_0x3ad5('0x36')],[db[_0x3ad5('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')]('`state`\x20=\x205,\x201,\x20null'))),_0x3ad5('0x37')],[db['sequelize']['fn']('COUNT',db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x38')))),_0x3ad5('0x39')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db['sequelize']['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x3a')))),_0x3ad5('0x3b')],[db[_0x3ad5('0x23')]['fn']('COUNT',db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x3c')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x3d')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')]['literal'](_0x3ad5('0x3e')))),_0x3ad5('0x3f')],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x3ad5('0x40')],[db['sequelize']['fn'](_0x3ad5('0x25'),db['sequelize']['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')]('`state`\x20=\x2018,\x201,\x20null'))),_0x3ad5('0x41')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x3ad5('0x26')](_0x3ad5('0x42')))),_0x3ad5('0x43')],[db[_0x3ad5('0x23')]['fn'](_0x3ad5('0x25'),db['sequelize']['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),_0x3ad5('0x41')],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')](_0x3ad5('0x44')))),_0x3ad5('0x45')]],'group':[_0x3ad5('0x2f')]})[_0x3ad5('0xe')](function(_0x4506f6){logger[_0x3ad5('0xf')]('GetVoiceQueueHopperHistory',_0x2f8bea);logger[_0x3ad5('0x1d')](_0x3ad5('0x2e'),_0x2f8bea,JSON['stringify'](_0x4506f6));_0x256c59(_0x4506f6);})[_0x3ad5('0x46')](function(_0x543041){logger[_0x3ad5('0x14')]('GetVoiceQueueHopperHistory',_0x543041[_0x3ad5('0x16')],_0x2f8bea);_0x13de0d(_0x247f0c[_0x3ad5('0x14')](0x1f4,_0x543041['message']));});});};exports[_0x3ad5('0x47')]=function(_0x53e2e7){var _0x10e0a2=this;return new Promise(function(_0x164115,_0x35038a){return db['CmHopperHistory'][_0x3ad5('0x1f')]({'raw':_0x53e2e7['options']?_0x53e2e7[_0x3ad5('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x53e2e7[_0x3ad5('0x1a')]?_0x53e2e7[_0x3ad5('0x1a')][_0x3ad5('0x20')]||null:null,'attributes':[[_0x3ad5('0x2f'),'name'],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')][_0x3ad5('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x3ad5('0x25'),db[_0x3ad5('0x23')]['fn']('IF',db[_0x3ad5('0x23')][_0x3ad5('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x3ad5('0x48')]],'group':[_0x3ad5('0x2f')]})[_0x3ad5('0xe')](function(_0x3ff478){logger[_0x3ad5('0xf')](_0x3ad5('0x47'),_0x53e2e7);logger['debug']('GetCampaignHopperHistory',_0x53e2e7,JSON[_0x3ad5('0x13')](_0x3ff478));_0x164115(_0x3ff478);})[_0x3ad5('0x46')](function(_0x2e109e){logger['error']('GetCampaignHopperHistory',_0x2e109e['message'],_0x53e2e7);_0x35038a(_0x10e0a2['error'](0x1f4,_0x2e109e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index c128f02..67722a3 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 _0x9d39=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','/:id','show','post','create','update','exports','multer'];(function(_0x2f7a54,_0x5d2d9a){var _0x371ae7=function(_0x12bdda){while(--_0x12bdda){_0x2f7a54['push'](_0x2f7a54['shift']());}};_0x371ae7(++_0x5d2d9a);}(_0x9d39,0x1a8));var _0x99d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d39[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x99d3('0x0'));var util=require(_0x99d3('0x1'));var path=require(_0x99d3('0x2'));var timeout=require(_0x99d3('0x3'));var express=require('express');var router=express[_0x99d3('0x4')]();var fs_extra=require(_0x99d3('0x5'));var auth=require(_0x99d3('0x6'));var interaction=require(_0x99d3('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x99d3('0x8')](),controller['index']);router[_0x99d3('0x9')](_0x99d3('0xa'),auth[_0x99d3('0x8')](),controller['describe']);router[_0x99d3('0x9')](_0x99d3('0xb'),auth[_0x99d3('0x8')](),controller[_0x99d3('0xc')]);router[_0x99d3('0xd')]('/',auth['isAuthenticated'](),controller[_0x99d3('0xe')]);router['put'](_0x99d3('0xb'),auth[_0x99d3('0x8')](),controller[_0x99d3('0xf')]);module[_0x99d3('0x10')]=router; \ No newline at end of file +var _0x0761=['put','update','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x237fcb,_0x592357){var _0x4eafc6=function(_0x27c8ca){while(--_0x27c8ca){_0x237fcb['push'](_0x237fcb['shift']());}};_0x4eafc6(++_0x592357);}(_0x0761,0x1a5));var _0x1076=function(_0x56e527,_0x14733b){_0x56e527=_0x56e527-0x0;var _0x717a6b=_0x0761[_0x56e527];return _0x717a6b;};'use strict';var multer=require('multer');var util=require(_0x1076('0x0'));var path=require(_0x1076('0x1'));var timeout=require(_0x1076('0x2'));var express=require('express');var router=express[_0x1076('0x3')]();var fs_extra=require(_0x1076('0x4'));var auth=require(_0x1076('0x5'));var interaction=require(_0x1076('0x6'));var config=require(_0x1076('0x7'));var controller=require(_0x1076('0x8'));router[_0x1076('0x9')]('/',auth[_0x1076('0xa')](),controller[_0x1076('0xb')]);router[_0x1076('0x9')](_0x1076('0xc'),auth[_0x1076('0xa')](),controller[_0x1076('0xd')]);router['get'](_0x1076('0xe'),auth[_0x1076('0xa')](),controller['show']);router[_0x1076('0xf')]('/',auth[_0x1076('0xa')](),controller['create']);router[_0x1076('0x10')](_0x1076('0xe'),auth[_0x1076('0xa')](),controller[_0x1076('0x11')]);module[_0x1076('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index cdf3231..e24a11c 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 _0x740a=['name','sequelize','exports','STRING'];(function(_0x387022,_0x30888c){var _0x414c5c=function(_0xbd6f1d){while(--_0xbd6f1d){_0x387022['push'](_0x387022['shift']());}};_0x414c5c(++_0x30888c);}(_0x740a,0x175));var _0xa740=function(_0x3d0b46,_0x154936){_0x3d0b46=_0x3d0b46-0x0;var _0x4db38a=_0x740a[_0x3d0b46];return _0x4db38a;};'use strict';var Sequelize=require(_0xa740('0x0'));module[_0xa740('0x1')]={'name':{'type':Sequelize[_0xa740('0x2')],'unique':_0xa740('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa740('0x2')]},'dialPrefix':{'type':Sequelize[_0xa740('0x2')]}}; \ No newline at end of file +var _0xfa2b=['exports','STRING','name','sequelize'];(function(_0x39f4cb,_0x1e6403){var _0x477b48=function(_0x5ae344){while(--_0x5ae344){_0x39f4cb['push'](_0x39f4cb['shift']());}};_0x477b48(++_0x1e6403);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2662f,_0x5538fd){_0x2662f=_0x2662f-0x0;var _0x28e298=_0xfa2b[_0x2662f];return _0x28e298;};'use strict';var Sequelize=require(_0xbfa2('0x0'));module[_0xbfa2('0x1')]={'name':{'type':Sequelize[_0xbfa2('0x2')],'unique':_0xbfa2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbfa2('0x2')]},'dialPrefix':{'type':Sequelize[_0xbfa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 602a926..2500632 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 _0xfd57=['format','cf_%d','raw','getContactsCsv','ContactItemType','findAll','OrderBy','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','alias','item','cm_contact_has_items','additionalPhone_','description','ItemTypeId\x20=\x20?','toString','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','getCustomFields','getGlobalCustomFields','findAndCountAll','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','./cmList.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','get','UserProfileResource','end','error','name','send','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','CmList','include','catch','show','params','includeAll','find','create','body','user','role','Lists','UserProfileSection','userProfileId','autoAssociation','destroy','describe','addDisposition','ListId','findOne','Disposition','length','nolimit','rows','removeDispositions','addContacts','CmContact','tags','join','isArray','push','each','omit','ids','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat'];(function(_0x45ce40,_0x3b6ba5){var _0x24017c=function(_0x3b1d60){while(--_0x3b1d60){_0x45ce40['push'](_0x45ce40['shift']());}};_0x24017c(++_0x3b6ba5);}(_0xfd57,0xd0));var _0x7fd5=function(_0x3d04c0,_0x2da1e3){_0x3d04c0=_0x3d04c0-0x0;var _0x8749c0=_0xfd57[_0x3d04c0];return _0x8749c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fd5('0x0'));var zipdir=require(_0x7fd5('0x1'));var jsonpatch=require(_0x7fd5('0x2'));var rp=require(_0x7fd5('0x3'));var moment=require(_0x7fd5('0x4'));var BPromise=require(_0x7fd5('0x5'));var Mustache=require('mustache');var util=require(_0x7fd5('0x6'));var path=require(_0x7fd5('0x7'));var sox=require(_0x7fd5('0x8'));var csv=require(_0x7fd5('0x9'));var ejs=require(_0x7fd5('0xa'));var fs=require('fs');var fs_extra=require(_0x7fd5('0xb'));var _=require(_0x7fd5('0xc'));var squel=require(_0x7fd5('0xd'));var crypto=require(_0x7fd5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7fd5('0x9'));var querystring=require(_0x7fd5('0xf'));var Papa=require('papaparse');var Redis=require(_0x7fd5('0x10'));var authService=require(_0x7fd5('0x11'));var qs=require(_0x7fd5('0x12'));var as=require(_0x7fd5('0x13'));var hardwareService=require(_0x7fd5('0x14'));var logger=require(_0x7fd5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x7fd5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var csv_results;config[_0x7fd5('0x17')]=_[_0x7fd5('0x18')](config[_0x7fd5('0x17')],{'host':_0x7fd5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7fd5('0x1a'))['register'](socket);function respondWithStatusCode(_0x2e3ffc,_0x180b09){_0x180b09=_0x180b09||0xcc;return function(_0x3983df){if(_0x3983df){return _0x2e3ffc[_0x7fd5('0x1b')](_0x180b09);}return _0x2e3ffc[_0x7fd5('0x1c')](_0x180b09)['end']();};}function respondWithResult(_0x451db7,_0x55873e){_0x55873e=_0x55873e||0xc8;return function(_0x9a3757){if(_0x9a3757){return _0x451db7['status'](_0x55873e)[_0x7fd5('0x1d')](_0x9a3757);}};}function respondWithFilteredResult(_0x53bab2,_0x39665f){return function(_0x3c1d9b){if(_0x3c1d9b){var _0x1cc1d4=typeof _0x39665f[_0x7fd5('0x1e')]===_0x7fd5('0x1f')&&typeof _0x39665f['limit']===_0x7fd5('0x1f');var _0x3e8370=_0x3c1d9b[_0x7fd5('0x20')];var _0x271d0b=_0x1cc1d4?0x0:_0x39665f['offset'];var _0x36685d=_0x1cc1d4?_0x3c1d9b[_0x7fd5('0x20')]:_0x39665f[_0x7fd5('0x1e')]+_0x39665f['limit'];var _0x223e43;if(_0x36685d>=_0x3e8370){_0x36685d=_0x3e8370;_0x223e43=0xc8;}else{_0x223e43=0xce;}_0x53bab2['status'](_0x223e43);return _0x53bab2[_0x7fd5('0x21')](_0x7fd5('0x22'),_0x271d0b+'-'+_0x36685d+'/'+_0x3e8370)[_0x7fd5('0x1d')](_0x3c1d9b);}return null;};}function patchUpdates(_0x5d95da){return function(_0x534fb6){try{jsonpatch[_0x7fd5('0x23')](_0x534fb6,_0x5d95da,!![]);}catch(_0x1b35ad){return BPromise['reject'](_0x1b35ad);}return _0x534fb6['save']();};}function saveUpdates(_0x1f6f9a,_0x36276b){return function(_0xc45281){if(_0xc45281){return _0xc45281[_0x7fd5('0x24')](_0x1f6f9a)[_0x7fd5('0x25')](function(_0x28825c){return _0x28825c;});}return null;};}function removeEntity(_0xe5baa7,_0x39ecde){return function(_0x14a5e6){if(_0x14a5e6){return _0x14a5e6['destroy']()['then'](function(){var _0x49b1f2=_0x14a5e6[_0x7fd5('0x26')]({'plain':!![]});var _0x3a9a7d='Lists';return db[_0x7fd5('0x27')]['destroy']({'where':{'type':_0x3a9a7d,'resourceId':_0x49b1f2['id']}})['then'](function(){return _0x14a5e6;});})[_0x7fd5('0x25')](function(){_0xe5baa7[_0x7fd5('0x1c')](0xcc)[_0x7fd5('0x28')]();});}};}function handleEntityNotFound(_0x11166c,_0x517426){return function(_0x5e5873){if(!_0x5e5873){_0x11166c['sendStatus'](0x194);}return _0x5e5873;};}function handleError(_0x49b12f,_0x524312){_0x524312=_0x524312||0x1f4;return function(_0x22a251){logger[_0x7fd5('0x29')](_0x22a251['stack']);if(_0x22a251['name']){delete _0x22a251[_0x7fd5('0x2a')];}_0x49b12f[_0x7fd5('0x1c')](_0x524312)[_0x7fd5('0x2b')](_0x22a251);};}exports['index']=function(_0x5dadc2,_0x594f52){var _0x2ded3f={},_0x40500c={},_0x5602ac={'count':0x0,'rows':[]};var _0x4b79dd=_[_0x7fd5('0x2c')](db['CmList'][_0x7fd5('0x2d')],function(_0x11cb6f){return{'name':_0x11cb6f['fieldName'],'type':_0x11cb6f[_0x7fd5('0x2e')]['key']};});_0x40500c[_0x7fd5('0x2f')]=_['map'](_0x4b79dd,_0x7fd5('0x2a'));_0x40500c[_0x7fd5('0x30')]=_[_0x7fd5('0x31')](_0x5dadc2[_0x7fd5('0x30')]);_0x40500c[_0x7fd5('0x32')]=_[_0x7fd5('0x33')](_0x40500c[_0x7fd5('0x2f')],_0x40500c[_0x7fd5('0x30')]);_0x2ded3f['attributes']=_[_0x7fd5('0x33')](_0x40500c['model'],qs[_0x7fd5('0x34')](_0x5dadc2[_0x7fd5('0x30')][_0x7fd5('0x34')]));_0x2ded3f[_0x7fd5('0x35')]=_0x2ded3f[_0x7fd5('0x35')]['length']?_0x2ded3f[_0x7fd5('0x35')]:_0x40500c[_0x7fd5('0x2f')];if(!_0x5dadc2['query'][_0x7fd5('0x36')]('nolimit')){_0x2ded3f['limit']=qs['limit'](_0x5dadc2['query'][_0x7fd5('0x37')]);_0x2ded3f[_0x7fd5('0x1e')]=qs[_0x7fd5('0x1e')](_0x5dadc2[_0x7fd5('0x30')][_0x7fd5('0x1e')]);}_0x2ded3f[_0x7fd5('0x38')]=qs[_0x7fd5('0x39')](_0x5dadc2['query'][_0x7fd5('0x39')]);_0x2ded3f[_0x7fd5('0x3a')]=qs['filters'](_[_0x7fd5('0x3b')](_0x5dadc2['query'],_0x40500c[_0x7fd5('0x32')]),_0x4b79dd);if(_0x5dadc2['query'][_0x7fd5('0x3c')]){_0x2ded3f[_0x7fd5('0x3a')]=_['merge'](_0x2ded3f[_0x7fd5('0x3a')],{'$or':_[_0x7fd5('0x2c')](_0x4b79dd,function(_0x2e16cc){if(_0x2e16cc[_0x7fd5('0x2e')]!=='VIRTUAL'){var _0x43da50={};_0x43da50[_0x2e16cc['name']]={'$like':'%'+_0x5dadc2[_0x7fd5('0x30')][_0x7fd5('0x3c')]+'%'};return _0x43da50;}})});}_0x2ded3f=_[_0x7fd5('0x3d')]({},_0x2ded3f,_0x5dadc2[_0x7fd5('0x3e')]);var _0x4f6a92={'where':_0x2ded3f[_0x7fd5('0x3a')]};return db[_0x7fd5('0x3f')]['count'](_0x4f6a92)[_0x7fd5('0x25')](function(_0x1c3152){_0x5602ac[_0x7fd5('0x20')]=_0x1c3152;if(_0x5dadc2['query']['includeAll']){_0x2ded3f[_0x7fd5('0x40')]=[{'all':!![]}];}return db[_0x7fd5('0x3f')]['findAll'](_0x2ded3f);})['then'](function(_0x184977){_0x5602ac['rows']=_0x184977;return _0x5602ac;})['then'](respondWithFilteredResult(_0x594f52,_0x2ded3f))[_0x7fd5('0x41')](handleError(_0x594f52,null));};exports[_0x7fd5('0x42')]=function(_0x5c0beb,_0x31c420){var _0x4bdf30={'raw':![],'where':{'id':_0x5c0beb[_0x7fd5('0x43')]['id']}},_0x4e5d78={};_0x4e5d78[_0x7fd5('0x2f')]=_[_0x7fd5('0x31')](db[_0x7fd5('0x3f')]['rawAttributes']);_0x4e5d78[_0x7fd5('0x30')]=_[_0x7fd5('0x31')](_0x5c0beb[_0x7fd5('0x30')]);_0x4e5d78[_0x7fd5('0x32')]=_[_0x7fd5('0x33')](_0x4e5d78['model'],_0x4e5d78['query']);_0x4bdf30[_0x7fd5('0x35')]=_['intersection'](_0x4e5d78[_0x7fd5('0x2f')],qs['fields'](_0x5c0beb['query'][_0x7fd5('0x34')]));_0x4bdf30[_0x7fd5('0x35')]=_0x4bdf30[_0x7fd5('0x35')]['length']?_0x4bdf30[_0x7fd5('0x35')]:_0x4e5d78[_0x7fd5('0x2f')];if(_0x5c0beb[_0x7fd5('0x30')][_0x7fd5('0x44')]){_0x4bdf30[_0x7fd5('0x40')]=[{'all':!![]}];}_0x4bdf30=_['merge']({},_0x4bdf30,_0x5c0beb[_0x7fd5('0x3e')]);return db['CmList'][_0x7fd5('0x45')](_0x4bdf30)['then'](handleEntityNotFound(_0x31c420,null))[_0x7fd5('0x25')](respondWithResult(_0x31c420,null))['catch'](handleError(_0x31c420,null));};exports[_0x7fd5('0x46')]=function(_0x5cfa9a,_0xa6357){return db['CmList'][_0x7fd5('0x46')](_0x5cfa9a[_0x7fd5('0x47')],{})['then'](function(_0x23f15d){var _0x1bcdc0=_0x5cfa9a[_0x7fd5('0x48')]['get']({'plain':!![]});if(!_0x1bcdc0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bcdc0[_0x7fd5('0x49')]===_0x7fd5('0x48')){var _0x2e929b=_0x23f15d[_0x7fd5('0x26')]({'plain':!![]});var _0x39e7e9=_0x7fd5('0x4a');return db[_0x7fd5('0x4b')][_0x7fd5('0x45')]({'where':{'name':_0x39e7e9,'userProfileId':_0x1bcdc0[_0x7fd5('0x4c')]},'raw':!![]})[_0x7fd5('0x25')](function(_0x3324fc){if(_0x3324fc&&_0x3324fc[_0x7fd5('0x4d')]===0x0){return db[_0x7fd5('0x27')]['create']({'name':_0x2e929b[_0x7fd5('0x2a')],'resourceId':_0x2e929b['id'],'type':_0x3324fc['name'],'sectionId':_0x3324fc['id']},{})[_0x7fd5('0x25')](function(){return _0x23f15d;});}else{return _0x23f15d;}})[_0x7fd5('0x41')](function(_0x371bc7){logger[_0x7fd5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371bc7);throw _0x371bc7;});}return _0x23f15d;})['then'](respondWithResult(_0xa6357,0xc9))[_0x7fd5('0x41')](handleError(_0xa6357,null));};exports[_0x7fd5('0x24')]=function(_0x3c65c3,_0x248b21){if(_0x3c65c3[_0x7fd5('0x47')]['id']){delete _0x3c65c3[_0x7fd5('0x47')]['id'];}return db[_0x7fd5('0x3f')][_0x7fd5('0x45')]({'where':{'id':_0x3c65c3[_0x7fd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x248b21,null))['then'](saveUpdates(_0x3c65c3[_0x7fd5('0x47')],null))[_0x7fd5('0x25')](respondWithResult(_0x248b21,null))[_0x7fd5('0x41')](handleError(_0x248b21,null));};exports[_0x7fd5('0x4e')]=function(_0x41f6ba,_0x949796){return db[_0x7fd5('0x3f')]['find']({'where':{'id':_0x41f6ba[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x949796,null))[_0x7fd5('0x25')](removeEntity(_0x949796,null))[_0x7fd5('0x41')](handleError(_0x949796,null));};exports[_0x7fd5('0x4f')]=function(_0x24ff19,_0x52075c){return db['CmList'][_0x7fd5('0x4f')]()[_0x7fd5('0x25')](respondWithResult(_0x52075c,null))['catch'](handleError(_0x52075c,null));};exports[_0x7fd5('0x50')]=function(_0x35bf6c,_0x2f3ad6,_0x4e6eb3){if(_0x35bf6c['body']['id']){delete _0x35bf6c[_0x7fd5('0x47')]['id'];}return db[_0x7fd5('0x3f')][_0x7fd5('0x45')]({'where':{'id':_0x35bf6c['params']['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x2f3ad6,null))[_0x7fd5('0x25')](function(_0x11aa41){if(_0x11aa41){_0x35bf6c['body'][_0x7fd5('0x51')]=_0x11aa41['id'];return db['Disposition'][_0x7fd5('0x46')](_0x35bf6c[_0x7fd5('0x47')]);}})[_0x7fd5('0x25')](respondWithResult(_0x2f3ad6,null))['catch'](handleError(_0x2f3ad6,null));};exports['getDispositions']=function(_0xd0bab0,_0x42d2de,_0x580e60){var _0x157144={'raw':![],'where':{}};var _0x56c427={};var _0x167dfe={'count':0x0,'rows':[]};return db[_0x7fd5('0x3f')][_0x7fd5('0x52')]({'where':{'id':_0xd0bab0[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x42d2de,null))[_0x7fd5('0x25')](function(_0x3c3602){if(_0x3c3602){_0x56c427[_0x7fd5('0x2f')]=_[_0x7fd5('0x31')](db[_0x7fd5('0x53')][_0x7fd5('0x2d')]);_0x56c427[_0x7fd5('0x30')]=_['keys'](_0xd0bab0['query']);_0x56c427[_0x7fd5('0x32')]=_['intersection'](_0x56c427[_0x7fd5('0x2f')],_0x56c427[_0x7fd5('0x30')]);_0x157144['attributes']=_[_0x7fd5('0x33')](_0x56c427[_0x7fd5('0x2f')],qs[_0x7fd5('0x34')](_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x34')]));_0x157144[_0x7fd5('0x35')]=_0x157144[_0x7fd5('0x35')][_0x7fd5('0x54')]?_0x157144[_0x7fd5('0x35')]:_0x56c427[_0x7fd5('0x2f')];if(!_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x36')](_0x7fd5('0x55'))){_0x157144[_0x7fd5('0x37')]=qs[_0x7fd5('0x37')](_0xd0bab0['query'][_0x7fd5('0x37')]);_0x157144[_0x7fd5('0x1e')]=qs[_0x7fd5('0x1e')](_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x1e')]);}_0x157144[_0x7fd5('0x38')]=qs[_0x7fd5('0x39')](_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x39')]);_0x157144[_0x7fd5('0x3a')]=qs[_0x7fd5('0x32')](_[_0x7fd5('0x3b')](_0xd0bab0[_0x7fd5('0x30')],_0x56c427[_0x7fd5('0x32')]));_0x157144['where'][_0x7fd5('0x51')]=_0x3c3602['id'];if(_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x3c')]){_0x157144[_0x7fd5('0x3a')]=_[_0x7fd5('0x3d')](_0x157144[_0x7fd5('0x3a')],{'$or':_[_0x7fd5('0x2c')](_0x157144[_0x7fd5('0x35')],function(_0x57da61){var _0x322923={};_0x322923[_0x57da61]={'$like':'%'+_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x3c')]+'%'};return _0x322923;})});}_0x157144=_[_0x7fd5('0x3d')]({},_0x157144,_0xd0bab0['options']);return db[_0x7fd5('0x53')][_0x7fd5('0x20')]({'where':_0x157144[_0x7fd5('0x3a')]})[_0x7fd5('0x25')](function(_0x3b40c9){_0x167dfe['count']=_0x3b40c9;if(_0xd0bab0[_0x7fd5('0x30')][_0x7fd5('0x44')]){_0x157144[_0x7fd5('0x40')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x157144);})[_0x7fd5('0x25')](function(_0x184fa4){_0x167dfe[_0x7fd5('0x56')]=_0x184fa4;return _0x167dfe;});}})[_0x7fd5('0x25')](respondWithFilteredResult(_0x42d2de,_0x157144))[_0x7fd5('0x41')](handleError(_0x42d2de,null));};exports[_0x7fd5('0x57')]=function(_0x555430,_0x9f454f,_0x4c2500){return db['CmList'][_0x7fd5('0x45')]({'where':{'id':_0x555430[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x9f454f,null))[_0x7fd5('0x25')](function(_0x192d4e){if(_0x192d4e){return _0x192d4e['removeDispositions'](_0x555430['query']['ids']);}})[_0x7fd5('0x25')](respondWithStatusCode(_0x9f454f,null))[_0x7fd5('0x41')](handleError(_0x9f454f,null));};exports[_0x7fd5('0x58')]=function(_0xcfbb55,_0x2297ea,_0x27c106){return db[_0x7fd5('0x3f')][_0x7fd5('0x45')]({'where':{'id':_0xcfbb55[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x2297ea,null))[_0x7fd5('0x25')](function(_0x491910){if(_0x491910){var _0x32bece=[];var _0x4aaae8={'success':[],'errors':[]};return db[_0x7fd5('0x59')][_0x7fd5('0x4f')]()[_0x7fd5('0x25')](function(_0x5e330a){if(_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x5a')]&&_['isArray'](_0xcfbb55[_0x7fd5('0x47')]['tags'])){if(_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x5a')][_0x7fd5('0x54')]){_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x5a')]=_0xcfbb55[_0x7fd5('0x47')]['tags'][_0x7fd5('0x5b')](';')+';';}else{_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x5a')]=null;}}else{_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x5a')]=null;}if(_0xcfbb55[_0x7fd5('0x47')]&&_[_0x7fd5('0x5c')](_0xcfbb55['body'])){for(var _0x164997=0x0;_0x164997<_0xcfbb55[_0x7fd5('0x47')][_0x7fd5('0x54')];_0x164997+=0x1){_0xcfbb55['body'][_0x164997]['ListId']=_0xcfbb55[_0x7fd5('0x43')]['id'];_0x32bece[_0x7fd5('0x5d')](_0xcfbb55['body'][_0x164997]);}return BPromise[_0x7fd5('0x5e')](_0x32bece,function(_0x2ba8af){return db[_0x7fd5('0x59')][_0x7fd5('0x46')](_[_0x7fd5('0x5f')](_0x2ba8af,[_0x7fd5('0x60'),'id'])||{},{'fields':_['keys'](_0x5e330a),'raw':!![]})[_0x7fd5('0x25')](function(_0x3d7ef2){_0x4aaae8['success'][_0x7fd5('0x5d')](_0x3d7ef2[_0x7fd5('0x61')]);})[_0x7fd5('0x41')](function(_0x37267){_0x4aaae8['errors']['push']({'data':_0x2ba8af,'error':_0x37267[_0x7fd5('0x62')]});});})[_0x7fd5('0x25')](function(_0x36ba0f){return _0x4aaae8;})[_0x7fd5('0x41')](function(_0x84d383){return _0x84d383;});}else{_0x2297ea['status'](0x190)[_0x7fd5('0x1d')]({'message':_0x7fd5('0x63')});}});}})[_0x7fd5('0x25')](respondWithResult(_0x2297ea,null))[_0x7fd5('0x41')](handleError(_0x2297ea,null));};exports[_0x7fd5('0x64')]=function(_0x35159d,_0x1882d0,_0x646d89){var _0x2118cd;return db['CmList'][_0x7fd5('0x45')]({'where':{'id':_0x35159d[_0x7fd5('0x43')]['id']},'include':[{'model':db[_0x7fd5('0x65')],'as':_0x7fd5('0x66')}]})[_0x7fd5('0x25')](handleEntityNotFound(_0x1882d0,null))['then'](function(_0x4b0566){if(_0x4b0566){_0x2118cd=_0x4b0566;return db['CmContact']['rawAttributes'];}})[_0x7fd5('0x25')](function(_0xef60eb){if(_0xef60eb){var _0x5cbc9c={};var _0x9d7add={};_0x9d7add[_0x7fd5('0x2f')]=_[_0x7fd5('0x67')](_['keys'](_0xef60eb),_['map'](_0x2118cd[_0x7fd5('0x66')],function(_0x3f4d50){return util[_0x7fd5('0x68')](_0x7fd5('0x69'),_0x3f4d50['id']);}));_0x9d7add[_0x7fd5('0x30')]=_[_0x7fd5('0x31')](_0x35159d[_0x7fd5('0x30')]);_0x9d7add[_0x7fd5('0x32')]=_[_0x7fd5('0x33')](_0x9d7add[_0x7fd5('0x2f')],_0x9d7add[_0x7fd5('0x30')]);_0x5cbc9c[_0x7fd5('0x35')]=_[_0x7fd5('0x33')](_0x9d7add[_0x7fd5('0x2f')],qs[_0x7fd5('0x34')](_0x35159d[_0x7fd5('0x30')][_0x7fd5('0x34')]));_0x5cbc9c[_0x7fd5('0x35')]=_0x5cbc9c[_0x7fd5('0x35')][_0x7fd5('0x54')]?_0x5cbc9c[_0x7fd5('0x35')]:_0x9d7add[_0x7fd5('0x2f')];if(!_0x35159d[_0x7fd5('0x30')][_0x7fd5('0x36')]('nolimit')){_0x5cbc9c[_0x7fd5('0x37')]=qs[_0x7fd5('0x37')](_0x35159d[_0x7fd5('0x30')][_0x7fd5('0x37')]);_0x5cbc9c[_0x7fd5('0x1e')]=qs['offset'](_0x35159d['query'][_0x7fd5('0x1e')]);}_0x5cbc9c['order']=qs['sort'](_0x35159d[_0x7fd5('0x30')][_0x7fd5('0x39')]);_0x5cbc9c[_0x7fd5('0x3a')]=qs[_0x7fd5('0x32')](_['pick'](_0x35159d[_0x7fd5('0x30')],_0x9d7add[_0x7fd5('0x32')]));_0x5cbc9c[_0x7fd5('0x6a')]=!![];if(_0x35159d['query'][_0x7fd5('0x3c')]){_0x5cbc9c[_0x7fd5('0x3a')]=_[_0x7fd5('0x3d')](_0x5cbc9c[_0x7fd5('0x3a')],{'$or':_[_0x7fd5('0x2c')](_0x5cbc9c['attributes'],function(_0x4d3146){var _0x1ddf23={};_0x1ddf23[_0x4d3146]={'$like':'%'+_0x35159d['query'][_0x7fd5('0x3c')]+'%'};return _0x1ddf23;})});}_0x5cbc9c=_[_0x7fd5('0x3d')]({},_0x5cbc9c,_0x35159d[_0x7fd5('0x3e')]);return _0x2118cd[_0x7fd5('0x64')](_0x5cbc9c);}})[_0x7fd5('0x25')](respondWithResult(_0x1882d0,null))[_0x7fd5('0x41')](handleError(_0x1882d0,null));};exports[_0x7fd5('0x6b')]=function(_0x556b48,_0xbfc2bd,_0xba5640){var _0x56de15;var _0x1d2d79;var _0x9c1034;var _0x4bb478=_0x556b48[_0x7fd5('0x43')]['id'];csv_results=[];return db[_0x7fd5('0x6c')][_0x7fd5('0x6d')]({'attributes':['id',_0x7fd5('0x2a')],'raw':!![],'order':[_0x7fd5('0x6e')]})[_0x7fd5('0x25')](function(_0x19c5f4){_0x56de15=_0x19c5f4;var _0x363f1f=_[_0x7fd5('0x31')](db[_0x7fd5('0x59')]['rawAttributes']);return db['CmCustomField'][_0x7fd5('0x6d')]({'raw':!![],'attributes':['id','alias']})[_0x7fd5('0x25')](function(_0x10e32f){_0x1d2d79=_0x10e32f;var _0x31bc67=squel[_0x7fd5('0x6f')]()[_0x7fd5('0x34')](_0x363f1f)[_0x7fd5('0x70')]('cm_contacts','c')[_0x7fd5('0x3a')](_0x7fd5('0x71'),_0x4bb478)['where'](_0x7fd5('0x72'))['distinct']();for(var _0x54e5a7=0x0;_0x54e5a7<_0x1d2d79['length'];_0x54e5a7++){_0x31bc67[_0x7fd5('0x73')]('c.cf_'+_0x1d2d79[_0x54e5a7]['id'],'customField_'+_0x1d2d79[_0x54e5a7][_0x7fd5('0x74')]);}for(var _0x54e5a7=0x0;_0x54e5a7<_0x56de15[_0x7fd5('0x54')];_0x54e5a7++){_0x31bc67[_0x7fd5('0x73')](squel['select']()[_0x7fd5('0x73')](_0x7fd5('0x75'))[_0x7fd5('0x70')](_0x7fd5('0x76'))[_0x7fd5('0x3a')]('ItemTypeId\x20=\x20?',_0x56de15[_0x54e5a7]['id'])[_0x7fd5('0x3a')]('CmContactId\x20=\x20c.id'),_0x7fd5('0x77')+_0x56de15[_0x54e5a7][_0x7fd5('0x2a')]);_0x31bc67[_0x7fd5('0x73')](squel[_0x7fd5('0x6f')]()[_0x7fd5('0x73')](_0x7fd5('0x78'))[_0x7fd5('0x70')](_0x7fd5('0x76'))[_0x7fd5('0x3a')](_0x7fd5('0x79'),_0x56de15[_0x54e5a7]['id'])[_0x7fd5('0x3a')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x56de15[_0x54e5a7]['name']);}var _0x473d9d=[];_0x473d9d[_0x7fd5('0x5d')](_0x31bc67[_0x7fd5('0x7a')]());BPromise[_0x7fd5('0x5e')](_0x473d9d,handleQuery)['then'](function(_0x3c429f){handleQuery(_0x31bc67['toString']());var _0x2db706=csv_results[0x0];if(!_['isEmpty'](_0x2db706)){var _0x89b687=toCsv(_0x2db706);var _0x2d02b6=Date[_0x7fd5('0x7b')]();fs[_0x7fd5('0x7c')](util['format'](_0x7fd5('0x7d'),_0x4bb478,_0x2d02b6),_0x89b687);_0xbfc2bd['setHeader'](_0x7fd5('0x7e'),_0x7fd5('0x7f')+util[_0x7fd5('0x68')](_0x7fd5('0x80'),_0x4bb478,_0x2d02b6));_0xbfc2bd[_0x7fd5('0x81')](_0x7fd5('0x82'),_0x7fd5('0x83'));return _0xbfc2bd['download'](util[_0x7fd5('0x68')]('/tmp/list_%d_%s.csv',_0x4bb478,_0x2d02b6));}else{return _0xbfc2bd[_0x7fd5('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x113a9a,_0x28a72d,_0x1cfca7){var _0x3e3d2a;delete _0x113a9a[_0x7fd5('0x47')]['id'];return db[_0x7fd5('0x3f')][_0x7fd5('0x52')]({'where':{'id':_0x113a9a[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x28a72d,null))[_0x7fd5('0x25')](function(_0x5388dc){if(_0x5388dc){return db['sequelize'][_0x7fd5('0x84')](function(_0x51c3cb){return db[_0x7fd5('0x65')]['create'](_0x113a9a[_0x7fd5('0x47')],{'transaction':_0x51c3cb})[_0x7fd5('0x25')](function(_0x34f668){_0x3e3d2a=_0x34f668;return _0x5388dc[_0x7fd5('0x85')](_0x34f668,{'transaction':_0x51c3cb});})[_0x7fd5('0x25')](function(){var _0x15e5ab={'type':db[_0x7fd5('0x86')][_0x7fd5('0x87')],'transaction':_0x51c3cb};switch(_0x113a9a[_0x7fd5('0x47')]['type']){case _0x7fd5('0x88'):_0x15e5ab[_0x7fd5('0x2e')]=db[_0x7fd5('0x86')][_0x7fd5('0x87')];break;case _0x7fd5('0x89'):_0x15e5ab['type']=db[_0x7fd5('0x86')][_0x7fd5('0x8a')];break;case _0x7fd5('0x8b'):_0x15e5ab[_0x7fd5('0x2e')]=db[_0x7fd5('0x86')][_0x7fd5('0x8c')];_0x15e5ab[_0x7fd5('0x8d')]=![];break;default:}return db[_0x7fd5('0x8e')][_0x7fd5('0x8f')][_0x7fd5('0x90')](_0x7fd5('0x91'),util[_0x7fd5('0x68')]('cf_%s',_0x3e3d2a['id']),_0x15e5ab);})[_0x7fd5('0x25')](function(){return _0x3e3d2a;});});}})[_0x7fd5('0x25')](respondWithResult(_0x28a72d,null))[_0x7fd5('0x41')](handleError(_0x28a72d,null));};exports[_0x7fd5('0x92')]=function(_0x4d86fa,_0x242c3f,_0x59a06c){var _0x38dbe3={};var _0x4809bb={};var _0x3a2bc0;var _0x1629c6;return db['CmList']['findOne']({'where':{'id':_0x4d86fa[_0x7fd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x242c3f,null))[_0x7fd5('0x25')](function(_0x2388cc){if(_0x2388cc){_0x3a2bc0=_0x2388cc;_0x4809bb['model']=_[_0x7fd5('0x31')](db[_0x7fd5('0x65')][_0x7fd5('0x2d')]);_0x4809bb[_0x7fd5('0x30')]=_['keys'](_0x4d86fa[_0x7fd5('0x30')]);_0x4809bb[_0x7fd5('0x32')]=_[_0x7fd5('0x33')](_0x4809bb[_0x7fd5('0x2f')],_0x4809bb['query']);_0x38dbe3[_0x7fd5('0x35')]=_[_0x7fd5('0x33')](_0x4809bb['model'],qs[_0x7fd5('0x34')](_0x4d86fa[_0x7fd5('0x30')]['fields']));_0x38dbe3['attributes']=_0x38dbe3[_0x7fd5('0x35')][_0x7fd5('0x54')]?_0x38dbe3[_0x7fd5('0x35')]:_0x4809bb[_0x7fd5('0x2f')];_0x38dbe3[_0x7fd5('0x38')]=qs[_0x7fd5('0x39')](_0x4d86fa['query'][_0x7fd5('0x39')]);_0x38dbe3[_0x7fd5('0x3a')]=qs[_0x7fd5('0x32')](_[_0x7fd5('0x3b')](_0x4d86fa['query'],_0x4809bb[_0x7fd5('0x32')]));_0x38dbe3['where']=_['merge'](_0x38dbe3[_0x7fd5('0x3a')],{'$or':[{'ListId':_0x2388cc['id']},{'ListId':null}]});if(_0x4d86fa['query'][_0x7fd5('0x3c')]){_0x38dbe3[_0x7fd5('0x3a')]=_[_0x7fd5('0x3d')](_0x38dbe3['where'],{'$or':_['map'](_0x38dbe3['attributes'],function(_0x33ba09){var _0x1ff0c9={};_0x1ff0c9[_0x33ba09]={'$like':'%'+_0x4d86fa[_0x7fd5('0x30')][_0x7fd5('0x3c')]+'%'};return _0x1ff0c9;})});}_0x38dbe3=_['merge']({},_0x38dbe3,_0x4d86fa[_0x7fd5('0x3e')]);return db[_0x7fd5('0x65')]['findAndCountAll'](_0x38dbe3);}})[_0x7fd5('0x25')](respondWithResult(_0x242c3f,null))[_0x7fd5('0x41')](handleError(_0x242c3f,null));};exports[_0x7fd5('0x93')]=function(_0x2b49f1,_0x51ce71){return db['CmCustomField'][_0x7fd5('0x94')]({'where':{'ListId':null}})[_0x7fd5('0x25')](handleEntityNotFound(_0x51ce71,null))['then'](function(_0x3c42c7){return _0x3c42c7;})[_0x7fd5('0x25')](respondWithResult(_0x51ce71,null))['catch'](handleError(_0x51ce71,null));};exports['addAgents']=function(_0x4ae148,_0x434a1a,_0x13998a){return db['CmList'][_0x7fd5('0x45')]({'where':{'id':_0x4ae148[_0x7fd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x434a1a,null))[_0x7fd5('0x25')](function(_0x3cd264){if(_0x3cd264){return _0x3cd264['addAgents'](_0x4ae148['body'][_0x7fd5('0x60')],_[_0x7fd5('0x5f')](_0x4ae148[_0x7fd5('0x47')],[_0x7fd5('0x60'),'id'])||{})[_0x7fd5('0x95')](function(_0x424bf1){for(var _0x3d8335=0x0;_0x3d8335<_0x4ae148['body'][_0x7fd5('0x60')][_0x7fd5('0x54')];_0x3d8335+=0x1){socket[_0x7fd5('0x96')](_0x7fd5('0x97'),{'UserId':Number(_0x4ae148[_0x7fd5('0x47')][_0x7fd5('0x60')][_0x3d8335]),'CmListId':Number(_0x4ae148[_0x7fd5('0x43')]['id'])});}return _0x424bf1;});}})[_0x7fd5('0x25')](respondWithResult(_0x434a1a,null))[_0x7fd5('0x41')](handleError(_0x434a1a,null));};exports[_0x7fd5('0x98')]=function(_0x38233d,_0x1e6d68,_0xa33949){return db['CmList'][_0x7fd5('0x45')]({'where':{'id':_0x38233d['params']['id']}})['then'](handleEntityNotFound(_0x1e6d68,null))[_0x7fd5('0x25')](function(_0x494e47){if(_0x494e47){return _0x494e47[_0x7fd5('0x98')](_0x38233d[_0x7fd5('0x30')][_0x7fd5('0x60')])[_0x7fd5('0x25')](function(){if(_[_0x7fd5('0x5c')](_0x38233d[_0x7fd5('0x30')]['ids'])){for(var _0x17aa9d=0x0;_0x17aa9d<_0x38233d[_0x7fd5('0x30')][_0x7fd5('0x60')][_0x7fd5('0x54')];_0x17aa9d+=0x1){socket[_0x7fd5('0x96')](_0x7fd5('0x99'),{'UserId':Number(_0x38233d[_0x7fd5('0x30')][_0x7fd5('0x60')][_0x17aa9d]),'CmListId':Number(_0x38233d[_0x7fd5('0x43')]['id'])});}}else{socket[_0x7fd5('0x96')](_0x7fd5('0x99'),{'UserId':Number(_0x38233d[_0x7fd5('0x30')][_0x7fd5('0x60')]),'CmListId':Number(_0x38233d[_0x7fd5('0x43')]['id'])});}});}})[_0x7fd5('0x25')](respondWithStatusCode(_0x1e6d68,null))[_0x7fd5('0x41')](handleError(_0x1e6d68,null));};exports['getAgents']=function(_0x245864,_0x3f1af1,_0x1936c1){var _0x401df4={};var _0x567188={};var _0x4d30d8;var _0x2cb096;return db['CmList']['findOne']({'where':{'id':_0x245864[_0x7fd5('0x43')]['id']}})[_0x7fd5('0x25')](handleEntityNotFound(_0x3f1af1,null))[_0x7fd5('0x25')](function(_0x4b3093){if(_0x4b3093){_0x4d30d8=_0x4b3093;_0x567188[_0x7fd5('0x2f')]=_[_0x7fd5('0x31')](db['User'][_0x7fd5('0x2d')]);_0x567188['query']=_[_0x7fd5('0x31')](_0x245864['query']);_0x567188['filters']=_[_0x7fd5('0x33')](_0x567188['model'],_0x567188[_0x7fd5('0x30')]);_0x401df4[_0x7fd5('0x35')]=_[_0x7fd5('0x33')](_0x567188[_0x7fd5('0x2f')],qs[_0x7fd5('0x34')](_0x245864[_0x7fd5('0x30')]['fields']));_0x401df4[_0x7fd5('0x35')]=_0x401df4[_0x7fd5('0x35')][_0x7fd5('0x54')]?_0x401df4[_0x7fd5('0x35')]:_0x567188[_0x7fd5('0x2f')];_0x401df4[_0x7fd5('0x38')]=qs['sort'](_0x245864[_0x7fd5('0x30')][_0x7fd5('0x39')]);_0x401df4[_0x7fd5('0x3a')]=qs['filters'](_[_0x7fd5('0x3b')](_0x245864['query'],_0x567188[_0x7fd5('0x32')]));if(_0x245864[_0x7fd5('0x30')][_0x7fd5('0x3c')]){_0x401df4[_0x7fd5('0x3a')]=_[_0x7fd5('0x3d')](_0x401df4[_0x7fd5('0x3a')],{'$or':_[_0x7fd5('0x2c')](_0x401df4['attributes'],function(_0x57e1eb){var _0x492fec={};_0x492fec[_0x57e1eb]={'$like':'%'+_0x245864[_0x7fd5('0x30')]['filter']+'%'};return _0x492fec;})});}_0x401df4=_[_0x7fd5('0x3d')]({},_0x401df4,_0x245864['options']);return _0x4d30d8[_0x7fd5('0x9a')](_0x401df4);}})[_0x7fd5('0x25')](function(_0x2cea68){if(_0x2cea68){_0x2cb096=_0x2cea68[_0x7fd5('0x54')];if(!_0x245864['query']['hasOwnProperty'](_0x7fd5('0x55'))){_0x401df4[_0x7fd5('0x37')]=qs[_0x7fd5('0x37')](_0x245864[_0x7fd5('0x30')][_0x7fd5('0x37')]);_0x401df4[_0x7fd5('0x1e')]=qs[_0x7fd5('0x1e')](_0x245864[_0x7fd5('0x30')][_0x7fd5('0x1e')]);}return _0x4d30d8[_0x7fd5('0x9a')](_0x401df4);}})['then'](function(_0x3911d7){if(_0x3911d7){return _0x3911d7?{'count':_0x2cb096,'rows':_0x3911d7}:null;}})[_0x7fd5('0x25')](respondWithResult(_0x3f1af1,null))[_0x7fd5('0x41')](handleError(_0x3f1af1,null));};function handleQuery(_0x4bb51e){logger[_0x7fd5('0x9b')](_0x4bb51e);return db[_0x7fd5('0x8e')][_0x7fd5('0x30')](_0x4bb51e)['spread'](function(_0xc85e01){csv_results[_0x7fd5('0x5d')](_0xc85e01);})['catch'](function(_0x250c83){logger[_0x7fd5('0x29')](_0x250c83[_0x7fd5('0x62')]);});} \ No newline at end of file +var _0xe951=['c.cf_','alias','field','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','CmCustomField','addCustomFields','TEXT','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','message','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','name','send','index','CmList','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','describe','Disposition','getDispositions','findOne','order','ListId','include','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','findAll','select','from','c.ListId\x20=\x20?'];(function(_0x54622b,_0x388fce){var _0x303c2c=function(_0x3a9f28){while(--_0x3a9f28){_0x54622b['push'](_0x54622b['shift']());}};_0x303c2c(++_0x388fce);}(_0xe951,0xca));var _0x1e95=function(_0x2972cf,_0x343fde){_0x2972cf=_0x2972cf-0x0;var _0x4c173f=_0xe951[_0x2972cf];return _0x4c173f;};'use strict';var emlformat=require(_0x1e95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e95('0x1'));var jsonpatch=require(_0x1e95('0x2'));var rp=require(_0x1e95('0x3'));var moment=require(_0x1e95('0x4'));var BPromise=require(_0x1e95('0x5'));var Mustache=require(_0x1e95('0x6'));var util=require(_0x1e95('0x7'));var path=require('path');var sox=require(_0x1e95('0x8'));var csv=require('to-csv');var ejs=require(_0x1e95('0x9'));var fs=require('fs');var fs_extra=require(_0x1e95('0xa'));var _=require(_0x1e95('0xb'));var squel=require(_0x1e95('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1e95('0xd'));var toCsv=require(_0x1e95('0xe'));var querystring=require(_0x1e95('0xf'));var Papa=require('papaparse');var Redis=require(_0x1e95('0x10'));var authService=require(_0x1e95('0x11'));var qs=require(_0x1e95('0x12'));var as=require(_0x1e95('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e95('0x14'))(_0x1e95('0x15'));var utils=require(_0x1e95('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1e95('0x17'));var db=require(_0x1e95('0x18'))['db'];var csv_results;config['redis']=_[_0x1e95('0x19')](config[_0x1e95('0x1a')],{'host':_0x1e95('0x1b'),'port':0x18eb});var socket=require(_0x1e95('0x1c'))(new Redis(config[_0x1e95('0x1a')]));require(_0x1e95('0x1d'))[_0x1e95('0x1e')](socket);function respondWithStatusCode(_0x459383,_0x48348d){_0x48348d=_0x48348d||0xcc;return function(_0x30b8b4){if(_0x30b8b4){return _0x459383[_0x1e95('0x1f')](_0x48348d);}return _0x459383[_0x1e95('0x20')](_0x48348d)[_0x1e95('0x21')]();};}function respondWithResult(_0x1fbb3e,_0x44b8d3){_0x44b8d3=_0x44b8d3||0xc8;return function(_0x52d641){if(_0x52d641){return _0x1fbb3e['status'](_0x44b8d3)[_0x1e95('0x22')](_0x52d641);}};}function respondWithFilteredResult(_0x34eb9c,_0x4ae3a8){return function(_0xa1ccb8){if(_0xa1ccb8){var _0x137829=typeof _0x4ae3a8['offset']==='undefined'&&typeof _0x4ae3a8[_0x1e95('0x23')]==='undefined';var _0x1019c9=_0xa1ccb8[_0x1e95('0x24')];var _0x455b06=_0x137829?0x0:_0x4ae3a8[_0x1e95('0x25')];var _0x51c095=_0x137829?_0xa1ccb8[_0x1e95('0x24')]:_0x4ae3a8[_0x1e95('0x25')]+_0x4ae3a8[_0x1e95('0x23')];var _0x4190dd;if(_0x51c095>=_0x1019c9){_0x51c095=_0x1019c9;_0x4190dd=0xc8;}else{_0x4190dd=0xce;}_0x34eb9c['status'](_0x4190dd);return _0x34eb9c[_0x1e95('0x26')](_0x1e95('0x27'),_0x455b06+'-'+_0x51c095+'/'+_0x1019c9)[_0x1e95('0x22')](_0xa1ccb8);}return null;};}function patchUpdates(_0x562cc9){return function(_0x30fde1){try{jsonpatch['apply'](_0x30fde1,_0x562cc9,!![]);}catch(_0x2d0183){return BPromise[_0x1e95('0x28')](_0x2d0183);}return _0x30fde1[_0x1e95('0x29')]();};}function saveUpdates(_0x29196b,_0x2d4508){return function(_0x959311){if(_0x959311){return _0x959311[_0x1e95('0x2a')](_0x29196b)['then'](function(_0x1b86a9){return _0x1b86a9;});}return null;};}function removeEntity(_0x573703,_0x3b2027){return function(_0x9b9990){if(_0x9b9990){return _0x9b9990[_0x1e95('0x2b')]()[_0x1e95('0x2c')](function(){var _0x355ed9=_0x9b9990[_0x1e95('0x2d')]({'plain':!![]});var _0x39baf5=_0x1e95('0x2e');return db[_0x1e95('0x2f')]['destroy']({'where':{'type':_0x39baf5,'resourceId':_0x355ed9['id']}})['then'](function(){return _0x9b9990;});})[_0x1e95('0x2c')](function(){_0x573703[_0x1e95('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24edef,_0x4a7752){return function(_0x45f913){if(!_0x45f913){_0x24edef[_0x1e95('0x1f')](0x194);}return _0x45f913;};}function handleError(_0x394c47,_0x49a55c){_0x49a55c=_0x49a55c||0x1f4;return function(_0x299435){logger[_0x1e95('0x30')](_0x299435['stack']);if(_0x299435[_0x1e95('0x31')]){delete _0x299435[_0x1e95('0x31')];}_0x394c47[_0x1e95('0x20')](_0x49a55c)[_0x1e95('0x32')](_0x299435);};}exports[_0x1e95('0x33')]=function(_0x558708,_0x3ef5fb){var _0x57b7f0={},_0x1006b0={},_0x2d6026={'count':0x0,'rows':[]};var _0x3ab0d0=_['map'](db[_0x1e95('0x34')][_0x1e95('0x35')],function(_0x4d7bb3){return{'name':_0x4d7bb3['fieldName'],'type':_0x4d7bb3[_0x1e95('0x36')][_0x1e95('0x37')]};});_0x1006b0['model']=_[_0x1e95('0x38')](_0x3ab0d0,_0x1e95('0x31'));_0x1006b0['query']=_['keys'](_0x558708[_0x1e95('0x39')]);_0x1006b0[_0x1e95('0x3a')]=_['intersection'](_0x1006b0['model'],_0x1006b0[_0x1e95('0x39')]);_0x57b7f0['attributes']=_[_0x1e95('0x3b')](_0x1006b0[_0x1e95('0x3c')],qs[_0x1e95('0x3d')](_0x558708[_0x1e95('0x39')]['fields']));_0x57b7f0['attributes']=_0x57b7f0[_0x1e95('0x3e')][_0x1e95('0x3f')]?_0x57b7f0[_0x1e95('0x3e')]:_0x1006b0[_0x1e95('0x3c')];if(!_0x558708[_0x1e95('0x39')][_0x1e95('0x40')](_0x1e95('0x41'))){_0x57b7f0[_0x1e95('0x23')]=qs['limit'](_0x558708[_0x1e95('0x39')][_0x1e95('0x23')]);_0x57b7f0[_0x1e95('0x25')]=qs[_0x1e95('0x25')](_0x558708[_0x1e95('0x39')][_0x1e95('0x25')]);}_0x57b7f0['order']=qs['sort'](_0x558708[_0x1e95('0x39')][_0x1e95('0x42')]);_0x57b7f0['where']=qs['filters'](_[_0x1e95('0x43')](_0x558708['query'],_0x1006b0[_0x1e95('0x3a')]),_0x3ab0d0);if(_0x558708['query'][_0x1e95('0x44')]){_0x57b7f0[_0x1e95('0x45')]=_['merge'](_0x57b7f0[_0x1e95('0x45')],{'$or':_['map'](_0x3ab0d0,function(_0x4194a4){if(_0x4194a4[_0x1e95('0x36')]!==_0x1e95('0x46')){var _0x3c5ee1={};_0x3c5ee1[_0x4194a4[_0x1e95('0x31')]]={'$like':'%'+_0x558708[_0x1e95('0x39')]['filter']+'%'};return _0x3c5ee1;}})});}_0x57b7f0=_[_0x1e95('0x47')]({},_0x57b7f0,_0x558708[_0x1e95('0x48')]);var _0x205379={'where':_0x57b7f0[_0x1e95('0x45')]};return db['CmList'][_0x1e95('0x24')](_0x205379)[_0x1e95('0x2c')](function(_0xd03c2a){_0x2d6026[_0x1e95('0x24')]=_0xd03c2a;if(_0x558708[_0x1e95('0x39')][_0x1e95('0x49')]){_0x57b7f0['include']=[{'all':!![]}];}return db['CmList']['findAll'](_0x57b7f0);})[_0x1e95('0x2c')](function(_0x462349){_0x2d6026[_0x1e95('0x4a')]=_0x462349;return _0x2d6026;})[_0x1e95('0x2c')](respondWithFilteredResult(_0x3ef5fb,_0x57b7f0))[_0x1e95('0x4b')](handleError(_0x3ef5fb,null));};exports[_0x1e95('0x4c')]=function(_0x5c19a5,_0xf7220c){var _0x139c32={'raw':![],'where':{'id':_0x5c19a5['params']['id']}},_0x4aa526={};_0x4aa526['model']=_[_0x1e95('0x4d')](db['CmList'][_0x1e95('0x35')]);_0x4aa526[_0x1e95('0x39')]=_[_0x1e95('0x4d')](_0x5c19a5[_0x1e95('0x39')]);_0x4aa526['filters']=_[_0x1e95('0x3b')](_0x4aa526[_0x1e95('0x3c')],_0x4aa526[_0x1e95('0x39')]);_0x139c32[_0x1e95('0x3e')]=_['intersection'](_0x4aa526[_0x1e95('0x3c')],qs[_0x1e95('0x3d')](_0x5c19a5['query'][_0x1e95('0x3d')]));_0x139c32[_0x1e95('0x3e')]=_0x139c32[_0x1e95('0x3e')]['length']?_0x139c32[_0x1e95('0x3e')]:_0x4aa526[_0x1e95('0x3c')];if(_0x5c19a5[_0x1e95('0x39')][_0x1e95('0x49')]){_0x139c32['include']=[{'all':!![]}];}_0x139c32=_[_0x1e95('0x47')]({},_0x139c32,_0x5c19a5[_0x1e95('0x48')]);return db[_0x1e95('0x34')][_0x1e95('0x4e')](_0x139c32)[_0x1e95('0x2c')](handleEntityNotFound(_0xf7220c,null))[_0x1e95('0x2c')](respondWithResult(_0xf7220c,null))[_0x1e95('0x4b')](handleError(_0xf7220c,null));};exports[_0x1e95('0x4f')]=function(_0x2ac544,_0x19c614){return db[_0x1e95('0x34')][_0x1e95('0x4f')](_0x2ac544[_0x1e95('0x50')],{})['then'](function(_0x5118c7){var _0x2d05b5=_0x2ac544[_0x1e95('0x51')][_0x1e95('0x2d')]({'plain':!![]});if(!_0x2d05b5)throw new Error(_0x1e95('0x52'));if(_0x2d05b5['role']===_0x1e95('0x51')){var _0x3dbc7d=_0x5118c7[_0x1e95('0x2d')]({'plain':!![]});var _0x17f596=_0x1e95('0x2e');return db[_0x1e95('0x53')][_0x1e95('0x4e')]({'where':{'name':_0x17f596,'userProfileId':_0x2d05b5[_0x1e95('0x54')]},'raw':!![]})[_0x1e95('0x2c')](function(_0x36e925){if(_0x36e925&&_0x36e925[_0x1e95('0x55')]===0x0){return db[_0x1e95('0x2f')][_0x1e95('0x4f')]({'name':_0x3dbc7d[_0x1e95('0x31')],'resourceId':_0x3dbc7d['id'],'type':_0x36e925[_0x1e95('0x31')],'sectionId':_0x36e925['id']},{})[_0x1e95('0x2c')](function(){return _0x5118c7;});}else{return _0x5118c7;}})[_0x1e95('0x4b')](function(_0x49e10a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49e10a);throw _0x49e10a;});}return _0x5118c7;})[_0x1e95('0x2c')](respondWithResult(_0x19c614,0xc9))[_0x1e95('0x4b')](handleError(_0x19c614,null));};exports[_0x1e95('0x2a')]=function(_0x5c7dc1,_0x1828af){if(_0x5c7dc1[_0x1e95('0x50')]['id']){delete _0x5c7dc1['body']['id'];}return db[_0x1e95('0x34')][_0x1e95('0x4e')]({'where':{'id':_0x5c7dc1[_0x1e95('0x56')]['id']}})['then'](handleEntityNotFound(_0x1828af,null))['then'](saveUpdates(_0x5c7dc1['body'],null))['then'](respondWithResult(_0x1828af,null))[_0x1e95('0x4b')](handleError(_0x1828af,null));};exports[_0x1e95('0x2b')]=function(_0x4e2684,_0x405b27){return db['CmList'][_0x1e95('0x4e')]({'where':{'id':_0x4e2684[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x405b27,null))[_0x1e95('0x2c')](removeEntity(_0x405b27,null))[_0x1e95('0x4b')](handleError(_0x405b27,null));};exports[_0x1e95('0x57')]=function(_0x9102a3,_0x1ba780){return db[_0x1e95('0x34')]['describe']()[_0x1e95('0x2c')](respondWithResult(_0x1ba780,null))[_0x1e95('0x4b')](handleError(_0x1ba780,null));};exports['addDisposition']=function(_0x45b265,_0x380814,_0x19b466){if(_0x45b265['body']['id']){delete _0x45b265[_0x1e95('0x50')]['id'];}return db[_0x1e95('0x34')][_0x1e95('0x4e')]({'where':{'id':_0x45b265[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x380814,null))[_0x1e95('0x2c')](function(_0x1f0868){if(_0x1f0868){_0x45b265[_0x1e95('0x50')]['ListId']=_0x1f0868['id'];return db[_0x1e95('0x58')][_0x1e95('0x4f')](_0x45b265[_0x1e95('0x50')]);}})[_0x1e95('0x2c')](respondWithResult(_0x380814,null))[_0x1e95('0x4b')](handleError(_0x380814,null));};exports[_0x1e95('0x59')]=function(_0x5563b2,_0x364808,_0x47a74a){var _0x2d321e={'raw':![],'where':{}};var _0x508535={};var _0x23c7f4={'count':0x0,'rows':[]};return db['CmList'][_0x1e95('0x5a')]({'where':{'id':_0x5563b2[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x364808,null))[_0x1e95('0x2c')](function(_0xb0670d){if(_0xb0670d){_0x508535[_0x1e95('0x3c')]=_[_0x1e95('0x4d')](db[_0x1e95('0x58')][_0x1e95('0x35')]);_0x508535[_0x1e95('0x39')]=_[_0x1e95('0x4d')](_0x5563b2['query']);_0x508535[_0x1e95('0x3a')]=_[_0x1e95('0x3b')](_0x508535[_0x1e95('0x3c')],_0x508535[_0x1e95('0x39')]);_0x2d321e[_0x1e95('0x3e')]=_[_0x1e95('0x3b')](_0x508535['model'],qs[_0x1e95('0x3d')](_0x5563b2[_0x1e95('0x39')]['fields']));_0x2d321e[_0x1e95('0x3e')]=_0x2d321e[_0x1e95('0x3e')][_0x1e95('0x3f')]?_0x2d321e[_0x1e95('0x3e')]:_0x508535[_0x1e95('0x3c')];if(!_0x5563b2[_0x1e95('0x39')][_0x1e95('0x40')](_0x1e95('0x41'))){_0x2d321e[_0x1e95('0x23')]=qs[_0x1e95('0x23')](_0x5563b2[_0x1e95('0x39')][_0x1e95('0x23')]);_0x2d321e[_0x1e95('0x25')]=qs[_0x1e95('0x25')](_0x5563b2['query'][_0x1e95('0x25')]);}_0x2d321e[_0x1e95('0x5b')]=qs[_0x1e95('0x42')](_0x5563b2[_0x1e95('0x39')]['sort']);_0x2d321e[_0x1e95('0x45')]=qs[_0x1e95('0x3a')](_[_0x1e95('0x43')](_0x5563b2[_0x1e95('0x39')],_0x508535[_0x1e95('0x3a')]));_0x2d321e[_0x1e95('0x45')][_0x1e95('0x5c')]=_0xb0670d['id'];if(_0x5563b2['query'][_0x1e95('0x44')]){_0x2d321e[_0x1e95('0x45')]=_[_0x1e95('0x47')](_0x2d321e[_0x1e95('0x45')],{'$or':_[_0x1e95('0x38')](_0x2d321e[_0x1e95('0x3e')],function(_0x3d54e7){var _0x3d0fe1={};_0x3d0fe1[_0x3d54e7]={'$like':'%'+_0x5563b2[_0x1e95('0x39')]['filter']+'%'};return _0x3d0fe1;})});}_0x2d321e=_[_0x1e95('0x47')]({},_0x2d321e,_0x5563b2[_0x1e95('0x48')]);return db['Disposition'][_0x1e95('0x24')]({'where':_0x2d321e[_0x1e95('0x45')]})[_0x1e95('0x2c')](function(_0x1b1865){_0x23c7f4[_0x1e95('0x24')]=_0x1b1865;if(_0x5563b2[_0x1e95('0x39')][_0x1e95('0x49')]){_0x2d321e[_0x1e95('0x5d')]=[{'all':!![]}];}return db[_0x1e95('0x58')]['findAll'](_0x2d321e);})[_0x1e95('0x2c')](function(_0x39c232){_0x23c7f4[_0x1e95('0x4a')]=_0x39c232;return _0x23c7f4;});}})[_0x1e95('0x2c')](respondWithFilteredResult(_0x364808,_0x2d321e))['catch'](handleError(_0x364808,null));};exports[_0x1e95('0x5e')]=function(_0x3ba0dd,_0x3b973b,_0x10049f){return db[_0x1e95('0x34')][_0x1e95('0x4e')]({'where':{'id':_0x3ba0dd[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x3b973b,null))[_0x1e95('0x2c')](function(_0x4c513c){if(_0x4c513c){return _0x4c513c['removeDispositions'](_0x3ba0dd[_0x1e95('0x39')][_0x1e95('0x5f')]);}})[_0x1e95('0x2c')](respondWithStatusCode(_0x3b973b,null))[_0x1e95('0x4b')](handleError(_0x3b973b,null));};exports[_0x1e95('0x60')]=function(_0x3ac68e,_0x4b0a82,_0x44bc93){return db[_0x1e95('0x34')][_0x1e95('0x4e')]({'where':{'id':_0x3ac68e['params']['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x4b0a82,null))[_0x1e95('0x2c')](function(_0x2c4b67){if(_0x2c4b67){var _0x317c4e=[];var _0x4c8eed={'success':[],'errors':[]};return db[_0x1e95('0x61')][_0x1e95('0x57')]()[_0x1e95('0x2c')](function(_0x5abf30){if(_0x3ac68e[_0x1e95('0x50')][_0x1e95('0x62')]&&_[_0x1e95('0x63')](_0x3ac68e['body']['tags'])){if(_0x3ac68e[_0x1e95('0x50')]['tags'][_0x1e95('0x3f')]){_0x3ac68e['body'][_0x1e95('0x62')]=_0x3ac68e[_0x1e95('0x50')]['tags'][_0x1e95('0x64')](';')+';';}else{_0x3ac68e[_0x1e95('0x50')][_0x1e95('0x62')]=null;}}else{_0x3ac68e[_0x1e95('0x50')][_0x1e95('0x62')]=null;}if(_0x3ac68e['body']&&_['isArray'](_0x3ac68e[_0x1e95('0x50')])){for(var _0x49d4fb=0x0;_0x49d4fb<_0x3ac68e[_0x1e95('0x50')][_0x1e95('0x3f')];_0x49d4fb+=0x1){_0x3ac68e[_0x1e95('0x50')][_0x49d4fb][_0x1e95('0x5c')]=_0x3ac68e['params']['id'];_0x317c4e[_0x1e95('0x65')](_0x3ac68e['body'][_0x49d4fb]);}return BPromise['each'](_0x317c4e,function(_0x1a2491){return db[_0x1e95('0x61')][_0x1e95('0x4f')](_[_0x1e95('0x66')](_0x1a2491,[_0x1e95('0x5f'),'id'])||{},{'fields':_['keys'](_0x5abf30),'raw':!![]})[_0x1e95('0x2c')](function(_0x17c6aa){_0x4c8eed[_0x1e95('0x67')][_0x1e95('0x65')](_0x17c6aa[_0x1e95('0x68')]);})[_0x1e95('0x4b')](function(_0x2de078){_0x4c8eed['errors']['push']({'data':_0x1a2491,'error':_0x2de078['message']});});})[_0x1e95('0x2c')](function(_0x217ffd){return _0x4c8eed;})['catch'](function(_0x5d6d87){return _0x5d6d87;});}else{_0x4b0a82[_0x1e95('0x20')](0x190)[_0x1e95('0x22')]({'message':_0x1e95('0x69')});}});}})[_0x1e95('0x2c')](respondWithResult(_0x4b0a82,null))[_0x1e95('0x4b')](handleError(_0x4b0a82,null));};exports[_0x1e95('0x6a')]=function(_0x5ee404,_0x3c86a6,_0x2a107a){var _0x2e9828;return db[_0x1e95('0x34')][_0x1e95('0x4e')]({'where':{'id':_0x5ee404[_0x1e95('0x56')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x1e95('0x6b')}]})['then'](handleEntityNotFound(_0x3c86a6,null))[_0x1e95('0x2c')](function(_0x24dfe9){if(_0x24dfe9){_0x2e9828=_0x24dfe9;return db['CmContact'][_0x1e95('0x35')];}})['then'](function(_0x4e14c7){if(_0x4e14c7){var _0x17a945={};var _0x333441={};_0x333441[_0x1e95('0x3c')]=_[_0x1e95('0x6c')](_[_0x1e95('0x4d')](_0x4e14c7),_[_0x1e95('0x38')](_0x2e9828[_0x1e95('0x6b')],function(_0x153297){return util[_0x1e95('0x6d')](_0x1e95('0x6e'),_0x153297['id']);}));_0x333441[_0x1e95('0x39')]=_[_0x1e95('0x4d')](_0x5ee404['query']);_0x333441[_0x1e95('0x3a')]=_[_0x1e95('0x3b')](_0x333441['model'],_0x333441[_0x1e95('0x39')]);_0x17a945[_0x1e95('0x3e')]=_[_0x1e95('0x3b')](_0x333441[_0x1e95('0x3c')],qs[_0x1e95('0x3d')](_0x5ee404[_0x1e95('0x39')][_0x1e95('0x3d')]));_0x17a945['attributes']=_0x17a945[_0x1e95('0x3e')]['length']?_0x17a945['attributes']:_0x333441[_0x1e95('0x3c')];if(!_0x5ee404[_0x1e95('0x39')][_0x1e95('0x40')](_0x1e95('0x41'))){_0x17a945['limit']=qs['limit'](_0x5ee404['query'][_0x1e95('0x23')]);_0x17a945[_0x1e95('0x25')]=qs[_0x1e95('0x25')](_0x5ee404[_0x1e95('0x39')][_0x1e95('0x25')]);}_0x17a945['order']=qs[_0x1e95('0x42')](_0x5ee404['query'][_0x1e95('0x42')]);_0x17a945['where']=qs[_0x1e95('0x3a')](_['pick'](_0x5ee404[_0x1e95('0x39')],_0x333441['filters']));_0x17a945[_0x1e95('0x6f')]=!![];if(_0x5ee404[_0x1e95('0x39')][_0x1e95('0x44')]){_0x17a945[_0x1e95('0x45')]=_[_0x1e95('0x47')](_0x17a945[_0x1e95('0x45')],{'$or':_['map'](_0x17a945[_0x1e95('0x3e')],function(_0x578c97){var _0x3bd6d3={};_0x3bd6d3[_0x578c97]={'$like':'%'+_0x5ee404[_0x1e95('0x39')]['filter']+'%'};return _0x3bd6d3;})});}_0x17a945=_['merge']({},_0x17a945,_0x5ee404[_0x1e95('0x48')]);return _0x2e9828[_0x1e95('0x6a')](_0x17a945);}})[_0x1e95('0x2c')](respondWithResult(_0x3c86a6,null))[_0x1e95('0x4b')](handleError(_0x3c86a6,null));};exports['getContactsCsv']=function(_0xdb84a5,_0x49f9d9,_0x3f0b81){var _0xfd042d;var _0xf9ea0d;var _0xb839ea;var _0x313ca8=_0xdb84a5['params']['id'];csv_results=[];return db['ContactItemType'][_0x1e95('0x70')]({'attributes':['id','name'],'raw':!![],'order':['OrderBy']})[_0x1e95('0x2c')](function(_0x40aebf){_0xfd042d=_0x40aebf;var _0x4ee6d2=_[_0x1e95('0x4d')](db[_0x1e95('0x61')][_0x1e95('0x35')]);return db['CmCustomField'][_0x1e95('0x70')]({'raw':!![],'attributes':['id','alias']})[_0x1e95('0x2c')](function(_0x270278){_0xf9ea0d=_0x270278;var _0x308310=squel[_0x1e95('0x71')]()[_0x1e95('0x3d')](_0x4ee6d2)[_0x1e95('0x72')]('cm_contacts','c')[_0x1e95('0x45')](_0x1e95('0x73'),_0x313ca8)[_0x1e95('0x45')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x1cfa37=0x0;_0x1cfa37<_0xf9ea0d[_0x1e95('0x3f')];_0x1cfa37++){_0x308310['field'](_0x1e95('0x74')+_0xf9ea0d[_0x1cfa37]['id'],'customField_'+_0xf9ea0d[_0x1cfa37][_0x1e95('0x75')]);}for(var _0x1cfa37=0x0;_0x1cfa37<_0xfd042d[_0x1e95('0x3f')];_0x1cfa37++){_0x308310['field'](squel['select']()[_0x1e95('0x76')]('item')[_0x1e95('0x72')](_0x1e95('0x77'))[_0x1e95('0x45')](_0x1e95('0x78'),_0xfd042d[_0x1cfa37]['id'])[_0x1e95('0x45')](_0x1e95('0x79')),_0x1e95('0x7a')+_0xfd042d[_0x1cfa37][_0x1e95('0x31')]);_0x308310[_0x1e95('0x76')](squel['select']()[_0x1e95('0x76')](_0x1e95('0x7b'))[_0x1e95('0x72')](_0x1e95('0x77'))[_0x1e95('0x45')](_0x1e95('0x78'),_0xfd042d[_0x1cfa37]['id'])[_0x1e95('0x45')](_0x1e95('0x79')),_0x1e95('0x7c')+_0xfd042d[_0x1cfa37][_0x1e95('0x31')]);}var _0x2f2946=[];_0x2f2946['push'](_0x308310['toString']());BPromise['each'](_0x2f2946,handleQuery)['then'](function(_0x4d29a9){handleQuery(_0x308310[_0x1e95('0x7d')]());var _0x7327c3=csv_results[0x0];if(!_[_0x1e95('0x7e')](_0x7327c3)){var _0x13d281=toCsv(_0x7327c3);var _0x1a2f0c=Date[_0x1e95('0x7f')]();fs[_0x1e95('0x80')](util[_0x1e95('0x6d')](_0x1e95('0x81'),_0x313ca8,_0x1a2f0c),_0x13d281);_0x49f9d9[_0x1e95('0x82')]('Content-disposition',_0x1e95('0x83')+util[_0x1e95('0x6d')]('list_%d_%s.csv',_0x313ca8,_0x1a2f0c));_0x49f9d9[_0x1e95('0x82')](_0x1e95('0x84'),_0x1e95('0x85'));return _0x49f9d9[_0x1e95('0x86')](util[_0x1e95('0x6d')](_0x1e95('0x81'),_0x313ca8,_0x1a2f0c));}else{return _0x49f9d9[_0x1e95('0x1f')](0xcc);}});});});};exports[_0x1e95('0x87')]=function(_0xb7fa7b,_0x258d87,_0x4450b2){var _0x865670;delete _0xb7fa7b[_0x1e95('0x50')]['id'];return db[_0x1e95('0x34')][_0x1e95('0x5a')]({'where':{'id':_0xb7fa7b[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x258d87,null))['then'](function(_0x176de6){if(_0x176de6){return db[_0x1e95('0x88')][_0x1e95('0x89')](function(_0x4836fb){return db[_0x1e95('0x8a')]['create'](_0xb7fa7b['body'],{'transaction':_0x4836fb})['then'](function(_0x56a263){_0x865670=_0x56a263;return _0x176de6[_0x1e95('0x8b')](_0x56a263,{'transaction':_0x4836fb});})[_0x1e95('0x2c')](function(){var _0x4053b9={'type':db['Sequelize'][_0x1e95('0x8c')],'transaction':_0x4836fb};switch(_0xb7fa7b[_0x1e95('0x50')][_0x1e95('0x36')]){case'text':_0x4053b9[_0x1e95('0x36')]=db[_0x1e95('0x8d')]['TEXT'];break;case'number':_0x4053b9[_0x1e95('0x36')]=db[_0x1e95('0x8d')]['INTEGER'];break;case'switch':_0x4053b9[_0x1e95('0x36')]=db[_0x1e95('0x8d')][_0x1e95('0x8e')];_0x4053b9[_0x1e95('0x8f')]=![];break;default:}return db[_0x1e95('0x88')][_0x1e95('0x90')][_0x1e95('0x91')]('cm_contacts',util['format'](_0x1e95('0x92'),_0x865670['id']),_0x4053b9);})[_0x1e95('0x2c')](function(){return _0x865670;});});}})['then'](respondWithResult(_0x258d87,null))[_0x1e95('0x4b')](handleError(_0x258d87,null));};exports[_0x1e95('0x93')]=function(_0x56760f,_0x4dd8de,_0x56b635){var _0xe00d68={};var _0x188a8={};var _0x251f1a;var _0x148c2c;return db[_0x1e95('0x34')][_0x1e95('0x5a')]({'where':{'id':_0x56760f[_0x1e95('0x56')]['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x4dd8de,null))[_0x1e95('0x2c')](function(_0x57ff3c){if(_0x57ff3c){_0x251f1a=_0x57ff3c;_0x188a8['model']=_[_0x1e95('0x4d')](db[_0x1e95('0x8a')][_0x1e95('0x35')]);_0x188a8[_0x1e95('0x39')]=_['keys'](_0x56760f[_0x1e95('0x39')]);_0x188a8[_0x1e95('0x3a')]=_['intersection'](_0x188a8[_0x1e95('0x3c')],_0x188a8[_0x1e95('0x39')]);_0xe00d68[_0x1e95('0x3e')]=_['intersection'](_0x188a8[_0x1e95('0x3c')],qs[_0x1e95('0x3d')](_0x56760f[_0x1e95('0x39')]['fields']));_0xe00d68['attributes']=_0xe00d68[_0x1e95('0x3e')][_0x1e95('0x3f')]?_0xe00d68[_0x1e95('0x3e')]:_0x188a8[_0x1e95('0x3c')];_0xe00d68[_0x1e95('0x5b')]=qs[_0x1e95('0x42')](_0x56760f[_0x1e95('0x39')]['sort']);_0xe00d68['where']=qs[_0x1e95('0x3a')](_[_0x1e95('0x43')](_0x56760f[_0x1e95('0x39')],_0x188a8['filters']));_0xe00d68[_0x1e95('0x45')]=_[_0x1e95('0x47')](_0xe00d68[_0x1e95('0x45')],{'$or':[{'ListId':_0x57ff3c['id']},{'ListId':null}]});if(_0x56760f['query'][_0x1e95('0x44')]){_0xe00d68['where']=_['merge'](_0xe00d68[_0x1e95('0x45')],{'$or':_['map'](_0xe00d68[_0x1e95('0x3e')],function(_0xfc9f72){var _0x1225fb={};_0x1225fb[_0xfc9f72]={'$like':'%'+_0x56760f[_0x1e95('0x39')][_0x1e95('0x44')]+'%'};return _0x1225fb;})});}_0xe00d68=_[_0x1e95('0x47')]({},_0xe00d68,_0x56760f[_0x1e95('0x48')]);return db[_0x1e95('0x8a')][_0x1e95('0x94')](_0xe00d68);}})[_0x1e95('0x2c')](respondWithResult(_0x4dd8de,null))[_0x1e95('0x4b')](handleError(_0x4dd8de,null));};exports[_0x1e95('0x95')]=function(_0x17e867,_0x4b5155){return db[_0x1e95('0x8a')]['findAndCountAll']({'where':{'ListId':null}})[_0x1e95('0x2c')](handleEntityNotFound(_0x4b5155,null))[_0x1e95('0x2c')](function(_0x736d00){return _0x736d00;})[_0x1e95('0x2c')](respondWithResult(_0x4b5155,null))['catch'](handleError(_0x4b5155,null));};exports['addAgents']=function(_0x49955f,_0x5d4b05,_0x32f8eb){return db[_0x1e95('0x34')]['find']({'where':{'id':_0x49955f['params']['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x5d4b05,null))[_0x1e95('0x2c')](function(_0x533779){if(_0x533779){return _0x533779[_0x1e95('0x96')](_0x49955f['body'][_0x1e95('0x5f')],_['omit'](_0x49955f[_0x1e95('0x50')],[_0x1e95('0x5f'),'id'])||{})[_0x1e95('0x97')](function(_0x175c38){for(var _0x516058=0x0;_0x516058<_0x49955f[_0x1e95('0x50')][_0x1e95('0x5f')][_0x1e95('0x3f')];_0x516058+=0x1){socket[_0x1e95('0x98')]('userCmList:save',{'UserId':Number(_0x49955f[_0x1e95('0x50')][_0x1e95('0x5f')][_0x516058]),'CmListId':Number(_0x49955f[_0x1e95('0x56')]['id'])});}return _0x175c38;});}})[_0x1e95('0x2c')](respondWithResult(_0x5d4b05,null))[_0x1e95('0x4b')](handleError(_0x5d4b05,null));};exports['removeAgents']=function(_0x5ce8ca,_0x1be76b,_0x5d181f){return db['CmList'][_0x1e95('0x4e')]({'where':{'id':_0x5ce8ca[_0x1e95('0x56')]['id']}})['then'](handleEntityNotFound(_0x1be76b,null))[_0x1e95('0x2c')](function(_0x1ea120){if(_0x1ea120){return _0x1ea120[_0x1e95('0x99')](_0x5ce8ca[_0x1e95('0x39')][_0x1e95('0x5f')])[_0x1e95('0x2c')](function(){if(_[_0x1e95('0x63')](_0x5ce8ca[_0x1e95('0x39')][_0x1e95('0x5f')])){for(var _0x14c9de=0x0;_0x14c9de<_0x5ce8ca[_0x1e95('0x39')]['ids'][_0x1e95('0x3f')];_0x14c9de+=0x1){socket[_0x1e95('0x98')](_0x1e95('0x9a'),{'UserId':Number(_0x5ce8ca[_0x1e95('0x39')][_0x1e95('0x5f')][_0x14c9de]),'CmListId':Number(_0x5ce8ca['params']['id'])});}}else{socket['emit'](_0x1e95('0x9a'),{'UserId':Number(_0x5ce8ca[_0x1e95('0x39')]['ids']),'CmListId':Number(_0x5ce8ca[_0x1e95('0x56')]['id'])});}});}})[_0x1e95('0x2c')](respondWithStatusCode(_0x1be76b,null))['catch'](handleError(_0x1be76b,null));};exports[_0x1e95('0x9b')]=function(_0x45eebe,_0x1d2aae,_0x438248){var _0x2704ce={};var _0x300d67={};var _0x28bb97;var _0x10a16d;return db[_0x1e95('0x34')]['findOne']({'where':{'id':_0x45eebe['params']['id']}})[_0x1e95('0x2c')](handleEntityNotFound(_0x1d2aae,null))[_0x1e95('0x2c')](function(_0x25883e){if(_0x25883e){_0x28bb97=_0x25883e;_0x300d67[_0x1e95('0x3c')]=_[_0x1e95('0x4d')](db[_0x1e95('0x9c')][_0x1e95('0x35')]);_0x300d67[_0x1e95('0x39')]=_[_0x1e95('0x4d')](_0x45eebe[_0x1e95('0x39')]);_0x300d67[_0x1e95('0x3a')]=_['intersection'](_0x300d67[_0x1e95('0x3c')],_0x300d67[_0x1e95('0x39')]);_0x2704ce[_0x1e95('0x3e')]=_[_0x1e95('0x3b')](_0x300d67[_0x1e95('0x3c')],qs['fields'](_0x45eebe[_0x1e95('0x39')][_0x1e95('0x3d')]));_0x2704ce[_0x1e95('0x3e')]=_0x2704ce[_0x1e95('0x3e')]['length']?_0x2704ce[_0x1e95('0x3e')]:_0x300d67[_0x1e95('0x3c')];_0x2704ce[_0x1e95('0x5b')]=qs[_0x1e95('0x42')](_0x45eebe[_0x1e95('0x39')][_0x1e95('0x42')]);_0x2704ce[_0x1e95('0x45')]=qs['filters'](_['pick'](_0x45eebe['query'],_0x300d67['filters']));if(_0x45eebe[_0x1e95('0x39')][_0x1e95('0x44')]){_0x2704ce[_0x1e95('0x45')]=_['merge'](_0x2704ce[_0x1e95('0x45')],{'$or':_[_0x1e95('0x38')](_0x2704ce[_0x1e95('0x3e')],function(_0x412c1c){var _0xa2d22b={};_0xa2d22b[_0x412c1c]={'$like':'%'+_0x45eebe[_0x1e95('0x39')][_0x1e95('0x44')]+'%'};return _0xa2d22b;})});}_0x2704ce=_[_0x1e95('0x47')]({},_0x2704ce,_0x45eebe['options']);return _0x28bb97['getAgents'](_0x2704ce);}})[_0x1e95('0x2c')](function(_0xc28e77){if(_0xc28e77){_0x10a16d=_0xc28e77[_0x1e95('0x3f')];if(!_0x45eebe[_0x1e95('0x39')][_0x1e95('0x40')](_0x1e95('0x41'))){_0x2704ce[_0x1e95('0x23')]=qs[_0x1e95('0x23')](_0x45eebe[_0x1e95('0x39')][_0x1e95('0x23')]);_0x2704ce[_0x1e95('0x25')]=qs[_0x1e95('0x25')](_0x45eebe[_0x1e95('0x39')][_0x1e95('0x25')]);}return _0x28bb97[_0x1e95('0x9b')](_0x2704ce);}})['then'](function(_0x1892df){if(_0x1892df){return _0x1892df?{'count':_0x10a16d,'rows':_0x1892df}:null;}})[_0x1e95('0x2c')](respondWithResult(_0x1d2aae,null))[_0x1e95('0x4b')](handleError(_0x1d2aae,null));};function handleQuery(_0x2e5c4d){logger[_0x1e95('0x9d')](_0x2e5c4d);return db[_0x1e95('0x88')][_0x1e95('0x39')](_0x2e5c4d)[_0x1e95('0x97')](function(_0xb1fa89){csv_results['push'](_0xb1fa89);})[_0x1e95('0x4b')](function(_0x5aaec5){logger[_0x1e95('0x30')](_0x5aaec5[_0x1e95('0x9e')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3e854bd..71bb715 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x21eb3c,_0x7ce88b){var _0x4bd2aa=function(_0x1b4bfd){while(--_0x1b4bfd){_0x21eb3c['push'](_0x21eb3c['shift']());}};_0x4bd2aa(++_0x7ce88b);}(_0x7217,0x19e));var _0x7721=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7217[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0x5fc3[_0x5447aa];return _0xb21e53;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index de68427..c558ec3 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 _0x2750=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4a6976,_0x28ac19){var _0x181580=function(_0x1b2d61){while(--_0x1b2d61){_0x4a6976['push'](_0x4a6976['shift']());}};_0x181580(++_0x28ac19);}(_0x2750,0x13b));var _0x0275=function(_0x2f4466,_0x28d0d4){_0x2f4466=_0x2f4466-0x0;var _0x16d1af=_0x2750[_0x2f4466];return _0x16d1af;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var moment=require(_0x0275('0x3'));var BPromise=require(_0x0275('0x4'));var rp=require(_0x0275('0x5'));var fs=require('fs');var path=require(_0x0275('0x6'));var rimraf=require(_0x0275('0x7'));var config=require(_0x0275('0x8'));var attributes=require(_0x0275('0x9'));module[_0x0275('0xa')]=function(_0x5953f9,_0x3f645f){return _0x5953f9[_0x0275('0xb')](_0x0275('0xc'),attributes,{'tableName':_0x0275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac4a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmList.attributes','define','cm_lists'];(function(_0x200a3c,_0x4797ec){var _0x682cde=function(_0x4cecdb){while(--_0x4cecdb){_0x200a3c['push'](_0x200a3c['shift']());}};_0x682cde(++_0x4797ec);}(_0xac4a,0x13f));var _0xaac4=function(_0x42ea9c,_0xef1f9){_0x42ea9c=_0x42ea9c-0x0;var _0xca90a6=_0xac4a[_0x42ea9c];return _0xca90a6;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('CmList',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 000f8d0..291dbef 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 _0xabbd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring'];(function(_0x16757a,_0x3dc5e2){var _0x4bc089=function(_0x1ff243){while(--_0x1ff243){_0x16757a['push'](_0x16757a['shift']());}};_0x4bc089(++_0x3dc5e2);}(_0xabbd,0x14e));var _0xdabb=function(_0x20f20b,_0xc40935){_0x20f20b=_0x20f20b-0x0;var _0x3af5a1=_0xabbd[_0x20f20b];return _0x3af5a1;};'use strict';var _=require(_0xdabb('0x0'));var util=require(_0xdabb('0x1'));var moment=require('moment');var BPromise=require(_0xdabb('0x2'));var rs=require(_0xdabb('0x3'));var fs=require('fs');var Redis=require(_0xdabb('0x4'));var db=require(_0xdabb('0x5'))['db'];var utils=require(_0xdabb('0x6'));var logger=require(_0xdabb('0x7'))(_0xdabb('0x8'));var config=require(_0xdabb('0x9'));var jayson=require(_0xdabb('0xa'));var client=jayson['client'][_0xdabb('0xb')]({'port':0x232a});config[_0xdabb('0xc')]=_[_0xdabb('0xd')](config[_0xdabb('0xc')],{'host':_0xdabb('0xe'),'port':0x18eb});var socket=require(_0xdabb('0xf'))(new Redis(config['redis']));require(_0xdabb('0x10'))[_0xdabb('0x11')](socket);function respondWithRpcPromise(_0x1bca55,_0x2be9a8,_0x35b892){return new BPromise(function(_0x47850c,_0x562d54){return client['request'](_0x1bca55,_0x35b892)['then'](function(_0x288486){logger[_0xdabb('0x12')](_0xdabb('0x13'),_0x2be9a8,_0xdabb('0x14'));logger[_0xdabb('0x15')](_0xdabb('0x16'),_0x2be9a8,'request\x20sent',JSON['stringify'](_0x288486));if(_0x288486[_0xdabb('0x17')]){if(_0x288486[_0xdabb('0x17')]['code']===0x1f4){logger['error'](_0xdabb('0x13'),_0x2be9a8,_0x288486[_0xdabb('0x17')][_0xdabb('0x18')]);return _0x562d54(_0x288486[_0xdabb('0x17')][_0xdabb('0x18')]);}logger[_0xdabb('0x17')](_0xdabb('0x13'),_0x2be9a8,_0x288486['error'][_0xdabb('0x18')]);return _0x47850c(_0x288486[_0xdabb('0x17')][_0xdabb('0x18')]);}else{logger['info'](_0xdabb('0x13'),_0x2be9a8,_0xdabb('0x14'));_0x47850c(_0x288486[_0xdabb('0x19')][_0xdabb('0x18')]);}})['catch'](function(_0x14bb19){logger[_0xdabb('0x17')](_0xdabb('0x13'),_0x2be9a8,_0x14bb19);_0x562d54(_0x14bb19);});});} \ No newline at end of file +var _0xa8d2=['localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmList,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2effe0,_0x24b2a3){var _0x47bd4d=function(_0x439be6){while(--_0x439be6){_0x2effe0['push'](_0x2effe0['shift']());}};_0x47bd4d(++_0x24b2a3);}(_0xa8d2,0x1ea));var _0x2a8d=function(_0x2615ff,_0x412cb0){_0x2615ff=_0x2615ff-0x0;var _0x3ef958=_0xa8d2[_0x2615ff];return _0x3ef958;};'use strict';var _=require(_0x2a8d('0x0'));var util=require('util');var moment=require(_0x2a8d('0x1'));var BPromise=require(_0x2a8d('0x2'));var rs=require(_0x2a8d('0x3'));var fs=require('fs');var Redis=require(_0x2a8d('0x4'));var db=require(_0x2a8d('0x5'))['db'];var utils=require(_0x2a8d('0x6'));var logger=require(_0x2a8d('0x7'))(_0x2a8d('0x8'));var config=require(_0x2a8d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2a8d('0xa')][_0x2a8d('0xb')]({'port':0x232a});config[_0x2a8d('0xc')]=_[_0x2a8d('0xd')](config[_0x2a8d('0xc')],{'host':_0x2a8d('0xe'),'port':0x18eb});var socket=require(_0x2a8d('0xf'))(new Redis(config[_0x2a8d('0xc')]));require(_0x2a8d('0x10'))[_0x2a8d('0x11')](socket);function respondWithRpcPromise(_0x2e7893,_0x534e05,_0x5006cb){return new BPromise(function(_0x2579bb,_0x213bb2){return client[_0x2a8d('0x12')](_0x2e7893,_0x5006cb)['then'](function(_0x5b37cb){logger[_0x2a8d('0x13')]('CmList,\x20%s,\x20%s',_0x534e05,'request\x20sent');logger['debug'](_0x2a8d('0x14'),_0x534e05,_0x2a8d('0x15'),JSON[_0x2a8d('0x16')](_0x5b37cb));if(_0x5b37cb[_0x2a8d('0x17')]){if(_0x5b37cb[_0x2a8d('0x17')][_0x2a8d('0x18')]===0x1f4){logger[_0x2a8d('0x17')]('CmList,\x20%s,\x20%s',_0x534e05,_0x5b37cb[_0x2a8d('0x17')][_0x2a8d('0x19')]);return _0x213bb2(_0x5b37cb[_0x2a8d('0x17')][_0x2a8d('0x19')]);}logger[_0x2a8d('0x17')](_0x2a8d('0x1a'),_0x534e05,_0x5b37cb['error'][_0x2a8d('0x19')]);return _0x2579bb(_0x5b37cb[_0x2a8d('0x17')][_0x2a8d('0x19')]);}else{logger[_0x2a8d('0x13')](_0x2a8d('0x1a'),_0x534e05,'request\x20sent');_0x2579bb(_0x5b37cb[_0x2a8d('0x1b')][_0x2a8d('0x19')]);}})['catch'](function(_0x330936){logger[_0x2a8d('0x17')](_0x2a8d('0x1a'),_0x534e05,_0x330936);_0x213bb2(_0x330936);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3a95c07..d5d28f1 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 _0x85fe=['length','./cmList.events','save','remove','removeListener','register'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x85fe,0x11b));var _0xe85f=function(_0x2a25a6,_0x17f5bb){_0x2a25a6=_0x2a25a6-0x0;var _0x48eb87=_0x85fe[_0x2a25a6];return _0x48eb87;};'use strict';var CmListEvents=require(_0xe85f('0x0'));var events=[_0xe85f('0x1'),_0xe85f('0x2'),'update'];function createListener(_0x478b9e,_0x1f8ba4){return function(_0x2c28da){_0x1f8ba4['emit'](_0x478b9e,_0x2c28da);};}function removeListener(_0x461588,_0x2d48ac){return function(){CmListEvents[_0xe85f('0x3')](_0x461588,_0x2d48ac);};}exports[_0xe85f('0x4')]=function(_0x46e136){for(var _0x44e2f4=0x0,_0x4e3036=events[_0xe85f('0x5')];_0x44e2f4<_0x4e3036;_0x44e2f4++){var _0x2df131=events[_0x44e2f4];var _0x39635a=createListener('cmList:'+_0x2df131,_0x46e136);CmListEvents['on'](_0x2df131,_0x39635a);}}; \ No newline at end of file +var _0x3b30=['./cmList.events','save','remove','update','emit','register','length','cmList:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b30,0xe0));var _0x03b3=function(_0x3bfeb5,_0xcbc5c8){_0x3bfeb5=_0x3bfeb5-0x0;var _0x2a9947=_0x3b30[_0x3bfeb5];return _0x2a9947;};'use strict';var CmListEvents=require(_0x03b3('0x0'));var events=[_0x03b3('0x1'),_0x03b3('0x2'),_0x03b3('0x3')];function createListener(_0x21dc24,_0x1ecd03){return function(_0x6cabad){_0x1ecd03[_0x03b3('0x4')](_0x21dc24,_0x6cabad);};}function removeListener(_0x1d31b5,_0x111b08){return function(){CmListEvents['removeListener'](_0x1d31b5,_0x111b08);};}exports[_0x03b3('0x5')]=function(_0x43537b){for(var _0xbb2690=0x0,_0x570627=events[_0x03b3('0x6')];_0xbb2690<_0x570627;_0xbb2690++){var _0x89946c=events[_0xbb2690];var _0x13d301=createListener(_0x03b3('0x7')+_0x89946c,_0x43537b);CmListEvents['on'](_0x89946c,_0x13d301);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1681392..0ce3b7b 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 _0xa7aa=['addContacts','/:id/fields','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','isAuthenticated','describe','get','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions'];(function(_0x284258,_0x41159b){var _0x1231fc=function(_0x13683d){while(--_0x13683d){_0x284258['push'](_0x284258['shift']());}};_0x1231fc(++_0x41159b);}(_0xa7aa,0x8d));var _0xaa7a=function(_0x37fb4f,_0x2611c8){_0x37fb4f=_0x37fb4f-0x0;var _0x7c779d=_0xa7aa[_0x37fb4f];return _0x7c779d;};'use strict';var multer=require('multer');var util=require(_0xaa7a('0x0'));var path=require(_0xaa7a('0x1'));var timeout=require(_0xaa7a('0x2'));var express=require(_0xaa7a('0x3'));var router=express[_0xaa7a('0x4')]();var fs_extra=require(_0xaa7a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa7a('0x6'));var controller=require('./cmList.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaa7a('0x7')]);router['get']('/describe',auth[_0xaa7a('0x8')](),controller[_0xaa7a('0x9')]);router[_0xaa7a('0xa')](_0xaa7a('0xb'),auth['isAuthenticated'](),controller[_0xaa7a('0xc')]);router[_0xaa7a('0xa')](_0xaa7a('0xd'),auth[_0xaa7a('0x8')](),controller[_0xaa7a('0xe')]);router[_0xaa7a('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xaa7a('0xf')]);router[_0xaa7a('0xa')](_0xaa7a('0x10'),auth['isAuthenticated'](),controller[_0xaa7a('0x11')]);router[_0xaa7a('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller['getContactsCsv']);router[_0xaa7a('0xa')]('/:id/fields',auth[_0xaa7a('0x8')](),controller[_0xaa7a('0x12')]);router[_0xaa7a('0xa')](_0xaa7a('0x13'),auth['isAuthenticated'](),controller[_0xaa7a('0x14')]);router[_0xaa7a('0x15')]('/',auth[_0xaa7a('0x8')](),controller[_0xaa7a('0x16')]);router['post'](_0xaa7a('0x17'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xaa7a('0x15')](_0xaa7a('0x10'),auth['isAuthenticated'](),controller[_0xaa7a('0x18')]);router[_0xaa7a('0x15')](_0xaa7a('0x19'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xaa7a('0x15')](_0xaa7a('0x13'),auth[_0xaa7a('0x8')](),controller[_0xaa7a('0x1a')]);router['put'](_0xaa7a('0xd'),auth[_0xaa7a('0x8')](),controller[_0xaa7a('0x1b')]);router[_0xaa7a('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xaa7a('0x1d')]);router[_0xaa7a('0x1c')](_0xaa7a('0x17'),auth['isAuthenticated'](),controller[_0xaa7a('0x1e')]);router[_0xaa7a('0x1c')](_0xaa7a('0x13'),auth['isAuthenticated'](),controller[_0xaa7a('0x1f')]);module[_0xaa7a('0x20')]=router; \ No newline at end of file +var _0x15cd=['post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','/:id','delete','removeDispositions','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','getGlobalCustomFields','get','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents'];(function(_0x21a8ba,_0x2b09e1){var _0x1da12a=function(_0xb9a7f0){while(--_0xb9a7f0){_0x21a8ba['push'](_0x21a8ba['shift']());}};_0x1da12a(++_0x2b09e1);}(_0x15cd,0x1cb));var _0xd15c=function(_0x5e980d,_0x316987){_0x5e980d=_0x5e980d-0x0;var _0x347477=_0x15cd[_0x5e980d];return _0x347477;};'use strict';var multer=require('multer');var util=require(_0xd15c('0x0'));var path=require(_0xd15c('0x1'));var timeout=require('connect-timeout');var express=require(_0xd15c('0x2'));var router=express[_0xd15c('0x3')]();var fs_extra=require(_0xd15c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd15c('0x5'));var config=require(_0xd15c('0x6'));var controller=require(_0xd15c('0x7'));router['get']('/',auth[_0xd15c('0x8')](),controller['index']);router['get']('/describe',auth[_0xd15c('0x8')](),controller['describe']);router['get']('/global_fields',auth[_0xd15c('0x8')](),controller[_0xd15c('0x9')]);router[_0xd15c('0xa')]('/:id',auth[_0xd15c('0x8')](),controller[_0xd15c('0xb')]);router['get'](_0xd15c('0xc'),auth[_0xd15c('0x8')](),controller[_0xd15c('0xd')]);router[_0xd15c('0xa')](_0xd15c('0xe'),auth[_0xd15c('0x8')](),controller[_0xd15c('0xf')]);router[_0xd15c('0xa')](_0xd15c('0x10'),auth[_0xd15c('0x8')](),controller[_0xd15c('0x11')]);router[_0xd15c('0xa')]('/:id/fields',auth[_0xd15c('0x8')](),controller[_0xd15c('0x12')]);router[_0xd15c('0xa')](_0xd15c('0x13'),auth[_0xd15c('0x8')](),controller[_0xd15c('0x14')]);router[_0xd15c('0x15')]('/',auth[_0xd15c('0x8')](),controller[_0xd15c('0x16')]);router[_0xd15c('0x15')]('/:id/dispositions',auth[_0xd15c('0x8')](),controller[_0xd15c('0x17')]);router[_0xd15c('0x15')](_0xd15c('0xe'),auth[_0xd15c('0x8')](),controller[_0xd15c('0x18')]);router[_0xd15c('0x15')](_0xd15c('0x19'),auth['isAuthenticated'](),controller[_0xd15c('0x1a')]);router[_0xd15c('0x15')](_0xd15c('0x13'),auth[_0xd15c('0x8')](),controller[_0xd15c('0x1b')]);router[_0xd15c('0x1c')](_0xd15c('0x1d'),auth[_0xd15c('0x8')](),controller['update']);router['delete'](_0xd15c('0x1d'),auth[_0xd15c('0x8')](),controller['destroy']);router[_0xd15c('0x1e')](_0xd15c('0xc'),auth[_0xd15c('0x8')](),controller[_0xd15c('0x1f')]);router[_0xd15c('0x1e')](_0xd15c('0x13'),auth[_0xd15c('0x8')](),controller['removeAgents']);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 0a2988f..26844e5 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 _0xfe1c=['STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0xc4514,_0x3c0572){var _0x1b50db=function(_0x2afa0a){while(--_0x2afa0a){_0xc4514['push'](_0xc4514['shift']());}};_0x1b50db(++_0x3c0572);}(_0xfe1c,0x6f));var _0xcfe1=function(_0x222dc6,_0x2ce4b2){_0x222dc6=_0x222dc6-0x0;var _0x3d7eaf=_0xfe1c[_0x222dc6];return _0x3d7eaf;};'use strict';var Sequelize=require(_0xcfe1('0x0'));module[_0xcfe1('0x1')]={'name':{'type':Sequelize[_0xcfe1('0x2')],'get':function(_0x2f4dd9){return this[_0xcfe1('0x3')]('field');}},'field':{'type':Sequelize[_0xcfe1('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xcfe1('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xeac2=['STRING','exports','VIRTUAL','getDataValue'];(function(_0x407a3a,_0x582bde){var _0x109c43=function(_0x550c06){while(--_0x550c06){_0x407a3a['push'](_0x407a3a['shift']());}};_0x109c43(++_0x582bde);}(_0xeac2,0x1b1));var _0x2eac=function(_0x2111af,_0x1bca32){_0x2111af=_0x2111af-0x0;var _0x482622=_0xeac2[_0x2111af];return _0x482622;};'use strict';var Sequelize=require('sequelize');module[_0x2eac('0x0')]={'name':{'type':Sequelize[_0x2eac('0x1')],'get':function(_0x34f38a){return this[_0x2eac('0x2')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x2eac('0x3')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 51fd3ee..ac75db5 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(_0xe5b32,_0x57acb6){var _0x17e7e8=function(_0x5b0cb2){while(--_0x5b0cb2){_0xe5b32['push'](_0xe5b32['shift']());}};_0x17e7e8(++_0x57acb6);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x353ffc,_0x465b99){var _0x216d85=function(_0x1c7042){while(--_0x1c7042){_0x353ffc['push'](_0x353ffc['shift']());}};_0x216d85(++_0x465b99);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 748a3ec..d773f44 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 _0x0df5=['api','moment','bluebird','request-promise','../../config/environment','define','Condition','tools_conditions','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0df5,0x166));var _0x50df=function(_0x1f7210,_0x359e76){_0x1f7210=_0x1f7210-0x0;var _0x5162e1=_0x0df5[_0x1f7210];return _0x5162e1;};'use strict';var _=require('lodash');var util=require(_0x50df('0x0'));var logger=require(_0x50df('0x1'))(_0x50df('0x2'));var moment=require(_0x50df('0x3'));var BPromise=require(_0x50df('0x4'));var rp=require(_0x50df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x50df('0x6'));var attributes=require('./condition.attributes');module['exports']=function(_0x45762a,_0x259226){return _0x45762a[_0x50df('0x7')](_0x50df('0x8'),attributes,{'tableName':_0x50df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c3d=['./condition.attributes','exports','define','Condition','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1b6c0c,_0x51ef20){var _0x178991=function(_0x3b6f64){while(--_0x3b6f64){_0x1b6c0c['push'](_0x1b6c0c['shift']());}};_0x178991(++_0x51ef20);}(_0x0c3d,0x1c0));var _0xd0c3=function(_0x563129,_0x26d5f9){_0x563129=_0x563129-0x0;var _0x28d1a3=_0x0c3d[_0x563129];return _0x28d1a3;};'use strict';var _=require(_0xd0c3('0x0'));var util=require(_0xd0c3('0x1'));var logger=require(_0xd0c3('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0c3('0x3'));var rp=require(_0xd0c3('0x4'));var fs=require('fs');var path=require(_0xd0c3('0x5'));var rimraf=require(_0xd0c3('0x6'));var config=require(_0xd0c3('0x7'));var attributes=require(_0xd0c3('0x8'));module[_0xd0c3('0x9')]=function(_0x4e2f2b,_0xe2f29e){return _0x4e2f2b[_0xd0c3('0xa')](_0xd0c3('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 81de364..d86ea64 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 _0x746d=['debug','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0xca04ff,_0xcb449f){var _0x6b547=function(_0xc91e4b){while(--_0xc91e4b){_0xca04ff['push'](_0xca04ff['shift']());}};_0x6b547(++_0xcb449f);}(_0x746d,0xd7));var _0xd746=function(_0x198d8a,_0x14529){_0x198d8a=_0x198d8a-0x0;var _0x3597a4=_0x746d[_0x198d8a];return _0x3597a4;};'use strict';var _=require(_0xd746('0x0'));var util=require(_0xd746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd746('0x2'));var fs=require('fs');var Redis=require(_0xd746('0x3'));var db=require(_0xd746('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd746('0x5'))(_0xd746('0x6'));var config=require(_0xd746('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd746('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30b02c,_0x1b5f1a,_0x475953){return new BPromise(function(_0x1158e9,_0x495b81){return client[_0xd746('0x9')](_0x30b02c,_0x475953)['then'](function(_0xeba3c2){logger[_0xd746('0xa')](_0xd746('0xb'),_0x1b5f1a,_0xd746('0xc'));logger[_0xd746('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x1b5f1a,_0xd746('0xc'),JSON[_0xd746('0xe')](_0xeba3c2));if(_0xeba3c2['error']){if(_0xeba3c2[_0xd746('0xf')][_0xd746('0x10')]===0x1f4){logger[_0xd746('0xf')](_0xd746('0xb'),_0x1b5f1a,_0xeba3c2['error'][_0xd746('0x11')]);return _0x495b81(_0xeba3c2[_0xd746('0xf')][_0xd746('0x11')]);}logger['error'](_0xd746('0xb'),_0x1b5f1a,_0xeba3c2[_0xd746('0xf')][_0xd746('0x11')]);return _0x1158e9(_0xeba3c2[_0xd746('0xf')][_0xd746('0x11')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x1b5f1a,'request\x20sent');_0x1158e9(_0xeba3c2[_0xd746('0x12')][_0xd746('0x11')]);}})['catch'](function(_0x36dd9c){logger[_0xd746('0xf')]('Condition,\x20%s,\x20%s',_0x1b5f1a,_0x36dd9c);_0x495b81(_0x36dd9c);});});} \ No newline at end of file +var _0xe846=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x2857fc,_0x411fd1){var _0x49047c=function(_0x30ceb2){while(--_0x30ceb2){_0x2857fc['push'](_0x2857fc['shift']());}};_0x49047c(++_0x411fd1);}(_0xe846,0xb4));var _0x6e84=function(_0x586bf1,_0x436f7a){_0x586bf1=_0x586bf1-0x0;var _0x4fe996=_0xe846[_0x586bf1];return _0x4fe996;};'use strict';var _=require(_0x6e84('0x0'));var util=require('util');var moment=require(_0x6e84('0x1'));var BPromise=require(_0x6e84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e84('0x3'));var db=require(_0x6e84('0x4'))['db'];var utils=require(_0x6e84('0x5'));var logger=require(_0x6e84('0x6'))('rpc');var config=require(_0x6e84('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6e84('0x8')][_0x6e84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c58f8,_0x58feee,_0x456d59){return new BPromise(function(_0xe377c5,_0x181a0f){return client[_0x6e84('0xa')](_0x2c58f8,_0x456d59)[_0x6e84('0xb')](function(_0x41e83a){logger[_0x6e84('0xc')](_0x6e84('0xd'),_0x58feee,_0x6e84('0xe'));logger['debug'](_0x6e84('0xf'),_0x58feee,_0x6e84('0xe'),JSON[_0x6e84('0x10')](_0x41e83a));if(_0x41e83a[_0x6e84('0x11')]){if(_0x41e83a[_0x6e84('0x11')]['code']===0x1f4){logger['error'](_0x6e84('0xd'),_0x58feee,_0x41e83a[_0x6e84('0x11')][_0x6e84('0x12')]);return _0x181a0f(_0x41e83a[_0x6e84('0x11')][_0x6e84('0x12')]);}logger[_0x6e84('0x11')]('Condition,\x20%s,\x20%s',_0x58feee,_0x41e83a[_0x6e84('0x11')][_0x6e84('0x12')]);return _0xe377c5(_0x41e83a[_0x6e84('0x11')][_0x6e84('0x12')]);}else{logger[_0x6e84('0xc')](_0x6e84('0xd'),_0x58feee,_0x6e84('0xe'));_0xe377c5(_0x41e83a['result']['message']);}})[_0x6e84('0x13')](function(_0x2a0c86){logger[_0x6e84('0x11')]('Condition,\x20%s,\x20%s',_0x58feee,_0x2a0c86);_0x181a0f(_0x2a0c86);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ddce6df..d9ebe4e 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 _0xb68e=['../../components/auth/service','./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0xb68e,0x80));var _0xeb68=function(_0x2aafa4,_0x188b99){_0x2aafa4=_0x2aafa4-0x0;var _0x4eb978=_0xb68e[_0x2aafa4];return _0x4eb978;};'use strict';var multer=require(_0xeb68('0x0'));var util=require(_0xeb68('0x1'));var path=require('path');var timeout=require(_0xeb68('0x2'));var express=require(_0xeb68('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeb68('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb68('0x5'));router['put'](_0xeb68('0x6'),auth[_0xeb68('0x7')](),controller[_0xeb68('0x8')]);router['delete']('/:id',auth[_0xeb68('0x7')](),controller[_0xeb68('0x9')]);module[_0xeb68('0xa')]=router; \ No newline at end of file +var _0xaa3e=['isAuthenticated','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./condition.controller','/:id'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xaa3e,0x100));var _0xeaa3=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0xaa3e[_0x4ed4d2];return _0x15ae2e;};'use strict';var multer=require('multer');var util=require(_0xeaa3('0x0'));var path=require('path');var timeout=require(_0xeaa3('0x1'));var express=require(_0xeaa3('0x2'));var router=express[_0xeaa3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeaa3('0x4'));var config=require(_0xeaa3('0x5'));var controller=require(_0xeaa3('0x6'));router['put'](_0xeaa3('0x7'),auth[_0xeaa3('0x8')](),controller['update']);router[_0xeaa3('0x9')](_0xeaa3('0x7'),auth[_0xeaa3('0x8')](),controller['destroy']);module[_0xeaa3('0xa')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 22da17e..622e65d 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f83=['INTEGER','exports','name'];(function(_0x4b99f0,_0x419040){var _0x29d886=function(_0x398626){while(--_0x398626){_0x4b99f0['push'](_0x4b99f0['shift']());}};_0x29d886(++_0x419040);}(_0x6f83,0x154));var _0x36f8=function(_0x1f2073,_0x13e932){_0x1f2073=_0x1f2073-0x0;var _0xe045e5=_0x6f83[_0x1f2073];return _0xe045e5;};'use strict';var Sequelize=require('sequelize');module[_0x36f8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x36f8('0x1')},'OrderBy':{'type':Sequelize[_0x36f8('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x60e1=['exports','INTEGER','STRING','sequelize'];(function(_0x27b070,_0x217d9b){var _0x1d8ecb=function(_0x1f0dec){while(--_0x1f0dec){_0x27b070['push'](_0x27b070['shift']());}};_0x1d8ecb(++_0x217d9b);}(_0x60e1,0xbf));var _0x160e=function(_0x53a9fc,_0x4aa510){_0x53a9fc=_0x53a9fc-0x0;var _0xc73782=_0x60e1[_0x53a9fc];return _0xc73782;};'use strict';var Sequelize=require(_0x160e('0x0'));module[_0x160e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x160e('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x160e('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index f4f5a10..2bcc536 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4991=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','end','error','stack','name','send','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x429230,_0xac45ff){var _0x20a2a3=function(_0x39d543){while(--_0x39d543){_0x429230['push'](_0x429230['shift']());}};_0x20a2a3(++_0xac45ff);}(_0x4991,0xf7));var _0x1499=function(_0x5d543b,_0x6a969a){_0x5d543b=_0x5d543b-0x0;var _0x2015b8=_0x4991[_0x5d543b];return _0x2015b8;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){var _0x30f014=_0x5615b4[_0x1499('0x26')]({'plain':!![]});var _0x3968e0=_0x1499('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3968e0,'resourceId':_0x30f014['id']}})[_0x1499('0x24')](function(){return _0x5615b4;});})[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x28')]();});}};}function handleEntityNotFound(_0x32782a,_0x525d6f){return function(_0x3e5ed1){if(!_0x3e5ed1){_0x32782a['sendStatus'](0x194);}return _0x3e5ed1;};}function handleError(_0x5022a4,_0x516f29){_0x516f29=_0x516f29||0x1f4;return function(_0x21d204){logger[_0x1499('0x29')](_0x21d204[_0x1499('0x2a')]);if(_0x21d204[_0x1499('0x2b')]){delete _0x21d204[_0x1499('0x2b')];}_0x5022a4[_0x1499('0x18')](_0x516f29)[_0x1499('0x2c')](_0x21d204);};}exports['index']=function(_0x180171,_0x1a2c99){var _0x39995b={},_0x5b59ea={},_0x2dae84={'count':0x0,'rows':[]};var _0x16466c=_['map'](db[_0x1499('0x2d')][_0x1499('0x2e')],function(_0x497efd){return{'name':_0x497efd[_0x1499('0x2f')],'type':_0x497efd[_0x1499('0x30')][_0x1499('0x31')]};});_0x5b59ea[_0x1499('0x32')]=_[_0x1499('0x33')](_0x16466c,_0x1499('0x2b'));_0x5b59ea[_0x1499('0x34')]=_[_0x1499('0x35')](_0x180171[_0x1499('0x34')]);_0x5b59ea[_0x1499('0x36')]=_[_0x1499('0x37')](_0x5b59ea[_0x1499('0x32')],_0x5b59ea[_0x1499('0x34')]);_0x39995b[_0x1499('0x38')]=_[_0x1499('0x37')](_0x5b59ea[_0x1499('0x32')],qs[_0x1499('0x39')](_0x180171[_0x1499('0x34')][_0x1499('0x39')]));_0x39995b[_0x1499('0x38')]=_0x39995b['attributes'][_0x1499('0x3a')]?_0x39995b[_0x1499('0x38')]:_0x5b59ea[_0x1499('0x32')];if(!_0x180171[_0x1499('0x34')][_0x1499('0x3b')](_0x1499('0x3c'))){_0x39995b[_0x1499('0x1b')]=qs[_0x1499('0x1b')](_0x180171[_0x1499('0x34')][_0x1499('0x1b')]);_0x39995b[_0x1499('0x1a')]=qs['offset'](_0x180171['query'][_0x1499('0x1a')]);}_0x39995b['order']=qs[_0x1499('0x3d')](_0x180171['query'][_0x1499('0x3d')]);_0x39995b[_0x1499('0x3e')]=qs[_0x1499('0x36')](_[_0x1499('0x3f')](_0x180171['query'],_0x5b59ea[_0x1499('0x36')]),_0x16466c);if(_0x180171['query'][_0x1499('0x40')]){_0x39995b[_0x1499('0x3e')]=_[_0x1499('0x41')](_0x39995b[_0x1499('0x3e')],{'$or':_['map'](_0x16466c,function(_0x61f5ce){if(_0x61f5ce[_0x1499('0x30')]!==_0x1499('0x42')){var _0x3b67a7={};_0x3b67a7[_0x61f5ce['name']]={'$like':'%'+_0x180171[_0x1499('0x34')]['filter']+'%'};return _0x3b67a7;}})});}_0x39995b=_[_0x1499('0x41')]({},_0x39995b,_0x180171[_0x1499('0x43')]);var _0x2a2441={'where':_0x39995b[_0x1499('0x3e')]};return db[_0x1499('0x2d')][_0x1499('0x1d')](_0x2a2441)[_0x1499('0x24')](function(_0xcb85eb){_0x2dae84[_0x1499('0x1d')]=_0xcb85eb;if(_0x180171[_0x1499('0x34')]['includeAll']){_0x39995b[_0x1499('0x44')]=[{'all':!![]}];}return db['ContactItemType'][_0x1499('0x45')](_0x39995b);})[_0x1499('0x24')](function(_0x5646cf){_0x2dae84[_0x1499('0x46')]=_0x5646cf;return _0x2dae84;})[_0x1499('0x24')](respondWithFilteredResult(_0x1a2c99,_0x39995b))[_0x1499('0x47')](handleError(_0x1a2c99,null));};exports[_0x1499('0x48')]=function(_0x43e76c,_0x4db5a1){var _0x5d1e9f={'raw':!![],'where':{'id':_0x43e76c[_0x1499('0x49')]['id']}},_0x368fdb={};_0x368fdb['model']=_[_0x1499('0x35')](db[_0x1499('0x2d')]['rawAttributes']);_0x368fdb['query']=_[_0x1499('0x35')](_0x43e76c[_0x1499('0x34')]);_0x368fdb[_0x1499('0x36')]=_['intersection'](_0x368fdb[_0x1499('0x32')],_0x368fdb[_0x1499('0x34')]);_0x5d1e9f[_0x1499('0x38')]=_[_0x1499('0x37')](_0x368fdb['model'],qs[_0x1499('0x39')](_0x43e76c[_0x1499('0x34')][_0x1499('0x39')]));_0x5d1e9f[_0x1499('0x38')]=_0x5d1e9f['attributes'][_0x1499('0x3a')]?_0x5d1e9f[_0x1499('0x38')]:_0x368fdb[_0x1499('0x32')];if(_0x43e76c['query']['includeAll']){_0x5d1e9f[_0x1499('0x44')]=[{'all':!![]}];}_0x5d1e9f=_['merge']({},_0x5d1e9f,_0x43e76c[_0x1499('0x43')]);return db[_0x1499('0x2d')][_0x1499('0x4a')](_0x5d1e9f)[_0x1499('0x24')](handleEntityNotFound(_0x4db5a1,null))[_0x1499('0x24')](respondWithResult(_0x4db5a1,null))[_0x1499('0x47')](handleError(_0x4db5a1,null));};exports[_0x1499('0x4b')]=function(_0x591aa8,_0x420d16){return db['ContactItemType'][_0x1499('0x4b')](_0x591aa8[_0x1499('0x4c')],{})['then'](function(_0x23fb7f){var _0xd4ac1a=_0x591aa8[_0x1499('0x4d')]['get']({'plain':!![]});if(!_0xd4ac1a)throw new Error(_0x1499('0x4e'));if(_0xd4ac1a[_0x1499('0x4f')]===_0x1499('0x4d')){var _0x29ac0f=_0x23fb7f[_0x1499('0x26')]({'plain':!![]});var _0x11aafe=_0x1499('0x27');return db[_0x1499('0x50')][_0x1499('0x4a')]({'where':{'name':_0x11aafe,'userProfileId':_0xd4ac1a[_0x1499('0x51')]},'raw':!![]})['then'](function(_0x13770a){if(_0x13770a&&_0x13770a[_0x1499('0x52')]===0x0){return db[_0x1499('0x53')]['create']({'name':_0x29ac0f[_0x1499('0x2b')],'resourceId':_0x29ac0f['id'],'type':_0x13770a[_0x1499('0x2b')],'sectionId':_0x13770a['id']},{})['then'](function(){return _0x23fb7f;});}else{return _0x23fb7f;}})[_0x1499('0x47')](function(_0x162ddb){logger['error'](_0x1499('0x54'),_0x162ddb);throw _0x162ddb;});}return _0x23fb7f;})[_0x1499('0x24')](respondWithResult(_0x420d16,0xc9))[_0x1499('0x47')](handleError(_0x420d16,null));};exports[_0x1499('0x23')]=function(_0xa870e,_0x16d97c){if(_0xa870e[_0x1499('0x4c')]['id']){delete _0xa870e['body']['id'];}return db[_0x1499('0x2d')][_0x1499('0x4a')]({'where':{'id':_0xa870e[_0x1499('0x49')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x16d97c,null))['then'](saveUpdates(_0xa870e['body'],null))[_0x1499('0x24')](respondWithResult(_0x16d97c,null))[_0x1499('0x47')](handleError(_0x16d97c,null));};exports['destroy']=function(_0x3c3a20,_0x1ddb13){return db[_0x1499('0x2d')]['find']({'where':{'id':_0x3c3a20['params']['id']}})['then'](handleEntityNotFound(_0x1ddb13,null))[_0x1499('0x24')](db[_0x1499('0x55')][_0x1499('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3c3a20['params']['id']}}))[_0x1499('0x24')](removeEntity(_0x1ddb13,null))['catch'](handleError(_0x1ddb13,null));}; \ No newline at end of file +var _0x056b=['find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','ContactItemTypes','error','stack','name','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll'];(function(_0xc6aa88,_0x1fe80f){var _0x2d1a11=function(_0x551273){while(--_0x551273){_0xc6aa88['push'](_0xc6aa88['shift']());}};_0x2d1a11(++_0x1fe80f);}(_0x056b,0xb6));var _0xb056=function(_0x53594d,_0xb372ae){_0x53594d=_0x53594d-0x0;var _0x3b2544=_0x056b[_0x53594d];return _0x3b2544;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){var _0x1bd6ac=_0x1016da['get']({'plain':!![]});var _0x44a14f=_0xb056('0x28');return db['UserProfileResource'][_0xb056('0x27')]({'where':{'type':_0x44a14f,'resourceId':_0x1bd6ac['id']}})[_0xb056('0x26')](function(){return _0x1016da;});})[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)[_0xb056('0x1c')]();});}};}function handleEntityNotFound(_0x4024d7,_0x211898){return function(_0x2042f1){if(!_0x2042f1){_0x4024d7['sendStatus'](0x194);}return _0x2042f1;};}function handleError(_0x29fbc1,_0x51b06b){_0x51b06b=_0x51b06b||0x1f4;return function(_0x3d83d3){logger[_0xb056('0x29')](_0x3d83d3[_0xb056('0x2a')]);if(_0x3d83d3['name']){delete _0x3d83d3[_0xb056('0x2b')];}_0x29fbc1[_0xb056('0x1d')](_0x51b06b)['send'](_0x3d83d3);};}exports[_0xb056('0x2c')]=function(_0x43aa63,_0x329eaa){var _0x1fad05={},_0x3ce984={},_0x4ebca5={'count':0x0,'rows':[]};var _0x87f31e=_[_0xb056('0x2d')](db[_0xb056('0x2e')][_0xb056('0x2f')],function(_0x103482){return{'name':_0x103482['fieldName'],'type':_0x103482[_0xb056('0x30')][_0xb056('0x31')]};});_0x3ce984[_0xb056('0x32')]=_[_0xb056('0x2d')](_0x87f31e,_0xb056('0x2b'));_0x3ce984[_0xb056('0x33')]=_[_0xb056('0x34')](_0x43aa63[_0xb056('0x33')]);_0x3ce984['filters']=_[_0xb056('0x35')](_0x3ce984['model'],_0x3ce984[_0xb056('0x33')]);_0x1fad05['attributes']=_['intersection'](_0x3ce984[_0xb056('0x32')],qs[_0xb056('0x36')](_0x43aa63[_0xb056('0x33')][_0xb056('0x36')]));_0x1fad05[_0xb056('0x37')]=_0x1fad05[_0xb056('0x37')][_0xb056('0x38')]?_0x1fad05['attributes']:_0x3ce984[_0xb056('0x32')];if(!_0x43aa63[_0xb056('0x33')]['hasOwnProperty']('nolimit')){_0x1fad05[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x43aa63[_0xb056('0x33')]['limit']);_0x1fad05[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x43aa63[_0xb056('0x33')][_0xb056('0x1f')]);}_0x1fad05[_0xb056('0x39')]=qs[_0xb056('0x3a')](_0x43aa63[_0xb056('0x33')][_0xb056('0x3a')]);_0x1fad05[_0xb056('0x3b')]=qs[_0xb056('0x3c')](_[_0xb056('0x3d')](_0x43aa63[_0xb056('0x33')],_0x3ce984['filters']),_0x87f31e);if(_0x43aa63[_0xb056('0x33')]['filter']){_0x1fad05[_0xb056('0x3b')]=_[_0xb056('0x3e')](_0x1fad05[_0xb056('0x3b')],{'$or':_[_0xb056('0x2d')](_0x87f31e,function(_0x460f28){if(_0x460f28[_0xb056('0x30')]!==_0xb056('0x3f')){var _0x42b54f={};_0x42b54f[_0x460f28['name']]={'$like':'%'+_0x43aa63[_0xb056('0x33')][_0xb056('0x40')]+'%'};return _0x42b54f;}})});}_0x1fad05=_[_0xb056('0x3e')]({},_0x1fad05,_0x43aa63[_0xb056('0x41')]);var _0x134db7={'where':_0x1fad05['where']};return db[_0xb056('0x2e')][_0xb056('0x21')](_0x134db7)[_0xb056('0x26')](function(_0x216f72){_0x4ebca5[_0xb056('0x21')]=_0x216f72;if(_0x43aa63[_0xb056('0x33')]['includeAll']){_0x1fad05[_0xb056('0x42')]=[{'all':!![]}];}return db['ContactItemType'][_0xb056('0x43')](_0x1fad05);})[_0xb056('0x26')](function(_0x21d98e){_0x4ebca5[_0xb056('0x44')]=_0x21d98e;return _0x4ebca5;})[_0xb056('0x26')](respondWithFilteredResult(_0x329eaa,_0x1fad05))[_0xb056('0x45')](handleError(_0x329eaa,null));};exports[_0xb056('0x46')]=function(_0x248819,_0x2c8b61){var _0x149341={'raw':!![],'where':{'id':_0x248819[_0xb056('0x47')]['id']}},_0x4fa3c5={};_0x4fa3c5[_0xb056('0x32')]=_[_0xb056('0x34')](db['ContactItemType'][_0xb056('0x2f')]);_0x4fa3c5[_0xb056('0x33')]=_['keys'](_0x248819['query']);_0x4fa3c5[_0xb056('0x3c')]=_[_0xb056('0x35')](_0x4fa3c5[_0xb056('0x32')],_0x4fa3c5[_0xb056('0x33')]);_0x149341['attributes']=_['intersection'](_0x4fa3c5['model'],qs['fields'](_0x248819['query']['fields']));_0x149341[_0xb056('0x37')]=_0x149341['attributes'][_0xb056('0x38')]?_0x149341[_0xb056('0x37')]:_0x4fa3c5[_0xb056('0x32')];if(_0x248819[_0xb056('0x33')][_0xb056('0x48')]){_0x149341[_0xb056('0x42')]=[{'all':!![]}];}_0x149341=_[_0xb056('0x3e')]({},_0x149341,_0x248819[_0xb056('0x41')]);return db['ContactItemType'][_0xb056('0x49')](_0x149341)[_0xb056('0x26')](handleEntityNotFound(_0x2c8b61,null))['then'](respondWithResult(_0x2c8b61,null))[_0xb056('0x45')](handleError(_0x2c8b61,null));};exports[_0xb056('0x4a')]=function(_0xe40439,_0x2f2d22){return db[_0xb056('0x2e')][_0xb056('0x4a')](_0xe40439['body'],{})[_0xb056('0x26')](function(_0x5e2224){var _0x132268=_0xe40439[_0xb056('0x4b')][_0xb056('0x4c')]({'plain':!![]});if(!_0x132268)throw new Error(_0xb056('0x4d'));if(_0x132268[_0xb056('0x4e')]===_0xb056('0x4b')){var _0x2b6733=_0x5e2224[_0xb056('0x4c')]({'plain':!![]});var _0x5a3bbf=_0xb056('0x28');return db[_0xb056('0x4f')][_0xb056('0x49')]({'where':{'name':_0x5a3bbf,'userProfileId':_0x132268[_0xb056('0x50')]},'raw':!![]})[_0xb056('0x26')](function(_0x35acab){if(_0x35acab&&_0x35acab[_0xb056('0x51')]===0x0){return db[_0xb056('0x52')]['create']({'name':_0x2b6733[_0xb056('0x2b')],'resourceId':_0x2b6733['id'],'type':_0x35acab[_0xb056('0x2b')],'sectionId':_0x35acab['id']},{})[_0xb056('0x26')](function(){return _0x5e2224;});}else{return _0x5e2224;}})[_0xb056('0x45')](function(_0x1a5170){logger[_0xb056('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a5170);throw _0x1a5170;});}return _0x5e2224;})[_0xb056('0x26')](respondWithResult(_0x2f2d22,0xc9))[_0xb056('0x45')](handleError(_0x2f2d22,null));};exports[_0xb056('0x25')]=function(_0x536d85,_0x37c64c){if(_0x536d85['body']['id']){delete _0x536d85[_0xb056('0x53')]['id'];}return db[_0xb056('0x2e')][_0xb056('0x49')]({'where':{'id':_0x536d85[_0xb056('0x47')]['id']}})['then'](handleEntityNotFound(_0x37c64c,null))[_0xb056('0x26')](saveUpdates(_0x536d85[_0xb056('0x53')],null))['then'](respondWithResult(_0x37c64c,null))[_0xb056('0x45')](handleError(_0x37c64c,null));};exports[_0xb056('0x27')]=function(_0x1d3cdd,_0x1546e5){return db[_0xb056('0x2e')]['find']({'where':{'id':_0x1d3cdd[_0xb056('0x47')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x1546e5,null))[_0xb056('0x26')](db[_0xb056('0x54')][_0xb056('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d3cdd[_0xb056('0x47')]['id']}}))[_0xb056('0x26')](removeEntity(_0x1546e5,null))[_0xb056('0x45')](handleError(_0x1546e5,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 8eefdf8..cbe94a0 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dbe=['tools_contact_item_types','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType'];(function(_0x37205b,_0x2c124d){var _0x4293e5=function(_0x15fc38){while(--_0x15fc38){_0x37205b['push'](_0x37205b['shift']());}};_0x4293e5(++_0x2c124d);}(_0x3dbe,0x1ae));var _0xe3db=function(_0x85bdbd,_0x52cdd8){_0x85bdbd=_0x85bdbd-0x0;var _0x3ff907=_0x3dbe[_0x85bdbd];return _0x3ff907;};'use strict';var _=require(_0xe3db('0x0'));var util=require(_0xe3db('0x1'));var logger=require('../../config/logger')(_0xe3db('0x2'));var moment=require(_0xe3db('0x3'));var BPromise=require(_0xe3db('0x4'));var rp=require(_0xe3db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3db('0x6'));var config=require(_0xe3db('0x7'));var attributes=require(_0xe3db('0x8'));module[_0xe3db('0x9')]=function(_0x52e36f,_0x2dfb1d){return _0x52e36f[_0xe3db('0xa')](_0xe3db('0xb'),attributes,{'tableName':_0xe3db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a24=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x4a24,0x1ce));var _0x44a2=function(_0x85d5a8,_0x1977be){_0x85d5a8=_0x85d5a8-0x0;var _0x20479b=_0x4a24[_0x85d5a8];return _0x20479b;};'use strict';var _=require(_0x44a2('0x0'));var util=require(_0x44a2('0x1'));var logger=require(_0x44a2('0x2'))(_0x44a2('0x3'));var moment=require(_0x44a2('0x4'));var BPromise=require(_0x44a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44a2('0x6'));var rimraf=require(_0x44a2('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x44a2('0x8')]=function(_0x957447,_0x1698de){return _0x957447[_0x44a2('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 4999f24..7c29b02 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x480b=['code','message','result','catch','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error'];(function(_0x1c52cb,_0x3f7cd4){var _0x37585e=function(_0x1aea64){while(--_0x1aea64){_0x1c52cb['push'](_0x1c52cb['shift']());}};_0x37585e(++_0x3f7cd4);}(_0x480b,0x1b9));var _0xb480=function(_0xdf1eb7,_0x17f252){_0xdf1eb7=_0xdf1eb7-0x0;var _0x514d52=_0x480b[_0xdf1eb7];return _0x514d52;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb480('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb480('0x1'))['db'];var utils=require(_0xb480('0x2'));var logger=require('../../config/logger')(_0xb480('0x3'));var config=require(_0xb480('0x4'));var jayson=require(_0xb480('0x5'));var client=jayson[_0xb480('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464ccb,_0x34b309,_0x9f7c00){return new BPromise(function(_0x429dde,_0x1b6fdc){return client[_0xb480('0x7')](_0x464ccb,_0x9f7c00)[_0xb480('0x8')](function(_0x2e66d8){logger[_0xb480('0x9')](_0xb480('0xa'),_0x34b309,_0xb480('0xb'));logger[_0xb480('0xc')](_0xb480('0xd'),_0x34b309,_0xb480('0xb'),JSON['stringify'](_0x2e66d8));if(_0x2e66d8[_0xb480('0xe')]){if(_0x2e66d8[_0xb480('0xe')][_0xb480('0xf')]===0x1f4){logger[_0xb480('0xe')](_0xb480('0xa'),_0x34b309,_0x2e66d8[_0xb480('0xe')][_0xb480('0x10')]);return _0x1b6fdc(_0x2e66d8['error'][_0xb480('0x10')]);}logger[_0xb480('0xe')]('ContactItemType,\x20%s,\x20%s',_0x34b309,_0x2e66d8[_0xb480('0xe')]['message']);return _0x429dde(_0x2e66d8[_0xb480('0xe')][_0xb480('0x10')]);}else{logger[_0xb480('0x9')]('ContactItemType,\x20%s,\x20%s',_0x34b309,_0xb480('0xb'));_0x429dde(_0x2e66d8[_0xb480('0x11')][_0xb480('0x10')]);}})[_0xb480('0x12')](function(_0x8c2dc2){logger['error'](_0xb480('0xa'),_0x34b309,_0x8c2dc2);_0x1b6fdc(_0x8c2dc2);});});} \ No newline at end of file +var _0x3bb2=['request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s'];(function(_0x2a661c,_0x5695ee){var _0x58d7fc=function(_0x35ab93){while(--_0x35ab93){_0x2a661c['push'](_0x2a661c['shift']());}};_0x58d7fc(++_0x5695ee);}(_0x3bb2,0x1b2));var _0x23bb=function(_0x3121e5,_0x428351){_0x3121e5=_0x3121e5-0x0;var _0x2f6c5e=_0x3bb2[_0x3121e5];return _0x2f6c5e;};'use strict';var _=require(_0x23bb('0x0'));var util=require(_0x23bb('0x1'));var moment=require(_0x23bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x23bb('0x3'));var fs=require('fs');var Redis=require(_0x23bb('0x4'));var db=require(_0x23bb('0x5'))['db'];var utils=require(_0x23bb('0x6'));var logger=require(_0x23bb('0x7'))('rpc');var config=require(_0x23bb('0x8'));var jayson=require(_0x23bb('0x9'));var client=jayson[_0x23bb('0xa')][_0x23bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df7f5,_0x572e5f,_0x34c1d7){return new BPromise(function(_0x3c64a2,_0x3cf71d){return client[_0x23bb('0xc')](_0x5df7f5,_0x34c1d7)[_0x23bb('0xd')](function(_0x33762d){logger[_0x23bb('0xe')](_0x23bb('0xf'),_0x572e5f,_0x23bb('0x10'));logger[_0x23bb('0x11')](_0x23bb('0x12'),_0x572e5f,_0x23bb('0x10'),JSON[_0x23bb('0x13')](_0x33762d));if(_0x33762d[_0x23bb('0x14')]){if(_0x33762d[_0x23bb('0x14')][_0x23bb('0x15')]===0x1f4){logger['error'](_0x23bb('0xf'),_0x572e5f,_0x33762d[_0x23bb('0x14')][_0x23bb('0x16')]);return _0x3cf71d(_0x33762d[_0x23bb('0x14')][_0x23bb('0x16')]);}logger['error'](_0x23bb('0xf'),_0x572e5f,_0x33762d[_0x23bb('0x14')][_0x23bb('0x16')]);return _0x3c64a2(_0x33762d[_0x23bb('0x14')][_0x23bb('0x16')]);}else{logger[_0x23bb('0xe')](_0x23bb('0xf'),_0x572e5f,_0x23bb('0x10'));_0x3c64a2(_0x33762d[_0x23bb('0x17')][_0x23bb('0x16')]);}})[_0x23bb('0x18')](function(_0x3afe40){logger[_0x23bb('0x14')](_0x23bb('0xf'),_0x572e5f,_0x3afe40);_0x3cf71d(_0x3afe40);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 1edce9f..549ab11 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d0f=['isAuthenticated','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','index','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d0f,0x197));var _0xf5d0=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x5d0f[_0x236c89];return _0x3b2a15;};'use strict';var multer=require(_0xf5d0('0x0'));var util=require(_0xf5d0('0x1'));var path=require(_0xf5d0('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5d0('0x3'));var router=express[_0xf5d0('0x4')]();var fs_extra=require(_0xf5d0('0x5'));var auth=require(_0xf5d0('0x6'));var interaction=require(_0xf5d0('0x7'));var config=require(_0xf5d0('0x8'));var controller=require(_0xf5d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf5d0('0xa')]);router[_0xf5d0('0xb')](_0xf5d0('0xc'),auth[_0xf5d0('0xd')](),controller[_0xf5d0('0xe')]);router[_0xf5d0('0xf')]('/',auth[_0xf5d0('0xd')](),controller[_0xf5d0('0x10')]);router['put'](_0xf5d0('0xc'),auth[_0xf5d0('0xd')](),controller[_0xf5d0('0x11')]);router[_0xf5d0('0x12')](_0xf5d0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf5d0('0x13')]=router; \ No newline at end of file +var _0xf654=['put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create'];(function(_0x51730e,_0x36f487){var _0x32e3dd=function(_0xd20f07){while(--_0xd20f07){_0x51730e['push'](_0x51730e['shift']());}};_0x32e3dd(++_0x36f487);}(_0xf654,0x1b4));var _0x4f65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf654[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4f65('0x0'));var util=require(_0x4f65('0x1'));var path=require(_0x4f65('0x2'));var timeout=require(_0x4f65('0x3'));var express=require('express');var router=express[_0x4f65('0x4')]();var fs_extra=require(_0x4f65('0x5'));var auth=require(_0x4f65('0x6'));var interaction=require(_0x4f65('0x7'));var config=require(_0x4f65('0x8'));var controller=require('./contactItemType.controller');router[_0x4f65('0x9')]('/',auth[_0x4f65('0xa')](),controller['index']);router['get'](_0x4f65('0xb'),auth[_0x4f65('0xa')](),controller['show']);router[_0x4f65('0xc')]('/',auth[_0x4f65('0xa')](),controller[_0x4f65('0xd')]);router[_0x4f65('0xe')](_0x4f65('0xb'),auth[_0x4f65('0xa')](),controller['update']);router[_0x4f65('0xf')](_0x4f65('0xb'),auth[_0x4f65('0xa')](),controller[_0x4f65('0x10')]);module[_0x4f65('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 8a378c4..fadeae8 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(_0x1232c3,_0x1550d6){var _0x1d055e=function(_0x1bad37){while(--_0x1bad37){_0x1232c3['push'](_0x1232c3['shift']());}};_0x1d055e(++_0x1550d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x408758,_0x548c1f){_0x408758=_0x408758-0x0;var _0x2e25ae=_0xb10b[_0x408758];return _0x2e25ae;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 4d85fb1..709255a 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 _0xa30f=['name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','Dashboard','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','update','destroy','iframe','attrUrl','attrs','custom','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','undefined','count','offset','limit','Content-Range','apply','reject','save','then','get','CustomDashboards','UserProfileResource','end','stack'];(function(_0x2b62cf,_0x108ced){var _0x4982ae=function(_0x4566ed){while(--_0x4566ed){_0x2b62cf['push'](_0x2b62cf['shift']());}};_0x4982ae(++_0x108ced);}(_0xa30f,0x1d4));var _0xfa30=function(_0x512c93,_0x9e0258){_0x512c93=_0x512c93-0x0;var _0x3bf671=_0xa30f[_0x512c93];return _0x3bf671;};'use strict';var emlformat=require(_0xfa30('0x0'));var rimraf=require(_0xfa30('0x1'));var zipdir=require(_0xfa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa30('0x3'));var moment=require(_0xfa30('0x4'));var BPromise=require(_0xfa30('0x5'));var Mustache=require(_0xfa30('0x6'));var util=require(_0xfa30('0x7'));var path=require(_0xfa30('0x8'));var sox=require(_0xfa30('0x9'));var csv=require('to-csv');var ejs=require(_0xfa30('0xa'));var fs=require('fs');var fs_extra=require(_0xfa30('0xb'));var _=require(_0xfa30('0xc'));var squel=require(_0xfa30('0xd'));var crypto=require(_0xfa30('0xe'));var jsforce=require(_0xfa30('0xf'));var deskjs=require(_0xfa30('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfa30('0x11'));var Papa=require('papaparse');var Redis=require(_0xfa30('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfa30('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa30('0x14'));var logger=require(_0xfa30('0x15'))(_0xfa30('0x16'));var utils=require(_0xfa30('0x17'));var config=require(_0xfa30('0x18'));var licenseUtil=require(_0xfa30('0x19'));var db=require(_0xfa30('0x1a'))['db'];config[_0xfa30('0x1b')]=_[_0xfa30('0x1c')](config[_0xfa30('0x1b')],{'host':_0xfa30('0x1d'),'port':0x18eb});var socket=require(_0xfa30('0x1e'))(new Redis(config[_0xfa30('0x1b')]));require('./dashboard.socket')[_0xfa30('0x1f')](socket);function respondWithStatusCode(_0x1e30ec,_0x5bb4e6){_0x5bb4e6=_0x5bb4e6||0xcc;return function(_0x1c8957){if(_0x1c8957){return _0x1e30ec[_0xfa30('0x20')](_0x5bb4e6);}return _0x1e30ec['status'](_0x5bb4e6)['end']();};}function respondWithResult(_0x3524fb,_0x12d2ed){_0x12d2ed=_0x12d2ed||0xc8;return function(_0xec3dd){if(_0xec3dd){return _0x3524fb[_0xfa30('0x21')](_0x12d2ed)['json'](_0xec3dd);}};}function respondWithFilteredResult(_0x33a59c,_0x346c3d){return function(_0x567cda){if(_0x567cda){var _0x3c7dbc=typeof _0x346c3d['offset']===_0xfa30('0x22')&&typeof _0x346c3d['limit']==='undefined';var _0xde5f=_0x567cda[_0xfa30('0x23')];var _0x4e4df8=_0x3c7dbc?0x0:_0x346c3d[_0xfa30('0x24')];var _0x1627da=_0x3c7dbc?_0x567cda[_0xfa30('0x23')]:_0x346c3d['offset']+_0x346c3d[_0xfa30('0x25')];var _0x412a45;if(_0x1627da>=_0xde5f){_0x1627da=_0xde5f;_0x412a45=0xc8;}else{_0x412a45=0xce;}_0x33a59c[_0xfa30('0x21')](_0x412a45);return _0x33a59c['set'](_0xfa30('0x26'),_0x4e4df8+'-'+_0x1627da+'/'+_0xde5f)['json'](_0x567cda);}return null;};}function patchUpdates(_0x11a888){return function(_0x535a00){try{jsonpatch[_0xfa30('0x27')](_0x535a00,_0x11a888,!![]);}catch(_0x3efd47){return BPromise[_0xfa30('0x28')](_0x3efd47);}return _0x535a00[_0xfa30('0x29')]();};}function saveUpdates(_0x16adb9,_0xad6d0d){return function(_0x2e422b){if(_0x2e422b){return _0x2e422b['update'](_0x16adb9)[_0xfa30('0x2a')](function(_0x1b0d2b){return _0x1b0d2b;});}return null;};}function removeEntity(_0x363727,_0xf80736){return function(_0x3a9545){if(_0x3a9545){return _0x3a9545['destroy']()[_0xfa30('0x2a')](function(){var _0x590787=_0x3a9545[_0xfa30('0x2b')]({'plain':!![]});var _0x5040d2=_0xfa30('0x2c');return db[_0xfa30('0x2d')]['destroy']({'where':{'type':_0x5040d2,'resourceId':_0x590787['id']}})['then'](function(){return _0x3a9545;});})['then'](function(){_0x363727[_0xfa30('0x21')](0xcc)[_0xfa30('0x2e')]();});}};}function handleEntityNotFound(_0x3e37e9,_0x542d4){return function(_0x291b50){if(!_0x291b50){_0x3e37e9[_0xfa30('0x20')](0x194);}return _0x291b50;};}function handleError(_0x364427,_0x9e434f){_0x9e434f=_0x9e434f||0x1f4;return function(_0x59896a){logger['error'](_0x59896a[_0xfa30('0x2f')]);if(_0x59896a[_0xfa30('0x30')]){delete _0x59896a[_0xfa30('0x30')];}_0x364427['status'](_0x9e434f)[_0xfa30('0x31')](_0x59896a);};}exports['index']=function(_0x59c8cc,_0x551858){var _0x20f1cb={},_0x21009c={},_0x3de2c4={'count':0x0,'rows':[]};var _0x46ec93=_['map'](db['Dashboard']['rawAttributes'],function(_0x58a31f){return{'name':_0x58a31f[_0xfa30('0x32')],'type':_0x58a31f[_0xfa30('0x33')][_0xfa30('0x34')]};});_0x21009c[_0xfa30('0x35')]=_[_0xfa30('0x36')](_0x46ec93,'name');_0x21009c[_0xfa30('0x37')]=_[_0xfa30('0x38')](_0x59c8cc[_0xfa30('0x37')]);_0x21009c[_0xfa30('0x39')]=_[_0xfa30('0x3a')](_0x21009c['model'],_0x21009c[_0xfa30('0x37')]);_0x20f1cb[_0xfa30('0x3b')]=_[_0xfa30('0x3a')](_0x21009c[_0xfa30('0x35')],qs[_0xfa30('0x3c')](_0x59c8cc[_0xfa30('0x37')]['fields']));_0x20f1cb['attributes']=_0x20f1cb[_0xfa30('0x3b')][_0xfa30('0x3d')]?_0x20f1cb[_0xfa30('0x3b')]:_0x21009c[_0xfa30('0x35')];if(!_0x59c8cc['query']['hasOwnProperty'](_0xfa30('0x3e'))){_0x20f1cb[_0xfa30('0x25')]=qs[_0xfa30('0x25')](_0x59c8cc['query'][_0xfa30('0x25')]);_0x20f1cb['offset']=qs[_0xfa30('0x24')](_0x59c8cc[_0xfa30('0x37')][_0xfa30('0x24')]);}_0x20f1cb[_0xfa30('0x3f')]=qs['sort'](_0x59c8cc[_0xfa30('0x37')][_0xfa30('0x40')]);_0x20f1cb['where']=qs[_0xfa30('0x39')](_[_0xfa30('0x41')](_0x59c8cc[_0xfa30('0x37')],_0x21009c[_0xfa30('0x39')]),_0x46ec93);if(_0x59c8cc[_0xfa30('0x37')][_0xfa30('0x42')]){_0x20f1cb['where']=_[_0xfa30('0x43')](_0x20f1cb[_0xfa30('0x44')],{'$or':_[_0xfa30('0x36')](_0x46ec93,function(_0x412a60){if(_0x412a60['type']!==_0xfa30('0x45')){var _0x14c841={};_0x14c841[_0x412a60['name']]={'$like':'%'+_0x59c8cc[_0xfa30('0x37')]['filter']+'%'};return _0x14c841;}})});}_0x20f1cb=_[_0xfa30('0x43')]({},_0x20f1cb,_0x59c8cc[_0xfa30('0x46')]);var _0x291f0f={'where':_0x20f1cb[_0xfa30('0x44')]};return db[_0xfa30('0x47')]['count'](_0x291f0f)[_0xfa30('0x2a')](function(_0x26acb0){_0x3de2c4[_0xfa30('0x23')]=_0x26acb0;if(_0x59c8cc[_0xfa30('0x37')][_0xfa30('0x48')]){_0x20f1cb[_0xfa30('0x49')]=[{'all':!![]}];}return db[_0xfa30('0x47')]['findAll'](_0x20f1cb);})['then'](function(_0x208633){_0x3de2c4[_0xfa30('0x4a')]=_0x208633;return _0x3de2c4;})[_0xfa30('0x2a')](respondWithFilteredResult(_0x551858,_0x20f1cb))[_0xfa30('0x4b')](handleError(_0x551858,null));};exports[_0xfa30('0x4c')]=function(_0x4574be,_0x32e6af){var _0x3dd7e9={'raw':![],'where':{'id':_0x4574be[_0xfa30('0x4d')]['id']}},_0x22cdf5={};_0x22cdf5['model']=_[_0xfa30('0x38')](db['Dashboard'][_0xfa30('0x4e')]);_0x22cdf5[_0xfa30('0x37')]=_['keys'](_0x4574be[_0xfa30('0x37')]);_0x22cdf5['filters']=_[_0xfa30('0x3a')](_0x22cdf5['model'],_0x22cdf5[_0xfa30('0x37')]);_0x3dd7e9[_0xfa30('0x3b')]=_['intersection'](_0x22cdf5[_0xfa30('0x35')],qs['fields'](_0x4574be[_0xfa30('0x37')][_0xfa30('0x3c')]));_0x3dd7e9[_0xfa30('0x3b')]=_0x3dd7e9[_0xfa30('0x3b')][_0xfa30('0x3d')]?_0x3dd7e9[_0xfa30('0x3b')]:_0x22cdf5['model'];if(_0x4574be[_0xfa30('0x37')][_0xfa30('0x48')]){_0x3dd7e9['include']=[{'all':!![]}];}_0x3dd7e9=_[_0xfa30('0x43')]({},_0x3dd7e9,_0x4574be[_0xfa30('0x46')]);return db[_0xfa30('0x47')][_0xfa30('0x4f')](_0x3dd7e9)['then'](handleEntityNotFound(_0x32e6af,null))[_0xfa30('0x2a')](respondWithResult(_0x32e6af,null))[_0xfa30('0x4b')](handleError(_0x32e6af,null));};exports[_0xfa30('0x50')]=function(_0x41fb27,_0x49bcac){return db[_0xfa30('0x47')][_0xfa30('0x50')](_0x41fb27[_0xfa30('0x51')],{})[_0xfa30('0x2a')](function(_0x23c70a){var _0x3908d9=_0x41fb27[_0xfa30('0x52')][_0xfa30('0x2b')]({'plain':!![]});if(!_0x3908d9)throw new Error(_0xfa30('0x53'));if(_0x3908d9['role']===_0xfa30('0x52')){var _0x532880=_0x23c70a[_0xfa30('0x2b')]({'plain':!![]});var _0x298ee4=_0xfa30('0x2c');return db[_0xfa30('0x54')][_0xfa30('0x4f')]({'where':{'name':_0x298ee4,'userProfileId':_0x3908d9[_0xfa30('0x55')]},'raw':!![]})[_0xfa30('0x2a')](function(_0x1808b3){if(_0x1808b3&&_0x1808b3[_0xfa30('0x56')]===0x0){return db[_0xfa30('0x2d')]['create']({'name':_0x532880[_0xfa30('0x30')],'resourceId':_0x532880['id'],'type':_0x1808b3[_0xfa30('0x30')],'sectionId':_0x1808b3['id']},{})[_0xfa30('0x2a')](function(){return _0x23c70a;});}else{return _0x23c70a;}})['catch'](function(_0x4f868b){logger[_0xfa30('0x57')](_0xfa30('0x58'),_0x4f868b);throw _0x4f868b;});}return _0x23c70a;})['then'](respondWithResult(_0x49bcac,0xc9))['catch'](handleError(_0x49bcac,null));};exports[_0xfa30('0x59')]=function(_0x5e3eef,_0x210bcd){var _0x59ea06={'where':{'id':_0x5e3eef[_0xfa30('0x4d')]['id']}},_0x350394={};_0x350394[_0xfa30('0x35')]=_[_0xfa30('0x38')](db[_0xfa30('0x47')]['rawAttributes']);_0x59ea06[_0xfa30('0x3b')]=_[_0xfa30('0x3a')](_0x350394[_0xfa30('0x35')],qs[_0xfa30('0x3c')](_0x5e3eef['query'][_0xfa30('0x3c')]));_0x59ea06[_0xfa30('0x3b')]=_0x59ea06[_0xfa30('0x3b')][_0xfa30('0x3d')]?_0x59ea06[_0xfa30('0x3b')]:_0x350394['model'];if(_0x5e3eef[_0xfa30('0x37')][_0xfa30('0x48')]){_0x59ea06['include']=[{'all':!![]}];}_0x59ea06=_[_0xfa30('0x43')]({},_0x59ea06,_0x5e3eef[_0xfa30('0x46')]);return db[_0xfa30('0x47')][_0xfa30('0x4f')](_0x59ea06)[_0xfa30('0x2a')](handleEntityNotFound(_0x210bcd,null))[_0xfa30('0x2a')](function(_0x28b748){if(_0x28b748){var _0x3fe7f4=_0x28b748[_0xfa30('0x2b')]({'plain':!![]});_0x3fe7f4=qs[_0xfa30('0x5a')](_0x3fe7f4,['id',_0xfa30('0x5b'),_0xfa30('0x5c')]);_0x5e3eef[_0xfa30('0x51')]=_['omit'](_0x5e3eef['body'],['id','createdAt',_0xfa30('0x5c')]);return db[_0xfa30('0x47')][_0xfa30('0x50')](_[_0xfa30('0x43')](_0x3fe7f4,_0x5e3eef[_0xfa30('0x51')]),{'include':_0x5e3eef[_0xfa30('0x37')][_0xfa30('0x48')]?[{'all':!![]}]:undefined})[_0xfa30('0x2a')](function(_0x47564d){var _0x26efb0=_0x5e3eef[_0xfa30('0x52')][_0xfa30('0x2b')]({'plain':!![]});if(!_0x26efb0)throw new Error(_0xfa30('0x53'));if(_0x26efb0[_0xfa30('0x5d')]===_0xfa30('0x52')){var _0x1b90f8=_0x47564d['get']({'plain':!![]});var _0x43fb15=_0xfa30('0x2c');return db['UserProfileSection'][_0xfa30('0x4f')]({'where':{'name':_0x43fb15,'userProfileId':_0x26efb0[_0xfa30('0x55')]},'raw':!![]})['then'](function(_0x4df76d){if(_0x4df76d&&_0x4df76d[_0xfa30('0x56')]===0x0){return db[_0xfa30('0x2d')][_0xfa30('0x50')]({'name':_0x1b90f8[_0xfa30('0x30')],'resourceId':_0x1b90f8['id'],'type':_0x4df76d[_0xfa30('0x30')],'sectionId':_0x4df76d['id']},{})[_0xfa30('0x2a')](function(){return _0x47564d;});}else{return _0x47564d;}})[_0xfa30('0x4b')](function(_0x19f8a8){logger['error'](_0xfa30('0x58'),_0x19f8a8);throw _0x19f8a8;});}return _0x47564d;});}})[_0xfa30('0x2a')](respondWithResult(_0x210bcd,0xc9))[_0xfa30('0x4b')](handleError(_0x210bcd,null));};exports[_0xfa30('0x5e')]=function(_0x1e3887,_0xbe4eab){if(_0x1e3887[_0xfa30('0x51')]['id']){delete _0x1e3887['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x1e3887[_0xfa30('0x4d')]['id']}})[_0xfa30('0x2a')](handleEntityNotFound(_0xbe4eab,null))[_0xfa30('0x2a')](saveUpdates(_0x1e3887[_0xfa30('0x51')],null))['then'](respondWithResult(_0xbe4eab,null))[_0xfa30('0x4b')](handleError(_0xbe4eab,null));};exports[_0xfa30('0x5f')]=function(_0x1c1a1c,_0x3d442b){return db[_0xfa30('0x47')][_0xfa30('0x4f')]({'where':{'id':_0x1c1a1c[_0xfa30('0x4d')]['id']}})[_0xfa30('0x2a')](handleEntityNotFound(_0x3d442b,null))[_0xfa30('0x2a')](removeEntity(_0x3d442b,null))[_0xfa30('0x4b')](handleError(_0x3d442b,null));};function widgetAttributes(_0x1bf48d){try{switch(_0x1bf48d[_0xfa30('0x33')]){case _0xfa30('0x60'):return[{'name':_0xfa30('0x61'),'value':_0x1bf48d[_0xfa30('0x61')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0]['value']:undefined)||'https://'}];case _0xfa30('0x63'):return[{'name':'attrPath','value':_0x1bf48d['attrPath']||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0][_0xfa30('0x64')]:undefined)||''}];case _0xfa30('0x65'):return[{'name':_0xfa30('0x66'),'value':_0x1bf48d[_0xfa30('0x66')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0][_0xfa30('0x64')]:undefined)||_0xfa30('0x67')},{'name':_0xfa30('0x68'),'value':_0x1bf48d[_0xfa30('0x68')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d['attrs'][0x1]?_0x1bf48d['attrs'][0x1][_0xfa30('0x64')]:undefined)||_0xfa30('0x69')},{'name':_0xfa30('0x6a'),'value':_0x1bf48d[_0xfa30('0x6a')]||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x2]?_0x1bf48d[_0xfa30('0x62')][0x2][_0xfa30('0x64')]:undefined)||0xc}];case _0xfa30('0x6b'):return[{'name':_0xfa30('0x6c'),'value':_0x1bf48d[_0xfa30('0x6c')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0][_0xfa30('0x64')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1bf48d[_0xfa30('0x6d')]||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x1]?_0x1bf48d[_0xfa30('0x62')][0x1][_0xfa30('0x64')]:undefined)||[]},{'name':_0xfa30('0x6a'),'value':_0x1bf48d[_0xfa30('0x6a')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x2]?_0x1bf48d['attrs'][0x2][_0xfa30('0x64')]:undefined)||0x14},{'name':'attrChannel','value':_0x1bf48d[_0xfa30('0x6e')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x3]?_0x1bf48d[_0xfa30('0x62')][0x3][_0xfa30('0x64')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x1bf48d[_0xfa30('0x6f')]||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x4]?_0x1bf48d['attrs'][0x4][_0xfa30('0x64')]:undefined)||''},{'name':_0xfa30('0x70'),'value':_0x1bf48d['attrFaxAccounts']||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x5]?_0x1bf48d[_0xfa30('0x62')][0x5]['value']:undefined)||''},{'name':_0xfa30('0x71'),'value':_0x1bf48d['attrSmsAccounts']||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x6]?_0x1bf48d[_0xfa30('0x62')][0x6][_0xfa30('0x64')]:undefined)||''},{'name':_0xfa30('0x72'),'value':_0x1bf48d['attrOpenchannelAccounts']||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x7]?_0x1bf48d[_0xfa30('0x62')][0x7][_0xfa30('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1bf48d[_0xfa30('0x73')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d['attrs'][0x8]?_0x1bf48d[_0xfa30('0x62')][0x8][_0xfa30('0x64')]:undefined)||''},{'name':_0xfa30('0x74'),'value':_0x1bf48d[_0xfa30('0x74')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d['attrs'][0x9]?_0x1bf48d[_0xfa30('0x62')][0x9][_0xfa30('0x64')]:undefined)||''}];case'multibar-chart':case _0xfa30('0x75'):return[{'name':'attrSerie1','value':_0x1bf48d['attrSerie1']||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d['attrs'][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0][_0xfa30('0x64')]:undefined)||_0xfa30('0x76')},{'name':_0xfa30('0x77'),'value':_0x1bf48d['attrSerie2']||(_0x1bf48d['attrs']&&_0x1bf48d['attrs'][0x1]?_0x1bf48d[_0xfa30('0x62')][0x1][_0xfa30('0x64')]:undefined)||null},{'name':_0xfa30('0x78'),'value':_0x1bf48d[_0xfa30('0x78')]||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x2]?_0x1bf48d[_0xfa30('0x62')][0x2][_0xfa30('0x64')]:undefined)||null},{'name':_0xfa30('0x6d'),'value':_0x1bf48d['attrVoiceQueues']||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x3]?_0x1bf48d[_0xfa30('0x62')][0x3][_0xfa30('0x64')]:undefined)||[]},{'name':_0xfa30('0x6e'),'value':_0x1bf48d[_0xfa30('0x6e')]||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x4]?_0x1bf48d[_0xfa30('0x62')][0x4]['value']:undefined)||'voice'},{'name':_0xfa30('0x6f'),'value':_0x1bf48d[_0xfa30('0x6f')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x5]?_0x1bf48d[_0xfa30('0x62')][0x5][_0xfa30('0x64')]:undefined)||''},{'name':_0xfa30('0x70'),'value':_0x1bf48d[_0xfa30('0x70')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x6]?_0x1bf48d[_0xfa30('0x62')][0x6]['value']:undefined)||''},{'name':_0xfa30('0x71'),'value':_0x1bf48d['attrSmsAccounts']||(_0x1bf48d['attrs']&&_0x1bf48d[_0xfa30('0x62')][0x7]?_0x1bf48d[_0xfa30('0x62')][0x7]['value']:undefined)||''},{'name':_0xfa30('0x72'),'value':_0x1bf48d[_0xfa30('0x72')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x8]?_0x1bf48d[_0xfa30('0x62')][0x8]['value']:undefined)||''},{'name':_0xfa30('0x73'),'value':_0x1bf48d[_0xfa30('0x73')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x9]?_0x1bf48d[_0xfa30('0x62')][0x9][_0xfa30('0x64')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1bf48d[_0xfa30('0x74')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d['attrs'][0xa]?_0x1bf48d[_0xfa30('0x62')][0xa]['value']:undefined)||''}];case _0xfa30('0x79'):return[{'name':'attrReport','type':_0x1bf48d[_0xfa30('0x7a')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d[_0xfa30('0x62')][0x0][_0xfa30('0x33')]:undefined)||null,'value':_0x1bf48d[_0xfa30('0x7b')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x0]?_0x1bf48d['attrs'][0x0]['value']:undefined)||null},{'name':_0xfa30('0x7c'),'value':_0x1bf48d[_0xfa30('0x7c')]||(_0x1bf48d[_0xfa30('0x62')]&&_0x1bf48d[_0xfa30('0x62')][0x1]?_0x1bf48d[_0xfa30('0x62')][0x1][_0xfa30('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x34980e){logger[_0xfa30('0x57')]('widgetAttributes:\x20%s',JSON[_0xfa30('0x7d')](_0x34980e));return[];}}exports['addItem']=function(_0x7cdc31,_0x97e725,_0x3e46d3){if(_0x7cdc31[_0xfa30('0x51')]['id']){delete _0x7cdc31[_0xfa30('0x51')]['id'];}return db['Dashboard'][_0xfa30('0x4f')]({'where':{'id':_0x7cdc31[_0xfa30('0x4d')]['id']}})['then'](handleEntityNotFound(_0x97e725,null))[_0xfa30('0x2a')](function(_0x521e24){if(_0x521e24){_0x7cdc31['body']['DashboardId']=_0x521e24['id'];_0x7cdc31[_0xfa30('0x51')][_0xfa30('0x62')]=widgetAttributes(_0x7cdc31[_0xfa30('0x51')]);return db[_0xfa30('0x7e')][_0xfa30('0x50')](_0x7cdc31[_0xfa30('0x51')]);}})[_0xfa30('0x2a')](respondWithResult(_0x97e725,null))['catch'](handleError(_0x97e725,null));};exports['getItems']=function(_0x136859,_0x5e9e86,_0x57b841){var _0x162fae={};var _0x35b50e={};var _0x57ec96;var _0x345694;return db[_0xfa30('0x47')][_0xfa30('0x7f')]({'where':{'id':_0x136859[_0xfa30('0x4d')]['id']}})[_0xfa30('0x2a')](handleEntityNotFound(_0x5e9e86,null))[_0xfa30('0x2a')](function(_0x3c2f12){if(_0x3c2f12){_0x57ec96=_0x3c2f12;_0x35b50e[_0xfa30('0x35')]=_[_0xfa30('0x38')](db[_0xfa30('0x7e')]['rawAttributes']);_0x35b50e[_0xfa30('0x37')]=_[_0xfa30('0x38')](_0x136859[_0xfa30('0x37')]);_0x35b50e[_0xfa30('0x39')]=_[_0xfa30('0x3a')](_0x35b50e[_0xfa30('0x35')],_0x35b50e[_0xfa30('0x37')]);_0x162fae[_0xfa30('0x3b')]=_[_0xfa30('0x3a')](_0x35b50e[_0xfa30('0x35')],qs[_0xfa30('0x3c')](_0x136859[_0xfa30('0x37')][_0xfa30('0x3c')]));_0x162fae[_0xfa30('0x3b')]=_0x162fae[_0xfa30('0x3b')][_0xfa30('0x3d')]?_0x162fae['attributes']:_0x35b50e[_0xfa30('0x35')];_0x162fae[_0xfa30('0x3f')]=qs['sort'](_0x136859[_0xfa30('0x37')][_0xfa30('0x40')]);_0x162fae['where']=qs['filters'](_[_0xfa30('0x41')](_0x136859[_0xfa30('0x37')],_0x35b50e[_0xfa30('0x39')]));if(_0x136859[_0xfa30('0x37')][_0xfa30('0x42')]){_0x162fae[_0xfa30('0x44')]=_[_0xfa30('0x43')](_0x162fae[_0xfa30('0x44')],{'$or':_[_0xfa30('0x36')](_0x162fae['attributes'],function(_0x51ceb0){var _0x28ff0c={};_0x28ff0c[_0x51ceb0]={'$like':'%'+_0x136859[_0xfa30('0x37')][_0xfa30('0x42')]+'%'};return _0x28ff0c;})});}_0x162fae=_['merge']({},_0x162fae,_0x136859[_0xfa30('0x46')]);return _0x57ec96[_0xfa30('0x80')](_0x162fae);}})[_0xfa30('0x2a')](function(_0x5b00d1){if(_0x5b00d1){_0x345694=_0x5b00d1[_0xfa30('0x3d')];if(!_0x136859['query']['hasOwnProperty'](_0xfa30('0x3e'))){_0x162fae[_0xfa30('0x25')]=qs[_0xfa30('0x25')](_0x136859[_0xfa30('0x37')][_0xfa30('0x25')]);_0x162fae['offset']=qs[_0xfa30('0x24')](_0x136859[_0xfa30('0x37')][_0xfa30('0x24')]);}return _0x57ec96[_0xfa30('0x80')](_0x162fae);}})['then'](function(_0x7ef3b){if(_0x7ef3b){return _0x7ef3b?{'count':_0x345694,'rows':_0x7ef3b}:null;}})['then'](respondWithResult(_0x5e9e86,null))['catch'](handleError(_0x5e9e86,null));}; \ No newline at end of file +var _0xdb84=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','map','Dashboard','rawAttributes','type','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','VIRTUAL','filter','merge','include','show','params','attributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','catch','includeAll','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x5043a0,_0x21cadd){var _0x5eac3b=function(_0x28a702){while(--_0x28a702){_0x5043a0['push'](_0x5043a0['shift']());}};_0x5eac3b(++_0x21cadd);}(_0xdb84,0x190));var _0x4db8=function(_0xbb2c90,_0x3b0548){_0xbb2c90=_0xbb2c90-0x0;var _0x22063=_0xdb84[_0xbb2c90];return _0x22063;};'use strict';var emlformat=require(_0x4db8('0x0'));var rimraf=require(_0x4db8('0x1'));var zipdir=require(_0x4db8('0x2'));var jsonpatch=require(_0x4db8('0x3'));var rp=require(_0x4db8('0x4'));var moment=require(_0x4db8('0x5'));var BPromise=require(_0x4db8('0x6'));var Mustache=require(_0x4db8('0x7'));var util=require(_0x4db8('0x8'));var path=require(_0x4db8('0x9'));var sox=require(_0x4db8('0xa'));var csv=require(_0x4db8('0xb'));var ejs=require(_0x4db8('0xc'));var fs=require('fs');var fs_extra=require(_0x4db8('0xd'));var _=require(_0x4db8('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4db8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4db8('0xb'));var querystring=require(_0x4db8('0x10'));var Papa=require(_0x4db8('0x11'));var Redis=require(_0x4db8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4db8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4db8('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4db8('0x15'));var config=require(_0x4db8('0x16'));var licenseUtil=require(_0x4db8('0x17'));var db=require(_0x4db8('0x18'))['db'];config[_0x4db8('0x19')]=_[_0x4db8('0x1a')](config[_0x4db8('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x4db8('0x1b'))(new Redis(config[_0x4db8('0x19')]));require('./dashboard.socket')[_0x4db8('0x1c')](socket);function respondWithStatusCode(_0x5f3a3c,_0x126cc6){_0x126cc6=_0x126cc6||0xcc;return function(_0x2973b8){if(_0x2973b8){return _0x5f3a3c['sendStatus'](_0x126cc6);}return _0x5f3a3c[_0x4db8('0x1d')](_0x126cc6)[_0x4db8('0x1e')]();};}function respondWithResult(_0x5763c0,_0x46a0d9){_0x46a0d9=_0x46a0d9||0xc8;return function(_0x4b60bd){if(_0x4b60bd){return _0x5763c0[_0x4db8('0x1d')](_0x46a0d9)[_0x4db8('0x1f')](_0x4b60bd);}};}function respondWithFilteredResult(_0x5b90f8,_0x5bb57e){return function(_0x565310){if(_0x565310){var _0x44efe7=typeof _0x5bb57e[_0x4db8('0x20')]===_0x4db8('0x21')&&typeof _0x5bb57e[_0x4db8('0x22')]===_0x4db8('0x21');var _0x25fc0c=_0x565310[_0x4db8('0x23')];var _0xa7c2ed=_0x44efe7?0x0:_0x5bb57e['offset'];var _0x501cfe=_0x44efe7?_0x565310[_0x4db8('0x23')]:_0x5bb57e['offset']+_0x5bb57e[_0x4db8('0x22')];var _0xbebf74;if(_0x501cfe>=_0x25fc0c){_0x501cfe=_0x25fc0c;_0xbebf74=0xc8;}else{_0xbebf74=0xce;}_0x5b90f8[_0x4db8('0x1d')](_0xbebf74);return _0x5b90f8['set'](_0x4db8('0x24'),_0xa7c2ed+'-'+_0x501cfe+'/'+_0x25fc0c)[_0x4db8('0x1f')](_0x565310);}return null;};}function patchUpdates(_0x2df74b){return function(_0x39ecd4){try{jsonpatch[_0x4db8('0x25')](_0x39ecd4,_0x2df74b,!![]);}catch(_0x1929c3){return BPromise[_0x4db8('0x26')](_0x1929c3);}return _0x39ecd4[_0x4db8('0x27')]();};}function saveUpdates(_0x919878,_0x306238){return function(_0x1b37f6){if(_0x1b37f6){return _0x1b37f6[_0x4db8('0x28')](_0x919878)[_0x4db8('0x29')](function(_0x5155b3){return _0x5155b3;});}return null;};}function removeEntity(_0x3ba984,_0x33157f){return function(_0x4153b2){if(_0x4153b2){return _0x4153b2[_0x4db8('0x2a')]()['then'](function(){var _0x5ec311=_0x4153b2[_0x4db8('0x2b')]({'plain':!![]});var _0xc64ef8='CustomDashboards';return db[_0x4db8('0x2c')]['destroy']({'where':{'type':_0xc64ef8,'resourceId':_0x5ec311['id']}})[_0x4db8('0x29')](function(){return _0x4153b2;});})[_0x4db8('0x29')](function(){_0x3ba984[_0x4db8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd240d4,_0x3f6211){return function(_0x3dce0c){if(!_0x3dce0c){_0xd240d4[_0x4db8('0x2d')](0x194);}return _0x3dce0c;};}function handleError(_0x2db965,_0x2f89a7){_0x2f89a7=_0x2f89a7||0x1f4;return function(_0x38a5ff){logger[_0x4db8('0x2e')](_0x38a5ff[_0x4db8('0x2f')]);if(_0x38a5ff[_0x4db8('0x30')]){delete _0x38a5ff[_0x4db8('0x30')];}_0x2db965['status'](_0x2f89a7)['send'](_0x38a5ff);};}exports[_0x4db8('0x31')]=function(_0x55456d,_0x1d44ab){var _0x5e50de={},_0x103bb4={},_0x43e645={'count':0x0,'rows':[]};var _0x3b2d49=_[_0x4db8('0x32')](db[_0x4db8('0x33')][_0x4db8('0x34')],function(_0x16d0dd){return{'name':_0x16d0dd['fieldName'],'type':_0x16d0dd[_0x4db8('0x35')]['key']};});_0x103bb4[_0x4db8('0x36')]=_[_0x4db8('0x32')](_0x3b2d49,_0x4db8('0x30'));_0x103bb4[_0x4db8('0x37')]=_[_0x4db8('0x38')](_0x55456d[_0x4db8('0x37')]);_0x103bb4['filters']=_[_0x4db8('0x39')](_0x103bb4['model'],_0x103bb4[_0x4db8('0x37')]);_0x5e50de['attributes']=_[_0x4db8('0x39')](_0x103bb4[_0x4db8('0x36')],qs[_0x4db8('0x3a')](_0x55456d[_0x4db8('0x37')][_0x4db8('0x3a')]));_0x5e50de['attributes']=_0x5e50de['attributes'][_0x4db8('0x3b')]?_0x5e50de['attributes']:_0x103bb4[_0x4db8('0x36')];if(!_0x55456d[_0x4db8('0x37')][_0x4db8('0x3c')](_0x4db8('0x3d'))){_0x5e50de['limit']=qs[_0x4db8('0x22')](_0x55456d[_0x4db8('0x37')][_0x4db8('0x22')]);_0x5e50de[_0x4db8('0x20')]=qs['offset'](_0x55456d[_0x4db8('0x37')][_0x4db8('0x20')]);}_0x5e50de[_0x4db8('0x3e')]=qs['sort'](_0x55456d[_0x4db8('0x37')][_0x4db8('0x3f')]);_0x5e50de['where']=qs[_0x4db8('0x40')](_['pick'](_0x55456d[_0x4db8('0x37')],_0x103bb4[_0x4db8('0x40')]),_0x3b2d49);if(_0x55456d['query']['filter']){_0x5e50de[_0x4db8('0x41')]=_['merge'](_0x5e50de[_0x4db8('0x41')],{'$or':_[_0x4db8('0x32')](_0x3b2d49,function(_0x2dd389){if(_0x2dd389[_0x4db8('0x35')]!==_0x4db8('0x42')){var _0x335b16={};_0x335b16[_0x2dd389[_0x4db8('0x30')]]={'$like':'%'+_0x55456d[_0x4db8('0x37')][_0x4db8('0x43')]+'%'};return _0x335b16;}})});}_0x5e50de=_[_0x4db8('0x44')]({},_0x5e50de,_0x55456d['options']);var _0x3c6618={'where':_0x5e50de[_0x4db8('0x41')]};return db[_0x4db8('0x33')][_0x4db8('0x23')](_0x3c6618)[_0x4db8('0x29')](function(_0x239e97){_0x43e645['count']=_0x239e97;if(_0x55456d[_0x4db8('0x37')]['includeAll']){_0x5e50de[_0x4db8('0x45')]=[{'all':!![]}];}return db[_0x4db8('0x33')]['findAll'](_0x5e50de);})['then'](function(_0xe774ed){_0x43e645['rows']=_0xe774ed;return _0x43e645;})['then'](respondWithFilteredResult(_0x1d44ab,_0x5e50de))['catch'](handleError(_0x1d44ab,null));};exports[_0x4db8('0x46')]=function(_0x211522,_0x391578){var _0x360397={'raw':![],'where':{'id':_0x211522[_0x4db8('0x47')]['id']}},_0x5b0b21={};_0x5b0b21['model']=_[_0x4db8('0x38')](db[_0x4db8('0x33')]['rawAttributes']);_0x5b0b21[_0x4db8('0x37')]=_[_0x4db8('0x38')](_0x211522[_0x4db8('0x37')]);_0x5b0b21['filters']=_[_0x4db8('0x39')](_0x5b0b21['model'],_0x5b0b21['query']);_0x360397['attributes']=_[_0x4db8('0x39')](_0x5b0b21[_0x4db8('0x36')],qs[_0x4db8('0x3a')](_0x211522[_0x4db8('0x37')]['fields']));_0x360397[_0x4db8('0x48')]=_0x360397[_0x4db8('0x48')][_0x4db8('0x3b')]?_0x360397[_0x4db8('0x48')]:_0x5b0b21[_0x4db8('0x36')];if(_0x211522[_0x4db8('0x37')]['includeAll']){_0x360397[_0x4db8('0x45')]=[{'all':!![]}];}_0x360397=_[_0x4db8('0x44')]({},_0x360397,_0x211522[_0x4db8('0x49')]);return db[_0x4db8('0x33')][_0x4db8('0x4a')](_0x360397)[_0x4db8('0x29')](handleEntityNotFound(_0x391578,null))[_0x4db8('0x29')](respondWithResult(_0x391578,null))['catch'](handleError(_0x391578,null));};exports[_0x4db8('0x4b')]=function(_0x30d1b0,_0x5cdbf2){return db[_0x4db8('0x33')][_0x4db8('0x4b')](_0x30d1b0[_0x4db8('0x4c')],{})[_0x4db8('0x29')](function(_0x2a71d2){var _0xa74398=_0x30d1b0[_0x4db8('0x4d')][_0x4db8('0x2b')]({'plain':!![]});if(!_0xa74398)throw new Error(_0x4db8('0x4e'));if(_0xa74398[_0x4db8('0x4f')]==='user'){var _0x96f131=_0x2a71d2['get']({'plain':!![]});var _0x46ad7e=_0x4db8('0x50');return db[_0x4db8('0x51')][_0x4db8('0x4a')]({'where':{'name':_0x46ad7e,'userProfileId':_0xa74398['userProfileId']},'raw':!![]})['then'](function(_0x2c5f92){if(_0x2c5f92&&_0x2c5f92[_0x4db8('0x52')]===0x0){return db[_0x4db8('0x2c')][_0x4db8('0x4b')]({'name':_0x96f131[_0x4db8('0x30')],'resourceId':_0x96f131['id'],'type':_0x2c5f92[_0x4db8('0x30')],'sectionId':_0x2c5f92['id']},{})[_0x4db8('0x29')](function(){return _0x2a71d2;});}else{return _0x2a71d2;}})[_0x4db8('0x53')](function(_0x1b2485){logger[_0x4db8('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2485);throw _0x1b2485;});}return _0x2a71d2;})[_0x4db8('0x29')](respondWithResult(_0x5cdbf2,0xc9))[_0x4db8('0x53')](handleError(_0x5cdbf2,null));};exports['clone']=function(_0x65620b,_0x5eb086){var _0x4b77eb={'where':{'id':_0x65620b['params']['id']}},_0x1ad7bc={};_0x1ad7bc[_0x4db8('0x36')]=_[_0x4db8('0x38')](db[_0x4db8('0x33')][_0x4db8('0x34')]);_0x4b77eb['attributes']=_[_0x4db8('0x39')](_0x1ad7bc[_0x4db8('0x36')],qs[_0x4db8('0x3a')](_0x65620b['query'][_0x4db8('0x3a')]));_0x4b77eb[_0x4db8('0x48')]=_0x4b77eb[_0x4db8('0x48')][_0x4db8('0x3b')]?_0x4b77eb[_0x4db8('0x48')]:_0x1ad7bc['model'];if(_0x65620b[_0x4db8('0x37')][_0x4db8('0x54')]){_0x4b77eb[_0x4db8('0x45')]=[{'all':!![]}];}_0x4b77eb=_[_0x4db8('0x44')]({},_0x4b77eb,_0x65620b['options']);return db[_0x4db8('0x33')][_0x4db8('0x4a')](_0x4b77eb)['then'](handleEntityNotFound(_0x5eb086,null))[_0x4db8('0x29')](function(_0xace379){if(_0xace379){var _0x7cfe73=_0xace379[_0x4db8('0x2b')]({'plain':!![]});_0x7cfe73=qs[_0x4db8('0x55')](_0x7cfe73,['id',_0x4db8('0x56'),_0x4db8('0x57')]);_0x65620b['body']=_[_0x4db8('0x55')](_0x65620b['body'],['id',_0x4db8('0x56'),_0x4db8('0x57')]);return db[_0x4db8('0x33')][_0x4db8('0x4b')](_[_0x4db8('0x44')](_0x7cfe73,_0x65620b[_0x4db8('0x4c')]),{'include':_0x65620b[_0x4db8('0x37')][_0x4db8('0x54')]?[{'all':!![]}]:undefined})[_0x4db8('0x29')](function(_0x56c21f){var _0x4b6b2d=_0x65620b[_0x4db8('0x4d')][_0x4db8('0x2b')]({'plain':!![]});if(!_0x4b6b2d)throw new Error(_0x4db8('0x4e'));if(_0x4b6b2d[_0x4db8('0x4f')]===_0x4db8('0x4d')){var _0x4b7d09=_0x56c21f[_0x4db8('0x2b')]({'plain':!![]});var _0x5cac68=_0x4db8('0x50');return db[_0x4db8('0x51')][_0x4db8('0x4a')]({'where':{'name':_0x5cac68,'userProfileId':_0x4b6b2d[_0x4db8('0x58')]},'raw':!![]})[_0x4db8('0x29')](function(_0x2a89cf){if(_0x2a89cf&&_0x2a89cf[_0x4db8('0x52')]===0x0){return db[_0x4db8('0x2c')]['create']({'name':_0x4b7d09['name'],'resourceId':_0x4b7d09['id'],'type':_0x2a89cf[_0x4db8('0x30')],'sectionId':_0x2a89cf['id']},{})[_0x4db8('0x29')](function(){return _0x56c21f;});}else{return _0x56c21f;}})[_0x4db8('0x53')](function(_0x1b970a){logger['error'](_0x4db8('0x59'),_0x1b970a);throw _0x1b970a;});}return _0x56c21f;});}})[_0x4db8('0x29')](respondWithResult(_0x5eb086,0xc9))['catch'](handleError(_0x5eb086,null));};exports[_0x4db8('0x28')]=function(_0x2f77a4,_0x32c1d8){if(_0x2f77a4['body']['id']){delete _0x2f77a4['body']['id'];}return db[_0x4db8('0x33')][_0x4db8('0x4a')]({'where':{'id':_0x2f77a4[_0x4db8('0x47')]['id']}})[_0x4db8('0x29')](handleEntityNotFound(_0x32c1d8,null))['then'](saveUpdates(_0x2f77a4[_0x4db8('0x4c')],null))[_0x4db8('0x29')](respondWithResult(_0x32c1d8,null))[_0x4db8('0x53')](handleError(_0x32c1d8,null));};exports[_0x4db8('0x2a')]=function(_0x241781,_0x5bb6d9){return db[_0x4db8('0x33')][_0x4db8('0x4a')]({'where':{'id':_0x241781[_0x4db8('0x47')]['id']}})[_0x4db8('0x29')](handleEntityNotFound(_0x5bb6d9,null))[_0x4db8('0x29')](removeEntity(_0x5bb6d9,null))[_0x4db8('0x53')](handleError(_0x5bb6d9,null));};function widgetAttributes(_0x4deef2){try{switch(_0x4deef2['type']){case _0x4db8('0x5a'):return[{'name':_0x4db8('0x5b'),'value':_0x4deef2[_0x4db8('0x5b')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x5d')]:undefined)||'https://'}];case _0x4db8('0x5e'):return[{'name':'attrPath','value':_0x4deef2['attrPath']||(_0x4deef2['attrs']&&_0x4deef2[_0x4db8('0x5c')][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x4db8('0x5f'),'value':_0x4deef2[_0x4db8('0x5f')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x5d')]:undefined)||_0x4db8('0x60')},{'name':_0x4db8('0x61'),'value':_0x4deef2[_0x4db8('0x61')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x1]?_0x4deef2[_0x4db8('0x5c')][0x1][_0x4db8('0x5d')]:undefined)||_0x4db8('0x62')},{'name':_0x4db8('0x63'),'value':_0x4deef2[_0x4db8('0x63')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x2]?_0x4deef2['attrs'][0x2][_0x4db8('0x5d')]:undefined)||0xc}];case _0x4db8('0x64'):return[{'name':_0x4db8('0x65'),'value':_0x4deef2[_0x4db8('0x65')]||(_0x4deef2['attrs']&&_0x4deef2['attrs'][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x5d')]:undefined)||_0x4db8('0x66')},{'name':'attrVoiceQueues','value':_0x4deef2['attrVoiceQueues']||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x1]?_0x4deef2['attrs'][0x1][_0x4db8('0x5d')]:undefined)||[]},{'name':_0x4db8('0x63'),'value':_0x4deef2[_0x4db8('0x63')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x2]?_0x4deef2['attrs'][0x2][_0x4db8('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x4deef2[_0x4db8('0x67')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x3]?_0x4deef2[_0x4db8('0x5c')][0x3][_0x4db8('0x5d')]:undefined)||'voice'},{'name':_0x4db8('0x68'),'value':_0x4deef2[_0x4db8('0x68')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x4]?_0x4deef2[_0x4db8('0x5c')][0x4][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x69'),'value':_0x4deef2[_0x4db8('0x69')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x5]?_0x4deef2['attrs'][0x5][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x6a'),'value':_0x4deef2[_0x4db8('0x6a')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x6]?_0x4deef2[_0x4db8('0x5c')][0x6][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x6b'),'value':_0x4deef2['attrOpenchannelAccounts']||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x7]?_0x4deef2['attrs'][0x7]['value']:undefined)||''},{'name':_0x4db8('0x6c'),'value':_0x4deef2[_0x4db8('0x6c')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x8]?_0x4deef2[_0x4db8('0x5c')][0x8]['value']:undefined)||''},{'name':_0x4db8('0x6d'),'value':_0x4deef2[_0x4db8('0x6d')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x9]?_0x4deef2['attrs'][0x9]['value']:undefined)||''}];case _0x4db8('0x6e'):case _0x4db8('0x6f'):return[{'name':_0x4db8('0x70'),'value':_0x4deef2[_0x4db8('0x70')]||(_0x4deef2['attrs']&&_0x4deef2[_0x4db8('0x5c')][0x0]?_0x4deef2['attrs'][0x0][_0x4db8('0x5d')]:undefined)||_0x4db8('0x66')},{'name':_0x4db8('0x71'),'value':_0x4deef2[_0x4db8('0x71')]||(_0x4deef2['attrs']&&_0x4deef2['attrs'][0x1]?_0x4deef2['attrs'][0x1][_0x4db8('0x5d')]:undefined)||null},{'name':_0x4db8('0x72'),'value':_0x4deef2[_0x4db8('0x72')]||(_0x4deef2['attrs']&&_0x4deef2[_0x4db8('0x5c')][0x2]?_0x4deef2['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x4deef2[_0x4db8('0x73')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x3]?_0x4deef2[_0x4db8('0x5c')][0x3][_0x4db8('0x5d')]:undefined)||[]},{'name':_0x4db8('0x67'),'value':_0x4deef2['attrChannel']||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x4]?_0x4deef2['attrs'][0x4][_0x4db8('0x5d')]:undefined)||'voice'},{'name':_0x4db8('0x68'),'value':_0x4deef2[_0x4db8('0x68')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x5]?_0x4deef2[_0x4db8('0x5c')][0x5][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x69'),'value':_0x4deef2[_0x4db8('0x69')]||(_0x4deef2['attrs']&&_0x4deef2['attrs'][0x6]?_0x4deef2[_0x4db8('0x5c')][0x6][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x6a'),'value':_0x4deef2[_0x4db8('0x6a')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x7]?_0x4deef2[_0x4db8('0x5c')][0x7]['value']:undefined)||''},{'name':_0x4db8('0x6b'),'value':_0x4deef2['attrOpenchannelAccounts']||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x8]?_0x4deef2[_0x4db8('0x5c')][0x8][_0x4db8('0x5d')]:undefined)||''},{'name':_0x4db8('0x6c'),'value':_0x4deef2[_0x4db8('0x6c')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x9]?_0x4deef2[_0x4db8('0x5c')][0x9][_0x4db8('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4deef2[_0x4db8('0x6d')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0xa]?_0x4deef2[_0x4db8('0x5c')][0xa][_0x4db8('0x5d')]:undefined)||''}];case _0x4db8('0x74'):return[{'name':_0x4db8('0x75'),'type':_0x4deef2[_0x4db8('0x76')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2['attrs'][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x35')]:undefined)||null,'value':_0x4deef2[_0x4db8('0x75')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x0]?_0x4deef2[_0x4db8('0x5c')][0x0][_0x4db8('0x5d')]:undefined)||null},{'name':_0x4db8('0x77'),'value':_0x4deef2[_0x4db8('0x77')]||(_0x4deef2[_0x4db8('0x5c')]&&_0x4deef2[_0x4db8('0x5c')][0x1]?_0x4deef2[_0x4db8('0x5c')][0x1][_0x4db8('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x41c422){logger['error'](_0x4db8('0x78'),JSON[_0x4db8('0x79')](_0x41c422));return[];}}exports[_0x4db8('0x7a')]=function(_0x13d8c6,_0x597031,_0x38cbcc){if(_0x13d8c6[_0x4db8('0x4c')]['id']){delete _0x13d8c6[_0x4db8('0x4c')]['id'];}return db[_0x4db8('0x33')][_0x4db8('0x4a')]({'where':{'id':_0x13d8c6[_0x4db8('0x47')]['id']}})['then'](handleEntityNotFound(_0x597031,null))['then'](function(_0x49988f){if(_0x49988f){_0x13d8c6[_0x4db8('0x4c')][_0x4db8('0x7b')]=_0x49988f['id'];_0x13d8c6[_0x4db8('0x4c')]['attrs']=widgetAttributes(_0x13d8c6[_0x4db8('0x4c')]);return db[_0x4db8('0x7c')][_0x4db8('0x4b')](_0x13d8c6[_0x4db8('0x4c')]);}})['then'](respondWithResult(_0x597031,null))['catch'](handleError(_0x597031,null));};exports['getItems']=function(_0x51bc3a,_0x5a8f10,_0x1c84e1){var _0x154c84={};var _0x35b998={};var _0x346540;var _0x257407;return db[_0x4db8('0x33')][_0x4db8('0x7d')]({'where':{'id':_0x51bc3a['params']['id']}})[_0x4db8('0x29')](handleEntityNotFound(_0x5a8f10,null))['then'](function(_0xe8ba77){if(_0xe8ba77){_0x346540=_0xe8ba77;_0x35b998[_0x4db8('0x36')]=_['keys'](db['DashboardItem'][_0x4db8('0x34')]);_0x35b998[_0x4db8('0x37')]=_[_0x4db8('0x38')](_0x51bc3a[_0x4db8('0x37')]);_0x35b998[_0x4db8('0x40')]=_[_0x4db8('0x39')](_0x35b998[_0x4db8('0x36')],_0x35b998[_0x4db8('0x37')]);_0x154c84['attributes']=_[_0x4db8('0x39')](_0x35b998[_0x4db8('0x36')],qs[_0x4db8('0x3a')](_0x51bc3a[_0x4db8('0x37')][_0x4db8('0x3a')]));_0x154c84[_0x4db8('0x48')]=_0x154c84[_0x4db8('0x48')][_0x4db8('0x3b')]?_0x154c84['attributes']:_0x35b998[_0x4db8('0x36')];_0x154c84[_0x4db8('0x3e')]=qs[_0x4db8('0x3f')](_0x51bc3a[_0x4db8('0x37')][_0x4db8('0x3f')]);_0x154c84[_0x4db8('0x41')]=qs['filters'](_['pick'](_0x51bc3a[_0x4db8('0x37')],_0x35b998[_0x4db8('0x40')]));if(_0x51bc3a['query']['filter']){_0x154c84['where']=_[_0x4db8('0x44')](_0x154c84['where'],{'$or':_[_0x4db8('0x32')](_0x154c84[_0x4db8('0x48')],function(_0x533773){var _0xfcb1d4={};_0xfcb1d4[_0x533773]={'$like':'%'+_0x51bc3a['query']['filter']+'%'};return _0xfcb1d4;})});}_0x154c84=_[_0x4db8('0x44')]({},_0x154c84,_0x51bc3a['options']);return _0x346540[_0x4db8('0x7e')](_0x154c84);}})[_0x4db8('0x29')](function(_0x15eb4d){if(_0x15eb4d){_0x257407=_0x15eb4d[_0x4db8('0x3b')];if(!_0x51bc3a[_0x4db8('0x37')][_0x4db8('0x3c')]('nolimit')){_0x154c84[_0x4db8('0x22')]=qs['limit'](_0x51bc3a['query'][_0x4db8('0x22')]);_0x154c84[_0x4db8('0x20')]=qs['offset'](_0x51bc3a['query'][_0x4db8('0x20')]);}return _0x346540[_0x4db8('0x7e')](_0x154c84);}})['then'](function(_0x7b996e){if(_0x7b996e){return _0x7b996e?{'count':_0x257407,'rows':_0x7b996e}:null;}})[_0x4db8('0x29')](respondWithResult(_0x5a8f10,null))[_0x4db8('0x53')](handleError(_0x5a8f10,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 44cb4e8..cc969f5 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 _0xe091=['../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1bb6d9,_0xe46af9){var _0x2ce766=function(_0xd5af66){while(--_0xd5af66){_0x1bb6d9['push'](_0x1bb6d9['shift']());}};_0x2ce766(++_0xe46af9);}(_0xe091,0x1ad));var _0x1e09=function(_0xe974b2,_0x1895e1){_0xe974b2=_0xe974b2-0x0;var _0xb38cf0=_0xe091[_0xe974b2];return _0xb38cf0;};'use strict';var EventEmitter=require(_0x1e09('0x0'));var Dashboard=require(_0x1e09('0x1'))['db'][_0x1e09('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1e09('0x3'),'afterUpdate':_0x1e09('0x4'),'afterDestroy':_0x1e09('0x5')};function emitEvent(_0x4e0879){return function(_0x1a43af,_0x110900,_0x1d9cc4){DashboardEvents[_0x1e09('0x6')](_0x4e0879+':'+_0x1a43af['id'],_0x1a43af);DashboardEvents[_0x1e09('0x6')](_0x4e0879,_0x1a43af);_0x1d9cc4(null);};}for(var e in events){if(events[_0x1e09('0x7')](e)){var event=events[e];Dashboard[_0x1e09('0x8')](e,emitEvent(event));}}module[_0x1e09('0x9')]=DashboardEvents; \ No newline at end of file +var _0xdf79=['emit','hasOwnProperty','exports','Dashboard','save','remove'];(function(_0x2c4d31,_0x21f3a8){var _0x3a9785=function(_0x1fb5b8){while(--_0x1fb5b8){_0x2c4d31['push'](_0x2c4d31['shift']());}};_0x3a9785(++_0x21f3a8);}(_0xdf79,0x99));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x9df7('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9df7('0x1'),'afterUpdate':'update','afterDestroy':_0x9df7('0x2')};function emitEvent(_0x399c2d){return function(_0x2cc502,_0x5af1eb,_0x3e1de5){DashboardEvents[_0x9df7('0x3')](_0x399c2d+':'+_0x2cc502['id'],_0x2cc502);DashboardEvents['emit'](_0x399c2d,_0x2cc502);_0x3e1de5(null);};}for(var e in events){if(events[_0x9df7('0x4')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x9df7('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index e44112d..005d4a8 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 _0x1ef8=['Dashboard','dashboards','lodash','util','api','moment','bluebird','rimraf','./dashboard.attributes','exports'];(function(_0x5c8205,_0x45dd52){var _0x19ed05=function(_0x26cee9){while(--_0x26cee9){_0x5c8205['push'](_0x5c8205['shift']());}};_0x19ed05(++_0x45dd52);}(_0x1ef8,0xa2));var _0x81ef=function(_0x2e0a02,_0x49bee1){_0x2e0a02=_0x2e0a02-0x0;var _0x4cdf44=_0x1ef8[_0x2e0a02];return _0x4cdf44;};'use strict';var _=require(_0x81ef('0x0'));var util=require(_0x81ef('0x1'));var logger=require('../../config/logger')(_0x81ef('0x2'));var moment=require(_0x81ef('0x3'));var BPromise=require(_0x81ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81ef('0x5'));var config=require('../../config/environment');var attributes=require(_0x81ef('0x6'));module[_0x81ef('0x7')]=function(_0x1805c2,_0x368f16){return _0x1805c2['define'](_0x81ef('0x8'),attributes,{'tableName':_0x81ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8af9=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','path'];(function(_0x4d7c86,_0x9b62a6){var _0x59443d=function(_0x5af971){while(--_0x5af971){_0x4d7c86['push'](_0x4d7c86['shift']());}};_0x59443d(++_0x9b62a6);}(_0x8af9,0x132));var _0x98af=function(_0x41e57d,_0x1bd4a5){_0x41e57d=_0x41e57d-0x0;var _0x426ec6=_0x8af9[_0x41e57d];return _0x426ec6;};'use strict';var _=require(_0x98af('0x0'));var util=require(_0x98af('0x1'));var logger=require(_0x98af('0x2'))(_0x98af('0x3'));var moment=require(_0x98af('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x98af('0x5'));var rimraf=require(_0x98af('0x6'));var config=require(_0x98af('0x7'));var attributes=require(_0x98af('0x8'));module[_0x98af('0x9')]=function(_0x44ee3f,_0x1407ce){return _0x44ee3f[_0x98af('0xa')](_0x98af('0xb'),attributes,{'tableName':_0x98af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 6f8af5f..511d8e7 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 _0x7771=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','lodash','util','moment'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x7771,0x15c));var _0x1777=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x7771[_0xa8369a];return _0x4b74b7;};'use strict';var _=require(_0x1777('0x0'));var util=require(_0x1777('0x1'));var moment=require(_0x1777('0x2'));var BPromise=require(_0x1777('0x3'));var rs=require(_0x1777('0x4'));var fs=require('fs');var Redis=require(_0x1777('0x5'));var db=require(_0x1777('0x6'))['db'];var utils=require(_0x1777('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1777('0x8'));var jayson=require(_0x1777('0x9'));var client=jayson[_0x1777('0xa')]['http']({'port':0x232a});config[_0x1777('0xb')]=_['defaults'](config[_0x1777('0xb')],{'host':_0x1777('0xc'),'port':0x18eb});var socket=require(_0x1777('0xd'))(new Redis(config[_0x1777('0xb')]));require(_0x1777('0xe'))[_0x1777('0xf')](socket);function respondWithRpcPromise(_0x51800e,_0x45b858,_0x51cdd0){return new BPromise(function(_0x43b931,_0x11721e){return client[_0x1777('0x10')](_0x51800e,_0x51cdd0)[_0x1777('0x11')](function(_0x57d971){logger[_0x1777('0x12')]('Dashboard,\x20%s,\x20%s',_0x45b858,_0x1777('0x13'));logger[_0x1777('0x14')](_0x1777('0x15'),_0x45b858,'request\x20sent',JSON[_0x1777('0x16')](_0x57d971));if(_0x57d971[_0x1777('0x17')]){if(_0x57d971['error'][_0x1777('0x18')]===0x1f4){logger[_0x1777('0x17')](_0x1777('0x19'),_0x45b858,_0x57d971['error'][_0x1777('0x1a')]);return _0x11721e(_0x57d971[_0x1777('0x17')]['message']);}logger[_0x1777('0x17')](_0x1777('0x19'),_0x45b858,_0x57d971[_0x1777('0x17')][_0x1777('0x1a')]);return _0x43b931(_0x57d971[_0x1777('0x17')][_0x1777('0x1a')]);}else{logger[_0x1777('0x12')](_0x1777('0x19'),_0x45b858,_0x1777('0x13'));_0x43b931(_0x57d971['result'][_0x1777('0x1a')]);}})['catch'](function(_0x3fdcac){logger[_0x1777('0x17')](_0x1777('0x19'),_0x45b858,_0x3fdcac);_0x11721e(_0x3fdcac);});});} \ No newline at end of file +var _0xd774=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x46ddb9,_0x39f91c){var _0x2b780e=function(_0x246cac){while(--_0x246cac){_0x46ddb9['push'](_0x46ddb9['shift']());}};_0x2b780e(++_0x39f91c);}(_0xd774,0xb1));var _0x4d77=function(_0x581d05,_0x3db0e7){_0x581d05=_0x581d05-0x0;var _0x3db033=_0xd774[_0x581d05];return _0x3db033;};'use strict';var _=require('lodash');var util=require(_0x4d77('0x0'));var moment=require(_0x4d77('0x1'));var BPromise=require(_0x4d77('0x2'));var rs=require(_0x4d77('0x3'));var fs=require('fs');var Redis=require(_0x4d77('0x4'));var db=require(_0x4d77('0x5'))['db'];var utils=require(_0x4d77('0x6'));var logger=require('../../config/logger')(_0x4d77('0x7'));var config=require(_0x4d77('0x8'));var jayson=require(_0x4d77('0x9'));var client=jayson[_0x4d77('0xa')][_0x4d77('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4d77('0xc')],{'host':_0x4d77('0xd'),'port':0x18eb});var socket=require(_0x4d77('0xe'))(new Redis(config[_0x4d77('0xc')]));require(_0x4d77('0xf'))[_0x4d77('0x10')](socket);function respondWithRpcPromise(_0xfce8dd,_0x54f285,_0x1a3ba7){return new BPromise(function(_0xaaae5c,_0x47e158){return client[_0x4d77('0x11')](_0xfce8dd,_0x1a3ba7)['then'](function(_0x9c8912){logger[_0x4d77('0x12')](_0x4d77('0x13'),_0x54f285,_0x4d77('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x54f285,_0x4d77('0x14'),JSON[_0x4d77('0x15')](_0x9c8912));if(_0x9c8912[_0x4d77('0x16')]){if(_0x9c8912['error'][_0x4d77('0x17')]===0x1f4){logger[_0x4d77('0x16')]('Dashboard,\x20%s,\x20%s',_0x54f285,_0x9c8912['error']['message']);return _0x47e158(_0x9c8912['error'][_0x4d77('0x18')]);}logger['error'](_0x4d77('0x13'),_0x54f285,_0x9c8912[_0x4d77('0x16')][_0x4d77('0x18')]);return _0xaaae5c(_0x9c8912[_0x4d77('0x16')]['message']);}else{logger['info'](_0x4d77('0x13'),_0x54f285,_0x4d77('0x14'));_0xaaae5c(_0x9c8912['result'][_0x4d77('0x18')]);}})[_0x4d77('0x19')](function(_0x5f05da){logger[_0x4d77('0x16')](_0x4d77('0x13'),_0x54f285,_0x5f05da);_0x47e158(_0x5f05da);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 729db70..35554a4 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 _0x064d=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x279224,_0x949076){var _0x401a4a=function(_0x4d5c3b){while(--_0x4d5c3b){_0x279224['push'](_0x279224['shift']());}};_0x401a4a(++_0x949076);}(_0x064d,0x124));var _0xd064=function(_0x1dfcfb,_0x1d185d){_0x1dfcfb=_0x1dfcfb-0x0;var _0x792502=_0x064d[_0x1dfcfb];return _0x792502;};'use strict';var DashboardEvents=require(_0xd064('0x0'));var events=[_0xd064('0x1'),_0xd064('0x2'),_0xd064('0x3')];function createListener(_0x2b8e9f,_0x1419a9){return function(_0x3274c3){_0x1419a9[_0xd064('0x4')](_0x2b8e9f,_0x3274c3);};}function removeListener(_0x1af583,_0x3de28b){return function(){DashboardEvents[_0xd064('0x5')](_0x1af583,_0x3de28b);};}exports[_0xd064('0x6')]=function(_0x54e839){for(var _0x2c6e9a=0x0,_0x312f12=events[_0xd064('0x7')];_0x2c6e9a<_0x312f12;_0x2c6e9a++){var _0x390e34=events[_0x2c6e9a];var _0x283866=createListener(_0xd064('0x8')+_0x390e34,_0x54e839);DashboardEvents['on'](_0x390e34,_0x283866);}}; \ No newline at end of file +var _0xb1d0=['remove','update','emit','removeListener','register','dashboard:','./dashboard.events','save'];(function(_0x52522d,_0x7347af){var _0x37e5db=function(_0x16dde7){while(--_0x16dde7){_0x52522d['push'](_0x52522d['shift']());}};_0x37e5db(++_0x7347af);}(_0xb1d0,0x196));var _0x0b1d=function(_0x3b0265,_0x54c4b6){_0x3b0265=_0x3b0265-0x0;var _0x4d6215=_0xb1d0[_0x3b0265];return _0x4d6215;};'use strict';var DashboardEvents=require(_0x0b1d('0x0'));var events=[_0x0b1d('0x1'),_0x0b1d('0x2'),_0x0b1d('0x3')];function createListener(_0x37f557,_0x57f3f1){return function(_0x5cdbf5){_0x57f3f1[_0x0b1d('0x4')](_0x37f557,_0x5cdbf5);};}function removeListener(_0x395c10,_0x475e6d){return function(){DashboardEvents[_0x0b1d('0x5')](_0x395c10,_0x475e6d);};}exports[_0x0b1d('0x6')]=function(_0x2d875f){for(var _0x198563=0x0,_0x5b1763=events['length'];_0x198563<_0x5b1763;_0x198563++){var _0x34b770=events[_0x198563];var _0x174173=createListener(_0x0b1d('0x7')+_0x34b770,_0x2d875f);DashboardEvents['on'](_0x34b770,_0x174173);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4e3ce61..bb9211e 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 _0x8172=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','get','/:id','show','/:id/items','getItems','post','create','clone','addItem'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x8172,0xad));var _0x2817=function(_0x98016a,_0xc9fbb1){_0x98016a=_0x98016a-0x0;var _0x209dae=_0x8172[_0x98016a];return _0x209dae;};'use strict';var multer=require('multer');var util=require(_0x2817('0x0'));var path=require(_0x2817('0x1'));var timeout=require('connect-timeout');var express=require(_0x2817('0x2'));var router=express[_0x2817('0x3')]();var fs_extra=require(_0x2817('0x4'));var auth=require(_0x2817('0x5'));var interaction=require(_0x2817('0x6'));var config=require(_0x2817('0x7'));var controller=require(_0x2817('0x8'));router['get']('/',auth[_0x2817('0x9')](),controller['index']);router[_0x2817('0xa')](_0x2817('0xb'),auth[_0x2817('0x9')](),controller[_0x2817('0xc')]);router['get'](_0x2817('0xd'),auth['isAuthenticated'](),controller[_0x2817('0xe')]);router[_0x2817('0xf')]('/',auth[_0x2817('0x9')](),controller[_0x2817('0x10')]);router[_0x2817('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x2817('0x11')]);router[_0x2817('0xf')](_0x2817('0xd'),auth[_0x2817('0x9')](),controller[_0x2817('0x12')]);router[_0x2817('0x13')](_0x2817('0xb'),auth[_0x2817('0x9')](),controller[_0x2817('0x14')]);router[_0x2817('0x15')](_0x2817('0xb'),auth[_0x2817('0x9')](),controller[_0x2817('0x16')]);module[_0x2817('0x17')]=router; \ No newline at end of file +var _0x68cc=['get','/:id','show','/:id/items','getItems','post','clone','addItem','put','update','destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index'];(function(_0x452429,_0x10ca1a){var _0x162c24=function(_0x509e11){while(--_0x509e11){_0x452429['push'](_0x452429['shift']());}};_0x162c24(++_0x10ca1a);}(_0x68cc,0x1eb));var _0xc68c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x68cc[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0xc68c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68c('0x1')]();var fs_extra=require(_0xc68c('0x2'));var auth=require(_0xc68c('0x3'));var interaction=require(_0xc68c('0x4'));var config=require(_0xc68c('0x5'));var controller=require(_0xc68c('0x6'));router['get']('/',auth[_0xc68c('0x7')](),controller[_0xc68c('0x8')]);router[_0xc68c('0x9')](_0xc68c('0xa'),auth[_0xc68c('0x7')](),controller[_0xc68c('0xb')]);router[_0xc68c('0x9')](_0xc68c('0xc'),auth[_0xc68c('0x7')](),controller[_0xc68c('0xd')]);router[_0xc68c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth[_0xc68c('0x7')](),controller[_0xc68c('0xf')]);router[_0xc68c('0xe')](_0xc68c('0xc'),auth['isAuthenticated'](),controller[_0xc68c('0x10')]);router[_0xc68c('0x11')](_0xc68c('0xa'),auth['isAuthenticated'](),controller[_0xc68c('0x12')]);router['delete'](_0xc68c('0xa'),auth[_0xc68c('0x7')](),controller[_0xc68c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3828a89..5d9ca66 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 _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7a54,0x106));var _0x47a5=function(_0x4dbaee,_0xdbcd2){_0x4dbaee=_0x4dbaee-0x0;var _0x5b5437=_0x7a54[_0x4dbaee];return _0x5b5437;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x19ae53,_0x2164c3){var _0x3e1bf7=function(_0x231193){while(--_0x231193){_0x19ae53['push'](_0x19ae53['shift']());}};_0x3e1bf7(++_0x2164c3);}(_0xeda8,0x104));var _0x8eda=function(_0x568c74,_0x2e97c9){_0x568c74=_0x568c74-0x0;var _0x22d3b9=_0xeda8[_0x568c74];return _0x22d3b9;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'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 fcb9977..03e2f47 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 _0x7958=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','value','custom','attrPath','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrOpenchannelAccounts','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch'];(function(_0x5354a7,_0x4ae95d){var _0x5c0116=function(_0x2d2a1d){while(--_0x2d2a1d){_0x5354a7['push'](_0x5354a7['shift']());}};_0x5c0116(++_0x4ae95d);}(_0x7958,0x126));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8795('0x0'));var rimraf=require(_0x8795('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8795('0x2'));var rp=require(_0x8795('0x3'));var moment=require(_0x8795('0x4'));var BPromise=require(_0x8795('0x5'));var Mustache=require(_0x8795('0x6'));var util=require(_0x8795('0x7'));var path=require(_0x8795('0x8'));var sox=require(_0x8795('0x9'));var csv=require('to-csv');var ejs=require(_0x8795('0xa'));var fs=require('fs');var fs_extra=require(_0x8795('0xb'));var _=require(_0x8795('0xc'));var squel=require('squel');var crypto=require(_0x8795('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8795('0xe'));var toCsv=require(_0x8795('0xf'));var querystring=require(_0x8795('0x10'));var Papa=require(_0x8795('0x11'));var Redis=require(_0x8795('0x12'));var authService=require(_0x8795('0x13'));var qs=require(_0x8795('0x14'));var as=require(_0x8795('0x15'));var hardwareService=require(_0x8795('0x16'));var logger=require(_0x8795('0x17'))(_0x8795('0x18'));var utils=require(_0x8795('0x19'));var config=require(_0x8795('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x8795('0x1b'))['db'];config[_0x8795('0x1c')]=_[_0x8795('0x1d')](config[_0x8795('0x1c')],{'host':_0x8795('0x1e'),'port':0x18eb});var socket=require(_0x8795('0x1f'))(new Redis(config[_0x8795('0x1c')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x595064,_0x283437){_0x283437=_0x283437||0xcc;return function(_0xb3f0d7){if(_0xb3f0d7){return _0x595064[_0x8795('0x20')](_0x283437);}return _0x595064[_0x8795('0x21')](_0x283437)[_0x8795('0x22')]();};}function respondWithResult(_0x2027c1,_0x3f835f){_0x3f835f=_0x3f835f||0xc8;return function(_0x5017fc){if(_0x5017fc){return _0x2027c1[_0x8795('0x21')](_0x3f835f)['json'](_0x5017fc);}};}function respondWithFilteredResult(_0x42005e,_0x1eed23){return function(_0x498eea){if(_0x498eea){var _0x2e5452=typeof _0x1eed23[_0x8795('0x23')]===_0x8795('0x24')&&typeof _0x1eed23[_0x8795('0x25')]==='undefined';var _0x1aae20=_0x498eea[_0x8795('0x26')];var _0x4a65f0=_0x2e5452?0x0:_0x1eed23[_0x8795('0x23')];var _0x2a9501=_0x2e5452?_0x498eea[_0x8795('0x26')]:_0x1eed23[_0x8795('0x23')]+_0x1eed23['limit'];var _0x1930ca;if(_0x2a9501>=_0x1aae20){_0x2a9501=_0x1aae20;_0x1930ca=0xc8;}else{_0x1930ca=0xce;}_0x42005e['status'](_0x1930ca);return _0x42005e['set'](_0x8795('0x27'),_0x4a65f0+'-'+_0x2a9501+'/'+_0x1aae20)['json'](_0x498eea);}return null;};}function patchUpdates(_0x396f97){return function(_0x237091){try{jsonpatch['apply'](_0x237091,_0x396f97,!![]);}catch(_0x2d5097){return BPromise[_0x8795('0x28')](_0x2d5097);}return _0x237091[_0x8795('0x29')]();};}function saveUpdates(_0x1aa57a,_0x170e1b){return function(_0x3db752){if(_0x3db752){return _0x3db752['update'](_0x1aa57a)['then'](function(_0x163707){return _0x163707;});}return null;};}function removeEntity(_0x4ff62c,_0x3ed14c){return function(_0x389c38){if(_0x389c38){return _0x389c38[_0x8795('0x2a')]()[_0x8795('0x2b')](function(){_0x4ff62c[_0x8795('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8dc441,_0xdef175){return function(_0x5e06c5){if(!_0x5e06c5){_0x8dc441[_0x8795('0x20')](0x194);}return _0x5e06c5;};}function handleError(_0x1baa26,_0x3ce361){_0x3ce361=_0x3ce361||0x1f4;return function(_0x28770c){logger[_0x8795('0x2c')](_0x28770c[_0x8795('0x2d')]);if(_0x28770c[_0x8795('0x2e')]){delete _0x28770c[_0x8795('0x2e')];}_0x1baa26[_0x8795('0x21')](_0x3ce361)[_0x8795('0x2f')](_0x28770c);};}exports[_0x8795('0x30')]=function(_0x4d5707,_0x3fd6e3){var _0xa5c815={'raw':![],'where':{'id':_0x4d5707[_0x8795('0x31')]['id']}},_0x3aab08={};_0x3aab08['model']=_[_0x8795('0x32')](db[_0x8795('0x33')][_0x8795('0x34')]);_0x3aab08[_0x8795('0x35')]=_[_0x8795('0x32')](_0x4d5707[_0x8795('0x35')]);_0x3aab08[_0x8795('0x36')]=_[_0x8795('0x37')](_0x3aab08['model'],_0x3aab08['query']);_0xa5c815[_0x8795('0x38')]=_[_0x8795('0x37')](_0x3aab08[_0x8795('0x39')],qs[_0x8795('0x3a')](_0x4d5707['query'][_0x8795('0x3a')]));_0xa5c815[_0x8795('0x38')]=_0xa5c815[_0x8795('0x38')][_0x8795('0x3b')]?_0xa5c815[_0x8795('0x38')]:_0x3aab08[_0x8795('0x39')];if(_0x4d5707[_0x8795('0x35')][_0x8795('0x3c')]){_0xa5c815[_0x8795('0x3d')]=[{'all':!![]}];}_0xa5c815=_[_0x8795('0x3e')]({},_0xa5c815,_0x4d5707[_0x8795('0x3f')]);return db[_0x8795('0x33')][_0x8795('0x40')](_0xa5c815)[_0x8795('0x2b')](handleEntityNotFound(_0x3fd6e3,null))[_0x8795('0x2b')](respondWithResult(_0x3fd6e3,null))[_0x8795('0x41')](handleError(_0x3fd6e3,null));};exports[_0x8795('0x2a')]=function(_0x3886f2,_0x394e29){return db[_0x8795('0x33')][_0x8795('0x40')]({'where':{'id':_0x3886f2[_0x8795('0x31')]['id']}})[_0x8795('0x2b')](handleEntityNotFound(_0x394e29,null))[_0x8795('0x2b')](removeEntity(_0x394e29,null))[_0x8795('0x41')](handleError(_0x394e29,null));};function widgetAttributes(_0x16ea8f){try{switch(_0x16ea8f['type']){case'iframe':return[{'name':_0x8795('0x42'),'value':_0x16ea8f[_0x8795('0x42')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||'https://'}];case _0x8795('0x45'):return[{'name':_0x8795('0x46'),'value':_0x16ea8f['attrPath']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x16ea8f['attrHourFormat']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||_0x8795('0x47')},{'name':_0x8795('0x48'),'value':_0x16ea8f[_0x8795('0x48')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||_0x8795('0x49')},{'name':'attrFontSize','value':_0x16ea8f['attrFontSize']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x2]?_0x16ea8f[_0x8795('0x43')][0x2][_0x8795('0x44')]:undefined)||0xc}];case _0x8795('0x4a'):return[{'name':_0x8795('0x4b'),'value':_0x16ea8f[_0x8795('0x4b')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0][_0x8795('0x44')]:undefined)||'total'},{'name':_0x8795('0x4c'),'value':_0x16ea8f[_0x8795('0x4c')]||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||[]},{'name':_0x8795('0x4d'),'value':_0x16ea8f[_0x8795('0x4d')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x2]?_0x16ea8f['attrs'][0x2][_0x8795('0x44')]:undefined)||0x14},{'name':_0x8795('0x4e'),'value':_0x16ea8f['attrChannel']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x3]?_0x16ea8f[_0x8795('0x43')][0x3][_0x8795('0x44')]:undefined)||_0x8795('0x4f')},{'name':'attrEmailAccounts','value':_0x16ea8f[_0x8795('0x50')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x4]?_0x16ea8f[_0x8795('0x43')][0x4][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x51'),'value':_0x16ea8f[_0x8795('0x51')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x5]?_0x16ea8f['attrs'][0x5][_0x8795('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x16ea8f[_0x8795('0x52')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x6]?_0x16ea8f[_0x8795('0x43')][0x6][_0x8795('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x16ea8f['attrOpenchannelAccounts']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x7]?_0x16ea8f[_0x8795('0x43')][0x7][_0x8795('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x16ea8f[_0x8795('0x53')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x8]?_0x16ea8f[_0x8795('0x43')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x16ea8f[_0x8795('0x54')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x9]?_0x16ea8f['attrs'][0x9]['value']:undefined)||''}];case _0x8795('0x55'):case _0x8795('0x56'):return[{'name':_0x8795('0x57'),'value':_0x16ea8f['attrSerie1']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||_0x8795('0x58')},{'name':_0x8795('0x59'),'value':_0x16ea8f[_0x8795('0x59')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x1]?_0x16ea8f[_0x8795('0x43')][0x1]['value']:undefined)||null},{'name':_0x8795('0x5a'),'value':_0x16ea8f[_0x8795('0x5a')]||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x2]?_0x16ea8f[_0x8795('0x43')][0x2][_0x8795('0x44')]:undefined)||null},{'name':_0x8795('0x4c'),'value':_0x16ea8f['attrVoiceQueues']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x3]?_0x16ea8f[_0x8795('0x43')][0x3][_0x8795('0x44')]:undefined)||[]},{'name':_0x8795('0x4e'),'value':_0x16ea8f['attrChannel']||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x4]?_0x16ea8f[_0x8795('0x43')][0x4][_0x8795('0x44')]:undefined)||'voice'},{'name':_0x8795('0x50'),'value':_0x16ea8f[_0x8795('0x50')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x5]?_0x16ea8f[_0x8795('0x43')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x16ea8f['attrFaxAccounts']||(_0x16ea8f['attrs']&&_0x16ea8f[_0x8795('0x43')][0x6]?_0x16ea8f[_0x8795('0x43')][0x6][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x52'),'value':_0x16ea8f['attrSmsAccounts']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x7]?_0x16ea8f[_0x8795('0x43')][0x7][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x5b'),'value':_0x16ea8f[_0x8795('0x5b')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x8]?_0x16ea8f[_0x8795('0x43')][0x8][_0x8795('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x16ea8f[_0x8795('0x53')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x9]?_0x16ea8f[_0x8795('0x43')][0x9][_0x8795('0x44')]:undefined)||''},{'name':_0x8795('0x54'),'value':_0x16ea8f[_0x8795('0x54')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0xa]?_0x16ea8f[_0x8795('0x43')][0xa][_0x8795('0x44')]:undefined)||''}];case _0x8795('0x5c'):return[{'name':_0x8795('0x5d'),'type':_0x16ea8f['reportType']||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f[_0x8795('0x43')][0x0]?_0x16ea8f['attrs'][0x0]['type']:undefined)||null,'value':_0x16ea8f[_0x8795('0x5d')]||(_0x16ea8f[_0x8795('0x43')]&&_0x16ea8f['attrs'][0x0]?_0x16ea8f[_0x8795('0x43')][0x0][_0x8795('0x44')]:undefined)||null},{'name':_0x8795('0x5e'),'value':_0x16ea8f[_0x8795('0x5e')]||(_0x16ea8f['attrs']&&_0x16ea8f['attrs'][0x1]?_0x16ea8f[_0x8795('0x43')][0x1][_0x8795('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x1219f6){logger['error'](_0x8795('0x5f'),JSON[_0x8795('0x60')](_0x1219f6));return[];}}exports[_0x8795('0x61')]=function(_0x1be553,_0x296a54){if(_0x1be553['body']){_0x1be553[_0x8795('0x62')][_0x8795('0x43')]=widgetAttributes(_0x1be553[_0x8795('0x62')]);}return db[_0x8795('0x33')][_0x8795('0x61')](_0x1be553['body'],{})[_0x8795('0x2b')](respondWithResult(_0x296a54,0xc9))['catch'](handleError(_0x296a54,null));};exports['update']=function(_0xcfdb92,_0x233927){if(_0xcfdb92[_0x8795('0x62')]['id']){delete _0xcfdb92[_0x8795('0x62')]['id'];}_0xcfdb92[_0x8795('0x62')][_0x8795('0x43')]=widgetAttributes(_0xcfdb92[_0x8795('0x62')]);return db[_0x8795('0x33')][_0x8795('0x40')]({'where':{'id':_0xcfdb92[_0x8795('0x31')]['id']}})[_0x8795('0x2b')](handleEntityNotFound(_0x233927,null))['then'](saveUpdates(_0xcfdb92[_0x8795('0x62')],null))[_0x8795('0x2b')](respondWithResult(_0x233927,null))[_0x8795('0x41')](handleError(_0x233927,null));}; \ No newline at end of file +var _0xb2ad=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','redis','./dashboardItem.socket','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring'];(function(_0x4dbdc3,_0x5a525d){var _0x1765ad=function(_0x516849){while(--_0x516849){_0x4dbdc3['push'](_0x4dbdc3['shift']());}};_0x1765ad(++_0x5a525d);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x428a0e,_0x4cfa8e){_0x428a0e=_0x428a0e-0x0;var _0x5e180b=_0xb2ad[_0x428a0e];return _0x5e180b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb2a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb2a('0x1'));var rp=require(_0xdb2a('0x2'));var moment=require(_0xdb2a('0x3'));var BPromise=require(_0xdb2a('0x4'));var Mustache=require(_0xdb2a('0x5'));var util=require('util');var path=require(_0xdb2a('0x6'));var sox=require(_0xdb2a('0x7'));var csv=require(_0xdb2a('0x8'));var ejs=require(_0xdb2a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb2a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb2a('0xb'));var jsforce=require(_0xdb2a('0xc'));var deskjs=require(_0xdb2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdb2a('0xe'));var Papa=require(_0xdb2a('0xf'));var Redis=require('ioredis');var authService=require(_0xdb2a('0x10'));var qs=require(_0xdb2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2a('0x12'))(_0xdb2a('0x13'));var utils=require(_0xdb2a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdb2a('0x15'));var db=require(_0xdb2a('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xdb2a('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb2a('0x18')]));require(_0xdb2a('0x19'))['register'](socket);function respondWithStatusCode(_0x33045a,_0x52ffb0){_0x52ffb0=_0x52ffb0||0xcc;return function(_0x542503){if(_0x542503){return _0x33045a['sendStatus'](_0x52ffb0);}return _0x33045a['status'](_0x52ffb0)[_0xdb2a('0x1a')]();};}function respondWithResult(_0x2df1fd,_0x48712c){_0x48712c=_0x48712c||0xc8;return function(_0x48e2e3){if(_0x48e2e3){return _0x2df1fd[_0xdb2a('0x1b')](_0x48712c)[_0xdb2a('0x1c')](_0x48e2e3);}};}function respondWithFilteredResult(_0x440dab,_0x1bdd2f){return function(_0x52508d){if(_0x52508d){var _0x2bc67d=typeof _0x1bdd2f[_0xdb2a('0x1d')]===_0xdb2a('0x1e')&&typeof _0x1bdd2f['limit']==='undefined';var _0x424583=_0x52508d[_0xdb2a('0x1f')];var _0x125233=_0x2bc67d?0x0:_0x1bdd2f[_0xdb2a('0x1d')];var _0x2b64e4=_0x2bc67d?_0x52508d['count']:_0x1bdd2f[_0xdb2a('0x1d')]+_0x1bdd2f['limit'];var _0x444fcf;if(_0x2b64e4>=_0x424583){_0x2b64e4=_0x424583;_0x444fcf=0xc8;}else{_0x444fcf=0xce;}_0x440dab['status'](_0x444fcf);return _0x440dab['set'](_0xdb2a('0x20'),_0x125233+'-'+_0x2b64e4+'/'+_0x424583)[_0xdb2a('0x1c')](_0x52508d);}return null;};}function patchUpdates(_0x46910c){return function(_0x557e76){try{jsonpatch[_0xdb2a('0x21')](_0x557e76,_0x46910c,!![]);}catch(_0x871b44){return BPromise[_0xdb2a('0x22')](_0x871b44);}return _0x557e76[_0xdb2a('0x23')]();};}function saveUpdates(_0x1f3d54,_0x412556){return function(_0x4b2205){if(_0x4b2205){return _0x4b2205[_0xdb2a('0x24')](_0x1f3d54)[_0xdb2a('0x25')](function(_0x5f00fb){return _0x5f00fb;});}return null;};}function removeEntity(_0x332911,_0x3645e9){return function(_0x3b05b2){if(_0x3b05b2){return _0x3b05b2[_0xdb2a('0x26')]()['then'](function(){_0x332911[_0xdb2a('0x1b')](0xcc)[_0xdb2a('0x1a')]();});}};}function handleEntityNotFound(_0x3439c1,_0x1cab2b){return function(_0x4ed637){if(!_0x4ed637){_0x3439c1[_0xdb2a('0x27')](0x194);}return _0x4ed637;};}function handleError(_0x46a80a,_0x4262cf){_0x4262cf=_0x4262cf||0x1f4;return function(_0x2b1c6d){logger[_0xdb2a('0x28')](_0x2b1c6d['stack']);if(_0x2b1c6d[_0xdb2a('0x29')]){delete _0x2b1c6d[_0xdb2a('0x29')];}_0x46a80a[_0xdb2a('0x1b')](_0x4262cf)[_0xdb2a('0x2a')](_0x2b1c6d);};}exports[_0xdb2a('0x2b')]=function(_0xd3a8a3,_0x134053){var _0x2b01e5={'raw':![],'where':{'id':_0xd3a8a3[_0xdb2a('0x2c')]['id']}},_0x3c55cc={};_0x3c55cc[_0xdb2a('0x2d')]=_[_0xdb2a('0x2e')](db[_0xdb2a('0x2f')][_0xdb2a('0x30')]);_0x3c55cc[_0xdb2a('0x31')]=_[_0xdb2a('0x2e')](_0xd3a8a3[_0xdb2a('0x31')]);_0x3c55cc[_0xdb2a('0x32')]=_[_0xdb2a('0x33')](_0x3c55cc[_0xdb2a('0x2d')],_0x3c55cc['query']);_0x2b01e5[_0xdb2a('0x34')]=_[_0xdb2a('0x33')](_0x3c55cc[_0xdb2a('0x2d')],qs['fields'](_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x35')]));_0x2b01e5[_0xdb2a('0x34')]=_0x2b01e5[_0xdb2a('0x34')][_0xdb2a('0x36')]?_0x2b01e5[_0xdb2a('0x34')]:_0x3c55cc[_0xdb2a('0x2d')];if(_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x37')]){_0x2b01e5[_0xdb2a('0x38')]=[{'all':!![]}];}_0x2b01e5=_[_0xdb2a('0x39')]({},_0x2b01e5,_0xd3a8a3[_0xdb2a('0x3a')]);return db[_0xdb2a('0x2f')][_0xdb2a('0x3b')](_0x2b01e5)[_0xdb2a('0x25')](handleEntityNotFound(_0x134053,null))['then'](respondWithResult(_0x134053,null))[_0xdb2a('0x3c')](handleError(_0x134053,null));};exports['destroy']=function(_0x52f058,_0x250fb8){return db[_0xdb2a('0x2f')][_0xdb2a('0x3b')]({'where':{'id':_0x52f058[_0xdb2a('0x2c')]['id']}})[_0xdb2a('0x25')](handleEntityNotFound(_0x250fb8,null))['then'](removeEntity(_0x250fb8,null))['catch'](handleError(_0x250fb8,null));};function widgetAttributes(_0x472170){try{switch(_0x472170['type']){case'iframe':return[{'name':_0xdb2a('0x3d'),'value':_0x472170[_0xdb2a('0x3d')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x0]?_0x472170[_0xdb2a('0x3e')][0x0][_0xdb2a('0x3f')]:undefined)||_0xdb2a('0x40')}];case'custom':return[{'name':_0xdb2a('0x41'),'value':_0x472170[_0xdb2a('0x41')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170[_0xdb2a('0x3e')][0x0][_0xdb2a('0x3f')]:undefined)||''}];case _0xdb2a('0x42'):return[{'name':'attrHourFormat','value':_0x472170[_0xdb2a('0x43')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170[_0xdb2a('0x3e')][0x0]['value']:undefined)||_0xdb2a('0x44')},{'name':_0xdb2a('0x45'),'value':_0x472170['attrTimezone']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x1]?_0x472170[_0xdb2a('0x3e')][0x1][_0xdb2a('0x3f')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x472170['attrFontSize']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x2]?_0x472170[_0xdb2a('0x3e')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x472170[_0xdb2a('0x46')]||(_0x472170['attrs']&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170[_0xdb2a('0x3e')][0x0][_0xdb2a('0x3f')]:undefined)||_0xdb2a('0x47')},{'name':'attrVoiceQueues','value':_0x472170[_0xdb2a('0x48')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x1]?_0x472170['attrs'][0x1][_0xdb2a('0x3f')]:undefined)||[]},{'name':_0xdb2a('0x49'),'value':_0x472170[_0xdb2a('0x49')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x2]?_0x472170[_0xdb2a('0x3e')][0x2]['value']:undefined)||0x14},{'name':_0xdb2a('0x4a'),'value':_0x472170['attrChannel']||(_0x472170['attrs']&&_0x472170[_0xdb2a('0x3e')][0x3]?_0x472170[_0xdb2a('0x3e')][0x3][_0xdb2a('0x3f')]:undefined)||_0xdb2a('0x4b')},{'name':_0xdb2a('0x4c'),'value':_0x472170[_0xdb2a('0x4c')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x4]?_0x472170[_0xdb2a('0x3e')][0x4][_0xdb2a('0x3f')]:undefined)||''},{'name':_0xdb2a('0x4d'),'value':_0x472170[_0xdb2a('0x4d')]||(_0x472170['attrs']&&_0x472170[_0xdb2a('0x3e')][0x5]?_0x472170[_0xdb2a('0x3e')][0x5]['value']:undefined)||''},{'name':_0xdb2a('0x4e'),'value':_0x472170[_0xdb2a('0x4e')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x6]?_0x472170['attrs'][0x6]['value']:undefined)||''},{'name':_0xdb2a('0x4f'),'value':_0x472170['attrOpenchannelAccounts']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x7]?_0x472170[_0xdb2a('0x3e')][0x7][_0xdb2a('0x3f')]:undefined)||''},{'name':_0xdb2a('0x50'),'value':_0x472170['attrWhatsappAccounts']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x8]?_0x472170[_0xdb2a('0x3e')][0x8]['value']:undefined)||''},{'name':_0xdb2a('0x51'),'value':_0x472170['attrChatWebsites']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x9]?_0x472170['attrs'][0x9][_0xdb2a('0x3f')]:undefined)||''}];case _0xdb2a('0x52'):case _0xdb2a('0x53'):return[{'name':_0xdb2a('0x54'),'value':_0x472170['attrSerie1']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170[_0xdb2a('0x3e')][0x0][_0xdb2a('0x3f')]:undefined)||_0xdb2a('0x47')},{'name':_0xdb2a('0x55'),'value':_0x472170[_0xdb2a('0x55')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x1]?_0x472170['attrs'][0x1][_0xdb2a('0x3f')]:undefined)||null},{'name':_0xdb2a('0x56'),'value':_0x472170[_0xdb2a('0x56')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x2]?_0x472170[_0xdb2a('0x3e')][0x2][_0xdb2a('0x3f')]:undefined)||null},{'name':_0xdb2a('0x48'),'value':_0x472170[_0xdb2a('0x48')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x3]?_0x472170[_0xdb2a('0x3e')][0x3][_0xdb2a('0x3f')]:undefined)||[]},{'name':_0xdb2a('0x4a'),'value':_0x472170['attrChannel']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x4]?_0x472170[_0xdb2a('0x3e')][0x4][_0xdb2a('0x3f')]:undefined)||'voice'},{'name':_0xdb2a('0x4c'),'value':_0x472170[_0xdb2a('0x4c')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x5]?_0x472170[_0xdb2a('0x3e')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x472170['attrFaxAccounts']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x6]?_0x472170[_0xdb2a('0x3e')][0x6][_0xdb2a('0x3f')]:undefined)||''},{'name':_0xdb2a('0x4e'),'value':_0x472170[_0xdb2a('0x4e')]||(_0x472170['attrs']&&_0x472170['attrs'][0x7]?_0x472170['attrs'][0x7][_0xdb2a('0x3f')]:undefined)||''},{'name':_0xdb2a('0x4f'),'value':_0x472170['attrOpenchannelAccounts']||(_0x472170[_0xdb2a('0x3e')]&&_0x472170['attrs'][0x8]?_0x472170['attrs'][0x8][_0xdb2a('0x3f')]:undefined)||''},{'name':_0xdb2a('0x50'),'value':_0x472170[_0xdb2a('0x50')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x9]?_0x472170['attrs'][0x9]['value']:undefined)||''},{'name':_0xdb2a('0x51'),'value':_0x472170[_0xdb2a('0x51')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0xa]?_0x472170[_0xdb2a('0x3e')][0xa][_0xdb2a('0x3f')]:undefined)||''}];case _0xdb2a('0x57'):return[{'name':_0xdb2a('0x58'),'type':_0x472170[_0xdb2a('0x59')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170['attrs'][0x0]['type']:undefined)||null,'value':_0x472170[_0xdb2a('0x58')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x0]?_0x472170[_0xdb2a('0x3e')][0x0][_0xdb2a('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x472170[_0xdb2a('0x5a')]||(_0x472170[_0xdb2a('0x3e')]&&_0x472170[_0xdb2a('0x3e')][0x1]?_0x472170[_0xdb2a('0x3e')][0x1][_0xdb2a('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x2930c3){logger[_0xdb2a('0x28')](_0xdb2a('0x5b'),JSON[_0xdb2a('0x5c')](_0x2930c3));return[];}}exports[_0xdb2a('0x5d')]=function(_0x2d7448,_0x43825a){if(_0x2d7448[_0xdb2a('0x5e')]){_0x2d7448[_0xdb2a('0x5e')][_0xdb2a('0x3e')]=widgetAttributes(_0x2d7448[_0xdb2a('0x5e')]);}return db[_0xdb2a('0x2f')][_0xdb2a('0x5d')](_0x2d7448[_0xdb2a('0x5e')],{})[_0xdb2a('0x25')](respondWithResult(_0x43825a,0xc9))[_0xdb2a('0x3c')](handleError(_0x43825a,null));};exports[_0xdb2a('0x24')]=function(_0x2808a6,_0x376e80){if(_0x2808a6[_0xdb2a('0x5e')]['id']){delete _0x2808a6[_0xdb2a('0x5e')]['id'];}_0x2808a6[_0xdb2a('0x5e')][_0xdb2a('0x3e')]=widgetAttributes(_0x2808a6['body']);return db[_0xdb2a('0x2f')][_0xdb2a('0x3b')]({'where':{'id':_0x2808a6[_0xdb2a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x376e80,null))[_0xdb2a('0x25')](saveUpdates(_0x2808a6[_0xdb2a('0x5e')],null))[_0xdb2a('0x25')](respondWithResult(_0x376e80,null))[_0xdb2a('0x3c')](handleError(_0x376e80,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 92b384f..62bd911 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 _0x0ee6=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0x0ee6,0x106));var _0x60ee=function(_0x1054b8,_0x1d23aa){_0x1054b8=_0x1054b8-0x0;var _0x5ab226=_0x0ee6[_0x1054b8];return _0x5ab226;};'use strict';var EventEmitter=require(_0x60ee('0x0'));var DashboardItem=require(_0x60ee('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x60ee('0x2')](0x0);var events={'afterCreate':_0x60ee('0x3'),'afterUpdate':_0x60ee('0x4'),'afterDestroy':_0x60ee('0x5')};function emitEvent(_0x5d0b30){return function(_0x36fb3f,_0x1bb6dd,_0x326bc8){DashboardItemEvents[_0x60ee('0x6')](_0x5d0b30+':'+_0x36fb3f['id'],_0x36fb3f);DashboardItemEvents[_0x60ee('0x6')](_0x5d0b30,_0x36fb3f);_0x326bc8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x60ee('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x5777=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','DashboardItem'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5777,0xb2));var _0x7577=function(_0x25feba,_0xff2e40){_0x25feba=_0x25feba-0x0;var _0x48a7ab=_0x5777[_0x25feba];return _0x48a7ab;};'use strict';var EventEmitter=require(_0x7577('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x7577('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7577('0x2')](0x0);var events={'afterCreate':_0x7577('0x3'),'afterUpdate':'update','afterDestroy':_0x7577('0x4')};function emitEvent(_0x51bd10){return function(_0x856b2a,_0x3935c1,_0x5d2299){DashboardItemEvents[_0x7577('0x5')](_0x51bd10+':'+_0x856b2a['id'],_0x856b2a);DashboardItemEvents[_0x7577('0x5')](_0x51bd10,_0x856b2a);_0x5d2299(null);};}for(var e in events){if(events[_0x7577('0x6')](e)){var event=events[e];DashboardItem[_0x7577('0x7')](e,emitEvent(event));}}module[_0x7577('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 143d571..d74a686 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 _0xe186=['bluebird','request-promise','path','../../config/environment','exports','dashboard_items','lodash','util','api','moment'];(function(_0x3f8d82,_0x298fa8){var _0x53d50e=function(_0x229ae0){while(--_0x229ae0){_0x3f8d82['push'](_0x3f8d82['shift']());}};_0x53d50e(++_0x298fa8);}(_0xe186,0x146));var _0x6e18=function(_0x4a149d,_0xad2501){_0x4a149d=_0x4a149d-0x0;var _0x214224=_0xe186[_0x4a149d];return _0x214224;};'use strict';var _=require(_0x6e18('0x0'));var util=require(_0x6e18('0x1'));var logger=require('../../config/logger')(_0x6e18('0x2'));var moment=require(_0x6e18('0x3'));var BPromise=require(_0x6e18('0x4'));var rp=require(_0x6e18('0x5'));var fs=require('fs');var path=require(_0x6e18('0x6'));var rimraf=require('rimraf');var config=require(_0x6e18('0x7'));var attributes=require('./dashboardItem.attributes');module[_0x6e18('0x8')]=function(_0x1bafb5,_0x1b9e15){return _0x1bafb5['define']('DashboardItem',attributes,{'tableName':_0x6e18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccf3=['lodash','util','bluebird','request-promise','../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items'];(function(_0x40886f,_0x30f5b5){var _0x4173b9=function(_0x1e1b80){while(--_0x1e1b80){_0x40886f['push'](_0x40886f['shift']());}};_0x4173b9(++_0x30f5b5);}(_0xccf3,0x99));var _0x3ccf=function(_0xc8b197,_0x357666){_0xc8b197=_0xc8b197-0x0;var _0x41a289=_0xccf3[_0xc8b197];return _0x41a289;};'use strict';var _=require(_0x3ccf('0x0'));var util=require(_0x3ccf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3ccf('0x2'));var rp=require(_0x3ccf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ccf('0x4'));var attributes=require(_0x3ccf('0x5'));module['exports']=function(_0x26f583,_0x447171){return _0x26f583[_0x3ccf('0x6')](_0x3ccf('0x7'),attributes,{'tableName':_0x3ccf('0x8'),'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 7d330ac..91fe084 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 _0x9cbd=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xbe65a,_0x4bbcbd){var _0x4882f4=function(_0x13f027){while(--_0x13f027){_0xbe65a['push'](_0xbe65a['shift']());}};_0x4882f4(++_0x4bbcbd);}(_0x9cbd,0x1cf));var _0xd9cb=function(_0x269acd,_0x2f591c){_0x269acd=_0x269acd-0x0;var _0x1b08f3=_0x9cbd[_0x269acd];return _0x1b08f3;};'use strict';var _=require('lodash');var util=require(_0xd9cb('0x0'));var moment=require(_0xd9cb('0x1'));var BPromise=require(_0xd9cb('0x2'));var rs=require(_0xd9cb('0x3'));var fs=require('fs');var Redis=require(_0xd9cb('0x4'));var db=require(_0xd9cb('0x5'))['db'];var utils=require(_0xd9cb('0x6'));var logger=require(_0xd9cb('0x7'))('rpc');var config=require(_0xd9cb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9cb('0x9')][_0xd9cb('0xa')]({'port':0x232a});config[_0xd9cb('0xb')]=_[_0xd9cb('0xc')](config[_0xd9cb('0xb')],{'host':_0xd9cb('0xd'),'port':0x18eb});var socket=require(_0xd9cb('0xe'))(new Redis(config[_0xd9cb('0xb')]));require('./dashboardItem.socket')[_0xd9cb('0xf')](socket);function respondWithRpcPromise(_0x29c432,_0x3e6c3b,_0x4db00c){return new BPromise(function(_0x389ae2,_0x2c15e1){return client['request'](_0x29c432,_0x4db00c)[_0xd9cb('0x10')](function(_0x1c3ccc){logger[_0xd9cb('0x11')](_0xd9cb('0x12'),_0x3e6c3b,_0xd9cb('0x13'));logger['debug'](_0xd9cb('0x14'),_0x3e6c3b,'request\x20sent',JSON[_0xd9cb('0x15')](_0x1c3ccc));if(_0x1c3ccc['error']){if(_0x1c3ccc[_0xd9cb('0x16')][_0xd9cb('0x17')]===0x1f4){logger['error'](_0xd9cb('0x12'),_0x3e6c3b,_0x1c3ccc['error'][_0xd9cb('0x18')]);return _0x2c15e1(_0x1c3ccc['error'][_0xd9cb('0x18')]);}logger[_0xd9cb('0x16')](_0xd9cb('0x12'),_0x3e6c3b,_0x1c3ccc[_0xd9cb('0x16')]['message']);return _0x389ae2(_0x1c3ccc[_0xd9cb('0x16')][_0xd9cb('0x18')]);}else{logger['info'](_0xd9cb('0x12'),_0x3e6c3b,_0xd9cb('0x13'));_0x389ae2(_0x1c3ccc[_0xd9cb('0x19')]['message']);}})[_0xd9cb('0x1a')](function(_0x7a4f87){logger['error'](_0xd9cb('0x12'),_0x3e6c3b,_0x7a4f87);_0x2c15e1(_0x7a4f87);});});} \ No newline at end of file +var _0x2516=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x1fb4ff,_0x172d25){var _0x3f2d20=function(_0x358d44){while(--_0x358d44){_0x1fb4ff['push'](_0x1fb4ff['shift']());}};_0x3f2d20(++_0x172d25);}(_0x2516,0x7d));var _0x6251=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x2516[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var moment=require('moment');var BPromise=require(_0x6251('0x2'));var rs=require(_0x6251('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6251('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6251('0x5'))(_0x6251('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6251('0x7')]({'port':0x232a});config['redis']=_[_0x6251('0x8')](config[_0x6251('0x9')],{'host':_0x6251('0xa'),'port':0x18eb});var socket=require(_0x6251('0xb'))(new Redis(config[_0x6251('0x9')]));require(_0x6251('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e8465,_0x20f8c5,_0x14b313){return new BPromise(function(_0x269cc4,_0x1c11d3){return client[_0x6251('0xd')](_0x1e8465,_0x14b313)[_0x6251('0xe')](function(_0x9eb4f){logger[_0x6251('0xf')](_0x6251('0x10'),_0x20f8c5,_0x6251('0x11'));logger[_0x6251('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x20f8c5,'request\x20sent',JSON[_0x6251('0x13')](_0x9eb4f));if(_0x9eb4f[_0x6251('0x14')]){if(_0x9eb4f[_0x6251('0x14')]['code']===0x1f4){logger[_0x6251('0x14')](_0x6251('0x10'),_0x20f8c5,_0x9eb4f['error'][_0x6251('0x15')]);return _0x1c11d3(_0x9eb4f[_0x6251('0x14')][_0x6251('0x15')]);}logger[_0x6251('0x14')](_0x6251('0x10'),_0x20f8c5,_0x9eb4f[_0x6251('0x14')]['message']);return _0x269cc4(_0x9eb4f[_0x6251('0x14')][_0x6251('0x15')]);}else{logger['info'](_0x6251('0x10'),_0x20f8c5,_0x6251('0x11'));_0x269cc4(_0x9eb4f[_0x6251('0x16')][_0x6251('0x15')]);}})['catch'](function(_0x241102){logger['error']('DashboardItem,\x20%s,\x20%s',_0x20f8c5,_0x241102);_0x1c11d3(_0x241102);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 2fb6a08..5f3e9f3 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 _0x798f=['update','emit','removeListener','register','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0xe0b097,_0x192e79){var _0x5d07e4=function(_0x1a5e51){while(--_0x1a5e51){_0xe0b097['push'](_0xe0b097['shift']());}};_0x5d07e4(++_0x192e79);}(_0x798f,0x14d));var _0xf798=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x798f[_0x14add3];return _0x4a174f;};'use strict';var DashboardItemEvents=require(_0xf798('0x0'));var events=[_0xf798('0x1'),_0xf798('0x2'),_0xf798('0x3')];function createListener(_0x4332a5,_0xd15ef9){return function(_0x2c3f76){_0xd15ef9[_0xf798('0x4')](_0x4332a5,_0x2c3f76);};}function removeListener(_0x3ce695,_0x4f1a37){return function(){DashboardItemEvents[_0xf798('0x5')](_0x3ce695,_0x4f1a37);};}exports[_0xf798('0x6')]=function(_0x446d3e){for(var _0x32b870=0x0,_0x227eb7=events['length'];_0x32b870<_0x227eb7;_0x32b870++){var _0x555546=events[_0x32b870];var _0x59c42d=createListener(_0xf798('0x7')+_0x555546,_0x446d3e);DashboardItemEvents['on'](_0x555546,_0x59c42d);}}; \ No newline at end of file +var _0x9a96=['dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener','length'];(function(_0x14675b,_0x21a339){var _0x49575a=function(_0x45ec1){while(--_0x45ec1){_0x14675b['push'](_0x14675b['shift']());}};_0x49575a(++_0x21a339);}(_0x9a96,0x120));var _0x69a9=function(_0x727ef1,_0x405280){_0x727ef1=_0x727ef1-0x0;var _0x2d778b=_0x9a96[_0x727ef1];return _0x2d778b;};'use strict';var DashboardItemEvents=require(_0x69a9('0x0'));var events=[_0x69a9('0x1'),_0x69a9('0x2'),'update'];function createListener(_0x33eda0,_0x5e36f4){return function(_0x17896c){_0x5e36f4[_0x69a9('0x3')](_0x33eda0,_0x17896c);};}function removeListener(_0x33b09d,_0x534f8a){return function(){DashboardItemEvents[_0x69a9('0x4')](_0x33b09d,_0x534f8a);};}exports['register']=function(_0x21dfac){for(var _0x28a9f1=0x0,_0xfc56f5=events[_0x69a9('0x5')];_0x28a9f1<_0xfc56f5;_0x28a9f1++){var _0x2d8961=events[_0x28a9f1];var _0x20120d=createListener(_0x69a9('0x6')+_0x2d8961,_0x21dfac);DashboardItemEvents['on'](_0x2d8961,_0x20120d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index d3fdd0e..df3657e 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 _0x91b1=['./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5b1259,_0x34d729){var _0x454ab4=function(_0x3d4351){while(--_0x3d4351){_0x5b1259['push'](_0x5b1259['shift']());}};_0x454ab4(++_0x34d729);}(_0x91b1,0x9a));var _0x191b=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x91b1[_0x3c22e0];return _0x215811;};'use strict';var multer=require(_0x191b('0x0'));var util=require(_0x191b('0x1'));var path=require(_0x191b('0x2'));var timeout=require(_0x191b('0x3'));var express=require(_0x191b('0x4'));var router=express['Router']();var fs_extra=require(_0x191b('0x5'));var auth=require(_0x191b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x191b('0x7'));var controller=require(_0x191b('0x8'));router[_0x191b('0x9')](_0x191b('0xa'),auth[_0x191b('0xb')](),controller[_0x191b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x191b('0xd')]);router[_0x191b('0xe')](_0x191b('0xa'),auth[_0x191b('0xb')](),controller[_0x191b('0xf')]);router[_0x191b('0x10')](_0x191b('0xa'),auth[_0x191b('0xb')](),controller[_0x191b('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfbfd=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','/:id','isAuthenticated','post','create','update','delete','destroy'];(function(_0x4b7ed3,_0x3573fa){var _0x3888fd=function(_0x383090){while(--_0x383090){_0x4b7ed3['push'](_0x4b7ed3['shift']());}};_0x3888fd(++_0x3573fa);}(_0xfbfd,0x168));var _0xdfbf=function(_0x560a09,_0x1a17b1){_0x560a09=_0x560a09-0x0;var _0x3b3232=_0xfbfd[_0x560a09];return _0x3b3232;};'use strict';var multer=require(_0xdfbf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdfbf('0x1'));var express=require(_0xdfbf('0x2'));var router=express[_0xdfbf('0x3')]();var fs_extra=require(_0xdfbf('0x4'));var auth=require(_0xdfbf('0x5'));var interaction=require(_0xdfbf('0x6'));var config=require('../../config/environment');var controller=require(_0xdfbf('0x7'));router['get'](_0xdfbf('0x8'),auth[_0xdfbf('0x9')](),controller['show']);router[_0xdfbf('0xa')]('/',auth['isAuthenticated'](),controller[_0xdfbf('0xb')]);router['put'](_0xdfbf('0x8'),auth[_0xdfbf('0x9')](),controller[_0xdfbf('0xc')]);router[_0xdfbf('0xd')](_0xdfbf('0x8'),auth[_0xdfbf('0x9')](),controller[_0xdfbf('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 0644598..22fb3e2 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 _0x4152=['second','first','STRING','ENUM'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0x4152,0xc2));var _0x2415=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x4152[_0x29d6e6];return _0xc75ff0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2415('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x2415('0x1')]('first',_0x2415('0x2'),'third'),'allowNull':![],'defaultValue':_0x2415('0x3')},'description':{'type':Sequelize[_0x2415('0x0')]}}; \ No newline at end of file +var _0x9b8f=['first','third','STRING','ENUM'];(function(_0x215366,_0x4919de){var _0xc78c39=function(_0x4b2678){while(--_0x4b2678){_0x215366['push'](_0x215366['shift']());}};_0xc78c39(++_0x4919de);}(_0x9b8f,0x14e));var _0xf9b8=function(_0x9c08b6,_0x1ca0f2){_0x9c08b6=_0x9c08b6-0x0;var _0x27d93e=_0x9b8f[_0x9c08b6];return _0x27d93e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf9b8('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xf9b8('0x1')](_0xf9b8('0x2'),'second',_0xf9b8('0x3')),'allowNull':![],'defaultValue':_0xf9b8('0x2')},'description':{'type':Sequelize[_0xf9b8('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ddd88ae..48e6fdd 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 _0x4e0a=['count','limit','set','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','Disposition','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined'];(function(_0x17ca37,_0x166d72){var _0x108251=function(_0x2ef26f){while(--_0x2ef26f){_0x17ca37['push'](_0x17ca37['shift']());}};_0x108251(++_0x166d72);}(_0x4e0a,0x1d5));var _0xa4e0=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0x4e0a[_0x3b3750];return _0x1b9e8b;};'use strict';var emlformat=require(_0xa4e0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4e0('0x1'));var jsonpatch=require(_0xa4e0('0x2'));var rp=require('request-promise');var moment=require(_0xa4e0('0x3'));var BPromise=require(_0xa4e0('0x4'));var Mustache=require(_0xa4e0('0x5'));var util=require(_0xa4e0('0x6'));var path=require(_0xa4e0('0x7'));var sox=require(_0xa4e0('0x8'));var csv=require(_0xa4e0('0x9'));var ejs=require(_0xa4e0('0xa'));var fs=require('fs');var fs_extra=require(_0xa4e0('0xb'));var _=require(_0xa4e0('0xc'));var squel=require('squel');var crypto=require(_0xa4e0('0xd'));var jsforce=require(_0xa4e0('0xe'));var deskjs=require(_0xa4e0('0xf'));var toCsv=require(_0xa4e0('0x9'));var querystring=require(_0xa4e0('0x10'));var Papa=require(_0xa4e0('0x11'));var Redis=require(_0xa4e0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4e0('0x13'));var logger=require(_0xa4e0('0x14'))(_0xa4e0('0x15'));var utils=require('../../config/utils');var config=require(_0xa4e0('0x16'));var licenseUtil=require(_0xa4e0('0x17'));var db=require(_0xa4e0('0x18'))['db'];function respondWithStatusCode(_0x27a67b,_0x53d161){_0x53d161=_0x53d161||0xcc;return function(_0x12d6a3){if(_0x12d6a3){return _0x27a67b['sendStatus'](_0x53d161);}return _0x27a67b[_0xa4e0('0x19')](_0x53d161)['end']();};}function respondWithResult(_0xb28909,_0x33eaf2){_0x33eaf2=_0x33eaf2||0xc8;return function(_0x479626){if(_0x479626){return _0xb28909[_0xa4e0('0x19')](_0x33eaf2)[_0xa4e0('0x1a')](_0x479626);}};}function respondWithFilteredResult(_0x41063e,_0x49dff5){return function(_0x45eb0b){if(_0x45eb0b){var _0x1ac342=typeof _0x49dff5[_0xa4e0('0x1b')]===_0xa4e0('0x1c')&&typeof _0x49dff5['limit']===_0xa4e0('0x1c');var _0x3fe829=_0x45eb0b[_0xa4e0('0x1d')];var _0x322849=_0x1ac342?0x0:_0x49dff5[_0xa4e0('0x1b')];var _0x2a7833=_0x1ac342?_0x45eb0b[_0xa4e0('0x1d')]:_0x49dff5['offset']+_0x49dff5[_0xa4e0('0x1e')];var _0x226556;if(_0x2a7833>=_0x3fe829){_0x2a7833=_0x3fe829;_0x226556=0xc8;}else{_0x226556=0xce;}_0x41063e['status'](_0x226556);return _0x41063e[_0xa4e0('0x1f')]('Content-Range',_0x322849+'-'+_0x2a7833+'/'+_0x3fe829)[_0xa4e0('0x1a')](_0x45eb0b);}return null;};}function patchUpdates(_0x502d55){return function(_0x2877a7){try{jsonpatch[_0xa4e0('0x20')](_0x2877a7,_0x502d55,!![]);}catch(_0x22a6d6){return BPromise[_0xa4e0('0x21')](_0x22a6d6);}return _0x2877a7[_0xa4e0('0x22')]();};}function saveUpdates(_0x4f643f,_0x16afba){return function(_0x403a81){if(_0x403a81){return _0x403a81[_0xa4e0('0x23')](_0x4f643f)[_0xa4e0('0x24')](function(_0x3d94d5){return _0x3d94d5;});}return null;};}function removeEntity(_0x5cce83,_0x44f31e){return function(_0x32b9fa){if(_0x32b9fa){return _0x32b9fa[_0xa4e0('0x25')]()['then'](function(){var _0x1af0ce=_0x32b9fa[_0xa4e0('0x26')]({'plain':!![]});var _0x5140f4=_0xa4e0('0x27');return db[_0xa4e0('0x28')][_0xa4e0('0x25')]({'where':{'type':_0x5140f4,'resourceId':_0x1af0ce['id']}})[_0xa4e0('0x24')](function(){return _0x32b9fa;});})[_0xa4e0('0x24')](function(){_0x5cce83[_0xa4e0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c2ed7,_0x47b1fa){return function(_0x51a19a){if(!_0x51a19a){_0x6c2ed7[_0xa4e0('0x29')](0x194);}return _0x51a19a;};}function handleError(_0x330801,_0x5631bf){_0x5631bf=_0x5631bf||0x1f4;return function(_0x385ad8){logger[_0xa4e0('0x2a')](_0x385ad8['stack']);if(_0x385ad8[_0xa4e0('0x2b')]){delete _0x385ad8['name'];}_0x330801[_0xa4e0('0x19')](_0x5631bf)[_0xa4e0('0x2c')](_0x385ad8);};}exports[_0xa4e0('0x2d')]=function(_0xbde07b,_0x7f5707){var _0x2562ba={},_0x3bfb11={},_0x4093d9={'count':0x0,'rows':[]};var _0x56779b=_['map'](db[_0xa4e0('0x2e')]['rawAttributes'],function(_0x4509b7){return{'name':_0x4509b7[_0xa4e0('0x2f')],'type':_0x4509b7[_0xa4e0('0x30')][_0xa4e0('0x31')]};});_0x3bfb11[_0xa4e0('0x32')]=_[_0xa4e0('0x33')](_0x56779b,_0xa4e0('0x2b'));_0x3bfb11[_0xa4e0('0x34')]=_['keys'](_0xbde07b[_0xa4e0('0x34')]);_0x3bfb11[_0xa4e0('0x35')]=_['intersection'](_0x3bfb11[_0xa4e0('0x32')],_0x3bfb11[_0xa4e0('0x34')]);_0x2562ba[_0xa4e0('0x36')]=_['intersection'](_0x3bfb11['model'],qs['fields'](_0xbde07b[_0xa4e0('0x34')][_0xa4e0('0x37')]));_0x2562ba[_0xa4e0('0x36')]=_0x2562ba[_0xa4e0('0x36')][_0xa4e0('0x38')]?_0x2562ba[_0xa4e0('0x36')]:_0x3bfb11['model'];if(!_0xbde07b[_0xa4e0('0x34')][_0xa4e0('0x39')](_0xa4e0('0x3a'))){_0x2562ba[_0xa4e0('0x1e')]=qs[_0xa4e0('0x1e')](_0xbde07b[_0xa4e0('0x34')]['limit']);_0x2562ba[_0xa4e0('0x1b')]=qs['offset'](_0xbde07b[_0xa4e0('0x34')]['offset']);}_0x2562ba[_0xa4e0('0x3b')]=qs['sort'](_0xbde07b[_0xa4e0('0x34')]['sort']);_0x2562ba[_0xa4e0('0x3c')]=qs[_0xa4e0('0x35')](_[_0xa4e0('0x3d')](_0xbde07b[_0xa4e0('0x34')],_0x3bfb11[_0xa4e0('0x35')]),_0x56779b);if(_0xbde07b[_0xa4e0('0x34')]['filter']){_0x2562ba[_0xa4e0('0x3c')]=_[_0xa4e0('0x3e')](_0x2562ba[_0xa4e0('0x3c')],{'$or':_[_0xa4e0('0x33')](_0x56779b,function(_0xdb56c4){if(_0xdb56c4['type']!==_0xa4e0('0x3f')){var _0x278de8={};_0x278de8[_0xdb56c4[_0xa4e0('0x2b')]]={'$like':'%'+_0xbde07b[_0xa4e0('0x34')][_0xa4e0('0x40')]+'%'};return _0x278de8;}})});}_0x2562ba=_[_0xa4e0('0x3e')]({},_0x2562ba,_0xbde07b[_0xa4e0('0x41')]);var _0xa5a4ff={'where':_0x2562ba['where']};return db[_0xa4e0('0x2e')][_0xa4e0('0x1d')](_0xa5a4ff)[_0xa4e0('0x24')](function(_0x3b1cec){_0x4093d9[_0xa4e0('0x1d')]=_0x3b1cec;if(_0xbde07b['query'][_0xa4e0('0x42')]){_0x2562ba[_0xa4e0('0x43')]=[{'all':!![]}];}return db[_0xa4e0('0x2e')][_0xa4e0('0x44')](_0x2562ba);})[_0xa4e0('0x24')](function(_0xd73857){_0x4093d9[_0xa4e0('0x45')]=_0xd73857;return _0x4093d9;})[_0xa4e0('0x24')](respondWithFilteredResult(_0x7f5707,_0x2562ba))['catch'](handleError(_0x7f5707,null));};exports[_0xa4e0('0x46')]=function(_0x270f15,_0xc1796e){var _0x4c459a={'raw':!![],'where':{'id':_0x270f15['params']['id']}},_0x253fa5={};_0x253fa5[_0xa4e0('0x32')]=_[_0xa4e0('0x47')](db[_0xa4e0('0x2e')]['rawAttributes']);_0x253fa5[_0xa4e0('0x34')]=_[_0xa4e0('0x47')](_0x270f15[_0xa4e0('0x34')]);_0x253fa5[_0xa4e0('0x35')]=_[_0xa4e0('0x48')](_0x253fa5[_0xa4e0('0x32')],_0x253fa5[_0xa4e0('0x34')]);_0x4c459a[_0xa4e0('0x36')]=_[_0xa4e0('0x48')](_0x253fa5[_0xa4e0('0x32')],qs[_0xa4e0('0x37')](_0x270f15[_0xa4e0('0x34')][_0xa4e0('0x37')]));_0x4c459a[_0xa4e0('0x36')]=_0x4c459a['attributes'][_0xa4e0('0x38')]?_0x4c459a['attributes']:_0x253fa5['model'];if(_0x270f15[_0xa4e0('0x34')]['includeAll']){_0x4c459a[_0xa4e0('0x43')]=[{'all':!![]}];}_0x4c459a=_[_0xa4e0('0x3e')]({},_0x4c459a,_0x270f15[_0xa4e0('0x41')]);return db['Disposition']['find'](_0x4c459a)[_0xa4e0('0x24')](handleEntityNotFound(_0xc1796e,null))[_0xa4e0('0x24')](respondWithResult(_0xc1796e,null))[_0xa4e0('0x49')](handleError(_0xc1796e,null));};exports[_0xa4e0('0x4a')]=function(_0x39a020,_0x32ee47){return db[_0xa4e0('0x2e')][_0xa4e0('0x4a')](_0x39a020[_0xa4e0('0x4b')],{})[_0xa4e0('0x24')](function(_0xd5fac4){var _0x5bb71e=_0x39a020[_0xa4e0('0x4c')][_0xa4e0('0x26')]({'plain':!![]});if(!_0x5bb71e)throw new Error(_0xa4e0('0x4d'));if(_0x5bb71e[_0xa4e0('0x4e')]===_0xa4e0('0x4c')){var _0x23f8f4=_0xd5fac4['get']({'plain':!![]});var _0x7441f4=_0xa4e0('0x27');return db['UserProfileSection'][_0xa4e0('0x4f')]({'where':{'name':_0x7441f4,'userProfileId':_0x5bb71e[_0xa4e0('0x50')]},'raw':!![]})[_0xa4e0('0x24')](function(_0x4c468d){if(_0x4c468d&&_0x4c468d['autoAssociation']===0x0){return db[_0xa4e0('0x28')][_0xa4e0('0x4a')]({'name':_0x23f8f4[_0xa4e0('0x2b')],'resourceId':_0x23f8f4['id'],'type':_0x4c468d['name'],'sectionId':_0x4c468d['id']},{})[_0xa4e0('0x24')](function(){return _0xd5fac4;});}else{return _0xd5fac4;}})[_0xa4e0('0x49')](function(_0x431272){logger[_0xa4e0('0x2a')](_0xa4e0('0x51'),_0x431272);throw _0x431272;});}return _0xd5fac4;})['then'](respondWithResult(_0x32ee47,0xc9))[_0xa4e0('0x49')](handleError(_0x32ee47,null));};exports['update']=function(_0xd173e2,_0x886ef0){if(_0xd173e2[_0xa4e0('0x4b')]['id']){delete _0xd173e2['body']['id'];}return db['Disposition'][_0xa4e0('0x4f')]({'where':{'id':_0xd173e2[_0xa4e0('0x52')]['id']}})[_0xa4e0('0x24')](handleEntityNotFound(_0x886ef0,null))[_0xa4e0('0x24')](saveUpdates(_0xd173e2[_0xa4e0('0x4b')],null))[_0xa4e0('0x24')](respondWithResult(_0x886ef0,null))[_0xa4e0('0x49')](handleError(_0x886ef0,null));};exports[_0xa4e0('0x25')]=function(_0x43a147,_0x3315ae){return db[_0xa4e0('0x2e')][_0xa4e0('0x4f')]({'where':{'id':_0x43a147['params']['id']}})[_0xa4e0('0x24')](handleEntityNotFound(_0x3315ae,null))[_0xa4e0('0x24')](removeEntity(_0x3315ae,null))[_0xa4e0('0x49')](handleError(_0x3315ae,null));}; \ No newline at end of file +var _0xb294=['find','create','body','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','findAll','rows','catch','show','params','includeAll','include'];(function(_0x57f87b,_0x91c818){var _0x13ee7f=function(_0x2a1517){while(--_0x2a1517){_0x57f87b['push'](_0x57f87b['shift']());}};_0x13ee7f(++_0x91c818);}(_0xb294,0x159));var _0x4b29=function(_0x37320c,_0x11386e){_0x37320c=_0x37320c-0x0;var _0x59b2de=_0xb294[_0x37320c];return _0x59b2de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b29('0x0'));var zipdir=require(_0x4b29('0x1'));var jsonpatch=require(_0x4b29('0x2'));var rp=require(_0x4b29('0x3'));var moment=require(_0x4b29('0x4'));var BPromise=require(_0x4b29('0x5'));var Mustache=require(_0x4b29('0x6'));var util=require(_0x4b29('0x7'));var path=require('path');var sox=require(_0x4b29('0x8'));var csv=require('to-csv');var ejs=require(_0x4b29('0x9'));var fs=require('fs');var fs_extra=require(_0x4b29('0xa'));var _=require(_0x4b29('0xb'));var squel=require(_0x4b29('0xc'));var crypto=require(_0x4b29('0xd'));var jsforce=require(_0x4b29('0xe'));var deskjs=require(_0x4b29('0xf'));var toCsv=require(_0x4b29('0x10'));var querystring=require(_0x4b29('0x11'));var Papa=require(_0x4b29('0x12'));var Redis=require(_0x4b29('0x13'));var authService=require(_0x4b29('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4b29('0x15'));var hardwareService=require(_0x4b29('0x16'));var logger=require(_0x4b29('0x17'))(_0x4b29('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b29('0x19'))['db'];function respondWithStatusCode(_0x20a75b,_0x2efdd5){_0x2efdd5=_0x2efdd5||0xcc;return function(_0xfc03d4){if(_0xfc03d4){return _0x20a75b[_0x4b29('0x1a')](_0x2efdd5);}return _0x20a75b['status'](_0x2efdd5)[_0x4b29('0x1b')]();};}function respondWithResult(_0x109f5d,_0x29a2d3){_0x29a2d3=_0x29a2d3||0xc8;return function(_0x44433c){if(_0x44433c){return _0x109f5d[_0x4b29('0x1c')](_0x29a2d3)['json'](_0x44433c);}};}function respondWithFilteredResult(_0x384a8e,_0x2e094a){return function(_0x17da92){if(_0x17da92){var _0x4517b4=typeof _0x2e094a[_0x4b29('0x1d')]===_0x4b29('0x1e')&&typeof _0x2e094a[_0x4b29('0x1f')]===_0x4b29('0x1e');var _0x58c244=_0x17da92['count'];var _0x476e1e=_0x4517b4?0x0:_0x2e094a['offset'];var _0x290be2=_0x4517b4?_0x17da92[_0x4b29('0x20')]:_0x2e094a[_0x4b29('0x1d')]+_0x2e094a['limit'];var _0x343236;if(_0x290be2>=_0x58c244){_0x290be2=_0x58c244;_0x343236=0xc8;}else{_0x343236=0xce;}_0x384a8e[_0x4b29('0x1c')](_0x343236);return _0x384a8e[_0x4b29('0x21')](_0x4b29('0x22'),_0x476e1e+'-'+_0x290be2+'/'+_0x58c244)[_0x4b29('0x23')](_0x17da92);}return null;};}function patchUpdates(_0x588c44){return function(_0x4379aa){try{jsonpatch[_0x4b29('0x24')](_0x4379aa,_0x588c44,!![]);}catch(_0x3e99a9){return BPromise['reject'](_0x3e99a9);}return _0x4379aa[_0x4b29('0x25')]();};}function saveUpdates(_0x114497,_0x2b1ab6){return function(_0x82197e){if(_0x82197e){return _0x82197e['update'](_0x114497)[_0x4b29('0x26')](function(_0x111719){return _0x111719;});}return null;};}function removeEntity(_0x5bffcf,_0x2dd70b){return function(_0x359ab2){if(_0x359ab2){return _0x359ab2[_0x4b29('0x27')]()[_0x4b29('0x26')](function(){var _0x3ae242=_0x359ab2[_0x4b29('0x28')]({'plain':!![]});var _0x407c95='Dispositions';return db['UserProfileResource'][_0x4b29('0x27')]({'where':{'type':_0x407c95,'resourceId':_0x3ae242['id']}})['then'](function(){return _0x359ab2;});})[_0x4b29('0x26')](function(){_0x5bffcf[_0x4b29('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x155d57,_0x3b8c5f){return function(_0x18c952){if(!_0x18c952){_0x155d57[_0x4b29('0x1a')](0x194);}return _0x18c952;};}function handleError(_0x4e89c1,_0x4c1801){_0x4c1801=_0x4c1801||0x1f4;return function(_0x48ebb5){logger[_0x4b29('0x29')](_0x48ebb5[_0x4b29('0x2a')]);if(_0x48ebb5['name']){delete _0x48ebb5[_0x4b29('0x2b')];}_0x4e89c1['status'](_0x4c1801)[_0x4b29('0x2c')](_0x48ebb5);};}exports[_0x4b29('0x2d')]=function(_0x51b498,_0x4d0526){var _0x4a4d4e={},_0x3f4069={},_0x227ec1={'count':0x0,'rows':[]};var _0x525d00=_[_0x4b29('0x2e')](db['Disposition'][_0x4b29('0x2f')],function(_0x50198d){return{'name':_0x50198d[_0x4b29('0x30')],'type':_0x50198d[_0x4b29('0x31')]['key']};});_0x3f4069[_0x4b29('0x32')]=_[_0x4b29('0x2e')](_0x525d00,_0x4b29('0x2b'));_0x3f4069['query']=_[_0x4b29('0x33')](_0x51b498[_0x4b29('0x34')]);_0x3f4069[_0x4b29('0x35')]=_[_0x4b29('0x36')](_0x3f4069['model'],_0x3f4069[_0x4b29('0x34')]);_0x4a4d4e[_0x4b29('0x37')]=_[_0x4b29('0x36')](_0x3f4069['model'],qs[_0x4b29('0x38')](_0x51b498[_0x4b29('0x34')][_0x4b29('0x38')]));_0x4a4d4e[_0x4b29('0x37')]=_0x4a4d4e[_0x4b29('0x37')][_0x4b29('0x39')]?_0x4a4d4e[_0x4b29('0x37')]:_0x3f4069[_0x4b29('0x32')];if(!_0x51b498['query'][_0x4b29('0x3a')]('nolimit')){_0x4a4d4e[_0x4b29('0x1f')]=qs[_0x4b29('0x1f')](_0x51b498[_0x4b29('0x34')][_0x4b29('0x1f')]);_0x4a4d4e[_0x4b29('0x1d')]=qs[_0x4b29('0x1d')](_0x51b498[_0x4b29('0x34')][_0x4b29('0x1d')]);}_0x4a4d4e[_0x4b29('0x3b')]=qs[_0x4b29('0x3c')](_0x51b498[_0x4b29('0x34')][_0x4b29('0x3c')]);_0x4a4d4e[_0x4b29('0x3d')]=qs[_0x4b29('0x35')](_[_0x4b29('0x3e')](_0x51b498[_0x4b29('0x34')],_0x3f4069['filters']),_0x525d00);if(_0x51b498[_0x4b29('0x34')][_0x4b29('0x3f')]){_0x4a4d4e[_0x4b29('0x3d')]=_[_0x4b29('0x40')](_0x4a4d4e[_0x4b29('0x3d')],{'$or':_[_0x4b29('0x2e')](_0x525d00,function(_0x6cd830){if(_0x6cd830[_0x4b29('0x31')]!==_0x4b29('0x41')){var _0x4464cd={};_0x4464cd[_0x6cd830[_0x4b29('0x2b')]]={'$like':'%'+_0x51b498['query'][_0x4b29('0x3f')]+'%'};return _0x4464cd;}})});}_0x4a4d4e=_['merge']({},_0x4a4d4e,_0x51b498[_0x4b29('0x42')]);var _0x394f13={'where':_0x4a4d4e[_0x4b29('0x3d')]};return db[_0x4b29('0x43')][_0x4b29('0x20')](_0x394f13)[_0x4b29('0x26')](function(_0x10e925){_0x227ec1[_0x4b29('0x20')]=_0x10e925;if(_0x51b498[_0x4b29('0x34')]['includeAll']){_0x4a4d4e['include']=[{'all':!![]}];}return db['Disposition'][_0x4b29('0x44')](_0x4a4d4e);})[_0x4b29('0x26')](function(_0x1298d3){_0x227ec1[_0x4b29('0x45')]=_0x1298d3;return _0x227ec1;})[_0x4b29('0x26')](respondWithFilteredResult(_0x4d0526,_0x4a4d4e))[_0x4b29('0x46')](handleError(_0x4d0526,null));};exports[_0x4b29('0x47')]=function(_0x3f0902,_0x40b6b2){var _0x333133={'raw':!![],'where':{'id':_0x3f0902[_0x4b29('0x48')]['id']}},_0x4fa376={};_0x4fa376[_0x4b29('0x32')]=_[_0x4b29('0x33')](db['Disposition'][_0x4b29('0x2f')]);_0x4fa376[_0x4b29('0x34')]=_['keys'](_0x3f0902[_0x4b29('0x34')]);_0x4fa376[_0x4b29('0x35')]=_[_0x4b29('0x36')](_0x4fa376[_0x4b29('0x32')],_0x4fa376['query']);_0x333133[_0x4b29('0x37')]=_['intersection'](_0x4fa376[_0x4b29('0x32')],qs[_0x4b29('0x38')](_0x3f0902[_0x4b29('0x34')][_0x4b29('0x38')]));_0x333133[_0x4b29('0x37')]=_0x333133['attributes'][_0x4b29('0x39')]?_0x333133[_0x4b29('0x37')]:_0x4fa376['model'];if(_0x3f0902[_0x4b29('0x34')][_0x4b29('0x49')]){_0x333133[_0x4b29('0x4a')]=[{'all':!![]}];}_0x333133=_[_0x4b29('0x40')]({},_0x333133,_0x3f0902[_0x4b29('0x42')]);return db[_0x4b29('0x43')][_0x4b29('0x4b')](_0x333133)[_0x4b29('0x26')](handleEntityNotFound(_0x40b6b2,null))[_0x4b29('0x26')](respondWithResult(_0x40b6b2,null))[_0x4b29('0x46')](handleError(_0x40b6b2,null));};exports[_0x4b29('0x4c')]=function(_0x26e991,_0x47f8c1){return db[_0x4b29('0x43')][_0x4b29('0x4c')](_0x26e991[_0x4b29('0x4d')],{})[_0x4b29('0x26')](function(_0x2445ab){var _0x49ae7c=_0x26e991[_0x4b29('0x4e')]['get']({'plain':!![]});if(!_0x49ae7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49ae7c['role']===_0x4b29('0x4e')){var _0x35f78b=_0x2445ab['get']({'plain':!![]});var _0x4d8a0d=_0x4b29('0x4f');return db[_0x4b29('0x50')][_0x4b29('0x4b')]({'where':{'name':_0x4d8a0d,'userProfileId':_0x49ae7c[_0x4b29('0x51')]},'raw':!![]})[_0x4b29('0x26')](function(_0x129432){if(_0x129432&&_0x129432[_0x4b29('0x52')]===0x0){return db['UserProfileResource'][_0x4b29('0x4c')]({'name':_0x35f78b['name'],'resourceId':_0x35f78b['id'],'type':_0x129432[_0x4b29('0x2b')],'sectionId':_0x129432['id']},{})[_0x4b29('0x26')](function(){return _0x2445ab;});}else{return _0x2445ab;}})['catch'](function(_0x453a6a){logger[_0x4b29('0x29')](_0x4b29('0x53'),_0x453a6a);throw _0x453a6a;});}return _0x2445ab;})['then'](respondWithResult(_0x47f8c1,0xc9))[_0x4b29('0x46')](handleError(_0x47f8c1,null));};exports['update']=function(_0x6f80b2,_0x232ff0){if(_0x6f80b2[_0x4b29('0x4d')]['id']){delete _0x6f80b2[_0x4b29('0x4d')]['id'];}return db[_0x4b29('0x43')]['find']({'where':{'id':_0x6f80b2[_0x4b29('0x48')]['id']}})[_0x4b29('0x26')](handleEntityNotFound(_0x232ff0,null))['then'](saveUpdates(_0x6f80b2[_0x4b29('0x4d')],null))[_0x4b29('0x26')](respondWithResult(_0x232ff0,null))['catch'](handleError(_0x232ff0,null));};exports[_0x4b29('0x27')]=function(_0x41d9d7,_0x42c888){return db['Disposition'][_0x4b29('0x4b')]({'where':{'id':_0x41d9d7['params']['id']}})[_0x4b29('0x26')](handleEntityNotFound(_0x42c888,null))[_0x4b29('0x26')](removeEntity(_0x42c888,null))['catch'](handleError(_0x42c888,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 17204cd..5d1f2c0 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 _0xc6a6=['name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','ListId','name_chat','name_mail','name','MailAccountId','name_sms','SmsAccountId'];(function(_0x948d60,_0x39ac9c){var _0xadb386=function(_0x2987d7){while(--_0x2987d7){_0x948d60['push'](_0x948d60['shift']());}};_0xadb386(++_0x39ac9c);}(_0xc6a6,0x12f));var _0x6c6a=function(_0x5fb087,_0x13455f){_0x5fb087=_0x5fb087-0x0;var _0x326517=_0xc6a6[_0x5fb087];return _0x326517;};'use strict';var _=require('lodash');var util=require(_0x6c6a('0x0'));var logger=require(_0x6c6a('0x1'))(_0x6c6a('0x2'));var moment=require(_0x6c6a('0x3'));var BPromise=require(_0x6c6a('0x4'));var rp=require(_0x6c6a('0x5'));var fs=require('fs');var path=require(_0x6c6a('0x6'));var rimraf=require(_0x6c6a('0x7'));var config=require(_0x6c6a('0x8'));var attributes=require(_0x6c6a('0x9'));module[_0x6c6a('0xa')]=function(_0x4db5c8,_0x1301fb){return _0x4db5c8['define'](_0x6c6a('0xb'),attributes,{'tableName':_0x6c6a('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6c6a('0xd'),'fields':['name',_0x6c6a('0xe')]},{'unique':!![],'name':_0x6c6a('0xf'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x6c6a('0x10'),'fields':[_0x6c6a('0x11'),_0x6c6a('0x12')]},{'unique':!![],'name':_0x6c6a('0x13'),'fields':[_0x6c6a('0x11'),_0x6c6a('0x14')]},{'unique':!![],'name':_0x6c6a('0x15'),'fields':[_0x6c6a('0x11'),_0x6c6a('0x16')]},{'unique':!![],'name':_0x6c6a('0x17'),'fields':['name',_0x6c6a('0x18')]},{'unique':!![],'name':_0x6c6a('0x19'),'fields':[_0x6c6a('0x11'),_0x6c6a('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0202=['MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat'];(function(_0x405aeb,_0x5ee732){var _0x50e76a=function(_0x2cded1){while(--_0x2cded1){_0x405aeb['push'](_0x405aeb['shift']());}};_0x50e76a(++_0x5ee732);}(_0x0202,0x18d));var _0x2020=function(_0x5bebf2,_0x32aa77){_0x5bebf2=_0x5bebf2-0x0;var _0x2924e4=_0x0202[_0x5bebf2];return _0x2924e4;};'use strict';var _=require('lodash');var util=require(_0x2020('0x0'));var logger=require(_0x2020('0x1'))(_0x2020('0x2'));var moment=require('moment');var BPromise=require(_0x2020('0x3'));var rp=require(_0x2020('0x4'));var fs=require('fs');var path=require(_0x2020('0x5'));var rimraf=require(_0x2020('0x6'));var config=require(_0x2020('0x7'));var attributes=require(_0x2020('0x8'));module[_0x2020('0x9')]=function(_0x18da15,_0x551b74){return _0x18da15[_0x2020('0xa')](_0x2020('0xb'),attributes,{'tableName':_0x2020('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2020('0xd'),'fields':[_0x2020('0xe'),_0x2020('0xf')]},{'unique':!![],'name':_0x2020('0x10'),'fields':[_0x2020('0xe'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name',_0x2020('0x11')]},{'unique':!![],'name':_0x2020('0x12'),'fields':['name',_0x2020('0x13')]},{'unique':!![],'name':_0x2020('0x14'),'fields':[_0x2020('0xe'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x2020('0xe'),_0x2020('0x15')]},{'unique':!![],'name':_0x2020('0x16'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index e59376c..7a5a2c7 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(_0x2c7373,_0x58496d){var _0x3407d1=function(_0x245ada){while(--_0x245ada){_0x2c7373['push'](_0x2c7373['shift']());}};_0x3407d1(++_0x58496d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x2e983e,_0x495ce6){var _0xabf9d8=function(_0x1f17d1){while(--_0x1f17d1){_0x2e983e['push'](_0x2e983e['shift']());}};_0xabf9d8(++_0x495ce6);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 5619cf6..91e674d 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 _0x3219=['put','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3f6135,_0x474672){var _0x433816=function(_0x5cf9c6){while(--_0x5cf9c6){_0x3f6135['push'](_0x3f6135['shift']());}};_0x433816(++_0x474672);}(_0x3219,0x9e));var _0x9321=function(_0x2f31d0,_0x4fce9a){_0x2f31d0=_0x2f31d0-0x0;var _0x1d0256=_0x3219[_0x2f31d0];return _0x1d0256;};'use strict';var multer=require(_0x9321('0x0'));var util=require(_0x9321('0x1'));var path=require(_0x9321('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9321('0x3')]();var fs_extra=require(_0x9321('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9321('0x5'));var config=require(_0x9321('0x6'));var controller=require('./disposition.controller');router[_0x9321('0x7')]('/',auth[_0x9321('0x8')](),controller[_0x9321('0x9')]);router['get'](_0x9321('0xa'),auth[_0x9321('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9321('0xb')](_0x9321('0xa'),auth[_0x9321('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9321('0xc')]);module['exports']=router; \ No newline at end of file +var _0xd9ad=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','get','/:id','post','create','put','update'];(function(_0x490a80,_0x2c3ec4){var _0x4177da=function(_0xe57b7d){while(--_0xe57b7d){_0x490a80['push'](_0x490a80['shift']());}};_0x4177da(++_0x2c3ec4);}(_0xd9ad,0x132));var _0xdd9a=function(_0x5a6f0d,_0x28bfa5){_0x5a6f0d=_0x5a6f0d-0x0;var _0x13d5f0=_0xd9ad[_0x5a6f0d];return _0x13d5f0;};'use strict';var multer=require(_0xdd9a('0x0'));var util=require(_0xdd9a('0x1'));var path=require(_0xdd9a('0x2'));var timeout=require(_0xdd9a('0x3'));var express=require(_0xdd9a('0x4'));var router=express['Router']();var fs_extra=require(_0xdd9a('0x5'));var auth=require(_0xdd9a('0x6'));var interaction=require(_0xdd9a('0x7'));var config=require(_0xdd9a('0x8'));var controller=require(_0xdd9a('0x9'));router['get']('/',auth[_0xdd9a('0xa')](),controller['index']);router[_0xdd9a('0xb')](_0xdd9a('0xc'),auth[_0xdd9a('0xa')](),controller['show']);router[_0xdd9a('0xd')]('/',auth[_0xdd9a('0xa')](),controller[_0xdd9a('0xe')]);router[_0xdd9a('0xf')]('/:id',auth[_0xdd9a('0xa')](),controller[_0xdd9a('0x10')]);router[_0xdd9a('0x11')](_0xdd9a('0xc'),auth[_0xdd9a('0xa')](),controller[_0xdd9a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 412979a..50f55c8 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 _0x1aad=['ENUM','yes','localstationid','4800','9600','12000','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x16585a,_0x325dfb){var _0x240a97=function(_0x88174a){while(--_0x88174a){_0x16585a['push'](_0x16585a['shift']());}};_0x240a97(++_0x325dfb);}(_0x1aad,0x13f));var _0xd1aa=function(_0x25f8e8,_0x519d8e){_0x25f8e8=_0x25f8e8-0x0;var _0x1df02c=_0x1aad[_0x25f8e8];return _0x1df02c;};'use strict';var Sequelize=require(_0xd1aa('0x0'));module[_0xd1aa('0x1')]={'name':{'type':Sequelize[_0xd1aa('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xd1aa('0x3')](_0xd1aa('0x4'),'no'),'defaultValue':_0xd1aa('0x4')},'headerinfo':{'type':Sequelize[_0xd1aa('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xd1aa('0x2')],'unique':_0xd1aa('0x5')},'minrate':{'type':Sequelize[_0xd1aa('0x3')]('2400',_0xd1aa('0x6'),'7200',_0xd1aa('0x7'),_0xd1aa('0x8'),_0xd1aa('0x9')),'defaultValue':_0xd1aa('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400','4800',_0xd1aa('0xa'),'9600',_0xd1aa('0x8'),'14400'),'defaultValue':_0xd1aa('0x9')},'modem':{'type':Sequelize[_0xd1aa('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd1aa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd1aa('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd1aa('0x3')](_0xd1aa('0xc'),_0xd1aa('0xd'),_0xd1aa('0xe'),_0xd1aa('0xf')),'defaultValue':_0xd1aa('0xc')},'key':{'type':Sequelize[_0xd1aa('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd1aa('0x10')],'defaultValue':function(){return _0xd1aa('0x11');}},'notificationSound':{'type':Sequelize[_0xd1aa('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd1aa('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd1aa('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd1aa('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd1aa('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd1aa('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd1aa('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd1aa('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd1aa('0x14'),'set':function(_0x2aa775){if(!_0x2aa775)this[_0xd1aa('0x15')]('mandatoryDispositionPauseId',null);this[_0xd1aa('0x15')](_0xd1aa('0x16'),_0x2aa775);}}}; \ No newline at end of file +var _0x750b=['SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','7200','9600','14400','4800','12000','INTEGER'];(function(_0x1d5a6c,_0x57fcb1){var _0x4ff124=function(_0x1b1422){while(--_0x1b1422){_0x1d5a6c['push'](_0x1d5a6c['shift']());}};_0x4ff124(++_0x57fcb1);}(_0x750b,0x1bf));var _0xb750=function(_0x389fb6,_0x56f281){_0x389fb6=_0x389fb6-0x0;var _0x500088=_0x750b[_0x389fb6];return _0x500088;};'use strict';var Sequelize=require(_0xb750('0x0'));module[_0xb750('0x1')]={'name':{'type':Sequelize[_0xb750('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb750('0x2')]},'ecm':{'type':Sequelize[_0xb750('0x3')](_0xb750('0x4'),'no'),'defaultValue':_0xb750('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xb750('0x5')},'localstationid':{'type':Sequelize[_0xb750('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xb750('0x3')](_0xb750('0x6'),'4800',_0xb750('0x7'),_0xb750('0x8'),'12000',_0xb750('0x9')),'defaultValue':_0xb750('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0xb750('0x6'),'4800',_0xb750('0x7'),_0xb750('0x8'),_0xb750('0xb'),_0xb750('0x9')),'defaultValue':_0xb750('0x9')},'modem':{'type':Sequelize[_0xb750('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb750('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb750('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xb750('0xd'),_0xb750('0xe'),_0xb750('0xf'),_0xb750('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb750('0x11')],'defaultValue':function(){return _0xb750('0x12');}},'notificationSound':{'type':Sequelize[_0xb750('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb750('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb750('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb750('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb750('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb750('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb750('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xb750('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xb750('0x13')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x598b5a){if(!_0x598b5a)this['setDataValue'](_0xb750('0x15'),null);this['setDataValue'](_0xb750('0x16'),_0x598b5a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ac822df..abe8b01 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 _0x8b7d=['ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','format','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','type','options','includeAll','findAll','rows','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','order','pick','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','tech','createdAt','updatedAt','TrunkId'];(function(_0x5490b6,_0x518350){var _0x3a9f0b=function(_0x4d0e0f){while(--_0x4d0e0f){_0x5490b6['push'](_0x5490b6['shift']());}};_0x3a9f0b(++_0x518350);}(_0x8b7d,0xee));var _0xd8b7=function(_0x175136,_0x5cefc5){_0x175136=_0x175136-0x0;var _0x5931cc=_0x8b7d[_0x175136];return _0x5931cc;};'use strict';var emlformat=require(_0xd8b7('0x0'));var rimraf=require(_0xd8b7('0x1'));var zipdir=require(_0xd8b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8b7('0x3'));var moment=require('moment');var BPromise=require(_0xd8b7('0x4'));var Mustache=require(_0xd8b7('0x5'));var util=require('util');var path=require(_0xd8b7('0x6'));var sox=require(_0xd8b7('0x7'));var csv=require(_0xd8b7('0x8'));var ejs=require(_0xd8b7('0x9'));var fs=require('fs');var fs_extra=require(_0xd8b7('0xa'));var _=require(_0xd8b7('0xb'));var squel=require(_0xd8b7('0xc'));var crypto=require(_0xd8b7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd8b7('0xe'));var toCsv=require(_0xd8b7('0x8'));var querystring=require(_0xd8b7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8b7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8b7('0x11'))(_0xd8b7('0x12'));var utils=require(_0xd8b7('0x13'));var config=require(_0xd8b7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8b7('0x15'))['db'];config[_0xd8b7('0x16')]=_['defaults'](config['redis'],{'host':_0xd8b7('0x17'),'port':0x18eb});var socket=require(_0xd8b7('0x18'))(new Redis(config[_0xd8b7('0x16')]));require(_0xd8b7('0x19'))['register'](socket);var jayson=require(_0xd8b7('0x1a'));var client=jayson[_0xd8b7('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xd8b7('0x1b')][_0xd8b7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x56a046,_0x4cbf65,_0x30a6fd,_0x4a2a30){return new BPromise(function(_0x58e749,_0x5bc071){var _0x24bac7=_0x4a2a30||client;return _0x24bac7[_0xd8b7('0x1d')](_0x56a046,_0x30a6fd)['then'](function(_0x39d51c){logger[_0xd8b7('0x1e')](_0xd8b7('0x1f'),_0x4cbf65,_0xd8b7('0x20'));logger['debug'](_0xd8b7('0x21'),_0x4cbf65,'request\x20sent',JSON[_0xd8b7('0x22')](_0x39d51c));if(_0x39d51c['error']){if(_0x39d51c[_0xd8b7('0x23')][_0xd8b7('0x24')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4cbf65,_0x39d51c[_0xd8b7('0x23')][_0xd8b7('0x25')]);return _0x5bc071(_0x39d51c['error'][_0xd8b7('0x25')]);}logger['error'](_0xd8b7('0x1f'),_0x4cbf65,_0x39d51c[_0xd8b7('0x23')][_0xd8b7('0x25')]);return _0x58e749(_0x39d51c[_0xd8b7('0x23')]['message']);}else{logger[_0xd8b7('0x1e')](_0xd8b7('0x1f'),_0x4cbf65,_0xd8b7('0x20'));_0x58e749(_0x39d51c[_0xd8b7('0x26')][_0xd8b7('0x25')]);}})[_0xd8b7('0x27')](function(_0x5a9b68){logger['error'](_0xd8b7('0x1f'),_0x4cbf65,_0x5a9b68);_0x5bc071(_0x5a9b68);});});}function respondWithStatusCode(_0x22cfcd,_0x4d04bd){_0x4d04bd=_0x4d04bd||0xcc;return function(_0xad017b){if(_0xad017b){return _0x22cfcd['sendStatus'](_0x4d04bd);}return _0x22cfcd[_0xd8b7('0x28')](_0x4d04bd)[_0xd8b7('0x29')]();};}function respondWithResult(_0x3ebeb9,_0x44f926){_0x44f926=_0x44f926||0xc8;return function(_0x3882af){if(_0x3882af){return _0x3ebeb9[_0xd8b7('0x28')](_0x44f926)[_0xd8b7('0x2a')](_0x3882af);}};}function respondWithFilteredResult(_0xf6d2be,_0x5d5c06){return function(_0x18e99a){if(_0x18e99a){var _0x59d1e7=typeof _0x5d5c06[_0xd8b7('0x2b')]===_0xd8b7('0x2c')&&typeof _0x5d5c06[_0xd8b7('0x2d')]===_0xd8b7('0x2c');var _0x4e0c75=_0x18e99a['count'];var _0x54bf66=_0x59d1e7?0x0:_0x5d5c06[_0xd8b7('0x2b')];var _0x150103=_0x59d1e7?_0x18e99a[_0xd8b7('0x2e')]:_0x5d5c06[_0xd8b7('0x2b')]+_0x5d5c06['limit'];var _0x1f8850;if(_0x150103>=_0x4e0c75){_0x150103=_0x4e0c75;_0x1f8850=0xc8;}else{_0x1f8850=0xce;}_0xf6d2be['status'](_0x1f8850);return _0xf6d2be[_0xd8b7('0x2f')](_0xd8b7('0x30'),_0x54bf66+'-'+_0x150103+'/'+_0x4e0c75)[_0xd8b7('0x2a')](_0x18e99a);}return null;};}function patchUpdates(_0x9125d0){return function(_0x537a3e){try{jsonpatch['apply'](_0x537a3e,_0x9125d0,!![]);}catch(_0x3fda6a){return BPromise[_0xd8b7('0x31')](_0x3fda6a);}return _0x537a3e[_0xd8b7('0x32')]();};}function saveUpdates(_0x1be32d,_0x4114d1){return function(_0x47099a){if(_0x47099a){return _0x47099a[_0xd8b7('0x33')](_0x1be32d)[_0xd8b7('0x34')](function(_0x2fb07a){return _0x2fb07a;});}return null;};}function removeEntity(_0xfbe9e,_0x3eb11a){return function(_0x5abff1){if(_0x5abff1){return _0x5abff1[_0xd8b7('0x35')]()[_0xd8b7('0x34')](function(){var _0x3ee6e8=_0x5abff1[_0xd8b7('0x36')]({'plain':!![]});var _0x2ad3a9=_0xd8b7('0x37');return db[_0xd8b7('0x38')][_0xd8b7('0x35')]({'where':{'type':_0x2ad3a9,'resourceId':_0x3ee6e8['id']}})[_0xd8b7('0x34')](function(){return _0x5abff1;});})[_0xd8b7('0x34')](function(){_0xfbe9e[_0xd8b7('0x28')](0xcc)[_0xd8b7('0x29')]();});}};}function handleEntityNotFound(_0xd95fed,_0x41f3d0){return function(_0xc0637){if(!_0xc0637){_0xd95fed['sendStatus'](0x194);}return _0xc0637;};}function handleError(_0x1574b2,_0x34d8ac){_0x34d8ac=_0x34d8ac||0x1f4;return function(_0x4ab72f){logger[_0xd8b7('0x23')](_0x4ab72f['stack']);if(_0x4ab72f['name']){delete _0x4ab72f[_0xd8b7('0x39')];}_0x1574b2[_0xd8b7('0x28')](_0x34d8ac)[_0xd8b7('0x3a')](_0x4ab72f);};}exports[_0xd8b7('0x3b')]=function(_0x4a4caa,_0x135529){var _0x10b2b3={'include':[{'model':db[_0xd8b7('0x3c')],'as':_0xd8b7('0x3d')}]},_0x1e2a76={},_0x2796e0={'count':0x0,'rows':[]};var _0x5ab6ba=_['map'](db[_0xd8b7('0x3e')][_0xd8b7('0x3f')],function(_0xbbfd9b){return{'name':_0xbbfd9b[_0xd8b7('0x40')],'type':_0xbbfd9b['type'][_0xd8b7('0x41')]};});_0x1e2a76[_0xd8b7('0x42')]=_[_0xd8b7('0x43')](_0x5ab6ba,_0xd8b7('0x39'));_0x1e2a76[_0xd8b7('0x44')]=_[_0xd8b7('0x45')](_0x4a4caa['query']);_0x1e2a76[_0xd8b7('0x46')]=_[_0xd8b7('0x47')](_0x1e2a76[_0xd8b7('0x42')],_0x1e2a76[_0xd8b7('0x44')]);_0x10b2b3[_0xd8b7('0x48')]=_[_0xd8b7('0x47')](_0x1e2a76[_0xd8b7('0x42')],qs[_0xd8b7('0x49')](_0x4a4caa[_0xd8b7('0x44')][_0xd8b7('0x49')]));_0x10b2b3[_0xd8b7('0x48')]=_0x10b2b3[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x10b2b3[_0xd8b7('0x48')]:_0x1e2a76[_0xd8b7('0x42')];if(!_0x4a4caa[_0xd8b7('0x44')]['hasOwnProperty']('nolimit')){_0x10b2b3['limit']=qs['limit'](_0x4a4caa['query'][_0xd8b7('0x2d')]);_0x10b2b3[_0xd8b7('0x2b')]=qs[_0xd8b7('0x2b')](_0x4a4caa[_0xd8b7('0x44')][_0xd8b7('0x2b')]);}_0x10b2b3['order']=qs[_0xd8b7('0x4b')](_0x4a4caa[_0xd8b7('0x44')][_0xd8b7('0x4b')]);_0x10b2b3[_0xd8b7('0x4c')]=qs[_0xd8b7('0x46')](_['pick'](_0x4a4caa['query'],_0x1e2a76['filters']),_0x5ab6ba);if(_0x4a4caa[_0xd8b7('0x44')][_0xd8b7('0x4d')]){_0x10b2b3[_0xd8b7('0x4c')]=_[_0xd8b7('0x4e')](_0x10b2b3[_0xd8b7('0x4c')],{'$or':_['map'](_0x5ab6ba,function(_0x2a1df1){if(_0x2a1df1[_0xd8b7('0x4f')]!=='VIRTUAL'){var _0x71f13e={};_0x71f13e[_0x2a1df1['name']]={'$like':'%'+_0x4a4caa[_0xd8b7('0x44')][_0xd8b7('0x4d')]+'%'};return _0x71f13e;}})});}_0x10b2b3=_[_0xd8b7('0x4e')]({},_0x10b2b3,_0x4a4caa[_0xd8b7('0x50')]);var _0x2d51d9={'where':_0x10b2b3['where']};return db[_0xd8b7('0x3e')][_0xd8b7('0x2e')](_0x2d51d9)[_0xd8b7('0x34')](function(_0x44138c){_0x2796e0[_0xd8b7('0x2e')]=_0x44138c;if(_0x4a4caa['query'][_0xd8b7('0x51')]){_0x10b2b3['include']=[{'all':!![]}];}return db['FaxAccount'][_0xd8b7('0x52')](_0x10b2b3);})[_0xd8b7('0x34')](function(_0x49919f){_0x2796e0[_0xd8b7('0x53')]=_0x49919f;return _0x2796e0;})[_0xd8b7('0x34')](respondWithFilteredResult(_0x135529,_0x10b2b3))['catch'](handleError(_0x135529,null));};exports[_0xd8b7('0x54')]=function(_0x1f0955,_0x43dd31){var _0x13f211={'raw':![],'where':{'id':_0x1f0955['params']['id']},'include':[{'model':db[_0xd8b7('0x3c')],'as':_0xd8b7('0x3d')}]},_0x147b73={};_0x147b73[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x3e')][_0xd8b7('0x3f')]);_0x147b73[_0xd8b7('0x44')]=_['keys'](_0x1f0955[_0xd8b7('0x44')]);_0x147b73['filters']=_[_0xd8b7('0x47')](_0x147b73['model'],_0x147b73[_0xd8b7('0x44')]);_0x13f211['attributes']=_[_0xd8b7('0x47')](_0x147b73['model'],qs['fields'](_0x1f0955[_0xd8b7('0x44')][_0xd8b7('0x49')]));_0x13f211[_0xd8b7('0x48')]=_0x13f211[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x13f211[_0xd8b7('0x48')]:_0x147b73[_0xd8b7('0x42')];if(_0x1f0955[_0xd8b7('0x44')][_0xd8b7('0x51')]){_0x13f211[_0xd8b7('0x55')]=[{'all':!![]}];}_0x13f211=_['merge']({},_0x13f211,_0x1f0955['options']);return db[_0xd8b7('0x3e')][_0xd8b7('0x56')](_0x13f211)[_0xd8b7('0x34')](handleEntityNotFound(_0x43dd31,null))[_0xd8b7('0x34')](respondWithResult(_0x43dd31,null))[_0xd8b7('0x27')](handleError(_0x43dd31,null));};exports[_0xd8b7('0x57')]=function(_0x22afcb,_0x445a9f){return db[_0xd8b7('0x3e')][_0xd8b7('0x57')](_0x22afcb[_0xd8b7('0x58')],{})[_0xd8b7('0x34')](function(_0x179aab){var _0x4aa3de=_0x22afcb[_0xd8b7('0x59')][_0xd8b7('0x36')]({'plain':!![]});if(!_0x4aa3de)throw new Error(_0xd8b7('0x5a'));if(_0x4aa3de[_0xd8b7('0x5b')]===_0xd8b7('0x59')){var _0x2fe066=_0x179aab[_0xd8b7('0x36')]({'plain':!![]});var _0x39fb37='FaxAccounts';return db[_0xd8b7('0x5c')][_0xd8b7('0x56')]({'where':{'name':_0x39fb37,'userProfileId':_0x4aa3de['userProfileId']},'raw':!![]})[_0xd8b7('0x34')](function(_0x5416a1){if(_0x5416a1&&_0x5416a1[_0xd8b7('0x5d')]===0x0){return db[_0xd8b7('0x38')]['create']({'name':_0x2fe066['name'],'resourceId':_0x2fe066['id'],'type':_0x5416a1[_0xd8b7('0x39')],'sectionId':_0x5416a1['id']},{})['then'](function(){return _0x179aab;});}else{return _0x179aab;}})[_0xd8b7('0x27')](function(_0x419591){logger[_0xd8b7('0x23')](_0xd8b7('0x5e'),_0x419591);throw _0x419591;});}return _0x179aab;})[_0xd8b7('0x34')](respondWithResult(_0x445a9f,0xc9))['catch'](handleError(_0x445a9f,null));};exports[_0xd8b7('0x33')]=function(_0x38b2a5,_0x92ec2c){if(_0x38b2a5[_0xd8b7('0x58')]['id']){delete _0x38b2a5[_0xd8b7('0x58')]['id'];}return db[_0xd8b7('0x3e')][_0xd8b7('0x56')]({'where':{'id':_0x38b2a5[_0xd8b7('0x5f')]['id']},'include':[{'model':db[_0xd8b7('0x3c')],'as':_0xd8b7('0x3d')}]})[_0xd8b7('0x34')](handleEntityNotFound(_0x92ec2c,null))[_0xd8b7('0x34')](saveUpdates(_0x38b2a5[_0xd8b7('0x58')],null))[_0xd8b7('0x34')](respondWithResult(_0x92ec2c,null))[_0xd8b7('0x27')](handleError(_0x92ec2c,null));};exports[_0xd8b7('0x35')]=function(_0x47329e,_0x3c83cd){return db[_0xd8b7('0x3e')]['find']({'where':{'id':_0x47329e[_0xd8b7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3c83cd,null))[_0xd8b7('0x34')](removeEntity(_0x3c83cd,null))[_0xd8b7('0x27')](handleError(_0x3c83cd,null));};exports[_0xd8b7('0x60')]=function(_0x4d0e3e,_0x19b3d5){return db[_0xd8b7('0x3e')][_0xd8b7('0x60')]()['then'](respondWithResult(_0x19b3d5,null))[_0xd8b7('0x27')](handleError(_0x19b3d5,null));};exports[_0xd8b7('0x61')]=function(_0xf1b3d0,_0xca880f,_0x479616){if(_0xf1b3d0[_0xd8b7('0x58')]['id']){delete _0xf1b3d0[_0xd8b7('0x58')]['id'];}return db[_0xd8b7('0x3e')][_0xd8b7('0x56')]({'where':{'id':_0xf1b3d0[_0xd8b7('0x5f')]['id']}})['then'](handleEntityNotFound(_0xca880f,null))[_0xd8b7('0x34')](function(_0x3b92e3){if(_0x3b92e3){_0xf1b3d0[_0xd8b7('0x58')][_0xd8b7('0x62')]=_0x3b92e3['id'];return db[_0xd8b7('0x63')][_0xd8b7('0x57')](_0xf1b3d0[_0xd8b7('0x58')]);}})['then'](respondWithResult(_0xca880f,null))[_0xd8b7('0x27')](handleError(_0xca880f,null));};exports[_0xd8b7('0x64')]=function(_0x3497a5,_0x5f1da2,_0x50130d){var _0x5c2a06={'raw':![],'where':{}};var _0x27d232={};var _0x87880f={'count':0x0,'rows':[]};return db['FaxAccount'][_0xd8b7('0x65')]({'where':{'id':_0x3497a5[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x5f1da2,null))['then'](function(_0x306e86){if(_0x306e86){_0x27d232[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x63')][_0xd8b7('0x3f')]);_0x27d232['query']=_['keys'](_0x3497a5[_0xd8b7('0x44')]);_0x27d232[_0xd8b7('0x46')]=_[_0xd8b7('0x47')](_0x27d232[_0xd8b7('0x42')],_0x27d232[_0xd8b7('0x44')]);_0x5c2a06[_0xd8b7('0x48')]=_[_0xd8b7('0x47')](_0x27d232['model'],qs['fields'](_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x49')]));_0x5c2a06[_0xd8b7('0x48')]=_0x5c2a06[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x5c2a06[_0xd8b7('0x48')]:_0x27d232[_0xd8b7('0x42')];if(!_0x3497a5['query'][_0xd8b7('0x66')](_0xd8b7('0x67'))){_0x5c2a06['limit']=qs[_0xd8b7('0x2d')](_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x2d')]);_0x5c2a06[_0xd8b7('0x2b')]=qs['offset'](_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x2b')]);}_0x5c2a06[_0xd8b7('0x68')]=qs[_0xd8b7('0x4b')](_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x4b')]);_0x5c2a06[_0xd8b7('0x4c')]=qs['filters'](_[_0xd8b7('0x69')](_0x3497a5['query'],_0x27d232[_0xd8b7('0x46')]));_0x5c2a06[_0xd8b7('0x4c')][_0xd8b7('0x62')]=_0x306e86['id'];if(_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x4d')]){_0x5c2a06[_0xd8b7('0x4c')]=_[_0xd8b7('0x4e')](_0x5c2a06[_0xd8b7('0x4c')],{'$or':_[_0xd8b7('0x43')](_0x5c2a06['attributes'],function(_0x41b0a1){var _0x1e14e6={};_0x1e14e6[_0x41b0a1]={'$like':'%'+_0x3497a5[_0xd8b7('0x44')][_0xd8b7('0x4d')]+'%'};return _0x1e14e6;})});}_0x5c2a06=_[_0xd8b7('0x4e')]({},_0x5c2a06,_0x3497a5[_0xd8b7('0x50')]);return db[_0xd8b7('0x63')][_0xd8b7('0x2e')]({'where':_0x5c2a06[_0xd8b7('0x4c')]})[_0xd8b7('0x34')](function(_0x24bca6){_0x87880f[_0xd8b7('0x2e')]=_0x24bca6;if(_0x3497a5['query']['includeAll']){_0x5c2a06[_0xd8b7('0x55')]=[{'all':!![]}];}return db[_0xd8b7('0x63')][_0xd8b7('0x52')](_0x5c2a06);})['then'](function(_0xa23e58){_0x87880f[_0xd8b7('0x53')]=_0xa23e58;return _0x87880f;});}})[_0xd8b7('0x34')](respondWithFilteredResult(_0x5f1da2,_0x5c2a06))['catch'](handleError(_0x5f1da2,null));};exports['removeDispositions']=function(_0x3bc092,_0x4ef161,_0x4f381d){return db[_0xd8b7('0x3e')][_0xd8b7('0x56')]({'where':{'id':_0x3bc092[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x4ef161,null))[_0xd8b7('0x34')](function(_0x5a7f56){if(_0x5a7f56){return _0x5a7f56['removeDispositions'](_0x3bc092[_0xd8b7('0x44')][_0xd8b7('0x6a')]);}})[_0xd8b7('0x34')](respondWithStatusCode(_0x4ef161,null))[_0xd8b7('0x27')](handleError(_0x4ef161,null));};exports[_0xd8b7('0x6b')]=function(_0x16a558,_0x301186,_0x5baf9a){if(_0x16a558['body']['id']){delete _0x16a558['body']['id'];}return db[_0xd8b7('0x3e')][_0xd8b7('0x56')]({'where':{'id':_0x16a558[_0xd8b7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x301186,null))[_0xd8b7('0x34')](function(_0x1052f7){if(_0x1052f7){_0x16a558[_0xd8b7('0x58')][_0xd8b7('0x62')]=_0x1052f7['id'];return db[_0xd8b7('0x6c')][_0xd8b7('0x57')](_0x16a558['body']);}})[_0xd8b7('0x34')](respondWithResult(_0x301186,null))[_0xd8b7('0x27')](handleError(_0x301186,null));};exports['getAnswers']=function(_0x570f65,_0x1c611d,_0x130b68){var _0x3b188d={'raw':![],'where':{}};var _0x3a8a95={};var _0xac4a83={'count':0x0,'rows':[]};return db[_0xd8b7('0x3e')][_0xd8b7('0x65')]({'where':{'id':_0x570f65[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x1c611d,null))[_0xd8b7('0x34')](function(_0x4eb03e){if(_0x4eb03e){_0x3a8a95[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x6c')][_0xd8b7('0x3f')]);_0x3a8a95['query']=_[_0xd8b7('0x45')](_0x570f65[_0xd8b7('0x44')]);_0x3a8a95[_0xd8b7('0x46')]=_['intersection'](_0x3a8a95[_0xd8b7('0x42')],_0x3a8a95[_0xd8b7('0x44')]);_0x3b188d[_0xd8b7('0x48')]=_[_0xd8b7('0x47')](_0x3a8a95['model'],qs[_0xd8b7('0x49')](_0x570f65[_0xd8b7('0x44')][_0xd8b7('0x49')]));_0x3b188d[_0xd8b7('0x48')]=_0x3b188d['attributes'][_0xd8b7('0x4a')]?_0x3b188d['attributes']:_0x3a8a95[_0xd8b7('0x42')];if(!_0x570f65[_0xd8b7('0x44')]['hasOwnProperty']('nolimit')){_0x3b188d[_0xd8b7('0x2d')]=qs[_0xd8b7('0x2d')](_0x570f65['query']['limit']);_0x3b188d[_0xd8b7('0x2b')]=qs[_0xd8b7('0x2b')](_0x570f65[_0xd8b7('0x44')]['offset']);}_0x3b188d['order']=qs[_0xd8b7('0x4b')](_0x570f65[_0xd8b7('0x44')]['sort']);_0x3b188d['where']=qs[_0xd8b7('0x46')](_['pick'](_0x570f65['query'],_0x3a8a95[_0xd8b7('0x46')]));_0x3b188d[_0xd8b7('0x4c')][_0xd8b7('0x62')]=_0x4eb03e['id'];if(_0x570f65[_0xd8b7('0x44')][_0xd8b7('0x4d')]){_0x3b188d[_0xd8b7('0x4c')]=_[_0xd8b7('0x4e')](_0x3b188d['where'],{'$or':_[_0xd8b7('0x43')](_0x3b188d['attributes'],function(_0x30df89){var _0x41659d={};_0x41659d[_0x30df89]={'$like':'%'+_0x570f65['query'][_0xd8b7('0x4d')]+'%'};return _0x41659d;})});}_0x3b188d=_[_0xd8b7('0x4e')]({},_0x3b188d,_0x570f65[_0xd8b7('0x50')]);return db['CannedAnswer']['count']({'where':_0x3b188d[_0xd8b7('0x4c')]})[_0xd8b7('0x34')](function(_0x4763bf){_0xac4a83['count']=_0x4763bf;if(_0x570f65[_0xd8b7('0x44')][_0xd8b7('0x51')]){_0x3b188d['include']=[{'all':!![]}];}return db[_0xd8b7('0x6c')][_0xd8b7('0x52')](_0x3b188d);})[_0xd8b7('0x34')](function(_0x529535){_0xac4a83['rows']=_0x529535;return _0xac4a83;});}})[_0xd8b7('0x34')](respondWithFilteredResult(_0x1c611d,_0x3b188d))[_0xd8b7('0x27')](handleError(_0x1c611d,null));};exports['removeAnswers']=function(_0x1732e3,_0xc5dde7,_0x4cb512){return db['FaxAccount']['find']({'where':{'id':_0x1732e3[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0xc5dde7,null))['then'](function(_0x500497){if(_0x500497){return _0x500497[_0xd8b7('0x6d')](_0x1732e3[_0xd8b7('0x44')]['ids']);}})[_0xd8b7('0x34')](respondWithStatusCode(_0xc5dde7,null))[_0xd8b7('0x27')](handleError(_0xc5dde7,null));};exports[_0xd8b7('0x6e')]=function(_0xf3596c,_0x383b1c,_0x55ebfd){return db[_0xd8b7('0x6f')][_0xd8b7('0x56')]({'where':{'id':_0xf3596c[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x383b1c,null))[_0xd8b7('0x34')](function(_0x3debbb){if(_0x3debbb){return _0x3debbb[_0xd8b7('0x6e')](_0xf3596c[_0xd8b7('0x58')]['ids'],_[_0xd8b7('0x70')](_0xf3596c[_0xd8b7('0x58')],[_0xd8b7('0x6a'),'id'])||{});}})[_0xd8b7('0x34')](respondWithResult(_0x383b1c,null))[_0xd8b7('0x27')](handleError(_0x383b1c,null));};exports[_0xd8b7('0x71')]=function(_0x4f9f55,_0x1b91db,_0x29a57f){var _0x1f8132={'raw':![],'where':{}};var _0x45ad60={};var _0x2c2fe1={'count':0x0,'rows':[]};return db[_0xd8b7('0x3e')]['findOne']({'where':{'id':_0x4f9f55[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x1b91db,null))[_0xd8b7('0x34')](function(_0x287caa){if(_0x287caa){_0x45ad60[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x6f')]['rawAttributes']);_0x45ad60['query']=_[_0xd8b7('0x45')](_0x4f9f55['query']);_0x45ad60[_0xd8b7('0x46')]=_['intersection'](_0x45ad60['model'],_0x45ad60[_0xd8b7('0x44')]);_0x1f8132[_0xd8b7('0x48')]=_[_0xd8b7('0x47')](_0x45ad60[_0xd8b7('0x42')],qs[_0xd8b7('0x49')](_0x4f9f55['query']['fields']));_0x1f8132[_0xd8b7('0x48')]=_0x1f8132[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x1f8132['attributes']:_0x45ad60['model'];if(!_0x4f9f55['query']['hasOwnProperty'](_0xd8b7('0x67'))){_0x1f8132[_0xd8b7('0x2d')]=qs[_0xd8b7('0x2d')](_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x2d')]);_0x1f8132['offset']=qs[_0xd8b7('0x2b')](_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x2b')]);}_0x1f8132[_0xd8b7('0x68')]=qs[_0xd8b7('0x4b')](_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x4b')]);_0x1f8132[_0xd8b7('0x4c')]=qs[_0xd8b7('0x46')](_[_0xd8b7('0x69')](_0x4f9f55[_0xd8b7('0x44')],_0x45ad60[_0xd8b7('0x46')]));_0x1f8132[_0xd8b7('0x4c')][_0xd8b7('0x62')]=_0x287caa['id'];if(_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x4d')]){_0x1f8132[_0xd8b7('0x4c')]=_[_0xd8b7('0x4e')](_0x1f8132[_0xd8b7('0x4c')],{'$or':_[_0xd8b7('0x43')](_0x1f8132['attributes'],function(_0x264cb1){var _0x162642={};_0x162642[_0x264cb1]={'$like':'%'+_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x4d')]+'%'};return _0x162642;})});}_0x1f8132=_[_0xd8b7('0x4e')]({},_0x1f8132,_0x4f9f55[_0xd8b7('0x50')]);return db[_0xd8b7('0x6f')][_0xd8b7('0x2e')]({'where':_0x1f8132['where']})[_0xd8b7('0x34')](function(_0x4af21e){_0x2c2fe1['count']=_0x4af21e;if(_0x4f9f55[_0xd8b7('0x44')]['includeAll']){_0x1f8132[_0xd8b7('0x55')]=[{'model':db[_0xd8b7('0x72')],'as':_0xd8b7('0x73'),'required':![]},{'model':db[_0xd8b7('0x74')],'as':_0xd8b7('0x75'),'attributes':[_0xd8b7('0x39'),'fullname',_0xd8b7('0x76')],'required':![]},{'model':db[_0xd8b7('0x77')],'as':'Tags','attributes':['id','name',_0xd8b7('0x78')],'where':_0x4f9f55[_0xd8b7('0x44')]['tag']?{'id':_0x4f9f55[_0xd8b7('0x44')][_0xd8b7('0x79')]}:undefined,'required':_0x4f9f55[_0xd8b7('0x44')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0xd8b7('0x52')](_0x1f8132);})[_0xd8b7('0x34')](function(_0x4d7018){_0x2c2fe1[_0xd8b7('0x53')]=_0x4d7018;return _0x2c2fe1;});}})[_0xd8b7('0x34')](respondWithFilteredResult(_0x1b91db,_0x1f8132))['catch'](handleError(_0x1b91db,null));};exports[_0xd8b7('0x7a')]=function(_0x2348b9,_0x1b941e){var _0x555a5f=_0x2348b9[_0xd8b7('0x5f')]['id'];var _0x1c2c8c=_0x2348b9['body'];var _0x291a40=0xc8;var _0x3a4b9f=null;return db[_0xd8b7('0x7b')]['transaction']({'isolationLevel':db[_0xd8b7('0x7b')][_0xd8b7('0x7c')][_0xd8b7('0x7d')][_0xd8b7('0x7e')]},function(_0x5ce39f){return db[_0xd8b7('0x3e')][_0xd8b7('0x65')]({'where':{'id':_0x555a5f},'transaction':_0x5ce39f})[_0xd8b7('0x34')](function(_0x417f6c){if(_0x417f6c){return db[_0xd8b7('0x7f')]['destroy']({'where':{'FaxAccountId':_0x555a5f},'transaction':_0x5ce39f})[_0xd8b7('0x34')](function(){var _0x318b25=_['map'](_0x1c2c8c,function(_0x3658ec){_0x3658ec[_0xd8b7('0x62')]=_0x555a5f;return _0x3658ec;});return db[_0xd8b7('0x7f')][_0xd8b7('0x80')](_0x318b25,{'transaction':_0x5ce39f});});}else{_0x291a40=0x194;_0x3a4b9f=[];}});})[_0xd8b7('0x34')](function(){if(_0x291a40!==0x194){return db['FaxApplication'][_0xd8b7('0x81')]({'where':{'FaxAccountId':_0x555a5f},'order':_0xd8b7('0x82')})[_0xd8b7('0x34')](function(_0x5d3e04){_0x3a4b9f=_0x5d3e04;});}})[_0xd8b7('0x27')](function(_0x58cc19){_0x291a40=0x1f4;logger[_0xd8b7('0x23')](_0x58cc19[_0xd8b7('0x83')]);if(_0x58cc19[_0xd8b7('0x39')]){delete _0x58cc19[_0xd8b7('0x39')];}_0x3a4b9f=_0x58cc19;})[_0xd8b7('0x84')](function(){if(_0x3a4b9f===null){_0x1b941e[_0xd8b7('0x85')](_0x291a40);}else{if(_0x291a40===0x1f4){_0x1b941e[_0xd8b7('0x28')](_0x291a40)[_0xd8b7('0x3a')](_0x3a4b9f);}else{_0x1b941e[_0xd8b7('0x28')](_0x291a40)[_0xd8b7('0x2a')](_0x3a4b9f);}}});};exports[_0xd8b7('0x86')]=function(_0x596a84,_0x44784f,_0x39adb1){var _0x374392={};var _0x558fc7={};var _0x430180;var _0x18dcc2;return db[_0xd8b7('0x3e')][_0xd8b7('0x65')]({'where':{'id':_0x596a84[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x44784f,null))[_0xd8b7('0x34')](function(_0x244063){if(_0x244063){_0x430180=_0x244063;_0x558fc7[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x7f')][_0xd8b7('0x3f')]);_0x558fc7[_0xd8b7('0x44')]=_['keys'](_0x596a84[_0xd8b7('0x44')]);_0x558fc7[_0xd8b7('0x46')]=_[_0xd8b7('0x47')](_0x558fc7['model'],_0x558fc7[_0xd8b7('0x44')]);_0x374392[_0xd8b7('0x48')]=_[_0xd8b7('0x47')](_0x558fc7[_0xd8b7('0x42')],qs[_0xd8b7('0x49')](_0x596a84[_0xd8b7('0x44')][_0xd8b7('0x49')]));_0x374392[_0xd8b7('0x48')]=_0x374392[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x374392[_0xd8b7('0x48')]:_0x558fc7[_0xd8b7('0x42')];_0x374392[_0xd8b7('0x68')]=qs['sort'](_0x596a84[_0xd8b7('0x44')][_0xd8b7('0x4b')]);_0x374392[_0xd8b7('0x4c')]=qs[_0xd8b7('0x46')](_['pick'](_0x596a84[_0xd8b7('0x44')],_0x558fc7[_0xd8b7('0x46')]));if(_0x596a84['query']['filter']){_0x374392[_0xd8b7('0x4c')]=_[_0xd8b7('0x4e')](_0x374392['where'],{'$or':_[_0xd8b7('0x43')](_0x374392[_0xd8b7('0x48')],function(_0x514c06){var _0xba286c={};_0xba286c[_0x514c06]={'$like':'%'+_0x596a84[_0xd8b7('0x44')]['filter']+'%'};return _0xba286c;})});}_0x374392=_[_0xd8b7('0x4e')]({},_0x374392,_0x596a84[_0xd8b7('0x50')]);return _0x430180['getApplications'](_0x374392);}})[_0xd8b7('0x34')](function(_0xaa7ebc){if(_0xaa7ebc){_0x18dcc2=_0xaa7ebc[_0xd8b7('0x4a')];if(!_0x596a84['query'][_0xd8b7('0x66')](_0xd8b7('0x67'))){_0x374392[_0xd8b7('0x2d')]=qs['limit'](_0x596a84['query'][_0xd8b7('0x2d')]);_0x374392[_0xd8b7('0x2b')]=qs[_0xd8b7('0x2b')](_0x596a84[_0xd8b7('0x44')]['offset']);}return _0x430180[_0xd8b7('0x86')](_0x374392);}})[_0xd8b7('0x34')](function(_0x37afcb){if(_0x37afcb){return _0x37afcb?{'count':_0x18dcc2,'rows':_0x37afcb}:null;}})[_0xd8b7('0x34')](respondWithResult(_0x44784f,null))[_0xd8b7('0x27')](handleError(_0x44784f,null));};function Extension(_0x58ebe7,_0x44804b,_0x54d13a,_0x355c34){this[_0xd8b7('0x87')]=_0xd8b7('0x88');this[_0xd8b7('0x89')]=_0x58ebe7[_0xd8b7('0x8a')];this[_0xd8b7('0x8b')]=_0x355c34;this[_0xd8b7('0x4f')]='system';this[_0xd8b7('0x8c')]=_0xd8b7('0x8d');this['FaxAccountId']=_0x58ebe7['id'];this[_0xd8b7('0x82')]=_0x44804b;this[_0xd8b7('0x8e')]=_0x54d13a;}function createExtensionsReciveFax(_0x151254){var _0x213527=0x1;var _0x2d7471=[];_0x2d7471['push'](new Extension(_0x151254,_0x213527,'',_0xd8b7('0x8f')));_0x213527+=0x1;_0x2d7471[_0xd8b7('0x90')](new Extension(_0x151254,_0x213527,_0xd8b7('0x91'),_0xd8b7('0x92')));_0x213527+=0x1;for(var _0x573337 in _0x151254){if(_0x151254[_0xd8b7('0x66')](_0x573337)&&(_0x573337===_0xd8b7('0x93')||_0x573337===_0xd8b7('0x8a')||_0x573337===_0xd8b7('0x94')||_0x573337===_0xd8b7('0x95')||_0x573337===_0xd8b7('0x96')||_0x573337===_0xd8b7('0x97')||_0x573337==='minrate'||_0x573337===_0xd8b7('0x98')||_0x573337===_0xd8b7('0x99'))){_0x2d7471[_0xd8b7('0x90')](new Extension(_0x151254,_0x213527,_0xd8b7('0x9a')+_0x573337+')='+_0x151254[_0x573337],'Set'));_0x213527+=0x1;}}_0x2d7471[_0xd8b7('0x90')](new Extension(_0x151254,_0x213527,'6',_0xd8b7('0x9b')));_0x213527+=0x1;_0x2d7471['push'](new Extension(_0x151254,_0x213527,_0xd8b7('0x9c'),'ReceiveFax'));_0x213527=0x0;return _0x2d7471;}exports[_0xd8b7('0x9d')]=function(_0x2a96db,_0x520e32,_0x3443f3){var _0x558d51;return db[_0xd8b7('0x7b')][_0xd8b7('0x9e')](function(_0x3b32d3){return db[_0xd8b7('0x3e')]['create'](_0x2a96db[_0xd8b7('0x58')],{'transaction':_0x3b32d3})['then'](function(_0xd28429){_0x558d51=_0xd28429[_0xd8b7('0x36')]({'plain':!![]});return db[_0xd8b7('0x9f')][_0xd8b7('0x80')](createExtensionsReciveFax(_0x558d51),{'transaction':_0x3b32d3});});})['then'](function(){return _0x558d51;})['then'](respondWithResult(_0x520e32,null))[_0xd8b7('0x27')](handleError(_0x520e32,null));};exports['updateAccountApplications']=function(_0x58d8c0,_0x45a871,_0x395eb8){var _0x19286a;return db[_0xd8b7('0x7b')][_0xd8b7('0x9e')](function(_0x408b14){return db[_0xd8b7('0x3e')][_0xd8b7('0x33')](_0x58d8c0[_0xd8b7('0x58')],{'where':{'id':_0x58d8c0[_0xd8b7('0x58')]['id']},'transaction':_0x408b14})[_0xd8b7('0x34')](function(_0x8db78d){return db['VoiceExtension'][_0xd8b7('0x35')]({'where':{'FaxAccountId':_0x58d8c0[_0xd8b7('0x58')]['id']},'transaction':_0x408b14})[_0xd8b7('0x34')](function(_0x442cdb){return db[_0xd8b7('0x9f')][_0xd8b7('0x80')](createExtensionsReciveFax(_[_0xd8b7('0x70')](_0x58d8c0[_0xd8b7('0x58')],[_0xd8b7('0xa0'),_0xd8b7('0x41'),_0xd8b7('0xa1'),_0xd8b7('0xa2'),_0xd8b7('0xa3'),_0xd8b7('0xa4')])),{'transaction':_0x408b14});});});})[_0xd8b7('0x34')](function(){return db[_0xd8b7('0x3e')][_0xd8b7('0xa5')](_0x58d8c0[_0xd8b7('0x58')]['id']);})['then'](respondWithResult(_0x45a871,null))[_0xd8b7('0x27')](handleError(_0x45a871,null));};exports[_0xd8b7('0xa6')]=function(_0x43dbae,_0xd9521a,_0x550d5d){var _0x1e95ae={'raw':!![],'where':{}};var _0x3425ec={};var _0x565b35={'count':0x0,'rows':[]};return db[_0xd8b7('0x3e')][_0xd8b7('0x65')]({'where':{'id':_0x43dbae[_0xd8b7('0x5f')]['id']}})['then'](handleEntityNotFound(_0xd9521a,null))['then'](function(_0x40294a){if(_0x40294a){_0x3425ec[_0xd8b7('0x42')]=_['keys'](db[_0xd8b7('0xa7')][_0xd8b7('0x3f')]);_0x3425ec[_0xd8b7('0x44')]=_[_0xd8b7('0x45')](_0x43dbae['query']);_0x3425ec[_0xd8b7('0x46')]=_[_0xd8b7('0x47')](_0x3425ec['model'],_0x3425ec['query']);_0x1e95ae['attributes']=_[_0xd8b7('0x47')](_0x3425ec['model'],qs[_0xd8b7('0x49')](_0x43dbae[_0xd8b7('0x44')]['fields']));_0x1e95ae[_0xd8b7('0x48')]=_0x1e95ae['attributes'][_0xd8b7('0x4a')]?_0x1e95ae['attributes']:_0x3425ec[_0xd8b7('0x42')];if(!_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0x66')](_0xd8b7('0x67'))){_0x1e95ae[_0xd8b7('0x2d')]=qs[_0xd8b7('0x2d')](_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0x2d')]);_0x1e95ae[_0xd8b7('0x2b')]=qs[_0xd8b7('0x2b')](_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0x2b')]);}_0x1e95ae[_0xd8b7('0x68')]=qs[_0xd8b7('0x4b')](_0x43dbae[_0xd8b7('0x44')]['sort']);_0x1e95ae[_0xd8b7('0x4c')]=qs['filters'](_[_0xd8b7('0x69')](_0x43dbae[_0xd8b7('0x44')],_0x3425ec[_0xd8b7('0x46')]));_0x1e95ae['where'][_0xd8b7('0x62')]=_0x40294a['id'];if(_0x43dbae[_0xd8b7('0x44')]['filter']){_0x1e95ae['where']=_[_0xd8b7('0x4e')](_0x1e95ae['where'],{'$or':_[_0xd8b7('0x43')](_0x1e95ae[_0xd8b7('0x48')],function(_0x4b7a43){var _0xf1c54d={};_0xf1c54d[_0x4b7a43]={'$like':'%'+_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0x4d')]+'%'};return _0xf1c54d;})});}if(_0x43dbae['query'][_0xd8b7('0xa8')]){var _0x172c31=_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0xa8')][_0xd8b7('0xa9')](',');var _0x17bf5c={};_0x17bf5c[_0x172c31[0x0]]={'$gte':moment(_0x172c31[0x1])['format'](_0xd8b7('0xaa'))};_0x1e95ae[_0xd8b7('0x4c')]=_['merge'](_0x1e95ae[_0xd8b7('0x4c')],_0x17bf5c);}_0x1e95ae=_[_0xd8b7('0x4e')]({},_0x1e95ae,_0x43dbae[_0xd8b7('0x50')]);return db[_0xd8b7('0xa7')][_0xd8b7('0x2e')]({'where':_0x1e95ae[_0xd8b7('0x4c')]})['then'](function(_0x59335a){_0x565b35['count']=_0x59335a;if(_0x43dbae[_0xd8b7('0x44')][_0xd8b7('0x51')]){_0x1e95ae[_0xd8b7('0x55')]=[{'all':!![]}];}return db[_0xd8b7('0xa7')]['findAll'](_0x1e95ae);})[_0xd8b7('0x34')](function(_0x336eb6){_0x565b35[_0xd8b7('0x53')]=_0x336eb6;return _0x565b35;});}})[_0xd8b7('0x34')](respondWithFilteredResult(_0xd9521a,_0x1e95ae))[_0xd8b7('0x27')](handleError(_0xd9521a,null));};exports[_0xd8b7('0x3a')]=function(_0x2ad62f,_0x1ea2e9,_0x222e09){var _0x27b9d3,_0x2afdbb={},_0x1f44db;if(_0x2ad62f[_0xd8b7('0x58')]['to']){_0x1f44db=_0x2ad62f[_0xd8b7('0x58')]['to'][0x0];}return db['FaxAccount'][_0xd8b7('0x56')]({'where':{'id':_0x2ad62f[_0xd8b7('0x5f')]['id']},'include':[{'model':db[_0xd8b7('0xab')],'as':_0xd8b7('0xac'),'include':[{'model':db[_0xd8b7('0x72')],'as':_0xd8b7('0xad'),'where':{'fax':_0x1f44db},'limit':0x1,'order':[[_0xd8b7('0xa2'),_0xd8b7('0xae')]]}]}]})['then'](handleEntityNotFound(_0x1ea2e9,null))['then'](function(_0x479499){_0x27b9d3=_0x479499;if(_0x2ad62f[_0xd8b7('0x58')]['attachments']&&_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][_0xd8b7('0x4a')]){for(var _0x32587f=0x0;_0x32587f<_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')]['length'];_0x32587f+=0x1){_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][_0x32587f]={'filename':_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][_0x32587f][_0xd8b7('0x39')],'id':_0x2ad62f['body']['attachments'][_0x32587f]['id'],'path':path['join'](config[_0xd8b7('0xb0')],_0xd8b7('0xb1'),_0x2ad62f[_0xd8b7('0x58')]['attachments'][_0x32587f]['basename'])};}}return respondWithRpcPromise(_0xd8b7('0xb2'),_0xd8b7('0xb2'),{'FaxAccountId':_[_0xd8b7('0xb3')](_0x2ad62f[_0xd8b7('0x5f')]['id'])?undefined:_0x2ad62f[_0xd8b7('0x5f')]['id'],'path':_[_0xd8b7('0xb3')](_0x2ad62f[_0xd8b7('0x58')]['attachments'][0x0][_0xd8b7('0x6')])?undefined:_0x2ad62f['body']['attachments'][0x0][_0xd8b7('0x6')],'fax':_[_0xd8b7('0xb3')](_0x2ad62f[_0xd8b7('0x58')]['to'][0x0])?undefined:_0x2ad62f['body']['to'][0x0]},client9002);})['then'](function(){if(_0x27b9d3){if(_['isNil'](_0x2ad62f[_0xd8b7('0x58')]['from'])){_0x2ad62f[_0xd8b7('0x58')]['from']=util[_0xd8b7('0xb4')](_0xd8b7('0xb5'),_0x27b9d3[_0xd8b7('0x39')],_0x27b9d3[_0xd8b7('0xb6')]);}if(_0x27b9d3['List']){if(_0x27b9d3['List'][_0xd8b7('0xad')][_0xd8b7('0x4a')]){return _0x27b9d3[_0xd8b7('0xac')]['Contacts'][0x0];}else{return db[_0xd8b7('0x72')][_0xd8b7('0x57')](_[_0xd8b7('0xb7')](_0x2ad62f[_0xd8b7('0x58')],{'firstName':_0x2ad62f[_0xd8b7('0x58')]['to'][0x0],'phone':_0x2ad62f[_0xd8b7('0x58')]['to'][0x0],'fax':_0x2ad62f[_0xd8b7('0x58')]['to'][0x0],'ListId':_0x27b9d3[_0xd8b7('0xa4')]}));}}else{throw new Error(_0xd8b7('0xb8'));}}else{throw new Error(_0xd8b7('0xb9'));}})[_0xd8b7('0x34')](function(_0x4895e3){if(_0x4895e3){return db[_0xd8b7('0x6f')]['find']({'where':{'ContactId':_0x4895e3['id'],'closed':![],'FaxAccountId':_0x27b9d3['id']}})[_0xd8b7('0x34')](function(_0x455d79){if(_0x455d79){return[_0x455d79,![]];}return db['FaxInteraction'][_0xd8b7('0x57')]({'UserId':_0x2ad62f[_0xd8b7('0x59')]['id'],'ContactId':_0x4895e3['id'],'FaxAccountId':_0x27b9d3['id'],'fax':_0x2ad62f[_0xd8b7('0x58')]['to'][0x0],'firstMsgDirection':_0xd8b7('0xba'),'Messages':[_[_0xd8b7('0x4e')](_0x2ad62f[_0xd8b7('0x58')],{'read':![],'body':_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][0x0]['filename'],'FaxAccountId':_0x27b9d3['id'],'UserId':_0x2ad62f[_0xd8b7('0x59')]['id'],'ContactId':_0x4895e3['id'],'AttachmentId':_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd8b7('0xbb')}]})[_0xd8b7('0x34')](function(_0x1966c1){return[_0x1966c1,!![]];});});}else{throw new Error(_0xd8b7('0xbc'));}})[_0xd8b7('0xbd')](function(_0x3f5561,_0x5d7e45){if(_0x5d7e45){return _0x3f5561;}return db[_0xd8b7('0xa7')]['create']({'direction':_0xd8b7('0xba'),'read':![],'body':_0x2ad62f[_0xd8b7('0x58')]['attachments'][0x0][_0xd8b7('0xbe')],'FaxAccountId':_0x27b9d3['id'],'FaxInteractionId':_0x3f5561['id'],'UserId':_0x2ad62f[_0xd8b7('0x59')]['id'],'ContactId':_0x3f5561[_0xd8b7('0xbf')],'AttachmentId':_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][0x0]['id']})['then'](function(_0x69228d){_0x3f5561[_0xd8b7('0xc0')][_0xd8b7('0xbb')]=[];_0x3f5561[_0xd8b7('0xc0')]['Messages'][_0xd8b7('0x90')](_0x69228d[_0xd8b7('0xc0')]);return _0x3f5561;});})[_0xd8b7('0x34')](function(_0x44dd2c){respondWithRpcPromise(_0xd8b7('0xc1'),'SendFax',{'FaxAccountId':_[_0xd8b7('0xb3')](_0x2ad62f[_0xd8b7('0x5f')]['id'])?undefined:_0x2ad62f[_0xd8b7('0x5f')]['id'],'path':_['isNil'](_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][0x0][_0xd8b7('0x6')])?undefined:_0x2ad62f[_0xd8b7('0x58')][_0xd8b7('0xaf')][0x0][_0xd8b7('0x6')],'fax':_[_0xd8b7('0xb3')](_0x2ad62f['body']['to'][0x0])?undefined:_0x2ad62f['body']['to'][0x0],'AttachmentId':_0x2ad62f[_0xd8b7('0x58')]['attachments'][0x0]['id']},client9002)[_0xd8b7('0x34')](function(_0x1cfb00){logger[_0xd8b7('0x1e')](_0xd8b7('0xc2'),_0x1cfb00);})[_0xd8b7('0x27')](function(_0x15278e){logger[_0xd8b7('0x1e')](_0xd8b7('0xc2'),_0x15278e);});return _0x44dd2c;})[_0xd8b7('0x34')](respondWithResult(_0x1ea2e9,null))[_0xd8b7('0x27')](handleError(_0x1ea2e9,null));};exports[_0xd8b7('0xc3')]=function(_0x288742,_0x457d46,_0x50663d){return db[_0xd8b7('0x3e')][_0xd8b7('0x56')]({'where':{'id':_0x288742[_0xd8b7('0x5f')]['id']}})[_0xd8b7('0x34')](handleEntityNotFound(_0x457d46,null))[_0xd8b7('0x34')](function(_0x2aab12){if(_0x2aab12){return _0x2aab12[_0xd8b7('0xc3')](_0x288742[_0xd8b7('0x58')][_0xd8b7('0x6a')],_[_0xd8b7('0x70')](_0x288742[_0xd8b7('0x58')],[_0xd8b7('0x6a'),'id'])||{})['spread'](function(_0x2c3d73){for(var _0x38a4a9=0x0;_0x38a4a9<_0x288742['body'][_0xd8b7('0x6a')][_0xd8b7('0x4a')];_0x38a4a9+=0x1){socket[_0xd8b7('0xc4')](_0xd8b7('0xc5'),{'UserId':Number(_0x288742['body'][_0xd8b7('0x6a')][_0x38a4a9]),'FaxAccountId':Number(_0x288742[_0xd8b7('0x5f')]['id'])});}return _0x2c3d73;});}})[_0xd8b7('0x34')](respondWithResult(_0x457d46,null))[_0xd8b7('0x27')](handleError(_0x457d46,null));};exports['removeAgents']=function(_0x9b4af7,_0x3bcca6,_0x49f18a){return db[_0xd8b7('0x3e')]['find']({'where':{'id':_0x9b4af7['params']['id']}})['then'](handleEntityNotFound(_0x3bcca6,null))[_0xd8b7('0x34')](function(_0x5bdd75){if(_0x5bdd75){return _0x5bdd75[_0xd8b7('0xc6')](_0x9b4af7[_0xd8b7('0x44')][_0xd8b7('0x6a')])[_0xd8b7('0x34')](function(){if(_['isArray'](_0x9b4af7[_0xd8b7('0x44')][_0xd8b7('0x6a')])){for(var _0x359091=0x0;_0x359091<_0x9b4af7[_0xd8b7('0x44')][_0xd8b7('0x6a')][_0xd8b7('0x4a')];_0x359091+=0x1){socket['emit'](_0xd8b7('0xc7'),{'UserId':Number(_0x9b4af7[_0xd8b7('0x44')][_0xd8b7('0x6a')][_0x359091]),'FaxAccountId':Number(_0x9b4af7[_0xd8b7('0x5f')]['id'])});}}else{socket[_0xd8b7('0xc4')](_0xd8b7('0xc7'),{'UserId':Number(_0x9b4af7[_0xd8b7('0x44')][_0xd8b7('0x6a')]),'FaxAccountId':Number(_0x9b4af7[_0xd8b7('0x5f')]['id'])});}});}})[_0xd8b7('0x34')](respondWithStatusCode(_0x3bcca6,null))[_0xd8b7('0x27')](handleError(_0x3bcca6,null));};exports[_0xd8b7('0xc8')]=function(_0x3e95a7,_0x5de576,_0x483856){var _0x4e810b={};var _0x1151ca={};var _0x28dea8;var _0x458eb5;return db[_0xd8b7('0x3e')]['findOne']({'where':{'id':_0x3e95a7['params']['id']}})['then'](handleEntityNotFound(_0x5de576,null))[_0xd8b7('0x34')](function(_0x5902f1){if(_0x5902f1){_0x28dea8=_0x5902f1;_0x1151ca[_0xd8b7('0x42')]=_[_0xd8b7('0x45')](db[_0xd8b7('0x74')][_0xd8b7('0x3f')]);_0x1151ca['query']=_['keys'](_0x3e95a7['query']);_0x1151ca['filters']=_['intersection'](_0x1151ca[_0xd8b7('0x42')],_0x1151ca['query']);_0x4e810b[_0xd8b7('0x48')]=_['intersection'](_0x1151ca[_0xd8b7('0x42')],qs['fields'](_0x3e95a7['query'][_0xd8b7('0x49')]));_0x4e810b[_0xd8b7('0x48')]=_0x4e810b[_0xd8b7('0x48')][_0xd8b7('0x4a')]?_0x4e810b[_0xd8b7('0x48')]:_0x1151ca['model'];_0x4e810b['order']=qs['sort'](_0x3e95a7['query']['sort']);_0x4e810b[_0xd8b7('0x4c')]=qs['filters'](_['pick'](_0x3e95a7['query'],_0x1151ca[_0xd8b7('0x46')]));if(_0x3e95a7[_0xd8b7('0x44')][_0xd8b7('0x4d')]){_0x4e810b['where']=_[_0xd8b7('0x4e')](_0x4e810b[_0xd8b7('0x4c')],{'$or':_[_0xd8b7('0x43')](_0x4e810b[_0xd8b7('0x48')],function(_0x52838f){var _0x15ba31={};_0x15ba31[_0x52838f]={'$like':'%'+_0x3e95a7[_0xd8b7('0x44')][_0xd8b7('0x4d')]+'%'};return _0x15ba31;})});}_0x4e810b=_[_0xd8b7('0x4e')]({},_0x4e810b,_0x3e95a7[_0xd8b7('0x50')]);return _0x28dea8[_0xd8b7('0xc8')](_0x4e810b);}})[_0xd8b7('0x34')](function(_0x1bfbae){if(_0x1bfbae){_0x458eb5=_0x1bfbae['length'];if(!_0x3e95a7[_0xd8b7('0x44')][_0xd8b7('0x66')](_0xd8b7('0x67'))){_0x4e810b[_0xd8b7('0x2d')]=qs['limit'](_0x3e95a7[_0xd8b7('0x44')][_0xd8b7('0x2d')]);_0x4e810b[_0xd8b7('0x2b')]=qs[_0xd8b7('0x2b')](_0x3e95a7[_0xd8b7('0x44')][_0xd8b7('0x2b')]);}return _0x28dea8[_0xd8b7('0xc8')](_0x4e810b);}})['then'](function(_0x368c6c){if(_0x368c6c){return _0x368c6c?{'count':_0x458eb5,'rows':_0x368c6c}:null;}})['then'](respondWithResult(_0x5de576,null))[_0xd8b7('0x27')](handleError(_0x5de576,null));}; \ No newline at end of file +var _0xdd7f=['redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','FaxAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','filter','where','merge','map','VIRTUAL','options','findAll','params','includeAll','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','pick','include','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addInteraction','FaxInteraction','omit','CmContact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','context','system','priority','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','maxrate','minrate','modem','t38timeout','/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','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xdd7f,0xa9));var _0xfdd7=function(_0x5a5176,_0x1c5f42){_0x5a5176=_0x5a5176-0x0;var _0x1b9968=_0xdd7f[_0x5a5176];return _0x1b9968;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdd7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd7('0x1'));var moment=require('moment');var BPromise=require(_0xfdd7('0x2'));var Mustache=require(_0xfdd7('0x3'));var util=require(_0xfdd7('0x4'));var path=require(_0xfdd7('0x5'));var sox=require(_0xfdd7('0x6'));var csv=require(_0xfdd7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfdd7('0x8'));var _=require(_0xfdd7('0x9'));var squel=require(_0xfdd7('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd7('0xb'));var deskjs=require(_0xfdd7('0xc'));var toCsv=require(_0xfdd7('0x7'));var querystring=require('querystring');var Papa=require(_0xfdd7('0xd'));var Redis=require(_0xfdd7('0xe'));var authService=require(_0xfdd7('0xf'));var qs=require(_0xfdd7('0x10'));var as=require(_0xfdd7('0x11'));var hardwareService=require(_0xfdd7('0x12'));var logger=require(_0xfdd7('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfdd7('0x14'));var db=require('../../mysqldb')['db'];config[_0xfdd7('0x15')]=_[_0xfdd7('0x16')](config[_0xfdd7('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd7('0x17'))(new Redis(config['redis']));require(_0xfdd7('0x18'))[_0xfdd7('0x19')](socket);var jayson=require(_0xfdd7('0x1a'));var client=jayson[_0xfdd7('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0xfdd7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1874c1,_0x298f90,_0x30aee1,_0x5de818){return new BPromise(function(_0x21449a,_0x2557f8){var _0x259b8c=_0x5de818||client;return _0x259b8c[_0xfdd7('0x1d')](_0x1874c1,_0x30aee1)[_0xfdd7('0x1e')](function(_0x18b2cc){logger[_0xfdd7('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x298f90,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x298f90,_0xfdd7('0x20'),JSON[_0xfdd7('0x21')](_0x18b2cc));if(_0x18b2cc[_0xfdd7('0x22')]){if(_0x18b2cc[_0xfdd7('0x22')][_0xfdd7('0x23')]===0x1f4){logger[_0xfdd7('0x22')](_0xfdd7('0x24'),_0x298f90,_0x18b2cc[_0xfdd7('0x22')][_0xfdd7('0x25')]);return _0x2557f8(_0x18b2cc[_0xfdd7('0x22')][_0xfdd7('0x25')]);}logger[_0xfdd7('0x22')](_0xfdd7('0x24'),_0x298f90,_0x18b2cc[_0xfdd7('0x22')][_0xfdd7('0x25')]);return _0x21449a(_0x18b2cc[_0xfdd7('0x22')][_0xfdd7('0x25')]);}else{logger[_0xfdd7('0x1f')](_0xfdd7('0x24'),_0x298f90,_0xfdd7('0x20'));_0x21449a(_0x18b2cc[_0xfdd7('0x26')][_0xfdd7('0x25')]);}})['catch'](function(_0x1ad7c3){logger[_0xfdd7('0x22')]('FaxAccount,\x20%s,\x20%s',_0x298f90,_0x1ad7c3);_0x2557f8(_0x1ad7c3);});});}function respondWithStatusCode(_0x5a8522,_0x218154){_0x218154=_0x218154||0xcc;return function(_0x583c31){if(_0x583c31){return _0x5a8522[_0xfdd7('0x27')](_0x218154);}return _0x5a8522[_0xfdd7('0x28')](_0x218154)[_0xfdd7('0x29')]();};}function respondWithResult(_0x5e8cf1,_0x183d82){_0x183d82=_0x183d82||0xc8;return function(_0x307431){if(_0x307431){return _0x5e8cf1['status'](_0x183d82)[_0xfdd7('0x2a')](_0x307431);}};}function respondWithFilteredResult(_0x29b869,_0x59ef9e){return function(_0x4c56ff){if(_0x4c56ff){var _0x377ed7=typeof _0x59ef9e['offset']===_0xfdd7('0x2b')&&typeof _0x59ef9e['limit']==='undefined';var _0xe63080=_0x4c56ff[_0xfdd7('0x2c')];var _0x1f0502=_0x377ed7?0x0:_0x59ef9e['offset'];var _0x452f91=_0x377ed7?_0x4c56ff[_0xfdd7('0x2c')]:_0x59ef9e['offset']+_0x59ef9e[_0xfdd7('0x2d')];var _0x3c00d4;if(_0x452f91>=_0xe63080){_0x452f91=_0xe63080;_0x3c00d4=0xc8;}else{_0x3c00d4=0xce;}_0x29b869[_0xfdd7('0x28')](_0x3c00d4);return _0x29b869[_0xfdd7('0x2e')](_0xfdd7('0x2f'),_0x1f0502+'-'+_0x452f91+'/'+_0xe63080)['json'](_0x4c56ff);}return null;};}function patchUpdates(_0x50566a){return function(_0x588654){try{jsonpatch[_0xfdd7('0x30')](_0x588654,_0x50566a,!![]);}catch(_0x24b440){return BPromise[_0xfdd7('0x31')](_0x24b440);}return _0x588654['save']();};}function saveUpdates(_0x59f97a,_0x18927f){return function(_0x16e3cd){if(_0x16e3cd){return _0x16e3cd[_0xfdd7('0x32')](_0x59f97a)[_0xfdd7('0x1e')](function(_0x4247d9){return _0x4247d9;});}return null;};}function removeEntity(_0x1b7099,_0x1de865){return function(_0x93698a){if(_0x93698a){return _0x93698a[_0xfdd7('0x33')]()['then'](function(){var _0x47b608=_0x93698a[_0xfdd7('0x34')]({'plain':!![]});var _0x413bfa=_0xfdd7('0x35');return db['UserProfileResource'][_0xfdd7('0x33')]({'where':{'type':_0x413bfa,'resourceId':_0x47b608['id']}})['then'](function(){return _0x93698a;});})['then'](function(){_0x1b7099[_0xfdd7('0x28')](0xcc)[_0xfdd7('0x29')]();});}};}function handleEntityNotFound(_0x1aa097,_0x51942b){return function(_0x473518){if(!_0x473518){_0x1aa097['sendStatus'](0x194);}return _0x473518;};}function handleError(_0x501f1a,_0x1c1251){_0x1c1251=_0x1c1251||0x1f4;return function(_0x2e885b){logger[_0xfdd7('0x22')](_0x2e885b[_0xfdd7('0x36')]);if(_0x2e885b[_0xfdd7('0x37')]){delete _0x2e885b[_0xfdd7('0x37')];}_0x501f1a[_0xfdd7('0x28')](_0x1c1251)[_0xfdd7('0x38')](_0x2e885b);};}exports[_0xfdd7('0x39')]=function(_0x57ffd5,_0x40bc36){var _0x142951={'include':[{'model':db[_0xfdd7('0x3a')],'as':_0xfdd7('0x3b')}]},_0x1b5560={},_0x3161fa={'count':0x0,'rows':[]};var _0x4aa04f=_['map'](db[_0xfdd7('0x3c')][_0xfdd7('0x3d')],function(_0x210f78){return{'name':_0x210f78['fieldName'],'type':_0x210f78[_0xfdd7('0x3e')]['key']};});_0x1b5560['model']=_['map'](_0x4aa04f,'name');_0x1b5560[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x57ffd5['query']);_0x1b5560['filters']=_[_0xfdd7('0x41')](_0x1b5560['model'],_0x1b5560[_0xfdd7('0x3f')]);_0x142951[_0xfdd7('0x42')]=_[_0xfdd7('0x41')](_0x1b5560[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x57ffd5[_0xfdd7('0x3f')]['fields']));_0x142951[_0xfdd7('0x42')]=_0x142951[_0xfdd7('0x42')][_0xfdd7('0x45')]?_0x142951[_0xfdd7('0x42')]:_0x1b5560[_0xfdd7('0x43')];if(!_0x57ffd5[_0xfdd7('0x3f')][_0xfdd7('0x46')](_0xfdd7('0x47'))){_0x142951['limit']=qs['limit'](_0x57ffd5['query'][_0xfdd7('0x2d')]);_0x142951[_0xfdd7('0x48')]=qs[_0xfdd7('0x48')](_0x57ffd5[_0xfdd7('0x3f')][_0xfdd7('0x48')]);}_0x142951[_0xfdd7('0x49')]=qs[_0xfdd7('0x4a')](_0x57ffd5[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0x142951['where']=qs[_0xfdd7('0x4b')](_['pick'](_0x57ffd5[_0xfdd7('0x3f')],_0x1b5560[_0xfdd7('0x4b')]),_0x4aa04f);if(_0x57ffd5[_0xfdd7('0x3f')][_0xfdd7('0x4c')]){_0x142951[_0xfdd7('0x4d')]=_[_0xfdd7('0x4e')](_0x142951[_0xfdd7('0x4d')],{'$or':_[_0xfdd7('0x4f')](_0x4aa04f,function(_0x19afb3){if(_0x19afb3[_0xfdd7('0x3e')]!==_0xfdd7('0x50')){var _0x3ff740={};_0x3ff740[_0x19afb3['name']]={'$like':'%'+_0x57ffd5[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x3ff740;}})});}_0x142951=_[_0xfdd7('0x4e')]({},_0x142951,_0x57ffd5[_0xfdd7('0x51')]);var _0x252c83={'where':_0x142951[_0xfdd7('0x4d')]};return db['FaxAccount']['count'](_0x252c83)[_0xfdd7('0x1e')](function(_0x4f8d05){_0x3161fa[_0xfdd7('0x2c')]=_0x4f8d05;if(_0x57ffd5[_0xfdd7('0x3f')]['includeAll']){_0x142951['include']=[{'all':!![]}];}return db[_0xfdd7('0x3c')][_0xfdd7('0x52')](_0x142951);})[_0xfdd7('0x1e')](function(_0x9cf50c){_0x3161fa['rows']=_0x9cf50c;return _0x3161fa;})['then'](respondWithFilteredResult(_0x40bc36,_0x142951))['catch'](handleError(_0x40bc36,null));};exports['show']=function(_0x35a48e,_0x2e1063){var _0x2dcfef={'raw':![],'where':{'id':_0x35a48e[_0xfdd7('0x53')]['id']},'include':[{'model':db[_0xfdd7('0x3a')],'as':_0xfdd7('0x3b')}]},_0x311911={};_0x311911[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db[_0xfdd7('0x3c')][_0xfdd7('0x3d')]);_0x311911[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x35a48e[_0xfdd7('0x3f')]);_0x311911['filters']=_['intersection'](_0x311911[_0xfdd7('0x43')],_0x311911[_0xfdd7('0x3f')]);_0x2dcfef[_0xfdd7('0x42')]=_['intersection'](_0x311911[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x35a48e['query'][_0xfdd7('0x44')]));_0x2dcfef[_0xfdd7('0x42')]=_0x2dcfef[_0xfdd7('0x42')]['length']?_0x2dcfef['attributes']:_0x311911[_0xfdd7('0x43')];if(_0x35a48e['query'][_0xfdd7('0x54')]){_0x2dcfef['include']=[{'all':!![]}];}_0x2dcfef=_[_0xfdd7('0x4e')]({},_0x2dcfef,_0x35a48e[_0xfdd7('0x51')]);return db[_0xfdd7('0x3c')]['find'](_0x2dcfef)[_0xfdd7('0x1e')](handleEntityNotFound(_0x2e1063,null))['then'](respondWithResult(_0x2e1063,null))[_0xfdd7('0x55')](handleError(_0x2e1063,null));};exports[_0xfdd7('0x56')]=function(_0x5c85b2,_0x59a63b){return db[_0xfdd7('0x3c')][_0xfdd7('0x56')](_0x5c85b2['body'],{})[_0xfdd7('0x1e')](function(_0x4a9439){var _0x422666=_0x5c85b2['user'][_0xfdd7('0x34')]({'plain':!![]});if(!_0x422666)throw new Error(_0xfdd7('0x57'));if(_0x422666[_0xfdd7('0x58')]===_0xfdd7('0x59')){var _0x3dc8ea=_0x4a9439['get']({'plain':!![]});var _0x2021f7=_0xfdd7('0x35');return db[_0xfdd7('0x5a')][_0xfdd7('0x5b')]({'where':{'name':_0x2021f7,'userProfileId':_0x422666['userProfileId']},'raw':!![]})[_0xfdd7('0x1e')](function(_0x2a571f){if(_0x2a571f&&_0x2a571f[_0xfdd7('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3dc8ea['name'],'resourceId':_0x3dc8ea['id'],'type':_0x2a571f['name'],'sectionId':_0x2a571f['id']},{})['then'](function(){return _0x4a9439;});}else{return _0x4a9439;}})[_0xfdd7('0x55')](function(_0x192f01){logger[_0xfdd7('0x22')](_0xfdd7('0x5d'),_0x192f01);throw _0x192f01;});}return _0x4a9439;})[_0xfdd7('0x1e')](respondWithResult(_0x59a63b,0xc9))[_0xfdd7('0x55')](handleError(_0x59a63b,null));};exports[_0xfdd7('0x32')]=function(_0x1b82ee,_0x58e74d){if(_0x1b82ee[_0xfdd7('0x5e')]['id']){delete _0x1b82ee['body']['id'];}return db[_0xfdd7('0x3c')]['find']({'where':{'id':_0x1b82ee['params']['id']},'include':[{'model':db[_0xfdd7('0x3a')],'as':_0xfdd7('0x3b')}]})['then'](handleEntityNotFound(_0x58e74d,null))[_0xfdd7('0x1e')](saveUpdates(_0x1b82ee[_0xfdd7('0x5e')],null))[_0xfdd7('0x1e')](respondWithResult(_0x58e74d,null))[_0xfdd7('0x55')](handleError(_0x58e74d,null));};exports[_0xfdd7('0x33')]=function(_0x6cd74d,_0x37d703){return db['FaxAccount'][_0xfdd7('0x5b')]({'where':{'id':_0x6cd74d[_0xfdd7('0x53')]['id']}})['then'](handleEntityNotFound(_0x37d703,null))['then'](removeEntity(_0x37d703,null))['catch'](handleError(_0x37d703,null));};exports[_0xfdd7('0x5f')]=function(_0x552bfd,_0x3bd223){return db[_0xfdd7('0x3c')]['describe']()[_0xfdd7('0x1e')](respondWithResult(_0x3bd223,null))[_0xfdd7('0x55')](handleError(_0x3bd223,null));};exports[_0xfdd7('0x60')]=function(_0x246a81,_0x16ce73,_0x30ecf1){if(_0x246a81[_0xfdd7('0x5e')]['id']){delete _0x246a81[_0xfdd7('0x5e')]['id'];}return db[_0xfdd7('0x3c')]['find']({'where':{'id':_0x246a81[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x16ce73,null))[_0xfdd7('0x1e')](function(_0x34ab84){if(_0x34ab84){_0x246a81[_0xfdd7('0x5e')][_0xfdd7('0x61')]=_0x34ab84['id'];return db['Disposition'][_0xfdd7('0x56')](_0x246a81['body']);}})[_0xfdd7('0x1e')](respondWithResult(_0x16ce73,null))[_0xfdd7('0x55')](handleError(_0x16ce73,null));};exports[_0xfdd7('0x62')]=function(_0x1c04c,_0x5a9ea8,_0x4b2eea){var _0x4ddffe={'raw':![],'where':{}};var _0x44f97c={};var _0x38a2b4={'count':0x0,'rows':[]};return db[_0xfdd7('0x3c')][_0xfdd7('0x63')]({'where':{'id':_0x1c04c[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x5a9ea8,null))[_0xfdd7('0x1e')](function(_0x22d375){if(_0x22d375){_0x44f97c[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db[_0xfdd7('0x64')][_0xfdd7('0x3d')]);_0x44f97c[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x1c04c[_0xfdd7('0x3f')]);_0x44f97c[_0xfdd7('0x4b')]=_[_0xfdd7('0x41')](_0x44f97c[_0xfdd7('0x43')],_0x44f97c[_0xfdd7('0x3f')]);_0x4ddffe['attributes']=_[_0xfdd7('0x41')](_0x44f97c[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x1c04c['query'][_0xfdd7('0x44')]));_0x4ddffe[_0xfdd7('0x42')]=_0x4ddffe[_0xfdd7('0x42')][_0xfdd7('0x45')]?_0x4ddffe[_0xfdd7('0x42')]:_0x44f97c[_0xfdd7('0x43')];if(!_0x1c04c[_0xfdd7('0x3f')][_0xfdd7('0x46')](_0xfdd7('0x47'))){_0x4ddffe[_0xfdd7('0x2d')]=qs[_0xfdd7('0x2d')](_0x1c04c[_0xfdd7('0x3f')]['limit']);_0x4ddffe[_0xfdd7('0x48')]=qs[_0xfdd7('0x48')](_0x1c04c[_0xfdd7('0x3f')][_0xfdd7('0x48')]);}_0x4ddffe[_0xfdd7('0x49')]=qs[_0xfdd7('0x4a')](_0x1c04c[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0x4ddffe['where']=qs[_0xfdd7('0x4b')](_[_0xfdd7('0x65')](_0x1c04c[_0xfdd7('0x3f')],_0x44f97c[_0xfdd7('0x4b')]));_0x4ddffe[_0xfdd7('0x4d')][_0xfdd7('0x61')]=_0x22d375['id'];if(_0x1c04c[_0xfdd7('0x3f')][_0xfdd7('0x4c')]){_0x4ddffe[_0xfdd7('0x4d')]=_[_0xfdd7('0x4e')](_0x4ddffe['where'],{'$or':_[_0xfdd7('0x4f')](_0x4ddffe[_0xfdd7('0x42')],function(_0x137b54){var _0x56c03a={};_0x56c03a[_0x137b54]={'$like':'%'+_0x1c04c[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x56c03a;})});}_0x4ddffe=_[_0xfdd7('0x4e')]({},_0x4ddffe,_0x1c04c['options']);return db[_0xfdd7('0x64')][_0xfdd7('0x2c')]({'where':_0x4ddffe['where']})[_0xfdd7('0x1e')](function(_0x36b14f){_0x38a2b4[_0xfdd7('0x2c')]=_0x36b14f;if(_0x1c04c['query'][_0xfdd7('0x54')]){_0x4ddffe[_0xfdd7('0x66')]=[{'all':!![]}];}return db['Disposition'][_0xfdd7('0x52')](_0x4ddffe);})[_0xfdd7('0x1e')](function(_0x261728){_0x38a2b4[_0xfdd7('0x67')]=_0x261728;return _0x38a2b4;});}})[_0xfdd7('0x1e')](respondWithFilteredResult(_0x5a9ea8,_0x4ddffe))[_0xfdd7('0x55')](handleError(_0x5a9ea8,null));};exports[_0xfdd7('0x68')]=function(_0x114b11,_0x1d73d6,_0x2045f1){return db['FaxAccount']['find']({'where':{'id':_0x114b11[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x1d73d6,null))[_0xfdd7('0x1e')](function(_0xa6fdab){if(_0xa6fdab){return _0xa6fdab['removeDispositions'](_0x114b11[_0xfdd7('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0x1d73d6,null))[_0xfdd7('0x55')](handleError(_0x1d73d6,null));};exports[_0xfdd7('0x69')]=function(_0xc93153,_0x3b1a34,_0x298805){if(_0xc93153[_0xfdd7('0x5e')]['id']){delete _0xc93153['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0xc93153[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x3b1a34,null))[_0xfdd7('0x1e')](function(_0x584742){if(_0x584742){_0xc93153[_0xfdd7('0x5e')]['FaxAccountId']=_0x584742['id'];return db[_0xfdd7('0x6a')][_0xfdd7('0x56')](_0xc93153[_0xfdd7('0x5e')]);}})['then'](respondWithResult(_0x3b1a34,null))[_0xfdd7('0x55')](handleError(_0x3b1a34,null));};exports[_0xfdd7('0x6b')]=function(_0x316739,_0xa5220,_0x204207){var _0x1b0c7f={'raw':![],'where':{}};var _0x5b53b0={};var _0x34c1fa={'count':0x0,'rows':[]};return db[_0xfdd7('0x3c')]['findOne']({'where':{'id':_0x316739['params']['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0xa5220,null))[_0xfdd7('0x1e')](function(_0x19348b){if(_0x19348b){_0x5b53b0[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db[_0xfdd7('0x6a')]['rawAttributes']);_0x5b53b0[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x316739[_0xfdd7('0x3f')]);_0x5b53b0[_0xfdd7('0x4b')]=_[_0xfdd7('0x41')](_0x5b53b0[_0xfdd7('0x43')],_0x5b53b0[_0xfdd7('0x3f')]);_0x1b0c7f[_0xfdd7('0x42')]=_[_0xfdd7('0x41')](_0x5b53b0[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x316739['query'][_0xfdd7('0x44')]));_0x1b0c7f[_0xfdd7('0x42')]=_0x1b0c7f['attributes'][_0xfdd7('0x45')]?_0x1b0c7f[_0xfdd7('0x42')]:_0x5b53b0['model'];if(!_0x316739['query'][_0xfdd7('0x46')]('nolimit')){_0x1b0c7f[_0xfdd7('0x2d')]=qs['limit'](_0x316739[_0xfdd7('0x3f')]['limit']);_0x1b0c7f[_0xfdd7('0x48')]=qs['offset'](_0x316739[_0xfdd7('0x3f')]['offset']);}_0x1b0c7f[_0xfdd7('0x49')]=qs['sort'](_0x316739['query'][_0xfdd7('0x4a')]);_0x1b0c7f[_0xfdd7('0x4d')]=qs['filters'](_[_0xfdd7('0x65')](_0x316739[_0xfdd7('0x3f')],_0x5b53b0[_0xfdd7('0x4b')]));_0x1b0c7f[_0xfdd7('0x4d')][_0xfdd7('0x61')]=_0x19348b['id'];if(_0x316739[_0xfdd7('0x3f')]['filter']){_0x1b0c7f[_0xfdd7('0x4d')]=_[_0xfdd7('0x4e')](_0x1b0c7f[_0xfdd7('0x4d')],{'$or':_[_0xfdd7('0x4f')](_0x1b0c7f['attributes'],function(_0xa3d2){var _0x3a27e4={};_0x3a27e4[_0xa3d2]={'$like':'%'+_0x316739[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x3a27e4;})});}_0x1b0c7f=_[_0xfdd7('0x4e')]({},_0x1b0c7f,_0x316739['options']);return db[_0xfdd7('0x6a')][_0xfdd7('0x2c')]({'where':_0x1b0c7f[_0xfdd7('0x4d')]})['then'](function(_0xc42f52){_0x34c1fa[_0xfdd7('0x2c')]=_0xc42f52;if(_0x316739[_0xfdd7('0x3f')][_0xfdd7('0x54')]){_0x1b0c7f[_0xfdd7('0x66')]=[{'all':!![]}];}return db[_0xfdd7('0x6a')][_0xfdd7('0x52')](_0x1b0c7f);})['then'](function(_0x50e556){_0x34c1fa[_0xfdd7('0x67')]=_0x50e556;return _0x34c1fa;});}})[_0xfdd7('0x1e')](respondWithFilteredResult(_0xa5220,_0x1b0c7f))[_0xfdd7('0x55')](handleError(_0xa5220,null));};exports['removeAnswers']=function(_0x222622,_0x3434ab,_0x1f09f2){return db[_0xfdd7('0x3c')][_0xfdd7('0x5b')]({'where':{'id':_0x222622[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x3434ab,null))[_0xfdd7('0x1e')](function(_0x3cd9c5){if(_0x3cd9c5){return _0x3cd9c5[_0xfdd7('0x6c')](_0x222622[_0xfdd7('0x3f')][_0xfdd7('0x6d')]);}})[_0xfdd7('0x1e')](respondWithStatusCode(_0x3434ab,null))[_0xfdd7('0x55')](handleError(_0x3434ab,null));};exports[_0xfdd7('0x6e')]=function(_0x121344,_0x55e62d,_0x4ad3f1){return db[_0xfdd7('0x6f')][_0xfdd7('0x5b')]({'where':{'id':_0x121344[_0xfdd7('0x53')]['id']}})['then'](handleEntityNotFound(_0x55e62d,null))['then'](function(_0x16d110){if(_0x16d110){return _0x16d110[_0xfdd7('0x6e')](_0x121344[_0xfdd7('0x5e')]['ids'],_[_0xfdd7('0x70')](_0x121344[_0xfdd7('0x5e')],[_0xfdd7('0x6d'),'id'])||{});}})[_0xfdd7('0x1e')](respondWithResult(_0x55e62d,null))[_0xfdd7('0x55')](handleError(_0x55e62d,null));};exports['getInteractions']=function(_0x157a12,_0x13e3d5,_0x36c9ea){var _0x15c7fb={'raw':![],'where':{}};var _0x30d3fe={};var _0x50bdd4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x157a12['params']['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x13e3d5,null))['then'](function(_0x570b2d){if(_0x570b2d){_0x30d3fe['model']=_[_0xfdd7('0x40')](db[_0xfdd7('0x6f')][_0xfdd7('0x3d')]);_0x30d3fe[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x157a12[_0xfdd7('0x3f')]);_0x30d3fe[_0xfdd7('0x4b')]=_[_0xfdd7('0x41')](_0x30d3fe[_0xfdd7('0x43')],_0x30d3fe[_0xfdd7('0x3f')]);_0x15c7fb[_0xfdd7('0x42')]=_['intersection'](_0x30d3fe['model'],qs[_0xfdd7('0x44')](_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x44')]));_0x15c7fb[_0xfdd7('0x42')]=_0x15c7fb[_0xfdd7('0x42')]['length']?_0x15c7fb[_0xfdd7('0x42')]:_0x30d3fe[_0xfdd7('0x43')];if(!_0x157a12[_0xfdd7('0x3f')]['hasOwnProperty'](_0xfdd7('0x47'))){_0x15c7fb[_0xfdd7('0x2d')]=qs[_0xfdd7('0x2d')](_0x157a12['query'][_0xfdd7('0x2d')]);_0x15c7fb['offset']=qs['offset'](_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x48')]);}_0x15c7fb[_0xfdd7('0x49')]=qs[_0xfdd7('0x4a')](_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0x15c7fb[_0xfdd7('0x4d')]=qs[_0xfdd7('0x4b')](_['pick'](_0x157a12[_0xfdd7('0x3f')],_0x30d3fe[_0xfdd7('0x4b')]));_0x15c7fb[_0xfdd7('0x4d')]['FaxAccountId']=_0x570b2d['id'];if(_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x4c')]){_0x15c7fb[_0xfdd7('0x4d')]=_['merge'](_0x15c7fb['where'],{'$or':_[_0xfdd7('0x4f')](_0x15c7fb[_0xfdd7('0x42')],function(_0x53fbc2){var _0x1aff84={};_0x1aff84[_0x53fbc2]={'$like':'%'+_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x1aff84;})});}_0x15c7fb=_[_0xfdd7('0x4e')]({},_0x15c7fb,_0x157a12['options']);return db['FaxInteraction']['count']({'where':_0x15c7fb[_0xfdd7('0x4d')]})[_0xfdd7('0x1e')](function(_0x859233){_0x50bdd4[_0xfdd7('0x2c')]=_0x859233;if(_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x54')]){_0x15c7fb['include']=[{'model':db[_0xfdd7('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xfdd7('0x72'),'attributes':[_0xfdd7('0x37'),'fullname',_0xfdd7('0x73')],'required':![]},{'model':db[_0xfdd7('0x74')],'as':_0xfdd7('0x75'),'attributes':['id',_0xfdd7('0x37'),'color'],'where':_0x157a12[_0xfdd7('0x3f')][_0xfdd7('0x76')]?{'id':_0x157a12[_0xfdd7('0x3f')]['tag']}:undefined,'required':_0x157a12['query'][_0xfdd7('0x76')]?!![]:![]}];}return db[_0xfdd7('0x6f')][_0xfdd7('0x52')](_0x15c7fb);})['then'](function(_0x567f3a){_0x50bdd4[_0xfdd7('0x67')]=_0x567f3a;return _0x50bdd4;});}})[_0xfdd7('0x1e')](respondWithFilteredResult(_0x13e3d5,_0x15c7fb))[_0xfdd7('0x55')](handleError(_0x13e3d5,null));};exports[_0xfdd7('0x77')]=function(_0x251b8a,_0x1fd615){var _0x1a468b=_0x251b8a[_0xfdd7('0x53')]['id'];var _0x4b6aaf=_0x251b8a[_0xfdd7('0x5e')];var _0x5d5697=0xc8;var _0x1e6640=null;return db[_0xfdd7('0x78')][_0xfdd7('0x79')]({'isolationLevel':db['sequelize'][_0xfdd7('0x7a')][_0xfdd7('0x7b')]['READ_COMMITTED']},function(_0x38ba26){return db['FaxAccount'][_0xfdd7('0x63')]({'where':{'id':_0x1a468b},'transaction':_0x38ba26})[_0xfdd7('0x1e')](function(_0x356f2f){if(_0x356f2f){return db[_0xfdd7('0x7c')][_0xfdd7('0x33')]({'where':{'FaxAccountId':_0x1a468b},'transaction':_0x38ba26})[_0xfdd7('0x1e')](function(){var _0x2df137=_[_0xfdd7('0x4f')](_0x4b6aaf,function(_0x44554d){_0x44554d['FaxAccountId']=_0x1a468b;return _0x44554d;});return db[_0xfdd7('0x7c')][_0xfdd7('0x7d')](_0x2df137,{'transaction':_0x38ba26});});}else{_0x5d5697=0x194;_0x1e6640=[];}});})['then'](function(){if(_0x5d5697!==0x194){return db[_0xfdd7('0x7c')][_0xfdd7('0x7e')]({'where':{'FaxAccountId':_0x1a468b},'order':'priority'})[_0xfdd7('0x1e')](function(_0x2cc80c){_0x1e6640=_0x2cc80c;});}})[_0xfdd7('0x55')](function(_0x52ee38){_0x5d5697=0x1f4;logger[_0xfdd7('0x22')](_0x52ee38[_0xfdd7('0x36')]);if(_0x52ee38['name']){delete _0x52ee38[_0xfdd7('0x37')];}_0x1e6640=_0x52ee38;})[_0xfdd7('0x7f')](function(){if(_0x1e6640===null){_0x1fd615[_0xfdd7('0x27')](_0x5d5697);}else{if(_0x5d5697===0x1f4){_0x1fd615[_0xfdd7('0x28')](_0x5d5697)[_0xfdd7('0x38')](_0x1e6640);}else{_0x1fd615['status'](_0x5d5697)[_0xfdd7('0x2a')](_0x1e6640);}}});};exports['getApplications']=function(_0x48a390,_0x4382d1,_0x2658ec){var _0x3b6ce2={};var _0x22a85b={};var _0x2fc1e6;var _0x3ac57d;return db[_0xfdd7('0x3c')][_0xfdd7('0x63')]({'where':{'id':_0x48a390[_0xfdd7('0x53')]['id']}})['then'](handleEntityNotFound(_0x4382d1,null))[_0xfdd7('0x1e')](function(_0x5c0f09){if(_0x5c0f09){_0x2fc1e6=_0x5c0f09;_0x22a85b[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db[_0xfdd7('0x7c')][_0xfdd7('0x3d')]);_0x22a85b[_0xfdd7('0x3f')]=_['keys'](_0x48a390['query']);_0x22a85b[_0xfdd7('0x4b')]=_[_0xfdd7('0x41')](_0x22a85b[_0xfdd7('0x43')],_0x22a85b['query']);_0x3b6ce2[_0xfdd7('0x42')]=_[_0xfdd7('0x41')](_0x22a85b[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x48a390[_0xfdd7('0x3f')][_0xfdd7('0x44')]));_0x3b6ce2[_0xfdd7('0x42')]=_0x3b6ce2[_0xfdd7('0x42')]['length']?_0x3b6ce2[_0xfdd7('0x42')]:_0x22a85b[_0xfdd7('0x43')];_0x3b6ce2[_0xfdd7('0x49')]=qs[_0xfdd7('0x4a')](_0x48a390[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0x3b6ce2['where']=qs[_0xfdd7('0x4b')](_[_0xfdd7('0x65')](_0x48a390[_0xfdd7('0x3f')],_0x22a85b[_0xfdd7('0x4b')]));if(_0x48a390[_0xfdd7('0x3f')][_0xfdd7('0x4c')]){_0x3b6ce2[_0xfdd7('0x4d')]=_[_0xfdd7('0x4e')](_0x3b6ce2[_0xfdd7('0x4d')],{'$or':_['map'](_0x3b6ce2[_0xfdd7('0x42')],function(_0x312e54){var _0x52c71f={};_0x52c71f[_0x312e54]={'$like':'%'+_0x48a390['query'][_0xfdd7('0x4c')]+'%'};return _0x52c71f;})});}_0x3b6ce2=_['merge']({},_0x3b6ce2,_0x48a390[_0xfdd7('0x51')]);return _0x2fc1e6[_0xfdd7('0x80')](_0x3b6ce2);}})[_0xfdd7('0x1e')](function(_0x130a31){if(_0x130a31){_0x3ac57d=_0x130a31['length'];if(!_0x48a390[_0xfdd7('0x3f')][_0xfdd7('0x46')](_0xfdd7('0x47'))){_0x3b6ce2['limit']=qs[_0xfdd7('0x2d')](_0x48a390[_0xfdd7('0x3f')]['limit']);_0x3b6ce2[_0xfdd7('0x48')]=qs['offset'](_0x48a390['query']['offset']);}return _0x2fc1e6['getApplications'](_0x3b6ce2);}})[_0xfdd7('0x1e')](function(_0x2f9478){if(_0x2f9478){return _0x2f9478?{'count':_0x3ac57d,'rows':_0x2f9478}:null;}})[_0xfdd7('0x1e')](respondWithResult(_0x4382d1,null))[_0xfdd7('0x55')](handleError(_0x4382d1,null));};function Extension(_0x52d3b4,_0x2a94fa,_0x596b8e,_0xb995eb){this[_0xfdd7('0x81')]='from-voip-provider';this['exten']=_0x52d3b4['localstationid'];this['app']=_0xb995eb;this[_0xfdd7('0x3e')]=_0xfdd7('0x82');this['description']='Fax\x20Extension';this[_0xfdd7('0x61')]=_0x52d3b4['id'];this[_0xfdd7('0x83')]=_0x2a94fa;this['appdata']=_0x596b8e;}function createExtensionsReciveFax(_0x164de0){var _0x3e832e=0x1;var _0x29b890=[];_0x29b890['push'](new Extension(_0x164de0,_0x3e832e,'',_0xfdd7('0x84')));_0x3e832e+=0x1;_0x29b890[_0xfdd7('0x85')](new Extension(_0x164de0,_0x3e832e,_0xfdd7('0x86'),_0xfdd7('0x87')));_0x3e832e+=0x1;for(var _0x5c02ee in _0x164de0){if(_0x164de0['hasOwnProperty'](_0x5c02ee)&&(_0x5c02ee===_0xfdd7('0x88')||_0x5c02ee===_0xfdd7('0x89')||_0x5c02ee==='gateway'||_0x5c02ee===_0xfdd7('0x8a')||_0x5c02ee==='headerinfo'||_0x5c02ee===_0xfdd7('0x8b')||_0x5c02ee===_0xfdd7('0x8c')||_0x5c02ee===_0xfdd7('0x8d')||_0x5c02ee===_0xfdd7('0x8e'))){_0x29b890[_0xfdd7('0x85')](new Extension(_0x164de0,_0x3e832e,'FAXOPT('+_0x5c02ee+')='+_0x164de0[_0x5c02ee],'Set'));_0x3e832e+=0x1;}}_0x29b890['push'](new Extension(_0x164de0,_0x3e832e,'6','Wait'));_0x3e832e+=0x1;_0x29b890[_0xfdd7('0x85')](new Extension(_0x164de0,_0x3e832e,_0xfdd7('0x8f'),'ReceiveFax'));_0x3e832e=0x0;return _0x29b890;}exports[_0xfdd7('0x90')]=function(_0xa1e683,_0x1c7ad7,_0x570162){var _0x4423ad;return db['sequelize'][_0xfdd7('0x79')](function(_0x83f9b6){return db[_0xfdd7('0x3c')][_0xfdd7('0x56')](_0xa1e683['body'],{'transaction':_0x83f9b6})[_0xfdd7('0x1e')](function(_0x1800dc){_0x4423ad=_0x1800dc['get']({'plain':!![]});return db[_0xfdd7('0x91')][_0xfdd7('0x7d')](createExtensionsReciveFax(_0x4423ad),{'transaction':_0x83f9b6});});})[_0xfdd7('0x1e')](function(){return _0x4423ad;})[_0xfdd7('0x1e')](respondWithResult(_0x1c7ad7,null))[_0xfdd7('0x55')](handleError(_0x1c7ad7,null));};exports[_0xfdd7('0x92')]=function(_0x2d62d5,_0x1c15ca,_0x5ff1a6){var _0xc5ad17;return db[_0xfdd7('0x78')][_0xfdd7('0x79')](function(_0x418222){return db[_0xfdd7('0x3c')][_0xfdd7('0x32')](_0x2d62d5[_0xfdd7('0x5e')],{'where':{'id':_0x2d62d5['body']['id']},'transaction':_0x418222})[_0xfdd7('0x1e')](function(_0x285269){return db[_0xfdd7('0x91')][_0xfdd7('0x33')]({'where':{'FaxAccountId':_0x2d62d5[_0xfdd7('0x5e')]['id']},'transaction':_0x418222})[_0xfdd7('0x1e')](function(_0x515a73){return db[_0xfdd7('0x91')][_0xfdd7('0x7d')](createExtensionsReciveFax(_['omit'](_0x2d62d5[_0xfdd7('0x5e')],[_0xfdd7('0x93'),_0xfdd7('0x94'),_0xfdd7('0x95'),_0xfdd7('0x96'),_0xfdd7('0x97'),_0xfdd7('0x98')])),{'transaction':_0x418222});});});})['then'](function(){return db[_0xfdd7('0x3c')][_0xfdd7('0x99')](_0x2d62d5[_0xfdd7('0x5e')]['id']);})[_0xfdd7('0x1e')](respondWithResult(_0x1c15ca,null))[_0xfdd7('0x55')](handleError(_0x1c15ca,null));};exports[_0xfdd7('0x9a')]=function(_0xa1a110,_0x12844e,_0x5f94e6){var _0xe636d3={'raw':!![],'where':{}};var _0x5015e3={};var _0x5c07c2={'count':0x0,'rows':[]};return db[_0xfdd7('0x3c')][_0xfdd7('0x63')]({'where':{'id':_0xa1a110[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x12844e,null))['then'](function(_0x4faa24){if(_0x4faa24){_0x5015e3[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db['FaxMessage'][_0xfdd7('0x3d')]);_0x5015e3['query']=_[_0xfdd7('0x40')](_0xa1a110['query']);_0x5015e3[_0xfdd7('0x4b')]=_['intersection'](_0x5015e3[_0xfdd7('0x43')],_0x5015e3[_0xfdd7('0x3f')]);_0xe636d3[_0xfdd7('0x42')]=_['intersection'](_0x5015e3[_0xfdd7('0x43')],qs['fields'](_0xa1a110[_0xfdd7('0x3f')]['fields']));_0xe636d3[_0xfdd7('0x42')]=_0xe636d3[_0xfdd7('0x42')][_0xfdd7('0x45')]?_0xe636d3[_0xfdd7('0x42')]:_0x5015e3[_0xfdd7('0x43')];if(!_0xa1a110['query'][_0xfdd7('0x46')](_0xfdd7('0x47'))){_0xe636d3[_0xfdd7('0x2d')]=qs['limit'](_0xa1a110['query'][_0xfdd7('0x2d')]);_0xe636d3[_0xfdd7('0x48')]=qs[_0xfdd7('0x48')](_0xa1a110[_0xfdd7('0x3f')]['offset']);}_0xe636d3[_0xfdd7('0x49')]=qs['sort'](_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0xe636d3['where']=qs[_0xfdd7('0x4b')](_['pick'](_0xa1a110['query'],_0x5015e3[_0xfdd7('0x4b')]));_0xe636d3[_0xfdd7('0x4d')]['FaxAccountId']=_0x4faa24['id'];if(_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x4c')]){_0xe636d3[_0xfdd7('0x4d')]=_['merge'](_0xe636d3[_0xfdd7('0x4d')],{'$or':_[_0xfdd7('0x4f')](_0xe636d3['attributes'],function(_0x4046d0){var _0x5d0cd4={};_0x5d0cd4[_0x4046d0]={'$like':'%'+_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x5d0cd4;})});}if(_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x9b')]){var _0xb037d7=_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x9b')][_0xfdd7('0x9c')](',');var _0x354d51={};_0x354d51[_0xb037d7[0x0]]={'$gte':moment(_0xb037d7[0x1])[_0xfdd7('0x9d')](_0xfdd7('0x9e'))};_0xe636d3[_0xfdd7('0x4d')]=_[_0xfdd7('0x4e')](_0xe636d3[_0xfdd7('0x4d')],_0x354d51);}_0xe636d3=_[_0xfdd7('0x4e')]({},_0xe636d3,_0xa1a110[_0xfdd7('0x51')]);return db[_0xfdd7('0x9f')][_0xfdd7('0x2c')]({'where':_0xe636d3[_0xfdd7('0x4d')]})[_0xfdd7('0x1e')](function(_0xa10dde){_0x5c07c2[_0xfdd7('0x2c')]=_0xa10dde;if(_0xa1a110[_0xfdd7('0x3f')][_0xfdd7('0x54')]){_0xe636d3[_0xfdd7('0x66')]=[{'all':!![]}];}return db[_0xfdd7('0x9f')][_0xfdd7('0x52')](_0xe636d3);})[_0xfdd7('0x1e')](function(_0x103e1f){_0x5c07c2['rows']=_0x103e1f;return _0x5c07c2;});}})[_0xfdd7('0x1e')](respondWithFilteredResult(_0x12844e,_0xe636d3))['catch'](handleError(_0x12844e,null));};exports['send']=function(_0x217cb5,_0x37222e,_0x47bdb8){var _0x5d80f4,_0x52d615={},_0x104c55;if(_0x217cb5[_0xfdd7('0x5e')]['to']){_0x104c55=_0x217cb5[_0xfdd7('0x5e')]['to'][0x0];}return db[_0xfdd7('0x3c')]['find']({'where':{'id':_0x217cb5[_0xfdd7('0x53')]['id']},'include':[{'model':db[_0xfdd7('0xa0')],'as':_0xfdd7('0xa1'),'include':[{'model':db[_0xfdd7('0x71')],'as':_0xfdd7('0xa2'),'where':{'fax':_0x104c55},'limit':0x1,'order':[[_0xfdd7('0x96'),_0xfdd7('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x37222e,null))[_0xfdd7('0x1e')](function(_0x56c19b){_0x5d80f4=_0x56c19b;if(_0x217cb5['body'][_0xfdd7('0xa4')]&&_0x217cb5[_0xfdd7('0x5e')]['attachments'][_0xfdd7('0x45')]){for(var _0x295501=0x0;_0x295501<_0x217cb5['body']['attachments'][_0xfdd7('0x45')];_0x295501+=0x1){_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][_0x295501]={'filename':_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][_0x295501][_0xfdd7('0x37')],'id':_0x217cb5[_0xfdd7('0x5e')]['attachments'][_0x295501]['id'],'path':path['join'](config['root'],_0xfdd7('0xa5'),_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][_0x295501][_0xfdd7('0xa6')])};}}return respondWithRpcPromise(_0xfdd7('0xa7'),'CheckAfterSend',{'FaxAccountId':_[_0xfdd7('0xa8')](_0x217cb5['params']['id'])?undefined:_0x217cb5[_0xfdd7('0x53')]['id'],'path':_[_0xfdd7('0xa8')](_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0][_0xfdd7('0x5')])?undefined:_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0][_0xfdd7('0x5')],'fax':_['isNil'](_0x217cb5[_0xfdd7('0x5e')]['to'][0x0])?undefined:_0x217cb5['body']['to'][0x0]},client9002);})[_0xfdd7('0x1e')](function(){if(_0x5d80f4){if(_['isNil'](_0x217cb5[_0xfdd7('0x5e')]['from'])){_0x217cb5['body'][_0xfdd7('0xa9')]=util[_0xfdd7('0x9d')](_0xfdd7('0xaa'),_0x5d80f4[_0xfdd7('0x37')],_0x5d80f4[_0xfdd7('0xab')]);}if(_0x5d80f4['List']){if(_0x5d80f4['List'][_0xfdd7('0xa2')][_0xfdd7('0x45')]){return _0x5d80f4[_0xfdd7('0xa1')]['Contacts'][0x0];}else{return db[_0xfdd7('0x71')]['create'](_[_0xfdd7('0x16')](_0x217cb5[_0xfdd7('0x5e')],{'firstName':_0x217cb5[_0xfdd7('0x5e')]['to'][0x0],'phone':_0x217cb5[_0xfdd7('0x5e')]['to'][0x0],'fax':_0x217cb5[_0xfdd7('0x5e')]['to'][0x0],'ListId':_0x5d80f4[_0xfdd7('0x98')]}));}}else{throw new Error(_0xfdd7('0xac'));}}else{throw new Error(_0xfdd7('0xad'));}})[_0xfdd7('0x1e')](function(_0x470628){if(_0x470628){return db[_0xfdd7('0x6f')][_0xfdd7('0x5b')]({'where':{'ContactId':_0x470628['id'],'closed':![],'FaxAccountId':_0x5d80f4['id']}})[_0xfdd7('0x1e')](function(_0x2b5ddb){if(_0x2b5ddb){return[_0x2b5ddb,![]];}return db['FaxInteraction'][_0xfdd7('0x56')]({'UserId':_0x217cb5[_0xfdd7('0x59')]['id'],'ContactId':_0x470628['id'],'FaxAccountId':_0x5d80f4['id'],'fax':_0x217cb5[_0xfdd7('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xfdd7('0x4e')](_0x217cb5[_0xfdd7('0x5e')],{'read':![],'body':_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0][_0xfdd7('0xae')],'FaxAccountId':_0x5d80f4['id'],'UserId':_0x217cb5['user']['id'],'ContactId':_0x470628['id'],'AttachmentId':_0x217cb5['body'][_0xfdd7('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xfdd7('0xaf')}]})[_0xfdd7('0x1e')](function(_0x1ad2c6){return[_0x1ad2c6,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfdd7('0xb0')](function(_0x2bb759,_0x682a){if(_0x682a){return _0x2bb759;}return db[_0xfdd7('0x9f')][_0xfdd7('0x56')]({'direction':_0xfdd7('0xb1'),'read':![],'body':_0x217cb5['body'][_0xfdd7('0xa4')][0x0][_0xfdd7('0xae')],'FaxAccountId':_0x5d80f4['id'],'FaxInteractionId':_0x2bb759['id'],'UserId':_0x217cb5[_0xfdd7('0x59')]['id'],'ContactId':_0x2bb759[_0xfdd7('0xb2')],'AttachmentId':_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0]['id']})[_0xfdd7('0x1e')](function(_0x1c58aa){_0x2bb759[_0xfdd7('0xb3')][_0xfdd7('0xaf')]=[];_0x2bb759[_0xfdd7('0xb3')]['Messages'][_0xfdd7('0x85')](_0x1c58aa[_0xfdd7('0xb3')]);return _0x2bb759;});})[_0xfdd7('0x1e')](function(_0x1752c5){respondWithRpcPromise(_0xfdd7('0xb4'),'SendFax',{'FaxAccountId':_['isNil'](_0x217cb5[_0xfdd7('0x53')]['id'])?undefined:_0x217cb5[_0xfdd7('0x53')]['id'],'path':_['isNil'](_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0]['path'])?undefined:_0x217cb5[_0xfdd7('0x5e')]['attachments'][0x0][_0xfdd7('0x5')],'fax':_['isNil'](_0x217cb5[_0xfdd7('0x5e')]['to'][0x0])?undefined:_0x217cb5[_0xfdd7('0x5e')]['to'][0x0],'AttachmentId':_0x217cb5[_0xfdd7('0x5e')][_0xfdd7('0xa4')][0x0]['id']},client9002)[_0xfdd7('0x1e')](function(_0xfafb62){logger[_0xfdd7('0x1f')](_0xfdd7('0xb5'),_0xfafb62);})[_0xfdd7('0x55')](function(_0x60c2e4){logger[_0xfdd7('0x1f')]('SendFaxRpc,\x20%s',_0x60c2e4);});return _0x1752c5;})[_0xfdd7('0x1e')](respondWithResult(_0x37222e,null))[_0xfdd7('0x55')](handleError(_0x37222e,null));};exports[_0xfdd7('0xb6')]=function(_0x40360c,_0x3e465f,_0x21ffeb){return db[_0xfdd7('0x3c')][_0xfdd7('0x5b')]({'where':{'id':_0x40360c[_0xfdd7('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e465f,null))[_0xfdd7('0x1e')](function(_0x542900){if(_0x542900){return _0x542900[_0xfdd7('0xb6')](_0x40360c['body'][_0xfdd7('0x6d')],_[_0xfdd7('0x70')](_0x40360c[_0xfdd7('0x5e')],['ids','id'])||{})['spread'](function(_0x2774a4){for(var _0x47dc52=0x0;_0x47dc52<_0x40360c[_0xfdd7('0x5e')][_0xfdd7('0x6d')][_0xfdd7('0x45')];_0x47dc52+=0x1){socket[_0xfdd7('0xb7')](_0xfdd7('0xb8'),{'UserId':Number(_0x40360c['body'][_0xfdd7('0x6d')][_0x47dc52]),'FaxAccountId':Number(_0x40360c[_0xfdd7('0x53')]['id'])});}return _0x2774a4;});}})[_0xfdd7('0x1e')](respondWithResult(_0x3e465f,null))[_0xfdd7('0x55')](handleError(_0x3e465f,null));};exports['removeAgents']=function(_0xf5c1e0,_0x5183c,_0x35083b){return db['FaxAccount']['find']({'where':{'id':_0xf5c1e0[_0xfdd7('0x53')]['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x5183c,null))['then'](function(_0x486862){if(_0x486862){return _0x486862[_0xfdd7('0xb9')](_0xf5c1e0[_0xfdd7('0x3f')]['ids'])[_0xfdd7('0x1e')](function(){if(_[_0xfdd7('0xba')](_0xf5c1e0['query'][_0xfdd7('0x6d')])){for(var _0x221a4e=0x0;_0x221a4e<_0xf5c1e0[_0xfdd7('0x3f')][_0xfdd7('0x6d')][_0xfdd7('0x45')];_0x221a4e+=0x1){socket[_0xfdd7('0xb7')](_0xfdd7('0xbb'),{'UserId':Number(_0xf5c1e0['query'][_0xfdd7('0x6d')][_0x221a4e]),'FaxAccountId':Number(_0xf5c1e0['params']['id'])});}}else{socket['emit'](_0xfdd7('0xbb'),{'UserId':Number(_0xf5c1e0[_0xfdd7('0x3f')][_0xfdd7('0x6d')]),'FaxAccountId':Number(_0xf5c1e0[_0xfdd7('0x53')]['id'])});}});}})[_0xfdd7('0x1e')](respondWithStatusCode(_0x5183c,null))[_0xfdd7('0x55')](handleError(_0x5183c,null));};exports[_0xfdd7('0xbc')]=function(_0x347941,_0x13091e,_0x188f4d){var _0x5bd320={};var _0x2fe932={};var _0x5e0d70;var _0x5bd8bc;return db[_0xfdd7('0x3c')]['findOne']({'where':{'id':_0x347941['params']['id']}})[_0xfdd7('0x1e')](handleEntityNotFound(_0x13091e,null))['then'](function(_0x5d287f){if(_0x5d287f){_0x5e0d70=_0x5d287f;_0x2fe932[_0xfdd7('0x43')]=_[_0xfdd7('0x40')](db[_0xfdd7('0xbd')][_0xfdd7('0x3d')]);_0x2fe932[_0xfdd7('0x3f')]=_[_0xfdd7('0x40')](_0x347941[_0xfdd7('0x3f')]);_0x2fe932['filters']=_[_0xfdd7('0x41')](_0x2fe932[_0xfdd7('0x43')],_0x2fe932[_0xfdd7('0x3f')]);_0x5bd320[_0xfdd7('0x42')]=_[_0xfdd7('0x41')](_0x2fe932[_0xfdd7('0x43')],qs[_0xfdd7('0x44')](_0x347941[_0xfdd7('0x3f')]['fields']));_0x5bd320[_0xfdd7('0x42')]=_0x5bd320[_0xfdd7('0x42')][_0xfdd7('0x45')]?_0x5bd320['attributes']:_0x2fe932[_0xfdd7('0x43')];_0x5bd320[_0xfdd7('0x49')]=qs[_0xfdd7('0x4a')](_0x347941[_0xfdd7('0x3f')][_0xfdd7('0x4a')]);_0x5bd320[_0xfdd7('0x4d')]=qs[_0xfdd7('0x4b')](_[_0xfdd7('0x65')](_0x347941['query'],_0x2fe932[_0xfdd7('0x4b')]));if(_0x347941[_0xfdd7('0x3f')]['filter']){_0x5bd320['where']=_[_0xfdd7('0x4e')](_0x5bd320[_0xfdd7('0x4d')],{'$or':_[_0xfdd7('0x4f')](_0x5bd320['attributes'],function(_0xc0c7af){var _0x4bf97f={};_0x4bf97f[_0xc0c7af]={'$like':'%'+_0x347941[_0xfdd7('0x3f')][_0xfdd7('0x4c')]+'%'};return _0x4bf97f;})});}_0x5bd320=_[_0xfdd7('0x4e')]({},_0x5bd320,_0x347941['options']);return _0x5e0d70[_0xfdd7('0xbc')](_0x5bd320);}})[_0xfdd7('0x1e')](function(_0x484169){if(_0x484169){_0x5bd8bc=_0x484169[_0xfdd7('0x45')];if(!_0x347941[_0xfdd7('0x3f')][_0xfdd7('0x46')](_0xfdd7('0x47'))){_0x5bd320[_0xfdd7('0x2d')]=qs[_0xfdd7('0x2d')](_0x347941['query'][_0xfdd7('0x2d')]);_0x5bd320[_0xfdd7('0x48')]=qs[_0xfdd7('0x48')](_0x347941['query']['offset']);}return _0x5e0d70[_0xfdd7('0xbc')](_0x5bd320);}})[_0xfdd7('0x1e')](function(_0x203e17){if(_0x203e17){return _0x203e17?{'count':_0x5bd8bc,'rows':_0x203e17}:null;}})[_0xfdd7('0x1e')](respondWithResult(_0x13091e,null))[_0xfdd7('0x55')](handleError(_0x13091e,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 997e110..8f92629 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 _0x1335=['remove','emit','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0xb9781b,_0x434c4f){var _0x254024=function(_0x3af64b){while(--_0x3af64b){_0xb9781b['push'](_0xb9781b['shift']());}};_0x254024(++_0x434c4f);}(_0x1335,0x6f));var _0x5133=function(_0x30f50e,_0x5279f8){_0x30f50e=_0x30f50e-0x0;var _0x1d1faf=_0x1335[_0x30f50e];return _0x1d1faf;};'use strict';var EventEmitter=require(_0x5133('0x0'));var FaxAccount=require(_0x5133('0x1'))['db'][_0x5133('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5133('0x3')](0x0);var events={'afterCreate':_0x5133('0x4'),'afterUpdate':_0x5133('0x5'),'afterDestroy':_0x5133('0x6')};function emitEvent(_0x426e1c){return function(_0x56acfb,_0x5b81e7,_0x3e6742){FaxAccountEvents[_0x5133('0x7')](_0x426e1c+':'+_0x56acfb['id'],_0x56acfb);FaxAccountEvents[_0x5133('0x7')](_0x426e1c,_0x56acfb);_0x3e6742(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x5133('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x160f=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x81b33b,_0x1d15eb){var _0x2a67c2=function(_0xb1595e){while(--_0xb1595e){_0x81b33b['push'](_0x81b33b['shift']());}};_0x2a67c2(++_0x1d15eb);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf160('0x0'));var FaxAccount=require(_0xf160('0x1'))['db'][_0xf160('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf160('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf160('0x4'),'afterDestroy':_0xf160('0x5')};function emitEvent(_0x183b15){return function(_0x3b2d7b,_0x194331,_0xfdbd72){FaxAccountEvents['emit'](_0x183b15+':'+_0x3b2d7b['id'],_0x3b2d7b);FaxAccountEvents[_0xf160('0x6')](_0x183b15,_0x3b2d7b);_0xfdbd72(null);};}for(var e in events){if(events[_0xf160('0x7')](e)){var event=events[e];FaxAccount['hook'](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 a9e7f5a..d25b394 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 _0x8a1e=['exports','define','fax_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes'];(function(_0x24c479,_0x52e4b6){var _0x3e05dd=function(_0x277afc){while(--_0x277afc){_0x24c479['push'](_0x24c479['shift']());}};_0x3e05dd(++_0x52e4b6);}(_0x8a1e,0xea));var _0xe8a1=function(_0x15b6ff,_0x6432f8){_0x15b6ff=_0x15b6ff-0x0;var _0x5c94f8=_0x8a1e[_0x15b6ff];return _0x5c94f8;};'use strict';var _=require(_0xe8a1('0x0'));var util=require(_0xe8a1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe8a1('0x2'));var BPromise=require(_0xe8a1('0x3'));var rp=require(_0xe8a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe8a1('0x5'));var config=require(_0xe8a1('0x6'));var attributes=require(_0xe8a1('0x7'));module[_0xe8a1('0x8')]=function(_0x252830,_0x4924ad){return _0x252830[_0xe8a1('0x9')]('FaxAccount',attributes,{'tableName':_0xe8a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x401f30,_0x4bba01){var _0x419d3b=function(_0x25ff24){while(--_0x25ff24){_0x401f30['push'](_0x401f30['shift']());}};_0x419d3b(++_0x4bba01);}(_0xaca2,0xd0));var _0x2aca=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0xaca2[_0x34e4a0];return _0x3ead3e;};'use strict';var _=require(_0x2aca('0x0'));var util=require(_0x2aca('0x1'));var logger=require(_0x2aca('0x2'))(_0x2aca('0x3'));var moment=require(_0x2aca('0x4'));var BPromise=require(_0x2aca('0x5'));var rp=require(_0x2aca('0x6'));var fs=require('fs');var path=require(_0x2aca('0x7'));var rimraf=require(_0x2aca('0x8'));var config=require(_0x2aca('0x9'));var attributes=require(_0x2aca('0xa'));module['exports']=function(_0x491b69,_0x7a97dd){return _0x491b69[_0x2aca('0xb')](_0x2aca('0xc'),attributes,{'tableName':_0x2aca('0xd'),'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 2686725..71a9c69 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 _0x0042=['Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','ListId','create','contact','Contact\x20not\x20found','spread','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','agent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','model','map','body','fax','CmContact','describe'];(function(_0x23b32a,_0x41d380){var _0x1696f9=function(_0x5cf5e8){while(--_0x5cf5e8){_0x23b32a['push'](_0x23b32a['shift']());}};_0x1696f9(++_0x41d380);}(_0x0042,0xe5));var _0x2004=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0x0042[_0x35bd6c];return _0x2f421d;};'use strict';var _=require(_0x2004('0x0'));var util=require(_0x2004('0x1'));var moment=require(_0x2004('0x2'));var BPromise=require(_0x2004('0x3'));var rs=require(_0x2004('0x4'));var fs=require('fs');var Redis=require(_0x2004('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2004('0x6'));var logger=require(_0x2004('0x7'))(_0x2004('0x8'));var config=require(_0x2004('0x9'));var jayson=require(_0x2004('0xa'));var client=jayson[_0x2004('0xb')]['http']({'port':0x232c});config[_0x2004('0xc')]=_[_0x2004('0xd')](config[_0x2004('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2004('0xc')]));require(_0x2004('0xe'))[_0x2004('0xf')](socket);function respondWithRpcPromise(_0x2abea2,_0x30c2cc,_0x316b28){return new BPromise(function(_0x27d35f,_0x3d4158){return client[_0x2004('0x10')](_0x2abea2,_0x316b28)[_0x2004('0x11')](function(_0x5dc882){logger[_0x2004('0x12')](_0x2004('0x13'),_0x30c2cc,'request\x20sent');logger[_0x2004('0x14')](_0x2004('0x15'),_0x30c2cc,_0x2004('0x16'),JSON[_0x2004('0x17')](_0x5dc882));if(_0x5dc882['error']){if(_0x5dc882['error'][_0x2004('0x18')]===0x1f4){logger[_0x2004('0x19')](_0x2004('0x13'),_0x30c2cc,_0x5dc882['error'][_0x2004('0x1a')]);return _0x3d4158(_0x5dc882[_0x2004('0x19')][_0x2004('0x1a')]);}logger[_0x2004('0x19')](_0x2004('0x13'),_0x30c2cc,_0x5dc882[_0x2004('0x19')][_0x2004('0x1a')]);return _0x27d35f(_0x5dc882[_0x2004('0x19')]['message']);}else{logger[_0x2004('0x12')](_0x2004('0x13'),_0x30c2cc,_0x2004('0x16'));_0x27d35f(_0x5dc882[_0x2004('0x1b')]['message']);}})[_0x2004('0x1c')](function(_0x400c17){logger[_0x2004('0x19')](_0x2004('0x13'),_0x30c2cc,_0x400c17);_0x3d4158(_0x400c17);});});}exports[_0x2004('0x1d')]=function(_0x3b4d93){var _0x4ab7a8=this;return new Promise(function(_0x2e7fe9,_0x437f42){return db[_0x2004('0x1e')][_0x2004('0x1f')]({'raw':_0x3b4d93[_0x2004('0x20')]?_0x3b4d93[_0x2004('0x20')][_0x2004('0x21')]===undefined?!![]:![]:!![],'where':_0x3b4d93['options']?_0x3b4d93[_0x2004('0x20')][_0x2004('0x22')]||null:null,'attributes':_0x3b4d93[_0x2004('0x20')]?_0x3b4d93[_0x2004('0x20')][_0x2004('0x23')]||null:null,'limit':_0x3b4d93['options']?_0x3b4d93[_0x2004('0x20')][_0x2004('0x24')]||null:null,'include':_0x3b4d93['options']?_0x3b4d93[_0x2004('0x20')][_0x2004('0x25')]?_['map'](_0x3b4d93['options'][_0x2004('0x25')],function(_0x2b48df){return{'model':db[_0x2b48df[_0x2004('0x26')]],'as':_0x2b48df['as'],'attributes':_0x2b48df[_0x2004('0x23')],'include':_0x2b48df['include']?_[_0x2004('0x27')](_0x2b48df[_0x2004('0x25')],function(_0x4ff748){return{'model':db[_0x4ff748[_0x2004('0x26')]],'as':_0x4ff748['as'],'attributes':_0x4ff748[_0x2004('0x23')],'include':_0x4ff748[_0x2004('0x25')]?_[_0x2004('0x27')](_0x4ff748[_0x2004('0x25')],function(_0x3409ae){return{'model':db[_0x3409ae[_0x2004('0x26')]],'as':_0x3409ae['as'],'attributes':_0x3409ae['attributes']};}):[]};}):[]};}):[]:[]})[_0x2004('0x11')](function(_0x1d2058){logger[_0x2004('0x12')](_0x2004('0x1d'),_0x3b4d93);logger['debug']('GetFaxAccount',_0x3b4d93,JSON[_0x2004('0x17')](_0x1d2058));_0x2e7fe9(_0x1d2058);})[_0x2004('0x1c')](function(_0x1e52c2){logger[_0x2004('0x19')](_0x2004('0x1d'),_0x1e52c2['message'],_0x3b4d93);_0x437f42(_0x4ab7a8[_0x2004('0x19')](0x1f4,_0x1e52c2[_0x2004('0x1a')]));});});};exports['NotifyFaxAccount']=function(_0x11f2fb,_0xe028c8,_0x4176a1){var _0x2f4231=this;return new Promise(function(_0x459225,_0x1c03f8){var _0x380013={'body':_0x11f2fb[_0x2004('0x28')],'channel':_0x2004('0x29')};var _0x52fa80=[];var _0x500eed=[];var _0x39fbdb={};return db[_0x2004('0x2a')][_0x2004('0x2b')]()[_0x2004('0x11')](function(_0x55d8dd){if(!_0x55d8dd){throw new db[(_0x2004('0x2c'))][(_0x2004('0x2d'))](_0x2004('0x2e'));}_0x52fa80=_[_0x2004('0x2f')](_[_0x2004('0x30')](_0x55d8dd),['createdAt',_0x2004('0x31')]);_0x500eed=_[_0x2004('0x2f')](_['keys'](_0x55d8dd),[_0x2004('0x32'),_0x2004('0x31'),_0x2004('0x33'),'ListId']);if(_0x11f2fb[_0x2004('0x28')]['id']){delete _0x11f2fb['body']['id'];}if(_['isNil'](_0x11f2fb[_0x2004('0x28')][_0x2004('0x34')])){throw new db[(_0x2004('0x2c'))][(_0x2004('0x2d'))]('from\x20is\x20mandatory');}if(_[_0x2004('0x35')](_0x11f2fb['body'][_0x2004('0x28')])||_0x11f2fb[_0x2004('0x28')][_0x2004('0x28')]===''){throw new db[(_0x2004('0x2c'))]['ValidationError'](_0x2004('0x36'));}if(_['isNil'](_0x11f2fb[_0x2004('0x28')][_0x2004('0x37')])){throw new db[(_0x2004('0x2c'))][(_0x2004('0x2d'))](_0x2004('0x38')+_0x500eed);}if(!_['includes'](_0x500eed,_0x11f2fb[_0x2004('0x28')][_0x2004('0x37')])){throw new db[(_0x2004('0x2c'))][(_0x2004('0x2d'))](_0x2004('0x39')+_0x500eed);}_0x39fbdb[_0x11f2fb[_0x2004('0x28')][_0x2004('0x37')]]=_0x11f2fb[_0x2004('0x28')][_0x2004('0x34')];})[_0x2004('0x11')](function(){return db[_0x2004('0x1e')][_0x2004('0x3a')]({'where':{'id':_0x11f2fb[_0x2004('0x3b')]['id']},'include':[{'model':db[_0x2004('0x3c')],'as':_0x2004('0x3d'),'include':[{'model':db[_0x2004('0x2a')],'as':_0x2004('0x3e'),'where':_0x39fbdb,'limit':0x1,'order':[[_0x2004('0x31'),'DESC']]}]},{'model':db[_0x2004('0x3f')],'as':_0x2004('0x40')}]});})['then'](function(_0x5da2a2){if(_0x5da2a2&&_0x5da2a2['List']){var _0x4db7ef=_0x5da2a2[_0x2004('0x41')]({'plain':!![]});_0x380013[_0x2004('0x3b')]=_0x4db7ef;_0x380013[_0x2004('0x42')]=_0x4db7ef['Applications'];_0x380013[_0x2004('0x43')]=_0x4db7ef['List'];_0x380013[_0x2004('0x42')]=_[_0x2004('0x44')](_0x380013[_0x2004('0x42')],[_0x2004('0x45')],[_0x2004('0x46')]);if(_0x380013[_0x2004('0x3b')][_0x2004('0x40')]){delete _0x380013[_0x2004('0x3b')]['Applications'];}if(_0x380013[_0x2004('0x3b')]['List']&&_0x380013[_0x2004('0x3b')][_0x2004('0x3d')][_0x2004('0x3e')][_0x2004('0x47')]){return _0x380013['account'][_0x2004('0x3d')][_0x2004('0x3e')][0x0];}var _0x135390=_[_0x2004('0xd')](_0x11f2fb[_0x2004('0x28')],{'firstName':_0x11f2fb[_0x2004('0x28')][_0x2004('0x34')],'ListId':_0x4db7ef[_0x2004('0x48')]});_0x135390[_0x11f2fb['body'][_0x2004('0x37')]]=_0x11f2fb[_0x2004('0x28')]['from'];return db['CmContact'][_0x2004('0x49')](_0x135390,{'fields':_0x52fa80,'raw':!![]});}})['then'](function(_0x27b94d){_0x380013[_0x2004('0x4a')]=_0x27b94d;if(_0x27b94d){var _0x6f456b={'ContactId':_0x27b94d['id'],'FaxAccountId':_0x11f2fb[_0x2004('0x3b')]['id'],'fax':_0x27b94d[_0x2004('0x29')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x27b94d['id'],'closed':![],'FaxAccountId':_0x11f2fb['account']['id']}})['then'](function(_0x5d95c3){if(_0x5d95c3){return[_0x5d95c3,![]];}return db['FaxInteraction'][_0x2004('0x49')](_0x6f456b)[_0x2004('0x11')](function(_0xe2ad36){return[_0xe2ad36,!![]];});});}else{throw new Error(_0x2004('0x4b'));}})[_0x2004('0x4c')](function(_0x199315,_0xcb7e36){var _0x1332f0=_0x199315[_0x2004('0x41')]({'plain':!![]});if(_0xcb7e36){if(_0x380013[_0x2004('0x3b')][_0x2004('0x4d')]){_0x380013['applications'][_0x2004('0x4e')]({'id':0x0,'priority':_0x380013[_0x2004('0x42')]['length']+0x1,'app':_0x2004('0x4f'),'appdata':'unmanaged','interval':_0x2004('0x50')});}_0x1332f0[_0x2004('0x51')]=!![];}else{_0x1332f0[_0x2004('0x51')]=![];}_0x380013[_0x2004('0x52')]=_0x1332f0;return db[_0x2004('0x53')][_0x2004('0x49')]({'body':_0x11f2fb[_0x2004('0x28')][_0x2004('0x28')],'FaxAccountId':_0x11f2fb[_0x2004('0x3b')]['id'],'FaxInteractionId':_0x199315['id'],'direction':'in','ContactId':_0x199315[_0x2004('0x54')],'AttachmentId':_0x11f2fb[_0x2004('0x28')][_0x2004('0x55')]});})[_0x2004('0x11')](function(_0x421394){_0x380013[_0x2004('0x1a')]=_0x421394;if(_0x380013[_0x2004('0x52')][_0x2004('0x56')]){return db['User'][_0x2004('0x3a')]({'attributes':['id',_0x2004('0x57')],'where':{'id':_0x380013[_0x2004('0x52')][_0x2004('0x56')]}})[_0x2004('0x11')](function(_0x32dfa6){if(_0x32dfa6){_0x380013['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2004('0x58'),'appdata':_0x32dfa6[_0x2004('0x57')]+','+(_0x380013[_0x2004('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':_0x2004('0x50')});}return respondWithRpcPromise('Start',_0x2004('0x59'),_0x380013);});}return respondWithRpcPromise(_0x2004('0x5a'),_0x2004('0x59'),_0x380013);})['then'](function(_0x32f9eb){_0x459225(_0x32f9eb);})[_0x2004('0x1c')](function(_0x2e31e5){_0x1c03f8(_0x2f4231[_0x2004('0x19')](0x1f4,_0x2e31e5[_0x2004('0x1a')]));});});}; \ No newline at end of file +var _0xf6cb=['DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','contact','FaxInteraction','find','create','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','Start','startRouting','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','findAll','options','raw','where','limit','include','model','attributes','map','catch','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','body','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','FaxAccount','account','CmList','List','Contacts'];(function(_0x29900d,_0x35548b){var _0x2d2895=function(_0xa9825d){while(--_0xa9825d){_0x29900d['push'](_0x29900d['shift']());}};_0x2d2895(++_0x35548b);}(_0xf6cb,0x127));var _0xbf6c=function(_0x571d22,_0x8d3445){_0x571d22=_0x571d22-0x0;var _0x562025=_0xf6cb[_0x571d22];return _0x562025;};'use strict';var _=require(_0xbf6c('0x0'));var util=require(_0xbf6c('0x1'));var moment=require(_0xbf6c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf6c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6c('0x4'))(_0xbf6c('0x5'));var config=require(_0xbf6c('0x6'));var jayson=require(_0xbf6c('0x7'));var client=jayson[_0xbf6c('0x8')][_0xbf6c('0x9')]({'port':0x232c});config[_0xbf6c('0xa')]=_[_0xbf6c('0xb')](config['redis'],{'host':_0xbf6c('0xc'),'port':0x18eb});var socket=require(_0xbf6c('0xd'))(new Redis(config[_0xbf6c('0xa')]));require(_0xbf6c('0xe'))[_0xbf6c('0xf')](socket);function respondWithRpcPromise(_0x6220df,_0x5569ab,_0xefea7b){return new BPromise(function(_0x5ca195,_0xc9a7db){return client[_0xbf6c('0x10')](_0x6220df,_0xefea7b)[_0xbf6c('0x11')](function(_0x3ee25c){logger[_0xbf6c('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5569ab,'request\x20sent');logger[_0xbf6c('0x13')](_0xbf6c('0x14'),_0x5569ab,_0xbf6c('0x15'),JSON[_0xbf6c('0x16')](_0x3ee25c));if(_0x3ee25c[_0xbf6c('0x17')]){if(_0x3ee25c['error']['code']===0x1f4){logger[_0xbf6c('0x17')](_0xbf6c('0x18'),_0x5569ab,_0x3ee25c[_0xbf6c('0x17')]['message']);return _0xc9a7db(_0x3ee25c[_0xbf6c('0x17')]['message']);}logger['error'](_0xbf6c('0x18'),_0x5569ab,_0x3ee25c[_0xbf6c('0x17')][_0xbf6c('0x19')]);return _0x5ca195(_0x3ee25c[_0xbf6c('0x17')][_0xbf6c('0x19')]);}else{logger[_0xbf6c('0x12')]('FaxAccount,\x20%s,\x20%s',_0x5569ab,_0xbf6c('0x15'));_0x5ca195(_0x3ee25c[_0xbf6c('0x1a')]['message']);}})['catch'](function(_0x4881c2){logger['error'](_0xbf6c('0x18'),_0x5569ab,_0x4881c2);_0xc9a7db(_0x4881c2);});});}exports[_0xbf6c('0x1b')]=function(_0x1d764d){var _0x3f30fe=this;return new Promise(function(_0x1252f5,_0x8f312d){return db['FaxAccount'][_0xbf6c('0x1c')]({'raw':_0x1d764d[_0xbf6c('0x1d')]?_0x1d764d['options'][_0xbf6c('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d764d[_0xbf6c('0x1d')]?_0x1d764d[_0xbf6c('0x1d')][_0xbf6c('0x1f')]||null:null,'attributes':_0x1d764d[_0xbf6c('0x1d')]?_0x1d764d[_0xbf6c('0x1d')]['attributes']||null:null,'limit':_0x1d764d[_0xbf6c('0x1d')]?_0x1d764d[_0xbf6c('0x1d')][_0xbf6c('0x20')]||null:null,'include':_0x1d764d[_0xbf6c('0x1d')]?_0x1d764d['options']['include']?_['map'](_0x1d764d[_0xbf6c('0x1d')][_0xbf6c('0x21')],function(_0x142fda){return{'model':db[_0x142fda[_0xbf6c('0x22')]],'as':_0x142fda['as'],'attributes':_0x142fda[_0xbf6c('0x23')],'include':_0x142fda[_0xbf6c('0x21')]?_[_0xbf6c('0x24')](_0x142fda[_0xbf6c('0x21')],function(_0x31998a){return{'model':db[_0x31998a[_0xbf6c('0x22')]],'as':_0x31998a['as'],'attributes':_0x31998a[_0xbf6c('0x23')],'include':_0x31998a['include']?_['map'](_0x31998a['include'],function(_0x1380a8){return{'model':db[_0x1380a8['model']],'as':_0x1380a8['as'],'attributes':_0x1380a8['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf6c('0x11')](function(_0x25896d){logger[_0xbf6c('0x12')](_0xbf6c('0x1b'),_0x1d764d);logger['debug'](_0xbf6c('0x1b'),_0x1d764d,JSON[_0xbf6c('0x16')](_0x25896d));_0x1252f5(_0x25896d);})[_0xbf6c('0x25')](function(_0x5d7547){logger[_0xbf6c('0x17')](_0xbf6c('0x1b'),_0x5d7547[_0xbf6c('0x19')],_0x1d764d);_0x8f312d(_0x3f30fe['error'](0x1f4,_0x5d7547[_0xbf6c('0x19')]));});});};exports[_0xbf6c('0x26')]=function(_0x527b98,_0x2db178,_0x1e07f4){var _0x545e0a=this;return new Promise(function(_0x5e22a8,_0x3606ca){var _0x43b40c={'body':_0x527b98['body'],'channel':_0xbf6c('0x27')};var _0x574b67=[];var _0xf11ee2=[];var _0x30db39={};return db[_0xbf6c('0x28')][_0xbf6c('0x29')]()[_0xbf6c('0x11')](function(_0x27dd71){if(!_0x27dd71){throw new db[(_0xbf6c('0x2a'))][(_0xbf6c('0x2b'))](_0xbf6c('0x2c'));}_0x574b67=_[_0xbf6c('0x2d')](_['keys'](_0x27dd71),['createdAt',_0xbf6c('0x2e')]);_0xf11ee2=_[_0xbf6c('0x2d')](_['keys'](_0x27dd71),[_0xbf6c('0x2f'),'updatedAt','CompanyId',_0xbf6c('0x30')]);if(_0x527b98[_0xbf6c('0x31')]['id']){delete _0x527b98[_0xbf6c('0x31')]['id'];}if(_[_0xbf6c('0x32')](_0x527b98['body']['from'])){throw new db[(_0xbf6c('0x2a'))]['ValidationError'](_0xbf6c('0x33'));}if(_['isNil'](_0x527b98[_0xbf6c('0x31')]['body'])||_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x31')]===''){throw new db[(_0xbf6c('0x2a'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbf6c('0x32')](_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x34')])){throw new db['Sequelize'][(_0xbf6c('0x2b'))](_0xbf6c('0x35')+_0xf11ee2);}if(!_[_0xbf6c('0x36')](_0xf11ee2,_0x527b98[_0xbf6c('0x31')]['mapKey'])){throw new db['Sequelize'][(_0xbf6c('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf11ee2);}_0x30db39[_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x34')]]=_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x37')];})[_0xbf6c('0x11')](function(){return db[_0xbf6c('0x38')]['find']({'where':{'id':_0x527b98[_0xbf6c('0x39')]['id']},'include':[{'model':db[_0xbf6c('0x3a')],'as':_0xbf6c('0x3b'),'include':[{'model':db[_0xbf6c('0x28')],'as':_0xbf6c('0x3c'),'where':_0x30db39,'limit':0x1,'order':[[_0xbf6c('0x2e'),_0xbf6c('0x3d')]]}]},{'model':db[_0xbf6c('0x3e')],'as':_0xbf6c('0x3f')}]});})[_0xbf6c('0x11')](function(_0x135427){if(_0x135427&&_0x135427['List']){var _0x3eb8bf=_0x135427[_0xbf6c('0x40')]({'plain':!![]});_0x43b40c[_0xbf6c('0x39')]=_0x3eb8bf;_0x43b40c[_0xbf6c('0x41')]=_0x3eb8bf[_0xbf6c('0x3f')];_0x43b40c[_0xbf6c('0x42')]=_0x3eb8bf['List'];_0x43b40c[_0xbf6c('0x41')]=_[_0xbf6c('0x43')](_0x43b40c['applications'],[_0xbf6c('0x44')],[_0xbf6c('0x45')]);if(_0x43b40c['account'][_0xbf6c('0x3f')]){delete _0x43b40c[_0xbf6c('0x39')][_0xbf6c('0x3f')];}if(_0x43b40c[_0xbf6c('0x39')][_0xbf6c('0x3b')]&&_0x43b40c[_0xbf6c('0x39')]['List'][_0xbf6c('0x3c')][_0xbf6c('0x46')]){return _0x43b40c[_0xbf6c('0x39')][_0xbf6c('0x3b')][_0xbf6c('0x3c')][0x0];}var _0x2a82a6=_[_0xbf6c('0xb')](_0x527b98[_0xbf6c('0x31')],{'firstName':_0x527b98['body'][_0xbf6c('0x37')],'ListId':_0x3eb8bf[_0xbf6c('0x30')]});_0x2a82a6[_0x527b98[_0xbf6c('0x31')]['mapKey']]=_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x37')];return db[_0xbf6c('0x28')]['create'](_0x2a82a6,{'fields':_0x574b67,'raw':!![]});}})['then'](function(_0x80a1bc){_0x43b40c[_0xbf6c('0x47')]=_0x80a1bc;if(_0x80a1bc){var _0x10cdae={'ContactId':_0x80a1bc['id'],'FaxAccountId':_0x527b98[_0xbf6c('0x39')]['id'],'fax':_0x80a1bc[_0xbf6c('0x27')]};return db[_0xbf6c('0x48')][_0xbf6c('0x49')]({'where':{'ContactId':_0x80a1bc['id'],'closed':![],'FaxAccountId':_0x527b98[_0xbf6c('0x39')]['id']}})[_0xbf6c('0x11')](function(_0x52da20){if(_0x52da20){return[_0x52da20,![]];}return db['FaxInteraction'][_0xbf6c('0x4a')](_0x10cdae)['then'](function(_0x39107d){return[_0x39107d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x29b83d,_0x44254f){var _0x4124a0=_0x29b83d['get']({'plain':!![]});if(_0x44254f){if(_0x43b40c['account'][_0xbf6c('0x4b')]){_0x43b40c[_0xbf6c('0x41')][_0xbf6c('0x4c')]({'id':0x0,'priority':_0x43b40c[_0xbf6c('0x41')]['length']+0x1,'app':_0xbf6c('0x4d'),'appdata':'unmanaged','interval':_0xbf6c('0x4e')});}_0x4124a0[_0xbf6c('0x4f')]=!![];}else{_0x4124a0['created']=![];}_0x43b40c[_0xbf6c('0x50')]=_0x4124a0;return db[_0xbf6c('0x51')][_0xbf6c('0x4a')]({'body':_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x31')],'FaxAccountId':_0x527b98[_0xbf6c('0x39')]['id'],'FaxInteractionId':_0x29b83d['id'],'direction':'in','ContactId':_0x29b83d[_0xbf6c('0x52')],'AttachmentId':_0x527b98[_0xbf6c('0x31')][_0xbf6c('0x53')]});})['then'](function(_0x28b7a3){_0x43b40c['message']=_0x28b7a3;if(_0x43b40c[_0xbf6c('0x50')][_0xbf6c('0x54')]){return db['User']['find']({'attributes':['id',_0xbf6c('0x55')],'where':{'id':_0x43b40c[_0xbf6c('0x50')][_0xbf6c('0x54')]}})[_0xbf6c('0x11')](function(_0x370977){if(_0x370977){_0x43b40c[_0xbf6c('0x41')][_0xbf6c('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x370977['name']+','+(_0x43b40c[_0xbf6c('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0xbf6c('0x4e')});}return respondWithRpcPromise(_0xbf6c('0x57'),_0xbf6c('0x58'),_0x43b40c);});}return respondWithRpcPromise(_0xbf6c('0x57'),_0xbf6c('0x58'),_0x43b40c);})[_0xbf6c('0x11')](function(_0x1a6aa0){_0x5e22a8(_0x1a6aa0);})['catch'](function(_0x3baa52){_0x3606ca(_0x545e0a[_0xbf6c('0x17')](0x1f4,_0x3baa52[_0xbf6c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index def28f3..5917d66 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 _0x342a=['./faxAccount.events','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x161381,_0xd4e4d6){var _0x6b5803=function(_0x253455){while(--_0x253455){_0x161381['push'](_0x161381['shift']());}};_0x6b5803(++_0xd4e4d6);}(_0x342a,0xa1));var _0xa342=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x342a[_0xaa0309];return _0x5de7ce;};'use strict';var FaxAccountEvents=require(_0xa342('0x0'));var events=['save',_0xa342('0x1'),_0xa342('0x2')];function createListener(_0x38ef38,_0x53edcb){return function(_0x10c497){_0x53edcb[_0xa342('0x3')](_0x38ef38,_0x10c497);};}function removeListener(_0x3d28d8,_0x39b427){return function(){FaxAccountEvents[_0xa342('0x4')](_0x3d28d8,_0x39b427);};}exports[_0xa342('0x5')]=function(_0x532ce2){for(var _0x2da224=0x0,_0x1b0f8c=events['length'];_0x2da224<_0x1b0f8c;_0x2da224++){var _0x54d265=events[_0x2da224];var _0x3187ec=createListener(_0xa342('0x6')+_0x54d265,_0x532ce2);FaxAccountEvents['on'](_0x54d265,_0x3187ec);}}; \ No newline at end of file +var _0x72c4=['register','length','faxAccount:','save','update','removeListener'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x72c4,0x189));var _0x472c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x72c4[_0x167cc1];return _0x10bc4b;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x472c('0x0'),'remove',_0x472c('0x1')];function createListener(_0x53df3f,_0x1cbc39){return function(_0x5f088c){_0x1cbc39['emit'](_0x53df3f,_0x5f088c);};}function removeListener(_0x12769a,_0x469e66){return function(){FaxAccountEvents[_0x472c('0x2')](_0x12769a,_0x469e66);};}exports[_0x472c('0x3')]=function(_0x2b88da){for(var _0x3d10bb=0x0,_0xf658d7=events[_0x472c('0x4')];_0x3d10bb<_0xf658d7;_0x3d10bb++){var _0x5735a8=events[_0x3d10bb];var _0x51c0e3=createListener(_0x472c('0x5')+_0x5735a8,_0x2b88da);FaxAccountEvents['on'](_0x5735a8,_0x51c0e3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9967f1e..8af4569 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(_0x50baba,_0x5e1ce2){var _0x5c5d48=function(_0x3aecfd){while(--_0x3aecfd){_0x50baba['push'](_0x50baba['shift']());}};_0x5c5d48(++_0x5e1ce2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x117523,_0x41a999){var _0x31f34a=function(_0x3feaa6){while(--_0x3feaa6){_0x117523['push'](_0x117523['shift']());}};_0x31f34a(++_0x41a999);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 9f5bcde..dda33b2 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 _0x618e=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x618e,0x198));var _0xe618=function(_0x20c6af,_0x15ac97){_0x20c6af=_0x20c6af-0x0;var _0x1e8088=_0x618e[_0x20c6af];return _0x1e8088;};'use strict';var Sequelize=require(_0xe618('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe618('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe618('0x2')],'allowNull':![],'defaultValue':_0xe618('0x3')},'appdata':{'type':Sequelize[_0xe618('0x4')]()},'description':{'type':Sequelize[_0xe618('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x294b=['exports','INTEGER','STRING','TEXT'];(function(_0x187f66,_0xbb607b){var _0x422e00=function(_0x1120f9){while(--_0x1120f9){_0x187f66['push'](_0x187f66['shift']());}};_0x422e00(++_0xbb607b);}(_0x294b,0x1e0));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xb294('0x0')]={'priority':{'type':Sequelize[_0xb294('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb294('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb294('0x3')]()},'description':{'type':Sequelize[_0xb294('0x2')]},'interval':{'type':Sequelize[_0xb294('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c239c5f..523befa 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 _0x52c7=['name','send','index','map','FaxApplication','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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'];(function(_0x46d041,_0x4b80db){var _0x294f8a=function(_0x3ba9f4){while(--_0x3ba9f4){_0x46d041['push'](_0x46d041['shift']());}};_0x294f8a(++_0x4b80db);}(_0x52c7,0x6f));var _0x752c=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x52c7[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x752c('0x0'));var zipdir=require(_0x752c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x752c('0x2'));var moment=require(_0x752c('0x3'));var BPromise=require(_0x752c('0x4'));var Mustache=require(_0x752c('0x5'));var util=require(_0x752c('0x6'));var path=require(_0x752c('0x7'));var sox=require(_0x752c('0x8'));var csv=require(_0x752c('0x9'));var ejs=require(_0x752c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x752c('0xb'));var squel=require(_0x752c('0xc'));var crypto=require(_0x752c('0xd'));var jsforce=require(_0x752c('0xe'));var deskjs=require(_0x752c('0xf'));var toCsv=require(_0x752c('0x9'));var querystring=require('querystring');var Papa=require(_0x752c('0x10'));var Redis=require('ioredis');var authService=require(_0x752c('0x11'));var qs=require(_0x752c('0x12'));var as=require(_0x752c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x752c('0x14'));var config=require(_0x752c('0x15'));var licenseUtil=require(_0x752c('0x16'));var db=require(_0x752c('0x17'))['db'];function respondWithStatusCode(_0x5bc92e,_0x40c768){_0x40c768=_0x40c768||0xcc;return function(_0x3d7bc0){if(_0x3d7bc0){return _0x5bc92e[_0x752c('0x18')](_0x40c768);}return _0x5bc92e['status'](_0x40c768)[_0x752c('0x19')]();};}function respondWithResult(_0x88bb2f,_0x14c6a4){_0x14c6a4=_0x14c6a4||0xc8;return function(_0x1191ff){if(_0x1191ff){return _0x88bb2f[_0x752c('0x1a')](_0x14c6a4)[_0x752c('0x1b')](_0x1191ff);}};}function respondWithFilteredResult(_0x2f3d8e,_0x5c95c7){return function(_0x5d56b8){if(_0x5d56b8){var _0x1b8471=typeof _0x5c95c7[_0x752c('0x1c')]===_0x752c('0x1d')&&typeof _0x5c95c7[_0x752c('0x1e')]===_0x752c('0x1d');var _0x35327f=_0x5d56b8[_0x752c('0x1f')];var _0x136482=_0x1b8471?0x0:_0x5c95c7['offset'];var _0x16a494=_0x1b8471?_0x5d56b8[_0x752c('0x1f')]:_0x5c95c7[_0x752c('0x1c')]+_0x5c95c7[_0x752c('0x1e')];var _0x411da9;if(_0x16a494>=_0x35327f){_0x16a494=_0x35327f;_0x411da9=0xc8;}else{_0x411da9=0xce;}_0x2f3d8e[_0x752c('0x1a')](_0x411da9);return _0x2f3d8e[_0x752c('0x20')](_0x752c('0x21'),_0x136482+'-'+_0x16a494+'/'+_0x35327f)['json'](_0x5d56b8);}return null;};}function patchUpdates(_0x201fc9){return function(_0x340b56){try{jsonpatch[_0x752c('0x22')](_0x340b56,_0x201fc9,!![]);}catch(_0x59855b){return BPromise[_0x752c('0x23')](_0x59855b);}return _0x340b56[_0x752c('0x24')]();};}function saveUpdates(_0x434a,_0x34fe6d){return function(_0x413fc2){if(_0x413fc2){return _0x413fc2[_0x752c('0x25')](_0x434a)[_0x752c('0x26')](function(_0x2fec26){return _0x2fec26;});}return null;};}function removeEntity(_0x48facf,_0x5da61e){return function(_0x573b2c){if(_0x573b2c){return _0x573b2c['destroy']()[_0x752c('0x26')](function(){_0x48facf[_0x752c('0x1a')](0xcc)[_0x752c('0x19')]();});}};}function handleEntityNotFound(_0x240171,_0x5a533e){return function(_0x10379d){if(!_0x10379d){_0x240171[_0x752c('0x18')](0x194);}return _0x10379d;};}function handleError(_0x1cf165,_0x372f79){_0x372f79=_0x372f79||0x1f4;return function(_0xad5a39){logger[_0x752c('0x27')](_0xad5a39[_0x752c('0x28')]);if(_0xad5a39[_0x752c('0x29')]){delete _0xad5a39[_0x752c('0x29')];}_0x1cf165[_0x752c('0x1a')](_0x372f79)[_0x752c('0x2a')](_0xad5a39);};}exports[_0x752c('0x2b')]=function(_0x4131e8,_0x4770c3){var _0x275041={},_0x1ea2a1={},_0x2efff1={'count':0x0,'rows':[]};var _0xeb7a33=_[_0x752c('0x2c')](db[_0x752c('0x2d')][_0x752c('0x2e')],function(_0x327779){return{'name':_0x327779[_0x752c('0x2f')],'type':_0x327779['type'][_0x752c('0x30')]};});_0x1ea2a1['model']=_[_0x752c('0x2c')](_0xeb7a33,_0x752c('0x29'));_0x1ea2a1[_0x752c('0x31')]=_['keys'](_0x4131e8['query']);_0x1ea2a1[_0x752c('0x32')]=_['intersection'](_0x1ea2a1[_0x752c('0x33')],_0x1ea2a1[_0x752c('0x31')]);_0x275041[_0x752c('0x34')]=_[_0x752c('0x35')](_0x1ea2a1[_0x752c('0x33')],qs[_0x752c('0x36')](_0x4131e8[_0x752c('0x31')][_0x752c('0x36')]));_0x275041[_0x752c('0x34')]=_0x275041[_0x752c('0x34')][_0x752c('0x37')]?_0x275041[_0x752c('0x34')]:_0x1ea2a1[_0x752c('0x33')];if(!_0x4131e8[_0x752c('0x31')]['hasOwnProperty'](_0x752c('0x38'))){_0x275041['limit']=qs[_0x752c('0x1e')](_0x4131e8[_0x752c('0x31')][_0x752c('0x1e')]);_0x275041[_0x752c('0x1c')]=qs[_0x752c('0x1c')](_0x4131e8[_0x752c('0x31')][_0x752c('0x1c')]);}_0x275041[_0x752c('0x39')]=qs[_0x752c('0x3a')](_0x4131e8['query'][_0x752c('0x3a')]);_0x275041[_0x752c('0x3b')]=qs['filters'](_[_0x752c('0x3c')](_0x4131e8['query'],_0x1ea2a1[_0x752c('0x32')]),_0xeb7a33);if(_0x4131e8[_0x752c('0x31')][_0x752c('0x3d')]){_0x275041['where']=_[_0x752c('0x3e')](_0x275041[_0x752c('0x3b')],{'$or':_[_0x752c('0x2c')](_0xeb7a33,function(_0x21ef26){if(_0x21ef26['type']!=='VIRTUAL'){var _0x551555={};_0x551555[_0x21ef26[_0x752c('0x29')]]={'$like':'%'+_0x4131e8[_0x752c('0x31')][_0x752c('0x3d')]+'%'};return _0x551555;}})});}_0x275041=_[_0x752c('0x3e')]({},_0x275041,_0x4131e8['options']);var _0x1303df={'where':_0x275041[_0x752c('0x3b')]};return db['FaxApplication']['count'](_0x1303df)['then'](function(_0x536b65){_0x2efff1[_0x752c('0x1f')]=_0x536b65;if(_0x4131e8[_0x752c('0x31')][_0x752c('0x3f')]){_0x275041[_0x752c('0x40')]=[{'all':!![]}];}return db[_0x752c('0x2d')][_0x752c('0x41')](_0x275041);})[_0x752c('0x26')](function(_0x4a6bca){_0x2efff1[_0x752c('0x42')]=_0x4a6bca;return _0x2efff1;})[_0x752c('0x26')](respondWithFilteredResult(_0x4770c3,_0x275041))[_0x752c('0x43')](handleError(_0x4770c3,null));};exports[_0x752c('0x44')]=function(_0x31a993,_0x53daea){var _0x1c6d6e={'raw':!![],'where':{'id':_0x31a993['params']['id']}},_0x25e19b={};_0x25e19b[_0x752c('0x33')]=_[_0x752c('0x45')](db[_0x752c('0x2d')][_0x752c('0x2e')]);_0x25e19b[_0x752c('0x31')]=_[_0x752c('0x45')](_0x31a993[_0x752c('0x31')]);_0x25e19b[_0x752c('0x32')]=_[_0x752c('0x35')](_0x25e19b[_0x752c('0x33')],_0x25e19b['query']);_0x1c6d6e[_0x752c('0x34')]=_[_0x752c('0x35')](_0x25e19b['model'],qs[_0x752c('0x36')](_0x31a993['query'][_0x752c('0x36')]));_0x1c6d6e[_0x752c('0x34')]=_0x1c6d6e[_0x752c('0x34')][_0x752c('0x37')]?_0x1c6d6e['attributes']:_0x25e19b[_0x752c('0x33')];if(_0x31a993['query'][_0x752c('0x3f')]){_0x1c6d6e[_0x752c('0x40')]=[{'all':!![]}];}_0x1c6d6e=_[_0x752c('0x3e')]({},_0x1c6d6e,_0x31a993[_0x752c('0x46')]);return db[_0x752c('0x2d')][_0x752c('0x47')](_0x1c6d6e)[_0x752c('0x26')](handleEntityNotFound(_0x53daea,null))[_0x752c('0x26')](respondWithResult(_0x53daea,null))[_0x752c('0x43')](handleError(_0x53daea,null));};exports[_0x752c('0x48')]=function(_0x4d2edc,_0x1e6a7c){return db[_0x752c('0x2d')][_0x752c('0x48')](_0x4d2edc[_0x752c('0x49')],{})[_0x752c('0x26')](respondWithResult(_0x1e6a7c,0xc9))[_0x752c('0x43')](handleError(_0x1e6a7c,null));};exports[_0x752c('0x25')]=function(_0x56bca8,_0x369bbf){if(_0x56bca8[_0x752c('0x49')]['id']){delete _0x56bca8['body']['id'];}return db[_0x752c('0x2d')][_0x752c('0x47')]({'where':{'id':_0x56bca8[_0x752c('0x4a')]['id']}})[_0x752c('0x26')](handleEntityNotFound(_0x369bbf,null))[_0x752c('0x26')](saveUpdates(_0x56bca8[_0x752c('0x49')],null))['then'](respondWithResult(_0x369bbf,null))[_0x752c('0x43')](handleError(_0x369bbf,null));};exports[_0x752c('0x4b')]=function(_0x236112,_0x1ccfbd){return db['FaxApplication'][_0x752c('0x47')]({'where':{'id':_0x236112['params']['id']}})['then'](handleEntityNotFound(_0x1ccfbd,null))[_0x752c('0x26')](removeEntity(_0x1ccfbd,null))[_0x752c('0x43')](handleError(_0x1ccfbd,null));}; \ No newline at end of file +var _0x5c3e=['destroy','end','sendStatus','stack','name','index','map','FaxApplication','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','type','VIRTUAL','options','where','includeAll','include','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','then'];(function(_0x4b4d91,_0x2f97cf){var _0x4d5618=function(_0x53835c){while(--_0x53835c){_0x4b4d91['push'](_0x4b4d91['shift']());}};_0x4d5618(++_0x2f97cf);}(_0x5c3e,0xbf));var _0xe5c3=function(_0x49c6bd,_0x23ef94){_0x49c6bd=_0x49c6bd-0x0;var _0x24e120=_0x5c3e[_0x49c6bd];return _0x24e120;};'use strict';var emlformat=require(_0xe5c3('0x0'));var rimraf=require(_0xe5c3('0x1'));var zipdir=require(_0xe5c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5c3('0x3'));var moment=require(_0xe5c3('0x4'));var BPromise=require(_0xe5c3('0x5'));var Mustache=require(_0xe5c3('0x6'));var util=require('util');var path=require(_0xe5c3('0x7'));var sox=require(_0xe5c3('0x8'));var csv=require(_0xe5c3('0x9'));var ejs=require(_0xe5c3('0xa'));var fs=require('fs');var fs_extra=require(_0xe5c3('0xb'));var _=require('lodash');var squel=require(_0xe5c3('0xc'));var crypto=require(_0xe5c3('0xd'));var jsforce=require(_0xe5c3('0xe'));var deskjs=require(_0xe5c3('0xf'));var toCsv=require(_0xe5c3('0x9'));var querystring=require(_0xe5c3('0x10'));var Papa=require(_0xe5c3('0x11'));var Redis=require(_0xe5c3('0x12'));var authService=require(_0xe5c3('0x13'));var qs=require(_0xe5c3('0x14'));var as=require(_0xe5c3('0x15'));var hardwareService=require(_0xe5c3('0x16'));var logger=require(_0xe5c3('0x17'))(_0xe5c3('0x18'));var utils=require(_0xe5c3('0x19'));var config=require(_0xe5c3('0x1a'));var licenseUtil=require(_0xe5c3('0x1b'));var db=require(_0xe5c3('0x1c'))['db'];function respondWithStatusCode(_0x4ab32b,_0x5edf3a){_0x5edf3a=_0x5edf3a||0xcc;return function(_0x5d6e98){if(_0x5d6e98){return _0x4ab32b['sendStatus'](_0x5edf3a);}return _0x4ab32b[_0xe5c3('0x1d')](_0x5edf3a)['end']();};}function respondWithResult(_0x384be1,_0x483a0c){_0x483a0c=_0x483a0c||0xc8;return function(_0x36f77f){if(_0x36f77f){return _0x384be1['status'](_0x483a0c)[_0xe5c3('0x1e')](_0x36f77f);}};}function respondWithFilteredResult(_0x44eb5e,_0x2ebeb5){return function(_0x5321f0){if(_0x5321f0){var _0x50ec69=typeof _0x2ebeb5[_0xe5c3('0x1f')]===_0xe5c3('0x20')&&typeof _0x2ebeb5[_0xe5c3('0x21')]==='undefined';var _0xb571f2=_0x5321f0[_0xe5c3('0x22')];var _0x11c97f=_0x50ec69?0x0:_0x2ebeb5[_0xe5c3('0x1f')];var _0xfa742c=_0x50ec69?_0x5321f0[_0xe5c3('0x22')]:_0x2ebeb5['offset']+_0x2ebeb5[_0xe5c3('0x21')];var _0x5c2496;if(_0xfa742c>=_0xb571f2){_0xfa742c=_0xb571f2;_0x5c2496=0xc8;}else{_0x5c2496=0xce;}_0x44eb5e[_0xe5c3('0x1d')](_0x5c2496);return _0x44eb5e[_0xe5c3('0x23')]('Content-Range',_0x11c97f+'-'+_0xfa742c+'/'+_0xb571f2)['json'](_0x5321f0);}return null;};}function patchUpdates(_0x4623c9){return function(_0x143fb5){try{jsonpatch[_0xe5c3('0x24')](_0x143fb5,_0x4623c9,!![]);}catch(_0x5d900e){return BPromise[_0xe5c3('0x25')](_0x5d900e);}return _0x143fb5[_0xe5c3('0x26')]();};}function saveUpdates(_0xff8845,_0xabcc28){return function(_0x542ad1){if(_0x542ad1){return _0x542ad1['update'](_0xff8845)[_0xe5c3('0x27')](function(_0x1af9b9){return _0x1af9b9;});}return null;};}function removeEntity(_0x765b81,_0x2c3b76){return function(_0x472e6f){if(_0x472e6f){return _0x472e6f[_0xe5c3('0x28')]()[_0xe5c3('0x27')](function(){_0x765b81[_0xe5c3('0x1d')](0xcc)[_0xe5c3('0x29')]();});}};}function handleEntityNotFound(_0x1c0b74,_0x1ca8e8){return function(_0x9bfb15){if(!_0x9bfb15){_0x1c0b74[_0xe5c3('0x2a')](0x194);}return _0x9bfb15;};}function handleError(_0x1e7379,_0x43bcc9){_0x43bcc9=_0x43bcc9||0x1f4;return function(_0x2f7a1e){logger['error'](_0x2f7a1e[_0xe5c3('0x2b')]);if(_0x2f7a1e[_0xe5c3('0x2c')]){delete _0x2f7a1e[_0xe5c3('0x2c')];}_0x1e7379[_0xe5c3('0x1d')](_0x43bcc9)['send'](_0x2f7a1e);};}exports[_0xe5c3('0x2d')]=function(_0x1e2c7d,_0x421f27){var _0x4de10f={},_0x1e8ac0={},_0x458cf3={'count':0x0,'rows':[]};var _0x5c5f02=_[_0xe5c3('0x2e')](db[_0xe5c3('0x2f')]['rawAttributes'],function(_0x141e29){return{'name':_0x141e29['fieldName'],'type':_0x141e29['type'][_0xe5c3('0x30')]};});_0x1e8ac0[_0xe5c3('0x31')]=_['map'](_0x5c5f02,_0xe5c3('0x2c'));_0x1e8ac0['query']=_[_0xe5c3('0x32')](_0x1e2c7d[_0xe5c3('0x33')]);_0x1e8ac0['filters']=_[_0xe5c3('0x34')](_0x1e8ac0['model'],_0x1e8ac0[_0xe5c3('0x33')]);_0x4de10f[_0xe5c3('0x35')]=_['intersection'](_0x1e8ac0[_0xe5c3('0x31')],qs['fields'](_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x36')]));_0x4de10f['attributes']=_0x4de10f[_0xe5c3('0x35')][_0xe5c3('0x37')]?_0x4de10f[_0xe5c3('0x35')]:_0x1e8ac0[_0xe5c3('0x31')];if(!_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x38')](_0xe5c3('0x39'))){_0x4de10f['limit']=qs[_0xe5c3('0x21')](_0x1e2c7d[_0xe5c3('0x33')]['limit']);_0x4de10f[_0xe5c3('0x1f')]=qs[_0xe5c3('0x1f')](_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x1f')]);}_0x4de10f[_0xe5c3('0x3a')]=qs['sort'](_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x3b')]);_0x4de10f['where']=qs[_0xe5c3('0x3c')](_[_0xe5c3('0x3d')](_0x1e2c7d['query'],_0x1e8ac0['filters']),_0x5c5f02);if(_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x3e')]){_0x4de10f['where']=_[_0xe5c3('0x3f')](_0x4de10f['where'],{'$or':_[_0xe5c3('0x2e')](_0x5c5f02,function(_0x106e7d){if(_0x106e7d[_0xe5c3('0x40')]!==_0xe5c3('0x41')){var _0x187d82={};_0x187d82[_0x106e7d[_0xe5c3('0x2c')]]={'$like':'%'+_0x1e2c7d['query'][_0xe5c3('0x3e')]+'%'};return _0x187d82;}})});}_0x4de10f=_[_0xe5c3('0x3f')]({},_0x4de10f,_0x1e2c7d[_0xe5c3('0x42')]);var _0x21124e={'where':_0x4de10f[_0xe5c3('0x43')]};return db[_0xe5c3('0x2f')][_0xe5c3('0x22')](_0x21124e)[_0xe5c3('0x27')](function(_0x420e14){_0x458cf3['count']=_0x420e14;if(_0x1e2c7d[_0xe5c3('0x33')][_0xe5c3('0x44')]){_0x4de10f[_0xe5c3('0x45')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x4de10f);})[_0xe5c3('0x27')](function(_0x51f670){_0x458cf3[_0xe5c3('0x46')]=_0x51f670;return _0x458cf3;})[_0xe5c3('0x27')](respondWithFilteredResult(_0x421f27,_0x4de10f))[_0xe5c3('0x47')](handleError(_0x421f27,null));};exports['show']=function(_0x107612,_0x464803){var _0x43b06c={'raw':!![],'where':{'id':_0x107612[_0xe5c3('0x48')]['id']}},_0x8ba8cf={};_0x8ba8cf['model']=_['keys'](db['FaxApplication']['rawAttributes']);_0x8ba8cf[_0xe5c3('0x33')]=_[_0xe5c3('0x32')](_0x107612['query']);_0x8ba8cf['filters']=_[_0xe5c3('0x34')](_0x8ba8cf[_0xe5c3('0x31')],_0x8ba8cf[_0xe5c3('0x33')]);_0x43b06c['attributes']=_[_0xe5c3('0x34')](_0x8ba8cf[_0xe5c3('0x31')],qs[_0xe5c3('0x36')](_0x107612['query'][_0xe5c3('0x36')]));_0x43b06c[_0xe5c3('0x35')]=_0x43b06c[_0xe5c3('0x35')][_0xe5c3('0x37')]?_0x43b06c[_0xe5c3('0x35')]:_0x8ba8cf['model'];if(_0x107612['query'][_0xe5c3('0x44')]){_0x43b06c[_0xe5c3('0x45')]=[{'all':!![]}];}_0x43b06c=_[_0xe5c3('0x3f')]({},_0x43b06c,_0x107612[_0xe5c3('0x42')]);return db[_0xe5c3('0x2f')][_0xe5c3('0x49')](_0x43b06c)[_0xe5c3('0x27')](handleEntityNotFound(_0x464803,null))[_0xe5c3('0x27')](respondWithResult(_0x464803,null))[_0xe5c3('0x47')](handleError(_0x464803,null));};exports[_0xe5c3('0x4a')]=function(_0x4ddc14,_0x197541){return db[_0xe5c3('0x2f')]['create'](_0x4ddc14[_0xe5c3('0x4b')],{})['then'](respondWithResult(_0x197541,0xc9))[_0xe5c3('0x47')](handleError(_0x197541,null));};exports[_0xe5c3('0x4c')]=function(_0x1900b1,_0x5e5273){if(_0x1900b1[_0xe5c3('0x4b')]['id']){delete _0x1900b1[_0xe5c3('0x4b')]['id'];}return db[_0xe5c3('0x2f')][_0xe5c3('0x49')]({'where':{'id':_0x1900b1[_0xe5c3('0x48')]['id']}})[_0xe5c3('0x27')](handleEntityNotFound(_0x5e5273,null))[_0xe5c3('0x27')](saveUpdates(_0x1900b1[_0xe5c3('0x4b')],null))[_0xe5c3('0x27')](respondWithResult(_0x5e5273,null))[_0xe5c3('0x47')](handleError(_0x5e5273,null));};exports[_0xe5c3('0x28')]=function(_0x182d54,_0x2d0b6d){return db[_0xe5c3('0x2f')][_0xe5c3('0x49')]({'where':{'id':_0x182d54['params']['id']}})[_0xe5c3('0x27')](handleEntityNotFound(_0x2d0b6d,null))['then'](removeEntity(_0x2d0b6d,null))[_0xe5c3('0x47')](handleError(_0x2d0b6d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 6f6c3a3..83e85ea 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 _0x1fa0=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4f4fb3,_0xbcff79){var _0x5d7c3f=function(_0xdc532d){while(--_0xdc532d){_0x4f4fb3['push'](_0x4f4fb3['shift']());}};_0x5d7c3f(++_0xbcff79);}(_0x1fa0,0x1a3));var _0x01fa=function(_0xe7aa08,_0x480743){_0xe7aa08=_0xe7aa08-0x0;var _0xbc6799=_0x1fa0[_0xe7aa08];return _0xbc6799;};'use strict';var _=require(_0x01fa('0x0'));var util=require('util');var logger=require(_0x01fa('0x1'))(_0x01fa('0x2'));var moment=require(_0x01fa('0x3'));var BPromise=require(_0x01fa('0x4'));var rp=require(_0x01fa('0x5'));var fs=require('fs');var path=require(_0x01fa('0x6'));var rimraf=require('rimraf');var config=require(_0x01fa('0x7'));var attributes=require(_0x01fa('0x8'));module[_0x01fa('0x9')]=function(_0x2cf5dc,_0x27aa9e){return _0x2cf5dc[_0x01fa('0xa')]('FaxApplication',attributes,{'tableName':_0x01fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01fa('0xc'),'collate':_0x01fa('0xd')});}; \ No newline at end of file +var _0x0ab6=['utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications'];(function(_0x26cf74,_0x3da273){var _0x886083=function(_0x4af2cc){while(--_0x4af2cc){_0x26cf74['push'](_0x26cf74['shift']());}};_0x886083(++_0x3da273);}(_0x0ab6,0x1d6));var _0x60ab=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0ab6[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x60ab('0x0'));var moment=require(_0x60ab('0x1'));var BPromise=require(_0x60ab('0x2'));var rp=require(_0x60ab('0x3'));var fs=require('fs');var path=require(_0x60ab('0x4'));var rimraf=require('rimraf');var config=require(_0x60ab('0x5'));var attributes=require(_0x60ab('0x6'));module[_0x60ab('0x7')]=function(_0x62877b,_0x59e423){return _0x62877b[_0x60ab('0x8')](_0x60ab('0x9'),attributes,{'tableName':_0x60ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60ab('0xb'),'collate':_0x60ab('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e8064e3..83b3755 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 _0x385e=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash'];(function(_0x3da912,_0x5e910a){var _0x355e45=function(_0x21b986){while(--_0x21b986){_0x3da912['push'](_0x3da912['shift']());}};_0x355e45(++_0x5e910a);}(_0x385e,0xdf));var _0xe385=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x385e[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0xe385('0x0'));var util=require(_0xe385('0x1'));var moment=require(_0xe385('0x2'));var BPromise=require(_0xe385('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe385('0x4'))['db'];var utils=require(_0xe385('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe385('0x6'));var jayson=require(_0xe385('0x7'));var client=jayson[_0xe385('0x8')][_0xe385('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x227120,_0x32ac4d,_0x567000){return new BPromise(function(_0xd3a544,_0x582642){return client[_0xe385('0xa')](_0x227120,_0x567000)[_0xe385('0xb')](function(_0xf4a14b){logger[_0xe385('0xc')]('FaxApplication,\x20%s,\x20%s',_0x32ac4d,_0xe385('0xd'));logger[_0xe385('0xe')](_0xe385('0xf'),_0x32ac4d,_0xe385('0xd'),JSON[_0xe385('0x10')](_0xf4a14b));if(_0xf4a14b[_0xe385('0x11')]){if(_0xf4a14b[_0xe385('0x11')][_0xe385('0x12')]===0x1f4){logger[_0xe385('0x11')]('FaxApplication,\x20%s,\x20%s',_0x32ac4d,_0xf4a14b[_0xe385('0x11')]['message']);return _0x582642(_0xf4a14b['error'][_0xe385('0x13')]);}logger['error'](_0xe385('0x14'),_0x32ac4d,_0xf4a14b[_0xe385('0x11')][_0xe385('0x13')]);return _0xd3a544(_0xf4a14b['error'][_0xe385('0x13')]);}else{logger[_0xe385('0xc')]('FaxApplication,\x20%s,\x20%s',_0x32ac4d,_0xe385('0xd'));_0xd3a544(_0xf4a14b[_0xe385('0x15')][_0xe385('0x13')]);}})[_0xe385('0x16')](function(_0x55432b){logger['error']('FaxApplication,\x20%s,\x20%s',_0x32ac4d,_0x55432b);_0x582642(_0x55432b);});});}exports[_0xe385('0x17')]=function(_0x50f7ce){var _0x330603=this;return new Promise(function(_0x4ea1e8,_0x5c48c5){return db[_0xe385('0x18')][_0xe385('0x19')](_0x50f7ce[_0xe385('0x1a')],{'raw':_0x50f7ce[_0xe385('0x1b')]?_0x50f7ce[_0xe385('0x1b')][_0xe385('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50f7ce[_0xe385('0x1b')]?_0x50f7ce[_0xe385('0x1b')][_0xe385('0x1d')]||null:null,'attributes':_0x50f7ce[_0xe385('0x1b')]?_0x50f7ce[_0xe385('0x1b')][_0xe385('0x1e')]||null:null,'limit':_0x50f7ce[_0xe385('0x1b')]?_0x50f7ce[_0xe385('0x1b')][_0xe385('0x1f')]||null:null})[_0xe385('0xb')](function(_0x3237f9){logger[_0xe385('0xc')]('UpdateFaxApplication',_0x50f7ce);logger[_0xe385('0xe')](_0xe385('0x17'),_0x50f7ce,JSON['stringify'](_0x3237f9));_0x4ea1e8(_0x3237f9);})['catch'](function(_0x380280){logger[_0xe385('0x11')]('UpdateFaxApplication',_0x380280[_0xe385('0x13')],_0x50f7ce);_0x5c48c5(_0x330603[_0xe385('0x11')](0x1f4,_0x380280[_0xe385('0x13')]));});});}; \ No newline at end of file +var _0x77aa=['message','info','result','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','then','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4a3e36,_0x431412){var _0x50aebb=function(_0x51486c){while(--_0x51486c){_0x4a3e36['push'](_0x4a3e36['shift']());}};_0x50aebb(++_0x431412);}(_0x77aa,0x89));var _0xa77a=function(_0x438d43,_0x5cdc35){_0x438d43=_0x438d43-0x0;var _0x5a0cd3=_0x77aa[_0x438d43];return _0x5a0cd3;};'use strict';var _=require(_0xa77a('0x0'));var util=require(_0xa77a('0x1'));var moment=require(_0xa77a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa77a('0x3'));var fs=require('fs');var Redis=require(_0xa77a('0x4'));var db=require(_0xa77a('0x5'))['db'];var utils=require(_0xa77a('0x6'));var logger=require(_0xa77a('0x7'))(_0xa77a('0x8'));var config=require(_0xa77a('0x9'));var jayson=require(_0xa77a('0xa'));var client=jayson[_0xa77a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe85259,_0x40f941,_0x5b8cf7){return new BPromise(function(_0x344457,_0x183a55){return client['request'](_0xe85259,_0x5b8cf7)['then'](function(_0x2c752e){logger['info'](_0xa77a('0xc'),_0x40f941,'request\x20sent');logger[_0xa77a('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x40f941,_0xa77a('0xe'),JSON[_0xa77a('0xf')](_0x2c752e));if(_0x2c752e['error']){if(_0x2c752e[_0xa77a('0x10')][_0xa77a('0x11')]===0x1f4){logger[_0xa77a('0x10')]('FaxApplication,\x20%s,\x20%s',_0x40f941,_0x2c752e[_0xa77a('0x10')][_0xa77a('0x12')]);return _0x183a55(_0x2c752e[_0xa77a('0x10')][_0xa77a('0x12')]);}logger[_0xa77a('0x10')](_0xa77a('0xc'),_0x40f941,_0x2c752e['error'][_0xa77a('0x12')]);return _0x344457(_0x2c752e[_0xa77a('0x10')][_0xa77a('0x12')]);}else{logger[_0xa77a('0x13')](_0xa77a('0xc'),_0x40f941,_0xa77a('0xe'));_0x344457(_0x2c752e[_0xa77a('0x14')][_0xa77a('0x12')]);}})['catch'](function(_0x378666){logger[_0xa77a('0x10')](_0xa77a('0xc'),_0x40f941,_0x378666);_0x183a55(_0x378666);});});}exports[_0xa77a('0x15')]=function(_0x57cdc4){var _0x1ae382=this;return new Promise(function(_0x2b8b00,_0x3f1d13){return db[_0xa77a('0x16')][_0xa77a('0x17')](_0x57cdc4[_0xa77a('0x18')],{'raw':_0x57cdc4[_0xa77a('0x19')]?_0x57cdc4[_0xa77a('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57cdc4[_0xa77a('0x19')]?_0x57cdc4['options'][_0xa77a('0x1a')]||null:null,'attributes':_0x57cdc4['options']?_0x57cdc4[_0xa77a('0x19')][_0xa77a('0x1b')]||null:null,'limit':_0x57cdc4[_0xa77a('0x19')]?_0x57cdc4['options'][_0xa77a('0x1c')]||null:null})[_0xa77a('0x1d')](function(_0x313478){logger[_0xa77a('0x13')](_0xa77a('0x15'),_0x57cdc4);logger['debug'](_0xa77a('0x15'),_0x57cdc4,JSON[_0xa77a('0xf')](_0x313478));_0x2b8b00(_0x313478);})[_0xa77a('0x1e')](function(_0x390cab){logger[_0xa77a('0x10')](_0xa77a('0x15'),_0x390cab[_0xa77a('0x12')],_0x57cdc4);_0x3f1d13(_0x1ae382['error'](0x1f4,_0x390cab[_0xa77a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9740a62..709e17c 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 _0x9354=['Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util','path','express'];(function(_0x6a1952,_0x513f3e){var _0x27f8b8=function(_0x1301b8){while(--_0x1301b8){_0x6a1952['push'](_0x6a1952['shift']());}};_0x27f8b8(++_0x513f3e);}(_0x9354,0x96));var _0x4935=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x9354[_0x4706a6];return _0x1bb705;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['post']('/',auth[_0x4935('0x9')](),controller['create']);router[_0x4935('0xd')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4935('0x10')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56263a,_0x2ae425){_0x56263a=_0x56263a-0x0;var _0x112eb9=_0x9ffd[_0x56263a];return _0x112eb9;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e030100..ccba8f8 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 _0x1320=['sequelize','exports','BOOLEAN','STRING','DATE','out'];(function(_0x954fb4,_0x400b09){var _0x4109af=function(_0x48c3c9){while(--_0x48c3c9){_0x954fb4['push'](_0x954fb4['shift']());}};_0x4109af(++_0x400b09);}(_0x1320,0x180));var _0x0132=function(_0x328e34,_0x4fabd0){_0x328e34=_0x328e34-0x0;var _0x1b0d06=_0x1320[_0x328e34];return _0x1b0d06;};'use strict';var Sequelize=require(_0x0132('0x0'));module[_0x0132('0x1')]={'closed':{'type':Sequelize[_0x0132('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0132('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x0132('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0132('0x4')]},'fax':{'type':Sequelize[_0x0132('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0132('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0132('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xbd41=['exports','DATE','STRING','out','ENUM','sequelize'];(function(_0x722939,_0x4fb48a){var _0x32f43d=function(_0x2e758a){while(--_0x2e758a){_0x722939['push'](_0x722939['shift']());}};_0x32f43d(++_0x4fb48a);}(_0xbd41,0x1c1));var _0x1bd4=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xbd41[_0x3452a8];return _0x233814;};'use strict';var Sequelize=require(_0x1bd4('0x0'));module[_0x1bd4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bd4('0x2')]},'disposition':{'type':Sequelize[_0x1bd4('0x3')]},'secondDisposition':{'type':Sequelize[_0x1bd4('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1bd4('0x3')]},'note':{'type':Sequelize[_0x1bd4('0x3')]},'read1stAt':{'type':Sequelize[_0x1bd4('0x2')]},'fax':{'type':Sequelize[_0x1bd4('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1bd4('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1bd4('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 9ba4da3..9b9e1e4 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 _0x3d62=['length','includeAll','merge','options','FaxInteraction','find','then','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','Tag','color','faxInteractionTags:save','download','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','zip-dir','bluebird','path','lodash','../../components/interaction/service','../../config/logger','api','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','index','map','rawAttributes','getOptions','findAll','query','user','catch','show','model','keys','attributes','intersection','fields'];(function(_0x39464f,_0x5b0f3f){var _0x4033e5=function(_0x436c13){while(--_0x436c13){_0x39464f['push'](_0x39464f['shift']());}};_0x4033e5(++_0x5b0f3f);}(_0x3d62,0x100));var _0x23d6=function(_0x565c5c,_0x32108c){_0x565c5c=_0x565c5c-0x0;var _0x1046da=_0x3d62[_0x565c5c];return _0x1046da;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x23d6('0x0'));var moment=require('moment');var BPromise=require(_0x23d6('0x1'));var util=require('util');var path=require(_0x23d6('0x2'));var fs=require('fs');var _=require(_0x23d6('0x3'));var Redis=require('ioredis');var interaction=require(_0x23d6('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x23d6('0x5'))(_0x23d6('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x23d6('0x7')]=_[_0x23d6('0x8')](config[_0x23d6('0x7')],{'host':_0x23d6('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23d6('0x7')]));require(_0x23d6('0xa'))[_0x23d6('0xb')](socket);function respondWithStatusCode(_0x8dd63,_0x569dde){_0x569dde=_0x569dde||0xcc;return function(_0x26f970){if(_0x26f970){return _0x8dd63[_0x23d6('0xc')](_0x569dde);}return _0x8dd63[_0x23d6('0xd')](_0x569dde)[_0x23d6('0xe')]();};}function respondWithResult(_0x33f3f1,_0x570f9e){_0x570f9e=_0x570f9e||0xc8;return function(_0x1518cc){if(_0x1518cc){return _0x33f3f1[_0x23d6('0xd')](_0x570f9e)[_0x23d6('0xf')](_0x1518cc);}};}function respondWithFilteredResult(_0x5c47b3,_0xd25e0a){return function(_0x20a0f4){if(_0x20a0f4){var _0x38b6e7=typeof _0xd25e0a[_0x23d6('0x10')]===_0x23d6('0x11')&&typeof _0xd25e0a[_0x23d6('0x12')]===_0x23d6('0x11');var _0x131566=_0x20a0f4['count'];var _0x1afa5e=_0x38b6e7?0x0:_0xd25e0a[_0x23d6('0x10')];var _0x502b05=_0x38b6e7?_0x20a0f4[_0x23d6('0x13')]:_0xd25e0a[_0x23d6('0x10')]+_0xd25e0a[_0x23d6('0x12')];var _0x4217d0;if(_0x502b05>=_0x131566){_0x502b05=_0x131566;_0x4217d0=0xc8;}else{_0x4217d0=0xce;}_0x5c47b3[_0x23d6('0xd')](_0x4217d0);return _0x5c47b3[_0x23d6('0x14')](_0x23d6('0x15'),_0x1afa5e+'-'+_0x502b05+'/'+_0x131566)[_0x23d6('0xf')](_0x20a0f4);}return null;};}function saveUpdates(_0xd943cc){return function(_0x86fde2){if(_0x86fde2){return _0x86fde2[_0x23d6('0x16')](_0xd943cc)['then'](function(_0x220285){return _0x220285;});}return null;};}function removeEntity(_0x4ed5c1){return function(_0x3eb0bc){if(_0x3eb0bc){return _0x3eb0bc[_0x23d6('0x17')]()['then'](function(){_0x4ed5c1[_0x23d6('0xd')](0xcc)[_0x23d6('0xe')]();});}};}function handleEntityNotFound(_0x1b3671){return function(_0x48f702){if(!_0x48f702){_0x1b3671['sendStatus'](0x194);}return _0x48f702;};}function handleError(_0x238015,_0x583b90){_0x583b90=_0x583b90||0x1f4;return function(_0x2daa16){logger['error'](_0x2daa16[_0x23d6('0x18')]);if(_0x2daa16[_0x23d6('0x19')]){delete _0x2daa16[_0x23d6('0x19')];}_0x238015[_0x23d6('0xd')](_0x583b90)[_0x23d6('0x1a')](_0x2daa16);};}exports[_0x23d6('0x1b')]=function(_0x903bae,_0x5552cb){var _0x25a149={};var _0x591fb=_[_0x23d6('0x1c')](db['FaxInteraction'][_0x23d6('0x1d')],function(_0x4247a1){return{'name':_0x4247a1['fieldName'],'type':_0x4247a1['type']['key']};});_0x25a149=qs[_0x23d6('0x1e')](_0x591fb,_0x903bae);return interaction[_0x23d6('0x1f')]('fax',_0x903bae[_0x23d6('0x20')],_0x903bae[_0x23d6('0x21')],_0x25a149,_0x591fb)['then'](respondWithFilteredResult(_0x5552cb,_0x25a149))[_0x23d6('0x22')](handleError(_0x5552cb,null));};exports[_0x23d6('0x23')]=function(_0x23f2d8,_0x34de6e){var _0x112b05={'raw':![],'where':{'id':_0x23f2d8['params']['id']}},_0x3fe94c={};_0x3fe94c[_0x23d6('0x24')]=_[_0x23d6('0x25')](db['FaxInteraction'][_0x23d6('0x1d')]);_0x3fe94c[_0x23d6('0x20')]=_[_0x23d6('0x25')](_0x23f2d8[_0x23d6('0x20')]);_0x3fe94c['filters']=_['intersection'](_0x3fe94c[_0x23d6('0x24')],_0x3fe94c['query']);_0x112b05[_0x23d6('0x26')]=_[_0x23d6('0x27')](_0x3fe94c['model'],qs[_0x23d6('0x28')](_0x23f2d8['query'][_0x23d6('0x28')]));_0x112b05[_0x23d6('0x26')]=_0x112b05[_0x23d6('0x26')][_0x23d6('0x29')]?_0x112b05[_0x23d6('0x26')]:_0x3fe94c[_0x23d6('0x24')];if(_0x23f2d8['query'][_0x23d6('0x2a')]){_0x112b05['include']=[{'all':!![]}];}_0x112b05=_[_0x23d6('0x2b')]({},_0x112b05,_0x23f2d8[_0x23d6('0x2c')]);return db[_0x23d6('0x2d')][_0x23d6('0x2e')](_0x112b05)[_0x23d6('0x2f')](handleEntityNotFound(_0x34de6e,null))[_0x23d6('0x2f')](respondWithResult(_0x34de6e,null))[_0x23d6('0x22')](handleError(_0x34de6e,null));};exports[_0x23d6('0x30')]=function(_0x561b6b,_0x2ca956){return db['FaxInteraction'][_0x23d6('0x30')](_0x561b6b[_0x23d6('0x31')],{})[_0x23d6('0x2f')](respondWithResult(_0x2ca956,0xc9))['catch'](handleError(_0x2ca956,null));};exports[_0x23d6('0x16')]=function(_0x13565f,_0x59d2a8){if(_0x13565f['body']['id']){delete _0x13565f[_0x23d6('0x31')]['id'];}return db[_0x23d6('0x2d')][_0x23d6('0x2e')]({'where':{'id':_0x13565f['params']['id']}})['then'](handleEntityNotFound(_0x59d2a8,null))['then'](saveUpdates(_0x13565f[_0x23d6('0x31')],null))[_0x23d6('0x2f')](respondWithResult(_0x59d2a8,null))[_0x23d6('0x22')](handleError(_0x59d2a8,null));};exports['destroy']=function(_0x4cd68b,_0x1b5bd6){return db['FaxInteraction']['find']({'where':{'id':_0x4cd68b[_0x23d6('0x32')]['id']}})[_0x23d6('0x2f')](handleEntityNotFound(_0x1b5bd6,null))[_0x23d6('0x2f')](removeEntity(_0x1b5bd6,null))['catch'](handleError(_0x1b5bd6,null));};exports[_0x23d6('0x33')]=function(_0x2f079c,_0x2f429c){return db['FaxInteraction'][_0x23d6('0x33')]()['then'](respondWithResult(_0x2f429c,null))['catch'](handleError(_0x2f429c,null));};exports[_0x23d6('0x34')]=function(_0x32a9fd,_0xd25553){return db['FaxMessage']['find']({'where':{'id':_0x32a9fd[_0x23d6('0x32')]['id']}})[_0x23d6('0x2f')](handleEntityNotFound(_0xd25553,null))[_0x23d6('0x2f')](function(_0xfcfd38){if(_0xfcfd38){return _0xfcfd38[_0x23d6('0x34')](_0x32a9fd[_0x23d6('0x31')][_0x23d6('0x35')],_[_0x23d6('0x36')](_0x32a9fd[_0x23d6('0x31')],[_0x23d6('0x35'),'id'])||{});}})[_0x23d6('0x2f')](respondWithResult(_0xd25553,null))[_0x23d6('0x22')](handleError(_0xd25553,null));};exports[_0x23d6('0x37')]=function(_0x5e541b,_0x4a118d){var _0x292f84={'raw':![],'where':{}};var _0x32686e={};var _0x39174e={'count':0x0,'rows':[]};return db[_0x23d6('0x2d')][_0x23d6('0x38')]({'where':{'id':_0x5e541b[_0x23d6('0x32')]['id']}})['then'](handleEntityNotFound(_0x4a118d,null))[_0x23d6('0x2f')](function(_0x3ce8df){if(_0x3ce8df){_0x32686e[_0x23d6('0x24')]=_[_0x23d6('0x25')](db[_0x23d6('0x39')][_0x23d6('0x1d')]);_0x32686e[_0x23d6('0x20')]=_[_0x23d6('0x25')](_0x5e541b[_0x23d6('0x20')]);_0x32686e['filters']=_[_0x23d6('0x27')](_0x32686e['model'],_0x32686e[_0x23d6('0x20')]);_0x292f84[_0x23d6('0x26')]=_[_0x23d6('0x27')](_0x32686e[_0x23d6('0x24')],qs['fields'](_0x5e541b[_0x23d6('0x20')]['fields']));_0x292f84[_0x23d6('0x26')]=_0x292f84[_0x23d6('0x26')][_0x23d6('0x29')]?_0x292f84[_0x23d6('0x26')]:_0x32686e['model'];if(!_0x5e541b['query'][_0x23d6('0x3a')](_0x23d6('0x3b'))){_0x292f84[_0x23d6('0x12')]=qs[_0x23d6('0x12')](_0x5e541b[_0x23d6('0x20')][_0x23d6('0x12')]);_0x292f84[_0x23d6('0x10')]=qs[_0x23d6('0x10')](_0x5e541b['query'][_0x23d6('0x10')]);}_0x292f84[_0x23d6('0x3c')]=qs[_0x23d6('0x3d')](_0x5e541b[_0x23d6('0x20')][_0x23d6('0x3d')]);_0x292f84[_0x23d6('0x3e')]=qs['filters'](_[_0x23d6('0x3f')](_0x5e541b[_0x23d6('0x20')],_0x32686e['filters']));_0x292f84[_0x23d6('0x3e')][_0x23d6('0x40')]=_0x3ce8df['id'];if(_0x5e541b[_0x23d6('0x20')][_0x23d6('0x41')]){_0x292f84[_0x23d6('0x3e')]=_[_0x23d6('0x2b')](_0x292f84[_0x23d6('0x3e')],{'$or':_[_0x23d6('0x1c')](_0x292f84[_0x23d6('0x26')],function(_0x588b64){var _0x54e86a={};_0x54e86a[_0x588b64]={'$like':'%'+_0x5e541b[_0x23d6('0x20')][_0x23d6('0x41')]+'%'};return _0x54e86a;})});}if(_0x5e541b[_0x23d6('0x20')][_0x23d6('0x42')]){var _0x503180=_0x5e541b[_0x23d6('0x20')]['$gte'][_0x23d6('0x43')](',');var _0x158485={};_0x158485[_0x503180[0x0]]={'$gte':moment(_0x503180[0x1])[_0x23d6('0x44')](_0x23d6('0x45'))};_0x292f84[_0x23d6('0x3e')]=_[_0x23d6('0x2b')](_0x292f84['where'],_0x158485);}_0x292f84=_[_0x23d6('0x2b')]({},_0x292f84,_0x5e541b[_0x23d6('0x2c')]);return db[_0x23d6('0x39')][_0x23d6('0x13')]({'where':_0x292f84['where']})[_0x23d6('0x2f')](function(_0xf704c4){_0x39174e[_0x23d6('0x13')]=_0xf704c4;if(_0x5e541b[_0x23d6('0x20')][_0x23d6('0x2a')]){_0x292f84[_0x23d6('0x46')]=[{'all':!![]}];}return db[_0x23d6('0x39')][_0x23d6('0x1f')](_0x292f84);})[_0x23d6('0x2f')](function(_0x2fc075){_0x39174e[_0x23d6('0x47')]=_0x2fc075;return _0x39174e;});}})[_0x23d6('0x2f')](respondWithFilteredResult(_0x4a118d,_0x292f84))[_0x23d6('0x22')](handleError(_0x4a118d,null));};exports[_0x23d6('0x48')]=function(_0x5ec35e,_0x24cfcd){return db[_0x23d6('0x2d')]['find']({'where':{'id':_0x5ec35e['params']['id']}})['then'](handleEntityNotFound(_0x24cfcd,null))[_0x23d6('0x2f')](function(_0xd3313f){if(_0xd3313f){return _0xd3313f['setTags'](_0x5ec35e[_0x23d6('0x31')][_0x23d6('0x35')],_[_0x23d6('0x36')](_0x5ec35e[_0x23d6('0x31')],[_0x23d6('0x35'),'id'])||{})['spread'](function(){return db[_0x23d6('0x49')][_0x23d6('0x1f')]({'attributes':['id',_0x23d6('0x19'),_0x23d6('0x4a')],'where':{'id':_0x5ec35e[_0x23d6('0x31')]['ids']}});})[_0x23d6('0x2f')](function(_0x5cdecd){socket['emit'](_0x23d6('0x4b'),{'id':Number(_0x5ec35e[_0x23d6('0x32')]['id']),'tags':_0x5cdecd||[]});return{'id':Number(_0x5ec35e[_0x23d6('0x32')]['id']),'tags':_0x5cdecd||[]};});}})['then'](respondWithResult(_0x24cfcd,null))[_0x23d6('0x22')](handleError(_0x24cfcd,null));};exports['removeTags']=function(_0x3e3bdf,_0x3c9ea1){return db[_0x23d6('0x2d')][_0x23d6('0x2e')]({'where':{'id':_0x3e3bdf[_0x23d6('0x32')]['id']}})[_0x23d6('0x2f')](handleEntityNotFound(_0x3c9ea1,null))[_0x23d6('0x2f')](function(_0x24e047){if(_0x24e047){return _0x24e047['removeTags'](_0x3e3bdf[_0x23d6('0x20')][_0x23d6('0x35')]);}})[_0x23d6('0x2f')](respondWithStatusCode(_0x3c9ea1,null))['catch'](handleError(_0x3c9ea1,null));};exports[_0x23d6('0x4c')]=function(_0x218ab7,_0x3fb590){var _0x4a53fa=moment()['unix']()[_0x23d6('0x4d')]();var _0x35b926=path['join'](config[_0x23d6('0x4e')],_0x23d6('0x4f'),_0x23d6('0x50'),_0x23d6('0x51'));var _0x4272d1=path[_0x23d6('0x52')](config['root'],'server',_0x23d6('0x50'),_0x23d6('0x53'));var _0x305d72=path['join'](_0x35b926,_0x4a53fa);var _0x6ffc3=util[_0x23d6('0x44')](_0x23d6('0x54'),_0x218ab7[_0x23d6('0x32')]['id'],_0x4a53fa);var _0x5ad384=path['join'](_0x35b926,_0x6ffc3);var _0x200a35=[];_0x200a35[_0x23d6('0x55')]({'model':db[_0x23d6('0x56')],'as':_0x23d6('0x56'),'raw':!![]});var _0x5ae768=[{'model':db[_0x23d6('0x39')],'as':_0x23d6('0x57'),'attributes':['id','body',_0x23d6('0x58')],'include':_0x200a35}];return db[_0x23d6('0x2d')][_0x23d6('0x2e')]({'where':{'id':_0x218ab7[_0x23d6('0x32')]['id']},'include':_0x5ae768})[_0x23d6('0x2f')](handleEntityNotFound(_0x3fb590,null))[_0x23d6('0x2f')](function(_0x5d7fb3){if(_0x5d7fb3&&_0x5d7fb3['Messages']){var _0x444b12=_0x5d7fb3['get']({'plain':!![]});fs[_0x23d6('0x59')](_0x305d72);for(var _0x9b8529=0x0;_0x9b8529<_0x444b12[_0x23d6('0x57')][_0x23d6('0x29')];_0x9b8529++){var _0x267b81=_0x444b12[_0x23d6('0x57')][_0x9b8529][_0x23d6('0x56')];if(_0x267b81){var _0x558273=path[_0x23d6('0x52')](_0x4272d1,_0x267b81[_0x23d6('0x5a')]);if(fs[_0x23d6('0x5b')](_0x558273)){fs[_0x23d6('0x5c')](_0x558273)[_0x23d6('0x5d')](fs[_0x23d6('0x5e')](path[_0x23d6('0x52')](_0x305d72,_0x267b81[_0x23d6('0x5a')])));}}}return BPromise[_0x23d6('0x5f')]()['then'](function(){return new BPromise(function(_0x3269ca,_0x91d919){zipdir(_0x305d72,{'saveTo':_0x5ad384},function(_0x18859a,_0x2bdb30){if(_0x18859a)return _0x91d919(_0x18859a);return _0x3269ca(_0x2bdb30);});})['then'](function(){return new BPromise(function(_0x416838,_0x69c4db){rimraf(_0x305d72,function(_0x57282a){if(_0x57282a)_0x69c4db(_0x57282a);return _0x416838();});});})[_0x23d6('0x2f')](function(){return _0x3fb590[_0x23d6('0x4c')](_0x5ad384,_0x6ffc3,function(_0x194841){if(_0x194841){console[_0x23d6('0x60')](_0x23d6('0x61'),_0x194841);}else{fs[_0x23d6('0x62')](_0x5ad384);}});});});}else{return _0x3fb590[_0x23d6('0xc')](0xc8);}})[_0x23d6('0x22')](handleError(_0x3fb590,null));}; \ No newline at end of file +var _0xc9e2=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','existsSync','pipe','createWriteStream','basename','resolve','err','zip-dir','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','offset','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','fax','query','user','catch','params','model','keys','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','omit','findOne','FaxMessage','filters','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0xc9e2,0x1ba));var _0x2c9e=function(_0x260e23,_0x2ea2c8){_0x260e23=_0x260e23-0x0;var _0x46d899=_0xc9e2[_0x260e23];return _0x46d899;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x2c9e('0x0'));var moment=require(_0x2c9e('0x1'));var BPromise=require(_0x2c9e('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c9e('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x2c9e('0x4'));var logger=require('../../config/logger')(_0x2c9e('0x5'));var config=require(_0x2c9e('0x6'));var db=require(_0x2c9e('0x7'))['db'];config[_0x2c9e('0x8')]=_[_0x2c9e('0x9')](config[_0x2c9e('0x8')],{'host':_0x2c9e('0xa'),'port':0x18eb});var socket=require(_0x2c9e('0xb'))(new Redis(config[_0x2c9e('0x8')]));require(_0x2c9e('0xc'))[_0x2c9e('0xd')](socket);function respondWithStatusCode(_0x5db822,_0x4139d7){_0x4139d7=_0x4139d7||0xcc;return function(_0x3079d0){if(_0x3079d0){return _0x5db822[_0x2c9e('0xe')](_0x4139d7);}return _0x5db822['status'](_0x4139d7)[_0x2c9e('0xf')]();};}function respondWithResult(_0x2e315e,_0x4aec55){_0x4aec55=_0x4aec55||0xc8;return function(_0x18c3a0){if(_0x18c3a0){return _0x2e315e[_0x2c9e('0x10')](_0x4aec55)['json'](_0x18c3a0);}};}function respondWithFilteredResult(_0x19352e,_0xf6af34){return function(_0x39b7c9){if(_0x39b7c9){var _0x384460=typeof _0xf6af34[_0x2c9e('0x11')]==='undefined'&&typeof _0xf6af34['limit']==='undefined';var _0x59e4df=_0x39b7c9['count'];var _0x5ce9b1=_0x384460?0x0:_0xf6af34[_0x2c9e('0x11')];var _0x125d3a=_0x384460?_0x39b7c9[_0x2c9e('0x12')]:_0xf6af34[_0x2c9e('0x11')]+_0xf6af34[_0x2c9e('0x13')];var _0x19de0b;if(_0x125d3a>=_0x59e4df){_0x125d3a=_0x59e4df;_0x19de0b=0xc8;}else{_0x19de0b=0xce;}_0x19352e[_0x2c9e('0x10')](_0x19de0b);return _0x19352e[_0x2c9e('0x14')](_0x2c9e('0x15'),_0x5ce9b1+'-'+_0x125d3a+'/'+_0x59e4df)['json'](_0x39b7c9);}return null;};}function saveUpdates(_0x468bf9){return function(_0x44d9e9){if(_0x44d9e9){return _0x44d9e9[_0x2c9e('0x16')](_0x468bf9)[_0x2c9e('0x17')](function(_0x2cd2cc){return _0x2cd2cc;});}return null;};}function removeEntity(_0x35f1c6){return function(_0x4d7178){if(_0x4d7178){return _0x4d7178[_0x2c9e('0x18')]()[_0x2c9e('0x17')](function(){_0x35f1c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x300284){return function(_0x5c8374){if(!_0x5c8374){_0x300284['sendStatus'](0x194);}return _0x5c8374;};}function handleError(_0x537abd,_0xba7aa){_0xba7aa=_0xba7aa||0x1f4;return function(_0x59b5bb){logger[_0x2c9e('0x19')](_0x59b5bb[_0x2c9e('0x1a')]);if(_0x59b5bb[_0x2c9e('0x1b')]){delete _0x59b5bb[_0x2c9e('0x1b')];}_0x537abd[_0x2c9e('0x10')](_0xba7aa)[_0x2c9e('0x1c')](_0x59b5bb);};}exports[_0x2c9e('0x1d')]=function(_0x57ffbf,_0x239c5d){var _0x12e243={};var _0x26e7fd=_[_0x2c9e('0x1e')](db[_0x2c9e('0x1f')][_0x2c9e('0x20')],function(_0x4d2a53){return{'name':_0x4d2a53[_0x2c9e('0x21')],'type':_0x4d2a53['type'][_0x2c9e('0x22')]};});_0x12e243=qs[_0x2c9e('0x23')](_0x26e7fd,_0x57ffbf);return interaction[_0x2c9e('0x24')](_0x2c9e('0x25'),_0x57ffbf[_0x2c9e('0x26')],_0x57ffbf[_0x2c9e('0x27')],_0x12e243,_0x26e7fd)[_0x2c9e('0x17')](respondWithFilteredResult(_0x239c5d,_0x12e243))[_0x2c9e('0x28')](handleError(_0x239c5d,null));};exports['show']=function(_0x144147,_0x3205ff){var _0x3521d6={'raw':![],'where':{'id':_0x144147[_0x2c9e('0x29')]['id']}},_0x59be1e={};_0x59be1e[_0x2c9e('0x2a')]=_[_0x2c9e('0x2b')](db[_0x2c9e('0x1f')][_0x2c9e('0x20')]);_0x59be1e[_0x2c9e('0x26')]=_['keys'](_0x144147[_0x2c9e('0x26')]);_0x59be1e['filters']=_[_0x2c9e('0x2c')](_0x59be1e[_0x2c9e('0x2a')],_0x59be1e[_0x2c9e('0x26')]);_0x3521d6[_0x2c9e('0x2d')]=_[_0x2c9e('0x2c')](_0x59be1e[_0x2c9e('0x2a')],qs[_0x2c9e('0x2e')](_0x144147[_0x2c9e('0x26')][_0x2c9e('0x2e')]));_0x3521d6[_0x2c9e('0x2d')]=_0x3521d6[_0x2c9e('0x2d')]['length']?_0x3521d6[_0x2c9e('0x2d')]:_0x59be1e[_0x2c9e('0x2a')];if(_0x144147[_0x2c9e('0x26')][_0x2c9e('0x2f')]){_0x3521d6[_0x2c9e('0x30')]=[{'all':!![]}];}_0x3521d6=_[_0x2c9e('0x31')]({},_0x3521d6,_0x144147[_0x2c9e('0x32')]);return db[_0x2c9e('0x1f')][_0x2c9e('0x33')](_0x3521d6)['then'](handleEntityNotFound(_0x3205ff,null))[_0x2c9e('0x17')](respondWithResult(_0x3205ff,null))[_0x2c9e('0x28')](handleError(_0x3205ff,null));};exports[_0x2c9e('0x34')]=function(_0x4b1936,_0x598945){return db[_0x2c9e('0x1f')][_0x2c9e('0x34')](_0x4b1936[_0x2c9e('0x35')],{})[_0x2c9e('0x17')](respondWithResult(_0x598945,0xc9))['catch'](handleError(_0x598945,null));};exports[_0x2c9e('0x16')]=function(_0x3e8fdd,_0xb9ab32){if(_0x3e8fdd[_0x2c9e('0x35')]['id']){delete _0x3e8fdd['body']['id'];}return db[_0x2c9e('0x1f')][_0x2c9e('0x33')]({'where':{'id':_0x3e8fdd[_0x2c9e('0x29')]['id']}})['then'](handleEntityNotFound(_0xb9ab32,null))[_0x2c9e('0x17')](saveUpdates(_0x3e8fdd['body'],null))[_0x2c9e('0x17')](respondWithResult(_0xb9ab32,null))[_0x2c9e('0x28')](handleError(_0xb9ab32,null));};exports[_0x2c9e('0x18')]=function(_0x3e8cd4,_0x22eb5e){return db['FaxInteraction']['find']({'where':{'id':_0x3e8cd4['params']['id']}})[_0x2c9e('0x17')](handleEntityNotFound(_0x22eb5e,null))[_0x2c9e('0x17')](removeEntity(_0x22eb5e,null))[_0x2c9e('0x28')](handleError(_0x22eb5e,null));};exports[_0x2c9e('0x36')]=function(_0x1fe0f7,_0x22b5bd){return db[_0x2c9e('0x1f')][_0x2c9e('0x36')]()[_0x2c9e('0x17')](respondWithResult(_0x22b5bd,null))[_0x2c9e('0x28')](handleError(_0x22b5bd,null));};exports[_0x2c9e('0x37')]=function(_0x28409e,_0x473054){return db['FaxMessage'][_0x2c9e('0x33')]({'where':{'id':_0x28409e[_0x2c9e('0x29')]['id']}})[_0x2c9e('0x17')](handleEntityNotFound(_0x473054,null))['then'](function(_0x2c2533){if(_0x2c2533){return _0x2c2533[_0x2c9e('0x37')](_0x28409e[_0x2c9e('0x35')][_0x2c9e('0x38')],_[_0x2c9e('0x39')](_0x28409e['body'],[_0x2c9e('0x38'),'id'])||{});}})['then'](respondWithResult(_0x473054,null))[_0x2c9e('0x28')](handleError(_0x473054,null));};exports['getMessages']=function(_0x1ddcfa,_0x2c36d1){var _0x32ab4b={'raw':![],'where':{}};var _0x5617e5={};var _0x4d2052={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x2c9e('0x3a')]({'where':{'id':_0x1ddcfa[_0x2c9e('0x29')]['id']}})[_0x2c9e('0x17')](handleEntityNotFound(_0x2c36d1,null))['then'](function(_0x259ac4){if(_0x259ac4){_0x5617e5[_0x2c9e('0x2a')]=_[_0x2c9e('0x2b')](db[_0x2c9e('0x3b')]['rawAttributes']);_0x5617e5[_0x2c9e('0x26')]=_[_0x2c9e('0x2b')](_0x1ddcfa[_0x2c9e('0x26')]);_0x5617e5[_0x2c9e('0x3c')]=_[_0x2c9e('0x2c')](_0x5617e5[_0x2c9e('0x2a')],_0x5617e5[_0x2c9e('0x26')]);_0x32ab4b[_0x2c9e('0x2d')]=_['intersection'](_0x5617e5[_0x2c9e('0x2a')],qs[_0x2c9e('0x2e')](_0x1ddcfa['query'][_0x2c9e('0x2e')]));_0x32ab4b[_0x2c9e('0x2d')]=_0x32ab4b['attributes'][_0x2c9e('0x3d')]?_0x32ab4b['attributes']:_0x5617e5[_0x2c9e('0x2a')];if(!_0x1ddcfa['query'][_0x2c9e('0x3e')](_0x2c9e('0x3f'))){_0x32ab4b['limit']=qs[_0x2c9e('0x13')](_0x1ddcfa[_0x2c9e('0x26')][_0x2c9e('0x13')]);_0x32ab4b[_0x2c9e('0x11')]=qs[_0x2c9e('0x11')](_0x1ddcfa['query'][_0x2c9e('0x11')]);}_0x32ab4b[_0x2c9e('0x40')]=qs[_0x2c9e('0x41')](_0x1ddcfa[_0x2c9e('0x26')]['sort']);_0x32ab4b['where']=qs[_0x2c9e('0x3c')](_['pick'](_0x1ddcfa[_0x2c9e('0x26')],_0x5617e5[_0x2c9e('0x3c')]));_0x32ab4b[_0x2c9e('0x42')]['FaxInteractionId']=_0x259ac4['id'];if(_0x1ddcfa['query'][_0x2c9e('0x43')]){_0x32ab4b[_0x2c9e('0x42')]=_['merge'](_0x32ab4b['where'],{'$or':_[_0x2c9e('0x1e')](_0x32ab4b[_0x2c9e('0x2d')],function(_0x5a97b9){var _0x159913={};_0x159913[_0x5a97b9]={'$like':'%'+_0x1ddcfa['query'][_0x2c9e('0x43')]+'%'};return _0x159913;})});}if(_0x1ddcfa['query'][_0x2c9e('0x44')]){var _0x2f4b4c=_0x1ddcfa[_0x2c9e('0x26')][_0x2c9e('0x44')][_0x2c9e('0x45')](',');var _0x5765aa={};_0x5765aa[_0x2f4b4c[0x0]]={'$gte':moment(_0x2f4b4c[0x1])[_0x2c9e('0x46')](_0x2c9e('0x47'))};_0x32ab4b['where']=_[_0x2c9e('0x31')](_0x32ab4b[_0x2c9e('0x42')],_0x5765aa);}_0x32ab4b=_['merge']({},_0x32ab4b,_0x1ddcfa['options']);return db[_0x2c9e('0x3b')][_0x2c9e('0x12')]({'where':_0x32ab4b[_0x2c9e('0x42')]})[_0x2c9e('0x17')](function(_0x3ef2de){_0x4d2052[_0x2c9e('0x12')]=_0x3ef2de;if(_0x1ddcfa[_0x2c9e('0x26')]['includeAll']){_0x32ab4b['include']=[{'all':!![]}];}return db[_0x2c9e('0x3b')][_0x2c9e('0x24')](_0x32ab4b);})['then'](function(_0xec1b1f){_0x4d2052[_0x2c9e('0x48')]=_0xec1b1f;return _0x4d2052;});}})['then'](respondWithFilteredResult(_0x2c36d1,_0x32ab4b))[_0x2c9e('0x28')](handleError(_0x2c36d1,null));};exports[_0x2c9e('0x49')]=function(_0x205955,_0x43fd26){return db[_0x2c9e('0x1f')][_0x2c9e('0x33')]({'where':{'id':_0x205955['params']['id']}})[_0x2c9e('0x17')](handleEntityNotFound(_0x43fd26,null))['then'](function(_0x4dc58e){if(_0x4dc58e){return _0x4dc58e[_0x2c9e('0x4a')](_0x205955[_0x2c9e('0x35')][_0x2c9e('0x38')],_[_0x2c9e('0x39')](_0x205955[_0x2c9e('0x35')],['ids','id'])||{})[_0x2c9e('0x4b')](function(){return db[_0x2c9e('0x4c')]['findAll']({'attributes':['id',_0x2c9e('0x1b'),_0x2c9e('0x4d')],'where':{'id':_0x205955['body'][_0x2c9e('0x38')]}});})[_0x2c9e('0x17')](function(_0x3191fe){socket['emit'](_0x2c9e('0x4e'),{'id':Number(_0x205955[_0x2c9e('0x29')]['id']),'tags':_0x3191fe||[]});return{'id':Number(_0x205955['params']['id']),'tags':_0x3191fe||[]};});}})['then'](respondWithResult(_0x43fd26,null))['catch'](handleError(_0x43fd26,null));};exports[_0x2c9e('0x4f')]=function(_0x59c35d,_0x3999e6){return db[_0x2c9e('0x1f')][_0x2c9e('0x33')]({'where':{'id':_0x59c35d[_0x2c9e('0x29')]['id']}})[_0x2c9e('0x17')](handleEntityNotFound(_0x3999e6,null))['then'](function(_0x10cff3){if(_0x10cff3){return _0x10cff3[_0x2c9e('0x4f')](_0x59c35d[_0x2c9e('0x26')][_0x2c9e('0x38')]);}})[_0x2c9e('0x17')](respondWithStatusCode(_0x3999e6,null))[_0x2c9e('0x28')](handleError(_0x3999e6,null));};exports[_0x2c9e('0x50')]=function(_0x22bab4,_0x4d2b92){var _0x7237=moment()[_0x2c9e('0x51')]()[_0x2c9e('0x52')]();var _0x2a8f1e=path[_0x2c9e('0x53')](config[_0x2c9e('0x54')],_0x2c9e('0x55'),_0x2c9e('0x56'),_0x2c9e('0x57'));var _0x113edc=path[_0x2c9e('0x53')](config[_0x2c9e('0x54')],'server',_0x2c9e('0x56'),_0x2c9e('0x58'));var _0x2ab7ff=path[_0x2c9e('0x53')](_0x2a8f1e,_0x7237);var _0x5ed975=util[_0x2c9e('0x46')](_0x2c9e('0x59'),_0x22bab4[_0x2c9e('0x29')]['id'],_0x7237);var _0x90a0c4=path[_0x2c9e('0x53')](_0x2a8f1e,_0x5ed975);var _0x1bad19=[];_0x1bad19[_0x2c9e('0x5a')]({'model':db[_0x2c9e('0x5b')],'as':'Attachment','raw':!![]});var _0x31984b=[{'model':db[_0x2c9e('0x3b')],'as':_0x2c9e('0x5c'),'attributes':['id',_0x2c9e('0x35'),_0x2c9e('0x5d')],'include':_0x1bad19}];return db[_0x2c9e('0x1f')][_0x2c9e('0x33')]({'where':{'id':_0x22bab4[_0x2c9e('0x29')]['id']},'include':_0x31984b})[_0x2c9e('0x17')](handleEntityNotFound(_0x4d2b92,null))[_0x2c9e('0x17')](function(_0x118e0c){if(_0x118e0c&&_0x118e0c[_0x2c9e('0x5c')]){var _0x1203e7=_0x118e0c[_0x2c9e('0x5e')]({'plain':!![]});fs[_0x2c9e('0x5f')](_0x2ab7ff);for(var _0x234849=0x0;_0x234849<_0x1203e7['Messages'][_0x2c9e('0x3d')];_0x234849++){var _0x3adf57=_0x1203e7[_0x2c9e('0x5c')][_0x234849][_0x2c9e('0x5b')];if(_0x3adf57){var _0x5c0a8d=path[_0x2c9e('0x53')](_0x113edc,_0x3adf57['basename']);if(fs[_0x2c9e('0x60')](_0x5c0a8d)){fs['createReadStream'](_0x5c0a8d)[_0x2c9e('0x61')](fs[_0x2c9e('0x62')](path[_0x2c9e('0x53')](_0x2ab7ff,_0x3adf57[_0x2c9e('0x63')])));}}}return BPromise[_0x2c9e('0x64')]()[_0x2c9e('0x17')](function(){return new BPromise(function(_0x125048,_0x7f6a0f){zipdir(_0x2ab7ff,{'saveTo':_0x90a0c4},function(_0x5ca249,_0x5f69f7){if(_0x5ca249)return _0x7f6a0f(_0x5ca249);return _0x125048(_0x5f69f7);});})[_0x2c9e('0x17')](function(){return new BPromise(function(_0x419a91,_0x32e1bb){rimraf(_0x2ab7ff,function(_0x15fb72){if(_0x15fb72)_0x32e1bb(_0x15fb72);return _0x419a91();});});})[_0x2c9e('0x17')](function(){return _0x4d2b92[_0x2c9e('0x50')](_0x90a0c4,_0x5ed975,function(_0x45a0a2){if(_0x45a0a2){console['log'](_0x2c9e('0x65'),_0x45a0a2);}else{fs['unlinkSync'](_0x90a0c4);}});});});}else{return _0x4d2b92[_0x2c9e('0xe')](0xc8);}})['catch'](handleError(_0x4d2b92,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 52badcd..498d32c 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 _0x5901=['setMaxListeners','save','update','remove','getUsers','Users','map','then','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction'];(function(_0x525a71,_0x2e2bcf){var _0x24c295=function(_0x19d270){while(--_0x19d270){_0x525a71['push'](_0x525a71['shift']());}};_0x24c295(++_0x2e2bcf);}(_0x5901,0xb1));var _0x1590=function(_0x2ae476,_0x133239){_0x2ae476=_0x2ae476-0x0;var _0x9e65f8=_0x5901[_0x2ae476];return _0x9e65f8;};'use strict';var EventEmitter=require(_0x1590('0x0'));var FaxInteraction=require(_0x1590('0x1'))['db'][_0x1590('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1590('0x3')](0x0);var events={'afterCreate':_0x1590('0x4'),'afterUpdate':_0x1590('0x5'),'afterDestroy':_0x1590('0x6')};function emitEvent(_0x51bd80){return function(_0x10730e,_0x1267ad,_0x2f42df){_0x10730e[_0x1590('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xdd5a59){_0x10730e['setDataValue'](_0x1590('0x8'),_0xdd5a59[_0x1590('0x9')](function(_0x16a28d){return{'id':_0x16a28d['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x10730e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1590('0xa')](function(_0x3cece3){_0x10730e[_0x1590('0xb')]('unreadMessages',_0x3cece3[_0x1590('0xc')]);FaxInteractionEvents[_0x1590('0xd')](_0x51bd80+':'+_0x10730e['id'],_0x10730e);FaxInteractionEvents[_0x1590('0xd')](_0x51bd80,_0x10730e);_0x2f42df(null);})[_0x1590('0xe')](_0x2f42df(null));};}for(var e in events){if(events[_0x1590('0xf')](e)){var event=events[e];FaxInteraction[_0x1590('0x10')](e,emitEvent(event));}}module[_0x1590('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x782a=['Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove'];(function(_0x1ff1b4,_0x28cd56){var _0x3172a4=function(_0x4f00b3){while(--_0x4f00b3){_0x1ff1b4['push'](_0x1ff1b4['shift']());}};_0x3172a4(++_0x28cd56);}(_0x782a,0xf9));var _0xa782=function(_0x917bb1,_0x5c39e5){_0x917bb1=_0x917bb1-0x0;var _0x5bfab7=_0x782a[_0x917bb1];return _0x5bfab7;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xa782('0x0'))['db'][_0xa782('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xa782('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa782('0x3')](0x0);var events={'afterCreate':_0xa782('0x4'),'afterUpdate':'update','afterDestroy':_0xa782('0x5')};function emitEvent(_0x25160e){return function(_0xf3c2e0,_0x113963,_0x11e983){_0xf3c2e0['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3f6c7c){_0xf3c2e0['setDataValue'](_0xa782('0x6'),_0x3f6c7c[_0xa782('0x7')](function(_0x39d6a6){return{'id':_0x39d6a6['id']};}));return FaxMessage[_0xa782('0x8')]({'where':{'FaxInteractionId':_0xf3c2e0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa782('0x9')](function(_0x278bf3){_0xf3c2e0['setDataValue'](_0xa782('0xa'),_0x278bf3[_0xa782('0xb')]);FaxInteractionEvents[_0xa782('0xc')](_0x25160e+':'+_0xf3c2e0['id'],_0xf3c2e0);FaxInteractionEvents['emit'](_0x25160e,_0xf3c2e0);_0x11e983(null);})['catch'](_0x11e983(null));};}for(var e in events){if(events[_0xa782('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xa782('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index ce056e2..c0ecb96 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 _0x4b27=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','moment','bluebird','request-promise','path','define','FaxInteraction','fax_interactions','closed'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x4b27,0xc9));var _0x74b2=function(_0x2b52bd,_0x3bb8b7){_0x2b52bd=_0x2b52bd-0x0;var _0x5cb451=_0x4b27[_0x2b52bd];return _0x5cb451;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x74b2('0x0'));var BPromise=require(_0x74b2('0x1'));var rp=require(_0x74b2('0x2'));var fs=require('fs');var path=require(_0x74b2('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x2d6d1f,_0x19b8df){return _0x2d6d1f[_0x74b2('0x4')](_0x74b2('0x5'),attributes,{'tableName':_0x74b2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x169d56,_0x4e0dc6,_0x1e5cdc){if(_0x169d56['changed'](_0x74b2('0x7'))){_0x169d56[_0x74b2('0x8')]=moment()[_0x74b2('0x9')](_0x74b2('0xa'));}_0x1e5cdc(null,_0x169d56);}}});}; \ No newline at end of file +var _0x0731=['fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxInteraction'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x0731,0x175));var _0x1073=function(_0x5f5962,_0x5903c3){_0x5f5962=_0x5f5962-0x0;var _0x2c269c=_0x0731[_0x5f5962];return _0x2c269c;};'use strict';var _=require(_0x1073('0x0'));var util=require(_0x1073('0x1'));var logger=require(_0x1073('0x2'))(_0x1073('0x3'));var moment=require('moment');var BPromise=require(_0x1073('0x4'));var rp=require(_0x1073('0x5'));var fs=require('fs');var path=require(_0x1073('0x6'));var rimraf=require(_0x1073('0x7'));var config=require(_0x1073('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x43c791,_0x2ffb4b){return _0x43c791[_0x1073('0x9')](_0x1073('0xa'),attributes,{'tableName':_0x1073('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f61e1,_0x41a384,_0x2ab5b2){if(_0x2f61e1['changed'](_0x1073('0xc'))){_0x2f61e1[_0x1073('0xd')]=moment()[_0x1073('0xe')](_0x1073('0xf'));}_0x2ab5b2(null,_0x2f61e1);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index b2e2fa3..d8022f0 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 _0xa08c=['defaults','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxInteraction','update','body','options','raw','where','attributes','stringify','catch','FaxInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis'];(function(_0x28699a,_0x4f4a11){var _0x4b0e12=function(_0x4f29d9){while(--_0x4f29d9){_0x28699a['push'](_0x28699a['shift']());}};_0x4b0e12(++_0x4f4a11);}(_0xa08c,0xb7));var _0xca08=function(_0x3b58a1,_0x4d30bf){_0x3b58a1=_0x3b58a1-0x0;var _0x2dbff1=_0xa08c[_0x3b58a1];return _0x2dbff1;};'use strict';var _=require(_0xca08('0x0'));var util=require(_0xca08('0x1'));var moment=require(_0xca08('0x2'));var BPromise=require(_0xca08('0x3'));var rs=require(_0xca08('0x4'));var fs=require('fs');var Redis=require(_0xca08('0x5'));var db=require(_0xca08('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca08('0x7'))(_0xca08('0x8'));var config=require('../../config/environment');var jayson=require(_0xca08('0x9'));var client=jayson[_0xca08('0xa')]['http']({'port':0x232a});config[_0xca08('0xb')]=_[_0xca08('0xc')](config[_0xca08('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')[_0xca08('0xd')](socket);function respondWithRpcPromise(_0x1221fe,_0x43fd7b,_0x3d3be1){return new BPromise(function(_0x51a152,_0x540ce2){return client[_0xca08('0xe')](_0x1221fe,_0x3d3be1)[_0xca08('0xf')](function(_0x3e1f9f){logger[_0xca08('0x10')](_0xca08('0x11'),_0x43fd7b,_0xca08('0x12'));logger[_0xca08('0x13')](_0xca08('0x14'),_0x43fd7b,'request\x20sent',JSON['stringify'](_0x3e1f9f));if(_0x3e1f9f[_0xca08('0x15')]){if(_0x3e1f9f[_0xca08('0x15')][_0xca08('0x16')]===0x1f4){logger['error'](_0xca08('0x11'),_0x43fd7b,_0x3e1f9f[_0xca08('0x15')][_0xca08('0x17')]);return _0x540ce2(_0x3e1f9f[_0xca08('0x15')]['message']);}logger[_0xca08('0x15')](_0xca08('0x11'),_0x43fd7b,_0x3e1f9f[_0xca08('0x15')][_0xca08('0x17')]);return _0x51a152(_0x3e1f9f[_0xca08('0x15')][_0xca08('0x17')]);}else{logger['info'](_0xca08('0x11'),_0x43fd7b,_0xca08('0x12'));_0x51a152(_0x3e1f9f['result'][_0xca08('0x17')]);}})['catch'](function(_0x2399bb){logger[_0xca08('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x43fd7b,_0x2399bb);_0x540ce2(_0x2399bb);});});}exports[_0xca08('0x18')]=function(_0x57b2dc){var _0x23b796=this;return new Promise(function(_0x9bda53,_0xf66159){return db['FaxInteraction'][_0xca08('0x19')](_0x57b2dc[_0xca08('0x1a')],{'raw':_0x57b2dc[_0xca08('0x1b')]?_0x57b2dc[_0xca08('0x1b')][_0xca08('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57b2dc[_0xca08('0x1b')]?_0x57b2dc['options'][_0xca08('0x1d')]||null:null,'attributes':_0x57b2dc[_0xca08('0x1b')]?_0x57b2dc['options'][_0xca08('0x1e')]||null:null,'limit':_0x57b2dc[_0xca08('0x1b')]?_0x57b2dc[_0xca08('0x1b')]['limit']||null:null})[_0xca08('0xf')](function(_0xa948e1){logger['info'](_0xca08('0x18'),_0x57b2dc);logger[_0xca08('0x13')](_0xca08('0x18'),_0x57b2dc,JSON[_0xca08('0x1f')](_0xa948e1));_0x9bda53(_0xa948e1);})[_0xca08('0x20')](function(_0x2ead85){logger[_0xca08('0x15')](_0xca08('0x18'),_0x2ead85[_0xca08('0x17')],_0x57b2dc);_0xf66159(_0x23b796[_0xca08('0x15')](0x1f4,_0x2ead85['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x20832c){return new Promise(function(_0x8ad618,_0x334da5){return db[_0xca08('0x21')]['find']({'where':_0x20832c[_0xca08('0x1b')]?_0x20832c[_0xca08('0x1b')][_0xca08('0x1d')]||null:null})[_0xca08('0xf')](function(_0x22cfb7){if(_0x22cfb7){return _0x22cfb7[_0xca08('0x22')](_0x20832c[_0xca08('0x1a')][_0xca08('0x23')],_[_0xca08('0x24')](_0x20832c[_0xca08('0x1a')],[_0xca08('0x23'),'id'])||{});}})[_0xca08('0x25')](function(_0x286714){logger[_0xca08('0x10')]('AddTags',_0x20832c);logger[_0xca08('0x13')]('AddTags',_0x20832c,JSON['stringify'](_0x286714));_0x8ad618(_0x286714);})[_0xca08('0x20')](function(_0x208534){logger[_0xca08('0x15')](_0xca08('0x26'),_0x208534[_0xca08('0x17')],_0x20832c);_0x334da5(_this['error'](0x1f4,_0x208534[_0xca08('0x17')]));});});}; \ No newline at end of file +var _0xdd9c=['client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x37f742,_0x2a7ae8){var _0xc87883=function(_0xf2367d){while(--_0xf2367d){_0x37f742['push'](_0x37f742['shift']());}};_0xc87883(++_0x2a7ae8);}(_0xdd9c,0xa3));var _0xcdd9=function(_0x2cb4df,_0x1759fd){_0x2cb4df=_0x2cb4df-0x0;var _0x22e115=_0xdd9c[_0x2cb4df];return _0x22e115;};'use strict';var _=require(_0xcdd9('0x0'));var util=require(_0xcdd9('0x1'));var moment=require(_0xcdd9('0x2'));var BPromise=require(_0xcdd9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd9('0x4'));var db=require(_0xcdd9('0x5'))['db'];var utils=require(_0xcdd9('0x6'));var logger=require(_0xcdd9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcdd9('0x8'));var client=jayson[_0xcdd9('0x9')][_0xcdd9('0xa')]({'port':0x232a});config['redis']=_[_0xcdd9('0xb')](config[_0xcdd9('0xc')],{'host':_0xcdd9('0xd'),'port':0x18eb});var socket=require(_0xcdd9('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xcdd9('0xf')](socket);function respondWithRpcPromise(_0x41a899,_0x5bf401,_0x388392){return new BPromise(function(_0x2466b3,_0x15d6f2){return client['request'](_0x41a899,_0x388392)[_0xcdd9('0x10')](function(_0x4171b4){logger[_0xcdd9('0x11')](_0xcdd9('0x12'),_0x5bf401,_0xcdd9('0x13'));logger[_0xcdd9('0x14')](_0xcdd9('0x15'),_0x5bf401,_0xcdd9('0x13'),JSON['stringify'](_0x4171b4));if(_0x4171b4['error']){if(_0x4171b4[_0xcdd9('0x16')][_0xcdd9('0x17')]===0x1f4){logger[_0xcdd9('0x16')](_0xcdd9('0x12'),_0x5bf401,_0x4171b4[_0xcdd9('0x16')][_0xcdd9('0x18')]);return _0x15d6f2(_0x4171b4[_0xcdd9('0x16')][_0xcdd9('0x18')]);}logger[_0xcdd9('0x16')](_0xcdd9('0x12'),_0x5bf401,_0x4171b4[_0xcdd9('0x16')]['message']);return _0x2466b3(_0x4171b4[_0xcdd9('0x16')][_0xcdd9('0x18')]);}else{logger[_0xcdd9('0x11')](_0xcdd9('0x12'),_0x5bf401,_0xcdd9('0x13'));_0x2466b3(_0x4171b4[_0xcdd9('0x19')]['message']);}})[_0xcdd9('0x1a')](function(_0x27e29d){logger[_0xcdd9('0x16')](_0xcdd9('0x12'),_0x5bf401,_0x27e29d);_0x15d6f2(_0x27e29d);});});}exports[_0xcdd9('0x1b')]=function(_0x5a01c6){var _0x1fac1b=this;return new Promise(function(_0x4bf2ff,_0x4c4f94){return db[_0xcdd9('0x1c')][_0xcdd9('0x1d')](_0x5a01c6[_0xcdd9('0x1e')],{'raw':_0x5a01c6[_0xcdd9('0x1f')]?_0x5a01c6[_0xcdd9('0x1f')][_0xcdd9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a01c6[_0xcdd9('0x1f')]?_0x5a01c6[_0xcdd9('0x1f')][_0xcdd9('0x21')]||null:null,'attributes':_0x5a01c6[_0xcdd9('0x1f')]?_0x5a01c6[_0xcdd9('0x1f')][_0xcdd9('0x22')]||null:null,'limit':_0x5a01c6[_0xcdd9('0x1f')]?_0x5a01c6[_0xcdd9('0x1f')][_0xcdd9('0x23')]||null:null})['then'](function(_0x50d67a){logger['info'](_0xcdd9('0x1b'),_0x5a01c6);logger[_0xcdd9('0x14')](_0xcdd9('0x1b'),_0x5a01c6,JSON[_0xcdd9('0x24')](_0x50d67a));_0x4bf2ff(_0x50d67a);})[_0xcdd9('0x1a')](function(_0x27842c){logger[_0xcdd9('0x16')](_0xcdd9('0x1b'),_0x27842c['message'],_0x5a01c6);_0x4c4f94(_0x1fac1b[_0xcdd9('0x16')](0x1f4,_0x27842c['message']));});});};exports[_0xcdd9('0x25')]=function(_0x2ba558){return new Promise(function(_0x168144,_0x234043){return db[_0xcdd9('0x1c')]['find']({'where':_0x2ba558['options']?_0x2ba558['options'][_0xcdd9('0x21')]||null:null})[_0xcdd9('0x10')](function(_0x237ec2){if(_0x237ec2){return _0x237ec2[_0xcdd9('0x26')](_0x2ba558['body']['ids'],_[_0xcdd9('0x27')](_0x2ba558['body'],[_0xcdd9('0x28'),'id'])||{});}})[_0xcdd9('0x29')](function(_0x1af407){logger[_0xcdd9('0x11')]('AddTags',_0x2ba558);logger[_0xcdd9('0x14')](_0xcdd9('0x2a'),_0x2ba558,JSON[_0xcdd9('0x24')](_0x1af407));_0x168144(_0x1af407);})[_0xcdd9('0x1a')](function(_0x3b72dc){logger[_0xcdd9('0x16')]('AddTags',_0x3b72dc[_0xcdd9('0x18')],_0x2ba558);_0x234043(_this[_0xcdd9('0x16')](0x1f4,_0x3b72dc['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 2ded6a3..4505455 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 _0x23e1=['./faxInteraction.events','remove','register','faxInteraction:'];(function(_0x42162e,_0x15e36f){var _0x39e174=function(_0x375726){while(--_0x375726){_0x42162e['push'](_0x42162e['shift']());}};_0x39e174(++_0x15e36f);}(_0x23e1,0x178));var _0x123e=function(_0x3dcd30,_0x3fb9fc){_0x3dcd30=_0x3dcd30-0x0;var _0x79d948=_0x23e1[_0x3dcd30];return _0x79d948;};'use strict';var FaxInteractionEvents=require(_0x123e('0x0'));var events=['save',_0x123e('0x1'),'update'];function createListener(_0x377cba,_0x43d4a1){return function(_0x583ae0){_0x43d4a1['emit'](_0x377cba,_0x583ae0);};}function removeListener(_0x2ce82a,_0x1dd595){return function(){FaxInteractionEvents['removeListener'](_0x2ce82a,_0x1dd595);};}exports[_0x123e('0x2')]=function(_0x3d005b){for(var _0x4f5d12=0x0,_0x3f47d9=events['length'];_0x4f5d12<_0x3f47d9;_0x4f5d12++){var _0x421d01=events[_0x4f5d12];var _0x11eaa1=createListener(_0x123e('0x3')+_0x421d01,_0x3d005b);FaxInteractionEvents['on'](_0x421d01,_0x11eaa1);}}; \ No newline at end of file +var _0x5969=['emit','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x5849b8,_0x95d106){var _0xe43b9=function(_0x3ce71e){while(--_0x3ce71e){_0x5849b8['push'](_0x5849b8['shift']());}};_0xe43b9(++_0x95d106);}(_0x5969,0x66));var _0x9596=function(_0x1c28b1,_0x1be593){_0x1c28b1=_0x1c28b1-0x0;var _0x45cd08=_0x5969[_0x1c28b1];return _0x45cd08;};'use strict';var FaxInteractionEvents=require(_0x9596('0x0'));var events=['save',_0x9596('0x1'),_0x9596('0x2')];function createListener(_0x2f034e,_0x1b6a6f){return function(_0x4d67b0){_0x1b6a6f[_0x9596('0x3')](_0x2f034e,_0x4d67b0);};}function removeListener(_0x238cae,_0x3ed1d2){return function(){FaxInteractionEvents['removeListener'](_0x238cae,_0x3ed1d2);};}exports['register']=function(_0x4277ac){for(var _0x250dda=0x0,_0x5232f6=events['length'];_0x250dda<_0x5232f6;_0x250dda++){var _0x4b1e71=events[_0x250dda];var _0x380e5e=createListener(_0x9596('0x4')+_0x4b1e71,_0x4277ac);FaxInteractionEvents['on'](_0x4b1e71,_0x380e5e);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e67e25a..6326790 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 _0x0baf=['destroy','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/messages','tracked','fax','faxinteraction:addtags','addTags','put','delete','faxinteraction:destroy'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0x0baf,0x73));var _0xf0ba=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x0baf[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0ba('0x0'));var timeout=require('connect-timeout');var express=require(_0xf0ba('0x1'));var router=express[_0xf0ba('0x2')]();var fs_extra=require(_0xf0ba('0x3'));var auth=require(_0xf0ba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf0ba('0x5'));var controller=require(_0xf0ba('0x6'));router[_0xf0ba('0x7')]('/',auth[_0xf0ba('0x8')](),controller['index']);router['get'](_0xf0ba('0x9'),auth[_0xf0ba('0x8')](),controller[_0xf0ba('0xa')]);router[_0xf0ba('0x7')](_0xf0ba('0xb'),auth[_0xf0ba('0x8')](),controller[_0xf0ba('0xc')]);router['get']('/:id/messages',auth[_0xf0ba('0x8')](),controller[_0xf0ba('0xd')]);router[_0xf0ba('0x7')](_0xf0ba('0xe'),auth[_0xf0ba('0x8')](),controller['download']);router[_0xf0ba('0xf')]('/',auth[_0xf0ba('0x8')](),controller[_0xf0ba('0x10')]);router['post'](_0xf0ba('0x11'),auth[_0xf0ba('0x8')](),controller['addMessage']);router[_0xf0ba('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xf0ba('0x12')](_0xf0ba('0x13'),_0xf0ba('0x14')),controller[_0xf0ba('0x15')]);router[_0xf0ba('0x16')](_0xf0ba('0xb'),auth[_0xf0ba('0x8')](),interaction['tracked']('fax','faxinteraction:update'),controller['update']);router[_0xf0ba('0x17')](_0xf0ba('0xb'),auth[_0xf0ba('0x8')](),interaction['tracked']('fax',_0xf0ba('0x18')),controller[_0xf0ba('0x19')]);router[_0xf0ba('0x17')]('/:id/tags',auth[_0xf0ba('0x8')](),controller[_0xf0ba('0x1a')]);module[_0xf0ba('0x1b')]=router; \ No newline at end of file +var _0x98d5=['destroy','removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','describe','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','fax','addTags','put','/:id','tracked','faxinteraction:update','update','faxinteraction:destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98d5,0xfb));var _0x598d=function(_0x178d6d,_0x5340b4){_0x178d6d=_0x178d6d-0x0;var _0x288eb2=_0x98d5[_0x178d6d];return _0x288eb2;};'use strict';var multer=require(_0x598d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x598d('0x1'));var express=require(_0x598d('0x2'));var router=express[_0x598d('0x3')]();var fs_extra=require(_0x598d('0x4'));var auth=require(_0x598d('0x5'));var interaction=require(_0x598d('0x6'));var config=require(_0x598d('0x7'));var controller=require(_0x598d('0x8'));router['get']('/',auth[_0x598d('0x9')](),controller['index']);router[_0x598d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x598d('0xb')]);router[_0x598d('0xa')]('/:id',auth[_0x598d('0x9')](),controller[_0x598d('0xc')]);router[_0x598d('0xa')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0xe')]);router['get']('/:id/download',auth[_0x598d('0x9')](),controller[_0x598d('0xf')]);router[_0x598d('0x10')]('/',auth[_0x598d('0x9')](),controller[_0x598d('0x11')]);router[_0x598d('0x10')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0x12')]);router[_0x598d('0x10')](_0x598d('0x13'),auth[_0x598d('0x9')](),interaction['tracked'](_0x598d('0x14'),'faxinteraction:addtags'),controller[_0x598d('0x15')]);router[_0x598d('0x16')](_0x598d('0x17'),auth[_0x598d('0x9')](),interaction[_0x598d('0x18')]('fax',_0x598d('0x19')),controller[_0x598d('0x1a')]);router['delete'](_0x598d('0x17'),auth[_0x598d('0x9')](),interaction['tracked'](_0x598d('0x14'),_0x598d('0x1b')),controller[_0x598d('0x1c')]);router['delete']('/:id/tags',auth[_0x598d('0x9')](),controller[_0x598d('0x1d')]);module[_0x598d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d11c4a5..b8c5ce7 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 _0xa3e6=['sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x26ff40,_0x305b3e){_0x26ff40=_0x26ff40-0x0;var _0xa2eb8e=_0xa3e6[_0x26ff40];return _0xa2eb8e;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'body':{'type':Sequelize[_0x6a3e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6a3e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6a3e('0x3')]('in',_0x6a3e('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x6a3e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x1948=['BOOLEAN','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x5702d1,_0x8e1bea){var _0x5c844b=function(_0x5a117a){while(--_0x5a117a){_0x5702d1['push'](_0x5702d1['shift']());}};_0x5c844b(++_0x8e1bea);}(_0x1948,0x145));var _0x8194=function(_0xb91ba6,_0x50cb6f){_0xb91ba6=_0xb91ba6-0x0;var _0x51b33c=_0x1948[_0xb91ba6];return _0x51b33c;};'use strict';var Sequelize=require(_0x8194('0x0'));module[_0x8194('0x1')]={'body':{'type':Sequelize[_0x8194('0x2')](_0x8194('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8194('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8194('0x5')),'defaultValue':_0x8194('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8194('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8194('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index cb10566..3122601 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 _0xe675=['FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','email','internal','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','server','files','attachments','join','basename','eml-format','rimraf','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','name','send','index','map','FaxMessage','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','options','include','findAll','show','params','keys','includeAll','find','body','destroy','describe','fax-interactions','accept','fax','read','format','UserId','user','agent'];(function(_0x1bc1ff,_0x29907d){var _0x3042f7=function(_0xa5abc8){while(--_0xa5abc8){_0x1bc1ff['push'](_0x1bc1ff['shift']());}};_0x3042f7(++_0x29907d);}(_0xe675,0x14c));var _0x5e67=function(_0x334564,_0x4a14ca){_0x334564=_0x334564-0x0;var _0x35f756=_0xe675[_0x334564];return _0x35f756;};'use strict';var emlformat=require(_0x5e67('0x0'));var rimraf=require(_0x5e67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5e67('0x2'));var util=require(_0x5e67('0x3'));var path=require('path');var sox=require(_0x5e67('0x4'));var csv=require(_0x5e67('0x5'));var ejs=require(_0x5e67('0x6'));var fs=require('fs');var fs_extra=require(_0x5e67('0x7'));var _=require(_0x5e67('0x8'));var squel=require(_0x5e67('0x9'));var crypto=require(_0x5e67('0xa'));var jsforce=require(_0x5e67('0xb'));var deskjs=require(_0x5e67('0xc'));var toCsv=require(_0x5e67('0x5'));var querystring=require(_0x5e67('0xd'));var Papa=require(_0x5e67('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e67('0xf'));var as=require(_0x5e67('0x10'));var hardwareService=require(_0x5e67('0x11'));var logger=require(_0x5e67('0x12'))(_0x5e67('0x13'));var utils=require(_0x5e67('0x14'));var config=require(_0x5e67('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e67('0x16'))['db'];config[_0x5e67('0x17')]=_[_0x5e67('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e67('0x19'))(new Redis(config['redis']));require(_0x5e67('0x1a'))[_0x5e67('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5e67('0x1c')][_0x5e67('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2565d8,_0x3d205c,_0x5d734a,_0xeee5f6){return new BPromise(function(_0x50510c,_0x25aa79){var _0x144e2c=_0xeee5f6||client;return _0x144e2c[_0x5e67('0x1e')](_0x2565d8,_0x5d734a)['then'](function(_0x541247){logger[_0x5e67('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x3d205c,_0x5e67('0x20'));logger[_0x5e67('0x21')](_0x5e67('0x22'),_0x3d205c,_0x5e67('0x20'),JSON[_0x5e67('0x23')](_0x541247));if(_0x541247[_0x5e67('0x24')]){if(_0x541247['error'][_0x5e67('0x25')]===0x1f4){logger[_0x5e67('0x24')](_0x5e67('0x26'),_0x3d205c,_0x541247[_0x5e67('0x24')][_0x5e67('0x27')]);return _0x25aa79(_0x541247[_0x5e67('0x24')][_0x5e67('0x27')]);}logger[_0x5e67('0x24')](_0x5e67('0x26'),_0x3d205c,_0x541247[_0x5e67('0x24')][_0x5e67('0x27')]);return _0x50510c(_0x541247[_0x5e67('0x24')][_0x5e67('0x27')]);}else{logger[_0x5e67('0x1f')](_0x5e67('0x26'),_0x3d205c,_0x5e67('0x20'));_0x50510c(_0x541247[_0x5e67('0x28')]['message']);}})[_0x5e67('0x29')](function(_0xfd6bc5){logger[_0x5e67('0x24')](_0x5e67('0x26'),_0x3d205c,_0xfd6bc5);_0x25aa79(_0xfd6bc5);});});}function respondWithStatusCode(_0x56f4bc,_0x14641){_0x14641=_0x14641||0xcc;return function(_0x538378){if(_0x538378){return _0x56f4bc[_0x5e67('0x2a')](_0x14641);}return _0x56f4bc[_0x5e67('0x2b')](_0x14641)[_0x5e67('0x2c')]();};}function respondWithResult(_0x4c7590,_0x43ae46){_0x43ae46=_0x43ae46||0xc8;return function(_0x48f7ef){if(_0x48f7ef){return _0x4c7590[_0x5e67('0x2b')](_0x43ae46)[_0x5e67('0x2d')](_0x48f7ef);}};}function respondWithFilteredResult(_0x4adb22,_0x3bf607){return function(_0x313dd8){if(_0x313dd8){var _0x10753c=typeof _0x3bf607['offset']===_0x5e67('0x2e')&&typeof _0x3bf607['limit']===_0x5e67('0x2e');var _0x5b90fd=_0x313dd8['count'];var _0x9ebb9f=_0x10753c?0x0:_0x3bf607[_0x5e67('0x2f')];var _0x1aa7c2=_0x10753c?_0x313dd8[_0x5e67('0x30')]:_0x3bf607[_0x5e67('0x2f')]+_0x3bf607[_0x5e67('0x31')];var _0x1dcef0;if(_0x1aa7c2>=_0x5b90fd){_0x1aa7c2=_0x5b90fd;_0x1dcef0=0xc8;}else{_0x1dcef0=0xce;}_0x4adb22[_0x5e67('0x2b')](_0x1dcef0);return _0x4adb22[_0x5e67('0x32')](_0x5e67('0x33'),_0x9ebb9f+'-'+_0x1aa7c2+'/'+_0x5b90fd)['json'](_0x313dd8);}return null;};}function patchUpdates(_0x20761c){return function(_0x2857c8){try{jsonpatch[_0x5e67('0x34')](_0x2857c8,_0x20761c,!![]);}catch(_0x17e3b0){return BPromise[_0x5e67('0x35')](_0x17e3b0);}return _0x2857c8[_0x5e67('0x36')]();};}function saveUpdates(_0x35d23e,_0x1e2372){return function(_0x1af3db){if(_0x1af3db){return _0x1af3db[_0x5e67('0x37')](_0x35d23e)[_0x5e67('0x38')](function(_0x3571b1){return _0x3571b1;});}return null;};}function removeEntity(_0x517147,_0x5b9102){return function(_0x1213d1){if(_0x1213d1){return _0x1213d1['destroy']()[_0x5e67('0x38')](function(){_0x517147[_0x5e67('0x2b')](0xcc)[_0x5e67('0x2c')]();});}};}function handleEntityNotFound(_0x57557f,_0xce3d4a){return function(_0x9eeb4e){if(!_0x9eeb4e){_0x57557f['sendStatus'](0x194);}return _0x9eeb4e;};}function handleError(_0x577c35,_0x1f671b){_0x1f671b=_0x1f671b||0x1f4;return function(_0x2ab715){logger[_0x5e67('0x24')](_0x2ab715['stack']);if(_0x2ab715['name']){delete _0x2ab715[_0x5e67('0x39')];}_0x577c35[_0x5e67('0x2b')](_0x1f671b)[_0x5e67('0x3a')](_0x2ab715);};}exports[_0x5e67('0x3b')]=function(_0x41f77d,_0x2b3cab){var _0x3f74dd={},_0x3524df={},_0x490984={'count':0x0,'rows':[]};var _0x24c6aa=_[_0x5e67('0x3c')](db[_0x5e67('0x3d')][_0x5e67('0x3e')],function(_0x41ab72){return{'name':_0x41ab72['fieldName'],'type':_0x41ab72[_0x5e67('0x3f')][_0x5e67('0x40')]};});_0x3524df[_0x5e67('0x41')]=_[_0x5e67('0x3c')](_0x24c6aa,_0x5e67('0x39'));_0x3524df[_0x5e67('0x42')]=_['keys'](_0x41f77d['query']);_0x3524df[_0x5e67('0x43')]=_[_0x5e67('0x44')](_0x3524df[_0x5e67('0x41')],_0x3524df[_0x5e67('0x42')]);_0x3f74dd['attributes']=_[_0x5e67('0x44')](_0x3524df[_0x5e67('0x41')],qs[_0x5e67('0x45')](_0x41f77d[_0x5e67('0x42')]['fields']));_0x3f74dd[_0x5e67('0x46')]=_0x3f74dd[_0x5e67('0x46')]['length']?_0x3f74dd[_0x5e67('0x46')]:_0x3524df[_0x5e67('0x41')];if(!_0x41f77d[_0x5e67('0x42')][_0x5e67('0x47')](_0x5e67('0x48'))){_0x3f74dd[_0x5e67('0x31')]=qs[_0x5e67('0x31')](_0x41f77d['query'][_0x5e67('0x31')]);_0x3f74dd['offset']=qs['offset'](_0x41f77d['query'][_0x5e67('0x2f')]);}_0x3f74dd['order']=qs[_0x5e67('0x49')](_0x41f77d[_0x5e67('0x42')]['sort']);_0x3f74dd['where']=qs[_0x5e67('0x43')](_[_0x5e67('0x4a')](_0x41f77d[_0x5e67('0x42')],_0x3524df[_0x5e67('0x43')]),_0x24c6aa);if(_0x41f77d[_0x5e67('0x42')]['filter']){_0x3f74dd['where']=_[_0x5e67('0x4b')](_0x3f74dd[_0x5e67('0x4c')],{'$or':_[_0x5e67('0x3c')](_0x24c6aa,function(_0x3aeed7){if(_0x3aeed7['type']!==_0x5e67('0x4d')){var _0x56e0e1={};_0x56e0e1[_0x3aeed7[_0x5e67('0x39')]]={'$like':'%'+_0x41f77d[_0x5e67('0x42')]['filter']+'%'};return _0x56e0e1;}})});}_0x3f74dd=_[_0x5e67('0x4b')]({},_0x3f74dd,_0x41f77d[_0x5e67('0x4e')]);var _0x40efcb={'where':_0x3f74dd['where']};return db[_0x5e67('0x3d')][_0x5e67('0x30')](_0x40efcb)['then'](function(_0x221493){_0x490984['count']=_0x221493;if(_0x41f77d['query']['includeAll']){_0x3f74dd[_0x5e67('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0x5e67('0x50')](_0x3f74dd);})[_0x5e67('0x38')](function(_0x41959d){_0x490984['rows']=_0x41959d;return _0x490984;})[_0x5e67('0x38')](respondWithFilteredResult(_0x2b3cab,_0x3f74dd))[_0x5e67('0x29')](handleError(_0x2b3cab,null));};exports[_0x5e67('0x51')]=function(_0x35a55e,_0x1a0664){var _0x59c8a0={'raw':!![],'where':{'id':_0x35a55e[_0x5e67('0x52')]['id']}},_0xe96678={};_0xe96678[_0x5e67('0x41')]=_[_0x5e67('0x53')](db[_0x5e67('0x3d')][_0x5e67('0x3e')]);_0xe96678[_0x5e67('0x42')]=_['keys'](_0x35a55e['query']);_0xe96678['filters']=_[_0x5e67('0x44')](_0xe96678[_0x5e67('0x41')],_0xe96678[_0x5e67('0x42')]);_0x59c8a0['attributes']=_[_0x5e67('0x44')](_0xe96678[_0x5e67('0x41')],qs[_0x5e67('0x45')](_0x35a55e[_0x5e67('0x42')][_0x5e67('0x45')]));_0x59c8a0[_0x5e67('0x46')]=_0x59c8a0['attributes']['length']?_0x59c8a0['attributes']:_0xe96678[_0x5e67('0x41')];if(_0x35a55e[_0x5e67('0x42')][_0x5e67('0x54')]){_0x59c8a0[_0x5e67('0x4f')]=[{'all':!![]}];}_0x59c8a0=_['merge']({},_0x59c8a0,_0x35a55e[_0x5e67('0x4e')]);return db[_0x5e67('0x3d')][_0x5e67('0x55')](_0x59c8a0)['then'](handleEntityNotFound(_0x1a0664,null))[_0x5e67('0x38')](respondWithResult(_0x1a0664,null))['catch'](handleError(_0x1a0664,null));};exports[_0x5e67('0x37')]=function(_0x32ea56,_0x24df6f){if(_0x32ea56['body']['id']){delete _0x32ea56[_0x5e67('0x56')]['id'];}return db[_0x5e67('0x3d')][_0x5e67('0x55')]({'where':{'id':_0x32ea56['params']['id']}})['then'](handleEntityNotFound(_0x24df6f,null))[_0x5e67('0x38')](saveUpdates(_0x32ea56[_0x5e67('0x56')],null))['then'](respondWithResult(_0x24df6f,null))[_0x5e67('0x29')](handleError(_0x24df6f,null));};exports[_0x5e67('0x57')]=function(_0x3c7a28,_0x359efa){return db[_0x5e67('0x3d')]['find']({'where':{'id':_0x3c7a28[_0x5e67('0x52')]['id']}})['then'](handleEntityNotFound(_0x359efa,null))[_0x5e67('0x38')](removeEntity(_0x359efa,null))[_0x5e67('0x29')](handleError(_0x359efa,null));};exports['describe']=function(_0x51c995,_0x3a5c63){return db['FaxMessage'][_0x5e67('0x58')]()[_0x5e67('0x38')](respondWithResult(_0x3a5c63,null))['catch'](handleError(_0x3a5c63,null));};var interaction_log=require(_0x5e67('0x12'))(_0x5e67('0x59'));exports[_0x5e67('0x5a')]=function(_0x2c7b0a,_0x49e770,_0x52fe42){var _0x2e097e={'agent':{},'channel':_0x5e67('0x5b')};if(_0x2c7b0a[_0x5e67('0x56')]['id']){delete _0x2c7b0a[_0x5e67('0x56')]['id'];}_0x2c7b0a[_0x5e67('0x56')][_0x5e67('0x5c')]=!![];_0x2c7b0a['body']['readAt']=moment()[_0x5e67('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c7b0a['body'][_0x5e67('0x5e')]=_0x2c7b0a[_0x5e67('0x56')][_0x5e67('0x5e')]||_0x2c7b0a[_0x5e67('0x5f')]['id'];_0x2e097e[_0x5e67('0x60')]['id']=_0x2c7b0a[_0x5e67('0x56')][_0x5e67('0x5e')];return db[_0x5e67('0x3d')][_0x5e67('0x55')]({'where':{'id':_0x2c7b0a[_0x5e67('0x52')]['id'],'UserId':null}})[_0x5e67('0x38')](handleEntityNotFound(_0x49e770,null))[_0x5e67('0x38')](saveUpdates(_0x2c7b0a['body'],null))[_0x5e67('0x38')](function(_0x2b46cf){if(_0x2b46cf){_0x2e097e[_0x5e67('0x27')]=_0x2b46cf['get']({'plain':!![]});return db[_0x5e67('0x61')]['find']({'where':{'id':_0x2b46cf[_0x5e67('0x62')]}});}return null;})[_0x5e67('0x38')](handleEntityNotFound(_0x49e770,null))[_0x5e67('0x38')](function(_0x144b87){if(_0x144b87){return _0x144b87[_0x5e67('0x37')]({'UserId':_0x2c7b0a[_0x5e67('0x56')]['UserId'],'read1stAt':_[_0x5e67('0x63')](_0x144b87[_0x5e67('0x64')])?moment()[_0x5e67('0x5d')](_0x5e67('0x65')):undefined});}return null;})[_0x5e67('0x38')](function(_0x3efa07){if(_0x3efa07){_0x2e097e['interaction']=_0x3efa07['get']({'plain':!![]});interaction_log[_0x5e67('0x1f')](_0x5e67('0x66'),_0x2c7b0a[_0x5e67('0x5f')]['id'],_0x2c7b0a[_0x5e67('0x5f')][_0x5e67('0x39')],_0x2c7b0a[_0x5e67('0x5f')][_0x5e67('0x67')],_0x2e097e['interaction']['id'],_0x2c7b0a[_0x5e67('0x56')]?JSON['stringify'](_0x2c7b0a[_0x5e67('0x56')]):_0x5e67('0x68'));return respondWithRpcPromise(_0x5e67('0x69'),'acceptMessage',_0x2e097e);}return null;})['then'](function(_0x480a6c){var _0x58be4a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x480a6c['message'][_0x5e67('0x6a')];return db[_0x5e67('0x6b')][_0x5e67('0x42')](_0x58be4a,{'type':db[_0x5e67('0x6c')][_0x5e67('0x6d')]['SELECT'],'raw':!![]})[_0x5e67('0x38')](function(_0x2d905f){return _0x2d905f;});})['then'](function(_0x745518){if(_0x745518){_0x2e097e['message'][_0x5e67('0x6e')]=_0x745518[0x0];if(!_0x2c7b0a[_0x5e67('0x56')][_0x5e67('0x5e')])return;return db[_0x5e67('0x6f')][_0x5e67('0x55')]({'where':{'id':_0x2c7b0a[_0x5e67('0x56')][_0x5e67('0x5e')],'role':_0x5e67('0x60')},'attributes':['id',_0x5e67('0x39'),_0x5e67('0x70'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x4b359b){if(!_0x4b359b)return null;_0x2e097e[_0x5e67('0x27')][_0x5e67('0x60')]=_0x4b359b;return _0x2e097e;})['then'](function(_0x361dc7){if(_0x361dc7){if(_0x2c7b0a[_0x5e67('0x56')]['manual']){_0x2e097e[_0x5e67('0x27')][_0x5e67('0x71')]=util['format'](_0x5e67('0x72'),_0x2c7b0a[_0x5e67('0x5f')][_0x5e67('0x39')]);_0x2e097e[_0x5e67('0x27')][_0x5e67('0x73')]=_0x2e097e[_0x5e67('0x73')];_0x2e097e['message'][_0x5e67('0x74')]=_0x2e097e[_0x5e67('0x73')];_0x2e097e[_0x5e67('0x27')][_0x5e67('0x75')]='accept';return respondWithRpcPromise('EventManager',_0x5e67('0x76'),{'event':_0x5e67('0x77'),'message':_0x2e097e['message']},client9002)[_0x5e67('0x38')](function(){return _0x2e097e;});}return _0x2e097e;}return null;})['then'](respondWithResult(_0x49e770,null))[_0x5e67('0x29')](handleError(_0x49e770,null));};var interaction_log=require('../../config/logger')(_0x5e67('0x59'));exports[_0x5e67('0x35')]=function(_0x34b8f6,_0x106bb6,_0x4cbd07){var _0x23229f={'agent':{},'channel':_0x5e67('0x5b')};if(_0x34b8f6[_0x5e67('0x56')]['id']){delete _0x34b8f6[_0x5e67('0x56')]['id'];}_0x34b8f6[_0x5e67('0x56')][_0x5e67('0x5e')]=_0x34b8f6[_0x5e67('0x56')]['UserId']||_0x34b8f6[_0x5e67('0x5f')]['id'];_0x23229f[_0x5e67('0x60')]['id']=_0x34b8f6['body'][_0x5e67('0x5e')];return db[_0x5e67('0x3d')][_0x5e67('0x55')]({'where':{'id':_0x34b8f6[_0x5e67('0x52')]['id'],'UserId':null}})[_0x5e67('0x38')](handleEntityNotFound(_0x106bb6,null))[_0x5e67('0x38')](function(_0x1154e2){if(_0x1154e2){_0x23229f[_0x5e67('0x27')]=_0x1154e2[_0x5e67('0x78')]({'plain':!![]});return db[_0x5e67('0x61')][_0x5e67('0x55')]({'where':{'id':_0x1154e2[_0x5e67('0x62')]}});}return null;})[_0x5e67('0x38')](handleEntityNotFound(_0x106bb6,null))[_0x5e67('0x38')](function(_0x586deb){if(_0x586deb){_0x23229f[_0x5e67('0x79')]=_0x586deb[_0x5e67('0x78')]({'plain':!![]});interaction_log['info'](_0x5e67('0x7a'),_0x34b8f6[_0x5e67('0x5f')]['id'],_0x34b8f6['user'][_0x5e67('0x39')],_0x34b8f6[_0x5e67('0x5f')]['role'],_0x23229f['interaction']['id'],_0x34b8f6[_0x5e67('0x56')]?JSON[_0x5e67('0x23')](_0x34b8f6[_0x5e67('0x56')]):_0x5e67('0x68'));return respondWithRpcPromise(_0x5e67('0x7b'),_0x5e67('0x7c'),_0x23229f);}return null;})[_0x5e67('0x38')](function(_0x1a53f5){var _0x2ffd4f=_0x5e67('0x7d')+_0x1a53f5['message'][_0x5e67('0x6a')];return db['sequelize'][_0x5e67('0x42')](_0x2ffd4f,{'type':db[_0x5e67('0x6c')][_0x5e67('0x6d')][_0x5e67('0x7e')],'raw':!![]})[_0x5e67('0x38')](function(_0x28686e){return _0x28686e;});})[_0x5e67('0x38')](function(_0x327e07){if(_0x327e07){_0x23229f[_0x5e67('0x27')][_0x5e67('0x6e')]=_0x327e07[0x0];if(!_0x34b8f6[_0x5e67('0x56')]['UserId'])return;return db[_0x5e67('0x6f')][_0x5e67('0x55')]({'where':{'id':_0x34b8f6[_0x5e67('0x56')][_0x5e67('0x5e')],'role':_0x5e67('0x60')},'attributes':['id','name',_0x5e67('0x70'),_0x5e67('0x7f'),_0x5e67('0x80')],'raw':!![]});}return null;})[_0x5e67('0x38')](function(_0x42151f){if(!_0x42151f)return null;_0x23229f[_0x5e67('0x27')][_0x5e67('0x60')]=_0x42151f;return _0x23229f;})[_0x5e67('0x38')](function(_0x2c89fc){if(_0x2c89fc){_0x2c89fc[_0x5e67('0x27')]['interface']=util[_0x5e67('0x5d')](_0x5e67('0x72'),_0x34b8f6['user']['name']);_0x2c89fc[_0x5e67('0x27')][_0x5e67('0x73')]=_0x23229f[_0x5e67('0x73')];_0x2c89fc[_0x5e67('0x27')]['motionChannel']=_0x23229f['channel'];_0x2c89fc[_0x5e67('0x27')][_0x5e67('0x75')]=_0x5e67('0x35');respondWithRpcPromise(_0x5e67('0x76'),_0x5e67('0x76'),{'event':'rejectmessage','message':_0x2c89fc[_0x5e67('0x27')]},client9002);return _0x23229f;}return null;})[_0x5e67('0x38')](respondWithResult(_0x106bb6,null))['catch'](handleError(_0x106bb6,null));};exports[_0x5e67('0x81')]=function(_0x3baf53,_0x2fc1ae){var _0x12af2d;return db[_0x5e67('0x3d')]['create'](_0x3baf53[_0x5e67('0x56')],{})[_0x5e67('0x38')](function(_0x394e6c){_0x12af2d=_0x394e6c;return db[_0x5e67('0x82')][_0x5e67('0x83')]({'where':{'id':_0x12af2d[_0x5e67('0x6a')]}});})[_0x5e67('0x38')](function(_0x2777b9){if(_[_0x5e67('0x63')](_0x2777b9)){return;}else{_0x12af2d[_0x5e67('0x5b')]=_0x2777b9[_0x5e67('0x5b')];return db[_0x5e67('0x84')][_0x5e67('0x83')]({'where':{'id':_0x12af2d[_0x5e67('0x85')]}});}})['then'](function(_0x417986){return respondWithRpcPromise(_0x5e67('0x86'),_0x5e67('0x86'),{'FaxAccountId':_[_0x5e67('0x63')](_0x3baf53[_0x5e67('0x56')])?undefined:_0x3baf53[_0x5e67('0x56')][_0x5e67('0x87')],'path':_[_0x5e67('0x63')](_0x417986)?undefined:util[_0x5e67('0x5d')](_0x5e67('0x88'),_0x417986['basename']),'fax':_[_0x5e67('0x63')](_0x12af2d[_0x5e67('0x5b')])?undefined:_0x12af2d[_0x5e67('0x5b')],'AttachmentId':_0x12af2d['AttachmentId']},client9002);})['then'](respondWithResult(_0x2fc1ae,0xc9))['catch'](handleError(_0x2fc1ae,null));};exports[_0x5e67('0x89')]=function(_0x4daef9,_0x44d638){var _0x1dc963=path['join'](config['root'],_0x5e67('0x8a'),_0x5e67('0x8b'),_0x5e67('0x8c'));return db[_0x5e67('0x3d')][_0x5e67('0x55')]({'where':{'id':_0x4daef9[_0x5e67('0x52')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x44d638,null))[_0x5e67('0x38')](function(_0x27dc9a){if(_0x27dc9a){return _0x44d638[_0x5e67('0x89')](path[_0x5e67('0x8d')](_0x1dc963,_0x27dc9a['Attachment'][_0x5e67('0x8e')]));}})[_0x5e67('0x29')](handleError(_0x44d638,null));}; \ No newline at end of file +var _0x6206=['code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','includeAll','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE: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','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','accept','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','User','email','SIP/%s','event','rejectmessage','create','CmContact','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x3b3064,_0x36bf5e){var _0x51eb6a=function(_0x52b27e){while(--_0x52b27e){_0x3b3064['push'](_0x3b3064['shift']());}};_0x51eb6a(++_0x36bf5e);}(_0x6206,0x193));var _0x6620=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x6206[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0x6620('0x0'));var rimraf=require(_0x6620('0x1'));var zipdir=require(_0x6620('0x2'));var jsonpatch=require(_0x6620('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6620('0x4'));var util=require(_0x6620('0x5'));var path=require(_0x6620('0x6'));var sox=require(_0x6620('0x7'));var csv=require(_0x6620('0x8'));var ejs=require(_0x6620('0x9'));var fs=require('fs');var fs_extra=require(_0x6620('0xa'));var _=require(_0x6620('0xb'));var squel=require(_0x6620('0xc'));var crypto=require(_0x6620('0xd'));var jsforce=require(_0x6620('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6620('0x8'));var querystring=require(_0x6620('0xf'));var Papa=require(_0x6620('0x10'));var Redis=require(_0x6620('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6620('0x12'));var hardwareService=require(_0x6620('0x13'));var logger=require(_0x6620('0x14'))(_0x6620('0x15'));var utils=require(_0x6620('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6620('0x17'));var db=require(_0x6620('0x18'))['db'];config[_0x6620('0x19')]=_[_0x6620('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6620('0x1b'))(new Redis(config[_0x6620('0x19')]));require(_0x6620('0x1c'))[_0x6620('0x1d')](socket);var jayson=require(_0x6620('0x1e'));var client=jayson[_0x6620('0x1f')][_0x6620('0x20')]({'port':0x232c});var client9002=jayson[_0x6620('0x1f')][_0x6620('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x235c2c,_0x529e6e,_0x2f456b,_0x1287b7){return new BPromise(function(_0x23a698,_0x2ff579){var _0x51783e=_0x1287b7||client;return _0x51783e[_0x6620('0x21')](_0x235c2c,_0x2f456b)[_0x6620('0x22')](function(_0x4cd4ce){logger[_0x6620('0x23')](_0x6620('0x24'),_0x529e6e,_0x6620('0x25'));logger[_0x6620('0x26')](_0x6620('0x27'),_0x529e6e,'request\x20sent',JSON['stringify'](_0x4cd4ce));if(_0x4cd4ce[_0x6620('0x28')]){if(_0x4cd4ce[_0x6620('0x28')][_0x6620('0x29')]===0x1f4){logger[_0x6620('0x28')](_0x6620('0x24'),_0x529e6e,_0x4cd4ce[_0x6620('0x28')][_0x6620('0x2a')]);return _0x2ff579(_0x4cd4ce[_0x6620('0x28')][_0x6620('0x2a')]);}logger[_0x6620('0x28')](_0x6620('0x24'),_0x529e6e,_0x4cd4ce['error'][_0x6620('0x2a')]);return _0x23a698(_0x4cd4ce[_0x6620('0x28')][_0x6620('0x2a')]);}else{logger[_0x6620('0x23')](_0x6620('0x24'),_0x529e6e,'request\x20sent');_0x23a698(_0x4cd4ce[_0x6620('0x2b')][_0x6620('0x2a')]);}})[_0x6620('0x2c')](function(_0x1d1635){logger[_0x6620('0x28')](_0x6620('0x24'),_0x529e6e,_0x1d1635);_0x2ff579(_0x1d1635);});});}function respondWithStatusCode(_0x5bfb02,_0x8a604d){_0x8a604d=_0x8a604d||0xcc;return function(_0x1eeb1a){if(_0x1eeb1a){return _0x5bfb02[_0x6620('0x2d')](_0x8a604d);}return _0x5bfb02['status'](_0x8a604d)[_0x6620('0x2e')]();};}function respondWithResult(_0x594d04,_0x5693a2){_0x5693a2=_0x5693a2||0xc8;return function(_0x2595f9){if(_0x2595f9){return _0x594d04[_0x6620('0x2f')](_0x5693a2)[_0x6620('0x30')](_0x2595f9);}};}function respondWithFilteredResult(_0x299b1d,_0x5895e5){return function(_0x2b8b63){if(_0x2b8b63){var _0x26286d=typeof _0x5895e5[_0x6620('0x31')]===_0x6620('0x32')&&typeof _0x5895e5['limit']===_0x6620('0x32');var _0x55a4e3=_0x2b8b63[_0x6620('0x33')];var _0x4f3873=_0x26286d?0x0:_0x5895e5[_0x6620('0x31')];var _0x42374c=_0x26286d?_0x2b8b63[_0x6620('0x33')]:_0x5895e5[_0x6620('0x31')]+_0x5895e5[_0x6620('0x34')];var _0x4fce9b;if(_0x42374c>=_0x55a4e3){_0x42374c=_0x55a4e3;_0x4fce9b=0xc8;}else{_0x4fce9b=0xce;}_0x299b1d[_0x6620('0x2f')](_0x4fce9b);return _0x299b1d['set']('Content-Range',_0x4f3873+'-'+_0x42374c+'/'+_0x55a4e3)[_0x6620('0x30')](_0x2b8b63);}return null;};}function patchUpdates(_0x530376){return function(_0x5a7822){try{jsonpatch['apply'](_0x5a7822,_0x530376,!![]);}catch(_0x4aa86d){return BPromise[_0x6620('0x35')](_0x4aa86d);}return _0x5a7822[_0x6620('0x36')]();};}function saveUpdates(_0x45ae4e,_0x54e15e){return function(_0x49039e){if(_0x49039e){return _0x49039e[_0x6620('0x37')](_0x45ae4e)[_0x6620('0x22')](function(_0x23351a){return _0x23351a;});}return null;};}function removeEntity(_0x1c3ca0,_0x530b05){return function(_0x243534){if(_0x243534){return _0x243534[_0x6620('0x38')]()[_0x6620('0x22')](function(){_0x1c3ca0[_0x6620('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a5db7,_0x1cae1e){return function(_0x133d61){if(!_0x133d61){_0x4a5db7['sendStatus'](0x194);}return _0x133d61;};}function handleError(_0x2fcf56,_0x216d96){_0x216d96=_0x216d96||0x1f4;return function(_0x58b963){logger[_0x6620('0x28')](_0x58b963[_0x6620('0x39')]);if(_0x58b963['name']){delete _0x58b963[_0x6620('0x3a')];}_0x2fcf56[_0x6620('0x2f')](_0x216d96)[_0x6620('0x3b')](_0x58b963);};}exports[_0x6620('0x3c')]=function(_0x19a06e,_0x9dbba5){var _0x3fa24b={},_0x480dee={},_0x515101={'count':0x0,'rows':[]};var _0x1c64b8=_[_0x6620('0x3d')](db[_0x6620('0x3e')][_0x6620('0x3f')],function(_0x356ddb){return{'name':_0x356ddb[_0x6620('0x40')],'type':_0x356ddb[_0x6620('0x41')][_0x6620('0x42')]};});_0x480dee[_0x6620('0x43')]=_[_0x6620('0x3d')](_0x1c64b8,_0x6620('0x3a'));_0x480dee['query']=_[_0x6620('0x44')](_0x19a06e[_0x6620('0x45')]);_0x480dee[_0x6620('0x46')]=_[_0x6620('0x47')](_0x480dee[_0x6620('0x43')],_0x480dee[_0x6620('0x45')]);_0x3fa24b[_0x6620('0x48')]=_[_0x6620('0x47')](_0x480dee[_0x6620('0x43')],qs[_0x6620('0x49')](_0x19a06e[_0x6620('0x45')][_0x6620('0x49')]));_0x3fa24b['attributes']=_0x3fa24b[_0x6620('0x48')][_0x6620('0x4a')]?_0x3fa24b[_0x6620('0x48')]:_0x480dee['model'];if(!_0x19a06e['query'][_0x6620('0x4b')](_0x6620('0x4c'))){_0x3fa24b[_0x6620('0x34')]=qs['limit'](_0x19a06e[_0x6620('0x45')]['limit']);_0x3fa24b['offset']=qs[_0x6620('0x31')](_0x19a06e[_0x6620('0x45')][_0x6620('0x31')]);}_0x3fa24b[_0x6620('0x4d')]=qs['sort'](_0x19a06e[_0x6620('0x45')][_0x6620('0x4e')]);_0x3fa24b[_0x6620('0x4f')]=qs[_0x6620('0x46')](_[_0x6620('0x50')](_0x19a06e[_0x6620('0x45')],_0x480dee[_0x6620('0x46')]),_0x1c64b8);if(_0x19a06e[_0x6620('0x45')][_0x6620('0x51')]){_0x3fa24b[_0x6620('0x4f')]=_[_0x6620('0x52')](_0x3fa24b[_0x6620('0x4f')],{'$or':_['map'](_0x1c64b8,function(_0x76a98a){if(_0x76a98a['type']!=='VIRTUAL'){var _0x26845f={};_0x26845f[_0x76a98a[_0x6620('0x3a')]]={'$like':'%'+_0x19a06e[_0x6620('0x45')][_0x6620('0x51')]+'%'};return _0x26845f;}})});}_0x3fa24b=_[_0x6620('0x52')]({},_0x3fa24b,_0x19a06e[_0x6620('0x53')]);var _0x3d6031={'where':_0x3fa24b[_0x6620('0x4f')]};return db['FaxMessage'][_0x6620('0x33')](_0x3d6031)[_0x6620('0x22')](function(_0x5041b1){_0x515101[_0x6620('0x33')]=_0x5041b1;if(_0x19a06e['query']['includeAll']){_0x3fa24b[_0x6620('0x54')]=[{'all':!![]}];}return db[_0x6620('0x3e')]['findAll'](_0x3fa24b);})['then'](function(_0xb9e486){_0x515101[_0x6620('0x55')]=_0xb9e486;return _0x515101;})['then'](respondWithFilteredResult(_0x9dbba5,_0x3fa24b))[_0x6620('0x2c')](handleError(_0x9dbba5,null));};exports[_0x6620('0x56')]=function(_0x16f036,_0x276b2c){var _0xfd2f5d={'raw':!![],'where':{'id':_0x16f036[_0x6620('0x57')]['id']}},_0x32b7c7={};_0x32b7c7[_0x6620('0x43')]=_[_0x6620('0x44')](db[_0x6620('0x3e')][_0x6620('0x3f')]);_0x32b7c7[_0x6620('0x45')]=_[_0x6620('0x44')](_0x16f036['query']);_0x32b7c7[_0x6620('0x46')]=_[_0x6620('0x47')](_0x32b7c7[_0x6620('0x43')],_0x32b7c7[_0x6620('0x45')]);_0xfd2f5d['attributes']=_[_0x6620('0x47')](_0x32b7c7[_0x6620('0x43')],qs[_0x6620('0x49')](_0x16f036[_0x6620('0x45')][_0x6620('0x49')]));_0xfd2f5d[_0x6620('0x48')]=_0xfd2f5d[_0x6620('0x48')]['length']?_0xfd2f5d[_0x6620('0x48')]:_0x32b7c7[_0x6620('0x43')];if(_0x16f036[_0x6620('0x45')][_0x6620('0x58')]){_0xfd2f5d[_0x6620('0x54')]=[{'all':!![]}];}_0xfd2f5d=_[_0x6620('0x52')]({},_0xfd2f5d,_0x16f036['options']);return db['FaxMessage'][_0x6620('0x59')](_0xfd2f5d)[_0x6620('0x22')](handleEntityNotFound(_0x276b2c,null))[_0x6620('0x22')](respondWithResult(_0x276b2c,null))[_0x6620('0x2c')](handleError(_0x276b2c,null));};exports[_0x6620('0x37')]=function(_0x33209e,_0x594b2b){if(_0x33209e[_0x6620('0x5a')]['id']){delete _0x33209e[_0x6620('0x5a')]['id'];}return db[_0x6620('0x3e')][_0x6620('0x59')]({'where':{'id':_0x33209e[_0x6620('0x57')]['id']}})[_0x6620('0x22')](handleEntityNotFound(_0x594b2b,null))['then'](saveUpdates(_0x33209e['body'],null))['then'](respondWithResult(_0x594b2b,null))['catch'](handleError(_0x594b2b,null));};exports[_0x6620('0x38')]=function(_0x4a85b1,_0x348ba1){return db[_0x6620('0x3e')]['find']({'where':{'id':_0x4a85b1[_0x6620('0x57')]['id']}})['then'](handleEntityNotFound(_0x348ba1,null))['then'](removeEntity(_0x348ba1,null))[_0x6620('0x2c')](handleError(_0x348ba1,null));};exports[_0x6620('0x5b')]=function(_0x3aa3ca,_0x31b595){return db['FaxMessage'][_0x6620('0x5b')]()['then'](respondWithResult(_0x31b595,null))[_0x6620('0x2c')](handleError(_0x31b595,null));};var interaction_log=require('../../config/logger')(_0x6620('0x5c'));exports['accept']=function(_0x3a3d0b,_0x1b2bc9,_0x598d88){var _0x193915={'agent':{},'channel':_0x6620('0x5d')};if(_0x3a3d0b[_0x6620('0x5a')]['id']){delete _0x3a3d0b[_0x6620('0x5a')]['id'];}_0x3a3d0b[_0x6620('0x5a')][_0x6620('0x5e')]=!![];_0x3a3d0b[_0x6620('0x5a')][_0x6620('0x5f')]=moment()[_0x6620('0x60')](_0x6620('0x61'));_0x3a3d0b[_0x6620('0x5a')][_0x6620('0x62')]=_0x3a3d0b[_0x6620('0x5a')][_0x6620('0x62')]||_0x3a3d0b[_0x6620('0x63')]['id'];_0x193915[_0x6620('0x64')]['id']=_0x3a3d0b['body']['UserId'];return db[_0x6620('0x3e')][_0x6620('0x59')]({'where':{'id':_0x3a3d0b[_0x6620('0x57')]['id'],'UserId':null}})[_0x6620('0x22')](handleEntityNotFound(_0x1b2bc9,null))[_0x6620('0x22')](saveUpdates(_0x3a3d0b['body'],null))['then'](function(_0x232ef3){if(_0x232ef3){_0x193915[_0x6620('0x2a')]=_0x232ef3[_0x6620('0x65')]({'plain':!![]});return db[_0x6620('0x66')][_0x6620('0x59')]({'where':{'id':_0x232ef3[_0x6620('0x67')]}});}return null;})[_0x6620('0x22')](handleEntityNotFound(_0x1b2bc9,null))[_0x6620('0x22')](function(_0xaaafa7){if(_0xaaafa7){return _0xaaafa7[_0x6620('0x37')]({'UserId':_0x3a3d0b['body']['UserId'],'read1stAt':_[_0x6620('0x68')](_0xaaafa7['read1stAt'])?moment()[_0x6620('0x60')](_0x6620('0x61')):undefined});}return null;})[_0x6620('0x22')](function(_0x1f9406){if(_0x1f9406){_0x193915[_0x6620('0x69')]=_0x1f9406[_0x6620('0x65')]({'plain':!![]});interaction_log[_0x6620('0x23')](_0x6620('0x6a'),_0x3a3d0b[_0x6620('0x63')]['id'],_0x3a3d0b[_0x6620('0x63')][_0x6620('0x3a')],_0x3a3d0b[_0x6620('0x63')]['role'],_0x193915[_0x6620('0x69')]['id'],_0x3a3d0b[_0x6620('0x5a')]?JSON[_0x6620('0x6b')](_0x3a3d0b[_0x6620('0x5a')]):_0x6620('0x6c'));return respondWithRpcPromise(_0x6620('0x6d'),_0x6620('0x6e'),_0x193915);}return null;})[_0x6620('0x22')](function(_0x404788){var _0x2b5c2c=_0x6620('0x6f')+_0x404788[_0x6620('0x2a')][_0x6620('0x70')];return db[_0x6620('0x71')][_0x6620('0x45')](_0x2b5c2c,{'type':db[_0x6620('0x72')]['QueryTypes'][_0x6620('0x73')],'raw':!![]})[_0x6620('0x22')](function(_0x15a8e2){return _0x15a8e2;});})[_0x6620('0x22')](function(_0x4f22d8){if(_0x4f22d8){_0x193915['message'][_0x6620('0x74')]=_0x4f22d8[0x0];if(!_0x3a3d0b['body'][_0x6620('0x62')])return;return db['User'][_0x6620('0x59')]({'where':{'id':_0x3a3d0b['body'][_0x6620('0x62')],'role':_0x6620('0x64')},'attributes':['id',_0x6620('0x3a'),_0x6620('0x75'),'email',_0x6620('0x76')],'raw':!![]});}return null;})['then'](function(_0x1d0f32){if(!_0x1d0f32)return null;_0x193915[_0x6620('0x2a')][_0x6620('0x64')]=_0x1d0f32;return _0x193915;})[_0x6620('0x22')](function(_0x5363c9){if(_0x5363c9){if(_0x3a3d0b[_0x6620('0x5a')][_0x6620('0x77')]){_0x193915[_0x6620('0x2a')][_0x6620('0x78')]=util[_0x6620('0x60')]('SIP/%s',_0x3a3d0b[_0x6620('0x63')][_0x6620('0x3a')]);_0x193915['message'][_0x6620('0x79')]=_0x193915['channel'];_0x193915[_0x6620('0x2a')][_0x6620('0x7a')]=_0x193915[_0x6620('0x79')];_0x193915['message']['event']=_0x6620('0x7b');return respondWithRpcPromise('EventManager',_0x6620('0x7c'),{'event':'acceptmessage','message':_0x193915['message']},client9002)['then'](function(){return _0x193915;});}return _0x193915;}return null;})['then'](respondWithResult(_0x1b2bc9,null))[_0x6620('0x2c')](handleError(_0x1b2bc9,null));};var interaction_log=require('../../config/logger')(_0x6620('0x5c'));exports[_0x6620('0x35')]=function(_0xf64b83,_0x59df6a,_0x359ff0){var _0x2ad772={'agent':{},'channel':_0x6620('0x5d')};if(_0xf64b83['body']['id']){delete _0xf64b83[_0x6620('0x5a')]['id'];}_0xf64b83['body']['UserId']=_0xf64b83['body']['UserId']||_0xf64b83[_0x6620('0x63')]['id'];_0x2ad772[_0x6620('0x64')]['id']=_0xf64b83[_0x6620('0x5a')][_0x6620('0x62')];return db[_0x6620('0x3e')]['find']({'where':{'id':_0xf64b83[_0x6620('0x57')]['id'],'UserId':null}})[_0x6620('0x22')](handleEntityNotFound(_0x59df6a,null))[_0x6620('0x22')](function(_0x51165d){if(_0x51165d){_0x2ad772['message']=_0x51165d[_0x6620('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x6620('0x59')]({'where':{'id':_0x51165d[_0x6620('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x59df6a,null))[_0x6620('0x22')](function(_0x35434f){if(_0x35434f){_0x2ad772[_0x6620('0x69')]=_0x35434f[_0x6620('0x65')]({'plain':!![]});interaction_log['info'](_0x6620('0x7d'),_0xf64b83[_0x6620('0x63')]['id'],_0xf64b83[_0x6620('0x63')][_0x6620('0x3a')],_0xf64b83[_0x6620('0x63')][_0x6620('0x7e')],_0x2ad772[_0x6620('0x69')]['id'],_0xf64b83[_0x6620('0x5a')]?JSON[_0x6620('0x6b')](_0xf64b83['body']):'null');return respondWithRpcPromise(_0x6620('0x7f'),_0x6620('0x80'),_0x2ad772);}return null;})[_0x6620('0x22')](function(_0x2f5697){var _0x3b8bde=_0x6620('0x6f')+_0x2f5697[_0x6620('0x2a')][_0x6620('0x70')];return db[_0x6620('0x71')][_0x6620('0x45')](_0x3b8bde,{'type':db[_0x6620('0x72')][_0x6620('0x81')][_0x6620('0x73')],'raw':!![]})['then'](function(_0x43ace3){return _0x43ace3;});})[_0x6620('0x22')](function(_0x3cf27d){if(_0x3cf27d){_0x2ad772[_0x6620('0x2a')][_0x6620('0x74')]=_0x3cf27d[0x0];if(!_0xf64b83[_0x6620('0x5a')][_0x6620('0x62')])return;return db[_0x6620('0x82')][_0x6620('0x59')]({'where':{'id':_0xf64b83['body']['UserId'],'role':_0x6620('0x64')},'attributes':['id','name',_0x6620('0x75'),_0x6620('0x83'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3c19e1){if(!_0x3c19e1)return null;_0x2ad772[_0x6620('0x2a')][_0x6620('0x64')]=_0x3c19e1;return _0x2ad772;})['then'](function(_0x1db72f){if(_0x1db72f){_0x1db72f['message'][_0x6620('0x78')]=util[_0x6620('0x60')](_0x6620('0x84'),_0xf64b83[_0x6620('0x63')][_0x6620('0x3a')]);_0x1db72f['message'][_0x6620('0x79')]=_0x2ad772[_0x6620('0x79')];_0x1db72f[_0x6620('0x2a')][_0x6620('0x7a')]=_0x2ad772[_0x6620('0x79')];_0x1db72f[_0x6620('0x2a')][_0x6620('0x85')]='reject';respondWithRpcPromise(_0x6620('0x7c'),'EventManager',{'event':_0x6620('0x86'),'message':_0x1db72f[_0x6620('0x2a')]},client9002);return _0x2ad772;}return null;})[_0x6620('0x22')](respondWithResult(_0x59df6a,null))[_0x6620('0x2c')](handleError(_0x59df6a,null));};exports[_0x6620('0x87')]=function(_0x2e39c5,_0x5e39bc){var _0x231a1a;return db[_0x6620('0x3e')][_0x6620('0x87')](_0x2e39c5[_0x6620('0x5a')],{})[_0x6620('0x22')](function(_0x14722a){_0x231a1a=_0x14722a;return db[_0x6620('0x88')]['findOne']({'where':{'id':_0x231a1a['ContactId']}});})[_0x6620('0x22')](function(_0x608cfc){if(_[_0x6620('0x68')](_0x608cfc)){return;}else{_0x231a1a[_0x6620('0x5d')]=_0x608cfc[_0x6620('0x5d')];return db[_0x6620('0x89')]['findOne']({'where':{'id':_0x231a1a['AttachmentId']}});}})['then'](function(_0x4836ee){return respondWithRpcPromise(_0x6620('0x8a'),'SendFax',{'FaxAccountId':_[_0x6620('0x68')](_0x2e39c5[_0x6620('0x5a')])?undefined:_0x2e39c5['body'][_0x6620('0x8b')],'path':_['isNil'](_0x4836ee)?undefined:util[_0x6620('0x60')](_0x6620('0x8c'),_0x4836ee[_0x6620('0x8d')]),'fax':_['isNil'](_0x231a1a[_0x6620('0x5d')])?undefined:_0x231a1a[_0x6620('0x5d')],'AttachmentId':_0x231a1a['AttachmentId']},client9002);})[_0x6620('0x22')](respondWithResult(_0x5e39bc,0xc9))[_0x6620('0x2c')](handleError(_0x5e39bc,null));};exports[_0x6620('0x8e')]=function(_0xf28f44,_0x2ec374){var _0x5b54f3=path[_0x6620('0x8f')](config[_0x6620('0x90')],_0x6620('0x91'),_0x6620('0x92'),_0x6620('0x93'));return db[_0x6620('0x3e')][_0x6620('0x59')]({'where':{'id':_0xf28f44[_0x6620('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0x6620('0x89')}]})[_0x6620('0x22')](handleEntityNotFound(_0x2ec374,null))['then'](function(_0x578820){if(_0x578820){return _0x2ec374[_0x6620('0x8e')](path['join'](_0x5b54f3,_0x578820[_0x6620('0x89')][_0x6620('0x8d')]));}})[_0x6620('0x2c')](handleError(_0x2ec374,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 6581b1d..ceaf60d 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 _0x82c4=['FaxMessage','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x17174c,_0x266797){var _0x38125a=function(_0x551221){while(--_0x551221){_0x17174c['push'](_0x17174c['shift']());}};_0x38125a(++_0x266797);}(_0x82c4,0x1ca));var _0x482c=function(_0x34596a,_0x4f5372){_0x34596a=_0x34596a-0x0;var _0x1695ec=_0x82c4[_0x34596a];return _0x1695ec;};'use strict';var EventEmitter=require(_0x482c('0x0'));var FaxMessage=require(_0x482c('0x1'))['db'][_0x482c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x482c('0x3')](0x0);var events={'afterCreate':_0x482c('0x4'),'afterUpdate':_0x482c('0x5'),'afterDestroy':_0x482c('0x6')};function emitEvent(_0x56de13){return function(_0x16b0f8,_0x5f4dee,_0x4556c8){FaxMessageEvents['emit'](_0x56de13+':'+_0x16b0f8['id'],_0x16b0f8);FaxMessageEvents[_0x482c('0x7')](_0x56de13,_0x16b0f8);_0x4556c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x482c('0x8')](e,emitEvent(event));}}module[_0x482c('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xb234=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x31d354,_0x2cc826){var _0x340a41=function(_0x2a0ca6){while(--_0x2a0ca6){_0x31d354['push'](_0x31d354['shift']());}};_0x340a41(++_0x2cc826);}(_0xb234,0x13f));var _0x4b23=function(_0x5e3736,_0x4649e7){_0x5e3736=_0x5e3736-0x0;var _0x854f42=_0xb234[_0x5e3736];return _0x854f42;};'use strict';var EventEmitter=require(_0x4b23('0x0'));var FaxMessage=require(_0x4b23('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x4b23('0x2')](0x0);var events={'afterCreate':_0x4b23('0x3'),'afterUpdate':_0x4b23('0x4'),'afterDestroy':_0x4b23('0x5')};function emitEvent(_0x5496ed){return function(_0x5557dc,_0x36c95e,_0xf90d41){FaxMessageEvents['emit'](_0x5496ed+':'+_0x5557dc['id'],_0x5557dc);FaxMessageEvents[_0x4b23('0x6')](_0x5496ed,_0x5557dc);_0xf90d41(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x4b23('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0a7644d..67b3269 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 _0xa884=['toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction'];(function(_0x2910c5,_0x143843){var _0x3c94de=function(_0x378062){while(--_0x378062){_0x2910c5['push'](_0x2910c5['shift']());}};_0x3c94de(++_0x143843);}(_0xa884,0x1ed));var _0x4a88=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0xa884[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var logger=require('../../config/logger')(_0x4a88('0x2'));var moment=require(_0x4a88('0x3'));var BPromise=require(_0x4a88('0x4'));var rp=require(_0x4a88('0x5'));var fs=require('fs');var path=require(_0x4a88('0x6'));var rimraf=require(_0x4a88('0x7'));var config=require(_0x4a88('0x8'));var attributes=require('./faxMessage.attributes');module[_0x4a88('0x9')]=function(_0x1150be,_0x5a8330){return _0x1150be[_0x4a88('0xa')](_0x4a88('0xb'),attributes,{'tableName':_0x4a88('0xc'),'paranoid':![],'indexes':[{'name':_0x4a88('0xd'),'fields':[_0x4a88('0xe')],'type':_0x4a88('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11bb63,_0x5e61ed,_0x33dd86){var _0x1f956a=_0x1150be[_0x4a88('0x10')];var _0x2d6615=_0x11bb63[_0x4a88('0x11')]({'plain':!![]});if(_0x2d6615[_0x4a88('0x12')][_0x4a88('0x13')]()==='in'||_0x2d6615[_0x4a88('0x12')][_0x4a88('0x13')]()==='out'&&!_0x2d6615[_0x4a88('0x14')]&&!_[_0x4a88('0x15')](_0x2d6615['UserId'])){_0x1f956a[_0x4a88('0x16')][_0x4a88('0x17')]({'where':{'id':_0x2d6615[_0x4a88('0x18')]}})[_0x4a88('0x19')](function(_0x316be2){if(_0x316be2){_0x316be2[_0x4a88('0x1a')]({'lastMsgAt':_0x2d6615[_0x4a88('0x1b')],'lastMsgDirection':_0x2d6615[_0x4a88('0x12')][_0x4a88('0x13')]()});}})[_0x4a88('0x1c')](function(_0x271195){console[_0x4a88('0x1d')](_0x271195);});}_0x33dd86();}},'charset':_0x4a88('0x1e'),'collate':_0x4a88('0x1f')});}; \ No newline at end of file +var _0x6ca7=['request-promise','path','rimraf','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','then','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0xd64668,_0x3f3acb){var _0x163ef9=function(_0x159f81){while(--_0x159f81){_0xd64668['push'](_0xd64668['shift']());}};_0x163ef9(++_0x3f3acb);}(_0x6ca7,0x1bb));var _0x76ca=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x6ca7[_0x16cb03];return _0x10944e;};'use strict';var _=require(_0x76ca('0x0'));var util=require(_0x76ca('0x1'));var logger=require(_0x76ca('0x2'))(_0x76ca('0x3'));var moment=require('moment');var BPromise=require(_0x76ca('0x4'));var rp=require(_0x76ca('0x5'));var fs=require('fs');var path=require(_0x76ca('0x6'));var rimraf=require(_0x76ca('0x7'));var config=require('../../config/environment');var attributes=require(_0x76ca('0x8'));module['exports']=function(_0x37ec6a,_0x3894b3){return _0x37ec6a[_0x76ca('0x9')](_0x76ca('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x76ca('0xb'),'fields':[_0x76ca('0xc')],'type':_0x76ca('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f2d8b,_0x2da296,_0x1878b6){var _0x15485f=_0x37ec6a[_0x76ca('0xe')];var _0x22e2f8=_0x2f2d8b[_0x76ca('0xf')]({'plain':!![]});if(_0x22e2f8[_0x76ca('0x10')]['toLowerCase']()==='in'||_0x22e2f8['direction'][_0x76ca('0x11')]()===_0x76ca('0x12')&&!_0x22e2f8[_0x76ca('0x13')]&&!_[_0x76ca('0x14')](_0x22e2f8[_0x76ca('0x15')])){_0x15485f['FaxInteraction'][_0x76ca('0x16')]({'where':{'id':_0x22e2f8[_0x76ca('0x17')]}})[_0x76ca('0x18')](function(_0xa901e9){if(_0xa901e9){_0xa901e9['update']({'lastMsgAt':_0x22e2f8['createdAt'],'lastMsgDirection':_0x22e2f8[_0x76ca('0x10')][_0x76ca('0x11')]()});}})['catch'](function(_0x6d436e){console[_0x76ca('0x19')](_0x6d436e);});}_0x1878b6();}},'charset':_0x76ca('0x1a'),'collate':_0x76ca('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e668804..6e25814 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 _0x8d0e=['http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f1753,_0x58ca9b){var _0x4fb12d=function(_0x55e8fd){while(--_0x55e8fd){_0x2f1753['push'](_0x2f1753['shift']());}};_0x4fb12d(++_0x58ca9b);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x448b42,_0x95ec01){_0x448b42=_0x448b42-0x0;var _0x377ea2=_0x8d0e[_0x448b42];return _0x377ea2;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});config[_0xe8d0('0xb')]=_[_0xe8d0('0xc')](config[_0xe8d0('0xb')],{'host':_0xe8d0('0xd'),'port':0x18eb});var socket=require(_0xe8d0('0xe'))(new Redis(config[_0xe8d0('0xb')]));require(_0xe8d0('0xf'))['register'](socket);function respondWithRpcPromise(_0x10e56c,_0x19c3d0,_0x463159){return new BPromise(function(_0x599bc3,_0x580aab){return client[_0xe8d0('0x10')](_0x10e56c,_0x463159)[_0xe8d0('0x11')](function(_0x3da047){logger[_0xe8d0('0x12')](_0xe8d0('0x13'),_0x19c3d0,_0xe8d0('0x14'));logger['debug'](_0xe8d0('0x15'),_0x19c3d0,_0xe8d0('0x14'),JSON['stringify'](_0x3da047));if(_0x3da047[_0xe8d0('0x16')]){if(_0x3da047['error']['code']===0x1f4){logger[_0xe8d0('0x16')](_0xe8d0('0x13'),_0x19c3d0,_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);return _0x580aab(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}logger['error'](_0xe8d0('0x13'),_0x19c3d0,_0x3da047['error'][_0xe8d0('0x17')]);return _0x599bc3(_0x3da047[_0xe8d0('0x16')][_0xe8d0('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x19c3d0,'request\x20sent');_0x599bc3(_0x3da047[_0xe8d0('0x18')][_0xe8d0('0x17')]);}})[_0xe8d0('0x19')](function(_0x44bbe4){logger[_0xe8d0('0x16')]('FaxMessage,\x20%s,\x20%s',_0x19c3d0,_0x44bbe4);_0x580aab(_0x44bbe4);});});}exports[_0xe8d0('0x1a')]=function(_0x12ebf4){var _0x524b00=this;return new Promise(function(_0x5ce284,_0x554402){return db[_0xe8d0('0x1b')][_0xe8d0('0x1c')](_0x12ebf4[_0xe8d0('0x1d')],{'raw':_0x12ebf4[_0xe8d0('0x1e')]?_0x12ebf4[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![]})[_0xe8d0('0x11')](function(_0x28a6b5){logger[_0xe8d0('0x12')]('CreateFaxMessage',_0x12ebf4);logger[_0xe8d0('0x20')](_0xe8d0('0x1a'),_0x12ebf4,JSON['stringify'](_0x28a6b5));_0x5ce284(_0x28a6b5);})[_0xe8d0('0x19')](function(_0x2e69d1){logger[_0xe8d0('0x16')](_0xe8d0('0x1a'),_0x2e69d1[_0xe8d0('0x17')],_0x12ebf4);_0x554402(_0x524b00[_0xe8d0('0x16')](0x1f4,_0x2e69d1[_0xe8d0('0x17')]));});});};exports[_0xe8d0('0x21')]=function(_0xfa3527){var _0x2dee67=this;return new Promise(function(_0x264de4,_0x539548){return db[_0xe8d0('0x1b')][_0xe8d0('0x22')](_0xfa3527[_0xe8d0('0x1d')],{'raw':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x23')]||null:null,'attributes':_0xfa3527[_0xe8d0('0x1e')]?_0xfa3527[_0xe8d0('0x1e')][_0xe8d0('0x24')]||null:null,'limit':_0xfa3527['options']?_0xfa3527[_0xe8d0('0x1e')]['limit']||null:null})['then'](function(_0x50ad3c){logger[_0xe8d0('0x12')](_0xe8d0('0x21'),_0xfa3527);logger[_0xe8d0('0x20')]('UpdateFaxMessage',_0xfa3527,JSON['stringify'](_0x50ad3c));_0x264de4(_0x50ad3c);})[_0xe8d0('0x19')](function(_0x551999){logger[_0xe8d0('0x16')](_0xe8d0('0x21'),_0x551999[_0xe8d0('0x17')],_0xfa3527);_0x539548(_0x2dee67[_0xe8d0('0x16')](0x1f4,_0x551999[_0xe8d0('0x17')]));});});}; \ No newline at end of file +var _0x9c44=['code','message','info','catch','FaxMessage','create','body','options','CreateFaxMessage','stringify','UpdateFaxMessage','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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});config[_0x49c4('0x9')]=_[_0x49c4('0xa')](config[_0x49c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0xb'))(new Redis(config[_0x49c4('0x9')]));require(_0x49c4('0xc'))[_0x49c4('0xd')](socket);function respondWithRpcPromise(_0x4c7d3a,_0x5ab4a3,_0x451ea6){return new BPromise(function(_0x313e73,_0x58cad7){return client[_0x49c4('0xe')](_0x4c7d3a,_0x451ea6)[_0x49c4('0xf')](function(_0x4adb3c){logger['info'](_0x49c4('0x10'),_0x5ab4a3,_0x49c4('0x11'));logger['debug'](_0x49c4('0x12'),_0x5ab4a3,_0x49c4('0x11'),JSON['stringify'](_0x4adb3c));if(_0x4adb3c[_0x49c4('0x13')]){if(_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x14')]===0x1f4){logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x58cad7(_0x4adb3c[_0x49c4('0x13')]['message']);}logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x313e73(_0x4adb3c[_0x49c4('0x13')]['message']);}else{logger[_0x49c4('0x16')](_0x49c4('0x10'),_0x5ab4a3,'request\x20sent');_0x313e73(_0x4adb3c['result'][_0x49c4('0x15')]);}})[_0x49c4('0x17')](function(_0x3addb2){logger['error'](_0x49c4('0x10'),_0x5ab4a3,_0x3addb2);_0x58cad7(_0x3addb2);});});}exports['CreateFaxMessage']=function(_0x2cbd50){var _0x1806c2=this;return new Promise(function(_0xe31fcc,_0x291526){return db[_0x49c4('0x18')][_0x49c4('0x19')](_0x2cbd50[_0x49c4('0x1a')],{'raw':_0x2cbd50[_0x49c4('0x1b')]?_0x2cbd50[_0x49c4('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57f502){logger[_0x49c4('0x16')]('CreateFaxMessage',_0x2cbd50);logger['debug'](_0x49c4('0x1c'),_0x2cbd50,JSON[_0x49c4('0x1d')](_0x57f502));_0xe31fcc(_0x57f502);})[_0x49c4('0x17')](function(_0xd335e4){logger['error']('CreateFaxMessage',_0xd335e4[_0x49c4('0x15')],_0x2cbd50);_0x291526(_0x1806c2[_0x49c4('0x13')](0x1f4,_0xd335e4['message']));});});};exports[_0x49c4('0x1e')]=function(_0x43e014){var _0x210159=this;return new Promise(function(_0xa7a826,_0x531d92){return db['FaxMessage'][_0x49c4('0x1f')](_0x43e014['body'],{'raw':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e014[_0x49c4('0x1b')]?_0x43e014['options'][_0x49c4('0x21')]||null:null,'attributes':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x22')]||null:null,'limit':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x23')]||null:null})[_0x49c4('0xf')](function(_0x17b50f){logger[_0x49c4('0x16')](_0x49c4('0x1e'),_0x43e014);logger['debug']('UpdateFaxMessage',_0x43e014,JSON['stringify'](_0x17b50f));_0xa7a826(_0x17b50f);})[_0x49c4('0x17')](function(_0x7ee704){logger[_0x49c4('0x13')](_0x49c4('0x1e'),_0x7ee704[_0x49c4('0x15')],_0x43e014);_0x531d92(_0x210159['error'](0x1f4,_0x7ee704[_0x49c4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 6efb4b9..22defc2 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 _0x0313=['length','./faxMessage.events','update','emit'];(function(_0x4c97d8,_0x3baab4){var _0xf4e6e=function(_0x12ac40){while(--_0x12ac40){_0x4c97d8['push'](_0x4c97d8['shift']());}};_0xf4e6e(++_0x3baab4);}(_0x0313,0x1ad));var _0x3031=function(_0x54c0b6,_0xb7f0e8){_0x54c0b6=_0x54c0b6-0x0;var _0x497fbb=_0x0313[_0x54c0b6];return _0x497fbb;};'use strict';var FaxMessageEvents=require(_0x3031('0x0'));var events=['save','remove',_0x3031('0x1')];function createListener(_0x546c7a,_0x496de7){return function(_0x18e8ee){_0x496de7[_0x3031('0x2')](_0x546c7a,_0x18e8ee);};}function removeListener(_0x115f46,_0x56937c){return function(){FaxMessageEvents['removeListener'](_0x115f46,_0x56937c);};}exports['register']=function(_0x1e7a26){for(var _0x23750b=0x0,_0x1a826d=events[_0x3031('0x3')];_0x23750b<_0x1a826d;_0x23750b++){var _0x35e1d6=events[_0x23750b];var _0x2fd0c8=createListener('faxMessage:'+_0x35e1d6,_0x1e7a26);FaxMessageEvents['on'](_0x35e1d6,_0x2fd0c8);}}; \ No newline at end of file +var _0xb469=['remove','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x21c622,_0x124272){var _0x4fed92=function(_0x2dfe00){while(--_0x2dfe00){_0x21c622['push'](_0x21c622['shift']());}};_0x4fed92(++_0x124272);}(_0xb469,0x156));var _0x9b46=function(_0x1ef46e,_0x461abe){_0x1ef46e=_0x1ef46e-0x0;var _0x2114f2=_0xb469[_0x1ef46e];return _0x2114f2;};'use strict';var FaxMessageEvents=require(_0x9b46('0x0'));var events=[_0x9b46('0x1'),_0x9b46('0x2'),'update'];function createListener(_0x25e966,_0x2210c8){return function(_0x5d9bc1){_0x2210c8[_0x9b46('0x3')](_0x25e966,_0x5d9bc1);};}function removeListener(_0x111d17,_0x3d6b8c){return function(){FaxMessageEvents[_0x9b46('0x4')](_0x111d17,_0x3d6b8c);};}exports[_0x9b46('0x5')]=function(_0x52304f){for(var _0x25d2d2=0x0,_0x5cfb98=events[_0x9b46('0x6')];_0x25d2d2<_0x5cfb98;_0x25d2d2++){var _0x2648c5=events[_0x25d2d2];var _0x1d0078=createListener(_0x9b46('0x7')+_0x2648c5,_0x52304f);FaxMessageEvents['on'](_0x2648c5,_0x1d0078);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index aa4b061..b37e324 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 _0x2e54=['download','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x2e54,0x1dd));var _0x42e5=function(_0x5f145d,_0x511bcc){_0x5f145d=_0x5f145d-0x0;var _0x1aa85b=_0x2e54[_0x5f145d];return _0x1aa85b;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./faxMessage.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),interaction['tracked'](_0x42e5('0x12'),_0x42e5('0x13')),controller['create']);router[_0x42e5('0x14')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x15')]);router[_0x42e5('0x14')](_0x42e5('0x16'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x17')]);router[_0x42e5('0x14')](_0x42e5('0x18'),auth['isAuthenticated'](),controller[_0x42e5('0x19')]);router[_0x42e5('0x1a')](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x1b')]);module[_0x42e5('0x1c')]=router; \ No newline at end of file +var _0x9aea=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','fax','faxmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express'];(function(_0xb34d1e,_0x243fb7){var _0x4e59c0=function(_0x4e9594){while(--_0x4e9594){_0xb34d1e['push'](_0xb34d1e['shift']());}};_0x4e59c0(++_0x243fb7);}(_0x9aea,0xdd));var _0xa9ae=function(_0x2d581e,_0x85488c){_0x2d581e=_0x2d581e-0x0;var _0x5abadd=_0x9aea[_0x2d581e];return _0x5abadd;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa9ae('0x4'));var interaction=require(_0xa9ae('0x5'));var config=require(_0xa9ae('0x6'));var controller=require(_0xa9ae('0x7'));router[_0xa9ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9ae('0x9')]);router[_0xa9ae('0x8')](_0xa9ae('0xa'),auth['isAuthenticated'](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0x8')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0xe')]);router[_0xa9ae('0x8')](_0xa9ae('0xf'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x10')]);router['post']('/',auth[_0xa9ae('0xd')](),interaction['tracked'](_0xa9ae('0x11'),_0xa9ae('0x12')),controller[_0xa9ae('0x13')]);router[_0xa9ae('0x14')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x15')]);router[_0xa9ae('0x14')]('/:id/accept',auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x16')]);router[_0xa9ae('0x14')](_0xa9ae('0x17'),auth['isAuthenticated'](),controller[_0xa9ae('0x18')]);router[_0xa9ae('0x19')](_0xa9ae('0xc'),auth[_0xa9ae('0xd')](),controller[_0xa9ae('0x1a')]);module[_0xa9ae('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 70f2098..11645bf 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 _0x6dc9=['name','ENUM','beepall','roundrobin','INTEGER','exports','STRING'];(function(_0x2ae0fc,_0x29a650){var _0xb1e543=function(_0x41cf0a){while(--_0x41cf0a){_0x2ae0fc['push'](_0x2ae0fc['shift']());}};_0xb1e543(++_0x29a650);}(_0x6dc9,0x140));var _0x96dc=function(_0x109dbd,_0x290d2b){_0x109dbd=_0x109dbd-0x0;var _0x395644=_0x6dc9[_0x109dbd];return _0x395644;};'use strict';var Sequelize=require('sequelize');module[_0x96dc('0x0')]={'name':{'type':Sequelize[_0x96dc('0x1')],'unique':_0x96dc('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x96dc('0x3')]('rrmemory',_0x96dc('0x4'),_0x96dc('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x96dc('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x175c=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x10c0d4,_0x42d65b){var _0x3606f3=function(_0x5ac655){while(--_0x5ac655){_0x10c0d4['push'](_0x10c0d4['shift']());}};_0x3606f3(++_0x42d65b);}(_0x175c,0x120));var _0xc175=function(_0x500327,_0x44eefa){_0x500327=_0x500327-0x0;var _0x409e36=_0x175c[_0x500327];return _0x409e36;};'use strict';var Sequelize=require(_0xc175('0x0'));module[_0xc175('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc175('0x2')]},'timeout':{'type':Sequelize[_0xc175('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc175('0x4')](_0xc175('0x5'),_0xc175('0x6'),_0xc175('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc175('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 1e8f344..f530e8f 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 _0xf5e7=['params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','length','FaxQueueId','User','agent','faxPause','updatedAt','createdAt','rows','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserFaxQueue','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeTeams','removeAgents','addAgents','spread','userFaxQueue:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','then','destroy','get','FaxQueues','error','stack','name','send','map','FaxQueue','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','show'];(function(_0x191fb4,_0x2f7dc7){var _0x1474bb=function(_0x50d02e){while(--_0x50d02e){_0x191fb4['push'](_0x191fb4['shift']());}};_0x1474bb(++_0x2f7dc7);}(_0xf5e7,0x158));var _0x7f5e=function(_0x429003,_0x3508da){_0x429003=_0x429003-0x0;var _0x3cc0d9=_0xf5e7[_0x429003];return _0x3cc0d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f5e('0x0'));var jsonpatch=require(_0x7f5e('0x1'));var rp=require(_0x7f5e('0x2'));var moment=require(_0x7f5e('0x3'));var BPromise=require(_0x7f5e('0x4'));var Mustache=require(_0x7f5e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7f5e('0x6'));var csv=require(_0x7f5e('0x7'));var ejs=require(_0x7f5e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f5e('0x9'));var squel=require(_0x7f5e('0xa'));var crypto=require(_0x7f5e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f5e('0x7'));var querystring=require(_0x7f5e('0xc'));var Papa=require(_0x7f5e('0xd'));var Redis=require('ioredis');var authService=require(_0x7f5e('0xe'));var qs=require(_0x7f5e('0xf'));var as=require(_0x7f5e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7f5e('0x11'));var utils=require(_0x7f5e('0x12'));var config=require(_0x7f5e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f5e('0x14'))['db'];config[_0x7f5e('0x15')]=_[_0x7f5e('0x16')](config[_0x7f5e('0x15')],{'host':_0x7f5e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f5e('0x15')]));require(_0x7f5e('0x18'))[_0x7f5e('0x19')](socket);function respondWithStatusCode(_0x3c61c1,_0x11057d){_0x11057d=_0x11057d||0xcc;return function(_0x2fa598){if(_0x2fa598){return _0x3c61c1[_0x7f5e('0x1a')](_0x11057d);}return _0x3c61c1[_0x7f5e('0x1b')](_0x11057d)[_0x7f5e('0x1c')]();};}function respondWithResult(_0xad2e87,_0x50cd13){_0x50cd13=_0x50cd13||0xc8;return function(_0x3bea64){if(_0x3bea64){return _0xad2e87['status'](_0x50cd13)[_0x7f5e('0x1d')](_0x3bea64);}};}function respondWithFilteredResult(_0x17962f,_0x401f7e){return function(_0x10903f){if(_0x10903f){var _0x1fdc78=typeof _0x401f7e['offset']==='undefined'&&typeof _0x401f7e[_0x7f5e('0x1e')]===_0x7f5e('0x1f');var _0x341f83=_0x10903f[_0x7f5e('0x20')];var _0x474fe6=_0x1fdc78?0x0:_0x401f7e['offset'];var _0x22bba7=_0x1fdc78?_0x10903f[_0x7f5e('0x20')]:_0x401f7e['offset']+_0x401f7e[_0x7f5e('0x1e')];var _0xafe14a;if(_0x22bba7>=_0x341f83){_0x22bba7=_0x341f83;_0xafe14a=0xc8;}else{_0xafe14a=0xce;}_0x17962f['status'](_0xafe14a);return _0x17962f[_0x7f5e('0x21')]('Content-Range',_0x474fe6+'-'+_0x22bba7+'/'+_0x341f83)[_0x7f5e('0x1d')](_0x10903f);}return null;};}function patchUpdates(_0x5567b1){return function(_0x2073bf){try{jsonpatch[_0x7f5e('0x22')](_0x2073bf,_0x5567b1,!![]);}catch(_0x20251b){return BPromise[_0x7f5e('0x23')](_0x20251b);}return _0x2073bf['save']();};}function saveUpdates(_0x1c13d7,_0x5b8921){return function(_0x540bcc){if(_0x540bcc){return _0x540bcc['update'](_0x1c13d7)[_0x7f5e('0x24')](function(_0x28d984){return _0x28d984;});}return null;};}function removeEntity(_0x209e87,_0x8dec63){return function(_0x2f7730){if(_0x2f7730){return _0x2f7730[_0x7f5e('0x25')]()['then'](function(){var _0x3da507=_0x2f7730[_0x7f5e('0x26')]({'plain':!![]});var _0x3cb390=_0x7f5e('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cb390,'resourceId':_0x3da507['id']}})[_0x7f5e('0x24')](function(){return _0x2f7730;});})[_0x7f5e('0x24')](function(){_0x209e87['status'](0xcc)[_0x7f5e('0x1c')]();});}};}function handleEntityNotFound(_0x510c14,_0x58ed7e){return function(_0x207906){if(!_0x207906){_0x510c14['sendStatus'](0x194);}return _0x207906;};}function handleError(_0x444d58,_0x4347d0){_0x4347d0=_0x4347d0||0x1f4;return function(_0x358b66){logger[_0x7f5e('0x28')](_0x358b66[_0x7f5e('0x29')]);if(_0x358b66['name']){delete _0x358b66[_0x7f5e('0x2a')];}_0x444d58[_0x7f5e('0x1b')](_0x4347d0)[_0x7f5e('0x2b')](_0x358b66);};}exports['index']=function(_0x566509,_0x13a8c5){var _0xd67bda={},_0x44b980={},_0x40f585={'count':0x0,'rows':[]};var _0x18a2c6=_[_0x7f5e('0x2c')](db[_0x7f5e('0x2d')]['rawAttributes'],function(_0x13b9cf){return{'name':_0x13b9cf[_0x7f5e('0x2e')],'type':_0x13b9cf['type'][_0x7f5e('0x2f')]};});_0x44b980[_0x7f5e('0x30')]=_[_0x7f5e('0x2c')](_0x18a2c6,'name');_0x44b980[_0x7f5e('0x31')]=_['keys'](_0x566509[_0x7f5e('0x31')]);_0x44b980[_0x7f5e('0x32')]=_[_0x7f5e('0x33')](_0x44b980[_0x7f5e('0x30')],_0x44b980['query']);_0xd67bda[_0x7f5e('0x34')]=_[_0x7f5e('0x33')](_0x44b980[_0x7f5e('0x30')],qs[_0x7f5e('0x35')](_0x566509[_0x7f5e('0x31')][_0x7f5e('0x35')]));_0xd67bda[_0x7f5e('0x34')]=_0xd67bda[_0x7f5e('0x34')]['length']?_0xd67bda[_0x7f5e('0x34')]:_0x44b980[_0x7f5e('0x30')];if(!_0x566509[_0x7f5e('0x31')][_0x7f5e('0x36')](_0x7f5e('0x37'))){_0xd67bda[_0x7f5e('0x1e')]=qs['limit'](_0x566509['query'][_0x7f5e('0x1e')]);_0xd67bda[_0x7f5e('0x38')]=qs[_0x7f5e('0x38')](_0x566509[_0x7f5e('0x31')][_0x7f5e('0x38')]);}_0xd67bda[_0x7f5e('0x39')]=qs[_0x7f5e('0x3a')](_0x566509[_0x7f5e('0x31')][_0x7f5e('0x3a')]);_0xd67bda['where']=qs[_0x7f5e('0x32')](_[_0x7f5e('0x3b')](_0x566509['query'],_0x44b980[_0x7f5e('0x32')]),_0x18a2c6);if(_0x566509[_0x7f5e('0x31')]['filter']){_0xd67bda['where']=_[_0x7f5e('0x3c')](_0xd67bda[_0x7f5e('0x3d')],{'$or':_[_0x7f5e('0x2c')](_0x18a2c6,function(_0x10f77f){if(_0x10f77f[_0x7f5e('0x3e')]!==_0x7f5e('0x3f')){var _0x314aea={};_0x314aea[_0x10f77f[_0x7f5e('0x2a')]]={'$like':'%'+_0x566509[_0x7f5e('0x31')][_0x7f5e('0x40')]+'%'};return _0x314aea;}})});}_0xd67bda=_['merge']({},_0xd67bda,_0x566509[_0x7f5e('0x41')]);var _0x55b7f2={'where':_0xd67bda[_0x7f5e('0x3d')]};return db[_0x7f5e('0x2d')][_0x7f5e('0x20')](_0x55b7f2)['then'](function(_0x15f8bb){_0x40f585['count']=_0x15f8bb;if(_0x566509[_0x7f5e('0x31')][_0x7f5e('0x42')]){_0xd67bda[_0x7f5e('0x43')]=[{'all':!![]}];}return db['FaxQueue'][_0x7f5e('0x44')](_0xd67bda);})[_0x7f5e('0x24')](function(_0x210b53){_0x40f585['rows']=_0x210b53;return _0x40f585;})[_0x7f5e('0x24')](respondWithFilteredResult(_0x13a8c5,_0xd67bda))['catch'](handleError(_0x13a8c5,null));};exports[_0x7f5e('0x45')]=function(_0x562d3c,_0x1ebdf7){var _0x287685={'raw':!![],'where':{'id':_0x562d3c[_0x7f5e('0x46')]['id']}},_0x356c78={};_0x356c78['model']=_[_0x7f5e('0x47')](db['FaxQueue'][_0x7f5e('0x48')]);_0x356c78[_0x7f5e('0x31')]=_['keys'](_0x562d3c[_0x7f5e('0x31')]);_0x356c78['filters']=_['intersection'](_0x356c78[_0x7f5e('0x30')],_0x356c78[_0x7f5e('0x31')]);_0x287685[_0x7f5e('0x34')]=_['intersection'](_0x356c78[_0x7f5e('0x30')],qs['fields'](_0x562d3c[_0x7f5e('0x31')][_0x7f5e('0x35')]));_0x287685['attributes']=_0x287685[_0x7f5e('0x34')]['length']?_0x287685[_0x7f5e('0x34')]:_0x356c78['model'];if(_0x562d3c[_0x7f5e('0x31')]['includeAll']){_0x287685[_0x7f5e('0x43')]=[{'all':!![]}];}_0x287685=_[_0x7f5e('0x3c')]({},_0x287685,_0x562d3c[_0x7f5e('0x41')]);return db[_0x7f5e('0x2d')][_0x7f5e('0x49')](_0x287685)['then'](handleEntityNotFound(_0x1ebdf7,null))['then'](respondWithResult(_0x1ebdf7,null))['catch'](handleError(_0x1ebdf7,null));};exports[_0x7f5e('0x4a')]=function(_0x589577,_0x49dc39){return db[_0x7f5e('0x2d')][_0x7f5e('0x4a')](_0x589577[_0x7f5e('0x4b')],{})[_0x7f5e('0x24')](function(_0x212c1b){var _0x4aa3da=_0x589577[_0x7f5e('0x4c')][_0x7f5e('0x26')]({'plain':!![]});if(!_0x4aa3da)throw new Error(_0x7f5e('0x4d'));if(_0x4aa3da[_0x7f5e('0x4e')]===_0x7f5e('0x4c')){var _0x15d82c=_0x212c1b[_0x7f5e('0x26')]({'plain':!![]});var _0x2f8c7a='FaxQueues';return db[_0x7f5e('0x4f')][_0x7f5e('0x49')]({'where':{'name':_0x2f8c7a,'userProfileId':_0x4aa3da[_0x7f5e('0x50')]},'raw':!![]})[_0x7f5e('0x24')](function(_0x5d5f0e){if(_0x5d5f0e&&_0x5d5f0e['autoAssociation']===0x0){return db[_0x7f5e('0x51')][_0x7f5e('0x4a')]({'name':_0x15d82c[_0x7f5e('0x2a')],'resourceId':_0x15d82c['id'],'type':_0x5d5f0e[_0x7f5e('0x2a')],'sectionId':_0x5d5f0e['id']},{})[_0x7f5e('0x24')](function(){return _0x212c1b;});}else{return _0x212c1b;}})[_0x7f5e('0x52')](function(_0xc9d328){logger[_0x7f5e('0x28')](_0x7f5e('0x53'),_0xc9d328);throw _0xc9d328;});}return _0x212c1b;})[_0x7f5e('0x24')](respondWithResult(_0x49dc39,0xc9))[_0x7f5e('0x52')](handleError(_0x49dc39,null));};exports[_0x7f5e('0x54')]=function(_0x2a09ba,_0x3c4261){if(_0x2a09ba['body']['id']){delete _0x2a09ba[_0x7f5e('0x4b')]['id'];}return db[_0x7f5e('0x2d')][_0x7f5e('0x49')]({'where':{'id':_0x2a09ba[_0x7f5e('0x46')]['id']}})[_0x7f5e('0x24')](handleEntityNotFound(_0x3c4261,null))[_0x7f5e('0x24')](saveUpdates(_0x2a09ba['body'],null))[_0x7f5e('0x24')](respondWithResult(_0x3c4261,null))[_0x7f5e('0x52')](handleError(_0x3c4261,null));};exports['destroy']=function(_0x29ed17,_0x266e1e){return db[_0x7f5e('0x2d')]['find']({'where':{'id':_0x29ed17['params']['id']}})[_0x7f5e('0x24')](handleEntityNotFound(_0x266e1e,null))[_0x7f5e('0x24')](removeEntity(_0x266e1e,null))[_0x7f5e('0x52')](handleError(_0x266e1e,null));};exports['describe']=function(_0x660a98,_0x185853){return db[_0x7f5e('0x2d')][_0x7f5e('0x55')]()[_0x7f5e('0x24')](respondWithResult(_0x185853,null))[_0x7f5e('0x52')](handleError(_0x185853,null));};exports[_0x7f5e('0x56')]=function(_0x3298e2,_0x914807,_0xd6621){var _0x422e47={'raw':!![],'where':{}},_0x3e568c={},_0x13fafc;return db[_0x7f5e('0x2d')]['findOne']({'where':{'id':_0x3298e2[_0x7f5e('0x46')]['id']}})[_0x7f5e('0x24')](handleEntityNotFound(_0x914807,null))[_0x7f5e('0x24')](function(_0x287843){if(_0x287843){_0x13fafc=_0x287843[_0x7f5e('0x26')]({'plain':!![]});_0x3e568c['model']=_[_0x7f5e('0x47')](db['UserFaxQueue'][_0x7f5e('0x48')]);_0x3e568c['query']=_[_0x7f5e('0x47')](_0x3298e2[_0x7f5e('0x31')]);_0x3e568c[_0x7f5e('0x32')]=_[_0x7f5e('0x33')](_0x3e568c['model'],_0x3e568c[_0x7f5e('0x31')]);_0x422e47[_0x7f5e('0x34')]=_['intersection'](_0x3e568c[_0x7f5e('0x30')],qs[_0x7f5e('0x35')](_0x3298e2[_0x7f5e('0x31')][_0x7f5e('0x35')]));_0x422e47[_0x7f5e('0x34')]=_0x422e47[_0x7f5e('0x34')][_0x7f5e('0x57')]?_0x422e47[_0x7f5e('0x34')]:_0x3e568c[_0x7f5e('0x30')];if(!_0x3298e2['query'][_0x7f5e('0x36')](_0x7f5e('0x37'))){_0x422e47[_0x7f5e('0x1e')]=qs[_0x7f5e('0x1e')](_0x3298e2[_0x7f5e('0x31')][_0x7f5e('0x1e')]);_0x422e47[_0x7f5e('0x38')]=qs[_0x7f5e('0x38')](_0x3298e2['query'][_0x7f5e('0x38')]);}_0x422e47[_0x7f5e('0x39')]=qs[_0x7f5e('0x3a')](_0x3298e2[_0x7f5e('0x31')][_0x7f5e('0x3a')]);_0x422e47[_0x7f5e('0x3d')]=qs[_0x7f5e('0x32')](_[_0x7f5e('0x3b')](_0x3298e2[_0x7f5e('0x31')],_0x3e568c['filters']));_0x422e47[_0x7f5e('0x3d')][_0x7f5e('0x58')]=_0x287843['id'];if(_0x3298e2[_0x7f5e('0x31')]['filter']){_0x422e47[_0x7f5e('0x3d')]=_['merge'](_0x422e47[_0x7f5e('0x3d')],{'$or':_[_0x7f5e('0x2c')](_0x422e47[_0x7f5e('0x34')],function(_0x3e60a5){var _0x39aa57={};_0x39aa57[_0x3e60a5]={'$like':'%'+_0x3298e2['query'][_0x7f5e('0x40')]+'%'};return _0x39aa57;})});}_0x422e47=_[_0x7f5e('0x3c')]({},_0x422e47,_0x3298e2[_0x7f5e('0x41')]);return db['UserFaxQueue'][_0x7f5e('0x44')](_0x422e47);}})[_0x7f5e('0x24')](function(_0x4fc096){if(_0x4fc096){return db[_0x7f5e('0x59')]['findAndCountAll']({'where':{'id':_[_0x7f5e('0x2c')](_0x4fc096,'UserId'),'role':_0x7f5e('0x5a')},'attributes':['id',_0x7f5e('0x2a'),_0x7f5e('0x5b'),_0x7f5e('0x5c'),_0x7f5e('0x5d')]});}})[_0x7f5e('0x24')](function(_0x348c56){if(_0x348c56){return{'count':_0x348c56[_0x7f5e('0x20')],'rows':_[_0x7f5e('0x2c')](_0x348c56[_0x7f5e('0x5e')],function(_0x5ea85f){return{'membername':_0x5ea85f[_0x7f5e('0x2a')],'UserId':_0x5ea85f['id'],'queue_name':_0x13fafc['name'],'FaxQueueId':_0x13fafc['id'],'interface':util[_0x7f5e('0x5f')]('%s/%s',_0x7f5e('0x60'),_0x5ea85f[_0x7f5e('0x2a')]),'penalty':0x0,'paused':_0x5ea85f['faxPause'],'createdAt':_0x5ea85f[_0x7f5e('0x5d')],'updatedAt':_0x5ea85f[_0x7f5e('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7f5e('0x24')](respondWithFilteredResult(_0x914807,_0x422e47))['catch'](handleError(_0x914807,null));};exports[_0x7f5e('0x61')]=function(_0x4254ca,_0xe62002,_0x2de8ab){var _0x32bfb0={};var _0x2f1c7e={};var _0x239806;var _0xd49a3e;return db[_0x7f5e('0x2d')][_0x7f5e('0x62')]({'where':{'id':_0x4254ca[_0x7f5e('0x46')]['id']}})['then'](handleEntityNotFound(_0xe62002,null))['then'](function(_0x12ed84){if(_0x12ed84){_0x239806=_0x12ed84;_0x2f1c7e['model']=_[_0x7f5e('0x47')](db[_0x7f5e('0x63')]['rawAttributes']);_0x2f1c7e[_0x7f5e('0x31')]=_[_0x7f5e('0x47')](_0x4254ca[_0x7f5e('0x31')]);_0x2f1c7e['filters']=_['intersection'](_0x2f1c7e[_0x7f5e('0x30')],_0x2f1c7e['query']);_0x32bfb0['attributes']=_[_0x7f5e('0x33')](_0x2f1c7e['model'],qs[_0x7f5e('0x35')](_0x4254ca['query']['fields']));_0x32bfb0['attributes']=_0x32bfb0[_0x7f5e('0x34')][_0x7f5e('0x57')]?_0x32bfb0[_0x7f5e('0x34')]:_0x2f1c7e['model'];_0x32bfb0[_0x7f5e('0x39')]=qs[_0x7f5e('0x3a')](_0x4254ca[_0x7f5e('0x31')][_0x7f5e('0x3a')]);_0x32bfb0[_0x7f5e('0x3d')]=qs['filters'](_[_0x7f5e('0x3b')](_0x4254ca[_0x7f5e('0x31')],_0x2f1c7e['filters']));if(_0x4254ca[_0x7f5e('0x31')][_0x7f5e('0x40')]){_0x32bfb0[_0x7f5e('0x3d')]=_[_0x7f5e('0x3c')](_0x32bfb0['where'],{'$or':_['map'](_0x32bfb0[_0x7f5e('0x34')],function(_0x4a7028){var _0x471284={};_0x471284[_0x4a7028]={'$like':'%'+_0x4254ca[_0x7f5e('0x31')][_0x7f5e('0x40')]+'%'};return _0x471284;})});}_0x32bfb0=_[_0x7f5e('0x3c')]({},_0x32bfb0,_0x4254ca[_0x7f5e('0x41')]);return _0x239806[_0x7f5e('0x61')](_0x32bfb0);}})[_0x7f5e('0x24')](function(_0x520659){if(_0x520659){_0xd49a3e=_0x520659[_0x7f5e('0x57')];if(!_0x4254ca['query']['hasOwnProperty'](_0x7f5e('0x37'))){_0x32bfb0['limit']=qs[_0x7f5e('0x1e')](_0x4254ca['query'][_0x7f5e('0x1e')]);_0x32bfb0[_0x7f5e('0x38')]=qs[_0x7f5e('0x38')](_0x4254ca[_0x7f5e('0x31')][_0x7f5e('0x38')]);}return _0x239806[_0x7f5e('0x61')](_0x32bfb0);}})[_0x7f5e('0x24')](function(_0x414ffe){if(_0x414ffe){return _0x414ffe?{'count':_0xd49a3e,'rows':_0x414ffe}:null;}})[_0x7f5e('0x24')](respondWithResult(_0xe62002,null))[_0x7f5e('0x52')](handleError(_0xe62002,null));};exports[_0x7f5e('0x64')]=function(_0x31601e,_0x8afd2d,_0x3421e3){var _0x399ead=_0x31601e[_0x7f5e('0x4b')][_0x7f5e('0x65')];return db['Team'][_0x7f5e('0x44')]({'where':{'id':_0x399ead},'attributes':['id'],'include':[{'model':db[_0x7f5e('0x59')],'as':_0x7f5e('0x66'),'attributes':['id',_0x7f5e('0x2a'),_0x7f5e('0x67'),_0x7f5e('0x68'),_0x7f5e('0x69')],'raw':!![]}]})[_0x7f5e('0x24')](function(_0x4e6b4b){if(_0x4e6b4b){var _0x319bd1=_[_0x7f5e('0x6a')](_0x4e6b4b,function(_0x4290d5){var _0x4bb676=_0x4290d5[_0x7f5e('0x26')]({'plain':!![]});return _0x4bb676[_0x7f5e('0x66')];});return db[_0x7f5e('0x2d')]['find']({'where':{'id':_0x31601e['params']['id']}})['then'](function(_0x44a221){return db[_0x7f5e('0x6b')][_0x7f5e('0x6c')](function(_0x376677){return _0x44a221[_0x7f5e('0x64')](_0x399ead,{'transaction':_0x376677})['then'](function(){return BPromise[_0x7f5e('0x6d')](_0x319bd1,function(_0x56030c){return db[_0x7f5e('0x6e')]['findOrCreate']({'where':{'UserId':_0x56030c['id'],'FaxQueueId':_0x31601e[_0x7f5e('0x46')]['id']},'transaction':_0x376677});});})[_0x7f5e('0x24')](function(){_0x319bd1[_0x7f5e('0x6f')](function(_0x459103){socket[_0x7f5e('0x70')](_0x7f5e('0x71'),{'UserId':_0x459103['id'],'FaxQueueId':_0x44a221['id']});});});});});}})[_0x7f5e('0x24')](respondWithStatusCode(_0x8afd2d,null))[_0x7f5e('0x52')](handleError(_0x8afd2d,null));};exports['removeTeams']=function(_0x3b0ea3,_0x11808a,_0x604aa){return db[_0x7f5e('0x63')][_0x7f5e('0x44')]({'where':{'id':_0x3b0ea3[_0x7f5e('0x31')][_0x7f5e('0x65')]},'attributes':['id'],'include':[{'model':db[_0x7f5e('0x59')],'as':_0x7f5e('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x11808a,null))[_0x7f5e('0x24')](function(_0x299bf2){var _0x149986=_[_0x7f5e('0x2c')](_0x299bf2,'id');var _0x252d66=[];var _0x42b697=[];var _0x1d2b42=squel[_0x7f5e('0x72')]();_0x1d2b42[_0x7f5e('0x73')](_0x7f5e('0x74'))['from'](_0x7f5e('0x75'),'tq')[_0x7f5e('0x76')](_0x7f5e('0x77'),'ut',_0x7f5e('0x78'))['where'](_0x7f5e('0x79'),_0x3b0ea3['params']['id']);for(var _0x421232=0x0;_0x421232<_0x299bf2[_0x7f5e('0x57')];_0x421232+=0x1){let _0x4926b0=_0x299bf2[_0x421232];for(var _0x5dbce3=0x0;_0x5dbce3<_0x4926b0[_0x7f5e('0x66')]['length'];_0x5dbce3+=0x1){let _0x3a33bd=_0x4926b0[_0x7f5e('0x66')][_0x5dbce3];var _0x3667dd=_0x1d2b42[_0x7f5e('0x7a')]();_0x3667dd[_0x7f5e('0x3d')]('ut.UserId\x20=\x20?',_0x3a33bd['id']);_0x42b697[_0x7f5e('0x7b')](db[_0x7f5e('0x6b')][_0x7f5e('0x31')](_0x3667dd[_0x7f5e('0x7c')](),{'type':db[_0x7f5e('0x6b')][_0x7f5e('0x7d')]['SELECT']})[_0x7f5e('0x24')](function(_0x136ca3){if(_0x136ca3[_0x7f5e('0x57')]===0x1){return _0x3a33bd['id'];}else{var _0x39fa44=_[_0x7f5e('0x7e')](_['map'](_0x136ca3,_0x7f5e('0x7f')),function(_0xd7b446){return _[_0x7f5e('0x80')](_0x149986,_0xd7b446);});if(_0x39fa44){return _0x3a33bd['id'];}}}));}}return BPromise[_0x7f5e('0x81')](_0x42b697)[_0x7f5e('0x24')](function(_0x44ee31){_0x252d66=_(_0x252d66)['union'](_0x44ee31)[_0x7f5e('0x82')]()[_0x7f5e('0x83')]();return db[_0x7f5e('0x2d')][_0x7f5e('0x49')]({'where':{'id':_0x3b0ea3[_0x7f5e('0x46')]['id']}})[_0x7f5e('0x24')](function(_0x235e3e){return db['sequelize'][_0x7f5e('0x6c')](function(_0x13c36b){return _0x235e3e[_0x7f5e('0x84')](_0x3b0ea3['query'][_0x7f5e('0x65')],{'transaction':_0x13c36b})[_0x7f5e('0x24')](function(){if(!_['isEmpty'](_0x252d66)){return _0x235e3e[_0x7f5e('0x85')](_0x252d66,{'transaction':_0x13c36b});}})['then'](function(){_0x252d66['forEach'](function(_0x5abbeb){socket[_0x7f5e('0x70')]('userFaxQueue:remove',{'UserId':_0x5abbeb,'FaxQueueId':_0x235e3e['id']});});});});});});})[_0x7f5e('0x24')](respondWithStatusCode(_0x11808a,null))['catch'](handleError(_0x11808a,null));};exports[_0x7f5e('0x86')]=function(_0x53a861,_0x84db4e,_0x324967){return db[_0x7f5e('0x2d')][_0x7f5e('0x49')]({'where':{'id':_0x53a861[_0x7f5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x84db4e,null))[_0x7f5e('0x24')](function(_0x15ef13){if(_0x15ef13){return _0x15ef13[_0x7f5e('0x86')](_0x53a861[_0x7f5e('0x4b')][_0x7f5e('0x65')],_['omit'](_0x53a861[_0x7f5e('0x4b')],[_0x7f5e('0x65'),'id'])||{})[_0x7f5e('0x87')](function(_0x42f06c){for(var _0x2643b9=0x0;_0x2643b9<_0x53a861[_0x7f5e('0x4b')]['ids'][_0x7f5e('0x57')];_0x2643b9+=0x1){socket['emit'](_0x7f5e('0x71'),{'UserId':Number(_0x53a861[_0x7f5e('0x4b')]['ids'][_0x2643b9]),'FaxQueueId':Number(_0x53a861['params']['id'])});}return _0x42f06c;});}})[_0x7f5e('0x24')](respondWithResult(_0x84db4e,null))[_0x7f5e('0x52')](handleError(_0x84db4e,null));};exports[_0x7f5e('0x85')]=function(_0x463d2e,_0x46b859,_0x6ac5d4){return db[_0x7f5e('0x2d')][_0x7f5e('0x49')]({'where':{'id':_0x463d2e[_0x7f5e('0x46')]['id']}})[_0x7f5e('0x24')](handleEntityNotFound(_0x46b859,null))[_0x7f5e('0x24')](function(_0x426a21){if(_0x426a21){return _0x426a21[_0x7f5e('0x85')](_0x463d2e[_0x7f5e('0x31')][_0x7f5e('0x65')])['then'](function(){if(_['isArray'](_0x463d2e[_0x7f5e('0x31')]['ids'])){for(var _0x1c9964=0x0;_0x1c9964<_0x463d2e[_0x7f5e('0x31')]['ids'][_0x7f5e('0x57')];_0x1c9964+=0x1){socket['emit'](_0x7f5e('0x88'),{'UserId':Number(_0x463d2e[_0x7f5e('0x31')]['ids'][_0x1c9964]),'FaxQueueId':Number(_0x463d2e['params']['id'])});}}else{socket[_0x7f5e('0x70')](_0x7f5e('0x88'),{'UserId':Number(_0x463d2e[_0x7f5e('0x31')][_0x7f5e('0x65')]),'FaxQueueId':Number(_0x463d2e['params']['id'])});}});}})[_0x7f5e('0x24')](respondWithStatusCode(_0x46b859,null))['catch'](handleError(_0x46b859,null));};exports[_0x7f5e('0x89')]=function(_0x26d33b,_0x307887,_0x4f07e8){var _0x1765b8={};var _0xa08f8={};var _0xe86649;var _0x394886;return db[_0x7f5e('0x2d')][_0x7f5e('0x62')]({'where':{'id':_0x26d33b[_0x7f5e('0x46')]['id']}})[_0x7f5e('0x24')](handleEntityNotFound(_0x307887,null))[_0x7f5e('0x24')](function(_0x249789){if(_0x249789){_0xe86649=_0x249789;_0xa08f8['model']=_['keys'](db[_0x7f5e('0x59')][_0x7f5e('0x48')]);_0xa08f8[_0x7f5e('0x31')]=_['keys'](_0x26d33b[_0x7f5e('0x31')]);_0xa08f8[_0x7f5e('0x32')]=_[_0x7f5e('0x33')](_0xa08f8['model'],_0xa08f8[_0x7f5e('0x31')]);_0x1765b8[_0x7f5e('0x34')]=_[_0x7f5e('0x33')](_0xa08f8[_0x7f5e('0x30')],qs[_0x7f5e('0x35')](_0x26d33b[_0x7f5e('0x31')][_0x7f5e('0x35')]));_0x1765b8[_0x7f5e('0x34')]=_0x1765b8[_0x7f5e('0x34')][_0x7f5e('0x57')]?_0x1765b8[_0x7f5e('0x34')]:_0xa08f8[_0x7f5e('0x30')];_0x1765b8['order']=qs[_0x7f5e('0x3a')](_0x26d33b[_0x7f5e('0x31')]['sort']);_0x1765b8[_0x7f5e('0x3d')]=qs['filters'](_[_0x7f5e('0x3b')](_0x26d33b[_0x7f5e('0x31')],_0xa08f8[_0x7f5e('0x32')]));if(_0x26d33b[_0x7f5e('0x31')][_0x7f5e('0x40')]){_0x1765b8[_0x7f5e('0x3d')]=_[_0x7f5e('0x3c')](_0x1765b8['where'],{'$or':_[_0x7f5e('0x2c')](_0x1765b8[_0x7f5e('0x34')],function(_0x1e1378){var _0x44f78a={};_0x44f78a[_0x1e1378]={'$like':'%'+_0x26d33b[_0x7f5e('0x31')][_0x7f5e('0x40')]+'%'};return _0x44f78a;})});}_0x1765b8=_['merge']({},_0x1765b8,_0x26d33b['options']);return _0xe86649[_0x7f5e('0x89')](_0x1765b8);}})[_0x7f5e('0x24')](function(_0x460c5d){if(_0x460c5d){_0x394886=_0x460c5d[_0x7f5e('0x57')];if(!_0x26d33b[_0x7f5e('0x31')][_0x7f5e('0x36')](_0x7f5e('0x37'))){_0x1765b8[_0x7f5e('0x1e')]=qs[_0x7f5e('0x1e')](_0x26d33b[_0x7f5e('0x31')]['limit']);_0x1765b8[_0x7f5e('0x38')]=qs['offset'](_0x26d33b['query']['offset']);}return _0xe86649[_0x7f5e('0x89')](_0x1765b8);}})[_0x7f5e('0x24')](function(_0x12238f){if(_0x12238f){return _0x12238f?{'count':_0x394886,'rows':_0x12238f}:null;}})[_0x7f5e('0x24')](respondWithResult(_0x307887,null))[_0x7f5e('0x52')](handleError(_0x307887,null));}; \ No newline at end of file +var _0x50fb=['name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','update','then','destroy','get','FaxQueues','end','error','stack'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x50fb,0x64));var _0xb50f=function(_0x5baa77,_0x1dc1e6){_0x5baa77=_0x5baa77-0x0;var _0x444b78=_0x50fb[_0x5baa77];return _0x444b78;};'use strict';var emlformat=require(_0xb50f('0x0'));var rimraf=require(_0xb50f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb50f('0x2'));var moment=require('moment');var BPromise=require(_0xb50f('0x3'));var Mustache=require(_0xb50f('0x4'));var util=require(_0xb50f('0x5'));var path=require(_0xb50f('0x6'));var sox=require('sox');var csv=require(_0xb50f('0x7'));var ejs=require(_0xb50f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb50f('0x9'));var squel=require(_0xb50f('0xa'));var crypto=require(_0xb50f('0xb'));var jsforce=require(_0xb50f('0xc'));var deskjs=require(_0xb50f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb50f('0xe'));var Papa=require(_0xb50f('0xf'));var Redis=require(_0xb50f('0x10'));var authService=require(_0xb50f('0x11'));var qs=require(_0xb50f('0x12'));var as=require(_0xb50f('0x13'));var hardwareService=require(_0xb50f('0x14'));var logger=require(_0xb50f('0x15'))('api');var utils=require(_0xb50f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb50f('0x17'));var db=require(_0xb50f('0x18'))['db'];config['redis']=_[_0xb50f('0x19')](config[_0xb50f('0x1a')],{'host':_0xb50f('0x1b'),'port':0x18eb});var socket=require(_0xb50f('0x1c'))(new Redis(config['redis']));require(_0xb50f('0x1d'))[_0xb50f('0x1e')](socket);function respondWithStatusCode(_0x113f1c,_0xc15b18){_0xc15b18=_0xc15b18||0xcc;return function(_0x571008){if(_0x571008){return _0x113f1c[_0xb50f('0x1f')](_0xc15b18);}return _0x113f1c['status'](_0xc15b18)['end']();};}function respondWithResult(_0x522462,_0x55a034){_0x55a034=_0x55a034||0xc8;return function(_0x20a32a){if(_0x20a32a){return _0x522462['status'](_0x55a034)[_0xb50f('0x20')](_0x20a32a);}};}function respondWithFilteredResult(_0x4d8216,_0x33b60b){return function(_0x2f232d){if(_0x2f232d){var _0x35e327=typeof _0x33b60b[_0xb50f('0x21')]===_0xb50f('0x22')&&typeof _0x33b60b['limit']===_0xb50f('0x22');var _0x334fbf=_0x2f232d[_0xb50f('0x23')];var _0x349741=_0x35e327?0x0:_0x33b60b[_0xb50f('0x21')];var _0x5aa342=_0x35e327?_0x2f232d[_0xb50f('0x23')]:_0x33b60b[_0xb50f('0x21')]+_0x33b60b[_0xb50f('0x24')];var _0x448e01;if(_0x5aa342>=_0x334fbf){_0x5aa342=_0x334fbf;_0x448e01=0xc8;}else{_0x448e01=0xce;}_0x4d8216[_0xb50f('0x25')](_0x448e01);return _0x4d8216[_0xb50f('0x26')](_0xb50f('0x27'),_0x349741+'-'+_0x5aa342+'/'+_0x334fbf)['json'](_0x2f232d);}return null;};}function patchUpdates(_0x15b26c){return function(_0xab717f){try{jsonpatch[_0xb50f('0x28')](_0xab717f,_0x15b26c,!![]);}catch(_0x411279){return BPromise['reject'](_0x411279);}return _0xab717f['save']();};}function saveUpdates(_0x59434c,_0x1d9bf4){return function(_0x4f517c){if(_0x4f517c){return _0x4f517c[_0xb50f('0x29')](_0x59434c)[_0xb50f('0x2a')](function(_0x175196){return _0x175196;});}return null;};}function removeEntity(_0x10b294,_0x59b156){return function(_0xe0dca5){if(_0xe0dca5){return _0xe0dca5[_0xb50f('0x2b')]()[_0xb50f('0x2a')](function(){var _0x1c2ffa=_0xe0dca5[_0xb50f('0x2c')]({'plain':!![]});var _0x222bc1=_0xb50f('0x2d');return db['UserProfileResource'][_0xb50f('0x2b')]({'where':{'type':_0x222bc1,'resourceId':_0x1c2ffa['id']}})[_0xb50f('0x2a')](function(){return _0xe0dca5;});})['then'](function(){_0x10b294[_0xb50f('0x25')](0xcc)[_0xb50f('0x2e')]();});}};}function handleEntityNotFound(_0x53c7c7,_0x1cf12a){return function(_0x3580b5){if(!_0x3580b5){_0x53c7c7['sendStatus'](0x194);}return _0x3580b5;};}function handleError(_0x2b7b2d,_0x59991d){_0x59991d=_0x59991d||0x1f4;return function(_0x2578c5){logger[_0xb50f('0x2f')](_0x2578c5[_0xb50f('0x30')]);if(_0x2578c5[_0xb50f('0x31')]){delete _0x2578c5[_0xb50f('0x31')];}_0x2b7b2d[_0xb50f('0x25')](_0x59991d)[_0xb50f('0x32')](_0x2578c5);};}exports[_0xb50f('0x33')]=function(_0x1b22be,_0xcb0d3c){var _0x275e30={},_0x5e3fc3={},_0x3ded44={'count':0x0,'rows':[]};var _0x106590=_['map'](db[_0xb50f('0x34')][_0xb50f('0x35')],function(_0x3000c1){return{'name':_0x3000c1[_0xb50f('0x36')],'type':_0x3000c1[_0xb50f('0x37')][_0xb50f('0x38')]};});_0x5e3fc3[_0xb50f('0x39')]=_[_0xb50f('0x3a')](_0x106590,_0xb50f('0x31'));_0x5e3fc3[_0xb50f('0x3b')]=_[_0xb50f('0x3c')](_0x1b22be[_0xb50f('0x3b')]);_0x5e3fc3[_0xb50f('0x3d')]=_[_0xb50f('0x3e')](_0x5e3fc3[_0xb50f('0x39')],_0x5e3fc3['query']);_0x275e30['attributes']=_[_0xb50f('0x3e')](_0x5e3fc3['model'],qs[_0xb50f('0x3f')](_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x3f')]));_0x275e30['attributes']=_0x275e30[_0xb50f('0x40')][_0xb50f('0x41')]?_0x275e30[_0xb50f('0x40')]:_0x5e3fc3['model'];if(!_0x1b22be[_0xb50f('0x3b')]['hasOwnProperty'](_0xb50f('0x42'))){_0x275e30[_0xb50f('0x24')]=qs[_0xb50f('0x24')](_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x24')]);_0x275e30[_0xb50f('0x21')]=qs['offset'](_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x21')]);}_0x275e30[_0xb50f('0x43')]=qs[_0xb50f('0x44')](_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x44')]);_0x275e30['where']=qs[_0xb50f('0x3d')](_[_0xb50f('0x45')](_0x1b22be['query'],_0x5e3fc3[_0xb50f('0x3d')]),_0x106590);if(_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x46')]){_0x275e30['where']=_[_0xb50f('0x47')](_0x275e30[_0xb50f('0x48')],{'$or':_[_0xb50f('0x3a')](_0x106590,function(_0x54a22e){if(_0x54a22e[_0xb50f('0x37')]!==_0xb50f('0x49')){var _0x5624e2={};_0x5624e2[_0x54a22e['name']]={'$like':'%'+_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x46')]+'%'};return _0x5624e2;}})});}_0x275e30=_[_0xb50f('0x47')]({},_0x275e30,_0x1b22be[_0xb50f('0x4a')]);var _0x22c8c7={'where':_0x275e30[_0xb50f('0x48')]};return db[_0xb50f('0x34')]['count'](_0x22c8c7)[_0xb50f('0x2a')](function(_0x5e3a76){_0x3ded44[_0xb50f('0x23')]=_0x5e3a76;if(_0x1b22be[_0xb50f('0x3b')][_0xb50f('0x4b')]){_0x275e30[_0xb50f('0x4c')]=[{'all':!![]}];}return db[_0xb50f('0x34')]['findAll'](_0x275e30);})['then'](function(_0x2d0df2){_0x3ded44['rows']=_0x2d0df2;return _0x3ded44;})[_0xb50f('0x2a')](respondWithFilteredResult(_0xcb0d3c,_0x275e30))['catch'](handleError(_0xcb0d3c,null));};exports[_0xb50f('0x4d')]=function(_0xa695e0,_0x26dffd){var _0x45d724={'raw':!![],'where':{'id':_0xa695e0[_0xb50f('0x4e')]['id']}},_0x477dcb={};_0x477dcb[_0xb50f('0x39')]=_[_0xb50f('0x3c')](db[_0xb50f('0x34')][_0xb50f('0x35')]);_0x477dcb['query']=_['keys'](_0xa695e0[_0xb50f('0x3b')]);_0x477dcb['filters']=_['intersection'](_0x477dcb[_0xb50f('0x39')],_0x477dcb[_0xb50f('0x3b')]);_0x45d724[_0xb50f('0x40')]=_[_0xb50f('0x3e')](_0x477dcb['model'],qs['fields'](_0xa695e0['query'][_0xb50f('0x3f')]));_0x45d724[_0xb50f('0x40')]=_0x45d724[_0xb50f('0x40')][_0xb50f('0x41')]?_0x45d724[_0xb50f('0x40')]:_0x477dcb[_0xb50f('0x39')];if(_0xa695e0[_0xb50f('0x3b')][_0xb50f('0x4b')]){_0x45d724[_0xb50f('0x4c')]=[{'all':!![]}];}_0x45d724=_[_0xb50f('0x47')]({},_0x45d724,_0xa695e0[_0xb50f('0x4a')]);return db[_0xb50f('0x34')][_0xb50f('0x4f')](_0x45d724)[_0xb50f('0x2a')](handleEntityNotFound(_0x26dffd,null))[_0xb50f('0x2a')](respondWithResult(_0x26dffd,null))[_0xb50f('0x50')](handleError(_0x26dffd,null));};exports[_0xb50f('0x51')]=function(_0x267f1a,_0x215287){return db[_0xb50f('0x34')][_0xb50f('0x51')](_0x267f1a['body'],{})['then'](function(_0x2cea20){var _0x1def26=_0x267f1a[_0xb50f('0x52')]['get']({'plain':!![]});if(!_0x1def26)throw new Error(_0xb50f('0x53'));if(_0x1def26[_0xb50f('0x54')]===_0xb50f('0x52')){var _0x1548c8=_0x2cea20[_0xb50f('0x2c')]({'plain':!![]});var _0x2dbbef=_0xb50f('0x2d');return db[_0xb50f('0x55')][_0xb50f('0x4f')]({'where':{'name':_0x2dbbef,'userProfileId':_0x1def26[_0xb50f('0x56')]},'raw':!![]})[_0xb50f('0x2a')](function(_0x277f76){if(_0x277f76&&_0x277f76[_0xb50f('0x57')]===0x0){return db[_0xb50f('0x58')][_0xb50f('0x51')]({'name':_0x1548c8[_0xb50f('0x31')],'resourceId':_0x1548c8['id'],'type':_0x277f76[_0xb50f('0x31')],'sectionId':_0x277f76['id']},{})[_0xb50f('0x2a')](function(){return _0x2cea20;});}else{return _0x2cea20;}})[_0xb50f('0x50')](function(_0x3eaf5a){logger['error'](_0xb50f('0x59'),_0x3eaf5a);throw _0x3eaf5a;});}return _0x2cea20;})[_0xb50f('0x2a')](respondWithResult(_0x215287,0xc9))[_0xb50f('0x50')](handleError(_0x215287,null));};exports[_0xb50f('0x29')]=function(_0x5b3741,_0xf48830){if(_0x5b3741[_0xb50f('0x5a')]['id']){delete _0x5b3741[_0xb50f('0x5a')]['id'];}return db['FaxQueue'][_0xb50f('0x4f')]({'where':{'id':_0x5b3741['params']['id']}})[_0xb50f('0x2a')](handleEntityNotFound(_0xf48830,null))[_0xb50f('0x2a')](saveUpdates(_0x5b3741[_0xb50f('0x5a')],null))[_0xb50f('0x2a')](respondWithResult(_0xf48830,null))[_0xb50f('0x50')](handleError(_0xf48830,null));};exports[_0xb50f('0x2b')]=function(_0x497e76,_0x4b2e2c){return db[_0xb50f('0x34')]['find']({'where':{'id':_0x497e76[_0xb50f('0x4e')]['id']}})[_0xb50f('0x2a')](handleEntityNotFound(_0x4b2e2c,null))['then'](removeEntity(_0x4b2e2c,null))[_0xb50f('0x50')](handleError(_0x4b2e2c,null));};exports['describe']=function(_0x2ec6bf,_0x3d2b80){return db[_0xb50f('0x34')][_0xb50f('0x5b')]()[_0xb50f('0x2a')](respondWithResult(_0x3d2b80,null))[_0xb50f('0x50')](handleError(_0x3d2b80,null));};exports[_0xb50f('0x5c')]=function(_0x371fcf,_0x14db28,_0x411994){var _0x176d47={'raw':!![],'where':{}},_0x105c0a={},_0x21dabd;return db['FaxQueue'][_0xb50f('0x5d')]({'where':{'id':_0x371fcf[_0xb50f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x14db28,null))[_0xb50f('0x2a')](function(_0x90b3ec){if(_0x90b3ec){_0x21dabd=_0x90b3ec[_0xb50f('0x2c')]({'plain':!![]});_0x105c0a[_0xb50f('0x39')]=_[_0xb50f('0x3c')](db[_0xb50f('0x5e')][_0xb50f('0x35')]);_0x105c0a[_0xb50f('0x3b')]=_[_0xb50f('0x3c')](_0x371fcf[_0xb50f('0x3b')]);_0x105c0a[_0xb50f('0x3d')]=_[_0xb50f('0x3e')](_0x105c0a[_0xb50f('0x39')],_0x105c0a[_0xb50f('0x3b')]);_0x176d47[_0xb50f('0x40')]=_[_0xb50f('0x3e')](_0x105c0a[_0xb50f('0x39')],qs[_0xb50f('0x3f')](_0x371fcf[_0xb50f('0x3b')]['fields']));_0x176d47['attributes']=_0x176d47[_0xb50f('0x40')][_0xb50f('0x41')]?_0x176d47[_0xb50f('0x40')]:_0x105c0a['model'];if(!_0x371fcf[_0xb50f('0x3b')][_0xb50f('0x5f')](_0xb50f('0x42'))){_0x176d47[_0xb50f('0x24')]=qs[_0xb50f('0x24')](_0x371fcf[_0xb50f('0x3b')][_0xb50f('0x24')]);_0x176d47[_0xb50f('0x21')]=qs[_0xb50f('0x21')](_0x371fcf[_0xb50f('0x3b')]['offset']);}_0x176d47['order']=qs[_0xb50f('0x44')](_0x371fcf[_0xb50f('0x3b')][_0xb50f('0x44')]);_0x176d47[_0xb50f('0x48')]=qs[_0xb50f('0x3d')](_[_0xb50f('0x45')](_0x371fcf['query'],_0x105c0a[_0xb50f('0x3d')]));_0x176d47[_0xb50f('0x48')][_0xb50f('0x60')]=_0x90b3ec['id'];if(_0x371fcf['query'][_0xb50f('0x46')]){_0x176d47[_0xb50f('0x48')]=_[_0xb50f('0x47')](_0x176d47[_0xb50f('0x48')],{'$or':_['map'](_0x176d47[_0xb50f('0x40')],function(_0x1de1b9){var _0x592b97={};_0x592b97[_0x1de1b9]={'$like':'%'+_0x371fcf['query'][_0xb50f('0x46')]+'%'};return _0x592b97;})});}_0x176d47=_['merge']({},_0x176d47,_0x371fcf[_0xb50f('0x4a')]);return db['UserFaxQueue'][_0xb50f('0x61')](_0x176d47);}})['then'](function(_0x25ca88){if(_0x25ca88){return db[_0xb50f('0x62')][_0xb50f('0x63')]({'where':{'id':_[_0xb50f('0x3a')](_0x25ca88,_0xb50f('0x64')),'role':_0xb50f('0x65')},'attributes':['id',_0xb50f('0x31'),_0xb50f('0x66'),_0xb50f('0x67'),_0xb50f('0x68')]});}})['then'](function(_0x3b36d1){if(_0x3b36d1){return{'count':_0x3b36d1[_0xb50f('0x23')],'rows':_[_0xb50f('0x3a')](_0x3b36d1[_0xb50f('0x69')],function(_0x1ebd1f){return{'membername':_0x1ebd1f[_0xb50f('0x31')],'UserId':_0x1ebd1f['id'],'queue_name':_0x21dabd['name'],'FaxQueueId':_0x21dabd['id'],'interface':util[_0xb50f('0x6a')](_0xb50f('0x6b'),_0xb50f('0x6c'),_0x1ebd1f['name']),'penalty':0x0,'paused':_0x1ebd1f[_0xb50f('0x66')],'createdAt':_0x1ebd1f['createdAt'],'updatedAt':_0x1ebd1f[_0xb50f('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x14db28,_0x176d47))[_0xb50f('0x50')](handleError(_0x14db28,null));};exports[_0xb50f('0x6d')]=function(_0x3fb50a,_0x40d6c7,_0x26c8f0){var _0xdfdf17={};var _0x3ccff9={};var _0x4acbf2;var _0x1a3570;return db[_0xb50f('0x34')][_0xb50f('0x5d')]({'where':{'id':_0x3fb50a['params']['id']}})[_0xb50f('0x2a')](handleEntityNotFound(_0x40d6c7,null))[_0xb50f('0x2a')](function(_0x15c414){if(_0x15c414){_0x4acbf2=_0x15c414;_0x3ccff9[_0xb50f('0x39')]=_['keys'](db[_0xb50f('0x6e')][_0xb50f('0x35')]);_0x3ccff9[_0xb50f('0x3b')]=_['keys'](_0x3fb50a[_0xb50f('0x3b')]);_0x3ccff9[_0xb50f('0x3d')]=_['intersection'](_0x3ccff9['model'],_0x3ccff9[_0xb50f('0x3b')]);_0xdfdf17[_0xb50f('0x40')]=_[_0xb50f('0x3e')](_0x3ccff9[_0xb50f('0x39')],qs[_0xb50f('0x3f')](_0x3fb50a[_0xb50f('0x3b')][_0xb50f('0x3f')]));_0xdfdf17[_0xb50f('0x40')]=_0xdfdf17['attributes']['length']?_0xdfdf17['attributes']:_0x3ccff9[_0xb50f('0x39')];_0xdfdf17[_0xb50f('0x43')]=qs[_0xb50f('0x44')](_0x3fb50a[_0xb50f('0x3b')][_0xb50f('0x44')]);_0xdfdf17[_0xb50f('0x48')]=qs[_0xb50f('0x3d')](_['pick'](_0x3fb50a[_0xb50f('0x3b')],_0x3ccff9['filters']));if(_0x3fb50a[_0xb50f('0x3b')][_0xb50f('0x46')]){_0xdfdf17['where']=_[_0xb50f('0x47')](_0xdfdf17[_0xb50f('0x48')],{'$or':_['map'](_0xdfdf17['attributes'],function(_0x1c2328){var _0x2a2634={};_0x2a2634[_0x1c2328]={'$like':'%'+_0x3fb50a[_0xb50f('0x3b')]['filter']+'%'};return _0x2a2634;})});}_0xdfdf17=_[_0xb50f('0x47')]({},_0xdfdf17,_0x3fb50a[_0xb50f('0x4a')]);return _0x4acbf2[_0xb50f('0x6d')](_0xdfdf17);}})[_0xb50f('0x2a')](function(_0x202628){if(_0x202628){_0x1a3570=_0x202628[_0xb50f('0x41')];if(!_0x3fb50a[_0xb50f('0x3b')][_0xb50f('0x5f')](_0xb50f('0x42'))){_0xdfdf17[_0xb50f('0x24')]=qs['limit'](_0x3fb50a[_0xb50f('0x3b')]['limit']);_0xdfdf17[_0xb50f('0x21')]=qs['offset'](_0x3fb50a[_0xb50f('0x3b')][_0xb50f('0x21')]);}return _0x4acbf2[_0xb50f('0x6d')](_0xdfdf17);}})[_0xb50f('0x2a')](function(_0xc8ad4){if(_0xc8ad4){return _0xc8ad4?{'count':_0x1a3570,'rows':_0xc8ad4}:null;}})[_0xb50f('0x2a')](respondWithResult(_0x40d6c7,null))[_0xb50f('0x50')](handleError(_0x40d6c7,null));};exports[_0xb50f('0x6f')]=function(_0x56ce71,_0x5991a5,_0xa31260){var _0xe5d8a4=_0x56ce71['body'][_0xb50f('0x70')];return db[_0xb50f('0x6e')][_0xb50f('0x61')]({'where':{'id':_0xe5d8a4},'attributes':['id'],'include':[{'model':db[_0xb50f('0x62')],'as':'Agents','attributes':['id',_0xb50f('0x31'),_0xb50f('0x71'),_0xb50f('0x72'),'interface'],'raw':!![]}]})['then'](function(_0xf89efd){if(_0xf89efd){var _0x18380c=_['flatMap'](_0xf89efd,function(_0x3ff10c){var _0x19accc=_0x3ff10c['get']({'plain':!![]});return _0x19accc[_0xb50f('0x73')];});return db[_0xb50f('0x34')][_0xb50f('0x4f')]({'where':{'id':_0x56ce71[_0xb50f('0x4e')]['id']}})[_0xb50f('0x2a')](function(_0x167b61){return db[_0xb50f('0x74')][_0xb50f('0x75')](function(_0x36afbc){return _0x167b61['addTeams'](_0xe5d8a4,{'transaction':_0x36afbc})['then'](function(){return BPromise[_0xb50f('0x76')](_0x18380c,function(_0x390df5){return db[_0xb50f('0x5e')][_0xb50f('0x77')]({'where':{'UserId':_0x390df5['id'],'FaxQueueId':_0x56ce71['params']['id']},'transaction':_0x36afbc});});})[_0xb50f('0x2a')](function(){_0x18380c[_0xb50f('0x78')](function(_0x21a126){socket[_0xb50f('0x79')](_0xb50f('0x7a'),{'UserId':_0x21a126['id'],'FaxQueueId':_0x167b61['id']});});});});});}})[_0xb50f('0x2a')](respondWithStatusCode(_0x5991a5,null))[_0xb50f('0x50')](handleError(_0x5991a5,null));};exports['removeTeams']=function(_0xae737c,_0x4b2802,_0x187a69){return db[_0xb50f('0x6e')]['findAll']({'where':{'id':_0xae737c[_0xb50f('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb50f('0x62')],'as':_0xb50f('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb50f('0x2a')](handleEntityNotFound(_0x4b2802,null))['then'](function(_0x5c0fd8){var _0x4cb912=_[_0xb50f('0x3a')](_0x5c0fd8,'id');var _0x3cb984=[];var _0x3e477e=[];var _0x447bcf=squel[_0xb50f('0x7b')]();_0x447bcf['field'](_0xb50f('0x7c'))[_0xb50f('0x7d')](_0xb50f('0x7e'),'tq')[_0xb50f('0x7f')](_0xb50f('0x80'),'ut',_0xb50f('0x81'))[_0xb50f('0x48')](_0xb50f('0x82'),_0xae737c[_0xb50f('0x4e')]['id']);for(var _0x3a10ec=0x0;_0x3a10ec<_0x5c0fd8[_0xb50f('0x41')];_0x3a10ec+=0x1){let _0x2775be=_0x5c0fd8[_0x3a10ec];for(var _0x317c6f=0x0;_0x317c6f<_0x2775be[_0xb50f('0x73')][_0xb50f('0x41')];_0x317c6f+=0x1){let _0x5f1ed4=_0x2775be['Agents'][_0x317c6f];var _0x54019d=_0x447bcf[_0xb50f('0x83')]();_0x54019d[_0xb50f('0x48')](_0xb50f('0x84'),_0x5f1ed4['id']);_0x3e477e[_0xb50f('0x85')](db[_0xb50f('0x74')][_0xb50f('0x3b')](_0x54019d[_0xb50f('0x86')](),{'type':db[_0xb50f('0x74')][_0xb50f('0x87')]['SELECT']})['then'](function(_0x5abf84){if(_0x5abf84[_0xb50f('0x41')]===0x1){return _0x5f1ed4['id'];}else{var _0x450491=_[_0xb50f('0x88')](_['map'](_0x5abf84,'TeamId'),function(_0x459953){return _[_0xb50f('0x89')](_0x4cb912,_0x459953);});if(_0x450491){return _0x5f1ed4['id'];}}}));}}return BPromise[_0xb50f('0x8a')](_0x3e477e)[_0xb50f('0x2a')](function(_0x381a11){_0x3cb984=_(_0x3cb984)[_0xb50f('0x8b')](_0x381a11)[_0xb50f('0x8c')]()['value']();return db[_0xb50f('0x34')][_0xb50f('0x4f')]({'where':{'id':_0xae737c['params']['id']}})[_0xb50f('0x2a')](function(_0x31da60){return db[_0xb50f('0x74')][_0xb50f('0x75')](function(_0x1ab9da){return _0x31da60[_0xb50f('0x8d')](_0xae737c['query'][_0xb50f('0x70')],{'transaction':_0x1ab9da})[_0xb50f('0x2a')](function(){if(!_[_0xb50f('0x8e')](_0x3cb984)){return _0x31da60[_0xb50f('0x8f')](_0x3cb984,{'transaction':_0x1ab9da});}})['then'](function(){_0x3cb984[_0xb50f('0x78')](function(_0x1c7289){socket[_0xb50f('0x79')](_0xb50f('0x90'),{'UserId':_0x1c7289,'FaxQueueId':_0x31da60['id']});});});});});});})[_0xb50f('0x2a')](respondWithStatusCode(_0x4b2802,null))[_0xb50f('0x50')](handleError(_0x4b2802,null));};exports[_0xb50f('0x91')]=function(_0x557b16,_0xc6e718,_0x2f184a){return db[_0xb50f('0x34')][_0xb50f('0x4f')]({'where':{'id':_0x557b16[_0xb50f('0x4e')]['id']}})[_0xb50f('0x2a')](handleEntityNotFound(_0xc6e718,null))[_0xb50f('0x2a')](function(_0x2e9fda){if(_0x2e9fda){return _0x2e9fda[_0xb50f('0x91')](_0x557b16[_0xb50f('0x5a')][_0xb50f('0x70')],_['omit'](_0x557b16[_0xb50f('0x5a')],[_0xb50f('0x70'),'id'])||{})[_0xb50f('0x92')](function(_0x53bc93){for(var _0x39f092=0x0;_0x39f092<_0x557b16['body'][_0xb50f('0x70')][_0xb50f('0x41')];_0x39f092+=0x1){socket[_0xb50f('0x79')](_0xb50f('0x7a'),{'UserId':Number(_0x557b16[_0xb50f('0x5a')][_0xb50f('0x70')][_0x39f092]),'FaxQueueId':Number(_0x557b16[_0xb50f('0x4e')]['id'])});}return _0x53bc93;});}})[_0xb50f('0x2a')](respondWithResult(_0xc6e718,null))[_0xb50f('0x50')](handleError(_0xc6e718,null));};exports['removeAgents']=function(_0x548b5d,_0x3b08b1,_0x2a44bc){return db[_0xb50f('0x34')][_0xb50f('0x4f')]({'where':{'id':_0x548b5d[_0xb50f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b08b1,null))[_0xb50f('0x2a')](function(_0x49fd94){if(_0x49fd94){return _0x49fd94[_0xb50f('0x8f')](_0x548b5d[_0xb50f('0x3b')]['ids'])[_0xb50f('0x2a')](function(){if(_[_0xb50f('0x93')](_0x548b5d[_0xb50f('0x3b')]['ids'])){for(var _0x47b383=0x0;_0x47b383<_0x548b5d['query']['ids'][_0xb50f('0x41')];_0x47b383+=0x1){socket[_0xb50f('0x79')]('userFaxQueue:remove',{'UserId':Number(_0x548b5d[_0xb50f('0x3b')][_0xb50f('0x70')][_0x47b383]),'FaxQueueId':Number(_0x548b5d[_0xb50f('0x4e')]['id'])});}}else{socket[_0xb50f('0x79')](_0xb50f('0x90'),{'UserId':Number(_0x548b5d['query'][_0xb50f('0x70')]),'FaxQueueId':Number(_0x548b5d[_0xb50f('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3b08b1,null))[_0xb50f('0x50')](handleError(_0x3b08b1,null));};exports['getAgents']=function(_0x452681,_0x4ae530,_0x1481e9){var _0x7e01ec={};var _0x1433a1={};var _0x3b23d9;var _0xab2e6d;return db[_0xb50f('0x34')]['findOne']({'where':{'id':_0x452681[_0xb50f('0x4e')]['id']}})[_0xb50f('0x2a')](handleEntityNotFound(_0x4ae530,null))[_0xb50f('0x2a')](function(_0x16dc39){if(_0x16dc39){_0x3b23d9=_0x16dc39;_0x1433a1[_0xb50f('0x39')]=_[_0xb50f('0x3c')](db[_0xb50f('0x62')]['rawAttributes']);_0x1433a1[_0xb50f('0x3b')]=_['keys'](_0x452681[_0xb50f('0x3b')]);_0x1433a1['filters']=_[_0xb50f('0x3e')](_0x1433a1[_0xb50f('0x39')],_0x1433a1[_0xb50f('0x3b')]);_0x7e01ec[_0xb50f('0x40')]=_[_0xb50f('0x3e')](_0x1433a1[_0xb50f('0x39')],qs[_0xb50f('0x3f')](_0x452681[_0xb50f('0x3b')]['fields']));_0x7e01ec['attributes']=_0x7e01ec[_0xb50f('0x40')][_0xb50f('0x41')]?_0x7e01ec[_0xb50f('0x40')]:_0x1433a1[_0xb50f('0x39')];_0x7e01ec[_0xb50f('0x43')]=qs[_0xb50f('0x44')](_0x452681[_0xb50f('0x3b')][_0xb50f('0x44')]);_0x7e01ec[_0xb50f('0x48')]=qs[_0xb50f('0x3d')](_['pick'](_0x452681[_0xb50f('0x3b')],_0x1433a1['filters']));if(_0x452681[_0xb50f('0x3b')][_0xb50f('0x46')]){_0x7e01ec['where']=_[_0xb50f('0x47')](_0x7e01ec[_0xb50f('0x48')],{'$or':_[_0xb50f('0x3a')](_0x7e01ec[_0xb50f('0x40')],function(_0x49dfac){var _0x117d98={};_0x117d98[_0x49dfac]={'$like':'%'+_0x452681[_0xb50f('0x3b')]['filter']+'%'};return _0x117d98;})});}_0x7e01ec=_[_0xb50f('0x47')]({},_0x7e01ec,_0x452681[_0xb50f('0x4a')]);return _0x3b23d9[_0xb50f('0x94')](_0x7e01ec);}})[_0xb50f('0x2a')](function(_0x2a2ead){if(_0x2a2ead){_0xab2e6d=_0x2a2ead[_0xb50f('0x41')];if(!_0x452681[_0xb50f('0x3b')][_0xb50f('0x5f')](_0xb50f('0x42'))){_0x7e01ec['limit']=qs['limit'](_0x452681['query'][_0xb50f('0x24')]);_0x7e01ec['offset']=qs[_0xb50f('0x21')](_0x452681[_0xb50f('0x3b')][_0xb50f('0x21')]);}return _0x3b23d9[_0xb50f('0x94')](_0x7e01ec);}})['then'](function(_0xc2c1d2){if(_0xc2c1d2){return _0xc2c1d2?{'count':_0xab2e6d,'rows':_0xc2c1d2}:null;}})[_0xb50f('0x2a')](respondWithResult(_0x4ae530,null))[_0xb50f('0x50')](handleError(_0x4ae530,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 3899811..99aa6f0 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 _0x2349=['remove','emit','events','../../mysqldb','FaxQueue','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2349,0xb1));var _0x9234=function(_0x3e35e9,_0x343705){_0x3e35e9=_0x3e35e9-0x0;var _0x5a9829=_0x2349[_0x3e35e9];return _0x5a9829;};'use strict';var EventEmitter=require(_0x9234('0x0'));var FaxQueue=require(_0x9234('0x1'))['db'][_0x9234('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9234('0x3'),'afterUpdate':_0x9234('0x4'),'afterDestroy':_0x9234('0x5')};function emitEvent(_0x5d3195){return function(_0x23e868,_0x1eba84,_0x1d4694){FaxQueueEvents[_0x9234('0x6')](_0x5d3195+':'+_0x23e868['id'],_0x23e868);FaxQueueEvents[_0x9234('0x6')](_0x5d3195,_0x23e868);_0x1d4694(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x3945=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x27cb5b,_0x4ebda4){var _0x3847f2=function(_0x5b2274){while(--_0x5b2274){_0x27cb5b['push'](_0x27cb5b['shift']());}};_0x3847f2(++_0x4ebda4);}(_0x3945,0x1ec));var _0x5394=function(_0x38c792,_0x22a1e3){_0x38c792=_0x38c792-0x0;var _0x5e33fe=_0x3945[_0x38c792];return _0x5e33fe;};'use strict';var EventEmitter=require(_0x5394('0x0'));var FaxQueue=require(_0x5394('0x1'))['db'][_0x5394('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5394('0x3')](0x0);var events={'afterCreate':_0x5394('0x4'),'afterUpdate':_0x5394('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b3db6){return function(_0x5d4780,_0x2e63c3,_0x12b8be){FaxQueueEvents[_0x5394('0x6')](_0x5b3db6+':'+_0x5d4780['id'],_0x5d4780);FaxQueueEvents['emit'](_0x5b3db6,_0x5d4780);_0x12b8be(null);};}for(var e in events){if(events[_0x5394('0x7')](e)){var event=events[e];FaxQueue[_0x5394('0x8')](e,emitEvent(event));}}module[_0x5394('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index ff0f815..4a1cab7 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 _0xf212=['FaxQueue','fax_queues','util','api','moment','bluebird','path','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x11efe8,_0xe6ad7e){var _0x5954b8=function(_0x48bc36){while(--_0x48bc36){_0x11efe8['push'](_0x11efe8['shift']());}};_0x5954b8(++_0xe6ad7e);}(_0xf212,0xf4));var _0x2f21=function(_0x102147,_0x170d81){_0x102147=_0x102147-0x0;var _0x5e2d52=_0xf212[_0x102147];return _0x5e2d52;};'use strict';var _=require('lodash');var util=require(_0x2f21('0x0'));var logger=require('../../config/logger')(_0x2f21('0x1'));var moment=require(_0x2f21('0x2'));var BPromise=require(_0x2f21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2f21('0x4'));var rimraf=require('rimraf');var config=require(_0x2f21('0x5'));var attributes=require(_0x2f21('0x6'));module[_0x2f21('0x7')]=function(_0xa6309e,_0x40e552){return _0xa6309e[_0x2f21('0x8')](_0x2f21('0x9'),attributes,{'tableName':_0x2f21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcabb=['bluebird','request-promise','path','rimraf','exports','define','fax_queues','lodash','util','../../config/logger','api'];(function(_0x155af3,_0x4b7f9a){var _0x15a675=function(_0xec0188){while(--_0xec0188){_0x155af3['push'](_0x155af3['shift']());}};_0x15a675(++_0x4b7f9a);}(_0xcabb,0x11a));var _0xbcab=function(_0x559c4c,_0x29896a){_0x559c4c=_0x559c4c-0x0;var _0x109a5f=_0xcabb[_0x559c4c];return _0x109a5f;};'use strict';var _=require(_0xbcab('0x0'));var util=require(_0xbcab('0x1'));var logger=require(_0xbcab('0x2'))(_0xbcab('0x3'));var moment=require('moment');var BPromise=require(_0xbcab('0x4'));var rp=require(_0xbcab('0x5'));var fs=require('fs');var path=require(_0xbcab('0x6'));var rimraf=require(_0xbcab('0x7'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xbcab('0x8')]=function(_0x4f8f42,_0x3a17e8){return _0x4f8f42[_0xbcab('0x9')]('FaxQueue',attributes,{'tableName':_0xbcab('0xa'),'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 9a79612..170966c 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 _0x692a=['FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','./faxQueue.socket','register','request','then','info'];(function(_0x42e89e,_0x3cbfdd){var _0x3fc33d=function(_0x222418){while(--_0x222418){_0x42e89e['push'](_0x42e89e['shift']());}};_0x3fc33d(++_0x3cbfdd);}(_0x692a,0xbe));var _0xa692=function(_0x103a96,_0x8b7201){_0x103a96=_0x103a96-0x0;var _0x5f4b75=_0x692a[_0x103a96];return _0x5f4b75;};'use strict';var _=require(_0xa692('0x0'));var util=require(_0xa692('0x1'));var moment=require(_0xa692('0x2'));var BPromise=require(_0xa692('0x3'));var rs=require(_0xa692('0x4'));var fs=require('fs');var Redis=require(_0xa692('0x5'));var db=require(_0xa692('0x6'))['db'];var utils=require(_0xa692('0x7'));var logger=require(_0xa692('0x8'))(_0xa692('0x9'));var config=require(_0xa692('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa692('0xb')]({'port':0x232a});config['redis']=_[_0xa692('0xc')](config[_0xa692('0xd')],{'host':_0xa692('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa692('0xf'))[_0xa692('0x10')](socket);function respondWithRpcPromise(_0x816fbf,_0x1dc578,_0x47d13a){return new BPromise(function(_0x3a867f,_0x4e4f30){return client[_0xa692('0x11')](_0x816fbf,_0x47d13a)[_0xa692('0x12')](function(_0x1b01f5){logger[_0xa692('0x13')](_0xa692('0x14'),_0x1dc578,_0xa692('0x15'));logger[_0xa692('0x16')](_0xa692('0x17'),_0x1dc578,_0xa692('0x15'),JSON[_0xa692('0x18')](_0x1b01f5));if(_0x1b01f5[_0xa692('0x19')]){if(_0x1b01f5[_0xa692('0x19')][_0xa692('0x1a')]===0x1f4){logger[_0xa692('0x19')]('FaxQueue,\x20%s,\x20%s',_0x1dc578,_0x1b01f5['error']['message']);return _0x4e4f30(_0x1b01f5['error'][_0xa692('0x1b')]);}logger[_0xa692('0x19')]('FaxQueue,\x20%s,\x20%s',_0x1dc578,_0x1b01f5[_0xa692('0x19')][_0xa692('0x1b')]);return _0x3a867f(_0x1b01f5['error']['message']);}else{logger[_0xa692('0x13')](_0xa692('0x14'),_0x1dc578,_0xa692('0x15'));_0x3a867f(_0x1b01f5['result']['message']);}})[_0xa692('0x1c')](function(_0x315de7){logger[_0xa692('0x19')](_0xa692('0x14'),_0x1dc578,_0x315de7);_0x4e4f30(_0x315de7);});});}exports[_0xa692('0x1d')]=function(_0x5e45d7){var _0x1cd632=this;return new Promise(function(_0x4c148e,_0x238581){return db[_0xa692('0x1e')][_0xa692('0x1f')]({'raw':_0x5e45d7[_0xa692('0x20')]?_0x5e45d7[_0xa692('0x20')][_0xa692('0x21')]===undefined?!![]:![]:!![],'where':_0x5e45d7[_0xa692('0x20')]?_0x5e45d7[_0xa692('0x20')][_0xa692('0x22')]||null:null,'attributes':_0x5e45d7['options']?_0x5e45d7[_0xa692('0x20')][_0xa692('0x23')]||null:null,'limit':_0x5e45d7[_0xa692('0x20')]?_0x5e45d7[_0xa692('0x20')][_0xa692('0x24')]||null:null,'include':_0x5e45d7[_0xa692('0x20')]?_0x5e45d7[_0xa692('0x20')][_0xa692('0x25')]?_[_0xa692('0x26')](_0x5e45d7['options']['include'],function(_0x2cb542){return{'model':db[_0x2cb542[_0xa692('0x27')]],'as':_0x2cb542['as'],'attributes':_0x2cb542[_0xa692('0x23')],'include':_0x2cb542[_0xa692('0x25')]?_['map'](_0x2cb542[_0xa692('0x25')],function(_0x23cb53){return{'model':db[_0x23cb53[_0xa692('0x27')]],'as':_0x23cb53['as'],'attributes':_0x23cb53[_0xa692('0x23')],'include':_0x23cb53[_0xa692('0x25')]?_[_0xa692('0x26')](_0x23cb53[_0xa692('0x25')],function(_0x41a39d){return{'model':db[_0x41a39d[_0xa692('0x27')]],'as':_0x41a39d['as'],'attributes':_0x41a39d[_0xa692('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a6b15){logger[_0xa692('0x13')](_0xa692('0x1d'),_0x5e45d7);logger['debug'](_0xa692('0x1d'),_0x5e45d7,JSON[_0xa692('0x18')](_0x4a6b15));_0x4c148e(_0x4a6b15);})[_0xa692('0x1c')](function(_0x3d870f){logger[_0xa692('0x19')]('GetFaxQueue',_0x3d870f['message'],_0x5e45d7);_0x238581(_0x1cd632[_0xa692('0x19')](0x1f4,_0x3d870f[_0xa692('0x1b')]));});});};exports['ShowFaxQueue']=function(_0x3bce33){var _0x40ca4c=this;return new Promise(function(_0x8fa8dc,_0x39c771){return db[_0xa692('0x1e')][_0xa692('0x28')]({'raw':_0x3bce33[_0xa692('0x20')]?_0x3bce33[_0xa692('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x3bce33[_0xa692('0x20')]?_0x3bce33[_0xa692('0x20')][_0xa692('0x22')]||null:null,'attributes':_0x3bce33[_0xa692('0x20')]?_0x3bce33[_0xa692('0x20')][_0xa692('0x23')]||null:null,'include':_0x3bce33[_0xa692('0x20')]?_0x3bce33[_0xa692('0x20')][_0xa692('0x25')]?_[_0xa692('0x26')](_0x3bce33[_0xa692('0x20')]['include'],function(_0x3ccd58){return{'model':db[_0x3ccd58[_0xa692('0x27')]],'as':_0x3ccd58['as'],'attributes':_0x3ccd58[_0xa692('0x23')],'include':_0x3ccd58[_0xa692('0x25')]?_['map'](_0x3ccd58[_0xa692('0x25')],function(_0x1e5ba6){return{'model':db[_0x1e5ba6[_0xa692('0x27')]],'as':_0x1e5ba6['as'],'attributes':_0x1e5ba6[_0xa692('0x23')],'include':_0x1e5ba6['include']?_[_0xa692('0x26')](_0x1e5ba6[_0xa692('0x25')],function(_0x2cfdb4){return{'model':db[_0x2cfdb4['model']],'as':_0x2cfdb4['as'],'attributes':_0x2cfdb4[_0xa692('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa692('0x12')](function(_0x19bc33){logger[_0xa692('0x13')](_0xa692('0x29'),_0x3bce33);logger['debug'](_0xa692('0x29'),_0x3bce33,JSON[_0xa692('0x18')](_0x19bc33));_0x8fa8dc(_0x19bc33);})[_0xa692('0x1c')](function(_0x2a82b5){logger[_0xa692('0x19')](_0xa692('0x29'),_0x2a82b5[_0xa692('0x1b')],_0x3bce33);_0x39c771(_0x40ca4c['error'](0x1f4,_0x2a82b5['message']));});});}; \ No newline at end of file +var _0xc6f3=['then','GetFaxQueue','find','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','FaxQueue','findAll','options','raw','where','attributes','include','model','map'];(function(_0x42e2df,_0x1513dd){var _0x582d66=function(_0x184b6f){while(--_0x184b6f){_0x42e2df['push'](_0x42e2df['shift']());}};_0x582d66(++_0x1513dd);}(_0xc6f3,0x1cc));var _0x3c6f=function(_0x46ed72,_0x3d8aaa){_0x46ed72=_0x46ed72-0x0;var _0x3c960f=_0xc6f3[_0x46ed72];return _0x3c960f;};'use strict';var _=require(_0x3c6f('0x0'));var util=require(_0x3c6f('0x1'));var moment=require(_0x3c6f('0x2'));var BPromise=require(_0x3c6f('0x3'));var rs=require(_0x3c6f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3c6f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c6f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3c6f('0x7')][_0x3c6f('0x8')]({'port':0x232a});config[_0x3c6f('0x9')]=_[_0x3c6f('0xa')](config[_0x3c6f('0x9')],{'host':_0x3c6f('0xb'),'port':0x18eb});var socket=require(_0x3c6f('0xc'))(new Redis(config[_0x3c6f('0x9')]));require('./faxQueue.socket')[_0x3c6f('0xd')](socket);function respondWithRpcPromise(_0x25b1ce,_0x2bf587,_0x444f82){return new BPromise(function(_0x1d7be0,_0x3d45bb){return client[_0x3c6f('0xe')](_0x25b1ce,_0x444f82)['then'](function(_0x13f461){logger[_0x3c6f('0xf')]('FaxQueue,\x20%s,\x20%s',_0x2bf587,_0x3c6f('0x10'));logger[_0x3c6f('0x11')](_0x3c6f('0x12'),_0x2bf587,_0x3c6f('0x10'),JSON[_0x3c6f('0x13')](_0x13f461));if(_0x13f461[_0x3c6f('0x14')]){if(_0x13f461['error'][_0x3c6f('0x15')]===0x1f4){logger[_0x3c6f('0x14')](_0x3c6f('0x16'),_0x2bf587,_0x13f461[_0x3c6f('0x14')][_0x3c6f('0x17')]);return _0x3d45bb(_0x13f461[_0x3c6f('0x14')][_0x3c6f('0x17')]);}logger['error'](_0x3c6f('0x16'),_0x2bf587,_0x13f461[_0x3c6f('0x14')][_0x3c6f('0x17')]);return _0x1d7be0(_0x13f461[_0x3c6f('0x14')]['message']);}else{logger[_0x3c6f('0xf')](_0x3c6f('0x16'),_0x2bf587,_0x3c6f('0x10'));_0x1d7be0(_0x13f461['result'][_0x3c6f('0x17')]);}})[_0x3c6f('0x18')](function(_0x14b4f7){logger[_0x3c6f('0x14')]('FaxQueue,\x20%s,\x20%s',_0x2bf587,_0x14b4f7);_0x3d45bb(_0x14b4f7);});});}exports['GetFaxQueue']=function(_0x41bd09){var _0x1f500b=this;return new Promise(function(_0x595bef,_0x43dba4){return db[_0x3c6f('0x19')][_0x3c6f('0x1a')]({'raw':_0x41bd09[_0x3c6f('0x1b')]?_0x41bd09[_0x3c6f('0x1b')][_0x3c6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x41bd09[_0x3c6f('0x1b')]?_0x41bd09[_0x3c6f('0x1b')][_0x3c6f('0x1d')]||null:null,'attributes':_0x41bd09[_0x3c6f('0x1b')]?_0x41bd09['options'][_0x3c6f('0x1e')]||null:null,'limit':_0x41bd09[_0x3c6f('0x1b')]?_0x41bd09[_0x3c6f('0x1b')]['limit']||null:null,'include':_0x41bd09[_0x3c6f('0x1b')]?_0x41bd09['options'][_0x3c6f('0x1f')]?_['map'](_0x41bd09[_0x3c6f('0x1b')][_0x3c6f('0x1f')],function(_0x34c117){return{'model':db[_0x34c117[_0x3c6f('0x20')]],'as':_0x34c117['as'],'attributes':_0x34c117[_0x3c6f('0x1e')],'include':_0x34c117[_0x3c6f('0x1f')]?_[_0x3c6f('0x21')](_0x34c117[_0x3c6f('0x1f')],function(_0x48275d){return{'model':db[_0x48275d['model']],'as':_0x48275d['as'],'attributes':_0x48275d[_0x3c6f('0x1e')],'include':_0x48275d[_0x3c6f('0x1f')]?_[_0x3c6f('0x21')](_0x48275d['include'],function(_0x326737){return{'model':db[_0x326737[_0x3c6f('0x20')]],'as':_0x326737['as'],'attributes':_0x326737[_0x3c6f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3c6f('0x22')](function(_0x26e0e4){logger['info'](_0x3c6f('0x23'),_0x41bd09);logger['debug']('GetFaxQueue',_0x41bd09,JSON[_0x3c6f('0x13')](_0x26e0e4));_0x595bef(_0x26e0e4);})['catch'](function(_0x2fbab2){logger[_0x3c6f('0x14')](_0x3c6f('0x23'),_0x2fbab2[_0x3c6f('0x17')],_0x41bd09);_0x43dba4(_0x1f500b[_0x3c6f('0x14')](0x1f4,_0x2fbab2[_0x3c6f('0x17')]));});});};exports['ShowFaxQueue']=function(_0x2e193b){var _0x3e4ffa=this;return new Promise(function(_0x100999,_0x154845){return db[_0x3c6f('0x19')][_0x3c6f('0x24')]({'raw':_0x2e193b['options']?_0x2e193b['options'][_0x3c6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e193b[_0x3c6f('0x1b')]?_0x2e193b[_0x3c6f('0x1b')][_0x3c6f('0x1d')]||null:null,'attributes':_0x2e193b[_0x3c6f('0x1b')]?_0x2e193b[_0x3c6f('0x1b')][_0x3c6f('0x1e')]||null:null,'include':_0x2e193b['options']?_0x2e193b[_0x3c6f('0x1b')][_0x3c6f('0x1f')]?_['map'](_0x2e193b[_0x3c6f('0x1b')][_0x3c6f('0x1f')],function(_0x32e6f4){return{'model':db[_0x32e6f4[_0x3c6f('0x20')]],'as':_0x32e6f4['as'],'attributes':_0x32e6f4[_0x3c6f('0x1e')],'include':_0x32e6f4[_0x3c6f('0x1f')]?_[_0x3c6f('0x21')](_0x32e6f4[_0x3c6f('0x1f')],function(_0x1c877e){return{'model':db[_0x1c877e[_0x3c6f('0x20')]],'as':_0x1c877e['as'],'attributes':_0x1c877e[_0x3c6f('0x1e')],'include':_0x1c877e[_0x3c6f('0x1f')]?_[_0x3c6f('0x21')](_0x1c877e['include'],function(_0x5e8cb8){return{'model':db[_0x5e8cb8[_0x3c6f('0x20')]],'as':_0x5e8cb8['as'],'attributes':_0x5e8cb8[_0x3c6f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53f1a2){logger[_0x3c6f('0xf')](_0x3c6f('0x25'),_0x2e193b);logger[_0x3c6f('0x11')](_0x3c6f('0x25'),_0x2e193b,JSON[_0x3c6f('0x13')](_0x53f1a2));_0x100999(_0x53f1a2);})[_0x3c6f('0x18')](function(_0x24a4f7){logger[_0x3c6f('0x14')](_0x3c6f('0x25'),_0x24a4f7['message'],_0x2e193b);_0x154845(_0x3e4ffa['error'](0x1f4,_0x24a4f7[_0x3c6f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f34e407..f14068e 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 _0xa1aa=['emit','register','length','faxQueue:','./faxQueue.events','remove','update'];(function(_0x45bd25,_0x1d4b04){var _0x1c005d=function(_0x10570e){while(--_0x10570e){_0x45bd25['push'](_0x45bd25['shift']());}};_0x1c005d(++_0x1d4b04);}(_0xa1aa,0x1a1));var _0xaa1a=function(_0x5528db,_0x3c3a0b){_0x5528db=_0x5528db-0x0;var _0x39a7dc=_0xa1aa[_0x5528db];return _0x39a7dc;};'use strict';var FaxQueueEvents=require(_0xaa1a('0x0'));var events=['save',_0xaa1a('0x1'),_0xaa1a('0x2')];function createListener(_0x3d5fac,_0x4464b7){return function(_0x21be12){_0x4464b7[_0xaa1a('0x3')](_0x3d5fac,_0x21be12);};}function removeListener(_0x87273b,_0x514589){return function(){FaxQueueEvents['removeListener'](_0x87273b,_0x514589);};}exports[_0xaa1a('0x4')]=function(_0xfef7b){for(var _0x5783af=0x0,_0x2cb8b4=events[_0xaa1a('0x5')];_0x5783af<_0x2cb8b4;_0x5783af++){var _0x5ac892=events[_0x5783af];var _0x2eec6a=createListener(_0xaa1a('0x6')+_0x5ac892,_0xfef7b);FaxQueueEvents['on'](_0x5ac892,_0x2eec6a);}}; \ No newline at end of file +var _0xf513=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x1e7ead,_0x7f6227){var _0x3912b2=function(_0x1eeb03){while(--_0x1eeb03){_0x1e7ead['push'](_0x1e7ead['shift']());}};_0x3912b2(++_0x7f6227);}(_0xf513,0x181));var _0x3f51=function(_0x3b5a71,_0x581c86){_0x3b5a71=_0x3b5a71-0x0;var _0xeca5b7=_0xf513[_0x3b5a71];return _0xeca5b7;};'use strict';var FaxQueueEvents=require(_0x3f51('0x0'));var events=[_0x3f51('0x1'),_0x3f51('0x2'),_0x3f51('0x3')];function createListener(_0x74ab72,_0x3d10ec){return function(_0x51b07f){_0x3d10ec[_0x3f51('0x4')](_0x74ab72,_0x51b07f);};}function removeListener(_0x15612d,_0x3d4aea){return function(){FaxQueueEvents[_0x3f51('0x5')](_0x15612d,_0x3d4aea);};}exports[_0x3f51('0x6')]=function(_0x567b49){for(var _0xdc7974=0x0,_0x39fcac=events[_0x3f51('0x7')];_0xdc7974<_0x39fcac;_0xdc7974++){var _0x5c55c5=events[_0xdc7974];var _0x5aa0d9=createListener(_0x3f51('0x8')+_0x5c55c5,_0x567b49);FaxQueueEvents['on'](_0x5c55c5,_0x5aa0d9);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 66f25cf..c5f1e21 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 _0xed1c=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams'];(function(_0x21feab,_0xa69cb6){var _0x35be66=function(_0x4f7521){while(--_0x4f7521){_0x21feab['push'](_0x21feab['shift']());}};_0x35be66(++_0xa69cb6);}(_0xed1c,0xe4));var _0xced1=function(_0x1b4a12,_0x2be253){_0x1b4a12=_0x1b4a12-0x0;var _0x2b9694=_0xed1c[_0x1b4a12];return _0x2b9694;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0x6')]('/:id/members',auth[_0xced1('0x7')](),controller['getMembers']);router[_0xced1('0x6')](_0xced1('0xd'),auth[_0xced1('0x7')](),controller[_0xced1('0xe')]);router[_0xced1('0x6')](_0xced1('0xf'),auth[_0xced1('0x7')](),controller['getAgents']);router[_0xced1('0x10')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x11')]);router[_0xced1('0x10')]('/:id/teams',auth[_0xced1('0x7')](),controller[_0xced1('0x12')]);router['post'](_0xced1('0xf'),auth[_0xced1('0x7')](),controller[_0xced1('0x13')]);router[_0xced1('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xced1('0x15')]);router[_0xced1('0x16')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0x17')]);router[_0xced1('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xced1('0x18')]);router[_0xced1('0x16')](_0xced1('0xf'),auth['isAuthenticated'](),controller[_0xced1('0x19')]);module[_0xced1('0x1a')]=router; \ No newline at end of file +var _0x90b1=['addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0x90b1,0x1bb));var _0x190b=function(_0x36ff42,_0x33ee47){_0x36ff42=_0x36ff42-0x0;var _0x2ff9b4=_0x90b1[_0x36ff42];return _0x2ff9b4;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0x8')](_0x190b('0xe'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x8')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller['getTeams']);router[_0x190b('0x8')](_0x190b('0x11'),auth['isAuthenticated'](),controller[_0x190b('0x12')]);router[_0x190b('0x13')]('/',auth[_0x190b('0xa')](),controller[_0x190b('0x14')]);router[_0x190b('0x13')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x15')]);router[_0x190b('0x13')](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x16')]);router[_0x190b('0x17')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0x18')]);router[_0x190b('0x19')]('/:id',auth[_0x190b('0xa')](),controller['destroy']);router[_0x190b('0x19')](_0x190b('0x10'),auth[_0x190b('0xa')](),controller[_0x190b('0x1a')]);router['delete'](_0x190b('0x11'),auth[_0x190b('0xa')](),controller[_0x190b('0x1b')]);module[_0x190b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b1d2df4..f6d8f1c 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 _0x8d8a=['DATE','moment','sequelize','STRING'];(function(_0x38d382,_0x14324d){var _0x319639=function(_0x399037){while(--_0x399037){_0x38d382['push'](_0x38d382['shift']());}};_0x319639(++_0x14324d);}(_0x8d8a,0x189));var _0xa8d8=function(_0x1ac5c1,_0x5ceee4){_0x1ac5c1=_0x1ac5c1-0x0;var _0xc12500=_0x8d8a[_0x1ac5c1];return _0xc12500;};'use strict';var moment=require(_0xa8d8('0x0'));var Sequelize=require(_0xa8d8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa8d8('0x2')]},'joinAt':{'type':Sequelize[_0xa8d8('0x3')]},'leaveAt':{'type':Sequelize[_0xa8d8('0x3')]},'acceptAt':{'type':Sequelize[_0xa8d8('0x3')]},'exitAt':{'type':Sequelize[_0xa8d8('0x3')]},'reason':{'type':Sequelize[_0xa8d8('0x2')]}}; \ No newline at end of file +var _0xbead=['moment','exports','STRING','DATE'];(function(_0x3dbb28,_0x7135cd){var _0x521bcb=function(_0x449278){while(--_0x449278){_0x3dbb28['push'](_0x3dbb28['shift']());}};_0x521bcb(++_0x7135cd);}(_0xbead,0x1f4));var _0xdbea=function(_0x4702ee,_0xaf6a45){_0x4702ee=_0x4702ee-0x0;var _0x62ca7d=_0xbead[_0x4702ee];return _0x62ca7d;};'use strict';var moment=require(_0xdbea('0x0'));var Sequelize=require('sequelize');module[_0xdbea('0x1')]={'uniqueid':{'type':Sequelize[_0xdbea('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdbea('0x3')]},'leaveAt':{'type':Sequelize[_0xdbea('0x3')]},'acceptAt':{'type':Sequelize[_0xdbea('0x3')]},'exitAt':{'type':Sequelize[_0xdbea('0x3')]},'reason':{'type':Sequelize[_0xdbea('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b090bef..11ac019 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 _0x8f7d=['type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x5930e1,_0x3b23c7){_0x5930e1=_0x5930e1-0x0;var _0x34cfc9=_0x8f7d[_0x5930e1];return _0x34cfc9;};'use strict';var emlformat=require(_0xd8f7('0x0'));var rimraf=require(_0xd8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8f7('0x3'));var Mustache=require('mustache');var util=require(_0xd8f7('0x4'));var path=require(_0xd8f7('0x5'));var sox=require(_0xd8f7('0x6'));var csv=require(_0xd8f7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8f7('0x8'));var _=require(_0xd8f7('0x9'));var squel=require(_0xd8f7('0xa'));var crypto=require(_0xd8f7('0xb'));var jsforce=require(_0xd8f7('0xc'));var deskjs=require(_0xd8f7('0xd'));var toCsv=require(_0xd8f7('0x7'));var querystring=require(_0xd8f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8f7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd8f7('0x10'));var as=require(_0xd8f7('0x11'));var hardwareService=require(_0xd8f7('0x12'));var logger=require(_0xd8f7('0x13'))(_0xd8f7('0x14'));var utils=require(_0xd8f7('0x15'));var config=require(_0xd8f7('0x16'));var licenseUtil=require(_0xd8f7('0x17'));var db=require(_0xd8f7('0x18'))['db'];function respondWithStatusCode(_0x41ebd3,_0x29467b){_0x29467b=_0x29467b||0xcc;return function(_0x21ee60){if(_0x21ee60){return _0x41ebd3[_0xd8f7('0x19')](_0x29467b);}return _0x41ebd3[_0xd8f7('0x1a')](_0x29467b)[_0xd8f7('0x1b')]();};}function respondWithResult(_0x4406c7,_0x4b4114){_0x4b4114=_0x4b4114||0xc8;return function(_0x5c1177){if(_0x5c1177){return _0x4406c7['status'](_0x4b4114)[_0xd8f7('0x1c')](_0x5c1177);}};}function respondWithFilteredResult(_0x2b58c1,_0x341152){return function(_0x109488){if(_0x109488){var _0x299208=typeof _0x341152[_0xd8f7('0x1d')]===_0xd8f7('0x1e')&&typeof _0x341152[_0xd8f7('0x1f')]==='undefined';var _0x478e46=_0x109488['count'];var _0x202298=_0x299208?0x0:_0x341152[_0xd8f7('0x1d')];var _0x5d31c5=_0x299208?_0x109488[_0xd8f7('0x20')]:_0x341152[_0xd8f7('0x1d')]+_0x341152[_0xd8f7('0x1f')];var _0x48a97b;if(_0x5d31c5>=_0x478e46){_0x5d31c5=_0x478e46;_0x48a97b=0xc8;}else{_0x48a97b=0xce;}_0x2b58c1[_0xd8f7('0x1a')](_0x48a97b);return _0x2b58c1['set'](_0xd8f7('0x21'),_0x202298+'-'+_0x5d31c5+'/'+_0x478e46)[_0xd8f7('0x1c')](_0x109488);}return null;};}function patchUpdates(_0x4e0ec4){return function(_0xcbc2a5){try{jsonpatch[_0xd8f7('0x22')](_0xcbc2a5,_0x4e0ec4,!![]);}catch(_0x57bf17){return BPromise[_0xd8f7('0x23')](_0x57bf17);}return _0xcbc2a5[_0xd8f7('0x24')]();};}function saveUpdates(_0x54bc78,_0x2fc6cb){return function(_0x58469a){if(_0x58469a){return _0x58469a['update'](_0x54bc78)[_0xd8f7('0x25')](function(_0x4e1e10){return _0x4e1e10;});}return null;};}function removeEntity(_0x148d6f,_0x1bbe84){return function(_0x4d84bb){if(_0x4d84bb){return _0x4d84bb[_0xd8f7('0x26')]()[_0xd8f7('0x25')](function(){_0x148d6f[_0xd8f7('0x1a')](0xcc)[_0xd8f7('0x1b')]();});}};}function handleEntityNotFound(_0x8874d4,_0x380247){return function(_0x3ca18a){if(!_0x3ca18a){_0x8874d4[_0xd8f7('0x19')](0x194);}return _0x3ca18a;};}function handleError(_0x424b91,_0x8a8403){_0x8a8403=_0x8a8403||0x1f4;return function(_0x4ba0f){logger[_0xd8f7('0x27')](_0x4ba0f[_0xd8f7('0x28')]);if(_0x4ba0f['name']){delete _0x4ba0f['name'];}_0x424b91[_0xd8f7('0x1a')](_0x8a8403)[_0xd8f7('0x29')](_0x4ba0f);};}exports[_0xd8f7('0x2a')]=function(_0x20ef3a,_0x35ef58){var _0x101935={},_0x5d54b9={},_0x480635={'count':0x0,'rows':[]};var _0x12bf13=_[_0xd8f7('0x2b')](db[_0xd8f7('0x2c')][_0xd8f7('0x2d')],function(_0x3e2f76){return{'name':_0x3e2f76[_0xd8f7('0x2e')],'type':_0x3e2f76['type']['key']};});_0x5d54b9[_0xd8f7('0x2f')]=_['map'](_0x12bf13,_0xd8f7('0x30'));_0x5d54b9['query']=_[_0xd8f7('0x31')](_0x20ef3a[_0xd8f7('0x32')]);_0x5d54b9[_0xd8f7('0x33')]=_[_0xd8f7('0x34')](_0x5d54b9[_0xd8f7('0x2f')],_0x5d54b9[_0xd8f7('0x32')]);_0x101935['attributes']=_['intersection'](_0x5d54b9[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x20ef3a['query'][_0xd8f7('0x35')]));_0x101935[_0xd8f7('0x36')]=_0x101935[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x101935[_0xd8f7('0x36')]:_0x5d54b9[_0xd8f7('0x2f')];if(!_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x38')](_0xd8f7('0x39'))){_0x101935[_0xd8f7('0x1f')]=qs[_0xd8f7('0x1f')](_0x20ef3a['query']['limit']);_0x101935[_0xd8f7('0x1d')]=qs['offset'](_0x20ef3a['query'][_0xd8f7('0x1d')]);}_0x101935[_0xd8f7('0x3a')]=qs[_0xd8f7('0x3b')](_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3b')]);_0x101935[_0xd8f7('0x3c')]=qs['filters'](_['pick'](_0x20ef3a[_0xd8f7('0x32')],_0x5d54b9['filters']),_0x12bf13);if(_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]){_0x101935[_0xd8f7('0x3c')]=_[_0xd8f7('0x3e')](_0x101935[_0xd8f7('0x3c')],{'$or':_[_0xd8f7('0x2b')](_0x12bf13,function(_0x40a26c){if(_0x40a26c[_0xd8f7('0x3f')]!==_0xd8f7('0x40')){var _0x41c08c={};_0x41c08c[_0x40a26c[_0xd8f7('0x30')]]={'$like':'%'+_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]+'%'};return _0x41c08c;}})});}_0x101935=_['merge']({},_0x101935,_0x20ef3a[_0xd8f7('0x41')]);var _0x143e1a={'where':_0x101935[_0xd8f7('0x3c')]};return db[_0xd8f7('0x2c')][_0xd8f7('0x20')](_0x143e1a)[_0xd8f7('0x25')](function(_0x153ff0){_0x480635[_0xd8f7('0x20')]=_0x153ff0;if(_0x20ef3a['query'][_0xd8f7('0x42')]){_0x101935[_0xd8f7('0x43')]=[{'all':!![]}];}return db[_0xd8f7('0x2c')][_0xd8f7('0x44')](_0x101935);})[_0xd8f7('0x25')](function(_0x254c15){_0x480635['rows']=_0x254c15;return _0x480635;})[_0xd8f7('0x25')](respondWithFilteredResult(_0x35ef58,_0x101935))[_0xd8f7('0x45')](handleError(_0x35ef58,null));};exports[_0xd8f7('0x46')]=function(_0x51d5a2,_0x265429){var _0x244d12={'raw':!![],'where':{'id':_0x51d5a2[_0xd8f7('0x47')]['id']}},_0x5cadee={};_0x5cadee[_0xd8f7('0x2f')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x5cadee[_0xd8f7('0x32')]=_[_0xd8f7('0x31')](_0x51d5a2[_0xd8f7('0x32')]);_0x5cadee[_0xd8f7('0x33')]=_['intersection'](_0x5cadee[_0xd8f7('0x2f')],_0x5cadee[_0xd8f7('0x32')]);_0x244d12[_0xd8f7('0x36')]=_[_0xd8f7('0x34')](_0x5cadee[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x35')]));_0x244d12[_0xd8f7('0x36')]=_0x244d12[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x244d12[_0xd8f7('0x36')]:_0x5cadee[_0xd8f7('0x2f')];if(_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x42')]){_0x244d12[_0xd8f7('0x43')]=[{'all':!![]}];}_0x244d12=_['merge']({},_0x244d12,_0x51d5a2['options']);return db[_0xd8f7('0x2c')][_0xd8f7('0x48')](_0x244d12)[_0xd8f7('0x25')](handleEntityNotFound(_0x265429,null))['then'](respondWithResult(_0x265429,null))[_0xd8f7('0x45')](handleError(_0x265429,null));};exports[_0xd8f7('0x49')]=function(_0x20832d,_0x1e8343){return db['FaxQueueReport'][_0xd8f7('0x49')](_0x20832d[_0xd8f7('0x4a')],{})[_0xd8f7('0x25')](respondWithResult(_0x1e8343,0xc9))[_0xd8f7('0x45')](handleError(_0x1e8343,null));};exports[_0xd8f7('0x4b')]=function(_0x3a317c,_0x522fb2){if(_0x3a317c[_0xd8f7('0x4a')]['id']){delete _0x3a317c[_0xd8f7('0x4a')]['id'];}return db[_0xd8f7('0x2c')][_0xd8f7('0x48')]({'where':{'id':_0x3a317c[_0xd8f7('0x47')]['id']}})[_0xd8f7('0x25')](handleEntityNotFound(_0x522fb2,null))[_0xd8f7('0x25')](saveUpdates(_0x3a317c['body'],null))[_0xd8f7('0x25')](respondWithResult(_0x522fb2,null))['catch'](handleError(_0x522fb2,null));};exports[_0xd8f7('0x26')]=function(_0x2a797d,_0x19ccef){return db['FaxQueueReport']['find']({'where':{'id':_0x2a797d['params']['id']}})['then'](handleEntityNotFound(_0x19ccef,null))['then'](removeEntity(_0x19ccef,null))['catch'](handleError(_0x19ccef,null));};exports[_0xd8f7('0x4c')]=function(_0x14a307,_0x2bca2b){return db[_0xd8f7('0x2c')][_0xd8f7('0x4c')]()[_0xd8f7('0x25')](respondWithResult(_0x2bca2b,null))[_0xd8f7('0x45')](handleError(_0x2bca2b,null));}; \ No newline at end of file +var _0xb492=['squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxQueueReport','then','includeAll','include','findAll','rows','catch','params','create','update','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash'];(function(_0x175b48,_0x3d9f90){var _0x52b98b=function(_0x47537b){while(--_0x47537b){_0x175b48['push'](_0x175b48['shift']());}};_0x52b98b(++_0x3d9f90);}(_0xb492,0x172));var _0x2b49=function(_0x332564,_0x1324c6){_0x332564=_0x332564-0x0;var _0x44948=_0xb492[_0x332564];return _0x44948;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b49('0x0'));var zipdir=require(_0x2b49('0x1'));var jsonpatch=require(_0x2b49('0x2'));var rp=require(_0x2b49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2b49('0x4'));var util=require(_0x2b49('0x5'));var path=require(_0x2b49('0x6'));var sox=require(_0x2b49('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b49('0x8'));var _=require(_0x2b49('0x9'));var squel=require(_0x2b49('0xa'));var crypto=require(_0x2b49('0xb'));var jsforce=require(_0x2b49('0xc'));var deskjs=require(_0x2b49('0xd'));var toCsv=require(_0x2b49('0xe'));var querystring=require(_0x2b49('0xf'));var Papa=require('papaparse');var Redis=require(_0x2b49('0x10'));var authService=require(_0x2b49('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b49('0x12'));var hardwareService=require(_0x2b49('0x13'));var logger=require(_0x2b49('0x14'))('api');var utils=require(_0x2b49('0x15'));var config=require(_0x2b49('0x16'));var licenseUtil=require(_0x2b49('0x17'));var db=require(_0x2b49('0x18'))['db'];function respondWithStatusCode(_0x1af731,_0x1bda39){_0x1bda39=_0x1bda39||0xcc;return function(_0x5aad36){if(_0x5aad36){return _0x1af731['sendStatus'](_0x1bda39);}return _0x1af731[_0x2b49('0x19')](_0x1bda39)[_0x2b49('0x1a')]();};}function respondWithResult(_0x5e7361,_0x4dec02){_0x4dec02=_0x4dec02||0xc8;return function(_0x30eb71){if(_0x30eb71){return _0x5e7361[_0x2b49('0x19')](_0x4dec02)[_0x2b49('0x1b')](_0x30eb71);}};}function respondWithFilteredResult(_0x4d114b,_0x14fb17){return function(_0xf92e0d){if(_0xf92e0d){var _0x5ee983=typeof _0x14fb17['offset']===_0x2b49('0x1c')&&typeof _0x14fb17[_0x2b49('0x1d')]===_0x2b49('0x1c');var _0x14359f=_0xf92e0d[_0x2b49('0x1e')];var _0x248de1=_0x5ee983?0x0:_0x14fb17[_0x2b49('0x1f')];var _0x25f0d8=_0x5ee983?_0xf92e0d[_0x2b49('0x1e')]:_0x14fb17[_0x2b49('0x1f')]+_0x14fb17['limit'];var _0x37b4ae;if(_0x25f0d8>=_0x14359f){_0x25f0d8=_0x14359f;_0x37b4ae=0xc8;}else{_0x37b4ae=0xce;}_0x4d114b['status'](_0x37b4ae);return _0x4d114b[_0x2b49('0x20')](_0x2b49('0x21'),_0x248de1+'-'+_0x25f0d8+'/'+_0x14359f)[_0x2b49('0x1b')](_0xf92e0d);}return null;};}function patchUpdates(_0x389ff0){return function(_0x1e54f4){try{jsonpatch[_0x2b49('0x22')](_0x1e54f4,_0x389ff0,!![]);}catch(_0x5d33f8){return BPromise[_0x2b49('0x23')](_0x5d33f8);}return _0x1e54f4[_0x2b49('0x24')]();};}function saveUpdates(_0x38edc3,_0x5840ef){return function(_0x8e4c){if(_0x8e4c){return _0x8e4c['update'](_0x38edc3)['then'](function(_0x3107b1){return _0x3107b1;});}return null;};}function removeEntity(_0x1242bb,_0x744835){return function(_0x509164){if(_0x509164){return _0x509164[_0x2b49('0x25')]()['then'](function(){_0x1242bb[_0x2b49('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea951,_0x3fd4b6){return function(_0x26a7a5){if(!_0x26a7a5){_0x3ea951[_0x2b49('0x26')](0x194);}return _0x26a7a5;};}function handleError(_0x5530e2,_0x4300c0){_0x4300c0=_0x4300c0||0x1f4;return function(_0x191602){logger[_0x2b49('0x27')](_0x191602[_0x2b49('0x28')]);if(_0x191602[_0x2b49('0x29')]){delete _0x191602[_0x2b49('0x29')];}_0x5530e2['status'](_0x4300c0)[_0x2b49('0x2a')](_0x191602);};}exports[_0x2b49('0x2b')]=function(_0x237233,_0x461592){var _0x23138e={},_0xf27200={},_0x177e4c={'count':0x0,'rows':[]};var _0x44c80b=_[_0x2b49('0x2c')](db['FaxQueueReport'][_0x2b49('0x2d')],function(_0x65c004){return{'name':_0x65c004[_0x2b49('0x2e')],'type':_0x65c004['type']['key']};});_0xf27200['model']=_[_0x2b49('0x2c')](_0x44c80b,_0x2b49('0x29'));_0xf27200[_0x2b49('0x2f')]=_[_0x2b49('0x30')](_0x237233[_0x2b49('0x2f')]);_0xf27200[_0x2b49('0x31')]=_[_0x2b49('0x32')](_0xf27200['model'],_0xf27200[_0x2b49('0x2f')]);_0x23138e[_0x2b49('0x33')]=_[_0x2b49('0x32')](_0xf27200[_0x2b49('0x34')],qs[_0x2b49('0x35')](_0x237233[_0x2b49('0x2f')][_0x2b49('0x35')]));_0x23138e[_0x2b49('0x33')]=_0x23138e[_0x2b49('0x33')][_0x2b49('0x36')]?_0x23138e[_0x2b49('0x33')]:_0xf27200[_0x2b49('0x34')];if(!_0x237233[_0x2b49('0x2f')][_0x2b49('0x37')]('nolimit')){_0x23138e[_0x2b49('0x1d')]=qs['limit'](_0x237233['query']['limit']);_0x23138e[_0x2b49('0x1f')]=qs[_0x2b49('0x1f')](_0x237233[_0x2b49('0x2f')]['offset']);}_0x23138e['order']=qs['sort'](_0x237233[_0x2b49('0x2f')][_0x2b49('0x38')]);_0x23138e[_0x2b49('0x39')]=qs['filters'](_[_0x2b49('0x3a')](_0x237233['query'],_0xf27200['filters']),_0x44c80b);if(_0x237233['query'][_0x2b49('0x3b')]){_0x23138e[_0x2b49('0x39')]=_['merge'](_0x23138e['where'],{'$or':_[_0x2b49('0x2c')](_0x44c80b,function(_0x2d2447){if(_0x2d2447[_0x2b49('0x3c')]!==_0x2b49('0x3d')){var _0x51d9f8={};_0x51d9f8[_0x2d2447[_0x2b49('0x29')]]={'$like':'%'+_0x237233[_0x2b49('0x2f')][_0x2b49('0x3b')]+'%'};return _0x51d9f8;}})});}_0x23138e=_[_0x2b49('0x3e')]({},_0x23138e,_0x237233[_0x2b49('0x3f')]);var _0x5395af={'where':_0x23138e[_0x2b49('0x39')]};return db[_0x2b49('0x40')][_0x2b49('0x1e')](_0x5395af)[_0x2b49('0x41')](function(_0x225d4b){_0x177e4c['count']=_0x225d4b;if(_0x237233['query'][_0x2b49('0x42')]){_0x23138e[_0x2b49('0x43')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x2b49('0x44')](_0x23138e);})['then'](function(_0x4521d0){_0x177e4c[_0x2b49('0x45')]=_0x4521d0;return _0x177e4c;})[_0x2b49('0x41')](respondWithFilteredResult(_0x461592,_0x23138e))[_0x2b49('0x46')](handleError(_0x461592,null));};exports['show']=function(_0x511fb4,_0x326e37){var _0x2968bf={'raw':!![],'where':{'id':_0x511fb4[_0x2b49('0x47')]['id']}},_0x4ff21d={};_0x4ff21d[_0x2b49('0x34')]=_[_0x2b49('0x30')](db[_0x2b49('0x40')][_0x2b49('0x2d')]);_0x4ff21d[_0x2b49('0x2f')]=_[_0x2b49('0x30')](_0x511fb4[_0x2b49('0x2f')]);_0x4ff21d[_0x2b49('0x31')]=_['intersection'](_0x4ff21d['model'],_0x4ff21d['query']);_0x2968bf[_0x2b49('0x33')]=_[_0x2b49('0x32')](_0x4ff21d[_0x2b49('0x34')],qs[_0x2b49('0x35')](_0x511fb4['query'][_0x2b49('0x35')]));_0x2968bf[_0x2b49('0x33')]=_0x2968bf[_0x2b49('0x33')][_0x2b49('0x36')]?_0x2968bf[_0x2b49('0x33')]:_0x4ff21d[_0x2b49('0x34')];if(_0x511fb4[_0x2b49('0x2f')][_0x2b49('0x42')]){_0x2968bf[_0x2b49('0x43')]=[{'all':!![]}];}_0x2968bf=_[_0x2b49('0x3e')]({},_0x2968bf,_0x511fb4['options']);return db[_0x2b49('0x40')]['find'](_0x2968bf)[_0x2b49('0x41')](handleEntityNotFound(_0x326e37,null))[_0x2b49('0x41')](respondWithResult(_0x326e37,null))['catch'](handleError(_0x326e37,null));};exports[_0x2b49('0x48')]=function(_0x35e146,_0x3beacf){return db[_0x2b49('0x40')][_0x2b49('0x48')](_0x35e146['body'],{})[_0x2b49('0x41')](respondWithResult(_0x3beacf,0xc9))[_0x2b49('0x46')](handleError(_0x3beacf,null));};exports[_0x2b49('0x49')]=function(_0x4ff422,_0x4ec660){if(_0x4ff422[_0x2b49('0x4a')]['id']){delete _0x4ff422[_0x2b49('0x4a')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x4ff422[_0x2b49('0x47')]['id']}})[_0x2b49('0x41')](handleEntityNotFound(_0x4ec660,null))[_0x2b49('0x41')](saveUpdates(_0x4ff422['body'],null))[_0x2b49('0x41')](respondWithResult(_0x4ec660,null))[_0x2b49('0x46')](handleError(_0x4ec660,null));};exports[_0x2b49('0x25')]=function(_0x29dc15,_0x5cac55){return db[_0x2b49('0x40')]['find']({'where':{'id':_0x29dc15[_0x2b49('0x47')]['id']}})[_0x2b49('0x41')](handleEntityNotFound(_0x5cac55,null))[_0x2b49('0x41')](removeEntity(_0x5cac55,null))['catch'](handleError(_0x5cac55,null));};exports[_0x2b49('0x4b')]=function(_0xe305e2,_0x2539c4){return db[_0x2b49('0x40')][_0x2b49('0x4b')]()[_0x2b49('0x41')](respondWithResult(_0x2539c4,null))[_0x2b49('0x46')](handleError(_0x2539c4,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index bc8cc62..c850641 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 _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x372d8f,_0x856fec){var _0xb20127=function(_0x3b718e){while(--_0x3b718e){_0x372d8f['push'](_0x372d8f['shift']());}};_0xb20127(++_0x856fec);}(_0x53ec,0x192));var _0xc53e=function(_0xb6516e,_0x2c0401){_0xb6516e=_0xb6516e-0x0;var _0x575bed=_0x53ec[_0xb6516e];return _0x575bed;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0xe1a1ab,_0x536c2f){var _0x14fcde=function(_0xf23632){while(--_0xf23632){_0xe1a1ab['push'](_0xe1a1ab['shift']());}};_0x14fcde(++_0x536c2f);}(_0x326f,0xd1));var _0xf326=function(_0x3df245,_0x4c1c6f){_0x3df245=_0x3df245-0x0;var _0xd237cb=_0x326f[_0x3df245];return _0xd237cb;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index f919094..ae1e807 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 _0x41bf=['catch','body','where','UpdateFaxQueueReport','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','then'];(function(_0x3d8417,_0x5a099b){var _0x46c5a2=function(_0x3f7657){while(--_0x3f7657){_0x3d8417['push'](_0x3d8417['shift']());}};_0x46c5a2(++_0x5a099b);}(_0x41bf,0xa6));var _0xf41b=function(_0x4808ef,_0x411bc7){_0x4808ef=_0x4808ef-0x0;var _0x218d14=_0x41bf[_0x4808ef];return _0x218d14;};'use strict';var _=require(_0xf41b('0x0'));var util=require(_0xf41b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf41b('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf41b('0x3'))(_0xf41b('0x4'));var config=require(_0xf41b('0x5'));var jayson=require(_0xf41b('0x6'));var client=jayson['client'][_0xf41b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a86a,_0x10f0b5,_0x191ba8){return new BPromise(function(_0x485aa0,_0x5602b1){return client['request'](_0x21a86a,_0x191ba8)['then'](function(_0x251d82){logger[_0xf41b('0x8')](_0xf41b('0x9'),_0x10f0b5,'request\x20sent');logger[_0xf41b('0xa')](_0xf41b('0xb'),_0x10f0b5,_0xf41b('0xc'),JSON[_0xf41b('0xd')](_0x251d82));if(_0x251d82['error']){if(_0x251d82['error']['code']===0x1f4){logger[_0xf41b('0xe')](_0xf41b('0x9'),_0x10f0b5,_0x251d82[_0xf41b('0xe')][_0xf41b('0xf')]);return _0x5602b1(_0x251d82['error']['message']);}logger[_0xf41b('0xe')](_0xf41b('0x9'),_0x10f0b5,_0x251d82['error'][_0xf41b('0xf')]);return _0x485aa0(_0x251d82[_0xf41b('0xe')]['message']);}else{logger[_0xf41b('0x8')](_0xf41b('0x9'),_0x10f0b5,_0xf41b('0xc'));_0x485aa0(_0x251d82[_0xf41b('0x10')][_0xf41b('0xf')]);}})['catch'](function(_0x2428de){logger[_0xf41b('0xe')](_0xf41b('0x9'),_0x10f0b5,_0x2428de);_0x5602b1(_0x2428de);});});}exports[_0xf41b('0x11')]=function(_0x521840){var _0x57c2cd=this;return new Promise(function(_0x38fe81,_0x5dbb91){return db[_0xf41b('0x12')][_0xf41b('0x13')](_0x521840['body'],{'raw':_0x521840[_0xf41b('0x14')]?_0x521840[_0xf41b('0x14')][_0xf41b('0x15')]===undefined?!![]:![]:!![]})[_0xf41b('0x16')](function(_0x33a497){logger['info'](_0xf41b('0x11'),_0x521840);logger[_0xf41b('0xa')](_0xf41b('0x11'),_0x521840,JSON[_0xf41b('0xd')](_0x33a497));_0x38fe81(_0x33a497);})[_0xf41b('0x17')](function(_0x28ce3b){logger[_0xf41b('0xe')](_0xf41b('0x11'),_0x28ce3b[_0xf41b('0xf')],_0x521840);_0x5dbb91(_0x57c2cd['error'](0x1f4,_0x28ce3b[_0xf41b('0xf')]));});});};exports['UpdateFaxQueueReport']=function(_0x17817d){var _0x1078b1=this;return new Promise(function(_0x2ede5e,_0x101ca7){return db[_0xf41b('0x12')]['update'](_0x17817d[_0xf41b('0x18')],{'raw':_0x17817d[_0xf41b('0x14')]?_0x17817d[_0xf41b('0x14')][_0xf41b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17817d[_0xf41b('0x14')]?_0x17817d[_0xf41b('0x14')][_0xf41b('0x19')]||null:null,'attributes':_0x17817d[_0xf41b('0x14')]?_0x17817d[_0xf41b('0x14')]['attributes']||null:null,'limit':_0x17817d[_0xf41b('0x14')]?_0x17817d[_0xf41b('0x14')]['limit']||null:null})[_0xf41b('0x16')](function(_0x33415d){logger[_0xf41b('0x8')](_0xf41b('0x1a'),_0x17817d);logger['debug'](_0xf41b('0x1a'),_0x17817d,JSON['stringify'](_0x33415d));_0x2ede5e(_0x33415d);})[_0xf41b('0x17')](function(_0x5da265){logger[_0xf41b('0xe')](_0xf41b('0x1a'),_0x5da265['message'],_0x17817d);_0x101ca7(_0x1078b1['error'](0x1f4,_0x5da265[_0xf41b('0xf')]));});});}; \ No newline at end of file +var _0xba03=['limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','debug','stringify','UpdateFaxQueueReport','raw','where','attributes'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xba03,0x9c));var _0x3ba0=function(_0x30e553,_0x464327){_0x30e553=_0x30e553-0x0;var _0x4ce3ef=_0xba03[_0x30e553];return _0x4ce3ef;};'use strict';var _=require(_0x3ba0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ba0('0x1'));var rs=require(_0x3ba0('0x2'));var fs=require('fs');var Redis=require(_0x3ba0('0x3'));var db=require(_0x3ba0('0x4'))['db'];var utils=require(_0x3ba0('0x5'));var logger=require('../../config/logger')(_0x3ba0('0x6'));var config=require(_0x3ba0('0x7'));var jayson=require(_0x3ba0('0x8'));var client=jayson['client'][_0x3ba0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x133efe,_0x1c4fb5,_0x34d55f){return new BPromise(function(_0x54cb2e,_0x4f7161){return client['request'](_0x133efe,_0x34d55f)[_0x3ba0('0xa')](function(_0x22ff4b){logger[_0x3ba0('0xb')](_0x3ba0('0xc'),_0x1c4fb5,_0x3ba0('0xd'));logger['debug'](_0x3ba0('0xe'),_0x1c4fb5,'request\x20sent',JSON['stringify'](_0x22ff4b));if(_0x22ff4b[_0x3ba0('0xf')]){if(_0x22ff4b[_0x3ba0('0xf')][_0x3ba0('0x10')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1c4fb5,_0x22ff4b[_0x3ba0('0xf')][_0x3ba0('0x11')]);return _0x4f7161(_0x22ff4b[_0x3ba0('0xf')][_0x3ba0('0x11')]);}logger[_0x3ba0('0xf')](_0x3ba0('0xc'),_0x1c4fb5,_0x22ff4b[_0x3ba0('0xf')][_0x3ba0('0x11')]);return _0x54cb2e(_0x22ff4b[_0x3ba0('0xf')][_0x3ba0('0x11')]);}else{logger[_0x3ba0('0xb')](_0x3ba0('0xc'),_0x1c4fb5,_0x3ba0('0xd'));_0x54cb2e(_0x22ff4b[_0x3ba0('0x12')]['message']);}})[_0x3ba0('0x13')](function(_0x2cbf3a){logger[_0x3ba0('0xf')](_0x3ba0('0xc'),_0x1c4fb5,_0x2cbf3a);_0x4f7161(_0x2cbf3a);});});}exports[_0x3ba0('0x14')]=function(_0xb8f86){var _0x5590ab=this;return new Promise(function(_0x5c0469,_0x538bcc){return db[_0x3ba0('0x15')]['create'](_0xb8f86[_0x3ba0('0x16')],{'raw':_0xb8f86['options']?_0xb8f86[_0x3ba0('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x3ba0('0xa')](function(_0x288f8e){logger[_0x3ba0('0xb')](_0x3ba0('0x14'),_0xb8f86);logger[_0x3ba0('0x18')](_0x3ba0('0x14'),_0xb8f86,JSON[_0x3ba0('0x19')](_0x288f8e));_0x5c0469(_0x288f8e);})[_0x3ba0('0x13')](function(_0x56085b){logger['error'](_0x3ba0('0x14'),_0x56085b[_0x3ba0('0x11')],_0xb8f86);_0x538bcc(_0x5590ab[_0x3ba0('0xf')](0x1f4,_0x56085b['message']));});});};exports[_0x3ba0('0x1a')]=function(_0x450f84){var _0x1f3c40=this;return new Promise(function(_0x37bc56,_0x1a7280){return db[_0x3ba0('0x15')]['update'](_0x450f84['body'],{'raw':_0x450f84['options']?_0x450f84[_0x3ba0('0x17')][_0x3ba0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450f84[_0x3ba0('0x17')]?_0x450f84['options'][_0x3ba0('0x1c')]||null:null,'attributes':_0x450f84[_0x3ba0('0x17')]?_0x450f84[_0x3ba0('0x17')][_0x3ba0('0x1d')]||null:null,'limit':_0x450f84[_0x3ba0('0x17')]?_0x450f84['options'][_0x3ba0('0x1e')]||null:null})['then'](function(_0x20ef51){logger[_0x3ba0('0xb')](_0x3ba0('0x1a'),_0x450f84);logger[_0x3ba0('0x18')](_0x3ba0('0x1a'),_0x450f84,JSON[_0x3ba0('0x19')](_0x20ef51));_0x37bc56(_0x20ef51);})[_0x3ba0('0x13')](function(_0x281614){logger[_0x3ba0('0xf')](_0x3ba0('0x1a'),_0x281614[_0x3ba0('0x11')],_0x450f84);_0x1a7280(_0x1f3c40['error'](0x1f4,_0x281614[_0x3ba0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 60ccfae..bb89987 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 _0xbf05=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbf05,0x13f));var _0x5bf0=function(_0x725cf8,_0x18bfae){_0x725cf8=_0x725cf8-0x0;var _0x4b0c66=_0xbf05[_0x725cf8];return _0x4b0c66;};'use strict';var multer=require(_0x5bf0('0x0'));var util=require(_0x5bf0('0x1'));var path=require(_0x5bf0('0x2'));var timeout=require(_0x5bf0('0x3'));var express=require(_0x5bf0('0x4'));var router=express[_0x5bf0('0x5')]();var fs_extra=require(_0x5bf0('0x6'));var auth=require(_0x5bf0('0x7'));var interaction=require(_0x5bf0('0x8'));var config=require(_0x5bf0('0x9'));var controller=require(_0x5bf0('0xa'));router[_0x5bf0('0xb')]('/',auth[_0x5bf0('0xc')](),controller[_0x5bf0('0xd')]);router[_0x5bf0('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x5bf0('0xe')]);router['get'](_0x5bf0('0xf'),auth[_0x5bf0('0xc')](),controller[_0x5bf0('0x10')]);router[_0x5bf0('0x11')]('/',auth[_0x5bf0('0xc')](),controller['create']);router[_0x5bf0('0x12')](_0x5bf0('0xf'),auth[_0x5bf0('0xc')](),controller[_0x5bf0('0x13')]);router[_0x5bf0('0x14')](_0x5bf0('0xf'),auth[_0x5bf0('0xc')](),controller[_0x5bf0('0x15')]);module[_0x5bf0('0x16')]=router; \ No newline at end of file +var _0xd0e3=['post','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','/describe','get','/:id','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd0e3,0x1e0));var _0x3d0e=function(_0x31b2c5,_0x20eda5){_0x31b2c5=_0x31b2c5-0x0;var _0x477c8c=_0xd0e3[_0x31b2c5];return _0x477c8c;};'use strict';var multer=require(_0x3d0e('0x0'));var util=require(_0x3d0e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3d0e('0x2'));var router=express[_0x3d0e('0x3')]();var fs_extra=require(_0x3d0e('0x4'));var auth=require(_0x3d0e('0x5'));var interaction=require(_0x3d0e('0x6'));var config=require(_0x3d0e('0x7'));var controller=require(_0x3d0e('0x8'));router['get']('/',auth[_0x3d0e('0x9')](),controller['index']);router['get'](_0x3d0e('0xa'),auth[_0x3d0e('0x9')](),controller['describe']);router[_0x3d0e('0xb')](_0x3d0e('0xc'),auth[_0x3d0e('0x9')](),controller[_0x3d0e('0xd')]);router[_0x3d0e('0xe')]('/',auth[_0x3d0e('0x9')](),controller['create']);router[_0x3d0e('0xf')](_0x3d0e('0xc'),auth[_0x3d0e('0x9')](),controller['update']);router[_0x3d0e('0x10')](_0x3d0e('0xc'),auth['isAuthenticated'](),controller[_0x3d0e('0x11')]);module[_0x3d0e('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 69aa3aa..0802510 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xe4c93f,_0x5549b0){var _0x582ab1=function(_0x4c0cf8){while(--_0x4c0cf8){_0xe4c93f['push'](_0xe4c93f['shift']());}};_0x582ab1(++_0x5549b0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x399bfc,_0x36d4b0){_0x399bfc=_0x399bfc-0x0;var _0x36846d=_0xf3cd[_0x399bfc];return _0x36846d;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xb23e8a,_0x34ef81){var _0xc9b754=function(_0x53f85f){while(--_0x53f85f){_0xb23e8a['push'](_0xb23e8a['shift']());}};_0xc9b754(++_0x34ef81);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xf3cd[_0x3a6efd];return _0x487b9a;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a034174..390f343 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 _0xbe99=['path','sox','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','describe','eml-format','rimraf','fast-json-patch','mustache'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0xbe99,0x1b2));var _0x9be9=function(_0x1f18b1,_0x38f43d){_0x1f18b1=_0x1f18b1-0x0;var _0x188618=_0xbe99[_0x1f18b1];return _0x188618;};'use strict';var emlformat=require(_0x9be9('0x0'));var rimraf=require(_0x9be9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9be9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9be9('0x3'));var util=require('util');var path=require(_0x9be9('0x4'));var sox=require(_0x9be9('0x5'));var csv=require('to-csv');var ejs=require(_0x9be9('0x6'));var fs=require('fs');var fs_extra=require(_0x9be9('0x7'));var _=require('lodash');var squel=require(_0x9be9('0x8'));var crypto=require(_0x9be9('0x9'));var jsforce=require(_0x9be9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9be9('0xb'));var Redis=require(_0x9be9('0xc'));var authService=require(_0x9be9('0xd'));var qs=require(_0x9be9('0xe'));var as=require(_0x9be9('0xf'));var hardwareService=require(_0x9be9('0x10'));var logger=require(_0x9be9('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x9be9('0x12'));var licenseUtil=require(_0x9be9('0x13'));var db=require(_0x9be9('0x14'))['db'];function respondWithStatusCode(_0x65838c,_0x2bec0f){_0x2bec0f=_0x2bec0f||0xcc;return function(_0x2d550f){if(_0x2d550f){return _0x65838c[_0x9be9('0x15')](_0x2bec0f);}return _0x65838c[_0x9be9('0x16')](_0x2bec0f)[_0x9be9('0x17')]();};}function respondWithResult(_0x278ba4,_0x3833a6){_0x3833a6=_0x3833a6||0xc8;return function(_0x54c4da){if(_0x54c4da){return _0x278ba4[_0x9be9('0x16')](_0x3833a6)[_0x9be9('0x18')](_0x54c4da);}};}function respondWithFilteredResult(_0x88f68b,_0x52d07c){return function(_0x45e811){if(_0x45e811){var _0x77b481=typeof _0x52d07c[_0x9be9('0x19')]==='undefined'&&typeof _0x52d07c[_0x9be9('0x1a')]===_0x9be9('0x1b');var _0x37e3bf=_0x45e811[_0x9be9('0x1c')];var _0x2b92b7=_0x77b481?0x0:_0x52d07c[_0x9be9('0x19')];var _0x3b0779=_0x77b481?_0x45e811[_0x9be9('0x1c')]:_0x52d07c[_0x9be9('0x19')]+_0x52d07c[_0x9be9('0x1a')];var _0x2cc318;if(_0x3b0779>=_0x37e3bf){_0x3b0779=_0x37e3bf;_0x2cc318=0xc8;}else{_0x2cc318=0xce;}_0x88f68b[_0x9be9('0x16')](_0x2cc318);return _0x88f68b[_0x9be9('0x1d')](_0x9be9('0x1e'),_0x2b92b7+'-'+_0x3b0779+'/'+_0x37e3bf)[_0x9be9('0x18')](_0x45e811);}return null;};}function patchUpdates(_0x475f4d){return function(_0xe679cb){try{jsonpatch[_0x9be9('0x1f')](_0xe679cb,_0x475f4d,!![]);}catch(_0x489573){return BPromise['reject'](_0x489573);}return _0xe679cb[_0x9be9('0x20')]();};}function saveUpdates(_0x20a656,_0x1ce403){return function(_0x2cbda8){if(_0x2cbda8){return _0x2cbda8[_0x9be9('0x21')](_0x20a656)[_0x9be9('0x22')](function(_0x5d0ac5){return _0x5d0ac5;});}return null;};}function removeEntity(_0x92de46,_0x4ad765){return function(_0x1ddffb){if(_0x1ddffb){return _0x1ddffb[_0x9be9('0x23')]()[_0x9be9('0x22')](function(){_0x92de46[_0x9be9('0x16')](0xcc)[_0x9be9('0x17')]();});}};}function handleEntityNotFound(_0x3065c9,_0x3b8c41){return function(_0x209406){if(!_0x209406){_0x3065c9[_0x9be9('0x15')](0x194);}return _0x209406;};}function handleError(_0x3fcbba,_0x195897){_0x195897=_0x195897||0x1f4;return function(_0x2f58a4){logger[_0x9be9('0x24')](_0x2f58a4[_0x9be9('0x25')]);if(_0x2f58a4[_0x9be9('0x26')]){delete _0x2f58a4[_0x9be9('0x26')];}_0x3fcbba[_0x9be9('0x16')](_0x195897)[_0x9be9('0x27')](_0x2f58a4);};}exports[_0x9be9('0x28')]=function(_0x1ce045,_0x26a434){var _0x4b288b={},_0x39afe8={},_0x2f4edb={'count':0x0,'rows':[]};var _0x21b217=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x50d7ca){return{'name':_0x50d7ca[_0x9be9('0x29')],'type':_0x50d7ca[_0x9be9('0x2a')]['key']};});_0x39afe8[_0x9be9('0x2b')]=_[_0x9be9('0x2c')](_0x21b217,_0x9be9('0x26'));_0x39afe8[_0x9be9('0x2d')]=_[_0x9be9('0x2e')](_0x1ce045[_0x9be9('0x2d')]);_0x39afe8[_0x9be9('0x2f')]=_[_0x9be9('0x30')](_0x39afe8[_0x9be9('0x2b')],_0x39afe8['query']);_0x4b288b[_0x9be9('0x31')]=_[_0x9be9('0x30')](_0x39afe8[_0x9be9('0x2b')],qs[_0x9be9('0x32')](_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x32')]));_0x4b288b[_0x9be9('0x31')]=_0x4b288b['attributes'][_0x9be9('0x33')]?_0x4b288b[_0x9be9('0x31')]:_0x39afe8[_0x9be9('0x2b')];if(!_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x34')]('nolimit')){_0x4b288b[_0x9be9('0x1a')]=qs['limit'](_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x1a')]);_0x4b288b['offset']=qs[_0x9be9('0x19')](_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x19')]);}_0x4b288b[_0x9be9('0x35')]=qs[_0x9be9('0x36')](_0x1ce045['query'][_0x9be9('0x36')]);_0x4b288b['where']=qs[_0x9be9('0x2f')](_[_0x9be9('0x37')](_0x1ce045[_0x9be9('0x2d')],_0x39afe8[_0x9be9('0x2f')]),_0x21b217);if(_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x38')]){_0x4b288b[_0x9be9('0x39')]=_[_0x9be9('0x3a')](_0x4b288b['where'],{'$or':_[_0x9be9('0x2c')](_0x21b217,function(_0x31873c){if(_0x31873c[_0x9be9('0x2a')]!==_0x9be9('0x3b')){var _0x1eaa9b={};_0x1eaa9b[_0x31873c[_0x9be9('0x26')]]={'$like':'%'+_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x38')]+'%'};return _0x1eaa9b;}})});}_0x4b288b=_[_0x9be9('0x3a')]({},_0x4b288b,_0x1ce045[_0x9be9('0x3c')]);var _0x1d3053={'where':_0x4b288b[_0x9be9('0x39')]};return db[_0x9be9('0x3d')][_0x9be9('0x1c')](_0x1d3053)['then'](function(_0x13a157){_0x2f4edb['count']=_0x13a157;if(_0x1ce045[_0x9be9('0x2d')][_0x9be9('0x3e')]){_0x4b288b[_0x9be9('0x3f')]=[{'all':!![]}];}return db[_0x9be9('0x3d')][_0x9be9('0x40')](_0x4b288b);})[_0x9be9('0x22')](function(_0x14dbad){_0x2f4edb[_0x9be9('0x41')]=_0x14dbad;return _0x2f4edb;})[_0x9be9('0x22')](respondWithFilteredResult(_0x26a434,_0x4b288b))[_0x9be9('0x42')](handleError(_0x26a434,null));};exports[_0x9be9('0x43')]=function(_0x1d3c8f,_0x195534){var _0x238361={'raw':!![],'where':{'id':_0x1d3c8f['params']['id']}},_0x17053b={};_0x17053b[_0x9be9('0x2b')]=_[_0x9be9('0x2e')](db[_0x9be9('0x3d')][_0x9be9('0x44')]);_0x17053b['query']=_[_0x9be9('0x2e')](_0x1d3c8f['query']);_0x17053b['filters']=_[_0x9be9('0x30')](_0x17053b[_0x9be9('0x2b')],_0x17053b[_0x9be9('0x2d')]);_0x238361['attributes']=_['intersection'](_0x17053b[_0x9be9('0x2b')],qs[_0x9be9('0x32')](_0x1d3c8f[_0x9be9('0x2d')]['fields']));_0x238361['attributes']=_0x238361[_0x9be9('0x31')]['length']?_0x238361[_0x9be9('0x31')]:_0x17053b[_0x9be9('0x2b')];if(_0x1d3c8f[_0x9be9('0x2d')]['includeAll']){_0x238361['include']=[{'all':!![]}];}_0x238361=_[_0x9be9('0x3a')]({},_0x238361,_0x1d3c8f[_0x9be9('0x3c')]);return db[_0x9be9('0x3d')]['find'](_0x238361)['then'](handleEntityNotFound(_0x195534,null))[_0x9be9('0x22')](respondWithResult(_0x195534,null))['catch'](handleError(_0x195534,null));};exports[_0x9be9('0x45')]=function(_0x3d8888,_0x22c18c){return db[_0x9be9('0x3d')]['create'](_0x3d8888['body'],{})[_0x9be9('0x22')](respondWithResult(_0x22c18c,0xc9))[_0x9be9('0x42')](handleError(_0x22c18c,null));};exports[_0x9be9('0x21')]=function(_0x24585e,_0x386fa4){if(_0x24585e[_0x9be9('0x46')]['id']){delete _0x24585e[_0x9be9('0x46')]['id'];}return db[_0x9be9('0x3d')]['find']({'where':{'id':_0x24585e[_0x9be9('0x47')]['id']}})[_0x9be9('0x22')](handleEntityNotFound(_0x386fa4,null))[_0x9be9('0x22')](saveUpdates(_0x24585e[_0x9be9('0x46')],null))[_0x9be9('0x22')](respondWithResult(_0x386fa4,null))['catch'](handleError(_0x386fa4,null));};exports[_0x9be9('0x23')]=function(_0x17ae2b,_0x17d078){return db[_0x9be9('0x3d')]['find']({'where':{'id':_0x17ae2b[_0x9be9('0x47')]['id']}})[_0x9be9('0x22')](handleEntityNotFound(_0x17d078,null))[_0x9be9('0x22')](removeEntity(_0x17d078,null))[_0x9be9('0x42')](handleError(_0x17d078,null));};exports['describe']=function(_0x338277,_0x4146d6){return db[_0x9be9('0x3d')][_0x9be9('0x48')]()[_0x9be9('0x22')](respondWithResult(_0x4146d6,null))['catch'](handleError(_0x4146d6,null));}; \ No newline at end of file +var _0xc12c=['body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','FaxTransferReport','create'];(function(_0x52ab5b,_0x54a4b7){var _0x29108a=function(_0x661272){while(--_0x661272){_0x52ab5b['push'](_0x52ab5b['shift']());}};_0x29108a(++_0x54a4b7);}(_0xc12c,0xdc));var _0xcc12=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xc12c[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0xcc12('0x0'));var rimraf=require(_0xcc12('0x1'));var zipdir=require(_0xcc12('0x2'));var jsonpatch=require(_0xcc12('0x3'));var rp=require(_0xcc12('0x4'));var moment=require(_0xcc12('0x5'));var BPromise=require(_0xcc12('0x6'));var Mustache=require(_0xcc12('0x7'));var util=require(_0xcc12('0x8'));var path=require(_0xcc12('0x9'));var sox=require('sox');var csv=require(_0xcc12('0xa'));var ejs=require(_0xcc12('0xb'));var fs=require('fs');var fs_extra=require(_0xcc12('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc12('0xd'));var jsforce=require(_0xcc12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc12('0xa'));var querystring=require('querystring');var Papa=require(_0xcc12('0xf'));var Redis=require(_0xcc12('0x10'));var authService=require(_0xcc12('0x11'));var qs=require(_0xcc12('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc12('0x13'))(_0xcc12('0x14'));var utils=require(_0xcc12('0x15'));var config=require(_0xcc12('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19519b,_0x4a0b2f){_0x4a0b2f=_0x4a0b2f||0xcc;return function(_0x6a8270){if(_0x6a8270){return _0x19519b['sendStatus'](_0x4a0b2f);}return _0x19519b[_0xcc12('0x17')](_0x4a0b2f)['end']();};}function respondWithResult(_0x56918e,_0x5788b8){_0x5788b8=_0x5788b8||0xc8;return function(_0x247b0e){if(_0x247b0e){return _0x56918e['status'](_0x5788b8)[_0xcc12('0x18')](_0x247b0e);}};}function respondWithFilteredResult(_0x137fdf,_0x359c62){return function(_0x5f30e6){if(_0x5f30e6){var _0x39a064=typeof _0x359c62[_0xcc12('0x19')]===_0xcc12('0x1a')&&typeof _0x359c62[_0xcc12('0x1b')]===_0xcc12('0x1a');var _0x22cbdb=_0x5f30e6[_0xcc12('0x1c')];var _0x5497bb=_0x39a064?0x0:_0x359c62['offset'];var _0x451b80=_0x39a064?_0x5f30e6['count']:_0x359c62[_0xcc12('0x19')]+_0x359c62[_0xcc12('0x1b')];var _0x16aa85;if(_0x451b80>=_0x22cbdb){_0x451b80=_0x22cbdb;_0x16aa85=0xc8;}else{_0x16aa85=0xce;}_0x137fdf['status'](_0x16aa85);return _0x137fdf[_0xcc12('0x1d')](_0xcc12('0x1e'),_0x5497bb+'-'+_0x451b80+'/'+_0x22cbdb)[_0xcc12('0x18')](_0x5f30e6);}return null;};}function patchUpdates(_0x3715c8){return function(_0x546013){try{jsonpatch[_0xcc12('0x1f')](_0x546013,_0x3715c8,!![]);}catch(_0x339ed5){return BPromise[_0xcc12('0x20')](_0x339ed5);}return _0x546013[_0xcc12('0x21')]();};}function saveUpdates(_0x18d1e8,_0x15a3ab){return function(_0x4efd59){if(_0x4efd59){return _0x4efd59[_0xcc12('0x22')](_0x18d1e8)[_0xcc12('0x23')](function(_0x980072){return _0x980072;});}return null;};}function removeEntity(_0x22111e,_0x4ec52c){return function(_0x77b96b){if(_0x77b96b){return _0x77b96b[_0xcc12('0x24')]()['then'](function(){_0x22111e[_0xcc12('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c25c0,_0x292986){return function(_0x137690){if(!_0x137690){_0x3c25c0['sendStatus'](0x194);}return _0x137690;};}function handleError(_0x2b979b,_0x10c162){_0x10c162=_0x10c162||0x1f4;return function(_0x244e28){logger[_0xcc12('0x25')](_0x244e28[_0xcc12('0x26')]);if(_0x244e28[_0xcc12('0x27')]){delete _0x244e28['name'];}_0x2b979b[_0xcc12('0x17')](_0x10c162)[_0xcc12('0x28')](_0x244e28);};}exports['index']=function(_0x475975,_0x56f2b8){var _0x48453a={},_0xc578c0={},_0x35cf43={'count':0x0,'rows':[]};var _0x1983fb=_[_0xcc12('0x29')](db['FaxTransferReport'][_0xcc12('0x2a')],function(_0x271f02){return{'name':_0x271f02['fieldName'],'type':_0x271f02['type'][_0xcc12('0x2b')]};});_0xc578c0[_0xcc12('0x2c')]=_[_0xcc12('0x29')](_0x1983fb,'name');_0xc578c0[_0xcc12('0x2d')]=_[_0xcc12('0x2e')](_0x475975[_0xcc12('0x2d')]);_0xc578c0[_0xcc12('0x2f')]=_['intersection'](_0xc578c0[_0xcc12('0x2c')],_0xc578c0['query']);_0x48453a[_0xcc12('0x30')]=_[_0xcc12('0x31')](_0xc578c0['model'],qs[_0xcc12('0x32')](_0x475975[_0xcc12('0x2d')][_0xcc12('0x32')]));_0x48453a['attributes']=_0x48453a[_0xcc12('0x30')][_0xcc12('0x33')]?_0x48453a[_0xcc12('0x30')]:_0xc578c0[_0xcc12('0x2c')];if(!_0x475975[_0xcc12('0x2d')][_0xcc12('0x34')](_0xcc12('0x35'))){_0x48453a[_0xcc12('0x1b')]=qs[_0xcc12('0x1b')](_0x475975[_0xcc12('0x2d')][_0xcc12('0x1b')]);_0x48453a[_0xcc12('0x19')]=qs[_0xcc12('0x19')](_0x475975['query'][_0xcc12('0x19')]);}_0x48453a['order']=qs[_0xcc12('0x36')](_0x475975[_0xcc12('0x2d')][_0xcc12('0x36')]);_0x48453a[_0xcc12('0x37')]=qs[_0xcc12('0x2f')](_[_0xcc12('0x38')](_0x475975[_0xcc12('0x2d')],_0xc578c0['filters']),_0x1983fb);if(_0x475975[_0xcc12('0x2d')][_0xcc12('0x39')]){_0x48453a['where']=_[_0xcc12('0x3a')](_0x48453a[_0xcc12('0x37')],{'$or':_[_0xcc12('0x29')](_0x1983fb,function(_0x56fb92){if(_0x56fb92['type']!==_0xcc12('0x3b')){var _0x48e927={};_0x48e927[_0x56fb92[_0xcc12('0x27')]]={'$like':'%'+_0x475975['query'][_0xcc12('0x39')]+'%'};return _0x48e927;}})});}_0x48453a=_[_0xcc12('0x3a')]({},_0x48453a,_0x475975[_0xcc12('0x3c')]);var _0x1f94d0={'where':_0x48453a[_0xcc12('0x37')]};return db['FaxTransferReport'][_0xcc12('0x1c')](_0x1f94d0)[_0xcc12('0x23')](function(_0x3f5a76){_0x35cf43[_0xcc12('0x1c')]=_0x3f5a76;if(_0x475975[_0xcc12('0x2d')][_0xcc12('0x3d')]){_0x48453a[_0xcc12('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xcc12('0x3f')](_0x48453a);})[_0xcc12('0x23')](function(_0x566e53){_0x35cf43['rows']=_0x566e53;return _0x35cf43;})[_0xcc12('0x23')](respondWithFilteredResult(_0x56f2b8,_0x48453a))[_0xcc12('0x40')](handleError(_0x56f2b8,null));};exports[_0xcc12('0x41')]=function(_0x329d40,_0xb4ec04){var _0x2ed80b={'raw':!![],'where':{'id':_0x329d40['params']['id']}},_0x5ccd59={};_0x5ccd59[_0xcc12('0x2c')]=_[_0xcc12('0x2e')](db[_0xcc12('0x42')][_0xcc12('0x2a')]);_0x5ccd59[_0xcc12('0x2d')]=_[_0xcc12('0x2e')](_0x329d40[_0xcc12('0x2d')]);_0x5ccd59[_0xcc12('0x2f')]=_['intersection'](_0x5ccd59[_0xcc12('0x2c')],_0x5ccd59[_0xcc12('0x2d')]);_0x2ed80b[_0xcc12('0x30')]=_[_0xcc12('0x31')](_0x5ccd59[_0xcc12('0x2c')],qs['fields'](_0x329d40[_0xcc12('0x2d')][_0xcc12('0x32')]));_0x2ed80b['attributes']=_0x2ed80b[_0xcc12('0x30')][_0xcc12('0x33')]?_0x2ed80b['attributes']:_0x5ccd59['model'];if(_0x329d40[_0xcc12('0x2d')]['includeAll']){_0x2ed80b[_0xcc12('0x3e')]=[{'all':!![]}];}_0x2ed80b=_[_0xcc12('0x3a')]({},_0x2ed80b,_0x329d40[_0xcc12('0x3c')]);return db[_0xcc12('0x42')]['find'](_0x2ed80b)[_0xcc12('0x23')](handleEntityNotFound(_0xb4ec04,null))[_0xcc12('0x23')](respondWithResult(_0xb4ec04,null))[_0xcc12('0x40')](handleError(_0xb4ec04,null));};exports['create']=function(_0x21ce0a,_0xd271f0){return db[_0xcc12('0x42')][_0xcc12('0x43')](_0x21ce0a['body'],{})[_0xcc12('0x23')](respondWithResult(_0xd271f0,0xc9))[_0xcc12('0x40')](handleError(_0xd271f0,null));};exports[_0xcc12('0x22')]=function(_0x5cad44,_0x2b5b25){if(_0x5cad44[_0xcc12('0x44')]['id']){delete _0x5cad44[_0xcc12('0x44')]['id'];}return db['FaxTransferReport'][_0xcc12('0x45')]({'where':{'id':_0x5cad44[_0xcc12('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b5b25,null))[_0xcc12('0x23')](saveUpdates(_0x5cad44[_0xcc12('0x44')],null))[_0xcc12('0x23')](respondWithResult(_0x2b5b25,null))[_0xcc12('0x40')](handleError(_0x2b5b25,null));};exports['destroy']=function(_0x46a0b6,_0x209ced){return db[_0xcc12('0x42')]['find']({'where':{'id':_0x46a0b6['params']['id']}})[_0xcc12('0x23')](handleEntityNotFound(_0x209ced,null))[_0xcc12('0x23')](removeEntity(_0x209ced,null))[_0xcc12('0x40')](handleError(_0x209ced,null));};exports['describe']=function(_0x3a80d6,_0x5bf7a1){return db['FaxTransferReport'][_0xcc12('0x47')]()[_0xcc12('0x23')](respondWithResult(_0x5bf7a1,null))['catch'](handleError(_0x5bf7a1,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index dfe3720..59d5932 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 _0xa0a3=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','util'];(function(_0xe6d9df,_0x4cd0e1){var _0x5212d5=function(_0xf4091){while(--_0xf4091){_0xe6d9df['push'](_0xe6d9df['shift']());}};_0x5212d5(++_0x4cd0e1);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x3691a6,_0x3f0213){_0x3691a6=_0x3691a6-0x0;var _0x4a6b35=_0xa0a3[_0x3691a6];return _0x4a6b35;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var logger=require(_0x3a0a('0x1'))('api');var moment=require(_0x3a0a('0x2'));var BPromise=require(_0x3a0a('0x3'));var rp=require(_0x3a0a('0x4'));var fs=require('fs');var path=require(_0x3a0a('0x5'));var rimraf=require(_0x3a0a('0x6'));var config=require(_0x3a0a('0x7'));var attributes=require(_0x3a0a('0x8'));module[_0x3a0a('0x9')]=function(_0xa047cf,_0x3d7dc7){return _0xa047cf[_0x3a0a('0xa')](_0x3a0a('0xb'),attributes,{'tableName':_0x3a0a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a0b=['lodash','util','../../config/logger','api','bluebird','path','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x35f7d1,_0x39d318){var _0x53ac5f=function(_0x30b171){while(--_0x30b171){_0x35f7d1['push'](_0x35f7d1['shift']());}};_0x53ac5f(++_0x39d318);}(_0x6a0b,0x181));var _0xb6a0=function(_0x7d9c46,_0x55c788){_0x7d9c46=_0x7d9c46-0x0;var _0x20aca3=_0x6a0b[_0x7d9c46];return _0x20aca3;};'use strict';var _=require(_0xb6a0('0x0'));var util=require(_0xb6a0('0x1'));var logger=require(_0xb6a0('0x2'))(_0xb6a0('0x3'));var moment=require('moment');var BPromise=require(_0xb6a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6a0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb6a0('0x6'));module[_0xb6a0('0x7')]=function(_0x46ad5a,_0x3136e9){return _0x46ad5a['define'](_0xb6a0('0x8'),attributes,{'tableName':_0xb6a0('0x9'),'paranoid':![],'indexes':[{'name':_0xb6a0('0xa'),'fields':[_0xb6a0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index f61e04f..1690273 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 _0x9e45=['client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5713b5,_0x423f83){var _0x2f795d=function(_0x392aea){while(--_0x392aea){_0x5713b5['push'](_0x5713b5['shift']());}};_0x2f795d(++_0x423f83);}(_0x9e45,0x1de));var _0x59e4=function(_0x1427ab,_0x4978fb){_0x1427ab=_0x1427ab-0x0;var _0x426299=_0x9e45[_0x1427ab];return _0x426299;};'use strict';var _=require(_0x59e4('0x0'));var util=require('util');var moment=require(_0x59e4('0x1'));var BPromise=require(_0x59e4('0x2'));var rs=require(_0x59e4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59e4('0x4'))['db'];var utils=require(_0x59e4('0x5'));var logger=require('../../config/logger')(_0x59e4('0x6'));var config=require(_0x59e4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x59e4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bddbb,_0x553944,_0x29fd2c){return new BPromise(function(_0x25856d,_0x7bfa39){return client[_0x59e4('0x9')](_0x1bddbb,_0x29fd2c)['then'](function(_0x5b0b46){logger['info'](_0x59e4('0xa'),_0x553944,_0x59e4('0xb'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x553944,'request\x20sent',JSON[_0x59e4('0xc')](_0x5b0b46));if(_0x5b0b46[_0x59e4('0xd')]){if(_0x5b0b46[_0x59e4('0xd')][_0x59e4('0xe')]===0x1f4){logger[_0x59e4('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x553944,_0x5b0b46[_0x59e4('0xd')][_0x59e4('0xf')]);return _0x7bfa39(_0x5b0b46[_0x59e4('0xd')]['message']);}logger[_0x59e4('0xd')](_0x59e4('0xa'),_0x553944,_0x5b0b46['error']['message']);return _0x25856d(_0x5b0b46[_0x59e4('0xd')][_0x59e4('0xf')]);}else{logger[_0x59e4('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x553944,_0x59e4('0xb'));_0x25856d(_0x5b0b46[_0x59e4('0x11')][_0x59e4('0xf')]);}})['catch'](function(_0x30d039){logger['error'](_0x59e4('0xa'),_0x553944,_0x30d039);_0x7bfa39(_0x30d039);});});} \ No newline at end of file +var _0xa8b2=['FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x36ea36,_0x544f2a){var _0x419659=function(_0x43a55e){while(--_0x43a55e){_0x36ea36['push'](_0x36ea36['shift']());}};_0x419659(++_0x544f2a);}(_0xa8b2,0x6e));var _0x2a8b=function(_0x26a4ba,_0x3fa856){_0x26a4ba=_0x26a4ba-0x0;var _0x244518=_0xa8b2[_0x26a4ba];return _0x244518;};'use strict';var _=require(_0x2a8b('0x0'));var util=require(_0x2a8b('0x1'));var moment=require('moment');var BPromise=require(_0x2a8b('0x2'));var rs=require(_0x2a8b('0x3'));var fs=require('fs');var Redis=require(_0x2a8b('0x4'));var db=require(_0x2a8b('0x5'))['db'];var utils=require(_0x2a8b('0x6'));var logger=require(_0x2a8b('0x7'))('rpc');var config=require(_0x2a8b('0x8'));var jayson=require(_0x2a8b('0x9'));var client=jayson[_0x2a8b('0xa')][_0x2a8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b3da,_0x37dbad,_0x46709d){return new BPromise(function(_0x116eaa,_0x269958){return client['request'](_0x42b3da,_0x46709d)[_0x2a8b('0xc')](function(_0x53b42d){logger[_0x2a8b('0xd')](_0x2a8b('0xe'),_0x37dbad,_0x2a8b('0xf'));logger['debug'](_0x2a8b('0x10'),_0x37dbad,'request\x20sent',JSON['stringify'](_0x53b42d));if(_0x53b42d[_0x2a8b('0x11')]){if(_0x53b42d[_0x2a8b('0x11')]['code']===0x1f4){logger[_0x2a8b('0x11')](_0x2a8b('0xe'),_0x37dbad,_0x53b42d[_0x2a8b('0x11')][_0x2a8b('0x12')]);return _0x269958(_0x53b42d[_0x2a8b('0x11')][_0x2a8b('0x12')]);}logger[_0x2a8b('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x37dbad,_0x53b42d[_0x2a8b('0x11')][_0x2a8b('0x12')]);return _0x116eaa(_0x53b42d[_0x2a8b('0x11')][_0x2a8b('0x12')]);}else{logger['info'](_0x2a8b('0xe'),_0x37dbad,_0x2a8b('0xf'));_0x116eaa(_0x53b42d[_0x2a8b('0x13')][_0x2a8b('0x12')]);}})[_0x2a8b('0x14')](function(_0x1e4dcb){logger[_0x2a8b('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x37dbad,_0x1e4dcb);_0x269958(_0x1e4dcb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 88711f0..1608d45 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 _0x7825=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7825,0x147));var _0x5782=function(_0x2c534a,_0x18a19e){_0x2c534a=_0x2c534a-0x0;var _0x3f5c99=_0x7825[_0x2c534a];return _0x3f5c99;};'use strict';var multer=require(_0x5782('0x0'));var util=require(_0x5782('0x1'));var path=require(_0x5782('0x2'));var timeout=require(_0x5782('0x3'));var express=require(_0x5782('0x4'));var router=express[_0x5782('0x5')]();var fs_extra=require(_0x5782('0x6'));var auth=require(_0x5782('0x7'));var interaction=require(_0x5782('0x8'));var config=require(_0x5782('0x9'));var controller=require('./faxTransferReport.controller');router[_0x5782('0xa')]('/',auth[_0x5782('0xb')](),controller['index']);router[_0x5782('0xa')](_0x5782('0xc'),auth[_0x5782('0xb')](),controller[_0x5782('0xd')]);router['get'](_0x5782('0xe'),auth[_0x5782('0xb')](),controller[_0x5782('0xf')]);router[_0x5782('0x10')]('/',auth[_0x5782('0xb')](),controller[_0x5782('0x11')]);router[_0x5782('0x12')](_0x5782('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5782('0x13')]('/:id',auth[_0x5782('0xb')](),controller['destroy']);module[_0x5782('0x14')]=router; \ No newline at end of file +var _0x365a=['isAuthenticated','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','describe','/:id'];(function(_0x1e5b99,_0x64b0b1){var _0x3dc6ab=function(_0x199d06){while(--_0x199d06){_0x1e5b99['push'](_0x1e5b99['shift']());}};_0x3dc6ab(++_0x64b0b1);}(_0x365a,0x136));var _0xa365=function(_0xf533d3,_0x2d9cb2){_0xf533d3=_0xf533d3-0x0;var _0x560516=_0x365a[_0xf533d3];return _0x560516;};'use strict';var multer=require(_0xa365('0x0'));var util=require('util');var path=require(_0xa365('0x1'));var timeout=require(_0xa365('0x2'));var express=require(_0xa365('0x3'));var router=express[_0xa365('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa365('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa365('0x6'));var controller=require(_0xa365('0x7'));router[_0xa365('0x8')]('/',auth['isAuthenticated'](),controller[_0xa365('0x9')]);router[_0xa365('0x8')](_0xa365('0xa'),auth['isAuthenticated'](),controller[_0xa365('0xb')]);router[_0xa365('0x8')](_0xa365('0xc'),auth[_0xa365('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa365('0xe')]);router[_0xa365('0xf')](_0xa365('0xc'),auth[_0xa365('0xd')](),controller[_0xa365('0x10')]);router['delete']('/:id',auth[_0xa365('0xd')](),controller[_0xa365('0x11')]);module[_0xa365('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index d9598c2..df73a04 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 _0xe284=['express','Router','fs-extra','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5981f0,_0x5ea307){var _0x532b20=function(_0x139a81){while(--_0x139a81){_0x5981f0['push'](_0x5981f0['shift']());}};_0x532b20(++_0x5ea307);}(_0xe284,0xfa));var _0x4e28=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0xe284[_0x5ca644];return _0x5c87a2;};'use strict';var multer=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var path=require('path');var timeout=require(_0x4e28('0x2'));var express=require(_0x4e28('0x3'));var router=express[_0x4e28('0x4')]();var fs_extra=require(_0x4e28('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e28('0x6'));router[_0x4e28('0x7')]('/',auth[_0x4e28('0x8')](),controller[_0x4e28('0x9')]);router[_0x4e28('0x7')](_0x4e28('0xa'),auth[_0x4e28('0x8')](),controller[_0x4e28('0xb')]);router['get'](_0x4e28('0xc'),auth[_0x4e28('0x8')](),controller[_0x4e28('0xd')]);router[_0x4e28('0x7')](_0x4e28('0xe'),auth[_0x4e28('0x8')](),controller[_0x4e28('0xf')]);router[_0x4e28('0x10')]('/',auth[_0x4e28('0x8')](),controller[_0x4e28('0x11')]);router[_0x4e28('0x10')](_0x4e28('0xc'),auth[_0x4e28('0x8')](),controller[_0x4e28('0x12')]);router[_0x4e28('0x13')](_0x4e28('0xa'),auth[_0x4e28('0x8')](),controller['update']);router[_0x4e28('0x14')]('/:id',auth[_0x4e28('0x8')](),controller[_0x4e28('0x15')]);module[_0x4e28('0x16')]=router; \ No newline at end of file +var _0xe7f6=['put','/:id','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe7f6,0x118));var _0x6e7f=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0xe7f6[_0xef4cf0];return _0x497ad2;};'use strict';var multer=require(_0x6e7f('0x0'));var util=require('util');var path=require(_0x6e7f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e7f('0x2'));var router=express[_0x6e7f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6e7f('0x4'));var interaction=require(_0x6e7f('0x5'));var config=require(_0x6e7f('0x6'));var controller=require(_0x6e7f('0x7'));router[_0x6e7f('0x8')]('/',auth[_0x6e7f('0x9')](),controller[_0x6e7f('0xa')]);router[_0x6e7f('0x8')]('/:id',auth[_0x6e7f('0x9')](),controller[_0x6e7f('0xb')]);router[_0x6e7f('0x8')](_0x6e7f('0xc'),auth['isAuthenticated'](),controller[_0x6e7f('0xd')]);router[_0x6e7f('0x8')](_0x6e7f('0xe'),auth['isAuthenticated'](),controller[_0x6e7f('0xf')]);router[_0x6e7f('0x10')]('/',auth['isAuthenticated'](),controller[_0x6e7f('0x11')]);router[_0x6e7f('0x10')](_0x6e7f('0xc'),auth[_0x6e7f('0x9')](),controller[_0x6e7f('0x12')]);router[_0x6e7f('0x13')](_0x6e7f('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x6e7f('0x15')](_0x6e7f('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e7f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 539bc99..40f29f5 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 _0x77ba=['STRING','basic','newTab','exports'];(function(_0x48f62a,_0x1b3782){var _0x4ebe15=function(_0x7f7728){while(--_0x7f7728){_0x48f62a['push'](_0x48f62a['shift']());}};_0x4ebe15(++_0x1b3782);}(_0x77ba,0x19f));var _0xa77b=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x77ba[_0x10dc64];return _0x9cf98d;};'use strict';var Sequelize=require('sequelize');module[_0xa77b('0x0')]={'name':{'type':Sequelize[_0xa77b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa77b('0x1')]},'remoteUri':{'type':Sequelize[_0xa77b('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xa77b('0x2')),'defaultValue':_0xa77b('0x2')},'password':{'type':Sequelize[_0xa77b('0x1')]},'consumerKey':{'type':Sequelize[_0xa77b('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa77b('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa77b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xa77b('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2698=['STRING','basic','integrationTab','newTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2698,0x86));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8269('0x0'));module['exports']={'name':{'type':Sequelize[_0x8269('0x1')]},'description':{'type':Sequelize[_0x8269('0x1')]},'username':{'type':Sequelize[_0x8269('0x1')]},'remoteUri':{'type':Sequelize[_0x8269('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x8269('0x2')),'defaultValue':_0x8269('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x8269('0x1')]},'consumerSecret':{'type':Sequelize[_0x8269('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8269('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8269('0x3'),_0x8269('0x4')),'defaultValue':_0x8269('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d3d0fb4..6202f36 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 _0xa774=['find','create','update','body','destroy','getConfigurations','findOne','DeskConfiguration','where','pick','filter','addConfiguration','AccountId','getSubjects','Descriptions','channel','DeskField','Subjects','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','password','toString','_embedded','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','sendStatus','error','name','send','map','DeskAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0xff42c7,_0x1da97f){var _0x36eb2b=function(_0x37056c){while(--_0x37056c){_0xff42c7['push'](_0xff42c7['shift']());}};_0x36eb2b(++_0x1da97f);}(_0xa774,0x1d3));var _0x4a77=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xa774[_0x377a6e];return _0x37f751;};'use strict';var emlformat=require(_0x4a77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a77('0x1'));var moment=require(_0x4a77('0x2'));var BPromise=require(_0x4a77('0x3'));var Mustache=require(_0x4a77('0x4'));var util=require('util');var path=require(_0x4a77('0x5'));var sox=require(_0x4a77('0x6'));var csv=require(_0x4a77('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a77('0x8'));var squel=require(_0x4a77('0x9'));var crypto=require('crypto');var jsforce=require(_0x4a77('0xa'));var deskjs=require(_0x4a77('0xb'));var toCsv=require(_0x4a77('0x7'));var querystring=require(_0x4a77('0xc'));var Papa=require(_0x4a77('0xd'));var Redis=require(_0x4a77('0xe'));var authService=require(_0x4a77('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4a77('0x10'));var hardwareService=require(_0x4a77('0x11'));var logger=require(_0x4a77('0x12'))(_0x4a77('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4a77('0x14'))['db'];var integrations=require(_0x4a77('0x15'));function respondWithStatusCode(_0x4b5d90,_0x1f9439){_0x1f9439=_0x1f9439||0xcc;return function(_0x320642){if(_0x320642){return _0x4b5d90['sendStatus'](_0x1f9439);}return _0x4b5d90['status'](_0x1f9439)[_0x4a77('0x16')]();};}function respondWithResult(_0x44f46f,_0x4165cf){_0x4165cf=_0x4165cf||0xc8;return function(_0x1c754b){if(_0x1c754b){return _0x44f46f[_0x4a77('0x17')](_0x4165cf)[_0x4a77('0x18')](_0x1c754b);}};}function respondWithFilteredResult(_0x569ee2,_0x2e6cdc){return function(_0x4eec62){if(_0x4eec62){var _0x429d45=typeof _0x2e6cdc['offset']===_0x4a77('0x19')&&typeof _0x2e6cdc[_0x4a77('0x1a')]===_0x4a77('0x19');var _0x576269=_0x4eec62[_0x4a77('0x1b')];var _0x3cc461=_0x429d45?0x0:_0x2e6cdc['offset'];var _0x5d0980=_0x429d45?_0x4eec62[_0x4a77('0x1b')]:_0x2e6cdc[_0x4a77('0x1c')]+_0x2e6cdc[_0x4a77('0x1a')];var _0x2817d5;if(_0x5d0980>=_0x576269){_0x5d0980=_0x576269;_0x2817d5=0xc8;}else{_0x2817d5=0xce;}_0x569ee2['status'](_0x2817d5);return _0x569ee2['set'](_0x4a77('0x1d'),_0x3cc461+'-'+_0x5d0980+'/'+_0x576269)['json'](_0x4eec62);}return null;};}function patchUpdates(_0x5f4cd6){return function(_0x3acba3){try{jsonpatch[_0x4a77('0x1e')](_0x3acba3,_0x5f4cd6,!![]);}catch(_0x21778f){return BPromise[_0x4a77('0x1f')](_0x21778f);}return _0x3acba3[_0x4a77('0x20')]();};}function saveUpdates(_0x164705,_0x110564){return function(_0x1ebd4e){if(_0x1ebd4e){return _0x1ebd4e['update'](_0x164705)[_0x4a77('0x21')](function(_0x125249){return _0x125249;});}return null;};}function removeEntity(_0x3b1848,_0x494838){return function(_0x204c69){if(_0x204c69){return _0x204c69['destroy']()[_0x4a77('0x21')](function(){_0x3b1848[_0x4a77('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f14f2,_0x2b74d0){return function(_0x463554){if(!_0x463554){_0x2f14f2[_0x4a77('0x22')](0x194);}return _0x463554;};}function handleError(_0x917e6d,_0x19bb57){_0x19bb57=_0x19bb57||0x1f4;return function(_0x4ad4ac){logger[_0x4a77('0x23')](_0x4ad4ac['stack']);if(_0x4ad4ac['name']){delete _0x4ad4ac[_0x4a77('0x24')];}_0x917e6d['status'](_0x19bb57)[_0x4a77('0x25')](_0x4ad4ac);};}exports['index']=function(_0x58ae40,_0x538fab){var _0x38f20d={},_0x20ee7f={},_0x4e4f5f={'count':0x0,'rows':[]};var _0x2513ee=_[_0x4a77('0x26')](db[_0x4a77('0x27')][_0x4a77('0x28')],function(_0x3c38c4){return{'name':_0x3c38c4['fieldName'],'type':_0x3c38c4[_0x4a77('0x29')]['key']};});_0x20ee7f[_0x4a77('0x2a')]=_[_0x4a77('0x26')](_0x2513ee,_0x4a77('0x24'));_0x20ee7f[_0x4a77('0x2b')]=_[_0x4a77('0x2c')](_0x58ae40[_0x4a77('0x2b')]);_0x20ee7f['filters']=_['intersection'](_0x20ee7f[_0x4a77('0x2a')],_0x20ee7f[_0x4a77('0x2b')]);_0x38f20d[_0x4a77('0x2d')]=_[_0x4a77('0x2e')](_0x20ee7f[_0x4a77('0x2a')],qs['fields'](_0x58ae40[_0x4a77('0x2b')][_0x4a77('0x2f')]));_0x38f20d[_0x4a77('0x2d')]=_0x38f20d[_0x4a77('0x2d')][_0x4a77('0x30')]?_0x38f20d['attributes']:_0x20ee7f[_0x4a77('0x2a')];if(!_0x58ae40[_0x4a77('0x2b')][_0x4a77('0x31')](_0x4a77('0x32'))){_0x38f20d[_0x4a77('0x1a')]=qs[_0x4a77('0x1a')](_0x58ae40[_0x4a77('0x2b')]['limit']);_0x38f20d[_0x4a77('0x1c')]=qs[_0x4a77('0x1c')](_0x58ae40[_0x4a77('0x2b')][_0x4a77('0x1c')]);}_0x38f20d[_0x4a77('0x33')]=qs[_0x4a77('0x34')](_0x58ae40[_0x4a77('0x2b')]['sort']);_0x38f20d['where']=qs[_0x4a77('0x35')](_['pick'](_0x58ae40[_0x4a77('0x2b')],_0x20ee7f[_0x4a77('0x35')]),_0x2513ee);if(_0x58ae40['query']['filter']){_0x38f20d['where']=_[_0x4a77('0x36')](_0x38f20d['where'],{'$or':_['map'](_0x2513ee,function(_0x94b858){if(_0x94b858[_0x4a77('0x29')]!==_0x4a77('0x37')){var _0x2d1b6f={};_0x2d1b6f[_0x94b858['name']]={'$like':'%'+_0x58ae40[_0x4a77('0x2b')]['filter']+'%'};return _0x2d1b6f;}})});}_0x38f20d=_[_0x4a77('0x36')]({},_0x38f20d,_0x58ae40[_0x4a77('0x38')]);var _0x53c174={'where':_0x38f20d['where']};return db['DeskAccount'][_0x4a77('0x1b')](_0x53c174)[_0x4a77('0x21')](function(_0x372529){_0x4e4f5f[_0x4a77('0x1b')]=_0x372529;if(_0x58ae40[_0x4a77('0x2b')][_0x4a77('0x39')]){_0x38f20d[_0x4a77('0x3a')]=[{'all':!![]}];}return db['DeskAccount'][_0x4a77('0x3b')](_0x38f20d);})[_0x4a77('0x21')](function(_0x2b9c75){_0x4e4f5f[_0x4a77('0x3c')]=_0x2b9c75;return _0x4e4f5f;})[_0x4a77('0x21')](respondWithFilteredResult(_0x538fab,_0x38f20d))[_0x4a77('0x3d')](handleError(_0x538fab,null));};exports['show']=function(_0x3095af,_0x64f354){var _0x5aa78a={'raw':![],'where':{'id':_0x3095af[_0x4a77('0x3e')]['id']}},_0x12b202={};_0x12b202[_0x4a77('0x2a')]=_[_0x4a77('0x2c')](db[_0x4a77('0x27')]['rawAttributes']);_0x12b202[_0x4a77('0x2b')]=_[_0x4a77('0x2c')](_0x3095af[_0x4a77('0x2b')]);_0x12b202[_0x4a77('0x35')]=_[_0x4a77('0x2e')](_0x12b202['model'],_0x12b202[_0x4a77('0x2b')]);_0x5aa78a[_0x4a77('0x2d')]=_['intersection'](_0x12b202[_0x4a77('0x2a')],qs[_0x4a77('0x2f')](_0x3095af[_0x4a77('0x2b')][_0x4a77('0x2f')]));_0x5aa78a['attributes']=_0x5aa78a[_0x4a77('0x2d')][_0x4a77('0x30')]?_0x5aa78a[_0x4a77('0x2d')]:_0x12b202[_0x4a77('0x2a')];if(_0x3095af[_0x4a77('0x2b')][_0x4a77('0x39')]){_0x5aa78a[_0x4a77('0x3a')]=[{'all':!![]}];}_0x5aa78a=_[_0x4a77('0x36')]({},_0x5aa78a,_0x3095af[_0x4a77('0x38')]);return db['DeskAccount'][_0x4a77('0x3f')](_0x5aa78a)[_0x4a77('0x21')](handleEntityNotFound(_0x64f354,null))[_0x4a77('0x21')](respondWithResult(_0x64f354,null))[_0x4a77('0x3d')](handleError(_0x64f354,null));};exports['create']=function(_0x4489c4,_0x112bc1){return db[_0x4a77('0x27')][_0x4a77('0x40')](_0x4489c4['body'],{})[_0x4a77('0x21')](respondWithResult(_0x112bc1,0xc9))[_0x4a77('0x3d')](handleError(_0x112bc1,null));};exports[_0x4a77('0x41')]=function(_0x18365d,_0x1a0999){if(_0x18365d[_0x4a77('0x42')]['id']){delete _0x18365d[_0x4a77('0x42')]['id'];}return db[_0x4a77('0x27')]['find']({'where':{'id':_0x18365d[_0x4a77('0x3e')]['id']}})[_0x4a77('0x21')](handleEntityNotFound(_0x1a0999,null))[_0x4a77('0x21')](saveUpdates(_0x18365d['body'],null))[_0x4a77('0x21')](respondWithResult(_0x1a0999,null))[_0x4a77('0x3d')](handleError(_0x1a0999,null));};exports[_0x4a77('0x43')]=function(_0x518928,_0x247d04){return db['DeskAccount'][_0x4a77('0x3f')]({'where':{'id':_0x518928[_0x4a77('0x3e')]['id']}})[_0x4a77('0x21')](handleEntityNotFound(_0x247d04,null))[_0x4a77('0x21')](removeEntity(_0x247d04,null))[_0x4a77('0x3d')](handleError(_0x247d04,null));};exports[_0x4a77('0x44')]=function(_0x953df,_0x104e90,_0x1e3989){var _0x396771={};var _0x331dc5={};var _0x15c4b9;var _0x331652;return db[_0x4a77('0x27')][_0x4a77('0x45')]({'where':{'id':_0x953df[_0x4a77('0x3e')]['id']}})[_0x4a77('0x21')](handleEntityNotFound(_0x104e90,null))['then'](function(_0x1cccfa){if(_0x1cccfa){_0x15c4b9=_0x1cccfa;_0x331dc5[_0x4a77('0x2a')]=_[_0x4a77('0x2c')](db[_0x4a77('0x46')][_0x4a77('0x28')]);_0x331dc5[_0x4a77('0x2b')]=_['keys'](_0x953df['query']);_0x331dc5[_0x4a77('0x35')]=_['intersection'](_0x331dc5[_0x4a77('0x2a')],_0x331dc5[_0x4a77('0x2b')]);_0x396771[_0x4a77('0x2d')]=_['intersection'](_0x331dc5[_0x4a77('0x2a')],qs['fields'](_0x953df['query']['fields']));_0x396771['attributes']=_0x396771[_0x4a77('0x2d')][_0x4a77('0x30')]?_0x396771[_0x4a77('0x2d')]:_0x331dc5[_0x4a77('0x2a')];_0x396771[_0x4a77('0x33')]=qs[_0x4a77('0x34')](_0x953df[_0x4a77('0x2b')][_0x4a77('0x34')]);_0x396771[_0x4a77('0x47')]=qs[_0x4a77('0x35')](_[_0x4a77('0x48')](_0x953df[_0x4a77('0x2b')],_0x331dc5[_0x4a77('0x35')]));if(_0x953df[_0x4a77('0x2b')][_0x4a77('0x49')]){_0x396771[_0x4a77('0x47')]=_[_0x4a77('0x36')](_0x396771[_0x4a77('0x47')],{'$or':_[_0x4a77('0x26')](_0x396771[_0x4a77('0x2d')],function(_0x468270){var _0x26d0ea={};_0x26d0ea[_0x468270]={'$like':'%'+_0x953df[_0x4a77('0x2b')][_0x4a77('0x49')]+'%'};return _0x26d0ea;})});}_0x396771=_[_0x4a77('0x36')]({},_0x396771,_0x953df[_0x4a77('0x38')]);return _0x15c4b9[_0x4a77('0x44')](_0x396771);}})['then'](function(_0x4106c0){if(_0x4106c0){_0x331652=_0x4106c0[_0x4a77('0x30')];if(!_0x953df[_0x4a77('0x2b')][_0x4a77('0x31')](_0x4a77('0x32'))){_0x396771[_0x4a77('0x1a')]=qs[_0x4a77('0x1a')](_0x953df[_0x4a77('0x2b')][_0x4a77('0x1a')]);_0x396771[_0x4a77('0x1c')]=qs[_0x4a77('0x1c')](_0x953df[_0x4a77('0x2b')][_0x4a77('0x1c')]);}return _0x15c4b9[_0x4a77('0x44')](_0x396771);}})[_0x4a77('0x21')](function(_0x3ac2fc){if(_0x3ac2fc){return _0x3ac2fc?{'count':_0x331652,'rows':_0x3ac2fc}:null;}})[_0x4a77('0x21')](respondWithResult(_0x104e90,null))[_0x4a77('0x3d')](handleError(_0x104e90,null));};exports[_0x4a77('0x4a')]=function(_0x58de33,_0x561513,_0x526705){if(_0x58de33[_0x4a77('0x42')]['id']){delete _0x58de33[_0x4a77('0x42')]['id'];}return db[_0x4a77('0x27')][_0x4a77('0x45')]({'where':{'id':_0x58de33[_0x4a77('0x3e')]['id']}})['then'](handleEntityNotFound(_0x561513,null))[_0x4a77('0x21')](function(_0x2866fd){if(_0x2866fd){_0x58de33[_0x4a77('0x42')][_0x4a77('0x4b')]=_0x2866fd['id'];_0x58de33['body']['Subjects']=integrations[_0x4a77('0x4c')](_0x58de33[_0x4a77('0x42')]['channel'],_0x58de33[_0x4a77('0x42')][_0x4a77('0x29')]);_0x58de33[_0x4a77('0x42')][_0x4a77('0x4d')]=integrations['getDescriptions'](_0x58de33[_0x4a77('0x42')][_0x4a77('0x4e')],_0x58de33[_0x4a77('0x42')]['type']);return db[_0x4a77('0x46')]['create'](_0x58de33[_0x4a77('0x42')],{'include':[{'model':db[_0x4a77('0x4f')],'as':_0x4a77('0x50')},{'model':db['DeskField'],'as':_0x4a77('0x4d')}]});}return null;})[_0x4a77('0x21')](respondWithResult(_0x561513,null))[_0x4a77('0x3d')](handleError(_0x561513,null));};exports[_0x4a77('0x51')]=function(_0x44e66c,_0x277f41,_0x1b4eb8){var _0x25d7d2=[{'name':_0x4a77('0x52'),'label':_0x4a77('0x52'),'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 _0x3a6b91='';return db[_0x4a77('0x27')][_0x4a77('0x45')]({'where':{'id':_0x44e66c[_0x4a77('0x3e')]['id']},'attributes':['id',_0x4a77('0x53'),_0x4a77('0x54'),_0x4a77('0x55'),'password',_0x4a77('0x56'),_0x4a77('0x57'),_0x4a77('0x58'),_0x4a77('0x59')]})['then'](handleEntityNotFound(_0x277f41,null))['then'](function(_0x28c15e){if(_0x28c15e){_0x3a6b91=_0x28c15e['remoteUri'];var _0x4cfa46=_0x3a6b91[_0x4a77('0x5a')](-0x1);if(_0x4cfa46==='/'){_0x3a6b91=_0x3a6b91[_0x4a77('0x5b')](0x0,_0x3a6b91['lastIndexOf'](_0x4cfa46));}var _0x437cae={'method':_0x4a77('0x5c'),'uri':util[_0x4a77('0x5d')]('%s/custom_fields',_0x3a6b91),'headers':{'Content-Type':'application/json','Accept':_0x4a77('0x5e')},'json':!![]};if(_0x28c15e[_0x4a77('0x54')]===_0x4a77('0x5f')){_0x437cae['headers'][_0x4a77('0x60')]=util[_0x4a77('0x5d')](_0x4a77('0x61'),new Buffer(util[_0x4a77('0x5d')](_0x4a77('0x62'),_0x28c15e[_0x4a77('0x55')],_0x28c15e[_0x4a77('0x63')]))[_0x4a77('0x64')]('base64'));}return rp(_0x437cae)[_0x4a77('0x21')](function(_0x43100d){return _0x25d7d2['concat'](_['map'](_0x43100d[_0x4a77('0x65')]['entries'],function(_0x45cd0c){return{'id':_0x45cd0c[_0x4a77('0x24')],'name':_0x45cd0c[_0x4a77('0x24')],'type':_0x45cd0c[_0x4a77('0x29')],'active':_0x45cd0c['active'],'label':_0x45cd0c['label'],'custom':!![]};}));});}})[_0x4a77('0x21')](function(_0x1bd516){return{'count':_0x1bd516[_0x4a77('0x30')],'rows':_0x1bd516};})['then'](respondWithResult(_0x277f41,null))['catch'](function(_0x513a88){var _0x1b11f2=_0x44e66c['query']['test']?0x1f4:_0x513a88[_0x4a77('0x66')]||0x1f4;logger['error'](_0x4a77('0x67'),_0x4a77('0x51'),_0x1b11f2,JSON['stringify'](_0x513a88));delete _0x513a88['name'];if(_0x1b11f2===0x191){_0x1b11f2=0x190;}_0x277f41[_0x4a77('0x17')](_0x1b11f2)[_0x4a77('0x25')](_0x44e66c[_0x4a77('0x2b')][_0x4a77('0x68')]?{'message':_0x4a77('0x69'),'statusCode':_0x513a88[_0x4a77('0x66')]}:_0x513a88);});}; \ No newline at end of file +var _0x0bbe=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','limit','undefined','count','offset','status','Content-Range','apply','reject','save','update','destroy','error','stack','send','index','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','DeskAccount','then','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','findOne','DeskConfiguration','getConfigurations','nolimit','addConfiguration','channel','Descriptions','getDescriptions','DeskField','Subjects','priority','remoteUri','authType','consumerKey','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','password','base64','concat','_embedded','entries','active','label','statusCode','getFields','stringify','Wrong\x20credentials'];(function(_0x16581f,_0x45ac48){var _0x2cc7e5=function(_0x1801f5){while(--_0x1801f5){_0x16581f['push'](_0x16581f['shift']());}};_0x2cc7e5(++_0x45ac48);}(_0x0bbe,0x1d0));var _0xe0bb=function(_0x2b1c26,_0x16e0e6){_0x2b1c26=_0x2b1c26-0x0;var _0x14df9e=_0x0bbe[_0x2b1c26];return _0x14df9e;};'use strict';var emlformat=require(_0xe0bb('0x0'));var rimraf=require(_0xe0bb('0x1'));var zipdir=require(_0xe0bb('0x2'));var jsonpatch=require(_0xe0bb('0x3'));var rp=require(_0xe0bb('0x4'));var moment=require(_0xe0bb('0x5'));var BPromise=require(_0xe0bb('0x6'));var Mustache=require(_0xe0bb('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe0bb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0bb('0x9'));var _=require(_0xe0bb('0xa'));var squel=require(_0xe0bb('0xb'));var crypto=require(_0xe0bb('0xc'));var jsforce=require(_0xe0bb('0xd'));var deskjs=require(_0xe0bb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe0bb('0xf'));var Papa=require(_0xe0bb('0x10'));var Redis=require('ioredis');var authService=require(_0xe0bb('0x11'));var qs=require(_0xe0bb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bb('0x13'));var logger=require(_0xe0bb('0x14'))(_0xe0bb('0x15'));var utils=require(_0xe0bb('0x16'));var config=require(_0xe0bb('0x17'));var licenseUtil=require(_0xe0bb('0x18'));var db=require(_0xe0bb('0x19'))['db'];var integrations=require(_0xe0bb('0x1a'));function respondWithStatusCode(_0x1db497,_0x1c006e){_0x1c006e=_0x1c006e||0xcc;return function(_0x178cee){if(_0x178cee){return _0x1db497[_0xe0bb('0x1b')](_0x1c006e);}return _0x1db497['status'](_0x1c006e)[_0xe0bb('0x1c')]();};}function respondWithResult(_0xbd7108,_0x4b4391){_0x4b4391=_0x4b4391||0xc8;return function(_0x40200f){if(_0x40200f){return _0xbd7108['status'](_0x4b4391)[_0xe0bb('0x1d')](_0x40200f);}};}function respondWithFilteredResult(_0x12be54,_0x219a53){return function(_0x1439ba){if(_0x1439ba){var _0x3e52ff=typeof _0x219a53['offset']==='undefined'&&typeof _0x219a53[_0xe0bb('0x1e')]===_0xe0bb('0x1f');var _0x2cb55a=_0x1439ba[_0xe0bb('0x20')];var _0x3cd9cc=_0x3e52ff?0x0:_0x219a53['offset'];var _0x62c4cf=_0x3e52ff?_0x1439ba['count']:_0x219a53[_0xe0bb('0x21')]+_0x219a53[_0xe0bb('0x1e')];var _0x270d70;if(_0x62c4cf>=_0x2cb55a){_0x62c4cf=_0x2cb55a;_0x270d70=0xc8;}else{_0x270d70=0xce;}_0x12be54[_0xe0bb('0x22')](_0x270d70);return _0x12be54['set'](_0xe0bb('0x23'),_0x3cd9cc+'-'+_0x62c4cf+'/'+_0x2cb55a)[_0xe0bb('0x1d')](_0x1439ba);}return null;};}function patchUpdates(_0x293dec){return function(_0x491e25){try{jsonpatch[_0xe0bb('0x24')](_0x491e25,_0x293dec,!![]);}catch(_0x2f9514){return BPromise[_0xe0bb('0x25')](_0x2f9514);}return _0x491e25[_0xe0bb('0x26')]();};}function saveUpdates(_0x2e4fd8,_0x460fab){return function(_0x11ffb3){if(_0x11ffb3){return _0x11ffb3[_0xe0bb('0x27')](_0x2e4fd8)['then'](function(_0x93c995){return _0x93c995;});}return null;};}function removeEntity(_0x54063a,_0x264c9b){return function(_0x2e959c){if(_0x2e959c){return _0x2e959c[_0xe0bb('0x28')]()['then'](function(){_0x54063a[_0xe0bb('0x22')](0xcc)[_0xe0bb('0x1c')]();});}};}function handleEntityNotFound(_0x4c5714,_0x3b6091){return function(_0x205128){if(!_0x205128){_0x4c5714[_0xe0bb('0x1b')](0x194);}return _0x205128;};}function handleError(_0x8d85a7,_0x364f89){_0x364f89=_0x364f89||0x1f4;return function(_0x242964){logger[_0xe0bb('0x29')](_0x242964[_0xe0bb('0x2a')]);if(_0x242964['name']){delete _0x242964['name'];}_0x8d85a7[_0xe0bb('0x22')](_0x364f89)[_0xe0bb('0x2b')](_0x242964);};}exports[_0xe0bb('0x2c')]=function(_0x5c74a5,_0x465867){var _0x441b64={},_0x16c204={},_0x2cad3d={'count':0x0,'rows':[]};var _0x7d78ab=_['map'](db['DeskAccount'][_0xe0bb('0x2d')],function(_0x10f9a4){return{'name':_0x10f9a4[_0xe0bb('0x2e')],'type':_0x10f9a4[_0xe0bb('0x2f')][_0xe0bb('0x30')]};});_0x16c204[_0xe0bb('0x31')]=_[_0xe0bb('0x32')](_0x7d78ab,_0xe0bb('0x33'));_0x16c204[_0xe0bb('0x34')]=_['keys'](_0x5c74a5['query']);_0x16c204[_0xe0bb('0x35')]=_[_0xe0bb('0x36')](_0x16c204[_0xe0bb('0x31')],_0x16c204['query']);_0x441b64[_0xe0bb('0x37')]=_[_0xe0bb('0x36')](_0x16c204['model'],qs[_0xe0bb('0x38')](_0x5c74a5[_0xe0bb('0x34')][_0xe0bb('0x38')]));_0x441b64[_0xe0bb('0x37')]=_0x441b64[_0xe0bb('0x37')][_0xe0bb('0x39')]?_0x441b64[_0xe0bb('0x37')]:_0x16c204[_0xe0bb('0x31')];if(!_0x5c74a5['query'][_0xe0bb('0x3a')]('nolimit')){_0x441b64[_0xe0bb('0x1e')]=qs[_0xe0bb('0x1e')](_0x5c74a5[_0xe0bb('0x34')][_0xe0bb('0x1e')]);_0x441b64['offset']=qs[_0xe0bb('0x21')](_0x5c74a5[_0xe0bb('0x34')][_0xe0bb('0x21')]);}_0x441b64[_0xe0bb('0x3b')]=qs['sort'](_0x5c74a5[_0xe0bb('0x34')][_0xe0bb('0x3c')]);_0x441b64['where']=qs['filters'](_[_0xe0bb('0x3d')](_0x5c74a5[_0xe0bb('0x34')],_0x16c204[_0xe0bb('0x35')]),_0x7d78ab);if(_0x5c74a5['query'][_0xe0bb('0x3e')]){_0x441b64[_0xe0bb('0x3f')]=_[_0xe0bb('0x40')](_0x441b64['where'],{'$or':_[_0xe0bb('0x32')](_0x7d78ab,function(_0x1d72a2){if(_0x1d72a2[_0xe0bb('0x2f')]!==_0xe0bb('0x41')){var _0x14efd8={};_0x14efd8[_0x1d72a2[_0xe0bb('0x33')]]={'$like':'%'+_0x5c74a5[_0xe0bb('0x34')][_0xe0bb('0x3e')]+'%'};return _0x14efd8;}})});}_0x441b64=_[_0xe0bb('0x40')]({},_0x441b64,_0x5c74a5['options']);var _0xc30175={'where':_0x441b64['where']};return db[_0xe0bb('0x42')]['count'](_0xc30175)[_0xe0bb('0x43')](function(_0x375405){_0x2cad3d[_0xe0bb('0x20')]=_0x375405;if(_0x5c74a5['query'][_0xe0bb('0x44')]){_0x441b64[_0xe0bb('0x45')]=[{'all':!![]}];}return db[_0xe0bb('0x42')][_0xe0bb('0x46')](_0x441b64);})[_0xe0bb('0x43')](function(_0x277ff5){_0x2cad3d[_0xe0bb('0x47')]=_0x277ff5;return _0x2cad3d;})[_0xe0bb('0x43')](respondWithFilteredResult(_0x465867,_0x441b64))[_0xe0bb('0x48')](handleError(_0x465867,null));};exports[_0xe0bb('0x49')]=function(_0x44ffef,_0x1d9ea6){var _0x915848={'raw':![],'where':{'id':_0x44ffef[_0xe0bb('0x4a')]['id']}},_0x54e3b6={};_0x54e3b6['model']=_[_0xe0bb('0x4b')](db[_0xe0bb('0x42')][_0xe0bb('0x2d')]);_0x54e3b6[_0xe0bb('0x34')]=_['keys'](_0x44ffef['query']);_0x54e3b6[_0xe0bb('0x35')]=_['intersection'](_0x54e3b6[_0xe0bb('0x31')],_0x54e3b6['query']);_0x915848['attributes']=_[_0xe0bb('0x36')](_0x54e3b6[_0xe0bb('0x31')],qs['fields'](_0x44ffef[_0xe0bb('0x34')][_0xe0bb('0x38')]));_0x915848['attributes']=_0x915848[_0xe0bb('0x37')][_0xe0bb('0x39')]?_0x915848[_0xe0bb('0x37')]:_0x54e3b6['model'];if(_0x44ffef[_0xe0bb('0x34')]['includeAll']){_0x915848[_0xe0bb('0x45')]=[{'all':!![]}];}_0x915848=_[_0xe0bb('0x40')]({},_0x915848,_0x44ffef[_0xe0bb('0x4c')]);return db[_0xe0bb('0x42')][_0xe0bb('0x4d')](_0x915848)['then'](handleEntityNotFound(_0x1d9ea6,null))[_0xe0bb('0x43')](respondWithResult(_0x1d9ea6,null))[_0xe0bb('0x48')](handleError(_0x1d9ea6,null));};exports[_0xe0bb('0x4e')]=function(_0x599b49,_0x11108b){return db[_0xe0bb('0x42')][_0xe0bb('0x4e')](_0x599b49['body'],{})[_0xe0bb('0x43')](respondWithResult(_0x11108b,0xc9))[_0xe0bb('0x48')](handleError(_0x11108b,null));};exports[_0xe0bb('0x27')]=function(_0x40d733,_0x25a663){if(_0x40d733[_0xe0bb('0x4f')]['id']){delete _0x40d733[_0xe0bb('0x4f')]['id'];}return db[_0xe0bb('0x42')][_0xe0bb('0x4d')]({'where':{'id':_0x40d733[_0xe0bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25a663,null))['then'](saveUpdates(_0x40d733['body'],null))[_0xe0bb('0x43')](respondWithResult(_0x25a663,null))['catch'](handleError(_0x25a663,null));};exports[_0xe0bb('0x28')]=function(_0x4dfa09,_0x225a71){return db['DeskAccount']['find']({'where':{'id':_0x4dfa09[_0xe0bb('0x4a')]['id']}})[_0xe0bb('0x43')](handleEntityNotFound(_0x225a71,null))['then'](removeEntity(_0x225a71,null))['catch'](handleError(_0x225a71,null));};exports['getConfigurations']=function(_0x2bea2e,_0x581a8d,_0x3b1649){var _0x51a2a1={};var _0x2c0600={};var _0x246611;var _0x10faaf;return db[_0xe0bb('0x42')][_0xe0bb('0x50')]({'where':{'id':_0x2bea2e['params']['id']}})[_0xe0bb('0x43')](handleEntityNotFound(_0x581a8d,null))[_0xe0bb('0x43')](function(_0x45b215){if(_0x45b215){_0x246611=_0x45b215;_0x2c0600[_0xe0bb('0x31')]=_[_0xe0bb('0x4b')](db[_0xe0bb('0x51')][_0xe0bb('0x2d')]);_0x2c0600['query']=_[_0xe0bb('0x4b')](_0x2bea2e[_0xe0bb('0x34')]);_0x2c0600['filters']=_['intersection'](_0x2c0600[_0xe0bb('0x31')],_0x2c0600[_0xe0bb('0x34')]);_0x51a2a1[_0xe0bb('0x37')]=_[_0xe0bb('0x36')](_0x2c0600['model'],qs[_0xe0bb('0x38')](_0x2bea2e['query'][_0xe0bb('0x38')]));_0x51a2a1['attributes']=_0x51a2a1[_0xe0bb('0x37')][_0xe0bb('0x39')]?_0x51a2a1[_0xe0bb('0x37')]:_0x2c0600[_0xe0bb('0x31')];_0x51a2a1[_0xe0bb('0x3b')]=qs[_0xe0bb('0x3c')](_0x2bea2e[_0xe0bb('0x34')][_0xe0bb('0x3c')]);_0x51a2a1[_0xe0bb('0x3f')]=qs[_0xe0bb('0x35')](_[_0xe0bb('0x3d')](_0x2bea2e[_0xe0bb('0x34')],_0x2c0600[_0xe0bb('0x35')]));if(_0x2bea2e[_0xe0bb('0x34')][_0xe0bb('0x3e')]){_0x51a2a1[_0xe0bb('0x3f')]=_[_0xe0bb('0x40')](_0x51a2a1[_0xe0bb('0x3f')],{'$or':_[_0xe0bb('0x32')](_0x51a2a1[_0xe0bb('0x37')],function(_0x431dff){var _0x17483e={};_0x17483e[_0x431dff]={'$like':'%'+_0x2bea2e[_0xe0bb('0x34')][_0xe0bb('0x3e')]+'%'};return _0x17483e;})});}_0x51a2a1=_[_0xe0bb('0x40')]({},_0x51a2a1,_0x2bea2e[_0xe0bb('0x4c')]);return _0x246611[_0xe0bb('0x52')](_0x51a2a1);}})[_0xe0bb('0x43')](function(_0x146e61){if(_0x146e61){_0x10faaf=_0x146e61[_0xe0bb('0x39')];if(!_0x2bea2e[_0xe0bb('0x34')]['hasOwnProperty'](_0xe0bb('0x53'))){_0x51a2a1[_0xe0bb('0x1e')]=qs['limit'](_0x2bea2e[_0xe0bb('0x34')]['limit']);_0x51a2a1[_0xe0bb('0x21')]=qs[_0xe0bb('0x21')](_0x2bea2e[_0xe0bb('0x34')][_0xe0bb('0x21')]);}return _0x246611[_0xe0bb('0x52')](_0x51a2a1);}})[_0xe0bb('0x43')](function(_0x17ba9c){if(_0x17ba9c){return _0x17ba9c?{'count':_0x10faaf,'rows':_0x17ba9c}:null;}})[_0xe0bb('0x43')](respondWithResult(_0x581a8d,null))[_0xe0bb('0x48')](handleError(_0x581a8d,null));};exports[_0xe0bb('0x54')]=function(_0x390277,_0x121712,_0x301f05){if(_0x390277['body']['id']){delete _0x390277['body']['id'];}return db['DeskAccount'][_0xe0bb('0x50')]({'where':{'id':_0x390277[_0xe0bb('0x4a')]['id']}})[_0xe0bb('0x43')](handleEntityNotFound(_0x121712,null))[_0xe0bb('0x43')](function(_0x5729ce){if(_0x5729ce){_0x390277[_0xe0bb('0x4f')]['AccountId']=_0x5729ce['id'];_0x390277[_0xe0bb('0x4f')]['Subjects']=integrations['getSubjects'](_0x390277[_0xe0bb('0x4f')][_0xe0bb('0x55')],_0x390277['body'][_0xe0bb('0x2f')]);_0x390277[_0xe0bb('0x4f')][_0xe0bb('0x56')]=integrations[_0xe0bb('0x57')](_0x390277[_0xe0bb('0x4f')]['channel'],_0x390277[_0xe0bb('0x4f')][_0xe0bb('0x2f')]);return db[_0xe0bb('0x51')][_0xe0bb('0x4e')](_0x390277[_0xe0bb('0x4f')],{'include':[{'model':db[_0xe0bb('0x58')],'as':_0xe0bb('0x59')},{'model':db[_0xe0bb('0x58')],'as':_0xe0bb('0x56')}]});}return null;})[_0xe0bb('0x43')](respondWithResult(_0x121712,null))[_0xe0bb('0x48')](handleError(_0x121712,null));};exports['getFields']=function(_0x5f2fcb,_0x5c9c23,_0x443213){var _0x440e45=[{'name':_0xe0bb('0x5a'),'label':_0xe0bb('0x5a'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x58731f='';return db['DeskAccount'][_0xe0bb('0x50')]({'where':{'id':_0x5f2fcb[_0xe0bb('0x4a')]['id']},'attributes':['id',_0xe0bb('0x5b'),_0xe0bb('0x5c'),'username','password',_0xe0bb('0x5d'),'consumerSecret',_0xe0bb('0x5e'),_0xe0bb('0x5f')]})['then'](handleEntityNotFound(_0x5c9c23,null))['then'](function(_0x14aa31){if(_0x14aa31){_0x58731f=_0x14aa31[_0xe0bb('0x5b')];var _0x2d6799=_0x58731f[_0xe0bb('0x60')](-0x1);if(_0x2d6799==='/'){_0x58731f=_0x58731f['substring'](0x0,_0x58731f[_0xe0bb('0x61')](_0x2d6799));}var _0x308811={'method':_0xe0bb('0x62'),'uri':util[_0xe0bb('0x63')](_0xe0bb('0x64'),_0x58731f),'headers':{'Content-Type':_0xe0bb('0x65'),'Accept':'application/json'},'json':!![]};if(_0x14aa31['authType']===_0xe0bb('0x66')){_0x308811[_0xe0bb('0x67')]['Authorization']=util[_0xe0bb('0x63')](_0xe0bb('0x68'),new Buffer(util[_0xe0bb('0x63')]('%s:%s',_0x14aa31['username'],_0x14aa31[_0xe0bb('0x69')]))['toString'](_0xe0bb('0x6a')));}return rp(_0x308811)[_0xe0bb('0x43')](function(_0xad5dac){return _0x440e45[_0xe0bb('0x6b')](_[_0xe0bb('0x32')](_0xad5dac[_0xe0bb('0x6c')][_0xe0bb('0x6d')],function(_0x9924ee){return{'id':_0x9924ee[_0xe0bb('0x33')],'name':_0x9924ee['name'],'type':_0x9924ee[_0xe0bb('0x2f')],'active':_0x9924ee[_0xe0bb('0x6e')],'label':_0x9924ee[_0xe0bb('0x6f')],'custom':!![]};}));});}})[_0xe0bb('0x43')](function(_0x4bc91b){return{'count':_0x4bc91b[_0xe0bb('0x39')],'rows':_0x4bc91b};})['then'](respondWithResult(_0x5c9c23,null))[_0xe0bb('0x48')](function(_0x45b55e){var _0x34ab68=_0x5f2fcb[_0xe0bb('0x34')]['test']?0x1f4:_0x45b55e[_0xe0bb('0x70')]||0x1f4;logger[_0xe0bb('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xe0bb('0x71'),_0x34ab68,JSON[_0xe0bb('0x72')](_0x45b55e));delete _0x45b55e['name'];if(_0x34ab68===0x191){_0x34ab68=0x190;}_0x5c9c23['status'](_0x34ab68)[_0xe0bb('0x2b')](_0x5f2fcb[_0xe0bb('0x34')]['test']?{'message':_0xe0bb('0x73'),'statusCode':_0x45b55e['statusCode']}:_0x45b55e);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 32f4d6a..da24bac 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 _0xcace=['request-promise','path','rimraf','../../components/integrations/configuration','exports','DeskAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x44d0ef,_0x3cb88a){var _0x277d42=function(_0x230334){while(--_0x230334){_0x44d0ef['push'](_0x44d0ef['shift']());}};_0x277d42(++_0x3cb88a);}(_0xcace,0x126));var _0xecac=function(_0x184f5f,_0x2034dd){_0x184f5f=_0x184f5f-0x0;var _0x467cd7=_0xcace[_0x184f5f];return _0x467cd7;};'use strict';var _=require(_0xecac('0x0'));var util=require(_0xecac('0x1'));var logger=require(_0xecac('0x2'))(_0xecac('0x3'));var moment=require(_0xecac('0x4'));var BPromise=require(_0xecac('0x5'));var rp=require(_0xecac('0x6'));var fs=require('fs');var path=require(_0xecac('0x7'));var rimraf=require(_0xecac('0x8'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xecac('0x9'));module[_0xecac('0xa')]=function(_0x2b42f4,_0x229f57){return _0x2b42f4['define'](_0xecac('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x453c=['../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x453c,0x112));var _0xc453=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x453c[_0x207811];return _0x170d56;};'use strict';var _=require(_0xc453('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc453('0x1'));var rp=require(_0xc453('0x2'));var fs=require('fs');var path=require(_0xc453('0x3'));var rimraf=require('rimraf');var config=require(_0xc453('0x4'));var attributes=require(_0xc453('0x5'));var integrations=require(_0xc453('0x6'));module[_0xc453('0x7')]=function(_0x19e9f7,_0x42a383){return _0x19e9f7[_0xc453('0x8')]('DeskAccount',attributes,{'tableName':_0xc453('0x9'),'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 9ce13d2..29fbcaf 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 _0xea7c=['ShowDeskAccount','lodash','moment','bluebird','rpc','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','DeskAccount','findAll','options','raw','where','attributes','include','map','model','GetDeskAccount','debug','stringify','find'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0xea7c,0x169));var _0xcea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea7c[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xcea7('0x0'));var util=require('util');var moment=require(_0xcea7('0x1'));var BPromise=require(_0xcea7('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('../../config/logger')(_0xcea7('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcea7('0x4')][_0xcea7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x153f85,_0x562227,_0xe3a66a){return new BPromise(function(_0x2ea9b9,_0x16baba){return client[_0xcea7('0x6')](_0x153f85,_0xe3a66a)[_0xcea7('0x7')](function(_0x1f8378){logger[_0xcea7('0x8')](_0xcea7('0x9'),_0x562227,_0xcea7('0xa'));logger['debug'](_0xcea7('0xb'),_0x562227,_0xcea7('0xa'),JSON['stringify'](_0x1f8378));if(_0x1f8378['error']){if(_0x1f8378[_0xcea7('0xc')][_0xcea7('0xd')]===0x1f4){logger['error'](_0xcea7('0x9'),_0x562227,_0x1f8378['error']['message']);return _0x16baba(_0x1f8378[_0xcea7('0xc')][_0xcea7('0xe')]);}logger[_0xcea7('0xc')]('DeskAccount,\x20%s,\x20%s',_0x562227,_0x1f8378[_0xcea7('0xc')]['message']);return _0x2ea9b9(_0x1f8378[_0xcea7('0xc')][_0xcea7('0xe')]);}else{logger['info'](_0xcea7('0x9'),_0x562227,'request\x20sent');_0x2ea9b9(_0x1f8378['result'][_0xcea7('0xe')]);}})[_0xcea7('0xf')](function(_0x1028f3){logger[_0xcea7('0xc')](_0xcea7('0x9'),_0x562227,_0x1028f3);_0x16baba(_0x1028f3);});});}exports['GetDeskAccount']=function(_0x370981){var _0x2e6abd=this;return new Promise(function(_0x5e199f,_0x214264){return db[_0xcea7('0x10')][_0xcea7('0x11')]({'raw':_0x370981[_0xcea7('0x12')]?_0x370981['options'][_0xcea7('0x13')]===undefined?!![]:![]:!![],'where':_0x370981['options']?_0x370981[_0xcea7('0x12')][_0xcea7('0x14')]||null:null,'attributes':_0x370981[_0xcea7('0x12')]?_0x370981[_0xcea7('0x12')][_0xcea7('0x15')]||null:null,'limit':_0x370981['options']?_0x370981['options']['limit']||null:null,'include':_0x370981['options']?_0x370981[_0xcea7('0x12')][_0xcea7('0x16')]?_[_0xcea7('0x17')](_0x370981[_0xcea7('0x12')][_0xcea7('0x16')],function(_0x4d4c4d){return{'model':db[_0x4d4c4d['model']],'as':_0x4d4c4d['as'],'attributes':_0x4d4c4d[_0xcea7('0x15')],'include':_0x4d4c4d[_0xcea7('0x16')]?_['map'](_0x4d4c4d['include'],function(_0x118041){return{'model':db[_0x118041[_0xcea7('0x18')]],'as':_0x118041['as'],'attributes':_0x118041[_0xcea7('0x15')],'include':_0x118041['include']?_[_0xcea7('0x17')](_0x118041[_0xcea7('0x16')],function(_0x1af469){return{'model':db[_0x1af469['model']],'as':_0x1af469['as'],'attributes':_0x1af469[_0xcea7('0x15')]};}):[]};}):[]};}):[]:[]})[_0xcea7('0x7')](function(_0x26b060){logger[_0xcea7('0x8')](_0xcea7('0x19'),_0x370981);logger[_0xcea7('0x1a')](_0xcea7('0x19'),_0x370981,JSON[_0xcea7('0x1b')](_0x26b060));_0x5e199f(_0x26b060);})[_0xcea7('0xf')](function(_0x35d88b){logger['error'](_0xcea7('0x19'),_0x35d88b['message'],_0x370981);_0x214264(_0x2e6abd[_0xcea7('0xc')](0x1f4,_0x35d88b[_0xcea7('0xe')]));});});};exports['ShowDeskAccount']=function(_0x265160){var _0x571ae6=this;return new Promise(function(_0x543416,_0x120db6){return db[_0xcea7('0x10')][_0xcea7('0x1c')]({'raw':_0x265160[_0xcea7('0x12')]?_0x265160[_0xcea7('0x12')][_0xcea7('0x13')]===undefined?!![]:![]:!![],'where':_0x265160[_0xcea7('0x12')]?_0x265160[_0xcea7('0x12')]['where']||null:null,'attributes':_0x265160['options']?_0x265160[_0xcea7('0x12')][_0xcea7('0x15')]||null:null,'include':_0x265160['options']?_0x265160[_0xcea7('0x12')][_0xcea7('0x16')]?_[_0xcea7('0x17')](_0x265160[_0xcea7('0x12')][_0xcea7('0x16')],function(_0x29bcb6){return{'model':db[_0x29bcb6[_0xcea7('0x18')]],'as':_0x29bcb6['as'],'attributes':_0x29bcb6[_0xcea7('0x15')],'include':_0x29bcb6[_0xcea7('0x16')]?_[_0xcea7('0x17')](_0x29bcb6[_0xcea7('0x16')],function(_0x24f738){return{'model':db[_0x24f738[_0xcea7('0x18')]],'as':_0x24f738['as'],'attributes':_0x24f738[_0xcea7('0x15')],'include':_0x24f738['include']?_['map'](_0x24f738['include'],function(_0x33647f){return{'model':db[_0x33647f['model']],'as':_0x33647f['as'],'attributes':_0x33647f[_0xcea7('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24c092){logger['info'](_0xcea7('0x1d'),_0x265160);logger['debug'](_0xcea7('0x1d'),_0x265160,JSON[_0xcea7('0x1b')](_0x24c092));_0x543416(_0x24c092);})[_0xcea7('0xf')](function(_0x4b5626){logger[_0xcea7('0xc')]('ShowDeskAccount',_0x4b5626[_0xcea7('0xe')],_0x265160);_0x120db6(_0x571ae6[_0xcea7('0xc')](0x1f4,_0x4b5626['message']));});});}; \ No newline at end of file +var _0xb9fe=['util','moment','randomstring','../../config/logger','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','map','include','model','GetDeskAccount','ShowDeskAccount','lodash'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0xb9fe,0x19f));var _0xeb9f=function(_0x3cdfb1,_0x32aefe){_0x3cdfb1=_0x3cdfb1-0x0;var _0x1ce4a0=_0xb9fe[_0x3cdfb1];return _0x1ce4a0;};'use strict';var _=require(_0xeb9f('0x0'));var util=require(_0xeb9f('0x1'));var moment=require(_0xeb9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeb9f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9f('0x5'));var client=jayson[_0xeb9f('0x6')][_0xeb9f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c1681,_0x31659f,_0x47a2ba){return new BPromise(function(_0x9fb844,_0x550c25){return client[_0xeb9f('0x8')](_0x1c1681,_0x47a2ba)[_0xeb9f('0x9')](function(_0xaec675){logger[_0xeb9f('0xa')](_0xeb9f('0xb'),_0x31659f,_0xeb9f('0xc'));logger[_0xeb9f('0xd')](_0xeb9f('0xe'),_0x31659f,_0xeb9f('0xc'),JSON[_0xeb9f('0xf')](_0xaec675));if(_0xaec675[_0xeb9f('0x10')]){if(_0xaec675['error'][_0xeb9f('0x11')]===0x1f4){logger[_0xeb9f('0x10')](_0xeb9f('0xb'),_0x31659f,_0xaec675[_0xeb9f('0x10')][_0xeb9f('0x12')]);return _0x550c25(_0xaec675[_0xeb9f('0x10')][_0xeb9f('0x12')]);}logger[_0xeb9f('0x10')](_0xeb9f('0xb'),_0x31659f,_0xaec675[_0xeb9f('0x10')][_0xeb9f('0x12')]);return _0x9fb844(_0xaec675[_0xeb9f('0x10')][_0xeb9f('0x12')]);}else{logger['info'](_0xeb9f('0xb'),_0x31659f,'request\x20sent');_0x9fb844(_0xaec675[_0xeb9f('0x13')][_0xeb9f('0x12')]);}})[_0xeb9f('0x14')](function(_0x3ed839){logger[_0xeb9f('0x10')](_0xeb9f('0xb'),_0x31659f,_0x3ed839);_0x550c25(_0x3ed839);});});}exports['GetDeskAccount']=function(_0x30af09){var _0x2285bc=this;return new Promise(function(_0x523a55,_0x2635c0){return db[_0xeb9f('0x15')][_0xeb9f('0x16')]({'raw':_0x30af09[_0xeb9f('0x17')]?_0x30af09[_0xeb9f('0x17')][_0xeb9f('0x18')]===undefined?!![]:![]:!![],'where':_0x30af09[_0xeb9f('0x17')]?_0x30af09[_0xeb9f('0x17')][_0xeb9f('0x19')]||null:null,'attributes':_0x30af09['options']?_0x30af09['options'][_0xeb9f('0x1a')]||null:null,'limit':_0x30af09[_0xeb9f('0x17')]?_0x30af09[_0xeb9f('0x17')]['limit']||null:null,'include':_0x30af09['options']?_0x30af09[_0xeb9f('0x17')]['include']?_[_0xeb9f('0x1b')](_0x30af09[_0xeb9f('0x17')][_0xeb9f('0x1c')],function(_0x4a8a6f){return{'model':db[_0x4a8a6f[_0xeb9f('0x1d')]],'as':_0x4a8a6f['as'],'attributes':_0x4a8a6f[_0xeb9f('0x1a')],'include':_0x4a8a6f[_0xeb9f('0x1c')]?_[_0xeb9f('0x1b')](_0x4a8a6f[_0xeb9f('0x1c')],function(_0x25a3a6){return{'model':db[_0x25a3a6[_0xeb9f('0x1d')]],'as':_0x25a3a6['as'],'attributes':_0x25a3a6[_0xeb9f('0x1a')],'include':_0x25a3a6['include']?_[_0xeb9f('0x1b')](_0x25a3a6[_0xeb9f('0x1c')],function(_0x8e367d){return{'model':db[_0x8e367d[_0xeb9f('0x1d')]],'as':_0x8e367d['as'],'attributes':_0x8e367d['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb9f('0x9')](function(_0x414e5c){logger[_0xeb9f('0xa')](_0xeb9f('0x1e'),_0x30af09);logger[_0xeb9f('0xd')](_0xeb9f('0x1e'),_0x30af09,JSON[_0xeb9f('0xf')](_0x414e5c));_0x523a55(_0x414e5c);})[_0xeb9f('0x14')](function(_0x3f74a5){logger[_0xeb9f('0x10')](_0xeb9f('0x1e'),_0x3f74a5[_0xeb9f('0x12')],_0x30af09);_0x2635c0(_0x2285bc['error'](0x1f4,_0x3f74a5[_0xeb9f('0x12')]));});});};exports[_0xeb9f('0x1f')]=function(_0x3e9363){var _0x533543=this;return new Promise(function(_0xf87531,_0x57542a){return db[_0xeb9f('0x15')]['find']({'raw':_0x3e9363[_0xeb9f('0x17')]?_0x3e9363[_0xeb9f('0x17')][_0xeb9f('0x18')]===undefined?!![]:![]:!![],'where':_0x3e9363[_0xeb9f('0x17')]?_0x3e9363['options']['where']||null:null,'attributes':_0x3e9363[_0xeb9f('0x17')]?_0x3e9363[_0xeb9f('0x17')][_0xeb9f('0x1a')]||null:null,'include':_0x3e9363[_0xeb9f('0x17')]?_0x3e9363[_0xeb9f('0x17')]['include']?_[_0xeb9f('0x1b')](_0x3e9363[_0xeb9f('0x17')][_0xeb9f('0x1c')],function(_0x21fa42){return{'model':db[_0x21fa42[_0xeb9f('0x1d')]],'as':_0x21fa42['as'],'attributes':_0x21fa42['attributes'],'include':_0x21fa42[_0xeb9f('0x1c')]?_[_0xeb9f('0x1b')](_0x21fa42[_0xeb9f('0x1c')],function(_0x19e028){return{'model':db[_0x19e028[_0xeb9f('0x1d')]],'as':_0x19e028['as'],'attributes':_0x19e028['attributes'],'include':_0x19e028[_0xeb9f('0x1c')]?_[_0xeb9f('0x1b')](_0x19e028['include'],function(_0x39508a){return{'model':db[_0x39508a['model']],'as':_0x39508a['as'],'attributes':_0x39508a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x232ef9){logger[_0xeb9f('0xa')]('ShowDeskAccount',_0x3e9363);logger['debug'](_0xeb9f('0x1f'),_0x3e9363,JSON[_0xeb9f('0xf')](_0x232ef9));_0xf87531(_0x232ef9);})[_0xeb9f('0x14')](function(_0x37525c){logger['error'](_0xeb9f('0x1f'),_0x37525c[_0xeb9f('0x12')],_0x3e9363);_0x57542a(_0x533543['error'](0x1f4,_0x37525c['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index b4fa1eb..b2d7bc1 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(_0x179971,_0x2df84e){var _0x2d47c3=function(_0x280275){while(--_0x280275){_0x179971['push'](_0x179971['shift']());}};_0x2d47c3(++_0x2df84e);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x3cb054,_0x8d69ce){var _0x5f1582=function(_0x1b5751){while(--_0x1b5751){_0x3cb054['push'](_0x3cb054['shift']());}};_0x5f1582(++_0x8d69ce);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b1a46,_0x41b19d){_0x2b1a46=_0x2b1a46-0x0;var _0x18f777=_0xedd9[_0x2b1a46];return _0x18f777;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4df6e75..7859a52 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 _0xee7b=['STRING','exports'];(function(_0xdde91,_0x3ae43e){var _0x1166d4=function(_0x147ac4){while(--_0x147ac4){_0xdde91['push'](_0xdde91['shift']());}};_0x1166d4(++_0x3ae43e);}(_0xee7b,0x95));var _0xbee7=function(_0x1e8099,_0x32f41f){_0x1e8099=_0x1e8099-0x0;var _0x429c38=_0xee7b[_0x1e8099];return _0x429c38;};'use strict';var Sequelize=require('sequelize');module[_0xbee7('0x0')]={'name':{'type':Sequelize[_0xbee7('0x1')]},'description':{'type':Sequelize[_0xbee7('0x1')]}}; \ No newline at end of file +var _0x4ee5=['sequelize','exports','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4ee5,0xcc));var _0x54ee=function(_0x47badd,_0x3e1bc2){_0x47badd=_0x47badd-0x0;var _0x192af8=_0x4ee5[_0x47badd];return _0x192af8;};'use strict';var Sequelize=require(_0x54ee('0x0'));module[_0x54ee('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x54ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 347af1c..655fefa 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 _0x3c61=['VIRTUAL','DeskConfiguration','includeAll','rows','catch','show','params','length','include','create','body','find','getFields','findOne','DeskField','pick','options','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','json','apply','save','update','destroy','then','status','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x405754,_0x2f76c5){var _0x2a76f6=function(_0x29a203){while(--_0x29a203){_0x405754['push'](_0x405754['shift']());}};_0x2a76f6(++_0x2f76c5);}(_0x3c61,0xb6));var _0x13c6=function(_0x205e85,_0xebc595){_0x205e85=_0x205e85-0x0;var _0x4f0cfb=_0x3c61[_0x205e85];return _0x4f0cfb;};'use strict';var emlformat=require(_0x13c6('0x0'));var rimraf=require(_0x13c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c6('0x2'));var rp=require(_0x13c6('0x3'));var moment=require(_0x13c6('0x4'));var BPromise=require(_0x13c6('0x5'));var Mustache=require(_0x13c6('0x6'));var util=require(_0x13c6('0x7'));var path=require(_0x13c6('0x8'));var sox=require(_0x13c6('0x9'));var csv=require('to-csv');var ejs=require(_0x13c6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13c6('0xb'));var squel=require(_0x13c6('0xc'));var crypto=require(_0x13c6('0xd'));var jsforce=require(_0x13c6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x13c6('0xf'));var Papa=require(_0x13c6('0x10'));var Redis=require('ioredis');var authService=require(_0x13c6('0x11'));var qs=require(_0x13c6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13c6('0x13'));var logger=require(_0x13c6('0x14'))('api');var utils=require(_0x13c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x13c6('0x16'));var db=require(_0x13c6('0x17'))['db'];function respondWithStatusCode(_0x426fa9,_0x211908){_0x211908=_0x211908||0xcc;return function(_0x22f9bc){if(_0x22f9bc){return _0x426fa9[_0x13c6('0x18')](_0x211908);}return _0x426fa9['status'](_0x211908)['end']();};}function respondWithResult(_0x56a3e5,_0x5f271a){_0x5f271a=_0x5f271a||0xc8;return function(_0x226a4c){if(_0x226a4c){return _0x56a3e5['status'](_0x5f271a)['json'](_0x226a4c);}};}function respondWithFilteredResult(_0x28e892,_0x2b4e86){return function(_0x397b47){if(_0x397b47){var _0x4c2bf0=typeof _0x2b4e86[_0x13c6('0x19')]===_0x13c6('0x1a')&&typeof _0x2b4e86[_0x13c6('0x1b')]===_0x13c6('0x1a');var _0x224f4f=_0x397b47[_0x13c6('0x1c')];var _0x595f20=_0x4c2bf0?0x0:_0x2b4e86[_0x13c6('0x19')];var _0x1bbdae=_0x4c2bf0?_0x397b47[_0x13c6('0x1c')]:_0x2b4e86[_0x13c6('0x19')]+_0x2b4e86[_0x13c6('0x1b')];var _0x1d6563;if(_0x1bbdae>=_0x224f4f){_0x1bbdae=_0x224f4f;_0x1d6563=0xc8;}else{_0x1d6563=0xce;}_0x28e892['status'](_0x1d6563);return _0x28e892['set']('Content-Range',_0x595f20+'-'+_0x1bbdae+'/'+_0x224f4f)[_0x13c6('0x1d')](_0x397b47);}return null;};}function patchUpdates(_0x48b3f8){return function(_0x1318ab){try{jsonpatch[_0x13c6('0x1e')](_0x1318ab,_0x48b3f8,!![]);}catch(_0x1f0d82){return BPromise['reject'](_0x1f0d82);}return _0x1318ab[_0x13c6('0x1f')]();};}function saveUpdates(_0x5c47b4,_0x469044){return function(_0x4e3850){if(_0x4e3850){return _0x4e3850[_0x13c6('0x20')](_0x5c47b4)['then'](function(_0x154b45){return _0x154b45;});}return null;};}function removeEntity(_0x3011b3,_0x24cd32){return function(_0x34d104){if(_0x34d104){return _0x34d104[_0x13c6('0x21')]()[_0x13c6('0x22')](function(){_0x3011b3[_0x13c6('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x295ae4,_0x2dd143){return function(_0x4ac81b){if(!_0x4ac81b){_0x295ae4[_0x13c6('0x18')](0x194);}return _0x4ac81b;};}function handleError(_0x161afd,_0x2e0478){_0x2e0478=_0x2e0478||0x1f4;return function(_0x46e5bb){logger[_0x13c6('0x24')](_0x46e5bb[_0x13c6('0x25')]);if(_0x46e5bb[_0x13c6('0x26')]){delete _0x46e5bb[_0x13c6('0x26')];}_0x161afd[_0x13c6('0x23')](_0x2e0478)['send'](_0x46e5bb);};}exports[_0x13c6('0x27')]=function(_0x2f0bc7,_0x4829ac){var _0x280e7f={},_0x22cba5={},_0x15c494={'count':0x0,'rows':[]};var _0x1f269d=_[_0x13c6('0x28')](db['DeskConfiguration'][_0x13c6('0x29')],function(_0x590a81){return{'name':_0x590a81[_0x13c6('0x2a')],'type':_0x590a81[_0x13c6('0x2b')]['key']};});_0x22cba5[_0x13c6('0x2c')]=_['map'](_0x1f269d,_0x13c6('0x26'));_0x22cba5[_0x13c6('0x2d')]=_[_0x13c6('0x2e')](_0x2f0bc7['query']);_0x22cba5[_0x13c6('0x2f')]=_[_0x13c6('0x30')](_0x22cba5['model'],_0x22cba5['query']);_0x280e7f[_0x13c6('0x31')]=_[_0x13c6('0x30')](_0x22cba5[_0x13c6('0x2c')],qs[_0x13c6('0x32')](_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x32')]));_0x280e7f[_0x13c6('0x31')]=_0x280e7f[_0x13c6('0x31')]['length']?_0x280e7f[_0x13c6('0x31')]:_0x22cba5[_0x13c6('0x2c')];if(!_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x33')](_0x13c6('0x34'))){_0x280e7f[_0x13c6('0x1b')]=qs[_0x13c6('0x1b')](_0x2f0bc7[_0x13c6('0x2d')]['limit']);_0x280e7f[_0x13c6('0x19')]=qs[_0x13c6('0x19')](_0x2f0bc7['query'][_0x13c6('0x19')]);}_0x280e7f[_0x13c6('0x35')]=qs[_0x13c6('0x36')](_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x36')]);_0x280e7f[_0x13c6('0x37')]=qs['filters'](_['pick'](_0x2f0bc7[_0x13c6('0x2d')],_0x22cba5['filters']),_0x1f269d);if(_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x38')]){_0x280e7f[_0x13c6('0x37')]=_[_0x13c6('0x39')](_0x280e7f[_0x13c6('0x37')],{'$or':_[_0x13c6('0x28')](_0x1f269d,function(_0x4d5d7c){if(_0x4d5d7c['type']!==_0x13c6('0x3a')){var _0x381ecc={};_0x381ecc[_0x4d5d7c[_0x13c6('0x26')]]={'$like':'%'+_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x38')]+'%'};return _0x381ecc;}})});}_0x280e7f=_[_0x13c6('0x39')]({},_0x280e7f,_0x2f0bc7['options']);var _0x51e1ef={'where':_0x280e7f['where']};return db[_0x13c6('0x3b')][_0x13c6('0x1c')](_0x51e1ef)['then'](function(_0x208ef3){_0x15c494[_0x13c6('0x1c')]=_0x208ef3;if(_0x2f0bc7[_0x13c6('0x2d')][_0x13c6('0x3c')]){_0x280e7f['include']=[{'all':!![]}];}return db[_0x13c6('0x3b')]['findAll'](_0x280e7f);})[_0x13c6('0x22')](function(_0x4ccf92){_0x15c494[_0x13c6('0x3d')]=_0x4ccf92;return _0x15c494;})['then'](respondWithFilteredResult(_0x4829ac,_0x280e7f))[_0x13c6('0x3e')](handleError(_0x4829ac,null));};exports[_0x13c6('0x3f')]=function(_0x5168c7,_0x2da1d8){var _0x1e177d={'raw':![],'where':{'id':_0x5168c7[_0x13c6('0x40')]['id']}},_0x385d81={};_0x385d81[_0x13c6('0x2c')]=_['keys'](db[_0x13c6('0x3b')][_0x13c6('0x29')]);_0x385d81[_0x13c6('0x2d')]=_['keys'](_0x5168c7['query']);_0x385d81[_0x13c6('0x2f')]=_[_0x13c6('0x30')](_0x385d81['model'],_0x385d81['query']);_0x1e177d[_0x13c6('0x31')]=_[_0x13c6('0x30')](_0x385d81['model'],qs[_0x13c6('0x32')](_0x5168c7['query'][_0x13c6('0x32')]));_0x1e177d[_0x13c6('0x31')]=_0x1e177d['attributes'][_0x13c6('0x41')]?_0x1e177d[_0x13c6('0x31')]:_0x385d81['model'];if(_0x5168c7[_0x13c6('0x2d')][_0x13c6('0x3c')]){_0x1e177d[_0x13c6('0x42')]=[{'all':!![]}];}_0x1e177d=_['merge']({},_0x1e177d,_0x5168c7['options']);return db[_0x13c6('0x3b')]['find'](_0x1e177d)[_0x13c6('0x22')](handleEntityNotFound(_0x2da1d8,null))['then'](respondWithResult(_0x2da1d8,null))[_0x13c6('0x3e')](handleError(_0x2da1d8,null));};exports[_0x13c6('0x43')]=function(_0x1a30ea,_0x23bb78){return db[_0x13c6('0x3b')][_0x13c6('0x43')](_0x1a30ea[_0x13c6('0x44')],{})[_0x13c6('0x22')](respondWithResult(_0x23bb78,0xc9))[_0x13c6('0x3e')](handleError(_0x23bb78,null));};exports[_0x13c6('0x20')]=function(_0xb6693e,_0x113537){if(_0xb6693e[_0x13c6('0x44')]['id']){delete _0xb6693e[_0x13c6('0x44')]['id'];}return db[_0x13c6('0x3b')][_0x13c6('0x45')]({'where':{'id':_0xb6693e[_0x13c6('0x40')]['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x113537,null))[_0x13c6('0x22')](saveUpdates(_0xb6693e[_0x13c6('0x44')],null))[_0x13c6('0x22')](respondWithResult(_0x113537,null))[_0x13c6('0x3e')](handleError(_0x113537,null));};exports[_0x13c6('0x21')]=function(_0xc0bc00,_0x51fca4){return db['DeskConfiguration'][_0x13c6('0x45')]({'where':{'id':_0xc0bc00[_0x13c6('0x40')]['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x51fca4,null))['then'](removeEntity(_0x51fca4,null))['catch'](handleError(_0x51fca4,null));};exports[_0x13c6('0x46')]=function(_0xdf46f3,_0x655a11,_0x7c75e1){var _0x7be0c7={};var _0x171d1c={};var _0x2d8d5e;var _0x1f7d51;return db['DeskConfiguration'][_0x13c6('0x47')]({'where':{'id':_0xdf46f3[_0x13c6('0x40')]['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x655a11,null))[_0x13c6('0x22')](function(_0x15e666){if(_0x15e666){_0x2d8d5e=_0x15e666;_0x171d1c[_0x13c6('0x2c')]=_[_0x13c6('0x2e')](db[_0x13c6('0x48')]['rawAttributes']);_0x171d1c[_0x13c6('0x2d')]=_[_0x13c6('0x2e')](_0xdf46f3[_0x13c6('0x2d')]);_0x171d1c[_0x13c6('0x2f')]=_[_0x13c6('0x30')](_0x171d1c['model'],_0x171d1c[_0x13c6('0x2d')]);_0x7be0c7[_0x13c6('0x31')]=_[_0x13c6('0x30')](_0x171d1c[_0x13c6('0x2c')],qs['fields'](_0xdf46f3['query']['fields']));_0x7be0c7['attributes']=_0x7be0c7[_0x13c6('0x31')][_0x13c6('0x41')]?_0x7be0c7[_0x13c6('0x31')]:_0x171d1c[_0x13c6('0x2c')];_0x7be0c7['order']=qs[_0x13c6('0x36')](_0xdf46f3['query']['sort']);_0x7be0c7[_0x13c6('0x37')]=qs['filters'](_[_0x13c6('0x49')](_0xdf46f3[_0x13c6('0x2d')],_0x171d1c[_0x13c6('0x2f')]));if(_0xdf46f3[_0x13c6('0x2d')][_0x13c6('0x38')]){_0x7be0c7[_0x13c6('0x37')]=_[_0x13c6('0x39')](_0x7be0c7[_0x13c6('0x37')],{'$or':_[_0x13c6('0x28')](_0x7be0c7['attributes'],function(_0x38d130){var _0x1c76c7={};_0x1c76c7[_0x38d130]={'$like':'%'+_0xdf46f3[_0x13c6('0x2d')][_0x13c6('0x38')]+'%'};return _0x1c76c7;})});}_0x7be0c7=_[_0x13c6('0x39')]({},_0x7be0c7,_0xdf46f3[_0x13c6('0x4a')]);return _0x2d8d5e[_0x13c6('0x46')](_0x7be0c7);}})[_0x13c6('0x22')](function(_0x3ed282){if(_0x3ed282){_0x1f7d51=_0x3ed282[_0x13c6('0x41')];if(!_0xdf46f3['query'][_0x13c6('0x33')](_0x13c6('0x34'))){_0x7be0c7['limit']=qs[_0x13c6('0x1b')](_0xdf46f3[_0x13c6('0x2d')][_0x13c6('0x1b')]);_0x7be0c7['offset']=qs['offset'](_0xdf46f3[_0x13c6('0x2d')]['offset']);}return _0x2d8d5e[_0x13c6('0x46')](_0x7be0c7);}})[_0x13c6('0x22')](function(_0x17d93c){if(_0x17d93c){return _0x17d93c?{'count':_0x1f7d51,'rows':_0x17d93c}:null;}})[_0x13c6('0x22')](respondWithResult(_0x655a11,null))['catch'](handleError(_0x655a11,null));};exports[_0x13c6('0x4b')]=function(_0x59ec79,_0x4eeda9,_0x41d3ed){var _0x5d0333={};var _0x58e0ee={};var _0x2bc9c8;var _0x432ae2;return db['DeskConfiguration']['findOne']({'where':{'id':_0x59ec79['params']['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x4eeda9,null))['then'](function(_0x1b062c){if(_0x1b062c){_0x2bc9c8=_0x1b062c;_0x58e0ee['model']=_[_0x13c6('0x2e')](db[_0x13c6('0x48')][_0x13c6('0x29')]);_0x58e0ee['query']=_[_0x13c6('0x2e')](_0x59ec79[_0x13c6('0x2d')]);_0x58e0ee[_0x13c6('0x2f')]=_[_0x13c6('0x30')](_0x58e0ee[_0x13c6('0x2c')],_0x58e0ee[_0x13c6('0x2d')]);_0x5d0333[_0x13c6('0x31')]=_[_0x13c6('0x30')](_0x58e0ee['model'],qs[_0x13c6('0x32')](_0x59ec79['query'][_0x13c6('0x32')]));_0x5d0333['attributes']=_0x5d0333[_0x13c6('0x31')][_0x13c6('0x41')]?_0x5d0333[_0x13c6('0x31')]:_0x58e0ee[_0x13c6('0x2c')];_0x5d0333[_0x13c6('0x35')]=qs[_0x13c6('0x36')](_0x59ec79[_0x13c6('0x2d')][_0x13c6('0x36')]);_0x5d0333[_0x13c6('0x37')]=qs[_0x13c6('0x2f')](_[_0x13c6('0x49')](_0x59ec79[_0x13c6('0x2d')],_0x58e0ee[_0x13c6('0x2f')]));if(_0x59ec79[_0x13c6('0x2d')][_0x13c6('0x38')]){_0x5d0333[_0x13c6('0x37')]=_['merge'](_0x5d0333[_0x13c6('0x37')],{'$or':_['map'](_0x5d0333[_0x13c6('0x31')],function(_0xc1273d){var _0x184f29={};_0x184f29[_0xc1273d]={'$like':'%'+_0x59ec79['query'][_0x13c6('0x38')]+'%'};return _0x184f29;})});}_0x5d0333=_['merge']({},_0x5d0333,_0x59ec79[_0x13c6('0x4a')]);return _0x2bc9c8[_0x13c6('0x4b')](_0x5d0333);}})['then'](function(_0x1e910e){if(_0x1e910e){_0x432ae2=_0x1e910e['length'];if(!_0x59ec79[_0x13c6('0x2d')][_0x13c6('0x33')](_0x13c6('0x34'))){_0x5d0333[_0x13c6('0x1b')]=qs['limit'](_0x59ec79['query'][_0x13c6('0x1b')]);_0x5d0333[_0x13c6('0x19')]=qs['offset'](_0x59ec79[_0x13c6('0x2d')]['offset']);}return _0x2bc9c8['getSubjects'](_0x5d0333);}})[_0x13c6('0x22')](function(_0x35729f){if(_0x35729f){return _0x35729f?{'count':_0x432ae2,'rows':_0x35729f}:null;}})['then'](respondWithResult(_0x4eeda9,null))[_0x13c6('0x3e')](handleError(_0x4eeda9,null));};exports['getDescriptions']=function(_0x14d899,_0x3ba370,_0x5434c3){var _0x1fab56={};var _0x5356e0={};var _0x364ac1;var _0x43640e;return db['DeskConfiguration'][_0x13c6('0x47')]({'where':{'id':_0x14d899[_0x13c6('0x40')]['id']}})['then'](handleEntityNotFound(_0x3ba370,null))[_0x13c6('0x22')](function(_0x2ee63b){if(_0x2ee63b){_0x364ac1=_0x2ee63b;_0x5356e0[_0x13c6('0x2c')]=_['keys'](db[_0x13c6('0x48')][_0x13c6('0x29')]);_0x5356e0[_0x13c6('0x2d')]=_[_0x13c6('0x2e')](_0x14d899['query']);_0x5356e0['filters']=_[_0x13c6('0x30')](_0x5356e0[_0x13c6('0x2c')],_0x5356e0[_0x13c6('0x2d')]);_0x1fab56[_0x13c6('0x31')]=_['intersection'](_0x5356e0[_0x13c6('0x2c')],qs['fields'](_0x14d899[_0x13c6('0x2d')][_0x13c6('0x32')]));_0x1fab56[_0x13c6('0x31')]=_0x1fab56[_0x13c6('0x31')]['length']?_0x1fab56[_0x13c6('0x31')]:_0x5356e0[_0x13c6('0x2c')];_0x1fab56[_0x13c6('0x35')]=qs[_0x13c6('0x36')](_0x14d899[_0x13c6('0x2d')][_0x13c6('0x36')]);_0x1fab56[_0x13c6('0x37')]=qs[_0x13c6('0x2f')](_[_0x13c6('0x49')](_0x14d899[_0x13c6('0x2d')],_0x5356e0[_0x13c6('0x2f')]));if(_0x14d899[_0x13c6('0x2d')]['filter']){_0x1fab56['where']=_[_0x13c6('0x39')](_0x1fab56[_0x13c6('0x37')],{'$or':_[_0x13c6('0x28')](_0x1fab56[_0x13c6('0x31')],function(_0x3cc51b){var _0x31d8de={};_0x31d8de[_0x3cc51b]={'$like':'%'+_0x14d899[_0x13c6('0x2d')][_0x13c6('0x38')]+'%'};return _0x31d8de;})});}_0x1fab56=_[_0x13c6('0x39')]({},_0x1fab56,_0x14d899[_0x13c6('0x4a')]);return _0x364ac1[_0x13c6('0x4c')](_0x1fab56);}})['then'](function(_0x1dd5e1){if(_0x1dd5e1){_0x43640e=_0x1dd5e1['length'];if(!_0x14d899[_0x13c6('0x2d')][_0x13c6('0x33')](_0x13c6('0x34'))){_0x1fab56[_0x13c6('0x1b')]=qs[_0x13c6('0x1b')](_0x14d899['query'][_0x13c6('0x1b')]);_0x1fab56[_0x13c6('0x19')]=qs[_0x13c6('0x19')](_0x14d899['query'][_0x13c6('0x19')]);}return _0x364ac1[_0x13c6('0x4c')](_0x1fab56);}})[_0x13c6('0x22')](function(_0x307561){if(_0x307561){return _0x307561?{'count':_0x43640e,'rows':_0x307561}:null;}})[_0x13c6('0x22')](respondWithResult(_0x3ba370,null))['catch'](handleError(_0x3ba370,null));};exports[_0x13c6('0x4d')]=function(_0x3329c5,_0x145282,_0x4aba5a){var _0x46895f={};var _0x5732c0={};var _0x13ed74;var _0x44dd58;return db[_0x13c6('0x3b')]['findOne']({'where':{'id':_0x3329c5['params']['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x145282,null))[_0x13c6('0x22')](function(_0x181162){if(_0x181162){_0x13ed74=_0x181162;_0x5732c0['model']=_['keys'](db[_0x13c6('0x4e')][_0x13c6('0x29')]);_0x5732c0[_0x13c6('0x2d')]=_[_0x13c6('0x2e')](_0x3329c5['query']);_0x5732c0[_0x13c6('0x2f')]=_[_0x13c6('0x30')](_0x5732c0['model'],_0x5732c0[_0x13c6('0x2d')]);_0x46895f['attributes']=_[_0x13c6('0x30')](_0x5732c0[_0x13c6('0x2c')],qs[_0x13c6('0x32')](_0x3329c5[_0x13c6('0x2d')][_0x13c6('0x32')]));_0x46895f[_0x13c6('0x31')]=_0x46895f[_0x13c6('0x31')]['length']?_0x46895f[_0x13c6('0x31')]:_0x5732c0['model'];_0x46895f[_0x13c6('0x35')]=qs[_0x13c6('0x36')](_0x3329c5['query'][_0x13c6('0x36')]);_0x46895f[_0x13c6('0x37')]=qs[_0x13c6('0x2f')](_[_0x13c6('0x49')](_0x3329c5[_0x13c6('0x2d')],_0x5732c0[_0x13c6('0x2f')]));if(_0x3329c5[_0x13c6('0x2d')][_0x13c6('0x38')]){_0x46895f[_0x13c6('0x37')]=_[_0x13c6('0x39')](_0x46895f['where'],{'$or':_[_0x13c6('0x28')](_0x46895f[_0x13c6('0x31')],function(_0xa96044){var _0x127d1d={};_0x127d1d[_0xa96044]={'$like':'%'+_0x3329c5['query']['filter']+'%'};return _0x127d1d;})});}_0x46895f=_[_0x13c6('0x39')]({},_0x46895f,_0x3329c5[_0x13c6('0x4a')]);return _0x13ed74[_0x13c6('0x4d')](_0x46895f);}})[_0x13c6('0x22')](function(_0x21f34a){if(_0x21f34a){_0x44dd58=_0x21f34a[_0x13c6('0x41')];if(!_0x3329c5[_0x13c6('0x2d')][_0x13c6('0x33')](_0x13c6('0x34'))){_0x46895f[_0x13c6('0x1b')]=qs[_0x13c6('0x1b')](_0x3329c5['query'][_0x13c6('0x1b')]);_0x46895f[_0x13c6('0x19')]=qs[_0x13c6('0x19')](_0x3329c5[_0x13c6('0x2d')][_0x13c6('0x19')]);}return _0x13ed74[_0x13c6('0x4d')](_0x46895f);}})['then'](function(_0xe97b7d){if(_0xe97b7d){return _0xe97b7d?{'count':_0x44dd58,'rows':_0xe97b7d}:null;}})[_0x13c6('0x22')](respondWithResult(_0x145282,null))[_0x13c6('0x3e')](handleError(_0x145282,null));};exports['setTags']=function(_0x533408,_0x49a2b5,_0x2ff1f9){if(_0x533408[_0x13c6('0x44')]['id']){delete _0x533408[_0x13c6('0x44')]['id'];}return db[_0x13c6('0x3b')][_0x13c6('0x47')]({'where':{'id':_0x533408[_0x13c6('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a2b5,null))[_0x13c6('0x22')](function(_0x370725){if(_0x370725){return _0x370725[_0x13c6('0x4f')](_0x533408[_0x13c6('0x44')]['ids']||[]);}return null;})[_0x13c6('0x22')](respondWithResult(_0x49a2b5,null))[_0x13c6('0x3e')](handleError(_0x49a2b5,null));}; \ No newline at end of file +var _0xe786=['../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','DeskConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','getFields','findOne','order','getSubjects','DeskField','getDescriptions','pick','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x13c367,_0x6e5907){var _0xb0dae6=function(_0x562d7d){while(--_0x562d7d){_0x13c367['push'](_0x13c367['shift']());}};_0xb0dae6(++_0x6e5907);}(_0xe786,0x12f));var _0x6e78=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xe786[_0x44bcb0];return _0xfaf881;};'use strict';var emlformat=require(_0x6e78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e78('0x1'));var jsonpatch=require(_0x6e78('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6e78('0x3'));var Mustache=require('mustache');var util=require(_0x6e78('0x4'));var path=require(_0x6e78('0x5'));var sox=require(_0x6e78('0x6'));var csv=require(_0x6e78('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e78('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6e78('0x9'));var deskjs=require(_0x6e78('0xa'));var toCsv=require(_0x6e78('0x7'));var querystring=require(_0x6e78('0xb'));var Papa=require(_0x6e78('0xc'));var Redis=require(_0x6e78('0xd'));var authService=require(_0x6e78('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6e78('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e78('0x10'))(_0x6e78('0x11'));var utils=require(_0x6e78('0x12'));var config=require(_0x6e78('0x13'));var licenseUtil=require(_0x6e78('0x14'));var db=require(_0x6e78('0x15'))['db'];function respondWithStatusCode(_0x1ab839,_0x5cfa7a){_0x5cfa7a=_0x5cfa7a||0xcc;return function(_0x4ef330){if(_0x4ef330){return _0x1ab839[_0x6e78('0x16')](_0x5cfa7a);}return _0x1ab839['status'](_0x5cfa7a)[_0x6e78('0x17')]();};}function respondWithResult(_0x4d24b0,_0x5694af){_0x5694af=_0x5694af||0xc8;return function(_0x119854){if(_0x119854){return _0x4d24b0[_0x6e78('0x18')](_0x5694af)[_0x6e78('0x19')](_0x119854);}};}function respondWithFilteredResult(_0x300df5,_0x1cee87){return function(_0x405679){if(_0x405679){var _0xa9f2e4=typeof _0x1cee87[_0x6e78('0x1a')]==='undefined'&&typeof _0x1cee87[_0x6e78('0x1b')]===_0x6e78('0x1c');var _0xa15307=_0x405679[_0x6e78('0x1d')];var _0xd60388=_0xa9f2e4?0x0:_0x1cee87[_0x6e78('0x1a')];var _0x4362ea=_0xa9f2e4?_0x405679[_0x6e78('0x1d')]:_0x1cee87[_0x6e78('0x1a')]+_0x1cee87[_0x6e78('0x1b')];var _0x29c07b;if(_0x4362ea>=_0xa15307){_0x4362ea=_0xa15307;_0x29c07b=0xc8;}else{_0x29c07b=0xce;}_0x300df5[_0x6e78('0x18')](_0x29c07b);return _0x300df5[_0x6e78('0x1e')](_0x6e78('0x1f'),_0xd60388+'-'+_0x4362ea+'/'+_0xa15307)[_0x6e78('0x19')](_0x405679);}return null;};}function patchUpdates(_0xc7528c){return function(_0x220ae5){try{jsonpatch[_0x6e78('0x20')](_0x220ae5,_0xc7528c,!![]);}catch(_0x1ca6ea){return BPromise[_0x6e78('0x21')](_0x1ca6ea);}return _0x220ae5['save']();};}function saveUpdates(_0xc6b8fd,_0x2f5e37){return function(_0x4aedf5){if(_0x4aedf5){return _0x4aedf5[_0x6e78('0x22')](_0xc6b8fd)[_0x6e78('0x23')](function(_0x63d8ac){return _0x63d8ac;});}return null;};}function removeEntity(_0x5a7d1d,_0x16e3b1){return function(_0x4ef276){if(_0x4ef276){return _0x4ef276['destroy']()['then'](function(){_0x5a7d1d[_0x6e78('0x18')](0xcc)[_0x6e78('0x17')]();});}};}function handleEntityNotFound(_0x4af5e0,_0x5b1e86){return function(_0x67fe8a){if(!_0x67fe8a){_0x4af5e0[_0x6e78('0x16')](0x194);}return _0x67fe8a;};}function handleError(_0x1c1b19,_0x3cd562){_0x3cd562=_0x3cd562||0x1f4;return function(_0x32726d){logger[_0x6e78('0x24')](_0x32726d[_0x6e78('0x25')]);if(_0x32726d[_0x6e78('0x26')]){delete _0x32726d[_0x6e78('0x26')];}_0x1c1b19[_0x6e78('0x18')](_0x3cd562)[_0x6e78('0x27')](_0x32726d);};}exports['index']=function(_0x20c62c,_0x55cf4b){var _0x24821d={},_0x33c55b={},_0x210cd5={'count':0x0,'rows':[]};var _0x47530f=_['map'](db[_0x6e78('0x28')][_0x6e78('0x29')],function(_0x51aeb9){return{'name':_0x51aeb9[_0x6e78('0x2a')],'type':_0x51aeb9[_0x6e78('0x2b')]['key']};});_0x33c55b[_0x6e78('0x2c')]=_[_0x6e78('0x2d')](_0x47530f,'name');_0x33c55b[_0x6e78('0x2e')]=_[_0x6e78('0x2f')](_0x20c62c['query']);_0x33c55b[_0x6e78('0x30')]=_[_0x6e78('0x31')](_0x33c55b['model'],_0x33c55b['query']);_0x24821d['attributes']=_[_0x6e78('0x31')](_0x33c55b[_0x6e78('0x2c')],qs[_0x6e78('0x32')](_0x20c62c['query'][_0x6e78('0x32')]));_0x24821d[_0x6e78('0x33')]=_0x24821d[_0x6e78('0x33')][_0x6e78('0x34')]?_0x24821d[_0x6e78('0x33')]:_0x33c55b[_0x6e78('0x2c')];if(!_0x20c62c[_0x6e78('0x2e')][_0x6e78('0x35')](_0x6e78('0x36'))){_0x24821d[_0x6e78('0x1b')]=qs[_0x6e78('0x1b')](_0x20c62c['query'][_0x6e78('0x1b')]);_0x24821d[_0x6e78('0x1a')]=qs[_0x6e78('0x1a')](_0x20c62c[_0x6e78('0x2e')][_0x6e78('0x1a')]);}_0x24821d['order']=qs[_0x6e78('0x37')](_0x20c62c[_0x6e78('0x2e')][_0x6e78('0x37')]);_0x24821d['where']=qs[_0x6e78('0x30')](_['pick'](_0x20c62c[_0x6e78('0x2e')],_0x33c55b[_0x6e78('0x30')]),_0x47530f);if(_0x20c62c[_0x6e78('0x2e')][_0x6e78('0x38')]){_0x24821d['where']=_[_0x6e78('0x39')](_0x24821d[_0x6e78('0x3a')],{'$or':_[_0x6e78('0x2d')](_0x47530f,function(_0x5f01b0){if(_0x5f01b0['type']!==_0x6e78('0x3b')){var _0x1bba9c={};_0x1bba9c[_0x5f01b0[_0x6e78('0x26')]]={'$like':'%'+_0x20c62c['query']['filter']+'%'};return _0x1bba9c;}})});}_0x24821d=_['merge']({},_0x24821d,_0x20c62c[_0x6e78('0x3c')]);var _0x4ec0e1={'where':_0x24821d[_0x6e78('0x3a')]};return db[_0x6e78('0x28')][_0x6e78('0x1d')](_0x4ec0e1)['then'](function(_0x1345bc){_0x210cd5[_0x6e78('0x1d')]=_0x1345bc;if(_0x20c62c[_0x6e78('0x2e')][_0x6e78('0x3d')]){_0x24821d[_0x6e78('0x3e')]=[{'all':!![]}];}return db[_0x6e78('0x28')]['findAll'](_0x24821d);})[_0x6e78('0x23')](function(_0x4f314a){_0x210cd5[_0x6e78('0x3f')]=_0x4f314a;return _0x210cd5;})[_0x6e78('0x23')](respondWithFilteredResult(_0x55cf4b,_0x24821d))[_0x6e78('0x40')](handleError(_0x55cf4b,null));};exports[_0x6e78('0x41')]=function(_0x379ffc,_0x7497d4){var _0xff20c7={'raw':![],'where':{'id':_0x379ffc[_0x6e78('0x42')]['id']}},_0xbfdf0f={};_0xbfdf0f['model']=_[_0x6e78('0x2f')](db['DeskConfiguration'][_0x6e78('0x29')]);_0xbfdf0f[_0x6e78('0x2e')]=_['keys'](_0x379ffc['query']);_0xbfdf0f[_0x6e78('0x30')]=_[_0x6e78('0x31')](_0xbfdf0f[_0x6e78('0x2c')],_0xbfdf0f[_0x6e78('0x2e')]);_0xff20c7['attributes']=_['intersection'](_0xbfdf0f[_0x6e78('0x2c')],qs['fields'](_0x379ffc['query'][_0x6e78('0x32')]));_0xff20c7[_0x6e78('0x33')]=_0xff20c7[_0x6e78('0x33')][_0x6e78('0x34')]?_0xff20c7[_0x6e78('0x33')]:_0xbfdf0f[_0x6e78('0x2c')];if(_0x379ffc[_0x6e78('0x2e')][_0x6e78('0x3d')]){_0xff20c7[_0x6e78('0x3e')]=[{'all':!![]}];}_0xff20c7=_['merge']({},_0xff20c7,_0x379ffc[_0x6e78('0x3c')]);return db[_0x6e78('0x28')][_0x6e78('0x43')](_0xff20c7)['then'](handleEntityNotFound(_0x7497d4,null))[_0x6e78('0x23')](respondWithResult(_0x7497d4,null))[_0x6e78('0x40')](handleError(_0x7497d4,null));};exports[_0x6e78('0x44')]=function(_0x2db168,_0x5c561a){return db[_0x6e78('0x28')][_0x6e78('0x44')](_0x2db168[_0x6e78('0x45')],{})[_0x6e78('0x23')](respondWithResult(_0x5c561a,0xc9))[_0x6e78('0x40')](handleError(_0x5c561a,null));};exports[_0x6e78('0x22')]=function(_0x4507ff,_0x2fcccb){if(_0x4507ff[_0x6e78('0x45')]['id']){delete _0x4507ff[_0x6e78('0x45')]['id'];}return db[_0x6e78('0x28')][_0x6e78('0x43')]({'where':{'id':_0x4507ff[_0x6e78('0x42')]['id']}})['then'](handleEntityNotFound(_0x2fcccb,null))[_0x6e78('0x23')](saveUpdates(_0x4507ff[_0x6e78('0x45')],null))[_0x6e78('0x23')](respondWithResult(_0x2fcccb,null))[_0x6e78('0x40')](handleError(_0x2fcccb,null));};exports[_0x6e78('0x46')]=function(_0x29141e,_0x13948c){return db[_0x6e78('0x28')][_0x6e78('0x43')]({'where':{'id':_0x29141e[_0x6e78('0x42')]['id']}})[_0x6e78('0x23')](handleEntityNotFound(_0x13948c,null))[_0x6e78('0x23')](removeEntity(_0x13948c,null))[_0x6e78('0x40')](handleError(_0x13948c,null));};exports[_0x6e78('0x47')]=function(_0x3beac2,_0x6f4f53,_0x5adeeb){var _0x58a2fc={};var _0x1f83e3={};var _0x33d4a2;var _0x242cbe;return db[_0x6e78('0x28')][_0x6e78('0x48')]({'where':{'id':_0x3beac2[_0x6e78('0x42')]['id']}})[_0x6e78('0x23')](handleEntityNotFound(_0x6f4f53,null))['then'](function(_0x17f36a){if(_0x17f36a){_0x33d4a2=_0x17f36a;_0x1f83e3[_0x6e78('0x2c')]=_[_0x6e78('0x2f')](db['DeskField']['rawAttributes']);_0x1f83e3['query']=_[_0x6e78('0x2f')](_0x3beac2['query']);_0x1f83e3[_0x6e78('0x30')]=_[_0x6e78('0x31')](_0x1f83e3[_0x6e78('0x2c')],_0x1f83e3[_0x6e78('0x2e')]);_0x58a2fc[_0x6e78('0x33')]=_['intersection'](_0x1f83e3[_0x6e78('0x2c')],qs['fields'](_0x3beac2[_0x6e78('0x2e')][_0x6e78('0x32')]));_0x58a2fc[_0x6e78('0x33')]=_0x58a2fc[_0x6e78('0x33')]['length']?_0x58a2fc[_0x6e78('0x33')]:_0x1f83e3['model'];_0x58a2fc[_0x6e78('0x49')]=qs[_0x6e78('0x37')](_0x3beac2[_0x6e78('0x2e')][_0x6e78('0x37')]);_0x58a2fc[_0x6e78('0x3a')]=qs['filters'](_['pick'](_0x3beac2[_0x6e78('0x2e')],_0x1f83e3[_0x6e78('0x30')]));if(_0x3beac2[_0x6e78('0x2e')]['filter']){_0x58a2fc['where']=_[_0x6e78('0x39')](_0x58a2fc[_0x6e78('0x3a')],{'$or':_[_0x6e78('0x2d')](_0x58a2fc[_0x6e78('0x33')],function(_0x5bda0d){var _0x4301a6={};_0x4301a6[_0x5bda0d]={'$like':'%'+_0x3beac2[_0x6e78('0x2e')][_0x6e78('0x38')]+'%'};return _0x4301a6;})});}_0x58a2fc=_['merge']({},_0x58a2fc,_0x3beac2[_0x6e78('0x3c')]);return _0x33d4a2[_0x6e78('0x47')](_0x58a2fc);}})[_0x6e78('0x23')](function(_0x13be2b){if(_0x13be2b){_0x242cbe=_0x13be2b[_0x6e78('0x34')];if(!_0x3beac2['query'][_0x6e78('0x35')](_0x6e78('0x36'))){_0x58a2fc[_0x6e78('0x1b')]=qs[_0x6e78('0x1b')](_0x3beac2[_0x6e78('0x2e')][_0x6e78('0x1b')]);_0x58a2fc[_0x6e78('0x1a')]=qs['offset'](_0x3beac2[_0x6e78('0x2e')][_0x6e78('0x1a')]);}return _0x33d4a2[_0x6e78('0x47')](_0x58a2fc);}})[_0x6e78('0x23')](function(_0x52a0c9){if(_0x52a0c9){return _0x52a0c9?{'count':_0x242cbe,'rows':_0x52a0c9}:null;}})[_0x6e78('0x23')](respondWithResult(_0x6f4f53,null))[_0x6e78('0x40')](handleError(_0x6f4f53,null));};exports[_0x6e78('0x4a')]=function(_0xb3480d,_0x255e98,_0x11a176){var _0x205c51={};var _0x24f89c={};var _0x1945ab;var _0x253524;return db[_0x6e78('0x28')][_0x6e78('0x48')]({'where':{'id':_0xb3480d[_0x6e78('0x42')]['id']}})['then'](handleEntityNotFound(_0x255e98,null))[_0x6e78('0x23')](function(_0x78a44e){if(_0x78a44e){_0x1945ab=_0x78a44e;_0x24f89c[_0x6e78('0x2c')]=_[_0x6e78('0x2f')](db[_0x6e78('0x4b')][_0x6e78('0x29')]);_0x24f89c[_0x6e78('0x2e')]=_[_0x6e78('0x2f')](_0xb3480d[_0x6e78('0x2e')]);_0x24f89c['filters']=_[_0x6e78('0x31')](_0x24f89c[_0x6e78('0x2c')],_0x24f89c[_0x6e78('0x2e')]);_0x205c51['attributes']=_['intersection'](_0x24f89c['model'],qs['fields'](_0xb3480d[_0x6e78('0x2e')][_0x6e78('0x32')]));_0x205c51['attributes']=_0x205c51[_0x6e78('0x33')][_0x6e78('0x34')]?_0x205c51[_0x6e78('0x33')]:_0x24f89c['model'];_0x205c51[_0x6e78('0x49')]=qs['sort'](_0xb3480d[_0x6e78('0x2e')][_0x6e78('0x37')]);_0x205c51[_0x6e78('0x3a')]=qs['filters'](_['pick'](_0xb3480d[_0x6e78('0x2e')],_0x24f89c['filters']));if(_0xb3480d[_0x6e78('0x2e')]['filter']){_0x205c51[_0x6e78('0x3a')]=_[_0x6e78('0x39')](_0x205c51[_0x6e78('0x3a')],{'$or':_[_0x6e78('0x2d')](_0x205c51['attributes'],function(_0x4884f4){var _0x4ec03e={};_0x4ec03e[_0x4884f4]={'$like':'%'+_0xb3480d['query'][_0x6e78('0x38')]+'%'};return _0x4ec03e;})});}_0x205c51=_[_0x6e78('0x39')]({},_0x205c51,_0xb3480d[_0x6e78('0x3c')]);return _0x1945ab[_0x6e78('0x4a')](_0x205c51);}})['then'](function(_0x5a4e81){if(_0x5a4e81){_0x253524=_0x5a4e81[_0x6e78('0x34')];if(!_0xb3480d[_0x6e78('0x2e')][_0x6e78('0x35')](_0x6e78('0x36'))){_0x205c51[_0x6e78('0x1b')]=qs['limit'](_0xb3480d[_0x6e78('0x2e')]['limit']);_0x205c51[_0x6e78('0x1a')]=qs['offset'](_0xb3480d[_0x6e78('0x2e')][_0x6e78('0x1a')]);}return _0x1945ab[_0x6e78('0x4a')](_0x205c51);}})[_0x6e78('0x23')](function(_0x298816){if(_0x298816){return _0x298816?{'count':_0x253524,'rows':_0x298816}:null;}})['then'](respondWithResult(_0x255e98,null))[_0x6e78('0x40')](handleError(_0x255e98,null));};exports[_0x6e78('0x4c')]=function(_0x2d0e9a,_0x46af69,_0x2bb04a){var _0x176c65={};var _0x507295={};var _0x28bb4f;var _0x349565;return db[_0x6e78('0x28')]['findOne']({'where':{'id':_0x2d0e9a[_0x6e78('0x42')]['id']}})[_0x6e78('0x23')](handleEntityNotFound(_0x46af69,null))[_0x6e78('0x23')](function(_0xa9b4f6){if(_0xa9b4f6){_0x28bb4f=_0xa9b4f6;_0x507295['model']=_[_0x6e78('0x2f')](db[_0x6e78('0x4b')][_0x6e78('0x29')]);_0x507295['query']=_['keys'](_0x2d0e9a[_0x6e78('0x2e')]);_0x507295[_0x6e78('0x30')]=_['intersection'](_0x507295[_0x6e78('0x2c')],_0x507295[_0x6e78('0x2e')]);_0x176c65[_0x6e78('0x33')]=_[_0x6e78('0x31')](_0x507295[_0x6e78('0x2c')],qs['fields'](_0x2d0e9a['query'][_0x6e78('0x32')]));_0x176c65[_0x6e78('0x33')]=_0x176c65['attributes']['length']?_0x176c65['attributes']:_0x507295[_0x6e78('0x2c')];_0x176c65[_0x6e78('0x49')]=qs['sort'](_0x2d0e9a[_0x6e78('0x2e')][_0x6e78('0x37')]);_0x176c65['where']=qs[_0x6e78('0x30')](_[_0x6e78('0x4d')](_0x2d0e9a[_0x6e78('0x2e')],_0x507295[_0x6e78('0x30')]));if(_0x2d0e9a[_0x6e78('0x2e')][_0x6e78('0x38')]){_0x176c65[_0x6e78('0x3a')]=_['merge'](_0x176c65[_0x6e78('0x3a')],{'$or':_[_0x6e78('0x2d')](_0x176c65['attributes'],function(_0x57e1c8){var _0x254419={};_0x254419[_0x57e1c8]={'$like':'%'+_0x2d0e9a[_0x6e78('0x2e')]['filter']+'%'};return _0x254419;})});}_0x176c65=_[_0x6e78('0x39')]({},_0x176c65,_0x2d0e9a[_0x6e78('0x3c')]);return _0x28bb4f['getDescriptions'](_0x176c65);}})[_0x6e78('0x23')](function(_0x15dae6){if(_0x15dae6){_0x349565=_0x15dae6['length'];if(!_0x2d0e9a[_0x6e78('0x2e')][_0x6e78('0x35')](_0x6e78('0x36'))){_0x176c65['limit']=qs[_0x6e78('0x1b')](_0x2d0e9a['query'][_0x6e78('0x1b')]);_0x176c65[_0x6e78('0x1a')]=qs[_0x6e78('0x1a')](_0x2d0e9a[_0x6e78('0x2e')][_0x6e78('0x1a')]);}return _0x28bb4f['getDescriptions'](_0x176c65);}})[_0x6e78('0x23')](function(_0x3d42d6){if(_0x3d42d6){return _0x3d42d6?{'count':_0x349565,'rows':_0x3d42d6}:null;}})[_0x6e78('0x23')](respondWithResult(_0x46af69,null))[_0x6e78('0x40')](handleError(_0x46af69,null));};exports[_0x6e78('0x4e')]=function(_0x15c64c,_0x97a34f,_0x14a96a){var _0x5a52ff={};var _0x40730b={};var _0x23c174;var _0x50966e;return db[_0x6e78('0x28')][_0x6e78('0x48')]({'where':{'id':_0x15c64c[_0x6e78('0x42')]['id']}})[_0x6e78('0x23')](handleEntityNotFound(_0x97a34f,null))[_0x6e78('0x23')](function(_0x524087){if(_0x524087){_0x23c174=_0x524087;_0x40730b[_0x6e78('0x2c')]=_[_0x6e78('0x2f')](db[_0x6e78('0x4f')]['rawAttributes']);_0x40730b[_0x6e78('0x2e')]=_[_0x6e78('0x2f')](_0x15c64c[_0x6e78('0x2e')]);_0x40730b[_0x6e78('0x30')]=_[_0x6e78('0x31')](_0x40730b['model'],_0x40730b['query']);_0x5a52ff[_0x6e78('0x33')]=_[_0x6e78('0x31')](_0x40730b[_0x6e78('0x2c')],qs[_0x6e78('0x32')](_0x15c64c[_0x6e78('0x2e')]['fields']));_0x5a52ff[_0x6e78('0x33')]=_0x5a52ff[_0x6e78('0x33')]['length']?_0x5a52ff['attributes']:_0x40730b[_0x6e78('0x2c')];_0x5a52ff[_0x6e78('0x49')]=qs[_0x6e78('0x37')](_0x15c64c[_0x6e78('0x2e')]['sort']);_0x5a52ff['where']=qs[_0x6e78('0x30')](_[_0x6e78('0x4d')](_0x15c64c[_0x6e78('0x2e')],_0x40730b[_0x6e78('0x30')]));if(_0x15c64c[_0x6e78('0x2e')][_0x6e78('0x38')]){_0x5a52ff['where']=_['merge'](_0x5a52ff['where'],{'$or':_[_0x6e78('0x2d')](_0x5a52ff[_0x6e78('0x33')],function(_0x51c94c){var _0x5be1f8={};_0x5be1f8[_0x51c94c]={'$like':'%'+_0x15c64c[_0x6e78('0x2e')]['filter']+'%'};return _0x5be1f8;})});}_0x5a52ff=_[_0x6e78('0x39')]({},_0x5a52ff,_0x15c64c[_0x6e78('0x3c')]);return _0x23c174[_0x6e78('0x4e')](_0x5a52ff);}})[_0x6e78('0x23')](function(_0x4c6f0e){if(_0x4c6f0e){_0x50966e=_0x4c6f0e['length'];if(!_0x15c64c[_0x6e78('0x2e')][_0x6e78('0x35')](_0x6e78('0x36'))){_0x5a52ff[_0x6e78('0x1b')]=qs[_0x6e78('0x1b')](_0x15c64c['query'][_0x6e78('0x1b')]);_0x5a52ff[_0x6e78('0x1a')]=qs[_0x6e78('0x1a')](_0x15c64c[_0x6e78('0x2e')][_0x6e78('0x1a')]);}return _0x23c174[_0x6e78('0x4e')](_0x5a52ff);}})[_0x6e78('0x23')](function(_0x7a2f62){if(_0x7a2f62){return _0x7a2f62?{'count':_0x50966e,'rows':_0x7a2f62}:null;}})[_0x6e78('0x23')](respondWithResult(_0x97a34f,null))[_0x6e78('0x40')](handleError(_0x97a34f,null));};exports[_0x6e78('0x50')]=function(_0x301a79,_0xbb882f,_0x2ad7f6){if(_0x301a79[_0x6e78('0x45')]['id']){delete _0x301a79[_0x6e78('0x45')]['id'];}return db['DeskConfiguration'][_0x6e78('0x48')]({'where':{'id':_0x301a79[_0x6e78('0x42')]['id']}})[_0x6e78('0x23')](handleEntityNotFound(_0xbb882f,null))[_0x6e78('0x23')](function(_0x1b6777){if(_0x1b6777){return _0x1b6777[_0x6e78('0x50')](_0x301a79[_0x6e78('0x45')]['ids']||[]);}return null;})[_0x6e78('0x23')](respondWithResult(_0xbb882f,null))['catch'](handleError(_0xbb882f,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 23fe4a2..5633105 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 _0x8ac7=['bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x55becc,_0x3e171c){var _0x535773=function(_0x54c308){while(--_0x54c308){_0x55becc['push'](_0x55becc['shift']());}};_0x535773(++_0x3e171c);}(_0x8ac7,0xeb));var _0x78ac=function(_0x3bb6f4,_0x3e4ca7){_0x3bb6f4=_0x3bb6f4-0x0;var _0x7290aa=_0x8ac7[_0x3bb6f4];return _0x7290aa;};'use strict';var _=require(_0x78ac('0x0'));var util=require(_0x78ac('0x1'));var logger=require(_0x78ac('0x2'))(_0x78ac('0x3'));var moment=require(_0x78ac('0x4'));var BPromise=require(_0x78ac('0x5'));var rp=require(_0x78ac('0x6'));var fs=require('fs');var path=require(_0x78ac('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x78ac('0x8'));module[_0x78ac('0x9')]=function(_0x144ceb,_0xb83d69){return _0x144ceb['define'](_0x78ac('0xa'),attributes,{'tableName':_0x78ac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca21=['exports','define','int_desk_configurations','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xca21,0xcf));var _0x1ca2=function(_0x58281b,_0x4cc135){_0x58281b=_0x58281b-0x0;var _0x43251c=_0xca21[_0x58281b];return _0x43251c;};'use strict';var _=require(_0x1ca2('0x0'));var util=require(_0x1ca2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1ca2('0x2'));var BPromise=require(_0x1ca2('0x3'));var rp=require(_0x1ca2('0x4'));var fs=require('fs');var path=require(_0x1ca2('0x5'));var rimraf=require(_0x1ca2('0x6'));var config=require(_0x1ca2('0x7'));var attributes=require(_0x1ca2('0x8'));module[_0x1ca2('0x9')]=function(_0x51556b,_0x4f5d05){return _0x51556b[_0x1ca2('0xa')]('DeskConfiguration',attributes,{'tableName':_0x1ca2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index dd412bc..10ed6b1 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 _0xc19a=['request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x362bf2,_0xe525e7){var _0xc96eaf=function(_0x502e9b){while(--_0x502e9b){_0x362bf2['push'](_0x362bf2['shift']());}};_0xc96eaf(++_0xe525e7);}(_0xc19a,0x7f));var _0xac19=function(_0x3467b5,_0x5b0350){_0x3467b5=_0x3467b5-0x0;var _0x1ed67a=_0xc19a[_0x3467b5];return _0x1ed67a;};'use strict';var _=require(_0xac19('0x0'));var util=require(_0xac19('0x1'));var moment=require(_0xac19('0x2'));var BPromise=require(_0xac19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac19('0x4'));var db=require(_0xac19('0x5'))['db'];var utils=require(_0xac19('0x6'));var logger=require('../../config/logger')(_0xac19('0x7'));var config=require(_0xac19('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac19('0x9')][_0xac19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5543da,_0x2bacfb,_0x58b6a5){return new BPromise(function(_0x4cb0f1,_0x505c9c){return client[_0xac19('0xb')](_0x5543da,_0x58b6a5)[_0xac19('0xc')](function(_0x306dd1){logger[_0xac19('0xd')](_0xac19('0xe'),_0x2bacfb,_0xac19('0xf'));logger[_0xac19('0x10')](_0xac19('0x11'),_0x2bacfb,'request\x20sent',JSON[_0xac19('0x12')](_0x306dd1));if(_0x306dd1[_0xac19('0x13')]){if(_0x306dd1[_0xac19('0x13')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2bacfb,_0x306dd1['error'][_0xac19('0x14')]);return _0x505c9c(_0x306dd1[_0xac19('0x13')]['message']);}logger['error'](_0xac19('0xe'),_0x2bacfb,_0x306dd1['error'][_0xac19('0x14')]);return _0x4cb0f1(_0x306dd1[_0xac19('0x13')]['message']);}else{logger[_0xac19('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x2bacfb,_0xac19('0xf'));_0x4cb0f1(_0x306dd1[_0xac19('0x15')][_0xac19('0x14')]);}})[_0xac19('0x16')](function(_0x2fe01d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2bacfb,_0x2fe01d);_0x505c9c(_0x2fe01d);});});} \ No newline at end of file +var _0x30d4=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x30f878,_0x61db8d){var _0x17092e=function(_0x36c1b8){while(--_0x36c1b8){_0x30f878['push'](_0x30f878['shift']());}};_0x17092e(++_0x61db8d);}(_0x30d4,0xed));var _0x430d=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x30d4[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x430d('0x0'));var util=require(_0x430d('0x1'));var moment=require(_0x430d('0x2'));var BPromise=require('bluebird');var rs=require(_0x430d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x430d('0x4'))['db'];var utils=require(_0x430d('0x5'));var logger=require('../../config/logger')(_0x430d('0x6'));var config=require(_0x430d('0x7'));var jayson=require(_0x430d('0x8'));var client=jayson[_0x430d('0x9')][_0x430d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4951a0,_0x391fe8,_0x2d8c1d){return new BPromise(function(_0x16a932,_0x3dfc84){return client['request'](_0x4951a0,_0x2d8c1d)['then'](function(_0x2ea388){logger[_0x430d('0xb')](_0x430d('0xc'),_0x391fe8,_0x430d('0xd'));logger[_0x430d('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x391fe8,_0x430d('0xd'),JSON[_0x430d('0xf')](_0x2ea388));if(_0x2ea388[_0x430d('0x10')]){if(_0x2ea388[_0x430d('0x10')][_0x430d('0x11')]===0x1f4){logger[_0x430d('0x10')](_0x430d('0xc'),_0x391fe8,_0x2ea388['error'][_0x430d('0x12')]);return _0x3dfc84(_0x2ea388['error']['message']);}logger['error'](_0x430d('0xc'),_0x391fe8,_0x2ea388['error']['message']);return _0x16a932(_0x2ea388[_0x430d('0x10')][_0x430d('0x12')]);}else{logger[_0x430d('0xb')](_0x430d('0xc'),_0x391fe8,_0x430d('0xd'));_0x16a932(_0x2ea388['result']['message']);}})[_0x430d('0x13')](function(_0x19e448){logger['error'](_0x430d('0xc'),_0x391fe8,_0x19e448);_0x3dfc84(_0x19e448);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f32baaa..df5e42b 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 _0x742b=['../../config/environment','get','index','/:id','isAuthenticated','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x742b,0xb4));var _0xb742=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x742b[_0x278e3c];return _0x3e2d9b;};'use strict';var multer=require(_0xb742('0x0'));var util=require(_0xb742('0x1'));var path=require(_0xb742('0x2'));var timeout=require(_0xb742('0x3'));var express=require(_0xb742('0x4'));var router=express[_0xb742('0x5')]();var fs_extra=require(_0xb742('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb742('0x7'));var controller=require('./intDeskField.controller');router[_0xb742('0x8')]('/',auth['isAuthenticated'](),controller[_0xb742('0x9')]);router['get'](_0xb742('0xa'),auth[_0xb742('0xb')](),controller['show']);router[_0xb742('0xc')]('/',auth[_0xb742('0xb')](),controller[_0xb742('0xd')]);router[_0xb742('0xe')](_0xb742('0xa'),auth[_0xb742('0xb')](),controller[_0xb742('0xf')]);router['delete'](_0xb742('0xa'),auth[_0xb742('0xb')](),controller[_0xb742('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc9a0=['../../components/interaction/service','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x325388,_0x4bef2c){var _0x384848=function(_0x4434fd){while(--_0x4434fd){_0x325388['push'](_0x325388['shift']());}};_0x384848(++_0x4bef2c);}(_0xc9a0,0x12c));var _0x0c9a=function(_0x2b4153,_0x12d809){_0x2b4153=_0x2b4153-0x0;var _0x3abd2f=_0xc9a0[_0x2b4153];return _0x3abd2f;};'use strict';var multer=require(_0x0c9a('0x0'));var util=require(_0x0c9a('0x1'));var path=require('path');var timeout=require(_0x0c9a('0x2'));var express=require(_0x0c9a('0x3'));var router=express[_0x0c9a('0x4')]();var fs_extra=require(_0x0c9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0c9a('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x0c9a('0x7')]('/',auth[_0x0c9a('0x8')](),controller[_0x0c9a('0x9')]);router['get']('/:id',auth[_0x0c9a('0x8')](),controller[_0x0c9a('0xa')]);router[_0x0c9a('0xb')]('/',auth['isAuthenticated'](),controller[_0x0c9a('0xc')]);router[_0x0c9a('0xd')](_0x0c9a('0xe'),auth['isAuthenticated'](),controller[_0x0c9a('0xf')]);router[_0x0c9a('0x10')](_0x0c9a('0xe'),auth[_0x0c9a('0x8')](),controller[_0x0c9a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 9bb8622..0e17d45 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 _0x13a2=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x57f8ec,_0x3c8c7a){var _0x441735=function(_0x486935){while(--_0x486935){_0x57f8ec['push'](_0x57f8ec['shift']());}};_0x441735(++_0x3c8c7a);}(_0x13a2,0xcf));var _0x213a=function(_0x171309,_0x8b7bd2){_0x171309=_0x171309-0x0;var _0x957c1f=_0x13a2[_0x171309];return _0x957c1f;};'use strict';var Sequelize=require(_0x213a('0x0'));module[_0x213a('0x1')]={'type':{'type':Sequelize[_0x213a('0x2')](_0x213a('0x3'),'variable',_0x213a('0x4'),_0x213a('0x5'),_0x213a('0x6')),'defaultValue':_0x213a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x213a('0x7')]},'keyType':{'type':Sequelize[_0x213a('0x2')]('string',_0x213a('0x8'),_0x213a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x213a('0x7')]},'nameField':{'type':Sequelize[_0x213a('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x213a('0x7')]}}; \ No newline at end of file +var _0xb0b2=['STRING','variable','customVariable','BOOLEAN','sequelize','ENUM','string','keyValue'];(function(_0x2ac6ef,_0xeaebbf){var _0x17f044=function(_0x41629b){while(--_0x41629b){_0x2ac6ef['push'](_0x2ac6ef['shift']());}};_0x17f044(++_0xeaebbf);}(_0xb0b2,0x124));var _0x2b0b=function(_0x2bcd56,_0x1e76eb){_0x2bcd56=_0x2bcd56-0x0;var _0x10052f=_0xb0b2[_0x2bcd56];return _0x10052f;};'use strict';var Sequelize=require(_0x2b0b('0x0'));module['exports']={'type':{'type':Sequelize[_0x2b0b('0x1')](_0x2b0b('0x2'),'variable','customVariable',_0x2b0b('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2b0b('0x4')]},'key':{'type':Sequelize[_0x2b0b('0x4')]},'keyType':{'type':Sequelize[_0x2b0b('0x1')](_0x2b0b('0x2'),_0x2b0b('0x5'),_0x2b0b('0x6'))},'keyContent':{'type':Sequelize[_0x2b0b('0x4')]},'idField':{'type':Sequelize[_0x2b0b('0x4')]},'nameField':{'type':Sequelize[_0x2b0b('0x4')]},'customField':{'type':Sequelize[_0x2b0b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 4a0609f..5ebfb03 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 _0x984b=['../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','DeskField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x547e18,_0x4e9fae){var _0x396e8d=function(_0x42a794){while(--_0x42a794){_0x547e18['push'](_0x547e18['shift']());}};_0x396e8d(++_0x4e9fae);}(_0x984b,0x15b));var _0xb984=function(_0x1a5f55,_0x1930e9){_0x1a5f55=_0x1a5f55-0x0;var _0xc6355a=_0x984b[_0x1a5f55];return _0xc6355a;};'use strict';var emlformat=require(_0xb984('0x0'));var rimraf=require(_0xb984('0x1'));var zipdir=require(_0xb984('0x2'));var jsonpatch=require(_0xb984('0x3'));var rp=require('request-promise');var moment=require(_0xb984('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb984('0x5'));var sox=require(_0xb984('0x6'));var csv=require('to-csv');var ejs=require(_0xb984('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb984('0x8'));var squel=require(_0xb984('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb984('0xa'));var toCsv=require(_0xb984('0xb'));var querystring=require(_0xb984('0xc'));var Papa=require(_0xb984('0xd'));var Redis=require(_0xb984('0xe'));var authService=require(_0xb984('0xf'));var qs=require(_0xb984('0x10'));var as=require(_0xb984('0x11'));var hardwareService=require(_0xb984('0x12'));var logger=require(_0xb984('0x13'))(_0xb984('0x14'));var utils=require(_0xb984('0x15'));var config=require(_0xb984('0x16'));var licenseUtil=require(_0xb984('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x480570,_0x26f6ab){_0x26f6ab=_0x26f6ab||0xcc;return function(_0x45f451){if(_0x45f451){return _0x480570[_0xb984('0x18')](_0x26f6ab);}return _0x480570[_0xb984('0x19')](_0x26f6ab)[_0xb984('0x1a')]();};}function respondWithResult(_0x1849c9,_0x1038cb){_0x1038cb=_0x1038cb||0xc8;return function(_0x5cc881){if(_0x5cc881){return _0x1849c9[_0xb984('0x19')](_0x1038cb)[_0xb984('0x1b')](_0x5cc881);}};}function respondWithFilteredResult(_0x43d016,_0x56d529){return function(_0x1a8d74){if(_0x1a8d74){var _0x3387b4=typeof _0x56d529['offset']===_0xb984('0x1c')&&typeof _0x56d529[_0xb984('0x1d')]==='undefined';var _0x4972f3=_0x1a8d74[_0xb984('0x1e')];var _0x3dac77=_0x3387b4?0x0:_0x56d529[_0xb984('0x1f')];var _0x30b581=_0x3387b4?_0x1a8d74[_0xb984('0x1e')]:_0x56d529[_0xb984('0x1f')]+_0x56d529[_0xb984('0x1d')];var _0xe3d89e;if(_0x30b581>=_0x4972f3){_0x30b581=_0x4972f3;_0xe3d89e=0xc8;}else{_0xe3d89e=0xce;}_0x43d016[_0xb984('0x19')](_0xe3d89e);return _0x43d016[_0xb984('0x20')](_0xb984('0x21'),_0x3dac77+'-'+_0x30b581+'/'+_0x4972f3)[_0xb984('0x1b')](_0x1a8d74);}return null;};}function patchUpdates(_0x251acd){return function(_0xe8961c){try{jsonpatch['apply'](_0xe8961c,_0x251acd,!![]);}catch(_0x11c4b6){return BPromise['reject'](_0x11c4b6);}return _0xe8961c[_0xb984('0x22')]();};}function saveUpdates(_0x5da6e6,_0x597ac1){return function(_0x4b994d){if(_0x4b994d){return _0x4b994d[_0xb984('0x23')](_0x5da6e6)[_0xb984('0x24')](function(_0xede235){return _0xede235;});}return null;};}function removeEntity(_0x424f8a,_0x14482a){return function(_0x4fc2c2){if(_0x4fc2c2){return _0x4fc2c2[_0xb984('0x25')]()[_0xb984('0x24')](function(){_0x424f8a[_0xb984('0x19')](0xcc)[_0xb984('0x1a')]();});}};}function handleEntityNotFound(_0x263c6d,_0x106f7e){return function(_0x5c40f7){if(!_0x5c40f7){_0x263c6d[_0xb984('0x18')](0x194);}return _0x5c40f7;};}function handleError(_0x235ca6,_0x454ccd){_0x454ccd=_0x454ccd||0x1f4;return function(_0xae99df){logger['error'](_0xae99df[_0xb984('0x26')]);if(_0xae99df['name']){delete _0xae99df[_0xb984('0x27')];}_0x235ca6[_0xb984('0x19')](_0x454ccd)[_0xb984('0x28')](_0xae99df);};}exports[_0xb984('0x29')]=function(_0x55b573,_0x49b0d1){var _0x3f1b10={},_0x2584bc={},_0x329426={'count':0x0,'rows':[]};var _0x420ff5=_[_0xb984('0x2a')](db[_0xb984('0x2b')][_0xb984('0x2c')],function(_0x4a84c0){return{'name':_0x4a84c0['fieldName'],'type':_0x4a84c0[_0xb984('0x2d')][_0xb984('0x2e')]};});_0x2584bc[_0xb984('0x2f')]=_[_0xb984('0x2a')](_0x420ff5,_0xb984('0x27'));_0x2584bc[_0xb984('0x30')]=_['keys'](_0x55b573[_0xb984('0x30')]);_0x2584bc[_0xb984('0x31')]=_[_0xb984('0x32')](_0x2584bc['model'],_0x2584bc[_0xb984('0x30')]);_0x3f1b10[_0xb984('0x33')]=_[_0xb984('0x32')](_0x2584bc[_0xb984('0x2f')],qs[_0xb984('0x34')](_0x55b573[_0xb984('0x30')]['fields']));_0x3f1b10[_0xb984('0x33')]=_0x3f1b10[_0xb984('0x33')]['length']?_0x3f1b10[_0xb984('0x33')]:_0x2584bc[_0xb984('0x2f')];if(!_0x55b573['query'][_0xb984('0x35')](_0xb984('0x36'))){_0x3f1b10[_0xb984('0x1d')]=qs['limit'](_0x55b573[_0xb984('0x30')][_0xb984('0x1d')]);_0x3f1b10[_0xb984('0x1f')]=qs[_0xb984('0x1f')](_0x55b573[_0xb984('0x30')][_0xb984('0x1f')]);}_0x3f1b10[_0xb984('0x37')]=qs[_0xb984('0x38')](_0x55b573[_0xb984('0x30')][_0xb984('0x38')]);_0x3f1b10[_0xb984('0x39')]=qs['filters'](_[_0xb984('0x3a')](_0x55b573[_0xb984('0x30')],_0x2584bc[_0xb984('0x31')]),_0x420ff5);if(_0x55b573[_0xb984('0x30')][_0xb984('0x3b')]){_0x3f1b10[_0xb984('0x39')]=_[_0xb984('0x3c')](_0x3f1b10[_0xb984('0x39')],{'$or':_[_0xb984('0x2a')](_0x420ff5,function(_0x27834a){if(_0x27834a[_0xb984('0x2d')]!==_0xb984('0x3d')){var _0x420d87={};_0x420d87[_0x27834a['name']]={'$like':'%'+_0x55b573[_0xb984('0x30')]['filter']+'%'};return _0x420d87;}})});}_0x3f1b10=_[_0xb984('0x3c')]({},_0x3f1b10,_0x55b573[_0xb984('0x3e')]);var _0x122afe={'where':_0x3f1b10[_0xb984('0x39')]};return db[_0xb984('0x2b')]['count'](_0x122afe)[_0xb984('0x24')](function(_0x182708){_0x329426[_0xb984('0x1e')]=_0x182708;if(_0x55b573[_0xb984('0x30')][_0xb984('0x3f')]){_0x3f1b10[_0xb984('0x40')]=[{'all':!![]}];}return db[_0xb984('0x2b')][_0xb984('0x41')](_0x3f1b10);})[_0xb984('0x24')](function(_0x4e5d2e){_0x329426[_0xb984('0x42')]=_0x4e5d2e;return _0x329426;})[_0xb984('0x24')](respondWithFilteredResult(_0x49b0d1,_0x3f1b10))[_0xb984('0x43')](handleError(_0x49b0d1,null));};exports['show']=function(_0x2c7ef8,_0x3db3b4){var _0x4fc13a={'raw':!![],'where':{'id':_0x2c7ef8[_0xb984('0x44')]['id']}},_0x471f4c={};_0x471f4c[_0xb984('0x2f')]=_[_0xb984('0x45')](db[_0xb984('0x2b')][_0xb984('0x2c')]);_0x471f4c['query']=_['keys'](_0x2c7ef8[_0xb984('0x30')]);_0x471f4c[_0xb984('0x31')]=_['intersection'](_0x471f4c['model'],_0x471f4c['query']);_0x4fc13a['attributes']=_[_0xb984('0x32')](_0x471f4c[_0xb984('0x2f')],qs[_0xb984('0x34')](_0x2c7ef8[_0xb984('0x30')][_0xb984('0x34')]));_0x4fc13a[_0xb984('0x33')]=_0x4fc13a['attributes'][_0xb984('0x46')]?_0x4fc13a[_0xb984('0x33')]:_0x471f4c[_0xb984('0x2f')];if(_0x2c7ef8['query'][_0xb984('0x3f')]){_0x4fc13a[_0xb984('0x40')]=[{'all':!![]}];}_0x4fc13a=_[_0xb984('0x3c')]({},_0x4fc13a,_0x2c7ef8[_0xb984('0x3e')]);return db['DeskField'][_0xb984('0x47')](_0x4fc13a)[_0xb984('0x24')](handleEntityNotFound(_0x3db3b4,null))[_0xb984('0x24')](respondWithResult(_0x3db3b4,null))[_0xb984('0x43')](handleError(_0x3db3b4,null));};exports[_0xb984('0x48')]=function(_0x560fb7,_0x76c502){return db[_0xb984('0x2b')][_0xb984('0x48')](_0x560fb7[_0xb984('0x49')],{})[_0xb984('0x24')](respondWithResult(_0x76c502,0xc9))['catch'](handleError(_0x76c502,null));};exports[_0xb984('0x23')]=function(_0xb4a2e5,_0x5ca2ff){if(_0xb4a2e5['body']['id']){delete _0xb4a2e5[_0xb984('0x49')]['id'];}return db[_0xb984('0x2b')][_0xb984('0x47')]({'where':{'id':_0xb4a2e5['params']['id']}})['then'](handleEntityNotFound(_0x5ca2ff,null))['then'](saveUpdates(_0xb4a2e5['body'],null))['then'](respondWithResult(_0x5ca2ff,null))[_0xb984('0x43')](handleError(_0x5ca2ff,null));};exports[_0xb984('0x25')]=function(_0x3dfbcd,_0x5a3803){return db[_0xb984('0x2b')][_0xb984('0x47')]({'where':{'id':_0x3dfbcd['params']['id']}})[_0xb984('0x24')](handleEntityNotFound(_0x5a3803,null))[_0xb984('0x24')](removeEntity(_0x5a3803,null))[_0xb984('0x43')](handleError(_0x5a3803,null));}; \ No newline at end of file +var _0x0aee=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','save','update','destroy','then','name','send','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','options','DeskField','count','includeAll','findAll','params','fields','length','include','find','catch','create','body','eml-format','zip-dir','request-promise','mustache','util','path','to-csv'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x0aee,0x1a3));var _0xe0ae=function(_0xd9c7d3,_0x478e9b){_0xd9c7d3=_0xd9c7d3-0x0;var _0x55e790=_0x0aee[_0xd9c7d3];return _0x55e790;};'use strict';var emlformat=require(_0xe0ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0ae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0ae('0x3'));var util=require(_0xe0ae('0x4'));var path=require(_0xe0ae('0x5'));var sox=require('sox');var csv=require(_0xe0ae('0x6'));var ejs=require(_0xe0ae('0x7'));var fs=require('fs');var fs_extra=require(_0xe0ae('0x8'));var _=require(_0xe0ae('0x9'));var squel=require(_0xe0ae('0xa'));var crypto=require(_0xe0ae('0xb'));var jsforce=require(_0xe0ae('0xc'));var deskjs=require(_0xe0ae('0xd'));var toCsv=require(_0xe0ae('0x6'));var querystring=require(_0xe0ae('0xe'));var Papa=require(_0xe0ae('0xf'));var Redis=require(_0xe0ae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe0ae('0x11'));var as=require(_0xe0ae('0x12'));var hardwareService=require(_0xe0ae('0x13'));var logger=require(_0xe0ae('0x14'))(_0xe0ae('0x15'));var utils=require(_0xe0ae('0x16'));var config=require(_0xe0ae('0x17'));var licenseUtil=require(_0xe0ae('0x18'));var db=require(_0xe0ae('0x19'))['db'];function respondWithStatusCode(_0x35c2c4,_0xf431bf){_0xf431bf=_0xf431bf||0xcc;return function(_0x1e93d4){if(_0x1e93d4){return _0x35c2c4[_0xe0ae('0x1a')](_0xf431bf);}return _0x35c2c4[_0xe0ae('0x1b')](_0xf431bf)[_0xe0ae('0x1c')]();};}function respondWithResult(_0x41f551,_0xae9fb7){_0xae9fb7=_0xae9fb7||0xc8;return function(_0xd4e85f){if(_0xd4e85f){return _0x41f551[_0xe0ae('0x1b')](_0xae9fb7)[_0xe0ae('0x1d')](_0xd4e85f);}};}function respondWithFilteredResult(_0x460b37,_0x1c2143){return function(_0x374d63){if(_0x374d63){var _0x3bc4e4=typeof _0x1c2143[_0xe0ae('0x1e')]===_0xe0ae('0x1f')&&typeof _0x1c2143[_0xe0ae('0x20')]===_0xe0ae('0x1f');var _0x389c27=_0x374d63['count'];var _0x338944=_0x3bc4e4?0x0:_0x1c2143[_0xe0ae('0x1e')];var _0x3186d4=_0x3bc4e4?_0x374d63['count']:_0x1c2143[_0xe0ae('0x1e')]+_0x1c2143['limit'];var _0x495928;if(_0x3186d4>=_0x389c27){_0x3186d4=_0x389c27;_0x495928=0xc8;}else{_0x495928=0xce;}_0x460b37['status'](_0x495928);return _0x460b37['set']('Content-Range',_0x338944+'-'+_0x3186d4+'/'+_0x389c27)['json'](_0x374d63);}return null;};}function patchUpdates(_0x11ddd0){return function(_0x38aa56){try{jsonpatch[_0xe0ae('0x21')](_0x38aa56,_0x11ddd0,!![]);}catch(_0x33ce62){return BPromise['reject'](_0x33ce62);}return _0x38aa56[_0xe0ae('0x22')]();};}function saveUpdates(_0x35dd73,_0x49c632){return function(_0x310060){if(_0x310060){return _0x310060[_0xe0ae('0x23')](_0x35dd73)['then'](function(_0x210bcb){return _0x210bcb;});}return null;};}function removeEntity(_0x4b82e3,_0x3948c1){return function(_0x4435f2){if(_0x4435f2){return _0x4435f2[_0xe0ae('0x24')]()[_0xe0ae('0x25')](function(){_0x4b82e3[_0xe0ae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x363614,_0x409ac2){return function(_0x1ef449){if(!_0x1ef449){_0x363614[_0xe0ae('0x1a')](0x194);}return _0x1ef449;};}function handleError(_0x5cfa33,_0x47cfb6){_0x47cfb6=_0x47cfb6||0x1f4;return function(_0x1025f0){logger['error'](_0x1025f0['stack']);if(_0x1025f0[_0xe0ae('0x26')]){delete _0x1025f0[_0xe0ae('0x26')];}_0x5cfa33['status'](_0x47cfb6)[_0xe0ae('0x27')](_0x1025f0);};}exports['index']=function(_0xb0776a,_0x363f03){var _0x2e9b62={},_0x249afa={},_0x18d0d2={'count':0x0,'rows':[]};var _0x575d5e=_['map'](db['DeskField'][_0xe0ae('0x28')],function(_0x4a625d){return{'name':_0x4a625d[_0xe0ae('0x29')],'type':_0x4a625d['type']['key']};});_0x249afa[_0xe0ae('0x2a')]=_['map'](_0x575d5e,_0xe0ae('0x26'));_0x249afa[_0xe0ae('0x2b')]=_[_0xe0ae('0x2c')](_0xb0776a[_0xe0ae('0x2b')]);_0x249afa[_0xe0ae('0x2d')]=_[_0xe0ae('0x2e')](_0x249afa[_0xe0ae('0x2a')],_0x249afa[_0xe0ae('0x2b')]);_0x2e9b62[_0xe0ae('0x2f')]=_[_0xe0ae('0x2e')](_0x249afa[_0xe0ae('0x2a')],qs['fields'](_0xb0776a['query']['fields']));_0x2e9b62[_0xe0ae('0x2f')]=_0x2e9b62[_0xe0ae('0x2f')]['length']?_0x2e9b62[_0xe0ae('0x2f')]:_0x249afa[_0xe0ae('0x2a')];if(!_0xb0776a['query'][_0xe0ae('0x30')](_0xe0ae('0x31'))){_0x2e9b62[_0xe0ae('0x20')]=qs[_0xe0ae('0x20')](_0xb0776a[_0xe0ae('0x2b')]['limit']);_0x2e9b62['offset']=qs['offset'](_0xb0776a[_0xe0ae('0x2b')][_0xe0ae('0x1e')]);}_0x2e9b62[_0xe0ae('0x32')]=qs['sort'](_0xb0776a[_0xe0ae('0x2b')][_0xe0ae('0x33')]);_0x2e9b62[_0xe0ae('0x34')]=qs[_0xe0ae('0x2d')](_['pick'](_0xb0776a[_0xe0ae('0x2b')],_0x249afa['filters']),_0x575d5e);if(_0xb0776a['query'][_0xe0ae('0x35')]){_0x2e9b62['where']=_[_0xe0ae('0x36')](_0x2e9b62[_0xe0ae('0x34')],{'$or':_[_0xe0ae('0x37')](_0x575d5e,function(_0x235ff6){if(_0x235ff6[_0xe0ae('0x38')]!==_0xe0ae('0x39')){var _0x98faa={};_0x98faa[_0x235ff6[_0xe0ae('0x26')]]={'$like':'%'+_0xb0776a[_0xe0ae('0x2b')]['filter']+'%'};return _0x98faa;}})});}_0x2e9b62=_['merge']({},_0x2e9b62,_0xb0776a[_0xe0ae('0x3a')]);var _0x4029b6={'where':_0x2e9b62['where']};return db[_0xe0ae('0x3b')][_0xe0ae('0x3c')](_0x4029b6)[_0xe0ae('0x25')](function(_0x4569c6){_0x18d0d2[_0xe0ae('0x3c')]=_0x4569c6;if(_0xb0776a[_0xe0ae('0x2b')][_0xe0ae('0x3d')]){_0x2e9b62['include']=[{'all':!![]}];}return db[_0xe0ae('0x3b')][_0xe0ae('0x3e')](_0x2e9b62);})['then'](function(_0x373012){_0x18d0d2['rows']=_0x373012;return _0x18d0d2;})[_0xe0ae('0x25')](respondWithFilteredResult(_0x363f03,_0x2e9b62))['catch'](handleError(_0x363f03,null));};exports['show']=function(_0x4176c8,_0x5c5f4d){var _0x6f6785={'raw':!![],'where':{'id':_0x4176c8[_0xe0ae('0x3f')]['id']}},_0x53a0d2={};_0x53a0d2[_0xe0ae('0x2a')]=_[_0xe0ae('0x2c')](db[_0xe0ae('0x3b')][_0xe0ae('0x28')]);_0x53a0d2[_0xe0ae('0x2b')]=_[_0xe0ae('0x2c')](_0x4176c8[_0xe0ae('0x2b')]);_0x53a0d2[_0xe0ae('0x2d')]=_['intersection'](_0x53a0d2['model'],_0x53a0d2['query']);_0x6f6785['attributes']=_[_0xe0ae('0x2e')](_0x53a0d2[_0xe0ae('0x2a')],qs[_0xe0ae('0x40')](_0x4176c8[_0xe0ae('0x2b')][_0xe0ae('0x40')]));_0x6f6785['attributes']=_0x6f6785[_0xe0ae('0x2f')][_0xe0ae('0x41')]?_0x6f6785['attributes']:_0x53a0d2['model'];if(_0x4176c8[_0xe0ae('0x2b')][_0xe0ae('0x3d')]){_0x6f6785[_0xe0ae('0x42')]=[{'all':!![]}];}_0x6f6785=_[_0xe0ae('0x36')]({},_0x6f6785,_0x4176c8[_0xe0ae('0x3a')]);return db[_0xe0ae('0x3b')][_0xe0ae('0x43')](_0x6f6785)[_0xe0ae('0x25')](handleEntityNotFound(_0x5c5f4d,null))[_0xe0ae('0x25')](respondWithResult(_0x5c5f4d,null))[_0xe0ae('0x44')](handleError(_0x5c5f4d,null));};exports[_0xe0ae('0x45')]=function(_0x2bfb37,_0x163246){return db[_0xe0ae('0x3b')][_0xe0ae('0x45')](_0x2bfb37[_0xe0ae('0x46')],{})['then'](respondWithResult(_0x163246,0xc9))[_0xe0ae('0x44')](handleError(_0x163246,null));};exports[_0xe0ae('0x23')]=function(_0x30f150,_0x35d1b3){if(_0x30f150[_0xe0ae('0x46')]['id']){delete _0x30f150[_0xe0ae('0x46')]['id'];}return db[_0xe0ae('0x3b')][_0xe0ae('0x43')]({'where':{'id':_0x30f150[_0xe0ae('0x3f')]['id']}})[_0xe0ae('0x25')](handleEntityNotFound(_0x35d1b3,null))[_0xe0ae('0x25')](saveUpdates(_0x30f150[_0xe0ae('0x46')],null))[_0xe0ae('0x25')](respondWithResult(_0x35d1b3,null))[_0xe0ae('0x44')](handleError(_0x35d1b3,null));};exports['destroy']=function(_0x540463,_0x4ab004){return db[_0xe0ae('0x3b')]['find']({'where':{'id':_0x540463[_0xe0ae('0x3f')]['id']}})[_0xe0ae('0x25')](handleEntityNotFound(_0x4ab004,null))[_0xe0ae('0x25')](removeEntity(_0x4ab004,null))[_0xe0ae('0x44')](handleError(_0x4ab004,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6c0e51f..4e787ba 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 _0xc85b=['../../config/environment','./intDeskField.attributes','exports','define','DeskField','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0xb949a9,_0x2f948a){var _0x31932b=function(_0x1e7414){while(--_0x1e7414){_0xb949a9['push'](_0xb949a9['shift']());}};_0x31932b(++_0x2f948a);}(_0xc85b,0x96));var _0xbc85=function(_0x15d7fa,_0x1b7d57){_0x15d7fa=_0x15d7fa-0x0;var _0x1c1d46=_0xc85b[_0x15d7fa];return _0x1c1d46;};'use strict';var _=require(_0xbc85('0x0'));var util=require('util');var logger=require(_0xbc85('0x1'))('api');var moment=require(_0xbc85('0x2'));var BPromise=require(_0xbc85('0x3'));var rp=require(_0xbc85('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc85('0x5'));var config=require(_0xbc85('0x6'));var attributes=require(_0xbc85('0x7'));module[_0xbc85('0x8')]=function(_0x332e57,_0x5f45e0){return _0x332e57[_0xbc85('0x9')](_0xbc85('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xbc85('0xb'),_0xbc85('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd343=['bluebird','path','rimraf','exports','define','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xd343,0x97));var _0x3d34=function(_0x5f5641,_0x20bd42){_0x5f5641=_0x5f5641-0x0;var _0x3090cb=_0xd343[_0x5f5641];return _0x3090cb;};'use strict';var _=require(_0x3d34('0x0'));var util=require(_0x3d34('0x1'));var logger=require(_0x3d34('0x2'))(_0x3d34('0x3'));var moment=require(_0x3d34('0x4'));var BPromise=require(_0x3d34('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d34('0x6'));var rimraf=require(_0x3d34('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x3d34('0x8')]=function(_0x25e763,_0x1568a2){return _0x25e763[_0x3d34('0x9')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x3d34('0xa'),'fields':[_0x3d34('0xb'),_0x3d34('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index d154614..78ca9fa 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 _0xec64=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x521d19,_0x3ef80b){var _0x39048c=function(_0x5704c0){while(--_0x5704c0){_0x521d19['push'](_0x521d19['shift']());}};_0x39048c(++_0x3ef80b);}(_0xec64,0x1b3));var _0x4ec6=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xec64[_0x36bf88];return _0x332914;};'use strict';var _=require(_0x4ec6('0x0'));var util=require(_0x4ec6('0x1'));var moment=require(_0x4ec6('0x2'));var BPromise=require(_0x4ec6('0x3'));var rs=require(_0x4ec6('0x4'));var fs=require('fs');var Redis=require(_0x4ec6('0x5'));var db=require(_0x4ec6('0x6'))['db'];var utils=require(_0x4ec6('0x7'));var logger=require(_0x4ec6('0x8'))(_0x4ec6('0x9'));var config=require(_0x4ec6('0xa'));var jayson=require(_0x4ec6('0xb'));var client=jayson['client'][_0x4ec6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27bf3d,_0x565eda,_0x5ab8de){return new BPromise(function(_0x1ff5f4,_0x41dfb1){return client[_0x4ec6('0xd')](_0x27bf3d,_0x5ab8de)['then'](function(_0x3fbe31){logger[_0x4ec6('0xe')](_0x4ec6('0xf'),_0x565eda,_0x4ec6('0x10'));logger[_0x4ec6('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x565eda,_0x4ec6('0x10'),JSON[_0x4ec6('0x12')](_0x3fbe31));if(_0x3fbe31['error']){if(_0x3fbe31[_0x4ec6('0x13')][_0x4ec6('0x14')]===0x1f4){logger[_0x4ec6('0x13')](_0x4ec6('0xf'),_0x565eda,_0x3fbe31[_0x4ec6('0x13')]['message']);return _0x41dfb1(_0x3fbe31[_0x4ec6('0x13')]['message']);}logger[_0x4ec6('0x13')](_0x4ec6('0xf'),_0x565eda,_0x3fbe31['error'][_0x4ec6('0x15')]);return _0x1ff5f4(_0x3fbe31['error'][_0x4ec6('0x15')]);}else{logger[_0x4ec6('0xe')]('DeskField,\x20%s,\x20%s',_0x565eda,_0x4ec6('0x10'));_0x1ff5f4(_0x3fbe31['result'][_0x4ec6('0x15')]);}})[_0x4ec6('0x16')](function(_0x12cfc9){logger[_0x4ec6('0x13')]('DeskField,\x20%s,\x20%s',_0x565eda,_0x12cfc9);_0x41dfb1(_0x12cfc9);});});} \ No newline at end of file +var _0xa0d8=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa0d8,0x6c));var _0x8a0d=function(_0x1cc366,_0x26692e){_0x1cc366=_0x1cc366-0x0;var _0x21caee=_0xa0d8[_0x1cc366];return _0x21caee;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require(_0x8a0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a0d('0x5'));var logger=require(_0x8a0d('0x6'))(_0x8a0d('0x7'));var config=require(_0x8a0d('0x8'));var jayson=require(_0x8a0d('0x9'));var client=jayson[_0x8a0d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ddf1d,_0x525a4e,_0x194ff6){return new BPromise(function(_0xc79028,_0x35b171){return client[_0x8a0d('0xb')](_0x4ddf1d,_0x194ff6)['then'](function(_0x33dd5e){logger[_0x8a0d('0xc')](_0x8a0d('0xd'),_0x525a4e,'request\x20sent');logger[_0x8a0d('0xe')](_0x8a0d('0xf'),_0x525a4e,_0x8a0d('0x10'),JSON[_0x8a0d('0x11')](_0x33dd5e));if(_0x33dd5e[_0x8a0d('0x12')]){if(_0x33dd5e[_0x8a0d('0x12')]['code']===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x525a4e,_0x33dd5e[_0x8a0d('0x12')][_0x8a0d('0x13')]);return _0x35b171(_0x33dd5e[_0x8a0d('0x12')][_0x8a0d('0x13')]);}logger[_0x8a0d('0x12')](_0x8a0d('0xd'),_0x525a4e,_0x33dd5e[_0x8a0d('0x12')][_0x8a0d('0x13')]);return _0xc79028(_0x33dd5e[_0x8a0d('0x12')][_0x8a0d('0x13')]);}else{logger[_0x8a0d('0xc')](_0x8a0d('0xd'),_0x525a4e,_0x8a0d('0x10'));_0xc79028(_0x33dd5e[_0x8a0d('0x14')][_0x8a0d('0x13')]);}})[_0x8a0d('0x15')](function(_0x3e76a2){logger[_0x8a0d('0x12')](_0x8a0d('0xd'),_0x525a4e,_0x3e76a2);_0x35b171(_0x3e76a2);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index c90cbcc..f72ceb7 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 _0x6db6=['getConfigurations','post','addConfiguration','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x2068ee,_0x42966a){var _0xa36814=function(_0x35dba2){while(--_0x35dba2){_0x2068ee['push'](_0x2068ee['shift']());}};_0xa36814(++_0x42966a);}(_0x6db6,0xb1));var _0x66db=function(_0x50a5ac,_0x5d8731){_0x50a5ac=_0x50a5ac-0x0;var _0x217b8e=_0x6db6[_0x50a5ac];return _0x217b8e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x66db('0x0'));var timeout=require(_0x66db('0x1'));var express=require(_0x66db('0x2'));var router=express[_0x66db('0x3')]();var fs_extra=require(_0x66db('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x66db('0x5'));var config=require(_0x66db('0x6'));var controller=require(_0x66db('0x7'));router[_0x66db('0x8')]('/',auth[_0x66db('0x9')](),controller['index']);router['get'](_0x66db('0xa'),auth[_0x66db('0x9')](),controller[_0x66db('0xb')]);router[_0x66db('0x8')](_0x66db('0xc'),auth[_0x66db('0x9')](),controller[_0x66db('0xd')]);router[_0x66db('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x66db('0x9')](),controller['create']);router[_0x66db('0xe')](_0x66db('0xc'),auth['isAuthenticated'](),controller[_0x66db('0xf')]);router['put'](_0x66db('0xa'),auth[_0x66db('0x9')](),controller[_0x66db('0x10')]);router['delete']('/:id',auth[_0x66db('0x9')](),controller[_0x66db('0x11')]);module[_0x66db('0x12')]=router; \ No newline at end of file +var _0x0d40=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x27f81e,_0x293850){var _0x48189a=function(_0x24f480){while(--_0x24f480){_0x27f81e['push'](_0x27f81e['shift']());}};_0x48189a(++_0x293850);}(_0x0d40,0x192));var _0x00d4=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0x0d40[_0x138293];return _0x34c4a2;};'use strict';var multer=require(_0x00d4('0x0'));var util=require(_0x00d4('0x1'));var path=require(_0x00d4('0x2'));var timeout=require(_0x00d4('0x3'));var express=require(_0x00d4('0x4'));var router=express[_0x00d4('0x5')]();var fs_extra=require(_0x00d4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x00d4('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x00d4('0x8')]('/',auth[_0x00d4('0x9')](),controller[_0x00d4('0xa')]);router['get'](_0x00d4('0xb'),auth[_0x00d4('0x9')](),controller[_0x00d4('0xc')]);router[_0x00d4('0x8')](_0x00d4('0xd'),auth[_0x00d4('0x9')](),controller[_0x00d4('0xe')]);router[_0x00d4('0x8')](_0x00d4('0xf'),auth[_0x00d4('0x9')](),controller[_0x00d4('0x10')]);router['post']('/',auth[_0x00d4('0x9')](),controller[_0x00d4('0x11')]);router[_0x00d4('0x12')]('/:id/configurations',auth[_0x00d4('0x9')](),controller[_0x00d4('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x00d4('0x14')]);router[_0x00d4('0x15')](_0x00d4('0xb'),auth[_0x00d4('0x9')](),controller['destroy']);module[_0x00d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 954edbb..22d768c 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 _0x1a44=['BOOLEAN','sequelize','STRING'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0x1a44,0xc4));var _0x41a4=function(_0x1d8bee,_0x4a0a6f){_0x1d8bee=_0x1d8bee-0x0;var _0x5c1a6f=_0x1a44[_0x1d8bee];return _0x5c1a6f;};'use strict';var Sequelize=require(_0x41a4('0x0'));module['exports']={'name':{'type':Sequelize[_0x41a4('0x1')]},'username':{'type':Sequelize[_0x41a4('0x1')]},'password':{'type':Sequelize[_0x41a4('0x1')]},'remoteUri':{'type':Sequelize[_0x41a4('0x1')]},'tenantId':{'type':Sequelize[_0x41a4('0x1')]},'clientId':{'type':Sequelize[_0x41a4('0x1')]},'clientSecret':{'type':Sequelize[_0x41a4('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x41a4('0x1')]},'modernAuthentication':{'type':Sequelize[_0x41a4('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb6f1=['BOOLEAN','sequelize','STRING'];(function(_0x5dccc5,_0xc65000){var _0x447f2f=function(_0x3f7cdb){while(--_0x3f7cdb){_0x5dccc5['push'](_0x5dccc5['shift']());}};_0x447f2f(++_0xc65000);}(_0xb6f1,0x118));var _0x1b6f=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xb6f1[_0x2b0a86];return _0x955940;};'use strict';var Sequelize=require(_0x1b6f('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b6f('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1b6f('0x1')]},'remoteUri':{'type':Sequelize[_0x1b6f('0x1')]},'tenantId':{'type':Sequelize[_0x1b6f('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1b6f('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1b6f('0x1')]},'modernAuthentication':{'type':Sequelize[_0x1b6f('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 13240f5..8da1ef8 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 _0xe64e=['timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','send','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','error','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','Incident','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdonbehalfbyname','customeridtype','customeridyominame','emailaddress','entitlementidname','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber'];(function(_0x535f9d,_0x4e6dde){var _0x9c6991=function(_0x48f948){while(--_0x48f948){_0x535f9d['push'](_0x535f9d['shift']());}};_0x9c6991(++_0x4e6dde);}(_0xe64e,0x1b0));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0xee64('0x0'));var util=require(_0xee64('0x1'));var _=require(_0xee64('0x2'));var qs=require(_0xee64('0x3'));var logger=require(_0xee64('0x4'))(_0xee64('0x5'));var db=require(_0xee64('0x6'))['db'];var integrations=require(_0xee64('0x7'));function respondWithResult(_0x1d1e83,_0x21ab00){_0x21ab00=_0x21ab00||0xc8;return function(_0x262a74){if(_0x262a74){return _0x1d1e83['status'](_0x21ab00)[_0xee64('0x8')](_0x262a74);}};}function respondWithFilteredResult(_0x332a1a,_0x19cbae){return function(_0x2ff12d){if(_0x2ff12d){var _0x44a1cf=typeof _0x19cbae[_0xee64('0x9')]===_0xee64('0xa')&&typeof _0x19cbae[_0xee64('0xb')]==='undefined';var _0xd77aa3=_0x2ff12d[_0xee64('0xc')];var _0x16d7da=_0x44a1cf?0x0:_0x19cbae[_0xee64('0x9')];var _0x56320f=_0x44a1cf?_0x2ff12d[_0xee64('0xc')]:_0x19cbae[_0xee64('0x9')]+_0x19cbae[_0xee64('0xb')];var _0x5aa70c;if(_0x56320f>=_0xd77aa3){_0x56320f=_0xd77aa3;_0x5aa70c=0xc8;}else{_0x5aa70c=0xce;}_0x332a1a[_0xee64('0xd')](_0x5aa70c);return _0x332a1a[_0xee64('0xe')](_0xee64('0xf'),_0x16d7da+'-'+_0x56320f+'/'+_0xd77aa3)[_0xee64('0x8')](_0x2ff12d);}return null;};}function saveUpdates(_0x5d1f7e){return function(_0xfba780){if(_0xfba780){return _0xfba780['update'](_0x5d1f7e)[_0xee64('0x10')](function(_0x20fce1){return _0x20fce1;});}return null;};}function removeEntity(_0x502e8d){return function(_0x277400){if(_0x277400){return _0x277400[_0xee64('0x11')]()[_0xee64('0x10')](function(){_0x502e8d[_0xee64('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc089a5){return function(_0x1df4fb){if(!_0x1df4fb){_0xc089a5['sendStatus'](0x194);}return _0x1df4fb;};}function handleError(_0x473d15,_0x418e78){_0x418e78=_0x418e78||0x1f4;return function(_0x2bf9ec){logger[_0xee64('0x12')](_0x2bf9ec[_0xee64('0x13')]);if(_0x2bf9ec[_0xee64('0x14')]){delete _0x2bf9ec[_0xee64('0x14')];}_0x473d15['status'](_0x418e78)['send'](_0x2bf9ec);};}exports[_0xee64('0x15')]=function(_0x1a7e24,_0x3317f1){var _0x126b18={},_0x23e839={},_0x50b487={'count':0x0,'rows':[]};var _0x27e416=_[_0xee64('0x16')](db[_0xee64('0x17')][_0xee64('0x18')],function(_0xdad72e){return{'name':_0xdad72e[_0xee64('0x19')],'type':_0xdad72e[_0xee64('0x1a')][_0xee64('0x1b')]};});_0x23e839[_0xee64('0x1c')]=_[_0xee64('0x16')](_0x27e416,_0xee64('0x14'));_0x23e839[_0xee64('0x1d')]=_[_0xee64('0x1e')](_0x1a7e24[_0xee64('0x1d')]);_0x23e839[_0xee64('0x1f')]=_['intersection'](_0x23e839[_0xee64('0x1c')],_0x23e839['query']);_0x126b18[_0xee64('0x20')]=_[_0xee64('0x21')](_0x23e839[_0xee64('0x1c')],qs[_0xee64('0x22')](_0x1a7e24[_0xee64('0x1d')][_0xee64('0x22')]));_0x126b18[_0xee64('0x20')]=_0x126b18[_0xee64('0x20')][_0xee64('0x23')]?_0x126b18[_0xee64('0x20')]:_0x23e839['model'];if(!_0x1a7e24[_0xee64('0x1d')]['hasOwnProperty'](_0xee64('0x24'))){_0x126b18['limit']=qs['limit'](_0x1a7e24[_0xee64('0x1d')]['limit']);_0x126b18[_0xee64('0x9')]=qs[_0xee64('0x9')](_0x1a7e24[_0xee64('0x1d')][_0xee64('0x9')]);}_0x126b18[_0xee64('0x25')]=qs[_0xee64('0x26')](_0x1a7e24[_0xee64('0x1d')]['sort']);_0x126b18[_0xee64('0x27')]=qs[_0xee64('0x1f')](_[_0xee64('0x28')](_0x1a7e24[_0xee64('0x1d')],_0x23e839[_0xee64('0x1f')]),_0x27e416);if(_0x1a7e24[_0xee64('0x1d')][_0xee64('0x29')]){_0x126b18[_0xee64('0x27')]=_[_0xee64('0x2a')](_0x126b18[_0xee64('0x27')],{'$or':_[_0xee64('0x16')](_0x27e416,function(_0x4e1242){if(_0x4e1242[_0xee64('0x1a')]!==_0xee64('0x2b')){var _0x112177={};_0x112177[_0x4e1242[_0xee64('0x14')]]={'$like':'%'+_0x1a7e24['query'][_0xee64('0x29')]+'%'};return _0x112177;}})});}_0x126b18=_[_0xee64('0x2a')]({},_0x126b18,_0x1a7e24[_0xee64('0x2c')]);var _0x52d185={'where':_0x126b18[_0xee64('0x27')]};return db[_0xee64('0x17')][_0xee64('0xc')](_0x52d185)[_0xee64('0x10')](function(_0x56a341){_0x50b487[_0xee64('0xc')]=_0x56a341;if(_0x1a7e24['query'][_0xee64('0x2d')]){_0x126b18[_0xee64('0x2e')]=[{'all':!![]}];}return db[_0xee64('0x17')][_0xee64('0x2f')](_0x126b18);})['then'](function(_0x5287fd){_0x50b487[_0xee64('0x30')]=_0x5287fd;return _0x50b487;})[_0xee64('0x10')](respondWithFilteredResult(_0x3317f1,_0x126b18))[_0xee64('0x31')](handleError(_0x3317f1,null));};exports['show']=function(_0x159361,_0x481e88){var _0x146f70={'raw':![],'where':{'id':_0x159361[_0xee64('0x32')]['id']}},_0x1d0194={};_0x1d0194[_0xee64('0x1c')]=_[_0xee64('0x1e')](db[_0xee64('0x17')][_0xee64('0x18')]);_0x1d0194[_0xee64('0x1d')]=_[_0xee64('0x1e')](_0x159361[_0xee64('0x1d')]);_0x1d0194['filters']=_['intersection'](_0x1d0194['model'],_0x1d0194[_0xee64('0x1d')]);_0x146f70['attributes']=_['intersection'](_0x1d0194[_0xee64('0x1c')],qs['fields'](_0x159361[_0xee64('0x1d')]['fields']));_0x146f70[_0xee64('0x20')]=_0x146f70[_0xee64('0x20')][_0xee64('0x23')]?_0x146f70[_0xee64('0x20')]:_0x1d0194[_0xee64('0x1c')];if(_0x159361[_0xee64('0x1d')][_0xee64('0x2d')]){_0x146f70[_0xee64('0x2e')]=[{'all':!![]}];}_0x146f70=_[_0xee64('0x2a')]({},_0x146f70,_0x159361[_0xee64('0x2c')]);return db[_0xee64('0x17')][_0xee64('0x33')](_0x146f70)['then'](handleEntityNotFound(_0x481e88,null))['then'](respondWithResult(_0x481e88,null))[_0xee64('0x31')](handleError(_0x481e88,null));};exports[_0xee64('0x34')]=function(_0x422158,_0xe8bb68){return db[_0xee64('0x17')]['create'](_0x422158[_0xee64('0x35')],{})[_0xee64('0x10')](respondWithResult(_0xe8bb68,0xc9))[_0xee64('0x31')](handleError(_0xe8bb68,null));};exports[_0xee64('0x36')]=function(_0x35de62,_0x3f901e){if(_0x35de62[_0xee64('0x35')]['id']){delete _0x35de62[_0xee64('0x35')]['id'];}return db[_0xee64('0x17')][_0xee64('0x33')]({'where':{'id':_0x35de62[_0xee64('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f901e,null))['then'](saveUpdates(_0x35de62[_0xee64('0x35')],null))[_0xee64('0x10')](respondWithResult(_0x3f901e,null))[_0xee64('0x31')](handleError(_0x3f901e,null));};exports[_0xee64('0x11')]=function(_0xf48f52,_0x95a9b5){return db[_0xee64('0x17')][_0xee64('0x33')]({'where':{'id':_0xf48f52['params']['id']}})[_0xee64('0x10')](handleEntityNotFound(_0x95a9b5,null))[_0xee64('0x10')](removeEntity(_0x95a9b5,null))[_0xee64('0x31')](handleError(_0x95a9b5,null));};exports[_0xee64('0x37')]=function(_0x4e5621,_0x370e64){var _0x36ea30={};var _0x44f8c0={};var _0x3e5565;var _0x396f96;return db['Dynamics365Account'][_0xee64('0x38')]({'where':{'id':_0x4e5621[_0xee64('0x32')]['id']}})[_0xee64('0x10')](handleEntityNotFound(_0x370e64,null))[_0xee64('0x10')](function(_0x7f59ef){if(_0x7f59ef){_0x3e5565=_0x7f59ef;_0x44f8c0[_0xee64('0x1c')]=_[_0xee64('0x1e')](db['Dynamics365Configuration']['rawAttributes']);_0x44f8c0[_0xee64('0x1d')]=_['keys'](_0x4e5621[_0xee64('0x1d')]);_0x44f8c0[_0xee64('0x1f')]=_['intersection'](_0x44f8c0[_0xee64('0x1c')],_0x44f8c0[_0xee64('0x1d')]);_0x36ea30[_0xee64('0x20')]=_[_0xee64('0x21')](_0x44f8c0[_0xee64('0x1c')],qs[_0xee64('0x22')](_0x4e5621[_0xee64('0x1d')][_0xee64('0x22')]));_0x36ea30['attributes']=_0x36ea30[_0xee64('0x20')][_0xee64('0x23')]?_0x36ea30[_0xee64('0x20')]:_0x44f8c0[_0xee64('0x1c')];_0x36ea30[_0xee64('0x25')]=qs[_0xee64('0x26')](_0x4e5621['query']['sort']);_0x36ea30[_0xee64('0x27')]=qs[_0xee64('0x1f')](_[_0xee64('0x28')](_0x4e5621[_0xee64('0x1d')],_0x44f8c0[_0xee64('0x1f')]));if(_0x4e5621[_0xee64('0x1d')][_0xee64('0x29')]){_0x36ea30[_0xee64('0x27')]=_['merge'](_0x36ea30['where'],{'$or':_[_0xee64('0x16')](_0x36ea30[_0xee64('0x20')],function(_0x156ae4){var _0x42ae81={};_0x42ae81[_0x156ae4]={'$like':'%'+_0x4e5621[_0xee64('0x1d')][_0xee64('0x29')]+'%'};return _0x42ae81;})});}_0x36ea30=_[_0xee64('0x2a')]({},_0x36ea30,_0x4e5621[_0xee64('0x2c')]);return _0x3e5565[_0xee64('0x37')](_0x36ea30);}})[_0xee64('0x10')](function(_0x30d2e7){if(_0x30d2e7){_0x396f96=_0x30d2e7[_0xee64('0x23')];if(!_0x4e5621[_0xee64('0x1d')]['hasOwnProperty'](_0xee64('0x24'))){_0x36ea30[_0xee64('0xb')]=qs[_0xee64('0xb')](_0x4e5621['query'][_0xee64('0xb')]);_0x36ea30[_0xee64('0x9')]=qs['offset'](_0x4e5621['query']['offset']);}return _0x3e5565[_0xee64('0x37')](_0x36ea30);}})[_0xee64('0x10')](function(_0x50731d){if(_0x50731d){return _0x50731d?{'count':_0x396f96,'rows':_0x50731d}:null;}})[_0xee64('0x10')](respondWithResult(_0x370e64,null))[_0xee64('0x31')](handleError(_0x370e64,null));};exports[_0xee64('0x39')]=function(_0x22bafe,_0x2e24fb){if(_0x22bafe['body']['id']){delete _0x22bafe['body']['id'];}return db['Dynamics365Account'][_0xee64('0x38')]({'where':{'id':_0x22bafe[_0xee64('0x32')]['id']}})[_0xee64('0x10')](handleEntityNotFound(_0x2e24fb,null))[_0xee64('0x10')](function(_0x3af928){if(_0x3af928){_0x22bafe[_0xee64('0x35')]['AccountId']=_0x3af928['id'];_0x22bafe[_0xee64('0x35')][_0xee64('0x3a')]=integrations[_0xee64('0x3b')](_0x22bafe[_0xee64('0x35')][_0xee64('0x3c')],_0x22bafe[_0xee64('0x35')]['type']);_0x22bafe[_0xee64('0x35')][_0xee64('0x3d')]=integrations[_0xee64('0x3e')](_0x22bafe[_0xee64('0x35')]['channel'],_0x22bafe['body'][_0xee64('0x1a')]);return db[_0xee64('0x3f')][_0xee64('0x34')](_0x22bafe['body'],{'include':[{'model':db[_0xee64('0x40')],'as':_0xee64('0x3a')},{'model':db[_0xee64('0x40')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2e24fb,null))[_0xee64('0x31')](handleError(_0x2e24fb,null));};function sanitizeRemoteUri(_0x52ee96){var _0x2682be=_0x52ee96[_0xee64('0x41')](-0x1);if(_0x2682be==='/')return _0x52ee96[_0xee64('0x42')](0x0,_0x52ee96[_0xee64('0x43')](_0x2682be));return _0x52ee96;}function getWebApiUrl(_0x49474e){return util[_0xee64('0x44')](_0xee64('0x45'),_0x49474e);}exports['getFields']=function(_0x1b4950,_0x5ca731){var _0x3f2d72=_0x1b4950['query'][_0xee64('0x46')];var _0x8310b4=_0x3f2d72==='incident'?_0xee64('0x47'):_0xee64('0x48');var _0x345f32='';var _0x508672='';var _0x276665='';var _0x7f6470='';var _0x24276f='';var _0x2d0a9a='';var _0x414d0a='';var _0x5c1155='';var _0x2c4dd9=[_0xee64('0x49'),_0xee64('0x4a'),_0xee64('0x4b'),'ownerid',_0xee64('0x4c'),_0xee64('0x4d'),'phonenumber',_0xee64('0x4e'),'directioncode',_0xee64('0x4f')];var _0x4e4521=['accountidname','accountidyominame',_0xee64('0x50'),_0xee64('0x51'),_0xee64('0x52'),_0xee64('0x53'),_0xee64('0x54'),_0xee64('0x55'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0xee64('0x56'),_0xee64('0x57'),'createdon',_0xee64('0x58'),'createdonbehalfbyyominame','customeridname',_0xee64('0x59'),_0xee64('0x5a'),_0xee64('0x5b'),_0xee64('0x5c'),'entityimage_timestamp','entityimage_url','escalatedon',_0xee64('0x5d'),_0xee64('0x5e'),_0xee64('0x5f'),_0xee64('0x60'),_0xee64('0x61'),_0xee64('0x62'),_0xee64('0x63'),'masteridname',_0xee64('0x64'),_0xee64('0x65'),_0xee64('0x66'),_0xee64('0x67'),'modifiedon','modifiedonbehalfbyname',_0xee64('0x68'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents',_0xee64('0x69'),'overriddencreatedon',_0xee64('0x6a'),_0xee64('0x6b'),_0xee64('0x6c'),_0xee64('0x6d'),_0xee64('0x6e'),_0xee64('0x6f'),_0xee64('0x70'),'productidname','productserialnumber','resolveby',_0xee64('0x71'),_0xee64('0x72'),_0xee64('0x73'),_0xee64('0x74'),_0xee64('0x75'),_0xee64('0x76'),_0xee64('0x77'),_0xee64('0x78'),'statecode','statuscode',_0xee64('0x79'),_0xee64('0x7a'),_0xee64('0x7b'),_0xee64('0x7c'),_0xee64('0x7d'),_0xee64('0x7e'),'versionnumber'];var _0x39e6a2=_0x2c4dd9[_0xee64('0x7f')](_0x4e4521);return db[_0xee64('0x17')][_0xee64('0x38')]({'where':{'id':_0x1b4950[_0xee64('0x32')]['id']},'attributes':['id',_0xee64('0x80'),_0xee64('0x81'),_0xee64('0x82'),_0xee64('0x83'),_0xee64('0x84'),_0xee64('0x85'),_0xee64('0x86')],'include':[{'model':db['CloudProvider'],'as':_0xee64('0x87'),'attributes':['id',_0xee64('0x88'),_0xee64('0x89')]}]})['then'](handleEntityNotFound(_0x5ca731,null))['then'](function(_0x500805){if(_0x500805){if(_0x500805[_0xee64('0x86')]){_0x500805[_0xee64('0x8a')]=_0x500805[_0xee64('0x87')]['data5'];_0x5c1155=sanitizeRemoteUri(_0x500805['CloudProvider'][_0xee64('0x89')]);_0x414d0a=getWebApiUrl(_0x5c1155);return _0x500805;}_0x5c1155=sanitizeRemoteUri(_0x500805[_0xee64('0x82')]);_0x414d0a=getWebApiUrl(_0x5c1155);var _0x475db5={'method':_0xee64('0x8b'),'uri':_0xee64('0x8c')+_0x500805['tenantId']+_0xee64('0x8d'),'form':{'client_id':_0x500805[_0xee64('0x84')],'resource':_0x5c1155,'username':_0x500805[_0xee64('0x80')],'password':_0x500805['password'],'grant_type':_0xee64('0x81'),'client_secret':_0x500805[_0xee64('0x85')]},'json':!![]};return rp(_0x475db5);}})[_0xee64('0x10')](function(_0xe68881){_0x2d0a9a=_0xe68881[_0xee64('0x8a')];var _0x380331={'method':_0xee64('0x8e'),'uri':encodeURI(_0x414d0a+_0xee64('0x8f')+_0x8310b4+'\x27'),'headers':{'Authorization':_0xee64('0x90')+_0x2d0a9a,'If-None-Match':null,'OData-Version':_0xee64('0x91')},'json':!![]};return rp(_0x380331);})[_0xee64('0x10')](function(_0x3aa7fb){var _0x4b3be8=_0x3aa7fb[_0xee64('0x92')][0x0];var _0x329fb8=_0x4b3be8['MetadataId'];var _0x1fac7d={'method':_0xee64('0x8e'),'uri':_0x414d0a+_0xee64('0x93')+_0x329fb8+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xee64('0x90')+_0x2d0a9a,'If-None-Match':null,'OData-Version':_0xee64('0x91')},'json':!![]};return rp(_0x1fac7d);})[_0xee64('0x10')](function(_0x449e8c){_0x345f32=_0x449e8c;_0x508672=_0x345f32[_0xee64('0x94')];_0x508672=_[_0xee64('0x95')](_0x508672,function(_0x37d0e4){return!_0x39e6a2[_0xee64('0x96')](_0x37d0e4[_0xee64('0x97')]);});var _0x572117=[];var _0x37d92c=[];_0x508672[_0xee64('0x98')](function(_0x79a88d){if(_0x79a88d['@odata.type']){var _0x341856=_0x79a88d[_0xee64('0x99')]['substring'](_0x79a88d[_0xee64('0x99')]['lastIndexOf']('.')+0x1);if(_0x341856===_0xee64('0x9a')){_0x572117[_0xee64('0x9b')](getSelectList(_0x414d0a,_0x3f2d72,_0x37d92c,_0x345f32[_0xee64('0x9c')],_0x79a88d['MetadataId'],_0x2d0a9a));}}});return Promise[_0xee64('0x9d')](_0x572117);})['then'](function(_0x2a98ea){_0x276665=_0x2a98ea[0x0];var _0x4c05b8=[];var _0x51bdc7=[];_0x508672[_0xee64('0x98')](function(_0x58e3b8){if(!_[_0xee64('0x9e')](_0x58e3b8[_0xee64('0x99')])){var _0x9e6898=_0x58e3b8[_0xee64('0x99')]['substring'](_0x58e3b8[_0xee64('0x99')]['lastIndexOf']('.')+0x1);if(_0x9e6898===_0xee64('0x9f')){_0x4c05b8[_0xee64('0x9b')](getBooleanList(_0x414d0a,_0x3f2d72,_0x51bdc7,_0x345f32['MetadataId'],_0x58e3b8[_0xee64('0x9c')],_0x2d0a9a));}}});return Promise['all'](_0x4c05b8);})[_0xee64('0x10')](function(_0x3f3a28){_0x7f6470=_0x3f3a28[0x0];var _0x58c908=[];var _0x13c95c=[];_0x508672[_0xee64('0x98')](function(_0x255c8e){if(_0x255c8e[_0xee64('0x99')]){var _0x458880=_0x255c8e[_0xee64('0x99')][_0xee64('0x42')](_0x255c8e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x458880===_0xee64('0xa0')||_0x458880===_0xee64('0xa1')||_0x458880==='BigIntAttributeMetadata'||_0x458880==='IntegerAttributeMetadata'||_0x458880===_0xee64('0xa2')||_0x458880==='DateTimeAttributeMetadata'||_0x458880==='StatusAttributeMetadata'||_0x458880===_0xee64('0xa3')||_0x458880===_0xee64('0xa4')||_0x458880===_0xee64('0xa5')){_0x58c908[_0xee64('0x9b')](getInputList(_0x414d0a,_0x3f2d72,_0x458880,_0x13c95c,_0x345f32[_0xee64('0x9c')],_0x255c8e[_0xee64('0x9c')],_0x2d0a9a));}}});return Promise['all'](_0x58c908);})[_0xee64('0x10')](function(_0x2b6e8b){_0x24276f=_0x2b6e8b[0x0];var _0x5eed4c=_0x276665[_0xee64('0x7f')](_0x7f6470)[_0xee64('0x7f')](_0x24276f);var _0x22b366={'count':_0x5eed4c[_0xee64('0x23')],'rows':_0x5eed4c};return _0x22b366;})[_0xee64('0x10')](respondWithResult(_0x5ca731,null))['catch'](function(_0x2360e9){var _0x205b52=_0x1b4950[_0xee64('0x1d')][_0xee64('0xa6')]?0x1f4:_0x2360e9['statusCode']||0x1f4;logger['error'](_0x2360e9['stack']);delete _0x2360e9[_0xee64('0x14')];if(_0x205b52===0x191){_0x205b52=0x190;}_0x5ca731[_0xee64('0xd')](_0x205b52)[_0xee64('0xa7')](_0x1b4950['query'][_0xee64('0xa6')]?{'message':_0xee64('0xa8'),'statusCode':_0x2360e9[_0xee64('0xa9')]}:_0x2360e9);});};function getSelectList(_0x464cdc,_0x2205a5,_0x4dfc54,_0x52f584,_0xf77098,_0xf081d8){var _0x1c599c={'method':_0xee64('0x8e'),'uri':_0x464cdc+'EntityDefinitions('+_0x52f584+_0xee64('0xaa')+_0xf77098+_0xee64('0xab')+_0xee64('0xac'),'headers':{'Authorization':'Bearer\x20'+_0xf081d8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1c599c)[_0xee64('0x10')](function(_0x1e7b09){var _0x3c754f=[];var _0x1b1293=_0x1e7b09['OptionSet'][_0xee64('0xad')];_0x1b1293[_0xee64('0x98')](function(_0x4e0576){_0x3c754f[_0xee64('0x9b')]({'name':_0x4e0576[_0xee64('0xae')][_0xee64('0xaf')][_0xee64('0xae')],'value':String(_0x4e0576[_0xee64('0xb0')])});});var _0x452d46={'id':_0x2205a5+'_'+_0x1e7b09[_0xee64('0x97')],'name':_0x1e7b09[_0xee64('0xb1')][_0xee64('0xaf')]['Label'],'custom':![],'options':_0x3c754f};_0x4dfc54['push'](_0x452d46);return _0x4dfc54;});}function getBooleanList(_0x20f5d4,_0x437eab,_0x3a6aee,_0x29b612,_0xd9e2fb,_0x509c9e){var _0x50d630={'method':'GET','uri':_0x20f5d4+_0xee64('0x93')+_0x29b612+_0xee64('0xaa')+_0xd9e2fb+_0xee64('0xb2'),'headers':{'Authorization':_0xee64('0x90')+_0x509c9e,'If-None-Match':null,'OData-Version':_0xee64('0x91')},'json':!![]};return rp(_0x50d630)[_0xee64('0x10')](function(_0x31aee4){var _0x7b9f09=[];_0x7b9f09[_0xee64('0x9b')]({'name':_0x31aee4[_0xee64('0xb3')]['TrueOption']['Label'][_0xee64('0xaf')][_0xee64('0xae')],'value':_0xee64('0xb4')},{'name':_0x31aee4[_0xee64('0xb3')][_0xee64('0xb5')][_0xee64('0xae')][_0xee64('0xaf')][_0xee64('0xae')],'value':_0xee64('0xb6')});var _0x46156b={'id':_0x437eab+'_'+_0x31aee4[_0xee64('0x97')],'name':_0x31aee4['DisplayName'][_0xee64('0xaf')][_0xee64('0xae')],'custom':![],'options':_0x7b9f09};_0x3a6aee[_0xee64('0x9b')](_0x46156b);return _0x3a6aee;});}function getInputList(_0xe8ef57,_0x371c6c,_0x4fca59,_0x3c8e22,_0x42e6ea,_0xb55122,_0x9dff99){var _0x2a861e={'method':'GET','uri':_0xe8ef57+'EntityDefinitions('+_0x42e6ea+_0xee64('0xaa')+_0xb55122+_0xee64('0xb7')+_0x4fca59+_0xee64('0xb8'),'headers':{'Authorization':'Bearer\x20'+_0x9dff99,'If-None-Match':null,'OData-Version':_0xee64('0x91')},'json':!![]};return rp(_0x2a861e)[_0xee64('0x10')](function(_0xef2327){var _0x149c1f={'id':_0x371c6c+'_'+_0xef2327[_0xee64('0x97')],'name':_0xef2327[_0xee64('0xb1')][_0xee64('0xaf')]?_0xef2327['DisplayName'][_0xee64('0xaf')][_0xee64('0xae')]:_0xef2327['LogicalName'],'custom':![],'options':[]};_0x3c8e22[_0xee64('0x9b')](_0x149c1f);return _0x3c8e22;});} \ No newline at end of file +var _0x6153=['accountidname','accountidyominame','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','TrueOption','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','status','json','offset','undefined','count','limit','set','update','then','destroy','end','sendStatus','error','stack','name','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','lastIndexOf','getFields','incident','Incident','PhoneCall','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties'];(function(_0x55fe01,_0x12ed37){var _0x5b42f0=function(_0x461191){while(--_0x461191){_0x55fe01['push'](_0x55fe01['shift']());}};_0x5b42f0(++_0x12ed37);}(_0x6153,0x6c));var _0x3615=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6153[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0x3615('0x0'));var util=require(_0x3615('0x1'));var _=require(_0x3615('0x2'));var qs=require(_0x3615('0x3'));var logger=require(_0x3615('0x4'))(_0x3615('0x5'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x41c6dc,_0x23ddfd){_0x23ddfd=_0x23ddfd||0xc8;return function(_0x571064){if(_0x571064){return _0x41c6dc[_0x3615('0x6')](_0x23ddfd)[_0x3615('0x7')](_0x571064);}};}function respondWithFilteredResult(_0x27bf1e,_0x16c4c0){return function(_0x275094){if(_0x275094){var _0x21bbb7=typeof _0x16c4c0[_0x3615('0x8')]===_0x3615('0x9')&&typeof _0x16c4c0['limit']===_0x3615('0x9');var _0x566a3a=_0x275094[_0x3615('0xa')];var _0x29100c=_0x21bbb7?0x0:_0x16c4c0['offset'];var _0x4e6d48=_0x21bbb7?_0x275094[_0x3615('0xa')]:_0x16c4c0['offset']+_0x16c4c0[_0x3615('0xb')];var _0x2df483;if(_0x4e6d48>=_0x566a3a){_0x4e6d48=_0x566a3a;_0x2df483=0xc8;}else{_0x2df483=0xce;}_0x27bf1e['status'](_0x2df483);return _0x27bf1e[_0x3615('0xc')]('Content-Range',_0x29100c+'-'+_0x4e6d48+'/'+_0x566a3a)['json'](_0x275094);}return null;};}function saveUpdates(_0x5d11c6){return function(_0x36dbe6){if(_0x36dbe6){return _0x36dbe6[_0x3615('0xd')](_0x5d11c6)[_0x3615('0xe')](function(_0x41c40c){return _0x41c40c;});}return null;};}function removeEntity(_0x3b3e10){return function(_0x3888a2){if(_0x3888a2){return _0x3888a2[_0x3615('0xf')]()['then'](function(){_0x3b3e10[_0x3615('0x6')](0xcc)[_0x3615('0x10')]();});}};}function handleEntityNotFound(_0x27b355){return function(_0x5577cd){if(!_0x5577cd){_0x27b355[_0x3615('0x11')](0x194);}return _0x5577cd;};}function handleError(_0x118704,_0x5ab98e){_0x5ab98e=_0x5ab98e||0x1f4;return function(_0x4f3170){logger[_0x3615('0x12')](_0x4f3170[_0x3615('0x13')]);if(_0x4f3170[_0x3615('0x14')]){delete _0x4f3170['name'];}_0x118704[_0x3615('0x6')](_0x5ab98e)['send'](_0x4f3170);};}exports['index']=function(_0x2808f1,_0x287e71){var _0x143117={},_0x27a2b9={},_0x17ec07={'count':0x0,'rows':[]};var _0x4f9749=_[_0x3615('0x15')](db[_0x3615('0x16')]['rawAttributes'],function(_0x3fbd95){return{'name':_0x3fbd95[_0x3615('0x17')],'type':_0x3fbd95[_0x3615('0x18')][_0x3615('0x19')]};});_0x27a2b9[_0x3615('0x1a')]=_[_0x3615('0x15')](_0x4f9749,'name');_0x27a2b9[_0x3615('0x1b')]=_[_0x3615('0x1c')](_0x2808f1[_0x3615('0x1b')]);_0x27a2b9[_0x3615('0x1d')]=_[_0x3615('0x1e')](_0x27a2b9[_0x3615('0x1a')],_0x27a2b9['query']);_0x143117[_0x3615('0x1f')]=_['intersection'](_0x27a2b9[_0x3615('0x1a')],qs[_0x3615('0x20')](_0x2808f1[_0x3615('0x1b')][_0x3615('0x20')]));_0x143117[_0x3615('0x1f')]=_0x143117['attributes']['length']?_0x143117[_0x3615('0x1f')]:_0x27a2b9[_0x3615('0x1a')];if(!_0x2808f1['query'][_0x3615('0x21')](_0x3615('0x22'))){_0x143117[_0x3615('0xb')]=qs[_0x3615('0xb')](_0x2808f1[_0x3615('0x1b')]['limit']);_0x143117['offset']=qs[_0x3615('0x8')](_0x2808f1['query'][_0x3615('0x8')]);}_0x143117[_0x3615('0x23')]=qs[_0x3615('0x24')](_0x2808f1[_0x3615('0x1b')][_0x3615('0x24')]);_0x143117[_0x3615('0x25')]=qs[_0x3615('0x1d')](_[_0x3615('0x26')](_0x2808f1[_0x3615('0x1b')],_0x27a2b9[_0x3615('0x1d')]),_0x4f9749);if(_0x2808f1['query'][_0x3615('0x27')]){_0x143117[_0x3615('0x25')]=_[_0x3615('0x28')](_0x143117[_0x3615('0x25')],{'$or':_[_0x3615('0x15')](_0x4f9749,function(_0x2d2e91){if(_0x2d2e91[_0x3615('0x18')]!==_0x3615('0x29')){var _0xadf3c9={};_0xadf3c9[_0x2d2e91[_0x3615('0x14')]]={'$like':'%'+_0x2808f1[_0x3615('0x1b')][_0x3615('0x27')]+'%'};return _0xadf3c9;}})});}_0x143117=_[_0x3615('0x28')]({},_0x143117,_0x2808f1[_0x3615('0x2a')]);var _0x3bbdba={'where':_0x143117['where']};return db[_0x3615('0x16')][_0x3615('0xa')](_0x3bbdba)['then'](function(_0x3e0c20){_0x17ec07['count']=_0x3e0c20;if(_0x2808f1['query'][_0x3615('0x2b')]){_0x143117['include']=[{'all':!![]}];}return db[_0x3615('0x16')][_0x3615('0x2c')](_0x143117);})[_0x3615('0xe')](function(_0x1928f9){_0x17ec07[_0x3615('0x2d')]=_0x1928f9;return _0x17ec07;})[_0x3615('0xe')](respondWithFilteredResult(_0x287e71,_0x143117))[_0x3615('0x2e')](handleError(_0x287e71,null));};exports[_0x3615('0x2f')]=function(_0x5bf070,_0x47568a){var _0x5f25a2={'raw':![],'where':{'id':_0x5bf070[_0x3615('0x30')]['id']}},_0x20fab9={};_0x20fab9[_0x3615('0x1a')]=_[_0x3615('0x1c')](db[_0x3615('0x16')]['rawAttributes']);_0x20fab9[_0x3615('0x1b')]=_[_0x3615('0x1c')](_0x5bf070['query']);_0x20fab9[_0x3615('0x1d')]=_[_0x3615('0x1e')](_0x20fab9[_0x3615('0x1a')],_0x20fab9['query']);_0x5f25a2[_0x3615('0x1f')]=_[_0x3615('0x1e')](_0x20fab9[_0x3615('0x1a')],qs['fields'](_0x5bf070[_0x3615('0x1b')][_0x3615('0x20')]));_0x5f25a2[_0x3615('0x1f')]=_0x5f25a2[_0x3615('0x1f')][_0x3615('0x31')]?_0x5f25a2[_0x3615('0x1f')]:_0x20fab9['model'];if(_0x5bf070['query'][_0x3615('0x2b')]){_0x5f25a2[_0x3615('0x32')]=[{'all':!![]}];}_0x5f25a2=_[_0x3615('0x28')]({},_0x5f25a2,_0x5bf070[_0x3615('0x2a')]);return db['Dynamics365Account'][_0x3615('0x33')](_0x5f25a2)[_0x3615('0xe')](handleEntityNotFound(_0x47568a,null))[_0x3615('0xe')](respondWithResult(_0x47568a,null))[_0x3615('0x2e')](handleError(_0x47568a,null));};exports['create']=function(_0x21307e,_0x4db600){return db['Dynamics365Account'][_0x3615('0x34')](_0x21307e[_0x3615('0x35')],{})['then'](respondWithResult(_0x4db600,0xc9))[_0x3615('0x2e')](handleError(_0x4db600,null));};exports[_0x3615('0xd')]=function(_0x4debf6,_0x173c05){if(_0x4debf6[_0x3615('0x35')]['id']){delete _0x4debf6[_0x3615('0x35')]['id'];}return db[_0x3615('0x16')][_0x3615('0x33')]({'where':{'id':_0x4debf6['params']['id']}})['then'](handleEntityNotFound(_0x173c05,null))[_0x3615('0xe')](saveUpdates(_0x4debf6[_0x3615('0x35')],null))[_0x3615('0xe')](respondWithResult(_0x173c05,null))[_0x3615('0x2e')](handleError(_0x173c05,null));};exports[_0x3615('0xf')]=function(_0x3ed939,_0x51ef23){return db['Dynamics365Account'][_0x3615('0x33')]({'where':{'id':_0x3ed939[_0x3615('0x30')]['id']}})[_0x3615('0xe')](handleEntityNotFound(_0x51ef23,null))[_0x3615('0xe')](removeEntity(_0x51ef23,null))[_0x3615('0x2e')](handleError(_0x51ef23,null));};exports[_0x3615('0x36')]=function(_0x4d648d,_0x2eee6e){var _0x3d7efb={};var _0x51df89={};var _0x200e88;var _0x11858b;return db[_0x3615('0x16')][_0x3615('0x37')]({'where':{'id':_0x4d648d[_0x3615('0x30')]['id']}})[_0x3615('0xe')](handleEntityNotFound(_0x2eee6e,null))[_0x3615('0xe')](function(_0x460eb9){if(_0x460eb9){_0x200e88=_0x460eb9;_0x51df89['model']=_[_0x3615('0x1c')](db[_0x3615('0x38')][_0x3615('0x39')]);_0x51df89[_0x3615('0x1b')]=_[_0x3615('0x1c')](_0x4d648d[_0x3615('0x1b')]);_0x51df89[_0x3615('0x1d')]=_['intersection'](_0x51df89[_0x3615('0x1a')],_0x51df89[_0x3615('0x1b')]);_0x3d7efb[_0x3615('0x1f')]=_[_0x3615('0x1e')](_0x51df89['model'],qs['fields'](_0x4d648d[_0x3615('0x1b')][_0x3615('0x20')]));_0x3d7efb[_0x3615('0x1f')]=_0x3d7efb['attributes']['length']?_0x3d7efb[_0x3615('0x1f')]:_0x51df89[_0x3615('0x1a')];_0x3d7efb[_0x3615('0x23')]=qs[_0x3615('0x24')](_0x4d648d['query']['sort']);_0x3d7efb['where']=qs[_0x3615('0x1d')](_[_0x3615('0x26')](_0x4d648d['query'],_0x51df89['filters']));if(_0x4d648d['query']['filter']){_0x3d7efb[_0x3615('0x25')]=_[_0x3615('0x28')](_0x3d7efb[_0x3615('0x25')],{'$or':_[_0x3615('0x15')](_0x3d7efb[_0x3615('0x1f')],function(_0x5b2b28){var _0x11d918={};_0x11d918[_0x5b2b28]={'$like':'%'+_0x4d648d[_0x3615('0x1b')][_0x3615('0x27')]+'%'};return _0x11d918;})});}_0x3d7efb=_[_0x3615('0x28')]({},_0x3d7efb,_0x4d648d[_0x3615('0x2a')]);return _0x200e88[_0x3615('0x36')](_0x3d7efb);}})[_0x3615('0xe')](function(_0x4fee26){if(_0x4fee26){_0x11858b=_0x4fee26[_0x3615('0x31')];if(!_0x4d648d[_0x3615('0x1b')][_0x3615('0x21')](_0x3615('0x22'))){_0x3d7efb['limit']=qs['limit'](_0x4d648d[_0x3615('0x1b')]['limit']);_0x3d7efb['offset']=qs['offset'](_0x4d648d['query'][_0x3615('0x8')]);}return _0x200e88['getConfigurations'](_0x3d7efb);}})['then'](function(_0x54e0df){if(_0x54e0df){return _0x54e0df?{'count':_0x11858b,'rows':_0x54e0df}:null;}})[_0x3615('0xe')](respondWithResult(_0x2eee6e,null))[_0x3615('0x2e')](handleError(_0x2eee6e,null));};exports[_0x3615('0x3a')]=function(_0x41e8c6,_0x100011){if(_0x41e8c6[_0x3615('0x35')]['id']){delete _0x41e8c6[_0x3615('0x35')]['id'];}return db['Dynamics365Account'][_0x3615('0x37')]({'where':{'id':_0x41e8c6[_0x3615('0x30')]['id']}})['then'](handleEntityNotFound(_0x100011,null))[_0x3615('0xe')](function(_0x1e62f7){if(_0x1e62f7){_0x41e8c6[_0x3615('0x35')][_0x3615('0x3b')]=_0x1e62f7['id'];_0x41e8c6[_0x3615('0x35')][_0x3615('0x3c')]=integrations[_0x3615('0x3d')](_0x41e8c6['body'][_0x3615('0x3e')],_0x41e8c6[_0x3615('0x35')][_0x3615('0x18')]);_0x41e8c6[_0x3615('0x35')][_0x3615('0x3f')]=integrations['getDescriptions'](_0x41e8c6[_0x3615('0x35')][_0x3615('0x3e')],_0x41e8c6['body'][_0x3615('0x18')]);return db[_0x3615('0x38')][_0x3615('0x34')](_0x41e8c6[_0x3615('0x35')],{'include':[{'model':db[_0x3615('0x40')],'as':_0x3615('0x3c')},{'model':db[_0x3615('0x40')],'as':_0x3615('0x3f')}]});}return null;})['then'](respondWithResult(_0x100011,null))[_0x3615('0x2e')](handleError(_0x100011,null));};function sanitizeRemoteUri(_0x12cc28){var _0x248270=_0x12cc28[_0x3615('0x41')](-0x1);if(_0x248270==='/')return _0x12cc28[_0x3615('0x42')](0x0,_0x12cc28[_0x3615('0x43')](_0x248270));return _0x12cc28;}function getWebApiUrl(_0x5d84f3){return util['format']('%s/api/data/v9.0/',_0x5d84f3);}exports[_0x3615('0x44')]=function(_0x27c2c7,_0x119567){var _0x106a7b=_0x27c2c7[_0x3615('0x1b')]['ticketType'];var _0x3bd138=_0x106a7b===_0x3615('0x45')?_0x3615('0x46'):_0x3615('0x47');var _0x14d627='';var _0x224370='';var _0x169e2a='';var _0x5cfebc='';var _0xb0c015='';var _0x1950ec='';var _0x4b38ed='';var _0x584f8d='';var _0x23d3d5=['title',_0x3615('0x48'),'customerid','ownerid',_0x3615('0x49'),_0x3615('0x4a'),_0x3615('0x4b'),_0x3615('0x4c'),_0x3615('0x4d'),_0x3615('0x4e')];var _0x50bb77=[_0x3615('0x4f'),_0x3615('0x50'),'actualserviceunits',_0x3615('0x51'),'contactidname',_0x3615('0x52'),'contractdetailidname',_0x3615('0x53'),'createdbyexternalpartyname',_0x3615('0x54'),_0x3615('0x55'),_0x3615('0x56'),_0x3615('0x57'),'createdonbehalfbyname',_0x3615('0x58'),_0x3615('0x59'),'customeridtype',_0x3615('0x5a'),_0x3615('0x5b'),'entitlementidname',_0x3615('0x5c'),_0x3615('0x5d'),_0x3615('0x5e'),_0x3615('0x5f'),'firstresponsebykpiidname',_0x3615('0x60'),'importsequencenumber',_0x3615('0x61'),'kbarticleidname',_0x3615('0x62'),_0x3615('0x63'),'modifiedbyexternalpartyname',_0x3615('0x64'),_0x3615('0x65'),_0x3615('0x66'),_0x3615('0x67'),_0x3615('0x68'),'modifiedonbehalfbyyominame',_0x3615('0x69'),_0x3615('0x6a'),_0x3615('0x6b'),_0x3615('0x6c'),'overriddencreatedon',_0x3615('0x6d'),_0x3615('0x6e'),_0x3615('0x6f'),_0x3615('0x70'),_0x3615('0x71'),_0x3615('0x72'),_0x3615('0x73'),_0x3615('0x74'),'productserialnumber',_0x3615('0x75'),_0x3615('0x76'),'responseby',_0x3615('0x77'),'responsiblecontactidyominame',_0x3615('0x78'),_0x3615('0x79'),_0x3615('0x7a'),_0x3615('0x7b'),_0x3615('0x7c'),_0x3615('0x7d'),'subjectidname',_0x3615('0x7e'),_0x3615('0x7f'),_0x3615('0x80'),_0x3615('0x81'),'utcconversiontimezonecode',_0x3615('0x82')];var _0xaffb42=_0x23d3d5[_0x3615('0x83')](_0x50bb77);return db[_0x3615('0x16')][_0x3615('0x37')]({'where':{'id':_0x27c2c7['params']['id']},'attributes':['id',_0x3615('0x84'),'password',_0x3615('0x85'),_0x3615('0x86'),_0x3615('0x87'),_0x3615('0x88'),'modernAuthentication'],'include':[{'model':db['CloudProvider'],'as':_0x3615('0x89'),'attributes':['id',_0x3615('0x8a'),_0x3615('0x8b')]}]})[_0x3615('0xe')](handleEntityNotFound(_0x119567,null))[_0x3615('0xe')](function(_0x9594be){if(_0x9594be){if(_0x9594be['modernAuthentication']){_0x9594be['access_token']=_0x9594be[_0x3615('0x89')][_0x3615('0x8a')];_0x584f8d=sanitizeRemoteUri(_0x9594be[_0x3615('0x89')]['data7']);_0x4b38ed=getWebApiUrl(_0x584f8d);return _0x9594be;}_0x584f8d=sanitizeRemoteUri(_0x9594be[_0x3615('0x85')]);_0x4b38ed=getWebApiUrl(_0x584f8d);var _0x48748f={'method':_0x3615('0x8c'),'uri':_0x3615('0x8d')+_0x9594be['tenantId']+_0x3615('0x8e'),'form':{'client_id':_0x9594be[_0x3615('0x87')],'resource':_0x584f8d,'username':_0x9594be[_0x3615('0x84')],'password':_0x9594be['password'],'grant_type':_0x3615('0x8f'),'client_secret':_0x9594be['clientSecret']},'json':!![]};return rp(_0x48748f);}})[_0x3615('0xe')](function(_0x121e62){_0x1950ec=_0x121e62['access_token'];var _0x44bbff={'method':_0x3615('0x90'),'uri':encodeURI(_0x4b38ed+_0x3615('0x91')+_0x3bd138+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x1950ec,'If-None-Match':null,'OData-Version':_0x3615('0x92')},'json':!![]};return rp(_0x44bbff);})[_0x3615('0xe')](function(_0x3d47e2){var _0x2a096a=_0x3d47e2['value'][0x0];var _0x371931=_0x2a096a['MetadataId'];var _0x641776={'method':_0x3615('0x90'),'uri':_0x4b38ed+_0x3615('0x93')+_0x371931+_0x3615('0x94'),'headers':{'Authorization':_0x3615('0x95')+_0x1950ec,'If-None-Match':null,'OData-Version':_0x3615('0x92')},'json':!![]};return rp(_0x641776);})[_0x3615('0xe')](function(_0x1825f0){_0x14d627=_0x1825f0;_0x224370=_0x14d627[_0x3615('0x96')];_0x224370=_[_0x3615('0x97')](_0x224370,function(_0xc498d3){return!_0xaffb42['includes'](_0xc498d3[_0x3615('0x98')]);});var _0x59ccc4=[];var _0x43dea7=[];_0x224370[_0x3615('0x99')](function(_0x466567){if(_0x466567[_0x3615('0x9a')]){var _0x36a6da=_0x466567[_0x3615('0x9a')][_0x3615('0x42')](_0x466567[_0x3615('0x9a')][_0x3615('0x43')]('.')+0x1);if(_0x36a6da===_0x3615('0x9b')){_0x59ccc4['push'](getSelectList(_0x4b38ed,_0x106a7b,_0x43dea7,_0x14d627[_0x3615('0x9c')],_0x466567[_0x3615('0x9c')],_0x1950ec));}}});return Promise[_0x3615('0x9d')](_0x59ccc4);})[_0x3615('0xe')](function(_0x293f67){_0x169e2a=_0x293f67[0x0];var _0x11e610=[];var _0x85210d=[];_0x224370[_0x3615('0x99')](function(_0xe0763b){if(!_[_0x3615('0x9e')](_0xe0763b['@odata.type'])){var _0x4d3881=_0xe0763b[_0x3615('0x9a')]['substring'](_0xe0763b[_0x3615('0x9a')]['lastIndexOf']('.')+0x1);if(_0x4d3881===_0x3615('0x9f')){_0x11e610[_0x3615('0xa0')](getBooleanList(_0x4b38ed,_0x106a7b,_0x85210d,_0x14d627['MetadataId'],_0xe0763b[_0x3615('0x9c')],_0x1950ec));}}});return Promise[_0x3615('0x9d')](_0x11e610);})[_0x3615('0xe')](function(_0x27afd3){_0x5cfebc=_0x27afd3[0x0];var _0x5278a8=[];var _0x157c2d=[];_0x224370['forEach'](function(_0x46684a){if(_0x46684a[_0x3615('0x9a')]){var _0x32dd94=_0x46684a[_0x3615('0x9a')]['substring'](_0x46684a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x32dd94===_0x3615('0xa1')||_0x32dd94===_0x3615('0xa2')||_0x32dd94===_0x3615('0xa3')||_0x32dd94===_0x3615('0xa4')||_0x32dd94==='MemoAttributeMetadata'||_0x32dd94===_0x3615('0xa5')||_0x32dd94===_0x3615('0xa6')||_0x32dd94===_0x3615('0xa7')||_0x32dd94===_0x3615('0xa8')||_0x32dd94===_0x3615('0xa9')){_0x5278a8[_0x3615('0xa0')](getInputList(_0x4b38ed,_0x106a7b,_0x32dd94,_0x157c2d,_0x14d627[_0x3615('0x9c')],_0x46684a['MetadataId'],_0x1950ec));}}});return Promise[_0x3615('0x9d')](_0x5278a8);})['then'](function(_0x26c15b){_0xb0c015=_0x26c15b[0x0];var _0x9d529f=_0x169e2a[_0x3615('0x83')](_0x5cfebc)['concat'](_0xb0c015);var _0x39f0e2={'count':_0x9d529f[_0x3615('0x31')],'rows':_0x9d529f};return _0x39f0e2;})[_0x3615('0xe')](respondWithResult(_0x119567,null))[_0x3615('0x2e')](function(_0x40ad8a){var _0x1cdbc2=_0x27c2c7[_0x3615('0x1b')][_0x3615('0xaa')]?0x1f4:_0x40ad8a[_0x3615('0xab')]||0x1f4;logger['error'](_0x40ad8a[_0x3615('0x13')]);delete _0x40ad8a[_0x3615('0x14')];if(_0x1cdbc2===0x191){_0x1cdbc2=0x190;}_0x119567[_0x3615('0x6')](_0x1cdbc2)[_0x3615('0xac')](_0x27c2c7[_0x3615('0x1b')][_0x3615('0xaa')]?{'message':'Wrong\x20credentials','statusCode':_0x40ad8a[_0x3615('0xab')]}:_0x40ad8a);});};function getSelectList(_0xb7cce5,_0x594bcb,_0x21871e,_0x28282b,_0x14dc6a,_0x52358a){var _0x2141d8={'method':_0x3615('0x90'),'uri':_0xb7cce5+_0x3615('0x93')+_0x28282b+_0x3615('0xad')+_0x14dc6a+_0x3615('0xae')+_0x3615('0xaf'),'headers':{'Authorization':_0x3615('0x95')+_0x52358a,'If-None-Match':null,'OData-Version':_0x3615('0x92')},'json':!![]};return rp(_0x2141d8)[_0x3615('0xe')](function(_0x470426){var _0x4b5deb=[];var _0x403bbd=_0x470426[_0x3615('0xb0')][_0x3615('0xb1')];_0x403bbd[_0x3615('0x99')](function(_0x32fce3){_0x4b5deb[_0x3615('0xa0')]({'name':_0x32fce3[_0x3615('0xb2')][_0x3615('0xb3')][_0x3615('0xb2')],'value':String(_0x32fce3[_0x3615('0xb4')])});});var _0x2492d2={'id':_0x594bcb+'_'+_0x470426[_0x3615('0x98')],'name':_0x470426['DisplayName'][_0x3615('0xb3')][_0x3615('0xb2')],'custom':![],'options':_0x4b5deb};_0x21871e[_0x3615('0xa0')](_0x2492d2);return _0x21871e;});}function getBooleanList(_0x46748c,_0x4d81a2,_0x28de59,_0x5179f0,_0x533ca0,_0x19491b){var _0x53a5d2={'method':_0x3615('0x90'),'uri':_0x46748c+'EntityDefinitions('+_0x5179f0+_0x3615('0xad')+_0x533ca0+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x3615('0x95')+_0x19491b,'If-None-Match':null,'OData-Version':_0x3615('0x92')},'json':!![]};return rp(_0x53a5d2)[_0x3615('0xe')](function(_0x40c671){var _0x4a78cd=[];_0x4a78cd[_0x3615('0xa0')]({'name':_0x40c671[_0x3615('0xb0')][_0x3615('0xb5')]['Label'][_0x3615('0xb3')][_0x3615('0xb2')],'value':_0x3615('0xb6')},{'name':_0x40c671[_0x3615('0xb0')][_0x3615('0xb7')][_0x3615('0xb2')][_0x3615('0xb3')][_0x3615('0xb2')],'value':'false'});var _0x58bd37={'id':_0x4d81a2+'_'+_0x40c671[_0x3615('0x98')],'name':_0x40c671[_0x3615('0xb8')][_0x3615('0xb3')][_0x3615('0xb2')],'custom':![],'options':_0x4a78cd};_0x28de59[_0x3615('0xa0')](_0x58bd37);return _0x28de59;});}function getInputList(_0x53b5a4,_0x358834,_0x286493,_0x564c4e,_0x4bc6c4,_0x343961,_0x538c56){var _0x3fcc8d={'method':_0x3615('0x90'),'uri':_0x53b5a4+_0x3615('0x93')+_0x4bc6c4+')/Attributes('+_0x343961+_0x3615('0xb9')+_0x286493+_0x3615('0xba'),'headers':{'Authorization':'Bearer\x20'+_0x538c56,'If-None-Match':null,'OData-Version':_0x3615('0x92')},'json':!![]};return rp(_0x3fcc8d)[_0x3615('0xe')](function(_0x56985a){var _0x416f7c={'id':_0x358834+'_'+_0x56985a[_0x3615('0x98')],'name':_0x56985a[_0x3615('0xb8')]['UserLocalizedLabel']?_0x56985a[_0x3615('0xb8')][_0x3615('0xb3')][_0x3615('0xb2')]:_0x56985a[_0x3615('0x98')],'custom':![],'options':[]};_0x564c4e[_0x3615('0xa0')](_0x416f7c);return _0x564c4e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 6e5568a..c892010 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x12e073,_0x4d43db){var _0x267748=function(_0x381284){while(--_0x381284){_0x12e073['push'](_0x12e073['shift']());}};_0x267748(++_0x4d43db);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x194244,_0x31748a){var _0x3f66db=function(_0x425567){while(--_0x425567){_0x194244['push'](_0x194244['shift']());}};_0x3f66db(++_0x31748a);}(_0x757a,0xde));var _0xa757=function(_0x21d807,_0x3318e0){_0x21d807=_0x21d807-0x0;var _0x2dcb8a=_0x757a[_0x21d807];return _0x2dcb8a;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index eed91ca..8f0cc17 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 _0xe499=['where','attributes','include','model','map','ShowDynamics365Account','Dynamics365Account','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','raw'];(function(_0x4eadff,_0x2ba9fa){var _0x510b98=function(_0x437a49){while(--_0x437a49){_0x4eadff['push'](_0x4eadff['shift']());}};_0x510b98(++_0x2ba9fa);}(_0xe499,0x1c4));var _0x9e49=function(_0x3b0eac,_0x503c4e){_0x3b0eac=_0x3b0eac-0x0;var _0xdf4967=_0xe499[_0x3b0eac];return _0xdf4967;};'use strict';var _=require(_0x9e49('0x0'));var util=require(_0x9e49('0x1'));var moment=require('moment');var BPromise=require(_0x9e49('0x2'));var rs=require(_0x9e49('0x3'));var fs=require('fs');var Redis=require(_0x9e49('0x4'));var db=require(_0x9e49('0x5'))['db'];var utils=require(_0x9e49('0x6'));var logger=require(_0x9e49('0x7'))(_0x9e49('0x8'));var config=require(_0x9e49('0x9'));var jayson=require(_0x9e49('0xa'));var client=jayson[_0x9e49('0xb')][_0x9e49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cdc89,_0x4e8fca,_0x186828){return new BPromise(function(_0x22a34c,_0x3e6dc9){return client[_0x9e49('0xd')](_0x4cdc89,_0x186828)[_0x9e49('0xe')](function(_0x43372d){logger[_0x9e49('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x4e8fca,_0x9e49('0x10'));logger[_0x9e49('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4e8fca,_0x9e49('0x10'),JSON[_0x9e49('0x12')](_0x43372d));if(_0x43372d[_0x9e49('0x13')]){if(_0x43372d[_0x9e49('0x13')][_0x9e49('0x14')]===0x1f4){logger['error'](_0x9e49('0x15'),_0x4e8fca,_0x43372d[_0x9e49('0x13')][_0x9e49('0x16')]);return _0x3e6dc9(_0x43372d[_0x9e49('0x13')][_0x9e49('0x16')]);}logger[_0x9e49('0x13')](_0x9e49('0x15'),_0x4e8fca,_0x43372d[_0x9e49('0x13')][_0x9e49('0x16')]);return _0x22a34c(_0x43372d[_0x9e49('0x13')][_0x9e49('0x16')]);}else{logger['info'](_0x9e49('0x15'),_0x4e8fca,_0x9e49('0x10'));_0x22a34c(_0x43372d[_0x9e49('0x17')][_0x9e49('0x16')]);}})[_0x9e49('0x18')](function(_0x5a97c0){logger[_0x9e49('0x13')](_0x9e49('0x15'),_0x4e8fca,_0x5a97c0);_0x3e6dc9(_0x5a97c0);});});}exports[_0x9e49('0x19')]=function(_0x3f3715){var _0x3050f4=this;return new Promise(function(_0x5ca3c9,_0x18d763){return db['Dynamics365Account'][_0x9e49('0x1a')]({'raw':_0x3f3715['options']?_0x3f3715[_0x9e49('0x1b')][_0x9e49('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f3715['options']?_0x3f3715[_0x9e49('0x1b')][_0x9e49('0x1d')]||null:null,'attributes':_0x3f3715[_0x9e49('0x1b')]?_0x3f3715[_0x9e49('0x1b')][_0x9e49('0x1e')]||null:null,'limit':_0x3f3715[_0x9e49('0x1b')]?_0x3f3715['options']['limit']||null:null,'include':_0x3f3715['options']?_0x3f3715['options'][_0x9e49('0x1f')]?_['map'](_0x3f3715[_0x9e49('0x1b')][_0x9e49('0x1f')],function(_0x466204){return{'model':db[_0x466204[_0x9e49('0x20')]],'as':_0x466204['as'],'attributes':_0x466204['attributes'],'include':_0x466204['include']?_['map'](_0x466204[_0x9e49('0x1f')],function(_0x1a660e){return{'model':db[_0x1a660e[_0x9e49('0x20')]],'as':_0x1a660e['as'],'attributes':_0x1a660e[_0x9e49('0x1e')],'include':_0x1a660e[_0x9e49('0x1f')]?_[_0x9e49('0x21')](_0x1a660e[_0x9e49('0x1f')],function(_0x7aba8c){return{'model':db[_0x7aba8c[_0x9e49('0x20')]],'as':_0x7aba8c['as'],'attributes':_0x7aba8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e49('0xe')](function(_0x3ab3aa){logger[_0x9e49('0xf')](_0x9e49('0x19'),_0x3f3715);logger[_0x9e49('0x11')](_0x9e49('0x19'),_0x3f3715,JSON['stringify'](_0x3ab3aa));_0x5ca3c9(_0x3ab3aa);})[_0x9e49('0x18')](function(_0x38d5fd){logger[_0x9e49('0x13')](_0x9e49('0x19'),_0x38d5fd['message'],_0x3f3715);_0x18d763(_0x3050f4['error'](0x1f4,_0x38d5fd['message']));});});};exports[_0x9e49('0x22')]=function(_0x3df556){var _0x270cde=this;return new Promise(function(_0x3bf102,_0x13ed7d){return db[_0x9e49('0x23')][_0x9e49('0x24')]({'raw':_0x3df556[_0x9e49('0x1b')]?_0x3df556[_0x9e49('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3df556[_0x9e49('0x1b')]?_0x3df556[_0x9e49('0x1b')][_0x9e49('0x1d')]||null:null,'attributes':_0x3df556[_0x9e49('0x1b')]?_0x3df556[_0x9e49('0x1b')][_0x9e49('0x1e')]||null:null,'include':_0x3df556[_0x9e49('0x1b')]?_0x3df556[_0x9e49('0x1b')][_0x9e49('0x1f')]?_[_0x9e49('0x21')](_0x3df556[_0x9e49('0x1b')]['include'],function(_0xdda760){return{'model':db[_0xdda760['model']],'as':_0xdda760['as'],'attributes':_0xdda760[_0x9e49('0x1e')],'include':_0xdda760['include']?_['map'](_0xdda760[_0x9e49('0x1f')],function(_0x2f8471){return{'model':db[_0x2f8471[_0x9e49('0x20')]],'as':_0x2f8471['as'],'attributes':_0x2f8471[_0x9e49('0x1e')],'include':_0x2f8471[_0x9e49('0x1f')]?_[_0x9e49('0x21')](_0x2f8471[_0x9e49('0x1f')],function(_0x56f7fa){return{'model':db[_0x56f7fa[_0x9e49('0x20')]],'as':_0x56f7fa['as'],'attributes':_0x56f7fa[_0x9e49('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9e49('0xe')](function(_0x454281){logger[_0x9e49('0xf')](_0x9e49('0x22'),_0x3df556);logger['debug']('ShowDynamics365Account',_0x3df556,JSON[_0x9e49('0x12')](_0x454281));_0x3bf102(_0x454281);})[_0x9e49('0x18')](function(_0x58826f){logger[_0x9e49('0x13')]('ShowDynamics365Account',_0x58826f[_0x9e49('0x16')],_0x3df556);_0x13ed7d(_0x270cde[_0x9e49('0x13')](0x1f4,_0x58826f[_0x9e49('0x16')]));});});}; \ No newline at end of file +var _0x8260=['then','info','request\x20sent','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','debug','ShowDynamics365Account','find','where','lodash','moment','bluebird','../../mysqldb','../../config/utils','client','http'];(function(_0xec2ebc,_0x3ded7f){var _0x463c60=function(_0x39f356){while(--_0x39f356){_0xec2ebc['push'](_0xec2ebc['shift']());}};_0x463c60(++_0x3ded7f);}(_0x8260,0x18c));var _0x0826=function(_0x34c8ff,_0x674110){_0x34c8ff=_0x34c8ff-0x0;var _0x42601c=_0x8260[_0x34c8ff];return _0x42601c;};'use strict';var _=require(_0x0826('0x0'));var util=require('util');var moment=require(_0x0826('0x1'));var BPromise=require(_0x0826('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0826('0x3'))['db'];var utils=require(_0x0826('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0826('0x5')][_0x0826('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x13035b,_0x123807,_0x32920d){return new BPromise(function(_0x2dd6ae,_0x133c37){return client['request'](_0x13035b,_0x32920d)[_0x0826('0x7')](function(_0x147da3){logger[_0x0826('0x8')]('Dynamics365Account,\x20%s,\x20%s',_0x123807,_0x0826('0x9'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x123807,_0x0826('0x9'),JSON[_0x0826('0xa')](_0x147da3));if(_0x147da3[_0x0826('0xb')]){if(_0x147da3[_0x0826('0xb')][_0x0826('0xc')]===0x1f4){logger['error'](_0x0826('0xd'),_0x123807,_0x147da3[_0x0826('0xb')]['message']);return _0x133c37(_0x147da3[_0x0826('0xb')][_0x0826('0xe')]);}logger[_0x0826('0xb')](_0x0826('0xd'),_0x123807,_0x147da3['error'][_0x0826('0xe')]);return _0x2dd6ae(_0x147da3[_0x0826('0xb')]['message']);}else{logger[_0x0826('0x8')]('Dynamics365Account,\x20%s,\x20%s',_0x123807,_0x0826('0x9'));_0x2dd6ae(_0x147da3[_0x0826('0xf')]['message']);}})[_0x0826('0x10')](function(_0x11d1ed){logger[_0x0826('0xb')](_0x0826('0xd'),_0x123807,_0x11d1ed);_0x133c37(_0x11d1ed);});});}exports[_0x0826('0x11')]=function(_0x27766b){var _0xbae033=this;return new Promise(function(_0x57c0e9,_0x5568c7){return db[_0x0826('0x12')][_0x0826('0x13')]({'raw':_0x27766b[_0x0826('0x14')]?_0x27766b[_0x0826('0x14')][_0x0826('0x15')]===undefined?!![]:![]:!![],'where':_0x27766b['options']?_0x27766b[_0x0826('0x14')]['where']||null:null,'attributes':_0x27766b['options']?_0x27766b['options'][_0x0826('0x16')]||null:null,'limit':_0x27766b[_0x0826('0x14')]?_0x27766b[_0x0826('0x14')][_0x0826('0x17')]||null:null,'include':_0x27766b[_0x0826('0x14')]?_0x27766b[_0x0826('0x14')][_0x0826('0x18')]?_[_0x0826('0x19')](_0x27766b[_0x0826('0x14')][_0x0826('0x18')],function(_0x186205){return{'model':db[_0x186205['model']],'as':_0x186205['as'],'attributes':_0x186205['attributes'],'include':_0x186205['include']?_[_0x0826('0x19')](_0x186205['include'],function(_0x4f1d42){return{'model':db[_0x4f1d42[_0x0826('0x1a')]],'as':_0x4f1d42['as'],'attributes':_0x4f1d42[_0x0826('0x16')],'include':_0x4f1d42[_0x0826('0x18')]?_[_0x0826('0x19')](_0x4f1d42[_0x0826('0x18')],function(_0x2a03b5){return{'model':db[_0x2a03b5[_0x0826('0x1a')]],'as':_0x2a03b5['as'],'attributes':_0x2a03b5[_0x0826('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0826('0x7')](function(_0x479561){logger['info'](_0x0826('0x11'),_0x27766b);logger[_0x0826('0x1b')]('GetDynamics365Account',_0x27766b,JSON[_0x0826('0xa')](_0x479561));_0x57c0e9(_0x479561);})['catch'](function(_0x3d75ce){logger[_0x0826('0xb')](_0x0826('0x11'),_0x3d75ce[_0x0826('0xe')],_0x27766b);_0x5568c7(_0xbae033[_0x0826('0xb')](0x1f4,_0x3d75ce[_0x0826('0xe')]));});});};exports[_0x0826('0x1c')]=function(_0x37bd3e){var _0x16fefa=this;return new Promise(function(_0x1cae3d,_0x27c519){return db[_0x0826('0x12')][_0x0826('0x1d')]({'raw':_0x37bd3e[_0x0826('0x14')]?_0x37bd3e[_0x0826('0x14')][_0x0826('0x15')]===undefined?!![]:![]:!![],'where':_0x37bd3e[_0x0826('0x14')]?_0x37bd3e[_0x0826('0x14')][_0x0826('0x1e')]||null:null,'attributes':_0x37bd3e[_0x0826('0x14')]?_0x37bd3e['options'][_0x0826('0x16')]||null:null,'include':_0x37bd3e[_0x0826('0x14')]?_0x37bd3e[_0x0826('0x14')][_0x0826('0x18')]?_[_0x0826('0x19')](_0x37bd3e['options']['include'],function(_0x486e7b){return{'model':db[_0x486e7b[_0x0826('0x1a')]],'as':_0x486e7b['as'],'attributes':_0x486e7b['attributes'],'include':_0x486e7b[_0x0826('0x18')]?_[_0x0826('0x19')](_0x486e7b['include'],function(_0x4bae35){return{'model':db[_0x4bae35['model']],'as':_0x4bae35['as'],'attributes':_0x4bae35['attributes'],'include':_0x4bae35[_0x0826('0x18')]?_['map'](_0x4bae35['include'],function(_0x44bf88){return{'model':db[_0x44bf88[_0x0826('0x1a')]],'as':_0x44bf88['as'],'attributes':_0x44bf88['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x38a49f){logger['info']('ShowDynamics365Account',_0x37bd3e);logger[_0x0826('0x1b')](_0x0826('0x1c'),_0x37bd3e,JSON['stringify'](_0x38a49f));_0x1cae3d(_0x38a49f);})[_0x0826('0x10')](function(_0x18fdf3){logger[_0x0826('0xb')]('ShowDynamics365Account',_0x18fdf3[_0x0826('0xe')],_0x37bd3e);_0x27c519(_0x16fefa[_0x0826('0xb')](0x1f4,_0x18fdf3['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 91e487a..472bf1c 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 _0xee1e=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee1e,0x109));var _0xeee1=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0xee1e[_0x2650e9];return _0x3511c8;};'use strict';var multer=require(_0xeee1('0x0'));var util=require('util');var path=require(_0xeee1('0x1'));var timeout=require(_0xeee1('0x2'));var express=require(_0xeee1('0x3'));var router=express[_0xeee1('0x4')]();var fs_extra=require(_0xeee1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeee1('0x6'));var config=require(_0xeee1('0x7'));var controller=require(_0xeee1('0x8'));router[_0xeee1('0x9')]('/',auth[_0xeee1('0xa')](),controller[_0xeee1('0xb')]);router[_0xeee1('0x9')](_0xeee1('0xc'),auth[_0xeee1('0xa')](),controller[_0xeee1('0xd')]);router[_0xeee1('0x9')]('/:id/fields',auth[_0xeee1('0xa')](),controller[_0xeee1('0xe')]);router[_0xeee1('0x9')](_0xeee1('0xf'),auth[_0xeee1('0xa')](),controller[_0xeee1('0x10')]);router[_0xeee1('0x9')](_0xeee1('0x11'),auth[_0xeee1('0xa')](),controller[_0xeee1('0x12')]);router['post']('/',auth[_0xeee1('0xa')](),controller[_0xeee1('0x13')]);router[_0xeee1('0x14')](_0xeee1('0xc'),auth[_0xeee1('0xa')](),controller[_0xeee1('0x15')]);router[_0xeee1('0x16')](_0xeee1('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xeee1('0x17')]=router; \ No newline at end of file +var _0x7c93=['post','create','put','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x7c93,0x16e));var _0x37c9=function(_0x278537,_0x3c8b81){_0x278537=_0x278537-0x0;var _0x3a00bd=_0x7c93[_0x278537];return _0x3a00bd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x37c9('0x0'));var timeout=require(_0x37c9('0x1'));var express=require(_0x37c9('0x2'));var router=express['Router']();var fs_extra=require(_0x37c9('0x3'));var auth=require(_0x37c9('0x4'));var interaction=require(_0x37c9('0x5'));var config=require(_0x37c9('0x6'));var controller=require(_0x37c9('0x7'));router[_0x37c9('0x8')]('/',auth[_0x37c9('0x9')](),controller[_0x37c9('0xa')]);router[_0x37c9('0x8')](_0x37c9('0xb'),auth[_0x37c9('0x9')](),controller[_0x37c9('0xc')]);router[_0x37c9('0x8')](_0x37c9('0xd'),auth[_0x37c9('0x9')](),controller[_0x37c9('0xe')]);router[_0x37c9('0x8')]('/:id/subjects',auth[_0x37c9('0x9')](),controller[_0x37c9('0xf')]);router[_0x37c9('0x8')](_0x37c9('0x10'),auth[_0x37c9('0x9')](),controller[_0x37c9('0x11')]);router[_0x37c9('0x12')]('/',auth[_0x37c9('0x9')](),controller[_0x37c9('0x13')]);router[_0x37c9('0x14')](_0x37c9('0xb'),auth[_0x37c9('0x9')](),controller['update']);router[_0x37c9('0x15')](_0x37c9('0xb'),auth[_0x37c9('0x9')](),controller[_0x37c9('0x16')]);module[_0x37c9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 8894c2b..425f498 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 _0x27aa=['BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM','contact','nothing'];(function(_0x7a8be9,_0x1caf02){var _0x4bab19=function(_0x539448){while(--_0x539448){_0x7a8be9['push'](_0x7a8be9['shift']());}};_0x4bab19(++_0x1caf02);}(_0x27aa,0x12a));var _0xa27a=function(_0x508767,_0x369e53){_0x508767=_0x508767-0x0;var _0x2480fe=_0x27aa[_0x508767];return _0x2480fe;};'use strict';var Sequelize=require(_0xa27a('0x0'));module[_0xa27a('0x1')]={'name':{'type':Sequelize[_0xa27a('0x2')]},'description':{'type':Sequelize[_0xa27a('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xa27a('0x3'),_0xa27a('0x4')),'defaultValue':_0xa27a('0x3')},'moduleCreate':{'type':Sequelize[_0xa27a('0x5')](_0xa27a('0x6'),_0xa27a('0x7')),'defaultValue':_0xa27a('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa27a('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xa27a('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x417b=['BOOLEAN','sequelize','exports','STRING','incident','phonecall','contact','nothing'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x417b,0x181));var _0xb417=function(_0x5aaabd,_0x5acd37){_0x5aaabd=_0x5aaabd-0x0;var _0x1e3fb3=_0x417b[_0x5aaabd];return _0x1e3fb3;};'use strict';var Sequelize=require(_0xb417('0x0'));module[_0xb417('0x1')]={'name':{'type':Sequelize[_0xb417('0x2')]},'description':{'type':Sequelize[_0xb417('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xb417('0x3'),_0xb417('0x4')),'defaultValue':_0xb417('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb417('0x5'),_0xb417('0x6')),'defaultValue':_0xb417('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb417('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xb417('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 229aaf2..2a220cd 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 _0x3be7=['stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','getFields','findOne','Dynamics365Field','length','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3be7,0x172));var _0x73be=function(_0x57a80d,_0x2194c3){_0x57a80d=_0x57a80d-0x0;var _0xb7cdb4=_0x3be7[_0x57a80d];return _0xb7cdb4;};'use strict';var emlformat=require(_0x73be('0x0'));var rimraf=require(_0x73be('0x1'));var zipdir=require(_0x73be('0x2'));var jsonpatch=require(_0x73be('0x3'));var rp=require('request-promise');var moment=require(_0x73be('0x4'));var BPromise=require(_0x73be('0x5'));var Mustache=require(_0x73be('0x6'));var util=require('util');var path=require('path');var sox=require(_0x73be('0x7'));var csv=require(_0x73be('0x8'));var ejs=require(_0x73be('0x9'));var fs=require('fs');var fs_extra=require(_0x73be('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x73be('0xb'));var deskjs=require(_0x73be('0xc'));var toCsv=require(_0x73be('0x8'));var querystring=require(_0x73be('0xd'));var Papa=require(_0x73be('0xe'));var Redis=require(_0x73be('0xf'));var authService=require(_0x73be('0x10'));var qs=require(_0x73be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73be('0x12'));var logger=require(_0x73be('0x13'))(_0x73be('0x14'));var utils=require(_0x73be('0x15'));var config=require(_0x73be('0x16'));var licenseUtil=require(_0x73be('0x17'));var db=require(_0x73be('0x18'))['db'];function respondWithStatusCode(_0x550011,_0x498f19){_0x498f19=_0x498f19||0xcc;return function(_0x9a7171){if(_0x9a7171){return _0x550011[_0x73be('0x19')](_0x498f19);}return _0x550011[_0x73be('0x1a')](_0x498f19)[_0x73be('0x1b')]();};}function respondWithResult(_0xdce9cb,_0x31f0f1){_0x31f0f1=_0x31f0f1||0xc8;return function(_0xe5be89){if(_0xe5be89){return _0xdce9cb['status'](_0x31f0f1)[_0x73be('0x1c')](_0xe5be89);}};}function respondWithFilteredResult(_0x454871,_0x48a320){return function(_0x5c9ee4){if(_0x5c9ee4){var _0x30c3b1=typeof _0x48a320[_0x73be('0x1d')]===_0x73be('0x1e')&&typeof _0x48a320[_0x73be('0x1f')]===_0x73be('0x1e');var _0x51cc6e=_0x5c9ee4[_0x73be('0x20')];var _0x1a19a0=_0x30c3b1?0x0:_0x48a320['offset'];var _0x352528=_0x30c3b1?_0x5c9ee4[_0x73be('0x20')]:_0x48a320[_0x73be('0x1d')]+_0x48a320[_0x73be('0x1f')];var _0x40020f;if(_0x352528>=_0x51cc6e){_0x352528=_0x51cc6e;_0x40020f=0xc8;}else{_0x40020f=0xce;}_0x454871[_0x73be('0x1a')](_0x40020f);return _0x454871['set'](_0x73be('0x21'),_0x1a19a0+'-'+_0x352528+'/'+_0x51cc6e)['json'](_0x5c9ee4);}return null;};}function patchUpdates(_0x4316c4){return function(_0x17f3ae){try{jsonpatch[_0x73be('0x22')](_0x17f3ae,_0x4316c4,!![]);}catch(_0x487dae){return BPromise[_0x73be('0x23')](_0x487dae);}return _0x17f3ae[_0x73be('0x24')]();};}function saveUpdates(_0x27665f,_0x46ba88){return function(_0x3d0f8e){if(_0x3d0f8e){return _0x3d0f8e[_0x73be('0x25')](_0x27665f)[_0x73be('0x26')](function(_0x20609a){return _0x20609a;});}return null;};}function removeEntity(_0x70aed5,_0x84cb41){return function(_0x2bd2f2){if(_0x2bd2f2){return _0x2bd2f2[_0x73be('0x27')]()['then'](function(){_0x70aed5[_0x73be('0x1a')](0xcc)[_0x73be('0x1b')]();});}};}function handleEntityNotFound(_0x2d2411,_0x439d9b){return function(_0xa67350){if(!_0xa67350){_0x2d2411['sendStatus'](0x194);}return _0xa67350;};}function handleError(_0x59bdd0,_0x36b10c){_0x36b10c=_0x36b10c||0x1f4;return function(_0x16a4e8){logger['error'](_0x16a4e8[_0x73be('0x28')]);if(_0x16a4e8['name']){delete _0x16a4e8[_0x73be('0x29')];}_0x59bdd0[_0x73be('0x1a')](_0x36b10c)[_0x73be('0x2a')](_0x16a4e8);};}exports[_0x73be('0x2b')]=function(_0x1d40e7,_0x3ab24c){var _0x177219={},_0xb1763d={},_0x3747d2={'count':0x0,'rows':[]};var _0x1a6d3c=_['map'](db[_0x73be('0x2c')][_0x73be('0x2d')],function(_0x3d7b78){return{'name':_0x3d7b78[_0x73be('0x2e')],'type':_0x3d7b78[_0x73be('0x2f')]['key']};});_0xb1763d[_0x73be('0x30')]=_[_0x73be('0x31')](_0x1a6d3c,_0x73be('0x29'));_0xb1763d[_0x73be('0x32')]=_[_0x73be('0x33')](_0x1d40e7['query']);_0xb1763d['filters']=_[_0x73be('0x34')](_0xb1763d[_0x73be('0x30')],_0xb1763d[_0x73be('0x32')]);_0x177219[_0x73be('0x35')]=_[_0x73be('0x34')](_0xb1763d[_0x73be('0x30')],qs[_0x73be('0x36')](_0x1d40e7[_0x73be('0x32')]['fields']));_0x177219['attributes']=_0x177219['attributes']['length']?_0x177219[_0x73be('0x35')]:_0xb1763d[_0x73be('0x30')];if(!_0x1d40e7['query']['hasOwnProperty']('nolimit')){_0x177219['limit']=qs[_0x73be('0x1f')](_0x1d40e7['query']['limit']);_0x177219[_0x73be('0x1d')]=qs[_0x73be('0x1d')](_0x1d40e7[_0x73be('0x32')][_0x73be('0x1d')]);}_0x177219[_0x73be('0x37')]=qs[_0x73be('0x38')](_0x1d40e7[_0x73be('0x32')]['sort']);_0x177219['where']=qs[_0x73be('0x39')](_[_0x73be('0x3a')](_0x1d40e7['query'],_0xb1763d[_0x73be('0x39')]),_0x1a6d3c);if(_0x1d40e7[_0x73be('0x32')]['filter']){_0x177219['where']=_[_0x73be('0x3b')](_0x177219[_0x73be('0x3c')],{'$or':_['map'](_0x1a6d3c,function(_0x2a88db){if(_0x2a88db[_0x73be('0x2f')]!==_0x73be('0x3d')){var _0x2dce0f={};_0x2dce0f[_0x2a88db[_0x73be('0x29')]]={'$like':'%'+_0x1d40e7[_0x73be('0x32')][_0x73be('0x3e')]+'%'};return _0x2dce0f;}})});}_0x177219=_[_0x73be('0x3b')]({},_0x177219,_0x1d40e7['options']);var _0x1d06fb={'where':_0x177219[_0x73be('0x3c')]};return db[_0x73be('0x2c')][_0x73be('0x20')](_0x1d06fb)[_0x73be('0x26')](function(_0xc950d3){_0x3747d2[_0x73be('0x20')]=_0xc950d3;if(_0x1d40e7[_0x73be('0x32')][_0x73be('0x3f')]){_0x177219['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x73be('0x40')](_0x177219);})[_0x73be('0x26')](function(_0x258b1d){_0x3747d2[_0x73be('0x41')]=_0x258b1d;return _0x3747d2;})[_0x73be('0x26')](respondWithFilteredResult(_0x3ab24c,_0x177219))[_0x73be('0x42')](handleError(_0x3ab24c,null));};exports[_0x73be('0x43')]=function(_0x55b153,_0x2575ff){var _0x4412f6={'raw':![],'where':{'id':_0x55b153[_0x73be('0x44')]['id']}},_0x2dbc96={};_0x2dbc96['model']=_[_0x73be('0x33')](db['Dynamics365Configuration'][_0x73be('0x2d')]);_0x2dbc96[_0x73be('0x32')]=_[_0x73be('0x33')](_0x55b153[_0x73be('0x32')]);_0x2dbc96[_0x73be('0x39')]=_['intersection'](_0x2dbc96[_0x73be('0x30')],_0x2dbc96[_0x73be('0x32')]);_0x4412f6[_0x73be('0x35')]=_[_0x73be('0x34')](_0x2dbc96['model'],qs[_0x73be('0x36')](_0x55b153[_0x73be('0x32')][_0x73be('0x36')]));_0x4412f6[_0x73be('0x35')]=_0x4412f6[_0x73be('0x35')]['length']?_0x4412f6[_0x73be('0x35')]:_0x2dbc96[_0x73be('0x30')];if(_0x55b153[_0x73be('0x32')][_0x73be('0x3f')]){_0x4412f6[_0x73be('0x45')]=[{'all':!![]}];}_0x4412f6=_['merge']({},_0x4412f6,_0x55b153[_0x73be('0x46')]);return db['Dynamics365Configuration']['find'](_0x4412f6)[_0x73be('0x26')](handleEntityNotFound(_0x2575ff,null))[_0x73be('0x26')](respondWithResult(_0x2575ff,null))['catch'](handleError(_0x2575ff,null));};exports[_0x73be('0x47')]=function(_0x417506,_0x16375f){return db[_0x73be('0x2c')][_0x73be('0x47')](_0x417506[_0x73be('0x48')],{})[_0x73be('0x26')](respondWithResult(_0x16375f,0xc9))['catch'](handleError(_0x16375f,null));};exports[_0x73be('0x25')]=function(_0x2ef905,_0xb6484c){if(_0x2ef905[_0x73be('0x48')]['id']){delete _0x2ef905[_0x73be('0x48')]['id'];}return db[_0x73be('0x2c')][_0x73be('0x49')]({'where':{'id':_0x2ef905['params']['id']}})[_0x73be('0x26')](handleEntityNotFound(_0xb6484c,null))['then'](saveUpdates(_0x2ef905[_0x73be('0x48')],null))[_0x73be('0x26')](respondWithResult(_0xb6484c,null))[_0x73be('0x42')](handleError(_0xb6484c,null));};exports[_0x73be('0x27')]=function(_0x3f3cbc,_0x381d79){return db[_0x73be('0x2c')][_0x73be('0x49')]({'where':{'id':_0x3f3cbc['params']['id']}})[_0x73be('0x26')](handleEntityNotFound(_0x381d79,null))['then'](removeEntity(_0x381d79,null))['catch'](handleError(_0x381d79,null));};exports[_0x73be('0x4a')]=function(_0x1d3fac,_0x1c307f,_0xa49bb0){var _0x24faec={};var _0x2176ec={};var _0x13efc3;var _0x4e2d8d;return db[_0x73be('0x2c')][_0x73be('0x4b')]({'where':{'id':_0x1d3fac[_0x73be('0x44')]['id']}})[_0x73be('0x26')](handleEntityNotFound(_0x1c307f,null))[_0x73be('0x26')](function(_0x4245a3){if(_0x4245a3){_0x13efc3=_0x4245a3;_0x2176ec[_0x73be('0x30')]=_[_0x73be('0x33')](db[_0x73be('0x4c')][_0x73be('0x2d')]);_0x2176ec[_0x73be('0x32')]=_[_0x73be('0x33')](_0x1d3fac['query']);_0x2176ec[_0x73be('0x39')]=_[_0x73be('0x34')](_0x2176ec[_0x73be('0x30')],_0x2176ec[_0x73be('0x32')]);_0x24faec['attributes']=_[_0x73be('0x34')](_0x2176ec[_0x73be('0x30')],qs[_0x73be('0x36')](_0x1d3fac['query'][_0x73be('0x36')]));_0x24faec[_0x73be('0x35')]=_0x24faec['attributes'][_0x73be('0x4d')]?_0x24faec[_0x73be('0x35')]:_0x2176ec[_0x73be('0x30')];_0x24faec['order']=qs[_0x73be('0x38')](_0x1d3fac[_0x73be('0x32')][_0x73be('0x38')]);_0x24faec['where']=qs['filters'](_['pick'](_0x1d3fac['query'],_0x2176ec['filters']));if(_0x1d3fac[_0x73be('0x32')][_0x73be('0x3e')]){_0x24faec[_0x73be('0x3c')]=_[_0x73be('0x3b')](_0x24faec[_0x73be('0x3c')],{'$or':_[_0x73be('0x31')](_0x24faec[_0x73be('0x35')],function(_0x1466e7){var _0x449c01={};_0x449c01[_0x1466e7]={'$like':'%'+_0x1d3fac[_0x73be('0x32')][_0x73be('0x3e')]+'%'};return _0x449c01;})});}_0x24faec=_['merge']({},_0x24faec,_0x1d3fac['options']);return _0x13efc3[_0x73be('0x4a')](_0x24faec);}})[_0x73be('0x26')](function(_0x454929){if(_0x454929){_0x4e2d8d=_0x454929['length'];if(!_0x1d3fac[_0x73be('0x32')][_0x73be('0x4e')](_0x73be('0x4f'))){_0x24faec['limit']=qs['limit'](_0x1d3fac['query'][_0x73be('0x1f')]);_0x24faec[_0x73be('0x1d')]=qs[_0x73be('0x1d')](_0x1d3fac[_0x73be('0x32')]['offset']);}return _0x13efc3[_0x73be('0x4a')](_0x24faec);}})[_0x73be('0x26')](function(_0x292490){if(_0x292490){return _0x292490?{'count':_0x4e2d8d,'rows':_0x292490}:null;}})[_0x73be('0x26')](respondWithResult(_0x1c307f,null))[_0x73be('0x42')](handleError(_0x1c307f,null));};exports[_0x73be('0x50')]=function(_0x87642f,_0x43b078,_0x339e3f){var _0x48959a={};var _0xa52360={};var _0x588d19;var _0x37a4b0;return db[_0x73be('0x2c')][_0x73be('0x4b')]({'where':{'id':_0x87642f[_0x73be('0x44')]['id']}})['then'](handleEntityNotFound(_0x43b078,null))['then'](function(_0x50ab47){if(_0x50ab47){_0x588d19=_0x50ab47;_0xa52360[_0x73be('0x30')]=_[_0x73be('0x33')](db[_0x73be('0x4c')][_0x73be('0x2d')]);_0xa52360[_0x73be('0x32')]=_[_0x73be('0x33')](_0x87642f[_0x73be('0x32')]);_0xa52360[_0x73be('0x39')]=_['intersection'](_0xa52360['model'],_0xa52360[_0x73be('0x32')]);_0x48959a[_0x73be('0x35')]=_[_0x73be('0x34')](_0xa52360['model'],qs['fields'](_0x87642f[_0x73be('0x32')][_0x73be('0x36')]));_0x48959a[_0x73be('0x35')]=_0x48959a['attributes'][_0x73be('0x4d')]?_0x48959a[_0x73be('0x35')]:_0xa52360[_0x73be('0x30')];_0x48959a[_0x73be('0x37')]=qs['sort'](_0x87642f[_0x73be('0x32')][_0x73be('0x38')]);_0x48959a[_0x73be('0x3c')]=qs['filters'](_[_0x73be('0x3a')](_0x87642f[_0x73be('0x32')],_0xa52360['filters']));if(_0x87642f[_0x73be('0x32')]['filter']){_0x48959a[_0x73be('0x3c')]=_[_0x73be('0x3b')](_0x48959a[_0x73be('0x3c')],{'$or':_['map'](_0x48959a[_0x73be('0x35')],function(_0x21b823){var _0x1e42a7={};_0x1e42a7[_0x21b823]={'$like':'%'+_0x87642f['query'][_0x73be('0x3e')]+'%'};return _0x1e42a7;})});}_0x48959a=_['merge']({},_0x48959a,_0x87642f['options']);return _0x588d19['getSubjects'](_0x48959a);}})[_0x73be('0x26')](function(_0x3004cf){if(_0x3004cf){_0x37a4b0=_0x3004cf[_0x73be('0x4d')];if(!_0x87642f[_0x73be('0x32')][_0x73be('0x4e')](_0x73be('0x4f'))){_0x48959a[_0x73be('0x1f')]=qs[_0x73be('0x1f')](_0x87642f[_0x73be('0x32')]['limit']);_0x48959a[_0x73be('0x1d')]=qs['offset'](_0x87642f['query'][_0x73be('0x1d')]);}return _0x588d19[_0x73be('0x50')](_0x48959a);}})[_0x73be('0x26')](function(_0x2901db){if(_0x2901db){return _0x2901db?{'count':_0x37a4b0,'rows':_0x2901db}:null;}})[_0x73be('0x26')](respondWithResult(_0x43b078,null))[_0x73be('0x42')](handleError(_0x43b078,null));};exports[_0x73be('0x51')]=function(_0x4d452a,_0x1a074d,_0x5605ef){var _0x1913db={};var _0x10af3f={};var _0x20b6d5;var _0x32c355;return db[_0x73be('0x2c')][_0x73be('0x4b')]({'where':{'id':_0x4d452a[_0x73be('0x44')]['id']}})[_0x73be('0x26')](handleEntityNotFound(_0x1a074d,null))[_0x73be('0x26')](function(_0x99eee){if(_0x99eee){_0x20b6d5=_0x99eee;_0x10af3f[_0x73be('0x30')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x10af3f[_0x73be('0x32')]=_[_0x73be('0x33')](_0x4d452a['query']);_0x10af3f[_0x73be('0x39')]=_[_0x73be('0x34')](_0x10af3f[_0x73be('0x30')],_0x10af3f[_0x73be('0x32')]);_0x1913db[_0x73be('0x35')]=_['intersection'](_0x10af3f[_0x73be('0x30')],qs[_0x73be('0x36')](_0x4d452a[_0x73be('0x32')][_0x73be('0x36')]));_0x1913db[_0x73be('0x35')]=_0x1913db[_0x73be('0x35')][_0x73be('0x4d')]?_0x1913db[_0x73be('0x35')]:_0x10af3f[_0x73be('0x30')];_0x1913db[_0x73be('0x37')]=qs[_0x73be('0x38')](_0x4d452a[_0x73be('0x32')][_0x73be('0x38')]);_0x1913db['where']=qs[_0x73be('0x39')](_['pick'](_0x4d452a[_0x73be('0x32')],_0x10af3f[_0x73be('0x39')]));if(_0x4d452a['query'][_0x73be('0x3e')]){_0x1913db[_0x73be('0x3c')]=_['merge'](_0x1913db[_0x73be('0x3c')],{'$or':_[_0x73be('0x31')](_0x1913db[_0x73be('0x35')],function(_0x1c83c6){var _0x16052c={};_0x16052c[_0x1c83c6]={'$like':'%'+_0x4d452a[_0x73be('0x32')]['filter']+'%'};return _0x16052c;})});}_0x1913db=_['merge']({},_0x1913db,_0x4d452a['options']);return _0x20b6d5['getDescriptions'](_0x1913db);}})[_0x73be('0x26')](function(_0x137e6f){if(_0x137e6f){_0x32c355=_0x137e6f[_0x73be('0x4d')];if(!_0x4d452a[_0x73be('0x32')][_0x73be('0x4e')](_0x73be('0x4f'))){_0x1913db[_0x73be('0x1f')]=qs[_0x73be('0x1f')](_0x4d452a['query'][_0x73be('0x1f')]);_0x1913db['offset']=qs['offset'](_0x4d452a[_0x73be('0x32')][_0x73be('0x1d')]);}return _0x20b6d5[_0x73be('0x51')](_0x1913db);}})[_0x73be('0x26')](function(_0x427086){if(_0x427086){return _0x427086?{'count':_0x32c355,'rows':_0x427086}:null;}})[_0x73be('0x26')](respondWithResult(_0x1a074d,null))[_0x73be('0x42')](handleError(_0x1a074d,null));}; \ No newline at end of file +var _0x0a53=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','params','fields','options','find','create','body','destroy','getFields','findOne','Dynamics365Field','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','offset','undefined','count','limit','set','apply','update','then','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a53,0xf7));var _0x30a5=function(_0x11b9be,_0x3a8373){_0x11b9be=_0x11b9be-0x0;var _0x32057d=_0x0a53[_0x11b9be];return _0x32057d;};'use strict';var emlformat=require(_0x30a5('0x0'));var rimraf=require(_0x30a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30a5('0x2'));var rp=require(_0x30a5('0x3'));var moment=require(_0x30a5('0x4'));var BPromise=require(_0x30a5('0x5'));var Mustache=require(_0x30a5('0x6'));var util=require('util');var path=require(_0x30a5('0x7'));var sox=require(_0x30a5('0x8'));var csv=require('to-csv');var ejs=require(_0x30a5('0x9'));var fs=require('fs');var fs_extra=require(_0x30a5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x30a5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x30a5('0xc'));var toCsv=require(_0x30a5('0xd'));var querystring=require(_0x30a5('0xe'));var Papa=require(_0x30a5('0xf'));var Redis=require('ioredis');var authService=require(_0x30a5('0x10'));var qs=require(_0x30a5('0x11'));var as=require(_0x30a5('0x12'));var hardwareService=require(_0x30a5('0x13'));var logger=require('../../config/logger')(_0x30a5('0x14'));var utils=require(_0x30a5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x583fc5,_0x35db52){_0x35db52=_0x35db52||0xcc;return function(_0x33089a){if(_0x33089a){return _0x583fc5[_0x30a5('0x16')](_0x35db52);}return _0x583fc5[_0x30a5('0x17')](_0x35db52)['end']();};}function respondWithResult(_0x5236f5,_0x3bcb38){_0x3bcb38=_0x3bcb38||0xc8;return function(_0x4e7010){if(_0x4e7010){return _0x5236f5['status'](_0x3bcb38)['json'](_0x4e7010);}};}function respondWithFilteredResult(_0x3c8773,_0x10d2b0){return function(_0x2ef380){if(_0x2ef380){var _0x56c132=typeof _0x10d2b0[_0x30a5('0x18')]===_0x30a5('0x19')&&typeof _0x10d2b0['limit']==='undefined';var _0x3f0abf=_0x2ef380['count'];var _0x511501=_0x56c132?0x0:_0x10d2b0[_0x30a5('0x18')];var _0x3f48e1=_0x56c132?_0x2ef380[_0x30a5('0x1a')]:_0x10d2b0[_0x30a5('0x18')]+_0x10d2b0[_0x30a5('0x1b')];var _0x2b8e40;if(_0x3f48e1>=_0x3f0abf){_0x3f48e1=_0x3f0abf;_0x2b8e40=0xc8;}else{_0x2b8e40=0xce;}_0x3c8773[_0x30a5('0x17')](_0x2b8e40);return _0x3c8773[_0x30a5('0x1c')]('Content-Range',_0x511501+'-'+_0x3f48e1+'/'+_0x3f0abf)['json'](_0x2ef380);}return null;};}function patchUpdates(_0x14bd0e){return function(_0x5a08dc){try{jsonpatch[_0x30a5('0x1d')](_0x5a08dc,_0x14bd0e,!![]);}catch(_0x718a74){return BPromise['reject'](_0x718a74);}return _0x5a08dc['save']();};}function saveUpdates(_0x61e86b,_0x27dd4f){return function(_0x4f6cdd){if(_0x4f6cdd){return _0x4f6cdd[_0x30a5('0x1e')](_0x61e86b)[_0x30a5('0x1f')](function(_0x47c808){return _0x47c808;});}return null;};}function removeEntity(_0x4476ac,_0x4108c3){return function(_0x357265){if(_0x357265){return _0x357265['destroy']()[_0x30a5('0x1f')](function(){_0x4476ac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58703b,_0x441cd9){return function(_0x4deb03){if(!_0x4deb03){_0x58703b[_0x30a5('0x16')](0x194);}return _0x4deb03;};}function handleError(_0x278eae,_0x2bc509){_0x2bc509=_0x2bc509||0x1f4;return function(_0x2ef2af){logger[_0x30a5('0x20')](_0x2ef2af[_0x30a5('0x21')]);if(_0x2ef2af[_0x30a5('0x22')]){delete _0x2ef2af[_0x30a5('0x22')];}_0x278eae['status'](_0x2bc509)[_0x30a5('0x23')](_0x2ef2af);};}exports[_0x30a5('0x24')]=function(_0x59c013,_0x406df8){var _0x1e1919={},_0xc47f9b={},_0x9240bd={'count':0x0,'rows':[]};var _0x1a8dd5=_[_0x30a5('0x25')](db[_0x30a5('0x26')][_0x30a5('0x27')],function(_0x148cc2){return{'name':_0x148cc2[_0x30a5('0x28')],'type':_0x148cc2[_0x30a5('0x29')][_0x30a5('0x2a')]};});_0xc47f9b[_0x30a5('0x2b')]=_[_0x30a5('0x25')](_0x1a8dd5,_0x30a5('0x22'));_0xc47f9b[_0x30a5('0x2c')]=_[_0x30a5('0x2d')](_0x59c013['query']);_0xc47f9b[_0x30a5('0x2e')]=_[_0x30a5('0x2f')](_0xc47f9b['model'],_0xc47f9b[_0x30a5('0x2c')]);_0x1e1919['attributes']=_[_0x30a5('0x2f')](_0xc47f9b[_0x30a5('0x2b')],qs['fields'](_0x59c013[_0x30a5('0x2c')]['fields']));_0x1e1919[_0x30a5('0x30')]=_0x1e1919[_0x30a5('0x30')][_0x30a5('0x31')]?_0x1e1919[_0x30a5('0x30')]:_0xc47f9b['model'];if(!_0x59c013[_0x30a5('0x2c')][_0x30a5('0x32')](_0x30a5('0x33'))){_0x1e1919['limit']=qs[_0x30a5('0x1b')](_0x59c013[_0x30a5('0x2c')][_0x30a5('0x1b')]);_0x1e1919[_0x30a5('0x18')]=qs[_0x30a5('0x18')](_0x59c013['query'][_0x30a5('0x18')]);}_0x1e1919[_0x30a5('0x34')]=qs[_0x30a5('0x35')](_0x59c013[_0x30a5('0x2c')][_0x30a5('0x35')]);_0x1e1919[_0x30a5('0x36')]=qs[_0x30a5('0x2e')](_['pick'](_0x59c013[_0x30a5('0x2c')],_0xc47f9b['filters']),_0x1a8dd5);if(_0x59c013[_0x30a5('0x2c')][_0x30a5('0x37')]){_0x1e1919[_0x30a5('0x36')]=_[_0x30a5('0x38')](_0x1e1919[_0x30a5('0x36')],{'$or':_['map'](_0x1a8dd5,function(_0x55b5fe){if(_0x55b5fe[_0x30a5('0x29')]!==_0x30a5('0x39')){var _0x2e824a={};_0x2e824a[_0x55b5fe[_0x30a5('0x22')]]={'$like':'%'+_0x59c013[_0x30a5('0x2c')][_0x30a5('0x37')]+'%'};return _0x2e824a;}})});}_0x1e1919=_[_0x30a5('0x38')]({},_0x1e1919,_0x59c013['options']);var _0x522ebe={'where':_0x1e1919[_0x30a5('0x36')]};return db[_0x30a5('0x26')][_0x30a5('0x1a')](_0x522ebe)['then'](function(_0x1030fb){_0x9240bd[_0x30a5('0x1a')]=_0x1030fb;if(_0x59c013[_0x30a5('0x2c')][_0x30a5('0x3a')]){_0x1e1919[_0x30a5('0x3b')]=[{'all':!![]}];}return db[_0x30a5('0x26')]['findAll'](_0x1e1919);})[_0x30a5('0x1f')](function(_0xde40f2){_0x9240bd['rows']=_0xde40f2;return _0x9240bd;})['then'](respondWithFilteredResult(_0x406df8,_0x1e1919))[_0x30a5('0x3c')](handleError(_0x406df8,null));};exports['show']=function(_0x5012da,_0x3a917b){var _0x303473={'raw':![],'where':{'id':_0x5012da[_0x30a5('0x3d')]['id']}},_0x44bb1b={};_0x44bb1b[_0x30a5('0x2b')]=_[_0x30a5('0x2d')](db['Dynamics365Configuration'][_0x30a5('0x27')]);_0x44bb1b[_0x30a5('0x2c')]=_[_0x30a5('0x2d')](_0x5012da['query']);_0x44bb1b[_0x30a5('0x2e')]=_[_0x30a5('0x2f')](_0x44bb1b['model'],_0x44bb1b[_0x30a5('0x2c')]);_0x303473[_0x30a5('0x30')]=_[_0x30a5('0x2f')](_0x44bb1b[_0x30a5('0x2b')],qs['fields'](_0x5012da[_0x30a5('0x2c')][_0x30a5('0x3e')]));_0x303473[_0x30a5('0x30')]=_0x303473[_0x30a5('0x30')][_0x30a5('0x31')]?_0x303473[_0x30a5('0x30')]:_0x44bb1b[_0x30a5('0x2b')];if(_0x5012da['query'][_0x30a5('0x3a')]){_0x303473[_0x30a5('0x3b')]=[{'all':!![]}];}_0x303473=_[_0x30a5('0x38')]({},_0x303473,_0x5012da[_0x30a5('0x3f')]);return db[_0x30a5('0x26')][_0x30a5('0x40')](_0x303473)[_0x30a5('0x1f')](handleEntityNotFound(_0x3a917b,null))[_0x30a5('0x1f')](respondWithResult(_0x3a917b,null))['catch'](handleError(_0x3a917b,null));};exports[_0x30a5('0x41')]=function(_0x1e8797,_0x55a1e0){return db[_0x30a5('0x26')][_0x30a5('0x41')](_0x1e8797['body'],{})['then'](respondWithResult(_0x55a1e0,0xc9))[_0x30a5('0x3c')](handleError(_0x55a1e0,null));};exports[_0x30a5('0x1e')]=function(_0x2e43b1,_0x2742a8){if(_0x2e43b1[_0x30a5('0x42')]['id']){delete _0x2e43b1[_0x30a5('0x42')]['id'];}return db[_0x30a5('0x26')][_0x30a5('0x40')]({'where':{'id':_0x2e43b1[_0x30a5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2742a8,null))[_0x30a5('0x1f')](saveUpdates(_0x2e43b1['body'],null))[_0x30a5('0x1f')](respondWithResult(_0x2742a8,null))[_0x30a5('0x3c')](handleError(_0x2742a8,null));};exports[_0x30a5('0x43')]=function(_0x2245f6,_0x28edfa){return db[_0x30a5('0x26')][_0x30a5('0x40')]({'where':{'id':_0x2245f6[_0x30a5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x28edfa,null))['then'](removeEntity(_0x28edfa,null))[_0x30a5('0x3c')](handleError(_0x28edfa,null));};exports[_0x30a5('0x44')]=function(_0x303c04,_0x5cdcdd,_0x28a06a){var _0x13b096={};var _0x5694f4={};var _0x61c3a2;var _0x533bbd;return db[_0x30a5('0x26')][_0x30a5('0x45')]({'where':{'id':_0x303c04[_0x30a5('0x3d')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x5cdcdd,null))[_0x30a5('0x1f')](function(_0x3c7787){if(_0x3c7787){_0x61c3a2=_0x3c7787;_0x5694f4[_0x30a5('0x2b')]=_[_0x30a5('0x2d')](db[_0x30a5('0x46')][_0x30a5('0x27')]);_0x5694f4['query']=_[_0x30a5('0x2d')](_0x303c04['query']);_0x5694f4[_0x30a5('0x2e')]=_['intersection'](_0x5694f4[_0x30a5('0x2b')],_0x5694f4[_0x30a5('0x2c')]);_0x13b096[_0x30a5('0x30')]=_[_0x30a5('0x2f')](_0x5694f4['model'],qs[_0x30a5('0x3e')](_0x303c04[_0x30a5('0x2c')][_0x30a5('0x3e')]));_0x13b096[_0x30a5('0x30')]=_0x13b096[_0x30a5('0x30')][_0x30a5('0x31')]?_0x13b096['attributes']:_0x5694f4[_0x30a5('0x2b')];_0x13b096[_0x30a5('0x34')]=qs[_0x30a5('0x35')](_0x303c04[_0x30a5('0x2c')][_0x30a5('0x35')]);_0x13b096['where']=qs['filters'](_[_0x30a5('0x47')](_0x303c04[_0x30a5('0x2c')],_0x5694f4[_0x30a5('0x2e')]));if(_0x303c04[_0x30a5('0x2c')][_0x30a5('0x37')]){_0x13b096['where']=_[_0x30a5('0x38')](_0x13b096[_0x30a5('0x36')],{'$or':_[_0x30a5('0x25')](_0x13b096[_0x30a5('0x30')],function(_0x13ae02){var _0x1026ce={};_0x1026ce[_0x13ae02]={'$like':'%'+_0x303c04[_0x30a5('0x2c')][_0x30a5('0x37')]+'%'};return _0x1026ce;})});}_0x13b096=_[_0x30a5('0x38')]({},_0x13b096,_0x303c04[_0x30a5('0x3f')]);return _0x61c3a2[_0x30a5('0x44')](_0x13b096);}})['then'](function(_0xd28eaa){if(_0xd28eaa){_0x533bbd=_0xd28eaa[_0x30a5('0x31')];if(!_0x303c04[_0x30a5('0x2c')][_0x30a5('0x32')](_0x30a5('0x33'))){_0x13b096['limit']=qs[_0x30a5('0x1b')](_0x303c04[_0x30a5('0x2c')][_0x30a5('0x1b')]);_0x13b096[_0x30a5('0x18')]=qs[_0x30a5('0x18')](_0x303c04[_0x30a5('0x2c')][_0x30a5('0x18')]);}return _0x61c3a2[_0x30a5('0x44')](_0x13b096);}})[_0x30a5('0x1f')](function(_0x4189cd){if(_0x4189cd){return _0x4189cd?{'count':_0x533bbd,'rows':_0x4189cd}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x5cdcdd,null))[_0x30a5('0x3c')](handleError(_0x5cdcdd,null));};exports[_0x30a5('0x48')]=function(_0xed64a0,_0x1522c1,_0x4aae00){var _0x516d1b={};var _0x2be43c={};var _0x5812d2;var _0x14d369;return db[_0x30a5('0x26')]['findOne']({'where':{'id':_0xed64a0[_0x30a5('0x3d')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x1522c1,null))[_0x30a5('0x1f')](function(_0x56c8e9){if(_0x56c8e9){_0x5812d2=_0x56c8e9;_0x2be43c[_0x30a5('0x2b')]=_[_0x30a5('0x2d')](db[_0x30a5('0x46')][_0x30a5('0x27')]);_0x2be43c[_0x30a5('0x2c')]=_[_0x30a5('0x2d')](_0xed64a0[_0x30a5('0x2c')]);_0x2be43c[_0x30a5('0x2e')]=_['intersection'](_0x2be43c[_0x30a5('0x2b')],_0x2be43c[_0x30a5('0x2c')]);_0x516d1b[_0x30a5('0x30')]=_['intersection'](_0x2be43c[_0x30a5('0x2b')],qs[_0x30a5('0x3e')](_0xed64a0[_0x30a5('0x2c')][_0x30a5('0x3e')]));_0x516d1b[_0x30a5('0x30')]=_0x516d1b[_0x30a5('0x30')][_0x30a5('0x31')]?_0x516d1b[_0x30a5('0x30')]:_0x2be43c[_0x30a5('0x2b')];_0x516d1b[_0x30a5('0x34')]=qs[_0x30a5('0x35')](_0xed64a0[_0x30a5('0x2c')][_0x30a5('0x35')]);_0x516d1b[_0x30a5('0x36')]=qs[_0x30a5('0x2e')](_[_0x30a5('0x47')](_0xed64a0['query'],_0x2be43c[_0x30a5('0x2e')]));if(_0xed64a0['query'][_0x30a5('0x37')]){_0x516d1b[_0x30a5('0x36')]=_[_0x30a5('0x38')](_0x516d1b[_0x30a5('0x36')],{'$or':_[_0x30a5('0x25')](_0x516d1b[_0x30a5('0x30')],function(_0x52f748){var _0x48c8f4={};_0x48c8f4[_0x52f748]={'$like':'%'+_0xed64a0['query'][_0x30a5('0x37')]+'%'};return _0x48c8f4;})});}_0x516d1b=_[_0x30a5('0x38')]({},_0x516d1b,_0xed64a0['options']);return _0x5812d2[_0x30a5('0x48')](_0x516d1b);}})[_0x30a5('0x1f')](function(_0x14d1d9){if(_0x14d1d9){_0x14d369=_0x14d1d9[_0x30a5('0x31')];if(!_0xed64a0[_0x30a5('0x2c')][_0x30a5('0x32')](_0x30a5('0x33'))){_0x516d1b['limit']=qs[_0x30a5('0x1b')](_0xed64a0[_0x30a5('0x2c')][_0x30a5('0x1b')]);_0x516d1b[_0x30a5('0x18')]=qs['offset'](_0xed64a0['query'][_0x30a5('0x18')]);}return _0x5812d2[_0x30a5('0x48')](_0x516d1b);}})['then'](function(_0x1b1c6a){if(_0x1b1c6a){return _0x1b1c6a?{'count':_0x14d369,'rows':_0x1b1c6a}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x1522c1,null))['catch'](handleError(_0x1522c1,null));};exports['getDescriptions']=function(_0x4eefc2,_0x4f1cbe,_0x5344ad){var _0x233325={};var _0x35b475={};var _0x2b072b;var _0xe1e197;return db['Dynamics365Configuration'][_0x30a5('0x45')]({'where':{'id':_0x4eefc2[_0x30a5('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4f1cbe,null))[_0x30a5('0x1f')](function(_0x5b06b9){if(_0x5b06b9){_0x2b072b=_0x5b06b9;_0x35b475[_0x30a5('0x2b')]=_['keys'](db['Dynamics365Field'][_0x30a5('0x27')]);_0x35b475[_0x30a5('0x2c')]=_[_0x30a5('0x2d')](_0x4eefc2[_0x30a5('0x2c')]);_0x35b475['filters']=_['intersection'](_0x35b475[_0x30a5('0x2b')],_0x35b475[_0x30a5('0x2c')]);_0x233325['attributes']=_['intersection'](_0x35b475[_0x30a5('0x2b')],qs['fields'](_0x4eefc2[_0x30a5('0x2c')][_0x30a5('0x3e')]));_0x233325['attributes']=_0x233325['attributes'][_0x30a5('0x31')]?_0x233325[_0x30a5('0x30')]:_0x35b475['model'];_0x233325[_0x30a5('0x34')]=qs[_0x30a5('0x35')](_0x4eefc2[_0x30a5('0x2c')][_0x30a5('0x35')]);_0x233325['where']=qs[_0x30a5('0x2e')](_[_0x30a5('0x47')](_0x4eefc2['query'],_0x35b475[_0x30a5('0x2e')]));if(_0x4eefc2[_0x30a5('0x2c')][_0x30a5('0x37')]){_0x233325[_0x30a5('0x36')]=_[_0x30a5('0x38')](_0x233325[_0x30a5('0x36')],{'$or':_['map'](_0x233325['attributes'],function(_0x1f3c10){var _0x49cd78={};_0x49cd78[_0x1f3c10]={'$like':'%'+_0x4eefc2['query'][_0x30a5('0x37')]+'%'};return _0x49cd78;})});}_0x233325=_[_0x30a5('0x38')]({},_0x233325,_0x4eefc2[_0x30a5('0x3f')]);return _0x2b072b[_0x30a5('0x49')](_0x233325);}})[_0x30a5('0x1f')](function(_0x146cfe){if(_0x146cfe){_0xe1e197=_0x146cfe[_0x30a5('0x31')];if(!_0x4eefc2['query'][_0x30a5('0x32')]('nolimit')){_0x233325[_0x30a5('0x1b')]=qs[_0x30a5('0x1b')](_0x4eefc2[_0x30a5('0x2c')][_0x30a5('0x1b')]);_0x233325[_0x30a5('0x18')]=qs[_0x30a5('0x18')](_0x4eefc2[_0x30a5('0x2c')][_0x30a5('0x18')]);}return _0x2b072b['getDescriptions'](_0x233325);}})[_0x30a5('0x1f')](function(_0x5d420b){if(_0x5d420b){return _0x5d420b?{'count':_0xe1e197,'rows':_0x5d420b}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x4f1cbe,null))[_0x30a5('0x3c')](handleError(_0x4f1cbe,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 050d275..2046fbd 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 _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x90e3d5,_0x3eea2b){var _0x5c2252=function(_0x3c7a2e){while(--_0x3c7a2e){_0x90e3d5['push'](_0x90e3d5['shift']());}};_0x5c2252(++_0x3eea2b);}(_0x3e74,0x175));var _0x43e7=function(_0x1c290a,_0x55c88b){_0x1c290a=_0x1c290a-0x0;var _0x5b128a=_0x3e74[_0x1c290a];return _0x5b128a;};'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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x50a06a,_0x1f18a9){var _0x4f200d=function(_0x24d9de){while(--_0x24d9de){_0x50a06a['push'](_0x50a06a['shift']());}};_0x4f200d(++_0x1f18a9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x00bb[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 7c04a3a..107d7d7 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 _0xa8fb=['client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0x1544c7,_0x52670b){var _0x1a350d=function(_0x97f4e9){while(--_0x97f4e9){_0x1544c7['push'](_0x1544c7['shift']());}};_0x1a350d(++_0x52670b);}(_0xa8fb,0xae));var _0xba8f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa8fb[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xba8f('0x0'));var moment=require(_0xba8f('0x1'));var BPromise=require(_0xba8f('0x2'));var rs=require(_0xba8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xba8f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xba8f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xba8f('0x6')][_0xba8f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bfa5c,_0x310543,_0x44e365){return new BPromise(function(_0x5790ad,_0x5eb9c2){return client[_0xba8f('0x8')](_0x1bfa5c,_0x44e365)[_0xba8f('0x9')](function(_0x3b0442){logger[_0xba8f('0xa')](_0xba8f('0xb'),_0x310543,_0xba8f('0xc'));logger[_0xba8f('0xd')](_0xba8f('0xe'),_0x310543,'request\x20sent',JSON[_0xba8f('0xf')](_0x3b0442));if(_0x3b0442[_0xba8f('0x10')]){if(_0x3b0442[_0xba8f('0x10')]['code']===0x1f4){logger[_0xba8f('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x310543,_0x3b0442[_0xba8f('0x10')]['message']);return _0x5eb9c2(_0x3b0442[_0xba8f('0x10')][_0xba8f('0x11')]);}logger[_0xba8f('0x10')](_0xba8f('0xb'),_0x310543,_0x3b0442[_0xba8f('0x10')]['message']);return _0x5790ad(_0x3b0442[_0xba8f('0x10')]['message']);}else{logger[_0xba8f('0xa')](_0xba8f('0xb'),_0x310543,_0xba8f('0xc'));_0x5790ad(_0x3b0442[_0xba8f('0x12')][_0xba8f('0x11')]);}})[_0xba8f('0x13')](function(_0x202b38){logger[_0xba8f('0x10')](_0xba8f('0xb'),_0x310543,_0x202b38);_0x5eb9c2(_0x202b38);});});} \ No newline at end of file +var _0x0985=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x44e982,_0xa57fe5){var _0x5660d0=function(_0x4770a2){while(--_0x4770a2){_0x44e982['push'](_0x44e982['shift']());}};_0x5660d0(++_0xa57fe5);}(_0x0985,0xf4));var _0x5098=function(_0x537684,_0x52e31b){_0x537684=_0x537684-0x0;var _0x4eff9b=_0x0985[_0x537684];return _0x4eff9b;};'use strict';var _=require(_0x5098('0x0'));var util=require(_0x5098('0x1'));var moment=require('moment');var BPromise=require(_0x5098('0x2'));var rs=require(_0x5098('0x3'));var fs=require('fs');var Redis=require(_0x5098('0x4'));var db=require(_0x5098('0x5'))['db'];var utils=require(_0x5098('0x6'));var logger=require(_0x5098('0x7'))(_0x5098('0x8'));var config=require(_0x5098('0x9'));var jayson=require(_0x5098('0xa'));var client=jayson[_0x5098('0xb')][_0x5098('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46fe3c,_0x5e2d36,_0x3351f0){return new BPromise(function(_0x37ffa9,_0x349334){return client[_0x5098('0xd')](_0x46fe3c,_0x3351f0)[_0x5098('0xe')](function(_0xc66561){logger['info'](_0x5098('0xf'),_0x5e2d36,_0x5098('0x10'));logger[_0x5098('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5e2d36,_0x5098('0x10'),JSON[_0x5098('0x12')](_0xc66561));if(_0xc66561[_0x5098('0x13')]){if(_0xc66561['error'][_0x5098('0x14')]===0x1f4){logger[_0x5098('0x13')](_0x5098('0xf'),_0x5e2d36,_0xc66561[_0x5098('0x13')][_0x5098('0x15')]);return _0x349334(_0xc66561[_0x5098('0x13')]['message']);}logger[_0x5098('0x13')](_0x5098('0xf'),_0x5e2d36,_0xc66561[_0x5098('0x13')][_0x5098('0x15')]);return _0x37ffa9(_0xc66561[_0x5098('0x13')][_0x5098('0x15')]);}else{logger['info'](_0x5098('0xf'),_0x5e2d36,'request\x20sent');_0x37ffa9(_0xc66561[_0x5098('0x16')][_0x5098('0x15')]);}})[_0x5098('0x17')](function(_0x245ae5){logger[_0x5098('0x13')](_0x5098('0xf'),_0x5e2d36,_0x245ae5);_0x349334(_0x245ae5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 16fef58..bcfc815 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 _0xc74f=['../../components/interaction/service','./intDynamics365Field.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x566a4e,_0xeeb3f6){var _0x36d409=function(_0x25960c){while(--_0x25960c){_0x566a4e['push'](_0x566a4e['shift']());}};_0x36d409(++_0xeeb3f6);}(_0xc74f,0x1e0));var _0xfc74=function(_0x3a6180,_0x36cfc7){_0x3a6180=_0x3a6180-0x0;var _0xda6e53=_0xc74f[_0x3a6180];return _0xda6e53;};'use strict';var multer=require(_0xfc74('0x0'));var util=require('util');var path=require(_0xfc74('0x1'));var timeout=require('connect-timeout');var express=require(_0xfc74('0x2'));var router=express[_0xfc74('0x3')]();var fs_extra=require(_0xfc74('0x4'));var auth=require(_0xfc74('0x5'));var interaction=require(_0xfc74('0x6'));var config=require('../../config/environment');var controller=require(_0xfc74('0x7'));router[_0xfc74('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfc74('0x8')](_0xfc74('0x9'),auth[_0xfc74('0xa')](),controller['show']);router[_0xfc74('0xb')]('/',auth['isAuthenticated'](),controller[_0xfc74('0xc')]);router[_0xfc74('0xd')](_0xfc74('0x9'),auth['isAuthenticated'](),controller[_0xfc74('0xe')]);router[_0xfc74('0xf')](_0xfc74('0x9'),auth['isAuthenticated'](),controller[_0xfc74('0x10')]);module[_0xfc74('0x11')]=router; \ No newline at end of file +var _0x9ed5=['get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x3ce36e,_0x56e47d){var _0xbc4e50=function(_0x763c9e){while(--_0x763c9e){_0x3ce36e['push'](_0x3ce36e['shift']());}};_0xbc4e50(++_0x56e47d);}(_0x9ed5,0x160));var _0x59ed=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x9ed5[_0x4b8156];return _0x4a819c;};'use strict';var multer=require('multer');var util=require(_0x59ed('0x0'));var path=require(_0x59ed('0x1'));var timeout=require(_0x59ed('0x2'));var express=require(_0x59ed('0x3'));var router=express[_0x59ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x59ed('0x5'));var interaction=require(_0x59ed('0x6'));var config=require(_0x59ed('0x7'));var controller=require(_0x59ed('0x8'));router[_0x59ed('0x9')]('/',auth[_0x59ed('0xa')](),controller[_0x59ed('0xb')]);router[_0x59ed('0x9')](_0x59ed('0xc'),auth[_0x59ed('0xa')](),controller[_0x59ed('0xd')]);router['post']('/',auth[_0x59ed('0xa')](),controller[_0x59ed('0xe')]);router['put'](_0x59ed('0xc'),auth[_0x59ed('0xa')](),controller[_0x59ed('0xf')]);router[_0x59ed('0x10')](_0x59ed('0xc'),auth[_0x59ed('0xa')](),controller[_0x59ed('0x11')]);module[_0x59ed('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index fadfbfa..c6b78f3 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 _0x53d6=['STRING','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x59c683,_0x209444){var _0x47251b=function(_0x4db046){while(--_0x4db046){_0x59c683['push'](_0x59c683['shift']());}};_0x47251b(++_0x209444);}(_0x53d6,0xa1));var _0x653d=function(_0x1ffd67,_0x1c18ba){_0x1ffd67=_0x1ffd67-0x0;var _0xce170f=_0x53d6[_0x1ffd67];return _0xce170f;};'use strict';var Sequelize=require(_0x653d('0x0'));module[_0x653d('0x1')]={'type':{'type':Sequelize[_0x653d('0x2')](_0x653d('0x3'),'variable',_0x653d('0x4'),_0x653d('0x5'),_0x653d('0x6')),'defaultValue':_0x653d('0x3')},'content':{'type':Sequelize[_0x653d('0x7')]},'key':{'type':Sequelize[_0x653d('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x653d('0x4'))},'keyContent':{'type':Sequelize[_0x653d('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x653d('0x7')]}}; \ No newline at end of file +var _0x7b91=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','exports'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x7b91,0x7f));var _0x17b9=function(_0x372979,_0x5c4cd9){_0x372979=_0x372979-0x0;var _0x518d3c=_0x7b91[_0x372979];return _0x518d3c;};'use strict';var Sequelize=require('sequelize');module[_0x17b9('0x0')]={'type':{'type':Sequelize[_0x17b9('0x1')](_0x17b9('0x2'),'variable','customVariable',_0x17b9('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x17b9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x17b9('0x1')]('string',_0x17b9('0x5'),_0x17b9('0x6'))},'keyContent':{'type':Sequelize[_0x17b9('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x17b9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17b9('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 6622816..dd6f354 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 _0xf685=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit'];(function(_0x4aad02,_0x25acc0){var _0x238924=function(_0x14fadf){while(--_0x14fadf){_0x4aad02['push'](_0x4aad02['shift']());}};_0x238924(++_0x25acc0);}(_0xf685,0x190));var _0x5f68=function(_0x282a80,_0xc08d67){_0x282a80=_0x282a80-0x0;var _0x4aaa15=_0xf685[_0x282a80];return _0x4aaa15;};'use strict';var emlformat=require(_0x5f68('0x0'));var rimraf=require(_0x5f68('0x1'));var zipdir=require(_0x5f68('0x2'));var jsonpatch=require(_0x5f68('0x3'));var rp=require('request-promise');var moment=require(_0x5f68('0x4'));var BPromise=require(_0x5f68('0x5'));var Mustache=require(_0x5f68('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5f68('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f68('0x8'));var _=require('lodash');var squel=require(_0x5f68('0x9'));var crypto=require('crypto');var jsforce=require(_0x5f68('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5f68('0x7'));var querystring=require('querystring');var Papa=require(_0x5f68('0xb'));var Redis=require(_0x5f68('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5f68('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f68('0xe'));var logger=require(_0x5f68('0xf'))(_0x5f68('0x10'));var utils=require(_0x5f68('0x11'));var config=require(_0x5f68('0x12'));var licenseUtil=require(_0x5f68('0x13'));var db=require(_0x5f68('0x14'))['db'];function respondWithStatusCode(_0xeaec1c,_0x4d01c5){_0x4d01c5=_0x4d01c5||0xcc;return function(_0x575da0){if(_0x575da0){return _0xeaec1c[_0x5f68('0x15')](_0x4d01c5);}return _0xeaec1c[_0x5f68('0x16')](_0x4d01c5)['end']();};}function respondWithResult(_0x28feb1,_0x289652){_0x289652=_0x289652||0xc8;return function(_0x57cb77){if(_0x57cb77){return _0x28feb1[_0x5f68('0x16')](_0x289652)[_0x5f68('0x17')](_0x57cb77);}};}function respondWithFilteredResult(_0x1d5b93,_0x5ce1bb){return function(_0x18ea91){if(_0x18ea91){var _0x1f4cdf=typeof _0x5ce1bb[_0x5f68('0x18')]==='undefined'&&typeof _0x5ce1bb[_0x5f68('0x19')]===_0x5f68('0x1a');var _0x46fd90=_0x18ea91[_0x5f68('0x1b')];var _0x5cbcb5=_0x1f4cdf?0x0:_0x5ce1bb[_0x5f68('0x18')];var _0x36f807=_0x1f4cdf?_0x18ea91['count']:_0x5ce1bb[_0x5f68('0x18')]+_0x5ce1bb['limit'];var _0x794e2b;if(_0x36f807>=_0x46fd90){_0x36f807=_0x46fd90;_0x794e2b=0xc8;}else{_0x794e2b=0xce;}_0x1d5b93[_0x5f68('0x16')](_0x794e2b);return _0x1d5b93[_0x5f68('0x1c')](_0x5f68('0x1d'),_0x5cbcb5+'-'+_0x36f807+'/'+_0x46fd90)['json'](_0x18ea91);}return null;};}function patchUpdates(_0xd6acd1){return function(_0x1f5167){try{jsonpatch[_0x5f68('0x1e')](_0x1f5167,_0xd6acd1,!![]);}catch(_0x37943b){return BPromise[_0x5f68('0x1f')](_0x37943b);}return _0x1f5167[_0x5f68('0x20')]();};}function saveUpdates(_0x4f40bb,_0x28f76f){return function(_0xb20262){if(_0xb20262){return _0xb20262[_0x5f68('0x21')](_0x4f40bb)[_0x5f68('0x22')](function(_0x507d26){return _0x507d26;});}return null;};}function removeEntity(_0xc9b3dd,_0x534b33){return function(_0x2c5924){if(_0x2c5924){return _0x2c5924[_0x5f68('0x23')]()['then'](function(){_0xc9b3dd[_0x5f68('0x16')](0xcc)[_0x5f68('0x24')]();});}};}function handleEntityNotFound(_0x3d81b8,_0x88727b){return function(_0x2e3471){if(!_0x2e3471){_0x3d81b8['sendStatus'](0x194);}return _0x2e3471;};}function handleError(_0x39d8eb,_0x33679e){_0x33679e=_0x33679e||0x1f4;return function(_0x11f58f){logger[_0x5f68('0x25')](_0x11f58f['stack']);if(_0x11f58f[_0x5f68('0x26')]){delete _0x11f58f[_0x5f68('0x26')];}_0x39d8eb['status'](_0x33679e)[_0x5f68('0x27')](_0x11f58f);};}exports['index']=function(_0x25cb2e,_0x7652b8){var _0x796f4a={},_0x5e25fb={},_0x98fb14={'count':0x0,'rows':[]};var _0x3ef177=_[_0x5f68('0x28')](db['Dynamics365Field']['rawAttributes'],function(_0x53d1d1){return{'name':_0x53d1d1[_0x5f68('0x29')],'type':_0x53d1d1['type']['key']};});_0x5e25fb[_0x5f68('0x2a')]=_[_0x5f68('0x28')](_0x3ef177,_0x5f68('0x26'));_0x5e25fb[_0x5f68('0x2b')]=_[_0x5f68('0x2c')](_0x25cb2e[_0x5f68('0x2b')]);_0x5e25fb[_0x5f68('0x2d')]=_[_0x5f68('0x2e')](_0x5e25fb['model'],_0x5e25fb['query']);_0x796f4a['attributes']=_[_0x5f68('0x2e')](_0x5e25fb[_0x5f68('0x2a')],qs[_0x5f68('0x2f')](_0x25cb2e[_0x5f68('0x2b')][_0x5f68('0x2f')]));_0x796f4a[_0x5f68('0x30')]=_0x796f4a[_0x5f68('0x30')]['length']?_0x796f4a['attributes']:_0x5e25fb[_0x5f68('0x2a')];if(!_0x25cb2e[_0x5f68('0x2b')][_0x5f68('0x31')](_0x5f68('0x32'))){_0x796f4a[_0x5f68('0x19')]=qs[_0x5f68('0x19')](_0x25cb2e['query']['limit']);_0x796f4a[_0x5f68('0x18')]=qs[_0x5f68('0x18')](_0x25cb2e[_0x5f68('0x2b')]['offset']);}_0x796f4a['order']=qs[_0x5f68('0x33')](_0x25cb2e['query'][_0x5f68('0x33')]);_0x796f4a['where']=qs[_0x5f68('0x2d')](_[_0x5f68('0x34')](_0x25cb2e[_0x5f68('0x2b')],_0x5e25fb[_0x5f68('0x2d')]),_0x3ef177);if(_0x25cb2e['query'][_0x5f68('0x35')]){_0x796f4a['where']=_[_0x5f68('0x36')](_0x796f4a[_0x5f68('0x37')],{'$or':_['map'](_0x3ef177,function(_0xa34089){if(_0xa34089[_0x5f68('0x38')]!=='VIRTUAL'){var _0x4262fd={};_0x4262fd[_0xa34089[_0x5f68('0x26')]]={'$like':'%'+_0x25cb2e[_0x5f68('0x2b')][_0x5f68('0x35')]+'%'};return _0x4262fd;}})});}_0x796f4a=_[_0x5f68('0x36')]({},_0x796f4a,_0x25cb2e[_0x5f68('0x39')]);var _0x4cfe4f={'where':_0x796f4a[_0x5f68('0x37')]};return db[_0x5f68('0x3a')][_0x5f68('0x1b')](_0x4cfe4f)[_0x5f68('0x22')](function(_0x285069){_0x98fb14[_0x5f68('0x1b')]=_0x285069;if(_0x25cb2e[_0x5f68('0x2b')][_0x5f68('0x3b')]){_0x796f4a[_0x5f68('0x3c')]=[{'all':!![]}];}return db[_0x5f68('0x3a')][_0x5f68('0x3d')](_0x796f4a);})[_0x5f68('0x22')](function(_0x12b3f4){_0x98fb14[_0x5f68('0x3e')]=_0x12b3f4;return _0x98fb14;})[_0x5f68('0x22')](respondWithFilteredResult(_0x7652b8,_0x796f4a))[_0x5f68('0x3f')](handleError(_0x7652b8,null));};exports[_0x5f68('0x40')]=function(_0x29ff96,_0x2f4766){var _0x29b01d={'raw':!![],'where':{'id':_0x29ff96['params']['id']}},_0x4b3715={};_0x4b3715[_0x5f68('0x2a')]=_[_0x5f68('0x2c')](db[_0x5f68('0x3a')][_0x5f68('0x41')]);_0x4b3715[_0x5f68('0x2b')]=_[_0x5f68('0x2c')](_0x29ff96[_0x5f68('0x2b')]);_0x4b3715[_0x5f68('0x2d')]=_[_0x5f68('0x2e')](_0x4b3715[_0x5f68('0x2a')],_0x4b3715['query']);_0x29b01d[_0x5f68('0x30')]=_[_0x5f68('0x2e')](_0x4b3715['model'],qs['fields'](_0x29ff96[_0x5f68('0x2b')]['fields']));_0x29b01d[_0x5f68('0x30')]=_0x29b01d[_0x5f68('0x30')][_0x5f68('0x42')]?_0x29b01d[_0x5f68('0x30')]:_0x4b3715['model'];if(_0x29ff96[_0x5f68('0x2b')][_0x5f68('0x3b')]){_0x29b01d[_0x5f68('0x3c')]=[{'all':!![]}];}_0x29b01d=_[_0x5f68('0x36')]({},_0x29b01d,_0x29ff96[_0x5f68('0x39')]);return db[_0x5f68('0x3a')][_0x5f68('0x43')](_0x29b01d)[_0x5f68('0x22')](handleEntityNotFound(_0x2f4766,null))[_0x5f68('0x22')](respondWithResult(_0x2f4766,null))[_0x5f68('0x3f')](handleError(_0x2f4766,null));};exports[_0x5f68('0x44')]=function(_0x25b15a,_0x2733be){return db[_0x5f68('0x3a')][_0x5f68('0x44')](_0x25b15a['body'],{})['then'](respondWithResult(_0x2733be,0xc9))[_0x5f68('0x3f')](handleError(_0x2733be,null));};exports[_0x5f68('0x21')]=function(_0x16cb74,_0x29ab3c){if(_0x16cb74[_0x5f68('0x45')]['id']){delete _0x16cb74[_0x5f68('0x45')]['id'];}return db['Dynamics365Field'][_0x5f68('0x43')]({'where':{'id':_0x16cb74[_0x5f68('0x46')]['id']}})['then'](handleEntityNotFound(_0x29ab3c,null))[_0x5f68('0x22')](saveUpdates(_0x16cb74[_0x5f68('0x45')],null))[_0x5f68('0x22')](respondWithResult(_0x29ab3c,null))['catch'](handleError(_0x29ab3c,null));};exports[_0x5f68('0x23')]=function(_0x2b410e,_0x5a5b7e){return db[_0x5f68('0x3a')][_0x5f68('0x43')]({'where':{'id':_0x2b410e['params']['id']}})['then'](handleEntityNotFound(_0x5a5b7e,null))[_0x5f68('0x22')](removeEntity(_0x5a5b7e,null))[_0x5f68('0x3f')](handleError(_0x5a5b7e,null));}; \ No newline at end of file +var _0x2ce2=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','save','update','then','end','error','stack','name','send','map','Dynamics365Field','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x10a5a7,_0x241ba8){var _0x402f69=function(_0x29e8c4){while(--_0x29e8c4){_0x10a5a7['push'](_0x10a5a7['shift']());}};_0x402f69(++_0x241ba8);}(_0x2ce2,0x1f1));var _0x22ce=function(_0xe14ee9,_0x4cd8e1){_0xe14ee9=_0xe14ee9-0x0;var _0x1dda60=_0x2ce2[_0xe14ee9];return _0x1dda60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22ce('0x0'));var zipdir=require(_0x22ce('0x1'));var jsonpatch=require(_0x22ce('0x2'));var rp=require('request-promise');var moment=require(_0x22ce('0x3'));var BPromise=require(_0x22ce('0x4'));var Mustache=require(_0x22ce('0x5'));var util=require(_0x22ce('0x6'));var path=require(_0x22ce('0x7'));var sox=require(_0x22ce('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(_0x22ce('0x9'));var jsforce=require(_0x22ce('0xa'));var deskjs=require(_0x22ce('0xb'));var toCsv=require(_0x22ce('0xc'));var querystring=require(_0x22ce('0xd'));var Papa=require(_0x22ce('0xe'));var Redis=require('ioredis');var authService=require(_0x22ce('0xf'));var qs=require(_0x22ce('0x10'));var as=require(_0x22ce('0x11'));var hardwareService=require(_0x22ce('0x12'));var logger=require(_0x22ce('0x13'))(_0x22ce('0x14'));var utils=require(_0x22ce('0x15'));var config=require(_0x22ce('0x16'));var licenseUtil=require(_0x22ce('0x17'));var db=require(_0x22ce('0x18'))['db'];function respondWithStatusCode(_0x4756c3,_0x2a7dfd){_0x2a7dfd=_0x2a7dfd||0xcc;return function(_0x463305){if(_0x463305){return _0x4756c3[_0x22ce('0x19')](_0x2a7dfd);}return _0x4756c3[_0x22ce('0x1a')](_0x2a7dfd)['end']();};}function respondWithResult(_0x246c74,_0x3c0e37){_0x3c0e37=_0x3c0e37||0xc8;return function(_0x50ef3d){if(_0x50ef3d){return _0x246c74[_0x22ce('0x1a')](_0x3c0e37)['json'](_0x50ef3d);}};}function respondWithFilteredResult(_0x54518a,_0x29456e){return function(_0x72ed8b){if(_0x72ed8b){var _0x3bbfa1=typeof _0x29456e[_0x22ce('0x1b')]==='undefined'&&typeof _0x29456e[_0x22ce('0x1c')]===_0x22ce('0x1d');var _0x298773=_0x72ed8b[_0x22ce('0x1e')];var _0x450694=_0x3bbfa1?0x0:_0x29456e['offset'];var _0x2d2e59=_0x3bbfa1?_0x72ed8b['count']:_0x29456e[_0x22ce('0x1b')]+_0x29456e[_0x22ce('0x1c')];var _0xf729b6;if(_0x2d2e59>=_0x298773){_0x2d2e59=_0x298773;_0xf729b6=0xc8;}else{_0xf729b6=0xce;}_0x54518a[_0x22ce('0x1a')](_0xf729b6);return _0x54518a[_0x22ce('0x1f')](_0x22ce('0x20'),_0x450694+'-'+_0x2d2e59+'/'+_0x298773)[_0x22ce('0x21')](_0x72ed8b);}return null;};}function patchUpdates(_0x41baf8){return function(_0x59b769){try{jsonpatch['apply'](_0x59b769,_0x41baf8,!![]);}catch(_0x3f21ca){return BPromise['reject'](_0x3f21ca);}return _0x59b769[_0x22ce('0x22')]();};}function saveUpdates(_0x38de69,_0x536ce0){return function(_0x1fb013){if(_0x1fb013){return _0x1fb013[_0x22ce('0x23')](_0x38de69)[_0x22ce('0x24')](function(_0x176fd7){return _0x176fd7;});}return null;};}function removeEntity(_0x4acf22,_0x5e4083){return function(_0x2642c8){if(_0x2642c8){return _0x2642c8['destroy']()[_0x22ce('0x24')](function(){_0x4acf22['status'](0xcc)[_0x22ce('0x25')]();});}};}function handleEntityNotFound(_0xc49c0c,_0x4ef018){return function(_0x375f8f){if(!_0x375f8f){_0xc49c0c[_0x22ce('0x19')](0x194);}return _0x375f8f;};}function handleError(_0x424fe9,_0x2cbde1){_0x2cbde1=_0x2cbde1||0x1f4;return function(_0x52fed8){logger[_0x22ce('0x26')](_0x52fed8[_0x22ce('0x27')]);if(_0x52fed8['name']){delete _0x52fed8[_0x22ce('0x28')];}_0x424fe9[_0x22ce('0x1a')](_0x2cbde1)[_0x22ce('0x29')](_0x52fed8);};}exports['index']=function(_0x5d1383,_0x2979b1){var _0x56b145={},_0x3bc220={},_0x19847c={'count':0x0,'rows':[]};var _0x3d4578=_[_0x22ce('0x2a')](db[_0x22ce('0x2b')][_0x22ce('0x2c')],function(_0x5feb3c){return{'name':_0x5feb3c['fieldName'],'type':_0x5feb3c['type']['key']};});_0x3bc220[_0x22ce('0x2d')]=_[_0x22ce('0x2a')](_0x3d4578,_0x22ce('0x28'));_0x3bc220['query']=_[_0x22ce('0x2e')](_0x5d1383['query']);_0x3bc220[_0x22ce('0x2f')]=_[_0x22ce('0x30')](_0x3bc220['model'],_0x3bc220[_0x22ce('0x31')]);_0x56b145[_0x22ce('0x32')]=_['intersection'](_0x3bc220[_0x22ce('0x2d')],qs['fields'](_0x5d1383[_0x22ce('0x31')][_0x22ce('0x33')]));_0x56b145[_0x22ce('0x32')]=_0x56b145['attributes'][_0x22ce('0x34')]?_0x56b145[_0x22ce('0x32')]:_0x3bc220[_0x22ce('0x2d')];if(!_0x5d1383['query'][_0x22ce('0x35')](_0x22ce('0x36'))){_0x56b145['limit']=qs[_0x22ce('0x1c')](_0x5d1383[_0x22ce('0x31')][_0x22ce('0x1c')]);_0x56b145[_0x22ce('0x1b')]=qs[_0x22ce('0x1b')](_0x5d1383[_0x22ce('0x31')][_0x22ce('0x1b')]);}_0x56b145[_0x22ce('0x37')]=qs[_0x22ce('0x38')](_0x5d1383[_0x22ce('0x31')][_0x22ce('0x38')]);_0x56b145[_0x22ce('0x39')]=qs['filters'](_[_0x22ce('0x3a')](_0x5d1383[_0x22ce('0x31')],_0x3bc220[_0x22ce('0x2f')]),_0x3d4578);if(_0x5d1383['query'][_0x22ce('0x3b')]){_0x56b145[_0x22ce('0x39')]=_[_0x22ce('0x3c')](_0x56b145[_0x22ce('0x39')],{'$or':_['map'](_0x3d4578,function(_0x5d7345){if(_0x5d7345[_0x22ce('0x3d')]!==_0x22ce('0x3e')){var _0xde43b6={};_0xde43b6[_0x5d7345[_0x22ce('0x28')]]={'$like':'%'+_0x5d1383[_0x22ce('0x31')][_0x22ce('0x3b')]+'%'};return _0xde43b6;}})});}_0x56b145=_['merge']({},_0x56b145,_0x5d1383[_0x22ce('0x3f')]);var _0x370b13={'where':_0x56b145[_0x22ce('0x39')]};return db['Dynamics365Field'][_0x22ce('0x1e')](_0x370b13)[_0x22ce('0x24')](function(_0x38cbce){_0x19847c['count']=_0x38cbce;if(_0x5d1383['query'][_0x22ce('0x40')]){_0x56b145[_0x22ce('0x41')]=[{'all':!![]}];}return db[_0x22ce('0x2b')][_0x22ce('0x42')](_0x56b145);})[_0x22ce('0x24')](function(_0x10f93f){_0x19847c[_0x22ce('0x43')]=_0x10f93f;return _0x19847c;})[_0x22ce('0x24')](respondWithFilteredResult(_0x2979b1,_0x56b145))['catch'](handleError(_0x2979b1,null));};exports[_0x22ce('0x44')]=function(_0x4a92b7,_0x3f781d){var _0x67f9e5={'raw':!![],'where':{'id':_0x4a92b7[_0x22ce('0x45')]['id']}},_0xf723d2={};_0xf723d2[_0x22ce('0x2d')]=_[_0x22ce('0x2e')](db[_0x22ce('0x2b')][_0x22ce('0x2c')]);_0xf723d2[_0x22ce('0x31')]=_[_0x22ce('0x2e')](_0x4a92b7[_0x22ce('0x31')]);_0xf723d2['filters']=_[_0x22ce('0x30')](_0xf723d2[_0x22ce('0x2d')],_0xf723d2[_0x22ce('0x31')]);_0x67f9e5[_0x22ce('0x32')]=_[_0x22ce('0x30')](_0xf723d2['model'],qs['fields'](_0x4a92b7[_0x22ce('0x31')][_0x22ce('0x33')]));_0x67f9e5[_0x22ce('0x32')]=_0x67f9e5[_0x22ce('0x32')][_0x22ce('0x34')]?_0x67f9e5[_0x22ce('0x32')]:_0xf723d2[_0x22ce('0x2d')];if(_0x4a92b7[_0x22ce('0x31')][_0x22ce('0x40')]){_0x67f9e5['include']=[{'all':!![]}];}_0x67f9e5=_['merge']({},_0x67f9e5,_0x4a92b7[_0x22ce('0x3f')]);return db[_0x22ce('0x2b')][_0x22ce('0x46')](_0x67f9e5)[_0x22ce('0x24')](handleEntityNotFound(_0x3f781d,null))[_0x22ce('0x24')](respondWithResult(_0x3f781d,null))[_0x22ce('0x47')](handleError(_0x3f781d,null));};exports[_0x22ce('0x48')]=function(_0x487124,_0x378f20){return db['Dynamics365Field'][_0x22ce('0x48')](_0x487124[_0x22ce('0x49')],{})['then'](respondWithResult(_0x378f20,0xc9))[_0x22ce('0x47')](handleError(_0x378f20,null));};exports[_0x22ce('0x23')]=function(_0x360102,_0x45c55b){if(_0x360102[_0x22ce('0x49')]['id']){delete _0x360102[_0x22ce('0x49')]['id'];}return db['Dynamics365Field'][_0x22ce('0x46')]({'where':{'id':_0x360102[_0x22ce('0x45')]['id']}})['then'](handleEntityNotFound(_0x45c55b,null))[_0x22ce('0x24')](saveUpdates(_0x360102[_0x22ce('0x49')],null))['then'](respondWithResult(_0x45c55b,null))[_0x22ce('0x47')](handleError(_0x45c55b,null));};exports['destroy']=function(_0x515768,_0xd34063){return db[_0x22ce('0x2b')]['find']({'where':{'id':_0x515768[_0x22ce('0x45')]['id']}})[_0x22ce('0x24')](handleEntityNotFound(_0xd34063,null))[_0x22ce('0x24')](removeEntity(_0xd34063,null))[_0x22ce('0x47')](handleError(_0xd34063,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 68c8049..2f302c4 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 _0xfd67=['../../config/environment','define','Dynamics365Field','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x39bd4b,_0x5ea984){var _0x1ec1ec=function(_0x36fe1e){while(--_0x36fe1e){_0x39bd4b['push'](_0x39bd4b['shift']());}};_0x1ec1ec(++_0x5ea984);}(_0xfd67,0x139));var _0x7fd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd67[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7fd6('0x0'));var util=require('util');var logger=require(_0x7fd6('0x1'))(_0x7fd6('0x2'));var moment=require(_0x7fd6('0x3'));var BPromise=require(_0x7fd6('0x4'));var rp=require(_0x7fd6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7fd6('0x6'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x3a9e4e,_0x5c7549){return _0x3a9e4e[_0x7fd6('0x7')](_0x7fd6('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7fd6('0x9'),_0x7fd6('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfcc9=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x126c6c,_0x3d6fae){var _0x2945ad=function(_0x30c709){while(--_0x30c709){_0x126c6c['push'](_0x126c6c['shift']());}};_0x2945ad(++_0x3d6fae);}(_0xfcc9,0xe8));var _0x9fcc=function(_0x286595,_0x29f350){_0x286595=_0x286595-0x0;var _0x3ea6b8=_0xfcc9[_0x286595];return _0x3ea6b8;};'use strict';var _=require(_0x9fcc('0x0'));var util=require(_0x9fcc('0x1'));var logger=require(_0x9fcc('0x2'))(_0x9fcc('0x3'));var moment=require(_0x9fcc('0x4'));var BPromise=require('bluebird');var rp=require(_0x9fcc('0x5'));var fs=require('fs');var path=require(_0x9fcc('0x6'));var rimraf=require(_0x9fcc('0x7'));var config=require(_0x9fcc('0x8'));var attributes=require(_0x9fcc('0x9'));module[_0x9fcc('0xa')]=function(_0x185b75,_0x4c95df){return _0x185b75[_0x9fcc('0xb')](_0x9fcc('0xc'),attributes,{'tableName':_0x9fcc('0xd'),'paranoid':![],'indexes':[{'name':_0x9fcc('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 902e90b..6d2579a 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 _0x8f96=['../../config/utils','../../config/logger','rpc','client','request','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x8f96,0x151));var _0x68f9=function(_0x4343ca,_0x3a4cd0){_0x4343ca=_0x4343ca-0x0;var _0x2ed056=_0x8f96[_0x4343ca];return _0x2ed056;};'use strict';var _=require(_0x68f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x68f9('0x1'));var rs=require(_0x68f9('0x2'));var fs=require('fs');var Redis=require(_0x68f9('0x3'));var db=require(_0x68f9('0x4'))['db'];var utils=require(_0x68f9('0x5'));var logger=require(_0x68f9('0x6'))(_0x68f9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x68f9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23f4fe,_0x27d296,_0xed920b){return new BPromise(function(_0x2b1a28,_0x371460){return client[_0x68f9('0x9')](_0x23f4fe,_0xed920b)['then'](function(_0x22513d){logger['info'](_0x68f9('0xa'),_0x27d296,_0x68f9('0xb'));logger[_0x68f9('0xc')](_0x68f9('0xd'),_0x27d296,_0x68f9('0xb'),JSON[_0x68f9('0xe')](_0x22513d));if(_0x22513d[_0x68f9('0xf')]){if(_0x22513d[_0x68f9('0xf')]['code']===0x1f4){logger[_0x68f9('0xf')](_0x68f9('0xa'),_0x27d296,_0x22513d[_0x68f9('0xf')][_0x68f9('0x10')]);return _0x371460(_0x22513d[_0x68f9('0xf')][_0x68f9('0x10')]);}logger[_0x68f9('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x27d296,_0x22513d[_0x68f9('0xf')][_0x68f9('0x10')]);return _0x2b1a28(_0x22513d[_0x68f9('0xf')]['message']);}else{logger['info'](_0x68f9('0xa'),_0x27d296,_0x68f9('0xb'));_0x2b1a28(_0x22513d['result'][_0x68f9('0x10')]);}})[_0x68f9('0x11')](function(_0xe68706){logger[_0x68f9('0xf')](_0x68f9('0xa'),_0x27d296,_0xe68706);_0x371460(_0xe68706);});});} \ No newline at end of file +var _0x7d13=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','../../mysqldb'];(function(_0x2c2622,_0x57f844){var _0x91774f=function(_0x4e89e7){while(--_0x4e89e7){_0x2c2622['push'](_0x2c2622['shift']());}};_0x91774f(++_0x57f844);}(_0x7d13,0x151));var _0x37d1=function(_0x544b3f,_0x4d8b66){_0x544b3f=_0x544b3f-0x0;var _0x15787f=_0x7d13[_0x544b3f];return _0x15787f;};'use strict';var _=require('lodash');var util=require(_0x37d1('0x0'));var moment=require(_0x37d1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37d1('0x2'))['db'];var utils=require(_0x37d1('0x3'));var logger=require('../../config/logger')(_0x37d1('0x4'));var config=require(_0x37d1('0x5'));var jayson=require(_0x37d1('0x6'));var client=jayson[_0x37d1('0x7')][_0x37d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x389a86,_0x19223e,_0x310384){return new BPromise(function(_0x3b5630,_0x51eeb0){return client['request'](_0x389a86,_0x310384)[_0x37d1('0x9')](function(_0x5b5029){logger[_0x37d1('0xa')](_0x37d1('0xb'),_0x19223e,_0x37d1('0xc'));logger[_0x37d1('0xd')](_0x37d1('0xe'),_0x19223e,_0x37d1('0xc'),JSON['stringify'](_0x5b5029));if(_0x5b5029['error']){if(_0x5b5029[_0x37d1('0xf')][_0x37d1('0x10')]===0x1f4){logger[_0x37d1('0xf')](_0x37d1('0xb'),_0x19223e,_0x5b5029[_0x37d1('0xf')][_0x37d1('0x11')]);return _0x51eeb0(_0x5b5029['error'][_0x37d1('0x11')]);}logger[_0x37d1('0xf')](_0x37d1('0xb'),_0x19223e,_0x5b5029[_0x37d1('0xf')][_0x37d1('0x11')]);return _0x3b5630(_0x5b5029[_0x37d1('0xf')][_0x37d1('0x11')]);}else{logger['info'](_0x37d1('0xb'),_0x19223e,_0x37d1('0xc'));_0x3b5630(_0x5b5029[_0x37d1('0x12')]['message']);}})[_0x37d1('0x13')](function(_0x1c4b26){logger[_0x37d1('0xf')](_0x37d1('0xb'),_0x19223e,_0x1c4b26);_0x51eeb0(_0x1c4b26);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 6e94e22..b8c4951 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 _0xa384=['show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','/:id','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xa384,0x79));var _0x4a38=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xa384[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0x4a38('0x0'));var util=require('util');var path=require(_0x4a38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4a38('0x2')]();var fs_extra=require(_0x4a38('0x3'));var auth=require(_0x4a38('0x4'));var interaction=require(_0x4a38('0x5'));var config=require(_0x4a38('0x6'));var controller=require(_0x4a38('0x7'));router[_0x4a38('0x8')]('/',auth[_0x4a38('0x9')](),controller[_0x4a38('0xa')]);router[_0x4a38('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4a38('0xb')]);router['get'](_0x4a38('0xc'),auth[_0x4a38('0x9')](),controller[_0x4a38('0xd')]);router[_0x4a38('0x8')]('/:id/fields',auth[_0x4a38('0x9')](),controller[_0x4a38('0xe')]);router[_0x4a38('0xf')]('/',auth[_0x4a38('0x9')](),controller['create']);router[_0x4a38('0xf')](_0x4a38('0xc'),auth[_0x4a38('0x9')](),controller[_0x4a38('0x10')]);router[_0x4a38('0x11')](_0x4a38('0x12'),auth[_0x4a38('0x9')](),controller[_0x4a38('0x13')]);router['delete'](_0x4a38('0x12'),auth[_0x4a38('0x9')](),controller[_0x4a38('0x14')]);module[_0x4a38('0x15')]=router; \ No newline at end of file +var _0xe62c=['/:id','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index'];(function(_0x2cdae9,_0x7878bb){var _0x3d4346=function(_0x14bb1b){while(--_0x14bb1b){_0x2cdae9['push'](_0x2cdae9['shift']());}};_0x3d4346(++_0x7878bb);}(_0xe62c,0x1d9));var _0xce62=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xe62c[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0xce62('0x0'));var util=require(_0xce62('0x1'));var path=require('path');var timeout=require(_0xce62('0x2'));var express=require(_0xce62('0x3'));var router=express[_0xce62('0x4')]();var fs_extra=require(_0xce62('0x5'));var auth=require(_0xce62('0x6'));var interaction=require(_0xce62('0x7'));var config=require('../../config/environment');var controller=require(_0xce62('0x8'));router[_0xce62('0x9')]('/',auth['isAuthenticated'](),controller[_0xce62('0xa')]);router[_0xce62('0x9')](_0xce62('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xce62('0x9')](_0xce62('0xc'),auth['isAuthenticated'](),controller[_0xce62('0xd')]);router[_0xce62('0x9')](_0xce62('0xe'),auth[_0xce62('0xf')](),controller[_0xce62('0x10')]);router['post']('/',auth[_0xce62('0xf')](),controller['create']);router[_0xce62('0x11')]('/:id/configurations',auth[_0xce62('0xf')](),controller[_0xce62('0x12')]);router['put'](_0xce62('0xb'),auth[_0xce62('0xf')](),controller[_0xce62('0x13')]);router['delete']('/:id',auth[_0xce62('0xf')](),controller[_0xce62('0x14')]);module[_0xce62('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 9a1a38a..094df6a 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 _0xf61e=['remoteUri','sequelize','exports','STRING','username'];(function(_0x522363,_0x31ebd2){var _0x507e25=function(_0x401bfa){while(--_0x401bfa){_0x522363['push'](_0x522363['shift']());}};_0x507e25(++_0x31ebd2);}(_0xf61e,0x191));var _0xef61=function(_0x9aae8e,_0x3cd72b){_0x9aae8e=_0x9aae8e-0x0;var _0x4b3402=_0xf61e[_0x9aae8e];return _0x4b3402;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')]},'description':{'type':Sequelize[_0xef61('0x2')]},'username':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3')},'apiKey':{'type':Sequelize[_0xef61('0x2')]},'remoteUri':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x4')},'serverUrl':{'type':Sequelize[_0xef61('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xadb5,0xad));var _0x5adb=function(_0xd456c9,_0x11765f){_0xd456c9=_0xd456c9-0x0;var _0x598be7=_0xadb5[_0xd456c9];return _0x598be7;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e378749..ad85afe 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 _0x8f37=['sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','show','merge','find','catch','create','body','params','findOne','length','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','priority','source','ticket_type','group','remove','default','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x8f37,0x190));var _0x78f3=function(_0x4c1ea3,_0x2637e0){_0x4c1ea3=_0x4c1ea3-0x0;var _0x28c216=_0x8f37[_0x4c1ea3];return _0x28c216;};'use strict';var emlformat=require(_0x78f3('0x0'));var rimraf=require(_0x78f3('0x1'));var zipdir=require(_0x78f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x78f3('0x3'));var BPromise=require(_0x78f3('0x4'));var Mustache=require(_0x78f3('0x5'));var util=require('util');var path=require(_0x78f3('0x6'));var sox=require('sox');var csv=require(_0x78f3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78f3('0x8'));var _=require(_0x78f3('0x9'));var squel=require('squel');var crypto=require(_0x78f3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78f3('0xb'));var toCsv=require(_0x78f3('0x7'));var querystring=require('querystring');var Papa=require(_0x78f3('0xc'));var Redis=require(_0x78f3('0xd'));var authService=require(_0x78f3('0xe'));var qs=require(_0x78f3('0xf'));var as=require(_0x78f3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78f3('0x11'))(_0x78f3('0x12'));var utils=require('../../config/utils');var config=require(_0x78f3('0x13'));var licenseUtil=require(_0x78f3('0x14'));var db=require(_0x78f3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x134063,_0x217945){_0x217945=_0x217945||0xcc;return function(_0x199fdb){if(_0x199fdb){return _0x134063[_0x78f3('0x16')](_0x217945);}return _0x134063[_0x78f3('0x17')](_0x217945)[_0x78f3('0x18')]();};}function respondWithResult(_0x33944e,_0x38db12){_0x38db12=_0x38db12||0xc8;return function(_0x1b0f4c){if(_0x1b0f4c){return _0x33944e[_0x78f3('0x17')](_0x38db12)[_0x78f3('0x19')](_0x1b0f4c);}};}function respondWithFilteredResult(_0x1e7a83,_0x3e2a15){return function(_0x453270){if(_0x453270){var _0x17172c=typeof _0x3e2a15[_0x78f3('0x1a')]===_0x78f3('0x1b')&&typeof _0x3e2a15[_0x78f3('0x1c')]===_0x78f3('0x1b');var _0x33d1c5=_0x453270[_0x78f3('0x1d')];var _0x1c25f2=_0x17172c?0x0:_0x3e2a15[_0x78f3('0x1a')];var _0x4a5db4=_0x17172c?_0x453270[_0x78f3('0x1d')]:_0x3e2a15[_0x78f3('0x1a')]+_0x3e2a15['limit'];var _0x4de869;if(_0x4a5db4>=_0x33d1c5){_0x4a5db4=_0x33d1c5;_0x4de869=0xc8;}else{_0x4de869=0xce;}_0x1e7a83['status'](_0x4de869);return _0x1e7a83[_0x78f3('0x1e')](_0x78f3('0x1f'),_0x1c25f2+'-'+_0x4a5db4+'/'+_0x33d1c5)[_0x78f3('0x19')](_0x453270);}return null;};}function patchUpdates(_0x11ee05){return function(_0x14d4ae){try{jsonpatch['apply'](_0x14d4ae,_0x11ee05,!![]);}catch(_0x369704){return BPromise[_0x78f3('0x20')](_0x369704);}return _0x14d4ae[_0x78f3('0x21')]();};}function saveUpdates(_0x3f623f,_0x2049a3){return function(_0x11de3e){if(_0x11de3e){return _0x11de3e[_0x78f3('0x22')](_0x3f623f)[_0x78f3('0x23')](function(_0x18189e){return _0x18189e;});}return null;};}function removeEntity(_0x3c6bf8,_0x5ea7fd){return function(_0x46f3a0){if(_0x46f3a0){return _0x46f3a0[_0x78f3('0x24')]()['then'](function(){_0x3c6bf8[_0x78f3('0x17')](0xcc)[_0x78f3('0x18')]();});}};}function handleEntityNotFound(_0x2d6df8,_0x43a8c8){return function(_0x1e36cf){if(!_0x1e36cf){_0x2d6df8['sendStatus'](0x194);}return _0x1e36cf;};}function handleError(_0x35ac35,_0x197837){_0x197837=_0x197837||0x1f4;return function(_0xf0607f){logger[_0x78f3('0x25')](_0xf0607f[_0x78f3('0x26')]);if(_0xf0607f['name']){delete _0xf0607f[_0x78f3('0x27')];}_0x35ac35[_0x78f3('0x17')](_0x197837)[_0x78f3('0x28')](_0xf0607f);};}exports[_0x78f3('0x29')]=function(_0x32e52f,_0x31f6c5){var _0x2de1bb={},_0x170d63={},_0x1b9c69={'count':0x0,'rows':[]};var _0x2b7308=_[_0x78f3('0x2a')](db[_0x78f3('0x2b')][_0x78f3('0x2c')],function(_0x9c0636){return{'name':_0x9c0636[_0x78f3('0x2d')],'type':_0x9c0636[_0x78f3('0x2e')][_0x78f3('0x2f')]};});_0x170d63[_0x78f3('0x30')]=_[_0x78f3('0x2a')](_0x2b7308,_0x78f3('0x27'));_0x170d63[_0x78f3('0x31')]=_[_0x78f3('0x32')](_0x32e52f[_0x78f3('0x31')]);_0x170d63['filters']=_[_0x78f3('0x33')](_0x170d63['model'],_0x170d63[_0x78f3('0x31')]);_0x2de1bb[_0x78f3('0x34')]=_[_0x78f3('0x33')](_0x170d63['model'],qs[_0x78f3('0x35')](_0x32e52f[_0x78f3('0x31')][_0x78f3('0x35')]));_0x2de1bb[_0x78f3('0x34')]=_0x2de1bb['attributes']['length']?_0x2de1bb[_0x78f3('0x34')]:_0x170d63[_0x78f3('0x30')];if(!_0x32e52f[_0x78f3('0x31')][_0x78f3('0x36')](_0x78f3('0x37'))){_0x2de1bb['limit']=qs[_0x78f3('0x1c')](_0x32e52f[_0x78f3('0x31')][_0x78f3('0x1c')]);_0x2de1bb['offset']=qs['offset'](_0x32e52f[_0x78f3('0x31')][_0x78f3('0x1a')]);}_0x2de1bb['order']=qs[_0x78f3('0x38')](_0x32e52f[_0x78f3('0x31')][_0x78f3('0x38')]);_0x2de1bb[_0x78f3('0x39')]=qs[_0x78f3('0x3a')](_[_0x78f3('0x3b')](_0x32e52f['query'],_0x170d63[_0x78f3('0x3a')]),_0x2b7308);if(_0x32e52f['query'][_0x78f3('0x3c')]){_0x2de1bb[_0x78f3('0x39')]=_['merge'](_0x2de1bb['where'],{'$or':_[_0x78f3('0x2a')](_0x2b7308,function(_0x2c26c7){if(_0x2c26c7[_0x78f3('0x2e')]!==_0x78f3('0x3d')){var _0x2e4200={};_0x2e4200[_0x2c26c7[_0x78f3('0x27')]]={'$like':'%'+_0x32e52f[_0x78f3('0x31')]['filter']+'%'};return _0x2e4200;}})});}_0x2de1bb=_['merge']({},_0x2de1bb,_0x32e52f[_0x78f3('0x3e')]);var _0x34ccb2={'where':_0x2de1bb['where']};return db['FreshdeskAccount'][_0x78f3('0x1d')](_0x34ccb2)[_0x78f3('0x23')](function(_0xdf42f7){_0x1b9c69[_0x78f3('0x1d')]=_0xdf42f7;if(_0x32e52f['query'][_0x78f3('0x3f')]){_0x2de1bb['include']=[{'all':!![]}];}return db[_0x78f3('0x2b')][_0x78f3('0x40')](_0x2de1bb);})[_0x78f3('0x23')](function(_0x5925a9){_0x1b9c69['rows']=_0x5925a9;return _0x1b9c69;})['then'](respondWithFilteredResult(_0x31f6c5,_0x2de1bb))['catch'](handleError(_0x31f6c5,null));};exports[_0x78f3('0x41')]=function(_0x4a86d8,_0x585204){var _0x29daf0={'raw':![],'where':{'id':_0x4a86d8['params']['id']}},_0x1e7935={};_0x1e7935[_0x78f3('0x30')]=_['keys'](db[_0x78f3('0x2b')][_0x78f3('0x2c')]);_0x1e7935[_0x78f3('0x31')]=_[_0x78f3('0x32')](_0x4a86d8['query']);_0x1e7935[_0x78f3('0x3a')]=_[_0x78f3('0x33')](_0x1e7935[_0x78f3('0x30')],_0x1e7935[_0x78f3('0x31')]);_0x29daf0[_0x78f3('0x34')]=_[_0x78f3('0x33')](_0x1e7935[_0x78f3('0x30')],qs[_0x78f3('0x35')](_0x4a86d8[_0x78f3('0x31')][_0x78f3('0x35')]));_0x29daf0[_0x78f3('0x34')]=_0x29daf0[_0x78f3('0x34')]['length']?_0x29daf0[_0x78f3('0x34')]:_0x1e7935[_0x78f3('0x30')];if(_0x4a86d8['query']['includeAll']){_0x29daf0['include']=[{'all':!![]}];}_0x29daf0=_[_0x78f3('0x42')]({},_0x29daf0,_0x4a86d8[_0x78f3('0x3e')]);return db['FreshdeskAccount'][_0x78f3('0x43')](_0x29daf0)[_0x78f3('0x23')](handleEntityNotFound(_0x585204,null))[_0x78f3('0x23')](respondWithResult(_0x585204,null))[_0x78f3('0x44')](handleError(_0x585204,null));};exports[_0x78f3('0x45')]=function(_0x179268,_0x2abb9e){return db[_0x78f3('0x2b')][_0x78f3('0x45')](_0x179268[_0x78f3('0x46')],{})['then'](respondWithResult(_0x2abb9e,0xc9))[_0x78f3('0x44')](handleError(_0x2abb9e,null));};exports['update']=function(_0x5cc5b1,_0x1f53fb){if(_0x5cc5b1[_0x78f3('0x46')]['id']){delete _0x5cc5b1[_0x78f3('0x46')]['id'];}return db['FreshdeskAccount'][_0x78f3('0x43')]({'where':{'id':_0x5cc5b1[_0x78f3('0x47')]['id']}})[_0x78f3('0x23')](handleEntityNotFound(_0x1f53fb,null))['then'](saveUpdates(_0x5cc5b1['body'],null))[_0x78f3('0x23')](respondWithResult(_0x1f53fb,null))[_0x78f3('0x44')](handleError(_0x1f53fb,null));};exports[_0x78f3('0x24')]=function(_0x3fc4ad,_0x372297){return db[_0x78f3('0x2b')]['find']({'where':{'id':_0x3fc4ad[_0x78f3('0x47')]['id']}})['then'](handleEntityNotFound(_0x372297,null))[_0x78f3('0x23')](removeEntity(_0x372297,null))[_0x78f3('0x44')](handleError(_0x372297,null));};exports['getConfigurations']=function(_0x30b5f4,_0x171c9b,_0x162e26){var _0x16b6e6={};var _0x418374={};var _0x3b0844;var _0x33904f;return db[_0x78f3('0x2b')][_0x78f3('0x48')]({'where':{'id':_0x30b5f4[_0x78f3('0x47')]['id']}})[_0x78f3('0x23')](handleEntityNotFound(_0x171c9b,null))[_0x78f3('0x23')](function(_0x1fbdb3){if(_0x1fbdb3){_0x3b0844=_0x1fbdb3;_0x418374[_0x78f3('0x30')]=_[_0x78f3('0x32')](db['FreshdeskConfiguration'][_0x78f3('0x2c')]);_0x418374[_0x78f3('0x31')]=_[_0x78f3('0x32')](_0x30b5f4[_0x78f3('0x31')]);_0x418374['filters']=_['intersection'](_0x418374[_0x78f3('0x30')],_0x418374[_0x78f3('0x31')]);_0x16b6e6[_0x78f3('0x34')]=_['intersection'](_0x418374['model'],qs[_0x78f3('0x35')](_0x30b5f4[_0x78f3('0x31')][_0x78f3('0x35')]));_0x16b6e6[_0x78f3('0x34')]=_0x16b6e6[_0x78f3('0x34')][_0x78f3('0x49')]?_0x16b6e6[_0x78f3('0x34')]:_0x418374['model'];_0x16b6e6[_0x78f3('0x4a')]=qs[_0x78f3('0x38')](_0x30b5f4[_0x78f3('0x31')][_0x78f3('0x38')]);_0x16b6e6[_0x78f3('0x39')]=qs[_0x78f3('0x3a')](_[_0x78f3('0x3b')](_0x30b5f4[_0x78f3('0x31')],_0x418374[_0x78f3('0x3a')]));if(_0x30b5f4[_0x78f3('0x31')][_0x78f3('0x3c')]){_0x16b6e6[_0x78f3('0x39')]=_[_0x78f3('0x42')](_0x16b6e6[_0x78f3('0x39')],{'$or':_[_0x78f3('0x2a')](_0x16b6e6[_0x78f3('0x34')],function(_0x366b35){var _0x1f9101={};_0x1f9101[_0x366b35]={'$like':'%'+_0x30b5f4[_0x78f3('0x31')][_0x78f3('0x3c')]+'%'};return _0x1f9101;})});}_0x16b6e6=_[_0x78f3('0x42')]({},_0x16b6e6,_0x30b5f4[_0x78f3('0x3e')]);return _0x3b0844[_0x78f3('0x4b')](_0x16b6e6);}})[_0x78f3('0x23')](function(_0x4b06d7){if(_0x4b06d7){_0x33904f=_0x4b06d7[_0x78f3('0x49')];if(!_0x30b5f4[_0x78f3('0x31')]['hasOwnProperty'](_0x78f3('0x37'))){_0x16b6e6['limit']=qs['limit'](_0x30b5f4[_0x78f3('0x31')]['limit']);_0x16b6e6[_0x78f3('0x1a')]=qs[_0x78f3('0x1a')](_0x30b5f4[_0x78f3('0x31')][_0x78f3('0x1a')]);}return _0x3b0844['getConfigurations'](_0x16b6e6);}})[_0x78f3('0x23')](function(_0x53feab){if(_0x53feab){return _0x53feab?{'count':_0x33904f,'rows':_0x53feab}:null;}})[_0x78f3('0x23')](respondWithResult(_0x171c9b,null))[_0x78f3('0x44')](handleError(_0x171c9b,null));};exports[_0x78f3('0x4c')]=function(_0x2d9a7c,_0x4375d8,_0x199004){if(_0x2d9a7c[_0x78f3('0x46')]['id']){delete _0x2d9a7c[_0x78f3('0x46')]['id'];}return db['FreshdeskAccount'][_0x78f3('0x48')]({'where':{'id':_0x2d9a7c['params']['id']}})[_0x78f3('0x23')](handleEntityNotFound(_0x4375d8,null))[_0x78f3('0x23')](function(_0x1489d2){if(_0x1489d2){_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x4d')]=_0x1489d2['id'];_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x4e')]=integrations[_0x78f3('0x4f')](_0x2d9a7c[_0x78f3('0x46')]['channel'],_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x2e')]);_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x50')]=integrations[_0x78f3('0x51')](_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x52')],_0x2d9a7c[_0x78f3('0x46')][_0x78f3('0x2e')]);return db[_0x78f3('0x53')]['create'](_0x2d9a7c[_0x78f3('0x46')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x78f3('0x54')],'as':_0x78f3('0x50')}]});}return null;})[_0x78f3('0x23')](respondWithResult(_0x4375d8,null))[_0x78f3('0x44')](handleError(_0x4375d8,null));};exports[_0x78f3('0x55')]=function(_0x449ca9,_0x4eb9a5,_0x39338d){var _0x2e1358='';return db[_0x78f3('0x2b')][_0x78f3('0x48')]({'where':{'id':_0x449ca9[_0x78f3('0x47')]['id']},'attributes':['id',_0x78f3('0x56'),_0x78f3('0x57')]})[_0x78f3('0x23')](handleEntityNotFound(_0x4eb9a5,null))[_0x78f3('0x23')](function(_0xb1bdc9){if(_0xb1bdc9){_0x2e1358=_0xb1bdc9[_0x78f3('0x56')];var _0x1da6c1=_0x2e1358[_0x78f3('0x58')](-0x1);if(_0x1da6c1==='/'){_0x2e1358=_0x2e1358[_0x78f3('0x59')](0x0,_0x2e1358[_0x78f3('0x5a')](_0x1da6c1));}return rp({'method':_0x78f3('0x5b'),'uri':util['format'](_0x78f3('0x5c'),_0x2e1358,_0x78f3('0x5d')),'headers':{'Authorization':util[_0x78f3('0x5e')](_0x78f3('0x5f'),new Buffer(util[_0x78f3('0x5e')](_0x78f3('0x60'),_0xb1bdc9[_0x78f3('0x57')]))[_0x78f3('0x61')](_0x78f3('0x62')))},'json':!![]});}})[_0x78f3('0x23')](function(_0xe0e9ed){if(_0xe0e9ed){var _0x3a69b7=[_0x78f3('0x63'),'subject','agent','description',_0x78f3('0x17'),_0x78f3('0x64'),'group',_0x78f3('0x65'),_0x78f3('0x66'),_0x78f3('0x67'),'company'];_[_0x78f3('0x68')](_0xe0e9ed,function(_0x218be3){return _0x3a69b7['includes'](_0x218be3['name'])||!_0x218be3[_0x78f3('0x69')]&&_0x218be3['type']!=='custom_text'&&_0x218be3[_0x78f3('0x2e')]!==_0x78f3('0x6a');});return{'count':_0xe0e9ed[_0x78f3('0x49')],'rows':_[_0x78f3('0x2a')](_0xe0e9ed,function(_0x55a627){return{'id':_0x55a627[_0x78f3('0x27')],'name':_0x55a627[_0x78f3('0x6b')],'custom':!_0x55a627[_0x78f3('0x69')],'options':_0x55a627[_0x78f3('0x6c')]?_[_0x78f3('0x2a')](_0x55a627[_0x78f3('0x6c')],function(_0xdbbcb3){return{'name':_['capitalize'](_0xdbbcb3),'value':_0xdbbcb3};}):[]};})};}})[_0x78f3('0x23')](respondWithResult(_0x4eb9a5,null))[_0x78f3('0x44')](function(_0x2c93f6){var _0xca83b2=_0x449ca9['query']['test']?0x1f4:_0x2c93f6[_0x78f3('0x6d')]||0x1f4;logger['error'](_0x78f3('0x6e'),_0x78f3('0x55'),_0xca83b2,JSON[_0x78f3('0x6f')](_0x2c93f6));delete _0x2c93f6['name'];if(_0xca83b2===0x191){_0xca83b2=0x190;}_0x4eb9a5['status'](_0xca83b2)['send'](_0x449ca9['query'][_0x78f3('0x70')]?{'message':_0x78f3('0x71'),'statusCode':_0x2c93f6[_0x78f3('0x6d')]}:_0x2c93f6);});}; \ No newline at end of file +var _0xa788=['fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','stringify','send','test','statusCode','eml-format','rimraf','zip-dir'];(function(_0x4b80ba,_0x2e4a1b){var _0x13f737=function(_0x2c5a07){while(--_0x2c5a07){_0x4b80ba['push'](_0x4b80ba['shift']());}};_0x13f737(++_0x2e4a1b);}(_0xa788,0x70));var _0x8a78=function(_0x4bf6ad,_0x376edb){_0x4bf6ad=_0x4bf6ad-0x0;var _0x171021=_0xa788[_0x4bf6ad];return _0x171021;};'use strict';var emlformat=require(_0x8a78('0x0'));var rimraf=require(_0x8a78('0x1'));var zipdir=require(_0x8a78('0x2'));var jsonpatch=require(_0x8a78('0x3'));var rp=require('request-promise');var moment=require(_0x8a78('0x4'));var BPromise=require(_0x8a78('0x5'));var Mustache=require('mustache');var util=require(_0x8a78('0x6'));var path=require(_0x8a78('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a78('0x8'));var _=require(_0x8a78('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a78('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a78('0xb'));var Papa=require(_0x8a78('0xc'));var Redis=require('ioredis');var authService=require(_0x8a78('0xd'));var qs=require(_0x8a78('0xe'));var as=require(_0x8a78('0xf'));var hardwareService=require(_0x8a78('0x10'));var logger=require(_0x8a78('0x11'))(_0x8a78('0x12'));var utils=require(_0x8a78('0x13'));var config=require(_0x8a78('0x14'));var licenseUtil=require(_0x8a78('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8a78('0x16'));function respondWithStatusCode(_0x294b34,_0x31b77e){_0x31b77e=_0x31b77e||0xcc;return function(_0x4b4bc8){if(_0x4b4bc8){return _0x294b34[_0x8a78('0x17')](_0x31b77e);}return _0x294b34[_0x8a78('0x18')](_0x31b77e)[_0x8a78('0x19')]();};}function respondWithResult(_0x4b073b,_0x423787){_0x423787=_0x423787||0xc8;return function(_0x5bf8a4){if(_0x5bf8a4){return _0x4b073b[_0x8a78('0x18')](_0x423787)['json'](_0x5bf8a4);}};}function respondWithFilteredResult(_0x429b2c,_0x586d47){return function(_0x57212b){if(_0x57212b){var _0x580cf9=typeof _0x586d47[_0x8a78('0x1a')]===_0x8a78('0x1b')&&typeof _0x586d47[_0x8a78('0x1c')]===_0x8a78('0x1b');var _0x303aab=_0x57212b[_0x8a78('0x1d')];var _0x9ce954=_0x580cf9?0x0:_0x586d47[_0x8a78('0x1a')];var _0x20343b=_0x580cf9?_0x57212b[_0x8a78('0x1d')]:_0x586d47[_0x8a78('0x1a')]+_0x586d47[_0x8a78('0x1c')];var _0x23721b;if(_0x20343b>=_0x303aab){_0x20343b=_0x303aab;_0x23721b=0xc8;}else{_0x23721b=0xce;}_0x429b2c[_0x8a78('0x18')](_0x23721b);return _0x429b2c['set'](_0x8a78('0x1e'),_0x9ce954+'-'+_0x20343b+'/'+_0x303aab)['json'](_0x57212b);}return null;};}function patchUpdates(_0xa6f4b8){return function(_0x1dd032){try{jsonpatch['apply'](_0x1dd032,_0xa6f4b8,!![]);}catch(_0x1389e8){return BPromise[_0x8a78('0x1f')](_0x1389e8);}return _0x1dd032[_0x8a78('0x20')]();};}function saveUpdates(_0x43b3b8,_0x2d7d03){return function(_0x530446){if(_0x530446){return _0x530446[_0x8a78('0x21')](_0x43b3b8)['then'](function(_0x3532d1){return _0x3532d1;});}return null;};}function removeEntity(_0x43305f,_0x118357){return function(_0x381795){if(_0x381795){return _0x381795[_0x8a78('0x22')]()[_0x8a78('0x23')](function(){_0x43305f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21908e,_0x2737d0){return function(_0x30fbe9){if(!_0x30fbe9){_0x21908e['sendStatus'](0x194);}return _0x30fbe9;};}function handleError(_0x10e6b6,_0x43f182){_0x43f182=_0x43f182||0x1f4;return function(_0x3c51db){logger[_0x8a78('0x24')](_0x3c51db[_0x8a78('0x25')]);if(_0x3c51db[_0x8a78('0x26')]){delete _0x3c51db[_0x8a78('0x26')];}_0x10e6b6['status'](_0x43f182)['send'](_0x3c51db);};}exports[_0x8a78('0x27')]=function(_0x370927,_0x2c26d0){var _0x19c208={},_0x5138ad={},_0x1561d8={'count':0x0,'rows':[]};var _0x27c5d1=_['map'](db[_0x8a78('0x28')][_0x8a78('0x29')],function(_0x2fbc0e){return{'name':_0x2fbc0e[_0x8a78('0x2a')],'type':_0x2fbc0e[_0x8a78('0x2b')][_0x8a78('0x2c')]};});_0x5138ad[_0x8a78('0x2d')]=_[_0x8a78('0x2e')](_0x27c5d1,_0x8a78('0x26'));_0x5138ad[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x370927['query']);_0x5138ad[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x5138ad['model'],_0x5138ad[_0x8a78('0x2f')]);_0x19c208['attributes']=_[_0x8a78('0x32')](_0x5138ad[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x370927['query']['fields']));_0x19c208[_0x8a78('0x34')]=_0x19c208['attributes'][_0x8a78('0x35')]?_0x19c208[_0x8a78('0x34')]:_0x5138ad[_0x8a78('0x2d')];if(!_0x370927[_0x8a78('0x2f')][_0x8a78('0x36')]('nolimit')){_0x19c208[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0x19c208[_0x8a78('0x1a')]=qs['offset'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1a')]);}_0x19c208[_0x8a78('0x37')]=qs['sort'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x38')]);_0x19c208[_0x8a78('0x39')]=qs['filters'](_['pick'](_0x370927['query'],_0x5138ad['filters']),_0x27c5d1);if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0x19c208[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0x19c208[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0x27c5d1,function(_0x1d5423){if(_0x1d5423['type']!==_0x8a78('0x3c')){var _0x3655d3={};_0x3655d3[_0x1d5423['name']]={'$like':'%'+_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]+'%'};return _0x3655d3;}})});}_0x19c208=_[_0x8a78('0x3b')]({},_0x19c208,_0x370927[_0x8a78('0x3d')]);var _0x321519={'where':_0x19c208[_0x8a78('0x39')]};return db[_0x8a78('0x28')][_0x8a78('0x1d')](_0x321519)[_0x8a78('0x23')](function(_0x329ba1){_0x1561d8[_0x8a78('0x1d')]=_0x329ba1;if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3e')]){_0x19c208[_0x8a78('0x3f')]=[{'all':!![]}];}return db[_0x8a78('0x28')][_0x8a78('0x40')](_0x19c208);})[_0x8a78('0x23')](function(_0x1d87dd){_0x1561d8[_0x8a78('0x41')]=_0x1d87dd;return _0x1561d8;})[_0x8a78('0x23')](respondWithFilteredResult(_0x2c26d0,_0x19c208))[_0x8a78('0x42')](handleError(_0x2c26d0,null));};exports['show']=function(_0x5b894c,_0x2ed20a){var _0x12bbf8={'raw':![],'where':{'id':_0x5b894c[_0x8a78('0x43')]['id']}},_0xb0eea6={};_0xb0eea6[_0x8a78('0x2d')]=_[_0x8a78('0x30')](db['FreshdeskAccount'][_0x8a78('0x29')]);_0xb0eea6[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x5b894c[_0x8a78('0x2f')]);_0xb0eea6[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],_0xb0eea6[_0x8a78('0x2f')]);_0x12bbf8[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x5b894c[_0x8a78('0x2f')][_0x8a78('0x33')]));_0x12bbf8[_0x8a78('0x34')]=_0x12bbf8[_0x8a78('0x34')][_0x8a78('0x35')]?_0x12bbf8[_0x8a78('0x34')]:_0xb0eea6[_0x8a78('0x2d')];if(_0x5b894c[_0x8a78('0x2f')]['includeAll']){_0x12bbf8[_0x8a78('0x3f')]=[{'all':!![]}];}_0x12bbf8=_[_0x8a78('0x3b')]({},_0x12bbf8,_0x5b894c[_0x8a78('0x3d')]);return db['FreshdeskAccount'][_0x8a78('0x44')](_0x12bbf8)[_0x8a78('0x23')](handleEntityNotFound(_0x2ed20a,null))[_0x8a78('0x23')](respondWithResult(_0x2ed20a,null))[_0x8a78('0x42')](handleError(_0x2ed20a,null));};exports[_0x8a78('0x45')]=function(_0x32b165,_0x16d46f){return db['FreshdeskAccount'][_0x8a78('0x45')](_0x32b165['body'],{})[_0x8a78('0x23')](respondWithResult(_0x16d46f,0xc9))['catch'](handleError(_0x16d46f,null));};exports['update']=function(_0x568924,_0x2f1542){if(_0x568924[_0x8a78('0x46')]['id']){delete _0x568924[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x568924[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f1542,null))['then'](saveUpdates(_0x568924[_0x8a78('0x46')],null))['then'](respondWithResult(_0x2f1542,null))['catch'](handleError(_0x2f1542,null));};exports[_0x8a78('0x22')]=function(_0x1eba19,_0x424400){return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x1eba19[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x424400,null))[_0x8a78('0x23')](removeEntity(_0x424400,null))[_0x8a78('0x42')](handleError(_0x424400,null));};exports[_0x8a78('0x47')]=function(_0x18b2a4,_0x445cc9,_0x25709b){var _0xca898d={};var _0x22b554={};var _0x35b5b4;var _0x49e5e4;return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0x18b2a4[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x445cc9,null))['then'](function(_0x2fb809){if(_0x2fb809){_0x35b5b4=_0x2fb809;_0x22b554['model']=_[_0x8a78('0x30')](db[_0x8a78('0x49')]['rawAttributes']);_0x22b554[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x18b2a4['query']);_0x22b554[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],_0x22b554[_0x8a78('0x2f')]);_0xca898d[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x33')]));_0xca898d[_0x8a78('0x34')]=_0xca898d[_0x8a78('0x34')][_0x8a78('0x35')]?_0xca898d['attributes']:_0x22b554[_0x8a78('0x2d')];_0xca898d[_0x8a78('0x37')]=qs[_0x8a78('0x38')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x38')]);_0xca898d[_0x8a78('0x39')]=qs[_0x8a78('0x31')](_[_0x8a78('0x4a')](_0x18b2a4[_0x8a78('0x2f')],_0x22b554[_0x8a78('0x31')]));if(_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0xca898d[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0xca898d[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0xca898d['attributes'],function(_0x402aed){var _0xe3b592={};_0xe3b592[_0x402aed]={'$like':'%'+_0x18b2a4['query'][_0x8a78('0x3a')]+'%'};return _0xe3b592;})});}_0xca898d=_[_0x8a78('0x3b')]({},_0xca898d,_0x18b2a4[_0x8a78('0x3d')]);return _0x35b5b4['getConfigurations'](_0xca898d);}})[_0x8a78('0x23')](function(_0x471b1d){if(_0x471b1d){_0x49e5e4=_0x471b1d[_0x8a78('0x35')];if(!_0x18b2a4[_0x8a78('0x2f')]['hasOwnProperty'](_0x8a78('0x4b'))){_0xca898d[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0xca898d[_0x8a78('0x1a')]=qs[_0x8a78('0x1a')](_0x18b2a4[_0x8a78('0x2f')]['offset']);}return _0x35b5b4[_0x8a78('0x47')](_0xca898d);}})[_0x8a78('0x23')](function(_0x524785){if(_0x524785){return _0x524785?{'count':_0x49e5e4,'rows':_0x524785}:null;}})['then'](respondWithResult(_0x445cc9,null))[_0x8a78('0x42')](handleError(_0x445cc9,null));};exports[_0x8a78('0x4c')]=function(_0xc9b8af,_0x30f0eb,_0x21129d){if(_0xc9b8af[_0x8a78('0x46')]['id']){delete _0xc9b8af[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0xc9b8af['params']['id']}})['then'](handleEntityNotFound(_0x30f0eb,null))['then'](function(_0x180e32){if(_0x180e32){_0xc9b8af[_0x8a78('0x46')]['AccountId']=_0x180e32['id'];_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4d')]=integrations[_0x8a78('0x4e')](_0xc9b8af[_0x8a78('0x46')]['channel'],_0xc9b8af[_0x8a78('0x46')]['type']);_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4f')]=integrations[_0x8a78('0x50')](_0xc9b8af['body'][_0x8a78('0x51')],_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x2b')]);return db[_0x8a78('0x49')][_0x8a78('0x45')](_0xc9b8af[_0x8a78('0x46')],{'include':[{'model':db[_0x8a78('0x52')],'as':_0x8a78('0x4d')},{'model':db['FreshdeskField'],'as':_0x8a78('0x4f')}]});}return null;})[_0x8a78('0x23')](respondWithResult(_0x30f0eb,null))['catch'](handleError(_0x30f0eb,null));};exports[_0x8a78('0x53')]=function(_0x379db5,_0x3df0b4,_0x4850ac){var _0x11ce80='';return db['FreshdeskAccount'][_0x8a78('0x48')]({'where':{'id':_0x379db5[_0x8a78('0x43')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x3df0b4,null))[_0x8a78('0x23')](function(_0x5d5c29){if(_0x5d5c29){_0x11ce80=_0x5d5c29['remoteUri'];var _0x52c94c=_0x11ce80[_0x8a78('0x54')](-0x1);if(_0x52c94c==='/'){_0x11ce80=_0x11ce80[_0x8a78('0x55')](0x0,_0x11ce80[_0x8a78('0x56')](_0x52c94c));}return rp({'method':_0x8a78('0x57'),'uri':util[_0x8a78('0x58')](_0x8a78('0x59'),_0x11ce80,_0x8a78('0x5a')),'headers':{'Authorization':util[_0x8a78('0x58')](_0x8a78('0x5b'),new Buffer(util[_0x8a78('0x58')]('%s:X',_0x5d5c29[_0x8a78('0x5c')]))[_0x8a78('0x5d')](_0x8a78('0x5e')))},'json':!![]});}})[_0x8a78('0x23')](function(_0x20c2e8){if(_0x20c2e8){var _0x1b43cd=[_0x8a78('0x5f'),_0x8a78('0x60'),_0x8a78('0x61'),_0x8a78('0x62'),_0x8a78('0x18'),_0x8a78('0x63'),_0x8a78('0x64'),_0x8a78('0x65'),_0x8a78('0x66'),'group','company'];_[_0x8a78('0x67')](_0x20c2e8,function(_0x5a506d){return _0x1b43cd[_0x8a78('0x68')](_0x5a506d[_0x8a78('0x26')])||!_0x5a506d[_0x8a78('0x69')]&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6a')&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6b');});return{'count':_0x20c2e8[_0x8a78('0x35')],'rows':_[_0x8a78('0x2e')](_0x20c2e8,function(_0x4f46bb){return{'id':_0x4f46bb[_0x8a78('0x26')],'name':_0x4f46bb[_0x8a78('0x6c')],'custom':!_0x4f46bb[_0x8a78('0x69')],'options':_0x4f46bb[_0x8a78('0x6d')]?_['map'](_0x4f46bb[_0x8a78('0x6d')],function(_0x22a759){return{'name':_[_0x8a78('0x6e')](_0x22a759),'value':_0x22a759};}):[]};})};}})[_0x8a78('0x23')](respondWithResult(_0x3df0b4,null))[_0x8a78('0x42')](function(_0x1f85fb){var _0x1d059d=_0x379db5['query']['test']?0x1f4:_0x1f85fb['statusCode']||0x1f4;logger[_0x8a78('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a78('0x53'),_0x1d059d,JSON[_0x8a78('0x6f')](_0x1f85fb));delete _0x1f85fb[_0x8a78('0x26')];if(_0x1d059d===0x191){_0x1d059d=0x190;}_0x3df0b4['status'](_0x1d059d)[_0x8a78('0x70')](_0x379db5['query'][_0x8a78('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x1f85fb[_0x8a78('0x72')]}:_0x1f85fb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6676a37..44fe616 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 _0xad5c=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','path'];(function(_0x35301,_0x5da18f){var _0x3b36ca=function(_0x44da0a){while(--_0x44da0a){_0x35301['push'](_0x35301['shift']());}};_0x3b36ca(++_0x5da18f);}(_0xad5c,0x109));var _0xcad5=function(_0x298754,_0x292f0c){_0x298754=_0x298754-0x0;var _0x3b90ba=_0xad5c[_0x298754];return _0x3b90ba;};'use strict';var _=require(_0xcad5('0x0'));var util=require('util');var logger=require(_0xcad5('0x1'))(_0xcad5('0x2'));var moment=require(_0xcad5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcad5('0x4'));var rimraf=require(_0xcad5('0x5'));var config=require(_0xcad5('0x6'));var attributes=require(_0xcad5('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4d17f1,_0x109934){return _0x4d17f1['define'](_0xcad5('0x8'),attributes,{'tableName':_0xcad5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a8a=['request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird'];(function(_0x473acb,_0x588b6c){var _0x1415bf=function(_0x4c4e08){while(--_0x4c4e08){_0x473acb['push'](_0x473acb['shift']());}};_0x1415bf(++_0x588b6c);}(_0x9a8a,0x175));var _0xa9a8=function(_0x23b630,_0x41d994){_0x23b630=_0x23b630-0x0;var _0x3004d5=_0x9a8a[_0x23b630];return _0x3004d5;};'use strict';var _=require(_0xa9a8('0x0'));var util=require(_0xa9a8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa9a8('0x2'));var BPromise=require(_0xa9a8('0x3'));var rp=require(_0xa9a8('0x4'));var fs=require('fs');var path=require(_0xa9a8('0x5'));var rimraf=require('rimraf');var config=require(_0xa9a8('0x6'));var attributes=require(_0xa9a8('0x7'));var integrations=require(_0xa9a8('0x8'));module[_0xa9a8('0x9')]=function(_0x41d795,_0x4a5029){return _0x41d795[_0xa9a8('0xa')](_0xa9a8('0xb'),attributes,{'tableName':_0xa9a8('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 3fdb4fe..1d98838 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 _0xe93b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','catch','FreshdeskAccount','findAll','options','raw','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe93b,0x1c2));var _0xbe93=function(_0x53711d,_0x5889e4){_0x53711d=_0x53711d-0x0;var _0x3e6dab=_0xe93b[_0x53711d];return _0x3e6dab;};'use strict';var _=require('lodash');var util=require(_0xbe93('0x0'));var moment=require(_0xbe93('0x1'));var BPromise=require(_0xbe93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe93('0x3'));var db=require(_0xbe93('0x4'))['db'];var utils=require(_0xbe93('0x5'));var logger=require(_0xbe93('0x6'))(_0xbe93('0x7'));var config=require(_0xbe93('0x8'));var jayson=require(_0xbe93('0x9'));var client=jayson[_0xbe93('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d79b4,_0x29bc15,_0x317a09){return new BPromise(function(_0xb5f3bb,_0x3832c0){return client[_0xbe93('0xb')](_0x1d79b4,_0x317a09)[_0xbe93('0xc')](function(_0x3ed10a){logger[_0xbe93('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x29bc15,_0xbe93('0xe'));logger[_0xbe93('0xf')](_0xbe93('0x10'),_0x29bc15,_0xbe93('0xe'),JSON[_0xbe93('0x11')](_0x3ed10a));if(_0x3ed10a[_0xbe93('0x12')]){if(_0x3ed10a['error'][_0xbe93('0x13')]===0x1f4){logger[_0xbe93('0x12')](_0xbe93('0x14'),_0x29bc15,_0x3ed10a['error']['message']);return _0x3832c0(_0x3ed10a[_0xbe93('0x12')][_0xbe93('0x15')]);}logger[_0xbe93('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x29bc15,_0x3ed10a['error'][_0xbe93('0x15')]);return _0xb5f3bb(_0x3ed10a[_0xbe93('0x12')][_0xbe93('0x15')]);}else{logger[_0xbe93('0xd')](_0xbe93('0x14'),_0x29bc15,_0xbe93('0xe'));_0xb5f3bb(_0x3ed10a['result'][_0xbe93('0x15')]);}})[_0xbe93('0x16')](function(_0x481af3){logger[_0xbe93('0x12')](_0xbe93('0x14'),_0x29bc15,_0x481af3);_0x3832c0(_0x481af3);});});}exports['GetFreshdeskAccount']=function(_0x4cdbb9){var _0x4447d6=this;return new Promise(function(_0x37312e,_0x5480c3){return db[_0xbe93('0x17')][_0xbe93('0x18')]({'raw':_0x4cdbb9[_0xbe93('0x19')]?_0x4cdbb9[_0xbe93('0x19')][_0xbe93('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cdbb9[_0xbe93('0x19')]?_0x4cdbb9[_0xbe93('0x19')]['where']||null:null,'attributes':_0x4cdbb9[_0xbe93('0x19')]?_0x4cdbb9[_0xbe93('0x19')][_0xbe93('0x1b')]||null:null,'limit':_0x4cdbb9[_0xbe93('0x19')]?_0x4cdbb9[_0xbe93('0x19')]['limit']||null:null,'include':_0x4cdbb9[_0xbe93('0x19')]?_0x4cdbb9[_0xbe93('0x19')][_0xbe93('0x1c')]?_[_0xbe93('0x1d')](_0x4cdbb9[_0xbe93('0x19')]['include'],function(_0x4d80ac){return{'model':db[_0x4d80ac[_0xbe93('0x1e')]],'as':_0x4d80ac['as'],'attributes':_0x4d80ac[_0xbe93('0x1b')],'include':_0x4d80ac[_0xbe93('0x1c')]?_[_0xbe93('0x1d')](_0x4d80ac['include'],function(_0x26470f){return{'model':db[_0x26470f[_0xbe93('0x1e')]],'as':_0x26470f['as'],'attributes':_0x26470f[_0xbe93('0x1b')],'include':_0x26470f[_0xbe93('0x1c')]?_[_0xbe93('0x1d')](_0x26470f[_0xbe93('0x1c')],function(_0x34d124){return{'model':db[_0x34d124[_0xbe93('0x1e')]],'as':_0x34d124['as'],'attributes':_0x34d124[_0xbe93('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe93('0xc')](function(_0xdcf0c4){logger[_0xbe93('0xd')]('GetFreshdeskAccount',_0x4cdbb9);logger[_0xbe93('0xf')](_0xbe93('0x1f'),_0x4cdbb9,JSON[_0xbe93('0x11')](_0xdcf0c4));_0x37312e(_0xdcf0c4);})[_0xbe93('0x16')](function(_0x5bf77c){logger[_0xbe93('0x12')]('GetFreshdeskAccount',_0x5bf77c['message'],_0x4cdbb9);_0x5480c3(_0x4447d6[_0xbe93('0x12')](0x1f4,_0x5bf77c[_0xbe93('0x15')]));});});};exports[_0xbe93('0x20')]=function(_0x16bc0f){var _0x4fd4d1=this;return new Promise(function(_0x50da57,_0x4113cd){return db[_0xbe93('0x17')][_0xbe93('0x21')]({'raw':_0x16bc0f[_0xbe93('0x19')]?_0x16bc0f[_0xbe93('0x19')][_0xbe93('0x1a')]===undefined?!![]:![]:!![],'where':_0x16bc0f[_0xbe93('0x19')]?_0x16bc0f[_0xbe93('0x19')][_0xbe93('0x22')]||null:null,'attributes':_0x16bc0f[_0xbe93('0x19')]?_0x16bc0f[_0xbe93('0x19')][_0xbe93('0x1b')]||null:null,'include':_0x16bc0f['options']?_0x16bc0f['options'][_0xbe93('0x1c')]?_[_0xbe93('0x1d')](_0x16bc0f[_0xbe93('0x19')][_0xbe93('0x1c')],function(_0x115b2b){return{'model':db[_0x115b2b['model']],'as':_0x115b2b['as'],'attributes':_0x115b2b[_0xbe93('0x1b')],'include':_0x115b2b[_0xbe93('0x1c')]?_['map'](_0x115b2b[_0xbe93('0x1c')],function(_0x107597){return{'model':db[_0x107597[_0xbe93('0x1e')]],'as':_0x107597['as'],'attributes':_0x107597[_0xbe93('0x1b')],'include':_0x107597[_0xbe93('0x1c')]?_[_0xbe93('0x1d')](_0x107597[_0xbe93('0x1c')],function(_0x226641){return{'model':db[_0x226641['model']],'as':_0x226641['as'],'attributes':_0x226641[_0xbe93('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbe93('0xc')](function(_0x378edc){logger[_0xbe93('0xd')](_0xbe93('0x20'),_0x16bc0f);logger[_0xbe93('0xf')](_0xbe93('0x20'),_0x16bc0f,JSON['stringify'](_0x378edc));_0x50da57(_0x378edc);})[_0xbe93('0x16')](function(_0x40b9c8){logger[_0xbe93('0x12')](_0xbe93('0x20'),_0x40b9c8[_0xbe93('0x15')],_0x16bc0f);_0x4113cd(_0x4fd4d1[_0xbe93('0x12')](0x1f4,_0x40b9c8[_0xbe93('0x15')]));});});}; \ No newline at end of file +var _0x4e0d=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','include','map','attributes','model','catch','ShowFreshdeskAccount','find','where','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x4f6464,_0x19ce0b){var _0x2970c0=function(_0x30b705){while(--_0x30b705){_0x4f6464['push'](_0x4f6464['shift']());}};_0x2970c0(++_0x19ce0b);}(_0x4e0d,0x9d));var _0xd4e0=function(_0x1bf61a,_0x234997){_0x1bf61a=_0x1bf61a-0x0;var _0x1fd5c6=_0x4e0d[_0x1bf61a];return _0x1fd5c6;};'use strict';var _=require('lodash');var util=require(_0xd4e0('0x0'));var moment=require(_0xd4e0('0x1'));var BPromise=require(_0xd4e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd4e0('0x3'));var logger=require('../../config/logger')(_0xd4e0('0x4'));var config=require(_0xd4e0('0x5'));var jayson=require(_0xd4e0('0x6'));var client=jayson[_0xd4e0('0x7')][_0xd4e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x389120,_0x36a62d,_0x54a0ad){return new BPromise(function(_0x2b1c75,_0x12ead3){return client[_0xd4e0('0x9')](_0x389120,_0x54a0ad)[_0xd4e0('0xa')](function(_0x1147ff){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x36a62d,_0xd4e0('0xb'));logger[_0xd4e0('0xc')](_0xd4e0('0xd'),_0x36a62d,_0xd4e0('0xb'),JSON['stringify'](_0x1147ff));if(_0x1147ff['error']){if(_0x1147ff[_0xd4e0('0xe')][_0xd4e0('0xf')]===0x1f4){logger[_0xd4e0('0xe')](_0xd4e0('0x10'),_0x36a62d,_0x1147ff[_0xd4e0('0xe')]['message']);return _0x12ead3(_0x1147ff[_0xd4e0('0xe')][_0xd4e0('0x11')]);}logger[_0xd4e0('0xe')](_0xd4e0('0x10'),_0x36a62d,_0x1147ff[_0xd4e0('0xe')][_0xd4e0('0x11')]);return _0x2b1c75(_0x1147ff['error'][_0xd4e0('0x11')]);}else{logger[_0xd4e0('0x12')](_0xd4e0('0x10'),_0x36a62d,_0xd4e0('0xb'));_0x2b1c75(_0x1147ff[_0xd4e0('0x13')][_0xd4e0('0x11')]);}})['catch'](function(_0x4cc1be){logger[_0xd4e0('0xe')](_0xd4e0('0x10'),_0x36a62d,_0x4cc1be);_0x12ead3(_0x4cc1be);});});}exports[_0xd4e0('0x14')]=function(_0x18a32a){var _0x4c7d7d=this;return new Promise(function(_0x22ea3a,_0x1d79cf){return db[_0xd4e0('0x15')][_0xd4e0('0x16')]({'raw':_0x18a32a[_0xd4e0('0x17')]?_0x18a32a[_0xd4e0('0x17')][_0xd4e0('0x18')]===undefined?!![]:![]:!![],'where':_0x18a32a[_0xd4e0('0x17')]?_0x18a32a['options']['where']||null:null,'attributes':_0x18a32a[_0xd4e0('0x17')]?_0x18a32a[_0xd4e0('0x17')]['attributes']||null:null,'limit':_0x18a32a['options']?_0x18a32a[_0xd4e0('0x17')][_0xd4e0('0x19')]||null:null,'include':_0x18a32a[_0xd4e0('0x17')]?_0x18a32a[_0xd4e0('0x17')][_0xd4e0('0x1a')]?_[_0xd4e0('0x1b')](_0x18a32a[_0xd4e0('0x17')]['include'],function(_0x14aa7c){return{'model':db[_0x14aa7c['model']],'as':_0x14aa7c['as'],'attributes':_0x14aa7c[_0xd4e0('0x1c')],'include':_0x14aa7c[_0xd4e0('0x1a')]?_[_0xd4e0('0x1b')](_0x14aa7c[_0xd4e0('0x1a')],function(_0x334522){return{'model':db[_0x334522[_0xd4e0('0x1d')]],'as':_0x334522['as'],'attributes':_0x334522[_0xd4e0('0x1c')],'include':_0x334522[_0xd4e0('0x1a')]?_['map'](_0x334522[_0xd4e0('0x1a')],function(_0x5cd331){return{'model':db[_0x5cd331[_0xd4e0('0x1d')]],'as':_0x5cd331['as'],'attributes':_0x5cd331['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4e0('0xa')](function(_0x20e2a1){logger['info']('GetFreshdeskAccount',_0x18a32a);logger[_0xd4e0('0xc')](_0xd4e0('0x14'),_0x18a32a,JSON['stringify'](_0x20e2a1));_0x22ea3a(_0x20e2a1);})[_0xd4e0('0x1e')](function(_0x22f677){logger['error'](_0xd4e0('0x14'),_0x22f677['message'],_0x18a32a);_0x1d79cf(_0x4c7d7d[_0xd4e0('0xe')](0x1f4,_0x22f677['message']));});});};exports[_0xd4e0('0x1f')]=function(_0x2ae109){var _0x1581d1=this;return new Promise(function(_0x1a1cb5,_0x466193){return db[_0xd4e0('0x15')][_0xd4e0('0x20')]({'raw':_0x2ae109['options']?_0x2ae109[_0xd4e0('0x17')][_0xd4e0('0x18')]===undefined?!![]:![]:!![],'where':_0x2ae109['options']?_0x2ae109[_0xd4e0('0x17')][_0xd4e0('0x21')]||null:null,'attributes':_0x2ae109['options']?_0x2ae109[_0xd4e0('0x17')][_0xd4e0('0x1c')]||null:null,'include':_0x2ae109['options']?_0x2ae109['options'][_0xd4e0('0x1a')]?_[_0xd4e0('0x1b')](_0x2ae109[_0xd4e0('0x17')][_0xd4e0('0x1a')],function(_0x79b77c){return{'model':db[_0x79b77c['model']],'as':_0x79b77c['as'],'attributes':_0x79b77c[_0xd4e0('0x1c')],'include':_0x79b77c[_0xd4e0('0x1a')]?_[_0xd4e0('0x1b')](_0x79b77c[_0xd4e0('0x1a')],function(_0x4f499a){return{'model':db[_0x4f499a[_0xd4e0('0x1d')]],'as':_0x4f499a['as'],'attributes':_0x4f499a[_0xd4e0('0x1c')],'include':_0x4f499a[_0xd4e0('0x1a')]?_[_0xd4e0('0x1b')](_0x4f499a[_0xd4e0('0x1a')],function(_0x602ed5){return{'model':db[_0x602ed5[_0xd4e0('0x1d')]],'as':_0x602ed5['as'],'attributes':_0x602ed5[_0xd4e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd4e0('0xa')](function(_0x955bbc){logger[_0xd4e0('0x12')](_0xd4e0('0x1f'),_0x2ae109);logger[_0xd4e0('0xc')](_0xd4e0('0x1f'),_0x2ae109,JSON['stringify'](_0x955bbc));_0x1a1cb5(_0x955bbc);})[_0xd4e0('0x1e')](function(_0x156073){logger[_0xd4e0('0xe')](_0xd4e0('0x1f'),_0x156073[_0xd4e0('0x11')],_0x2ae109);_0x466193(_0x1581d1[_0xd4e0('0xe')](0x1f4,_0x156073[_0xd4e0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index b9ad3ca..2573d71 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 _0xfeae=['create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','getFields','getDescriptions','/:id/tags','getTags','post'];(function(_0x125052,_0x6ca733){var _0x4ce4c4=function(_0x24a712){while(--_0x24a712){_0x125052['push'](_0x125052['shift']());}};_0x4ce4c4(++_0x6ca733);}(_0xfeae,0x191));var _0xefea=function(_0x4e4c7e,_0x2be545){_0x4e4c7e=_0x4e4c7e-0x0;var _0x1063ef=_0xfeae[_0x4e4c7e];return _0x1063ef;};'use strict';var multer=require(_0xefea('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xefea('0x1'));var express=require(_0xefea('0x2'));var router=express[_0xefea('0x3')]();var fs_extra=require(_0xefea('0x4'));var auth=require(_0xefea('0x5'));var interaction=require(_0xefea('0x6'));var config=require('../../config/environment');var controller=require(_0xefea('0x7'));router[_0xefea('0x8')]('/',auth[_0xefea('0x9')](),controller['index']);router[_0xefea('0x8')](_0xefea('0xa'),auth[_0xefea('0x9')](),controller[_0xefea('0xb')]);router[_0xefea('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xefea('0xc')]);router[_0xefea('0x8')]('/:id/subjects',auth[_0xefea('0x9')](),controller['getSubjects']);router[_0xefea('0x8')]('/:id/descriptions',auth[_0xefea('0x9')](),controller[_0xefea('0xd')]);router['get'](_0xefea('0xe'),auth[_0xefea('0x9')](),controller[_0xefea('0xf')]);router[_0xefea('0x10')]('/',auth['isAuthenticated'](),controller[_0xefea('0x11')]);router['post']('/:id/tags',auth[_0xefea('0x9')](),controller['setTags']);router['put'](_0xefea('0xa'),auth[_0xefea('0x9')](),controller[_0xefea('0x12')]);router[_0xefea('0x13')](_0xefea('0xa'),auth[_0xefea('0x9')](),controller[_0xefea('0x14')]);module[_0xefea('0x15')]=router; \ No newline at end of file +var _0x8004=['get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','show'];(function(_0x197595,_0x4d42ab){var _0x1d4440=function(_0x414659){while(--_0x414659){_0x197595['push'](_0x197595['shift']());}};_0x1d4440(++_0x4d42ab);}(_0x8004,0x80));var _0x4800=function(_0x210a38,_0xd57379){_0x210a38=_0x210a38-0x0;var _0x385e3e=_0x8004[_0x210a38];return _0x385e3e;};'use strict';var multer=require(_0x4800('0x0'));var util=require(_0x4800('0x1'));var path=require(_0x4800('0x2'));var timeout=require(_0x4800('0x3'));var express=require(_0x4800('0x4'));var router=express[_0x4800('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4800('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x4800('0x7')](),controller[_0x4800('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4800('0x9')]);router[_0x4800('0xa')](_0x4800('0xb'),auth[_0x4800('0x7')](),controller[_0x4800('0xc')]);router[_0x4800('0xa')](_0x4800('0xd'),auth[_0x4800('0x7')](),controller[_0x4800('0xe')]);router[_0x4800('0xa')](_0x4800('0xf'),auth['isAuthenticated'](),controller[_0x4800('0x10')]);router[_0x4800('0xa')]('/:id/tags',auth[_0x4800('0x7')](),controller['getTags']);router[_0x4800('0x11')]('/',auth[_0x4800('0x7')](),controller[_0x4800('0x12')]);router[_0x4800('0x11')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router['put']('/:id',auth[_0x4800('0x7')](),controller['update']);router[_0x4800('0x13')](_0x4800('0x14'),auth[_0x4800('0x7')](),controller[_0x4800('0x15')]);module[_0x4800('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index bdc3fc3..50fef90 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 _0x8b72=['exports','STRING'];(function(_0xb8dd02,_0x12049d){var _0x518fca=function(_0x204a2f){while(--_0x204a2f){_0xb8dd02['push'](_0xb8dd02['shift']());}};_0x518fca(++_0x12049d);}(_0x8b72,0x84));var _0x28b7=function(_0x1069b4,_0x305f8c){_0x1069b4=_0x1069b4-0x0;var _0x24bddd=_0x8b72[_0x1069b4];return _0x24bddd;};'use strict';var Sequelize=require('sequelize');module[_0x28b7('0x0')]={'name':{'type':Sequelize[_0x28b7('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5320=['exports','STRING','sequelize'];(function(_0x5a0ca8,_0x345a08){var _0x5e1088=function(_0x149075){while(--_0x149075){_0x5a0ca8['push'](_0x5a0ca8['shift']());}};_0x5e1088(++_0x345a08);}(_0x5320,0xb0));var _0x0532=function(_0x30ade3,_0x533875){_0x30ade3=_0x30ade3-0x0;var _0x288829=_0x5320[_0x30ade3];return _0x288829;};'use strict';var Sequelize=require(_0x0532('0x0'));module[_0x0532('0x1')]={'name':{'type':Sequelize[_0x0532('0x2')]},'description':{'type':Sequelize[_0x0532('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 728f707..1e09a4c 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 _0xd744=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','getFields','findOne','FreshdeskField','pick','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','request-promise'];(function(_0x261262,_0x224883){var _0xa9d33e=function(_0x5bdba2){while(--_0x5bdba2){_0x261262['push'](_0x261262['shift']());}};_0xa9d33e(++_0x224883);}(_0xd744,0xf9));var _0x4d74=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd744[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d74('0x0'));var zipdir=require(_0x4d74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d74('0x2'));var moment=require(_0x4d74('0x3'));var BPromise=require(_0x4d74('0x4'));var Mustache=require(_0x4d74('0x5'));var util=require(_0x4d74('0x6'));var path=require(_0x4d74('0x7'));var sox=require(_0x4d74('0x8'));var csv=require(_0x4d74('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d74('0xa'));var squel=require(_0x4d74('0xb'));var crypto=require('crypto');var jsforce=require(_0x4d74('0xc'));var deskjs=require(_0x4d74('0xd'));var toCsv=require(_0x4d74('0x9'));var querystring=require('querystring');var Papa=require(_0x4d74('0xe'));var Redis=require(_0x4d74('0xf'));var authService=require(_0x4d74('0x10'));var qs=require(_0x4d74('0x11'));var as=require(_0x4d74('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d74('0x13'))('api');var utils=require(_0x4d74('0x14'));var config=require(_0x4d74('0x15'));var licenseUtil=require(_0x4d74('0x16'));var db=require(_0x4d74('0x17'))['db'];function respondWithStatusCode(_0x1d1abe,_0x3fdeed){_0x3fdeed=_0x3fdeed||0xcc;return function(_0x35b0af){if(_0x35b0af){return _0x1d1abe[_0x4d74('0x18')](_0x3fdeed);}return _0x1d1abe[_0x4d74('0x19')](_0x3fdeed)[_0x4d74('0x1a')]();};}function respondWithResult(_0x2c306e,_0x1d3ad2){_0x1d3ad2=_0x1d3ad2||0xc8;return function(_0x58bfcd){if(_0x58bfcd){return _0x2c306e['status'](_0x1d3ad2)[_0x4d74('0x1b')](_0x58bfcd);}};}function respondWithFilteredResult(_0x2e4131,_0x14af73){return function(_0x342684){if(_0x342684){var _0x1f180b=typeof _0x14af73[_0x4d74('0x1c')]===_0x4d74('0x1d')&&typeof _0x14af73[_0x4d74('0x1e')]==='undefined';var _0xa3abb5=_0x342684[_0x4d74('0x1f')];var _0x57c644=_0x1f180b?0x0:_0x14af73['offset'];var _0x56c4c2=_0x1f180b?_0x342684[_0x4d74('0x1f')]:_0x14af73[_0x4d74('0x1c')]+_0x14af73[_0x4d74('0x1e')];var _0x13b06f;if(_0x56c4c2>=_0xa3abb5){_0x56c4c2=_0xa3abb5;_0x13b06f=0xc8;}else{_0x13b06f=0xce;}_0x2e4131[_0x4d74('0x19')](_0x13b06f);return _0x2e4131[_0x4d74('0x20')]('Content-Range',_0x57c644+'-'+_0x56c4c2+'/'+_0xa3abb5)[_0x4d74('0x1b')](_0x342684);}return null;};}function patchUpdates(_0x2871f9){return function(_0x2d2630){try{jsonpatch[_0x4d74('0x21')](_0x2d2630,_0x2871f9,!![]);}catch(_0x131d20){return BPromise[_0x4d74('0x22')](_0x131d20);}return _0x2d2630[_0x4d74('0x23')]();};}function saveUpdates(_0x5d777d,_0x3ec276){return function(_0x16729a){if(_0x16729a){return _0x16729a[_0x4d74('0x24')](_0x5d777d)[_0x4d74('0x25')](function(_0x2058bf){return _0x2058bf;});}return null;};}function removeEntity(_0x384451,_0x229236){return function(_0x4781c5){if(_0x4781c5){return _0x4781c5['destroy']()['then'](function(){_0x384451[_0x4d74('0x19')](0xcc)[_0x4d74('0x1a')]();});}};}function handleEntityNotFound(_0x2fda5f,_0x20c7ed){return function(_0x179f82){if(!_0x179f82){_0x2fda5f[_0x4d74('0x18')](0x194);}return _0x179f82;};}function handleError(_0x46184b,_0x2fe5d8){_0x2fe5d8=_0x2fe5d8||0x1f4;return function(_0x38eac3){logger[_0x4d74('0x26')](_0x38eac3[_0x4d74('0x27')]);if(_0x38eac3[_0x4d74('0x28')]){delete _0x38eac3[_0x4d74('0x28')];}_0x46184b[_0x4d74('0x19')](_0x2fe5d8)[_0x4d74('0x29')](_0x38eac3);};}exports[_0x4d74('0x2a')]=function(_0x3b8a32,_0x569ea2){var _0x45d0c4={},_0x1c052d={},_0x50e77a={'count':0x0,'rows':[]};var _0x3b9760=_[_0x4d74('0x2b')](db['FreshdeskConfiguration'][_0x4d74('0x2c')],function(_0x5569ca){return{'name':_0x5569ca[_0x4d74('0x2d')],'type':_0x5569ca[_0x4d74('0x2e')][_0x4d74('0x2f')]};});_0x1c052d[_0x4d74('0x30')]=_[_0x4d74('0x2b')](_0x3b9760,_0x4d74('0x28'));_0x1c052d[_0x4d74('0x31')]=_['keys'](_0x3b8a32['query']);_0x1c052d[_0x4d74('0x32')]=_['intersection'](_0x1c052d['model'],_0x1c052d['query']);_0x45d0c4['attributes']=_[_0x4d74('0x33')](_0x1c052d[_0x4d74('0x30')],qs[_0x4d74('0x34')](_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x34')]));_0x45d0c4[_0x4d74('0x35')]=_0x45d0c4[_0x4d74('0x35')][_0x4d74('0x36')]?_0x45d0c4[_0x4d74('0x35')]:_0x1c052d[_0x4d74('0x30')];if(!_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x37')](_0x4d74('0x38'))){_0x45d0c4[_0x4d74('0x1e')]=qs['limit'](_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x1e')]);_0x45d0c4[_0x4d74('0x1c')]=qs[_0x4d74('0x1c')](_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x1c')]);}_0x45d0c4[_0x4d74('0x39')]=qs['sort'](_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x3a')]);_0x45d0c4[_0x4d74('0x3b')]=qs[_0x4d74('0x32')](_['pick'](_0x3b8a32[_0x4d74('0x31')],_0x1c052d['filters']),_0x3b9760);if(_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x3c')]){_0x45d0c4[_0x4d74('0x3b')]=_[_0x4d74('0x3d')](_0x45d0c4[_0x4d74('0x3b')],{'$or':_[_0x4d74('0x2b')](_0x3b9760,function(_0x45bdc9){if(_0x45bdc9[_0x4d74('0x2e')]!==_0x4d74('0x3e')){var _0x25a387={};_0x25a387[_0x45bdc9[_0x4d74('0x28')]]={'$like':'%'+_0x3b8a32['query'][_0x4d74('0x3c')]+'%'};return _0x25a387;}})});}_0x45d0c4=_['merge']({},_0x45d0c4,_0x3b8a32[_0x4d74('0x3f')]);var _0x399aee={'where':_0x45d0c4[_0x4d74('0x3b')]};return db[_0x4d74('0x40')][_0x4d74('0x1f')](_0x399aee)[_0x4d74('0x25')](function(_0x116cf8){_0x50e77a[_0x4d74('0x1f')]=_0x116cf8;if(_0x3b8a32[_0x4d74('0x31')][_0x4d74('0x41')]){_0x45d0c4[_0x4d74('0x42')]=[{'all':!![]}];}return db[_0x4d74('0x40')][_0x4d74('0x43')](_0x45d0c4);})[_0x4d74('0x25')](function(_0x36af5b){_0x50e77a[_0x4d74('0x44')]=_0x36af5b;return _0x50e77a;})['then'](respondWithFilteredResult(_0x569ea2,_0x45d0c4))[_0x4d74('0x45')](handleError(_0x569ea2,null));};exports['show']=function(_0x1f52f6,_0x24b219){var _0x508f9c={'raw':![],'where':{'id':_0x1f52f6[_0x4d74('0x46')]['id']}},_0x2587f7={};_0x2587f7['model']=_[_0x4d74('0x47')](db[_0x4d74('0x40')][_0x4d74('0x2c')]);_0x2587f7[_0x4d74('0x31')]=_[_0x4d74('0x47')](_0x1f52f6[_0x4d74('0x31')]);_0x2587f7[_0x4d74('0x32')]=_['intersection'](_0x2587f7[_0x4d74('0x30')],_0x2587f7[_0x4d74('0x31')]);_0x508f9c[_0x4d74('0x35')]=_[_0x4d74('0x33')](_0x2587f7[_0x4d74('0x30')],qs[_0x4d74('0x34')](_0x1f52f6[_0x4d74('0x31')]['fields']));_0x508f9c[_0x4d74('0x35')]=_0x508f9c[_0x4d74('0x35')][_0x4d74('0x36')]?_0x508f9c[_0x4d74('0x35')]:_0x2587f7[_0x4d74('0x30')];if(_0x1f52f6['query'][_0x4d74('0x41')]){_0x508f9c[_0x4d74('0x42')]=[{'all':!![]}];}_0x508f9c=_[_0x4d74('0x3d')]({},_0x508f9c,_0x1f52f6[_0x4d74('0x3f')]);return db['FreshdeskConfiguration'][_0x4d74('0x48')](_0x508f9c)[_0x4d74('0x25')](handleEntityNotFound(_0x24b219,null))[_0x4d74('0x25')](respondWithResult(_0x24b219,null))['catch'](handleError(_0x24b219,null));};exports[_0x4d74('0x49')]=function(_0x5f3b68,_0x11e1b7){return db[_0x4d74('0x40')][_0x4d74('0x49')](_0x5f3b68[_0x4d74('0x4a')],{})[_0x4d74('0x25')](respondWithResult(_0x11e1b7,0xc9))[_0x4d74('0x45')](handleError(_0x11e1b7,null));};exports[_0x4d74('0x24')]=function(_0x33d5d8,_0x19f2f7){if(_0x33d5d8[_0x4d74('0x4a')]['id']){delete _0x33d5d8[_0x4d74('0x4a')]['id'];}return db[_0x4d74('0x40')]['find']({'where':{'id':_0x33d5d8['params']['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x19f2f7,null))[_0x4d74('0x25')](saveUpdates(_0x33d5d8['body'],null))[_0x4d74('0x25')](respondWithResult(_0x19f2f7,null))[_0x4d74('0x45')](handleError(_0x19f2f7,null));};exports[_0x4d74('0x4b')]=function(_0x245556,_0x4978cd){return db[_0x4d74('0x40')][_0x4d74('0x48')]({'where':{'id':_0x245556['params']['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x4978cd,null))[_0x4d74('0x25')](removeEntity(_0x4978cd,null))['catch'](handleError(_0x4978cd,null));};exports[_0x4d74('0x4c')]=function(_0xa26442,_0x1193bb,_0x4254be){var _0xfec88={};var _0x2c7fdf={};var _0x366640;var _0x358aee;return db['FreshdeskConfiguration'][_0x4d74('0x4d')]({'where':{'id':_0xa26442[_0x4d74('0x46')]['id']}})['then'](handleEntityNotFound(_0x1193bb,null))[_0x4d74('0x25')](function(_0x1c6873){if(_0x1c6873){_0x366640=_0x1c6873;_0x2c7fdf[_0x4d74('0x30')]=_[_0x4d74('0x47')](db[_0x4d74('0x4e')][_0x4d74('0x2c')]);_0x2c7fdf['query']=_[_0x4d74('0x47')](_0xa26442[_0x4d74('0x31')]);_0x2c7fdf['filters']=_[_0x4d74('0x33')](_0x2c7fdf['model'],_0x2c7fdf['query']);_0xfec88[_0x4d74('0x35')]=_[_0x4d74('0x33')](_0x2c7fdf['model'],qs[_0x4d74('0x34')](_0xa26442['query'][_0x4d74('0x34')]));_0xfec88[_0x4d74('0x35')]=_0xfec88[_0x4d74('0x35')][_0x4d74('0x36')]?_0xfec88[_0x4d74('0x35')]:_0x2c7fdf['model'];_0xfec88[_0x4d74('0x39')]=qs[_0x4d74('0x3a')](_0xa26442[_0x4d74('0x31')][_0x4d74('0x3a')]);_0xfec88[_0x4d74('0x3b')]=qs['filters'](_[_0x4d74('0x4f')](_0xa26442['query'],_0x2c7fdf[_0x4d74('0x32')]));if(_0xa26442[_0x4d74('0x31')]['filter']){_0xfec88['where']=_[_0x4d74('0x3d')](_0xfec88[_0x4d74('0x3b')],{'$or':_[_0x4d74('0x2b')](_0xfec88[_0x4d74('0x35')],function(_0x2451bc){var _0x4cdc3f={};_0x4cdc3f[_0x2451bc]={'$like':'%'+_0xa26442['query']['filter']+'%'};return _0x4cdc3f;})});}_0xfec88=_['merge']({},_0xfec88,_0xa26442[_0x4d74('0x3f')]);return _0x366640['getFields'](_0xfec88);}})[_0x4d74('0x25')](function(_0x36dd76){if(_0x36dd76){_0x358aee=_0x36dd76[_0x4d74('0x36')];if(!_0xa26442['query'][_0x4d74('0x37')](_0x4d74('0x38'))){_0xfec88[_0x4d74('0x1e')]=qs[_0x4d74('0x1e')](_0xa26442[_0x4d74('0x31')][_0x4d74('0x1e')]);_0xfec88[_0x4d74('0x1c')]=qs[_0x4d74('0x1c')](_0xa26442[_0x4d74('0x31')][_0x4d74('0x1c')]);}return _0x366640[_0x4d74('0x4c')](_0xfec88);}})[_0x4d74('0x25')](function(_0x2dabbf){if(_0x2dabbf){return _0x2dabbf?{'count':_0x358aee,'rows':_0x2dabbf}:null;}})[_0x4d74('0x25')](respondWithResult(_0x1193bb,null))[_0x4d74('0x45')](handleError(_0x1193bb,null));};exports['getSubjects']=function(_0x1d3af8,_0x58374f,_0x47d9bb){var _0xf0649c={};var _0x6251c0={};var _0x184143;var _0x4a09e5;return db[_0x4d74('0x40')][_0x4d74('0x4d')]({'where':{'id':_0x1d3af8[_0x4d74('0x46')]['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x58374f,null))[_0x4d74('0x25')](function(_0x1218a5){if(_0x1218a5){_0x184143=_0x1218a5;_0x6251c0[_0x4d74('0x30')]=_[_0x4d74('0x47')](db['FreshdeskField'][_0x4d74('0x2c')]);_0x6251c0[_0x4d74('0x31')]=_[_0x4d74('0x47')](_0x1d3af8['query']);_0x6251c0[_0x4d74('0x32')]=_[_0x4d74('0x33')](_0x6251c0[_0x4d74('0x30')],_0x6251c0[_0x4d74('0x31')]);_0xf0649c[_0x4d74('0x35')]=_['intersection'](_0x6251c0[_0x4d74('0x30')],qs['fields'](_0x1d3af8[_0x4d74('0x31')]['fields']));_0xf0649c[_0x4d74('0x35')]=_0xf0649c['attributes'][_0x4d74('0x36')]?_0xf0649c[_0x4d74('0x35')]:_0x6251c0[_0x4d74('0x30')];_0xf0649c[_0x4d74('0x39')]=qs[_0x4d74('0x3a')](_0x1d3af8[_0x4d74('0x31')]['sort']);_0xf0649c[_0x4d74('0x3b')]=qs[_0x4d74('0x32')](_['pick'](_0x1d3af8['query'],_0x6251c0[_0x4d74('0x32')]));if(_0x1d3af8[_0x4d74('0x31')][_0x4d74('0x3c')]){_0xf0649c[_0x4d74('0x3b')]=_[_0x4d74('0x3d')](_0xf0649c[_0x4d74('0x3b')],{'$or':_[_0x4d74('0x2b')](_0xf0649c['attributes'],function(_0x3ebc6b){var _0xbcd9fb={};_0xbcd9fb[_0x3ebc6b]={'$like':'%'+_0x1d3af8[_0x4d74('0x31')]['filter']+'%'};return _0xbcd9fb;})});}_0xf0649c=_[_0x4d74('0x3d')]({},_0xf0649c,_0x1d3af8['options']);return _0x184143['getSubjects'](_0xf0649c);}})[_0x4d74('0x25')](function(_0x2c14f3){if(_0x2c14f3){_0x4a09e5=_0x2c14f3[_0x4d74('0x36')];if(!_0x1d3af8[_0x4d74('0x31')][_0x4d74('0x37')](_0x4d74('0x38'))){_0xf0649c[_0x4d74('0x1e')]=qs['limit'](_0x1d3af8['query']['limit']);_0xf0649c[_0x4d74('0x1c')]=qs['offset'](_0x1d3af8[_0x4d74('0x31')]['offset']);}return _0x184143['getSubjects'](_0xf0649c);}})['then'](function(_0x17f468){if(_0x17f468){return _0x17f468?{'count':_0x4a09e5,'rows':_0x17f468}:null;}})[_0x4d74('0x25')](respondWithResult(_0x58374f,null))[_0x4d74('0x45')](handleError(_0x58374f,null));};exports[_0x4d74('0x50')]=function(_0x5c7089,_0x2308f2,_0x4d127a){var _0x5d2460={};var _0x5265e5={};var _0x16e0c9;var _0x8641aa;return db['FreshdeskConfiguration'][_0x4d74('0x4d')]({'where':{'id':_0x5c7089[_0x4d74('0x46')]['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x2308f2,null))[_0x4d74('0x25')](function(_0x64c1a3){if(_0x64c1a3){_0x16e0c9=_0x64c1a3;_0x5265e5[_0x4d74('0x30')]=_[_0x4d74('0x47')](db[_0x4d74('0x4e')]['rawAttributes']);_0x5265e5['query']=_[_0x4d74('0x47')](_0x5c7089[_0x4d74('0x31')]);_0x5265e5[_0x4d74('0x32')]=_[_0x4d74('0x33')](_0x5265e5['model'],_0x5265e5[_0x4d74('0x31')]);_0x5d2460[_0x4d74('0x35')]=_[_0x4d74('0x33')](_0x5265e5['model'],qs[_0x4d74('0x34')](_0x5c7089[_0x4d74('0x31')][_0x4d74('0x34')]));_0x5d2460['attributes']=_0x5d2460['attributes'][_0x4d74('0x36')]?_0x5d2460[_0x4d74('0x35')]:_0x5265e5[_0x4d74('0x30')];_0x5d2460[_0x4d74('0x39')]=qs['sort'](_0x5c7089['query'][_0x4d74('0x3a')]);_0x5d2460[_0x4d74('0x3b')]=qs[_0x4d74('0x32')](_[_0x4d74('0x4f')](_0x5c7089[_0x4d74('0x31')],_0x5265e5[_0x4d74('0x32')]));if(_0x5c7089[_0x4d74('0x31')][_0x4d74('0x3c')]){_0x5d2460[_0x4d74('0x3b')]=_['merge'](_0x5d2460['where'],{'$or':_[_0x4d74('0x2b')](_0x5d2460['attributes'],function(_0x212a48){var _0x143e20={};_0x143e20[_0x212a48]={'$like':'%'+_0x5c7089[_0x4d74('0x31')][_0x4d74('0x3c')]+'%'};return _0x143e20;})});}_0x5d2460=_[_0x4d74('0x3d')]({},_0x5d2460,_0x5c7089['options']);return _0x16e0c9[_0x4d74('0x50')](_0x5d2460);}})['then'](function(_0x170098){if(_0x170098){_0x8641aa=_0x170098[_0x4d74('0x36')];if(!_0x5c7089['query'][_0x4d74('0x37')](_0x4d74('0x38'))){_0x5d2460['limit']=qs[_0x4d74('0x1e')](_0x5c7089['query']['limit']);_0x5d2460[_0x4d74('0x1c')]=qs[_0x4d74('0x1c')](_0x5c7089[_0x4d74('0x31')][_0x4d74('0x1c')]);}return _0x16e0c9['getDescriptions'](_0x5d2460);}})[_0x4d74('0x25')](function(_0x525f81){if(_0x525f81){return _0x525f81?{'count':_0x8641aa,'rows':_0x525f81}:null;}})[_0x4d74('0x25')](respondWithResult(_0x2308f2,null))['catch'](handleError(_0x2308f2,null));};exports[_0x4d74('0x51')]=function(_0x2d4e18,_0x25e7e6,_0x434de8){var _0x4fc279={};var _0x257b69={};var _0x48b0ad;var _0x567406;return db['FreshdeskConfiguration'][_0x4d74('0x4d')]({'where':{'id':_0x2d4e18[_0x4d74('0x46')]['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x25e7e6,null))[_0x4d74('0x25')](function(_0x5738db){if(_0x5738db){_0x48b0ad=_0x5738db;_0x257b69[_0x4d74('0x30')]=_[_0x4d74('0x47')](db[_0x4d74('0x52')]['rawAttributes']);_0x257b69[_0x4d74('0x31')]=_[_0x4d74('0x47')](_0x2d4e18[_0x4d74('0x31')]);_0x257b69[_0x4d74('0x32')]=_[_0x4d74('0x33')](_0x257b69['model'],_0x257b69[_0x4d74('0x31')]);_0x4fc279[_0x4d74('0x35')]=_['intersection'](_0x257b69[_0x4d74('0x30')],qs[_0x4d74('0x34')](_0x2d4e18[_0x4d74('0x31')][_0x4d74('0x34')]));_0x4fc279['attributes']=_0x4fc279[_0x4d74('0x35')][_0x4d74('0x36')]?_0x4fc279[_0x4d74('0x35')]:_0x257b69['model'];_0x4fc279['order']=qs['sort'](_0x2d4e18[_0x4d74('0x31')]['sort']);_0x4fc279[_0x4d74('0x3b')]=qs['filters'](_[_0x4d74('0x4f')](_0x2d4e18['query'],_0x257b69[_0x4d74('0x32')]));if(_0x2d4e18['query'][_0x4d74('0x3c')]){_0x4fc279[_0x4d74('0x3b')]=_['merge'](_0x4fc279[_0x4d74('0x3b')],{'$or':_['map'](_0x4fc279[_0x4d74('0x35')],function(_0x152969){var _0x3188f1={};_0x3188f1[_0x152969]={'$like':'%'+_0x2d4e18['query'][_0x4d74('0x3c')]+'%'};return _0x3188f1;})});}_0x4fc279=_[_0x4d74('0x3d')]({},_0x4fc279,_0x2d4e18[_0x4d74('0x3f')]);return _0x48b0ad[_0x4d74('0x51')](_0x4fc279);}})['then'](function(_0x167e51){if(_0x167e51){_0x567406=_0x167e51[_0x4d74('0x36')];if(!_0x2d4e18[_0x4d74('0x31')][_0x4d74('0x37')](_0x4d74('0x38'))){_0x4fc279['limit']=qs[_0x4d74('0x1e')](_0x2d4e18['query'][_0x4d74('0x1e')]);_0x4fc279[_0x4d74('0x1c')]=qs[_0x4d74('0x1c')](_0x2d4e18['query'][_0x4d74('0x1c')]);}return _0x48b0ad[_0x4d74('0x51')](_0x4fc279);}})['then'](function(_0x19f118){if(_0x19f118){return _0x19f118?{'count':_0x567406,'rows':_0x19f118}:null;}})[_0x4d74('0x25')](respondWithResult(_0x25e7e6,null))[_0x4d74('0x45')](handleError(_0x25e7e6,null));};exports['setTags']=function(_0x33525b,_0x472dc4,_0x4daf02){if(_0x33525b[_0x4d74('0x4a')]['id']){delete _0x33525b[_0x4d74('0x4a')]['id'];}return db[_0x4d74('0x40')][_0x4d74('0x4d')]({'where':{'id':_0x33525b[_0x4d74('0x46')]['id']}})[_0x4d74('0x25')](handleEntityNotFound(_0x472dc4,null))[_0x4d74('0x25')](function(_0x4878fc){if(_0x4878fc){return _0x4878fc[_0x4d74('0x53')](_0x33525b['body']['ids']||[]);}return null;})[_0x4d74('0x25')](respondWithResult(_0x472dc4,null))['catch'](handleError(_0x472dc4,null));}; \ No newline at end of file +var _0x2cc3=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','FreshdeskField','length','getSubjects','order','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x1846b9,_0x11e023){var _0xd1f7d5=function(_0x28502c){while(--_0x28502c){_0x1846b9['push'](_0x1846b9['shift']());}};_0xd1f7d5(++_0x11e023);}(_0x2cc3,0x13b));var _0x32cc=function(_0x2a18e4,_0x10367f){_0x2a18e4=_0x2a18e4-0x0;var _0x4f0cc1=_0x2cc3[_0x2a18e4];return _0x4f0cc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32cc('0x0'));var zipdir=require(_0x32cc('0x1'));var jsonpatch=require(_0x32cc('0x2'));var rp=require(_0x32cc('0x3'));var moment=require('moment');var BPromise=require(_0x32cc('0x4'));var Mustache=require(_0x32cc('0x5'));var util=require(_0x32cc('0x6'));var path=require(_0x32cc('0x7'));var sox=require(_0x32cc('0x8'));var csv=require('to-csv');var ejs=require(_0x32cc('0x9'));var fs=require('fs');var fs_extra=require(_0x32cc('0xa'));var _=require('lodash');var squel=require(_0x32cc('0xb'));var crypto=require('crypto');var jsforce=require(_0x32cc('0xc'));var deskjs=require(_0x32cc('0xd'));var toCsv=require(_0x32cc('0xe'));var querystring=require(_0x32cc('0xf'));var Papa=require('papaparse');var Redis=require(_0x32cc('0x10'));var authService=require(_0x32cc('0x11'));var qs=require(_0x32cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32cc('0x13'))(_0x32cc('0x14'));var utils=require('../../config/utils');var config=require(_0x32cc('0x15'));var licenseUtil=require(_0x32cc('0x16'));var db=require(_0x32cc('0x17'))['db'];function respondWithStatusCode(_0x3f0d93,_0x527b79){_0x527b79=_0x527b79||0xcc;return function(_0x110a46){if(_0x110a46){return _0x3f0d93[_0x32cc('0x18')](_0x527b79);}return _0x3f0d93[_0x32cc('0x19')](_0x527b79)[_0x32cc('0x1a')]();};}function respondWithResult(_0x340567,_0x1e4356){_0x1e4356=_0x1e4356||0xc8;return function(_0x1cc221){if(_0x1cc221){return _0x340567[_0x32cc('0x19')](_0x1e4356)[_0x32cc('0x1b')](_0x1cc221);}};}function respondWithFilteredResult(_0x4cc877,_0x4dd24b){return function(_0x474c9b){if(_0x474c9b){var _0x8ff2b6=typeof _0x4dd24b[_0x32cc('0x1c')]==='undefined'&&typeof _0x4dd24b[_0x32cc('0x1d')]===_0x32cc('0x1e');var _0x2c8bce=_0x474c9b['count'];var _0x57ea30=_0x8ff2b6?0x0:_0x4dd24b[_0x32cc('0x1c')];var _0x10c5c3=_0x8ff2b6?_0x474c9b['count']:_0x4dd24b[_0x32cc('0x1c')]+_0x4dd24b[_0x32cc('0x1d')];var _0x308a30;if(_0x10c5c3>=_0x2c8bce){_0x10c5c3=_0x2c8bce;_0x308a30=0xc8;}else{_0x308a30=0xce;}_0x4cc877[_0x32cc('0x19')](_0x308a30);return _0x4cc877[_0x32cc('0x1f')](_0x32cc('0x20'),_0x57ea30+'-'+_0x10c5c3+'/'+_0x2c8bce)[_0x32cc('0x1b')](_0x474c9b);}return null;};}function patchUpdates(_0x3af772){return function(_0x491af2){try{jsonpatch[_0x32cc('0x21')](_0x491af2,_0x3af772,!![]);}catch(_0x1af205){return BPromise[_0x32cc('0x22')](_0x1af205);}return _0x491af2[_0x32cc('0x23')]();};}function saveUpdates(_0xb9cf8,_0xa49b8a){return function(_0x548f80){if(_0x548f80){return _0x548f80['update'](_0xb9cf8)[_0x32cc('0x24')](function(_0x4efd70){return _0x4efd70;});}return null;};}function removeEntity(_0x4bed15,_0x574922){return function(_0x52ec67){if(_0x52ec67){return _0x52ec67[_0x32cc('0x25')]()['then'](function(){_0x4bed15['status'](0xcc)[_0x32cc('0x1a')]();});}};}function handleEntityNotFound(_0x1a3939,_0x239724){return function(_0x136151){if(!_0x136151){_0x1a3939[_0x32cc('0x18')](0x194);}return _0x136151;};}function handleError(_0x340292,_0x5e79ad){_0x5e79ad=_0x5e79ad||0x1f4;return function(_0xbffd36){logger['error'](_0xbffd36['stack']);if(_0xbffd36[_0x32cc('0x26')]){delete _0xbffd36[_0x32cc('0x26')];}_0x340292['status'](_0x5e79ad)[_0x32cc('0x27')](_0xbffd36);};}exports[_0x32cc('0x28')]=function(_0x586a77,_0x2288b9){var _0x1eba12={},_0x2c3ebd={},_0x2cea00={'count':0x0,'rows':[]};var _0x455003=_[_0x32cc('0x29')](db[_0x32cc('0x2a')][_0x32cc('0x2b')],function(_0xf2d83d){return{'name':_0xf2d83d['fieldName'],'type':_0xf2d83d['type'][_0x32cc('0x2c')]};});_0x2c3ebd[_0x32cc('0x2d')]=_['map'](_0x455003,_0x32cc('0x26'));_0x2c3ebd[_0x32cc('0x2e')]=_[_0x32cc('0x2f')](_0x586a77[_0x32cc('0x2e')]);_0x2c3ebd[_0x32cc('0x30')]=_[_0x32cc('0x31')](_0x2c3ebd['model'],_0x2c3ebd['query']);_0x1eba12['attributes']=_['intersection'](_0x2c3ebd[_0x32cc('0x2d')],qs[_0x32cc('0x32')](_0x586a77[_0x32cc('0x2e')]['fields']));_0x1eba12[_0x32cc('0x33')]=_0x1eba12['attributes']['length']?_0x1eba12[_0x32cc('0x33')]:_0x2c3ebd[_0x32cc('0x2d')];if(!_0x586a77[_0x32cc('0x2e')][_0x32cc('0x34')](_0x32cc('0x35'))){_0x1eba12[_0x32cc('0x1d')]=qs[_0x32cc('0x1d')](_0x586a77['query'][_0x32cc('0x1d')]);_0x1eba12['offset']=qs[_0x32cc('0x1c')](_0x586a77['query'][_0x32cc('0x1c')]);}_0x1eba12['order']=qs['sort'](_0x586a77[_0x32cc('0x2e')][_0x32cc('0x36')]);_0x1eba12['where']=qs[_0x32cc('0x30')](_[_0x32cc('0x37')](_0x586a77['query'],_0x2c3ebd[_0x32cc('0x30')]),_0x455003);if(_0x586a77[_0x32cc('0x2e')]['filter']){_0x1eba12[_0x32cc('0x38')]=_[_0x32cc('0x39')](_0x1eba12['where'],{'$or':_['map'](_0x455003,function(_0x2b6c91){if(_0x2b6c91['type']!==_0x32cc('0x3a')){var _0x160983={};_0x160983[_0x2b6c91['name']]={'$like':'%'+_0x586a77['query'][_0x32cc('0x3b')]+'%'};return _0x160983;}})});}_0x1eba12=_['merge']({},_0x1eba12,_0x586a77[_0x32cc('0x3c')]);var _0x5d8f3a={'where':_0x1eba12[_0x32cc('0x38')]};return db[_0x32cc('0x2a')][_0x32cc('0x3d')](_0x5d8f3a)['then'](function(_0x46daed){_0x2cea00[_0x32cc('0x3d')]=_0x46daed;if(_0x586a77[_0x32cc('0x2e')][_0x32cc('0x3e')]){_0x1eba12[_0x32cc('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x32cc('0x40')](_0x1eba12);})[_0x32cc('0x24')](function(_0x278a12){_0x2cea00[_0x32cc('0x41')]=_0x278a12;return _0x2cea00;})[_0x32cc('0x24')](respondWithFilteredResult(_0x2288b9,_0x1eba12))[_0x32cc('0x42')](handleError(_0x2288b9,null));};exports[_0x32cc('0x43')]=function(_0x412788,_0x3a498b){var _0xea3144={'raw':![],'where':{'id':_0x412788['params']['id']}},_0x3b3808={};_0x3b3808[_0x32cc('0x2d')]=_['keys'](db[_0x32cc('0x2a')][_0x32cc('0x2b')]);_0x3b3808[_0x32cc('0x2e')]=_['keys'](_0x412788[_0x32cc('0x2e')]);_0x3b3808[_0x32cc('0x30')]=_['intersection'](_0x3b3808[_0x32cc('0x2d')],_0x3b3808[_0x32cc('0x2e')]);_0xea3144[_0x32cc('0x33')]=_[_0x32cc('0x31')](_0x3b3808[_0x32cc('0x2d')],qs[_0x32cc('0x32')](_0x412788[_0x32cc('0x2e')][_0x32cc('0x32')]));_0xea3144[_0x32cc('0x33')]=_0xea3144[_0x32cc('0x33')]['length']?_0xea3144['attributes']:_0x3b3808[_0x32cc('0x2d')];if(_0x412788[_0x32cc('0x2e')][_0x32cc('0x3e')]){_0xea3144[_0x32cc('0x3f')]=[{'all':!![]}];}_0xea3144=_[_0x32cc('0x39')]({},_0xea3144,_0x412788[_0x32cc('0x3c')]);return db[_0x32cc('0x2a')][_0x32cc('0x44')](_0xea3144)['then'](handleEntityNotFound(_0x3a498b,null))['then'](respondWithResult(_0x3a498b,null))[_0x32cc('0x42')](handleError(_0x3a498b,null));};exports[_0x32cc('0x45')]=function(_0xf725a5,_0x1fed70){return db[_0x32cc('0x2a')][_0x32cc('0x45')](_0xf725a5['body'],{})[_0x32cc('0x24')](respondWithResult(_0x1fed70,0xc9))['catch'](handleError(_0x1fed70,null));};exports['update']=function(_0x302c75,_0x34c411){if(_0x302c75['body']['id']){delete _0x302c75[_0x32cc('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x32cc('0x44')]({'where':{'id':_0x302c75['params']['id']}})[_0x32cc('0x24')](handleEntityNotFound(_0x34c411,null))[_0x32cc('0x24')](saveUpdates(_0x302c75[_0x32cc('0x46')],null))[_0x32cc('0x24')](respondWithResult(_0x34c411,null))['catch'](handleError(_0x34c411,null));};exports['destroy']=function(_0x119216,_0x41b029){return db['FreshdeskConfiguration'][_0x32cc('0x44')]({'where':{'id':_0x119216[_0x32cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x41b029,null))[_0x32cc('0x24')](removeEntity(_0x41b029,null))[_0x32cc('0x42')](handleError(_0x41b029,null));};exports[_0x32cc('0x48')]=function(_0x460d7c,_0x39dd54,_0x1c9f31){var _0x5633c1={};var _0x558f19={};var _0x53fb5d;var _0x2487e1;return db[_0x32cc('0x2a')][_0x32cc('0x49')]({'where':{'id':_0x460d7c[_0x32cc('0x47')]['id']}})[_0x32cc('0x24')](handleEntityNotFound(_0x39dd54,null))[_0x32cc('0x24')](function(_0x36e16f){if(_0x36e16f){_0x53fb5d=_0x36e16f;_0x558f19[_0x32cc('0x2d')]=_[_0x32cc('0x2f')](db[_0x32cc('0x4a')]['rawAttributes']);_0x558f19[_0x32cc('0x2e')]=_[_0x32cc('0x2f')](_0x460d7c[_0x32cc('0x2e')]);_0x558f19['filters']=_[_0x32cc('0x31')](_0x558f19[_0x32cc('0x2d')],_0x558f19[_0x32cc('0x2e')]);_0x5633c1[_0x32cc('0x33')]=_[_0x32cc('0x31')](_0x558f19[_0x32cc('0x2d')],qs[_0x32cc('0x32')](_0x460d7c[_0x32cc('0x2e')][_0x32cc('0x32')]));_0x5633c1[_0x32cc('0x33')]=_0x5633c1[_0x32cc('0x33')]['length']?_0x5633c1[_0x32cc('0x33')]:_0x558f19[_0x32cc('0x2d')];_0x5633c1['order']=qs[_0x32cc('0x36')](_0x460d7c['query'][_0x32cc('0x36')]);_0x5633c1[_0x32cc('0x38')]=qs[_0x32cc('0x30')](_[_0x32cc('0x37')](_0x460d7c[_0x32cc('0x2e')],_0x558f19[_0x32cc('0x30')]));if(_0x460d7c[_0x32cc('0x2e')][_0x32cc('0x3b')]){_0x5633c1[_0x32cc('0x38')]=_[_0x32cc('0x39')](_0x5633c1[_0x32cc('0x38')],{'$or':_[_0x32cc('0x29')](_0x5633c1['attributes'],function(_0x3c11e4){var _0x216cd3={};_0x216cd3[_0x3c11e4]={'$like':'%'+_0x460d7c['query'][_0x32cc('0x3b')]+'%'};return _0x216cd3;})});}_0x5633c1=_[_0x32cc('0x39')]({},_0x5633c1,_0x460d7c['options']);return _0x53fb5d[_0x32cc('0x48')](_0x5633c1);}})[_0x32cc('0x24')](function(_0x5502d9){if(_0x5502d9){_0x2487e1=_0x5502d9[_0x32cc('0x4b')];if(!_0x460d7c[_0x32cc('0x2e')][_0x32cc('0x34')](_0x32cc('0x35'))){_0x5633c1[_0x32cc('0x1d')]=qs['limit'](_0x460d7c[_0x32cc('0x2e')]['limit']);_0x5633c1['offset']=qs['offset'](_0x460d7c[_0x32cc('0x2e')][_0x32cc('0x1c')]);}return _0x53fb5d[_0x32cc('0x48')](_0x5633c1);}})[_0x32cc('0x24')](function(_0x410a77){if(_0x410a77){return _0x410a77?{'count':_0x2487e1,'rows':_0x410a77}:null;}})[_0x32cc('0x24')](respondWithResult(_0x39dd54,null))[_0x32cc('0x42')](handleError(_0x39dd54,null));};exports[_0x32cc('0x4c')]=function(_0xb16b74,_0x15370a,_0x76f923){var _0x362948={};var _0x4a0de8={};var _0x5efa53;var _0xd26f88;return db[_0x32cc('0x2a')]['findOne']({'where':{'id':_0xb16b74[_0x32cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x15370a,null))['then'](function(_0x408e79){if(_0x408e79){_0x5efa53=_0x408e79;_0x4a0de8[_0x32cc('0x2d')]=_['keys'](db['FreshdeskField'][_0x32cc('0x2b')]);_0x4a0de8['query']=_['keys'](_0xb16b74['query']);_0x4a0de8[_0x32cc('0x30')]=_['intersection'](_0x4a0de8[_0x32cc('0x2d')],_0x4a0de8['query']);_0x362948[_0x32cc('0x33')]=_[_0x32cc('0x31')](_0x4a0de8[_0x32cc('0x2d')],qs[_0x32cc('0x32')](_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x32')]));_0x362948[_0x32cc('0x33')]=_0x362948[_0x32cc('0x33')][_0x32cc('0x4b')]?_0x362948['attributes']:_0x4a0de8[_0x32cc('0x2d')];_0x362948[_0x32cc('0x4d')]=qs['sort'](_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x36')]);_0x362948['where']=qs['filters'](_[_0x32cc('0x37')](_0xb16b74['query'],_0x4a0de8[_0x32cc('0x30')]));if(_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x3b')]){_0x362948[_0x32cc('0x38')]=_[_0x32cc('0x39')](_0x362948[_0x32cc('0x38')],{'$or':_[_0x32cc('0x29')](_0x362948['attributes'],function(_0x5a9196){var _0x347ab4={};_0x347ab4[_0x5a9196]={'$like':'%'+_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x3b')]+'%'};return _0x347ab4;})});}_0x362948=_['merge']({},_0x362948,_0xb16b74[_0x32cc('0x3c')]);return _0x5efa53[_0x32cc('0x4c')](_0x362948);}})[_0x32cc('0x24')](function(_0x5f0025){if(_0x5f0025){_0xd26f88=_0x5f0025['length'];if(!_0xb16b74[_0x32cc('0x2e')]['hasOwnProperty'](_0x32cc('0x35'))){_0x362948[_0x32cc('0x1d')]=qs['limit'](_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x1d')]);_0x362948[_0x32cc('0x1c')]=qs['offset'](_0xb16b74[_0x32cc('0x2e')][_0x32cc('0x1c')]);}return _0x5efa53[_0x32cc('0x4c')](_0x362948);}})[_0x32cc('0x24')](function(_0x2e90ba){if(_0x2e90ba){return _0x2e90ba?{'count':_0xd26f88,'rows':_0x2e90ba}:null;}})[_0x32cc('0x24')](respondWithResult(_0x15370a,null))['catch'](handleError(_0x15370a,null));};exports[_0x32cc('0x4e')]=function(_0x528804,_0x3c5cd0,_0x40af5d){var _0x45e466={};var _0x365070={};var _0x56f4b9;var _0x41ab36;return db[_0x32cc('0x2a')][_0x32cc('0x49')]({'where':{'id':_0x528804[_0x32cc('0x47')]['id']}})[_0x32cc('0x24')](handleEntityNotFound(_0x3c5cd0,null))[_0x32cc('0x24')](function(_0xb2c20b){if(_0xb2c20b){_0x56f4b9=_0xb2c20b;_0x365070[_0x32cc('0x2d')]=_[_0x32cc('0x2f')](db['FreshdeskField']['rawAttributes']);_0x365070['query']=_['keys'](_0x528804[_0x32cc('0x2e')]);_0x365070[_0x32cc('0x30')]=_[_0x32cc('0x31')](_0x365070[_0x32cc('0x2d')],_0x365070[_0x32cc('0x2e')]);_0x45e466[_0x32cc('0x33')]=_[_0x32cc('0x31')](_0x365070[_0x32cc('0x2d')],qs[_0x32cc('0x32')](_0x528804['query'][_0x32cc('0x32')]));_0x45e466[_0x32cc('0x33')]=_0x45e466[_0x32cc('0x33')][_0x32cc('0x4b')]?_0x45e466['attributes']:_0x365070[_0x32cc('0x2d')];_0x45e466['order']=qs['sort'](_0x528804[_0x32cc('0x2e')][_0x32cc('0x36')]);_0x45e466[_0x32cc('0x38')]=qs['filters'](_['pick'](_0x528804[_0x32cc('0x2e')],_0x365070[_0x32cc('0x30')]));if(_0x528804['query'][_0x32cc('0x3b')]){_0x45e466['where']=_[_0x32cc('0x39')](_0x45e466['where'],{'$or':_[_0x32cc('0x29')](_0x45e466['attributes'],function(_0x5f3530){var _0x284c00={};_0x284c00[_0x5f3530]={'$like':'%'+_0x528804[_0x32cc('0x2e')][_0x32cc('0x3b')]+'%'};return _0x284c00;})});}_0x45e466=_[_0x32cc('0x39')]({},_0x45e466,_0x528804[_0x32cc('0x3c')]);return _0x56f4b9[_0x32cc('0x4e')](_0x45e466);}})[_0x32cc('0x24')](function(_0x4f7818){if(_0x4f7818){_0x41ab36=_0x4f7818[_0x32cc('0x4b')];if(!_0x528804[_0x32cc('0x2e')][_0x32cc('0x34')](_0x32cc('0x35'))){_0x45e466[_0x32cc('0x1d')]=qs[_0x32cc('0x1d')](_0x528804[_0x32cc('0x2e')][_0x32cc('0x1d')]);_0x45e466[_0x32cc('0x1c')]=qs[_0x32cc('0x1c')](_0x528804[_0x32cc('0x2e')][_0x32cc('0x1c')]);}return _0x56f4b9[_0x32cc('0x4e')](_0x45e466);}})[_0x32cc('0x24')](function(_0x45e25c){if(_0x45e25c){return _0x45e25c?{'count':_0x41ab36,'rows':_0x45e25c}:null;}})[_0x32cc('0x24')](respondWithResult(_0x3c5cd0,null))['catch'](handleError(_0x3c5cd0,null));};exports['getTags']=function(_0x58c5dd,_0x351117,_0x1602ff){var _0x12d621={};var _0x15c1cb={};var _0x43dd80;var _0x269384;return db[_0x32cc('0x2a')][_0x32cc('0x49')]({'where':{'id':_0x58c5dd[_0x32cc('0x47')]['id']}})[_0x32cc('0x24')](handleEntityNotFound(_0x351117,null))[_0x32cc('0x24')](function(_0x1b6936){if(_0x1b6936){_0x43dd80=_0x1b6936;_0x15c1cb[_0x32cc('0x2d')]=_[_0x32cc('0x2f')](db[_0x32cc('0x4f')][_0x32cc('0x2b')]);_0x15c1cb[_0x32cc('0x2e')]=_[_0x32cc('0x2f')](_0x58c5dd[_0x32cc('0x2e')]);_0x15c1cb[_0x32cc('0x30')]=_[_0x32cc('0x31')](_0x15c1cb['model'],_0x15c1cb[_0x32cc('0x2e')]);_0x12d621[_0x32cc('0x33')]=_[_0x32cc('0x31')](_0x15c1cb['model'],qs['fields'](_0x58c5dd[_0x32cc('0x2e')][_0x32cc('0x32')]));_0x12d621['attributes']=_0x12d621[_0x32cc('0x33')][_0x32cc('0x4b')]?_0x12d621[_0x32cc('0x33')]:_0x15c1cb['model'];_0x12d621['order']=qs[_0x32cc('0x36')](_0x58c5dd[_0x32cc('0x2e')][_0x32cc('0x36')]);_0x12d621[_0x32cc('0x38')]=qs['filters'](_[_0x32cc('0x37')](_0x58c5dd['query'],_0x15c1cb[_0x32cc('0x30')]));if(_0x58c5dd['query'][_0x32cc('0x3b')]){_0x12d621[_0x32cc('0x38')]=_[_0x32cc('0x39')](_0x12d621[_0x32cc('0x38')],{'$or':_['map'](_0x12d621[_0x32cc('0x33')],function(_0x51f37b){var _0x2d9f9b={};_0x2d9f9b[_0x51f37b]={'$like':'%'+_0x58c5dd['query'][_0x32cc('0x3b')]+'%'};return _0x2d9f9b;})});}_0x12d621=_[_0x32cc('0x39')]({},_0x12d621,_0x58c5dd[_0x32cc('0x3c')]);return _0x43dd80[_0x32cc('0x50')](_0x12d621);}})[_0x32cc('0x24')](function(_0x5be8db){if(_0x5be8db){_0x269384=_0x5be8db[_0x32cc('0x4b')];if(!_0x58c5dd[_0x32cc('0x2e')][_0x32cc('0x34')](_0x32cc('0x35'))){_0x12d621['limit']=qs[_0x32cc('0x1d')](_0x58c5dd[_0x32cc('0x2e')][_0x32cc('0x1d')]);_0x12d621[_0x32cc('0x1c')]=qs[_0x32cc('0x1c')](_0x58c5dd[_0x32cc('0x2e')][_0x32cc('0x1c')]);}return _0x43dd80[_0x32cc('0x50')](_0x12d621);}})[_0x32cc('0x24')](function(_0x36cad6){if(_0x36cad6){return _0x36cad6?{'count':_0x269384,'rows':_0x36cad6}:null;}})[_0x32cc('0x24')](respondWithResult(_0x351117,null))[_0x32cc('0x42')](handleError(_0x351117,null));};exports[_0x32cc('0x51')]=function(_0x281069,_0x181cbe,_0x20cfff){if(_0x281069[_0x32cc('0x46')]['id']){delete _0x281069[_0x32cc('0x46')]['id'];}return db[_0x32cc('0x2a')][_0x32cc('0x49')]({'where':{'id':_0x281069[_0x32cc('0x47')]['id']}})[_0x32cc('0x24')](handleEntityNotFound(_0x181cbe,null))[_0x32cc('0x24')](function(_0x3ef37b){if(_0x3ef37b){return _0x3ef37b[_0x32cc('0x51')](_0x281069[_0x32cc('0x46')][_0x32cc('0x52')]||[]);}return null;})[_0x32cc('0x24')](respondWithResult(_0x181cbe,null))[_0x32cc('0x42')](handleError(_0x181cbe,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a70a39a..3771090 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 _0x81ff=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','lodash','util','../../config/logger','api'];(function(_0x1c82e2,_0x1c7db7){var _0x11fdc9=function(_0x44ce33){while(--_0x44ce33){_0x1c82e2['push'](_0x1c82e2['shift']());}};_0x11fdc9(++_0x1c7db7);}(_0x81ff,0x1e8));var _0xf81f=function(_0x39a0ec,_0x58e84b){_0x39a0ec=_0x39a0ec-0x0;var _0x46157b=_0x81ff[_0x39a0ec];return _0x46157b;};'use strict';var _=require(_0xf81f('0x0'));var util=require(_0xf81f('0x1'));var logger=require(_0xf81f('0x2'))(_0xf81f('0x3'));var moment=require(_0xf81f('0x4'));var BPromise=require(_0xf81f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf81f('0x6'));var rimraf=require(_0xf81f('0x7'));var config=require(_0xf81f('0x8'));var attributes=require(_0xf81f('0x9'));module[_0xf81f('0xa')]=function(_0x4a9bd0,_0x3a2b8c){return _0x4a9bd0['define'](_0xf81f('0xb'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedae=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x291fab,_0x40467e){var _0x2e8352=function(_0x1d3be2){while(--_0x1d3be2){_0x291fab['push'](_0x291fab['shift']());}};_0x2e8352(++_0x40467e);}(_0xedae,0x1a3));var _0xeeda=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xedae[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xeeda('0x0'));var util=require(_0xeeda('0x1'));var logger=require(_0xeeda('0x2'))(_0xeeda('0x3'));var moment=require(_0xeeda('0x4'));var BPromise=require(_0xeeda('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeda('0x6'));var rimraf=require('rimraf');var config=require(_0xeeda('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xeeda('0x8')]=function(_0x46c58a,_0x57053b){return _0x46c58a[_0xeeda('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0xeeda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index f33474f..fe4a0cf 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 _0x945d=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5af7c5,_0x23f1d6){var _0x500a58=function(_0x274e7c){while(--_0x274e7c){_0x5af7c5['push'](_0x5af7c5['shift']());}};_0x500a58(++_0x23f1d6);}(_0x945d,0x1cf));var _0xd945=function(_0x5692ec,_0x5154fe){_0x5692ec=_0x5692ec-0x0;var _0x1ea117=_0x945d[_0x5692ec];return _0x1ea117;};'use strict';var _=require(_0xd945('0x0'));var util=require(_0xd945('0x1'));var moment=require(_0xd945('0x2'));var BPromise=require('bluebird');var rs=require(_0xd945('0x3'));var fs=require('fs');var Redis=require(_0xd945('0x4'));var db=require(_0xd945('0x5'))['db'];var utils=require(_0xd945('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd945('0x7'));var client=jayson[_0xd945('0x8')][_0xd945('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38131a,_0x295de4,_0x50db6e){return new BPromise(function(_0x2d4da7,_0x49855b){return client[_0xd945('0xa')](_0x38131a,_0x50db6e)['then'](function(_0x2e55a4){logger[_0xd945('0xb')](_0xd945('0xc'),_0x295de4,_0xd945('0xd'));logger[_0xd945('0xe')](_0xd945('0xf'),_0x295de4,_0xd945('0xd'),JSON[_0xd945('0x10')](_0x2e55a4));if(_0x2e55a4[_0xd945('0x11')]){if(_0x2e55a4[_0xd945('0x11')][_0xd945('0x12')]===0x1f4){logger[_0xd945('0x11')](_0xd945('0xc'),_0x295de4,_0x2e55a4[_0xd945('0x11')][_0xd945('0x13')]);return _0x49855b(_0x2e55a4['error'][_0xd945('0x13')]);}logger[_0xd945('0x11')](_0xd945('0xc'),_0x295de4,_0x2e55a4[_0xd945('0x11')][_0xd945('0x13')]);return _0x2d4da7(_0x2e55a4[_0xd945('0x11')][_0xd945('0x13')]);}else{logger[_0xd945('0xb')](_0xd945('0xc'),_0x295de4,_0xd945('0xd'));_0x2d4da7(_0x2e55a4['result']['message']);}})[_0xd945('0x14')](function(_0x9534f8){logger[_0xd945('0x11')](_0xd945('0xc'),_0x295de4,_0x9534f8);_0x49855b(_0x9534f8);});});} \ No newline at end of file +var _0xc84f=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc84f,0xac));var _0xfc84=function(_0x301a2f,_0x1549eb){_0x301a2f=_0x301a2f-0x0;var _0x5f05ca=_0xc84f[_0x301a2f];return _0x5f05ca;};'use strict';var _=require(_0xfc84('0x0'));var util=require('util');var moment=require(_0xfc84('0x1'));var BPromise=require(_0xfc84('0x2'));var rs=require(_0xfc84('0x3'));var fs=require('fs');var Redis=require(_0xfc84('0x4'));var db=require(_0xfc84('0x5'))['db'];var utils=require(_0xfc84('0x6'));var logger=require('../../config/logger')(_0xfc84('0x7'));var config=require(_0xfc84('0x8'));var jayson=require(_0xfc84('0x9'));var client=jayson[_0xfc84('0xa')][_0xfc84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40b47b,_0x129c3d,_0x57a19a){return new BPromise(function(_0x1102ec,_0x1bf991){return client[_0xfc84('0xc')](_0x40b47b,_0x57a19a)['then'](function(_0x2f0bd1){logger[_0xfc84('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x129c3d,_0xfc84('0xe'));logger[_0xfc84('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x129c3d,_0xfc84('0xe'),JSON['stringify'](_0x2f0bd1));if(_0x2f0bd1[_0xfc84('0x10')]){if(_0x2f0bd1[_0xfc84('0x10')]['code']===0x1f4){logger['error'](_0xfc84('0x11'),_0x129c3d,_0x2f0bd1['error'][_0xfc84('0x12')]);return _0x1bf991(_0x2f0bd1[_0xfc84('0x10')][_0xfc84('0x12')]);}logger[_0xfc84('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x129c3d,_0x2f0bd1[_0xfc84('0x10')][_0xfc84('0x12')]);return _0x1102ec(_0x2f0bd1[_0xfc84('0x10')]['message']);}else{logger['info'](_0xfc84('0x11'),_0x129c3d,_0xfc84('0xe'));_0x1102ec(_0x2f0bd1['result'][_0xfc84('0x12')]);}})[_0xfc84('0x13')](function(_0x5ca013){logger[_0xfc84('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x129c3d,_0x5ca013);_0x1bf991(_0x5ca013);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3340f0a..d2bbe01 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 _0xc5bb=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','connect-timeout'];(function(_0x4f02d4,_0x1ed9bf){var _0x163b04=function(_0x52e36d){while(--_0x52e36d){_0x4f02d4['push'](_0x4f02d4['shift']());}};_0x163b04(++_0x1ed9bf);}(_0xc5bb,0x18e));var _0xbc5b=function(_0x145191,_0x3d888b){_0x145191=_0x145191-0x0;var _0x5661c3=_0xc5bb[_0x145191];return _0x5661c3;};'use strict';var multer=require(_0xbc5b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbc5b('0x1'));var express=require(_0xbc5b('0x2'));var router=express[_0xbc5b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbc5b('0x4'));var config=require(_0xbc5b('0x5'));var controller=require('./intFreshdeskField.controller');router[_0xbc5b('0x6')]('/',auth[_0xbc5b('0x7')](),controller[_0xbc5b('0x8')]);router[_0xbc5b('0x6')](_0xbc5b('0x9'),auth[_0xbc5b('0x7')](),controller[_0xbc5b('0xa')]);router[_0xbc5b('0xb')]('/',auth[_0xbc5b('0x7')](),controller['create']);router[_0xbc5b('0xc')](_0xbc5b('0x9'),auth[_0xbc5b('0x7')](),controller[_0xbc5b('0xd')]);router[_0xbc5b('0xe')](_0xbc5b('0x9'),auth[_0xbc5b('0x7')](),controller['destroy']);module[_0xbc5b('0xf')]=router; \ No newline at end of file +var _0xb233=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index'];(function(_0x1308ee,_0x4485d1){var _0x409568=function(_0x438f79){while(--_0x438f79){_0x1308ee['push'](_0x1308ee['shift']());}};_0x409568(++_0x4485d1);}(_0xb233,0x1ee));var _0x3b23=function(_0x49b632,_0x4157bc){_0x49b632=_0x49b632-0x0;var _0x481b93=_0xb233[_0x49b632];return _0x481b93;};'use strict';var multer=require(_0x3b23('0x0'));var util=require(_0x3b23('0x1'));var path=require('path');var timeout=require(_0x3b23('0x2'));var express=require(_0x3b23('0x3'));var router=express[_0x3b23('0x4')]();var fs_extra=require(_0x3b23('0x5'));var auth=require(_0x3b23('0x6'));var interaction=require(_0x3b23('0x7'));var config=require(_0x3b23('0x8'));var controller=require(_0x3b23('0x9'));router[_0x3b23('0xa')]('/',auth['isAuthenticated'](),controller[_0x3b23('0xb')]);router[_0x3b23('0xa')](_0x3b23('0xc'),auth[_0x3b23('0xd')](),controller[_0x3b23('0xe')]);router[_0x3b23('0xf')]('/',auth[_0x3b23('0xd')](),controller[_0x3b23('0x10')]);router[_0x3b23('0x11')](_0x3b23('0xc'),auth[_0x3b23('0xd')](),controller[_0x3b23('0x12')]);router[_0x3b23('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3b23('0x14')]);module[_0x3b23('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 921309a..7870f33 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 _0x5f21=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM'];(function(_0x4aafb9,_0x9c0c15){var _0x1bd998=function(_0x373a6f){while(--_0x373a6f){_0x4aafb9['push'](_0x4aafb9['shift']());}};_0x1bd998(++_0x9c0c15);}(_0x5f21,0x1de));var _0x15f2=function(_0x124128,_0x1934dd){_0x124128=_0x124128-0x0;var _0x25079e=_0x5f21[_0x124128];return _0x25079e;};'use strict';var Sequelize=require(_0x15f2('0x0'));module['exports']={'type':{'type':Sequelize[_0x15f2('0x1')](_0x15f2('0x2'),_0x15f2('0x3'),_0x15f2('0x4'),_0x15f2('0x5'),_0x15f2('0x6')),'defaultValue':_0x15f2('0x2')},'content':{'type':Sequelize[_0x15f2('0x7')]},'key':{'type':Sequelize[_0x15f2('0x7')]},'keyType':{'type':Sequelize[_0x15f2('0x1')](_0x15f2('0x2'),_0x15f2('0x3'),_0x15f2('0x4'))},'keyContent':{'type':Sequelize[_0x15f2('0x7')]},'idField':{'type':Sequelize[_0x15f2('0x7')]},'nameField':{'type':Sequelize[_0x15f2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15f2('0x7')]}}; \ No newline at end of file +var _0xe8d0=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x4ade89,_0x33f831){var _0x5edb02=function(_0x3c9f66){while(--_0x3c9f66){_0x4ade89['push'](_0x4ade89['shift']());}};_0x5edb02(++_0x33f831);}(_0xe8d0,0x19f));var _0x0e8d=function(_0x116bf5,_0x151ac5){_0x116bf5=_0x116bf5-0x0;var _0x3b21c0=_0xe8d0[_0x116bf5];return _0x3b21c0;};'use strict';var Sequelize=require(_0x0e8d('0x0'));module[_0x0e8d('0x1')]={'type':{'type':Sequelize[_0x0e8d('0x2')](_0x0e8d('0x3'),_0x0e8d('0x4'),_0x0e8d('0x5'),_0x0e8d('0x6'),_0x0e8d('0x7')),'defaultValue':_0x0e8d('0x3')},'content':{'type':Sequelize[_0x0e8d('0x8')]},'key':{'type':Sequelize[_0x0e8d('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x0e8d('0x3'),_0x0e8d('0x4'),_0x0e8d('0x5'))},'keyContent':{'type':Sequelize[_0x0e8d('0x8')]},'idField':{'type':Sequelize[_0x0e8d('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0e8d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0e8d('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 7b095c5..9f6b47e 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 _0xe13a=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','order','sort','where','pick','filters','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','show','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe13a,0x178));var _0xae13=function(_0x5f2838,_0x5de0ef){_0x5f2838=_0x5f2838-0x0;var _0x477570=_0xe13a[_0x5f2838];return _0x477570;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae13('0x0'));var zipdir=require(_0xae13('0x1'));var jsonpatch=require(_0xae13('0x2'));var rp=require(_0xae13('0x3'));var moment=require('moment');var BPromise=require(_0xae13('0x4'));var Mustache=require(_0xae13('0x5'));var util=require(_0xae13('0x6'));var path=require(_0xae13('0x7'));var sox=require(_0xae13('0x8'));var csv=require(_0xae13('0x9'));var ejs=require(_0xae13('0xa'));var fs=require('fs');var fs_extra=require(_0xae13('0xb'));var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0x9'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae13('0x15'));var logger=require(_0xae13('0x16'))(_0xae13('0x17'));var utils=require(_0xae13('0x18'));var config=require(_0xae13('0x19'));var licenseUtil=require(_0xae13('0x1a'));var db=require(_0xae13('0x1b'))['db'];function respondWithStatusCode(_0x4dd599,_0x42d869){_0x42d869=_0x42d869||0xcc;return function(_0x159632){if(_0x159632){return _0x4dd599['sendStatus'](_0x42d869);}return _0x4dd599['status'](_0x42d869)['end']();};}function respondWithResult(_0x50f7c4,_0x52484b){_0x52484b=_0x52484b||0xc8;return function(_0x26ff3e){if(_0x26ff3e){return _0x50f7c4[_0xae13('0x1c')](_0x52484b)[_0xae13('0x1d')](_0x26ff3e);}};}function respondWithFilteredResult(_0x90cdc1,_0x537889){return function(_0x2912a2){if(_0x2912a2){var _0x5c25a4=typeof _0x537889[_0xae13('0x1e')]==='undefined'&&typeof _0x537889[_0xae13('0x1f')]===_0xae13('0x20');var _0x207363=_0x2912a2[_0xae13('0x21')];var _0x1a9c07=_0x5c25a4?0x0:_0x537889[_0xae13('0x1e')];var _0x32dcbe=_0x5c25a4?_0x2912a2[_0xae13('0x21')]:_0x537889[_0xae13('0x1e')]+_0x537889['limit'];var _0x4462a5;if(_0x32dcbe>=_0x207363){_0x32dcbe=_0x207363;_0x4462a5=0xc8;}else{_0x4462a5=0xce;}_0x90cdc1['status'](_0x4462a5);return _0x90cdc1[_0xae13('0x22')](_0xae13('0x23'),_0x1a9c07+'-'+_0x32dcbe+'/'+_0x207363)['json'](_0x2912a2);}return null;};}function patchUpdates(_0x25a195){return function(_0x39d41c){try{jsonpatch[_0xae13('0x24')](_0x39d41c,_0x25a195,!![]);}catch(_0x240802){return BPromise[_0xae13('0x25')](_0x240802);}return _0x39d41c[_0xae13('0x26')]();};}function saveUpdates(_0x54b3b4,_0x520692){return function(_0x149eda){if(_0x149eda){return _0x149eda[_0xae13('0x27')](_0x54b3b4)['then'](function(_0x168b92){return _0x168b92;});}return null;};}function removeEntity(_0x519a37,_0x13c2de){return function(_0x194437){if(_0x194437){return _0x194437[_0xae13('0x28')]()['then'](function(){_0x519a37['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4edb8c,_0xc5e6a7){return function(_0x17ce58){if(!_0x17ce58){_0x4edb8c['sendStatus'](0x194);}return _0x17ce58;};}function handleError(_0x370874,_0x517e71){_0x517e71=_0x517e71||0x1f4;return function(_0x3d0d60){logger['error'](_0x3d0d60[_0xae13('0x29')]);if(_0x3d0d60[_0xae13('0x2a')]){delete _0x3d0d60['name'];}_0x370874[_0xae13('0x1c')](_0x517e71)[_0xae13('0x2b')](_0x3d0d60);};}exports[_0xae13('0x2c')]=function(_0x306dfb,_0x578e99){var _0x41ceb7={},_0x27b737={},_0x1d7152={'count':0x0,'rows':[]};var _0x68ce70=_[_0xae13('0x2d')](db[_0xae13('0x2e')][_0xae13('0x2f')],function(_0x5bd0ee){return{'name':_0x5bd0ee[_0xae13('0x30')],'type':_0x5bd0ee['type'][_0xae13('0x31')]};});_0x27b737[_0xae13('0x32')]=_[_0xae13('0x2d')](_0x68ce70,_0xae13('0x2a'));_0x27b737[_0xae13('0x33')]=_[_0xae13('0x34')](_0x306dfb[_0xae13('0x33')]);_0x27b737['filters']=_['intersection'](_0x27b737[_0xae13('0x32')],_0x27b737[_0xae13('0x33')]);_0x41ceb7[_0xae13('0x35')]=_[_0xae13('0x36')](_0x27b737[_0xae13('0x32')],qs[_0xae13('0x37')](_0x306dfb[_0xae13('0x33')][_0xae13('0x37')]));_0x41ceb7[_0xae13('0x35')]=_0x41ceb7[_0xae13('0x35')]['length']?_0x41ceb7[_0xae13('0x35')]:_0x27b737[_0xae13('0x32')];if(!_0x306dfb[_0xae13('0x33')]['hasOwnProperty']('nolimit')){_0x41ceb7['limit']=qs['limit'](_0x306dfb['query']['limit']);_0x41ceb7[_0xae13('0x1e')]=qs[_0xae13('0x1e')](_0x306dfb[_0xae13('0x33')]['offset']);}_0x41ceb7[_0xae13('0x38')]=qs[_0xae13('0x39')](_0x306dfb[_0xae13('0x33')][_0xae13('0x39')]);_0x41ceb7[_0xae13('0x3a')]=qs['filters'](_[_0xae13('0x3b')](_0x306dfb[_0xae13('0x33')],_0x27b737[_0xae13('0x3c')]),_0x68ce70);if(_0x306dfb['query']['filter']){_0x41ceb7[_0xae13('0x3a')]=_[_0xae13('0x3d')](_0x41ceb7[_0xae13('0x3a')],{'$or':_[_0xae13('0x2d')](_0x68ce70,function(_0x4a17bb){if(_0x4a17bb[_0xae13('0x3e')]!==_0xae13('0x3f')){var _0x538283={};_0x538283[_0x4a17bb[_0xae13('0x2a')]]={'$like':'%'+_0x306dfb[_0xae13('0x33')]['filter']+'%'};return _0x538283;}})});}_0x41ceb7=_[_0xae13('0x3d')]({},_0x41ceb7,_0x306dfb[_0xae13('0x40')]);var _0x3d3569={'where':_0x41ceb7[_0xae13('0x3a')]};return db['FreshdeskField'][_0xae13('0x21')](_0x3d3569)[_0xae13('0x41')](function(_0x166091){_0x1d7152[_0xae13('0x21')]=_0x166091;if(_0x306dfb['query'][_0xae13('0x42')]){_0x41ceb7[_0xae13('0x43')]=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x44')](_0x41ceb7);})['then'](function(_0x49428a){_0x1d7152[_0xae13('0x45')]=_0x49428a;return _0x1d7152;})[_0xae13('0x41')](respondWithFilteredResult(_0x578e99,_0x41ceb7))['catch'](handleError(_0x578e99,null));};exports[_0xae13('0x46')]=function(_0x4a3a43,_0x2b589f){var _0x230ba6={'raw':!![],'where':{'id':_0x4a3a43['params']['id']}},_0x3fca0a={};_0x3fca0a[_0xae13('0x32')]=_[_0xae13('0x34')](db[_0xae13('0x2e')][_0xae13('0x2f')]);_0x3fca0a['query']=_[_0xae13('0x34')](_0x4a3a43[_0xae13('0x33')]);_0x3fca0a[_0xae13('0x3c')]=_[_0xae13('0x36')](_0x3fca0a[_0xae13('0x32')],_0x3fca0a[_0xae13('0x33')]);_0x230ba6[_0xae13('0x35')]=_[_0xae13('0x36')](_0x3fca0a['model'],qs[_0xae13('0x37')](_0x4a3a43['query'][_0xae13('0x37')]));_0x230ba6[_0xae13('0x35')]=_0x230ba6[_0xae13('0x35')][_0xae13('0x47')]?_0x230ba6['attributes']:_0x3fca0a[_0xae13('0x32')];if(_0x4a3a43['query'][_0xae13('0x42')]){_0x230ba6[_0xae13('0x43')]=[{'all':!![]}];}_0x230ba6=_['merge']({},_0x230ba6,_0x4a3a43[_0xae13('0x40')]);return db[_0xae13('0x2e')][_0xae13('0x48')](_0x230ba6)[_0xae13('0x41')](handleEntityNotFound(_0x2b589f,null))[_0xae13('0x41')](respondWithResult(_0x2b589f,null))[_0xae13('0x49')](handleError(_0x2b589f,null));};exports['create']=function(_0x417ef2,_0x26dcbb){return db[_0xae13('0x2e')][_0xae13('0x4a')](_0x417ef2[_0xae13('0x4b')],{})['then'](respondWithResult(_0x26dcbb,0xc9))[_0xae13('0x49')](handleError(_0x26dcbb,null));};exports[_0xae13('0x27')]=function(_0x8e6f1e,_0x551ed6){if(_0x8e6f1e['body']['id']){delete _0x8e6f1e['body']['id'];}return db['FreshdeskField'][_0xae13('0x48')]({'where':{'id':_0x8e6f1e['params']['id']}})[_0xae13('0x41')](handleEntityNotFound(_0x551ed6,null))['then'](saveUpdates(_0x8e6f1e[_0xae13('0x4b')],null))[_0xae13('0x41')](respondWithResult(_0x551ed6,null))[_0xae13('0x49')](handleError(_0x551ed6,null));};exports[_0xae13('0x28')]=function(_0x4509ea,_0x53d341){return db[_0xae13('0x2e')][_0xae13('0x48')]({'where':{'id':_0x4509ea['params']['id']}})[_0xae13('0x41')](handleEntityNotFound(_0x53d341,null))[_0xae13('0x41')](removeEntity(_0x53d341,null))['catch'](handleError(_0x53d341,null));}; \ No newline at end of file +var _0x8130=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','filters','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes'];(function(_0x2a84d6,_0x538497){var _0x55c2ea=function(_0x3f5d46){while(--_0x3f5d46){_0x2a84d6['push'](_0x2a84d6['shift']());}};_0x55c2ea(++_0x538497);}(_0x8130,0x146));var _0x0813=function(_0x465457,_0x4c5de6){_0x465457=_0x465457-0x0;var _0x3446a1=_0x8130[_0x465457];return _0x3446a1;};'use strict';var emlformat=require(_0x0813('0x0'));var rimraf=require(_0x0813('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0813('0x2'));var rp=require(_0x0813('0x3'));var moment=require(_0x0813('0x4'));var BPromise=require(_0x0813('0x5'));var Mustache=require(_0x0813('0x6'));var util=require(_0x0813('0x7'));var path=require('path');var sox=require(_0x0813('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0813('0x9'));var _=require(_0x0813('0xa'));var squel=require(_0x0813('0xb'));var crypto=require(_0x0813('0xc'));var jsforce=require(_0x0813('0xd'));var deskjs=require(_0x0813('0xe'));var toCsv=require(_0x0813('0xf'));var querystring=require('querystring');var Papa=require(_0x0813('0x10'));var Redis=require(_0x0813('0x11'));var authService=require(_0x0813('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0813('0x13'));var logger=require('../../config/logger')(_0x0813('0x14'));var utils=require('../../config/utils');var config=require(_0x0813('0x15'));var licenseUtil=require(_0x0813('0x16'));var db=require(_0x0813('0x17'))['db'];function respondWithStatusCode(_0x230ec7,_0x5b17f2){_0x5b17f2=_0x5b17f2||0xcc;return function(_0x4dcc3a){if(_0x4dcc3a){return _0x230ec7[_0x0813('0x18')](_0x5b17f2);}return _0x230ec7[_0x0813('0x19')](_0x5b17f2)['end']();};}function respondWithResult(_0x403e40,_0x4dae33){_0x4dae33=_0x4dae33||0xc8;return function(_0x58e56c){if(_0x58e56c){return _0x403e40[_0x0813('0x19')](_0x4dae33)[_0x0813('0x1a')](_0x58e56c);}};}function respondWithFilteredResult(_0x4ffaad,_0x2cf4f1){return function(_0x5793cb){if(_0x5793cb){var _0x29537f=typeof _0x2cf4f1[_0x0813('0x1b')]===_0x0813('0x1c')&&typeof _0x2cf4f1[_0x0813('0x1d')]===_0x0813('0x1c');var _0x10e29a=_0x5793cb[_0x0813('0x1e')];var _0x3e15da=_0x29537f?0x0:_0x2cf4f1['offset'];var _0x3ec7b5=_0x29537f?_0x5793cb['count']:_0x2cf4f1[_0x0813('0x1b')]+_0x2cf4f1[_0x0813('0x1d')];var _0x518923;if(_0x3ec7b5>=_0x10e29a){_0x3ec7b5=_0x10e29a;_0x518923=0xc8;}else{_0x518923=0xce;}_0x4ffaad[_0x0813('0x19')](_0x518923);return _0x4ffaad[_0x0813('0x1f')]('Content-Range',_0x3e15da+'-'+_0x3ec7b5+'/'+_0x10e29a)[_0x0813('0x1a')](_0x5793cb);}return null;};}function patchUpdates(_0x334741){return function(_0x4d7680){try{jsonpatch[_0x0813('0x20')](_0x4d7680,_0x334741,!![]);}catch(_0x3b3662){return BPromise[_0x0813('0x21')](_0x3b3662);}return _0x4d7680[_0x0813('0x22')]();};}function saveUpdates(_0xf6ee0c,_0x5a6cdc){return function(_0x2bb694){if(_0x2bb694){return _0x2bb694[_0x0813('0x23')](_0xf6ee0c)[_0x0813('0x24')](function(_0x598cf2){return _0x598cf2;});}return null;};}function removeEntity(_0x35b3d6,_0x5eabe4){return function(_0x56f4b6){if(_0x56f4b6){return _0x56f4b6[_0x0813('0x25')]()['then'](function(){_0x35b3d6['status'](0xcc)[_0x0813('0x26')]();});}};}function handleEntityNotFound(_0x2366a3,_0x1a8d2a){return function(_0x2f8849){if(!_0x2f8849){_0x2366a3[_0x0813('0x18')](0x194);}return _0x2f8849;};}function handleError(_0x1418c7,_0x42627c){_0x42627c=_0x42627c||0x1f4;return function(_0x3ac129){logger['error'](_0x3ac129[_0x0813('0x27')]);if(_0x3ac129[_0x0813('0x28')]){delete _0x3ac129[_0x0813('0x28')];}_0x1418c7[_0x0813('0x19')](_0x42627c)[_0x0813('0x29')](_0x3ac129);};}exports[_0x0813('0x2a')]=function(_0x55e115,_0xa36d86){var _0x48294b={},_0x54ed64={},_0x54bf5d={'count':0x0,'rows':[]};var _0x3c3321=_[_0x0813('0x2b')](db[_0x0813('0x2c')][_0x0813('0x2d')],function(_0x21f388){return{'name':_0x21f388[_0x0813('0x2e')],'type':_0x21f388['type'][_0x0813('0x2f')]};});_0x54ed64[_0x0813('0x30')]=_['map'](_0x3c3321,'name');_0x54ed64[_0x0813('0x31')]=_[_0x0813('0x32')](_0x55e115[_0x0813('0x31')]);_0x54ed64['filters']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],_0x54ed64['query']);_0x48294b['attributes']=_[_0x0813('0x33')](_0x54ed64[_0x0813('0x30')],qs[_0x0813('0x34')](_0x55e115[_0x0813('0x31')]['fields']));_0x48294b[_0x0813('0x35')]=_0x48294b[_0x0813('0x35')][_0x0813('0x36')]?_0x48294b[_0x0813('0x35')]:_0x54ed64['model'];if(!_0x55e115['query'][_0x0813('0x37')](_0x0813('0x38'))){_0x48294b[_0x0813('0x1d')]=qs['limit'](_0x55e115[_0x0813('0x31')][_0x0813('0x1d')]);_0x48294b[_0x0813('0x1b')]=qs['offset'](_0x55e115['query'][_0x0813('0x1b')]);}_0x48294b[_0x0813('0x39')]=qs[_0x0813('0x3a')](_0x55e115[_0x0813('0x31')][_0x0813('0x3a')]);_0x48294b[_0x0813('0x3b')]=qs['filters'](_[_0x0813('0x3c')](_0x55e115['query'],_0x54ed64['filters']),_0x3c3321);if(_0x55e115['query'][_0x0813('0x3d')]){_0x48294b[_0x0813('0x3b')]=_['merge'](_0x48294b['where'],{'$or':_[_0x0813('0x2b')](_0x3c3321,function(_0x36ce6d){if(_0x36ce6d[_0x0813('0x3e')]!==_0x0813('0x3f')){var _0x36f4d5={};_0x36f4d5[_0x36ce6d[_0x0813('0x28')]]={'$like':'%'+_0x55e115[_0x0813('0x31')][_0x0813('0x3d')]+'%'};return _0x36f4d5;}})});}_0x48294b=_[_0x0813('0x40')]({},_0x48294b,_0x55e115[_0x0813('0x41')]);var _0x54b271={'where':_0x48294b['where']};return db['FreshdeskField'][_0x0813('0x1e')](_0x54b271)[_0x0813('0x24')](function(_0x5cb01b){_0x54bf5d[_0x0813('0x1e')]=_0x5cb01b;if(_0x55e115[_0x0813('0x31')][_0x0813('0x42')]){_0x48294b['include']=[{'all':!![]}];}return db[_0x0813('0x2c')][_0x0813('0x43')](_0x48294b);})[_0x0813('0x24')](function(_0x4e94b0){_0x54bf5d[_0x0813('0x44')]=_0x4e94b0;return _0x54bf5d;})[_0x0813('0x24')](respondWithFilteredResult(_0xa36d86,_0x48294b))[_0x0813('0x45')](handleError(_0xa36d86,null));};exports['show']=function(_0x22564d,_0x38dc22){var _0x47da3b={'raw':!![],'where':{'id':_0x22564d[_0x0813('0x46')]['id']}},_0x171a5e={};_0x171a5e['model']=_[_0x0813('0x32')](db['FreshdeskField'][_0x0813('0x2d')]);_0x171a5e[_0x0813('0x31')]=_[_0x0813('0x32')](_0x22564d['query']);_0x171a5e[_0x0813('0x47')]=_['intersection'](_0x171a5e[_0x0813('0x30')],_0x171a5e[_0x0813('0x31')]);_0x47da3b[_0x0813('0x35')]=_[_0x0813('0x33')](_0x171a5e[_0x0813('0x30')],qs[_0x0813('0x34')](_0x22564d['query'][_0x0813('0x34')]));_0x47da3b['attributes']=_0x47da3b[_0x0813('0x35')]['length']?_0x47da3b['attributes']:_0x171a5e['model'];if(_0x22564d[_0x0813('0x31')][_0x0813('0x42')]){_0x47da3b[_0x0813('0x48')]=[{'all':!![]}];}_0x47da3b=_[_0x0813('0x40')]({},_0x47da3b,_0x22564d[_0x0813('0x41')]);return db[_0x0813('0x2c')]['find'](_0x47da3b)['then'](handleEntityNotFound(_0x38dc22,null))[_0x0813('0x24')](respondWithResult(_0x38dc22,null))[_0x0813('0x45')](handleError(_0x38dc22,null));};exports[_0x0813('0x49')]=function(_0x3fd5f9,_0xadaead){return db[_0x0813('0x2c')][_0x0813('0x49')](_0x3fd5f9[_0x0813('0x4a')],{})['then'](respondWithResult(_0xadaead,0xc9))[_0x0813('0x45')](handleError(_0xadaead,null));};exports[_0x0813('0x23')]=function(_0x42e4e4,_0x1baf77){if(_0x42e4e4[_0x0813('0x4a')]['id']){delete _0x42e4e4[_0x0813('0x4a')]['id'];}return db['FreshdeskField'][_0x0813('0x4b')]({'where':{'id':_0x42e4e4['params']['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x1baf77,null))[_0x0813('0x24')](saveUpdates(_0x42e4e4[_0x0813('0x4a')],null))[_0x0813('0x24')](respondWithResult(_0x1baf77,null))['catch'](handleError(_0x1baf77,null));};exports[_0x0813('0x25')]=function(_0x3a93eb,_0x353e25){return db[_0x0813('0x2c')]['find']({'where':{'id':_0x3a93eb[_0x0813('0x46')]['id']}})[_0x0813('0x24')](handleEntityNotFound(_0x353e25,null))['then'](removeEntity(_0x353e25,null))['catch'](handleError(_0x353e25,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 014b1c4..e57d99f 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 _0x2630=['../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0x2630,0x1b9));var _0x0263=function(_0x2e528d,_0x51971e){_0x2e528d=_0x2e528d-0x0;var _0x24ac34=_0x2630[_0x2e528d];return _0x24ac34;};'use strict';var _=require('lodash');var util=require(_0x0263('0x0'));var logger=require(_0x0263('0x1'))(_0x0263('0x2'));var moment=require(_0x0263('0x3'));var BPromise=require(_0x0263('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0263('0x5'));var rimraf=require(_0x0263('0x6'));var config=require(_0x0263('0x7'));var attributes=require(_0x0263('0x8'));module[_0x0263('0x9')]=function(_0x49bf12,_0x4310cc){return _0x49bf12['define'](_0x0263('0xa'),attributes,{'tableName':_0x0263('0xb'),'paranoid':![],'indexes':[{'name':_0x0263('0xc'),'fields':[_0x0263('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd4e=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1bf441,_0x49f64b){var _0x4d7eee=function(_0x5ef734){while(--_0x5ef734){_0x1bf441['push'](_0x1bf441['shift']());}};_0x4d7eee(++_0x49f64b);}(_0xfd4e,0x100));var _0xefd4=function(_0x6d1a44,_0x2fd7ca){_0x6d1a44=_0x6d1a44-0x0;var _0x48a9ab=_0xfd4e[_0x6d1a44];return _0x48a9ab;};'use strict';var _=require(_0xefd4('0x0'));var util=require('util');var logger=require(_0xefd4('0x1'))(_0xefd4('0x2'));var moment=require('moment');var BPromise=require(_0xefd4('0x3'));var rp=require(_0xefd4('0x4'));var fs=require('fs');var path=require(_0xefd4('0x5'));var rimraf=require(_0xefd4('0x6'));var config=require(_0xefd4('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xefd4('0x8')]=function(_0xe48af4,_0x4f16f3){return _0xe48af4[_0xefd4('0x9')]('FreshdeskField',attributes,{'tableName':_0xefd4('0xa'),'paranoid':![],'indexes':[{'name':_0xefd4('0xb'),'fields':[_0xefd4('0xc'),_0xefd4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 873f438..04b1f9f 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 _0x35cb=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash'];(function(_0x3f9093,_0x31c061){var _0x4873ac=function(_0x145568){while(--_0x145568){_0x3f9093['push'](_0x3f9093['shift']());}};_0x4873ac(++_0x31c061);}(_0x35cb,0x1b7));var _0xb35c=function(_0x5913d7,_0x3df32d){_0x5913d7=_0x5913d7-0x0;var _0xa64bd1=_0x35cb[_0x5913d7];return _0xa64bd1;};'use strict';var _=require(_0xb35c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb35c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb35c('0x2'));var db=require(_0xb35c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb35c('0x4'))(_0xb35c('0x5'));var config=require(_0xb35c('0x6'));var jayson=require(_0xb35c('0x7'));var client=jayson[_0xb35c('0x8')][_0xb35c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xea8dfa,_0x12fae7,_0x45e3b5){return new BPromise(function(_0x56702e,_0x3b472b){return client[_0xb35c('0xa')](_0xea8dfa,_0x45e3b5)[_0xb35c('0xb')](function(_0x2841c7){logger[_0xb35c('0xc')](_0xb35c('0xd'),_0x12fae7,'request\x20sent');logger[_0xb35c('0xe')](_0xb35c('0xf'),_0x12fae7,_0xb35c('0x10'),JSON[_0xb35c('0x11')](_0x2841c7));if(_0x2841c7['error']){if(_0x2841c7[_0xb35c('0x12')]['code']===0x1f4){logger[_0xb35c('0x12')](_0xb35c('0xd'),_0x12fae7,_0x2841c7[_0xb35c('0x12')][_0xb35c('0x13')]);return _0x3b472b(_0x2841c7[_0xb35c('0x12')]['message']);}logger['error'](_0xb35c('0xd'),_0x12fae7,_0x2841c7[_0xb35c('0x12')][_0xb35c('0x13')]);return _0x56702e(_0x2841c7[_0xb35c('0x12')]['message']);}else{logger['info'](_0xb35c('0xd'),_0x12fae7,_0xb35c('0x10'));_0x56702e(_0x2841c7['result'][_0xb35c('0x13')]);}})['catch'](function(_0x8ae891){logger[_0xb35c('0x12')](_0xb35c('0xd'),_0x12fae7,_0x8ae891);_0x3b472b(_0x8ae891);});});} \ No newline at end of file +var _0x3f39=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result'];(function(_0xdf7f26,_0x5c1fe1){var _0x523573=function(_0x153afc){while(--_0x153afc){_0xdf7f26['push'](_0xdf7f26['shift']());}};_0x523573(++_0x5c1fe1);}(_0x3f39,0x177));var _0x93f3=function(_0x9437ed,_0x1e58aa){_0x9437ed=_0x9437ed-0x0;var _0x2dd88c=_0x3f39[_0x9437ed];return _0x2dd88c;};'use strict';var _=require(_0x93f3('0x0'));var util=require(_0x93f3('0x1'));var moment=require(_0x93f3('0x2'));var BPromise=require('bluebird');var rs=require(_0x93f3('0x3'));var fs=require('fs');var Redis=require(_0x93f3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f3('0x5'));var logger=require(_0x93f3('0x6'))(_0x93f3('0x7'));var config=require(_0x93f3('0x8'));var jayson=require(_0x93f3('0x9'));var client=jayson[_0x93f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a24b7,_0x569032,_0x1fdf7c){return new BPromise(function(_0x469ede,_0x4c176a){return client['request'](_0x4a24b7,_0x1fdf7c)[_0x93f3('0xb')](function(_0x1f40de){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x569032,_0x93f3('0xc'));logger['debug'](_0x93f3('0xd'),_0x569032,_0x93f3('0xc'),JSON[_0x93f3('0xe')](_0x1f40de));if(_0x1f40de[_0x93f3('0xf')]){if(_0x1f40de['error'][_0x93f3('0x10')]===0x1f4){logger['error'](_0x93f3('0x11'),_0x569032,_0x1f40de['error'][_0x93f3('0x12')]);return _0x4c176a(_0x1f40de[_0x93f3('0xf')][_0x93f3('0x12')]);}logger[_0x93f3('0xf')](_0x93f3('0x11'),_0x569032,_0x1f40de['error'][_0x93f3('0x12')]);return _0x469ede(_0x1f40de[_0x93f3('0xf')][_0x93f3('0x12')]);}else{logger[_0x93f3('0x13')](_0x93f3('0x11'),_0x569032,_0x93f3('0xc'));_0x469ede(_0x1f40de[_0x93f3('0x14')]['message']);}})[_0x93f3('0x15')](function(_0xb0d6f){logger[_0x93f3('0xf')](_0x93f3('0x11'),_0x569032,_0xb0d6f);_0x4c176a(_0xb0d6f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1b88377..f91e7aa 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 _0xe205=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xe205,0xa7));var _0x5e20=function(_0x371232,_0x398d0e){_0x371232=_0x371232-0x0;var _0x2bfa7=_0xe205[_0x371232];return _0x2bfa7;};'use strict';var multer=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var path=require(_0x5e20('0x2'));var timeout=require(_0x5e20('0x3'));var express=require(_0x5e20('0x4'));var router=express[_0x5e20('0x5')]();var fs_extra=require(_0x5e20('0x6'));var auth=require(_0x5e20('0x7'));var interaction=require(_0x5e20('0x8'));var config=require('../../config/environment');var controller=require(_0x5e20('0x9'));router[_0x5e20('0xa')]('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0xc')]);router['get']('/:id',auth[_0x5e20('0xb')](),controller['show']);router['get'](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller['getConfigurations']);router[_0x5e20('0xa')](_0x5e20('0xe'),auth[_0x5e20('0xb')](),controller[_0x5e20('0xf')]);router['post']('/',auth[_0x5e20('0xb')](),controller[_0x5e20('0x10')]);router[_0x5e20('0x11')](_0x5e20('0xd'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x12')]);router['put'](_0x5e20('0x13'),auth[_0x5e20('0xb')](),controller[_0x5e20('0x14')]);router['delete'](_0x5e20('0x13'),auth['isAuthenticated'](),controller[_0x5e20('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['addConfiguration','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x37d0bc,_0x109b96){var _0x170e60=function(_0xae2ad){while(--_0xae2ad){_0x37d0bc['push'](_0x37d0bc['shift']());}};_0x170e60(++_0x109b96);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0xcb91[_0x3a78a0];return _0x48e917;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller['destroy']);module[_0x1cb9('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 72c4d7f..9747831 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 _0xed3c=['STRING','username','sequelize','exports'];(function(_0x1d4c02,_0x527f59){var _0x10d034=function(_0xb3c381){while(--_0xb3c381){_0x1d4c02['push'](_0x1d4c02['shift']());}};_0x10d034(++_0x527f59);}(_0xed3c,0x1a6));var _0xced3=function(_0x1c9093,_0x31eb87){_0x1c9093=_0x1c9093-0x0;var _0x32dd36=_0xed3c[_0x1c9093];return _0x32dd36;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'name':{'type':Sequelize[_0xced3('0x2')]},'description':{'type':Sequelize[_0xced3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xced3('0x3')},'apiKey':{'type':Sequelize[_0xced3('0x2')]},'remoteUri':{'type':Sequelize[_0xced3('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0xb016,0x159));var _0x6b01=function(_0x220e55,_0x4dbbd4){_0x220e55=_0x220e55-0x0;var _0x5ca879=_0xb016[_0x220e55];return _0x5ca879;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('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 06720c2..602c438 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 _0xd5cb=['email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','destroy','getConfigurations','findOne','FreshsalesConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getFields','apiKey','username','remoteUri','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users'];(function(_0x36f8bc,_0x46fd0e){var _0x57aad1=function(_0x1ad085){while(--_0x1ad085){_0x36f8bc['push'](_0x36f8bc['shift']());}};_0x57aad1(++_0x46fd0e);}(_0xd5cb,0xe7));var _0xbd5c=function(_0x2bf961,_0x201073){_0x2bf961=_0x2bf961-0x0;var _0xc77320=_0xd5cb[_0x2bf961];return _0xc77320;};'use strict';var emlformat=require(_0xbd5c('0x0'));var rimraf=require(_0xbd5c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd5c('0x2'));var rp=require(_0xbd5c('0x3'));var moment=require(_0xbd5c('0x4'));var BPromise=require(_0xbd5c('0x5'));var Mustache=require(_0xbd5c('0x6'));var util=require(_0xbd5c('0x7'));var path=require(_0xbd5c('0x8'));var sox=require(_0xbd5c('0x9'));var csv=require(_0xbd5c('0xa'));var ejs=require(_0xbd5c('0xb'));var fs=require('fs');var fs_extra=require(_0xbd5c('0xc'));var _=require(_0xbd5c('0xd'));var squel=require(_0xbd5c('0xe'));var crypto=require(_0xbd5c('0xf'));var jsforce=require(_0xbd5c('0x10'));var deskjs=require(_0xbd5c('0x11'));var toCsv=require(_0xbd5c('0xa'));var querystring=require(_0xbd5c('0x12'));var Papa=require(_0xbd5c('0x13'));var Redis=require(_0xbd5c('0x14'));var authService=require(_0xbd5c('0x15'));var qs=require(_0xbd5c('0x16'));var as=require(_0xbd5c('0x17'));var hardwareService=require(_0xbd5c('0x18'));var logger=require(_0xbd5c('0x19'))(_0xbd5c('0x1a'));var utils=require(_0xbd5c('0x1b'));var config=require(_0xbd5c('0x1c'));var licenseUtil=require(_0xbd5c('0x1d'));var db=require(_0xbd5c('0x1e'))['db'];var integrations=require(_0xbd5c('0x1f'));function respondWithStatusCode(_0x49501a,_0x4d87b8){_0x4d87b8=_0x4d87b8||0xcc;return function(_0x1bf227){if(_0x1bf227){return _0x49501a[_0xbd5c('0x20')](_0x4d87b8);}return _0x49501a['status'](_0x4d87b8)['end']();};}function respondWithResult(_0x3d4d5b,_0x55ac7b){_0x55ac7b=_0x55ac7b||0xc8;return function(_0x4e770d){if(_0x4e770d){return _0x3d4d5b['status'](_0x55ac7b)['json'](_0x4e770d);}};}function respondWithFilteredResult(_0x31e9b3,_0x44dbde){return function(_0x45b59d){if(_0x45b59d){var _0x1d4789=typeof _0x44dbde[_0xbd5c('0x21')]===_0xbd5c('0x22')&&typeof _0x44dbde[_0xbd5c('0x23')]===_0xbd5c('0x22');var _0x2a1ea5=_0x45b59d[_0xbd5c('0x24')];var _0x501e55=_0x1d4789?0x0:_0x44dbde[_0xbd5c('0x21')];var _0xee4256=_0x1d4789?_0x45b59d[_0xbd5c('0x24')]:_0x44dbde[_0xbd5c('0x21')]+_0x44dbde[_0xbd5c('0x23')];var _0x3733cd;if(_0xee4256>=_0x2a1ea5){_0xee4256=_0x2a1ea5;_0x3733cd=0xc8;}else{_0x3733cd=0xce;}_0x31e9b3[_0xbd5c('0x25')](_0x3733cd);return _0x31e9b3[_0xbd5c('0x26')](_0xbd5c('0x27'),_0x501e55+'-'+_0xee4256+'/'+_0x2a1ea5)[_0xbd5c('0x28')](_0x45b59d);}return null;};}function patchUpdates(_0x5a7965){return function(_0x3f378f){try{jsonpatch[_0xbd5c('0x29')](_0x3f378f,_0x5a7965,!![]);}catch(_0x48aa69){return BPromise[_0xbd5c('0x2a')](_0x48aa69);}return _0x3f378f[_0xbd5c('0x2b')]();};}function saveUpdates(_0x11a255,_0x5e7f8b){return function(_0x2bf445){if(_0x2bf445){return _0x2bf445[_0xbd5c('0x2c')](_0x11a255)[_0xbd5c('0x2d')](function(_0x47f1b5){return _0x47f1b5;});}return null;};}function removeEntity(_0x2cba1e,_0x538884){return function(_0x1d09f9){if(_0x1d09f9){return _0x1d09f9['destroy']()[_0xbd5c('0x2d')](function(){_0x2cba1e[_0xbd5c('0x25')](0xcc)[_0xbd5c('0x2e')]();});}};}function handleEntityNotFound(_0x1ed0d4,_0x455456){return function(_0x9c46d5){if(!_0x9c46d5){_0x1ed0d4['sendStatus'](0x194);}return _0x9c46d5;};}function handleError(_0x4a9a4c,_0x373250){_0x373250=_0x373250||0x1f4;return function(_0x3181ed){logger[_0xbd5c('0x2f')](_0x3181ed[_0xbd5c('0x30')]);if(_0x3181ed[_0xbd5c('0x31')]){delete _0x3181ed['name'];}_0x4a9a4c[_0xbd5c('0x25')](_0x373250)['send'](_0x3181ed);};}exports[_0xbd5c('0x32')]=function(_0x19bc79,_0xfbc643){var _0x4672ee={},_0x230f59={},_0x52afce={'count':0x0,'rows':[]};var _0x518e1=_[_0xbd5c('0x33')](db[_0xbd5c('0x34')][_0xbd5c('0x35')],function(_0x307344){return{'name':_0x307344[_0xbd5c('0x36')],'type':_0x307344[_0xbd5c('0x37')][_0xbd5c('0x38')]};});_0x230f59[_0xbd5c('0x39')]=_['map'](_0x518e1,_0xbd5c('0x31'));_0x230f59[_0xbd5c('0x3a')]=_[_0xbd5c('0x3b')](_0x19bc79['query']);_0x230f59['filters']=_[_0xbd5c('0x3c')](_0x230f59['model'],_0x230f59[_0xbd5c('0x3a')]);_0x4672ee[_0xbd5c('0x3d')]=_[_0xbd5c('0x3c')](_0x230f59[_0xbd5c('0x39')],qs['fields'](_0x19bc79[_0xbd5c('0x3a')][_0xbd5c('0x3e')]));_0x4672ee['attributes']=_0x4672ee[_0xbd5c('0x3d')]['length']?_0x4672ee[_0xbd5c('0x3d')]:_0x230f59[_0xbd5c('0x39')];if(!_0x19bc79['query'][_0xbd5c('0x3f')](_0xbd5c('0x40'))){_0x4672ee['limit']=qs['limit'](_0x19bc79['query'][_0xbd5c('0x23')]);_0x4672ee[_0xbd5c('0x21')]=qs[_0xbd5c('0x21')](_0x19bc79['query'][_0xbd5c('0x21')]);}_0x4672ee['order']=qs[_0xbd5c('0x41')](_0x19bc79[_0xbd5c('0x3a')][_0xbd5c('0x41')]);_0x4672ee[_0xbd5c('0x42')]=qs[_0xbd5c('0x43')](_[_0xbd5c('0x44')](_0x19bc79['query'],_0x230f59[_0xbd5c('0x43')]),_0x518e1);if(_0x19bc79['query']['filter']){_0x4672ee[_0xbd5c('0x42')]=_[_0xbd5c('0x45')](_0x4672ee[_0xbd5c('0x42')],{'$or':_[_0xbd5c('0x33')](_0x518e1,function(_0x55116c){if(_0x55116c['type']!==_0xbd5c('0x46')){var _0x336b43={};_0x336b43[_0x55116c[_0xbd5c('0x31')]]={'$like':'%'+_0x19bc79['query']['filter']+'%'};return _0x336b43;}})});}_0x4672ee=_[_0xbd5c('0x45')]({},_0x4672ee,_0x19bc79[_0xbd5c('0x47')]);var _0x2c1210={'where':_0x4672ee[_0xbd5c('0x42')]};return db['FreshsalesAccount'][_0xbd5c('0x24')](_0x2c1210)[_0xbd5c('0x2d')](function(_0x26f1c1){_0x52afce[_0xbd5c('0x24')]=_0x26f1c1;if(_0x19bc79['query']['includeAll']){_0x4672ee[_0xbd5c('0x48')]=[{'all':!![]}];}return db[_0xbd5c('0x34')][_0xbd5c('0x49')](_0x4672ee);})[_0xbd5c('0x2d')](function(_0x450ca4){_0x52afce[_0xbd5c('0x4a')]=_0x450ca4;return _0x52afce;})[_0xbd5c('0x2d')](respondWithFilteredResult(_0xfbc643,_0x4672ee))['catch'](handleError(_0xfbc643,null));};exports[_0xbd5c('0x4b')]=function(_0x43bbeb,_0x1528a7){var _0x591bd3={'raw':![],'where':{'id':_0x43bbeb['params']['id']}},_0x50e29e={};_0x50e29e['model']=_[_0xbd5c('0x3b')](db[_0xbd5c('0x34')][_0xbd5c('0x35')]);_0x50e29e[_0xbd5c('0x3a')]=_[_0xbd5c('0x3b')](_0x43bbeb[_0xbd5c('0x3a')]);_0x50e29e[_0xbd5c('0x43')]=_[_0xbd5c('0x3c')](_0x50e29e['model'],_0x50e29e[_0xbd5c('0x3a')]);_0x591bd3[_0xbd5c('0x3d')]=_[_0xbd5c('0x3c')](_0x50e29e['model'],qs[_0xbd5c('0x3e')](_0x43bbeb[_0xbd5c('0x3a')][_0xbd5c('0x3e')]));_0x591bd3[_0xbd5c('0x3d')]=_0x591bd3[_0xbd5c('0x3d')][_0xbd5c('0x4c')]?_0x591bd3[_0xbd5c('0x3d')]:_0x50e29e[_0xbd5c('0x39')];if(_0x43bbeb[_0xbd5c('0x3a')][_0xbd5c('0x4d')]){_0x591bd3['include']=[{'all':!![]}];}_0x591bd3=_[_0xbd5c('0x45')]({},_0x591bd3,_0x43bbeb[_0xbd5c('0x47')]);return db[_0xbd5c('0x34')][_0xbd5c('0x4e')](_0x591bd3)['then'](handleEntityNotFound(_0x1528a7,null))['then'](respondWithResult(_0x1528a7,null))[_0xbd5c('0x4f')](handleError(_0x1528a7,null));};exports[_0xbd5c('0x50')]=function(_0x1e893c,_0x4e4911){return db['FreshsalesAccount'][_0xbd5c('0x50')](_0x1e893c[_0xbd5c('0x51')],{})[_0xbd5c('0x2d')](respondWithResult(_0x4e4911,0xc9))[_0xbd5c('0x4f')](handleError(_0x4e4911,null));};exports[_0xbd5c('0x2c')]=function(_0x2f378c,_0x4b245f){if(_0x2f378c[_0xbd5c('0x51')]['id']){delete _0x2f378c[_0xbd5c('0x51')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x2f378c[_0xbd5c('0x52')]['id']}})[_0xbd5c('0x2d')](handleEntityNotFound(_0x4b245f,null))[_0xbd5c('0x2d')](saveUpdates(_0x2f378c[_0xbd5c('0x51')],null))[_0xbd5c('0x2d')](respondWithResult(_0x4b245f,null))['catch'](handleError(_0x4b245f,null));};exports[_0xbd5c('0x53')]=function(_0x5158cf,_0x306aae){return db[_0xbd5c('0x34')][_0xbd5c('0x4e')]({'where':{'id':_0x5158cf[_0xbd5c('0x52')]['id']}})['then'](handleEntityNotFound(_0x306aae,null))[_0xbd5c('0x2d')](removeEntity(_0x306aae,null))[_0xbd5c('0x4f')](handleError(_0x306aae,null));};exports[_0xbd5c('0x54')]=function(_0x590333,_0x4768d5,_0x3f391a){var _0x23058c={};var _0x4a8d3a={};var _0x1137b4;var _0x31986c;return db[_0xbd5c('0x34')][_0xbd5c('0x55')]({'where':{'id':_0x590333[_0xbd5c('0x52')]['id']}})[_0xbd5c('0x2d')](handleEntityNotFound(_0x4768d5,null))[_0xbd5c('0x2d')](function(_0x5b30c2){if(_0x5b30c2){_0x1137b4=_0x5b30c2;_0x4a8d3a[_0xbd5c('0x39')]=_[_0xbd5c('0x3b')](db[_0xbd5c('0x56')][_0xbd5c('0x35')]);_0x4a8d3a[_0xbd5c('0x3a')]=_[_0xbd5c('0x3b')](_0x590333[_0xbd5c('0x3a')]);_0x4a8d3a[_0xbd5c('0x43')]=_[_0xbd5c('0x3c')](_0x4a8d3a[_0xbd5c('0x39')],_0x4a8d3a[_0xbd5c('0x3a')]);_0x23058c[_0xbd5c('0x3d')]=_['intersection'](_0x4a8d3a[_0xbd5c('0x39')],qs[_0xbd5c('0x3e')](_0x590333['query'][_0xbd5c('0x3e')]));_0x23058c[_0xbd5c('0x3d')]=_0x23058c['attributes']['length']?_0x23058c[_0xbd5c('0x3d')]:_0x4a8d3a[_0xbd5c('0x39')];_0x23058c['order']=qs[_0xbd5c('0x41')](_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x41')]);_0x23058c['where']=qs['filters'](_[_0xbd5c('0x44')](_0x590333[_0xbd5c('0x3a')],_0x4a8d3a[_0xbd5c('0x43')]));if(_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x57')]){_0x23058c['where']=_['merge'](_0x23058c[_0xbd5c('0x42')],{'$or':_['map'](_0x23058c[_0xbd5c('0x3d')],function(_0x2f4341){var _0x4d33ba={};_0x4d33ba[_0x2f4341]={'$like':'%'+_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x57')]+'%'};return _0x4d33ba;})});}_0x23058c=_['merge']({},_0x23058c,_0x590333[_0xbd5c('0x47')]);return _0x1137b4[_0xbd5c('0x54')](_0x23058c);}})[_0xbd5c('0x2d')](function(_0x228712){if(_0x228712){_0x31986c=_0x228712[_0xbd5c('0x4c')];if(!_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x3f')](_0xbd5c('0x40'))){_0x23058c['limit']=qs['limit'](_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x23')]);_0x23058c[_0xbd5c('0x21')]=qs[_0xbd5c('0x21')](_0x590333[_0xbd5c('0x3a')][_0xbd5c('0x21')]);}return _0x1137b4[_0xbd5c('0x54')](_0x23058c);}})[_0xbd5c('0x2d')](function(_0x291c86){if(_0x291c86){return _0x291c86?{'count':_0x31986c,'rows':_0x291c86}:null;}})[_0xbd5c('0x2d')](respondWithResult(_0x4768d5,null))[_0xbd5c('0x4f')](handleError(_0x4768d5,null));};exports[_0xbd5c('0x58')]=function(_0x34dc56,_0x3a8815,_0x3f58cd){if(_0x34dc56[_0xbd5c('0x51')]['id']){delete _0x34dc56[_0xbd5c('0x51')]['id'];}return db[_0xbd5c('0x34')][_0xbd5c('0x55')]({'where':{'id':_0x34dc56['params']['id']}})['then'](handleEntityNotFound(_0x3a8815,null))[_0xbd5c('0x2d')](function(_0xd80fbe){if(_0xd80fbe){_0x34dc56['body'][_0xbd5c('0x59')]=_0xd80fbe['id'];_0x34dc56[_0xbd5c('0x51')][_0xbd5c('0x5a')]=integrations[_0xbd5c('0x5b')](_0x34dc56[_0xbd5c('0x51')][_0xbd5c('0x5c')],_0x34dc56[_0xbd5c('0x51')][_0xbd5c('0x37')]);_0x34dc56['body']['Descriptions']=integrations['getDescriptions'](_0x34dc56['body']['channel'],_0x34dc56[_0xbd5c('0x51')][_0xbd5c('0x37')]);return db[_0xbd5c('0x56')]['create'](_0x34dc56['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xbd5c('0x5a')},{'model':db['FreshsalesField'],'as':_0xbd5c('0x5d')}]});}return null;})[_0xbd5c('0x2d')](respondWithResult(_0x3a8815,null))[_0xbd5c('0x4f')](handleError(_0x3a8815,null));};exports[_0xbd5c('0x5e')]=function(_0x3ba6a6,_0xb230e7,_0xd08fda){var _0x52d057='';var _0x3606a5='';return db[_0xbd5c('0x34')][_0xbd5c('0x55')]({'where':{'id':_0x3ba6a6[_0xbd5c('0x52')]['id']},'attributes':['id','username','remoteUri',_0xbd5c('0x5f')]})[_0xbd5c('0x2d')](handleEntityNotFound(_0xb230e7,null))[_0xbd5c('0x2d')](function(_0x523c53){if(_0x523c53){_0x3606a5=_0x523c53[_0xbd5c('0x60')];_0x52d057=_0x523c53[_0xbd5c('0x61')];var _0x477889=_0x523c53[_0xbd5c('0x61')]['slice'](-0x1);if(_0x477889==='/'){_0x52d057=_0x52d057[_0xbd5c('0x62')](0x0,_0x52d057[_0xbd5c('0x63')](_0x477889));}return rp({'method':'GET','uri':util[_0xbd5c('0x64')](_0xbd5c('0x65'),_0x52d057,_0xbd5c('0x66')),'headers':{'Authorization':_0xbd5c('0x67')+_0x523c53[_0xbd5c('0x5f')]},'json':!![]});}})[_0xbd5c('0x2d')](function(_0x1cadb5){if(_0x1cadb5){var _0x29898a=_0x1cadb5[_0xbd5c('0x68')];var _0x4454fd=![];var _0x295a79=null;for(_0x295a79=0x0;_0x295a79<_0x29898a['length'];_0x295a79++){if(_0x29898a[_0x295a79][_0xbd5c('0x69')]===_0x3606a5){_0x4454fd=!![];}}if(_0x4454fd){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xbd5c('0x6a')});}}})['then'](respondWithResult(_0xb230e7,null))[_0xbd5c('0x4f')](function(_0x5dde0b){var _0x5f0b2e=_0x3ba6a6[_0xbd5c('0x3a')]['test']?0x1f4:_0x5dde0b[_0xbd5c('0x6b')]||0x1f4;logger[_0xbd5c('0x2f')](_0xbd5c('0x6c'),_0xbd5c('0x5e'),_0x5f0b2e,JSON['stringify'](_0x5dde0b));delete _0x5dde0b[_0xbd5c('0x31')];if(_0x5f0b2e===0x191){_0x5f0b2e=0x190;}_0xb230e7['status'](_0x5f0b2e)[_0xbd5c('0x6d')](_0x3ba6a6[_0xbd5c('0x3a')][_0xbd5c('0x6e')]?{'message':_0xbd5c('0x6f'),'statusCode':_0x5dde0b[_0xbd5c('0x6b')]}:_0x5dde0b);});}; \ No newline at end of file +var _0xb37c=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','FreshsalesAccount','findAll','rows','catch','show','params','includeAll','include','body','destroy','find','getConfigurations','findOne','FreshsalesConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','create','FreshsalesField','getFields','username','apiKey','remoteUri','slice','GET','format','%s%s','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x259082,_0x480570){var _0x1359bd=function(_0x46d7ee){while(--_0x46d7ee){_0x259082['push'](_0x259082['shift']());}};_0x1359bd(++_0x480570);}(_0xb37c,0x178));var _0xcb37=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb37c[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb37('0x0'));var zipdir=require(_0xcb37('0x1'));var jsonpatch=require(_0xcb37('0x2'));var rp=require(_0xcb37('0x3'));var moment=require('moment');var BPromise=require(_0xcb37('0x4'));var Mustache=require(_0xcb37('0x5'));var util=require(_0xcb37('0x6'));var path=require(_0xcb37('0x7'));var sox=require(_0xcb37('0x8'));var csv=require(_0xcb37('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb37('0xa'));var _=require('lodash');var squel=require(_0xcb37('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb37('0xc'));var deskjs=require(_0xcb37('0xd'));var toCsv=require(_0xcb37('0x9'));var querystring=require(_0xcb37('0xe'));var Papa=require('papaparse');var Redis=require(_0xcb37('0xf'));var authService=require(_0xcb37('0x10'));var qs=require(_0xcb37('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb37('0x12'));var logger=require(_0xcb37('0x13'))(_0xcb37('0x14'));var utils=require('../../config/utils');var config=require(_0xcb37('0x15'));var licenseUtil=require(_0xcb37('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcb37('0x17'));function respondWithStatusCode(_0x18760e,_0x526faa){_0x526faa=_0x526faa||0xcc;return function(_0x33469b){if(_0x33469b){return _0x18760e[_0xcb37('0x18')](_0x526faa);}return _0x18760e[_0xcb37('0x19')](_0x526faa)[_0xcb37('0x1a')]();};}function respondWithResult(_0x241255,_0xe3b142){_0xe3b142=_0xe3b142||0xc8;return function(_0xd715d7){if(_0xd715d7){return _0x241255[_0xcb37('0x19')](_0xe3b142)[_0xcb37('0x1b')](_0xd715d7);}};}function respondWithFilteredResult(_0x592df4,_0x1725e5){return function(_0x5abe96){if(_0x5abe96){var _0x1ed9f2=typeof _0x1725e5[_0xcb37('0x1c')]==='undefined'&&typeof _0x1725e5[_0xcb37('0x1d')]===_0xcb37('0x1e');var _0x6a2e64=_0x5abe96['count'];var _0x4d3d55=_0x1ed9f2?0x0:_0x1725e5[_0xcb37('0x1c')];var _0xe74f89=_0x1ed9f2?_0x5abe96[_0xcb37('0x1f')]:_0x1725e5['offset']+_0x1725e5[_0xcb37('0x1d')];var _0x329a61;if(_0xe74f89>=_0x6a2e64){_0xe74f89=_0x6a2e64;_0x329a61=0xc8;}else{_0x329a61=0xce;}_0x592df4[_0xcb37('0x19')](_0x329a61);return _0x592df4[_0xcb37('0x20')]('Content-Range',_0x4d3d55+'-'+_0xe74f89+'/'+_0x6a2e64)[_0xcb37('0x1b')](_0x5abe96);}return null;};}function patchUpdates(_0x1b6af8){return function(_0x6db7b){try{jsonpatch[_0xcb37('0x21')](_0x6db7b,_0x1b6af8,!![]);}catch(_0x46e1fb){return BPromise[_0xcb37('0x22')](_0x46e1fb);}return _0x6db7b['save']();};}function saveUpdates(_0x2a52a6,_0xf8217a){return function(_0x36a5f7){if(_0x36a5f7){return _0x36a5f7[_0xcb37('0x23')](_0x2a52a6)[_0xcb37('0x24')](function(_0x403611){return _0x403611;});}return null;};}function removeEntity(_0x4adc41,_0xa53eed){return function(_0x26f19e){if(_0x26f19e){return _0x26f19e['destroy']()[_0xcb37('0x24')](function(){_0x4adc41['status'](0xcc)[_0xcb37('0x1a')]();});}};}function handleEntityNotFound(_0x75fc1,_0x3e58dd){return function(_0x4883ed){if(!_0x4883ed){_0x75fc1[_0xcb37('0x18')](0x194);}return _0x4883ed;};}function handleError(_0x347b24,_0x2c38e5){_0x2c38e5=_0x2c38e5||0x1f4;return function(_0x496453){logger[_0xcb37('0x25')](_0x496453[_0xcb37('0x26')]);if(_0x496453[_0xcb37('0x27')]){delete _0x496453[_0xcb37('0x27')];}_0x347b24[_0xcb37('0x19')](_0x2c38e5)[_0xcb37('0x28')](_0x496453);};}exports['index']=function(_0x10ab59,_0x528349){var _0x323515={},_0x110a83={},_0x30c877={'count':0x0,'rows':[]};var _0x54fa04=_[_0xcb37('0x29')](db['FreshsalesAccount'][_0xcb37('0x2a')],function(_0x40c36a){return{'name':_0x40c36a[_0xcb37('0x2b')],'type':_0x40c36a[_0xcb37('0x2c')][_0xcb37('0x2d')]};});_0x110a83[_0xcb37('0x2e')]=_[_0xcb37('0x29')](_0x54fa04,_0xcb37('0x27'));_0x110a83[_0xcb37('0x2f')]=_[_0xcb37('0x30')](_0x10ab59[_0xcb37('0x2f')]);_0x110a83['filters']=_[_0xcb37('0x31')](_0x110a83['model'],_0x110a83['query']);_0x323515[_0xcb37('0x32')]=_['intersection'](_0x110a83[_0xcb37('0x2e')],qs['fields'](_0x10ab59[_0xcb37('0x2f')][_0xcb37('0x33')]));_0x323515[_0xcb37('0x32')]=_0x323515[_0xcb37('0x32')][_0xcb37('0x34')]?_0x323515[_0xcb37('0x32')]:_0x110a83[_0xcb37('0x2e')];if(!_0x10ab59[_0xcb37('0x2f')][_0xcb37('0x35')](_0xcb37('0x36'))){_0x323515[_0xcb37('0x1d')]=qs['limit'](_0x10ab59[_0xcb37('0x2f')]['limit']);_0x323515[_0xcb37('0x1c')]=qs[_0xcb37('0x1c')](_0x10ab59[_0xcb37('0x2f')][_0xcb37('0x1c')]);}_0x323515[_0xcb37('0x37')]=qs['sort'](_0x10ab59[_0xcb37('0x2f')][_0xcb37('0x38')]);_0x323515[_0xcb37('0x39')]=qs[_0xcb37('0x3a')](_[_0xcb37('0x3b')](_0x10ab59['query'],_0x110a83[_0xcb37('0x3a')]),_0x54fa04);if(_0x10ab59['query'][_0xcb37('0x3c')]){_0x323515['where']=_['merge'](_0x323515[_0xcb37('0x39')],{'$or':_[_0xcb37('0x29')](_0x54fa04,function(_0x28e3fd){if(_0x28e3fd['type']!=='VIRTUAL'){var _0x5241b0={};_0x5241b0[_0x28e3fd[_0xcb37('0x27')]]={'$like':'%'+_0x10ab59[_0xcb37('0x2f')][_0xcb37('0x3c')]+'%'};return _0x5241b0;}})});}_0x323515=_[_0xcb37('0x3d')]({},_0x323515,_0x10ab59[_0xcb37('0x3e')]);var _0x1dd6f9={'where':_0x323515[_0xcb37('0x39')]};return db[_0xcb37('0x3f')]['count'](_0x1dd6f9)['then'](function(_0x232d53){_0x30c877[_0xcb37('0x1f')]=_0x232d53;if(_0x10ab59[_0xcb37('0x2f')]['includeAll']){_0x323515['include']=[{'all':!![]}];}return db[_0xcb37('0x3f')][_0xcb37('0x40')](_0x323515);})[_0xcb37('0x24')](function(_0x5054e6){_0x30c877[_0xcb37('0x41')]=_0x5054e6;return _0x30c877;})[_0xcb37('0x24')](respondWithFilteredResult(_0x528349,_0x323515))[_0xcb37('0x42')](handleError(_0x528349,null));};exports[_0xcb37('0x43')]=function(_0x2a7eaa,_0x3125bf){var _0x2fa791={'raw':![],'where':{'id':_0x2a7eaa[_0xcb37('0x44')]['id']}},_0x3c23a8={};_0x3c23a8[_0xcb37('0x2e')]=_[_0xcb37('0x30')](db[_0xcb37('0x3f')][_0xcb37('0x2a')]);_0x3c23a8[_0xcb37('0x2f')]=_[_0xcb37('0x30')](_0x2a7eaa[_0xcb37('0x2f')]);_0x3c23a8[_0xcb37('0x3a')]=_[_0xcb37('0x31')](_0x3c23a8['model'],_0x3c23a8[_0xcb37('0x2f')]);_0x2fa791[_0xcb37('0x32')]=_[_0xcb37('0x31')](_0x3c23a8[_0xcb37('0x2e')],qs[_0xcb37('0x33')](_0x2a7eaa['query']['fields']));_0x2fa791['attributes']=_0x2fa791[_0xcb37('0x32')][_0xcb37('0x34')]?_0x2fa791[_0xcb37('0x32')]:_0x3c23a8[_0xcb37('0x2e')];if(_0x2a7eaa[_0xcb37('0x2f')][_0xcb37('0x45')]){_0x2fa791[_0xcb37('0x46')]=[{'all':!![]}];}_0x2fa791=_[_0xcb37('0x3d')]({},_0x2fa791,_0x2a7eaa[_0xcb37('0x3e')]);return db[_0xcb37('0x3f')]['find'](_0x2fa791)[_0xcb37('0x24')](handleEntityNotFound(_0x3125bf,null))[_0xcb37('0x24')](respondWithResult(_0x3125bf,null))[_0xcb37('0x42')](handleError(_0x3125bf,null));};exports['create']=function(_0x2df3fe,_0x760863){return db['FreshsalesAccount']['create'](_0x2df3fe[_0xcb37('0x47')],{})['then'](respondWithResult(_0x760863,0xc9))[_0xcb37('0x42')](handleError(_0x760863,null));};exports[_0xcb37('0x23')]=function(_0x4d2eaa,_0x2a3466){if(_0x4d2eaa['body']['id']){delete _0x4d2eaa['body']['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x4d2eaa[_0xcb37('0x44')]['id']}})[_0xcb37('0x24')](handleEntityNotFound(_0x2a3466,null))['then'](saveUpdates(_0x4d2eaa['body'],null))[_0xcb37('0x24')](respondWithResult(_0x2a3466,null))[_0xcb37('0x42')](handleError(_0x2a3466,null));};exports[_0xcb37('0x48')]=function(_0x560379,_0x2b2605){return db[_0xcb37('0x3f')][_0xcb37('0x49')]({'where':{'id':_0x560379[_0xcb37('0x44')]['id']}})[_0xcb37('0x24')](handleEntityNotFound(_0x2b2605,null))[_0xcb37('0x24')](removeEntity(_0x2b2605,null))['catch'](handleError(_0x2b2605,null));};exports[_0xcb37('0x4a')]=function(_0x53b64f,_0xb10775,_0x1b1621){var _0x47f5c8={};var _0x20ec93={};var _0x237539;var _0x49b365;return db['FreshsalesAccount'][_0xcb37('0x4b')]({'where':{'id':_0x53b64f[_0xcb37('0x44')]['id']}})[_0xcb37('0x24')](handleEntityNotFound(_0xb10775,null))['then'](function(_0x38b319){if(_0x38b319){_0x237539=_0x38b319;_0x20ec93[_0xcb37('0x2e')]=_[_0xcb37('0x30')](db[_0xcb37('0x4c')][_0xcb37('0x2a')]);_0x20ec93[_0xcb37('0x2f')]=_[_0xcb37('0x30')](_0x53b64f[_0xcb37('0x2f')]);_0x20ec93[_0xcb37('0x3a')]=_[_0xcb37('0x31')](_0x20ec93[_0xcb37('0x2e')],_0x20ec93[_0xcb37('0x2f')]);_0x47f5c8['attributes']=_[_0xcb37('0x31')](_0x20ec93[_0xcb37('0x2e')],qs[_0xcb37('0x33')](_0x53b64f[_0xcb37('0x2f')][_0xcb37('0x33')]));_0x47f5c8[_0xcb37('0x32')]=_0x47f5c8[_0xcb37('0x32')][_0xcb37('0x34')]?_0x47f5c8[_0xcb37('0x32')]:_0x20ec93[_0xcb37('0x2e')];_0x47f5c8[_0xcb37('0x37')]=qs[_0xcb37('0x38')](_0x53b64f['query'][_0xcb37('0x38')]);_0x47f5c8[_0xcb37('0x39')]=qs[_0xcb37('0x3a')](_[_0xcb37('0x3b')](_0x53b64f[_0xcb37('0x2f')],_0x20ec93[_0xcb37('0x3a')]));if(_0x53b64f[_0xcb37('0x2f')][_0xcb37('0x3c')]){_0x47f5c8[_0xcb37('0x39')]=_['merge'](_0x47f5c8[_0xcb37('0x39')],{'$or':_[_0xcb37('0x29')](_0x47f5c8[_0xcb37('0x32')],function(_0x1eefa8){var _0x40ed24={};_0x40ed24[_0x1eefa8]={'$like':'%'+_0x53b64f[_0xcb37('0x2f')][_0xcb37('0x3c')]+'%'};return _0x40ed24;})});}_0x47f5c8=_[_0xcb37('0x3d')]({},_0x47f5c8,_0x53b64f[_0xcb37('0x3e')]);return _0x237539[_0xcb37('0x4a')](_0x47f5c8);}})[_0xcb37('0x24')](function(_0x1192f0){if(_0x1192f0){_0x49b365=_0x1192f0[_0xcb37('0x34')];if(!_0x53b64f[_0xcb37('0x2f')][_0xcb37('0x35')](_0xcb37('0x36'))){_0x47f5c8[_0xcb37('0x1d')]=qs[_0xcb37('0x1d')](_0x53b64f[_0xcb37('0x2f')][_0xcb37('0x1d')]);_0x47f5c8[_0xcb37('0x1c')]=qs[_0xcb37('0x1c')](_0x53b64f['query']['offset']);}return _0x237539[_0xcb37('0x4a')](_0x47f5c8);}})[_0xcb37('0x24')](function(_0x1395e5){if(_0x1395e5){return _0x1395e5?{'count':_0x49b365,'rows':_0x1395e5}:null;}})['then'](respondWithResult(_0xb10775,null))[_0xcb37('0x42')](handleError(_0xb10775,null));};exports['addConfiguration']=function(_0xcddbb9,_0x2f7823,_0x1014d2){if(_0xcddbb9[_0xcb37('0x47')]['id']){delete _0xcddbb9[_0xcb37('0x47')]['id'];}return db[_0xcb37('0x3f')][_0xcb37('0x4b')]({'where':{'id':_0xcddbb9[_0xcb37('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f7823,null))['then'](function(_0x4dbc58){if(_0x4dbc58){_0xcddbb9[_0xcb37('0x47')][_0xcb37('0x4d')]=_0x4dbc58['id'];_0xcddbb9['body'][_0xcb37('0x4e')]=integrations['getSubjects'](_0xcddbb9['body'][_0xcb37('0x4f')],_0xcddbb9[_0xcb37('0x47')][_0xcb37('0x2c')]);_0xcddbb9[_0xcb37('0x47')][_0xcb37('0x50')]=integrations[_0xcb37('0x51')](_0xcddbb9['body'][_0xcb37('0x4f')],_0xcddbb9['body'][_0xcb37('0x2c')]);return db['FreshsalesConfiguration'][_0xcb37('0x52')](_0xcddbb9[_0xcb37('0x47')],{'include':[{'model':db[_0xcb37('0x53')],'as':_0xcb37('0x4e')},{'model':db['FreshsalesField'],'as':_0xcb37('0x50')}]});}return null;})[_0xcb37('0x24')](respondWithResult(_0x2f7823,null))[_0xcb37('0x42')](handleError(_0x2f7823,null));};exports[_0xcb37('0x54')]=function(_0x584c47,_0x1decc5,_0x7e6400){var _0x96e8e8='';var _0x498601='';return db[_0xcb37('0x3f')][_0xcb37('0x4b')]({'where':{'id':_0x584c47['params']['id']},'attributes':['id',_0xcb37('0x55'),'remoteUri',_0xcb37('0x56')]})[_0xcb37('0x24')](handleEntityNotFound(_0x1decc5,null))[_0xcb37('0x24')](function(_0x4bea7a){if(_0x4bea7a){_0x498601=_0x4bea7a[_0xcb37('0x55')];_0x96e8e8=_0x4bea7a[_0xcb37('0x57')];var _0x19b09e=_0x4bea7a[_0xcb37('0x57')][_0xcb37('0x58')](-0x1);if(_0x19b09e==='/'){_0x96e8e8=_0x96e8e8['substring'](0x0,_0x96e8e8['lastIndexOf'](_0x19b09e));}return rp({'method':_0xcb37('0x59'),'uri':util[_0xcb37('0x5a')](_0xcb37('0x5b'),_0x96e8e8,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x4bea7a['apiKey']},'json':!![]});}})['then'](function(_0x5997d1){if(_0x5997d1){var _0xb00af8=_0x5997d1['users'];var _0x27d34f=![];var _0x5a412b=null;for(_0x5a412b=0x0;_0x5a412b<_0xb00af8[_0xcb37('0x34')];_0x5a412b++){if(_0xb00af8[_0x5a412b]['email']===_0x498601){_0x27d34f=!![];}}if(_0x27d34f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcb37('0x5c')});}}})['then'](respondWithResult(_0x1decc5,null))['catch'](function(_0x51b583){var _0x50790d=_0x584c47[_0xcb37('0x2f')]['test']?0x1f4:_0x51b583['statusCode']||0x1f4;logger[_0xcb37('0x25')](_0xcb37('0x5d'),_0xcb37('0x54'),_0x50790d,JSON[_0xcb37('0x5e')](_0x51b583));delete _0x51b583[_0xcb37('0x27')];if(_0x50790d===0x191){_0x50790d=0x190;}_0x1decc5[_0xcb37('0x19')](_0x50790d)[_0xcb37('0x28')](_0x584c47[_0xcb37('0x2f')]['test']?{'message':_0xcb37('0x5f'),'statusCode':_0x51b583[_0xcb37('0x60')]}:_0x51b583);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 7a4dad1..4a75541 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 _0xb145=['request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x453691,_0x19ae63){var _0x21c62d=function(_0x26151d){while(--_0x26151d){_0x453691['push'](_0x453691['shift']());}};_0x21c62d(++_0x19ae63);}(_0xb145,0xa3));var _0x5b14=function(_0x4ba42c,_0x428175){_0x4ba42c=_0x4ba42c-0x0;var _0x5753a0=_0xb145[_0x4ba42c];return _0x5753a0;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));var integrations=require(_0x5b14('0x9'));module[_0x5b14('0xa')]=function(_0x4d82ad,_0x50fd91){return _0x4d82ad[_0x5b14('0xb')](_0x5b14('0xc'),attributes,{'tableName':_0x5b14('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27a0=['int_freshsales_accounts','util','../../config/logger','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x5b5fe2,_0x48132d){var _0x42a513=function(_0x32d22b){while(--_0x32d22b){_0x5b5fe2['push'](_0x5b5fe2['shift']());}};_0x42a513(++_0x48132d);}(_0x27a0,0xbf));var _0x027a=function(_0x4ee119,_0x4190a5){_0x4ee119=_0x4ee119-0x0;var _0x4fbf89=_0x27a0[_0x4ee119];return _0x4fbf89;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('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(_0x027a('0x5'));var integrations=require(_0x027a('0x6'));module[_0x027a('0x7')]=function(_0x639bec,_0xe233ed){return _0x639bec[_0x027a('0x8')]('FreshsalesAccount',attributes,{'tableName':_0x027a('0x9'),'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 3f1cf39..41f4f21 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 _0x32f4=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','find','ShowFreshsalesAccount'];(function(_0x154b31,_0x2d12bc){var _0x1183d8=function(_0x5c9e27){while(--_0x5c9e27){_0x154b31['push'](_0x154b31['shift']());}};_0x1183d8(++_0x2d12bc);}(_0x32f4,0x154));var _0x432f=function(_0x1f756a,_0x2781b6){_0x1f756a=_0x1f756a-0x0;var _0x303ba5=_0x32f4[_0x1f756a];return _0x303ba5;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['findAll']({'raw':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1a')]||null:null,'attributes':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'limit':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1c')]||null:null,'include':_0x243cf['options']?_0x243cf['options'][_0x432f('0x1d')]?_['map'](_0x243cf[_0x432f('0x18')]['include'],function(_0x37f136){return{'model':db[_0x37f136[_0x432f('0x1e')]],'as':_0x37f136['as'],'attributes':_0x37f136[_0x432f('0x1b')],'include':_0x37f136[_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x37f136[_0x432f('0x1d')],function(_0x59f352){return{'model':db[_0x59f352[_0x432f('0x1e')]],'as':_0x59f352['as'],'attributes':_0x59f352[_0x432f('0x1b')],'include':_0x59f352['include']?_[_0x432f('0x1f')](_0x59f352[_0x432f('0x1d')],function(_0x2bcbb4){return{'model':db[_0x2bcbb4[_0x432f('0x1e')]],'as':_0x2bcbb4['as'],'attributes':_0x2bcbb4[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x138a6a){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON['stringify'](_0x138a6a));_0x129582(_0x138a6a);})[_0x432f('0x15')](function(_0x5a2c14){logger[_0x432f('0x11')]('GetFreshsalesAccount',_0x5a2c14[_0x432f('0x13')],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x5a2c14[_0x432f('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x6a116e){var _0x24406a=this;return new Promise(function(_0x48139b,_0x5ee0fa){return db[_0x432f('0x17')][_0x432f('0x20')]({'raw':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x6a116e[_0x432f('0x18')]?_0x6a116e['options']['where']||null:null,'attributes':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'include':_0x6a116e['options']?_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')],function(_0x3ad632){return{'model':db[_0x3ad632[_0x432f('0x1e')]],'as':_0x3ad632['as'],'attributes':_0x3ad632[_0x432f('0x1b')],'include':_0x3ad632['include']?_['map'](_0x3ad632[_0x432f('0x1d')],function(_0xa5e0d){return{'model':db[_0xa5e0d['model']],'as':_0xa5e0d['as'],'attributes':_0xa5e0d['attributes'],'include':_0xa5e0d['include']?_[_0x432f('0x1f')](_0xa5e0d[_0x432f('0x1d')],function(_0x5648a7){return{'model':db[_0x5648a7[_0x432f('0x1e')]],'as':_0x5648a7['as'],'attributes':_0x5648a7[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x5903f6){logger[_0x432f('0xc')](_0x432f('0x21'),_0x6a116e);logger['debug'](_0x432f('0x21'),_0x6a116e,JSON[_0x432f('0x10')](_0x5903f6));_0x48139b(_0x5903f6);})['catch'](function(_0x28da2e){logger[_0x432f('0x11')](_0x432f('0x21'),_0x28da2e[_0x432f('0x13')],_0x6a116e);_0x5ee0fa(_0x24406a[_0x432f('0x11')](0x1f4,_0x28da2e[_0x432f('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['http','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x493732,_0x22412a){var _0x57b91a=function(_0x291fe1){while(--_0x291fe1){_0x493732['push'](_0x493732['shift']());}};_0x57b91a(++_0x22412a);}(_0x7a54,0x106));var _0x47a5=function(_0x22384,_0x8ff21b){_0x22384=_0x22384-0x0;var _0x3953f7=_0x7a54[_0x22384];return _0x3953f7;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=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,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 379fa70..fec0a0a 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 _0x18e2=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','/:id','get','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1c6a2f,_0x5b7146){var _0x66320c=function(_0x4cee6a){while(--_0x4cee6a){_0x1c6a2f['push'](_0x1c6a2f['shift']());}};_0x66320c(++_0x5b7146);}(_0x18e2,0x165));var _0x218e=function(_0x1531b5,_0x522e09){_0x1531b5=_0x1531b5-0x0;var _0xeba8ab=_0x18e2[_0x1531b5];return _0xeba8ab;};'use strict';var multer=require(_0x218e('0x0'));var util=require(_0x218e('0x1'));var path=require(_0x218e('0x2'));var timeout=require(_0x218e('0x3'));var express=require(_0x218e('0x4'));var router=express['Router']();var fs_extra=require(_0x218e('0x5'));var auth=require(_0x218e('0x6'));var interaction=require(_0x218e('0x7'));var config=require('../../config/environment');var controller=require(_0x218e('0x8'));router['get']('/',auth[_0x218e('0x9')](),controller[_0x218e('0xa')]);router['get'](_0x218e('0xb'),auth[_0x218e('0x9')](),controller['show']);router[_0x218e('0xc')]('/:id/subjects',auth[_0x218e('0x9')](),controller[_0x218e('0xd')]);router[_0x218e('0xc')](_0x218e('0xe'),auth[_0x218e('0x9')](),controller[_0x218e('0xf')]);router[_0x218e('0xc')](_0x218e('0x10'),auth['isAuthenticated'](),controller[_0x218e('0x11')]);router[_0x218e('0x12')]('/',auth[_0x218e('0x9')](),controller['create']);router[_0x218e('0x13')](_0x218e('0xb'),auth[_0x218e('0x9')](),controller[_0x218e('0x14')]);router[_0x218e('0x15')](_0x218e('0xb'),auth[_0x218e('0x9')](),controller[_0x218e('0x16')]);module[_0x218e('0x17')]=router; \ No newline at end of file +var _0xbe29=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x5c396c,_0x3b75c3){var _0x514f6c=function(_0x368b1a){while(--_0x368b1a){_0x5c396c['push'](_0x5c396c['shift']());}};_0x514f6c(++_0x3b75c3);}(_0xbe29,0x87));var _0x9be2=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0xbe29[_0x473ee7];return _0x30f0d4;};'use strict';var multer=require(_0x9be2('0x0'));var util=require(_0x9be2('0x1'));var path=require(_0x9be2('0x2'));var timeout=require(_0x9be2('0x3'));var express=require(_0x9be2('0x4'));var router=express[_0x9be2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9be2('0x6'));var interaction=require(_0x9be2('0x7'));var config=require(_0x9be2('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x9be2('0x9')]('/',auth['isAuthenticated'](),controller[_0x9be2('0xa')]);router[_0x9be2('0x9')]('/:id',auth[_0x9be2('0xb')](),controller['show']);router[_0x9be2('0x9')](_0x9be2('0xc'),auth[_0x9be2('0xb')](),controller[_0x9be2('0xd')]);router[_0x9be2('0x9')](_0x9be2('0xe'),auth[_0x9be2('0xb')](),controller[_0x9be2('0xf')]);router[_0x9be2('0x9')]('/:id/fields',auth[_0x9be2('0xb')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x9be2('0x10')]);router[_0x9be2('0x11')]('/:id',auth[_0x9be2('0xb')](),controller[_0x9be2('0x12')]);router[_0x9be2('0x13')](_0x9be2('0x14'),auth['isAuthenticated'](),controller[_0x9be2('0x15')]);module[_0x9be2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4657ab4..b4c11a4 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 _0xf38c=['STRING'];(function(_0x20c502,_0xd41920){var _0x3baa61=function(_0x4ccd95){while(--_0x4ccd95){_0x20c502['push'](_0x20c502['shift']());}};_0x3baa61(++_0xd41920);}(_0xf38c,0x1ac));var _0xcf38=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf38c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcf38('0x0')]},'description':{'type':Sequelize[_0xcf38('0x0')]}}; \ No newline at end of file +var _0x9f91=['sequelize','STRING'];(function(_0x2d33c7,_0x20e736){var _0x3f5a29=function(_0x41f9fb){while(--_0x41f9fb){_0x2d33c7['push'](_0x2d33c7['shift']());}};_0x3f5a29(++_0x20e736);}(_0x9f91,0x94));var _0x19f9=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x9f91[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0x19f9('0x0'));module['exports']={'name':{'type':Sequelize[_0x19f9('0x1')]},'description':{'type':Sequelize[_0x19f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a221f51..9836c0c 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 _0x1803=['FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','count','include','findAll','rows','catch','show','includeAll','create','body','find','findOne','params','FreshsalesField','order','pick','getSubjects','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','set','apply','save','update','destroy','then','end','sendStatus','error','stack','name','index'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x1803,0x111));var _0x3180=function(_0x2333ac,_0x8920e6){_0x2333ac=_0x2333ac-0x0;var _0x458430=_0x1803[_0x2333ac];return _0x458430;};'use strict';var emlformat=require(_0x3180('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3180('0x1'));var jsonpatch=require(_0x3180('0x2'));var rp=require(_0x3180('0x3'));var moment=require(_0x3180('0x4'));var BPromise=require(_0x3180('0x5'));var Mustache=require('mustache');var util=require(_0x3180('0x6'));var path=require(_0x3180('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3180('0x8'));var fs=require('fs');var fs_extra=require(_0x3180('0x9'));var _=require(_0x3180('0xa'));var squel=require(_0x3180('0xb'));var crypto=require(_0x3180('0xc'));var jsforce=require(_0x3180('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3180('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3180('0xf'));var authService=require(_0x3180('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3180('0x11'));var hardwareService=require(_0x3180('0x12'));var logger=require(_0x3180('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3180('0x14'));var licenseUtil=require(_0x3180('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x221909,_0x3232f3){_0x3232f3=_0x3232f3||0xcc;return function(_0x5a0892){if(_0x5a0892){return _0x221909['sendStatus'](_0x3232f3);}return _0x221909[_0x3180('0x16')](_0x3232f3)['end']();};}function respondWithResult(_0x3326e8,_0x349c54){_0x349c54=_0x349c54||0xc8;return function(_0x1844a6){if(_0x1844a6){return _0x3326e8[_0x3180('0x16')](_0x349c54)[_0x3180('0x17')](_0x1844a6);}};}function respondWithFilteredResult(_0x2bf29d,_0x10adc0){return function(_0x45e3ef){if(_0x45e3ef){var _0x9d5441=typeof _0x10adc0['offset']===_0x3180('0x18')&&typeof _0x10adc0[_0x3180('0x19')]==='undefined';var _0x150ecd=_0x45e3ef['count'];var _0x20739c=_0x9d5441?0x0:_0x10adc0[_0x3180('0x1a')];var _0x28045b=_0x9d5441?_0x45e3ef['count']:_0x10adc0[_0x3180('0x1a')]+_0x10adc0[_0x3180('0x19')];var _0x578e18;if(_0x28045b>=_0x150ecd){_0x28045b=_0x150ecd;_0x578e18=0xc8;}else{_0x578e18=0xce;}_0x2bf29d[_0x3180('0x16')](_0x578e18);return _0x2bf29d[_0x3180('0x1b')]('Content-Range',_0x20739c+'-'+_0x28045b+'/'+_0x150ecd)[_0x3180('0x17')](_0x45e3ef);}return null;};}function patchUpdates(_0x55b354){return function(_0x53a4d2){try{jsonpatch[_0x3180('0x1c')](_0x53a4d2,_0x55b354,!![]);}catch(_0x5d6abe){return BPromise['reject'](_0x5d6abe);}return _0x53a4d2[_0x3180('0x1d')]();};}function saveUpdates(_0x1d5551,_0x5b306d){return function(_0x294b94){if(_0x294b94){return _0x294b94[_0x3180('0x1e')](_0x1d5551)['then'](function(_0x21f2e6){return _0x21f2e6;});}return null;};}function removeEntity(_0x266286,_0x1d7e0d){return function(_0x4b4cec){if(_0x4b4cec){return _0x4b4cec[_0x3180('0x1f')]()[_0x3180('0x20')](function(){_0x266286[_0x3180('0x16')](0xcc)[_0x3180('0x21')]();});}};}function handleEntityNotFound(_0x4f341f,_0xfbb058){return function(_0x5eeb5c){if(!_0x5eeb5c){_0x4f341f[_0x3180('0x22')](0x194);}return _0x5eeb5c;};}function handleError(_0x4ee12c,_0x3e3182){_0x3e3182=_0x3e3182||0x1f4;return function(_0x1587c7){logger[_0x3180('0x23')](_0x1587c7[_0x3180('0x24')]);if(_0x1587c7[_0x3180('0x25')]){delete _0x1587c7[_0x3180('0x25')];}_0x4ee12c[_0x3180('0x16')](_0x3e3182)['send'](_0x1587c7);};}exports[_0x3180('0x26')]=function(_0x2925c9,_0x2278e1){var _0x51869b={},_0x1fe494={},_0x4ac21a={'count':0x0,'rows':[]};var _0x347b6b=_['map'](db[_0x3180('0x27')][_0x3180('0x28')],function(_0x5321af){return{'name':_0x5321af[_0x3180('0x29')],'type':_0x5321af[_0x3180('0x2a')][_0x3180('0x2b')]};});_0x1fe494[_0x3180('0x2c')]=_[_0x3180('0x2d')](_0x347b6b,'name');_0x1fe494['query']=_[_0x3180('0x2e')](_0x2925c9[_0x3180('0x2f')]);_0x1fe494[_0x3180('0x30')]=_[_0x3180('0x31')](_0x1fe494[_0x3180('0x2c')],_0x1fe494[_0x3180('0x2f')]);_0x51869b[_0x3180('0x32')]=_[_0x3180('0x31')](_0x1fe494[_0x3180('0x2c')],qs[_0x3180('0x33')](_0x2925c9[_0x3180('0x2f')]['fields']));_0x51869b[_0x3180('0x32')]=_0x51869b[_0x3180('0x32')][_0x3180('0x34')]?_0x51869b[_0x3180('0x32')]:_0x1fe494[_0x3180('0x2c')];if(!_0x2925c9[_0x3180('0x2f')][_0x3180('0x35')](_0x3180('0x36'))){_0x51869b['limit']=qs[_0x3180('0x19')](_0x2925c9[_0x3180('0x2f')][_0x3180('0x19')]);_0x51869b['offset']=qs['offset'](_0x2925c9[_0x3180('0x2f')][_0x3180('0x1a')]);}_0x51869b['order']=qs[_0x3180('0x37')](_0x2925c9[_0x3180('0x2f')][_0x3180('0x37')]);_0x51869b[_0x3180('0x38')]=qs['filters'](_['pick'](_0x2925c9[_0x3180('0x2f')],_0x1fe494['filters']),_0x347b6b);if(_0x2925c9[_0x3180('0x2f')]['filter']){_0x51869b[_0x3180('0x38')]=_[_0x3180('0x39')](_0x51869b[_0x3180('0x38')],{'$or':_['map'](_0x347b6b,function(_0x885c46){if(_0x885c46[_0x3180('0x2a')]!=='VIRTUAL'){var _0x2db919={};_0x2db919[_0x885c46[_0x3180('0x25')]]={'$like':'%'+_0x2925c9[_0x3180('0x2f')][_0x3180('0x3a')]+'%'};return _0x2db919;}})});}_0x51869b=_['merge']({},_0x51869b,_0x2925c9[_0x3180('0x3b')]);var _0xa59f46={'where':_0x51869b[_0x3180('0x38')]};return db[_0x3180('0x27')][_0x3180('0x3c')](_0xa59f46)[_0x3180('0x20')](function(_0x11eb6a){_0x4ac21a[_0x3180('0x3c')]=_0x11eb6a;if(_0x2925c9[_0x3180('0x2f')]['includeAll']){_0x51869b[_0x3180('0x3d')]=[{'all':!![]}];}return db[_0x3180('0x27')][_0x3180('0x3e')](_0x51869b);})[_0x3180('0x20')](function(_0x16da52){_0x4ac21a[_0x3180('0x3f')]=_0x16da52;return _0x4ac21a;})[_0x3180('0x20')](respondWithFilteredResult(_0x2278e1,_0x51869b))[_0x3180('0x40')](handleError(_0x2278e1,null));};exports[_0x3180('0x41')]=function(_0x3ba3bf,_0x438913){var _0x2f3e07={'raw':![],'where':{'id':_0x3ba3bf['params']['id']}},_0x699c26={};_0x699c26[_0x3180('0x2c')]=_[_0x3180('0x2e')](db['FreshsalesConfiguration'][_0x3180('0x28')]);_0x699c26['query']=_['keys'](_0x3ba3bf[_0x3180('0x2f')]);_0x699c26['filters']=_[_0x3180('0x31')](_0x699c26[_0x3180('0x2c')],_0x699c26[_0x3180('0x2f')]);_0x2f3e07['attributes']=_[_0x3180('0x31')](_0x699c26['model'],qs[_0x3180('0x33')](_0x3ba3bf[_0x3180('0x2f')][_0x3180('0x33')]));_0x2f3e07[_0x3180('0x32')]=_0x2f3e07[_0x3180('0x32')]['length']?_0x2f3e07[_0x3180('0x32')]:_0x699c26[_0x3180('0x2c')];if(_0x3ba3bf['query'][_0x3180('0x42')]){_0x2f3e07['include']=[{'all':!![]}];}_0x2f3e07=_['merge']({},_0x2f3e07,_0x3ba3bf[_0x3180('0x3b')]);return db[_0x3180('0x27')]['find'](_0x2f3e07)[_0x3180('0x20')](handleEntityNotFound(_0x438913,null))[_0x3180('0x20')](respondWithResult(_0x438913,null))[_0x3180('0x40')](handleError(_0x438913,null));};exports[_0x3180('0x43')]=function(_0x1e4a14,_0x35bb4f){return db[_0x3180('0x27')][_0x3180('0x43')](_0x1e4a14[_0x3180('0x44')],{})['then'](respondWithResult(_0x35bb4f,0xc9))[_0x3180('0x40')](handleError(_0x35bb4f,null));};exports[_0x3180('0x1e')]=function(_0x1554cd,_0x36db8c){if(_0x1554cd[_0x3180('0x44')]['id']){delete _0x1554cd[_0x3180('0x44')]['id'];}return db[_0x3180('0x27')][_0x3180('0x45')]({'where':{'id':_0x1554cd['params']['id']}})[_0x3180('0x20')](handleEntityNotFound(_0x36db8c,null))[_0x3180('0x20')](saveUpdates(_0x1554cd[_0x3180('0x44')],null))[_0x3180('0x20')](respondWithResult(_0x36db8c,null))[_0x3180('0x40')](handleError(_0x36db8c,null));};exports[_0x3180('0x1f')]=function(_0x5194cd,_0x1e1df1){return db[_0x3180('0x27')][_0x3180('0x45')]({'where':{'id':_0x5194cd['params']['id']}})['then'](handleEntityNotFound(_0x1e1df1,null))[_0x3180('0x20')](removeEntity(_0x1e1df1,null))[_0x3180('0x40')](handleError(_0x1e1df1,null));};exports['getSubjects']=function(_0x2f4c24,_0x252c14,_0x59bb35){var _0x1ec035={};var _0x436e48={};var _0x5d61d1;var _0x4c2332;return db[_0x3180('0x27')][_0x3180('0x46')]({'where':{'id':_0x2f4c24[_0x3180('0x47')]['id']}})[_0x3180('0x20')](handleEntityNotFound(_0x252c14,null))['then'](function(_0x3c8f9d){if(_0x3c8f9d){_0x5d61d1=_0x3c8f9d;_0x436e48['model']=_[_0x3180('0x2e')](db[_0x3180('0x48')]['rawAttributes']);_0x436e48[_0x3180('0x2f')]=_[_0x3180('0x2e')](_0x2f4c24[_0x3180('0x2f')]);_0x436e48[_0x3180('0x30')]=_[_0x3180('0x31')](_0x436e48['model'],_0x436e48[_0x3180('0x2f')]);_0x1ec035[_0x3180('0x32')]=_['intersection'](_0x436e48[_0x3180('0x2c')],qs[_0x3180('0x33')](_0x2f4c24['query'][_0x3180('0x33')]));_0x1ec035[_0x3180('0x32')]=_0x1ec035[_0x3180('0x32')]['length']?_0x1ec035[_0x3180('0x32')]:_0x436e48[_0x3180('0x2c')];_0x1ec035[_0x3180('0x49')]=qs[_0x3180('0x37')](_0x2f4c24['query']['sort']);_0x1ec035['where']=qs['filters'](_[_0x3180('0x4a')](_0x2f4c24[_0x3180('0x2f')],_0x436e48[_0x3180('0x30')]));if(_0x2f4c24[_0x3180('0x2f')][_0x3180('0x3a')]){_0x1ec035[_0x3180('0x38')]=_['merge'](_0x1ec035[_0x3180('0x38')],{'$or':_[_0x3180('0x2d')](_0x1ec035['attributes'],function(_0xe5047f){var _0x32059f={};_0x32059f[_0xe5047f]={'$like':'%'+_0x2f4c24['query'][_0x3180('0x3a')]+'%'};return _0x32059f;})});}_0x1ec035=_[_0x3180('0x39')]({},_0x1ec035,_0x2f4c24[_0x3180('0x3b')]);return _0x5d61d1[_0x3180('0x4b')](_0x1ec035);}})[_0x3180('0x20')](function(_0x33ea41){if(_0x33ea41){_0x4c2332=_0x33ea41[_0x3180('0x34')];if(!_0x2f4c24[_0x3180('0x2f')][_0x3180('0x35')](_0x3180('0x36'))){_0x1ec035[_0x3180('0x19')]=qs['limit'](_0x2f4c24['query'][_0x3180('0x19')]);_0x1ec035[_0x3180('0x1a')]=qs['offset'](_0x2f4c24[_0x3180('0x2f')]['offset']);}return _0x5d61d1[_0x3180('0x4b')](_0x1ec035);}})[_0x3180('0x20')](function(_0x484075){if(_0x484075){return _0x484075?{'count':_0x4c2332,'rows':_0x484075}:null;}})[_0x3180('0x20')](respondWithResult(_0x252c14,null))[_0x3180('0x40')](handleError(_0x252c14,null));};exports['getDescriptions']=function(_0x16d36b,_0x3e2686,_0x2ce844){var _0x5140dd={};var _0x5cf03d={};var _0x2a2017;var _0x2b16e8;return db[_0x3180('0x27')][_0x3180('0x46')]({'where':{'id':_0x16d36b[_0x3180('0x47')]['id']}})[_0x3180('0x20')](handleEntityNotFound(_0x3e2686,null))[_0x3180('0x20')](function(_0x5ea052){if(_0x5ea052){_0x2a2017=_0x5ea052;_0x5cf03d['model']=_[_0x3180('0x2e')](db[_0x3180('0x48')][_0x3180('0x28')]);_0x5cf03d['query']=_[_0x3180('0x2e')](_0x16d36b[_0x3180('0x2f')]);_0x5cf03d['filters']=_[_0x3180('0x31')](_0x5cf03d[_0x3180('0x2c')],_0x5cf03d[_0x3180('0x2f')]);_0x5140dd[_0x3180('0x32')]=_[_0x3180('0x31')](_0x5cf03d[_0x3180('0x2c')],qs[_0x3180('0x33')](_0x16d36b['query'][_0x3180('0x33')]));_0x5140dd['attributes']=_0x5140dd[_0x3180('0x32')][_0x3180('0x34')]?_0x5140dd['attributes']:_0x5cf03d['model'];_0x5140dd[_0x3180('0x49')]=qs['sort'](_0x16d36b['query'][_0x3180('0x37')]);_0x5140dd[_0x3180('0x38')]=qs[_0x3180('0x30')](_[_0x3180('0x4a')](_0x16d36b['query'],_0x5cf03d[_0x3180('0x30')]));if(_0x16d36b[_0x3180('0x2f')]['filter']){_0x5140dd[_0x3180('0x38')]=_[_0x3180('0x39')](_0x5140dd[_0x3180('0x38')],{'$or':_[_0x3180('0x2d')](_0x5140dd[_0x3180('0x32')],function(_0x1c41b3){var _0x5a8826={};_0x5a8826[_0x1c41b3]={'$like':'%'+_0x16d36b[_0x3180('0x2f')][_0x3180('0x3a')]+'%'};return _0x5a8826;})});}_0x5140dd=_[_0x3180('0x39')]({},_0x5140dd,_0x16d36b[_0x3180('0x3b')]);return _0x2a2017[_0x3180('0x4c')](_0x5140dd);}})[_0x3180('0x20')](function(_0x4dd7f8){if(_0x4dd7f8){_0x2b16e8=_0x4dd7f8[_0x3180('0x34')];if(!_0x16d36b[_0x3180('0x2f')][_0x3180('0x35')]('nolimit')){_0x5140dd[_0x3180('0x19')]=qs[_0x3180('0x19')](_0x16d36b['query'][_0x3180('0x19')]);_0x5140dd[_0x3180('0x1a')]=qs[_0x3180('0x1a')](_0x16d36b[_0x3180('0x2f')]['offset']);}return _0x2a2017[_0x3180('0x4c')](_0x5140dd);}})[_0x3180('0x20')](function(_0x53fdaa){if(_0x53fdaa){return _0x53fdaa?{'count':_0x2b16e8,'rows':_0x53fdaa}:null;}})[_0x3180('0x20')](respondWithResult(_0x3e2686,null))[_0x3180('0x40')](handleError(_0x3e2686,null));};exports[_0x3180('0x4d')]=function(_0x411564,_0x301638,_0x2b6a98){var _0xe1212d={};var _0x396535={};var _0x5aa9e6;var _0x5ecbd9;return db[_0x3180('0x27')][_0x3180('0x46')]({'where':{'id':_0x411564[_0x3180('0x47')]['id']}})[_0x3180('0x20')](handleEntityNotFound(_0x301638,null))[_0x3180('0x20')](function(_0x1d5567){if(_0x1d5567){_0x5aa9e6=_0x1d5567;_0x396535[_0x3180('0x2c')]=_[_0x3180('0x2e')](db[_0x3180('0x48')]['rawAttributes']);_0x396535[_0x3180('0x2f')]=_[_0x3180('0x2e')](_0x411564[_0x3180('0x2f')]);_0x396535[_0x3180('0x30')]=_[_0x3180('0x31')](_0x396535[_0x3180('0x2c')],_0x396535[_0x3180('0x2f')]);_0xe1212d[_0x3180('0x32')]=_[_0x3180('0x31')](_0x396535[_0x3180('0x2c')],qs[_0x3180('0x33')](_0x411564[_0x3180('0x2f')]['fields']));_0xe1212d[_0x3180('0x32')]=_0xe1212d[_0x3180('0x32')]['length']?_0xe1212d[_0x3180('0x32')]:_0x396535[_0x3180('0x2c')];_0xe1212d[_0x3180('0x49')]=qs[_0x3180('0x37')](_0x411564['query'][_0x3180('0x37')]);_0xe1212d[_0x3180('0x38')]=qs[_0x3180('0x30')](_[_0x3180('0x4a')](_0x411564[_0x3180('0x2f')],_0x396535['filters']));if(_0x411564[_0x3180('0x2f')][_0x3180('0x3a')]){_0xe1212d[_0x3180('0x38')]=_[_0x3180('0x39')](_0xe1212d['where'],{'$or':_['map'](_0xe1212d[_0x3180('0x32')],function(_0xfc7fe0){var _0x33d8a9={};_0x33d8a9[_0xfc7fe0]={'$like':'%'+_0x411564[_0x3180('0x2f')][_0x3180('0x3a')]+'%'};return _0x33d8a9;})});}_0xe1212d=_[_0x3180('0x39')]({},_0xe1212d,_0x411564['options']);return _0x5aa9e6[_0x3180('0x4d')](_0xe1212d);}})[_0x3180('0x20')](function(_0x5de032){if(_0x5de032){_0x5ecbd9=_0x5de032[_0x3180('0x34')];if(!_0x411564[_0x3180('0x2f')]['hasOwnProperty']('nolimit')){_0xe1212d['limit']=qs['limit'](_0x411564[_0x3180('0x2f')][_0x3180('0x19')]);_0xe1212d[_0x3180('0x1a')]=qs[_0x3180('0x1a')](_0x411564[_0x3180('0x2f')]['offset']);}return _0x5aa9e6['getFields'](_0xe1212d);}})['then'](function(_0x1a324d){if(_0x1a324d){return _0x1a324d?{'count':_0x5ecbd9,'rows':_0x1a324d}:null;}})['then'](respondWithResult(_0x301638,null))[_0x3180('0x40')](handleError(_0x301638,null));}; \ No newline at end of file +var _0x0303=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','getSubjects','findOne','order','pick','FreshsalesField','getDescriptions','getFields','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','model','keys','query','filters'];(function(_0x374222,_0x198f30){var _0x42f607=function(_0x2ca49d){while(--_0x2ca49d){_0x374222['push'](_0x374222['shift']());}};_0x42f607(++_0x198f30);}(_0x0303,0x19f));var _0x3030=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x0303[_0x39bc44];return _0x2916d8;};'use strict';var emlformat=require(_0x3030('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3030('0x1'));var rp=require('request-promise');var moment=require(_0x3030('0x2'));var BPromise=require(_0x3030('0x3'));var Mustache=require(_0x3030('0x4'));var util=require(_0x3030('0x5'));var path=require(_0x3030('0x6'));var sox=require('sox');var csv=require(_0x3030('0x7'));var ejs=require(_0x3030('0x8'));var fs=require('fs');var fs_extra=require(_0x3030('0x9'));var _=require(_0x3030('0xa'));var squel=require('squel');var crypto=require(_0x3030('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3030('0xc'));var toCsv=require(_0x3030('0x7'));var querystring=require(_0x3030('0xd'));var Papa=require(_0x3030('0xe'));var Redis=require(_0x3030('0xf'));var authService=require(_0x3030('0x10'));var qs=require(_0x3030('0x11'));var as=require(_0x3030('0x12'));var hardwareService=require(_0x3030('0x13'));var logger=require('../../config/logger')(_0x3030('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3030('0x15'));var db=require(_0x3030('0x16'))['db'];function respondWithStatusCode(_0x23b499,_0x57b72){_0x57b72=_0x57b72||0xcc;return function(_0x2cffc6){if(_0x2cffc6){return _0x23b499[_0x3030('0x17')](_0x57b72);}return _0x23b499['status'](_0x57b72)[_0x3030('0x18')]();};}function respondWithResult(_0xa456a7,_0x3db098){_0x3db098=_0x3db098||0xc8;return function(_0x2441fe){if(_0x2441fe){return _0xa456a7[_0x3030('0x19')](_0x3db098)[_0x3030('0x1a')](_0x2441fe);}};}function respondWithFilteredResult(_0x266c74,_0x57ebd3){return function(_0x265666){if(_0x265666){var _0x575dce=typeof _0x57ebd3[_0x3030('0x1b')]===_0x3030('0x1c')&&typeof _0x57ebd3[_0x3030('0x1d')]===_0x3030('0x1c');var _0xbad227=_0x265666['count'];var _0x258594=_0x575dce?0x0:_0x57ebd3['offset'];var _0xeb02de=_0x575dce?_0x265666[_0x3030('0x1e')]:_0x57ebd3[_0x3030('0x1b')]+_0x57ebd3[_0x3030('0x1d')];var _0x2502a1;if(_0xeb02de>=_0xbad227){_0xeb02de=_0xbad227;_0x2502a1=0xc8;}else{_0x2502a1=0xce;}_0x266c74[_0x3030('0x19')](_0x2502a1);return _0x266c74[_0x3030('0x1f')]('Content-Range',_0x258594+'-'+_0xeb02de+'/'+_0xbad227)['json'](_0x265666);}return null;};}function patchUpdates(_0x5eb691){return function(_0x19649f){try{jsonpatch[_0x3030('0x20')](_0x19649f,_0x5eb691,!![]);}catch(_0x159ddb){return BPromise[_0x3030('0x21')](_0x159ddb);}return _0x19649f[_0x3030('0x22')]();};}function saveUpdates(_0x193467,_0x4b45d9){return function(_0x4462d3){if(_0x4462d3){return _0x4462d3[_0x3030('0x23')](_0x193467)['then'](function(_0x3efb8b){return _0x3efb8b;});}return null;};}function removeEntity(_0x49edee,_0x39cb50){return function(_0x21e4b2){if(_0x21e4b2){return _0x21e4b2['destroy']()['then'](function(){_0x49edee[_0x3030('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7710,_0x510b21){return function(_0x229caf){if(!_0x229caf){_0x3a7710[_0x3030('0x17')](0x194);}return _0x229caf;};}function handleError(_0x3b5666,_0x588f1c){_0x588f1c=_0x588f1c||0x1f4;return function(_0x5e6f05){logger[_0x3030('0x24')](_0x5e6f05['stack']);if(_0x5e6f05[_0x3030('0x25')]){delete _0x5e6f05[_0x3030('0x25')];}_0x3b5666['status'](_0x588f1c)[_0x3030('0x26')](_0x5e6f05);};}exports[_0x3030('0x27')]=function(_0x3927e9,_0x11c2b5){var _0x575b06={},_0x842f0e={},_0x2d088b={'count':0x0,'rows':[]};var _0x24e7c1=_[_0x3030('0x28')](db[_0x3030('0x29')][_0x3030('0x2a')],function(_0x26be82){return{'name':_0x26be82['fieldName'],'type':_0x26be82['type']['key']};});_0x842f0e[_0x3030('0x2b')]=_[_0x3030('0x28')](_0x24e7c1,_0x3030('0x25'));_0x842f0e['query']=_[_0x3030('0x2c')](_0x3927e9[_0x3030('0x2d')]);_0x842f0e[_0x3030('0x2e')]=_[_0x3030('0x2f')](_0x842f0e[_0x3030('0x2b')],_0x842f0e[_0x3030('0x2d')]);_0x575b06[_0x3030('0x30')]=_[_0x3030('0x2f')](_0x842f0e['model'],qs[_0x3030('0x31')](_0x3927e9[_0x3030('0x2d')][_0x3030('0x31')]));_0x575b06[_0x3030('0x30')]=_0x575b06['attributes']['length']?_0x575b06['attributes']:_0x842f0e[_0x3030('0x2b')];if(!_0x3927e9[_0x3030('0x2d')][_0x3030('0x32')](_0x3030('0x33'))){_0x575b06[_0x3030('0x1d')]=qs['limit'](_0x3927e9[_0x3030('0x2d')][_0x3030('0x1d')]);_0x575b06[_0x3030('0x1b')]=qs[_0x3030('0x1b')](_0x3927e9['query']['offset']);}_0x575b06['order']=qs[_0x3030('0x34')](_0x3927e9[_0x3030('0x2d')][_0x3030('0x34')]);_0x575b06['where']=qs[_0x3030('0x2e')](_['pick'](_0x3927e9[_0x3030('0x2d')],_0x842f0e[_0x3030('0x2e')]),_0x24e7c1);if(_0x3927e9[_0x3030('0x2d')][_0x3030('0x35')]){_0x575b06[_0x3030('0x36')]=_[_0x3030('0x37')](_0x575b06[_0x3030('0x36')],{'$or':_[_0x3030('0x28')](_0x24e7c1,function(_0xd212b3){if(_0xd212b3['type']!==_0x3030('0x38')){var _0x573fad={};_0x573fad[_0xd212b3[_0x3030('0x25')]]={'$like':'%'+_0x3927e9[_0x3030('0x2d')][_0x3030('0x35')]+'%'};return _0x573fad;}})});}_0x575b06=_[_0x3030('0x37')]({},_0x575b06,_0x3927e9[_0x3030('0x39')]);var _0x341cc7={'where':_0x575b06[_0x3030('0x36')]};return db[_0x3030('0x29')][_0x3030('0x1e')](_0x341cc7)[_0x3030('0x3a')](function(_0x50a95c){_0x2d088b[_0x3030('0x1e')]=_0x50a95c;if(_0x3927e9[_0x3030('0x2d')][_0x3030('0x3b')]){_0x575b06[_0x3030('0x3c')]=[{'all':!![]}];}return db[_0x3030('0x29')]['findAll'](_0x575b06);})[_0x3030('0x3a')](function(_0x4b53af){_0x2d088b[_0x3030('0x3d')]=_0x4b53af;return _0x2d088b;})[_0x3030('0x3a')](respondWithFilteredResult(_0x11c2b5,_0x575b06))[_0x3030('0x3e')](handleError(_0x11c2b5,null));};exports[_0x3030('0x3f')]=function(_0x13a39b,_0x5627c8){var _0x2dcad5={'raw':![],'where':{'id':_0x13a39b[_0x3030('0x40')]['id']}},_0x5d9e1d={};_0x5d9e1d[_0x3030('0x2b')]=_['keys'](db[_0x3030('0x29')]['rawAttributes']);_0x5d9e1d[_0x3030('0x2d')]=_[_0x3030('0x2c')](_0x13a39b[_0x3030('0x2d')]);_0x5d9e1d[_0x3030('0x2e')]=_[_0x3030('0x2f')](_0x5d9e1d[_0x3030('0x2b')],_0x5d9e1d[_0x3030('0x2d')]);_0x2dcad5[_0x3030('0x30')]=_[_0x3030('0x2f')](_0x5d9e1d['model'],qs[_0x3030('0x31')](_0x13a39b[_0x3030('0x2d')][_0x3030('0x31')]));_0x2dcad5['attributes']=_0x2dcad5[_0x3030('0x30')][_0x3030('0x41')]?_0x2dcad5[_0x3030('0x30')]:_0x5d9e1d['model'];if(_0x13a39b[_0x3030('0x2d')][_0x3030('0x3b')]){_0x2dcad5['include']=[{'all':!![]}];}_0x2dcad5=_[_0x3030('0x37')]({},_0x2dcad5,_0x13a39b[_0x3030('0x39')]);return db[_0x3030('0x29')][_0x3030('0x42')](_0x2dcad5)[_0x3030('0x3a')](handleEntityNotFound(_0x5627c8,null))['then'](respondWithResult(_0x5627c8,null))[_0x3030('0x3e')](handleError(_0x5627c8,null));};exports[_0x3030('0x43')]=function(_0x595863,_0x440ccb){return db['FreshsalesConfiguration'][_0x3030('0x43')](_0x595863[_0x3030('0x44')],{})[_0x3030('0x3a')](respondWithResult(_0x440ccb,0xc9))[_0x3030('0x3e')](handleError(_0x440ccb,null));};exports[_0x3030('0x23')]=function(_0x2c19d2,_0xe48f28){if(_0x2c19d2[_0x3030('0x44')]['id']){delete _0x2c19d2['body']['id'];}return db[_0x3030('0x29')][_0x3030('0x42')]({'where':{'id':_0x2c19d2[_0x3030('0x40')]['id']}})[_0x3030('0x3a')](handleEntityNotFound(_0xe48f28,null))[_0x3030('0x3a')](saveUpdates(_0x2c19d2[_0x3030('0x44')],null))[_0x3030('0x3a')](respondWithResult(_0xe48f28,null))[_0x3030('0x3e')](handleError(_0xe48f28,null));};exports[_0x3030('0x45')]=function(_0x4f4593,_0x15de23){return db['FreshsalesConfiguration'][_0x3030('0x42')]({'where':{'id':_0x4f4593[_0x3030('0x40')]['id']}})[_0x3030('0x3a')](handleEntityNotFound(_0x15de23,null))[_0x3030('0x3a')](removeEntity(_0x15de23,null))[_0x3030('0x3e')](handleError(_0x15de23,null));};exports[_0x3030('0x46')]=function(_0x43b63c,_0x5061e0,_0x5ccecc){var _0x4fc177={};var _0x27fe36={};var _0x49ecb1;var _0x121aa7;return db['FreshsalesConfiguration'][_0x3030('0x47')]({'where':{'id':_0x43b63c[_0x3030('0x40')]['id']}})['then'](handleEntityNotFound(_0x5061e0,null))[_0x3030('0x3a')](function(_0x2d9a82){if(_0x2d9a82){_0x49ecb1=_0x2d9a82;_0x27fe36['model']=_[_0x3030('0x2c')](db['FreshsalesField'][_0x3030('0x2a')]);_0x27fe36[_0x3030('0x2d')]=_[_0x3030('0x2c')](_0x43b63c[_0x3030('0x2d')]);_0x27fe36[_0x3030('0x2e')]=_['intersection'](_0x27fe36[_0x3030('0x2b')],_0x27fe36[_0x3030('0x2d')]);_0x4fc177[_0x3030('0x30')]=_[_0x3030('0x2f')](_0x27fe36[_0x3030('0x2b')],qs[_0x3030('0x31')](_0x43b63c[_0x3030('0x2d')][_0x3030('0x31')]));_0x4fc177[_0x3030('0x30')]=_0x4fc177['attributes'][_0x3030('0x41')]?_0x4fc177[_0x3030('0x30')]:_0x27fe36[_0x3030('0x2b')];_0x4fc177[_0x3030('0x48')]=qs[_0x3030('0x34')](_0x43b63c[_0x3030('0x2d')][_0x3030('0x34')]);_0x4fc177[_0x3030('0x36')]=qs[_0x3030('0x2e')](_[_0x3030('0x49')](_0x43b63c[_0x3030('0x2d')],_0x27fe36[_0x3030('0x2e')]));if(_0x43b63c[_0x3030('0x2d')]['filter']){_0x4fc177[_0x3030('0x36')]=_['merge'](_0x4fc177['where'],{'$or':_['map'](_0x4fc177['attributes'],function(_0x371cdc){var _0x378b7f={};_0x378b7f[_0x371cdc]={'$like':'%'+_0x43b63c['query'][_0x3030('0x35')]+'%'};return _0x378b7f;})});}_0x4fc177=_[_0x3030('0x37')]({},_0x4fc177,_0x43b63c[_0x3030('0x39')]);return _0x49ecb1['getSubjects'](_0x4fc177);}})[_0x3030('0x3a')](function(_0x231d98){if(_0x231d98){_0x121aa7=_0x231d98['length'];if(!_0x43b63c['query'][_0x3030('0x32')](_0x3030('0x33'))){_0x4fc177[_0x3030('0x1d')]=qs['limit'](_0x43b63c['query'][_0x3030('0x1d')]);_0x4fc177[_0x3030('0x1b')]=qs[_0x3030('0x1b')](_0x43b63c['query'][_0x3030('0x1b')]);}return _0x49ecb1[_0x3030('0x46')](_0x4fc177);}})[_0x3030('0x3a')](function(_0x3eeee3){if(_0x3eeee3){return _0x3eeee3?{'count':_0x121aa7,'rows':_0x3eeee3}:null;}})[_0x3030('0x3a')](respondWithResult(_0x5061e0,null))[_0x3030('0x3e')](handleError(_0x5061e0,null));};exports['getDescriptions']=function(_0x1b5293,_0x3a963f,_0x3eda44){var _0x454eda={};var _0x39ec0b={};var _0x2571c9;var _0x4c0305;return db['FreshsalesConfiguration'][_0x3030('0x47')]({'where':{'id':_0x1b5293[_0x3030('0x40')]['id']}})[_0x3030('0x3a')](handleEntityNotFound(_0x3a963f,null))[_0x3030('0x3a')](function(_0x51972a){if(_0x51972a){_0x2571c9=_0x51972a;_0x39ec0b[_0x3030('0x2b')]=_['keys'](db[_0x3030('0x4a')][_0x3030('0x2a')]);_0x39ec0b[_0x3030('0x2d')]=_[_0x3030('0x2c')](_0x1b5293[_0x3030('0x2d')]);_0x39ec0b[_0x3030('0x2e')]=_[_0x3030('0x2f')](_0x39ec0b[_0x3030('0x2b')],_0x39ec0b[_0x3030('0x2d')]);_0x454eda[_0x3030('0x30')]=_[_0x3030('0x2f')](_0x39ec0b['model'],qs[_0x3030('0x31')](_0x1b5293['query'][_0x3030('0x31')]));_0x454eda[_0x3030('0x30')]=_0x454eda[_0x3030('0x30')]['length']?_0x454eda['attributes']:_0x39ec0b[_0x3030('0x2b')];_0x454eda[_0x3030('0x48')]=qs[_0x3030('0x34')](_0x1b5293[_0x3030('0x2d')][_0x3030('0x34')]);_0x454eda['where']=qs[_0x3030('0x2e')](_[_0x3030('0x49')](_0x1b5293['query'],_0x39ec0b[_0x3030('0x2e')]));if(_0x1b5293[_0x3030('0x2d')][_0x3030('0x35')]){_0x454eda[_0x3030('0x36')]=_['merge'](_0x454eda[_0x3030('0x36')],{'$or':_['map'](_0x454eda[_0x3030('0x30')],function(_0x3d673b){var _0x48abaf={};_0x48abaf[_0x3d673b]={'$like':'%'+_0x1b5293[_0x3030('0x2d')]['filter']+'%'};return _0x48abaf;})});}_0x454eda=_['merge']({},_0x454eda,_0x1b5293[_0x3030('0x39')]);return _0x2571c9['getDescriptions'](_0x454eda);}})['then'](function(_0x38c60d){if(_0x38c60d){_0x4c0305=_0x38c60d[_0x3030('0x41')];if(!_0x1b5293[_0x3030('0x2d')][_0x3030('0x32')](_0x3030('0x33'))){_0x454eda[_0x3030('0x1d')]=qs[_0x3030('0x1d')](_0x1b5293['query'][_0x3030('0x1d')]);_0x454eda[_0x3030('0x1b')]=qs[_0x3030('0x1b')](_0x1b5293[_0x3030('0x2d')][_0x3030('0x1b')]);}return _0x2571c9[_0x3030('0x4b')](_0x454eda);}})[_0x3030('0x3a')](function(_0x404d59){if(_0x404d59){return _0x404d59?{'count':_0x4c0305,'rows':_0x404d59}:null;}})[_0x3030('0x3a')](respondWithResult(_0x3a963f,null))[_0x3030('0x3e')](handleError(_0x3a963f,null));};exports[_0x3030('0x4c')]=function(_0x2f0e71,_0x12dcd2,_0x50d2a1){var _0x354469={};var _0x22e217={};var _0x1e727b;var _0x443097;return db[_0x3030('0x29')]['findOne']({'where':{'id':_0x2f0e71[_0x3030('0x40')]['id']}})[_0x3030('0x3a')](handleEntityNotFound(_0x12dcd2,null))['then'](function(_0x2f5802){if(_0x2f5802){_0x1e727b=_0x2f5802;_0x22e217['model']=_[_0x3030('0x2c')](db['FreshsalesField'][_0x3030('0x2a')]);_0x22e217[_0x3030('0x2d')]=_[_0x3030('0x2c')](_0x2f0e71[_0x3030('0x2d')]);_0x22e217[_0x3030('0x2e')]=_[_0x3030('0x2f')](_0x22e217['model'],_0x22e217[_0x3030('0x2d')]);_0x354469['attributes']=_[_0x3030('0x2f')](_0x22e217[_0x3030('0x2b')],qs['fields'](_0x2f0e71[_0x3030('0x2d')][_0x3030('0x31')]));_0x354469['attributes']=_0x354469[_0x3030('0x30')][_0x3030('0x41')]?_0x354469[_0x3030('0x30')]:_0x22e217['model'];_0x354469[_0x3030('0x48')]=qs[_0x3030('0x34')](_0x2f0e71['query'][_0x3030('0x34')]);_0x354469[_0x3030('0x36')]=qs['filters'](_[_0x3030('0x49')](_0x2f0e71['query'],_0x22e217[_0x3030('0x2e')]));if(_0x2f0e71[_0x3030('0x2d')][_0x3030('0x35')]){_0x354469[_0x3030('0x36')]=_['merge'](_0x354469[_0x3030('0x36')],{'$or':_[_0x3030('0x28')](_0x354469[_0x3030('0x30')],function(_0x412e03){var _0x39ce86={};_0x39ce86[_0x412e03]={'$like':'%'+_0x2f0e71[_0x3030('0x2d')]['filter']+'%'};return _0x39ce86;})});}_0x354469=_[_0x3030('0x37')]({},_0x354469,_0x2f0e71[_0x3030('0x39')]);return _0x1e727b[_0x3030('0x4c')](_0x354469);}})[_0x3030('0x3a')](function(_0x3750a0){if(_0x3750a0){_0x443097=_0x3750a0['length'];if(!_0x2f0e71[_0x3030('0x2d')][_0x3030('0x32')](_0x3030('0x33'))){_0x354469[_0x3030('0x1d')]=qs[_0x3030('0x1d')](_0x2f0e71[_0x3030('0x2d')]['limit']);_0x354469['offset']=qs[_0x3030('0x1b')](_0x2f0e71[_0x3030('0x2d')]['offset']);}return _0x1e727b['getFields'](_0x354469);}})['then'](function(_0x3ab141){if(_0x3ab141){return _0x3ab141?{'count':_0x443097,'rows':_0x3ab141}:null;}})[_0x3030('0x3a')](respondWithResult(_0x12dcd2,null))[_0x3030('0x3e')](handleError(_0x12dcd2,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b83a003..d060872 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 _0x0aaf=['./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aaf,0x155));var _0xf0aa=function(_0x1d2195,_0x4b8096){_0x1d2195=_0x1d2195-0x0;var _0x4962cd=_0x0aaf[_0x1d2195];return _0x4962cd;};'use strict';var _=require(_0xf0aa('0x0'));var util=require(_0xf0aa('0x1'));var logger=require('../../config/logger')(_0xf0aa('0x2'));var moment=require(_0xf0aa('0x3'));var BPromise=require(_0xf0aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0aa('0x5'));var rimraf=require('rimraf');var config=require(_0xf0aa('0x6'));var attributes=require(_0xf0aa('0x7'));module[_0xf0aa('0x8')]=function(_0x5493f9,_0x59315a){return _0x5493f9[_0xf0aa('0x9')](_0xf0aa('0xa'),attributes,{'tableName':_0xf0aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9290=['util','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','lodash'];(function(_0x569f1e,_0x1d19c5){var _0x5c1d69=function(_0x48b47c){while(--_0x48b47c){_0x569f1e['push'](_0x569f1e['shift']());}};_0x5c1d69(++_0x1d19c5);}(_0x9290,0x6b));var _0x0929=function(_0x209603,_0x351b88){_0x209603=_0x209603-0x0;var _0x3e06d4=_0x9290[_0x209603];return _0x3e06d4;};'use strict';var _=require(_0x0929('0x0'));var util=require(_0x0929('0x1'));var logger=require(_0x0929('0x2'))(_0x0929('0x3'));var moment=require(_0x0929('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0929('0x5'));var config=require(_0x0929('0x6'));var attributes=require(_0x0929('0x7'));module['exports']=function(_0x49b075,_0x354aee){return _0x49b075['define'](_0x0929('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 1168859..9cf82d0 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 _0xf7e7=['message','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xf7e7,0x1d0));var _0x7f7e=function(_0x247364,_0x1b8168){_0x247364=_0x247364-0x0;var _0x4a720e=_0xf7e7[_0x247364];return _0x4a720e;};'use strict';var _=require('lodash');var util=require(_0x7f7e('0x0'));var moment=require(_0x7f7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f7e('0x2'));var fs=require('fs');var Redis=require(_0x7f7e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f7e('0x4'));var logger=require(_0x7f7e('0x5'))(_0x7f7e('0x6'));var config=require(_0x7f7e('0x7'));var jayson=require(_0x7f7e('0x8'));var client=jayson[_0x7f7e('0x9')][_0x7f7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x131245,_0x11f4fb,_0x54674a){return new BPromise(function(_0x45f09f,_0x4e0f11){return client[_0x7f7e('0xb')](_0x131245,_0x54674a)[_0x7f7e('0xc')](function(_0x3f4386){logger[_0x7f7e('0xd')](_0x7f7e('0xe'),_0x11f4fb,'request\x20sent');logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x11f4fb,_0x7f7e('0xf'),JSON[_0x7f7e('0x10')](_0x3f4386));if(_0x3f4386[_0x7f7e('0x11')]){if(_0x3f4386[_0x7f7e('0x11')][_0x7f7e('0x12')]===0x1f4){logger[_0x7f7e('0x11')](_0x7f7e('0xe'),_0x11f4fb,_0x3f4386['error'][_0x7f7e('0x13')]);return _0x4e0f11(_0x3f4386[_0x7f7e('0x11')][_0x7f7e('0x13')]);}logger[_0x7f7e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x11f4fb,_0x3f4386[_0x7f7e('0x11')][_0x7f7e('0x13')]);return _0x45f09f(_0x3f4386[_0x7f7e('0x11')][_0x7f7e('0x13')]);}else{logger[_0x7f7e('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x11f4fb,_0x7f7e('0xf'));_0x45f09f(_0x3f4386['result'][_0x7f7e('0x13')]);}})[_0x7f7e('0x14')](function(_0x1d180d){logger['error'](_0x7f7e('0xe'),_0x11f4fb,_0x1d180d);_0x4e0f11(_0x1d180d);});});} \ No newline at end of file +var _0xbefc=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x1cd8b8,_0x1a80a2){var _0xabf2b4=function(_0x39b584){while(--_0x39b584){_0x1cd8b8['push'](_0x1cd8b8['shift']());}};_0xabf2b4(++_0x1a80a2);}(_0xbefc,0x7c));var _0xcbef=function(_0x241bf1,_0x4f2b0d){_0x241bf1=_0x241bf1-0x0;var _0x3fd6a1=_0xbefc[_0x241bf1];return _0x3fd6a1;};'use strict';var _=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var moment=require(_0xcbef('0x2'));var BPromise=require(_0xcbef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbef('0x4'))['db'];var utils=require(_0xcbef('0x5'));var logger=require('../../config/logger')(_0xcbef('0x6'));var config=require(_0xcbef('0x7'));var jayson=require(_0xcbef('0x8'));var client=jayson[_0xcbef('0x9')][_0xcbef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13bf93,_0x8fe683,_0x328fdf){return new BPromise(function(_0x5126e9,_0x316142){return client[_0xcbef('0xb')](_0x13bf93,_0x328fdf)['then'](function(_0x3753d8){logger[_0xcbef('0xc')](_0xcbef('0xd'),_0x8fe683,'request\x20sent');logger['debug'](_0xcbef('0xe'),_0x8fe683,_0xcbef('0xf'),JSON[_0xcbef('0x10')](_0x3753d8));if(_0x3753d8[_0xcbef('0x11')]){if(_0x3753d8['error']['code']===0x1f4){logger[_0xcbef('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x8fe683,_0x3753d8[_0xcbef('0x11')][_0xcbef('0x12')]);return _0x316142(_0x3753d8[_0xcbef('0x11')][_0xcbef('0x12')]);}logger[_0xcbef('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x8fe683,_0x3753d8[_0xcbef('0x11')][_0xcbef('0x12')]);return _0x5126e9(_0x3753d8[_0xcbef('0x11')][_0xcbef('0x12')]);}else{logger[_0xcbef('0xc')](_0xcbef('0xd'),_0x8fe683,_0xcbef('0xf'));_0x5126e9(_0x3753d8[_0xcbef('0x13')]['message']);}})[_0xcbef('0x14')](function(_0x42d03e){logger[_0xcbef('0x11')](_0xcbef('0xd'),_0x8fe683,_0x42d03e);_0x316142(_0x42d03e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 7065211..0c61aba 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 _0xd49c=['../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x20ea89,_0x1bfce6){var _0x1f06a8=function(_0xc541ce){while(--_0xc541ce){_0x20ea89['push'](_0x20ea89['shift']());}};_0x1f06a8(++_0x1bfce6);}(_0xd49c,0x1d8));var _0xcd49=function(_0x131c55,_0x29ecdd){_0x131c55=_0x131c55-0x0;var _0x444320=_0xd49c[_0x131c55];return _0x444320;};'use strict';var multer=require('multer');var util=require(_0xcd49('0x0'));var path=require('path');var timeout=require(_0xcd49('0x1'));var express=require(_0xcd49('0x2'));var router=express['Router']();var fs_extra=require(_0xcd49('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcd49('0x4'));var config=require('../../config/environment');var controller=require(_0xcd49('0x5'));router[_0xcd49('0x6')]('/',auth[_0xcd49('0x7')](),controller[_0xcd49('0x8')]);router[_0xcd49('0x6')](_0xcd49('0x9'),auth[_0xcd49('0x7')](),controller[_0xcd49('0xa')]);router[_0xcd49('0xb')]('/',auth[_0xcd49('0x7')](),controller[_0xcd49('0xc')]);router['put'](_0xcd49('0x9'),auth[_0xcd49('0x7')](),controller[_0xcd49('0xd')]);router[_0xcd49('0xe')](_0xcd49('0x9'),auth[_0xcd49('0x7')](),controller[_0xcd49('0xf')]);module[_0xcd49('0x10')]=router; \ No newline at end of file +var _0x2060=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated','index','/:id','post','create'];(function(_0x7a5efe,_0x27b521){var _0x1da481=function(_0x12edda){while(--_0x12edda){_0x7a5efe['push'](_0x7a5efe['shift']());}};_0x1da481(++_0x27b521);}(_0x2060,0x1be));var _0x0206=function(_0x136235,_0xcdfa4f){_0x136235=_0x136235-0x0;var _0x3b8a09=_0x2060[_0x136235];return _0x3b8a09;};'use strict';var multer=require(_0x0206('0x0'));var util=require('util');var path=require(_0x0206('0x1'));var timeout=require(_0x0206('0x2'));var express=require(_0x0206('0x3'));var router=express[_0x0206('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0206('0x5'));var interaction=require(_0x0206('0x6'));var config=require('../../config/environment');var controller=require(_0x0206('0x7'));router['get']('/',auth[_0x0206('0x8')](),controller[_0x0206('0x9')]);router['get'](_0x0206('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0206('0xb')]('/',auth[_0x0206('0x8')](),controller[_0x0206('0xc')]);router[_0x0206('0xd')](_0x0206('0xa'),auth[_0x0206('0x8')](),controller[_0x0206('0xe')]);router[_0x0206('0xf')](_0x0206('0xa'),auth[_0x0206('0x8')](),controller[_0x0206('0x10')]);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 bacaef2..d0fe828 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 _0x6ec4=['keyValue','STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6ec4,0x194));var _0x46ec=function(_0x253ac6,_0x2c4e61){_0x253ac6=_0x253ac6-0x0;var _0x53c386=_0x6ec4[_0x253ac6];return _0x53c386;};'use strict';var Sequelize=require(_0x46ec('0x0'));module['exports']={'type':{'type':Sequelize[_0x46ec('0x1')](_0x46ec('0x2'),'variable',_0x46ec('0x3'),_0x46ec('0x4'),'picklist'),'defaultValue':_0x46ec('0x2')},'content':{'type':Sequelize[_0x46ec('0x5')]},'key':{'type':Sequelize[_0x46ec('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x46ec('0x6'),_0x46ec('0x3'))},'keyContent':{'type':Sequelize[_0x46ec('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x46ec('0x5')]},'customField':{'type':Sequelize[_0x46ec('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x46ec('0x5')]}}; \ No newline at end of file +var _0x5b4e=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x22d159,_0x1a488f){var _0xf6114a=function(_0x284f9c){while(--_0x284f9c){_0x22d159['push'](_0x22d159['shift']());}};_0xf6114a(++_0x1a488f);}(_0x5b4e,0x14d));var _0xe5b4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5b4e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xe5b4('0x0'));module[_0xe5b4('0x1')]={'type':{'type':Sequelize[_0xe5b4('0x2')](_0xe5b4('0x3'),_0xe5b4('0x4'),'customVariable',_0xe5b4('0x5'),_0xe5b4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe5b4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe5b4('0x2')]('string',_0xe5b4('0x4'),_0xe5b4('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe5b4('0x7')]},'nameField':{'type':Sequelize[_0xe5b4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index e4ed136..a1676f1 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 _0xcad3=['mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','stack','name','FreshsalesField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x536a73,_0x5cce8b){var _0x112420=function(_0x23891e){while(--_0x23891e){_0x536a73['push'](_0x536a73['shift']());}};_0x112420(++_0x5cce8b);}(_0xcad3,0xdb));var _0x3cad=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0xcad3[_0x19dd7a];return _0x3feb6a;};'use strict';var emlformat=require(_0x3cad('0x0'));var rimraf=require(_0x3cad('0x1'));var zipdir=require(_0x3cad('0x2'));var jsonpatch=require(_0x3cad('0x3'));var rp=require('request-promise');var moment=require(_0x3cad('0x4'));var BPromise=require(_0x3cad('0x5'));var Mustache=require(_0x3cad('0x6'));var util=require(_0x3cad('0x7'));var path=require(_0x3cad('0x8'));var sox=require(_0x3cad('0x9'));var csv=require(_0x3cad('0xa'));var ejs=require(_0x3cad('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3cad('0xc'));var deskjs=require(_0x3cad('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3cad('0xe'));var Papa=require(_0x3cad('0xf'));var Redis=require('ioredis');var authService=require(_0x3cad('0x10'));var qs=require(_0x3cad('0x11'));var as=require(_0x3cad('0x12'));var hardwareService=require(_0x3cad('0x13'));var logger=require('../../config/logger')(_0x3cad('0x14'));var utils=require(_0x3cad('0x15'));var config=require(_0x3cad('0x16'));var licenseUtil=require(_0x3cad('0x17'));var db=require(_0x3cad('0x18'))['db'];function respondWithStatusCode(_0x534386,_0x2d811a){_0x2d811a=_0x2d811a||0xcc;return function(_0x28017a){if(_0x28017a){return _0x534386[_0x3cad('0x19')](_0x2d811a);}return _0x534386[_0x3cad('0x1a')](_0x2d811a)[_0x3cad('0x1b')]();};}function respondWithResult(_0x422d55,_0x38b6df){_0x38b6df=_0x38b6df||0xc8;return function(_0x1ab890){if(_0x1ab890){return _0x422d55['status'](_0x38b6df)[_0x3cad('0x1c')](_0x1ab890);}};}function respondWithFilteredResult(_0x30b9b9,_0x5069ea){return function(_0x1a17cf){if(_0x1a17cf){var _0x27eca9=typeof _0x5069ea['offset']===_0x3cad('0x1d')&&typeof _0x5069ea[_0x3cad('0x1e')]===_0x3cad('0x1d');var _0x50e1b2=_0x1a17cf[_0x3cad('0x1f')];var _0x278822=_0x27eca9?0x0:_0x5069ea['offset'];var _0x24ce2c=_0x27eca9?_0x1a17cf[_0x3cad('0x1f')]:_0x5069ea[_0x3cad('0x20')]+_0x5069ea[_0x3cad('0x1e')];var _0x59109e;if(_0x24ce2c>=_0x50e1b2){_0x24ce2c=_0x50e1b2;_0x59109e=0xc8;}else{_0x59109e=0xce;}_0x30b9b9[_0x3cad('0x1a')](_0x59109e);return _0x30b9b9[_0x3cad('0x21')](_0x3cad('0x22'),_0x278822+'-'+_0x24ce2c+'/'+_0x50e1b2)[_0x3cad('0x1c')](_0x1a17cf);}return null;};}function patchUpdates(_0x28c281){return function(_0x255162){try{jsonpatch['apply'](_0x255162,_0x28c281,!![]);}catch(_0x54cd4c){return BPromise[_0x3cad('0x23')](_0x54cd4c);}return _0x255162[_0x3cad('0x24')]();};}function saveUpdates(_0x2d7479,_0x4ee4f4){return function(_0xed2b80){if(_0xed2b80){return _0xed2b80['update'](_0x2d7479)[_0x3cad('0x25')](function(_0x57b151){return _0x57b151;});}return null;};}function removeEntity(_0x35a1a9,_0x3fc503){return function(_0x102b6c){if(_0x102b6c){return _0x102b6c[_0x3cad('0x26')]()['then'](function(){_0x35a1a9[_0x3cad('0x1a')](0xcc)[_0x3cad('0x1b')]();});}};}function handleEntityNotFound(_0x314f43,_0x2bbde6){return function(_0x2eec05){if(!_0x2eec05){_0x314f43[_0x3cad('0x19')](0x194);}return _0x2eec05;};}function handleError(_0x529faf,_0x43b94a){_0x43b94a=_0x43b94a||0x1f4;return function(_0x23177b){logger['error'](_0x23177b[_0x3cad('0x27')]);if(_0x23177b[_0x3cad('0x28')]){delete _0x23177b[_0x3cad('0x28')];}_0x529faf[_0x3cad('0x1a')](_0x43b94a)['send'](_0x23177b);};}exports['index']=function(_0x1f789e,_0x43c603){var _0x41b600={},_0x3b4e89={},_0x4f233b={'count':0x0,'rows':[]};var _0x42b2c2=_['map'](db[_0x3cad('0x29')][_0x3cad('0x2a')],function(_0x38bc88){return{'name':_0x38bc88[_0x3cad('0x2b')],'type':_0x38bc88[_0x3cad('0x2c')]['key']};});_0x3b4e89['model']=_['map'](_0x42b2c2,_0x3cad('0x28'));_0x3b4e89[_0x3cad('0x2d')]=_[_0x3cad('0x2e')](_0x1f789e['query']);_0x3b4e89['filters']=_[_0x3cad('0x2f')](_0x3b4e89[_0x3cad('0x30')],_0x3b4e89[_0x3cad('0x2d')]);_0x41b600[_0x3cad('0x31')]=_['intersection'](_0x3b4e89[_0x3cad('0x30')],qs[_0x3cad('0x32')](_0x1f789e['query'][_0x3cad('0x32')]));_0x41b600[_0x3cad('0x31')]=_0x41b600[_0x3cad('0x31')][_0x3cad('0x33')]?_0x41b600[_0x3cad('0x31')]:_0x3b4e89[_0x3cad('0x30')];if(!_0x1f789e[_0x3cad('0x2d')][_0x3cad('0x34')](_0x3cad('0x35'))){_0x41b600['limit']=qs[_0x3cad('0x1e')](_0x1f789e[_0x3cad('0x2d')][_0x3cad('0x1e')]);_0x41b600[_0x3cad('0x20')]=qs[_0x3cad('0x20')](_0x1f789e[_0x3cad('0x2d')]['offset']);}_0x41b600[_0x3cad('0x36')]=qs[_0x3cad('0x37')](_0x1f789e[_0x3cad('0x2d')][_0x3cad('0x37')]);_0x41b600[_0x3cad('0x38')]=qs[_0x3cad('0x39')](_[_0x3cad('0x3a')](_0x1f789e[_0x3cad('0x2d')],_0x3b4e89[_0x3cad('0x39')]),_0x42b2c2);if(_0x1f789e[_0x3cad('0x2d')][_0x3cad('0x3b')]){_0x41b600[_0x3cad('0x38')]=_[_0x3cad('0x3c')](_0x41b600[_0x3cad('0x38')],{'$or':_[_0x3cad('0x3d')](_0x42b2c2,function(_0x1a735b){if(_0x1a735b['type']!==_0x3cad('0x3e')){var _0x3df0ed={};_0x3df0ed[_0x1a735b['name']]={'$like':'%'+_0x1f789e['query'][_0x3cad('0x3b')]+'%'};return _0x3df0ed;}})});}_0x41b600=_[_0x3cad('0x3c')]({},_0x41b600,_0x1f789e[_0x3cad('0x3f')]);var _0x13273b={'where':_0x41b600[_0x3cad('0x38')]};return db[_0x3cad('0x29')]['count'](_0x13273b)[_0x3cad('0x25')](function(_0x5cccdd){_0x4f233b['count']=_0x5cccdd;if(_0x1f789e['query'][_0x3cad('0x40')]){_0x41b600[_0x3cad('0x41')]=[{'all':!![]}];}return db[_0x3cad('0x29')][_0x3cad('0x42')](_0x41b600);})[_0x3cad('0x25')](function(_0x20ac41){_0x4f233b[_0x3cad('0x43')]=_0x20ac41;return _0x4f233b;})['then'](respondWithFilteredResult(_0x43c603,_0x41b600))['catch'](handleError(_0x43c603,null));};exports[_0x3cad('0x44')]=function(_0x3ccf68,_0x4059f1){var _0x42748b={'raw':!![],'where':{'id':_0x3ccf68['params']['id']}},_0x51c313={};_0x51c313[_0x3cad('0x30')]=_['keys'](db['FreshsalesField'][_0x3cad('0x2a')]);_0x51c313['query']=_[_0x3cad('0x2e')](_0x3ccf68[_0x3cad('0x2d')]);_0x51c313[_0x3cad('0x39')]=_[_0x3cad('0x2f')](_0x51c313[_0x3cad('0x30')],_0x51c313[_0x3cad('0x2d')]);_0x42748b[_0x3cad('0x31')]=_[_0x3cad('0x2f')](_0x51c313[_0x3cad('0x30')],qs['fields'](_0x3ccf68[_0x3cad('0x2d')][_0x3cad('0x32')]));_0x42748b[_0x3cad('0x31')]=_0x42748b[_0x3cad('0x31')][_0x3cad('0x33')]?_0x42748b['attributes']:_0x51c313[_0x3cad('0x30')];if(_0x3ccf68[_0x3cad('0x2d')][_0x3cad('0x40')]){_0x42748b[_0x3cad('0x41')]=[{'all':!![]}];}_0x42748b=_[_0x3cad('0x3c')]({},_0x42748b,_0x3ccf68[_0x3cad('0x3f')]);return db['FreshsalesField'][_0x3cad('0x45')](_0x42748b)[_0x3cad('0x25')](handleEntityNotFound(_0x4059f1,null))['then'](respondWithResult(_0x4059f1,null))[_0x3cad('0x46')](handleError(_0x4059f1,null));};exports[_0x3cad('0x47')]=function(_0x499e13,_0x22b541){return db['FreshsalesField'][_0x3cad('0x47')](_0x499e13[_0x3cad('0x48')],{})[_0x3cad('0x25')](respondWithResult(_0x22b541,0xc9))[_0x3cad('0x46')](handleError(_0x22b541,null));};exports[_0x3cad('0x49')]=function(_0xf38e53,_0x35e07d){if(_0xf38e53[_0x3cad('0x48')]['id']){delete _0xf38e53[_0x3cad('0x48')]['id'];}return db[_0x3cad('0x29')][_0x3cad('0x45')]({'where':{'id':_0xf38e53[_0x3cad('0x4a')]['id']}})[_0x3cad('0x25')](handleEntityNotFound(_0x35e07d,null))['then'](saveUpdates(_0xf38e53['body'],null))[_0x3cad('0x25')](respondWithResult(_0x35e07d,null))[_0x3cad('0x46')](handleError(_0x35e07d,null));};exports['destroy']=function(_0x4be75e,_0x267140){return db[_0x3cad('0x29')]['find']({'where':{'id':_0x4be75e[_0x3cad('0x4a')]['id']}})[_0x3cad('0x25')](handleEntityNotFound(_0x267140,null))['then'](removeEntity(_0x267140,null))[_0x3cad('0x46')](handleError(_0x267140,null));}; \ No newline at end of file +var _0x779f=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','end','name','send','index','map','FreshsalesField','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x779f,0x198));var _0xf779=function(_0x5de6fb,_0x70a379){_0x5de6fb=_0x5de6fb-0x0;var _0x3a1058=_0x779f[_0x5de6fb];return _0x3a1058;};'use strict';var emlformat=require(_0xf779('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf779('0x1'));var jsonpatch=require(_0xf779('0x2'));var rp=require('request-promise');var moment=require(_0xf779('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf779('0x4'));var path=require(_0xf779('0x5'));var sox=require(_0xf779('0x6'));var csv=require(_0xf779('0x7'));var ejs=require(_0xf779('0x8'));var fs=require('fs');var fs_extra=require(_0xf779('0x9'));var _=require(_0xf779('0xa'));var squel=require(_0xf779('0xb'));var crypto=require(_0xf779('0xc'));var jsforce=require(_0xf779('0xd'));var deskjs=require(_0xf779('0xe'));var toCsv=require(_0xf779('0x7'));var querystring=require(_0xf779('0xf'));var Papa=require(_0xf779('0x10'));var Redis=require(_0xf779('0x11'));var authService=require(_0xf779('0x12'));var qs=require(_0xf779('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf779('0x14'));var logger=require(_0xf779('0x15'))(_0xf779('0x16'));var utils=require(_0xf779('0x17'));var config=require(_0xf779('0x18'));var licenseUtil=require(_0xf779('0x19'));var db=require(_0xf779('0x1a'))['db'];function respondWithStatusCode(_0x210571,_0x310f25){_0x310f25=_0x310f25||0xcc;return function(_0x1b02f){if(_0x1b02f){return _0x210571[_0xf779('0x1b')](_0x310f25);}return _0x210571['status'](_0x310f25)['end']();};}function respondWithResult(_0x5680f2,_0x595c51){_0x595c51=_0x595c51||0xc8;return function(_0x39f4cf){if(_0x39f4cf){return _0x5680f2[_0xf779('0x1c')](_0x595c51)[_0xf779('0x1d')](_0x39f4cf);}};}function respondWithFilteredResult(_0x195f17,_0x241885){return function(_0xeb179b){if(_0xeb179b){var _0x363421=typeof _0x241885[_0xf779('0x1e')]===_0xf779('0x1f')&&typeof _0x241885[_0xf779('0x20')]===_0xf779('0x1f');var _0x2a5ccc=_0xeb179b[_0xf779('0x21')];var _0x37aee6=_0x363421?0x0:_0x241885[_0xf779('0x1e')];var _0xd6051b=_0x363421?_0xeb179b[_0xf779('0x21')]:_0x241885[_0xf779('0x1e')]+_0x241885[_0xf779('0x20')];var _0xc3708b;if(_0xd6051b>=_0x2a5ccc){_0xd6051b=_0x2a5ccc;_0xc3708b=0xc8;}else{_0xc3708b=0xce;}_0x195f17[_0xf779('0x1c')](_0xc3708b);return _0x195f17['set'](_0xf779('0x22'),_0x37aee6+'-'+_0xd6051b+'/'+_0x2a5ccc)['json'](_0xeb179b);}return null;};}function patchUpdates(_0x478d90){return function(_0x1fdb5c){try{jsonpatch['apply'](_0x1fdb5c,_0x478d90,!![]);}catch(_0x5de8ad){return BPromise['reject'](_0x5de8ad);}return _0x1fdb5c[_0xf779('0x23')]();};}function saveUpdates(_0x36f394,_0x3ef426){return function(_0x33166f){if(_0x33166f){return _0x33166f[_0xf779('0x24')](_0x36f394)[_0xf779('0x25')](function(_0x22911c){return _0x22911c;});}return null;};}function removeEntity(_0x3e56c4,_0x1ff6a1){return function(_0x355d3c){if(_0x355d3c){return _0x355d3c['destroy']()[_0xf779('0x25')](function(){_0x3e56c4['status'](0xcc)[_0xf779('0x26')]();});}};}function handleEntityNotFound(_0x176d60,_0x59870a){return function(_0x3c17f7){if(!_0x3c17f7){_0x176d60[_0xf779('0x1b')](0x194);}return _0x3c17f7;};}function handleError(_0x51a5ad,_0x52e8dd){_0x52e8dd=_0x52e8dd||0x1f4;return function(_0x232873){logger['error'](_0x232873['stack']);if(_0x232873[_0xf779('0x27')]){delete _0x232873[_0xf779('0x27')];}_0x51a5ad[_0xf779('0x1c')](_0x52e8dd)[_0xf779('0x28')](_0x232873);};}exports[_0xf779('0x29')]=function(_0x437d7f,_0x451f91){var _0x136c09={},_0x21a77f={},_0x1bc1cd={'count':0x0,'rows':[]};var _0x46a053=_[_0xf779('0x2a')](db[_0xf779('0x2b')]['rawAttributes'],function(_0x4ed797){return{'name':_0x4ed797[_0xf779('0x2c')],'type':_0x4ed797['type']['key']};});_0x21a77f[_0xf779('0x2d')]=_[_0xf779('0x2a')](_0x46a053,_0xf779('0x27'));_0x21a77f['query']=_['keys'](_0x437d7f[_0xf779('0x2e')]);_0x21a77f[_0xf779('0x2f')]=_[_0xf779('0x30')](_0x21a77f[_0xf779('0x2d')],_0x21a77f[_0xf779('0x2e')]);_0x136c09[_0xf779('0x31')]=_[_0xf779('0x30')](_0x21a77f[_0xf779('0x2d')],qs[_0xf779('0x32')](_0x437d7f['query'][_0xf779('0x32')]));_0x136c09[_0xf779('0x31')]=_0x136c09[_0xf779('0x31')]['length']?_0x136c09[_0xf779('0x31')]:_0x21a77f[_0xf779('0x2d')];if(!_0x437d7f[_0xf779('0x2e')][_0xf779('0x33')]('nolimit')){_0x136c09[_0xf779('0x20')]=qs[_0xf779('0x20')](_0x437d7f[_0xf779('0x2e')][_0xf779('0x20')]);_0x136c09[_0xf779('0x1e')]=qs['offset'](_0x437d7f[_0xf779('0x2e')]['offset']);}_0x136c09['order']=qs[_0xf779('0x34')](_0x437d7f['query']['sort']);_0x136c09[_0xf779('0x35')]=qs[_0xf779('0x2f')](_[_0xf779('0x36')](_0x437d7f[_0xf779('0x2e')],_0x21a77f[_0xf779('0x2f')]),_0x46a053);if(_0x437d7f[_0xf779('0x2e')]['filter']){_0x136c09[_0xf779('0x35')]=_[_0xf779('0x37')](_0x136c09[_0xf779('0x35')],{'$or':_[_0xf779('0x2a')](_0x46a053,function(_0x2029f0){if(_0x2029f0['type']!==_0xf779('0x38')){var _0x19784f={};_0x19784f[_0x2029f0[_0xf779('0x27')]]={'$like':'%'+_0x437d7f[_0xf779('0x2e')]['filter']+'%'};return _0x19784f;}})});}_0x136c09=_['merge']({},_0x136c09,_0x437d7f[_0xf779('0x39')]);var _0x559ecd={'where':_0x136c09[_0xf779('0x35')]};return db[_0xf779('0x2b')][_0xf779('0x21')](_0x559ecd)[_0xf779('0x25')](function(_0x94cbec){_0x1bc1cd[_0xf779('0x21')]=_0x94cbec;if(_0x437d7f['query'][_0xf779('0x3a')]){_0x136c09[_0xf779('0x3b')]=[{'all':!![]}];}return db[_0xf779('0x2b')][_0xf779('0x3c')](_0x136c09);})[_0xf779('0x25')](function(_0x105e29){_0x1bc1cd['rows']=_0x105e29;return _0x1bc1cd;})[_0xf779('0x25')](respondWithFilteredResult(_0x451f91,_0x136c09))[_0xf779('0x3d')](handleError(_0x451f91,null));};exports[_0xf779('0x3e')]=function(_0x13c24d,_0xd33963){var _0x4a8e5a={'raw':!![],'where':{'id':_0x13c24d[_0xf779('0x3f')]['id']}},_0x2b49e1={};_0x2b49e1['model']=_[_0xf779('0x40')](db[_0xf779('0x2b')][_0xf779('0x41')]);_0x2b49e1[_0xf779('0x2e')]=_['keys'](_0x13c24d[_0xf779('0x2e')]);_0x2b49e1[_0xf779('0x2f')]=_['intersection'](_0x2b49e1[_0xf779('0x2d')],_0x2b49e1['query']);_0x4a8e5a[_0xf779('0x31')]=_['intersection'](_0x2b49e1[_0xf779('0x2d')],qs['fields'](_0x13c24d[_0xf779('0x2e')]['fields']));_0x4a8e5a[_0xf779('0x31')]=_0x4a8e5a[_0xf779('0x31')][_0xf779('0x42')]?_0x4a8e5a[_0xf779('0x31')]:_0x2b49e1['model'];if(_0x13c24d[_0xf779('0x2e')]['includeAll']){_0x4a8e5a['include']=[{'all':!![]}];}_0x4a8e5a=_[_0xf779('0x37')]({},_0x4a8e5a,_0x13c24d['options']);return db[_0xf779('0x2b')][_0xf779('0x43')](_0x4a8e5a)[_0xf779('0x25')](handleEntityNotFound(_0xd33963,null))[_0xf779('0x25')](respondWithResult(_0xd33963,null))[_0xf779('0x3d')](handleError(_0xd33963,null));};exports[_0xf779('0x44')]=function(_0x5cc118,_0x1cc165){return db[_0xf779('0x2b')][_0xf779('0x44')](_0x5cc118[_0xf779('0x45')],{})[_0xf779('0x25')](respondWithResult(_0x1cc165,0xc9))[_0xf779('0x3d')](handleError(_0x1cc165,null));};exports[_0xf779('0x24')]=function(_0x7fe780,_0x433da1){if(_0x7fe780[_0xf779('0x45')]['id']){delete _0x7fe780['body']['id'];}return db[_0xf779('0x2b')][_0xf779('0x43')]({'where':{'id':_0x7fe780[_0xf779('0x3f')]['id']}})['then'](handleEntityNotFound(_0x433da1,null))[_0xf779('0x25')](saveUpdates(_0x7fe780[_0xf779('0x45')],null))[_0xf779('0x25')](respondWithResult(_0x433da1,null))[_0xf779('0x3d')](handleError(_0x433da1,null));};exports[_0xf779('0x46')]=function(_0x1c2dd5,_0x69ccd0){return db[_0xf779('0x2b')][_0xf779('0x43')]({'where':{'id':_0x1c2dd5[_0xf779('0x3f')]['id']}})[_0xf779('0x25')](handleEntityNotFound(_0x69ccd0,null))[_0xf779('0x25')](removeEntity(_0x69ccd0,null))[_0xf779('0x3d')](handleError(_0x69ccd0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e732493..6edcdb5 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 _0x6edc=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','FreshsalesField','freshsales_unique_index','idField','FieldId'];(function(_0x5b577b,_0x52c3c7){var _0x529bb8=function(_0x5bd7bc){while(--_0x5bd7bc){_0x5b577b['push'](_0x5b577b['shift']());}};_0x529bb8(++_0x52c3c7);}(_0x6edc,0x138));var _0xc6ed=function(_0x4eb8e0,_0x487ec2){_0x4eb8e0=_0x4eb8e0-0x0;var _0x44474e=_0x6edc[_0x4eb8e0];return _0x44474e;};'use strict';var _=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var logger=require(_0xc6ed('0x2'))(_0xc6ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6ed('0x4'));var fs=require('fs');var path=require(_0xc6ed('0x5'));var rimraf=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xc6ed('0x8')]=function(_0x442466,_0x2b3e56){return _0x442466['define'](_0xc6ed('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xc6ed('0xa'),'fields':[_0xc6ed('0xb'),_0xc6ed('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6efe=['define','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x27ffd4,_0x1764cc){var _0x220dcd=function(_0x46caa6){while(--_0x46caa6){_0x27ffd4['push'](_0x27ffd4['shift']());}};_0x220dcd(++_0x1764cc);}(_0x6efe,0xc6));var _0xe6ef=function(_0x2b24ec,_0x425452){_0x2b24ec=_0x2b24ec-0x0;var _0xe1973c=_0x6efe[_0x2b24ec];return _0xe1973c;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ef('0x5'));var rimraf=require(_0xe6ef('0x6'));var config=require(_0xe6ef('0x7'));var attributes=require(_0xe6ef('0x8'));module[_0xe6ef('0x9')]=function(_0x573395,_0x17fc74){return _0x573395[_0xe6ef('0xa')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe6ef('0xb'),_0xe6ef('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 9e4abfe..01150b8 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x37b617,_0x3e76f1){var _0x22b26e=function(_0x5cd44a){while(--_0x5cd44a){_0x37b617['push'](_0x37b617['shift']());}};_0x22b26e(++_0x3e76f1);}(_0xabce,0x103));var _0xeabc=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xabce[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('FreshsalesField,\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 _0x33af=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5e0d12,_0x144474){var _0x180516=function(_0x330f91){while(--_0x330f91){_0x5e0d12['push'](_0x5e0d12['shift']());}};_0x180516(++_0x144474);}(_0x33af,0xec));var _0xf33a=function(_0x57ee8c,_0xe42849){_0x57ee8c=_0x57ee8c-0x0;var _0x3a2322=_0x33af[_0x57ee8c];return _0x3a2322;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 542b834..3538543 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(_0x22d041,_0x50c578){var _0xa51460=function(_0x1aa349){while(--_0x1aa349){_0x22d041['push'](_0x22d041['shift']());}};_0xa51460(++_0x50c578);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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(_0x2a6e95,_0x171b71){var _0x19578f=function(_0xe7f0de){while(--_0xe7f0de){_0x2a6e95['push'](_0x2a6e95['shift']());}};_0x19578f(++_0x171b71);}(_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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 1360925..1a9d5e1 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 _0x285b=['ENUM','integrationTab','newTab','sequelize','STRING','username'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x285b,0x171));var _0xb285=function(_0x530afb,_0x419b3b){_0x530afb=_0x530afb-0x0;var _0x597d9b=_0x285b[_0x530afb];return _0x597d9b;};'use strict';var Sequelize=require(_0xb285('0x0'));module['exports']={'name':{'type':Sequelize[_0xb285('0x1')]},'description':{'type':Sequelize[_0xb285('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb285('0x2')},'remoteUri':{'type':Sequelize[_0xb285('0x1')]},'password':{'type':Sequelize[_0xb285('0x1')]},'clientId':{'type':Sequelize[_0xb285('0x1')]},'clientSecret':{'type':Sequelize[_0xb285('0x1')]},'securityToken':{'type':Sequelize[_0xb285('0x1')]},'serverUrl':{'type':Sequelize[_0xb285('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb285('0x3')](_0xb285('0x4'),_0xb285('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x87d0=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x4f3815,_0x3460c2){var _0x32613f=function(_0x24569e){while(--_0x24569e){_0x4f3815['push'](_0x4f3815['shift']());}};_0x32613f(++_0x3460c2);}(_0x87d0,0xbd));var _0x087d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87d0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x087d('0x0'));module[_0x087d('0x1')]={'name':{'type':Sequelize[_0x087d('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x087d('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x087d('0x2')]},'password':{'type':Sequelize[_0x087d('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x087d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x087d('0x3')](_0x087d('0x4'),_0x087d('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4999683..ce36b53 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 _0x9182=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','sendStatus','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','update','getConfigurations','findOne','length','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','securityToken','slice','lastIndexOf','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','phone','custom','picklistValues','label','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x2837ac,_0x353be5){var _0x2775b4=function(_0x177445){while(--_0x177445){_0x2837ac['push'](_0x2837ac['shift']());}};_0x2775b4(++_0x353be5);}(_0x9182,0xe7));var _0x2918=function(_0x4831c0,_0x5f0326){_0x4831c0=_0x4831c0-0x0;var _0x2a7937=_0x9182[_0x4831c0];return _0x2a7937;};'use strict';var emlformat=require(_0x2918('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2918('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2918('0x2'));var moment=require(_0x2918('0x3'));var BPromise=require(_0x2918('0x4'));var Mustache=require(_0x2918('0x5'));var util=require(_0x2918('0x6'));var path=require(_0x2918('0x7'));var sox=require(_0x2918('0x8'));var csv=require(_0x2918('0x9'));var ejs=require(_0x2918('0xa'));var fs=require('fs');var fs_extra=require(_0x2918('0xb'));var _=require(_0x2918('0xc'));var squel=require(_0x2918('0xd'));var crypto=require(_0x2918('0xe'));var jsforce=require(_0x2918('0xf'));var deskjs=require(_0x2918('0x10'));var toCsv=require(_0x2918('0x9'));var querystring=require(_0x2918('0x11'));var Papa=require(_0x2918('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2918('0x13'));var as=require(_0x2918('0x14'));var hardwareService=require(_0x2918('0x15'));var logger=require(_0x2918('0x16'))(_0x2918('0x17'));var utils=require(_0x2918('0x18'));var config=require(_0x2918('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2918('0x1a'));function respondWithStatusCode(_0x15384a,_0x275b1d){_0x275b1d=_0x275b1d||0xcc;return function(_0x4a52dc){if(_0x4a52dc){return _0x15384a['sendStatus'](_0x275b1d);}return _0x15384a[_0x2918('0x1b')](_0x275b1d)[_0x2918('0x1c')]();};}function respondWithResult(_0x35c5fb,_0x519b4d){_0x519b4d=_0x519b4d||0xc8;return function(_0x57be7c){if(_0x57be7c){return _0x35c5fb['status'](_0x519b4d)[_0x2918('0x1d')](_0x57be7c);}};}function respondWithFilteredResult(_0x163f0e,_0x2954b9){return function(_0x315fc1){if(_0x315fc1){var _0x206f57=typeof _0x2954b9['offset']===_0x2918('0x1e')&&typeof _0x2954b9[_0x2918('0x1f')]===_0x2918('0x1e');var _0x4f8c8d=_0x315fc1[_0x2918('0x20')];var _0x439774=_0x206f57?0x0:_0x2954b9[_0x2918('0x21')];var _0x48676f=_0x206f57?_0x315fc1[_0x2918('0x20')]:_0x2954b9['offset']+_0x2954b9['limit'];var _0x2dd6c3;if(_0x48676f>=_0x4f8c8d){_0x48676f=_0x4f8c8d;_0x2dd6c3=0xc8;}else{_0x2dd6c3=0xce;}_0x163f0e[_0x2918('0x1b')](_0x2dd6c3);return _0x163f0e[_0x2918('0x22')](_0x2918('0x23'),_0x439774+'-'+_0x48676f+'/'+_0x4f8c8d)[_0x2918('0x1d')](_0x315fc1);}return null;};}function patchUpdates(_0x533500){return function(_0x508812){try{jsonpatch[_0x2918('0x24')](_0x508812,_0x533500,!![]);}catch(_0x553f0f){return BPromise[_0x2918('0x25')](_0x553f0f);}return _0x508812['save']();};}function saveUpdates(_0x4719ba,_0x1c7687){return function(_0x763563){if(_0x763563){return _0x763563['update'](_0x4719ba)[_0x2918('0x26')](function(_0x4f1817){return _0x4f1817;});}return null;};}function removeEntity(_0x18f365,_0x1386bd){return function(_0x321f71){if(_0x321f71){return _0x321f71['destroy']()[_0x2918('0x26')](function(){_0x18f365[_0x2918('0x1b')](0xcc)[_0x2918('0x1c')]();});}};}function handleEntityNotFound(_0x3883d0,_0x10469e){return function(_0x130fdd){if(!_0x130fdd){_0x3883d0[_0x2918('0x27')](0x194);}return _0x130fdd;};}function handleError(_0x291861,_0xc9e756){_0xc9e756=_0xc9e756||0x1f4;return function(_0x5646f8){logger[_0x2918('0x28')](_0x5646f8[_0x2918('0x29')]);if(_0x5646f8[_0x2918('0x2a')]){delete _0x5646f8[_0x2918('0x2a')];}_0x291861[_0x2918('0x1b')](_0xc9e756)[_0x2918('0x2b')](_0x5646f8);};}exports['index']=function(_0x5167c7,_0x55eb8b){var _0x33ae81={},_0x28eb5c={},_0x249106={'count':0x0,'rows':[]};var _0x33cdf8=_[_0x2918('0x2c')](db[_0x2918('0x2d')][_0x2918('0x2e')],function(_0x35adb2){return{'name':_0x35adb2[_0x2918('0x2f')],'type':_0x35adb2['type'][_0x2918('0x30')]};});_0x28eb5c[_0x2918('0x31')]=_['map'](_0x33cdf8,_0x2918('0x2a'));_0x28eb5c[_0x2918('0x32')]=_['keys'](_0x5167c7[_0x2918('0x32')]);_0x28eb5c['filters']=_['intersection'](_0x28eb5c[_0x2918('0x31')],_0x28eb5c[_0x2918('0x32')]);_0x33ae81['attributes']=_[_0x2918('0x33')](_0x28eb5c['model'],qs['fields'](_0x5167c7[_0x2918('0x32')][_0x2918('0x34')]));_0x33ae81[_0x2918('0x35')]=_0x33ae81[_0x2918('0x35')]['length']?_0x33ae81['attributes']:_0x28eb5c[_0x2918('0x31')];if(!_0x5167c7[_0x2918('0x32')][_0x2918('0x36')](_0x2918('0x37'))){_0x33ae81[_0x2918('0x1f')]=qs['limit'](_0x5167c7[_0x2918('0x32')][_0x2918('0x1f')]);_0x33ae81[_0x2918('0x21')]=qs[_0x2918('0x21')](_0x5167c7[_0x2918('0x32')][_0x2918('0x21')]);}_0x33ae81[_0x2918('0x38')]=qs[_0x2918('0x39')](_0x5167c7[_0x2918('0x32')][_0x2918('0x39')]);_0x33ae81[_0x2918('0x3a')]=qs[_0x2918('0x3b')](_[_0x2918('0x3c')](_0x5167c7[_0x2918('0x32')],_0x28eb5c[_0x2918('0x3b')]),_0x33cdf8);if(_0x5167c7[_0x2918('0x32')]['filter']){_0x33ae81['where']=_['merge'](_0x33ae81[_0x2918('0x3a')],{'$or':_[_0x2918('0x2c')](_0x33cdf8,function(_0x1a2179){if(_0x1a2179[_0x2918('0x3d')]!==_0x2918('0x3e')){var _0x32dd1f={};_0x32dd1f[_0x1a2179[_0x2918('0x2a')]]={'$like':'%'+_0x5167c7[_0x2918('0x32')][_0x2918('0x3f')]+'%'};return _0x32dd1f;}})});}_0x33ae81=_[_0x2918('0x40')]({},_0x33ae81,_0x5167c7[_0x2918('0x41')]);var _0x2f4196={'where':_0x33ae81['where']};return db[_0x2918('0x2d')][_0x2918('0x20')](_0x2f4196)[_0x2918('0x26')](function(_0x27363b){_0x249106['count']=_0x27363b;if(_0x5167c7[_0x2918('0x32')][_0x2918('0x42')]){_0x33ae81[_0x2918('0x43')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x33ae81);})[_0x2918('0x26')](function(_0x15c65e){_0x249106[_0x2918('0x44')]=_0x15c65e;return _0x249106;})[_0x2918('0x26')](respondWithFilteredResult(_0x55eb8b,_0x33ae81))[_0x2918('0x45')](handleError(_0x55eb8b,null));};exports['show']=function(_0x5890ef,_0x582d96){var _0x202ab0={'raw':![],'where':{'id':_0x5890ef[_0x2918('0x46')]['id']}},_0x5f161c={};_0x5f161c['model']=_[_0x2918('0x47')](db[_0x2918('0x2d')][_0x2918('0x2e')]);_0x5f161c[_0x2918('0x32')]=_['keys'](_0x5890ef['query']);_0x5f161c['filters']=_[_0x2918('0x33')](_0x5f161c[_0x2918('0x31')],_0x5f161c['query']);_0x202ab0['attributes']=_[_0x2918('0x33')](_0x5f161c['model'],qs[_0x2918('0x34')](_0x5890ef[_0x2918('0x32')][_0x2918('0x34')]));_0x202ab0[_0x2918('0x35')]=_0x202ab0[_0x2918('0x35')]['length']?_0x202ab0[_0x2918('0x35')]:_0x5f161c[_0x2918('0x31')];if(_0x5890ef[_0x2918('0x32')][_0x2918('0x42')]){_0x202ab0['include']=[{'all':!![]}];}_0x202ab0=_[_0x2918('0x40')]({},_0x202ab0,_0x5890ef[_0x2918('0x41')]);return db['SalesforceAccount'][_0x2918('0x48')](_0x202ab0)[_0x2918('0x26')](handleEntityNotFound(_0x582d96,null))[_0x2918('0x26')](respondWithResult(_0x582d96,null))[_0x2918('0x45')](handleError(_0x582d96,null));};exports[_0x2918('0x49')]=function(_0x10dcd2,_0x3e5dd6){return db['SalesforceAccount'][_0x2918('0x49')](_0x10dcd2[_0x2918('0x4a')],{})[_0x2918('0x26')](respondWithResult(_0x3e5dd6,0xc9))[_0x2918('0x45')](handleError(_0x3e5dd6,null));};exports[_0x2918('0x4b')]=function(_0x21263f,_0x1af317){if(_0x21263f[_0x2918('0x4a')]['id']){delete _0x21263f['body']['id'];}return db[_0x2918('0x2d')][_0x2918('0x48')]({'where':{'id':_0x21263f[_0x2918('0x46')]['id']}})[_0x2918('0x26')](handleEntityNotFound(_0x1af317,null))[_0x2918('0x26')](saveUpdates(_0x21263f[_0x2918('0x4a')],null))[_0x2918('0x26')](respondWithResult(_0x1af317,null))['catch'](handleError(_0x1af317,null));};exports['destroy']=function(_0x181304,_0x52a615){return db[_0x2918('0x2d')][_0x2918('0x48')]({'where':{'id':_0x181304['params']['id']}})[_0x2918('0x26')](handleEntityNotFound(_0x52a615,null))[_0x2918('0x26')](removeEntity(_0x52a615,null))[_0x2918('0x45')](handleError(_0x52a615,null));};exports[_0x2918('0x4c')]=function(_0x164c0d,_0x1ae270,_0x545c3e){var _0x5080dd={};var _0x267ab2={};var _0xd3580b;var _0x2c2f3c;return db[_0x2918('0x2d')][_0x2918('0x4d')]({'where':{'id':_0x164c0d[_0x2918('0x46')]['id']}})[_0x2918('0x26')](handleEntityNotFound(_0x1ae270,null))[_0x2918('0x26')](function(_0xa2affa){if(_0xa2affa){_0xd3580b=_0xa2affa;_0x267ab2['model']=_[_0x2918('0x47')](db['SalesforceConfiguration'][_0x2918('0x2e')]);_0x267ab2[_0x2918('0x32')]=_[_0x2918('0x47')](_0x164c0d[_0x2918('0x32')]);_0x267ab2[_0x2918('0x3b')]=_['intersection'](_0x267ab2['model'],_0x267ab2['query']);_0x5080dd[_0x2918('0x35')]=_[_0x2918('0x33')](_0x267ab2['model'],qs[_0x2918('0x34')](_0x164c0d[_0x2918('0x32')][_0x2918('0x34')]));_0x5080dd[_0x2918('0x35')]=_0x5080dd['attributes'][_0x2918('0x4e')]?_0x5080dd[_0x2918('0x35')]:_0x267ab2[_0x2918('0x31')];_0x5080dd[_0x2918('0x38')]=qs[_0x2918('0x39')](_0x164c0d['query'][_0x2918('0x39')]);_0x5080dd[_0x2918('0x3a')]=qs[_0x2918('0x3b')](_[_0x2918('0x3c')](_0x164c0d[_0x2918('0x32')],_0x267ab2[_0x2918('0x3b')]));if(_0x164c0d[_0x2918('0x32')][_0x2918('0x3f')]){_0x5080dd[_0x2918('0x3a')]=_[_0x2918('0x40')](_0x5080dd['where'],{'$or':_[_0x2918('0x2c')](_0x5080dd[_0x2918('0x35')],function(_0x48e2cc){var _0x57d5e0={};_0x57d5e0[_0x48e2cc]={'$like':'%'+_0x164c0d[_0x2918('0x32')]['filter']+'%'};return _0x57d5e0;})});}_0x5080dd=_[_0x2918('0x40')]({},_0x5080dd,_0x164c0d[_0x2918('0x41')]);return _0xd3580b[_0x2918('0x4c')](_0x5080dd);}})[_0x2918('0x26')](function(_0x47c118){if(_0x47c118){_0x2c2f3c=_0x47c118[_0x2918('0x4e')];if(!_0x164c0d['query'][_0x2918('0x36')](_0x2918('0x37'))){_0x5080dd[_0x2918('0x1f')]=qs[_0x2918('0x1f')](_0x164c0d['query'][_0x2918('0x1f')]);_0x5080dd[_0x2918('0x21')]=qs['offset'](_0x164c0d[_0x2918('0x32')]['offset']);}return _0xd3580b['getConfigurations'](_0x5080dd);}})[_0x2918('0x26')](function(_0x1a4c38){if(_0x1a4c38){return _0x1a4c38?{'count':_0x2c2f3c,'rows':_0x1a4c38}:null;}})[_0x2918('0x26')](respondWithResult(_0x1ae270,null))[_0x2918('0x45')](handleError(_0x1ae270,null));};exports['addConfiguration']=function(_0x37e16e,_0x498954,_0x428c8a){if(_0x37e16e[_0x2918('0x4a')]['id']){delete _0x37e16e[_0x2918('0x4a')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x37e16e[_0x2918('0x46')]['id']}})['then'](handleEntityNotFound(_0x498954,null))[_0x2918('0x26')](function(_0x44bf87){if(_0x44bf87){_0x37e16e['body'][_0x2918('0x4f')]=_0x44bf87['id'];_0x37e16e[_0x2918('0x4a')][_0x2918('0x50')]=integrations[_0x2918('0x51')](_0x37e16e[_0x2918('0x4a')][_0x2918('0x52')],_0x37e16e['body'][_0x2918('0x3d')]);_0x37e16e[_0x2918('0x4a')][_0x2918('0x53')]=integrations[_0x2918('0x54')](_0x37e16e['body'][_0x2918('0x52')],_0x37e16e[_0x2918('0x4a')][_0x2918('0x3d')]);return db['SalesforceConfiguration'][_0x2918('0x49')](_0x37e16e[_0x2918('0x4a')],{'include':[{'model':db[_0x2918('0x55')],'as':_0x2918('0x50')},{'model':db[_0x2918('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x498954,null))['catch'](handleError(_0x498954,null));};exports[_0x2918('0x56')]=function(_0x520db3,_0xc8e4e3,_0x4b6fb0){var _0x4b5502;var _0x4c52c4='';var _0x55c9c4='Task';return db['SalesforceAccount']['findOne']({'where':{'id':_0x520db3['params']['id']},'attributes':['id',_0x2918('0x57'),_0x2918('0x58'),_0x2918('0x59'),_0x2918('0x5a'),'password',_0x2918('0x5b')]})['then'](handleEntityNotFound(_0xc8e4e3,null))['then'](function(_0x46a0d0){if(_0x46a0d0){_0x4c52c4=_0x46a0d0['remoteUri'];var _0x362027=_0x4c52c4[_0x2918('0x5c')](-0x1);if(_0x362027==='/'){_0x4c52c4=_0x4c52c4['substring'](0x0,_0x4c52c4[_0x2918('0x5d')](_0x362027));}_0x4b5502=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4c52c4,'clientId':_0x46a0d0[_0x2918('0x58')],'clientSecret':_0x46a0d0[_0x2918('0x59')]}});return _0x4b5502[_0x2918('0x5e')](_0x46a0d0['username'],_0x46a0d0['password'][_0x2918('0x5f')](_0x46a0d0['securityToken']));}})[_0x2918('0x26')](function(_0x268a81){if(_0x268a81){if(!_['isNil'](_0x520db3[_0x2918('0x32')][_0x2918('0x60')])){_0x55c9c4=_0x520db3[_0x2918('0x32')]['ticketType'];}return _0x4b5502[_0x2918('0x61')](_0x55c9c4)[_0x2918('0x62')]();}})[_0x2918('0x26')](function(_0x3809fb){var _0x4075ea=[_0x2918('0x63'),_0x2918('0x64'),_0x2918('0x65'),_0x2918('0x66'),_0x2918('0x67'),_0x2918('0x68')];var _0x4fe539=[_0x2918('0x69'),'int',_0x2918('0x6a'),_0x2918('0x6b'),_0x2918('0x6c'),'textarea',_0x2918('0x6d')];if(_0x3809fb){_['remove'](_0x3809fb[_0x2918('0x34')],function(_0x542246){return _0x4075ea['includes'](_0x542246['name'])||!_0x4fe539['includes'](_0x542246['type']);});return{'count':_0x3809fb[_0x2918('0x34')][_0x2918('0x4e')],'rows':_[_0x2918('0x2c')](_0x3809fb[_0x2918('0x34')],function(_0x2b568a){return{'id':_0x2b568a[_0x2918('0x2a')],'name':_0x2b568a['label'],'custom':_0x2b568a[_0x2918('0x6e')],'options':_0x2b568a['picklistValues'][_0x2918('0x4e')]>0x0?_[_0x2918('0x2c')](_0x2b568a[_0x2918('0x6f')],function(_0x439bde){return{'name':_0x439bde[_0x2918('0x70')],'value':_0x439bde[_0x2918('0x71')]};}):_0x2b568a[_0x2918('0x3d')]==_0x2918('0x6b')?[{'name':_0x2918('0x72'),'value':'true'},{'name':_0x2918('0x73'),'value':_0x2918('0x74')}]:[]};})};}})[_0x2918('0x26')](respondWithResult(_0xc8e4e3,null))[_0x2918('0x45')](function(_0x50032c){var _0x4d1cd8=_0x520db3[_0x2918('0x32')][_0x2918('0x75')]?0x1f4:_0x50032c[_0x2918('0x76')]||0x1f4;logger[_0x2918('0x28')](_0x2918('0x77'),_0x2918('0x56'),_0x4d1cd8,JSON['stringify'](_0x50032c));delete _0x50032c[_0x2918('0x2a')];if(_0x4d1cd8===0x191){_0x4d1cd8=0x190;}_0xc8e4e3[_0x2918('0x1b')](_0x4d1cd8)['send'](_0x520db3[_0x2918('0x32')][_0x2918('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x50032c['statusCode']}:_0x50032c);});}; \ No newline at end of file +var _0xc095=['includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','fast-json-patch','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','options','find','create','body','update','params','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','Subjects','getDescriptions','channel','SalesforceField','Descriptions','Task','remoteUri','clientId','username','password','securityToken','slice','lastIndexOf','Connection','clientSecret','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','phone'];(function(_0x3e732d,_0x3ea556){var _0x5aaaec=function(_0x58b330){while(--_0x58b330){_0x3e732d['push'](_0x3e732d['shift']());}};_0x5aaaec(++_0x3ea556);}(_0xc095,0x87));var _0x5c09=function(_0x592033,_0x1d6856){_0x592033=_0x592033-0x0;var _0x5b7dff=_0xc095[_0x592033];return _0x5b7dff;};'use strict';var emlformat=require(_0x5c09('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c09('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c09('0x2'));var Mustache=require(_0x5c09('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5c09('0x4'));var ejs=require(_0x5c09('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c09('0x6'));var squel=require(_0x5c09('0x7'));var crypto=require(_0x5c09('0x8'));var jsforce=require(_0x5c09('0x9'));var deskjs=require(_0x5c09('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5c09('0xb'));var Papa=require('papaparse');var Redis=require(_0x5c09('0xc'));var authService=require(_0x5c09('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5c09('0xe'));var hardwareService=require(_0x5c09('0xf'));var logger=require(_0x5c09('0x10'))(_0x5c09('0x11'));var utils=require(_0x5c09('0x12'));var config=require(_0x5c09('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c09('0x14'))['db'];var integrations=require(_0x5c09('0x15'));function respondWithStatusCode(_0x514be8,_0x35d533){_0x35d533=_0x35d533||0xcc;return function(_0x1b4eff){if(_0x1b4eff){return _0x514be8[_0x5c09('0x16')](_0x35d533);}return _0x514be8[_0x5c09('0x17')](_0x35d533)[_0x5c09('0x18')]();};}function respondWithResult(_0x1fedfd,_0x508a8c){_0x508a8c=_0x508a8c||0xc8;return function(_0x28ee85){if(_0x28ee85){return _0x1fedfd['status'](_0x508a8c)[_0x5c09('0x19')](_0x28ee85);}};}function respondWithFilteredResult(_0x7ff8ed,_0x5c3023){return function(_0x112e6a){if(_0x112e6a){var _0xf14ce0=typeof _0x5c3023[_0x5c09('0x1a')]===_0x5c09('0x1b')&&typeof _0x5c3023[_0x5c09('0x1c')]==='undefined';var _0x1b1c01=_0x112e6a[_0x5c09('0x1d')];var _0x46801e=_0xf14ce0?0x0:_0x5c3023[_0x5c09('0x1a')];var _0xc54e9b=_0xf14ce0?_0x112e6a[_0x5c09('0x1d')]:_0x5c3023[_0x5c09('0x1a')]+_0x5c3023[_0x5c09('0x1c')];var _0x5958b5;if(_0xc54e9b>=_0x1b1c01){_0xc54e9b=_0x1b1c01;_0x5958b5=0xc8;}else{_0x5958b5=0xce;}_0x7ff8ed[_0x5c09('0x17')](_0x5958b5);return _0x7ff8ed[_0x5c09('0x1e')](_0x5c09('0x1f'),_0x46801e+'-'+_0xc54e9b+'/'+_0x1b1c01)[_0x5c09('0x19')](_0x112e6a);}return null;};}function patchUpdates(_0x1a29e0){return function(_0x1ffba2){try{jsonpatch['apply'](_0x1ffba2,_0x1a29e0,!![]);}catch(_0x29ba55){return BPromise[_0x5c09('0x20')](_0x29ba55);}return _0x1ffba2[_0x5c09('0x21')]();};}function saveUpdates(_0x1a3744,_0x43a1f3){return function(_0x512505){if(_0x512505){return _0x512505['update'](_0x1a3744)['then'](function(_0xb4dd0d){return _0xb4dd0d;});}return null;};}function removeEntity(_0x207bcf,_0x3e61a7){return function(_0x4816af){if(_0x4816af){return _0x4816af[_0x5c09('0x22')]()[_0x5c09('0x23')](function(){_0x207bcf[_0x5c09('0x17')](0xcc)[_0x5c09('0x18')]();});}};}function handleEntityNotFound(_0x1623d4,_0xf18a0e){return function(_0x5ef747){if(!_0x5ef747){_0x1623d4['sendStatus'](0x194);}return _0x5ef747;};}function handleError(_0x38ff8a,_0x573dc3){_0x573dc3=_0x573dc3||0x1f4;return function(_0x113813){logger[_0x5c09('0x24')](_0x113813[_0x5c09('0x25')]);if(_0x113813[_0x5c09('0x26')]){delete _0x113813[_0x5c09('0x26')];}_0x38ff8a[_0x5c09('0x17')](_0x573dc3)[_0x5c09('0x27')](_0x113813);};}exports[_0x5c09('0x28')]=function(_0x54c88f,_0x2207f0){var _0x2082db={},_0x37d8bd={},_0x437155={'count':0x0,'rows':[]};var _0x171a79=_[_0x5c09('0x29')](db[_0x5c09('0x2a')][_0x5c09('0x2b')],function(_0x158f41){return{'name':_0x158f41[_0x5c09('0x2c')],'type':_0x158f41[_0x5c09('0x2d')][_0x5c09('0x2e')]};});_0x37d8bd[_0x5c09('0x2f')]=_[_0x5c09('0x29')](_0x171a79,_0x5c09('0x26'));_0x37d8bd[_0x5c09('0x30')]=_[_0x5c09('0x31')](_0x54c88f[_0x5c09('0x30')]);_0x37d8bd[_0x5c09('0x32')]=_[_0x5c09('0x33')](_0x37d8bd[_0x5c09('0x2f')],_0x37d8bd[_0x5c09('0x30')]);_0x2082db[_0x5c09('0x34')]=_['intersection'](_0x37d8bd[_0x5c09('0x2f')],qs[_0x5c09('0x35')](_0x54c88f['query']['fields']));_0x2082db[_0x5c09('0x34')]=_0x2082db['attributes'][_0x5c09('0x36')]?_0x2082db[_0x5c09('0x34')]:_0x37d8bd[_0x5c09('0x2f')];if(!_0x54c88f['query'][_0x5c09('0x37')]('nolimit')){_0x2082db[_0x5c09('0x1c')]=qs['limit'](_0x54c88f[_0x5c09('0x30')][_0x5c09('0x1c')]);_0x2082db[_0x5c09('0x1a')]=qs[_0x5c09('0x1a')](_0x54c88f[_0x5c09('0x30')]['offset']);}_0x2082db[_0x5c09('0x38')]=qs[_0x5c09('0x39')](_0x54c88f['query'][_0x5c09('0x39')]);_0x2082db['where']=qs[_0x5c09('0x32')](_['pick'](_0x54c88f[_0x5c09('0x30')],_0x37d8bd[_0x5c09('0x32')]),_0x171a79);if(_0x54c88f[_0x5c09('0x30')][_0x5c09('0x3a')]){_0x2082db['where']=_['merge'](_0x2082db[_0x5c09('0x3b')],{'$or':_['map'](_0x171a79,function(_0x549e8e){if(_0x549e8e[_0x5c09('0x2d')]!==_0x5c09('0x3c')){var _0x3350e3={};_0x3350e3[_0x549e8e['name']]={'$like':'%'+_0x54c88f[_0x5c09('0x30')]['filter']+'%'};return _0x3350e3;}})});}_0x2082db=_[_0x5c09('0x3d')]({},_0x2082db,_0x54c88f['options']);var _0x517a1a={'where':_0x2082db[_0x5c09('0x3b')]};return db['SalesforceAccount']['count'](_0x517a1a)['then'](function(_0x49cc22){_0x437155['count']=_0x49cc22;if(_0x54c88f[_0x5c09('0x30')][_0x5c09('0x3e')]){_0x2082db[_0x5c09('0x3f')]=[{'all':!![]}];}return db[_0x5c09('0x2a')][_0x5c09('0x40')](_0x2082db);})[_0x5c09('0x23')](function(_0x29d1da){_0x437155['rows']=_0x29d1da;return _0x437155;})[_0x5c09('0x23')](respondWithFilteredResult(_0x2207f0,_0x2082db))[_0x5c09('0x41')](handleError(_0x2207f0,null));};exports['show']=function(_0x42cf8c,_0x3c51c1){var _0x55e1b8={'raw':![],'where':{'id':_0x42cf8c['params']['id']}},_0x4b9359={};_0x4b9359[_0x5c09('0x2f')]=_[_0x5c09('0x31')](db[_0x5c09('0x2a')]['rawAttributes']);_0x4b9359['query']=_['keys'](_0x42cf8c['query']);_0x4b9359[_0x5c09('0x32')]=_[_0x5c09('0x33')](_0x4b9359['model'],_0x4b9359[_0x5c09('0x30')]);_0x55e1b8[_0x5c09('0x34')]=_[_0x5c09('0x33')](_0x4b9359[_0x5c09('0x2f')],qs[_0x5c09('0x35')](_0x42cf8c[_0x5c09('0x30')][_0x5c09('0x35')]));_0x55e1b8[_0x5c09('0x34')]=_0x55e1b8[_0x5c09('0x34')][_0x5c09('0x36')]?_0x55e1b8[_0x5c09('0x34')]:_0x4b9359[_0x5c09('0x2f')];if(_0x42cf8c[_0x5c09('0x30')][_0x5c09('0x3e')]){_0x55e1b8['include']=[{'all':!![]}];}_0x55e1b8=_[_0x5c09('0x3d')]({},_0x55e1b8,_0x42cf8c[_0x5c09('0x42')]);return db[_0x5c09('0x2a')][_0x5c09('0x43')](_0x55e1b8)[_0x5c09('0x23')](handleEntityNotFound(_0x3c51c1,null))[_0x5c09('0x23')](respondWithResult(_0x3c51c1,null))[_0x5c09('0x41')](handleError(_0x3c51c1,null));};exports[_0x5c09('0x44')]=function(_0x276e0e,_0x583367){return db['SalesforceAccount']['create'](_0x276e0e[_0x5c09('0x45')],{})[_0x5c09('0x23')](respondWithResult(_0x583367,0xc9))[_0x5c09('0x41')](handleError(_0x583367,null));};exports[_0x5c09('0x46')]=function(_0x39f697,_0x5847ab){if(_0x39f697[_0x5c09('0x45')]['id']){delete _0x39f697[_0x5c09('0x45')]['id'];}return db[_0x5c09('0x2a')][_0x5c09('0x43')]({'where':{'id':_0x39f697[_0x5c09('0x47')]['id']}})[_0x5c09('0x23')](handleEntityNotFound(_0x5847ab,null))[_0x5c09('0x23')](saveUpdates(_0x39f697['body'],null))[_0x5c09('0x23')](respondWithResult(_0x5847ab,null))[_0x5c09('0x41')](handleError(_0x5847ab,null));};exports[_0x5c09('0x22')]=function(_0x366f96,_0x13132c){return db[_0x5c09('0x2a')][_0x5c09('0x43')]({'where':{'id':_0x366f96[_0x5c09('0x47')]['id']}})[_0x5c09('0x23')](handleEntityNotFound(_0x13132c,null))[_0x5c09('0x23')](removeEntity(_0x13132c,null))[_0x5c09('0x41')](handleError(_0x13132c,null));};exports[_0x5c09('0x48')]=function(_0x6401af,_0x4246e4,_0x548ca1){var _0x560ce0={};var _0x409663={};var _0x2e72e1;var _0xace75a;return db['SalesforceAccount'][_0x5c09('0x49')]({'where':{'id':_0x6401af[_0x5c09('0x47')]['id']}})[_0x5c09('0x23')](handleEntityNotFound(_0x4246e4,null))['then'](function(_0x2805f8){if(_0x2805f8){_0x2e72e1=_0x2805f8;_0x409663[_0x5c09('0x2f')]=_[_0x5c09('0x31')](db[_0x5c09('0x4a')][_0x5c09('0x2b')]);_0x409663[_0x5c09('0x30')]=_[_0x5c09('0x31')](_0x6401af[_0x5c09('0x30')]);_0x409663['filters']=_[_0x5c09('0x33')](_0x409663['model'],_0x409663['query']);_0x560ce0[_0x5c09('0x34')]=_[_0x5c09('0x33')](_0x409663[_0x5c09('0x2f')],qs[_0x5c09('0x35')](_0x6401af[_0x5c09('0x30')][_0x5c09('0x35')]));_0x560ce0[_0x5c09('0x34')]=_0x560ce0['attributes'][_0x5c09('0x36')]?_0x560ce0[_0x5c09('0x34')]:_0x409663[_0x5c09('0x2f')];_0x560ce0[_0x5c09('0x38')]=qs[_0x5c09('0x39')](_0x6401af[_0x5c09('0x30')]['sort']);_0x560ce0[_0x5c09('0x3b')]=qs[_0x5c09('0x32')](_['pick'](_0x6401af[_0x5c09('0x30')],_0x409663['filters']));if(_0x6401af[_0x5c09('0x30')]['filter']){_0x560ce0[_0x5c09('0x3b')]=_[_0x5c09('0x3d')](_0x560ce0[_0x5c09('0x3b')],{'$or':_[_0x5c09('0x29')](_0x560ce0[_0x5c09('0x34')],function(_0x3f6892){var _0x2ed068={};_0x2ed068[_0x3f6892]={'$like':'%'+_0x6401af[_0x5c09('0x30')][_0x5c09('0x3a')]+'%'};return _0x2ed068;})});}_0x560ce0=_[_0x5c09('0x3d')]({},_0x560ce0,_0x6401af[_0x5c09('0x42')]);return _0x2e72e1['getConfigurations'](_0x560ce0);}})[_0x5c09('0x23')](function(_0xc34b60){if(_0xc34b60){_0xace75a=_0xc34b60['length'];if(!_0x6401af[_0x5c09('0x30')][_0x5c09('0x37')](_0x5c09('0x4b'))){_0x560ce0[_0x5c09('0x1c')]=qs[_0x5c09('0x1c')](_0x6401af['query'][_0x5c09('0x1c')]);_0x560ce0[_0x5c09('0x1a')]=qs['offset'](_0x6401af['query'][_0x5c09('0x1a')]);}return _0x2e72e1[_0x5c09('0x48')](_0x560ce0);}})[_0x5c09('0x23')](function(_0xf3ca71){if(_0xf3ca71){return _0xf3ca71?{'count':_0xace75a,'rows':_0xf3ca71}:null;}})[_0x5c09('0x23')](respondWithResult(_0x4246e4,null))[_0x5c09('0x41')](handleError(_0x4246e4,null));};exports[_0x5c09('0x4c')]=function(_0x185e30,_0x9f88be,_0x5084a2){if(_0x185e30[_0x5c09('0x45')]['id']){delete _0x185e30[_0x5c09('0x45')]['id'];}return db[_0x5c09('0x2a')][_0x5c09('0x49')]({'where':{'id':_0x185e30['params']['id']}})['then'](handleEntityNotFound(_0x9f88be,null))[_0x5c09('0x23')](function(_0x2b2ddc){if(_0x2b2ddc){_0x185e30[_0x5c09('0x45')][_0x5c09('0x4d')]=_0x2b2ddc['id'];_0x185e30[_0x5c09('0x45')][_0x5c09('0x4e')]=integrations['getSubjects'](_0x185e30[_0x5c09('0x45')]['channel'],_0x185e30[_0x5c09('0x45')][_0x5c09('0x2d')]);_0x185e30['body']['Descriptions']=integrations[_0x5c09('0x4f')](_0x185e30[_0x5c09('0x45')][_0x5c09('0x50')],_0x185e30['body']['type']);return db[_0x5c09('0x4a')][_0x5c09('0x44')](_0x185e30[_0x5c09('0x45')],{'include':[{'model':db[_0x5c09('0x51')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x5c09('0x52')}]});}return null;})['then'](respondWithResult(_0x9f88be,null))[_0x5c09('0x41')](handleError(_0x9f88be,null));};exports['getFields']=function(_0x4562b5,_0x3dc8cf,_0x196016){var _0x52ba78;var _0x2cf4ea='';var _0x50534d=_0x5c09('0x53');return db[_0x5c09('0x2a')][_0x5c09('0x49')]({'where':{'id':_0x4562b5[_0x5c09('0x47')]['id']},'attributes':['id',_0x5c09('0x54'),_0x5c09('0x55'),'clientSecret',_0x5c09('0x56'),_0x5c09('0x57'),_0x5c09('0x58')]})[_0x5c09('0x23')](handleEntityNotFound(_0x3dc8cf,null))[_0x5c09('0x23')](function(_0xfc01d0){if(_0xfc01d0){_0x2cf4ea=_0xfc01d0[_0x5c09('0x54')];var _0x87955=_0x2cf4ea[_0x5c09('0x59')](-0x1);if(_0x87955==='/'){_0x2cf4ea=_0x2cf4ea['substring'](0x0,_0x2cf4ea[_0x5c09('0x5a')](_0x87955));}_0x52ba78=new jsforce[(_0x5c09('0x5b'))]({'oauth2':{'loginUrl':_0x2cf4ea,'clientId':_0xfc01d0['clientId'],'clientSecret':_0xfc01d0[_0x5c09('0x5c')]}});return _0x52ba78['login'](_0xfc01d0[_0x5c09('0x56')],_0xfc01d0[_0x5c09('0x57')][_0x5c09('0x5d')](_0xfc01d0[_0x5c09('0x58')]));}})[_0x5c09('0x23')](function(_0x1faab9){if(_0x1faab9){if(!_[_0x5c09('0x5e')](_0x4562b5[_0x5c09('0x30')][_0x5c09('0x5f')])){_0x50534d=_0x4562b5[_0x5c09('0x30')][_0x5c09('0x5f')];}return _0x52ba78[_0x5c09('0x60')](_0x50534d)[_0x5c09('0x61')]();}})[_0x5c09('0x23')](function(_0x1c72b1){var _0x56e771=[_0x5c09('0x62'),_0x5c09('0x63'),_0x5c09('0x64'),_0x5c09('0x65'),_0x5c09('0x66'),_0x5c09('0x67')];var _0xa18d48=[_0x5c09('0x68'),'int',_0x5c09('0x69'),_0x5c09('0x6a'),_0x5c09('0x6b'),'textarea',_0x5c09('0x6c')];if(_0x1c72b1){_['remove'](_0x1c72b1[_0x5c09('0x35')],function(_0x3ce5b6){return _0x56e771[_0x5c09('0x6d')](_0x3ce5b6[_0x5c09('0x26')])||!_0xa18d48[_0x5c09('0x6d')](_0x3ce5b6['type']);});return{'count':_0x1c72b1[_0x5c09('0x35')][_0x5c09('0x36')],'rows':_['map'](_0x1c72b1[_0x5c09('0x35')],function(_0x311ac0){return{'id':_0x311ac0[_0x5c09('0x26')],'name':_0x311ac0[_0x5c09('0x6e')],'custom':_0x311ac0['custom'],'options':_0x311ac0[_0x5c09('0x6f')][_0x5c09('0x36')]>0x0?_[_0x5c09('0x29')](_0x311ac0[_0x5c09('0x6f')],function(_0x3395a1){return{'name':_0x3395a1[_0x5c09('0x6e')],'value':_0x3395a1[_0x5c09('0x70')]};}):_0x311ac0[_0x5c09('0x2d')]==_0x5c09('0x6a')?[{'name':_0x5c09('0x71'),'value':_0x5c09('0x72')},{'name':_0x5c09('0x73'),'value':_0x5c09('0x74')}]:[]};})};}})[_0x5c09('0x23')](respondWithResult(_0x3dc8cf,null))[_0x5c09('0x41')](function(_0x161b1e){var _0x359e9a=_0x4562b5['query'][_0x5c09('0x75')]?0x1f4:_0x161b1e[_0x5c09('0x76')]||0x1f4;logger[_0x5c09('0x24')](_0x5c09('0x77'),_0x5c09('0x78'),_0x359e9a,JSON['stringify'](_0x161b1e));delete _0x161b1e[_0x5c09('0x26')];if(_0x359e9a===0x191){_0x359e9a=0x190;}_0x3dc8cf['status'](_0x359e9a)[_0x5c09('0x27')](_0x4562b5[_0x5c09('0x30')][_0x5c09('0x75')]?{'message':_0x5c09('0x79'),'statusCode':_0x161b1e[_0x5c09('0x76')]}:_0x161b1e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 3dfae9d..4e44dd4 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 _0x3397=['util','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0x3397,0x1a3));var _0x7339=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3397[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7339('0x2'));var BPromise=require(_0x7339('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7339('0x4'));var rimraf=require(_0x7339('0x5'));var config=require(_0x7339('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x7339('0x7'));module[_0x7339('0x8')]=function(_0x1e42c4,_0x24b6bc){return _0x1e42c4['define']('SalesforceAccount',attributes,{'tableName':_0x7339('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcd0=['../../config/environment','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts','lodash','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x3bcef6,_0x242a22){var _0x1020f9=function(_0x240391){while(--_0x240391){_0x3bcef6['push'](_0x3bcef6['shift']());}};_0x1020f9(++_0x242a22);}(_0xdcd0,0xb9));var _0x0dcd=function(_0x55c19d,_0x13f94c){_0x55c19d=_0x55c19d-0x0;var _0x3437c8=_0xdcd0[_0x55c19d];return _0x3437c8;};'use strict';var _=require(_0x0dcd('0x0'));var util=require('util');var logger=require(_0x0dcd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0dcd('0x2'));var rp=require(_0x0dcd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dcd('0x4'));var config=require(_0x0dcd('0x5'));var attributes=require(_0x0dcd('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x0dcd('0x7')]=function(_0x440bdd,_0x19ac5a){return _0x440bdd[_0x0dcd('0x8')]('SalesforceAccount',attributes,{'tableName':_0x0dcd('0x9'),'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 91524bf..8f2ab98 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 _0xdc45=['ShowSalesforceAccount','find','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','limit','include','map','attributes','model','stringify'];(function(_0x35de6f,_0x42689b){var _0x478c89=function(_0x39015f){while(--_0x39015f){_0x35de6f['push'](_0x35de6f['shift']());}};_0x478c89(++_0x42689b);}(_0xdc45,0x156));var _0x5dc4=function(_0x20cdea,_0x57e509){_0x20cdea=_0x20cdea-0x0;var _0x58e655=_0xdc45[_0x20cdea];return _0x58e655;};'use strict';var _=require(_0x5dc4('0x0'));var util=require(_0x5dc4('0x1'));var moment=require(_0x5dc4('0x2'));var BPromise=require('bluebird');var rs=require(_0x5dc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5dc4('0x4'));var logger=require(_0x5dc4('0x5'))(_0x5dc4('0x6'));var config=require(_0x5dc4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dc4('0x8')][_0x5dc4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438a82,_0x480ab2,_0x5268e4){return new BPromise(function(_0xd60c91,_0x5f0a20){return client[_0x5dc4('0xa')](_0x438a82,_0x5268e4)[_0x5dc4('0xb')](function(_0x429c49){logger[_0x5dc4('0xc')](_0x5dc4('0xd'),_0x480ab2,'request\x20sent');logger[_0x5dc4('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x480ab2,_0x5dc4('0xf'),JSON['stringify'](_0x429c49));if(_0x429c49[_0x5dc4('0x10')]){if(_0x429c49[_0x5dc4('0x10')][_0x5dc4('0x11')]===0x1f4){logger['error'](_0x5dc4('0xd'),_0x480ab2,_0x429c49[_0x5dc4('0x10')][_0x5dc4('0x12')]);return _0x5f0a20(_0x429c49[_0x5dc4('0x10')][_0x5dc4('0x12')]);}logger[_0x5dc4('0x10')](_0x5dc4('0xd'),_0x480ab2,_0x429c49[_0x5dc4('0x10')][_0x5dc4('0x12')]);return _0xd60c91(_0x429c49['error'][_0x5dc4('0x12')]);}else{logger[_0x5dc4('0xc')](_0x5dc4('0xd'),_0x480ab2,_0x5dc4('0xf'));_0xd60c91(_0x429c49[_0x5dc4('0x13')][_0x5dc4('0x12')]);}})[_0x5dc4('0x14')](function(_0x42606b){logger[_0x5dc4('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x480ab2,_0x42606b);_0x5f0a20(_0x42606b);});});}exports[_0x5dc4('0x15')]=function(_0x5d528b){var _0x54647f=this;return new Promise(function(_0x30204b,_0x42f537){return db[_0x5dc4('0x16')]['findAll']({'raw':_0x5d528b[_0x5dc4('0x17')]?_0x5d528b[_0x5dc4('0x17')][_0x5dc4('0x18')]===undefined?!![]:![]:!![],'where':_0x5d528b[_0x5dc4('0x17')]?_0x5d528b[_0x5dc4('0x17')][_0x5dc4('0x19')]||null:null,'attributes':_0x5d528b[_0x5dc4('0x17')]?_0x5d528b[_0x5dc4('0x17')]['attributes']||null:null,'limit':_0x5d528b['options']?_0x5d528b[_0x5dc4('0x17')][_0x5dc4('0x1a')]||null:null,'include':_0x5d528b[_0x5dc4('0x17')]?_0x5d528b['options'][_0x5dc4('0x1b')]?_[_0x5dc4('0x1c')](_0x5d528b['options'][_0x5dc4('0x1b')],function(_0x146b81){return{'model':db[_0x146b81['model']],'as':_0x146b81['as'],'attributes':_0x146b81[_0x5dc4('0x1d')],'include':_0x146b81['include']?_[_0x5dc4('0x1c')](_0x146b81[_0x5dc4('0x1b')],function(_0x45c603){return{'model':db[_0x45c603[_0x5dc4('0x1e')]],'as':_0x45c603['as'],'attributes':_0x45c603[_0x5dc4('0x1d')],'include':_0x45c603[_0x5dc4('0x1b')]?_['map'](_0x45c603[_0x5dc4('0x1b')],function(_0x1002f5){return{'model':db[_0x1002f5[_0x5dc4('0x1e')]],'as':_0x1002f5['as'],'attributes':_0x1002f5[_0x5dc4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5dc4('0xb')](function(_0x45ed58){logger['info'](_0x5dc4('0x15'),_0x5d528b);logger[_0x5dc4('0xe')](_0x5dc4('0x15'),_0x5d528b,JSON[_0x5dc4('0x1f')](_0x45ed58));_0x30204b(_0x45ed58);})[_0x5dc4('0x14')](function(_0x24d4f0){logger[_0x5dc4('0x10')](_0x5dc4('0x15'),_0x24d4f0['message'],_0x5d528b);_0x42f537(_0x54647f[_0x5dc4('0x10')](0x1f4,_0x24d4f0[_0x5dc4('0x12')]));});});};exports[_0x5dc4('0x20')]=function(_0x284dd9){var _0x148754=this;return new Promise(function(_0x4c195b,_0x23ad95){return db[_0x5dc4('0x16')][_0x5dc4('0x21')]({'raw':_0x284dd9[_0x5dc4('0x17')]?_0x284dd9[_0x5dc4('0x17')][_0x5dc4('0x18')]===undefined?!![]:![]:!![],'where':_0x284dd9['options']?_0x284dd9['options']['where']||null:null,'attributes':_0x284dd9['options']?_0x284dd9[_0x5dc4('0x17')]['attributes']||null:null,'include':_0x284dd9['options']?_0x284dd9['options'][_0x5dc4('0x1b')]?_[_0x5dc4('0x1c')](_0x284dd9[_0x5dc4('0x17')][_0x5dc4('0x1b')],function(_0x334772){return{'model':db[_0x334772[_0x5dc4('0x1e')]],'as':_0x334772['as'],'attributes':_0x334772['attributes'],'include':_0x334772[_0x5dc4('0x1b')]?_[_0x5dc4('0x1c')](_0x334772[_0x5dc4('0x1b')],function(_0x5ed0fc){return{'model':db[_0x5ed0fc['model']],'as':_0x5ed0fc['as'],'attributes':_0x5ed0fc['attributes'],'include':_0x5ed0fc[_0x5dc4('0x1b')]?_[_0x5dc4('0x1c')](_0x5ed0fc['include'],function(_0x34f0dc){return{'model':db[_0x34f0dc[_0x5dc4('0x1e')]],'as':_0x34f0dc['as'],'attributes':_0x34f0dc[_0x5dc4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13b8f7){logger[_0x5dc4('0xc')](_0x5dc4('0x20'),_0x284dd9);logger['debug'](_0x5dc4('0x20'),_0x284dd9,JSON[_0x5dc4('0x1f')](_0x13b8f7));_0x4c195b(_0x13b8f7);})[_0x5dc4('0x14')](function(_0x2742e7){logger['error']('ShowSalesforceAccount',_0x2742e7[_0x5dc4('0x12')],_0x284dd9);_0x23ad95(_0x148754[_0x5dc4('0x10')](0x1f4,_0x2742e7[_0x5dc4('0x12')]));});});}; \ No newline at end of file +var _0x2bce=['find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','stringify','ShowSalesforceAccount'];(function(_0x29279c,_0x570176){var _0x279b1f=function(_0xd36d1f){while(--_0xd36d1f){_0x29279c['push'](_0x29279c['shift']());}};_0x279b1f(++_0x570176);}(_0x2bce,0x6d));var _0xe2bc=function(_0x356159,_0x3f9ae1){_0x356159=_0x356159-0x0;var _0x1488c4=_0x2bce[_0x356159];return _0x1488c4;};'use strict';var _=require(_0xe2bc('0x0'));var util=require(_0xe2bc('0x1'));var moment=require(_0xe2bc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2bc('0x4'))['db'];var utils=require(_0xe2bc('0x5'));var logger=require(_0xe2bc('0x6'))(_0xe2bc('0x7'));var config=require(_0xe2bc('0x8'));var jayson=require(_0xe2bc('0x9'));var client=jayson['client'][_0xe2bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494308,_0x4f5cf,_0x43e828){return new BPromise(function(_0x13b676,_0x316fc4){return client['request'](_0x494308,_0x43e828)[_0xe2bc('0xb')](function(_0x57d41b){logger[_0xe2bc('0xc')](_0xe2bc('0xd'),_0x4f5cf,'request\x20sent');logger[_0xe2bc('0xe')](_0xe2bc('0xf'),_0x4f5cf,_0xe2bc('0x10'),JSON['stringify'](_0x57d41b));if(_0x57d41b['error']){if(_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x12')]===0x1f4){logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x13')]);return _0x316fc4(_0x57d41b[_0xe2bc('0x11')][_0xe2bc('0x13')]);}logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x57d41b['error'][_0xe2bc('0x13')]);return _0x13b676(_0x57d41b['error'][_0xe2bc('0x13')]);}else{logger[_0xe2bc('0xc')](_0xe2bc('0xd'),_0x4f5cf,_0xe2bc('0x10'));_0x13b676(_0x57d41b[_0xe2bc('0x14')][_0xe2bc('0x13')]);}})[_0xe2bc('0x15')](function(_0x59af2e){logger[_0xe2bc('0x11')](_0xe2bc('0xd'),_0x4f5cf,_0x59af2e);_0x316fc4(_0x59af2e);});});}exports['GetSalesforceAccount']=function(_0x36dbb1){var _0x152ae7=this;return new Promise(function(_0x568cf7,_0x64baa3){return db[_0xe2bc('0x16')][_0xe2bc('0x17')]({'raw':_0x36dbb1['options']?_0x36dbb1[_0xe2bc('0x18')][_0xe2bc('0x19')]===undefined?!![]:![]:!![],'where':_0x36dbb1[_0xe2bc('0x18')]?_0x36dbb1[_0xe2bc('0x18')][_0xe2bc('0x1a')]||null:null,'attributes':_0x36dbb1[_0xe2bc('0x18')]?_0x36dbb1[_0xe2bc('0x18')][_0xe2bc('0x1b')]||null:null,'limit':_0x36dbb1[_0xe2bc('0x18')]?_0x36dbb1['options'][_0xe2bc('0x1c')]||null:null,'include':_0x36dbb1['options']?_0x36dbb1[_0xe2bc('0x18')][_0xe2bc('0x1d')]?_[_0xe2bc('0x1e')](_0x36dbb1[_0xe2bc('0x18')][_0xe2bc('0x1d')],function(_0x373942){return{'model':db[_0x373942[_0xe2bc('0x1f')]],'as':_0x373942['as'],'attributes':_0x373942['attributes'],'include':_0x373942[_0xe2bc('0x1d')]?_[_0xe2bc('0x1e')](_0x373942['include'],function(_0x2a16f0){return{'model':db[_0x2a16f0[_0xe2bc('0x1f')]],'as':_0x2a16f0['as'],'attributes':_0x2a16f0[_0xe2bc('0x1b')],'include':_0x2a16f0[_0xe2bc('0x1d')]?_[_0xe2bc('0x1e')](_0x2a16f0[_0xe2bc('0x1d')],function(_0x436f20){return{'model':db[_0x436f20[_0xe2bc('0x1f')]],'as':_0x436f20['as'],'attributes':_0x436f20[_0xe2bc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b0e05){logger[_0xe2bc('0xc')](_0xe2bc('0x20'),_0x36dbb1);logger[_0xe2bc('0xe')](_0xe2bc('0x20'),_0x36dbb1,JSON[_0xe2bc('0x21')](_0x1b0e05));_0x568cf7(_0x1b0e05);})[_0xe2bc('0x15')](function(_0x10e98c){logger[_0xe2bc('0x11')](_0xe2bc('0x20'),_0x10e98c[_0xe2bc('0x13')],_0x36dbb1);_0x64baa3(_0x152ae7[_0xe2bc('0x11')](0x1f4,_0x10e98c[_0xe2bc('0x13')]));});});};exports[_0xe2bc('0x22')]=function(_0x35ebbf){var _0x2b140c=this;return new Promise(function(_0x1cb9c4,_0x704e3c){return db[_0xe2bc('0x16')][_0xe2bc('0x23')]({'raw':_0x35ebbf['options']?_0x35ebbf[_0xe2bc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x35ebbf['options']?_0x35ebbf[_0xe2bc('0x18')]['where']||null:null,'attributes':_0x35ebbf[_0xe2bc('0x18')]?_0x35ebbf[_0xe2bc('0x18')][_0xe2bc('0x1b')]||null:null,'include':_0x35ebbf['options']?_0x35ebbf[_0xe2bc('0x18')][_0xe2bc('0x1d')]?_['map'](_0x35ebbf[_0xe2bc('0x18')]['include'],function(_0x437249){return{'model':db[_0x437249[_0xe2bc('0x1f')]],'as':_0x437249['as'],'attributes':_0x437249[_0xe2bc('0x1b')],'include':_0x437249['include']?_[_0xe2bc('0x1e')](_0x437249[_0xe2bc('0x1d')],function(_0x14f151){return{'model':db[_0x14f151[_0xe2bc('0x1f')]],'as':_0x14f151['as'],'attributes':_0x14f151['attributes'],'include':_0x14f151['include']?_[_0xe2bc('0x1e')](_0x14f151[_0xe2bc('0x1d')],function(_0x45ed59){return{'model':db[_0x45ed59[_0xe2bc('0x1f')]],'as':_0x45ed59['as'],'attributes':_0x45ed59[_0xe2bc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe2bc('0xb')](function(_0x14f79a){logger[_0xe2bc('0xc')](_0xe2bc('0x22'),_0x35ebbf);logger['debug']('ShowSalesforceAccount',_0x35ebbf,JSON[_0xe2bc('0x21')](_0x14f79a));_0x1cb9c4(_0x14f79a);})[_0xe2bc('0x15')](function(_0x3ce838){logger['error'](_0xe2bc('0x22'),_0x3ce838[_0xe2bc('0x13')],_0x35ebbf);_0x704e3c(_0x2b140c[_0xe2bc('0x11')](0x1f4,_0x3ce838['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 43a0a18..4cbe92f 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x70d5e9,_0x5eef5d){var _0x5df019=function(_0xcc7f4b){while(--_0xcc7f4b){_0x70d5e9['push'](_0x70d5e9['shift']());}};_0x5df019(++_0x5eef5d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4750ca,_0x2e513b){_0x4750ca=_0x4750ca-0x0;var _0x2f6418=_0x5f2f[_0x4750ca];return _0x2f6418;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xdb28,0x106));var _0x8db2=function(_0x1c1a48,_0x1e2638){_0x1c1a48=_0x1c1a48-0x0;var _0x579fe9=_0xdb28[_0x1c1a48];return _0x579fe9;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3e10e7a..20975e4 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 _0xbfca=['STRING','ENUM','Case','Task','contact','account_contact_lead','account','contact_lead','nothing','lead','sequelize','exports'];(function(_0x50ab95,_0x480438){var _0x2c62cd=function(_0x2af369){while(--_0x2af369){_0x50ab95['push'](_0x50ab95['shift']());}};_0x2c62cd(++_0x480438);}(_0xbfca,0x112));var _0xabfc=function(_0x4d33f9,_0x431815){_0x4d33f9=_0x4d33f9-0x0;var _0x4d4ced=_0xbfca[_0x4d33f9];return _0x4d4ced;};'use strict';var Sequelize=require(_0xabfc('0x0'));module[_0xabfc('0x1')]={'name':{'type':Sequelize[_0xabfc('0x2')]},'description':{'type':Sequelize[_0xabfc('0x2')]},'ticketType':{'type':Sequelize[_0xabfc('0x3')]('Task',_0xabfc('0x4')),'defaultValue':_0xabfc('0x5')},'moduleSearch':{'type':Sequelize[_0xabfc('0x3')]('contact_lead',_0xabfc('0x6'),'lead',_0xabfc('0x7'),_0xabfc('0x8')),'defaultValue':_0xabfc('0x9')},'moduleCreate':{'type':Sequelize[_0xabfc('0x3')](_0xabfc('0xa'),_0xabfc('0x6'),_0xabfc('0xb'),'account'),'defaultValue':_0xabfc('0xb')},'leadId':{'type':Sequelize[_0xabfc('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xabfc('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xabfc('0x2')]}}; \ No newline at end of file +var _0x99f5=['lead','account_contact_lead','account','nothing','contact','exports','STRING','Task','ENUM','contact_lead'];(function(_0x3109e6,_0x3e0450){var _0x12aed5=function(_0x492ec2){while(--_0x492ec2){_0x3109e6['push'](_0x3109e6['shift']());}};_0x12aed5(++_0x3e0450);}(_0x99f5,0x16d));var _0x599f=function(_0x4f8835,_0x270e13){_0x4f8835=_0x4f8835-0x0;var _0x5c75fe=_0x99f5[_0x4f8835];return _0x5c75fe;};'use strict';var Sequelize=require('sequelize');module[_0x599f('0x0')]={'name':{'type':Sequelize[_0x599f('0x1')]},'description':{'type':Sequelize[_0x599f('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x599f('0x2'),'Case'),'defaultValue':_0x599f('0x2')},'moduleSearch':{'type':Sequelize[_0x599f('0x3')](_0x599f('0x4'),'contact',_0x599f('0x5'),_0x599f('0x6'),_0x599f('0x7')),'defaultValue':_0x599f('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x599f('0x8'),_0x599f('0x9'),_0x599f('0x5'),_0x599f('0x7')),'defaultValue':_0x599f('0x5')},'leadId':{'type':Sequelize[_0x599f('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x599f('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x599f('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x599f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c4fee20..54aa09b 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 _0x3e1f=['util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','find','catch','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x3e1f,0x18a));var _0xf3e1=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0x3e1f[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3e1('0x0'));var zipdir=require(_0xf3e1('0x1'));var jsonpatch=require(_0xf3e1('0x2'));var rp=require('request-promise');var moment=require(_0xf3e1('0x3'));var BPromise=require(_0xf3e1('0x4'));var Mustache=require(_0xf3e1('0x5'));var util=require(_0xf3e1('0x6'));var path=require(_0xf3e1('0x7'));var sox=require('sox');var csv=require(_0xf3e1('0x8'));var ejs=require(_0xf3e1('0x9'));var fs=require('fs');var fs_extra=require(_0xf3e1('0xa'));var _=require(_0xf3e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3e1('0xc'));var deskjs=require(_0xf3e1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf3e1('0xe'));var Papa=require(_0xf3e1('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf3e1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf3e1('0x11'));var logger=require(_0xf3e1('0x12'))(_0xf3e1('0x13'));var utils=require(_0xf3e1('0x14'));var config=require(_0xf3e1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3e1('0x16'))['db'];function respondWithStatusCode(_0x58ab03,_0xb69ec0){_0xb69ec0=_0xb69ec0||0xcc;return function(_0x449ed7){if(_0x449ed7){return _0x58ab03['sendStatus'](_0xb69ec0);}return _0x58ab03[_0xf3e1('0x17')](_0xb69ec0)[_0xf3e1('0x18')]();};}function respondWithResult(_0xfc07a2,_0x2f4722){_0x2f4722=_0x2f4722||0xc8;return function(_0x395668){if(_0x395668){return _0xfc07a2['status'](_0x2f4722)[_0xf3e1('0x19')](_0x395668);}};}function respondWithFilteredResult(_0x3061fa,_0xb18131){return function(_0x3dea57){if(_0x3dea57){var _0x3bce21=typeof _0xb18131[_0xf3e1('0x1a')]==='undefined'&&typeof _0xb18131[_0xf3e1('0x1b')]===_0xf3e1('0x1c');var _0x1bcb42=_0x3dea57[_0xf3e1('0x1d')];var _0x49b90c=_0x3bce21?0x0:_0xb18131[_0xf3e1('0x1a')];var _0x1598c0=_0x3bce21?_0x3dea57[_0xf3e1('0x1d')]:_0xb18131['offset']+_0xb18131[_0xf3e1('0x1b')];var _0xd97824;if(_0x1598c0>=_0x1bcb42){_0x1598c0=_0x1bcb42;_0xd97824=0xc8;}else{_0xd97824=0xce;}_0x3061fa[_0xf3e1('0x17')](_0xd97824);return _0x3061fa[_0xf3e1('0x1e')](_0xf3e1('0x1f'),_0x49b90c+'-'+_0x1598c0+'/'+_0x1bcb42)[_0xf3e1('0x19')](_0x3dea57);}return null;};}function patchUpdates(_0x3fd1ce){return function(_0x37828b){try{jsonpatch[_0xf3e1('0x20')](_0x37828b,_0x3fd1ce,!![]);}catch(_0x4eb593){return BPromise[_0xf3e1('0x21')](_0x4eb593);}return _0x37828b[_0xf3e1('0x22')]();};}function saveUpdates(_0xdb0be4,_0x48aa67){return function(_0x1f84b5){if(_0x1f84b5){return _0x1f84b5[_0xf3e1('0x23')](_0xdb0be4)[_0xf3e1('0x24')](function(_0x59532a){return _0x59532a;});}return null;};}function removeEntity(_0x139291,_0x4a8b38){return function(_0x2b26b9){if(_0x2b26b9){return _0x2b26b9[_0xf3e1('0x25')]()[_0xf3e1('0x24')](function(){_0x139291['status'](0xcc)[_0xf3e1('0x18')]();});}};}function handleEntityNotFound(_0x3d7c3f,_0x248b84){return function(_0x324449){if(!_0x324449){_0x3d7c3f[_0xf3e1('0x26')](0x194);}return _0x324449;};}function handleError(_0x44668c,_0x487a5e){_0x487a5e=_0x487a5e||0x1f4;return function(_0xa9bf1a){logger[_0xf3e1('0x27')](_0xa9bf1a[_0xf3e1('0x28')]);if(_0xa9bf1a['name']){delete _0xa9bf1a[_0xf3e1('0x29')];}_0x44668c[_0xf3e1('0x17')](_0x487a5e)[_0xf3e1('0x2a')](_0xa9bf1a);};}exports['index']=function(_0x34d523,_0x28210){var _0x38bd5c={},_0x221bdb={},_0xc9b5f9={'count':0x0,'rows':[]};var _0x19db85=_[_0xf3e1('0x2b')](db['SalesforceConfiguration'][_0xf3e1('0x2c')],function(_0x1e4fea){return{'name':_0x1e4fea[_0xf3e1('0x2d')],'type':_0x1e4fea[_0xf3e1('0x2e')]['key']};});_0x221bdb['model']=_[_0xf3e1('0x2b')](_0x19db85,'name');_0x221bdb[_0xf3e1('0x2f')]=_[_0xf3e1('0x30')](_0x34d523[_0xf3e1('0x2f')]);_0x221bdb[_0xf3e1('0x31')]=_[_0xf3e1('0x32')](_0x221bdb[_0xf3e1('0x33')],_0x221bdb[_0xf3e1('0x2f')]);_0x38bd5c[_0xf3e1('0x34')]=_[_0xf3e1('0x32')](_0x221bdb['model'],qs[_0xf3e1('0x35')](_0x34d523[_0xf3e1('0x2f')][_0xf3e1('0x35')]));_0x38bd5c[_0xf3e1('0x34')]=_0x38bd5c[_0xf3e1('0x34')][_0xf3e1('0x36')]?_0x38bd5c[_0xf3e1('0x34')]:_0x221bdb[_0xf3e1('0x33')];if(!_0x34d523[_0xf3e1('0x2f')][_0xf3e1('0x37')](_0xf3e1('0x38'))){_0x38bd5c[_0xf3e1('0x1b')]=qs['limit'](_0x34d523[_0xf3e1('0x2f')][_0xf3e1('0x1b')]);_0x38bd5c[_0xf3e1('0x1a')]=qs[_0xf3e1('0x1a')](_0x34d523[_0xf3e1('0x2f')][_0xf3e1('0x1a')]);}_0x38bd5c[_0xf3e1('0x39')]=qs[_0xf3e1('0x3a')](_0x34d523[_0xf3e1('0x2f')]['sort']);_0x38bd5c[_0xf3e1('0x3b')]=qs[_0xf3e1('0x31')](_[_0xf3e1('0x3c')](_0x34d523['query'],_0x221bdb[_0xf3e1('0x31')]),_0x19db85);if(_0x34d523['query'][_0xf3e1('0x3d')]){_0x38bd5c[_0xf3e1('0x3b')]=_['merge'](_0x38bd5c[_0xf3e1('0x3b')],{'$or':_[_0xf3e1('0x2b')](_0x19db85,function(_0x571131){if(_0x571131[_0xf3e1('0x2e')]!==_0xf3e1('0x3e')){var _0x126ebd={};_0x126ebd[_0x571131[_0xf3e1('0x29')]]={'$like':'%'+_0x34d523['query']['filter']+'%'};return _0x126ebd;}})});}_0x38bd5c=_[_0xf3e1('0x3f')]({},_0x38bd5c,_0x34d523[_0xf3e1('0x40')]);var _0x4d9aa7={'where':_0x38bd5c['where']};return db[_0xf3e1('0x41')][_0xf3e1('0x1d')](_0x4d9aa7)[_0xf3e1('0x24')](function(_0x19feeb){_0xc9b5f9['count']=_0x19feeb;if(_0x34d523[_0xf3e1('0x2f')][_0xf3e1('0x42')]){_0x38bd5c[_0xf3e1('0x43')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xf3e1('0x44')](_0x38bd5c);})[_0xf3e1('0x24')](function(_0xa6bc52){_0xc9b5f9[_0xf3e1('0x45')]=_0xa6bc52;return _0xc9b5f9;})['then'](respondWithFilteredResult(_0x28210,_0x38bd5c))['catch'](handleError(_0x28210,null));};exports['show']=function(_0x23a45e,_0x564b8c){var _0x51700d={'raw':![],'where':{'id':_0x23a45e['params']['id']}},_0x127b14={};_0x127b14[_0xf3e1('0x33')]=_['keys'](db[_0xf3e1('0x41')][_0xf3e1('0x2c')]);_0x127b14['query']=_[_0xf3e1('0x30')](_0x23a45e[_0xf3e1('0x2f')]);_0x127b14[_0xf3e1('0x31')]=_['intersection'](_0x127b14['model'],_0x127b14['query']);_0x51700d['attributes']=_[_0xf3e1('0x32')](_0x127b14[_0xf3e1('0x33')],qs[_0xf3e1('0x35')](_0x23a45e['query'][_0xf3e1('0x35')]));_0x51700d[_0xf3e1('0x34')]=_0x51700d[_0xf3e1('0x34')]['length']?_0x51700d[_0xf3e1('0x34')]:_0x127b14['model'];if(_0x23a45e[_0xf3e1('0x2f')][_0xf3e1('0x42')]){_0x51700d[_0xf3e1('0x43')]=[{'all':!![]}];}_0x51700d=_[_0xf3e1('0x3f')]({},_0x51700d,_0x23a45e[_0xf3e1('0x40')]);return db['SalesforceConfiguration'][_0xf3e1('0x46')](_0x51700d)['then'](handleEntityNotFound(_0x564b8c,null))[_0xf3e1('0x24')](respondWithResult(_0x564b8c,null))[_0xf3e1('0x47')](handleError(_0x564b8c,null));};exports[_0xf3e1('0x48')]=function(_0x10e849,_0x45c23e){return db['SalesforceConfiguration'][_0xf3e1('0x48')](_0x10e849[_0xf3e1('0x49')],{})[_0xf3e1('0x24')](respondWithResult(_0x45c23e,0xc9))[_0xf3e1('0x47')](handleError(_0x45c23e,null));};exports[_0xf3e1('0x23')]=function(_0x4e923c,_0x249c5d){if(_0x4e923c['body']['id']){delete _0x4e923c[_0xf3e1('0x49')]['id'];}return db[_0xf3e1('0x41')][_0xf3e1('0x46')]({'where':{'id':_0x4e923c[_0xf3e1('0x4a')]['id']}})[_0xf3e1('0x24')](handleEntityNotFound(_0x249c5d,null))[_0xf3e1('0x24')](saveUpdates(_0x4e923c[_0xf3e1('0x49')],null))[_0xf3e1('0x24')](respondWithResult(_0x249c5d,null))[_0xf3e1('0x47')](handleError(_0x249c5d,null));};exports[_0xf3e1('0x25')]=function(_0x382599,_0x4439e2){return db[_0xf3e1('0x41')]['find']({'where':{'id':_0x382599[_0xf3e1('0x4a')]['id']}})[_0xf3e1('0x24')](handleEntityNotFound(_0x4439e2,null))[_0xf3e1('0x24')](removeEntity(_0x4439e2,null))[_0xf3e1('0x47')](handleError(_0x4439e2,null));};exports[_0xf3e1('0x4b')]=function(_0x38b41c,_0x1971cb,_0x4ba0c4){var _0x3a073e={};var _0x3d4018={};var _0x1d5617;var _0x212357;return db[_0xf3e1('0x41')][_0xf3e1('0x4c')]({'where':{'id':_0x38b41c[_0xf3e1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1971cb,null))[_0xf3e1('0x24')](function(_0x10fcbb){if(_0x10fcbb){_0x1d5617=_0x10fcbb;_0x3d4018[_0xf3e1('0x33')]=_[_0xf3e1('0x30')](db[_0xf3e1('0x4d')][_0xf3e1('0x2c')]);_0x3d4018['query']=_[_0xf3e1('0x30')](_0x38b41c[_0xf3e1('0x2f')]);_0x3d4018[_0xf3e1('0x31')]=_[_0xf3e1('0x32')](_0x3d4018['model'],_0x3d4018[_0xf3e1('0x2f')]);_0x3a073e['attributes']=_[_0xf3e1('0x32')](_0x3d4018[_0xf3e1('0x33')],qs[_0xf3e1('0x35')](_0x38b41c[_0xf3e1('0x2f')]['fields']));_0x3a073e[_0xf3e1('0x34')]=_0x3a073e[_0xf3e1('0x34')][_0xf3e1('0x36')]?_0x3a073e['attributes']:_0x3d4018['model'];_0x3a073e['order']=qs['sort'](_0x38b41c[_0xf3e1('0x2f')][_0xf3e1('0x3a')]);_0x3a073e[_0xf3e1('0x3b')]=qs[_0xf3e1('0x31')](_[_0xf3e1('0x3c')](_0x38b41c[_0xf3e1('0x2f')],_0x3d4018['filters']));if(_0x38b41c[_0xf3e1('0x2f')][_0xf3e1('0x3d')]){_0x3a073e[_0xf3e1('0x3b')]=_[_0xf3e1('0x3f')](_0x3a073e[_0xf3e1('0x3b')],{'$or':_[_0xf3e1('0x2b')](_0x3a073e[_0xf3e1('0x34')],function(_0x4c20ae){var _0x3dae28={};_0x3dae28[_0x4c20ae]={'$like':'%'+_0x38b41c[_0xf3e1('0x2f')][_0xf3e1('0x3d')]+'%'};return _0x3dae28;})});}_0x3a073e=_[_0xf3e1('0x3f')]({},_0x3a073e,_0x38b41c[_0xf3e1('0x40')]);return _0x1d5617['getFields'](_0x3a073e);}})[_0xf3e1('0x24')](function(_0x11a1ec){if(_0x11a1ec){_0x212357=_0x11a1ec[_0xf3e1('0x36')];if(!_0x38b41c[_0xf3e1('0x2f')][_0xf3e1('0x37')]('nolimit')){_0x3a073e[_0xf3e1('0x1b')]=qs[_0xf3e1('0x1b')](_0x38b41c[_0xf3e1('0x2f')][_0xf3e1('0x1b')]);_0x3a073e[_0xf3e1('0x1a')]=qs[_0xf3e1('0x1a')](_0x38b41c[_0xf3e1('0x2f')]['offset']);}return _0x1d5617[_0xf3e1('0x4b')](_0x3a073e);}})[_0xf3e1('0x24')](function(_0x10997b){if(_0x10997b){return _0x10997b?{'count':_0x212357,'rows':_0x10997b}:null;}})[_0xf3e1('0x24')](respondWithResult(_0x1971cb,null))[_0xf3e1('0x47')](handleError(_0x1971cb,null));};exports[_0xf3e1('0x4e')]=function(_0xf7a2b,_0x48a160,_0x3bf999){var _0x2fc593={};var _0x3c07e6={};var _0x46852a;var _0x1e92e6;return db['SalesforceConfiguration'][_0xf3e1('0x4c')]({'where':{'id':_0xf7a2b[_0xf3e1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48a160,null))[_0xf3e1('0x24')](function(_0xa5377b){if(_0xa5377b){_0x46852a=_0xa5377b;_0x3c07e6[_0xf3e1('0x33')]=_[_0xf3e1('0x30')](db[_0xf3e1('0x4d')]['rawAttributes']);_0x3c07e6[_0xf3e1('0x2f')]=_[_0xf3e1('0x30')](_0xf7a2b[_0xf3e1('0x2f')]);_0x3c07e6[_0xf3e1('0x31')]=_[_0xf3e1('0x32')](_0x3c07e6[_0xf3e1('0x33')],_0x3c07e6[_0xf3e1('0x2f')]);_0x2fc593[_0xf3e1('0x34')]=_['intersection'](_0x3c07e6[_0xf3e1('0x33')],qs[_0xf3e1('0x35')](_0xf7a2b[_0xf3e1('0x2f')][_0xf3e1('0x35')]));_0x2fc593['attributes']=_0x2fc593[_0xf3e1('0x34')][_0xf3e1('0x36')]?_0x2fc593[_0xf3e1('0x34')]:_0x3c07e6[_0xf3e1('0x33')];_0x2fc593[_0xf3e1('0x39')]=qs[_0xf3e1('0x3a')](_0xf7a2b[_0xf3e1('0x2f')][_0xf3e1('0x3a')]);_0x2fc593[_0xf3e1('0x3b')]=qs[_0xf3e1('0x31')](_[_0xf3e1('0x3c')](_0xf7a2b['query'],_0x3c07e6[_0xf3e1('0x31')]));if(_0xf7a2b[_0xf3e1('0x2f')]['filter']){_0x2fc593[_0xf3e1('0x3b')]=_[_0xf3e1('0x3f')](_0x2fc593[_0xf3e1('0x3b')],{'$or':_[_0xf3e1('0x2b')](_0x2fc593[_0xf3e1('0x34')],function(_0x273107){var _0x40cc33={};_0x40cc33[_0x273107]={'$like':'%'+_0xf7a2b['query'][_0xf3e1('0x3d')]+'%'};return _0x40cc33;})});}_0x2fc593=_[_0xf3e1('0x3f')]({},_0x2fc593,_0xf7a2b[_0xf3e1('0x40')]);return _0x46852a['getSubjects'](_0x2fc593);}})[_0xf3e1('0x24')](function(_0xaba7bd){if(_0xaba7bd){_0x1e92e6=_0xaba7bd['length'];if(!_0xf7a2b[_0xf3e1('0x2f')][_0xf3e1('0x37')](_0xf3e1('0x38'))){_0x2fc593[_0xf3e1('0x1b')]=qs[_0xf3e1('0x1b')](_0xf7a2b[_0xf3e1('0x2f')][_0xf3e1('0x1b')]);_0x2fc593['offset']=qs['offset'](_0xf7a2b[_0xf3e1('0x2f')][_0xf3e1('0x1a')]);}return _0x46852a[_0xf3e1('0x4e')](_0x2fc593);}})[_0xf3e1('0x24')](function(_0x40cf2b){if(_0x40cf2b){return _0x40cf2b?{'count':_0x1e92e6,'rows':_0x40cf2b}:null;}})['then'](respondWithResult(_0x48a160,null))['catch'](handleError(_0x48a160,null));};exports[_0xf3e1('0x4f')]=function(_0x55ddbc,_0x3f7792,_0x35e2d6){var _0x4bb6d5={};var _0x2a171e={};var _0x173e7c;var _0x242d83;return db[_0xf3e1('0x41')][_0xf3e1('0x4c')]({'where':{'id':_0x55ddbc['params']['id']}})['then'](handleEntityNotFound(_0x3f7792,null))[_0xf3e1('0x24')](function(_0x1b52b4){if(_0x1b52b4){_0x173e7c=_0x1b52b4;_0x2a171e[_0xf3e1('0x33')]=_[_0xf3e1('0x30')](db[_0xf3e1('0x4d')]['rawAttributes']);_0x2a171e[_0xf3e1('0x2f')]=_[_0xf3e1('0x30')](_0x55ddbc[_0xf3e1('0x2f')]);_0x2a171e['filters']=_[_0xf3e1('0x32')](_0x2a171e[_0xf3e1('0x33')],_0x2a171e[_0xf3e1('0x2f')]);_0x4bb6d5[_0xf3e1('0x34')]=_[_0xf3e1('0x32')](_0x2a171e[_0xf3e1('0x33')],qs[_0xf3e1('0x35')](_0x55ddbc[_0xf3e1('0x2f')]['fields']));_0x4bb6d5['attributes']=_0x4bb6d5[_0xf3e1('0x34')]['length']?_0x4bb6d5[_0xf3e1('0x34')]:_0x2a171e[_0xf3e1('0x33')];_0x4bb6d5[_0xf3e1('0x39')]=qs[_0xf3e1('0x3a')](_0x55ddbc[_0xf3e1('0x2f')][_0xf3e1('0x3a')]);_0x4bb6d5[_0xf3e1('0x3b')]=qs[_0xf3e1('0x31')](_[_0xf3e1('0x3c')](_0x55ddbc[_0xf3e1('0x2f')],_0x2a171e['filters']));if(_0x55ddbc[_0xf3e1('0x2f')]['filter']){_0x4bb6d5[_0xf3e1('0x3b')]=_['merge'](_0x4bb6d5[_0xf3e1('0x3b')],{'$or':_[_0xf3e1('0x2b')](_0x4bb6d5[_0xf3e1('0x34')],function(_0x169ed1){var _0xef6ca0={};_0xef6ca0[_0x169ed1]={'$like':'%'+_0x55ddbc[_0xf3e1('0x2f')][_0xf3e1('0x3d')]+'%'};return _0xef6ca0;})});}_0x4bb6d5=_['merge']({},_0x4bb6d5,_0x55ddbc[_0xf3e1('0x40')]);return _0x173e7c[_0xf3e1('0x4f')](_0x4bb6d5);}})[_0xf3e1('0x24')](function(_0x2d83dc){if(_0x2d83dc){_0x242d83=_0x2d83dc[_0xf3e1('0x36')];if(!_0x55ddbc[_0xf3e1('0x2f')]['hasOwnProperty'](_0xf3e1('0x38'))){_0x4bb6d5[_0xf3e1('0x1b')]=qs[_0xf3e1('0x1b')](_0x55ddbc['query']['limit']);_0x4bb6d5[_0xf3e1('0x1a')]=qs[_0xf3e1('0x1a')](_0x55ddbc[_0xf3e1('0x2f')][_0xf3e1('0x1a')]);}return _0x173e7c['getDescriptions'](_0x4bb6d5);}})['then'](function(_0x279956){if(_0x279956){return _0x279956?{'count':_0x242d83,'rows':_0x279956}:null;}})[_0xf3e1('0x24')](respondWithResult(_0x3f7792,null))[_0xf3e1('0x47')](handleError(_0x3f7792,null));}; \ No newline at end of file +var _0x4b0c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','catch','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2729cd,_0x462966){var _0x1c259=function(_0x51f3a4){while(--_0x51f3a4){_0x2729cd['push'](_0x2729cd['shift']());}};_0x1c259(++_0x462966);}(_0x4b0c,0x138));var _0xc4b0=function(_0x5b2e9b,_0x1f80f2){_0x5b2e9b=_0x5b2e9b-0x0;var _0x49dc70=_0x4b0c[_0x5b2e9b];return _0x49dc70;};'use strict';var emlformat=require(_0xc4b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4b0('0x1'));var jsonpatch=require(_0xc4b0('0x2'));var rp=require('request-promise');var moment=require(_0xc4b0('0x3'));var BPromise=require(_0xc4b0('0x4'));var Mustache=require(_0xc4b0('0x5'));var util=require(_0xc4b0('0x6'));var path=require(_0xc4b0('0x7'));var sox=require(_0xc4b0('0x8'));var csv=require(_0xc4b0('0x9'));var ejs=require(_0xc4b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4b0('0xb'));var squel=require(_0xc4b0('0xc'));var crypto=require(_0xc4b0('0xd'));var jsforce=require(_0xc4b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc4b0('0x9'));var querystring=require(_0xc4b0('0xf'));var Papa=require(_0xc4b0('0x10'));var Redis=require(_0xc4b0('0x11'));var authService=require(_0xc4b0('0x12'));var qs=require(_0xc4b0('0x13'));var as=require(_0xc4b0('0x14'));var hardwareService=require(_0xc4b0('0x15'));var logger=require(_0xc4b0('0x16'))(_0xc4b0('0x17'));var utils=require(_0xc4b0('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc4b0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50ed91,_0x4cccb5){_0x4cccb5=_0x4cccb5||0xcc;return function(_0x542faf){if(_0x542faf){return _0x50ed91[_0xc4b0('0x1a')](_0x4cccb5);}return _0x50ed91['status'](_0x4cccb5)[_0xc4b0('0x1b')]();};}function respondWithResult(_0x5f74ef,_0x5eba58){_0x5eba58=_0x5eba58||0xc8;return function(_0xf6cc8d){if(_0xf6cc8d){return _0x5f74ef['status'](_0x5eba58)[_0xc4b0('0x1c')](_0xf6cc8d);}};}function respondWithFilteredResult(_0x5ea045,_0x3476e0){return function(_0xa08988){if(_0xa08988){var _0x153ef1=typeof _0x3476e0[_0xc4b0('0x1d')]==='undefined'&&typeof _0x3476e0[_0xc4b0('0x1e')]===_0xc4b0('0x1f');var _0x32b3ba=_0xa08988[_0xc4b0('0x20')];var _0x2e5929=_0x153ef1?0x0:_0x3476e0[_0xc4b0('0x1d')];var _0x191d5c=_0x153ef1?_0xa08988['count']:_0x3476e0['offset']+_0x3476e0[_0xc4b0('0x1e')];var _0x236961;if(_0x191d5c>=_0x32b3ba){_0x191d5c=_0x32b3ba;_0x236961=0xc8;}else{_0x236961=0xce;}_0x5ea045[_0xc4b0('0x21')](_0x236961);return _0x5ea045['set'](_0xc4b0('0x22'),_0x2e5929+'-'+_0x191d5c+'/'+_0x32b3ba)[_0xc4b0('0x1c')](_0xa08988);}return null;};}function patchUpdates(_0x548399){return function(_0x275641){try{jsonpatch[_0xc4b0('0x23')](_0x275641,_0x548399,!![]);}catch(_0x57e782){return BPromise[_0xc4b0('0x24')](_0x57e782);}return _0x275641[_0xc4b0('0x25')]();};}function saveUpdates(_0x3a9e29,_0x3f9e11){return function(_0x248721){if(_0x248721){return _0x248721[_0xc4b0('0x26')](_0x3a9e29)['then'](function(_0x1fb4e0){return _0x1fb4e0;});}return null;};}function removeEntity(_0x1d714a,_0xdd3af6){return function(_0x5914fb){if(_0x5914fb){return _0x5914fb[_0xc4b0('0x27')]()[_0xc4b0('0x28')](function(){_0x1d714a[_0xc4b0('0x21')](0xcc)[_0xc4b0('0x1b')]();});}};}function handleEntityNotFound(_0x25e259,_0x306545){return function(_0x2fe684){if(!_0x2fe684){_0x25e259[_0xc4b0('0x1a')](0x194);}return _0x2fe684;};}function handleError(_0xe8470d,_0x87e9e){_0x87e9e=_0x87e9e||0x1f4;return function(_0x31379f){logger[_0xc4b0('0x29')](_0x31379f[_0xc4b0('0x2a')]);if(_0x31379f['name']){delete _0x31379f[_0xc4b0('0x2b')];}_0xe8470d[_0xc4b0('0x21')](_0x87e9e)[_0xc4b0('0x2c')](_0x31379f);};}exports[_0xc4b0('0x2d')]=function(_0x41c38d,_0x465e8a){var _0x2600a3={},_0x245f6f={},_0x1b1228={'count':0x0,'rows':[]};var _0x45b88c=_[_0xc4b0('0x2e')](db[_0xc4b0('0x2f')][_0xc4b0('0x30')],function(_0x59b088){return{'name':_0x59b088[_0xc4b0('0x31')],'type':_0x59b088[_0xc4b0('0x32')]['key']};});_0x245f6f[_0xc4b0('0x33')]=_[_0xc4b0('0x2e')](_0x45b88c,'name');_0x245f6f['query']=_[_0xc4b0('0x34')](_0x41c38d[_0xc4b0('0x35')]);_0x245f6f[_0xc4b0('0x36')]=_[_0xc4b0('0x37')](_0x245f6f[_0xc4b0('0x33')],_0x245f6f['query']);_0x2600a3[_0xc4b0('0x38')]=_['intersection'](_0x245f6f[_0xc4b0('0x33')],qs[_0xc4b0('0x39')](_0x41c38d['query'][_0xc4b0('0x39')]));_0x2600a3[_0xc4b0('0x38')]=_0x2600a3[_0xc4b0('0x38')][_0xc4b0('0x3a')]?_0x2600a3[_0xc4b0('0x38')]:_0x245f6f[_0xc4b0('0x33')];if(!_0x41c38d['query'][_0xc4b0('0x3b')](_0xc4b0('0x3c'))){_0x2600a3[_0xc4b0('0x1e')]=qs[_0xc4b0('0x1e')](_0x41c38d[_0xc4b0('0x35')][_0xc4b0('0x1e')]);_0x2600a3['offset']=qs[_0xc4b0('0x1d')](_0x41c38d[_0xc4b0('0x35')]['offset']);}_0x2600a3[_0xc4b0('0x3d')]=qs['sort'](_0x41c38d[_0xc4b0('0x35')][_0xc4b0('0x3e')]);_0x2600a3[_0xc4b0('0x3f')]=qs[_0xc4b0('0x36')](_[_0xc4b0('0x40')](_0x41c38d[_0xc4b0('0x35')],_0x245f6f[_0xc4b0('0x36')]),_0x45b88c);if(_0x41c38d[_0xc4b0('0x35')][_0xc4b0('0x41')]){_0x2600a3['where']=_['merge'](_0x2600a3[_0xc4b0('0x3f')],{'$or':_[_0xc4b0('0x2e')](_0x45b88c,function(_0xf1ac79){if(_0xf1ac79[_0xc4b0('0x32')]!==_0xc4b0('0x42')){var _0x310c26={};_0x310c26[_0xf1ac79[_0xc4b0('0x2b')]]={'$like':'%'+_0x41c38d[_0xc4b0('0x35')][_0xc4b0('0x41')]+'%'};return _0x310c26;}})});}_0x2600a3=_[_0xc4b0('0x43')]({},_0x2600a3,_0x41c38d[_0xc4b0('0x44')]);var _0x17bf8c={'where':_0x2600a3['where']};return db[_0xc4b0('0x2f')][_0xc4b0('0x20')](_0x17bf8c)[_0xc4b0('0x28')](function(_0x5dff89){_0x1b1228[_0xc4b0('0x20')]=_0x5dff89;if(_0x41c38d[_0xc4b0('0x35')]['includeAll']){_0x2600a3[_0xc4b0('0x45')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2600a3);})[_0xc4b0('0x28')](function(_0x5f31b1){_0x1b1228[_0xc4b0('0x46')]=_0x5f31b1;return _0x1b1228;})[_0xc4b0('0x28')](respondWithFilteredResult(_0x465e8a,_0x2600a3))['catch'](handleError(_0x465e8a,null));};exports[_0xc4b0('0x47')]=function(_0x3db619,_0x134602){var _0x1a16de={'raw':![],'where':{'id':_0x3db619[_0xc4b0('0x48')]['id']}},_0x592c96={};_0x592c96['model']=_[_0xc4b0('0x34')](db[_0xc4b0('0x2f')]['rawAttributes']);_0x592c96[_0xc4b0('0x35')]=_[_0xc4b0('0x34')](_0x3db619[_0xc4b0('0x35')]);_0x592c96[_0xc4b0('0x36')]=_[_0xc4b0('0x37')](_0x592c96[_0xc4b0('0x33')],_0x592c96[_0xc4b0('0x35')]);_0x1a16de['attributes']=_[_0xc4b0('0x37')](_0x592c96['model'],qs[_0xc4b0('0x39')](_0x3db619[_0xc4b0('0x35')]['fields']));_0x1a16de[_0xc4b0('0x38')]=_0x1a16de[_0xc4b0('0x38')][_0xc4b0('0x3a')]?_0x1a16de['attributes']:_0x592c96[_0xc4b0('0x33')];if(_0x3db619[_0xc4b0('0x35')][_0xc4b0('0x49')]){_0x1a16de['include']=[{'all':!![]}];}_0x1a16de=_[_0xc4b0('0x43')]({},_0x1a16de,_0x3db619['options']);return db[_0xc4b0('0x2f')][_0xc4b0('0x4a')](_0x1a16de)['then'](handleEntityNotFound(_0x134602,null))['then'](respondWithResult(_0x134602,null))[_0xc4b0('0x4b')](handleError(_0x134602,null));};exports[_0xc4b0('0x4c')]=function(_0x301ecd,_0x519203){return db['SalesforceConfiguration'][_0xc4b0('0x4c')](_0x301ecd[_0xc4b0('0x4d')],{})['then'](respondWithResult(_0x519203,0xc9))[_0xc4b0('0x4b')](handleError(_0x519203,null));};exports['update']=function(_0x4a982b,_0x3291c0){if(_0x4a982b[_0xc4b0('0x4d')]['id']){delete _0x4a982b[_0xc4b0('0x4d')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x4a982b['params']['id']}})[_0xc4b0('0x28')](handleEntityNotFound(_0x3291c0,null))['then'](saveUpdates(_0x4a982b[_0xc4b0('0x4d')],null))[_0xc4b0('0x28')](respondWithResult(_0x3291c0,null))[_0xc4b0('0x4b')](handleError(_0x3291c0,null));};exports[_0xc4b0('0x27')]=function(_0x4f1211,_0x56e7e1){return db[_0xc4b0('0x2f')]['find']({'where':{'id':_0x4f1211[_0xc4b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e7e1,null))['then'](removeEntity(_0x56e7e1,null))[_0xc4b0('0x4b')](handleError(_0x56e7e1,null));};exports[_0xc4b0('0x4e')]=function(_0x3de769,_0x31e92f,_0x382314){var _0x7bc1d9={};var _0x1e7bf2={};var _0x571c7f;var _0x22a544;return db['SalesforceConfiguration'][_0xc4b0('0x4f')]({'where':{'id':_0x3de769[_0xc4b0('0x48')]['id']}})[_0xc4b0('0x28')](handleEntityNotFound(_0x31e92f,null))[_0xc4b0('0x28')](function(_0x507675){if(_0x507675){_0x571c7f=_0x507675;_0x1e7bf2['model']=_[_0xc4b0('0x34')](db[_0xc4b0('0x50')][_0xc4b0('0x30')]);_0x1e7bf2[_0xc4b0('0x35')]=_[_0xc4b0('0x34')](_0x3de769[_0xc4b0('0x35')]);_0x1e7bf2[_0xc4b0('0x36')]=_[_0xc4b0('0x37')](_0x1e7bf2['model'],_0x1e7bf2['query']);_0x7bc1d9[_0xc4b0('0x38')]=_[_0xc4b0('0x37')](_0x1e7bf2[_0xc4b0('0x33')],qs[_0xc4b0('0x39')](_0x3de769['query'][_0xc4b0('0x39')]));_0x7bc1d9[_0xc4b0('0x38')]=_0x7bc1d9['attributes']['length']?_0x7bc1d9['attributes']:_0x1e7bf2['model'];_0x7bc1d9['order']=qs[_0xc4b0('0x3e')](_0x3de769[_0xc4b0('0x35')][_0xc4b0('0x3e')]);_0x7bc1d9[_0xc4b0('0x3f')]=qs['filters'](_[_0xc4b0('0x40')](_0x3de769[_0xc4b0('0x35')],_0x1e7bf2[_0xc4b0('0x36')]));if(_0x3de769[_0xc4b0('0x35')]['filter']){_0x7bc1d9[_0xc4b0('0x3f')]=_['merge'](_0x7bc1d9['where'],{'$or':_['map'](_0x7bc1d9[_0xc4b0('0x38')],function(_0x52b359){var _0x2aaca1={};_0x2aaca1[_0x52b359]={'$like':'%'+_0x3de769['query'][_0xc4b0('0x41')]+'%'};return _0x2aaca1;})});}_0x7bc1d9=_[_0xc4b0('0x43')]({},_0x7bc1d9,_0x3de769[_0xc4b0('0x44')]);return _0x571c7f[_0xc4b0('0x4e')](_0x7bc1d9);}})['then'](function(_0xc90880){if(_0xc90880){_0x22a544=_0xc90880[_0xc4b0('0x3a')];if(!_0x3de769[_0xc4b0('0x35')][_0xc4b0('0x3b')]('nolimit')){_0x7bc1d9[_0xc4b0('0x1e')]=qs[_0xc4b0('0x1e')](_0x3de769[_0xc4b0('0x35')][_0xc4b0('0x1e')]);_0x7bc1d9['offset']=qs[_0xc4b0('0x1d')](_0x3de769[_0xc4b0('0x35')]['offset']);}return _0x571c7f[_0xc4b0('0x4e')](_0x7bc1d9);}})[_0xc4b0('0x28')](function(_0x319d37){if(_0x319d37){return _0x319d37?{'count':_0x22a544,'rows':_0x319d37}:null;}})[_0xc4b0('0x28')](respondWithResult(_0x31e92f,null))[_0xc4b0('0x4b')](handleError(_0x31e92f,null));};exports['getSubjects']=function(_0x550ad5,_0x454b8e,_0x5af9fc){var _0x49f267={};var _0x5d18c1={};var _0x53a534;var _0x52861f;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x550ad5['params']['id']}})[_0xc4b0('0x28')](handleEntityNotFound(_0x454b8e,null))[_0xc4b0('0x28')](function(_0x34c330){if(_0x34c330){_0x53a534=_0x34c330;_0x5d18c1[_0xc4b0('0x33')]=_['keys'](db[_0xc4b0('0x50')][_0xc4b0('0x30')]);_0x5d18c1[_0xc4b0('0x35')]=_[_0xc4b0('0x34')](_0x550ad5['query']);_0x5d18c1['filters']=_['intersection'](_0x5d18c1[_0xc4b0('0x33')],_0x5d18c1['query']);_0x49f267[_0xc4b0('0x38')]=_[_0xc4b0('0x37')](_0x5d18c1['model'],qs[_0xc4b0('0x39')](_0x550ad5[_0xc4b0('0x35')]['fields']));_0x49f267[_0xc4b0('0x38')]=_0x49f267[_0xc4b0('0x38')][_0xc4b0('0x3a')]?_0x49f267[_0xc4b0('0x38')]:_0x5d18c1[_0xc4b0('0x33')];_0x49f267['order']=qs[_0xc4b0('0x3e')](_0x550ad5[_0xc4b0('0x35')]['sort']);_0x49f267[_0xc4b0('0x3f')]=qs[_0xc4b0('0x36')](_[_0xc4b0('0x40')](_0x550ad5[_0xc4b0('0x35')],_0x5d18c1[_0xc4b0('0x36')]));if(_0x550ad5['query'][_0xc4b0('0x41')]){_0x49f267[_0xc4b0('0x3f')]=_['merge'](_0x49f267[_0xc4b0('0x3f')],{'$or':_[_0xc4b0('0x2e')](_0x49f267[_0xc4b0('0x38')],function(_0x468a06){var _0x379a33={};_0x379a33[_0x468a06]={'$like':'%'+_0x550ad5[_0xc4b0('0x35')][_0xc4b0('0x41')]+'%'};return _0x379a33;})});}_0x49f267=_[_0xc4b0('0x43')]({},_0x49f267,_0x550ad5['options']);return _0x53a534[_0xc4b0('0x51')](_0x49f267);}})['then'](function(_0x54ab07){if(_0x54ab07){_0x52861f=_0x54ab07[_0xc4b0('0x3a')];if(!_0x550ad5[_0xc4b0('0x35')][_0xc4b0('0x3b')](_0xc4b0('0x3c'))){_0x49f267[_0xc4b0('0x1e')]=qs['limit'](_0x550ad5[_0xc4b0('0x35')]['limit']);_0x49f267[_0xc4b0('0x1d')]=qs['offset'](_0x550ad5[_0xc4b0('0x35')][_0xc4b0('0x1d')]);}return _0x53a534[_0xc4b0('0x51')](_0x49f267);}})[_0xc4b0('0x28')](function(_0x98dd31){if(_0x98dd31){return _0x98dd31?{'count':_0x52861f,'rows':_0x98dd31}:null;}})[_0xc4b0('0x28')](respondWithResult(_0x454b8e,null))[_0xc4b0('0x4b')](handleError(_0x454b8e,null));};exports['getDescriptions']=function(_0x4522e8,_0x1e53b7,_0x3c83e){var _0x1042d9={};var _0x1f0634={};var _0x45bdc2;var _0x58c9db;return db[_0xc4b0('0x2f')][_0xc4b0('0x4f')]({'where':{'id':_0x4522e8[_0xc4b0('0x48')]['id']}})[_0xc4b0('0x28')](handleEntityNotFound(_0x1e53b7,null))['then'](function(_0x3c3040){if(_0x3c3040){_0x45bdc2=_0x3c3040;_0x1f0634[_0xc4b0('0x33')]=_[_0xc4b0('0x34')](db[_0xc4b0('0x50')][_0xc4b0('0x30')]);_0x1f0634[_0xc4b0('0x35')]=_[_0xc4b0('0x34')](_0x4522e8[_0xc4b0('0x35')]);_0x1f0634[_0xc4b0('0x36')]=_['intersection'](_0x1f0634[_0xc4b0('0x33')],_0x1f0634['query']);_0x1042d9['attributes']=_[_0xc4b0('0x37')](_0x1f0634['model'],qs[_0xc4b0('0x39')](_0x4522e8[_0xc4b0('0x35')]['fields']));_0x1042d9[_0xc4b0('0x38')]=_0x1042d9['attributes'][_0xc4b0('0x3a')]?_0x1042d9[_0xc4b0('0x38')]:_0x1f0634[_0xc4b0('0x33')];_0x1042d9[_0xc4b0('0x3d')]=qs[_0xc4b0('0x3e')](_0x4522e8[_0xc4b0('0x35')][_0xc4b0('0x3e')]);_0x1042d9[_0xc4b0('0x3f')]=qs['filters'](_[_0xc4b0('0x40')](_0x4522e8[_0xc4b0('0x35')],_0x1f0634['filters']));if(_0x4522e8[_0xc4b0('0x35')][_0xc4b0('0x41')]){_0x1042d9[_0xc4b0('0x3f')]=_[_0xc4b0('0x43')](_0x1042d9['where'],{'$or':_[_0xc4b0('0x2e')](_0x1042d9[_0xc4b0('0x38')],function(_0x255278){var _0x540877={};_0x540877[_0x255278]={'$like':'%'+_0x4522e8[_0xc4b0('0x35')]['filter']+'%'};return _0x540877;})});}_0x1042d9=_[_0xc4b0('0x43')]({},_0x1042d9,_0x4522e8['options']);return _0x45bdc2[_0xc4b0('0x52')](_0x1042d9);}})[_0xc4b0('0x28')](function(_0xc7987f){if(_0xc7987f){_0x58c9db=_0xc7987f[_0xc4b0('0x3a')];if(!_0x4522e8[_0xc4b0('0x35')]['hasOwnProperty'](_0xc4b0('0x3c'))){_0x1042d9[_0xc4b0('0x1e')]=qs[_0xc4b0('0x1e')](_0x4522e8[_0xc4b0('0x35')][_0xc4b0('0x1e')]);_0x1042d9['offset']=qs[_0xc4b0('0x1d')](_0x4522e8[_0xc4b0('0x35')][_0xc4b0('0x1d')]);}return _0x45bdc2[_0xc4b0('0x52')](_0x1042d9);}})[_0xc4b0('0x28')](function(_0x42915c){if(_0x42915c){return _0x42915c?{'count':_0x58c9db,'rows':_0x42915c}:null;}})[_0xc4b0('0x28')](respondWithResult(_0x1e53b7,null))['catch'](handleError(_0x1e53b7,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ce849c0..2397a08 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 _0xa969=['lodash','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x47f4e7,_0x46f17f){var _0x49085b=function(_0x558433){while(--_0x558433){_0x47f4e7['push'](_0x47f4e7['shift']());}};_0x49085b(++_0x46f17f);}(_0xa969,0x174));var _0x9a96=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xa969[_0x7275e9];return _0x17b99d;};'use strict';var _=require(_0x9a96('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a96('0x1'));var moment=require(_0x9a96('0x2'));var BPromise=require(_0x9a96('0x3'));var rp=require(_0x9a96('0x4'));var fs=require('fs');var path=require(_0x9a96('0x5'));var rimraf=require(_0x9a96('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a96('0x7'));module[_0x9a96('0x8')]=function(_0xa5fd36,_0x35fc00){return _0xa5fd36[_0x9a96('0x9')](_0x9a96('0xa'),attributes,{'tableName':_0x9a96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c82=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0xa7460,_0x2cbd51){var _0x378897=function(_0x3073c8){while(--_0x3073c8){_0xa7460['push'](_0xa7460['shift']());}};_0x378897(++_0x2cbd51);}(_0x4c82,0x15c));var _0x24c8=function(_0x4be3e7,_0x3a7f05){_0x4be3e7=_0x4be3e7-0x0;var _0x4d44a0=_0x4c82[_0x4be3e7];return _0x4d44a0;};'use strict';var _=require(_0x24c8('0x0'));var util=require(_0x24c8('0x1'));var logger=require(_0x24c8('0x2'))(_0x24c8('0x3'));var moment=require('moment');var BPromise=require(_0x24c8('0x4'));var rp=require(_0x24c8('0x5'));var fs=require('fs');var path=require(_0x24c8('0x6'));var rimraf=require(_0x24c8('0x7'));var config=require('../../config/environment');var attributes=require(_0x24c8('0x8'));module[_0x24c8('0x9')]=function(_0x8e4391,_0x13d51c){return _0x8e4391[_0x24c8('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x24c8('0xb'),'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 5725e2a..d1675bf 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 _0xa408=['stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent'];(function(_0x5d52d9,_0x2dc2f7){var _0x561b60=function(_0x402337){while(--_0x402337){_0x5d52d9['push'](_0x5d52d9['shift']());}};_0x561b60(++_0x2dc2f7);}(_0xa408,0x8b));var _0x8a40=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xa408[_0x44946b];return _0x249bc4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a40('0x0'));var BPromise=require(_0x8a40('0x1'));var rs=require(_0x8a40('0x2'));var fs=require('fs');var Redis=require(_0x8a40('0x3'));var db=require(_0x8a40('0x4'))['db'];var utils=require(_0x8a40('0x5'));var logger=require(_0x8a40('0x6'))(_0x8a40('0x7'));var config=require(_0x8a40('0x8'));var jayson=require(_0x8a40('0x9'));var client=jayson['client'][_0x8a40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce1c8,_0x8a6103,_0x528881){return new BPromise(function(_0x39db45,_0x571b4a){return client['request'](_0x5ce1c8,_0x528881)[_0x8a40('0xb')](function(_0xc8df7b){logger[_0x8a40('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x8a6103,'request\x20sent');logger[_0x8a40('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x8a6103,_0x8a40('0xe'),JSON[_0x8a40('0xf')](_0xc8df7b));if(_0xc8df7b[_0x8a40('0x10')]){if(_0xc8df7b[_0x8a40('0x10')][_0x8a40('0x11')]===0x1f4){logger[_0x8a40('0x10')](_0x8a40('0x12'),_0x8a6103,_0xc8df7b[_0x8a40('0x10')][_0x8a40('0x13')]);return _0x571b4a(_0xc8df7b[_0x8a40('0x10')][_0x8a40('0x13')]);}logger['error'](_0x8a40('0x12'),_0x8a6103,_0xc8df7b[_0x8a40('0x10')]['message']);return _0x39db45(_0xc8df7b[_0x8a40('0x10')][_0x8a40('0x13')]);}else{logger[_0x8a40('0xc')](_0x8a40('0x12'),_0x8a6103,'request\x20sent');_0x39db45(_0xc8df7b[_0x8a40('0x14')][_0x8a40('0x13')]);}})[_0x8a40('0x15')](function(_0x116192){logger[_0x8a40('0x10')](_0x8a40('0x12'),_0x8a6103,_0x116192);_0x571b4a(_0x116192);});});} \ No newline at end of file +var _0xf0b8=['stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xe49874,_0x14b06a){var _0x2d2c68=function(_0x42b6c2){while(--_0x42b6c2){_0xe49874['push'](_0xe49874['shift']());}};_0x2d2c68(++_0x14b06a);}(_0xf0b8,0x1ea));var _0x8f0b=function(_0x16dd61,_0x7fd2b3){_0x16dd61=_0x16dd61-0x0;var _0x5ab373=_0xf0b8[_0x16dd61];return _0x5ab373;};'use strict';var _=require(_0x8f0b('0x0'));var util=require('util');var moment=require(_0x8f0b('0x1'));var BPromise=require(_0x8f0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f0b('0x3'));var db=require(_0x8f0b('0x4'))['db'];var utils=require(_0x8f0b('0x5'));var logger=require(_0x8f0b('0x6'))(_0x8f0b('0x7'));var config=require(_0x8f0b('0x8'));var jayson=require(_0x8f0b('0x9'));var client=jayson[_0x8f0b('0xa')][_0x8f0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x360d78,_0x199c66,_0x437e6e){return new BPromise(function(_0xd24f48,_0x4f7edf){return client[_0x8f0b('0xc')](_0x360d78,_0x437e6e)[_0x8f0b('0xd')](function(_0x33ecaf){logger[_0x8f0b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x199c66,'request\x20sent');logger['debug'](_0x8f0b('0xf'),_0x199c66,'request\x20sent',JSON[_0x8f0b('0x10')](_0x33ecaf));if(_0x33ecaf[_0x8f0b('0x11')]){if(_0x33ecaf[_0x8f0b('0x11')][_0x8f0b('0x12')]===0x1f4){logger[_0x8f0b('0x11')](_0x8f0b('0x13'),_0x199c66,_0x33ecaf[_0x8f0b('0x11')][_0x8f0b('0x14')]);return _0x4f7edf(_0x33ecaf['error'][_0x8f0b('0x14')]);}logger[_0x8f0b('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x199c66,_0x33ecaf[_0x8f0b('0x11')][_0x8f0b('0x14')]);return _0xd24f48(_0x33ecaf[_0x8f0b('0x11')][_0x8f0b('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x199c66,'request\x20sent');_0xd24f48(_0x33ecaf['result'][_0x8f0b('0x14')]);}})[_0x8f0b('0x15')](function(_0x3f44b8){logger[_0x8f0b('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x199c66,_0x3f44b8);_0x4f7edf(_0x3f44b8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 50c1dcc..abc4598 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 _0x9849=['post','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id'];(function(_0x30928e,_0x45a538){var _0x4b64ad=function(_0x4ed3c6){while(--_0x4ed3c6){_0x30928e['push'](_0x30928e['shift']());}};_0x4b64ad(++_0x45a538);}(_0x9849,0x154));var _0x9984=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x9849[_0x710815];return _0x5b3b89;};'use strict';var multer=require(_0x9984('0x0'));var util=require(_0x9984('0x1'));var path=require(_0x9984('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9984('0x3'));var auth=require(_0x9984('0x4'));var interaction=require(_0x9984('0x5'));var config=require(_0x9984('0x6'));var controller=require(_0x9984('0x7'));router[_0x9984('0x8')]('/',auth[_0x9984('0x9')](),controller[_0x9984('0xa')]);router[_0x9984('0x8')](_0x9984('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9984('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9984('0xd')](_0x9984('0xb'),auth[_0x9984('0x9')](),controller[_0x9984('0xe')]);module[_0x9984('0xf')]=router; \ No newline at end of file +var _0x01e6=['express','../../components/auth/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x3a2faa,_0x3d8355){var _0x43eb8e=function(_0x5df948){while(--_0x5df948){_0x3a2faa['push'](_0x3a2faa['shift']());}};_0x43eb8e(++_0x3d8355);}(_0x01e6,0x1c7));var _0x601e=function(_0x2abe9d,_0x4a8c6e){_0x2abe9d=_0x2abe9d-0x0;var _0x135213=_0x01e6[_0x2abe9d];return _0x135213;};'use strict';var multer=require(_0x601e('0x0'));var util=require(_0x601e('0x1'));var path=require(_0x601e('0x2'));var timeout=require(_0x601e('0x3'));var express=require(_0x601e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x601e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x601e('0x6'));router[_0x601e('0x7')]('/',auth[_0x601e('0x8')](),controller[_0x601e('0x9')]);router[_0x601e('0x7')](_0x601e('0xa'),auth['isAuthenticated'](),controller[_0x601e('0xb')]);router[_0x601e('0xc')]('/',auth['isAuthenticated'](),controller[_0x601e('0xd')]);router[_0x601e('0xe')](_0x601e('0xa'),auth[_0x601e('0x8')](),controller[_0x601e('0xf')]);router['delete'](_0x601e('0xa'),auth[_0x601e('0x8')](),controller['destroy']);module[_0x601e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 96e8ca8..a0cfc25 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 _0x1356=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5618c4,_0x4e8f57){var _0xdf390f=function(_0x1406cb){while(--_0x1406cb){_0x5618c4['push'](_0x5618c4['shift']());}};_0xdf390f(++_0x4e8f57);}(_0x1356,0x112));var _0x6135=function(_0x3a3448,_0x49d4ab){_0x3a3448=_0x3a3448-0x0;var _0x112114=_0x1356[_0x3a3448];return _0x112114;};'use strict';var Sequelize=require('sequelize');module[_0x6135('0x0')]={'type':{'type':Sequelize[_0x6135('0x1')](_0x6135('0x2'),_0x6135('0x3'),_0x6135('0x4'),_0x6135('0x5'),_0x6135('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6135('0x7')]},'key':{'type':Sequelize[_0x6135('0x7')]},'keyType':{'type':Sequelize[_0x6135('0x1')](_0x6135('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6135('0x7')]},'idField':{'type':Sequelize[_0x6135('0x7')]},'variableName':{'type':Sequelize[_0x6135('0x7')]}}; \ No newline at end of file +var _0xff38=['keyValue','ENUM','variable','STRING','sequelize','exports','string','customVariable'];(function(_0x14221c,_0x2c3796){var _0x170d18=function(_0x1418d5){while(--_0x1418d5){_0x14221c['push'](_0x14221c['shift']());}};_0x170d18(++_0x2c3796);}(_0xff38,0x1a4));var _0x8ff3=function(_0x1b7249,_0x13b891){_0x1b7249=_0x1b7249-0x0;var _0x3cadfb=_0xff38[_0x1b7249];return _0x3cadfb;};'use strict';var Sequelize=require(_0x8ff3('0x0'));module[_0x8ff3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8ff3('0x2'),'variable',_0x8ff3('0x3'),_0x8ff3('0x4'),'picklist'),'defaultValue':_0x8ff3('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8ff3('0x5')](_0x8ff3('0x2'),_0x8ff3('0x6'),_0x8ff3('0x3'))},'keyContent':{'type':Sequelize[_0x8ff3('0x7')]},'idField':{'type':Sequelize[_0x8ff3('0x7')]},'variableName':{'type':Sequelize[_0x8ff3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index fbd0b40..589dc66 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 _0x6b05=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','options','includeAll','include','SalesforceField','findAll','catch','show','params','merge','find','create','body','destroy','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x220d28,_0xe0cf5e){var _0x5e77d8=function(_0x54d47e){while(--_0x54d47e){_0x220d28['push'](_0x220d28['shift']());}};_0x5e77d8(++_0xe0cf5e);}(_0x6b05,0xc3));var _0x56b0=function(_0x9ef431,_0x572264){_0x9ef431=_0x9ef431-0x0;var _0xc7ee41=_0x6b05[_0x9ef431];return _0xc7ee41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x56b0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x56b0('0x1'));var moment=require(_0x56b0('0x2'));var BPromise=require(_0x56b0('0x3'));var Mustache=require(_0x56b0('0x4'));var util=require('util');var path=require(_0x56b0('0x5'));var sox=require(_0x56b0('0x6'));var csv=require(_0x56b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56b0('0x8'));var squel=require(_0x56b0('0x9'));var crypto=require(_0x56b0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x56b0('0xb'));var toCsv=require(_0x56b0('0x7'));var querystring=require(_0x56b0('0xc'));var Papa=require(_0x56b0('0xd'));var Redis=require(_0x56b0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x56b0('0xf'));var as=require(_0x56b0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x56b0('0x11'))(_0x56b0('0x12'));var utils=require(_0x56b0('0x13'));var config=require(_0x56b0('0x14'));var licenseUtil=require(_0x56b0('0x15'));var db=require(_0x56b0('0x16'))['db'];function respondWithStatusCode(_0x260ed9,_0x30c9ad){_0x30c9ad=_0x30c9ad||0xcc;return function(_0x4db44b){if(_0x4db44b){return _0x260ed9['sendStatus'](_0x30c9ad);}return _0x260ed9[_0x56b0('0x17')](_0x30c9ad)[_0x56b0('0x18')]();};}function respondWithResult(_0x14157e,_0x1e6f99){_0x1e6f99=_0x1e6f99||0xc8;return function(_0x47ca41){if(_0x47ca41){return _0x14157e[_0x56b0('0x17')](_0x1e6f99)['json'](_0x47ca41);}};}function respondWithFilteredResult(_0x4c2566,_0x2ba736){return function(_0x457ebb){if(_0x457ebb){var _0xd1ac4f=typeof _0x2ba736[_0x56b0('0x19')]===_0x56b0('0x1a')&&typeof _0x2ba736['limit']===_0x56b0('0x1a');var _0x2ff598=_0x457ebb['count'];var _0x26c13a=_0xd1ac4f?0x0:_0x2ba736['offset'];var _0x2a6c55=_0xd1ac4f?_0x457ebb[_0x56b0('0x1b')]:_0x2ba736[_0x56b0('0x19')]+_0x2ba736['limit'];var _0x201df5;if(_0x2a6c55>=_0x2ff598){_0x2a6c55=_0x2ff598;_0x201df5=0xc8;}else{_0x201df5=0xce;}_0x4c2566[_0x56b0('0x17')](_0x201df5);return _0x4c2566[_0x56b0('0x1c')](_0x56b0('0x1d'),_0x26c13a+'-'+_0x2a6c55+'/'+_0x2ff598)[_0x56b0('0x1e')](_0x457ebb);}return null;};}function patchUpdates(_0x2f4b12){return function(_0x2f6b7b){try{jsonpatch[_0x56b0('0x1f')](_0x2f6b7b,_0x2f4b12,!![]);}catch(_0x1334ab){return BPromise[_0x56b0('0x20')](_0x1334ab);}return _0x2f6b7b['save']();};}function saveUpdates(_0x2164d2,_0x5f3599){return function(_0x320bf3){if(_0x320bf3){return _0x320bf3[_0x56b0('0x21')](_0x2164d2)['then'](function(_0x2e8ce8){return _0x2e8ce8;});}return null;};}function removeEntity(_0x1edcb5,_0x441543){return function(_0x5832c6){if(_0x5832c6){return _0x5832c6['destroy']()[_0x56b0('0x22')](function(){_0x1edcb5[_0x56b0('0x17')](0xcc)[_0x56b0('0x18')]();});}};}function handleEntityNotFound(_0x3e0744,_0x449d67){return function(_0x5c9ff0){if(!_0x5c9ff0){_0x3e0744['sendStatus'](0x194);}return _0x5c9ff0;};}function handleError(_0x1415f5,_0x2b2a64){_0x2b2a64=_0x2b2a64||0x1f4;return function(_0x34ddc2){logger[_0x56b0('0x23')](_0x34ddc2[_0x56b0('0x24')]);if(_0x34ddc2[_0x56b0('0x25')]){delete _0x34ddc2['name'];}_0x1415f5[_0x56b0('0x17')](_0x2b2a64)['send'](_0x34ddc2);};}exports[_0x56b0('0x26')]=function(_0x545db8,_0x19c790){var _0x17daf4={},_0x359f10={},_0x1a2e6c={'count':0x0,'rows':[]};var _0x2005f1=_[_0x56b0('0x27')](db['SalesforceField'][_0x56b0('0x28')],function(_0x1163a9){return{'name':_0x1163a9[_0x56b0('0x29')],'type':_0x1163a9[_0x56b0('0x2a')]['key']};});_0x359f10[_0x56b0('0x2b')]=_['map'](_0x2005f1,_0x56b0('0x25'));_0x359f10[_0x56b0('0x2c')]=_[_0x56b0('0x2d')](_0x545db8[_0x56b0('0x2c')]);_0x359f10[_0x56b0('0x2e')]=_['intersection'](_0x359f10[_0x56b0('0x2b')],_0x359f10['query']);_0x17daf4['attributes']=_[_0x56b0('0x2f')](_0x359f10[_0x56b0('0x2b')],qs[_0x56b0('0x30')](_0x545db8[_0x56b0('0x2c')][_0x56b0('0x30')]));_0x17daf4[_0x56b0('0x31')]=_0x17daf4[_0x56b0('0x31')][_0x56b0('0x32')]?_0x17daf4[_0x56b0('0x31')]:_0x359f10['model'];if(!_0x545db8[_0x56b0('0x2c')][_0x56b0('0x33')](_0x56b0('0x34'))){_0x17daf4[_0x56b0('0x35')]=qs[_0x56b0('0x35')](_0x545db8[_0x56b0('0x2c')][_0x56b0('0x35')]);_0x17daf4[_0x56b0('0x19')]=qs[_0x56b0('0x19')](_0x545db8[_0x56b0('0x2c')]['offset']);}_0x17daf4['order']=qs['sort'](_0x545db8[_0x56b0('0x2c')][_0x56b0('0x36')]);_0x17daf4['where']=qs[_0x56b0('0x2e')](_['pick'](_0x545db8['query'],_0x359f10['filters']),_0x2005f1);if(_0x545db8[_0x56b0('0x2c')]['filter']){_0x17daf4[_0x56b0('0x37')]=_['merge'](_0x17daf4[_0x56b0('0x37')],{'$or':_[_0x56b0('0x27')](_0x2005f1,function(_0x342036){if(_0x342036[_0x56b0('0x2a')]!=='VIRTUAL'){var _0xd37407={};_0xd37407[_0x342036[_0x56b0('0x25')]]={'$like':'%'+_0x545db8['query'][_0x56b0('0x38')]+'%'};return _0xd37407;}})});}_0x17daf4=_['merge']({},_0x17daf4,_0x545db8[_0x56b0('0x39')]);var _0x23ff46={'where':_0x17daf4['where']};return db['SalesforceField'][_0x56b0('0x1b')](_0x23ff46)[_0x56b0('0x22')](function(_0x1303a8){_0x1a2e6c[_0x56b0('0x1b')]=_0x1303a8;if(_0x545db8[_0x56b0('0x2c')][_0x56b0('0x3a')]){_0x17daf4[_0x56b0('0x3b')]=[{'all':!![]}];}return db[_0x56b0('0x3c')][_0x56b0('0x3d')](_0x17daf4);})[_0x56b0('0x22')](function(_0x143a69){_0x1a2e6c['rows']=_0x143a69;return _0x1a2e6c;})[_0x56b0('0x22')](respondWithFilteredResult(_0x19c790,_0x17daf4))[_0x56b0('0x3e')](handleError(_0x19c790,null));};exports[_0x56b0('0x3f')]=function(_0x4ff6a5,_0x1e1d6c){var _0x5d2ccb={'raw':!![],'where':{'id':_0x4ff6a5[_0x56b0('0x40')]['id']}},_0x5461d0={};_0x5461d0[_0x56b0('0x2b')]=_[_0x56b0('0x2d')](db[_0x56b0('0x3c')]['rawAttributes']);_0x5461d0['query']=_[_0x56b0('0x2d')](_0x4ff6a5[_0x56b0('0x2c')]);_0x5461d0[_0x56b0('0x2e')]=_['intersection'](_0x5461d0[_0x56b0('0x2b')],_0x5461d0['query']);_0x5d2ccb['attributes']=_[_0x56b0('0x2f')](_0x5461d0[_0x56b0('0x2b')],qs[_0x56b0('0x30')](_0x4ff6a5[_0x56b0('0x2c')]['fields']));_0x5d2ccb['attributes']=_0x5d2ccb[_0x56b0('0x31')][_0x56b0('0x32')]?_0x5d2ccb[_0x56b0('0x31')]:_0x5461d0[_0x56b0('0x2b')];if(_0x4ff6a5[_0x56b0('0x2c')][_0x56b0('0x3a')]){_0x5d2ccb[_0x56b0('0x3b')]=[{'all':!![]}];}_0x5d2ccb=_[_0x56b0('0x41')]({},_0x5d2ccb,_0x4ff6a5[_0x56b0('0x39')]);return db[_0x56b0('0x3c')][_0x56b0('0x42')](_0x5d2ccb)['then'](handleEntityNotFound(_0x1e1d6c,null))[_0x56b0('0x22')](respondWithResult(_0x1e1d6c,null))[_0x56b0('0x3e')](handleError(_0x1e1d6c,null));};exports[_0x56b0('0x43')]=function(_0x30881c,_0x2455bc){return db[_0x56b0('0x3c')][_0x56b0('0x43')](_0x30881c[_0x56b0('0x44')],{})[_0x56b0('0x22')](respondWithResult(_0x2455bc,0xc9))[_0x56b0('0x3e')](handleError(_0x2455bc,null));};exports[_0x56b0('0x21')]=function(_0x2b5df4,_0x40bb0f){if(_0x2b5df4[_0x56b0('0x44')]['id']){delete _0x2b5df4['body']['id'];}return db[_0x56b0('0x3c')][_0x56b0('0x42')]({'where':{'id':_0x2b5df4[_0x56b0('0x40')]['id']}})[_0x56b0('0x22')](handleEntityNotFound(_0x40bb0f,null))[_0x56b0('0x22')](saveUpdates(_0x2b5df4[_0x56b0('0x44')],null))['then'](respondWithResult(_0x40bb0f,null))[_0x56b0('0x3e')](handleError(_0x40bb0f,null));};exports[_0x56b0('0x45')]=function(_0x409f44,_0x477e0e){return db[_0x56b0('0x3c')][_0x56b0('0x42')]({'where':{'id':_0x409f44['params']['id']}})['then'](handleEntityNotFound(_0x477e0e,null))[_0x56b0('0x22')](removeEntity(_0x477e0e,null))[_0x56b0('0x3e')](handleError(_0x477e0e,null));}; \ No newline at end of file +var _0x3b19=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','keys','include','find','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','error','name','send','index','map','SalesforceField','type','key','model'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x3b19,0xa5));var _0x93b1=function(_0x20dc37,_0x81495a){_0x20dc37=_0x20dc37-0x0;var _0x389459=_0x3b19[_0x20dc37];return _0x389459;};'use strict';var emlformat=require(_0x93b1('0x0'));var rimraf=require(_0x93b1('0x1'));var zipdir=require(_0x93b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x93b1('0x3'));var BPromise=require(_0x93b1('0x4'));var Mustache=require('mustache');var util=require(_0x93b1('0x5'));var path=require(_0x93b1('0x6'));var sox=require(_0x93b1('0x7'));var csv=require(_0x93b1('0x8'));var ejs=require(_0x93b1('0x9'));var fs=require('fs');var fs_extra=require(_0x93b1('0xa'));var _=require(_0x93b1('0xb'));var squel=require(_0x93b1('0xc'));var crypto=require(_0x93b1('0xd'));var jsforce=require(_0x93b1('0xe'));var deskjs=require(_0x93b1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x93b1('0x10'));var Papa=require(_0x93b1('0x11'));var Redis=require(_0x93b1('0x12'));var authService=require(_0x93b1('0x13'));var qs=require(_0x93b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93b1('0x15'));var logger=require('../../config/logger')(_0x93b1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ceddd,_0x594dd2){_0x594dd2=_0x594dd2||0xcc;return function(_0x2be257){if(_0x2be257){return _0x3ceddd[_0x93b1('0x17')](_0x594dd2);}return _0x3ceddd['status'](_0x594dd2)[_0x93b1('0x18')]();};}function respondWithResult(_0xc600b6,_0x102784){_0x102784=_0x102784||0xc8;return function(_0x5b7870){if(_0x5b7870){return _0xc600b6[_0x93b1('0x19')](_0x102784)[_0x93b1('0x1a')](_0x5b7870);}};}function respondWithFilteredResult(_0x37f522,_0x4fe220){return function(_0x9082ba){if(_0x9082ba){var _0x3421c4=typeof _0x4fe220[_0x93b1('0x1b')]===_0x93b1('0x1c')&&typeof _0x4fe220[_0x93b1('0x1d')]===_0x93b1('0x1c');var _0x5b9dcb=_0x9082ba['count'];var _0x129381=_0x3421c4?0x0:_0x4fe220['offset'];var _0xd2912=_0x3421c4?_0x9082ba[_0x93b1('0x1e')]:_0x4fe220['offset']+_0x4fe220[_0x93b1('0x1d')];var _0x51eac5;if(_0xd2912>=_0x5b9dcb){_0xd2912=_0x5b9dcb;_0x51eac5=0xc8;}else{_0x51eac5=0xce;}_0x37f522[_0x93b1('0x19')](_0x51eac5);return _0x37f522[_0x93b1('0x1f')]('Content-Range',_0x129381+'-'+_0xd2912+'/'+_0x5b9dcb)['json'](_0x9082ba);}return null;};}function patchUpdates(_0x38bb37){return function(_0xa0caef){try{jsonpatch['apply'](_0xa0caef,_0x38bb37,!![]);}catch(_0x5469ad){return BPromise[_0x93b1('0x20')](_0x5469ad);}return _0xa0caef[_0x93b1('0x21')]();};}function saveUpdates(_0x6edf0a,_0x160a25){return function(_0x341131){if(_0x341131){return _0x341131[_0x93b1('0x22')](_0x6edf0a)[_0x93b1('0x23')](function(_0xed2017){return _0xed2017;});}return null;};}function removeEntity(_0x9a6400,_0x298d2b){return function(_0x1e893b){if(_0x1e893b){return _0x1e893b['destroy']()[_0x93b1('0x23')](function(){_0x9a6400[_0x93b1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5203cb,_0x384c06){return function(_0xe260c){if(!_0xe260c){_0x5203cb[_0x93b1('0x17')](0x194);}return _0xe260c;};}function handleError(_0x248e54,_0x119f55){_0x119f55=_0x119f55||0x1f4;return function(_0x150615){logger[_0x93b1('0x24')](_0x150615['stack']);if(_0x150615[_0x93b1('0x25')]){delete _0x150615[_0x93b1('0x25')];}_0x248e54[_0x93b1('0x19')](_0x119f55)[_0x93b1('0x26')](_0x150615);};}exports[_0x93b1('0x27')]=function(_0xf674ad,_0x21c36b){var _0x5df217={},_0xff929={},_0x28aef5={'count':0x0,'rows':[]};var _0x2b405e=_[_0x93b1('0x28')](db[_0x93b1('0x29')]['rawAttributes'],function(_0x3759df){return{'name':_0x3759df['fieldName'],'type':_0x3759df[_0x93b1('0x2a')][_0x93b1('0x2b')]};});_0xff929[_0x93b1('0x2c')]=_[_0x93b1('0x28')](_0x2b405e,'name');_0xff929[_0x93b1('0x2d')]=_['keys'](_0xf674ad[_0x93b1('0x2d')]);_0xff929[_0x93b1('0x2e')]=_[_0x93b1('0x2f')](_0xff929['model'],_0xff929[_0x93b1('0x2d')]);_0x5df217[_0x93b1('0x30')]=_[_0x93b1('0x2f')](_0xff929[_0x93b1('0x2c')],qs[_0x93b1('0x31')](_0xf674ad[_0x93b1('0x2d')][_0x93b1('0x31')]));_0x5df217[_0x93b1('0x30')]=_0x5df217[_0x93b1('0x30')][_0x93b1('0x32')]?_0x5df217['attributes']:_0xff929[_0x93b1('0x2c')];if(!_0xf674ad[_0x93b1('0x2d')][_0x93b1('0x33')](_0x93b1('0x34'))){_0x5df217[_0x93b1('0x1d')]=qs[_0x93b1('0x1d')](_0xf674ad[_0x93b1('0x2d')]['limit']);_0x5df217[_0x93b1('0x1b')]=qs[_0x93b1('0x1b')](_0xf674ad[_0x93b1('0x2d')][_0x93b1('0x1b')]);}_0x5df217[_0x93b1('0x35')]=qs[_0x93b1('0x36')](_0xf674ad[_0x93b1('0x2d')]['sort']);_0x5df217[_0x93b1('0x37')]=qs[_0x93b1('0x2e')](_[_0x93b1('0x38')](_0xf674ad['query'],_0xff929['filters']),_0x2b405e);if(_0xf674ad['query'][_0x93b1('0x39')]){_0x5df217[_0x93b1('0x37')]=_[_0x93b1('0x3a')](_0x5df217[_0x93b1('0x37')],{'$or':_[_0x93b1('0x28')](_0x2b405e,function(_0x1abf33){if(_0x1abf33[_0x93b1('0x2a')]!=='VIRTUAL'){var _0x55284d={};_0x55284d[_0x1abf33[_0x93b1('0x25')]]={'$like':'%'+_0xf674ad[_0x93b1('0x2d')][_0x93b1('0x39')]+'%'};return _0x55284d;}})});}_0x5df217=_['merge']({},_0x5df217,_0xf674ad[_0x93b1('0x3b')]);var _0x821805={'where':_0x5df217['where']};return db[_0x93b1('0x29')][_0x93b1('0x1e')](_0x821805)[_0x93b1('0x23')](function(_0xb2e9f1){_0x28aef5[_0x93b1('0x1e')]=_0xb2e9f1;if(_0xf674ad[_0x93b1('0x2d')][_0x93b1('0x3c')]){_0x5df217['include']=[{'all':!![]}];}return db[_0x93b1('0x29')][_0x93b1('0x3d')](_0x5df217);})['then'](function(_0x2e893a){_0x28aef5['rows']=_0x2e893a;return _0x28aef5;})[_0x93b1('0x23')](respondWithFilteredResult(_0x21c36b,_0x5df217))[_0x93b1('0x3e')](handleError(_0x21c36b,null));};exports['show']=function(_0xc3a2cb,_0x265ce4){var _0x2f3bf0={'raw':!![],'where':{'id':_0xc3a2cb[_0x93b1('0x3f')]['id']}},_0x3cb5e9={};_0x3cb5e9[_0x93b1('0x2c')]=_[_0x93b1('0x40')](db['SalesforceField']['rawAttributes']);_0x3cb5e9[_0x93b1('0x2d')]=_[_0x93b1('0x40')](_0xc3a2cb['query']);_0x3cb5e9['filters']=_[_0x93b1('0x2f')](_0x3cb5e9[_0x93b1('0x2c')],_0x3cb5e9[_0x93b1('0x2d')]);_0x2f3bf0[_0x93b1('0x30')]=_[_0x93b1('0x2f')](_0x3cb5e9[_0x93b1('0x2c')],qs[_0x93b1('0x31')](_0xc3a2cb[_0x93b1('0x2d')][_0x93b1('0x31')]));_0x2f3bf0[_0x93b1('0x30')]=_0x2f3bf0[_0x93b1('0x30')]['length']?_0x2f3bf0[_0x93b1('0x30')]:_0x3cb5e9[_0x93b1('0x2c')];if(_0xc3a2cb[_0x93b1('0x2d')][_0x93b1('0x3c')]){_0x2f3bf0[_0x93b1('0x41')]=[{'all':!![]}];}_0x2f3bf0=_[_0x93b1('0x3a')]({},_0x2f3bf0,_0xc3a2cb[_0x93b1('0x3b')]);return db['SalesforceField'][_0x93b1('0x42')](_0x2f3bf0)['then'](handleEntityNotFound(_0x265ce4,null))[_0x93b1('0x23')](respondWithResult(_0x265ce4,null))[_0x93b1('0x3e')](handleError(_0x265ce4,null));};exports[_0x93b1('0x43')]=function(_0xcef159,_0x17fc9b){return db[_0x93b1('0x29')]['create'](_0xcef159[_0x93b1('0x44')],{})[_0x93b1('0x23')](respondWithResult(_0x17fc9b,0xc9))[_0x93b1('0x3e')](handleError(_0x17fc9b,null));};exports[_0x93b1('0x22')]=function(_0x52bb69,_0x17ad3a){if(_0x52bb69[_0x93b1('0x44')]['id']){delete _0x52bb69[_0x93b1('0x44')]['id'];}return db[_0x93b1('0x29')][_0x93b1('0x42')]({'where':{'id':_0x52bb69['params']['id']}})[_0x93b1('0x23')](handleEntityNotFound(_0x17ad3a,null))[_0x93b1('0x23')](saveUpdates(_0x52bb69[_0x93b1('0x44')],null))[_0x93b1('0x23')](respondWithResult(_0x17ad3a,null))[_0x93b1('0x3e')](handleError(_0x17ad3a,null));};exports[_0x93b1('0x45')]=function(_0xa1feb1,_0x25f9d0){return db[_0x93b1('0x29')][_0x93b1('0x42')]({'where':{'id':_0xa1feb1['params']['id']}})['then'](handleEntityNotFound(_0x25f9d0,null))[_0x93b1('0x23')](removeEntity(_0x25f9d0,null))[_0x93b1('0x3e')](handleError(_0x25f9d0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index ee9937e..168c2ed 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 _0x9b01=['exports','SalesforceField','int_salesforce_fields','idField','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x9b01,0x7d));var _0x19b0=function(_0x1fc18b,_0x13d27d){_0x1fc18b=_0x1fc18b-0x0;var _0x16a351=_0x9b01[_0x1fc18b];return _0x16a351;};'use strict';var _=require('lodash');var util=require(_0x19b0('0x0'));var logger=require('../../config/logger')(_0x19b0('0x1'));var moment=require(_0x19b0('0x2'));var BPromise=require(_0x19b0('0x3'));var rp=require(_0x19b0('0x4'));var fs=require('fs');var path=require(_0x19b0('0x5'));var rimraf=require(_0x19b0('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x19b0('0x7')]=function(_0x11a21a,_0x43f514){return _0x11a21a['define'](_0x19b0('0x8'),attributes,{'tableName':_0x19b0('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x19b0('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc92=['exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xbc92,0xf4));var _0x2bc9=function(_0x2aeca6,_0x565154){_0x2aeca6=_0x2aeca6-0x0;var _0x48c8c9=_0xbc92[_0x2aeca6];return _0x48c8c9;};'use strict';var _=require(_0x2bc9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bc9('0x1'));var moment=require(_0x2bc9('0x2'));var BPromise=require(_0x2bc9('0x3'));var rp=require(_0x2bc9('0x4'));var fs=require('fs');var path=require(_0x2bc9('0x5'));var rimraf=require(_0x2bc9('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bc9('0x7'));module[_0x2bc9('0x8')]=function(_0x155e87,_0x11c9a3){return _0x155e87[_0x2bc9('0x9')](_0x2bc9('0xa'),attributes,{'tableName':_0x2bc9('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x2bc9('0xc'),_0x2bc9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index c7509c2..0f8d344 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 _0xf774=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceField,\x20%s,\x20%s','request\x20sent','result','lodash'];(function(_0x37d640,_0x390bfc){var _0x35b049=function(_0x17288f){while(--_0x17288f){_0x37d640['push'](_0x37d640['shift']());}};_0x35b049(++_0x390bfc);}(_0xf774,0x15f));var _0x4f77=function(_0x56287f,_0x41cae7){_0x56287f=_0x56287f-0x0;var _0x36cb41=_0xf774[_0x56287f];return _0x36cb41;};'use strict';var _=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var moment=require(_0x4f77('0x2'));var BPromise=require(_0x4f77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f77('0x4'));var db=require(_0x4f77('0x5'))['db'];var utils=require(_0x4f77('0x6'));var logger=require(_0x4f77('0x7'))(_0x4f77('0x8'));var config=require(_0x4f77('0x9'));var jayson=require(_0x4f77('0xa'));var client=jayson[_0x4f77('0xb')][_0x4f77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3bbd69,_0x5c5ada,_0x3169cf){return new BPromise(function(_0x45ecb5,_0x4471c2){return client['request'](_0x3bbd69,_0x3169cf)[_0x4f77('0xd')](function(_0x5da502){logger[_0x4f77('0xe')]('SalesforceField,\x20%s,\x20%s',_0x5c5ada,'request\x20sent');logger['debug'](_0x4f77('0xf'),_0x5c5ada,'request\x20sent',JSON[_0x4f77('0x10')](_0x5da502));if(_0x5da502[_0x4f77('0x11')]){if(_0x5da502[_0x4f77('0x11')]['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x5c5ada,_0x5da502[_0x4f77('0x11')][_0x4f77('0x12')]);return _0x4471c2(_0x5da502[_0x4f77('0x11')]['message']);}logger[_0x4f77('0x11')](_0x4f77('0x13'),_0x5c5ada,_0x5da502[_0x4f77('0x11')]['message']);return _0x45ecb5(_0x5da502[_0x4f77('0x11')][_0x4f77('0x12')]);}else{logger[_0x4f77('0xe')](_0x4f77('0x13'),_0x5c5ada,_0x4f77('0x14'));_0x45ecb5(_0x5da502[_0x4f77('0x15')][_0x4f77('0x12')]);}})['catch'](function(_0x1d1881){logger[_0x4f77('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5c5ada,_0x1d1881);_0x4471c2(_0x1d1881);});});} \ No newline at end of file +var _0xc02a=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x51b80a,_0x355fe3){var _0x22fdf0=function(_0x152b3e){while(--_0x152b3e){_0x51b80a['push'](_0x51b80a['shift']());}};_0x22fdf0(++_0x355fe3);}(_0xc02a,0xcf));var _0xac02=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xc02a[_0x4709c8];return _0x478cdd;};'use strict';var _=require('lodash');var util=require(_0xac02('0x0'));var moment=require(_0xac02('0x1'));var BPromise=require(_0xac02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac02('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xac02('0x4'))(_0xac02('0x5'));var config=require('../../config/environment');var jayson=require(_0xac02('0x6'));var client=jayson[_0xac02('0x7')][_0xac02('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a6c8a,_0x882e5c,_0x169574){return new BPromise(function(_0x478cbb,_0x6ee6b5){return client[_0xac02('0x9')](_0x1a6c8a,_0x169574)['then'](function(_0x252814){logger[_0xac02('0xa')](_0xac02('0xb'),_0x882e5c,_0xac02('0xc'));logger[_0xac02('0xd')](_0xac02('0xe'),_0x882e5c,'request\x20sent',JSON[_0xac02('0xf')](_0x252814));if(_0x252814[_0xac02('0x10')]){if(_0x252814[_0xac02('0x10')][_0xac02('0x11')]===0x1f4){logger['error'](_0xac02('0xb'),_0x882e5c,_0x252814[_0xac02('0x10')][_0xac02('0x12')]);return _0x6ee6b5(_0x252814['error']['message']);}logger[_0xac02('0x10')](_0xac02('0xb'),_0x882e5c,_0x252814[_0xac02('0x10')][_0xac02('0x12')]);return _0x478cbb(_0x252814[_0xac02('0x10')]['message']);}else{logger[_0xac02('0xa')](_0xac02('0xb'),_0x882e5c,'request\x20sent');_0x478cbb(_0x252814[_0xac02('0x13')]['message']);}})[_0xac02('0x14')](function(_0x193229){logger[_0xac02('0x10')](_0xac02('0xb'),_0x882e5c,_0x193229);_0x6ee6b5(_0x193229);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8f2f06a..1796b57 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 _0x191a=['isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get'];(function(_0x4ca888,_0x2af15b){var _0x38aa3c=function(_0x492d7e){while(--_0x492d7e){_0x4ca888['push'](_0x4ca888['shift']());}};_0x38aa3c(++_0x2af15b);}(_0x191a,0xef));var _0xa191=function(_0x31a3b0,_0x4aeb7d){_0x31a3b0=_0x31a3b0-0x0;var _0x4529fb=_0x191a[_0x31a3b0];return _0x4529fb;};'use strict';var multer=require(_0xa191('0x0'));var util=require('util');var path=require(_0xa191('0x1'));var timeout=require(_0xa191('0x2'));var express=require(_0xa191('0x3'));var router=express[_0xa191('0x4')]();var fs_extra=require(_0xa191('0x5'));var auth=require(_0xa191('0x6'));var interaction=require(_0xa191('0x7'));var config=require(_0xa191('0x8'));var controller=require(_0xa191('0x9'));router[_0xa191('0xa')]('/',auth[_0xa191('0xb')](),controller['index']);router[_0xa191('0xa')](_0xa191('0xc'),auth['isAuthenticated'](),controller[_0xa191('0xd')]);router[_0xa191('0xa')]('/:id/configurations',auth[_0xa191('0xb')](),controller[_0xa191('0xe')]);router[_0xa191('0xa')](_0xa191('0xf'),auth['isAuthenticated'](),controller[_0xa191('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa191('0x11')]);router[_0xa191('0x12')](_0xa191('0x13'),auth[_0xa191('0xb')](),controller[_0xa191('0x14')]);router[_0xa191('0x15')](_0xa191('0xc'),auth['isAuthenticated'](),controller[_0xa191('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa191('0x17')]);module[_0xa191('0x18')]=router; \ No newline at end of file +var _0xe80d=['isAuthenticated','/:id','get','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x3f7a14,_0x3462d7){var _0x412957=function(_0x25ef87){while(--_0x25ef87){_0x3f7a14['push'](_0x3f7a14['shift']());}};_0x412957(++_0x3462d7);}(_0xe80d,0x183));var _0xde80=function(_0x1ca5a3,_0x40b024){_0x1ca5a3=_0x1ca5a3-0x0;var _0xc8acbf=_0xe80d[_0x1ca5a3];return _0xc8acbf;};'use strict';var multer=require(_0xde80('0x0'));var util=require(_0xde80('0x1'));var path=require(_0xde80('0x2'));var timeout=require('connect-timeout');var express=require(_0xde80('0x3'));var router=express[_0xde80('0x4')]();var fs_extra=require(_0xde80('0x5'));var auth=require(_0xde80('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde80('0x7'));var controller=require(_0xde80('0x8'));router['get']('/',auth[_0xde80('0x9')](),controller['index']);router['get'](_0xde80('0xa'),auth[_0xde80('0x9')](),controller['show']);router[_0xde80('0xb')]('/:id/configurations',auth[_0xde80('0x9')](),controller[_0xde80('0xc')]);router[_0xde80('0xb')](_0xde80('0xd'),auth['isAuthenticated'](),controller[_0xde80('0xe')]);router['post']('/',auth[_0xde80('0x9')](),controller[_0xde80('0xf')]);router['post']('/:id/configurations',auth[_0xde80('0x9')](),controller[_0xde80('0x10')]);router[_0xde80('0x11')](_0xde80('0xa'),auth[_0xde80('0x9')](),controller[_0xde80('0x12')]);router[_0xde80('0x13')](_0xde80('0xa'),auth['isAuthenticated'](),controller[_0xde80('0x14')]);module[_0xde80('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 6d03d03..b088593 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 _0x1cee=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2af1fa,_0x4f6545){var _0x24873d=function(_0x4393ac){while(--_0x4393ac){_0x2af1fa['push'](_0x2af1fa['shift']());}};_0x24873d(++_0x4f6545);}(_0x1cee,0xf1));var _0xe1ce=function(_0x240da3,_0x756fb5){_0x240da3=_0x240da3-0x0;var _0x2ad370=_0x1cee[_0x240da3];return _0x2ad370;};'use strict';var Sequelize=require(_0xe1ce('0x0'));module[_0xe1ce('0x1')]={'name':{'type':Sequelize[_0xe1ce('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe1ce('0x2')],'unique':_0xe1ce('0x3')},'password':{'type':Sequelize[_0xe1ce('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe1ce('0x2')],'unique':_0xe1ce('0x4')},'serverUrl':{'type':Sequelize[_0xe1ce('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xcbee=['remoteUri','sequelize','exports','STRING','username'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcbee,0x14b));var _0xecbe=function(_0x50b31a,_0x202db){_0x50b31a=_0x50b31a-0x0;var _0x4b149b=_0xcbee[_0x50b31a];return _0x4b149b;};'use strict';var Sequelize=require(_0xecbe('0x0'));module[_0xecbe('0x1')]={'name':{'type':Sequelize[_0xecbe('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xecbe('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xecbe('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xecbe('0x4')},'serverUrl':{'type':Sequelize[_0xecbe('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 91ca833..d97f3ab 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 _0x8c54=['company','assigned_to','comments','sla_due','comments_and_work_notes','due_date','escalation','correlation_id','location','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','password','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','concat','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowAccount','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','findOne','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','delivery_plan','impact','active','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','resolved_at','subcategory','work_notes','close_code','correlation_display','work_start','assignment_group','business_stc','description','calendar_duration','close_notes','closed_by','follow_up','sys_id','contact_type','urgency','problem_id'];(function(_0x4eb55c,_0x5da5d9){var _0x49e1d5=function(_0x243cab){while(--_0x243cab){_0x4eb55c['push'](_0x4eb55c['shift']());}};_0x49e1d5(++_0x5da5d9);}(_0x8c54,0x19a));var _0x48c5=function(_0x29795,_0x8399c){_0x29795=_0x29795-0x0;var _0x1470f0=_0x8c54[_0x29795];return _0x1470f0;};'use strict';var emlformat=require(_0x48c5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48c5('0x1'));var rp=require('request-promise');var moment=require(_0x48c5('0x2'));var BPromise=require(_0x48c5('0x3'));var Mustache=require('mustache');var util=require(_0x48c5('0x4'));var path=require(_0x48c5('0x5'));var sox=require('sox');var csv=require(_0x48c5('0x6'));var ejs=require(_0x48c5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48c5('0x8'));var squel=require(_0x48c5('0x9'));var crypto=require(_0x48c5('0xa'));var jsforce=require(_0x48c5('0xb'));var deskjs=require(_0x48c5('0xc'));var toCsv=require(_0x48c5('0x6'));var querystring=require('querystring');var Papa=require(_0x48c5('0xd'));var Redis=require(_0x48c5('0xe'));var authService=require(_0x48c5('0xf'));var qs=require(_0x48c5('0x10'));var as=require(_0x48c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x48c5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48c5('0x13'));var db=require(_0x48c5('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x43bc2c,_0x595e9f){_0x595e9f=_0x595e9f||0xcc;return function(_0x2e83f4){if(_0x2e83f4){return _0x43bc2c[_0x48c5('0x15')](_0x595e9f);}return _0x43bc2c[_0x48c5('0x16')](_0x595e9f)['end']();};}function respondWithResult(_0x31ab6c,_0x4d0db6){_0x4d0db6=_0x4d0db6||0xc8;return function(_0x2ec516){if(_0x2ec516){return _0x31ab6c['status'](_0x4d0db6)['json'](_0x2ec516);}};}function respondWithFilteredResult(_0x496f99,_0x5d97ba){return function(_0x240808){if(_0x240808){var _0x274d25=typeof _0x5d97ba[_0x48c5('0x17')]==='undefined'&&typeof _0x5d97ba['limit']==='undefined';var _0x13ca2c=_0x240808[_0x48c5('0x18')];var _0x4f5e97=_0x274d25?0x0:_0x5d97ba['offset'];var _0x1c2425=_0x274d25?_0x240808['count']:_0x5d97ba[_0x48c5('0x17')]+_0x5d97ba[_0x48c5('0x19')];var _0x591ad8;if(_0x1c2425>=_0x13ca2c){_0x1c2425=_0x13ca2c;_0x591ad8=0xc8;}else{_0x591ad8=0xce;}_0x496f99[_0x48c5('0x16')](_0x591ad8);return _0x496f99[_0x48c5('0x1a')](_0x48c5('0x1b'),_0x4f5e97+'-'+_0x1c2425+'/'+_0x13ca2c)['json'](_0x240808);}return null;};}function patchUpdates(_0x9cae7f){return function(_0xb04bee){try{jsonpatch[_0x48c5('0x1c')](_0xb04bee,_0x9cae7f,!![]);}catch(_0x41df8f){return BPromise[_0x48c5('0x1d')](_0x41df8f);}return _0xb04bee['save']();};}function saveUpdates(_0x59c66b,_0x855230){return function(_0x406c5b){if(_0x406c5b){return _0x406c5b[_0x48c5('0x1e')](_0x59c66b)[_0x48c5('0x1f')](function(_0x289798){return _0x289798;});}return null;};}function removeEntity(_0x4309f3,_0x893ac4){return function(_0x27f912){if(_0x27f912){return _0x27f912[_0x48c5('0x20')]()[_0x48c5('0x1f')](function(){_0x4309f3[_0x48c5('0x16')](0xcc)[_0x48c5('0x21')]();});}};}function handleEntityNotFound(_0x1cce23,_0x83976){return function(_0x35525e){if(!_0x35525e){_0x1cce23['sendStatus'](0x194);}return _0x35525e;};}function handleError(_0x1f48f5,_0x2db156){_0x2db156=_0x2db156||0x1f4;return function(_0x3b222b){logger[_0x48c5('0x22')](_0x3b222b[_0x48c5('0x23')]);if(_0x3b222b[_0x48c5('0x24')]){delete _0x3b222b[_0x48c5('0x24')];}_0x1f48f5[_0x48c5('0x16')](_0x2db156)['send'](_0x3b222b);};}exports[_0x48c5('0x25')]=function(_0x3b830d,_0x5c0c73){var _0x50f610={},_0x3eed59={},_0x4f554b={'count':0x0,'rows':[]};var _0x108edd=_[_0x48c5('0x26')](db['ServicenowAccount']['rawAttributes'],function(_0xa4f821){return{'name':_0xa4f821[_0x48c5('0x27')],'type':_0xa4f821[_0x48c5('0x28')][_0x48c5('0x29')]};});_0x3eed59['model']=_[_0x48c5('0x26')](_0x108edd,'name');_0x3eed59[_0x48c5('0x2a')]=_[_0x48c5('0x2b')](_0x3b830d[_0x48c5('0x2a')]);_0x3eed59[_0x48c5('0x2c')]=_[_0x48c5('0x2d')](_0x3eed59[_0x48c5('0x2e')],_0x3eed59[_0x48c5('0x2a')]);_0x50f610[_0x48c5('0x2f')]=_[_0x48c5('0x2d')](_0x3eed59[_0x48c5('0x2e')],qs[_0x48c5('0x30')](_0x3b830d[_0x48c5('0x2a')][_0x48c5('0x30')]));_0x50f610[_0x48c5('0x2f')]=_0x50f610[_0x48c5('0x2f')][_0x48c5('0x31')]?_0x50f610['attributes']:_0x3eed59[_0x48c5('0x2e')];if(!_0x3b830d[_0x48c5('0x2a')][_0x48c5('0x32')]('nolimit')){_0x50f610[_0x48c5('0x19')]=qs[_0x48c5('0x19')](_0x3b830d['query'][_0x48c5('0x19')]);_0x50f610[_0x48c5('0x17')]=qs[_0x48c5('0x17')](_0x3b830d['query']['offset']);}_0x50f610[_0x48c5('0x33')]=qs[_0x48c5('0x34')](_0x3b830d['query'][_0x48c5('0x34')]);_0x50f610[_0x48c5('0x35')]=qs[_0x48c5('0x2c')](_[_0x48c5('0x36')](_0x3b830d['query'],_0x3eed59[_0x48c5('0x2c')]),_0x108edd);if(_0x3b830d[_0x48c5('0x2a')][_0x48c5('0x37')]){_0x50f610[_0x48c5('0x35')]=_['merge'](_0x50f610[_0x48c5('0x35')],{'$or':_['map'](_0x108edd,function(_0xb0ada3){if(_0xb0ada3[_0x48c5('0x28')]!==_0x48c5('0x38')){var _0x1c686e={};_0x1c686e[_0xb0ada3[_0x48c5('0x24')]]={'$like':'%'+_0x3b830d[_0x48c5('0x2a')]['filter']+'%'};return _0x1c686e;}})});}_0x50f610=_[_0x48c5('0x39')]({},_0x50f610,_0x3b830d[_0x48c5('0x3a')]);var _0x2664c4={'where':_0x50f610['where']};return db[_0x48c5('0x3b')][_0x48c5('0x18')](_0x2664c4)[_0x48c5('0x1f')](function(_0x2cad09){_0x4f554b[_0x48c5('0x18')]=_0x2cad09;if(_0x3b830d['query'][_0x48c5('0x3c')]){_0x50f610[_0x48c5('0x3d')]=[{'all':!![]}];}return db[_0x48c5('0x3b')][_0x48c5('0x3e')](_0x50f610);})[_0x48c5('0x1f')](function(_0x264f37){_0x4f554b[_0x48c5('0x3f')]=_0x264f37;return _0x4f554b;})[_0x48c5('0x1f')](respondWithFilteredResult(_0x5c0c73,_0x50f610))['catch'](handleError(_0x5c0c73,null));};exports[_0x48c5('0x40')]=function(_0x2f0d5,_0x122ef1){var _0x1c4ecd={'raw':![],'where':{'id':_0x2f0d5[_0x48c5('0x41')]['id']}},_0xc66f85={};_0xc66f85[_0x48c5('0x2e')]=_['keys'](db['ServicenowAccount'][_0x48c5('0x42')]);_0xc66f85[_0x48c5('0x2a')]=_[_0x48c5('0x2b')](_0x2f0d5[_0x48c5('0x2a')]);_0xc66f85[_0x48c5('0x2c')]=_[_0x48c5('0x2d')](_0xc66f85[_0x48c5('0x2e')],_0xc66f85[_0x48c5('0x2a')]);_0x1c4ecd[_0x48c5('0x2f')]=_[_0x48c5('0x2d')](_0xc66f85[_0x48c5('0x2e')],qs[_0x48c5('0x30')](_0x2f0d5['query'][_0x48c5('0x30')]));_0x1c4ecd['attributes']=_0x1c4ecd[_0x48c5('0x2f')]['length']?_0x1c4ecd['attributes']:_0xc66f85[_0x48c5('0x2e')];if(_0x2f0d5[_0x48c5('0x2a')]['includeAll']){_0x1c4ecd[_0x48c5('0x3d')]=[{'all':!![]}];}_0x1c4ecd=_[_0x48c5('0x39')]({},_0x1c4ecd,_0x2f0d5[_0x48c5('0x3a')]);return db[_0x48c5('0x3b')][_0x48c5('0x43')](_0x1c4ecd)[_0x48c5('0x1f')](handleEntityNotFound(_0x122ef1,null))[_0x48c5('0x1f')](respondWithResult(_0x122ef1,null))[_0x48c5('0x44')](handleError(_0x122ef1,null));};exports[_0x48c5('0x45')]=function(_0x538905,_0x5a9da3){return db[_0x48c5('0x3b')][_0x48c5('0x45')](_0x538905['body'],{})['then'](respondWithResult(_0x5a9da3,0xc9))['catch'](handleError(_0x5a9da3,null));};exports[_0x48c5('0x1e')]=function(_0x1bb681,_0x407980){if(_0x1bb681[_0x48c5('0x46')]['id']){delete _0x1bb681[_0x48c5('0x46')]['id'];}return db[_0x48c5('0x3b')][_0x48c5('0x43')]({'where':{'id':_0x1bb681[_0x48c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x407980,null))['then'](saveUpdates(_0x1bb681['body'],null))[_0x48c5('0x1f')](respondWithResult(_0x407980,null))['catch'](handleError(_0x407980,null));};exports[_0x48c5('0x20')]=function(_0x2dd430,_0x117996){return db[_0x48c5('0x3b')][_0x48c5('0x43')]({'where':{'id':_0x2dd430[_0x48c5('0x41')]['id']}})[_0x48c5('0x1f')](handleEntityNotFound(_0x117996,null))['then'](removeEntity(_0x117996,null))['catch'](handleError(_0x117996,null));};exports['getConfigurations']=function(_0x5590aa,_0xb6c0d2,_0x220aa9){var _0x3f7a0f={};var _0x4dbefb={};var _0x5e9ad4;var _0x12201a;return db['ServicenowAccount'][_0x48c5('0x47')]({'where':{'id':_0x5590aa[_0x48c5('0x41')]['id']}})[_0x48c5('0x1f')](handleEntityNotFound(_0xb6c0d2,null))['then'](function(_0x4872de){if(_0x4872de){_0x5e9ad4=_0x4872de;_0x4dbefb[_0x48c5('0x2e')]=_[_0x48c5('0x2b')](db['ServicenowConfiguration'][_0x48c5('0x42')]);_0x4dbefb[_0x48c5('0x2a')]=_['keys'](_0x5590aa[_0x48c5('0x2a')]);_0x4dbefb['filters']=_[_0x48c5('0x2d')](_0x4dbefb['model'],_0x4dbefb[_0x48c5('0x2a')]);_0x3f7a0f[_0x48c5('0x2f')]=_[_0x48c5('0x2d')](_0x4dbefb['model'],qs[_0x48c5('0x30')](_0x5590aa['query'][_0x48c5('0x30')]));_0x3f7a0f[_0x48c5('0x2f')]=_0x3f7a0f['attributes'][_0x48c5('0x31')]?_0x3f7a0f[_0x48c5('0x2f')]:_0x4dbefb[_0x48c5('0x2e')];_0x3f7a0f['order']=qs[_0x48c5('0x34')](_0x5590aa[_0x48c5('0x2a')]['sort']);_0x3f7a0f[_0x48c5('0x35')]=qs[_0x48c5('0x2c')](_[_0x48c5('0x36')](_0x5590aa['query'],_0x4dbefb[_0x48c5('0x2c')]));if(_0x5590aa['query'][_0x48c5('0x37')]){_0x3f7a0f['where']=_['merge'](_0x3f7a0f['where'],{'$or':_[_0x48c5('0x26')](_0x3f7a0f[_0x48c5('0x2f')],function(_0x1e1715){var _0x386e7d={};_0x386e7d[_0x1e1715]={'$like':'%'+_0x5590aa[_0x48c5('0x2a')][_0x48c5('0x37')]+'%'};return _0x386e7d;})});}_0x3f7a0f=_[_0x48c5('0x39')]({},_0x3f7a0f,_0x5590aa['options']);return _0x5e9ad4[_0x48c5('0x48')](_0x3f7a0f);}})[_0x48c5('0x1f')](function(_0x297ac5){if(_0x297ac5){_0x12201a=_0x297ac5[_0x48c5('0x31')];if(!_0x5590aa[_0x48c5('0x2a')][_0x48c5('0x32')](_0x48c5('0x49'))){_0x3f7a0f[_0x48c5('0x19')]=qs[_0x48c5('0x19')](_0x5590aa[_0x48c5('0x2a')][_0x48c5('0x19')]);_0x3f7a0f[_0x48c5('0x17')]=qs['offset'](_0x5590aa[_0x48c5('0x2a')][_0x48c5('0x17')]);}return _0x5e9ad4[_0x48c5('0x48')](_0x3f7a0f);}})['then'](function(_0x2051e0){if(_0x2051e0){return _0x2051e0?{'count':_0x12201a,'rows':_0x2051e0}:null;}})[_0x48c5('0x1f')](respondWithResult(_0xb6c0d2,null))[_0x48c5('0x44')](handleError(_0xb6c0d2,null));};exports[_0x48c5('0x4a')]=function(_0xb51253,_0x2ec0df,_0xa58e7a){if(_0xb51253[_0x48c5('0x46')]['id']){delete _0xb51253[_0x48c5('0x46')]['id'];}return db[_0x48c5('0x3b')][_0x48c5('0x47')]({'where':{'id':_0xb51253[_0x48c5('0x41')]['id']}})[_0x48c5('0x1f')](handleEntityNotFound(_0x2ec0df,null))[_0x48c5('0x1f')](function(_0x47ebac){if(_0x47ebac){_0xb51253[_0x48c5('0x46')][_0x48c5('0x4b')]=_0x47ebac['id'];_0xb51253['body'][_0x48c5('0x4c')]=integrations['getSubjects'](_0xb51253['body'][_0x48c5('0x4d')],_0xb51253['body'][_0x48c5('0x28')]);_0xb51253[_0x48c5('0x46')][_0x48c5('0x4e')]=integrations[_0x48c5('0x4f')](_0xb51253[_0x48c5('0x46')][_0x48c5('0x4d')],_0xb51253[_0x48c5('0x46')][_0x48c5('0x28')]);return db['ServicenowConfiguration'][_0x48c5('0x45')](_0xb51253[_0x48c5('0x46')],{'include':[{'model':db[_0x48c5('0x50')],'as':_0x48c5('0x4c')},{'model':db[_0x48c5('0x50')],'as':_0x48c5('0x4e')}]});}return null;})['then'](respondWithResult(_0x2ec0df,null))[_0x48c5('0x44')](handleError(_0x2ec0df,null));};exports[_0x48c5('0x51')]=function(_0x44e429,_0xfe7b2,_0x2a8116){var _0x421ac0=[_0x48c5('0x52'),_0x48c5('0x53'),'knowledge','subcategory','close_code',_0x48c5('0x54'),_0x48c5('0x55'),_0x48c5('0x56'),_0x48c5('0x57')];var _0x532028=[_0x48c5('0x58'),_0x48c5('0x52'),_0x48c5('0x59'),_0x48c5('0x5a'),_0x48c5('0x5b'),'sys_updated_on','child_incidents','hold_reason',_0x48c5('0x5c'),_0x48c5('0x5d'),_0x48c5('0x5e'),_0x48c5('0x5f'),_0x48c5('0x60'),_0x48c5('0x61'),_0x48c5('0x62'),_0x48c5('0x63'),_0x48c5('0x64'),_0x48c5('0x65'),_0x48c5('0x66'),_0x48c5('0x33'),_0x48c5('0x67'),'closed_at',_0x48c5('0x68'),_0x48c5('0x69'),_0x48c5('0x6a'),_0x48c5('0x6b'),'work_notes_list',_0x48c5('0x6c'),'priority',_0x48c5('0x6d'),_0x48c5('0x6e'),_0x48c5('0x6f'),_0x48c5('0x70'),_0x48c5('0x71'),_0x48c5('0x72'),'group_list',_0x48c5('0x73'),'reopened_time',_0x48c5('0x74'),'caller_id','approval_set',_0x48c5('0x75'),_0x48c5('0x76'),'short_description',_0x48c5('0x77'),_0x48c5('0x78'),'delivery_task',_0x48c5('0x79'),_0x48c5('0x7a'),_0x48c5('0x7b'),'additional_assignee_list',_0x48c5('0x7c'),_0x48c5('0x7d'),_0x48c5('0x54'),'sys_class_name',_0x48c5('0x7e'),_0x48c5('0x7f'),_0x48c5('0x80'),'parent_incident',_0x48c5('0x81'),_0x48c5('0x82'),'reopened_by',_0x48c5('0x55'),_0x48c5('0x83'),_0x48c5('0x84'),_0x48c5('0x85'),'reassignment_count','activity_due',_0x48c5('0x86'),'severity',_0x48c5('0x87'),_0x48c5('0x88'),'approval',_0x48c5('0x89'),_0x48c5('0x8a'),'sys_mod_count','reopen_count','sys_tags',_0x48c5('0x8b'),'upon_approval',_0x48c5('0x8c'),_0x48c5('0x8d'),_0x48c5('0x57')];var _0x305baf='';var _0x1cf7d6='';var _0x39c275=[];var _0x5bbec4='';var _0x227670='';var _0x108023=[];var _0x468f68='';var _0x40204a='';var _0x4c7726={};var _0x13b656='';return db['ServicenowAccount'][_0x48c5('0x47')]({'where':{'id':_0x44e429[_0x48c5('0x41')]['id']},'attributes':['id','username','password',_0x48c5('0x8e'),_0x48c5('0x8f'),_0x48c5('0x90')]})[_0x48c5('0x1f')](handleEntityNotFound(_0xfe7b2,null))['then'](function(_0x38308b){if(_0x38308b){_0x13b656=_0x38308b[_0x48c5('0x8f')];var _0x180113=_0x13b656[_0x48c5('0x91')](-0x1);if(_0x180113==='/'){_0x13b656=_0x13b656[_0x48c5('0x92')](0x0,_0x13b656[_0x48c5('0x93')](_0x180113));}_0x40204a=util[_0x48c5('0x94')]('%s/api/now/doc/table/schema/',_0x13b656);_0x468f68=util[_0x48c5('0x94')](_0x48c5('0x95'),_0x13b656);_0x4c7726={'user':_0x38308b[_0x48c5('0x96')],'pass':_0x38308b[_0x48c5('0x97')]};var _0xbc2ecd={'method':_0x48c5('0x98'),'uri':_0x40204a+_0x48c5('0x99'),'auth':_0x4c7726,'json':!![]};return rp(_0xbc2ecd);}})[_0x48c5('0x1f')](function(_0x2fef29){if(_0x2fef29['result'][_0x48c5('0x31')]>0x0){_0x305baf=_0x2fef29[_0x48c5('0x9a')];}console['log'](_0x48c5('0x9b'),_0x305baf);_0x108023=[];_0x1cf7d6=Object[_0x48c5('0x9c')]([],_0x305baf);_[_0x48c5('0x9d')](_0x1cf7d6,function(_0x17b9f4){return!_0x421ac0[_0x48c5('0x9e')](_0x17b9f4[_0x48c5('0x24')]);});_0x1cf7d6[_0x48c5('0x9f')](function(_0x10ed48){var _0x4eed78=createFieldObject(_0x468f68,_0x4c7726,_0x10ed48[_0x48c5('0xa0')],_0x10ed48[_0x48c5('0x24')],_0x10ed48['label'],![]);_0x108023[_0x48c5('0xa1')](_0x4eed78);});return Promise['all'](_0x108023);})[_0x48c5('0x1f')](function(_0xe65431){_0x39c275=_0xe65431;_0x5bbec4=Object['assign']([],_0x305baf);console[_0x48c5('0xa2')](_0x48c5('0xa3'),_0x305baf);_[_0x48c5('0x9d')](_0x5bbec4,function(_0x290838){return _0x532028[_0x48c5('0x9e')](_0x290838[_0x48c5('0x24')]);});console[_0x48c5('0xa2')](_0x48c5('0xa4'),_0x5bbec4);_0x108023=[];_0x5bbec4[_0x48c5('0x9f')](function(_0x3f5160){var _0x5334e1=createFieldObject(_0x468f68,_0x4c7726,_0x3f5160[_0x48c5('0xa0')],_0x3f5160[_0x48c5('0x24')],_0x3f5160[_0x48c5('0xa5')],!![]);_0x108023[_0x48c5('0xa1')](_0x5334e1);});return Promise[_0x48c5('0xa6')](_0x108023);})[_0x48c5('0x1f')](function(_0x132a55){_0x227670=_0x132a55;var _0x562e18=_0x39c275[_0x48c5('0xa7')](_0x227670);return{'count':_0x562e18[_0x48c5('0x31')],'rows':_0x562e18};})['then'](respondWithResult(_0xfe7b2,null))['catch'](function(_0xede16e){console[_0x48c5('0xa2')](_0x48c5('0xa8')+_0xede16e);var _0x31e6a2=_0x44e429['query'][_0x48c5('0xa9')]?0x1f4:_0xede16e['statusCode']||0x1f4;logger[_0x48c5('0x22')](_0xede16e['stack']);delete _0xede16e[_0x48c5('0x24')];if(_0x31e6a2===0x191){_0x31e6a2=0x190;}_0xfe7b2['status'](_0x31e6a2)[_0x48c5('0xaa')](_0x44e429[_0x48c5('0x2a')][_0x48c5('0xa9')]?{'message':_0x48c5('0xab'),'statusCode':_0xede16e[_0x48c5('0xac')]}:_0xede16e);});};function createFieldObject(_0x1f7da9,_0x176227,_0xc97784,_0x78c527,_0x250a7f,_0x143544){return new Promise(function(_0x11ad4c,_0x127609){var _0xcb5b58={'id':_0x78c527,'name':_0x250a7f,'custom':_0x143544};if(_0xc97784===_0x48c5('0xad')){_0xcb5b58[_0x48c5('0x3a')]=[{'name':_0x48c5('0xae'),'value':_0x48c5('0xaf')},{'name':_0x48c5('0xb0'),'value':_0x48c5('0xb1')}];_0x11ad4c(_0xcb5b58);}else{var _0x3e5956={'method':_0x48c5('0x98'),'uri':_0x1f7da9+_0x48c5('0xb2')+_0x78c527,'auth':_0x176227,'json':!![]};return rp(_0x3e5956)[_0x48c5('0x1f')](function(_0x14394){var _0x3742bd=[];if(_0x14394[_0x48c5('0x9a')][_0x48c5('0x31')]>0x0){_0x14394[_0x48c5('0x9a')][_0x48c5('0x9f')](function(_0x23b201){if(_0x23b201[_0x48c5('0xb3')]===_0x48c5('0xb1')){var _0x14eb79={'name':_0x23b201[_0x48c5('0xa5')],'value':_0x23b201[_0x48c5('0xb4')]};_0x3742bd[_0x48c5('0xa1')](_0x14eb79);}});}_0xcb5b58[_0x48c5('0x3a')]=_0x3742bd;if(_0xcb5b58[_0x48c5('0x3a')][_0x48c5('0x31')]>0x0){_0x11ad4c(_0xcb5b58);}else{if(_0x143544==![]){_0x11ad4c();}else{_0x11ad4c(_0xcb5b58);}}});}});} \ No newline at end of file +var _0xcb49=['stack','name','send','index','ServicenowAccount','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','params','length','find','body','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','channel','Descriptions','create','Subjects','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','email','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','concat','test','statusCode','True','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','options','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error'];(function(_0x1c618c,_0x216969){var _0xd42ed2=function(_0x440581){while(--_0x440581){_0x1c618c['push'](_0x1c618c['shift']());}};_0xd42ed2(++_0x216969);}(_0xcb49,0x13a));var _0x9cb4=function(_0x153faa,_0x75f2a){_0x153faa=_0x153faa-0x0;var _0x43c32a=_0xcb49[_0x153faa];return _0x43c32a;};'use strict';var emlformat=require(_0x9cb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9cb4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cb4('0x2'));var moment=require('moment');var BPromise=require(_0x9cb4('0x3'));var Mustache=require('mustache');var util=require(_0x9cb4('0x4'));var path=require(_0x9cb4('0x5'));var sox=require('sox');var csv=require(_0x9cb4('0x6'));var ejs=require(_0x9cb4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9cb4('0x8'));var squel=require('squel');var crypto=require(_0x9cb4('0x9'));var jsforce=require(_0x9cb4('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9cb4('0xb'));var Papa=require(_0x9cb4('0xc'));var Redis=require(_0x9cb4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9cb4('0xe'));var as=require(_0x9cb4('0xf'));var hardwareService=require(_0x9cb4('0x10'));var logger=require(_0x9cb4('0x11'))(_0x9cb4('0x12'));var utils=require(_0x9cb4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9cb4('0x14'));var db=require(_0x9cb4('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xa4168f,_0x3e6705){_0x3e6705=_0x3e6705||0xcc;return function(_0x425f49){if(_0x425f49){return _0xa4168f['sendStatus'](_0x3e6705);}return _0xa4168f[_0x9cb4('0x16')](_0x3e6705)[_0x9cb4('0x17')]();};}function respondWithResult(_0x26b5be,_0x567b85){_0x567b85=_0x567b85||0xc8;return function(_0x5943c0){if(_0x5943c0){return _0x26b5be['status'](_0x567b85)['json'](_0x5943c0);}};}function respondWithFilteredResult(_0x326aa0,_0x1df781){return function(_0x33f8e3){if(_0x33f8e3){var _0x4536b3=typeof _0x1df781[_0x9cb4('0x18')]==='undefined'&&typeof _0x1df781['limit']==='undefined';var _0x4119dd=_0x33f8e3['count'];var _0x27e033=_0x4536b3?0x0:_0x1df781[_0x9cb4('0x18')];var _0xe35224=_0x4536b3?_0x33f8e3[_0x9cb4('0x19')]:_0x1df781[_0x9cb4('0x18')]+_0x1df781['limit'];var _0x3511a4;if(_0xe35224>=_0x4119dd){_0xe35224=_0x4119dd;_0x3511a4=0xc8;}else{_0x3511a4=0xce;}_0x326aa0[_0x9cb4('0x16')](_0x3511a4);return _0x326aa0[_0x9cb4('0x1a')](_0x9cb4('0x1b'),_0x27e033+'-'+_0xe35224+'/'+_0x4119dd)[_0x9cb4('0x1c')](_0x33f8e3);}return null;};}function patchUpdates(_0x17ea46){return function(_0x12a4f0){try{jsonpatch[_0x9cb4('0x1d')](_0x12a4f0,_0x17ea46,!![]);}catch(_0x29e04b){return BPromise[_0x9cb4('0x1e')](_0x29e04b);}return _0x12a4f0[_0x9cb4('0x1f')]();};}function saveUpdates(_0x5c4273,_0x9d830){return function(_0x42b455){if(_0x42b455){return _0x42b455[_0x9cb4('0x20')](_0x5c4273)['then'](function(_0x3f2189){return _0x3f2189;});}return null;};}function removeEntity(_0x4de970,_0x590961){return function(_0x4a0171){if(_0x4a0171){return _0x4a0171['destroy']()[_0x9cb4('0x21')](function(){_0x4de970[_0x9cb4('0x16')](0xcc)[_0x9cb4('0x17')]();});}};}function handleEntityNotFound(_0x4234af,_0x11308c){return function(_0x551e74){if(!_0x551e74){_0x4234af[_0x9cb4('0x22')](0x194);}return _0x551e74;};}function handleError(_0x28b75a,_0x1455ed){_0x1455ed=_0x1455ed||0x1f4;return function(_0x4a23b4){logger[_0x9cb4('0x23')](_0x4a23b4[_0x9cb4('0x24')]);if(_0x4a23b4['name']){delete _0x4a23b4[_0x9cb4('0x25')];}_0x28b75a[_0x9cb4('0x16')](_0x1455ed)[_0x9cb4('0x26')](_0x4a23b4);};}exports[_0x9cb4('0x27')]=function(_0xbb4c5,_0x5a9d06){var _0x378c37={},_0x5d9841={},_0x5d54f9={'count':0x0,'rows':[]};var _0x55f324=_['map'](db[_0x9cb4('0x28')][_0x9cb4('0x29')],function(_0x446cbd){return{'name':_0x446cbd['fieldName'],'type':_0x446cbd[_0x9cb4('0x2a')]['key']};});_0x5d9841['model']=_[_0x9cb4('0x2b')](_0x55f324,'name');_0x5d9841[_0x9cb4('0x2c')]=_[_0x9cb4('0x2d')](_0xbb4c5[_0x9cb4('0x2c')]);_0x5d9841[_0x9cb4('0x2e')]=_[_0x9cb4('0x2f')](_0x5d9841[_0x9cb4('0x30')],_0x5d9841[_0x9cb4('0x2c')]);_0x378c37[_0x9cb4('0x31')]=_[_0x9cb4('0x2f')](_0x5d9841[_0x9cb4('0x30')],qs[_0x9cb4('0x32')](_0xbb4c5[_0x9cb4('0x2c')]['fields']));_0x378c37[_0x9cb4('0x31')]=_0x378c37[_0x9cb4('0x31')]['length']?_0x378c37[_0x9cb4('0x31')]:_0x5d9841['model'];if(!_0xbb4c5[_0x9cb4('0x2c')]['hasOwnProperty'](_0x9cb4('0x33'))){_0x378c37[_0x9cb4('0x34')]=qs[_0x9cb4('0x34')](_0xbb4c5['query'][_0x9cb4('0x34')]);_0x378c37[_0x9cb4('0x18')]=qs[_0x9cb4('0x18')](_0xbb4c5['query'][_0x9cb4('0x18')]);}_0x378c37[_0x9cb4('0x35')]=qs[_0x9cb4('0x36')](_0xbb4c5[_0x9cb4('0x2c')][_0x9cb4('0x36')]);_0x378c37[_0x9cb4('0x37')]=qs[_0x9cb4('0x2e')](_[_0x9cb4('0x38')](_0xbb4c5['query'],_0x5d9841[_0x9cb4('0x2e')]),_0x55f324);if(_0xbb4c5[_0x9cb4('0x2c')][_0x9cb4('0x39')]){_0x378c37[_0x9cb4('0x37')]=_[_0x9cb4('0x3a')](_0x378c37[_0x9cb4('0x37')],{'$or':_[_0x9cb4('0x2b')](_0x55f324,function(_0x2852e2){if(_0x2852e2[_0x9cb4('0x2a')]!=='VIRTUAL'){var _0x244b14={};_0x244b14[_0x2852e2[_0x9cb4('0x25')]]={'$like':'%'+_0xbb4c5['query'][_0x9cb4('0x39')]+'%'};return _0x244b14;}})});}_0x378c37=_['merge']({},_0x378c37,_0xbb4c5['options']);var _0x442d22={'where':_0x378c37[_0x9cb4('0x37')]};return db[_0x9cb4('0x28')][_0x9cb4('0x19')](_0x442d22)[_0x9cb4('0x21')](function(_0x3210ff){_0x5d54f9[_0x9cb4('0x19')]=_0x3210ff;if(_0xbb4c5[_0x9cb4('0x2c')]['includeAll']){_0x378c37[_0x9cb4('0x3b')]=[{'all':!![]}];}return db[_0x9cb4('0x28')][_0x9cb4('0x3c')](_0x378c37);})[_0x9cb4('0x21')](function(_0x50aca8){_0x5d54f9[_0x9cb4('0x3d')]=_0x50aca8;return _0x5d54f9;})[_0x9cb4('0x21')](respondWithFilteredResult(_0x5a9d06,_0x378c37))[_0x9cb4('0x3e')](handleError(_0x5a9d06,null));};exports['show']=function(_0x3edbfd,_0x45965d){var _0x536b53={'raw':![],'where':{'id':_0x3edbfd[_0x9cb4('0x3f')]['id']}},_0x3c4ef0={};_0x3c4ef0[_0x9cb4('0x30')]=_[_0x9cb4('0x2d')](db[_0x9cb4('0x28')][_0x9cb4('0x29')]);_0x3c4ef0[_0x9cb4('0x2c')]=_[_0x9cb4('0x2d')](_0x3edbfd[_0x9cb4('0x2c')]);_0x3c4ef0[_0x9cb4('0x2e')]=_[_0x9cb4('0x2f')](_0x3c4ef0[_0x9cb4('0x30')],_0x3c4ef0[_0x9cb4('0x2c')]);_0x536b53[_0x9cb4('0x31')]=_['intersection'](_0x3c4ef0[_0x9cb4('0x30')],qs[_0x9cb4('0x32')](_0x3edbfd[_0x9cb4('0x2c')][_0x9cb4('0x32')]));_0x536b53[_0x9cb4('0x31')]=_0x536b53[_0x9cb4('0x31')][_0x9cb4('0x40')]?_0x536b53[_0x9cb4('0x31')]:_0x3c4ef0['model'];if(_0x3edbfd[_0x9cb4('0x2c')]['includeAll']){_0x536b53[_0x9cb4('0x3b')]=[{'all':!![]}];}_0x536b53=_[_0x9cb4('0x3a')]({},_0x536b53,_0x3edbfd['options']);return db[_0x9cb4('0x28')][_0x9cb4('0x41')](_0x536b53)[_0x9cb4('0x21')](handleEntityNotFound(_0x45965d,null))[_0x9cb4('0x21')](respondWithResult(_0x45965d,null))[_0x9cb4('0x3e')](handleError(_0x45965d,null));};exports['create']=function(_0x548596,_0x10e4c9){return db[_0x9cb4('0x28')]['create'](_0x548596['body'],{})['then'](respondWithResult(_0x10e4c9,0xc9))['catch'](handleError(_0x10e4c9,null));};exports[_0x9cb4('0x20')]=function(_0xa4d816,_0x1709ba){if(_0xa4d816[_0x9cb4('0x42')]['id']){delete _0xa4d816['body']['id'];}return db[_0x9cb4('0x28')][_0x9cb4('0x41')]({'where':{'id':_0xa4d816[_0x9cb4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1709ba,null))['then'](saveUpdates(_0xa4d816[_0x9cb4('0x42')],null))[_0x9cb4('0x21')](respondWithResult(_0x1709ba,null))[_0x9cb4('0x3e')](handleError(_0x1709ba,null));};exports[_0x9cb4('0x43')]=function(_0x3bfb07,_0x2ec628){return db[_0x9cb4('0x28')][_0x9cb4('0x41')]({'where':{'id':_0x3bfb07['params']['id']}})['then'](handleEntityNotFound(_0x2ec628,null))['then'](removeEntity(_0x2ec628,null))[_0x9cb4('0x3e')](handleError(_0x2ec628,null));};exports[_0x9cb4('0x44')]=function(_0x1699d3,_0x29d8bd,_0xec5261){var _0x327f44={};var _0x27a149={};var _0x189783;var _0x588179;return db[_0x9cb4('0x28')][_0x9cb4('0x45')]({'where':{'id':_0x1699d3[_0x9cb4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x29d8bd,null))['then'](function(_0x1e5667){if(_0x1e5667){_0x189783=_0x1e5667;_0x27a149[_0x9cb4('0x30')]=_[_0x9cb4('0x2d')](db[_0x9cb4('0x46')]['rawAttributes']);_0x27a149['query']=_[_0x9cb4('0x2d')](_0x1699d3[_0x9cb4('0x2c')]);_0x27a149[_0x9cb4('0x2e')]=_[_0x9cb4('0x2f')](_0x27a149[_0x9cb4('0x30')],_0x27a149['query']);_0x327f44[_0x9cb4('0x31')]=_[_0x9cb4('0x2f')](_0x27a149[_0x9cb4('0x30')],qs[_0x9cb4('0x32')](_0x1699d3[_0x9cb4('0x2c')]['fields']));_0x327f44['attributes']=_0x327f44[_0x9cb4('0x31')][_0x9cb4('0x40')]?_0x327f44[_0x9cb4('0x31')]:_0x27a149['model'];_0x327f44[_0x9cb4('0x35')]=qs[_0x9cb4('0x36')](_0x1699d3['query']['sort']);_0x327f44[_0x9cb4('0x37')]=qs[_0x9cb4('0x2e')](_[_0x9cb4('0x38')](_0x1699d3['query'],_0x27a149[_0x9cb4('0x2e')]));if(_0x1699d3[_0x9cb4('0x2c')][_0x9cb4('0x39')]){_0x327f44[_0x9cb4('0x37')]=_[_0x9cb4('0x3a')](_0x327f44[_0x9cb4('0x37')],{'$or':_[_0x9cb4('0x2b')](_0x327f44['attributes'],function(_0x1335b1){var _0x4409f2={};_0x4409f2[_0x1335b1]={'$like':'%'+_0x1699d3[_0x9cb4('0x2c')]['filter']+'%'};return _0x4409f2;})});}_0x327f44=_[_0x9cb4('0x3a')]({},_0x327f44,_0x1699d3['options']);return _0x189783['getConfigurations'](_0x327f44);}})[_0x9cb4('0x21')](function(_0x47eda5){if(_0x47eda5){_0x588179=_0x47eda5[_0x9cb4('0x40')];if(!_0x1699d3[_0x9cb4('0x2c')]['hasOwnProperty'](_0x9cb4('0x33'))){_0x327f44[_0x9cb4('0x34')]=qs[_0x9cb4('0x34')](_0x1699d3[_0x9cb4('0x2c')][_0x9cb4('0x34')]);_0x327f44[_0x9cb4('0x18')]=qs['offset'](_0x1699d3[_0x9cb4('0x2c')][_0x9cb4('0x18')]);}return _0x189783[_0x9cb4('0x44')](_0x327f44);}})[_0x9cb4('0x21')](function(_0x18fbf3){if(_0x18fbf3){return _0x18fbf3?{'count':_0x588179,'rows':_0x18fbf3}:null;}})[_0x9cb4('0x21')](respondWithResult(_0x29d8bd,null))[_0x9cb4('0x3e')](handleError(_0x29d8bd,null));};exports[_0x9cb4('0x47')]=function(_0x2604e2,_0x33b239,_0xc6a9b7){if(_0x2604e2[_0x9cb4('0x42')]['id']){delete _0x2604e2[_0x9cb4('0x42')]['id'];}return db[_0x9cb4('0x28')][_0x9cb4('0x45')]({'where':{'id':_0x2604e2[_0x9cb4('0x3f')]['id']}})[_0x9cb4('0x21')](handleEntityNotFound(_0x33b239,null))[_0x9cb4('0x21')](function(_0x7f5dc3){if(_0x7f5dc3){_0x2604e2[_0x9cb4('0x42')][_0x9cb4('0x48')]=_0x7f5dc3['id'];_0x2604e2[_0x9cb4('0x42')]['Subjects']=integrations['getSubjects'](_0x2604e2[_0x9cb4('0x42')][_0x9cb4('0x49')],_0x2604e2[_0x9cb4('0x42')][_0x9cb4('0x2a')]);_0x2604e2[_0x9cb4('0x42')][_0x9cb4('0x4a')]=integrations['getDescriptions'](_0x2604e2[_0x9cb4('0x42')][_0x9cb4('0x49')],_0x2604e2['body']['type']);return db[_0x9cb4('0x46')][_0x9cb4('0x4b')](_0x2604e2[_0x9cb4('0x42')],{'include':[{'model':db['ServicenowField'],'as':_0x9cb4('0x4c')},{'model':db[_0x9cb4('0x4d')],'as':_0x9cb4('0x4a')}]});}return null;})[_0x9cb4('0x21')](respondWithResult(_0x33b239,null))[_0x9cb4('0x3e')](handleError(_0x33b239,null));};exports['getFields']=function(_0x3c0f03,_0x253f69,_0x5d7ffe){var _0x2aa619=[_0x9cb4('0x4e'),_0x9cb4('0x4f'),_0x9cb4('0x50'),_0x9cb4('0x51'),_0x9cb4('0x52'),_0x9cb4('0x53'),_0x9cb4('0x54'),'severity',_0x9cb4('0x55')];var _0x5e72eb=[_0x9cb4('0x56'),'made_sla',_0x9cb4('0x57'),_0x9cb4('0x58'),'upon_reject',_0x9cb4('0x59'),_0x9cb4('0x5a'),'hold_reason',_0x9cb4('0x5b'),_0x9cb4('0x5c'),_0x9cb4('0x5d'),_0x9cb4('0x5e'),_0x9cb4('0x5f'),_0x9cb4('0x60'),_0x9cb4('0x61'),'sys_domain',_0x9cb4('0x62'),'sys_created_by',_0x9cb4('0x50'),'order',_0x9cb4('0x63'),_0x9cb4('0x64'),'cmdb_ci',_0x9cb4('0x65'),_0x9cb4('0x66'),_0x9cb4('0x67'),_0x9cb4('0x68'),_0x9cb4('0x69'),_0x9cb4('0x6a'),_0x9cb4('0x6b'),_0x9cb4('0x6c'),'time_worked',_0x9cb4('0x6d'),_0x9cb4('0x6e'),'business_duration','group_list','work_end',_0x9cb4('0x6f'),_0x9cb4('0x70'),'caller_id',_0x9cb4('0x71'),'subcategory',_0x9cb4('0x72'),_0x9cb4('0x73'),_0x9cb4('0x52'),_0x9cb4('0x74'),_0x9cb4('0x75'),_0x9cb4('0x76'),_0x9cb4('0x77'),'business_stc',_0x9cb4('0x78'),_0x9cb4('0x79'),_0x9cb4('0x7a'),_0x9cb4('0x53'),_0x9cb4('0x7b'),_0x9cb4('0x7c'),'closed_by',_0x9cb4('0x7d'),_0x9cb4('0x7e'),_0x9cb4('0x7f'),_0x9cb4('0x80'),_0x9cb4('0x81'),'incident_state',_0x9cb4('0x82'),_0x9cb4('0x83'),_0x9cb4('0x84'),'reassignment_count',_0x9cb4('0x85'),'assigned_to','severity',_0x9cb4('0x86'),_0x9cb4('0x87'),_0x9cb4('0x88'),_0x9cb4('0x89'),_0x9cb4('0x8a'),_0x9cb4('0x8b'),_0x9cb4('0x8c'),_0x9cb4('0x8d'),_0x9cb4('0x8e'),_0x9cb4('0x8f'),_0x9cb4('0x90'),'location',_0x9cb4('0x55')];var _0x137ebf='';var _0x1af344='';var _0x23ecbe=[];var _0x1533a4='';var _0x5f2541='';var _0x392c6e=[];var _0x5cff51='';var _0x4cbc21='';var _0x4a6e5b={};var _0x4078aa='';return db['ServicenowAccount'][_0x9cb4('0x45')]({'where':{'id':_0x3c0f03[_0x9cb4('0x3f')]['id']},'attributes':['id',_0x9cb4('0x91'),'password',_0x9cb4('0x92'),'remoteUri',_0x9cb4('0x93')]})[_0x9cb4('0x21')](handleEntityNotFound(_0x253f69,null))['then'](function(_0x408b70){if(_0x408b70){_0x4078aa=_0x408b70['remoteUri'];var _0x250fa7=_0x4078aa[_0x9cb4('0x94')](-0x1);if(_0x250fa7==='/'){_0x4078aa=_0x4078aa[_0x9cb4('0x95')](0x0,_0x4078aa[_0x9cb4('0x96')](_0x250fa7));}_0x4cbc21=util['format'](_0x9cb4('0x97'),_0x4078aa);_0x5cff51=util[_0x9cb4('0x98')]('%s/api/now/table/',_0x4078aa);_0x4a6e5b={'user':_0x408b70[_0x9cb4('0x91')],'pass':_0x408b70[_0x9cb4('0x99')]};var _0x1f2c05={'method':_0x9cb4('0x9a'),'uri':_0x4cbc21+_0x9cb4('0x9b'),'auth':_0x4a6e5b,'json':!![]};return rp(_0x1f2c05);}})[_0x9cb4('0x21')](function(_0x5921ae){if(_0x5921ae[_0x9cb4('0x9c')][_0x9cb4('0x40')]>0x0){_0x137ebf=_0x5921ae[_0x9cb4('0x9c')];}console[_0x9cb4('0x9d')](_0x9cb4('0x9e'),_0x137ebf);_0x392c6e=[];_0x1af344=Object[_0x9cb4('0x9f')]([],_0x137ebf);_[_0x9cb4('0xa0')](_0x1af344,function(_0xbd6c9f){return!_0x2aa619[_0x9cb4('0xa1')](_0xbd6c9f[_0x9cb4('0x25')]);});_0x1af344[_0x9cb4('0xa2')](function(_0x130b81){var _0x5dc0f8=createFieldObject(_0x5cff51,_0x4a6e5b,_0x130b81[_0x9cb4('0xa3')],_0x130b81[_0x9cb4('0x25')],_0x130b81['label'],![]);_0x392c6e[_0x9cb4('0xa4')](_0x5dc0f8);});return Promise['all'](_0x392c6e);})[_0x9cb4('0x21')](function(_0x172cf8){_0x23ecbe=_0x172cf8;_0x1533a4=Object['assign']([],_0x137ebf);console[_0x9cb4('0x9d')]('TCL:\x20_object',_0x137ebf);_[_0x9cb4('0xa0')](_0x1533a4,function(_0x2350c4){return _0x5e72eb['includes'](_0x2350c4[_0x9cb4('0x25')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1533a4);_0x392c6e=[];_0x1533a4['forEach'](function(_0x100aae){var _0x2039fd=createFieldObject(_0x5cff51,_0x4a6e5b,_0x100aae[_0x9cb4('0xa3')],_0x100aae[_0x9cb4('0x25')],_0x100aae['label'],!![]);_0x392c6e[_0x9cb4('0xa4')](_0x2039fd);});return Promise[_0x9cb4('0xa5')](_0x392c6e);})[_0x9cb4('0x21')](function(_0x172645){_0x5f2541=_0x172645;var _0x3c9b12=_0x23ecbe[_0x9cb4('0xa6')](_0x5f2541);return{'count':_0x3c9b12[_0x9cb4('0x40')],'rows':_0x3c9b12};})[_0x9cb4('0x21')](respondWithResult(_0x253f69,null))['catch'](function(_0x254f35){console[_0x9cb4('0x9d')]('ServiceNow\x20error:\x20'+_0x254f35);var _0x58c5c5=_0x3c0f03[_0x9cb4('0x2c')][_0x9cb4('0xa7')]?0x1f4:_0x254f35[_0x9cb4('0xa8')]||0x1f4;logger['error'](_0x254f35[_0x9cb4('0x24')]);delete _0x254f35[_0x9cb4('0x25')];if(_0x58c5c5===0x191){_0x58c5c5=0x190;}_0x253f69[_0x9cb4('0x16')](_0x58c5c5)['send'](_0x3c0f03['query'][_0x9cb4('0xa7')]?{'message':'Wrong\x20credentials','statusCode':_0x254f35[_0x9cb4('0xa8')]}:_0x254f35);});};function createFieldObject(_0x17c39a,_0x3dce36,_0x4acfd2,_0x12034f,_0x50140f,_0x5a4c81){return new Promise(function(_0xf88e63,_0x1146ae){var _0x5a1965={'id':_0x12034f,'name':_0x50140f,'custom':_0x5a4c81};if(_0x4acfd2==='boolean'){_0x5a1965['options']=[{'name':_0x9cb4('0xa9'),'value':'true'},{'name':'False','value':'false'}];_0xf88e63(_0x5a1965);}else{var _0x821196={'method':_0x9cb4('0x9a'),'uri':_0x17c39a+_0x9cb4('0xaa')+_0x12034f,'auth':_0x3dce36,'json':!![]};return rp(_0x821196)[_0x9cb4('0x21')](function(_0x5a309e){var _0x54e51c=[];if(_0x5a309e[_0x9cb4('0x9c')]['length']>0x0){_0x5a309e[_0x9cb4('0x9c')][_0x9cb4('0xa2')](function(_0x2670bb){if(_0x2670bb[_0x9cb4('0xab')]===_0x9cb4('0xac')){var _0x1a5bc1={'name':_0x2670bb['label'],'value':_0x2670bb[_0x9cb4('0xad')]};_0x54e51c[_0x9cb4('0xa4')](_0x1a5bc1);}});}_0x5a1965[_0x9cb4('0xae')]=_0x54e51c;if(_0x5a1965[_0x9cb4('0xae')][_0x9cb4('0x40')]>0x0){_0xf88e63(_0x5a1965);}else{if(_0x5a4c81==![]){_0xf88e63();}else{_0xf88e63(_0x5a1965);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index c4e95fd..8e97714 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(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0x7a54,0x106));var _0x47a5=function(_0x46efd6,_0x55719c){_0x46efd6=_0x46efd6-0x0;var _0x564dc9=_0x7a54[_0x46efd6];return _0x564dc9;};'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(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7da7,0x10d));var _0x77da=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x7da7[_0x53f0db];return _0xae0a5c;};'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 b1e0fc3..8d4c120 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 _0xd875=['findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','util','moment','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','ServicenowAccount'];(function(_0xc9bd13,_0x3ceab7){var _0x3e7481=function(_0x281b77){while(--_0x281b77){_0xc9bd13['push'](_0xc9bd13['shift']());}};_0x3e7481(++_0x3ceab7);}(_0xd875,0xe4));var _0x5d87=function(_0x9c79b3,_0x5c5ac0){_0x9c79b3=_0x9c79b3-0x0;var _0x2b897a=_0xd875[_0x9c79b3];return _0x2b897a;};'use strict';var _=require('lodash');var util=require(_0x5d87('0x0'));var moment=require(_0x5d87('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d87('0x3'))(_0x5d87('0x4'));var config=require('../../config/environment');var jayson=require(_0x5d87('0x5'));var client=jayson['client'][_0x5d87('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a6210,_0x58356f,_0x2e898d){return new BPromise(function(_0x471fd8,_0x306f89){return client[_0x5d87('0x7')](_0x5a6210,_0x2e898d)[_0x5d87('0x8')](function(_0x5e5fa9){logger[_0x5d87('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x58356f,_0x5d87('0xa'));logger[_0x5d87('0xb')](_0x5d87('0xc'),_0x58356f,_0x5d87('0xa'),JSON[_0x5d87('0xd')](_0x5e5fa9));if(_0x5e5fa9[_0x5d87('0xe')]){if(_0x5e5fa9[_0x5d87('0xe')]['code']===0x1f4){logger[_0x5d87('0xe')](_0x5d87('0xf'),_0x58356f,_0x5e5fa9[_0x5d87('0xe')][_0x5d87('0x10')]);return _0x306f89(_0x5e5fa9[_0x5d87('0xe')][_0x5d87('0x10')]);}logger[_0x5d87('0xe')](_0x5d87('0xf'),_0x58356f,_0x5e5fa9[_0x5d87('0xe')][_0x5d87('0x10')]);return _0x471fd8(_0x5e5fa9['error']['message']);}else{logger[_0x5d87('0x9')](_0x5d87('0xf'),_0x58356f,_0x5d87('0xa'));_0x471fd8(_0x5e5fa9['result'][_0x5d87('0x10')]);}})[_0x5d87('0x11')](function(_0x5c335b){logger['error'](_0x5d87('0xf'),_0x58356f,_0x5c335b);_0x306f89(_0x5c335b);});});}exports[_0x5d87('0x12')]=function(_0x31ff54){var _0x36af93=this;return new Promise(function(_0x5ea7b5,_0xf698e8){return db[_0x5d87('0x13')][_0x5d87('0x14')]({'raw':_0x31ff54[_0x5d87('0x15')]?_0x31ff54[_0x5d87('0x15')][_0x5d87('0x16')]===undefined?!![]:![]:!![],'where':_0x31ff54[_0x5d87('0x15')]?_0x31ff54[_0x5d87('0x15')][_0x5d87('0x17')]||null:null,'attributes':_0x31ff54['options']?_0x31ff54['options'][_0x5d87('0x18')]||null:null,'limit':_0x31ff54[_0x5d87('0x15')]?_0x31ff54[_0x5d87('0x15')][_0x5d87('0x19')]||null:null,'include':_0x31ff54['options']?_0x31ff54[_0x5d87('0x15')][_0x5d87('0x1a')]?_[_0x5d87('0x1b')](_0x31ff54['options'][_0x5d87('0x1a')],function(_0x2956b7){return{'model':db[_0x2956b7[_0x5d87('0x1c')]],'as':_0x2956b7['as'],'attributes':_0x2956b7[_0x5d87('0x18')],'include':_0x2956b7[_0x5d87('0x1a')]?_[_0x5d87('0x1b')](_0x2956b7['include'],function(_0x46724b){return{'model':db[_0x46724b[_0x5d87('0x1c')]],'as':_0x46724b['as'],'attributes':_0x46724b[_0x5d87('0x18')],'include':_0x46724b[_0x5d87('0x1a')]?_['map'](_0x46724b[_0x5d87('0x1a')],function(_0x22d189){return{'model':db[_0x22d189['model']],'as':_0x22d189['as'],'attributes':_0x22d189[_0x5d87('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5d87('0x8')](function(_0x404cbe){logger[_0x5d87('0x9')](_0x5d87('0x12'),_0x31ff54);logger[_0x5d87('0xb')]('GetServicenowAccount',_0x31ff54,JSON[_0x5d87('0xd')](_0x404cbe));_0x5ea7b5(_0x404cbe);})[_0x5d87('0x11')](function(_0x8967b3){logger[_0x5d87('0xe')](_0x5d87('0x12'),_0x8967b3[_0x5d87('0x10')],_0x31ff54);_0xf698e8(_0x36af93[_0x5d87('0xe')](0x1f4,_0x8967b3['message']));});});};exports[_0x5d87('0x1d')]=function(_0x305a1d){var _0x4efad5=this;return new Promise(function(_0x203251,_0x25a650){return db['ServicenowAccount'][_0x5d87('0x1e')]({'raw':_0x305a1d[_0x5d87('0x15')]?_0x305a1d['options']['raw']===undefined?!![]:![]:!![],'where':_0x305a1d['options']?_0x305a1d['options'][_0x5d87('0x17')]||null:null,'attributes':_0x305a1d[_0x5d87('0x15')]?_0x305a1d[_0x5d87('0x15')][_0x5d87('0x18')]||null:null,'include':_0x305a1d[_0x5d87('0x15')]?_0x305a1d[_0x5d87('0x15')][_0x5d87('0x1a')]?_[_0x5d87('0x1b')](_0x305a1d[_0x5d87('0x15')][_0x5d87('0x1a')],function(_0x2382d4){return{'model':db[_0x2382d4[_0x5d87('0x1c')]],'as':_0x2382d4['as'],'attributes':_0x2382d4[_0x5d87('0x18')],'include':_0x2382d4[_0x5d87('0x1a')]?_[_0x5d87('0x1b')](_0x2382d4['include'],function(_0x4dba77){return{'model':db[_0x4dba77['model']],'as':_0x4dba77['as'],'attributes':_0x4dba77['attributes'],'include':_0x4dba77['include']?_[_0x5d87('0x1b')](_0x4dba77[_0x5d87('0x1a')],function(_0x510dc5){return{'model':db[_0x510dc5[_0x5d87('0x1c')]],'as':_0x510dc5['as'],'attributes':_0x510dc5[_0x5d87('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5d87('0x8')](function(_0x2d656d){logger[_0x5d87('0x9')](_0x5d87('0x1d'),_0x305a1d);logger[_0x5d87('0xb')](_0x5d87('0x1d'),_0x305a1d,JSON[_0x5d87('0xd')](_0x2d656d));_0x203251(_0x2d656d);})[_0x5d87('0x11')](function(_0x58f951){logger[_0x5d87('0xe')](_0x5d87('0x1d'),_0x58f951[_0x5d87('0x10')],_0x305a1d);_0x25a650(_0x4efad5[_0x5d87('0xe')](0x1f4,_0x58f951[_0x5d87('0x10')]));});});}; \ No newline at end of file +var _0x9748=['../../config/environment','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowServicenowAccount','find','lodash','util','moment','randomstring','../../config/logger','rpc'];(function(_0x12d09e,_0x16be4f){var _0x564f69=function(_0x351276){while(--_0x351276){_0x12d09e['push'](_0x12d09e['shift']());}};_0x564f69(++_0x16be4f);}(_0x9748,0xe8));var _0x8974=function(_0x5883e3,_0x147e1a){_0x5883e3=_0x5883e3-0x0;var _0xcc0f20=_0x9748[_0x5883e3];return _0xcc0f20;};'use strict';var _=require(_0x8974('0x0'));var util=require(_0x8974('0x1'));var moment=require(_0x8974('0x2'));var BPromise=require('bluebird');var rs=require(_0x8974('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8974('0x4'))(_0x8974('0x5'));var config=require(_0x8974('0x6'));var jayson=require(_0x8974('0x7'));var client=jayson['client'][_0x8974('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f28d0,_0x400169,_0x5b5c05){return new BPromise(function(_0x34ff12,_0x250175){return client[_0x8974('0x9')](_0x2f28d0,_0x5b5c05)['then'](function(_0x3bdae5){logger[_0x8974('0xa')](_0x8974('0xb'),_0x400169,_0x8974('0xc'));logger[_0x8974('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x400169,_0x8974('0xc'),JSON[_0x8974('0xe')](_0x3bdae5));if(_0x3bdae5[_0x8974('0xf')]){if(_0x3bdae5[_0x8974('0xf')][_0x8974('0x10')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x400169,_0x3bdae5['error']['message']);return _0x250175(_0x3bdae5[_0x8974('0xf')][_0x8974('0x11')]);}logger[_0x8974('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x400169,_0x3bdae5[_0x8974('0xf')][_0x8974('0x11')]);return _0x34ff12(_0x3bdae5[_0x8974('0xf')][_0x8974('0x11')]);}else{logger[_0x8974('0xa')](_0x8974('0xb'),_0x400169,_0x8974('0xc'));_0x34ff12(_0x3bdae5[_0x8974('0x12')][_0x8974('0x11')]);}})[_0x8974('0x13')](function(_0x58db40){logger[_0x8974('0xf')](_0x8974('0xb'),_0x400169,_0x58db40);_0x250175(_0x58db40);});});}exports[_0x8974('0x14')]=function(_0x4ff4ee){var _0x295d2c=this;return new Promise(function(_0x4740d4,_0x55581d){return db[_0x8974('0x15')][_0x8974('0x16')]({'raw':_0x4ff4ee[_0x8974('0x17')]?_0x4ff4ee['options'][_0x8974('0x18')]===undefined?!![]:![]:!![],'where':_0x4ff4ee[_0x8974('0x17')]?_0x4ff4ee[_0x8974('0x17')][_0x8974('0x19')]||null:null,'attributes':_0x4ff4ee['options']?_0x4ff4ee[_0x8974('0x17')][_0x8974('0x1a')]||null:null,'limit':_0x4ff4ee[_0x8974('0x17')]?_0x4ff4ee[_0x8974('0x17')][_0x8974('0x1b')]||null:null,'include':_0x4ff4ee['options']?_0x4ff4ee[_0x8974('0x17')][_0x8974('0x1c')]?_[_0x8974('0x1d')](_0x4ff4ee['options']['include'],function(_0x184a6d){return{'model':db[_0x184a6d[_0x8974('0x1e')]],'as':_0x184a6d['as'],'attributes':_0x184a6d['attributes'],'include':_0x184a6d[_0x8974('0x1c')]?_['map'](_0x184a6d[_0x8974('0x1c')],function(_0x2f39a7){return{'model':db[_0x2f39a7[_0x8974('0x1e')]],'as':_0x2f39a7['as'],'attributes':_0x2f39a7[_0x8974('0x1a')],'include':_0x2f39a7['include']?_[_0x8974('0x1d')](_0x2f39a7[_0x8974('0x1c')],function(_0x41346b){return{'model':db[_0x41346b[_0x8974('0x1e')]],'as':_0x41346b['as'],'attributes':_0x41346b[_0x8974('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8974('0x1f')](function(_0x513cc8){logger['info'](_0x8974('0x14'),_0x4ff4ee);logger[_0x8974('0xd')]('GetServicenowAccount',_0x4ff4ee,JSON[_0x8974('0xe')](_0x513cc8));_0x4740d4(_0x513cc8);})[_0x8974('0x13')](function(_0x372deb){logger['error']('GetServicenowAccount',_0x372deb[_0x8974('0x11')],_0x4ff4ee);_0x55581d(_0x295d2c[_0x8974('0xf')](0x1f4,_0x372deb[_0x8974('0x11')]));});});};exports[_0x8974('0x20')]=function(_0x4491b5){var _0x1d2c91=this;return new Promise(function(_0x5310b0,_0x29c08c){return db[_0x8974('0x15')][_0x8974('0x21')]({'raw':_0x4491b5[_0x8974('0x17')]?_0x4491b5[_0x8974('0x17')][_0x8974('0x18')]===undefined?!![]:![]:!![],'where':_0x4491b5[_0x8974('0x17')]?_0x4491b5['options'][_0x8974('0x19')]||null:null,'attributes':_0x4491b5[_0x8974('0x17')]?_0x4491b5['options'][_0x8974('0x1a')]||null:null,'include':_0x4491b5[_0x8974('0x17')]?_0x4491b5[_0x8974('0x17')]['include']?_['map'](_0x4491b5[_0x8974('0x17')][_0x8974('0x1c')],function(_0x2efa02){return{'model':db[_0x2efa02['model']],'as':_0x2efa02['as'],'attributes':_0x2efa02['attributes'],'include':_0x2efa02[_0x8974('0x1c')]?_[_0x8974('0x1d')](_0x2efa02[_0x8974('0x1c')],function(_0x26238d){return{'model':db[_0x26238d[_0x8974('0x1e')]],'as':_0x26238d['as'],'attributes':_0x26238d[_0x8974('0x1a')],'include':_0x26238d[_0x8974('0x1c')]?_[_0x8974('0x1d')](_0x26238d[_0x8974('0x1c')],function(_0x46caa5){return{'model':db[_0x46caa5[_0x8974('0x1e')]],'as':_0x46caa5['as'],'attributes':_0x46caa5[_0x8974('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39e0c4){logger[_0x8974('0xa')](_0x8974('0x20'),_0x4491b5);logger[_0x8974('0xd')](_0x8974('0x20'),_0x4491b5,JSON[_0x8974('0xe')](_0x39e0c4));_0x5310b0(_0x39e0c4);})[_0x8974('0x13')](function(_0x123f87){logger['error'](_0x8974('0x20'),_0x123f87[_0x8974('0x11')],_0x4491b5);_0x29c08c(_0x1d2c91[_0x8974('0xf')](0x1f4,_0x123f87[_0x8974('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b1e2955..56759cb 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 _0x74d4=['/:id/descriptions','post','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/subjects'];(function(_0x49f3d8,_0x300bf1){var _0x3c05eb=function(_0x3aa5f4){while(--_0x3aa5f4){_0x49f3d8['push'](_0x49f3d8['shift']());}};_0x3c05eb(++_0x300bf1);}(_0x74d4,0xe4));var _0x474d=function(_0x5cd0fb,_0x253865){_0x5cd0fb=_0x5cd0fb-0x0;var _0x5301f0=_0x74d4[_0x5cd0fb];return _0x5301f0;};'use strict';var multer=require('multer');var util=require(_0x474d('0x0'));var path=require(_0x474d('0x1'));var timeout=require(_0x474d('0x2'));var express=require(_0x474d('0x3'));var router=express[_0x474d('0x4')]();var fs_extra=require(_0x474d('0x5'));var auth=require(_0x474d('0x6'));var interaction=require(_0x474d('0x7'));var config=require('../../config/environment');var controller=require(_0x474d('0x8'));router[_0x474d('0x9')]('/',auth[_0x474d('0xa')](),controller['index']);router[_0x474d('0x9')]('/:id',auth[_0x474d('0xa')](),controller[_0x474d('0xb')]);router['get'](_0x474d('0xc'),auth[_0x474d('0xa')](),controller['getFields']);router[_0x474d('0x9')](_0x474d('0xd'),auth[_0x474d('0xa')](),controller['getSubjects']);router[_0x474d('0x9')](_0x474d('0xe'),auth[_0x474d('0xa')](),controller['getDescriptions']);router[_0x474d('0xf')]('/',auth[_0x474d('0xa')](),controller[_0x474d('0x10')]);router['put']('/:id',auth[_0x474d('0xa')](),controller[_0x474d('0x11')]);router[_0x474d('0x12')](_0x474d('0x13'),auth[_0x474d('0xa')](),controller[_0x474d('0x14')]);module[_0x474d('0x15')]=router; \ No newline at end of file +var _0x30a4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x30a4,0xd2));var _0x430a=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x30a4[_0x178856];return _0x3c7fe7;};'use strict';var multer=require(_0x430a('0x0'));var util=require(_0x430a('0x1'));var path=require(_0x430a('0x2'));var timeout=require(_0x430a('0x3'));var express=require(_0x430a('0x4'));var router=express[_0x430a('0x5')]();var fs_extra=require(_0x430a('0x6'));var auth=require(_0x430a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x430a('0x8'));router[_0x430a('0x9')]('/',auth['isAuthenticated'](),controller[_0x430a('0xa')]);router[_0x430a('0x9')]('/:id',auth[_0x430a('0xb')](),controller[_0x430a('0xc')]);router[_0x430a('0x9')](_0x430a('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x430a('0xe'),auth[_0x430a('0xb')](),controller[_0x430a('0xf')]);router[_0x430a('0x9')](_0x430a('0x10'),auth[_0x430a('0xb')](),controller[_0x430a('0x11')]);router[_0x430a('0x12')]('/',auth[_0x430a('0xb')](),controller['create']);router[_0x430a('0x13')]('/:id',auth[_0x430a('0xb')](),controller['update']);router[_0x430a('0x14')]('/:id',auth[_0x430a('0xb')](),controller[_0x430a('0x15')]);module[_0x430a('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 5e37bac..b566e94 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 _0x157a=['exports','STRING'];(function(_0x117c47,_0x4b9fdb){var _0xc7ee7e=function(_0x183bfb){while(--_0x183bfb){_0x117c47['push'](_0x117c47['shift']());}};_0xc7ee7e(++_0x4b9fdb);}(_0x157a,0x1c4));var _0xa157=function(_0x15cc52,_0x167dca){_0x15cc52=_0x15cc52-0x0;var _0x47224b=_0x157a[_0x15cc52];return _0x47224b;};'use strict';var Sequelize=require('sequelize');module[_0xa157('0x0')]={'name':{'type':Sequelize[_0xa157('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1ad=['sequelize','STRING'];(function(_0x5697c,_0x73501d){var _0x4eb5d5=function(_0x10abb8){while(--_0x10abb8){_0x5697c['push'](_0x5697c['shift']());}};_0x4eb5d5(++_0x73501d);}(_0xd1ad,0x166));var _0xdd1a=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xd1ad[_0x5447aa];return _0xb21e53;};'use strict';var Sequelize=require(_0xdd1a('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd1a('0x1')]},'description':{'type':Sequelize[_0xdd1a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 49d51db..ba88fcf 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 _0xfff2=['params','keys','find','create','body','ServicenowField','sort','getFields','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','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','end','status','offset','undefined','count','Content-Range','json','reject','update','destroy','then','sendStatus','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0xfff2,0x1f1));var _0x2fff=function(_0x252cc9,_0xbcab3d){_0x252cc9=_0x252cc9-0x0;var _0x85a4f4=_0xfff2[_0x252cc9];return _0x85a4f4;};'use strict';var emlformat=require(_0x2fff('0x0'));var rimraf=require(_0x2fff('0x1'));var zipdir=require(_0x2fff('0x2'));var jsonpatch=require(_0x2fff('0x3'));var rp=require(_0x2fff('0x4'));var moment=require(_0x2fff('0x5'));var BPromise=require(_0x2fff('0x6'));var Mustache=require(_0x2fff('0x7'));var util=require(_0x2fff('0x8'));var path=require('path');var sox=require(_0x2fff('0x9'));var csv=require(_0x2fff('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fff('0xb'));var _=require(_0x2fff('0xc'));var squel=require(_0x2fff('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2fff('0xe'));var toCsv=require(_0x2fff('0xa'));var querystring=require(_0x2fff('0xf'));var Papa=require(_0x2fff('0x10'));var Redis=require(_0x2fff('0x11'));var authService=require(_0x2fff('0x12'));var qs=require(_0x2fff('0x13'));var as=require(_0x2fff('0x14'));var hardwareService=require(_0x2fff('0x15'));var logger=require('../../config/logger')(_0x2fff('0x16'));var utils=require(_0x2fff('0x17'));var config=require(_0x2fff('0x18'));var licenseUtil=require(_0x2fff('0x19'));var db=require(_0x2fff('0x1a'))['db'];function respondWithStatusCode(_0x5b9b4c,_0x54b361){_0x54b361=_0x54b361||0xcc;return function(_0x5a74e3){if(_0x5a74e3){return _0x5b9b4c['sendStatus'](_0x54b361);}return _0x5b9b4c['status'](_0x54b361)[_0x2fff('0x1b')]();};}function respondWithResult(_0x19834a,_0x3d2775){_0x3d2775=_0x3d2775||0xc8;return function(_0x1477f4){if(_0x1477f4){return _0x19834a[_0x2fff('0x1c')](_0x3d2775)['json'](_0x1477f4);}};}function respondWithFilteredResult(_0x58fdbe,_0x5a9903){return function(_0x143b53){if(_0x143b53){var _0x5a56a1=typeof _0x5a9903[_0x2fff('0x1d')]===_0x2fff('0x1e')&&typeof _0x5a9903['limit']==='undefined';var _0x591713=_0x143b53[_0x2fff('0x1f')];var _0x4b31f2=_0x5a56a1?0x0:_0x5a9903['offset'];var _0x1ce7a3=_0x5a56a1?_0x143b53['count']:_0x5a9903[_0x2fff('0x1d')]+_0x5a9903['limit'];var _0x17b56e;if(_0x1ce7a3>=_0x591713){_0x1ce7a3=_0x591713;_0x17b56e=0xc8;}else{_0x17b56e=0xce;}_0x58fdbe['status'](_0x17b56e);return _0x58fdbe['set'](_0x2fff('0x20'),_0x4b31f2+'-'+_0x1ce7a3+'/'+_0x591713)[_0x2fff('0x21')](_0x143b53);}return null;};}function patchUpdates(_0x58100a){return function(_0x20429){try{jsonpatch['apply'](_0x20429,_0x58100a,!![]);}catch(_0x548a2){return BPromise[_0x2fff('0x22')](_0x548a2);}return _0x20429['save']();};}function saveUpdates(_0x31ec3f,_0x249c2b){return function(_0x1b9fde){if(_0x1b9fde){return _0x1b9fde[_0x2fff('0x23')](_0x31ec3f)['then'](function(_0x1bac6a){return _0x1bac6a;});}return null;};}function removeEntity(_0x3aa2e2,_0x4faf1e){return function(_0x4dddc0){if(_0x4dddc0){return _0x4dddc0[_0x2fff('0x24')]()[_0x2fff('0x25')](function(){_0x3aa2e2[_0x2fff('0x1c')](0xcc)[_0x2fff('0x1b')]();});}};}function handleEntityNotFound(_0x369726,_0x2d8231){return function(_0x30eaa3){if(!_0x30eaa3){_0x369726[_0x2fff('0x26')](0x194);}return _0x30eaa3;};}function handleError(_0x12b2d5,_0x3b3d17){_0x3b3d17=_0x3b3d17||0x1f4;return function(_0x361181){logger[_0x2fff('0x27')](_0x361181[_0x2fff('0x28')]);if(_0x361181[_0x2fff('0x29')]){delete _0x361181[_0x2fff('0x29')];}_0x12b2d5['status'](_0x3b3d17)['send'](_0x361181);};}exports[_0x2fff('0x2a')]=function(_0x448537,_0x1fe86b){var _0x4a4b67={},_0x46b429={},_0x53401c={'count':0x0,'rows':[]};var _0x2e8465=_[_0x2fff('0x2b')](db[_0x2fff('0x2c')][_0x2fff('0x2d')],function(_0x4377dd){return{'name':_0x4377dd[_0x2fff('0x2e')],'type':_0x4377dd[_0x2fff('0x2f')][_0x2fff('0x30')]};});_0x46b429[_0x2fff('0x31')]=_[_0x2fff('0x2b')](_0x2e8465,_0x2fff('0x29'));_0x46b429['query']=_['keys'](_0x448537['query']);_0x46b429[_0x2fff('0x32')]=_[_0x2fff('0x33')](_0x46b429[_0x2fff('0x31')],_0x46b429['query']);_0x4a4b67[_0x2fff('0x34')]=_[_0x2fff('0x33')](_0x46b429[_0x2fff('0x31')],qs[_0x2fff('0x35')](_0x448537[_0x2fff('0x36')][_0x2fff('0x35')]));_0x4a4b67[_0x2fff('0x34')]=_0x4a4b67[_0x2fff('0x34')][_0x2fff('0x37')]?_0x4a4b67[_0x2fff('0x34')]:_0x46b429[_0x2fff('0x31')];if(!_0x448537[_0x2fff('0x36')][_0x2fff('0x38')](_0x2fff('0x39'))){_0x4a4b67[_0x2fff('0x3a')]=qs['limit'](_0x448537[_0x2fff('0x36')]['limit']);_0x4a4b67[_0x2fff('0x1d')]=qs[_0x2fff('0x1d')](_0x448537[_0x2fff('0x36')][_0x2fff('0x1d')]);}_0x4a4b67[_0x2fff('0x3b')]=qs['sort'](_0x448537['query']['sort']);_0x4a4b67[_0x2fff('0x3c')]=qs[_0x2fff('0x32')](_[_0x2fff('0x3d')](_0x448537[_0x2fff('0x36')],_0x46b429[_0x2fff('0x32')]),_0x2e8465);if(_0x448537['query'][_0x2fff('0x3e')]){_0x4a4b67[_0x2fff('0x3c')]=_[_0x2fff('0x3f')](_0x4a4b67[_0x2fff('0x3c')],{'$or':_[_0x2fff('0x2b')](_0x2e8465,function(_0x21d332){if(_0x21d332[_0x2fff('0x2f')]!==_0x2fff('0x40')){var _0x150f9c={};_0x150f9c[_0x21d332[_0x2fff('0x29')]]={'$like':'%'+_0x448537['query']['filter']+'%'};return _0x150f9c;}})});}_0x4a4b67=_[_0x2fff('0x3f')]({},_0x4a4b67,_0x448537[_0x2fff('0x41')]);var _0x321751={'where':_0x4a4b67[_0x2fff('0x3c')]};return db[_0x2fff('0x2c')][_0x2fff('0x1f')](_0x321751)[_0x2fff('0x25')](function(_0x20227a){_0x53401c[_0x2fff('0x1f')]=_0x20227a;if(_0x448537[_0x2fff('0x36')][_0x2fff('0x42')]){_0x4a4b67[_0x2fff('0x43')]=[{'all':!![]}];}return db[_0x2fff('0x2c')]['findAll'](_0x4a4b67);})[_0x2fff('0x25')](function(_0x927525){_0x53401c['rows']=_0x927525;return _0x53401c;})['then'](respondWithFilteredResult(_0x1fe86b,_0x4a4b67))[_0x2fff('0x44')](handleError(_0x1fe86b,null));};exports[_0x2fff('0x45')]=function(_0x5b8ca1,_0x1c8f66){var _0x252770={'raw':![],'where':{'id':_0x5b8ca1[_0x2fff('0x46')]['id']}},_0x14fae6={};_0x14fae6[_0x2fff('0x31')]=_[_0x2fff('0x47')](db[_0x2fff('0x2c')]['rawAttributes']);_0x14fae6[_0x2fff('0x36')]=_['keys'](_0x5b8ca1['query']);_0x14fae6['filters']=_[_0x2fff('0x33')](_0x14fae6[_0x2fff('0x31')],_0x14fae6[_0x2fff('0x36')]);_0x252770[_0x2fff('0x34')]=_['intersection'](_0x14fae6['model'],qs[_0x2fff('0x35')](_0x5b8ca1['query'][_0x2fff('0x35')]));_0x252770['attributes']=_0x252770['attributes'][_0x2fff('0x37')]?_0x252770['attributes']:_0x14fae6[_0x2fff('0x31')];if(_0x5b8ca1['query'][_0x2fff('0x42')]){_0x252770[_0x2fff('0x43')]=[{'all':!![]}];}_0x252770=_[_0x2fff('0x3f')]({},_0x252770,_0x5b8ca1[_0x2fff('0x41')]);return db[_0x2fff('0x2c')][_0x2fff('0x48')](_0x252770)['then'](handleEntityNotFound(_0x1c8f66,null))['then'](respondWithResult(_0x1c8f66,null))[_0x2fff('0x44')](handleError(_0x1c8f66,null));};exports[_0x2fff('0x49')]=function(_0x3adc8e,_0x2181b6){return db[_0x2fff('0x2c')][_0x2fff('0x49')](_0x3adc8e[_0x2fff('0x4a')],{})[_0x2fff('0x25')](respondWithResult(_0x2181b6,0xc9))['catch'](handleError(_0x2181b6,null));};exports['update']=function(_0x4b5a86,_0x4caf13){if(_0x4b5a86[_0x2fff('0x4a')]['id']){delete _0x4b5a86[_0x2fff('0x4a')]['id'];}return db[_0x2fff('0x2c')][_0x2fff('0x48')]({'where':{'id':_0x4b5a86[_0x2fff('0x46')]['id']}})['then'](handleEntityNotFound(_0x4caf13,null))[_0x2fff('0x25')](saveUpdates(_0x4b5a86[_0x2fff('0x4a')],null))['then'](respondWithResult(_0x4caf13,null))['catch'](handleError(_0x4caf13,null));};exports[_0x2fff('0x24')]=function(_0x4d2ff5,_0x2003b1){return db['ServicenowConfiguration']['find']({'where':{'id':_0x4d2ff5[_0x2fff('0x46')]['id']}})['then'](handleEntityNotFound(_0x2003b1,null))[_0x2fff('0x25')](removeEntity(_0x2003b1,null))[_0x2fff('0x44')](handleError(_0x2003b1,null));};exports['getFields']=function(_0x5ede0c,_0x52b389,_0x2f978a){var _0x391ffe={};var _0x4b6456={};var _0x55a9ed;var _0xe809df;return db[_0x2fff('0x2c')]['findOne']({'where':{'id':_0x5ede0c[_0x2fff('0x46')]['id']}})[_0x2fff('0x25')](handleEntityNotFound(_0x52b389,null))['then'](function(_0x1c331f){if(_0x1c331f){_0x55a9ed=_0x1c331f;_0x4b6456[_0x2fff('0x31')]=_[_0x2fff('0x47')](db[_0x2fff('0x4b')][_0x2fff('0x2d')]);_0x4b6456['query']=_[_0x2fff('0x47')](_0x5ede0c['query']);_0x4b6456['filters']=_[_0x2fff('0x33')](_0x4b6456[_0x2fff('0x31')],_0x4b6456[_0x2fff('0x36')]);_0x391ffe[_0x2fff('0x34')]=_[_0x2fff('0x33')](_0x4b6456['model'],qs['fields'](_0x5ede0c['query'][_0x2fff('0x35')]));_0x391ffe[_0x2fff('0x34')]=_0x391ffe['attributes']['length']?_0x391ffe[_0x2fff('0x34')]:_0x4b6456['model'];_0x391ffe[_0x2fff('0x3b')]=qs[_0x2fff('0x4c')](_0x5ede0c[_0x2fff('0x36')][_0x2fff('0x4c')]);_0x391ffe[_0x2fff('0x3c')]=qs[_0x2fff('0x32')](_['pick'](_0x5ede0c['query'],_0x4b6456[_0x2fff('0x32')]));if(_0x5ede0c['query'][_0x2fff('0x3e')]){_0x391ffe[_0x2fff('0x3c')]=_['merge'](_0x391ffe[_0x2fff('0x3c')],{'$or':_[_0x2fff('0x2b')](_0x391ffe['attributes'],function(_0x5eec1f){var _0x591765={};_0x591765[_0x5eec1f]={'$like':'%'+_0x5ede0c[_0x2fff('0x36')]['filter']+'%'};return _0x591765;})});}_0x391ffe=_['merge']({},_0x391ffe,_0x5ede0c[_0x2fff('0x41')]);return _0x55a9ed[_0x2fff('0x4d')](_0x391ffe);}})[_0x2fff('0x25')](function(_0x2e405e){if(_0x2e405e){_0xe809df=_0x2e405e[_0x2fff('0x37')];if(!_0x5ede0c[_0x2fff('0x36')][_0x2fff('0x38')](_0x2fff('0x39'))){_0x391ffe['limit']=qs['limit'](_0x5ede0c[_0x2fff('0x36')][_0x2fff('0x3a')]);_0x391ffe['offset']=qs[_0x2fff('0x1d')](_0x5ede0c[_0x2fff('0x36')]['offset']);}return _0x55a9ed[_0x2fff('0x4d')](_0x391ffe);}})['then'](function(_0xb415f){if(_0xb415f){return _0xb415f?{'count':_0xe809df,'rows':_0xb415f}:null;}})[_0x2fff('0x25')](respondWithResult(_0x52b389,null))[_0x2fff('0x44')](handleError(_0x52b389,null));};exports[_0x2fff('0x4e')]=function(_0x5c52c2,_0x2e1fea,_0x2cd8ba){var _0xc60c44={};var _0x280e96={};var _0x4dc4ae;var _0x35583d;return db[_0x2fff('0x2c')]['findOne']({'where':{'id':_0x5c52c2[_0x2fff('0x46')]['id']}})[_0x2fff('0x25')](handleEntityNotFound(_0x2e1fea,null))[_0x2fff('0x25')](function(_0x3b6cf1){if(_0x3b6cf1){_0x4dc4ae=_0x3b6cf1;_0x280e96['model']=_[_0x2fff('0x47')](db[_0x2fff('0x4b')][_0x2fff('0x2d')]);_0x280e96[_0x2fff('0x36')]=_[_0x2fff('0x47')](_0x5c52c2['query']);_0x280e96['filters']=_['intersection'](_0x280e96['model'],_0x280e96[_0x2fff('0x36')]);_0xc60c44[_0x2fff('0x34')]=_[_0x2fff('0x33')](_0x280e96[_0x2fff('0x31')],qs[_0x2fff('0x35')](_0x5c52c2[_0x2fff('0x36')][_0x2fff('0x35')]));_0xc60c44[_0x2fff('0x34')]=_0xc60c44[_0x2fff('0x34')][_0x2fff('0x37')]?_0xc60c44[_0x2fff('0x34')]:_0x280e96[_0x2fff('0x31')];_0xc60c44[_0x2fff('0x3b')]=qs['sort'](_0x5c52c2[_0x2fff('0x36')][_0x2fff('0x4c')]);_0xc60c44[_0x2fff('0x3c')]=qs['filters'](_[_0x2fff('0x3d')](_0x5c52c2[_0x2fff('0x36')],_0x280e96[_0x2fff('0x32')]));if(_0x5c52c2[_0x2fff('0x36')]['filter']){_0xc60c44[_0x2fff('0x3c')]=_['merge'](_0xc60c44[_0x2fff('0x3c')],{'$or':_['map'](_0xc60c44[_0x2fff('0x34')],function(_0x5c0921){var _0xadabe0={};_0xadabe0[_0x5c0921]={'$like':'%'+_0x5c52c2['query'][_0x2fff('0x3e')]+'%'};return _0xadabe0;})});}_0xc60c44=_[_0x2fff('0x3f')]({},_0xc60c44,_0x5c52c2[_0x2fff('0x41')]);return _0x4dc4ae['getSubjects'](_0xc60c44);}})[_0x2fff('0x25')](function(_0x4d3455){if(_0x4d3455){_0x35583d=_0x4d3455[_0x2fff('0x37')];if(!_0x5c52c2[_0x2fff('0x36')][_0x2fff('0x38')](_0x2fff('0x39'))){_0xc60c44[_0x2fff('0x3a')]=qs[_0x2fff('0x3a')](_0x5c52c2[_0x2fff('0x36')]['limit']);_0xc60c44[_0x2fff('0x1d')]=qs[_0x2fff('0x1d')](_0x5c52c2[_0x2fff('0x36')][_0x2fff('0x1d')]);}return _0x4dc4ae['getSubjects'](_0xc60c44);}})[_0x2fff('0x25')](function(_0x57e9bd){if(_0x57e9bd){return _0x57e9bd?{'count':_0x35583d,'rows':_0x57e9bd}:null;}})[_0x2fff('0x25')](respondWithResult(_0x2e1fea,null))[_0x2fff('0x44')](handleError(_0x2e1fea,null));};exports[_0x2fff('0x4f')]=function(_0x5ad1f4,_0xda20b1,_0x494166){var _0x23310e={};var _0x49c8be={};var _0x250475;var _0x2bc5c8;return db[_0x2fff('0x2c')][_0x2fff('0x50')]({'where':{'id':_0x5ad1f4['params']['id']}})[_0x2fff('0x25')](handleEntityNotFound(_0xda20b1,null))[_0x2fff('0x25')](function(_0x21bc65){if(_0x21bc65){_0x250475=_0x21bc65;_0x49c8be[_0x2fff('0x31')]=_[_0x2fff('0x47')](db['ServicenowField'][_0x2fff('0x2d')]);_0x49c8be[_0x2fff('0x36')]=_[_0x2fff('0x47')](_0x5ad1f4[_0x2fff('0x36')]);_0x49c8be['filters']=_[_0x2fff('0x33')](_0x49c8be[_0x2fff('0x31')],_0x49c8be[_0x2fff('0x36')]);_0x23310e[_0x2fff('0x34')]=_[_0x2fff('0x33')](_0x49c8be[_0x2fff('0x31')],qs[_0x2fff('0x35')](_0x5ad1f4[_0x2fff('0x36')][_0x2fff('0x35')]));_0x23310e[_0x2fff('0x34')]=_0x23310e['attributes'][_0x2fff('0x37')]?_0x23310e[_0x2fff('0x34')]:_0x49c8be[_0x2fff('0x31')];_0x23310e['order']=qs[_0x2fff('0x4c')](_0x5ad1f4['query'][_0x2fff('0x4c')]);_0x23310e[_0x2fff('0x3c')]=qs['filters'](_['pick'](_0x5ad1f4[_0x2fff('0x36')],_0x49c8be[_0x2fff('0x32')]));if(_0x5ad1f4[_0x2fff('0x36')]['filter']){_0x23310e['where']=_[_0x2fff('0x3f')](_0x23310e[_0x2fff('0x3c')],{'$or':_[_0x2fff('0x2b')](_0x23310e['attributes'],function(_0x54f3c5){var _0x6e2f94={};_0x6e2f94[_0x54f3c5]={'$like':'%'+_0x5ad1f4['query'][_0x2fff('0x3e')]+'%'};return _0x6e2f94;})});}_0x23310e=_[_0x2fff('0x3f')]({},_0x23310e,_0x5ad1f4['options']);return _0x250475[_0x2fff('0x4f')](_0x23310e);}})[_0x2fff('0x25')](function(_0x34e36a){if(_0x34e36a){_0x2bc5c8=_0x34e36a[_0x2fff('0x37')];if(!_0x5ad1f4[_0x2fff('0x36')][_0x2fff('0x38')]('nolimit')){_0x23310e[_0x2fff('0x3a')]=qs[_0x2fff('0x3a')](_0x5ad1f4['query'][_0x2fff('0x3a')]);_0x23310e[_0x2fff('0x1d')]=qs['offset'](_0x5ad1f4[_0x2fff('0x36')][_0x2fff('0x1d')]);}return _0x250475['getDescriptions'](_0x23310e);}})[_0x2fff('0x25')](function(_0x59b30a){if(_0x59b30a){return _0x59b30a?{'count':_0x2bc5c8,'rows':_0x59b30a}:null;}})['then'](respondWithResult(_0xda20b1,null))[_0x2fff('0x44')](handleError(_0xda20b1,null));}; \ No newline at end of file +var _0xe610=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','params','include','create','body','find','destroy','getFields','findOne','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ServicenowConfiguration','type','query','keys','filters','model','attributes'];(function(_0x55433c,_0x16130d){var _0x1957ad=function(_0x271e0b){while(--_0x271e0b){_0x55433c['push'](_0x55433c['shift']());}};_0x1957ad(++_0x16130d);}(_0xe610,0x153));var _0x0e61=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe610[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x0e61('0x0'));var rimraf=require(_0x0e61('0x1'));var zipdir=require(_0x0e61('0x2'));var jsonpatch=require(_0x0e61('0x3'));var rp=require('request-promise');var moment=require(_0x0e61('0x4'));var BPromise=require(_0x0e61('0x5'));var Mustache=require(_0x0e61('0x6'));var util=require(_0x0e61('0x7'));var path=require(_0x0e61('0x8'));var sox=require(_0x0e61('0x9'));var csv=require('to-csv');var ejs=require(_0x0e61('0xa'));var fs=require('fs');var fs_extra=require(_0x0e61('0xb'));var _=require(_0x0e61('0xc'));var squel=require(_0x0e61('0xd'));var crypto=require('crypto');var jsforce=require(_0x0e61('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e61('0xf'));var querystring=require(_0x0e61('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e61('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0e61('0x12'));var hardwareService=require(_0x0e61('0x13'));var logger=require(_0x0e61('0x14'))(_0x0e61('0x15'));var utils=require('../../config/utils');var config=require(_0x0e61('0x16'));var licenseUtil=require(_0x0e61('0x17'));var db=require(_0x0e61('0x18'))['db'];function respondWithStatusCode(_0x3dd1a8,_0x47e5a5){_0x47e5a5=_0x47e5a5||0xcc;return function(_0x580ef5){if(_0x580ef5){return _0x3dd1a8[_0x0e61('0x19')](_0x47e5a5);}return _0x3dd1a8[_0x0e61('0x1a')](_0x47e5a5)['end']();};}function respondWithResult(_0x17ea0b,_0x40d682){_0x40d682=_0x40d682||0xc8;return function(_0x40d27d){if(_0x40d27d){return _0x17ea0b['status'](_0x40d682)[_0x0e61('0x1b')](_0x40d27d);}};}function respondWithFilteredResult(_0x1a3cb8,_0x396433){return function(_0x2006c2){if(_0x2006c2){var _0x541e7f=typeof _0x396433[_0x0e61('0x1c')]===_0x0e61('0x1d')&&typeof _0x396433[_0x0e61('0x1e')]==='undefined';var _0x100756=_0x2006c2[_0x0e61('0x1f')];var _0x33cc52=_0x541e7f?0x0:_0x396433[_0x0e61('0x1c')];var _0x2e24ac=_0x541e7f?_0x2006c2[_0x0e61('0x1f')]:_0x396433[_0x0e61('0x1c')]+_0x396433[_0x0e61('0x1e')];var _0x23122f;if(_0x2e24ac>=_0x100756){_0x2e24ac=_0x100756;_0x23122f=0xc8;}else{_0x23122f=0xce;}_0x1a3cb8[_0x0e61('0x1a')](_0x23122f);return _0x1a3cb8[_0x0e61('0x20')](_0x0e61('0x21'),_0x33cc52+'-'+_0x2e24ac+'/'+_0x100756)[_0x0e61('0x1b')](_0x2006c2);}return null;};}function patchUpdates(_0x40949e){return function(_0x474906){try{jsonpatch[_0x0e61('0x22')](_0x474906,_0x40949e,!![]);}catch(_0x169db8){return BPromise[_0x0e61('0x23')](_0x169db8);}return _0x474906['save']();};}function saveUpdates(_0x4498e2,_0x307675){return function(_0x3651b0){if(_0x3651b0){return _0x3651b0[_0x0e61('0x24')](_0x4498e2)[_0x0e61('0x25')](function(_0x471996){return _0x471996;});}return null;};}function removeEntity(_0x352bc4,_0x426620){return function(_0x4a695f){if(_0x4a695f){return _0x4a695f['destroy']()[_0x0e61('0x25')](function(){_0x352bc4[_0x0e61('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306ba5,_0x34d905){return function(_0x71d38a){if(!_0x71d38a){_0x306ba5[_0x0e61('0x19')](0x194);}return _0x71d38a;};}function handleError(_0x49d7f2,_0xfd849e){_0xfd849e=_0xfd849e||0x1f4;return function(_0x40f689){logger[_0x0e61('0x26')](_0x40f689[_0x0e61('0x27')]);if(_0x40f689[_0x0e61('0x28')]){delete _0x40f689[_0x0e61('0x28')];}_0x49d7f2[_0x0e61('0x1a')](_0xfd849e)[_0x0e61('0x29')](_0x40f689);};}exports[_0x0e61('0x2a')]=function(_0x4e915c,_0x154fca){var _0x5a57a0={},_0x26f11a={},_0x369b6a={'count':0x0,'rows':[]};var _0x423d61=_[_0x0e61('0x2b')](db[_0x0e61('0x2c')]['rawAttributes'],function(_0x547017){return{'name':_0x547017['fieldName'],'type':_0x547017[_0x0e61('0x2d')]['key']};});_0x26f11a['model']=_['map'](_0x423d61,'name');_0x26f11a[_0x0e61('0x2e')]=_[_0x0e61('0x2f')](_0x4e915c[_0x0e61('0x2e')]);_0x26f11a[_0x0e61('0x30')]=_['intersection'](_0x26f11a[_0x0e61('0x31')],_0x26f11a['query']);_0x5a57a0[_0x0e61('0x32')]=_[_0x0e61('0x33')](_0x26f11a[_0x0e61('0x31')],qs['fields'](_0x4e915c['query'][_0x0e61('0x34')]));_0x5a57a0[_0x0e61('0x32')]=_0x5a57a0['attributes'][_0x0e61('0x35')]?_0x5a57a0[_0x0e61('0x32')]:_0x26f11a[_0x0e61('0x31')];if(!_0x4e915c['query'][_0x0e61('0x36')](_0x0e61('0x37'))){_0x5a57a0['limit']=qs['limit'](_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x1e')]);_0x5a57a0[_0x0e61('0x1c')]=qs[_0x0e61('0x1c')](_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x1c')]);}_0x5a57a0[_0x0e61('0x38')]=qs['sort'](_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x39')]);_0x5a57a0['where']=qs['filters'](_[_0x0e61('0x3a')](_0x4e915c[_0x0e61('0x2e')],_0x26f11a['filters']),_0x423d61);if(_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x3b')]){_0x5a57a0[_0x0e61('0x3c')]=_['merge'](_0x5a57a0['where'],{'$or':_[_0x0e61('0x2b')](_0x423d61,function(_0x34c0e8){if(_0x34c0e8[_0x0e61('0x2d')]!==_0x0e61('0x3d')){var _0x8673f8={};_0x8673f8[_0x34c0e8[_0x0e61('0x28')]]={'$like':'%'+_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x3b')]+'%'};return _0x8673f8;}})});}_0x5a57a0=_[_0x0e61('0x3e')]({},_0x5a57a0,_0x4e915c[_0x0e61('0x3f')]);var _0x18f29d={'where':_0x5a57a0['where']};return db['ServicenowConfiguration'][_0x0e61('0x1f')](_0x18f29d)[_0x0e61('0x25')](function(_0x51e7d6){_0x369b6a[_0x0e61('0x1f')]=_0x51e7d6;if(_0x4e915c[_0x0e61('0x2e')][_0x0e61('0x40')]){_0x5a57a0['include']=[{'all':!![]}];}return db[_0x0e61('0x2c')]['findAll'](_0x5a57a0);})[_0x0e61('0x25')](function(_0x40b1f1){_0x369b6a[_0x0e61('0x41')]=_0x40b1f1;return _0x369b6a;})['then'](respondWithFilteredResult(_0x154fca,_0x5a57a0))[_0x0e61('0x42')](handleError(_0x154fca,null));};exports['show']=function(_0x55e6a5,_0x409843){var _0x5752e5={'raw':![],'where':{'id':_0x55e6a5[_0x0e61('0x43')]['id']}},_0x93ac33={};_0x93ac33[_0x0e61('0x31')]=_[_0x0e61('0x2f')](db[_0x0e61('0x2c')]['rawAttributes']);_0x93ac33[_0x0e61('0x2e')]=_['keys'](_0x55e6a5['query']);_0x93ac33[_0x0e61('0x30')]=_['intersection'](_0x93ac33[_0x0e61('0x31')],_0x93ac33['query']);_0x5752e5['attributes']=_['intersection'](_0x93ac33[_0x0e61('0x31')],qs[_0x0e61('0x34')](_0x55e6a5[_0x0e61('0x2e')][_0x0e61('0x34')]));_0x5752e5[_0x0e61('0x32')]=_0x5752e5[_0x0e61('0x32')]['length']?_0x5752e5[_0x0e61('0x32')]:_0x93ac33[_0x0e61('0x31')];if(_0x55e6a5[_0x0e61('0x2e')]['includeAll']){_0x5752e5[_0x0e61('0x44')]=[{'all':!![]}];}_0x5752e5=_['merge']({},_0x5752e5,_0x55e6a5[_0x0e61('0x3f')]);return db[_0x0e61('0x2c')]['find'](_0x5752e5)['then'](handleEntityNotFound(_0x409843,null))[_0x0e61('0x25')](respondWithResult(_0x409843,null))['catch'](handleError(_0x409843,null));};exports[_0x0e61('0x45')]=function(_0x5648c7,_0x26a14d){return db[_0x0e61('0x2c')]['create'](_0x5648c7[_0x0e61('0x46')],{})[_0x0e61('0x25')](respondWithResult(_0x26a14d,0xc9))['catch'](handleError(_0x26a14d,null));};exports[_0x0e61('0x24')]=function(_0x1383c7,_0x38ba51){if(_0x1383c7[_0x0e61('0x46')]['id']){delete _0x1383c7[_0x0e61('0x46')]['id'];}return db[_0x0e61('0x2c')][_0x0e61('0x47')]({'where':{'id':_0x1383c7[_0x0e61('0x43')]['id']}})[_0x0e61('0x25')](handleEntityNotFound(_0x38ba51,null))[_0x0e61('0x25')](saveUpdates(_0x1383c7[_0x0e61('0x46')],null))[_0x0e61('0x25')](respondWithResult(_0x38ba51,null))['catch'](handleError(_0x38ba51,null));};exports[_0x0e61('0x48')]=function(_0x2db351,_0xdaa3e0){return db[_0x0e61('0x2c')]['find']({'where':{'id':_0x2db351[_0x0e61('0x43')]['id']}})[_0x0e61('0x25')](handleEntityNotFound(_0xdaa3e0,null))[_0x0e61('0x25')](removeEntity(_0xdaa3e0,null))[_0x0e61('0x42')](handleError(_0xdaa3e0,null));};exports[_0x0e61('0x49')]=function(_0x3200f5,_0x4dfc7b,_0xb9bff){var _0x28f62d={};var _0x3e79c9={};var _0x170694;var _0x430df4;return db[_0x0e61('0x2c')][_0x0e61('0x4a')]({'where':{'id':_0x3200f5[_0x0e61('0x43')]['id']}})['then'](handleEntityNotFound(_0x4dfc7b,null))[_0x0e61('0x25')](function(_0x692afc){if(_0x692afc){_0x170694=_0x692afc;_0x3e79c9[_0x0e61('0x31')]=_[_0x0e61('0x2f')](db['ServicenowField'][_0x0e61('0x4b')]);_0x3e79c9[_0x0e61('0x2e')]=_[_0x0e61('0x2f')](_0x3200f5[_0x0e61('0x2e')]);_0x3e79c9[_0x0e61('0x30')]=_['intersection'](_0x3e79c9[_0x0e61('0x31')],_0x3e79c9[_0x0e61('0x2e')]);_0x28f62d[_0x0e61('0x32')]=_['intersection'](_0x3e79c9[_0x0e61('0x31')],qs[_0x0e61('0x34')](_0x3200f5[_0x0e61('0x2e')]['fields']));_0x28f62d[_0x0e61('0x32')]=_0x28f62d[_0x0e61('0x32')][_0x0e61('0x35')]?_0x28f62d['attributes']:_0x3e79c9[_0x0e61('0x31')];_0x28f62d[_0x0e61('0x38')]=qs[_0x0e61('0x39')](_0x3200f5[_0x0e61('0x2e')][_0x0e61('0x39')]);_0x28f62d['where']=qs[_0x0e61('0x30')](_['pick'](_0x3200f5[_0x0e61('0x2e')],_0x3e79c9[_0x0e61('0x30')]));if(_0x3200f5[_0x0e61('0x2e')][_0x0e61('0x3b')]){_0x28f62d['where']=_[_0x0e61('0x3e')](_0x28f62d['where'],{'$or':_[_0x0e61('0x2b')](_0x28f62d['attributes'],function(_0x1c650c){var _0x3b91ca={};_0x3b91ca[_0x1c650c]={'$like':'%'+_0x3200f5[_0x0e61('0x2e')]['filter']+'%'};return _0x3b91ca;})});}_0x28f62d=_[_0x0e61('0x3e')]({},_0x28f62d,_0x3200f5[_0x0e61('0x3f')]);return _0x170694[_0x0e61('0x49')](_0x28f62d);}})[_0x0e61('0x25')](function(_0xffd30){if(_0xffd30){_0x430df4=_0xffd30[_0x0e61('0x35')];if(!_0x3200f5[_0x0e61('0x2e')][_0x0e61('0x36')](_0x0e61('0x37'))){_0x28f62d[_0x0e61('0x1e')]=qs[_0x0e61('0x1e')](_0x3200f5[_0x0e61('0x2e')]['limit']);_0x28f62d[_0x0e61('0x1c')]=qs[_0x0e61('0x1c')](_0x3200f5['query'][_0x0e61('0x1c')]);}return _0x170694[_0x0e61('0x49')](_0x28f62d);}})['then'](function(_0x52099d){if(_0x52099d){return _0x52099d?{'count':_0x430df4,'rows':_0x52099d}:null;}})[_0x0e61('0x25')](respondWithResult(_0x4dfc7b,null))[_0x0e61('0x42')](handleError(_0x4dfc7b,null));};exports[_0x0e61('0x4c')]=function(_0x758500,_0x5d18e8,_0x2ded3a){var _0x5dbfc6={};var _0x26c3b4={};var _0x565c99;var _0x523875;return db['ServicenowConfiguration'][_0x0e61('0x4a')]({'where':{'id':_0x758500[_0x0e61('0x43')]['id']}})[_0x0e61('0x25')](handleEntityNotFound(_0x5d18e8,null))[_0x0e61('0x25')](function(_0x5356e4){if(_0x5356e4){_0x565c99=_0x5356e4;_0x26c3b4[_0x0e61('0x31')]=_[_0x0e61('0x2f')](db['ServicenowField'][_0x0e61('0x4b')]);_0x26c3b4['query']=_[_0x0e61('0x2f')](_0x758500['query']);_0x26c3b4['filters']=_['intersection'](_0x26c3b4['model'],_0x26c3b4[_0x0e61('0x2e')]);_0x5dbfc6[_0x0e61('0x32')]=_[_0x0e61('0x33')](_0x26c3b4[_0x0e61('0x31')],qs[_0x0e61('0x34')](_0x758500[_0x0e61('0x2e')][_0x0e61('0x34')]));_0x5dbfc6[_0x0e61('0x32')]=_0x5dbfc6[_0x0e61('0x32')]['length']?_0x5dbfc6[_0x0e61('0x32')]:_0x26c3b4[_0x0e61('0x31')];_0x5dbfc6[_0x0e61('0x38')]=qs['sort'](_0x758500['query'][_0x0e61('0x39')]);_0x5dbfc6['where']=qs[_0x0e61('0x30')](_[_0x0e61('0x3a')](_0x758500[_0x0e61('0x2e')],_0x26c3b4['filters']));if(_0x758500[_0x0e61('0x2e')][_0x0e61('0x3b')]){_0x5dbfc6['where']=_[_0x0e61('0x3e')](_0x5dbfc6[_0x0e61('0x3c')],{'$or':_[_0x0e61('0x2b')](_0x5dbfc6[_0x0e61('0x32')],function(_0x94f792){var _0x39fb05={};_0x39fb05[_0x94f792]={'$like':'%'+_0x758500[_0x0e61('0x2e')][_0x0e61('0x3b')]+'%'};return _0x39fb05;})});}_0x5dbfc6=_[_0x0e61('0x3e')]({},_0x5dbfc6,_0x758500[_0x0e61('0x3f')]);return _0x565c99[_0x0e61('0x4c')](_0x5dbfc6);}})[_0x0e61('0x25')](function(_0x31e13d){if(_0x31e13d){_0x523875=_0x31e13d[_0x0e61('0x35')];if(!_0x758500[_0x0e61('0x2e')][_0x0e61('0x36')](_0x0e61('0x37'))){_0x5dbfc6[_0x0e61('0x1e')]=qs[_0x0e61('0x1e')](_0x758500[_0x0e61('0x2e')][_0x0e61('0x1e')]);_0x5dbfc6[_0x0e61('0x1c')]=qs[_0x0e61('0x1c')](_0x758500[_0x0e61('0x2e')][_0x0e61('0x1c')]);}return _0x565c99[_0x0e61('0x4c')](_0x5dbfc6);}})['then'](function(_0x2976f6){if(_0x2976f6){return _0x2976f6?{'count':_0x523875,'rows':_0x2976f6}:null;}})[_0x0e61('0x25')](respondWithResult(_0x5d18e8,null))[_0x0e61('0x42')](handleError(_0x5d18e8,null));};exports[_0x0e61('0x4d')]=function(_0xcdc616,_0x161fb7,_0x43c3c4){var _0x14360a={};var _0xcd9409={};var _0x211fb5;var _0x2f2a97;return db[_0x0e61('0x2c')][_0x0e61('0x4a')]({'where':{'id':_0xcdc616['params']['id']}})[_0x0e61('0x25')](handleEntityNotFound(_0x161fb7,null))[_0x0e61('0x25')](function(_0x18d36e){if(_0x18d36e){_0x211fb5=_0x18d36e;_0xcd9409[_0x0e61('0x31')]=_['keys'](db['ServicenowField'][_0x0e61('0x4b')]);_0xcd9409[_0x0e61('0x2e')]=_['keys'](_0xcdc616[_0x0e61('0x2e')]);_0xcd9409[_0x0e61('0x30')]=_[_0x0e61('0x33')](_0xcd9409[_0x0e61('0x31')],_0xcd9409[_0x0e61('0x2e')]);_0x14360a['attributes']=_[_0x0e61('0x33')](_0xcd9409[_0x0e61('0x31')],qs[_0x0e61('0x34')](_0xcdc616[_0x0e61('0x2e')][_0x0e61('0x34')]));_0x14360a[_0x0e61('0x32')]=_0x14360a['attributes'][_0x0e61('0x35')]?_0x14360a[_0x0e61('0x32')]:_0xcd9409['model'];_0x14360a[_0x0e61('0x38')]=qs[_0x0e61('0x39')](_0xcdc616[_0x0e61('0x2e')]['sort']);_0x14360a[_0x0e61('0x3c')]=qs[_0x0e61('0x30')](_[_0x0e61('0x3a')](_0xcdc616[_0x0e61('0x2e')],_0xcd9409[_0x0e61('0x30')]));if(_0xcdc616['query'][_0x0e61('0x3b')]){_0x14360a[_0x0e61('0x3c')]=_['merge'](_0x14360a[_0x0e61('0x3c')],{'$or':_[_0x0e61('0x2b')](_0x14360a[_0x0e61('0x32')],function(_0x427b55){var _0x2a48ee={};_0x2a48ee[_0x427b55]={'$like':'%'+_0xcdc616['query'][_0x0e61('0x3b')]+'%'};return _0x2a48ee;})});}_0x14360a=_[_0x0e61('0x3e')]({},_0x14360a,_0xcdc616['options']);return _0x211fb5[_0x0e61('0x4d')](_0x14360a);}})[_0x0e61('0x25')](function(_0xba8724){if(_0xba8724){_0x2f2a97=_0xba8724[_0x0e61('0x35')];if(!_0xcdc616[_0x0e61('0x2e')]['hasOwnProperty'](_0x0e61('0x37'))){_0x14360a['limit']=qs[_0x0e61('0x1e')](_0xcdc616['query']['limit']);_0x14360a[_0x0e61('0x1c')]=qs[_0x0e61('0x1c')](_0xcdc616[_0x0e61('0x2e')][_0x0e61('0x1c')]);}return _0x211fb5[_0x0e61('0x4d')](_0x14360a);}})['then'](function(_0x351980){if(_0x351980){return _0x351980?{'count':_0x2f2a97,'rows':_0x351980}:null;}})[_0x0e61('0x25')](respondWithResult(_0x161fb7,null))[_0x0e61('0x42')](handleError(_0x161fb7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 4a8b330..2c1265c 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 _0x7e05=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','api','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e05,0x69));var _0x57e0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7e05[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x57e0('0x0'));var util=require(_0x57e0('0x1'));var logger=require('../../config/logger')(_0x57e0('0x2'));var moment=require('moment');var BPromise=require(_0x57e0('0x3'));var rp=require(_0x57e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x57e0('0x5'));var attributes=require(_0x57e0('0x6'));module[_0x57e0('0x7')]=function(_0x327596,_0x5f4f7e){return _0x327596[_0x57e0('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x57e0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5386=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations'];(function(_0x256ec3,_0x12bdab){var _0x4764bd=function(_0x463c26){while(--_0x463c26){_0x256ec3['push'](_0x256ec3['shift']());}};_0x4764bd(++_0x12bdab);}(_0x5386,0x1e1));var _0x6538=function(_0x174a2d,_0x44cf92){_0x174a2d=_0x174a2d-0x0;var _0x3a58c3=_0x5386[_0x174a2d];return _0x3a58c3;};'use strict';var _=require(_0x6538('0x0'));var util=require(_0x6538('0x1'));var logger=require(_0x6538('0x2'))(_0x6538('0x3'));var moment=require('moment');var BPromise=require(_0x6538('0x4'));var rp=require(_0x6538('0x5'));var fs=require('fs');var path=require(_0x6538('0x6'));var rimraf=require(_0x6538('0x7'));var config=require(_0x6538('0x8'));var attributes=require(_0x6538('0x9'));module[_0x6538('0xa')]=function(_0x2433c9,_0x4ed3fa){return _0x2433c9[_0x6538('0xb')]('ServicenowConfiguration',attributes,{'tableName':_0x6538('0xc'),'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 899c49d..84d18e4 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 _0xf690=['code','message','ServicenowConfiguration,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xf690,0xa6));var _0x0f69=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0xf690[_0x36b037];return _0x409194;};'use strict';var _=require('lodash');var util=require(_0x0f69('0x0'));var moment=require(_0x0f69('0x1'));var BPromise=require(_0x0f69('0x2'));var rs=require(_0x0f69('0x3'));var fs=require('fs');var Redis=require(_0x0f69('0x4'));var db=require(_0x0f69('0x5'))['db'];var utils=require(_0x0f69('0x6'));var logger=require(_0x0f69('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0f69('0x8'));var client=jayson[_0x0f69('0x9')][_0x0f69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a3e2,_0x2809c2,_0x8a6d0){return new BPromise(function(_0x54269f,_0x3c5dca){return client[_0x0f69('0xb')](_0x49a3e2,_0x8a6d0)[_0x0f69('0xc')](function(_0x491744){logger[_0x0f69('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2809c2,_0x0f69('0xe'));logger[_0x0f69('0xf')](_0x0f69('0x10'),_0x2809c2,_0x0f69('0xe'),JSON['stringify'](_0x491744));if(_0x491744[_0x0f69('0x11')]){if(_0x491744[_0x0f69('0x11')][_0x0f69('0x12')]===0x1f4){logger[_0x0f69('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2809c2,_0x491744[_0x0f69('0x11')][_0x0f69('0x13')]);return _0x3c5dca(_0x491744[_0x0f69('0x11')][_0x0f69('0x13')]);}logger[_0x0f69('0x11')](_0x0f69('0x14'),_0x2809c2,_0x491744[_0x0f69('0x11')]['message']);return _0x54269f(_0x491744['error'][_0x0f69('0x13')]);}else{logger[_0x0f69('0xd')](_0x0f69('0x14'),_0x2809c2,_0x0f69('0xe'));_0x54269f(_0x491744[_0x0f69('0x15')][_0x0f69('0x13')]);}})[_0x0f69('0x16')](function(_0x5582db){logger[_0x0f69('0x11')](_0x0f69('0x14'),_0x2809c2,_0x5582db);_0x3c5dca(_0x5582db);});});} \ No newline at end of file +var _0x9000=['request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message'];(function(_0x1a8532,_0x9df2ce){var _0x562d6f=function(_0x1fd53d){while(--_0x1fd53d){_0x1a8532['push'](_0x1a8532['shift']());}};_0x562d6f(++_0x9df2ce);}(_0x9000,0x173));var _0x0900=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0x9000[_0xf8886b];return _0x321bd5;};'use strict';var _=require(_0x0900('0x0'));var util=require(_0x0900('0x1'));var moment=require('moment');var BPromise=require(_0x0900('0x2'));var rs=require(_0x0900('0x3'));var fs=require('fs');var Redis=require(_0x0900('0x4'));var db=require(_0x0900('0x5'))['db'];var utils=require(_0x0900('0x6'));var logger=require(_0x0900('0x7'))('rpc');var config=require(_0x0900('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0900('0x9')][_0x0900('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df721,_0xa886dd,_0x2f2d4d){return new BPromise(function(_0x509cff,_0x42e0f2){return client[_0x0900('0xb')](_0x3df721,_0x2f2d4d)[_0x0900('0xc')](function(_0x2cde59){logger[_0x0900('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xa886dd,'request\x20sent');logger[_0x0900('0xe')](_0x0900('0xf'),_0xa886dd,'request\x20sent',JSON['stringify'](_0x2cde59));if(_0x2cde59[_0x0900('0x10')]){if(_0x2cde59['error'][_0x0900('0x11')]===0x1f4){logger['error'](_0x0900('0x12'),_0xa886dd,_0x2cde59['error'][_0x0900('0x13')]);return _0x42e0f2(_0x2cde59['error'][_0x0900('0x13')]);}logger[_0x0900('0x10')](_0x0900('0x12'),_0xa886dd,_0x2cde59[_0x0900('0x10')]['message']);return _0x509cff(_0x2cde59[_0x0900('0x10')][_0x0900('0x13')]);}else{logger[_0x0900('0xd')](_0x0900('0x12'),_0xa886dd,_0x0900('0x14'));_0x509cff(_0x2cde59[_0x0900('0x15')][_0x0900('0x13')]);}})[_0x0900('0x16')](function(_0x1de1ee){logger[_0x0900('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0xa886dd,_0x1de1ee);_0x42e0f2(_0x1de1ee);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0233c7f..6728700 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 _0xcd24=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1dd78b,_0x213fd9){var _0x2d9bf6=function(_0x2c749a){while(--_0x2c749a){_0x1dd78b['push'](_0x1dd78b['shift']());}};_0x2d9bf6(++_0x213fd9);}(_0xcd24,0x8c));var _0x4cd2=function(_0x4d761f,_0x1364ca){_0x4d761f=_0x4d761f-0x0;var _0x11fe7f=_0xcd24[_0x4d761f];return _0x11fe7f;};'use strict';var multer=require(_0x4cd2('0x0'));var util=require(_0x4cd2('0x1'));var path=require(_0x4cd2('0x2'));var timeout=require(_0x4cd2('0x3'));var express=require('express');var router=express[_0x4cd2('0x4')]();var fs_extra=require(_0x4cd2('0x5'));var auth=require(_0x4cd2('0x6'));var interaction=require(_0x4cd2('0x7'));var config=require('../../config/environment');var controller=require(_0x4cd2('0x8'));router[_0x4cd2('0x9')]('/',auth[_0x4cd2('0xa')](),controller[_0x4cd2('0xb')]);router[_0x4cd2('0x9')](_0x4cd2('0xc'),auth[_0x4cd2('0xa')](),controller['show']);router[_0x4cd2('0xd')]('/',auth[_0x4cd2('0xa')](),controller['create']);router['put'](_0x4cd2('0xc'),auth[_0x4cd2('0xa')](),controller[_0x4cd2('0xe')]);router[_0x4cd2('0xf')](_0x4cd2('0xc'),auth['isAuthenticated'](),controller[_0x4cd2('0x10')]);module[_0x4cd2('0x11')]=router; \ No newline at end of file +var _0xbbad=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','post'];(function(_0x26641c,_0x1ba2a5){var _0x42c01a=function(_0x15c7da){while(--_0x15c7da){_0x26641c['push'](_0x26641c['shift']());}};_0x42c01a(++_0x1ba2a5);}(_0xbbad,0x104));var _0xdbba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbad[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdbba('0x0'));var util=require(_0xdbba('0x1'));var path=require('path');var timeout=require(_0xdbba('0x2'));var express=require(_0xdbba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdbba('0x4'));var interaction=require(_0xdbba('0x5'));var config=require(_0xdbba('0x6'));var controller=require(_0xdbba('0x7'));router['get']('/',auth[_0xdbba('0x8')](),controller['index']);router[_0xdbba('0x9')](_0xdbba('0xa'),auth[_0xdbba('0x8')](),controller['show']);router[_0xdbba('0xb')]('/',auth[_0xdbba('0x8')](),controller[_0xdbba('0xc')]);router[_0xdbba('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdbba('0xe')](_0xdbba('0xa'),auth[_0xdbba('0x8')](),controller[_0xdbba('0xf')]);module[_0xdbba('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0c4fa8b..2320aa2 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 _0xd34f=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x4a569e,_0x26f401){var _0x31b4cf=function(_0x4bdcb3){while(--_0x4bdcb3){_0x4a569e['push'](_0x4a569e['shift']());}};_0x31b4cf(++_0x26f401);}(_0xd34f,0x1e3));var _0xfd34=function(_0x4cfd3f,_0x7cf913){_0x4cfd3f=_0x4cfd3f-0x0;var _0x132313=_0xd34f[_0x4cfd3f];return _0x132313;};'use strict';var Sequelize=require('sequelize');module[_0xfd34('0x0')]={'type':{'type':Sequelize[_0xfd34('0x1')](_0xfd34('0x2'),_0xfd34('0x3'),_0xfd34('0x4'),_0xfd34('0x5'),_0xfd34('0x6')),'defaultValue':_0xfd34('0x2')},'content':{'type':Sequelize[_0xfd34('0x7')]},'key':{'type':Sequelize[_0xfd34('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xfd34('0x2'),_0xfd34('0x3'),_0xfd34('0x4'))},'keyContent':{'type':Sequelize[_0xfd34('0x7')]},'idField':{'type':Sequelize[_0xfd34('0x7')]},'nameField':{'type':Sequelize[_0xfd34('0x7')]},'customField':{'type':Sequelize[_0xfd34('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfd34('0x7')]}}; \ No newline at end of file +var _0xf0dd=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','picklist'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xf0dd,0x153));var _0xdf0d=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xf0dd[_0x57fa7e];return _0x320671;};'use strict';var Sequelize=require('sequelize');module[_0xdf0d('0x0')]={'type':{'type':Sequelize[_0xdf0d('0x1')]('string',_0xdf0d('0x2'),_0xdf0d('0x3'),'keyValue',_0xdf0d('0x4')),'defaultValue':_0xdf0d('0x5')},'content':{'type':Sequelize[_0xdf0d('0x6')]},'key':{'type':Sequelize[_0xdf0d('0x6')]},'keyType':{'type':Sequelize[_0xdf0d('0x1')](_0xdf0d('0x5'),_0xdf0d('0x2'),_0xdf0d('0x3'))},'keyContent':{'type':Sequelize[_0xdf0d('0x6')]},'idField':{'type':Sequelize[_0xdf0d('0x6')]},'nameField':{'type':Sequelize[_0xdf0d('0x6')]},'customField':{'type':Sequelize[_0xdf0d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdf0d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 0db6c6b..728a292 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 _0xd561=['create','body','update','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','params','find'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xd561,0x1c5));var _0x1d56=function(_0x540af3,_0xa5116d){_0x540af3=_0x540af3-0x0;var _0x142a6c=_0xd561[_0x540af3];return _0x142a6c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d56('0x0'));var rp=require(_0x1d56('0x1'));var moment=require(_0x1d56('0x2'));var BPromise=require(_0x1d56('0x3'));var Mustache=require(_0x1d56('0x4'));var util=require(_0x1d56('0x5'));var path=require(_0x1d56('0x6'));var sox=require('sox');var csv=require(_0x1d56('0x7'));var ejs=require(_0x1d56('0x8'));var fs=require('fs');var fs_extra=require(_0x1d56('0x9'));var _=require('lodash');var squel=require(_0x1d56('0xa'));var crypto=require(_0x1d56('0xb'));var jsforce=require(_0x1d56('0xc'));var deskjs=require(_0x1d56('0xd'));var toCsv=require(_0x1d56('0x7'));var querystring=require(_0x1d56('0xe'));var Papa=require(_0x1d56('0xf'));var Redis=require(_0x1d56('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d56('0x11'));var as=require(_0x1d56('0x12'));var hardwareService=require(_0x1d56('0x13'));var logger=require('../../config/logger')(_0x1d56('0x14'));var utils=require(_0x1d56('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1d56('0x16'));var db=require(_0x1d56('0x17'))['db'];function respondWithStatusCode(_0x450473,_0x144d81){_0x144d81=_0x144d81||0xcc;return function(_0x1b57ad){if(_0x1b57ad){return _0x450473[_0x1d56('0x18')](_0x144d81);}return _0x450473[_0x1d56('0x19')](_0x144d81)['end']();};}function respondWithResult(_0x489c5b,_0x57d08c){_0x57d08c=_0x57d08c||0xc8;return function(_0xeab998){if(_0xeab998){return _0x489c5b[_0x1d56('0x19')](_0x57d08c)[_0x1d56('0x1a')](_0xeab998);}};}function respondWithFilteredResult(_0x157c68,_0x576ccb){return function(_0x349e8b){if(_0x349e8b){var _0x3dc8bd=typeof _0x576ccb[_0x1d56('0x1b')]===_0x1d56('0x1c')&&typeof _0x576ccb[_0x1d56('0x1d')]===_0x1d56('0x1c');var _0xb3805b=_0x349e8b[_0x1d56('0x1e')];var _0x370319=_0x3dc8bd?0x0:_0x576ccb[_0x1d56('0x1b')];var _0x9380fa=_0x3dc8bd?_0x349e8b['count']:_0x576ccb[_0x1d56('0x1b')]+_0x576ccb[_0x1d56('0x1d')];var _0x58b3f6;if(_0x9380fa>=_0xb3805b){_0x9380fa=_0xb3805b;_0x58b3f6=0xc8;}else{_0x58b3f6=0xce;}_0x157c68[_0x1d56('0x19')](_0x58b3f6);return _0x157c68['set']('Content-Range',_0x370319+'-'+_0x9380fa+'/'+_0xb3805b)[_0x1d56('0x1a')](_0x349e8b);}return null;};}function patchUpdates(_0x103db3){return function(_0x5bf78f){try{jsonpatch[_0x1d56('0x1f')](_0x5bf78f,_0x103db3,!![]);}catch(_0x23ce96){return BPromise[_0x1d56('0x20')](_0x23ce96);}return _0x5bf78f[_0x1d56('0x21')]();};}function saveUpdates(_0x5b10f2,_0x891d0b){return function(_0x4bf814){if(_0x4bf814){return _0x4bf814['update'](_0x5b10f2)[_0x1d56('0x22')](function(_0x2fcd98){return _0x2fcd98;});}return null;};}function removeEntity(_0x48e6af,_0x4ed74f){return function(_0x1cdd58){if(_0x1cdd58){return _0x1cdd58[_0x1d56('0x23')]()[_0x1d56('0x22')](function(){_0x48e6af[_0x1d56('0x19')](0xcc)[_0x1d56('0x24')]();});}};}function handleEntityNotFound(_0x39c100,_0x89d921){return function(_0x483f32){if(!_0x483f32){_0x39c100[_0x1d56('0x18')](0x194);}return _0x483f32;};}function handleError(_0x52ffd5,_0x558eff){_0x558eff=_0x558eff||0x1f4;return function(_0x265f5f){logger[_0x1d56('0x25')](_0x265f5f[_0x1d56('0x26')]);if(_0x265f5f[_0x1d56('0x27')]){delete _0x265f5f[_0x1d56('0x27')];}_0x52ffd5[_0x1d56('0x19')](_0x558eff)[_0x1d56('0x28')](_0x265f5f);};}exports[_0x1d56('0x29')]=function(_0xe25829,_0x4620bd){var _0x1bcb54={},_0x8313c1={},_0x1ce5f8={'count':0x0,'rows':[]};var _0x318f8c=_[_0x1d56('0x2a')](db[_0x1d56('0x2b')][_0x1d56('0x2c')],function(_0x5576a3){return{'name':_0x5576a3[_0x1d56('0x2d')],'type':_0x5576a3['type'][_0x1d56('0x2e')]};});_0x8313c1[_0x1d56('0x2f')]=_[_0x1d56('0x2a')](_0x318f8c,'name');_0x8313c1['query']=_[_0x1d56('0x30')](_0xe25829[_0x1d56('0x31')]);_0x8313c1[_0x1d56('0x32')]=_[_0x1d56('0x33')](_0x8313c1[_0x1d56('0x2f')],_0x8313c1[_0x1d56('0x31')]);_0x1bcb54[_0x1d56('0x34')]=_[_0x1d56('0x33')](_0x8313c1['model'],qs[_0x1d56('0x35')](_0xe25829['query'][_0x1d56('0x35')]));_0x1bcb54[_0x1d56('0x34')]=_0x1bcb54[_0x1d56('0x34')][_0x1d56('0x36')]?_0x1bcb54[_0x1d56('0x34')]:_0x8313c1[_0x1d56('0x2f')];if(!_0xe25829[_0x1d56('0x31')][_0x1d56('0x37')](_0x1d56('0x38'))){_0x1bcb54[_0x1d56('0x1d')]=qs['limit'](_0xe25829[_0x1d56('0x31')]['limit']);_0x1bcb54[_0x1d56('0x1b')]=qs[_0x1d56('0x1b')](_0xe25829[_0x1d56('0x31')][_0x1d56('0x1b')]);}_0x1bcb54[_0x1d56('0x39')]=qs[_0x1d56('0x3a')](_0xe25829[_0x1d56('0x31')][_0x1d56('0x3a')]);_0x1bcb54[_0x1d56('0x3b')]=qs['filters'](_[_0x1d56('0x3c')](_0xe25829[_0x1d56('0x31')],_0x8313c1['filters']),_0x318f8c);if(_0xe25829[_0x1d56('0x31')][_0x1d56('0x3d')]){_0x1bcb54[_0x1d56('0x3b')]=_['merge'](_0x1bcb54[_0x1d56('0x3b')],{'$or':_[_0x1d56('0x2a')](_0x318f8c,function(_0x529bc2){if(_0x529bc2[_0x1d56('0x3e')]!=='VIRTUAL'){var _0xd2019d={};_0xd2019d[_0x529bc2[_0x1d56('0x27')]]={'$like':'%'+_0xe25829[_0x1d56('0x31')][_0x1d56('0x3d')]+'%'};return _0xd2019d;}})});}_0x1bcb54=_[_0x1d56('0x3f')]({},_0x1bcb54,_0xe25829[_0x1d56('0x40')]);var _0x4dba83={'where':_0x1bcb54[_0x1d56('0x3b')]};return db['ServicenowField'][_0x1d56('0x1e')](_0x4dba83)[_0x1d56('0x22')](function(_0xf96c53){_0x1ce5f8[_0x1d56('0x1e')]=_0xf96c53;if(_0xe25829[_0x1d56('0x31')][_0x1d56('0x41')]){_0x1bcb54[_0x1d56('0x42')]=[{'all':!![]}];}return db[_0x1d56('0x2b')][_0x1d56('0x43')](_0x1bcb54);})['then'](function(_0x375323){_0x1ce5f8[_0x1d56('0x44')]=_0x375323;return _0x1ce5f8;})['then'](respondWithFilteredResult(_0x4620bd,_0x1bcb54))[_0x1d56('0x45')](handleError(_0x4620bd,null));};exports['show']=function(_0x2b6012,_0x149a9e){var _0x191eee={'raw':!![],'where':{'id':_0x2b6012[_0x1d56('0x46')]['id']}},_0xc13d81={};_0xc13d81[_0x1d56('0x2f')]=_['keys'](db[_0x1d56('0x2b')][_0x1d56('0x2c')]);_0xc13d81['query']=_[_0x1d56('0x30')](_0x2b6012[_0x1d56('0x31')]);_0xc13d81[_0x1d56('0x32')]=_[_0x1d56('0x33')](_0xc13d81['model'],_0xc13d81[_0x1d56('0x31')]);_0x191eee['attributes']=_['intersection'](_0xc13d81[_0x1d56('0x2f')],qs[_0x1d56('0x35')](_0x2b6012[_0x1d56('0x31')][_0x1d56('0x35')]));_0x191eee[_0x1d56('0x34')]=_0x191eee['attributes'][_0x1d56('0x36')]?_0x191eee[_0x1d56('0x34')]:_0xc13d81['model'];if(_0x2b6012['query'][_0x1d56('0x41')]){_0x191eee[_0x1d56('0x42')]=[{'all':!![]}];}_0x191eee=_[_0x1d56('0x3f')]({},_0x191eee,_0x2b6012[_0x1d56('0x40')]);return db['ServicenowField'][_0x1d56('0x47')](_0x191eee)['then'](handleEntityNotFound(_0x149a9e,null))['then'](respondWithResult(_0x149a9e,null))[_0x1d56('0x45')](handleError(_0x149a9e,null));};exports[_0x1d56('0x48')]=function(_0x1ffcca,_0x4f9d8a){return db[_0x1d56('0x2b')]['create'](_0x1ffcca[_0x1d56('0x49')],{})[_0x1d56('0x22')](respondWithResult(_0x4f9d8a,0xc9))[_0x1d56('0x45')](handleError(_0x4f9d8a,null));};exports[_0x1d56('0x4a')]=function(_0x189768,_0x514ff7){if(_0x189768[_0x1d56('0x49')]['id']){delete _0x189768['body']['id'];}return db[_0x1d56('0x2b')][_0x1d56('0x47')]({'where':{'id':_0x189768['params']['id']}})[_0x1d56('0x22')](handleEntityNotFound(_0x514ff7,null))['then'](saveUpdates(_0x189768[_0x1d56('0x49')],null))[_0x1d56('0x22')](respondWithResult(_0x514ff7,null))[_0x1d56('0x45')](handleError(_0x514ff7,null));};exports[_0x1d56('0x23')]=function(_0x1393d7,_0x4bf578){return db[_0x1d56('0x2b')]['find']({'where':{'id':_0x1393d7['params']['id']}})['then'](handleEntityNotFound(_0x4bf578,null))[_0x1d56('0x22')](removeEntity(_0x4bf578,null))[_0x1d56('0x45')](handleError(_0x4bf578,null));}; \ No newline at end of file +var _0x5445=['status','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','findAll','params','keys','includeAll','find','catch','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0xea5313,_0x5ced37){var _0x5ca006=function(_0x5d0ef3){while(--_0x5d0ef3){_0xea5313['push'](_0xea5313['shift']());}};_0x5ca006(++_0x5ced37);}(_0x5445,0x14e));var _0x5544=function(_0x3fa529,_0x3c341e){_0x3fa529=_0x3fa529-0x0;var _0x350134=_0x5445[_0x3fa529];return _0x350134;};'use strict';var emlformat=require(_0x5544('0x0'));var rimraf=require(_0x5544('0x1'));var zipdir=require(_0x5544('0x2'));var jsonpatch=require(_0x5544('0x3'));var rp=require(_0x5544('0x4'));var moment=require(_0x5544('0x5'));var BPromise=require(_0x5544('0x6'));var Mustache=require('mustache');var util=require(_0x5544('0x7'));var path=require('path');var sox=require(_0x5544('0x8'));var csv=require(_0x5544('0x9'));var ejs=require(_0x5544('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5544('0xb'));var squel=require('squel');var crypto=require(_0x5544('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5544('0xd'));var toCsv=require(_0x5544('0x9'));var querystring=require(_0x5544('0xe'));var Papa=require('papaparse');var Redis=require(_0x5544('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5544('0x10'));var as=require(_0x5544('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5544('0x12'))(_0x5544('0x13'));var utils=require(_0x5544('0x14'));var config=require(_0x5544('0x15'));var licenseUtil=require(_0x5544('0x16'));var db=require(_0x5544('0x17'))['db'];function respondWithStatusCode(_0x51b0b2,_0x12946a){_0x12946a=_0x12946a||0xcc;return function(_0x1c22a9){if(_0x1c22a9){return _0x51b0b2[_0x5544('0x18')](_0x12946a);}return _0x51b0b2['status'](_0x12946a)[_0x5544('0x19')]();};}function respondWithResult(_0xacba2d,_0x4689cc){_0x4689cc=_0x4689cc||0xc8;return function(_0x22ae91){if(_0x22ae91){return _0xacba2d[_0x5544('0x1a')](_0x4689cc)[_0x5544('0x1b')](_0x22ae91);}};}function respondWithFilteredResult(_0x40d23f,_0x4b834b){return function(_0xdfef44){if(_0xdfef44){var _0x4df400=typeof _0x4b834b['offset']==='undefined'&&typeof _0x4b834b[_0x5544('0x1c')]===_0x5544('0x1d');var _0x45a3c8=_0xdfef44[_0x5544('0x1e')];var _0x4a6516=_0x4df400?0x0:_0x4b834b[_0x5544('0x1f')];var _0x4b5210=_0x4df400?_0xdfef44[_0x5544('0x1e')]:_0x4b834b[_0x5544('0x1f')]+_0x4b834b[_0x5544('0x1c')];var _0x1afa91;if(_0x4b5210>=_0x45a3c8){_0x4b5210=_0x45a3c8;_0x1afa91=0xc8;}else{_0x1afa91=0xce;}_0x40d23f['status'](_0x1afa91);return _0x40d23f['set'](_0x5544('0x20'),_0x4a6516+'-'+_0x4b5210+'/'+_0x45a3c8)[_0x5544('0x1b')](_0xdfef44);}return null;};}function patchUpdates(_0x6f6b94){return function(_0x1fbb68){try{jsonpatch[_0x5544('0x21')](_0x1fbb68,_0x6f6b94,!![]);}catch(_0x317c86){return BPromise['reject'](_0x317c86);}return _0x1fbb68[_0x5544('0x22')]();};}function saveUpdates(_0x469992,_0x419c93){return function(_0x732e18){if(_0x732e18){return _0x732e18[_0x5544('0x23')](_0x469992)[_0x5544('0x24')](function(_0x49de67){return _0x49de67;});}return null;};}function removeEntity(_0x3bd22e,_0x1586d0){return function(_0x272094){if(_0x272094){return _0x272094['destroy']()[_0x5544('0x24')](function(){_0x3bd22e[_0x5544('0x1a')](0xcc)[_0x5544('0x19')]();});}};}function handleEntityNotFound(_0x4b3016,_0x692253){return function(_0x29adfc){if(!_0x29adfc){_0x4b3016[_0x5544('0x18')](0x194);}return _0x29adfc;};}function handleError(_0x32f59a,_0x2a7e80){_0x2a7e80=_0x2a7e80||0x1f4;return function(_0x1eb0f5){logger['error'](_0x1eb0f5[_0x5544('0x25')]);if(_0x1eb0f5['name']){delete _0x1eb0f5[_0x5544('0x26')];}_0x32f59a[_0x5544('0x1a')](_0x2a7e80)[_0x5544('0x27')](_0x1eb0f5);};}exports[_0x5544('0x28')]=function(_0x4208fb,_0x139ebb){var _0x165cbc={},_0x129e9b={},_0x593eb9={'count':0x0,'rows':[]};var _0x2ef761=_[_0x5544('0x29')](db[_0x5544('0x2a')][_0x5544('0x2b')],function(_0x505b86){return{'name':_0x505b86[_0x5544('0x2c')],'type':_0x505b86[_0x5544('0x2d')][_0x5544('0x2e')]};});_0x129e9b[_0x5544('0x2f')]=_['map'](_0x2ef761,_0x5544('0x26'));_0x129e9b['query']=_['keys'](_0x4208fb[_0x5544('0x30')]);_0x129e9b[_0x5544('0x31')]=_[_0x5544('0x32')](_0x129e9b[_0x5544('0x2f')],_0x129e9b['query']);_0x165cbc['attributes']=_[_0x5544('0x32')](_0x129e9b['model'],qs[_0x5544('0x33')](_0x4208fb['query'][_0x5544('0x33')]));_0x165cbc[_0x5544('0x34')]=_0x165cbc[_0x5544('0x34')][_0x5544('0x35')]?_0x165cbc[_0x5544('0x34')]:_0x129e9b[_0x5544('0x2f')];if(!_0x4208fb['query'][_0x5544('0x36')](_0x5544('0x37'))){_0x165cbc[_0x5544('0x1c')]=qs[_0x5544('0x1c')](_0x4208fb['query'][_0x5544('0x1c')]);_0x165cbc['offset']=qs['offset'](_0x4208fb[_0x5544('0x30')][_0x5544('0x1f')]);}_0x165cbc[_0x5544('0x38')]=qs['sort'](_0x4208fb['query'][_0x5544('0x39')]);_0x165cbc[_0x5544('0x3a')]=qs[_0x5544('0x31')](_['pick'](_0x4208fb['query'],_0x129e9b['filters']),_0x2ef761);if(_0x4208fb[_0x5544('0x30')]['filter']){_0x165cbc[_0x5544('0x3a')]=_['merge'](_0x165cbc[_0x5544('0x3a')],{'$or':_[_0x5544('0x29')](_0x2ef761,function(_0x3f8610){if(_0x3f8610[_0x5544('0x2d')]!==_0x5544('0x3b')){var _0x314ea6={};_0x314ea6[_0x3f8610[_0x5544('0x26')]]={'$like':'%'+_0x4208fb[_0x5544('0x30')][_0x5544('0x3c')]+'%'};return _0x314ea6;}})});}_0x165cbc=_[_0x5544('0x3d')]({},_0x165cbc,_0x4208fb[_0x5544('0x3e')]);var _0x15508e={'where':_0x165cbc[_0x5544('0x3a')]};return db['ServicenowField'][_0x5544('0x1e')](_0x15508e)[_0x5544('0x24')](function(_0x152f19){_0x593eb9[_0x5544('0x1e')]=_0x152f19;if(_0x4208fb['query']['includeAll']){_0x165cbc[_0x5544('0x3f')]=[{'all':!![]}];}return db[_0x5544('0x2a')][_0x5544('0x40')](_0x165cbc);})[_0x5544('0x24')](function(_0x4a1f1d){_0x593eb9['rows']=_0x4a1f1d;return _0x593eb9;})[_0x5544('0x24')](respondWithFilteredResult(_0x139ebb,_0x165cbc))['catch'](handleError(_0x139ebb,null));};exports['show']=function(_0x59608a,_0x1d5a9f){var _0xe0b475={'raw':!![],'where':{'id':_0x59608a[_0x5544('0x41')]['id']}},_0x72aba7={};_0x72aba7[_0x5544('0x2f')]=_['keys'](db[_0x5544('0x2a')]['rawAttributes']);_0x72aba7[_0x5544('0x30')]=_[_0x5544('0x42')](_0x59608a[_0x5544('0x30')]);_0x72aba7[_0x5544('0x31')]=_['intersection'](_0x72aba7[_0x5544('0x2f')],_0x72aba7[_0x5544('0x30')]);_0xe0b475[_0x5544('0x34')]=_[_0x5544('0x32')](_0x72aba7[_0x5544('0x2f')],qs['fields'](_0x59608a[_0x5544('0x30')][_0x5544('0x33')]));_0xe0b475[_0x5544('0x34')]=_0xe0b475[_0x5544('0x34')][_0x5544('0x35')]?_0xe0b475[_0x5544('0x34')]:_0x72aba7[_0x5544('0x2f')];if(_0x59608a['query'][_0x5544('0x43')]){_0xe0b475[_0x5544('0x3f')]=[{'all':!![]}];}_0xe0b475=_[_0x5544('0x3d')]({},_0xe0b475,_0x59608a[_0x5544('0x3e')]);return db[_0x5544('0x2a')][_0x5544('0x44')](_0xe0b475)[_0x5544('0x24')](handleEntityNotFound(_0x1d5a9f,null))[_0x5544('0x24')](respondWithResult(_0x1d5a9f,null))[_0x5544('0x45')](handleError(_0x1d5a9f,null));};exports['create']=function(_0x21a546,_0x1de2ab){return db[_0x5544('0x2a')]['create'](_0x21a546[_0x5544('0x46')],{})['then'](respondWithResult(_0x1de2ab,0xc9))[_0x5544('0x45')](handleError(_0x1de2ab,null));};exports[_0x5544('0x23')]=function(_0x37a1ea,_0x5096de){if(_0x37a1ea[_0x5544('0x46')]['id']){delete _0x37a1ea[_0x5544('0x46')]['id'];}return db[_0x5544('0x2a')][_0x5544('0x44')]({'where':{'id':_0x37a1ea[_0x5544('0x41')]['id']}})[_0x5544('0x24')](handleEntityNotFound(_0x5096de,null))[_0x5544('0x24')](saveUpdates(_0x37a1ea[_0x5544('0x46')],null))[_0x5544('0x24')](respondWithResult(_0x5096de,null))[_0x5544('0x45')](handleError(_0x5096de,null));};exports[_0x5544('0x47')]=function(_0x36c097,_0x3a1a59){return db[_0x5544('0x2a')][_0x5544('0x44')]({'where':{'id':_0x36c097[_0x5544('0x41')]['id']}})[_0x5544('0x24')](handleEntityNotFound(_0x3a1a59,null))[_0x5544('0x24')](removeEntity(_0x3a1a59,null))[_0x5544('0x45')](handleError(_0x3a1a59,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 81e94a0..68053b7 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 _0xed4e=['define','ServicenowField','int_servicenow_fields','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xed4e,0x1e4));var _0xeed4=function(_0x1ec981,_0x660f60){_0x1ec981=_0x1ec981-0x0;var _0x8958f4=_0xed4e[_0x1ec981];return _0x8958f4;};'use strict';var _=require(_0xeed4('0x0'));var util=require(_0xeed4('0x1'));var logger=require(_0xeed4('0x2'))('api');var moment=require(_0xeed4('0x3'));var BPromise=require('bluebird');var rp=require(_0xeed4('0x4'));var fs=require('fs');var path=require(_0xeed4('0x5'));var rimraf=require(_0xeed4('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xeed4('0x7')]=function(_0x25115f,_0x1b3a1e){return _0x25115f[_0xeed4('0x8')](_0xeed4('0x9'),attributes,{'tableName':_0xeed4('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xeed4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x374a=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x588074,_0x2523ba){var _0xa5e1ec=function(_0x48aa9a){while(--_0x48aa9a){_0x588074['push'](_0x588074['shift']());}};_0xa5e1ec(++_0x2523ba);}(_0x374a,0x92));var _0xa374=function(_0x3abd0f,_0x18f224){_0x3abd0f=_0x3abd0f-0x0;var _0x1be221=_0x374a[_0x3abd0f];return _0x1be221;};'use strict';var _=require(_0xa374('0x0'));var util=require(_0xa374('0x1'));var logger=require(_0xa374('0x2'))(_0xa374('0x3'));var moment=require('moment');var BPromise=require(_0xa374('0x4'));var rp=require(_0xa374('0x5'));var fs=require('fs');var path=require(_0xa374('0x6'));var rimraf=require(_0xa374('0x7'));var config=require(_0xa374('0x8'));var attributes=require(_0xa374('0x9'));module[_0xa374('0xa')]=function(_0x274557,_0x338e11){return _0x274557[_0xa374('0xb')](_0xa374('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xa374('0xd'),_0xa374('0xe')],'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 c5cd41c..97119a7 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x58da8a,_0x1c0584){var _0x5ba3a3=function(_0x31552b){while(--_0x31552b){_0x58da8a['push'](_0x58da8a['shift']());}};_0x5ba3a3(++_0x1c0584);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x543bdd,_0x21d49b){var _0xdc72c=function(_0x8e277){while(--_0x8e277){_0x543bdd['push'](_0x543bdd['shift']());}};_0xdc72c(++_0x21d49b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 584da97..c141f27 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x11c9b1,_0x42d2d3){var _0x511435=function(_0x28b405){while(--_0x28b405){_0x11c9b1['push'](_0x11c9b1['shift']());}};_0x511435(++_0x42d2d3);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x29b4bb,_0x361442){var _0x39c028=function(_0x223afe){while(--_0x223afe){_0x29b4bb['push'](_0x29b4bb['shift']());}};_0x39c028(++_0x361442);}(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 24f4289..cc42000 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(_0xf5192b,_0x2ab5c9){var _0x382a08=function(_0x4457e0){while(--_0x4457e0){_0xf5192b['push'](_0xf5192b['shift']());}};_0x382a08(++_0x2ab5c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x183b74,_0x3f72aa){var _0x23a747=function(_0x57afcf){while(--_0x57afcf){_0x183b74['push'](_0x183b74['shift']());}};_0x23a747(++_0x3f72aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 98b90b4..29a956c 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 _0xef60=['Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','includes','label','values','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','params','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','hasOwnProperty','nolimit','AccountId'];(function(_0x4cb322,_0x505daf){var _0x25be4b=function(_0x944c96){while(--_0x944c96){_0x4cb322['push'](_0x4cb322['shift']());}};_0x25be4b(++_0x505daf);}(_0xef60,0xa0));var _0x0ef6=function(_0x106c84,_0x5ed551){_0x106c84=_0x106c84-0x0;var _0x195486=_0xef60[_0x106c84];return _0x195486;};'use strict';var emlformat=require(_0x0ef6('0x0'));var rimraf=require(_0x0ef6('0x1'));var zipdir=require(_0x0ef6('0x2'));var jsonpatch=require(_0x0ef6('0x3'));var rp=require(_0x0ef6('0x4'));var moment=require(_0x0ef6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0ef6('0x6'));var util=require(_0x0ef6('0x7'));var path=require('path');var sox=require(_0x0ef6('0x8'));var csv=require(_0x0ef6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ef6('0xa'));var _=require(_0x0ef6('0xb'));var squel=require(_0x0ef6('0xc'));var crypto=require(_0x0ef6('0xd'));var jsforce=require(_0x0ef6('0xe'));var deskjs=require(_0x0ef6('0xf'));var toCsv=require(_0x0ef6('0x9'));var querystring=require('querystring');var Papa=require(_0x0ef6('0x10'));var Redis=require(_0x0ef6('0x11'));var authService=require(_0x0ef6('0x12'));var qs=require(_0x0ef6('0x13'));var as=require(_0x0ef6('0x14'));var hardwareService=require(_0x0ef6('0x15'));var logger=require('../../config/logger')(_0x0ef6('0x16'));var utils=require(_0x0ef6('0x17'));var config=require(_0x0ef6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ef6('0x19'))['db'];var integrations=require(_0x0ef6('0x1a'));function respondWithStatusCode(_0xf0efea,_0x29eecf){_0x29eecf=_0x29eecf||0xcc;return function(_0x129e5a){if(_0x129e5a){return _0xf0efea[_0x0ef6('0x1b')](_0x29eecf);}return _0xf0efea[_0x0ef6('0x1c')](_0x29eecf)['end']();};}function respondWithResult(_0xa4a5e,_0x2a9cba){_0x2a9cba=_0x2a9cba||0xc8;return function(_0x55bfd1){if(_0x55bfd1){return _0xa4a5e[_0x0ef6('0x1c')](_0x2a9cba)[_0x0ef6('0x1d')](_0x55bfd1);}};}function respondWithFilteredResult(_0x1416a4,_0x3dc698){return function(_0x31f524){if(_0x31f524){var _0x46c0c1=typeof _0x3dc698[_0x0ef6('0x1e')]===_0x0ef6('0x1f')&&typeof _0x3dc698[_0x0ef6('0x20')]===_0x0ef6('0x1f');var _0x338b87=_0x31f524[_0x0ef6('0x21')];var _0x14bdf0=_0x46c0c1?0x0:_0x3dc698['offset'];var _0x3af0df=_0x46c0c1?_0x31f524[_0x0ef6('0x21')]:_0x3dc698[_0x0ef6('0x1e')]+_0x3dc698['limit'];var _0x27486a;if(_0x3af0df>=_0x338b87){_0x3af0df=_0x338b87;_0x27486a=0xc8;}else{_0x27486a=0xce;}_0x1416a4[_0x0ef6('0x1c')](_0x27486a);return _0x1416a4['set'](_0x0ef6('0x22'),_0x14bdf0+'-'+_0x3af0df+'/'+_0x338b87)[_0x0ef6('0x1d')](_0x31f524);}return null;};}function patchUpdates(_0x706213){return function(_0x39074a){try{jsonpatch['apply'](_0x39074a,_0x706213,!![]);}catch(_0x1afef0){return BPromise[_0x0ef6('0x23')](_0x1afef0);}return _0x39074a[_0x0ef6('0x24')]();};}function saveUpdates(_0x4733f2,_0xeee26c){return function(_0x260d15){if(_0x260d15){return _0x260d15[_0x0ef6('0x25')](_0x4733f2)[_0x0ef6('0x26')](function(_0x56d65a){return _0x56d65a;});}return null;};}function removeEntity(_0x277d47,_0x94e858){return function(_0x569afa){if(_0x569afa){return _0x569afa[_0x0ef6('0x27')]()['then'](function(){_0x277d47[_0x0ef6('0x1c')](0xcc)[_0x0ef6('0x28')]();});}};}function handleEntityNotFound(_0x5d6501,_0x3ce3e1){return function(_0x275010){if(!_0x275010){_0x5d6501['sendStatus'](0x194);}return _0x275010;};}function handleError(_0x2c55ac,_0x3e8be0){_0x3e8be0=_0x3e8be0||0x1f4;return function(_0x2c0bfb){logger[_0x0ef6('0x29')](_0x2c0bfb[_0x0ef6('0x2a')]);if(_0x2c0bfb[_0x0ef6('0x2b')]){delete _0x2c0bfb[_0x0ef6('0x2b')];}_0x2c55ac[_0x0ef6('0x1c')](_0x3e8be0)[_0x0ef6('0x2c')](_0x2c0bfb);};}exports['index']=function(_0x3a3c76,_0x2c48c3){var _0x5bf7a6={},_0x1b9983={},_0x4ad66c={'count':0x0,'rows':[]};var _0x331a70=_['map'](db['SugarcrmAccount'][_0x0ef6('0x2d')],function(_0x4e094c){return{'name':_0x4e094c[_0x0ef6('0x2e')],'type':_0x4e094c[_0x0ef6('0x2f')][_0x0ef6('0x30')]};});_0x1b9983[_0x0ef6('0x31')]=_[_0x0ef6('0x32')](_0x331a70,_0x0ef6('0x2b'));_0x1b9983[_0x0ef6('0x33')]=_[_0x0ef6('0x34')](_0x3a3c76[_0x0ef6('0x33')]);_0x1b9983[_0x0ef6('0x35')]=_['intersection'](_0x1b9983[_0x0ef6('0x31')],_0x1b9983[_0x0ef6('0x33')]);_0x5bf7a6['attributes']=_[_0x0ef6('0x36')](_0x1b9983[_0x0ef6('0x31')],qs[_0x0ef6('0x37')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x37')]));_0x5bf7a6[_0x0ef6('0x38')]=_0x5bf7a6[_0x0ef6('0x38')][_0x0ef6('0x39')]?_0x5bf7a6[_0x0ef6('0x38')]:_0x1b9983['model'];if(!_0x3a3c76[_0x0ef6('0x33')]['hasOwnProperty']('nolimit')){_0x5bf7a6[_0x0ef6('0x20')]=qs[_0x0ef6('0x20')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x20')]);_0x5bf7a6[_0x0ef6('0x1e')]=qs['offset'](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x1e')]);}_0x5bf7a6[_0x0ef6('0x3a')]=qs[_0x0ef6('0x3b')](_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x3b')]);_0x5bf7a6[_0x0ef6('0x3c')]=qs[_0x0ef6('0x35')](_['pick'](_0x3a3c76['query'],_0x1b9983['filters']),_0x331a70);if(_0x3a3c76['query'][_0x0ef6('0x3d')]){_0x5bf7a6[_0x0ef6('0x3c')]=_[_0x0ef6('0x3e')](_0x5bf7a6[_0x0ef6('0x3c')],{'$or':_['map'](_0x331a70,function(_0x5018a7){if(_0x5018a7[_0x0ef6('0x2f')]!==_0x0ef6('0x3f')){var _0x21ccb2={};_0x21ccb2[_0x5018a7[_0x0ef6('0x2b')]]={'$like':'%'+_0x3a3c76[_0x0ef6('0x33')]['filter']+'%'};return _0x21ccb2;}})});}_0x5bf7a6=_[_0x0ef6('0x3e')]({},_0x5bf7a6,_0x3a3c76[_0x0ef6('0x40')]);var _0x53acec={'where':_0x5bf7a6[_0x0ef6('0x3c')]};return db[_0x0ef6('0x41')][_0x0ef6('0x21')](_0x53acec)[_0x0ef6('0x26')](function(_0x169c8e){_0x4ad66c['count']=_0x169c8e;if(_0x3a3c76[_0x0ef6('0x33')][_0x0ef6('0x42')]){_0x5bf7a6[_0x0ef6('0x43')]=[{'all':!![]}];}return db[_0x0ef6('0x41')][_0x0ef6('0x44')](_0x5bf7a6);})[_0x0ef6('0x26')](function(_0x5ecca4){_0x4ad66c[_0x0ef6('0x45')]=_0x5ecca4;return _0x4ad66c;})[_0x0ef6('0x26')](respondWithFilteredResult(_0x2c48c3,_0x5bf7a6))['catch'](handleError(_0x2c48c3,null));};exports['show']=function(_0x8a355e,_0x28bff1){var _0x2a9283={'raw':![],'where':{'id':_0x8a355e[_0x0ef6('0x46')]['id']}},_0x1a6dab={};_0x1a6dab[_0x0ef6('0x31')]=_[_0x0ef6('0x34')](db[_0x0ef6('0x41')]['rawAttributes']);_0x1a6dab[_0x0ef6('0x33')]=_['keys'](_0x8a355e[_0x0ef6('0x33')]);_0x1a6dab['filters']=_[_0x0ef6('0x36')](_0x1a6dab['model'],_0x1a6dab[_0x0ef6('0x33')]);_0x2a9283[_0x0ef6('0x38')]=_[_0x0ef6('0x36')](_0x1a6dab['model'],qs[_0x0ef6('0x37')](_0x8a355e[_0x0ef6('0x33')]['fields']));_0x2a9283[_0x0ef6('0x38')]=_0x2a9283[_0x0ef6('0x38')]['length']?_0x2a9283[_0x0ef6('0x38')]:_0x1a6dab[_0x0ef6('0x31')];if(_0x8a355e[_0x0ef6('0x33')][_0x0ef6('0x42')]){_0x2a9283['include']=[{'all':!![]}];}_0x2a9283=_[_0x0ef6('0x3e')]({},_0x2a9283,_0x8a355e[_0x0ef6('0x40')]);return db[_0x0ef6('0x41')][_0x0ef6('0x47')](_0x2a9283)[_0x0ef6('0x26')](handleEntityNotFound(_0x28bff1,null))['then'](respondWithResult(_0x28bff1,null))[_0x0ef6('0x48')](handleError(_0x28bff1,null));};exports[_0x0ef6('0x49')]=function(_0x50f3cd,_0x4be4e6){return db['SugarcrmAccount'][_0x0ef6('0x49')](_0x50f3cd[_0x0ef6('0x4a')],{})['then'](respondWithResult(_0x4be4e6,0xc9))[_0x0ef6('0x48')](handleError(_0x4be4e6,null));};exports[_0x0ef6('0x25')]=function(_0x196cbd,_0x53bd76){if(_0x196cbd['body']['id']){delete _0x196cbd['body']['id'];}return db[_0x0ef6('0x41')]['find']({'where':{'id':_0x196cbd[_0x0ef6('0x46')]['id']}})[_0x0ef6('0x26')](handleEntityNotFound(_0x53bd76,null))[_0x0ef6('0x26')](saveUpdates(_0x196cbd[_0x0ef6('0x4a')],null))[_0x0ef6('0x26')](respondWithResult(_0x53bd76,null))['catch'](handleError(_0x53bd76,null));};exports[_0x0ef6('0x27')]=function(_0xfcabbb,_0x42ab99){return db[_0x0ef6('0x41')][_0x0ef6('0x47')]({'where':{'id':_0xfcabbb['params']['id']}})['then'](handleEntityNotFound(_0x42ab99,null))[_0x0ef6('0x26')](removeEntity(_0x42ab99,null))[_0x0ef6('0x48')](handleError(_0x42ab99,null));};exports[_0x0ef6('0x4b')]=function(_0x1c0c02,_0x1aa4ec,_0x270436){var _0x5990d0={};var _0x4349e5={};var _0x594254;var _0x502164;return db[_0x0ef6('0x41')][_0x0ef6('0x4c')]({'where':{'id':_0x1c0c02['params']['id']}})['then'](handleEntityNotFound(_0x1aa4ec,null))['then'](function(_0x49dbb0){if(_0x49dbb0){_0x594254=_0x49dbb0;_0x4349e5[_0x0ef6('0x31')]=_[_0x0ef6('0x34')](db[_0x0ef6('0x4d')][_0x0ef6('0x2d')]);_0x4349e5[_0x0ef6('0x33')]=_['keys'](_0x1c0c02['query']);_0x4349e5['filters']=_[_0x0ef6('0x36')](_0x4349e5['model'],_0x4349e5[_0x0ef6('0x33')]);_0x5990d0['attributes']=_[_0x0ef6('0x36')](_0x4349e5[_0x0ef6('0x31')],qs['fields'](_0x1c0c02['query']['fields']));_0x5990d0[_0x0ef6('0x38')]=_0x5990d0['attributes'][_0x0ef6('0x39')]?_0x5990d0['attributes']:_0x4349e5[_0x0ef6('0x31')];_0x5990d0[_0x0ef6('0x3a')]=qs[_0x0ef6('0x3b')](_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x3b')]);_0x5990d0[_0x0ef6('0x3c')]=qs[_0x0ef6('0x35')](_[_0x0ef6('0x4e')](_0x1c0c02[_0x0ef6('0x33')],_0x4349e5[_0x0ef6('0x35')]));if(_0x1c0c02['query']['filter']){_0x5990d0['where']=_[_0x0ef6('0x3e')](_0x5990d0[_0x0ef6('0x3c')],{'$or':_[_0x0ef6('0x32')](_0x5990d0[_0x0ef6('0x38')],function(_0x8506ae){var _0x56e66b={};_0x56e66b[_0x8506ae]={'$like':'%'+_0x1c0c02[_0x0ef6('0x33')]['filter']+'%'};return _0x56e66b;})});}_0x5990d0=_['merge']({},_0x5990d0,_0x1c0c02[_0x0ef6('0x40')]);return _0x594254[_0x0ef6('0x4b')](_0x5990d0);}})[_0x0ef6('0x26')](function(_0x26c31a){if(_0x26c31a){_0x502164=_0x26c31a['length'];if(!_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x4f')](_0x0ef6('0x50'))){_0x5990d0[_0x0ef6('0x20')]=qs[_0x0ef6('0x20')](_0x1c0c02['query']['limit']);_0x5990d0['offset']=qs[_0x0ef6('0x1e')](_0x1c0c02[_0x0ef6('0x33')][_0x0ef6('0x1e')]);}return _0x594254[_0x0ef6('0x4b')](_0x5990d0);}})[_0x0ef6('0x26')](function(_0x27e0e1){if(_0x27e0e1){return _0x27e0e1?{'count':_0x502164,'rows':_0x27e0e1}:null;}})[_0x0ef6('0x26')](respondWithResult(_0x1aa4ec,null))['catch'](handleError(_0x1aa4ec,null));};exports['addConfiguration']=function(_0x45ed8b,_0x53babc,_0x65e80f){if(_0x45ed8b[_0x0ef6('0x4a')]['id']){delete _0x45ed8b[_0x0ef6('0x4a')]['id'];}return db[_0x0ef6('0x41')]['findOne']({'where':{'id':_0x45ed8b['params']['id']}})['then'](handleEntityNotFound(_0x53babc,null))[_0x0ef6('0x26')](function(_0x1c47d0){if(_0x1c47d0){_0x45ed8b['body'][_0x0ef6('0x51')]=_0x1c47d0['id'];_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x52')]=integrations[_0x0ef6('0x53')](_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x54')],_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x2f')]);_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x55')]=integrations[_0x0ef6('0x56')](_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x54')],_0x45ed8b[_0x0ef6('0x4a')][_0x0ef6('0x2f')]);return db[_0x0ef6('0x4d')]['create'](_0x45ed8b[_0x0ef6('0x4a')],{'include':[{'model':db['SugarcrmField'],'as':_0x0ef6('0x52')},{'model':db[_0x0ef6('0x57')],'as':_0x0ef6('0x55')}]});}return null;})[_0x0ef6('0x26')](respondWithResult(_0x53babc,null))[_0x0ef6('0x48')](handleError(_0x53babc,null));};exports[_0x0ef6('0x58')]=function(_0x409d75,_0x4d9984,_0x397357){var _0x36fa86='';var _0x5d0328=['id','name',_0x0ef6('0x59'),_0x0ef6('0x5a'),_0x0ef6('0x5b'),_0x0ef6('0x5c'),'duration_hours',_0x0ef6('0x5d'),_0x0ef6('0x5e'),'parent_type','parent_name',_0x0ef6('0x5f')];return db[_0x0ef6('0x41')]['findOne']({'where':{'id':_0x409d75[_0x0ef6('0x46')]['id']},'attributes':['id',_0x0ef6('0x60'),_0x0ef6('0x61'),_0x0ef6('0x62')]})[_0x0ef6('0x26')](handleEntityNotFound(_0x4d9984,null))[_0x0ef6('0x26')](function(_0xe2f32){if(_0xe2f32){_0x36fa86=_0xe2f32[_0x0ef6('0x62')];var _0xdd2097=_0x36fa86['slice'](-0x1);if(_0xdd2097==='/'){_0x36fa86=_0x36fa86[_0x0ef6('0x63')](0x0,_0x36fa86[_0x0ef6('0x64')](_0xdd2097));}return rp({'method':_0x0ef6('0x65'),'uri':util[_0x0ef6('0x66')](_0x0ef6('0x67'),_0x36fa86,_0x0ef6('0x68')),'json':!![],'form':{'method':_0x0ef6('0x69'),'input_type':_0x0ef6('0x6a'),'response_type':'JSON','rest_data':JSON[_0x0ef6('0x6b')]({'user_auth':{'user_name':_0xe2f32['username'],'password':_0xe2f32[_0x0ef6('0x61')],'encryption':_0x0ef6('0x6c')},'application':_0x0ef6('0x6d')})}});}})[_0x0ef6('0x26')](function(_0x37871b){if(_0x37871b&&_0x37871b[_0x0ef6('0x2b')]!==_0x0ef6('0x6e')&&_0x37871b[_0x0ef6('0x2b')]!==_0x0ef6('0x6f')){return rp({'method':'POST','uri':util[_0x0ef6('0x66')](_0x0ef6('0x67'),_0x36fa86,_0x0ef6('0x68')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x0ef6('0x6a'),'response_type':_0x0ef6('0x6a'),'rest_data':JSON[_0x0ef6('0x6b')]({'session':_0x37871b['id'],'module_name':_0x0ef6('0x70')})}})[_0x0ef6('0x26')](function(_0x18d6b4){if(_0x18d6b4){var _0x4e0567=_['values'](_0x18d6b4[_0x0ef6('0x71')]);_[_0x0ef6('0x72')](_0x4e0567,function(_0x10fd9e){return _0x5d0328[_0x0ef6('0x73')](_0x10fd9e['name']);});return{'count':_0x4e0567['length'],'rows':_[_0x0ef6('0x32')](_0x4e0567,function(_0x2bddfa){return{'id':_0x2bddfa[_0x0ef6('0x2b')],'name':_0x2bddfa[_0x0ef6('0x74')],'custom':_['endsWith'](_0x2bddfa[_0x0ef6('0x2b')],'_c')?!![]:![],'options':_0x2bddfa['options']?_[_0x0ef6('0x32')](_[_0x0ef6('0x75')](_0x2bddfa[_0x0ef6('0x40')]),function(_0x180125){return{'name':_0x180125['value'],'value':_0x180125[_0x0ef6('0x2b')]};}):[]};})};}})['then'](respondWithResult(_0x4d9984,null))['catch'](function(_0x98bfdc){var _0x2585c7=_0x409d75[_0x0ef6('0x33')]['test']?0x1f4:_0x98bfdc['statusCode']||0x1f4;logger[_0x0ef6('0x29')](_0x0ef6('0x76'),_0x0ef6('0x58'),_0x2585c7,JSON['stringify'](_0x98bfdc));delete _0x98bfdc[_0x0ef6('0x2b')];if(_0x2585c7===0x191){_0x2585c7=0x190;}_0x4d9984[_0x0ef6('0x1c')](_0x2585c7)[_0x0ef6('0x2c')](_0x409d75[_0x0ef6('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x98bfdc[_0x0ef6('0x77')]}:_0x98bfdc);});}else{var _0x8a7a0f=0x1f4;_0x4d9984[_0x0ef6('0x1c')](_0x8a7a0f)[_0x0ef6('0x2c')]({'message':_0x0ef6('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xe586=['parent_id','parent_type','parent_name','findOne','username','password','remoteUri','substring','lastIndexOf','%s%s','JSON','stringify','Invalid\x20Login','Password\x20Expired','POST','format','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','name','send','index','map','SugarcrmAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','destroy','SugarcrmConfiguration','options','getConfigurations','AccountId','Subjects','getSubjects','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes'];(function(_0x575126,_0x7e3332){var _0x5c1454=function(_0x113968){while(--_0x113968){_0x575126['push'](_0x575126['shift']());}};_0x5c1454(++_0x7e3332);}(_0xe586,0x181));var _0x6e58=function(_0x2f6edf,_0x2ef5f4){_0x2f6edf=_0x2f6edf-0x0;var _0x205dd6=_0xe586[_0x2f6edf];return _0x205dd6;};'use strict';var emlformat=require(_0x6e58('0x0'));var rimraf=require(_0x6e58('0x1'));var zipdir=require(_0x6e58('0x2'));var jsonpatch=require(_0x6e58('0x3'));var rp=require(_0x6e58('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6e58('0x5'));var path=require('path');var sox=require(_0x6e58('0x6'));var csv=require(_0x6e58('0x7'));var ejs=require(_0x6e58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e58('0x9'));var squel=require(_0x6e58('0xa'));var crypto=require('crypto');var jsforce=require(_0x6e58('0xb'));var deskjs=require(_0x6e58('0xc'));var toCsv=require(_0x6e58('0x7'));var querystring=require(_0x6e58('0xd'));var Papa=require('papaparse');var Redis=require(_0x6e58('0xe'));var authService=require(_0x6e58('0xf'));var qs=require(_0x6e58('0x10'));var as=require(_0x6e58('0x11'));var hardwareService=require(_0x6e58('0x12'));var logger=require(_0x6e58('0x13'))(_0x6e58('0x14'));var utils=require('../../config/utils');var config=require(_0x6e58('0x15'));var licenseUtil=require(_0x6e58('0x16'));var db=require(_0x6e58('0x17'))['db'];var integrations=require(_0x6e58('0x18'));function respondWithStatusCode(_0x44ad44,_0x119fb6){_0x119fb6=_0x119fb6||0xcc;return function(_0x151b14){if(_0x151b14){return _0x44ad44['sendStatus'](_0x119fb6);}return _0x44ad44[_0x6e58('0x19')](_0x119fb6)['end']();};}function respondWithResult(_0x108170,_0x4076aa){_0x4076aa=_0x4076aa||0xc8;return function(_0x5197c2){if(_0x5197c2){return _0x108170[_0x6e58('0x19')](_0x4076aa)[_0x6e58('0x1a')](_0x5197c2);}};}function respondWithFilteredResult(_0x2a9a38,_0x210496){return function(_0x207dee){if(_0x207dee){var _0x398d10=typeof _0x210496['offset']===_0x6e58('0x1b')&&typeof _0x210496[_0x6e58('0x1c')]==='undefined';var _0x3d616a=_0x207dee[_0x6e58('0x1d')];var _0x3a0135=_0x398d10?0x0:_0x210496['offset'];var _0x83fb47=_0x398d10?_0x207dee['count']:_0x210496[_0x6e58('0x1e')]+_0x210496[_0x6e58('0x1c')];var _0x44cab0;if(_0x83fb47>=_0x3d616a){_0x83fb47=_0x3d616a;_0x44cab0=0xc8;}else{_0x44cab0=0xce;}_0x2a9a38[_0x6e58('0x19')](_0x44cab0);return _0x2a9a38[_0x6e58('0x1f')](_0x6e58('0x20'),_0x3a0135+'-'+_0x83fb47+'/'+_0x3d616a)[_0x6e58('0x1a')](_0x207dee);}return null;};}function patchUpdates(_0x239c50){return function(_0xbf9527){try{jsonpatch[_0x6e58('0x21')](_0xbf9527,_0x239c50,!![]);}catch(_0x34e5ee){return BPromise[_0x6e58('0x22')](_0x34e5ee);}return _0xbf9527[_0x6e58('0x23')]();};}function saveUpdates(_0x4b68e4,_0x360252){return function(_0x372b45){if(_0x372b45){return _0x372b45[_0x6e58('0x24')](_0x4b68e4)[_0x6e58('0x25')](function(_0x4f0ff8){return _0x4f0ff8;});}return null;};}function removeEntity(_0x9fb61f,_0x55b0c2){return function(_0x2776eb){if(_0x2776eb){return _0x2776eb['destroy']()[_0x6e58('0x25')](function(){_0x9fb61f['status'](0xcc)[_0x6e58('0x26')]();});}};}function handleEntityNotFound(_0x269167,_0x393bca){return function(_0x375687){if(!_0x375687){_0x269167[_0x6e58('0x27')](0x194);}return _0x375687;};}function handleError(_0x3655b9,_0x4d8217){_0x4d8217=_0x4d8217||0x1f4;return function(_0x30cd76){logger['error'](_0x30cd76['stack']);if(_0x30cd76['name']){delete _0x30cd76[_0x6e58('0x28')];}_0x3655b9['status'](_0x4d8217)[_0x6e58('0x29')](_0x30cd76);};}exports[_0x6e58('0x2a')]=function(_0x3ca731,_0x279085){var _0x293483={},_0xc26b5f={},_0x366c7a={'count':0x0,'rows':[]};var _0x1da589=_[_0x6e58('0x2b')](db[_0x6e58('0x2c')]['rawAttributes'],function(_0x33adaa){return{'name':_0x33adaa[_0x6e58('0x2d')],'type':_0x33adaa['type'][_0x6e58('0x2e')]};});_0xc26b5f[_0x6e58('0x2f')]=_[_0x6e58('0x2b')](_0x1da589,_0x6e58('0x28'));_0xc26b5f[_0x6e58('0x30')]=_[_0x6e58('0x31')](_0x3ca731[_0x6e58('0x30')]);_0xc26b5f['filters']=_[_0x6e58('0x32')](_0xc26b5f[_0x6e58('0x2f')],_0xc26b5f['query']);_0x293483[_0x6e58('0x33')]=_[_0x6e58('0x32')](_0xc26b5f[_0x6e58('0x2f')],qs[_0x6e58('0x34')](_0x3ca731[_0x6e58('0x30')]['fields']));_0x293483[_0x6e58('0x33')]=_0x293483['attributes'][_0x6e58('0x35')]?_0x293483[_0x6e58('0x33')]:_0xc26b5f['model'];if(!_0x3ca731['query'][_0x6e58('0x36')](_0x6e58('0x37'))){_0x293483[_0x6e58('0x1c')]=qs['limit'](_0x3ca731[_0x6e58('0x30')]['limit']);_0x293483[_0x6e58('0x1e')]=qs[_0x6e58('0x1e')](_0x3ca731[_0x6e58('0x30')][_0x6e58('0x1e')]);}_0x293483[_0x6e58('0x38')]=qs['sort'](_0x3ca731[_0x6e58('0x30')][_0x6e58('0x39')]);_0x293483[_0x6e58('0x3a')]=qs[_0x6e58('0x3b')](_[_0x6e58('0x3c')](_0x3ca731[_0x6e58('0x30')],_0xc26b5f['filters']),_0x1da589);if(_0x3ca731['query']['filter']){_0x293483[_0x6e58('0x3a')]=_[_0x6e58('0x3d')](_0x293483[_0x6e58('0x3a')],{'$or':_[_0x6e58('0x2b')](_0x1da589,function(_0x533942){if(_0x533942[_0x6e58('0x3e')]!==_0x6e58('0x3f')){var _0x52ca60={};_0x52ca60[_0x533942[_0x6e58('0x28')]]={'$like':'%'+_0x3ca731[_0x6e58('0x30')]['filter']+'%'};return _0x52ca60;}})});}_0x293483=_[_0x6e58('0x3d')]({},_0x293483,_0x3ca731['options']);var _0x180477={'where':_0x293483[_0x6e58('0x3a')]};return db[_0x6e58('0x2c')][_0x6e58('0x1d')](_0x180477)[_0x6e58('0x25')](function(_0x3f93fd){_0x366c7a['count']=_0x3f93fd;if(_0x3ca731['query'][_0x6e58('0x40')]){_0x293483[_0x6e58('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x6e58('0x42')](_0x293483);})[_0x6e58('0x25')](function(_0x514299){_0x366c7a[_0x6e58('0x43')]=_0x514299;return _0x366c7a;})['then'](respondWithFilteredResult(_0x279085,_0x293483))[_0x6e58('0x44')](handleError(_0x279085,null));};exports[_0x6e58('0x45')]=function(_0xfc616e,_0x4de097){var _0x234bfd={'raw':![],'where':{'id':_0xfc616e['params']['id']}},_0x2f4aa1={};_0x2f4aa1[_0x6e58('0x2f')]=_[_0x6e58('0x31')](db[_0x6e58('0x2c')][_0x6e58('0x46')]);_0x2f4aa1['query']=_[_0x6e58('0x31')](_0xfc616e['query']);_0x2f4aa1[_0x6e58('0x3b')]=_[_0x6e58('0x32')](_0x2f4aa1[_0x6e58('0x2f')],_0x2f4aa1['query']);_0x234bfd[_0x6e58('0x33')]=_[_0x6e58('0x32')](_0x2f4aa1['model'],qs[_0x6e58('0x34')](_0xfc616e['query'][_0x6e58('0x34')]));_0x234bfd['attributes']=_0x234bfd[_0x6e58('0x33')][_0x6e58('0x35')]?_0x234bfd[_0x6e58('0x33')]:_0x2f4aa1[_0x6e58('0x2f')];if(_0xfc616e[_0x6e58('0x30')]['includeAll']){_0x234bfd[_0x6e58('0x41')]=[{'all':!![]}];}_0x234bfd=_[_0x6e58('0x3d')]({},_0x234bfd,_0xfc616e['options']);return db[_0x6e58('0x2c')]['find'](_0x234bfd)[_0x6e58('0x25')](handleEntityNotFound(_0x4de097,null))[_0x6e58('0x25')](respondWithResult(_0x4de097,null))[_0x6e58('0x44')](handleError(_0x4de097,null));};exports[_0x6e58('0x47')]=function(_0x83dd2f,_0x530820){return db[_0x6e58('0x2c')][_0x6e58('0x47')](_0x83dd2f['body'],{})['then'](respondWithResult(_0x530820,0xc9))['catch'](handleError(_0x530820,null));};exports[_0x6e58('0x24')]=function(_0xc21d6e,_0x585048){if(_0xc21d6e['body']['id']){delete _0xc21d6e[_0x6e58('0x48')]['id'];}return db['SugarcrmAccount'][_0x6e58('0x49')]({'where':{'id':_0xc21d6e[_0x6e58('0x4a')]['id']}})[_0x6e58('0x25')](handleEntityNotFound(_0x585048,null))[_0x6e58('0x25')](saveUpdates(_0xc21d6e[_0x6e58('0x48')],null))[_0x6e58('0x25')](respondWithResult(_0x585048,null))[_0x6e58('0x44')](handleError(_0x585048,null));};exports[_0x6e58('0x4b')]=function(_0x76a327,_0x27d139){return db[_0x6e58('0x2c')][_0x6e58('0x49')]({'where':{'id':_0x76a327[_0x6e58('0x4a')]['id']}})[_0x6e58('0x25')](handleEntityNotFound(_0x27d139,null))[_0x6e58('0x25')](removeEntity(_0x27d139,null))[_0x6e58('0x44')](handleError(_0x27d139,null));};exports['getConfigurations']=function(_0x3a2a9f,_0x7237e4,_0x1d99a2){var _0x4c9a9c={};var _0x660e0f={};var _0x38f467;var _0x4cf5bb;return db[_0x6e58('0x2c')]['findOne']({'where':{'id':_0x3a2a9f[_0x6e58('0x4a')]['id']}})[_0x6e58('0x25')](handleEntityNotFound(_0x7237e4,null))['then'](function(_0x3e449f){if(_0x3e449f){_0x38f467=_0x3e449f;_0x660e0f[_0x6e58('0x2f')]=_[_0x6e58('0x31')](db[_0x6e58('0x4c')][_0x6e58('0x46')]);_0x660e0f[_0x6e58('0x30')]=_[_0x6e58('0x31')](_0x3a2a9f[_0x6e58('0x30')]);_0x660e0f['filters']=_[_0x6e58('0x32')](_0x660e0f[_0x6e58('0x2f')],_0x660e0f[_0x6e58('0x30')]);_0x4c9a9c[_0x6e58('0x33')]=_[_0x6e58('0x32')](_0x660e0f['model'],qs[_0x6e58('0x34')](_0x3a2a9f[_0x6e58('0x30')]['fields']));_0x4c9a9c[_0x6e58('0x33')]=_0x4c9a9c[_0x6e58('0x33')][_0x6e58('0x35')]?_0x4c9a9c[_0x6e58('0x33')]:_0x660e0f[_0x6e58('0x2f')];_0x4c9a9c[_0x6e58('0x38')]=qs['sort'](_0x3a2a9f['query']['sort']);_0x4c9a9c[_0x6e58('0x3a')]=qs[_0x6e58('0x3b')](_[_0x6e58('0x3c')](_0x3a2a9f[_0x6e58('0x30')],_0x660e0f['filters']));if(_0x3a2a9f[_0x6e58('0x30')]['filter']){_0x4c9a9c[_0x6e58('0x3a')]=_[_0x6e58('0x3d')](_0x4c9a9c[_0x6e58('0x3a')],{'$or':_['map'](_0x4c9a9c[_0x6e58('0x33')],function(_0x34534d){var _0x330051={};_0x330051[_0x34534d]={'$like':'%'+_0x3a2a9f[_0x6e58('0x30')]['filter']+'%'};return _0x330051;})});}_0x4c9a9c=_[_0x6e58('0x3d')]({},_0x4c9a9c,_0x3a2a9f[_0x6e58('0x4d')]);return _0x38f467[_0x6e58('0x4e')](_0x4c9a9c);}})[_0x6e58('0x25')](function(_0x1797e0){if(_0x1797e0){_0x4cf5bb=_0x1797e0['length'];if(!_0x3a2a9f[_0x6e58('0x30')]['hasOwnProperty']('nolimit')){_0x4c9a9c[_0x6e58('0x1c')]=qs[_0x6e58('0x1c')](_0x3a2a9f[_0x6e58('0x30')]['limit']);_0x4c9a9c[_0x6e58('0x1e')]=qs[_0x6e58('0x1e')](_0x3a2a9f[_0x6e58('0x30')][_0x6e58('0x1e')]);}return _0x38f467['getConfigurations'](_0x4c9a9c);}})['then'](function(_0x3fe7d1){if(_0x3fe7d1){return _0x3fe7d1?{'count':_0x4cf5bb,'rows':_0x3fe7d1}:null;}})[_0x6e58('0x25')](respondWithResult(_0x7237e4,null))[_0x6e58('0x44')](handleError(_0x7237e4,null));};exports['addConfiguration']=function(_0x335c6d,_0x330bf6,_0x106af3){if(_0x335c6d[_0x6e58('0x48')]['id']){delete _0x335c6d[_0x6e58('0x48')]['id'];}return db[_0x6e58('0x2c')]['findOne']({'where':{'id':_0x335c6d[_0x6e58('0x4a')]['id']}})[_0x6e58('0x25')](handleEntityNotFound(_0x330bf6,null))[_0x6e58('0x25')](function(_0x3a57d5){if(_0x3a57d5){_0x335c6d[_0x6e58('0x48')][_0x6e58('0x4f')]=_0x3a57d5['id'];_0x335c6d['body'][_0x6e58('0x50')]=integrations[_0x6e58('0x51')](_0x335c6d[_0x6e58('0x48')][_0x6e58('0x52')],_0x335c6d[_0x6e58('0x48')][_0x6e58('0x3e')]);_0x335c6d[_0x6e58('0x48')]['Descriptions']=integrations['getDescriptions'](_0x335c6d[_0x6e58('0x48')][_0x6e58('0x52')],_0x335c6d[_0x6e58('0x48')][_0x6e58('0x3e')]);return db['SugarcrmConfiguration'][_0x6e58('0x47')](_0x335c6d['body'],{'include':[{'model':db[_0x6e58('0x53')],'as':_0x6e58('0x50')},{'model':db[_0x6e58('0x53')],'as':'Descriptions'}]});}return null;})[_0x6e58('0x25')](respondWithResult(_0x330bf6,null))[_0x6e58('0x44')](handleError(_0x330bf6,null));};exports[_0x6e58('0x54')]=function(_0x2fb5ef,_0x1438e3,_0x3ed7e6){var _0x10cd7c='';var _0x2e434f=['id',_0x6e58('0x28'),_0x6e58('0x55'),_0x6e58('0x56'),_0x6e58('0x57'),_0x6e58('0x58'),_0x6e58('0x59'),_0x6e58('0x5a'),_0x6e58('0x5b'),_0x6e58('0x5c'),_0x6e58('0x5d'),'direction'];return db[_0x6e58('0x2c')][_0x6e58('0x5e')]({'where':{'id':_0x2fb5ef[_0x6e58('0x4a')]['id']},'attributes':['id',_0x6e58('0x5f'),_0x6e58('0x60'),_0x6e58('0x61')]})[_0x6e58('0x25')](handleEntityNotFound(_0x1438e3,null))[_0x6e58('0x25')](function(_0x12e065){if(_0x12e065){_0x10cd7c=_0x12e065[_0x6e58('0x61')];var _0x789ca6=_0x10cd7c['slice'](-0x1);if(_0x789ca6==='/'){_0x10cd7c=_0x10cd7c[_0x6e58('0x62')](0x0,_0x10cd7c[_0x6e58('0x63')](_0x789ca6));}return rp({'method':'POST','uri':util['format'](_0x6e58('0x64'),_0x10cd7c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x6e58('0x65'),'rest_data':JSON[_0x6e58('0x66')]({'user_auth':{'user_name':_0x12e065[_0x6e58('0x5f')],'password':_0x12e065['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0xc6885a){if(_0xc6885a&&_0xc6885a['name']!==_0x6e58('0x67')&&_0xc6885a[_0x6e58('0x28')]!==_0x6e58('0x68')){return rp({'method':_0x6e58('0x69'),'uri':util[_0x6e58('0x6a')](_0x6e58('0x64'),_0x10cd7c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x6e58('0x65'),'response_type':'JSON','rest_data':JSON[_0x6e58('0x66')]({'session':_0xc6885a['id'],'module_name':_0x6e58('0x6b')})}})[_0x6e58('0x25')](function(_0x55c989){if(_0x55c989){var _0x339cca=_[_0x6e58('0x6c')](_0x55c989[_0x6e58('0x6d')]);_[_0x6e58('0x6e')](_0x339cca,function(_0x594190){return _0x2e434f['includes'](_0x594190[_0x6e58('0x28')]);});return{'count':_0x339cca[_0x6e58('0x35')],'rows':_[_0x6e58('0x2b')](_0x339cca,function(_0x3a5cd0){return{'id':_0x3a5cd0[_0x6e58('0x28')],'name':_0x3a5cd0[_0x6e58('0x6f')],'custom':_[_0x6e58('0x70')](_0x3a5cd0[_0x6e58('0x28')],'_c')?!![]:![],'options':_0x3a5cd0[_0x6e58('0x4d')]?_['map'](_['values'](_0x3a5cd0[_0x6e58('0x4d')]),function(_0x52d6c6){return{'name':_0x52d6c6[_0x6e58('0x71')],'value':_0x52d6c6[_0x6e58('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x1438e3,null))[_0x6e58('0x44')](function(_0x3d10b7){var _0x17079b=_0x2fb5ef[_0x6e58('0x30')][_0x6e58('0x72')]?0x1f4:_0x3d10b7[_0x6e58('0x73')]||0x1f4;logger[_0x6e58('0x74')](_0x6e58('0x75'),_0x6e58('0x54'),_0x17079b,JSON['stringify'](_0x3d10b7));delete _0x3d10b7[_0x6e58('0x28')];if(_0x17079b===0x191){_0x17079b=0x190;}_0x1438e3[_0x6e58('0x19')](_0x17079b)[_0x6e58('0x29')](_0x2fb5ef[_0x6e58('0x30')]['test']?{'message':_0x6e58('0x76'),'statusCode':_0x3d10b7[_0x6e58('0x73')]}:_0x3d10b7);});}else{var _0x5b21ad=0x1f4;_0x1438e3['status'](_0x5b21ad)['send']({'message':_0x6e58('0x76'),'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 f3dc1b5..ed3659c 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 _0x52c4=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount'];(function(_0x105760,_0x4c2c93){var _0x3a8477=function(_0xe5d355){while(--_0xe5d355){_0x105760['push'](_0x105760['shift']());}};_0x3a8477(++_0x4c2c93);}(_0x52c4,0x1b1));var _0x452c=function(_0x26a026,_0x2b5b07){_0x26a026=_0x26a026-0x0;var _0x2ff357=_0x52c4[_0x26a026];return _0x2ff357;};'use strict';var _=require(_0x452c('0x0'));var util=require(_0x452c('0x1'));var logger=require(_0x452c('0x2'))(_0x452c('0x3'));var moment=require(_0x452c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x452c('0x5'));var rimraf=require(_0x452c('0x6'));var config=require(_0x452c('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x452c('0x8'));module[_0x452c('0x9')]=function(_0x50aa40,_0x3b4519){return _0x50aa40['define'](_0x452c('0xa'),attributes,{'tableName':_0x452c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa805=['util','../../config/logger','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts'];(function(_0x42bf36,_0x1a5870){var _0x1f0a4e=function(_0x1119b9){while(--_0x1119b9){_0x42bf36['push'](_0x42bf36['shift']());}};_0x1f0a4e(++_0x1a5870);}(_0xa805,0xb4));var _0x5a80=function(_0x11a6c0,_0x521a7c){_0x11a6c0=_0x11a6c0-0x0;var _0x38cb8b=_0xa805[_0x11a6c0];return _0x38cb8b;};'use strict';var _=require('lodash');var util=require(_0x5a80('0x0'));var logger=require(_0x5a80('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a80('0x2'));var rimraf=require(_0x5a80('0x3'));var config=require(_0x5a80('0x4'));var attributes=require(_0x5a80('0x5'));var integrations=require(_0x5a80('0x6'));module[_0x5a80('0x7')]=function(_0xbedc31,_0xa31ce2){return _0xbedc31[_0x5a80('0x8')]('SugarcrmAccount',attributes,{'tableName':_0x5a80('0x9'),'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 995eb9f..e1aacc3 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 _0x0f56=['rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','SugarcrmAccount','findAll','raw','options','attributes','model','map','include','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x27ef43,_0x2643a6){var _0x14e648=function(_0x53cae5){while(--_0x53cae5){_0x27ef43['push'](_0x27ef43['shift']());}};_0x14e648(++_0x2643a6);}(_0x0f56,0x121));var _0x60f5=function(_0x4bc3db,_0x40c671){_0x4bc3db=_0x4bc3db-0x0;var _0x20d44e=_0x0f56[_0x4bc3db];return _0x20d44e;};'use strict';var _=require(_0x60f5('0x0'));var util=require(_0x60f5('0x1'));var moment=require(_0x60f5('0x2'));var BPromise=require(_0x60f5('0x3'));var rs=require(_0x60f5('0x4'));var fs=require('fs');var Redis=require(_0x60f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x60f5('0x6'));var logger=require(_0x60f5('0x7'))(_0x60f5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x60f5('0x9')][_0x60f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d65c7,_0x29b9b9,_0xedea32){return new BPromise(function(_0x27f678,_0x5ece8f){return client[_0x60f5('0xb')](_0x2d65c7,_0xedea32)[_0x60f5('0xc')](function(_0x2515fa){logger[_0x60f5('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x29b9b9,_0x60f5('0xe'));logger[_0x60f5('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x29b9b9,'request\x20sent',JSON[_0x60f5('0x10')](_0x2515fa));if(_0x2515fa[_0x60f5('0x11')]){if(_0x2515fa['error']['code']===0x1f4){logger[_0x60f5('0x11')](_0x60f5('0x12'),_0x29b9b9,_0x2515fa[_0x60f5('0x11')][_0x60f5('0x13')]);return _0x5ece8f(_0x2515fa[_0x60f5('0x11')][_0x60f5('0x13')]);}logger[_0x60f5('0x11')](_0x60f5('0x12'),_0x29b9b9,_0x2515fa[_0x60f5('0x11')][_0x60f5('0x13')]);return _0x27f678(_0x2515fa['error'][_0x60f5('0x13')]);}else{logger[_0x60f5('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x29b9b9,_0x60f5('0xe'));_0x27f678(_0x2515fa[_0x60f5('0x14')][_0x60f5('0x13')]);}})[_0x60f5('0x15')](function(_0x35bee4){logger[_0x60f5('0x11')](_0x60f5('0x12'),_0x29b9b9,_0x35bee4);_0x5ece8f(_0x35bee4);});});}exports['GetSugarcrmAccount']=function(_0x440d1a){var _0x1506a6=this;return new Promise(function(_0x384e79,_0x606921){return db[_0x60f5('0x16')][_0x60f5('0x17')]({'raw':_0x440d1a['options']?_0x440d1a['options'][_0x60f5('0x18')]===undefined?!![]:![]:!![],'where':_0x440d1a[_0x60f5('0x19')]?_0x440d1a[_0x60f5('0x19')]['where']||null:null,'attributes':_0x440d1a['options']?_0x440d1a[_0x60f5('0x19')][_0x60f5('0x1a')]||null:null,'limit':_0x440d1a[_0x60f5('0x19')]?_0x440d1a['options']['limit']||null:null,'include':_0x440d1a[_0x60f5('0x19')]?_0x440d1a['options']['include']?_['map'](_0x440d1a[_0x60f5('0x19')]['include'],function(_0xb01e4a){return{'model':db[_0xb01e4a[_0x60f5('0x1b')]],'as':_0xb01e4a['as'],'attributes':_0xb01e4a[_0x60f5('0x1a')],'include':_0xb01e4a['include']?_[_0x60f5('0x1c')](_0xb01e4a[_0x60f5('0x1d')],function(_0x2cf6de){return{'model':db[_0x2cf6de[_0x60f5('0x1b')]],'as':_0x2cf6de['as'],'attributes':_0x2cf6de[_0x60f5('0x1a')],'include':_0x2cf6de['include']?_[_0x60f5('0x1c')](_0x2cf6de['include'],function(_0x57c621){return{'model':db[_0x57c621[_0x60f5('0x1b')]],'as':_0x57c621['as'],'attributes':_0x57c621[_0x60f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x60f5('0xc')](function(_0x4beced){logger[_0x60f5('0xd')]('GetSugarcrmAccount',_0x440d1a);logger[_0x60f5('0xf')](_0x60f5('0x1e'),_0x440d1a,JSON[_0x60f5('0x10')](_0x4beced));_0x384e79(_0x4beced);})[_0x60f5('0x15')](function(_0x2b5235){logger[_0x60f5('0x11')](_0x60f5('0x1e'),_0x2b5235[_0x60f5('0x13')],_0x440d1a);_0x606921(_0x1506a6[_0x60f5('0x11')](0x1f4,_0x2b5235[_0x60f5('0x13')]));});});};exports[_0x60f5('0x1f')]=function(_0x4359a2){var _0x884e03=this;return new Promise(function(_0x32f800,_0x36d6d0){return db[_0x60f5('0x16')][_0x60f5('0x20')]({'raw':_0x4359a2[_0x60f5('0x19')]?_0x4359a2[_0x60f5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4359a2[_0x60f5('0x19')]?_0x4359a2[_0x60f5('0x19')]['where']||null:null,'attributes':_0x4359a2[_0x60f5('0x19')]?_0x4359a2[_0x60f5('0x19')][_0x60f5('0x1a')]||null:null,'include':_0x4359a2[_0x60f5('0x19')]?_0x4359a2[_0x60f5('0x19')][_0x60f5('0x1d')]?_['map'](_0x4359a2[_0x60f5('0x19')]['include'],function(_0x4f38f3){return{'model':db[_0x4f38f3['model']],'as':_0x4f38f3['as'],'attributes':_0x4f38f3['attributes'],'include':_0x4f38f3['include']?_['map'](_0x4f38f3['include'],function(_0x16ddbd){return{'model':db[_0x16ddbd[_0x60f5('0x1b')]],'as':_0x16ddbd['as'],'attributes':_0x16ddbd['attributes'],'include':_0x16ddbd['include']?_[_0x60f5('0x1c')](_0x16ddbd['include'],function(_0x5b5e22){return{'model':db[_0x5b5e22[_0x60f5('0x1b')]],'as':_0x5b5e22['as'],'attributes':_0x5b5e22[_0x60f5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f8822){logger[_0x60f5('0xd')](_0x60f5('0x1f'),_0x4359a2);logger['debug']('ShowSugarcrmAccount',_0x4359a2,JSON['stringify'](_0x4f8822));_0x32f800(_0x4f8822);})[_0x60f5('0x15')](function(_0x595267){logger[_0x60f5('0x11')](_0x60f5('0x1f'),_0x595267[_0x60f5('0x13')],_0x4359a2);_0x36d6d0(_0x884e03[_0x60f5('0x11')](0x1f4,_0x595267[_0x60f5('0x13')]));});});}; \ No newline at end of file +var _0x50da=['jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','model','ShowSugarcrmAccount','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x50da,0x1b2));var _0xa50d=function(_0x176c78,_0x42f9ec){_0x176c78=_0x176c78-0x0;var _0x30ef3e=_0x50da[_0x176c78];return _0x30ef3e;};'use strict';var _=require(_0xa50d('0x0'));var util=require(_0xa50d('0x1'));var moment=require(_0xa50d('0x2'));var BPromise=require(_0xa50d('0x3'));var rs=require(_0xa50d('0x4'));var fs=require('fs');var Redis=require(_0xa50d('0x5'));var db=require(_0xa50d('0x6'))['db'];var utils=require(_0xa50d('0x7'));var logger=require('../../config/logger')(_0xa50d('0x8'));var config=require(_0xa50d('0x9'));var jayson=require(_0xa50d('0xa'));var client=jayson[_0xa50d('0xb')][_0xa50d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x56f59e,_0x2961a8,_0x309b95){return new BPromise(function(_0x43305a,_0x5742d3){return client[_0xa50d('0xd')](_0x56f59e,_0x309b95)[_0xa50d('0xe')](function(_0x46b9cc){logger[_0xa50d('0xf')](_0xa50d('0x10'),_0x2961a8,_0xa50d('0x11'));logger[_0xa50d('0x12')](_0xa50d('0x13'),_0x2961a8,'request\x20sent',JSON[_0xa50d('0x14')](_0x46b9cc));if(_0x46b9cc[_0xa50d('0x15')]){if(_0x46b9cc[_0xa50d('0x15')]['code']===0x1f4){logger[_0xa50d('0x15')](_0xa50d('0x10'),_0x2961a8,_0x46b9cc[_0xa50d('0x15')][_0xa50d('0x16')]);return _0x5742d3(_0x46b9cc['error'][_0xa50d('0x16')]);}logger[_0xa50d('0x15')](_0xa50d('0x10'),_0x2961a8,_0x46b9cc[_0xa50d('0x15')][_0xa50d('0x16')]);return _0x43305a(_0x46b9cc[_0xa50d('0x15')][_0xa50d('0x16')]);}else{logger[_0xa50d('0xf')](_0xa50d('0x10'),_0x2961a8,'request\x20sent');_0x43305a(_0x46b9cc[_0xa50d('0x17')]['message']);}})[_0xa50d('0x18')](function(_0x2ae6d4){logger[_0xa50d('0x15')](_0xa50d('0x10'),_0x2961a8,_0x2ae6d4);_0x5742d3(_0x2ae6d4);});});}exports[_0xa50d('0x19')]=function(_0x5c56c7){var _0x35099b=this;return new Promise(function(_0x21c62f,_0x2ed163){return db[_0xa50d('0x1a')][_0xa50d('0x1b')]({'raw':_0x5c56c7[_0xa50d('0x1c')]?_0x5c56c7[_0xa50d('0x1c')][_0xa50d('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c56c7[_0xa50d('0x1c')]?_0x5c56c7[_0xa50d('0x1c')][_0xa50d('0x1e')]||null:null,'attributes':_0x5c56c7[_0xa50d('0x1c')]?_0x5c56c7[_0xa50d('0x1c')][_0xa50d('0x1f')]||null:null,'limit':_0x5c56c7['options']?_0x5c56c7['options']['limit']||null:null,'include':_0x5c56c7[_0xa50d('0x1c')]?_0x5c56c7[_0xa50d('0x1c')][_0xa50d('0x20')]?_['map'](_0x5c56c7['options']['include'],function(_0x235e02){return{'model':db[_0x235e02[_0xa50d('0x21')]],'as':_0x235e02['as'],'attributes':_0x235e02[_0xa50d('0x1f')],'include':_0x235e02['include']?_['map'](_0x235e02[_0xa50d('0x20')],function(_0x1f513c){return{'model':db[_0x1f513c[_0xa50d('0x21')]],'as':_0x1f513c['as'],'attributes':_0x1f513c[_0xa50d('0x1f')],'include':_0x1f513c[_0xa50d('0x20')]?_['map'](_0x1f513c[_0xa50d('0x20')],function(_0x59b4c9){return{'model':db[_0x59b4c9['model']],'as':_0x59b4c9['as'],'attributes':_0x59b4c9[_0xa50d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c85bd){logger[_0xa50d('0xf')](_0xa50d('0x19'),_0x5c56c7);logger[_0xa50d('0x12')](_0xa50d('0x19'),_0x5c56c7,JSON['stringify'](_0x1c85bd));_0x21c62f(_0x1c85bd);})['catch'](function(_0x311ada){logger[_0xa50d('0x15')](_0xa50d('0x19'),_0x311ada[_0xa50d('0x16')],_0x5c56c7);_0x2ed163(_0x35099b['error'](0x1f4,_0x311ada[_0xa50d('0x16')]));});});};exports[_0xa50d('0x22')]=function(_0x4280b7){var _0x4c802f=this;return new Promise(function(_0x47c5e3,_0x4fbcc0){return db[_0xa50d('0x1a')][_0xa50d('0x23')]({'raw':_0x4280b7[_0xa50d('0x1c')]?_0x4280b7['options'][_0xa50d('0x1d')]===undefined?!![]:![]:!![],'where':_0x4280b7[_0xa50d('0x1c')]?_0x4280b7[_0xa50d('0x1c')][_0xa50d('0x1e')]||null:null,'attributes':_0x4280b7[_0xa50d('0x1c')]?_0x4280b7[_0xa50d('0x1c')][_0xa50d('0x1f')]||null:null,'include':_0x4280b7[_0xa50d('0x1c')]?_0x4280b7[_0xa50d('0x1c')][_0xa50d('0x20')]?_[_0xa50d('0x24')](_0x4280b7['options'][_0xa50d('0x20')],function(_0x18a59c){return{'model':db[_0x18a59c[_0xa50d('0x21')]],'as':_0x18a59c['as'],'attributes':_0x18a59c[_0xa50d('0x1f')],'include':_0x18a59c['include']?_['map'](_0x18a59c[_0xa50d('0x20')],function(_0x530d0c){return{'model':db[_0x530d0c[_0xa50d('0x21')]],'as':_0x530d0c['as'],'attributes':_0x530d0c[_0xa50d('0x1f')],'include':_0x530d0c[_0xa50d('0x20')]?_['map'](_0x530d0c[_0xa50d('0x20')],function(_0xbaa5f6){return{'model':db[_0xbaa5f6[_0xa50d('0x21')]],'as':_0xbaa5f6['as'],'attributes':_0xbaa5f6[_0xa50d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa50d('0xe')](function(_0x53f647){logger[_0xa50d('0xf')](_0xa50d('0x22'),_0x4280b7);logger[_0xa50d('0x12')](_0xa50d('0x22'),_0x4280b7,JSON[_0xa50d('0x14')](_0x53f647));_0x47c5e3(_0x53f647);})[_0xa50d('0x18')](function(_0x3ea845){logger['error'](_0xa50d('0x22'),_0x3ea845[_0xa50d('0x16')],_0x4280b7);_0x4fbcc0(_0x4c802f['error'](0x1f4,_0x3ea845[_0xa50d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8f54f41..02faa69 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 _0x4bc0=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2bce42,_0xd429b9){var _0x158ade=function(_0x5057b1){while(--_0x5057b1){_0x2bce42['push'](_0x2bce42['shift']());}};_0x158ade(++_0xd429b9);}(_0x4bc0,0x13b));var _0x04bc=function(_0x2b1029,_0x19920a){_0x2b1029=_0x2b1029-0x0;var _0x1ae1b9=_0x4bc0[_0x2b1029];return _0x1ae1b9;};'use strict';var multer=require(_0x04bc('0x0'));var util=require(_0x04bc('0x1'));var path=require(_0x04bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x04bc('0x3'));var router=express[_0x04bc('0x4')]();var fs_extra=require(_0x04bc('0x5'));var auth=require(_0x04bc('0x6'));var interaction=require(_0x04bc('0x7'));var config=require(_0x04bc('0x8'));var controller=require(_0x04bc('0x9'));router[_0x04bc('0xa')]('/',auth[_0x04bc('0xb')](),controller[_0x04bc('0xc')]);router[_0x04bc('0xa')](_0x04bc('0xd'),auth[_0x04bc('0xb')](),controller[_0x04bc('0xe')]);router[_0x04bc('0xa')]('/:id/fields',auth[_0x04bc('0xb')](),controller[_0x04bc('0xf')]);router['get'](_0x04bc('0x10'),auth[_0x04bc('0xb')](),controller[_0x04bc('0x11')]);router[_0x04bc('0xa')](_0x04bc('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x04bc('0xb')](),controller[_0x04bc('0x13')]);router['put']('/:id',auth[_0x04bc('0xb')](),controller[_0x04bc('0x14')]);router[_0x04bc('0x15')](_0x04bc('0xd'),auth['isAuthenticated'](),controller[_0x04bc('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4baf=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xe50651,_0x78b476){var _0xc8931c=function(_0x1c2902){while(--_0x1c2902){_0xe50651['push'](_0xe50651['shift']());}};_0xc8931c(++_0x78b476);}(_0x4baf,0xb8));var _0xf4ba=function(_0x3f97e0,_0xf16a13){_0x3f97e0=_0x3f97e0-0x0;var _0xae4294=_0x4baf[_0x3f97e0];return _0xae4294;};'use strict';var multer=require(_0xf4ba('0x0'));var util=require(_0xf4ba('0x1'));var path=require(_0xf4ba('0x2'));var timeout=require(_0xf4ba('0x3'));var express=require(_0xf4ba('0x4'));var router=express[_0xf4ba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf4ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf4ba('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xf4ba('0x8')]('/',auth[_0xf4ba('0x9')](),controller[_0xf4ba('0xa')]);router[_0xf4ba('0x8')]('/:id',auth[_0xf4ba('0x9')](),controller[_0xf4ba('0xb')]);router['get']('/:id/fields',auth[_0xf4ba('0x9')](),controller[_0xf4ba('0xc')]);router['get'](_0xf4ba('0xd'),auth[_0xf4ba('0x9')](),controller[_0xf4ba('0xe')]);router[_0xf4ba('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf4ba('0xf')]);router['post']('/',auth[_0xf4ba('0x9')](),controller['create']);router['put'](_0xf4ba('0x10'),auth[_0xf4ba('0x9')](),controller[_0xf4ba('0x11')]);router[_0xf4ba('0x12')](_0xf4ba('0x10'),auth['isAuthenticated'](),controller[_0xf4ba('0x13')]);module[_0xf4ba('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 499bf02..f9b6a97 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 _0x45cc=['exports','STRING','sequelize'];(function(_0x592c8e,_0x4a9b9d){var _0x4ac1d9=function(_0x5e6306){while(--_0x5e6306){_0x592c8e['push'](_0x592c8e['shift']());}};_0x4ac1d9(++_0x4a9b9d);}(_0x45cc,0x83));var _0xc45c=function(_0x502773,_0xe55d92){_0x502773=_0x502773-0x0;var _0x568f34=_0x45cc[_0x502773];return _0x568f34;};'use strict';var Sequelize=require(_0xc45c('0x0'));module[_0xc45c('0x1')]={'name':{'type':Sequelize[_0xc45c('0x2')]},'description':{'type':Sequelize[_0xc45c('0x2')]}}; \ No newline at end of file +var _0xb105=['exports','STRING','sequelize'];(function(_0x50f509,_0xcef389){var _0x4f4dba=function(_0x4a1852){while(--_0x4a1852){_0x50f509['push'](_0x50f509['shift']());}};_0x4f4dba(++_0xcef389);}(_0xb105,0x13d));var _0x5b10=function(_0x3f8568,_0x3e3cd7){_0x3f8568=_0x3f8568-0x0;var _0x18c5ae=_0xb105[_0x3f8568];return _0x18c5ae;};'use strict';var Sequelize=require(_0x5b10('0x0'));module[_0x5b10('0x1')]={'name':{'type':Sequelize[_0x5b10('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 53ce458..3e36b72 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 _0xd17e=['undefined','set','Content-Range','reject','update','then','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','findAll','rows','catch','show','params','fields','includeAll','include','body','find','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x4ac584,_0x137322){var _0x3b3b57=function(_0x45b4a1){while(--_0x45b4a1){_0x4ac584['push'](_0x4ac584['shift']());}};_0x3b3b57(++_0x137322);}(_0xd17e,0x1d2));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xed17('0x0'));var rimraf=require(_0xed17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed17('0x2'));var rp=require(_0xed17('0x3'));var moment=require(_0xed17('0x4'));var BPromise=require(_0xed17('0x5'));var Mustache=require(_0xed17('0x6'));var util=require(_0xed17('0x7'));var path=require(_0xed17('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed17('0x9'));var fs=require('fs');var fs_extra=require(_0xed17('0xa'));var _=require(_0xed17('0xb'));var squel=require(_0xed17('0xc'));var crypto=require(_0xed17('0xd'));var jsforce=require(_0xed17('0xe'));var deskjs=require(_0xed17('0xf'));var toCsv=require(_0xed17('0x10'));var querystring=require(_0xed17('0x11'));var Papa=require(_0xed17('0x12'));var Redis=require(_0xed17('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed17('0x14'));var hardwareService=require(_0xed17('0x15'));var logger=require(_0xed17('0x16'))(_0xed17('0x17'));var utils=require(_0xed17('0x18'));var config=require(_0xed17('0x19'));var licenseUtil=require(_0xed17('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c27cb,_0x5f3deb){_0x5f3deb=_0x5f3deb||0xcc;return function(_0x30ca62){if(_0x30ca62){return _0x2c27cb[_0xed17('0x1b')](_0x5f3deb);}return _0x2c27cb[_0xed17('0x1c')](_0x5f3deb)[_0xed17('0x1d')]();};}function respondWithResult(_0x32bbc2,_0x45ae28){_0x45ae28=_0x45ae28||0xc8;return function(_0x16fd6b){if(_0x16fd6b){return _0x32bbc2['status'](_0x45ae28)[_0xed17('0x1e')](_0x16fd6b);}};}function respondWithFilteredResult(_0x3b2b01,_0x4ae1d5){return function(_0x512612){if(_0x512612){var _0x1ef419=typeof _0x4ae1d5[_0xed17('0x1f')]==='undefined'&&typeof _0x4ae1d5['limit']===_0xed17('0x20');var _0x52cd45=_0x512612['count'];var _0x285d20=_0x1ef419?0x0:_0x4ae1d5[_0xed17('0x1f')];var _0x22e5bc=_0x1ef419?_0x512612['count']:_0x4ae1d5[_0xed17('0x1f')]+_0x4ae1d5['limit'];var _0x56644c;if(_0x22e5bc>=_0x52cd45){_0x22e5bc=_0x52cd45;_0x56644c=0xc8;}else{_0x56644c=0xce;}_0x3b2b01['status'](_0x56644c);return _0x3b2b01[_0xed17('0x21')](_0xed17('0x22'),_0x285d20+'-'+_0x22e5bc+'/'+_0x52cd45)[_0xed17('0x1e')](_0x512612);}return null;};}function patchUpdates(_0xaa8418){return function(_0x33986f){try{jsonpatch['apply'](_0x33986f,_0xaa8418,!![]);}catch(_0x26f78c){return BPromise[_0xed17('0x23')](_0x26f78c);}return _0x33986f['save']();};}function saveUpdates(_0x3d539a,_0x41c729){return function(_0x3d501d){if(_0x3d501d){return _0x3d501d[_0xed17('0x24')](_0x3d539a)['then'](function(_0x4e1eb3){return _0x4e1eb3;});}return null;};}function removeEntity(_0x4b38ec,_0x586db1){return function(_0x5408f5){if(_0x5408f5){return _0x5408f5['destroy']()[_0xed17('0x25')](function(){_0x4b38ec['status'](0xcc)[_0xed17('0x1d')]();});}};}function handleEntityNotFound(_0x2ee6bf,_0x358c30){return function(_0x1cf61b){if(!_0x1cf61b){_0x2ee6bf[_0xed17('0x1b')](0x194);}return _0x1cf61b;};}function handleError(_0x5529e1,_0x32b1e4){_0x32b1e4=_0x32b1e4||0x1f4;return function(_0x10e0e1){logger[_0xed17('0x26')](_0x10e0e1[_0xed17('0x27')]);if(_0x10e0e1[_0xed17('0x28')]){delete _0x10e0e1[_0xed17('0x28')];}_0x5529e1[_0xed17('0x1c')](_0x32b1e4)['send'](_0x10e0e1);};}exports[_0xed17('0x29')]=function(_0x13ae9a,_0x19b2b2){var _0x5627af={},_0xae83b2={},_0x1500db={'count':0x0,'rows':[]};var _0x7f9564=_[_0xed17('0x2a')](db[_0xed17('0x2b')][_0xed17('0x2c')],function(_0x319b5f){return{'name':_0x319b5f[_0xed17('0x2d')],'type':_0x319b5f[_0xed17('0x2e')][_0xed17('0x2f')]};});_0xae83b2[_0xed17('0x30')]=_[_0xed17('0x2a')](_0x7f9564,_0xed17('0x28'));_0xae83b2[_0xed17('0x31')]=_[_0xed17('0x32')](_0x13ae9a['query']);_0xae83b2[_0xed17('0x33')]=_[_0xed17('0x34')](_0xae83b2[_0xed17('0x30')],_0xae83b2[_0xed17('0x31')]);_0x5627af[_0xed17('0x35')]=_['intersection'](_0xae83b2[_0xed17('0x30')],qs['fields'](_0x13ae9a[_0xed17('0x31')]['fields']));_0x5627af['attributes']=_0x5627af[_0xed17('0x35')][_0xed17('0x36')]?_0x5627af[_0xed17('0x35')]:_0xae83b2['model'];if(!_0x13ae9a[_0xed17('0x31')][_0xed17('0x37')](_0xed17('0x38'))){_0x5627af[_0xed17('0x39')]=qs[_0xed17('0x39')](_0x13ae9a[_0xed17('0x31')]['limit']);_0x5627af['offset']=qs[_0xed17('0x1f')](_0x13ae9a[_0xed17('0x31')][_0xed17('0x1f')]);}_0x5627af[_0xed17('0x3a')]=qs['sort'](_0x13ae9a[_0xed17('0x31')][_0xed17('0x3b')]);_0x5627af[_0xed17('0x3c')]=qs[_0xed17('0x33')](_[_0xed17('0x3d')](_0x13ae9a[_0xed17('0x31')],_0xae83b2[_0xed17('0x33')]),_0x7f9564);if(_0x13ae9a['query']['filter']){_0x5627af[_0xed17('0x3c')]=_[_0xed17('0x3e')](_0x5627af[_0xed17('0x3c')],{'$or':_[_0xed17('0x2a')](_0x7f9564,function(_0x321b31){if(_0x321b31[_0xed17('0x2e')]!==_0xed17('0x3f')){var _0x558194={};_0x558194[_0x321b31[_0xed17('0x28')]]={'$like':'%'+_0x13ae9a[_0xed17('0x31')][_0xed17('0x40')]+'%'};return _0x558194;}})});}_0x5627af=_['merge']({},_0x5627af,_0x13ae9a[_0xed17('0x41')]);var _0x259b15={'where':_0x5627af[_0xed17('0x3c')]};return db[_0xed17('0x2b')][_0xed17('0x42')](_0x259b15)[_0xed17('0x25')](function(_0x33d2a3){_0x1500db['count']=_0x33d2a3;if(_0x13ae9a[_0xed17('0x31')]['includeAll']){_0x5627af['include']=[{'all':!![]}];}return db[_0xed17('0x2b')][_0xed17('0x43')](_0x5627af);})[_0xed17('0x25')](function(_0x4d8c76){_0x1500db[_0xed17('0x44')]=_0x4d8c76;return _0x1500db;})['then'](respondWithFilteredResult(_0x19b2b2,_0x5627af))[_0xed17('0x45')](handleError(_0x19b2b2,null));};exports[_0xed17('0x46')]=function(_0x1d1990,_0x4c2a74){var _0x2f09be={'raw':![],'where':{'id':_0x1d1990[_0xed17('0x47')]['id']}},_0x5e7b3c={};_0x5e7b3c[_0xed17('0x30')]=_[_0xed17('0x32')](db[_0xed17('0x2b')]['rawAttributes']);_0x5e7b3c[_0xed17('0x31')]=_[_0xed17('0x32')](_0x1d1990[_0xed17('0x31')]);_0x5e7b3c[_0xed17('0x33')]=_['intersection'](_0x5e7b3c[_0xed17('0x30')],_0x5e7b3c[_0xed17('0x31')]);_0x2f09be[_0xed17('0x35')]=_['intersection'](_0x5e7b3c[_0xed17('0x30')],qs[_0xed17('0x48')](_0x1d1990['query'][_0xed17('0x48')]));_0x2f09be[_0xed17('0x35')]=_0x2f09be[_0xed17('0x35')][_0xed17('0x36')]?_0x2f09be[_0xed17('0x35')]:_0x5e7b3c[_0xed17('0x30')];if(_0x1d1990[_0xed17('0x31')][_0xed17('0x49')]){_0x2f09be[_0xed17('0x4a')]=[{'all':!![]}];}_0x2f09be=_['merge']({},_0x2f09be,_0x1d1990[_0xed17('0x41')]);return db[_0xed17('0x2b')]['find'](_0x2f09be)['then'](handleEntityNotFound(_0x4c2a74,null))['then'](respondWithResult(_0x4c2a74,null))[_0xed17('0x45')](handleError(_0x4c2a74,null));};exports['create']=function(_0x476d86,_0x3561bd){return db[_0xed17('0x2b')]['create'](_0x476d86[_0xed17('0x4b')],{})['then'](respondWithResult(_0x3561bd,0xc9))['catch'](handleError(_0x3561bd,null));};exports[_0xed17('0x24')]=function(_0x5cbc5a,_0x3baa82){if(_0x5cbc5a[_0xed17('0x4b')]['id']){delete _0x5cbc5a['body']['id'];}return db['SugarcrmConfiguration'][_0xed17('0x4c')]({'where':{'id':_0x5cbc5a[_0xed17('0x47')]['id']}})[_0xed17('0x25')](handleEntityNotFound(_0x3baa82,null))[_0xed17('0x25')](saveUpdates(_0x5cbc5a[_0xed17('0x4b')],null))[_0xed17('0x25')](respondWithResult(_0x3baa82,null))[_0xed17('0x45')](handleError(_0x3baa82,null));};exports[_0xed17('0x4d')]=function(_0x5582a0,_0x350b2b){return db['SugarcrmConfiguration'][_0xed17('0x4c')]({'where':{'id':_0x5582a0['params']['id']}})['then'](handleEntityNotFound(_0x350b2b,null))[_0xed17('0x25')](removeEntity(_0x350b2b,null))[_0xed17('0x45')](handleError(_0x350b2b,null));};exports[_0xed17('0x4e')]=function(_0x69395f,_0x5f088a,_0x208f33){var _0x25a60e={};var _0x32888a={};var _0xbd6f93;var _0x517056;return db[_0xed17('0x2b')][_0xed17('0x4f')]({'where':{'id':_0x69395f[_0xed17('0x47')]['id']}})[_0xed17('0x25')](handleEntityNotFound(_0x5f088a,null))[_0xed17('0x25')](function(_0x7f7d4c){if(_0x7f7d4c){_0xbd6f93=_0x7f7d4c;_0x32888a['model']=_['keys'](db[_0xed17('0x50')]['rawAttributes']);_0x32888a[_0xed17('0x31')]=_['keys'](_0x69395f[_0xed17('0x31')]);_0x32888a[_0xed17('0x33')]=_[_0xed17('0x34')](_0x32888a[_0xed17('0x30')],_0x32888a['query']);_0x25a60e[_0xed17('0x35')]=_[_0xed17('0x34')](_0x32888a['model'],qs[_0xed17('0x48')](_0x69395f['query']['fields']));_0x25a60e[_0xed17('0x35')]=_0x25a60e[_0xed17('0x35')]['length']?_0x25a60e[_0xed17('0x35')]:_0x32888a[_0xed17('0x30')];_0x25a60e['order']=qs[_0xed17('0x3b')](_0x69395f['query']['sort']);_0x25a60e[_0xed17('0x3c')]=qs['filters'](_['pick'](_0x69395f[_0xed17('0x31')],_0x32888a[_0xed17('0x33')]));if(_0x69395f[_0xed17('0x31')][_0xed17('0x40')]){_0x25a60e['where']=_[_0xed17('0x3e')](_0x25a60e[_0xed17('0x3c')],{'$or':_[_0xed17('0x2a')](_0x25a60e[_0xed17('0x35')],function(_0x4e0227){var _0x5855d6={};_0x5855d6[_0x4e0227]={'$like':'%'+_0x69395f[_0xed17('0x31')][_0xed17('0x40')]+'%'};return _0x5855d6;})});}_0x25a60e=_[_0xed17('0x3e')]({},_0x25a60e,_0x69395f['options']);return _0xbd6f93[_0xed17('0x4e')](_0x25a60e);}})['then'](function(_0x738f79){if(_0x738f79){_0x517056=_0x738f79['length'];if(!_0x69395f[_0xed17('0x31')]['hasOwnProperty'](_0xed17('0x38'))){_0x25a60e[_0xed17('0x39')]=qs[_0xed17('0x39')](_0x69395f[_0xed17('0x31')]['limit']);_0x25a60e[_0xed17('0x1f')]=qs[_0xed17('0x1f')](_0x69395f[_0xed17('0x31')][_0xed17('0x1f')]);}return _0xbd6f93[_0xed17('0x4e')](_0x25a60e);}})[_0xed17('0x25')](function(_0x251458){if(_0x251458){return _0x251458?{'count':_0x517056,'rows':_0x251458}:null;}})['then'](respondWithResult(_0x5f088a,null))[_0xed17('0x45')](handleError(_0x5f088a,null));};exports['getSubjects']=function(_0x1b087b,_0xd6655a,_0x3fe07e){var _0x2cded5={};var _0x206db7={};var _0x43634f;var _0x46fdda;return db[_0xed17('0x2b')][_0xed17('0x4f')]({'where':{'id':_0x1b087b[_0xed17('0x47')]['id']}})[_0xed17('0x25')](handleEntityNotFound(_0xd6655a,null))[_0xed17('0x25')](function(_0x10b5b1){if(_0x10b5b1){_0x43634f=_0x10b5b1;_0x206db7[_0xed17('0x30')]=_[_0xed17('0x32')](db[_0xed17('0x50')][_0xed17('0x2c')]);_0x206db7[_0xed17('0x31')]=_[_0xed17('0x32')](_0x1b087b[_0xed17('0x31')]);_0x206db7[_0xed17('0x33')]=_[_0xed17('0x34')](_0x206db7[_0xed17('0x30')],_0x206db7[_0xed17('0x31')]);_0x2cded5[_0xed17('0x35')]=_['intersection'](_0x206db7[_0xed17('0x30')],qs[_0xed17('0x48')](_0x1b087b[_0xed17('0x31')][_0xed17('0x48')]));_0x2cded5[_0xed17('0x35')]=_0x2cded5[_0xed17('0x35')][_0xed17('0x36')]?_0x2cded5[_0xed17('0x35')]:_0x206db7[_0xed17('0x30')];_0x2cded5[_0xed17('0x3a')]=qs[_0xed17('0x3b')](_0x1b087b[_0xed17('0x31')]['sort']);_0x2cded5[_0xed17('0x3c')]=qs[_0xed17('0x33')](_['pick'](_0x1b087b['query'],_0x206db7[_0xed17('0x33')]));if(_0x1b087b['query']['filter']){_0x2cded5[_0xed17('0x3c')]=_['merge'](_0x2cded5[_0xed17('0x3c')],{'$or':_[_0xed17('0x2a')](_0x2cded5['attributes'],function(_0x105538){var _0x411cf4={};_0x411cf4[_0x105538]={'$like':'%'+_0x1b087b[_0xed17('0x31')][_0xed17('0x40')]+'%'};return _0x411cf4;})});}_0x2cded5=_[_0xed17('0x3e')]({},_0x2cded5,_0x1b087b['options']);return _0x43634f[_0xed17('0x51')](_0x2cded5);}})[_0xed17('0x25')](function(_0x39005d){if(_0x39005d){_0x46fdda=_0x39005d[_0xed17('0x36')];if(!_0x1b087b['query']['hasOwnProperty']('nolimit')){_0x2cded5[_0xed17('0x39')]=qs[_0xed17('0x39')](_0x1b087b[_0xed17('0x31')][_0xed17('0x39')]);_0x2cded5[_0xed17('0x1f')]=qs[_0xed17('0x1f')](_0x1b087b[_0xed17('0x31')][_0xed17('0x1f')]);}return _0x43634f['getSubjects'](_0x2cded5);}})[_0xed17('0x25')](function(_0x4bdb17){if(_0x4bdb17){return _0x4bdb17?{'count':_0x46fdda,'rows':_0x4bdb17}:null;}})['then'](respondWithResult(_0xd6655a,null))[_0xed17('0x45')](handleError(_0xd6655a,null));};exports[_0xed17('0x52')]=function(_0x547a8b,_0x5a66cd,_0x40e3af){var _0x508601={};var _0x1cc2eb={};var _0x18576d;var _0x4da0f5;return db[_0xed17('0x2b')]['findOne']({'where':{'id':_0x547a8b[_0xed17('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a66cd,null))[_0xed17('0x25')](function(_0x20a9f3){if(_0x20a9f3){_0x18576d=_0x20a9f3;_0x1cc2eb[_0xed17('0x30')]=_['keys'](db['SugarcrmField'][_0xed17('0x2c')]);_0x1cc2eb['query']=_[_0xed17('0x32')](_0x547a8b['query']);_0x1cc2eb[_0xed17('0x33')]=_[_0xed17('0x34')](_0x1cc2eb[_0xed17('0x30')],_0x1cc2eb['query']);_0x508601['attributes']=_[_0xed17('0x34')](_0x1cc2eb[_0xed17('0x30')],qs[_0xed17('0x48')](_0x547a8b[_0xed17('0x31')]['fields']));_0x508601[_0xed17('0x35')]=_0x508601['attributes'][_0xed17('0x36')]?_0x508601['attributes']:_0x1cc2eb[_0xed17('0x30')];_0x508601[_0xed17('0x3a')]=qs[_0xed17('0x3b')](_0x547a8b['query'][_0xed17('0x3b')]);_0x508601['where']=qs['filters'](_[_0xed17('0x3d')](_0x547a8b[_0xed17('0x31')],_0x1cc2eb[_0xed17('0x33')]));if(_0x547a8b['query'][_0xed17('0x40')]){_0x508601[_0xed17('0x3c')]=_[_0xed17('0x3e')](_0x508601[_0xed17('0x3c')],{'$or':_[_0xed17('0x2a')](_0x508601[_0xed17('0x35')],function(_0x1c27df){var _0x2b5f7c={};_0x2b5f7c[_0x1c27df]={'$like':'%'+_0x547a8b[_0xed17('0x31')][_0xed17('0x40')]+'%'};return _0x2b5f7c;})});}_0x508601=_['merge']({},_0x508601,_0x547a8b['options']);return _0x18576d[_0xed17('0x52')](_0x508601);}})['then'](function(_0x4dfd7c){if(_0x4dfd7c){_0x4da0f5=_0x4dfd7c[_0xed17('0x36')];if(!_0x547a8b[_0xed17('0x31')][_0xed17('0x37')]('nolimit')){_0x508601[_0xed17('0x39')]=qs[_0xed17('0x39')](_0x547a8b[_0xed17('0x31')][_0xed17('0x39')]);_0x508601[_0xed17('0x1f')]=qs[_0xed17('0x1f')](_0x547a8b[_0xed17('0x31')]['offset']);}return _0x18576d[_0xed17('0x52')](_0x508601);}})[_0xed17('0x25')](function(_0x49fd3b){if(_0x49fd3b){return _0x49fd3b?{'count':_0x4da0f5,'rows':_0x49fd3b}:null;}})[_0xed17('0x25')](respondWithResult(_0x5a66cd,null))[_0xed17('0x45')](handleError(_0x5a66cd,null));}; \ No newline at end of file +var _0x29c9=['status','end','undefined','limit','count','offset','set','Content-Range','json','reject','then','destroy','sendStatus','stack','send','index','rawAttributes','fieldName','map','name','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','include','SugarcrmConfiguration','findAll','rows','catch','show','params','includeAll','find','create','body','update','getFields','findOne','order','pick','hasOwnProperty','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x29c9,0x1d2));var _0x929c=function(_0x409b0f,_0x25936f){_0x409b0f=_0x409b0f-0x0;var _0x2054ba=_0x29c9[_0x409b0f];return _0x2054ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x929c('0x0'));var zipdir=require(_0x929c('0x1'));var jsonpatch=require(_0x929c('0x2'));var rp=require(_0x929c('0x3'));var moment=require(_0x929c('0x4'));var BPromise=require(_0x929c('0x5'));var Mustache=require(_0x929c('0x6'));var util=require(_0x929c('0x7'));var path=require(_0x929c('0x8'));var sox=require(_0x929c('0x9'));var csv=require(_0x929c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x929c('0xb'));var squel=require(_0x929c('0xc'));var crypto=require(_0x929c('0xd'));var jsforce=require(_0x929c('0xe'));var deskjs=require(_0x929c('0xf'));var toCsv=require(_0x929c('0xa'));var querystring=require(_0x929c('0x10'));var Papa=require(_0x929c('0x11'));var Redis=require(_0x929c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x929c('0x13'));var as=require(_0x929c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x929c('0x15'))(_0x929c('0x16'));var utils=require(_0x929c('0x17'));var config=require(_0x929c('0x18'));var licenseUtil=require(_0x929c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe010ec,_0x5dea86){_0x5dea86=_0x5dea86||0xcc;return function(_0x48c7e2){if(_0x48c7e2){return _0xe010ec['sendStatus'](_0x5dea86);}return _0xe010ec[_0x929c('0x1a')](_0x5dea86)[_0x929c('0x1b')]();};}function respondWithResult(_0x3857b5,_0x415c8f){_0x415c8f=_0x415c8f||0xc8;return function(_0x106307){if(_0x106307){return _0x3857b5['status'](_0x415c8f)['json'](_0x106307);}};}function respondWithFilteredResult(_0x2003b8,_0x5a820b){return function(_0x9a5bef){if(_0x9a5bef){var _0x2565cd=typeof _0x5a820b['offset']===_0x929c('0x1c')&&typeof _0x5a820b[_0x929c('0x1d')]===_0x929c('0x1c');var _0x3dcafb=_0x9a5bef[_0x929c('0x1e')];var _0x4ec0f1=_0x2565cd?0x0:_0x5a820b[_0x929c('0x1f')];var _0x1f8eb8=_0x2565cd?_0x9a5bef[_0x929c('0x1e')]:_0x5a820b[_0x929c('0x1f')]+_0x5a820b[_0x929c('0x1d')];var _0x17bdbf;if(_0x1f8eb8>=_0x3dcafb){_0x1f8eb8=_0x3dcafb;_0x17bdbf=0xc8;}else{_0x17bdbf=0xce;}_0x2003b8['status'](_0x17bdbf);return _0x2003b8[_0x929c('0x20')](_0x929c('0x21'),_0x4ec0f1+'-'+_0x1f8eb8+'/'+_0x3dcafb)[_0x929c('0x22')](_0x9a5bef);}return null;};}function patchUpdates(_0x366ff3){return function(_0x503cfe){try{jsonpatch['apply'](_0x503cfe,_0x366ff3,!![]);}catch(_0x2a7359){return BPromise[_0x929c('0x23')](_0x2a7359);}return _0x503cfe['save']();};}function saveUpdates(_0x16b8b2,_0x93e849){return function(_0x588b66){if(_0x588b66){return _0x588b66['update'](_0x16b8b2)[_0x929c('0x24')](function(_0x221faf){return _0x221faf;});}return null;};}function removeEntity(_0x5ea0e8,_0x411f3a){return function(_0xcf6b84){if(_0xcf6b84){return _0xcf6b84[_0x929c('0x25')]()[_0x929c('0x24')](function(){_0x5ea0e8[_0x929c('0x1a')](0xcc)[_0x929c('0x1b')]();});}};}function handleEntityNotFound(_0xea0a90,_0x178620){return function(_0x9d3886){if(!_0x9d3886){_0xea0a90[_0x929c('0x26')](0x194);}return _0x9d3886;};}function handleError(_0x4a86a0,_0x557dc4){_0x557dc4=_0x557dc4||0x1f4;return function(_0x28e037){logger['error'](_0x28e037[_0x929c('0x27')]);if(_0x28e037['name']){delete _0x28e037['name'];}_0x4a86a0['status'](_0x557dc4)[_0x929c('0x28')](_0x28e037);};}exports[_0x929c('0x29')]=function(_0x79d347,_0x353cf8){var _0xd6f0e4={},_0x5efab0={},_0x1ad63f={'count':0x0,'rows':[]};var _0x2654a5=_['map'](db['SugarcrmConfiguration'][_0x929c('0x2a')],function(_0x674256){return{'name':_0x674256[_0x929c('0x2b')],'type':_0x674256['type']['key']};});_0x5efab0['model']=_[_0x929c('0x2c')](_0x2654a5,_0x929c('0x2d'));_0x5efab0[_0x929c('0x2e')]=_[_0x929c('0x2f')](_0x79d347[_0x929c('0x2e')]);_0x5efab0['filters']=_[_0x929c('0x30')](_0x5efab0[_0x929c('0x31')],_0x5efab0[_0x929c('0x2e')]);_0xd6f0e4[_0x929c('0x32')]=_[_0x929c('0x30')](_0x5efab0['model'],qs[_0x929c('0x33')](_0x79d347['query'][_0x929c('0x33')]));_0xd6f0e4[_0x929c('0x32')]=_0xd6f0e4[_0x929c('0x32')][_0x929c('0x34')]?_0xd6f0e4[_0x929c('0x32')]:_0x5efab0[_0x929c('0x31')];if(!_0x79d347[_0x929c('0x2e')]['hasOwnProperty'](_0x929c('0x35'))){_0xd6f0e4[_0x929c('0x1d')]=qs[_0x929c('0x1d')](_0x79d347[_0x929c('0x2e')][_0x929c('0x1d')]);_0xd6f0e4['offset']=qs[_0x929c('0x1f')](_0x79d347[_0x929c('0x2e')][_0x929c('0x1f')]);}_0xd6f0e4['order']=qs[_0x929c('0x36')](_0x79d347[_0x929c('0x2e')]['sort']);_0xd6f0e4[_0x929c('0x37')]=qs[_0x929c('0x38')](_['pick'](_0x79d347[_0x929c('0x2e')],_0x5efab0[_0x929c('0x38')]),_0x2654a5);if(_0x79d347['query'][_0x929c('0x39')]){_0xd6f0e4[_0x929c('0x37')]=_[_0x929c('0x3a')](_0xd6f0e4[_0x929c('0x37')],{'$or':_['map'](_0x2654a5,function(_0x1e90c4){if(_0x1e90c4[_0x929c('0x3b')]!==_0x929c('0x3c')){var _0x27bbd8={};_0x27bbd8[_0x1e90c4[_0x929c('0x2d')]]={'$like':'%'+_0x79d347[_0x929c('0x2e')][_0x929c('0x39')]+'%'};return _0x27bbd8;}})});}_0xd6f0e4=_['merge']({},_0xd6f0e4,_0x79d347[_0x929c('0x3d')]);var _0x26932d={'where':_0xd6f0e4[_0x929c('0x37')]};return db['SugarcrmConfiguration']['count'](_0x26932d)['then'](function(_0x1cce29){_0x1ad63f[_0x929c('0x1e')]=_0x1cce29;if(_0x79d347['query']['includeAll']){_0xd6f0e4[_0x929c('0x3e')]=[{'all':!![]}];}return db[_0x929c('0x3f')][_0x929c('0x40')](_0xd6f0e4);})['then'](function(_0xb86e58){_0x1ad63f[_0x929c('0x41')]=_0xb86e58;return _0x1ad63f;})['then'](respondWithFilteredResult(_0x353cf8,_0xd6f0e4))[_0x929c('0x42')](handleError(_0x353cf8,null));};exports[_0x929c('0x43')]=function(_0x59ca1e,_0x42f1d4){var _0x213d9f={'raw':![],'where':{'id':_0x59ca1e[_0x929c('0x44')]['id']}},_0x18afcb={};_0x18afcb[_0x929c('0x31')]=_[_0x929c('0x2f')](db['SugarcrmConfiguration'][_0x929c('0x2a')]);_0x18afcb[_0x929c('0x2e')]=_[_0x929c('0x2f')](_0x59ca1e[_0x929c('0x2e')]);_0x18afcb['filters']=_[_0x929c('0x30')](_0x18afcb[_0x929c('0x31')],_0x18afcb[_0x929c('0x2e')]);_0x213d9f[_0x929c('0x32')]=_[_0x929c('0x30')](_0x18afcb['model'],qs[_0x929c('0x33')](_0x59ca1e[_0x929c('0x2e')]['fields']));_0x213d9f[_0x929c('0x32')]=_0x213d9f[_0x929c('0x32')]['length']?_0x213d9f['attributes']:_0x18afcb[_0x929c('0x31')];if(_0x59ca1e[_0x929c('0x2e')][_0x929c('0x45')]){_0x213d9f[_0x929c('0x3e')]=[{'all':!![]}];}_0x213d9f=_[_0x929c('0x3a')]({},_0x213d9f,_0x59ca1e[_0x929c('0x3d')]);return db[_0x929c('0x3f')][_0x929c('0x46')](_0x213d9f)[_0x929c('0x24')](handleEntityNotFound(_0x42f1d4,null))[_0x929c('0x24')](respondWithResult(_0x42f1d4,null))['catch'](handleError(_0x42f1d4,null));};exports['create']=function(_0x3c6ba3,_0x379a9b){return db[_0x929c('0x3f')][_0x929c('0x47')](_0x3c6ba3[_0x929c('0x48')],{})[_0x929c('0x24')](respondWithResult(_0x379a9b,0xc9))['catch'](handleError(_0x379a9b,null));};exports[_0x929c('0x49')]=function(_0x697f6e,_0x840a74){if(_0x697f6e[_0x929c('0x48')]['id']){delete _0x697f6e[_0x929c('0x48')]['id'];}return db[_0x929c('0x3f')]['find']({'where':{'id':_0x697f6e[_0x929c('0x44')]['id']}})[_0x929c('0x24')](handleEntityNotFound(_0x840a74,null))[_0x929c('0x24')](saveUpdates(_0x697f6e[_0x929c('0x48')],null))[_0x929c('0x24')](respondWithResult(_0x840a74,null))['catch'](handleError(_0x840a74,null));};exports[_0x929c('0x25')]=function(_0x108dc9,_0x488036){return db[_0x929c('0x3f')][_0x929c('0x46')]({'where':{'id':_0x108dc9[_0x929c('0x44')]['id']}})[_0x929c('0x24')](handleEntityNotFound(_0x488036,null))[_0x929c('0x24')](removeEntity(_0x488036,null))[_0x929c('0x42')](handleError(_0x488036,null));};exports[_0x929c('0x4a')]=function(_0x4eb614,_0xb81731,_0x86b88b){var _0x5b8c0f={};var _0x49b6dc={};var _0x4cd296;var _0x1149a9;return db[_0x929c('0x3f')][_0x929c('0x4b')]({'where':{'id':_0x4eb614['params']['id']}})[_0x929c('0x24')](handleEntityNotFound(_0xb81731,null))[_0x929c('0x24')](function(_0x2b1fb6){if(_0x2b1fb6){_0x4cd296=_0x2b1fb6;_0x49b6dc[_0x929c('0x31')]=_[_0x929c('0x2f')](db['SugarcrmField'][_0x929c('0x2a')]);_0x49b6dc['query']=_['keys'](_0x4eb614[_0x929c('0x2e')]);_0x49b6dc[_0x929c('0x38')]=_[_0x929c('0x30')](_0x49b6dc[_0x929c('0x31')],_0x49b6dc[_0x929c('0x2e')]);_0x5b8c0f[_0x929c('0x32')]=_[_0x929c('0x30')](_0x49b6dc[_0x929c('0x31')],qs[_0x929c('0x33')](_0x4eb614['query']['fields']));_0x5b8c0f[_0x929c('0x32')]=_0x5b8c0f[_0x929c('0x32')]['length']?_0x5b8c0f[_0x929c('0x32')]:_0x49b6dc[_0x929c('0x31')];_0x5b8c0f[_0x929c('0x4c')]=qs[_0x929c('0x36')](_0x4eb614[_0x929c('0x2e')][_0x929c('0x36')]);_0x5b8c0f[_0x929c('0x37')]=qs[_0x929c('0x38')](_[_0x929c('0x4d')](_0x4eb614[_0x929c('0x2e')],_0x49b6dc[_0x929c('0x38')]));if(_0x4eb614[_0x929c('0x2e')][_0x929c('0x39')]){_0x5b8c0f[_0x929c('0x37')]=_[_0x929c('0x3a')](_0x5b8c0f[_0x929c('0x37')],{'$or':_[_0x929c('0x2c')](_0x5b8c0f[_0x929c('0x32')],function(_0xf0e412){var _0x1737a7={};_0x1737a7[_0xf0e412]={'$like':'%'+_0x4eb614[_0x929c('0x2e')]['filter']+'%'};return _0x1737a7;})});}_0x5b8c0f=_[_0x929c('0x3a')]({},_0x5b8c0f,_0x4eb614[_0x929c('0x3d')]);return _0x4cd296[_0x929c('0x4a')](_0x5b8c0f);}})['then'](function(_0x2779d4){if(_0x2779d4){_0x1149a9=_0x2779d4[_0x929c('0x34')];if(!_0x4eb614[_0x929c('0x2e')][_0x929c('0x4e')](_0x929c('0x35'))){_0x5b8c0f['limit']=qs[_0x929c('0x1d')](_0x4eb614[_0x929c('0x2e')][_0x929c('0x1d')]);_0x5b8c0f[_0x929c('0x1f')]=qs[_0x929c('0x1f')](_0x4eb614[_0x929c('0x2e')][_0x929c('0x1f')]);}return _0x4cd296[_0x929c('0x4a')](_0x5b8c0f);}})[_0x929c('0x24')](function(_0x1c9e50){if(_0x1c9e50){return _0x1c9e50?{'count':_0x1149a9,'rows':_0x1c9e50}:null;}})[_0x929c('0x24')](respondWithResult(_0xb81731,null))[_0x929c('0x42')](handleError(_0xb81731,null));};exports['getSubjects']=function(_0x585bf0,_0x4e782a,_0x28381b){var _0x136c43={};var _0xfe52df={};var _0x3926c3;var _0x426694;return db[_0x929c('0x3f')][_0x929c('0x4b')]({'where':{'id':_0x585bf0['params']['id']}})[_0x929c('0x24')](handleEntityNotFound(_0x4e782a,null))[_0x929c('0x24')](function(_0x3620bf){if(_0x3620bf){_0x3926c3=_0x3620bf;_0xfe52df[_0x929c('0x31')]=_['keys'](db[_0x929c('0x4f')]['rawAttributes']);_0xfe52df[_0x929c('0x2e')]=_[_0x929c('0x2f')](_0x585bf0[_0x929c('0x2e')]);_0xfe52df['filters']=_[_0x929c('0x30')](_0xfe52df[_0x929c('0x31')],_0xfe52df['query']);_0x136c43[_0x929c('0x32')]=_[_0x929c('0x30')](_0xfe52df[_0x929c('0x31')],qs[_0x929c('0x33')](_0x585bf0[_0x929c('0x2e')]['fields']));_0x136c43[_0x929c('0x32')]=_0x136c43[_0x929c('0x32')][_0x929c('0x34')]?_0x136c43[_0x929c('0x32')]:_0xfe52df[_0x929c('0x31')];_0x136c43['order']=qs[_0x929c('0x36')](_0x585bf0['query'][_0x929c('0x36')]);_0x136c43['where']=qs['filters'](_['pick'](_0x585bf0[_0x929c('0x2e')],_0xfe52df['filters']));if(_0x585bf0['query']['filter']){_0x136c43['where']=_['merge'](_0x136c43[_0x929c('0x37')],{'$or':_[_0x929c('0x2c')](_0x136c43[_0x929c('0x32')],function(_0x46b3b1){var _0x3c312a={};_0x3c312a[_0x46b3b1]={'$like':'%'+_0x585bf0[_0x929c('0x2e')][_0x929c('0x39')]+'%'};return _0x3c312a;})});}_0x136c43=_['merge']({},_0x136c43,_0x585bf0['options']);return _0x3926c3[_0x929c('0x50')](_0x136c43);}})[_0x929c('0x24')](function(_0x5a17f0){if(_0x5a17f0){_0x426694=_0x5a17f0[_0x929c('0x34')];if(!_0x585bf0[_0x929c('0x2e')][_0x929c('0x4e')](_0x929c('0x35'))){_0x136c43[_0x929c('0x1d')]=qs[_0x929c('0x1d')](_0x585bf0['query'][_0x929c('0x1d')]);_0x136c43[_0x929c('0x1f')]=qs[_0x929c('0x1f')](_0x585bf0[_0x929c('0x2e')][_0x929c('0x1f')]);}return _0x3926c3['getSubjects'](_0x136c43);}})[_0x929c('0x24')](function(_0x484910){if(_0x484910){return _0x484910?{'count':_0x426694,'rows':_0x484910}:null;}})[_0x929c('0x24')](respondWithResult(_0x4e782a,null))[_0x929c('0x42')](handleError(_0x4e782a,null));};exports[_0x929c('0x51')]=function(_0xab0d1e,_0x2a6d9d,_0x27cdb5){var _0x27e64d={};var _0x587488={};var _0x237cab;var _0x26e871;return db[_0x929c('0x3f')]['findOne']({'where':{'id':_0xab0d1e[_0x929c('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a6d9d,null))['then'](function(_0x461009){if(_0x461009){_0x237cab=_0x461009;_0x587488['model']=_[_0x929c('0x2f')](db[_0x929c('0x4f')][_0x929c('0x2a')]);_0x587488[_0x929c('0x2e')]=_[_0x929c('0x2f')](_0xab0d1e['query']);_0x587488[_0x929c('0x38')]=_['intersection'](_0x587488['model'],_0x587488[_0x929c('0x2e')]);_0x27e64d['attributes']=_[_0x929c('0x30')](_0x587488[_0x929c('0x31')],qs[_0x929c('0x33')](_0xab0d1e['query'][_0x929c('0x33')]));_0x27e64d[_0x929c('0x32')]=_0x27e64d[_0x929c('0x32')][_0x929c('0x34')]?_0x27e64d['attributes']:_0x587488[_0x929c('0x31')];_0x27e64d[_0x929c('0x4c')]=qs[_0x929c('0x36')](_0xab0d1e[_0x929c('0x2e')][_0x929c('0x36')]);_0x27e64d[_0x929c('0x37')]=qs['filters'](_[_0x929c('0x4d')](_0xab0d1e[_0x929c('0x2e')],_0x587488[_0x929c('0x38')]));if(_0xab0d1e[_0x929c('0x2e')][_0x929c('0x39')]){_0x27e64d[_0x929c('0x37')]=_['merge'](_0x27e64d[_0x929c('0x37')],{'$or':_[_0x929c('0x2c')](_0x27e64d[_0x929c('0x32')],function(_0x4d8d5b){var _0x3a6ac8={};_0x3a6ac8[_0x4d8d5b]={'$like':'%'+_0xab0d1e[_0x929c('0x2e')]['filter']+'%'};return _0x3a6ac8;})});}_0x27e64d=_[_0x929c('0x3a')]({},_0x27e64d,_0xab0d1e[_0x929c('0x3d')]);return _0x237cab[_0x929c('0x51')](_0x27e64d);}})[_0x929c('0x24')](function(_0x2f16ef){if(_0x2f16ef){_0x26e871=_0x2f16ef['length'];if(!_0xab0d1e[_0x929c('0x2e')][_0x929c('0x4e')]('nolimit')){_0x27e64d[_0x929c('0x1d')]=qs[_0x929c('0x1d')](_0xab0d1e['query']['limit']);_0x27e64d[_0x929c('0x1f')]=qs[_0x929c('0x1f')](_0xab0d1e[_0x929c('0x2e')][_0x929c('0x1f')]);}return _0x237cab['getDescriptions'](_0x27e64d);}})['then'](function(_0x59202c){if(_0x59202c){return _0x59202c?{'count':_0x26e871,'rows':_0x59202c}:null;}})[_0x929c('0x24')](respondWithResult(_0x2a6d9d,null))[_0x929c('0x42')](handleError(_0x2a6d9d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 9a6972f..0192465 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 _0x64b2=['../../config/logger','api','moment','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x41cd69,_0x28ffa0){var _0x138cc2=function(_0xf84cae){while(--_0xf84cae){_0x41cd69['push'](_0x41cd69['shift']());}};_0x138cc2(++_0x28ffa0);}(_0x64b2,0x143));var _0x264b=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x64b2[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x264b('0x0'));var util=require(_0x264b('0x1'));var logger=require(_0x264b('0x2'))(_0x264b('0x3'));var moment=require(_0x264b('0x4'));var BPromise=require('bluebird');var rp=require(_0x264b('0x5'));var fs=require('fs');var path=require(_0x264b('0x6'));var rimraf=require(_0x264b('0x7'));var config=require('../../config/environment');var attributes=require(_0x264b('0x8'));module[_0x264b('0x9')]=function(_0x1b80ad,_0x58dc15){return _0x1b80ad[_0x264b('0xa')](_0x264b('0xb'),attributes,{'tableName':_0x264b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdb7=['../../config/logger','api','bluebird','request-promise','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xcdb7,0x18b));var _0x7cdb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcdb7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7cdb('0x0'));var util=require('util');var logger=require(_0x7cdb('0x1'))(_0x7cdb('0x2'));var moment=require('moment');var BPromise=require(_0x7cdb('0x3'));var rp=require(_0x7cdb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7cdb('0x5'));var attributes=require(_0x7cdb('0x6'));module[_0x7cdb('0x7')]=function(_0x2f945f,_0x57f158){return _0x2f945f['define'](_0x7cdb('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 7031da4..9af057c 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 _0x7bb9=['message','info','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x7bb9,0xa6));var _0x97bb=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x7bb9[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x97bb('0x0'));var util=require('util');var moment=require(_0x97bb('0x1'));var BPromise=require(_0x97bb('0x2'));var rs=require(_0x97bb('0x3'));var fs=require('fs');var Redis=require(_0x97bb('0x4'));var db=require(_0x97bb('0x5'))['db'];var utils=require(_0x97bb('0x6'));var logger=require(_0x97bb('0x7'))(_0x97bb('0x8'));var config=require(_0x97bb('0x9'));var jayson=require(_0x97bb('0xa'));var client=jayson[_0x97bb('0xb')][_0x97bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a8056,_0xde0be3,_0x54190c){return new BPromise(function(_0x226914,_0x47e8fe){return client[_0x97bb('0xd')](_0x1a8056,_0x54190c)[_0x97bb('0xe')](function(_0x430caa){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0xde0be3,_0x97bb('0xf'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xde0be3,_0x97bb('0xf'),JSON[_0x97bb('0x10')](_0x430caa));if(_0x430caa[_0x97bb('0x11')]){if(_0x430caa[_0x97bb('0x11')]['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xde0be3,_0x430caa[_0x97bb('0x11')][_0x97bb('0x12')]);return _0x47e8fe(_0x430caa[_0x97bb('0x11')]['message']);}logger[_0x97bb('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xde0be3,_0x430caa[_0x97bb('0x11')][_0x97bb('0x12')]);return _0x226914(_0x430caa[_0x97bb('0x11')]['message']);}else{logger[_0x97bb('0x13')](_0x97bb('0x14'),_0xde0be3,_0x97bb('0xf'));_0x226914(_0x430caa[_0x97bb('0x15')]['message']);}})[_0x97bb('0x16')](function(_0x4a7438){logger[_0x97bb('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xde0be3,_0x4a7438);_0x47e8fe(_0x4a7438);});});} \ No newline at end of file +var _0x0b03=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment'];(function(_0x2419e1,_0x12416d){var _0x38e897=function(_0x15d500){while(--_0x15d500){_0x2419e1['push'](_0x2419e1['shift']());}};_0x38e897(++_0x12416d);}(_0x0b03,0xec));var _0x30b0=function(_0x21642c,_0x4a4fed){_0x21642c=_0x21642c-0x0;var _0x20ec18=_0x0b03[_0x21642c];return _0x20ec18;};'use strict';var _=require('lodash');var util=require(_0x30b0('0x0'));var moment=require(_0x30b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x30b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b0('0x3'))['db'];var utils=require(_0x30b0('0x4'));var logger=require(_0x30b0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x30b0('0x6'));var client=jayson[_0x30b0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd15ccd,_0x1ebbb4,_0x1bf0c4){return new BPromise(function(_0x4f00bc,_0x1e5012){return client[_0x30b0('0x8')](_0xd15ccd,_0x1bf0c4)['then'](function(_0x155577){logger['info'](_0x30b0('0x9'),_0x1ebbb4,'request\x20sent');logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1ebbb4,_0x30b0('0xa'),JSON['stringify'](_0x155577));if(_0x155577[_0x30b0('0xb')]){if(_0x155577[_0x30b0('0xb')][_0x30b0('0xc')]===0x1f4){logger[_0x30b0('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1ebbb4,_0x155577[_0x30b0('0xb')]['message']);return _0x1e5012(_0x155577[_0x30b0('0xb')][_0x30b0('0xd')]);}logger['error'](_0x30b0('0x9'),_0x1ebbb4,_0x155577['error'][_0x30b0('0xd')]);return _0x4f00bc(_0x155577[_0x30b0('0xb')][_0x30b0('0xd')]);}else{logger[_0x30b0('0xe')](_0x30b0('0x9'),_0x1ebbb4,_0x30b0('0xa'));_0x4f00bc(_0x155577[_0x30b0('0xf')][_0x30b0('0xd')]);}})[_0x30b0('0x10')](function(_0xb15858){logger[_0x30b0('0xb')](_0x30b0('0x9'),_0x1ebbb4,_0xb15858);_0x1e5012(_0xb15858);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d948376..0027d18 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 _0x2ebe=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','/:id','destroy','exports'];(function(_0x220c48,_0xcb524d){var _0x43febf=function(_0x1a7754){while(--_0x1a7754){_0x220c48['push'](_0x220c48['shift']());}};_0x43febf(++_0xcb524d);}(_0x2ebe,0x156));var _0xe2eb=function(_0x1654cc,_0x1fd3ea){_0x1654cc=_0x1654cc-0x0;var _0x583fdb=_0x2ebe[_0x1654cc];return _0x583fdb;};'use strict';var multer=require(_0xe2eb('0x0'));var util=require(_0xe2eb('0x1'));var path=require(_0xe2eb('0x2'));var timeout=require(_0xe2eb('0x3'));var express=require(_0xe2eb('0x4'));var router=express[_0xe2eb('0x5')]();var fs_extra=require(_0xe2eb('0x6'));var auth=require(_0xe2eb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe2eb('0x8'));var controller=require(_0xe2eb('0x9'));router[_0xe2eb('0xa')]('/',auth[_0xe2eb('0xb')](),controller[_0xe2eb('0xc')]);router[_0xe2eb('0xa')]('/:id',auth[_0xe2eb('0xb')](),controller[_0xe2eb('0xd')]);router[_0xe2eb('0xe')]('/',auth[_0xe2eb('0xb')](),controller['create']);router['put'](_0xe2eb('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe2eb('0xb')](),controller[_0xe2eb('0x10')]);module[_0xe2eb('0x11')]=router; \ No newline at end of file +var _0x515d=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','show','isAuthenticated','create','put','/:id','update','delete','destroy'];(function(_0x4bc7ea,_0x5e3b49){var _0x5a2f25=function(_0xd08366){while(--_0xd08366){_0x4bc7ea['push'](_0x4bc7ea['shift']());}};_0x5a2f25(++_0x5e3b49);}(_0x515d,0xa0));var _0xd515=function(_0x4d89c5,_0x88b142){_0x4d89c5=_0x4d89c5-0x0;var _0x11938b=_0x515d[_0x4d89c5];return _0x11938b;};'use strict';var multer=require('multer');var util=require(_0xd515('0x0'));var path=require(_0xd515('0x1'));var timeout=require('connect-timeout');var express=require(_0xd515('0x2'));var router=express['Router']();var fs_extra=require(_0xd515('0x3'));var auth=require(_0xd515('0x4'));var interaction=require(_0xd515('0x5'));var config=require('../../config/environment');var controller=require(_0xd515('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd515('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd515('0x8')]);router['post']('/',auth[_0xd515('0x9')](),controller[_0xd515('0xa')]);router[_0xd515('0xb')](_0xd515('0xc'),auth[_0xd515('0x9')](),controller[_0xd515('0xd')]);router[_0xd515('0xe')](_0xd515('0xc'),auth[_0xd515('0x9')](),controller[_0xd515('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index f708e76..b162e7a 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 _0xfcc2=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x4f3173,_0x52ad78){var _0x103329=function(_0x3c5341){while(--_0x3c5341){_0x4f3173['push'](_0x4f3173['shift']());}};_0x103329(++_0x52ad78);}(_0xfcc2,0x94));var _0x2fcc=function(_0x2c5655,_0x2cab10){_0x2c5655=_0x2c5655-0x0;var _0xe23b4f=_0xfcc2[_0x2c5655];return _0xe23b4f;};'use strict';var Sequelize=require(_0x2fcc('0x0'));module[_0x2fcc('0x1')]={'type':{'type':Sequelize[_0x2fcc('0x2')](_0x2fcc('0x3'),_0x2fcc('0x4'),'customVariable',_0x2fcc('0x5'),_0x2fcc('0x6')),'defaultValue':_0x2fcc('0x3')},'content':{'type':Sequelize[_0x2fcc('0x7')]},'key':{'type':Sequelize[_0x2fcc('0x7')]},'keyType':{'type':Sequelize[_0x2fcc('0x2')]('string','variable',_0x2fcc('0x8'))},'keyContent':{'type':Sequelize[_0x2fcc('0x7')]},'idField':{'type':Sequelize[_0x2fcc('0x7')]},'nameField':{'type':Sequelize[_0x2fcc('0x7')]},'customField':{'type':Sequelize[_0x2fcc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fcc('0x7')]}}; \ No newline at end of file +var _0x3863=['customVariable','picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string'];(function(_0x9512c2,_0x35638d){var _0x360bb7=function(_0x4bff2d){while(--_0x4bff2d){_0x9512c2['push'](_0x9512c2['shift']());}};_0x360bb7(++_0x35638d);}(_0x3863,0x11d));var _0x3386=function(_0x4178df,_0x2f471a){_0x4178df=_0x4178df-0x0;var _0x54492e=_0x3863[_0x4178df];return _0x54492e;};'use strict';var Sequelize=require(_0x3386('0x0'));module['exports']={'type':{'type':Sequelize[_0x3386('0x1')](_0x3386('0x2'),'variable',_0x3386('0x3'),'keyValue',_0x3386('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3386('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x3386('0x2'),_0x3386('0x6'),_0x3386('0x3'))},'keyContent':{'type':Sequelize[_0x3386('0x5')]},'idField':{'type':Sequelize[_0x3386('0x5')]},'nameField':{'type':Sequelize[_0x3386('0x5')]},'customField':{'type':Sequelize[_0x3386('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c817549..d45011c 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 _0x53cd=['lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','type','key','model','keys','filters','attributes','intersection','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','show','length','create','body','find','params','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x37a3a1,_0x1e9cb5){var _0x3cc96f=function(_0x56462d){while(--_0x56462d){_0x37a3a1['push'](_0x37a3a1['shift']());}};_0x3cc96f(++_0x1e9cb5);}(_0x53cd,0x89));var _0xd53c=function(_0x2b8e43,_0xe69f5c){_0x2b8e43=_0x2b8e43-0x0;var _0x1fbc9f=_0x53cd[_0x2b8e43];return _0x1fbc9f;};'use strict';var emlformat=require(_0xd53c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd53c('0x1'));var jsonpatch=require(_0xd53c('0x2'));var rp=require('request-promise');var moment=require(_0xd53c('0x3'));var BPromise=require(_0xd53c('0x4'));var Mustache=require(_0xd53c('0x5'));var util=require(_0xd53c('0x6'));var path=require(_0xd53c('0x7'));var sox=require(_0xd53c('0x8'));var csv=require(_0xd53c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd53c('0xa'));var _=require(_0xd53c('0xb'));var squel=require(_0xd53c('0xc'));var crypto=require(_0xd53c('0xd'));var jsforce=require(_0xd53c('0xe'));var deskjs=require(_0xd53c('0xf'));var toCsv=require(_0xd53c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd53c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd53c('0x11'))(_0xd53c('0x12'));var utils=require(_0xd53c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd53c('0x14'));var db=require(_0xd53c('0x15'))['db'];function respondWithStatusCode(_0x1f1f78,_0x551936){_0x551936=_0x551936||0xcc;return function(_0x2a98bb){if(_0x2a98bb){return _0x1f1f78[_0xd53c('0x16')](_0x551936);}return _0x1f1f78[_0xd53c('0x17')](_0x551936)[_0xd53c('0x18')]();};}function respondWithResult(_0xa836b3,_0x293b33){_0x293b33=_0x293b33||0xc8;return function(_0x41e110){if(_0x41e110){return _0xa836b3[_0xd53c('0x17')](_0x293b33)[_0xd53c('0x19')](_0x41e110);}};}function respondWithFilteredResult(_0x16d14e,_0x445444){return function(_0x147abd){if(_0x147abd){var _0x40d3be=typeof _0x445444[_0xd53c('0x1a')]===_0xd53c('0x1b')&&typeof _0x445444[_0xd53c('0x1c')]==='undefined';var _0x4c50d1=_0x147abd[_0xd53c('0x1d')];var _0x2ba102=_0x40d3be?0x0:_0x445444[_0xd53c('0x1a')];var _0x5a61e5=_0x40d3be?_0x147abd[_0xd53c('0x1d')]:_0x445444[_0xd53c('0x1a')]+_0x445444[_0xd53c('0x1c')];var _0x192529;if(_0x5a61e5>=_0x4c50d1){_0x5a61e5=_0x4c50d1;_0x192529=0xc8;}else{_0x192529=0xce;}_0x16d14e['status'](_0x192529);return _0x16d14e[_0xd53c('0x1e')]('Content-Range',_0x2ba102+'-'+_0x5a61e5+'/'+_0x4c50d1)[_0xd53c('0x19')](_0x147abd);}return null;};}function patchUpdates(_0x2de16d){return function(_0x52d315){try{jsonpatch[_0xd53c('0x1f')](_0x52d315,_0x2de16d,!![]);}catch(_0x50fa22){return BPromise[_0xd53c('0x20')](_0x50fa22);}return _0x52d315[_0xd53c('0x21')]();};}function saveUpdates(_0x3426ae,_0x508d36){return function(_0xdaf11){if(_0xdaf11){return _0xdaf11[_0xd53c('0x22')](_0x3426ae)[_0xd53c('0x23')](function(_0x264f63){return _0x264f63;});}return null;};}function removeEntity(_0x5591a2,_0x29e60b){return function(_0x40d1c1){if(_0x40d1c1){return _0x40d1c1[_0xd53c('0x24')]()[_0xd53c('0x23')](function(){_0x5591a2[_0xd53c('0x17')](0xcc)[_0xd53c('0x18')]();});}};}function handleEntityNotFound(_0x29fc8e,_0x581bdb){return function(_0x5c5c68){if(!_0x5c5c68){_0x29fc8e['sendStatus'](0x194);}return _0x5c5c68;};}function handleError(_0x2725bb,_0x427c84){_0x427c84=_0x427c84||0x1f4;return function(_0x243a0a){logger[_0xd53c('0x25')](_0x243a0a[_0xd53c('0x26')]);if(_0x243a0a[_0xd53c('0x27')]){delete _0x243a0a[_0xd53c('0x27')];}_0x2725bb['status'](_0x427c84)[_0xd53c('0x28')](_0x243a0a);};}exports[_0xd53c('0x29')]=function(_0x5b82cd,_0x3cd7bb){var _0x4547ac={},_0x35ce2f={},_0x118762={'count':0x0,'rows':[]};var _0x12db6d=_['map'](db[_0xd53c('0x2a')][_0xd53c('0x2b')],function(_0x370a33){return{'name':_0x370a33['fieldName'],'type':_0x370a33[_0xd53c('0x2c')][_0xd53c('0x2d')]};});_0x35ce2f[_0xd53c('0x2e')]=_['map'](_0x12db6d,_0xd53c('0x27'));_0x35ce2f['query']=_[_0xd53c('0x2f')](_0x5b82cd['query']);_0x35ce2f[_0xd53c('0x30')]=_['intersection'](_0x35ce2f[_0xd53c('0x2e')],_0x35ce2f['query']);_0x4547ac[_0xd53c('0x31')]=_[_0xd53c('0x32')](_0x35ce2f['model'],qs['fields'](_0x5b82cd[_0xd53c('0x33')][_0xd53c('0x34')]));_0x4547ac['attributes']=_0x4547ac[_0xd53c('0x31')]['length']?_0x4547ac['attributes']:_0x35ce2f['model'];if(!_0x5b82cd['query'][_0xd53c('0x35')](_0xd53c('0x36'))){_0x4547ac[_0xd53c('0x1c')]=qs[_0xd53c('0x1c')](_0x5b82cd[_0xd53c('0x33')][_0xd53c('0x1c')]);_0x4547ac[_0xd53c('0x1a')]=qs[_0xd53c('0x1a')](_0x5b82cd[_0xd53c('0x33')][_0xd53c('0x1a')]);}_0x4547ac[_0xd53c('0x37')]=qs[_0xd53c('0x38')](_0x5b82cd['query'][_0xd53c('0x38')]);_0x4547ac[_0xd53c('0x39')]=qs[_0xd53c('0x30')](_[_0xd53c('0x3a')](_0x5b82cd[_0xd53c('0x33')],_0x35ce2f['filters']),_0x12db6d);if(_0x5b82cd[_0xd53c('0x33')]['filter']){_0x4547ac['where']=_['merge'](_0x4547ac[_0xd53c('0x39')],{'$or':_[_0xd53c('0x3b')](_0x12db6d,function(_0x1cebb0){if(_0x1cebb0[_0xd53c('0x2c')]!=='VIRTUAL'){var _0x1e96ff={};_0x1e96ff[_0x1cebb0[_0xd53c('0x27')]]={'$like':'%'+_0x5b82cd[_0xd53c('0x33')][_0xd53c('0x3c')]+'%'};return _0x1e96ff;}})});}_0x4547ac=_[_0xd53c('0x3d')]({},_0x4547ac,_0x5b82cd[_0xd53c('0x3e')]);var _0x21be95={'where':_0x4547ac['where']};return db['SugarcrmField']['count'](_0x21be95)[_0xd53c('0x23')](function(_0xe35f4){_0x118762[_0xd53c('0x1d')]=_0xe35f4;if(_0x5b82cd[_0xd53c('0x33')][_0xd53c('0x3f')]){_0x4547ac[_0xd53c('0x40')]=[{'all':!![]}];}return db[_0xd53c('0x2a')][_0xd53c('0x41')](_0x4547ac);})['then'](function(_0xa85327){_0x118762[_0xd53c('0x42')]=_0xa85327;return _0x118762;})[_0xd53c('0x23')](respondWithFilteredResult(_0x3cd7bb,_0x4547ac))['catch'](handleError(_0x3cd7bb,null));};exports[_0xd53c('0x43')]=function(_0x2943ee,_0x89a53f){var _0x2e6415={'raw':!![],'where':{'id':_0x2943ee['params']['id']}},_0x349cbb={};_0x349cbb['model']=_[_0xd53c('0x2f')](db[_0xd53c('0x2a')][_0xd53c('0x2b')]);_0x349cbb[_0xd53c('0x33')]=_[_0xd53c('0x2f')](_0x2943ee[_0xd53c('0x33')]);_0x349cbb[_0xd53c('0x30')]=_['intersection'](_0x349cbb[_0xd53c('0x2e')],_0x349cbb['query']);_0x2e6415[_0xd53c('0x31')]=_[_0xd53c('0x32')](_0x349cbb[_0xd53c('0x2e')],qs[_0xd53c('0x34')](_0x2943ee['query'][_0xd53c('0x34')]));_0x2e6415['attributes']=_0x2e6415[_0xd53c('0x31')][_0xd53c('0x44')]?_0x2e6415['attributes']:_0x349cbb['model'];if(_0x2943ee['query']['includeAll']){_0x2e6415['include']=[{'all':!![]}];}_0x2e6415=_[_0xd53c('0x3d')]({},_0x2e6415,_0x2943ee['options']);return db[_0xd53c('0x2a')]['find'](_0x2e6415)[_0xd53c('0x23')](handleEntityNotFound(_0x89a53f,null))['then'](respondWithResult(_0x89a53f,null))['catch'](handleError(_0x89a53f,null));};exports[_0xd53c('0x45')]=function(_0x1e05d9,_0x6f33e8){return db[_0xd53c('0x2a')][_0xd53c('0x45')](_0x1e05d9[_0xd53c('0x46')],{})[_0xd53c('0x23')](respondWithResult(_0x6f33e8,0xc9))['catch'](handleError(_0x6f33e8,null));};exports[_0xd53c('0x22')]=function(_0x4ce991,_0x5b7cee){if(_0x4ce991[_0xd53c('0x46')]['id']){delete _0x4ce991[_0xd53c('0x46')]['id'];}return db['SugarcrmField'][_0xd53c('0x47')]({'where':{'id':_0x4ce991[_0xd53c('0x48')]['id']}})[_0xd53c('0x23')](handleEntityNotFound(_0x5b7cee,null))['then'](saveUpdates(_0x4ce991[_0xd53c('0x46')],null))[_0xd53c('0x23')](respondWithResult(_0x5b7cee,null))[_0xd53c('0x49')](handleError(_0x5b7cee,null));};exports[_0xd53c('0x24')]=function(_0x4dc493,_0x27438e){return db['SugarcrmField'][_0xd53c('0x47')]({'where':{'id':_0x4dc493[_0xd53c('0x48')]['id']}})[_0xd53c('0x23')](handleEntityNotFound(_0x27438e,null))['then'](removeEntity(_0x27438e,null))[_0xd53c('0x49')](handleError(_0x27438e,null));}; \ No newline at end of file +var _0xf806=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xf806,0x166));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f80('0x0'));var zipdir=require(_0x6f80('0x1'));var jsonpatch=require(_0x6f80('0x2'));var rp=require('request-promise');var moment=require(_0x6f80('0x3'));var BPromise=require(_0x6f80('0x4'));var Mustache=require(_0x6f80('0x5'));var util=require(_0x6f80('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6f80('0x7'));var ejs=require(_0x6f80('0x8'));var fs=require('fs');var fs_extra=require(_0x6f80('0x9'));var _=require('lodash');var squel=require(_0x6f80('0xa'));var crypto=require(_0x6f80('0xb'));var jsforce=require(_0x6f80('0xc'));var deskjs=require(_0x6f80('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6f80('0xe'));var Papa=require(_0x6f80('0xf'));var Redis=require(_0x6f80('0x10'));var authService=require(_0x6f80('0x11'));var qs=require(_0x6f80('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f80('0x13'));var logger=require(_0x6f80('0x14'))(_0x6f80('0x15'));var utils=require('../../config/utils');var config=require(_0x6f80('0x16'));var licenseUtil=require(_0x6f80('0x17'));var db=require(_0x6f80('0x18'))['db'];function respondWithStatusCode(_0x291d71,_0x537bcb){_0x537bcb=_0x537bcb||0xcc;return function(_0x885cee){if(_0x885cee){return _0x291d71[_0x6f80('0x19')](_0x537bcb);}return _0x291d71[_0x6f80('0x1a')](_0x537bcb)[_0x6f80('0x1b')]();};}function respondWithResult(_0x322a2d,_0x2c59fd){_0x2c59fd=_0x2c59fd||0xc8;return function(_0x470dc3){if(_0x470dc3){return _0x322a2d['status'](_0x2c59fd)[_0x6f80('0x1c')](_0x470dc3);}};}function respondWithFilteredResult(_0x50a993,_0x197850){return function(_0x446929){if(_0x446929){var _0x133359=typeof _0x197850[_0x6f80('0x1d')]===_0x6f80('0x1e')&&typeof _0x197850[_0x6f80('0x1f')]===_0x6f80('0x1e');var _0x37d7a3=_0x446929[_0x6f80('0x20')];var _0x206084=_0x133359?0x0:_0x197850[_0x6f80('0x1d')];var _0x596e2f=_0x133359?_0x446929['count']:_0x197850[_0x6f80('0x1d')]+_0x197850[_0x6f80('0x1f')];var _0x4d59cd;if(_0x596e2f>=_0x37d7a3){_0x596e2f=_0x37d7a3;_0x4d59cd=0xc8;}else{_0x4d59cd=0xce;}_0x50a993[_0x6f80('0x1a')](_0x4d59cd);return _0x50a993[_0x6f80('0x21')](_0x6f80('0x22'),_0x206084+'-'+_0x596e2f+'/'+_0x37d7a3)['json'](_0x446929);}return null;};}function patchUpdates(_0x4c5711){return function(_0xd8294b){try{jsonpatch[_0x6f80('0x23')](_0xd8294b,_0x4c5711,!![]);}catch(_0xf48ed6){return BPromise[_0x6f80('0x24')](_0xf48ed6);}return _0xd8294b[_0x6f80('0x25')]();};}function saveUpdates(_0x59be61,_0x26cb0b){return function(_0x47c3d3){if(_0x47c3d3){return _0x47c3d3[_0x6f80('0x26')](_0x59be61)[_0x6f80('0x27')](function(_0x3ce470){return _0x3ce470;});}return null;};}function removeEntity(_0x44b76f,_0x2074a6){return function(_0x5b1e0f){if(_0x5b1e0f){return _0x5b1e0f[_0x6f80('0x28')]()[_0x6f80('0x27')](function(){_0x44b76f[_0x6f80('0x1a')](0xcc)[_0x6f80('0x1b')]();});}};}function handleEntityNotFound(_0x56e55c,_0x55fc91){return function(_0x142ea7){if(!_0x142ea7){_0x56e55c[_0x6f80('0x19')](0x194);}return _0x142ea7;};}function handleError(_0x87810,_0x16947b){_0x16947b=_0x16947b||0x1f4;return function(_0x374b2d){logger[_0x6f80('0x29')](_0x374b2d[_0x6f80('0x2a')]);if(_0x374b2d['name']){delete _0x374b2d[_0x6f80('0x2b')];}_0x87810[_0x6f80('0x1a')](_0x16947b)[_0x6f80('0x2c')](_0x374b2d);};}exports[_0x6f80('0x2d')]=function(_0x37f0a8,_0x12d016){var _0x5090e8={},_0x166a21={},_0x27b257={'count':0x0,'rows':[]};var _0x279805=_[_0x6f80('0x2e')](db[_0x6f80('0x2f')][_0x6f80('0x30')],function(_0xc75433){return{'name':_0xc75433[_0x6f80('0x31')],'type':_0xc75433['type'][_0x6f80('0x32')]};});_0x166a21[_0x6f80('0x33')]=_['map'](_0x279805,_0x6f80('0x2b'));_0x166a21[_0x6f80('0x34')]=_['keys'](_0x37f0a8[_0x6f80('0x34')]);_0x166a21[_0x6f80('0x35')]=_['intersection'](_0x166a21['model'],_0x166a21[_0x6f80('0x34')]);_0x5090e8[_0x6f80('0x36')]=_[_0x6f80('0x37')](_0x166a21[_0x6f80('0x33')],qs[_0x6f80('0x38')](_0x37f0a8[_0x6f80('0x34')]['fields']));_0x5090e8[_0x6f80('0x36')]=_0x5090e8['attributes'][_0x6f80('0x39')]?_0x5090e8[_0x6f80('0x36')]:_0x166a21['model'];if(!_0x37f0a8[_0x6f80('0x34')][_0x6f80('0x3a')]('nolimit')){_0x5090e8[_0x6f80('0x1f')]=qs[_0x6f80('0x1f')](_0x37f0a8[_0x6f80('0x34')][_0x6f80('0x1f')]);_0x5090e8[_0x6f80('0x1d')]=qs[_0x6f80('0x1d')](_0x37f0a8[_0x6f80('0x34')][_0x6f80('0x1d')]);}_0x5090e8[_0x6f80('0x3b')]=qs[_0x6f80('0x3c')](_0x37f0a8['query'][_0x6f80('0x3c')]);_0x5090e8[_0x6f80('0x3d')]=qs[_0x6f80('0x35')](_[_0x6f80('0x3e')](_0x37f0a8[_0x6f80('0x34')],_0x166a21['filters']),_0x279805);if(_0x37f0a8[_0x6f80('0x34')]['filter']){_0x5090e8['where']=_[_0x6f80('0x3f')](_0x5090e8[_0x6f80('0x3d')],{'$or':_['map'](_0x279805,function(_0x268f14){if(_0x268f14[_0x6f80('0x40')]!=='VIRTUAL'){var _0x4d9506={};_0x4d9506[_0x268f14[_0x6f80('0x2b')]]={'$like':'%'+_0x37f0a8[_0x6f80('0x34')]['filter']+'%'};return _0x4d9506;}})});}_0x5090e8=_[_0x6f80('0x3f')]({},_0x5090e8,_0x37f0a8[_0x6f80('0x41')]);var _0x16ad79={'where':_0x5090e8['where']};return db[_0x6f80('0x2f')][_0x6f80('0x20')](_0x16ad79)[_0x6f80('0x27')](function(_0x3600fb){_0x27b257[_0x6f80('0x20')]=_0x3600fb;if(_0x37f0a8[_0x6f80('0x34')][_0x6f80('0x42')]){_0x5090e8['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x6f80('0x43')](_0x5090e8);})[_0x6f80('0x27')](function(_0x381b56){_0x27b257[_0x6f80('0x44')]=_0x381b56;return _0x27b257;})[_0x6f80('0x27')](respondWithFilteredResult(_0x12d016,_0x5090e8))[_0x6f80('0x45')](handleError(_0x12d016,null));};exports[_0x6f80('0x46')]=function(_0xb90956,_0x145425){var _0x6f933e={'raw':!![],'where':{'id':_0xb90956[_0x6f80('0x47')]['id']}},_0x3ebb7c={};_0x3ebb7c[_0x6f80('0x33')]=_[_0x6f80('0x48')](db[_0x6f80('0x2f')][_0x6f80('0x30')]);_0x3ebb7c['query']=_[_0x6f80('0x48')](_0xb90956['query']);_0x3ebb7c[_0x6f80('0x35')]=_[_0x6f80('0x37')](_0x3ebb7c[_0x6f80('0x33')],_0x3ebb7c[_0x6f80('0x34')]);_0x6f933e[_0x6f80('0x36')]=_[_0x6f80('0x37')](_0x3ebb7c['model'],qs[_0x6f80('0x38')](_0xb90956['query'][_0x6f80('0x38')]));_0x6f933e[_0x6f80('0x36')]=_0x6f933e[_0x6f80('0x36')][_0x6f80('0x39')]?_0x6f933e[_0x6f80('0x36')]:_0x3ebb7c[_0x6f80('0x33')];if(_0xb90956[_0x6f80('0x34')][_0x6f80('0x42')]){_0x6f933e[_0x6f80('0x49')]=[{'all':!![]}];}_0x6f933e=_['merge']({},_0x6f933e,_0xb90956['options']);return db['SugarcrmField'][_0x6f80('0x4a')](_0x6f933e)['then'](handleEntityNotFound(_0x145425,null))[_0x6f80('0x27')](respondWithResult(_0x145425,null))[_0x6f80('0x45')](handleError(_0x145425,null));};exports['create']=function(_0x2456b2,_0x372b4c){return db[_0x6f80('0x2f')][_0x6f80('0x4b')](_0x2456b2['body'],{})[_0x6f80('0x27')](respondWithResult(_0x372b4c,0xc9))['catch'](handleError(_0x372b4c,null));};exports[_0x6f80('0x26')]=function(_0x573371,_0x4ce36c){if(_0x573371[_0x6f80('0x4c')]['id']){delete _0x573371[_0x6f80('0x4c')]['id'];}return db[_0x6f80('0x2f')][_0x6f80('0x4a')]({'where':{'id':_0x573371[_0x6f80('0x47')]['id']}})[_0x6f80('0x27')](handleEntityNotFound(_0x4ce36c,null))[_0x6f80('0x27')](saveUpdates(_0x573371[_0x6f80('0x4c')],null))[_0x6f80('0x27')](respondWithResult(_0x4ce36c,null))[_0x6f80('0x45')](handleError(_0x4ce36c,null));};exports[_0x6f80('0x28')]=function(_0x59077a,_0x4a12a4){return db[_0x6f80('0x2f')][_0x6f80('0x4a')]({'where':{'id':_0x59077a[_0x6f80('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a12a4,null))[_0x6f80('0x27')](removeEntity(_0x4a12a4,null))[_0x6f80('0x45')](handleError(_0x4a12a4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 82d1d31..7edf963 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 _0xf56b=['exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','../../config/logger','api','request-promise','path','rimraf','./intSugarcrmField.attributes'];(function(_0x283348,_0xfef144){var _0x3f1de8=function(_0x490c61){while(--_0x490c61){_0x283348['push'](_0x283348['shift']());}};_0x3f1de8(++_0xfef144);}(_0xf56b,0x123));var _0xbf56=function(_0x3d2b32,_0x201572){_0x3d2b32=_0x3d2b32-0x0;var _0x545405=_0xf56b[_0x3d2b32];return _0x545405;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf56('0x0'))(_0xbf56('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf56('0x2'));var fs=require('fs');var path=require(_0xbf56('0x3'));var rimraf=require(_0xbf56('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf56('0x5'));module[_0xbf56('0x6')]=function(_0x490c7a,_0x9cf7e){return _0x490c7a['define'](_0xbf56('0x7'),attributes,{'tableName':_0xbf56('0x8'),'paranoid':![],'indexes':[{'name':_0xbf56('0x9'),'fields':['idField',_0xbf56('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e06=['FieldId','util','../../config/logger','api','moment','path','../../config/environment','./intSugarcrmField.attributes','exports','define'];(function(_0x409e32,_0x334fe1){var _0x5e0d83=function(_0x1f01f1){while(--_0x1f01f1){_0x409e32['push'](_0x409e32['shift']());}};_0x5e0d83(++_0x334fe1);}(_0x3e06,0x1c3));var _0x63e0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3e06[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x63e0('0x0'));var logger=require(_0x63e0('0x1'))(_0x63e0('0x2'));var moment=require(_0x63e0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63e0('0x4'));var rimraf=require('rimraf');var config=require(_0x63e0('0x5'));var attributes=require(_0x63e0('0x6'));module[_0x63e0('0x7')]=function(_0x31efdf,_0x22f471){return _0x31efdf[_0x63e0('0x8')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x63e0('0x9')],'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 2d4fa19..80ecc62 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 _0x47bd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3071b4,_0x5d2892){var _0x5b1d56=function(_0x3ddd3e){while(--_0x3ddd3e){_0x3071b4['push'](_0x3071b4['shift']());}};_0x5b1d56(++_0x5d2892);}(_0x47bd,0x156));var _0xd47b=function(_0x261d2d,_0x4322d6){_0x261d2d=_0x261d2d-0x0;var _0x42cd72=_0x47bd[_0x261d2d];return _0x42cd72;};'use strict';var _=require(_0xd47b('0x0'));var util=require(_0xd47b('0x1'));var moment=require(_0xd47b('0x2'));var BPromise=require(_0xd47b('0x3'));var rs=require(_0xd47b('0x4'));var fs=require('fs');var Redis=require(_0xd47b('0x5'));var db=require(_0xd47b('0x6'))['db'];var utils=require(_0xd47b('0x7'));var logger=require(_0xd47b('0x8'))(_0xd47b('0x9'));var config=require(_0xd47b('0xa'));var jayson=require(_0xd47b('0xb'));var client=jayson[_0xd47b('0xc')][_0xd47b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x132e5b,_0x7ed1ce,_0xce5196){return new BPromise(function(_0x46d123,_0x18e028){return client[_0xd47b('0xe')](_0x132e5b,_0xce5196)[_0xd47b('0xf')](function(_0x11361c){logger[_0xd47b('0x10')](_0xd47b('0x11'),_0x7ed1ce,_0xd47b('0x12'));logger[_0xd47b('0x13')](_0xd47b('0x14'),_0x7ed1ce,_0xd47b('0x12'),JSON[_0xd47b('0x15')](_0x11361c));if(_0x11361c[_0xd47b('0x16')]){if(_0x11361c['error']['code']===0x1f4){logger['error'](_0xd47b('0x11'),_0x7ed1ce,_0x11361c['error'][_0xd47b('0x17')]);return _0x18e028(_0x11361c[_0xd47b('0x16')][_0xd47b('0x17')]);}logger[_0xd47b('0x16')](_0xd47b('0x11'),_0x7ed1ce,_0x11361c['error'][_0xd47b('0x17')]);return _0x46d123(_0x11361c[_0xd47b('0x16')][_0xd47b('0x17')]);}else{logger['info'](_0xd47b('0x11'),_0x7ed1ce,_0xd47b('0x12'));_0x46d123(_0x11361c[_0xd47b('0x18')][_0xd47b('0x17')]);}})['catch'](function(_0x2be764){logger[_0xd47b('0x16')](_0xd47b('0x11'),_0x7ed1ce,_0x2be764);_0x18e028(_0x2be764);});});} \ No newline at end of file +var _0xeaef=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x413ddf,_0x10ef0d){var _0x21e912=function(_0x3af609){while(--_0x3af609){_0x413ddf['push'](_0x413ddf['shift']());}};_0x21e912(++_0x10ef0d);}(_0xeaef,0x9a));var _0xfeae=function(_0x5d05b6,_0x20fd2d){_0x5d05b6=_0x5d05b6-0x0;var _0x26be89=_0xeaef[_0x5d05b6];return _0x26be89;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var moment=require('moment');var BPromise=require(_0xfeae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfeae('0x4'));var logger=require(_0xfeae('0x5'))('rpc');var config=require(_0xfeae('0x6'));var jayson=require(_0xfeae('0x7'));var client=jayson[_0xfeae('0x8')][_0xfeae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d4392,_0x38496c,_0x4269d7){return new BPromise(function(_0x2e10ea,_0x57a35d){return client['request'](_0x1d4392,_0x4269d7)[_0xfeae('0xa')](function(_0x483a11){logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x38496c,_0xfeae('0xd'));logger[_0xfeae('0xe')](_0xfeae('0xf'),_0x38496c,_0xfeae('0xd'),JSON[_0xfeae('0x10')](_0x483a11));if(_0x483a11[_0xfeae('0x11')]){if(_0x483a11[_0xfeae('0x11')][_0xfeae('0x12')]===0x1f4){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x38496c,_0x483a11[_0xfeae('0x11')][_0xfeae('0x13')]);return _0x57a35d(_0x483a11[_0xfeae('0x11')][_0xfeae('0x13')]);}logger['error'](_0xfeae('0xc'),_0x38496c,_0x483a11[_0xfeae('0x11')]['message']);return _0x2e10ea(_0x483a11[_0xfeae('0x11')][_0xfeae('0x13')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x38496c,_0xfeae('0xd'));_0x2e10ea(_0x483a11[_0xfeae('0x14')][_0xfeae('0x13')]);}})['catch'](function(_0x2a91fe){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x38496c,_0x2a91fe);_0x57a35d(_0x2a91fe);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 45e0d13..0d8e941 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 _0x60e6=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b23c1,_0x4aeeaa){var _0x26ba4c=function(_0x112356){while(--_0x112356){_0x5b23c1['push'](_0x5b23c1['shift']());}};_0x26ba4c(++_0x4aeeaa);}(_0x60e6,0xd2));var _0x660e=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x60e6[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x660e('0x0'));var util=require(_0x660e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x660e('0x2'));var router=express[_0x660e('0x3')]();var fs_extra=require(_0x660e('0x4'));var auth=require(_0x660e('0x5'));var interaction=require(_0x660e('0x6'));var config=require(_0x660e('0x7'));var controller=require(_0x660e('0x8'));router[_0x660e('0x9')]('/',auth[_0x660e('0xa')](),controller['index']);router[_0x660e('0x9')](_0x660e('0xb'),auth[_0x660e('0xa')](),controller['show']);router[_0x660e('0x9')](_0x660e('0xc'),auth['isAuthenticated'](),controller[_0x660e('0xd')]);router[_0x660e('0x9')](_0x660e('0xe'),auth[_0x660e('0xa')](),controller[_0x660e('0xf')]);router[_0x660e('0x10')]('/',auth[_0x660e('0xa')](),controller[_0x660e('0x11')]);router[_0x660e('0x10')](_0x660e('0xc'),auth[_0x660e('0xa')](),controller[_0x660e('0x12')]);router[_0x660e('0x13')]('/:id',auth[_0x660e('0xa')](),controller[_0x660e('0x14')]);router[_0x660e('0x15')](_0x660e('0xb'),auth[_0x660e('0xa')](),controller[_0x660e('0x16')]);module[_0x660e('0x17')]=router; \ No newline at end of file +var _0xa216=['../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x319784,_0x47e6d4){var _0x1917da=function(_0x2cb921){while(--_0x2cb921){_0x319784['push'](_0x319784['shift']());}};_0x1917da(++_0x47e6d4);}(_0xa216,0xf4));var _0x6a21=function(_0x243250,_0x32e04a){_0x243250=_0x243250-0x0;var _0x1b3fff=_0xa216[_0x243250];return _0x1b3fff;};'use strict';var multer=require('multer');var util=require(_0x6a21('0x0'));var path=require(_0x6a21('0x1'));var timeout=require(_0x6a21('0x2'));var express=require(_0x6a21('0x3'));var router=express[_0x6a21('0x4')]();var fs_extra=require(_0x6a21('0x5'));var auth=require(_0x6a21('0x6'));var interaction=require(_0x6a21('0x7'));var config=require(_0x6a21('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x6a21('0x9')]('/',auth[_0x6a21('0xa')](),controller['index']);router['get']('/:id',auth[_0x6a21('0xa')](),controller['show']);router['get'](_0x6a21('0xb'),auth[_0x6a21('0xa')](),controller[_0x6a21('0xc')]);router[_0x6a21('0x9')](_0x6a21('0xd'),auth[_0x6a21('0xa')](),controller['getFields']);router[_0x6a21('0xe')]('/',auth[_0x6a21('0xa')](),controller[_0x6a21('0xf')]);router[_0x6a21('0xe')](_0x6a21('0xb'),auth[_0x6a21('0xa')](),controller['addConfiguration']);router[_0x6a21('0x10')](_0x6a21('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x6a21('0x12')](_0x6a21('0x11'),auth[_0x6a21('0xa')](),controller[_0x6a21('0x13')]);module[_0x6a21('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 8680dea..57a5ce5 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 _0x185a=['STRING','HelpDesk'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x185a,0xcc));var _0xa185=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x185a[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa185('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xa185('0x0')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa185('0x0')],'allowNull':![],'defaultValue':_0xa185('0x1')},'remoteUri':{'type':Sequelize[_0xa185('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa185('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x668b=['HelpDesk','exports','STRING'];(function(_0xd26409,_0xed62a){var _0x2461ed=function(_0x15c314){while(--_0x15c314){_0xd26409['push'](_0xd26409['shift']());}};_0x2461ed(++_0xed62a);}(_0x668b,0x1f0));var _0xb668=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x668b[_0x3bf925];return _0x2128a1;};'use strict';var Sequelize=require('sequelize');module[_0xb668('0x0')]={'name':{'type':Sequelize[_0xb668('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb668('0x1')]},'username':{'type':Sequelize[_0xb668('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb668('0x1')],'allowNull':![],'defaultValue':_0xb668('0x2')},'remoteUri':{'type':Sequelize[_0xb668('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6918da8..77c18c1 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 _0x64b9=['params','body','find','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Descriptions','getDescriptions','create','Subjects','VtigerField','md5','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','sendStatus','stack','name','send','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','catch','show'];(function(_0x5e3115,_0x540600){var _0x5a1dc6=function(_0x1163f5){while(--_0x1163f5){_0x5e3115['push'](_0x5e3115['shift']());}};_0x5a1dc6(++_0x540600);}(_0x64b9,0xaa));var _0x964b=function(_0x2591ef,_0x513a9b){_0x2591ef=_0x2591ef-0x0;var _0x5a999a=_0x64b9[_0x2591ef];return _0x5a999a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x964b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x964b('0x1'));var rp=require('request-promise');var moment=require(_0x964b('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x964b('0x3'));var sox=require(_0x964b('0x4'));var csv=require(_0x964b('0x5'));var ejs=require(_0x964b('0x6'));var fs=require('fs');var fs_extra=require(_0x964b('0x7'));var _=require('lodash');var squel=require(_0x964b('0x8'));var crypto=require(_0x964b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x964b('0xa'));var toCsv=require(_0x964b('0x5'));var querystring=require('querystring');var Papa=require(_0x964b('0xb'));var Redis=require(_0x964b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x964b('0xd'));var as=require(_0x964b('0xe'));var hardwareService=require(_0x964b('0xf'));var logger=require(_0x964b('0x10'))(_0x964b('0x11'));var utils=require(_0x964b('0x12'));var config=require(_0x964b('0x13'));var licenseUtil=require(_0x964b('0x14'));var db=require(_0x964b('0x15'))['db'];var integrations=require(_0x964b('0x16'));function respondWithStatusCode(_0x4bfd79,_0x2283ba){_0x2283ba=_0x2283ba||0xcc;return function(_0x163b08){if(_0x163b08){return _0x4bfd79['sendStatus'](_0x2283ba);}return _0x4bfd79[_0x964b('0x17')](_0x2283ba)['end']();};}function respondWithResult(_0x39c101,_0x182342){_0x182342=_0x182342||0xc8;return function(_0x1e9cd3){if(_0x1e9cd3){return _0x39c101[_0x964b('0x17')](_0x182342)[_0x964b('0x18')](_0x1e9cd3);}};}function respondWithFilteredResult(_0x44c634,_0x3e411e){return function(_0x27d7fb){if(_0x27d7fb){var _0x2576ac=typeof _0x3e411e[_0x964b('0x19')]===_0x964b('0x1a')&&typeof _0x3e411e['limit']==='undefined';var _0x311f85=_0x27d7fb[_0x964b('0x1b')];var _0x345f8d=_0x2576ac?0x0:_0x3e411e[_0x964b('0x19')];var _0x483d5b=_0x2576ac?_0x27d7fb[_0x964b('0x1b')]:_0x3e411e[_0x964b('0x19')]+_0x3e411e[_0x964b('0x1c')];var _0x3f9cf0;if(_0x483d5b>=_0x311f85){_0x483d5b=_0x311f85;_0x3f9cf0=0xc8;}else{_0x3f9cf0=0xce;}_0x44c634[_0x964b('0x17')](_0x3f9cf0);return _0x44c634[_0x964b('0x1d')](_0x964b('0x1e'),_0x345f8d+'-'+_0x483d5b+'/'+_0x311f85)[_0x964b('0x18')](_0x27d7fb);}return null;};}function patchUpdates(_0x165ab4){return function(_0xc26aed){try{jsonpatch['apply'](_0xc26aed,_0x165ab4,!![]);}catch(_0x44772b){return BPromise[_0x964b('0x1f')](_0x44772b);}return _0xc26aed[_0x964b('0x20')]();};}function saveUpdates(_0x190cd9,_0x5d359f){return function(_0x2d56bf){if(_0x2d56bf){return _0x2d56bf['update'](_0x190cd9)[_0x964b('0x21')](function(_0x468008){return _0x468008;});}return null;};}function removeEntity(_0x23f245,_0x4a12ff){return function(_0x2a64d6){if(_0x2a64d6){return _0x2a64d6[_0x964b('0x22')]()['then'](function(){_0x23f245['status'](0xcc)[_0x964b('0x23')]();});}};}function handleEntityNotFound(_0xddc05,_0x4f3686){return function(_0xfd1d78){if(!_0xfd1d78){_0xddc05[_0x964b('0x24')](0x194);}return _0xfd1d78;};}function handleError(_0x2888f1,_0xa27a47){_0xa27a47=_0xa27a47||0x1f4;return function(_0x26da9f){logger['error'](_0x26da9f[_0x964b('0x25')]);if(_0x26da9f[_0x964b('0x26')]){delete _0x26da9f[_0x964b('0x26')];}_0x2888f1[_0x964b('0x17')](_0xa27a47)[_0x964b('0x27')](_0x26da9f);};}exports['index']=function(_0x1a5bec,_0x13ca65){var _0x18897e={},_0x4cb82f={},_0x4dedcf={'count':0x0,'rows':[]};var _0x2fafc5=_['map'](db[_0x964b('0x28')][_0x964b('0x29')],function(_0x17ce88){return{'name':_0x17ce88[_0x964b('0x2a')],'type':_0x17ce88[_0x964b('0x2b')]['key']};});_0x4cb82f[_0x964b('0x2c')]=_['map'](_0x2fafc5,_0x964b('0x26'));_0x4cb82f[_0x964b('0x2d')]=_[_0x964b('0x2e')](_0x1a5bec[_0x964b('0x2d')]);_0x4cb82f['filters']=_[_0x964b('0x2f')](_0x4cb82f[_0x964b('0x2c')],_0x4cb82f[_0x964b('0x2d')]);_0x18897e[_0x964b('0x30')]=_[_0x964b('0x2f')](_0x4cb82f[_0x964b('0x2c')],qs[_0x964b('0x31')](_0x1a5bec[_0x964b('0x2d')]['fields']));_0x18897e['attributes']=_0x18897e[_0x964b('0x30')][_0x964b('0x32')]?_0x18897e[_0x964b('0x30')]:_0x4cb82f[_0x964b('0x2c')];if(!_0x1a5bec[_0x964b('0x2d')][_0x964b('0x33')]('nolimit')){_0x18897e[_0x964b('0x1c')]=qs[_0x964b('0x1c')](_0x1a5bec[_0x964b('0x2d')][_0x964b('0x1c')]);_0x18897e[_0x964b('0x19')]=qs[_0x964b('0x19')](_0x1a5bec[_0x964b('0x2d')]['offset']);}_0x18897e[_0x964b('0x34')]=qs[_0x964b('0x35')](_0x1a5bec[_0x964b('0x2d')][_0x964b('0x35')]);_0x18897e[_0x964b('0x36')]=qs[_0x964b('0x37')](_[_0x964b('0x38')](_0x1a5bec[_0x964b('0x2d')],_0x4cb82f[_0x964b('0x37')]),_0x2fafc5);if(_0x1a5bec[_0x964b('0x2d')][_0x964b('0x39')]){_0x18897e[_0x964b('0x36')]=_[_0x964b('0x3a')](_0x18897e[_0x964b('0x36')],{'$or':_[_0x964b('0x3b')](_0x2fafc5,function(_0x50bbb9){if(_0x50bbb9['type']!=='VIRTUAL'){var _0x5ee80f={};_0x5ee80f[_0x50bbb9[_0x964b('0x26')]]={'$like':'%'+_0x1a5bec[_0x964b('0x2d')][_0x964b('0x39')]+'%'};return _0x5ee80f;}})});}_0x18897e=_[_0x964b('0x3a')]({},_0x18897e,_0x1a5bec[_0x964b('0x3c')]);var _0x170edc={'where':_0x18897e[_0x964b('0x36')]};return db[_0x964b('0x28')]['count'](_0x170edc)[_0x964b('0x21')](function(_0x3e97bc){_0x4dedcf[_0x964b('0x1b')]=_0x3e97bc;if(_0x1a5bec[_0x964b('0x2d')][_0x964b('0x3d')]){_0x18897e[_0x964b('0x3e')]=[{'all':!![]}];}return db['VtigerAccount'][_0x964b('0x3f')](_0x18897e);})[_0x964b('0x21')](function(_0x23c028){_0x4dedcf['rows']=_0x23c028;return _0x4dedcf;})[_0x964b('0x21')](respondWithFilteredResult(_0x13ca65,_0x18897e))[_0x964b('0x40')](handleError(_0x13ca65,null));};exports[_0x964b('0x41')]=function(_0x226359,_0x9c38c9){var _0x2db0c4={'raw':![],'where':{'id':_0x226359[_0x964b('0x42')]['id']}},_0xe89131={};_0xe89131[_0x964b('0x2c')]=_[_0x964b('0x2e')](db[_0x964b('0x28')][_0x964b('0x29')]);_0xe89131[_0x964b('0x2d')]=_['keys'](_0x226359[_0x964b('0x2d')]);_0xe89131[_0x964b('0x37')]=_[_0x964b('0x2f')](_0xe89131[_0x964b('0x2c')],_0xe89131['query']);_0x2db0c4[_0x964b('0x30')]=_[_0x964b('0x2f')](_0xe89131[_0x964b('0x2c')],qs[_0x964b('0x31')](_0x226359[_0x964b('0x2d')][_0x964b('0x31')]));_0x2db0c4['attributes']=_0x2db0c4[_0x964b('0x30')][_0x964b('0x32')]?_0x2db0c4[_0x964b('0x30')]:_0xe89131[_0x964b('0x2c')];if(_0x226359['query'][_0x964b('0x3d')]){_0x2db0c4[_0x964b('0x3e')]=[{'all':!![]}];}_0x2db0c4=_[_0x964b('0x3a')]({},_0x2db0c4,_0x226359[_0x964b('0x3c')]);return db[_0x964b('0x28')]['find'](_0x2db0c4)[_0x964b('0x21')](handleEntityNotFound(_0x9c38c9,null))[_0x964b('0x21')](respondWithResult(_0x9c38c9,null))[_0x964b('0x40')](handleError(_0x9c38c9,null));};exports['create']=function(_0x3695b6,_0x1060e3){return db[_0x964b('0x28')]['create'](_0x3695b6[_0x964b('0x43')],{})[_0x964b('0x21')](respondWithResult(_0x1060e3,0xc9))['catch'](handleError(_0x1060e3,null));};exports['update']=function(_0xd54ece,_0xcf815a){if(_0xd54ece['body']['id']){delete _0xd54ece[_0x964b('0x43')]['id'];}return db[_0x964b('0x28')]['find']({'where':{'id':_0xd54ece[_0x964b('0x42')]['id']}})['then'](handleEntityNotFound(_0xcf815a,null))['then'](saveUpdates(_0xd54ece['body'],null))['then'](respondWithResult(_0xcf815a,null))[_0x964b('0x40')](handleError(_0xcf815a,null));};exports[_0x964b('0x22')]=function(_0x15ec83,_0x4fc050){return db['VtigerAccount'][_0x964b('0x44')]({'where':{'id':_0x15ec83['params']['id']}})[_0x964b('0x21')](handleEntityNotFound(_0x4fc050,null))[_0x964b('0x21')](removeEntity(_0x4fc050,null))[_0x964b('0x40')](handleError(_0x4fc050,null));};exports[_0x964b('0x45')]=function(_0x144d0c,_0x4abb2e,_0x5dabcd){var _0x285558={};var _0x1a18af={};var _0x4b439f;var _0x470e9a;return db[_0x964b('0x28')][_0x964b('0x46')]({'where':{'id':_0x144d0c[_0x964b('0x42')]['id']}})['then'](handleEntityNotFound(_0x4abb2e,null))[_0x964b('0x21')](function(_0x592e53){if(_0x592e53){_0x4b439f=_0x592e53;_0x1a18af[_0x964b('0x2c')]=_[_0x964b('0x2e')](db[_0x964b('0x47')][_0x964b('0x29')]);_0x1a18af['query']=_['keys'](_0x144d0c['query']);_0x1a18af[_0x964b('0x37')]=_[_0x964b('0x2f')](_0x1a18af[_0x964b('0x2c')],_0x1a18af['query']);_0x285558[_0x964b('0x30')]=_['intersection'](_0x1a18af[_0x964b('0x2c')],qs[_0x964b('0x31')](_0x144d0c[_0x964b('0x2d')]['fields']));_0x285558[_0x964b('0x30')]=_0x285558[_0x964b('0x30')][_0x964b('0x32')]?_0x285558[_0x964b('0x30')]:_0x1a18af['model'];_0x285558[_0x964b('0x34')]=qs[_0x964b('0x35')](_0x144d0c[_0x964b('0x2d')][_0x964b('0x35')]);_0x285558[_0x964b('0x36')]=qs[_0x964b('0x37')](_[_0x964b('0x38')](_0x144d0c[_0x964b('0x2d')],_0x1a18af[_0x964b('0x37')]));if(_0x144d0c['query'][_0x964b('0x39')]){_0x285558[_0x964b('0x36')]=_[_0x964b('0x3a')](_0x285558[_0x964b('0x36')],{'$or':_[_0x964b('0x3b')](_0x285558['attributes'],function(_0x48ea2e){var _0x29ec11={};_0x29ec11[_0x48ea2e]={'$like':'%'+_0x144d0c[_0x964b('0x2d')][_0x964b('0x39')]+'%'};return _0x29ec11;})});}_0x285558=_[_0x964b('0x3a')]({},_0x285558,_0x144d0c[_0x964b('0x3c')]);return _0x4b439f['getConfigurations'](_0x285558);}})[_0x964b('0x21')](function(_0x1d474e){if(_0x1d474e){_0x470e9a=_0x1d474e['length'];if(!_0x144d0c['query'][_0x964b('0x33')](_0x964b('0x48'))){_0x285558[_0x964b('0x1c')]=qs[_0x964b('0x1c')](_0x144d0c['query'][_0x964b('0x1c')]);_0x285558[_0x964b('0x19')]=qs[_0x964b('0x19')](_0x144d0c[_0x964b('0x2d')]['offset']);}return _0x4b439f[_0x964b('0x45')](_0x285558);}})[_0x964b('0x21')](function(_0x1e304a){if(_0x1e304a){return _0x1e304a?{'count':_0x470e9a,'rows':_0x1e304a}:null;}})[_0x964b('0x21')](respondWithResult(_0x4abb2e,null))[_0x964b('0x40')](handleError(_0x4abb2e,null));};exports[_0x964b('0x49')]=function(_0xd5c141,_0x15d768,_0x459f62){if(_0xd5c141['body']['id']){delete _0xd5c141[_0x964b('0x43')]['id'];}return db['VtigerAccount'][_0x964b('0x46')]({'where':{'id':_0xd5c141['params']['id']}})[_0x964b('0x21')](handleEntityNotFound(_0x15d768,null))[_0x964b('0x21')](function(_0x400b08){if(_0x400b08){_0xd5c141[_0x964b('0x43')][_0x964b('0x4a')]=_0x400b08['id'];_0xd5c141['body']['Subjects']=integrations['getSubjects'](_0xd5c141[_0x964b('0x43')]['channel'],_0xd5c141[_0x964b('0x43')][_0x964b('0x2b')]);_0xd5c141[_0x964b('0x43')][_0x964b('0x4b')]=integrations[_0x964b('0x4c')](_0xd5c141[_0x964b('0x43')]['channel'],_0xd5c141[_0x964b('0x43')][_0x964b('0x2b')]);return db[_0x964b('0x47')][_0x964b('0x4d')](_0xd5c141[_0x964b('0x43')],{'include':[{'model':db['VtigerField'],'as':_0x964b('0x4e')},{'model':db[_0x964b('0x4f')],'as':_0x964b('0x4b')}]});}return null;})[_0x964b('0x21')](respondWithResult(_0x15d768,null))[_0x964b('0x40')](handleError(_0x15d768,null));};var md5=require(_0x964b('0x50'));exports['getFields']=function(_0x37507b,_0x82b2b1,_0xaaefa8){var _0x1fefae=null;var _0x2ec556=null;var _0x3b8f99=null;var _0x2e0029=null;var _0x3a242b='';return db[_0x964b('0x28')][_0x964b('0x46')]({'where':{'id':_0x37507b[_0x964b('0x42')]['id']},'attributes':['id','name',_0x964b('0x51'),'description',_0x964b('0x52'),_0x964b('0x53'),_0x964b('0x54'),_0x964b('0x55')]})[_0x964b('0x21')](handleEntityNotFound(_0x82b2b1,null))[_0x964b('0x21')](function(_0x2b1387){if(_0x2b1387){_0x1fefae=_0x2b1387[_0x964b('0x51')];_0x2ec556=_0x2b1387['accessKey'];_0x3b8f99=_0x2b1387[_0x964b('0x52')];_0x3a242b=_0x2b1387[_0x964b('0x53')];var _0x3a22cb=_0x3a242b[_0x964b('0x56')](-0x1);if(_0x3a22cb==='/'){_0x3a242b=_0x3a242b[_0x964b('0x57')](0x0,_0x3a242b[_0x964b('0x58')](_0x3a22cb));}_0x2e0029=util[_0x964b('0x59')](_0x964b('0x5a'),_0x3a242b);var _0x1a2540={'method':_0x964b('0x5b'),'uri':_0x2e0029,'qs':{'operation':_0x964b('0x5c'),'username':_0x2b1387[_0x964b('0x51')]},'json':!![]};return rp(_0x1a2540);}})[_0x964b('0x21')](function(_0x3a0dfe){if(_0x3a0dfe[_0x964b('0x5d')]){var _0xf8cbf1={'method':_0x964b('0x5e'),'uri':_0x2e0029,'form':{'operation':_0x964b('0x5f'),'username':_0x1fefae,'accessKey':md5(_0x3a0dfe[_0x964b('0x60')][_0x964b('0x61')]+_0x2ec556)},'json':!![]};return rp(_0xf8cbf1);}})[_0x964b('0x21')](function(_0x2a3d7d){if(_0x2a3d7d[_0x964b('0x5d')]){var _0x36d323={'method':'GET','uri':_0x2e0029,'qs':{'operation':_0x964b('0x62'),'username':_0x1fefae,'sessionName':_0x2a3d7d[_0x964b('0x60')][_0x964b('0x63')],'elementType':_0x3b8f99},'json':!![]};return rp(_0x36d323);}})['then'](function(_0x127992){if(_0x127992[_0x964b('0x5d')]){var _0x2b34a2=['autogenerated','reference','owner'];_[_0x964b('0x64')](_0x127992['result'][_0x964b('0x31')],function(_0x46e5a9){return _0x2b34a2[_0x964b('0x65')](_0x46e5a9['type'][_0x964b('0x26')]);});_[_0x964b('0x64')](_0x127992[_0x964b('0x60')][_0x964b('0x31')],function(_0x1ce1fe){return _0x1ce1fe[_0x964b('0x66')]===_0x964b('0x67');});return{'count':_0x127992[_0x964b('0x60')][_0x964b('0x31')][_0x964b('0x32')],'rows':_[_0x964b('0x3b')](_0x127992[_0x964b('0x60')]['fields'],function(_0x3ebc0c){return{'id':_0x3ebc0c[_0x964b('0x26')],'name':_0x3ebc0c[_0x964b('0x68')],'custom':_[_0x964b('0x69')](_0x3ebc0c[_0x964b('0x26')],_0x964b('0x6a'))?!![]:![],'options':_0x3ebc0c['type'][_0x964b('0x26')]===_0x964b('0x6b')&&_0x3ebc0c[_0x964b('0x2b')][_0x964b('0x6c')][_0x964b('0x32')]>0x0?_[_0x964b('0x3b')](_0x3ebc0c[_0x964b('0x2b')][_0x964b('0x6c')],function(_0x24cc49){return{'name':_0x24cc49[_0x964b('0x68')],'value':_0x24cc49[_0x964b('0x6d')]};}):[]};})};}})[_0x964b('0x21')](respondWithResult(_0x82b2b1,null))[_0x964b('0x40')](function(_0x15eff0){console[_0x964b('0x6e')](_0x964b('0x6f')+_0x15eff0);var _0x4e62d7=_0x37507b[_0x964b('0x2d')][_0x964b('0x70')]?0x1f4:_0x15eff0[_0x964b('0x71')]||0x1f4;logger['error'](_0x964b('0x72'),_0x964b('0x73'),_0x4e62d7,JSON[_0x964b('0x74')](_0x15eff0));delete _0x15eff0[_0x964b('0x26')];if(_0x4e62d7===0x191){_0x4e62d7=0x190;}_0x82b2b1[_0x964b('0x17')](_0x4e62d7)[_0x964b('0x27')](_0x37507b[_0x964b('0x2d')][_0x964b('0x70')]?{'message':_0x964b('0x75'),'statusCode':_0x15eff0['statusCode']}:_0x15eff0);});}; \ No newline at end of file +var _0x3009=['getDescriptions','VtigerField','md5','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','success','describe','sessionName','autogenerated','reference','owner','remove','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','offset','count','set','Content-Range','apply','save','destroy','sendStatus','error','name','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','show','params','find','create','body','update','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x440a65,_0xf19541){var _0x5320be=function(_0x5402f4){while(--_0x5402f4){_0x440a65['push'](_0x440a65['shift']());}};_0x5320be(++_0xf19541);}(_0x3009,0xa2));var _0x9300=function(_0x26c955,_0x56b92a){_0x26c955=_0x26c955-0x0;var _0x1938af=_0x3009[_0x26c955];return _0x1938af;};'use strict';var emlformat=require(_0x9300('0x0'));var rimraf=require(_0x9300('0x1'));var zipdir=require(_0x9300('0x2'));var jsonpatch=require(_0x9300('0x3'));var rp=require(_0x9300('0x4'));var moment=require('moment');var BPromise=require(_0x9300('0x5'));var Mustache=require(_0x9300('0x6'));var util=require('util');var path=require(_0x9300('0x7'));var sox=require(_0x9300('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9300('0x9'));var _=require(_0x9300('0xa'));var squel=require('squel');var crypto=require(_0x9300('0xb'));var jsforce=require(_0x9300('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9300('0xd'));var querystring=require(_0x9300('0xe'));var Papa=require('papaparse');var Redis=require(_0x9300('0xf'));var authService=require(_0x9300('0x10'));var qs=require(_0x9300('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9300('0x12'));var logger=require(_0x9300('0x13'))(_0x9300('0x14'));var utils=require(_0x9300('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9300('0x16'));var db=require(_0x9300('0x17'))['db'];var integrations=require(_0x9300('0x18'));function respondWithStatusCode(_0x1fd834,_0x9c1b4){_0x9c1b4=_0x9c1b4||0xcc;return function(_0xc70be0){if(_0xc70be0){return _0x1fd834['sendStatus'](_0x9c1b4);}return _0x1fd834[_0x9300('0x19')](_0x9c1b4)[_0x9300('0x1a')]();};}function respondWithResult(_0x2c9f09,_0x47ba6b){_0x47ba6b=_0x47ba6b||0xc8;return function(_0x5a21f5){if(_0x5a21f5){return _0x2c9f09[_0x9300('0x19')](_0x47ba6b)[_0x9300('0x1b')](_0x5a21f5);}};}function respondWithFilteredResult(_0x16e036,_0x21d666){return function(_0x356cfa){if(_0x356cfa){var _0x3a118f=typeof _0x21d666['offset']==='undefined'&&typeof _0x21d666['limit']===_0x9300('0x1c');var _0x99d1bb=_0x356cfa['count'];var _0x4a087f=_0x3a118f?0x0:_0x21d666[_0x9300('0x1d')];var _0x4261e0=_0x3a118f?_0x356cfa[_0x9300('0x1e')]:_0x21d666[_0x9300('0x1d')]+_0x21d666['limit'];var _0x1bde4e;if(_0x4261e0>=_0x99d1bb){_0x4261e0=_0x99d1bb;_0x1bde4e=0xc8;}else{_0x1bde4e=0xce;}_0x16e036['status'](_0x1bde4e);return _0x16e036[_0x9300('0x1f')](_0x9300('0x20'),_0x4a087f+'-'+_0x4261e0+'/'+_0x99d1bb)[_0x9300('0x1b')](_0x356cfa);}return null;};}function patchUpdates(_0x10ed38){return function(_0x1fcb3e){try{jsonpatch[_0x9300('0x21')](_0x1fcb3e,_0x10ed38,!![]);}catch(_0x4eae8e){return BPromise['reject'](_0x4eae8e);}return _0x1fcb3e[_0x9300('0x22')]();};}function saveUpdates(_0x4dda63,_0x3917c0){return function(_0x15beda){if(_0x15beda){return _0x15beda['update'](_0x4dda63)['then'](function(_0x3dfce4){return _0x3dfce4;});}return null;};}function removeEntity(_0x34b0de,_0x13ec94){return function(_0x54de1f){if(_0x54de1f){return _0x54de1f[_0x9300('0x23')]()['then'](function(){_0x34b0de[_0x9300('0x19')](0xcc)[_0x9300('0x1a')]();});}};}function handleEntityNotFound(_0x2dd970,_0x270cb8){return function(_0xffc522){if(!_0xffc522){_0x2dd970[_0x9300('0x24')](0x194);}return _0xffc522;};}function handleError(_0x4a55b4,_0x85b162){_0x85b162=_0x85b162||0x1f4;return function(_0x4dd239){logger[_0x9300('0x25')](_0x4dd239['stack']);if(_0x4dd239['name']){delete _0x4dd239[_0x9300('0x26')];}_0x4a55b4[_0x9300('0x19')](_0x85b162)['send'](_0x4dd239);};}exports['index']=function(_0x3dcb7f,_0x235efd){var _0x1fe6c9={},_0x333817={},_0x4fb9cf={'count':0x0,'rows':[]};var _0x2bd194=_[_0x9300('0x27')](db[_0x9300('0x28')][_0x9300('0x29')],function(_0x583c3c){return{'name':_0x583c3c[_0x9300('0x2a')],'type':_0x583c3c[_0x9300('0x2b')][_0x9300('0x2c')]};});_0x333817[_0x9300('0x2d')]=_[_0x9300('0x27')](_0x2bd194,_0x9300('0x26'));_0x333817['query']=_[_0x9300('0x2e')](_0x3dcb7f[_0x9300('0x2f')]);_0x333817[_0x9300('0x30')]=_[_0x9300('0x31')](_0x333817[_0x9300('0x2d')],_0x333817[_0x9300('0x2f')]);_0x1fe6c9[_0x9300('0x32')]=_[_0x9300('0x31')](_0x333817[_0x9300('0x2d')],qs[_0x9300('0x33')](_0x3dcb7f[_0x9300('0x2f')][_0x9300('0x33')]));_0x1fe6c9['attributes']=_0x1fe6c9['attributes'][_0x9300('0x34')]?_0x1fe6c9[_0x9300('0x32')]:_0x333817[_0x9300('0x2d')];if(!_0x3dcb7f[_0x9300('0x2f')][_0x9300('0x35')](_0x9300('0x36'))){_0x1fe6c9[_0x9300('0x37')]=qs['limit'](_0x3dcb7f['query'][_0x9300('0x37')]);_0x1fe6c9[_0x9300('0x1d')]=qs[_0x9300('0x1d')](_0x3dcb7f[_0x9300('0x2f')]['offset']);}_0x1fe6c9[_0x9300('0x38')]=qs[_0x9300('0x39')](_0x3dcb7f[_0x9300('0x2f')][_0x9300('0x39')]);_0x1fe6c9[_0x9300('0x3a')]=qs[_0x9300('0x30')](_[_0x9300('0x3b')](_0x3dcb7f['query'],_0x333817[_0x9300('0x30')]),_0x2bd194);if(_0x3dcb7f['query']['filter']){_0x1fe6c9[_0x9300('0x3a')]=_['merge'](_0x1fe6c9[_0x9300('0x3a')],{'$or':_[_0x9300('0x27')](_0x2bd194,function(_0x4eed82){if(_0x4eed82['type']!==_0x9300('0x3c')){var _0x11eb43={};_0x11eb43[_0x4eed82[_0x9300('0x26')]]={'$like':'%'+_0x3dcb7f['query']['filter']+'%'};return _0x11eb43;}})});}_0x1fe6c9=_[_0x9300('0x3d')]({},_0x1fe6c9,_0x3dcb7f[_0x9300('0x3e')]);var _0x36ec08={'where':_0x1fe6c9[_0x9300('0x3a')]};return db[_0x9300('0x28')][_0x9300('0x1e')](_0x36ec08)[_0x9300('0x3f')](function(_0x1a86f0){_0x4fb9cf[_0x9300('0x1e')]=_0x1a86f0;if(_0x3dcb7f[_0x9300('0x2f')][_0x9300('0x40')]){_0x1fe6c9['include']=[{'all':!![]}];}return db[_0x9300('0x28')][_0x9300('0x41')](_0x1fe6c9);})[_0x9300('0x3f')](function(_0x53e85a){_0x4fb9cf[_0x9300('0x42')]=_0x53e85a;return _0x4fb9cf;})[_0x9300('0x3f')](respondWithFilteredResult(_0x235efd,_0x1fe6c9))[_0x9300('0x43')](handleError(_0x235efd,null));};exports[_0x9300('0x44')]=function(_0x43522b,_0x3280fd){var _0x429b8a={'raw':![],'where':{'id':_0x43522b[_0x9300('0x45')]['id']}},_0x20cdad={};_0x20cdad['model']=_['keys'](db[_0x9300('0x28')][_0x9300('0x29')]);_0x20cdad[_0x9300('0x2f')]=_[_0x9300('0x2e')](_0x43522b['query']);_0x20cdad[_0x9300('0x30')]=_[_0x9300('0x31')](_0x20cdad[_0x9300('0x2d')],_0x20cdad[_0x9300('0x2f')]);_0x429b8a['attributes']=_['intersection'](_0x20cdad[_0x9300('0x2d')],qs[_0x9300('0x33')](_0x43522b['query'][_0x9300('0x33')]));_0x429b8a[_0x9300('0x32')]=_0x429b8a['attributes']['length']?_0x429b8a[_0x9300('0x32')]:_0x20cdad['model'];if(_0x43522b[_0x9300('0x2f')][_0x9300('0x40')]){_0x429b8a['include']=[{'all':!![]}];}_0x429b8a=_[_0x9300('0x3d')]({},_0x429b8a,_0x43522b[_0x9300('0x3e')]);return db['VtigerAccount'][_0x9300('0x46')](_0x429b8a)[_0x9300('0x3f')](handleEntityNotFound(_0x3280fd,null))[_0x9300('0x3f')](respondWithResult(_0x3280fd,null))[_0x9300('0x43')](handleError(_0x3280fd,null));};exports[_0x9300('0x47')]=function(_0x1cb250,_0x27d218){return db[_0x9300('0x28')][_0x9300('0x47')](_0x1cb250[_0x9300('0x48')],{})['then'](respondWithResult(_0x27d218,0xc9))['catch'](handleError(_0x27d218,null));};exports[_0x9300('0x49')]=function(_0xbbe4e2,_0x2a7389){if(_0xbbe4e2[_0x9300('0x48')]['id']){delete _0xbbe4e2[_0x9300('0x48')]['id'];}return db[_0x9300('0x28')]['find']({'where':{'id':_0xbbe4e2[_0x9300('0x45')]['id']}})[_0x9300('0x3f')](handleEntityNotFound(_0x2a7389,null))[_0x9300('0x3f')](saveUpdates(_0xbbe4e2['body'],null))[_0x9300('0x3f')](respondWithResult(_0x2a7389,null))[_0x9300('0x43')](handleError(_0x2a7389,null));};exports[_0x9300('0x23')]=function(_0x5a1609,_0x1b3b47){return db[_0x9300('0x28')][_0x9300('0x46')]({'where':{'id':_0x5a1609['params']['id']}})[_0x9300('0x3f')](handleEntityNotFound(_0x1b3b47,null))['then'](removeEntity(_0x1b3b47,null))['catch'](handleError(_0x1b3b47,null));};exports['getConfigurations']=function(_0x6e78c5,_0x20d454,_0x7b5794){var _0x54461f={};var _0x466de8={};var _0x16b4d0;var _0x5a690b;return db['VtigerAccount'][_0x9300('0x4a')]({'where':{'id':_0x6e78c5[_0x9300('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d454,null))[_0x9300('0x3f')](function(_0x4469e8){if(_0x4469e8){_0x16b4d0=_0x4469e8;_0x466de8['model']=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x466de8[_0x9300('0x2f')]=_[_0x9300('0x2e')](_0x6e78c5[_0x9300('0x2f')]);_0x466de8['filters']=_[_0x9300('0x31')](_0x466de8['model'],_0x466de8[_0x9300('0x2f')]);_0x54461f[_0x9300('0x32')]=_[_0x9300('0x31')](_0x466de8[_0x9300('0x2d')],qs[_0x9300('0x33')](_0x6e78c5[_0x9300('0x2f')][_0x9300('0x33')]));_0x54461f[_0x9300('0x32')]=_0x54461f[_0x9300('0x32')][_0x9300('0x34')]?_0x54461f[_0x9300('0x32')]:_0x466de8['model'];_0x54461f[_0x9300('0x38')]=qs[_0x9300('0x39')](_0x6e78c5['query'][_0x9300('0x39')]);_0x54461f[_0x9300('0x3a')]=qs[_0x9300('0x30')](_['pick'](_0x6e78c5[_0x9300('0x2f')],_0x466de8[_0x9300('0x30')]));if(_0x6e78c5[_0x9300('0x2f')]['filter']){_0x54461f[_0x9300('0x3a')]=_['merge'](_0x54461f['where'],{'$or':_['map'](_0x54461f[_0x9300('0x32')],function(_0x6a15f2){var _0x3386c8={};_0x3386c8[_0x6a15f2]={'$like':'%'+_0x6e78c5[_0x9300('0x2f')]['filter']+'%'};return _0x3386c8;})});}_0x54461f=_[_0x9300('0x3d')]({},_0x54461f,_0x6e78c5['options']);return _0x16b4d0[_0x9300('0x4b')](_0x54461f);}})[_0x9300('0x3f')](function(_0x5c2590){if(_0x5c2590){_0x5a690b=_0x5c2590[_0x9300('0x34')];if(!_0x6e78c5[_0x9300('0x2f')][_0x9300('0x35')](_0x9300('0x36'))){_0x54461f[_0x9300('0x37')]=qs[_0x9300('0x37')](_0x6e78c5[_0x9300('0x2f')][_0x9300('0x37')]);_0x54461f[_0x9300('0x1d')]=qs[_0x9300('0x1d')](_0x6e78c5['query']['offset']);}return _0x16b4d0[_0x9300('0x4b')](_0x54461f);}})[_0x9300('0x3f')](function(_0x5c2ac1){if(_0x5c2ac1){return _0x5c2ac1?{'count':_0x5a690b,'rows':_0x5c2ac1}:null;}})[_0x9300('0x3f')](respondWithResult(_0x20d454,null))[_0x9300('0x43')](handleError(_0x20d454,null));};exports[_0x9300('0x4c')]=function(_0x544d4d,_0x5a6bc9,_0x1ca40f){if(_0x544d4d[_0x9300('0x48')]['id']){delete _0x544d4d[_0x9300('0x48')]['id'];}return db[_0x9300('0x28')][_0x9300('0x4a')]({'where':{'id':_0x544d4d[_0x9300('0x45')]['id']}})[_0x9300('0x3f')](handleEntityNotFound(_0x5a6bc9,null))[_0x9300('0x3f')](function(_0x3f15a8){if(_0x3f15a8){_0x544d4d['body'][_0x9300('0x4d')]=_0x3f15a8['id'];_0x544d4d['body'][_0x9300('0x4e')]=integrations[_0x9300('0x4f')](_0x544d4d[_0x9300('0x48')][_0x9300('0x50')],_0x544d4d[_0x9300('0x48')][_0x9300('0x2b')]);_0x544d4d[_0x9300('0x48')][_0x9300('0x51')]=integrations[_0x9300('0x52')](_0x544d4d['body']['channel'],_0x544d4d[_0x9300('0x48')][_0x9300('0x2b')]);return db['VtigerConfiguration'][_0x9300('0x47')](_0x544d4d['body'],{'include':[{'model':db[_0x9300('0x53')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x9300('0x51')}]});}return null;})['then'](respondWithResult(_0x5a6bc9,null))[_0x9300('0x43')](handleError(_0x5a6bc9,null));};var md5=require(_0x9300('0x54'));exports[_0x9300('0x55')]=function(_0x3bacdb,_0x5dd47c,_0x1acf10){var _0x13842a=null;var _0x196015=null;var _0x2ac8ae=null;var _0x515e6a=null;var _0x500f56='';return db[_0x9300('0x28')]['findOne']({'where':{'id':_0x3bacdb[_0x9300('0x45')]['id']},'attributes':['id',_0x9300('0x26'),_0x9300('0x56'),_0x9300('0x57'),_0x9300('0x58'),'remoteUri',_0x9300('0x59'),'accessKey']})['then'](handleEntityNotFound(_0x5dd47c,null))[_0x9300('0x3f')](function(_0x4e7da8){if(_0x4e7da8){_0x13842a=_0x4e7da8[_0x9300('0x56')];_0x196015=_0x4e7da8[_0x9300('0x5a')];_0x2ac8ae=_0x4e7da8[_0x9300('0x58')];_0x500f56=_0x4e7da8[_0x9300('0x5b')];var _0x36d38d=_0x500f56[_0x9300('0x5c')](-0x1);if(_0x36d38d==='/'){_0x500f56=_0x500f56[_0x9300('0x5d')](0x0,_0x500f56[_0x9300('0x5e')](_0x36d38d));}_0x515e6a=util[_0x9300('0x5f')](_0x9300('0x60'),_0x500f56);var _0x29fdaf={'method':_0x9300('0x61'),'uri':_0x515e6a,'qs':{'operation':_0x9300('0x62'),'username':_0x4e7da8[_0x9300('0x56')]},'json':!![]};return rp(_0x29fdaf);}})[_0x9300('0x3f')](function(_0x5c7b05){if(_0x5c7b05['success']){var _0x4210e0={'method':_0x9300('0x63'),'uri':_0x515e6a,'form':{'operation':_0x9300('0x64'),'username':_0x13842a,'accessKey':md5(_0x5c7b05[_0x9300('0x65')]['token']+_0x196015)},'json':!![]};return rp(_0x4210e0);}})[_0x9300('0x3f')](function(_0x45b840){if(_0x45b840[_0x9300('0x66')]){var _0x186f72={'method':_0x9300('0x61'),'uri':_0x515e6a,'qs':{'operation':_0x9300('0x67'),'username':_0x13842a,'sessionName':_0x45b840[_0x9300('0x65')][_0x9300('0x68')],'elementType':_0x2ac8ae},'json':!![]};return rp(_0x186f72);}})[_0x9300('0x3f')](function(_0x456f07){if(_0x456f07[_0x9300('0x66')]){var _0x3f1865=[_0x9300('0x69'),_0x9300('0x6a'),_0x9300('0x6b')];_[_0x9300('0x6c')](_0x456f07[_0x9300('0x65')][_0x9300('0x33')],function(_0x5452b2){return _0x3f1865['includes'](_0x5452b2[_0x9300('0x2b')]['name']);});_[_0x9300('0x6c')](_0x456f07['result']['fields'],function(_0x3c2302){return _0x3c2302['editable']===_0x9300('0x6d');});return{'count':_0x456f07[_0x9300('0x65')]['fields'][_0x9300('0x34')],'rows':_['map'](_0x456f07[_0x9300('0x65')][_0x9300('0x33')],function(_0x47be72){return{'id':_0x47be72[_0x9300('0x26')],'name':_0x47be72[_0x9300('0x6e')],'custom':_[_0x9300('0x6f')](_0x47be72[_0x9300('0x26')],_0x9300('0x70'))?!![]:![],'options':_0x47be72['type'][_0x9300('0x26')]===_0x9300('0x71')&&_0x47be72[_0x9300('0x2b')][_0x9300('0x72')][_0x9300('0x34')]>0x0?_['map'](_0x47be72[_0x9300('0x2b')][_0x9300('0x72')],function(_0x22df3f){return{'name':_0x22df3f['label'],'value':_0x22df3f[_0x9300('0x73')]};}):[]};})};}})[_0x9300('0x3f')](respondWithResult(_0x5dd47c,null))[_0x9300('0x43')](function(_0x14df93){console[_0x9300('0x74')](_0x9300('0x75')+_0x14df93);var _0x1a0845=_0x3bacdb[_0x9300('0x2f')]['test']?0x1f4:_0x14df93[_0x9300('0x76')]||0x1f4;logger[_0x9300('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1a0845,JSON['stringify'](_0x14df93));delete _0x14df93[_0x9300('0x26')];if(_0x1a0845===0x191){_0x1a0845=0x190;}_0x5dd47c['status'](_0x1a0845)[_0x9300('0x77')](_0x3bacdb[_0x9300('0x2f')][_0x9300('0x78')]?{'message':_0x9300('0x79'),'statusCode':_0x14df93[_0x9300('0x76')]}:_0x14df93);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 109d8bd..ef5af58 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 _0xd97a=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','lodash','../../config/logger','api','request-promise'];(function(_0x40eb4e,_0x4bdbcd){var _0x249c0b=function(_0x34af78){while(--_0x34af78){_0x40eb4e['push'](_0x40eb4e['shift']());}};_0x249c0b(++_0x4bdbcd);}(_0xd97a,0x13c));var _0xad97=function(_0x21dabf,_0x46d99d){_0x21dabf=_0x21dabf-0x0;var _0x44f90f=_0xd97a[_0x21dabf];return _0x44f90f;};'use strict';var _=require(_0xad97('0x0'));var util=require('util');var logger=require(_0xad97('0x1'))(_0xad97('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad97('0x3'));var fs=require('fs');var path=require(_0xad97('0x4'));var rimraf=require(_0xad97('0x5'));var config=require(_0xad97('0x6'));var attributes=require(_0xad97('0x7'));var integrations=require(_0xad97('0x8'));module[_0xad97('0x9')]=function(_0x3b9ec8,_0xd0914a){return _0x3b9ec8['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4da2=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3c6f79,_0x3ed502){var _0x311855=function(_0x35c843){while(--_0x35c843){_0x3c6f79['push'](_0x3c6f79['shift']());}};_0x311855(++_0x3ed502);}(_0x4da2,0xe9));var _0x24da=function(_0x240d57,_0x2af593){_0x240d57=_0x240d57-0x0;var _0x525929=_0x4da2[_0x240d57];return _0x525929;};'use strict';var _=require(_0x24da('0x0'));var util=require(_0x24da('0x1'));var logger=require('../../config/logger')(_0x24da('0x2'));var moment=require(_0x24da('0x3'));var BPromise=require(_0x24da('0x4'));var rp=require(_0x24da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x24da('0x6'));var attributes=require(_0x24da('0x7'));var integrations=require(_0x24da('0x8'));module[_0x24da('0x9')]=function(_0x50e7f0,_0x5133fd){return _0x50e7f0[_0x24da('0xa')](_0x24da('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index cece7df..6ba988f 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 _0x4024=['attributes','include','map','model','then','debug','ShowVtigerAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','options'];(function(_0x1c8e65,_0x3016ea){var _0x4549fc=function(_0x32d776){while(--_0x32d776){_0x1c8e65['push'](_0x1c8e65['shift']());}};_0x4549fc(++_0x3016ea);}(_0x4024,0x89));var _0x4402=function(_0x5c2ed4,_0x392942){_0x5c2ed4=_0x5c2ed4-0x0;var _0x6f63f9=_0x4024[_0x5c2ed4];return _0x6f63f9;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['findAll']({'raw':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x231382[_0x4402('0x16')]?_0x231382['options']['where']||null:null,'attributes':_0x231382[_0x4402('0x16')]?_0x231382[_0x4402('0x16')][_0x4402('0x17')]||null:null,'limit':_0x231382['options']?_0x231382[_0x4402('0x16')]['limit']||null:null,'include':_0x231382['options']?_0x231382[_0x4402('0x16')][_0x4402('0x18')]?_[_0x4402('0x19')](_0x231382[_0x4402('0x16')][_0x4402('0x18')],function(_0x2e6fee){return{'model':db[_0x2e6fee[_0x4402('0x1a')]],'as':_0x2e6fee['as'],'attributes':_0x2e6fee[_0x4402('0x17')],'include':_0x2e6fee[_0x4402('0x18')]?_['map'](_0x2e6fee[_0x4402('0x18')],function(_0x4e1c04){return{'model':db[_0x4e1c04[_0x4402('0x1a')]],'as':_0x4e1c04['as'],'attributes':_0x4e1c04[_0x4402('0x17')],'include':_0x4e1c04[_0x4402('0x18')]?_[_0x4402('0x19')](_0x4e1c04['include'],function(_0x15c19f){return{'model':db[_0x15c19f['model']],'as':_0x15c19f['as'],'attributes':_0x15c19f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x395e49){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x1c')]('GetVtigerAccount',_0x231382,JSON[_0x4402('0xd')](_0x395e49));_0x494389(_0x395e49);})['catch'](function(_0x71da2f){logger[_0x4402('0xe')](_0x4402('0x14'),_0x71da2f['message'],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x71da2f[_0x4402('0x11')]));});});};exports[_0x4402('0x1d')]=function(_0x3f4bcb){var _0x2526d1=this;return new Promise(function(_0x605702,_0x1189b8){return db[_0x4402('0x15')][_0x4402('0x1e')]({'raw':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb['options'][_0x4402('0x1f')]||null:null,'attributes':_0x3f4bcb['options']?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x17')]||null:null,'include':_0x3f4bcb[_0x4402('0x16')]?_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')]?_['map'](_0x3f4bcb[_0x4402('0x16')][_0x4402('0x18')],function(_0x169340){return{'model':db[_0x169340['model']],'as':_0x169340['as'],'attributes':_0x169340[_0x4402('0x17')],'include':_0x169340[_0x4402('0x18')]?_['map'](_0x169340[_0x4402('0x18')],function(_0x437e83){return{'model':db[_0x437e83[_0x4402('0x1a')]],'as':_0x437e83['as'],'attributes':_0x437e83[_0x4402('0x17')],'include':_0x437e83[_0x4402('0x18')]?_[_0x4402('0x19')](_0x437e83[_0x4402('0x18')],function(_0x6e9fb7){return{'model':db[_0x6e9fb7[_0x4402('0x1a')]],'as':_0x6e9fb7['as'],'attributes':_0x6e9fb7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0x1b')](function(_0x28fee8){logger[_0x4402('0xa')]('ShowVtigerAccount',_0x3f4bcb);logger[_0x4402('0x1c')](_0x4402('0x1d'),_0x3f4bcb,JSON['stringify'](_0x28fee8));_0x605702(_0x28fee8);})['catch'](function(_0x2b9d51){logger[_0x4402('0xe')](_0x4402('0x1d'),_0x2b9d51[_0x4402('0x11')],_0x3f4bcb);_0x1189b8(_0x2526d1['error'](0x1f4,_0x2b9d51['message']));});});}; \ No newline at end of file +var _0x1d2d=['error','code','message','result','catch','VtigerAccount','findAll','raw','where','options','attributes','limit','map','include','model','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x291a25,_0x31ae01){var _0x380fab=function(_0x205298){while(--_0x205298){_0x291a25['push'](_0x291a25['shift']());}};_0x380fab(++_0x31ae01);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x44ecb9,_0x9727a0){_0x44ecb9=_0x44ecb9-0x0;var _0x28aee2=_0x1d2d[_0x44ecb9];return _0x28aee2;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var moment=require(_0xd1d2('0x2'));var BPromise=require(_0xd1d2('0x3'));var rs=require(_0xd1d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1d2('0x6'));var config=require(_0xd1d2('0x7'));var jayson=require(_0xd1d2('0x8'));var client=jayson[_0xd1d2('0x9')][_0xd1d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353dbd,_0x55be7a,_0x1eaf41){return new BPromise(function(_0x21bc28,_0x35735f){return client[_0xd1d2('0xb')](_0x353dbd,_0x1eaf41)[_0xd1d2('0xc')](function(_0x59e484){logger[_0xd1d2('0xd')](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));logger[_0xd1d2('0x10')](_0xd1d2('0x11'),_0x55be7a,_0xd1d2('0xf'),JSON[_0xd1d2('0x12')](_0x59e484));if(_0x59e484['error']){if(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x14')]===0x1f4){logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);return _0x35735f(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}logger[_0xd1d2('0x13')](_0xd1d2('0xe'),_0x55be7a,_0x59e484['error'][_0xd1d2('0x15')]);return _0x21bc28(_0x59e484[_0xd1d2('0x13')][_0xd1d2('0x15')]);}else{logger['info'](_0xd1d2('0xe'),_0x55be7a,_0xd1d2('0xf'));_0x21bc28(_0x59e484[_0xd1d2('0x16')][_0xd1d2('0x15')]);}})[_0xd1d2('0x17')](function(_0x2723b3){logger[_0xd1d2('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x55be7a,_0x2723b3);_0x35735f(_0x2723b3);});});}exports['GetVtigerAccount']=function(_0x3be186){var _0x55320b=this;return new Promise(function(_0x247b3a,_0x42565b){return db[_0xd1d2('0x18')][_0xd1d2('0x19')]({'raw':_0x3be186['options']?_0x3be186['options'][_0xd1d2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3be186['options']?_0x3be186['options'][_0xd1d2('0x1b')]||null:null,'attributes':_0x3be186[_0xd1d2('0x1c')]?_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x1d')]||null:null,'limit':_0x3be186['options']?_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x1e')]||null:null,'include':_0x3be186[_0xd1d2('0x1c')]?_0x3be186['options']['include']?_[_0xd1d2('0x1f')](_0x3be186[_0xd1d2('0x1c')][_0xd1d2('0x20')],function(_0x2f92ee){return{'model':db[_0x2f92ee[_0xd1d2('0x21')]],'as':_0x2f92ee['as'],'attributes':_0x2f92ee[_0xd1d2('0x1d')],'include':_0x2f92ee[_0xd1d2('0x20')]?_['map'](_0x2f92ee[_0xd1d2('0x20')],function(_0x42da6d){return{'model':db[_0x42da6d[_0xd1d2('0x21')]],'as':_0x42da6d['as'],'attributes':_0x42da6d[_0xd1d2('0x1d')],'include':_0x42da6d[_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0x42da6d[_0xd1d2('0x20')],function(_0x34faf7){return{'model':db[_0x34faf7[_0xd1d2('0x21')]],'as':_0x34faf7['as'],'attributes':_0x34faf7[_0xd1d2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1d2('0xc')](function(_0x4e1bc2){logger['info'](_0xd1d2('0x22'),_0x3be186);logger[_0xd1d2('0x10')](_0xd1d2('0x22'),_0x3be186,JSON[_0xd1d2('0x12')](_0x4e1bc2));_0x247b3a(_0x4e1bc2);})[_0xd1d2('0x17')](function(_0x48ade1){logger[_0xd1d2('0x13')](_0xd1d2('0x22'),_0x48ade1[_0xd1d2('0x15')],_0x3be186);_0x42565b(_0x55320b['error'](0x1f4,_0x48ade1[_0xd1d2('0x15')]));});});};exports[_0xd1d2('0x23')]=function(_0xbd855a){var _0x56557d=this;return new Promise(function(_0x419db7,_0x18528f){return db[_0xd1d2('0x18')][_0xd1d2('0x24')]({'raw':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1a')]===undefined?!![]:![]:!![],'where':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1b')]||null:null,'attributes':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x1d')]||null:null,'include':_0xbd855a[_0xd1d2('0x1c')]?_0xbd855a[_0xd1d2('0x1c')][_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0xbd855a[_0xd1d2('0x1c')]['include'],function(_0x1541ff){return{'model':db[_0x1541ff[_0xd1d2('0x21')]],'as':_0x1541ff['as'],'attributes':_0x1541ff[_0xd1d2('0x1d')],'include':_0x1541ff['include']?_[_0xd1d2('0x1f')](_0x1541ff['include'],function(_0x57a7fb){return{'model':db[_0x57a7fb[_0xd1d2('0x21')]],'as':_0x57a7fb['as'],'attributes':_0x57a7fb[_0xd1d2('0x1d')],'include':_0x57a7fb[_0xd1d2('0x20')]?_[_0xd1d2('0x1f')](_0x57a7fb[_0xd1d2('0x20')],function(_0x2d2d12){return{'model':db[_0x2d2d12['model']],'as':_0x2d2d12['as'],'attributes':_0x2d2d12[_0xd1d2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1d2('0xc')](function(_0x5bdf40){logger[_0xd1d2('0xd')](_0xd1d2('0x23'),_0xbd855a);logger[_0xd1d2('0x10')](_0xd1d2('0x23'),_0xbd855a,JSON['stringify'](_0x5bdf40));_0x419db7(_0x5bdf40);})['catch'](function(_0x2fd2c5){logger['error']('ShowVtigerAccount',_0x2fd2c5['message'],_0xbd855a);_0x18528f(_0x56557d[_0xd1d2('0x13')](0x1f4,_0x2fd2c5['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 8ac69a3..ea89409 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 _0xaf2b=['/:id','show','get','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index'];(function(_0x379a23,_0x4cbb8b){var _0x29d687=function(_0x42664c){while(--_0x42664c){_0x379a23['push'](_0x379a23['shift']());}};_0x29d687(++_0x4cbb8b);}(_0xaf2b,0x13b));var _0xbaf2=function(_0x5d949e,_0x555707){_0x5d949e=_0x5d949e-0x0;var _0x445c1e=_0xaf2b[_0x5d949e];return _0x445c1e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbaf2('0x0'));var timeout=require(_0xbaf2('0x1'));var express=require('express');var router=express[_0xbaf2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbaf2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbaf2('0x4'));var controller=require(_0xbaf2('0x5'));router['get']('/',auth[_0xbaf2('0x6')](),controller[_0xbaf2('0x7')]);router['get'](_0xbaf2('0x8'),auth[_0xbaf2('0x6')](),controller[_0xbaf2('0x9')]);router[_0xbaf2('0xa')](_0xbaf2('0xb'),auth[_0xbaf2('0x6')](),controller['getFields']);router['get'](_0xbaf2('0xc'),auth[_0xbaf2('0x6')](),controller[_0xbaf2('0xd')]);router[_0xbaf2('0xa')]('/:id/descriptions',auth[_0xbaf2('0x6')](),controller[_0xbaf2('0xe')]);router[_0xbaf2('0xf')]('/',auth[_0xbaf2('0x6')](),controller[_0xbaf2('0x10')]);router[_0xbaf2('0x11')](_0xbaf2('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbaf2('0x12')](_0xbaf2('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2fd9=['connect-timeout','express','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','destroy','multer','util','path'];(function(_0x2d57a9,_0x5ae060){var _0x1b9671=function(_0x95fb4e){while(--_0x95fb4e){_0x2d57a9['push'](_0x2d57a9['shift']());}};_0x1b9671(++_0x5ae060);}(_0x2fd9,0x75));var _0x92fd=function(_0x1a3b58,_0xd5ba9a){_0x1a3b58=_0x1a3b58-0x0;var _0x1c0814=_0x2fd9[_0x1a3b58];return _0x1c0814;};'use strict';var multer=require(_0x92fd('0x0'));var util=require(_0x92fd('0x1'));var path=require(_0x92fd('0x2'));var timeout=require(_0x92fd('0x3'));var express=require(_0x92fd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x92fd('0x5'));var controller=require(_0x92fd('0x6'));router[_0x92fd('0x7')]('/',auth[_0x92fd('0x8')](),controller[_0x92fd('0x9')]);router[_0x92fd('0x7')](_0x92fd('0xa'),auth[_0x92fd('0x8')](),controller[_0x92fd('0xb')]);router[_0x92fd('0x7')]('/:id/fields',auth[_0x92fd('0x8')](),controller[_0x92fd('0xc')]);router[_0x92fd('0x7')](_0x92fd('0xd'),auth[_0x92fd('0x8')](),controller[_0x92fd('0xe')]);router[_0x92fd('0x7')](_0x92fd('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x92fd('0x10')]('/',auth[_0x92fd('0x8')](),controller['create']);router[_0x92fd('0x11')]('/:id',auth[_0x92fd('0x8')](),controller[_0x92fd('0x12')]);router['delete']('/:id',auth[_0x92fd('0x8')](),controller[_0x92fd('0x13')]);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 194d224..22ff80f 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 _0xa5aa=['STRING','exports'];(function(_0x379dca,_0x3340b3){var _0x19f5e0=function(_0x201749){while(--_0x201749){_0x379dca['push'](_0x379dca['shift']());}};_0x19f5e0(++_0x3340b3);}(_0xa5aa,0x7d));var _0xaa5a=function(_0x34a11c,_0x13b20a){_0x34a11c=_0x34a11c-0x0;var _0x5d64b5=_0xa5aa[_0x34a11c];return _0x5d64b5;};'use strict';var Sequelize=require('sequelize');module[_0xaa5a('0x0')]={'name':{'type':Sequelize[_0xaa5a('0x1')]},'description':{'type':Sequelize[_0xaa5a('0x1')]}}; \ No newline at end of file +var _0x2235=['STRING','exports'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x2235,0x15f));var _0x5223=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x2235[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x5223('0x0')]={'name':{'type':Sequelize[_0x5223('0x1')]},'description':{'type':Sequelize[_0x5223('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 1020feb..d1f3e8b 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 _0xcc8c=['rows','catch','show','params','include','find','create','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll'];(function(_0x1c817c,_0x55f2ff){var _0x569f07=function(_0x292d30){while(--_0x292d30){_0x1c817c['push'](_0x1c817c['shift']());}};_0x569f07(++_0x55f2ff);}(_0xcc8c,0x151));var _0xccc8=function(_0x30fde3,_0x69fd6){_0x30fde3=_0x30fde3-0x0;var _0x45703f=_0xcc8c[_0x30fde3];return _0x45703f;};'use strict';var emlformat=require(_0xccc8('0x0'));var rimraf=require(_0xccc8('0x1'));var zipdir=require(_0xccc8('0x2'));var jsonpatch=require(_0xccc8('0x3'));var rp=require(_0xccc8('0x4'));var moment=require(_0xccc8('0x5'));var BPromise=require(_0xccc8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xccc8('0x7'));var sox=require(_0xccc8('0x8'));var csv=require(_0xccc8('0x9'));var ejs=require(_0xccc8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccc8('0xb'));var crypto=require('crypto');var jsforce=require(_0xccc8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xccc8('0x9'));var querystring=require(_0xccc8('0xd'));var Papa=require(_0xccc8('0xe'));var Redis=require(_0xccc8('0xf'));var authService=require(_0xccc8('0x10'));var qs=require(_0xccc8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xccc8('0x12'));var logger=require(_0xccc8('0x13'))('api');var utils=require(_0xccc8('0x14'));var config=require(_0xccc8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xccc8('0x16'))['db'];function respondWithStatusCode(_0x2bfbc7,_0x3bc2f1){_0x3bc2f1=_0x3bc2f1||0xcc;return function(_0x1494bc){if(_0x1494bc){return _0x2bfbc7[_0xccc8('0x17')](_0x3bc2f1);}return _0x2bfbc7[_0xccc8('0x18')](_0x3bc2f1)['end']();};}function respondWithResult(_0x4e0d2c,_0xdce64f){_0xdce64f=_0xdce64f||0xc8;return function(_0xba7b7d){if(_0xba7b7d){return _0x4e0d2c[_0xccc8('0x18')](_0xdce64f)[_0xccc8('0x19')](_0xba7b7d);}};}function respondWithFilteredResult(_0x5d06ef,_0x38f4b3){return function(_0x15ab58){if(_0x15ab58){var _0x24cd70=typeof _0x38f4b3['offset']===_0xccc8('0x1a')&&typeof _0x38f4b3['limit']===_0xccc8('0x1a');var _0x37ec6c=_0x15ab58[_0xccc8('0x1b')];var _0x3009fb=_0x24cd70?0x0:_0x38f4b3['offset'];var _0x3c02fd=_0x24cd70?_0x15ab58[_0xccc8('0x1b')]:_0x38f4b3[_0xccc8('0x1c')]+_0x38f4b3[_0xccc8('0x1d')];var _0x2b7c38;if(_0x3c02fd>=_0x37ec6c){_0x3c02fd=_0x37ec6c;_0x2b7c38=0xc8;}else{_0x2b7c38=0xce;}_0x5d06ef[_0xccc8('0x18')](_0x2b7c38);return _0x5d06ef['set'](_0xccc8('0x1e'),_0x3009fb+'-'+_0x3c02fd+'/'+_0x37ec6c)[_0xccc8('0x19')](_0x15ab58);}return null;};}function patchUpdates(_0x42a720){return function(_0x3fb1c5){try{jsonpatch[_0xccc8('0x1f')](_0x3fb1c5,_0x42a720,!![]);}catch(_0x15384f){return BPromise[_0xccc8('0x20')](_0x15384f);}return _0x3fb1c5[_0xccc8('0x21')]();};}function saveUpdates(_0x2a4e59,_0xd0411d){return function(_0x5116c5){if(_0x5116c5){return _0x5116c5[_0xccc8('0x22')](_0x2a4e59)[_0xccc8('0x23')](function(_0x433fa0){return _0x433fa0;});}return null;};}function removeEntity(_0x511b46,_0x19bf00){return function(_0x212574){if(_0x212574){return _0x212574[_0xccc8('0x24')]()[_0xccc8('0x23')](function(){_0x511b46[_0xccc8('0x18')](0xcc)[_0xccc8('0x25')]();});}};}function handleEntityNotFound(_0x40f68a,_0x33d744){return function(_0x579bd1){if(!_0x579bd1){_0x40f68a[_0xccc8('0x17')](0x194);}return _0x579bd1;};}function handleError(_0x1ee2a3,_0x57d859){_0x57d859=_0x57d859||0x1f4;return function(_0x2adf1c){logger[_0xccc8('0x26')](_0x2adf1c[_0xccc8('0x27')]);if(_0x2adf1c[_0xccc8('0x28')]){delete _0x2adf1c[_0xccc8('0x28')];}_0x1ee2a3[_0xccc8('0x18')](_0x57d859)[_0xccc8('0x29')](_0x2adf1c);};}exports[_0xccc8('0x2a')]=function(_0x318403,_0x2f25a0){var _0x18cb1f={},_0x3e0403={},_0x3541d5={'count':0x0,'rows':[]};var _0x53053a=_[_0xccc8('0x2b')](db['VtigerConfiguration'][_0xccc8('0x2c')],function(_0x5dedf6){return{'name':_0x5dedf6[_0xccc8('0x2d')],'type':_0x5dedf6[_0xccc8('0x2e')][_0xccc8('0x2f')]};});_0x3e0403[_0xccc8('0x30')]=_[_0xccc8('0x2b')](_0x53053a,'name');_0x3e0403['query']=_[_0xccc8('0x31')](_0x318403[_0xccc8('0x32')]);_0x3e0403[_0xccc8('0x33')]=_[_0xccc8('0x34')](_0x3e0403[_0xccc8('0x30')],_0x3e0403[_0xccc8('0x32')]);_0x18cb1f[_0xccc8('0x35')]=_['intersection'](_0x3e0403[_0xccc8('0x30')],qs[_0xccc8('0x36')](_0x318403[_0xccc8('0x32')]['fields']));_0x18cb1f[_0xccc8('0x35')]=_0x18cb1f[_0xccc8('0x35')][_0xccc8('0x37')]?_0x18cb1f['attributes']:_0x3e0403['model'];if(!_0x318403[_0xccc8('0x32')][_0xccc8('0x38')](_0xccc8('0x39'))){_0x18cb1f[_0xccc8('0x1d')]=qs['limit'](_0x318403[_0xccc8('0x32')][_0xccc8('0x1d')]);_0x18cb1f[_0xccc8('0x1c')]=qs[_0xccc8('0x1c')](_0x318403[_0xccc8('0x32')][_0xccc8('0x1c')]);}_0x18cb1f[_0xccc8('0x3a')]=qs[_0xccc8('0x3b')](_0x318403[_0xccc8('0x32')][_0xccc8('0x3b')]);_0x18cb1f[_0xccc8('0x3c')]=qs[_0xccc8('0x33')](_[_0xccc8('0x3d')](_0x318403['query'],_0x3e0403['filters']),_0x53053a);if(_0x318403['query'][_0xccc8('0x3e')]){_0x18cb1f['where']=_[_0xccc8('0x3f')](_0x18cb1f[_0xccc8('0x3c')],{'$or':_[_0xccc8('0x2b')](_0x53053a,function(_0x1e6c55){if(_0x1e6c55[_0xccc8('0x2e')]!==_0xccc8('0x40')){var _0x39ddff={};_0x39ddff[_0x1e6c55[_0xccc8('0x28')]]={'$like':'%'+_0x318403[_0xccc8('0x32')][_0xccc8('0x3e')]+'%'};return _0x39ddff;}})});}_0x18cb1f=_[_0xccc8('0x3f')]({},_0x18cb1f,_0x318403[_0xccc8('0x41')]);var _0x4103cc={'where':_0x18cb1f[_0xccc8('0x3c')]};return db[_0xccc8('0x42')][_0xccc8('0x1b')](_0x4103cc)[_0xccc8('0x23')](function(_0x29093c){_0x3541d5[_0xccc8('0x1b')]=_0x29093c;if(_0x318403[_0xccc8('0x32')][_0xccc8('0x43')]){_0x18cb1f['include']=[{'all':!![]}];}return db[_0xccc8('0x42')]['findAll'](_0x18cb1f);})[_0xccc8('0x23')](function(_0x2fc8eb){_0x3541d5[_0xccc8('0x44')]=_0x2fc8eb;return _0x3541d5;})['then'](respondWithFilteredResult(_0x2f25a0,_0x18cb1f))[_0xccc8('0x45')](handleError(_0x2f25a0,null));};exports[_0xccc8('0x46')]=function(_0x8cdfbc,_0x56ae7d){var _0x2b1ef9={'raw':![],'where':{'id':_0x8cdfbc[_0xccc8('0x47')]['id']}},_0x5dcebb={};_0x5dcebb[_0xccc8('0x30')]=_['keys'](db[_0xccc8('0x42')][_0xccc8('0x2c')]);_0x5dcebb[_0xccc8('0x32')]=_[_0xccc8('0x31')](_0x8cdfbc['query']);_0x5dcebb[_0xccc8('0x33')]=_[_0xccc8('0x34')](_0x5dcebb[_0xccc8('0x30')],_0x5dcebb['query']);_0x2b1ef9[_0xccc8('0x35')]=_['intersection'](_0x5dcebb[_0xccc8('0x30')],qs[_0xccc8('0x36')](_0x8cdfbc[_0xccc8('0x32')][_0xccc8('0x36')]));_0x2b1ef9[_0xccc8('0x35')]=_0x2b1ef9[_0xccc8('0x35')]['length']?_0x2b1ef9[_0xccc8('0x35')]:_0x5dcebb[_0xccc8('0x30')];if(_0x8cdfbc[_0xccc8('0x32')][_0xccc8('0x43')]){_0x2b1ef9[_0xccc8('0x48')]=[{'all':!![]}];}_0x2b1ef9=_[_0xccc8('0x3f')]({},_0x2b1ef9,_0x8cdfbc[_0xccc8('0x41')]);return db['VtigerConfiguration'][_0xccc8('0x49')](_0x2b1ef9)[_0xccc8('0x23')](handleEntityNotFound(_0x56ae7d,null))[_0xccc8('0x23')](respondWithResult(_0x56ae7d,null))[_0xccc8('0x45')](handleError(_0x56ae7d,null));};exports[_0xccc8('0x4a')]=function(_0x292b6a,_0xa78467){return db[_0xccc8('0x42')][_0xccc8('0x4a')](_0x292b6a['body'],{})[_0xccc8('0x23')](respondWithResult(_0xa78467,0xc9))[_0xccc8('0x45')](handleError(_0xa78467,null));};exports[_0xccc8('0x22')]=function(_0x37102f,_0x3ec088){if(_0x37102f[_0xccc8('0x4b')]['id']){delete _0x37102f['body']['id'];}return db[_0xccc8('0x42')][_0xccc8('0x49')]({'where':{'id':_0x37102f['params']['id']}})[_0xccc8('0x23')](handleEntityNotFound(_0x3ec088,null))[_0xccc8('0x23')](saveUpdates(_0x37102f[_0xccc8('0x4b')],null))[_0xccc8('0x23')](respondWithResult(_0x3ec088,null))['catch'](handleError(_0x3ec088,null));};exports[_0xccc8('0x24')]=function(_0x2709da,_0x2e9134){return db['VtigerConfiguration'][_0xccc8('0x49')]({'where':{'id':_0x2709da[_0xccc8('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e9134,null))[_0xccc8('0x23')](removeEntity(_0x2e9134,null))['catch'](handleError(_0x2e9134,null));};exports[_0xccc8('0x4c')]=function(_0x5e15f5,_0x822119,_0x5b5128){var _0x52338d={};var _0x61607c={};var _0x535c06;var _0xc73906;return db[_0xccc8('0x42')]['findOne']({'where':{'id':_0x5e15f5[_0xccc8('0x47')]['id']}})['then'](handleEntityNotFound(_0x822119,null))['then'](function(_0x38db71){if(_0x38db71){_0x535c06=_0x38db71;_0x61607c[_0xccc8('0x30')]=_[_0xccc8('0x31')](db[_0xccc8('0x4d')]['rawAttributes']);_0x61607c[_0xccc8('0x32')]=_[_0xccc8('0x31')](_0x5e15f5[_0xccc8('0x32')]);_0x61607c[_0xccc8('0x33')]=_[_0xccc8('0x34')](_0x61607c['model'],_0x61607c['query']);_0x52338d[_0xccc8('0x35')]=_[_0xccc8('0x34')](_0x61607c['model'],qs[_0xccc8('0x36')](_0x5e15f5[_0xccc8('0x32')][_0xccc8('0x36')]));_0x52338d[_0xccc8('0x35')]=_0x52338d[_0xccc8('0x35')][_0xccc8('0x37')]?_0x52338d[_0xccc8('0x35')]:_0x61607c['model'];_0x52338d[_0xccc8('0x3a')]=qs[_0xccc8('0x3b')](_0x5e15f5[_0xccc8('0x32')]['sort']);_0x52338d[_0xccc8('0x3c')]=qs['filters'](_['pick'](_0x5e15f5[_0xccc8('0x32')],_0x61607c[_0xccc8('0x33')]));if(_0x5e15f5[_0xccc8('0x32')]['filter']){_0x52338d['where']=_[_0xccc8('0x3f')](_0x52338d[_0xccc8('0x3c')],{'$or':_[_0xccc8('0x2b')](_0x52338d[_0xccc8('0x35')],function(_0xd2ade2){var _0x48d23b={};_0x48d23b[_0xd2ade2]={'$like':'%'+_0x5e15f5[_0xccc8('0x32')][_0xccc8('0x3e')]+'%'};return _0x48d23b;})});}_0x52338d=_['merge']({},_0x52338d,_0x5e15f5[_0xccc8('0x41')]);return _0x535c06[_0xccc8('0x4c')](_0x52338d);}})[_0xccc8('0x23')](function(_0x1687f8){if(_0x1687f8){_0xc73906=_0x1687f8[_0xccc8('0x37')];if(!_0x5e15f5['query'][_0xccc8('0x38')](_0xccc8('0x39'))){_0x52338d[_0xccc8('0x1d')]=qs[_0xccc8('0x1d')](_0x5e15f5['query'][_0xccc8('0x1d')]);_0x52338d['offset']=qs[_0xccc8('0x1c')](_0x5e15f5[_0xccc8('0x32')][_0xccc8('0x1c')]);}return _0x535c06[_0xccc8('0x4c')](_0x52338d);}})[_0xccc8('0x23')](function(_0x507b96){if(_0x507b96){return _0x507b96?{'count':_0xc73906,'rows':_0x507b96}:null;}})[_0xccc8('0x23')](respondWithResult(_0x822119,null))[_0xccc8('0x45')](handleError(_0x822119,null));};exports[_0xccc8('0x4e')]=function(_0x1dd5b5,_0x583b79,_0x5cc416){var _0x2fca5b={};var _0x4aee67={};var _0x225ee5;var _0x40e177;return db[_0xccc8('0x42')][_0xccc8('0x4f')]({'where':{'id':_0x1dd5b5[_0xccc8('0x47')]['id']}})[_0xccc8('0x23')](handleEntityNotFound(_0x583b79,null))['then'](function(_0x1a793d){if(_0x1a793d){_0x225ee5=_0x1a793d;_0x4aee67['model']=_['keys'](db[_0xccc8('0x4d')][_0xccc8('0x2c')]);_0x4aee67[_0xccc8('0x32')]=_[_0xccc8('0x31')](_0x1dd5b5[_0xccc8('0x32')]);_0x4aee67[_0xccc8('0x33')]=_[_0xccc8('0x34')](_0x4aee67[_0xccc8('0x30')],_0x4aee67['query']);_0x2fca5b[_0xccc8('0x35')]=_[_0xccc8('0x34')](_0x4aee67['model'],qs[_0xccc8('0x36')](_0x1dd5b5[_0xccc8('0x32')][_0xccc8('0x36')]));_0x2fca5b[_0xccc8('0x35')]=_0x2fca5b[_0xccc8('0x35')]['length']?_0x2fca5b['attributes']:_0x4aee67[_0xccc8('0x30')];_0x2fca5b['order']=qs[_0xccc8('0x3b')](_0x1dd5b5['query']['sort']);_0x2fca5b[_0xccc8('0x3c')]=qs[_0xccc8('0x33')](_[_0xccc8('0x3d')](_0x1dd5b5['query'],_0x4aee67[_0xccc8('0x33')]));if(_0x1dd5b5['query'][_0xccc8('0x3e')]){_0x2fca5b[_0xccc8('0x3c')]=_[_0xccc8('0x3f')](_0x2fca5b[_0xccc8('0x3c')],{'$or':_[_0xccc8('0x2b')](_0x2fca5b[_0xccc8('0x35')],function(_0x5e2776){var _0x10a7d4={};_0x10a7d4[_0x5e2776]={'$like':'%'+_0x1dd5b5[_0xccc8('0x32')][_0xccc8('0x3e')]+'%'};return _0x10a7d4;})});}_0x2fca5b=_[_0xccc8('0x3f')]({},_0x2fca5b,_0x1dd5b5[_0xccc8('0x41')]);return _0x225ee5['getSubjects'](_0x2fca5b);}})[_0xccc8('0x23')](function(_0x2cc69d){if(_0x2cc69d){_0x40e177=_0x2cc69d[_0xccc8('0x37')];if(!_0x1dd5b5[_0xccc8('0x32')]['hasOwnProperty']('nolimit')){_0x2fca5b[_0xccc8('0x1d')]=qs[_0xccc8('0x1d')](_0x1dd5b5['query'][_0xccc8('0x1d')]);_0x2fca5b['offset']=qs[_0xccc8('0x1c')](_0x1dd5b5['query'][_0xccc8('0x1c')]);}return _0x225ee5[_0xccc8('0x4e')](_0x2fca5b);}})[_0xccc8('0x23')](function(_0x2255a0){if(_0x2255a0){return _0x2255a0?{'count':_0x40e177,'rows':_0x2255a0}:null;}})[_0xccc8('0x23')](respondWithResult(_0x583b79,null))[_0xccc8('0x45')](handleError(_0x583b79,null));};exports[_0xccc8('0x50')]=function(_0x5ce562,_0x4c14c0,_0x1a18a6){var _0x92fd99={};var _0x1497ac={};var _0x5bb8d9;var _0x4fef27;return db[_0xccc8('0x42')][_0xccc8('0x4f')]({'where':{'id':_0x5ce562['params']['id']}})[_0xccc8('0x23')](handleEntityNotFound(_0x4c14c0,null))['then'](function(_0x28c6db){if(_0x28c6db){_0x5bb8d9=_0x28c6db;_0x1497ac['model']=_[_0xccc8('0x31')](db['VtigerField'][_0xccc8('0x2c')]);_0x1497ac[_0xccc8('0x32')]=_[_0xccc8('0x31')](_0x5ce562[_0xccc8('0x32')]);_0x1497ac[_0xccc8('0x33')]=_[_0xccc8('0x34')](_0x1497ac[_0xccc8('0x30')],_0x1497ac[_0xccc8('0x32')]);_0x92fd99[_0xccc8('0x35')]=_[_0xccc8('0x34')](_0x1497ac[_0xccc8('0x30')],qs[_0xccc8('0x36')](_0x5ce562[_0xccc8('0x32')][_0xccc8('0x36')]));_0x92fd99[_0xccc8('0x35')]=_0x92fd99[_0xccc8('0x35')][_0xccc8('0x37')]?_0x92fd99[_0xccc8('0x35')]:_0x1497ac[_0xccc8('0x30')];_0x92fd99[_0xccc8('0x3a')]=qs[_0xccc8('0x3b')](_0x5ce562[_0xccc8('0x32')][_0xccc8('0x3b')]);_0x92fd99[_0xccc8('0x3c')]=qs['filters'](_[_0xccc8('0x3d')](_0x5ce562[_0xccc8('0x32')],_0x1497ac[_0xccc8('0x33')]));if(_0x5ce562[_0xccc8('0x32')]['filter']){_0x92fd99['where']=_['merge'](_0x92fd99[_0xccc8('0x3c')],{'$or':_[_0xccc8('0x2b')](_0x92fd99[_0xccc8('0x35')],function(_0x47c9e6){var _0xa2c34d={};_0xa2c34d[_0x47c9e6]={'$like':'%'+_0x5ce562[_0xccc8('0x32')][_0xccc8('0x3e')]+'%'};return _0xa2c34d;})});}_0x92fd99=_[_0xccc8('0x3f')]({},_0x92fd99,_0x5ce562[_0xccc8('0x41')]);return _0x5bb8d9[_0xccc8('0x50')](_0x92fd99);}})[_0xccc8('0x23')](function(_0x5e7df5){if(_0x5e7df5){_0x4fef27=_0x5e7df5['length'];if(!_0x5ce562[_0xccc8('0x32')]['hasOwnProperty'](_0xccc8('0x39'))){_0x92fd99[_0xccc8('0x1d')]=qs[_0xccc8('0x1d')](_0x5ce562['query'][_0xccc8('0x1d')]);_0x92fd99[_0xccc8('0x1c')]=qs[_0xccc8('0x1c')](_0x5ce562['query'][_0xccc8('0x1c')]);}return _0x5bb8d9['getDescriptions'](_0x92fd99);}})[_0xccc8('0x23')](function(_0x131417){if(_0x131417){return _0x131417?{'count':_0x4fef27,'rows':_0x131417}:null;}})['then'](respondWithResult(_0x4c14c0,null))['catch'](handleError(_0x4c14c0,null));}; \ No newline at end of file +var _0x31ae=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','includeAll','include','find','create','body','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x31ae,0x6b));var _0xe31a=function(_0x137ae3,_0x4e93bf){_0x137ae3=_0x137ae3-0x0;var _0x3de34c=_0x31ae[_0x137ae3];return _0x3de34c;};'use strict';var emlformat=require(_0xe31a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe31a('0x1'));var jsonpatch=require(_0xe31a('0x2'));var rp=require(_0xe31a('0x3'));var moment=require(_0xe31a('0x4'));var BPromise=require(_0xe31a('0x5'));var Mustache=require(_0xe31a('0x6'));var util=require(_0xe31a('0x7'));var path=require(_0xe31a('0x8'));var sox=require(_0xe31a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe31a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe31a('0xb'));var jsforce=require(_0xe31a('0xc'));var deskjs=require(_0xe31a('0xd'));var toCsv=require(_0xe31a('0xe'));var querystring=require(_0xe31a('0xf'));var Papa=require(_0xe31a('0x10'));var Redis=require(_0xe31a('0x11'));var authService=require(_0xe31a('0x12'));var qs=require(_0xe31a('0x13'));var as=require(_0xe31a('0x14'));var hardwareService=require(_0xe31a('0x15'));var logger=require(_0xe31a('0x16'))(_0xe31a('0x17'));var utils=require(_0xe31a('0x18'));var config=require(_0xe31a('0x19'));var licenseUtil=require(_0xe31a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c0751,_0x21cac9){_0x21cac9=_0x21cac9||0xcc;return function(_0x4c073a){if(_0x4c073a){return _0x4c0751[_0xe31a('0x1b')](_0x21cac9);}return _0x4c0751[_0xe31a('0x1c')](_0x21cac9)['end']();};}function respondWithResult(_0x559cb1,_0x29d0b3){_0x29d0b3=_0x29d0b3||0xc8;return function(_0x3c9cb9){if(_0x3c9cb9){return _0x559cb1[_0xe31a('0x1c')](_0x29d0b3)['json'](_0x3c9cb9);}};}function respondWithFilteredResult(_0x1577b4,_0x1d52b4){return function(_0x3f5a5c){if(_0x3f5a5c){var _0x482ccb=typeof _0x1d52b4[_0xe31a('0x1d')]===_0xe31a('0x1e')&&typeof _0x1d52b4['limit']===_0xe31a('0x1e');var _0xbc8e1f=_0x3f5a5c[_0xe31a('0x1f')];var _0x5a040=_0x482ccb?0x0:_0x1d52b4[_0xe31a('0x1d')];var _0x5640d2=_0x482ccb?_0x3f5a5c['count']:_0x1d52b4[_0xe31a('0x1d')]+_0x1d52b4[_0xe31a('0x20')];var _0x292c9d;if(_0x5640d2>=_0xbc8e1f){_0x5640d2=_0xbc8e1f;_0x292c9d=0xc8;}else{_0x292c9d=0xce;}_0x1577b4[_0xe31a('0x1c')](_0x292c9d);return _0x1577b4[_0xe31a('0x21')](_0xe31a('0x22'),_0x5a040+'-'+_0x5640d2+'/'+_0xbc8e1f)[_0xe31a('0x23')](_0x3f5a5c);}return null;};}function patchUpdates(_0x2915b6){return function(_0x11d929){try{jsonpatch[_0xe31a('0x24')](_0x11d929,_0x2915b6,!![]);}catch(_0xdd576c){return BPromise[_0xe31a('0x25')](_0xdd576c);}return _0x11d929[_0xe31a('0x26')]();};}function saveUpdates(_0x211638,_0x354dbc){return function(_0x18d119){if(_0x18d119){return _0x18d119[_0xe31a('0x27')](_0x211638)[_0xe31a('0x28')](function(_0x4c5bf6){return _0x4c5bf6;});}return null;};}function removeEntity(_0x3ce241,_0x43efc9){return function(_0x11f93e){if(_0x11f93e){return _0x11f93e[_0xe31a('0x29')]()[_0xe31a('0x28')](function(){_0x3ce241['status'](0xcc)[_0xe31a('0x2a')]();});}};}function handleEntityNotFound(_0x3ea149,_0x5eb9c6){return function(_0x2de01e){if(!_0x2de01e){_0x3ea149[_0xe31a('0x1b')](0x194);}return _0x2de01e;};}function handleError(_0x5ef095,_0x3bb5fc){_0x3bb5fc=_0x3bb5fc||0x1f4;return function(_0x1ea4f7){logger[_0xe31a('0x2b')](_0x1ea4f7[_0xe31a('0x2c')]);if(_0x1ea4f7['name']){delete _0x1ea4f7[_0xe31a('0x2d')];}_0x5ef095['status'](_0x3bb5fc)[_0xe31a('0x2e')](_0x1ea4f7);};}exports['index']=function(_0x316098,_0x55bddd){var _0x3a06ff={},_0x5829b6={},_0x535ae1={'count':0x0,'rows':[]};var _0x3a5a98=_[_0xe31a('0x2f')](db[_0xe31a('0x30')][_0xe31a('0x31')],function(_0x1b3aab){return{'name':_0x1b3aab[_0xe31a('0x32')],'type':_0x1b3aab[_0xe31a('0x33')][_0xe31a('0x34')]};});_0x5829b6['model']=_['map'](_0x3a5a98,_0xe31a('0x2d'));_0x5829b6[_0xe31a('0x35')]=_[_0xe31a('0x36')](_0x316098[_0xe31a('0x35')]);_0x5829b6[_0xe31a('0x37')]=_[_0xe31a('0x38')](_0x5829b6[_0xe31a('0x39')],_0x5829b6[_0xe31a('0x35')]);_0x3a06ff[_0xe31a('0x3a')]=_[_0xe31a('0x38')](_0x5829b6[_0xe31a('0x39')],qs[_0xe31a('0x3b')](_0x316098['query'][_0xe31a('0x3b')]));_0x3a06ff[_0xe31a('0x3a')]=_0x3a06ff['attributes'][_0xe31a('0x3c')]?_0x3a06ff[_0xe31a('0x3a')]:_0x5829b6['model'];if(!_0x316098[_0xe31a('0x35')][_0xe31a('0x3d')](_0xe31a('0x3e'))){_0x3a06ff[_0xe31a('0x20')]=qs[_0xe31a('0x20')](_0x316098[_0xe31a('0x35')]['limit']);_0x3a06ff[_0xe31a('0x1d')]=qs[_0xe31a('0x1d')](_0x316098[_0xe31a('0x35')][_0xe31a('0x1d')]);}_0x3a06ff[_0xe31a('0x3f')]=qs[_0xe31a('0x40')](_0x316098['query'][_0xe31a('0x40')]);_0x3a06ff[_0xe31a('0x41')]=qs[_0xe31a('0x37')](_[_0xe31a('0x42')](_0x316098['query'],_0x5829b6[_0xe31a('0x37')]),_0x3a5a98);if(_0x316098['query'][_0xe31a('0x43')]){_0x3a06ff[_0xe31a('0x41')]=_[_0xe31a('0x44')](_0x3a06ff['where'],{'$or':_['map'](_0x3a5a98,function(_0x1389e7){if(_0x1389e7[_0xe31a('0x33')]!=='VIRTUAL'){var _0x447ce3={};_0x447ce3[_0x1389e7[_0xe31a('0x2d')]]={'$like':'%'+_0x316098[_0xe31a('0x35')][_0xe31a('0x43')]+'%'};return _0x447ce3;}})});}_0x3a06ff=_[_0xe31a('0x44')]({},_0x3a06ff,_0x316098[_0xe31a('0x45')]);var _0x6ff02c={'where':_0x3a06ff['where']};return db[_0xe31a('0x30')][_0xe31a('0x1f')](_0x6ff02c)[_0xe31a('0x28')](function(_0x4bbec5){_0x535ae1[_0xe31a('0x1f')]=_0x4bbec5;if(_0x316098[_0xe31a('0x35')]['includeAll']){_0x3a06ff['include']=[{'all':!![]}];}return db[_0xe31a('0x30')][_0xe31a('0x46')](_0x3a06ff);})[_0xe31a('0x28')](function(_0x378364){_0x535ae1['rows']=_0x378364;return _0x535ae1;})[_0xe31a('0x28')](respondWithFilteredResult(_0x55bddd,_0x3a06ff))[_0xe31a('0x47')](handleError(_0x55bddd,null));};exports[_0xe31a('0x48')]=function(_0x8f5661,_0x479ed){var _0x1b2115={'raw':![],'where':{'id':_0x8f5661[_0xe31a('0x49')]['id']}},_0x8b970e={};_0x8b970e[_0xe31a('0x39')]=_['keys'](db['VtigerConfiguration'][_0xe31a('0x31')]);_0x8b970e[_0xe31a('0x35')]=_[_0xe31a('0x36')](_0x8f5661[_0xe31a('0x35')]);_0x8b970e[_0xe31a('0x37')]=_['intersection'](_0x8b970e[_0xe31a('0x39')],_0x8b970e[_0xe31a('0x35')]);_0x1b2115[_0xe31a('0x3a')]=_['intersection'](_0x8b970e[_0xe31a('0x39')],qs[_0xe31a('0x3b')](_0x8f5661['query'][_0xe31a('0x3b')]));_0x1b2115[_0xe31a('0x3a')]=_0x1b2115[_0xe31a('0x3a')][_0xe31a('0x3c')]?_0x1b2115['attributes']:_0x8b970e['model'];if(_0x8f5661['query'][_0xe31a('0x4a')]){_0x1b2115[_0xe31a('0x4b')]=[{'all':!![]}];}_0x1b2115=_[_0xe31a('0x44')]({},_0x1b2115,_0x8f5661[_0xe31a('0x45')]);return db[_0xe31a('0x30')][_0xe31a('0x4c')](_0x1b2115)[_0xe31a('0x28')](handleEntityNotFound(_0x479ed,null))[_0xe31a('0x28')](respondWithResult(_0x479ed,null))[_0xe31a('0x47')](handleError(_0x479ed,null));};exports[_0xe31a('0x4d')]=function(_0x30e3b6,_0x5c45dd){return db[_0xe31a('0x30')]['create'](_0x30e3b6['body'],{})[_0xe31a('0x28')](respondWithResult(_0x5c45dd,0xc9))['catch'](handleError(_0x5c45dd,null));};exports[_0xe31a('0x27')]=function(_0x111be2,_0x57cebe){if(_0x111be2[_0xe31a('0x4e')]['id']){delete _0x111be2[_0xe31a('0x4e')]['id'];}return db[_0xe31a('0x30')]['find']({'where':{'id':_0x111be2[_0xe31a('0x49')]['id']}})['then'](handleEntityNotFound(_0x57cebe,null))[_0xe31a('0x28')](saveUpdates(_0x111be2[_0xe31a('0x4e')],null))[_0xe31a('0x28')](respondWithResult(_0x57cebe,null))[_0xe31a('0x47')](handleError(_0x57cebe,null));};exports[_0xe31a('0x29')]=function(_0x1599cd,_0x52a93c){return db[_0xe31a('0x30')]['find']({'where':{'id':_0x1599cd['params']['id']}})[_0xe31a('0x28')](handleEntityNotFound(_0x52a93c,null))[_0xe31a('0x28')](removeEntity(_0x52a93c,null))[_0xe31a('0x47')](handleError(_0x52a93c,null));};exports[_0xe31a('0x4f')]=function(_0x126277,_0x89fc8d,_0x175765){var _0x587953={};var _0x1cb2c2={};var _0x33413e;var _0x219c49;return db[_0xe31a('0x30')]['findOne']({'where':{'id':_0x126277[_0xe31a('0x49')]['id']}})[_0xe31a('0x28')](handleEntityNotFound(_0x89fc8d,null))[_0xe31a('0x28')](function(_0x2132ed){if(_0x2132ed){_0x33413e=_0x2132ed;_0x1cb2c2[_0xe31a('0x39')]=_[_0xe31a('0x36')](db[_0xe31a('0x50')][_0xe31a('0x31')]);_0x1cb2c2[_0xe31a('0x35')]=_['keys'](_0x126277[_0xe31a('0x35')]);_0x1cb2c2[_0xe31a('0x37')]=_[_0xe31a('0x38')](_0x1cb2c2[_0xe31a('0x39')],_0x1cb2c2['query']);_0x587953[_0xe31a('0x3a')]=_[_0xe31a('0x38')](_0x1cb2c2[_0xe31a('0x39')],qs[_0xe31a('0x3b')](_0x126277[_0xe31a('0x35')][_0xe31a('0x3b')]));_0x587953[_0xe31a('0x3a')]=_0x587953[_0xe31a('0x3a')][_0xe31a('0x3c')]?_0x587953[_0xe31a('0x3a')]:_0x1cb2c2[_0xe31a('0x39')];_0x587953[_0xe31a('0x3f')]=qs['sort'](_0x126277[_0xe31a('0x35')]['sort']);_0x587953[_0xe31a('0x41')]=qs['filters'](_[_0xe31a('0x42')](_0x126277[_0xe31a('0x35')],_0x1cb2c2[_0xe31a('0x37')]));if(_0x126277[_0xe31a('0x35')][_0xe31a('0x43')]){_0x587953[_0xe31a('0x41')]=_[_0xe31a('0x44')](_0x587953[_0xe31a('0x41')],{'$or':_[_0xe31a('0x2f')](_0x587953[_0xe31a('0x3a')],function(_0x510683){var _0x4671e9={};_0x4671e9[_0x510683]={'$like':'%'+_0x126277['query'][_0xe31a('0x43')]+'%'};return _0x4671e9;})});}_0x587953=_[_0xe31a('0x44')]({},_0x587953,_0x126277[_0xe31a('0x45')]);return _0x33413e[_0xe31a('0x4f')](_0x587953);}})[_0xe31a('0x28')](function(_0x3af84f){if(_0x3af84f){_0x219c49=_0x3af84f['length'];if(!_0x126277[_0xe31a('0x35')][_0xe31a('0x3d')](_0xe31a('0x3e'))){_0x587953['limit']=qs[_0xe31a('0x20')](_0x126277['query']['limit']);_0x587953[_0xe31a('0x1d')]=qs[_0xe31a('0x1d')](_0x126277[_0xe31a('0x35')][_0xe31a('0x1d')]);}return _0x33413e['getFields'](_0x587953);}})[_0xe31a('0x28')](function(_0x28623c){if(_0x28623c){return _0x28623c?{'count':_0x219c49,'rows':_0x28623c}:null;}})['then'](respondWithResult(_0x89fc8d,null))[_0xe31a('0x47')](handleError(_0x89fc8d,null));};exports[_0xe31a('0x51')]=function(_0x5499a1,_0x1da452,_0x20faa4){var _0x5c10d4={};var _0x5c0131={};var _0x2f647c;var _0x3c8ea7;return db['VtigerConfiguration'][_0xe31a('0x52')]({'where':{'id':_0x5499a1[_0xe31a('0x49')]['id']}})[_0xe31a('0x28')](handleEntityNotFound(_0x1da452,null))[_0xe31a('0x28')](function(_0x43624e){if(_0x43624e){_0x2f647c=_0x43624e;_0x5c0131['model']=_[_0xe31a('0x36')](db[_0xe31a('0x50')]['rawAttributes']);_0x5c0131['query']=_['keys'](_0x5499a1[_0xe31a('0x35')]);_0x5c0131[_0xe31a('0x37')]=_['intersection'](_0x5c0131['model'],_0x5c0131[_0xe31a('0x35')]);_0x5c10d4[_0xe31a('0x3a')]=_[_0xe31a('0x38')](_0x5c0131[_0xe31a('0x39')],qs[_0xe31a('0x3b')](_0x5499a1[_0xe31a('0x35')][_0xe31a('0x3b')]));_0x5c10d4[_0xe31a('0x3a')]=_0x5c10d4[_0xe31a('0x3a')][_0xe31a('0x3c')]?_0x5c10d4[_0xe31a('0x3a')]:_0x5c0131[_0xe31a('0x39')];_0x5c10d4[_0xe31a('0x3f')]=qs['sort'](_0x5499a1[_0xe31a('0x35')][_0xe31a('0x40')]);_0x5c10d4[_0xe31a('0x41')]=qs['filters'](_[_0xe31a('0x42')](_0x5499a1[_0xe31a('0x35')],_0x5c0131[_0xe31a('0x37')]));if(_0x5499a1[_0xe31a('0x35')][_0xe31a('0x43')]){_0x5c10d4[_0xe31a('0x41')]=_['merge'](_0x5c10d4[_0xe31a('0x41')],{'$or':_['map'](_0x5c10d4['attributes'],function(_0x1a1876){var _0x41c6a3={};_0x41c6a3[_0x1a1876]={'$like':'%'+_0x5499a1[_0xe31a('0x35')][_0xe31a('0x43')]+'%'};return _0x41c6a3;})});}_0x5c10d4=_[_0xe31a('0x44')]({},_0x5c10d4,_0x5499a1[_0xe31a('0x45')]);return _0x2f647c[_0xe31a('0x51')](_0x5c10d4);}})[_0xe31a('0x28')](function(_0x2d9e28){if(_0x2d9e28){_0x3c8ea7=_0x2d9e28['length'];if(!_0x5499a1[_0xe31a('0x35')][_0xe31a('0x3d')]('nolimit')){_0x5c10d4[_0xe31a('0x20')]=qs[_0xe31a('0x20')](_0x5499a1[_0xe31a('0x35')][_0xe31a('0x20')]);_0x5c10d4[_0xe31a('0x1d')]=qs['offset'](_0x5499a1[_0xe31a('0x35')][_0xe31a('0x1d')]);}return _0x2f647c[_0xe31a('0x51')](_0x5c10d4);}})[_0xe31a('0x28')](function(_0x416cc7){if(_0x416cc7){return _0x416cc7?{'count':_0x3c8ea7,'rows':_0x416cc7}:null;}})[_0xe31a('0x28')](respondWithResult(_0x1da452,null))['catch'](handleError(_0x1da452,null));};exports[_0xe31a('0x53')]=function(_0x554ebd,_0x40061e,_0x37b963){var _0x2eaa32={};var _0x33bba9={};var _0x412192;var _0x53ed0e;return db[_0xe31a('0x30')][_0xe31a('0x52')]({'where':{'id':_0x554ebd['params']['id']}})[_0xe31a('0x28')](handleEntityNotFound(_0x40061e,null))[_0xe31a('0x28')](function(_0x40ee21){if(_0x40ee21){_0x412192=_0x40ee21;_0x33bba9[_0xe31a('0x39')]=_[_0xe31a('0x36')](db[_0xe31a('0x50')]['rawAttributes']);_0x33bba9['query']=_[_0xe31a('0x36')](_0x554ebd[_0xe31a('0x35')]);_0x33bba9['filters']=_[_0xe31a('0x38')](_0x33bba9[_0xe31a('0x39')],_0x33bba9['query']);_0x2eaa32[_0xe31a('0x3a')]=_['intersection'](_0x33bba9[_0xe31a('0x39')],qs['fields'](_0x554ebd['query'][_0xe31a('0x3b')]));_0x2eaa32['attributes']=_0x2eaa32[_0xe31a('0x3a')]['length']?_0x2eaa32['attributes']:_0x33bba9[_0xe31a('0x39')];_0x2eaa32[_0xe31a('0x3f')]=qs[_0xe31a('0x40')](_0x554ebd[_0xe31a('0x35')][_0xe31a('0x40')]);_0x2eaa32[_0xe31a('0x41')]=qs[_0xe31a('0x37')](_[_0xe31a('0x42')](_0x554ebd[_0xe31a('0x35')],_0x33bba9[_0xe31a('0x37')]));if(_0x554ebd['query'][_0xe31a('0x43')]){_0x2eaa32[_0xe31a('0x41')]=_['merge'](_0x2eaa32[_0xe31a('0x41')],{'$or':_[_0xe31a('0x2f')](_0x2eaa32[_0xe31a('0x3a')],function(_0x4f3516){var _0x130fbe={};_0x130fbe[_0x4f3516]={'$like':'%'+_0x554ebd[_0xe31a('0x35')][_0xe31a('0x43')]+'%'};return _0x130fbe;})});}_0x2eaa32=_[_0xe31a('0x44')]({},_0x2eaa32,_0x554ebd['options']);return _0x412192[_0xe31a('0x53')](_0x2eaa32);}})[_0xe31a('0x28')](function(_0x799639){if(_0x799639){_0x53ed0e=_0x799639[_0xe31a('0x3c')];if(!_0x554ebd[_0xe31a('0x35')][_0xe31a('0x3d')](_0xe31a('0x3e'))){_0x2eaa32[_0xe31a('0x20')]=qs[_0xe31a('0x20')](_0x554ebd[_0xe31a('0x35')][_0xe31a('0x20')]);_0x2eaa32['offset']=qs[_0xe31a('0x1d')](_0x554ebd[_0xe31a('0x35')][_0xe31a('0x1d')]);}return _0x412192[_0xe31a('0x53')](_0x2eaa32);}})[_0xe31a('0x28')](function(_0x5cd0c7){if(_0x5cd0c7){return _0x5cd0c7?{'count':_0x53ed0e,'rows':_0x5cd0c7}:null;}})[_0xe31a('0x28')](respondWithResult(_0x40061e,null))['catch'](handleError(_0x40061e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 86ad791..c572262 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 _0x642d=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','moment','bluebird'];(function(_0x8eb4eb,_0xa70079){var _0x1ff8e3=function(_0x1e118e){while(--_0x1e118e){_0x8eb4eb['push'](_0x8eb4eb['shift']());}};_0x1ff8e3(++_0xa70079);}(_0x642d,0x8b));var _0xd642=function(_0x923eae,_0x24de30){_0x923eae=_0x923eae-0x0;var _0x431ed1=_0x642d[_0x923eae];return _0x431ed1;};'use strict';var _=require('lodash');var util=require(_0xd642('0x0'));var logger=require(_0xd642('0x1'))('api');var moment=require(_0xd642('0x2'));var BPromise=require(_0xd642('0x3'));var rp=require(_0xd642('0x4'));var fs=require('fs');var path=require(_0xd642('0x5'));var rimraf=require(_0xd642('0x6'));var config=require(_0xd642('0x7'));var attributes=require(_0xd642('0x8'));module[_0xd642('0x9')]=function(_0xcb7710,_0x34dbb0){return _0xcb7710[_0xd642('0xa')](_0xd642('0xb'),attributes,{'tableName':_0xd642('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf894=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','util'];(function(_0x38ef85,_0x317bcc){var _0x1ffa8d=function(_0x5069b0){while(--_0x5069b0){_0x38ef85['push'](_0x38ef85['shift']());}};_0x1ffa8d(++_0x317bcc);}(_0xf894,0x1e0));var _0x4f89=function(_0x3b9846,_0x16a666){_0x3b9846=_0x3b9846-0x0;var _0x495077=_0xf894[_0x3b9846];return _0x495077;};'use strict';var _=require('lodash');var util=require(_0x4f89('0x0'));var logger=require(_0x4f89('0x1'))(_0x4f89('0x2'));var moment=require(_0x4f89('0x3'));var BPromise=require(_0x4f89('0x4'));var rp=require(_0x4f89('0x5'));var fs=require('fs');var path=require(_0x4f89('0x6'));var rimraf=require(_0x4f89('0x7'));var config=require(_0x4f89('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x4f89('0x9')]=function(_0x5f13e6,_0x2e2bcc){return _0x5f13e6[_0x4f89('0xa')](_0x4f89('0xb'),attributes,{'tableName':_0x4f89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 8607ba9..68eeadb 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 _0xf83f=['rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0x3db9e0,_0x1068ee){var _0x528569=function(_0x14f6dc){while(--_0x14f6dc){_0x3db9e0['push'](_0x3db9e0['shift']());}};_0x528569(++_0x1068ee);}(_0xf83f,0x178));var _0xff83=function(_0x2ce9a5,_0x5bbdf2){_0x2ce9a5=_0x2ce9a5-0x0;var _0x420895=_0xf83f[_0x2ce9a5];return _0x420895;};'use strict';var _=require('lodash');var util=require(_0xff83('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff83('0x1'));var fs=require('fs');var Redis=require(_0xff83('0x2'));var db=require(_0xff83('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff83('0x4'));var config=require(_0xff83('0x5'));var jayson=require(_0xff83('0x6'));var client=jayson['client'][_0xff83('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e85b2,_0x442260,_0x349cc8){return new BPromise(function(_0x3d1adb,_0xe31c1){return client[_0xff83('0x8')](_0x5e85b2,_0x349cc8)[_0xff83('0x9')](function(_0x18064){logger[_0xff83('0xa')](_0xff83('0xb'),_0x442260,_0xff83('0xc'));logger['debug'](_0xff83('0xd'),_0x442260,_0xff83('0xc'),JSON['stringify'](_0x18064));if(_0x18064[_0xff83('0xe')]){if(_0x18064[_0xff83('0xe')][_0xff83('0xf')]===0x1f4){logger[_0xff83('0xe')](_0xff83('0xb'),_0x442260,_0x18064['error']['message']);return _0xe31c1(_0x18064[_0xff83('0xe')][_0xff83('0x10')]);}logger[_0xff83('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x442260,_0x18064[_0xff83('0xe')]['message']);return _0x3d1adb(_0x18064[_0xff83('0xe')][_0xff83('0x10')]);}else{logger[_0xff83('0xa')](_0xff83('0xb'),_0x442260,_0xff83('0xc'));_0x3d1adb(_0x18064[_0xff83('0x11')][_0xff83('0x10')]);}})[_0xff83('0x12')](function(_0x1feb42){logger[_0xff83('0xe')](_0xff83('0xb'),_0x442260,_0x1feb42);_0xe31c1(_0x1feb42);});});} \ No newline at end of file +var _0x1517=['request','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','VtigerConfiguration,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x128d97,_0x3f7514){var _0x83644e=function(_0x2edbc5){while(--_0x2edbc5){_0x128d97['push'](_0x128d97['shift']());}};_0x83644e(++_0x3f7514);}(_0x1517,0x7d));var _0x7151=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x1517[_0x38b14f];return _0x22a324;};'use strict';var _=require(_0x7151('0x0'));var util=require(_0x7151('0x1'));var moment=require(_0x7151('0x2'));var BPromise=require(_0x7151('0x3'));var rs=require(_0x7151('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7151('0x5'))['db'];var utils=require(_0x7151('0x6'));var logger=require(_0x7151('0x7'))(_0x7151('0x8'));var config=require(_0x7151('0x9'));var jayson=require(_0x7151('0xa'));var client=jayson[_0x7151('0xb')][_0x7151('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cd956,_0x1d24b5,_0x454735){return new BPromise(function(_0x40817a,_0x77f88a){return client[_0x7151('0xd')](_0x4cd956,_0x454735)[_0x7151('0xe')](function(_0x1d9156){logger[_0x7151('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d24b5,_0x7151('0x10'));logger['debug'](_0x7151('0x11'),_0x1d24b5,'request\x20sent',JSON['stringify'](_0x1d9156));if(_0x1d9156['error']){if(_0x1d9156['error'][_0x7151('0x12')]===0x1f4){logger['error'](_0x7151('0x13'),_0x1d24b5,_0x1d9156[_0x7151('0x14')]['message']);return _0x77f88a(_0x1d9156[_0x7151('0x14')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x1d24b5,_0x1d9156[_0x7151('0x14')][_0x7151('0x15')]);return _0x40817a(_0x1d9156[_0x7151('0x14')][_0x7151('0x15')]);}else{logger[_0x7151('0xf')](_0x7151('0x13'),_0x1d24b5,_0x7151('0x10'));_0x40817a(_0x1d9156['result'][_0x7151('0x15')]);}})[_0x7151('0x16')](function(_0x4030df){logger['error'](_0x7151('0x13'),_0x1d24b5,_0x4030df);_0x77f88a(_0x4030df);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 678922b..52c4ead 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 _0x0894=['/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','get'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x0894,0x1ad));var _0x4089=function(_0x9d35dd,_0x87b0d4){_0x9d35dd=_0x9d35dd-0x0;var _0xeb3bc6=_0x0894[_0x9d35dd];return _0xeb3bc6;};'use strict';var multer=require(_0x4089('0x0'));var util=require('util');var path=require(_0x4089('0x1'));var timeout=require(_0x4089('0x2'));var express=require('express');var router=express[_0x4089('0x3')]();var fs_extra=require(_0x4089('0x4'));var auth=require(_0x4089('0x5'));var interaction=require(_0x4089('0x6'));var config=require(_0x4089('0x7'));var controller=require(_0x4089('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4089('0x9')]);router[_0x4089('0xa')](_0x4089('0xb'),auth[_0x4089('0xc')](),controller[_0x4089('0xd')]);router[_0x4089('0xe')]('/',auth[_0x4089('0xc')](),controller[_0x4089('0xf')]);router[_0x4089('0x10')]('/:id',auth[_0x4089('0xc')](),controller['update']);router[_0x4089('0x11')](_0x4089('0xb'),auth[_0x4089('0xc')](),controller[_0x4089('0x12')]);module[_0x4089('0x13')]=router; \ No newline at end of file +var _0x7f95=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x7f95,0x1eb));var _0x57f9=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0x7f95[_0x274638];return _0x5755df;};'use strict';var multer=require('multer');var util=require(_0x57f9('0x0'));var path=require(_0x57f9('0x1'));var timeout=require(_0x57f9('0x2'));var express=require(_0x57f9('0x3'));var router=express[_0x57f9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x57f9('0x5'));var config=require(_0x57f9('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x57f9('0x7')](),controller[_0x57f9('0x8')]);router[_0x57f9('0x9')](_0x57f9('0xa'),auth[_0x57f9('0x7')](),controller[_0x57f9('0xb')]);router[_0x57f9('0xc')]('/',auth[_0x57f9('0x7')](),controller['create']);router[_0x57f9('0xd')](_0x57f9('0xa'),auth[_0x57f9('0x7')](),controller[_0x57f9('0xe')]);router[_0x57f9('0xf')](_0x57f9('0xa'),auth[_0x57f9('0x7')](),controller[_0x57f9('0x10')]);module[_0x57f9('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 9eabe2b..5de50ab 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 _0x135c=['picklist','variable','STRING','ENUM','string','customVariable','keyValue'];(function(_0x1eef12,_0x553c4c){var _0x23d2b5=function(_0x5da74c){while(--_0x5da74c){_0x1eef12['push'](_0x1eef12['shift']());}};_0x23d2b5(++_0x553c4c);}(_0x135c,0xce));var _0xc135=function(_0x21d6c7,_0x575186){_0x21d6c7=_0x21d6c7-0x0;var _0x362704=_0x135c[_0x21d6c7];return _0x362704;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc135('0x0')](_0xc135('0x1'),'variable',_0xc135('0x2'),_0xc135('0x3'),_0xc135('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc135('0x0')]('string',_0xc135('0x5'),_0xc135('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc135('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d15=['customVariable','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0x5d15,0x14a));var _0x55d1=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x5d15[_0x26a906];return _0x495575;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x55d1('0x0')](_0x55d1('0x1'),_0x55d1('0x2'),'customVariable',_0x55d1('0x3'),_0x55d1('0x4')),'defaultValue':_0x55d1('0x1')},'content':{'type':Sequelize[_0x55d1('0x5')]},'key':{'type':Sequelize[_0x55d1('0x5')]},'keyType':{'type':Sequelize[_0x55d1('0x0')](_0x55d1('0x1'),_0x55d1('0x2'),_0x55d1('0x6'))},'keyContent':{'type':Sequelize[_0x55d1('0x5')]},'idField':{'type':Sequelize[_0x55d1('0x5')]},'nameField':{'type':Sequelize[_0x55d1('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x55d1('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ff06e78..43f0b45 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 _0x29a0=['Content-Range','json','apply','save','then','sendStatus','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x29a0,0xbc));var _0x029a=function(_0x52ed8c,_0x3bb747){_0x52ed8c=_0x52ed8c-0x0;var _0x1d5547=_0x29a0[_0x52ed8c];return _0x1d5547;};'use strict';var emlformat=require(_0x029a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x029a('0x1'));var jsonpatch=require(_0x029a('0x2'));var rp=require(_0x029a('0x3'));var moment=require(_0x029a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x029a('0x5'));var path=require(_0x029a('0x6'));var sox=require(_0x029a('0x7'));var csv=require(_0x029a('0x8'));var ejs=require(_0x029a('0x9'));var fs=require('fs');var fs_extra=require(_0x029a('0xa'));var _=require(_0x029a('0xb'));var squel=require(_0x029a('0xc'));var crypto=require(_0x029a('0xd'));var jsforce=require(_0x029a('0xe'));var deskjs=require(_0x029a('0xf'));var toCsv=require(_0x029a('0x8'));var querystring=require(_0x029a('0x10'));var Papa=require(_0x029a('0x11'));var Redis=require(_0x029a('0x12'));var authService=require(_0x029a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x029a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x029a('0x15'))('api');var utils=require(_0x029a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x029a('0x17'));var db=require(_0x029a('0x18'))['db'];function respondWithStatusCode(_0x26fc31,_0xb8a8e9){_0xb8a8e9=_0xb8a8e9||0xcc;return function(_0x43e35e){if(_0x43e35e){return _0x26fc31['sendStatus'](_0xb8a8e9);}return _0x26fc31[_0x029a('0x19')](_0xb8a8e9)[_0x029a('0x1a')]();};}function respondWithResult(_0x1c0a59,_0x24ecc9){_0x24ecc9=_0x24ecc9||0xc8;return function(_0x2cf661){if(_0x2cf661){return _0x1c0a59[_0x029a('0x19')](_0x24ecc9)['json'](_0x2cf661);}};}function respondWithFilteredResult(_0x52adec,_0x27d269){return function(_0x4e855d){if(_0x4e855d){var _0x26ba03=typeof _0x27d269[_0x029a('0x1b')]==='undefined'&&typeof _0x27d269[_0x029a('0x1c')]===_0x029a('0x1d');var _0x59f2e6=_0x4e855d[_0x029a('0x1e')];var _0x5e05c0=_0x26ba03?0x0:_0x27d269[_0x029a('0x1b')];var _0x1bd05b=_0x26ba03?_0x4e855d['count']:_0x27d269['offset']+_0x27d269[_0x029a('0x1c')];var _0x207adf;if(_0x1bd05b>=_0x59f2e6){_0x1bd05b=_0x59f2e6;_0x207adf=0xc8;}else{_0x207adf=0xce;}_0x52adec['status'](_0x207adf);return _0x52adec['set'](_0x029a('0x1f'),_0x5e05c0+'-'+_0x1bd05b+'/'+_0x59f2e6)[_0x029a('0x20')](_0x4e855d);}return null;};}function patchUpdates(_0x32c1e3){return function(_0x151849){try{jsonpatch[_0x029a('0x21')](_0x151849,_0x32c1e3,!![]);}catch(_0x223b41){return BPromise['reject'](_0x223b41);}return _0x151849[_0x029a('0x22')]();};}function saveUpdates(_0x329ead,_0x15e32e){return function(_0x121a10){if(_0x121a10){return _0x121a10['update'](_0x329ead)[_0x029a('0x23')](function(_0x5d4242){return _0x5d4242;});}return null;};}function removeEntity(_0x4dc164,_0x9c8bf3){return function(_0x58a986){if(_0x58a986){return _0x58a986['destroy']()[_0x029a('0x23')](function(){_0x4dc164['status'](0xcc)[_0x029a('0x1a')]();});}};}function handleEntityNotFound(_0x2f5bec,_0x618c33){return function(_0x1dcc6b){if(!_0x1dcc6b){_0x2f5bec[_0x029a('0x24')](0x194);}return _0x1dcc6b;};}function handleError(_0x13fde5,_0x4dd315){_0x4dd315=_0x4dd315||0x1f4;return function(_0x1c53e5){logger['error'](_0x1c53e5[_0x029a('0x25')]);if(_0x1c53e5[_0x029a('0x26')]){delete _0x1c53e5[_0x029a('0x26')];}_0x13fde5[_0x029a('0x19')](_0x4dd315)[_0x029a('0x27')](_0x1c53e5);};}exports[_0x029a('0x28')]=function(_0x4c331e,_0x5a095c){var _0x572359={},_0x1be163={},_0x29dfe3={'count':0x0,'rows':[]};var _0x469989=_[_0x029a('0x29')](db[_0x029a('0x2a')][_0x029a('0x2b')],function(_0x18cab1){return{'name':_0x18cab1[_0x029a('0x2c')],'type':_0x18cab1[_0x029a('0x2d')]['key']};});_0x1be163[_0x029a('0x2e')]=_[_0x029a('0x29')](_0x469989,'name');_0x1be163['query']=_[_0x029a('0x2f')](_0x4c331e[_0x029a('0x30')]);_0x1be163[_0x029a('0x31')]=_[_0x029a('0x32')](_0x1be163[_0x029a('0x2e')],_0x1be163[_0x029a('0x30')]);_0x572359[_0x029a('0x33')]=_[_0x029a('0x32')](_0x1be163[_0x029a('0x2e')],qs[_0x029a('0x34')](_0x4c331e[_0x029a('0x30')][_0x029a('0x34')]));_0x572359[_0x029a('0x33')]=_0x572359[_0x029a('0x33')][_0x029a('0x35')]?_0x572359[_0x029a('0x33')]:_0x1be163[_0x029a('0x2e')];if(!_0x4c331e[_0x029a('0x30')][_0x029a('0x36')](_0x029a('0x37'))){_0x572359['limit']=qs['limit'](_0x4c331e[_0x029a('0x30')][_0x029a('0x1c')]);_0x572359[_0x029a('0x1b')]=qs[_0x029a('0x1b')](_0x4c331e[_0x029a('0x30')]['offset']);}_0x572359['order']=qs[_0x029a('0x38')](_0x4c331e[_0x029a('0x30')]['sort']);_0x572359[_0x029a('0x39')]=qs[_0x029a('0x31')](_[_0x029a('0x3a')](_0x4c331e[_0x029a('0x30')],_0x1be163[_0x029a('0x31')]),_0x469989);if(_0x4c331e[_0x029a('0x30')][_0x029a('0x3b')]){_0x572359[_0x029a('0x39')]=_[_0x029a('0x3c')](_0x572359[_0x029a('0x39')],{'$or':_[_0x029a('0x29')](_0x469989,function(_0xee30fa){if(_0xee30fa[_0x029a('0x2d')]!==_0x029a('0x3d')){var _0x22cd2f={};_0x22cd2f[_0xee30fa[_0x029a('0x26')]]={'$like':'%'+_0x4c331e['query']['filter']+'%'};return _0x22cd2f;}})});}_0x572359=_['merge']({},_0x572359,_0x4c331e[_0x029a('0x3e')]);var _0x3111f1={'where':_0x572359[_0x029a('0x39')]};return db[_0x029a('0x2a')][_0x029a('0x1e')](_0x3111f1)[_0x029a('0x23')](function(_0x4236b8){_0x29dfe3['count']=_0x4236b8;if(_0x4c331e[_0x029a('0x30')]['includeAll']){_0x572359['include']=[{'all':!![]}];}return db[_0x029a('0x2a')][_0x029a('0x3f')](_0x572359);})[_0x029a('0x23')](function(_0x3e1643){_0x29dfe3[_0x029a('0x40')]=_0x3e1643;return _0x29dfe3;})[_0x029a('0x23')](respondWithFilteredResult(_0x5a095c,_0x572359))[_0x029a('0x41')](handleError(_0x5a095c,null));};exports[_0x029a('0x42')]=function(_0x5404c9,_0x2331e5){var _0x4ce03c={'raw':!![],'where':{'id':_0x5404c9[_0x029a('0x43')]['id']}},_0x144140={};_0x144140[_0x029a('0x2e')]=_['keys'](db[_0x029a('0x2a')][_0x029a('0x2b')]);_0x144140[_0x029a('0x30')]=_['keys'](_0x5404c9[_0x029a('0x30')]);_0x144140[_0x029a('0x31')]=_[_0x029a('0x32')](_0x144140[_0x029a('0x2e')],_0x144140[_0x029a('0x30')]);_0x4ce03c['attributes']=_[_0x029a('0x32')](_0x144140['model'],qs[_0x029a('0x34')](_0x5404c9['query'][_0x029a('0x34')]));_0x4ce03c[_0x029a('0x33')]=_0x4ce03c[_0x029a('0x33')][_0x029a('0x35')]?_0x4ce03c[_0x029a('0x33')]:_0x144140[_0x029a('0x2e')];if(_0x5404c9['query'][_0x029a('0x44')]){_0x4ce03c['include']=[{'all':!![]}];}_0x4ce03c=_[_0x029a('0x3c')]({},_0x4ce03c,_0x5404c9[_0x029a('0x3e')]);return db['VtigerField'][_0x029a('0x45')](_0x4ce03c)['then'](handleEntityNotFound(_0x2331e5,null))['then'](respondWithResult(_0x2331e5,null))['catch'](handleError(_0x2331e5,null));};exports[_0x029a('0x46')]=function(_0x403164,_0x11ea76){return db[_0x029a('0x2a')]['create'](_0x403164[_0x029a('0x47')],{})[_0x029a('0x23')](respondWithResult(_0x11ea76,0xc9))[_0x029a('0x41')](handleError(_0x11ea76,null));};exports['update']=function(_0x3f10cc,_0xb295aa){if(_0x3f10cc[_0x029a('0x47')]['id']){delete _0x3f10cc[_0x029a('0x47')]['id'];}return db[_0x029a('0x2a')]['find']({'where':{'id':_0x3f10cc[_0x029a('0x43')]['id']}})[_0x029a('0x23')](handleEntityNotFound(_0xb295aa,null))[_0x029a('0x23')](saveUpdates(_0x3f10cc[_0x029a('0x47')],null))['then'](respondWithResult(_0xb295aa,null))[_0x029a('0x41')](handleError(_0xb295aa,null));};exports[_0x029a('0x48')]=function(_0x43926f,_0x25f98d){return db[_0x029a('0x2a')]['find']({'where':{'id':_0x43926f['params']['id']}})['then'](handleEntityNotFound(_0x25f98d,null))[_0x029a('0x23')](removeEntity(_0x25f98d,null))[_0x029a('0x41')](handleError(_0x25f98d,null));}; \ No newline at end of file +var _0x6a6f=['fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','keys','find','create','body','params','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','VtigerField','rawAttributes'];(function(_0x45aa72,_0x8af642){var _0x75adaa=function(_0x1f6809){while(--_0x1f6809){_0x45aa72['push'](_0x45aa72['shift']());}};_0x75adaa(++_0x8af642);}(_0x6a6f,0x69));var _0xf6a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a6f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf6a6('0x0'));var rimraf=require(_0xf6a6('0x1'));var zipdir=require(_0xf6a6('0x2'));var jsonpatch=require(_0xf6a6('0x3'));var rp=require(_0xf6a6('0x4'));var moment=require(_0xf6a6('0x5'));var BPromise=require(_0xf6a6('0x6'));var Mustache=require(_0xf6a6('0x7'));var util=require('util');var path=require(_0xf6a6('0x8'));var sox=require(_0xf6a6('0x9'));var csv=require(_0xf6a6('0xa'));var ejs=require(_0xf6a6('0xb'));var fs=require('fs');var fs_extra=require(_0xf6a6('0xc'));var _=require(_0xf6a6('0xd'));var squel=require(_0xf6a6('0xe'));var crypto=require(_0xf6a6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xf6a6('0x10'));var toCsv=require(_0xf6a6('0xa'));var querystring=require(_0xf6a6('0x11'));var Papa=require(_0xf6a6('0x12'));var Redis=require(_0xf6a6('0x13'));var authService=require(_0xf6a6('0x14'));var qs=require(_0xf6a6('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6a6('0x16'))('api');var utils=require(_0xf6a6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf6a6('0x18'));var db=require(_0xf6a6('0x19'))['db'];function respondWithStatusCode(_0x424c32,_0x531f2e){_0x531f2e=_0x531f2e||0xcc;return function(_0x59fd8f){if(_0x59fd8f){return _0x424c32[_0xf6a6('0x1a')](_0x531f2e);}return _0x424c32[_0xf6a6('0x1b')](_0x531f2e)[_0xf6a6('0x1c')]();};}function respondWithResult(_0x746c51,_0x4d229){_0x4d229=_0x4d229||0xc8;return function(_0x3e3d16){if(_0x3e3d16){return _0x746c51[_0xf6a6('0x1b')](_0x4d229)[_0xf6a6('0x1d')](_0x3e3d16);}};}function respondWithFilteredResult(_0x12ed0a,_0x32ae9a){return function(_0x556ebd){if(_0x556ebd){var _0x2bc62f=typeof _0x32ae9a[_0xf6a6('0x1e')]==='undefined'&&typeof _0x32ae9a['limit']==='undefined';var _0x858cc7=_0x556ebd['count'];var _0x56b3bd=_0x2bc62f?0x0:_0x32ae9a[_0xf6a6('0x1e')];var _0x30d559=_0x2bc62f?_0x556ebd[_0xf6a6('0x1f')]:_0x32ae9a[_0xf6a6('0x1e')]+_0x32ae9a['limit'];var _0x7255aa;if(_0x30d559>=_0x858cc7){_0x30d559=_0x858cc7;_0x7255aa=0xc8;}else{_0x7255aa=0xce;}_0x12ed0a[_0xf6a6('0x1b')](_0x7255aa);return _0x12ed0a[_0xf6a6('0x20')](_0xf6a6('0x21'),_0x56b3bd+'-'+_0x30d559+'/'+_0x858cc7)[_0xf6a6('0x1d')](_0x556ebd);}return null;};}function patchUpdates(_0x241fd6){return function(_0x57cbc9){try{jsonpatch[_0xf6a6('0x22')](_0x57cbc9,_0x241fd6,!![]);}catch(_0x2643e7){return BPromise['reject'](_0x2643e7);}return _0x57cbc9[_0xf6a6('0x23')]();};}function saveUpdates(_0x21d3c8,_0x4a65d0){return function(_0x4190df){if(_0x4190df){return _0x4190df[_0xf6a6('0x24')](_0x21d3c8)['then'](function(_0x1caf94){return _0x1caf94;});}return null;};}function removeEntity(_0x46f707,_0x271e84){return function(_0x2f6706){if(_0x2f6706){return _0x2f6706[_0xf6a6('0x25')]()[_0xf6a6('0x26')](function(){_0x46f707[_0xf6a6('0x1b')](0xcc)[_0xf6a6('0x1c')]();});}};}function handleEntityNotFound(_0x472ead,_0x330446){return function(_0x26b931){if(!_0x26b931){_0x472ead[_0xf6a6('0x1a')](0x194);}return _0x26b931;};}function handleError(_0x38c121,_0xe10aa9){_0xe10aa9=_0xe10aa9||0x1f4;return function(_0x39a248){logger[_0xf6a6('0x27')](_0x39a248[_0xf6a6('0x28')]);if(_0x39a248[_0xf6a6('0x29')]){delete _0x39a248['name'];}_0x38c121['status'](_0xe10aa9)[_0xf6a6('0x2a')](_0x39a248);};}exports[_0xf6a6('0x2b')]=function(_0x26cdd5,_0x4db62d){var _0x19c43b={},_0x1406e8={},_0x3acdd0={'count':0x0,'rows':[]};var _0x53a62f=_[_0xf6a6('0x2c')](db[_0xf6a6('0x2d')][_0xf6a6('0x2e')],function(_0x78d197){return{'name':_0x78d197[_0xf6a6('0x2f')],'type':_0x78d197[_0xf6a6('0x30')][_0xf6a6('0x31')]};});_0x1406e8['model']=_[_0xf6a6('0x2c')](_0x53a62f,'name');_0x1406e8[_0xf6a6('0x32')]=_['keys'](_0x26cdd5[_0xf6a6('0x32')]);_0x1406e8['filters']=_[_0xf6a6('0x33')](_0x1406e8[_0xf6a6('0x34')],_0x1406e8['query']);_0x19c43b['attributes']=_[_0xf6a6('0x33')](_0x1406e8[_0xf6a6('0x34')],qs['fields'](_0x26cdd5[_0xf6a6('0x32')][_0xf6a6('0x35')]));_0x19c43b[_0xf6a6('0x36')]=_0x19c43b[_0xf6a6('0x36')][_0xf6a6('0x37')]?_0x19c43b[_0xf6a6('0x36')]:_0x1406e8[_0xf6a6('0x34')];if(!_0x26cdd5[_0xf6a6('0x32')][_0xf6a6('0x38')]('nolimit')){_0x19c43b['limit']=qs[_0xf6a6('0x39')](_0x26cdd5['query'][_0xf6a6('0x39')]);_0x19c43b[_0xf6a6('0x1e')]=qs['offset'](_0x26cdd5[_0xf6a6('0x32')][_0xf6a6('0x1e')]);}_0x19c43b[_0xf6a6('0x3a')]=qs[_0xf6a6('0x3b')](_0x26cdd5['query'][_0xf6a6('0x3b')]);_0x19c43b[_0xf6a6('0x3c')]=qs[_0xf6a6('0x3d')](_[_0xf6a6('0x3e')](_0x26cdd5[_0xf6a6('0x32')],_0x1406e8[_0xf6a6('0x3d')]),_0x53a62f);if(_0x26cdd5[_0xf6a6('0x32')]['filter']){_0x19c43b['where']=_[_0xf6a6('0x3f')](_0x19c43b[_0xf6a6('0x3c')],{'$or':_[_0xf6a6('0x2c')](_0x53a62f,function(_0x5b1ae2){if(_0x5b1ae2['type']!==_0xf6a6('0x40')){var _0x1ccea7={};_0x1ccea7[_0x5b1ae2[_0xf6a6('0x29')]]={'$like':'%'+_0x26cdd5['query'][_0xf6a6('0x41')]+'%'};return _0x1ccea7;}})});}_0x19c43b=_[_0xf6a6('0x3f')]({},_0x19c43b,_0x26cdd5['options']);var _0x7d333e={'where':_0x19c43b[_0xf6a6('0x3c')]};return db[_0xf6a6('0x2d')][_0xf6a6('0x1f')](_0x7d333e)[_0xf6a6('0x26')](function(_0x5b4776){_0x3acdd0[_0xf6a6('0x1f')]=_0x5b4776;if(_0x26cdd5[_0xf6a6('0x32')][_0xf6a6('0x42')]){_0x19c43b[_0xf6a6('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0xf6a6('0x44')](_0x19c43b);})[_0xf6a6('0x26')](function(_0x225068){_0x3acdd0[_0xf6a6('0x45')]=_0x225068;return _0x3acdd0;})[_0xf6a6('0x26')](respondWithFilteredResult(_0x4db62d,_0x19c43b))[_0xf6a6('0x46')](handleError(_0x4db62d,null));};exports['show']=function(_0x341d2d,_0x9ecdf1){var _0x5b618b={'raw':!![],'where':{'id':_0x341d2d['params']['id']}},_0x3f8a1a={};_0x3f8a1a[_0xf6a6('0x34')]=_[_0xf6a6('0x47')](db['VtigerField'][_0xf6a6('0x2e')]);_0x3f8a1a[_0xf6a6('0x32')]=_[_0xf6a6('0x47')](_0x341d2d[_0xf6a6('0x32')]);_0x3f8a1a['filters']=_[_0xf6a6('0x33')](_0x3f8a1a[_0xf6a6('0x34')],_0x3f8a1a[_0xf6a6('0x32')]);_0x5b618b['attributes']=_[_0xf6a6('0x33')](_0x3f8a1a[_0xf6a6('0x34')],qs[_0xf6a6('0x35')](_0x341d2d[_0xf6a6('0x32')]['fields']));_0x5b618b[_0xf6a6('0x36')]=_0x5b618b[_0xf6a6('0x36')][_0xf6a6('0x37')]?_0x5b618b[_0xf6a6('0x36')]:_0x3f8a1a['model'];if(_0x341d2d[_0xf6a6('0x32')][_0xf6a6('0x42')]){_0x5b618b[_0xf6a6('0x43')]=[{'all':!![]}];}_0x5b618b=_[_0xf6a6('0x3f')]({},_0x5b618b,_0x341d2d['options']);return db[_0xf6a6('0x2d')][_0xf6a6('0x48')](_0x5b618b)['then'](handleEntityNotFound(_0x9ecdf1,null))[_0xf6a6('0x26')](respondWithResult(_0x9ecdf1,null))[_0xf6a6('0x46')](handleError(_0x9ecdf1,null));};exports[_0xf6a6('0x49')]=function(_0x4b793b,_0x59831b){return db[_0xf6a6('0x2d')]['create'](_0x4b793b[_0xf6a6('0x4a')],{})[_0xf6a6('0x26')](respondWithResult(_0x59831b,0xc9))[_0xf6a6('0x46')](handleError(_0x59831b,null));};exports[_0xf6a6('0x24')]=function(_0x55f991,_0x482a1){if(_0x55f991['body']['id']){delete _0x55f991[_0xf6a6('0x4a')]['id'];}return db[_0xf6a6('0x2d')][_0xf6a6('0x48')]({'where':{'id':_0x55f991[_0xf6a6('0x4b')]['id']}})[_0xf6a6('0x26')](handleEntityNotFound(_0x482a1,null))[_0xf6a6('0x26')](saveUpdates(_0x55f991[_0xf6a6('0x4a')],null))['then'](respondWithResult(_0x482a1,null))['catch'](handleError(_0x482a1,null));};exports['destroy']=function(_0x35f7fe,_0x3af0fa){return db[_0xf6a6('0x2d')][_0xf6a6('0x48')]({'where':{'id':_0x35f7fe[_0xf6a6('0x4b')]['id']}})[_0xf6a6('0x26')](handleEntityNotFound(_0x3af0fa,null))[_0xf6a6('0x26')](removeEntity(_0x3af0fa,null))['catch'](handleError(_0x3af0fa,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index bf5d463..ca36da5 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 _0xbbdc=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0xbbdc,0xd3));var _0xcbbd=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbbdc[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0xcbbd('0x0'));var logger=require(_0xcbbd('0x1'))(_0xcbbd('0x2'));var moment=require(_0xcbbd('0x3'));var BPromise=require(_0xcbbd('0x4'));var rp=require(_0xcbbd('0x5'));var fs=require('fs');var path=require(_0xcbbd('0x6'));var rimraf=require(_0xcbbd('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xcbbd('0x8')]=function(_0x184444,_0x531f1b){return _0x184444[_0xcbbd('0x9')]('VtigerField',attributes,{'tableName':_0xcbbd('0xa'),'paranoid':![],'indexes':[{'name':_0xcbbd('0xb'),'fields':[_0xcbbd('0xc'),_0xcbbd('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a36=['idField','FieldId','../../config/logger','api','moment','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x169287,_0x1df3bc){var _0x35ca59=function(_0x50b78e){while(--_0x50b78e){_0x169287['push'](_0x169287['shift']());}};_0x35ca59(++_0x1df3bc);}(_0x5a36,0x1ec));var _0x65a3=function(_0x388546,_0x387a8c){_0x388546=_0x388546-0x0;var _0x59e418=_0x5a36[_0x388546];return _0x59e418;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x65a3('0x0'))(_0x65a3('0x1'));var moment=require(_0x65a3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x65a3('0x3'));var rimraf=require(_0x65a3('0x4'));var config=require(_0x65a3('0x5'));var attributes=require(_0x65a3('0x6'));module[_0x65a3('0x7')]=function(_0x4d6d95,_0x1efc14){return _0x4d6d95[_0x65a3('0x8')](_0x65a3('0x9'),attributes,{'tableName':_0x65a3('0xa'),'paranoid':![],'indexes':[{'name':_0x65a3('0xb'),'fields':[_0x65a3('0xc'),_0x65a3('0xd')],'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 8cbd1a3..21bc34d 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 _0xc2a8=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4ced59,_0x3e46cc){var _0x4cc09a=function(_0x46736d){while(--_0x46736d){_0x4ced59['push'](_0x4ced59['shift']());}};_0x4cc09a(++_0x3e46cc);}(_0xc2a8,0x1bc));var _0x8c2a=function(_0x53f344,_0x59947b){_0x53f344=_0x53f344-0x0;var _0x1e2750=_0xc2a8[_0x53f344];return _0x1e2750;};'use strict';var _=require(_0x8c2a('0x0'));var util=require(_0x8c2a('0x1'));var moment=require(_0x8c2a('0x2'));var BPromise=require(_0x8c2a('0x3'));var rs=require(_0x8c2a('0x4'));var fs=require('fs');var Redis=require(_0x8c2a('0x5'));var db=require(_0x8c2a('0x6'))['db'];var utils=require(_0x8c2a('0x7'));var logger=require('../../config/logger')(_0x8c2a('0x8'));var config=require(_0x8c2a('0x9'));var jayson=require(_0x8c2a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x594b06,_0x18ab57,_0x242832){return new BPromise(function(_0x4951e9,_0x4cd7d4){return client['request'](_0x594b06,_0x242832)[_0x8c2a('0xb')](function(_0x76006e){logger['info'](_0x8c2a('0xc'),_0x18ab57,_0x8c2a('0xd'));logger[_0x8c2a('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x18ab57,_0x8c2a('0xd'),JSON[_0x8c2a('0xf')](_0x76006e));if(_0x76006e[_0x8c2a('0x10')]){if(_0x76006e[_0x8c2a('0x10')][_0x8c2a('0x11')]===0x1f4){logger[_0x8c2a('0x10')]('VtigerField,\x20%s,\x20%s',_0x18ab57,_0x76006e[_0x8c2a('0x10')][_0x8c2a('0x12')]);return _0x4cd7d4(_0x76006e[_0x8c2a('0x10')][_0x8c2a('0x12')]);}logger[_0x8c2a('0x10')](_0x8c2a('0xc'),_0x18ab57,_0x76006e[_0x8c2a('0x10')]['message']);return _0x4951e9(_0x76006e['error'][_0x8c2a('0x12')]);}else{logger[_0x8c2a('0x13')](_0x8c2a('0xc'),_0x18ab57,'request\x20sent');_0x4951e9(_0x76006e[_0x8c2a('0x14')]['message']);}})[_0x8c2a('0x15')](function(_0x3d57b8){logger[_0x8c2a('0x10')](_0x8c2a('0xc'),_0x18ab57,_0x3d57b8);_0x4cd7d4(_0x3d57b8);});});} \ No newline at end of file +var _0x1003=['code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e43be,_0x3c3c67){var _0x2cce24=function(_0x41d05b){while(--_0x41d05b){_0x4e43be['push'](_0x4e43be['shift']());}};_0x2cce24(++_0x3c3c67);}(_0x1003,0x101));var _0x3100=function(_0x40495f,_0x83f995){_0x40495f=_0x40495f-0x0;var _0x2bc9bc=_0x1003[_0x40495f];return _0x2bc9bc;};'use strict';var _=require(_0x3100('0x0'));var util=require(_0x3100('0x1'));var moment=require(_0x3100('0x2'));var BPromise=require('bluebird');var rs=require(_0x3100('0x3'));var fs=require('fs');var Redis=require(_0x3100('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3100('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3100('0x6'));var client=jayson[_0x3100('0x7')][_0x3100('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5519f6,_0x157011,_0x3285d5){return new BPromise(function(_0x4b5519,_0x2ca64e){return client[_0x3100('0x9')](_0x5519f6,_0x3285d5)['then'](function(_0x2b98e9){logger[_0x3100('0xa')]('VtigerField,\x20%s,\x20%s',_0x157011,_0x3100('0xb'));logger[_0x3100('0xc')](_0x3100('0xd'),_0x157011,_0x3100('0xb'),JSON[_0x3100('0xe')](_0x2b98e9));if(_0x2b98e9[_0x3100('0xf')]){if(_0x2b98e9['error'][_0x3100('0x10')]===0x1f4){logger['error'](_0x3100('0x11'),_0x157011,_0x2b98e9[_0x3100('0xf')][_0x3100('0x12')]);return _0x2ca64e(_0x2b98e9['error'][_0x3100('0x12')]);}logger[_0x3100('0xf')](_0x3100('0x11'),_0x157011,_0x2b98e9[_0x3100('0xf')][_0x3100('0x12')]);return _0x4b5519(_0x2b98e9['error'][_0x3100('0x12')]);}else{logger[_0x3100('0xa')](_0x3100('0x11'),_0x157011,'request\x20sent');_0x4b5519(_0x2b98e9[_0x3100('0x13')][_0x3100('0x12')]);}})[_0x3100('0x14')](function(_0x5bb3f3){logger[_0x3100('0xf')](_0x3100('0x11'),_0x157011,_0x5bb3f3);_0x2ca64e(_0x5bb3f3);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index be62d76..a2fb89d 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 _0x0946=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x509cd3,_0x2f3032){var _0x3cdd06=function(_0x21ee1a){while(--_0x21ee1a){_0x509cd3['push'](_0x509cd3['shift']());}};_0x3cdd06(++_0x2f3032);}(_0x0946,0x130));var _0x6094=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0x0946[_0x1757f2];return _0x5e7212;};'use strict';var multer=require(_0x6094('0x0'));var util=require(_0x6094('0x1'));var path=require(_0x6094('0x2'));var timeout=require(_0x6094('0x3'));var express=require(_0x6094('0x4'));var router=express[_0x6094('0x5')]();var fs_extra=require(_0x6094('0x6'));var auth=require(_0x6094('0x7'));var interaction=require(_0x6094('0x8'));var config=require(_0x6094('0x9'));var controller=require(_0x6094('0xa'));router[_0x6094('0xb')]('/',auth[_0x6094('0xc')](),controller[_0x6094('0xd')]);router[_0x6094('0xb')](_0x6094('0xe'),auth[_0x6094('0xc')](),controller[_0x6094('0xf')]);router['get'](_0x6094('0x10'),auth[_0x6094('0xc')](),controller[_0x6094('0x11')]);router[_0x6094('0xb')](_0x6094('0x12'),auth[_0x6094('0xc')](),controller['getFields']);router[_0x6094('0x13')]('/',auth['isAuthenticated'](),controller[_0x6094('0x14')]);router[_0x6094('0x13')](_0x6094('0x10'),auth[_0x6094('0xc')](),controller[_0x6094('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6094('0x16')]);router['delete'](_0x6094('0xe'),auth[_0x6094('0xc')](),controller[_0x6094('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6177=['isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x51f113,_0x2771e3){var _0x2d60d4=function(_0x481bf5){while(--_0x481bf5){_0x51f113['push'](_0x51f113['shift']());}};_0x2d60d4(++_0x2771e3);}(_0x6177,0xf8));var _0x7617=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x6177[_0xc67528];return _0x38e26d;};'use strict';var multer=require(_0x7617('0x0'));var util=require(_0x7617('0x1'));var path=require(_0x7617('0x2'));var timeout=require(_0x7617('0x3'));var express=require(_0x7617('0x4'));var router=express[_0x7617('0x5')]();var fs_extra=require(_0x7617('0x6'));var auth=require(_0x7617('0x7'));var interaction=require(_0x7617('0x8'));var config=require(_0x7617('0x9'));var controller=require(_0x7617('0xa'));router[_0x7617('0xb')]('/',auth[_0x7617('0xc')](),controller[_0x7617('0xd')]);router[_0x7617('0xb')](_0x7617('0xe'),auth[_0x7617('0xc')](),controller[_0x7617('0xf')]);router[_0x7617('0xb')]('/:id/configurations',auth[_0x7617('0xc')](),controller[_0x7617('0x10')]);router['get'](_0x7617('0x11'),auth[_0x7617('0xc')](),controller[_0x7617('0x12')]);router[_0x7617('0x13')]('/',auth['isAuthenticated'](),controller[_0x7617('0x14')]);router[_0x7617('0x13')](_0x7617('0x15'),auth[_0x7617('0xc')](),controller[_0x7617('0x16')]);router['put'](_0x7617('0xe'),auth[_0x7617('0xc')](),controller[_0x7617('0x17')]);router[_0x7617('0x18')](_0x7617('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7617('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index bd318a3..5431e58 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 _0x1261=['ENUM','password','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x39b9ad,_0x353c33){var _0x74dfd5=function(_0x362433){while(--_0x362433){_0x39b9ad['push'](_0x39b9ad['shift']());}};_0x74dfd5(++_0x353c33);}(_0x1261,0x144));var _0x1126=function(_0xecc551,_0x471cac){_0xecc551=_0xecc551-0x0;var _0x344658=_0x1261[_0xecc551];return _0x344658;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'password':{'type':Sequelize[_0x1126('0x1')]},'token':{'type':Sequelize[_0x1126('0x1')]},'remoteUri':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x3')},'authType':{'type':Sequelize[_0x1126('0x4')]('password','token'),'defaultValue':_0x1126('0x5')},'serverUrl':{'type':Sequelize[_0x1126('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1126('0x6'),_0x1126('0x7')),'defaultValue':_0x1126('0x6')}}; \ No newline at end of file +var _0x1a37=['remoteUri','password','ENUM','integrationTab','sequelize','exports','STRING','username'];(function(_0x59d35b,_0x2cb74d){var _0x2f2bcd=function(_0x161bf0){while(--_0x161bf0){_0x59d35b['push'](_0x59d35b['shift']());}};_0x2f2bcd(++_0x2cb74d);}(_0x1a37,0xb4));var _0x71a3=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x1a37[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'password':{'type':Sequelize[_0x71a3('0x2')]},'token':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'authType':{'type':Sequelize['ENUM'](_0x71a3('0x5'),'token'),'defaultValue':_0x71a3('0x5')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x71a3('0x6')](_0x71a3('0x7'),'newTab'),'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 e721e71..13c4eed 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 _0xf4eb=['includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields','stringify','send','Wrong\x20credentials','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','order','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskConfiguration','ZendeskField','findOne','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','token','ValidationError','description','assignee','remove','ticket_fields'];(function(_0x503b3c,_0x4207c0){var _0x2009ba=function(_0x56f0c0){while(--_0x56f0c0){_0x503b3c['push'](_0x503b3c['shift']());}};_0x2009ba(++_0x4207c0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1d580f,_0x3f3a87){_0x1d580f=_0x1d580f-0x0;var _0x2c4fc9=_0xf4eb[_0x1d580f];return _0x2c4fc9;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbf4e('0x13'));function respondWithStatusCode(_0x5a3035,_0x56d185){_0x56d185=_0x56d185||0xcc;return function(_0x209b25){if(_0x209b25){return _0x5a3035[_0xbf4e('0x14')](_0x56d185);}return _0x5a3035[_0xbf4e('0x15')](_0x56d185)[_0xbf4e('0x16')]();};}function respondWithResult(_0x3b74bd,_0x61bd54){_0x61bd54=_0x61bd54||0xc8;return function(_0x4984b4){if(_0x4984b4){return _0x3b74bd['status'](_0x61bd54)[_0xbf4e('0x17')](_0x4984b4);}};}function respondWithFilteredResult(_0x1735ae,_0x28fc6b){return function(_0x542909){if(_0x542909){var _0x14110b=typeof _0x28fc6b[_0xbf4e('0x18')]===_0xbf4e('0x19')&&typeof _0x28fc6b[_0xbf4e('0x1a')]==='undefined';var _0x247322=_0x542909['count'];var _0x5db03f=_0x14110b?0x0:_0x28fc6b['offset'];var _0x4f8762=_0x14110b?_0x542909[_0xbf4e('0x1b')]:_0x28fc6b[_0xbf4e('0x18')]+_0x28fc6b[_0xbf4e('0x1a')];var _0x4d9c2a;if(_0x4f8762>=_0x247322){_0x4f8762=_0x247322;_0x4d9c2a=0xc8;}else{_0x4d9c2a=0xce;}_0x1735ae['status'](_0x4d9c2a);return _0x1735ae[_0xbf4e('0x1c')](_0xbf4e('0x1d'),_0x5db03f+'-'+_0x4f8762+'/'+_0x247322)[_0xbf4e('0x17')](_0x542909);}return null;};}function patchUpdates(_0x3a875b){return function(_0x344727){try{jsonpatch[_0xbf4e('0x1e')](_0x344727,_0x3a875b,!![]);}catch(_0x415963){return BPromise[_0xbf4e('0x1f')](_0x415963);}return _0x344727[_0xbf4e('0x20')]();};}function saveUpdates(_0x376832,_0x30539b){return function(_0x59bd84){if(_0x59bd84){return _0x59bd84[_0xbf4e('0x21')](_0x376832)[_0xbf4e('0x22')](function(_0x51648c){return _0x51648c;});}return null;};}function removeEntity(_0x31e3f5,_0x30994d){return function(_0x114412){if(_0x114412){return _0x114412[_0xbf4e('0x23')]()[_0xbf4e('0x22')](function(){_0x31e3f5['status'](0xcc)[_0xbf4e('0x16')]();});}};}function handleEntityNotFound(_0x36688a,_0x3d6863){return function(_0x5766d4){if(!_0x5766d4){_0x36688a[_0xbf4e('0x14')](0x194);}return _0x5766d4;};}function handleError(_0x5e08b1,_0x5bcf71){_0x5bcf71=_0x5bcf71||0x1f4;return function(_0x2bfccf){logger['error'](_0x2bfccf[_0xbf4e('0x24')]);if(_0x2bfccf[_0xbf4e('0x25')]){delete _0x2bfccf[_0xbf4e('0x25')];}_0x5e08b1[_0xbf4e('0x15')](_0x5bcf71)['send'](_0x2bfccf);};}exports[_0xbf4e('0x26')]=function(_0x8e0ab5,_0x43879d){var _0x4cd4a1={},_0x681c3b={},_0x590c85={'count':0x0,'rows':[]};var _0x1dfa81=_[_0xbf4e('0x27')](db[_0xbf4e('0x28')]['rawAttributes'],function(_0x1d12e2){return{'name':_0x1d12e2[_0xbf4e('0x29')],'type':_0x1d12e2[_0xbf4e('0x2a')][_0xbf4e('0x2b')]};});_0x681c3b[_0xbf4e('0x2c')]=_[_0xbf4e('0x27')](_0x1dfa81,'name');_0x681c3b[_0xbf4e('0x2d')]=_[_0xbf4e('0x2e')](_0x8e0ab5['query']);_0x681c3b[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](_0x681c3b['model'],_0x681c3b[_0xbf4e('0x2d')]);_0x4cd4a1['attributes']=_[_0xbf4e('0x30')](_0x681c3b['model'],qs[_0xbf4e('0x31')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x31')]));_0x4cd4a1['attributes']=_0x4cd4a1[_0xbf4e('0x32')][_0xbf4e('0x33')]?_0x4cd4a1[_0xbf4e('0x32')]:_0x681c3b[_0xbf4e('0x2c')];if(!_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x34')]('nolimit')){_0x4cd4a1[_0xbf4e('0x1a')]=qs[_0xbf4e('0x1a')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x1a')]);_0x4cd4a1[_0xbf4e('0x18')]=qs['offset'](_0x8e0ab5['query']['offset']);}_0x4cd4a1['order']=qs[_0xbf4e('0x35')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x35')]);_0x4cd4a1[_0xbf4e('0x36')]=qs[_0xbf4e('0x2f')](_[_0xbf4e('0x37')](_0x8e0ab5[_0xbf4e('0x2d')],_0x681c3b[_0xbf4e('0x2f')]),_0x1dfa81);if(_0x8e0ab5[_0xbf4e('0x2d')]['filter']){_0x4cd4a1['where']=_[_0xbf4e('0x38')](_0x4cd4a1[_0xbf4e('0x36')],{'$or':_[_0xbf4e('0x27')](_0x1dfa81,function(_0x4ae676){if(_0x4ae676[_0xbf4e('0x2a')]!=='VIRTUAL'){var _0x370d90={};_0x370d90[_0x4ae676[_0xbf4e('0x25')]]={'$like':'%'+_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x39')]+'%'};return _0x370d90;}})});}_0x4cd4a1=_['merge']({},_0x4cd4a1,_0x8e0ab5[_0xbf4e('0x3a')]);var _0x78ab2d={'where':_0x4cd4a1[_0xbf4e('0x36')]};return db[_0xbf4e('0x28')]['count'](_0x78ab2d)[_0xbf4e('0x22')](function(_0x44e96b){_0x590c85[_0xbf4e('0x1b')]=_0x44e96b;if(_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x3b')]){_0x4cd4a1[_0xbf4e('0x3c')]=[{'all':!![]}];}return db[_0xbf4e('0x28')]['findAll'](_0x4cd4a1);})[_0xbf4e('0x22')](function(_0x7b3a94){_0x590c85['rows']=_0x7b3a94;return _0x590c85;})['then'](respondWithFilteredResult(_0x43879d,_0x4cd4a1))[_0xbf4e('0x3d')](handleError(_0x43879d,null));};exports[_0xbf4e('0x3e')]=function(_0x495e53,_0x5bfc4d){var _0x2b1bf4={'raw':![],'where':{'id':_0x495e53[_0xbf4e('0x3f')]['id']}},_0x150224={};_0x150224[_0xbf4e('0x2c')]=_[_0xbf4e('0x2e')](db[_0xbf4e('0x28')]['rawAttributes']);_0x150224[_0xbf4e('0x2d')]=_[_0xbf4e('0x2e')](_0x495e53['query']);_0x150224['filters']=_['intersection'](_0x150224['model'],_0x150224[_0xbf4e('0x2d')]);_0x2b1bf4['attributes']=_[_0xbf4e('0x30')](_0x150224[_0xbf4e('0x2c')],qs['fields'](_0x495e53['query'][_0xbf4e('0x31')]));_0x2b1bf4[_0xbf4e('0x32')]=_0x2b1bf4[_0xbf4e('0x32')][_0xbf4e('0x33')]?_0x2b1bf4[_0xbf4e('0x32')]:_0x150224['model'];if(_0x495e53[_0xbf4e('0x2d')][_0xbf4e('0x3b')]){_0x2b1bf4[_0xbf4e('0x3c')]=[{'all':!![]}];}_0x2b1bf4=_[_0xbf4e('0x38')]({},_0x2b1bf4,_0x495e53[_0xbf4e('0x3a')]);return db[_0xbf4e('0x28')][_0xbf4e('0x40')](_0x2b1bf4)[_0xbf4e('0x22')](handleEntityNotFound(_0x5bfc4d,null))['then'](respondWithResult(_0x5bfc4d,null))[_0xbf4e('0x3d')](handleError(_0x5bfc4d,null));};exports[_0xbf4e('0x41')]=function(_0x1833c1,_0x32bed6){return db[_0xbf4e('0x28')][_0xbf4e('0x41')](_0x1833c1[_0xbf4e('0x42')],{})[_0xbf4e('0x22')](respondWithResult(_0x32bed6,0xc9))[_0xbf4e('0x3d')](handleError(_0x32bed6,null));};exports[_0xbf4e('0x21')]=function(_0x2fdba9,_0x6fd78d){if(_0x2fdba9[_0xbf4e('0x42')]['id']){delete _0x2fdba9[_0xbf4e('0x42')]['id'];}return db[_0xbf4e('0x28')][_0xbf4e('0x40')]({'where':{'id':_0x2fdba9[_0xbf4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x6fd78d,null))[_0xbf4e('0x22')](saveUpdates(_0x2fdba9[_0xbf4e('0x42')],null))[_0xbf4e('0x22')](respondWithResult(_0x6fd78d,null))['catch'](handleError(_0x6fd78d,null));};exports[_0xbf4e('0x23')]=function(_0x5ed838,_0x4a050e){return db[_0xbf4e('0x28')][_0xbf4e('0x40')]({'where':{'id':_0x5ed838['params']['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x4a050e,null))[_0xbf4e('0x22')](removeEntity(_0x4a050e,null))[_0xbf4e('0x3d')](handleError(_0x4a050e,null));};exports[_0xbf4e('0x43')]=function(_0x42eef6,_0x2ac2c8,_0x419969){var _0x1cdd8c={};var _0x3cd61b={};var _0xc058e1;var _0x271ad2;return db['ZendeskAccount']['findOne']({'where':{'id':_0x42eef6[_0xbf4e('0x3f')]['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x2ac2c8,null))[_0xbf4e('0x22')](function(_0x586f5d){if(_0x586f5d){_0xc058e1=_0x586f5d;_0x3cd61b[_0xbf4e('0x2c')]=_[_0xbf4e('0x2e')](db['ZendeskConfiguration']['rawAttributes']);_0x3cd61b[_0xbf4e('0x2d')]=_['keys'](_0x42eef6['query']);_0x3cd61b[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](_0x3cd61b[_0xbf4e('0x2c')],_0x3cd61b[_0xbf4e('0x2d')]);_0x1cdd8c[_0xbf4e('0x32')]=_['intersection'](_0x3cd61b[_0xbf4e('0x2c')],qs['fields'](_0x42eef6[_0xbf4e('0x2d')]['fields']));_0x1cdd8c[_0xbf4e('0x32')]=_0x1cdd8c['attributes'][_0xbf4e('0x33')]?_0x1cdd8c[_0xbf4e('0x32')]:_0x3cd61b[_0xbf4e('0x2c')];_0x1cdd8c[_0xbf4e('0x44')]=qs[_0xbf4e('0x35')](_0x42eef6['query']['sort']);_0x1cdd8c['where']=qs['filters'](_[_0xbf4e('0x37')](_0x42eef6[_0xbf4e('0x2d')],_0x3cd61b['filters']));if(_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x39')]){_0x1cdd8c[_0xbf4e('0x36')]=_[_0xbf4e('0x38')](_0x1cdd8c[_0xbf4e('0x36')],{'$or':_[_0xbf4e('0x27')](_0x1cdd8c[_0xbf4e('0x32')],function(_0x48682c){var _0x25c254={};_0x25c254[_0x48682c]={'$like':'%'+_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x39')]+'%'};return _0x25c254;})});}_0x1cdd8c=_['merge']({},_0x1cdd8c,_0x42eef6['options']);return _0xc058e1[_0xbf4e('0x43')](_0x1cdd8c);}})[_0xbf4e('0x22')](function(_0x2e8a62){if(_0x2e8a62){_0x271ad2=_0x2e8a62['length'];if(!_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x34')](_0xbf4e('0x45'))){_0x1cdd8c[_0xbf4e('0x1a')]=qs[_0xbf4e('0x1a')](_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x1a')]);_0x1cdd8c[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x18')]);}return _0xc058e1[_0xbf4e('0x43')](_0x1cdd8c);}})['then'](function(_0x21cbd2){if(_0x21cbd2){return _0x21cbd2?{'count':_0x271ad2,'rows':_0x21cbd2}:null;}})['then'](respondWithResult(_0x2ac2c8,null))[_0xbf4e('0x3d')](handleError(_0x2ac2c8,null));};exports[_0xbf4e('0x46')]=function(_0x400fa5,_0x180b13,_0x2080ec){if(_0x400fa5[_0xbf4e('0x42')]['id']){delete _0x400fa5[_0xbf4e('0x42')]['id'];}return db[_0xbf4e('0x28')]['findOne']({'where':{'id':_0x400fa5[_0xbf4e('0x3f')]['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x180b13,null))[_0xbf4e('0x22')](function(_0x33f9c4){if(_0x33f9c4){_0x400fa5[_0xbf4e('0x42')]['AccountId']=_0x33f9c4['id'];_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x47')]=integrations[_0xbf4e('0x48')](_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x49')],_0x400fa5[_0xbf4e('0x42')]['type']);_0x400fa5[_0xbf4e('0x42')]['Descriptions']=integrations[_0xbf4e('0x4a')](_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x49')],_0x400fa5[_0xbf4e('0x42')]['type']);return db[_0xbf4e('0x4b')]['create'](_0x400fa5['body'],{'include':[{'model':db[_0xbf4e('0x4c')],'as':_0xbf4e('0x47')},{'model':db[_0xbf4e('0x4c')],'as':'Descriptions'}]});}return null;})[_0xbf4e('0x22')](respondWithResult(_0x180b13,null))[_0xbf4e('0x3d')](handleError(_0x180b13,null));};exports['getFields']=function(_0x19c5b4,_0x42df5f,_0x4405b9){var _0x137224='';return db[_0xbf4e('0x28')][_0xbf4e('0x4d')]({'where':{'id':_0x19c5b4[_0xbf4e('0x3f')]['id']},'attributes':['id',_0xbf4e('0x4e'),_0xbf4e('0x4f'),'token',_0xbf4e('0x50'),_0xbf4e('0x51')]})[_0xbf4e('0x22')](handleEntityNotFound(_0x42df5f,null))[_0xbf4e('0x22')](function(_0x54f450){if(_0x54f450){_0x137224=_0x54f450[_0xbf4e('0x51')];var _0x667836=_0x137224[_0xbf4e('0x52')](-0x1);if(_0x667836==='/'){_0x137224=_0x137224[_0xbf4e('0x53')](0x0,_0x137224[_0xbf4e('0x54')](_0x667836));}var _0x3448f5={'method':_0xbf4e('0x55'),'uri':util[_0xbf4e('0x56')](_0xbf4e('0x57'),_0x137224,'ticket_fields'),'json':!![]};switch(_0x54f450[_0xbf4e('0x50')]){case'password':_0x3448f5[_0xbf4e('0x58')]={'Authorization':util[_0xbf4e('0x56')](_0xbf4e('0x59'),new Buffer(util[_0xbf4e('0x56')](_0xbf4e('0x5a'),_0x54f450['username'],_0x54f450[_0xbf4e('0x4f')]))[_0xbf4e('0x5b')](_0xbf4e('0x5c')))};break;case'token':_0x3448f5[_0xbf4e('0x58')]={'Authorization':util[_0xbf4e('0x56')](_0xbf4e('0x59'),new Buffer(util['format'](_0xbf4e('0x5d'),_0x54f450[_0xbf4e('0x4e')],_0x54f450[_0xbf4e('0x5e')]))[_0xbf4e('0x5b')](_0xbf4e('0x5c')))};break;default:throw new db['Sequelize'][(_0xbf4e('0x5f'))]('Unknown\x20authentication\x20type');}return rp(_0x3448f5);}})[_0xbf4e('0x22')](function(_0x504723){if(_0x504723){var _0x19a7e9=['subject',_0xbf4e('0x60'),'group',_0xbf4e('0x61')];_[_0xbf4e('0x62')](_0x504723[_0xbf4e('0x63')],function(_0x23de82){return _0x19a7e9[_0xbf4e('0x64')](_0x23de82[_0xbf4e('0x2a')]);});return{'count':_0x504723[_0xbf4e('0x63')]['length'],'rows':_[_0xbf4e('0x27')](_0x504723[_0xbf4e('0x63')],function(_0x2a242b){return{'id':_0x2a242b['id'],'name':_0x2a242b[_0xbf4e('0x65')]>0x7?_0x2a242b[_0xbf4e('0x66')]:_0x2a242b[_0xbf4e('0x2a')],'custom':_0x2a242b['position']>0x7?!![]:![],'options':_0x2a242b[_0xbf4e('0x67')]?_0x2a242b[_0xbf4e('0x67')]:_0x2a242b['custom_field_options']?_0x2a242b[_0xbf4e('0x68')]:[]};})};}})[_0xbf4e('0x22')](respondWithResult(_0x42df5f,null))[_0xbf4e('0x3d')](function(_0xb6d122){var _0x19ec7e=_0x19c5b4[_0xbf4e('0x2d')][_0xbf4e('0x69')]?0x1f4:_0xb6d122[_0xbf4e('0x6a')]||0x1f4;logger[_0xbf4e('0x6b')]('getFields,\x20%s,\x20%s,\x20%s',_0xbf4e('0x6c'),_0x19ec7e,JSON[_0xbf4e('0x6d')](_0xb6d122));delete _0xb6d122[_0xbf4e('0x25')];if(_0x19ec7e===0x191){_0x19ec7e=0x190;}_0x42df5f['status'](_0x19ec7e)[_0xbf4e('0x6e')](_0x19c5b4[_0xbf4e('0x2d')]['test']?{'message':_0xbf4e('0x6f'),'statusCode':_0xb6d122[_0xbf4e('0x6a')]}:_0xb6d122);});}; \ No newline at end of file +var _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x3ef550,_0x43d56c){var _0x2c97ec=function(_0x5482e6){while(--_0x5482e6){_0x3ef550['push'](_0x3ef550['shift']());}};_0x2c97ec(++_0x43d56c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x264fdb,_0x511406){_0x264fdb=_0x264fdb-0x0;var _0x3af01b=_0x9ffd[_0x264fdb];return _0x3af01b;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2822310..3e7fd6f 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 _0x57ca=['../../components/integrations/configuration','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x57ca,0xff));var _0xa57c=function(_0x912ce8,_0x1f7cb5){_0x912ce8=_0x912ce8-0x0;var _0x4cd09a=_0x57ca[_0x912ce8];return _0x4cd09a;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require(_0xa57c('0x7'));var attributes=require(_0xa57c('0x8'));var integrations=require(_0xa57c('0x9'));module['exports']=function(_0x36da95,_0x1ac8ab){return _0x36da95[_0xa57c('0xa')](_0xa57c('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf35=['request-promise','rimraf','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','moment','bluebird'];(function(_0x2a7d55,_0x36bd70){var _0x137989=function(_0x51246a){while(--_0x51246a){_0x2a7d55['push'](_0x2a7d55['shift']());}};_0x137989(++_0x36bd70);}(_0xbf35,0x13c));var _0x5bf3=function(_0x59f6dc,_0x390dc0){_0x59f6dc=_0x59f6dc-0x0;var _0x36ea78=_0xbf35[_0x59f6dc];return _0x36ea78;};'use strict';var _=require(_0x5bf3('0x0'));var util=require(_0x5bf3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5bf3('0x2'));var BPromise=require(_0x5bf3('0x3'));var rp=require(_0x5bf3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bf3('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5bf3('0x6')]=function(_0x3788d2,_0x26249a){return _0x3788d2[_0x5bf3('0x7')](_0x5bf3('0x8'),attributes,{'tableName':_0x5bf3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 1ee26b1..7aaa3ce 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 _0xc794=['request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','then','debug','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x472072,_0x5add18){var _0x38ca35=function(_0x197592){while(--_0x197592){_0x472072['push'](_0x472072['shift']());}};_0x38ca35(++_0x5add18);}(_0xc794,0x141));var _0x4c79=function(_0x16963b,_0x5a7432){_0x16963b=_0x16963b-0x0;var _0x15cc6a=_0xc794[_0x16963b];return _0x15cc6a;};'use strict';var _=require('lodash');var util=require(_0x4c79('0x0'));var moment=require(_0x4c79('0x1'));var BPromise=require(_0x4c79('0x2'));var rs=require(_0x4c79('0x3'));var fs=require('fs');var Redis=require(_0x4c79('0x4'));var db=require(_0x4c79('0x5'))['db'];var utils=require(_0x4c79('0x6'));var logger=require(_0x4c79('0x7'))(_0x4c79('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c79('0x9'));var client=jayson[_0x4c79('0xa')][_0x4c79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24ace2,_0x5ccf1f,_0x177f8c){return new BPromise(function(_0x2f9547,_0x2747fb){return client[_0x4c79('0xc')](_0x24ace2,_0x177f8c)['then'](function(_0x2c7910){logger[_0x4c79('0xd')](_0x4c79('0xe'),_0x5ccf1f,_0x4c79('0xf'));logger['debug'](_0x4c79('0x10'),_0x5ccf1f,_0x4c79('0xf'),JSON[_0x4c79('0x11')](_0x2c7910));if(_0x2c7910['error']){if(_0x2c7910[_0x4c79('0x12')][_0x4c79('0x13')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x5ccf1f,_0x2c7910[_0x4c79('0x12')][_0x4c79('0x14')]);return _0x2747fb(_0x2c7910[_0x4c79('0x12')][_0x4c79('0x14')]);}logger[_0x4c79('0x12')](_0x4c79('0xe'),_0x5ccf1f,_0x2c7910['error'][_0x4c79('0x14')]);return _0x2f9547(_0x2c7910[_0x4c79('0x12')][_0x4c79('0x14')]);}else{logger[_0x4c79('0xd')](_0x4c79('0xe'),_0x5ccf1f,_0x4c79('0xf'));_0x2f9547(_0x2c7910['result'][_0x4c79('0x14')]);}})[_0x4c79('0x15')](function(_0x121370){logger['error'](_0x4c79('0xe'),_0x5ccf1f,_0x121370);_0x2747fb(_0x121370);});});}exports[_0x4c79('0x16')]=function(_0x12e9af){var _0x11c45b=this;return new Promise(function(_0x584754,_0x3e4548){return db[_0x4c79('0x17')][_0x4c79('0x18')]({'raw':_0x12e9af[_0x4c79('0x19')]?_0x12e9af['options']['raw']===undefined?!![]:![]:!![],'where':_0x12e9af[_0x4c79('0x19')]?_0x12e9af[_0x4c79('0x19')][_0x4c79('0x1a')]||null:null,'attributes':_0x12e9af[_0x4c79('0x19')]?_0x12e9af[_0x4c79('0x19')][_0x4c79('0x1b')]||null:null,'limit':_0x12e9af[_0x4c79('0x19')]?_0x12e9af[_0x4c79('0x19')][_0x4c79('0x1c')]||null:null,'include':_0x12e9af[_0x4c79('0x19')]?_0x12e9af[_0x4c79('0x19')][_0x4c79('0x1d')]?_[_0x4c79('0x1e')](_0x12e9af[_0x4c79('0x19')][_0x4c79('0x1d')],function(_0x1e25ce){return{'model':db[_0x1e25ce[_0x4c79('0x1f')]],'as':_0x1e25ce['as'],'attributes':_0x1e25ce[_0x4c79('0x1b')],'include':_0x1e25ce['include']?_['map'](_0x1e25ce[_0x4c79('0x1d')],function(_0xa0c16c){return{'model':db[_0xa0c16c[_0x4c79('0x1f')]],'as':_0xa0c16c['as'],'attributes':_0xa0c16c[_0x4c79('0x1b')],'include':_0xa0c16c[_0x4c79('0x1d')]?_['map'](_0xa0c16c[_0x4c79('0x1d')],function(_0x3cfc37){return{'model':db[_0x3cfc37['model']],'as':_0x3cfc37['as'],'attributes':_0x3cfc37[_0x4c79('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c79('0x20')](function(_0x45b0d8){logger[_0x4c79('0xd')]('GetZendeskAccount',_0x12e9af);logger[_0x4c79('0x21')](_0x4c79('0x16'),_0x12e9af,JSON[_0x4c79('0x11')](_0x45b0d8));_0x584754(_0x45b0d8);})[_0x4c79('0x15')](function(_0x3923a9){logger[_0x4c79('0x12')](_0x4c79('0x16'),_0x3923a9[_0x4c79('0x14')],_0x12e9af);_0x3e4548(_0x11c45b[_0x4c79('0x12')](0x1f4,_0x3923a9[_0x4c79('0x14')]));});});};exports[_0x4c79('0x22')]=function(_0xa1b0c5){var _0x5a7d7c=this;return new Promise(function(_0xf80c22,_0x186cba){return db[_0x4c79('0x17')][_0x4c79('0x23')]({'raw':_0xa1b0c5[_0x4c79('0x19')]?_0xa1b0c5['options'][_0x4c79('0x24')]===undefined?!![]:![]:!![],'where':_0xa1b0c5[_0x4c79('0x19')]?_0xa1b0c5[_0x4c79('0x19')][_0x4c79('0x1a')]||null:null,'attributes':_0xa1b0c5[_0x4c79('0x19')]?_0xa1b0c5[_0x4c79('0x19')]['attributes']||null:null,'include':_0xa1b0c5[_0x4c79('0x19')]?_0xa1b0c5['options'][_0x4c79('0x1d')]?_['map'](_0xa1b0c5[_0x4c79('0x19')][_0x4c79('0x1d')],function(_0x2f7e60){return{'model':db[_0x2f7e60['model']],'as':_0x2f7e60['as'],'attributes':_0x2f7e60[_0x4c79('0x1b')],'include':_0x2f7e60['include']?_[_0x4c79('0x1e')](_0x2f7e60[_0x4c79('0x1d')],function(_0x250aca){return{'model':db[_0x250aca['model']],'as':_0x250aca['as'],'attributes':_0x250aca[_0x4c79('0x1b')],'include':_0x250aca['include']?_[_0x4c79('0x1e')](_0x250aca[_0x4c79('0x1d')],function(_0x29e827){return{'model':db[_0x29e827[_0x4c79('0x1f')]],'as':_0x29e827['as'],'attributes':_0x29e827[_0x4c79('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4c79('0x20')](function(_0x3d3076){logger[_0x4c79('0xd')]('ShowZendeskAccount',_0xa1b0c5);logger[_0x4c79('0x21')](_0x4c79('0x22'),_0xa1b0c5,JSON[_0x4c79('0x11')](_0x3d3076));_0xf80c22(_0x3d3076);})[_0x4c79('0x15')](function(_0x32949c){logger[_0x4c79('0x12')](_0x4c79('0x22'),_0x32949c[_0x4c79('0x14')],_0xa1b0c5);_0x186cba(_0x5a7d7c[_0x4c79('0x12')](0x1f4,_0x32949c[_0x4c79('0x14')]));});});}; \ No newline at end of file +var _0x16e0=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','bluebird','randomstring'];(function(_0x22df3f,_0x6dd9c1){var _0x1ed10f=function(_0xd4b514){while(--_0xd4b514){_0x22df3f['push'](_0x22df3f['shift']());}};_0x1ed10f(++_0x6dd9c1);}(_0x16e0,0x124));var _0x016e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x016e('0x0'));var util=require(_0x016e('0x1'));var moment=require('moment');var BPromise=require(_0x016e('0x2'));var rs=require(_0x016e('0x3'));var fs=require('fs');var Redis=require(_0x016e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x016e('0x5'));var logger=require(_0x016e('0x6'))('rpc');var config=require(_0x016e('0x7'));var jayson=require(_0x016e('0x8'));var client=jayson[_0x016e('0x9')][_0x016e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ae05,_0x25701b,_0x38b5ae){return new BPromise(function(_0x48092c,_0xa8cf14){return client[_0x016e('0xb')](_0x57ae05,_0x38b5ae)[_0x016e('0xc')](function(_0x590603){logger['info'](_0x016e('0xd'),_0x25701b,_0x016e('0xe'));logger[_0x016e('0xf')](_0x016e('0x10'),_0x25701b,_0x016e('0xe'),JSON[_0x016e('0x11')](_0x590603));if(_0x590603[_0x016e('0x12')]){if(_0x590603['error'][_0x016e('0x13')]===0x1f4){logger[_0x016e('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x25701b,_0x590603[_0x016e('0x12')]['message']);return _0xa8cf14(_0x590603['error']['message']);}logger['error'](_0x016e('0xd'),_0x25701b,_0x590603[_0x016e('0x12')]['message']);return _0x48092c(_0x590603[_0x016e('0x12')][_0x016e('0x14')]);}else{logger[_0x016e('0x15')](_0x016e('0xd'),_0x25701b,_0x016e('0xe'));_0x48092c(_0x590603[_0x016e('0x16')][_0x016e('0x14')]);}})[_0x016e('0x17')](function(_0xab9a46){logger[_0x016e('0x12')](_0x016e('0xd'),_0x25701b,_0xab9a46);_0xa8cf14(_0xab9a46);});});}exports['GetZendeskAccount']=function(_0x406d3d){var _0x3108e9=this;return new Promise(function(_0x752c3a,_0x58f9c6){return db[_0x016e('0x18')][_0x016e('0x19')]({'raw':_0x406d3d[_0x016e('0x1a')]?_0x406d3d[_0x016e('0x1a')][_0x016e('0x1b')]===undefined?!![]:![]:!![],'where':_0x406d3d[_0x016e('0x1a')]?_0x406d3d[_0x016e('0x1a')][_0x016e('0x1c')]||null:null,'attributes':_0x406d3d['options']?_0x406d3d[_0x016e('0x1a')][_0x016e('0x1d')]||null:null,'limit':_0x406d3d['options']?_0x406d3d[_0x016e('0x1a')][_0x016e('0x1e')]||null:null,'include':_0x406d3d[_0x016e('0x1a')]?_0x406d3d[_0x016e('0x1a')]['include']?_[_0x016e('0x1f')](_0x406d3d[_0x016e('0x1a')][_0x016e('0x20')],function(_0x405219){return{'model':db[_0x405219[_0x016e('0x21')]],'as':_0x405219['as'],'attributes':_0x405219[_0x016e('0x1d')],'include':_0x405219[_0x016e('0x20')]?_[_0x016e('0x1f')](_0x405219[_0x016e('0x20')],function(_0x35c9a1){return{'model':db[_0x35c9a1[_0x016e('0x21')]],'as':_0x35c9a1['as'],'attributes':_0x35c9a1['attributes'],'include':_0x35c9a1[_0x016e('0x20')]?_[_0x016e('0x1f')](_0x35c9a1['include'],function(_0x4caff1){return{'model':db[_0x4caff1[_0x016e('0x21')]],'as':_0x4caff1['as'],'attributes':_0x4caff1[_0x016e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x016e('0xc')](function(_0x41f8e1){logger['info']('GetZendeskAccount',_0x406d3d);logger[_0x016e('0xf')]('GetZendeskAccount',_0x406d3d,JSON[_0x016e('0x11')](_0x41f8e1));_0x752c3a(_0x41f8e1);})[_0x016e('0x17')](function(_0x33de7c){logger[_0x016e('0x12')](_0x016e('0x22'),_0x33de7c[_0x016e('0x14')],_0x406d3d);_0x58f9c6(_0x3108e9[_0x016e('0x12')](0x1f4,_0x33de7c['message']));});});};exports[_0x016e('0x23')]=function(_0x2d116d){var _0x50150e=this;return new Promise(function(_0x399a4c,_0x303f88){return db['ZendeskAccount'][_0x016e('0x24')]({'raw':_0x2d116d['options']?_0x2d116d[_0x016e('0x1a')][_0x016e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d116d['options']?_0x2d116d['options'][_0x016e('0x1c')]||null:null,'attributes':_0x2d116d[_0x016e('0x1a')]?_0x2d116d['options'][_0x016e('0x1d')]||null:null,'include':_0x2d116d['options']?_0x2d116d['options'][_0x016e('0x20')]?_['map'](_0x2d116d[_0x016e('0x1a')][_0x016e('0x20')],function(_0x1edebe){return{'model':db[_0x1edebe[_0x016e('0x21')]],'as':_0x1edebe['as'],'attributes':_0x1edebe[_0x016e('0x1d')],'include':_0x1edebe[_0x016e('0x20')]?_['map'](_0x1edebe[_0x016e('0x20')],function(_0x506de2){return{'model':db[_0x506de2[_0x016e('0x21')]],'as':_0x506de2['as'],'attributes':_0x506de2['attributes'],'include':_0x506de2[_0x016e('0x20')]?_['map'](_0x506de2['include'],function(_0x57f0f6){return{'model':db[_0x57f0f6[_0x016e('0x21')]],'as':_0x57f0f6['as'],'attributes':_0x57f0f6[_0x016e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x016e('0xc')](function(_0x145cd6){logger[_0x016e('0x15')](_0x016e('0x23'),_0x2d116d);logger[_0x016e('0xf')](_0x016e('0x23'),_0x2d116d,JSON[_0x016e('0x11')](_0x145cd6));_0x399a4c(_0x145cd6);})[_0x016e('0x17')](function(_0x4bcba8){logger[_0x016e('0x12')](_0x016e('0x23'),_0x4bcba8[_0x016e('0x14')],_0x2d116d);_0x303f88(_0x50150e[_0x016e('0x12')](0x1f4,_0x4bcba8[_0x016e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c3af703..3b60b3b 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 _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4ca645,_0x11e071){var _0xe5e86e=function(_0x1c8abe){while(--_0x1c8abe){_0x4ca645['push'](_0x4ca645['shift']());}};_0xe5e86e(++_0x11e071);}(_0x5c00,0x17e));var _0x05c0=function(_0x95975e,_0x51412c){_0x95975e=_0x95975e-0x0;var _0x5d4933=_0x5c00[_0x95975e];return _0x5d4933;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router; \ No newline at end of file +var _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x45fc8d,_0x53e1f7){var _0x43a493=function(_0xadf408){while(--_0xadf408){_0x45fc8d['push'](_0x45fc8d['shift']());}};_0x43a493(++_0x53e1f7);}(_0x5c00,0x17e));var _0x05c0=function(_0xf3120,_0x80a54c){_0xf3120=_0xf3120-0x0;var _0x5aa549=_0x5c00[_0xf3120];return _0x5aa549;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 6b0cd39..2c132dc 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 _0x7ebc=['exports','STRING','sequelize'];(function(_0x563252,_0x34ddcf){var _0x3edc4e=function(_0x849aa0){while(--_0x849aa0){_0x563252['push'](_0x563252['shift']());}};_0x3edc4e(++_0x34ddcf);}(_0x7ebc,0x140));var _0xc7eb=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x7ebc[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0xc7eb('0x0'));module[_0xc7eb('0x1')]={'name':{'type':Sequelize[_0xc7eb('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0edf=['sequelize','exports','STRING'];(function(_0x43f27c,_0x672013){var _0x341182=function(_0x30d092){while(--_0x30d092){_0x43f27c['push'](_0x43f27c['shift']());}};_0x341182(++_0x672013);}(_0x0edf,0x123));var _0xf0ed=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x0edf[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0xf0ed('0x0'));module[_0xf0ed('0x1')]={'name':{'type':Sequelize[_0xf0ed('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 0c8f5a6..b296f52 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 _0x3fa4=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','findOne','getFields','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','request-promise','moment'];(function(_0x38c294,_0x580e77){var _0x3d5bdf=function(_0x38f330){while(--_0x38f330){_0x38c294['push'](_0x38c294['shift']());}};_0x3d5bdf(++_0x580e77);}(_0x3fa4,0xf0));var _0x43fa=function(_0x4ae837,_0x1a1ece){_0x4ae837=_0x4ae837-0x0;var _0x22b5da=_0x3fa4[_0x4ae837];return _0x22b5da;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['ZendeskConfiguration']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['ZendeskConfiguration'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['getFields']=function(_0x2ca431,_0x574076,_0x518317){var _0x2228e0={};var _0x393842={};var _0x4c48b5;var _0x43f94c;return db[_0x43fa('0x2b')][_0x43fa('0x47')]({'where':{'id':_0x2ca431[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x574076,null))[_0x43fa('0x24')](function(_0x172c23){if(_0x172c23){_0x4c48b5=_0x172c23;_0x393842[_0x43fa('0x30')]=_[_0x43fa('0x32')](db['ZendeskField']['rawAttributes']);_0x393842[_0x43fa('0x31')]=_['keys'](_0x2ca431['query']);_0x393842['filters']=_[_0x43fa('0x41')](_0x393842[_0x43fa('0x30')],_0x393842[_0x43fa('0x31')]);_0x2228e0[_0x43fa('0x34')]=_[_0x43fa('0x41')](_0x393842[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x2ca431['query'][_0x43fa('0x35')]));_0x2228e0[_0x43fa('0x34')]=_0x2228e0['attributes'][_0x43fa('0x42')]?_0x2228e0['attributes']:_0x393842[_0x43fa('0x30')];_0x2228e0[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x2ca431[_0x43fa('0x31')]['sort']);_0x2228e0['where']=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x2ca431[_0x43fa('0x31')],_0x393842[_0x43fa('0x33')]));if(_0x2ca431['query']['filter']){_0x2228e0[_0x43fa('0x39')]=_['merge'](_0x2228e0[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x2228e0[_0x43fa('0x34')],function(_0x33e439){var _0x50a1e9={};_0x50a1e9[_0x33e439]={'$like':'%'+_0x2ca431['query'][_0x43fa('0x3b')]+'%'};return _0x50a1e9;})});}_0x2228e0=_['merge']({},_0x2228e0,_0x2ca431[_0x43fa('0x3d')]);return _0x4c48b5[_0x43fa('0x48')](_0x2228e0);}})[_0x43fa('0x24')](function(_0x379a9b){if(_0x379a9b){_0x43f94c=_0x379a9b[_0x43fa('0x42')];if(!_0x2ca431[_0x43fa('0x31')][_0x43fa('0x49')]('nolimit')){_0x2228e0[_0x43fa('0x1d')]=qs[_0x43fa('0x1d')](_0x2ca431[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x2228e0[_0x43fa('0x1b')]=qs['offset'](_0x2ca431[_0x43fa('0x31')][_0x43fa('0x1b')]);}return _0x4c48b5[_0x43fa('0x48')](_0x2228e0);}})[_0x43fa('0x24')](function(_0x78f0a9){if(_0x78f0a9){return _0x78f0a9?{'count':_0x43f94c,'rows':_0x78f0a9}:null;}})[_0x43fa('0x24')](respondWithResult(_0x574076,null))[_0x43fa('0x40')](handleError(_0x574076,null));};exports[_0x43fa('0x4a')]=function(_0xd06168,_0x5ac94a,_0x1395f4){var _0x25eb08={};var _0x2d8a01={};var _0x170dac;var _0x31fdeb;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0xd06168[_0x43fa('0x46')]['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x5ac94a,null))[_0x43fa('0x24')](function(_0x1adb75){if(_0x1adb75){_0x170dac=_0x1adb75;_0x2d8a01[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x4b')][_0x43fa('0x2c')]);_0x2d8a01[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0xd06168[_0x43fa('0x31')]);_0x2d8a01[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x2d8a01[_0x43fa('0x30')],_0x2d8a01[_0x43fa('0x31')]);_0x25eb08[_0x43fa('0x34')]=_[_0x43fa('0x41')](_0x2d8a01[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0xd06168[_0x43fa('0x31')][_0x43fa('0x35')]));_0x25eb08[_0x43fa('0x34')]=_0x25eb08['attributes']['length']?_0x25eb08[_0x43fa('0x34')]:_0x2d8a01[_0x43fa('0x30')];_0x25eb08['order']=qs[_0x43fa('0x38')](_0xd06168['query'][_0x43fa('0x38')]);_0x25eb08['where']=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0xd06168[_0x43fa('0x31')],_0x2d8a01[_0x43fa('0x33')]));if(_0xd06168[_0x43fa('0x31')]['filter']){_0x25eb08[_0x43fa('0x39')]=_['merge'](_0x25eb08[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x25eb08[_0x43fa('0x34')],function(_0x1619ae){var _0x195c8b={};_0x195c8b[_0x1619ae]={'$like':'%'+_0xd06168['query'][_0x43fa('0x3b')]+'%'};return _0x195c8b;})});}_0x25eb08=_[_0x43fa('0x3c')]({},_0x25eb08,_0xd06168['options']);return _0x170dac[_0x43fa('0x4a')](_0x25eb08);}})['then'](function(_0x258e00){if(_0x258e00){_0x31fdeb=_0x258e00[_0x43fa('0x42')];if(!_0xd06168['query'][_0x43fa('0x49')](_0x43fa('0x36'))){_0x25eb08[_0x43fa('0x1d')]=qs['limit'](_0xd06168['query'][_0x43fa('0x1d')]);_0x25eb08[_0x43fa('0x1b')]=qs[_0x43fa('0x1b')](_0xd06168[_0x43fa('0x31')]['offset']);}return _0x170dac[_0x43fa('0x4a')](_0x25eb08);}})['then'](function(_0x5b4308){if(_0x5b4308){return _0x5b4308?{'count':_0x31fdeb,'rows':_0x5b4308}:null;}})[_0x43fa('0x24')](respondWithResult(_0x5ac94a,null))[_0x43fa('0x40')](handleError(_0x5ac94a,null));};exports[_0x43fa('0x4c')]=function(_0x29e704,_0x2d7f8b,_0x13adec){var _0x4842b1={};var _0x3eca2f={};var _0x19d1bd;var _0x117181;return db['ZendeskConfiguration'][_0x43fa('0x47')]({'where':{'id':_0x29e704[_0x43fa('0x46')]['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x2d7f8b,null))['then'](function(_0x2e0331){if(_0x2e0331){_0x19d1bd=_0x2e0331;_0x3eca2f[_0x43fa('0x30')]=_['keys'](db['ZendeskField'][_0x43fa('0x2c')]);_0x3eca2f[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x29e704[_0x43fa('0x31')]);_0x3eca2f[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x3eca2f[_0x43fa('0x30')],_0x3eca2f[_0x43fa('0x31')]);_0x4842b1[_0x43fa('0x34')]=_[_0x43fa('0x41')](_0x3eca2f[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x29e704[_0x43fa('0x31')][_0x43fa('0x35')]));_0x4842b1[_0x43fa('0x34')]=_0x4842b1[_0x43fa('0x34')]['length']?_0x4842b1[_0x43fa('0x34')]:_0x3eca2f[_0x43fa('0x30')];_0x4842b1[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x29e704['query'][_0x43fa('0x38')]);_0x4842b1['where']=qs['filters'](_['pick'](_0x29e704[_0x43fa('0x31')],_0x3eca2f['filters']));if(_0x29e704[_0x43fa('0x31')][_0x43fa('0x3b')]){_0x4842b1[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x4842b1[_0x43fa('0x39')],{'$or':_['map'](_0x4842b1[_0x43fa('0x34')],function(_0x1d28b5){var _0x44b968={};_0x44b968[_0x1d28b5]={'$like':'%'+_0x29e704[_0x43fa('0x31')]['filter']+'%'};return _0x44b968;})});}_0x4842b1=_['merge']({},_0x4842b1,_0x29e704['options']);return _0x19d1bd['getDescriptions'](_0x4842b1);}})[_0x43fa('0x24')](function(_0x830a70){if(_0x830a70){_0x117181=_0x830a70[_0x43fa('0x42')];if(!_0x29e704['query'][_0x43fa('0x49')](_0x43fa('0x36'))){_0x4842b1[_0x43fa('0x1d')]=qs[_0x43fa('0x1d')](_0x29e704['query'][_0x43fa('0x1d')]);_0x4842b1[_0x43fa('0x1b')]=qs[_0x43fa('0x1b')](_0x29e704[_0x43fa('0x31')][_0x43fa('0x1b')]);}return _0x19d1bd[_0x43fa('0x4c')](_0x4842b1);}})[_0x43fa('0x24')](function(_0x4f04ef){if(_0x4f04ef){return _0x4f04ef?{'count':_0x117181,'rows':_0x4f04ef}:null;}})['then'](respondWithResult(_0x2d7f8b,null))['catch'](handleError(_0x2d7f8b,null));};exports[_0x43fa('0x4d')]=function(_0xe218b0,_0x3c141e,_0x500a1b){var _0x3ff0ce={};var _0x3f4839={};var _0x268cb2;var _0x563487;return db[_0x43fa('0x2b')][_0x43fa('0x47')]({'where':{'id':_0xe218b0[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c141e,null))[_0x43fa('0x24')](function(_0x457006){if(_0x457006){_0x268cb2=_0x457006;_0x3f4839[_0x43fa('0x30')]=_['keys'](db[_0x43fa('0x4e')][_0x43fa('0x2c')]);_0x3f4839['query']=_[_0x43fa('0x32')](_0xe218b0[_0x43fa('0x31')]);_0x3f4839[_0x43fa('0x33')]=_['intersection'](_0x3f4839[_0x43fa('0x30')],_0x3f4839[_0x43fa('0x31')]);_0x3ff0ce[_0x43fa('0x34')]=_[_0x43fa('0x41')](_0x3f4839[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0xe218b0['query'][_0x43fa('0x35')]));_0x3ff0ce[_0x43fa('0x34')]=_0x3ff0ce[_0x43fa('0x34')][_0x43fa('0x42')]?_0x3ff0ce[_0x43fa('0x34')]:_0x3f4839[_0x43fa('0x30')];_0x3ff0ce[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0xe218b0['query']['sort']);_0x3ff0ce[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0xe218b0[_0x43fa('0x31')],_0x3f4839['filters']));if(_0xe218b0[_0x43fa('0x31')][_0x43fa('0x3b')]){_0x3ff0ce['where']=_[_0x43fa('0x3c')](_0x3ff0ce[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x3ff0ce[_0x43fa('0x34')],function(_0x187b74){var _0x562405={};_0x562405[_0x187b74]={'$like':'%'+_0xe218b0[_0x43fa('0x31')][_0x43fa('0x3b')]+'%'};return _0x562405;})});}_0x3ff0ce=_[_0x43fa('0x3c')]({},_0x3ff0ce,_0xe218b0[_0x43fa('0x3d')]);return _0x268cb2[_0x43fa('0x4d')](_0x3ff0ce);}})[_0x43fa('0x24')](function(_0x303923){if(_0x303923){_0x563487=_0x303923[_0x43fa('0x42')];if(!_0xe218b0[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3ff0ce[_0x43fa('0x1d')]=qs[_0x43fa('0x1d')](_0xe218b0[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3ff0ce[_0x43fa('0x1b')]=qs[_0x43fa('0x1b')](_0xe218b0['query'][_0x43fa('0x1b')]);}return _0x268cb2['getTags'](_0x3ff0ce);}})[_0x43fa('0x24')](function(_0xf08895){if(_0xf08895){return _0xf08895?{'count':_0x563487,'rows':_0xf08895}:null;}})['then'](respondWithResult(_0x3c141e,null))['catch'](handleError(_0x3c141e,null));};exports[_0x43fa('0x4f')]=function(_0x12a889,_0x30a504,_0x262aee){if(_0x12a889[_0x43fa('0x45')]['id']){delete _0x12a889[_0x43fa('0x45')]['id'];}return db[_0x43fa('0x2b')][_0x43fa('0x47')]({'where':{'id':_0x12a889['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x30a504,null))[_0x43fa('0x24')](function(_0x17024c){if(_0x17024c){return _0x17024c[_0x43fa('0x4f')](_0x12a889[_0x43fa('0x45')][_0x43fa('0x50')]||[]);}return null;})['then'](respondWithResult(_0x30a504,null))['catch'](handleError(_0x30a504,null));}; \ No newline at end of file +var _0xea0d=['model','includeAll','find','create','body','catch','destroy','getFields','findOne','ZendeskField','length','sort','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','Content-Range','reject','save','then','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','include','findAll','show','params'];(function(_0x5bb248,_0x69a63a){var _0x568c03=function(_0x19acab){while(--_0x19acab){_0x5bb248['push'](_0x5bb248['shift']());}};_0x568c03(++_0x69a63a);}(_0xea0d,0x1a6));var _0xdea0=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0xea0d[_0x36de10];return _0x58100f;};'use strict';var emlformat=require(_0xdea0('0x0'));var rimraf=require(_0xdea0('0x1'));var zipdir=require(_0xdea0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdea0('0x3'));var moment=require(_0xdea0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdea0('0x5'));var sox=require(_0xdea0('0x6'));var csv=require(_0xdea0('0x7'));var ejs=require(_0xdea0('0x8'));var fs=require('fs');var fs_extra=require(_0xdea0('0x9'));var _=require(_0xdea0('0xa'));var squel=require(_0xdea0('0xb'));var crypto=require(_0xdea0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdea0('0xd'));var toCsv=require(_0xdea0('0x7'));var querystring=require('querystring');var Papa=require(_0xdea0('0xe'));var Redis=require(_0xdea0('0xf'));var authService=require(_0xdea0('0x10'));var qs=require(_0xdea0('0x11'));var as=require(_0xdea0('0x12'));var hardwareService=require(_0xdea0('0x13'));var logger=require(_0xdea0('0x14'))('api');var utils=require(_0xdea0('0x15'));var config=require(_0xdea0('0x16'));var licenseUtil=require(_0xdea0('0x17'));var db=require(_0xdea0('0x18'))['db'];function respondWithStatusCode(_0x55ec7f,_0x11fa36){_0x11fa36=_0x11fa36||0xcc;return function(_0x321244){if(_0x321244){return _0x55ec7f['sendStatus'](_0x11fa36);}return _0x55ec7f[_0xdea0('0x19')](_0x11fa36)['end']();};}function respondWithResult(_0x306bec,_0x29ce5a){_0x29ce5a=_0x29ce5a||0xc8;return function(_0x30c29c){if(_0x30c29c){return _0x306bec[_0xdea0('0x19')](_0x29ce5a)[_0xdea0('0x1a')](_0x30c29c);}};}function respondWithFilteredResult(_0x52d90f,_0x451b09){return function(_0x199bd0){if(_0x199bd0){var _0x3fe779=typeof _0x451b09[_0xdea0('0x1b')]==='undefined'&&typeof _0x451b09[_0xdea0('0x1c')]==='undefined';var _0x3e3c78=_0x199bd0[_0xdea0('0x1d')];var _0x515fc4=_0x3fe779?0x0:_0x451b09['offset'];var _0x269c15=_0x3fe779?_0x199bd0[_0xdea0('0x1d')]:_0x451b09[_0xdea0('0x1b')]+_0x451b09['limit'];var _0x1313b8;if(_0x269c15>=_0x3e3c78){_0x269c15=_0x3e3c78;_0x1313b8=0xc8;}else{_0x1313b8=0xce;}_0x52d90f[_0xdea0('0x19')](_0x1313b8);return _0x52d90f['set'](_0xdea0('0x1e'),_0x515fc4+'-'+_0x269c15+'/'+_0x3e3c78)[_0xdea0('0x1a')](_0x199bd0);}return null;};}function patchUpdates(_0x2e90b5){return function(_0x5c33c2){try{jsonpatch['apply'](_0x5c33c2,_0x2e90b5,!![]);}catch(_0x30995d){return BPromise[_0xdea0('0x1f')](_0x30995d);}return _0x5c33c2[_0xdea0('0x20')]();};}function saveUpdates(_0x41a03d,_0x25a531){return function(_0xa69fd4){if(_0xa69fd4){return _0xa69fd4['update'](_0x41a03d)[_0xdea0('0x21')](function(_0x3f56da){return _0x3f56da;});}return null;};}function removeEntity(_0x47397b,_0x154803){return function(_0x7aa49b){if(_0x7aa49b){return _0x7aa49b['destroy']()['then'](function(){_0x47397b[_0xdea0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d29c,_0x460c9d){return function(_0x34b5f0){if(!_0x34b5f0){_0x43d29c[_0xdea0('0x22')](0x194);}return _0x34b5f0;};}function handleError(_0x15a829,_0x127d14){_0x127d14=_0x127d14||0x1f4;return function(_0x1b28fd){logger[_0xdea0('0x23')](_0x1b28fd[_0xdea0('0x24')]);if(_0x1b28fd[_0xdea0('0x25')]){delete _0x1b28fd[_0xdea0('0x25')];}_0x15a829[_0xdea0('0x19')](_0x127d14)[_0xdea0('0x26')](_0x1b28fd);};}exports[_0xdea0('0x27')]=function(_0x480078,_0x269962){var _0x31cbd8={},_0x266775={},_0x3538cf={'count':0x0,'rows':[]};var _0x243a26=_[_0xdea0('0x28')](db[_0xdea0('0x29')][_0xdea0('0x2a')],function(_0x4e3be2){return{'name':_0x4e3be2[_0xdea0('0x2b')],'type':_0x4e3be2[_0xdea0('0x2c')][_0xdea0('0x2d')]};});_0x266775['model']=_['map'](_0x243a26,_0xdea0('0x25'));_0x266775['query']=_[_0xdea0('0x2e')](_0x480078[_0xdea0('0x2f')]);_0x266775[_0xdea0('0x30')]=_['intersection'](_0x266775['model'],_0x266775[_0xdea0('0x2f')]);_0x31cbd8[_0xdea0('0x31')]=_[_0xdea0('0x32')](_0x266775['model'],qs[_0xdea0('0x33')](_0x480078[_0xdea0('0x2f')]['fields']));_0x31cbd8[_0xdea0('0x31')]=_0x31cbd8[_0xdea0('0x31')]['length']?_0x31cbd8['attributes']:_0x266775['model'];if(!_0x480078[_0xdea0('0x2f')][_0xdea0('0x34')](_0xdea0('0x35'))){_0x31cbd8['limit']=qs[_0xdea0('0x1c')](_0x480078['query']['limit']);_0x31cbd8[_0xdea0('0x1b')]=qs['offset'](_0x480078[_0xdea0('0x2f')]['offset']);}_0x31cbd8[_0xdea0('0x36')]=qs['sort'](_0x480078[_0xdea0('0x2f')]['sort']);_0x31cbd8['where']=qs['filters'](_[_0xdea0('0x37')](_0x480078[_0xdea0('0x2f')],_0x266775[_0xdea0('0x30')]),_0x243a26);if(_0x480078[_0xdea0('0x2f')][_0xdea0('0x38')]){_0x31cbd8[_0xdea0('0x39')]=_[_0xdea0('0x3a')](_0x31cbd8[_0xdea0('0x39')],{'$or':_[_0xdea0('0x28')](_0x243a26,function(_0x3e59fe){if(_0x3e59fe[_0xdea0('0x2c')]!=='VIRTUAL'){var _0x5c4134={};_0x5c4134[_0x3e59fe['name']]={'$like':'%'+_0x480078[_0xdea0('0x2f')][_0xdea0('0x38')]+'%'};return _0x5c4134;}})});}_0x31cbd8=_[_0xdea0('0x3a')]({},_0x31cbd8,_0x480078[_0xdea0('0x3b')]);var _0x1f20a4={'where':_0x31cbd8[_0xdea0('0x39')]};return db['ZendeskConfiguration']['count'](_0x1f20a4)[_0xdea0('0x21')](function(_0x5b3999){_0x3538cf[_0xdea0('0x1d')]=_0x5b3999;if(_0x480078[_0xdea0('0x2f')]['includeAll']){_0x31cbd8[_0xdea0('0x3c')]=[{'all':!![]}];}return db[_0xdea0('0x29')][_0xdea0('0x3d')](_0x31cbd8);})[_0xdea0('0x21')](function(_0xc27e4){_0x3538cf['rows']=_0xc27e4;return _0x3538cf;})[_0xdea0('0x21')](respondWithFilteredResult(_0x269962,_0x31cbd8))['catch'](handleError(_0x269962,null));};exports[_0xdea0('0x3e')]=function(_0x50d487,_0x24ab42){var _0x11777a={'raw':![],'where':{'id':_0x50d487[_0xdea0('0x3f')]['id']}},_0x4952b0={};_0x4952b0['model']=_[_0xdea0('0x2e')](db[_0xdea0('0x29')]['rawAttributes']);_0x4952b0[_0xdea0('0x2f')]=_[_0xdea0('0x2e')](_0x50d487[_0xdea0('0x2f')]);_0x4952b0[_0xdea0('0x30')]=_[_0xdea0('0x32')](_0x4952b0[_0xdea0('0x40')],_0x4952b0[_0xdea0('0x2f')]);_0x11777a[_0xdea0('0x31')]=_[_0xdea0('0x32')](_0x4952b0['model'],qs[_0xdea0('0x33')](_0x50d487[_0xdea0('0x2f')][_0xdea0('0x33')]));_0x11777a[_0xdea0('0x31')]=_0x11777a[_0xdea0('0x31')]['length']?_0x11777a[_0xdea0('0x31')]:_0x4952b0['model'];if(_0x50d487[_0xdea0('0x2f')][_0xdea0('0x41')]){_0x11777a[_0xdea0('0x3c')]=[{'all':!![]}];}_0x11777a=_['merge']({},_0x11777a,_0x50d487[_0xdea0('0x3b')]);return db['ZendeskConfiguration'][_0xdea0('0x42')](_0x11777a)[_0xdea0('0x21')](handleEntityNotFound(_0x24ab42,null))[_0xdea0('0x21')](respondWithResult(_0x24ab42,null))['catch'](handleError(_0x24ab42,null));};exports[_0xdea0('0x43')]=function(_0x4ee249,_0x97b1b0){return db[_0xdea0('0x29')][_0xdea0('0x43')](_0x4ee249[_0xdea0('0x44')],{})[_0xdea0('0x21')](respondWithResult(_0x97b1b0,0xc9))[_0xdea0('0x45')](handleError(_0x97b1b0,null));};exports['update']=function(_0x1b3ada,_0x5a0e13){if(_0x1b3ada[_0xdea0('0x44')]['id']){delete _0x1b3ada[_0xdea0('0x44')]['id'];}return db['ZendeskConfiguration'][_0xdea0('0x42')]({'where':{'id':_0x1b3ada[_0xdea0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5a0e13,null))[_0xdea0('0x21')](saveUpdates(_0x1b3ada[_0xdea0('0x44')],null))[_0xdea0('0x21')](respondWithResult(_0x5a0e13,null))[_0xdea0('0x45')](handleError(_0x5a0e13,null));};exports[_0xdea0('0x46')]=function(_0x37ca67,_0x333312){return db[_0xdea0('0x29')][_0xdea0('0x42')]({'where':{'id':_0x37ca67['params']['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0x333312,null))['then'](removeEntity(_0x333312,null))['catch'](handleError(_0x333312,null));};exports[_0xdea0('0x47')]=function(_0x4c5ee8,_0x8ce55e,_0xf8e7e4){var _0x285f1f={};var _0x318dab={};var _0x27454f;var _0x3fb263;return db[_0xdea0('0x29')][_0xdea0('0x48')]({'where':{'id':_0x4c5ee8[_0xdea0('0x3f')]['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0x8ce55e,null))[_0xdea0('0x21')](function(_0x3aab21){if(_0x3aab21){_0x27454f=_0x3aab21;_0x318dab[_0xdea0('0x40')]=_[_0xdea0('0x2e')](db[_0xdea0('0x49')][_0xdea0('0x2a')]);_0x318dab[_0xdea0('0x2f')]=_[_0xdea0('0x2e')](_0x4c5ee8[_0xdea0('0x2f')]);_0x318dab[_0xdea0('0x30')]=_[_0xdea0('0x32')](_0x318dab[_0xdea0('0x40')],_0x318dab[_0xdea0('0x2f')]);_0x285f1f['attributes']=_[_0xdea0('0x32')](_0x318dab[_0xdea0('0x40')],qs[_0xdea0('0x33')](_0x4c5ee8[_0xdea0('0x2f')]['fields']));_0x285f1f[_0xdea0('0x31')]=_0x285f1f['attributes'][_0xdea0('0x4a')]?_0x285f1f[_0xdea0('0x31')]:_0x318dab[_0xdea0('0x40')];_0x285f1f[_0xdea0('0x36')]=qs[_0xdea0('0x4b')](_0x4c5ee8[_0xdea0('0x2f')][_0xdea0('0x4b')]);_0x285f1f[_0xdea0('0x39')]=qs[_0xdea0('0x30')](_['pick'](_0x4c5ee8[_0xdea0('0x2f')],_0x318dab['filters']));if(_0x4c5ee8[_0xdea0('0x2f')][_0xdea0('0x38')]){_0x285f1f[_0xdea0('0x39')]=_['merge'](_0x285f1f[_0xdea0('0x39')],{'$or':_[_0xdea0('0x28')](_0x285f1f['attributes'],function(_0x42559a){var _0x2331f4={};_0x2331f4[_0x42559a]={'$like':'%'+_0x4c5ee8[_0xdea0('0x2f')][_0xdea0('0x38')]+'%'};return _0x2331f4;})});}_0x285f1f=_[_0xdea0('0x3a')]({},_0x285f1f,_0x4c5ee8['options']);return _0x27454f[_0xdea0('0x47')](_0x285f1f);}})[_0xdea0('0x21')](function(_0x2e0c76){if(_0x2e0c76){_0x3fb263=_0x2e0c76[_0xdea0('0x4a')];if(!_0x4c5ee8[_0xdea0('0x2f')][_0xdea0('0x34')](_0xdea0('0x35'))){_0x285f1f[_0xdea0('0x1c')]=qs[_0xdea0('0x1c')](_0x4c5ee8[_0xdea0('0x2f')][_0xdea0('0x1c')]);_0x285f1f[_0xdea0('0x1b')]=qs[_0xdea0('0x1b')](_0x4c5ee8['query'][_0xdea0('0x1b')]);}return _0x27454f[_0xdea0('0x47')](_0x285f1f);}})[_0xdea0('0x21')](function(_0x3d5fcb){if(_0x3d5fcb){return _0x3d5fcb?{'count':_0x3fb263,'rows':_0x3d5fcb}:null;}})['then'](respondWithResult(_0x8ce55e,null))[_0xdea0('0x45')](handleError(_0x8ce55e,null));};exports['getSubjects']=function(_0x30639d,_0x498d78,_0x5eaf65){var _0x44c421={};var _0x1b058a={};var _0x3a449b;var _0x15d8c1;return db['ZendeskConfiguration'][_0xdea0('0x48')]({'where':{'id':_0x30639d[_0xdea0('0x3f')]['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0x498d78,null))[_0xdea0('0x21')](function(_0xcc59d6){if(_0xcc59d6){_0x3a449b=_0xcc59d6;_0x1b058a[_0xdea0('0x40')]=_[_0xdea0('0x2e')](db[_0xdea0('0x49')][_0xdea0('0x2a')]);_0x1b058a['query']=_[_0xdea0('0x2e')](_0x30639d[_0xdea0('0x2f')]);_0x1b058a[_0xdea0('0x30')]=_[_0xdea0('0x32')](_0x1b058a[_0xdea0('0x40')],_0x1b058a[_0xdea0('0x2f')]);_0x44c421[_0xdea0('0x31')]=_['intersection'](_0x1b058a['model'],qs[_0xdea0('0x33')](_0x30639d[_0xdea0('0x2f')][_0xdea0('0x33')]));_0x44c421['attributes']=_0x44c421[_0xdea0('0x31')]['length']?_0x44c421['attributes']:_0x1b058a['model'];_0x44c421[_0xdea0('0x36')]=qs[_0xdea0('0x4b')](_0x30639d['query'][_0xdea0('0x4b')]);_0x44c421[_0xdea0('0x39')]=qs['filters'](_['pick'](_0x30639d[_0xdea0('0x2f')],_0x1b058a[_0xdea0('0x30')]));if(_0x30639d[_0xdea0('0x2f')][_0xdea0('0x38')]){_0x44c421['where']=_[_0xdea0('0x3a')](_0x44c421[_0xdea0('0x39')],{'$or':_[_0xdea0('0x28')](_0x44c421['attributes'],function(_0x5694a4){var _0x11973d={};_0x11973d[_0x5694a4]={'$like':'%'+_0x30639d[_0xdea0('0x2f')][_0xdea0('0x38')]+'%'};return _0x11973d;})});}_0x44c421=_[_0xdea0('0x3a')]({},_0x44c421,_0x30639d[_0xdea0('0x3b')]);return _0x3a449b['getSubjects'](_0x44c421);}})[_0xdea0('0x21')](function(_0x545896){if(_0x545896){_0x15d8c1=_0x545896[_0xdea0('0x4a')];if(!_0x30639d[_0xdea0('0x2f')][_0xdea0('0x34')](_0xdea0('0x35'))){_0x44c421['limit']=qs[_0xdea0('0x1c')](_0x30639d[_0xdea0('0x2f')][_0xdea0('0x1c')]);_0x44c421[_0xdea0('0x1b')]=qs[_0xdea0('0x1b')](_0x30639d['query'][_0xdea0('0x1b')]);}return _0x3a449b[_0xdea0('0x4c')](_0x44c421);}})[_0xdea0('0x21')](function(_0x16e60b){if(_0x16e60b){return _0x16e60b?{'count':_0x15d8c1,'rows':_0x16e60b}:null;}})['then'](respondWithResult(_0x498d78,null))[_0xdea0('0x45')](handleError(_0x498d78,null));};exports[_0xdea0('0x4d')]=function(_0x2fda49,_0xa30f30,_0x390390){var _0x139b83={};var _0x56fe59={};var _0x55731f;var _0x496c39;return db[_0xdea0('0x29')]['findOne']({'where':{'id':_0x2fda49[_0xdea0('0x3f')]['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0xa30f30,null))[_0xdea0('0x21')](function(_0x34215b){if(_0x34215b){_0x55731f=_0x34215b;_0x56fe59[_0xdea0('0x40')]=_[_0xdea0('0x2e')](db[_0xdea0('0x49')][_0xdea0('0x2a')]);_0x56fe59[_0xdea0('0x2f')]=_['keys'](_0x2fda49[_0xdea0('0x2f')]);_0x56fe59[_0xdea0('0x30')]=_[_0xdea0('0x32')](_0x56fe59['model'],_0x56fe59[_0xdea0('0x2f')]);_0x139b83[_0xdea0('0x31')]=_['intersection'](_0x56fe59['model'],qs[_0xdea0('0x33')](_0x2fda49[_0xdea0('0x2f')][_0xdea0('0x33')]));_0x139b83[_0xdea0('0x31')]=_0x139b83[_0xdea0('0x31')][_0xdea0('0x4a')]?_0x139b83[_0xdea0('0x31')]:_0x56fe59[_0xdea0('0x40')];_0x139b83[_0xdea0('0x36')]=qs[_0xdea0('0x4b')](_0x2fda49[_0xdea0('0x2f')][_0xdea0('0x4b')]);_0x139b83[_0xdea0('0x39')]=qs[_0xdea0('0x30')](_[_0xdea0('0x37')](_0x2fda49[_0xdea0('0x2f')],_0x56fe59[_0xdea0('0x30')]));if(_0x2fda49[_0xdea0('0x2f')]['filter']){_0x139b83[_0xdea0('0x39')]=_[_0xdea0('0x3a')](_0x139b83['where'],{'$or':_[_0xdea0('0x28')](_0x139b83[_0xdea0('0x31')],function(_0x20a2b6){var _0x635b77={};_0x635b77[_0x20a2b6]={'$like':'%'+_0x2fda49['query'][_0xdea0('0x38')]+'%'};return _0x635b77;})});}_0x139b83=_[_0xdea0('0x3a')]({},_0x139b83,_0x2fda49[_0xdea0('0x3b')]);return _0x55731f['getDescriptions'](_0x139b83);}})[_0xdea0('0x21')](function(_0x4d3c80){if(_0x4d3c80){_0x496c39=_0x4d3c80[_0xdea0('0x4a')];if(!_0x2fda49[_0xdea0('0x2f')][_0xdea0('0x34')](_0xdea0('0x35'))){_0x139b83[_0xdea0('0x1c')]=qs[_0xdea0('0x1c')](_0x2fda49[_0xdea0('0x2f')][_0xdea0('0x1c')]);_0x139b83[_0xdea0('0x1b')]=qs['offset'](_0x2fda49['query'][_0xdea0('0x1b')]);}return _0x55731f[_0xdea0('0x4d')](_0x139b83);}})[_0xdea0('0x21')](function(_0x202bdc){if(_0x202bdc){return _0x202bdc?{'count':_0x496c39,'rows':_0x202bdc}:null;}})[_0xdea0('0x21')](respondWithResult(_0xa30f30,null))['catch'](handleError(_0xa30f30,null));};exports[_0xdea0('0x4e')]=function(_0x4e22e0,_0x4c96f5,_0x20a587){var _0x64e0a8={};var _0x105d65={};var _0xdd8db9;var _0x493fd3;return db[_0xdea0('0x29')][_0xdea0('0x48')]({'where':{'id':_0x4e22e0[_0xdea0('0x3f')]['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0x4c96f5,null))[_0xdea0('0x21')](function(_0x2c80c6){if(_0x2c80c6){_0xdd8db9=_0x2c80c6;_0x105d65['model']=_[_0xdea0('0x2e')](db[_0xdea0('0x4f')][_0xdea0('0x2a')]);_0x105d65[_0xdea0('0x2f')]=_[_0xdea0('0x2e')](_0x4e22e0[_0xdea0('0x2f')]);_0x105d65['filters']=_[_0xdea0('0x32')](_0x105d65[_0xdea0('0x40')],_0x105d65[_0xdea0('0x2f')]);_0x64e0a8['attributes']=_[_0xdea0('0x32')](_0x105d65['model'],qs['fields'](_0x4e22e0[_0xdea0('0x2f')][_0xdea0('0x33')]));_0x64e0a8[_0xdea0('0x31')]=_0x64e0a8[_0xdea0('0x31')][_0xdea0('0x4a')]?_0x64e0a8['attributes']:_0x105d65['model'];_0x64e0a8['order']=qs[_0xdea0('0x4b')](_0x4e22e0['query']['sort']);_0x64e0a8[_0xdea0('0x39')]=qs[_0xdea0('0x30')](_[_0xdea0('0x37')](_0x4e22e0[_0xdea0('0x2f')],_0x105d65[_0xdea0('0x30')]));if(_0x4e22e0[_0xdea0('0x2f')][_0xdea0('0x38')]){_0x64e0a8[_0xdea0('0x39')]=_[_0xdea0('0x3a')](_0x64e0a8['where'],{'$or':_[_0xdea0('0x28')](_0x64e0a8[_0xdea0('0x31')],function(_0x594a48){var _0x52210d={};_0x52210d[_0x594a48]={'$like':'%'+_0x4e22e0['query'][_0xdea0('0x38')]+'%'};return _0x52210d;})});}_0x64e0a8=_[_0xdea0('0x3a')]({},_0x64e0a8,_0x4e22e0[_0xdea0('0x3b')]);return _0xdd8db9[_0xdea0('0x4e')](_0x64e0a8);}})[_0xdea0('0x21')](function(_0x488692){if(_0x488692){_0x493fd3=_0x488692['length'];if(!_0x4e22e0[_0xdea0('0x2f')][_0xdea0('0x34')](_0xdea0('0x35'))){_0x64e0a8[_0xdea0('0x1c')]=qs[_0xdea0('0x1c')](_0x4e22e0[_0xdea0('0x2f')][_0xdea0('0x1c')]);_0x64e0a8[_0xdea0('0x1b')]=qs[_0xdea0('0x1b')](_0x4e22e0['query'][_0xdea0('0x1b')]);}return _0xdd8db9['getTags'](_0x64e0a8);}})[_0xdea0('0x21')](function(_0x29cec6){if(_0x29cec6){return _0x29cec6?{'count':_0x493fd3,'rows':_0x29cec6}:null;}})['then'](respondWithResult(_0x4c96f5,null))[_0xdea0('0x45')](handleError(_0x4c96f5,null));};exports[_0xdea0('0x50')]=function(_0x3fb9ac,_0x5142da,_0x330b8f){if(_0x3fb9ac['body']['id']){delete _0x3fb9ac[_0xdea0('0x44')]['id'];}return db[_0xdea0('0x29')][_0xdea0('0x48')]({'where':{'id':_0x3fb9ac[_0xdea0('0x3f')]['id']}})[_0xdea0('0x21')](handleEntityNotFound(_0x5142da,null))['then'](function(_0x47bb04){if(_0x47bb04){return _0x47bb04['setTags'](_0x3fb9ac['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x5142da,null))[_0xdea0('0x45')](handleError(_0x5142da,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4c836b1..b285f4c 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 _0x7334=['exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x7334,0x184));var _0x4733=function(_0x441672,_0x50c448){_0x441672=_0x441672-0x0;var _0x444bc4=_0x7334[_0x441672];return _0x444bc4;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var logger=require(_0x4733('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4733('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4733('0x4'));var rimraf=require(_0x4733('0x5'));var config=require(_0x4733('0x6'));var attributes=require(_0x4733('0x7'));module[_0x4733('0x8')]=function(_0x449ead,_0x16d7cc){return _0x449ead[_0x4733('0x9')](_0x4733('0xa'),attributes,{'tableName':_0x4733('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d25=['api','moment','bluebird','request-promise','path','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger'];(function(_0x1cc325,_0x537298){var _0x33d644=function(_0x4cd101){while(--_0x4cd101){_0x1cc325['push'](_0x1cc325['shift']());}};_0x33d644(++_0x537298);}(_0x7d25,0x8a));var _0x57d2=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x7d25[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require(_0x57d2('0x0'));var logger=require(_0x57d2('0x1'))(_0x57d2('0x2'));var moment=require(_0x57d2('0x3'));var BPromise=require(_0x57d2('0x4'));var rp=require(_0x57d2('0x5'));var fs=require('fs');var path=require(_0x57d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x3c5511,_0x49cc5f){return _0x3c5511[_0x57d2('0x7')](_0x57d2('0x8'),attributes,{'tableName':_0x57d2('0x9'),'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 0777558..f25b27b 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 _0x93c0=['request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x9b494f,_0x2d68ff){var _0x36597c=function(_0x5bcafb){while(--_0x5bcafb){_0x9b494f['push'](_0x9b494f['shift']());}};_0x36597c(++_0x2d68ff);}(_0x93c0,0x185));var _0x093c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93c0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x093c('0x0'));var util=require(_0x093c('0x1'));var moment=require('moment');var BPromise=require(_0x093c('0x2'));var rs=require(_0x093c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x093c('0x4'));var logger=require(_0x093c('0x5'))(_0x093c('0x6'));var config=require(_0x093c('0x7'));var jayson=require(_0x093c('0x8'));var client=jayson[_0x093c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3080d8,_0x2ee17c,_0x4f322c){return new BPromise(function(_0x215db8,_0x551159){return client[_0x093c('0xa')](_0x3080d8,_0x4f322c)['then'](function(_0x2be0ab){logger[_0x093c('0xb')](_0x093c('0xc'),_0x2ee17c,_0x093c('0xd'));logger[_0x093c('0xe')](_0x093c('0xf'),_0x2ee17c,_0x093c('0xd'),JSON['stringify'](_0x2be0ab));if(_0x2be0ab[_0x093c('0x10')]){if(_0x2be0ab[_0x093c('0x10')]['code']===0x1f4){logger[_0x093c('0x10')](_0x093c('0xc'),_0x2ee17c,_0x2be0ab['error'][_0x093c('0x11')]);return _0x551159(_0x2be0ab[_0x093c('0x10')][_0x093c('0x11')]);}logger[_0x093c('0x10')](_0x093c('0xc'),_0x2ee17c,_0x2be0ab['error'][_0x093c('0x11')]);return _0x215db8(_0x2be0ab[_0x093c('0x10')]['message']);}else{logger[_0x093c('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2ee17c,'request\x20sent');_0x215db8(_0x2be0ab['result'][_0x093c('0x11')]);}})[_0x093c('0x12')](function(_0x1e5ef6){logger[_0x093c('0x10')](_0x093c('0xc'),_0x2ee17c,_0x1e5ef6);_0x551159(_0x1e5ef6);});});} \ No newline at end of file +var _0x27a1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x29db25,_0x457467){var _0x48b1a5=function(_0x5cb05f){while(--_0x5cb05f){_0x29db25['push'](_0x29db25['shift']());}};_0x48b1a5(++_0x457467);}(_0x27a1,0x1d8));var _0x127a=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x27a1[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x127a('0x0'));var util=require(_0x127a('0x1'));var moment=require(_0x127a('0x2'));var BPromise=require('bluebird');var rs=require(_0x127a('0x3'));var fs=require('fs');var Redis=require(_0x127a('0x4'));var db=require(_0x127a('0x5'))['db'];var utils=require(_0x127a('0x6'));var logger=require(_0x127a('0x7'))(_0x127a('0x8'));var config=require(_0x127a('0x9'));var jayson=require(_0x127a('0xa'));var client=jayson['client'][_0x127a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdbe882,_0x5ab7a8,_0x5f26b8){return new BPromise(function(_0x5d45d1,_0x4b89ff){return client[_0x127a('0xc')](_0xdbe882,_0x5f26b8)[_0x127a('0xd')](function(_0x4ecd37){logger[_0x127a('0xe')](_0x127a('0xf'),_0x5ab7a8,_0x127a('0x10'));logger[_0x127a('0x11')](_0x127a('0x12'),_0x5ab7a8,_0x127a('0x10'),JSON[_0x127a('0x13')](_0x4ecd37));if(_0x4ecd37[_0x127a('0x14')]){if(_0x4ecd37[_0x127a('0x14')][_0x127a('0x15')]===0x1f4){logger[_0x127a('0x14')](_0x127a('0xf'),_0x5ab7a8,_0x4ecd37['error'][_0x127a('0x16')]);return _0x4b89ff(_0x4ecd37[_0x127a('0x14')][_0x127a('0x16')]);}logger[_0x127a('0x14')](_0x127a('0xf'),_0x5ab7a8,_0x4ecd37['error'][_0x127a('0x16')]);return _0x5d45d1(_0x4ecd37[_0x127a('0x14')]['message']);}else{logger[_0x127a('0xe')](_0x127a('0xf'),_0x5ab7a8,'request\x20sent');_0x5d45d1(_0x4ecd37[_0x127a('0x17')][_0x127a('0x16')]);}})[_0x127a('0x18')](function(_0xda113d){logger[_0x127a('0x14')](_0x127a('0xf'),_0x5ab7a8,_0xda113d);_0x4b89ff(_0xda113d);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 509cafa..bbd1474 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 _0xfa7d=['index','get','/:id','show','post','create','put','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated'];(function(_0x58fbd8,_0x5494e8){var _0x34de43=function(_0x37a842){while(--_0x37a842){_0x58fbd8['push'](_0x58fbd8['shift']());}};_0x34de43(++_0x5494e8);}(_0xfa7d,0x6f));var _0xdfa7=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xfa7d[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require('multer');var util=require(_0xdfa7('0x0'));var path=require('path');var timeout=require(_0xdfa7('0x1'));var express=require('express');var router=express[_0xdfa7('0x2')]();var fs_extra=require(_0xdfa7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdfa7('0x4'));var config=require(_0xdfa7('0x5'));var controller=require(_0xdfa7('0x6'));router['get']('/',auth[_0xdfa7('0x7')](),controller[_0xdfa7('0x8')]);router[_0xdfa7('0x9')](_0xdfa7('0xa'),auth[_0xdfa7('0x7')](),controller[_0xdfa7('0xb')]);router[_0xdfa7('0xc')]('/',auth[_0xdfa7('0x7')](),controller[_0xdfa7('0xd')]);router[_0xdfa7('0xe')](_0xdfa7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xdfa7('0xf')](_0xdfa7('0xa'),auth[_0xdfa7('0x7')](),controller[_0xdfa7('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb6a4=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x364be9,_0x64177c){var _0x529a0a=function(_0xfbb9ba){while(--_0xfbb9ba){_0x364be9['push'](_0x364be9['shift']());}};_0x529a0a(++_0x64177c);}(_0xb6a4,0x164));var _0x4b6a=function(_0x2ba6ad,_0x18bb40){_0x2ba6ad=_0x2ba6ad-0x0;var _0x277fe3=_0xb6a4[_0x2ba6ad];return _0x277fe3;};'use strict';var multer=require(_0x4b6a('0x0'));var util=require(_0x4b6a('0x1'));var path=require(_0x4b6a('0x2'));var timeout=require(_0x4b6a('0x3'));var express=require(_0x4b6a('0x4'));var router=express[_0x4b6a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4b6a('0x6'));var interaction=require(_0x4b6a('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0x4b6a('0x8')]('/',auth[_0x4b6a('0x9')](),controller[_0x4b6a('0xa')]);router[_0x4b6a('0x8')](_0x4b6a('0xb'),auth['isAuthenticated'](),controller[_0x4b6a('0xc')]);router[_0x4b6a('0xd')]('/',auth[_0x4b6a('0x9')](),controller[_0x4b6a('0xe')]);router[_0x4b6a('0xf')](_0x4b6a('0xb'),auth[_0x4b6a('0x9')](),controller['update']);router['delete'](_0x4b6a('0xb'),auth[_0x4b6a('0x9')](),controller[_0x4b6a('0x10')]);module[_0x4b6a('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 ca6b4d8..d9cfe78 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 _0x84c9=['string','STRING','variable','sequelize','exports','ENUM','customVariable','keyValue','picklist'];(function(_0xdc71d3,_0x23722c){var _0xd9cac8=function(_0x3b403d){while(--_0x3b403d){_0xdc71d3['push'](_0xdc71d3['shift']());}};_0xd9cac8(++_0x23722c);}(_0x84c9,0xe4));var _0x984c=function(_0x3f925c,_0x38f349){_0x3f925c=_0x3f925c-0x0;var _0xc1b88d=_0x84c9[_0x3f925c];return _0xc1b88d;};'use strict';var Sequelize=require(_0x984c('0x0'));module[_0x984c('0x1')]={'type':{'type':Sequelize[_0x984c('0x2')]('string','variable',_0x984c('0x3'),_0x984c('0x4'),_0x984c('0x5')),'defaultValue':_0x984c('0x6')},'content':{'type':Sequelize[_0x984c('0x7')]},'key':{'type':Sequelize[_0x984c('0x7')]},'keyType':{'type':Sequelize[_0x984c('0x2')]('string',_0x984c('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x984c('0x7')]},'idField':{'type':Sequelize[_0x984c('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa800=['keyValue','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0xa800,0x176));var _0x0a80=function(_0x31db70,_0x62d245){_0x31db70=_0x31db70-0x0;var _0x5623a4=_0xa800[_0x31db70];return _0x5623a4;};'use strict';var Sequelize=require(_0x0a80('0x0'));module[_0x0a80('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0a80('0x2'),_0x0a80('0x3'),'customVariable',_0x0a80('0x4'),'picklist'),'defaultValue':_0x0a80('0x2')},'content':{'type':Sequelize[_0x0a80('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0a80('0x6')](_0x0a80('0x2'),_0x0a80('0x3'),_0x0a80('0x7'))},'keyContent':{'type':Sequelize[_0x0a80('0x5')]},'idField':{'type':Sequelize[_0x0a80('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0a80('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a80('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 16640c4..822acd1 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 _0xc1cd=['destroy','error','stack','name','send','ZendeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x446186,_0x116e31){var _0x63b564=function(_0x590a14){while(--_0x590a14){_0x446186['push'](_0x446186['shift']());}};_0x63b564(++_0x116e31);}(_0xc1cd,0x1e6));var _0xdc1c=function(_0x463542,_0x40d201){_0x463542=_0x463542-0x0;var _0x8267f2=_0xc1cd[_0x463542];return _0x8267f2;};'use strict';var emlformat=require(_0xdc1c('0x0'));var rimraf=require(_0xdc1c('0x1'));var zipdir=require(_0xdc1c('0x2'));var jsonpatch=require(_0xdc1c('0x3'));var rp=require('request-promise');var moment=require(_0xdc1c('0x4'));var BPromise=require(_0xdc1c('0x5'));var Mustache=require('mustache');var util=require(_0xdc1c('0x6'));var path=require(_0xdc1c('0x7'));var sox=require('sox');var csv=require(_0xdc1c('0x8'));var ejs=require(_0xdc1c('0x9'));var fs=require('fs');var fs_extra=require(_0xdc1c('0xa'));var _=require(_0xdc1c('0xb'));var squel=require(_0xdc1c('0xc'));var crypto=require('crypto');var jsforce=require(_0xdc1c('0xd'));var deskjs=require(_0xdc1c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdc1c('0xf'));var Papa=require(_0xdc1c('0x10'));var Redis=require('ioredis');var authService=require(_0xdc1c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdc1c('0x12'));var hardwareService=require(_0xdc1c('0x13'));var logger=require(_0xdc1c('0x14'))(_0xdc1c('0x15'));var utils=require('../../config/utils');var config=require(_0xdc1c('0x16'));var licenseUtil=require(_0xdc1c('0x17'));var db=require(_0xdc1c('0x18'))['db'];function respondWithStatusCode(_0x16f013,_0x2b25ef){_0x2b25ef=_0x2b25ef||0xcc;return function(_0x1d4e86){if(_0x1d4e86){return _0x16f013[_0xdc1c('0x19')](_0x2b25ef);}return _0x16f013[_0xdc1c('0x1a')](_0x2b25ef)[_0xdc1c('0x1b')]();};}function respondWithResult(_0x544685,_0x2f1ec7){_0x2f1ec7=_0x2f1ec7||0xc8;return function(_0x1a45a9){if(_0x1a45a9){return _0x544685[_0xdc1c('0x1a')](_0x2f1ec7)[_0xdc1c('0x1c')](_0x1a45a9);}};}function respondWithFilteredResult(_0xaf1d5,_0x27842c){return function(_0x47be19){if(_0x47be19){var _0x1669c1=typeof _0x27842c[_0xdc1c('0x1d')]===_0xdc1c('0x1e')&&typeof _0x27842c[_0xdc1c('0x1f')]===_0xdc1c('0x1e');var _0x3ec757=_0x47be19[_0xdc1c('0x20')];var _0x49bc37=_0x1669c1?0x0:_0x27842c['offset'];var _0x47c609=_0x1669c1?_0x47be19[_0xdc1c('0x20')]:_0x27842c['offset']+_0x27842c[_0xdc1c('0x1f')];var _0x1abcbd;if(_0x47c609>=_0x3ec757){_0x47c609=_0x3ec757;_0x1abcbd=0xc8;}else{_0x1abcbd=0xce;}_0xaf1d5[_0xdc1c('0x1a')](_0x1abcbd);return _0xaf1d5[_0xdc1c('0x21')](_0xdc1c('0x22'),_0x49bc37+'-'+_0x47c609+'/'+_0x3ec757)[_0xdc1c('0x1c')](_0x47be19);}return null;};}function patchUpdates(_0x2b3e9d){return function(_0x315ee1){try{jsonpatch['apply'](_0x315ee1,_0x2b3e9d,!![]);}catch(_0x426498){return BPromise[_0xdc1c('0x23')](_0x426498);}return _0x315ee1[_0xdc1c('0x24')]();};}function saveUpdates(_0x546a68,_0x83d7ab){return function(_0x37d167){if(_0x37d167){return _0x37d167[_0xdc1c('0x25')](_0x546a68)[_0xdc1c('0x26')](function(_0x4c7a8f){return _0x4c7a8f;});}return null;};}function removeEntity(_0x143f6f,_0x53e296){return function(_0x24ee8e){if(_0x24ee8e){return _0x24ee8e[_0xdc1c('0x27')]()[_0xdc1c('0x26')](function(){_0x143f6f[_0xdc1c('0x1a')](0xcc)[_0xdc1c('0x1b')]();});}};}function handleEntityNotFound(_0x469b6d,_0x470a28){return function(_0x4a0085){if(!_0x4a0085){_0x469b6d[_0xdc1c('0x19')](0x194);}return _0x4a0085;};}function handleError(_0x3cd97f,_0x1f603a){_0x1f603a=_0x1f603a||0x1f4;return function(_0x16dbc6){logger[_0xdc1c('0x28')](_0x16dbc6[_0xdc1c('0x29')]);if(_0x16dbc6[_0xdc1c('0x2a')]){delete _0x16dbc6[_0xdc1c('0x2a')];}_0x3cd97f[_0xdc1c('0x1a')](_0x1f603a)[_0xdc1c('0x2b')](_0x16dbc6);};}exports['index']=function(_0xb77c16,_0x30bd89){var _0x306be2={},_0x2df256={},_0x48eb9a={'count':0x0,'rows':[]};var _0x4a320c=_['map'](db[_0xdc1c('0x2c')][_0xdc1c('0x2d')],function(_0x2fd38e){return{'name':_0x2fd38e[_0xdc1c('0x2e')],'type':_0x2fd38e[_0xdc1c('0x2f')][_0xdc1c('0x30')]};});_0x2df256['model']=_[_0xdc1c('0x31')](_0x4a320c,'name');_0x2df256[_0xdc1c('0x32')]=_[_0xdc1c('0x33')](_0xb77c16[_0xdc1c('0x32')]);_0x2df256[_0xdc1c('0x34')]=_['intersection'](_0x2df256['model'],_0x2df256['query']);_0x306be2[_0xdc1c('0x35')]=_['intersection'](_0x2df256[_0xdc1c('0x36')],qs['fields'](_0xb77c16[_0xdc1c('0x32')][_0xdc1c('0x37')]));_0x306be2[_0xdc1c('0x35')]=_0x306be2[_0xdc1c('0x35')]['length']?_0x306be2[_0xdc1c('0x35')]:_0x2df256[_0xdc1c('0x36')];if(!_0xb77c16['query'][_0xdc1c('0x38')](_0xdc1c('0x39'))){_0x306be2[_0xdc1c('0x1f')]=qs[_0xdc1c('0x1f')](_0xb77c16[_0xdc1c('0x32')][_0xdc1c('0x1f')]);_0x306be2[_0xdc1c('0x1d')]=qs['offset'](_0xb77c16[_0xdc1c('0x32')][_0xdc1c('0x1d')]);}_0x306be2[_0xdc1c('0x3a')]=qs[_0xdc1c('0x3b')](_0xb77c16[_0xdc1c('0x32')]['sort']);_0x306be2[_0xdc1c('0x3c')]=qs[_0xdc1c('0x34')](_[_0xdc1c('0x3d')](_0xb77c16[_0xdc1c('0x32')],_0x2df256[_0xdc1c('0x34')]),_0x4a320c);if(_0xb77c16['query'][_0xdc1c('0x3e')]){_0x306be2[_0xdc1c('0x3c')]=_[_0xdc1c('0x3f')](_0x306be2[_0xdc1c('0x3c')],{'$or':_[_0xdc1c('0x31')](_0x4a320c,function(_0xc527e3){if(_0xc527e3['type']!==_0xdc1c('0x40')){var _0x324615={};_0x324615[_0xc527e3['name']]={'$like':'%'+_0xb77c16[_0xdc1c('0x32')][_0xdc1c('0x3e')]+'%'};return _0x324615;}})});}_0x306be2=_[_0xdc1c('0x3f')]({},_0x306be2,_0xb77c16[_0xdc1c('0x41')]);var _0x3ab0cf={'where':_0x306be2[_0xdc1c('0x3c')]};return db['ZendeskField'][_0xdc1c('0x20')](_0x3ab0cf)[_0xdc1c('0x26')](function(_0x395461){_0x48eb9a[_0xdc1c('0x20')]=_0x395461;if(_0xb77c16['query'][_0xdc1c('0x42')]){_0x306be2[_0xdc1c('0x43')]=[{'all':!![]}];}return db[_0xdc1c('0x2c')]['findAll'](_0x306be2);})[_0xdc1c('0x26')](function(_0x131186){_0x48eb9a[_0xdc1c('0x44')]=_0x131186;return _0x48eb9a;})[_0xdc1c('0x26')](respondWithFilteredResult(_0x30bd89,_0x306be2))[_0xdc1c('0x45')](handleError(_0x30bd89,null));};exports[_0xdc1c('0x46')]=function(_0x3c3cf1,_0x4d4c93){var _0xd1ec27={'raw':!![],'where':{'id':_0x3c3cf1[_0xdc1c('0x47')]['id']}},_0x29bc80={};_0x29bc80[_0xdc1c('0x36')]=_[_0xdc1c('0x33')](db['ZendeskField'][_0xdc1c('0x2d')]);_0x29bc80[_0xdc1c('0x32')]=_[_0xdc1c('0x33')](_0x3c3cf1[_0xdc1c('0x32')]);_0x29bc80[_0xdc1c('0x34')]=_['intersection'](_0x29bc80[_0xdc1c('0x36')],_0x29bc80[_0xdc1c('0x32')]);_0xd1ec27[_0xdc1c('0x35')]=_[_0xdc1c('0x48')](_0x29bc80[_0xdc1c('0x36')],qs[_0xdc1c('0x37')](_0x3c3cf1[_0xdc1c('0x32')][_0xdc1c('0x37')]));_0xd1ec27[_0xdc1c('0x35')]=_0xd1ec27[_0xdc1c('0x35')]['length']?_0xd1ec27['attributes']:_0x29bc80[_0xdc1c('0x36')];if(_0x3c3cf1['query'][_0xdc1c('0x42')]){_0xd1ec27[_0xdc1c('0x43')]=[{'all':!![]}];}_0xd1ec27=_[_0xdc1c('0x3f')]({},_0xd1ec27,_0x3c3cf1[_0xdc1c('0x41')]);return db[_0xdc1c('0x2c')][_0xdc1c('0x49')](_0xd1ec27)[_0xdc1c('0x26')](handleEntityNotFound(_0x4d4c93,null))[_0xdc1c('0x26')](respondWithResult(_0x4d4c93,null))[_0xdc1c('0x45')](handleError(_0x4d4c93,null));};exports['create']=function(_0x3ea884,_0x4021c1){return db[_0xdc1c('0x2c')]['create'](_0x3ea884[_0xdc1c('0x4a')],{})[_0xdc1c('0x26')](respondWithResult(_0x4021c1,0xc9))['catch'](handleError(_0x4021c1,null));};exports[_0xdc1c('0x25')]=function(_0x4897e7,_0x21ecef){if(_0x4897e7['body']['id']){delete _0x4897e7[_0xdc1c('0x4a')]['id'];}return db['ZendeskField'][_0xdc1c('0x49')]({'where':{'id':_0x4897e7[_0xdc1c('0x47')]['id']}})[_0xdc1c('0x26')](handleEntityNotFound(_0x21ecef,null))[_0xdc1c('0x26')](saveUpdates(_0x4897e7[_0xdc1c('0x4a')],null))[_0xdc1c('0x26')](respondWithResult(_0x21ecef,null))[_0xdc1c('0x45')](handleError(_0x21ecef,null));};exports['destroy']=function(_0xc7c018,_0x338323){return db[_0xdc1c('0x2c')][_0xdc1c('0x49')]({'where':{'id':_0xc7c018['params']['id']}})['then'](handleEntityNotFound(_0x338323,null))[_0xdc1c('0x26')](removeEntity(_0x338323,null))[_0xdc1c('0x45')](handleError(_0x338323,null));}; \ No newline at end of file +var _0xa583=['params','keys','rawAttributes','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','apply','reject','save','update','then','stack','name','send','index','ZendeskField','fieldName','type','key','map','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x4048e3,_0x10f92b){var _0x4e4c8b=function(_0x84d136){while(--_0x84d136){_0x4048e3['push'](_0x4048e3['shift']());}};_0x4e4c8b(++_0x10f92b);}(_0xa583,0x127));var _0x3a58=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa583[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a58('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a58('0x1'));var rp=require(_0x3a58('0x2'));var moment=require(_0x3a58('0x3'));var BPromise=require(_0x3a58('0x4'));var Mustache=require('mustache');var util=require(_0x3a58('0x5'));var path=require(_0x3a58('0x6'));var sox=require(_0x3a58('0x7'));var csv=require(_0x3a58('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a58('0x9'));var crypto=require('crypto');var jsforce=require(_0x3a58('0xa'));var deskjs=require(_0x3a58('0xb'));var toCsv=require(_0x3a58('0x8'));var querystring=require(_0x3a58('0xc'));var Papa=require(_0x3a58('0xd'));var Redis=require(_0x3a58('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a58('0xf'));var hardwareService=require(_0x3a58('0x10'));var logger=require(_0x3a58('0x11'))(_0x3a58('0x12'));var utils=require(_0x3a58('0x13'));var config=require(_0x3a58('0x14'));var licenseUtil=require(_0x3a58('0x15'));var db=require(_0x3a58('0x16'))['db'];function respondWithStatusCode(_0x1cc677,_0xe51ee){_0xe51ee=_0xe51ee||0xcc;return function(_0x214c68){if(_0x214c68){return _0x1cc677[_0x3a58('0x17')](_0xe51ee);}return _0x1cc677[_0x3a58('0x18')](_0xe51ee)['end']();};}function respondWithResult(_0x4e4c93,_0x230c08){_0x230c08=_0x230c08||0xc8;return function(_0x3adf8f){if(_0x3adf8f){return _0x4e4c93[_0x3a58('0x18')](_0x230c08)['json'](_0x3adf8f);}};}function respondWithFilteredResult(_0x408133,_0x58e986){return function(_0x1a514d){if(_0x1a514d){var _0x32310b=typeof _0x58e986['offset']===_0x3a58('0x19')&&typeof _0x58e986['limit']===_0x3a58('0x19');var _0x398ce9=_0x1a514d[_0x3a58('0x1a')];var _0x92c64c=_0x32310b?0x0:_0x58e986[_0x3a58('0x1b')];var _0x487d4b=_0x32310b?_0x1a514d[_0x3a58('0x1a')]:_0x58e986['offset']+_0x58e986[_0x3a58('0x1c')];var _0x25a24f;if(_0x487d4b>=_0x398ce9){_0x487d4b=_0x398ce9;_0x25a24f=0xc8;}else{_0x25a24f=0xce;}_0x408133['status'](_0x25a24f);return _0x408133[_0x3a58('0x1d')]('Content-Range',_0x92c64c+'-'+_0x487d4b+'/'+_0x398ce9)['json'](_0x1a514d);}return null;};}function patchUpdates(_0x256118){return function(_0x325b00){try{jsonpatch[_0x3a58('0x1e')](_0x325b00,_0x256118,!![]);}catch(_0x2c3419){return BPromise[_0x3a58('0x1f')](_0x2c3419);}return _0x325b00[_0x3a58('0x20')]();};}function saveUpdates(_0x458e87,_0x2b94bb){return function(_0x4a62d0){if(_0x4a62d0){return _0x4a62d0[_0x3a58('0x21')](_0x458e87)[_0x3a58('0x22')](function(_0x59b9b8){return _0x59b9b8;});}return null;};}function removeEntity(_0x5eb7a3,_0x29cbad){return function(_0x6f40e0){if(_0x6f40e0){return _0x6f40e0['destroy']()[_0x3a58('0x22')](function(){_0x5eb7a3[_0x3a58('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55c876,_0x5593ff){return function(_0x1c9db0){if(!_0x1c9db0){_0x55c876[_0x3a58('0x17')](0x194);}return _0x1c9db0;};}function handleError(_0x4073b4,_0x325a29){_0x325a29=_0x325a29||0x1f4;return function(_0x3f24e8){logger['error'](_0x3f24e8[_0x3a58('0x23')]);if(_0x3f24e8[_0x3a58('0x24')]){delete _0x3f24e8[_0x3a58('0x24')];}_0x4073b4[_0x3a58('0x18')](_0x325a29)[_0x3a58('0x25')](_0x3f24e8);};}exports[_0x3a58('0x26')]=function(_0x11d4c7,_0x5261ef){var _0x10d692={},_0x49ef1f={},_0x55b49f={'count':0x0,'rows':[]};var _0x162278=_['map'](db[_0x3a58('0x27')]['rawAttributes'],function(_0x4b51ad){return{'name':_0x4b51ad[_0x3a58('0x28')],'type':_0x4b51ad[_0x3a58('0x29')][_0x3a58('0x2a')]};});_0x49ef1f['model']=_[_0x3a58('0x2b')](_0x162278,_0x3a58('0x24'));_0x49ef1f[_0x3a58('0x2c')]=_['keys'](_0x11d4c7[_0x3a58('0x2c')]);_0x49ef1f['filters']=_['intersection'](_0x49ef1f[_0x3a58('0x2d')],_0x49ef1f['query']);_0x10d692[_0x3a58('0x2e')]=_[_0x3a58('0x2f')](_0x49ef1f['model'],qs[_0x3a58('0x30')](_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x30')]));_0x10d692[_0x3a58('0x2e')]=_0x10d692['attributes'][_0x3a58('0x31')]?_0x10d692['attributes']:_0x49ef1f['model'];if(!_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x32')](_0x3a58('0x33'))){_0x10d692[_0x3a58('0x1c')]=qs[_0x3a58('0x1c')](_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x1c')]);_0x10d692['offset']=qs[_0x3a58('0x1b')](_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x1b')]);}_0x10d692['order']=qs[_0x3a58('0x34')](_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x34')]);_0x10d692[_0x3a58('0x35')]=qs[_0x3a58('0x36')](_['pick'](_0x11d4c7['query'],_0x49ef1f[_0x3a58('0x36')]),_0x162278);if(_0x11d4c7[_0x3a58('0x2c')]['filter']){_0x10d692[_0x3a58('0x35')]=_[_0x3a58('0x37')](_0x10d692[_0x3a58('0x35')],{'$or':_[_0x3a58('0x2b')](_0x162278,function(_0x952f0d){if(_0x952f0d[_0x3a58('0x29')]!==_0x3a58('0x38')){var _0x237b1f={};_0x237b1f[_0x952f0d[_0x3a58('0x24')]]={'$like':'%'+_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x39')]+'%'};return _0x237b1f;}})});}_0x10d692=_[_0x3a58('0x37')]({},_0x10d692,_0x11d4c7[_0x3a58('0x3a')]);var _0x1a56d8={'where':_0x10d692[_0x3a58('0x35')]};return db[_0x3a58('0x27')]['count'](_0x1a56d8)[_0x3a58('0x22')](function(_0x5b834f){_0x55b49f[_0x3a58('0x1a')]=_0x5b834f;if(_0x11d4c7[_0x3a58('0x2c')][_0x3a58('0x3b')]){_0x10d692[_0x3a58('0x3c')]=[{'all':!![]}];}return db['ZendeskField'][_0x3a58('0x3d')](_0x10d692);})[_0x3a58('0x22')](function(_0x17af3f){_0x55b49f[_0x3a58('0x3e')]=_0x17af3f;return _0x55b49f;})[_0x3a58('0x22')](respondWithFilteredResult(_0x5261ef,_0x10d692))[_0x3a58('0x3f')](handleError(_0x5261ef,null));};exports[_0x3a58('0x40')]=function(_0x1d449c,_0x5e7d45){var _0x4e7f90={'raw':!![],'where':{'id':_0x1d449c[_0x3a58('0x41')]['id']}},_0x104744={};_0x104744[_0x3a58('0x2d')]=_[_0x3a58('0x42')](db[_0x3a58('0x27')][_0x3a58('0x43')]);_0x104744[_0x3a58('0x2c')]=_[_0x3a58('0x42')](_0x1d449c[_0x3a58('0x2c')]);_0x104744[_0x3a58('0x36')]=_['intersection'](_0x104744[_0x3a58('0x2d')],_0x104744[_0x3a58('0x2c')]);_0x4e7f90[_0x3a58('0x2e')]=_[_0x3a58('0x2f')](_0x104744[_0x3a58('0x2d')],qs[_0x3a58('0x30')](_0x1d449c[_0x3a58('0x2c')][_0x3a58('0x30')]));_0x4e7f90[_0x3a58('0x2e')]=_0x4e7f90['attributes'][_0x3a58('0x31')]?_0x4e7f90[_0x3a58('0x2e')]:_0x104744[_0x3a58('0x2d')];if(_0x1d449c[_0x3a58('0x2c')][_0x3a58('0x3b')]){_0x4e7f90[_0x3a58('0x3c')]=[{'all':!![]}];}_0x4e7f90=_[_0x3a58('0x37')]({},_0x4e7f90,_0x1d449c[_0x3a58('0x3a')]);return db[_0x3a58('0x27')][_0x3a58('0x44')](_0x4e7f90)[_0x3a58('0x22')](handleEntityNotFound(_0x5e7d45,null))[_0x3a58('0x22')](respondWithResult(_0x5e7d45,null))[_0x3a58('0x3f')](handleError(_0x5e7d45,null));};exports[_0x3a58('0x45')]=function(_0x3547b0,_0x5371b0){return db[_0x3a58('0x27')]['create'](_0x3547b0[_0x3a58('0x46')],{})[_0x3a58('0x22')](respondWithResult(_0x5371b0,0xc9))[_0x3a58('0x3f')](handleError(_0x5371b0,null));};exports[_0x3a58('0x21')]=function(_0x28e519,_0x37e338){if(_0x28e519['body']['id']){delete _0x28e519['body']['id'];}return db['ZendeskField'][_0x3a58('0x44')]({'where':{'id':_0x28e519[_0x3a58('0x41')]['id']}})[_0x3a58('0x22')](handleEntityNotFound(_0x37e338,null))[_0x3a58('0x22')](saveUpdates(_0x28e519[_0x3a58('0x46')],null))[_0x3a58('0x22')](respondWithResult(_0x37e338,null))[_0x3a58('0x3f')](handleError(_0x37e338,null));};exports[_0x3a58('0x47')]=function(_0x40e3f4,_0xe87d92){return db['ZendeskField'][_0x3a58('0x44')]({'where':{'id':_0x40e3f4[_0x3a58('0x41')]['id']}})[_0x3a58('0x22')](handleEntityNotFound(_0xe87d92,null))['then'](removeEntity(_0xe87d92,null))['catch'](handleError(_0xe87d92,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index c76a9ac..e7814e2 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 _0x4b83=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','FieldId'];(function(_0x539b71,_0x4daf0b){var _0x3d1a59=function(_0x1a59ed){while(--_0x1a59ed){_0x539b71['push'](_0x539b71['shift']());}};_0x3d1a59(++_0x4daf0b);}(_0x4b83,0xea));var _0x34b8=function(_0x4c5493,_0x5428da){_0x4c5493=_0x4c5493-0x0;var _0x4b0a4b=_0x4b83[_0x4c5493];return _0x4b0a4b;};'use strict';var _=require(_0x34b8('0x0'));var util=require(_0x34b8('0x1'));var logger=require(_0x34b8('0x2'))(_0x34b8('0x3'));var moment=require('moment');var BPromise=require(_0x34b8('0x4'));var rp=require(_0x34b8('0x5'));var fs=require('fs');var path=require(_0x34b8('0x6'));var rimraf=require(_0x34b8('0x7'));var config=require(_0x34b8('0x8'));var attributes=require(_0x34b8('0x9'));module['exports']=function(_0x1eaa85,_0x4a8234){return _0x1eaa85[_0x34b8('0xa')]('ZendeskField',attributes,{'tableName':_0x34b8('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x34b8('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x84ba=['zendesk_unique_index','idField','FieldId','util','api','moment','rimraf','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x4e44f2,_0x1eefbd){var _0x2f1463=function(_0x2a1a0a){while(--_0x2a1a0a){_0x4e44f2['push'](_0x4e44f2['shift']());}};_0x2f1463(++_0x1eefbd);}(_0x84ba,0x1c6));var _0xa84b=function(_0x2e7194,_0xea768d){_0x2e7194=_0x2e7194-0x0;var _0x16d3c7=_0x84ba[_0x2e7194];return _0x16d3c7;};'use strict';var _=require('lodash');var util=require(_0xa84b('0x0'));var logger=require('../../config/logger')(_0xa84b('0x1'));var moment=require(_0xa84b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa84b('0x3'));var config=require('../../config/environment');var attributes=require(_0xa84b('0x4'));module[_0xa84b('0x5')]=function(_0x17a486,_0xda60dd){return _0x17a486[_0xa84b('0x6')](_0xa84b('0x7'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xa84b('0x8'),'fields':[_0xa84b('0x9'),_0xa84b('0xa')],'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 b4be5ae..b83c9d2 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 _0xb604=['debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x4d7c82,_0x2f2fff){var _0x173bf7=function(_0x564926){while(--_0x564926){_0x4d7c82['push'](_0x4d7c82['shift']());}};_0x173bf7(++_0x2f2fff);}(_0xb604,0xb8));var _0x4b60=function(_0x245b57,_0x420f33){_0x245b57=_0x245b57-0x0;var _0x1d07d9=_0xb604[_0x245b57];return _0x1d07d9;};'use strict';var _=require(_0x4b60('0x0'));var util=require(_0x4b60('0x1'));var moment=require(_0x4b60('0x2'));var BPromise=require(_0x4b60('0x3'));var rs=require(_0x4b60('0x4'));var fs=require('fs');var Redis=require(_0x4b60('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b60('0x6'));var logger=require('../../config/logger')(_0x4b60('0x7'));var config=require(_0x4b60('0x8'));var jayson=require(_0x4b60('0x9'));var client=jayson[_0x4b60('0xa')][_0x4b60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x129eb9,_0x23e265,_0x8416ed){return new BPromise(function(_0x422cde,_0x164e72){return client['request'](_0x129eb9,_0x8416ed)['then'](function(_0xba7625){logger['info'](_0x4b60('0xc'),_0x23e265,_0x4b60('0xd'));logger[_0x4b60('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x23e265,_0x4b60('0xd'),JSON[_0x4b60('0xf')](_0xba7625));if(_0xba7625[_0x4b60('0x10')]){if(_0xba7625[_0x4b60('0x10')][_0x4b60('0x11')]===0x1f4){logger[_0x4b60('0x10')](_0x4b60('0xc'),_0x23e265,_0xba7625[_0x4b60('0x10')][_0x4b60('0x12')]);return _0x164e72(_0xba7625[_0x4b60('0x10')][_0x4b60('0x12')]);}logger['error'](_0x4b60('0xc'),_0x23e265,_0xba7625[_0x4b60('0x10')]['message']);return _0x422cde(_0xba7625[_0x4b60('0x10')][_0x4b60('0x12')]);}else{logger[_0x4b60('0x13')](_0x4b60('0xc'),_0x23e265,_0x4b60('0xd'));_0x422cde(_0xba7625[_0x4b60('0x14')][_0x4b60('0x12')]);}})[_0x4b60('0x15')](function(_0x2554af){logger['error'](_0x4b60('0xc'),_0x23e265,_0x2554af);_0x164e72(_0x2554af);});});} \ No newline at end of file +var _0x95cf=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskField,\x20%s,\x20%s'];(function(_0x17823f,_0xffd807){var _0x51fc21=function(_0x5e4921){while(--_0x5e4921){_0x17823f['push'](_0x17823f['shift']());}};_0x51fc21(++_0xffd807);}(_0x95cf,0xba));var _0xf95c=function(_0x30dca1,_0x3c89e4){_0x30dca1=_0x30dca1-0x0;var _0x1cf754=_0x95cf[_0x30dca1];return _0x1cf754;};'use strict';var _=require(_0xf95c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf95c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf95c('0x2'));var db=require(_0xf95c('0x3'))['db'];var utils=require(_0xf95c('0x4'));var logger=require(_0xf95c('0x5'))(_0xf95c('0x6'));var config=require(_0xf95c('0x7'));var jayson=require(_0xf95c('0x8'));var client=jayson['client'][_0xf95c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x301839,_0x4d69bb,_0x1f6f91){return new BPromise(function(_0x13a53d,_0xe8263b){return client['request'](_0x301839,_0x1f6f91)['then'](function(_0x162cda){logger[_0xf95c('0xa')](_0xf95c('0xb'),_0x4d69bb,_0xf95c('0xc'));logger[_0xf95c('0xd')](_0xf95c('0xe'),_0x4d69bb,_0xf95c('0xc'),JSON['stringify'](_0x162cda));if(_0x162cda['error']){if(_0x162cda[_0xf95c('0xf')][_0xf95c('0x10')]===0x1f4){logger[_0xf95c('0xf')](_0xf95c('0xb'),_0x4d69bb,_0x162cda[_0xf95c('0xf')]['message']);return _0xe8263b(_0x162cda['error'][_0xf95c('0x11')]);}logger[_0xf95c('0xf')](_0xf95c('0xb'),_0x4d69bb,_0x162cda[_0xf95c('0xf')][_0xf95c('0x11')]);return _0x13a53d(_0x162cda[_0xf95c('0xf')][_0xf95c('0x11')]);}else{logger['info'](_0xf95c('0xb'),_0x4d69bb,_0xf95c('0xc'));_0x13a53d(_0x162cda['result'][_0xf95c('0x11')]);}})['catch'](function(_0x2eef27){logger[_0xf95c('0xf')](_0xf95c('0xb'),_0x4d69bb,_0x2eef27);_0xe8263b(_0x2eef27);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 8bc087d..713cb26 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 _0xbe43=['/:id','show','get','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xbe43,0x1bc));var _0x3be4=function(_0x52693e,_0x110211){_0x52693e=_0x52693e-0x0;var _0x553c56=_0xbe43[_0x52693e];return _0x553c56;};'use strict';var multer=require(_0x3be4('0x0'));var util=require(_0x3be4('0x1'));var path=require(_0x3be4('0x2'));var timeout=require(_0x3be4('0x3'));var express=require(_0x3be4('0x4'));var router=express[_0x3be4('0x5')]();var fs_extra=require(_0x3be4('0x6'));var auth=require(_0x3be4('0x7'));var interaction=require(_0x3be4('0x8'));var config=require(_0x3be4('0x9'));var controller=require(_0x3be4('0xa'));router['get']('/',auth[_0x3be4('0xb')](),controller['index']);router['get'](_0x3be4('0xc'),auth[_0x3be4('0xb')](),controller[_0x3be4('0xd')]);router[_0x3be4('0xe')](_0x3be4('0xf'),auth['isAuthenticated'](),controller[_0x3be4('0x10')]);router[_0x3be4('0xe')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x3be4('0x11')]('/',auth[_0x3be4('0xb')](),controller['create']);router[_0x3be4('0x11')](_0x3be4('0xf'),auth[_0x3be4('0xb')](),controller[_0x3be4('0x12')]);router[_0x3be4('0x13')](_0x3be4('0xc'),auth[_0x3be4('0xb')](),controller[_0x3be4('0x14')]);router[_0x3be4('0x15')]('/:id',auth[_0x3be4('0xb')](),controller[_0x3be4('0x16')]);module[_0x3be4('0x17')]=router; \ No newline at end of file +var _0x0194=['exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy'];(function(_0x4c11f7,_0x5a0447){var _0x587d6b=function(_0x5b9bbf){while(--_0x5b9bbf){_0x4c11f7['push'](_0x4c11f7['shift']());}};_0x587d6b(++_0x5a0447);}(_0x0194,0xa9));var _0x4019=function(_0x489909,_0x712d66){_0x489909=_0x489909-0x0;var _0x2b49a1=_0x0194[_0x489909];return _0x2b49a1;};'use strict';var multer=require(_0x4019('0x0'));var util=require('util');var path=require(_0x4019('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4019('0x2')]();var fs_extra=require(_0x4019('0x3'));var auth=require(_0x4019('0x4'));var interaction=require(_0x4019('0x5'));var config=require(_0x4019('0x6'));var controller=require(_0x4019('0x7'));router['get']('/',auth[_0x4019('0x8')](),controller['index']);router['get'](_0x4019('0x9'),auth[_0x4019('0x8')](),controller[_0x4019('0xa')]);router[_0x4019('0xb')](_0x4019('0xc'),auth[_0x4019('0x8')](),controller[_0x4019('0xd')]);router[_0x4019('0xb')](_0x4019('0xe'),auth[_0x4019('0x8')](),controller[_0x4019('0xf')]);router[_0x4019('0x10')]('/',auth[_0x4019('0x8')](),controller['create']);router[_0x4019('0x10')](_0x4019('0xc'),auth[_0x4019('0x8')](),controller['addConfiguration']);router['put'](_0x4019('0x9'),auth[_0x4019('0x8')](),controller[_0x4019('0x11')]);router[_0x4019('0x12')](_0x4019('0x9'),auth[_0x4019('0x8')](),controller[_0x4019('0x13')]);module[_0x4019('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 02e1e6d..a4e079a 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 _0xb821=['STRING','exports'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xb821,0xa7));var _0x1b82=function(_0x126878,_0x1e7e93){_0x126878=_0x126878-0x0;var _0x63f30f=_0xb821[_0x126878];return _0x63f30f;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'name':{'type':Sequelize[_0x1b82('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x1b82('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b82('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x1b82('0x1')]},'refreshToken':{'type':Sequelize[_0x1b82('0x1')]}}; \ No newline at end of file +var _0x1be1=['STRING'];(function(_0x224365,_0x137b8a){var _0x3e4131=function(_0x204586){while(--_0x204586){_0x224365['push'](_0x224365['shift']());}};_0x3e4131(++_0x137b8a);}(_0x1be1,0x192));var _0x11be=function(_0x2e8bea,_0x2ce264){_0x2e8bea=_0x2e8bea-0x0;var _0x157f22=_0x1be1[_0x2e8bea];return _0x157f22;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11be('0x0')]},'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x11be('0x0')]},'clientId':{'type':Sequelize[_0x11be('0x0')]},'clientSecret':{'type':Sequelize[_0x11be('0x0')]},'serverUrl':{'type':Sequelize[_0x11be('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 4129c5b..ac8940d 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 _0x2b77=['destroy','end','sendStatus','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','ZohoAccount','includeAll','include','params','rawAttributes','options','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','filter','AccountId','Subjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','clientSecret','serverUrl','refreshToken','host','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','offset','undefined','limit','count','set','apply','save','update','then'];(function(_0x16acb7,_0x23f034){var _0x39bf39=function(_0x21281e){while(--_0x21281e){_0x16acb7['push'](_0x16acb7['shift']());}};_0x39bf39(++_0x23f034);}(_0x2b77,0x1e4));var _0x72b7=function(_0x407cc1,_0xf59640){_0x407cc1=_0x407cc1-0x0;var _0x39da5c=_0x2b77[_0x407cc1];return _0x39da5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72b7('0x0'));var zipdir=require(_0x72b7('0x1'));var jsonpatch=require(_0x72b7('0x2'));var rp=require(_0x72b7('0x3'));var moment=require(_0x72b7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x72b7('0x5'));var util=require('util');var path=require(_0x72b7('0x6'));var sox=require(_0x72b7('0x7'));var csv=require(_0x72b7('0x8'));var ejs=require(_0x72b7('0x9'));var fs=require('fs');var fs_extra=require(_0x72b7('0xa'));var _=require(_0x72b7('0xb'));var squel=require(_0x72b7('0xc'));var crypto=require(_0x72b7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x72b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x72b7('0xf'));var Papa=require(_0x72b7('0x10'));var Redis=require('ioredis');var authService=require(_0x72b7('0x11'));var qs=require(_0x72b7('0x12'));var as=require(_0x72b7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72b7('0x14'))(_0x72b7('0x15'));var utils=require(_0x72b7('0x16'));var config=require(_0x72b7('0x17'));var licenseUtil=require(_0x72b7('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x72b7('0x19'));function respondWithStatusCode(_0x1f1e14,_0x46f57e){_0x46f57e=_0x46f57e||0xcc;return function(_0x1a79c1){if(_0x1a79c1){return _0x1f1e14['sendStatus'](_0x46f57e);}return _0x1f1e14[_0x72b7('0x1a')](_0x46f57e)['end']();};}function respondWithResult(_0x567c98,_0x4e1598){_0x4e1598=_0x4e1598||0xc8;return function(_0x370e5c){if(_0x370e5c){return _0x567c98[_0x72b7('0x1a')](_0x4e1598)['json'](_0x370e5c);}};}function respondWithFilteredResult(_0x2f5e04,_0x276f7){return function(_0x3aa827){if(_0x3aa827){var _0x3783ef=typeof _0x276f7[_0x72b7('0x1b')]===_0x72b7('0x1c')&&typeof _0x276f7[_0x72b7('0x1d')]===_0x72b7('0x1c');var _0x931bf8=_0x3aa827[_0x72b7('0x1e')];var _0x423b19=_0x3783ef?0x0:_0x276f7['offset'];var _0x2a7cc5=_0x3783ef?_0x3aa827[_0x72b7('0x1e')]:_0x276f7[_0x72b7('0x1b')]+_0x276f7[_0x72b7('0x1d')];var _0x2f7e5f;if(_0x2a7cc5>=_0x931bf8){_0x2a7cc5=_0x931bf8;_0x2f7e5f=0xc8;}else{_0x2f7e5f=0xce;}_0x2f5e04['status'](_0x2f7e5f);return _0x2f5e04[_0x72b7('0x1f')]('Content-Range',_0x423b19+'-'+_0x2a7cc5+'/'+_0x931bf8)['json'](_0x3aa827);}return null;};}function patchUpdates(_0x4ee5e8){return function(_0x1d59e7){try{jsonpatch[_0x72b7('0x20')](_0x1d59e7,_0x4ee5e8,!![]);}catch(_0x5aec05){return BPromise['reject'](_0x5aec05);}return _0x1d59e7[_0x72b7('0x21')]();};}function saveUpdates(_0x5b3049,_0x596721){return function(_0x1e49ce){if(_0x1e49ce){return _0x1e49ce[_0x72b7('0x22')](_0x5b3049)[_0x72b7('0x23')](function(_0x32e67d){return _0x32e67d;});}return null;};}function removeEntity(_0x151feb,_0x461322){return function(_0x5471a6){if(_0x5471a6){return _0x5471a6[_0x72b7('0x24')]()[_0x72b7('0x23')](function(){_0x151feb[_0x72b7('0x1a')](0xcc)[_0x72b7('0x25')]();});}};}function handleEntityNotFound(_0x40102b,_0x5c466c){return function(_0xd28bce){if(!_0xd28bce){_0x40102b[_0x72b7('0x26')](0x194);}return _0xd28bce;};}function handleError(_0x3f0366,_0x4a6f2d){_0x4a6f2d=_0x4a6f2d||0x1f4;return function(_0x2512c5){logger['error'](_0x2512c5[_0x72b7('0x27')]);if(_0x2512c5[_0x72b7('0x28')]){delete _0x2512c5['name'];}_0x3f0366[_0x72b7('0x1a')](_0x4a6f2d)[_0x72b7('0x29')](_0x2512c5);};}exports[_0x72b7('0x2a')]=function(_0x502ef0,_0x41cd5a){var _0x2a0e68={},_0x3ea9db={},_0x31e928={'count':0x0,'rows':[]};var _0x274263=_[_0x72b7('0x2b')](db['ZohoAccount']['rawAttributes'],function(_0x3b2bf9){return{'name':_0x3b2bf9[_0x72b7('0x2c')],'type':_0x3b2bf9[_0x72b7('0x2d')][_0x72b7('0x2e')]};});_0x3ea9db[_0x72b7('0x2f')]=_[_0x72b7('0x2b')](_0x274263,_0x72b7('0x28'));_0x3ea9db[_0x72b7('0x30')]=_[_0x72b7('0x31')](_0x502ef0[_0x72b7('0x30')]);_0x3ea9db[_0x72b7('0x32')]=_[_0x72b7('0x33')](_0x3ea9db[_0x72b7('0x2f')],_0x3ea9db['query']);_0x2a0e68[_0x72b7('0x34')]=_[_0x72b7('0x33')](_0x3ea9db[_0x72b7('0x2f')],qs[_0x72b7('0x35')](_0x502ef0[_0x72b7('0x30')][_0x72b7('0x35')]));_0x2a0e68[_0x72b7('0x34')]=_0x2a0e68[_0x72b7('0x34')][_0x72b7('0x36')]?_0x2a0e68[_0x72b7('0x34')]:_0x3ea9db['model'];if(!_0x502ef0[_0x72b7('0x30')][_0x72b7('0x37')](_0x72b7('0x38'))){_0x2a0e68['limit']=qs[_0x72b7('0x1d')](_0x502ef0[_0x72b7('0x30')][_0x72b7('0x1d')]);_0x2a0e68[_0x72b7('0x1b')]=qs[_0x72b7('0x1b')](_0x502ef0[_0x72b7('0x30')][_0x72b7('0x1b')]);}_0x2a0e68[_0x72b7('0x39')]=qs[_0x72b7('0x3a')](_0x502ef0[_0x72b7('0x30')][_0x72b7('0x3a')]);_0x2a0e68[_0x72b7('0x3b')]=qs[_0x72b7('0x32')](_[_0x72b7('0x3c')](_0x502ef0[_0x72b7('0x30')],_0x3ea9db[_0x72b7('0x32')]),_0x274263);if(_0x502ef0[_0x72b7('0x30')]['filter']){_0x2a0e68[_0x72b7('0x3b')]=_[_0x72b7('0x3d')](_0x2a0e68['where'],{'$or':_[_0x72b7('0x2b')](_0x274263,function(_0x3b4213){if(_0x3b4213[_0x72b7('0x2d')]!==_0x72b7('0x3e')){var _0x693ad0={};_0x693ad0[_0x3b4213[_0x72b7('0x28')]]={'$like':'%'+_0x502ef0['query']['filter']+'%'};return _0x693ad0;}})});}_0x2a0e68=_[_0x72b7('0x3d')]({},_0x2a0e68,_0x502ef0['options']);var _0x74edde={'where':_0x2a0e68[_0x72b7('0x3b')]};return db[_0x72b7('0x3f')][_0x72b7('0x1e')](_0x74edde)['then'](function(_0x4db600){_0x31e928[_0x72b7('0x1e')]=_0x4db600;if(_0x502ef0[_0x72b7('0x30')][_0x72b7('0x40')]){_0x2a0e68[_0x72b7('0x41')]=[{'all':!![]}];}return db[_0x72b7('0x3f')]['findAll'](_0x2a0e68);})[_0x72b7('0x23')](function(_0x2c95a0){_0x31e928['rows']=_0x2c95a0;return _0x31e928;})[_0x72b7('0x23')](respondWithFilteredResult(_0x41cd5a,_0x2a0e68))['catch'](handleError(_0x41cd5a,null));};exports['show']=function(_0x2f756b,_0x2e2a55){var _0x2d934e={'raw':![],'where':{'id':_0x2f756b[_0x72b7('0x42')]['id']}},_0x192c01={};_0x192c01[_0x72b7('0x2f')]=_[_0x72b7('0x31')](db[_0x72b7('0x3f')][_0x72b7('0x43')]);_0x192c01['query']=_[_0x72b7('0x31')](_0x2f756b[_0x72b7('0x30')]);_0x192c01[_0x72b7('0x32')]=_[_0x72b7('0x33')](_0x192c01[_0x72b7('0x2f')],_0x192c01['query']);_0x2d934e[_0x72b7('0x34')]=_['intersection'](_0x192c01[_0x72b7('0x2f')],qs[_0x72b7('0x35')](_0x2f756b[_0x72b7('0x30')][_0x72b7('0x35')]));_0x2d934e['attributes']=_0x2d934e[_0x72b7('0x34')][_0x72b7('0x36')]?_0x2d934e[_0x72b7('0x34')]:_0x192c01[_0x72b7('0x2f')];if(_0x2f756b[_0x72b7('0x30')]['includeAll']){_0x2d934e['include']=[{'all':!![]}];}_0x2d934e=_['merge']({},_0x2d934e,_0x2f756b[_0x72b7('0x44')]);return db['ZohoAccount'][_0x72b7('0x45')](_0x2d934e)['then'](handleEntityNotFound(_0x2e2a55,null))[_0x72b7('0x23')](respondWithResult(_0x2e2a55,null))[_0x72b7('0x46')](handleError(_0x2e2a55,null));};exports[_0x72b7('0x47')]=function(_0x152135,_0xe2bab4){return db['ZohoAccount'][_0x72b7('0x47')](_0x152135[_0x72b7('0x48')],{})[_0x72b7('0x23')](respondWithResult(_0xe2bab4,0xc9))['catch'](handleError(_0xe2bab4,null));};exports[_0x72b7('0x22')]=function(_0x4191f7,_0x3edea9){if(_0x4191f7[_0x72b7('0x48')]['id']){delete _0x4191f7[_0x72b7('0x48')]['id'];}return db[_0x72b7('0x3f')][_0x72b7('0x45')]({'where':{'id':_0x4191f7[_0x72b7('0x42')]['id']}})[_0x72b7('0x23')](handleEntityNotFound(_0x3edea9,null))[_0x72b7('0x23')](saveUpdates(_0x4191f7[_0x72b7('0x48')],null))['then'](respondWithResult(_0x3edea9,null))[_0x72b7('0x46')](handleError(_0x3edea9,null));};exports[_0x72b7('0x24')]=function(_0x28171b,_0x50e75a){return db['ZohoAccount'][_0x72b7('0x45')]({'where':{'id':_0x28171b[_0x72b7('0x42')]['id']}})['then'](handleEntityNotFound(_0x50e75a,null))[_0x72b7('0x23')](removeEntity(_0x50e75a,null))['catch'](handleError(_0x50e75a,null));};exports[_0x72b7('0x49')]=function(_0xfc74e8,_0x187fbb,_0x3acfb8){var _0x5ea424={};var _0x11c6a9={};var _0x2edc01;var _0x2f6e1b;return db[_0x72b7('0x3f')][_0x72b7('0x4a')]({'where':{'id':_0xfc74e8['params']['id']}})[_0x72b7('0x23')](handleEntityNotFound(_0x187fbb,null))[_0x72b7('0x23')](function(_0x223eb9){if(_0x223eb9){_0x2edc01=_0x223eb9;_0x11c6a9[_0x72b7('0x2f')]=_[_0x72b7('0x31')](db[_0x72b7('0x4b')][_0x72b7('0x43')]);_0x11c6a9['query']=_[_0x72b7('0x31')](_0xfc74e8[_0x72b7('0x30')]);_0x11c6a9[_0x72b7('0x32')]=_[_0x72b7('0x33')](_0x11c6a9[_0x72b7('0x2f')],_0x11c6a9[_0x72b7('0x30')]);_0x5ea424[_0x72b7('0x34')]=_['intersection'](_0x11c6a9['model'],qs[_0x72b7('0x35')](_0xfc74e8['query']['fields']));_0x5ea424[_0x72b7('0x34')]=_0x5ea424[_0x72b7('0x34')][_0x72b7('0x36')]?_0x5ea424[_0x72b7('0x34')]:_0x11c6a9['model'];_0x5ea424[_0x72b7('0x39')]=qs[_0x72b7('0x3a')](_0xfc74e8['query']['sort']);_0x5ea424['where']=qs[_0x72b7('0x32')](_[_0x72b7('0x3c')](_0xfc74e8['query'],_0x11c6a9[_0x72b7('0x32')]));if(_0xfc74e8['query']['filter']){_0x5ea424[_0x72b7('0x3b')]=_['merge'](_0x5ea424[_0x72b7('0x3b')],{'$or':_[_0x72b7('0x2b')](_0x5ea424[_0x72b7('0x34')],function(_0x3f8e01){var _0x3c5fe5={};_0x3c5fe5[_0x3f8e01]={'$like':'%'+_0xfc74e8['query'][_0x72b7('0x4c')]+'%'};return _0x3c5fe5;})});}_0x5ea424=_[_0x72b7('0x3d')]({},_0x5ea424,_0xfc74e8['options']);return _0x2edc01['getConfigurations'](_0x5ea424);}})[_0x72b7('0x23')](function(_0xd69908){if(_0xd69908){_0x2f6e1b=_0xd69908[_0x72b7('0x36')];if(!_0xfc74e8[_0x72b7('0x30')][_0x72b7('0x37')](_0x72b7('0x38'))){_0x5ea424[_0x72b7('0x1d')]=qs[_0x72b7('0x1d')](_0xfc74e8['query'][_0x72b7('0x1d')]);_0x5ea424[_0x72b7('0x1b')]=qs[_0x72b7('0x1b')](_0xfc74e8[_0x72b7('0x30')][_0x72b7('0x1b')]);}return _0x2edc01[_0x72b7('0x49')](_0x5ea424);}})[_0x72b7('0x23')](function(_0x5e47a3){if(_0x5e47a3){return _0x5e47a3?{'count':_0x2f6e1b,'rows':_0x5e47a3}:null;}})['then'](respondWithResult(_0x187fbb,null))['catch'](handleError(_0x187fbb,null));};exports['addConfiguration']=function(_0x226549,_0x552735,_0x46cc5f){if(_0x226549[_0x72b7('0x48')]['id']){delete _0x226549[_0x72b7('0x48')]['id'];}return db[_0x72b7('0x3f')]['findOne']({'where':{'id':_0x226549[_0x72b7('0x42')]['id']}})['then'](handleEntityNotFound(_0x552735,null))['then'](function(_0x3882bb){if(_0x3882bb){_0x226549[_0x72b7('0x48')][_0x72b7('0x4d')]=_0x3882bb['id'];_0x226549[_0x72b7('0x48')][_0x72b7('0x4e')]=integrations['getSubjects'](_0x226549[_0x72b7('0x48')]['channel'],_0x226549[_0x72b7('0x48')][_0x72b7('0x2d')]);_0x226549[_0x72b7('0x48')][_0x72b7('0x4f')]=integrations[_0x72b7('0x50')](_0x226549[_0x72b7('0x48')]['channel'],_0x226549[_0x72b7('0x48')][_0x72b7('0x2d')]);return db[_0x72b7('0x4b')]['create'](_0x226549['body'],{'include':[{'model':db[_0x72b7('0x51')],'as':_0x72b7('0x4e')},{'model':db[_0x72b7('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x552735,null))[_0x72b7('0x46')](handleError(_0x552735,null));};function getAccessToken(_0x21c0a5){return new Promise(function(_0x25da3b,_0x32e62e){var _0x377859;switch(_0x21c0a5[_0x72b7('0x52')]){case'US':_0x377859=_0x72b7('0x53');break;case'AU':_0x377859=_0x72b7('0x54');break;case'EU':_0x377859=_0x72b7('0x55');break;case'IN':_0x377859=_0x72b7('0x56');break;case'CN':_0x377859=_0x72b7('0x57');break;default:_0x377859='https://accounts.zoho.eu';break;}var _0x4fb8b8={'method':_0x72b7('0x58'),'uri':_0x377859+_0x72b7('0x59'),'qs':{'refresh_token':_0x21c0a5['refreshToken'],'client_id':_0x21c0a5[_0x72b7('0x5a')],'client_secret':_0x21c0a5['clientSecret'],'grant_type':_0x72b7('0x5b')},'json':!![]};return rp(_0x4fb8b8)[_0x72b7('0x23')](function(_0x36ba4f){if(_0x36ba4f[_0x72b7('0x5c')]){_0x25da3b(_0x36ba4f[_0x72b7('0x5c')]);}else{_0x32e62e(_0x72b7('0x5d'));}})[_0x72b7('0x46')](function(_0x10ff5e){_0x32e62e(_0x10ff5e);});});}exports['getFields']=function(_0x26633c,_0x4ac5c4,_0x1ee476){var _0xd3158a,_0x3a52fc,_0x31e9e7,_0x21dacc,_0x395844;return db['ZohoAccount'][_0x72b7('0x4a')]({'where':{'id':_0x26633c[_0x72b7('0x42')]['id']},'attributes':['id','host',_0x72b7('0x52'),_0x72b7('0x5a'),_0x72b7('0x5e'),_0x72b7('0x5f'),'code',_0x72b7('0x60')]})[_0x72b7('0x23')](handleEntityNotFound(_0x4ac5c4,null))[_0x72b7('0x23')](function(_0x4e5f81){_0x395844=_0x4e5f81;_0xd3158a=_0x395844[_0x72b7('0x61')];_0x3a52fc=_0xd3158a===_0x72b7('0x62')?'eu':_0x72b7('0x63');_0x31e9e7=_0x395844[_0x72b7('0x5f')];var _0x34493e=_0x31e9e7[_0x72b7('0x64')](-0x1);if(_0x34493e==='/'||_0x34493e==='\x5c'||_0x34493e===':'){_0x31e9e7=_0x31e9e7[_0x72b7('0x65')](0x0,_0x31e9e7[_0x72b7('0x66')](_0x34493e));}if(!_0x395844[_0x72b7('0x60')]){throw new Error(_0x72b7('0x67'));}return getAccessToken(_0x395844);})[_0x72b7('0x23')](function(_0x1bf8d0){if(_0x1bf8d0){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x3a52fc),'qs':{'module':_0x72b7('0x68')},'headers':{'Authorization':_0x72b7('0x69')+_0x1bf8d0},'json':!![]});}})[_0x72b7('0x23')](function(_0x2180d2){if(_0x2180d2){if(_0x2180d2[_0x72b7('0x6a')]&&_0x2180d2[_0x72b7('0x6a')]['error']){throw new Error(_0x2180d2['response'][_0x72b7('0x6b')][_0x72b7('0x6c')]);}var _0x2ae66e=[];var _0x29bb2f=[];var _0x5beef4=[_0x72b7('0x6d'),_0x72b7('0x6e'),_0x72b7('0x6f'),_0x72b7('0x70'),_0x72b7('0x71'),_0x72b7('0x72'),_0x72b7('0x73'),_0x72b7('0x74')];_0x29bb2f=_['remove'](_0x2180d2[_0x72b7('0x35')],function(_0x2d8169){return _0x5beef4[_0x72b7('0x75')](_0x2d8169[_0x72b7('0x76')]);});for(var _0x259993=0x0;_0x259993<_0x29bb2f['length'];_0x259993++){if(_0x29bb2f[_0x259993][_0x72b7('0x77')]===![]){_0x2ae66e[_0x72b7('0x78')]({'id':_0x29bb2f[_0x259993]['id'],'name':_0x29bb2f[_0x259993][_0x72b7('0x79')],'custom':_0x29bb2f[_0x259993][_0x72b7('0x7a')],'options':_0x29bb2f[_0x259993][_0x72b7('0x7b')]===_0x72b7('0x7c')&&_0x29bb2f[_0x259993][_0x72b7('0x7d')][_0x72b7('0x36')]>-0x1?_['map'](_0x29bb2f[_0x259993][_0x72b7('0x7d')],function(_0x155c9b){return{'name':_0x155c9b,'value':_0x155c9b};}):[]});}}return{'count':_0x2ae66e['length'],'rows':_0x2ae66e};}else{return{'count':0x0,'rows':[]};}})[_0x72b7('0x23')](respondWithResult(_0x4ac5c4,null))[_0x72b7('0x46')](function(_0xede114){var _0x2264e4=_0x26633c[_0x72b7('0x30')]['test']?0x1f4:_0xede114[_0x72b7('0x7e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x72b7('0x7f'),_0x2264e4,JSON[_0x72b7('0x80')](_0xede114));delete _0xede114[_0x72b7('0x28')];if(_0x2264e4===0x191){_0x2264e4=0x190;}_0x4ac5c4[_0x72b7('0x1a')](_0x2264e4)[_0x72b7('0x29')](_0x26633c[_0x72b7('0x30')]['test']?{'message':_0x72b7('0x81'),'statusCode':_0xede114[_0x72b7('0x7e')]}:_0xede114);});}; \ No newline at end of file +var _0x1d74=['findAll','rows','catch','params','rawAttributes','intersection','create','body','find','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','Descriptions','channel','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','ZohoAccount','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0x1d74,0xc1));var _0x41d7=function(_0x1a32fe,_0xdab6ac){_0x1a32fe=_0x1a32fe-0x0;var _0x1abca6=_0x1d74[_0x1a32fe];return _0x1abca6;};'use strict';var emlformat=require(_0x41d7('0x0'));var rimraf=require(_0x41d7('0x1'));var zipdir=require(_0x41d7('0x2'));var jsonpatch=require(_0x41d7('0x3'));var rp=require(_0x41d7('0x4'));var moment=require(_0x41d7('0x5'));var BPromise=require(_0x41d7('0x6'));var Mustache=require(_0x41d7('0x7'));var util=require(_0x41d7('0x8'));var path=require(_0x41d7('0x9'));var sox=require('sox');var csv=require(_0x41d7('0xa'));var ejs=require(_0x41d7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41d7('0xc'));var squel=require('squel');var crypto=require(_0x41d7('0xd'));var jsforce=require(_0x41d7('0xe'));var deskjs=require(_0x41d7('0xf'));var toCsv=require(_0x41d7('0xa'));var querystring=require(_0x41d7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41d7('0x11'));var qs=require(_0x41d7('0x12'));var as=require(_0x41d7('0x13'));var hardwareService=require(_0x41d7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x41d7('0x15'));var config=require(_0x41d7('0x16'));var licenseUtil=require(_0x41d7('0x17'));var db=require(_0x41d7('0x18'))['db'];var integrations=require(_0x41d7('0x19'));function respondWithStatusCode(_0x5b70c0,_0x4d2f88){_0x4d2f88=_0x4d2f88||0xcc;return function(_0x4cc578){if(_0x4cc578){return _0x5b70c0[_0x41d7('0x1a')](_0x4d2f88);}return _0x5b70c0[_0x41d7('0x1b')](_0x4d2f88)[_0x41d7('0x1c')]();};}function respondWithResult(_0x1674fb,_0x2139af){_0x2139af=_0x2139af||0xc8;return function(_0x309643){if(_0x309643){return _0x1674fb['status'](_0x2139af)[_0x41d7('0x1d')](_0x309643);}};}function respondWithFilteredResult(_0x3b4c3a,_0x543c63){return function(_0x31a04a){if(_0x31a04a){var _0x248a93=typeof _0x543c63[_0x41d7('0x1e')]===_0x41d7('0x1f')&&typeof _0x543c63[_0x41d7('0x20')]===_0x41d7('0x1f');var _0x160377=_0x31a04a[_0x41d7('0x21')];var _0x1c6dae=_0x248a93?0x0:_0x543c63[_0x41d7('0x1e')];var _0x477120=_0x248a93?_0x31a04a[_0x41d7('0x21')]:_0x543c63[_0x41d7('0x1e')]+_0x543c63['limit'];var _0x15bbd7;if(_0x477120>=_0x160377){_0x477120=_0x160377;_0x15bbd7=0xc8;}else{_0x15bbd7=0xce;}_0x3b4c3a[_0x41d7('0x1b')](_0x15bbd7);return _0x3b4c3a[_0x41d7('0x22')]('Content-Range',_0x1c6dae+'-'+_0x477120+'/'+_0x160377)['json'](_0x31a04a);}return null;};}function patchUpdates(_0x5ac0af){return function(_0x1ca1a4){try{jsonpatch[_0x41d7('0x23')](_0x1ca1a4,_0x5ac0af,!![]);}catch(_0x3baf97){return BPromise['reject'](_0x3baf97);}return _0x1ca1a4[_0x41d7('0x24')]();};}function saveUpdates(_0x4ac97d,_0x208423){return function(_0x35dd83){if(_0x35dd83){return _0x35dd83[_0x41d7('0x25')](_0x4ac97d)[_0x41d7('0x26')](function(_0x33599a){return _0x33599a;});}return null;};}function removeEntity(_0x3e1cc3,_0x3f924c){return function(_0x423e9e){if(_0x423e9e){return _0x423e9e[_0x41d7('0x27')]()['then'](function(){_0x3e1cc3['status'](0xcc)[_0x41d7('0x1c')]();});}};}function handleEntityNotFound(_0xe3f385,_0x980d54){return function(_0x1b73aa){if(!_0x1b73aa){_0xe3f385['sendStatus'](0x194);}return _0x1b73aa;};}function handleError(_0x75cb5,_0x594281){_0x594281=_0x594281||0x1f4;return function(_0x2ffcbd){logger[_0x41d7('0x28')](_0x2ffcbd[_0x41d7('0x29')]);if(_0x2ffcbd[_0x41d7('0x2a')]){delete _0x2ffcbd[_0x41d7('0x2a')];}_0x75cb5[_0x41d7('0x1b')](_0x594281)['send'](_0x2ffcbd);};}exports[_0x41d7('0x2b')]=function(_0x435870,_0xe4324e){var _0x41ef66={},_0x41bb42={},_0x397db1={'count':0x0,'rows':[]};var _0x3e54b8=_['map'](db[_0x41d7('0x2c')]['rawAttributes'],function(_0x5a465a){return{'name':_0x5a465a[_0x41d7('0x2d')],'type':_0x5a465a[_0x41d7('0x2e')][_0x41d7('0x2f')]};});_0x41bb42[_0x41d7('0x30')]=_[_0x41d7('0x31')](_0x3e54b8,_0x41d7('0x2a'));_0x41bb42[_0x41d7('0x32')]=_[_0x41d7('0x33')](_0x435870[_0x41d7('0x32')]);_0x41bb42[_0x41d7('0x34')]=_['intersection'](_0x41bb42[_0x41d7('0x30')],_0x41bb42['query']);_0x41ef66[_0x41d7('0x35')]=_['intersection'](_0x41bb42['model'],qs[_0x41d7('0x36')](_0x435870[_0x41d7('0x32')]['fields']));_0x41ef66[_0x41d7('0x35')]=_0x41ef66[_0x41d7('0x35')][_0x41d7('0x37')]?_0x41ef66[_0x41d7('0x35')]:_0x41bb42[_0x41d7('0x30')];if(!_0x435870[_0x41d7('0x32')][_0x41d7('0x38')](_0x41d7('0x39'))){_0x41ef66[_0x41d7('0x20')]=qs[_0x41d7('0x20')](_0x435870['query'][_0x41d7('0x20')]);_0x41ef66[_0x41d7('0x1e')]=qs['offset'](_0x435870[_0x41d7('0x32')]['offset']);}_0x41ef66['order']=qs[_0x41d7('0x3a')](_0x435870[_0x41d7('0x32')][_0x41d7('0x3a')]);_0x41ef66[_0x41d7('0x3b')]=qs['filters'](_[_0x41d7('0x3c')](_0x435870[_0x41d7('0x32')],_0x41bb42[_0x41d7('0x34')]),_0x3e54b8);if(_0x435870[_0x41d7('0x32')]['filter']){_0x41ef66[_0x41d7('0x3b')]=_[_0x41d7('0x3d')](_0x41ef66[_0x41d7('0x3b')],{'$or':_[_0x41d7('0x31')](_0x3e54b8,function(_0x5d82eb){if(_0x5d82eb['type']!==_0x41d7('0x3e')){var _0x22ae79={};_0x22ae79[_0x5d82eb[_0x41d7('0x2a')]]={'$like':'%'+_0x435870['query'][_0x41d7('0x3f')]+'%'};return _0x22ae79;}})});}_0x41ef66=_[_0x41d7('0x3d')]({},_0x41ef66,_0x435870[_0x41d7('0x40')]);var _0x561245={'where':_0x41ef66['where']};return db[_0x41d7('0x2c')]['count'](_0x561245)[_0x41d7('0x26')](function(_0x4443ac){_0x397db1[_0x41d7('0x21')]=_0x4443ac;if(_0x435870[_0x41d7('0x32')][_0x41d7('0x41')]){_0x41ef66[_0x41d7('0x42')]=[{'all':!![]}];}return db[_0x41d7('0x2c')][_0x41d7('0x43')](_0x41ef66);})[_0x41d7('0x26')](function(_0x449a8a){_0x397db1[_0x41d7('0x44')]=_0x449a8a;return _0x397db1;})[_0x41d7('0x26')](respondWithFilteredResult(_0xe4324e,_0x41ef66))[_0x41d7('0x45')](handleError(_0xe4324e,null));};exports['show']=function(_0x4f00a1,_0x5b3497){var _0x190c7f={'raw':![],'where':{'id':_0x4f00a1[_0x41d7('0x46')]['id']}},_0xb5b69b={};_0xb5b69b[_0x41d7('0x30')]=_[_0x41d7('0x33')](db['ZohoAccount'][_0x41d7('0x47')]);_0xb5b69b[_0x41d7('0x32')]=_[_0x41d7('0x33')](_0x4f00a1[_0x41d7('0x32')]);_0xb5b69b[_0x41d7('0x34')]=_[_0x41d7('0x48')](_0xb5b69b['model'],_0xb5b69b[_0x41d7('0x32')]);_0x190c7f[_0x41d7('0x35')]=_['intersection'](_0xb5b69b[_0x41d7('0x30')],qs['fields'](_0x4f00a1[_0x41d7('0x32')][_0x41d7('0x36')]));_0x190c7f[_0x41d7('0x35')]=_0x190c7f[_0x41d7('0x35')][_0x41d7('0x37')]?_0x190c7f['attributes']:_0xb5b69b['model'];if(_0x4f00a1[_0x41d7('0x32')][_0x41d7('0x41')]){_0x190c7f[_0x41d7('0x42')]=[{'all':!![]}];}_0x190c7f=_[_0x41d7('0x3d')]({},_0x190c7f,_0x4f00a1[_0x41d7('0x40')]);return db[_0x41d7('0x2c')]['find'](_0x190c7f)[_0x41d7('0x26')](handleEntityNotFound(_0x5b3497,null))[_0x41d7('0x26')](respondWithResult(_0x5b3497,null))[_0x41d7('0x45')](handleError(_0x5b3497,null));};exports[_0x41d7('0x49')]=function(_0x2e312b,_0x261c3f){return db[_0x41d7('0x2c')]['create'](_0x2e312b[_0x41d7('0x4a')],{})[_0x41d7('0x26')](respondWithResult(_0x261c3f,0xc9))[_0x41d7('0x45')](handleError(_0x261c3f,null));};exports[_0x41d7('0x25')]=function(_0x598852,_0x4a4aff){if(_0x598852[_0x41d7('0x4a')]['id']){delete _0x598852[_0x41d7('0x4a')]['id'];}return db[_0x41d7('0x2c')][_0x41d7('0x4b')]({'where':{'id':_0x598852['params']['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x4a4aff,null))[_0x41d7('0x26')](saveUpdates(_0x598852[_0x41d7('0x4a')],null))['then'](respondWithResult(_0x4a4aff,null))[_0x41d7('0x45')](handleError(_0x4a4aff,null));};exports[_0x41d7('0x27')]=function(_0xc63ed7,_0x5aec24){return db['ZohoAccount']['find']({'where':{'id':_0xc63ed7[_0x41d7('0x46')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x5aec24,null))['then'](removeEntity(_0x5aec24,null))[_0x41d7('0x45')](handleError(_0x5aec24,null));};exports[_0x41d7('0x4c')]=function(_0x5ca74d,_0x5899a7,_0x97e3a6){var _0x40b39a={};var _0x5949d0={};var _0x3fb2ae;var _0x1d48c2;return db['ZohoAccount'][_0x41d7('0x4d')]({'where':{'id':_0x5ca74d[_0x41d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x5899a7,null))[_0x41d7('0x26')](function(_0x413868){if(_0x413868){_0x3fb2ae=_0x413868;_0x5949d0['model']=_[_0x41d7('0x33')](db['ZohoConfiguration'][_0x41d7('0x47')]);_0x5949d0['query']=_[_0x41d7('0x33')](_0x5ca74d[_0x41d7('0x32')]);_0x5949d0['filters']=_[_0x41d7('0x48')](_0x5949d0[_0x41d7('0x30')],_0x5949d0['query']);_0x40b39a[_0x41d7('0x35')]=_[_0x41d7('0x48')](_0x5949d0['model'],qs['fields'](_0x5ca74d[_0x41d7('0x32')]['fields']));_0x40b39a[_0x41d7('0x35')]=_0x40b39a[_0x41d7('0x35')]['length']?_0x40b39a[_0x41d7('0x35')]:_0x5949d0[_0x41d7('0x30')];_0x40b39a['order']=qs['sort'](_0x5ca74d[_0x41d7('0x32')][_0x41d7('0x3a')]);_0x40b39a[_0x41d7('0x3b')]=qs[_0x41d7('0x34')](_['pick'](_0x5ca74d['query'],_0x5949d0[_0x41d7('0x34')]));if(_0x5ca74d[_0x41d7('0x32')]['filter']){_0x40b39a[_0x41d7('0x3b')]=_[_0x41d7('0x3d')](_0x40b39a['where'],{'$or':_[_0x41d7('0x31')](_0x40b39a[_0x41d7('0x35')],function(_0x2530f2){var _0x45a5b2={};_0x45a5b2[_0x2530f2]={'$like':'%'+_0x5ca74d[_0x41d7('0x32')][_0x41d7('0x3f')]+'%'};return _0x45a5b2;})});}_0x40b39a=_[_0x41d7('0x3d')]({},_0x40b39a,_0x5ca74d['options']);return _0x3fb2ae[_0x41d7('0x4c')](_0x40b39a);}})['then'](function(_0x3fecb8){if(_0x3fecb8){_0x1d48c2=_0x3fecb8[_0x41d7('0x37')];if(!_0x5ca74d[_0x41d7('0x32')][_0x41d7('0x38')](_0x41d7('0x39'))){_0x40b39a[_0x41d7('0x20')]=qs[_0x41d7('0x20')](_0x5ca74d[_0x41d7('0x32')][_0x41d7('0x20')]);_0x40b39a[_0x41d7('0x1e')]=qs[_0x41d7('0x1e')](_0x5ca74d[_0x41d7('0x32')][_0x41d7('0x1e')]);}return _0x3fb2ae['getConfigurations'](_0x40b39a);}})[_0x41d7('0x26')](function(_0x6706db){if(_0x6706db){return _0x6706db?{'count':_0x1d48c2,'rows':_0x6706db}:null;}})['then'](respondWithResult(_0x5899a7,null))[_0x41d7('0x45')](handleError(_0x5899a7,null));};exports[_0x41d7('0x4e')]=function(_0x25d24a,_0x56118e,_0x433986){if(_0x25d24a[_0x41d7('0x4a')]['id']){delete _0x25d24a['body']['id'];}return db['ZohoAccount'][_0x41d7('0x4d')]({'where':{'id':_0x25d24a[_0x41d7('0x46')]['id']}})[_0x41d7('0x26')](handleEntityNotFound(_0x56118e,null))[_0x41d7('0x26')](function(_0x88cff3){if(_0x88cff3){_0x25d24a[_0x41d7('0x4a')]['AccountId']=_0x88cff3['id'];_0x25d24a[_0x41d7('0x4a')][_0x41d7('0x4f')]=integrations[_0x41d7('0x50')](_0x25d24a[_0x41d7('0x4a')]['channel'],_0x25d24a['body'][_0x41d7('0x2e')]);_0x25d24a[_0x41d7('0x4a')][_0x41d7('0x51')]=integrations['getDescriptions'](_0x25d24a[_0x41d7('0x4a')][_0x41d7('0x52')],_0x25d24a[_0x41d7('0x4a')][_0x41d7('0x2e')]);return db['ZohoConfiguration'][_0x41d7('0x49')](_0x25d24a[_0x41d7('0x4a')],{'include':[{'model':db[_0x41d7('0x53')],'as':_0x41d7('0x4f')},{'model':db[_0x41d7('0x53')],'as':'Descriptions'}]});}return null;})[_0x41d7('0x26')](respondWithResult(_0x56118e,null))['catch'](handleError(_0x56118e,null));};function getAccessToken(_0x249765){return new Promise(function(_0x1da5cc,_0x2168d1){var _0x53f174;switch(_0x249765['zone']){case'US':_0x53f174='https://accounts.zoho.com';break;case'AU':_0x53f174=_0x41d7('0x54');break;case'EU':_0x53f174='https://accounts.zoho.eu';break;case'IN':_0x53f174=_0x41d7('0x55');break;case'CN':_0x53f174=_0x41d7('0x56');break;default:_0x53f174=_0x41d7('0x57');break;}var _0x424cea={'method':'POST','uri':_0x53f174+'/oauth/v2/token','qs':{'refresh_token':_0x249765[_0x41d7('0x58')],'client_id':_0x249765['clientId'],'client_secret':_0x249765[_0x41d7('0x59')],'grant_type':_0x41d7('0x5a')},'json':!![]};return rp(_0x424cea)['then'](function(_0x54e8b7){if(_0x54e8b7[_0x41d7('0x5b')]){_0x1da5cc(_0x54e8b7[_0x41d7('0x5b')]);}else{_0x2168d1(_0x41d7('0x5c'));}})[_0x41d7('0x45')](function(_0x4b0a55){_0x2168d1(_0x4b0a55);});});}exports[_0x41d7('0x5d')]=function(_0x1fc02b,_0x49aba2,_0x4ec4a1){var _0x63aff,_0x4b1e84,_0xb439e4,_0x4174e8,_0x535169;return db[_0x41d7('0x2c')][_0x41d7('0x4d')]({'where':{'id':_0x1fc02b[_0x41d7('0x46')]['id']},'attributes':['id',_0x41d7('0x5e'),_0x41d7('0x5f'),'clientId','clientSecret',_0x41d7('0x60'),_0x41d7('0x61'),_0x41d7('0x58')]})[_0x41d7('0x26')](handleEntityNotFound(_0x49aba2,null))[_0x41d7('0x26')](function(_0xf824c){_0x535169=_0xf824c;_0x63aff=_0x535169[_0x41d7('0x5e')];_0x4b1e84=_0x63aff===_0x41d7('0x62')?'eu':_0x41d7('0x63');_0xb439e4=_0x535169[_0x41d7('0x60')];var _0x1e57aa=_0xb439e4[_0x41d7('0x64')](-0x1);if(_0x1e57aa==='/'||_0x1e57aa==='\x5c'||_0x1e57aa===':'){_0xb439e4=_0xb439e4['substring'](0x0,_0xb439e4[_0x41d7('0x65')](_0x1e57aa));}if(!_0x535169[_0x41d7('0x58')]){throw new Error(_0x41d7('0x66'));}return getAccessToken(_0x535169);})[_0x41d7('0x26')](function(_0x43aff2){if(_0x43aff2){return rp({'method':_0x41d7('0x67'),'uri':util['format'](_0x41d7('0x68'),_0x4b1e84),'qs':{'module':_0x41d7('0x69')},'headers':{'Authorization':_0x41d7('0x6a')+_0x43aff2},'json':!![]});}})[_0x41d7('0x26')](function(_0x32271b){if(_0x32271b){if(_0x32271b[_0x41d7('0x6b')]&&_0x32271b[_0x41d7('0x6b')][_0x41d7('0x28')]){throw new Error(_0x32271b[_0x41d7('0x6b')][_0x41d7('0x28')][_0x41d7('0x6c')]);}var _0x5d35a0=[];var _0x497af0=[];var _0x16fbfe=[_0x41d7('0x6d'),_0x41d7('0x6e'),_0x41d7('0x6f'),_0x41d7('0x70'),_0x41d7('0x71'),_0x41d7('0x72'),_0x41d7('0x73'),_0x41d7('0x74')];_0x497af0=_[_0x41d7('0x75')](_0x32271b['fields'],function(_0x2f8111){return _0x16fbfe[_0x41d7('0x76')](_0x2f8111['api_name']);});for(var _0x3d307c=0x0;_0x3d307c<_0x497af0[_0x41d7('0x37')];_0x3d307c++){if(_0x497af0[_0x3d307c][_0x41d7('0x77')]===![]){_0x5d35a0[_0x41d7('0x78')]({'id':_0x497af0[_0x3d307c]['id'],'name':_0x497af0[_0x3d307c][_0x41d7('0x79')],'custom':_0x497af0[_0x3d307c]['custom_field'],'options':_0x497af0[_0x3d307c][_0x41d7('0x7a')]===_0x41d7('0x7b')&&_0x497af0[_0x3d307c][_0x41d7('0x7c')][_0x41d7('0x37')]>-0x1?_[_0x41d7('0x31')](_0x497af0[_0x3d307c][_0x41d7('0x7c')],function(_0x3cd1e8){return{'name':_0x3cd1e8,'value':_0x3cd1e8};}):[]});}}return{'count':_0x5d35a0[_0x41d7('0x37')],'rows':_0x5d35a0};}else{return{'count':0x0,'rows':[]};}})[_0x41d7('0x26')](respondWithResult(_0x49aba2,null))[_0x41d7('0x45')](function(_0x3506ca){var _0x1058a7=_0x1fc02b['query'][_0x41d7('0x7d')]?0x1f4:_0x3506ca[_0x41d7('0x7e')]||0x1f4;logger[_0x41d7('0x28')](_0x41d7('0x7f'),_0x41d7('0x5d'),_0x1058a7,JSON[_0x41d7('0x80')](_0x3506ca));delete _0x3506ca[_0x41d7('0x2a')];if(_0x1058a7===0x191){_0x1058a7=0x190;}_0x49aba2[_0x41d7('0x1b')](_0x1058a7)['send'](_0x1fc02b[_0x41d7('0x32')][_0x41d7('0x7d')]?{'message':_0x41d7('0x81'),'statusCode':_0x3506ca[_0x41d7('0x7e')]}:_0x3506ca);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index cff58f8..7278daf 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 _0xeb1c=['define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','info','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.in','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','util','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xeb1c,0x17e));var _0xceb1=function(_0x28f6ec,_0x538bbf){_0x28f6ec=_0x28f6ec-0x0;var _0x1e0c7b=_0xeb1c[_0x28f6ec];return _0x1e0c7b;};'use strict';var _=require('lodash');var util=require(_0xceb1('0x0'));var logger=require('../../config/logger')(_0xceb1('0x1'));var moment=require('moment');var BPromise=require(_0xceb1('0x2'));var rp=require(_0xceb1('0x3'));var fs=require('fs');var path=require(_0xceb1('0x4'));var rimraf=require(_0xceb1('0x5'));var config=require('../../config/environment');var attributes=require(_0xceb1('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xceb1('0x7')]=function(_0x155130,_0x286021){return _0x155130[_0xceb1('0x8')]('ZohoAccount',attributes,{'tableName':_0xceb1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2098dc,_0x1cd63e,_0x3647fa){if(_0x2098dc[_0xceb1('0xa')]('zone')||_0x2098dc[_0xceb1('0xa')](_0xceb1('0xb'))||_0x2098dc[_0xceb1('0xa')](_0xceb1('0xc'))||_0x2098dc[_0xceb1('0xa')](_0xceb1('0xd'))||_0x2098dc[_0xceb1('0xa')]('code')||_0x2098dc[_0xceb1('0xa')]('host')){var _0x23ab2b,_0x24c44d;_0x23ab2b=_0x2098dc[_0xceb1('0xb')];var _0x7f1c5b=_0x23ab2b['slice'](-0x1);if(_0x7f1c5b==='/'||_0x7f1c5b==='\x5c'||_0x7f1c5b===':'){_0x23ab2b=_0x23ab2b['substring'](0x0,_0x23ab2b[_0xceb1('0xe')](_0x7f1c5b));}switch(_0x2098dc[_0xceb1('0xf')]){case'US':_0x24c44d='https://accounts.zoho.com';break;case'AU':_0x24c44d=_0xceb1('0x10');break;case'IN':_0x24c44d='https://accounts.zoho.in';break;case'CN':_0x24c44d=_0xceb1('0x11');break;default:_0x24c44d=_0xceb1('0x12');break;}var _0x53ecea={'method':_0xceb1('0x13'),'uri':_0x24c44d+_0xceb1('0x14'),'form':{'grant_type':_0xceb1('0x15'),'client_id':_0x2098dc[_0xceb1('0xc')],'client_secret':_0x2098dc['clientSecret'],'redirect_uri':_0x2098dc[_0xceb1('0xb')],'code':_0x2098dc[_0xceb1('0x16')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x53ecea)[_0xceb1('0x17')](function(_0x396457){var _0x2f79ff=JSON[_0xceb1('0x18')](_0x396457);if(_0x2f79ff[_0xceb1('0x19')]){_0x2098dc['refreshToken']=_0x2f79ff[_0xceb1('0x19')];logger[_0xceb1('0x1a')](util[_0xceb1('0x1b')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2098dc['name'],_0x2098dc['id']));}else{logger[_0xceb1('0x1c')](util[_0xceb1('0x1b')](_0xceb1('0x1d'),_0x2098dc[_0xceb1('0x1e')],_0x2098dc['id']),util[_0xceb1('0x1f')](_0x2f79ff,{'showHidden':![],'depth':null}));}return _0x3647fa(null,_0x1cd63e);})[_0xceb1('0x20')](function(_0x451486){logger['error'](util[_0xceb1('0x1b')](_0xceb1('0x1d'),_0x2098dc[_0xceb1('0x1e')],_0x2098dc['id']),util[_0xceb1('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x3647fa(_0x451486);});}else{return _0x3647fa(null,_0x1cd63e);}},'beforeUpdate':function(_0x5bac66,_0xe7171b,_0x5673d3){if(_0x5bac66[_0xceb1('0xa')](_0xceb1('0xf'))||_0x5bac66[_0xceb1('0xa')](_0xceb1('0xb'))||_0x5bac66[_0xceb1('0xa')]('clientId')||_0x5bac66[_0xceb1('0xa')](_0xceb1('0xd'))||_0x5bac66[_0xceb1('0xa')]('code')||_0x5bac66['changed'](_0xceb1('0x21'))){var _0x4088ef,_0x2f7e5b;_0x4088ef=_0x5bac66[_0xceb1('0xb')];var _0x49e4e7=_0x4088ef[_0xceb1('0x22')](-0x1);if(_0x49e4e7==='/'||_0x49e4e7==='\x5c'||_0x49e4e7===':'){_0x4088ef=_0x4088ef[_0xceb1('0x23')](0x0,_0x4088ef[_0xceb1('0xe')](_0x49e4e7));}switch(_0x5bac66[_0xceb1('0xf')]){case'US':_0x2f7e5b=_0xceb1('0x24');break;case'AU':_0x2f7e5b=_0xceb1('0x10');break;case'IN':_0x2f7e5b=_0xceb1('0x25');break;case'CN':_0x2f7e5b='https://accounts.zoho.com.cn';break;default:_0x2f7e5b=_0xceb1('0x12');break;}var _0x3a0e31={'method':_0xceb1('0x13'),'uri':_0x2f7e5b+_0xceb1('0x14'),'form':{'grant_type':_0xceb1('0x15'),'client_id':_0x5bac66['clientId'],'client_secret':_0x5bac66[_0xceb1('0xd')],'redirect_uri':_0x5bac66['serverUrl'],'code':_0x5bac66[_0xceb1('0x16')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3a0e31)[_0xceb1('0x17')](function(_0x30e60e){var _0x2dcd62=JSON[_0xceb1('0x18')](_0x30e60e);if(_0x2dcd62['refresh_token']){_0x5bac66['refreshToken']=_0x2dcd62[_0xceb1('0x19')];logger[_0xceb1('0x1a')](util[_0xceb1('0x1b')](_0xceb1('0x26'),_0x5bac66[_0xceb1('0x1e')],_0x5bac66['id']));}else{logger[_0xceb1('0x1c')](util[_0xceb1('0x1b')](_0xceb1('0x1d'),_0x5bac66[_0xceb1('0x1e')],_0x5bac66['id']),util['inspect'](_0x2dcd62,{'showHidden':![],'depth':null}));}return _0x5673d3(null,_0xe7171b);})['catch'](function(_0x1f552a){logger[_0xceb1('0x1c')](util[_0xceb1('0x1b')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5bac66['name'],_0x5bac66['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5673d3(_0x1f552a);});}else{return _0x5673d3(null,_0xe7171b);}}}});}; \ No newline at end of file +var _0x96be=['substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','application/x-www-form-urlencoded','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','slice'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96be,0x127));var _0xe96b=function(_0x4687d4,_0x1c74aa){_0x4687d4=_0x4687d4-0x0;var _0x267670=_0x96be[_0x4687d4];return _0x267670;};'use strict';var _=require(_0xe96b('0x0'));var util=require(_0xe96b('0x1'));var logger=require(_0xe96b('0x2'))(_0xe96b('0x3'));var moment=require('moment');var BPromise=require(_0xe96b('0x4'));var rp=require(_0xe96b('0x5'));var fs=require('fs');var path=require(_0xe96b('0x6'));var rimraf=require(_0xe96b('0x7'));var config=require(_0xe96b('0x8'));var attributes=require(_0xe96b('0x9'));var integrations=require(_0xe96b('0xa'));module['exports']=function(_0x41cb9d,_0x290f59){return _0x41cb9d[_0xe96b('0xb')](_0xe96b('0xc'),attributes,{'tableName':_0xe96b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5eacae,_0x434799,_0x5dd01a){if(_0x5eacae[_0xe96b('0xe')]('zone')||_0x5eacae[_0xe96b('0xe')]('serverUrl')||_0x5eacae[_0xe96b('0xe')](_0xe96b('0xf'))||_0x5eacae[_0xe96b('0xe')](_0xe96b('0x10'))||_0x5eacae[_0xe96b('0xe')]('code')||_0x5eacae['changed'](_0xe96b('0x11'))){var _0x2b07ec,_0x4855a0;_0x2b07ec=_0x5eacae[_0xe96b('0x12')];var _0x358697=_0x2b07ec[_0xe96b('0x13')](-0x1);if(_0x358697==='/'||_0x358697==='\x5c'||_0x358697===':'){_0x2b07ec=_0x2b07ec[_0xe96b('0x14')](0x0,_0x2b07ec[_0xe96b('0x15')](_0x358697));}switch(_0x5eacae[_0xe96b('0x16')]){case'US':_0x4855a0=_0xe96b('0x17');break;case'AU':_0x4855a0=_0xe96b('0x18');break;case'IN':_0x4855a0=_0xe96b('0x19');break;case'CN':_0x4855a0=_0xe96b('0x1a');break;default:_0x4855a0=_0xe96b('0x1b');break;}var _0x540652={'method':_0xe96b('0x1c'),'uri':_0x4855a0+_0xe96b('0x1d'),'form':{'grant_type':_0xe96b('0x1e'),'client_id':_0x5eacae['clientId'],'client_secret':_0x5eacae[_0xe96b('0x10')],'redirect_uri':_0x5eacae[_0xe96b('0x12')],'code':_0x5eacae[_0xe96b('0x1f')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x540652)[_0xe96b('0x20')](function(_0x54e061){var _0x429ded=JSON[_0xe96b('0x21')](_0x54e061);if(_0x429ded[_0xe96b('0x22')]){_0x5eacae[_0xe96b('0x23')]=_0x429ded[_0xe96b('0x22')];logger[_0xe96b('0x24')](util[_0xe96b('0x25')](_0xe96b('0x26'),_0x5eacae[_0xe96b('0x27')],_0x5eacae['id']));}else{logger[_0xe96b('0x28')](util[_0xe96b('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5eacae[_0xe96b('0x27')],_0x5eacae['id']),util[_0xe96b('0x29')](_0x429ded,{'showHidden':![],'depth':null}));}return _0x5dd01a(null,_0x434799);})[_0xe96b('0x2a')](function(_0x8ba80d){logger['error'](util[_0xe96b('0x25')](_0xe96b('0x2b'),_0x5eacae[_0xe96b('0x27')],_0x5eacae['id']),util[_0xe96b('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x5dd01a(_0x8ba80d);});}else{return _0x5dd01a(null,_0x434799);}},'beforeUpdate':function(_0x55c951,_0x34fc93,_0x5f0a6c){if(_0x55c951[_0xe96b('0xe')](_0xe96b('0x16'))||_0x55c951[_0xe96b('0xe')](_0xe96b('0x12'))||_0x55c951[_0xe96b('0xe')]('clientId')||_0x55c951[_0xe96b('0xe')](_0xe96b('0x10'))||_0x55c951[_0xe96b('0xe')](_0xe96b('0x1f'))||_0x55c951['changed'](_0xe96b('0x11'))){var _0x1a4f5c,_0x5e6dbc;_0x1a4f5c=_0x55c951[_0xe96b('0x12')];var _0x611846=_0x1a4f5c[_0xe96b('0x13')](-0x1);if(_0x611846==='/'||_0x611846==='\x5c'||_0x611846===':'){_0x1a4f5c=_0x1a4f5c[_0xe96b('0x14')](0x0,_0x1a4f5c[_0xe96b('0x15')](_0x611846));}switch(_0x55c951[_0xe96b('0x16')]){case'US':_0x5e6dbc='https://accounts.zoho.com';break;case'AU':_0x5e6dbc='https://accounts.zoho.com.au';break;case'IN':_0x5e6dbc='https://accounts.zoho.in';break;case'CN':_0x5e6dbc='https://accounts.zoho.com.cn';break;default:_0x5e6dbc=_0xe96b('0x1b');break;}var _0x2a28e6={'method':_0xe96b('0x1c'),'uri':_0x5e6dbc+_0xe96b('0x1d'),'form':{'grant_type':_0xe96b('0x1e'),'client_id':_0x55c951[_0xe96b('0xf')],'client_secret':_0x55c951[_0xe96b('0x10')],'redirect_uri':_0x55c951[_0xe96b('0x12')],'code':_0x55c951[_0xe96b('0x1f')]},'headers':{'Content-Type':_0xe96b('0x2c')}};return rp(_0x2a28e6)[_0xe96b('0x20')](function(_0x322139){var _0x5c9c07=JSON[_0xe96b('0x21')](_0x322139);if(_0x5c9c07[_0xe96b('0x22')]){_0x55c951[_0xe96b('0x23')]=_0x5c9c07['refresh_token'];logger[_0xe96b('0x24')](util[_0xe96b('0x25')](_0xe96b('0x26'),_0x55c951[_0xe96b('0x27')],_0x55c951['id']));}else{logger[_0xe96b('0x28')](util[_0xe96b('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x55c951[_0xe96b('0x27')],_0x55c951['id']),util[_0xe96b('0x29')](_0x5c9c07,{'showHidden':![],'depth':null}));}return _0x5f0a6c(null,_0x34fc93);})['catch'](function(_0x1c5d00){logger['error'](util[_0xe96b('0x25')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x55c951[_0xe96b('0x27')],_0x55c951['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5f0a6c(_0x1c5d00);});}else{return _0x5f0a6c(null,_0x34fc93);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index a048bec..0049bb8 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 _0xf79e=['message','result','catch','GetZohoAccount','findAll','options','attributes','limit','include','map','model','ShowZohoAccount','ZohoAccount','raw','where','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5583e9,_0x1847d3){var _0x253c77=function(_0x5d5259){while(--_0x5d5259){_0x5583e9['push'](_0x5583e9['shift']());}};_0x253c77(++_0x1847d3);}(_0xf79e,0x185));var _0xef79=function(_0x4027da,_0x5c66fc){_0x4027da=_0x4027da-0x0;var _0x449636=_0xf79e[_0x4027da];return _0x449636;};'use strict';var _=require('lodash');var util=require(_0xef79('0x0'));var moment=require(_0xef79('0x1'));var BPromise=require(_0xef79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef79('0x3'));var db=require(_0xef79('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xef79('0x5'));var config=require(_0xef79('0x6'));var jayson=require(_0xef79('0x7'));var client=jayson[_0xef79('0x8')][_0xef79('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa668,_0x49d0ea,_0x1e7443){return new BPromise(function(_0x4a8de0,_0x33b384){return client[_0xef79('0xa')](_0x2fa668,_0x1e7443)['then'](function(_0x42dee6){logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));logger[_0xef79('0xe')](_0xef79('0xf'),_0x49d0ea,_0xef79('0xd'),JSON[_0xef79('0x10')](_0x42dee6));if(_0x42dee6['error']){if(_0x42dee6[_0xef79('0x11')][_0xef79('0x12')]===0x1f4){logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);return _0x33b384(_0x42dee6[_0xef79('0x11')][_0xef79('0x13')]);}logger[_0xef79('0x11')](_0xef79('0xc'),_0x49d0ea,_0x42dee6['error']['message']);return _0x4a8de0(_0x42dee6['error']['message']);}else{logger[_0xef79('0xb')](_0xef79('0xc'),_0x49d0ea,_0xef79('0xd'));_0x4a8de0(_0x42dee6[_0xef79('0x14')]['message']);}})[_0xef79('0x15')](function(_0x6a689c){logger['error'](_0xef79('0xc'),_0x49d0ea,_0x6a689c);_0x33b384(_0x6a689c);});});}exports[_0xef79('0x16')]=function(_0x249a8c){var _0x406ca2=this;return new Promise(function(_0x55492c,_0x276b8b){return db['ZohoAccount'][_0xef79('0x17')]({'raw':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x249a8c[_0xef79('0x18')]?_0x249a8c[_0xef79('0x18')]['where']||null:null,'attributes':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x19')]||null:null,'limit':_0x249a8c['options']?_0x249a8c[_0xef79('0x18')][_0xef79('0x1a')]||null:null,'include':_0x249a8c[_0xef79('0x18')]?_0x249a8c['options'][_0xef79('0x1b')]?_['map'](_0x249a8c['options'][_0xef79('0x1b')],function(_0x196672){return{'model':db[_0x196672['model']],'as':_0x196672['as'],'attributes':_0x196672[_0xef79('0x19')],'include':_0x196672[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x196672[_0xef79('0x1b')],function(_0x5b4017){return{'model':db[_0x5b4017[_0xef79('0x1d')]],'as':_0x5b4017['as'],'attributes':_0x5b4017[_0xef79('0x19')],'include':_0x5b4017[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x5b4017['include'],function(_0x38ec60){return{'model':db[_0x38ec60['model']],'as':_0x38ec60['as'],'attributes':_0x38ec60[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102d6f){logger[_0xef79('0xb')](_0xef79('0x16'),_0x249a8c);logger[_0xef79('0xe')](_0xef79('0x16'),_0x249a8c,JSON[_0xef79('0x10')](_0x102d6f));_0x55492c(_0x102d6f);})[_0xef79('0x15')](function(_0x2e3bbf){logger['error'](_0xef79('0x16'),_0x2e3bbf['message'],_0x249a8c);_0x276b8b(_0x406ca2[_0xef79('0x11')](0x1f4,_0x2e3bbf[_0xef79('0x13')]));});});};exports[_0xef79('0x1e')]=function(_0x34db2f){var _0x84ad52=this;return new Promise(function(_0x3bb745,_0x2d70ce){return db[_0xef79('0x1f')]['find']({'raw':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x20')]===undefined?!![]:![]:!![],'where':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x21')]||null:null,'attributes':_0x34db2f[_0xef79('0x18')]?_0x34db2f['options'][_0xef79('0x19')]||null:null,'include':_0x34db2f[_0xef79('0x18')]?_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x34db2f[_0xef79('0x18')][_0xef79('0x1b')],function(_0x360b28){return{'model':db[_0x360b28[_0xef79('0x1d')]],'as':_0x360b28['as'],'attributes':_0x360b28[_0xef79('0x19')],'include':_0x360b28[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x360b28[_0xef79('0x1b')],function(_0x41d36b){return{'model':db[_0x41d36b[_0xef79('0x1d')]],'as':_0x41d36b['as'],'attributes':_0x41d36b[_0xef79('0x19')],'include':_0x41d36b[_0xef79('0x1b')]?_[_0xef79('0x1c')](_0x41d36b[_0xef79('0x1b')],function(_0x565cf1){return{'model':db[_0x565cf1['model']],'as':_0x565cf1['as'],'attributes':_0x565cf1[_0xef79('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bc12a){logger['info'](_0xef79('0x1e'),_0x34db2f);logger[_0xef79('0xe')]('ShowZohoAccount',_0x34db2f,JSON[_0xef79('0x10')](_0x4bc12a));_0x3bb745(_0x4bc12a);})['catch'](function(_0x529bb4){logger['error'](_0xef79('0x1e'),_0x529bb4[_0xef79('0x13')],_0x34db2f);_0x2d70ce(_0x84ad52[_0xef79('0x11')](0x1f4,_0x529bb4[_0xef79('0x13')]));});});}; \ No newline at end of file +var _0x6e1c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','ShowZohoAccount','find','lodash','bluebird','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});}exports[_0xc6e1('0x15')]=function(_0x527c70){var _0x2c9fd7=this;return new Promise(function(_0x2b8b22,_0x3f4a60){return db[_0xc6e1('0x16')][_0xc6e1('0x17')]({'raw':_0x527c70[_0xc6e1('0x18')]?_0x527c70[_0xc6e1('0x18')][_0xc6e1('0x19')]===undefined?!![]:![]:!![],'where':_0x527c70[_0xc6e1('0x18')]?_0x527c70[_0xc6e1('0x18')][_0xc6e1('0x1a')]||null:null,'attributes':_0x527c70[_0xc6e1('0x18')]?_0x527c70[_0xc6e1('0x18')][_0xc6e1('0x1b')]||null:null,'limit':_0x527c70['options']?_0x527c70[_0xc6e1('0x18')][_0xc6e1('0x1c')]||null:null,'include':_0x527c70[_0xc6e1('0x18')]?_0x527c70[_0xc6e1('0x18')][_0xc6e1('0x1d')]?_[_0xc6e1('0x1e')](_0x527c70['options'][_0xc6e1('0x1d')],function(_0x40b059){return{'model':db[_0x40b059[_0xc6e1('0x1f')]],'as':_0x40b059['as'],'attributes':_0x40b059[_0xc6e1('0x1b')],'include':_0x40b059[_0xc6e1('0x1d')]?_['map'](_0x40b059['include'],function(_0x2e284e){return{'model':db[_0x2e284e[_0xc6e1('0x1f')]],'as':_0x2e284e['as'],'attributes':_0x2e284e['attributes'],'include':_0x2e284e[_0xc6e1('0x1d')]?_[_0xc6e1('0x1e')](_0x2e284e[_0xc6e1('0x1d')],function(_0x400687){return{'model':db[_0x400687[_0xc6e1('0x1f')]],'as':_0x400687['as'],'attributes':_0x400687[_0xc6e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6e1('0x20')](function(_0x71fa6d){logger[_0xc6e1('0xd')]('GetZohoAccount',_0x527c70);logger[_0xc6e1('0x21')](_0xc6e1('0x15'),_0x527c70,JSON[_0xc6e1('0x22')](_0x71fa6d));_0x2b8b22(_0x71fa6d);})['catch'](function(_0xe1114b){logger[_0xc6e1('0x11')](_0xc6e1('0x15'),_0xe1114b[_0xc6e1('0x13')],_0x527c70);_0x3f4a60(_0x2c9fd7[_0xc6e1('0x11')](0x1f4,_0xe1114b['message']));});});};exports[_0xc6e1('0x23')]=function(_0x1585d4){var _0x5a7c24=this;return new Promise(function(_0x2cdb1e,_0x3d6d3d){return db[_0xc6e1('0x16')][_0xc6e1('0x24')]({'raw':_0x1585d4[_0xc6e1('0x18')]?_0x1585d4[_0xc6e1('0x18')][_0xc6e1('0x19')]===undefined?!![]:![]:!![],'where':_0x1585d4[_0xc6e1('0x18')]?_0x1585d4['options'][_0xc6e1('0x1a')]||null:null,'attributes':_0x1585d4[_0xc6e1('0x18')]?_0x1585d4[_0xc6e1('0x18')][_0xc6e1('0x1b')]||null:null,'include':_0x1585d4[_0xc6e1('0x18')]?_0x1585d4[_0xc6e1('0x18')]['include']?_['map'](_0x1585d4[_0xc6e1('0x18')][_0xc6e1('0x1d')],function(_0x1c5db9){return{'model':db[_0x1c5db9['model']],'as':_0x1c5db9['as'],'attributes':_0x1c5db9[_0xc6e1('0x1b')],'include':_0x1c5db9[_0xc6e1('0x1d')]?_['map'](_0x1c5db9[_0xc6e1('0x1d')],function(_0x51860c){return{'model':db[_0x51860c[_0xc6e1('0x1f')]],'as':_0x51860c['as'],'attributes':_0x51860c[_0xc6e1('0x1b')],'include':_0x51860c['include']?_[_0xc6e1('0x1e')](_0x51860c['include'],function(_0x253543){return{'model':db[_0x253543[_0xc6e1('0x1f')]],'as':_0x253543['as'],'attributes':_0x253543[_0xc6e1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc6e1('0x20')](function(_0x21594c){logger['info']('ShowZohoAccount',_0x1585d4);logger[_0xc6e1('0x21')](_0xc6e1('0x23'),_0x1585d4,JSON[_0xc6e1('0x22')](_0x21594c));_0x2cdb1e(_0x21594c);})['catch'](function(_0x2f9c1e){logger['error'](_0xc6e1('0x23'),_0x2f9c1e[_0xc6e1('0x13')],_0x1585d4);_0x3d6d3d(_0x5a7c24[_0xc6e1('0x11')](0x1f4,_0x2f9c1e[_0xc6e1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 45e468f..62ab98c 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 _0xcdbf=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update'];(function(_0x1d0aee,_0x2c4454){var _0x34ee2c=function(_0x6e3b9d){while(--_0x6e3b9d){_0x1d0aee['push'](_0x1d0aee['shift']());}};_0x34ee2c(++_0x2c4454);}(_0xcdbf,0xe9));var _0xfcdb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcdbf[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xfcdb('0x0'));var util=require('util');var path=require(_0xfcdb('0x1'));var timeout=require(_0xfcdb('0x2'));var express=require(_0xfcdb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfcdb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfcdb('0x5'));var controller=require(_0xfcdb('0x6'));router[_0xfcdb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcdb('0x7')](_0xfcdb('0x8'),auth[_0xfcdb('0x9')](),controller[_0xfcdb('0xa')]);router[_0xfcdb('0x7')]('/:id/fields',auth[_0xfcdb('0x9')](),controller[_0xfcdb('0xb')]);router[_0xfcdb('0x7')](_0xfcdb('0xc'),auth[_0xfcdb('0x9')](),controller[_0xfcdb('0xd')]);router['get'](_0xfcdb('0xe'),auth[_0xfcdb('0x9')](),controller[_0xfcdb('0xf')]);router[_0xfcdb('0x10')]('/',auth[_0xfcdb('0x9')](),controller[_0xfcdb('0x11')]);router[_0xfcdb('0x12')](_0xfcdb('0x8'),auth['isAuthenticated'](),controller[_0xfcdb('0x13')]);router[_0xfcdb('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xfcdb('0x15')]);module[_0xfcdb('0x16')]=router; \ No newline at end of file +var _0x8c2c=['isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intZohoConfiguration.controller','get','index','/:id'];(function(_0x5306b,_0x2a7f0f){var _0x363d6e=function(_0x49dc10){while(--_0x49dc10){_0x5306b['push'](_0x5306b['shift']());}};_0x363d6e(++_0x2a7f0f);}(_0x8c2c,0x11c));var _0xc8c2=function(_0x11ced7,_0x1ea2c5){_0x11ced7=_0x11ced7-0x0;var _0x20545c=_0x8c2c[_0x11ced7];return _0x20545c;};'use strict';var multer=require(_0xc8c2('0x0'));var util=require('util');var path=require(_0xc8c2('0x1'));var timeout=require(_0xc8c2('0x2'));var express=require(_0xc8c2('0x3'));var router=express[_0xc8c2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc8c2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc8c2('0x6'));router[_0xc8c2('0x7')]('/',auth['isAuthenticated'](),controller[_0xc8c2('0x8')]);router[_0xc8c2('0x7')](_0xc8c2('0x9'),auth[_0xc8c2('0xa')](),controller[_0xc8c2('0xb')]);router[_0xc8c2('0x7')](_0xc8c2('0xc'),auth[_0xc8c2('0xa')](),controller['getFields']);router[_0xc8c2('0x7')](_0xc8c2('0xd'),auth[_0xc8c2('0xa')](),controller['getSubjects']);router[_0xc8c2('0x7')](_0xc8c2('0xe'),auth[_0xc8c2('0xa')](),controller[_0xc8c2('0xf')]);router[_0xc8c2('0x10')]('/',auth['isAuthenticated'](),controller[_0xc8c2('0x11')]);router['put'](_0xc8c2('0x9'),auth[_0xc8c2('0xa')](),controller['update']);router[_0xc8c2('0x12')](_0xc8c2('0x9'),auth[_0xc8c2('0xa')](),controller[_0xc8c2('0x13')]);module[_0xc8c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 533f864..954cf50 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 _0x84f7=['nothing','ENUM','contact_lead','contact','sequelize','STRING','lead'];(function(_0x3a9ea3,_0x33f993){var _0x10d765=function(_0x1447f2){while(--_0x1447f2){_0x3a9ea3['push'](_0x3a9ea3['shift']());}};_0x10d765(++_0x33f993);}(_0x84f7,0x1e0));var _0x784f=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x84f7[_0x215e65];return _0xa85842;};'use strict';var Sequelize=require(_0x784f('0x0'));module['exports']={'name':{'type':Sequelize[_0x784f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x784f('0x2'),'contact',_0x784f('0x3')),'defaultValue':_0x784f('0x2')},'moduleSearch':{'type':Sequelize[_0x784f('0x4')](_0x784f('0x5'),_0x784f('0x6'),_0x784f('0x2')),'defaultValue':_0x784f('0x5')},'description':{'type':Sequelize[_0x784f('0x1')]}}; \ No newline at end of file +var _0x501e=['sequelize','exports','STRING','ENUM','lead','contact_lead'];(function(_0x4e0c90,_0x1822f7){var _0x26164b=function(_0x5f3548){while(--_0x5f3548){_0x4e0c90['push'](_0x4e0c90['shift']());}};_0x26164b(++_0x1822f7);}(_0x501e,0x150));var _0xe501=function(_0x18f6d3,_0x5b6a89){_0x18f6d3=_0x18f6d3-0x0;var _0x540314=_0x501e[_0x18f6d3];return _0x540314;};'use strict';var Sequelize=require(_0xe501('0x0'));module[_0xe501('0x1')]={'name':{'type':Sequelize[_0xe501('0x2')]},'moduleCreate':{'type':Sequelize[_0xe501('0x3')]('lead','contact','nothing'),'defaultValue':_0xe501('0x4')},'moduleSearch':{'type':Sequelize[_0xe501('0x3')]('contact_lead','contact',_0xe501('0x4')),'defaultValue':_0xe501('0x5')},'description':{'type':Sequelize[_0xe501('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5da7f89..dfd83fb 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 _0x709f=['keys','find','create','body','destroy','getFields','findOne','ZohoField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/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','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll','findAll','rows','catch','params'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x709f,0x152));var _0xf709=function(_0x80544e,_0x37a3f3){_0x80544e=_0x80544e-0x0;var _0x4f9b90=_0x709f[_0x80544e];return _0x4f9b90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf709('0x0'));var zipdir=require(_0xf709('0x1'));var jsonpatch=require(_0xf709('0x2'));var rp=require('request-promise');var moment=require(_0xf709('0x3'));var BPromise=require(_0xf709('0x4'));var Mustache=require(_0xf709('0x5'));var util=require(_0xf709('0x6'));var path=require('path');var sox=require(_0xf709('0x7'));var csv=require(_0xf709('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf709('0x9'));var _=require(_0xf709('0xa'));var squel=require(_0xf709('0xb'));var crypto=require(_0xf709('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf709('0xd'));var toCsv=require(_0xf709('0x8'));var querystring=require(_0xf709('0xe'));var Papa=require(_0xf709('0xf'));var Redis=require(_0xf709('0x10'));var authService=require(_0xf709('0x11'));var qs=require(_0xf709('0x12'));var as=require(_0xf709('0x13'));var hardwareService=require(_0xf709('0x14'));var logger=require(_0xf709('0x15'))('api');var utils=require(_0xf709('0x16'));var config=require(_0xf709('0x17'));var licenseUtil=require(_0xf709('0x18'));var db=require(_0xf709('0x19'))['db'];function respondWithStatusCode(_0x2ef940,_0x1600a2){_0x1600a2=_0x1600a2||0xcc;return function(_0x3280d3){if(_0x3280d3){return _0x2ef940[_0xf709('0x1a')](_0x1600a2);}return _0x2ef940['status'](_0x1600a2)[_0xf709('0x1b')]();};}function respondWithResult(_0x5e73f2,_0x36d7e4){_0x36d7e4=_0x36d7e4||0xc8;return function(_0x501edb){if(_0x501edb){return _0x5e73f2[_0xf709('0x1c')](_0x36d7e4)[_0xf709('0x1d')](_0x501edb);}};}function respondWithFilteredResult(_0x38337e,_0x5d1196){return function(_0xce50a9){if(_0xce50a9){var _0x2efca2=typeof _0x5d1196[_0xf709('0x1e')]===_0xf709('0x1f')&&typeof _0x5d1196[_0xf709('0x20')]===_0xf709('0x1f');var _0x226eee=_0xce50a9[_0xf709('0x21')];var _0x21dfa2=_0x2efca2?0x0:_0x5d1196[_0xf709('0x1e')];var _0x28bac9=_0x2efca2?_0xce50a9[_0xf709('0x21')]:_0x5d1196[_0xf709('0x1e')]+_0x5d1196[_0xf709('0x20')];var _0x47e84e;if(_0x28bac9>=_0x226eee){_0x28bac9=_0x226eee;_0x47e84e=0xc8;}else{_0x47e84e=0xce;}_0x38337e[_0xf709('0x1c')](_0x47e84e);return _0x38337e[_0xf709('0x22')](_0xf709('0x23'),_0x21dfa2+'-'+_0x28bac9+'/'+_0x226eee)[_0xf709('0x1d')](_0xce50a9);}return null;};}function patchUpdates(_0xd0e560){return function(_0x42481c){try{jsonpatch[_0xf709('0x24')](_0x42481c,_0xd0e560,!![]);}catch(_0x24ed99){return BPromise[_0xf709('0x25')](_0x24ed99);}return _0x42481c[_0xf709('0x26')]();};}function saveUpdates(_0x5428e5,_0x480ccd){return function(_0x17ca84){if(_0x17ca84){return _0x17ca84[_0xf709('0x27')](_0x5428e5)[_0xf709('0x28')](function(_0xb6ab71){return _0xb6ab71;});}return null;};}function removeEntity(_0x18ff54,_0x287537){return function(_0x393591){if(_0x393591){return _0x393591['destroy']()['then'](function(){_0x18ff54[_0xf709('0x1c')](0xcc)[_0xf709('0x1b')]();});}};}function handleEntityNotFound(_0x127e10,_0x3e4212){return function(_0x3f5749){if(!_0x3f5749){_0x127e10[_0xf709('0x1a')](0x194);}return _0x3f5749;};}function handleError(_0x154f3b,_0x2c81a1){_0x2c81a1=_0x2c81a1||0x1f4;return function(_0x2fb86b){logger[_0xf709('0x29')](_0x2fb86b[_0xf709('0x2a')]);if(_0x2fb86b[_0xf709('0x2b')]){delete _0x2fb86b[_0xf709('0x2b')];}_0x154f3b['status'](_0x2c81a1)['send'](_0x2fb86b);};}exports[_0xf709('0x2c')]=function(_0x413ada,_0x4ae251){var _0xa48d27={},_0xd45cc1={},_0xb5b5c3={'count':0x0,'rows':[]};var _0x20192b=_[_0xf709('0x2d')](db['ZohoConfiguration'][_0xf709('0x2e')],function(_0xbdc659){return{'name':_0xbdc659[_0xf709('0x2f')],'type':_0xbdc659[_0xf709('0x30')][_0xf709('0x31')]};});_0xd45cc1['model']=_[_0xf709('0x2d')](_0x20192b,'name');_0xd45cc1['query']=_['keys'](_0x413ada[_0xf709('0x32')]);_0xd45cc1[_0xf709('0x33')]=_[_0xf709('0x34')](_0xd45cc1[_0xf709('0x35')],_0xd45cc1[_0xf709('0x32')]);_0xa48d27[_0xf709('0x36')]=_[_0xf709('0x34')](_0xd45cc1[_0xf709('0x35')],qs[_0xf709('0x37')](_0x413ada[_0xf709('0x32')][_0xf709('0x37')]));_0xa48d27[_0xf709('0x36')]=_0xa48d27['attributes'][_0xf709('0x38')]?_0xa48d27[_0xf709('0x36')]:_0xd45cc1[_0xf709('0x35')];if(!_0x413ada[_0xf709('0x32')][_0xf709('0x39')](_0xf709('0x3a'))){_0xa48d27[_0xf709('0x20')]=qs[_0xf709('0x20')](_0x413ada[_0xf709('0x32')][_0xf709('0x20')]);_0xa48d27[_0xf709('0x1e')]=qs[_0xf709('0x1e')](_0x413ada[_0xf709('0x32')][_0xf709('0x1e')]);}_0xa48d27[_0xf709('0x3b')]=qs[_0xf709('0x3c')](_0x413ada[_0xf709('0x32')][_0xf709('0x3c')]);_0xa48d27[_0xf709('0x3d')]=qs[_0xf709('0x33')](_[_0xf709('0x3e')](_0x413ada[_0xf709('0x32')],_0xd45cc1[_0xf709('0x33')]),_0x20192b);if(_0x413ada[_0xf709('0x32')][_0xf709('0x3f')]){_0xa48d27['where']=_[_0xf709('0x40')](_0xa48d27[_0xf709('0x3d')],{'$or':_[_0xf709('0x2d')](_0x20192b,function(_0x5198ec){if(_0x5198ec[_0xf709('0x30')]!=='VIRTUAL'){var _0x132a23={};_0x132a23[_0x5198ec[_0xf709('0x2b')]]={'$like':'%'+_0x413ada[_0xf709('0x32')]['filter']+'%'};return _0x132a23;}})});}_0xa48d27=_['merge']({},_0xa48d27,_0x413ada[_0xf709('0x41')]);var _0x2c42e9={'where':_0xa48d27['where']};return db[_0xf709('0x42')]['count'](_0x2c42e9)[_0xf709('0x28')](function(_0x34ac56){_0xb5b5c3[_0xf709('0x21')]=_0x34ac56;if(_0x413ada[_0xf709('0x32')][_0xf709('0x43')]){_0xa48d27['include']=[{'all':!![]}];}return db[_0xf709('0x42')][_0xf709('0x44')](_0xa48d27);})[_0xf709('0x28')](function(_0x3e07ff){_0xb5b5c3[_0xf709('0x45')]=_0x3e07ff;return _0xb5b5c3;})[_0xf709('0x28')](respondWithFilteredResult(_0x4ae251,_0xa48d27))[_0xf709('0x46')](handleError(_0x4ae251,null));};exports['show']=function(_0x1a967f,_0x4fb813){var _0x3b9d9f={'raw':![],'where':{'id':_0x1a967f[_0xf709('0x47')]['id']}},_0x34e03f={};_0x34e03f['model']=_[_0xf709('0x48')](db[_0xf709('0x42')][_0xf709('0x2e')]);_0x34e03f[_0xf709('0x32')]=_[_0xf709('0x48')](_0x1a967f[_0xf709('0x32')]);_0x34e03f[_0xf709('0x33')]=_[_0xf709('0x34')](_0x34e03f[_0xf709('0x35')],_0x34e03f[_0xf709('0x32')]);_0x3b9d9f['attributes']=_['intersection'](_0x34e03f[_0xf709('0x35')],qs['fields'](_0x1a967f['query'][_0xf709('0x37')]));_0x3b9d9f[_0xf709('0x36')]=_0x3b9d9f[_0xf709('0x36')]['length']?_0x3b9d9f['attributes']:_0x34e03f[_0xf709('0x35')];if(_0x1a967f[_0xf709('0x32')][_0xf709('0x43')]){_0x3b9d9f['include']=[{'all':!![]}];}_0x3b9d9f=_[_0xf709('0x40')]({},_0x3b9d9f,_0x1a967f[_0xf709('0x41')]);return db['ZohoConfiguration'][_0xf709('0x49')](_0x3b9d9f)[_0xf709('0x28')](handleEntityNotFound(_0x4fb813,null))[_0xf709('0x28')](respondWithResult(_0x4fb813,null))[_0xf709('0x46')](handleError(_0x4fb813,null));};exports[_0xf709('0x4a')]=function(_0x1b6be2,_0xe36199){return db[_0xf709('0x42')][_0xf709('0x4a')](_0x1b6be2['body'],{})[_0xf709('0x28')](respondWithResult(_0xe36199,0xc9))[_0xf709('0x46')](handleError(_0xe36199,null));};exports[_0xf709('0x27')]=function(_0x3f65ce,_0x5c6e9b){if(_0x3f65ce['body']['id']){delete _0x3f65ce[_0xf709('0x4b')]['id'];}return db[_0xf709('0x42')][_0xf709('0x49')]({'where':{'id':_0x3f65ce['params']['id']}})[_0xf709('0x28')](handleEntityNotFound(_0x5c6e9b,null))[_0xf709('0x28')](saveUpdates(_0x3f65ce[_0xf709('0x4b')],null))['then'](respondWithResult(_0x5c6e9b,null))[_0xf709('0x46')](handleError(_0x5c6e9b,null));};exports[_0xf709('0x4c')]=function(_0x402467,_0x4346d2){return db[_0xf709('0x42')]['find']({'where':{'id':_0x402467['params']['id']}})['then'](handleEntityNotFound(_0x4346d2,null))[_0xf709('0x28')](removeEntity(_0x4346d2,null))[_0xf709('0x46')](handleError(_0x4346d2,null));};exports[_0xf709('0x4d')]=function(_0x48c532,_0x2ba785,_0x20a867){var _0x8afc26={};var _0xf204f7={};var _0xe89b48;var _0x3407dc;return db[_0xf709('0x42')][_0xf709('0x4e')]({'where':{'id':_0x48c532['params']['id']}})[_0xf709('0x28')](handleEntityNotFound(_0x2ba785,null))[_0xf709('0x28')](function(_0x1c95aa){if(_0x1c95aa){_0xe89b48=_0x1c95aa;_0xf204f7[_0xf709('0x35')]=_[_0xf709('0x48')](db[_0xf709('0x4f')][_0xf709('0x2e')]);_0xf204f7[_0xf709('0x32')]=_[_0xf709('0x48')](_0x48c532[_0xf709('0x32')]);_0xf204f7[_0xf709('0x33')]=_['intersection'](_0xf204f7[_0xf709('0x35')],_0xf204f7['query']);_0x8afc26[_0xf709('0x36')]=_[_0xf709('0x34')](_0xf204f7[_0xf709('0x35')],qs[_0xf709('0x37')](_0x48c532['query']['fields']));_0x8afc26['attributes']=_0x8afc26[_0xf709('0x36')][_0xf709('0x38')]?_0x8afc26[_0xf709('0x36')]:_0xf204f7[_0xf709('0x35')];_0x8afc26[_0xf709('0x3b')]=qs[_0xf709('0x3c')](_0x48c532['query'][_0xf709('0x3c')]);_0x8afc26[_0xf709('0x3d')]=qs[_0xf709('0x33')](_[_0xf709('0x3e')](_0x48c532[_0xf709('0x32')],_0xf204f7[_0xf709('0x33')]));if(_0x48c532['query'][_0xf709('0x3f')]){_0x8afc26[_0xf709('0x3d')]=_[_0xf709('0x40')](_0x8afc26[_0xf709('0x3d')],{'$or':_[_0xf709('0x2d')](_0x8afc26[_0xf709('0x36')],function(_0x48a9ab){var _0x269cc7={};_0x269cc7[_0x48a9ab]={'$like':'%'+_0x48c532['query'][_0xf709('0x3f')]+'%'};return _0x269cc7;})});}_0x8afc26=_[_0xf709('0x40')]({},_0x8afc26,_0x48c532[_0xf709('0x41')]);return _0xe89b48[_0xf709('0x4d')](_0x8afc26);}})['then'](function(_0x2bed97){if(_0x2bed97){_0x3407dc=_0x2bed97[_0xf709('0x38')];if(!_0x48c532[_0xf709('0x32')][_0xf709('0x39')]('nolimit')){_0x8afc26['limit']=qs['limit'](_0x48c532['query']['limit']);_0x8afc26['offset']=qs['offset'](_0x48c532[_0xf709('0x32')][_0xf709('0x1e')]);}return _0xe89b48['getFields'](_0x8afc26);}})['then'](function(_0x3a04d7){if(_0x3a04d7){return _0x3a04d7?{'count':_0x3407dc,'rows':_0x3a04d7}:null;}})[_0xf709('0x28')](respondWithResult(_0x2ba785,null))[_0xf709('0x46')](handleError(_0x2ba785,null));};exports['getSubjects']=function(_0x18aa62,_0x454914,_0x51591a){var _0x413e25={};var _0x46d223={};var _0x7ec6ee;var _0x2af4e5;return db[_0xf709('0x42')][_0xf709('0x4e')]({'where':{'id':_0x18aa62[_0xf709('0x47')]['id']}})[_0xf709('0x28')](handleEntityNotFound(_0x454914,null))[_0xf709('0x28')](function(_0x54d2f1){if(_0x54d2f1){_0x7ec6ee=_0x54d2f1;_0x46d223['model']=_['keys'](db[_0xf709('0x4f')]['rawAttributes']);_0x46d223[_0xf709('0x32')]=_[_0xf709('0x48')](_0x18aa62[_0xf709('0x32')]);_0x46d223[_0xf709('0x33')]=_[_0xf709('0x34')](_0x46d223['model'],_0x46d223[_0xf709('0x32')]);_0x413e25[_0xf709('0x36')]=_[_0xf709('0x34')](_0x46d223[_0xf709('0x35')],qs[_0xf709('0x37')](_0x18aa62[_0xf709('0x32')][_0xf709('0x37')]));_0x413e25[_0xf709('0x36')]=_0x413e25[_0xf709('0x36')][_0xf709('0x38')]?_0x413e25[_0xf709('0x36')]:_0x46d223[_0xf709('0x35')];_0x413e25[_0xf709('0x3b')]=qs[_0xf709('0x3c')](_0x18aa62[_0xf709('0x32')][_0xf709('0x3c')]);_0x413e25[_0xf709('0x3d')]=qs[_0xf709('0x33')](_['pick'](_0x18aa62['query'],_0x46d223[_0xf709('0x33')]));if(_0x18aa62['query'][_0xf709('0x3f')]){_0x413e25[_0xf709('0x3d')]=_[_0xf709('0x40')](_0x413e25[_0xf709('0x3d')],{'$or':_[_0xf709('0x2d')](_0x413e25[_0xf709('0x36')],function(_0x32658f){var _0x55f2fa={};_0x55f2fa[_0x32658f]={'$like':'%'+_0x18aa62[_0xf709('0x32')][_0xf709('0x3f')]+'%'};return _0x55f2fa;})});}_0x413e25=_[_0xf709('0x40')]({},_0x413e25,_0x18aa62[_0xf709('0x41')]);return _0x7ec6ee[_0xf709('0x50')](_0x413e25);}})['then'](function(_0x3f0fde){if(_0x3f0fde){_0x2af4e5=_0x3f0fde['length'];if(!_0x18aa62[_0xf709('0x32')][_0xf709('0x39')](_0xf709('0x3a'))){_0x413e25[_0xf709('0x20')]=qs[_0xf709('0x20')](_0x18aa62[_0xf709('0x32')][_0xf709('0x20')]);_0x413e25[_0xf709('0x1e')]=qs[_0xf709('0x1e')](_0x18aa62['query'][_0xf709('0x1e')]);}return _0x7ec6ee[_0xf709('0x50')](_0x413e25);}})[_0xf709('0x28')](function(_0x53a4c6){if(_0x53a4c6){return _0x53a4c6?{'count':_0x2af4e5,'rows':_0x53a4c6}:null;}})[_0xf709('0x28')](respondWithResult(_0x454914,null))['catch'](handleError(_0x454914,null));};exports[_0xf709('0x51')]=function(_0x4feab5,_0x3a0b21,_0xdc5d29){var _0x23a208={};var _0x4b214a={};var _0xcf743d;var _0x2eecc0;return db[_0xf709('0x42')]['findOne']({'where':{'id':_0x4feab5['params']['id']}})[_0xf709('0x28')](handleEntityNotFound(_0x3a0b21,null))[_0xf709('0x28')](function(_0x52f7ef){if(_0x52f7ef){_0xcf743d=_0x52f7ef;_0x4b214a[_0xf709('0x35')]=_[_0xf709('0x48')](db[_0xf709('0x4f')][_0xf709('0x2e')]);_0x4b214a[_0xf709('0x32')]=_[_0xf709('0x48')](_0x4feab5[_0xf709('0x32')]);_0x4b214a[_0xf709('0x33')]=_['intersection'](_0x4b214a[_0xf709('0x35')],_0x4b214a['query']);_0x23a208['attributes']=_[_0xf709('0x34')](_0x4b214a[_0xf709('0x35')],qs[_0xf709('0x37')](_0x4feab5['query'][_0xf709('0x37')]));_0x23a208[_0xf709('0x36')]=_0x23a208[_0xf709('0x36')]['length']?_0x23a208[_0xf709('0x36')]:_0x4b214a['model'];_0x23a208[_0xf709('0x3b')]=qs[_0xf709('0x3c')](_0x4feab5[_0xf709('0x32')]['sort']);_0x23a208['where']=qs[_0xf709('0x33')](_[_0xf709('0x3e')](_0x4feab5[_0xf709('0x32')],_0x4b214a['filters']));if(_0x4feab5[_0xf709('0x32')][_0xf709('0x3f')]){_0x23a208[_0xf709('0x3d')]=_['merge'](_0x23a208['where'],{'$or':_[_0xf709('0x2d')](_0x23a208['attributes'],function(_0x789354){var _0x2a02dd={};_0x2a02dd[_0x789354]={'$like':'%'+_0x4feab5[_0xf709('0x32')][_0xf709('0x3f')]+'%'};return _0x2a02dd;})});}_0x23a208=_[_0xf709('0x40')]({},_0x23a208,_0x4feab5['options']);return _0xcf743d[_0xf709('0x51')](_0x23a208);}})['then'](function(_0x5a1978){if(_0x5a1978){_0x2eecc0=_0x5a1978[_0xf709('0x38')];if(!_0x4feab5[_0xf709('0x32')]['hasOwnProperty'](_0xf709('0x3a'))){_0x23a208[_0xf709('0x20')]=qs['limit'](_0x4feab5[_0xf709('0x32')][_0xf709('0x20')]);_0x23a208[_0xf709('0x1e')]=qs[_0xf709('0x1e')](_0x4feab5[_0xf709('0x32')][_0xf709('0x1e')]);}return _0xcf743d[_0xf709('0x51')](_0x23a208);}})['then'](function(_0x3f1cca){if(_0x3f1cca){return _0x3f1cca?{'count':_0x2eecc0,'rows':_0x3f1cca}:null;}})[_0xf709('0x28')](respondWithResult(_0x3a0b21,null))[_0xf709('0x46')](handleError(_0x3a0b21,null));}; \ No newline at end of file +var _0x6272=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','ZohoConfiguration','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','body','find','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x38abce,_0x339b87){var _0x4b83a9=function(_0x1d97df){while(--_0x1d97df){_0x38abce['push'](_0x38abce['shift']());}};_0x4b83a9(++_0x339b87);}(_0x6272,0x195));var _0x2627=function(_0x518506,_0x480ad3){_0x518506=_0x518506-0x0;var _0x585617=_0x6272[_0x518506];return _0x585617;};'use strict';var emlformat=require(_0x2627('0x0'));var rimraf=require(_0x2627('0x1'));var zipdir=require(_0x2627('0x2'));var jsonpatch=require(_0x2627('0x3'));var rp=require(_0x2627('0x4'));var moment=require(_0x2627('0x5'));var BPromise=require(_0x2627('0x6'));var Mustache=require(_0x2627('0x7'));var util=require(_0x2627('0x8'));var path=require(_0x2627('0x9'));var sox=require(_0x2627('0xa'));var csv=require(_0x2627('0xb'));var ejs=require(_0x2627('0xc'));var fs=require('fs');var fs_extra=require(_0x2627('0xd'));var _=require(_0x2627('0xe'));var squel=require(_0x2627('0xf'));var crypto=require(_0x2627('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x2627('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2627('0x12'));var Papa=require(_0x2627('0x13'));var Redis=require(_0x2627('0x14'));var authService=require(_0x2627('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x2627('0x16'));var hardwareService=require(_0x2627('0x17'));var logger=require(_0x2627('0x18'))(_0x2627('0x19'));var utils=require(_0x2627('0x1a'));var config=require(_0x2627('0x1b'));var licenseUtil=require(_0x2627('0x1c'));var db=require(_0x2627('0x1d'))['db'];function respondWithStatusCode(_0x365792,_0xc6db90){_0xc6db90=_0xc6db90||0xcc;return function(_0x203007){if(_0x203007){return _0x365792['sendStatus'](_0xc6db90);}return _0x365792[_0x2627('0x1e')](_0xc6db90)[_0x2627('0x1f')]();};}function respondWithResult(_0x2eb9ee,_0x531175){_0x531175=_0x531175||0xc8;return function(_0x36e2b6){if(_0x36e2b6){return _0x2eb9ee[_0x2627('0x1e')](_0x531175)['json'](_0x36e2b6);}};}function respondWithFilteredResult(_0x2a3197,_0xdf0101){return function(_0x2442f7){if(_0x2442f7){var _0x59fcc9=typeof _0xdf0101['offset']===_0x2627('0x20')&&typeof _0xdf0101['limit']===_0x2627('0x20');var _0x3c0179=_0x2442f7[_0x2627('0x21')];var _0xa467b=_0x59fcc9?0x0:_0xdf0101[_0x2627('0x22')];var _0x176bb9=_0x59fcc9?_0x2442f7['count']:_0xdf0101[_0x2627('0x22')]+_0xdf0101['limit'];var _0x3ee4d8;if(_0x176bb9>=_0x3c0179){_0x176bb9=_0x3c0179;_0x3ee4d8=0xc8;}else{_0x3ee4d8=0xce;}_0x2a3197[_0x2627('0x1e')](_0x3ee4d8);return _0x2a3197[_0x2627('0x23')](_0x2627('0x24'),_0xa467b+'-'+_0x176bb9+'/'+_0x3c0179)['json'](_0x2442f7);}return null;};}function patchUpdates(_0x36a9f0){return function(_0x19e3a4){try{jsonpatch[_0x2627('0x25')](_0x19e3a4,_0x36a9f0,!![]);}catch(_0x5a0fa0){return BPromise[_0x2627('0x26')](_0x5a0fa0);}return _0x19e3a4[_0x2627('0x27')]();};}function saveUpdates(_0x3ee2fb,_0x434339){return function(_0x2c74db){if(_0x2c74db){return _0x2c74db[_0x2627('0x28')](_0x3ee2fb)[_0x2627('0x29')](function(_0x32c5ee){return _0x32c5ee;});}return null;};}function removeEntity(_0x1b65b1,_0x46d427){return function(_0x1ef6d2){if(_0x1ef6d2){return _0x1ef6d2[_0x2627('0x2a')]()['then'](function(){_0x1b65b1['status'](0xcc)[_0x2627('0x1f')]();});}};}function handleEntityNotFound(_0x4ad99a,_0x1c0d42){return function(_0x1ff9ef){if(!_0x1ff9ef){_0x4ad99a[_0x2627('0x2b')](0x194);}return _0x1ff9ef;};}function handleError(_0x31f9f7,_0x18ce99){_0x18ce99=_0x18ce99||0x1f4;return function(_0x3e0aa3){logger[_0x2627('0x2c')](_0x3e0aa3['stack']);if(_0x3e0aa3[_0x2627('0x2d')]){delete _0x3e0aa3[_0x2627('0x2d')];}_0x31f9f7[_0x2627('0x1e')](_0x18ce99)[_0x2627('0x2e')](_0x3e0aa3);};}exports[_0x2627('0x2f')]=function(_0x27a515,_0x39ee14){var _0x1e1e6b={},_0xeeb936={},_0x3b9003={'count':0x0,'rows':[]};var _0x56084a=_['map'](db[_0x2627('0x30')][_0x2627('0x31')],function(_0x4af73b){return{'name':_0x4af73b['fieldName'],'type':_0x4af73b[_0x2627('0x32')][_0x2627('0x33')]};});_0xeeb936['model']=_[_0x2627('0x34')](_0x56084a,_0x2627('0x2d'));_0xeeb936[_0x2627('0x35')]=_[_0x2627('0x36')](_0x27a515['query']);_0xeeb936[_0x2627('0x37')]=_[_0x2627('0x38')](_0xeeb936[_0x2627('0x39')],_0xeeb936['query']);_0x1e1e6b[_0x2627('0x3a')]=_[_0x2627('0x38')](_0xeeb936[_0x2627('0x39')],qs[_0x2627('0x3b')](_0x27a515['query'][_0x2627('0x3b')]));_0x1e1e6b['attributes']=_0x1e1e6b[_0x2627('0x3a')][_0x2627('0x3c')]?_0x1e1e6b[_0x2627('0x3a')]:_0xeeb936[_0x2627('0x39')];if(!_0x27a515[_0x2627('0x35')][_0x2627('0x3d')](_0x2627('0x3e'))){_0x1e1e6b[_0x2627('0x3f')]=qs[_0x2627('0x3f')](_0x27a515[_0x2627('0x35')][_0x2627('0x3f')]);_0x1e1e6b['offset']=qs[_0x2627('0x22')](_0x27a515[_0x2627('0x35')]['offset']);}_0x1e1e6b[_0x2627('0x40')]=qs[_0x2627('0x41')](_0x27a515[_0x2627('0x35')][_0x2627('0x41')]);_0x1e1e6b[_0x2627('0x42')]=qs[_0x2627('0x37')](_[_0x2627('0x43')](_0x27a515[_0x2627('0x35')],_0xeeb936[_0x2627('0x37')]),_0x56084a);if(_0x27a515[_0x2627('0x35')][_0x2627('0x44')]){_0x1e1e6b[_0x2627('0x42')]=_[_0x2627('0x45')](_0x1e1e6b['where'],{'$or':_[_0x2627('0x34')](_0x56084a,function(_0x389c62){if(_0x389c62['type']!=='VIRTUAL'){var _0x2dd820={};_0x2dd820[_0x389c62[_0x2627('0x2d')]]={'$like':'%'+_0x27a515[_0x2627('0x35')]['filter']+'%'};return _0x2dd820;}})});}_0x1e1e6b=_[_0x2627('0x45')]({},_0x1e1e6b,_0x27a515[_0x2627('0x46')]);var _0x3d42a8={'where':_0x1e1e6b[_0x2627('0x42')]};return db[_0x2627('0x30')][_0x2627('0x21')](_0x3d42a8)[_0x2627('0x29')](function(_0x35e280){_0x3b9003[_0x2627('0x21')]=_0x35e280;if(_0x27a515[_0x2627('0x35')]['includeAll']){_0x1e1e6b[_0x2627('0x47')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x2627('0x48')](_0x1e1e6b);})[_0x2627('0x29')](function(_0x3c3469){_0x3b9003[_0x2627('0x49')]=_0x3c3469;return _0x3b9003;})[_0x2627('0x29')](respondWithFilteredResult(_0x39ee14,_0x1e1e6b))[_0x2627('0x4a')](handleError(_0x39ee14,null));};exports['show']=function(_0x365f21,_0x3d3577){var _0x5bfea1={'raw':![],'where':{'id':_0x365f21[_0x2627('0x4b')]['id']}},_0x12f992={};_0x12f992['model']=_[_0x2627('0x36')](db[_0x2627('0x30')][_0x2627('0x31')]);_0x12f992['query']=_[_0x2627('0x36')](_0x365f21[_0x2627('0x35')]);_0x12f992[_0x2627('0x37')]=_[_0x2627('0x38')](_0x12f992[_0x2627('0x39')],_0x12f992[_0x2627('0x35')]);_0x5bfea1['attributes']=_['intersection'](_0x12f992[_0x2627('0x39')],qs[_0x2627('0x3b')](_0x365f21['query']['fields']));_0x5bfea1[_0x2627('0x3a')]=_0x5bfea1['attributes'][_0x2627('0x3c')]?_0x5bfea1[_0x2627('0x3a')]:_0x12f992[_0x2627('0x39')];if(_0x365f21[_0x2627('0x35')][_0x2627('0x4c')]){_0x5bfea1[_0x2627('0x47')]=[{'all':!![]}];}_0x5bfea1=_[_0x2627('0x45')]({},_0x5bfea1,_0x365f21[_0x2627('0x46')]);return db[_0x2627('0x30')]['find'](_0x5bfea1)[_0x2627('0x29')](handleEntityNotFound(_0x3d3577,null))[_0x2627('0x29')](respondWithResult(_0x3d3577,null))['catch'](handleError(_0x3d3577,null));};exports[_0x2627('0x4d')]=function(_0x542e3a,_0x412621){return db[_0x2627('0x30')][_0x2627('0x4d')](_0x542e3a[_0x2627('0x4e')],{})[_0x2627('0x29')](respondWithResult(_0x412621,0xc9))[_0x2627('0x4a')](handleError(_0x412621,null));};exports['update']=function(_0x4bf2b6,_0x290b29){if(_0x4bf2b6[_0x2627('0x4e')]['id']){delete _0x4bf2b6[_0x2627('0x4e')]['id'];}return db[_0x2627('0x30')][_0x2627('0x4f')]({'where':{'id':_0x4bf2b6[_0x2627('0x4b')]['id']}})[_0x2627('0x29')](handleEntityNotFound(_0x290b29,null))[_0x2627('0x29')](saveUpdates(_0x4bf2b6[_0x2627('0x4e')],null))['then'](respondWithResult(_0x290b29,null))['catch'](handleError(_0x290b29,null));};exports[_0x2627('0x2a')]=function(_0x45b437,_0xbdd0d){return db[_0x2627('0x30')][_0x2627('0x4f')]({'where':{'id':_0x45b437[_0x2627('0x4b')]['id']}})[_0x2627('0x29')](handleEntityNotFound(_0xbdd0d,null))[_0x2627('0x29')](removeEntity(_0xbdd0d,null))[_0x2627('0x4a')](handleError(_0xbdd0d,null));};exports[_0x2627('0x50')]=function(_0x73b8a0,_0x1ac4a9,_0x1d1ea7){var _0x19bcb2={};var _0x3b00f1={};var _0x1d9713;var _0x2abc05;return db['ZohoConfiguration'][_0x2627('0x51')]({'where':{'id':_0x73b8a0[_0x2627('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ac4a9,null))[_0x2627('0x29')](function(_0x820e7){if(_0x820e7){_0x1d9713=_0x820e7;_0x3b00f1[_0x2627('0x39')]=_[_0x2627('0x36')](db[_0x2627('0x52')][_0x2627('0x31')]);_0x3b00f1[_0x2627('0x35')]=_['keys'](_0x73b8a0[_0x2627('0x35')]);_0x3b00f1[_0x2627('0x37')]=_[_0x2627('0x38')](_0x3b00f1[_0x2627('0x39')],_0x3b00f1[_0x2627('0x35')]);_0x19bcb2[_0x2627('0x3a')]=_[_0x2627('0x38')](_0x3b00f1[_0x2627('0x39')],qs[_0x2627('0x3b')](_0x73b8a0[_0x2627('0x35')][_0x2627('0x3b')]));_0x19bcb2[_0x2627('0x3a')]=_0x19bcb2[_0x2627('0x3a')][_0x2627('0x3c')]?_0x19bcb2['attributes']:_0x3b00f1[_0x2627('0x39')];_0x19bcb2[_0x2627('0x40')]=qs['sort'](_0x73b8a0[_0x2627('0x35')][_0x2627('0x41')]);_0x19bcb2['where']=qs[_0x2627('0x37')](_[_0x2627('0x43')](_0x73b8a0[_0x2627('0x35')],_0x3b00f1[_0x2627('0x37')]));if(_0x73b8a0[_0x2627('0x35')]['filter']){_0x19bcb2[_0x2627('0x42')]=_[_0x2627('0x45')](_0x19bcb2[_0x2627('0x42')],{'$or':_[_0x2627('0x34')](_0x19bcb2[_0x2627('0x3a')],function(_0x5cfb0e){var _0x76dfe0={};_0x76dfe0[_0x5cfb0e]={'$like':'%'+_0x73b8a0['query']['filter']+'%'};return _0x76dfe0;})});}_0x19bcb2=_[_0x2627('0x45')]({},_0x19bcb2,_0x73b8a0[_0x2627('0x46')]);return _0x1d9713[_0x2627('0x50')](_0x19bcb2);}})['then'](function(_0x2260bd){if(_0x2260bd){_0x2abc05=_0x2260bd[_0x2627('0x3c')];if(!_0x73b8a0[_0x2627('0x35')][_0x2627('0x3d')]('nolimit')){_0x19bcb2[_0x2627('0x3f')]=qs[_0x2627('0x3f')](_0x73b8a0[_0x2627('0x35')][_0x2627('0x3f')]);_0x19bcb2['offset']=qs[_0x2627('0x22')](_0x73b8a0[_0x2627('0x35')]['offset']);}return _0x1d9713[_0x2627('0x50')](_0x19bcb2);}})[_0x2627('0x29')](function(_0x219afc){if(_0x219afc){return _0x219afc?{'count':_0x2abc05,'rows':_0x219afc}:null;}})[_0x2627('0x29')](respondWithResult(_0x1ac4a9,null))['catch'](handleError(_0x1ac4a9,null));};exports[_0x2627('0x53')]=function(_0x380d6a,_0x34b691,_0x35b8c3){var _0x50b8cb={};var _0x1a9f09={};var _0x53298e;var _0x58d1ac;return db[_0x2627('0x30')][_0x2627('0x51')]({'where':{'id':_0x380d6a[_0x2627('0x4b')]['id']}})[_0x2627('0x29')](handleEntityNotFound(_0x34b691,null))[_0x2627('0x29')](function(_0x467669){if(_0x467669){_0x53298e=_0x467669;_0x1a9f09['model']=_[_0x2627('0x36')](db[_0x2627('0x52')][_0x2627('0x31')]);_0x1a9f09[_0x2627('0x35')]=_[_0x2627('0x36')](_0x380d6a[_0x2627('0x35')]);_0x1a9f09[_0x2627('0x37')]=_[_0x2627('0x38')](_0x1a9f09[_0x2627('0x39')],_0x1a9f09[_0x2627('0x35')]);_0x50b8cb[_0x2627('0x3a')]=_[_0x2627('0x38')](_0x1a9f09[_0x2627('0x39')],qs[_0x2627('0x3b')](_0x380d6a['query'][_0x2627('0x3b')]));_0x50b8cb[_0x2627('0x3a')]=_0x50b8cb[_0x2627('0x3a')][_0x2627('0x3c')]?_0x50b8cb[_0x2627('0x3a')]:_0x1a9f09[_0x2627('0x39')];_0x50b8cb[_0x2627('0x40')]=qs[_0x2627('0x41')](_0x380d6a['query']['sort']);_0x50b8cb[_0x2627('0x42')]=qs[_0x2627('0x37')](_[_0x2627('0x43')](_0x380d6a[_0x2627('0x35')],_0x1a9f09[_0x2627('0x37')]));if(_0x380d6a[_0x2627('0x35')]['filter']){_0x50b8cb[_0x2627('0x42')]=_['merge'](_0x50b8cb[_0x2627('0x42')],{'$or':_[_0x2627('0x34')](_0x50b8cb[_0x2627('0x3a')],function(_0x130725){var _0x1d5e6b={};_0x1d5e6b[_0x130725]={'$like':'%'+_0x380d6a['query'][_0x2627('0x44')]+'%'};return _0x1d5e6b;})});}_0x50b8cb=_[_0x2627('0x45')]({},_0x50b8cb,_0x380d6a['options']);return _0x53298e[_0x2627('0x53')](_0x50b8cb);}})[_0x2627('0x29')](function(_0x54417e){if(_0x54417e){_0x58d1ac=_0x54417e['length'];if(!_0x380d6a[_0x2627('0x35')]['hasOwnProperty'](_0x2627('0x3e'))){_0x50b8cb[_0x2627('0x3f')]=qs[_0x2627('0x3f')](_0x380d6a[_0x2627('0x35')][_0x2627('0x3f')]);_0x50b8cb['offset']=qs[_0x2627('0x22')](_0x380d6a[_0x2627('0x35')][_0x2627('0x22')]);}return _0x53298e['getSubjects'](_0x50b8cb);}})['then'](function(_0x251fcb){if(_0x251fcb){return _0x251fcb?{'count':_0x58d1ac,'rows':_0x251fcb}:null;}})['then'](respondWithResult(_0x34b691,null))[_0x2627('0x4a')](handleError(_0x34b691,null));};exports[_0x2627('0x54')]=function(_0x141db7,_0x417cf2,_0x4015e4){var _0x39b7d9={};var _0x209314={};var _0x35dc2f;var _0x25a38f;return db['ZohoConfiguration'][_0x2627('0x51')]({'where':{'id':_0x141db7['params']['id']}})[_0x2627('0x29')](handleEntityNotFound(_0x417cf2,null))[_0x2627('0x29')](function(_0x2e37d6){if(_0x2e37d6){_0x35dc2f=_0x2e37d6;_0x209314['model']=_['keys'](db['ZohoField'][_0x2627('0x31')]);_0x209314[_0x2627('0x35')]=_[_0x2627('0x36')](_0x141db7[_0x2627('0x35')]);_0x209314[_0x2627('0x37')]=_[_0x2627('0x38')](_0x209314[_0x2627('0x39')],_0x209314['query']);_0x39b7d9[_0x2627('0x3a')]=_[_0x2627('0x38')](_0x209314['model'],qs[_0x2627('0x3b')](_0x141db7[_0x2627('0x35')][_0x2627('0x3b')]));_0x39b7d9[_0x2627('0x3a')]=_0x39b7d9[_0x2627('0x3a')][_0x2627('0x3c')]?_0x39b7d9[_0x2627('0x3a')]:_0x209314[_0x2627('0x39')];_0x39b7d9['order']=qs[_0x2627('0x41')](_0x141db7[_0x2627('0x35')][_0x2627('0x41')]);_0x39b7d9[_0x2627('0x42')]=qs[_0x2627('0x37')](_['pick'](_0x141db7[_0x2627('0x35')],_0x209314[_0x2627('0x37')]));if(_0x141db7[_0x2627('0x35')][_0x2627('0x44')]){_0x39b7d9[_0x2627('0x42')]=_['merge'](_0x39b7d9['where'],{'$or':_['map'](_0x39b7d9[_0x2627('0x3a')],function(_0x4cec12){var _0x3f1108={};_0x3f1108[_0x4cec12]={'$like':'%'+_0x141db7['query'][_0x2627('0x44')]+'%'};return _0x3f1108;})});}_0x39b7d9=_['merge']({},_0x39b7d9,_0x141db7['options']);return _0x35dc2f[_0x2627('0x54')](_0x39b7d9);}})[_0x2627('0x29')](function(_0x429658){if(_0x429658){_0x25a38f=_0x429658['length'];if(!_0x141db7['query']['hasOwnProperty'](_0x2627('0x3e'))){_0x39b7d9[_0x2627('0x3f')]=qs['limit'](_0x141db7['query'][_0x2627('0x3f')]);_0x39b7d9[_0x2627('0x22')]=qs[_0x2627('0x22')](_0x141db7[_0x2627('0x35')][_0x2627('0x22')]);}return _0x35dc2f[_0x2627('0x54')](_0x39b7d9);}})[_0x2627('0x29')](function(_0x442663){if(_0x442663){return _0x442663?{'count':_0x25a38f,'rows':_0x442663}:null;}})['then'](respondWithResult(_0x417cf2,null))[_0x2627('0x4a')](handleError(_0x417cf2,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 8ed5729..48af30f 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 _0x33ed=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x33ed,0x1c3));var _0xd33e=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0x33ed[_0x568cf0];return _0x360f81;};'use strict';var _=require(_0xd33e('0x0'));var util=require(_0xd33e('0x1'));var logger=require(_0xd33e('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd33e('0x3'));var rp=require(_0xd33e('0x4'));var fs=require('fs');var path=require(_0xd33e('0x5'));var rimraf=require(_0xd33e('0x6'));var config=require(_0xd33e('0x7'));var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x150bad,_0x4b2e0f){return _0x150bad[_0xd33e('0x8')](_0xd33e('0x9'),attributes,{'tableName':_0xd33e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6e6=['lodash','util','api','bluebird','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0xc6e6,0xa5));var _0x6c6e=function(_0xe88bd5,_0x327861){_0xe88bd5=_0xe88bd5-0x0;var _0x254b46=_0xc6e6[_0xe88bd5];return _0x254b46;};'use strict';var _=require(_0x6c6e('0x0'));var util=require(_0x6c6e('0x1'));var logger=require('../../config/logger')(_0x6c6e('0x2'));var moment=require('moment');var BPromise=require(_0x6c6e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c6e('0x4'));var rimraf=require(_0x6c6e('0x5'));var config=require(_0x6c6e('0x6'));var attributes=require('./intZohoConfiguration.attributes');module[_0x6c6e('0x7')]=function(_0x16b0b2,_0x11ab04){return _0x16b0b2[_0x6c6e('0x8')](_0x6c6e('0x9'),attributes,{'tableName':_0x6c6e('0xa'),'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 0e86994..77ada19 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 _0x018d=['client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x342fff,_0xb16078){var _0x115b0d=function(_0x5c9ecf){while(--_0x5c9ecf){_0x342fff['push'](_0x342fff['shift']());}};_0x115b0d(++_0xb16078);}(_0x018d,0xa3));var _0xd018=function(_0x56e984,_0x57363d){_0x56e984=_0x56e984-0x0;var _0x4cb323=_0x018d[_0x56e984];return _0x4cb323;};'use strict';var _=require(_0xd018('0x0'));var util=require(_0xd018('0x1'));var moment=require(_0xd018('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd018('0x3'));var db=require(_0xd018('0x4'))['db'];var utils=require(_0xd018('0x5'));var logger=require(_0xd018('0x6'))('rpc');var config=require(_0xd018('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd018('0x8')][_0xd018('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x166cc9,_0x1719cb,_0x43d46f){return new BPromise(function(_0x1cb047,_0x218cb4){return client['request'](_0x166cc9,_0x43d46f)['then'](function(_0x16dc71){logger[_0xd018('0xa')](_0xd018('0xb'),_0x1719cb,_0xd018('0xc'));logger[_0xd018('0xd')](_0xd018('0xe'),_0x1719cb,_0xd018('0xc'),JSON['stringify'](_0x16dc71));if(_0x16dc71['error']){if(_0x16dc71[_0xd018('0xf')]['code']===0x1f4){logger[_0xd018('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1719cb,_0x16dc71['error'][_0xd018('0x10')]);return _0x218cb4(_0x16dc71[_0xd018('0xf')][_0xd018('0x10')]);}logger[_0xd018('0xf')](_0xd018('0xb'),_0x1719cb,_0x16dc71['error'][_0xd018('0x10')]);return _0x1cb047(_0x16dc71[_0xd018('0xf')][_0xd018('0x10')]);}else{logger['info'](_0xd018('0xb'),_0x1719cb,_0xd018('0xc'));_0x1cb047(_0x16dc71[_0xd018('0x11')][_0xd018('0x10')]);}})[_0xd018('0x12')](function(_0x1d6e5a){logger[_0xd018('0xf')](_0xd018('0xb'),_0x1719cb,_0x1d6e5a);_0x218cb4(_0x1d6e5a);});});} \ No newline at end of file +var _0x62a1=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x5dc227,_0x53b6dc){var _0x17e9ba=function(_0x2c56d8){while(--_0x2c56d8){_0x5dc227['push'](_0x5dc227['shift']());}};_0x17e9ba(++_0x53b6dc);}(_0x62a1,0x105));var _0x162a=function(_0x2c77f5,_0x2cc7c5){_0x2c77f5=_0x2c77f5-0x0;var _0x3d5f1b=_0x62a1[_0x2c77f5];return _0x3d5f1b;};'use strict';var _=require('lodash');var util=require(_0x162a('0x0'));var moment=require('moment');var BPromise=require(_0x162a('0x1'));var rs=require(_0x162a('0x2'));var fs=require('fs');var Redis=require(_0x162a('0x3'));var db=require(_0x162a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x162a('0x5'))(_0x162a('0x6'));var config=require('../../config/environment');var jayson=require(_0x162a('0x7'));var client=jayson[_0x162a('0x8')][_0x162a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x424285,_0xd46db8,_0x3f3d96){return new BPromise(function(_0x3136bd,_0x23fde9){return client[_0x162a('0xa')](_0x424285,_0x3f3d96)['then'](function(_0x241966){logger[_0x162a('0xb')](_0x162a('0xc'),_0xd46db8,_0x162a('0xd'));logger[_0x162a('0xe')](_0x162a('0xf'),_0xd46db8,'request\x20sent',JSON['stringify'](_0x241966));if(_0x241966['error']){if(_0x241966['error'][_0x162a('0x10')]===0x1f4){logger[_0x162a('0x11')](_0x162a('0xc'),_0xd46db8,_0x241966[_0x162a('0x11')][_0x162a('0x12')]);return _0x23fde9(_0x241966[_0x162a('0x11')][_0x162a('0x12')]);}logger['error'](_0x162a('0xc'),_0xd46db8,_0x241966[_0x162a('0x11')][_0x162a('0x12')]);return _0x3136bd(_0x241966[_0x162a('0x11')][_0x162a('0x12')]);}else{logger['info'](_0x162a('0xc'),_0xd46db8,_0x162a('0xd'));_0x3136bd(_0x241966[_0x162a('0x13')][_0x162a('0x12')]);}})[_0x162a('0x14')](function(_0xc312f5){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xd46db8,_0xc312f5);_0x23fde9(_0xc312f5);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 801f12f..5663b24 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 _0x5071=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','/:id','isAuthenticated','post','put','update','delete','util','path','connect-timeout','express'];(function(_0x1f7591,_0x989408){var _0x11cfde=function(_0x34a3f1){while(--_0x34a3f1){_0x1f7591['push'](_0x1f7591['shift']());}};_0x11cfde(++_0x989408);}(_0x5071,0xbf));var _0x1507=function(_0x53d9a7,_0x44c4a3){_0x53d9a7=_0x53d9a7-0x0;var _0x1c8958=_0x5071[_0x53d9a7];return _0x1c8958;};'use strict';var multer=require('multer');var util=require(_0x1507('0x0'));var path=require(_0x1507('0x1'));var timeout=require(_0x1507('0x2'));var express=require(_0x1507('0x3'));var router=express[_0x1507('0x4')]();var fs_extra=require(_0x1507('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1507('0x6'));var config=require(_0x1507('0x7'));var controller=require(_0x1507('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1507('0x9'),auth[_0x1507('0xa')](),controller['show']);router[_0x1507('0xb')]('/',auth[_0x1507('0xa')](),controller['create']);router[_0x1507('0xc')]('/:id',auth[_0x1507('0xa')](),controller[_0x1507('0xd')]);router[_0x1507('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5730=['connect-timeout','../../components/interaction/service','../../config/environment','./intZohoField.controller','index','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','path'];(function(_0x3c95c7,_0x548075){var _0x5e0f4e=function(_0x869d6f){while(--_0x869d6f){_0x3c95c7['push'](_0x3c95c7['shift']());}};_0x5e0f4e(++_0x548075);}(_0x5730,0x65));var _0x0573=function(_0x2ef873,_0x1538d9){_0x2ef873=_0x2ef873-0x0;var _0x262ea6=_0x5730[_0x2ef873];return _0x262ea6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0573('0x0'));var timeout=require(_0x0573('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0573('0x2'));var config=require(_0x0573('0x3'));var controller=require(_0x0573('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x0573('0x5')]);router[_0x0573('0x6')](_0x0573('0x7'),auth['isAuthenticated'](),controller[_0x0573('0x8')]);router[_0x0573('0x9')]('/',auth['isAuthenticated'](),controller[_0x0573('0xa')]);router[_0x0573('0xb')](_0x0573('0x7'),auth[_0x0573('0xc')](),controller[_0x0573('0xd')]);router[_0x0573('0xe')](_0x0573('0x7'),auth[_0x0573('0xc')](),controller[_0x0573('0xf')]);module[_0x0573('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index eb01c50..42dd1f4 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 _0xf05a=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xf05a,0x72));var _0xaf05=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf05a[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xaf05('0x0'));module[_0xaf05('0x1')]={'type':{'type':Sequelize[_0xaf05('0x2')](_0xaf05('0x3'),_0xaf05('0x4'),_0xaf05('0x5'),_0xaf05('0x6'),'picklist'),'defaultValue':_0xaf05('0x3')},'content':{'type':Sequelize[_0xaf05('0x7')]},'key':{'type':Sequelize[_0xaf05('0x7')]},'keyType':{'type':Sequelize[_0xaf05('0x2')](_0xaf05('0x3'),'variable',_0xaf05('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaf05('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf05('0x7')]}}; \ No newline at end of file +var _0x97b5=['keyValue','string','STRING','ENUM','variable','customVariable'];(function(_0x42eb51,_0xafa7f2){var _0x403569=function(_0x51d5b9){while(--_0x51d5b9){_0x42eb51['push'](_0x42eb51['shift']());}};_0x403569(++_0xafa7f2);}(_0x97b5,0x130));var _0x597b=function(_0x4fc4e7,_0x16bfc4){_0x4fc4e7=_0x4fc4e7-0x0;var _0x297133=_0x97b5[_0x4fc4e7];return _0x297133;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x597b('0x0'),_0x597b('0x1'),_0x597b('0x2'),'picklist'),'defaultValue':_0x597b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x597b('0x4')]},'keyType':{'type':Sequelize[_0x597b('0x5')](_0x597b('0x3'),_0x597b('0x0'),_0x597b('0x1'))},'keyContent':{'type':Sequelize[_0x597b('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x597b('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x597b('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4980d2e..f81118c 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 _0x0185=['limit','count','json','reject','then','destroy','stack','name','send','map','ZohoField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x46117a,_0x19d46b){var _0xbac905=function(_0x3c1e58){while(--_0x3c1e58){_0x46117a['push'](_0x46117a['shift']());}};_0xbac905(++_0x19d46b);}(_0x0185,0xb3));var _0x5018=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x0185[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0x5018('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5018('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5018('0x2'));var moment=require(_0x5018('0x3'));var BPromise=require(_0x5018('0x4'));var Mustache=require(_0x5018('0x5'));var util=require(_0x5018('0x6'));var path=require('path');var sox=require(_0x5018('0x7'));var csv=require(_0x5018('0x8'));var ejs=require(_0x5018('0x9'));var fs=require('fs');var fs_extra=require(_0x5018('0xa'));var _=require(_0x5018('0xb'));var squel=require(_0x5018('0xc'));var crypto=require(_0x5018('0xd'));var jsforce=require(_0x5018('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5018('0xf'));var Papa=require(_0x5018('0x10'));var Redis=require(_0x5018('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5018('0x12'));var as=require(_0x5018('0x13'));var hardwareService=require(_0x5018('0x14'));var logger=require(_0x5018('0x15'))('api');var utils=require(_0x5018('0x16'));var config=require(_0x5018('0x17'));var licenseUtil=require(_0x5018('0x18'));var db=require(_0x5018('0x19'))['db'];function respondWithStatusCode(_0x57df45,_0x4c0358){_0x4c0358=_0x4c0358||0xcc;return function(_0x7db5be){if(_0x7db5be){return _0x57df45[_0x5018('0x1a')](_0x4c0358);}return _0x57df45[_0x5018('0x1b')](_0x4c0358)[_0x5018('0x1c')]();};}function respondWithResult(_0x278149,_0x4660b4){_0x4660b4=_0x4660b4||0xc8;return function(_0xc3100c){if(_0xc3100c){return _0x278149[_0x5018('0x1b')](_0x4660b4)['json'](_0xc3100c);}};}function respondWithFilteredResult(_0x43844f,_0x553eaa){return function(_0x3324e9){if(_0x3324e9){var _0xffd182=typeof _0x553eaa[_0x5018('0x1d')]===_0x5018('0x1e')&&typeof _0x553eaa[_0x5018('0x1f')]===_0x5018('0x1e');var _0x47544f=_0x3324e9['count'];var _0x2159d8=_0xffd182?0x0:_0x553eaa[_0x5018('0x1d')];var _0x167611=_0xffd182?_0x3324e9[_0x5018('0x20')]:_0x553eaa[_0x5018('0x1d')]+_0x553eaa[_0x5018('0x1f')];var _0xf05cb5;if(_0x167611>=_0x47544f){_0x167611=_0x47544f;_0xf05cb5=0xc8;}else{_0xf05cb5=0xce;}_0x43844f[_0x5018('0x1b')](_0xf05cb5);return _0x43844f['set']('Content-Range',_0x2159d8+'-'+_0x167611+'/'+_0x47544f)[_0x5018('0x21')](_0x3324e9);}return null;};}function patchUpdates(_0x5411c5){return function(_0x4ed192){try{jsonpatch['apply'](_0x4ed192,_0x5411c5,!![]);}catch(_0x12e804){return BPromise[_0x5018('0x22')](_0x12e804);}return _0x4ed192['save']();};}function saveUpdates(_0x337aed,_0x2d39fe){return function(_0x155b9b){if(_0x155b9b){return _0x155b9b['update'](_0x337aed)[_0x5018('0x23')](function(_0x54f5cb){return _0x54f5cb;});}return null;};}function removeEntity(_0x30793e,_0x323b19){return function(_0x3d19fd){if(_0x3d19fd){return _0x3d19fd[_0x5018('0x24')]()[_0x5018('0x23')](function(){_0x30793e[_0x5018('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2260e6,_0x56932f){return function(_0x1982d8){if(!_0x1982d8){_0x2260e6[_0x5018('0x1a')](0x194);}return _0x1982d8;};}function handleError(_0x107b78,_0x54913e){_0x54913e=_0x54913e||0x1f4;return function(_0x5d9133){logger['error'](_0x5d9133[_0x5018('0x25')]);if(_0x5d9133[_0x5018('0x26')]){delete _0x5d9133['name'];}_0x107b78['status'](_0x54913e)[_0x5018('0x27')](_0x5d9133);};}exports['index']=function(_0x89d812,_0x47b1f3){var _0x1efe03={},_0x56a3ed={},_0x54a836={'count':0x0,'rows':[]};var _0x468cb6=_[_0x5018('0x28')](db[_0x5018('0x29')]['rawAttributes'],function(_0x299497){return{'name':_0x299497[_0x5018('0x2a')],'type':_0x299497[_0x5018('0x2b')][_0x5018('0x2c')]};});_0x56a3ed[_0x5018('0x2d')]=_['map'](_0x468cb6,'name');_0x56a3ed[_0x5018('0x2e')]=_[_0x5018('0x2f')](_0x89d812[_0x5018('0x2e')]);_0x56a3ed[_0x5018('0x30')]=_[_0x5018('0x31')](_0x56a3ed['model'],_0x56a3ed[_0x5018('0x2e')]);_0x1efe03[_0x5018('0x32')]=_[_0x5018('0x31')](_0x56a3ed[_0x5018('0x2d')],qs[_0x5018('0x33')](_0x89d812[_0x5018('0x2e')]['fields']));_0x1efe03[_0x5018('0x32')]=_0x1efe03[_0x5018('0x32')][_0x5018('0x34')]?_0x1efe03[_0x5018('0x32')]:_0x56a3ed[_0x5018('0x2d')];if(!_0x89d812[_0x5018('0x2e')][_0x5018('0x35')]('nolimit')){_0x1efe03[_0x5018('0x1f')]=qs['limit'](_0x89d812[_0x5018('0x2e')][_0x5018('0x1f')]);_0x1efe03[_0x5018('0x1d')]=qs['offset'](_0x89d812[_0x5018('0x2e')][_0x5018('0x1d')]);}_0x1efe03['order']=qs[_0x5018('0x36')](_0x89d812['query'][_0x5018('0x36')]);_0x1efe03[_0x5018('0x37')]=qs[_0x5018('0x30')](_[_0x5018('0x38')](_0x89d812[_0x5018('0x2e')],_0x56a3ed[_0x5018('0x30')]),_0x468cb6);if(_0x89d812[_0x5018('0x2e')]['filter']){_0x1efe03['where']=_[_0x5018('0x39')](_0x1efe03[_0x5018('0x37')],{'$or':_[_0x5018('0x28')](_0x468cb6,function(_0x5be355){if(_0x5be355[_0x5018('0x2b')]!==_0x5018('0x3a')){var _0x1a5cc3={};_0x1a5cc3[_0x5be355[_0x5018('0x26')]]={'$like':'%'+_0x89d812[_0x5018('0x2e')][_0x5018('0x3b')]+'%'};return _0x1a5cc3;}})});}_0x1efe03=_[_0x5018('0x39')]({},_0x1efe03,_0x89d812[_0x5018('0x3c')]);var _0x130b48={'where':_0x1efe03[_0x5018('0x37')]};return db[_0x5018('0x29')][_0x5018('0x20')](_0x130b48)[_0x5018('0x23')](function(_0x4bb43f){_0x54a836[_0x5018('0x20')]=_0x4bb43f;if(_0x89d812['query']['includeAll']){_0x1efe03[_0x5018('0x3d')]=[{'all':!![]}];}return db['ZohoField'][_0x5018('0x3e')](_0x1efe03);})['then'](function(_0xdb3a7f){_0x54a836[_0x5018('0x3f')]=_0xdb3a7f;return _0x54a836;})[_0x5018('0x23')](respondWithFilteredResult(_0x47b1f3,_0x1efe03))[_0x5018('0x40')](handleError(_0x47b1f3,null));};exports['show']=function(_0x50734f,_0x4dfdb2){var _0x551654={'raw':!![],'where':{'id':_0x50734f[_0x5018('0x41')]['id']}},_0x25d386={};_0x25d386[_0x5018('0x2d')]=_[_0x5018('0x2f')](db[_0x5018('0x29')]['rawAttributes']);_0x25d386['query']=_['keys'](_0x50734f['query']);_0x25d386[_0x5018('0x30')]=_[_0x5018('0x31')](_0x25d386[_0x5018('0x2d')],_0x25d386[_0x5018('0x2e')]);_0x551654[_0x5018('0x32')]=_[_0x5018('0x31')](_0x25d386['model'],qs[_0x5018('0x33')](_0x50734f[_0x5018('0x2e')][_0x5018('0x33')]));_0x551654[_0x5018('0x32')]=_0x551654[_0x5018('0x32')][_0x5018('0x34')]?_0x551654[_0x5018('0x32')]:_0x25d386[_0x5018('0x2d')];if(_0x50734f[_0x5018('0x2e')][_0x5018('0x42')]){_0x551654['include']=[{'all':!![]}];}_0x551654=_[_0x5018('0x39')]({},_0x551654,_0x50734f[_0x5018('0x3c')]);return db['ZohoField'][_0x5018('0x43')](_0x551654)[_0x5018('0x23')](handleEntityNotFound(_0x4dfdb2,null))[_0x5018('0x23')](respondWithResult(_0x4dfdb2,null))['catch'](handleError(_0x4dfdb2,null));};exports['create']=function(_0x373dc1,_0x3261b7){return db['ZohoField'][_0x5018('0x44')](_0x373dc1[_0x5018('0x45')],{})[_0x5018('0x23')](respondWithResult(_0x3261b7,0xc9))[_0x5018('0x40')](handleError(_0x3261b7,null));};exports['update']=function(_0x59d89a,_0x546e82){if(_0x59d89a[_0x5018('0x45')]['id']){delete _0x59d89a[_0x5018('0x45')]['id'];}return db[_0x5018('0x29')][_0x5018('0x43')]({'where':{'id':_0x59d89a['params']['id']}})[_0x5018('0x23')](handleEntityNotFound(_0x546e82,null))[_0x5018('0x23')](saveUpdates(_0x59d89a[_0x5018('0x45')],null))[_0x5018('0x23')](respondWithResult(_0x546e82,null))[_0x5018('0x40')](handleError(_0x546e82,null));};exports['destroy']=function(_0xa7c69b,_0x5ec4fa){return db[_0x5018('0x29')][_0x5018('0x43')]({'where':{'id':_0xa7c69b['params']['id']}})['then'](handleEntityNotFound(_0x5ec4fa,null))[_0x5018('0x23')](removeEntity(_0x5ec4fa,null))[_0x5018('0x40')](handleError(_0x5ec4fa,null));}; \ No newline at end of file +var _0x4f17=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','include','ZohoField','findAll','catch','show','find','create','body','params','eml-format','rimraf'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x4f17,0x9c));var _0x74f1=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x4f17[_0xfb0281];return _0x408dd3;};'use strict';var emlformat=require(_0x74f1('0x0'));var rimraf=require(_0x74f1('0x1'));var zipdir=require(_0x74f1('0x2'));var jsonpatch=require(_0x74f1('0x3'));var rp=require(_0x74f1('0x4'));var moment=require(_0x74f1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x74f1('0x6'));var util=require(_0x74f1('0x7'));var path=require(_0x74f1('0x8'));var sox=require(_0x74f1('0x9'));var csv=require(_0x74f1('0xa'));var ejs=require(_0x74f1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74f1('0xc'));var squel=require(_0x74f1('0xd'));var crypto=require(_0x74f1('0xe'));var jsforce=require(_0x74f1('0xf'));var deskjs=require(_0x74f1('0x10'));var toCsv=require(_0x74f1('0xa'));var querystring=require(_0x74f1('0x11'));var Papa=require(_0x74f1('0x12'));var Redis=require(_0x74f1('0x13'));var authService=require(_0x74f1('0x14'));var qs=require(_0x74f1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74f1('0x16'));var logger=require(_0x74f1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x74f1('0x18'));var licenseUtil=require(_0x74f1('0x19'));var db=require(_0x74f1('0x1a'))['db'];function respondWithStatusCode(_0x2a6d68,_0x32388f){_0x32388f=_0x32388f||0xcc;return function(_0xaff57f){if(_0xaff57f){return _0x2a6d68[_0x74f1('0x1b')](_0x32388f);}return _0x2a6d68[_0x74f1('0x1c')](_0x32388f)[_0x74f1('0x1d')]();};}function respondWithResult(_0x5ca6d2,_0x2b4742){_0x2b4742=_0x2b4742||0xc8;return function(_0xfe3b9d){if(_0xfe3b9d){return _0x5ca6d2[_0x74f1('0x1c')](_0x2b4742)['json'](_0xfe3b9d);}};}function respondWithFilteredResult(_0x93e29f,_0x211101){return function(_0x2d0c27){if(_0x2d0c27){var _0x351e6c=typeof _0x211101['offset']==='undefined'&&typeof _0x211101[_0x74f1('0x1e')]===_0x74f1('0x1f');var _0x4956a9=_0x2d0c27[_0x74f1('0x20')];var _0xc231f5=_0x351e6c?0x0:_0x211101[_0x74f1('0x21')];var _0x1cdc85=_0x351e6c?_0x2d0c27[_0x74f1('0x20')]:_0x211101[_0x74f1('0x21')]+_0x211101[_0x74f1('0x1e')];var _0x2001ac;if(_0x1cdc85>=_0x4956a9){_0x1cdc85=_0x4956a9;_0x2001ac=0xc8;}else{_0x2001ac=0xce;}_0x93e29f['status'](_0x2001ac);return _0x93e29f[_0x74f1('0x22')](_0x74f1('0x23'),_0xc231f5+'-'+_0x1cdc85+'/'+_0x4956a9)['json'](_0x2d0c27);}return null;};}function patchUpdates(_0x46c8cd){return function(_0x4848e1){try{jsonpatch[_0x74f1('0x24')](_0x4848e1,_0x46c8cd,!![]);}catch(_0x4c5e06){return BPromise[_0x74f1('0x25')](_0x4c5e06);}return _0x4848e1[_0x74f1('0x26')]();};}function saveUpdates(_0xd58d3c,_0x1e1cd7){return function(_0x5ce42d){if(_0x5ce42d){return _0x5ce42d[_0x74f1('0x27')](_0xd58d3c)['then'](function(_0x32d2ba){return _0x32d2ba;});}return null;};}function removeEntity(_0x460709,_0x3df55b){return function(_0x43eb92){if(_0x43eb92){return _0x43eb92[_0x74f1('0x28')]()['then'](function(){_0x460709[_0x74f1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45038e,_0x3ad817){return function(_0xe549f2){if(!_0xe549f2){_0x45038e[_0x74f1('0x1b')](0x194);}return _0xe549f2;};}function handleError(_0xf8a3c4,_0x41214a){_0x41214a=_0x41214a||0x1f4;return function(_0x37514a){logger[_0x74f1('0x29')](_0x37514a[_0x74f1('0x2a')]);if(_0x37514a[_0x74f1('0x2b')]){delete _0x37514a['name'];}_0xf8a3c4[_0x74f1('0x1c')](_0x41214a)[_0x74f1('0x2c')](_0x37514a);};}exports[_0x74f1('0x2d')]=function(_0x5e9bef,_0x4e4f8a){var _0x35bc56={},_0x53d46c={},_0x373151={'count':0x0,'rows':[]};var _0x447497=_[_0x74f1('0x2e')](db['ZohoField'][_0x74f1('0x2f')],function(_0x256fae){return{'name':_0x256fae[_0x74f1('0x30')],'type':_0x256fae['type'][_0x74f1('0x31')]};});_0x53d46c[_0x74f1('0x32')]=_['map'](_0x447497,'name');_0x53d46c[_0x74f1('0x33')]=_[_0x74f1('0x34')](_0x5e9bef[_0x74f1('0x33')]);_0x53d46c[_0x74f1('0x35')]=_[_0x74f1('0x36')](_0x53d46c[_0x74f1('0x32')],_0x53d46c[_0x74f1('0x33')]);_0x35bc56['attributes']=_['intersection'](_0x53d46c[_0x74f1('0x32')],qs[_0x74f1('0x37')](_0x5e9bef['query']['fields']));_0x35bc56[_0x74f1('0x38')]=_0x35bc56[_0x74f1('0x38')]['length']?_0x35bc56[_0x74f1('0x38')]:_0x53d46c[_0x74f1('0x32')];if(!_0x5e9bef[_0x74f1('0x33')][_0x74f1('0x39')](_0x74f1('0x3a'))){_0x35bc56[_0x74f1('0x1e')]=qs[_0x74f1('0x1e')](_0x5e9bef['query'][_0x74f1('0x1e')]);_0x35bc56[_0x74f1('0x21')]=qs[_0x74f1('0x21')](_0x5e9bef[_0x74f1('0x33')][_0x74f1('0x21')]);}_0x35bc56[_0x74f1('0x3b')]=qs['sort'](_0x5e9bef[_0x74f1('0x33')][_0x74f1('0x3c')]);_0x35bc56[_0x74f1('0x3d')]=qs['filters'](_[_0x74f1('0x3e')](_0x5e9bef[_0x74f1('0x33')],_0x53d46c[_0x74f1('0x35')]),_0x447497);if(_0x5e9bef[_0x74f1('0x33')]['filter']){_0x35bc56[_0x74f1('0x3d')]=_[_0x74f1('0x3f')](_0x35bc56[_0x74f1('0x3d')],{'$or':_['map'](_0x447497,function(_0x26b140){if(_0x26b140[_0x74f1('0x40')]!==_0x74f1('0x41')){var _0x7abc3b={};_0x7abc3b[_0x26b140['name']]={'$like':'%'+_0x5e9bef[_0x74f1('0x33')][_0x74f1('0x42')]+'%'};return _0x7abc3b;}})});}_0x35bc56=_[_0x74f1('0x3f')]({},_0x35bc56,_0x5e9bef[_0x74f1('0x43')]);var _0x1f851e={'where':_0x35bc56[_0x74f1('0x3d')]};return db['ZohoField']['count'](_0x1f851e)[_0x74f1('0x44')](function(_0x15c593){_0x373151[_0x74f1('0x20')]=_0x15c593;if(_0x5e9bef['query'][_0x74f1('0x45')]){_0x35bc56[_0x74f1('0x46')]=[{'all':!![]}];}return db[_0x74f1('0x47')][_0x74f1('0x48')](_0x35bc56);})[_0x74f1('0x44')](function(_0x483c00){_0x373151['rows']=_0x483c00;return _0x373151;})[_0x74f1('0x44')](respondWithFilteredResult(_0x4e4f8a,_0x35bc56))[_0x74f1('0x49')](handleError(_0x4e4f8a,null));};exports[_0x74f1('0x4a')]=function(_0x54015c,_0x3d8f25){var _0x4b3056={'raw':!![],'where':{'id':_0x54015c['params']['id']}},_0x16658e={};_0x16658e[_0x74f1('0x32')]=_[_0x74f1('0x34')](db[_0x74f1('0x47')][_0x74f1('0x2f')]);_0x16658e[_0x74f1('0x33')]=_[_0x74f1('0x34')](_0x54015c[_0x74f1('0x33')]);_0x16658e['filters']=_['intersection'](_0x16658e[_0x74f1('0x32')],_0x16658e[_0x74f1('0x33')]);_0x4b3056[_0x74f1('0x38')]=_[_0x74f1('0x36')](_0x16658e[_0x74f1('0x32')],qs[_0x74f1('0x37')](_0x54015c['query']['fields']));_0x4b3056['attributes']=_0x4b3056[_0x74f1('0x38')]['length']?_0x4b3056[_0x74f1('0x38')]:_0x16658e['model'];if(_0x54015c[_0x74f1('0x33')][_0x74f1('0x45')]){_0x4b3056[_0x74f1('0x46')]=[{'all':!![]}];}_0x4b3056=_[_0x74f1('0x3f')]({},_0x4b3056,_0x54015c[_0x74f1('0x43')]);return db['ZohoField'][_0x74f1('0x4b')](_0x4b3056)[_0x74f1('0x44')](handleEntityNotFound(_0x3d8f25,null))[_0x74f1('0x44')](respondWithResult(_0x3d8f25,null))[_0x74f1('0x49')](handleError(_0x3d8f25,null));};exports[_0x74f1('0x4c')]=function(_0x1b1336,_0x5210af){return db[_0x74f1('0x47')]['create'](_0x1b1336[_0x74f1('0x4d')],{})[_0x74f1('0x44')](respondWithResult(_0x5210af,0xc9))[_0x74f1('0x49')](handleError(_0x5210af,null));};exports[_0x74f1('0x27')]=function(_0x3dcb59,_0x37aad9){if(_0x3dcb59[_0x74f1('0x4d')]['id']){delete _0x3dcb59[_0x74f1('0x4d')]['id'];}return db[_0x74f1('0x47')][_0x74f1('0x4b')]({'where':{'id':_0x3dcb59['params']['id']}})[_0x74f1('0x44')](handleEntityNotFound(_0x37aad9,null))[_0x74f1('0x44')](saveUpdates(_0x3dcb59[_0x74f1('0x4d')],null))[_0x74f1('0x44')](respondWithResult(_0x37aad9,null))['catch'](handleError(_0x37aad9,null));};exports[_0x74f1('0x28')]=function(_0x27d99b,_0x1a22b4){return db[_0x74f1('0x47')]['find']({'where':{'id':_0x27d99b[_0x74f1('0x4e')]['id']}})[_0x74f1('0x44')](handleEntityNotFound(_0x1a22b4,null))['then'](removeEntity(_0x1a22b4,null))[_0x74f1('0x49')](handleError(_0x1a22b4,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a02270d..2912055 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 _0xafc4=['bluebird','request-promise','path','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x21f970,_0x1e8bbb){var _0x23df47=function(_0x340493){while(--_0x340493){_0x21f970['push'](_0x21f970['shift']());}};_0x23df47(++_0x1e8bbb);}(_0xafc4,0x69));var _0x4afc=function(_0x6873c5,_0x5cb1fc){_0x6873c5=_0x6873c5-0x0;var _0x4bb50e=_0xafc4[_0x6873c5];return _0x4bb50e;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4afc('0xa'),_0x4afc('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5a3c7b,_0x3fad44){var _0x5763f5=function(_0x238f9b){while(--_0x238f9b){_0x5a3c7b['push'](_0x5a3c7b['shift']());}};_0x5763f5(++_0x3fad44);}(_0x0120,0x6f));var _0x0012=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x0120[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 11154a2..5b4b305 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 _0x881a=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x881a,0x1e9));var _0xa881=function(_0x336d19,_0x3767d0){_0x336d19=_0x336d19-0x0;var _0x419656=_0x881a[_0x336d19];return _0x419656;};'use strict';var _=require(_0xa881('0x0'));var util=require(_0xa881('0x1'));var moment=require('moment');var BPromise=require(_0xa881('0x2'));var rs=require(_0xa881('0x3'));var fs=require('fs');var Redis=require(_0xa881('0x4'));var db=require(_0xa881('0x5'))['db'];var utils=require(_0xa881('0x6'));var logger=require('../../config/logger')(_0xa881('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa881('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cef71,_0x2b60bd,_0x4cef02){return new BPromise(function(_0x108a15,_0x1d61dc){return client[_0xa881('0x9')](_0x5cef71,_0x4cef02)[_0xa881('0xa')](function(_0x2dbfe0){logger[_0xa881('0xb')](_0xa881('0xc'),_0x2b60bd,'request\x20sent');logger[_0xa881('0xd')](_0xa881('0xe'),_0x2b60bd,_0xa881('0xf'),JSON[_0xa881('0x10')](_0x2dbfe0));if(_0x2dbfe0[_0xa881('0x11')]){if(_0x2dbfe0[_0xa881('0x11')][_0xa881('0x12')]===0x1f4){logger[_0xa881('0x11')]('ZohoField,\x20%s,\x20%s',_0x2b60bd,_0x2dbfe0[_0xa881('0x11')]['message']);return _0x1d61dc(_0x2dbfe0['error'][_0xa881('0x13')]);}logger[_0xa881('0x11')]('ZohoField,\x20%s,\x20%s',_0x2b60bd,_0x2dbfe0[_0xa881('0x11')]['message']);return _0x108a15(_0x2dbfe0[_0xa881('0x11')][_0xa881('0x13')]);}else{logger[_0xa881('0xb')](_0xa881('0xc'),_0x2b60bd,_0xa881('0xf'));_0x108a15(_0x2dbfe0[_0xa881('0x14')][_0xa881('0x13')]);}})[_0xa881('0x15')](function(_0x52cb3b){logger[_0xa881('0x11')](_0xa881('0xc'),_0x2b60bd,_0x52cb3b);_0x1d61dc(_0x52cb3b);});});} \ No newline at end of file +var _0x00b6=['ZohoField,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4007cd,_0x4e90af){var _0x4aa6f8=function(_0x271739){while(--_0x271739){_0x4007cd['push'](_0x4007cd['shift']());}};_0x4aa6f8(++_0x4e90af);}(_0x00b6,0x92));var _0x600b=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x00b6[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x600b('0x0'));var util=require(_0x600b('0x1'));var moment=require(_0x600b('0x2'));var BPromise=require(_0x600b('0x3'));var rs=require(_0x600b('0x4'));var fs=require('fs');var Redis=require(_0x600b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x600b('0x6'))(_0x600b('0x7'));var config=require(_0x600b('0x8'));var jayson=require(_0x600b('0x9'));var client=jayson[_0x600b('0xa')][_0x600b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x266b93,_0xa69250,_0x59f6cc){return new BPromise(function(_0x2137b9,_0xbeefb6){return client[_0x600b('0xc')](_0x266b93,_0x59f6cc)['then'](function(_0xdd173d){logger[_0x600b('0xd')](_0x600b('0xe'),_0xa69250,_0x600b('0xf'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0xa69250,'request\x20sent',JSON['stringify'](_0xdd173d));if(_0xdd173d[_0x600b('0x10')]){if(_0xdd173d[_0x600b('0x10')][_0x600b('0x11')]===0x1f4){logger['error'](_0x600b('0xe'),_0xa69250,_0xdd173d[_0x600b('0x10')][_0x600b('0x12')]);return _0xbeefb6(_0xdd173d[_0x600b('0x10')][_0x600b('0x12')]);}logger['error'](_0x600b('0xe'),_0xa69250,_0xdd173d['error'][_0x600b('0x12')]);return _0x2137b9(_0xdd173d[_0x600b('0x10')][_0x600b('0x12')]);}else{logger[_0x600b('0xd')](_0x600b('0xe'),_0xa69250,_0x600b('0xf'));_0x2137b9(_0xdd173d['result'][_0x600b('0x12')]);}})[_0x600b('0x13')](function(_0x49635c){logger['error'](_0x600b('0xe'),_0xa69250,_0x49635c);_0xbeefb6(_0x49635c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 66e57b8..23c14e5 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x342fce,_0x3ea24c){var _0x59b07f=function(_0x13352f){while(--_0x13352f){_0x342fce['push'](_0x342fce['shift']());}};_0x59b07f(++_0x3ea24c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xcb91[_0xa79977];return _0x109f10;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x288d65,_0x5d384d){var _0x435590=function(_0x1d8ca8){while(--_0x1d8ca8){_0x288d65['push'](_0x288d65['shift']());}};_0x435590(++_0x5d384d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0xcb91[_0x50d84b];return _0x6d4270;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 6faeaa6..ed29212 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 _0xa85c=['exports','STRING','unique_name_and_version','INTEGER','sequelize'];(function(_0x498dea,_0x5cb3b2){var _0x58c484=function(_0x22492b){while(--_0x22492b){_0x498dea['push'](_0x498dea['shift']());}};_0x58c484(++_0x5cb3b2);}(_0xa85c,0x158));var _0xca85=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0xa85c[_0x38a6c6];return _0x142f0a;};'use strict';var Sequelize=require(_0xca85('0x0'));module[_0xca85('0x1')]={'name':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'unique':_0xca85('0x3')},'main':{'type':Sequelize[_0xca85('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xca85('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xca85('0x2')]},'size':{'type':Sequelize[_0xca85('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xca85('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xca85('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xca85('0x2')]},'link':{'type':Sequelize[_0xca85('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0f0a=['app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x573542,_0x352f0f){var _0x4f709f=function(_0x52d216){while(--_0x52d216){_0x573542['push'](_0x573542['shift']());}};_0x4f709f(++_0x352f0f);}(_0x0f0a,0x6c));var _0xa0f0=function(_0x16b7e5,_0x5305e4){_0x16b7e5=_0x16b7e5-0x0;var _0x40a080=_0x0f0a[_0x16b7e5];return _0x40a080;};'use strict';var Sequelize=require(_0xa0f0('0x0'));module[_0xa0f0('0x1')]={'name':{'type':Sequelize[_0xa0f0('0x2')],'allowNull':![],'unique':_0xa0f0('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa0f0('0x3')},'main':{'type':Sequelize[_0xa0f0('0x2')],'defaultValue':_0xa0f0('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xa0f0('0x2')]},'type':{'type':Sequelize[_0xa0f0('0x2')]},'size':{'type':Sequelize[_0xa0f0('0x5')]},'active':{'type':Sequelize[_0xa0f0('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xa0f0('0x2')]},'logo':{'type':Sequelize[_0xa0f0('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xa0f0('0x7')},'description':{'type':Sequelize[_0xa0f0('0x2')]},'title':{'type':Sequelize[_0xa0f0('0x2')]},'remoteUri':{'type':Sequelize[_0xa0f0('0x2')]},'link':{'type':Sequelize[_0xa0f0('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7464f00..439e164 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 _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x53ec,0x192));var _0xc53e=function(_0x5e6f73,_0x3f27d8){_0x5e6f73=_0x5e6f73-0x0;var _0x432614=_0x53ec[_0x5e6f73];return _0x432614;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));}; \ No newline at end of file +var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4d247c,_0x3dff9e){var _0x42c60c=function(_0x399acd){while(--_0x399acd){_0x4d247c['push'](_0x4d247c['shift']());}};_0x42c60c(++_0x3dff9e);}(_0x2542,0x169));var _0x2254=function(_0x5e10c3,_0x3c00d7){_0x5e10c3=_0x5e10c3-0x0;var _0xd3005d=_0x2542[_0x5e10c3];return _0xd3005d;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5d86a05..f22cc2c 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 _0xfba0=['define','integrations','lodash','../../config/logger','bluebird','request-promise','path','rimraf','./integration.attributes'];(function(_0x2272a5,_0x12cc1d){var _0xcbc51a=function(_0x58f409){while(--_0x58f409){_0x2272a5['push'](_0x2272a5['shift']());}};_0xcbc51a(++_0x12cc1d);}(_0xfba0,0x1c4));var _0x0fba=function(_0x342950,_0x225d79){_0x342950=_0x342950-0x0;var _0x22db1e=_0xfba0[_0x342950];return _0x22db1e;};'use strict';var _=require(_0x0fba('0x0'));var util=require('util');var logger=require(_0x0fba('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0fba('0x2'));var rp=require(_0x0fba('0x3'));var fs=require('fs');var path=require(_0x0fba('0x4'));var rimraf=require(_0x0fba('0x5'));var config=require('../../config/environment');var attributes=require(_0x0fba('0x6'));module['exports']=function(_0x434de4,_0x13c690){return _0x434de4[_0x0fba('0x7')]('Integration',attributes,{'tableName':_0x0fba('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf74b=['./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x520a1b,_0x446485){var _0x11bea9=function(_0x2241cc){while(--_0x2241cc){_0x520a1b['push'](_0x520a1b['shift']());}};_0x11bea9(++_0x446485);}(_0xf74b,0xfc));var _0xbf74=function(_0x61e2c3,_0x4957b6){_0x61e2c3=_0x61e2c3-0x0;var _0x37e9d1=_0xf74b[_0x61e2c3];return _0x37e9d1;};'use strict';var _=require(_0xbf74('0x0'));var util=require(_0xbf74('0x1'));var logger=require(_0xbf74('0x2'))(_0xbf74('0x3'));var moment=require(_0xbf74('0x4'));var BPromise=require(_0xbf74('0x5'));var rp=require(_0xbf74('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf74('0x7'));var config=require('../../config/environment');var attributes=require(_0xbf74('0x8'));module[_0xbf74('0x9')]=function(_0x5931c7,_0x29e15e){return _0x5931c7[_0xbf74('0xa')](_0xbf74('0xb'),attributes,{'tableName':_0xbf74('0xc'),'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 cd14cc4..f1f0d58 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 _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x44f2ae,_0x10707b){var _0x1f50cd=function(_0x2d182d){while(--_0x2d182d){_0x44f2ae['push'](_0x44f2ae['shift']());}};_0x1f50cd(++_0x10707b);}(_0x57ca,0x108));var _0xa57c=function(_0x165184,_0x6f6b4c){_0x165184=_0x165184-0x0;var _0x25046c=_0x57ca[_0x165184];return _0x25046c;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0xdd4f=['lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x43c974,_0x55cc7b){var _0x3bb168=function(_0x40063c){while(--_0x40063c){_0x43c974['push'](_0x43c974['shift']());}};_0x3bb168(++_0x55cc7b);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2767cc,_0x1e78e5){_0x2767cc=_0x2767cc-0x0;var _0x3a4d5b=_0xdd4f[_0x2767cc];return _0x3a4d5b;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x307ac6,_0x3c72d4,_0x51acd6){return new BPromise(function(_0x3cd8e6,_0x563ae6){return client[_0xfdd4('0x9')](_0x307ac6,_0x51acd6)[_0xfdd4('0xa')](function(_0x1e823e){logger['info'](_0xfdd4('0xb'),_0x3c72d4,'request\x20sent');logger[_0xfdd4('0xc')](_0xfdd4('0xd'),_0x3c72d4,_0xfdd4('0xe'),JSON[_0xfdd4('0xf')](_0x1e823e));if(_0x1e823e[_0xfdd4('0x10')]){if(_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x11')]===0x1f4){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e[_0xfdd4('0x10')][_0xfdd4('0x12')]);return _0x563ae6(_0x1e823e['error'][_0xfdd4('0x12')]);}logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x1e823e['error'][_0xfdd4('0x12')]);return _0x3cd8e6(_0x1e823e['error'][_0xfdd4('0x12')]);}else{logger[_0xfdd4('0x13')](_0xfdd4('0xb'),_0x3c72d4,_0xfdd4('0xe'));_0x3cd8e6(_0x1e823e[_0xfdd4('0x14')]['message']);}})['catch'](function(_0x559c77){logger[_0xfdd4('0x10')](_0xfdd4('0xb'),_0x3c72d4,_0x559c77);_0x563ae6(_0x559c77);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index bf2e1ed..a0c7c24 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 _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xdb28,0x106));var _0x8db2=function(_0x34d558,_0x1d1a5f){_0x34d558=_0x34d558-0x0;var _0x4b3408=_0xdb28[_0x34d558];return _0x4b3408;};'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('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x150654,_0x22e377){var _0x28dbee=function(_0x31703f){while(--_0x31703f){_0x150654['push'](_0x150654['shift']());}};_0x28dbee(++_0x22e377);}(_0x66fa,0x117));var _0xa66f=function(_0x595594,_0x49af70){_0x595594=_0x595594-0x0;var _0x57abd2=_0x66fa[_0x595594];return _0x57abd2;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0931542..fc1bc46 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 _0x5b65=['SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x21e76d,_0x273988){var _0x4d54df=function(_0x3cc0ba){while(--_0x3cc0ba){_0x21e76d['push'](_0x21e76d['shift']());}};_0x4d54df(++_0x273988);}(_0x5b65,0x121));var _0x55b6=function(_0x5eeb1a,_0xd2f607){_0x5eeb1a=_0x5eeb1a-0x0;var _0x293625=_0x5b65[_0x5eeb1a];return _0x293625;};'use strict';var Sequelize=require(_0x55b6('0x0'));module[_0x55b6('0x1')]={'integration':{'type':Sequelize[_0x55b6('0x2')]},'eventChannel':{'type':Sequelize[_0x55b6('0x2')]},'exitStatus':{'type':Sequelize[_0x55b6('0x2')]},'ticketId':{'type':Sequelize[_0x55b6('0x2')]},'integrationId':{'type':Sequelize[_0x55b6('0x3')]},'contacts':{'type':Sequelize[_0x55b6('0x2')]},'uniqueid':{'type':Sequelize[_0x55b6('0x2')]},'calleridnum':{'type':Sequelize[_0x55b6('0x2')]},'calleridname':{'type':Sequelize[_0x55b6('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x55b6('0x2')]},'membername':{'type':Sequelize[_0x55b6('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x55b6('0x4')]},'holdtime':{'type':Sequelize[_0x55b6('0x3')]},'agentcomplete':{'type':Sequelize[_0x55b6('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x55b6('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x55b6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x55b6('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x55b6('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x55b6('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x55b6('0x4')]},'lastevent':{'type':Sequelize[_0x55b6('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x55b6('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x55b6('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x55b6('0x2')]},'context':{'type':Sequelize[_0x55b6('0x2')]},'exten':{'type':Sequelize[_0x55b6('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x55b6('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x55b6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x55b6('0x2')]},'destlanguage':{'type':Sequelize[_0x55b6('0x2')]},'destaccountcode':{'type':Sequelize[_0x55b6('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x55b6('0x2')]},'destpriority':{'type':Sequelize[_0x55b6('0x2')]},'destuniqueid':{'type':Sequelize[_0x55b6('0x2')]},'messageId':{'type':Sequelize[_0x55b6('0x2')]},'inReplyTo':{'type':Sequelize[_0x55b6('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x55b6('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x55b6('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x55b6('0x6')]},'status':{'type':Sequelize['ENUM'](_0x55b6('0x7'),_0x55b6('0x8'),_0x55b6('0x9'),_0x55b6('0xa'))},'url':{'type':Sequelize[_0x55b6('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x55b6('0x2')]},'projectId':{'type':Sequelize[_0x55b6('0x3')]}}; \ No newline at end of file +var _0xedf9=['DATE','BOOLEAN','TEXT','ENUM','SENDING','exports','STRING','INTEGER'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xedf9,0x85));var _0x9edf=function(_0x56ad4b,_0x208e9d){_0x56ad4b=_0x56ad4b-0x0;var _0x5992b3=_0xedf9[_0x56ad4b];return _0x5992b3;};'use strict';var Sequelize=require('sequelize');module[_0x9edf('0x0')]={'integration':{'type':Sequelize[_0x9edf('0x1')]},'eventChannel':{'type':Sequelize[_0x9edf('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x9edf('0x1')]},'integrationId':{'type':Sequelize[_0x9edf('0x2')]},'contacts':{'type':Sequelize[_0x9edf('0x1')]},'uniqueid':{'type':Sequelize[_0x9edf('0x1')]},'calleridnum':{'type':Sequelize[_0x9edf('0x1')]},'calleridname':{'type':Sequelize[_0x9edf('0x1')]},'queue':{'type':Sequelize[_0x9edf('0x1')]},'interface':{'type':Sequelize[_0x9edf('0x1')]},'membername':{'type':Sequelize[_0x9edf('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9edf('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9edf('0x3')]},'holdtime':{'type':Sequelize[_0x9edf('0x2')]},'agentcomplete':{'type':Sequelize[_0x9edf('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9edf('0x3')]},'talktime':{'type':Sequelize[_0x9edf('0x2')]},'agentacw':{'type':Sequelize[_0x9edf('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9edf('0x2')]},'reason':{'type':Sequelize[_0x9edf('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x9edf('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9edf('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9edf('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9edf('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edf('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9edf('0x1')]},'context':{'type':Sequelize[_0x9edf('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edf('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edf('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9edf('0x1')]},'destcalleridname':{'type':Sequelize[_0x9edf('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9edf('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9edf('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9edf('0x1')]},'destexten':{'type':Sequelize[_0x9edf('0x1')]},'destpriority':{'type':Sequelize[_0x9edf('0x1')]},'destuniqueid':{'type':Sequelize[_0x9edf('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9edf('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x9edf('0x1')]},'to':{'type':Sequelize[_0x9edf('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x9edf('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x9edf('0x5')]},'status':{'type':Sequelize[_0x9edf('0x6')]('SENT',_0x9edf('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x9edf('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 701b306..ad4c863 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 _0xffca=['then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','IntegrationReport','includeAll','include','findAll','rows','catch','show','merge','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x5bd619,_0x2455ff){var _0x5f12b0=function(_0x16d7c2){while(--_0x16d7c2){_0x5bd619['push'](_0x5bd619['shift']());}};_0x5f12b0(++_0x2455ff);}(_0xffca,0xcc));var _0xaffc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xffca[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0xaffc('0x0'));var rimraf=require(_0xaffc('0x1'));var zipdir=require(_0xaffc('0x2'));var jsonpatch=require(_0xaffc('0x3'));var rp=require(_0xaffc('0x4'));var moment=require(_0xaffc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaffc('0x6'));var util=require(_0xaffc('0x7'));var path=require(_0xaffc('0x8'));var sox=require(_0xaffc('0x9'));var csv=require(_0xaffc('0xa'));var ejs=require(_0xaffc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaffc('0xc'));var squel=require(_0xaffc('0xd'));var crypto=require(_0xaffc('0xe'));var jsforce=require(_0xaffc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaffc('0xa'));var querystring=require('querystring');var Papa=require(_0xaffc('0x10'));var Redis=require(_0xaffc('0x11'));var authService=require(_0xaffc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaffc('0x13'));var logger=require(_0xaffc('0x14'))(_0xaffc('0x15'));var utils=require(_0xaffc('0x16'));var config=require(_0xaffc('0x17'));var licenseUtil=require(_0xaffc('0x18'));var db=require(_0xaffc('0x19'))['db'];function respondWithStatusCode(_0x7c332c,_0x1c9a48){_0x1c9a48=_0x1c9a48||0xcc;return function(_0x3d8882){if(_0x3d8882){return _0x7c332c[_0xaffc('0x1a')](_0x1c9a48);}return _0x7c332c[_0xaffc('0x1b')](_0x1c9a48)['end']();};}function respondWithResult(_0x12728e,_0x1163a7){_0x1163a7=_0x1163a7||0xc8;return function(_0x7f6665){if(_0x7f6665){return _0x12728e[_0xaffc('0x1b')](_0x1163a7)[_0xaffc('0x1c')](_0x7f6665);}};}function respondWithFilteredResult(_0x5532af,_0x8b82df){return function(_0x2b65ce){if(_0x2b65ce){var _0x510532=typeof _0x8b82df[_0xaffc('0x1d')]===_0xaffc('0x1e')&&typeof _0x8b82df[_0xaffc('0x1f')]===_0xaffc('0x1e');var _0x1e06dc=_0x2b65ce[_0xaffc('0x20')];var _0x1fb640=_0x510532?0x0:_0x8b82df['offset'];var _0xca7836=_0x510532?_0x2b65ce[_0xaffc('0x20')]:_0x8b82df[_0xaffc('0x1d')]+_0x8b82df[_0xaffc('0x1f')];var _0x2649f3;if(_0xca7836>=_0x1e06dc){_0xca7836=_0x1e06dc;_0x2649f3=0xc8;}else{_0x2649f3=0xce;}_0x5532af[_0xaffc('0x1b')](_0x2649f3);return _0x5532af[_0xaffc('0x21')](_0xaffc('0x22'),_0x1fb640+'-'+_0xca7836+'/'+_0x1e06dc)[_0xaffc('0x1c')](_0x2b65ce);}return null;};}function patchUpdates(_0x23756d){return function(_0x11a130){try{jsonpatch[_0xaffc('0x23')](_0x11a130,_0x23756d,!![]);}catch(_0x50f8dd){return BPromise[_0xaffc('0x24')](_0x50f8dd);}return _0x11a130[_0xaffc('0x25')]();};}function saveUpdates(_0x4f5f46,_0x4bc531){return function(_0x42384f){if(_0x42384f){return _0x42384f[_0xaffc('0x26')](_0x4f5f46)[_0xaffc('0x27')](function(_0x2a51dc){return _0x2a51dc;});}return null;};}function removeEntity(_0xc6402a,_0x56438a){return function(_0x14c8c8){if(_0x14c8c8){return _0x14c8c8[_0xaffc('0x28')]()['then'](function(){_0xc6402a[_0xaffc('0x1b')](0xcc)[_0xaffc('0x29')]();});}};}function handleEntityNotFound(_0x4f87d2,_0x47189b){return function(_0x5c0d78){if(!_0x5c0d78){_0x4f87d2[_0xaffc('0x1a')](0x194);}return _0x5c0d78;};}function handleError(_0x4f5e84,_0x52b999){_0x52b999=_0x52b999||0x1f4;return function(_0x2cc601){logger[_0xaffc('0x2a')](_0x2cc601[_0xaffc('0x2b')]);if(_0x2cc601[_0xaffc('0x2c')]){delete _0x2cc601['name'];}_0x4f5e84['status'](_0x52b999)['send'](_0x2cc601);};}exports[_0xaffc('0x2d')]=function(_0x15cbfb,_0x1192fa){var _0xad416a={},_0x273e73={},_0x496c03={'count':0x0,'rows':[]};var _0x2d2479=_[_0xaffc('0x2e')](db['IntegrationReport'][_0xaffc('0x2f')],function(_0x411d6a){return{'name':_0x411d6a[_0xaffc('0x30')],'type':_0x411d6a[_0xaffc('0x31')][_0xaffc('0x32')]};});_0x273e73[_0xaffc('0x33')]=_['map'](_0x2d2479,'name');_0x273e73[_0xaffc('0x34')]=_[_0xaffc('0x35')](_0x15cbfb[_0xaffc('0x34')]);_0x273e73[_0xaffc('0x36')]=_[_0xaffc('0x37')](_0x273e73[_0xaffc('0x33')],_0x273e73[_0xaffc('0x34')]);_0xad416a[_0xaffc('0x38')]=_['intersection'](_0x273e73['model'],qs[_0xaffc('0x39')](_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x39')]));_0xad416a[_0xaffc('0x38')]=_0xad416a[_0xaffc('0x38')][_0xaffc('0x3a')]?_0xad416a[_0xaffc('0x38')]:_0x273e73['model'];if(!_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x3b')](_0xaffc('0x3c'))){_0xad416a[_0xaffc('0x1f')]=qs['limit'](_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x1f')]);_0xad416a[_0xaffc('0x1d')]=qs[_0xaffc('0x1d')](_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x1d')]);}_0xad416a[_0xaffc('0x3d')]=qs['sort'](_0x15cbfb['query'][_0xaffc('0x3e')]);_0xad416a[_0xaffc('0x3f')]=qs[_0xaffc('0x36')](_[_0xaffc('0x40')](_0x15cbfb['query'],_0x273e73['filters']),_0x2d2479);if(_0x15cbfb[_0xaffc('0x34')]['filter']){_0xad416a[_0xaffc('0x3f')]=_['merge'](_0xad416a['where'],{'$or':_[_0xaffc('0x2e')](_0x2d2479,function(_0x47e104){if(_0x47e104[_0xaffc('0x31')]!==_0xaffc('0x41')){var _0x4d3b87={};_0x4d3b87[_0x47e104['name']]={'$like':'%'+_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x42')]+'%'};return _0x4d3b87;}})});}_0xad416a=_['merge']({},_0xad416a,_0x15cbfb['options']);var _0x54aa44={'where':_0xad416a['where']};return db[_0xaffc('0x43')]['count'](_0x54aa44)['then'](function(_0x18474e){_0x496c03['count']=_0x18474e;if(_0x15cbfb[_0xaffc('0x34')][_0xaffc('0x44')]){_0xad416a[_0xaffc('0x45')]=[{'all':!![]}];}return db[_0xaffc('0x43')][_0xaffc('0x46')](_0xad416a);})['then'](function(_0x4dcecc){_0x496c03[_0xaffc('0x47')]=_0x4dcecc;return _0x496c03;})['then'](respondWithFilteredResult(_0x1192fa,_0xad416a))[_0xaffc('0x48')](handleError(_0x1192fa,null));};exports[_0xaffc('0x49')]=function(_0x183371,_0x3363aa){var _0x10dc35={'raw':![],'where':{'id':_0x183371['params']['id']}},_0x2965a3={};_0x2965a3[_0xaffc('0x33')]=_[_0xaffc('0x35')](db[_0xaffc('0x43')][_0xaffc('0x2f')]);_0x2965a3[_0xaffc('0x34')]=_[_0xaffc('0x35')](_0x183371[_0xaffc('0x34')]);_0x2965a3[_0xaffc('0x36')]=_['intersection'](_0x2965a3[_0xaffc('0x33')],_0x2965a3['query']);_0x10dc35[_0xaffc('0x38')]=_[_0xaffc('0x37')](_0x2965a3[_0xaffc('0x33')],qs[_0xaffc('0x39')](_0x183371[_0xaffc('0x34')]['fields']));_0x10dc35[_0xaffc('0x38')]=_0x10dc35[_0xaffc('0x38')][_0xaffc('0x3a')]?_0x10dc35[_0xaffc('0x38')]:_0x2965a3['model'];if(_0x183371['query']['includeAll']){_0x10dc35[_0xaffc('0x45')]=[{'all':!![]}];}_0x10dc35=_[_0xaffc('0x4a')]({},_0x10dc35,_0x183371[_0xaffc('0x4b')]);return db[_0xaffc('0x43')][_0xaffc('0x4c')](_0x10dc35)[_0xaffc('0x27')](handleEntityNotFound(_0x3363aa,null))['then'](respondWithResult(_0x3363aa,null))['catch'](handleError(_0x3363aa,null));};exports['create']=function(_0x351694,_0xf5738e){return db[_0xaffc('0x43')][_0xaffc('0x4d')](_0x351694[_0xaffc('0x4e')],{})['then'](respondWithResult(_0xf5738e,0xc9))[_0xaffc('0x48')](handleError(_0xf5738e,null));};exports[_0xaffc('0x26')]=function(_0x4b14a7,_0x3c20ce){if(_0x4b14a7[_0xaffc('0x4e')]['id']){delete _0x4b14a7[_0xaffc('0x4e')]['id'];}return db[_0xaffc('0x43')][_0xaffc('0x4c')]({'where':{'id':_0x4b14a7[_0xaffc('0x4f')]['id']}})[_0xaffc('0x27')](handleEntityNotFound(_0x3c20ce,null))[_0xaffc('0x27')](saveUpdates(_0x4b14a7[_0xaffc('0x4e')],null))[_0xaffc('0x27')](respondWithResult(_0x3c20ce,null))[_0xaffc('0x48')](handleError(_0x3c20ce,null));};exports[_0xaffc('0x28')]=function(_0x12efb6,_0x299a5d){return db[_0xaffc('0x43')][_0xaffc('0x4c')]({'where':{'id':_0x12efb6['params']['id']}})[_0xaffc('0x27')](handleEntityNotFound(_0x299a5d,null))[_0xaffc('0x27')](removeEntity(_0x299a5d,null))[_0xaffc('0x48')](handleError(_0x299a5d,null));};exports['describe']=function(_0x3fb3cd,_0x5adcef){return db[_0xaffc('0x43')][_0xaffc('0x50')]()[_0xaffc('0x27')](respondWithResult(_0x5adcef,null))[_0xaffc('0x48')](handleError(_0x5adcef,null));}; \ No newline at end of file +var _0x5e44=['length','find','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0x5e44,0x134));var _0x45e4=function(_0x12bcac,_0x3a11c2){_0x12bcac=_0x12bcac-0x0;var _0x3bad58=_0x5e44[_0x12bcac];return _0x3bad58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45e4('0x0'));var zipdir=require(_0x45e4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45e4('0x2'));var moment=require(_0x45e4('0x3'));var BPromise=require(_0x45e4('0x4'));var Mustache=require(_0x45e4('0x5'));var util=require(_0x45e4('0x6'));var path=require(_0x45e4('0x7'));var sox=require(_0x45e4('0x8'));var csv=require(_0x45e4('0x9'));var ejs=require(_0x45e4('0xa'));var fs=require('fs');var fs_extra=require(_0x45e4('0xb'));var _=require(_0x45e4('0xc'));var squel=require(_0x45e4('0xd'));var crypto=require(_0x45e4('0xe'));var jsforce=require(_0x45e4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x45e4('0x9'));var querystring=require(_0x45e4('0x10'));var Papa=require(_0x45e4('0x11'));var Redis=require(_0x45e4('0x12'));var authService=require(_0x45e4('0x13'));var qs=require(_0x45e4('0x14'));var as=require(_0x45e4('0x15'));var hardwareService=require(_0x45e4('0x16'));var logger=require('../../config/logger')(_0x45e4('0x17'));var utils=require(_0x45e4('0x18'));var config=require(_0x45e4('0x19'));var licenseUtil=require(_0x45e4('0x1a'));var db=require(_0x45e4('0x1b'))['db'];function respondWithStatusCode(_0x356dc7,_0x2cfc9e){_0x2cfc9e=_0x2cfc9e||0xcc;return function(_0x1dd606){if(_0x1dd606){return _0x356dc7[_0x45e4('0x1c')](_0x2cfc9e);}return _0x356dc7[_0x45e4('0x1d')](_0x2cfc9e)[_0x45e4('0x1e')]();};}function respondWithResult(_0x4e0b48,_0x2675ee){_0x2675ee=_0x2675ee||0xc8;return function(_0x3b63c6){if(_0x3b63c6){return _0x4e0b48[_0x45e4('0x1d')](_0x2675ee)[_0x45e4('0x1f')](_0x3b63c6);}};}function respondWithFilteredResult(_0x1b68ca,_0x366b43){return function(_0x368b63){if(_0x368b63){var _0x3d3eb9=typeof _0x366b43[_0x45e4('0x20')]==='undefined'&&typeof _0x366b43[_0x45e4('0x21')]===_0x45e4('0x22');var _0xe06576=_0x368b63[_0x45e4('0x23')];var _0x2d8776=_0x3d3eb9?0x0:_0x366b43[_0x45e4('0x20')];var _0x382d0a=_0x3d3eb9?_0x368b63['count']:_0x366b43[_0x45e4('0x20')]+_0x366b43[_0x45e4('0x21')];var _0x2d02fa;if(_0x382d0a>=_0xe06576){_0x382d0a=_0xe06576;_0x2d02fa=0xc8;}else{_0x2d02fa=0xce;}_0x1b68ca[_0x45e4('0x1d')](_0x2d02fa);return _0x1b68ca['set']('Content-Range',_0x2d8776+'-'+_0x382d0a+'/'+_0xe06576)[_0x45e4('0x1f')](_0x368b63);}return null;};}function patchUpdates(_0x5ebd51){return function(_0x81c532){try{jsonpatch[_0x45e4('0x24')](_0x81c532,_0x5ebd51,!![]);}catch(_0x271787){return BPromise['reject'](_0x271787);}return _0x81c532[_0x45e4('0x25')]();};}function saveUpdates(_0xb2d96e,_0x15da5d){return function(_0x1d0cf2){if(_0x1d0cf2){return _0x1d0cf2[_0x45e4('0x26')](_0xb2d96e)[_0x45e4('0x27')](function(_0x15ae3e){return _0x15ae3e;});}return null;};}function removeEntity(_0x11b887,_0x328eef){return function(_0xa9203c){if(_0xa9203c){return _0xa9203c[_0x45e4('0x28')]()['then'](function(){_0x11b887[_0x45e4('0x1d')](0xcc)[_0x45e4('0x1e')]();});}};}function handleEntityNotFound(_0xb2d7c,_0x3acfa2){return function(_0x9d278c){if(!_0x9d278c){_0xb2d7c[_0x45e4('0x1c')](0x194);}return _0x9d278c;};}function handleError(_0x2454fc,_0xfabdc2){_0xfabdc2=_0xfabdc2||0x1f4;return function(_0x2f8efd){logger[_0x45e4('0x29')](_0x2f8efd[_0x45e4('0x2a')]);if(_0x2f8efd[_0x45e4('0x2b')]){delete _0x2f8efd[_0x45e4('0x2b')];}_0x2454fc['status'](_0xfabdc2)[_0x45e4('0x2c')](_0x2f8efd);};}exports[_0x45e4('0x2d')]=function(_0x518a15,_0x158ada){var _0x149bed={},_0x2b09d7={},_0x360efc={'count':0x0,'rows':[]};var _0x22d27c=_[_0x45e4('0x2e')](db[_0x45e4('0x2f')][_0x45e4('0x30')],function(_0x37680f){return{'name':_0x37680f[_0x45e4('0x31')],'type':_0x37680f[_0x45e4('0x32')][_0x45e4('0x33')]};});_0x2b09d7[_0x45e4('0x34')]=_['map'](_0x22d27c,_0x45e4('0x2b'));_0x2b09d7[_0x45e4('0x35')]=_['keys'](_0x518a15[_0x45e4('0x35')]);_0x2b09d7[_0x45e4('0x36')]=_[_0x45e4('0x37')](_0x2b09d7[_0x45e4('0x34')],_0x2b09d7[_0x45e4('0x35')]);_0x149bed[_0x45e4('0x38')]=_[_0x45e4('0x37')](_0x2b09d7['model'],qs[_0x45e4('0x39')](_0x518a15['query']['fields']));_0x149bed[_0x45e4('0x38')]=_0x149bed[_0x45e4('0x38')]['length']?_0x149bed[_0x45e4('0x38')]:_0x2b09d7[_0x45e4('0x34')];if(!_0x518a15['query']['hasOwnProperty'](_0x45e4('0x3a'))){_0x149bed[_0x45e4('0x21')]=qs[_0x45e4('0x21')](_0x518a15[_0x45e4('0x35')][_0x45e4('0x21')]);_0x149bed[_0x45e4('0x20')]=qs[_0x45e4('0x20')](_0x518a15[_0x45e4('0x35')][_0x45e4('0x20')]);}_0x149bed[_0x45e4('0x3b')]=qs[_0x45e4('0x3c')](_0x518a15[_0x45e4('0x35')]['sort']);_0x149bed[_0x45e4('0x3d')]=qs[_0x45e4('0x36')](_[_0x45e4('0x3e')](_0x518a15[_0x45e4('0x35')],_0x2b09d7[_0x45e4('0x36')]),_0x22d27c);if(_0x518a15[_0x45e4('0x35')][_0x45e4('0x3f')]){_0x149bed[_0x45e4('0x3d')]=_[_0x45e4('0x40')](_0x149bed['where'],{'$or':_[_0x45e4('0x2e')](_0x22d27c,function(_0x2c2c8f){if(_0x2c2c8f[_0x45e4('0x32')]!=='VIRTUAL'){var _0x2e37c4={};_0x2e37c4[_0x2c2c8f['name']]={'$like':'%'+_0x518a15['query'][_0x45e4('0x3f')]+'%'};return _0x2e37c4;}})});}_0x149bed=_['merge']({},_0x149bed,_0x518a15[_0x45e4('0x41')]);var _0x19a0bd={'where':_0x149bed[_0x45e4('0x3d')]};return db[_0x45e4('0x2f')][_0x45e4('0x23')](_0x19a0bd)[_0x45e4('0x27')](function(_0x26544c){_0x360efc['count']=_0x26544c;if(_0x518a15[_0x45e4('0x35')][_0x45e4('0x42')]){_0x149bed[_0x45e4('0x43')]=[{'all':!![]}];}return db[_0x45e4('0x2f')][_0x45e4('0x44')](_0x149bed);})[_0x45e4('0x27')](function(_0x3db210){_0x360efc[_0x45e4('0x45')]=_0x3db210;return _0x360efc;})[_0x45e4('0x27')](respondWithFilteredResult(_0x158ada,_0x149bed))[_0x45e4('0x46')](handleError(_0x158ada,null));};exports['show']=function(_0x362345,_0x580550){var _0x508733={'raw':![],'where':{'id':_0x362345[_0x45e4('0x47')]['id']}},_0x26feb2={};_0x26feb2['model']=_['keys'](db[_0x45e4('0x2f')][_0x45e4('0x30')]);_0x26feb2[_0x45e4('0x35')]=_['keys'](_0x362345[_0x45e4('0x35')]);_0x26feb2[_0x45e4('0x36')]=_[_0x45e4('0x37')](_0x26feb2[_0x45e4('0x34')],_0x26feb2[_0x45e4('0x35')]);_0x508733[_0x45e4('0x38')]=_[_0x45e4('0x37')](_0x26feb2[_0x45e4('0x34')],qs['fields'](_0x362345[_0x45e4('0x35')][_0x45e4('0x39')]));_0x508733[_0x45e4('0x38')]=_0x508733[_0x45e4('0x38')][_0x45e4('0x48')]?_0x508733[_0x45e4('0x38')]:_0x26feb2[_0x45e4('0x34')];if(_0x362345['query'][_0x45e4('0x42')]){_0x508733[_0x45e4('0x43')]=[{'all':!![]}];}_0x508733=_[_0x45e4('0x40')]({},_0x508733,_0x362345[_0x45e4('0x41')]);return db['IntegrationReport'][_0x45e4('0x49')](_0x508733)['then'](handleEntityNotFound(_0x580550,null))[_0x45e4('0x27')](respondWithResult(_0x580550,null))[_0x45e4('0x46')](handleError(_0x580550,null));};exports['create']=function(_0x2439e7,_0x4c4d15){return db['IntegrationReport']['create'](_0x2439e7[_0x45e4('0x4a')],{})[_0x45e4('0x27')](respondWithResult(_0x4c4d15,0xc9))[_0x45e4('0x46')](handleError(_0x4c4d15,null));};exports[_0x45e4('0x26')]=function(_0x430f3c,_0x351f54){if(_0x430f3c[_0x45e4('0x4a')]['id']){delete _0x430f3c[_0x45e4('0x4a')]['id'];}return db['IntegrationReport'][_0x45e4('0x49')]({'where':{'id':_0x430f3c[_0x45e4('0x47')]['id']}})['then'](handleEntityNotFound(_0x351f54,null))[_0x45e4('0x27')](saveUpdates(_0x430f3c[_0x45e4('0x4a')],null))[_0x45e4('0x27')](respondWithResult(_0x351f54,null))['catch'](handleError(_0x351f54,null));};exports[_0x45e4('0x28')]=function(_0xdb6b13,_0x5caaf2){return db[_0x45e4('0x2f')][_0x45e4('0x49')]({'where':{'id':_0xdb6b13[_0x45e4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5caaf2,null))['then'](removeEntity(_0x5caaf2,null))[_0x45e4('0x46')](handleError(_0x5caaf2,null));};exports[_0x45e4('0x4b')]=function(_0x490289,_0x19d7ef){return db[_0x45e4('0x2f')][_0x45e4('0x4b')]()[_0x45e4('0x27')](respondWithResult(_0x19d7ef,null))[_0x45e4('0x46')](handleError(_0x19d7ef,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a60b38b..45c7eda 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 _0x4eeb=['bluebird','request-promise','path','rimraf','exports','define','report_integration','lodash','util','../../config/logger','api'];(function(_0x3dc35c,_0x1acaea){var _0x4e821a=function(_0x44f97e){while(--_0x44f97e){_0x3dc35c['push'](_0x3dc35c['shift']());}};_0x4e821a(++_0x1acaea);}(_0x4eeb,0x104));var _0xb4ee=function(_0x48a50c,_0xb7fbba){_0x48a50c=_0x48a50c-0x0;var _0x1ff5ac=_0x4eeb[_0x48a50c];return _0x1ff5ac;};'use strict';var _=require(_0xb4ee('0x0'));var util=require(_0xb4ee('0x1'));var logger=require(_0xb4ee('0x2'))(_0xb4ee('0x3'));var moment=require('moment');var BPromise=require(_0xb4ee('0x4'));var rp=require(_0xb4ee('0x5'));var fs=require('fs');var path=require(_0xb4ee('0x6'));var rimraf=require(_0xb4ee('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xb4ee('0x8')]=function(_0x14537d,_0x282e23){return _0x14537d[_0xb4ee('0x9')]('IntegrationReport',attributes,{'tableName':_0xb4ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cef=['IntegrationReport','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x4cef,0x85));var _0xf4ce=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x4cef[_0x592e40];return _0x5d4288;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4ce('0x0'))(_0xf4ce('0x1'));var moment=require(_0xf4ce('0x2'));var BPromise=require('bluebird');var rp=require(_0xf4ce('0x3'));var fs=require('fs');var path=require(_0xf4ce('0x4'));var rimraf=require(_0xf4ce('0x5'));var config=require(_0xf4ce('0x6'));var attributes=require(_0xf4ce('0x7'));module[_0xf4ce('0x8')]=function(_0x27a422,_0x12b081){return _0x27a422[_0xf4ce('0x9')](_0xf4ce('0xa'),attributes,{'tableName':'report_integration','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 0391ba8..b8f0bc5 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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x687b,0x14a));var _0xb687=function(_0x5295a5,_0x2f106a){_0x5295a5=_0x5295a5-0x0;var _0x499291=_0x687b[_0x5295a5];return _0x499291;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x53ec,0x192));var _0xc53e=function(_0x3b0265,_0x54c4b6){_0x3b0265=_0x3b0265-0x0;var _0x4d6215=_0x53ec[_0x3b0265];return _0x4d6215;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index c3298c0..4f7ad41 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 _0x3dc1=['../../config/environment','get','isAuthenticated','/:id','show','getIntervals','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d0f15,_0x56c566){var _0x56725b=function(_0x444af7){while(--_0x444af7){_0x1d0f15['push'](_0x1d0f15['shift']());}};_0x56725b(++_0x56c566);}(_0x3dc1,0x127));var _0x13dc=function(_0x2aba7f,_0x52f819){_0x2aba7f=_0x2aba7f-0x0;var _0x231d9a=_0x3dc1[_0x2aba7f];return _0x231d9a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x13dc('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x13dc('0x1')]();var fs_extra=require(_0x13dc('0x2'));var auth=require(_0x13dc('0x3'));var interaction=require(_0x13dc('0x4'));var config=require(_0x13dc('0x5'));var controller=require('./interval.controller');router[_0x13dc('0x6')]('/',auth[_0x13dc('0x7')](),controller['index']);router['get'](_0x13dc('0x8'),auth['isAuthenticated'](),controller[_0x13dc('0x9')]);router[_0x13dc('0x6')]('/:id/sub_intervals',auth[_0x13dc('0x7')](),controller[_0x13dc('0xa')]);router[_0x13dc('0xb')]('/',auth[_0x13dc('0x7')](),controller['create']);router[_0x13dc('0xb')](_0x13dc('0xc'),auth['isAuthenticated'](),controller[_0x13dc('0xd')]);router[_0x13dc('0xb')](_0x13dc('0xe'),auth['isAuthenticated'](),controller[_0x13dc('0xf')]);router[_0x13dc('0x10')]('/:id',auth[_0x13dc('0x7')](),controller['update']);router[_0x13dc('0x11')](_0x13dc('0x8'),auth[_0x13dc('0x7')](),controller[_0x13dc('0x12')]);module[_0x13dc('0x13')]=router; \ No newline at end of file +var _0x3148=['put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many'];(function(_0x586480,_0x2546ca){var _0x2f51d5=function(_0x2e7ab7){while(--_0x2e7ab7){_0x586480['push'](_0x586480['shift']());}};_0x2f51d5(++_0x2546ca);}(_0x3148,0x1d3));var _0x8314=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x3148[_0x1034bb];return _0x453fdb;};'use strict';var multer=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var path=require('path');var timeout=require(_0x8314('0x2'));var express=require(_0x8314('0x3'));var router=express[_0x8314('0x4')]();var fs_extra=require(_0x8314('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8314('0x6'));var config=require(_0x8314('0x7'));var controller=require(_0x8314('0x8'));router[_0x8314('0x9')]('/',auth[_0x8314('0xa')](),controller[_0x8314('0xb')]);router[_0x8314('0x9')]('/:id',auth[_0x8314('0xa')](),controller['show']);router[_0x8314('0x9')](_0x8314('0xc'),auth[_0x8314('0xa')](),controller[_0x8314('0xd')]);router[_0x8314('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8314('0xe')](_0x8314('0xc'),auth[_0x8314('0xa')](),controller[_0x8314('0xf')]);router['post'](_0x8314('0x10'),auth[_0x8314('0xa')](),controller['addIntervals']);router[_0x8314('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8314('0x12')]);router[_0x8314('0x13')](_0x8314('0x14'),auth[_0x8314('0xa')](),controller['destroy']);module[_0x8314('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index b4a9d92..8027fb9 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 _0xa88b=['STRING','sequelize','exports'];(function(_0x1af80e,_0x8a8525){var _0x347585=function(_0x462d98){while(--_0x462d98){_0x1af80e['push'](_0x1af80e['shift']());}};_0x347585(++_0x8a8525);}(_0xa88b,0xd3));var _0xba88=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xa88b[_0x30d87a];return _0x48f64b;};'use strict';var Sequelize=require(_0xba88('0x0'));module[_0xba88('0x1')]={'name':{'type':Sequelize[_0xba88('0x2')]},'description':{'type':Sequelize[_0xba88('0x2')]},'interval':{'type':Sequelize[_0xba88('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x309c=['exports','STRING'];(function(_0x5890b,_0x3883c7){var _0xaaed57=function(_0x270592){while(--_0x270592){_0x5890b['push'](_0x5890b['shift']());}};_0xaaed57(++_0x3883c7);}(_0x309c,0xc8));var _0xc309=function(_0x546fe6,_0x1a9263){_0x546fe6=_0x546fe6-0x0;var _0x2a3db1=_0x309c[_0x546fe6];return _0x2a3db1;};'use strict';var Sequelize=require('sequelize');module[_0xc309('0x0')]={'name':{'type':Sequelize[_0xc309('0x1')]},'description':{'type':Sequelize[_0xc309('0x1')]},'interval':{'type':Sequelize[_0xc309('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 0aba335..88cd12f 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 _0x4180=['includeAll','include','Interval','findAll','rows','catch','show','params','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','length','pick','nolimit','findOne','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','limit','count','offset','apply','update','then','destroy','Intervals','stack','name','send','index','map','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options'];(function(_0x2510db,_0x3c3c74){var _0x4c9c46=function(_0x29ee7d){while(--_0x29ee7d){_0x2510db['push'](_0x2510db['shift']());}};_0x4c9c46(++_0x3c3c74);}(_0x4180,0xc3));var _0x0418=function(_0x397171,_0x10bc1f){_0x397171=_0x397171-0x0;var _0xb39da2=_0x4180[_0x397171];return _0xb39da2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0418('0x0'));var zipdir=require(_0x0418('0x1'));var jsonpatch=require(_0x0418('0x2'));var rp=require(_0x0418('0x3'));var moment=require(_0x0418('0x4'));var BPromise=require(_0x0418('0x5'));var Mustache=require(_0x0418('0x6'));var util=require(_0x0418('0x7'));var path=require(_0x0418('0x8'));var sox=require(_0x0418('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0418('0xa'));var squel=require(_0x0418('0xb'));var crypto=require(_0x0418('0xc'));var jsforce=require(_0x0418('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0418('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0418('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0418('0x10'));var hardwareService=require(_0x0418('0x11'));var logger=require(_0x0418('0x12'))(_0x0418('0x13'));var utils=require(_0x0418('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0418('0x15'))['db'];var extensions=require(_0x0418('0x16'));function respondWithStatusCode(_0x2c815d,_0x237307){_0x237307=_0x237307||0xcc;return function(_0x9b4640){if(_0x9b4640){return _0x2c815d[_0x0418('0x17')](_0x237307);}return _0x2c815d[_0x0418('0x18')](_0x237307)[_0x0418('0x19')]();};}function respondWithResult(_0x2fc581,_0x44394b){_0x44394b=_0x44394b||0xc8;return function(_0x55ee2f){if(_0x55ee2f){return _0x2fc581['status'](_0x44394b)[_0x0418('0x1a')](_0x55ee2f);}};}function respondWithFilteredResult(_0x35dd15,_0x356e1e){return function(_0x26458c){if(_0x26458c){var _0x3123c0=typeof _0x356e1e['offset']==='undefined'&&typeof _0x356e1e[_0x0418('0x1b')]==='undefined';var _0x40fc16=_0x26458c[_0x0418('0x1c')];var _0x196808=_0x3123c0?0x0:_0x356e1e[_0x0418('0x1d')];var _0x1df22e=_0x3123c0?_0x26458c[_0x0418('0x1c')]:_0x356e1e['offset']+_0x356e1e[_0x0418('0x1b')];var _0x59caa3;if(_0x1df22e>=_0x40fc16){_0x1df22e=_0x40fc16;_0x59caa3=0xc8;}else{_0x59caa3=0xce;}_0x35dd15[_0x0418('0x18')](_0x59caa3);return _0x35dd15['set']('Content-Range',_0x196808+'-'+_0x1df22e+'/'+_0x40fc16)[_0x0418('0x1a')](_0x26458c);}return null;};}function patchUpdates(_0x3c517a){return function(_0x16f5fb){try{jsonpatch[_0x0418('0x1e')](_0x16f5fb,_0x3c517a,!![]);}catch(_0x12ee46){return BPromise['reject'](_0x12ee46);}return _0x16f5fb['save']();};}function saveUpdates(_0xd3ce2f,_0x474689){return function(_0x1956f7){if(_0x1956f7){return _0x1956f7[_0x0418('0x1f')](_0xd3ce2f)[_0x0418('0x20')](function(_0x514741){return _0x514741;});}return null;};}function removeEntity(_0x23a141,_0x203b61){return function(_0x18699e){if(_0x18699e){return _0x18699e[_0x0418('0x21')]()[_0x0418('0x20')](function(){var _0x26b61c=_0x18699e['get']({'plain':!![]});var _0x3a94f8=_0x0418('0x22');return db['UserProfileResource'][_0x0418('0x21')]({'where':{'type':_0x3a94f8,'resourceId':_0x26b61c['id']}})[_0x0418('0x20')](function(){return _0x18699e;});})[_0x0418('0x20')](function(){_0x23a141[_0x0418('0x18')](0xcc)[_0x0418('0x19')]();});}};}function handleEntityNotFound(_0x1d7bb3,_0x5ce90a){return function(_0x24d2a7){if(!_0x24d2a7){_0x1d7bb3['sendStatus'](0x194);}return _0x24d2a7;};}function handleError(_0x48c242,_0x310981){_0x310981=_0x310981||0x1f4;return function(_0x5eae5d){logger['error'](_0x5eae5d[_0x0418('0x23')]);if(_0x5eae5d['name']){delete _0x5eae5d[_0x0418('0x24')];}_0x48c242[_0x0418('0x18')](_0x310981)[_0x0418('0x25')](_0x5eae5d);};}exports[_0x0418('0x26')]=function(_0x35273d,_0xeca73e){var _0x50899c={},_0x2fc259={},_0x2f9116={'count':0x0,'rows':[]};var _0x42ac5a=_[_0x0418('0x27')](db['Interval']['rawAttributes'],function(_0x19f02f){return{'name':_0x19f02f[_0x0418('0x28')],'type':_0x19f02f['type']['key']};});_0x2fc259[_0x0418('0x29')]=_[_0x0418('0x27')](_0x42ac5a,_0x0418('0x24'));_0x2fc259[_0x0418('0x2a')]=_[_0x0418('0x2b')](_0x35273d[_0x0418('0x2a')]);_0x2fc259['filters']=_[_0x0418('0x2c')](_0x2fc259[_0x0418('0x29')],_0x2fc259['query']);_0x50899c['attributes']=_[_0x0418('0x2c')](_0x2fc259['model'],qs[_0x0418('0x2d')](_0x35273d[_0x0418('0x2a')][_0x0418('0x2d')]));_0x50899c[_0x0418('0x2e')]=_0x50899c[_0x0418('0x2e')]['length']?_0x50899c[_0x0418('0x2e')]:_0x2fc259['model'];if(!_0x35273d[_0x0418('0x2a')][_0x0418('0x2f')]('nolimit')){_0x50899c[_0x0418('0x1b')]=qs[_0x0418('0x1b')](_0x35273d[_0x0418('0x2a')][_0x0418('0x1b')]);_0x50899c[_0x0418('0x1d')]=qs[_0x0418('0x1d')](_0x35273d['query'][_0x0418('0x1d')]);}_0x50899c[_0x0418('0x30')]=qs['sort'](_0x35273d[_0x0418('0x2a')][_0x0418('0x31')]);_0x50899c[_0x0418('0x32')]=qs[_0x0418('0x33')](_['pick'](_0x35273d[_0x0418('0x2a')],_0x2fc259['filters']),_0x42ac5a);if(_0x35273d[_0x0418('0x2a')][_0x0418('0x34')]){_0x50899c[_0x0418('0x32')]=_[_0x0418('0x35')](_0x50899c['where'],{'$or':_[_0x0418('0x27')](_0x42ac5a,function(_0x9e1d48){if(_0x9e1d48[_0x0418('0x36')]!==_0x0418('0x37')){var _0x3f7662={};_0x3f7662[_0x9e1d48['name']]={'$like':'%'+_0x35273d[_0x0418('0x2a')][_0x0418('0x34')]+'%'};return _0x3f7662;}})});}_0x50899c=_['merge']({},_0x50899c,_0x35273d[_0x0418('0x38')]);var _0xf8d93d={'where':_0x50899c[_0x0418('0x32')]};return db['Interval']['count'](_0xf8d93d)[_0x0418('0x20')](function(_0x452641){_0x2f9116[_0x0418('0x1c')]=_0x452641;if(_0x35273d[_0x0418('0x2a')][_0x0418('0x39')]){_0x50899c[_0x0418('0x3a')]=[{'all':!![]}];}return db[_0x0418('0x3b')][_0x0418('0x3c')](_0x50899c);})[_0x0418('0x20')](function(_0x32dd71){_0x2f9116[_0x0418('0x3d')]=_0x32dd71;return _0x2f9116;})['then'](respondWithFilteredResult(_0xeca73e,_0x50899c))[_0x0418('0x3e')](handleError(_0xeca73e,null));};exports[_0x0418('0x3f')]=function(_0x32220f,_0x4672e6){var _0x1125d3={'raw':!![],'where':{'id':_0x32220f[_0x0418('0x40')]['id']}},_0x46a27f={};_0x46a27f['model']=_[_0x0418('0x2b')](db['Interval'][_0x0418('0x41')]);_0x46a27f[_0x0418('0x2a')]=_[_0x0418('0x2b')](_0x32220f[_0x0418('0x2a')]);_0x46a27f[_0x0418('0x33')]=_[_0x0418('0x2c')](_0x46a27f[_0x0418('0x29')],_0x46a27f[_0x0418('0x2a')]);_0x1125d3[_0x0418('0x2e')]=_[_0x0418('0x2c')](_0x46a27f[_0x0418('0x29')],qs[_0x0418('0x2d')](_0x32220f[_0x0418('0x2a')]['fields']));_0x1125d3[_0x0418('0x2e')]=_0x1125d3[_0x0418('0x2e')]['length']?_0x1125d3[_0x0418('0x2e')]:_0x46a27f['model'];if(_0x32220f['query']['includeAll']){_0x1125d3[_0x0418('0x3a')]=[{'all':!![]}];}_0x1125d3=_['merge']({},_0x1125d3,_0x32220f[_0x0418('0x38')]);return db['Interval']['find'](_0x1125d3)[_0x0418('0x20')](handleEntityNotFound(_0x4672e6,null))[_0x0418('0x20')](respondWithResult(_0x4672e6,null))[_0x0418('0x3e')](handleError(_0x4672e6,null));};exports[_0x0418('0x42')]=function(_0x1c2b18,_0x237192){return db[_0x0418('0x3b')][_0x0418('0x42')](_0x1c2b18['body'],{})[_0x0418('0x20')](function(_0x2897a6){var _0x46130a=_0x1c2b18[_0x0418('0x43')][_0x0418('0x44')]({'plain':!![]});if(!_0x46130a)throw new Error(_0x0418('0x45'));if(_0x46130a['role']==='user'){var _0x231868=_0x2897a6[_0x0418('0x44')]({'plain':!![]});var _0x9b3732='Intervals';return db[_0x0418('0x46')][_0x0418('0x47')]({'where':{'name':_0x9b3732,'userProfileId':_0x46130a[_0x0418('0x48')]},'raw':!![]})['then'](function(_0x25125f){if(_0x25125f&&_0x25125f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x231868[_0x0418('0x24')],'resourceId':_0x231868['id'],'type':_0x25125f[_0x0418('0x24')],'sectionId':_0x25125f['id']},{})[_0x0418('0x20')](function(){return _0x2897a6;});}else{return _0x2897a6;}})['catch'](function(_0x18516f){logger['error'](_0x0418('0x49'),_0x18516f);throw _0x18516f;});}return _0x2897a6;})[_0x0418('0x20')](respondWithResult(_0x237192,0xc9))['catch'](handleError(_0x237192,null));};exports[_0x0418('0x1f')]=function(_0x4e33b7,_0x21287d){if(_0x4e33b7[_0x0418('0x4a')]['id']){delete _0x4e33b7[_0x0418('0x4a')]['id'];}return db[_0x0418('0x3b')][_0x0418('0x47')]({'where':{'id':_0x4e33b7[_0x0418('0x40')]['id']}})[_0x0418('0x20')](handleEntityNotFound(_0x21287d,null))[_0x0418('0x20')](saveUpdates(_0x4e33b7[_0x0418('0x4a')],null))['then'](respondWithResult(_0x21287d,null))[_0x0418('0x3e')](handleError(_0x21287d,null));};exports['destroy']=function(_0x1280b3,_0x533f30){return db['Interval'][_0x0418('0x47')]({'where':{'id':_0x1280b3[_0x0418('0x40')]['id']}})['then'](handleEntityNotFound(_0x533f30,null))['then'](removeEntity(_0x533f30,null))[_0x0418('0x3e')](handleError(_0x533f30,null));};exports[_0x0418('0x4b')]=function(_0x6ca55d,_0x546807,_0x48fb5c){if(_0x6ca55d['body']['id']){delete _0x6ca55d['body']['id'];}return db['Interval'][_0x0418('0x47')]({'where':{'id':_0x6ca55d[_0x0418('0x40')]['id']}})['then'](handleEntityNotFound(_0x546807,null))[_0x0418('0x20')](function(_0x30f461){if(_0x30f461){_0x6ca55d[_0x0418('0x4a')][_0x0418('0x4c')]=_0x30f461['id'];return db[_0x0418('0x3b')][_0x0418('0x42')](_0x6ca55d[_0x0418('0x4a')]);}})[_0x0418('0x20')](respondWithResult(_0x546807,null))[_0x0418('0x3e')](handleError(_0x546807,null));};exports[_0x0418('0x4d')]=function(_0x485811,_0x5d4baa,_0x141abd){var _0x5ce450={};var _0x1e13f5={};var _0x254d09;var _0x307786;return db['Interval']['findOne']({'where':{'id':_0x485811['params']['id']}})[_0x0418('0x20')](handleEntityNotFound(_0x5d4baa,null))[_0x0418('0x20')](function(_0x5b2743){if(_0x5b2743){_0x254d09=_0x5b2743;_0x1e13f5[_0x0418('0x29')]=_[_0x0418('0x2b')](db['Interval'][_0x0418('0x41')]);_0x1e13f5[_0x0418('0x2a')]=_[_0x0418('0x2b')](_0x485811[_0x0418('0x2a')]);_0x1e13f5[_0x0418('0x33')]=_[_0x0418('0x2c')](_0x1e13f5['model'],_0x1e13f5[_0x0418('0x2a')]);_0x5ce450[_0x0418('0x2e')]=_[_0x0418('0x2c')](_0x1e13f5[_0x0418('0x29')],qs[_0x0418('0x2d')](_0x485811[_0x0418('0x2a')][_0x0418('0x2d')]));_0x5ce450[_0x0418('0x2e')]=_0x5ce450[_0x0418('0x2e')][_0x0418('0x4e')]?_0x5ce450['attributes']:_0x1e13f5[_0x0418('0x29')];_0x5ce450[_0x0418('0x30')]=qs[_0x0418('0x31')](_0x485811[_0x0418('0x2a')]['sort']);_0x5ce450[_0x0418('0x32')]=qs[_0x0418('0x33')](_[_0x0418('0x4f')](_0x485811[_0x0418('0x2a')],_0x1e13f5[_0x0418('0x33')]));if(_0x485811['query'][_0x0418('0x34')]){_0x5ce450[_0x0418('0x32')]=_[_0x0418('0x35')](_0x5ce450[_0x0418('0x32')],{'$or':_[_0x0418('0x27')](_0x5ce450[_0x0418('0x2e')],function(_0x1e263a){var _0x409b30={};_0x409b30[_0x1e263a]={'$like':'%'+_0x485811[_0x0418('0x2a')][_0x0418('0x34')]+'%'};return _0x409b30;})});}_0x5ce450=_[_0x0418('0x35')]({},_0x5ce450,_0x485811[_0x0418('0x38')]);return _0x254d09[_0x0418('0x4d')](_0x5ce450);}})['then'](function(_0x5adee7){if(_0x5adee7){_0x307786=_0x5adee7[_0x0418('0x4e')];if(!_0x485811[_0x0418('0x2a')][_0x0418('0x2f')](_0x0418('0x50'))){_0x5ce450[_0x0418('0x1b')]=qs['limit'](_0x485811[_0x0418('0x2a')][_0x0418('0x1b')]);_0x5ce450[_0x0418('0x1d')]=qs[_0x0418('0x1d')](_0x485811[_0x0418('0x2a')]['offset']);}return _0x254d09['getIntervals'](_0x5ce450);}})[_0x0418('0x20')](function(_0x566fe){if(_0x566fe){return _0x566fe?{'count':_0x307786,'rows':_0x566fe}:null;}})['then'](respondWithResult(_0x5d4baa,null))['catch'](handleError(_0x5d4baa,null));};exports['addIntervals']=function(_0x11d413,_0x2fb8bd,_0x411af0){return db[_0x0418('0x3b')][_0x0418('0x51')]({'where':{'id':_0x11d413[_0x0418('0x40')]['id']}})[_0x0418('0x20')](handleEntityNotFound(_0x2fb8bd,null))[_0x0418('0x20')](function(_0xc15860){if(_0xc15860){return db['sequelize'][_0x0418('0x52')](function(_0x2cd638){return db[_0x0418('0x3b')][_0x0418('0x21')]({'where':{'IntervalId':_0x11d413[_0x0418('0x40')]['id']},'transaction':_0x2cd638})[_0x0418('0x20')](function(_0x3fb1a3){var _0x159203=_['map'](_0x11d413['body'],function(_0xabc81a){delete _0xabc81a['id'];_0xabc81a['IntervalId']=_0x11d413[_0x0418('0x40')]['id'];return _0xabc81a;});return db['Interval'][_0x0418('0x53')](_0x159203,{'transaction':_0x2cd638});});})[_0x0418('0x20')](function(){return db[_0x0418('0x3b')][_0x0418('0x3c')]({'where':{'IntervalId':_0x11d413[_0x0418('0x40')]['id']}});});}})[_0x0418('0x20')](respondWithResult(_0x2fb8bd,null))[_0x0418('0x3e')](handleError(_0x2fb8bd,null));}; \ No newline at end of file +var _0x7576=['index','Interval','fieldName','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','create','user','role','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','params','getIntervals','findOne','order','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy','Intervals','UserProfileResource','name','send'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7576,0x1d8));var _0x6757=function(_0x2e69ff,_0x1ce11a){_0x2e69ff=_0x2e69ff-0x0;var _0x3cd280=_0x7576[_0x2e69ff];return _0x3cd280;};'use strict';var emlformat=require(_0x6757('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6757('0x2'));var moment=require(_0x6757('0x3'));var BPromise=require(_0x6757('0x4'));var Mustache=require(_0x6757('0x5'));var util=require(_0x6757('0x6'));var path=require('path');var sox=require(_0x6757('0x7'));var csv=require(_0x6757('0x8'));var ejs=require(_0x6757('0x9'));var fs=require('fs');var fs_extra=require(_0x6757('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6757('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6757('0x8'));var querystring=require(_0x6757('0xc'));var Papa=require(_0x6757('0xd'));var Redis=require(_0x6757('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6757('0xf'));var as=require(_0x6757('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6757('0x11'));var utils=require(_0x6757('0x12'));var config=require(_0x6757('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6757('0x14'))['db'];var extensions=require(_0x6757('0x15'));function respondWithStatusCode(_0x548eb1,_0x32548f){_0x32548f=_0x32548f||0xcc;return function(_0x151a4e){if(_0x151a4e){return _0x548eb1[_0x6757('0x16')](_0x32548f);}return _0x548eb1[_0x6757('0x17')](_0x32548f)['end']();};}function respondWithResult(_0x5bdd15,_0x5762ad){_0x5762ad=_0x5762ad||0xc8;return function(_0x273d49){if(_0x273d49){return _0x5bdd15[_0x6757('0x17')](_0x5762ad)[_0x6757('0x18')](_0x273d49);}};}function respondWithFilteredResult(_0x14b564,_0x2b16b7){return function(_0xba31b0){if(_0xba31b0){var _0x47a994=typeof _0x2b16b7[_0x6757('0x19')]==='undefined'&&typeof _0x2b16b7[_0x6757('0x1a')]===_0x6757('0x1b');var _0xe82448=_0xba31b0[_0x6757('0x1c')];var _0xbb36a5=_0x47a994?0x0:_0x2b16b7[_0x6757('0x19')];var _0x5417ef=_0x47a994?_0xba31b0['count']:_0x2b16b7[_0x6757('0x19')]+_0x2b16b7[_0x6757('0x1a')];var _0xfeabe7;if(_0x5417ef>=_0xe82448){_0x5417ef=_0xe82448;_0xfeabe7=0xc8;}else{_0xfeabe7=0xce;}_0x14b564[_0x6757('0x17')](_0xfeabe7);return _0x14b564['set']('Content-Range',_0xbb36a5+'-'+_0x5417ef+'/'+_0xe82448)['json'](_0xba31b0);}return null;};}function patchUpdates(_0x1d5e6f){return function(_0x1a1de4){try{jsonpatch[_0x6757('0x1d')](_0x1a1de4,_0x1d5e6f,!![]);}catch(_0x426f83){return BPromise[_0x6757('0x1e')](_0x426f83);}return _0x1a1de4[_0x6757('0x1f')]();};}function saveUpdates(_0x25e609,_0x19940f){return function(_0x481717){if(_0x481717){return _0x481717['update'](_0x25e609)[_0x6757('0x20')](function(_0x23664e){return _0x23664e;});}return null;};}function removeEntity(_0x20ddc6,_0x3ed266){return function(_0x36fbfe){if(_0x36fbfe){return _0x36fbfe[_0x6757('0x21')]()[_0x6757('0x20')](function(){var _0x583ad7=_0x36fbfe['get']({'plain':!![]});var _0x11c51d=_0x6757('0x22');return db[_0x6757('0x23')][_0x6757('0x21')]({'where':{'type':_0x11c51d,'resourceId':_0x583ad7['id']}})['then'](function(){return _0x36fbfe;});})[_0x6757('0x20')](function(){_0x20ddc6[_0x6757('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x357eac,_0x46e7ca){return function(_0x1e1801){if(!_0x1e1801){_0x357eac[_0x6757('0x16')](0x194);}return _0x1e1801;};}function handleError(_0x14cf04,_0x327e7e){_0x327e7e=_0x327e7e||0x1f4;return function(_0x3df4c3){logger['error'](_0x3df4c3['stack']);if(_0x3df4c3['name']){delete _0x3df4c3[_0x6757('0x24')];}_0x14cf04[_0x6757('0x17')](_0x327e7e)[_0x6757('0x25')](_0x3df4c3);};}exports[_0x6757('0x26')]=function(_0x79645f,_0x2833ba){var _0x293534={},_0x595969={},_0x4d84ed={'count':0x0,'rows':[]};var _0x5222b5=_['map'](db[_0x6757('0x27')]['rawAttributes'],function(_0x435d32){return{'name':_0x435d32[_0x6757('0x28')],'type':_0x435d32['type']['key']};});_0x595969[_0x6757('0x29')]=_[_0x6757('0x2a')](_0x5222b5,_0x6757('0x24'));_0x595969['query']=_[_0x6757('0x2b')](_0x79645f[_0x6757('0x2c')]);_0x595969[_0x6757('0x2d')]=_[_0x6757('0x2e')](_0x595969[_0x6757('0x29')],_0x595969[_0x6757('0x2c')]);_0x293534['attributes']=_[_0x6757('0x2e')](_0x595969[_0x6757('0x29')],qs['fields'](_0x79645f[_0x6757('0x2c')][_0x6757('0x2f')]));_0x293534[_0x6757('0x30')]=_0x293534['attributes'][_0x6757('0x31')]?_0x293534[_0x6757('0x30')]:_0x595969[_0x6757('0x29')];if(!_0x79645f[_0x6757('0x2c')][_0x6757('0x32')](_0x6757('0x33'))){_0x293534[_0x6757('0x1a')]=qs[_0x6757('0x1a')](_0x79645f[_0x6757('0x2c')][_0x6757('0x1a')]);_0x293534[_0x6757('0x19')]=qs[_0x6757('0x19')](_0x79645f[_0x6757('0x2c')][_0x6757('0x19')]);}_0x293534['order']=qs[_0x6757('0x34')](_0x79645f['query'][_0x6757('0x34')]);_0x293534[_0x6757('0x35')]=qs[_0x6757('0x2d')](_[_0x6757('0x36')](_0x79645f[_0x6757('0x2c')],_0x595969[_0x6757('0x2d')]),_0x5222b5);if(_0x79645f[_0x6757('0x2c')][_0x6757('0x37')]){_0x293534[_0x6757('0x35')]=_[_0x6757('0x38')](_0x293534[_0x6757('0x35')],{'$or':_[_0x6757('0x2a')](_0x5222b5,function(_0x5ef3bf){if(_0x5ef3bf[_0x6757('0x39')]!==_0x6757('0x3a')){var _0x32bcd4={};_0x32bcd4[_0x5ef3bf[_0x6757('0x24')]]={'$like':'%'+_0x79645f[_0x6757('0x2c')][_0x6757('0x37')]+'%'};return _0x32bcd4;}})});}_0x293534=_[_0x6757('0x38')]({},_0x293534,_0x79645f[_0x6757('0x3b')]);var _0x51c750={'where':_0x293534['where']};return db[_0x6757('0x27')][_0x6757('0x1c')](_0x51c750)['then'](function(_0x21ab07){_0x4d84ed[_0x6757('0x1c')]=_0x21ab07;if(_0x79645f[_0x6757('0x2c')]['includeAll']){_0x293534[_0x6757('0x3c')]=[{'all':!![]}];}return db['Interval'][_0x6757('0x3d')](_0x293534);})[_0x6757('0x20')](function(_0x3c4e94){_0x4d84ed[_0x6757('0x3e')]=_0x3c4e94;return _0x4d84ed;})[_0x6757('0x20')](respondWithFilteredResult(_0x2833ba,_0x293534))[_0x6757('0x3f')](handleError(_0x2833ba,null));};exports[_0x6757('0x40')]=function(_0x4476df,_0x1ec0b4){var _0x4631a3={'raw':!![],'where':{'id':_0x4476df['params']['id']}},_0x303c42={};_0x303c42[_0x6757('0x29')]=_[_0x6757('0x2b')](db[_0x6757('0x27')][_0x6757('0x41')]);_0x303c42['query']=_[_0x6757('0x2b')](_0x4476df[_0x6757('0x2c')]);_0x303c42[_0x6757('0x2d')]=_[_0x6757('0x2e')](_0x303c42['model'],_0x303c42[_0x6757('0x2c')]);_0x4631a3['attributes']=_[_0x6757('0x2e')](_0x303c42[_0x6757('0x29')],qs[_0x6757('0x2f')](_0x4476df[_0x6757('0x2c')][_0x6757('0x2f')]));_0x4631a3[_0x6757('0x30')]=_0x4631a3[_0x6757('0x30')][_0x6757('0x31')]?_0x4631a3['attributes']:_0x303c42[_0x6757('0x29')];if(_0x4476df[_0x6757('0x2c')]['includeAll']){_0x4631a3['include']=[{'all':!![]}];}_0x4631a3=_[_0x6757('0x38')]({},_0x4631a3,_0x4476df['options']);return db[_0x6757('0x27')]['find'](_0x4631a3)[_0x6757('0x20')](handleEntityNotFound(_0x1ec0b4,null))[_0x6757('0x20')](respondWithResult(_0x1ec0b4,null))[_0x6757('0x3f')](handleError(_0x1ec0b4,null));};exports[_0x6757('0x42')]=function(_0x58b53a,_0x4a7185){return db['Interval'][_0x6757('0x42')](_0x58b53a['body'],{})['then'](function(_0x557d1f){var _0x2620b1=_0x58b53a[_0x6757('0x43')]['get']({'plain':!![]});if(!_0x2620b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2620b1[_0x6757('0x44')]==='user'){var _0xc23a28=_0x557d1f[_0x6757('0x45')]({'plain':!![]});var _0x7425fb=_0x6757('0x22');return db['UserProfileSection'][_0x6757('0x46')]({'where':{'name':_0x7425fb,'userProfileId':_0x2620b1['userProfileId']},'raw':!![]})['then'](function(_0x17e6d3){if(_0x17e6d3&&_0x17e6d3[_0x6757('0x47')]===0x0){return db[_0x6757('0x23')][_0x6757('0x42')]({'name':_0xc23a28[_0x6757('0x24')],'resourceId':_0xc23a28['id'],'type':_0x17e6d3[_0x6757('0x24')],'sectionId':_0x17e6d3['id']},{})['then'](function(){return _0x557d1f;});}else{return _0x557d1f;}})[_0x6757('0x3f')](function(_0x4bc428){logger['error'](_0x6757('0x48'),_0x4bc428);throw _0x4bc428;});}return _0x557d1f;})[_0x6757('0x20')](respondWithResult(_0x4a7185,0xc9))[_0x6757('0x3f')](handleError(_0x4a7185,null));};exports[_0x6757('0x49')]=function(_0xe0c42f,_0x393043){if(_0xe0c42f[_0x6757('0x4a')]['id']){delete _0xe0c42f[_0x6757('0x4a')]['id'];}return db[_0x6757('0x27')][_0x6757('0x46')]({'where':{'id':_0xe0c42f['params']['id']}})['then'](handleEntityNotFound(_0x393043,null))['then'](saveUpdates(_0xe0c42f['body'],null))[_0x6757('0x20')](respondWithResult(_0x393043,null))[_0x6757('0x3f')](handleError(_0x393043,null));};exports[_0x6757('0x21')]=function(_0x42e2a5,_0x8e3614){return db[_0x6757('0x27')][_0x6757('0x46')]({'where':{'id':_0x42e2a5['params']['id']}})['then'](handleEntityNotFound(_0x8e3614,null))[_0x6757('0x20')](removeEntity(_0x8e3614,null))[_0x6757('0x3f')](handleError(_0x8e3614,null));};exports[_0x6757('0x4b')]=function(_0x42472d,_0x2202d9,_0x110da4){if(_0x42472d[_0x6757('0x4a')]['id']){delete _0x42472d[_0x6757('0x4a')]['id'];}return db[_0x6757('0x27')]['find']({'where':{'id':_0x42472d[_0x6757('0x4c')]['id']}})[_0x6757('0x20')](handleEntityNotFound(_0x2202d9,null))[_0x6757('0x20')](function(_0x21660d){if(_0x21660d){_0x42472d[_0x6757('0x4a')]['IntervalId']=_0x21660d['id'];return db['Interval'][_0x6757('0x42')](_0x42472d[_0x6757('0x4a')]);}})['then'](respondWithResult(_0x2202d9,null))[_0x6757('0x3f')](handleError(_0x2202d9,null));};exports[_0x6757('0x4d')]=function(_0x45e123,_0xf43344,_0x13478f){var _0x15a322={};var _0x2b441d={};var _0x362124;var _0x1248cb;return db['Interval'][_0x6757('0x4e')]({'where':{'id':_0x45e123['params']['id']}})['then'](handleEntityNotFound(_0xf43344,null))[_0x6757('0x20')](function(_0x1e0983){if(_0x1e0983){_0x362124=_0x1e0983;_0x2b441d[_0x6757('0x29')]=_['keys'](db['Interval']['rawAttributes']);_0x2b441d[_0x6757('0x2c')]=_['keys'](_0x45e123['query']);_0x2b441d[_0x6757('0x2d')]=_[_0x6757('0x2e')](_0x2b441d[_0x6757('0x29')],_0x2b441d[_0x6757('0x2c')]);_0x15a322[_0x6757('0x30')]=_[_0x6757('0x2e')](_0x2b441d[_0x6757('0x29')],qs[_0x6757('0x2f')](_0x45e123[_0x6757('0x2c')][_0x6757('0x2f')]));_0x15a322[_0x6757('0x30')]=_0x15a322[_0x6757('0x30')]['length']?_0x15a322['attributes']:_0x2b441d[_0x6757('0x29')];_0x15a322[_0x6757('0x4f')]=qs[_0x6757('0x34')](_0x45e123[_0x6757('0x2c')]['sort']);_0x15a322[_0x6757('0x35')]=qs[_0x6757('0x2d')](_[_0x6757('0x36')](_0x45e123[_0x6757('0x2c')],_0x2b441d[_0x6757('0x2d')]));if(_0x45e123['query'][_0x6757('0x37')]){_0x15a322[_0x6757('0x35')]=_['merge'](_0x15a322[_0x6757('0x35')],{'$or':_[_0x6757('0x2a')](_0x15a322[_0x6757('0x30')],function(_0x3f1b6f){var _0x2e9754={};_0x2e9754[_0x3f1b6f]={'$like':'%'+_0x45e123[_0x6757('0x2c')][_0x6757('0x37')]+'%'};return _0x2e9754;})});}_0x15a322=_[_0x6757('0x38')]({},_0x15a322,_0x45e123[_0x6757('0x3b')]);return _0x362124[_0x6757('0x4d')](_0x15a322);}})[_0x6757('0x20')](function(_0x2b1489){if(_0x2b1489){_0x1248cb=_0x2b1489[_0x6757('0x31')];if(!_0x45e123[_0x6757('0x2c')][_0x6757('0x32')](_0x6757('0x33'))){_0x15a322[_0x6757('0x1a')]=qs[_0x6757('0x1a')](_0x45e123[_0x6757('0x2c')][_0x6757('0x1a')]);_0x15a322['offset']=qs['offset'](_0x45e123[_0x6757('0x2c')]['offset']);}return _0x362124[_0x6757('0x4d')](_0x15a322);}})[_0x6757('0x20')](function(_0x5cceb8){if(_0x5cceb8){return _0x5cceb8?{'count':_0x1248cb,'rows':_0x5cceb8}:null;}})[_0x6757('0x20')](respondWithResult(_0xf43344,null))[_0x6757('0x3f')](handleError(_0xf43344,null));};exports[_0x6757('0x50')]=function(_0x271ea1,_0x2ce795,_0x1ece24){return db[_0x6757('0x27')][_0x6757('0x4e')]({'where':{'id':_0x271ea1[_0x6757('0x4c')]['id']}})[_0x6757('0x20')](handleEntityNotFound(_0x2ce795,null))[_0x6757('0x20')](function(_0x124e6c){if(_0x124e6c){return db[_0x6757('0x51')][_0x6757('0x52')](function(_0x4c8c10){return db[_0x6757('0x27')][_0x6757('0x21')]({'where':{'IntervalId':_0x271ea1[_0x6757('0x4c')]['id']},'transaction':_0x4c8c10})['then'](function(_0x5c009f){var _0xe11c41=_['map'](_0x271ea1[_0x6757('0x4a')],function(_0x642a23){delete _0x642a23['id'];_0x642a23[_0x6757('0x53')]=_0x271ea1[_0x6757('0x4c')]['id'];return _0x642a23;});return db[_0x6757('0x27')][_0x6757('0x54')](_0xe11c41,{'transaction':_0x4c8c10});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x271ea1['params']['id']}});});}})[_0x6757('0x20')](respondWithResult(_0x2ce795,null))[_0x6757('0x3f')](handleError(_0x2ce795,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 4cd6dc5..dc8952f 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 _0xa354=['iftime','exports','Interval','tools_intervals','rewrite','interval','getIntervals','then','all','map','../../components/extensions/rewrite','../../utils/iftime'];(function(_0x2c83a3,_0x4dcd84){var _0x1efdc1=function(_0x2b42ad){while(--_0x2b42ad){_0x2c83a3['push'](_0x2c83a3['shift']());}};_0x1efdc1(++_0x4dcd84);}(_0xa354,0x6a));var _0x4a35=function(_0x291501,_0x3116c0){_0x291501=_0x291501-0x0;var _0x5a8084=_0xa354[_0x291501];return _0x5a8084;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x4a35('0x0'));var iftime=require(_0x4a35('0x1'))[_0x4a35('0x2')];module[_0x4a35('0x3')]=function(_0x2ca22d){return _0x2ca22d['define'](_0x4a35('0x4'),attributes,{'tableName':_0x4a35('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1139b2){extensions[_0x4a35('0x6')](_0x2ca22d,_0x1139b2);},'afterBulkCreate':function(_0x4528b4,_0x21520b,_0x1d1cea){_0x1d1cea();extensions[_0x4a35('0x6')](_0x2ca22d,_0x4528b4[0x0]);},'afterUpdate':function(_0x21fc35){extensions[_0x4a35('0x6')](_0x2ca22d,_0x21fc35);},'afterDestroy':function(_0x524765){extensions[_0x4a35('0x6')](_0x2ca22d,_0x524765);}},'instanceMethods':{'ifTime':function(_0x336f89=undefined,_0x2d1186=new Date()){if(typeof this[_0x4a35('0x7')]==='string'){return iftime(this['interval'],_0x336f89,_0x2d1186);}else{return this[_0x4a35('0x8')]()[_0x4a35('0x9')](function(_0x5df2ea){return Promise[_0x4a35('0xa')](_0x5df2ea[_0x4a35('0xb')](function(_0x15b2ad){return _0x15b2ad['ifTime'](_0x336f89,_0x2d1186);}));})[_0x4a35('0x9')](function(_0xacca38){return _0xacca38['reduce'](function(_0x288a18,_0x1c14c0){return _0x288a18||_0x1c14c0;},![]);});}}}});}; \ No newline at end of file +var _0x9b70=['interval','string','getIntervals','then','all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','Interval','tools_intervals','rewrite'];(function(_0x146e1e,_0x1bb32c){var _0x417efe=function(_0x23e740){while(--_0x23e740){_0x146e1e['push'](_0x146e1e['shift']());}};_0x417efe(++_0x1bb32c);}(_0x9b70,0x1e3));var _0x09b7=function(_0x153c6c,_0x5aa22f){_0x153c6c=_0x153c6c-0x0;var _0x3c85d3=_0x9b70[_0x153c6c];return _0x3c85d3;};'use strict';var attributes=require(_0x09b7('0x0'));var extensions=require(_0x09b7('0x1'));var iftime=require(_0x09b7('0x2'))['iftime'];module[_0x09b7('0x3')]=function(_0x29369b){return _0x29369b['define'](_0x09b7('0x4'),attributes,{'tableName':_0x09b7('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x646e18){extensions[_0x09b7('0x6')](_0x29369b,_0x646e18);},'afterBulkCreate':function(_0x225bb2,_0x164f3a,_0x330426){_0x330426();extensions[_0x09b7('0x6')](_0x29369b,_0x225bb2[0x0]);},'afterUpdate':function(_0x319cc6){extensions['rewrite'](_0x29369b,_0x319cc6);},'afterDestroy':function(_0x5e37d6){extensions['rewrite'](_0x29369b,_0x5e37d6);}},'instanceMethods':{'ifTime':function(_0x5534cd=undefined,_0x2e7ee7=new Date()){if(typeof this[_0x09b7('0x7')]===_0x09b7('0x8')){return iftime(this[_0x09b7('0x7')],_0x5534cd,_0x2e7ee7);}else{return this[_0x09b7('0x9')]()[_0x09b7('0xa')](function(_0x38349d){return Promise[_0x09b7('0xb')](_0x38349d[_0x09b7('0xc')](function(_0x3e3f2c){return _0x3e3f2c[_0x09b7('0xd')](_0x5534cd,_0x2e7ee7);}));})[_0x09b7('0xa')](function(_0x4450e2){return _0x4450e2['reduce'](function(_0x4ae00f,_0x3ac539){return _0x4ae00f||_0x3ac539;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 0567954..01e7c52 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 _0xb239=['include','map','model','info','debug','stringify','catch','message','error','ShowInterval','find','then','all','ifTime','reduce','format','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','intervals','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','resolve','isArray','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','raw','where','attributes','limit'];(function(_0xa6a39c,_0x3fb727){var _0x4e5ff8=function(_0x271baa){while(--_0x271baa){_0xa6a39c['push'](_0xa6a39c['shift']());}};_0x4e5ff8(++_0x3fb727);}(_0xb239,0x112));var _0x9b23=function(_0x5cf76b,_0xfbf968){_0x5cf76b=_0x5cf76b-0x0;var _0x50d61f=_0xb239[_0x5cf76b];return _0x50d61f;};'use strict';var _=require(_0x9b23('0x0'));var util=require('util');var db=require(_0x9b23('0x1'))['db'];var iftime=require(_0x9b23('0x2'))[_0x9b23('0x3')];var logger=require(_0x9b23('0x4'))('rpc');exports[_0x9b23('0x5')]=function(_0x208fcc){var _0x1b53f0=this;return new Promise(function(_0x37f5a4,_0x4a426d){return db[_0x9b23('0x6')][_0x9b23('0x7')]({'raw':_0x208fcc[_0x9b23('0x8')]?_0x208fcc[_0x9b23('0x8')][_0x9b23('0x9')]===undefined?!![]:![]:!![],'where':_0x208fcc[_0x9b23('0x8')]?_0x208fcc[_0x9b23('0x8')][_0x9b23('0xa')]||null:null,'attributes':_0x208fcc[_0x9b23('0x8')]?_0x208fcc[_0x9b23('0x8')][_0x9b23('0xb')]||null:null,'limit':_0x208fcc['options']?_0x208fcc[_0x9b23('0x8')][_0x9b23('0xc')]||null:null,'include':_0x208fcc[_0x9b23('0x8')]?_0x208fcc[_0x9b23('0x8')][_0x9b23('0xd')]?_[_0x9b23('0xe')](_0x208fcc[_0x9b23('0x8')]['include'],function(_0x5e947a){return{'model':db[_0x5e947a[_0x9b23('0xf')]],'as':_0x5e947a['as'],'attributes':_0x5e947a['attributes'],'include':_0x5e947a[_0x9b23('0xd')]?_[_0x9b23('0xe')](_0x5e947a['include'],function(_0x3da30d){return{'model':db[_0x3da30d[_0x9b23('0xf')]],'as':_0x3da30d['as'],'attributes':_0x3da30d['attributes'],'include':_0x3da30d['include']?_['map'](_0x3da30d[_0x9b23('0xd')],function(_0x1a89b6){return{'model':db[_0x1a89b6[_0x9b23('0xf')]],'as':_0x1a89b6['as'],'attributes':_0x1a89b6[_0x9b23('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x333a77){logger[_0x9b23('0x10')]('GetInterval',_0x208fcc);logger[_0x9b23('0x11')](_0x9b23('0x5'),_0x208fcc,JSON[_0x9b23('0x12')](_0x333a77));_0x37f5a4(_0x333a77);})[_0x9b23('0x13')](function(_0x39ea7a){logger['error'](_0x9b23('0x5'),_0x39ea7a[_0x9b23('0x14')],_0x208fcc);_0x4a426d(_0x1b53f0[_0x9b23('0x15')](0x1f4,_0x39ea7a[_0x9b23('0x14')]));});});};exports[_0x9b23('0x16')]=function(_0x49dee5){var _0x45fbf5=this;return new Promise(function(_0x165bf3,_0x453e11){return db[_0x9b23('0x6')][_0x9b23('0x17')]({'raw':_0x49dee5[_0x9b23('0x8')]?_0x49dee5['options'][_0x9b23('0x9')]===undefined?!![]:![]:!![],'where':_0x49dee5['options']?_0x49dee5[_0x9b23('0x8')][_0x9b23('0xa')]||null:null,'attributes':_0x49dee5[_0x9b23('0x8')]?_0x49dee5[_0x9b23('0x8')]['attributes']||null:null,'include':_0x49dee5['options']?_0x49dee5[_0x9b23('0x8')][_0x9b23('0xd')]?_['map'](_0x49dee5[_0x9b23('0x8')][_0x9b23('0xd')],function(_0xce6873){return{'model':db[_0xce6873[_0x9b23('0xf')]],'as':_0xce6873['as'],'attributes':_0xce6873[_0x9b23('0xb')],'include':_0xce6873[_0x9b23('0xd')]?_[_0x9b23('0xe')](_0xce6873[_0x9b23('0xd')],function(_0x527b5f){return{'model':db[_0x527b5f[_0x9b23('0xf')]],'as':_0x527b5f['as'],'attributes':_0x527b5f['attributes'],'include':_0x527b5f[_0x9b23('0xd')]?_['map'](_0x527b5f[_0x9b23('0xd')],function(_0x42888e){return{'model':db[_0x42888e['model']],'as':_0x42888e['as'],'attributes':_0x42888e[_0x9b23('0xb')]};}):[]};}):[]};}):[]:[]})[_0x9b23('0x18')](function(_0x1e51b0){logger[_0x9b23('0x10')](_0x9b23('0x16'),_0x49dee5);logger[_0x9b23('0x11')](_0x9b23('0x16'),_0x49dee5,JSON[_0x9b23('0x12')](_0x1e51b0));_0x165bf3(_0x1e51b0);})[_0x9b23('0x13')](function(_0x27a2b6){logger[_0x9b23('0x15')]('ShowInterval',_0x27a2b6['message'],_0x49dee5);_0x453e11(_0x45fbf5[_0x9b23('0x15')](0x1f4,_0x27a2b6[_0x9b23('0x14')]));});});};function checkArrayOfIntervals(_0x5f26f0,_0x3de815){var _0x279c1c=[];return db[_0x9b23('0x6')][_0x9b23('0x7')]({'where':{'id':_0x5f26f0}})[_0x9b23('0x18')](function(_0x26705f){_0x279c1c=_0x26705f;return Promise[_0x9b23('0x19')](_0x279c1c[_0x9b23('0xe')](function(_0x4a138a){return _0x4a138a[_0x9b23('0x1a')](_0x3de815);}));})['then'](function(_0x4b1fa2){var _0xae449a=_0x4b1fa2[_0x9b23('0x1b')](function(_0x3c5f55,_0x492717){return _0x3c5f55||_0x492717;},![]);logger[_0x9b23('0x10')](util[_0x9b23('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x279c1c[_0x9b23('0xe')](function(_0x49033a){return _0x49033a['name'];})[_0x9b23('0x1d')](',\x20'),_0x279c1c[_0x9b23('0xe')](function(_0x431815){return _0x431815['id'];})[_0x9b23('0x1d')](',\x20')));return _0xae449a;});}function checkSingleInterval(_0x1d2f49,_0x7f35e){return db['Interval'][_0x9b23('0x1e')](_0x1d2f49)[_0x9b23('0x18')](function(_0x397432){if(_0x397432){logger['info'](util[_0x9b23('0x1c')](_0x9b23('0x1f'),_0x397432[_0x9b23('0x20')],_0x397432['id']));return _0x397432[_0x9b23('0x1a')](_0x7f35e);}});}exports['IntervalIftime']=function(_0x5e20a2){var _0x11de5a=_0x5e20a2['intervalIds'];var _0x20eec3=Array['isArray'](_0x5e20a2[_0x9b23('0x21')])?_0x5e20a2[_0x9b23('0x21')]:typeof _0x5e20a2[_0x9b23('0x21')]==='string'?[_0x5e20a2[_0x9b23('0x21')]]:[];var _0x22506b=_0x5e20a2['timezone']||undefined;var _0x3b07e5=![];if(_0x20eec3[_0x9b23('0x22')]){logger[_0x9b23('0x10')](util[_0x9b23('0x1c')](_0x9b23('0x23'),_0x20eec3[_0x9b23('0x1d')](';\x20')));}if(_0x22506b){logger[_0x9b23('0x10')](util[_0x9b23('0x1c')](_0x9b23('0x24'),_0x22506b));}logger[_0x9b23('0x11')]('Iftime',_0x3b07e5);logger[_0x9b23('0x25')](_0x9b23('0x26'),_0x5e20a2);return Promise[_0x9b23('0x27')]()[_0x9b23('0x18')](function(){if(Array[_0x9b23('0x28')](_0x11de5a)){return checkArrayOfIntervals(_0x11de5a,_0x22506b);}else if(_0x11de5a){return checkSingleInterval(_0x11de5a,_0x22506b);}})[_0x9b23('0x18')](function(_0x11445f){var _0x10aaea=_0x20eec3[_0x9b23('0x1b')](function(_0x129079,_0x2c8517){return _0x129079||iftime(_0x2c8517,_0x22506b);},![]);_0x3b07e5=_0x11445f||_0x10aaea;return _0x3b07e5;})[_0x9b23('0x13')](function(_0x444fb0){logger[_0x9b23('0x15')](_0x9b23('0x26'),_0x5e20a2,_0x444fb0);throw this['error'](0x1f4,_0x444fb0[_0x9b23('0x14')]);});}; \ No newline at end of file +var _0xb4b7=['intervals','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','catch','error','message','ShowInterval','find','info','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','name','IntervalIftime','intervalIds','isArray'];(function(_0x120b0d,_0x1885ed){var _0x970527=function(_0x32ca9d){while(--_0x32ca9d){_0x120b0d['push'](_0x120b0d['shift']());}};_0x970527(++_0x1885ed);}(_0xb4b7,0x124));var _0x7b4b=function(_0x3ef29e,_0x348d91){_0x3ef29e=_0x3ef29e-0x0;var _0x4d02de=_0xb4b7[_0x3ef29e];return _0x4d02de;};'use strict';var _=require(_0x7b4b('0x0'));var util=require(_0x7b4b('0x1'));var db=require(_0x7b4b('0x2'))['db'];var iftime=require(_0x7b4b('0x3'))[_0x7b4b('0x4')];var logger=require('../../config/logger')(_0x7b4b('0x5'));exports[_0x7b4b('0x6')]=function(_0xb5dab4){var _0x363875=this;return new Promise(function(_0x1ee8cd,_0x1be118){return db[_0x7b4b('0x7')][_0x7b4b('0x8')]({'raw':_0xb5dab4[_0x7b4b('0x9')]?_0xb5dab4[_0x7b4b('0x9')][_0x7b4b('0xa')]===undefined?!![]:![]:!![],'where':_0xb5dab4[_0x7b4b('0x9')]?_0xb5dab4['options'][_0x7b4b('0xb')]||null:null,'attributes':_0xb5dab4[_0x7b4b('0x9')]?_0xb5dab4[_0x7b4b('0x9')][_0x7b4b('0xc')]||null:null,'limit':_0xb5dab4[_0x7b4b('0x9')]?_0xb5dab4[_0x7b4b('0x9')][_0x7b4b('0xd')]||null:null,'include':_0xb5dab4[_0x7b4b('0x9')]?_0xb5dab4[_0x7b4b('0x9')][_0x7b4b('0xe')]?_[_0x7b4b('0xf')](_0xb5dab4['options'][_0x7b4b('0xe')],function(_0xfbaee5){return{'model':db[_0xfbaee5[_0x7b4b('0x10')]],'as':_0xfbaee5['as'],'attributes':_0xfbaee5[_0x7b4b('0xc')],'include':_0xfbaee5[_0x7b4b('0xe')]?_['map'](_0xfbaee5['include'],function(_0x4c9011){return{'model':db[_0x4c9011[_0x7b4b('0x10')]],'as':_0x4c9011['as'],'attributes':_0x4c9011[_0x7b4b('0xc')],'include':_0x4c9011[_0x7b4b('0xe')]?_[_0x7b4b('0xf')](_0x4c9011[_0x7b4b('0xe')],function(_0x5ef5ec){return{'model':db[_0x5ef5ec['model']],'as':_0x5ef5ec['as'],'attributes':_0x5ef5ec[_0x7b4b('0xc')]};}):[]};}):[]};}):[]:[]})[_0x7b4b('0x11')](function(_0x42bb33){logger['info'](_0x7b4b('0x6'),_0xb5dab4);logger[_0x7b4b('0x12')](_0x7b4b('0x6'),_0xb5dab4,JSON[_0x7b4b('0x13')](_0x42bb33));_0x1ee8cd(_0x42bb33);})[_0x7b4b('0x14')](function(_0xffe0bf){logger[_0x7b4b('0x15')](_0x7b4b('0x6'),_0xffe0bf[_0x7b4b('0x16')],_0xb5dab4);_0x1be118(_0x363875[_0x7b4b('0x15')](0x1f4,_0xffe0bf[_0x7b4b('0x16')]));});});};exports[_0x7b4b('0x17')]=function(_0x1b48be){var _0x1c6528=this;return new Promise(function(_0x3c0aba,_0x50348d){return db[_0x7b4b('0x7')][_0x7b4b('0x18')]({'raw':_0x1b48be[_0x7b4b('0x9')]?_0x1b48be[_0x7b4b('0x9')][_0x7b4b('0xa')]===undefined?!![]:![]:!![],'where':_0x1b48be[_0x7b4b('0x9')]?_0x1b48be[_0x7b4b('0x9')][_0x7b4b('0xb')]||null:null,'attributes':_0x1b48be['options']?_0x1b48be['options']['attributes']||null:null,'include':_0x1b48be[_0x7b4b('0x9')]?_0x1b48be[_0x7b4b('0x9')]['include']?_['map'](_0x1b48be[_0x7b4b('0x9')]['include'],function(_0x2cc310){return{'model':db[_0x2cc310['model']],'as':_0x2cc310['as'],'attributes':_0x2cc310[_0x7b4b('0xc')],'include':_0x2cc310['include']?_['map'](_0x2cc310['include'],function(_0x35cdcb){return{'model':db[_0x35cdcb[_0x7b4b('0x10')]],'as':_0x35cdcb['as'],'attributes':_0x35cdcb[_0x7b4b('0xc')],'include':_0x35cdcb[_0x7b4b('0xe')]?_[_0x7b4b('0xf')](_0x35cdcb[_0x7b4b('0xe')],function(_0x509fc3){return{'model':db[_0x509fc3['model']],'as':_0x509fc3['as'],'attributes':_0x509fc3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b4b('0x11')](function(_0x23a349){logger[_0x7b4b('0x19')](_0x7b4b('0x17'),_0x1b48be);logger[_0x7b4b('0x12')](_0x7b4b('0x17'),_0x1b48be,JSON[_0x7b4b('0x13')](_0x23a349));_0x3c0aba(_0x23a349);})['catch'](function(_0x12d614){logger[_0x7b4b('0x15')](_0x7b4b('0x17'),_0x12d614['message'],_0x1b48be);_0x50348d(_0x1c6528['error'](0x1f4,_0x12d614['message']));});});};function checkArrayOfIntervals(_0x398059,_0x319d37){var _0x9bc093=[];return db['Interval'][_0x7b4b('0x8')]({'where':{'id':_0x398059}})[_0x7b4b('0x11')](function(_0x508f52){_0x9bc093=_0x508f52;return Promise[_0x7b4b('0x1a')](_0x9bc093[_0x7b4b('0xf')](function(_0x3d9653){return _0x3d9653[_0x7b4b('0x1b')](_0x319d37);}));})[_0x7b4b('0x11')](function(_0x25f80d){var _0x2594e5=_0x25f80d[_0x7b4b('0x1c')](function(_0x3d16e9,_0x3b5db0){return _0x3d16e9||_0x3b5db0;},![]);logger[_0x7b4b('0x19')](util[_0x7b4b('0x1d')](_0x7b4b('0x1e'),_0x9bc093['map'](function(_0x24623d){return _0x24623d['name'];})[_0x7b4b('0x1f')](',\x20'),_0x9bc093[_0x7b4b('0xf')](function(_0x2f7956){return _0x2f7956['id'];})[_0x7b4b('0x1f')](',\x20')));return _0x2594e5;});}function checkSingleInterval(_0x42df3e,_0xdf84){return db[_0x7b4b('0x7')]['findById'](_0x42df3e)[_0x7b4b('0x11')](function(_0x41ba22){if(_0x41ba22){logger[_0x7b4b('0x19')](util[_0x7b4b('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x41ba22[_0x7b4b('0x20')],_0x41ba22['id']));return _0x41ba22[_0x7b4b('0x1b')](_0xdf84);}});}exports[_0x7b4b('0x21')]=function(_0x15623e){var _0x1fc632=_0x15623e[_0x7b4b('0x22')];var _0x48b28f=Array[_0x7b4b('0x23')](_0x15623e['intervals'])?_0x15623e[_0x7b4b('0x24')]:typeof _0x15623e[_0x7b4b('0x24')]==='string'?[_0x15623e['intervals']]:[];var _0x2cab4f=_0x15623e[_0x7b4b('0x25')]||undefined;var _0x451cd3=![];if(_0x48b28f['length']){logger['info'](util[_0x7b4b('0x1d')](_0x7b4b('0x26'),_0x48b28f[_0x7b4b('0x1f')](';\x20')));}if(_0x2cab4f){logger[_0x7b4b('0x19')](util[_0x7b4b('0x1d')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x2cab4f));}logger[_0x7b4b('0x12')](_0x7b4b('0x27'),_0x451cd3);logger['silly']('IntervalIftime',_0x15623e);return Promise[_0x7b4b('0x28')]()['then'](function(){if(Array[_0x7b4b('0x23')](_0x1fc632)){return checkArrayOfIntervals(_0x1fc632,_0x2cab4f);}else if(_0x1fc632){return checkSingleInterval(_0x1fc632,_0x2cab4f);}})[_0x7b4b('0x11')](function(_0x35b625){var _0x40c947=_0x48b28f[_0x7b4b('0x1c')](function(_0x5d1bff,_0xed9065){return _0x5d1bff||iftime(_0xed9065,_0x2cab4f);},![]);_0x451cd3=_0x35b625||_0x40c947;return _0x451cd3;})[_0x7b4b('0x14')](function(_0x2916b8){logger[_0x7b4b('0x15')](_0x7b4b('0x21'),_0x15623e,_0x2916b8);throw this[_0x7b4b('0x15')](0x1f4,_0x2916b8['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 44efa93..5ef67be 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x485865,_0x11d29a){_0x485865=_0x485865-0x0;var _0x11ef06=_0x0b0e[_0x485865];return _0x11ef06;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x40cb91,_0xca8c09){var _0x3cd00d=function(_0xa7b2e3){while(--_0xa7b2e3){_0x40cb91['push'](_0x40cb91['shift']());}};_0x3cd00d(++_0xca8c09);}(_0x5f2f,0x73));var _0xf5f2=function(_0x184eb2,_0x2f6b87){_0x184eb2=_0x184eb2-0x0;var _0x2bcd6f=_0x5f2f[_0x184eb2];return _0x2bcd6f;};'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 ed3d3a4..d0820cc 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 _0xf952=['json','parse','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','../../config/logger','support','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','statusCode'];(function(_0x2da230,_0x5a5dfc){var _0x3504a9=function(_0x5bc685){while(--_0x5bc685){_0x2da230['push'](_0x2da230['shift']());}};_0x3504a9(++_0x5a5dfc);}(_0xf952,0x1e6));var _0x2f95=function(_0xedfea7,_0xc17e11){_0xedfea7=_0xedfea7-0x0;var _0x4c7b82=_0xf952[_0xedfea7];return _0x4c7b82;};'use strict';var BPromise=require(_0x2f95('0x0'));var https=require('https');var logger=require(_0x2f95('0x1'))('api');var USERNAME=_0x2f95('0x2');var PASSWORD=_0x2f95('0x3');function openIssue(_0x467e9,_0x4e0a6a){var _0x313b63={'fields':{'project':{'key':_0x467e9['key']||'MOTGUI'},'summary':(_0x467e9[_0x2f95('0x4')]||_0x2f95('0x5'))+_0x2f95('0x6')+_0x467e9['ip'],'description':_0x467e9[_0x2f95('0x7')]||JSON[_0x2f95('0x8')](_0x467e9),'issuetype':{'name':_0x467e9[_0x2f95('0x9')]||_0x2f95('0xa')}}};_0x313b63[_0x2f95('0xb')][_0x2f95('0xc')]=_0x467e9[_0x2f95('0xd')];_0x313b63[_0x2f95('0xb')][_0x2f95('0xe')]=_0x467e9[_0x2f95('0xf')];_0x313b63['fields']['customfield_11502']=_0x467e9[_0x2f95('0x10')];_0x313b63[_0x2f95('0xb')][_0x2f95('0x11')]=_0x467e9['name'];_0x313b63[_0x2f95('0xb')]['customfield_11504']=_0x467e9['reason'];_0x313b63[_0x2f95('0xb')][_0x2f95('0x12')]=_0x467e9['ip'];var _0x1599ba={'host':_0x2f95('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x2f95('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x2f95('0x15'),'Authorization':_0x2f95('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x2f95('0x17')]('base64')}};var _0x434ea5=JSON[_0x2f95('0x8')](_0x313b63);var _0xdd2d0a=https[_0x2f95('0x18')](_0x1599ba,function(_0x3cd881){_0x3cd881[_0x2f95('0x19')](_0x2f95('0x1a'));var _0x8a5f76='';_0x3cd881['on'](_0x2f95('0x1b'),function(_0xbdef8d){_0x8a5f76+=_0xbdef8d;});_0x3cd881['on'](_0x2f95('0x1c'),function(){if(_0x4e0a6a){return _0x4e0a6a['status'](_0x3cd881[_0x2f95('0x1d')])[_0x2f95('0x1e')](JSON[_0x2f95('0x1f')](_0x8a5f76));}});});_0xdd2d0a['on']('error',function(_0x5ab0e4){if(_0x4e0a6a){return _0x4e0a6a[_0x2f95('0x20')](0x1f4)[_0x2f95('0x1e')]({'errors':[{'message':_0x2f95('0x21'),'type':_0x2f95('0x22')}]});}});_0xdd2d0a['write'](_0x434ea5);_0xdd2d0a[_0x2f95('0x1c')]();}exports[_0x2f95('0x23')]=openIssue;exports[_0x2f95('0x24')]=function(_0x2b3bb7,_0x51f7c6){_0x2b3bb7[_0x2f95('0x25')]['ip']=_0x2b3bb7[_0x2f95('0x26')][_0x2f95('0x27')]||_0x2b3bb7['connection'][_0x2f95('0x28')]||_0x2b3bb7[_0x2f95('0x29')]['remoteAddress']||_0x2b3bb7[_0x2f95('0x2a')]['socket'][_0x2f95('0x28')];return openIssue(_0x2b3bb7[_0x2f95('0x25')],_0x51f7c6);}; \ No newline at end of file +var _0x3803=['email','oldToken','customfield_11502','newToken','reason','customfield_10102','track.xcallymotion.com','POST','application/json','toString','base64','request','setEncoding','data','end','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','Bug','fields','customfield_11500'];(function(_0x2e7087,_0x112eec){var _0xb5b3a6=function(_0x296310){while(--_0x296310){_0x2e7087['push'](_0x2e7087['shift']());}};_0xb5b3a6(++_0x112eec);}(_0x3803,0xf3));var _0x3380=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x3803[_0x27af45];return _0x18df21;};'use strict';var BPromise=require(_0x3380('0x0'));var https=require(_0x3380('0x1'));var logger=require(_0x3380('0x2'))(_0x3380('0x3'));var USERNAME=_0x3380('0x4');var PASSWORD=_0x3380('0x5');function openIssue(_0x52d734,_0x1570d8){var _0x474075={'fields':{'project':{'key':_0x52d734[_0x3380('0x6')]||_0x3380('0x7')},'summary':(_0x52d734[_0x3380('0x8')]||'Report')+_0x3380('0x9')+_0x52d734['ip'],'description':_0x52d734[_0x3380('0xa')]||JSON[_0x3380('0xb')](_0x52d734),'issuetype':{'name':_0x52d734['issuetype']||_0x3380('0xc')}}};_0x474075[_0x3380('0xd')][_0x3380('0xe')]=_0x52d734[_0x3380('0xf')];_0x474075[_0x3380('0xd')]['customfield_11501']=_0x52d734[_0x3380('0x10')];_0x474075[_0x3380('0xd')][_0x3380('0x11')]=_0x52d734[_0x3380('0x12')];_0x474075[_0x3380('0xd')]['customfield_11503']=_0x52d734['name'];_0x474075[_0x3380('0xd')]['customfield_11504']=_0x52d734[_0x3380('0x13')];_0x474075['fields'][_0x3380('0x14')]=_0x52d734['ip'];var _0x126585={'host':_0x3380('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x3380('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x3380('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x3380('0x18')](_0x3380('0x19'))}};var _0x272fa7=JSON[_0x3380('0xb')](_0x474075);var _0xeeccc9=https[_0x3380('0x1a')](_0x126585,function(_0x85eaa0){_0x85eaa0[_0x3380('0x1b')]('utf8');var _0x2b643a='';_0x85eaa0['on'](_0x3380('0x1c'),function(_0x295ee4){_0x2b643a+=_0x295ee4;});_0x85eaa0['on'](_0x3380('0x1d'),function(){if(_0x1570d8){return _0x1570d8['status'](_0x85eaa0[_0x3380('0x1e')])[_0x3380('0x1f')](JSON['parse'](_0x2b643a));}});});_0xeeccc9['on'](_0x3380('0x20'),function(_0x226ebe){if(_0x1570d8){return _0x1570d8[_0x3380('0x21')](0x1f4)[_0x3380('0x1f')]({'errors':[{'message':_0x3380('0x22'),'type':'api.jira'}]});}});_0xeeccc9[_0x3380('0x23')](_0x272fa7);_0xeeccc9[_0x3380('0x1d')]();}exports[_0x3380('0x24')]=openIssue;exports[_0x3380('0x25')]=function(_0x3aa8be,_0x1301a2){_0x3aa8be[_0x3380('0x26')]['ip']=_0x3aa8be['headers'][_0x3380('0x27')]||_0x3aa8be[_0x3380('0x28')]['remoteAddress']||_0x3aa8be[_0x3380('0x29')][_0x3380('0x2a')]||_0x3aa8be[_0x3380('0x28')][_0x3380('0x29')][_0x3380('0x2a')];return openIssue(_0x3aa8be['body'],_0x1301a2);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3e01ccd..72229e2 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 _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c5d97,_0x392697){var _0x13c92a=function(_0x47ea8c){while(--_0x47ea8c){_0x5c5d97['push'](_0x5c5d97['shift']());}};_0x13c92a(++_0x392697);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5da657,_0x2144ce){_0x5da657=_0x5da657-0x0;var _0x24f12f=_0xd2ea[_0x5da657];return _0x24f12f;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file +var _0x6f7a=['isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x19b84f,_0x16ebfd){var _0xd2355=function(_0x36c427){while(--_0x36c427){_0x19b84f['push'](_0x19b84f['shift']());}};_0xd2355(++_0x16ebfd);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x672477,_0x326d26){_0x672477=_0x672477-0x0;var _0x51f486=_0x6f7a[_0x672477];return _0x51f486;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6f7('0x11')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);module[_0xa6f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 72a7559..f6b3028 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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0x7e175c,_0x524379){_0x7e175c=_0x7e175c-0x0;var _0x5808b7=_0x7a54[_0x7e175c];return _0x5808b7;};'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(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0xeb4319,_0x363e2f){_0xeb4319=_0xeb4319-0x0;var _0x356539=_0x7a54[_0xeb4319];return _0x356539;};'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 12274af..2136110 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 _0xd8b1=['then','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x1cd880,_0x31fc63){var _0x218fe0=function(_0x2be449){while(--_0x2be449){_0x1cd880['push'](_0x1cd880['shift']());}};_0x218fe0(++_0x31fc63);}(_0xd8b1,0x105));var _0x1d8b=function(_0xd8dd66,_0x3ccfcd){_0xd8dd66=_0xd8dd66-0x0;var _0x3744c1=_0xd8b1[_0xd8dd66];return _0x3744c1;};'use strict';var emlformat=require(_0x1d8b('0x0'));var rimraf=require(_0x1d8b('0x1'));var zipdir=require(_0x1d8b('0x2'));var jsonpatch=require(_0x1d8b('0x3'));var rp=require(_0x1d8b('0x4'));var moment=require('moment');var BPromise=require(_0x1d8b('0x5'));var Mustache=require(_0x1d8b('0x6'));var util=require('util');var path=require(_0x1d8b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d8b('0x8'));var _=require('lodash');var squel=require(_0x1d8b('0x9'));var crypto=require(_0x1d8b('0xa'));var jsforce=require(_0x1d8b('0xb'));var deskjs=require(_0x1d8b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d8b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d8b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d8b('0xf'));var logger=require('../../config/logger')(_0x1d8b('0x10'));var utils=require(_0x1d8b('0x11'));var config=require(_0x1d8b('0x12'));var licenseUtil=require(_0x1d8b('0x13'));var db=require(_0x1d8b('0x14'))['db'];function respondWithStatusCode(_0xfd985b,_0x4f506a){_0x4f506a=_0x4f506a||0xcc;return function(_0xec0671){if(_0xec0671){return _0xfd985b[_0x1d8b('0x15')](_0x4f506a);}return _0xfd985b[_0x1d8b('0x16')](_0x4f506a)[_0x1d8b('0x17')]();};}function respondWithResult(_0x4486a8,_0x3a23d0){_0x3a23d0=_0x3a23d0||0xc8;return function(_0x46bd8c){if(_0x46bd8c){return _0x4486a8[_0x1d8b('0x16')](_0x3a23d0)['json'](_0x46bd8c);}};}function respondWithFilteredResult(_0x50c75f,_0x3d54d3){return function(_0x3f31a4){if(_0x3f31a4){var _0x44ebbe=typeof _0x3d54d3[_0x1d8b('0x18')]===_0x1d8b('0x19')&&typeof _0x3d54d3[_0x1d8b('0x1a')]==='undefined';var _0x5aeef3=_0x3f31a4[_0x1d8b('0x1b')];var _0x100a9b=_0x44ebbe?0x0:_0x3d54d3[_0x1d8b('0x18')];var _0x1b6440=_0x44ebbe?_0x3f31a4[_0x1d8b('0x1b')]:_0x3d54d3['offset']+_0x3d54d3[_0x1d8b('0x1a')];var _0x57c63a;if(_0x1b6440>=_0x5aeef3){_0x1b6440=_0x5aeef3;_0x57c63a=0xc8;}else{_0x57c63a=0xce;}_0x50c75f['status'](_0x57c63a);return _0x50c75f[_0x1d8b('0x1c')](_0x1d8b('0x1d'),_0x100a9b+'-'+_0x1b6440+'/'+_0x5aeef3)[_0x1d8b('0x1e')](_0x3f31a4);}return null;};}function patchUpdates(_0x4f3342){return function(_0x2274c5){try{jsonpatch[_0x1d8b('0x1f')](_0x2274c5,_0x4f3342,!![]);}catch(_0x3cdf3b){return BPromise[_0x1d8b('0x20')](_0x3cdf3b);}return _0x2274c5[_0x1d8b('0x21')]();};}function saveUpdates(_0x130c00,_0x3c2c78){return function(_0x4d5ea8){if(_0x4d5ea8){return _0x4d5ea8[_0x1d8b('0x22')](_0x130c00)[_0x1d8b('0x23')](function(_0x3d8fcb){return _0x3d8fcb;});}return null;};}function removeEntity(_0x308b89,_0x5235b6){return function(_0x5bee29){if(_0x5bee29){return _0x5bee29[_0x1d8b('0x24')]()[_0x1d8b('0x23')](function(){_0x308b89['status'](0xcc)[_0x1d8b('0x17')]();});}};}function handleEntityNotFound(_0x461405,_0x497d02){return function(_0x4df3ab){if(!_0x4df3ab){_0x461405[_0x1d8b('0x15')](0x194);}return _0x4df3ab;};}function handleError(_0x19b9aa,_0x374954){_0x374954=_0x374954||0x1f4;return function(_0xe76d45){logger[_0x1d8b('0x25')](_0xe76d45[_0x1d8b('0x26')]);if(_0xe76d45[_0x1d8b('0x27')]){delete _0xe76d45['name'];}_0x19b9aa[_0x1d8b('0x16')](_0x374954)['send'](_0xe76d45);};}exports[_0x1d8b('0x28')]=function(_0x4ccfa9,_0x37c284){var _0x3f16de={},_0x14928e={},_0x41a54e={'count':0x0,'rows':[]};var _0x569ed4=_['map'](db[_0x1d8b('0x29')][_0x1d8b('0x2a')],function(_0x35efca){return{'name':_0x35efca[_0x1d8b('0x2b')],'type':_0x35efca[_0x1d8b('0x2c')][_0x1d8b('0x2d')]};});_0x14928e['model']=_[_0x1d8b('0x2e')](_0x569ed4,_0x1d8b('0x27'));_0x14928e[_0x1d8b('0x2f')]=_[_0x1d8b('0x30')](_0x4ccfa9[_0x1d8b('0x2f')]);_0x14928e[_0x1d8b('0x31')]=_[_0x1d8b('0x32')](_0x14928e[_0x1d8b('0x33')],_0x14928e[_0x1d8b('0x2f')]);_0x3f16de['attributes']=_[_0x1d8b('0x32')](_0x14928e['model'],qs['fields'](_0x4ccfa9['query'][_0x1d8b('0x34')]));_0x3f16de[_0x1d8b('0x35')]=_0x3f16de[_0x1d8b('0x35')][_0x1d8b('0x36')]?_0x3f16de[_0x1d8b('0x35')]:_0x14928e['model'];if(!_0x4ccfa9[_0x1d8b('0x2f')][_0x1d8b('0x37')](_0x1d8b('0x38'))){_0x3f16de[_0x1d8b('0x1a')]=qs[_0x1d8b('0x1a')](_0x4ccfa9[_0x1d8b('0x2f')][_0x1d8b('0x1a')]);_0x3f16de[_0x1d8b('0x18')]=qs['offset'](_0x4ccfa9[_0x1d8b('0x2f')]['offset']);}_0x3f16de[_0x1d8b('0x39')]=qs['sort'](_0x4ccfa9[_0x1d8b('0x2f')][_0x1d8b('0x3a')]);_0x3f16de[_0x1d8b('0x3b')]=qs['filters'](_[_0x1d8b('0x3c')](_0x4ccfa9[_0x1d8b('0x2f')],_0x14928e[_0x1d8b('0x31')]),_0x569ed4);if(_0x4ccfa9[_0x1d8b('0x2f')]['filter']){_0x3f16de[_0x1d8b('0x3b')]=_[_0x1d8b('0x3d')](_0x3f16de['where'],{'$or':_[_0x1d8b('0x2e')](_0x569ed4,function(_0x48217f){if(_0x48217f['type']!=='VIRTUAL'){var _0x21e9e0={};_0x21e9e0[_0x48217f[_0x1d8b('0x27')]]={'$like':'%'+_0x4ccfa9[_0x1d8b('0x2f')][_0x1d8b('0x3e')]+'%'};return _0x21e9e0;}})});}_0x3f16de=_[_0x1d8b('0x3d')]({},_0x3f16de,_0x4ccfa9[_0x1d8b('0x3f')]);var _0xaee456={'where':_0x3f16de['where']};return db[_0x1d8b('0x29')]['count'](_0xaee456)[_0x1d8b('0x23')](function(_0x5da0e7){_0x41a54e[_0x1d8b('0x1b')]=_0x5da0e7;if(_0x4ccfa9[_0x1d8b('0x2f')][_0x1d8b('0x40')]){_0x3f16de[_0x1d8b('0x41')]=[{'all':!![]}];}return db[_0x1d8b('0x29')][_0x1d8b('0x42')](_0x3f16de);})[_0x1d8b('0x23')](function(_0x47a4e6){_0x41a54e['rows']=_0x47a4e6;return _0x41a54e;})[_0x1d8b('0x23')](respondWithFilteredResult(_0x37c284,_0x3f16de))[_0x1d8b('0x43')](handleError(_0x37c284,null));};exports[_0x1d8b('0x44')]=function(_0x108a51,_0x39cfd3){var _0x4ea452={'raw':!![],'where':{'id':_0x108a51[_0x1d8b('0x45')]['id']}},_0x280775={};_0x280775['model']=_['keys'](db['JscriptyAnswerReport'][_0x1d8b('0x2a')]);_0x280775['query']=_[_0x1d8b('0x30')](_0x108a51[_0x1d8b('0x2f')]);_0x280775['filters']=_[_0x1d8b('0x32')](_0x280775[_0x1d8b('0x33')],_0x280775[_0x1d8b('0x2f')]);_0x4ea452[_0x1d8b('0x35')]=_[_0x1d8b('0x32')](_0x280775['model'],qs['fields'](_0x108a51[_0x1d8b('0x2f')][_0x1d8b('0x34')]));_0x4ea452[_0x1d8b('0x35')]=_0x4ea452['attributes'][_0x1d8b('0x36')]?_0x4ea452[_0x1d8b('0x35')]:_0x280775[_0x1d8b('0x33')];if(_0x108a51[_0x1d8b('0x2f')][_0x1d8b('0x40')]){_0x4ea452[_0x1d8b('0x41')]=[{'all':!![]}];}_0x4ea452=_[_0x1d8b('0x3d')]({},_0x4ea452,_0x108a51[_0x1d8b('0x3f')]);return db['JscriptyAnswerReport'][_0x1d8b('0x46')](_0x4ea452)[_0x1d8b('0x23')](handleEntityNotFound(_0x39cfd3,null))[_0x1d8b('0x23')](respondWithResult(_0x39cfd3,null))[_0x1d8b('0x43')](handleError(_0x39cfd3,null));};exports[_0x1d8b('0x47')]=function(_0xfaf101,_0x44cc0f){return db[_0x1d8b('0x29')]['create'](_0xfaf101[_0x1d8b('0x48')],{})[_0x1d8b('0x23')](respondWithResult(_0x44cc0f,0xc9))['catch'](handleError(_0x44cc0f,null));};exports['update']=function(_0x33d7cd,_0x51584d){if(_0x33d7cd[_0x1d8b('0x48')]['id']){delete _0x33d7cd[_0x1d8b('0x48')]['id'];}return db[_0x1d8b('0x29')][_0x1d8b('0x46')]({'where':{'id':_0x33d7cd[_0x1d8b('0x45')]['id']}})[_0x1d8b('0x23')](handleEntityNotFound(_0x51584d,null))[_0x1d8b('0x23')](saveUpdates(_0x33d7cd[_0x1d8b('0x48')],null))[_0x1d8b('0x23')](respondWithResult(_0x51584d,null))[_0x1d8b('0x43')](handleError(_0x51584d,null));};exports[_0x1d8b('0x24')]=function(_0x29d30c,_0x28aee5){return db[_0x1d8b('0x29')][_0x1d8b('0x46')]({'where':{'id':_0x29d30c[_0x1d8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x28aee5,null))['then'](removeEntity(_0x28aee5,null))[_0x1d8b('0x43')](handleError(_0x28aee5,null));};exports[_0x1d8b('0x49')]=function(_0x573ba8,_0x2445d3){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x2445d3,null))[_0x1d8b('0x43')](handleError(_0x2445d3,null));}; \ No newline at end of file +var _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','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(_0x4e7e72,_0x3a6fde){var _0x29554d=function(_0x298a94){while(--_0x298a94){_0x4e7e72['push'](_0x4e7e72['shift']());}};_0x29554d(++_0x3a6fde);}(_0x3435,0xfa));var _0x5343=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3435[_0x40a045];return _0x1a687c;};'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['JscriptyAnswerReport']['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['JscriptyAnswerReport'][_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['JscriptyAnswerReport'][_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['JscriptyAnswerReport'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 8e7018f..e6c9db0 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 _0x88a4=['path','rimraf','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird'];(function(_0x5f0225,_0x52631a){var _0x2cef4b=function(_0x5a29c6){while(--_0x5a29c6){_0x5f0225['push'](_0x5f0225['shift']());}};_0x2cef4b(++_0x52631a);}(_0x88a4,0x150));var _0x488a=function(_0x120db0,_0x1734be){_0x120db0=_0x120db0-0x0;var _0x48451e=_0x88a4[_0x120db0];return _0x48451e;};'use strict';var _=require(_0x488a('0x0'));var util=require('util');var logger=require(_0x488a('0x1'))(_0x488a('0x2'));var moment=require('moment');var BPromise=require(_0x488a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x488a('0x4'));var rimraf=require(_0x488a('0x5'));var config=require('../../config/environment');var attributes=require(_0x488a('0x6'));module['exports']=function(_0x2b6b7d,_0x186574){return _0x2b6b7d[_0x488a('0x7')](_0x488a('0x8'),attributes,{'tableName':_0x488a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bf6=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3104ae,_0x2ba4bf){var _0x306c53=function(_0xef4612){while(--_0xef4612){_0x3104ae['push'](_0x3104ae['shift']());}};_0x306c53(++_0x2ba4bf);}(_0x8bf6,0x1c8));var _0x68bf=function(_0x4b2d2a,_0x267012){_0x4b2d2a=_0x4b2d2a-0x0;var _0x596fc1=_0x8bf6[_0x4b2d2a];return _0x596fc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x68bf('0x0'))(_0x68bf('0x1'));var moment=require(_0x68bf('0x2'));var BPromise=require(_0x68bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x68bf('0x4'));var rimraf=require(_0x68bf('0x5'));var config=require('../../config/environment');var attributes=require(_0x68bf('0x6'));module[_0x68bf('0x7')]=function(_0x2c2c51,_0x31ef85){return _0x2c2c51[_0x68bf('0x8')](_0x68bf('0x9'),attributes,{'tableName':_0x68bf('0xa'),'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 3ecb7aa..4764a01 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 _0xee3c=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x5d7ee6,_0x213374){var _0x338267=function(_0x5d83fc){while(--_0x5d83fc){_0x5d7ee6['push'](_0x5d7ee6['shift']());}};_0x338267(++_0x213374);}(_0xee3c,0x87));var _0xcee3=function(_0x4b1a6c,_0x236acd){_0x4b1a6c=_0x4b1a6c-0x0;var _0x2b7f57=_0xee3c[_0x4b1a6c];return _0x2b7f57;};'use strict';var _=require('lodash');var util=require(_0xcee3('0x0'));var moment=require(_0xcee3('0x1'));var BPromise=require(_0xcee3('0x2'));var rs=require(_0xcee3('0x3'));var fs=require('fs');var Redis=require(_0xcee3('0x4'));var db=require(_0xcee3('0x5'))['db'];var utils=require(_0xcee3('0x6'));var logger=require(_0xcee3('0x7'))(_0xcee3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcee3('0x9')][_0xcee3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdf1f,_0x55e8b8,_0x21524a){return new BPromise(function(_0x4a9928,_0x3ae1b1){return client[_0xcee3('0xb')](_0x4cdf1f,_0x21524a)[_0xcee3('0xc')](function(_0x515d4a){logger[_0xcee3('0xd')](_0xcee3('0xe'),_0x55e8b8,_0xcee3('0xf'));logger[_0xcee3('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x55e8b8,_0xcee3('0xf'),JSON['stringify'](_0x515d4a));if(_0x515d4a[_0xcee3('0x11')]){if(_0x515d4a[_0xcee3('0x11')]['code']===0x1f4){logger['error'](_0xcee3('0xe'),_0x55e8b8,_0x515d4a[_0xcee3('0x11')][_0xcee3('0x12')]);return _0x3ae1b1(_0x515d4a[_0xcee3('0x11')][_0xcee3('0x12')]);}logger['error'](_0xcee3('0xe'),_0x55e8b8,_0x515d4a[_0xcee3('0x11')]['message']);return _0x4a9928(_0x515d4a[_0xcee3('0x11')][_0xcee3('0x12')]);}else{logger[_0xcee3('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x55e8b8,_0xcee3('0xf'));_0x4a9928(_0x515d4a[_0xcee3('0x13')]['message']);}})[_0xcee3('0x14')](function(_0x4339ea){logger['error'](_0xcee3('0xe'),_0x55e8b8,_0x4339ea);_0x3ae1b1(_0x4339ea);});});} \ No newline at end of file +var _0x0c5c=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0x0c5c,0x92));var _0xc0c5=function(_0x58cecb,_0x5e4a99){_0x58cecb=_0x58cecb-0x0;var _0x38e0a9=_0x0c5c[_0x58cecb];return _0x38e0a9;};'use strict';var _=require(_0xc0c5('0x0'));var util=require(_0xc0c5('0x1'));var moment=require(_0xc0c5('0x2'));var BPromise=require(_0xc0c5('0x3'));var rs=require(_0xc0c5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0c5('0x5'))['db'];var utils=require(_0xc0c5('0x6'));var logger=require(_0xc0c5('0x7'))('rpc');var config=require(_0xc0c5('0x8'));var jayson=require(_0xc0c5('0x9'));var client=jayson[_0xc0c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a3110,_0x2f5705,_0x446410){return new BPromise(function(_0xc338ac,_0x43c5c0){return client[_0xc0c5('0xb')](_0x2a3110,_0x446410)[_0xc0c5('0xc')](function(_0x5150c5){logger[_0xc0c5('0xd')](_0xc0c5('0xe'),_0x2f5705,_0xc0c5('0xf'));logger['debug'](_0xc0c5('0x10'),_0x2f5705,_0xc0c5('0xf'),JSON['stringify'](_0x5150c5));if(_0x5150c5['error']){if(_0x5150c5['error'][_0xc0c5('0x11')]===0x1f4){logger[_0xc0c5('0x12')](_0xc0c5('0xe'),_0x2f5705,_0x5150c5[_0xc0c5('0x12')]['message']);return _0x43c5c0(_0x5150c5[_0xc0c5('0x12')]['message']);}logger[_0xc0c5('0x12')](_0xc0c5('0xe'),_0x2f5705,_0x5150c5[_0xc0c5('0x12')][_0xc0c5('0x13')]);return _0xc338ac(_0x5150c5['error'][_0xc0c5('0x13')]);}else{logger['info'](_0xc0c5('0xe'),_0x2f5705,'request\x20sent');_0xc338ac(_0x5150c5[_0xc0c5('0x14')]['message']);}})['catch'](function(_0x334483){logger[_0xc0c5('0x12')](_0xc0c5('0xe'),_0x2f5705,_0x334483);_0x43c5c0(_0x334483);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 00f914f..a99f357 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 _0x11d2=['get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyProject.controller'];(function(_0x3f3153,_0x4c9c78){var _0x2a50f8=function(_0x23ba6c){while(--_0x23ba6c){_0x3f3153['push'](_0x3f3153['shift']());}};_0x2a50f8(++_0x4c9c78);}(_0x11d2,0x14b));var _0x211d=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x11d2[_0x20a558];return _0x53d3f7;};'use strict';var multer=require(_0x211d('0x0'));var util=require('util');var path=require(_0x211d('0x1'));var timeout=require(_0x211d('0x2'));var express=require(_0x211d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x211d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x211d('0x5'));var controller=require(_0x211d('0x6'));router[_0x211d('0x7')]('/',auth[_0x211d('0x8')](),controller[_0x211d('0x9')]);router[_0x211d('0x7')](_0x211d('0xa'),auth[_0x211d('0x8')](),controller[_0x211d('0xb')]);router[_0x211d('0x7')](_0x211d('0xc'),auth[_0x211d('0x8')](),controller[_0x211d('0xd')]);router[_0x211d('0x7')](_0x211d('0xe'),auth[_0x211d('0x8')](),controller[_0x211d('0xf')]);router['get'](_0x211d('0x10'),auth[_0x211d('0x8')](),timeout(_0x211d('0x11')),controller[_0x211d('0x12')]);router[_0x211d('0x13')]('/',auth[_0x211d('0x8')](),controller['create']);router[_0x211d('0x13')](_0x211d('0x14'),auth['isAuthenticated'](),controller[_0x211d('0x15')]);router[_0x211d('0x16')](_0x211d('0xa'),auth[_0x211d('0x8')](),controller[_0x211d('0x17')]);router[_0x211d('0x18')](_0x211d('0xa'),auth[_0x211d('0x8')](),controller['destroy']);module[_0x211d('0x19')]=router; \ No newline at end of file +var _0xbd2a=['/:id/clone','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','index','/:id','show','/:id/sessions','getSessions','/:id/answers','isAuthenticated','getAnswers','30s','getSummary','post','create'];(function(_0xe47034,_0x540251){var _0x5a9957=function(_0x34fe51){while(--_0x34fe51){_0xe47034['push'](_0xe47034['shift']());}};_0x5a9957(++_0x540251);}(_0xbd2a,0x132));var _0xabd2=function(_0x1791c9,_0x57703a){_0x1791c9=_0x1791c9-0x0;var _0x1e2528=_0xbd2a[_0x1791c9];return _0x1e2528;};'use strict';var multer=require(_0xabd2('0x0'));var util=require('util');var path=require(_0xabd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xabd2('0x2'));var router=express[_0xabd2('0x3')]();var fs_extra=require(_0xabd2('0x4'));var auth=require(_0xabd2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xabd2('0x6')]('/',auth['isAuthenticated'](),controller[_0xabd2('0x7')]);router[_0xabd2('0x6')](_0xabd2('0x8'),auth['isAuthenticated'](),controller[_0xabd2('0x9')]);router[_0xabd2('0x6')](_0xabd2('0xa'),auth['isAuthenticated'](),controller[_0xabd2('0xb')]);router['get'](_0xabd2('0xc'),auth[_0xabd2('0xd')](),controller[_0xabd2('0xe')]);router[_0xabd2('0x6')]('/:id/summary',auth[_0xabd2('0xd')](),timeout(_0xabd2('0xf')),controller[_0xabd2('0x10')]);router[_0xabd2('0x11')]('/',auth['isAuthenticated'](),controller[_0xabd2('0x12')]);router['post'](_0xabd2('0x13'),auth[_0xabd2('0xd')](),controller['clone']);router[_0xabd2('0x14')]('/:id',auth[_0xabd2('0xd')](),controller[_0xabd2('0x15')]);router[_0xabd2('0x16')](_0xabd2('0x8'),auth[_0xabd2('0xd')](),controller[_0xabd2('0x17')]);module[_0xabd2('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 0ce0a6c..7f4ed27 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 _0x4ab0=['formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','sequelize','lodash','util','exports','TEXT','isObjectLike','setDataValue'];(function(_0x2e63dd,_0x31651c){var _0x4fded6=function(_0x32d95d){while(--_0x32d95d){_0x2e63dd['push'](_0x2e63dd['shift']());}};_0x4fded6(++_0x31651c);}(_0x4ab0,0x125));var _0x04ab=function(_0x2c4e7c,_0x2e64c3){_0x2c4e7c=_0x2c4e7c-0x0;var _0x390eea=_0x4ab0[_0x2c4e7c];return _0x390eea;};'use strict';var Sequelize=require(_0x04ab('0x0'));var _=require(_0x04ab('0x1'));var util=require(_0x04ab('0x2'));module[_0x04ab('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x04ab('0x4')]('long'),'set':function(_0x2078c8){if(_[_0x04ab('0x5')](_0x2078c8)){this[_0x04ab('0x6')](_0x04ab('0x7'),JSON[_0x04ab('0x8')](_0x2078c8));}else if(_[_0x04ab('0x9')](_0x2078c8)){this['setDataValue']('formData',_0x2078c8);}else{this[_0x04ab('0x6')](_0x04ab('0x7'),util[_0x04ab('0xa')](_0x04ab('0xb'),this[_0x04ab('0xc')](_0x04ab('0xd'))||'',this[_0x04ab('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x04ab('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x04ab('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x5919=['sequelize','lodash','util','exports','STRING','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x25f372,_0x18327c){var _0x1069b7=function(_0x4566dc){while(--_0x4566dc){_0x25f372['push'](_0x25f372['shift']());}};_0x1069b7(++_0x18327c);}(_0x5919,0x75));var _0x9591=function(_0x537baf,_0x1d08ad){_0x537baf=_0x537baf-0x0;var _0x574e77=_0x5919[_0x537baf];return _0x574e77;};'use strict';var Sequelize=require(_0x9591('0x0'));var _=require(_0x9591('0x1'));var util=require(_0x9591('0x2'));module[_0x9591('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x9591('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x46c881){if(_['isObjectLike'](_0x46c881)){this[_0x9591('0x5')](_0x9591('0x6'),JSON['stringify'](_0x46c881));}else if(_[_0x9591('0x7')](_0x46c881)){this[_0x9591('0x5')]('formData',_0x46c881);}else{this[_0x9591('0x5')](_0x9591('0x6'),util[_0x9591('0x8')](_0x9591('0x9'),this[_0x9591('0xa')]('name')||'',this[_0x9591('0xa')](_0x9591('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9591('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9591('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 5696eae..a7df451 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 _0xafcb=['key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','includeAll','include','findAll','rows','catch','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','clone','params','omit','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','rawAttributes','pick','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','format','SessionId','answer','now','writeFileSync','setHeader','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','JscriptyProject','fieldName'];(function(_0x547deb,_0x1809a4){var _0x2bc011=function(_0x1834c8){while(--_0x1834c8){_0x547deb['push'](_0x547deb['shift']());}};_0x2bc011(++_0x1809a4);}(_0xafcb,0xb6));var _0xbafc=function(_0x296f90,_0x3e2b17){_0x296f90=_0x296f90-0x0;var _0x1bb1fa=_0xafcb[_0x296f90];return _0x1bb1fa;};'use strict';var emlformat=require(_0xbafc('0x0'));var rimraf=require(_0xbafc('0x1'));var zipdir=require(_0xbafc('0x2'));var jsonpatch=require(_0xbafc('0x3'));var rp=require(_0xbafc('0x4'));var moment=require(_0xbafc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbafc('0x6'));var util=require(_0xbafc('0x7'));var path=require(_0xbafc('0x8'));var sox=require(_0xbafc('0x9'));var csv=require('to-csv');var ejs=require(_0xbafc('0xa'));var fs=require('fs');var fs_extra=require(_0xbafc('0xb'));var _=require(_0xbafc('0xc'));var squel=require(_0xbafc('0xd'));var crypto=require('crypto');var jsforce=require(_0xbafc('0xe'));var deskjs=require(_0xbafc('0xf'));var toCsv=require(_0xbafc('0x10'));var querystring=require('querystring');var Papa=require(_0xbafc('0x11'));var Redis=require('ioredis');var authService=require(_0xbafc('0x12'));var qs=require(_0xbafc('0x13'));var as=require(_0xbafc('0x14'));var hardwareService=require(_0xbafc('0x15'));var logger=require(_0xbafc('0x16'))(_0xbafc('0x17'));var utils=require(_0xbafc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbafc('0x19'));var db=require(_0xbafc('0x1a'))['db'];function respondWithStatusCode(_0x732bb9,_0x959edd){_0x959edd=_0x959edd||0xcc;return function(_0x12ccb2){if(_0x12ccb2){return _0x732bb9['sendStatus'](_0x959edd);}return _0x732bb9[_0xbafc('0x1b')](_0x959edd)['end']();};}function respondWithResult(_0x29e862,_0x574f8b){_0x574f8b=_0x574f8b||0xc8;return function(_0x56dbab){if(_0x56dbab){return _0x29e862['status'](_0x574f8b)[_0xbafc('0x1c')](_0x56dbab);}};}function respondWithFilteredResult(_0x2d95eb,_0x4fdc0b){return function(_0x2a0e99){if(_0x2a0e99){var _0x54f144=typeof _0x4fdc0b[_0xbafc('0x1d')]==='undefined'&&typeof _0x4fdc0b[_0xbafc('0x1e')]==='undefined';var _0xc0f289=_0x2a0e99[_0xbafc('0x1f')];var _0x5f2034=_0x54f144?0x0:_0x4fdc0b[_0xbafc('0x1d')];var _0x4eea4b=_0x54f144?_0x2a0e99[_0xbafc('0x1f')]:_0x4fdc0b[_0xbafc('0x1d')]+_0x4fdc0b[_0xbafc('0x1e')];var _0xdad822;if(_0x4eea4b>=_0xc0f289){_0x4eea4b=_0xc0f289;_0xdad822=0xc8;}else{_0xdad822=0xce;}_0x2d95eb[_0xbafc('0x1b')](_0xdad822);return _0x2d95eb[_0xbafc('0x20')](_0xbafc('0x21'),_0x5f2034+'-'+_0x4eea4b+'/'+_0xc0f289)[_0xbafc('0x1c')](_0x2a0e99);}return null;};}function patchUpdates(_0x3443d5){return function(_0x267394){try{jsonpatch[_0xbafc('0x22')](_0x267394,_0x3443d5,!![]);}catch(_0x1e5371){return BPromise[_0xbafc('0x23')](_0x1e5371);}return _0x267394[_0xbafc('0x24')]();};}function saveUpdates(_0x5e78c5,_0x5f1330){return function(_0x5506d2){if(_0x5506d2){return _0x5506d2[_0xbafc('0x25')](_0x5e78c5)['then'](function(_0xfcb308){return _0xfcb308;});}return null;};}function removeEntity(_0x3f0dca,_0x5cec82){return function(_0x53035d){if(_0x53035d){return _0x53035d[_0xbafc('0x26')]()[_0xbafc('0x27')](function(){var _0x5bf96f=_0x53035d[_0xbafc('0x28')]({'plain':!![]});var _0x2aeb55='Projects';return db[_0xbafc('0x29')]['destroy']({'where':{'type':_0x2aeb55,'resourceId':_0x5bf96f['id']}})[_0xbafc('0x27')](function(){return _0x53035d;});})['then'](function(){_0x3f0dca[_0xbafc('0x1b')](0xcc)[_0xbafc('0x2a')]();});}};}function handleEntityNotFound(_0x1c16bd,_0x5d0082){return function(_0x7e878a){if(!_0x7e878a){_0x1c16bd['sendStatus'](0x194);}return _0x7e878a;};}function handleError(_0x50b9ef,_0x153c32){_0x153c32=_0x153c32||0x1f4;return function(_0x1d2988){logger[_0xbafc('0x2b')](_0x1d2988[_0xbafc('0x2c')]);if(_0x1d2988[_0xbafc('0x2d')]){delete _0x1d2988['name'];}_0x50b9ef[_0xbafc('0x1b')](_0x153c32)[_0xbafc('0x2e')](_0x1d2988);};}exports[_0xbafc('0x2f')]=function(_0xf08cc8,_0x2e7bff){var _0xe1ef58={},_0x584a7e={},_0x11c700={'count':0x0,'rows':[]};var _0x4ddb43=_['map'](db[_0xbafc('0x30')]['rawAttributes'],function(_0x556e57){return{'name':_0x556e57[_0xbafc('0x31')],'type':_0x556e57['type'][_0xbafc('0x32')]};});_0x584a7e['model']=_[_0xbafc('0x33')](_0x4ddb43,_0xbafc('0x2d'));_0x584a7e[_0xbafc('0x34')]=_[_0xbafc('0x35')](_0xf08cc8[_0xbafc('0x34')]);_0x584a7e['filters']=_[_0xbafc('0x36')](_0x584a7e[_0xbafc('0x37')],_0x584a7e[_0xbafc('0x34')]);_0xe1ef58['attributes']=_[_0xbafc('0x36')](_0x584a7e[_0xbafc('0x37')],qs[_0xbafc('0x38')](_0xf08cc8['query'][_0xbafc('0x38')]));_0xe1ef58[_0xbafc('0x39')]=_0xe1ef58[_0xbafc('0x39')][_0xbafc('0x3a')]?_0xe1ef58[_0xbafc('0x39')]:_0x584a7e[_0xbafc('0x37')];if(!_0xf08cc8[_0xbafc('0x34')][_0xbafc('0x3b')](_0xbafc('0x3c'))){_0xe1ef58[_0xbafc('0x1e')]=qs[_0xbafc('0x1e')](_0xf08cc8[_0xbafc('0x34')][_0xbafc('0x1e')]);_0xe1ef58['offset']=qs[_0xbafc('0x1d')](_0xf08cc8[_0xbafc('0x34')]['offset']);}_0xe1ef58[_0xbafc('0x3d')]=qs[_0xbafc('0x3e')](_0xf08cc8['query'][_0xbafc('0x3e')]);_0xe1ef58[_0xbafc('0x3f')]=qs[_0xbafc('0x40')](_['pick'](_0xf08cc8[_0xbafc('0x34')],_0x584a7e[_0xbafc('0x40')]),_0x4ddb43);if(_0xf08cc8[_0xbafc('0x34')][_0xbafc('0x41')]){_0xe1ef58[_0xbafc('0x3f')]=_[_0xbafc('0x42')](_0xe1ef58[_0xbafc('0x3f')],{'$or':_[_0xbafc('0x33')](_0x4ddb43,function(_0x2bd0c7){if(_0x2bd0c7[_0xbafc('0x43')]!=='VIRTUAL'){var _0x76e28a={};_0x76e28a[_0x2bd0c7[_0xbafc('0x2d')]]={'$like':'%'+_0xf08cc8[_0xbafc('0x34')][_0xbafc('0x41')]+'%'};return _0x76e28a;}})});}_0xe1ef58=_[_0xbafc('0x42')]({},_0xe1ef58,_0xf08cc8['options']);var _0x3bb82c={'where':_0xe1ef58['where']};return db[_0xbafc('0x30')][_0xbafc('0x1f')](_0x3bb82c)[_0xbafc('0x27')](function(_0x208cca){_0x11c700[_0xbafc('0x1f')]=_0x208cca;if(_0xf08cc8[_0xbafc('0x34')][_0xbafc('0x44')]){_0xe1ef58[_0xbafc('0x45')]=[{'all':!![]}];}return db[_0xbafc('0x30')][_0xbafc('0x46')](_0xe1ef58);})[_0xbafc('0x27')](function(_0xa3330a){_0x11c700[_0xbafc('0x47')]=_0xa3330a;return _0x11c700;})['then'](respondWithFilteredResult(_0x2e7bff,_0xe1ef58))[_0xbafc('0x48')](handleError(_0x2e7bff,null));};exports['show']=function(_0x121e72,_0x21af5f){var _0x239131={'raw':![],'where':{'id':_0x121e72['params']['id']}},_0x43b84d={};_0x43b84d['model']=_[_0xbafc('0x35')](db[_0xbafc('0x30')]['rawAttributes']);_0x43b84d[_0xbafc('0x34')]=_[_0xbafc('0x35')](_0x121e72['query']);_0x43b84d[_0xbafc('0x40')]=_[_0xbafc('0x36')](_0x43b84d[_0xbafc('0x37')],_0x43b84d[_0xbafc('0x34')]);_0x239131[_0xbafc('0x39')]=_[_0xbafc('0x36')](_0x43b84d['model'],qs[_0xbafc('0x38')](_0x121e72['query'][_0xbafc('0x38')]));_0x239131['attributes']=_0x239131[_0xbafc('0x39')][_0xbafc('0x3a')]?_0x239131[_0xbafc('0x39')]:_0x43b84d[_0xbafc('0x37')];if(_0x121e72['query'][_0xbafc('0x44')]){_0x239131[_0xbafc('0x45')]=[{'all':!![]}];}_0x239131=_['merge']({},_0x239131,_0x121e72[_0xbafc('0x49')]);return db['JscriptyProject'][_0xbafc('0x4a')](_0x239131)[_0xbafc('0x27')](handleEntityNotFound(_0x21af5f,null))[_0xbafc('0x27')](respondWithResult(_0x21af5f,null))['catch'](handleError(_0x21af5f,null));};exports[_0xbafc('0x4b')]=function(_0x25052b,_0x422db4){return db[_0xbafc('0x30')][_0xbafc('0x4b')](_0x25052b['body'],{})['then'](function(_0x48acc7){var _0x48d7c3=_0x25052b[_0xbafc('0x4c')][_0xbafc('0x28')]({'plain':!![]});if(!_0x48d7c3)throw new Error(_0xbafc('0x4d'));if(_0x48d7c3['role']===_0xbafc('0x4c')){var _0x4a8e8d=_0x48acc7['get']({'plain':!![]});var _0x409526=_0xbafc('0x4e');return db[_0xbafc('0x4f')][_0xbafc('0x4a')]({'where':{'name':_0x409526,'userProfileId':_0x48d7c3[_0xbafc('0x50')]},'raw':!![]})[_0xbafc('0x27')](function(_0x4f6c02){if(_0x4f6c02&&_0x4f6c02['autoAssociation']===0x0){return db['UserProfileResource'][_0xbafc('0x4b')]({'name':_0x4a8e8d[_0xbafc('0x2d')],'resourceId':_0x4a8e8d['id'],'type':_0x4f6c02['name'],'sectionId':_0x4f6c02['id']},{})[_0xbafc('0x27')](function(){return _0x48acc7;});}else{return _0x48acc7;}})[_0xbafc('0x48')](function(_0x38ada3){logger[_0xbafc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38ada3);throw _0x38ada3;});}return _0x48acc7;})[_0xbafc('0x27')](respondWithResult(_0x422db4,0xc9))[_0xbafc('0x48')](handleError(_0x422db4,null));};exports[_0xbafc('0x51')]=function(_0x30ef46,_0x30369a){var _0x413212={'where':{'id':_0x30ef46[_0xbafc('0x52')]['id']}},_0x34b269={};_0x34b269[_0xbafc('0x37')]=_['keys'](db[_0xbafc('0x30')]['rawAttributes']);_0x413212[_0xbafc('0x39')]=_[_0xbafc('0x36')](_0x34b269[_0xbafc('0x37')],qs[_0xbafc('0x38')](_0x30ef46[_0xbafc('0x34')][_0xbafc('0x38')]));_0x413212['attributes']=_0x413212[_0xbafc('0x39')][_0xbafc('0x3a')]?_0x413212['attributes']:_0x34b269['model'];if(_0x30ef46['query'][_0xbafc('0x44')]){_0x413212[_0xbafc('0x45')]=[{'all':!![]}];}_0x413212=_['merge']({},_0x413212,_0x30ef46[_0xbafc('0x49')]);return db[_0xbafc('0x30')][_0xbafc('0x4a')](_0x413212)[_0xbafc('0x27')](handleEntityNotFound(_0x30369a,null))['then'](function(_0x5a292a){if(_0x5a292a){var _0x367881=_0x5a292a[_0xbafc('0x28')]({'plain':!![]});_0x367881=qs[_0xbafc('0x53')](_0x367881,['id','createdAt',_0xbafc('0x54')]);_0x30ef46['body']=_[_0xbafc('0x53')](_0x30ef46[_0xbafc('0x55')],['id','createdAt',_0xbafc('0x54')]);return db[_0xbafc('0x30')][_0xbafc('0x4b')](_[_0xbafc('0x42')](_0x367881,_0x30ef46[_0xbafc('0x55')]),{'include':_0x30ef46[_0xbafc('0x34')][_0xbafc('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x988720){var _0x8b5140=_0x30ef46['user'][_0xbafc('0x28')]({'plain':!![]});if(!_0x8b5140)throw new Error(_0xbafc('0x4d'));if(_0x8b5140['role']==='user'){var _0x5edf49=_0x988720[_0xbafc('0x28')]({'plain':!![]});var _0xb8cc2=_0xbafc('0x4e');return db[_0xbafc('0x4f')][_0xbafc('0x4a')]({'where':{'name':_0xb8cc2,'userProfileId':_0x8b5140[_0xbafc('0x50')]},'raw':!![]})['then'](function(_0x180b5f){if(_0x180b5f&&_0x180b5f[_0xbafc('0x56')]===0x0){return db[_0xbafc('0x29')][_0xbafc('0x4b')]({'name':_0x5edf49['name'],'resourceId':_0x5edf49['id'],'type':_0x180b5f['name'],'sectionId':_0x180b5f['id']},{})[_0xbafc('0x27')](function(){return _0x988720;});}else{return _0x988720;}})[_0xbafc('0x48')](function(_0x31c687){logger['error'](_0xbafc('0x57'),_0x31c687);throw _0x31c687;});}return _0x988720;});}})[_0xbafc('0x27')](respondWithResult(_0x30369a,0xc9))[_0xbafc('0x48')](handleError(_0x30369a,null));};exports['update']=function(_0x178e92,_0x36ef36){if(_0x178e92['body']['id']){delete _0x178e92[_0xbafc('0x55')]['id'];}return db[_0xbafc('0x30')][_0xbafc('0x4a')]({'where':{'id':_0x178e92[_0xbafc('0x52')]['id']}})['then'](handleEntityNotFound(_0x36ef36,null))[_0xbafc('0x27')](saveUpdates(_0x178e92[_0xbafc('0x55')],null))[_0xbafc('0x27')](respondWithResult(_0x36ef36,null))[_0xbafc('0x48')](handleError(_0x36ef36,null));};exports[_0xbafc('0x26')]=function(_0xcb86a2,_0x169e81){return db[_0xbafc('0x30')][_0xbafc('0x4a')]({'where':{'id':_0xcb86a2[_0xbafc('0x52')]['id']}})['then'](handleEntityNotFound(_0x169e81,null))['then'](removeEntity(_0x169e81,null))[_0xbafc('0x48')](handleError(_0x169e81,null));};exports[_0xbafc('0x58')]=function(_0x122fe1,_0x3757ff,_0x2613d0){var _0x38447d={'raw':!![],'where':{}};var _0xb0e800={};var _0x5039db={'count':0x0,'rows':[]};return db[_0xbafc('0x30')][_0xbafc('0x59')]({'where':{'id':_0x122fe1['params']['id']}})['then'](handleEntityNotFound(_0x3757ff,null))[_0xbafc('0x27')](function(_0x1a6431){if(_0x1a6431){_0xb0e800['model']=_[_0xbafc('0x35')](db[_0xbafc('0x5a')][_0xbafc('0x5b')]);_0xb0e800['query']=_[_0xbafc('0x35')](_0x122fe1[_0xbafc('0x34')]);_0xb0e800[_0xbafc('0x40')]=_[_0xbafc('0x36')](_0xb0e800[_0xbafc('0x37')],_0xb0e800[_0xbafc('0x34')]);_0x38447d[_0xbafc('0x39')]=_['intersection'](_0xb0e800['model'],qs[_0xbafc('0x38')](_0x122fe1['query'][_0xbafc('0x38')]));_0x38447d['attributes']=_0x38447d[_0xbafc('0x39')][_0xbafc('0x3a')]?_0x38447d['attributes']:_0xb0e800['model'];if(!_0x122fe1[_0xbafc('0x34')][_0xbafc('0x3b')](_0xbafc('0x3c'))){_0x38447d[_0xbafc('0x1e')]=qs['limit'](_0x122fe1[_0xbafc('0x34')][_0xbafc('0x1e')]);_0x38447d[_0xbafc('0x1d')]=qs[_0xbafc('0x1d')](_0x122fe1[_0xbafc('0x34')][_0xbafc('0x1d')]);}_0x38447d[_0xbafc('0x3d')]=qs[_0xbafc('0x3e')](_0x122fe1[_0xbafc('0x34')][_0xbafc('0x3e')]);_0x38447d[_0xbafc('0x3f')]=qs['filters'](_[_0xbafc('0x5c')](_0x122fe1[_0xbafc('0x34')],_0xb0e800[_0xbafc('0x40')]));_0x38447d['where'][_0xbafc('0x5d')]=_0x1a6431['id'];if(_0x122fe1[_0xbafc('0x34')][_0xbafc('0x41')]){_0x38447d['where']=_['merge'](_0x38447d[_0xbafc('0x3f')],{'$or':_[_0xbafc('0x33')](_0x38447d[_0xbafc('0x39')],function(_0x11bf69){var _0x157b63={};_0x157b63[_0x11bf69]={'$like':'%'+_0x122fe1['query'][_0xbafc('0x41')]+'%'};return _0x157b63;})});}_0x38447d=_['merge']({},_0x38447d,_0x122fe1[_0xbafc('0x49')]);return db['JscriptySessionReport'][_0xbafc('0x1f')]({'where':_0x38447d['where']})['then'](function(_0x1ab8e9){_0x5039db[_0xbafc('0x1f')]=_0x1ab8e9;if(_0x122fe1[_0xbafc('0x34')][_0xbafc('0x44')]){_0x38447d[_0xbafc('0x45')]=[{'all':!![]}];}return db[_0xbafc('0x5a')][_0xbafc('0x46')](_0x38447d);})[_0xbafc('0x27')](function(_0x32709b){_0x5039db[_0xbafc('0x47')]=_0x32709b;return _0x5039db;});}})[_0xbafc('0x27')](respondWithFilteredResult(_0x3757ff,_0x38447d))[_0xbafc('0x48')](handleError(_0x3757ff,null));};exports['getAnswers']=function(_0x3d113b,_0x1a2887,_0x4edb5f){var _0x726038={'raw':!![],'where':{}};var _0x22f6d1={};var _0x499c24={'count':0x0,'rows':[]};return db[_0xbafc('0x30')][_0xbafc('0x59')]({'where':{'id':_0x3d113b[_0xbafc('0x52')]['id']}})[_0xbafc('0x27')](handleEntityNotFound(_0x1a2887,null))[_0xbafc('0x27')](function(_0x4fb2e7){if(_0x4fb2e7){_0x22f6d1['model']=_[_0xbafc('0x35')](db[_0xbafc('0x5e')][_0xbafc('0x5b')]);_0x22f6d1[_0xbafc('0x34')]=_['keys'](_0x3d113b[_0xbafc('0x34')]);_0x22f6d1['filters']=_['intersection'](_0x22f6d1['model'],_0x22f6d1[_0xbafc('0x34')]);_0x726038[_0xbafc('0x39')]=_[_0xbafc('0x36')](_0x22f6d1[_0xbafc('0x37')],qs['fields'](_0x3d113b[_0xbafc('0x34')]['fields']));_0x726038[_0xbafc('0x39')]=_0x726038[_0xbafc('0x39')][_0xbafc('0x3a')]?_0x726038[_0xbafc('0x39')]:_0x22f6d1[_0xbafc('0x37')];if(!_0x3d113b[_0xbafc('0x34')][_0xbafc('0x3b')](_0xbafc('0x3c'))){_0x726038[_0xbafc('0x1e')]=qs['limit'](_0x3d113b[_0xbafc('0x34')][_0xbafc('0x1e')]);_0x726038[_0xbafc('0x1d')]=qs[_0xbafc('0x1d')](_0x3d113b[_0xbafc('0x34')][_0xbafc('0x1d')]);}_0x726038[_0xbafc('0x3d')]=qs[_0xbafc('0x3e')](_0x3d113b[_0xbafc('0x34')]['sort']);_0x726038[_0xbafc('0x3f')]=qs[_0xbafc('0x40')](_['pick'](_0x3d113b[_0xbafc('0x34')],_0x22f6d1[_0xbafc('0x40')]));_0x726038[_0xbafc('0x3f')][_0xbafc('0x5d')]=_0x4fb2e7['id'];if(_0x3d113b[_0xbafc('0x34')][_0xbafc('0x41')]){_0x726038[_0xbafc('0x3f')]=_['merge'](_0x726038[_0xbafc('0x3f')],{'$or':_[_0xbafc('0x33')](_0x726038['attributes'],function(_0x18cafa){var _0x3aa6a5={};_0x3aa6a5[_0x18cafa]={'$like':'%'+_0x3d113b['query'][_0xbafc('0x41')]+'%'};return _0x3aa6a5;})});}_0x726038=_[_0xbafc('0x42')]({},_0x726038,_0x3d113b[_0xbafc('0x49')]);return db[_0xbafc('0x5e')][_0xbafc('0x1f')]({'where':_0x726038[_0xbafc('0x3f')]})[_0xbafc('0x27')](function(_0x417646){_0x499c24['count']=_0x417646;if(_0x3d113b[_0xbafc('0x34')][_0xbafc('0x44')]){_0x726038[_0xbafc('0x45')]=[{'all':!![]}];}return db[_0xbafc('0x5e')][_0xbafc('0x46')](_0x726038);})[_0xbafc('0x27')](function(_0x95c5bc){_0x499c24['rows']=_0x95c5bc;return _0x499c24;});}})[_0xbafc('0x27')](respondWithFilteredResult(_0x1a2887,_0x726038))[_0xbafc('0x48')](handleError(_0x1a2887,null));};function char(_0x2a272d){return _0xbafc('0x5f')===typeof _0x2a272d?String[_0xbafc('0x60')][_0xbafc('0x22')](null,arguments):_0x2a272d;}function needsEncapsulation(_0x168984){return!!_0x168984&&(_0x168984[_0xbafc('0x61')]()[_0xbafc('0x62')](char(0xd))>=0x0||_0x168984[_0xbafc('0x61')]()[_0xbafc('0x62')](char(0xa))>=0x0||_0x168984[_0xbafc('0x61')]()['indexOf'](char(0x2c))>=0x0||_0x168984[_0xbafc('0x61')]()[_0xbafc('0x62')](char(0x22))>=0x0);}function encapsulate(_0x27d5e7){var _0x325050=char(0x22),_0x4088e7='\x5c'+char(0x22),_0x18c16b=_0x27d5e7[_0xbafc('0x61')]()[_0xbafc('0x63')](new RegExp(_0x325050,'g'),_0x4088e7);return _0x325050+_0x18c16b+_0x325050;}exports['getSummary']=function(_0x4b1b9b,_0xd50e89,_0x280bf1){var _0x15c0af,_0xcd5d44;var _0x3d7528={'where':{'ProjectId':_0x4b1b9b[_0xbafc('0x52')]['id']}};if(_0x4b1b9b[_0xbafc('0x34')][_0xbafc('0x64')]){_0x3d7528[_0xbafc('0x3f')][_0xbafc('0x65')]=JSON[_0xbafc('0x66')](_0x4b1b9b[_0xbafc('0x34')][_0xbafc('0x64')]);}return db[_0xbafc('0x5a')][_0xbafc('0x46')](_0x3d7528)[_0xbafc('0x27')](handleEntityNotFound(_0xd50e89,null))['then'](function(_0x787398){if(_0x787398){_0x15c0af=_0x787398;return db['JscriptyQuestionReport'][_0xbafc('0x46')]({'where':{'SessionId':{'$in':_[_0xbafc('0x33')](_0x15c0af,'id')},'ProjectId':_0x4b1b9b[_0xbafc('0x52')]['id']},'order':_0xbafc('0x67')});}})[_0xbafc('0x27')](handleEntityNotFound(_0xd50e89,null))[_0xbafc('0x27')](function(_0x40a110){if(_0x40a110){_0xcd5d44=_0x40a110;var _0x1c5af8={};for(var _0x35aaaf=0x0,_0x33eea2=_0xcd5d44['length'];_0x35aaaf<_0x33eea2;_0x35aaaf++){if(!_0x1c5af8[_0xbafc('0x3b')](_0xcd5d44[_0x35aaaf][_0xbafc('0x68')])){_0x1c5af8[_0xcd5d44[_0x35aaaf][_0xbafc('0x68')]]=needsEncapsulation(_0xcd5d44[_0x35aaaf][_0xbafc('0x69')])?encapsulate(_0xcd5d44[_0x35aaaf]['question']):_0xcd5d44[_0x35aaaf][_0xbafc('0x69')];}}var _0x5378c3=[],_0x12f887={};for(var _0x137b21=0x0,_0x132e58=_0x15c0af[_0xbafc('0x3a')];_0x137b21<_0x132e58;_0x137b21++){_0x12f887={'ProjectId':_0x4b1b9b[_0xbafc('0x52')]['id'],'SessionId':_0x15c0af[_0x137b21]['id'],'StartTime':moment(_0x15c0af[_0x137b21]['starttime'])[_0xbafc('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x218c01=0x0,_0x1e003b=_0xcd5d44['length'];_0x218c01<_0x1e003b;_0x218c01++){if(_0xcd5d44[_0x218c01][_0xbafc('0x6b')]==_0x15c0af[_0x137b21]['id']&&_0x1c5af8['hasOwnProperty'](_0xcd5d44[_0x218c01][_0xbafc('0x68')])){_0x12f887[_0x1c5af8[_0xcd5d44[_0x218c01][_0xbafc('0x68')]]]=_0xcd5d44[_0x218c01][_0xbafc('0x6c')];}}for(var _0x1eef3c in _0x1c5af8){if(!_0x12f887[_0xbafc('0x3b')](_0x1c5af8[_0x1eef3c])){_0x12f887[_0x1c5af8[_0x1eef3c]]=null;}}_0x5378c3['push'](_0x12f887);}return _0x5378c3;}})[_0xbafc('0x27')](function(_0x32c69b){if(!_['isEmpty'](_0x32c69b)){var _0x13bd78=toCsv(_0x32c69b);var _0x32e476=Date[_0xbafc('0x6d')]();fs[_0xbafc('0x6e')](util[_0xbafc('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4b1b9b[_0xbafc('0x52')]['id'],_0x32e476),_0x13bd78);_0xd50e89['setHeader']('Content-disposition','attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4b1b9b[_0xbafc('0x52')]['id'],_0x32e476));_0xd50e89[_0xbafc('0x6f')]('Content-type',_0xbafc('0x70'));return _0xd50e89[_0xbafc('0x71')](util[_0xbafc('0x6a')](_0xbafc('0x72'),_0x4b1b9b['params']['id'],_0x32e476));}else{return _0xd50e89[_0xbafc('0x73')](0xcc);}})[_0xbafc('0x48')](handleError(_0xd50e89,null));}; \ No newline at end of file +var _0x2b84=['fromCharCode','apply','indexOf','toString','replace','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','sendStatus','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Projects','UserProfileResource','error','name','index','map','JscriptyProject','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','clone','options','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','hasOwnProperty','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number'];(function(_0xf08375,_0x21611d){var _0x191f56=function(_0x2b1e91){while(--_0x2b1e91){_0xf08375['push'](_0xf08375['shift']());}};_0x191f56(++_0x21611d);}(_0x2b84,0x1ed));var _0x42b8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2b84[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x42b8('0x0'));var rimraf=require(_0x42b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42b8('0x2'));var rp=require(_0x42b8('0x3'));var moment=require(_0x42b8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42b8('0x5'));var util=require('util');var path=require(_0x42b8('0x6'));var sox=require('sox');var csv=require(_0x42b8('0x7'));var ejs=require(_0x42b8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x42b8('0x9'));var crypto=require(_0x42b8('0xa'));var jsforce=require(_0x42b8('0xb'));var deskjs=require(_0x42b8('0xc'));var toCsv=require(_0x42b8('0x7'));var querystring=require('querystring');var Papa=require(_0x42b8('0xd'));var Redis=require(_0x42b8('0xe'));var authService=require(_0x42b8('0xf'));var qs=require(_0x42b8('0x10'));var as=require(_0x42b8('0x11'));var hardwareService=require(_0x42b8('0x12'));var logger=require(_0x42b8('0x13'))(_0x42b8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x42b8('0x15'));var db=require(_0x42b8('0x16'))['db'];function respondWithStatusCode(_0x5a10b5,_0x3f7cc1){_0x3f7cc1=_0x3f7cc1||0xcc;return function(_0x54d531){if(_0x54d531){return _0x5a10b5['sendStatus'](_0x3f7cc1);}return _0x5a10b5[_0x42b8('0x17')](_0x3f7cc1)[_0x42b8('0x18')]();};}function respondWithResult(_0x15fab4,_0x1ea576){_0x1ea576=_0x1ea576||0xc8;return function(_0xf1fcc1){if(_0xf1fcc1){return _0x15fab4['status'](_0x1ea576)[_0x42b8('0x19')](_0xf1fcc1);}};}function respondWithFilteredResult(_0x48d8f9,_0x23a8f8){return function(_0x58c768){if(_0x58c768){var _0x54b74b=typeof _0x23a8f8[_0x42b8('0x1a')]===_0x42b8('0x1b')&&typeof _0x23a8f8[_0x42b8('0x1c')]===_0x42b8('0x1b');var _0x1b7701=_0x58c768[_0x42b8('0x1d')];var _0x5ef289=_0x54b74b?0x0:_0x23a8f8[_0x42b8('0x1a')];var _0x5664a4=_0x54b74b?_0x58c768['count']:_0x23a8f8[_0x42b8('0x1a')]+_0x23a8f8[_0x42b8('0x1c')];var _0x2310a2;if(_0x5664a4>=_0x1b7701){_0x5664a4=_0x1b7701;_0x2310a2=0xc8;}else{_0x2310a2=0xce;}_0x48d8f9[_0x42b8('0x17')](_0x2310a2);return _0x48d8f9[_0x42b8('0x1e')](_0x42b8('0x1f'),_0x5ef289+'-'+_0x5664a4+'/'+_0x1b7701)[_0x42b8('0x19')](_0x58c768);}return null;};}function patchUpdates(_0x3dd964){return function(_0x2a28ba){try{jsonpatch['apply'](_0x2a28ba,_0x3dd964,!![]);}catch(_0x5dbcdd){return BPromise['reject'](_0x5dbcdd);}return _0x2a28ba[_0x42b8('0x20')]();};}function saveUpdates(_0xcdbef8,_0x135bab){return function(_0x20b35f){if(_0x20b35f){return _0x20b35f['update'](_0xcdbef8)[_0x42b8('0x21')](function(_0x3434b0){return _0x3434b0;});}return null;};}function removeEntity(_0x5cbca8,_0x479b6d){return function(_0x328e72){if(_0x328e72){return _0x328e72[_0x42b8('0x22')]()[_0x42b8('0x21')](function(){var _0x183bd0=_0x328e72[_0x42b8('0x23')]({'plain':!![]});var _0x551b5e=_0x42b8('0x24');return db[_0x42b8('0x25')][_0x42b8('0x22')]({'where':{'type':_0x551b5e,'resourceId':_0x183bd0['id']}})[_0x42b8('0x21')](function(){return _0x328e72;});})[_0x42b8('0x21')](function(){_0x5cbca8['status'](0xcc)[_0x42b8('0x18')]();});}};}function handleEntityNotFound(_0x2a50aa,_0x583c70){return function(_0x471fc0){if(!_0x471fc0){_0x2a50aa['sendStatus'](0x194);}return _0x471fc0;};}function handleError(_0x1fd893,_0x124aef){_0x124aef=_0x124aef||0x1f4;return function(_0x59dc05){logger[_0x42b8('0x26')](_0x59dc05['stack']);if(_0x59dc05[_0x42b8('0x27')]){delete _0x59dc05[_0x42b8('0x27')];}_0x1fd893[_0x42b8('0x17')](_0x124aef)['send'](_0x59dc05);};}exports[_0x42b8('0x28')]=function(_0x2dcfc8,_0x81944d){var _0x45b1e1={},_0x520c4={},_0x453227={'count':0x0,'rows':[]};var _0x196e8f=_[_0x42b8('0x29')](db[_0x42b8('0x2a')][_0x42b8('0x2b')],function(_0x3a795b){return{'name':_0x3a795b['fieldName'],'type':_0x3a795b[_0x42b8('0x2c')][_0x42b8('0x2d')]};});_0x520c4['model']=_[_0x42b8('0x29')](_0x196e8f,_0x42b8('0x27'));_0x520c4[_0x42b8('0x2e')]=_[_0x42b8('0x2f')](_0x2dcfc8['query']);_0x520c4[_0x42b8('0x30')]=_['intersection'](_0x520c4[_0x42b8('0x31')],_0x520c4[_0x42b8('0x2e')]);_0x45b1e1['attributes']=_[_0x42b8('0x32')](_0x520c4[_0x42b8('0x31')],qs[_0x42b8('0x33')](_0x2dcfc8[_0x42b8('0x2e')][_0x42b8('0x33')]));_0x45b1e1[_0x42b8('0x34')]=_0x45b1e1[_0x42b8('0x34')][_0x42b8('0x35')]?_0x45b1e1['attributes']:_0x520c4[_0x42b8('0x31')];if(!_0x2dcfc8['query']['hasOwnProperty'](_0x42b8('0x36'))){_0x45b1e1[_0x42b8('0x1c')]=qs[_0x42b8('0x1c')](_0x2dcfc8[_0x42b8('0x2e')]['limit']);_0x45b1e1[_0x42b8('0x1a')]=qs['offset'](_0x2dcfc8[_0x42b8('0x2e')][_0x42b8('0x1a')]);}_0x45b1e1[_0x42b8('0x37')]=qs[_0x42b8('0x38')](_0x2dcfc8[_0x42b8('0x2e')][_0x42b8('0x38')]);_0x45b1e1[_0x42b8('0x39')]=qs['filters'](_[_0x42b8('0x3a')](_0x2dcfc8[_0x42b8('0x2e')],_0x520c4[_0x42b8('0x30')]),_0x196e8f);if(_0x2dcfc8['query'][_0x42b8('0x3b')]){_0x45b1e1['where']=_[_0x42b8('0x3c')](_0x45b1e1[_0x42b8('0x39')],{'$or':_['map'](_0x196e8f,function(_0x2025cd){if(_0x2025cd[_0x42b8('0x2c')]!==_0x42b8('0x3d')){var _0x16c419={};_0x16c419[_0x2025cd[_0x42b8('0x27')]]={'$like':'%'+_0x2dcfc8[_0x42b8('0x2e')][_0x42b8('0x3b')]+'%'};return _0x16c419;}})});}_0x45b1e1=_[_0x42b8('0x3c')]({},_0x45b1e1,_0x2dcfc8['options']);var _0x138266={'where':_0x45b1e1[_0x42b8('0x39')]};return db['JscriptyProject'][_0x42b8('0x1d')](_0x138266)[_0x42b8('0x21')](function(_0x3f8d00){_0x453227[_0x42b8('0x1d')]=_0x3f8d00;if(_0x2dcfc8['query'][_0x42b8('0x3e')]){_0x45b1e1[_0x42b8('0x3f')]=[{'all':!![]}];}return db[_0x42b8('0x2a')][_0x42b8('0x40')](_0x45b1e1);})[_0x42b8('0x21')](function(_0x5ded87){_0x453227[_0x42b8('0x41')]=_0x5ded87;return _0x453227;})[_0x42b8('0x21')](respondWithFilteredResult(_0x81944d,_0x45b1e1))[_0x42b8('0x42')](handleError(_0x81944d,null));};exports[_0x42b8('0x43')]=function(_0x5e34a4,_0x18fb14){var _0x3328a9={'raw':![],'where':{'id':_0x5e34a4['params']['id']}},_0x32d6d2={};_0x32d6d2['model']=_[_0x42b8('0x2f')](db[_0x42b8('0x2a')][_0x42b8('0x2b')]);_0x32d6d2[_0x42b8('0x2e')]=_[_0x42b8('0x2f')](_0x5e34a4[_0x42b8('0x2e')]);_0x32d6d2[_0x42b8('0x30')]=_[_0x42b8('0x32')](_0x32d6d2[_0x42b8('0x31')],_0x32d6d2[_0x42b8('0x2e')]);_0x3328a9['attributes']=_[_0x42b8('0x32')](_0x32d6d2[_0x42b8('0x31')],qs['fields'](_0x5e34a4['query']['fields']));_0x3328a9['attributes']=_0x3328a9[_0x42b8('0x34')][_0x42b8('0x35')]?_0x3328a9[_0x42b8('0x34')]:_0x32d6d2[_0x42b8('0x31')];if(_0x5e34a4[_0x42b8('0x2e')][_0x42b8('0x3e')]){_0x3328a9['include']=[{'all':!![]}];}_0x3328a9=_[_0x42b8('0x3c')]({},_0x3328a9,_0x5e34a4['options']);return db[_0x42b8('0x2a')][_0x42b8('0x44')](_0x3328a9)['then'](handleEntityNotFound(_0x18fb14,null))[_0x42b8('0x21')](respondWithResult(_0x18fb14,null))[_0x42b8('0x42')](handleError(_0x18fb14,null));};exports['create']=function(_0x47b4ec,_0x37dbdd){return db[_0x42b8('0x2a')][_0x42b8('0x45')](_0x47b4ec[_0x42b8('0x46')],{})[_0x42b8('0x21')](function(_0x24b474){var _0x2c0d4b=_0x47b4ec[_0x42b8('0x47')]['get']({'plain':!![]});if(!_0x2c0d4b)throw new Error(_0x42b8('0x48'));if(_0x2c0d4b[_0x42b8('0x49')]==='user'){var _0x404e53=_0x24b474[_0x42b8('0x23')]({'plain':!![]});var _0x5da195=_0x42b8('0x24');return db['UserProfileSection'][_0x42b8('0x44')]({'where':{'name':_0x5da195,'userProfileId':_0x2c0d4b[_0x42b8('0x4a')]},'raw':!![]})[_0x42b8('0x21')](function(_0x49eab7){if(_0x49eab7&&_0x49eab7[_0x42b8('0x4b')]===0x0){return db[_0x42b8('0x25')][_0x42b8('0x45')]({'name':_0x404e53[_0x42b8('0x27')],'resourceId':_0x404e53['id'],'type':_0x49eab7['name'],'sectionId':_0x49eab7['id']},{})[_0x42b8('0x21')](function(){return _0x24b474;});}else{return _0x24b474;}})['catch'](function(_0x353511){logger[_0x42b8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353511);throw _0x353511;});}return _0x24b474;})[_0x42b8('0x21')](respondWithResult(_0x37dbdd,0xc9))[_0x42b8('0x42')](handleError(_0x37dbdd,null));};exports[_0x42b8('0x4c')]=function(_0x441dfa,_0x2f1380){var _0x50465b={'where':{'id':_0x441dfa['params']['id']}},_0x2abbab={};_0x2abbab[_0x42b8('0x31')]=_['keys'](db[_0x42b8('0x2a')][_0x42b8('0x2b')]);_0x50465b[_0x42b8('0x34')]=_[_0x42b8('0x32')](_0x2abbab[_0x42b8('0x31')],qs[_0x42b8('0x33')](_0x441dfa['query'][_0x42b8('0x33')]));_0x50465b[_0x42b8('0x34')]=_0x50465b['attributes'][_0x42b8('0x35')]?_0x50465b[_0x42b8('0x34')]:_0x2abbab[_0x42b8('0x31')];if(_0x441dfa['query']['includeAll']){_0x50465b['include']=[{'all':!![]}];}_0x50465b=_[_0x42b8('0x3c')]({},_0x50465b,_0x441dfa[_0x42b8('0x4d')]);return db[_0x42b8('0x2a')][_0x42b8('0x44')](_0x50465b)['then'](handleEntityNotFound(_0x2f1380,null))[_0x42b8('0x21')](function(_0x4afdd4){if(_0x4afdd4){var _0x1c3bf3=_0x4afdd4[_0x42b8('0x23')]({'plain':!![]});_0x1c3bf3=qs[_0x42b8('0x4e')](_0x1c3bf3,['id',_0x42b8('0x4f'),'updatedAt']);_0x441dfa[_0x42b8('0x46')]=_[_0x42b8('0x4e')](_0x441dfa[_0x42b8('0x46')],['id',_0x42b8('0x4f'),_0x42b8('0x50')]);return db[_0x42b8('0x2a')]['create'](_[_0x42b8('0x3c')](_0x1c3bf3,_0x441dfa[_0x42b8('0x46')]),{'include':_0x441dfa[_0x42b8('0x2e')][_0x42b8('0x3e')]?[{'all':!![]}]:undefined})[_0x42b8('0x21')](function(_0x5e655b){var _0x67cdc5=_0x441dfa[_0x42b8('0x47')]['get']({'plain':!![]});if(!_0x67cdc5)throw new Error(_0x42b8('0x48'));if(_0x67cdc5[_0x42b8('0x49')]==='user'){var _0x1c6c5e=_0x5e655b[_0x42b8('0x23')]({'plain':!![]});var _0x3f2ff0=_0x42b8('0x24');return db[_0x42b8('0x51')][_0x42b8('0x44')]({'where':{'name':_0x3f2ff0,'userProfileId':_0x67cdc5[_0x42b8('0x4a')]},'raw':!![]})[_0x42b8('0x21')](function(_0x67ce7a){if(_0x67ce7a&&_0x67ce7a[_0x42b8('0x4b')]===0x0){return db[_0x42b8('0x25')]['create']({'name':_0x1c6c5e[_0x42b8('0x27')],'resourceId':_0x1c6c5e['id'],'type':_0x67ce7a[_0x42b8('0x27')],'sectionId':_0x67ce7a['id']},{})['then'](function(){return _0x5e655b;});}else{return _0x5e655b;}})[_0x42b8('0x42')](function(_0x4fdcfd){logger[_0x42b8('0x26')](_0x42b8('0x52'),_0x4fdcfd);throw _0x4fdcfd;});}return _0x5e655b;});}})[_0x42b8('0x21')](respondWithResult(_0x2f1380,0xc9))[_0x42b8('0x42')](handleError(_0x2f1380,null));};exports[_0x42b8('0x53')]=function(_0x248572,_0x15bf33){if(_0x248572[_0x42b8('0x46')]['id']){delete _0x248572[_0x42b8('0x46')]['id'];}return db[_0x42b8('0x2a')]['find']({'where':{'id':_0x248572[_0x42b8('0x54')]['id']}})[_0x42b8('0x21')](handleEntityNotFound(_0x15bf33,null))['then'](saveUpdates(_0x248572['body'],null))['then'](respondWithResult(_0x15bf33,null))[_0x42b8('0x42')](handleError(_0x15bf33,null));};exports[_0x42b8('0x22')]=function(_0x5d5a48,_0x32e010){return db[_0x42b8('0x2a')][_0x42b8('0x44')]({'where':{'id':_0x5d5a48[_0x42b8('0x54')]['id']}})[_0x42b8('0x21')](handleEntityNotFound(_0x32e010,null))['then'](removeEntity(_0x32e010,null))['catch'](handleError(_0x32e010,null));};exports['getSessions']=function(_0x150f9a,_0x490950,_0x22cf66){var _0xad151={'raw':!![],'where':{}};var _0x2787ac={};var _0x185b77={'count':0x0,'rows':[]};return db[_0x42b8('0x2a')][_0x42b8('0x55')]({'where':{'id':_0x150f9a['params']['id']}})['then'](handleEntityNotFound(_0x490950,null))['then'](function(_0xd12625){if(_0xd12625){_0x2787ac['model']=_[_0x42b8('0x2f')](db['JscriptySessionReport'][_0x42b8('0x2b')]);_0x2787ac[_0x42b8('0x2e')]=_['keys'](_0x150f9a[_0x42b8('0x2e')]);_0x2787ac[_0x42b8('0x30')]=_[_0x42b8('0x32')](_0x2787ac['model'],_0x2787ac[_0x42b8('0x2e')]);_0xad151[_0x42b8('0x34')]=_[_0x42b8('0x32')](_0x2787ac[_0x42b8('0x31')],qs[_0x42b8('0x33')](_0x150f9a['query'][_0x42b8('0x33')]));_0xad151[_0x42b8('0x34')]=_0xad151[_0x42b8('0x34')][_0x42b8('0x35')]?_0xad151[_0x42b8('0x34')]:_0x2787ac[_0x42b8('0x31')];if(!_0x150f9a[_0x42b8('0x2e')][_0x42b8('0x56')](_0x42b8('0x36'))){_0xad151[_0x42b8('0x1c')]=qs['limit'](_0x150f9a[_0x42b8('0x2e')][_0x42b8('0x1c')]);_0xad151[_0x42b8('0x1a')]=qs[_0x42b8('0x1a')](_0x150f9a[_0x42b8('0x2e')][_0x42b8('0x1a')]);}_0xad151[_0x42b8('0x37')]=qs[_0x42b8('0x38')](_0x150f9a[_0x42b8('0x2e')][_0x42b8('0x38')]);_0xad151[_0x42b8('0x39')]=qs[_0x42b8('0x30')](_[_0x42b8('0x3a')](_0x150f9a['query'],_0x2787ac[_0x42b8('0x30')]));_0xad151[_0x42b8('0x39')][_0x42b8('0x57')]=_0xd12625['id'];if(_0x150f9a['query']['filter']){_0xad151[_0x42b8('0x39')]=_[_0x42b8('0x3c')](_0xad151[_0x42b8('0x39')],{'$or':_[_0x42b8('0x29')](_0xad151[_0x42b8('0x34')],function(_0x1fd73c){var _0x2aa45c={};_0x2aa45c[_0x1fd73c]={'$like':'%'+_0x150f9a[_0x42b8('0x2e')][_0x42b8('0x3b')]+'%'};return _0x2aa45c;})});}_0xad151=_[_0x42b8('0x3c')]({},_0xad151,_0x150f9a['options']);return db[_0x42b8('0x58')][_0x42b8('0x1d')]({'where':_0xad151[_0x42b8('0x39')]})[_0x42b8('0x21')](function(_0x10845d){_0x185b77[_0x42b8('0x1d')]=_0x10845d;if(_0x150f9a['query'][_0x42b8('0x3e')]){_0xad151[_0x42b8('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0xad151);})[_0x42b8('0x21')](function(_0x7ad47f){_0x185b77[_0x42b8('0x41')]=_0x7ad47f;return _0x185b77;});}})[_0x42b8('0x21')](respondWithFilteredResult(_0x490950,_0xad151))['catch'](handleError(_0x490950,null));};exports[_0x42b8('0x59')]=function(_0x1b5671,_0x5af69e,_0x5c531d){var _0x961495={'raw':!![],'where':{}};var _0x30624d={};var _0x45b80e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x42b8('0x55')]({'where':{'id':_0x1b5671[_0x42b8('0x54')]['id']}})[_0x42b8('0x21')](handleEntityNotFound(_0x5af69e,null))[_0x42b8('0x21')](function(_0x5ede79){if(_0x5ede79){_0x30624d[_0x42b8('0x31')]=_[_0x42b8('0x2f')](db['JscriptyAnswerReport'][_0x42b8('0x2b')]);_0x30624d[_0x42b8('0x2e')]=_[_0x42b8('0x2f')](_0x1b5671[_0x42b8('0x2e')]);_0x30624d[_0x42b8('0x30')]=_[_0x42b8('0x32')](_0x30624d[_0x42b8('0x31')],_0x30624d[_0x42b8('0x2e')]);_0x961495[_0x42b8('0x34')]=_[_0x42b8('0x32')](_0x30624d['model'],qs[_0x42b8('0x33')](_0x1b5671[_0x42b8('0x2e')][_0x42b8('0x33')]));_0x961495['attributes']=_0x961495['attributes'][_0x42b8('0x35')]?_0x961495[_0x42b8('0x34')]:_0x30624d[_0x42b8('0x31')];if(!_0x1b5671[_0x42b8('0x2e')][_0x42b8('0x56')]('nolimit')){_0x961495['limit']=qs['limit'](_0x1b5671[_0x42b8('0x2e')]['limit']);_0x961495[_0x42b8('0x1a')]=qs[_0x42b8('0x1a')](_0x1b5671[_0x42b8('0x2e')][_0x42b8('0x1a')]);}_0x961495[_0x42b8('0x37')]=qs[_0x42b8('0x38')](_0x1b5671['query'][_0x42b8('0x38')]);_0x961495[_0x42b8('0x39')]=qs[_0x42b8('0x30')](_['pick'](_0x1b5671['query'],_0x30624d[_0x42b8('0x30')]));_0x961495[_0x42b8('0x39')][_0x42b8('0x57')]=_0x5ede79['id'];if(_0x1b5671['query'][_0x42b8('0x3b')]){_0x961495[_0x42b8('0x39')]=_['merge'](_0x961495['where'],{'$or':_[_0x42b8('0x29')](_0x961495[_0x42b8('0x34')],function(_0x8a5c19){var _0x5a5a2e={};_0x5a5a2e[_0x8a5c19]={'$like':'%'+_0x1b5671['query'][_0x42b8('0x3b')]+'%'};return _0x5a5a2e;})});}_0x961495=_['merge']({},_0x961495,_0x1b5671[_0x42b8('0x4d')]);return db[_0x42b8('0x5a')][_0x42b8('0x1d')]({'where':_0x961495[_0x42b8('0x39')]})[_0x42b8('0x21')](function(_0x4b43f4){_0x45b80e[_0x42b8('0x1d')]=_0x4b43f4;if(_0x1b5671[_0x42b8('0x2e')][_0x42b8('0x3e')]){_0x961495[_0x42b8('0x3f')]=[{'all':!![]}];}return db[_0x42b8('0x5a')][_0x42b8('0x40')](_0x961495);})['then'](function(_0x205b95){_0x45b80e[_0x42b8('0x41')]=_0x205b95;return _0x45b80e;});}})[_0x42b8('0x21')](respondWithFilteredResult(_0x5af69e,_0x961495))[_0x42b8('0x42')](handleError(_0x5af69e,null));};function char(_0x16fcbd){return _0x42b8('0x5b')===typeof _0x16fcbd?String[_0x42b8('0x5c')][_0x42b8('0x5d')](null,arguments):_0x16fcbd;}function needsEncapsulation(_0x5cdb9e){return!!_0x5cdb9e&&(_0x5cdb9e['toString']()[_0x42b8('0x5e')](char(0xd))>=0x0||_0x5cdb9e[_0x42b8('0x5f')]()[_0x42b8('0x5e')](char(0xa))>=0x0||_0x5cdb9e[_0x42b8('0x5f')]()[_0x42b8('0x5e')](char(0x2c))>=0x0||_0x5cdb9e[_0x42b8('0x5f')]()[_0x42b8('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x4e9f4e){var _0x49d7d4=char(0x22),_0x40d013='\x5c'+char(0x22),_0x512bb0=_0x4e9f4e[_0x42b8('0x5f')]()[_0x42b8('0x60')](new RegExp(_0x49d7d4,'g'),_0x40d013);return _0x49d7d4+_0x512bb0+_0x49d7d4;}exports[_0x42b8('0x61')]=function(_0xd10699,_0x1f62a2,_0x4c86e6){var _0x2ea580,_0xab5eb5;var _0x507731={'where':{'ProjectId':_0xd10699[_0x42b8('0x54')]['id']}};if(_0xd10699['query'][_0x42b8('0x62')]){_0x507731[_0x42b8('0x39')][_0x42b8('0x63')]=JSON['parse'](_0xd10699['query'][_0x42b8('0x62')]);}return db['JscriptySessionReport'][_0x42b8('0x40')](_0x507731)['then'](handleEntityNotFound(_0x1f62a2,null))[_0x42b8('0x21')](function(_0x55fe5d){if(_0x55fe5d){_0x2ea580=_0x55fe5d;return db[_0x42b8('0x64')][_0x42b8('0x40')]({'where':{'SessionId':{'$in':_[_0x42b8('0x29')](_0x2ea580,'id')},'ProjectId':_0xd10699[_0x42b8('0x54')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x1f62a2,null))[_0x42b8('0x21')](function(_0x5164bb){if(_0x5164bb){_0xab5eb5=_0x5164bb;var _0x4493eb={};for(var _0x3ec30c=0x0,_0x222f95=_0xab5eb5[_0x42b8('0x35')];_0x3ec30c<_0x222f95;_0x3ec30c++){if(!_0x4493eb['hasOwnProperty'](_0xab5eb5[_0x3ec30c][_0x42b8('0x65')])){_0x4493eb[_0xab5eb5[_0x3ec30c]['questionId']]=needsEncapsulation(_0xab5eb5[_0x3ec30c][_0x42b8('0x66')])?encapsulate(_0xab5eb5[_0x3ec30c]['question']):_0xab5eb5[_0x3ec30c]['question'];}}var _0xc00c7c=[],_0xe4fea5={};for(var _0x582488=0x0,_0x12d468=_0x2ea580[_0x42b8('0x35')];_0x582488<_0x12d468;_0x582488++){_0xe4fea5={'ProjectId':_0xd10699[_0x42b8('0x54')]['id'],'SessionId':_0x2ea580[_0x582488]['id'],'StartTime':moment(_0x2ea580[_0x582488][_0x42b8('0x63')])[_0x42b8('0x67')](_0x42b8('0x68'))};for(var _0x3e282c=0x0,_0x2ffe83=_0xab5eb5['length'];_0x3e282c<_0x2ffe83;_0x3e282c++){if(_0xab5eb5[_0x3e282c][_0x42b8('0x69')]==_0x2ea580[_0x582488]['id']&&_0x4493eb[_0x42b8('0x56')](_0xab5eb5[_0x3e282c][_0x42b8('0x65')])){_0xe4fea5[_0x4493eb[_0xab5eb5[_0x3e282c][_0x42b8('0x65')]]]=_0xab5eb5[_0x3e282c][_0x42b8('0x6a')];}}for(var _0x2e1fe1 in _0x4493eb){if(!_0xe4fea5[_0x42b8('0x56')](_0x4493eb[_0x2e1fe1])){_0xe4fea5[_0x4493eb[_0x2e1fe1]]=null;}}_0xc00c7c['push'](_0xe4fea5);}return _0xc00c7c;}})[_0x42b8('0x21')](function(_0x1ffb09){if(!_['isEmpty'](_0x1ffb09)){var _0x7631cb=toCsv(_0x1ffb09);var _0x53f19f=Date[_0x42b8('0x6b')]();fs[_0x42b8('0x6c')](util[_0x42b8('0x67')](_0x42b8('0x6d'),_0xd10699[_0x42b8('0x54')]['id'],_0x53f19f),_0x7631cb);_0x1f62a2['setHeader'](_0x42b8('0x6e'),_0x42b8('0x6f')+util[_0x42b8('0x67')](_0x42b8('0x70'),_0xd10699['params']['id'],_0x53f19f));_0x1f62a2[_0x42b8('0x71')](_0x42b8('0x72'),'text/csv');return _0x1f62a2[_0x42b8('0x73')](util[_0x42b8('0x67')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xd10699[_0x42b8('0x54')]['id'],_0x53f19f));}else{return _0x1f62a2[_0x42b8('0x74')](0xcc);}})['catch'](handleError(_0x1f62a2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5c00b45..cebe3fc 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 _0x3e74=['exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','path','../../config/environment','./jscriptyProject.attributes'];(function(_0x99f838,_0xe376e2){var _0x432cd7=function(_0x2cd5dc){while(--_0x2cd5dc){_0x99f838['push'](_0x99f838['shift']());}};_0x432cd7(++_0xe376e2);}(_0x3e74,0x175));var _0x43e7=function(_0x89faff,_0x27f810){_0x89faff=_0x89faff-0x0;var _0x4311d9=_0x3e74[_0x89faff];return _0x4311d9;};'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 _0xb7a8=['request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment','bluebird'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb7a8,0xec));var _0x8b7a=function(_0x125f89,_0x1bb4d7){_0x125f89=_0x125f89-0x0;var _0x3a2aa7=_0xb7a8[_0x125f89];return _0x3a2aa7;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7ea366a..cc69e0d 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x2df6b7,_0x32d4af){var _0x424be2=function(_0x31656b){while(--_0x31656b){_0x2df6b7['push'](_0x2df6b7['shift']());}};_0x424be2(++_0x32d4af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x5500c7,_0xc64059){var _0x51e918=function(_0x58b444){while(--_0x58b444){_0x5500c7['push'](_0x5500c7['shift']());}};_0x51e918(++_0xc64059);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xcb91[_0x59e821];return _0x5333f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 083788e..34c1829 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 _0x7288=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3a1c3b,_0x302272){var _0x48705d=function(_0x5bcb86){while(--_0x5bcb86){_0x3a1c3b['push'](_0x3a1c3b['shift']());}};_0x48705d(++_0x302272);}(_0x7288,0x1c6));var _0x8728=function(_0x3107f8,_0x2166d2){_0x3107f8=_0x3107f8-0x0;var _0x39a250=_0x7288[_0x3107f8];return _0x39a250;};'use strict';var multer=require(_0x8728('0x0'));var util=require(_0x8728('0x1'));var path=require(_0x8728('0x2'));var timeout=require(_0x8728('0x3'));var express=require(_0x8728('0x4'));var router=express[_0x8728('0x5')]();var fs_extra=require(_0x8728('0x6'));var auth=require(_0x8728('0x7'));var interaction=require(_0x8728('0x8'));var config=require(_0x8728('0x9'));var controller=require(_0x8728('0xa'));router['get']('/',auth[_0x8728('0xb')](),controller[_0x8728('0xc')]);router[_0x8728('0xd')](_0x8728('0xe'),auth[_0x8728('0xb')](),controller['describe']);router[_0x8728('0xd')](_0x8728('0xf'),auth[_0x8728('0xb')](),controller[_0x8728('0x10')]);router[_0x8728('0x11')]('/',auth[_0x8728('0xb')](),controller[_0x8728('0x12')]);router[_0x8728('0x13')]('/:id',auth[_0x8728('0xb')](),controller[_0x8728('0x14')]);router[_0x8728('0x15')]('/:id',auth[_0x8728('0xb')](),controller[_0x8728('0x16')]);module[_0x8728('0x17')]=router; \ No newline at end of file +var _0x21cf=['delete','/:id','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x21cf,0x10b));var _0xf21c=function(_0x23e72b,_0x8d9c3){_0x23e72b=_0x23e72b-0x0;var _0x3aa720=_0x21cf[_0x23e72b];return _0x3aa720;};'use strict';var multer=require(_0xf21c('0x0'));var util=require(_0xf21c('0x1'));var path=require(_0xf21c('0x2'));var timeout=require(_0xf21c('0x3'));var express=require('express');var router=express[_0xf21c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf21c('0x5'));var interaction=require(_0xf21c('0x6'));var config=require(_0xf21c('0x7'));var controller=require(_0xf21c('0x8'));router['get']('/',auth[_0xf21c('0x9')](),controller[_0xf21c('0xa')]);router[_0xf21c('0xb')](_0xf21c('0xc'),auth['isAuthenticated'](),controller[_0xf21c('0xd')]);router[_0xf21c('0xb')]('/:id',auth[_0xf21c('0x9')](),controller[_0xf21c('0xe')]);router[_0xf21c('0xf')]('/',auth[_0xf21c('0x9')](),controller[_0xf21c('0x10')]);router[_0xf21c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf21c('0x12')]);router[_0xf21c('0x13')](_0xf21c('0x14'),auth[_0xf21c('0x9')](),controller['destroy']);module[_0xf21c('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9e8a370..a0e08ce 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(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x579651,_0x7226ec){_0x579651=_0x579651-0x0;var _0x3e8f33=_0x7a54[_0x579651];return _0x3e8f33;};'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(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0xa38f7,_0x1fabf7){_0xa38f7=_0xa38f7-0x0;var _0x2c53da=_0x7a54[_0xa38f7];return _0x2c53da;};'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 e2a0ca0..2e9b0ed 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 _0x73ae=['offset','undefined','count','limit','set','Content-Range','json','apply','update','destroy','error','stack','name','send','index','map','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','then','include','findAll','catch','show','JscriptyQuestionReport','rawAttributes','length','includeAll','body','find','params','describe','rimraf','request-promise','moment','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end'];(function(_0x5ae423,_0x3b4052){var _0x17b4ae=function(_0x47d5c4){while(--_0x47d5c4){_0x5ae423['push'](_0x5ae423['shift']());}};_0x17b4ae(++_0x3b4052);}(_0x73ae,0x135));var _0xe73a=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x73ae[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe73a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe73a('0x1'));var moment=require(_0xe73a('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe73a('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xe73a('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe73a('0x5'));var _=require(_0xe73a('0x6'));var squel=require(_0xe73a('0x7'));var crypto=require(_0xe73a('0x8'));var jsforce=require(_0xe73a('0x9'));var deskjs=require(_0xe73a('0xa'));var toCsv=require(_0xe73a('0x4'));var querystring=require(_0xe73a('0xb'));var Papa=require(_0xe73a('0xc'));var Redis=require('ioredis');var authService=require(_0xe73a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe73a('0xe'));var hardwareService=require(_0xe73a('0xf'));var logger=require(_0xe73a('0x10'))('api');var utils=require(_0xe73a('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x835f5a,_0x551a0a){_0x551a0a=_0x551a0a||0xcc;return function(_0x3808d6){if(_0x3808d6){return _0x835f5a[_0xe73a('0x12')](_0x551a0a);}return _0x835f5a[_0xe73a('0x13')](_0x551a0a)[_0xe73a('0x14')]();};}function respondWithResult(_0x1aeb32,_0x235f6f){_0x235f6f=_0x235f6f||0xc8;return function(_0xd1b88c){if(_0xd1b88c){return _0x1aeb32['status'](_0x235f6f)['json'](_0xd1b88c);}};}function respondWithFilteredResult(_0x467435,_0x23ea40){return function(_0x42229c){if(_0x42229c){var _0x8e2b02=typeof _0x23ea40[_0xe73a('0x15')]==='undefined'&&typeof _0x23ea40['limit']===_0xe73a('0x16');var _0x1071b3=_0x42229c['count'];var _0x4389ba=_0x8e2b02?0x0:_0x23ea40[_0xe73a('0x15')];var _0x2f9676=_0x8e2b02?_0x42229c[_0xe73a('0x17')]:_0x23ea40[_0xe73a('0x15')]+_0x23ea40[_0xe73a('0x18')];var _0x25ec1f;if(_0x2f9676>=_0x1071b3){_0x2f9676=_0x1071b3;_0x25ec1f=0xc8;}else{_0x25ec1f=0xce;}_0x467435['status'](_0x25ec1f);return _0x467435[_0xe73a('0x19')](_0xe73a('0x1a'),_0x4389ba+'-'+_0x2f9676+'/'+_0x1071b3)[_0xe73a('0x1b')](_0x42229c);}return null;};}function patchUpdates(_0x273aed){return function(_0x1dd643){try{jsonpatch[_0xe73a('0x1c')](_0x1dd643,_0x273aed,!![]);}catch(_0x333313){return BPromise['reject'](_0x333313);}return _0x1dd643['save']();};}function saveUpdates(_0x118423,_0x56ee1e){return function(_0x2754da){if(_0x2754da){return _0x2754da[_0xe73a('0x1d')](_0x118423)['then'](function(_0x82b940){return _0x82b940;});}return null;};}function removeEntity(_0x5c26da,_0x1e5d24){return function(_0x5d91de){if(_0x5d91de){return _0x5d91de[_0xe73a('0x1e')]()['then'](function(){_0x5c26da[_0xe73a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x579ec8,_0x3c3cea){return function(_0xbf05b9){if(!_0xbf05b9){_0x579ec8['sendStatus'](0x194);}return _0xbf05b9;};}function handleError(_0x14deb6,_0x19e28b){_0x19e28b=_0x19e28b||0x1f4;return function(_0x59cd1e){logger[_0xe73a('0x1f')](_0x59cd1e[_0xe73a('0x20')]);if(_0x59cd1e[_0xe73a('0x21')]){delete _0x59cd1e[_0xe73a('0x21')];}_0x14deb6[_0xe73a('0x13')](_0x19e28b)[_0xe73a('0x22')](_0x59cd1e);};}exports[_0xe73a('0x23')]=function(_0xfe4a3f,_0xf1dd6c){var _0x9886d4={},_0x2c63d5={},_0x18a7aa={'count':0x0,'rows':[]};var _0x92d101=_[_0xe73a('0x24')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x3abc97){return{'name':_0x3abc97['fieldName'],'type':_0x3abc97[_0xe73a('0x25')]['key']};});_0x2c63d5['model']=_[_0xe73a('0x24')](_0x92d101,_0xe73a('0x21'));_0x2c63d5[_0xe73a('0x26')]=_[_0xe73a('0x27')](_0xfe4a3f['query']);_0x2c63d5[_0xe73a('0x28')]=_[_0xe73a('0x29')](_0x2c63d5[_0xe73a('0x2a')],_0x2c63d5[_0xe73a('0x26')]);_0x9886d4[_0xe73a('0x2b')]=_['intersection'](_0x2c63d5[_0xe73a('0x2a')],qs['fields'](_0xfe4a3f[_0xe73a('0x26')][_0xe73a('0x2c')]));_0x9886d4['attributes']=_0x9886d4[_0xe73a('0x2b')]['length']?_0x9886d4[_0xe73a('0x2b')]:_0x2c63d5[_0xe73a('0x2a')];if(!_0xfe4a3f['query'][_0xe73a('0x2d')]('nolimit')){_0x9886d4[_0xe73a('0x18')]=qs[_0xe73a('0x18')](_0xfe4a3f['query']['limit']);_0x9886d4[_0xe73a('0x15')]=qs[_0xe73a('0x15')](_0xfe4a3f[_0xe73a('0x26')][_0xe73a('0x15')]);}_0x9886d4[_0xe73a('0x2e')]=qs['sort'](_0xfe4a3f[_0xe73a('0x26')]['sort']);_0x9886d4[_0xe73a('0x2f')]=qs[_0xe73a('0x28')](_[_0xe73a('0x30')](_0xfe4a3f[_0xe73a('0x26')],_0x2c63d5['filters']),_0x92d101);if(_0xfe4a3f['query']['filter']){_0x9886d4[_0xe73a('0x2f')]=_[_0xe73a('0x31')](_0x9886d4['where'],{'$or':_['map'](_0x92d101,function(_0xbf3550){if(_0xbf3550[_0xe73a('0x25')]!==_0xe73a('0x32')){var _0x19b9e2={};_0x19b9e2[_0xbf3550['name']]={'$like':'%'+_0xfe4a3f[_0xe73a('0x26')][_0xe73a('0x33')]+'%'};return _0x19b9e2;}})});}_0x9886d4=_['merge']({},_0x9886d4,_0xfe4a3f[_0xe73a('0x34')]);var _0x5d023f={'where':_0x9886d4[_0xe73a('0x2f')]};return db['JscriptyQuestionReport']['count'](_0x5d023f)[_0xe73a('0x35')](function(_0x5cd694){_0x18a7aa[_0xe73a('0x17')]=_0x5cd694;if(_0xfe4a3f[_0xe73a('0x26')]['includeAll']){_0x9886d4[_0xe73a('0x36')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xe73a('0x37')](_0x9886d4);})['then'](function(_0x29ecd8){_0x18a7aa['rows']=_0x29ecd8;return _0x18a7aa;})[_0xe73a('0x35')](respondWithFilteredResult(_0xf1dd6c,_0x9886d4))[_0xe73a('0x38')](handleError(_0xf1dd6c,null));};exports[_0xe73a('0x39')]=function(_0x45e93a,_0x2af2e4){var _0x4cc2bc={'raw':!![],'where':{'id':_0x45e93a['params']['id']}},_0x449d6d={};_0x449d6d[_0xe73a('0x2a')]=_[_0xe73a('0x27')](db[_0xe73a('0x3a')][_0xe73a('0x3b')]);_0x449d6d[_0xe73a('0x26')]=_['keys'](_0x45e93a[_0xe73a('0x26')]);_0x449d6d[_0xe73a('0x28')]=_['intersection'](_0x449d6d['model'],_0x449d6d[_0xe73a('0x26')]);_0x4cc2bc[_0xe73a('0x2b')]=_[_0xe73a('0x29')](_0x449d6d[_0xe73a('0x2a')],qs[_0xe73a('0x2c')](_0x45e93a[_0xe73a('0x26')][_0xe73a('0x2c')]));_0x4cc2bc[_0xe73a('0x2b')]=_0x4cc2bc[_0xe73a('0x2b')][_0xe73a('0x3c')]?_0x4cc2bc[_0xe73a('0x2b')]:_0x449d6d[_0xe73a('0x2a')];if(_0x45e93a[_0xe73a('0x26')][_0xe73a('0x3d')]){_0x4cc2bc[_0xe73a('0x36')]=[{'all':!![]}];}_0x4cc2bc=_[_0xe73a('0x31')]({},_0x4cc2bc,_0x45e93a[_0xe73a('0x34')]);return db['JscriptyQuestionReport']['find'](_0x4cc2bc)['then'](handleEntityNotFound(_0x2af2e4,null))[_0xe73a('0x35')](respondWithResult(_0x2af2e4,null))[_0xe73a('0x38')](handleError(_0x2af2e4,null));};exports['create']=function(_0xab31e8,_0x437311){return db['JscriptyQuestionReport']['create'](_0xab31e8[_0xe73a('0x3e')],{})['then'](respondWithResult(_0x437311,0xc9))['catch'](handleError(_0x437311,null));};exports[_0xe73a('0x1d')]=function(_0x5bb1ba,_0x561811){if(_0x5bb1ba[_0xe73a('0x3e')]['id']){delete _0x5bb1ba[_0xe73a('0x3e')]['id'];}return db[_0xe73a('0x3a')][_0xe73a('0x3f')]({'where':{'id':_0x5bb1ba[_0xe73a('0x40')]['id']}})[_0xe73a('0x35')](handleEntityNotFound(_0x561811,null))[_0xe73a('0x35')](saveUpdates(_0x5bb1ba[_0xe73a('0x3e')],null))['then'](respondWithResult(_0x561811,null))[_0xe73a('0x38')](handleError(_0x561811,null));};exports[_0xe73a('0x1e')]=function(_0x1fab3d,_0x437dd1){return db[_0xe73a('0x3a')][_0xe73a('0x3f')]({'where':{'id':_0x1fab3d['params']['id']}})[_0xe73a('0x35')](handleEntityNotFound(_0x437dd1,null))[_0xe73a('0x35')](removeEntity(_0x437dd1,null))[_0xe73a('0x38')](handleError(_0x437dd1,null));};exports[_0xe73a('0x41')]=function(_0x3ea0fb,_0x3dbfe3){return db['JscriptyQuestionReport'][_0xe73a('0x41')]()['then'](respondWithResult(_0x3dbfe3,null))['catch'](handleError(_0x3dbfe3,null));}; \ No newline at end of file +var _0x4fc0=['undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','status','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','json','limit'];(function(_0x4617a6,_0x587d07){var _0xc16f5d=function(_0x21a643){while(--_0x21a643){_0x4617a6['push'](_0x4617a6['shift']());}};_0xc16f5d(++_0x587d07);}(_0x4fc0,0x120));var _0x04fc=function(_0x4005f8,_0x1e5fb3){_0x4005f8=_0x4005f8-0x0;var _0x37190e=_0x4fc0[_0x4005f8];return _0x37190e;};'use strict';var emlformat=require(_0x04fc('0x0'));var rimraf=require(_0x04fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x04fc('0x2'));var moment=require(_0x04fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x04fc('0x4'));var util=require(_0x04fc('0x5'));var path=require(_0x04fc('0x6'));var sox=require(_0x04fc('0x7'));var csv=require(_0x04fc('0x8'));var ejs=require(_0x04fc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04fc('0xa'));var squel=require(_0x04fc('0xb'));var crypto=require(_0x04fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x04fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x04fc('0xe'));var Papa=require(_0x04fc('0xf'));var Redis=require(_0x04fc('0x10'));var authService=require(_0x04fc('0x11'));var qs=require(_0x04fc('0x12'));var as=require(_0x04fc('0x13'));var hardwareService=require(_0x04fc('0x14'));var logger=require(_0x04fc('0x15'))(_0x04fc('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x04fc('0x17'));var db=require(_0x04fc('0x18'))['db'];function respondWithStatusCode(_0x9dd4be,_0x1db9ba){_0x1db9ba=_0x1db9ba||0xcc;return function(_0x114e67){if(_0x114e67){return _0x9dd4be['sendStatus'](_0x1db9ba);}return _0x9dd4be['status'](_0x1db9ba)[_0x04fc('0x19')]();};}function respondWithResult(_0x16e6ee,_0x12b0f8){_0x12b0f8=_0x12b0f8||0xc8;return function(_0x2bf0fd){if(_0x2bf0fd){return _0x16e6ee['status'](_0x12b0f8)[_0x04fc('0x1a')](_0x2bf0fd);}};}function respondWithFilteredResult(_0xcb15f0,_0x3c2713){return function(_0x106e4c){if(_0x106e4c){var _0xe40c3d=typeof _0x3c2713['offset']==='undefined'&&typeof _0x3c2713[_0x04fc('0x1b')]===_0x04fc('0x1c');var _0x255b94=_0x106e4c[_0x04fc('0x1d')];var _0x55576f=_0xe40c3d?0x0:_0x3c2713['offset'];var _0x1a7aa8=_0xe40c3d?_0x106e4c[_0x04fc('0x1d')]:_0x3c2713[_0x04fc('0x1e')]+_0x3c2713[_0x04fc('0x1b')];var _0x2c7c6e;if(_0x1a7aa8>=_0x255b94){_0x1a7aa8=_0x255b94;_0x2c7c6e=0xc8;}else{_0x2c7c6e=0xce;}_0xcb15f0['status'](_0x2c7c6e);return _0xcb15f0[_0x04fc('0x1f')](_0x04fc('0x20'),_0x55576f+'-'+_0x1a7aa8+'/'+_0x255b94)[_0x04fc('0x1a')](_0x106e4c);}return null;};}function patchUpdates(_0x116702){return function(_0x3182e3){try{jsonpatch[_0x04fc('0x21')](_0x3182e3,_0x116702,!![]);}catch(_0x463a0b){return BPromise[_0x04fc('0x22')](_0x463a0b);}return _0x3182e3[_0x04fc('0x23')]();};}function saveUpdates(_0x371697,_0x295749){return function(_0x1d1275){if(_0x1d1275){return _0x1d1275['update'](_0x371697)[_0x04fc('0x24')](function(_0x579150){return _0x579150;});}return null;};}function removeEntity(_0x85a4df,_0x1946ae){return function(_0x80a647){if(_0x80a647){return _0x80a647[_0x04fc('0x25')]()[_0x04fc('0x24')](function(){_0x85a4df[_0x04fc('0x26')](0xcc)[_0x04fc('0x19')]();});}};}function handleEntityNotFound(_0x6cbed2,_0x1a0473){return function(_0x4e2dfb){if(!_0x4e2dfb){_0x6cbed2[_0x04fc('0x27')](0x194);}return _0x4e2dfb;};}function handleError(_0x3929ed,_0x17b8ed){_0x17b8ed=_0x17b8ed||0x1f4;return function(_0x592c34){logger['error'](_0x592c34[_0x04fc('0x28')]);if(_0x592c34[_0x04fc('0x29')]){delete _0x592c34['name'];}_0x3929ed[_0x04fc('0x26')](_0x17b8ed)[_0x04fc('0x2a')](_0x592c34);};}exports[_0x04fc('0x2b')]=function(_0x3ef80b,_0x5a58cb){var _0x45cf34={},_0x46ff8f={},_0x44ceec={'count':0x0,'rows':[]};var _0x28f9fa=_[_0x04fc('0x2c')](db[_0x04fc('0x2d')][_0x04fc('0x2e')],function(_0x44920f){return{'name':_0x44920f[_0x04fc('0x2f')],'type':_0x44920f[_0x04fc('0x30')][_0x04fc('0x31')]};});_0x46ff8f[_0x04fc('0x32')]=_['map'](_0x28f9fa,_0x04fc('0x29'));_0x46ff8f[_0x04fc('0x33')]=_[_0x04fc('0x34')](_0x3ef80b[_0x04fc('0x33')]);_0x46ff8f[_0x04fc('0x35')]=_[_0x04fc('0x36')](_0x46ff8f[_0x04fc('0x32')],_0x46ff8f[_0x04fc('0x33')]);_0x45cf34[_0x04fc('0x37')]=_[_0x04fc('0x36')](_0x46ff8f['model'],qs[_0x04fc('0x38')](_0x3ef80b[_0x04fc('0x33')][_0x04fc('0x38')]));_0x45cf34[_0x04fc('0x37')]=_0x45cf34[_0x04fc('0x37')][_0x04fc('0x39')]?_0x45cf34[_0x04fc('0x37')]:_0x46ff8f[_0x04fc('0x32')];if(!_0x3ef80b['query'][_0x04fc('0x3a')]('nolimit')){_0x45cf34[_0x04fc('0x1b')]=qs[_0x04fc('0x1b')](_0x3ef80b[_0x04fc('0x33')][_0x04fc('0x1b')]);_0x45cf34['offset']=qs[_0x04fc('0x1e')](_0x3ef80b[_0x04fc('0x33')]['offset']);}_0x45cf34[_0x04fc('0x3b')]=qs[_0x04fc('0x3c')](_0x3ef80b['query'][_0x04fc('0x3c')]);_0x45cf34['where']=qs[_0x04fc('0x35')](_[_0x04fc('0x3d')](_0x3ef80b[_0x04fc('0x33')],_0x46ff8f['filters']),_0x28f9fa);if(_0x3ef80b[_0x04fc('0x33')][_0x04fc('0x3e')]){_0x45cf34[_0x04fc('0x3f')]=_[_0x04fc('0x40')](_0x45cf34[_0x04fc('0x3f')],{'$or':_[_0x04fc('0x2c')](_0x28f9fa,function(_0x53e76f){if(_0x53e76f['type']!==_0x04fc('0x41')){var _0xb766c3={};_0xb766c3[_0x53e76f[_0x04fc('0x29')]]={'$like':'%'+_0x3ef80b['query'][_0x04fc('0x3e')]+'%'};return _0xb766c3;}})});}_0x45cf34=_[_0x04fc('0x40')]({},_0x45cf34,_0x3ef80b[_0x04fc('0x42')]);var _0x237abc={'where':_0x45cf34['where']};return db[_0x04fc('0x2d')][_0x04fc('0x1d')](_0x237abc)['then'](function(_0x4a0a6c){_0x44ceec[_0x04fc('0x1d')]=_0x4a0a6c;if(_0x3ef80b[_0x04fc('0x33')][_0x04fc('0x43')]){_0x45cf34['include']=[{'all':!![]}];}return db[_0x04fc('0x2d')][_0x04fc('0x44')](_0x45cf34);})[_0x04fc('0x24')](function(_0x44e3dc){_0x44ceec[_0x04fc('0x45')]=_0x44e3dc;return _0x44ceec;})['then'](respondWithFilteredResult(_0x5a58cb,_0x45cf34))[_0x04fc('0x46')](handleError(_0x5a58cb,null));};exports[_0x04fc('0x47')]=function(_0xadca82,_0x5a6ca0){var _0x45e4df={'raw':!![],'where':{'id':_0xadca82['params']['id']}},_0x908b23={};_0x908b23[_0x04fc('0x32')]=_[_0x04fc('0x34')](db[_0x04fc('0x2d')][_0x04fc('0x2e')]);_0x908b23[_0x04fc('0x33')]=_[_0x04fc('0x34')](_0xadca82[_0x04fc('0x33')]);_0x908b23[_0x04fc('0x35')]=_[_0x04fc('0x36')](_0x908b23['model'],_0x908b23['query']);_0x45e4df[_0x04fc('0x37')]=_[_0x04fc('0x36')](_0x908b23['model'],qs[_0x04fc('0x38')](_0xadca82[_0x04fc('0x33')][_0x04fc('0x38')]));_0x45e4df[_0x04fc('0x37')]=_0x45e4df[_0x04fc('0x37')][_0x04fc('0x39')]?_0x45e4df[_0x04fc('0x37')]:_0x908b23[_0x04fc('0x32')];if(_0xadca82['query'][_0x04fc('0x43')]){_0x45e4df[_0x04fc('0x48')]=[{'all':!![]}];}_0x45e4df=_[_0x04fc('0x40')]({},_0x45e4df,_0xadca82['options']);return db[_0x04fc('0x2d')][_0x04fc('0x49')](_0x45e4df)[_0x04fc('0x24')](handleEntityNotFound(_0x5a6ca0,null))[_0x04fc('0x24')](respondWithResult(_0x5a6ca0,null))[_0x04fc('0x46')](handleError(_0x5a6ca0,null));};exports[_0x04fc('0x4a')]=function(_0x245343,_0x5454b2){return db[_0x04fc('0x2d')][_0x04fc('0x4a')](_0x245343[_0x04fc('0x4b')],{})[_0x04fc('0x24')](respondWithResult(_0x5454b2,0xc9))[_0x04fc('0x46')](handleError(_0x5454b2,null));};exports[_0x04fc('0x4c')]=function(_0x2b35e8,_0x2b2a3e){if(_0x2b35e8[_0x04fc('0x4b')]['id']){delete _0x2b35e8[_0x04fc('0x4b')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x2b35e8['params']['id']}})['then'](handleEntityNotFound(_0x2b2a3e,null))[_0x04fc('0x24')](saveUpdates(_0x2b35e8[_0x04fc('0x4b')],null))[_0x04fc('0x24')](respondWithResult(_0x2b2a3e,null))[_0x04fc('0x46')](handleError(_0x2b2a3e,null));};exports[_0x04fc('0x25')]=function(_0x404422,_0x57155a){return db[_0x04fc('0x2d')][_0x04fc('0x49')]({'where':{'id':_0x404422[_0x04fc('0x4d')]['id']}})[_0x04fc('0x24')](handleEntityNotFound(_0x57155a,null))[_0x04fc('0x24')](removeEntity(_0x57155a,null))[_0x04fc('0x46')](handleError(_0x57155a,null));};exports[_0x04fc('0x4e')]=function(_0x584fbc,_0xa7e3b){return db['JscriptyQuestionReport']['describe']()[_0x04fc('0x24')](respondWithResult(_0xa7e3b,null))[_0x04fc('0x46')](handleError(_0xa7e3b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4365e43..83a6376 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 _0x05a4=['../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','request-promise'];(function(_0x693235,_0x53a413){var _0x53ae8a=function(_0x21bce0){while(--_0x21bce0){_0x693235['push'](_0x693235['shift']());}};_0x53ae8a(++_0x53a413);}(_0x05a4,0xe6));var _0x405a=function(_0x675f47,_0x3b2a1c){_0x675f47=_0x675f47-0x0;var _0x708695=_0x05a4[_0x675f47];return _0x708695;};'use strict';var _=require(_0x405a('0x0'));var util=require('util');var logger=require(_0x405a('0x1'))(_0x405a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x405a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x405a('0x4'));var attributes=require(_0x405a('0x5'));module['exports']=function(_0x3e63cd,_0x446547){return _0x3e63cd[_0x405a('0x6')](_0x405a('0x7'),attributes,{'tableName':_0x405a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59c4=['path','rimraf','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','request-promise'];(function(_0x43a054,_0x22109c){var _0x39b75f=function(_0x36fa3b){while(--_0x36fa3b){_0x43a054['push'](_0x43a054['shift']());}};_0x39b75f(++_0x22109c);}(_0x59c4,0x1a8));var _0x459c=function(_0x345de8,_0x45312c){_0x345de8=_0x345de8-0x0;var _0x27703f=_0x59c4[_0x345de8];return _0x27703f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x459c('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x459c('0x1'));var fs=require('fs');var path=require(_0x459c('0x2'));var rimraf=require(_0x459c('0x3'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x221380,_0x3c4a53){return _0x221380['define'](_0x459c('0x4'),attributes,{'tableName':_0x459c('0x5'),'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 95b8288..badb8b0 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 _0xfc50=['request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x377cce,_0x3b4f48){var _0x256bc9=function(_0x45d5ce){while(--_0x45d5ce){_0x377cce['push'](_0x377cce['shift']());}};_0x256bc9(++_0x3b4f48);}(_0xfc50,0x193));var _0x0fc5=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xfc50[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0fc5('0x0'));var util=require(_0x0fc5('0x1'));var moment=require('moment');var BPromise=require(_0x0fc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fc5('0x3'));var db=require(_0x0fc5('0x4'))['db'];var utils=require(_0x0fc5('0x5'));var logger=require('../../config/logger')(_0x0fc5('0x6'));var config=require(_0x0fc5('0x7'));var jayson=require(_0x0fc5('0x8'));var client=jayson[_0x0fc5('0x9')][_0x0fc5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f414f,_0x5e19d4,_0x51cd84){return new BPromise(function(_0x4eafaa,_0x12b8b6){return client[_0x0fc5('0xb')](_0x7f414f,_0x51cd84)[_0x0fc5('0xc')](function(_0x5a9210){logger[_0x0fc5('0xd')](_0x0fc5('0xe'),_0x5e19d4,_0x0fc5('0xf'));logger[_0x0fc5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x5e19d4,_0x0fc5('0xf'),JSON[_0x0fc5('0x11')](_0x5a9210));if(_0x5a9210[_0x0fc5('0x12')]){if(_0x5a9210['error']['code']===0x1f4){logger[_0x0fc5('0x12')](_0x0fc5('0xe'),_0x5e19d4,_0x5a9210[_0x0fc5('0x12')][_0x0fc5('0x13')]);return _0x12b8b6(_0x5a9210[_0x0fc5('0x12')]['message']);}logger[_0x0fc5('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5e19d4,_0x5a9210[_0x0fc5('0x12')]['message']);return _0x4eafaa(_0x5a9210[_0x0fc5('0x12')]['message']);}else{logger['info'](_0x0fc5('0xe'),_0x5e19d4,_0x0fc5('0xf'));_0x4eafaa(_0x5a9210[_0x0fc5('0x14')][_0x0fc5('0x13')]);}})[_0x0fc5('0x15')](function(_0x564ec1){logger[_0x0fc5('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5e19d4,_0x564ec1);_0x12b8b6(_0x564ec1);});});} \ No newline at end of file +var _0x6c1d=['rpc','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x358b45,_0x237da3){var _0x18dc83=function(_0x365356){while(--_0x365356){_0x358b45['push'](_0x358b45['shift']());}};_0x18dc83(++_0x237da3);}(_0x6c1d,0xdf));var _0xd6c1=function(_0x2d4392,_0x52e054){_0x2d4392=_0x2d4392-0x0;var _0x322daf=_0x6c1d[_0x2d4392];return _0x322daf;};'use strict';var _=require(_0xd6c1('0x0'));var util=require('util');var moment=require(_0xd6c1('0x1'));var BPromise=require(_0xd6c1('0x2'));var rs=require(_0xd6c1('0x3'));var fs=require('fs');var Redis=require(_0xd6c1('0x4'));var db=require(_0xd6c1('0x5'))['db'];var utils=require(_0xd6c1('0x6'));var logger=require('../../config/logger')(_0xd6c1('0x7'));var config=require('../../config/environment');var jayson=require(_0xd6c1('0x8'));var client=jayson[_0xd6c1('0x9')][_0xd6c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4131cf,_0x247150,_0x437e82){return new BPromise(function(_0x5a9a12,_0x2d5f1c){return client[_0xd6c1('0xb')](_0x4131cf,_0x437e82)[_0xd6c1('0xc')](function(_0xc88bca){logger[_0xd6c1('0xd')](_0xd6c1('0xe'),_0x247150,'request\x20sent');logger[_0xd6c1('0xf')](_0xd6c1('0x10'),_0x247150,_0xd6c1('0x11'),JSON[_0xd6c1('0x12')](_0xc88bca));if(_0xc88bca[_0xd6c1('0x13')]){if(_0xc88bca[_0xd6c1('0x13')][_0xd6c1('0x14')]===0x1f4){logger[_0xd6c1('0x13')](_0xd6c1('0xe'),_0x247150,_0xc88bca[_0xd6c1('0x13')][_0xd6c1('0x15')]);return _0x2d5f1c(_0xc88bca[_0xd6c1('0x13')][_0xd6c1('0x15')]);}logger[_0xd6c1('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x247150,_0xc88bca[_0xd6c1('0x13')][_0xd6c1('0x15')]);return _0x5a9a12(_0xc88bca[_0xd6c1('0x13')]['message']);}else{logger[_0xd6c1('0xd')](_0xd6c1('0xe'),_0x247150,_0xd6c1('0x11'));_0x5a9a12(_0xc88bca[_0xd6c1('0x16')][_0xd6c1('0x15')]);}})['catch'](function(_0x39663c){logger[_0xd6c1('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x247150,_0x39663c);_0x2d5f1c(_0x39663c);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9455b4f..8a51124 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 _0xf364=['put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create'];(function(_0x13e2e3,_0x21d65c){var _0x34078f=function(_0xae1d71){while(--_0xae1d71){_0x13e2e3['push'](_0x13e2e3['shift']());}};_0x34078f(++_0x21d65c);}(_0xf364,0x11b));var _0x4f36=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xf364[_0x411add];return _0x238242;};'use strict';var multer=require(_0x4f36('0x0'));var util=require(_0x4f36('0x1'));var path=require(_0x4f36('0x2'));var timeout=require(_0x4f36('0x3'));var express=require(_0x4f36('0x4'));var router=express['Router']();var fs_extra=require(_0x4f36('0x5'));var auth=require(_0x4f36('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x4f36('0x7')]('/',auth[_0x4f36('0x8')](),controller[_0x4f36('0x9')]);router['get'](_0x4f36('0xa'),auth[_0x4f36('0x8')](),controller['describe']);router['get'](_0x4f36('0xb'),auth[_0x4f36('0x8')](),controller[_0x4f36('0xc')]);router['get'](_0x4f36('0xd'),auth[_0x4f36('0x8')](),controller[_0x4f36('0xe')]);router[_0x4f36('0xf')]('/',auth[_0x4f36('0x8')](),controller[_0x4f36('0x10')]);router[_0x4f36('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x4f36('0xb'),auth['isAuthenticated'](),controller[_0x4f36('0x12')]);module[_0x4f36('0x13')]=router; \ No newline at end of file +var _0x40fd=['getQuestions','post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x40fd,0x1bf));var _0xd40f=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0x40fd[_0x1945a5];return _0x5817a5;};'use strict';var multer=require(_0xd40f('0x0'));var util=require(_0xd40f('0x1'));var path=require(_0xd40f('0x2'));var timeout=require('connect-timeout');var express=require(_0xd40f('0x3'));var router=express[_0xd40f('0x4')]();var fs_extra=require(_0xd40f('0x5'));var auth=require(_0xd40f('0x6'));var interaction=require(_0xd40f('0x7'));var config=require(_0xd40f('0x8'));var controller=require('./jscriptySessionReport.controller');router[_0xd40f('0x9')]('/',auth[_0xd40f('0xa')](),controller[_0xd40f('0xb')]);router['get'](_0xd40f('0xc'),auth[_0xd40f('0xa')](),controller[_0xd40f('0xd')]);router[_0xd40f('0x9')](_0xd40f('0xe'),auth[_0xd40f('0xa')](),controller['show']);router[_0xd40f('0x9')]('/:id/questions',auth[_0xd40f('0xa')](),controller[_0xd40f('0xf')]);router[_0xd40f('0x10')]('/',auth[_0xd40f('0xa')](),controller[_0xd40f('0x11')]);router[_0xd40f('0x12')](_0xd40f('0xe'),auth[_0xd40f('0xa')](),controller['update']);router[_0xd40f('0x13')](_0xd40f('0xe'),auth[_0xd40f('0xa')](),controller[_0xd40f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 802785a..28844bd 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 _0x0f32=['STRING','moment','exports','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x0f32,0x73));var _0x20f3=function(_0x28cc13,_0x4be0c5){_0x28cc13=_0x28cc13-0x0;var _0x49b130=_0x0f32[_0x28cc13];return _0x49b130;};'use strict';var moment=require(_0x20f3('0x0'));var Sequelize=require('sequelize');module[_0x20f3('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5af270){this['setDataValue'](_0x20f3('0x2'),_0x5af270);this['setDataValue'](_0x20f3('0x3'),moment()['format'](_0x20f3('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x20f3('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x20f3('0x5')]},'uniqueid':{'type':Sequelize[_0x20f3('0x5')]},'calleridname':{'type':Sequelize[_0x20f3('0x5')]},'calleridnum':{'type':Sequelize[_0x20f3('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xabf9=['moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0xe19b83,_0x2ca159){var _0x4b6b05=function(_0x3ebf76){while(--_0x3ebf76){_0xe19b83['push'](_0xe19b83['shift']());}};_0x4b6b05(++_0x2ca159);}(_0xabf9,0x1e4));var _0x9abf=function(_0x12c9ec,_0x603b97){_0x12c9ec=_0x12c9ec-0x0;var _0x152942=_0xabf9[_0x12c9ec];return _0x152942;};'use strict';var moment=require(_0x9abf('0x0'));var Sequelize=require(_0x9abf('0x1'));module[_0x9abf('0x2')]={'starttime':{'type':Sequelize[_0x9abf('0x3')],'set':function(_0x28cf6a){this[_0x9abf('0x4')](_0x9abf('0x5'),_0x28cf6a);this[_0x9abf('0x4')](_0x9abf('0x6'),moment()[_0x9abf('0x7')](_0x9abf('0x8')));}},'endtime':{'type':Sequelize[_0x9abf('0x3')]},'membername':{'type':Sequelize[_0x9abf('0x9')]},'projectname':{'type':Sequelize[_0x9abf('0x9')]},'queue':{'type':Sequelize[_0x9abf('0x9')]},'uniqueid':{'type':Sequelize[_0x9abf('0x9')]},'calleridname':{'type':Sequelize[_0x9abf('0x9')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x9abf('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d60fcbe..f3b30ba 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 _0x62c8=['where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','fields','length','include','find','create','body','catch','describe','findOne','JscriptyQuestionReport','order','SessionId','rows','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','index','map','JscriptySessionReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','hasOwnProperty','nolimit','sort'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x62c8,0x1a8));var _0x862c=function(_0x2b5c3e,_0x3994f6){_0x2b5c3e=_0x2b5c3e-0x0;var _0x561bed=_0x62c8[_0x2b5c3e];return _0x561bed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x862c('0x0'));var zipdir=require(_0x862c('0x1'));var jsonpatch=require(_0x862c('0x2'));var rp=require('request-promise');var moment=require(_0x862c('0x3'));var BPromise=require(_0x862c('0x4'));var Mustache=require(_0x862c('0x5'));var util=require(_0x862c('0x6'));var path=require(_0x862c('0x7'));var sox=require(_0x862c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x862c('0x9'));var _=require(_0x862c('0xa'));var squel=require('squel');var crypto=require(_0x862c('0xb'));var jsforce=require(_0x862c('0xc'));var deskjs=require(_0x862c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x862c('0xe'));var authService=require(_0x862c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x862c('0x10'));var hardwareService=require(_0x862c('0x11'));var logger=require(_0x862c('0x12'))(_0x862c('0x13'));var utils=require(_0x862c('0x14'));var config=require(_0x862c('0x15'));var licenseUtil=require(_0x862c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xadeee0,_0x58c8a4){_0x58c8a4=_0x58c8a4||0xcc;return function(_0x31dc7e){if(_0x31dc7e){return _0xadeee0[_0x862c('0x17')](_0x58c8a4);}return _0xadeee0['status'](_0x58c8a4)[_0x862c('0x18')]();};}function respondWithResult(_0x3a5be7,_0x397ba5){_0x397ba5=_0x397ba5||0xc8;return function(_0x391ee1){if(_0x391ee1){return _0x3a5be7['status'](_0x397ba5)[_0x862c('0x19')](_0x391ee1);}};}function respondWithFilteredResult(_0x2f75e0,_0x5de703){return function(_0x115b46){if(_0x115b46){var _0x30beb9=typeof _0x5de703[_0x862c('0x1a')]===_0x862c('0x1b')&&typeof _0x5de703[_0x862c('0x1c')]===_0x862c('0x1b');var _0x5e91b8=_0x115b46[_0x862c('0x1d')];var _0x486403=_0x30beb9?0x0:_0x5de703[_0x862c('0x1a')];var _0x39b9b0=_0x30beb9?_0x115b46[_0x862c('0x1d')]:_0x5de703[_0x862c('0x1a')]+_0x5de703[_0x862c('0x1c')];var _0x239b68;if(_0x39b9b0>=_0x5e91b8){_0x39b9b0=_0x5e91b8;_0x239b68=0xc8;}else{_0x239b68=0xce;}_0x2f75e0['status'](_0x239b68);return _0x2f75e0['set'](_0x862c('0x1e'),_0x486403+'-'+_0x39b9b0+'/'+_0x5e91b8)['json'](_0x115b46);}return null;};}function patchUpdates(_0xa61eb4){return function(_0x1a8dfd){try{jsonpatch[_0x862c('0x1f')](_0x1a8dfd,_0xa61eb4,!![]);}catch(_0x14bc8a){return BPromise[_0x862c('0x20')](_0x14bc8a);}return _0x1a8dfd[_0x862c('0x21')]();};}function saveUpdates(_0x4cf5a4,_0x5e5f1d){return function(_0x118e5a){if(_0x118e5a){return _0x118e5a[_0x862c('0x22')](_0x4cf5a4)[_0x862c('0x23')](function(_0x4c8e88){return _0x4c8e88;});}return null;};}function removeEntity(_0x45c7a0,_0xddaa49){return function(_0x323fe4){if(_0x323fe4){return _0x323fe4[_0x862c('0x24')]()[_0x862c('0x23')](function(){_0x45c7a0[_0x862c('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b9e8,_0x8c9a85){return function(_0x30ff87){if(!_0x30ff87){_0x41b9e8[_0x862c('0x17')](0x194);}return _0x30ff87;};}function handleError(_0x14e358,_0x43ed70){_0x43ed70=_0x43ed70||0x1f4;return function(_0x560251){logger[_0x862c('0x26')](_0x560251[_0x862c('0x27')]);if(_0x560251[_0x862c('0x28')]){delete _0x560251['name'];}_0x14e358['status'](_0x43ed70)['send'](_0x560251);};}exports[_0x862c('0x29')]=function(_0x5e72f0,_0x128e65){var _0x14cf4a={},_0x5da7f1={},_0x4adc92={'count':0x0,'rows':[]};var _0x571a20=_[_0x862c('0x2a')](db[_0x862c('0x2b')]['rawAttributes'],function(_0x2f362e){return{'name':_0x2f362e[_0x862c('0x2c')],'type':_0x2f362e[_0x862c('0x2d')][_0x862c('0x2e')]};});_0x5da7f1['model']=_[_0x862c('0x2a')](_0x571a20,_0x862c('0x28'));_0x5da7f1[_0x862c('0x2f')]=_[_0x862c('0x30')](_0x5e72f0['query']);_0x5da7f1[_0x862c('0x31')]=_[_0x862c('0x32')](_0x5da7f1['model'],_0x5da7f1[_0x862c('0x2f')]);_0x14cf4a[_0x862c('0x33')]=_[_0x862c('0x32')](_0x5da7f1[_0x862c('0x34')],qs['fields'](_0x5e72f0[_0x862c('0x2f')]['fields']));_0x14cf4a[_0x862c('0x33')]=_0x14cf4a['attributes']['length']?_0x14cf4a[_0x862c('0x33')]:_0x5da7f1['model'];if(!_0x5e72f0['query'][_0x862c('0x35')](_0x862c('0x36'))){_0x14cf4a[_0x862c('0x1c')]=qs[_0x862c('0x1c')](_0x5e72f0[_0x862c('0x2f')]['limit']);_0x14cf4a[_0x862c('0x1a')]=qs[_0x862c('0x1a')](_0x5e72f0[_0x862c('0x2f')][_0x862c('0x1a')]);}_0x14cf4a['order']=qs[_0x862c('0x37')](_0x5e72f0[_0x862c('0x2f')][_0x862c('0x37')]);_0x14cf4a[_0x862c('0x38')]=qs['filters'](_[_0x862c('0x39')](_0x5e72f0[_0x862c('0x2f')],_0x5da7f1['filters']),_0x571a20);if(_0x5e72f0[_0x862c('0x2f')][_0x862c('0x3a')]){_0x14cf4a[_0x862c('0x38')]=_[_0x862c('0x3b')](_0x14cf4a[_0x862c('0x38')],{'$or':_[_0x862c('0x2a')](_0x571a20,function(_0x2a79c5){if(_0x2a79c5[_0x862c('0x2d')]!==_0x862c('0x3c')){var _0x450d5c={};_0x450d5c[_0x2a79c5[_0x862c('0x28')]]={'$like':'%'+_0x5e72f0['query']['filter']+'%'};return _0x450d5c;}})});}_0x14cf4a=_[_0x862c('0x3b')]({},_0x14cf4a,_0x5e72f0[_0x862c('0x3d')]);var _0x392572={'where':_0x14cf4a['where']};return db[_0x862c('0x2b')][_0x862c('0x1d')](_0x392572)[_0x862c('0x23')](function(_0x26b091){_0x4adc92[_0x862c('0x1d')]=_0x26b091;if(_0x5e72f0[_0x862c('0x2f')][_0x862c('0x3e')]){_0x14cf4a['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x862c('0x3f')](_0x14cf4a);})[_0x862c('0x23')](function(_0x2c6350){_0x4adc92['rows']=_0x2c6350;return _0x4adc92;})['then'](respondWithFilteredResult(_0x128e65,_0x14cf4a))['catch'](handleError(_0x128e65,null));};exports[_0x862c('0x40')]=function(_0x4c41b8,_0x1bafe4){var _0x3cf4d3={'raw':!![],'where':{'id':_0x4c41b8[_0x862c('0x41')]['id']}},_0x15a931={};_0x15a931['model']=_[_0x862c('0x30')](db[_0x862c('0x2b')][_0x862c('0x42')]);_0x15a931[_0x862c('0x2f')]=_[_0x862c('0x30')](_0x4c41b8['query']);_0x15a931[_0x862c('0x31')]=_[_0x862c('0x32')](_0x15a931['model'],_0x15a931[_0x862c('0x2f')]);_0x3cf4d3['attributes']=_['intersection'](_0x15a931[_0x862c('0x34')],qs[_0x862c('0x43')](_0x4c41b8['query'][_0x862c('0x43')]));_0x3cf4d3['attributes']=_0x3cf4d3[_0x862c('0x33')][_0x862c('0x44')]?_0x3cf4d3[_0x862c('0x33')]:_0x15a931[_0x862c('0x34')];if(_0x4c41b8['query'][_0x862c('0x3e')]){_0x3cf4d3[_0x862c('0x45')]=[{'all':!![]}];}_0x3cf4d3=_[_0x862c('0x3b')]({},_0x3cf4d3,_0x4c41b8[_0x862c('0x3d')]);return db['JscriptySessionReport'][_0x862c('0x46')](_0x3cf4d3)['then'](handleEntityNotFound(_0x1bafe4,null))[_0x862c('0x23')](respondWithResult(_0x1bafe4,null))['catch'](handleError(_0x1bafe4,null));};exports[_0x862c('0x47')]=function(_0x93e884,_0x19a993){return db[_0x862c('0x2b')]['create'](_0x93e884[_0x862c('0x48')],{})[_0x862c('0x23')](respondWithResult(_0x19a993,0xc9))[_0x862c('0x49')](handleError(_0x19a993,null));};exports[_0x862c('0x22')]=function(_0x58c07e,_0x19083c){if(_0x58c07e[_0x862c('0x48')]['id']){delete _0x58c07e[_0x862c('0x48')]['id'];}return db[_0x862c('0x2b')][_0x862c('0x46')]({'where':{'id':_0x58c07e[_0x862c('0x41')]['id']}})[_0x862c('0x23')](handleEntityNotFound(_0x19083c,null))[_0x862c('0x23')](saveUpdates(_0x58c07e[_0x862c('0x48')],null))[_0x862c('0x23')](respondWithResult(_0x19083c,null))[_0x862c('0x49')](handleError(_0x19083c,null));};exports[_0x862c('0x24')]=function(_0x285b5d,_0x442d32){return db[_0x862c('0x2b')][_0x862c('0x46')]({'where':{'id':_0x285b5d[_0x862c('0x41')]['id']}})[_0x862c('0x23')](handleEntityNotFound(_0x442d32,null))[_0x862c('0x23')](removeEntity(_0x442d32,null))[_0x862c('0x49')](handleError(_0x442d32,null));};exports[_0x862c('0x4a')]=function(_0x24a3ea,_0x59fb78){return db[_0x862c('0x2b')][_0x862c('0x4a')]()[_0x862c('0x23')](respondWithResult(_0x59fb78,null))[_0x862c('0x49')](handleError(_0x59fb78,null));};exports['getQuestions']=function(_0x42ac8e,_0x32c94c,_0x217958){var _0x3f24fe={'raw':!![],'where':{}};var _0x3dc251={};var _0x4b68dd={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x862c('0x4b')]({'where':{'id':_0x42ac8e[_0x862c('0x41')]['id']}})[_0x862c('0x23')](handleEntityNotFound(_0x32c94c,null))['then'](function(_0x3c930e){if(_0x3c930e){_0x3dc251[_0x862c('0x34')]=_[_0x862c('0x30')](db[_0x862c('0x4c')]['rawAttributes']);_0x3dc251[_0x862c('0x2f')]=_[_0x862c('0x30')](_0x42ac8e['query']);_0x3dc251[_0x862c('0x31')]=_[_0x862c('0x32')](_0x3dc251[_0x862c('0x34')],_0x3dc251['query']);_0x3f24fe['attributes']=_[_0x862c('0x32')](_0x3dc251['model'],qs[_0x862c('0x43')](_0x42ac8e[_0x862c('0x2f')][_0x862c('0x43')]));_0x3f24fe[_0x862c('0x33')]=_0x3f24fe['attributes'][_0x862c('0x44')]?_0x3f24fe[_0x862c('0x33')]:_0x3dc251[_0x862c('0x34')];if(!_0x42ac8e[_0x862c('0x2f')]['hasOwnProperty'](_0x862c('0x36'))){_0x3f24fe['limit']=qs[_0x862c('0x1c')](_0x42ac8e['query'][_0x862c('0x1c')]);_0x3f24fe[_0x862c('0x1a')]=qs[_0x862c('0x1a')](_0x42ac8e[_0x862c('0x2f')]['offset']);}_0x3f24fe[_0x862c('0x4d')]=qs[_0x862c('0x37')](_0x42ac8e[_0x862c('0x2f')][_0x862c('0x37')]);_0x3f24fe['where']=qs[_0x862c('0x31')](_[_0x862c('0x39')](_0x42ac8e[_0x862c('0x2f')],_0x3dc251['filters']));_0x3f24fe[_0x862c('0x38')][_0x862c('0x4e')]=_0x3c930e['id'];if(_0x42ac8e[_0x862c('0x2f')][_0x862c('0x3a')]){_0x3f24fe['where']=_[_0x862c('0x3b')](_0x3f24fe[_0x862c('0x38')],{'$or':_[_0x862c('0x2a')](_0x3f24fe[_0x862c('0x33')],function(_0x4c73d0){var _0x5d070f={};_0x5d070f[_0x4c73d0]={'$like':'%'+_0x42ac8e[_0x862c('0x2f')][_0x862c('0x3a')]+'%'};return _0x5d070f;})});}_0x3f24fe=_['merge']({},_0x3f24fe,_0x42ac8e[_0x862c('0x3d')]);return db[_0x862c('0x4c')]['count']({'where':_0x3f24fe[_0x862c('0x38')]})['then'](function(_0x554430){_0x4b68dd['count']=_0x554430;if(_0x42ac8e[_0x862c('0x2f')]['includeAll']){_0x3f24fe[_0x862c('0x45')]=[{'all':!![]}];}return db[_0x862c('0x4c')][_0x862c('0x3f')](_0x3f24fe);})[_0x862c('0x23')](function(_0xf4b94){_0x4b68dd[_0x862c('0x4f')]=_0xf4b94;return _0x4b68dd;});}})[_0x862c('0x23')](respondWithFilteredResult(_0x32c94c,_0x3f24fe))[_0x862c('0x49')](handleError(_0x32c94c,null));}; \ No newline at end of file +var _0xa3a3=['body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','apply','save','update','destroy','error','stack','name','send','index','map','JscriptySessionReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','type','VIRTUAL','merge','options','where','includeAll','findAll','then','rows','catch','params','include','find','create'];(function(_0x4e0f70,_0x375e11){var _0x21e651=function(_0x2a7f92){while(--_0x2a7f92){_0x4e0f70['push'](_0x4e0f70['shift']());}};_0x21e651(++_0x375e11);}(_0xa3a3,0x13a));var _0x3a3a=function(_0x4adc66,_0xb80204){_0x4adc66=_0x4adc66-0x0;var _0x267a41=_0xa3a3[_0x4adc66];return _0x267a41;};'use strict';var emlformat=require(_0x3a3a('0x0'));var rimraf=require(_0x3a3a('0x1'));var zipdir=require(_0x3a3a('0x2'));var jsonpatch=require(_0x3a3a('0x3'));var rp=require(_0x3a3a('0x4'));var moment=require(_0x3a3a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3a3a('0x6'));var path=require('path');var sox=require(_0x3a3a('0x7'));var csv=require(_0x3a3a('0x8'));var ejs=require(_0x3a3a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a3a('0xa'));var squel=require(_0x3a3a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3a3a('0xc'));var deskjs=require(_0x3a3a('0xd'));var toCsv=require(_0x3a3a('0x8'));var querystring=require(_0x3a3a('0xe'));var Papa=require('papaparse');var Redis=require(_0x3a3a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3a3a('0x10'));var as=require(_0x3a3a('0x11'));var hardwareService=require(_0x3a3a('0x12'));var logger=require('../../config/logger')(_0x3a3a('0x13'));var utils=require('../../config/utils');var config=require(_0x3a3a('0x14'));var licenseUtil=require(_0x3a3a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f5972,_0x1ad325){_0x1ad325=_0x1ad325||0xcc;return function(_0x1397d6){if(_0x1397d6){return _0x5f5972[_0x3a3a('0x16')](_0x1ad325);}return _0x5f5972['status'](_0x1ad325)[_0x3a3a('0x17')]();};}function respondWithResult(_0x28c492,_0x492fdd){_0x492fdd=_0x492fdd||0xc8;return function(_0x1b9f1f){if(_0x1b9f1f){return _0x28c492[_0x3a3a('0x18')](_0x492fdd)[_0x3a3a('0x19')](_0x1b9f1f);}};}function respondWithFilteredResult(_0x54cc79,_0x4d82a5){return function(_0x2ea772){if(_0x2ea772){var _0x4e5848=typeof _0x4d82a5['offset']===_0x3a3a('0x1a')&&typeof _0x4d82a5[_0x3a3a('0x1b')]===_0x3a3a('0x1a');var _0x4de7e1=_0x2ea772[_0x3a3a('0x1c')];var _0x332113=_0x4e5848?0x0:_0x4d82a5[_0x3a3a('0x1d')];var _0x27b0d5=_0x4e5848?_0x2ea772[_0x3a3a('0x1c')]:_0x4d82a5[_0x3a3a('0x1d')]+_0x4d82a5[_0x3a3a('0x1b')];var _0x2cce8c;if(_0x27b0d5>=_0x4de7e1){_0x27b0d5=_0x4de7e1;_0x2cce8c=0xc8;}else{_0x2cce8c=0xce;}_0x54cc79[_0x3a3a('0x18')](_0x2cce8c);return _0x54cc79['set']('Content-Range',_0x332113+'-'+_0x27b0d5+'/'+_0x4de7e1)[_0x3a3a('0x19')](_0x2ea772);}return null;};}function patchUpdates(_0x3f9bd1){return function(_0x36ff9e){try{jsonpatch[_0x3a3a('0x1e')](_0x36ff9e,_0x3f9bd1,!![]);}catch(_0xca37f5){return BPromise['reject'](_0xca37f5);}return _0x36ff9e[_0x3a3a('0x1f')]();};}function saveUpdates(_0x79396c,_0x5d0500){return function(_0x4f8c17){if(_0x4f8c17){return _0x4f8c17[_0x3a3a('0x20')](_0x79396c)['then'](function(_0x355df3){return _0x355df3;});}return null;};}function removeEntity(_0xd35443,_0x1e462d){return function(_0x3291dd){if(_0x3291dd){return _0x3291dd[_0x3a3a('0x21')]()['then'](function(){_0xd35443[_0x3a3a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13e14f,_0x38254c){return function(_0x540f40){if(!_0x540f40){_0x13e14f[_0x3a3a('0x16')](0x194);}return _0x540f40;};}function handleError(_0x5e9336,_0x490b6c){_0x490b6c=_0x490b6c||0x1f4;return function(_0x518d07){logger[_0x3a3a('0x22')](_0x518d07[_0x3a3a('0x23')]);if(_0x518d07['name']){delete _0x518d07[_0x3a3a('0x24')];}_0x5e9336[_0x3a3a('0x18')](_0x490b6c)[_0x3a3a('0x25')](_0x518d07);};}exports[_0x3a3a('0x26')]=function(_0x52fd27,_0xa97576){var _0x4f4255={},_0xb4c6bd={},_0x563d75={'count':0x0,'rows':[]};var _0x2cd4f8=_[_0x3a3a('0x27')](db[_0x3a3a('0x28')]['rawAttributes'],function(_0x1d5fc0){return{'name':_0x1d5fc0[_0x3a3a('0x29')],'type':_0x1d5fc0['type'][_0x3a3a('0x2a')]};});_0xb4c6bd[_0x3a3a('0x2b')]=_[_0x3a3a('0x27')](_0x2cd4f8,_0x3a3a('0x24'));_0xb4c6bd[_0x3a3a('0x2c')]=_[_0x3a3a('0x2d')](_0x52fd27['query']);_0xb4c6bd[_0x3a3a('0x2e')]=_['intersection'](_0xb4c6bd[_0x3a3a('0x2b')],_0xb4c6bd[_0x3a3a('0x2c')]);_0x4f4255[_0x3a3a('0x2f')]=_[_0x3a3a('0x30')](_0xb4c6bd[_0x3a3a('0x2b')],qs[_0x3a3a('0x31')](_0x52fd27[_0x3a3a('0x2c')]['fields']));_0x4f4255[_0x3a3a('0x2f')]=_0x4f4255[_0x3a3a('0x2f')][_0x3a3a('0x32')]?_0x4f4255[_0x3a3a('0x2f')]:_0xb4c6bd[_0x3a3a('0x2b')];if(!_0x52fd27[_0x3a3a('0x2c')][_0x3a3a('0x33')](_0x3a3a('0x34'))){_0x4f4255['limit']=qs['limit'](_0x52fd27[_0x3a3a('0x2c')][_0x3a3a('0x1b')]);_0x4f4255[_0x3a3a('0x1d')]=qs['offset'](_0x52fd27[_0x3a3a('0x2c')][_0x3a3a('0x1d')]);}_0x4f4255[_0x3a3a('0x35')]=qs[_0x3a3a('0x36')](_0x52fd27['query'][_0x3a3a('0x36')]);_0x4f4255['where']=qs[_0x3a3a('0x2e')](_[_0x3a3a('0x37')](_0x52fd27[_0x3a3a('0x2c')],_0xb4c6bd[_0x3a3a('0x2e')]),_0x2cd4f8);if(_0x52fd27[_0x3a3a('0x2c')][_0x3a3a('0x38')]){_0x4f4255['where']=_['merge'](_0x4f4255['where'],{'$or':_[_0x3a3a('0x27')](_0x2cd4f8,function(_0x51518b){if(_0x51518b[_0x3a3a('0x39')]!==_0x3a3a('0x3a')){var _0x4cd2bf={};_0x4cd2bf[_0x51518b['name']]={'$like':'%'+_0x52fd27['query']['filter']+'%'};return _0x4cd2bf;}})});}_0x4f4255=_[_0x3a3a('0x3b')]({},_0x4f4255,_0x52fd27[_0x3a3a('0x3c')]);var _0x53c0ef={'where':_0x4f4255[_0x3a3a('0x3d')]};return db[_0x3a3a('0x28')]['count'](_0x53c0ef)['then'](function(_0x28c310){_0x563d75[_0x3a3a('0x1c')]=_0x28c310;if(_0x52fd27[_0x3a3a('0x2c')][_0x3a3a('0x3e')]){_0x4f4255['include']=[{'all':!![]}];}return db[_0x3a3a('0x28')][_0x3a3a('0x3f')](_0x4f4255);})[_0x3a3a('0x40')](function(_0x37e50c){_0x563d75[_0x3a3a('0x41')]=_0x37e50c;return _0x563d75;})['then'](respondWithFilteredResult(_0xa97576,_0x4f4255))[_0x3a3a('0x42')](handleError(_0xa97576,null));};exports['show']=function(_0x1d61bc,_0x59762e){var _0x470e0a={'raw':!![],'where':{'id':_0x1d61bc[_0x3a3a('0x43')]['id']}},_0x15b9d0={};_0x15b9d0[_0x3a3a('0x2b')]=_[_0x3a3a('0x2d')](db['JscriptySessionReport']['rawAttributes']);_0x15b9d0['query']=_[_0x3a3a('0x2d')](_0x1d61bc[_0x3a3a('0x2c')]);_0x15b9d0[_0x3a3a('0x2e')]=_['intersection'](_0x15b9d0[_0x3a3a('0x2b')],_0x15b9d0['query']);_0x470e0a[_0x3a3a('0x2f')]=_[_0x3a3a('0x30')](_0x15b9d0['model'],qs[_0x3a3a('0x31')](_0x1d61bc['query'][_0x3a3a('0x31')]));_0x470e0a['attributes']=_0x470e0a['attributes'][_0x3a3a('0x32')]?_0x470e0a[_0x3a3a('0x2f')]:_0x15b9d0[_0x3a3a('0x2b')];if(_0x1d61bc[_0x3a3a('0x2c')][_0x3a3a('0x3e')]){_0x470e0a[_0x3a3a('0x44')]=[{'all':!![]}];}_0x470e0a=_['merge']({},_0x470e0a,_0x1d61bc[_0x3a3a('0x3c')]);return db[_0x3a3a('0x28')][_0x3a3a('0x45')](_0x470e0a)[_0x3a3a('0x40')](handleEntityNotFound(_0x59762e,null))[_0x3a3a('0x40')](respondWithResult(_0x59762e,null))[_0x3a3a('0x42')](handleError(_0x59762e,null));};exports[_0x3a3a('0x46')]=function(_0x163902,_0x5096ef){return db[_0x3a3a('0x28')]['create'](_0x163902[_0x3a3a('0x47')],{})[_0x3a3a('0x40')](respondWithResult(_0x5096ef,0xc9))['catch'](handleError(_0x5096ef,null));};exports[_0x3a3a('0x20')]=function(_0x12dbd0,_0x1504ac){if(_0x12dbd0[_0x3a3a('0x47')]['id']){delete _0x12dbd0[_0x3a3a('0x47')]['id'];}return db['JscriptySessionReport'][_0x3a3a('0x45')]({'where':{'id':_0x12dbd0[_0x3a3a('0x43')]['id']}})['then'](handleEntityNotFound(_0x1504ac,null))[_0x3a3a('0x40')](saveUpdates(_0x12dbd0['body'],null))[_0x3a3a('0x40')](respondWithResult(_0x1504ac,null))[_0x3a3a('0x42')](handleError(_0x1504ac,null));};exports[_0x3a3a('0x21')]=function(_0x522e5e,_0x5130ca){return db[_0x3a3a('0x28')]['find']({'where':{'id':_0x522e5e[_0x3a3a('0x43')]['id']}})[_0x3a3a('0x40')](handleEntityNotFound(_0x5130ca,null))[_0x3a3a('0x40')](removeEntity(_0x5130ca,null))[_0x3a3a('0x42')](handleError(_0x5130ca,null));};exports['describe']=function(_0x4a672e,_0x20a180){return db[_0x3a3a('0x28')][_0x3a3a('0x48')]()['then'](respondWithResult(_0x20a180,null))[_0x3a3a('0x42')](handleError(_0x20a180,null));};exports[_0x3a3a('0x49')]=function(_0x3bedb6,_0x7c4fb2,_0x64ec74){var _0x36b84f={'raw':!![],'where':{}};var _0x229f2b={};var _0x529302={'count':0x0,'rows':[]};return db[_0x3a3a('0x28')][_0x3a3a('0x4a')]({'where':{'id':_0x3bedb6['params']['id']}})[_0x3a3a('0x40')](handleEntityNotFound(_0x7c4fb2,null))['then'](function(_0x1b5b6d){if(_0x1b5b6d){_0x229f2b['model']=_[_0x3a3a('0x2d')](db[_0x3a3a('0x4b')][_0x3a3a('0x4c')]);_0x229f2b[_0x3a3a('0x2c')]=_[_0x3a3a('0x2d')](_0x3bedb6[_0x3a3a('0x2c')]);_0x229f2b[_0x3a3a('0x2e')]=_['intersection'](_0x229f2b[_0x3a3a('0x2b')],_0x229f2b[_0x3a3a('0x2c')]);_0x36b84f['attributes']=_[_0x3a3a('0x30')](_0x229f2b['model'],qs[_0x3a3a('0x31')](_0x3bedb6[_0x3a3a('0x2c')][_0x3a3a('0x31')]));_0x36b84f['attributes']=_0x36b84f['attributes'][_0x3a3a('0x32')]?_0x36b84f[_0x3a3a('0x2f')]:_0x229f2b['model'];if(!_0x3bedb6[_0x3a3a('0x2c')][_0x3a3a('0x33')](_0x3a3a('0x34'))){_0x36b84f[_0x3a3a('0x1b')]=qs[_0x3a3a('0x1b')](_0x3bedb6[_0x3a3a('0x2c')]['limit']);_0x36b84f[_0x3a3a('0x1d')]=qs[_0x3a3a('0x1d')](_0x3bedb6['query'][_0x3a3a('0x1d')]);}_0x36b84f[_0x3a3a('0x35')]=qs[_0x3a3a('0x36')](_0x3bedb6['query'][_0x3a3a('0x36')]);_0x36b84f[_0x3a3a('0x3d')]=qs[_0x3a3a('0x2e')](_[_0x3a3a('0x37')](_0x3bedb6[_0x3a3a('0x2c')],_0x229f2b[_0x3a3a('0x2e')]));_0x36b84f[_0x3a3a('0x3d')]['SessionId']=_0x1b5b6d['id'];if(_0x3bedb6[_0x3a3a('0x2c')]['filter']){_0x36b84f['where']=_['merge'](_0x36b84f[_0x3a3a('0x3d')],{'$or':_['map'](_0x36b84f[_0x3a3a('0x2f')],function(_0x2a5380){var _0x2cf78d={};_0x2cf78d[_0x2a5380]={'$like':'%'+_0x3bedb6['query'][_0x3a3a('0x38')]+'%'};return _0x2cf78d;})});}_0x36b84f=_[_0x3a3a('0x3b')]({},_0x36b84f,_0x3bedb6[_0x3a3a('0x3c')]);return db[_0x3a3a('0x4b')]['count']({'where':_0x36b84f['where']})[_0x3a3a('0x40')](function(_0x11dfb0){_0x529302['count']=_0x11dfb0;if(_0x3bedb6[_0x3a3a('0x2c')][_0x3a3a('0x3e')]){_0x36b84f[_0x3a3a('0x44')]=[{'all':!![]}];}return db[_0x3a3a('0x4b')][_0x3a3a('0x3f')](_0x36b84f);})[_0x3a3a('0x40')](function(_0xb15cdb){_0x529302[_0x3a3a('0x41')]=_0xb15cdb;return _0x529302;});}})[_0x3a3a('0x40')](respondWithFilteredResult(_0x7c4fb2,_0x36b84f))['catch'](handleError(_0x7c4fb2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 27f350b..5090e60 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 _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x2d2a9b,_0x5870ff){var _0x3d2d49=function(_0x13884d){while(--_0x13884d){_0x2d2a9b['push'](_0x2d2a9b['shift']());}};_0x3d2d49(++_0x5870ff);}(_0x8ca9,0x9c));var _0x98ca=function(_0x182ba6,_0x4e11b1){_0x182ba6=_0x182ba6-0x0;var _0x3f4068=_0x8ca9[_0x182ba6];return _0x3f4068;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1883=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x1883,0xab));var _0x3188=function(_0x1576f1,_0xf69fb6){_0x1576f1=_0x1576f1-0x0;var _0x334b28=_0x1883[_0x1576f1];return _0x334b28;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index b502fea..1765573 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 _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x151e77,_0x395874){var _0x53314d=function(_0x48184){while(--_0x48184){_0x151e77['push'](_0x151e77['shift']());}};_0x53314d(++_0x395874);}(_0x32b6,0x1d1));var _0x632b=function(_0x140c40,_0x244f09){_0x140c40=_0x140c40-0x0;var _0x34ca3f=_0x32b6[_0x140c40];return _0x34ca3f;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file +var _0x1967=['then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x1967,0x173));var _0x7196=function(_0x56ece6,_0x4784b9){_0x56ece6=_0x56ece6-0x0;var _0x3be7bc=_0x1967[_0x56ece6];return _0x3be7bc;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 83489b7..83f84b2 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 _0x0670=['/:id','isAuthenticated','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put'];(function(_0xb553ad,_0x5cd296){var _0x51f3db=function(_0x56f1af){while(--_0x56f1af){_0xb553ad['push'](_0xb553ad['shift']());}};_0x51f3db(++_0x5cd296);}(_0x0670,0x1c5));var _0x0067=function(_0x2575eb,_0x456f3f){_0x2575eb=_0x2575eb-0x0;var _0x1c49da=_0x0670[_0x2575eb];return _0x1c49da;};'use strict';var multer=require(_0x0067('0x0'));var util=require(_0x0067('0x1'));var path=require(_0x0067('0x2'));var timeout=require(_0x0067('0x3'));var express=require('express');var router=express[_0x0067('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0067('0x5'));var interaction=require(_0x0067('0x6'));var config=require('../../config/environment');var controller=require(_0x0067('0x7'));router[_0x0067('0x8')]('/',controller[_0x0067('0x9')]);router[_0x0067('0xa')](_0x0067('0xb'),auth[_0x0067('0xc')](),controller['update']);router[_0x0067('0x8')](_0x0067('0xd'),auth[_0x0067('0xc')](),controller[_0x0067('0xe')]);module[_0x0067('0xf')]=router; \ No newline at end of file +var _0x8aa0=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','index','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x573990,_0x262643){var _0x4e6109=function(_0x19bce1){while(--_0x19bce1){_0x573990['push'](_0x573990['shift']());}};_0x4e6109(++_0x262643);}(_0x8aa0,0xb7));var _0x08aa=function(_0x58e631,_0x4690e3){_0x58e631=_0x58e631-0x0;var _0x40ae88=_0x8aa0[_0x58e631];return _0x40ae88;};'use strict';var multer=require(_0x08aa('0x0'));var util=require('util');var path=require(_0x08aa('0x1'));var timeout=require(_0x08aa('0x2'));var express=require(_0x08aa('0x3'));var router=express[_0x08aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x08aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x08aa('0x6'));var controller=require('./license.controller');router['get']('/',controller[_0x08aa('0x7')]);router['put'](_0x08aa('0x8'),auth[_0x08aa('0x9')](),controller[_0x08aa('0xa')]);router['get'](_0x08aa('0xb'),auth[_0x08aa('0x9')](),controller[_0x08aa('0xc')]);module[_0x08aa('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 7d5701a..8cc7412 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 _0xe5b9=['STRING','INTEGER','exports'];(function(_0x736c40,_0x34651a){var _0xe59d21=function(_0x246df9){while(--_0x246df9){_0x736c40['push'](_0x736c40['shift']());}};_0xe59d21(++_0x34651a);}(_0xe5b9,0x1a6));var _0x9e5b=function(_0x9e7ecd,_0x4eb8b4){_0x9e7ecd=_0x9e7ecd-0x0;var _0x29572b=_0xe5b9[_0x9e7ecd];return _0x29572b;};'use strict';var Sequelize=require('sequelize');module[_0x9e5b('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x9e5b('0x1')]},'data2':{'type':Sequelize[_0x9e5b('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x9e5b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x60ec=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x28f851,_0x4ef3f1){var _0x5c86d4=function(_0x31fd2d){while(--_0x31fd2d){_0x28f851['push'](_0x28f851['shift']());}};_0x5c86d4(++_0x4ef3f1);}(_0x60ec,0xfc));var _0xc60e=function(_0x1215f6,_0x466abd){_0x1215f6=_0x1215f6-0x0;var _0x38194c=_0x60ec[_0x1215f6];return _0x38194c;};'use strict';var Sequelize=require(_0xc60e('0x0'));module[_0xc60e('0x1')]={'license':{'type':Sequelize[_0xc60e('0x2')]},'data1':{'type':Sequelize[_0xc60e('0x3')]},'data2':{'type':Sequelize[_0xc60e('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xc60e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 9b5b500..01e9a86 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 _0x866a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','error','stack','name','send','model','keys','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','license-info.log','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4abe25,_0x3d2379){var _0x472ebf=function(_0x592f0d){while(--_0x592f0d){_0x4abe25['push'](_0x4abe25['shift']());}};_0x472ebf(++_0x3d2379);}(_0x866a,0x1dd));var _0xa866=function(_0x406d39,_0xd3c8f1){_0x406d39=_0x406d39-0x0;var _0x2eb792=_0x866a[_0x406d39];return _0x2eb792;};'use strict';var emlformat=require(_0xa866('0x0'));var rimraf=require(_0xa866('0x1'));var zipdir=require(_0xa866('0x2'));var jsonpatch=require(_0xa866('0x3'));var rp=require('request-promise');var moment=require(_0xa866('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa866('0x5'));var sox=require(_0xa866('0x6'));var csv=require(_0xa866('0x7'));var ejs=require(_0xa866('0x8'));var fs=require('fs');var fs_extra=require(_0xa866('0x9'));var _=require('lodash');var squel=require(_0xa866('0xa'));var crypto=require(_0xa866('0xb'));var jsforce=require(_0xa866('0xc'));var deskjs=require(_0xa866('0xd'));var toCsv=require(_0xa866('0x7'));var querystring=require(_0xa866('0xe'));var Papa=require(_0xa866('0xf'));var Redis=require(_0xa866('0x10'));var authService=require(_0xa866('0x11'));var qs=require(_0xa866('0x12'));var as=require(_0xa866('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa866('0x14'))(_0xa866('0x15'));var utils=require(_0xa866('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa866('0x17'));var db=require(_0xa866('0x18'))['db'];function respondWithStatusCode(_0x1495f4,_0x5bf175){_0x5bf175=_0x5bf175||0xcc;return function(_0x124b1f){if(_0x124b1f){return _0x1495f4[_0xa866('0x19')](_0x5bf175);}return _0x1495f4[_0xa866('0x1a')](_0x5bf175)[_0xa866('0x1b')]();};}function respondWithResult(_0x3fd752,_0xb66966){_0xb66966=_0xb66966||0xc8;return function(_0xca8d82){if(_0xca8d82){return _0x3fd752['status'](_0xb66966)[_0xa866('0x1c')](_0xca8d82);}};}function respondWithFilteredResult(_0x122b62,_0x2108ec){return function(_0x3d6fc6){if(_0x3d6fc6){var _0x5133d8=typeof _0x2108ec['offset']===_0xa866('0x1d')&&typeof _0x2108ec[_0xa866('0x1e')]==='undefined';var _0x92964b=_0x3d6fc6[_0xa866('0x1f')];var _0x35b92a=_0x5133d8?0x0:_0x2108ec[_0xa866('0x20')];var _0x371847=_0x5133d8?_0x3d6fc6['count']:_0x2108ec[_0xa866('0x20')]+_0x2108ec[_0xa866('0x1e')];var _0x28e95b;if(_0x371847>=_0x92964b){_0x371847=_0x92964b;_0x28e95b=0xc8;}else{_0x28e95b=0xce;}_0x122b62[_0xa866('0x1a')](_0x28e95b);return _0x122b62['set']('Content-Range',_0x35b92a+'-'+_0x371847+'/'+_0x92964b)[_0xa866('0x1c')](_0x3d6fc6);}return null;};}function patchUpdates(_0x5d4ace){return function(_0x2a9cf6){try{jsonpatch[_0xa866('0x21')](_0x2a9cf6,_0x5d4ace,!![]);}catch(_0x5d915f){return BPromise['reject'](_0x5d915f);}return _0x2a9cf6[_0xa866('0x22')]();};}function saveUpdates(_0x2315d3,_0x173295){return function(_0x572ab){if(_0x572ab){return _0x572ab[_0xa866('0x23')](_0x2315d3)[_0xa866('0x24')](function(_0x427a63){return _0x427a63;});}return null;};}function removeEntity(_0x225fce,_0xf88422){return function(_0x176bba){if(_0x176bba){return _0x176bba['destroy']()[_0xa866('0x24')](function(){_0x225fce['status'](0xcc)[_0xa866('0x1b')]();});}};}function handleEntityNotFound(_0x4989f6,_0x10affa){return function(_0x2876af){if(!_0x2876af){_0x4989f6['sendStatus'](0x194);}return _0x2876af;};}function handleError(_0x4c7db1,_0x5d208a){_0x5d208a=_0x5d208a||0x1f4;return function(_0x46345b){logger[_0xa866('0x25')](_0x46345b[_0xa866('0x26')]);if(_0x46345b[_0xa866('0x27')]){delete _0x46345b['name'];}_0x4c7db1[_0xa866('0x1a')](_0x5d208a)[_0xa866('0x28')](_0x46345b);};}var utilLicense=require(_0xa866('0x17'));exports['index']=function(_0x217ad0,_0x3bbcd6){var _0x45106a={'raw':!![],'where':{'id':0x1}},_0x2fd75d={};_0x2fd75d[_0xa866('0x29')]=_[_0xa866('0x2a')](db['License']['rawAttributes']);_0x2fd75d['query']=_[_0xa866('0x2a')](_0x217ad0[_0xa866('0x2b')]);_0x2fd75d[_0xa866('0x2c')]=_[_0xa866('0x2d')](_0x2fd75d['model'],_0x2fd75d[_0xa866('0x2b')]);_0x45106a[_0xa866('0x2e')]=_['intersection'](_0x2fd75d[_0xa866('0x29')],qs[_0xa866('0x2f')](_0x217ad0[_0xa866('0x2b')]['fields']));_0x45106a[_0xa866('0x2e')]=_0x45106a[_0xa866('0x2e')][_0xa866('0x30')]?_0x45106a['attributes']:_0x2fd75d['model'];_0x45106a=_[_0xa866('0x31')]({},_0x45106a,_0x217ad0[_0xa866('0x32')]);return utilLicense[_0xa866('0x33')](_0x45106a)[_0xa866('0x24')](respondWithResult(_0x3bbcd6,null))[_0xa866('0x34')](handleError(_0x3bbcd6,null));};exports[_0xa866('0x23')]=function(_0x2b1517,_0x40218b){if(_0x2b1517[_0xa866('0x35')]['id']){delete _0x2b1517[_0xa866('0x35')]['id'];}return db['License'][_0xa866('0x36')]({'where':{'id':_0x2b1517[_0xa866('0x37')]['id']}})['then'](handleEntityNotFound(_0x40218b,null))[_0xa866('0x24')](function(_0x5d3983){var _0x3998c1=_0x5d3983[_0xa866('0x38')]({'plain':!![]});return utilLicense[_0xa866('0x39')](_0x3998c1,_0x2b1517[_0xa866('0x35')]['key']);})['then'](function(_0x4e63a3){if(!_0x4e63a3[_0xa866('0x3a')]){return saveUpdates(_0x2b1517[_0xa866('0x35')],null);}return _0x4e63a3;})['then'](respondWithResult(_0x40218b,null))['catch'](handleError(_0x40218b,null));};exports[_0xa866('0x3b')]=function(_0x427523,_0x3175b9){var _0x15cd70=_0xa866('0x3c');var _0x2e1c0e=path['join'](_0xa866('0x3d'),_0xa866('0x3e'),_0xa866('0x3f'),_0x15cd70);_0x3175b9[_0xa866('0x40')](_0xa866('0x41'),_0xa866('0x42')+_0x15cd70);_0x3175b9[_0xa866('0x43')](_0xa866('0x44'),_0xa866('0x45'));_0x3175b9[_0xa866('0x46')](_0x2e1c0e);}; \ No newline at end of file +var _0x9c18=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','save','update','destroy','then','end','stack','name','send','index','model','License','query','keys','filters','intersection','attributes','fields','length','options','getLicense','catch','body','params','get','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','set','Content-Type','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis'];(function(_0x27e577,_0xb4a36){var _0x2ba541=function(_0x572777){while(--_0x572777){_0x27e577['push'](_0x27e577['shift']());}};_0x2ba541(++_0xb4a36);}(_0x9c18,0x153));var _0x89c1=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x9c18[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0x89c1('0x0'));var rimraf=require(_0x89c1('0x1'));var zipdir=require(_0x89c1('0x2'));var jsonpatch=require(_0x89c1('0x3'));var rp=require('request-promise');var moment=require(_0x89c1('0x4'));var BPromise=require(_0x89c1('0x5'));var Mustache=require(_0x89c1('0x6'));var util=require(_0x89c1('0x7'));var path=require('path');var sox=require(_0x89c1('0x8'));var csv=require(_0x89c1('0x9'));var ejs=require(_0x89c1('0xa'));var fs=require('fs');var fs_extra=require(_0x89c1('0xb'));var _=require(_0x89c1('0xc'));var squel=require(_0x89c1('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x89c1('0xe'));var toCsv=require(_0x89c1('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x89c1('0xf'));var authService=require(_0x89c1('0x10'));var qs=require(_0x89c1('0x11'));var as=require(_0x89c1('0x12'));var hardwareService=require(_0x89c1('0x13'));var logger=require(_0x89c1('0x14'))('api');var utils=require(_0x89c1('0x15'));var config=require(_0x89c1('0x16'));var licenseUtil=require(_0x89c1('0x17'));var db=require(_0x89c1('0x18'))['db'];function respondWithStatusCode(_0x23f042,_0x31fd1e){_0x31fd1e=_0x31fd1e||0xcc;return function(_0x502424){if(_0x502424){return _0x23f042[_0x89c1('0x19')](_0x31fd1e);}return _0x23f042[_0x89c1('0x1a')](_0x31fd1e)['end']();};}function respondWithResult(_0x5884c7,_0x2daac1){_0x2daac1=_0x2daac1||0xc8;return function(_0x322986){if(_0x322986){return _0x5884c7[_0x89c1('0x1a')](_0x2daac1)['json'](_0x322986);}};}function respondWithFilteredResult(_0x2bf70d,_0x553f52){return function(_0x5a6a39){if(_0x5a6a39){var _0x14685a=typeof _0x553f52[_0x89c1('0x1b')]===_0x89c1('0x1c')&&typeof _0x553f52['limit']==='undefined';var _0x52235c=_0x5a6a39[_0x89c1('0x1d')];var _0x1a826a=_0x14685a?0x0:_0x553f52[_0x89c1('0x1b')];var _0x4e8300=_0x14685a?_0x5a6a39[_0x89c1('0x1d')]:_0x553f52['offset']+_0x553f52[_0x89c1('0x1e')];var _0x198c13;if(_0x4e8300>=_0x52235c){_0x4e8300=_0x52235c;_0x198c13=0xc8;}else{_0x198c13=0xce;}_0x2bf70d[_0x89c1('0x1a')](_0x198c13);return _0x2bf70d['set']('Content-Range',_0x1a826a+'-'+_0x4e8300+'/'+_0x52235c)[_0x89c1('0x1f')](_0x5a6a39);}return null;};}function patchUpdates(_0x8807d0){return function(_0x2a3dbc){try{jsonpatch[_0x89c1('0x20')](_0x2a3dbc,_0x8807d0,!![]);}catch(_0x165cf5){return BPromise[_0x89c1('0x21')](_0x165cf5);}return _0x2a3dbc[_0x89c1('0x22')]();};}function saveUpdates(_0x40af44,_0x377d7c){return function(_0x381327){if(_0x381327){return _0x381327[_0x89c1('0x23')](_0x40af44)['then'](function(_0xfb3aed){return _0xfb3aed;});}return null;};}function removeEntity(_0x387f06,_0x42f5ff){return function(_0x4e571b){if(_0x4e571b){return _0x4e571b[_0x89c1('0x24')]()[_0x89c1('0x25')](function(){_0x387f06[_0x89c1('0x1a')](0xcc)[_0x89c1('0x26')]();});}};}function handleEntityNotFound(_0xc235cd,_0x579f3e){return function(_0x33376c){if(!_0x33376c){_0xc235cd[_0x89c1('0x19')](0x194);}return _0x33376c;};}function handleError(_0x5c8dac,_0x47c7c8){_0x47c7c8=_0x47c7c8||0x1f4;return function(_0xb74115){logger['error'](_0xb74115[_0x89c1('0x27')]);if(_0xb74115[_0x89c1('0x28')]){delete _0xb74115[_0x89c1('0x28')];}_0x5c8dac['status'](_0x47c7c8)[_0x89c1('0x29')](_0xb74115);};}var utilLicense=require('../../config/license/util');exports[_0x89c1('0x2a')]=function(_0x442042,_0xb7f9b7){var _0x543749={'raw':!![],'where':{'id':0x1}},_0x1f7bc7={};_0x1f7bc7[_0x89c1('0x2b')]=_['keys'](db[_0x89c1('0x2c')]['rawAttributes']);_0x1f7bc7[_0x89c1('0x2d')]=_[_0x89c1('0x2e')](_0x442042[_0x89c1('0x2d')]);_0x1f7bc7[_0x89c1('0x2f')]=_[_0x89c1('0x30')](_0x1f7bc7[_0x89c1('0x2b')],_0x1f7bc7[_0x89c1('0x2d')]);_0x543749[_0x89c1('0x31')]=_[_0x89c1('0x30')](_0x1f7bc7[_0x89c1('0x2b')],qs['fields'](_0x442042[_0x89c1('0x2d')][_0x89c1('0x32')]));_0x543749['attributes']=_0x543749[_0x89c1('0x31')][_0x89c1('0x33')]?_0x543749[_0x89c1('0x31')]:_0x1f7bc7[_0x89c1('0x2b')];_0x543749=_['merge']({},_0x543749,_0x442042[_0x89c1('0x34')]);return utilLicense[_0x89c1('0x35')](_0x543749)['then'](respondWithResult(_0xb7f9b7,null))[_0x89c1('0x36')](handleError(_0xb7f9b7,null));};exports[_0x89c1('0x23')]=function(_0x1f5a4d,_0x52d865){if(_0x1f5a4d[_0x89c1('0x37')]['id']){delete _0x1f5a4d[_0x89c1('0x37')]['id'];}return db[_0x89c1('0x2c')]['find']({'where':{'id':_0x1f5a4d[_0x89c1('0x38')]['id']}})[_0x89c1('0x25')](handleEntityNotFound(_0x52d865,null))[_0x89c1('0x25')](function(_0x438815){var _0x1fe535=_0x438815[_0x89c1('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x1fe535,_0x1f5a4d[_0x89c1('0x37')][_0x89c1('0x3a')]);})[_0x89c1('0x25')](function(_0x13e294){if(!_0x13e294[_0x89c1('0x3b')]){return saveUpdates(_0x1f5a4d[_0x89c1('0x37')],null);}return _0x13e294;})[_0x89c1('0x25')](respondWithResult(_0x52d865,null))['catch'](handleError(_0x52d865,null));};exports[_0x89c1('0x3c')]=function(_0x1f5c86,_0x564559){var _0x586642=_0x89c1('0x3d');var _0x1b01ec=path[_0x89c1('0x3e')](_0x89c1('0x3f'),_0x89c1('0x40'),_0x89c1('0x41'),_0x586642);_0x564559['setHeader'](_0x89c1('0x42'),_0x89c1('0x43')+_0x586642);_0x564559[_0x89c1('0x44')](_0x89c1('0x45'),'text/plain');_0x564559[_0x89c1('0x46')](_0x1b01ec);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index c145891..5f5df03 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 _0xa68b=['define','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xa68b,0xd9));var _0xba68=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xa68b[_0x292f93];return _0x5a94b1;};'use strict';var _=require('lodash');var util=require(_0xba68('0x0'));var logger=require('../../config/logger')(_0xba68('0x1'));var moment=require('moment');var BPromise=require(_0xba68('0x2'));var rp=require(_0xba68('0x3'));var fs=require('fs');var path=require(_0xba68('0x4'));var rimraf=require(_0xba68('0x5'));var config=require(_0xba68('0x6'));var attributes=require('./license.attributes');module[_0xba68('0x7')]=function(_0x219358,_0xd589b9){return _0x219358[_0xba68('0x8')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff2d=['./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1f7972,_0x4794c1){var _0x3259f7=function(_0x8aa0ec){while(--_0x8aa0ec){_0x1f7972['push'](_0x1f7972['shift']());}};_0x3259f7(++_0x4794c1);}(_0xff2d,0x7a));var _0xdff2=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xff2d[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xdff2('0x0'));var util=require(_0xdff2('0x1'));var logger=require(_0xdff2('0x2'))(_0xdff2('0x3'));var moment=require('moment');var BPromise=require(_0xdff2('0x4'));var rp=require(_0xdff2('0x5'));var fs=require('fs');var path=require(_0xdff2('0x6'));var rimraf=require('rimraf');var config=require(_0xdff2('0x7'));var attributes=require(_0xdff2('0x8'));module[_0xdff2('0x9')]=function(_0x51f3f9,_0x15d962){return _0x51f3f9[_0xdff2('0xa')](_0xdff2('0xb'),attributes,{'tableName':_0xdff2('0xc'),'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 5bad2a5..654eefd 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 _0x1a86=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x590649,_0x28f93d){var _0x4e1806=function(_0x145c9a){while(--_0x145c9a){_0x590649['push'](_0x590649['shift']());}};_0x4e1806(++_0x28f93d);}(_0x1a86,0x1e2));var _0x61a8=function(_0x10852e,_0x5d1a81){_0x10852e=_0x10852e-0x0;var _0x38cfd8=_0x1a86[_0x10852e];return _0x38cfd8;};'use strict';var _=require(_0x61a8('0x0'));var util=require(_0x61a8('0x1'));var moment=require(_0x61a8('0x2'));var BPromise=require(_0x61a8('0x3'));var rs=require(_0x61a8('0x4'));var fs=require('fs');var Redis=require(_0x61a8('0x5'));var db=require(_0x61a8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61a8('0x7'))(_0x61a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x61a8('0x9'));var client=jayson[_0x61a8('0xa')][_0x61a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e7fa6,_0xba844c,_0x56d906){return new BPromise(function(_0x4a8ecc,_0x33b404){return client[_0x61a8('0xc')](_0x5e7fa6,_0x56d906)[_0x61a8('0xd')](function(_0x4e2489){logger[_0x61a8('0xe')](_0x61a8('0xf'),_0xba844c,_0x61a8('0x10'));logger['debug'](_0x61a8('0x11'),_0xba844c,_0x61a8('0x10'),JSON[_0x61a8('0x12')](_0x4e2489));if(_0x4e2489[_0x61a8('0x13')]){if(_0x4e2489[_0x61a8('0x13')]['code']===0x1f4){logger[_0x61a8('0x13')](_0x61a8('0xf'),_0xba844c,_0x4e2489[_0x61a8('0x13')][_0x61a8('0x14')]);return _0x33b404(_0x4e2489[_0x61a8('0x13')][_0x61a8('0x14')]);}logger[_0x61a8('0x13')](_0x61a8('0xf'),_0xba844c,_0x4e2489[_0x61a8('0x13')][_0x61a8('0x14')]);return _0x4a8ecc(_0x4e2489[_0x61a8('0x13')][_0x61a8('0x14')]);}else{logger[_0x61a8('0xe')](_0x61a8('0xf'),_0xba844c,_0x61a8('0x10'));_0x4a8ecc(_0x4e2489[_0x61a8('0x15')][_0x61a8('0x14')]);}})[_0x61a8('0x16')](function(_0x4686c4){logger[_0x61a8('0x13')](_0x61a8('0xf'),_0xba844c,_0x4686c4);_0x33b404(_0x4686c4);});});} \ No newline at end of file +var _0xade6=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1b7df9,_0x4dec4b){var _0x3499b5=function(_0x4b6faf){while(--_0x4b6faf){_0x1b7df9['push'](_0x1b7df9['shift']());}};_0x3499b5(++_0x4dec4b);}(_0xade6,0xbb));var _0x6ade=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0xade6[_0x53b133];return _0x5647e0;};'use strict';var _=require('lodash');var util=require(_0x6ade('0x0'));var moment=require(_0x6ade('0x1'));var BPromise=require(_0x6ade('0x2'));var rs=require(_0x6ade('0x3'));var fs=require('fs');var Redis=require(_0x6ade('0x4'));var db=require(_0x6ade('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ade('0x6'))(_0x6ade('0x7'));var config=require(_0x6ade('0x8'));var jayson=require(_0x6ade('0x9'));var client=jayson[_0x6ade('0xa')][_0x6ade('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x591f41,_0x191109,_0xe266e6){return new BPromise(function(_0x944bc5,_0x215412){return client[_0x6ade('0xc')](_0x591f41,_0xe266e6)[_0x6ade('0xd')](function(_0x534991){logger[_0x6ade('0xe')](_0x6ade('0xf'),_0x191109,_0x6ade('0x10'));logger[_0x6ade('0x11')]('License,\x20%s,\x20%s,\x20%s',_0x191109,_0x6ade('0x10'),JSON[_0x6ade('0x12')](_0x534991));if(_0x534991[_0x6ade('0x13')]){if(_0x534991[_0x6ade('0x13')][_0x6ade('0x14')]===0x1f4){logger['error'](_0x6ade('0xf'),_0x191109,_0x534991[_0x6ade('0x13')]['message']);return _0x215412(_0x534991['error'][_0x6ade('0x15')]);}logger[_0x6ade('0x13')]('License,\x20%s,\x20%s',_0x191109,_0x534991[_0x6ade('0x13')][_0x6ade('0x15')]);return _0x944bc5(_0x534991[_0x6ade('0x13')][_0x6ade('0x15')]);}else{logger[_0x6ade('0xe')](_0x6ade('0xf'),_0x191109,_0x6ade('0x10'));_0x944bc5(_0x534991[_0x6ade('0x16')][_0x6ade('0x15')]);}})[_0x6ade('0x17')](function(_0x58ac45){logger[_0x6ade('0x13')]('License,\x20%s,\x20%s',_0x191109,_0x58ac45);_0x215412(_0x58ac45);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index d9aeea6..1a87f25 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 _0x3c00=['/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','/:id/dispositions','/:id/canned_answers','addImap','addInteraction','/:id/applications','addApplications','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications'];(function(_0x2a97c1,_0x5ce154){var _0x106b47=function(_0x8c8390){while(--_0x8c8390){_0x2a97c1['push'](_0x2a97c1['shift']());}};_0x106b47(++_0x5ce154);}(_0x3c00,0x116));var _0x03c0=function(_0x423be3,_0x5b8952){_0x423be3=_0x423be3-0x0;var _0x10f24e=_0x3c00[_0x423be3];return _0x10f24e;};'use strict';var multer=require(_0x03c0('0x0'));var util=require(_0x03c0('0x1'));var path=require('path');var timeout=require(_0x03c0('0x2'));var express=require(_0x03c0('0x3'));var router=express[_0x03c0('0x4')]();var fs_extra=require(_0x03c0('0x5'));var auth=require(_0x03c0('0x6'));var interaction=require(_0x03c0('0x7'));var config=require(_0x03c0('0x8'));var controller=require(_0x03c0('0x9'));router[_0x03c0('0xa')]('/',auth[_0x03c0('0xb')](),controller[_0x03c0('0xc')]);router[_0x03c0('0xa')](_0x03c0('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x03c0('0xa')](_0x03c0('0xe'),auth[_0x03c0('0xb')](),controller[_0x03c0('0xf')]);router[_0x03c0('0xa')]('/:id/dispositions',auth[_0x03c0('0xb')](),controller[_0x03c0('0x10')]);router[_0x03c0('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x03c0('0x11'),auth[_0x03c0('0xb')](),controller['getImap']);router['get'](_0x03c0('0x12'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x13')]);router[_0x03c0('0xa')](_0x03c0('0x14'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x15')]);router['get']('/:id/applications',auth[_0x03c0('0xb')](),controller[_0x03c0('0x16')]);router[_0x03c0('0xa')](_0x03c0('0x17'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x18')]);router[_0x03c0('0xa')](_0x03c0('0x19'),auth[_0x03c0('0xb')](),controller['verifySmtp']);router[_0x03c0('0xa')](_0x03c0('0x1a'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x1b')]);router[_0x03c0('0x1c')](_0x03c0('0x1d'),auth[_0x03c0('0xb')](),controller['addDisposition']);router[_0x03c0('0x1c')](_0x03c0('0x1e'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0x03c0('0xb')](),controller['create']);router[_0x03c0('0x1c')]('/:id/in_servers',auth[_0x03c0('0xb')](),controller[_0x03c0('0x1f')]);router['post'](_0x03c0('0x12'),auth[_0x03c0('0xb')](),controller['addSmtp']);router[_0x03c0('0x1c')](_0x03c0('0x14'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x20')]);router[_0x03c0('0x1c')](_0x03c0('0x21'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x22')]);router['post']('/:id/send',auth[_0x03c0('0xb')](),controller[_0x03c0('0x23')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x03c0('0x24')]);router[_0x03c0('0x25')](_0x03c0('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x03c0('0x26')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x03c0('0x27')]);router[_0x03c0('0x26')](_0x03c0('0x1e'),auth['isAuthenticated'](),controller[_0x03c0('0x28')]);router[_0x03c0('0x26')](_0x03c0('0x11'),auth[_0x03c0('0xb')](),controller[_0x03c0('0x29')]);router[_0x03c0('0x26')](_0x03c0('0x12'),auth[_0x03c0('0xb')](),controller['removeSmtp']);router[_0x03c0('0x26')]('/:id',auth[_0x03c0('0xb')](),controller[_0x03c0('0x2a')]);router[_0x03c0('0x26')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xed13=['addInteraction','addApplications','/:id/send','addAgents','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addImap','addSmtp'];(function(_0x3fe1ba,_0x1a33c5){var _0x5df1b4=function(_0x55d7c3){while(--_0x55d7c3){_0x3fe1ba['push'](_0x3fe1ba['shift']());}};_0x5df1b4(++_0x1a33c5);}(_0xed13,0x198));var _0x3ed1=function(_0x21b200,_0xfce4eb){_0x21b200=_0x21b200-0x0;var _0x399a96=_0xed13[_0x21b200];return _0x399a96;};'use strict';var multer=require('multer');var util=require(_0x3ed1('0x0'));var path=require(_0x3ed1('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ed1('0x2'));var router=express[_0x3ed1('0x3')]();var fs_extra=require(_0x3ed1('0x4'));var auth=require(_0x3ed1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ed1('0x6'));var controller=require(_0x3ed1('0x7'));router['get']('/',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x9')]);router[_0x3ed1('0xa')]('/describe',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0xb')]);router['get'](_0x3ed1('0xc'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0xd')]);router[_0x3ed1('0xa')](_0x3ed1('0xe'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0xf')]);router[_0x3ed1('0xa')](_0x3ed1('0x10'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x11')]);router[_0x3ed1('0xa')](_0x3ed1('0x12'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x13')]);router[_0x3ed1('0xa')](_0x3ed1('0x14'),auth[_0x3ed1('0x8')](),controller['getSmtp']);router[_0x3ed1('0xa')](_0x3ed1('0x15'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x16')]);router[_0x3ed1('0xa')](_0x3ed1('0x17'),auth[_0x3ed1('0x8')](),controller['getApplications']);router[_0x3ed1('0xa')](_0x3ed1('0x18'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x19')]);router[_0x3ed1('0xa')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0x3ed1('0xa')](_0x3ed1('0x1a'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x1b')]);router[_0x3ed1('0x1c')](_0x3ed1('0xe'),auth[_0x3ed1('0x8')](),controller['addDisposition']);router[_0x3ed1('0x1c')](_0x3ed1('0x10'),auth[_0x3ed1('0x8')](),controller['addAnswer']);router[_0x3ed1('0x1c')]('/',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x1d')]);router[_0x3ed1('0x1c')](_0x3ed1('0x12'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x1e')]);router[_0x3ed1('0x1c')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x3ed1('0x1f')]);router[_0x3ed1('0x1c')]('/:id/interactions',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x20')]);router[_0x3ed1('0x1c')](_0x3ed1('0x17'),auth['isAuthenticated'](),controller[_0x3ed1('0x21')]);router['post'](_0x3ed1('0x22'),auth[_0x3ed1('0x8')](),controller['send']);router[_0x3ed1('0x1c')]('/:id/users',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x23')]);router['put'](_0x3ed1('0xc'),auth[_0x3ed1('0x8')](),controller['update']);router[_0x3ed1('0x24')](_0x3ed1('0xe'),auth['isAuthenticated'](),controller[_0x3ed1('0x25')]);router[_0x3ed1('0x24')](_0x3ed1('0x10'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x26')]);router[_0x3ed1('0x24')]('/:id/in_servers',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x27')]);router[_0x3ed1('0x24')](_0x3ed1('0x14'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x28')]);router[_0x3ed1('0x24')]('/:id',auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x29')]);router[_0x3ed1('0x24')](_0x3ed1('0x1a'),auth[_0x3ed1('0x8')](),controller[_0x3ed1('0x2a')]);module[_0x3ed1('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 03fd20c..ed7f0ee 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 _0x1491=['exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','custom','sequelize'];(function(_0x2ce6c4,_0x1493e0){var _0x3fa5ef=function(_0x462a6a){while(--_0x462a6a){_0x2ce6c4['push'](_0x2ce6c4['shift']());}};_0x3fa5ef(++_0x1493e0);}(_0x1491,0x1d3));var _0x1149=function(_0x498775,_0x2a995f){_0x498775=_0x498775-0x0;var _0x302c50=_0x1491[_0x498775];return _0x302c50;};'use strict';var Sequelize=require(_0x1149('0x0'));module[_0x1149('0x1')]={'description':{'type':Sequelize[_0x1149('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1149('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x1149('0x4')]},'markAsUnread':{'type':Sequelize[_0x1149('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x1149('0x5')](0x2)[_0x1149('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1149('0x4')],'defaultValue':function(){return _0x1149('0x7');}},'notificationSound':{'type':Sequelize[_0x1149('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1149('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1149('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1149('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1149('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1149('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1149('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1149('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3edd86){if(!_0x3edd86)this[_0x1149('0x8')]('mandatoryDispositionPauseId',null);this[_0x1149('0x8')](_0x1149('0x9'),_0x3edd86);}},'provider':{'type':Sequelize[_0x1149('0xa')](_0x1149('0xb'),_0x1149('0xc'),_0x1149('0xd'),_0x1149('0xe')),'defaultValue':null,'get':function(){if(!this[_0x1149('0xf')](_0x1149('0x10')))return _0x1149('0x11');return this['getDataValue'](_0x1149('0x10'));},'set':function(_0xf31282){if(_0xf31282===_0x1149('0x11'))_0xf31282=null;return this[_0x1149('0x8')](_0x1149('0x10'),_0xf31282);}}}; \ No newline at end of file +var _0xb4b5=['sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','UNSIGNED','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider','custom','getDataValue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb4b5,0x1cc));var _0x5b4b=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xb4b5[_0x3e2fcf];return _0x497db7;};'use strict';var Sequelize=require(_0x5b4b('0x0'));module[_0x5b4b('0x1')]={'description':{'type':Sequelize[_0x5b4b('0x2')]},'name':{'type':Sequelize[_0x5b4b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5b4b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x5b4b('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5b4b('0x2')],'allowNull':![],'defaultValue':_0x5b4b('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x5b4b('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5b4b('0x6')],'defaultValue':function(){return _0x5b4b('0x7');}},'notificationSound':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5b4b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5b4b('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1c1660){if(!_0x1c1660)this[_0x5b4b('0x9')](_0x5b4b('0xa'),null);this[_0x5b4b('0x9')](_0x5b4b('0xb'),_0x1c1660);}},'provider':{'type':Sequelize[_0x5b4b('0xc')](_0x5b4b('0xd'),_0x5b4b('0xe'),_0x5b4b('0xf'),_0x5b4b('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x5b4b('0x11')))return _0x5b4b('0x12');return this[_0x5b4b('0x13')](_0x5b4b('0x11'));},'set':function(_0x28a728){if(_0x28a728===_0x5b4b('0x12'))_0x28a728=null;return this[_0x5b4b('0x9')](_0x5b4b('0x11'),_0x28a728);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 3c22a2f..e0e5c69 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 _0x147a=['tag','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','offset','limit','undefined','count','set','json','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','service','authentication','Imap','Smtp','port','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','MailAccount','show','params','keys','length','include','find','body','custom','provider','secure','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','pick','findAll','rows','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','email','isNil','active','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color'];(function(_0x4bc78e,_0x4f6f3a){var _0x50fbdb=function(_0x209891){while(--_0x209891){_0x4bc78e['push'](_0x4bc78e['shift']());}};_0x50fbdb(++_0x4f6f3a);}(_0x147a,0xf0));var _0xa147=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x147a[_0x23c6f2];return _0x4c270b;};'use strict';var moment=require(_0xa147('0x0'));var BPromise=require(_0xa147('0x1'));var util=require('util');var path=require(_0xa147('0x2'));var _=require(_0xa147('0x3'));var juice=require('juice');var Redis=require(_0xa147('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xa147('0x5'))(_0xa147('0x6'));var config=require(_0xa147('0x7'));var db=require(_0xa147('0x8'))['db'];config['redis']=_[_0xa147('0x9')](config['redis'],{'host':_0xa147('0xa'),'port':0x18eb});var socket=require(_0xa147('0xb'))(new Redis(config[_0xa147('0xc')]));require(_0xa147('0xd'))[_0xa147('0xe')](socket);var jayson=require(_0xa147('0xf'));var client=jayson[_0xa147('0x10')][_0xa147('0x11')]({'port':0x232b});function respondWithRpcPromise(_0xa2bdbd,_0x54ab0d,_0x5374ba,_0x5f0241){return new BPromise(function(_0x109482,_0x38494c){var _0x28b821=_0x5f0241||client;return _0x28b821[_0xa147('0x12')](_0xa2bdbd,_0x5374ba)[_0xa147('0x13')](function(_0x4e2acb){logger['info'](_0xa147('0x14'),_0x54ab0d,_0xa147('0x15'));logger[_0xa147('0x16')](_0xa147('0x17'),_0x54ab0d,_0xa147('0x15'),JSON[_0xa147('0x18')](_0x4e2acb));if(_0x4e2acb[_0xa147('0x19')]){if(_0x4e2acb[_0xa147('0x19')][_0xa147('0x1a')]===0x1f4){logger[_0xa147('0x19')](_0xa147('0x14'),_0x54ab0d,_0x4e2acb[_0xa147('0x19')][_0xa147('0x1b')]);return _0x38494c(_0x4e2acb['error'][_0xa147('0x1b')]);}logger[_0xa147('0x19')]('MailAccount,\x20%s,\x20%s',_0x54ab0d,_0x4e2acb[_0xa147('0x19')][_0xa147('0x1b')]);return _0x109482(_0x4e2acb[_0xa147('0x19')][_0xa147('0x1b')]);}else{logger[_0xa147('0x1c')](_0xa147('0x14'),_0x54ab0d,_0xa147('0x15'));_0x109482(_0x4e2acb[_0xa147('0x1d')]['message']);}})[_0xa147('0x1e')](function(_0x160ab6){logger[_0xa147('0x19')](_0xa147('0x14'),_0x54ab0d,_0x160ab6);_0x38494c(_0x160ab6);});});}function respondWithStatusCode(_0x300601,_0x300981){_0x300981=_0x300981||0xcc;return function(_0x307828){if(_0x307828){return _0x300601[_0xa147('0x1f')](_0x300981);}return _0x300601['status'](_0x300981)['end']();};}function respondWithResult(_0xe4c654,_0x52e888){_0x52e888=_0x52e888||0xc8;return function(_0xc6f84d){if(_0xc6f84d){return _0xe4c654[_0xa147('0x20')](_0x52e888)['json'](_0xc6f84d);}};}function respondWithFilteredResult(_0x18163e,_0x48629a){return function(_0x38e34a){if(_0x38e34a){var _0x22180a=typeof _0x48629a[_0xa147('0x21')]==='undefined'&&typeof _0x48629a[_0xa147('0x22')]===_0xa147('0x23');var _0x1f4a13=_0x38e34a[_0xa147('0x24')];var _0x2a6b2f=_0x22180a?0x0:_0x48629a[_0xa147('0x21')];var _0x5c25ff=_0x22180a?_0x38e34a[_0xa147('0x24')]:_0x48629a[_0xa147('0x21')]+_0x48629a[_0xa147('0x22')];var _0x13a625;if(_0x5c25ff>=_0x1f4a13){_0x5c25ff=_0x1f4a13;_0x13a625=0xc8;}else{_0x13a625=0xce;}_0x18163e[_0xa147('0x20')](_0x13a625);return _0x18163e[_0xa147('0x25')]('Content-Range',_0x2a6b2f+'-'+_0x5c25ff+'/'+_0x1f4a13)[_0xa147('0x26')](_0x38e34a);}return null;};}function saveUpdates(_0x202237){return function(_0x257ab2){if(_0x257ab2){return _0x257ab2[_0xa147('0x27')](_0x202237)[_0xa147('0x13')](function(_0xc32728){return _0xc32728;});}return null;};}function removeEntity(_0x544208){return function(_0x535fe3){if(_0x535fe3){return _0x535fe3[_0xa147('0x28')]()[_0xa147('0x13')](function(){var _0x1cc25d=_0x535fe3[_0xa147('0x29')]({'plain':!![]});var _0x1925e0=_0xa147('0x2a');return db[_0xa147('0x2b')][_0xa147('0x28')]({'where':{'type':_0x1925e0,'resourceId':_0x1cc25d['id']}})[_0xa147('0x13')](function(){return _0x535fe3;});})[_0xa147('0x13')](function(){_0x544208[_0xa147('0x20')](0xcc)[_0xa147('0x2c')]();});}};}function handleEntityNotFound(_0x1f29d3){return function(_0x45fc39){if(!_0x45fc39){_0x1f29d3['sendStatus'](0x194);}return _0x45fc39;};}function handleError(_0x49ac39,_0x499b2a){_0x499b2a=_0x499b2a||0x1f4;return function(_0x535b16){logger[_0xa147('0x19')](_0x535b16[_0xa147('0x2d')]);if(_0x535b16[_0xa147('0x2e')]){delete _0x535b16[_0xa147('0x2e')];}_0x49ac39[_0xa147('0x20')](_0x499b2a)[_0xa147('0x2f')](_0x535b16);};}function getImapHost(_0x18dfd2){switch(_0x18dfd2){case'gmail':return'imap.gmail.com';case _0xa147('0x30'):return _0xa147('0x31');case'hotmail':return _0xa147('0x32');case _0xa147('0x33'):return _0xa147('0x34');}throw new Error(_0xa147('0x35'),_0x18dfd2);}function getSmtpHost(_0x42d957){switch(_0x42d957){case _0xa147('0x36'):return _0xa147('0x37');case _0xa147('0x30'):return _0xa147('0x38');case'hotmail':return _0xa147('0x39');case _0xa147('0x33'):return _0xa147('0x3a');}throw new Error(_0xa147('0x35'),_0x42d957);}function getAuthenticationOptions(_0x8078de,_0x431b6d){var _0x2b91e3={};var _0x3e5d9e={};if(_0x8078de){_0x2b91e3[_0xa147('0x3b')]=_0x3e5d9e[_0xa147('0x3b')]=_0x431b6d[_0xa147('0x3c')];_0x2b91e3[_0xa147('0x3d')]=_0x3e5d9e[_0xa147('0x3e')]=_0x431b6d[_0xa147('0x3d')];if(_0x431b6d[_0xa147('0x3f')]){_0x2b91e3[_0xa147('0x3f')]=_0x3e5d9e[_0xa147('0x3f')]=!![];_0x2b91e3['CloudProviderId']=_0x3e5d9e[_0xa147('0x40')]=_0x431b6d[_0xa147('0x40')];_0x2b91e3['password']=_0x3e5d9e[_0xa147('0x3e')]=null;}else{_0x2b91e3[_0xa147('0x40')]=_0x3e5d9e['CloudProviderId']=null;}_0x2b91e3[_0xa147('0x41')]=getImapHost(_0x8078de);_0x2b91e3['port']=0x3e1;_0x3e5d9e[_0xa147('0x41')]=getSmtpHost(_0x8078de);_0x3e5d9e['port']=0x24b;_0x3e5d9e['secure']=![];_0x2b91e3['service']=_0x3e5d9e[_0xa147('0x42')]=null;}else{if(_0x431b6d[_0xa147('0x43')]){_0x2b91e3[_0xa147('0x3b')]=_0x3e5d9e[_0xa147('0x3b')]=_0x431b6d[_0xa147('0x3c')];_0x2b91e3[_0xa147('0x3d')]=_0x3e5d9e['pass']=_0x431b6d[_0xa147('0x3d')];}else{_0x2b91e3[_0xa147('0x43')]=_0x3e5d9e[_0xa147('0x43')]=![];_0x2b91e3[_0xa147('0x3b')]=_0x3e5d9e[_0xa147('0x3b')]=null;_0x2b91e3[_0xa147('0x3d')]=_0x3e5d9e[_0xa147('0x3e')]=null;}_0x2b91e3[_0xa147('0x41')]=_0x431b6d['Imap'][_0xa147('0x41')];_0x2b91e3['port']=_0x431b6d[_0xa147('0x44')]['port'];_0x3e5d9e[_0xa147('0x41')]=_0x431b6d[_0xa147('0x45')]['host'];_0x3e5d9e[_0xa147('0x46')]=_0x431b6d[_0xa147('0x45')]['port'];}return{'Imap':_0x2b91e3,'Smtp':_0x3e5d9e};}exports['index']=function(_0x1b29b5,_0x39042f){var _0x3f4d51={'include':[{'model':db[_0xa147('0x47')],'as':_0xa147('0x44')},{'model':db[_0xa147('0x48')],'as':_0xa147('0x45')},{'model':db[_0xa147('0x49')],'as':_0xa147('0x4a')}]},_0x38396c={},_0x508d37={'count':0x0,'rows':[]};var _0x5c4e6c=_['map'](db['MailAccount'][_0xa147('0x4b')],function(_0x5074c0){return{'name':_0x5074c0['fieldName'],'type':_0x5074c0[_0xa147('0x4c')][_0xa147('0x4d')]};});_0x38396c[_0xa147('0x4e')]=_[_0xa147('0x4f')](_0x5c4e6c,_0xa147('0x2e'));_0x38396c[_0xa147('0x50')]=_['keys'](_0x1b29b5[_0xa147('0x50')]);_0x38396c['filters']=_[_0xa147('0x51')](_0x38396c[_0xa147('0x4e')],_0x38396c[_0xa147('0x50')]);_0x3f4d51[_0xa147('0x52')]=_[_0xa147('0x51')](_0x38396c[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x1b29b5['query']['fields']));_0x3f4d51['attributes']=_0x3f4d51[_0xa147('0x52')]['length']?_0x3f4d51[_0xa147('0x52')]:_0x38396c['model'];if(!_0x1b29b5[_0xa147('0x50')][_0xa147('0x54')](_0xa147('0x55'))){_0x3f4d51[_0xa147('0x22')]=qs[_0xa147('0x22')](_0x1b29b5[_0xa147('0x50')][_0xa147('0x22')]);_0x3f4d51[_0xa147('0x21')]=qs['offset'](_0x1b29b5[_0xa147('0x50')][_0xa147('0x21')]);}_0x3f4d51[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x1b29b5['query'][_0xa147('0x57')]);_0x3f4d51[_0xa147('0x58')]=qs['filters'](_['pick'](_0x1b29b5['query'],_0x38396c[_0xa147('0x59')]),_0x5c4e6c);if(_0x1b29b5[_0xa147('0x50')]['filter']){_0x3f4d51[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x3f4d51[_0xa147('0x58')],{'$or':_['map'](_0x5c4e6c,function(_0x528fd0){if(_0x528fd0['type']!=='VIRTUAL'){var _0x228161={};_0x228161[_0x528fd0[_0xa147('0x2e')]]={'$like':'%'+_0x1b29b5[_0xa147('0x50')][_0xa147('0x5b')]+'%'};return _0x228161;}})});}_0x3f4d51=_[_0xa147('0x5a')]({},_0x3f4d51,_0x1b29b5[_0xa147('0x5c')]);var _0x2861e3={'where':_0x3f4d51[_0xa147('0x58')]};return db['MailAccount']['count'](_0x2861e3)[_0xa147('0x13')](function(_0x5739f5){_0x508d37[_0xa147('0x24')]=_0x5739f5;if(_0x1b29b5[_0xa147('0x50')][_0xa147('0x5d')]){_0x3f4d51['include']=[{'all':!![]}];}return db[_0xa147('0x5e')]['findAll'](_0x3f4d51);})[_0xa147('0x13')](function(_0x827800){_0x508d37['rows']=_0x827800;return _0x508d37;})['then'](respondWithFilteredResult(_0x39042f,_0x3f4d51))[_0xa147('0x1e')](handleError(_0x39042f,null));};exports[_0xa147('0x5f')]=function(_0xae230c,_0x6f101){var _0x86f20a={'raw':![],'where':{'id':_0xae230c[_0xa147('0x60')]['id']},'include':[{'model':db[_0xa147('0x47')],'as':_0xa147('0x44')},{'model':db[_0xa147('0x48')],'as':_0xa147('0x45')},{'model':db[_0xa147('0x49')],'as':_0xa147('0x4a')}]},_0x552cdd={};_0x552cdd['model']=_['keys'](db[_0xa147('0x5e')][_0xa147('0x4b')]);_0x552cdd['query']=_[_0xa147('0x61')](_0xae230c[_0xa147('0x50')]);_0x552cdd['filters']=_[_0xa147('0x51')](_0x552cdd[_0xa147('0x4e')],_0x552cdd[_0xa147('0x50')]);_0x86f20a[_0xa147('0x52')]=_[_0xa147('0x51')](_0x552cdd['model'],qs[_0xa147('0x53')](_0xae230c['query'][_0xa147('0x53')]));_0x86f20a[_0xa147('0x52')]=_0x86f20a[_0xa147('0x52')][_0xa147('0x62')]?_0x86f20a[_0xa147('0x52')]:_0x552cdd[_0xa147('0x4e')];if(_0xae230c['query'][_0xa147('0x5d')]){_0x86f20a[_0xa147('0x63')]=[{'all':!![]}];}_0x86f20a=_[_0xa147('0x5a')]({},_0x86f20a,_0xae230c[_0xa147('0x5c')]);return db[_0xa147('0x5e')][_0xa147('0x64')](_0x86f20a)[_0xa147('0x13')](handleEntityNotFound(_0x6f101,null))['then'](respondWithResult(_0x6f101,null))['catch'](handleError(_0x6f101,null));};exports[_0xa147('0x27')]=function(_0x2891c0,_0x3b898b){if(_0x2891c0['body']['id']){delete _0x2891c0[_0xa147('0x65')]['id'];}var _0x542006=_0x2891c0[_0xa147('0x65')]['provider']===_0xa147('0x66')?null:_0x2891c0[_0xa147('0x65')][_0xa147('0x67')];var _0x10eb70=_0x2891c0['body'][_0xa147('0x44')]||{};var _0x39228e=_0x2891c0['body'][_0xa147('0x45')]||{};if(_0x542006){_0x10eb70[_0xa147('0x41')]=getImapHost(_0x542006);_0x10eb70[_0xa147('0x46')]=0x3e1;_0x39228e[_0xa147('0x41')]=getSmtpHost(_0x542006);_0x39228e[_0xa147('0x46')]=0x24b;_0x39228e[_0xa147('0x68')]=![];}if(_0x39228e[_0xa147('0x3f')]){_0x39228e[_0xa147('0x68')]=![];}else{_0x39228e[_0xa147('0x40')]=null;}if(!_0x10eb70['modernAuthentication'])_0x10eb70['CloudProviderId']=null;_0x2891c0[_0xa147('0x65')][_0xa147('0x44')]=_0x10eb70;_0x2891c0[_0xa147('0x65')][_0xa147('0x45')]=_0x39228e;return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x2891c0[_0xa147('0x60')]['id']},'include':[{'model':db[_0xa147('0x47')],'as':_0xa147('0x44')},{'model':db[_0xa147('0x48')],'as':_0xa147('0x45')},{'model':db[_0xa147('0x49')],'as':_0xa147('0x4a')}]})['then'](handleEntityNotFound(_0x3b898b,null))[_0xa147('0x13')](function(_0x4c09f5){if(!_0x4c09f5)throw new Error('Mail\x20Account\x20not\x20found');if(_0x4c09f5[_0xa147('0x42')])delete _0x2891c0[_0xa147('0x65')][_0xa147('0x44')];return _0x4c09f5;})[_0xa147('0x13')](saveUpdates(_0x2891c0['body'],null))[_0xa147('0x13')](function(_0x331946){if(!_0x2891c0[_0xa147('0x65')][_0xa147('0x44')])return _0x331946;return db[_0xa147('0x47')]['update'](_0x2891c0[_0xa147('0x65')]['Imap'],{'where':{'MailAccountId':_0x331946['id']}})[_0xa147('0x13')](function(){return _0x331946;});})[_0xa147('0x13')](function(_0x543649){if(!_0x2891c0[_0xa147('0x65')][_0xa147('0x45')])return _0x543649;return db['MailServerOut'][_0xa147('0x27')](_0x2891c0[_0xa147('0x65')]['Smtp'],{'where':{'MailAccountId':_0x543649['id']}})[_0xa147('0x13')](function(){return _0x543649;});})[_0xa147('0x13')](respondWithResult(_0x3b898b,null))[_0xa147('0x1e')](handleError(_0x3b898b,null));};exports[_0xa147('0x69')]=function(_0xd13422,_0x445de0){return db[_0xa147('0x5e')]['describe']()['then'](respondWithResult(_0x445de0,null))[_0xa147('0x1e')](handleError(_0x445de0,null));};exports[_0xa147('0x6a')]=function(_0x393529,_0x4fb94c){if(_0x393529[_0xa147('0x65')]['id']){delete _0x393529[_0xa147('0x65')]['id'];}return db['MailAccount'][_0xa147('0x64')]({'where':{'id':_0x393529[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x4fb94c,null))[_0xa147('0x13')](function(_0x15cb6b){if(_0x15cb6b){_0x393529[_0xa147('0x65')][_0xa147('0x6b')]=_0x15cb6b['id'];return db[_0xa147('0x6c')][_0xa147('0x6d')](_0x393529[_0xa147('0x65')]);}})['then'](respondWithResult(_0x4fb94c,null))['catch'](handleError(_0x4fb94c,null));};exports[_0xa147('0x6e')]=function(_0x2e2329,_0x2607dc){var _0x48db6b={'raw':![],'where':{}};var _0x15634f={};var _0x376dc5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x2e2329[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x2607dc,null))[_0xa147('0x13')](function(_0x2c8b7c){if(_0x2c8b7c){_0x15634f[_0xa147('0x4e')]=_[_0xa147('0x61')](db[_0xa147('0x6c')][_0xa147('0x4b')]);_0x15634f[_0xa147('0x50')]=_['keys'](_0x2e2329[_0xa147('0x50')]);_0x15634f[_0xa147('0x59')]=_[_0xa147('0x51')](_0x15634f[_0xa147('0x4e')],_0x15634f[_0xa147('0x50')]);_0x48db6b['attributes']=_[_0xa147('0x51')](_0x15634f[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x2e2329[_0xa147('0x50')][_0xa147('0x53')]));_0x48db6b[_0xa147('0x52')]=_0x48db6b[_0xa147('0x52')]['length']?_0x48db6b['attributes']:_0x15634f[_0xa147('0x4e')];if(!_0x2e2329[_0xa147('0x50')][_0xa147('0x54')](_0xa147('0x55'))){_0x48db6b[_0xa147('0x22')]=qs[_0xa147('0x22')](_0x2e2329['query']['limit']);_0x48db6b[_0xa147('0x21')]=qs[_0xa147('0x21')](_0x2e2329[_0xa147('0x50')][_0xa147('0x21')]);}_0x48db6b[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x2e2329[_0xa147('0x50')][_0xa147('0x57')]);_0x48db6b[_0xa147('0x58')]=qs['filters'](_[_0xa147('0x6f')](_0x2e2329[_0xa147('0x50')],_0x15634f[_0xa147('0x59')]));_0x48db6b[_0xa147('0x58')][_0xa147('0x6b')]=_0x2c8b7c['id'];if(_0x2e2329['query'][_0xa147('0x5b')]){_0x48db6b[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x48db6b['where'],{'$or':_[_0xa147('0x4f')](_0x48db6b[_0xa147('0x52')],function(_0x44a995){var _0x1795a8={};_0x1795a8[_0x44a995]={'$like':'%'+_0x2e2329['query'][_0xa147('0x5b')]+'%'};return _0x1795a8;})});}_0x48db6b=_[_0xa147('0x5a')]({},_0x48db6b,_0x2e2329[_0xa147('0x5c')]);return db[_0xa147('0x6c')][_0xa147('0x24')]({'where':_0x48db6b[_0xa147('0x58')]})[_0xa147('0x13')](function(_0x28adcf){_0x376dc5[_0xa147('0x24')]=_0x28adcf;if(_0x2e2329['query'][_0xa147('0x5d')]){_0x48db6b[_0xa147('0x63')]=[{'all':!![]}];}return db[_0xa147('0x6c')][_0xa147('0x70')](_0x48db6b);})[_0xa147('0x13')](function(_0x8ae493){_0x376dc5[_0xa147('0x71')]=_0x8ae493;return _0x376dc5;});}})[_0xa147('0x13')](respondWithFilteredResult(_0x2607dc,_0x48db6b))[_0xa147('0x1e')](handleError(_0x2607dc,null));};exports['removeDispositions']=function(_0x4aed8a,_0x484837){return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x4aed8a[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x484837,null))[_0xa147('0x13')](function(_0x80eddd){if(_0x80eddd){return _0x80eddd['removeDispositions'](_0x4aed8a['query'][_0xa147('0x72')]);}})[_0xa147('0x13')](respondWithStatusCode(_0x484837,null))[_0xa147('0x1e')](handleError(_0x484837,null));};exports[_0xa147('0x73')]=function(_0x2a3c67,_0x43a796){if(_0x2a3c67[_0xa147('0x65')]['id']){delete _0x2a3c67['body']['id'];}return db['MailAccount'][_0xa147('0x64')]({'where':{'id':_0x2a3c67[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x43a796,null))['then'](function(_0x148099){if(_0x148099){_0x2a3c67[_0xa147('0x65')]['MailAccountId']=_0x148099['id'];return db['CannedAnswer'][_0xa147('0x6d')](_0x2a3c67[_0xa147('0x65')]);}})[_0xa147('0x13')](respondWithResult(_0x43a796,null))[_0xa147('0x1e')](handleError(_0x43a796,null));};exports[_0xa147('0x74')]=function(_0x3b8ba3,_0x44eb95){var _0x487220={'raw':![],'where':{}};var _0x5b10ed={};var _0x1ba9ec={'count':0x0,'rows':[]};return db['MailAccount'][_0xa147('0x75')]({'where':{'id':_0x3b8ba3[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x44eb95,null))[_0xa147('0x13')](function(_0x5218a5){if(_0x5218a5){_0x5b10ed[_0xa147('0x4e')]=_[_0xa147('0x61')](db[_0xa147('0x76')][_0xa147('0x4b')]);_0x5b10ed[_0xa147('0x50')]=_[_0xa147('0x61')](_0x3b8ba3[_0xa147('0x50')]);_0x5b10ed[_0xa147('0x59')]=_[_0xa147('0x51')](_0x5b10ed[_0xa147('0x4e')],_0x5b10ed[_0xa147('0x50')]);_0x487220[_0xa147('0x52')]=_[_0xa147('0x51')](_0x5b10ed['model'],qs[_0xa147('0x53')](_0x3b8ba3['query'][_0xa147('0x53')]));_0x487220[_0xa147('0x52')]=_0x487220[_0xa147('0x52')][_0xa147('0x62')]?_0x487220[_0xa147('0x52')]:_0x5b10ed['model'];if(!_0x3b8ba3[_0xa147('0x50')][_0xa147('0x54')]('nolimit')){_0x487220[_0xa147('0x22')]=qs[_0xa147('0x22')](_0x3b8ba3[_0xa147('0x50')]['limit']);_0x487220[_0xa147('0x21')]=qs[_0xa147('0x21')](_0x3b8ba3['query'][_0xa147('0x21')]);}_0x487220[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x3b8ba3['query'][_0xa147('0x57')]);_0x487220['where']=qs['filters'](_['pick'](_0x3b8ba3[_0xa147('0x50')],_0x5b10ed[_0xa147('0x59')]));_0x487220['where'][_0xa147('0x6b')]=_0x5218a5['id'];if(_0x3b8ba3['query'][_0xa147('0x5b')]){_0x487220[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x487220[_0xa147('0x58')],{'$or':_[_0xa147('0x4f')](_0x487220[_0xa147('0x52')],function(_0x359eab){var _0x3ec7e7={};_0x3ec7e7[_0x359eab]={'$like':'%'+_0x3b8ba3[_0xa147('0x50')][_0xa147('0x5b')]+'%'};return _0x3ec7e7;})});}_0x487220=_[_0xa147('0x5a')]({},_0x487220,_0x3b8ba3['options']);return db[_0xa147('0x76')][_0xa147('0x24')]({'where':_0x487220[_0xa147('0x58')]})[_0xa147('0x13')](function(_0x5228c4){_0x1ba9ec[_0xa147('0x24')]=_0x5228c4;if(_0x3b8ba3[_0xa147('0x50')]['includeAll']){_0x487220['include']=[{'all':!![]}];}return db[_0xa147('0x76')][_0xa147('0x70')](_0x487220);})[_0xa147('0x13')](function(_0x1be898){_0x1ba9ec[_0xa147('0x71')]=_0x1be898;return _0x1ba9ec;});}})['then'](respondWithFilteredResult(_0x44eb95,_0x487220))[_0xa147('0x1e')](handleError(_0x44eb95,null));};exports[_0xa147('0x77')]=function(_0x45fd2e,_0x277436){return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x45fd2e['params']['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x277436,null))[_0xa147('0x13')](function(_0x18a9ce){if(_0x18a9ce){return _0x18a9ce[_0xa147('0x77')](_0x45fd2e['query']['ids']);}})['then'](respondWithStatusCode(_0x277436,null))[_0xa147('0x1e')](handleError(_0x277436,null));};exports[_0xa147('0x6d')]=function(_0x21ca9d,_0x5f47eb){var _0x4ad333={'name':_0x21ca9d[_0xa147('0x65')][_0xa147('0x2e')],'key':_0x21ca9d['body']['key'],'provider':_0x21ca9d['body'][_0xa147('0x67')]==='custom'?null:_0x21ca9d[_0xa147('0x65')][_0xa147('0x67')],'email':_0x21ca9d[_0xa147('0x65')][_0xa147('0x78')],'ListId':_0x21ca9d[_0xa147('0x65')]['ListId'],'active':!_[_0xa147('0x79')](_0x21ca9d[_0xa147('0x65')]['active'])?_0x21ca9d['body'][_0xa147('0x7a')]:!![],'description':_0x21ca9d[_0xa147('0x65')]['description']||null};var _0xdbefd7=getAuthenticationOptions(_0x4ad333[_0xa147('0x67')],_0x21ca9d[_0xa147('0x65')]);_0x4ad333['Imap']=_0xdbefd7['Imap'];_0x4ad333[_0xa147('0x45')]=_0xdbefd7[_0xa147('0x45')];return db[_0xa147('0x5e')]['create'](_0x4ad333,{'include':[{'model':db[_0xa147('0x48')],'as':_0xa147('0x45')},{'model':db[_0xa147('0x47')],'as':_0xa147('0x44')}]})['then'](function(_0x5c8845){var _0x41244f=_0x21ca9d[_0xa147('0x3b')][_0xa147('0x29')]({'plain':!![]});if(!_0x41244f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41244f['role']===_0xa147('0x3b')){var _0x152a96=_0x5c8845[_0xa147('0x29')]({'plain':!![]});return db[_0xa147('0x7b')][_0xa147('0x64')]({'where':{'name':_0xa147('0x2a'),'userProfileId':_0x41244f['userProfileId']},'raw':!![]})[_0xa147('0x13')](function(_0x7f1c77){if(_0x7f1c77&&_0x7f1c77[_0xa147('0x7c')]===0x0){return db[_0xa147('0x2b')][_0xa147('0x6d')]({'name':_0x152a96[_0xa147('0x2e')],'resourceId':_0x152a96['id'],'type':_0x7f1c77[_0xa147('0x2e')],'sectionId':_0x7f1c77['id']},{})[_0xa147('0x13')](function(){return _0x5c8845;});}else{return _0x5c8845;}})[_0xa147('0x1e')](function(_0x170bd4){logger['error'](_0xa147('0x7d'),_0x170bd4);throw _0x170bd4;});}return _0x5c8845;})[_0xa147('0x13')](respondWithResult(_0x5f47eb,0xc9))[_0xa147('0x1e')](handleError(_0x5f47eb,null));};exports[_0xa147('0x7e')]=function(_0x2cd1ff,_0x132217){return db[_0xa147('0x5e')][_0xa147('0x75')]({'where':{'id':_0x2cd1ff[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x132217,null))[_0xa147('0x13')](function(_0x9933c9){if(_0x9933c9){return _0x9933c9[_0xa147('0x7e')]();}return null;})[_0xa147('0x13')](respondWithResult(_0x132217,null))[_0xa147('0x1e')](handleError(_0x132217,null));};exports['addImap']=function(_0x5344be,_0x4c5d61){if(_0x5344be[_0xa147('0x65')]['id']){delete _0x5344be[_0xa147('0x65')]['id'];}return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x5344be[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x4c5d61,null))[_0xa147('0x13')](function(_0x9c8993){if(_0x9c8993){_0x5344be[_0xa147('0x65')][_0xa147('0x6b')]=_0x9c8993['id'];return db[_0xa147('0x47')]['create'](_0x5344be[_0xa147('0x65')]);}})[_0xa147('0x13')](respondWithResult(_0x4c5d61,null))['catch'](handleError(_0x4c5d61,null));};exports[_0xa147('0x7f')]=function(_0x1f917c,_0x3a0d57){return db[_0xa147('0x5e')][_0xa147('0x75')]({'where':{'id':_0x1f917c[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x3a0d57,null))[_0xa147('0x13')](function(_0x22bea5){if(_0x22bea5){return _0x22bea5[_0xa147('0x80')](null);}return null;})[_0xa147('0x13')](respondWithStatusCode(_0x3a0d57,null))['catch'](handleError(_0x3a0d57,null));};exports[_0xa147('0x81')]=function(_0x4e8853,_0x110e93){return db[_0xa147('0x5e')][_0xa147('0x75')]({'where':{'id':_0x4e8853[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x110e93,null))['then'](function(_0x10d2d5){if(_0x10d2d5){return _0x10d2d5[_0xa147('0x81')]();}return null;})[_0xa147('0x13')](respondWithResult(_0x110e93,null))[_0xa147('0x1e')](handleError(_0x110e93,null));};exports[_0xa147('0x82')]=function(_0x16b222,_0x57517c){if(_0x16b222['body']['id']){delete _0x16b222[_0xa147('0x65')]['id'];}return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x16b222['params']['id']}})['then'](handleEntityNotFound(_0x57517c,null))[_0xa147('0x13')](function(_0x494df4){if(_0x494df4){_0x16b222[_0xa147('0x65')][_0xa147('0x6b')]=_0x494df4['id'];return db[_0xa147('0x48')][_0xa147('0x6d')](_0x16b222[_0xa147('0x65')]);}})[_0xa147('0x13')](respondWithResult(_0x57517c,null))[_0xa147('0x1e')](handleError(_0x57517c,null));};exports[_0xa147('0x83')]=function(_0xebf484,_0x2398a0){return db['MailAccount']['findOne']({'where':{'id':_0xebf484[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x2398a0,null))[_0xa147('0x13')](function(_0x3ee0fe){if(_0x3ee0fe){return _0x3ee0fe[_0xa147('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x2398a0,null))[_0xa147('0x1e')](handleError(_0x2398a0,null));};exports[_0xa147('0x85')]=function(_0xc45d42,_0x24114d){return db[_0xa147('0x86')]['find']({'where':{'id':_0xc45d42[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x24114d,null))['then'](function(_0x362db7){if(_0x362db7){return _0x362db7[_0xa147('0x85')](_0xc45d42[_0xa147('0x65')][_0xa147('0x72')],_[_0xa147('0x87')](_0xc45d42[_0xa147('0x65')],[_0xa147('0x72'),'id'])||{});}})[_0xa147('0x13')](respondWithResult(_0x24114d,null))['catch'](handleError(_0x24114d,null));};exports[_0xa147('0x88')]=function(_0x3ebc34,_0x206810){var _0x318d85={'raw':![],'where':{}};var _0x3c590d={};var _0x4c2240={'count':0x0,'rows':[]};return db[_0xa147('0x5e')][_0xa147('0x75')]({'where':{'id':_0x3ebc34[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x206810,null))['then'](function(_0x3285a9){if(_0x3285a9){_0x3c590d[_0xa147('0x4e')]=_[_0xa147('0x61')](db[_0xa147('0x86')]['rawAttributes']);_0x3c590d['query']=_['keys'](_0x3ebc34[_0xa147('0x50')]);_0x3c590d[_0xa147('0x59')]=_[_0xa147('0x51')](_0x3c590d[_0xa147('0x4e')],_0x3c590d[_0xa147('0x50')]);_0x318d85[_0xa147('0x52')]=_[_0xa147('0x51')](_0x3c590d[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x3ebc34[_0xa147('0x50')]['fields']));_0x318d85['attributes']=_0x318d85[_0xa147('0x52')][_0xa147('0x62')]?_0x318d85['attributes']:_0x3c590d[_0xa147('0x4e')];if(!_0x3ebc34['query'][_0xa147('0x54')](_0xa147('0x55'))){_0x318d85[_0xa147('0x22')]=qs[_0xa147('0x22')](_0x3ebc34['query'][_0xa147('0x22')]);_0x318d85[_0xa147('0x21')]=qs[_0xa147('0x21')](_0x3ebc34['query']['offset']);}_0x318d85[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x3ebc34[_0xa147('0x50')][_0xa147('0x57')]);_0x318d85[_0xa147('0x58')]=qs[_0xa147('0x59')](_[_0xa147('0x6f')](_0x3ebc34[_0xa147('0x50')],_0x3c590d[_0xa147('0x59')]));_0x318d85['where']['MailAccountId']=_0x3285a9['id'];if(_0x3ebc34[_0xa147('0x50')][_0xa147('0x5b')]){_0x318d85[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x318d85['where'],{'$or':_['map'](_0x318d85[_0xa147('0x52')],function(_0x3b4126){var _0x42f2ce={};_0x42f2ce[_0x3b4126]={'$like':'%'+_0x3ebc34[_0xa147('0x50')]['filter']+'%'};return _0x42f2ce;})});}_0x318d85=_['merge']({},_0x318d85,_0x3ebc34[_0xa147('0x5c')]);return db[_0xa147('0x86')][_0xa147('0x24')]({'where':_0x318d85[_0xa147('0x58')]})[_0xa147('0x13')](function(_0x149053){_0x4c2240['count']=_0x149053;if(_0x3ebc34['query'][_0xa147('0x5d')]){_0x318d85[_0xa147('0x63')]=[{'model':db[_0xa147('0x89')],'as':_0xa147('0x8a'),'required':![]},{'model':db[_0xa147('0x8b')],'as':_0xa147('0x8c'),'attributes':[_0xa147('0x2e'),_0xa147('0x8d'),_0xa147('0x8e')],'required':![]},{'model':db[_0xa147('0x8f')],'as':_0xa147('0x90'),'attributes':['id',_0xa147('0x2e'),_0xa147('0x91')],'where':_0x3ebc34[_0xa147('0x50')]['tag']?{'id':_0x3ebc34[_0xa147('0x50')][_0xa147('0x92')]}:undefined,'required':_0x3ebc34['query'][_0xa147('0x92')]?!![]:![]}];}return db[_0xa147('0x86')][_0xa147('0x70')](_0x318d85);})[_0xa147('0x13')](function(_0x5e0c9f){_0x4c2240[_0xa147('0x71')]=_0x5e0c9f;return _0x4c2240;});}})[_0xa147('0x13')](respondWithFilteredResult(_0x206810,_0x318d85))[_0xa147('0x1e')](handleError(_0x206810,null));};exports['addApplications']=function addApplications(_0x2dcac4,_0x191206){var _0x2be5d5=_0x2dcac4[_0xa147('0x60')]['id'];var _0x915fdf=_0x2dcac4[_0xa147('0x65')];var _0x2562ed=0xc8;var _0x3a68aa=null;return db[_0xa147('0x93')]['transaction']({'isolationLevel':db[_0xa147('0x93')][_0xa147('0x94')]['ISOLATION_LEVELS'][_0xa147('0x95')]},function(_0x3a856d){return db['MailAccount'][_0xa147('0x75')]({'where':{'id':_0x2be5d5},'transaction':_0x3a856d})[_0xa147('0x13')](function(_0x2d8413){if(_0x2d8413){return db[_0xa147('0x96')][_0xa147('0x28')]({'where':{'MailAccountId':_0x2be5d5},'transaction':_0x3a856d})['then'](function(){var _0x385ede=_[_0xa147('0x4f')](_0x915fdf,function(_0x1edfdb){_0x1edfdb[_0xa147('0x6b')]=_0x2be5d5;return _0x1edfdb;});return db[_0xa147('0x96')][_0xa147('0x97')](_0x385ede,{'transaction':_0x3a856d});});}else{_0x2562ed=0x194;_0x3a68aa=[];}});})[_0xa147('0x13')](function(){if(_0x2562ed!==0x194){return db[_0xa147('0x96')][_0xa147('0x98')]({'where':{'MailAccountId':_0x2be5d5},'order':_0xa147('0x99')})[_0xa147('0x13')](function(_0xf08e2b){_0x3a68aa=_0xf08e2b;});}})['catch'](function(_0x23228b){_0x2562ed=0x1f4;logger['error'](_0x23228b[_0xa147('0x2d')]);if(_0x23228b[_0xa147('0x2e')]){delete _0x23228b['name'];}_0x3a68aa=_0x23228b;})['finally'](function(){if(_0x3a68aa===null){_0x191206['sendStatus'](_0x2562ed);}else{if(_0x2562ed===0x1f4){_0x191206[_0xa147('0x20')](_0x2562ed)[_0xa147('0x2f')](_0x3a68aa);}else{_0x191206[_0xa147('0x20')](_0x2562ed)[_0xa147('0x26')](_0x3a68aa);}}});};exports[_0xa147('0x9a')]=function(_0x4afe4a,_0xa34c20){var _0x1d9ea3={};var _0x4b747d={};var _0x33a83c;var _0x5a464;return db[_0xa147('0x5e')][_0xa147('0x75')]({'where':{'id':_0x4afe4a['params']['id']}})[_0xa147('0x13')](handleEntityNotFound(_0xa34c20,null))[_0xa147('0x13')](function(_0x18d78b){if(_0x18d78b){_0x33a83c=_0x18d78b;_0x4b747d[_0xa147('0x4e')]=_[_0xa147('0x61')](db[_0xa147('0x96')][_0xa147('0x4b')]);_0x4b747d[_0xa147('0x50')]=_[_0xa147('0x61')](_0x4afe4a[_0xa147('0x50')]);_0x4b747d[_0xa147('0x59')]=_[_0xa147('0x51')](_0x4b747d[_0xa147('0x4e')],_0x4b747d[_0xa147('0x50')]);_0x1d9ea3[_0xa147('0x52')]=_['intersection'](_0x4b747d[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x4afe4a[_0xa147('0x50')][_0xa147('0x53')]));_0x1d9ea3[_0xa147('0x52')]=_0x1d9ea3[_0xa147('0x52')][_0xa147('0x62')]?_0x1d9ea3['attributes']:_0x4b747d[_0xa147('0x4e')];_0x1d9ea3[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x4afe4a[_0xa147('0x50')][_0xa147('0x57')]);_0x1d9ea3['where']=qs[_0xa147('0x59')](_[_0xa147('0x6f')](_0x4afe4a[_0xa147('0x50')],_0x4b747d[_0xa147('0x59')]));if(_0x4afe4a['query'][_0xa147('0x5b')]){_0x1d9ea3[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x1d9ea3[_0xa147('0x58')],{'$or':_[_0xa147('0x4f')](_0x1d9ea3['attributes'],function(_0x494478){var _0xb1d5b7={};_0xb1d5b7[_0x494478]={'$like':'%'+_0x4afe4a[_0xa147('0x50')]['filter']+'%'};return _0xb1d5b7;})});}_0x1d9ea3=_[_0xa147('0x5a')]({},_0x1d9ea3,_0x4afe4a[_0xa147('0x5c')]);return _0x33a83c[_0xa147('0x9a')](_0x1d9ea3);}})['then'](function(_0x380f5e){if(_0x380f5e){_0x5a464=_0x380f5e['length'];if(!_0x4afe4a['query']['hasOwnProperty'](_0xa147('0x55'))){_0x1d9ea3['limit']=qs[_0xa147('0x22')](_0x4afe4a[_0xa147('0x50')][_0xa147('0x22')]);_0x1d9ea3[_0xa147('0x21')]=qs[_0xa147('0x21')](_0x4afe4a[_0xa147('0x50')][_0xa147('0x21')]);}return _0x33a83c['getApplications'](_0x1d9ea3);}})[_0xa147('0x13')](function(_0xe0151d){if(_0xe0151d){return _0xe0151d?{'count':_0x5a464,'rows':_0xe0151d}:null;}})[_0xa147('0x13')](respondWithResult(_0xa34c20,null))[_0xa147('0x1e')](handleError(_0xa34c20,null));};exports[_0xa147('0x9b')]=function(_0x398b9a,_0x50a5b5){var _0x1dcb58={'raw':!![],'where':{}};var _0x46c21a={};var _0x532af3={'count':0x0,'rows':[]};return db[_0xa147('0x5e')]['findOne']({'where':{'id':_0x398b9a['params']['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x50a5b5,null))[_0xa147('0x13')](function(_0xe7dedf){if(_0xe7dedf){_0x46c21a[_0xa147('0x4e')]=_['keys'](db['MailMessage'][_0xa147('0x4b')]);_0x46c21a[_0xa147('0x50')]=_[_0xa147('0x61')](_0x398b9a['query']);_0x46c21a['filters']=_[_0xa147('0x51')](_0x46c21a[_0xa147('0x4e')],_0x46c21a[_0xa147('0x50')]);_0x1dcb58['attributes']=_[_0xa147('0x51')](_0x46c21a[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x398b9a['query'][_0xa147('0x53')]));_0x1dcb58[_0xa147('0x52')]=_0x1dcb58[_0xa147('0x52')][_0xa147('0x62')]?_0x1dcb58[_0xa147('0x52')]:_0x46c21a[_0xa147('0x4e')];if(!_0x398b9a[_0xa147('0x50')]['hasOwnProperty'](_0xa147('0x55'))){_0x1dcb58['limit']=qs[_0xa147('0x22')](_0x398b9a['query'][_0xa147('0x22')]);_0x1dcb58[_0xa147('0x21')]=qs[_0xa147('0x21')](_0x398b9a[_0xa147('0x50')][_0xa147('0x21')]);}_0x1dcb58[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x398b9a['query'][_0xa147('0x57')]);_0x1dcb58['where']=qs['filters'](_['pick'](_0x398b9a[_0xa147('0x50')],_0x46c21a[_0xa147('0x59')]));_0x1dcb58[_0xa147('0x58')][_0xa147('0x6b')]=_0xe7dedf['id'];if(_0x398b9a['query'][_0xa147('0x5b')]){_0x1dcb58[_0xa147('0x58')]=_['merge'](_0x1dcb58[_0xa147('0x58')],{'$or':_['map'](_0x1dcb58[_0xa147('0x52')],function(_0x59ca97){var _0x232be0={};_0x232be0[_0x59ca97]={'$like':'%'+_0x398b9a[_0xa147('0x50')][_0xa147('0x5b')]+'%'};return _0x232be0;})});}if(_0x398b9a[_0xa147('0x50')][_0xa147('0x9c')]){var _0x5d1523=_0x398b9a['query'][_0xa147('0x9c')][_0xa147('0x9d')](',');var _0x1b02e3={};_0x1b02e3[_0x5d1523[0x0]]={'$gte':moment(_0x5d1523[0x1])[_0xa147('0x9e')](_0xa147('0x9f'))};_0x1dcb58[_0xa147('0x58')]=_[_0xa147('0x5a')](_0x1dcb58['where'],_0x1b02e3);}_0x1dcb58=_[_0xa147('0x5a')]({},_0x1dcb58,_0x398b9a[_0xa147('0x5c')]);return db[_0xa147('0xa0')]['count']({'where':_0x1dcb58['where']})[_0xa147('0x13')](function(_0x1c3a03){_0x532af3['count']=_0x1c3a03;if(_0x398b9a['query'][_0xa147('0x5d')]){_0x1dcb58[_0xa147('0x63')]=[{'all':!![]}];}return db[_0xa147('0xa0')][_0xa147('0x70')](_0x1dcb58);})['then'](function(_0x5ed4d1){if(_0x398b9a['query']['inlineCss']==='true'){for(var _0x933513=0x0;_0x933513<_0x5ed4d1['length'];_0x933513++){_0x5ed4d1[_0x933513][_0xa147('0x65')]=juice(_0x5ed4d1[_0x933513][_0xa147('0x65')]);}}_0x532af3[_0xa147('0x71')]=_0x5ed4d1;return _0x532af3;});}})[_0xa147('0x13')](respondWithFilteredResult(_0x50a5b5,_0x1dcb58))[_0xa147('0x1e')](handleError(_0x50a5b5,null));};exports[_0xa147('0x2f')]=function(_0x5b52fa,_0x186beb){var _0x37d975,_0x152a4a={},_0x486cf8;if(_0x5b52fa[_0xa147('0x65')]['to']){_0x486cf8=_0x5b52fa['body']['to'][_0xa147('0x9d')](',')[0x0];}return db[_0xa147('0x5e')]['find']({'where':{'id':_0x5b52fa[_0xa147('0x60')]['id']},'include':[{'model':db[_0xa147('0xa1')],'as':_0xa147('0xa2'),'include':[{'model':db[_0xa147('0x89')],'as':_0xa147('0xa3'),'where':{'email':_0x486cf8},'limit':0x1,'order':[['updatedAt',_0xa147('0xa4')]]}]},{'model':db[_0xa147('0x48')],'as':_0xa147('0x45'),'raw':!![],'include':[{'model':db[_0xa147('0xa5')],'as':_0xa147('0xa5'),'raw':!![]}]}]})[_0xa147('0x13')](handleEntityNotFound(_0x186beb,null))[_0xa147('0x13')](function(_0xb270d2){if(!_0xb270d2)return;_0x37d975=_0xb270d2;if(!_0xb270d2[_0xa147('0x45')])throw new Error(_0xa147('0xa6'));if(_[_0xa147('0x79')](_0x5b52fa[_0xa147('0x65')]['from'])){_0x5b52fa[_0xa147('0x65')][_0xa147('0xa7')]=util[_0xa147('0x9e')](_0xa147('0xa8'),_0xb270d2[_0xa147('0x2e')],_0xb270d2['email']||_0xb270d2[_0xa147('0x45')][_0xa147('0x3b')]);}if(_0x5b52fa[_0xa147('0x65')]['attachments']&&_0x5b52fa[_0xa147('0x65')]['attachments'][_0xa147('0x62')]){for(var _0x14c9d2=0x0;_0x14c9d2<_0x5b52fa[_0xa147('0x65')][_0xa147('0xa9')][_0xa147('0x62')];_0x14c9d2+=0x1){_0x5b52fa[_0xa147('0x65')][_0xa147('0xa9')][_0x14c9d2]={'filename':_0x5b52fa[_0xa147('0x65')][_0xa147('0xa9')][_0x14c9d2][_0xa147('0x2e')],'path':path[_0xa147('0xaa')](config[_0xa147('0xab')],_0xa147('0xac'),_0x5b52fa[_0xa147('0x65')][_0xa147('0xa9')][_0x14c9d2][_0xa147('0xad')])};}}var _0x49499b=_0xb270d2[_0xa147('0xae')]();return respondWithRpcPromise(_0xa147('0xaf'),'sendMail',{'account':_0x49499b,'message':_0x5b52fa[_0xa147('0x65')]});})['then'](function(_0x571578){if(!_0x571578)return;_0x152a4a=_0x571578;if(!_0x37d975['List'])throw new Error(_0xa147('0xb0'));if(_0x37d975[_0xa147('0xa2')][_0xa147('0xa3')][_0xa147('0x62')])return _0x37d975[_0xa147('0xa2')][_0xa147('0xa3')][0x0];return db[_0xa147('0x89')][_0xa147('0x6d')](_[_0xa147('0x9')](_0x5b52fa[_0xa147('0x65')],{'firstName':_0x5b52fa['body']['to'],'email':_0x5b52fa[_0xa147('0x65')]['to'],'phone':_0x5b52fa[_0xa147('0x65')]['to'],'ListId':_0x37d975[_0xa147('0xb1')]}));})[_0xa147('0x13')](function(_0x3af4c7){if(!_0x3af4c7)return;var _0x4c1743={'UserId':_0x5b52fa['user']['id'],'ContactId':_0x3af4c7['id'],'MailAccountId':_0x37d975['id'],'inReplyTo':_0x152a4a[_0xa147('0xb2')],'to':_0x5b52fa[_0xa147('0x65')]['from'],'cc':_0x5b52fa[_0xa147('0x65')]['cc'],'subject':_0x5b52fa[_0xa147('0x65')][_0xa147('0xb3')],'attach':_0x5b52fa[_0xa147('0x65')][_0xa147('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xa147('0x9f')),'lastMsgDirection':_0xa147('0xb5'),'Messages':[_[_0xa147('0x5a')](_0x5b52fa['body'],{'messageId':_0x152a4a[_0xa147('0xb2')],'sentAt':moment()[_0xa147('0x9e')](_0xa147('0x9f')),'read':!![],'MailAccountId':_0x37d975['id'],'UserId':_0x5b52fa['user']['id'],'ContactId':_0x3af4c7['id']})]};if(_0x5b52fa[_0xa147('0x65')][_0xa147('0xb6')]){_0x4c1743=_[_0xa147('0x5a')](_0x4c1743,_0x5b52fa[_0xa147('0x65')]['Interaction']);}return db['MailInteraction'][_0xa147('0x6d')](_0x4c1743,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0xa147('0x13')](respondWithResult(_0x186beb,null))[_0xa147('0x1e')](handleError(_0x186beb,null));};exports[_0xa147('0xb7')]=function(_0x160c77,_0x1c67e9){return db['MailAccount'][_0xa147('0x64')]({'where':{'id':_0x160c77['params']['id']},'include':[{'model':db[_0xa147('0x48')],'as':_0xa147('0x45'),'raw':!![],'include':[{'model':db[_0xa147('0xa5')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x1c67e9,null))[_0xa147('0x13')](function(_0x46d1db){if(!_0x46d1db[_0xa147('0x45')])return;var _0x265826=_0x46d1db[_0xa147('0xae')]();return respondWithRpcPromise(_0xa147('0xb8'),_0xa147('0xb7'),{'account':_0x265826});})['then'](respondWithResult(_0x1c67e9,null))[_0xa147('0x1e')](handleError(_0x1c67e9,null));};exports['destroy']=function(_0x1d5d3b,_0x4a8073){return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x1d5d3b['params']['id']}})['then'](handleEntityNotFound(_0x4a8073,null))['then'](function(_0x2cf601){if(_0x2cf601&&_0x2cf601[_0xa147('0x42')]){throw new db[(_0xa147('0xb9'))][(_0xa147('0xba'))](_0xa147('0xbb'));}return _0x2cf601;})[_0xa147('0x13')](removeEntity(_0x4a8073,null))[_0xa147('0x1e')](handleError(_0x4a8073,null));};exports[_0xa147('0xbc')]=function(_0x32833d,_0x42addc){return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x32833d[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x42addc,null))[_0xa147('0x13')](function(_0xf95b73){if(_0xf95b73){return _0xf95b73[_0xa147('0xbc')](_0x32833d[_0xa147('0x65')]['ids'],_['omit'](_0x32833d[_0xa147('0x65')],['ids','id'])||{})['spread'](function(_0x125c06){for(var _0x129af3=0x0;_0x129af3<_0x32833d[_0xa147('0x65')][_0xa147('0x72')][_0xa147('0x62')];_0x129af3+=0x1){socket[_0xa147('0xbd')]('userMailAccount:save',{'UserId':Number(_0x32833d[_0xa147('0x65')][_0xa147('0x72')][_0x129af3]),'MailAccountId':Number(_0x32833d[_0xa147('0x60')]['id'])});}return _0x125c06;});}})[_0xa147('0x13')](respondWithResult(_0x42addc,null))[_0xa147('0x1e')](handleError(_0x42addc,null));};exports[_0xa147('0xbe')]=function(_0x40da1f,_0x3780dc){return db[_0xa147('0x5e')][_0xa147('0x64')]({'where':{'id':_0x40da1f[_0xa147('0x60')]['id']}})[_0xa147('0x13')](handleEntityNotFound(_0x3780dc,null))[_0xa147('0x13')](function(_0x1bc3ba){if(_0x1bc3ba){return _0x1bc3ba[_0xa147('0xbe')](_0x40da1f['query'][_0xa147('0x72')])[_0xa147('0x13')](function(){if(_['isArray'](_0x40da1f['query'][_0xa147('0x72')])){for(var _0x3dd1a0=0x0;_0x3dd1a0<_0x40da1f[_0xa147('0x50')][_0xa147('0x72')]['length'];_0x3dd1a0+=0x1){socket[_0xa147('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x40da1f['query'][_0xa147('0x72')][_0x3dd1a0]),'MailAccountId':Number(_0x40da1f[_0xa147('0x60')]['id'])});}}else{socket[_0xa147('0xbd')](_0xa147('0xbf'),{'UserId':Number(_0x40da1f['query']['ids']),'MailAccountId':Number(_0x40da1f['params']['id'])});}});}})[_0xa147('0x13')](respondWithStatusCode(_0x3780dc,null))[_0xa147('0x1e')](handleError(_0x3780dc,null));};exports[_0xa147('0xc0')]=function(_0x5bc0d5,_0x24b4d0){var _0x48ee0b={};var _0x22ef2f={};var _0x2d749e;var _0x5440e6;return db['MailAccount'][_0xa147('0x75')]({'where':{'id':_0x5bc0d5[_0xa147('0x60')]['id']}})['then'](handleEntityNotFound(_0x24b4d0,null))[_0xa147('0x13')](function(_0x2144d5){if(_0x2144d5){_0x2d749e=_0x2144d5;_0x22ef2f['model']=_['keys'](db[_0xa147('0x8b')][_0xa147('0x4b')]);_0x22ef2f[_0xa147('0x50')]=_[_0xa147('0x61')](_0x5bc0d5[_0xa147('0x50')]);_0x22ef2f['filters']=_[_0xa147('0x51')](_0x22ef2f[_0xa147('0x4e')],_0x22ef2f['query']);_0x48ee0b['attributes']=_[_0xa147('0x51')](_0x22ef2f[_0xa147('0x4e')],qs[_0xa147('0x53')](_0x5bc0d5['query'][_0xa147('0x53')]));_0x48ee0b['attributes']=_0x48ee0b[_0xa147('0x52')]['length']?_0x48ee0b[_0xa147('0x52')]:_0x22ef2f[_0xa147('0x4e')];_0x48ee0b[_0xa147('0x56')]=qs[_0xa147('0x57')](_0x5bc0d5[_0xa147('0x50')][_0xa147('0x57')]);_0x48ee0b[_0xa147('0x58')]=qs[_0xa147('0x59')](_[_0xa147('0x6f')](_0x5bc0d5[_0xa147('0x50')],_0x22ef2f['filters']));if(_0x5bc0d5['query'][_0xa147('0x5b')]){_0x48ee0b[_0xa147('0x58')]=_['merge'](_0x48ee0b[_0xa147('0x58')],{'$or':_[_0xa147('0x4f')](_0x48ee0b[_0xa147('0x52')],function(_0x2fd4a6){var _0x2b926f={};_0x2b926f[_0x2fd4a6]={'$like':'%'+_0x5bc0d5[_0xa147('0x50')][_0xa147('0x5b')]+'%'};return _0x2b926f;})});}_0x48ee0b=_['merge']({},_0x48ee0b,_0x5bc0d5[_0xa147('0x5c')]);return _0x2d749e['getAgents'](_0x48ee0b);}})[_0xa147('0x13')](function(_0x53178a){if(_0x53178a){_0x5440e6=_0x53178a[_0xa147('0x62')];if(!_0x5bc0d5[_0xa147('0x50')]['hasOwnProperty'](_0xa147('0x55'))){_0x48ee0b[_0xa147('0x22')]=qs[_0xa147('0x22')](_0x5bc0d5[_0xa147('0x50')][_0xa147('0x22')]);_0x48ee0b[_0xa147('0x21')]=qs['offset'](_0x5bc0d5[_0xa147('0x50')][_0xa147('0x21')]);}return _0x2d749e['getAgents'](_0x48ee0b);}})[_0xa147('0x13')](function(_0x568a7e){if(_0x568a7e){return _0x568a7e?{'count':_0x5440e6,'rows':_0x568a7e}:null;}})[_0xa147('0x13')](respondWithResult(_0x24b4d0,null))['catch'](handleError(_0x24b4d0,null));}; \ No newline at end of file +var _0x1043=['rows','show','params','rawAttributes','find','body','provider','custom','Mail\x20Account\x20not\x20found','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','key','email','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','Contacts','updatedAt','DESC','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','ValidationError','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','ioredis','../../config/logger','api','../../config/environment','redis','defaults','localhost','./mailAccount.socket','register','http','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','destroy','get','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','secure','service','authentication','Imap','host','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x4972ef,_0x4c0ef2){var _0x1005b1=function(_0x13d1d7){while(--_0x13d1d7){_0x4972ef['push'](_0x4972ef['shift']());}};_0x1005b1(++_0x4c0ef2);}(_0x1043,0x123));var _0x3104=function(_0x37c70e,_0x4f3427){_0x37c70e=_0x37c70e-0x0;var _0x18dc99=_0x1043[_0x37c70e];return _0x18dc99;};'use strict';var moment=require(_0x3104('0x0'));var BPromise=require(_0x3104('0x1'));var util=require(_0x3104('0x2'));var path=require(_0x3104('0x3'));var _=require('lodash');var juice=require(_0x3104('0x4'));var Redis=require(_0x3104('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x3104('0x6'))(_0x3104('0x7'));var config=require(_0x3104('0x8'));var db=require('../../mysqldb')['db'];config[_0x3104('0x9')]=_[_0x3104('0xa')](config[_0x3104('0x9')],{'host':_0x3104('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3104('0x9')]));require(_0x3104('0xc'))[_0x3104('0xd')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3104('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x5a36f5,_0x5f41c4,_0x455802,_0xe6dd62){return new BPromise(function(_0x3d9764,_0x29bf69){var _0x36d80c=_0xe6dd62||client;return _0x36d80c['request'](_0x5a36f5,_0x455802)[_0x3104('0xf')](function(_0x526ff5){logger['info'](_0x3104('0x10'),_0x5f41c4,_0x3104('0x11'));logger['debug'](_0x3104('0x12'),_0x5f41c4,_0x3104('0x11'),JSON[_0x3104('0x13')](_0x526ff5));if(_0x526ff5[_0x3104('0x14')]){if(_0x526ff5[_0x3104('0x14')][_0x3104('0x15')]===0x1f4){logger[_0x3104('0x14')](_0x3104('0x10'),_0x5f41c4,_0x526ff5[_0x3104('0x14')]['message']);return _0x29bf69(_0x526ff5['error']['message']);}logger[_0x3104('0x14')](_0x3104('0x10'),_0x5f41c4,_0x526ff5['error'][_0x3104('0x16')]);return _0x3d9764(_0x526ff5[_0x3104('0x14')][_0x3104('0x16')]);}else{logger[_0x3104('0x17')]('MailAccount,\x20%s,\x20%s',_0x5f41c4,_0x3104('0x11'));_0x3d9764(_0x526ff5[_0x3104('0x18')][_0x3104('0x16')]);}})[_0x3104('0x19')](function(_0xdf3095){logger[_0x3104('0x14')](_0x3104('0x10'),_0x5f41c4,_0xdf3095);_0x29bf69(_0xdf3095);});});}function respondWithStatusCode(_0x11896c,_0x4a1ada){_0x4a1ada=_0x4a1ada||0xcc;return function(_0x41a9fe){if(_0x41a9fe){return _0x11896c[_0x3104('0x1a')](_0x4a1ada);}return _0x11896c[_0x3104('0x1b')](_0x4a1ada)[_0x3104('0x1c')]();};}function respondWithResult(_0x8ec9b9,_0x433ff4){_0x433ff4=_0x433ff4||0xc8;return function(_0x59b247){if(_0x59b247){return _0x8ec9b9[_0x3104('0x1b')](_0x433ff4)[_0x3104('0x1d')](_0x59b247);}};}function respondWithFilteredResult(_0x12cce6,_0x5787c1){return function(_0x2c07a1){if(_0x2c07a1){var _0x3ee5a4=typeof _0x5787c1['offset']===_0x3104('0x1e')&&typeof _0x5787c1[_0x3104('0x1f')]===_0x3104('0x1e');var _0x44bfac=_0x2c07a1[_0x3104('0x20')];var _0x4d250d=_0x3ee5a4?0x0:_0x5787c1[_0x3104('0x21')];var _0x1244e5=_0x3ee5a4?_0x2c07a1[_0x3104('0x20')]:_0x5787c1['offset']+_0x5787c1[_0x3104('0x1f')];var _0x33f28b;if(_0x1244e5>=_0x44bfac){_0x1244e5=_0x44bfac;_0x33f28b=0xc8;}else{_0x33f28b=0xce;}_0x12cce6['status'](_0x33f28b);return _0x12cce6[_0x3104('0x22')](_0x3104('0x23'),_0x4d250d+'-'+_0x1244e5+'/'+_0x44bfac)[_0x3104('0x1d')](_0x2c07a1);}return null;};}function saveUpdates(_0x1a8383){return function(_0x3ada26){if(_0x3ada26){return _0x3ada26['update'](_0x1a8383)[_0x3104('0xf')](function(_0xe253b2){return _0xe253b2;});}return null;};}function removeEntity(_0x5b1894){return function(_0x47a6f4){if(_0x47a6f4){return _0x47a6f4[_0x3104('0x24')]()['then'](function(){var _0x239dc7=_0x47a6f4[_0x3104('0x25')]({'plain':!![]});var _0x4ddaef=_0x3104('0x26');return db['UserProfileResource'][_0x3104('0x24')]({'where':{'type':_0x4ddaef,'resourceId':_0x239dc7['id']}})[_0x3104('0xf')](function(){return _0x47a6f4;});})['then'](function(){_0x5b1894['status'](0xcc)[_0x3104('0x1c')]();});}};}function handleEntityNotFound(_0x34d498){return function(_0x47ab52){if(!_0x47ab52){_0x34d498['sendStatus'](0x194);}return _0x47ab52;};}function handleError(_0x46612f,_0x1257cc){_0x1257cc=_0x1257cc||0x1f4;return function(_0xe8afd4){logger[_0x3104('0x14')](_0xe8afd4[_0x3104('0x27')]);if(_0xe8afd4[_0x3104('0x28')]){delete _0xe8afd4[_0x3104('0x28')];}_0x46612f[_0x3104('0x1b')](_0x1257cc)[_0x3104('0x29')](_0xe8afd4);};}function getImapHost(_0x1fbc6a){switch(_0x1fbc6a){case _0x3104('0x2a'):return _0x3104('0x2b');case _0x3104('0x2c'):return'imap.mail.yahoo.com';case _0x3104('0x2d'):return _0x3104('0x2e');case'outlook365':return _0x3104('0x2f');}throw new Error(_0x3104('0x30'),_0x1fbc6a);}function getSmtpHost(_0x131147){switch(_0x131147){case _0x3104('0x2a'):return _0x3104('0x31');case _0x3104('0x2c'):return _0x3104('0x32');case _0x3104('0x2d'):return _0x3104('0x33');case _0x3104('0x34'):return _0x3104('0x35');}throw new Error(_0x3104('0x30'),_0x131147);}function getAuthenticationOptions(_0x42ad14,_0x46d6e9){var _0x5e3271={};var _0x27ead0={};if(_0x42ad14){_0x5e3271['user']=_0x27ead0[_0x3104('0x36')]=_0x46d6e9[_0x3104('0x37')];_0x5e3271[_0x3104('0x38')]=_0x27ead0[_0x3104('0x39')]=_0x46d6e9['password'];if(_0x46d6e9['modernAuthentication']){_0x5e3271['modernAuthentication']=_0x27ead0[_0x3104('0x3a')]=!![];_0x5e3271[_0x3104('0x3b')]=_0x27ead0[_0x3104('0x3b')]=_0x46d6e9[_0x3104('0x3b')];_0x5e3271['password']=_0x27ead0[_0x3104('0x39')]=null;}else{_0x5e3271[_0x3104('0x3b')]=_0x27ead0[_0x3104('0x3b')]=null;}_0x5e3271['host']=getImapHost(_0x42ad14);_0x5e3271[_0x3104('0x3c')]=0x3e1;_0x27ead0['host']=getSmtpHost(_0x42ad14);_0x27ead0['port']=0x24b;_0x27ead0[_0x3104('0x3d')]=![];_0x5e3271[_0x3104('0x3e')]=_0x27ead0['service']=null;}else{if(_0x46d6e9[_0x3104('0x3f')]){_0x5e3271['user']=_0x27ead0[_0x3104('0x36')]=_0x46d6e9['username'];_0x5e3271[_0x3104('0x38')]=_0x27ead0[_0x3104('0x39')]=_0x46d6e9[_0x3104('0x38')];}else{_0x5e3271[_0x3104('0x3f')]=_0x27ead0[_0x3104('0x3f')]=![];_0x5e3271[_0x3104('0x36')]=_0x27ead0[_0x3104('0x36')]=null;_0x5e3271[_0x3104('0x38')]=_0x27ead0['pass']=null;}_0x5e3271['host']=_0x46d6e9['Imap']['host'];_0x5e3271[_0x3104('0x3c')]=_0x46d6e9[_0x3104('0x40')]['port'];_0x27ead0[_0x3104('0x41')]=_0x46d6e9[_0x3104('0x42')][_0x3104('0x41')];_0x27ead0[_0x3104('0x3c')]=_0x46d6e9[_0x3104('0x42')]['port'];}return{'Imap':_0x5e3271,'Smtp':_0x27ead0};}exports[_0x3104('0x43')]=function(_0x29792f,_0x2672ea){var _0x39d848={'include':[{'model':db[_0x3104('0x44')],'as':_0x3104('0x40')},{'model':db[_0x3104('0x45')],'as':_0x3104('0x42')},{'model':db[_0x3104('0x46')],'as':_0x3104('0x47')}]},_0xc08153={},_0x3c4d02={'count':0x0,'rows':[]};var _0x428e1e=_[_0x3104('0x48')](db[_0x3104('0x49')]['rawAttributes'],function(_0x547fbb){return{'name':_0x547fbb['fieldName'],'type':_0x547fbb['type']['key']};});_0xc08153[_0x3104('0x4a')]=_['map'](_0x428e1e,'name');_0xc08153[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0x29792f['query']);_0xc08153[_0x3104('0x4d')]=_[_0x3104('0x4e')](_0xc08153['model'],_0xc08153['query']);_0x39d848[_0x3104('0x4f')]=_[_0x3104('0x4e')](_0xc08153[_0x3104('0x4a')],qs[_0x3104('0x50')](_0x29792f[_0x3104('0x4b')]['fields']));_0x39d848[_0x3104('0x4f')]=_0x39d848[_0x3104('0x4f')][_0x3104('0x51')]?_0x39d848['attributes']:_0xc08153[_0x3104('0x4a')];if(!_0x29792f['query'][_0x3104('0x52')](_0x3104('0x53'))){_0x39d848[_0x3104('0x1f')]=qs[_0x3104('0x1f')](_0x29792f['query'][_0x3104('0x1f')]);_0x39d848['offset']=qs[_0x3104('0x21')](_0x29792f[_0x3104('0x4b')][_0x3104('0x21')]);}_0x39d848['order']=qs[_0x3104('0x54')](_0x29792f[_0x3104('0x4b')][_0x3104('0x54')]);_0x39d848[_0x3104('0x55')]=qs[_0x3104('0x4d')](_[_0x3104('0x56')](_0x29792f['query'],_0xc08153['filters']),_0x428e1e);if(_0x29792f['query'][_0x3104('0x57')]){_0x39d848[_0x3104('0x55')]=_[_0x3104('0x58')](_0x39d848[_0x3104('0x55')],{'$or':_[_0x3104('0x48')](_0x428e1e,function(_0x5f4df8){if(_0x5f4df8['type']!==_0x3104('0x59')){var _0x5fc62d={};_0x5fc62d[_0x5f4df8[_0x3104('0x28')]]={'$like':'%'+_0x29792f[_0x3104('0x4b')][_0x3104('0x57')]+'%'};return _0x5fc62d;}})});}_0x39d848=_[_0x3104('0x58')]({},_0x39d848,_0x29792f[_0x3104('0x5a')]);var _0x22d8b2={'where':_0x39d848[_0x3104('0x55')]};return db[_0x3104('0x49')][_0x3104('0x20')](_0x22d8b2)[_0x3104('0xf')](function(_0x16dffc){_0x3c4d02[_0x3104('0x20')]=_0x16dffc;if(_0x29792f['query'][_0x3104('0x5b')]){_0x39d848['include']=[{'all':!![]}];}return db[_0x3104('0x49')][_0x3104('0x5c')](_0x39d848);})['then'](function(_0x18ebbc){_0x3c4d02[_0x3104('0x5d')]=_0x18ebbc;return _0x3c4d02;})[_0x3104('0xf')](respondWithFilteredResult(_0x2672ea,_0x39d848))[_0x3104('0x19')](handleError(_0x2672ea,null));};exports[_0x3104('0x5e')]=function(_0x1b690e,_0x27cea9){var _0x418317={'raw':![],'where':{'id':_0x1b690e[_0x3104('0x5f')]['id']},'include':[{'model':db[_0x3104('0x44')],'as':_0x3104('0x40')},{'model':db[_0x3104('0x45')],'as':_0x3104('0x42')},{'model':db[_0x3104('0x46')],'as':'mandatoryDispositionPause'}]},_0x2e1d70={};_0x2e1d70[_0x3104('0x4a')]=_[_0x3104('0x4c')](db[_0x3104('0x49')][_0x3104('0x60')]);_0x2e1d70[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0x1b690e[_0x3104('0x4b')]);_0x2e1d70[_0x3104('0x4d')]=_[_0x3104('0x4e')](_0x2e1d70[_0x3104('0x4a')],_0x2e1d70[_0x3104('0x4b')]);_0x418317[_0x3104('0x4f')]=_[_0x3104('0x4e')](_0x2e1d70[_0x3104('0x4a')],qs[_0x3104('0x50')](_0x1b690e[_0x3104('0x4b')][_0x3104('0x50')]));_0x418317[_0x3104('0x4f')]=_0x418317[_0x3104('0x4f')][_0x3104('0x51')]?_0x418317['attributes']:_0x2e1d70[_0x3104('0x4a')];if(_0x1b690e['query'][_0x3104('0x5b')]){_0x418317['include']=[{'all':!![]}];}_0x418317=_[_0x3104('0x58')]({},_0x418317,_0x1b690e[_0x3104('0x5a')]);return db[_0x3104('0x49')][_0x3104('0x61')](_0x418317)[_0x3104('0xf')](handleEntityNotFound(_0x27cea9,null))[_0x3104('0xf')](respondWithResult(_0x27cea9,null))['catch'](handleError(_0x27cea9,null));};exports['update']=function(_0x3c2db4,_0xf58bea){if(_0x3c2db4[_0x3104('0x62')]['id']){delete _0x3c2db4[_0x3104('0x62')]['id'];}var _0x3b178f=_0x3c2db4[_0x3104('0x62')][_0x3104('0x63')]===_0x3104('0x64')?null:_0x3c2db4[_0x3104('0x62')]['provider'];var _0x5005d5=_0x3c2db4['body'][_0x3104('0x40')]||{};var _0x130d7c=_0x3c2db4[_0x3104('0x62')][_0x3104('0x42')]||{};if(_0x3b178f){_0x5005d5['host']=getImapHost(_0x3b178f);_0x5005d5[_0x3104('0x3c')]=0x3e1;_0x130d7c[_0x3104('0x41')]=getSmtpHost(_0x3b178f);_0x130d7c['port']=0x24b;_0x130d7c[_0x3104('0x3d')]=![];}if(_0x130d7c['modernAuthentication']){_0x130d7c[_0x3104('0x3d')]=![];}else{_0x130d7c['CloudProviderId']=null;}if(!_0x5005d5['modernAuthentication'])_0x5005d5[_0x3104('0x3b')]=null;_0x3c2db4[_0x3104('0x62')][_0x3104('0x40')]=_0x5005d5;_0x3c2db4[_0x3104('0x62')][_0x3104('0x42')]=_0x130d7c;return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x3c2db4['params']['id']},'include':[{'model':db[_0x3104('0x44')],'as':_0x3104('0x40')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3104('0x46')],'as':_0x3104('0x47')}]})[_0x3104('0xf')](handleEntityNotFound(_0xf58bea,null))[_0x3104('0xf')](function(_0x5301f7){if(!_0x5301f7)throw new Error(_0x3104('0x65'));if(_0x5301f7[_0x3104('0x3e')])delete _0x3c2db4[_0x3104('0x62')][_0x3104('0x40')];return _0x5301f7;})[_0x3104('0xf')](saveUpdates(_0x3c2db4[_0x3104('0x62')],null))[_0x3104('0xf')](function(_0x3af4c4){if(!_0x3c2db4[_0x3104('0x62')][_0x3104('0x40')])return _0x3af4c4;return db['MailServerIn'][_0x3104('0x66')](_0x3c2db4['body'][_0x3104('0x40')],{'where':{'MailAccountId':_0x3af4c4['id']}})['then'](function(){return _0x3af4c4;});})[_0x3104('0xf')](function(_0x18c79c){if(!_0x3c2db4[_0x3104('0x62')]['Smtp'])return _0x18c79c;return db[_0x3104('0x45')]['update'](_0x3c2db4[_0x3104('0x62')]['Smtp'],{'where':{'MailAccountId':_0x18c79c['id']}})[_0x3104('0xf')](function(){return _0x18c79c;});})['then'](respondWithResult(_0xf58bea,null))[_0x3104('0x19')](handleError(_0xf58bea,null));};exports[_0x3104('0x67')]=function(_0x29fff8,_0x3649ed){return db[_0x3104('0x49')]['describe']()[_0x3104('0xf')](respondWithResult(_0x3649ed,null))['catch'](handleError(_0x3649ed,null));};exports[_0x3104('0x68')]=function(_0x24b00f,_0x2d5315){if(_0x24b00f[_0x3104('0x62')]['id']){delete _0x24b00f['body']['id'];}return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x24b00f[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x2d5315,null))['then'](function(_0x4f064a){if(_0x4f064a){_0x24b00f[_0x3104('0x62')][_0x3104('0x69')]=_0x4f064a['id'];return db[_0x3104('0x6a')][_0x3104('0x6b')](_0x24b00f[_0x3104('0x62')]);}})[_0x3104('0xf')](respondWithResult(_0x2d5315,null))[_0x3104('0x19')](handleError(_0x2d5315,null));};exports[_0x3104('0x6c')]=function(_0x30581e,_0x17520f){var _0x5935bb={'raw':![],'where':{}};var _0x5a168d={};var _0x407dda={'count':0x0,'rows':[]};return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x30581e['params']['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x17520f,null))['then'](function(_0x49bd8a){if(_0x49bd8a){_0x5a168d['model']=_[_0x3104('0x4c')](db['Disposition'][_0x3104('0x60')]);_0x5a168d[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0x30581e['query']);_0x5a168d[_0x3104('0x4d')]=_['intersection'](_0x5a168d[_0x3104('0x4a')],_0x5a168d[_0x3104('0x4b')]);_0x5935bb[_0x3104('0x4f')]=_['intersection'](_0x5a168d[_0x3104('0x4a')],qs[_0x3104('0x50')](_0x30581e[_0x3104('0x4b')][_0x3104('0x50')]));_0x5935bb['attributes']=_0x5935bb[_0x3104('0x4f')][_0x3104('0x51')]?_0x5935bb['attributes']:_0x5a168d[_0x3104('0x4a')];if(!_0x30581e[_0x3104('0x4b')][_0x3104('0x52')](_0x3104('0x53'))){_0x5935bb['limit']=qs[_0x3104('0x1f')](_0x30581e[_0x3104('0x4b')]['limit']);_0x5935bb[_0x3104('0x21')]=qs[_0x3104('0x21')](_0x30581e[_0x3104('0x4b')][_0x3104('0x21')]);}_0x5935bb['order']=qs[_0x3104('0x54')](_0x30581e[_0x3104('0x4b')][_0x3104('0x54')]);_0x5935bb[_0x3104('0x55')]=qs[_0x3104('0x4d')](_[_0x3104('0x56')](_0x30581e['query'],_0x5a168d['filters']));_0x5935bb[_0x3104('0x55')][_0x3104('0x69')]=_0x49bd8a['id'];if(_0x30581e[_0x3104('0x4b')]['filter']){_0x5935bb['where']=_['merge'](_0x5935bb[_0x3104('0x55')],{'$or':_[_0x3104('0x48')](_0x5935bb['attributes'],function(_0x3e6465){var _0xb2114d={};_0xb2114d[_0x3e6465]={'$like':'%'+_0x30581e['query'][_0x3104('0x57')]+'%'};return _0xb2114d;})});}_0x5935bb=_['merge']({},_0x5935bb,_0x30581e[_0x3104('0x5a')]);return db['Disposition'][_0x3104('0x20')]({'where':_0x5935bb[_0x3104('0x55')]})[_0x3104('0xf')](function(_0x4fcc92){_0x407dda['count']=_0x4fcc92;if(_0x30581e[_0x3104('0x4b')][_0x3104('0x5b')]){_0x5935bb[_0x3104('0x6e')]=[{'all':!![]}];}return db[_0x3104('0x6a')][_0x3104('0x5c')](_0x5935bb);})[_0x3104('0xf')](function(_0x514e9a){_0x407dda['rows']=_0x514e9a;return _0x407dda;});}})[_0x3104('0xf')](respondWithFilteredResult(_0x17520f,_0x5935bb))['catch'](handleError(_0x17520f,null));};exports[_0x3104('0x6f')]=function(_0xa515de,_0x3915af){return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0xa515de[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x3915af,null))[_0x3104('0xf')](function(_0x39fb7d){if(_0x39fb7d){return _0x39fb7d[_0x3104('0x6f')](_0xa515de[_0x3104('0x4b')][_0x3104('0x70')]);}})[_0x3104('0xf')](respondWithStatusCode(_0x3915af,null))[_0x3104('0x19')](handleError(_0x3915af,null));};exports[_0x3104('0x71')]=function(_0x571bea,_0x5913c5){if(_0x571bea[_0x3104('0x62')]['id']){delete _0x571bea[_0x3104('0x62')]['id'];}return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x571bea[_0x3104('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5913c5,null))[_0x3104('0xf')](function(_0x35eb69){if(_0x35eb69){_0x571bea[_0x3104('0x62')][_0x3104('0x69')]=_0x35eb69['id'];return db[_0x3104('0x72')]['create'](_0x571bea['body']);}})['then'](respondWithResult(_0x5913c5,null))[_0x3104('0x19')](handleError(_0x5913c5,null));};exports['getAnswers']=function(_0x32fb34,_0x211a35){var _0x3f0c25={'raw':![],'where':{}};var _0x520fe6={};var _0x1a5823={'count':0x0,'rows':[]};return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x32fb34[_0x3104('0x5f')]['id']}})['then'](handleEntityNotFound(_0x211a35,null))[_0x3104('0xf')](function(_0x21eb4e){if(_0x21eb4e){_0x520fe6[_0x3104('0x4a')]=_[_0x3104('0x4c')](db['CannedAnswer'][_0x3104('0x60')]);_0x520fe6['query']=_[_0x3104('0x4c')](_0x32fb34[_0x3104('0x4b')]);_0x520fe6[_0x3104('0x4d')]=_['intersection'](_0x520fe6[_0x3104('0x4a')],_0x520fe6[_0x3104('0x4b')]);_0x3f0c25['attributes']=_[_0x3104('0x4e')](_0x520fe6['model'],qs[_0x3104('0x50')](_0x32fb34[_0x3104('0x4b')]['fields']));_0x3f0c25[_0x3104('0x4f')]=_0x3f0c25[_0x3104('0x4f')][_0x3104('0x51')]?_0x3f0c25[_0x3104('0x4f')]:_0x520fe6[_0x3104('0x4a')];if(!_0x32fb34[_0x3104('0x4b')][_0x3104('0x52')](_0x3104('0x53'))){_0x3f0c25['limit']=qs[_0x3104('0x1f')](_0x32fb34['query'][_0x3104('0x1f')]);_0x3f0c25[_0x3104('0x21')]=qs[_0x3104('0x21')](_0x32fb34['query'][_0x3104('0x21')]);}_0x3f0c25[_0x3104('0x73')]=qs[_0x3104('0x54')](_0x32fb34['query'][_0x3104('0x54')]);_0x3f0c25['where']=qs[_0x3104('0x4d')](_[_0x3104('0x56')](_0x32fb34['query'],_0x520fe6[_0x3104('0x4d')]));_0x3f0c25['where'][_0x3104('0x69')]=_0x21eb4e['id'];if(_0x32fb34[_0x3104('0x4b')]['filter']){_0x3f0c25[_0x3104('0x55')]=_[_0x3104('0x58')](_0x3f0c25[_0x3104('0x55')],{'$or':_[_0x3104('0x48')](_0x3f0c25['attributes'],function(_0x581d6a){var _0x130b8a={};_0x130b8a[_0x581d6a]={'$like':'%'+_0x32fb34[_0x3104('0x4b')]['filter']+'%'};return _0x130b8a;})});}_0x3f0c25=_[_0x3104('0x58')]({},_0x3f0c25,_0x32fb34[_0x3104('0x5a')]);return db[_0x3104('0x72')][_0x3104('0x20')]({'where':_0x3f0c25[_0x3104('0x55')]})[_0x3104('0xf')](function(_0x3fc717){_0x1a5823[_0x3104('0x20')]=_0x3fc717;if(_0x32fb34[_0x3104('0x4b')]['includeAll']){_0x3f0c25[_0x3104('0x6e')]=[{'all':!![]}];}return db[_0x3104('0x72')][_0x3104('0x5c')](_0x3f0c25);})['then'](function(_0x563f03){_0x1a5823[_0x3104('0x5d')]=_0x563f03;return _0x1a5823;});}})[_0x3104('0xf')](respondWithFilteredResult(_0x211a35,_0x3f0c25))['catch'](handleError(_0x211a35,null));};exports[_0x3104('0x74')]=function(_0x1e9b86,_0x2dc8f3){return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x1e9b86[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x2dc8f3,null))[_0x3104('0xf')](function(_0x25da46){if(_0x25da46){return _0x25da46[_0x3104('0x74')](_0x1e9b86[_0x3104('0x4b')][_0x3104('0x70')]);}})[_0x3104('0xf')](respondWithStatusCode(_0x2dc8f3,null))[_0x3104('0x19')](handleError(_0x2dc8f3,null));};exports[_0x3104('0x6b')]=function(_0x29feea,_0x3ae689){var _0x371075={'name':_0x29feea[_0x3104('0x62')][_0x3104('0x28')],'key':_0x29feea[_0x3104('0x62')][_0x3104('0x75')],'provider':_0x29feea[_0x3104('0x62')][_0x3104('0x63')]===_0x3104('0x64')?null:_0x29feea[_0x3104('0x62')]['provider'],'email':_0x29feea[_0x3104('0x62')][_0x3104('0x76')],'ListId':_0x29feea[_0x3104('0x62')][_0x3104('0x77')],'active':!_['isNil'](_0x29feea[_0x3104('0x62')]['active'])?_0x29feea['body'][_0x3104('0x78')]:!![],'description':_0x29feea[_0x3104('0x62')]['description']||null};var _0x5c83a5=getAuthenticationOptions(_0x371075[_0x3104('0x63')],_0x29feea[_0x3104('0x62')]);_0x371075[_0x3104('0x40')]=_0x5c83a5[_0x3104('0x40')];_0x371075[_0x3104('0x42')]=_0x5c83a5[_0x3104('0x42')];return db['MailAccount'][_0x3104('0x6b')](_0x371075,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x3104('0x44')],'as':_0x3104('0x40')}]})[_0x3104('0xf')](function(_0x4b60ba){var _0x3841d8=_0x29feea[_0x3104('0x36')][_0x3104('0x25')]({'plain':!![]});if(!_0x3841d8)throw new Error(_0x3104('0x79'));if(_0x3841d8[_0x3104('0x7a')]===_0x3104('0x36')){var _0x2f7fc6=_0x4b60ba[_0x3104('0x25')]({'plain':!![]});return db[_0x3104('0x7b')][_0x3104('0x61')]({'where':{'name':_0x3104('0x26'),'userProfileId':_0x3841d8[_0x3104('0x7c')]},'raw':!![]})['then'](function(_0x3fea8c){if(_0x3fea8c&&_0x3fea8c[_0x3104('0x7d')]===0x0){return db['UserProfileResource'][_0x3104('0x6b')]({'name':_0x2f7fc6[_0x3104('0x28')],'resourceId':_0x2f7fc6['id'],'type':_0x3fea8c[_0x3104('0x28')],'sectionId':_0x3fea8c['id']},{})[_0x3104('0xf')](function(){return _0x4b60ba;});}else{return _0x4b60ba;}})[_0x3104('0x19')](function(_0x494f54){logger[_0x3104('0x14')](_0x3104('0x7e'),_0x494f54);throw _0x494f54;});}return _0x4b60ba;})[_0x3104('0xf')](respondWithResult(_0x3ae689,0xc9))['catch'](handleError(_0x3ae689,null));};exports['getImap']=function(_0x41398a,_0x557ae5){return db[_0x3104('0x49')]['findOne']({'where':{'id':_0x41398a['params']['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x557ae5,null))[_0x3104('0xf')](function(_0x14e661){if(_0x14e661){return _0x14e661[_0x3104('0x7f')]();}return null;})[_0x3104('0xf')](respondWithResult(_0x557ae5,null))['catch'](handleError(_0x557ae5,null));};exports[_0x3104('0x80')]=function(_0x33741e,_0x5f3031){if(_0x33741e[_0x3104('0x62')]['id']){delete _0x33741e[_0x3104('0x62')]['id'];}return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x33741e[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x5f3031,null))['then'](function(_0x35cf18){if(_0x35cf18){_0x33741e[_0x3104('0x62')][_0x3104('0x69')]=_0x35cf18['id'];return db[_0x3104('0x44')][_0x3104('0x6b')](_0x33741e[_0x3104('0x62')]);}})[_0x3104('0xf')](respondWithResult(_0x5f3031,null))[_0x3104('0x19')](handleError(_0x5f3031,null));};exports[_0x3104('0x81')]=function(_0x5cf92d,_0x2de2b0){return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x5cf92d[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x2de2b0,null))[_0x3104('0xf')](function(_0x3aaf4f){if(_0x3aaf4f){return _0x3aaf4f['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x2de2b0,null))[_0x3104('0x19')](handleError(_0x2de2b0,null));};exports[_0x3104('0x82')]=function(_0x1f3e90,_0x43a0e7){return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x1f3e90[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x43a0e7,null))['then'](function(_0x42bc73){if(_0x42bc73){return _0x42bc73[_0x3104('0x82')]();}return null;})['then'](respondWithResult(_0x43a0e7,null))[_0x3104('0x19')](handleError(_0x43a0e7,null));};exports['addSmtp']=function(_0x54da6d,_0x4dd403){if(_0x54da6d[_0x3104('0x62')]['id']){delete _0x54da6d[_0x3104('0x62')]['id'];}return db[_0x3104('0x49')]['find']({'where':{'id':_0x54da6d[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x4dd403,null))[_0x3104('0xf')](function(_0xd66282){if(_0xd66282){_0x54da6d[_0x3104('0x62')][_0x3104('0x69')]=_0xd66282['id'];return db['MailServerOut']['create'](_0x54da6d['body']);}})[_0x3104('0xf')](respondWithResult(_0x4dd403,null))[_0x3104('0x19')](handleError(_0x4dd403,null));};exports[_0x3104('0x83')]=function(_0x322a93,_0x446ace){return db[_0x3104('0x49')]['findOne']({'where':{'id':_0x322a93[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x446ace,null))[_0x3104('0xf')](function(_0x39704e){if(_0x39704e){return _0x39704e['setSmtp'](null);}return null;})[_0x3104('0xf')](respondWithStatusCode(_0x446ace,null))[_0x3104('0x19')](handleError(_0x446ace,null));};exports['addInteraction']=function(_0x197a9d,_0x3a0dbd){return db[_0x3104('0x84')][_0x3104('0x61')]({'where':{'id':_0x197a9d[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x3a0dbd,null))[_0x3104('0xf')](function(_0x51674a){if(_0x51674a){return _0x51674a['addInteraction'](_0x197a9d['body'][_0x3104('0x70')],_[_0x3104('0x85')](_0x197a9d[_0x3104('0x62')],[_0x3104('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3a0dbd,null))['catch'](handleError(_0x3a0dbd,null));};exports[_0x3104('0x86')]=function(_0xa9fde1,_0x2a9f26){var _0x431475={'raw':![],'where':{}};var _0x15db37={};var _0x9a76a={'count':0x0,'rows':[]};return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0xa9fde1[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x2a9f26,null))['then'](function(_0x22e999){if(_0x22e999){_0x15db37[_0x3104('0x4a')]=_[_0x3104('0x4c')](db[_0x3104('0x84')]['rawAttributes']);_0x15db37[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0xa9fde1[_0x3104('0x4b')]);_0x15db37[_0x3104('0x4d')]=_[_0x3104('0x4e')](_0x15db37[_0x3104('0x4a')],_0x15db37[_0x3104('0x4b')]);_0x431475[_0x3104('0x4f')]=_['intersection'](_0x15db37[_0x3104('0x4a')],qs[_0x3104('0x50')](_0xa9fde1[_0x3104('0x4b')][_0x3104('0x50')]));_0x431475[_0x3104('0x4f')]=_0x431475['attributes']['length']?_0x431475[_0x3104('0x4f')]:_0x15db37[_0x3104('0x4a')];if(!_0xa9fde1[_0x3104('0x4b')]['hasOwnProperty'](_0x3104('0x53'))){_0x431475[_0x3104('0x1f')]=qs[_0x3104('0x1f')](_0xa9fde1['query'][_0x3104('0x1f')]);_0x431475[_0x3104('0x21')]=qs['offset'](_0xa9fde1[_0x3104('0x4b')][_0x3104('0x21')]);}_0x431475['order']=qs[_0x3104('0x54')](_0xa9fde1[_0x3104('0x4b')][_0x3104('0x54')]);_0x431475['where']=qs[_0x3104('0x4d')](_['pick'](_0xa9fde1[_0x3104('0x4b')],_0x15db37['filters']));_0x431475[_0x3104('0x55')][_0x3104('0x69')]=_0x22e999['id'];if(_0xa9fde1[_0x3104('0x4b')][_0x3104('0x57')]){_0x431475[_0x3104('0x55')]=_['merge'](_0x431475[_0x3104('0x55')],{'$or':_['map'](_0x431475[_0x3104('0x4f')],function(_0x296d93){var _0x38c256={};_0x38c256[_0x296d93]={'$like':'%'+_0xa9fde1['query'][_0x3104('0x57')]+'%'};return _0x38c256;})});}_0x431475=_['merge']({},_0x431475,_0xa9fde1[_0x3104('0x5a')]);return db[_0x3104('0x84')][_0x3104('0x20')]({'where':_0x431475['where']})['then'](function(_0xbda925){_0x9a76a[_0x3104('0x20')]=_0xbda925;if(_0xa9fde1[_0x3104('0x4b')][_0x3104('0x5b')]){_0x431475[_0x3104('0x6e')]=[{'model':db[_0x3104('0x87')],'as':_0x3104('0x88'),'required':![]},{'model':db[_0x3104('0x89')],'as':_0x3104('0x8a'),'attributes':[_0x3104('0x28'),_0x3104('0x8b'),_0x3104('0x8c')],'required':![]},{'model':db['Tag'],'as':_0x3104('0x8d'),'attributes':['id',_0x3104('0x28'),_0x3104('0x8e')],'where':_0xa9fde1[_0x3104('0x4b')]['tag']?{'id':_0xa9fde1['query'][_0x3104('0x8f')]}:undefined,'required':_0xa9fde1[_0x3104('0x4b')]['tag']?!![]:![]}];}return db[_0x3104('0x84')][_0x3104('0x5c')](_0x431475);})['then'](function(_0x378cb8){_0x9a76a[_0x3104('0x5d')]=_0x378cb8;return _0x9a76a;});}})[_0x3104('0xf')](respondWithFilteredResult(_0x2a9f26,_0x431475))[_0x3104('0x19')](handleError(_0x2a9f26,null));};exports[_0x3104('0x90')]=function addApplications(_0xb4b174,_0x100fd9){var _0x59230b=_0xb4b174[_0x3104('0x5f')]['id'];var _0x1aeb6a=_0xb4b174[_0x3104('0x62')];var _0x5da82c=0xc8;var _0x582f31=null;return db[_0x3104('0x91')]['transaction']({'isolationLevel':db['sequelize'][_0x3104('0x92')][_0x3104('0x93')]['READ_COMMITTED']},function(_0x5b8303){return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x59230b},'transaction':_0x5b8303})[_0x3104('0xf')](function(_0x4d19b3){if(_0x4d19b3){return db[_0x3104('0x94')]['destroy']({'where':{'MailAccountId':_0x59230b},'transaction':_0x5b8303})[_0x3104('0xf')](function(){var _0xe724c0=_[_0x3104('0x48')](_0x1aeb6a,function(_0x444a7e){_0x444a7e[_0x3104('0x69')]=_0x59230b;return _0x444a7e;});return db[_0x3104('0x94')]['bulkCreate'](_0xe724c0,{'transaction':_0x5b8303});});}else{_0x5da82c=0x194;_0x582f31=[];}});})[_0x3104('0xf')](function(){if(_0x5da82c!==0x194){return db[_0x3104('0x94')][_0x3104('0x95')]({'where':{'MailAccountId':_0x59230b},'order':_0x3104('0x96')})['then'](function(_0x207811){_0x582f31=_0x207811;});}})[_0x3104('0x19')](function(_0x198a0c){_0x5da82c=0x1f4;logger[_0x3104('0x14')](_0x198a0c[_0x3104('0x27')]);if(_0x198a0c[_0x3104('0x28')]){delete _0x198a0c[_0x3104('0x28')];}_0x582f31=_0x198a0c;})['finally'](function(){if(_0x582f31===null){_0x100fd9[_0x3104('0x1a')](_0x5da82c);}else{if(_0x5da82c===0x1f4){_0x100fd9[_0x3104('0x1b')](_0x5da82c)['send'](_0x582f31);}else{_0x100fd9[_0x3104('0x1b')](_0x5da82c)['json'](_0x582f31);}}});};exports[_0x3104('0x97')]=function(_0x4af32b,_0x14ab1a){var _0x33af03={};var _0x52bb14={};var _0x44175a;var _0x58766a;return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x4af32b[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x14ab1a,null))[_0x3104('0xf')](function(_0x44e585){if(_0x44e585){_0x44175a=_0x44e585;_0x52bb14[_0x3104('0x4a')]=_[_0x3104('0x4c')](db['MailApplication']['rawAttributes']);_0x52bb14['query']=_['keys'](_0x4af32b[_0x3104('0x4b')]);_0x52bb14['filters']=_[_0x3104('0x4e')](_0x52bb14[_0x3104('0x4a')],_0x52bb14[_0x3104('0x4b')]);_0x33af03[_0x3104('0x4f')]=_[_0x3104('0x4e')](_0x52bb14[_0x3104('0x4a')],qs['fields'](_0x4af32b[_0x3104('0x4b')][_0x3104('0x50')]));_0x33af03['attributes']=_0x33af03['attributes'][_0x3104('0x51')]?_0x33af03['attributes']:_0x52bb14['model'];_0x33af03[_0x3104('0x73')]=qs[_0x3104('0x54')](_0x4af32b[_0x3104('0x4b')][_0x3104('0x54')]);_0x33af03[_0x3104('0x55')]=qs[_0x3104('0x4d')](_['pick'](_0x4af32b[_0x3104('0x4b')],_0x52bb14[_0x3104('0x4d')]));if(_0x4af32b[_0x3104('0x4b')][_0x3104('0x57')]){_0x33af03[_0x3104('0x55')]=_[_0x3104('0x58')](_0x33af03['where'],{'$or':_[_0x3104('0x48')](_0x33af03[_0x3104('0x4f')],function(_0x56845c){var _0x54c7aa={};_0x54c7aa[_0x56845c]={'$like':'%'+_0x4af32b[_0x3104('0x4b')][_0x3104('0x57')]+'%'};return _0x54c7aa;})});}_0x33af03=_[_0x3104('0x58')]({},_0x33af03,_0x4af32b[_0x3104('0x5a')]);return _0x44175a['getApplications'](_0x33af03);}})[_0x3104('0xf')](function(_0x1aeea0){if(_0x1aeea0){_0x58766a=_0x1aeea0[_0x3104('0x51')];if(!_0x4af32b[_0x3104('0x4b')][_0x3104('0x52')](_0x3104('0x53'))){_0x33af03[_0x3104('0x1f')]=qs[_0x3104('0x1f')](_0x4af32b['query'][_0x3104('0x1f')]);_0x33af03[_0x3104('0x21')]=qs[_0x3104('0x21')](_0x4af32b[_0x3104('0x4b')]['offset']);}return _0x44175a['getApplications'](_0x33af03);}})['then'](function(_0x37015e){if(_0x37015e){return _0x37015e?{'count':_0x58766a,'rows':_0x37015e}:null;}})[_0x3104('0xf')](respondWithResult(_0x14ab1a,null))[_0x3104('0x19')](handleError(_0x14ab1a,null));};exports[_0x3104('0x98')]=function(_0x4841e1,_0x5f3607){var _0x1a417f={'raw':!![],'where':{}};var _0x3e3e1c={};var _0x1c0c08={'count':0x0,'rows':[]};return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x4841e1['params']['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x5f3607,null))[_0x3104('0xf')](function(_0x2fb8c8){if(_0x2fb8c8){_0x3e3e1c[_0x3104('0x4a')]=_[_0x3104('0x4c')](db[_0x3104('0x99')][_0x3104('0x60')]);_0x3e3e1c[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0x4841e1['query']);_0x3e3e1c[_0x3104('0x4d')]=_[_0x3104('0x4e')](_0x3e3e1c[_0x3104('0x4a')],_0x3e3e1c['query']);_0x1a417f[_0x3104('0x4f')]=_[_0x3104('0x4e')](_0x3e3e1c[_0x3104('0x4a')],qs[_0x3104('0x50')](_0x4841e1[_0x3104('0x4b')][_0x3104('0x50')]));_0x1a417f['attributes']=_0x1a417f['attributes']['length']?_0x1a417f[_0x3104('0x4f')]:_0x3e3e1c[_0x3104('0x4a')];if(!_0x4841e1[_0x3104('0x4b')]['hasOwnProperty']('nolimit')){_0x1a417f[_0x3104('0x1f')]=qs[_0x3104('0x1f')](_0x4841e1['query'][_0x3104('0x1f')]);_0x1a417f[_0x3104('0x21')]=qs[_0x3104('0x21')](_0x4841e1[_0x3104('0x4b')][_0x3104('0x21')]);}_0x1a417f[_0x3104('0x73')]=qs[_0x3104('0x54')](_0x4841e1[_0x3104('0x4b')][_0x3104('0x54')]);_0x1a417f[_0x3104('0x55')]=qs[_0x3104('0x4d')](_[_0x3104('0x56')](_0x4841e1[_0x3104('0x4b')],_0x3e3e1c[_0x3104('0x4d')]));_0x1a417f[_0x3104('0x55')][_0x3104('0x69')]=_0x2fb8c8['id'];if(_0x4841e1[_0x3104('0x4b')][_0x3104('0x57')]){_0x1a417f[_0x3104('0x55')]=_['merge'](_0x1a417f[_0x3104('0x55')],{'$or':_[_0x3104('0x48')](_0x1a417f[_0x3104('0x4f')],function(_0xf974b4){var _0x660e23={};_0x660e23[_0xf974b4]={'$like':'%'+_0x4841e1[_0x3104('0x4b')][_0x3104('0x57')]+'%'};return _0x660e23;})});}if(_0x4841e1['query'][_0x3104('0x9a')]){var _0x447b0d=_0x4841e1[_0x3104('0x4b')][_0x3104('0x9a')][_0x3104('0x9b')](',');var _0x45be46={};_0x45be46[_0x447b0d[0x0]]={'$gte':moment(_0x447b0d[0x1])[_0x3104('0x9c')](_0x3104('0x9d'))};_0x1a417f[_0x3104('0x55')]=_[_0x3104('0x58')](_0x1a417f[_0x3104('0x55')],_0x45be46);}_0x1a417f=_['merge']({},_0x1a417f,_0x4841e1[_0x3104('0x5a')]);return db[_0x3104('0x99')][_0x3104('0x20')]({'where':_0x1a417f[_0x3104('0x55')]})[_0x3104('0xf')](function(_0xf883a7){_0x1c0c08[_0x3104('0x20')]=_0xf883a7;if(_0x4841e1[_0x3104('0x4b')]['includeAll']){_0x1a417f[_0x3104('0x6e')]=[{'all':!![]}];}return db[_0x3104('0x99')][_0x3104('0x5c')](_0x1a417f);})['then'](function(_0x50dd77){if(_0x4841e1[_0x3104('0x4b')][_0x3104('0x9e')]===_0x3104('0x9f')){for(var _0xca999c=0x0;_0xca999c<_0x50dd77['length'];_0xca999c++){_0x50dd77[_0xca999c][_0x3104('0x62')]=juice(_0x50dd77[_0xca999c]['body']);}}_0x1c0c08['rows']=_0x50dd77;return _0x1c0c08;});}})[_0x3104('0xf')](respondWithFilteredResult(_0x5f3607,_0x1a417f))[_0x3104('0x19')](handleError(_0x5f3607,null));};exports[_0x3104('0x29')]=function(_0x55316e,_0x50fe4b){var _0x4f3c35,_0x6e1107={},_0x5ca090;if(_0x55316e['body']['to']){_0x5ca090=_0x55316e[_0x3104('0x62')]['to'][_0x3104('0x9b')](',')[0x0];}return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x55316e['params']['id']},'include':[{'model':db['CmList'],'as':_0x3104('0xa0'),'include':[{'model':db[_0x3104('0x87')],'as':_0x3104('0xa1'),'where':{'email':_0x5ca090},'limit':0x1,'order':[[_0x3104('0xa2'),_0x3104('0xa3')]]}]},{'model':db[_0x3104('0x45')],'as':_0x3104('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x50fe4b,null))[_0x3104('0xf')](function(_0x3fa770){if(!_0x3fa770)return;_0x4f3c35=_0x3fa770;if(!_0x3fa770[_0x3104('0x42')])throw new Error(_0x3104('0xa4'));if(_[_0x3104('0xa5')](_0x55316e[_0x3104('0x62')][_0x3104('0xa6')])){_0x55316e[_0x3104('0x62')][_0x3104('0xa6')]=util[_0x3104('0x9c')](_0x3104('0xa7'),_0x3fa770[_0x3104('0x28')],_0x3fa770[_0x3104('0x76')]||_0x3fa770[_0x3104('0x42')]['user']);}if(_0x55316e['body'][_0x3104('0xa8')]&&_0x55316e[_0x3104('0x62')]['attachments']['length']){for(var _0x212871=0x0;_0x212871<_0x55316e[_0x3104('0x62')][_0x3104('0xa8')][_0x3104('0x51')];_0x212871+=0x1){_0x55316e[_0x3104('0x62')][_0x3104('0xa8')][_0x212871]={'filename':_0x55316e[_0x3104('0x62')]['attachments'][_0x212871][_0x3104('0x28')],'path':path[_0x3104('0xa9')](config[_0x3104('0xaa')],_0x3104('0xab'),_0x55316e[_0x3104('0x62')][_0x3104('0xa8')][_0x212871]['basename'])};}}var _0x2b5095=_0x3fa770[_0x3104('0xac')]();return respondWithRpcPromise(_0x3104('0xad'),_0x3104('0xae'),{'account':_0x2b5095,'message':_0x55316e[_0x3104('0x62')]});})['then'](function(_0x2cbfd2){if(!_0x2cbfd2)return;_0x6e1107=_0x2cbfd2;if(!_0x4f3c35[_0x3104('0xa0')])throw new Error(_0x3104('0xaf'));if(_0x4f3c35['List']['Contacts'][_0x3104('0x51')])return _0x4f3c35[_0x3104('0xa0')][_0x3104('0xa1')][0x0];return db[_0x3104('0x87')][_0x3104('0x6b')](_[_0x3104('0xa')](_0x55316e[_0x3104('0x62')],{'firstName':_0x55316e[_0x3104('0x62')]['to'],'email':_0x55316e[_0x3104('0x62')]['to'],'phone':_0x55316e[_0x3104('0x62')]['to'],'ListId':_0x4f3c35[_0x3104('0x77')]}));})[_0x3104('0xf')](function(_0x1b3b5a){if(!_0x1b3b5a)return;var _0x174702={'UserId':_0x55316e[_0x3104('0x36')]['id'],'ContactId':_0x1b3b5a['id'],'MailAccountId':_0x4f3c35['id'],'inReplyTo':_0x6e1107[_0x3104('0xb0')],'to':_0x55316e['body'][_0x3104('0xa6')],'cc':_0x55316e[_0x3104('0x62')]['cc'],'subject':_0x55316e[_0x3104('0x62')][_0x3104('0xb1')],'attach':_0x55316e['body'][_0x3104('0xb2')],'firstMsgDirection':_0x3104('0xb3'),'lastMsgAt':moment()[_0x3104('0x9c')](_0x3104('0x9d')),'lastMsgDirection':'out','Messages':[_[_0x3104('0x58')](_0x55316e[_0x3104('0x62')],{'messageId':_0x6e1107[_0x3104('0xb0')],'sentAt':moment()[_0x3104('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4f3c35['id'],'UserId':_0x55316e[_0x3104('0x36')]['id'],'ContactId':_0x1b3b5a['id']})]};if(_0x55316e[_0x3104('0x62')][_0x3104('0xb4')]){_0x174702=_[_0x3104('0x58')](_0x174702,_0x55316e['body'][_0x3104('0xb4')]);}return db[_0x3104('0x84')][_0x3104('0x6b')](_0x174702,{'include':[{'model':db[_0x3104('0x99')],'as':_0x3104('0xb5')}]});})[_0x3104('0xf')](respondWithResult(_0x50fe4b,null))[_0x3104('0x19')](handleError(_0x50fe4b,null));};exports[_0x3104('0xb6')]=function(_0x1b1de1,_0x42372e){return db['MailAccount'][_0x3104('0x61')]({'where':{'id':_0x1b1de1[_0x3104('0x5f')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x3104('0x42'),'raw':!![],'include':[{'model':db[_0x3104('0xb7')],'as':_0x3104('0xb7'),'raw':!![]}]}]})[_0x3104('0xf')](handleEntityNotFound(_0x42372e,null))[_0x3104('0xf')](function(_0x198a3a){if(!_0x198a3a[_0x3104('0x42')])return;var _0x119d57=_0x198a3a[_0x3104('0xac')]();return respondWithRpcPromise('VerifySmtp',_0x3104('0xb6'),{'account':_0x119d57});})[_0x3104('0xf')](respondWithResult(_0x42372e,null))[_0x3104('0x19')](handleError(_0x42372e,null));};exports[_0x3104('0x24')]=function(_0x2ab16f,_0x20731a){return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x2ab16f[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x20731a,null))['then'](function(_0x17d668){if(_0x17d668&&_0x17d668[_0x3104('0x3e')]){throw new db['Sequelize'][(_0x3104('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x17d668;})['then'](removeEntity(_0x20731a,null))['catch'](handleError(_0x20731a,null));};exports[_0x3104('0xb9')]=function(_0x334f93,_0x470fcf){return db[_0x3104('0x49')][_0x3104('0x61')]({'where':{'id':_0x334f93[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x470fcf,null))['then'](function(_0x37435b){if(_0x37435b){return _0x37435b['addAgents'](_0x334f93[_0x3104('0x62')][_0x3104('0x70')],_[_0x3104('0x85')](_0x334f93[_0x3104('0x62')],['ids','id'])||{})['spread'](function(_0x54fc61){for(var _0x1bb6a0=0x0;_0x1bb6a0<_0x334f93[_0x3104('0x62')][_0x3104('0x70')]['length'];_0x1bb6a0+=0x1){socket[_0x3104('0xba')](_0x3104('0xbb'),{'UserId':Number(_0x334f93[_0x3104('0x62')]['ids'][_0x1bb6a0]),'MailAccountId':Number(_0x334f93[_0x3104('0x5f')]['id'])});}return _0x54fc61;});}})[_0x3104('0xf')](respondWithResult(_0x470fcf,null))[_0x3104('0x19')](handleError(_0x470fcf,null));};exports[_0x3104('0xbc')]=function(_0xf2aff7,_0x312ca3){return db['MailAccount'][_0x3104('0x61')]({'where':{'id':_0xf2aff7['params']['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x312ca3,null))['then'](function(_0x24ee08){if(_0x24ee08){return _0x24ee08[_0x3104('0xbc')](_0xf2aff7[_0x3104('0x4b')]['ids'])[_0x3104('0xf')](function(){if(_[_0x3104('0xbd')](_0xf2aff7[_0x3104('0x4b')][_0x3104('0x70')])){for(var _0x514354=0x0;_0x514354<_0xf2aff7[_0x3104('0x4b')][_0x3104('0x70')][_0x3104('0x51')];_0x514354+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0xf2aff7[_0x3104('0x4b')][_0x3104('0x70')][_0x514354]),'MailAccountId':Number(_0xf2aff7[_0x3104('0x5f')]['id'])});}}else{socket['emit'](_0x3104('0xbe'),{'UserId':Number(_0xf2aff7['query'][_0x3104('0x70')]),'MailAccountId':Number(_0xf2aff7[_0x3104('0x5f')]['id'])});}});}})[_0x3104('0xf')](respondWithStatusCode(_0x312ca3,null))[_0x3104('0x19')](handleError(_0x312ca3,null));};exports['getAgents']=function(_0x32b5bd,_0x46f2b8){var _0x302c98={};var _0x5864b2={};var _0xa0f188;var _0x31bc72;return db[_0x3104('0x49')][_0x3104('0x6d')]({'where':{'id':_0x32b5bd[_0x3104('0x5f')]['id']}})[_0x3104('0xf')](handleEntityNotFound(_0x46f2b8,null))[_0x3104('0xf')](function(_0x57ebfa){if(_0x57ebfa){_0xa0f188=_0x57ebfa;_0x5864b2[_0x3104('0x4a')]=_[_0x3104('0x4c')](db[_0x3104('0x89')][_0x3104('0x60')]);_0x5864b2[_0x3104('0x4b')]=_[_0x3104('0x4c')](_0x32b5bd['query']);_0x5864b2['filters']=_[_0x3104('0x4e')](_0x5864b2[_0x3104('0x4a')],_0x5864b2['query']);_0x302c98[_0x3104('0x4f')]=_[_0x3104('0x4e')](_0x5864b2[_0x3104('0x4a')],qs[_0x3104('0x50')](_0x32b5bd[_0x3104('0x4b')][_0x3104('0x50')]));_0x302c98[_0x3104('0x4f')]=_0x302c98[_0x3104('0x4f')][_0x3104('0x51')]?_0x302c98[_0x3104('0x4f')]:_0x5864b2[_0x3104('0x4a')];_0x302c98['order']=qs[_0x3104('0x54')](_0x32b5bd[_0x3104('0x4b')][_0x3104('0x54')]);_0x302c98[_0x3104('0x55')]=qs[_0x3104('0x4d')](_[_0x3104('0x56')](_0x32b5bd['query'],_0x5864b2['filters']));if(_0x32b5bd[_0x3104('0x4b')][_0x3104('0x57')]){_0x302c98[_0x3104('0x55')]=_[_0x3104('0x58')](_0x302c98[_0x3104('0x55')],{'$or':_['map'](_0x302c98[_0x3104('0x4f')],function(_0x2dbf99){var _0x584ac8={};_0x584ac8[_0x2dbf99]={'$like':'%'+_0x32b5bd[_0x3104('0x4b')][_0x3104('0x57')]+'%'};return _0x584ac8;})});}_0x302c98=_[_0x3104('0x58')]({},_0x302c98,_0x32b5bd[_0x3104('0x5a')]);return _0xa0f188[_0x3104('0xbf')](_0x302c98);}})[_0x3104('0xf')](function(_0x4c83c9){if(_0x4c83c9){_0x31bc72=_0x4c83c9[_0x3104('0x51')];if(!_0x32b5bd[_0x3104('0x4b')][_0x3104('0x52')]('nolimit')){_0x302c98[_0x3104('0x1f')]=qs[_0x3104('0x1f')](_0x32b5bd[_0x3104('0x4b')][_0x3104('0x1f')]);_0x302c98[_0x3104('0x21')]=qs['offset'](_0x32b5bd[_0x3104('0x4b')][_0x3104('0x21')]);}return _0xa0f188[_0x3104('0xbf')](_0x302c98);}})[_0x3104('0xf')](function(_0x21142e){if(_0x21142e){return _0x21142e?{'count':_0x31bc72,'rows':_0x21142e}:null;}})[_0x3104('0xf')](respondWithResult(_0x46f2b8,null))[_0x3104('0x19')](handleError(_0x46f2b8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 46b5909..cf7ec8f 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 _0x7097=['MailAccount','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1b944d,_0x14ac0f){var _0x1caddc=function(_0x3290b3){while(--_0x3290b3){_0x1b944d['push'](_0x1b944d['shift']());}};_0x1caddc(++_0x14ac0f);}(_0x7097,0x1be));var _0x7709=function(_0x3a515c,_0x14709a){_0x3a515c=_0x3a515c-0x0;var _0x5be4a5=_0x7097[_0x3a515c];return _0x5be4a5;};'use strict';var EventEmitter=require(_0x7709('0x0'));var MailAccount=require(_0x7709('0x1'))['db'][_0x7709('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7709('0x3'),'afterDestroy':_0x7709('0x4')};function emitEvent(_0x1f3e60){return function(_0x48396f,_0x335a2c,_0x4f076c){MailAccountEvents[_0x7709('0x5')](_0x1f3e60+':'+_0x48396f['id'],_0x48396f);MailAccountEvents['emit'](_0x1f3e60,_0x48396f);_0x4f076c(null);};}for(var e in events){if(events[_0x7709('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x7709('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x2a07=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x1db558,_0x519349){var _0xf5dd19=function(_0x216fe5){while(--_0x216fe5){_0x1db558['push'](_0x1db558['shift']());}};_0xf5dd19(++_0x519349);}(_0x2a07,0x74));var _0x72a0=function(_0x1f96d7,_0x20d141){_0x1f96d7=_0x1f96d7-0x0;var _0x728705=_0x2a07[_0x1f96d7];return _0x728705;};'use strict';var EventEmitter=require(_0x72a0('0x0'));var MailAccount=require(_0x72a0('0x1'))['db'][_0x72a0('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x72a0('0x3')](0x0);var events={'afterCreate':_0x72a0('0x4'),'afterUpdate':'update','afterDestroy':_0x72a0('0x5')};function emitEvent(_0x5f7f29){return function(_0x135982,_0x45b155,_0x431f65){MailAccountEvents[_0x72a0('0x6')](_0x5f7f29+':'+_0x135982['id'],_0x135982);MailAccountEvents[_0x72a0('0x6')](_0x5f7f29,_0x135982);_0x431f65(null);};}for(var e in events){if(events[_0x72a0('0x7')](e)){var event=events[e];MailAccount[_0x72a0('0x8')](e,emitEvent(event));}}module[_0x72a0('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6541efb..03af0eb 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 _0x1ca2=['Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','define','mail_accounts','provider','custom','service','host'];(function(_0x1e2eb5,_0x2846bd){var _0x19408b=function(_0x4fd183){while(--_0x4fd183){_0x1e2eb5['push'](_0x1e2eb5['shift']());}};_0x19408b(++_0x2846bd);}(_0x1ca2,0x1df));var _0x21ca=function(_0x240700,_0x13e7d9){_0x240700=_0x240700-0x0;var _0x51530c=_0x1ca2[_0x240700];return _0x51530c;};'use strict';var attributes=require(_0x21ca('0x0'));module['exports']=function(_0x3d11c5){return _0x3d11c5[_0x21ca('0x1')]('MailAccount',attributes,{'tableName':_0x21ca('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x256d6d=this;var _0x17a529={'id':_0x256d6d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x256d6d[_0x21ca('0x3')]!==_0x21ca('0x4')){_0x17a529[_0x21ca('0x5')]=_0x256d6d[_0x21ca('0x3')];}else{_0x17a529[_0x21ca('0x6')]=_0x256d6d[_0x21ca('0x7')][_0x21ca('0x6')];_0x17a529[_0x21ca('0x8')]=_0x256d6d[_0x21ca('0x7')][_0x21ca('0x8')];_0x17a529['secure']=_0x256d6d[_0x21ca('0x7')][_0x21ca('0x9')];}if(_0x256d6d[_0x21ca('0x7')][_0x21ca('0xa')]){if(_0x256d6d['Smtp'][_0x21ca('0xb')]){if(!_0x256d6d[_0x21ca('0x7')][_0x21ca('0xc')])throw new Error(_0x21ca('0xd'));_0x17a529[_0x21ca('0xe')]={'type':'OAuth2','user':_0x256d6d['Smtp'][_0x21ca('0xf')],'accessToken':_0x256d6d[_0x21ca('0x7')][_0x21ca('0xc')][_0x21ca('0x10')]};}else{_0x17a529[_0x21ca('0xe')]={'user':_0x256d6d[_0x21ca('0x7')][_0x21ca('0xf')],'pass':_0x256d6d['Smtp'][_0x21ca('0x11')]};}}return _0x17a529;}}});}; \ No newline at end of file +var _0x98f0=['modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','data5','pass','./mailAccount.attributes','exports','mail_accounts','service','provider','host','Smtp','port','secure','authentication'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x98f0,0x6d));var _0x098f=function(_0x4ae3fd,_0x1d3481){_0x4ae3fd=_0x4ae3fd-0x0;var _0x491024=_0x98f0[_0x4ae3fd];return _0x491024;};'use strict';var attributes=require(_0x098f('0x0'));module[_0x098f('0x1')]=function(_0x37b29b){return _0x37b29b['define']('MailAccount',attributes,{'tableName':_0x098f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x376970=this;var _0x50afc9={'id':_0x376970['id'],'tls':{'rejectUnauthorized':![]}};if(_0x376970['provider']!=='custom'){_0x50afc9[_0x098f('0x3')]=_0x376970[_0x098f('0x4')];}else{_0x50afc9[_0x098f('0x5')]=_0x376970[_0x098f('0x6')][_0x098f('0x5')];_0x50afc9[_0x098f('0x7')]=_0x376970['Smtp']['port'];_0x50afc9['secure']=_0x376970[_0x098f('0x6')][_0x098f('0x8')];}if(_0x376970[_0x098f('0x6')][_0x098f('0x9')]){if(_0x376970[_0x098f('0x6')][_0x098f('0xa')]){if(!_0x376970[_0x098f('0x6')]['CloudProvider'])throw new Error(_0x098f('0xb'));_0x50afc9[_0x098f('0xc')]={'type':'OAuth2','user':_0x376970['Smtp'][_0x098f('0xd')],'accessToken':_0x376970['Smtp'][_0x098f('0xe')][_0x098f('0xf')]};}else{_0x50afc9['auth']={'user':_0x376970['Smtp'][_0x098f('0xd')],'pass':_0x376970['Smtp'][_0x098f('0x10')]};}}return _0x50afc9;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 0622be1..a469dcf 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 _0x7880=['info','ShowMailAccount','find','where','smtp','smtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','DESC','MailApplication','Applications','Smtp','CloudProvider','get','getSmtpOptions','applications','list','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','ListId','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','Contact\x20not\x20found','update','format','interaction','created','attachments','originTo','originCc','bcc','originChannel','Attachment','Attachments','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','include','map','model'];(function(_0x3e19da,_0x5797a7){var _0x369c1c=function(_0x3d6820){while(--_0x3d6820){_0x3e19da['push'](_0x3e19da['shift']());}};_0x369c1c(++_0x5797a7);}(_0x7880,0x1f4));var _0x0788=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x7880[_0x3be2e2];return _0x53b9c5;};'use strict';var _=require('lodash');var moment=require(_0x0788('0x0'));var BPromise=require(_0x0788('0x1'));var rs=require(_0x0788('0x2'));var Redis=require(_0x0788('0x3'));var db=require(_0x0788('0x4'))['db'];var logger=require(_0x0788('0x5'))('rpc');var config=require(_0x0788('0x6'));var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232c});config[_0x0788('0xa')]=_[_0x0788('0xb')](config[_0x0788('0xa')],{'host':_0x0788('0xc'),'port':0x18eb});var socket=require(_0x0788('0xd'))(new Redis(config[_0x0788('0xa')]));require('./mailAccount.socket')[_0x0788('0xe')](socket);function respondWithRpcPromise(_0x49f53b,_0xabaf81,_0x53b2f2){return new BPromise(function(_0x433c26,_0x3c6d18){return client[_0x0788('0xf')](_0x49f53b,_0x53b2f2)[_0x0788('0x10')](function(_0x469ebe){logger['info'](_0x0788('0x11'),_0xabaf81,_0x0788('0x12'));logger[_0x0788('0x13')](_0x0788('0x14'),_0xabaf81,_0x0788('0x12'),JSON[_0x0788('0x15')](_0x469ebe));if(_0x469ebe[_0x0788('0x16')]){if(_0x469ebe['error'][_0x0788('0x17')]===0x1f4){logger[_0x0788('0x16')](_0x0788('0x11'),_0xabaf81,_0x469ebe[_0x0788('0x16')]['message']);return _0x3c6d18(_0x469ebe[_0x0788('0x16')]['message']);}logger[_0x0788('0x16')](_0x0788('0x11'),_0xabaf81,_0x469ebe[_0x0788('0x16')][_0x0788('0x18')]);return _0x433c26(_0x469ebe[_0x0788('0x16')][_0x0788('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0xabaf81,_0x0788('0x12'));_0x433c26(_0x469ebe[_0x0788('0x19')]['message']);}})[_0x0788('0x1a')](function(_0x415f19){logger[_0x0788('0x16')]('MailAccount,\x20%s,\x20%s',_0xabaf81,_0x415f19);_0x3c6d18(_0x415f19);});});}exports[_0x0788('0x1b')]=function(_0x3fb723){var _0x492c2c=this;return new Promise(function(_0x11ea01,_0x5173d6){return db[_0x0788('0x1c')]['findAll']({'raw':_0x3fb723[_0x0788('0x1d')]?_0x3fb723[_0x0788('0x1d')][_0x0788('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fb723[_0x0788('0x1d')]?_0x3fb723[_0x0788('0x1d')]['where']||null:null,'attributes':_0x3fb723['options']?_0x3fb723[_0x0788('0x1d')][_0x0788('0x1f')]||null:null,'limit':_0x3fb723[_0x0788('0x1d')]?_0x3fb723[_0x0788('0x1d')]['limit']||null:null,'include':_0x3fb723['options']?_0x3fb723[_0x0788('0x1d')][_0x0788('0x20')]?_[_0x0788('0x21')](_0x3fb723['options']['include'],function(_0x240459){return{'model':db[_0x240459[_0x0788('0x22')]],'as':_0x240459['as'],'attributes':_0x240459['attributes'],'include':_0x240459['include']?_[_0x0788('0x21')](_0x240459[_0x0788('0x20')],function(_0x57fda1){return{'model':db[_0x57fda1[_0x0788('0x22')]],'as':_0x57fda1['as'],'attributes':_0x57fda1[_0x0788('0x1f')],'include':_0x57fda1[_0x0788('0x20')]?_[_0x0788('0x21')](_0x57fda1[_0x0788('0x20')],function(_0xb2f4a5){return{'model':db[_0xb2f4a5[_0x0788('0x22')]],'as':_0xb2f4a5['as'],'attributes':_0xb2f4a5[_0x0788('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a5178){logger[_0x0788('0x23')](_0x0788('0x1b'),_0x3fb723);logger['debug']('GetMailAccount',_0x3fb723,JSON[_0x0788('0x15')](_0x5a5178));_0x11ea01(_0x5a5178);})[_0x0788('0x1a')](function(_0x20fcd8){logger[_0x0788('0x16')](_0x0788('0x1b'),_0x20fcd8[_0x0788('0x18')],_0x3fb723);_0x5173d6(_0x492c2c[_0x0788('0x16')](0x1f4,_0x20fcd8[_0x0788('0x18')]));});});};exports[_0x0788('0x24')]=function(_0x85e579){var _0x5ec0ed=this;return new Promise(function(_0x2a08b7,_0x1aab6a){return db[_0x0788('0x1c')][_0x0788('0x25')]({'raw':_0x85e579[_0x0788('0x1d')]?_0x85e579[_0x0788('0x1d')][_0x0788('0x1e')]===undefined?!![]:![]:!![],'where':_0x85e579[_0x0788('0x1d')]?_0x85e579[_0x0788('0x1d')][_0x0788('0x26')]||null:null,'attributes':_0x85e579['options']?_0x85e579['options']['attributes']||null:null,'include':_0x85e579['options']?_0x85e579['options']['include']?_[_0x0788('0x21')](_0x85e579[_0x0788('0x1d')][_0x0788('0x20')],function(_0x574576){return{'model':db[_0x574576[_0x0788('0x22')]],'as':_0x574576['as'],'attributes':_0x574576[_0x0788('0x1f')],'include':_0x574576[_0x0788('0x20')]?_[_0x0788('0x21')](_0x574576['include'],function(_0x2ed940){return{'model':db[_0x2ed940['model']],'as':_0x2ed940['as'],'attributes':_0x2ed940[_0x0788('0x1f')],'include':_0x2ed940['include']?_[_0x0788('0x21')](_0x2ed940[_0x0788('0x20')],function(_0x498e16){return{'model':db[_0x498e16[_0x0788('0x22')]],'as':_0x498e16['as'],'attributes':_0x498e16[_0x0788('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17240e){if(_0x85e579['options'][_0x0788('0x27')]===!![])_0x17240e['setDataValue'](_0x0788('0x28'),_0x17240e['getSmtpOptions']());logger[_0x0788('0x23')]('ShowMailAccount',_0x85e579);logger['debug'](_0x0788('0x24'),_0x85e579,JSON[_0x0788('0x15')](_0x17240e));_0x2a08b7(_0x17240e);})[_0x0788('0x1a')](function(_0x2d17b0){logger[_0x0788('0x16')]('ShowMailAccount',_0x2d17b0['message'],_0x85e579);_0x1aab6a(_0x5ec0ed['error'](0x1f4,_0x2d17b0['message']));});});};exports[_0x0788('0x29')]=function(_0x1202c4){var _0x45b247=this;return new Promise(function(_0x358a22,_0x362c49){var _0x5993ad={'body':_0x1202c4['body'],'channel':_0x0788('0x2a')};var _0x6770a8=_[_0x0788('0x2b')](_[_0x0788('0x2c')](db[_0x0788('0x2d')][_0x0788('0x2e')]),[_0x0788('0x2f'),_0x0788('0x30'),_0x0788('0x31'),'ListId']);var _0x5581e6=![];if(_0x1202c4[_0x0788('0x32')]['id']){delete _0x1202c4[_0x0788('0x32')]['id'];}if(_[_0x0788('0x33')](_0x1202c4['body']['from'])){return _0x362c49(_0x45b247['error'](0x1f4,_0x0788('0x34')));}if(_[_0x0788('0x33')](_0x1202c4[_0x0788('0x32')][_0x0788('0x32')])||_0x1202c4[_0x0788('0x32')][_0x0788('0x32')]===''){return _0x362c49(_0x45b247[_0x0788('0x16')](0x1f4,_0x0788('0x35')));}if(_['isNil'](_0x1202c4[_0x0788('0x32')][_0x0788('0x36')])){return _0x362c49(_0x45b247[_0x0788('0x16')](0x1f4,_0x0788('0x37')+_0x6770a8));}if(!_['includes'](_0x6770a8,_0x1202c4[_0x0788('0x32')][_0x0788('0x36')])){return _0x362c49(_0x45b247['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6770a8));}var _0x524b43={};_0x524b43[_0x1202c4[_0x0788('0x32')]['mapKey']]=_0x1202c4[_0x0788('0x32')][_0x0788('0x38')];return db[_0x0788('0x1c')][_0x0788('0x25')]({'where':{'id':_0x1202c4[_0x0788('0x39')]['id']},'include':[{'model':db[_0x0788('0x3a')],'as':_0x0788('0x3b'),'include':[{'model':db[_0x0788('0x2d')],'as':'Contacts','where':_0x524b43,'limit':0x1,'order':[['updatedAt',_0x0788('0x3c')]]}]},{'model':db[_0x0788('0x3d')],'as':_0x0788('0x3e')},{'model':db['MailServerOut'],'as':_0x0788('0x3f'),'include':[{'model':db[_0x0788('0x40')],'as':_0x0788('0x40')}]}]})[_0x0788('0x10')](function(_0x2395ad){if(_0x2395ad&&_0x2395ad['List']){var _0x5c436a=_0x2395ad[_0x0788('0x41')]({'plain':!![]});_0x5993ad[_0x0788('0x39')]=_['omit'](_0x5c436a,[_0x0788('0x3e'),'List']);_0x5993ad[_0x0788('0x39')][_0x0788('0x28')]=_0x2395ad[_0x0788('0x42')]();_0x5993ad[_0x0788('0x43')]=_0x5c436a[_0x0788('0x3e')];_0x5993ad[_0x0788('0x44')]=_0x5c436a[_0x0788('0x3b')];_0x5993ad[_0x0788('0x43')]=_['orderBy'](_0x5993ad[_0x0788('0x43')],[_0x0788('0x45')],[_0x0788('0x46')]);if(_0x5993ad['account']&&_0x5993ad[_0x0788('0x39')][_0x0788('0x47')]){_0x5993ad['applications'][_0x0788('0x48')]({'id':0x0,'priority':_0x5993ad[_0x0788('0x43')][_0x0788('0x49')]+0x1,'app':_0x0788('0x4a'),'appdata':_0x0788('0x47'),'interval':_0x0788('0x4b')});}if(_0x5993ad['account']['Applications']){delete _0x5993ad[_0x0788('0x39')][_0x0788('0x3e')];}if(_0x5993ad['account'][_0x0788('0x3b')]){delete _0x5993ad[_0x0788('0x39')][_0x0788('0x3b')];}if(_0x5c436a[_0x0788('0x3b')][_0x0788('0x4c')][_0x0788('0x49')]){return _0x5c436a[_0x0788('0x3b')][_0x0788('0x4c')][0x0];}var _0x35f290=_[_0x0788('0xb')](_0x1202c4[_0x0788('0x32')],{'firstName':_0x1202c4[_0x0788('0x32')]['from'],'ListId':_0x5c436a[_0x0788('0x4d')]});_0x35f290[_0x1202c4[_0x0788('0x32')][_0x0788('0x36')]]=_0x1202c4['body'][_0x0788('0x38')];return db[_0x0788('0x2d')]['create'](_0x35f290);}else{throw new Error('List\x20not\x20found');}})[_0x0788('0x10')](function(_0x26826a){_0x5993ad[_0x0788('0x4e')]=_0x26826a;if(_0x26826a){if(!_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x4f')]){_0x1202c4['body'][_0x0788('0x18')][_0x0788('0x4f')]=rs[_0x0788('0x50')]()+'\x20'+_0x1202c4['body']['message'][_0x0788('0x38')];}var _0x5419d9={'ContactId':_0x26826a['id'],'MailAccountId':_0x1202c4[_0x0788('0x39')]['id'],'inReplyTo':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x4f')],'to':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x38')],'cc':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['cc'],'subject':_0x1202c4[_0x0788('0x32')]['message'][_0x0788('0x51')],'attach':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x52')],'lastMsgAt':moment()['format'](_0x0788('0x53')),'lastMsgDirection':'in'};return db[_0x0788('0x54')][_0x0788('0x25')]({'where':{'closed':![],'MailAccountId':_0x1202c4[_0x0788('0x39')]['id']},'include':[{'model':db[_0x0788('0x55')],'as':'Messages','attributes':[_0x0788('0x4f')],'where':{'messageId':_0x1202c4['body'][_0x0788('0x18')][_0x0788('0x56')]}}]})[_0x0788('0x10')](function(_0x47f22c){if(_0x47f22c){return[_0x47f22c,![]];}return db[_0x0788('0x54')][_0x0788('0x57')](_0x5419d9)[_0x0788('0x10')](function(_0x150403){return[_0x150403,!![]];});});}else{throw new Error(_0x0788('0x58'));}})['spread'](function(_0x25201f,_0x2dea6c){if(_0x25201f){_0x5581e6=_0x2dea6c;if(!_0x2dea6c){return _0x25201f[_0x0788('0x59')]({'inReplyTo':_0x1202c4['body']['message'][_0x0788('0x4f')],'to':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['from'],'cc':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['cc'],'subject':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['subject'],'attach':_0x25201f['attach']?_0x25201f['attach']:_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x52')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0788('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x25201f;}}})[_0x0788('0x10')](function(_0x3d1181){_0x5993ad[_0x0788('0x5b')]=_0x3d1181[_0x0788('0x41')]({'plain':!![]});_0x5993ad[_0x0788('0x5b')][_0x0788('0x5c')]=_0x5581e6;return db[_0x0788('0x55')][_0x0788('0x57')]({'body':_0x1202c4[_0x0788('0x32')][_0x0788('0x32')],'MailAccountId':_0x1202c4['account']['id'],'MailInteractionId':_0x3d1181['id'],'direction':'in','ContactId':_0x5993ad[_0x0788('0x4e')]['id'],'messageId':_0x1202c4[_0x0788('0x32')]['message']['messageId'],'from':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x38')],'to':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['to'],'cc':_0x1202c4[_0x0788('0x32')]['message']['cc'],'subject':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x51')],'attach':_0x1202c4[_0x0788('0x32')]['message'][_0x0788('0x52')],'Attachments':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x5d')],'originTo':_0x1202c4['body']['message'][_0x0788('0x5e')],'originCc':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x5f')],'bcc':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x60')],'ChatWebsiteId':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')]['ChatWebsiteId']||null,'originChannel':_0x1202c4[_0x0788('0x32')][_0x0788('0x18')][_0x0788('0x61')]||'Email','ChatOfflineMessageId':_0x1202c4['body'][_0x0788('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x0788('0x62')],'as':_0x0788('0x63')}]});})[_0x0788('0x10')](function(_0xa4b3f8){_0x5993ad[_0x0788('0x18')]=_0xa4b3f8;if(_0x5993ad[_0x0788('0x5b')][_0x0788('0x64')]){return db[_0x0788('0x65')][_0x0788('0x25')]({'attributes':['id','name'],'where':{'id':_0x5993ad[_0x0788('0x5b')][_0x0788('0x64')]}})[_0x0788('0x10')](function(_0x54fd89){if(_0x54fd89){_0x5993ad[_0x0788('0x43')][_0x0788('0x66')]({'id':0x0,'priority':0x0,'app':_0x0788('0x67'),'appdata':_0x54fd89['name']+','+(_0x5993ad[_0x0788('0x39')][_0x0788('0x68')]||0xa),'interval':_0x0788('0x4b')});}return respondWithRpcPromise(_0x0788('0x69'),_0x0788('0x6a'),_0x5993ad);});}return respondWithRpcPromise(_0x0788('0x69'),_0x0788('0x6a'),_0x5993ad);})[_0x0788('0x10')](function(_0x25058b){_0x358a22(_0x25058b);})['catch'](function(_0x471b3a){_0x362c49(_0x45b247[_0x0788('0x16')](0x1f4,_0x471b3a[_0x0788('0x18')]));});});}; \ No newline at end of file +var _0x5f2f=['Attachments','UserId','User','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailAccount','options','where','limit','include','model','attributes','map','MailAccount','find','raw','then','smtp','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','applications','Applications','priority','asc','autoclose','push','close','Contacts','length','create','messageId','subject','format','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','interaction','contact','attachments','originCc','originChannel','Email','ChatOfflineMessageId','Attachment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4e4255,_0x3e4f0c){_0x4e4255=_0x4e4255-0x0;var _0x19faa3=_0x5f2f[_0x4e4255];return _0x19faa3;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var BPromise=require(_0xf5f2('0x2'));var rs=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var db=require(_0xf5f2('0x5'))['db'];var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5f2('0x8')][_0xf5f2('0x9')]({'port':0x232c});config[_0xf5f2('0xa')]=_[_0xf5f2('0xb')](config[_0xf5f2('0xa')],{'host':_0xf5f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0xa')]));require(_0xf5f2('0xd'))[_0xf5f2('0xe')](socket);function respondWithRpcPromise(_0x56a69f,_0x375da4,_0x15dd7c){return new BPromise(function(_0x218ae3,_0x4e0e6b){return client[_0xf5f2('0xf')](_0x56a69f,_0x15dd7c)['then'](function(_0x53fb33){logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,'request\x20sent');logger[_0xf5f2('0x12')](_0xf5f2('0x13'),_0x375da4,_0xf5f2('0x14'),JSON[_0xf5f2('0x15')](_0x53fb33));if(_0x53fb33[_0xf5f2('0x16')]){if(_0x53fb33[_0xf5f2('0x16')]['code']===0x1f4){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x4e0e6b(_0x53fb33[_0xf5f2('0x16')]['message']);}logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);return _0x218ae3(_0x53fb33[_0xf5f2('0x16')][_0xf5f2('0x17')]);}else{logger[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x375da4,_0xf5f2('0x14'));_0x218ae3(_0x53fb33[_0xf5f2('0x18')][_0xf5f2('0x17')]);}})[_0xf5f2('0x19')](function(_0x4ff59b){logger[_0xf5f2('0x16')](_0xf5f2('0x11'),_0x375da4,_0x4ff59b);_0x4e0e6b(_0x4ff59b);});});}exports[_0xf5f2('0x1a')]=function(_0x1bf655){var _0x56acc5=this;return new Promise(function(_0x34706d,_0x47101e){return db['MailAccount']['findAll']({'raw':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1c')]||null:null,'attributes':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['attributes']||null:null,'limit':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1d')]||null:null,'include':_0x1bf655[_0xf5f2('0x1b')]?_0x1bf655[_0xf5f2('0x1b')]['include']?_['map'](_0x1bf655[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')],'include':_0x294414[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x294414[_0xf5f2('0x1e')],function(_0x198c73){return{'model':db[_0x198c73[_0xf5f2('0x1f')]],'as':_0x198c73['as'],'attributes':_0x198c73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22c826){logger[_0xf5f2('0x10')](_0xf5f2('0x1a'),_0x1bf655);logger['debug']('GetMailAccount',_0x1bf655,JSON[_0xf5f2('0x15')](_0x22c826));_0x34706d(_0x22c826);})[_0xf5f2('0x19')](function(_0x17394a){logger[_0xf5f2('0x16')](_0xf5f2('0x1a'),_0x17394a['message'],_0x1bf655);_0x47101e(_0x56acc5['error'](0x1f4,_0x17394a[_0xf5f2('0x17')]));});});};exports['ShowMailAccount']=function(_0xb744b9){var _0x58a4df=this;return new Promise(function(_0x45b643,_0x31087c){return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'raw':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x24')]===undefined?!![]:![]:!![],'where':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9['options'][_0xf5f2('0x1c')]||null:null,'attributes':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null,'include':_0xb744b9[_0xf5f2('0x1b')]?_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')]?_['map'](_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes'],'include':_0x2e3cca[_0xf5f2('0x1e')]?_[_0xf5f2('0x21')](_0x2e3cca[_0xf5f2('0x1e')],function(_0x4ec8fb){return{'model':db[_0x4ec8fb[_0xf5f2('0x1f')]],'as':_0x4ec8fb['as'],'attributes':_0x4ec8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x25')](function(_0x566c47){if(_0xb744b9[_0xf5f2('0x1b')][_0xf5f2('0x26')]===!![])_0x566c47['setDataValue'](_0xf5f2('0x27'),_0x566c47[_0xf5f2('0x28')]());logger[_0xf5f2('0x10')](_0xf5f2('0x29'),_0xb744b9);logger['debug']('ShowMailAccount',_0xb744b9,JSON[_0xf5f2('0x15')](_0x566c47));_0x45b643(_0x566c47);})[_0xf5f2('0x19')](function(_0x22b20c){logger[_0xf5f2('0x16')](_0xf5f2('0x29'),_0x22b20c[_0xf5f2('0x17')],_0xb744b9);_0x31087c(_0x58a4df[_0xf5f2('0x16')](0x1f4,_0x22b20c['message']));});});};exports[_0xf5f2('0x2a')]=function(_0x3b4ea6){var _0x536501=this;return new Promise(function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'body':_0x3b4ea6[_0xf5f2('0x2b')],'channel':_0xf5f2('0x2c')};var _0x3b6372=_[_0xf5f2('0x2d')](_[_0xf5f2('0x2e')](db['CmContact'][_0xf5f2('0x2f')]),[_0xf5f2('0x30'),_0xf5f2('0x31'),'CompanyId','ListId']);var _0x59eb00=![];if(_0x3b4ea6[_0xf5f2('0x2b')]['id']){delete _0x3b4ea6[_0xf5f2('0x2b')]['id'];}if(_['isNil'](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x33')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')])||_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')]===''){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x35')));}if(_[_0xf5f2('0x34')](_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501['error'](0x1f4,_0xf5f2('0x37')+_0x3b6372));}if(!_['includes'](_0x3b6372,_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x36')])){return _0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0xf5f2('0x38')+_0x3b6372));}var _0x31bf0e={};_0x31bf0e[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x22')][_0xf5f2('0x23')]({'where':{'id':_0x3b4ea6[_0xf5f2('0x39')]['id']},'include':[{'model':db[_0xf5f2('0x3a')],'as':_0xf5f2('0x3b'),'include':[{'model':db[_0xf5f2('0x3c')],'as':'Contacts','where':_0x31bf0e,'limit':0x1,'order':[[_0xf5f2('0x31'),_0xf5f2('0x3d')]]}]},{'model':db[_0xf5f2('0x3e')],'as':'Applications'},{'model':db[_0xf5f2('0x3f')],'as':_0xf5f2('0x40'),'include':[{'model':db[_0xf5f2('0x41')],'as':'CloudProvider'}]}]})['then'](function(_0x7bb942){if(_0x7bb942&&_0x7bb942[_0xf5f2('0x3b')]){var _0x5db519=_0x7bb942[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7['account']=_[_0xf5f2('0x43')](_0x5db519,['Applications',_0xf5f2('0x3b')]);_0x71b0e7['account'][_0xf5f2('0x27')]=_0x7bb942[_0xf5f2('0x28')]();_0x71b0e7[_0xf5f2('0x44')]=_0x5db519[_0xf5f2('0x45')];_0x71b0e7['list']=_0x5db519[_0xf5f2('0x3b')];_0x71b0e7[_0xf5f2('0x44')]=_['orderBy'](_0x71b0e7['applications'],[_0xf5f2('0x46')],[_0xf5f2('0x47')]);if(_0x71b0e7['account']&&_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x48')]){_0x71b0e7[_0xf5f2('0x44')][_0xf5f2('0x49')]({'id':0x0,'priority':_0x71b0e7['applications']['length']+0x1,'app':_0xf5f2('0x4a'),'appdata':_0xf5f2('0x48'),'interval':'*,*,*,*'});}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')]){delete _0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x45')];}if(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x3b')]){delete _0x71b0e7[_0xf5f2('0x39')]['List'];}if(_0x5db519['List'][_0xf5f2('0x4b')][_0xf5f2('0x4c')]){return _0x5db519[_0xf5f2('0x3b')][_0xf5f2('0x4b')][0x0];}var _0x21b0d3=_['defaults'](_0x3b4ea6[_0xf5f2('0x2b')],{'firstName':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')],'ListId':_0x5db519['ListId']});_0x21b0d3[_0x3b4ea6[_0xf5f2('0x2b')]['mapKey']]=_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x32')];return db[_0xf5f2('0x3c')][_0xf5f2('0x4d')](_0x21b0d3);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x756f1f){_0x71b0e7['contact']=_0x756f1f;if(_0x756f1f){if(!_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['messageId']){_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4e')]=rs['generate']()+'\x20'+_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')];}var _0x4579f4={'ContactId':_0x756f1f['id'],'MailAccountId':_0x3b4ea6['account']['id'],'inReplyTo':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'cc':_0x3b4ea6[_0xf5f2('0x2b')]['message']['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['attach'],'lastMsgAt':moment()[_0xf5f2('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xf5f2('0x23')]({'where':{'closed':![],'MailAccountId':_0x3b4ea6['account']['id']},'include':[{'model':db[_0xf5f2('0x51')],'as':_0xf5f2('0x52'),'attributes':[_0xf5f2('0x4e')],'where':{'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x53')]}}]})[_0xf5f2('0x25')](function(_0x1ec682){if(_0x1ec682){return[_0x1ec682,![]];}return db[_0xf5f2('0x54')][_0xf5f2('0x4d')](_0x4579f4)[_0xf5f2('0x25')](function(_0x158768){return[_0x158768,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5f2('0x55')](function(_0x2d171d,_0xb39a6e){if(_0x2d171d){_0x59eb00=_0xb39a6e;if(!_0xb39a6e){return _0x2d171d[_0xf5f2('0x56')]({'inReplyTo':_0x3b4ea6['body'][_0xf5f2('0x17')]['messageId'],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['from'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x2d171d['attach']?_0x2d171d[_0xf5f2('0x57')]:_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x57')],'substatus':null,'substatusAt':moment()[_0xf5f2('0x50')](_0xf5f2('0x58')),'lastMsgAt':moment()['format'](_0xf5f2('0x58')),'lastMsgDirection':'in'});}else{return _0x2d171d;}}})[_0xf5f2('0x25')](function(_0x4800fe){_0x71b0e7[_0xf5f2('0x59')]=_0x4800fe[_0xf5f2('0x42')]({'plain':!![]});_0x71b0e7[_0xf5f2('0x59')]['created']=_0x59eb00;return db['MailMessage']['create']({'body':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x2b')],'MailAccountId':_0x3b4ea6[_0xf5f2('0x39')]['id'],'MailInteractionId':_0x4800fe['id'],'direction':'in','ContactId':_0x71b0e7[_0xf5f2('0x5a')]['id'],'messageId':_0x3b4ea6[_0xf5f2('0x2b')]['message'][_0xf5f2('0x4e')],'from':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x32')],'to':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['to'],'cc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['cc'],'subject':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x4f')],'attach':_0x3b4ea6['body']['message']['attach'],'Attachments':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5b')],'originTo':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['originTo'],'originCc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5c')],'bcc':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['bcc'],'ChatWebsiteId':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')]['ChatWebsiteId']||null,'originChannel':_0x3b4ea6[_0xf5f2('0x2b')][_0xf5f2('0x17')][_0xf5f2('0x5d')]||_0xf5f2('0x5e'),'ChatOfflineMessageId':_0x3b4ea6['body'][_0xf5f2('0x17')][_0xf5f2('0x5f')]||null},{'include':[{'model':db[_0xf5f2('0x60')],'as':_0xf5f2('0x61')}]});})[_0xf5f2('0x25')](function(_0x4f47e1){_0x71b0e7['message']=_0x4f47e1;if(_0x71b0e7[_0xf5f2('0x59')][_0xf5f2('0x62')]){return db[_0xf5f2('0x63')][_0xf5f2('0x23')]({'attributes':['id','name'],'where':{'id':_0x71b0e7['interaction'][_0xf5f2('0x62')]}})['then'](function(_0x4c4420){if(_0x4c4420){_0x71b0e7['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf5f2('0x64'),'appdata':_0x4c4420[_0xf5f2('0x65')]+','+(_0x71b0e7[_0xf5f2('0x39')][_0xf5f2('0x66')]||0xa),'interval':_0xf5f2('0x67')});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);});}return respondWithRpcPromise(_0xf5f2('0x68'),_0xf5f2('0x69'),_0x71b0e7);})[_0xf5f2('0x25')](function(_0x9afb3c){_0xc6a1ae(_0x9afb3c);})[_0xf5f2('0x19')](function(_0x1ba503){_0x3f3895(_0x536501[_0xf5f2('0x16')](0x1f4,_0x1ba503[_0xf5f2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 937f6be..590c941 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 _0xe19e=['register','length','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x1c8ebb,_0x54515c){var _0x33a55f=function(_0x354db6){while(--_0x354db6){_0x1c8ebb['push'](_0x1c8ebb['shift']());}};_0x33a55f(++_0x54515c);}(_0xe19e,0x93));var _0xee19=function(_0x518d1b,_0x1bd9f6){_0x518d1b=_0x518d1b-0x0;var _0x567a51=_0xe19e[_0x518d1b];return _0x567a51;};'use strict';var MailAccountEvents=require(_0xee19('0x0'));var events=[_0xee19('0x1'),_0xee19('0x2'),_0xee19('0x3')];function createListener(_0x244546,_0x49d80e){return function(_0x144537){_0x49d80e[_0xee19('0x4')](_0x244546,_0x144537);};}function removeListener(_0x56313e,_0x3bcf2c){return function(){MailAccountEvents[_0xee19('0x5')](_0x56313e,_0x3bcf2c);};}exports[_0xee19('0x6')]=function(_0x1cbde0){for(var _0x3529da=0x0,_0x855f38=events[_0xee19('0x7')];_0x3529da<_0x855f38;_0x3529da++){var _0x3fcf9d=events[_0x3529da];var _0x145f2=createListener(_0xee19('0x8')+_0x3fcf9d,_0x1cbde0);MailAccountEvents['on'](_0x3fcf9d,_0x145f2);}}; \ No newline at end of file +var _0x4e5c=['remove','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0xc8c5e1,_0x533470){var _0x572dd1=function(_0x247abe){while(--_0x247abe){_0xc8c5e1['push'](_0xc8c5e1['shift']());}};_0x572dd1(++_0x533470);}(_0x4e5c,0x149));var _0xc4e5=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4e5c[_0x279d37];return _0x530173;};'use strict';var MailAccountEvents=require(_0xc4e5('0x0'));var events=['save',_0xc4e5('0x1'),'update'];function createListener(_0x31e94d,_0x27a49f){return function(_0x253810){_0x27a49f['emit'](_0x31e94d,_0x253810);};}function removeListener(_0x4cd665,_0x4ecd96){return function(){MailAccountEvents[_0xc4e5('0x2')](_0x4cd665,_0x4ecd96);};}exports[_0xc4e5('0x3')]=function(_0x3b4b2c){for(var _0x81444b=0x0,_0x36da95=events[_0xc4e5('0x4')];_0x81444b<_0x36da95;_0x81444b++){var _0x40c9df=events[_0x81444b];var _0x3fb6b7=createListener(_0xc4e5('0x5')+_0x40c9df,_0x3b4b2c);MailAccountEvents['on'](_0x40c9df,_0x3fb6b7);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 04c693c..6b66a69 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 _0x6172=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','exports'];(function(_0x1dec69,_0x36180e){var _0x326a53=function(_0x3dc226){while(--_0x3dc226){_0x1dec69['push'](_0x1dec69['shift']());}};_0x326a53(++_0x36180e);}(_0x6172,0x1f0));var _0x2617=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6172[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2617('0x0'));var util=require(_0x2617('0x1'));var path=require(_0x2617('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2617('0x3')]();var fs_extra=require(_0x2617('0x4'));var auth=require(_0x2617('0x5'));var interaction=require(_0x2617('0x6'));var config=require('../../config/environment');var controller=require(_0x2617('0x7'));router[_0x2617('0x8')](_0x2617('0x9'),auth[_0x2617('0xa')](),controller[_0x2617('0xb')]);router['put'](_0x2617('0x9'),auth['isAuthenticated'](),controller[_0x2617('0xc')]);router[_0x2617('0xd')](_0x2617('0x9'),auth['isAuthenticated'](),controller[_0x2617('0xe')]);module[_0x2617('0xf')]=router; \ No newline at end of file +var _0x285e=['express','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x18e005,_0x33ef44){var _0x3ebd6b=function(_0x2010cc){while(--_0x2010cc){_0x18e005['push'](_0x18e005['shift']());}};_0x3ebd6b(++_0x33ef44);}(_0x285e,0x14c));var _0xe285=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x285e[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0xe285('0x0'));var util=require(_0xe285('0x1'));var path=require(_0xe285('0x2'));var timeout=require(_0xe285('0x3'));var express=require(_0xe285('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe285('0x5'));var config=require(_0xe285('0x6'));var controller=require(_0xe285('0x7'));router['get'](_0xe285('0x8'),auth[_0xe285('0x9')](),controller[_0xe285('0xa')]);router[_0xe285('0xb')]('/:id',auth[_0xe285('0x9')](),controller[_0xe285('0xc')]);router['delete'](_0xe285('0x8'),auth[_0xe285('0x9')](),controller[_0xe285('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index d73250b..f764fa8 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 _0x1329=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x3dc203,_0x272419){var _0x28ad47=function(_0x4e354e){while(--_0x4e354e){_0x3dc203['push'](_0x3dc203['shift']());}};_0x28ad47(++_0x272419);}(_0x1329,0x10d));var _0x9132=function(_0x738858,_0x264a91){_0x738858=_0x738858-0x0;var _0x336686=_0x1329[_0x738858];return _0x336686;};'use strict';var Sequelize=require(_0x9132('0x0'));module[_0x9132('0x1')]={'priority':{'type':Sequelize[_0x9132('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9132('0x3')},'appdata':{'type':Sequelize[_0x9132('0x4')]()},'description':{'type':Sequelize[_0x9132('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9132('0x6')}}; \ No newline at end of file +var _0x825f=['noop','TEXT','*,*,*,*','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x825f,0xbc));var _0xf825=function(_0x4a6322,_0x1dac50){_0x4a6322=_0x4a6322-0x0;var _0x4c4f0d=_0x825f[_0x4a6322];return _0x4c4f0d;};'use strict';var Sequelize=require('sequelize');module[_0xf825('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf825('0x1')],'allowNull':![],'defaultValue':_0xf825('0x2')},'appdata':{'type':Sequelize[_0xf825('0x3')]()},'description':{'type':Sequelize[_0xf825('0x1')]},'interval':{'type':Sequelize[_0xf825('0x1')],'defaultValue':_0xf825('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 1d55660..26f7a8d 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 _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x44b23a,_0x3d7311){var _0x5922cf=function(_0x52c388){while(--_0x52c388){_0x44b23a['push'](_0x44b23a['shift']());}};_0x5922cf(++_0x3d7311);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file +var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x9a7d08,_0xe9048){_0x9a7d08=_0x9a7d08-0x0;var _0x58e6e8=_0xbdb7[_0x9a7d08];return _0x58e6e8;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 65e0c76..1c447df 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 _0xee0f=['bluebird','../../config/environment','./mailApplication.attributes','exports','MailApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5cd69c,_0x17d939){var _0x3e066f=function(_0x9a54b){while(--_0x9a54b){_0x5cd69c['push'](_0x5cd69c['shift']());}};_0x3e066f(++_0x17d939);}(_0xee0f,0x1be));var _0xfee0=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xee0f[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0xfee0('0x0'));var util=require(_0xfee0('0x1'));var logger=require(_0xfee0('0x2'))(_0xfee0('0x3'));var moment=require('moment');var BPromise=require(_0xfee0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfee0('0x5'));var attributes=require(_0xfee0('0x6'));module[_0xfee0('0x7')]=function(_0x5bd201,_0x140a4c){return _0x5bd201['define'](_0xfee0('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfee0('0x9')});}; \ No newline at end of file +var _0x9782=['exports','define','mail_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./mailApplication.attributes'];(function(_0x527732,_0x3ebc05){var _0x2470df=function(_0x307b31){while(--_0x307b31){_0x527732['push'](_0x527732['shift']());}};_0x2470df(++_0x3ebc05);}(_0x9782,0x13c));var _0x2978=function(_0x4621c7,_0x24f171){_0x4621c7=_0x4621c7-0x0;var _0x2a83d6=_0x9782[_0x4621c7];return _0x2a83d6;};'use strict';var _=require(_0x2978('0x0'));var util=require(_0x2978('0x1'));var logger=require(_0x2978('0x2'))('api');var moment=require(_0x2978('0x3'));var BPromise=require(_0x2978('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2978('0x5'));var rimraf=require('rimraf');var config=require(_0x2978('0x6'));var attributes=require(_0x2978('0x7'));module[_0x2978('0x8')]=function(_0x1d2fb2,_0x45748d){return _0x1d2fb2[_0x2978('0x9')]('MailApplication',attributes,{'tableName':_0x2978('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2978('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 95b442d..a64e04e 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 _0xbc38=['../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','update','options','attributes','UpdateMailApplication','lodash','util','moment','bluebird','../../config/utils','rpc'];(function(_0x50e246,_0x240a92){var _0x524643=function(_0x4edf8b){while(--_0x4edf8b){_0x50e246['push'](_0x50e246['shift']());}};_0x524643(++_0x240a92);}(_0xbc38,0xb0));var _0x8bc3=function(_0x5ae4a3,_0x3cc4e9){_0x5ae4a3=_0x5ae4a3-0x0;var _0x24938b=_0xbc38[_0x5ae4a3];return _0x24938b;};'use strict';var _=require(_0x8bc3('0x0'));var util=require(_0x8bc3('0x1'));var moment=require(_0x8bc3('0x2'));var BPromise=require(_0x8bc3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8bc3('0x4'));var logger=require('../../config/logger')(_0x8bc3('0x5'));var config=require(_0x8bc3('0x6'));var jayson=require(_0x8bc3('0x7'));var client=jayson['client'][_0x8bc3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5db19d,_0x33a88b,_0x18f6a4){return new BPromise(function(_0x3e55e8,_0x1ad2e3){return client[_0x8bc3('0x9')](_0x5db19d,_0x18f6a4)[_0x8bc3('0xa')](function(_0x42a5b9){logger[_0x8bc3('0xb')](_0x8bc3('0xc'),_0x33a88b,'request\x20sent');logger[_0x8bc3('0xd')](_0x8bc3('0xe'),_0x33a88b,_0x8bc3('0xf'),JSON[_0x8bc3('0x10')](_0x42a5b9));if(_0x42a5b9[_0x8bc3('0x11')]){if(_0x42a5b9[_0x8bc3('0x11')][_0x8bc3('0x12')]===0x1f4){logger[_0x8bc3('0x11')](_0x8bc3('0xc'),_0x33a88b,_0x42a5b9[_0x8bc3('0x11')][_0x8bc3('0x13')]);return _0x1ad2e3(_0x42a5b9[_0x8bc3('0x11')][_0x8bc3('0x13')]);}logger[_0x8bc3('0x11')](_0x8bc3('0xc'),_0x33a88b,_0x42a5b9[_0x8bc3('0x11')][_0x8bc3('0x13')]);return _0x3e55e8(_0x42a5b9['error']['message']);}else{logger[_0x8bc3('0xb')](_0x8bc3('0xc'),_0x33a88b,'request\x20sent');_0x3e55e8(_0x42a5b9[_0x8bc3('0x14')][_0x8bc3('0x13')]);}})[_0x8bc3('0x15')](function(_0x84a40b){logger[_0x8bc3('0x11')]('MailApplication,\x20%s,\x20%s',_0x33a88b,_0x84a40b);_0x1ad2e3(_0x84a40b);});});}exports['UpdateMailApplication']=function(_0x38f2e8){var _0x2d3178=this;return new Promise(function(_0xd36dbb,_0x2e3ace){return db['MailApplication'][_0x8bc3('0x16')](_0x38f2e8['body'],{'raw':_0x38f2e8['options']?_0x38f2e8[_0x8bc3('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38f2e8[_0x8bc3('0x17')]?_0x38f2e8[_0x8bc3('0x17')]['where']||null:null,'attributes':_0x38f2e8[_0x8bc3('0x17')]?_0x38f2e8['options'][_0x8bc3('0x18')]||null:null,'limit':_0x38f2e8[_0x8bc3('0x17')]?_0x38f2e8['options']['limit']||null:null})[_0x8bc3('0xa')](function(_0xa2a62c){logger[_0x8bc3('0xb')]('UpdateMailApplication',_0x38f2e8);logger[_0x8bc3('0xd')](_0x8bc3('0x19'),_0x38f2e8,JSON['stringify'](_0xa2a62c));_0xd36dbb(_0xa2a62c);})['catch'](function(_0x33ffd8){logger[_0x8bc3('0x11')](_0x8bc3('0x19'),_0x33ffd8[_0x8bc3('0x13')],_0x38f2e8);_0x2e3ace(_0x2d3178[_0x8bc3('0x11')](0x1f4,_0x33ffd8[_0x8bc3('0x13')]));});});}; \ No newline at end of file +var _0xd3ca=['error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','then','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x548c98,_0x46a69f){var _0x1c9f1b=function(_0x199fb8){while(--_0x199fb8){_0x548c98['push'](_0x548c98['shift']());}};_0x1c9f1b(++_0x46a69f);}(_0xd3ca,0xc2));var _0xad3c=function(_0x5643ae,_0x58470a){_0x5643ae=_0x5643ae-0x0;var _0x33cfec=_0xd3ca[_0x5643ae];return _0x33cfec;};'use strict';var _=require('lodash');var util=require(_0xad3c('0x0'));var moment=require('moment');var BPromise=require(_0xad3c('0x1'));var rs=require(_0xad3c('0x2'));var fs=require('fs');var Redis=require(_0xad3c('0x3'));var db=require(_0xad3c('0x4'))['db'];var utils=require(_0xad3c('0x5'));var logger=require(_0xad3c('0x6'))('rpc');var config=require(_0xad3c('0x7'));var jayson=require(_0xad3c('0x8'));var client=jayson['client'][_0xad3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191110,_0x543fd2,_0x4592fb){return new BPromise(function(_0x483b05,_0xfce8d8){return client[_0xad3c('0xa')](_0x191110,_0x4592fb)['then'](function(_0x339819){logger[_0xad3c('0xb')](_0xad3c('0xc'),_0x543fd2,_0xad3c('0xd'));logger[_0xad3c('0xe')](_0xad3c('0xf'),_0x543fd2,'request\x20sent',JSON['stringify'](_0x339819));if(_0x339819[_0xad3c('0x10')]){if(_0x339819[_0xad3c('0x10')][_0xad3c('0x11')]===0x1f4){logger[_0xad3c('0x10')]('MailApplication,\x20%s,\x20%s',_0x543fd2,_0x339819[_0xad3c('0x10')]['message']);return _0xfce8d8(_0x339819['error']['message']);}logger['error']('MailApplication,\x20%s,\x20%s',_0x543fd2,_0x339819[_0xad3c('0x10')][_0xad3c('0x12')]);return _0x483b05(_0x339819[_0xad3c('0x10')][_0xad3c('0x12')]);}else{logger[_0xad3c('0xb')](_0xad3c('0xc'),_0x543fd2,'request\x20sent');_0x483b05(_0x339819[_0xad3c('0x13')]['message']);}})[_0xad3c('0x14')](function(_0x24504d){logger[_0xad3c('0x10')](_0xad3c('0xc'),_0x543fd2,_0x24504d);_0xfce8d8(_0x24504d);});});}exports[_0xad3c('0x15')]=function(_0x158d01){var _0x47a987=this;return new Promise(function(_0x44b47d,_0x4b3749){return db[_0xad3c('0x16')][_0xad3c('0x17')](_0x158d01[_0xad3c('0x18')],{'raw':_0x158d01['options']?_0x158d01[_0xad3c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158d01['options']?_0x158d01['options'][_0xad3c('0x1a')]||null:null,'attributes':_0x158d01['options']?_0x158d01['options'][_0xad3c('0x1b')]||null:null,'limit':_0x158d01[_0xad3c('0x19')]?_0x158d01[_0xad3c('0x19')]['limit']||null:null})[_0xad3c('0x1c')](function(_0xfa5078){logger[_0xad3c('0xb')]('UpdateMailApplication',_0x158d01);logger[_0xad3c('0xe')](_0xad3c('0x15'),_0x158d01,JSON[_0xad3c('0x1d')](_0xfa5078));_0x44b47d(_0xfa5078);})[_0xad3c('0x14')](function(_0xff66b7){logger[_0xad3c('0x10')]('UpdateMailApplication',_0xff66b7[_0xad3c('0x12')],_0x158d01);_0x4b3749(_0x47a987['error'](0x1f4,_0xff66b7[_0xad3c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 05654c2..561005b 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 _0x13d8=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service'];(function(_0x1ea750,_0x1eef90){var _0x4e2baf=function(_0x3866b1){while(--_0x3866b1){_0x1ea750['push'](_0x1ea750['shift']());}};_0x4e2baf(++_0x1eef90);}(_0x13d8,0x1bf));var _0x813d=function(_0x23461d,_0x3dea91){_0x23461d=_0x23461d-0x0;var _0x215cce=_0x13d8[_0x23461d];return _0x215cce;};'use strict';var express=require(_0x813d('0x0'));var router=express[_0x813d('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x813d('0x2'));var controller=require('./mailInteraction.controller');router[_0x813d('0x3')]('/',auth[_0x813d('0x4')](),controller[_0x813d('0x5')]);router[_0x813d('0x3')](_0x813d('0x6'),auth[_0x813d('0x4')](),controller[_0x813d('0x7')]);router[_0x813d('0x3')](_0x813d('0x8'),auth[_0x813d('0x4')](),controller[_0x813d('0x9')]);router[_0x813d('0x3')](_0x813d('0xa'),auth[_0x813d('0x4')](),controller[_0x813d('0xb')]);router[_0x813d('0x3')](_0x813d('0xc'),auth[_0x813d('0x4')](),controller[_0x813d('0xd')]);router[_0x813d('0xe')]('/',auth['isAuthenticated'](),controller[_0x813d('0xf')]);router['post'](_0x813d('0xa'),auth[_0x813d('0x4')](),controller[_0x813d('0x10')]);router[_0x813d('0xe')](_0x813d('0x11'),auth['isAuthenticated'](),interaction[_0x813d('0x12')](_0x813d('0x13'),_0x813d('0x14')),controller[_0x813d('0x15')]);router[_0x813d('0x16')](_0x813d('0x8'),auth[_0x813d('0x4')](),interaction['tracked'](_0x813d('0x13'),_0x813d('0x17')),controller[_0x813d('0x18')]);router[_0x813d('0x19')](_0x813d('0x8'),auth[_0x813d('0x4')](),interaction[_0x813d('0x12')](_0x813d('0x13'),_0x813d('0x1a')),controller[_0x813d('0x1b')]);router[_0x813d('0x19')]('/:id/tags',auth['isAuthenticated'](),controller[_0x813d('0x1c')]);module[_0x813d('0x1d')]=router; \ No newline at end of file +var _0x78bd=['download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','/describe','/:id','show','/:id/messages','/:id/download'];(function(_0x2aa8d9,_0x5a9132){var _0x50d4b0=function(_0x56e36d){while(--_0x56e36d){_0x2aa8d9['push'](_0x2aa8d9['shift']());}};_0x50d4b0(++_0x5a9132);}(_0x78bd,0x18e));var _0xd78b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x78bd[_0x5834bc];return _0x3e183a;};'use strict';var express=require(_0xd78b('0x0'));var router=express[_0xd78b('0x1')]();var auth=require(_0xd78b('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0xd78b('0x3')]('/',auth[_0xd78b('0x4')](),controller['index']);router[_0xd78b('0x3')](_0xd78b('0x5'),auth[_0xd78b('0x4')](),controller['describe']);router[_0xd78b('0x3')](_0xd78b('0x6'),auth[_0xd78b('0x4')](),controller[_0xd78b('0x7')]);router[_0xd78b('0x3')](_0xd78b('0x8'),auth[_0xd78b('0x4')](),controller['getMessages']);router['get'](_0xd78b('0x9'),auth['isAuthenticated'](),controller[_0xd78b('0xa')]);router[_0xd78b('0xb')]('/',auth[_0xd78b('0x4')](),controller[_0xd78b('0xc')]);router['post'](_0xd78b('0x8'),auth[_0xd78b('0x4')](),controller[_0xd78b('0xd')]);router['post'](_0xd78b('0xe'),auth[_0xd78b('0x4')](),interaction[_0xd78b('0xf')](_0xd78b('0x10'),_0xd78b('0x11')),controller['addTags']);router[_0xd78b('0x12')](_0xd78b('0x6'),auth[_0xd78b('0x4')](),interaction[_0xd78b('0xf')](_0xd78b('0x10'),_0xd78b('0x13')),controller[_0xd78b('0x14')]);router[_0xd78b('0x15')](_0xd78b('0x6'),auth[_0xd78b('0x4')](),interaction['tracked'](_0xd78b('0x10'),'mailinteraction:destroy'),controller[_0xd78b('0x16')]);router[_0xd78b('0x15')](_0xd78b('0xe'),auth[_0xd78b('0x4')](),controller['removeTags']);module[_0xd78b('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 6c59ed6..3ed908b 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 _0xa74d=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize','iconv','exports'];(function(_0x1d2342,_0x13d9dd){var _0x701d8c=function(_0x2a2da7){while(--_0x2a2da7){_0x1d2342['push'](_0x1d2342['shift']());}};_0x701d8c(++_0x13d9dd);}(_0xa74d,0xcf));var _0xda74=function(_0xcd3753,_0x5f170f){_0xcd3753=_0xcd3753-0x0;var _0x4831f1=_0xa74d[_0xcd3753];return _0x4831f1;};'use strict';var Sequelize=require(_0xda74('0x0'));var iconv=require(_0xda74('0x1'));module[_0xda74('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xda74('0x3')]},'disposition':{'type':Sequelize[_0xda74('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xda74('0x4')]},'inReplyTo':{'type':Sequelize[_0xda74('0x4')](0x1fe)},'to':{'type':Sequelize[_0xda74('0x4')]},'cc':{'type':Sequelize[_0xda74('0x5')](_0xda74('0x6'))},'subject':{'type':Sequelize[_0xda74('0x5')]()},'attach':{'type':Sequelize[_0xda74('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xda74('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xda74('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xda74('0x8')]('in',_0xda74('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xda74('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xda74('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xda74('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x27e7=['DATE','STRING','TEXT','long','BOOLEAN','ENUM','out','sequelize'];(function(_0x15e59c,_0x350fb3){var _0x57f29f=function(_0x55c2d8){while(--_0x55c2d8){_0x15e59c['push'](_0x15e59c['shift']());}};_0x57f29f(++_0x350fb3);}(_0x27e7,0x67));var _0x727e=function(_0x3905b1,_0x362645){_0x3905b1=_0x3905b1-0x0;var _0x48a651=_0x27e7[_0x3905b1];return _0x48a651;};'use strict';var Sequelize=require(_0x727e('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x727e('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x727e('0x2')]},'note':{'type':Sequelize[_0x727e('0x2')]},'inReplyTo':{'type':Sequelize[_0x727e('0x2')](0x1fe)},'to':{'type':Sequelize[_0x727e('0x2')]},'cc':{'type':Sequelize[_0x727e('0x3')](_0x727e('0x4'))},'subject':{'type':Sequelize[_0x727e('0x3')]()},'attach':{'type':Sequelize[_0x727e('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x727e('0x1')]},'substatus':{'type':Sequelize[_0x727e('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x727e('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x727e('0x6')]('in',_0x727e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x727e('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x727e('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 91a4d01..49e679a 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 _0x7394=['pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','inlineCss','true','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','from','bcc','subject','get','each','missing.recipient@your.company.com','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','name','readFileSync','writeFileSync','message%d.eml','unlinkSync','zip-dir','moment','bluebird','util','juice','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','destroy','stack','send','map','MailInteraction','rawAttributes','type','getOptions','mail','query','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where'];(function(_0x524610,_0x5e14d0){var _0x2aa0d3=function(_0x4b1491){while(--_0x4b1491){_0x524610['push'](_0x524610['shift']());}};_0x2aa0d3(++_0x5e14d0);}(_0x7394,0x17c));var _0x4739=function(_0x2a3c22,_0x2d359a){_0x2a3c22=_0x2a3c22-0x0;var _0x1b34e7=_0x7394[_0x2a3c22];return _0x1b34e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4739('0x0'));var moment=require(_0x4739('0x1'));var BPromise=require(_0x4739('0x2'));var util=require(_0x4739('0x3'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0x4739('0x4'));var Redis=require(_0x4739('0x5'));var interaction=require(_0x4739('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x4739('0x7'))('api');var config=require(_0x4739('0x8'));var db=require(_0x4739('0x9'))['db'];var htmlEntities=require(_0x4739('0xa'));config[_0x4739('0xb')]=_[_0x4739('0xc')](config['redis'],{'host':_0x4739('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4739('0xb')]));require(_0x4739('0xe'))[_0x4739('0xf')](socket);function respondWithStatusCode(_0x27b3a3,_0x4346d9){_0x4346d9=_0x4346d9||0xcc;return function(_0x3932bb){if(_0x3932bb){return _0x27b3a3[_0x4739('0x10')](_0x4346d9);}return _0x27b3a3[_0x4739('0x11')](_0x4346d9)[_0x4739('0x12')]();};}function respondWithResult(_0x195704,_0x116eed){_0x116eed=_0x116eed||0xc8;return function(_0x4b03ca){if(_0x4b03ca){return _0x195704[_0x4739('0x11')](_0x116eed)[_0x4739('0x13')](_0x4b03ca);}};}function respondWithFilteredResult(_0x56f15f,_0x3e90ac){return function(_0x5092f5){if(_0x5092f5){var _0x3c4750=typeof _0x3e90ac[_0x4739('0x14')]===_0x4739('0x15')&&typeof _0x3e90ac[_0x4739('0x16')]==='undefined';var _0x4dc6f7=_0x5092f5['count'];var _0x718da0=_0x3c4750?0x0:_0x3e90ac['offset'];var _0x55c81b=_0x3c4750?_0x5092f5['count']:_0x3e90ac['offset']+_0x3e90ac[_0x4739('0x16')];var _0x384021;if(_0x55c81b>=_0x4dc6f7){_0x55c81b=_0x4dc6f7;_0x384021=0xc8;}else{_0x384021=0xce;}_0x56f15f['status'](_0x384021);return _0x56f15f['set'](_0x4739('0x17'),_0x718da0+'-'+_0x55c81b+'/'+_0x4dc6f7)['json'](_0x5092f5);}return null;};}function saveUpdates(_0x973316){return function(_0x5769b1){if(_0x5769b1){return _0x5769b1[_0x4739('0x18')](_0x973316)[_0x4739('0x19')](function(_0x15dae7){return _0x15dae7;});}return null;};}function removeEntity(_0x32a2c4){return function(_0x3dd76e){if(_0x3dd76e){return _0x3dd76e[_0x4739('0x1a')]()[_0x4739('0x19')](function(){_0x32a2c4[_0x4739('0x11')](0xcc)[_0x4739('0x12')]();});}};}function handleEntityNotFound(_0x397d26){return function(_0x4ffb4a){if(!_0x4ffb4a){_0x397d26['sendStatus'](0x194);}return _0x4ffb4a;};}function handleError(_0x4fd448,_0x13d3de){_0x13d3de=_0x13d3de||0x1f4;return function(_0x1668fc){logger['error'](_0x1668fc[_0x4739('0x1b')]);if(_0x1668fc['name']){delete _0x1668fc['name'];}_0x4fd448[_0x4739('0x11')](_0x13d3de)[_0x4739('0x1c')](_0x1668fc);};}exports['index']=function(_0x1470cc,_0x39365c){var _0x365b70={};var _0x4c825e=_[_0x4739('0x1d')](db[_0x4739('0x1e')][_0x4739('0x1f')],function(_0x3c1c7e){return{'name':_0x3c1c7e['fieldName'],'type':_0x3c1c7e[_0x4739('0x20')]['key']};});_0x365b70=qs[_0x4739('0x21')](_0x4c825e,_0x1470cc);return interaction['findAll'](_0x4739('0x22'),_0x1470cc[_0x4739('0x23')],_0x1470cc['user'],_0x365b70,_0x4c825e)[_0x4739('0x19')](respondWithFilteredResult(_0x39365c,_0x365b70))['catch'](handleError(_0x39365c,null));};exports[_0x4739('0x24')]=function(_0x5e053a,_0x14760e){var _0x4cd8f3={'raw':![],'where':{'id':_0x5e053a[_0x4739('0x25')]['id']}},_0x3f8f2e={};_0x3f8f2e['model']=_[_0x4739('0x26')](db[_0x4739('0x1e')][_0x4739('0x1f')]);_0x3f8f2e[_0x4739('0x23')]=_['keys'](_0x5e053a[_0x4739('0x23')]);_0x3f8f2e[_0x4739('0x27')]=_[_0x4739('0x28')](_0x3f8f2e[_0x4739('0x29')],_0x3f8f2e[_0x4739('0x23')]);_0x4cd8f3[_0x4739('0x2a')]=_[_0x4739('0x28')](_0x3f8f2e['model'],qs[_0x4739('0x2b')](_0x5e053a[_0x4739('0x23')]['fields']));_0x4cd8f3[_0x4739('0x2a')]=_0x4cd8f3[_0x4739('0x2a')][_0x4739('0x2c')]?_0x4cd8f3[_0x4739('0x2a')]:_0x3f8f2e[_0x4739('0x29')];if(_0x5e053a[_0x4739('0x23')][_0x4739('0x2d')]){_0x4cd8f3[_0x4739('0x2e')]=[{'all':!![]}];}_0x4cd8f3=_[_0x4739('0x2f')]({},_0x4cd8f3,_0x5e053a[_0x4739('0x30')]);return db[_0x4739('0x1e')][_0x4739('0x31')](_0x4cd8f3)[_0x4739('0x19')](handleEntityNotFound(_0x14760e,null))[_0x4739('0x19')](respondWithResult(_0x14760e,null))[_0x4739('0x32')](handleError(_0x14760e,null));};exports['create']=function(_0x33c5a8,_0x5bd2c6){return db[_0x4739('0x1e')]['create'](_0x33c5a8[_0x4739('0x33')],{})[_0x4739('0x19')](respondWithResult(_0x5bd2c6,0xc9))[_0x4739('0x32')](handleError(_0x5bd2c6,null));};exports[_0x4739('0x18')]=function(_0x3812a3,_0x2cbb1b){if(_0x3812a3[_0x4739('0x33')]['id']){delete _0x3812a3['body']['id'];}return db[_0x4739('0x1e')][_0x4739('0x31')]({'where':{'id':_0x3812a3[_0x4739('0x25')]['id']}})[_0x4739('0x19')](handleEntityNotFound(_0x2cbb1b,null))[_0x4739('0x19')](saveUpdates(_0x3812a3[_0x4739('0x33')],null))[_0x4739('0x19')](respondWithResult(_0x2cbb1b,null))[_0x4739('0x32')](handleError(_0x2cbb1b,null));};exports[_0x4739('0x1a')]=function(_0x230573,_0x4172f5){return db[_0x4739('0x1e')][_0x4739('0x31')]({'where':{'id':_0x230573[_0x4739('0x25')]['id']}})[_0x4739('0x19')](handleEntityNotFound(_0x4172f5,null))[_0x4739('0x19')](removeEntity(_0x4172f5,null))[_0x4739('0x32')](handleError(_0x4172f5,null));};exports[_0x4739('0x34')]=function(_0x205bcf,_0x2c094b){return db[_0x4739('0x1e')][_0x4739('0x34')]()[_0x4739('0x19')](respondWithResult(_0x2c094b,null))['catch'](handleError(_0x2c094b,null));};exports[_0x4739('0x35')]=function(_0x5b456b,_0x5543aa){return db[_0x4739('0x36')][_0x4739('0x31')]({'where':{'id':_0x5b456b[_0x4739('0x25')]['id']}})['then'](handleEntityNotFound(_0x5543aa,null))['then'](function(_0x5ccaa8){if(_0x5ccaa8){return _0x5ccaa8[_0x4739('0x35')](_0x5b456b[_0x4739('0x33')][_0x4739('0x37')],_[_0x4739('0x38')](_0x5b456b[_0x4739('0x33')],['ids','id'])||{});}})['then'](respondWithResult(_0x5543aa,null))['catch'](handleError(_0x5543aa,null));};exports[_0x4739('0x39')]=function(_0x45229c,_0x436040){var _0x4b2aa9={'raw':![],'where':{}};var _0x3c99af={};var _0x260d84={'count':0x0,'rows':[]};return db['MailInteraction'][_0x4739('0x3a')]({'where':{'id':_0x45229c[_0x4739('0x25')]['id']}})[_0x4739('0x19')](handleEntityNotFound(_0x436040,null))[_0x4739('0x19')](function(_0x583b9f){if(_0x583b9f){_0x3c99af['model']=_['keys'](db[_0x4739('0x36')][_0x4739('0x1f')]);_0x3c99af[_0x4739('0x23')]=_['keys'](_0x45229c[_0x4739('0x23')]);_0x3c99af['filters']=_[_0x4739('0x28')](_0x3c99af['model'],_0x3c99af[_0x4739('0x23')]);_0x4b2aa9[_0x4739('0x2a')]=_[_0x4739('0x28')](_0x3c99af[_0x4739('0x29')],qs[_0x4739('0x2b')](_0x45229c['query'][_0x4739('0x2b')]));_0x4b2aa9[_0x4739('0x2a')]=_0x4b2aa9['attributes']['length']?_0x4b2aa9[_0x4739('0x2a')]:_0x3c99af['model'];if(!_0x45229c[_0x4739('0x23')][_0x4739('0x3b')](_0x4739('0x3c'))){_0x4b2aa9[_0x4739('0x16')]=qs[_0x4739('0x16')](_0x45229c[_0x4739('0x23')][_0x4739('0x16')]);_0x4b2aa9[_0x4739('0x14')]=qs[_0x4739('0x14')](_0x45229c['query']['offset']);}_0x4b2aa9[_0x4739('0x3d')]=qs[_0x4739('0x3e')](_0x45229c['query'][_0x4739('0x3e')]);_0x4b2aa9[_0x4739('0x3f')]=qs['filters'](_[_0x4739('0x40')](_0x45229c[_0x4739('0x23')],_0x3c99af[_0x4739('0x27')]));_0x4b2aa9[_0x4739('0x3f')]['MailInteractionId']=_0x583b9f['id'];if(_0x45229c[_0x4739('0x23')][_0x4739('0x41')]){_0x4b2aa9[_0x4739('0x3f')]=_[_0x4739('0x2f')](_0x4b2aa9[_0x4739('0x3f')],{'$or':_[_0x4739('0x1d')](_0x4b2aa9[_0x4739('0x2a')],function(_0x4e9778){var _0x500daf={};_0x500daf[_0x4e9778]={'$like':'%'+_0x45229c[_0x4739('0x23')][_0x4739('0x41')]+'%'};return _0x500daf;})});}if(_0x45229c[_0x4739('0x23')]['$gte']){var _0x32dce5=_0x45229c['query'][_0x4739('0x42')][_0x4739('0x43')](',');var _0x297eb5={};_0x297eb5[_0x32dce5[0x0]]={'$gte':moment(_0x32dce5[0x1])[_0x4739('0x44')](_0x4739('0x45'))};_0x4b2aa9['where']=_[_0x4739('0x2f')](_0x4b2aa9[_0x4739('0x3f')],_0x297eb5);}_0x4b2aa9=_[_0x4739('0x2f')]({},_0x4b2aa9,_0x45229c['options']);return db[_0x4739('0x36')][_0x4739('0x46')]({'where':_0x4b2aa9[_0x4739('0x3f')]})['then'](function(_0xca75f5){_0x260d84[_0x4739('0x46')]=_0xca75f5;if(_0x45229c[_0x4739('0x23')][_0x4739('0x2d')]){_0x4b2aa9[_0x4739('0x2e')]=[{'all':!![]}];}return db['MailMessage'][_0x4739('0x47')](_0x4b2aa9);})[_0x4739('0x19')](function(_0x46de2){if(_0x45229c[_0x4739('0x23')][_0x4739('0x48')]===_0x4739('0x49')){for(var _0x14abda=0x0;_0x14abda<_0x46de2[_0x4739('0x2c')];_0x14abda++){_0x46de2[_0x14abda][_0x4739('0x33')]=juice(_0x46de2[_0x14abda]['body']);}}_0x260d84[_0x4739('0x4a')]=_0x46de2;return _0x260d84;});}})[_0x4739('0x19')](respondWithFilteredResult(_0x436040,_0x4b2aa9))[_0x4739('0x32')](handleError(_0x436040,null));};exports[_0x4739('0x4b')]=function(_0x2277b5,_0x38bb24){return db[_0x4739('0x1e')][_0x4739('0x31')]({'where':{'id':_0x2277b5[_0x4739('0x25')]['id']}})[_0x4739('0x19')](handleEntityNotFound(_0x38bb24,null))[_0x4739('0x19')](function(_0x27eb2e){if(_0x27eb2e){return _0x27eb2e[_0x4739('0x4c')](_0x2277b5['body'][_0x4739('0x37')],_[_0x4739('0x38')](_0x2277b5[_0x4739('0x33')],[_0x4739('0x37'),'id'])||{})[_0x4739('0x4d')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x4739('0x4e')],'where':{'id':_0x2277b5['body'][_0x4739('0x37')]}});})[_0x4739('0x19')](function(_0x7b7b6d){socket[_0x4739('0x4f')](_0x4739('0x50'),{'id':Number(_0x2277b5[_0x4739('0x25')]['id']),'tags':_0x7b7b6d||[]});return{'id':Number(_0x2277b5['params']['id']),'tags':_0x7b7b6d||[]};});}})[_0x4739('0x19')](respondWithResult(_0x38bb24,null))[_0x4739('0x32')](handleError(_0x38bb24,null));};exports[_0x4739('0x51')]=function(_0x3b029e,_0x1e240f){return db[_0x4739('0x1e')][_0x4739('0x31')]({'where':{'id':_0x3b029e[_0x4739('0x25')]['id']}})['then'](handleEntityNotFound(_0x1e240f,null))[_0x4739('0x19')](function(_0x262e86){if(_0x262e86){return _0x262e86[_0x4739('0x51')](_0x3b029e[_0x4739('0x23')][_0x4739('0x37')]);}})[_0x4739('0x19')](respondWithStatusCode(_0x1e240f,null))[_0x4739('0x32')](handleError(_0x1e240f,null));};exports[_0x4739('0x52')]=function(_0x5cbdcf,_0x40694a){var _0x3c75ef=moment()[_0x4739('0x53')]()['toString']();var _0x3bf109=path[_0x4739('0x54')](config['root'],'server',_0x4739('0x55'),_0x4739('0x56'));var _0x2694db=path[_0x4739('0x54')](config[_0x4739('0x57')],_0x4739('0x58'),'files',_0x4739('0x59'));var _0x573d16=path[_0x4739('0x54')](_0x3bf109,_0x3c75ef);var _0x3f4620=util[_0x4739('0x44')](_0x4739('0x5a'),_0x5cbdcf[_0x4739('0x25')]['id'],_0x3c75ef);var _0x36579d=path['join'](_0x3bf109,_0x3f4620);var _0x442d81=[];if(_0x5cbdcf[_0x4739('0x23')][_0x4739('0x59')]){_0x442d81['push']({'model':db[_0x4739('0x5b')],'as':_0x4739('0x5c'),'raw':!![]});}var _0x18286c=[{'model':db[_0x4739('0x36')],'as':_0x4739('0x5d'),'attributes':['id',_0x4739('0x33'),_0x4739('0x5e'),'to','cc',_0x4739('0x5f'),_0x4739('0x60'),'createdAt'],'where':{'secret':![]},'order':qs[_0x4739('0x3e')]('id'),'include':_0x442d81}];return db[_0x4739('0x1e')][_0x4739('0x31')]({'where':{'id':_0x5cbdcf[_0x4739('0x25')]['id']},'include':_0x18286c})['then'](handleEntityNotFound(_0x40694a,null))[_0x4739('0x19')](function(_0x551914){if(_0x551914&&_0x551914[_0x4739('0x5d')]){var _0x6e7e1f=_0x551914[_0x4739('0x61')]({'plain':!![]});fs['mkdirSync'](_0x573d16);return BPromise[_0x4739('0x62')](_0x6e7e1f[_0x4739('0x5d')],function(_0x5a3d4e,_0x3d8710){var _0x4d08f3={'from':_0x5a3d4e['from'],'to':_0x5a3d4e['to']||_0x4739('0x63'),'subject':_0x5a3d4e[_0x4739('0x60')],'html':htmlEntities[_0x4739('0x64')](_0x5a3d4e[_0x4739('0x33')]),'headers':{'Date':moment(_0x5a3d4e[_0x4739('0x65')])['format'](_0x4739('0x66'))},'attachments':[]};if(_0x5a3d4e['cc']){_0x4d08f3['headers']['Cc']=_0x5a3d4e['cc'];}if(_0x5a3d4e['bcc']){_0x4d08f3[_0x4739('0x67')]['Bcc']=_0x5a3d4e['bcc'];}return new BPromise(function(_0x1a941b,_0x5b54c4){if(_0x5a3d4e[_0x4739('0x5c')]){for(var _0x2c0e49=0x0;_0x2c0e49<_0x5a3d4e[_0x4739('0x5c')]['length'];_0x2c0e49++){var _0x50b014=_0x5a3d4e[_0x4739('0x5c')][_0x2c0e49];var _0x27b78c=path['join'](_0x2694db,_0x50b014['basename']);if(fs[_0x4739('0x68')](_0x27b78c)){_0x4d08f3[_0x4739('0x59')][_0x4739('0x69')]({'name':_0x50b014[_0x4739('0x6a')],'contentType':_0x50b014[_0x4739('0x20')],'data':fs[_0x4739('0x6b')](_0x27b78c)});}}}emlformat['build'](_0x4d08f3,function(_0x19f026,_0x56520d){if(_0x19f026)return _0x5b54c4(_0x19f026);fs[_0x4739('0x6c')](path['join'](_0x573d16,util[_0x4739('0x44')](_0x4739('0x6d'),_0x3d8710)),_0x56520d);return _0x1a941b(_0x56520d);});});})['then'](function(){return new BPromise(function(_0x28d382,_0x19dc04){zipdir(_0x573d16,{'saveTo':_0x36579d},function(_0x455b48,_0x3f51b5){if(_0x455b48)return _0x19dc04(_0x455b48);return _0x28d382(_0x3f51b5);});})[_0x4739('0x19')](function(){return new BPromise(function(_0x199031,_0x46dafe){rimraf(_0x573d16,function(_0x1d390e){if(_0x1d390e)_0x46dafe(_0x1d390e);return _0x199031();});});})[_0x4739('0x19')](function(){return _0x40694a[_0x4739('0x52')](_0x36579d,_0x3f4620,function(_0x52fc8e){if(!_0x52fc8e)fs[_0x4739('0x6e')](_0x36579d);});});});}else{return _0x40694a[_0x4739('0x10')](0xc8);}})[_0x4739('0x32')](handleError(_0x40694a,null));}; \ No newline at end of file +var _0x1d95=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','includeAll','findAll','inlineCss','rows','addTags','setTags','omit','spread','Tag','color','mailInteractionTags:save','removeTags','download','unix','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','Attachment','from','createdAt','get','mkdirSync','each','Messages','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','rimraf','zip-dir','bluebird','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','status','json','undefined','limit','count','offset','set','Content-Range','update','then','end','sendStatus','error','name','index','map','MailInteraction','fieldName','type','key','getOptions','mail','query','user','model','keys','filters','intersection','attributes','fields','length','include','find','create','body','catch','destroy','params','MailMessage','ids','getMessages','findOne','rawAttributes','nolimit','order','sort','where','pick','MailInteractionId','filter'];(function(_0x4cee32,_0x5988a2){var _0x593d85=function(_0x1e97ef){while(--_0x1e97ef){_0x4cee32['push'](_0x4cee32['shift']());}};_0x593d85(++_0x5988a2);}(_0x1d95,0x114));var _0x51d9=function(_0x2139c9,_0x413dc4){_0x2139c9=_0x2139c9-0x0;var _0x2fddb6=_0x1d95[_0x2139c9];return _0x2fddb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51d9('0x0'));var zipdir=require(_0x51d9('0x1'));var moment=require('moment');var BPromise=require(_0x51d9('0x2'));var util=require('util');var path=require(_0x51d9('0x3'));var fs=require('fs');var _=require(_0x51d9('0x4'));var juice=require(_0x51d9('0x5'));var Redis=require(_0x51d9('0x6'));var interaction=require(_0x51d9('0x7'));var qs=require(_0x51d9('0x8'));var logger=require(_0x51d9('0x9'))(_0x51d9('0xa'));var config=require('../../config/environment');var db=require(_0x51d9('0xb'))['db'];var htmlEntities=require('html-entities');config[_0x51d9('0xc')]=_['defaults'](config[_0x51d9('0xc')],{'host':_0x51d9('0xd'),'port':0x18eb});var socket=require(_0x51d9('0xe'))(new Redis(config[_0x51d9('0xc')]));require(_0x51d9('0xf'))['register'](socket);function respondWithStatusCode(_0x42a12c,_0x182184){_0x182184=_0x182184||0xcc;return function(_0x163fb7){if(_0x163fb7){return _0x42a12c['sendStatus'](_0x182184);}return _0x42a12c[_0x51d9('0x10')](_0x182184)['end']();};}function respondWithResult(_0x173102,_0x1bc02e){_0x1bc02e=_0x1bc02e||0xc8;return function(_0x15b8d6){if(_0x15b8d6){return _0x173102['status'](_0x1bc02e)[_0x51d9('0x11')](_0x15b8d6);}};}function respondWithFilteredResult(_0x4472df,_0x6b529){return function(_0x42f6ca){if(_0x42f6ca){var _0x4dc0e1=typeof _0x6b529['offset']===_0x51d9('0x12')&&typeof _0x6b529[_0x51d9('0x13')]===_0x51d9('0x12');var _0x3db6bb=_0x42f6ca[_0x51d9('0x14')];var _0x496ca5=_0x4dc0e1?0x0:_0x6b529['offset'];var _0x1d245c=_0x4dc0e1?_0x42f6ca[_0x51d9('0x14')]:_0x6b529[_0x51d9('0x15')]+_0x6b529[_0x51d9('0x13')];var _0x571dee;if(_0x1d245c>=_0x3db6bb){_0x1d245c=_0x3db6bb;_0x571dee=0xc8;}else{_0x571dee=0xce;}_0x4472df[_0x51d9('0x10')](_0x571dee);return _0x4472df[_0x51d9('0x16')](_0x51d9('0x17'),_0x496ca5+'-'+_0x1d245c+'/'+_0x3db6bb)[_0x51d9('0x11')](_0x42f6ca);}return null;};}function saveUpdates(_0x5b57b5){return function(_0x315cac){if(_0x315cac){return _0x315cac[_0x51d9('0x18')](_0x5b57b5)[_0x51d9('0x19')](function(_0x43b6be){return _0x43b6be;});}return null;};}function removeEntity(_0x14b7e6){return function(_0x103046){if(_0x103046){return _0x103046['destroy']()[_0x51d9('0x19')](function(){_0x14b7e6[_0x51d9('0x10')](0xcc)[_0x51d9('0x1a')]();});}};}function handleEntityNotFound(_0x17ca65){return function(_0x8db9cc){if(!_0x8db9cc){_0x17ca65[_0x51d9('0x1b')](0x194);}return _0x8db9cc;};}function handleError(_0x471280,_0x69f8fc){_0x69f8fc=_0x69f8fc||0x1f4;return function(_0x49cc6b){logger[_0x51d9('0x1c')](_0x49cc6b['stack']);if(_0x49cc6b['name']){delete _0x49cc6b[_0x51d9('0x1d')];}_0x471280[_0x51d9('0x10')](_0x69f8fc)['send'](_0x49cc6b);};}exports[_0x51d9('0x1e')]=function(_0x5dbf3f,_0x4c65d0){var _0x456ff0={};var _0x459c2c=_[_0x51d9('0x1f')](db[_0x51d9('0x20')]['rawAttributes'],function(_0x349138){return{'name':_0x349138[_0x51d9('0x21')],'type':_0x349138[_0x51d9('0x22')][_0x51d9('0x23')]};});_0x456ff0=qs[_0x51d9('0x24')](_0x459c2c,_0x5dbf3f);return interaction['findAll'](_0x51d9('0x25'),_0x5dbf3f[_0x51d9('0x26')],_0x5dbf3f[_0x51d9('0x27')],_0x456ff0,_0x459c2c)[_0x51d9('0x19')](respondWithFilteredResult(_0x4c65d0,_0x456ff0))['catch'](handleError(_0x4c65d0,null));};exports['show']=function(_0x42c0c7,_0x35b7e6){var _0x5a4c0c={'raw':![],'where':{'id':_0x42c0c7['params']['id']}},_0x19d37b={};_0x19d37b[_0x51d9('0x28')]=_['keys'](db[_0x51d9('0x20')]['rawAttributes']);_0x19d37b[_0x51d9('0x26')]=_[_0x51d9('0x29')](_0x42c0c7[_0x51d9('0x26')]);_0x19d37b[_0x51d9('0x2a')]=_[_0x51d9('0x2b')](_0x19d37b[_0x51d9('0x28')],_0x19d37b[_0x51d9('0x26')]);_0x5a4c0c[_0x51d9('0x2c')]=_['intersection'](_0x19d37b['model'],qs[_0x51d9('0x2d')](_0x42c0c7[_0x51d9('0x26')][_0x51d9('0x2d')]));_0x5a4c0c[_0x51d9('0x2c')]=_0x5a4c0c['attributes'][_0x51d9('0x2e')]?_0x5a4c0c[_0x51d9('0x2c')]:_0x19d37b['model'];if(_0x42c0c7[_0x51d9('0x26')]['includeAll']){_0x5a4c0c[_0x51d9('0x2f')]=[{'all':!![]}];}_0x5a4c0c=_['merge']({},_0x5a4c0c,_0x42c0c7['options']);return db[_0x51d9('0x20')][_0x51d9('0x30')](_0x5a4c0c)[_0x51d9('0x19')](handleEntityNotFound(_0x35b7e6,null))['then'](respondWithResult(_0x35b7e6,null))['catch'](handleError(_0x35b7e6,null));};exports['create']=function(_0x88b6bf,_0x467c5){return db[_0x51d9('0x20')][_0x51d9('0x31')](_0x88b6bf['body'],{})[_0x51d9('0x19')](respondWithResult(_0x467c5,0xc9))['catch'](handleError(_0x467c5,null));};exports[_0x51d9('0x18')]=function(_0x8cb076,_0x1c2748){if(_0x8cb076[_0x51d9('0x32')]['id']){delete _0x8cb076[_0x51d9('0x32')]['id'];}return db[_0x51d9('0x20')][_0x51d9('0x30')]({'where':{'id':_0x8cb076['params']['id']}})['then'](handleEntityNotFound(_0x1c2748,null))['then'](saveUpdates(_0x8cb076[_0x51d9('0x32')],null))['then'](respondWithResult(_0x1c2748,null))[_0x51d9('0x33')](handleError(_0x1c2748,null));};exports[_0x51d9('0x34')]=function(_0x3f392e,_0x2700cc){return db[_0x51d9('0x20')]['find']({'where':{'id':_0x3f392e[_0x51d9('0x35')]['id']}})[_0x51d9('0x19')](handleEntityNotFound(_0x2700cc,null))[_0x51d9('0x19')](removeEntity(_0x2700cc,null))[_0x51d9('0x33')](handleError(_0x2700cc,null));};exports['describe']=function(_0x57aba6,_0x52c52f){return db['MailInteraction']['describe']()[_0x51d9('0x19')](respondWithResult(_0x52c52f,null))['catch'](handleError(_0x52c52f,null));};exports['addMessage']=function(_0x4bb376,_0xe3b477){return db[_0x51d9('0x36')][_0x51d9('0x30')]({'where':{'id':_0x4bb376[_0x51d9('0x35')]['id']}})[_0x51d9('0x19')](handleEntityNotFound(_0xe3b477,null))[_0x51d9('0x19')](function(_0x1c4671){if(_0x1c4671){return _0x1c4671['addMessage'](_0x4bb376[_0x51d9('0x32')][_0x51d9('0x37')],_['omit'](_0x4bb376[_0x51d9('0x32')],[_0x51d9('0x37'),'id'])||{});}})[_0x51d9('0x19')](respondWithResult(_0xe3b477,null))[_0x51d9('0x33')](handleError(_0xe3b477,null));};exports[_0x51d9('0x38')]=function(_0x5e22b5,_0x2d7a35){var _0x5126c3={'raw':![],'where':{}};var _0x5578bb={};var _0x5ca0bd={'count':0x0,'rows':[]};return db[_0x51d9('0x20')][_0x51d9('0x39')]({'where':{'id':_0x5e22b5[_0x51d9('0x35')]['id']}})[_0x51d9('0x19')](handleEntityNotFound(_0x2d7a35,null))[_0x51d9('0x19')](function(_0x288201){if(_0x288201){_0x5578bb['model']=_[_0x51d9('0x29')](db[_0x51d9('0x36')][_0x51d9('0x3a')]);_0x5578bb[_0x51d9('0x26')]=_[_0x51d9('0x29')](_0x5e22b5[_0x51d9('0x26')]);_0x5578bb[_0x51d9('0x2a')]=_[_0x51d9('0x2b')](_0x5578bb[_0x51d9('0x28')],_0x5578bb[_0x51d9('0x26')]);_0x5126c3[_0x51d9('0x2c')]=_[_0x51d9('0x2b')](_0x5578bb[_0x51d9('0x28')],qs['fields'](_0x5e22b5[_0x51d9('0x26')]['fields']));_0x5126c3[_0x51d9('0x2c')]=_0x5126c3['attributes'][_0x51d9('0x2e')]?_0x5126c3[_0x51d9('0x2c')]:_0x5578bb[_0x51d9('0x28')];if(!_0x5e22b5[_0x51d9('0x26')]['hasOwnProperty'](_0x51d9('0x3b'))){_0x5126c3['limit']=qs[_0x51d9('0x13')](_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x13')]);_0x5126c3[_0x51d9('0x15')]=qs[_0x51d9('0x15')](_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x15')]);}_0x5126c3[_0x51d9('0x3c')]=qs[_0x51d9('0x3d')](_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x3d')]);_0x5126c3[_0x51d9('0x3e')]=qs[_0x51d9('0x2a')](_[_0x51d9('0x3f')](_0x5e22b5['query'],_0x5578bb[_0x51d9('0x2a')]));_0x5126c3[_0x51d9('0x3e')][_0x51d9('0x40')]=_0x288201['id'];if(_0x5e22b5['query']['filter']){_0x5126c3['where']=_['merge'](_0x5126c3[_0x51d9('0x3e')],{'$or':_[_0x51d9('0x1f')](_0x5126c3[_0x51d9('0x2c')],function(_0x255da4){var _0x599321={};_0x599321[_0x255da4]={'$like':'%'+_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x41')]+'%'};return _0x599321;})});}if(_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x42')]){var _0x2f8c63=_0x5e22b5['query'][_0x51d9('0x42')][_0x51d9('0x43')](',');var _0x9bacbe={};_0x9bacbe[_0x2f8c63[0x0]]={'$gte':moment(_0x2f8c63[0x1])[_0x51d9('0x44')](_0x51d9('0x45'))};_0x5126c3[_0x51d9('0x3e')]=_['merge'](_0x5126c3[_0x51d9('0x3e')],_0x9bacbe);}_0x5126c3=_[_0x51d9('0x46')]({},_0x5126c3,_0x5e22b5[_0x51d9('0x47')]);return db[_0x51d9('0x36')][_0x51d9('0x14')]({'where':_0x5126c3['where']})[_0x51d9('0x19')](function(_0x5cd26b){_0x5ca0bd[_0x51d9('0x14')]=_0x5cd26b;if(_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x48')]){_0x5126c3['include']=[{'all':!![]}];}return db[_0x51d9('0x36')][_0x51d9('0x49')](_0x5126c3);})[_0x51d9('0x19')](function(_0x40bf29){if(_0x5e22b5[_0x51d9('0x26')][_0x51d9('0x4a')]==='true'){for(var _0x188e30=0x0;_0x188e30<_0x40bf29[_0x51d9('0x2e')];_0x188e30++){_0x40bf29[_0x188e30][_0x51d9('0x32')]=juice(_0x40bf29[_0x188e30][_0x51d9('0x32')]);}}_0x5ca0bd[_0x51d9('0x4b')]=_0x40bf29;return _0x5ca0bd;});}})[_0x51d9('0x19')](respondWithFilteredResult(_0x2d7a35,_0x5126c3))[_0x51d9('0x33')](handleError(_0x2d7a35,null));};exports[_0x51d9('0x4c')]=function(_0x4891da,_0x5b6832){return db[_0x51d9('0x20')]['find']({'where':{'id':_0x4891da[_0x51d9('0x35')]['id']}})[_0x51d9('0x19')](handleEntityNotFound(_0x5b6832,null))[_0x51d9('0x19')](function(_0x9c915e){if(_0x9c915e){return _0x9c915e[_0x51d9('0x4d')](_0x4891da[_0x51d9('0x32')][_0x51d9('0x37')],_[_0x51d9('0x4e')](_0x4891da[_0x51d9('0x32')],[_0x51d9('0x37'),'id'])||{})[_0x51d9('0x4f')](function(){return db[_0x51d9('0x50')][_0x51d9('0x49')]({'attributes':['id',_0x51d9('0x1d'),_0x51d9('0x51')],'where':{'id':_0x4891da[_0x51d9('0x32')]['ids']}});})['then'](function(_0x3e0a9c){socket['emit'](_0x51d9('0x52'),{'id':Number(_0x4891da[_0x51d9('0x35')]['id']),'tags':_0x3e0a9c||[]});return{'id':Number(_0x4891da[_0x51d9('0x35')]['id']),'tags':_0x3e0a9c||[]};});}})[_0x51d9('0x19')](respondWithResult(_0x5b6832,null))[_0x51d9('0x33')](handleError(_0x5b6832,null));};exports[_0x51d9('0x53')]=function(_0x20d34e,_0x7f0af1){return db[_0x51d9('0x20')]['find']({'where':{'id':_0x20d34e[_0x51d9('0x35')]['id']}})['then'](handleEntityNotFound(_0x7f0af1,null))[_0x51d9('0x19')](function(_0xdb803a){if(_0xdb803a){return _0xdb803a['removeTags'](_0x20d34e['query'][_0x51d9('0x37')]);}})[_0x51d9('0x19')](respondWithStatusCode(_0x7f0af1,null))[_0x51d9('0x33')](handleError(_0x7f0af1,null));};exports[_0x51d9('0x54')]=function(_0x3f48f3,_0x5bc74d){var _0x376b12=moment()[_0x51d9('0x55')]()['toString']();var _0x1c9397=path['join'](config[_0x51d9('0x56')],'server',_0x51d9('0x57'),_0x51d9('0x58'));var _0x288867=path[_0x51d9('0x59')](config[_0x51d9('0x56')],_0x51d9('0x5a'),_0x51d9('0x57'),_0x51d9('0x5b'));var _0x2bbec5=path[_0x51d9('0x59')](_0x1c9397,_0x376b12);var _0x40a242=util[_0x51d9('0x44')](_0x51d9('0x5c'),_0x3f48f3[_0x51d9('0x35')]['id'],_0x376b12);var _0x3552de=path[_0x51d9('0x59')](_0x1c9397,_0x40a242);var _0x2252bd=[];if(_0x3f48f3[_0x51d9('0x26')][_0x51d9('0x5b')]){_0x2252bd[_0x51d9('0x5d')]({'model':db[_0x51d9('0x5e')],'as':'Attachments','raw':!![]});}var _0x50f609=[{'model':db[_0x51d9('0x36')],'as':'Messages','attributes':['id',_0x51d9('0x32'),_0x51d9('0x5f'),'to','cc','bcc','subject',_0x51d9('0x60')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x2252bd}];return db['MailInteraction'][_0x51d9('0x30')]({'where':{'id':_0x3f48f3['params']['id']},'include':_0x50f609})[_0x51d9('0x19')](handleEntityNotFound(_0x5bc74d,null))[_0x51d9('0x19')](function(_0x29d729){if(_0x29d729&&_0x29d729['Messages']){var _0x34699b=_0x29d729[_0x51d9('0x61')]({'plain':!![]});fs[_0x51d9('0x62')](_0x2bbec5);return BPromise[_0x51d9('0x63')](_0x34699b[_0x51d9('0x64')],function(_0x1e9216,_0x534f7a){var _0x25e047={'from':_0x1e9216[_0x51d9('0x5f')],'to':_0x1e9216['to']||'missing.recipient@your.company.com','subject':_0x1e9216[_0x51d9('0x65')],'html':htmlEntities[_0x51d9('0x66')](_0x1e9216[_0x51d9('0x32')]),'headers':{'Date':moment(_0x1e9216['createdAt'])[_0x51d9('0x44')](_0x51d9('0x67'))},'attachments':[]};if(_0x1e9216['cc']){_0x25e047[_0x51d9('0x68')]['Cc']=_0x1e9216['cc'];}if(_0x1e9216[_0x51d9('0x69')]){_0x25e047[_0x51d9('0x68')][_0x51d9('0x6a')]=_0x1e9216[_0x51d9('0x69')];}return new BPromise(function(_0x1e4db3,_0x4d4e5b){if(_0x1e9216[_0x51d9('0x6b')]){for(var _0x113bc4=0x0;_0x113bc4<_0x1e9216['Attachments'][_0x51d9('0x2e')];_0x113bc4++){var _0x763f93=_0x1e9216[_0x51d9('0x6b')][_0x113bc4];var _0x7811a3=path['join'](_0x288867,_0x763f93[_0x51d9('0x6c')]);if(fs[_0x51d9('0x6d')](_0x7811a3)){_0x25e047['attachments']['push']({'name':_0x763f93['name'],'contentType':_0x763f93[_0x51d9('0x22')],'data':fs[_0x51d9('0x6e')](_0x7811a3)});}}}emlformat[_0x51d9('0x6f')](_0x25e047,function(_0x151eb2,_0x33f690){if(_0x151eb2)return _0x4d4e5b(_0x151eb2);fs['writeFileSync'](path[_0x51d9('0x59')](_0x2bbec5,util[_0x51d9('0x44')](_0x51d9('0x70'),_0x534f7a)),_0x33f690);return _0x1e4db3(_0x33f690);});});})[_0x51d9('0x19')](function(){return new BPromise(function(_0x3f3cb6,_0x19af8a){zipdir(_0x2bbec5,{'saveTo':_0x3552de},function(_0x3fe49c,_0x21bb32){if(_0x3fe49c)return _0x19af8a(_0x3fe49c);return _0x3f3cb6(_0x21bb32);});})['then'](function(){return new BPromise(function(_0x49bfe5,_0x1b94ea){rimraf(_0x2bbec5,function(_0x247a7b){if(_0x247a7b)_0x1b94ea(_0x247a7b);return _0x49bfe5();});});})[_0x51d9('0x19')](function(){return _0x5bc74d[_0x51d9('0x54')](_0x3552de,_0x40a242,function(_0x1113ce){if(!_0x1113ce)fs[_0x51d9('0x71')](_0x3552de);});});});}else{return _0x5bc74d[_0x51d9('0x1b')](0xc8);}})[_0x51d9('0x33')](handleError(_0x5bc74d,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 6e192d9..046eacd 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 _0x06c8=['setDataValue','Users','map','then','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers'];(function(_0x4d94f8,_0x28ba5b){var _0x450985=function(_0x50d515){while(--_0x50d515){_0x4d94f8['push'](_0x4d94f8['shift']());}};_0x450985(++_0x28ba5b);}(_0x06c8,0x90));var _0x806c=function(_0x4dbfa0,_0x22f00f){_0x4dbfa0=_0x4dbfa0-0x0;var _0x662629=_0x06c8[_0x4dbfa0];return _0x662629;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x806c('0x0'))['db'][_0x806c('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x806c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x806c('0x3'),'afterDestroy':_0x806c('0x4')};function emitEvent(_0x3eec0e){return function(_0x2ebb74,_0x38ec4a,_0x2f406b){_0x2ebb74[_0x806c('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a0087){_0x2ebb74[_0x806c('0x6')](_0x806c('0x7'),_0x5a0087[_0x806c('0x8')](function(_0x3b9fd7){return{'id':_0x3b9fd7['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2ebb74['id'],'direction':'in','read':![]},'raw':!![]});})[_0x806c('0x9')](function(_0x6510e1){_0x2ebb74[_0x806c('0x6')](_0x806c('0xa'),_0x6510e1[_0x806c('0xb')]);MailInteractionEvents[_0x806c('0xc')](_0x3eec0e+':'+_0x2ebb74['id'],_0x2ebb74);MailInteractionEvents['emit'](_0x3eec0e,_0x2ebb74);_0x2f406b(null);})['catch'](_0x2f406b(null));};}for(var e in events){if(events[_0x806c('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x806c('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x21b4=['catch','hasOwnProperty','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','map','length','emit'];(function(_0x56a290,_0x4d000c){var _0x576584=function(_0xd7a76e){while(--_0xd7a76e){_0x56a290['push'](_0x56a290['shift']());}};_0x576584(++_0x4d000c);}(_0x21b4,0x15b));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x421b('0x0'));var MailInteraction=require(_0x421b('0x1'))['db'][_0x421b('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x421b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x421b('0x4')](0x0);var events={'afterCreate':_0x421b('0x5'),'afterUpdate':_0x421b('0x6'),'afterDestroy':_0x421b('0x7')};function emitEvent(_0x2b2775){return function(_0xd580d6,_0x3a9a70,_0x6056e1){_0xd580d6['getUsers']({'attributes':['id'],'raw':!![]})[_0x421b('0x8')](function(_0xefe3d7){_0xd580d6[_0x421b('0x9')]('Users',_0xefe3d7[_0x421b('0xa')](function(_0x38f603){return{'id':_0x38f603['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0xd580d6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xaeb4b6){_0xd580d6[_0x421b('0x9')]('unreadMessages',_0xaeb4b6[_0x421b('0xb')]);MailInteractionEvents[_0x421b('0xc')](_0x2b2775+':'+_0xd580d6['id'],_0xd580d6);MailInteractionEvents[_0x421b('0xc')](_0x2b2775,_0xd580d6);_0x6056e1(null);})[_0x421b('0xd')](_0x6056e1(null));};}for(var e in events){if(events[_0x421b('0xe')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 4da9549..07d1f8c 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 _0x1868=['format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','closedAt','models','get','closed','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt'];(function(_0x33ab35,_0x297cdd){var _0x59bac6=function(_0x48ff16){while(--_0x48ff16){_0x33ab35['push'](_0x33ab35['shift']());}};_0x59bac6(++_0x297cdd);}(_0x1868,0x9e));var _0x8186=function(_0x18dda6,_0x40ecf4){_0x18dda6=_0x18dda6-0x0;var _0x59dbd0=_0x1868[_0x18dda6];return _0x59dbd0;};'use strict';var _=require(_0x8186('0x0'));var util=require(_0x8186('0x1'));var logger=require(_0x8186('0x2'))('api');var moment=require(_0x8186('0x3'));var BPromise=require(_0x8186('0x4'));var rp=require(_0x8186('0x5'));var fs=require('fs');var path=require(_0x8186('0x6'));var rimraf=require(_0x8186('0x7'));var config=require(_0x8186('0x8'));var attributes=require(_0x8186('0x9'));module['exports']=function(_0x29ac0f,_0x1cdcd8){return _0x29ac0f[_0x8186('0xa')](_0x8186('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x8186('0xc'),'fields':[_0x8186('0xd'),'to'],'type':_0x8186('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x256e99,_0x263f72,_0x4106d0){if(_0x256e99['substatus']){_0x256e99[_0x8186('0xf')]=moment()[_0x8186('0x10')](_0x8186('0x11'));}if(_0x256e99['closed']){_0x256e99['closedAt']=moment()[_0x8186('0x10')](_0x8186('0x11'));}_0x4106d0(null,_0x263f72);},'beforeUpdate':function(_0x2440b6,_0xfb8781,_0x564f1b){if(_0x2440b6[_0x8186('0x12')](_0x8186('0x13'))){_0x2440b6[_0x8186('0xf')]=_0x2440b6['substatus']?moment()[_0x8186('0x10')](_0x8186('0x11')):null;}if(_0x2440b6['changed']('closed')){_0x2440b6[_0x8186('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2440b6[_0x8186('0x13')]=null;_0x2440b6['substatusAt']=null;}_0x564f1b(null,_0x2440b6);},'afterUpdate':function(_0x43d4f7,_0x373e38,_0x182d91){var _0xe352d6=_0x29ac0f[_0x8186('0x15')];var _0x315852=_0x43d4f7[_0x8186('0x16')]({'plain':!![]});if(_0x315852[_0x8186('0x17')]){return _0xe352d6['MailMessage'][_0x8186('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x315852['id']}})[_0x8186('0x19')](function(){_0x182d91();})[_0x8186('0x1a')](function(_0x2c95a2){_0x182d91(_0x2c95a2);});}else{_0x182d91();}}},'charset':_0x8186('0x1b'),'collate':_0x8186('0x1c')});}; \ No newline at end of file +var _0xa054=['request-promise','path','rimraf','../../config/environment','exports','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x327e55,_0x2767ad){var _0x7a1a9e=function(_0x2e1fef){while(--_0x2e1fef){_0x327e55['push'](_0x327e55['shift']());}};_0x7a1a9e(++_0x2767ad);}(_0xa054,0x124));var _0x4a05=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0xa054[_0x252328];return _0xaa85b7;};'use strict';var _=require(_0x4a05('0x0'));var util=require(_0x4a05('0x1'));var logger=require(_0x4a05('0x2'))(_0x4a05('0x3'));var moment=require('moment');var BPromise=require(_0x4a05('0x4'));var rp=require(_0x4a05('0x5'));var fs=require('fs');var path=require(_0x4a05('0x6'));var rimraf=require(_0x4a05('0x7'));var config=require(_0x4a05('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x4a05('0x9')]=function(_0x213ffc,_0xb3cc40){return _0x213ffc[_0x4a05('0xa')]('MailInteraction',attributes,{'tableName':_0x4a05('0xb'),'paranoid':![],'indexes':[{'name':_0x4a05('0xc'),'fields':[_0x4a05('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x14e08d,_0x5c252e,_0x55739d){if(_0x14e08d[_0x4a05('0xe')]){_0x14e08d[_0x4a05('0xf')]=moment()[_0x4a05('0x10')](_0x4a05('0x11'));}if(_0x14e08d[_0x4a05('0x12')]){_0x14e08d[_0x4a05('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x55739d(null,_0x5c252e);},'beforeUpdate':function(_0x2cf21f,_0x21f33b,_0x5f0bc4){if(_0x2cf21f[_0x4a05('0x14')](_0x4a05('0xe'))){_0x2cf21f[_0x4a05('0xf')]=_0x2cf21f['substatus']?moment()[_0x4a05('0x10')](_0x4a05('0x11')):null;}if(_0x2cf21f[_0x4a05('0x14')](_0x4a05('0x12'))){_0x2cf21f[_0x4a05('0x13')]=moment()[_0x4a05('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cf21f[_0x4a05('0xe')]=null;_0x2cf21f[_0x4a05('0xf')]=null;}_0x5f0bc4(null,_0x2cf21f);},'afterUpdate':function(_0x3dff90,_0x5408f2,_0x11f08e){var _0x37c795=_0x213ffc[_0x4a05('0x15')];var _0x374980=_0x3dff90['get']({'plain':!![]});if(_0x374980[_0x4a05('0x12')]){return _0x37c795[_0x4a05('0x16')][_0x4a05('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x374980['id']}})[_0x4a05('0x18')](function(){_0x11f08e();})[_0x4a05('0x19')](function(_0x36ad90){_0x11f08e(_0x36ad90);});}else{_0x11f08e();}}},'charset':'utf8mb4','collate':_0x4a05('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3cf1da2..b4b07c7 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 _0x705e=['ids','omit','spread','AddTags','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','MailInteraction','update','body','raw','options','limit','then','UpdateMailInteraction','debug','AddTagsToMailInteraction','find'];(function(_0x3b8c98,_0x9e6a9c){var _0x25a11d=function(_0x63e852){while(--_0x63e852){_0x3b8c98['push'](_0x3b8c98['shift']());}};_0x25a11d(++_0x9e6a9c);}(_0x705e,0x107));var _0xe705=function(_0x470212,_0x1387de){_0x470212=_0x470212-0x0;var _0x5083cb=_0x705e[_0x470212];return _0x5083cb;};'use strict';var _=require('lodash');var util=require(_0xe705('0x0'));var moment=require(_0xe705('0x1'));var BPromise=require(_0xe705('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe705('0x3'));var logger=require(_0xe705('0x4'))(_0xe705('0x5'));var config=require(_0xe705('0x6'));var jayson=require(_0xe705('0x7'));var client=jayson[_0xe705('0x8')][_0xe705('0x9')]({'port':0x232a});config[_0xe705('0xa')]=_[_0xe705('0xb')](config[_0xe705('0xa')],{'host':_0xe705('0xc'),'port':0x18eb});var socket=require(_0xe705('0xd'))(new Redis(config[_0xe705('0xa')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x192eb3,_0x1ebbe1,_0x3a9ce0){return new BPromise(function(_0x317e85,_0x334c67){return client['request'](_0x192eb3,_0x3a9ce0)['then'](function(_0x481231){logger['info'](_0xe705('0xe'),_0x1ebbe1,_0xe705('0xf'));logger['debug'](_0xe705('0x10'),_0x1ebbe1,_0xe705('0xf'),JSON[_0xe705('0x11')](_0x481231));if(_0x481231[_0xe705('0x12')]){if(_0x481231[_0xe705('0x12')]['code']===0x1f4){logger[_0xe705('0x12')](_0xe705('0xe'),_0x1ebbe1,_0x481231[_0xe705('0x12')]['message']);return _0x334c67(_0x481231[_0xe705('0x12')][_0xe705('0x13')]);}logger['error'](_0xe705('0xe'),_0x1ebbe1,_0x481231[_0xe705('0x12')][_0xe705('0x13')]);return _0x317e85(_0x481231['error'][_0xe705('0x13')]);}else{logger[_0xe705('0x14')](_0xe705('0xe'),_0x1ebbe1,_0xe705('0xf'));_0x317e85(_0x481231['result'][_0xe705('0x13')]);}})[_0xe705('0x15')](function(_0x445536){logger[_0xe705('0x12')](_0xe705('0xe'),_0x1ebbe1,_0x445536);_0x334c67(_0x445536);});});}exports['UpdateMailInteraction']=function(_0xbbeb7a){var _0x3d8f61=this;return new Promise(function(_0x1e295a,_0x452592){return db[_0xe705('0x16')][_0xe705('0x17')](_0xbbeb7a[_0xe705('0x18')],{'raw':_0xbbeb7a['options']?_0xbbeb7a['options'][_0xe705('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbbeb7a[_0xe705('0x1a')]?_0xbbeb7a['options']['where']||null:null,'attributes':_0xbbeb7a[_0xe705('0x1a')]?_0xbbeb7a[_0xe705('0x1a')]['attributes']||null:null,'limit':_0xbbeb7a[_0xe705('0x1a')]?_0xbbeb7a[_0xe705('0x1a')][_0xe705('0x1b')]||null:null})[_0xe705('0x1c')](function(_0x1c9565){logger[_0xe705('0x14')](_0xe705('0x1d'),_0xbbeb7a);logger[_0xe705('0x1e')]('UpdateMailInteraction',_0xbbeb7a,JSON[_0xe705('0x11')](_0x1c9565));_0x1e295a(_0x1c9565);})[_0xe705('0x15')](function(_0xce046c){logger[_0xe705('0x12')](_0xe705('0x1d'),_0xce046c[_0xe705('0x13')],_0xbbeb7a);_0x452592(_0x3d8f61[_0xe705('0x12')](0x1f4,_0xce046c[_0xe705('0x13')]));});});};exports[_0xe705('0x1f')]=function(_0x23b27a){return new Promise(function(_0x4273dd,_0x307bbf){return db['MailInteraction'][_0xe705('0x20')]({'where':_0x23b27a[_0xe705('0x1a')]?_0x23b27a['options']['where']||null:null})[_0xe705('0x1c')](function(_0x3d036f){if(_0x3d036f){return _0x3d036f['addTags'](_0x23b27a['body'][_0xe705('0x21')],_[_0xe705('0x22')](_0x23b27a[_0xe705('0x18')],[_0xe705('0x21'),'id'])||{});}})[_0xe705('0x23')](function(_0x5ea6b7){logger[_0xe705('0x14')]('AddTags',_0x23b27a);logger[_0xe705('0x1e')](_0xe705('0x24'),_0x23b27a,JSON[_0xe705('0x11')](_0x5ea6b7));_0x4273dd(_0x5ea6b7);})[_0xe705('0x15')](function(_0x16e29d){logger[_0xe705('0x12')](_0xe705('0x24'),_0x16e29d[_0xe705('0x13')],_0x23b27a);_0x307bbf(_this['error'](0x1f4,_0x16e29d['message']));});});}; \ No newline at end of file +var _0xefe9=['catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','addTags','body','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailInteraction,\x20%s,\x20%s','info'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xefe9,0x83));var _0x9efe=function(_0x1cf1c6,_0x378916){_0x1cf1c6=_0x1cf1c6-0x0;var _0x2e08af=_0xefe9[_0x1cf1c6];return _0x2e08af;};'use strict';var _=require(_0x9efe('0x0'));var util=require('util');var moment=require(_0x9efe('0x1'));var BPromise=require('bluebird');var rs=require(_0x9efe('0x2'));var fs=require('fs');var Redis=require(_0x9efe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9efe('0x4'));var logger=require('../../config/logger')(_0x9efe('0x5'));var config=require(_0x9efe('0x6'));var jayson=require(_0x9efe('0x7'));var client=jayson[_0x9efe('0x8')][_0x9efe('0x9')]({'port':0x232a});config[_0x9efe('0xa')]=_[_0x9efe('0xb')](config['redis'],{'host':_0x9efe('0xc'),'port':0x18eb});var socket=require(_0x9efe('0xd'))(new Redis(config[_0x9efe('0xa')]));require(_0x9efe('0xe'))[_0x9efe('0xf')](socket);function respondWithRpcPromise(_0x46470b,_0x1d3a65,_0xcc0b43){return new BPromise(function(_0x1ba171,_0x6f12c7){return client['request'](_0x46470b,_0xcc0b43)[_0x9efe('0x10')](function(_0x33a695){logger['info']('MailInteraction,\x20%s,\x20%s',_0x1d3a65,'request\x20sent');logger[_0x9efe('0x11')](_0x9efe('0x12'),_0x1d3a65,_0x9efe('0x13'),JSON[_0x9efe('0x14')](_0x33a695));if(_0x33a695[_0x9efe('0x15')]){if(_0x33a695[_0x9efe('0x15')]['code']===0x1f4){logger[_0x9efe('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1d3a65,_0x33a695[_0x9efe('0x15')][_0x9efe('0x16')]);return _0x6f12c7(_0x33a695[_0x9efe('0x15')]['message']);}logger[_0x9efe('0x15')](_0x9efe('0x17'),_0x1d3a65,_0x33a695[_0x9efe('0x15')][_0x9efe('0x16')]);return _0x1ba171(_0x33a695['error']['message']);}else{logger[_0x9efe('0x18')](_0x9efe('0x17'),_0x1d3a65,'request\x20sent');_0x1ba171(_0x33a695['result'][_0x9efe('0x16')]);}})[_0x9efe('0x19')](function(_0x5eb084){logger['error'](_0x9efe('0x17'),_0x1d3a65,_0x5eb084);_0x6f12c7(_0x5eb084);});});}exports[_0x9efe('0x1a')]=function(_0xd7673d){var _0x391f80=this;return new Promise(function(_0x1d8e24,_0x3a1f41){return db[_0x9efe('0x1b')][_0x9efe('0x1c')](_0xd7673d['body'],{'raw':_0xd7673d[_0x9efe('0x1d')]?_0xd7673d[_0x9efe('0x1d')][_0x9efe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7673d[_0x9efe('0x1d')]?_0xd7673d[_0x9efe('0x1d')][_0x9efe('0x1f')]||null:null,'attributes':_0xd7673d[_0x9efe('0x1d')]?_0xd7673d['options'][_0x9efe('0x20')]||null:null,'limit':_0xd7673d[_0x9efe('0x1d')]?_0xd7673d[_0x9efe('0x1d')]['limit']||null:null})[_0x9efe('0x10')](function(_0x5160b4){logger[_0x9efe('0x18')]('UpdateMailInteraction',_0xd7673d);logger[_0x9efe('0x11')]('UpdateMailInteraction',_0xd7673d,JSON[_0x9efe('0x14')](_0x5160b4));_0x1d8e24(_0x5160b4);})[_0x9efe('0x19')](function(_0x9fd63b){logger[_0x9efe('0x15')]('UpdateMailInteraction',_0x9fd63b[_0x9efe('0x16')],_0xd7673d);_0x3a1f41(_0x391f80[_0x9efe('0x15')](0x1f4,_0x9fd63b[_0x9efe('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0xee7d5d){return new Promise(function(_0x5640aa,_0x3d0f6c){return db['MailInteraction']['find']({'where':_0xee7d5d[_0x9efe('0x1d')]?_0xee7d5d[_0x9efe('0x1d')][_0x9efe('0x1f')]||null:null})[_0x9efe('0x10')](function(_0x297931){if(_0x297931){return _0x297931[_0x9efe('0x21')](_0xee7d5d[_0x9efe('0x22')][_0x9efe('0x23')],_[_0x9efe('0x24')](_0xee7d5d[_0x9efe('0x22')],[_0x9efe('0x23'),'id'])||{});}})[_0x9efe('0x25')](function(_0xde9b38){logger[_0x9efe('0x18')](_0x9efe('0x26'),_0xee7d5d);logger[_0x9efe('0x11')](_0x9efe('0x26'),_0xee7d5d,JSON[_0x9efe('0x14')](_0xde9b38));_0x5640aa(_0xde9b38);})[_0x9efe('0x19')](function(_0x61403e){logger['error'](_0x9efe('0x26'),_0x61403e[_0x9efe('0x16')],_0xee7d5d);_0x3d0f6c(_this[_0x9efe('0x15')](0x1f4,_0x61403e[_0x9efe('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 01df1b2..91c9765 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 _0xbb0f=['mailInteraction:','save','remove','removeListener','register','length'];(function(_0xd3f0ae,_0x5563bf){var _0x34671d=function(_0x2033f9){while(--_0x2033f9){_0xd3f0ae['push'](_0xd3f0ae['shift']());}};_0x34671d(++_0x5563bf);}(_0xbb0f,0x16f));var _0xfbb0=function(_0x5ef309,_0x421458){_0x5ef309=_0x5ef309-0x0;var _0x54546a=_0xbb0f[_0x5ef309];return _0x54546a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xfbb0('0x0'),_0xfbb0('0x1'),'update'];function createListener(_0x456bd5,_0x4826f4){return function(_0x21602c){_0x4826f4['emit'](_0x456bd5,_0x21602c);};}function removeListener(_0x90373f,_0xf637e1){return function(){MailInteractionEvents[_0xfbb0('0x2')](_0x90373f,_0xf637e1);};}exports[_0xfbb0('0x3')]=function(_0x2252fc){for(var _0x496d80=0x0,_0x1f9d96=events[_0xfbb0('0x4')];_0x496d80<_0x1f9d96;_0x496d80++){var _0x41dfaa=events[_0x496d80];var _0x5804f9=createListener(_0xfbb0('0x5')+_0x41dfaa,_0x2252fc);MailInteractionEvents['on'](_0x41dfaa,_0x5804f9);}}; \ No newline at end of file +var _0x6439=['mailInteraction:','./mailInteraction.events','save','update','emit','removeListener','register'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x6439,0x158));var _0x9643=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6439[_0x167cc1];return _0x10bc4b;};'use strict';var MailInteractionEvents=require(_0x9643('0x0'));var events=[_0x9643('0x1'),'remove',_0x9643('0x2')];function createListener(_0xd0375c,_0x5c455f){return function(_0x1e665c){_0x5c455f[_0x9643('0x3')](_0xd0375c,_0x1e665c);};}function removeListener(_0x4e1054,_0x1ab471){return function(){MailInteractionEvents[_0x9643('0x4')](_0x4e1054,_0x1ab471);};}exports[_0x9643('0x5')]=function(_0x431c32){for(var _0x5d68c1=0x0,_0x3a3d62=events['length'];_0x5d68c1<_0x3a3d62;_0x5d68c1++){var _0x414cd0=events[_0x5d68c1];var _0x36b5dd=createListener(_0x9643('0x6')+_0x414cd0,_0x431c32);MailInteractionEvents['on'](_0x414cd0,_0x36b5dd);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 72f6c4c..e7f5c6b 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 _0xb74d=['update','/:id/accept','accept','/:id/reject','delete','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','download','post','mailmessage:create','create','put','/:id'];(function(_0x74784d,_0x380276){var _0x7fbca9=function(_0x5ef105){while(--_0x5ef105){_0x74784d['push'](_0x74784d['shift']());}};_0x7fbca9(++_0x380276);}(_0xb74d,0x16e));var _0xdb74=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0xb74d[_0x3c0dcc];return _0x1a224c;};'use strict';var multer=require(_0xdb74('0x0'));var util=require('util');var path=require(_0xdb74('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb74('0x2'));var router=express['Router']();var fs_extra=require(_0xdb74('0x3'));var auth=require(_0xdb74('0x4'));var interaction=require(_0xdb74('0x5'));var config=require('../../config/environment');var controller=require(_0xdb74('0x6'));router[_0xdb74('0x7')]('/',auth[_0xdb74('0x8')](),controller['index']);router['get'](_0xdb74('0x9'),auth['isAuthenticated'](),controller[_0xdb74('0xa')]);router[_0xdb74('0x7')]('/:id',auth[_0xdb74('0x8')](),controller['show']);router[_0xdb74('0x7')](_0xdb74('0xb'),auth['isAuthenticated'](),controller[_0xdb74('0xc')]);router[_0xdb74('0xd')]('/',auth[_0xdb74('0x8')](),interaction['tracked']('mail',_0xdb74('0xe')),controller[_0xdb74('0xf')]);router[_0xdb74('0x10')](_0xdb74('0x11'),auth[_0xdb74('0x8')](),controller[_0xdb74('0x12')]);router[_0xdb74('0x10')](_0xdb74('0x13'),auth[_0xdb74('0x8')](),controller[_0xdb74('0x14')]);router[_0xdb74('0x10')](_0xdb74('0x15'),auth[_0xdb74('0x8')](),controller['reject']);router[_0xdb74('0x16')](_0xdb74('0x11'),auth[_0xdb74('0x8')](),controller[_0xdb74('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe148=['/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','show','/:id/download','download','post','mail','create','put','/:id','update'];(function(_0x29f0b0,_0x320941){var _0x2d8df4=function(_0x434191){while(--_0x434191){_0x29f0b0['push'](_0x29f0b0['shift']());}};_0x2d8df4(++_0x320941);}(_0xe148,0x109));var _0x8e14=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0xe148[_0x9105f4];return _0x57a818;};'use strict';var multer=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var path=require(_0x8e14('0x2'));var timeout=require(_0x8e14('0x3'));var express=require(_0x8e14('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e14('0x5'));var interaction=require(_0x8e14('0x6'));var config=require(_0x8e14('0x7'));var controller=require(_0x8e14('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8e14('0x9')](_0x8e14('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8e14('0x9')]('/:id',auth[_0x8e14('0xb')](),controller[_0x8e14('0xc')]);router[_0x8e14('0x9')](_0x8e14('0xd'),auth[_0x8e14('0xb')](),controller[_0x8e14('0xe')]);router[_0x8e14('0xf')]('/',auth[_0x8e14('0xb')](),interaction['tracked'](_0x8e14('0x10'),'mailmessage:create'),controller[_0x8e14('0x11')]);router[_0x8e14('0x12')](_0x8e14('0x13'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x14')]);router['put'](_0x8e14('0x15'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x16')]);router[_0x8e14('0x12')]('/:id/reject',auth[_0x8e14('0xb')](),controller['reject']);router[_0x8e14('0x17')](_0x8e14('0x13'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x18')]);module[_0x8e14('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 78a334e..335138f 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 _0xa32b=['STRING','long','DATE','Email','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x2067c1,_0x4ad413){var _0x4c2968=function(_0x51df02){while(--_0x51df02){_0x2067c1['push'](_0x2067c1['shift']());}};_0x4c2968(++_0x4ad413);}(_0xa32b,0x68));var _0xba32=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa32b[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0xba32('0x0'));var _=require('lodash');module[_0xba32('0x1')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xba32('0x2')](_0xba32('0x3'))},'read':{'type':Sequelize[_0xba32('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xba32('0x5')),'defaultValue':_0xba32('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xba32('0x6')](0x1fe)},'from':{'type':Sequelize[_0xba32('0x6')]},'to':{'type':Sequelize[_0xba32('0x2')]('long')},'cc':{'type':Sequelize[_0xba32('0x2')]('long')},'bcc':{'type':Sequelize[_0xba32('0x2')](_0xba32('0x7'))},'subject':{'type':Sequelize[_0xba32('0x2')]},'sentAt':{'type':Sequelize[_0xba32('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0xba32('0x7'))},'originCc':{'type':Sequelize['TEXT'](_0xba32('0x7'))},'originChannel':{'type':Sequelize['ENUM'](_0xba32('0x9'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xf4ae=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat'];(function(_0x764079,_0x377a6a){var _0x50b1d2=function(_0x1f9b0c){while(--_0x1f9b0c){_0x764079['push'](_0x764079['shift']());}};_0x50b1d2(++_0x377a6a);}(_0xf4ae,0x193));var _0xef4a=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0xf4ae[_0x1d30a3];return _0x32bba1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xef4a('0x0'));module[_0xef4a('0x1')]={'body':{'type':Sequelize[_0xef4a('0x2')](_0xef4a('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xef4a('0x2')](_0xef4a('0x4'))},'read':{'type':Sequelize[_0xef4a('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xef4a('0x6')]('in',_0xef4a('0x7')),'defaultValue':_0xef4a('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xef4a('0x8')](0x1fe)},'from':{'type':Sequelize[_0xef4a('0x8')]},'to':{'type':Sequelize[_0xef4a('0x2')](_0xef4a('0x3'))},'cc':{'type':Sequelize[_0xef4a('0x2')]('long')},'bcc':{'type':Sequelize['TEXT'](_0xef4a('0x3'))},'subject':{'type':Sequelize[_0xef4a('0x2')]},'sentAt':{'type':Sequelize[_0xef4a('0x9')]},'attach':{'type':Sequelize[_0xef4a('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xef4a('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xef4a('0x9')]},'originTo':{'type':Sequelize[_0xef4a('0x2')](_0xef4a('0x3'))},'originCc':{'type':Sequelize[_0xef4a('0x2')](_0xef4a('0x3'))},'originChannel':{'type':Sequelize[_0xef4a('0x6')](_0xef4a('0xb'),_0xef4a('0xc')),'defaultValue':_0xef4a('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 6840071..0302165 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 _0x5357=['http','client','request','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','offset','limit','undefined','count','status','set','Content-Range','update','then','destroy','stack','name','send','map','MailMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','body','find','catch','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','List','CmContact','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','length','root','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','UserId','user','agent','MailInteractionId','isNil','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','reject','fromString','rejectmessage','unix','toString','join','server','files','message-%s.eml','bcc','createdAt','Attachment','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','push','readFileSync','build','download','unlinkSync','eml-format','util','path','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','socket.io-emitter','html-entities','register','jayson/promise'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5357,0x1b9));var _0x7535=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5357[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x7535('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7535('0x1'));var path=require(_0x7535('0x2'));var fs=require('fs');var _=require(_0x7535('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x7535('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x7535('0x5'))(_0x7535('0x6'));var interaction_log=require(_0x7535('0x5'))(_0x7535('0x7'));var config=require(_0x7535('0x8'));var db=require(_0x7535('0x9'))['db'];config['redis']=_['defaults'](config[_0x7535('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7535('0xb'))(new Redis(config[_0x7535('0xa')]));var htmlEntities=require(_0x7535('0xc'));require('./mailMessage.socket')[_0x7535('0xd')](socket);var jayson=require(_0x7535('0xe'));var client=jayson['client'][_0x7535('0xf')]({'port':0x232c});var client9003=jayson[_0x7535('0x10')]['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3523d1,_0x5088c7,_0x20d687,_0x3ea1d6){return new BPromise(function(_0x364f7e,_0x48823d){var _0x3bb2a2=_0x3ea1d6||client;return _0x3bb2a2[_0x7535('0x11')](_0x3523d1,_0x20d687)['then'](function(_0x103f49){logger['info'](_0x7535('0x12'),_0x5088c7,_0x7535('0x13'));logger[_0x7535('0x14')](_0x7535('0x15'),_0x5088c7,_0x7535('0x13'),JSON[_0x7535('0x16')](_0x103f49));if(_0x103f49[_0x7535('0x17')]){if(_0x103f49[_0x7535('0x17')][_0x7535('0x18')]===0x1f4){logger['error'](_0x7535('0x12'),_0x5088c7,_0x103f49[_0x7535('0x17')]['message']);return _0x48823d(_0x103f49['error'][_0x7535('0x19')]);}logger[_0x7535('0x17')]('MailMessage,\x20%s,\x20%s',_0x5088c7,_0x103f49['error']['message']);return _0x364f7e(_0x103f49['error'][_0x7535('0x19')]);}else{logger[_0x7535('0x1a')](_0x7535('0x12'),_0x5088c7,_0x7535('0x13'));_0x364f7e(_0x103f49[_0x7535('0x1b')][_0x7535('0x19')]);}})['catch'](function(_0x54ddea){logger[_0x7535('0x17')](_0x7535('0x12'),_0x5088c7,_0x54ddea);_0x48823d(_0x54ddea);});});}function respondWithResult(_0x55a99d,_0x4820ac){_0x4820ac=_0x4820ac||0xc8;return function(_0x386693){if(_0x386693){return _0x55a99d['status'](_0x4820ac)['json'](_0x386693);}};}function respondWithFilteredResult(_0x35051d,_0x569736){return function(_0x36fa21){if(_0x36fa21){var _0x4850d9=typeof _0x569736[_0x7535('0x1c')]==='undefined'&&typeof _0x569736[_0x7535('0x1d')]===_0x7535('0x1e');var _0x1b48fe=_0x36fa21[_0x7535('0x1f')];var _0x3fdaab=_0x4850d9?0x0:_0x569736[_0x7535('0x1c')];var _0x3959e7=_0x4850d9?_0x36fa21[_0x7535('0x1f')]:_0x569736[_0x7535('0x1c')]+_0x569736[_0x7535('0x1d')];var _0x52898a;if(_0x3959e7>=_0x1b48fe){_0x3959e7=_0x1b48fe;_0x52898a=0xc8;}else{_0x52898a=0xce;}_0x35051d[_0x7535('0x20')](_0x52898a);return _0x35051d[_0x7535('0x21')](_0x7535('0x22'),_0x3fdaab+'-'+_0x3959e7+'/'+_0x1b48fe)['json'](_0x36fa21);}return null;};}function saveUpdates(_0x2ff4c2){return function(_0x23ab88){if(_0x23ab88){return _0x23ab88[_0x7535('0x23')](_0x2ff4c2)[_0x7535('0x24')](function(_0x14db7e){return _0x14db7e;});}return null;};}function removeEntity(_0x4aee84){return function(_0x3d5e33){if(_0x3d5e33){return _0x3d5e33[_0x7535('0x25')]()['then'](function(){_0x4aee84[_0x7535('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c811){return function(_0x570690){if(!_0x570690){_0x48c811['sendStatus'](0x194);}return _0x570690;};}function handleError(_0x330ee4,_0x25398b){_0x25398b=_0x25398b||0x1f4;return function(_0xe5281f){logger['error'](_0xe5281f[_0x7535('0x26')]);if(_0xe5281f['name']){delete _0xe5281f[_0x7535('0x27')];}_0x330ee4[_0x7535('0x20')](_0x25398b)[_0x7535('0x28')](_0xe5281f);};}exports['index']=function(_0x11fbc4,_0x5b9daa){var _0xbbf707={},_0x1045d7={},_0x1fb0b1={'count':0x0,'rows':[]};var _0x2921cf=_[_0x7535('0x29')](db[_0x7535('0x2a')][_0x7535('0x2b')],function(_0x28a1bd){return{'name':_0x28a1bd[_0x7535('0x2c')],'type':_0x28a1bd['type'][_0x7535('0x2d')]};});_0x1045d7[_0x7535('0x2e')]=_['map'](_0x2921cf,'name');_0x1045d7[_0x7535('0x2f')]=_['keys'](_0x11fbc4[_0x7535('0x2f')]);_0x1045d7[_0x7535('0x30')]=_[_0x7535('0x31')](_0x1045d7[_0x7535('0x2e')],_0x1045d7[_0x7535('0x2f')]);_0xbbf707[_0x7535('0x32')]=_[_0x7535('0x31')](_0x1045d7[_0x7535('0x2e')],qs[_0x7535('0x33')](_0x11fbc4[_0x7535('0x2f')][_0x7535('0x33')]));_0xbbf707[_0x7535('0x32')]=_0xbbf707[_0x7535('0x32')]['length']?_0xbbf707[_0x7535('0x32')]:_0x1045d7[_0x7535('0x2e')];if(!_0x11fbc4[_0x7535('0x2f')][_0x7535('0x34')](_0x7535('0x35'))){_0xbbf707[_0x7535('0x1d')]=qs[_0x7535('0x1d')](_0x11fbc4['query'][_0x7535('0x1d')]);_0xbbf707[_0x7535('0x1c')]=qs[_0x7535('0x1c')](_0x11fbc4[_0x7535('0x2f')][_0x7535('0x1c')]);}_0xbbf707['order']=qs[_0x7535('0x36')](_0x11fbc4[_0x7535('0x2f')][_0x7535('0x36')]);_0xbbf707['where']=qs[_0x7535('0x30')](_['pick'](_0x11fbc4['query'],_0x1045d7['filters']),_0x2921cf);if(_0x11fbc4[_0x7535('0x2f')][_0x7535('0x37')]){_0xbbf707[_0x7535('0x38')]=_[_0x7535('0x39')](_0xbbf707['where'],{'$or':_[_0x7535('0x29')](_0x2921cf,function(_0x372a84){if(_0x372a84[_0x7535('0x3a')]!==_0x7535('0x3b')){var _0x5e805c={};_0x5e805c[_0x372a84[_0x7535('0x27')]]={'$like':'%'+_0x11fbc4[_0x7535('0x2f')][_0x7535('0x37')]+'%'};return _0x5e805c;}})});}_0xbbf707=_[_0x7535('0x39')]({},_0xbbf707,_0x11fbc4[_0x7535('0x3c')]);var _0x3a82fa={'where':_0xbbf707[_0x7535('0x38')]};return db[_0x7535('0x2a')][_0x7535('0x1f')](_0x3a82fa)[_0x7535('0x24')](function(_0x4e53dd){_0x1fb0b1[_0x7535('0x1f')]=_0x4e53dd;if(_0x11fbc4[_0x7535('0x2f')][_0x7535('0x3d')]){_0xbbf707[_0x7535('0x3e')]=[{'all':!![]}];}return db['MailMessage'][_0x7535('0x3f')](_0xbbf707);})['then'](function(_0x2a2b31){_0x1fb0b1[_0x7535('0x40')]=_0x2a2b31;return _0x1fb0b1;})[_0x7535('0x24')](respondWithFilteredResult(_0x5b9daa,_0xbbf707))['catch'](handleError(_0x5b9daa,null));};exports['show']=function(_0x1bac7c,_0x39b960){var _0x44b063={'raw':!![],'where':{'id':_0x1bac7c[_0x7535('0x41')]['id']}},_0x4039cf={};_0x4039cf[_0x7535('0x2e')]=_[_0x7535('0x42')](db['MailMessage'][_0x7535('0x2b')]);_0x4039cf[_0x7535('0x2f')]=_[_0x7535('0x42')](_0x1bac7c[_0x7535('0x2f')]);_0x4039cf[_0x7535('0x30')]=_[_0x7535('0x31')](_0x4039cf[_0x7535('0x2e')],_0x4039cf[_0x7535('0x2f')]);_0x44b063[_0x7535('0x32')]=_[_0x7535('0x31')](_0x4039cf[_0x7535('0x2e')],qs[_0x7535('0x33')](_0x1bac7c['query']['fields']));_0x44b063[_0x7535('0x32')]=_0x44b063[_0x7535('0x32')]['length']?_0x44b063[_0x7535('0x32')]:_0x4039cf[_0x7535('0x2e')];if(_0x1bac7c[_0x7535('0x2f')][_0x7535('0x3d')]){_0x44b063[_0x7535('0x3e')]=[{'all':!![]}];}_0x44b063=_[_0x7535('0x39')]({},_0x44b063,_0x1bac7c[_0x7535('0x3c')]);return db[_0x7535('0x2a')]['find'](_0x44b063)[_0x7535('0x24')](handleEntityNotFound(_0x39b960,null))['then'](respondWithResult(_0x39b960,null))['catch'](handleError(_0x39b960,null));};exports[_0x7535('0x23')]=function(_0x3030b3,_0x34fde5){if(_0x3030b3['body']['id']){delete _0x3030b3[_0x7535('0x43')]['id'];}return db[_0x7535('0x2a')][_0x7535('0x44')]({'where':{'id':_0x3030b3[_0x7535('0x41')]['id']}})[_0x7535('0x24')](handleEntityNotFound(_0x34fde5,null))[_0x7535('0x24')](saveUpdates(_0x3030b3[_0x7535('0x43')],null))[_0x7535('0x24')](respondWithResult(_0x34fde5,null))[_0x7535('0x45')](handleError(_0x34fde5,null));};exports[_0x7535('0x25')]=function(_0x3e1e7a,_0xffd411){return db['MailMessage'][_0x7535('0x44')]({'where':{'id':_0x3e1e7a['params']['id']}})[_0x7535('0x24')](handleEntityNotFound(_0xffd411,null))[_0x7535('0x24')](removeEntity(_0xffd411,null))[_0x7535('0x45')](handleError(_0xffd411,null));};exports[_0x7535('0x46')]=function(_0x566288,_0x18edb1){return db[_0x7535('0x2a')][_0x7535('0x46')]()[_0x7535('0x24')](respondWithResult(_0x18edb1,null))[_0x7535('0x45')](handleError(_0x18edb1,null));};exports['create']=function(_0x4b2595,_0x73cd59){return db[_0x7535('0x2a')][_0x7535('0x47')](_0x4b2595[_0x7535('0x43')])[_0x7535('0x24')](function(_0x20c50a){if(_0x20c50a){if(_0x20c50a[_0x7535('0x48')]===_0x7535('0x49')&&!_0x20c50a[_0x7535('0x4a')]){var _0x1be07f,_0x4f9c50,_0x1c316a;if(_0x4b2595[_0x7535('0x43')]['to']){_0x4f9c50=_0x4b2595[_0x7535('0x43')]['to']['split'](',')[0x0];}return db[_0x7535('0x4b')][_0x7535('0x4c')]({'where':{'id':_0x20c50a[_0x7535('0x4d')]},'include':[{'model':db['CmList'],'as':_0x7535('0x4e'),'include':[{'model':db[_0x7535('0x4f')],'as':'Contacts','where':{'email':_0x4f9c50},'limit':0x1,'order':[[_0x7535('0x50'),'DESC']]}]},{'model':db[_0x7535('0x51')],'as':_0x7535('0x52'),'raw':!![],'include':[{'model':db[_0x7535('0x53')],'as':_0x7535('0x53'),'raw':!![]}]}]})[_0x7535('0x24')](function(_0x27050b){_0x1be07f=_0x27050b;if(!_0x1be07f||!_0x1be07f[_0x7535('0x52')])return;var _0x2b64db=_0x1be07f['getSmtpOptions']();if(_0x4b2595['body'][_0x7535('0x54')]&&_0x4b2595['body'][_0x7535('0x54')][_0x7535('0x55')]){for(var _0x309ba2=0x0;_0x309ba2<_0x4b2595[_0x7535('0x43')]['attachments'][_0x7535('0x55')];_0x309ba2+=0x1){_0x4b2595[_0x7535('0x43')]['attachments'][_0x309ba2]={'filename':_0x4b2595['body']['attachments'][_0x309ba2][_0x7535('0x27')],'path':path['join'](config[_0x7535('0x56')],'server/files/attachments',_0x4b2595[_0x7535('0x43')][_0x7535('0x54')][_0x309ba2][_0x7535('0x57')])};}}_0x1c316a={'account':_0x2b64db,'message':_0x4b2595['body']};return;})[_0x7535('0x24')](function(){if(_0x1be07f[_0x7535('0x4e')]){if(_0x1be07f['List'][_0x7535('0x58')][_0x7535('0x55')]){return _0x1be07f[_0x7535('0x4e')][_0x7535('0x58')][0x0];}else{return db['CmContact'][_0x7535('0x47')](_['defaults'](_0x4b2595[_0x7535('0x43')],{'firstName':_0x4b2595[_0x7535('0x43')]['to'],'email':_0x4b2595[_0x7535('0x43')]['to'],'phone':_0x4b2595[_0x7535('0x43')]['to'],'ListId':_0x1be07f[_0x7535('0x59')]}));}}else{throw new Error(_0x7535('0x5a'));}})['then'](function(){if(_0x1c316a){return respondWithRpcPromise(_0x7535('0x5b'),_0x7535('0x5c'),_0x1c316a,client9003)[_0x7535('0x24')](function(_0x59ac49){return _0x20c50a[_0x7535('0x23')]({'read':!![],'messageId':_0x59ac49[_0x7535('0x5d')],'sentAt':moment()[_0x7535('0x5e')](_0x7535('0x5f'))});})['catch'](function(_0x3bd594){logger[_0x7535('0x17')]('%s',JSON[_0x7535('0x16')](_0x3bd594));return _0x20c50a;});}return _0x20c50a;});}return _0x20c50a;}})['then'](respondWithResult(_0x73cd59,0xc9))['catch'](handleError(_0x73cd59,null));};exports['accept']=function(_0x384f86,_0x78fdf){var _0x470ad7={'agent':{},'channel':_0x7535('0x60')};if(_0x384f86['body']['id']){delete _0x384f86[_0x7535('0x43')]['id'];}_0x384f86[_0x7535('0x43')][_0x7535('0x61')]=!![];_0x384f86['body']['readAt']=moment()[_0x7535('0x5e')](_0x7535('0x5f'));_0x384f86['body'][_0x7535('0x62')]=_0x384f86['body'][_0x7535('0x62')]||_0x384f86[_0x7535('0x63')]['id'];_0x470ad7[_0x7535('0x64')]['id']=_0x384f86[_0x7535('0x43')][_0x7535('0x62')];return db[_0x7535('0x2a')][_0x7535('0x44')]({'where':{'id':_0x384f86[_0x7535('0x41')]['id'],'UserId':null}})[_0x7535('0x24')](handleEntityNotFound(_0x78fdf,null))[_0x7535('0x24')](saveUpdates(_0x384f86[_0x7535('0x43')],null))['then'](function(_0x1b06b4){if(_0x1b06b4){_0x470ad7[_0x7535('0x19')]=_0x1b06b4['get']({'plain':!![]});return db['MailInteraction'][_0x7535('0x44')]({'where':{'id':_0x1b06b4[_0x7535('0x65')]}});}return null;})[_0x7535('0x24')](handleEntityNotFound(_0x78fdf,null))[_0x7535('0x24')](function(_0x5273d5){if(_0x5273d5){return _0x5273d5[_0x7535('0x23')]({'UserId':_0x384f86[_0x7535('0x43')][_0x7535('0x62')],'read1stAt':_[_0x7535('0x66')](_0x5273d5['read1stAt'])?moment()['format'](_0x7535('0x5f')):undefined});}return null;})['then'](function(_0x44bc95){if(_0x44bc95){_0x470ad7['interaction']=_0x44bc95[_0x7535('0x67')]({'plain':!![]});interaction_log[_0x7535('0x1a')](_0x7535('0x68'),_0x384f86[_0x7535('0x63')]['id'],_0x384f86[_0x7535('0x63')][_0x7535('0x27')],_0x384f86[_0x7535('0x63')][_0x7535('0x69')],_0x470ad7[_0x7535('0x6a')]['id'],_0x384f86[_0x7535('0x43')]?JSON[_0x7535('0x16')](_0x384f86[_0x7535('0x43')]):_0x7535('0x6b'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x470ad7);}return null;})[_0x7535('0x24')](function(_0x125ed5){var _0x1d8fc1=_0x7535('0x6c')+_0x125ed5['message']['ContactId'];return db[_0x7535('0x6d')]['query'](_0x1d8fc1,{'type':db[_0x7535('0x6e')][_0x7535('0x6f')][_0x7535('0x70')],'raw':!![]})[_0x7535('0x24')](function(_0x5107d0){return _0x5107d0;});})[_0x7535('0x24')](function(_0x3ca6ea){if(_0x3ca6ea){_0x470ad7[_0x7535('0x19')][_0x7535('0x71')]=_0x3ca6ea[0x0];if(!_0x384f86[_0x7535('0x43')][_0x7535('0x62')])return;return db[_0x7535('0x72')][_0x7535('0x44')]({'where':{'id':_0x384f86['body'][_0x7535('0x62')],'role':_0x7535('0x64')},'attributes':['id',_0x7535('0x27'),_0x7535('0x73'),_0x7535('0x74'),_0x7535('0x75')],'raw':!![]});}return null;})[_0x7535('0x24')](function(_0x219de2){if(!_0x219de2)return null;_0x470ad7['message'][_0x7535('0x64')]=_0x219de2;return _0x470ad7;})[_0x7535('0x24')](function(_0x53e4cc){if(_0x53e4cc){if(_0x384f86['body']['manual']){_0x470ad7[_0x7535('0x19')][_0x7535('0x76')]=util['format'](_0x7535('0x77'),_0x384f86['user'][_0x7535('0x27')]);_0x470ad7[_0x7535('0x19')][_0x7535('0x78')]=_0x470ad7[_0x7535('0x78')];_0x470ad7[_0x7535('0x19')][_0x7535('0x79')]=_0x470ad7['channel'];_0x470ad7[_0x7535('0x19')]['event']=_0x7535('0x7a');_0x470ad7[_0x7535('0x19')][_0x7535('0x43')]=htmlToText['fromString'](_0x470ad7[_0x7535('0x19')][_0x7535('0x43')]);return respondWithRpcPromise('EventManager',_0x7535('0x7b'),{'event':_0x7535('0x7c'),'message':_0x470ad7[_0x7535('0x19')]},client9002)[_0x7535('0x24')](function(){return _0x470ad7;});}return _0x470ad7;}return null;})['then'](respondWithResult(_0x78fdf,null))['catch'](handleError(_0x78fdf,null));};exports['reject']=function(_0x31f216,_0x15c7a8){var _0x1336a2={'agent':{},'channel':_0x7535('0x60')};if(_0x31f216['body']['id']){delete _0x31f216[_0x7535('0x43')]['id'];}_0x31f216[_0x7535('0x43')][_0x7535('0x62')]=_0x31f216[_0x7535('0x43')][_0x7535('0x62')]||_0x31f216[_0x7535('0x63')]['id'];_0x1336a2['agent']['id']=_0x31f216[_0x7535('0x43')]['UserId'];return db[_0x7535('0x2a')][_0x7535('0x44')]({'where':{'id':_0x31f216[_0x7535('0x41')]['id'],'UserId':null}})[_0x7535('0x24')](handleEntityNotFound(_0x15c7a8,null))[_0x7535('0x24')](function(_0x33ff04){if(_0x33ff04){_0x1336a2[_0x7535('0x19')]=_0x33ff04[_0x7535('0x67')]({'plain':!![]});return db['MailInteraction'][_0x7535('0x44')]({'where':{'id':_0x33ff04[_0x7535('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x15c7a8,null))[_0x7535('0x24')](function(_0x2f8fcd){if(_0x2f8fcd){_0x1336a2[_0x7535('0x6a')]=_0x2f8fcd[_0x7535('0x67')]({'plain':!![]});interaction_log[_0x7535('0x1a')](_0x7535('0x7d'),_0x31f216[_0x7535('0x63')]['id'],_0x31f216[_0x7535('0x63')][_0x7535('0x27')],_0x31f216['user']['role'],_0x1336a2[_0x7535('0x6a')]['id'],_0x31f216[_0x7535('0x43')]?JSON[_0x7535('0x16')](_0x31f216['body']):'null');return respondWithRpcPromise(_0x7535('0x7e'),_0x7535('0x7f'),_0x1336a2);}return null;})[_0x7535('0x24')](function(_0x283168){var _0x3d9a10=_0x7535('0x6c')+_0x283168['message']['ContactId'];return db[_0x7535('0x6d')][_0x7535('0x2f')](_0x3d9a10,{'type':db['Sequelize']['QueryTypes'][_0x7535('0x70')],'raw':!![]})[_0x7535('0x24')](function(_0x1f57fd){return _0x1f57fd;});})[_0x7535('0x24')](function(_0x3b6c50){if(_0x3b6c50){_0x1336a2[_0x7535('0x19')][_0x7535('0x71')]=_0x3b6c50[0x0];if(!_0x31f216[_0x7535('0x43')][_0x7535('0x62')])return;return db['User']['find']({'where':{'id':_0x31f216['body']['UserId'],'role':'agent'},'attributes':['id',_0x7535('0x27'),_0x7535('0x73'),_0x7535('0x74'),_0x7535('0x75')],'raw':!![]});}return null;})[_0x7535('0x24')](function(_0x65700b){if(!_0x65700b)return null;_0x1336a2[_0x7535('0x19')]['agent']=_0x65700b;return _0x1336a2;})['then'](function(_0x2d0222){if(_0x2d0222){_0x2d0222['message'][_0x7535('0x76')]=util['format'](_0x7535('0x77'),_0x31f216[_0x7535('0x63')][_0x7535('0x27')]);_0x2d0222[_0x7535('0x19')][_0x7535('0x78')]=_0x1336a2[_0x7535('0x78')];_0x2d0222[_0x7535('0x19')][_0x7535('0x79')]=_0x1336a2[_0x7535('0x78')];_0x2d0222[_0x7535('0x19')][_0x7535('0x80')]=_0x7535('0x81');_0x2d0222['message']['body']=htmlToText[_0x7535('0x82')](_0x1336a2[_0x7535('0x19')][_0x7535('0x43')]);respondWithRpcPromise(_0x7535('0x7b'),'EventManager',{'event':_0x7535('0x83'),'message':_0x2d0222['message']},client9002);return _0x1336a2;}return null;})[_0x7535('0x24')](respondWithResult(_0x15c7a8,null))['catch'](handleError(_0x15c7a8,null));};exports['download']=function(_0x550837,_0x4d2edc){var _0x509924=moment()[_0x7535('0x84')]()[_0x7535('0x85')]();var _0x18856b=path[_0x7535('0x86')](config['root'],_0x7535('0x87'),_0x7535('0x88'),'tmp');var _0x4855d8=path[_0x7535('0x86')](config[_0x7535('0x56')],_0x7535('0x87'),'files',_0x7535('0x54'));var _0x5cfe93=util[_0x7535('0x5e')](_0x7535('0x89'),_0x509924);return db[_0x7535('0x2a')][_0x7535('0x44')]({'where':{'id':_0x550837['params']['id']},'attributes':['id',_0x7535('0x43'),'from','to','cc',_0x7535('0x8a'),'subject',_0x7535('0x8b')],'include':_0x550837[_0x7535('0x2f')]['attachments']?[{'model':db[_0x7535('0x8c')],'as':'Attachments'}]:undefined})[_0x7535('0x24')](handleEntityNotFound(_0x4d2edc,null))[_0x7535('0x24')](function(_0x2231ba){if(_0x2231ba){var _0x5dd9fb=_0x2231ba;var _0x288f25={'from':_0x5dd9fb[_0x7535('0x8d')],'to':_0x5dd9fb['to'],'subject':_0x5dd9fb['subject'],'html':htmlEntities[_0x7535('0x8e')](_0x5dd9fb[_0x7535('0x43')]),'headers':{'Date':moment(_0x5dd9fb[_0x7535('0x8b')])[_0x7535('0x5e')](_0x7535('0x8f'))},'attachments':[]};if(_0x2231ba['cc']){_0x288f25[_0x7535('0x90')]['Cc']=_0x2231ba['cc'];}if(_0x2231ba['bcc']){_0x288f25['headers'][_0x7535('0x91')]=_0x2231ba[_0x7535('0x8a')];}return new BPromise(function(_0x3d1018,_0x166da3){if(_0x2231ba['Attachments']){for(var _0x21f40e=0x0;_0x21f40e<_0x2231ba[_0x7535('0x92')]['length'];_0x21f40e++){var _0x27e41b=_0x2231ba['Attachments'][_0x21f40e];var _0x508068=path[_0x7535('0x86')](_0x4855d8,_0x27e41b[_0x7535('0x57')]);if(fs['existsSync'](_0x508068)){_0x288f25[_0x7535('0x54')][_0x7535('0x93')]({'name':_0x27e41b[_0x7535('0x27')],'contentType':_0x27e41b[_0x7535('0x3a')],'data':fs[_0x7535('0x94')](_0x508068)});}}}emlformat[_0x7535('0x95')](_0x288f25,function(_0x4c42fa,_0x58c596){if(_0x4c42fa)return _0x166da3(_0x4c42fa);fs['writeFileSync'](path[_0x7535('0x86')](_0x18856b,_0x5cfe93),_0x58c596);return _0x3d1018(_0x58c596);});});}})[_0x7535('0x24')](function(_0x325db2){if(_0x325db2){return _0x4d2edc[_0x7535('0x96')](path['join'](_0x18856b,_0x5cfe93),_0x5cfe93,function(_0x59e2aa){if(!_0x59e2aa)fs[_0x7535('0x97')](path[_0x7535('0x86')](_0x18856b,_0x5cfe93));});}})[_0x7535('0x45')](handleError(_0x4d2edc,null));}; \ No newline at end of file +var _0xadee=['html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','offset','undefined','count','limit','status','json','destroy','end','sendStatus','stack','name','index','map','MailMessage','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','update','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmContact','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List','Contacts','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','user','agent','UserId','MailInteraction','MailInteractionId','isNil','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','download','unix','toString','files','server','message-%s.eml','from','bcc','subject','createdAt','decode','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','ioredis'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xadee,0x1e0));var _0xeade=function(_0x4ce976,_0x244b80){_0x4ce976=_0x4ce976-0x0;var _0x414f10=_0xadee[_0x4ce976];return _0x414f10;};'use strict';var emlformat=require(_0xeade('0x0'));var moment=require('moment');var BPromise=require(_0xeade('0x1'));var util=require(_0xeade('0x2'));var path=require(_0xeade('0x3'));var fs=require('fs');var _=require(_0xeade('0x4'));var Redis=require(_0xeade('0x5'));var htmlToText=require(_0xeade('0x6'));var qs=require(_0xeade('0x7'));var logger=require(_0xeade('0x8'))(_0xeade('0x9'));var interaction_log=require(_0xeade('0x8'))(_0xeade('0xa'));var config=require(_0xeade('0xb'));var db=require(_0xeade('0xc'))['db'];config[_0xeade('0xd')]=_[_0xeade('0xe')](config[_0xeade('0xd')],{'host':_0xeade('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeade('0xd')]));var htmlEntities=require(_0xeade('0x10'));require(_0xeade('0x11'))[_0xeade('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0xeade('0x13')][_0xeade('0x14')]({'port':0x232c});var client9003=jayson[_0xeade('0x13')][_0xeade('0x14')]({'port':0x232b});var client9002=jayson[_0xeade('0x13')][_0xeade('0x14')]({'port':0x232a});function respondWithRpcPromise(_0xe62fcc,_0x2a98c9,_0x38e15a,_0x1bdc80){return new BPromise(function(_0xb45c58,_0x234af6){var _0x4911e6=_0x1bdc80||client;return _0x4911e6[_0xeade('0x15')](_0xe62fcc,_0x38e15a)[_0xeade('0x16')](function(_0x6c6524){logger[_0xeade('0x17')](_0xeade('0x18'),_0x2a98c9,_0xeade('0x19'));logger[_0xeade('0x1a')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2a98c9,_0xeade('0x19'),JSON[_0xeade('0x1b')](_0x6c6524));if(_0x6c6524[_0xeade('0x1c')]){if(_0x6c6524[_0xeade('0x1c')][_0xeade('0x1d')]===0x1f4){logger['error'](_0xeade('0x18'),_0x2a98c9,_0x6c6524[_0xeade('0x1c')]['message']);return _0x234af6(_0x6c6524[_0xeade('0x1c')][_0xeade('0x1e')]);}logger[_0xeade('0x1c')]('MailMessage,\x20%s,\x20%s',_0x2a98c9,_0x6c6524['error'][_0xeade('0x1e')]);return _0xb45c58(_0x6c6524[_0xeade('0x1c')]['message']);}else{logger[_0xeade('0x17')](_0xeade('0x18'),_0x2a98c9,_0xeade('0x19'));_0xb45c58(_0x6c6524[_0xeade('0x1f')][_0xeade('0x1e')]);}})[_0xeade('0x20')](function(_0x46ca46){logger[_0xeade('0x1c')](_0xeade('0x18'),_0x2a98c9,_0x46ca46);_0x234af6(_0x46ca46);});});}function respondWithResult(_0x2e121c,_0x1b58df){_0x1b58df=_0x1b58df||0xc8;return function(_0x177e02){if(_0x177e02){return _0x2e121c['status'](_0x1b58df)['json'](_0x177e02);}};}function respondWithFilteredResult(_0x5e9799,_0x4d45fd){return function(_0x16e42e){if(_0x16e42e){var _0x250d26=typeof _0x4d45fd[_0xeade('0x21')]===_0xeade('0x22')&&typeof _0x4d45fd['limit']==='undefined';var _0x372ec1=_0x16e42e[_0xeade('0x23')];var _0x352e97=_0x250d26?0x0:_0x4d45fd['offset'];var _0x239c3b=_0x250d26?_0x16e42e[_0xeade('0x23')]:_0x4d45fd[_0xeade('0x21')]+_0x4d45fd[_0xeade('0x24')];var _0x4f0671;if(_0x239c3b>=_0x372ec1){_0x239c3b=_0x372ec1;_0x4f0671=0xc8;}else{_0x4f0671=0xce;}_0x5e9799[_0xeade('0x25')](_0x4f0671);return _0x5e9799['set']('Content-Range',_0x352e97+'-'+_0x239c3b+'/'+_0x372ec1)[_0xeade('0x26')](_0x16e42e);}return null;};}function saveUpdates(_0x4eae17){return function(_0x42e227){if(_0x42e227){return _0x42e227['update'](_0x4eae17)['then'](function(_0xb32e71){return _0xb32e71;});}return null;};}function removeEntity(_0x1eb781){return function(_0x2834e8){if(_0x2834e8){return _0x2834e8[_0xeade('0x27')]()[_0xeade('0x16')](function(){_0x1eb781[_0xeade('0x25')](0xcc)[_0xeade('0x28')]();});}};}function handleEntityNotFound(_0x1fb2eb){return function(_0x5c77c7){if(!_0x5c77c7){_0x1fb2eb[_0xeade('0x29')](0x194);}return _0x5c77c7;};}function handleError(_0x4d8f0a,_0x1fdad1){_0x1fdad1=_0x1fdad1||0x1f4;return function(_0x1fbbcb){logger[_0xeade('0x1c')](_0x1fbbcb[_0xeade('0x2a')]);if(_0x1fbbcb[_0xeade('0x2b')]){delete _0x1fbbcb[_0xeade('0x2b')];}_0x4d8f0a[_0xeade('0x25')](_0x1fdad1)['send'](_0x1fbbcb);};}exports[_0xeade('0x2c')]=function(_0x48ed8e,_0x11cfc3){var _0x209b1c={},_0x209fa7={},_0x5c47e8={'count':0x0,'rows':[]};var _0x478832=_[_0xeade('0x2d')](db[_0xeade('0x2e')]['rawAttributes'],function(_0x5b95ff){return{'name':_0x5b95ff[_0xeade('0x2f')],'type':_0x5b95ff[_0xeade('0x30')][_0xeade('0x31')]};});_0x209fa7['model']=_['map'](_0x478832,_0xeade('0x2b'));_0x209fa7[_0xeade('0x32')]=_[_0xeade('0x33')](_0x48ed8e[_0xeade('0x32')]);_0x209fa7[_0xeade('0x34')]=_[_0xeade('0x35')](_0x209fa7[_0xeade('0x36')],_0x209fa7[_0xeade('0x32')]);_0x209b1c['attributes']=_[_0xeade('0x35')](_0x209fa7[_0xeade('0x36')],qs[_0xeade('0x37')](_0x48ed8e[_0xeade('0x32')][_0xeade('0x37')]));_0x209b1c[_0xeade('0x38')]=_0x209b1c[_0xeade('0x38')][_0xeade('0x39')]?_0x209b1c[_0xeade('0x38')]:_0x209fa7[_0xeade('0x36')];if(!_0x48ed8e[_0xeade('0x32')][_0xeade('0x3a')]('nolimit')){_0x209b1c[_0xeade('0x24')]=qs[_0xeade('0x24')](_0x48ed8e[_0xeade('0x32')]['limit']);_0x209b1c['offset']=qs['offset'](_0x48ed8e['query'][_0xeade('0x21')]);}_0x209b1c[_0xeade('0x3b')]=qs['sort'](_0x48ed8e[_0xeade('0x32')][_0xeade('0x3c')]);_0x209b1c['where']=qs[_0xeade('0x34')](_[_0xeade('0x3d')](_0x48ed8e[_0xeade('0x32')],_0x209fa7[_0xeade('0x34')]),_0x478832);if(_0x48ed8e[_0xeade('0x32')][_0xeade('0x3e')]){_0x209b1c[_0xeade('0x3f')]=_[_0xeade('0x40')](_0x209b1c[_0xeade('0x3f')],{'$or':_[_0xeade('0x2d')](_0x478832,function(_0x5c0a09){if(_0x5c0a09[_0xeade('0x30')]!==_0xeade('0x41')){var _0x113792={};_0x113792[_0x5c0a09[_0xeade('0x2b')]]={'$like':'%'+_0x48ed8e[_0xeade('0x32')]['filter']+'%'};return _0x113792;}})});}_0x209b1c=_[_0xeade('0x40')]({},_0x209b1c,_0x48ed8e[_0xeade('0x42')]);var _0x2a4b86={'where':_0x209b1c[_0xeade('0x3f')]};return db[_0xeade('0x2e')][_0xeade('0x23')](_0x2a4b86)[_0xeade('0x16')](function(_0x53b36c){_0x5c47e8[_0xeade('0x23')]=_0x53b36c;if(_0x48ed8e[_0xeade('0x32')][_0xeade('0x43')]){_0x209b1c[_0xeade('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0xeade('0x45')](_0x209b1c);})[_0xeade('0x16')](function(_0x3ea073){_0x5c47e8[_0xeade('0x46')]=_0x3ea073;return _0x5c47e8;})[_0xeade('0x16')](respondWithFilteredResult(_0x11cfc3,_0x209b1c))[_0xeade('0x20')](handleError(_0x11cfc3,null));};exports[_0xeade('0x47')]=function(_0x492772,_0x2f4b92){var _0x11cc1f={'raw':!![],'where':{'id':_0x492772[_0xeade('0x48')]['id']}},_0x50785e={};_0x50785e['model']=_[_0xeade('0x33')](db[_0xeade('0x2e')][_0xeade('0x49')]);_0x50785e[_0xeade('0x32')]=_['keys'](_0x492772[_0xeade('0x32')]);_0x50785e[_0xeade('0x34')]=_['intersection'](_0x50785e['model'],_0x50785e[_0xeade('0x32')]);_0x11cc1f[_0xeade('0x38')]=_[_0xeade('0x35')](_0x50785e[_0xeade('0x36')],qs[_0xeade('0x37')](_0x492772[_0xeade('0x32')][_0xeade('0x37')]));_0x11cc1f[_0xeade('0x38')]=_0x11cc1f['attributes'][_0xeade('0x39')]?_0x11cc1f[_0xeade('0x38')]:_0x50785e['model'];if(_0x492772['query']['includeAll']){_0x11cc1f[_0xeade('0x44')]=[{'all':!![]}];}_0x11cc1f=_[_0xeade('0x40')]({},_0x11cc1f,_0x492772[_0xeade('0x42')]);return db[_0xeade('0x2e')][_0xeade('0x4a')](_0x11cc1f)['then'](handleEntityNotFound(_0x2f4b92,null))['then'](respondWithResult(_0x2f4b92,null))['catch'](handleError(_0x2f4b92,null));};exports[_0xeade('0x4b')]=function(_0x219c73,_0x5b8d1f){if(_0x219c73[_0xeade('0x4c')]['id']){delete _0x219c73[_0xeade('0x4c')]['id'];}return db[_0xeade('0x2e')][_0xeade('0x4a')]({'where':{'id':_0x219c73[_0xeade('0x48')]['id']}})[_0xeade('0x16')](handleEntityNotFound(_0x5b8d1f,null))[_0xeade('0x16')](saveUpdates(_0x219c73[_0xeade('0x4c')],null))[_0xeade('0x16')](respondWithResult(_0x5b8d1f,null))[_0xeade('0x20')](handleError(_0x5b8d1f,null));};exports['destroy']=function(_0x4a0519,_0x4c0b9e){return db[_0xeade('0x2e')]['find']({'where':{'id':_0x4a0519['params']['id']}})[_0xeade('0x16')](handleEntityNotFound(_0x4c0b9e,null))[_0xeade('0x16')](removeEntity(_0x4c0b9e,null))[_0xeade('0x20')](handleError(_0x4c0b9e,null));};exports[_0xeade('0x4d')]=function(_0x3d59db,_0x1d2ef7){return db[_0xeade('0x2e')]['describe']()[_0xeade('0x16')](respondWithResult(_0x1d2ef7,null))[_0xeade('0x20')](handleError(_0x1d2ef7,null));};exports[_0xeade('0x4e')]=function(_0x3f157c,_0x4506c4){return db[_0xeade('0x2e')][_0xeade('0x4e')](_0x3f157c[_0xeade('0x4c')])[_0xeade('0x16')](function(_0x559b9c){if(_0x559b9c){if(_0x559b9c[_0xeade('0x4f')]===_0xeade('0x50')&&!_0x559b9c['secret']){var _0x3d0158,_0x2066f3,_0x3dc99b;if(_0x3f157c[_0xeade('0x4c')]['to']){_0x2066f3=_0x3f157c[_0xeade('0x4c')]['to'][_0xeade('0x51')](',')[0x0];}return db[_0xeade('0x52')][_0xeade('0x53')]({'where':{'id':_0x559b9c[_0xeade('0x54')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xeade('0x55')],'as':'Contacts','where':{'email':_0x2066f3},'limit':0x1,'order':[['updatedAt',_0xeade('0x56')]]}]},{'model':db[_0xeade('0x57')],'as':_0xeade('0x58'),'raw':!![],'include':[{'model':db[_0xeade('0x59')],'as':_0xeade('0x59'),'raw':!![]}]}]})[_0xeade('0x16')](function(_0x230d63){_0x3d0158=_0x230d63;if(!_0x3d0158||!_0x3d0158['Smtp'])return;var _0x86fe66=_0x3d0158[_0xeade('0x5a')]();if(_0x3f157c[_0xeade('0x4c')][_0xeade('0x5b')]&&_0x3f157c[_0xeade('0x4c')][_0xeade('0x5b')][_0xeade('0x39')]){for(var _0x192af5=0x0;_0x192af5<_0x3f157c[_0xeade('0x4c')]['attachments'][_0xeade('0x39')];_0x192af5+=0x1){_0x3f157c['body'][_0xeade('0x5b')][_0x192af5]={'filename':_0x3f157c['body'][_0xeade('0x5b')][_0x192af5]['name'],'path':path[_0xeade('0x5c')](config[_0xeade('0x5d')],'server/files/attachments',_0x3f157c[_0xeade('0x4c')][_0xeade('0x5b')][_0x192af5][_0xeade('0x5e')])};}}_0x3dc99b={'account':_0x86fe66,'message':_0x3f157c[_0xeade('0x4c')]};return;})[_0xeade('0x16')](function(){if(_0x3d0158[_0xeade('0x5f')]){if(_0x3d0158[_0xeade('0x5f')][_0xeade('0x60')]['length']){return _0x3d0158[_0xeade('0x5f')][_0xeade('0x60')][0x0];}else{return db[_0xeade('0x55')][_0xeade('0x4e')](_['defaults'](_0x3f157c[_0xeade('0x4c')],{'firstName':_0x3f157c[_0xeade('0x4c')]['to'],'email':_0x3f157c[_0xeade('0x4c')]['to'],'phone':_0x3f157c[_0xeade('0x4c')]['to'],'ListId':_0x3d0158[_0xeade('0x61')]}));}}else{throw new Error(_0xeade('0x62'));}})['then'](function(){if(_0x3dc99b){return respondWithRpcPromise('SendMail','sendMail',_0x3dc99b,client9003)['then'](function(_0x1cc609){return _0x559b9c[_0xeade('0x4b')]({'read':!![],'messageId':_0x1cc609[_0xeade('0x63')],'sentAt':moment()[_0xeade('0x64')](_0xeade('0x65'))});})[_0xeade('0x20')](function(_0x4fece4){logger['error']('%s',JSON[_0xeade('0x1b')](_0x4fece4));return _0x559b9c;});}return _0x559b9c;});}return _0x559b9c;}})[_0xeade('0x16')](respondWithResult(_0x4506c4,0xc9))[_0xeade('0x20')](handleError(_0x4506c4,null));};exports[_0xeade('0x66')]=function(_0xfb1b26,_0x460c17){var _0x1e2d49={'agent':{},'channel':_0xeade('0x67')};if(_0xfb1b26[_0xeade('0x4c')]['id']){delete _0xfb1b26[_0xeade('0x4c')]['id'];}_0xfb1b26['body'][_0xeade('0x68')]=!![];_0xfb1b26[_0xeade('0x4c')][_0xeade('0x69')]=moment()[_0xeade('0x64')](_0xeade('0x65'));_0xfb1b26['body']['UserId']=_0xfb1b26['body']['UserId']||_0xfb1b26[_0xeade('0x6a')]['id'];_0x1e2d49[_0xeade('0x6b')]['id']=_0xfb1b26[_0xeade('0x4c')][_0xeade('0x6c')];return db[_0xeade('0x2e')][_0xeade('0x4a')]({'where':{'id':_0xfb1b26[_0xeade('0x48')]['id'],'UserId':null}})[_0xeade('0x16')](handleEntityNotFound(_0x460c17,null))[_0xeade('0x16')](saveUpdates(_0xfb1b26[_0xeade('0x4c')],null))[_0xeade('0x16')](function(_0x5adedc){if(_0x5adedc){_0x1e2d49[_0xeade('0x1e')]=_0x5adedc['get']({'plain':!![]});return db[_0xeade('0x6d')][_0xeade('0x4a')]({'where':{'id':_0x5adedc[_0xeade('0x6e')]}});}return null;})[_0xeade('0x16')](handleEntityNotFound(_0x460c17,null))[_0xeade('0x16')](function(_0x4401ca){if(_0x4401ca){return _0x4401ca[_0xeade('0x4b')]({'UserId':_0xfb1b26[_0xeade('0x4c')][_0xeade('0x6c')],'read1stAt':_[_0xeade('0x6f')](_0x4401ca[_0xeade('0x70')])?moment()[_0xeade('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeade('0x16')](function(_0x22415a){if(_0x22415a){_0x1e2d49['interaction']=_0x22415a[_0xeade('0x71')]({'plain':!![]});interaction_log[_0xeade('0x17')](_0xeade('0x72'),_0xfb1b26['user']['id'],_0xfb1b26[_0xeade('0x6a')]['name'],_0xfb1b26[_0xeade('0x6a')][_0xeade('0x73')],_0x1e2d49[_0xeade('0x74')]['id'],_0xfb1b26['body']?JSON[_0xeade('0x1b')](_0xfb1b26[_0xeade('0x4c')]):_0xeade('0x75'));return respondWithRpcPromise(_0xeade('0x76'),_0xeade('0x77'),_0x1e2d49);}return null;})['then'](function(_0x25ea38){var _0x29f487=_0xeade('0x78')+_0x25ea38[_0xeade('0x1e')][_0xeade('0x79')];return db[_0xeade('0x7a')][_0xeade('0x32')](_0x29f487,{'type':db[_0xeade('0x7b')][_0xeade('0x7c')][_0xeade('0x7d')],'raw':!![]})['then'](function(_0x110d62){return _0x110d62;});})[_0xeade('0x16')](function(_0x4c8198){if(_0x4c8198){_0x1e2d49[_0xeade('0x1e')][_0xeade('0x7e')]=_0x4c8198[0x0];if(!_0xfb1b26[_0xeade('0x4c')][_0xeade('0x6c')])return;return db[_0xeade('0x7f')][_0xeade('0x4a')]({'where':{'id':_0xfb1b26[_0xeade('0x4c')][_0xeade('0x6c')],'role':_0xeade('0x6b')},'attributes':['id',_0xeade('0x2b'),_0xeade('0x80'),_0xeade('0x81'),'internal'],'raw':!![]});}return null;})[_0xeade('0x16')](function(_0x34c234){if(!_0x34c234)return null;_0x1e2d49[_0xeade('0x1e')][_0xeade('0x6b')]=_0x34c234;return _0x1e2d49;})[_0xeade('0x16')](function(_0x14f976){if(_0x14f976){if(_0xfb1b26['body'][_0xeade('0x82')]){_0x1e2d49[_0xeade('0x1e')][_0xeade('0x83')]=util[_0xeade('0x64')](_0xeade('0x84'),_0xfb1b26['user'][_0xeade('0x2b')]);_0x1e2d49['message'][_0xeade('0x85')]=_0x1e2d49['channel'];_0x1e2d49[_0xeade('0x1e')][_0xeade('0x86')]=_0x1e2d49[_0xeade('0x85')];_0x1e2d49['message'][_0xeade('0x87')]=_0xeade('0x66');_0x1e2d49[_0xeade('0x1e')]['body']=htmlToText[_0xeade('0x88')](_0x1e2d49['message'][_0xeade('0x4c')]);return respondWithRpcPromise('EventManager',_0xeade('0x89'),{'event':_0xeade('0x8a'),'message':_0x1e2d49['message']},client9002)[_0xeade('0x16')](function(){return _0x1e2d49;});}return _0x1e2d49;}return null;})[_0xeade('0x16')](respondWithResult(_0x460c17,null))[_0xeade('0x20')](handleError(_0x460c17,null));};exports[_0xeade('0x8b')]=function(_0x2377cd,_0x2b2591){var _0x5e689e={'agent':{},'channel':'mail'};if(_0x2377cd[_0xeade('0x4c')]['id']){delete _0x2377cd[_0xeade('0x4c')]['id'];}_0x2377cd[_0xeade('0x4c')][_0xeade('0x6c')]=_0x2377cd[_0xeade('0x4c')][_0xeade('0x6c')]||_0x2377cd[_0xeade('0x6a')]['id'];_0x5e689e['agent']['id']=_0x2377cd[_0xeade('0x4c')][_0xeade('0x6c')];return db['MailMessage'][_0xeade('0x4a')]({'where':{'id':_0x2377cd['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b2591,null))['then'](function(_0x56c30f){if(_0x56c30f){_0x5e689e[_0xeade('0x1e')]=_0x56c30f[_0xeade('0x71')]({'plain':!![]});return db['MailInteraction'][_0xeade('0x4a')]({'where':{'id':_0x56c30f['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2b2591,null))[_0xeade('0x16')](function(_0x606fea){if(_0x606fea){_0x5e689e[_0xeade('0x74')]=_0x606fea[_0xeade('0x71')]({'plain':!![]});interaction_log[_0xeade('0x17')](_0xeade('0x8c'),_0x2377cd[_0xeade('0x6a')]['id'],_0x2377cd['user']['name'],_0x2377cd[_0xeade('0x6a')]['role'],_0x5e689e[_0xeade('0x74')]['id'],_0x2377cd['body']?JSON[_0xeade('0x1b')](_0x2377cd['body']):'null');return respondWithRpcPromise(_0xeade('0x8d'),'rejectMessage',_0x5e689e);}return null;})[_0xeade('0x16')](function(_0x54b5a7){var _0x194538=_0xeade('0x78')+_0x54b5a7[_0xeade('0x1e')]['ContactId'];return db[_0xeade('0x7a')][_0xeade('0x32')](_0x194538,{'type':db[_0xeade('0x7b')][_0xeade('0x7c')]['SELECT'],'raw':!![]})[_0xeade('0x16')](function(_0x5d5de9){return _0x5d5de9;});})[_0xeade('0x16')](function(_0x211dfc){if(_0x211dfc){_0x5e689e[_0xeade('0x1e')]['contact']=_0x211dfc[0x0];if(!_0x2377cd[_0xeade('0x4c')]['UserId'])return;return db[_0xeade('0x7f')]['find']({'where':{'id':_0x2377cd[_0xeade('0x4c')]['UserId'],'role':_0xeade('0x6b')},'attributes':['id','name','fullname',_0xeade('0x81'),'internal'],'raw':!![]});}return null;})[_0xeade('0x16')](function(_0xdd3aed){if(!_0xdd3aed)return null;_0x5e689e['message'][_0xeade('0x6b')]=_0xdd3aed;return _0x5e689e;})['then'](function(_0x4bb81f){if(_0x4bb81f){_0x4bb81f[_0xeade('0x1e')]['interface']=util['format']('SIP/%s',_0x2377cd[_0xeade('0x6a')][_0xeade('0x2b')]);_0x4bb81f[_0xeade('0x1e')][_0xeade('0x85')]=_0x5e689e[_0xeade('0x85')];_0x4bb81f['message'][_0xeade('0x86')]=_0x5e689e[_0xeade('0x85')];_0x4bb81f['message'][_0xeade('0x87')]='reject';_0x4bb81f[_0xeade('0x1e')][_0xeade('0x4c')]=htmlToText[_0xeade('0x88')](_0x5e689e[_0xeade('0x1e')][_0xeade('0x4c')]);respondWithRpcPromise(_0xeade('0x89'),_0xeade('0x89'),{'event':_0xeade('0x8e'),'message':_0x4bb81f['message']},client9002);return _0x5e689e;}return null;})['then'](respondWithResult(_0x2b2591,null))[_0xeade('0x20')](handleError(_0x2b2591,null));};exports[_0xeade('0x8f')]=function(_0x11067f,_0x1ca063){var _0x2bcf16=moment()[_0xeade('0x90')]()[_0xeade('0x91')]();var _0x4bc14a=path['join'](config['root'],'server',_0xeade('0x92'),'tmp');var _0x4a72d1=path[_0xeade('0x5c')](config[_0xeade('0x5d')],_0xeade('0x93'),_0xeade('0x92'),_0xeade('0x5b'));var _0x580686=util[_0xeade('0x64')](_0xeade('0x94'),_0x2bcf16);return db[_0xeade('0x2e')][_0xeade('0x4a')]({'where':{'id':_0x11067f[_0xeade('0x48')]['id']},'attributes':['id','body',_0xeade('0x95'),'to','cc',_0xeade('0x96'),_0xeade('0x97'),_0xeade('0x98')],'include':_0x11067f['query'][_0xeade('0x5b')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xeade('0x16')](handleEntityNotFound(_0x1ca063,null))[_0xeade('0x16')](function(_0x5cc618){if(_0x5cc618){var _0x2f73de=_0x5cc618;var _0x21d69a={'from':_0x2f73de[_0xeade('0x95')],'to':_0x2f73de['to'],'subject':_0x2f73de['subject'],'html':htmlEntities[_0xeade('0x99')](_0x2f73de[_0xeade('0x4c')]),'headers':{'Date':moment(_0x2f73de['createdAt'])[_0xeade('0x64')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5cc618['cc']){_0x21d69a['headers']['Cc']=_0x5cc618['cc'];}if(_0x5cc618[_0xeade('0x96')]){_0x21d69a[_0xeade('0x9a')][_0xeade('0x9b')]=_0x5cc618[_0xeade('0x96')];}return new BPromise(function(_0x2a7fe0,_0x1cc63b){if(_0x5cc618[_0xeade('0x9c')]){for(var _0x27171c=0x0;_0x27171c<_0x5cc618[_0xeade('0x9c')][_0xeade('0x39')];_0x27171c++){var _0x2948a1=_0x5cc618[_0xeade('0x9c')][_0x27171c];var _0x22d86f=path[_0xeade('0x5c')](_0x4a72d1,_0x2948a1[_0xeade('0x5e')]);if(fs[_0xeade('0x9d')](_0x22d86f)){_0x21d69a['attachments'][_0xeade('0x9e')]({'name':_0x2948a1[_0xeade('0x2b')],'contentType':_0x2948a1[_0xeade('0x30')],'data':fs[_0xeade('0x9f')](_0x22d86f)});}}}emlformat[_0xeade('0xa0')](_0x21d69a,function(_0x5733d,_0x1fad46){if(_0x5733d)return _0x1cc63b(_0x5733d);fs[_0xeade('0xa1')](path[_0xeade('0x5c')](_0x4bc14a,_0x580686),_0x1fad46);return _0x2a7fe0(_0x1fad46);});});}})[_0xeade('0x16')](function(_0x10f2e2){if(_0x10f2e2){return _0x1ca063[_0xeade('0x8f')](path[_0xeade('0x5c')](_0x4bc14a,_0x580686),_0x580686,function(_0x33da9e){if(!_0x33da9e)fs['unlinkSync'](path[_0xeade('0x5c')](_0x4bc14a,_0x580686));});}})[_0xeade('0x20')](handleError(_0x1ca063,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 1e3eb04..e30a095 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 _0x711f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x711f,0x1ea));var _0xf711=function(_0x236487,_0x39046f){_0x236487=_0x236487-0x0;var _0x1c64cc=_0x711f[_0x236487];return _0x1c64cc;};'use strict';var EventEmitter=require(_0xf711('0x0'));var MailMessage=require(_0xf711('0x1'))['db'][_0xf711('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf711('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf711('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e2e8f){return function(_0x338510,_0x482a2d,_0x3ad496){MailMessageEvents[_0xf711('0x5')](_0x1e2e8f+':'+_0x338510['id'],_0x338510);MailMessageEvents['emit'](_0x1e2e8f,_0x338510);_0x3ad496(null);};}for(var e in events){if(events[_0xf711('0x6')](e)){var event=events[e];MailMessage[_0xf711('0x7')](e,emitEvent(event));}}module[_0xf711('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x5d80=['MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3492c8,_0x5a40aa){var _0xf3e965=function(_0x4f7ee9){while(--_0x4f7ee9){_0x3492c8['push'](_0x3492c8['shift']());}};_0xf3e965(++_0x5a40aa);}(_0x5d80,0x1a2));var _0x05d8=function(_0x4a25c0,_0x3034ca){_0x4a25c0=_0x4a25c0-0x0;var _0x478f0c=_0x5d80[_0x4a25c0];return _0x478f0c;};'use strict';var EventEmitter=require(_0x05d8('0x0'));var MailMessage=require(_0x05d8('0x1'))['db'][_0x05d8('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x05d8('0x3')](0x0);var events={'afterCreate':_0x05d8('0x4'),'afterUpdate':_0x05d8('0x5'),'afterDestroy':'remove'};function emitEvent(_0xefbe4){return function(_0x8745f8,_0x143679,_0x277680){MailMessageEvents[_0x05d8('0x6')](_0xefbe4+':'+_0x8745f8['id'],_0x8745f8);MailMessageEvents[_0x05d8('0x6')](_0xefbe4,_0x8745f8);_0x277680(null);};}for(var e in events){if(events[_0x05d8('0x7')](e)){var event=events[e];MailMessage[_0x05d8('0x8')](e,emitEvent(event));}}module[_0x05d8('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 9159ef2..1ccca61 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 _0xedb6=['MailInteraction','findOne','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','fti_mail_messages','plainBody','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xedb6,0x1ba));var _0x6edb=function(_0x37a9d7,_0x2b6fde){_0x37a9d7=_0x37a9d7-0x0;var _0x1343d3=_0xedb6[_0x37a9d7];return _0x1343d3;};'use strict';var _=require(_0x6edb('0x0'));var util=require(_0x6edb('0x1'));var logger=require(_0x6edb('0x2'))('api');var moment=require(_0x6edb('0x3'));var BPromise=require('bluebird');var rp=require(_0x6edb('0x4'));var htmlToText=require(_0x6edb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6edb('0x6'));var attributes=require(_0x6edb('0x7'));module[_0x6edb('0x8')]=function(_0xf3eaa7,_0x487ebd){return _0xf3eaa7[_0x6edb('0x9')](_0x6edb('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x6edb('0xb'),'fields':[_0x6edb('0xc'),'subject'],'type':_0x6edb('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x439b70,_0x1287e4,_0x1cb8f5){if(_0x439b70[_0x6edb('0xe')]){_0x439b70[_0x6edb('0xc')]=htmlToText['fromString'](_0x439b70['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1cb8f5(null,_0x1287e4);},'afterCreate':function(_0x1dbf76,_0x4e5891,_0x2eb9fe){var _0x2a5b8c=_0xf3eaa7[_0x6edb('0xf')];var _0x40622e=_0x1dbf76[_0x6edb('0x10')]({'plain':!![]});if(_0x40622e[_0x6edb('0x11')][_0x6edb('0x12')]()==='in'||_0x40622e['direction'][_0x6edb('0x12')]()===_0x6edb('0x13')&&!_0x40622e[_0x6edb('0x14')]&&!_[_0x6edb('0x15')](_0x40622e[_0x6edb('0x16')])){_0x2a5b8c[_0x6edb('0x17')][_0x6edb('0x18')]({'where':{'id':_0x40622e['MailInteractionId']}})['then'](function(_0x106165){if(_0x106165){_0x106165[_0x6edb('0x19')]({'lastMsgAt':_0x40622e[_0x6edb('0x1a')],'lastMsgDirection':_0x40622e[_0x6edb('0x11')]['toLowerCase']()});}})[_0x6edb('0x1b')](function(_0x4f0921){console[_0x6edb('0x1c')](_0x4f0921);});}_0x2eb9fe();}},'charset':_0x6edb('0x1d'),'collate':_0x6edb('0x1e')});}; \ No newline at end of file +var _0x69f1=['./mailMessage.attributes','MailMessage','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','out','findOne','MailInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment'];(function(_0x25837e,_0x44da6e){var _0x594854=function(_0x4f287d){while(--_0x4f287d){_0x25837e['push'](_0x25837e['shift']());}};_0x594854(++_0x44da6e);}(_0x69f1,0x135));var _0x169f=function(_0xd2e60e,_0x1465bc){_0xd2e60e=_0xd2e60e-0x0;var _0x1c767a=_0x69f1[_0xd2e60e];return _0x1c767a;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var logger=require(_0x169f('0x2'))(_0x169f('0x3'));var moment=require(_0x169f('0x4'));var BPromise=require(_0x169f('0x5'));var rp=require(_0x169f('0x6'));var htmlToText=require(_0x169f('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x169f('0x8'));var config=require(_0x169f('0x9'));var attributes=require(_0x169f('0xa'));module['exports']=function(_0x451916,_0x299b4f){return _0x451916['define'](_0x169f('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x169f('0xc'),'fields':[_0x169f('0xd'),_0x169f('0xe')],'type':_0x169f('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2cb237,_0x5a02ce,_0x5b16b5){if(_0x2cb237[_0x169f('0x10')]){_0x2cb237[_0x169f('0xd')]=htmlToText[_0x169f('0x11')](_0x2cb237[_0x169f('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5b16b5(null,_0x5a02ce);},'afterCreate':function(_0x13d985,_0x9d15b3,_0x593426){var _0x17b10e=_0x451916[_0x169f('0x12')];var _0x219075=_0x13d985[_0x169f('0x13')]({'plain':!![]});if(_0x219075['direction'][_0x169f('0x14')]()==='in'||_0x219075[_0x169f('0x15')]['toLowerCase']()===_0x169f('0x16')&&!_0x219075['secret']&&!_['isNil'](_0x219075['UserId'])){_0x17b10e['MailInteraction'][_0x169f('0x17')]({'where':{'id':_0x219075[_0x169f('0x18')]}})[_0x169f('0x19')](function(_0x17a890){if(_0x17a890){_0x17a890['update']({'lastMsgAt':_0x219075['createdAt'],'lastMsgDirection':_0x219075[_0x169f('0x15')][_0x169f('0x14')]()});}})[_0x169f('0x1a')](function(_0x17bcd0){console['error'](_0x17bcd0);});}_0x593426();}},'charset':_0x169f('0x1b'),'collate':_0x169f('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index e43c8f8..dca6590 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 _0x8952=['error','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','stringify','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8952,0x17e));var _0x2895=function(_0x546ac1,_0x370ff0){_0x546ac1=_0x546ac1-0x0;var _0xc37b33=_0x8952[_0x546ac1];return _0xc37b33;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}exports['CreateMailMessage']=function(_0x493851){var _0x442cfa=this;return new Promise(function(_0x12c2fb,_0x3ec4da){return db['MailMessage'][_0x2895('0x1a')](_0x493851[_0x2895('0x1b')],{'raw':_0x493851[_0x2895('0x1c')]?_0x493851[_0x2895('0x1c')][_0x2895('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x30c6c3){logger[_0x2895('0x10')]('CreateMailMessage',_0x493851);logger[_0x2895('0x12')](_0x2895('0x1e'),_0x493851,JSON[_0x2895('0x13')](_0x30c6c3));_0x12c2fb(_0x30c6c3);})['catch'](function(_0x4e884f){logger[_0x2895('0x15')](_0x2895('0x1e'),_0x4e884f[_0x2895('0x16')],_0x493851);_0x3ec4da(_0x442cfa['error'](0x1f4,_0x4e884f[_0x2895('0x16')]));});});}; \ No newline at end of file +var _0xcf66=['redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0x3a40c7,_0x3b5303){var _0x527d6d=function(_0x3e08f5){while(--_0x3e08f5){_0x3a40c7['push'](_0x3a40c7['shift']());}};_0x527d6d(++_0x3b5303);}(_0xcf66,0x71));var _0x6cf6=function(_0x30bf36,_0x334413){_0x30bf36=_0x30bf36-0x0;var _0x5c1eba=_0xcf66[_0x30bf36];return _0x5c1eba;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});config['redis']=_[_0x6cf6('0xa')](config[_0x6cf6('0xb')],{'host':_0x6cf6('0xc'),'port':0x18eb});var socket=require(_0x6cf6('0xd'))(new Redis(config[_0x6cf6('0xb')]));require(_0x6cf6('0xe'))['register'](socket);function respondWithRpcPromise(_0x58378c,_0x5b7f4e,_0x8e90e){return new BPromise(function(_0x504c98,_0x1fdf80){return client[_0x6cf6('0xf')](_0x58378c,_0x8e90e)[_0x6cf6('0x10')](function(_0x3f7fc1){logger['info']('MailMessage,\x20%s,\x20%s',_0x5b7f4e,'request\x20sent');logger[_0x6cf6('0x11')](_0x6cf6('0x12'),_0x5b7f4e,_0x6cf6('0x13'),JSON[_0x6cf6('0x14')](_0x3f7fc1));if(_0x3f7fc1[_0x6cf6('0x15')]){if(_0x3f7fc1[_0x6cf6('0x15')]['code']===0x1f4){logger[_0x6cf6('0x15')]('MailMessage,\x20%s,\x20%s',_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x1fdf80(_0x3f7fc1['error'][_0x6cf6('0x16')]);}logger[_0x6cf6('0x15')](_0x6cf6('0x17'),_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x504c98(_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);}else{logger[_0x6cf6('0x18')](_0x6cf6('0x17'),_0x5b7f4e,_0x6cf6('0x13'));_0x504c98(_0x3f7fc1['result'][_0x6cf6('0x16')]);}})[_0x6cf6('0x19')](function(_0x22ab0){logger['error'](_0x6cf6('0x17'),_0x5b7f4e,_0x22ab0);_0x1fdf80(_0x22ab0);});});}exports[_0x6cf6('0x1a')]=function(_0x101e39){var _0x2995b3=this;return new Promise(function(_0x440634,_0x21e903){return db[_0x6cf6('0x1b')]['create'](_0x101e39[_0x6cf6('0x1c')],{'raw':_0x101e39[_0x6cf6('0x1d')]?_0x101e39[_0x6cf6('0x1d')][_0x6cf6('0x1e')]===undefined?!![]:![]:!![]})[_0x6cf6('0x10')](function(_0x470ea4){logger[_0x6cf6('0x18')](_0x6cf6('0x1a'),_0x101e39);logger['debug']('CreateMailMessage',_0x101e39,JSON[_0x6cf6('0x14')](_0x470ea4));_0x440634(_0x470ea4);})['catch'](function(_0x45ce6e){logger[_0x6cf6('0x15')](_0x6cf6('0x1a'),_0x45ce6e[_0x6cf6('0x16')],_0x101e39);_0x21e903(_0x2995b3[_0x6cf6('0x15')](0x1f4,_0x45ce6e[_0x6cf6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 6e0d0b5..7a2a71a 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 _0xa44a=['emit','register','./mailMessage.events','update'];(function(_0x20edd4,_0x7c30f2){var _0xc4a1e4=function(_0x32f2f6){while(--_0x32f2f6){_0x20edd4['push'](_0x20edd4['shift']());}};_0xc4a1e4(++_0x7c30f2);}(_0xa44a,0x9a));var _0xaa44=function(_0x2cd832,_0x6a0705){_0x2cd832=_0x2cd832-0x0;var _0x4f052e=_0xa44a[_0x2cd832];return _0x4f052e;};'use strict';var MailMessageEvents=require(_0xaa44('0x0'));var events=['save','remove',_0xaa44('0x1')];function createListener(_0x1962a1,_0x4bceaa){return function(_0x1ae2e3){_0x4bceaa[_0xaa44('0x2')](_0x1962a1,_0x1ae2e3);};}function removeListener(_0x3427a1,_0x479854){return function(){MailMessageEvents['removeListener'](_0x3427a1,_0x479854);};}exports[_0xaa44('0x3')]=function(_0x39a3f6){for(var _0x4979e3=0x0,_0x247589=events['length'];_0x4979e3<_0x247589;_0x4979e3++){var _0x3459c5=events[_0x4979e3];var _0x37cdeb=createListener('mailMessage:'+_0x3459c5,_0x39a3f6);MailMessageEvents['on'](_0x3459c5,_0x37cdeb);}}; \ No newline at end of file +var _0xa8ff=['mailMessage:','./mailMessage.events','emit','removeListener','register','length'];(function(_0x12d82d,_0x40a7ab){var _0x5fde95=function(_0x432761){while(--_0x432761){_0x12d82d['push'](_0x12d82d['shift']());}};_0x5fde95(++_0x40a7ab);}(_0xa8ff,0x1ab));var _0xfa8f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xa8ff[_0x2070da];return _0x4f9fe1;};'use strict';var MailMessageEvents=require(_0xfa8f('0x0'));var events=['save','remove','update'];function createListener(_0x4b88d8,_0x1370f2){return function(_0x528d40){_0x1370f2[_0xfa8f('0x1')](_0x4b88d8,_0x528d40);};}function removeListener(_0x4985f9,_0x4e0613){return function(){MailMessageEvents[_0xfa8f('0x2')](_0x4985f9,_0x4e0613);};}exports[_0xfa8f('0x3')]=function(_0x5cdf23){for(var _0x1dcc61=0x0,_0x42f1d7=events[_0xfa8f('0x4')];_0x1dcc61<_0x42f1d7;_0x1dcc61++){var _0xc6ec97=events[_0x1dcc61];var _0xb43311=createListener(_0xfa8f('0x5')+_0xc6ec97,_0x5cdf23);MailMessageEvents['on'](_0xc6ec97,_0xb43311);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index c71523f..8626f2a 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 _0x1c37=['post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c37,0x19d));var _0x71c3=function(_0x585517,_0x305e82){_0x585517=_0x585517-0x0;var _0x34f7c3=_0x1c37[_0x585517];return _0x34f7c3;};'use strict';var multer=require(_0x71c3('0x0'));var util=require(_0x71c3('0x1'));var path=require('path');var timeout=require(_0x71c3('0x2'));var express=require(_0x71c3('0x3'));var router=express[_0x71c3('0x4')]();var fs_extra=require(_0x71c3('0x5'));var auth=require(_0x71c3('0x6'));var interaction=require(_0x71c3('0x7'));var config=require(_0x71c3('0x8'));var controller=require(_0x71c3('0x9'));router['get']('/',auth[_0x71c3('0xa')](),controller[_0x71c3('0xb')]);router[_0x71c3('0xc')](_0x71c3('0xd'),auth[_0x71c3('0xa')](),controller[_0x71c3('0xe')]);router[_0x71c3('0xc')]('/:id',auth[_0x71c3('0xa')](),controller['show']);router[_0x71c3('0xc')]('/:id/members',auth['isAuthenticated'](),controller[_0x71c3('0xf')]);router[_0x71c3('0xc')](_0x71c3('0x10'),auth['isAuthenticated'](),controller[_0x71c3('0x11')]);router['get'](_0x71c3('0x12'),auth[_0x71c3('0xa')](),controller[_0x71c3('0x13')]);router['post']('/',auth[_0x71c3('0xa')](),controller[_0x71c3('0x14')]);router[_0x71c3('0x15')]('/:id/teams',auth[_0x71c3('0xa')](),controller[_0x71c3('0x16')]);router[_0x71c3('0x15')](_0x71c3('0x12'),auth['isAuthenticated'](),controller[_0x71c3('0x17')]);router[_0x71c3('0x18')](_0x71c3('0x19'),auth[_0x71c3('0xa')](),controller[_0x71c3('0x1a')]);router[_0x71c3('0x1b')](_0x71c3('0x19'),auth[_0x71c3('0xa')](),controller[_0x71c3('0x1c')]);router['delete'](_0x71c3('0x10'),auth[_0x71c3('0xa')](),controller[_0x71c3('0x1d')]);router[_0x71c3('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x71c3('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x4a12=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4a12,0x15d));var _0x24a1=function(_0x20e295,_0x308599){_0x20e295=_0x20e295-0x0;var _0x33ffbe=_0x4a12[_0x20e295];return _0x33ffbe;};'use strict';var multer=require(_0x24a1('0x0'));var util=require(_0x24a1('0x1'));var path=require(_0x24a1('0x2'));var timeout=require(_0x24a1('0x3'));var express=require(_0x24a1('0x4'));var router=express[_0x24a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x24a1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24a1('0x7'));var controller=require(_0x24a1('0x8'));router['get']('/',auth[_0x24a1('0x9')](),controller[_0x24a1('0xa')]);router[_0x24a1('0xb')](_0x24a1('0xc'),auth[_0x24a1('0x9')](),controller[_0x24a1('0xd')]);router[_0x24a1('0xb')](_0x24a1('0xe'),auth[_0x24a1('0x9')](),controller[_0x24a1('0xf')]);router['get'](_0x24a1('0x10'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x24a1('0x11'),auth[_0x24a1('0x9')](),controller[_0x24a1('0x12')]);router[_0x24a1('0xb')](_0x24a1('0x13'),auth[_0x24a1('0x9')](),controller[_0x24a1('0x14')]);router[_0x24a1('0x15')]('/',auth[_0x24a1('0x9')](),controller[_0x24a1('0x16')]);router[_0x24a1('0x15')](_0x24a1('0x11'),auth['isAuthenticated'](),controller[_0x24a1('0x17')]);router['post'](_0x24a1('0x13'),auth['isAuthenticated'](),controller[_0x24a1('0x18')]);router['put']('/:id',auth[_0x24a1('0x9')](),controller[_0x24a1('0x19')]);router[_0x24a1('0x1a')](_0x24a1('0xe'),auth[_0x24a1('0x9')](),controller[_0x24a1('0x1b')]);router[_0x24a1('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0x24a1('0x1c')]);router['delete'](_0x24a1('0x13'),auth[_0x24a1('0x9')](),controller[_0x24a1('0x1d')]);module[_0x24a1('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 9b4a305..8566278 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 _0xf12f=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x5f2728,_0x4f1ea5){var _0x4f8691=function(_0x295817){while(--_0x295817){_0x5f2728['push'](_0x5f2728['shift']());}};_0x4f8691(++_0x4f1ea5);}(_0xf12f,0xcc));var _0xff12=function(_0xe36b2,_0x588b96){_0xe36b2=_0xe36b2-0x0;var _0x8055f9=_0xf12f[_0xe36b2];return _0x8055f9;};'use strict';var Sequelize=require(_0xff12('0x0'));module[_0xff12('0x1')]={'name':{'type':Sequelize[_0xff12('0x2')],'unique':_0xff12('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff12('0x2')]},'timeout':{'type':Sequelize[_0xff12('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff12('0x5')]('rrmemory',_0xff12('0x6'),_0xff12('0x7'))}}; \ No newline at end of file +var _0x9151=['ENUM','rrmemory','exports','STRING','name'];(function(_0x472eb8,_0x118204){var _0x13788e=function(_0x253601){while(--_0x253601){_0x472eb8['push'](_0x472eb8['shift']());}};_0x13788e(++_0x118204);}(_0x9151,0x124));var _0x1915=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x9151[_0x1c3370];return _0xa9b358;};'use strict';var Sequelize=require('sequelize');module[_0x1915('0x0')]={'name':{'type':Sequelize[_0x1915('0x1')],'unique':_0x1915('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1915('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1915('0x3')](_0x1915('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ba7836f..69f911b 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 _0xfb58=['format','%s/%s','SIP','getTeams','findOne','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','value','ids','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','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','describe','UserMailQueue','merge','User','findAndCountAll','UserId','agent','mailPause','createdAt'];(function(_0x22b6aa,_0x1ea80b){var _0x1b2349=function(_0x248343){while(--_0x248343){_0x22b6aa['push'](_0x22b6aa['shift']());}};_0x1b2349(++_0x1ea80b);}(_0xfb58,0x143));var _0x8fb5=function(_0x5e3aa3,_0x59d0cc){_0x5e3aa3=_0x5e3aa3-0x0;var _0x11e60a=_0xfb58[_0x5e3aa3];return _0x11e60a;};'use strict';var emlformat=require(_0x8fb5('0x0'));var rimraf=require(_0x8fb5('0x1'));var zipdir=require(_0x8fb5('0x2'));var jsonpatch=require(_0x8fb5('0x3'));var rp=require('request-promise');var moment=require(_0x8fb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fb5('0x5'));var util=require('util');var path=require(_0x8fb5('0x6'));var sox=require('sox');var csv=require(_0x8fb5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fb5('0x8'));var _=require('lodash');var squel=require(_0x8fb5('0x9'));var crypto=require('crypto');var jsforce=require(_0x8fb5('0xa'));var deskjs=require(_0x8fb5('0xb'));var toCsv=require(_0x8fb5('0x7'));var querystring=require('querystring');var Papa=require(_0x8fb5('0xc'));var Redis=require(_0x8fb5('0xd'));var authService=require(_0x8fb5('0xe'));var qs=require(_0x8fb5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fb5('0x10'));var logger=require(_0x8fb5('0x11'))(_0x8fb5('0x12'));var utils=require(_0x8fb5('0x13'));var config=require(_0x8fb5('0x14'));var licenseUtil=require(_0x8fb5('0x15'));var db=require(_0x8fb5('0x16'))['db'];config[_0x8fb5('0x17')]=_['defaults'](config['redis'],{'host':_0x8fb5('0x18'),'port':0x18eb});var socket=require(_0x8fb5('0x19'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x8fb5('0x1a')](socket);function respondWithStatusCode(_0x55cea1,_0x4e9878){_0x4e9878=_0x4e9878||0xcc;return function(_0xad51e3){if(_0xad51e3){return _0x55cea1[_0x8fb5('0x1b')](_0x4e9878);}return _0x55cea1[_0x8fb5('0x1c')](_0x4e9878)[_0x8fb5('0x1d')]();};}function respondWithResult(_0x542d55,_0x392ddb){_0x392ddb=_0x392ddb||0xc8;return function(_0xe8e196){if(_0xe8e196){return _0x542d55['status'](_0x392ddb)[_0x8fb5('0x1e')](_0xe8e196);}};}function respondWithFilteredResult(_0xa3b585,_0x599db6){return function(_0x5b04ee){if(_0x5b04ee){var _0x4b846d=typeof _0x599db6[_0x8fb5('0x1f')]==='undefined'&&typeof _0x599db6[_0x8fb5('0x20')]==='undefined';var _0x48e1b5=_0x5b04ee[_0x8fb5('0x21')];var _0x27443f=_0x4b846d?0x0:_0x599db6[_0x8fb5('0x1f')];var _0x14ab03=_0x4b846d?_0x5b04ee[_0x8fb5('0x21')]:_0x599db6[_0x8fb5('0x1f')]+_0x599db6['limit'];var _0x337610;if(_0x14ab03>=_0x48e1b5){_0x14ab03=_0x48e1b5;_0x337610=0xc8;}else{_0x337610=0xce;}_0xa3b585['status'](_0x337610);return _0xa3b585[_0x8fb5('0x22')](_0x8fb5('0x23'),_0x27443f+'-'+_0x14ab03+'/'+_0x48e1b5)[_0x8fb5('0x1e')](_0x5b04ee);}return null;};}function patchUpdates(_0x514327){return function(_0x3ff4a9){try{jsonpatch['apply'](_0x3ff4a9,_0x514327,!![]);}catch(_0x492c4e){return BPromise['reject'](_0x492c4e);}return _0x3ff4a9[_0x8fb5('0x24')]();};}function saveUpdates(_0x28348f,_0x31639d){return function(_0x2b300b){if(_0x2b300b){return _0x2b300b[_0x8fb5('0x25')](_0x28348f)[_0x8fb5('0x26')](function(_0x292fad){return _0x292fad;});}return null;};}function removeEntity(_0x40ac62,_0x55bf33){return function(_0x3d4c18){if(_0x3d4c18){return _0x3d4c18[_0x8fb5('0x27')]()[_0x8fb5('0x26')](function(){var _0x55b4ed=_0x3d4c18[_0x8fb5('0x28')]({'plain':!![]});var _0xbbef8a='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xbbef8a,'resourceId':_0x55b4ed['id']}})['then'](function(){return _0x3d4c18;});})[_0x8fb5('0x26')](function(){_0x40ac62[_0x8fb5('0x1c')](0xcc)[_0x8fb5('0x1d')]();});}};}function handleEntityNotFound(_0x16ebb5,_0x3dc27e){return function(_0xa94434){if(!_0xa94434){_0x16ebb5[_0x8fb5('0x1b')](0x194);}return _0xa94434;};}function handleError(_0x16a2ff,_0x1503f8){_0x1503f8=_0x1503f8||0x1f4;return function(_0x44e89a){logger[_0x8fb5('0x29')](_0x44e89a[_0x8fb5('0x2a')]);if(_0x44e89a[_0x8fb5('0x2b')]){delete _0x44e89a[_0x8fb5('0x2b')];}_0x16a2ff[_0x8fb5('0x1c')](_0x1503f8)['send'](_0x44e89a);};}exports[_0x8fb5('0x2c')]=function(_0x4b11b2,_0x3f3375){var _0x404fcc={},_0x4fda2f={},_0x1bbc6b={'count':0x0,'rows':[]};var _0x212f5c=_[_0x8fb5('0x2d')](db[_0x8fb5('0x2e')][_0x8fb5('0x2f')],function(_0x2b136a){return{'name':_0x2b136a[_0x8fb5('0x30')],'type':_0x2b136a['type'][_0x8fb5('0x31')]};});_0x4fda2f[_0x8fb5('0x32')]=_['map'](_0x212f5c,_0x8fb5('0x2b'));_0x4fda2f[_0x8fb5('0x33')]=_[_0x8fb5('0x34')](_0x4b11b2[_0x8fb5('0x33')]);_0x4fda2f[_0x8fb5('0x35')]=_[_0x8fb5('0x36')](_0x4fda2f[_0x8fb5('0x32')],_0x4fda2f[_0x8fb5('0x33')]);_0x404fcc[_0x8fb5('0x37')]=_[_0x8fb5('0x36')](_0x4fda2f[_0x8fb5('0x32')],qs['fields'](_0x4b11b2['query'][_0x8fb5('0x38')]));_0x404fcc[_0x8fb5('0x37')]=_0x404fcc[_0x8fb5('0x37')][_0x8fb5('0x39')]?_0x404fcc['attributes']:_0x4fda2f['model'];if(!_0x4b11b2[_0x8fb5('0x33')][_0x8fb5('0x3a')](_0x8fb5('0x3b'))){_0x404fcc['limit']=qs[_0x8fb5('0x20')](_0x4b11b2[_0x8fb5('0x33')][_0x8fb5('0x20')]);_0x404fcc[_0x8fb5('0x1f')]=qs['offset'](_0x4b11b2[_0x8fb5('0x33')][_0x8fb5('0x1f')]);}_0x404fcc[_0x8fb5('0x3c')]=qs[_0x8fb5('0x3d')](_0x4b11b2['query'][_0x8fb5('0x3d')]);_0x404fcc['where']=qs[_0x8fb5('0x35')](_[_0x8fb5('0x3e')](_0x4b11b2[_0x8fb5('0x33')],_0x4fda2f[_0x8fb5('0x35')]),_0x212f5c);if(_0x4b11b2['query']['filter']){_0x404fcc[_0x8fb5('0x3f')]=_['merge'](_0x404fcc['where'],{'$or':_['map'](_0x212f5c,function(_0x336edb){if(_0x336edb[_0x8fb5('0x40')]!==_0x8fb5('0x41')){var _0x4f877f={};_0x4f877f[_0x336edb[_0x8fb5('0x2b')]]={'$like':'%'+_0x4b11b2[_0x8fb5('0x33')][_0x8fb5('0x42')]+'%'};return _0x4f877f;}})});}_0x404fcc=_['merge']({},_0x404fcc,_0x4b11b2[_0x8fb5('0x43')]);var _0xfea239={'where':_0x404fcc[_0x8fb5('0x3f')]};return db[_0x8fb5('0x2e')]['count'](_0xfea239)[_0x8fb5('0x26')](function(_0x159a4c){_0x1bbc6b[_0x8fb5('0x21')]=_0x159a4c;if(_0x4b11b2[_0x8fb5('0x33')][_0x8fb5('0x44')]){_0x404fcc[_0x8fb5('0x45')]=[{'all':!![]}];}return db[_0x8fb5('0x2e')][_0x8fb5('0x46')](_0x404fcc);})['then'](function(_0x2b1aed){_0x1bbc6b[_0x8fb5('0x47')]=_0x2b1aed;return _0x1bbc6b;})[_0x8fb5('0x26')](respondWithFilteredResult(_0x3f3375,_0x404fcc))['catch'](handleError(_0x3f3375,null));};exports[_0x8fb5('0x48')]=function(_0x4f31ac,_0x48ba26){var _0x31162e={'raw':!![],'where':{'id':_0x4f31ac[_0x8fb5('0x49')]['id']}},_0x2606b8={};_0x2606b8[_0x8fb5('0x32')]=_[_0x8fb5('0x34')](db['MailQueue'][_0x8fb5('0x2f')]);_0x2606b8[_0x8fb5('0x33')]=_[_0x8fb5('0x34')](_0x4f31ac[_0x8fb5('0x33')]);_0x2606b8[_0x8fb5('0x35')]=_[_0x8fb5('0x36')](_0x2606b8['model'],_0x2606b8[_0x8fb5('0x33')]);_0x31162e['attributes']=_['intersection'](_0x2606b8['model'],qs[_0x8fb5('0x38')](_0x4f31ac[_0x8fb5('0x33')][_0x8fb5('0x38')]));_0x31162e[_0x8fb5('0x37')]=_0x31162e[_0x8fb5('0x37')][_0x8fb5('0x39')]?_0x31162e[_0x8fb5('0x37')]:_0x2606b8['model'];if(_0x4f31ac[_0x8fb5('0x33')]['includeAll']){_0x31162e['include']=[{'all':!![]}];}_0x31162e=_['merge']({},_0x31162e,_0x4f31ac[_0x8fb5('0x43')]);return db[_0x8fb5('0x2e')]['find'](_0x31162e)[_0x8fb5('0x26')](handleEntityNotFound(_0x48ba26,null))[_0x8fb5('0x26')](respondWithResult(_0x48ba26,null))[_0x8fb5('0x4a')](handleError(_0x48ba26,null));};exports[_0x8fb5('0x4b')]=function(_0x49da0a,_0x942543){return db[_0x8fb5('0x2e')]['create'](_0x49da0a[_0x8fb5('0x4c')],{})[_0x8fb5('0x26')](function(_0x18b080){var _0x4481b3=_0x49da0a[_0x8fb5('0x4d')][_0x8fb5('0x28')]({'plain':!![]});if(!_0x4481b3)throw new Error(_0x8fb5('0x4e'));if(_0x4481b3[_0x8fb5('0x4f')]===_0x8fb5('0x4d')){var _0x37223f=_0x18b080[_0x8fb5('0x28')]({'plain':!![]});var _0x2d13a3='MailQueues';return db[_0x8fb5('0x50')][_0x8fb5('0x51')]({'where':{'name':_0x2d13a3,'userProfileId':_0x4481b3[_0x8fb5('0x52')]},'raw':!![]})[_0x8fb5('0x26')](function(_0x2d8fdd){if(_0x2d8fdd&&_0x2d8fdd[_0x8fb5('0x53')]===0x0){return db['UserProfileResource'][_0x8fb5('0x4b')]({'name':_0x37223f[_0x8fb5('0x2b')],'resourceId':_0x37223f['id'],'type':_0x2d8fdd[_0x8fb5('0x2b')],'sectionId':_0x2d8fdd['id']},{})[_0x8fb5('0x26')](function(){return _0x18b080;});}else{return _0x18b080;}})[_0x8fb5('0x4a')](function(_0x32d7aa){logger[_0x8fb5('0x29')](_0x8fb5('0x54'),_0x32d7aa);throw _0x32d7aa;});}return _0x18b080;})[_0x8fb5('0x26')](respondWithResult(_0x942543,0xc9))[_0x8fb5('0x4a')](handleError(_0x942543,null));};exports[_0x8fb5('0x25')]=function(_0x31dab3,_0x400b10){if(_0x31dab3[_0x8fb5('0x4c')]['id']){delete _0x31dab3['body']['id'];}return db['MailQueue'][_0x8fb5('0x51')]({'where':{'id':_0x31dab3[_0x8fb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x400b10,null))['then'](saveUpdates(_0x31dab3[_0x8fb5('0x4c')],null))['then'](respondWithResult(_0x400b10,null))['catch'](handleError(_0x400b10,null));};exports[_0x8fb5('0x27')]=function(_0x52b05d,_0x42c40e){return db[_0x8fb5('0x2e')]['find']({'where':{'id':_0x52b05d[_0x8fb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x42c40e,null))[_0x8fb5('0x26')](removeEntity(_0x42c40e,null))['catch'](handleError(_0x42c40e,null));};exports[_0x8fb5('0x55')]=function(_0x1c1668,_0x45dad1){return db[_0x8fb5('0x2e')][_0x8fb5('0x55')]()[_0x8fb5('0x26')](respondWithResult(_0x45dad1,null))[_0x8fb5('0x4a')](handleError(_0x45dad1,null));};exports['getMembers']=function(_0xb79486,_0x45a162,_0x3c6e4b){var _0x1deb5b={'raw':!![],'where':{}},_0x4ef5a7={},_0x1aab91;return db[_0x8fb5('0x2e')]['findOne']({'where':{'id':_0xb79486[_0x8fb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x45a162,null))[_0x8fb5('0x26')](function(_0x326e97){if(_0x326e97){_0x1aab91=_0x326e97[_0x8fb5('0x28')]({'plain':!![]});_0x4ef5a7[_0x8fb5('0x32')]=_[_0x8fb5('0x34')](db[_0x8fb5('0x56')]['rawAttributes']);_0x4ef5a7[_0x8fb5('0x33')]=_[_0x8fb5('0x34')](_0xb79486[_0x8fb5('0x33')]);_0x4ef5a7[_0x8fb5('0x35')]=_[_0x8fb5('0x36')](_0x4ef5a7[_0x8fb5('0x32')],_0x4ef5a7[_0x8fb5('0x33')]);_0x1deb5b[_0x8fb5('0x37')]=_[_0x8fb5('0x36')](_0x4ef5a7[_0x8fb5('0x32')],qs['fields'](_0xb79486[_0x8fb5('0x33')]['fields']));_0x1deb5b[_0x8fb5('0x37')]=_0x1deb5b[_0x8fb5('0x37')][_0x8fb5('0x39')]?_0x1deb5b['attributes']:_0x4ef5a7[_0x8fb5('0x32')];if(!_0xb79486[_0x8fb5('0x33')]['hasOwnProperty'](_0x8fb5('0x3b'))){_0x1deb5b[_0x8fb5('0x20')]=qs[_0x8fb5('0x20')](_0xb79486['query'][_0x8fb5('0x20')]);_0x1deb5b['offset']=qs[_0x8fb5('0x1f')](_0xb79486['query'][_0x8fb5('0x1f')]);}_0x1deb5b['order']=qs[_0x8fb5('0x3d')](_0xb79486['query'][_0x8fb5('0x3d')]);_0x1deb5b[_0x8fb5('0x3f')]=qs['filters'](_[_0x8fb5('0x3e')](_0xb79486[_0x8fb5('0x33')],_0x4ef5a7[_0x8fb5('0x35')]));_0x1deb5b[_0x8fb5('0x3f')]['MailQueueId']=_0x326e97['id'];if(_0xb79486[_0x8fb5('0x33')][_0x8fb5('0x42')]){_0x1deb5b[_0x8fb5('0x3f')]=_['merge'](_0x1deb5b[_0x8fb5('0x3f')],{'$or':_[_0x8fb5('0x2d')](_0x1deb5b[_0x8fb5('0x37')],function(_0x3f8c34){var _0x43ca69={};_0x43ca69[_0x3f8c34]={'$like':'%'+_0xb79486['query'][_0x8fb5('0x42')]+'%'};return _0x43ca69;})});}_0x1deb5b=_[_0x8fb5('0x57')]({},_0x1deb5b,_0xb79486['options']);return db[_0x8fb5('0x56')][_0x8fb5('0x46')](_0x1deb5b);}})[_0x8fb5('0x26')](function(_0x297de4){if(_0x297de4){return db[_0x8fb5('0x58')][_0x8fb5('0x59')]({'where':{'id':_[_0x8fb5('0x2d')](_0x297de4,_0x8fb5('0x5a')),'role':_0x8fb5('0x5b')},'attributes':['id',_0x8fb5('0x2b'),_0x8fb5('0x5c'),'updatedAt',_0x8fb5('0x5d')]});}})[_0x8fb5('0x26')](function(_0x24b9bd){if(_0x24b9bd){return{'count':_0x24b9bd[_0x8fb5('0x21')],'rows':_[_0x8fb5('0x2d')](_0x24b9bd[_0x8fb5('0x47')],function(_0x4c9fa2){return{'membername':_0x4c9fa2['name'],'UserId':_0x4c9fa2['id'],'queue_name':_0x1aab91[_0x8fb5('0x2b')],'MailQueueId':_0x1aab91['id'],'interface':util[_0x8fb5('0x5e')](_0x8fb5('0x5f'),_0x8fb5('0x60'),_0x4c9fa2['name']),'penalty':0x0,'paused':_0x4c9fa2[_0x8fb5('0x5c')],'createdAt':_0x4c9fa2[_0x8fb5('0x5d')],'updatedAt':_0x4c9fa2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8fb5('0x26')](respondWithFilteredResult(_0x45a162,_0x1deb5b))[_0x8fb5('0x4a')](handleError(_0x45a162,null));};exports[_0x8fb5('0x61')]=function(_0x308c86,_0x40a4a2,_0x55ea16){var _0x1a0090={};var _0x36bce6={};var _0x376b55;var _0x4c0cfd;return db['MailQueue'][_0x8fb5('0x62')]({'where':{'id':_0x308c86[_0x8fb5('0x49')]['id']}})[_0x8fb5('0x26')](handleEntityNotFound(_0x40a4a2,null))['then'](function(_0x305ae8){if(_0x305ae8){_0x376b55=_0x305ae8;_0x36bce6[_0x8fb5('0x32')]=_[_0x8fb5('0x34')](db['Team']['rawAttributes']);_0x36bce6[_0x8fb5('0x33')]=_[_0x8fb5('0x34')](_0x308c86['query']);_0x36bce6[_0x8fb5('0x35')]=_['intersection'](_0x36bce6[_0x8fb5('0x32')],_0x36bce6[_0x8fb5('0x33')]);_0x1a0090['attributes']=_[_0x8fb5('0x36')](_0x36bce6[_0x8fb5('0x32')],qs[_0x8fb5('0x38')](_0x308c86['query']['fields']));_0x1a0090[_0x8fb5('0x37')]=_0x1a0090[_0x8fb5('0x37')][_0x8fb5('0x39')]?_0x1a0090[_0x8fb5('0x37')]:_0x36bce6['model'];_0x1a0090[_0x8fb5('0x3c')]=qs['sort'](_0x308c86[_0x8fb5('0x33')][_0x8fb5('0x3d')]);_0x1a0090[_0x8fb5('0x3f')]=qs[_0x8fb5('0x35')](_['pick'](_0x308c86[_0x8fb5('0x33')],_0x36bce6[_0x8fb5('0x35')]));if(_0x308c86['query'][_0x8fb5('0x42')]){_0x1a0090[_0x8fb5('0x3f')]=_[_0x8fb5('0x57')](_0x1a0090[_0x8fb5('0x3f')],{'$or':_[_0x8fb5('0x2d')](_0x1a0090[_0x8fb5('0x37')],function(_0x421cc5){var _0xa931e2={};_0xa931e2[_0x421cc5]={'$like':'%'+_0x308c86[_0x8fb5('0x33')]['filter']+'%'};return _0xa931e2;})});}_0x1a0090=_[_0x8fb5('0x57')]({},_0x1a0090,_0x308c86[_0x8fb5('0x43')]);return _0x376b55['getTeams'](_0x1a0090);}})[_0x8fb5('0x26')](function(_0x28072a){if(_0x28072a){_0x4c0cfd=_0x28072a[_0x8fb5('0x39')];if(!_0x308c86['query'][_0x8fb5('0x3a')](_0x8fb5('0x3b'))){_0x1a0090[_0x8fb5('0x20')]=qs['limit'](_0x308c86[_0x8fb5('0x33')]['limit']);_0x1a0090[_0x8fb5('0x1f')]=qs['offset'](_0x308c86[_0x8fb5('0x33')][_0x8fb5('0x1f')]);}return _0x376b55[_0x8fb5('0x61')](_0x1a0090);}})['then'](function(_0x301525){if(_0x301525){return _0x301525?{'count':_0x4c0cfd,'rows':_0x301525}:null;}})[_0x8fb5('0x26')](respondWithResult(_0x40a4a2,null))[_0x8fb5('0x4a')](handleError(_0x40a4a2,null));};exports[_0x8fb5('0x63')]=function(_0x276e5c,_0x38d869,_0x3fff32){var _0x7870ff=_0x276e5c['body']['ids'];return db[_0x8fb5('0x64')][_0x8fb5('0x46')]({'where':{'id':_0x7870ff},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8fb5('0x65'),'attributes':['id',_0x8fb5('0x2b'),_0x8fb5('0x66'),_0x8fb5('0x67'),_0x8fb5('0x68')],'raw':!![]}]})['then'](function(_0x2c2be3){if(_0x2c2be3){var _0x226c7d=_[_0x8fb5('0x69')](_0x2c2be3,function(_0x5d8bca){var _0x2ce84f=_0x5d8bca[_0x8fb5('0x28')]({'plain':!![]});return _0x2ce84f[_0x8fb5('0x65')];});return db[_0x8fb5('0x2e')][_0x8fb5('0x51')]({'where':{'id':_0x276e5c[_0x8fb5('0x49')]['id']}})[_0x8fb5('0x26')](function(_0x50ab61){return db[_0x8fb5('0x6a')][_0x8fb5('0x6b')](function(_0x1ae364){return _0x50ab61[_0x8fb5('0x63')](_0x7870ff,{'transaction':_0x1ae364})['then'](function(){return BPromise[_0x8fb5('0x6c')](_0x226c7d,function(_0x426091){return db[_0x8fb5('0x56')][_0x8fb5('0x6d')]({'where':{'UserId':_0x426091['id'],'MailQueueId':_0x276e5c[_0x8fb5('0x49')]['id']},'transaction':_0x1ae364});});})[_0x8fb5('0x26')](function(){_0x226c7d[_0x8fb5('0x6e')](function(_0x38f92c){socket[_0x8fb5('0x6f')](_0x8fb5('0x70'),{'UserId':_0x38f92c['id'],'MailQueueId':_0x50ab61['id']});});});});});}})[_0x8fb5('0x26')](respondWithStatusCode(_0x38d869,null))[_0x8fb5('0x4a')](handleError(_0x38d869,null));};exports[_0x8fb5('0x71')]=function(_0x2c07a4,_0x18bebd,_0xcd893){return db[_0x8fb5('0x64')][_0x8fb5('0x46')]({'where':{'id':_0x2c07a4[_0x8fb5('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8fb5('0x58')],'as':_0x8fb5('0x65'),'attributes':['id'],'raw':!![]}]})[_0x8fb5('0x26')](handleEntityNotFound(_0x18bebd,null))[_0x8fb5('0x26')](function(_0x4fb316){var _0x2eaa49=_[_0x8fb5('0x2d')](_0x4fb316,'id');var _0xf5263f=[];var _0x5edbac=[];var _0x36a868=squel['select']();_0x36a868[_0x8fb5('0x72')](_0x8fb5('0x73'))[_0x8fb5('0x74')](_0x8fb5('0x75'),'tq')['join'](_0x8fb5('0x76'),'ut',_0x8fb5('0x77'))[_0x8fb5('0x3f')](_0x8fb5('0x78'),_0x2c07a4[_0x8fb5('0x49')]['id']);for(var _0x387d28=0x0;_0x387d28<_0x4fb316[_0x8fb5('0x39')];_0x387d28+=0x1){let _0x4788a4=_0x4fb316[_0x387d28];for(var _0x176188=0x0;_0x176188<_0x4788a4[_0x8fb5('0x65')][_0x8fb5('0x39')];_0x176188+=0x1){let _0x216e5d=_0x4788a4[_0x8fb5('0x65')][_0x176188];var _0x31f3e3=_0x36a868['clone']();_0x31f3e3[_0x8fb5('0x3f')](_0x8fb5('0x79'),_0x216e5d['id']);_0x5edbac[_0x8fb5('0x7a')](db[_0x8fb5('0x6a')][_0x8fb5('0x33')](_0x31f3e3[_0x8fb5('0x7b')](),{'type':db[_0x8fb5('0x6a')][_0x8fb5('0x7c')]['SELECT']})[_0x8fb5('0x26')](function(_0x3646a0){if(_0x3646a0['length']===0x1){return _0x216e5d['id'];}else{var _0x44fb11=_[_0x8fb5('0x7d')](_['map'](_0x3646a0,_0x8fb5('0x7e')),function(_0x27b869){return _[_0x8fb5('0x7f')](_0x2eaa49,_0x27b869);});if(_0x44fb11){return _0x216e5d['id'];}}}));}}return BPromise['all'](_0x5edbac)['then'](function(_0x415f23){_0xf5263f=_(_0xf5263f)[_0x8fb5('0x80')](_0x415f23)['compact']()[_0x8fb5('0x81')]();return db['MailQueue']['find']({'where':{'id':_0x2c07a4[_0x8fb5('0x49')]['id']}})[_0x8fb5('0x26')](function(_0x182469){return db[_0x8fb5('0x6a')]['transaction'](function(_0x4d1ec7){return _0x182469[_0x8fb5('0x71')](_0x2c07a4[_0x8fb5('0x33')][_0x8fb5('0x82')],{'transaction':_0x4d1ec7})[_0x8fb5('0x26')](function(){if(!_[_0x8fb5('0x83')](_0xf5263f)){return _0x182469[_0x8fb5('0x84')](_0xf5263f,{'transaction':_0x4d1ec7});}})[_0x8fb5('0x26')](function(){_0xf5263f[_0x8fb5('0x6e')](function(_0xe3ae74){socket[_0x8fb5('0x6f')]('userMailQueue:remove',{'UserId':_0xe3ae74,'MailQueueId':_0x182469['id']});});});});});});})['then'](respondWithStatusCode(_0x18bebd,null))[_0x8fb5('0x4a')](handleError(_0x18bebd,null));};exports[_0x8fb5('0x85')]=function(_0x583225,_0x719fe8,_0x1c651c){return db[_0x8fb5('0x2e')][_0x8fb5('0x51')]({'where':{'id':_0x583225[_0x8fb5('0x49')]['id']}})[_0x8fb5('0x26')](handleEntityNotFound(_0x719fe8,null))[_0x8fb5('0x26')](function(_0x683f6e){if(_0x683f6e){return _0x683f6e[_0x8fb5('0x85')](_0x583225['body'][_0x8fb5('0x82')],_[_0x8fb5('0x86')](_0x583225['body'],[_0x8fb5('0x82'),'id'])||{})[_0x8fb5('0x87')](function(_0xc8bc5c){for(var _0x2a4630=0x0;_0x2a4630<_0x583225[_0x8fb5('0x4c')]['ids'][_0x8fb5('0x39')];_0x2a4630+=0x1){socket[_0x8fb5('0x6f')]('userMailQueue:save',{'UserId':Number(_0x583225['body'][_0x8fb5('0x82')][_0x2a4630]),'MailQueueId':Number(_0x583225['params']['id'])});}return _0xc8bc5c;});}})[_0x8fb5('0x26')](respondWithResult(_0x719fe8,null))['catch'](handleError(_0x719fe8,null));};exports[_0x8fb5('0x84')]=function(_0x17bf93,_0x57d579,_0x44440b){return db[_0x8fb5('0x2e')]['find']({'where':{'id':_0x17bf93[_0x8fb5('0x49')]['id']}})[_0x8fb5('0x26')](handleEntityNotFound(_0x57d579,null))[_0x8fb5('0x26')](function(_0x20a984){if(_0x20a984){return _0x20a984[_0x8fb5('0x84')](_0x17bf93[_0x8fb5('0x33')][_0x8fb5('0x82')])['then'](function(){if(_[_0x8fb5('0x88')](_0x17bf93[_0x8fb5('0x33')][_0x8fb5('0x82')])){for(var _0xc819dd=0x0;_0xc819dd<_0x17bf93[_0x8fb5('0x33')][_0x8fb5('0x82')][_0x8fb5('0x39')];_0xc819dd+=0x1){socket[_0x8fb5('0x6f')](_0x8fb5('0x89'),{'UserId':Number(_0x17bf93[_0x8fb5('0x33')]['ids'][_0xc819dd]),'MailQueueId':Number(_0x17bf93[_0x8fb5('0x49')]['id'])});}}else{socket['emit'](_0x8fb5('0x89'),{'UserId':Number(_0x17bf93[_0x8fb5('0x33')][_0x8fb5('0x82')]),'MailQueueId':Number(_0x17bf93['params']['id'])});}});}})[_0x8fb5('0x26')](respondWithStatusCode(_0x57d579,null))[_0x8fb5('0x4a')](handleError(_0x57d579,null));};exports[_0x8fb5('0x8a')]=function(_0x3e0994,_0x1cb96d,_0x267b00){var _0x33f37a={};var _0x5d14bc={};var _0x2ee0bb;var _0x139b31;return db['MailQueue']['findOne']({'where':{'id':_0x3e0994[_0x8fb5('0x49')]['id']}})['then'](handleEntityNotFound(_0x1cb96d,null))[_0x8fb5('0x26')](function(_0x31d05b){if(_0x31d05b){_0x2ee0bb=_0x31d05b;_0x5d14bc[_0x8fb5('0x32')]=_[_0x8fb5('0x34')](db[_0x8fb5('0x58')]['rawAttributes']);_0x5d14bc[_0x8fb5('0x33')]=_[_0x8fb5('0x34')](_0x3e0994[_0x8fb5('0x33')]);_0x5d14bc[_0x8fb5('0x35')]=_[_0x8fb5('0x36')](_0x5d14bc['model'],_0x5d14bc[_0x8fb5('0x33')]);_0x33f37a[_0x8fb5('0x37')]=_[_0x8fb5('0x36')](_0x5d14bc[_0x8fb5('0x32')],qs[_0x8fb5('0x38')](_0x3e0994[_0x8fb5('0x33')]['fields']));_0x33f37a['attributes']=_0x33f37a[_0x8fb5('0x37')]['length']?_0x33f37a[_0x8fb5('0x37')]:_0x5d14bc[_0x8fb5('0x32')];_0x33f37a['order']=qs['sort'](_0x3e0994[_0x8fb5('0x33')][_0x8fb5('0x3d')]);_0x33f37a[_0x8fb5('0x3f')]=qs[_0x8fb5('0x35')](_[_0x8fb5('0x3e')](_0x3e0994['query'],_0x5d14bc[_0x8fb5('0x35')]));if(_0x3e0994['query'][_0x8fb5('0x42')]){_0x33f37a[_0x8fb5('0x3f')]=_[_0x8fb5('0x57')](_0x33f37a['where'],{'$or':_[_0x8fb5('0x2d')](_0x33f37a[_0x8fb5('0x37')],function(_0x3870f2){var _0x579351={};_0x579351[_0x3870f2]={'$like':'%'+_0x3e0994[_0x8fb5('0x33')][_0x8fb5('0x42')]+'%'};return _0x579351;})});}_0x33f37a=_[_0x8fb5('0x57')]({},_0x33f37a,_0x3e0994[_0x8fb5('0x43')]);return _0x2ee0bb[_0x8fb5('0x8a')](_0x33f37a);}})['then'](function(_0x39908a){if(_0x39908a){_0x139b31=_0x39908a['length'];if(!_0x3e0994[_0x8fb5('0x33')][_0x8fb5('0x3a')](_0x8fb5('0x3b'))){_0x33f37a['limit']=qs[_0x8fb5('0x20')](_0x3e0994['query'][_0x8fb5('0x20')]);_0x33f37a[_0x8fb5('0x1f')]=qs[_0x8fb5('0x1f')](_0x3e0994['query'][_0x8fb5('0x1f')]);}return _0x2ee0bb['getAgents'](_0x33f37a);}})[_0x8fb5('0x26')](function(_0x349cba){if(_0x349cba){return _0x349cba?{'count':_0x139b31,'rows':_0x349cba}:null;}})[_0x8fb5('0x26')](respondWithResult(_0x1cb96d,null))[_0x8fb5('0x4a')](handleError(_0x1cb96d,null));}; \ No newline at end of file +var _0x1261=['fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','end','json','offset','limit','undefined','count','status','apply','reject','save','update','destroy','then','get','MailQueues','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','MailQueue','includeAll','findAll','rows','show','params','include','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','filter','User','agent','updatedAt','%s/%s','SIP','mailPause','createdAt','Team','getTeams','addTeams','ids','online','voicePause','interface','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','eml-format','rimraf'];(function(_0x4caccf,_0x1255d8){var _0x4596ab=function(_0x898a4c){while(--_0x898a4c){_0x4caccf['push'](_0x4caccf['shift']());}};_0x4596ab(++_0x1255d8);}(_0x1261,0x1a8));var _0x1126=function(_0x67e9ca,_0x419250){_0x67e9ca=_0x67e9ca-0x0;var _0x1b81d6=_0x1261[_0x67e9ca];return _0x1b81d6;};'use strict';var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1126('0x2'));var rp=require('request-promise');var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var Mustache=require(_0x1126('0x5'));var util=require('util');var path=require(_0x1126('0x6'));var sox=require(_0x1126('0x7'));var csv=require(_0x1126('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1126('0x9'));var squel=require('squel');var crypto=require(_0x1126('0xa'));var jsforce=require(_0x1126('0xb'));var deskjs=require(_0x1126('0xc'));var toCsv=require(_0x1126('0x8'));var querystring=require(_0x1126('0xd'));var Papa=require(_0x1126('0xe'));var Redis=require('ioredis');var authService=require(_0x1126('0xf'));var qs=require(_0x1126('0x10'));var as=require(_0x1126('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1126('0x12'))(_0x1126('0x13'));var utils=require(_0x1126('0x14'));var config=require(_0x1126('0x15'));var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];config[_0x1126('0x18')]=_[_0x1126('0x19')](config[_0x1126('0x18')],{'host':_0x1126('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1126('0x18')]));require(_0x1126('0x1b'))[_0x1126('0x1c')](socket);function respondWithStatusCode(_0x2d39ca,_0x39ce31){_0x39ce31=_0x39ce31||0xcc;return function(_0x15b3c7){if(_0x15b3c7){return _0x2d39ca['sendStatus'](_0x39ce31);}return _0x2d39ca['status'](_0x39ce31)[_0x1126('0x1d')]();};}function respondWithResult(_0x1a84f6,_0x16b463){_0x16b463=_0x16b463||0xc8;return function(_0x5dbe86){if(_0x5dbe86){return _0x1a84f6['status'](_0x16b463)[_0x1126('0x1e')](_0x5dbe86);}};}function respondWithFilteredResult(_0x1cab76,_0x5f3eec){return function(_0x178bd1){if(_0x178bd1){var _0x52640b=typeof _0x5f3eec[_0x1126('0x1f')]==='undefined'&&typeof _0x5f3eec[_0x1126('0x20')]===_0x1126('0x21');var _0x37c994=_0x178bd1[_0x1126('0x22')];var _0x236b56=_0x52640b?0x0:_0x5f3eec[_0x1126('0x1f')];var _0x30f5ba=_0x52640b?_0x178bd1[_0x1126('0x22')]:_0x5f3eec[_0x1126('0x1f')]+_0x5f3eec[_0x1126('0x20')];var _0x6e2bbd;if(_0x30f5ba>=_0x37c994){_0x30f5ba=_0x37c994;_0x6e2bbd=0xc8;}else{_0x6e2bbd=0xce;}_0x1cab76[_0x1126('0x23')](_0x6e2bbd);return _0x1cab76['set']('Content-Range',_0x236b56+'-'+_0x30f5ba+'/'+_0x37c994)[_0x1126('0x1e')](_0x178bd1);}return null;};}function patchUpdates(_0x2acd14){return function(_0x426d97){try{jsonpatch[_0x1126('0x24')](_0x426d97,_0x2acd14,!![]);}catch(_0x1bf9e0){return BPromise[_0x1126('0x25')](_0x1bf9e0);}return _0x426d97[_0x1126('0x26')]();};}function saveUpdates(_0x3e13a1,_0x5e25d3){return function(_0x2d03b3){if(_0x2d03b3){return _0x2d03b3[_0x1126('0x27')](_0x3e13a1)['then'](function(_0x4c00d){return _0x4c00d;});}return null;};}function removeEntity(_0x2ff0d0,_0x32602f){return function(_0x5ea27e){if(_0x5ea27e){return _0x5ea27e[_0x1126('0x28')]()[_0x1126('0x29')](function(){var _0x20a39d=_0x5ea27e[_0x1126('0x2a')]({'plain':!![]});var _0x51f821=_0x1126('0x2b');return db['UserProfileResource'][_0x1126('0x28')]({'where':{'type':_0x51f821,'resourceId':_0x20a39d['id']}})['then'](function(){return _0x5ea27e;});})['then'](function(){_0x2ff0d0[_0x1126('0x23')](0xcc)[_0x1126('0x1d')]();});}};}function handleEntityNotFound(_0x4f18a0,_0xad0f84){return function(_0x39d615){if(!_0x39d615){_0x4f18a0[_0x1126('0x2c')](0x194);}return _0x39d615;};}function handleError(_0x327519,_0x99912d){_0x99912d=_0x99912d||0x1f4;return function(_0x73dc08){logger[_0x1126('0x2d')](_0x73dc08[_0x1126('0x2e')]);if(_0x73dc08['name']){delete _0x73dc08[_0x1126('0x2f')];}_0x327519[_0x1126('0x23')](_0x99912d)[_0x1126('0x30')](_0x73dc08);};}exports[_0x1126('0x31')]=function(_0x7769ce,_0x300d79){var _0x47ebe1={},_0x50a009={},_0x56c6a1={'count':0x0,'rows':[]};var _0x1b0294=_[_0x1126('0x32')](db['MailQueue'][_0x1126('0x33')],function(_0x3fcd44){return{'name':_0x3fcd44['fieldName'],'type':_0x3fcd44[_0x1126('0x34')][_0x1126('0x35')]};});_0x50a009[_0x1126('0x36')]=_[_0x1126('0x32')](_0x1b0294,_0x1126('0x2f'));_0x50a009[_0x1126('0x37')]=_[_0x1126('0x38')](_0x7769ce['query']);_0x50a009[_0x1126('0x39')]=_[_0x1126('0x3a')](_0x50a009[_0x1126('0x36')],_0x50a009['query']);_0x47ebe1[_0x1126('0x3b')]=_[_0x1126('0x3a')](_0x50a009[_0x1126('0x36')],qs[_0x1126('0x3c')](_0x7769ce['query'][_0x1126('0x3c')]));_0x47ebe1['attributes']=_0x47ebe1[_0x1126('0x3b')][_0x1126('0x3d')]?_0x47ebe1[_0x1126('0x3b')]:_0x50a009['model'];if(!_0x7769ce[_0x1126('0x37')][_0x1126('0x3e')](_0x1126('0x3f'))){_0x47ebe1[_0x1126('0x20')]=qs['limit'](_0x7769ce['query'][_0x1126('0x20')]);_0x47ebe1['offset']=qs[_0x1126('0x1f')](_0x7769ce['query'][_0x1126('0x1f')]);}_0x47ebe1[_0x1126('0x40')]=qs[_0x1126('0x41')](_0x7769ce[_0x1126('0x37')][_0x1126('0x41')]);_0x47ebe1[_0x1126('0x42')]=qs[_0x1126('0x39')](_['pick'](_0x7769ce['query'],_0x50a009[_0x1126('0x39')]),_0x1b0294);if(_0x7769ce[_0x1126('0x37')]['filter']){_0x47ebe1[_0x1126('0x42')]=_['merge'](_0x47ebe1[_0x1126('0x42')],{'$or':_[_0x1126('0x32')](_0x1b0294,function(_0x131655){if(_0x131655['type']!==_0x1126('0x43')){var _0x224f1d={};_0x224f1d[_0x131655['name']]={'$like':'%'+_0x7769ce[_0x1126('0x37')]['filter']+'%'};return _0x224f1d;}})});}_0x47ebe1=_[_0x1126('0x44')]({},_0x47ebe1,_0x7769ce['options']);var _0x49b6d3={'where':_0x47ebe1[_0x1126('0x42')]};return db[_0x1126('0x45')][_0x1126('0x22')](_0x49b6d3)['then'](function(_0x55fcea){_0x56c6a1['count']=_0x55fcea;if(_0x7769ce['query'][_0x1126('0x46')]){_0x47ebe1['include']=[{'all':!![]}];}return db[_0x1126('0x45')][_0x1126('0x47')](_0x47ebe1);})[_0x1126('0x29')](function(_0x3d9354){_0x56c6a1[_0x1126('0x48')]=_0x3d9354;return _0x56c6a1;})[_0x1126('0x29')](respondWithFilteredResult(_0x300d79,_0x47ebe1))['catch'](handleError(_0x300d79,null));};exports[_0x1126('0x49')]=function(_0x40385e,_0x2f5085){var _0x6f1524={'raw':!![],'where':{'id':_0x40385e[_0x1126('0x4a')]['id']}},_0x476815={};_0x476815[_0x1126('0x36')]=_[_0x1126('0x38')](db[_0x1126('0x45')][_0x1126('0x33')]);_0x476815[_0x1126('0x37')]=_['keys'](_0x40385e[_0x1126('0x37')]);_0x476815[_0x1126('0x39')]=_[_0x1126('0x3a')](_0x476815[_0x1126('0x36')],_0x476815[_0x1126('0x37')]);_0x6f1524['attributes']=_[_0x1126('0x3a')](_0x476815[_0x1126('0x36')],qs[_0x1126('0x3c')](_0x40385e[_0x1126('0x37')][_0x1126('0x3c')]));_0x6f1524[_0x1126('0x3b')]=_0x6f1524['attributes']['length']?_0x6f1524[_0x1126('0x3b')]:_0x476815[_0x1126('0x36')];if(_0x40385e[_0x1126('0x37')]['includeAll']){_0x6f1524[_0x1126('0x4b')]=[{'all':!![]}];}_0x6f1524=_[_0x1126('0x44')]({},_0x6f1524,_0x40385e[_0x1126('0x4c')]);return db['MailQueue']['find'](_0x6f1524)[_0x1126('0x29')](handleEntityNotFound(_0x2f5085,null))['then'](respondWithResult(_0x2f5085,null))[_0x1126('0x4d')](handleError(_0x2f5085,null));};exports['create']=function(_0x113e6f,_0x402d1c){return db[_0x1126('0x45')][_0x1126('0x4e')](_0x113e6f[_0x1126('0x4f')],{})[_0x1126('0x29')](function(_0x42cd6e){var _0x5ef272=_0x113e6f[_0x1126('0x50')]['get']({'plain':!![]});if(!_0x5ef272)throw new Error(_0x1126('0x51'));if(_0x5ef272[_0x1126('0x52')]===_0x1126('0x50')){var _0x950b39=_0x42cd6e[_0x1126('0x2a')]({'plain':!![]});var _0x55044b=_0x1126('0x2b');return db[_0x1126('0x53')][_0x1126('0x54')]({'where':{'name':_0x55044b,'userProfileId':_0x5ef272[_0x1126('0x55')]},'raw':!![]})[_0x1126('0x29')](function(_0x51be8b){if(_0x51be8b&&_0x51be8b[_0x1126('0x56')]===0x0){return db['UserProfileResource'][_0x1126('0x4e')]({'name':_0x950b39[_0x1126('0x2f')],'resourceId':_0x950b39['id'],'type':_0x51be8b[_0x1126('0x2f')],'sectionId':_0x51be8b['id']},{})[_0x1126('0x29')](function(){return _0x42cd6e;});}else{return _0x42cd6e;}})['catch'](function(_0x19ab52){logger[_0x1126('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19ab52);throw _0x19ab52;});}return _0x42cd6e;})[_0x1126('0x29')](respondWithResult(_0x402d1c,0xc9))[_0x1126('0x4d')](handleError(_0x402d1c,null));};exports[_0x1126('0x27')]=function(_0x2757f6,_0x3f1330){if(_0x2757f6[_0x1126('0x4f')]['id']){delete _0x2757f6[_0x1126('0x4f')]['id'];}return db['MailQueue'][_0x1126('0x54')]({'where':{'id':_0x2757f6['params']['id']}})['then'](handleEntityNotFound(_0x3f1330,null))['then'](saveUpdates(_0x2757f6[_0x1126('0x4f')],null))[_0x1126('0x29')](respondWithResult(_0x3f1330,null))['catch'](handleError(_0x3f1330,null));};exports[_0x1126('0x28')]=function(_0x50e46c,_0xcc22b0){return db['MailQueue'][_0x1126('0x54')]({'where':{'id':_0x50e46c[_0x1126('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcc22b0,null))[_0x1126('0x29')](removeEntity(_0xcc22b0,null))[_0x1126('0x4d')](handleError(_0xcc22b0,null));};exports[_0x1126('0x57')]=function(_0x57f5b2,_0x3a53da){return db[_0x1126('0x45')][_0x1126('0x57')]()['then'](respondWithResult(_0x3a53da,null))[_0x1126('0x4d')](handleError(_0x3a53da,null));};exports[_0x1126('0x58')]=function(_0x3dc469,_0x236129,_0x459ba2){var _0x4b23f9={'raw':!![],'where':{}},_0x429667={},_0x38e152;return db[_0x1126('0x45')][_0x1126('0x59')]({'where':{'id':_0x3dc469[_0x1126('0x4a')]['id']}})[_0x1126('0x29')](handleEntityNotFound(_0x236129,null))[_0x1126('0x29')](function(_0x23bcca){if(_0x23bcca){_0x38e152=_0x23bcca[_0x1126('0x2a')]({'plain':!![]});_0x429667[_0x1126('0x36')]=_[_0x1126('0x38')](db[_0x1126('0x5a')]['rawAttributes']);_0x429667[_0x1126('0x37')]=_['keys'](_0x3dc469['query']);_0x429667[_0x1126('0x39')]=_[_0x1126('0x3a')](_0x429667[_0x1126('0x36')],_0x429667[_0x1126('0x37')]);_0x4b23f9[_0x1126('0x3b')]=_[_0x1126('0x3a')](_0x429667[_0x1126('0x36')],qs['fields'](_0x3dc469[_0x1126('0x37')]['fields']));_0x4b23f9[_0x1126('0x3b')]=_0x4b23f9[_0x1126('0x3b')][_0x1126('0x3d')]?_0x4b23f9['attributes']:_0x429667[_0x1126('0x36')];if(!_0x3dc469[_0x1126('0x37')]['hasOwnProperty'](_0x1126('0x3f'))){_0x4b23f9['limit']=qs[_0x1126('0x20')](_0x3dc469[_0x1126('0x37')][_0x1126('0x20')]);_0x4b23f9['offset']=qs[_0x1126('0x1f')](_0x3dc469[_0x1126('0x37')]['offset']);}_0x4b23f9['order']=qs[_0x1126('0x41')](_0x3dc469[_0x1126('0x37')][_0x1126('0x41')]);_0x4b23f9['where']=qs[_0x1126('0x39')](_[_0x1126('0x5b')](_0x3dc469[_0x1126('0x37')],_0x429667[_0x1126('0x39')]));_0x4b23f9[_0x1126('0x42')][_0x1126('0x5c')]=_0x23bcca['id'];if(_0x3dc469[_0x1126('0x37')]['filter']){_0x4b23f9[_0x1126('0x42')]=_['merge'](_0x4b23f9[_0x1126('0x42')],{'$or':_[_0x1126('0x32')](_0x4b23f9[_0x1126('0x3b')],function(_0x100c02){var _0x5cc79c={};_0x5cc79c[_0x100c02]={'$like':'%'+_0x3dc469['query'][_0x1126('0x5d')]+'%'};return _0x5cc79c;})});}_0x4b23f9=_['merge']({},_0x4b23f9,_0x3dc469[_0x1126('0x4c')]);return db[_0x1126('0x5a')][_0x1126('0x47')](_0x4b23f9);}})[_0x1126('0x29')](function(_0x369899){if(_0x369899){return db[_0x1126('0x5e')]['findAndCountAll']({'where':{'id':_[_0x1126('0x32')](_0x369899,'UserId'),'role':_0x1126('0x5f')},'attributes':['id',_0x1126('0x2f'),'mailPause',_0x1126('0x60'),'createdAt']});}})[_0x1126('0x29')](function(_0x314467){if(_0x314467){return{'count':_0x314467['count'],'rows':_[_0x1126('0x32')](_0x314467[_0x1126('0x48')],function(_0x579482){return{'membername':_0x579482[_0x1126('0x2f')],'UserId':_0x579482['id'],'queue_name':_0x38e152[_0x1126('0x2f')],'MailQueueId':_0x38e152['id'],'interface':util['format'](_0x1126('0x61'),_0x1126('0x62'),_0x579482[_0x1126('0x2f')]),'penalty':0x0,'paused':_0x579482[_0x1126('0x63')],'createdAt':_0x579482[_0x1126('0x64')],'updatedAt':_0x579482[_0x1126('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1126('0x29')](respondWithFilteredResult(_0x236129,_0x4b23f9))[_0x1126('0x4d')](handleError(_0x236129,null));};exports['getTeams']=function(_0x1df4e4,_0x532a37,_0x2de3b7){var _0x11109f={};var _0x4dcb26={};var _0x3975a4;var _0x454abd;return db[_0x1126('0x45')]['findOne']({'where':{'id':_0x1df4e4[_0x1126('0x4a')]['id']}})[_0x1126('0x29')](handleEntityNotFound(_0x532a37,null))[_0x1126('0x29')](function(_0x11e9cb){if(_0x11e9cb){_0x3975a4=_0x11e9cb;_0x4dcb26[_0x1126('0x36')]=_[_0x1126('0x38')](db[_0x1126('0x65')][_0x1126('0x33')]);_0x4dcb26[_0x1126('0x37')]=_[_0x1126('0x38')](_0x1df4e4[_0x1126('0x37')]);_0x4dcb26[_0x1126('0x39')]=_['intersection'](_0x4dcb26[_0x1126('0x36')],_0x4dcb26[_0x1126('0x37')]);_0x11109f[_0x1126('0x3b')]=_[_0x1126('0x3a')](_0x4dcb26[_0x1126('0x36')],qs['fields'](_0x1df4e4[_0x1126('0x37')]['fields']));_0x11109f[_0x1126('0x3b')]=_0x11109f[_0x1126('0x3b')][_0x1126('0x3d')]?_0x11109f[_0x1126('0x3b')]:_0x4dcb26[_0x1126('0x36')];_0x11109f[_0x1126('0x40')]=qs[_0x1126('0x41')](_0x1df4e4[_0x1126('0x37')]['sort']);_0x11109f['where']=qs[_0x1126('0x39')](_[_0x1126('0x5b')](_0x1df4e4[_0x1126('0x37')],_0x4dcb26[_0x1126('0x39')]));if(_0x1df4e4['query'][_0x1126('0x5d')]){_0x11109f[_0x1126('0x42')]=_[_0x1126('0x44')](_0x11109f['where'],{'$or':_['map'](_0x11109f[_0x1126('0x3b')],function(_0x579acd){var _0x138b62={};_0x138b62[_0x579acd]={'$like':'%'+_0x1df4e4['query']['filter']+'%'};return _0x138b62;})});}_0x11109f=_['merge']({},_0x11109f,_0x1df4e4[_0x1126('0x4c')]);return _0x3975a4[_0x1126('0x66')](_0x11109f);}})['then'](function(_0xd0fd63){if(_0xd0fd63){_0x454abd=_0xd0fd63[_0x1126('0x3d')];if(!_0x1df4e4[_0x1126('0x37')][_0x1126('0x3e')](_0x1126('0x3f'))){_0x11109f['limit']=qs['limit'](_0x1df4e4['query'][_0x1126('0x20')]);_0x11109f[_0x1126('0x1f')]=qs[_0x1126('0x1f')](_0x1df4e4[_0x1126('0x37')][_0x1126('0x1f')]);}return _0x3975a4[_0x1126('0x66')](_0x11109f);}})[_0x1126('0x29')](function(_0x195520){if(_0x195520){return _0x195520?{'count':_0x454abd,'rows':_0x195520}:null;}})[_0x1126('0x29')](respondWithResult(_0x532a37,null))[_0x1126('0x4d')](handleError(_0x532a37,null));};exports[_0x1126('0x67')]=function(_0x3a7cad,_0x5b7b59,_0x5c882e){var _0x38b4a3=_0x3a7cad['body'][_0x1126('0x68')];return db['Team']['findAll']({'where':{'id':_0x38b4a3},'attributes':['id'],'include':[{'model':db[_0x1126('0x5e')],'as':'Agents','attributes':['id','name',_0x1126('0x69'),_0x1126('0x6a'),_0x1126('0x6b')],'raw':!![]}]})['then'](function(_0x48118b){if(_0x48118b){var _0x12ffdb=_['flatMap'](_0x48118b,function(_0x323f19){var _0x5aaf77=_0x323f19['get']({'plain':!![]});return _0x5aaf77['Agents'];});return db['MailQueue'][_0x1126('0x54')]({'where':{'id':_0x3a7cad['params']['id']}})[_0x1126('0x29')](function(_0x197760){return db[_0x1126('0x6c')][_0x1126('0x6d')](function(_0x50a4ba){return _0x197760[_0x1126('0x67')](_0x38b4a3,{'transaction':_0x50a4ba})['then'](function(){return BPromise[_0x1126('0x6e')](_0x12ffdb,function(_0x160c9c){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x160c9c['id'],'MailQueueId':_0x3a7cad[_0x1126('0x4a')]['id']},'transaction':_0x50a4ba});});})[_0x1126('0x29')](function(){_0x12ffdb[_0x1126('0x6f')](function(_0x2fa607){socket['emit'](_0x1126('0x70'),{'UserId':_0x2fa607['id'],'MailQueueId':_0x197760['id']});});});});});}})[_0x1126('0x29')](respondWithStatusCode(_0x5b7b59,null))['catch'](handleError(_0x5b7b59,null));};exports[_0x1126('0x71')]=function(_0x4336a5,_0x3af11c,_0x350557){return db[_0x1126('0x65')][_0x1126('0x47')]({'where':{'id':_0x4336a5['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1126('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3af11c,null))['then'](function(_0x23ec6d){var _0x5e5a34=_[_0x1126('0x32')](_0x23ec6d,'id');var _0xe25bcf=[];var _0xa8e05b=[];var _0xdab4d=squel[_0x1126('0x73')]();_0xdab4d[_0x1126('0x74')](_0x1126('0x75'))[_0x1126('0x76')](_0x1126('0x77'),'tq')[_0x1126('0x78')](_0x1126('0x79'),'ut',_0x1126('0x7a'))[_0x1126('0x42')](_0x1126('0x7b'),_0x4336a5[_0x1126('0x4a')]['id']);for(var _0x547b91=0x0;_0x547b91<_0x23ec6d[_0x1126('0x3d')];_0x547b91+=0x1){let _0x47b5d8=_0x23ec6d[_0x547b91];for(var _0x5a9abe=0x0;_0x5a9abe<_0x47b5d8[_0x1126('0x72')]['length'];_0x5a9abe+=0x1){let _0x3411ab=_0x47b5d8[_0x1126('0x72')][_0x5a9abe];var _0x3072c4=_0xdab4d[_0x1126('0x7c')]();_0x3072c4[_0x1126('0x42')]('ut.UserId\x20=\x20?',_0x3411ab['id']);_0xa8e05b['push'](db[_0x1126('0x6c')][_0x1126('0x37')](_0x3072c4[_0x1126('0x7d')](),{'type':db[_0x1126('0x6c')]['QueryTypes'][_0x1126('0x7e')]})['then'](function(_0x33ac16){if(_0x33ac16[_0x1126('0x3d')]===0x1){return _0x3411ab['id'];}else{var _0x3a3989=_[_0x1126('0x7f')](_[_0x1126('0x32')](_0x33ac16,_0x1126('0x80')),function(_0x2522b0){return _['includes'](_0x5e5a34,_0x2522b0);});if(_0x3a3989){return _0x3411ab['id'];}}}));}}return BPromise[_0x1126('0x81')](_0xa8e05b)[_0x1126('0x29')](function(_0x1578b6){_0xe25bcf=_(_0xe25bcf)[_0x1126('0x82')](_0x1578b6)[_0x1126('0x83')]()[_0x1126('0x84')]();return db[_0x1126('0x45')][_0x1126('0x54')]({'where':{'id':_0x4336a5['params']['id']}})[_0x1126('0x29')](function(_0xd3f7ac){return db[_0x1126('0x6c')][_0x1126('0x6d')](function(_0x2e4693){return _0xd3f7ac[_0x1126('0x71')](_0x4336a5[_0x1126('0x37')][_0x1126('0x68')],{'transaction':_0x2e4693})[_0x1126('0x29')](function(){if(!_[_0x1126('0x85')](_0xe25bcf)){return _0xd3f7ac[_0x1126('0x86')](_0xe25bcf,{'transaction':_0x2e4693});}})[_0x1126('0x29')](function(){_0xe25bcf['forEach'](function(_0x2648a6){socket['emit'](_0x1126('0x87'),{'UserId':_0x2648a6,'MailQueueId':_0xd3f7ac['id']});});});});});});})['then'](respondWithStatusCode(_0x3af11c,null))['catch'](handleError(_0x3af11c,null));};exports[_0x1126('0x88')]=function(_0x3c7b90,_0x353f86,_0xb4e7ad){return db[_0x1126('0x45')]['find']({'where':{'id':_0x3c7b90['params']['id']}})[_0x1126('0x29')](handleEntityNotFound(_0x353f86,null))['then'](function(_0x1dd343){if(_0x1dd343){return _0x1dd343[_0x1126('0x88')](_0x3c7b90[_0x1126('0x4f')][_0x1126('0x68')],_[_0x1126('0x89')](_0x3c7b90[_0x1126('0x4f')],[_0x1126('0x68'),'id'])||{})[_0x1126('0x8a')](function(_0x166ebd){for(var _0x3d7a4=0x0;_0x3d7a4<_0x3c7b90[_0x1126('0x4f')][_0x1126('0x68')]['length'];_0x3d7a4+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x3c7b90['body']['ids'][_0x3d7a4]),'MailQueueId':Number(_0x3c7b90['params']['id'])});}return _0x166ebd;});}})['then'](respondWithResult(_0x353f86,null))[_0x1126('0x4d')](handleError(_0x353f86,null));};exports['removeAgents']=function(_0x3e30c0,_0x510e85,_0x582652){return db['MailQueue']['find']({'where':{'id':_0x3e30c0[_0x1126('0x4a')]['id']}})[_0x1126('0x29')](handleEntityNotFound(_0x510e85,null))[_0x1126('0x29')](function(_0xf2342d){if(_0xf2342d){return _0xf2342d[_0x1126('0x86')](_0x3e30c0[_0x1126('0x37')][_0x1126('0x68')])[_0x1126('0x29')](function(){if(_[_0x1126('0x8b')](_0x3e30c0['query'][_0x1126('0x68')])){for(var _0x49750a=0x0;_0x49750a<_0x3e30c0[_0x1126('0x37')][_0x1126('0x68')][_0x1126('0x3d')];_0x49750a+=0x1){socket['emit'](_0x1126('0x87'),{'UserId':Number(_0x3e30c0[_0x1126('0x37')][_0x1126('0x68')][_0x49750a]),'MailQueueId':Number(_0x3e30c0[_0x1126('0x4a')]['id'])});}}else{socket[_0x1126('0x8c')](_0x1126('0x87'),{'UserId':Number(_0x3e30c0[_0x1126('0x37')][_0x1126('0x68')]),'MailQueueId':Number(_0x3e30c0[_0x1126('0x4a')]['id'])});}});}})[_0x1126('0x29')](respondWithStatusCode(_0x510e85,null))[_0x1126('0x4d')](handleError(_0x510e85,null));};exports[_0x1126('0x8d')]=function(_0x14eae4,_0x3b6e2a,_0x1598d5){var _0x3bbbc4={};var _0x29e56a={};var _0x3aa4b1;var _0x2c2871;return db[_0x1126('0x45')]['findOne']({'where':{'id':_0x14eae4[_0x1126('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b6e2a,null))['then'](function(_0xafaba8){if(_0xafaba8){_0x3aa4b1=_0xafaba8;_0x29e56a[_0x1126('0x36')]=_['keys'](db['User'][_0x1126('0x33')]);_0x29e56a['query']=_[_0x1126('0x38')](_0x14eae4['query']);_0x29e56a[_0x1126('0x39')]=_[_0x1126('0x3a')](_0x29e56a[_0x1126('0x36')],_0x29e56a[_0x1126('0x37')]);_0x3bbbc4[_0x1126('0x3b')]=_[_0x1126('0x3a')](_0x29e56a[_0x1126('0x36')],qs[_0x1126('0x3c')](_0x14eae4['query'][_0x1126('0x3c')]));_0x3bbbc4[_0x1126('0x3b')]=_0x3bbbc4[_0x1126('0x3b')][_0x1126('0x3d')]?_0x3bbbc4[_0x1126('0x3b')]:_0x29e56a['model'];_0x3bbbc4['order']=qs[_0x1126('0x41')](_0x14eae4['query']['sort']);_0x3bbbc4[_0x1126('0x42')]=qs[_0x1126('0x39')](_[_0x1126('0x5b')](_0x14eae4['query'],_0x29e56a[_0x1126('0x39')]));if(_0x14eae4[_0x1126('0x37')]['filter']){_0x3bbbc4[_0x1126('0x42')]=_[_0x1126('0x44')](_0x3bbbc4[_0x1126('0x42')],{'$or':_[_0x1126('0x32')](_0x3bbbc4[_0x1126('0x3b')],function(_0x24bc73){var _0x2bd7c7={};_0x2bd7c7[_0x24bc73]={'$like':'%'+_0x14eae4[_0x1126('0x37')][_0x1126('0x5d')]+'%'};return _0x2bd7c7;})});}_0x3bbbc4=_[_0x1126('0x44')]({},_0x3bbbc4,_0x14eae4[_0x1126('0x4c')]);return _0x3aa4b1[_0x1126('0x8d')](_0x3bbbc4);}})[_0x1126('0x29')](function(_0x1965d7){if(_0x1965d7){_0x2c2871=_0x1965d7[_0x1126('0x3d')];if(!_0x14eae4[_0x1126('0x37')][_0x1126('0x3e')](_0x1126('0x3f'))){_0x3bbbc4[_0x1126('0x20')]=qs['limit'](_0x14eae4[_0x1126('0x37')][_0x1126('0x20')]);_0x3bbbc4[_0x1126('0x1f')]=qs[_0x1126('0x1f')](_0x14eae4[_0x1126('0x37')][_0x1126('0x1f')]);}return _0x3aa4b1[_0x1126('0x8d')](_0x3bbbc4);}})['then'](function(_0x3b02e5){if(_0x3b02e5){return _0x3b02e5?{'count':_0x2c2871,'rows':_0x3b02e5}:null;}})[_0x1126('0x29')](respondWithResult(_0x3b6e2a,null))[_0x1126('0x4d')](handleError(_0x3b6e2a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 9255bf6..3cec316 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 _0x2dfe=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x1cda61,_0x34c664){var _0x20e7d0=function(_0x7b5a79){while(--_0x7b5a79){_0x1cda61['push'](_0x1cda61['shift']());}};_0x20e7d0(++_0x34c664);}(_0x2dfe,0x151));var _0xe2df=function(_0x38300c,_0x4618b9){_0x38300c=_0x38300c-0x0;var _0x591bf6=_0x2dfe[_0x38300c];return _0x591bf6;};'use strict';var EventEmitter=require(_0xe2df('0x0'));var MailQueue=require(_0xe2df('0x1'))['db'][_0xe2df('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe2df('0x3')](0x0);var events={'afterCreate':_0xe2df('0x4'),'afterUpdate':_0xe2df('0x5'),'afterDestroy':_0xe2df('0x6')};function emitEvent(_0x10c0bd){return function(_0x1fb532,_0x47757e,_0x1e21c5){MailQueueEvents['emit'](_0x10c0bd+':'+_0x1fb532['id'],_0x1fb532);MailQueueEvents[_0xe2df('0x7')](_0x10c0bd,_0x1fb532);_0x1e21c5(null);};}for(var e in events){if(events[_0xe2df('0x8')](e)){var event=events[e];MailQueue[_0xe2df('0x9')](e,emitEvent(event));}}module[_0xe2df('0xa')]=MailQueueEvents; \ No newline at end of file +var _0xc1c3=['MailQueue','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3a5bc0,_0x830b35){var _0xad3a6d=function(_0x16112c){while(--_0x16112c){_0x3a5bc0['push'](_0x3a5bc0['shift']());}};_0xad3a6d(++_0x830b35);}(_0xc1c3,0x142));var _0x3c1c=function(_0x23263f,_0xb04623){_0x23263f=_0x23263f-0x0;var _0x54fea6=_0xc1c3[_0x23263f];return _0x54fea6;};'use strict';var EventEmitter=require(_0x3c1c('0x0'));var MailQueue=require(_0x3c1c('0x1'))['db'][_0x3c1c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c1c('0x3'),'afterUpdate':_0x3c1c('0x4'),'afterDestroy':_0x3c1c('0x5')};function emitEvent(_0x1e419f){return function(_0x270be4,_0x5db95a,_0x525abf){MailQueueEvents[_0x3c1c('0x6')](_0x1e419f+':'+_0x270be4['id'],_0x270be4);MailQueueEvents['emit'](_0x1e419f,_0x270be4);_0x525abf(null);};}for(var e in events){if(events[_0x3c1c('0x7')](e)){var event=events[e];MailQueue[_0x3c1c('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index cbfc84e..9337c11 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 _0xd5af=['mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue'];(function(_0x4f2540,_0x10e19b){var _0x151dd6=function(_0x57c8ec){while(--_0x57c8ec){_0x4f2540['push'](_0x4f2540['shift']());}};_0x151dd6(++_0x10e19b);}(_0xd5af,0x135));var _0xfd5a=function(_0x57204f,_0x33039d){_0x57204f=_0x57204f-0x0;var _0xf7e51d=_0xd5af[_0x57204f];return _0xf7e51d;};'use strict';var _=require('lodash');var util=require(_0xfd5a('0x0'));var logger=require(_0xfd5a('0x1'))(_0xfd5a('0x2'));var moment=require(_0xfd5a('0x3'));var BPromise=require(_0xfd5a('0x4'));var rp=require(_0xfd5a('0x5'));var fs=require('fs');var path=require(_0xfd5a('0x6'));var rimraf=require(_0xfd5a('0x7'));var config=require(_0xfd5a('0x8'));var attributes=require(_0xfd5a('0x9'));module[_0xfd5a('0xa')]=function(_0xc596a5,_0x10a698){return _0xc596a5[_0xfd5a('0xb')](_0xfd5a('0xc'),attributes,{'tableName':_0xfd5a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf621=['../../config/environment','./mailQueue.attributes','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x350c87,_0x2b44ef){var _0x163800=function(_0xb99c9){while(--_0xb99c9){_0x350c87['push'](_0x350c87['shift']());}};_0x163800(++_0x2b44ef);}(_0xf621,0x88));var _0x1f62=function(_0x257017,_0x330627){_0x257017=_0x257017-0x0;var _0x38536d=_0xf621[_0x257017];return _0x38536d;};'use strict';var _=require(_0x1f62('0x0'));var util=require(_0x1f62('0x1'));var logger=require(_0x1f62('0x2'))(_0x1f62('0x3'));var moment=require(_0x1f62('0x4'));var BPromise=require(_0x1f62('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f62('0x6'));var rimraf=require(_0x1f62('0x7'));var config=require(_0x1f62('0x8'));var attributes=require(_0x1f62('0x9'));module['exports']=function(_0xe1081,_0x4af5a9){return _0xe1081[_0x1f62('0xa')](_0x1f62('0xb'),attributes,{'tableName':'mail_queues','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 b861115..04e839a 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 _0x1601=['model','catch','ShowMailQueue','find','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message','result','GetMailQueue','MailQueue','options','raw','where','limit','include','map','attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1601,0x151));var _0x1160=function(_0x280587,_0x4e9971){_0x280587=_0x280587-0x0;var _0x3b7543=_0x1601[_0x280587];return _0x3b7543;};'use strict';var _=require('lodash');var util=require(_0x1160('0x0'));var moment=require('moment');var BPromise=require(_0x1160('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1160('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1160('0x3'))(_0x1160('0x4'));var config=require(_0x1160('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1160('0x6')]({'port':0x232a});config[_0x1160('0x7')]=_[_0x1160('0x8')](config['redis'],{'host':_0x1160('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1160('0x7')]));require(_0x1160('0xa'))[_0x1160('0xb')](socket);function respondWithRpcPromise(_0x35fbfe,_0x536fbe,_0x39da44){return new BPromise(function(_0x14d24f,_0x9872a5){return client[_0x1160('0xc')](_0x35fbfe,_0x39da44)[_0x1160('0xd')](function(_0x4f41bf){logger[_0x1160('0xe')]('MailQueue,\x20%s,\x20%s',_0x536fbe,_0x1160('0xf'));logger[_0x1160('0x10')](_0x1160('0x11'),_0x536fbe,_0x1160('0xf'),JSON[_0x1160('0x12')](_0x4f41bf));if(_0x4f41bf['error']){if(_0x4f41bf[_0x1160('0x13')][_0x1160('0x14')]===0x1f4){logger[_0x1160('0x13')](_0x1160('0x15'),_0x536fbe,_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);return _0x9872a5(_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);}logger[_0x1160('0x13')](_0x1160('0x15'),_0x536fbe,_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);return _0x14d24f(_0x4f41bf[_0x1160('0x13')][_0x1160('0x16')]);}else{logger[_0x1160('0xe')](_0x1160('0x15'),_0x536fbe,_0x1160('0xf'));_0x14d24f(_0x4f41bf[_0x1160('0x17')]['message']);}})['catch'](function(_0x221b5d){logger['error']('MailQueue,\x20%s,\x20%s',_0x536fbe,_0x221b5d);_0x9872a5(_0x221b5d);});});}exports[_0x1160('0x18')]=function(_0x7efc43){var _0xe7bfcb=this;return new Promise(function(_0x3c1ce9,_0x4abddd){return db[_0x1160('0x19')]['findAll']({'raw':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1b')]===undefined?!![]:![]:!![],'where':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1c')]||null:null,'attributes':_0x7efc43['options']?_0x7efc43[_0x1160('0x1a')]['attributes']||null:null,'limit':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1d')]||null:null,'include':_0x7efc43[_0x1160('0x1a')]?_0x7efc43[_0x1160('0x1a')][_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x7efc43[_0x1160('0x1a')][_0x1160('0x1e')],function(_0x52d053){return{'model':db[_0x52d053['model']],'as':_0x52d053['as'],'attributes':_0x52d053[_0x1160('0x20')],'include':_0x52d053[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x52d053[_0x1160('0x1e')],function(_0x532a43){return{'model':db[_0x532a43[_0x1160('0x21')]],'as':_0x532a43['as'],'attributes':_0x532a43[_0x1160('0x20')],'include':_0x532a43['include']?_[_0x1160('0x1f')](_0x532a43[_0x1160('0x1e')],function(_0x1d45b1){return{'model':db[_0x1d45b1[_0x1160('0x21')]],'as':_0x1d45b1['as'],'attributes':_0x1d45b1[_0x1160('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cde09){logger[_0x1160('0xe')](_0x1160('0x18'),_0x7efc43);logger[_0x1160('0x10')]('GetMailQueue',_0x7efc43,JSON[_0x1160('0x12')](_0x3cde09));_0x3c1ce9(_0x3cde09);})[_0x1160('0x22')](function(_0x5609d0){logger[_0x1160('0x13')]('GetMailQueue',_0x5609d0['message'],_0x7efc43);_0x4abddd(_0xe7bfcb[_0x1160('0x13')](0x1f4,_0x5609d0[_0x1160('0x16')]));});});};exports[_0x1160('0x23')]=function(_0x319196){var _0x4ab8e4=this;return new Promise(function(_0x44d8c8,_0xdff5a3){return db['MailQueue'][_0x1160('0x24')]({'raw':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1b')]===undefined?!![]:![]:!![],'where':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1c')]||null:null,'attributes':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')]['attributes']||null:null,'include':_0x319196[_0x1160('0x1a')]?_0x319196[_0x1160('0x1a')][_0x1160('0x1e')]?_['map'](_0x319196[_0x1160('0x1a')][_0x1160('0x1e')],function(_0x595015){return{'model':db[_0x595015[_0x1160('0x21')]],'as':_0x595015['as'],'attributes':_0x595015['attributes'],'include':_0x595015[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x595015['include'],function(_0x36fc9c){return{'model':db[_0x36fc9c[_0x1160('0x21')]],'as':_0x36fc9c['as'],'attributes':_0x36fc9c[_0x1160('0x20')],'include':_0x36fc9c[_0x1160('0x1e')]?_[_0x1160('0x1f')](_0x36fc9c[_0x1160('0x1e')],function(_0x203531){return{'model':db[_0x203531['model']],'as':_0x203531['as'],'attributes':_0x203531[_0x1160('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1160('0xd')](function(_0x1a05f9){logger[_0x1160('0xe')](_0x1160('0x23'),_0x319196);logger[_0x1160('0x10')](_0x1160('0x23'),_0x319196,JSON[_0x1160('0x12')](_0x1a05f9));_0x44d8c8(_0x1a05f9);})['catch'](function(_0xaafdbe){logger['error']('ShowMailQueue',_0xaafdbe[_0x1160('0x16')],_0x319196);_0xdff5a3(_0x4ab8e4[_0x1160('0x13')](0x1f4,_0xaafdbe[_0x1160('0x16')]));});});}; \ No newline at end of file +var _0x2e31=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','attributes','include','map','model','GetMailQueue','ShowMailQueue','MailQueue','find','where','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x584f9e,_0x11d9c7){var _0x29d129=function(_0x2620ad){while(--_0x2620ad){_0x584f9e['push'](_0x584f9e['shift']());}};_0x29d129(++_0x11d9c7);}(_0x2e31,0x145));var _0x12e3=function(_0x215a89,_0xfddaf7){_0x215a89=_0x215a89-0x0;var _0xb8c79e=_0x2e31[_0x215a89];return _0xb8c79e;};'use strict';var _=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));var moment=require(_0x12e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x12e3('0x3'));var fs=require('fs');var Redis=require(_0x12e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12e3('0x5'))(_0x12e3('0x6'));var config=require(_0x12e3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12e3('0x8')][_0x12e3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x12e3('0xa')],{'host':_0x12e3('0xb'),'port':0x18eb});var socket=require(_0x12e3('0xc'))(new Redis(config[_0x12e3('0xa')]));require('./mailQueue.socket')[_0x12e3('0xd')](socket);function respondWithRpcPromise(_0x3ec880,_0x40bf58,_0x5208d6){return new BPromise(function(_0x5901b3,_0x3e7283){return client[_0x12e3('0xe')](_0x3ec880,_0x5208d6)[_0x12e3('0xf')](function(_0x3d6c3c){logger[_0x12e3('0x10')](_0x12e3('0x11'),_0x40bf58,_0x12e3('0x12'));logger[_0x12e3('0x13')](_0x12e3('0x14'),_0x40bf58,_0x12e3('0x12'),JSON[_0x12e3('0x15')](_0x3d6c3c));if(_0x3d6c3c[_0x12e3('0x16')]){if(_0x3d6c3c['error'][_0x12e3('0x17')]===0x1f4){logger[_0x12e3('0x16')](_0x12e3('0x11'),_0x40bf58,_0x3d6c3c['error'][_0x12e3('0x18')]);return _0x3e7283(_0x3d6c3c[_0x12e3('0x16')]['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x40bf58,_0x3d6c3c[_0x12e3('0x16')]['message']);return _0x5901b3(_0x3d6c3c[_0x12e3('0x16')][_0x12e3('0x18')]);}else{logger[_0x12e3('0x10')](_0x12e3('0x11'),_0x40bf58,_0x12e3('0x12'));_0x5901b3(_0x3d6c3c[_0x12e3('0x19')]['message']);}})[_0x12e3('0x1a')](function(_0x199e1d){logger['error']('MailQueue,\x20%s,\x20%s',_0x40bf58,_0x199e1d);_0x3e7283(_0x199e1d);});});}exports['GetMailQueue']=function(_0x2e5f1a){var _0x577b74=this;return new Promise(function(_0x3db972,_0x2ddfbf){return db['MailQueue']['findAll']({'raw':_0x2e5f1a[_0x12e3('0x1b')]?_0x2e5f1a[_0x12e3('0x1b')][_0x12e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e5f1a[_0x12e3('0x1b')]?_0x2e5f1a['options']['where']||null:null,'attributes':_0x2e5f1a[_0x12e3('0x1b')]?_0x2e5f1a[_0x12e3('0x1b')][_0x12e3('0x1d')]||null:null,'limit':_0x2e5f1a[_0x12e3('0x1b')]?_0x2e5f1a[_0x12e3('0x1b')]['limit']||null:null,'include':_0x2e5f1a[_0x12e3('0x1b')]?_0x2e5f1a[_0x12e3('0x1b')][_0x12e3('0x1e')]?_[_0x12e3('0x1f')](_0x2e5f1a[_0x12e3('0x1b')][_0x12e3('0x1e')],function(_0x578681){return{'model':db[_0x578681[_0x12e3('0x20')]],'as':_0x578681['as'],'attributes':_0x578681[_0x12e3('0x1d')],'include':_0x578681[_0x12e3('0x1e')]?_[_0x12e3('0x1f')](_0x578681['include'],function(_0x1609ea){return{'model':db[_0x1609ea[_0x12e3('0x20')]],'as':_0x1609ea['as'],'attributes':_0x1609ea[_0x12e3('0x1d')],'include':_0x1609ea['include']?_[_0x12e3('0x1f')](_0x1609ea[_0x12e3('0x1e')],function(_0x329d32){return{'model':db[_0x329d32[_0x12e3('0x20')]],'as':_0x329d32['as'],'attributes':_0x329d32['attributes']};}):[]};}):[]};}):[]:[]})[_0x12e3('0xf')](function(_0x2859d2){logger[_0x12e3('0x10')]('GetMailQueue',_0x2e5f1a);logger[_0x12e3('0x13')]('GetMailQueue',_0x2e5f1a,JSON[_0x12e3('0x15')](_0x2859d2));_0x3db972(_0x2859d2);})[_0x12e3('0x1a')](function(_0x286676){logger[_0x12e3('0x16')](_0x12e3('0x21'),_0x286676[_0x12e3('0x18')],_0x2e5f1a);_0x2ddfbf(_0x577b74['error'](0x1f4,_0x286676[_0x12e3('0x18')]));});});};exports[_0x12e3('0x22')]=function(_0x5d731c){var _0xf4647c=this;return new Promise(function(_0x4212cc,_0x4929f9){return db[_0x12e3('0x23')][_0x12e3('0x24')]({'raw':_0x5d731c['options']?_0x5d731c[_0x12e3('0x1b')][_0x12e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d731c[_0x12e3('0x1b')]?_0x5d731c['options'][_0x12e3('0x25')]||null:null,'attributes':_0x5d731c[_0x12e3('0x1b')]?_0x5d731c[_0x12e3('0x1b')][_0x12e3('0x1d')]||null:null,'include':_0x5d731c[_0x12e3('0x1b')]?_0x5d731c[_0x12e3('0x1b')][_0x12e3('0x1e')]?_[_0x12e3('0x1f')](_0x5d731c[_0x12e3('0x1b')][_0x12e3('0x1e')],function(_0x19d331){return{'model':db[_0x19d331[_0x12e3('0x20')]],'as':_0x19d331['as'],'attributes':_0x19d331[_0x12e3('0x1d')],'include':_0x19d331['include']?_[_0x12e3('0x1f')](_0x19d331['include'],function(_0xbdde8a){return{'model':db[_0xbdde8a['model']],'as':_0xbdde8a['as'],'attributes':_0xbdde8a[_0x12e3('0x1d')],'include':_0xbdde8a[_0x12e3('0x1e')]?_['map'](_0xbdde8a[_0x12e3('0x1e')],function(_0x31910f){return{'model':db[_0x31910f['model']],'as':_0x31910f['as'],'attributes':_0x31910f[_0x12e3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x12e3('0xf')](function(_0x1f1ed3){logger['info'](_0x12e3('0x22'),_0x5d731c);logger[_0x12e3('0x13')](_0x12e3('0x22'),_0x5d731c,JSON['stringify'](_0x1f1ed3));_0x4212cc(_0x1f1ed3);})[_0x12e3('0x1a')](function(_0x4d6bdd){logger['error'](_0x12e3('0x22'),_0x4d6bdd[_0x12e3('0x18')],_0x5d731c);_0x4929f9(_0xf4647c[_0x12e3('0x16')](0x1f4,_0x4d6bdd['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 72ea28b..80b970c 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 _0x0e89=['./mailQueue.events','remove','emit','removeListener','register','length','mailQueue:'];(function(_0x43df12,_0xef698){var _0x44f2a9=function(_0x77f02a){while(--_0x77f02a){_0x43df12['push'](_0x43df12['shift']());}};_0x44f2a9(++_0xef698);}(_0x0e89,0x69));var _0x90e8=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x0e89[_0x40220a];return _0x3903cc;};'use strict';var MailQueueEvents=require(_0x90e8('0x0'));var events=['save',_0x90e8('0x1'),'update'];function createListener(_0x15851,_0x203797){return function(_0x15c6d8){_0x203797[_0x90e8('0x2')](_0x15851,_0x15c6d8);};}function removeListener(_0x51330c,_0x4809af){return function(){MailQueueEvents[_0x90e8('0x3')](_0x51330c,_0x4809af);};}exports[_0x90e8('0x4')]=function(_0x5e609d){for(var _0x55cb57=0x0,_0x2c0813=events[_0x90e8('0x5')];_0x55cb57<_0x2c0813;_0x55cb57++){var _0x47a2e7=events[_0x55cb57];var _0x165d7e=createListener(_0x90e8('0x6')+_0x47a2e7,_0x5e609d);MailQueueEvents['on'](_0x47a2e7,_0x165d7e);}}; \ No newline at end of file +var _0x4708=['register','length','./mailQueue.events','save','removeListener'];(function(_0x72c219,_0xb5b8e6){var _0xf3f820=function(_0x182292){while(--_0x182292){_0x72c219['push'](_0x72c219['shift']());}};_0xf3f820(++_0xb5b8e6);}(_0x4708,0xa7));var _0x8470=function(_0xc0f0ab,_0x40105a){_0xc0f0ab=_0xc0f0ab-0x0;var _0x5793e4=_0x4708[_0xc0f0ab];return _0x5793e4;};'use strict';var MailQueueEvents=require(_0x8470('0x0'));var events=[_0x8470('0x1'),'remove','update'];function createListener(_0x5232fd,_0x98d703){return function(_0x945cd0){_0x98d703['emit'](_0x5232fd,_0x945cd0);};}function removeListener(_0x29d013,_0x214e6c){return function(){MailQueueEvents[_0x8470('0x2')](_0x29d013,_0x214e6c);};}exports[_0x8470('0x3')]=function(_0x310710){for(var _0x45206e=0x0,_0x35934b=events[_0x8470('0x4')];_0x45206e<_0x35934b;_0x45206e++){var _0x29fa35=events[_0x45206e];var _0xe4f518=createListener('mailQueue:'+_0x29fa35,_0x310710);MailQueueEvents['on'](_0x29fa35,_0xe4f518);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ba07525..81233c3 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 _0x1146=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x27055c,_0x180848){var _0x46723f=function(_0x17aa27){while(--_0x17aa27){_0x27055c['push'](_0x27055c['shift']());}};_0x46723f(++_0x180848);}(_0x1146,0xc0));var _0x6114=function(_0x2c45d7,_0x5ce0f5){_0x2c45d7=_0x2c45d7-0x0;var _0x8c322c=_0x1146[_0x2c45d7];return _0x8c322c;};'use strict';var multer=require(_0x6114('0x0'));var util=require(_0x6114('0x1'));var path=require(_0x6114('0x2'));var timeout=require(_0x6114('0x3'));var express=require(_0x6114('0x4'));var router=express[_0x6114('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6114('0x6'));var config=require(_0x6114('0x7'));var controller=require('./mailQueueReport.controller');router[_0x6114('0x8')]('/',auth[_0x6114('0x9')](),controller[_0x6114('0xa')]);router[_0x6114('0x8')]('/describe',auth[_0x6114('0x9')](),controller['describe']);router['get']('/:id',auth[_0x6114('0x9')](),controller[_0x6114('0xb')]);router[_0x6114('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6114('0xd')](_0x6114('0xe'),auth[_0x6114('0x9')](),controller[_0x6114('0xf')]);router[_0x6114('0x10')](_0x6114('0xe'),auth['isAuthenticated'](),controller[_0x6114('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4222=['post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','/describe','isAuthenticated','/:id'];(function(_0x2b0163,_0x1cc981){var _0x2da9fb=function(_0x1b5b01){while(--_0x1b5b01){_0x2b0163['push'](_0x2b0163['shift']());}};_0x2da9fb(++_0x1cc981);}(_0x4222,0x1d2));var _0x2422=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4222[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x2422('0x0'));var util=require(_0x2422('0x1'));var path=require(_0x2422('0x2'));var timeout=require('connect-timeout');var express=require(_0x2422('0x3'));var router=express[_0x2422('0x4')]();var fs_extra=require(_0x2422('0x5'));var auth=require(_0x2422('0x6'));var interaction=require(_0x2422('0x7'));var config=require(_0x2422('0x8'));var controller=require(_0x2422('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2422('0xa')](_0x2422('0xb'),auth[_0x2422('0xc')](),controller['describe']);router[_0x2422('0xa')](_0x2422('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x2422('0xe')]('/',auth[_0x2422('0xc')](),controller[_0x2422('0xf')]);router[_0x2422('0x10')]('/:id',auth[_0x2422('0xc')](),controller['update']);router[_0x2422('0x11')](_0x2422('0xd'),auth[_0x2422('0xc')](),controller[_0x2422('0x12')]);module[_0x2422('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f1ed489..3a2d0b7 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 _0xc2e1=['DATE','exports','STRING'];(function(_0x5e877c,_0x3dbeaa){var _0xf35faa=function(_0x552c7f){while(--_0x552c7f){_0x5e877c['push'](_0x5e877c['shift']());}};_0xf35faa(++_0x3dbeaa);}(_0xc2e1,0x1f3));var _0x1c2e=function(_0x205eca,_0x138c20){_0x205eca=_0x205eca-0x0;var _0x193e81=_0xc2e1[_0x205eca];return _0x193e81;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1c2e('0x0')]={'uniqueid':{'type':Sequelize[_0x1c2e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1c2e('0x2')]},'leaveAt':{'type':Sequelize[_0x1c2e('0x2')]},'acceptAt':{'type':Sequelize[_0x1c2e('0x2')]},'exitAt':{'type':Sequelize[_0x1c2e('0x2')]},'reason':{'type':Sequelize[_0x1c2e('0x1')]}}; \ No newline at end of file +var _0xcab7=['DATE','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcab7,0x163));var _0x7cab=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0xcab7[_0x573c9e];return _0x5d0714;};'use strict';var moment=require(_0x7cab('0x0'));var Sequelize=require(_0x7cab('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7cab('0x2')]},'leaveAt':{'type':Sequelize[_0x7cab('0x2')]},'acceptAt':{'type':Sequelize[_0x7cab('0x2')]},'exitAt':{'type':Sequelize[_0x7cab('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index cb83851..6772b08 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 _0x627e=['limit','count','set','reject','save','then','destroy','error','stack','name','index','MailQueueReport','fieldName','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','rows','catch','params','fields','length','includeAll','include','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x46da23,_0x134106){var _0x23f887=function(_0x3d5e17){while(--_0x3d5e17){_0x46da23['push'](_0x46da23['shift']());}};_0x23f887(++_0x134106);}(_0x627e,0x14a));var _0xe627=function(_0x22c320,_0xe5aa59){_0x22c320=_0x22c320-0x0;var _0xe36876=_0x627e[_0x22c320];return _0xe36876;};'use strict';var emlformat=require(_0xe627('0x0'));var rimraf=require(_0xe627('0x1'));var zipdir=require(_0xe627('0x2'));var jsonpatch=require(_0xe627('0x3'));var rp=require(_0xe627('0x4'));var moment=require('moment');var BPromise=require(_0xe627('0x5'));var Mustache=require(_0xe627('0x6'));var util=require(_0xe627('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe627('0x8'));var fs=require('fs');var fs_extra=require(_0xe627('0x9'));var _=require(_0xe627('0xa'));var squel=require(_0xe627('0xb'));var crypto=require(_0xe627('0xc'));var jsforce=require(_0xe627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe627('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe627('0xf'));var authService=require(_0xe627('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe627('0x11'));var logger=require(_0xe627('0x12'))(_0xe627('0x13'));var utils=require(_0xe627('0x14'));var config=require(_0xe627('0x15'));var licenseUtil=require(_0xe627('0x16'));var db=require(_0xe627('0x17'))['db'];function respondWithStatusCode(_0x3919be,_0x1922f5){_0x1922f5=_0x1922f5||0xcc;return function(_0x582190){if(_0x582190){return _0x3919be[_0xe627('0x18')](_0x1922f5);}return _0x3919be[_0xe627('0x19')](_0x1922f5)[_0xe627('0x1a')]();};}function respondWithResult(_0x4be370,_0x42dd1c){_0x42dd1c=_0x42dd1c||0xc8;return function(_0x1e2e62){if(_0x1e2e62){return _0x4be370[_0xe627('0x19')](_0x42dd1c)[_0xe627('0x1b')](_0x1e2e62);}};}function respondWithFilteredResult(_0x62896f,_0x6a9a15){return function(_0x271325){if(_0x271325){var _0x54720a=typeof _0x6a9a15[_0xe627('0x1c')]===_0xe627('0x1d')&&typeof _0x6a9a15[_0xe627('0x1e')]===_0xe627('0x1d');var _0x403982=_0x271325[_0xe627('0x1f')];var _0x56559b=_0x54720a?0x0:_0x6a9a15[_0xe627('0x1c')];var _0x538b22=_0x54720a?_0x271325[_0xe627('0x1f')]:_0x6a9a15['offset']+_0x6a9a15[_0xe627('0x1e')];var _0x565213;if(_0x538b22>=_0x403982){_0x538b22=_0x403982;_0x565213=0xc8;}else{_0x565213=0xce;}_0x62896f['status'](_0x565213);return _0x62896f[_0xe627('0x20')]('Content-Range',_0x56559b+'-'+_0x538b22+'/'+_0x403982)[_0xe627('0x1b')](_0x271325);}return null;};}function patchUpdates(_0x3391ce){return function(_0x4adde7){try{jsonpatch['apply'](_0x4adde7,_0x3391ce,!![]);}catch(_0x4ecfa6){return BPromise[_0xe627('0x21')](_0x4ecfa6);}return _0x4adde7[_0xe627('0x22')]();};}function saveUpdates(_0x4e3338,_0x708a8a){return function(_0x33cb27){if(_0x33cb27){return _0x33cb27['update'](_0x4e3338)[_0xe627('0x23')](function(_0x29221b){return _0x29221b;});}return null;};}function removeEntity(_0x52d492,_0x42f3d1){return function(_0x19adbc){if(_0x19adbc){return _0x19adbc[_0xe627('0x24')]()['then'](function(){_0x52d492[_0xe627('0x19')](0xcc)[_0xe627('0x1a')]();});}};}function handleEntityNotFound(_0x1a5081,_0x3ddd8d){return function(_0x4b9ff9){if(!_0x4b9ff9){_0x1a5081[_0xe627('0x18')](0x194);}return _0x4b9ff9;};}function handleError(_0x1fe192,_0x1635a0){_0x1635a0=_0x1635a0||0x1f4;return function(_0x29eb8e){logger[_0xe627('0x25')](_0x29eb8e[_0xe627('0x26')]);if(_0x29eb8e[_0xe627('0x27')]){delete _0x29eb8e[_0xe627('0x27')];}_0x1fe192[_0xe627('0x19')](_0x1635a0)['send'](_0x29eb8e);};}exports[_0xe627('0x28')]=function(_0x5aeba1,_0x5cd7c8){var _0x1e0bd7={},_0xdf63c8={},_0x5799a3={'count':0x0,'rows':[]};var _0x39c23f=_['map'](db[_0xe627('0x29')]['rawAttributes'],function(_0x262253){return{'name':_0x262253[_0xe627('0x2a')],'type':_0x262253['type'][_0xe627('0x2b')]};});_0xdf63c8['model']=_[_0xe627('0x2c')](_0x39c23f,_0xe627('0x27'));_0xdf63c8[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x5aeba1[_0xe627('0x2d')]);_0xdf63c8[_0xe627('0x2f')]=_[_0xe627('0x30')](_0xdf63c8[_0xe627('0x31')],_0xdf63c8[_0xe627('0x2d')]);_0x1e0bd7[_0xe627('0x32')]=_[_0xe627('0x30')](_0xdf63c8['model'],qs['fields'](_0x5aeba1[_0xe627('0x2d')]['fields']));_0x1e0bd7[_0xe627('0x32')]=_0x1e0bd7['attributes']['length']?_0x1e0bd7[_0xe627('0x32')]:_0xdf63c8['model'];if(!_0x5aeba1['query'][_0xe627('0x33')](_0xe627('0x34'))){_0x1e0bd7[_0xe627('0x1e')]=qs['limit'](_0x5aeba1['query']['limit']);_0x1e0bd7[_0xe627('0x1c')]=qs['offset'](_0x5aeba1[_0xe627('0x2d')][_0xe627('0x1c')]);}_0x1e0bd7['order']=qs[_0xe627('0x35')](_0x5aeba1[_0xe627('0x2d')]['sort']);_0x1e0bd7[_0xe627('0x36')]=qs[_0xe627('0x2f')](_[_0xe627('0x37')](_0x5aeba1[_0xe627('0x2d')],_0xdf63c8[_0xe627('0x2f')]),_0x39c23f);if(_0x5aeba1[_0xe627('0x2d')]['filter']){_0x1e0bd7[_0xe627('0x36')]=_['merge'](_0x1e0bd7[_0xe627('0x36')],{'$or':_['map'](_0x39c23f,function(_0xe90eda){if(_0xe90eda[_0xe627('0x38')]!==_0xe627('0x39')){var _0x21a533={};_0x21a533[_0xe90eda[_0xe627('0x27')]]={'$like':'%'+_0x5aeba1[_0xe627('0x2d')][_0xe627('0x3a')]+'%'};return _0x21a533;}})});}_0x1e0bd7=_[_0xe627('0x3b')]({},_0x1e0bd7,_0x5aeba1[_0xe627('0x3c')]);var _0x415a25={'where':_0x1e0bd7[_0xe627('0x36')]};return db[_0xe627('0x29')][_0xe627('0x1f')](_0x415a25)['then'](function(_0x4ddff5){_0x5799a3['count']=_0x4ddff5;if(_0x5aeba1['query']['includeAll']){_0x1e0bd7['include']=[{'all':!![]}];}return db[_0xe627('0x29')]['findAll'](_0x1e0bd7);})[_0xe627('0x23')](function(_0x59cd6a){_0x5799a3[_0xe627('0x3d')]=_0x59cd6a;return _0x5799a3;})[_0xe627('0x23')](respondWithFilteredResult(_0x5cd7c8,_0x1e0bd7))[_0xe627('0x3e')](handleError(_0x5cd7c8,null));};exports['show']=function(_0x58e110,_0x26064c){var _0x5f3374={'raw':!![],'where':{'id':_0x58e110[_0xe627('0x3f')]['id']}},_0x5e352e={};_0x5e352e['model']=_[_0xe627('0x2e')](db['MailQueueReport']['rawAttributes']);_0x5e352e[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x58e110[_0xe627('0x2d')]);_0x5e352e['filters']=_['intersection'](_0x5e352e[_0xe627('0x31')],_0x5e352e['query']);_0x5f3374['attributes']=_[_0xe627('0x30')](_0x5e352e[_0xe627('0x31')],qs[_0xe627('0x40')](_0x58e110[_0xe627('0x2d')][_0xe627('0x40')]));_0x5f3374[_0xe627('0x32')]=_0x5f3374['attributes'][_0xe627('0x41')]?_0x5f3374[_0xe627('0x32')]:_0x5e352e['model'];if(_0x58e110['query'][_0xe627('0x42')]){_0x5f3374[_0xe627('0x43')]=[{'all':!![]}];}_0x5f3374=_[_0xe627('0x3b')]({},_0x5f3374,_0x58e110[_0xe627('0x3c')]);return db[_0xe627('0x29')][_0xe627('0x44')](_0x5f3374)[_0xe627('0x23')](handleEntityNotFound(_0x26064c,null))['then'](respondWithResult(_0x26064c,null))[_0xe627('0x3e')](handleError(_0x26064c,null));};exports['create']=function(_0x648456,_0xcd19f5){return db[_0xe627('0x29')]['create'](_0x648456[_0xe627('0x45')],{})['then'](respondWithResult(_0xcd19f5,0xc9))[_0xe627('0x3e')](handleError(_0xcd19f5,null));};exports[_0xe627('0x46')]=function(_0x375e05,_0x30e057){if(_0x375e05[_0xe627('0x45')]['id']){delete _0x375e05['body']['id'];}return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x375e05[_0xe627('0x3f')]['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x30e057,null))[_0xe627('0x23')](saveUpdates(_0x375e05[_0xe627('0x45')],null))[_0xe627('0x23')](respondWithResult(_0x30e057,null))[_0xe627('0x3e')](handleError(_0x30e057,null));};exports[_0xe627('0x24')]=function(_0x3824da,_0x550b74){return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x3824da['params']['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x550b74,null))[_0xe627('0x23')](removeEntity(_0x550b74,null))['catch'](handleError(_0x550b74,null));};exports[_0xe627('0x47')]=function(_0x3a827e,_0x542a4c){return db[_0xe627('0x29')][_0xe627('0x47')]()['then'](respondWithResult(_0x542a4c,null))[_0xe627('0x3e')](handleError(_0x542a4c,null));}; \ No newline at end of file +var _0x8e3f=['save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','MailQueueReport','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ae02,_0x41f85e){_0x41f85e=_0x41f85e||0xcc;return function(_0x336790){if(_0x336790){return _0x40ae02[_0xf8e3('0x1a')](_0x41f85e);}return _0x40ae02['status'](_0x41f85e)[_0xf8e3('0x1b')]();};}function respondWithResult(_0xa856f5,_0x2fe631){_0x2fe631=_0x2fe631||0xc8;return function(_0x4af736){if(_0x4af736){return _0xa856f5[_0xf8e3('0x1c')](_0x2fe631)['json'](_0x4af736);}};}function respondWithFilteredResult(_0x1ec773,_0x40c196){return function(_0x460629){if(_0x460629){var _0x570ee3=typeof _0x40c196['offset']===_0xf8e3('0x1d')&&typeof _0x40c196[_0xf8e3('0x1e')]===_0xf8e3('0x1d');var _0x3b01ac=_0x460629[_0xf8e3('0x1f')];var _0x11d4cc=_0x570ee3?0x0:_0x40c196[_0xf8e3('0x20')];var _0x2e27e3=_0x570ee3?_0x460629[_0xf8e3('0x1f')]:_0x40c196[_0xf8e3('0x20')]+_0x40c196['limit'];var _0x20cc64;if(_0x2e27e3>=_0x3b01ac){_0x2e27e3=_0x3b01ac;_0x20cc64=0xc8;}else{_0x20cc64=0xce;}_0x1ec773[_0xf8e3('0x1c')](_0x20cc64);return _0x1ec773[_0xf8e3('0x21')](_0xf8e3('0x22'),_0x11d4cc+'-'+_0x2e27e3+'/'+_0x3b01ac)[_0xf8e3('0x23')](_0x460629);}return null;};}function patchUpdates(_0x11c58e){return function(_0x1cae53){try{jsonpatch[_0xf8e3('0x24')](_0x1cae53,_0x11c58e,!![]);}catch(_0x5b99b1){return BPromise[_0xf8e3('0x25')](_0x5b99b1);}return _0x1cae53[_0xf8e3('0x26')]();};}function saveUpdates(_0x3c636d,_0xccbcc0){return function(_0x4a1e5f){if(_0x4a1e5f){return _0x4a1e5f[_0xf8e3('0x27')](_0x3c636d)['then'](function(_0x286059){return _0x286059;});}return null;};}function removeEntity(_0x225a1b,_0x33d526){return function(_0x2dc856){if(_0x2dc856){return _0x2dc856[_0xf8e3('0x28')]()[_0xf8e3('0x29')](function(){_0x225a1b['status'](0xcc)[_0xf8e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fc674,_0x3373ca){return function(_0x417b42){if(!_0x417b42){_0x2fc674[_0xf8e3('0x1a')](0x194);}return _0x417b42;};}function handleError(_0x3b41a1,_0x2963ed){_0x2963ed=_0x2963ed||0x1f4;return function(_0x157a2d){logger['error'](_0x157a2d[_0xf8e3('0x2a')]);if(_0x157a2d[_0xf8e3('0x2b')]){delete _0x157a2d[_0xf8e3('0x2b')];}_0x3b41a1[_0xf8e3('0x1c')](_0x2963ed)[_0xf8e3('0x2c')](_0x157a2d);};}exports[_0xf8e3('0x2d')]=function(_0x16485e,_0xfaf15d){var _0x4f2ae9={},_0x21e1c0={},_0x243e28={'count':0x0,'rows':[]};var _0x492694=_[_0xf8e3('0x2e')](db['MailQueueReport'][_0xf8e3('0x2f')],function(_0x10cf28){return{'name':_0x10cf28[_0xf8e3('0x30')],'type':_0x10cf28[_0xf8e3('0x31')][_0xf8e3('0x32')]};});_0x21e1c0[_0xf8e3('0x33')]=_[_0xf8e3('0x2e')](_0x492694,_0xf8e3('0x2b'));_0x21e1c0['query']=_[_0xf8e3('0x34')](_0x16485e[_0xf8e3('0x35')]);_0x21e1c0['filters']=_['intersection'](_0x21e1c0['model'],_0x21e1c0[_0xf8e3('0x35')]);_0x4f2ae9['attributes']=_[_0xf8e3('0x36')](_0x21e1c0[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x16485e[_0xf8e3('0x35')]['fields']));_0x4f2ae9['attributes']=_0x4f2ae9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0x4f2ae9[_0xf8e3('0x38')]:_0x21e1c0[_0xf8e3('0x33')];if(!_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x3a')]('nolimit')){_0x4f2ae9[_0xf8e3('0x1e')]=qs['limit'](_0x16485e['query'][_0xf8e3('0x1e')]);_0x4f2ae9[_0xf8e3('0x20')]=qs[_0xf8e3('0x20')](_0x16485e[_0xf8e3('0x35')]['offset']);}_0x4f2ae9['order']=qs[_0xf8e3('0x3b')](_0x16485e[_0xf8e3('0x35')]['sort']);_0x4f2ae9[_0xf8e3('0x3c')]=qs[_0xf8e3('0x3d')](_[_0xf8e3('0x3e')](_0x16485e[_0xf8e3('0x35')],_0x21e1c0['filters']),_0x492694);if(_0x16485e['query']['filter']){_0x4f2ae9[_0xf8e3('0x3c')]=_[_0xf8e3('0x3f')](_0x4f2ae9[_0xf8e3('0x3c')],{'$or':_[_0xf8e3('0x2e')](_0x492694,function(_0x53160a){if(_0x53160a[_0xf8e3('0x31')]!=='VIRTUAL'){var _0x20909b={};_0x20909b[_0x53160a[_0xf8e3('0x2b')]]={'$like':'%'+_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x40')]+'%'};return _0x20909b;}})});}_0x4f2ae9=_[_0xf8e3('0x3f')]({},_0x4f2ae9,_0x16485e[_0xf8e3('0x41')]);var _0x82e778={'where':_0x4f2ae9[_0xf8e3('0x3c')]};return db[_0xf8e3('0x42')]['count'](_0x82e778)[_0xf8e3('0x29')](function(_0x537089){_0x243e28[_0xf8e3('0x1f')]=_0x537089;if(_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x43')]){_0x4f2ae9[_0xf8e3('0x44')]=[{'all':!![]}];}return db[_0xf8e3('0x42')][_0xf8e3('0x45')](_0x4f2ae9);})[_0xf8e3('0x29')](function(_0x2f05b7){_0x243e28['rows']=_0x2f05b7;return _0x243e28;})[_0xf8e3('0x29')](respondWithFilteredResult(_0xfaf15d,_0x4f2ae9))[_0xf8e3('0x46')](handleError(_0xfaf15d,null));};exports[_0xf8e3('0x47')]=function(_0x382dbb,_0x6dd110){var _0xe7fcb9={'raw':!![],'where':{'id':_0x382dbb[_0xf8e3('0x48')]['id']}},_0x792190={};_0x792190['model']=_['keys'](db['MailQueueReport'][_0xf8e3('0x2f')]);_0x792190[_0xf8e3('0x35')]=_['keys'](_0x382dbb[_0xf8e3('0x35')]);_0x792190['filters']=_[_0xf8e3('0x36')](_0x792190[_0xf8e3('0x33')],_0x792190['query']);_0xe7fcb9[_0xf8e3('0x38')]=_['intersection'](_0x792190[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x382dbb['query'][_0xf8e3('0x37')]));_0xe7fcb9[_0xf8e3('0x38')]=_0xe7fcb9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0xe7fcb9['attributes']:_0x792190['model'];if(_0x382dbb['query'][_0xf8e3('0x43')]){_0xe7fcb9[_0xf8e3('0x44')]=[{'all':!![]}];}_0xe7fcb9=_[_0xf8e3('0x3f')]({},_0xe7fcb9,_0x382dbb['options']);return db[_0xf8e3('0x42')]['find'](_0xe7fcb9)[_0xf8e3('0x29')](handleEntityNotFound(_0x6dd110,null))[_0xf8e3('0x29')](respondWithResult(_0x6dd110,null))['catch'](handleError(_0x6dd110,null));};exports['create']=function(_0x128234,_0x2939e6){return db[_0xf8e3('0x42')][_0xf8e3('0x49')](_0x128234[_0xf8e3('0x4a')],{})[_0xf8e3('0x29')](respondWithResult(_0x2939e6,0xc9))[_0xf8e3('0x46')](handleError(_0x2939e6,null));};exports[_0xf8e3('0x27')]=function(_0xdc2430,_0x81898e){if(_0xdc2430[_0xf8e3('0x4a')]['id']){delete _0xdc2430['body']['id'];}return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0xdc2430[_0xf8e3('0x48')]['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x81898e,null))[_0xf8e3('0x29')](saveUpdates(_0xdc2430[_0xf8e3('0x4a')],null))['then'](respondWithResult(_0x81898e,null))[_0xf8e3('0x46')](handleError(_0x81898e,null));};exports[_0xf8e3('0x28')]=function(_0x39caae,_0x3e60a6){return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0x39caae['params']['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x3e60a6,null))[_0xf8e3('0x29')](removeEntity(_0x3e60a6,null))[_0xf8e3('0x46')](handleError(_0x3e60a6,null));};exports[_0xf8e3('0x4c')]=function(_0x113404,_0x2fef16){return db['MailQueueReport'][_0xf8e3('0x4c')]()[_0xf8e3('0x29')](respondWithResult(_0x2fef16,null))[_0xf8e3('0x46')](handleError(_0x2fef16,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 00f598d..6afd0c4 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 _0x5f8e=['rimraf','../../config/environment','./mailQueueReport.attributes','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x5f8e,0x1aa));var _0xe5f8=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x5f8e[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require('lodash');var util=require(_0xe5f8('0x0'));var logger=require(_0xe5f8('0x1'))(_0xe5f8('0x2'));var moment=require(_0xe5f8('0x3'));var BPromise=require(_0xe5f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5f8('0x5'));var rimraf=require(_0xe5f8('0x6'));var config=require(_0xe5f8('0x7'));var attributes=require(_0xe5f8('0x8'));module['exports']=function(_0x494236,_0x2baa65){return _0x494236['define'](_0xe5f8('0x9'),attributes,{'tableName':_0xe5f8('0xa'),'paranoid':![],'indexes':[{'name':_0xe5f8('0xb'),'fields':[_0xe5f8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd386=['path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd386,0x10c));var _0x6d38=function(_0x200aa5,_0x197802){_0x200aa5=_0x200aa5-0x0;var _0x458200=_0xd386[_0x200aa5];return _0x458200;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var logger=require(_0x6d38('0x2'))('api');var moment=require(_0x6d38('0x3'));var BPromise=require(_0x6d38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d38('0x5'));var rimraf=require(_0x6d38('0x6'));var config=require(_0x6d38('0x7'));var attributes=require(_0x6d38('0x8'));module['exports']=function(_0x1a54fa,_0x25eef5){return _0x1a54fa[_0x6d38('0x9')](_0x6d38('0xa'),attributes,{'tableName':_0x6d38('0xb'),'paranoid':![],'indexes':[{'name':_0x6d38('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index b98d58d..319bb8b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1975b6,_0x55025c){var _0x404cb6=function(_0xfa3613){while(--_0xfa3613){_0x1975b6['push'](_0x1975b6['shift']());}};_0x404cb6(++_0x55025c);}(_0x326f,0xd1));var _0xf326=function(_0x10861a,_0x38ee31){_0x10861a=_0x10861a-0x0;var _0x550e41=_0x326f[_0x10861a];return _0x550e41;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x112513,_0x2a7c77){var _0x528b2e=function(_0x2bbf15){while(--_0x2bbf15){_0x112513['push'](_0x112513['shift']());}};_0x528b2e(++_0x2a7c77);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 88f68e2..f173a13 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x33ac6b,_0x1ed895){var _0x34cffe=function(_0x17d762){while(--_0x17d762){_0x33ac6b['push'](_0x33ac6b['shift']());}};_0x34cffe(++_0x1ed895);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x54e76c,_0x4dda43){var _0x37037f=function(_0x5e4952){while(--_0x5e4952){_0x54e76c['push'](_0x54e76c['shift']());}};_0x37037f(++_0x4dda43);}(_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 b0707e2..3607ce2 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 _0x6d48=['INTEGER','INBOX','BOOLEAN','sequelize','exports','STRING'];(function(_0x251ab0,_0x46e532){var _0x11848c=function(_0x78e3a2){while(--_0x78e3a2){_0x251ab0['push'](_0x251ab0['shift']());}};_0x11848c(++_0x46e532);}(_0x6d48,0x135));var _0x86d4=function(_0x3ddf16,_0x76f985){_0x3ddf16=_0x3ddf16-0x0;var _0x353de4=_0x6d48[_0x3ddf16];return _0x353de4;};'use strict';var Sequelize=require(_0x86d4('0x0'));module[_0x86d4('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x86d4('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x86d4('0x2')]},'password':{'type':Sequelize[_0x86d4('0x2')]},'port':{'type':Sequelize[_0x86d4('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x86d4('0x4')},'connTimeout':{'type':Sequelize[_0x86d4('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x86d4('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x86d4('0x2')]},'modernAuthentication':{'type':Sequelize[_0x86d4('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x49c1=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x2790ed,_0x2e6f9e){var _0x5a6850=function(_0x1afb8b){while(--_0x1afb8b){_0x2790ed['push'](_0x2790ed['shift']());}};_0x5a6850(++_0x2e6f9e);}(_0x49c1,0x154));var _0x149c=function(_0x53baf6,_0x18912e){_0x53baf6=_0x53baf6-0x0;var _0xf501d5=_0x49c1[_0x53baf6];return _0xf501d5;};'use strict';var Sequelize=require(_0x149c('0x0'));module[_0x149c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x149c('0x2')]},'authentication':{'type':Sequelize[_0x149c('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x149c('0x2')]},'password':{'type':Sequelize[_0x149c('0x2')]},'port':{'type':Sequelize[_0x149c('0x4')]},'tls':{'type':Sequelize[_0x149c('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x149c('0x2')],'defaultValue':_0x149c('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x149c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 4818c10..3b5587b 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 _0x8664=['path','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','util','../../config/logger','api','bluebird'];(function(_0x1f7fe4,_0x886c47){var _0x4ea97e=function(_0x1d5474){while(--_0x1d5474){_0x1f7fe4['push'](_0x1f7fe4['shift']());}};_0x4ea97e(++_0x886c47);}(_0x8664,0x15a));var _0x4866=function(_0x64b865,_0x2470da){_0x64b865=_0x64b865-0x0;var _0x1e0433=_0x8664[_0x64b865];return _0x1e0433;};'use strict';var _=require('lodash');var util=require(_0x4866('0x0'));var logger=require(_0x4866('0x1'))(_0x4866('0x2'));var moment=require('moment');var BPromise=require(_0x4866('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4866('0x4'));var rimraf=require('rimraf');var config=require(_0x4866('0x5'));var attributes=require(_0x4866('0x6'));module[_0x4866('0x7')]=function(_0x126448,_0x54cb29){return _0x126448[_0x4866('0x8')]('MailServerIn',attributes,{'tableName':_0x4866('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43f1=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3f5238,_0x39e5b6){var _0x115624=function(_0x57db3a){while(--_0x57db3a){_0x3f5238['push'](_0x3f5238['shift']());}};_0x115624(++_0x39e5b6);}(_0x43f1,0x7d));var _0x143f=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x43f1[_0x5cc3d4];return _0x17ca31;};'use strict';var _=require(_0x143f('0x0'));var util=require('util');var logger=require(_0x143f('0x1'))('api');var moment=require(_0x143f('0x2'));var BPromise=require(_0x143f('0x3'));var rp=require(_0x143f('0x4'));var fs=require('fs');var path=require(_0x143f('0x5'));var rimraf=require('rimraf');var config=require(_0x143f('0x6'));var attributes=require(_0x143f('0x7'));module[_0x143f('0x8')]=function(_0x49b470,_0x1bd608){return _0x49b470[_0x143f('0x9')](_0x143f('0xa'),attributes,{'tableName':_0x143f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index daf8f7c..324c039 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 _0xbca8=['request\x20sent','result','GetMailServerIn','MailServerIn','options','where','attributes','limit','map','include','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','MailServerIn,\x20%s,\x20%s'];(function(_0x538c9e,_0x3e01c4){var _0x3698fd=function(_0xb3a07e){while(--_0xb3a07e){_0x538c9e['push'](_0x538c9e['shift']());}};_0x3698fd(++_0x3e01c4);}(_0xbca8,0xcc));var _0x8bca=function(_0x4ad85a,_0x106bd1){_0x4ad85a=_0x4ad85a-0x0;var _0x3518b5=_0xbca8[_0x4ad85a];return _0x3518b5;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bca('0x5'))['db'];var utils=require(_0x8bca('0x6'));var logger=require(_0x8bca('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8bca('0x8'));var client=jayson[_0x8bca('0x9')][_0x8bca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348ddd,_0x4b3267,_0x3fdccf){return new BPromise(function(_0x38e241,_0x278c99){return client[_0x8bca('0xb')](_0x348ddd,_0x3fdccf)[_0x8bca('0xc')](function(_0xe266ca){logger[_0x8bca('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4b3267,'request\x20sent');logger[_0x8bca('0xe')](_0x8bca('0xf'),_0x4b3267,'request\x20sent',JSON['stringify'](_0xe266ca));if(_0xe266ca[_0x8bca('0x10')]){if(_0xe266ca['error'][_0x8bca('0x11')]===0x1f4){logger[_0x8bca('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4b3267,_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);return _0x278c99(_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4b3267,_0xe266ca[_0x8bca('0x10')]['message']);return _0x38e241(_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);}else{logger[_0x8bca('0xd')](_0x8bca('0x13'),_0x4b3267,_0x8bca('0x14'));_0x38e241(_0xe266ca[_0x8bca('0x15')]['message']);}})['catch'](function(_0x11037e){logger['error'](_0x8bca('0x13'),_0x4b3267,_0x11037e);_0x278c99(_0x11037e);});});}exports[_0x8bca('0x16')]=function(_0x4e24c8){var _0x5e735b=this;return new Promise(function(_0x5622ba,_0x1963c0){return db[_0x8bca('0x17')]['findAll']({'raw':_0x4e24c8[_0x8bca('0x18')]?_0x4e24c8['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e24c8['options']?_0x4e24c8[_0x8bca('0x18')][_0x8bca('0x19')]||null:null,'attributes':_0x4e24c8[_0x8bca('0x18')]?_0x4e24c8[_0x8bca('0x18')][_0x8bca('0x1a')]||null:null,'limit':_0x4e24c8[_0x8bca('0x18')]?_0x4e24c8['options'][_0x8bca('0x1b')]||null:null,'include':_0x4e24c8[_0x8bca('0x18')]?_0x4e24c8[_0x8bca('0x18')]['include']?_[_0x8bca('0x1c')](_0x4e24c8['options'][_0x8bca('0x1d')],function(_0x4e4bff){return{'model':db[_0x4e4bff[_0x8bca('0x1e')]],'as':_0x4e4bff['as'],'attributes':_0x4e4bff[_0x8bca('0x1a')],'include':_0x4e4bff[_0x8bca('0x1d')]?_[_0x8bca('0x1c')](_0x4e4bff[_0x8bca('0x1d')],function(_0x3a7498){return{'model':db[_0x3a7498[_0x8bca('0x1e')]],'as':_0x3a7498['as'],'attributes':_0x3a7498['attributes'],'include':_0x3a7498['include']?_[_0x8bca('0x1c')](_0x3a7498[_0x8bca('0x1d')],function(_0x4c10db){return{'model':db[_0x4c10db[_0x8bca('0x1e')]],'as':_0x4c10db['as'],'attributes':_0x4c10db[_0x8bca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8bca('0xc')](function(_0x344eae){logger[_0x8bca('0xd')]('GetMailServerIn',_0x4e24c8);logger[_0x8bca('0xe')]('GetMailServerIn',_0x4e24c8,JSON[_0x8bca('0x1f')](_0x344eae));_0x5622ba(_0x344eae);})['catch'](function(_0x18ff94){logger[_0x8bca('0x10')](_0x8bca('0x16'),_0x18ff94[_0x8bca('0x12')],_0x4e24c8);_0x1963c0(_0x5e735b['error'](0x1f4,_0x18ff94[_0x8bca('0x12')]));});});}; \ No newline at end of file +var _0xe735=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','attributes','limit','include','model','map','lodash','bluebird'];(function(_0x1aeb9e,_0x38e5de){var _0xad8e0a=function(_0x5a1721){while(--_0x5a1721){_0x1aeb9e['push'](_0x1aeb9e['shift']());}};_0xad8e0a(++_0x38e5de);}(_0xe735,0xc4));var _0x5e73=function(_0x4af01e,_0x543f5c){_0x4af01e=_0x4af01e-0x0;var _0x178c11=_0xe735[_0x4af01e];return _0x178c11;};'use strict';var _=require(_0x5e73('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e73('0x1'));var rs=require(_0x5e73('0x2'));var fs=require('fs');var Redis=require(_0x5e73('0x3'));var db=require(_0x5e73('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e73('0x5'))(_0x5e73('0x6'));var config=require(_0x5e73('0x7'));var jayson=require(_0x5e73('0x8'));var client=jayson[_0x5e73('0x9')][_0x5e73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17e271,_0x3d7356,_0xeeb8ac){return new BPromise(function(_0x4bc989,_0x11856d){return client[_0x5e73('0xb')](_0x17e271,_0xeeb8ac)[_0x5e73('0xc')](function(_0x465402){logger[_0x5e73('0xd')](_0x5e73('0xe'),_0x3d7356,_0x5e73('0xf'));logger[_0x5e73('0x10')](_0x5e73('0x11'),_0x3d7356,_0x5e73('0xf'),JSON[_0x5e73('0x12')](_0x465402));if(_0x465402[_0x5e73('0x13')]){if(_0x465402['error'][_0x5e73('0x14')]===0x1f4){logger[_0x5e73('0x13')](_0x5e73('0xe'),_0x3d7356,_0x465402['error'][_0x5e73('0x15')]);return _0x11856d(_0x465402[_0x5e73('0x13')][_0x5e73('0x15')]);}logger[_0x5e73('0x13')]('MailServerIn,\x20%s,\x20%s',_0x3d7356,_0x465402['error']['message']);return _0x4bc989(_0x465402[_0x5e73('0x13')][_0x5e73('0x15')]);}else{logger[_0x5e73('0xd')](_0x5e73('0xe'),_0x3d7356,'request\x20sent');_0x4bc989(_0x465402[_0x5e73('0x16')][_0x5e73('0x15')]);}})[_0x5e73('0x17')](function(_0x2f204c){logger[_0x5e73('0x13')]('MailServerIn,\x20%s,\x20%s',_0x3d7356,_0x2f204c);_0x11856d(_0x2f204c);});});}exports[_0x5e73('0x18')]=function(_0x5128a0){var _0x3ffbf8=this;return new Promise(function(_0x4e72ba,_0x4d1e7e){return db[_0x5e73('0x19')]['findAll']({'raw':_0x5128a0[_0x5e73('0x1a')]?_0x5128a0[_0x5e73('0x1a')][_0x5e73('0x1b')]===undefined?!![]:![]:!![],'where':_0x5128a0['options']?_0x5128a0['options']['where']||null:null,'attributes':_0x5128a0['options']?_0x5128a0[_0x5e73('0x1a')][_0x5e73('0x1c')]||null:null,'limit':_0x5128a0[_0x5e73('0x1a')]?_0x5128a0['options'][_0x5e73('0x1d')]||null:null,'include':_0x5128a0[_0x5e73('0x1a')]?_0x5128a0[_0x5e73('0x1a')][_0x5e73('0x1e')]?_['map'](_0x5128a0[_0x5e73('0x1a')][_0x5e73('0x1e')],function(_0x35f7dd){return{'model':db[_0x35f7dd[_0x5e73('0x1f')]],'as':_0x35f7dd['as'],'attributes':_0x35f7dd['attributes'],'include':_0x35f7dd[_0x5e73('0x1e')]?_[_0x5e73('0x20')](_0x35f7dd['include'],function(_0x402deb){return{'model':db[_0x402deb['model']],'as':_0x402deb['as'],'attributes':_0x402deb[_0x5e73('0x1c')],'include':_0x402deb[_0x5e73('0x1e')]?_[_0x5e73('0x20')](_0x402deb[_0x5e73('0x1e')],function(_0x41633b){return{'model':db[_0x41633b[_0x5e73('0x1f')]],'as':_0x41633b['as'],'attributes':_0x41633b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e73('0xc')](function(_0x4efa01){logger[_0x5e73('0xd')]('GetMailServerIn',_0x5128a0);logger[_0x5e73('0x10')]('GetMailServerIn',_0x5128a0,JSON[_0x5e73('0x12')](_0x4efa01));_0x4e72ba(_0x4efa01);})[_0x5e73('0x17')](function(_0x45a988){logger[_0x5e73('0x13')](_0x5e73('0x18'),_0x45a988['message'],_0x5128a0);_0x4d1e7e(_0x3ffbf8[_0x5e73('0x13')](0x1f4,_0x45a988['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d6665e2..bb2bcda 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_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('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 5b23824..9f22415 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 _0x4cf8=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1f2578,_0x34c050){var _0x6439c4=function(_0x5b9a35){while(--_0x5b9a35){_0x1f2578['push'](_0x1f2578['shift']());}};_0x6439c4(++_0x34c050);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x1a9c75,_0xa83750){_0x1a9c75=_0x1a9c75-0x0;var _0xb2f37e=_0x4cf8[_0x1a9c75];return _0xb2f37e;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'description':{'type':Sequelize[_0x84cf('0x2')]},'host':{'type':Sequelize[_0x84cf('0x2')]},'user':{'type':Sequelize[_0x84cf('0x2')]},'pass':{'type':Sequelize[_0x84cf('0x2')]},'port':{'type':Sequelize[_0x84cf('0x3')]},'secure':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x84cf('0x2')]},'authentication':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x84cf('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xb58b=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x525abe,_0x2f2fde){var _0x58e5ce=function(_0x42e2c9){while(--_0x42e2c9){_0x525abe['push'](_0x525abe['shift']());}};_0x58e5ce(++_0x2f2fde);}(_0xb58b,0x1f1));var _0xbb58=function(_0x44f3db,_0x3075c2){_0x44f3db=_0x44f3db-0x0;var _0x38e91f=_0xb58b[_0x44f3db];return _0x38e91f;};'use strict';var Sequelize=require('sequelize');module[_0xbb58('0x0')]={'description':{'type':Sequelize[_0xbb58('0x1')]},'host':{'type':Sequelize[_0xbb58('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xbb58('0x1')]},'port':{'type':Sequelize[_0xbb58('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xbb58('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xbb58('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 f404a43..78ec031 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 _0x863b=['then','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x863b,0x77));var _0xb863=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x863b[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb863('0x0'));var zipdir=require(_0xb863('0x1'));var jsonpatch=require(_0xb863('0x2'));var rp=require(_0xb863('0x3'));var moment=require(_0xb863('0x4'));var BPromise=require(_0xb863('0x5'));var Mustache=require(_0xb863('0x6'));var util=require(_0xb863('0x7'));var path=require(_0xb863('0x8'));var sox=require('sox');var csv=require(_0xb863('0x9'));var ejs=require(_0xb863('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb863('0xb'));var squel=require(_0xb863('0xc'));var crypto=require(_0xb863('0xd'));var jsforce=require(_0xb863('0xe'));var deskjs=require(_0xb863('0xf'));var toCsv=require(_0xb863('0x9'));var querystring=require(_0xb863('0x10'));var Papa=require(_0xb863('0x11'));var Redis=require(_0xb863('0x12'));var authService=require(_0xb863('0x13'));var qs=require(_0xb863('0x14'));var as=require(_0xb863('0x15'));var hardwareService=require(_0xb863('0x16'));var logger=require(_0xb863('0x17'))(_0xb863('0x18'));var utils=require(_0xb863('0x19'));var config=require(_0xb863('0x1a'));var licenseUtil=require(_0xb863('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302073,_0x5abd76){_0x5abd76=_0x5abd76||0xcc;return function(_0x5f1260){if(_0x5f1260){return _0x302073[_0xb863('0x1c')](_0x5abd76);}return _0x302073[_0xb863('0x1d')](_0x5abd76)[_0xb863('0x1e')]();};}function respondWithResult(_0x373d5c,_0x146c14){_0x146c14=_0x146c14||0xc8;return function(_0x1a99b7){if(_0x1a99b7){return _0x373d5c[_0xb863('0x1d')](_0x146c14)[_0xb863('0x1f')](_0x1a99b7);}};}function respondWithFilteredResult(_0x2e590a,_0x4763c8){return function(_0x1e50c0){if(_0x1e50c0){var _0x2657fc=typeof _0x4763c8['offset']===_0xb863('0x20')&&typeof _0x4763c8['limit']===_0xb863('0x20');var _0x2902dc=_0x1e50c0[_0xb863('0x21')];var _0x560785=_0x2657fc?0x0:_0x4763c8['offset'];var _0x10eaca=_0x2657fc?_0x1e50c0[_0xb863('0x21')]:_0x4763c8[_0xb863('0x22')]+_0x4763c8['limit'];var _0x33aebd;if(_0x10eaca>=_0x2902dc){_0x10eaca=_0x2902dc;_0x33aebd=0xc8;}else{_0x33aebd=0xce;}_0x2e590a[_0xb863('0x1d')](_0x33aebd);return _0x2e590a[_0xb863('0x23')](_0xb863('0x24'),_0x560785+'-'+_0x10eaca+'/'+_0x2902dc)['json'](_0x1e50c0);}return null;};}function patchUpdates(_0x5bbcc2){return function(_0x1c05ba){try{jsonpatch[_0xb863('0x25')](_0x1c05ba,_0x5bbcc2,!![]);}catch(_0x317068){return BPromise[_0xb863('0x26')](_0x317068);}return _0x1c05ba[_0xb863('0x27')]();};}function saveUpdates(_0x17cf8c,_0x466df4){return function(_0x19eece){if(_0x19eece){return _0x19eece[_0xb863('0x28')](_0x17cf8c)[_0xb863('0x29')](function(_0x5c51bf){return _0x5c51bf;});}return null;};}function removeEntity(_0x167453,_0xb5a169){return function(_0x584b9b){if(_0x584b9b){return _0x584b9b['destroy']()[_0xb863('0x29')](function(){_0x167453[_0xb863('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8c92,_0x22dbe5){return function(_0x50c26c){if(!_0x50c26c){_0x2c8c92[_0xb863('0x1c')](0x194);}return _0x50c26c;};}function handleError(_0x1c9e73,_0x13c913){_0x13c913=_0x13c913||0x1f4;return function(_0x28c025){logger[_0xb863('0x2a')](_0x28c025[_0xb863('0x2b')]);if(_0x28c025['name']){delete _0x28c025[_0xb863('0x2c')];}_0x1c9e73[_0xb863('0x1d')](_0x13c913)[_0xb863('0x2d')](_0x28c025);};}exports[_0xb863('0x2e')]=function(_0x37d329,_0x129408){var _0x47cf51={},_0x2aae9a={},_0x5f2377={'count':0x0,'rows':[]};var _0x1f72a8=_[_0xb863('0x2f')](db[_0xb863('0x30')][_0xb863('0x31')],function(_0x246971){return{'name':_0x246971[_0xb863('0x32')],'type':_0x246971[_0xb863('0x33')]['key']};});_0x2aae9a[_0xb863('0x34')]=_[_0xb863('0x2f')](_0x1f72a8,'name');_0x2aae9a[_0xb863('0x35')]=_[_0xb863('0x36')](_0x37d329['query']);_0x2aae9a['filters']=_[_0xb863('0x37')](_0x2aae9a[_0xb863('0x34')],_0x2aae9a[_0xb863('0x35')]);_0x47cf51[_0xb863('0x38')]=_['intersection'](_0x2aae9a['model'],qs[_0xb863('0x39')](_0x37d329[_0xb863('0x35')]['fields']));_0x47cf51[_0xb863('0x38')]=_0x47cf51['attributes'][_0xb863('0x3a')]?_0x47cf51[_0xb863('0x38')]:_0x2aae9a[_0xb863('0x34')];if(!_0x37d329[_0xb863('0x35')][_0xb863('0x3b')]('nolimit')){_0x47cf51[_0xb863('0x3c')]=qs[_0xb863('0x3c')](_0x37d329[_0xb863('0x35')][_0xb863('0x3c')]);_0x47cf51[_0xb863('0x22')]=qs['offset'](_0x37d329[_0xb863('0x35')][_0xb863('0x22')]);}_0x47cf51[_0xb863('0x3d')]=qs[_0xb863('0x3e')](_0x37d329[_0xb863('0x35')]['sort']);_0x47cf51[_0xb863('0x3f')]=qs[_0xb863('0x40')](_['pick'](_0x37d329[_0xb863('0x35')],_0x2aae9a[_0xb863('0x40')]),_0x1f72a8);if(_0x37d329[_0xb863('0x35')][_0xb863('0x41')]){_0x47cf51[_0xb863('0x3f')]=_[_0xb863('0x42')](_0x47cf51[_0xb863('0x3f')],{'$or':_['map'](_0x1f72a8,function(_0x41dd4e){if(_0x41dd4e[_0xb863('0x33')]!==_0xb863('0x43')){var _0x10f10b={};_0x10f10b[_0x41dd4e[_0xb863('0x2c')]]={'$like':'%'+_0x37d329[_0xb863('0x35')]['filter']+'%'};return _0x10f10b;}})});}_0x47cf51=_[_0xb863('0x42')]({},_0x47cf51,_0x37d329[_0xb863('0x44')]);var _0x5660e8={'where':_0x47cf51[_0xb863('0x3f')]};return db[_0xb863('0x30')][_0xb863('0x21')](_0x5660e8)[_0xb863('0x29')](function(_0x5300cc){_0x5f2377[_0xb863('0x21')]=_0x5300cc;if(_0x37d329['query'][_0xb863('0x45')]){_0x47cf51[_0xb863('0x46')]=[{'all':!![]}];}return db['MailServerOut'][_0xb863('0x47')](_0x47cf51);})[_0xb863('0x29')](function(_0x1fa300){_0x5f2377[_0xb863('0x48')]=_0x1fa300;return _0x5f2377;})[_0xb863('0x29')](respondWithFilteredResult(_0x129408,_0x47cf51))[_0xb863('0x49')](handleError(_0x129408,null));};exports[_0xb863('0x4a')]=function(_0x337029,_0x5a268c){var _0x3960d4={'raw':!![],'where':{'id':_0x337029['params']['id']}},_0x5a998d={};_0x5a998d[_0xb863('0x34')]=_[_0xb863('0x36')](db[_0xb863('0x30')][_0xb863('0x31')]);_0x5a998d[_0xb863('0x35')]=_[_0xb863('0x36')](_0x337029[_0xb863('0x35')]);_0x5a998d['filters']=_[_0xb863('0x37')](_0x5a998d[_0xb863('0x34')],_0x5a998d[_0xb863('0x35')]);_0x3960d4['attributes']=_[_0xb863('0x37')](_0x5a998d['model'],qs[_0xb863('0x39')](_0x337029[_0xb863('0x35')][_0xb863('0x39')]));_0x3960d4[_0xb863('0x38')]=_0x3960d4[_0xb863('0x38')][_0xb863('0x3a')]?_0x3960d4[_0xb863('0x38')]:_0x5a998d['model'];if(_0x337029[_0xb863('0x35')][_0xb863('0x45')]){_0x3960d4[_0xb863('0x46')]=[{'all':!![]}];}_0x3960d4=_['merge']({},_0x3960d4,_0x337029[_0xb863('0x44')]);return db[_0xb863('0x30')][_0xb863('0x4b')](_0x3960d4)['then'](handleEntityNotFound(_0x5a268c,null))[_0xb863('0x29')](respondWithResult(_0x5a268c,null))['catch'](handleError(_0x5a268c,null));};exports[_0xb863('0x4c')]=function(_0x33d613,_0x53fdf3){return db[_0xb863('0x30')][_0xb863('0x4c')](_0x33d613[_0xb863('0x4d')],{})[_0xb863('0x29')](respondWithResult(_0x53fdf3,0xc9))['catch'](handleError(_0x53fdf3,null));};exports[_0xb863('0x28')]=function(_0x553237,_0xe54691){if(_0x553237[_0xb863('0x4d')]['id']){delete _0x553237[_0xb863('0x4d')]['id'];}return db['MailServerOut'][_0xb863('0x4b')]({'where':{'id':_0x553237[_0xb863('0x4e')]['id']}})[_0xb863('0x29')](handleEntityNotFound(_0xe54691,null))[_0xb863('0x29')](saveUpdates(_0x553237[_0xb863('0x4d')],null))[_0xb863('0x29')](respondWithResult(_0xe54691,null))[_0xb863('0x49')](handleError(_0xe54691,null));};exports[_0xb863('0x4f')]=function(_0x1edd8b,_0x74016f){return db[_0xb863('0x30')][_0xb863('0x4b')]({'where':{'id':_0x1edd8b[_0xb863('0x4e')]['id']}})[_0xb863('0x29')](handleEntityNotFound(_0x74016f,null))['then'](removeEntity(_0x74016f,null))['catch'](handleError(_0x74016f,null));}; \ No newline at end of file +var _0xee19=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','body','find','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status'];(function(_0x57911f,_0x1baf91){var _0x3061cb=function(_0x44f643){while(--_0x44f643){_0x57911f['push'](_0x57911f['shift']());}};_0x3061cb(++_0x1baf91);}(_0xee19,0x110));var _0x9ee1=function(_0x4fa0ff,_0x3bfabe){_0x4fa0ff=_0x4fa0ff-0x0;var _0xf76b8e=_0xee19[_0x4fa0ff];return _0xf76b8e;};'use strict';var emlformat=require(_0x9ee1('0x0'));var rimraf=require(_0x9ee1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ee1('0x2'));var rp=require(_0x9ee1('0x3'));var moment=require(_0x9ee1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ee1('0x5'));var util=require(_0x9ee1('0x6'));var path=require(_0x9ee1('0x7'));var sox=require('sox');var csv=require(_0x9ee1('0x8'));var ejs=require(_0x9ee1('0x9'));var fs=require('fs');var fs_extra=require(_0x9ee1('0xa'));var _=require(_0x9ee1('0xb'));var squel=require(_0x9ee1('0xc'));var crypto=require(_0x9ee1('0xd'));var jsforce=require(_0x9ee1('0xe'));var deskjs=require(_0x9ee1('0xf'));var toCsv=require(_0x9ee1('0x8'));var querystring=require(_0x9ee1('0x10'));var Papa=require(_0x9ee1('0x11'));var Redis=require(_0x9ee1('0x12'));var authService=require(_0x9ee1('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ee1('0x14'));var logger=require(_0x9ee1('0x15'))(_0x9ee1('0x16'));var utils=require(_0x9ee1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9ee1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cbf87,_0x5c03fa){_0x5c03fa=_0x5c03fa||0xcc;return function(_0x231d62){if(_0x231d62){return _0x1cbf87[_0x9ee1('0x19')](_0x5c03fa);}return _0x1cbf87['status'](_0x5c03fa)[_0x9ee1('0x1a')]();};}function respondWithResult(_0x492fc0,_0x5f11de){_0x5f11de=_0x5f11de||0xc8;return function(_0x1bba18){if(_0x1bba18){return _0x492fc0[_0x9ee1('0x1b')](_0x5f11de)['json'](_0x1bba18);}};}function respondWithFilteredResult(_0x424b70,_0x359c9f){return function(_0x45981f){if(_0x45981f){var _0x5db215=typeof _0x359c9f[_0x9ee1('0x1c')]===_0x9ee1('0x1d')&&typeof _0x359c9f[_0x9ee1('0x1e')]===_0x9ee1('0x1d');var _0x3da34e=_0x45981f[_0x9ee1('0x1f')];var _0x421b5a=_0x5db215?0x0:_0x359c9f['offset'];var _0x55bdb3=_0x5db215?_0x45981f['count']:_0x359c9f[_0x9ee1('0x1c')]+_0x359c9f[_0x9ee1('0x1e')];var _0x71008a;if(_0x55bdb3>=_0x3da34e){_0x55bdb3=_0x3da34e;_0x71008a=0xc8;}else{_0x71008a=0xce;}_0x424b70['status'](_0x71008a);return _0x424b70[_0x9ee1('0x20')](_0x9ee1('0x21'),_0x421b5a+'-'+_0x55bdb3+'/'+_0x3da34e)[_0x9ee1('0x22')](_0x45981f);}return null;};}function patchUpdates(_0xf89683){return function(_0x52a744){try{jsonpatch[_0x9ee1('0x23')](_0x52a744,_0xf89683,!![]);}catch(_0x5b54f2){return BPromise[_0x9ee1('0x24')](_0x5b54f2);}return _0x52a744['save']();};}function saveUpdates(_0x42fe53,_0xba2cda){return function(_0x2d4490){if(_0x2d4490){return _0x2d4490[_0x9ee1('0x25')](_0x42fe53)[_0x9ee1('0x26')](function(_0x28cccf){return _0x28cccf;});}return null;};}function removeEntity(_0x33d9bb,_0xf3f3b3){return function(_0x5ecb85){if(_0x5ecb85){return _0x5ecb85[_0x9ee1('0x27')]()[_0x9ee1('0x26')](function(){_0x33d9bb[_0x9ee1('0x1b')](0xcc)[_0x9ee1('0x1a')]();});}};}function handleEntityNotFound(_0x5d5f16,_0x3f227c){return function(_0x5775e8){if(!_0x5775e8){_0x5d5f16[_0x9ee1('0x19')](0x194);}return _0x5775e8;};}function handleError(_0x39b437,_0x3f7146){_0x3f7146=_0x3f7146||0x1f4;return function(_0x74b3d7){logger[_0x9ee1('0x28')](_0x74b3d7[_0x9ee1('0x29')]);if(_0x74b3d7[_0x9ee1('0x2a')]){delete _0x74b3d7[_0x9ee1('0x2a')];}_0x39b437[_0x9ee1('0x1b')](_0x3f7146)[_0x9ee1('0x2b')](_0x74b3d7);};}exports[_0x9ee1('0x2c')]=function(_0x184db3,_0x162b5d){var _0x4b9b26={},_0x14405a={},_0x2aa0bb={'count':0x0,'rows':[]};var _0x1ced56=_[_0x9ee1('0x2d')](db[_0x9ee1('0x2e')][_0x9ee1('0x2f')],function(_0x3a7955){return{'name':_0x3a7955[_0x9ee1('0x30')],'type':_0x3a7955[_0x9ee1('0x31')]['key']};});_0x14405a[_0x9ee1('0x32')]=_[_0x9ee1('0x2d')](_0x1ced56,_0x9ee1('0x2a'));_0x14405a[_0x9ee1('0x33')]=_[_0x9ee1('0x34')](_0x184db3[_0x9ee1('0x33')]);_0x14405a['filters']=_[_0x9ee1('0x35')](_0x14405a[_0x9ee1('0x32')],_0x14405a[_0x9ee1('0x33')]);_0x4b9b26[_0x9ee1('0x36')]=_[_0x9ee1('0x35')](_0x14405a[_0x9ee1('0x32')],qs[_0x9ee1('0x37')](_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x37')]));_0x4b9b26['attributes']=_0x4b9b26[_0x9ee1('0x36')][_0x9ee1('0x38')]?_0x4b9b26['attributes']:_0x14405a[_0x9ee1('0x32')];if(!_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x39')](_0x9ee1('0x3a'))){_0x4b9b26['limit']=qs[_0x9ee1('0x1e')](_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x1e')]);_0x4b9b26[_0x9ee1('0x1c')]=qs['offset'](_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x1c')]);}_0x4b9b26[_0x9ee1('0x3b')]=qs[_0x9ee1('0x3c')](_0x184db3['query'][_0x9ee1('0x3c')]);_0x4b9b26['where']=qs[_0x9ee1('0x3d')](_['pick'](_0x184db3[_0x9ee1('0x33')],_0x14405a['filters']),_0x1ced56);if(_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x3e')]){_0x4b9b26['where']=_[_0x9ee1('0x3f')](_0x4b9b26['where'],{'$or':_[_0x9ee1('0x2d')](_0x1ced56,function(_0x288426){if(_0x288426['type']!==_0x9ee1('0x40')){var _0x1441b8={};_0x1441b8[_0x288426['name']]={'$like':'%'+_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x3e')]+'%'};return _0x1441b8;}})});}_0x4b9b26=_['merge']({},_0x4b9b26,_0x184db3[_0x9ee1('0x41')]);var _0x23b61d={'where':_0x4b9b26['where']};return db[_0x9ee1('0x2e')]['count'](_0x23b61d)[_0x9ee1('0x26')](function(_0x1a581b){_0x2aa0bb[_0x9ee1('0x1f')]=_0x1a581b;if(_0x184db3[_0x9ee1('0x33')][_0x9ee1('0x42')]){_0x4b9b26['include']=[{'all':!![]}];}return db[_0x9ee1('0x2e')][_0x9ee1('0x43')](_0x4b9b26);})[_0x9ee1('0x26')](function(_0x39bdbc){_0x2aa0bb[_0x9ee1('0x44')]=_0x39bdbc;return _0x2aa0bb;})[_0x9ee1('0x26')](respondWithFilteredResult(_0x162b5d,_0x4b9b26))[_0x9ee1('0x45')](handleError(_0x162b5d,null));};exports[_0x9ee1('0x46')]=function(_0xa244ed,_0xcf8382){var _0x268390={'raw':!![],'where':{'id':_0xa244ed[_0x9ee1('0x47')]['id']}},_0x48bf28={};_0x48bf28[_0x9ee1('0x32')]=_['keys'](db[_0x9ee1('0x2e')][_0x9ee1('0x2f')]);_0x48bf28[_0x9ee1('0x33')]=_['keys'](_0xa244ed[_0x9ee1('0x33')]);_0x48bf28[_0x9ee1('0x3d')]=_['intersection'](_0x48bf28[_0x9ee1('0x32')],_0x48bf28['query']);_0x268390['attributes']=_['intersection'](_0x48bf28[_0x9ee1('0x32')],qs[_0x9ee1('0x37')](_0xa244ed[_0x9ee1('0x33')][_0x9ee1('0x37')]));_0x268390['attributes']=_0x268390[_0x9ee1('0x36')]['length']?_0x268390[_0x9ee1('0x36')]:_0x48bf28['model'];if(_0xa244ed[_0x9ee1('0x33')][_0x9ee1('0x42')]){_0x268390[_0x9ee1('0x48')]=[{'all':!![]}];}_0x268390=_['merge']({},_0x268390,_0xa244ed[_0x9ee1('0x41')]);return db[_0x9ee1('0x2e')]['find'](_0x268390)[_0x9ee1('0x26')](handleEntityNotFound(_0xcf8382,null))[_0x9ee1('0x26')](respondWithResult(_0xcf8382,null))[_0x9ee1('0x45')](handleError(_0xcf8382,null));};exports['create']=function(_0x1eea56,_0x239e82){return db['MailServerOut']['create'](_0x1eea56['body'],{})[_0x9ee1('0x26')](respondWithResult(_0x239e82,0xc9))[_0x9ee1('0x45')](handleError(_0x239e82,null));};exports[_0x9ee1('0x25')]=function(_0x60c66,_0x1be276){if(_0x60c66[_0x9ee1('0x49')]['id']){delete _0x60c66['body']['id'];}return db[_0x9ee1('0x2e')][_0x9ee1('0x4a')]({'where':{'id':_0x60c66[_0x9ee1('0x47')]['id']}})[_0x9ee1('0x26')](handleEntityNotFound(_0x1be276,null))[_0x9ee1('0x26')](saveUpdates(_0x60c66[_0x9ee1('0x49')],null))[_0x9ee1('0x26')](respondWithResult(_0x1be276,null))[_0x9ee1('0x45')](handleError(_0x1be276,null));};exports[_0x9ee1('0x27')]=function(_0x5c3856,_0x56bc09){return db['MailServerOut'][_0x9ee1('0x4a')]({'where':{'id':_0x5c3856[_0x9ee1('0x47')]['id']}})['then'](handleEntityNotFound(_0x56bc09,null))['then'](removeEntity(_0x56bc09,null))[_0x9ee1('0x45')](handleError(_0x56bc09,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index aae487d..4ab0d8c 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 _0x26cf=['bluebird','path','rimraf','../../config/environment','define','MailServerOut','mail_servers_out','lodash'];(function(_0x243990,_0x59d23d){var _0x58848f=function(_0x30e60e){while(--_0x30e60e){_0x243990['push'](_0x243990['shift']());}};_0x58848f(++_0x59d23d);}(_0x26cf,0x187));var _0xf26c=function(_0x4627bb,_0x4c8412){_0x4627bb=_0x4627bb-0x0;var _0x3ab7a0=_0x26cf[_0x4627bb];return _0x3ab7a0;};'use strict';var _=require(_0xf26c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf26c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf26c('0x2'));var rimraf=require(_0xf26c('0x3'));var config=require(_0xf26c('0x4'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x26ba43,_0xc8e684){return _0x26ba43[_0xf26c('0x5')](_0xf26c('0x6'),attributes,{'tableName':_0xf26c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8959=['mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./mailServerOut.attributes','MailServerOut'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8959,0x1d7));var _0x9895=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x8959[_0x13342f];return _0x2fc1fc;};'use strict';var _=require(_0x9895('0x0'));var util=require(_0x9895('0x1'));var logger=require(_0x9895('0x2'))(_0x9895('0x3'));var moment=require(_0x9895('0x4'));var BPromise=require(_0x9895('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9895('0x6'));var config=require('../../config/environment');var attributes=require(_0x9895('0x7'));module['exports']=function(_0x49e26f,_0x5dc7c5){return _0x49e26f['define'](_0x9895('0x8'),attributes,{'tableName':_0x9895('0x9'),'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 5f3a3a9..2f3dd1c 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 _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(_0x1719e4,_0x4278fe){var _0x236bac=function(_0x12e8a3){while(--_0x12e8a3){_0x1719e4['push'](_0x1719e4['shift']());}};_0x236bac(++_0x4278fe);}(_0x2ef3,0xba));var _0x32ef=function(_0x3e88d2,_0x529266){_0x3e88d2=_0x3e88d2-0x0;var _0x17761a=_0x2ef3[_0x3e88d2];return _0x17761a;};'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 +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x14ddd4,_0x5b527d){var _0x421616=function(_0x4f0a42){while(--_0x4f0a42){_0x14ddd4['push'](_0x14ddd4['shift']());}};_0x421616(++_0x5b527d);}(_0xadb5,0xad));var _0x5adb=function(_0xe96b4d,_0xe557a8){_0xe96b4d=_0xe96b4d-0x0;var _0x1c8dc0=_0xadb5[_0xe96b4d];return _0x1c8dc0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 986a2c6..b55714b 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 _0xe7b3=['show','post','create','put','update','delete','multer','util','path','express','Router','fs-extra','./mailSubstatus.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x3b75f4,_0x3653d6){var _0x3851b5=function(_0x4d0d85){while(--_0x4d0d85){_0x3b75f4['push'](_0x3b75f4['shift']());}};_0x3851b5(++_0x3653d6);}(_0xe7b3,0x15c));var _0x3e7b=function(_0x3a26dc,_0x2b849f){_0x3a26dc=_0x3a26dc-0x0;var _0x420d69=_0xe7b3[_0x3a26dc];return _0x420d69;};'use strict';var multer=require(_0x3e7b('0x0'));var util=require(_0x3e7b('0x1'));var path=require(_0x3e7b('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e7b('0x3'));var router=express[_0x3e7b('0x4')]();var fs_extra=require(_0x3e7b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e7b('0x6'));router['get']('/',auth[_0x3e7b('0x7')](),controller[_0x3e7b('0x8')]);router[_0x3e7b('0x9')](_0x3e7b('0xa'),auth[_0x3e7b('0x7')](),controller['describe']);router[_0x3e7b('0x9')](_0x3e7b('0xb'),auth['isAuthenticated'](),controller[_0x3e7b('0xc')]);router[_0x3e7b('0xd')]('/',auth[_0x3e7b('0x7')](),controller[_0x3e7b('0xe')]);router[_0x3e7b('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3e7b('0x10')]);router[_0x3e7b('0x11')](_0x3e7b('0xb'),auth[_0x3e7b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe048=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x37597b,_0x46e807){var _0x1b10a4=function(_0x3c2f82){while(--_0x3c2f82){_0x37597b['push'](_0x37597b['shift']());}};_0x1b10a4(++_0x46e807);}(_0xe048,0x68));var _0x8e04=function(_0x41d515,_0x4bda68){_0x41d515=_0x41d515-0x0;var _0x45b796=_0xe048[_0x41d515];return _0x45b796;};'use strict';var multer=require(_0x8e04('0x0'));var util=require(_0x8e04('0x1'));var path=require(_0x8e04('0x2'));var timeout=require(_0x8e04('0x3'));var express=require('express');var router=express[_0x8e04('0x4')]();var fs_extra=require(_0x8e04('0x5'));var auth=require(_0x8e04('0x6'));var interaction=require(_0x8e04('0x7'));var config=require(_0x8e04('0x8'));var controller=require(_0x8e04('0x9'));router['get']('/',auth[_0x8e04('0xa')](),controller['index']);router[_0x8e04('0xb')](_0x8e04('0xc'),auth[_0x8e04('0xa')](),controller['describe']);router[_0x8e04('0xb')](_0x8e04('0xd'),auth[_0x8e04('0xa')](),controller[_0x8e04('0xe')]);router[_0x8e04('0xf')]('/',auth[_0x8e04('0xa')](),controller[_0x8e04('0x10')]);router[_0x8e04('0x11')](_0x8e04('0xd'),auth[_0x8e04('0xa')](),controller[_0x8e04('0x12')]);router[_0x8e04('0x13')](_0x8e04('0xd'),auth[_0x8e04('0xa')](),controller[_0x8e04('0x14')]);module[_0x8e04('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 7120309..06469b2 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 _0x31af=['sequelize','exports','STRING'];(function(_0x57cc7a,_0x1e738d){var _0x5d6159=function(_0xb455d5){while(--_0xb455d5){_0x57cc7a['push'](_0x57cc7a['shift']());}};_0x5d6159(++_0x1e738d);}(_0x31af,0xde));var _0xf31a=function(_0x514089,_0xc4e3c4){_0x514089=_0x514089-0x0;var _0x376500=_0x31af[_0x514089];return _0x376500;};'use strict';var Sequelize=require(_0xf31a('0x0'));module[_0xf31a('0x1')]={'name':{'type':Sequelize[_0xf31a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0af5=['STRING','name','exports'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0x0af5,0x158));var _0x50af=function(_0x73be99,_0x5bc606){_0x73be99=_0x73be99-0x0;var _0x15f44d=_0x0af5[_0x73be99];return _0x15f44d;};'use strict';var Sequelize=require('sequelize');module[_0x50af('0x0')]={'name':{'type':Sequelize[_0x50af('0x1')],'unique':_0x50af('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x50af('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 61f4c5e..d6b4bd8 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 _0x8656=['end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','MailSubstatus','fieldName','key','map','query','keys','filters','attributes','intersection','model','fields','length','nolimit','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','rawAttributes','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0x8656,0x1e4));var _0x6865=function(_0x35d483,_0x28b4a0){_0x35d483=_0x35d483-0x0;var _0x99edb7=_0x8656[_0x35d483];return _0x99edb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6865('0x0'));var zipdir=require(_0x6865('0x1'));var jsonpatch=require(_0x6865('0x2'));var rp=require('request-promise');var moment=require(_0x6865('0x3'));var BPromise=require(_0x6865('0x4'));var Mustache=require(_0x6865('0x5'));var util=require(_0x6865('0x6'));var path=require(_0x6865('0x7'));var sox=require(_0x6865('0x8'));var csv=require(_0x6865('0x9'));var ejs=require(_0x6865('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6865('0xb'));var squel=require(_0x6865('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6865('0xd'));var toCsv=require(_0x6865('0x9'));var querystring=require(_0x6865('0xe'));var Papa=require('papaparse');var Redis=require(_0x6865('0xf'));var authService=require(_0x6865('0x10'));var qs=require(_0x6865('0x11'));var as=require(_0x6865('0x12'));var hardwareService=require(_0x6865('0x13'));var logger=require(_0x6865('0x14'))(_0x6865('0x15'));var utils=require('../../config/utils');var config=require(_0x6865('0x16'));var licenseUtil=require(_0x6865('0x17'));var db=require(_0x6865('0x18'))['db'];function respondWithStatusCode(_0x59e48b,_0x305b30){_0x305b30=_0x305b30||0xcc;return function(_0x1652e0){if(_0x1652e0){return _0x59e48b[_0x6865('0x19')](_0x305b30);}return _0x59e48b[_0x6865('0x1a')](_0x305b30)[_0x6865('0x1b')]();};}function respondWithResult(_0x1aca53,_0x368454){_0x368454=_0x368454||0xc8;return function(_0x192258){if(_0x192258){return _0x1aca53['status'](_0x368454)[_0x6865('0x1c')](_0x192258);}};}function respondWithFilteredResult(_0x456a19,_0x363b65){return function(_0x3d45e5){if(_0x3d45e5){var _0x138a5c=typeof _0x363b65[_0x6865('0x1d')]===_0x6865('0x1e')&&typeof _0x363b65[_0x6865('0x1f')]===_0x6865('0x1e');var _0x5d83ec=_0x3d45e5[_0x6865('0x20')];var _0x4d5a74=_0x138a5c?0x0:_0x363b65[_0x6865('0x1d')];var _0x3dc666=_0x138a5c?_0x3d45e5[_0x6865('0x20')]:_0x363b65[_0x6865('0x1d')]+_0x363b65['limit'];var _0x200660;if(_0x3dc666>=_0x5d83ec){_0x3dc666=_0x5d83ec;_0x200660=0xc8;}else{_0x200660=0xce;}_0x456a19['status'](_0x200660);return _0x456a19[_0x6865('0x21')](_0x6865('0x22'),_0x4d5a74+'-'+_0x3dc666+'/'+_0x5d83ec)[_0x6865('0x1c')](_0x3d45e5);}return null;};}function patchUpdates(_0x21d019){return function(_0x515cb4){try{jsonpatch[_0x6865('0x23')](_0x515cb4,_0x21d019,!![]);}catch(_0xac7240){return BPromise['reject'](_0xac7240);}return _0x515cb4['save']();};}function saveUpdates(_0x59aeac,_0x100a3d){return function(_0x4fefc3){if(_0x4fefc3){return _0x4fefc3[_0x6865('0x24')](_0x59aeac)[_0x6865('0x25')](function(_0x1cdcf0){return _0x1cdcf0;});}return null;};}function removeEntity(_0x31e9d1,_0x5e526a){return function(_0x2cccf0){if(_0x2cccf0){return _0x2cccf0['destroy']()[_0x6865('0x25')](function(){_0x31e9d1[_0x6865('0x1a')](0xcc)[_0x6865('0x1b')]();});}};}function handleEntityNotFound(_0x178b42,_0x1af812){return function(_0xfc7948){if(!_0xfc7948){_0x178b42[_0x6865('0x19')](0x194);}return _0xfc7948;};}function handleError(_0x1030b9,_0x272b1d){_0x272b1d=_0x272b1d||0x1f4;return function(_0x4a1894){logger[_0x6865('0x26')](_0x4a1894[_0x6865('0x27')]);if(_0x4a1894[_0x6865('0x28')]){delete _0x4a1894['name'];}_0x1030b9[_0x6865('0x1a')](_0x272b1d)[_0x6865('0x29')](_0x4a1894);};}exports['index']=function(_0x3278d0,_0x1e8dd4){var _0x365dde={},_0x291ada={},_0x265601={'count':0x0,'rows':[]};var _0x5eee89=_['map'](db[_0x6865('0x2a')]['rawAttributes'],function(_0x3b30e9){return{'name':_0x3b30e9[_0x6865('0x2b')],'type':_0x3b30e9['type'][_0x6865('0x2c')]};});_0x291ada['model']=_[_0x6865('0x2d')](_0x5eee89,_0x6865('0x28'));_0x291ada[_0x6865('0x2e')]=_[_0x6865('0x2f')](_0x3278d0[_0x6865('0x2e')]);_0x291ada[_0x6865('0x30')]=_['intersection'](_0x291ada['model'],_0x291ada[_0x6865('0x2e')]);_0x365dde[_0x6865('0x31')]=_[_0x6865('0x32')](_0x291ada[_0x6865('0x33')],qs[_0x6865('0x34')](_0x3278d0[_0x6865('0x2e')]['fields']));_0x365dde[_0x6865('0x31')]=_0x365dde[_0x6865('0x31')][_0x6865('0x35')]?_0x365dde[_0x6865('0x31')]:_0x291ada[_0x6865('0x33')];if(!_0x3278d0[_0x6865('0x2e')]['hasOwnProperty'](_0x6865('0x36'))){_0x365dde[_0x6865('0x1f')]=qs['limit'](_0x3278d0['query'][_0x6865('0x1f')]);_0x365dde[_0x6865('0x1d')]=qs[_0x6865('0x1d')](_0x3278d0[_0x6865('0x2e')][_0x6865('0x1d')]);}_0x365dde['order']=qs[_0x6865('0x37')](_0x3278d0[_0x6865('0x2e')][_0x6865('0x37')]);_0x365dde[_0x6865('0x38')]=qs['filters'](_[_0x6865('0x39')](_0x3278d0[_0x6865('0x2e')],_0x291ada[_0x6865('0x30')]),_0x5eee89);if(_0x3278d0[_0x6865('0x2e')][_0x6865('0x3a')]){_0x365dde[_0x6865('0x38')]=_[_0x6865('0x3b')](_0x365dde['where'],{'$or':_[_0x6865('0x2d')](_0x5eee89,function(_0x34dda1){if(_0x34dda1[_0x6865('0x3c')]!=='VIRTUAL'){var _0xfe47e0={};_0xfe47e0[_0x34dda1['name']]={'$like':'%'+_0x3278d0[_0x6865('0x2e')]['filter']+'%'};return _0xfe47e0;}})});}_0x365dde=_[_0x6865('0x3b')]({},_0x365dde,_0x3278d0[_0x6865('0x3d')]);var _0x3c7ab4={'where':_0x365dde[_0x6865('0x38')]};return db['MailSubstatus'][_0x6865('0x20')](_0x3c7ab4)[_0x6865('0x25')](function(_0x2e734c){_0x265601[_0x6865('0x20')]=_0x2e734c;if(_0x3278d0[_0x6865('0x2e')][_0x6865('0x3e')]){_0x365dde['include']=[{'all':!![]}];}return db[_0x6865('0x2a')][_0x6865('0x3f')](_0x365dde);})['then'](function(_0x368b58){_0x265601[_0x6865('0x40')]=_0x368b58;return _0x265601;})[_0x6865('0x25')](respondWithFilteredResult(_0x1e8dd4,_0x365dde))[_0x6865('0x41')](handleError(_0x1e8dd4,null));};exports['show']=function(_0x3497f1,_0x24ab03){var _0x1b41d9={'raw':!![],'where':{'id':_0x3497f1['params']['id']}},_0x217140={};_0x217140[_0x6865('0x33')]=_[_0x6865('0x2f')](db[_0x6865('0x2a')][_0x6865('0x42')]);_0x217140[_0x6865('0x2e')]=_[_0x6865('0x2f')](_0x3497f1[_0x6865('0x2e')]);_0x217140[_0x6865('0x30')]=_[_0x6865('0x32')](_0x217140['model'],_0x217140[_0x6865('0x2e')]);_0x1b41d9[_0x6865('0x31')]=_[_0x6865('0x32')](_0x217140[_0x6865('0x33')],qs[_0x6865('0x34')](_0x3497f1[_0x6865('0x2e')][_0x6865('0x34')]));_0x1b41d9[_0x6865('0x31')]=_0x1b41d9[_0x6865('0x31')][_0x6865('0x35')]?_0x1b41d9[_0x6865('0x31')]:_0x217140[_0x6865('0x33')];if(_0x3497f1[_0x6865('0x2e')]['includeAll']){_0x1b41d9['include']=[{'all':!![]}];}_0x1b41d9=_['merge']({},_0x1b41d9,_0x3497f1['options']);return db[_0x6865('0x2a')][_0x6865('0x43')](_0x1b41d9)[_0x6865('0x25')](handleEntityNotFound(_0x24ab03,null))['then'](respondWithResult(_0x24ab03,null))['catch'](handleError(_0x24ab03,null));};exports[_0x6865('0x44')]=function(_0x5ae508,_0x30db9f){return db[_0x6865('0x2a')][_0x6865('0x44')](_0x5ae508[_0x6865('0x45')],{})[_0x6865('0x25')](respondWithResult(_0x30db9f,0xc9))[_0x6865('0x41')](handleError(_0x30db9f,null));};exports['update']=function(_0x58aec5,_0x4de6e2){if(_0x58aec5[_0x6865('0x45')]['id']){delete _0x58aec5[_0x6865('0x45')]['id'];}return db[_0x6865('0x2a')][_0x6865('0x43')]({'where':{'id':_0x58aec5[_0x6865('0x46')]['id']}})[_0x6865('0x25')](handleEntityNotFound(_0x4de6e2,null))[_0x6865('0x25')](saveUpdates(_0x58aec5[_0x6865('0x45')],null))[_0x6865('0x25')](respondWithResult(_0x4de6e2,null))[_0x6865('0x41')](handleError(_0x4de6e2,null));};exports[_0x6865('0x47')]=function(_0x4006c4,_0x19bb18){return db[_0x6865('0x2a')][_0x6865('0x43')]({'where':{'id':_0x4006c4[_0x6865('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bb18,null))[_0x6865('0x25')](removeEntity(_0x19bb18,null))[_0x6865('0x41')](handleError(_0x19bb18,null));};exports[_0x6865('0x48')]=function(_0x39f04d,_0x382b81){return db[_0x6865('0x2a')][_0x6865('0x48')]()[_0x6865('0x25')](respondWithResult(_0x382b81,null))['catch'](handleError(_0x382b81,null));}; \ No newline at end of file +var _0x067d=['describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','stack','name','index','map','MailSubstatus','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','update'];(function(_0x2912f0,_0x208e8d){var _0x33b9ca=function(_0x422756){while(--_0x422756){_0x2912f0['push'](_0x2912f0['shift']());}};_0x33b9ca(++_0x208e8d);}(_0x067d,0x8d));var _0xd067=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x067d[_0x57cb4f];return _0x29bb45;};'use strict';var emlformat=require(_0xd067('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd067('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd067('0x2'));var moment=require(_0xd067('0x3'));var BPromise=require(_0xd067('0x4'));var Mustache=require(_0xd067('0x5'));var util=require(_0xd067('0x6'));var path=require(_0xd067('0x7'));var sox=require(_0xd067('0x8'));var csv=require('to-csv');var ejs=require(_0xd067('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd067('0xa'));var squel=require(_0xd067('0xb'));var crypto=require(_0xd067('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd067('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd067('0xe'));var Redis=require(_0xd067('0xf'));var authService=require(_0xd067('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd067('0x11'));var logger=require('../../config/logger')(_0xd067('0x12'));var utils=require(_0xd067('0x13'));var config=require(_0xd067('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd067('0x15'))['db'];function respondWithStatusCode(_0x27b1e5,_0x3db8de){_0x3db8de=_0x3db8de||0xcc;return function(_0x310543){if(_0x310543){return _0x27b1e5[_0xd067('0x16')](_0x3db8de);}return _0x27b1e5[_0xd067('0x17')](_0x3db8de)['end']();};}function respondWithResult(_0x2c6ce6,_0x4ce515){_0x4ce515=_0x4ce515||0xc8;return function(_0x302fb4){if(_0x302fb4){return _0x2c6ce6[_0xd067('0x17')](_0x4ce515)[_0xd067('0x18')](_0x302fb4);}};}function respondWithFilteredResult(_0x1c18be,_0x596a75){return function(_0x257899){if(_0x257899){var _0xd8800d=typeof _0x596a75[_0xd067('0x19')]===_0xd067('0x1a')&&typeof _0x596a75[_0xd067('0x1b')]===_0xd067('0x1a');var _0x41af79=_0x257899[_0xd067('0x1c')];var _0x35c7f0=_0xd8800d?0x0:_0x596a75[_0xd067('0x19')];var _0x422e99=_0xd8800d?_0x257899[_0xd067('0x1c')]:_0x596a75[_0xd067('0x19')]+_0x596a75[_0xd067('0x1b')];var _0x665c1b;if(_0x422e99>=_0x41af79){_0x422e99=_0x41af79;_0x665c1b=0xc8;}else{_0x665c1b=0xce;}_0x1c18be[_0xd067('0x17')](_0x665c1b);return _0x1c18be[_0xd067('0x1d')](_0xd067('0x1e'),_0x35c7f0+'-'+_0x422e99+'/'+_0x41af79)[_0xd067('0x18')](_0x257899);}return null;};}function patchUpdates(_0x4c0c7d){return function(_0x31c491){try{jsonpatch[_0xd067('0x1f')](_0x31c491,_0x4c0c7d,!![]);}catch(_0x157a4b){return BPromise['reject'](_0x157a4b);}return _0x31c491[_0xd067('0x20')]();};}function saveUpdates(_0x2429d3,_0x4b8db6){return function(_0x47005b){if(_0x47005b){return _0x47005b['update'](_0x2429d3)[_0xd067('0x21')](function(_0x5f1a22){return _0x5f1a22;});}return null;};}function removeEntity(_0x2d869b,_0x27b652){return function(_0x4605ff){if(_0x4605ff){return _0x4605ff[_0xd067('0x22')]()[_0xd067('0x21')](function(){_0x2d869b[_0xd067('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277573,_0x47fe59){return function(_0x3e95c1){if(!_0x3e95c1){_0x277573['sendStatus'](0x194);}return _0x3e95c1;};}function handleError(_0x1fb617,_0x4974b6){_0x4974b6=_0x4974b6||0x1f4;return function(_0x231481){logger['error'](_0x231481[_0xd067('0x23')]);if(_0x231481['name']){delete _0x231481[_0xd067('0x24')];}_0x1fb617[_0xd067('0x17')](_0x4974b6)['send'](_0x231481);};}exports[_0xd067('0x25')]=function(_0x1d89a2,_0xb593ec){var _0x4e9a5c={},_0x4e53ce={},_0x5d5817={'count':0x0,'rows':[]};var _0x286900=_[_0xd067('0x26')](db[_0xd067('0x27')]['rawAttributes'],function(_0x3f5f05){return{'name':_0x3f5f05['fieldName'],'type':_0x3f5f05[_0xd067('0x28')][_0xd067('0x29')]};});_0x4e53ce[_0xd067('0x2a')]=_[_0xd067('0x26')](_0x286900,'name');_0x4e53ce[_0xd067('0x2b')]=_['keys'](_0x1d89a2[_0xd067('0x2b')]);_0x4e53ce['filters']=_[_0xd067('0x2c')](_0x4e53ce[_0xd067('0x2a')],_0x4e53ce['query']);_0x4e9a5c['attributes']=_[_0xd067('0x2c')](_0x4e53ce['model'],qs[_0xd067('0x2d')](_0x1d89a2[_0xd067('0x2b')][_0xd067('0x2d')]));_0x4e9a5c['attributes']=_0x4e9a5c[_0xd067('0x2e')][_0xd067('0x2f')]?_0x4e9a5c[_0xd067('0x2e')]:_0x4e53ce['model'];if(!_0x1d89a2[_0xd067('0x2b')][_0xd067('0x30')]('nolimit')){_0x4e9a5c[_0xd067('0x1b')]=qs['limit'](_0x1d89a2[_0xd067('0x2b')][_0xd067('0x1b')]);_0x4e9a5c[_0xd067('0x19')]=qs[_0xd067('0x19')](_0x1d89a2[_0xd067('0x2b')][_0xd067('0x19')]);}_0x4e9a5c['order']=qs['sort'](_0x1d89a2[_0xd067('0x2b')][_0xd067('0x31')]);_0x4e9a5c['where']=qs[_0xd067('0x32')](_[_0xd067('0x33')](_0x1d89a2[_0xd067('0x2b')],_0x4e53ce['filters']),_0x286900);if(_0x1d89a2['query']['filter']){_0x4e9a5c[_0xd067('0x34')]=_[_0xd067('0x35')](_0x4e9a5c[_0xd067('0x34')],{'$or':_[_0xd067('0x26')](_0x286900,function(_0xb85433){if(_0xb85433[_0xd067('0x28')]!=='VIRTUAL'){var _0x4fccc3={};_0x4fccc3[_0xb85433[_0xd067('0x24')]]={'$like':'%'+_0x1d89a2[_0xd067('0x2b')][_0xd067('0x36')]+'%'};return _0x4fccc3;}})});}_0x4e9a5c=_[_0xd067('0x35')]({},_0x4e9a5c,_0x1d89a2[_0xd067('0x37')]);var _0x48c098={'where':_0x4e9a5c[_0xd067('0x34')]};return db['MailSubstatus'][_0xd067('0x1c')](_0x48c098)[_0xd067('0x21')](function(_0x1b2ba1){_0x5d5817[_0xd067('0x1c')]=_0x1b2ba1;if(_0x1d89a2[_0xd067('0x2b')][_0xd067('0x38')]){_0x4e9a5c['include']=[{'all':!![]}];}return db[_0xd067('0x27')][_0xd067('0x39')](_0x4e9a5c);})[_0xd067('0x21')](function(_0x332616){_0x5d5817[_0xd067('0x3a')]=_0x332616;return _0x5d5817;})[_0xd067('0x21')](respondWithFilteredResult(_0xb593ec,_0x4e9a5c))[_0xd067('0x3b')](handleError(_0xb593ec,null));};exports[_0xd067('0x3c')]=function(_0x55ca63,_0xa610bc){var _0x484d46={'raw':!![],'where':{'id':_0x55ca63[_0xd067('0x3d')]['id']}},_0xbb0e26={};_0xbb0e26[_0xd067('0x2a')]=_[_0xd067('0x3e')](db['MailSubstatus'][_0xd067('0x3f')]);_0xbb0e26[_0xd067('0x2b')]=_['keys'](_0x55ca63[_0xd067('0x2b')]);_0xbb0e26[_0xd067('0x32')]=_[_0xd067('0x2c')](_0xbb0e26[_0xd067('0x2a')],_0xbb0e26[_0xd067('0x2b')]);_0x484d46['attributes']=_[_0xd067('0x2c')](_0xbb0e26[_0xd067('0x2a')],qs[_0xd067('0x2d')](_0x55ca63[_0xd067('0x2b')]['fields']));_0x484d46[_0xd067('0x2e')]=_0x484d46[_0xd067('0x2e')][_0xd067('0x2f')]?_0x484d46[_0xd067('0x2e')]:_0xbb0e26[_0xd067('0x2a')];if(_0x55ca63[_0xd067('0x2b')]['includeAll']){_0x484d46[_0xd067('0x40')]=[{'all':!![]}];}_0x484d46=_['merge']({},_0x484d46,_0x55ca63[_0xd067('0x37')]);return db['MailSubstatus'][_0xd067('0x41')](_0x484d46)['then'](handleEntityNotFound(_0xa610bc,null))['then'](respondWithResult(_0xa610bc,null))['catch'](handleError(_0xa610bc,null));};exports[_0xd067('0x42')]=function(_0x2eef72,_0x52b2d0){return db['MailSubstatus'][_0xd067('0x42')](_0x2eef72[_0xd067('0x43')],{})[_0xd067('0x21')](respondWithResult(_0x52b2d0,0xc9))['catch'](handleError(_0x52b2d0,null));};exports[_0xd067('0x44')]=function(_0x5ffbd6,_0x4629af){if(_0x5ffbd6[_0xd067('0x43')]['id']){delete _0x5ffbd6[_0xd067('0x43')]['id'];}return db[_0xd067('0x27')][_0xd067('0x41')]({'where':{'id':_0x5ffbd6[_0xd067('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4629af,null))[_0xd067('0x21')](saveUpdates(_0x5ffbd6[_0xd067('0x43')],null))[_0xd067('0x21')](respondWithResult(_0x4629af,null))[_0xd067('0x3b')](handleError(_0x4629af,null));};exports[_0xd067('0x22')]=function(_0x1ec7d8,_0x9d930c){return db[_0xd067('0x27')][_0xd067('0x41')]({'where':{'id':_0x1ec7d8[_0xd067('0x3d')]['id']}})[_0xd067('0x21')](handleEntityNotFound(_0x9d930c,null))[_0xd067('0x21')](removeEntity(_0x9d930c,null))[_0xd067('0x3b')](handleError(_0x9d930c,null));};exports[_0xd067('0x45')]=function(_0x2f2435,_0x2a16aa){return db['MailSubstatus'][_0xd067('0x45')]()['then'](respondWithResult(_0x2a16aa,null))['catch'](handleError(_0x2a16aa,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2cdcc19..6a81131 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4588=['update','emit','hasOwnProperty','hook','exports','events','MailSubstatus','setMaxListeners'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x4588,0x14d));var _0x8458=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x4588[_0x48ec91];return _0x22766c;};'use strict';var EventEmitter=require(_0x8458('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x8458('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8458('0x2')](0x0);var events={'afterUpdate':_0x8458('0x3')};function emitEvent(_0x23fe7b){return function(_0x290098,_0x2b6860,_0x544aea){MailSubstatusEvents[_0x8458('0x4')](_0x23fe7b+':'+_0x290098['id'],_0x290098);MailSubstatusEvents[_0x8458('0x4')](_0x23fe7b,_0x290098);_0x544aea(null);};}for(var e in events){if(events[_0x8458('0x5')](e)){var event=events[e];MailSubstatus[_0x8458('0x6')](e,emitEvent(event));}}module[_0x8458('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xb50f=['../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x2c5d95,_0x1dff74){var _0x58bbfb=function(_0x2003dd){while(--_0x2003dd){_0x2c5d95['push'](_0x2c5d95['shift']());}};_0x58bbfb(++_0x1dff74);}(_0xb50f,0x177));var _0xfb50=function(_0x4628a1,_0x55ff29){_0x4628a1=_0x4628a1-0x0;var _0x492347=_0xb50f[_0x4628a1];return _0x492347;};'use strict';var EventEmitter=require(_0xfb50('0x0'));var MailSubstatus=require(_0xfb50('0x1'))['db'][_0xfb50('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xfb50('0x3')};function emitEvent(_0x48bc33){return function(_0x5b5511,_0x335765,_0x260a0c){MailSubstatusEvents['emit'](_0x48bc33+':'+_0x5b5511['id'],_0x5b5511);MailSubstatusEvents[_0xfb50('0x4')](_0x48bc33,_0x5b5511);_0x260a0c(null);};}for(var e in events){if(events[_0xfb50('0x5')](e)){var event=events[e];MailSubstatus[_0xfb50('0x6')](e,emitEvent(event));}}module[_0xfb50('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 9a7dff5..ee303d7 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 _0x5ff5=['_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus'];(function(_0x3db887,_0x59f92d){var _0x59d5c3=function(_0x56df25){while(--_0x56df25){_0x3db887['push'](_0x3db887['shift']());}};_0x59d5c3(++_0x59f92d);}(_0x5ff5,0xfb));var _0x55ff=function(_0x374f4c,_0x1e3de6){_0x374f4c=_0x374f4c-0x0;var _0x4af8d5=_0x5ff5[_0x374f4c];return _0x4af8d5;};'use strict';var attributes=require(_0x55ff('0x0'));module[_0x55ff('0x1')]=function(_0x5ccaa8){var _0x1f73af=_0x5ccaa8[_0x55ff('0x2')];return _0x5ccaa8[_0x55ff('0x3')](_0x55ff('0x4'),attributes,{'tableName':_0x55ff('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x558d55,_0x5c2424,_0x3e50ee){return _0x1f73af[_0x55ff('0x6')][_0x55ff('0x7')]({'value':_0x558d55['name']},{'where':{'field':_0x55ff('0x8'),'value':_0x558d55[_0x55ff('0x9')][_0x55ff('0xa')]}})[_0x55ff('0xb')](function(){_0x3e50ee();})[_0x55ff('0xc')](function(_0x3cef42){_0x3e50ee(_0x3cef42);});}}});}; \ No newline at end of file +var _0x7f23=['Condition','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses'];(function(_0x396248,_0x5b7ff2){var _0x568f77=function(_0x4a5108){while(--_0x4a5108){_0x396248['push'](_0x396248['shift']());}};_0x568f77(++_0x5b7ff2);}(_0x7f23,0x1ef));var _0x37f2=function(_0x15fd55,_0x1532e0){_0x15fd55=_0x15fd55-0x0;var _0x3c208a=_0x7f23[_0x15fd55];return _0x3c208a;};'use strict';var attributes=require(_0x37f2('0x0'));module[_0x37f2('0x1')]=function(_0xa26812){var _0x3ed2f7=_0xa26812[_0x37f2('0x2')];return _0xa26812['define'](_0x37f2('0x3'),attributes,{'tableName':_0x37f2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x25da16,_0x427bda,_0x3f8316){return _0x3ed2f7[_0x37f2('0x5')]['update']({'value':_0x25da16[_0x37f2('0x6')]},{'where':{'field':_0x37f2('0x7'),'value':_0x25da16['_previousDataValues']['name']}})[_0x37f2('0x8')](function(){_0x3f8316();})[_0x37f2('0x9')](function(_0x4da98a){_0x3f8316(_0x4da98a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index fc19756..d5c22ac 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 _0xb0bc=['MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x232cb8,_0x201667){var _0x20d3a2=function(_0x1013dc){while(--_0x1013dc){_0x232cb8['push'](_0x232cb8['shift']());}};_0x20d3a2(++_0x201667);}(_0xb0bc,0x156));var _0xcb0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb0bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcb0b('0x0'));var util=require(_0xcb0b('0x1'));var moment=require(_0xcb0b('0x2'));var BPromise=require(_0xcb0b('0x3'));var rs=require(_0xcb0b('0x4'));var fs=require('fs');var Redis=require(_0xcb0b('0x5'));var db=require(_0xcb0b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb0b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcb0b('0x8'));var client=jayson[_0xcb0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x227533,_0x1a0fa3,_0x35a726){return new BPromise(function(_0x3875d6,_0x39cb70){return client[_0xcb0b('0xa')](_0x227533,_0x35a726)[_0xcb0b('0xb')](function(_0x24e5dd){logger[_0xcb0b('0xc')](_0xcb0b('0xd'),_0x1a0fa3,_0xcb0b('0xe'));logger['debug'](_0xcb0b('0xf'),_0x1a0fa3,_0xcb0b('0xe'),JSON[_0xcb0b('0x10')](_0x24e5dd));if(_0x24e5dd[_0xcb0b('0x11')]){if(_0x24e5dd[_0xcb0b('0x11')][_0xcb0b('0x12')]===0x1f4){logger[_0xcb0b('0x11')](_0xcb0b('0xd'),_0x1a0fa3,_0x24e5dd[_0xcb0b('0x11')][_0xcb0b('0x13')]);return _0x39cb70(_0x24e5dd[_0xcb0b('0x11')]['message']);}logger[_0xcb0b('0x11')](_0xcb0b('0xd'),_0x1a0fa3,_0x24e5dd[_0xcb0b('0x11')][_0xcb0b('0x13')]);return _0x3875d6(_0x24e5dd[_0xcb0b('0x11')][_0xcb0b('0x13')]);}else{logger['info'](_0xcb0b('0xd'),_0x1a0fa3,_0xcb0b('0xe'));_0x3875d6(_0x24e5dd[_0xcb0b('0x14')][_0xcb0b('0x13')]);}})['catch'](function(_0x46adc1){logger[_0xcb0b('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1a0fa3,_0x46adc1);_0x39cb70(_0x46adc1);});});} \ No newline at end of file +var _0xc20c=['lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc20c,0x73));var _0xcc20=function(_0x4d8666,_0x2ff19d){_0x4d8666=_0x4d8666-0x0;var _0x37175b=_0xc20c[_0x4d8666];return _0x37175b;};'use strict';var _=require(_0xcc20('0x0'));var util=require('util');var moment=require(_0xcc20('0x1'));var BPromise=require(_0xcc20('0x2'));var rs=require(_0xcc20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc20('0x4'));var logger=require(_0xcc20('0x5'))(_0xcc20('0x6'));var config=require(_0xcc20('0x7'));var jayson=require(_0xcc20('0x8'));var client=jayson[_0xcc20('0x9')][_0xcc20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x132d4a,_0x561f8e,_0x38b650){return new BPromise(function(_0xb45670,_0x4ea38d){return client[_0xcc20('0xb')](_0x132d4a,_0x38b650)[_0xcc20('0xc')](function(_0x48bcbd){logger['info'](_0xcc20('0xd'),_0x561f8e,_0xcc20('0xe'));logger[_0xcc20('0xf')](_0xcc20('0x10'),_0x561f8e,_0xcc20('0xe'),JSON['stringify'](_0x48bcbd));if(_0x48bcbd['error']){if(_0x48bcbd[_0xcc20('0x11')][_0xcc20('0x12')]===0x1f4){logger[_0xcc20('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x561f8e,_0x48bcbd['error'][_0xcc20('0x13')]);return _0x4ea38d(_0x48bcbd[_0xcc20('0x11')][_0xcc20('0x13')]);}logger[_0xcc20('0x11')](_0xcc20('0xd'),_0x561f8e,_0x48bcbd[_0xcc20('0x11')][_0xcc20('0x13')]);return _0xb45670(_0x48bcbd['error'][_0xcc20('0x13')]);}else{logger[_0xcc20('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x561f8e,'request\x20sent');_0xb45670(_0x48bcbd[_0xcc20('0x15')][_0xcc20('0x13')]);}})[_0xcc20('0x16')](function(_0x5a7353){logger['error'](_0xcc20('0xd'),_0x561f8e,_0x5a7353);_0x4ea38d(_0x5a7353);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b73db5c..6787d9b 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 _0x5129=['../../config/environment','./mailTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x349248,_0x5eded1){var _0x39687f=function(_0x5426e6){while(--_0x5426e6){_0x349248['push'](_0x349248['shift']());}};_0x39687f(++_0x5eded1);}(_0x5129,0x10c));var _0x9512=function(_0xed045e,_0xcd67c1){_0xed045e=_0xed045e-0x0;var _0x35862a=_0x5129[_0xed045e];return _0x35862a;};'use strict';var multer=require(_0x9512('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9512('0x1'));var express=require('express');var router=express[_0x9512('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9512('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9512('0x4'));var controller=require(_0x9512('0x5'));router['get']('/',auth[_0x9512('0x6')](),controller[_0x9512('0x7')]);router['get'](_0x9512('0x8'),auth['isAuthenticated'](),controller[_0x9512('0x9')]);router[_0x9512('0xa')](_0x9512('0xb'),auth[_0x9512('0x6')](),controller[_0x9512('0xc')]);router['post']('/',auth[_0x9512('0x6')](),controller[_0x9512('0xd')]);router['put'](_0x9512('0xb'),auth[_0x9512('0x6')](),controller['update']);router[_0x9512('0xe')](_0x9512('0xb'),auth[_0x9512('0x6')](),controller[_0x9512('0xf')]);module[_0x9512('0x10')]=router; \ No newline at end of file +var _0x2282=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer'];(function(_0x12e1c4,_0x157f1b){var _0x59e7bb=function(_0x15cb84){while(--_0x15cb84){_0x12e1c4['push'](_0x12e1c4['shift']());}};_0x59e7bb(++_0x157f1b);}(_0x2282,0xf6));var _0x2228=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0x2282[_0x4733d3];return _0x1b9a44;};'use strict';var multer=require(_0x2228('0x0'));var util=require('util');var path=require(_0x2228('0x1'));var timeout=require(_0x2228('0x2'));var express=require(_0x2228('0x3'));var router=express[_0x2228('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2228('0x5'));var interaction=require(_0x2228('0x6'));var config=require('../../config/environment');var controller=require(_0x2228('0x7'));router[_0x2228('0x8')]('/',auth[_0x2228('0x9')](),controller[_0x2228('0xa')]);router['get'](_0x2228('0xb'),auth[_0x2228('0x9')](),controller[_0x2228('0xc')]);router[_0x2228('0x8')](_0x2228('0xd'),auth[_0x2228('0x9')](),controller['show']);router[_0x2228('0xe')]('/',auth[_0x2228('0x9')](),controller['create']);router[_0x2228('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2228('0x10')](_0x2228('0xd'),auth[_0x2228('0x9')](),controller[_0x2228('0x11')]);module[_0x2228('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 8c734c9..e701692 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x482e9b,_0x20951d){var _0x2a3a07=function(_0x2f55ce){while(--_0x2f55ce){_0x482e9b['push'](_0x482e9b['shift']());}};_0x2a3a07(++_0x20951d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0xcb91[_0x136a0d];return _0x212ea5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x008c,0x188));var _0xc008=function(_0x36211c,_0x178508){_0x36211c=_0x36211c-0x0;var _0xd2487b=_0x008c[_0x36211c];return _0xd2487b;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5a19651..d14688e 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 _0xc68e=['path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MailTransferReport','includeAll','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x558e5a,_0x5e9a85){var _0x717a46=function(_0x786d8){while(--_0x786d8){_0x558e5a['push'](_0x558e5a['shift']());}};_0x717a46(++_0x5e9a85);}(_0xc68e,0x9b));var _0xec68=function(_0x3a0fc0,_0x2a63b7){_0x3a0fc0=_0x3a0fc0-0x0;var _0x544b5a=_0xc68e[_0x3a0fc0];return _0x544b5a;};'use strict';var emlformat=require(_0xec68('0x0'));var rimraf=require(_0xec68('0x1'));var zipdir=require(_0xec68('0x2'));var jsonpatch=require(_0xec68('0x3'));var rp=require(_0xec68('0x4'));var moment=require(_0xec68('0x5'));var BPromise=require(_0xec68('0x6'));var Mustache=require(_0xec68('0x7'));var util=require(_0xec68('0x8'));var path=require(_0xec68('0x9'));var sox=require(_0xec68('0xa'));var csv=require('to-csv');var ejs=require(_0xec68('0xb'));var fs=require('fs');var fs_extra=require(_0xec68('0xc'));var _=require(_0xec68('0xd'));var squel=require('squel');var crypto=require(_0xec68('0xe'));var jsforce=require(_0xec68('0xf'));var deskjs=require(_0xec68('0x10'));var toCsv=require(_0xec68('0x11'));var querystring=require(_0xec68('0x12'));var Papa=require(_0xec68('0x13'));var Redis=require(_0xec68('0x14'));var authService=require(_0xec68('0x15'));var qs=require(_0xec68('0x16'));var as=require(_0xec68('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec68('0x18'))(_0xec68('0x19'));var utils=require(_0xec68('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xec68('0x1b'));var db=require(_0xec68('0x1c'))['db'];function respondWithStatusCode(_0x40e6b4,_0x4456a2){_0x4456a2=_0x4456a2||0xcc;return function(_0x535c26){if(_0x535c26){return _0x40e6b4[_0xec68('0x1d')](_0x4456a2);}return _0x40e6b4[_0xec68('0x1e')](_0x4456a2)[_0xec68('0x1f')]();};}function respondWithResult(_0x4b375b,_0x205e4a){_0x205e4a=_0x205e4a||0xc8;return function(_0x5da32a){if(_0x5da32a){return _0x4b375b[_0xec68('0x1e')](_0x205e4a)[_0xec68('0x20')](_0x5da32a);}};}function respondWithFilteredResult(_0x2a8f9b,_0xe6d32b){return function(_0x306075){if(_0x306075){var _0x1a2978=typeof _0xe6d32b[_0xec68('0x21')]==='undefined'&&typeof _0xe6d32b[_0xec68('0x22')]==='undefined';var _0x13e9fd=_0x306075[_0xec68('0x23')];var _0x1aa227=_0x1a2978?0x0:_0xe6d32b['offset'];var _0x3b631d=_0x1a2978?_0x306075[_0xec68('0x23')]:_0xe6d32b[_0xec68('0x21')]+_0xe6d32b[_0xec68('0x22')];var _0x55516e;if(_0x3b631d>=_0x13e9fd){_0x3b631d=_0x13e9fd;_0x55516e=0xc8;}else{_0x55516e=0xce;}_0x2a8f9b[_0xec68('0x1e')](_0x55516e);return _0x2a8f9b[_0xec68('0x24')](_0xec68('0x25'),_0x1aa227+'-'+_0x3b631d+'/'+_0x13e9fd)['json'](_0x306075);}return null;};}function patchUpdates(_0x46ca3e){return function(_0x4ce677){try{jsonpatch[_0xec68('0x26')](_0x4ce677,_0x46ca3e,!![]);}catch(_0x4f3196){return BPromise[_0xec68('0x27')](_0x4f3196);}return _0x4ce677[_0xec68('0x28')]();};}function saveUpdates(_0x78c121,_0x3d90f8){return function(_0x100632){if(_0x100632){return _0x100632['update'](_0x78c121)['then'](function(_0x1f3599){return _0x1f3599;});}return null;};}function removeEntity(_0x241af1,_0x339298){return function(_0x1896a0){if(_0x1896a0){return _0x1896a0['destroy']()[_0xec68('0x29')](function(){_0x241af1[_0xec68('0x1e')](0xcc)[_0xec68('0x1f')]();});}};}function handleEntityNotFound(_0x2f43c0,_0x1c4fc6){return function(_0x2e7f07){if(!_0x2e7f07){_0x2f43c0[_0xec68('0x1d')](0x194);}return _0x2e7f07;};}function handleError(_0x2d5265,_0x27a28b){_0x27a28b=_0x27a28b||0x1f4;return function(_0x2c1a88){logger[_0xec68('0x2a')](_0x2c1a88['stack']);if(_0x2c1a88[_0xec68('0x2b')]){delete _0x2c1a88[_0xec68('0x2b')];}_0x2d5265['status'](_0x27a28b)[_0xec68('0x2c')](_0x2c1a88);};}exports[_0xec68('0x2d')]=function(_0x22cecc,_0x45866d){var _0x2e2456={},_0x4e9847={},_0x2666a1={'count':0x0,'rows':[]};var _0x2b03c9=_['map'](db['MailTransferReport'][_0xec68('0x2e')],function(_0x424dc4){return{'name':_0x424dc4[_0xec68('0x2f')],'type':_0x424dc4['type'][_0xec68('0x30')]};});_0x4e9847['model']=_[_0xec68('0x31')](_0x2b03c9,_0xec68('0x2b'));_0x4e9847[_0xec68('0x32')]=_['keys'](_0x22cecc['query']);_0x4e9847[_0xec68('0x33')]=_[_0xec68('0x34')](_0x4e9847[_0xec68('0x35')],_0x4e9847[_0xec68('0x32')]);_0x2e2456[_0xec68('0x36')]=_[_0xec68('0x34')](_0x4e9847[_0xec68('0x35')],qs[_0xec68('0x37')](_0x22cecc[_0xec68('0x32')][_0xec68('0x37')]));_0x2e2456[_0xec68('0x36')]=_0x2e2456[_0xec68('0x36')][_0xec68('0x38')]?_0x2e2456[_0xec68('0x36')]:_0x4e9847[_0xec68('0x35')];if(!_0x22cecc[_0xec68('0x32')][_0xec68('0x39')](_0xec68('0x3a'))){_0x2e2456['limit']=qs[_0xec68('0x22')](_0x22cecc['query'][_0xec68('0x22')]);_0x2e2456['offset']=qs[_0xec68('0x21')](_0x22cecc[_0xec68('0x32')]['offset']);}_0x2e2456[_0xec68('0x3b')]=qs['sort'](_0x22cecc['query'][_0xec68('0x3c')]);_0x2e2456[_0xec68('0x3d')]=qs['filters'](_[_0xec68('0x3e')](_0x22cecc[_0xec68('0x32')],_0x4e9847[_0xec68('0x33')]),_0x2b03c9);if(_0x22cecc[_0xec68('0x32')][_0xec68('0x3f')]){_0x2e2456['where']=_[_0xec68('0x40')](_0x2e2456[_0xec68('0x3d')],{'$or':_[_0xec68('0x31')](_0x2b03c9,function(_0x7b8570){if(_0x7b8570[_0xec68('0x41')]!==_0xec68('0x42')){var _0x5a4d56={};_0x5a4d56[_0x7b8570[_0xec68('0x2b')]]={'$like':'%'+_0x22cecc[_0xec68('0x32')][_0xec68('0x3f')]+'%'};return _0x5a4d56;}})});}_0x2e2456=_[_0xec68('0x40')]({},_0x2e2456,_0x22cecc[_0xec68('0x43')]);var _0x3e966f={'where':_0x2e2456[_0xec68('0x3d')]};return db[_0xec68('0x44')][_0xec68('0x23')](_0x3e966f)[_0xec68('0x29')](function(_0x4ecd0a){_0x2666a1[_0xec68('0x23')]=_0x4ecd0a;if(_0x22cecc[_0xec68('0x32')][_0xec68('0x45')]){_0x2e2456['include']=[{'all':!![]}];}return db[_0xec68('0x44')][_0xec68('0x46')](_0x2e2456);})[_0xec68('0x29')](function(_0x14a196){_0x2666a1[_0xec68('0x47')]=_0x14a196;return _0x2666a1;})[_0xec68('0x29')](respondWithFilteredResult(_0x45866d,_0x2e2456))[_0xec68('0x48')](handleError(_0x45866d,null));};exports[_0xec68('0x49')]=function(_0x17fe5c,_0x12de20){var _0x2f812e={'raw':!![],'where':{'id':_0x17fe5c[_0xec68('0x4a')]['id']}},_0x998de4={};_0x998de4[_0xec68('0x35')]=_[_0xec68('0x4b')](db[_0xec68('0x44')]['rawAttributes']);_0x998de4[_0xec68('0x32')]=_['keys'](_0x17fe5c[_0xec68('0x32')]);_0x998de4[_0xec68('0x33')]=_[_0xec68('0x34')](_0x998de4[_0xec68('0x35')],_0x998de4[_0xec68('0x32')]);_0x2f812e['attributes']=_[_0xec68('0x34')](_0x998de4[_0xec68('0x35')],qs[_0xec68('0x37')](_0x17fe5c[_0xec68('0x32')][_0xec68('0x37')]));_0x2f812e[_0xec68('0x36')]=_0x2f812e[_0xec68('0x36')][_0xec68('0x38')]?_0x2f812e[_0xec68('0x36')]:_0x998de4['model'];if(_0x17fe5c[_0xec68('0x32')][_0xec68('0x45')]){_0x2f812e['include']=[{'all':!![]}];}_0x2f812e=_['merge']({},_0x2f812e,_0x17fe5c[_0xec68('0x43')]);return db['MailTransferReport'][_0xec68('0x4c')](_0x2f812e)[_0xec68('0x29')](handleEntityNotFound(_0x12de20,null))[_0xec68('0x29')](respondWithResult(_0x12de20,null))[_0xec68('0x48')](handleError(_0x12de20,null));};exports[_0xec68('0x4d')]=function(_0x4844a2,_0x3a9045){return db[_0xec68('0x44')]['create'](_0x4844a2[_0xec68('0x4e')],{})[_0xec68('0x29')](respondWithResult(_0x3a9045,0xc9))['catch'](handleError(_0x3a9045,null));};exports[_0xec68('0x4f')]=function(_0x292d4c,_0x9b16cc){if(_0x292d4c[_0xec68('0x4e')]['id']){delete _0x292d4c[_0xec68('0x4e')]['id'];}return db[_0xec68('0x44')]['find']({'where':{'id':_0x292d4c['params']['id']}})[_0xec68('0x29')](handleEntityNotFound(_0x9b16cc,null))[_0xec68('0x29')](saveUpdates(_0x292d4c[_0xec68('0x4e')],null))['then'](respondWithResult(_0x9b16cc,null))[_0xec68('0x48')](handleError(_0x9b16cc,null));};exports[_0xec68('0x50')]=function(_0x5f1b82,_0x5bdded){return db[_0xec68('0x44')][_0xec68('0x4c')]({'where':{'id':_0x5f1b82[_0xec68('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bdded,null))[_0xec68('0x29')](removeEntity(_0x5bdded,null))['catch'](handleError(_0x5bdded,null));};exports[_0xec68('0x51')]=function(_0x21ea2c,_0x5770f3){return db[_0xec68('0x44')]['describe']()[_0xec68('0x29')](respondWithResult(_0x5770f3,null))['catch'](handleError(_0x5770f3,null));}; \ No newline at end of file +var _0xf946=['sort','where','pick','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','offset','order'];(function(_0x37e0b3,_0x1940f1){var _0x35e903=function(_0x3f8ad5){while(--_0x3f8ad5){_0x37e0b3['push'](_0x37e0b3['shift']());}};_0x35e903(++_0x1940f1);}(_0xf946,0x18d));var _0x6f94=function(_0x564c3f,_0x563c13){_0x564c3f=_0x564c3f-0x0;var _0xdeb099=_0xf946[_0x564c3f];return _0xdeb099;};'use strict';var emlformat=require(_0x6f94('0x0'));var rimraf=require(_0x6f94('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f94('0x2'));var rp=require(_0x6f94('0x3'));var moment=require(_0x6f94('0x4'));var BPromise=require(_0x6f94('0x5'));var Mustache=require(_0x6f94('0x6'));var util=require('util');var path=require(_0x6f94('0x7'));var sox=require(_0x6f94('0x8'));var csv=require('to-csv');var ejs=require(_0x6f94('0x9'));var fs=require('fs');var fs_extra=require(_0x6f94('0xa'));var _=require(_0x6f94('0xb'));var squel=require('squel');var crypto=require(_0x6f94('0xc'));var jsforce=require(_0x6f94('0xd'));var deskjs=require(_0x6f94('0xe'));var toCsv=require(_0x6f94('0xf'));var querystring=require('querystring');var Papa=require(_0x6f94('0x10'));var Redis=require(_0x6f94('0x11'));var authService=require(_0x6f94('0x12'));var qs=require(_0x6f94('0x13'));var as=require(_0x6f94('0x14'));var hardwareService=require(_0x6f94('0x15'));var logger=require(_0x6f94('0x16'))(_0x6f94('0x17'));var utils=require(_0x6f94('0x18'));var config=require(_0x6f94('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f94('0x1a'))['db'];function respondWithStatusCode(_0x3671d7,_0x18ef81){_0x18ef81=_0x18ef81||0xcc;return function(_0x48ab5f){if(_0x48ab5f){return _0x3671d7[_0x6f94('0x1b')](_0x18ef81);}return _0x3671d7[_0x6f94('0x1c')](_0x18ef81)[_0x6f94('0x1d')]();};}function respondWithResult(_0x106113,_0x4ff6cb){_0x4ff6cb=_0x4ff6cb||0xc8;return function(_0x41124d){if(_0x41124d){return _0x106113[_0x6f94('0x1c')](_0x4ff6cb)['json'](_0x41124d);}};}function respondWithFilteredResult(_0x1214a4,_0x5322ff){return function(_0x4a1b09){if(_0x4a1b09){var _0x3ce04e=typeof _0x5322ff['offset']===_0x6f94('0x1e')&&typeof _0x5322ff[_0x6f94('0x1f')]==='undefined';var _0x28ccbe=_0x4a1b09['count'];var _0x12bd75=_0x3ce04e?0x0:_0x5322ff['offset'];var _0x3a787d=_0x3ce04e?_0x4a1b09[_0x6f94('0x20')]:_0x5322ff['offset']+_0x5322ff[_0x6f94('0x1f')];var _0x27c1bf;if(_0x3a787d>=_0x28ccbe){_0x3a787d=_0x28ccbe;_0x27c1bf=0xc8;}else{_0x27c1bf=0xce;}_0x1214a4['status'](_0x27c1bf);return _0x1214a4[_0x6f94('0x21')](_0x6f94('0x22'),_0x12bd75+'-'+_0x3a787d+'/'+_0x28ccbe)['json'](_0x4a1b09);}return null;};}function patchUpdates(_0xbfd35a){return function(_0x326c1e){try{jsonpatch[_0x6f94('0x23')](_0x326c1e,_0xbfd35a,!![]);}catch(_0x266d7a){return BPromise[_0x6f94('0x24')](_0x266d7a);}return _0x326c1e['save']();};}function saveUpdates(_0x32fa58,_0x32517c){return function(_0x3e6c16){if(_0x3e6c16){return _0x3e6c16[_0x6f94('0x25')](_0x32fa58)[_0x6f94('0x26')](function(_0x5b85a4){return _0x5b85a4;});}return null;};}function removeEntity(_0x190405,_0x31c8a4){return function(_0x13ffda){if(_0x13ffda){return _0x13ffda[_0x6f94('0x27')]()[_0x6f94('0x26')](function(){_0x190405[_0x6f94('0x1c')](0xcc)[_0x6f94('0x1d')]();});}};}function handleEntityNotFound(_0x22434e,_0x1857fe){return function(_0x1db07f){if(!_0x1db07f){_0x22434e[_0x6f94('0x1b')](0x194);}return _0x1db07f;};}function handleError(_0x2d38e0,_0x512d7f){_0x512d7f=_0x512d7f||0x1f4;return function(_0x38661d){logger[_0x6f94('0x28')](_0x38661d[_0x6f94('0x29')]);if(_0x38661d[_0x6f94('0x2a')]){delete _0x38661d['name'];}_0x2d38e0[_0x6f94('0x1c')](_0x512d7f)[_0x6f94('0x2b')](_0x38661d);};}exports[_0x6f94('0x2c')]=function(_0x149ce4,_0x2026f7){var _0x6562d6={},_0x4a2a98={},_0x45a31d={'count':0x0,'rows':[]};var _0x31191f=_['map'](db[_0x6f94('0x2d')][_0x6f94('0x2e')],function(_0x172f78){return{'name':_0x172f78[_0x6f94('0x2f')],'type':_0x172f78[_0x6f94('0x30')]['key']};});_0x4a2a98['model']=_[_0x6f94('0x31')](_0x31191f,_0x6f94('0x2a'));_0x4a2a98['query']=_['keys'](_0x149ce4[_0x6f94('0x32')]);_0x4a2a98[_0x6f94('0x33')]=_[_0x6f94('0x34')](_0x4a2a98['model'],_0x4a2a98['query']);_0x6562d6[_0x6f94('0x35')]=_[_0x6f94('0x34')](_0x4a2a98[_0x6f94('0x36')],qs[_0x6f94('0x37')](_0x149ce4[_0x6f94('0x32')][_0x6f94('0x37')]));_0x6562d6['attributes']=_0x6562d6[_0x6f94('0x35')]['length']?_0x6562d6['attributes']:_0x4a2a98['model'];if(!_0x149ce4['query'][_0x6f94('0x38')]('nolimit')){_0x6562d6['limit']=qs['limit'](_0x149ce4[_0x6f94('0x32')][_0x6f94('0x1f')]);_0x6562d6['offset']=qs[_0x6f94('0x39')](_0x149ce4['query']['offset']);}_0x6562d6[_0x6f94('0x3a')]=qs[_0x6f94('0x3b')](_0x149ce4[_0x6f94('0x32')][_0x6f94('0x3b')]);_0x6562d6[_0x6f94('0x3c')]=qs[_0x6f94('0x33')](_[_0x6f94('0x3d')](_0x149ce4[_0x6f94('0x32')],_0x4a2a98[_0x6f94('0x33')]),_0x31191f);if(_0x149ce4[_0x6f94('0x32')]['filter']){_0x6562d6[_0x6f94('0x3c')]=_['merge'](_0x6562d6[_0x6f94('0x3c')],{'$or':_[_0x6f94('0x31')](_0x31191f,function(_0x15ce7c){if(_0x15ce7c['type']!==_0x6f94('0x3e')){var _0x2094d3={};_0x2094d3[_0x15ce7c[_0x6f94('0x2a')]]={'$like':'%'+_0x149ce4[_0x6f94('0x32')][_0x6f94('0x3f')]+'%'};return _0x2094d3;}})});}_0x6562d6=_[_0x6f94('0x40')]({},_0x6562d6,_0x149ce4['options']);var _0x5a4ba9={'where':_0x6562d6[_0x6f94('0x3c')]};return db['MailTransferReport']['count'](_0x5a4ba9)[_0x6f94('0x26')](function(_0x1f4274){_0x45a31d['count']=_0x1f4274;if(_0x149ce4[_0x6f94('0x32')][_0x6f94('0x41')]){_0x6562d6['include']=[{'all':!![]}];}return db[_0x6f94('0x2d')][_0x6f94('0x42')](_0x6562d6);})['then'](function(_0x448518){_0x45a31d[_0x6f94('0x43')]=_0x448518;return _0x45a31d;})['then'](respondWithFilteredResult(_0x2026f7,_0x6562d6))[_0x6f94('0x44')](handleError(_0x2026f7,null));};exports[_0x6f94('0x45')]=function(_0x3a5dfc,_0x15eaef){var _0x25c1cd={'raw':!![],'where':{'id':_0x3a5dfc[_0x6f94('0x46')]['id']}},_0x3074f0={};_0x3074f0['model']=_[_0x6f94('0x47')](db['MailTransferReport'][_0x6f94('0x2e')]);_0x3074f0['query']=_['keys'](_0x3a5dfc['query']);_0x3074f0['filters']=_['intersection'](_0x3074f0[_0x6f94('0x36')],_0x3074f0[_0x6f94('0x32')]);_0x25c1cd[_0x6f94('0x35')]=_[_0x6f94('0x34')](_0x3074f0[_0x6f94('0x36')],qs[_0x6f94('0x37')](_0x3a5dfc[_0x6f94('0x32')][_0x6f94('0x37')]));_0x25c1cd[_0x6f94('0x35')]=_0x25c1cd['attributes']['length']?_0x25c1cd[_0x6f94('0x35')]:_0x3074f0[_0x6f94('0x36')];if(_0x3a5dfc['query'][_0x6f94('0x41')]){_0x25c1cd['include']=[{'all':!![]}];}_0x25c1cd=_[_0x6f94('0x40')]({},_0x25c1cd,_0x3a5dfc[_0x6f94('0x48')]);return db['MailTransferReport'][_0x6f94('0x49')](_0x25c1cd)['then'](handleEntityNotFound(_0x15eaef,null))[_0x6f94('0x26')](respondWithResult(_0x15eaef,null))[_0x6f94('0x44')](handleError(_0x15eaef,null));};exports[_0x6f94('0x4a')]=function(_0x3dadc4,_0x2933e6){return db[_0x6f94('0x2d')][_0x6f94('0x4a')](_0x3dadc4[_0x6f94('0x4b')],{})[_0x6f94('0x26')](respondWithResult(_0x2933e6,0xc9))[_0x6f94('0x44')](handleError(_0x2933e6,null));};exports[_0x6f94('0x25')]=function(_0x416867,_0x32b111){if(_0x416867[_0x6f94('0x4b')]['id']){delete _0x416867['body']['id'];}return db[_0x6f94('0x2d')][_0x6f94('0x49')]({'where':{'id':_0x416867[_0x6f94('0x46')]['id']}})[_0x6f94('0x26')](handleEntityNotFound(_0x32b111,null))[_0x6f94('0x26')](saveUpdates(_0x416867['body'],null))[_0x6f94('0x26')](respondWithResult(_0x32b111,null))[_0x6f94('0x44')](handleError(_0x32b111,null));};exports[_0x6f94('0x27')]=function(_0x21ea27,_0x5173d9){return db[_0x6f94('0x2d')]['find']({'where':{'id':_0x21ea27[_0x6f94('0x46')]['id']}})[_0x6f94('0x26')](handleEntityNotFound(_0x5173d9,null))[_0x6f94('0x26')](removeEntity(_0x5173d9,null))[_0x6f94('0x44')](handleError(_0x5173d9,null));};exports['describe']=function(_0x1c52f0,_0x455aee){return db[_0x6f94('0x2d')]['describe']()[_0x6f94('0x26')](respondWithResult(_0x455aee,null))[_0x6f94('0x44')](handleError(_0x455aee,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e0f2536..2a4da0a 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 _0xb13b=['api','moment','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util','../../config/logger'];(function(_0x24b073,_0x428400){var _0x149618=function(_0x2cd0d8){while(--_0x2cd0d8){_0x24b073['push'](_0x24b073['shift']());}};_0x149618(++_0x428400);}(_0xb13b,0x1de));var _0xbb13=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xb13b[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xbb13('0x0'));var util=require(_0xbb13('0x1'));var logger=require(_0xbb13('0x2'))(_0xbb13('0x3'));var moment=require(_0xbb13('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb13('0x5'));var fs=require('fs');var path=require(_0xbb13('0x6'));var rimraf=require('rimraf');var config=require(_0xbb13('0x7'));var attributes=require(_0xbb13('0x8'));module[_0xbb13('0x9')]=function(_0x464c50,_0x296632){return _0x464c50[_0xbb13('0xa')](_0xbb13('0xb'),attributes,{'tableName':_0xbb13('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb957=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','../../config/logger'];(function(_0x4011c7,_0x4d3d71){var _0x32a078=function(_0x2aaede){while(--_0x2aaede){_0x4011c7['push'](_0x4011c7['shift']());}};_0x32a078(++_0x4d3d71);}(_0xb957,0x6d));var _0x7b95=function(_0xe2b604,_0x73cc8b){_0xe2b604=_0xe2b604-0x0;var _0x53b580=_0xb957[_0xe2b604];return _0x53b580;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b95('0x0'))('api');var moment=require(_0x7b95('0x1'));var BPromise=require(_0x7b95('0x2'));var rp=require(_0x7b95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var attributes=require(_0x7b95('0x6'));module[_0x7b95('0x7')]=function(_0x19ff14,_0x518099){return _0x19ff14[_0x7b95('0x8')](_0x7b95('0x9'),attributes,{'tableName':_0x7b95('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 984cc82..d957f34 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 _0xafb7=['then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x2e6bab,_0x208883){var _0x2ad467=function(_0x1e7bc0){while(--_0x1e7bc0){_0x2e6bab['push'](_0x2e6bab['shift']());}};_0x2ad467(++_0x208883);}(_0xafb7,0x19a));var _0x7afb=function(_0x1a8d4e,_0x259dcc){_0x1a8d4e=_0x1a8d4e-0x0;var _0x541bd5=_0xafb7[_0x1a8d4e];return _0x541bd5;};'use strict';var _=require(_0x7afb('0x0'));var util=require(_0x7afb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7afb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7afb('0x3'));var logger=require(_0x7afb('0x4'))(_0x7afb('0x5'));var config=require(_0x7afb('0x6'));var jayson=require(_0x7afb('0x7'));var client=jayson[_0x7afb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18e484,_0x5c2328,_0x1e8094){return new BPromise(function(_0x36ec3,_0x46f1b0){return client[_0x7afb('0x9')](_0x18e484,_0x1e8094)[_0x7afb('0xa')](function(_0x801e9e){logger['info'](_0x7afb('0xb'),_0x5c2328,_0x7afb('0xc'));logger[_0x7afb('0xd')](_0x7afb('0xe'),_0x5c2328,'request\x20sent',JSON[_0x7afb('0xf')](_0x801e9e));if(_0x801e9e[_0x7afb('0x10')]){if(_0x801e9e['error'][_0x7afb('0x11')]===0x1f4){logger['error'](_0x7afb('0xb'),_0x5c2328,_0x801e9e[_0x7afb('0x10')][_0x7afb('0x12')]);return _0x46f1b0(_0x801e9e['error'][_0x7afb('0x12')]);}logger[_0x7afb('0x10')](_0x7afb('0xb'),_0x5c2328,_0x801e9e[_0x7afb('0x10')][_0x7afb('0x12')]);return _0x36ec3(_0x801e9e[_0x7afb('0x10')]['message']);}else{logger['info'](_0x7afb('0xb'),_0x5c2328,_0x7afb('0xc'));_0x36ec3(_0x801e9e[_0x7afb('0x13')]['message']);}})[_0x7afb('0x14')](function(_0x1f9019){logger[_0x7afb('0x10')](_0x7afb('0xb'),_0x5c2328,_0x1f9019);_0x46f1b0(_0x1f9019);});});} \ No newline at end of file +var _0x6356=['MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x261044,_0x1ebcbe){var _0x243393=function(_0x227861){while(--_0x227861){_0x261044['push'](_0x261044['shift']());}};_0x243393(++_0x1ebcbe);}(_0x6356,0x102));var _0x6635=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0x6356[_0x168478];return _0x29c2f8;};'use strict';var _=require(_0x6635('0x0'));var util=require(_0x6635('0x1'));var moment=require(_0x6635('0x2'));var BPromise=require(_0x6635('0x3'));var rs=require(_0x6635('0x4'));var fs=require('fs');var Redis=require(_0x6635('0x5'));var db=require(_0x6635('0x6'))['db'];var utils=require(_0x6635('0x7'));var logger=require(_0x6635('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6635('0x9')][_0x6635('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51453d,_0x164391,_0x1f72b3){return new BPromise(function(_0x1c8c20,_0x452c8c){return client[_0x6635('0xb')](_0x51453d,_0x1f72b3)[_0x6635('0xc')](function(_0xb77dca){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x164391,_0x6635('0xd'));logger[_0x6635('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x164391,_0x6635('0xd'),JSON[_0x6635('0xf')](_0xb77dca));if(_0xb77dca[_0x6635('0x10')]){if(_0xb77dca[_0x6635('0x10')][_0x6635('0x11')]===0x1f4){logger[_0x6635('0x10')](_0x6635('0x12'),_0x164391,_0xb77dca[_0x6635('0x10')][_0x6635('0x13')]);return _0x452c8c(_0xb77dca[_0x6635('0x10')][_0x6635('0x13')]);}logger[_0x6635('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x164391,_0xb77dca[_0x6635('0x10')][_0x6635('0x13')]);return _0x1c8c20(_0xb77dca[_0x6635('0x10')][_0x6635('0x13')]);}else{logger[_0x6635('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x164391,_0x6635('0xd'));_0x1c8c20(_0xb77dca[_0x6635('0x15')][_0x6635('0x13')]);}})[_0x6635('0x16')](function(_0x50a602){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x164391,_0x50a602);_0x452c8c(_0x50a602);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index f81db90..68d0438 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 _0x2634=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x2634,0xd8));var _0x4263=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2634[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4263('0x0'));var timeout=require('connect-timeout');var express=require(_0x4263('0x1'));var router=express[_0x4263('0x2')]();var fs_extra=require(_0x4263('0x3'));var auth=require(_0x4263('0x4'));var interaction=require(_0x4263('0x5'));var config=require(_0x4263('0x6'));var controller=require('./memberReport.controller');router[_0x4263('0x7')]('/',auth[_0x4263('0x8')](),controller[_0x4263('0x9')]);router['get']('/describe',auth[_0x4263('0x8')](),controller['describe']);router[_0x4263('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4263('0xa')]);router[_0x4263('0xb')]('/',auth['isAuthenticated'](),controller[_0x4263('0xc')]);router['put'](_0x4263('0xd'),auth[_0x4263('0x8')](),controller[_0x4263('0xe')]);router[_0x4263('0xf')]('/:id',auth[_0x4263('0x8')](),controller[_0x4263('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcecb=['update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xcecb,0x114));var _0xbcec=function(_0x417baa,_0x3923d0){_0x417baa=_0x417baa-0x0;var _0x42724f=_0xcecb[_0x417baa];return _0x42724f;};'use strict';var multer=require(_0xbcec('0x0'));var util=require(_0xbcec('0x1'));var path=require('path');var timeout=require(_0xbcec('0x2'));var express=require(_0xbcec('0x3'));var router=express[_0xbcec('0x4')]();var fs_extra=require(_0xbcec('0x5'));var auth=require(_0xbcec('0x6'));var interaction=require(_0xbcec('0x7'));var config=require('../../config/environment');var controller=require(_0xbcec('0x8'));router[_0xbcec('0x9')]('/',auth[_0xbcec('0xa')](),controller[_0xbcec('0xb')]);router[_0xbcec('0x9')](_0xbcec('0xc'),auth['isAuthenticated'](),controller[_0xbcec('0xd')]);router['get'](_0xbcec('0xe'),auth[_0xbcec('0xa')](),controller[_0xbcec('0xf')]);router[_0xbcec('0x10')]('/',auth[_0xbcec('0xa')](),controller['create']);router[_0xbcec('0x11')](_0xbcec('0xe'),auth[_0xbcec('0xa')](),controller[_0xbcec('0x12')]);router[_0xbcec('0x13')]('/:id',auth[_0xbcec('0xa')](),controller[_0xbcec('0x14')]);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 23247b1..c529784 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 _0x0618=['INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x0618,0x64));var _0x8061=function(_0x340d9f,_0x26c7b1){_0x340d9f=_0x340d9f-0x0;var _0x33bc66=_0x0618[_0x340d9f];return _0x33bc66;};'use strict';var Sequelize=require(_0x8061('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x8061('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8061('0x1')],'defaultValue':_0x8061('0x2'),'comment':_0x8061('0x3')},'duration':{'type':Sequelize[_0x8061('0x4')]},'enterAt':{'type':Sequelize[_0x8061('0x5')]},'exitAt':{'type':Sequelize[_0x8061('0x5')],'set':function(_0x346075){var _0x4e0211=moment(_0x346075);var _0x27c61f=moment(this[_0x8061('0x6')]('enterAt'));var _0x58b92c=_0x4e0211[_0x8061('0x7')](_0x27c61f,_0x8061('0x8'));this[_0x8061('0x9')](_0x8061('0xa'),_0x346075);this[_0x8061('0x9')]('duration',_0x58b92c>=0x0?_0x58b92c:null);}},'data1':{'type':Sequelize[_0x8061('0x1')],'comment':_0x8061('0xb')},'data2':{'type':Sequelize[_0x8061('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x8061('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x8061('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x8061('0x1')],'comment':_0x8061('0xc')},'role':{'type':Sequelize[_0x8061('0x1')]},'internal':{'type':Sequelize[_0x8061('0x4')]},'uniqueid':{'type':Sequelize[_0x8061('0x1')]}}; \ No newline at end of file +var _0xdede=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','exitAt','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment'];(function(_0x174650,_0x2d67be){var _0x285d4d=function(_0x4bbd0a){while(--_0x4bbd0a){_0x174650['push'](_0x174650['shift']());}};_0x285d4d(++_0x2d67be);}(_0xdede,0x6b));var _0xeded=function(_0x5270f8,_0x2dc0c0){_0x5270f8=_0x5270f8-0x0;var _0x432ed0=_0xdede[_0x5270f8];return _0x432ed0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xeded('0x0'));module[_0xeded('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xeded('0x2')]},'interface':{'type':Sequelize[_0xeded('0x2')]},'type':{'type':Sequelize[_0xeded('0x2')],'defaultValue':_0xeded('0x3'),'comment':_0xeded('0x4')},'duration':{'type':Sequelize[_0xeded('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xeded('0x6')],'set':function(_0x79b0ba){var _0x2db1b6=moment(_0x79b0ba);var _0x2b957d=moment(this[_0xeded('0x7')](_0xeded('0x8')));var _0x37faea=_0x2db1b6[_0xeded('0x9')](_0x2b957d,_0xeded('0xa'));this['setDataValue'](_0xeded('0xb'),_0x79b0ba);this[_0xeded('0xc')](_0xeded('0xd'),_0x37faea>=0x0?_0x37faea:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xeded('0x2')],'comment':_0xeded('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xeded('0xf')},'data4':{'type':Sequelize[_0xeded('0x2')],'comment':_0xeded('0x10')},'data5':{'type':Sequelize[_0xeded('0x2')],'comment':_0xeded('0x11')},'role':{'type':Sequelize[_0xeded('0x2')]},'internal':{'type':Sequelize[_0xeded('0x5')]},'uniqueid':{'type':Sequelize[_0xeded('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 629e19f..1319674 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x34e8,0x12c));var _0x834e=function(_0x4fc085,_0x1df493){_0x4fc085=_0x4fc085-0x0;var _0x22d539=_0x34e8[_0x4fc085];return _0x22d539;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x34e8,0x12c));var _0x834e=function(_0x4edf69,_0xeb11b9){_0x4edf69=_0x4edf69-0x0;var _0x35aa8d=_0x34e8[_0x4edf69];return _0x35aa8d;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 3b38dca..e6a8419 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 _0x2d72=['rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x2d72,0xa8));var _0x22d7=function(_0x6d34d7,_0xc0f2ec){_0x6d34d7=_0x6d34d7-0x0;var _0x2e6abb=_0x2d72[_0x6d34d7];return _0x2e6abb;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x22d7('0xe'),_0x22d7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x522b=['lodash','util','api','request-promise','path','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','interface'];(function(_0x12187e,_0x3ac0b2){var _0x4e5cf9=function(_0x12438b){while(--_0x12438b){_0x12187e['push'](_0x12187e['shift']());}};_0x4e5cf9(++_0x3ac0b2);}(_0x522b,0x1c3));var _0xb522=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x522b[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var logger=require('../../config/logger')(_0xb522('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb522('0x3'));var fs=require('fs');var path=require(_0xb522('0x4'));var rimraf=require('rimraf');var config=require(_0xb522('0x5'));var attributes=require(_0xb522('0x6'));module[_0xb522('0x7')]=function(_0x2fca5b,_0x47bd53){return _0x2fca5b['define'](_0xb522('0x8'),attributes,{'tableName':_0xb522('0x9'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xb522('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 20fccab..908cd21 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 _0x41ec=['raw','attributes','limit','include','map','model','create','body','CreateMemberReport','UpdateMemberReport','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options'];(function(_0x234785,_0x15d7ec){var _0x38f40a=function(_0x1de89c){while(--_0x1de89c){_0x234785['push'](_0x234785['shift']());}};_0x38f40a(++_0x15d7ec);}(_0x41ec,0x143));var _0xc41e=function(_0x34c983,_0x138a97){_0x34c983=_0x34c983-0x0;var _0x163621=_0x41ec[_0x34c983];return _0x163621;};'use strict';var _=require('lodash');var util=require(_0xc41e('0x0'));var moment=require('moment');var BPromise=require(_0xc41e('0x1'));var rs=require(_0xc41e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc41e('0x3'))['db'];var utils=require(_0xc41e('0x4'));var logger=require(_0xc41e('0x5'))(_0xc41e('0x6'));var config=require(_0xc41e('0x7'));var jayson=require(_0xc41e('0x8'));var client=jayson[_0xc41e('0x9')][_0xc41e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ce38,_0x3655bf,_0x9a951a){return new BPromise(function(_0x4d941e,_0x2b8cf6){return client[_0xc41e('0xb')](_0x27ce38,_0x9a951a)[_0xc41e('0xc')](function(_0x2a7ed8){logger[_0xc41e('0xd')](_0xc41e('0xe'),_0x3655bf,_0xc41e('0xf'));logger[_0xc41e('0x10')](_0xc41e('0x11'),_0x3655bf,_0xc41e('0xf'),JSON[_0xc41e('0x12')](_0x2a7ed8));if(_0x2a7ed8['error']){if(_0x2a7ed8[_0xc41e('0x13')][_0xc41e('0x14')]===0x1f4){logger[_0xc41e('0x13')](_0xc41e('0xe'),_0x3655bf,_0x2a7ed8[_0xc41e('0x13')][_0xc41e('0x15')]);return _0x2b8cf6(_0x2a7ed8[_0xc41e('0x13')][_0xc41e('0x15')]);}logger['error'](_0xc41e('0xe'),_0x3655bf,_0x2a7ed8[_0xc41e('0x13')][_0xc41e('0x15')]);return _0x4d941e(_0x2a7ed8[_0xc41e('0x13')]['message']);}else{logger['info'](_0xc41e('0xe'),_0x3655bf,_0xc41e('0xf'));_0x4d941e(_0x2a7ed8[_0xc41e('0x16')]['message']);}})[_0xc41e('0x17')](function(_0x2ef2ca){logger['error']('MemberReport,\x20%s,\x20%s',_0x3655bf,_0x2ef2ca);_0x2b8cf6(_0x2ef2ca);});});}exports[_0xc41e('0x18')]=function(_0x5c0517){var _0x37d0d6=this;return new Promise(function(_0x23c9b6,_0x5d630f){return db[_0xc41e('0x19')][_0xc41e('0x1a')]({'raw':_0x5c0517[_0xc41e('0x1b')]?_0x5c0517[_0xc41e('0x1b')][_0xc41e('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c0517[_0xc41e('0x1b')]?_0x5c0517[_0xc41e('0x1b')]['where']||null:null,'attributes':_0x5c0517[_0xc41e('0x1b')]?_0x5c0517[_0xc41e('0x1b')][_0xc41e('0x1d')]||null:null,'limit':_0x5c0517['options']?_0x5c0517[_0xc41e('0x1b')][_0xc41e('0x1e')]||null:null,'include':_0x5c0517[_0xc41e('0x1b')]?_0x5c0517['options'][_0xc41e('0x1f')]?_[_0xc41e('0x20')](_0x5c0517[_0xc41e('0x1b')]['include'],function(_0x5a06dd){return{'model':db[_0x5a06dd['model']],'as':_0x5a06dd['as'],'attributes':_0x5a06dd[_0xc41e('0x1d')],'include':_0x5a06dd[_0xc41e('0x1f')]?_['map'](_0x5a06dd['include'],function(_0x5a3e0d){return{'model':db[_0x5a3e0d[_0xc41e('0x21')]],'as':_0x5a3e0d['as'],'attributes':_0x5a3e0d[_0xc41e('0x1d')],'include':_0x5a3e0d[_0xc41e('0x1f')]?_[_0xc41e('0x20')](_0x5a3e0d[_0xc41e('0x1f')],function(_0x580b9e){return{'model':db[_0x580b9e[_0xc41e('0x21')]],'as':_0x580b9e['as'],'attributes':_0x580b9e[_0xc41e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc41e('0xc')](function(_0x5bd682){logger[_0xc41e('0xd')](_0xc41e('0x18'),_0x5c0517);logger['debug'](_0xc41e('0x18'),_0x5c0517,JSON[_0xc41e('0x12')](_0x5bd682));_0x23c9b6(_0x5bd682);})[_0xc41e('0x17')](function(_0xcb3a15){logger[_0xc41e('0x13')](_0xc41e('0x18'),_0xcb3a15[_0xc41e('0x15')],_0x5c0517);_0x5d630f(_0x37d0d6['error'](0x1f4,_0xcb3a15['message']));});});};exports['CreateMemberReport']=function(_0x3cd142){var _0x1fc6e2=this;return new Promise(function(_0x24b7ac,_0x3334f8){return db[_0xc41e('0x19')][_0xc41e('0x22')](_0x3cd142[_0xc41e('0x23')],{'raw':_0x3cd142['options']?_0x3cd142[_0xc41e('0x1b')][_0xc41e('0x1c')]===undefined?!![]:![]:!![]})[_0xc41e('0xc')](function(_0x5ca527){logger[_0xc41e('0xd')]('CreateMemberReport',_0x3cd142);logger[_0xc41e('0x10')](_0xc41e('0x24'),_0x3cd142,JSON[_0xc41e('0x12')](_0x5ca527));_0x24b7ac(_0x5ca527);})[_0xc41e('0x17')](function(_0x4df6e6){logger['error'](_0xc41e('0x24'),_0x4df6e6[_0xc41e('0x15')],_0x3cd142);_0x3334f8(_0x1fc6e2[_0xc41e('0x13')](0x1f4,_0x4df6e6[_0xc41e('0x15')]));});});};exports[_0xc41e('0x25')]=function(_0x3ce21a){var _0x53861a=this;return new Promise(function(_0x42badc,_0x3416b5){return db[_0xc41e('0x19')]['update'](_0x3ce21a[_0xc41e('0x23')],{'raw':_0x3ce21a[_0xc41e('0x1b')]?_0x3ce21a['options'][_0xc41e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce21a[_0xc41e('0x1b')]?_0x3ce21a[_0xc41e('0x1b')][_0xc41e('0x26')]||null:null,'attributes':_0x3ce21a[_0xc41e('0x1b')]?_0x3ce21a['options']['attributes']||null:null,'limit':_0x3ce21a[_0xc41e('0x1b')]?_0x3ce21a[_0xc41e('0x1b')][_0xc41e('0x1e')]||null:null})[_0xc41e('0xc')](function(_0x29fbec){logger[_0xc41e('0xd')](_0xc41e('0x25'),_0x3ce21a);logger[_0xc41e('0x10')](_0xc41e('0x25'),_0x3ce21a,JSON['stringify'](_0x29fbec));_0x42badc(_0x29fbec);})['catch'](function(_0x465280){logger[_0xc41e('0x13')](_0xc41e('0x25'),_0x465280[_0xc41e('0x15')],_0x3ce21a);_0x3416b5(_0x53861a[_0xc41e('0x13')](0x1f4,_0x465280[_0xc41e('0x15')]));});});}; \ No newline at end of file +var _0x965d=['where','limit','include','model','attributes','map','stringify','create','body','CreateMemberReport','UpdateMemberReport','MemberReport','update','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','code','error','message','MemberReport,\x20%s,\x20%s','result','GetMemberReport','options','raw'];(function(_0x4c10a9,_0x514b23){var _0x40e058=function(_0x34a519){while(--_0x34a519){_0x4c10a9['push'](_0x4c10a9['shift']());}};_0x40e058(++_0x514b23);}(_0x965d,0x1be));var _0xd965=function(_0x566c0d,_0x1d01cf){_0x566c0d=_0x566c0d-0x0;var _0x1f2416=_0x965d[_0x566c0d];return _0x1f2416;};'use strict';var _=require(_0xd965('0x0'));var util=require(_0xd965('0x1'));var moment=require('moment');var BPromise=require(_0xd965('0x2'));var rs=require(_0xd965('0x3'));var fs=require('fs');var Redis=require(_0xd965('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd965('0x5'));var logger=require(_0xd965('0x6'))(_0xd965('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9b86,_0x368f36,_0x5772e3){return new BPromise(function(_0x427868,_0x563c33){return client[_0xd965('0x8')](_0x2f9b86,_0x5772e3)[_0xd965('0x9')](function(_0xa4f9f9){logger[_0xd965('0xa')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xd965('0xb'));logger[_0xd965('0xc')](_0xd965('0xd'),_0x368f36,'request\x20sent',JSON['stringify'](_0xa4f9f9));if(_0xa4f9f9['error']){if(_0xa4f9f9['error'][_0xd965('0xe')]===0x1f4){logger[_0xd965('0xf')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);return _0x563c33(_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);}logger[_0xd965('0xf')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);return _0x427868(_0xa4f9f9['error']['message']);}else{logger['info'](_0xd965('0x11'),_0x368f36,_0xd965('0xb'));_0x427868(_0xa4f9f9[_0xd965('0x12')][_0xd965('0x10')]);}})['catch'](function(_0x439eca){logger[_0xd965('0xf')](_0xd965('0x11'),_0x368f36,_0x439eca);_0x563c33(_0x439eca);});});}exports[_0xd965('0x13')]=function(_0x45f930){var _0x5dbaff=this;return new Promise(function(_0x1321c1,_0x5e4659){return db['MemberReport']['findAll']({'raw':_0x45f930[_0xd965('0x14')]?_0x45f930[_0xd965('0x14')][_0xd965('0x15')]===undefined?!![]:![]:!![],'where':_0x45f930[_0xd965('0x14')]?_0x45f930['options'][_0xd965('0x16')]||null:null,'attributes':_0x45f930[_0xd965('0x14')]?_0x45f930[_0xd965('0x14')]['attributes']||null:null,'limit':_0x45f930['options']?_0x45f930['options'][_0xd965('0x17')]||null:null,'include':_0x45f930['options']?_0x45f930[_0xd965('0x14')][_0xd965('0x18')]?_['map'](_0x45f930['options'][_0xd965('0x18')],function(_0x140000){return{'model':db[_0x140000[_0xd965('0x19')]],'as':_0x140000['as'],'attributes':_0x140000[_0xd965('0x1a')],'include':_0x140000[_0xd965('0x18')]?_[_0xd965('0x1b')](_0x140000[_0xd965('0x18')],function(_0x1a7367){return{'model':db[_0x1a7367[_0xd965('0x19')]],'as':_0x1a7367['as'],'attributes':_0x1a7367[_0xd965('0x1a')],'include':_0x1a7367[_0xd965('0x18')]?_[_0xd965('0x1b')](_0x1a7367['include'],function(_0x3d8899){return{'model':db[_0x3d8899[_0xd965('0x19')]],'as':_0x3d8899['as'],'attributes':_0x3d8899['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d6a07){logger['info']('GetMemberReport',_0x45f930);logger[_0xd965('0xc')](_0xd965('0x13'),_0x45f930,JSON[_0xd965('0x1c')](_0x4d6a07));_0x1321c1(_0x4d6a07);})['catch'](function(_0x20b8b9){logger[_0xd965('0xf')](_0xd965('0x13'),_0x20b8b9['message'],_0x45f930);_0x5e4659(_0x5dbaff[_0xd965('0xf')](0x1f4,_0x20b8b9['message']));});});};exports['CreateMemberReport']=function(_0x5ac01e){var _0x26379d=this;return new Promise(function(_0x5d2d32,_0x29b600){return db['MemberReport'][_0xd965('0x1d')](_0x5ac01e[_0xd965('0x1e')],{'raw':_0x5ac01e[_0xd965('0x14')]?_0x5ac01e[_0xd965('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xd965('0x9')](function(_0x1eb100){logger['info'](_0xd965('0x1f'),_0x5ac01e);logger[_0xd965('0xc')]('CreateMemberReport',_0x5ac01e,JSON[_0xd965('0x1c')](_0x1eb100));_0x5d2d32(_0x1eb100);})['catch'](function(_0x3c3246){logger[_0xd965('0xf')](_0xd965('0x1f'),_0x3c3246[_0xd965('0x10')],_0x5ac01e);_0x29b600(_0x26379d['error'](0x1f4,_0x3c3246[_0xd965('0x10')]));});});};exports[_0xd965('0x20')]=function(_0x4e974a){var _0x259543=this;return new Promise(function(_0x15286,_0x3dd72d){return db[_0xd965('0x21')][_0xd965('0x22')](_0x4e974a[_0xd965('0x1e')],{'raw':_0x4e974a['options']?_0x4e974a[_0xd965('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')]['where']||null:null,'attributes':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')][_0xd965('0x1a')]||null:null,'limit':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')][_0xd965('0x17')]||null:null})[_0xd965('0x9')](function(_0xdd22bb){logger[_0xd965('0xa')](_0xd965('0x20'),_0x4e974a);logger['debug'](_0xd965('0x20'),_0x4e974a,JSON[_0xd965('0x1c')](_0xdd22bb));_0x15286(_0xdd22bb);})[_0xd965('0x23')](function(_0x48115b){logger['error']('UpdateMemberReport',_0x48115b[_0xd965('0x10')],_0x4e974a);_0x3dd72d(_0x259543[_0xd965('0xf')](0x1f4,_0x48115b[_0xd965('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index c260cfa..9a3e5a5 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 _0xa7e6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','connect-timeout'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xa7e6,0x74));var _0x6a7e=function(_0x35faa8,_0x18c8b7){_0x35faa8=_0x35faa8-0x0;var _0x3227b0=_0xa7e6[_0x35faa8];return _0x3227b0;};'use strict';var multer=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var path=require(_0x6a7e('0x2'));var timeout=require(_0x6a7e('0x3'));var express=require(_0x6a7e('0x4'));var router=express[_0x6a7e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6a7e('0x6'));var interaction=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var controller=require(_0x6a7e('0x9'));router[_0x6a7e('0xa')]('/',controller['index']);module[_0x6a7e('0xb')]=router; \ No newline at end of file +var _0x4b5b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','util'];(function(_0x166b97,_0x21bd32){var _0x4dcd02=function(_0x5133e8){while(--_0x5133e8){_0x166b97['push'](_0x166b97['shift']());}};_0x4dcd02(++_0x21bd32);}(_0x4b5b,0x1c1));var _0xb4b5=function(_0x2ad646,_0x116355){_0x2ad646=_0x2ad646-0x0;var _0x2d2bcd=_0x4b5b[_0x2ad646];return _0x2d2bcd;};'use strict';var multer=require('multer');var util=require(_0xb4b5('0x0'));var path=require(_0xb4b5('0x1'));var timeout=require(_0xb4b5('0x2'));var express=require(_0xb4b5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb4b5('0x4'));var interaction=require(_0xb4b5('0x5'));var config=require(_0xb4b5('0x6'));var controller=require(_0xb4b5('0x7'));router[_0xb4b5('0x8')]('/',controller['index']);module[_0xb4b5('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 53dc56f..245bcee 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 _0xaf85=['exports','STRING','version'];(function(_0x21cffc,_0x386d53){var _0x5818f3=function(_0x475471){while(--_0x475471){_0x21cffc['push'](_0x21cffc['shift']());}};_0x5818f3(++_0x386d53);}(_0xaf85,0x81));var _0x5af8=function(_0x41d902,_0x29d0b){_0x41d902=_0x41d902-0x0;var _0x360fb1=_0xaf85[_0x41d902];return _0x360fb1;};'use strict';var Sequelize=require('sequelize');module[_0x5af8('0x0')]={'version':{'type':Sequelize[_0x5af8('0x1')],'unique':_0x5af8('0x2')}}; \ No newline at end of file +var _0x7d68=['version','exports'];(function(_0x5b13e0,_0x248ca4){var _0x5ac9a0=function(_0x29bb6f){while(--_0x29bb6f){_0x5b13e0['push'](_0x5b13e0['shift']());}};_0x5ac9a0(++_0x248ca4);}(_0x7d68,0x99));var _0x87d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d68[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x87d6('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0x87d6('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0b02e11..6bd65fa 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 _0xe787=['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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Migration','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse'];(function(_0x8fba1a,_0x274189){var _0x2f5c2d=function(_0x5f46e4){while(--_0x5f46e4){_0x8fba1a['push'](_0x8fba1a['shift']());}};_0x2f5c2d(++_0x274189);}(_0xe787,0x14d));var _0x7e78=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xe787[_0x3fe042];return _0x7d4a1f;};'use strict';var emlformat=require(_0x7e78('0x0'));var rimraf=require(_0x7e78('0x1'));var zipdir=require(_0x7e78('0x2'));var jsonpatch=require(_0x7e78('0x3'));var rp=require(_0x7e78('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7e78('0x5'));var util=require(_0x7e78('0x6'));var path=require(_0x7e78('0x7'));var sox=require(_0x7e78('0x8'));var csv=require(_0x7e78('0x9'));var ejs=require(_0x7e78('0xa'));var fs=require('fs');var fs_extra=require(_0x7e78('0xb'));var _=require(_0x7e78('0xc'));var squel=require(_0x7e78('0xd'));var crypto=require(_0x7e78('0xe'));var jsforce=require(_0x7e78('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7e78('0x9'));var querystring=require('querystring');var Papa=require(_0x7e78('0x10'));var Redis=require(_0x7e78('0x11'));var authService=require(_0x7e78('0x12'));var qs=require(_0x7e78('0x13'));var as=require(_0x7e78('0x14'));var hardwareService=require(_0x7e78('0x15'));var logger=require(_0x7e78('0x16'))(_0x7e78('0x17'));var utils=require(_0x7e78('0x18'));var config=require(_0x7e78('0x19'));var licenseUtil=require(_0x7e78('0x1a'));var db=require(_0x7e78('0x1b'))['db'];function respondWithStatusCode(_0x3758ce,_0x2cae6b){_0x2cae6b=_0x2cae6b||0xcc;return function(_0x32c605){if(_0x32c605){return _0x3758ce['sendStatus'](_0x2cae6b);}return _0x3758ce[_0x7e78('0x1c')](_0x2cae6b)[_0x7e78('0x1d')]();};}function respondWithResult(_0x42c664,_0x51415a){_0x51415a=_0x51415a||0xc8;return function(_0x399b79){if(_0x399b79){return _0x42c664[_0x7e78('0x1c')](_0x51415a)[_0x7e78('0x1e')](_0x399b79);}};}function respondWithFilteredResult(_0x295665,_0x18fae3){return function(_0x3a30b3){if(_0x3a30b3){var _0x2cc50f=typeof _0x18fae3['offset']===_0x7e78('0x1f')&&typeof _0x18fae3[_0x7e78('0x20')]==='undefined';var _0xcc45ad=_0x3a30b3[_0x7e78('0x21')];var _0x48eddb=_0x2cc50f?0x0:_0x18fae3[_0x7e78('0x22')];var _0x449a51=_0x2cc50f?_0x3a30b3['count']:_0x18fae3[_0x7e78('0x22')]+_0x18fae3[_0x7e78('0x20')];var _0x2f65d4;if(_0x449a51>=_0xcc45ad){_0x449a51=_0xcc45ad;_0x2f65d4=0xc8;}else{_0x2f65d4=0xce;}_0x295665[_0x7e78('0x1c')](_0x2f65d4);return _0x295665[_0x7e78('0x23')](_0x7e78('0x24'),_0x48eddb+'-'+_0x449a51+'/'+_0xcc45ad)[_0x7e78('0x1e')](_0x3a30b3);}return null;};}function patchUpdates(_0x5dd440){return function(_0x25c556){try{jsonpatch[_0x7e78('0x25')](_0x25c556,_0x5dd440,!![]);}catch(_0x208d6a){return BPromise[_0x7e78('0x26')](_0x208d6a);}return _0x25c556[_0x7e78('0x27')]();};}function saveUpdates(_0x445e56,_0xb8eb07){return function(_0x32e3fc){if(_0x32e3fc){return _0x32e3fc['update'](_0x445e56)[_0x7e78('0x28')](function(_0x1d9609){return _0x1d9609;});}return null;};}function removeEntity(_0x4da4e0,_0x36cb04){return function(_0x22ff5a){if(_0x22ff5a){return _0x22ff5a[_0x7e78('0x29')]()['then'](function(){_0x4da4e0[_0x7e78('0x1c')](0xcc)[_0x7e78('0x1d')]();});}};}function handleEntityNotFound(_0x4569cb,_0x80cd18){return function(_0x1622c4){if(!_0x1622c4){_0x4569cb[_0x7e78('0x2a')](0x194);}return _0x1622c4;};}function handleError(_0x19063b,_0x6e5481){_0x6e5481=_0x6e5481||0x1f4;return function(_0x4368af){logger[_0x7e78('0x2b')](_0x4368af[_0x7e78('0x2c')]);if(_0x4368af['name']){delete _0x4368af[_0x7e78('0x2d')];}_0x19063b['status'](_0x6e5481)['send'](_0x4368af);};}exports[_0x7e78('0x2e')]=function(_0x427284,_0x311b63){var _0x8c0807={},_0x5cfd36={},_0x4117a7={'count':0x0,'rows':[]};var _0x203eda=_[_0x7e78('0x2f')](db['Migration'][_0x7e78('0x30')],function(_0x40afa4){return{'name':_0x40afa4['fieldName'],'type':_0x40afa4['type'][_0x7e78('0x31')]};});_0x5cfd36[_0x7e78('0x32')]=_['map'](_0x203eda,_0x7e78('0x2d'));_0x5cfd36[_0x7e78('0x33')]=_[_0x7e78('0x34')](_0x427284[_0x7e78('0x33')]);_0x5cfd36[_0x7e78('0x35')]=_[_0x7e78('0x36')](_0x5cfd36['model'],_0x5cfd36['query']);_0x8c0807[_0x7e78('0x37')]=_[_0x7e78('0x36')](_0x5cfd36['model'],qs['fields'](_0x427284[_0x7e78('0x33')][_0x7e78('0x38')]));_0x8c0807[_0x7e78('0x37')]=_0x8c0807[_0x7e78('0x37')]['length']?_0x8c0807['attributes']:_0x5cfd36[_0x7e78('0x32')];if(!_0x427284['query'][_0x7e78('0x39')]('nolimit')){_0x8c0807[_0x7e78('0x20')]=qs[_0x7e78('0x20')](_0x427284['query'][_0x7e78('0x20')]);_0x8c0807[_0x7e78('0x22')]=qs['offset'](_0x427284[_0x7e78('0x33')][_0x7e78('0x22')]);}_0x8c0807[_0x7e78('0x3a')]=qs[_0x7e78('0x3b')](_0x427284[_0x7e78('0x33')][_0x7e78('0x3b')]);_0x8c0807[_0x7e78('0x3c')]=qs['filters'](_[_0x7e78('0x3d')](_0x427284['query'],_0x5cfd36['filters']),_0x203eda);if(_0x427284[_0x7e78('0x33')]['filter']){_0x8c0807[_0x7e78('0x3c')]=_[_0x7e78('0x3e')](_0x8c0807[_0x7e78('0x3c')],{'$or':_[_0x7e78('0x2f')](_0x203eda,function(_0x45ca67){if(_0x45ca67['type']!==_0x7e78('0x3f')){var _0x7e4786={};_0x7e4786[_0x45ca67[_0x7e78('0x2d')]]={'$like':'%'+_0x427284[_0x7e78('0x33')][_0x7e78('0x40')]+'%'};return _0x7e4786;}})});}_0x8c0807=_[_0x7e78('0x3e')]({},_0x8c0807,_0x427284[_0x7e78('0x41')]);var _0x5a896f={'where':_0x8c0807[_0x7e78('0x3c')]};return db[_0x7e78('0x42')][_0x7e78('0x21')](_0x5a896f)['then'](function(_0x459909){_0x4117a7[_0x7e78('0x21')]=_0x459909;if(_0x427284[_0x7e78('0x33')]['includeAll']){_0x8c0807[_0x7e78('0x43')]=[{'all':!![]}];}return db['Migration'][_0x7e78('0x44')](_0x8c0807);})['then'](function(_0x2f7087){_0x4117a7['rows']=_0x2f7087;return _0x4117a7;})['then'](respondWithFilteredResult(_0x311b63,_0x8c0807))[_0x7e78('0x45')](handleError(_0x311b63,null));}; \ No newline at end of file +var _0x33a4=['where','merge','VIRTUAL','include','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','sort','filters','pick','filter'];(function(_0x37c32e,_0xb05ce4){var _0x2440d8=function(_0x3a4779){while(--_0x3a4779){_0x37c32e['push'](_0x37c32e['shift']());}};_0x2440d8(++_0xb05ce4);}(_0x33a4,0x1c4));var _0x433a=function(_0x17c1ef,_0x541b39){_0x17c1ef=_0x17c1ef-0x0;var _0x49e779=_0x33a4[_0x17c1ef];return _0x49e779;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x433a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x433a('0x1'));var moment=require('moment');var BPromise=require(_0x433a('0x2'));var Mustache=require(_0x433a('0x3'));var util=require(_0x433a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x433a('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x433a('0x6'));var _=require(_0x433a('0x7'));var squel=require(_0x433a('0x8'));var crypto=require(_0x433a('0x9'));var jsforce=require(_0x433a('0xa'));var deskjs=require(_0x433a('0xb'));var toCsv=require(_0x433a('0x5'));var querystring=require(_0x433a('0xc'));var Papa=require(_0x433a('0xd'));var Redis=require(_0x433a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x433a('0xf'));var as=require(_0x433a('0x10'));var hardwareService=require(_0x433a('0x11'));var logger=require(_0x433a('0x12'))(_0x433a('0x13'));var utils=require(_0x433a('0x14'));var config=require(_0x433a('0x15'));var licenseUtil=require(_0x433a('0x16'));var db=require(_0x433a('0x17'))['db'];function respondWithStatusCode(_0x5e1464,_0x51bcb5){_0x51bcb5=_0x51bcb5||0xcc;return function(_0x5f33b1){if(_0x5f33b1){return _0x5e1464[_0x433a('0x18')](_0x51bcb5);}return _0x5e1464[_0x433a('0x19')](_0x51bcb5)[_0x433a('0x1a')]();};}function respondWithResult(_0x4281e2,_0x12cb0d){_0x12cb0d=_0x12cb0d||0xc8;return function(_0x3cb460){if(_0x3cb460){return _0x4281e2[_0x433a('0x19')](_0x12cb0d)[_0x433a('0x1b')](_0x3cb460);}};}function respondWithFilteredResult(_0x52d0c1,_0x361037){return function(_0x5c6854){if(_0x5c6854){var _0x1c1aa3=typeof _0x361037[_0x433a('0x1c')]===_0x433a('0x1d')&&typeof _0x361037[_0x433a('0x1e')]==='undefined';var _0x3ad9fb=_0x5c6854[_0x433a('0x1f')];var _0x114790=_0x1c1aa3?0x0:_0x361037['offset'];var _0x5aac09=_0x1c1aa3?_0x5c6854[_0x433a('0x1f')]:_0x361037[_0x433a('0x1c')]+_0x361037[_0x433a('0x1e')];var _0x114e95;if(_0x5aac09>=_0x3ad9fb){_0x5aac09=_0x3ad9fb;_0x114e95=0xc8;}else{_0x114e95=0xce;}_0x52d0c1[_0x433a('0x19')](_0x114e95);return _0x52d0c1[_0x433a('0x20')](_0x433a('0x21'),_0x114790+'-'+_0x5aac09+'/'+_0x3ad9fb)['json'](_0x5c6854);}return null;};}function patchUpdates(_0x144c25){return function(_0x260f14){try{jsonpatch['apply'](_0x260f14,_0x144c25,!![]);}catch(_0x4e1bd7){return BPromise['reject'](_0x4e1bd7);}return _0x260f14[_0x433a('0x22')]();};}function saveUpdates(_0x2e5ff8,_0x24adef){return function(_0x428afa){if(_0x428afa){return _0x428afa[_0x433a('0x23')](_0x2e5ff8)[_0x433a('0x24')](function(_0x13c213){return _0x13c213;});}return null;};}function removeEntity(_0x50e784,_0x183250){return function(_0x4db894){if(_0x4db894){return _0x4db894[_0x433a('0x25')]()[_0x433a('0x24')](function(){_0x50e784[_0x433a('0x19')](0xcc)[_0x433a('0x1a')]();});}};}function handleEntityNotFound(_0x5cc51c,_0x3edcc0){return function(_0x9995d9){if(!_0x9995d9){_0x5cc51c['sendStatus'](0x194);}return _0x9995d9;};}function handleError(_0x489da3,_0x186fa2){_0x186fa2=_0x186fa2||0x1f4;return function(_0x154d3d){logger[_0x433a('0x26')](_0x154d3d[_0x433a('0x27')]);if(_0x154d3d['name']){delete _0x154d3d[_0x433a('0x28')];}_0x489da3[_0x433a('0x19')](_0x186fa2)['send'](_0x154d3d);};}exports[_0x433a('0x29')]=function(_0x273ee9,_0x3c20a7){var _0x34b93c={},_0x4f8fea={},_0x168fde={'count':0x0,'rows':[]};var _0x31eaa0=_[_0x433a('0x2a')](db[_0x433a('0x2b')][_0x433a('0x2c')],function(_0x20e0ca){return{'name':_0x20e0ca[_0x433a('0x2d')],'type':_0x20e0ca[_0x433a('0x2e')][_0x433a('0x2f')]};});_0x4f8fea[_0x433a('0x30')]=_['map'](_0x31eaa0,_0x433a('0x28'));_0x4f8fea['query']=_[_0x433a('0x31')](_0x273ee9['query']);_0x4f8fea['filters']=_['intersection'](_0x4f8fea[_0x433a('0x30')],_0x4f8fea[_0x433a('0x32')]);_0x34b93c['attributes']=_[_0x433a('0x33')](_0x4f8fea[_0x433a('0x30')],qs[_0x433a('0x34')](_0x273ee9[_0x433a('0x32')]['fields']));_0x34b93c['attributes']=_0x34b93c['attributes'][_0x433a('0x35')]?_0x34b93c[_0x433a('0x36')]:_0x4f8fea['model'];if(!_0x273ee9['query'][_0x433a('0x37')]('nolimit')){_0x34b93c['limit']=qs[_0x433a('0x1e')](_0x273ee9['query'][_0x433a('0x1e')]);_0x34b93c[_0x433a('0x1c')]=qs[_0x433a('0x1c')](_0x273ee9[_0x433a('0x32')][_0x433a('0x1c')]);}_0x34b93c['order']=qs['sort'](_0x273ee9[_0x433a('0x32')][_0x433a('0x38')]);_0x34b93c['where']=qs[_0x433a('0x39')](_[_0x433a('0x3a')](_0x273ee9[_0x433a('0x32')],_0x4f8fea['filters']),_0x31eaa0);if(_0x273ee9[_0x433a('0x32')][_0x433a('0x3b')]){_0x34b93c[_0x433a('0x3c')]=_[_0x433a('0x3d')](_0x34b93c[_0x433a('0x3c')],{'$or':_['map'](_0x31eaa0,function(_0xf9bc53){if(_0xf9bc53[_0x433a('0x2e')]!==_0x433a('0x3e')){var _0x11f7e8={};_0x11f7e8[_0xf9bc53[_0x433a('0x28')]]={'$like':'%'+_0x273ee9[_0x433a('0x32')][_0x433a('0x3b')]+'%'};return _0x11f7e8;}})});}_0x34b93c=_[_0x433a('0x3d')]({},_0x34b93c,_0x273ee9['options']);var _0x566c4a={'where':_0x34b93c[_0x433a('0x3c')]};return db[_0x433a('0x2b')][_0x433a('0x1f')](_0x566c4a)[_0x433a('0x24')](function(_0x38330c){_0x168fde[_0x433a('0x1f')]=_0x38330c;if(_0x273ee9[_0x433a('0x32')]['includeAll']){_0x34b93c[_0x433a('0x3f')]=[{'all':!![]}];}return db[_0x433a('0x2b')]['findAll'](_0x34b93c);})[_0x433a('0x24')](function(_0x2eac58){_0x168fde['rows']=_0x2eac58;return _0x168fde;})['then'](respondWithFilteredResult(_0x3c20a7,_0x34b93c))['catch'](handleError(_0x3c20a7,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index fa8245e..7b12999 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 _0xbcf2=['../../config/logger','api','moment','bluebird','rimraf','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0xbcf2,0x1b7));var _0x2bcf=function(_0x5b6375,_0x563718){_0x5b6375=_0x5b6375-0x0;var _0x4045b4=_0xbcf2[_0x5b6375];return _0x4045b4;};'use strict';var _=require(_0x2bcf('0x0'));var util=require('util');var logger=require(_0x2bcf('0x1'))(_0x2bcf('0x2'));var moment=require(_0x2bcf('0x3'));var BPromise=require(_0x2bcf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2bcf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2bcf('0x6'));module[_0x2bcf('0x7')]=function(_0x5a375a,_0x11008a){return _0x5a375a[_0x2bcf('0x8')](_0x2bcf('0x9'),attributes,{'tableName':_0x2bcf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14e7=['rimraf','./migration.attributes','exports','Migration','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4b7fbf,_0x2e3831){var _0x33bb60=function(_0x48fdf3){while(--_0x48fdf3){_0x4b7fbf['push'](_0x4b7fbf['shift']());}};_0x33bb60(++_0x2e3831);}(_0x14e7,0x16f));var _0x714e=function(_0xd2010a,_0x1780c2){_0xd2010a=_0xd2010a-0x0;var _0x4c4704=_0x14e7[_0xd2010a];return _0x4c4704;};'use strict';var _=require(_0x714e('0x0'));var util=require(_0x714e('0x1'));var logger=require(_0x714e('0x2'))(_0x714e('0x3'));var moment=require(_0x714e('0x4'));var BPromise=require(_0x714e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x714e('0x6'));var rimraf=require(_0x714e('0x7'));var config=require('../../config/environment');var attributes=require(_0x714e('0x8'));module[_0x714e('0x9')]=function(_0x2b76b0,_0x37f3b1){return _0x2b76b0['define'](_0x714e('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 2977604..33b9290 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 _0x7d5a=['request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x552b53,_0x146a29){var _0x458599=function(_0x172939){while(--_0x172939){_0x552b53['push'](_0x552b53['shift']());}};_0x458599(++_0x146a29);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x3bf8e0,_0x5de8a2){_0x3bf8e0=_0x3bf8e0-0x0;var _0x1df07f=_0x7d5a[_0x3bf8e0];return _0x1df07f;};'use strict';var _=require(_0xa7d5('0x0'));var util=require(_0xa7d5('0x1'));var moment=require(_0xa7d5('0x2'));var BPromise=require(_0xa7d5('0x3'));var rs=require(_0xa7d5('0x4'));var fs=require('fs');var Redis=require(_0xa7d5('0x5'));var db=require(_0xa7d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7d5('0x7'));var config=require(_0xa7d5('0x8'));var jayson=require(_0xa7d5('0x9'));var client=jayson[_0xa7d5('0xa')][_0xa7d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80431a,_0x5a8f8a,_0x21ccfa){return new BPromise(function(_0xb5bcd2,_0x2c2c25){return client[_0xa7d5('0xc')](_0x80431a,_0x21ccfa)[_0xa7d5('0xd')](function(_0xf40c67){logger[_0xa7d5('0xe')]('Migration,\x20%s,\x20%s',_0x5a8f8a,_0xa7d5('0xf'));logger[_0xa7d5('0x10')](_0xa7d5('0x11'),_0x5a8f8a,'request\x20sent',JSON[_0xa7d5('0x12')](_0xf40c67));if(_0xf40c67[_0xa7d5('0x13')]){if(_0xf40c67[_0xa7d5('0x13')]['code']===0x1f4){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0x2c2c25(_0xf40c67[_0xa7d5('0x13')]['message']);}logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0xf40c67[_0xa7d5('0x13')][_0xa7d5('0x15')]);return _0xb5bcd2(_0xf40c67[_0xa7d5('0x13')]['message']);}else{logger[_0xa7d5('0xe')](_0xa7d5('0x14'),_0x5a8f8a,_0xa7d5('0xf'));_0xb5bcd2(_0xf40c67['result']['message']);}})[_0xa7d5('0x16')](function(_0x53d884){logger[_0xa7d5('0x13')](_0xa7d5('0x14'),_0x5a8f8a,_0x53d884);_0x2c2c25(_0x53d884);});});} \ No newline at end of file +var _0x3cfb=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0xd1805a,_0x3ea5cb){var _0x1b06f3=function(_0x67ceb9){while(--_0x67ceb9){_0xd1805a['push'](_0xd1805a['shift']());}};_0x1b06f3(++_0x3ea5cb);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x51b8dd,_0x8c9886){_0x51b8dd=_0x51b8dd-0x0;var _0x549961=_0x3cfb[_0x51b8dd];return _0x549961;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require(_0xb3cf('0x3'));var rs=require(_0xb3cf('0x4'));var fs=require('fs');var Redis=require(_0xb3cf('0x5'));var db=require(_0xb3cf('0x6'))['db'];var utils=require(_0xb3cf('0x7'));var logger=require('../../config/logger')(_0xb3cf('0x8'));var config=require(_0xb3cf('0x9'));var jayson=require(_0xb3cf('0xa'));var client=jayson['client'][_0xb3cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7131,_0x42ce15,_0x53be8c){return new BPromise(function(_0x19ed7d,_0x4e4cc8){return client['request'](_0x1b7131,_0x53be8c)[_0xb3cf('0xc')](function(_0x44a55d){logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,_0xb3cf('0xf'));logger[_0xb3cf('0x10')](_0xb3cf('0x11'),_0x42ce15,_0xb3cf('0xf'),JSON[_0xb3cf('0x12')](_0x44a55d));if(_0x44a55d[_0xb3cf('0x13')]){if(_0x44a55d[_0xb3cf('0x13')][_0xb3cf('0x14')]===0x1f4){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x4e4cc8(_0x44a55d['error'][_0xb3cf('0x15')]);}logger[_0xb3cf('0x13')]('Migration,\x20%s,\x20%s',_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x19ed7d(_0x44a55d['error'][_0xb3cf('0x15')]);}else{logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,'request\x20sent');_0x19ed7d(_0x44a55d[_0xb3cf('0x16')][_0xb3cf('0x15')]);}})[_0xb3cf('0x17')](function(_0x442fd6){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x442fd6);_0x4e4cc8(_0x442fd6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 6333b6b..2043d8d 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 _0xe61c=['put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe61c,0xee));var _0xce61=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xe61c[_0x118139];return _0x2fece9;};'use strict';var multer=require(_0xce61('0x0'));var util=require('util');var path=require(_0xce61('0x1'));var timeout=require(_0xce61('0x2'));var express=require(_0xce61('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xce61('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce61('0x5'));var controller=require(_0xce61('0x6'));router[_0xce61('0x7')]('/',auth[_0xce61('0x8')](),controller[_0xce61('0x9')]);router[_0xce61('0x7')](_0xce61('0xa'),auth['isAuthenticated'](),controller[_0xce61('0xb')]);router[_0xce61('0xc')]('/',auth[_0xce61('0x8')](),controller[_0xce61('0xd')]);router[_0xce61('0xe')](_0xce61('0xa'),auth[_0xce61('0x8')](),controller['update']);router[_0xce61('0xf')](_0xce61('0xa'),auth['isAuthenticated'](),controller[_0xce61('0x10')]);module[_0xce61('0x11')]=router; \ No newline at end of file +var _0x65cb=['../../config/environment','./network.controller','isAuthenticated','index','get','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x371e8f,_0x16584e){var _0x3c031a=function(_0x23a589){while(--_0x23a589){_0x371e8f['push'](_0x371e8f['shift']());}};_0x3c031a(++_0x16584e);}(_0x65cb,0xa4));var _0xb65c=function(_0x6f287a,_0xc92ab4){_0x6f287a=_0x6f287a-0x0;var _0x51df4e=_0x65cb[_0x6f287a];return _0x51df4e;};'use strict';var multer=require(_0xb65c('0x0'));var util=require('util');var path=require(_0xb65c('0x1'));var timeout=require(_0xb65c('0x2'));var express=require(_0xb65c('0x3'));var router=express['Router']();var fs_extra=require(_0xb65c('0x4'));var auth=require(_0xb65c('0x5'));var interaction=require(_0xb65c('0x6'));var config=require(_0xb65c('0x7'));var controller=require(_0xb65c('0x8'));router['get']('/',auth[_0xb65c('0x9')](),controller[_0xb65c('0xa')]);router[_0xb65c('0xb')](_0xb65c('0xc'),auth[_0xb65c('0x9')](),controller[_0xb65c('0xd')]);router[_0xb65c('0xe')]('/',auth[_0xb65c('0x9')](),controller['create']);router[_0xb65c('0xf')](_0xb65c('0xc'),auth[_0xb65c('0x9')](),controller[_0xb65c('0x10')]);router['delete'](_0xb65c('0xc'),auth['isAuthenticated'](),controller[_0xb65c('0x11')]);module[_0xb65c('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b30a192..5533181 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 _0x1842=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x1eb6f9,_0x48e25d){var _0x4943ad=function(_0x20e364){while(--_0x20e364){_0x1eb6f9['push'](_0x1eb6f9['shift']());}};_0x4943ad(++_0x48e25d);}(_0x1842,0x172));var _0x2184=function(_0x2940ae,_0x37e966){_0x2940ae=_0x2940ae-0x0;var _0x4b92d1=_0x1842[_0x2940ae];return _0x4b92d1;};'use strict';var Sequelize=require(_0x2184('0x0'));module[_0x2184('0x1')]={'type':{'type':Sequelize[_0x2184('0x2')](_0x2184('0x3'),_0x2184('0x4'),_0x2184('0x5'),'turn')},'value':{'type':Sequelize[_0x2184('0x6')]},'username':{'type':Sequelize[_0x2184('0x6')]},'password':{'type':Sequelize[_0x2184('0x6')]}}; \ No newline at end of file +var _0x2766=['stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2766,0x177));var _0x6276=function(_0x16b334,_0x58bd7f){_0x16b334=_0x16b334-0x0;var _0x54aff2=_0x2766[_0x16b334];return _0x54aff2;};'use strict';var Sequelize=require(_0x6276('0x0'));module[_0x6276('0x1')]={'type':{'type':Sequelize[_0x6276('0x2')]('localnet','externip',_0x6276('0x3'),_0x6276('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6276('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7529086..0029deb 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 _0x3bd3=['where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','include','find','create','body','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','toUpperCase','server/files/templates/network.ejs','toLowerCase','destroy','format','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','catch','status','offset','undefined','limit','count','set','Content-Range','json','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x352d35,_0xb9100){var _0x3708b8=function(_0x38454b){while(--_0x38454b){_0x352d35['push'](_0x352d35['shift']());}};_0x3708b8(++_0xb9100);}(_0x3bd3,0x180));var _0x33bd=function(_0x5d57c7,_0x3547be){_0x5d57c7=_0x5d57c7-0x0;var _0x2ee0ee=_0x3bd3[_0x5d57c7];return _0x2ee0ee;};'use strict';var util=require(_0x33bd('0x0'));var path=require(_0x33bd('0x1'));var ejs=require(_0x33bd('0x2'));var fs=require('fs');var _=require(_0x33bd('0x3'));var qs=require(_0x33bd('0x4'));var logger=require(_0x33bd('0x5'))(_0x33bd('0x6'));var config=require('../../config/environment');var db=require(_0x33bd('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x33bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13dcac,_0x58797f,_0xdf5fae,_0x4dfa9f){return new Promise(function(_0x56c4d1,_0x143926){var _0x2c8aca=_0x4dfa9f||client;return _0x2c8aca[_0x33bd('0x9')](_0x13dcac,_0xdf5fae)[_0x33bd('0xa')](function(_0x4884f3){logger[_0x33bd('0xb')](_0x33bd('0xc'),_0x58797f,_0x33bd('0xd'));logger[_0x33bd('0xe')](_0x33bd('0xf'),_0x58797f,'request\x20sent',JSON['stringify'](_0x4884f3));if(_0x4884f3['error']){if(_0x4884f3['error'][_0x33bd('0x10')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x58797f,_0x4884f3[_0x33bd('0x11')]['message']);return _0x143926(_0x4884f3['error']['message']);}logger[_0x33bd('0x11')](_0x33bd('0xc'),_0x58797f,_0x4884f3['error'][_0x33bd('0x12')]);return _0x56c4d1(_0x4884f3['error'][_0x33bd('0x12')]);}else{logger[_0x33bd('0xb')]('Network,\x20%s,\x20%s',_0x58797f,_0x33bd('0xd'));_0x56c4d1(_0x4884f3['result'][_0x33bd('0x12')]);}})[_0x33bd('0x13')](function(_0xf282f7){logger['error'](_0x33bd('0xc'),_0x58797f,_0xf282f7);_0x143926(_0xf282f7);});});}function respondWithResult(_0x26383d,_0x2460cc){_0x2460cc=_0x2460cc||0xc8;return function(_0x33d6e5){if(_0x33d6e5){return _0x26383d[_0x33bd('0x14')](_0x2460cc)['json'](_0x33d6e5);}};}function respondWithFilteredResult(_0x1a1a85,_0x238eed){return function(_0x148fde){if(_0x148fde){var _0x1a0144=typeof _0x238eed[_0x33bd('0x15')]===_0x33bd('0x16')&&typeof _0x238eed[_0x33bd('0x17')]===_0x33bd('0x16');var _0x2e17a5=_0x148fde[_0x33bd('0x18')];var _0x2b5a83=_0x1a0144?0x0:_0x238eed[_0x33bd('0x15')];var _0x47d1a2=_0x1a0144?_0x148fde['count']:_0x238eed[_0x33bd('0x15')]+_0x238eed['limit'];var _0x472ec5;if(_0x47d1a2>=_0x2e17a5){_0x47d1a2=_0x2e17a5;_0x472ec5=0xc8;}else{_0x472ec5=0xce;}_0x1a1a85[_0x33bd('0x14')](_0x472ec5);return _0x1a1a85[_0x33bd('0x19')](_0x33bd('0x1a'),_0x2b5a83+'-'+_0x47d1a2+'/'+_0x2e17a5)[_0x33bd('0x1b')](_0x148fde);}return null;};}function saveUpdates(_0x4ef349){return function(_0x39c5b5){if(_0x39c5b5){return _0x39c5b5['update'](_0x4ef349)[_0x33bd('0xa')](function(_0x1b9ad0){return _0x1b9ad0;});}return null;};}function removeEntity(_0x5c6dce){return function(_0x19098f){if(_0x19098f){return _0x19098f['destroy']()[_0x33bd('0xa')](function(){_0x5c6dce[_0x33bd('0x14')](0xcc)[_0x33bd('0x1c')]();});}};}function handleEntityNotFound(_0x41d8b0){return function(_0x30541d){if(!_0x30541d){_0x41d8b0[_0x33bd('0x1d')](0x194);}return _0x30541d;};}function handleError(_0x21c068,_0x988f44){_0x988f44=_0x988f44||0x1f4;return function(_0x2f553d){logger[_0x33bd('0x11')](_0x2f553d[_0x33bd('0x1e')]);if(_0x2f553d[_0x33bd('0x1f')]){delete _0x2f553d[_0x33bd('0x1f')];}_0x21c068[_0x33bd('0x14')](_0x988f44)[_0x33bd('0x20')](_0x2f553d);};}exports[_0x33bd('0x21')]=function(_0x2cb7ba,_0x3fa635){var _0x46b46c={},_0x5802ee={},_0x5d910b={'count':0x0,'rows':[]};var _0x1394d2=_[_0x33bd('0x22')](db[_0x33bd('0x23')][_0x33bd('0x24')],function(_0x349297){return{'name':_0x349297['fieldName'],'type':_0x349297[_0x33bd('0x25')][_0x33bd('0x26')]};});_0x5802ee[_0x33bd('0x27')]=_[_0x33bd('0x22')](_0x1394d2,'name');_0x5802ee[_0x33bd('0x28')]=_[_0x33bd('0x29')](_0x2cb7ba['query']);_0x5802ee[_0x33bd('0x2a')]=_[_0x33bd('0x2b')](_0x5802ee[_0x33bd('0x27')],_0x5802ee[_0x33bd('0x28')]);_0x46b46c[_0x33bd('0x2c')]=_[_0x33bd('0x2b')](_0x5802ee[_0x33bd('0x27')],qs['fields'](_0x2cb7ba['query'][_0x33bd('0x2d')]));_0x46b46c['attributes']=_0x46b46c['attributes'][_0x33bd('0x2e')]?_0x46b46c[_0x33bd('0x2c')]:_0x5802ee['model'];if(!_0x2cb7ba[_0x33bd('0x28')][_0x33bd('0x2f')](_0x33bd('0x30'))){_0x46b46c['limit']=qs['limit'](_0x2cb7ba['query']['limit']);_0x46b46c[_0x33bd('0x15')]=qs[_0x33bd('0x15')](_0x2cb7ba[_0x33bd('0x28')][_0x33bd('0x15')]);}_0x46b46c[_0x33bd('0x31')]=qs[_0x33bd('0x32')](_0x2cb7ba[_0x33bd('0x28')][_0x33bd('0x32')]);_0x46b46c[_0x33bd('0x33')]=qs['filters'](_[_0x33bd('0x34')](_0x2cb7ba[_0x33bd('0x28')],_0x5802ee['filters']),_0x1394d2);if(_0x2cb7ba[_0x33bd('0x28')][_0x33bd('0x35')]){_0x46b46c[_0x33bd('0x33')]=_[_0x33bd('0x36')](_0x46b46c[_0x33bd('0x33')],{'$or':_[_0x33bd('0x22')](_0x1394d2,function(_0x65f063){if(_0x65f063[_0x33bd('0x25')]!==_0x33bd('0x37')){var _0x2b129d={};_0x2b129d[_0x65f063[_0x33bd('0x1f')]]={'$like':'%'+_0x2cb7ba[_0x33bd('0x28')]['filter']+'%'};return _0x2b129d;}})});}_0x46b46c=_[_0x33bd('0x36')]({},_0x46b46c,_0x2cb7ba[_0x33bd('0x38')]);var _0x472ab4={'where':_0x46b46c['where']};return db[_0x33bd('0x23')][_0x33bd('0x18')](_0x472ab4)['then'](function(_0x50b1ca){_0x5d910b['count']=_0x50b1ca;if(_0x2cb7ba[_0x33bd('0x28')]['includeAll']){_0x46b46c['include']=[{'all':!![]}];}return db[_0x33bd('0x23')][_0x33bd('0x39')](_0x46b46c);})[_0x33bd('0xa')](function(_0x5a9b78){_0x5d910b[_0x33bd('0x3a')]=_0x5a9b78;return _0x5d910b;})[_0x33bd('0xa')](respondWithFilteredResult(_0x3fa635,_0x46b46c))[_0x33bd('0x13')](handleError(_0x3fa635,null));};exports[_0x33bd('0x3b')]=function(_0x158ba4,_0x38fb5b){var _0x36debc={'raw':!![],'where':{'id':_0x158ba4[_0x33bd('0x3c')]['id']}},_0x452d57={};_0x452d57['model']=_[_0x33bd('0x29')](db['Network'][_0x33bd('0x24')]);_0x452d57[_0x33bd('0x28')]=_[_0x33bd('0x29')](_0x158ba4[_0x33bd('0x28')]);_0x452d57['filters']=_[_0x33bd('0x2b')](_0x452d57[_0x33bd('0x27')],_0x452d57['query']);_0x36debc[_0x33bd('0x2c')]=_[_0x33bd('0x2b')](_0x452d57[_0x33bd('0x27')],qs['fields'](_0x158ba4[_0x33bd('0x28')]['fields']));_0x36debc[_0x33bd('0x2c')]=_0x36debc[_0x33bd('0x2c')][_0x33bd('0x2e')]?_0x36debc[_0x33bd('0x2c')]:_0x452d57[_0x33bd('0x27')];if(_0x158ba4[_0x33bd('0x28')]['includeAll']){_0x36debc[_0x33bd('0x3d')]=[{'all':!![]}];}_0x36debc=_[_0x33bd('0x36')]({},_0x36debc,_0x158ba4[_0x33bd('0x38')]);return db[_0x33bd('0x23')][_0x33bd('0x3e')](_0x36debc)[_0x33bd('0xa')](handleEntityNotFound(_0x38fb5b,null))[_0x33bd('0xa')](respondWithResult(_0x38fb5b,null))[_0x33bd('0x13')](handleError(_0x38fb5b,null));};exports[_0x33bd('0x3f')]=function(_0x139dca,_0x2b9707){var _0x33167e;return db['Network']['create'](_0x139dca[_0x33bd('0x40')],{'raw':!![]})[_0x33bd('0xa')](function(_0x40bfc8){_0x33167e=_0x40bfc8;return db[_0x33bd('0x23')][_0x33bd('0x39')]({'where':{'type':_0x139dca[_0x33bd('0x40')][_0x33bd('0x25')]},'raw':!![]});})[_0x33bd('0xa')](function(_0x3fe806){if(_0x33167e['type']['toUpperCase']()==_0x33bd('0x41')){var _0x4ddd2f=fs[_0x33bd('0x42')](path[_0x33bd('0x43')](config['root'],_0x33bd('0x44')),_0x33bd('0x45'));var _0x624a55=ejs[_0x33bd('0x46')](_0x4ddd2f,{'networks':_0x3fe806||[]});fs[_0x33bd('0x47')](_0x33bd('0x48'),_0x624a55);return respondWithRpcPromise('Reload',_0x33bd('0x3f'),{'module':_0x33bd('0x49')});}else if(_0x33167e['type']['toUpperCase']()==_0x33bd('0x4a')){var _0x2d7c4c=fs[_0x33bd('0x42')](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],_0x33bd('0x4c')),_0x33bd('0x45'));var _0x5dfc0a=ejs['render'](_0x2d7c4c,{'networks':_0x3fe806||[]});fs[_0x33bd('0x47')](_0x33bd('0x4d'),_0x5dfc0a);return respondWithRpcPromise(_0x33bd('0x4e'),_0x33bd('0x3f'),{'module':'res_stun_monitor.so'});}else{var _0x4d3d8d=fs['readFileSync'](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],'server/files/templates/network.ejs'),_0x33bd('0x45'));var _0x1ecdb8=ejs[_0x33bd('0x46')](_0x4d3d8d,{'networks':_0x3fe806||[]});fs[_0x33bd('0x47')](util['format'](_0x33bd('0x4f'),_0x139dca['body']['type']['toLowerCase']()),_0x1ecdb8);return respondWithRpcPromise(_0x33bd('0x4e'),_0x33bd('0x3f'),{'module':_0x33bd('0x50')});}})['then'](function(){return _0x33167e;})[_0x33bd('0xa')](respondWithResult(_0x2b9707,0xc9))[_0x33bd('0x13')](handleError(_0x2b9707,null));};exports[_0x33bd('0x51')]=function(_0x11cae4,_0x17d002){var _0x4ed90f;return db['Network'][_0x33bd('0x3e')]({'where':{'id':_0x11cae4[_0x33bd('0x3c')]['id']}})[_0x33bd('0xa')](handleEntityNotFound(_0x17d002,null))['then'](saveUpdates(_0x11cae4[_0x33bd('0x40')],null))[_0x33bd('0xa')](function(_0x59eff0){if(_0x59eff0){_0x4ed90f=_0x59eff0;return db['Network'][_0x33bd('0x39')]({'where':{'type':_0x4ed90f[_0x33bd('0x25')]},'raw':!![]});}return null;})[_0x33bd('0xa')](function(_0x5a5398){if(_0x4ed90f[_0x33bd('0x25')][_0x33bd('0x52')]()==_0x33bd('0x41')){var _0x2d5d12=fs[_0x33bd('0x42')](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],_0x33bd('0x44')),_0x33bd('0x45'));var _0x50f420=ejs[_0x33bd('0x46')](_0x2d5d12,{'networks':_0x5a5398||[]});fs[_0x33bd('0x47')](_0x33bd('0x48'),_0x50f420);return respondWithRpcPromise(_0x33bd('0x4e'),'update',{'module':_0x33bd('0x49')});}else if(_0x4ed90f['type'][_0x33bd('0x52')]()=='TURN'){var _0x7a7527=fs[_0x33bd('0x42')](path['join'](config['root'],_0x33bd('0x4c')),'utf8');var _0x2df47a=ejs['render'](_0x7a7527,{'networks':_0x5a5398||[]});fs[_0x33bd('0x47')](_0x33bd('0x4d'),_0x2df47a);return respondWithRpcPromise(_0x33bd('0x4e'),_0x33bd('0x51'),{'module':_0x33bd('0x49')});}else{var _0x2b057d=fs[_0x33bd('0x42')](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],_0x33bd('0x53')),_0x33bd('0x45'));var _0x4a254a=ejs['render'](_0x2b057d,{'networks':_0x5a5398||[]});fs['writeFileSync'](util['format'](_0x33bd('0x4f'),_0x11cae4[_0x33bd('0x40')][_0x33bd('0x25')][_0x33bd('0x54')]()),_0x4a254a);return respondWithRpcPromise('Reload','update',{'module':_0x33bd('0x50')});}})['then'](function(_0x1fbfa5){if(_0x1fbfa5){return _0x4ed90f;}return null;})['then'](respondWithResult(_0x17d002,null))['catch'](handleError(_0x17d002,null));};exports[_0x33bd('0x55')]=function(_0x28f79f,_0x181e1d){var _0x4c131d;return db[_0x33bd('0x23')]['find']({'where':{'id':_0x28f79f['params']['id']}})[_0x33bd('0xa')](function(_0x36443a){_0x4c131d=_0x36443a;return _0x36443a;})['then'](handleEntityNotFound(_0x181e1d,null))[_0x33bd('0xa')](removeEntity(_0x181e1d,null))[_0x33bd('0xa')](function(){if(_0x4c131d){return db[_0x33bd('0x23')]['findAll']({'where':{'type':_0x4c131d['type']},'raw':!![]});}})[_0x33bd('0xa')](function(_0x5c2fea){if(_0x4c131d[_0x33bd('0x25')]['toUpperCase']()==_0x33bd('0x41')){var _0x3456be=fs['readFileSync'](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],_0x33bd('0x44')),'utf8');var _0x3727a4=ejs['render'](_0x3456be,{'networks':_0x5c2fea||[]});fs[_0x33bd('0x47')](_0x33bd('0x48'),_0x3727a4);return respondWithRpcPromise('Reload',_0x33bd('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x4c131d[_0x33bd('0x25')]['toUpperCase']()==_0x33bd('0x4a')){var _0x500566=fs[_0x33bd('0x42')](path[_0x33bd('0x43')](config[_0x33bd('0x4b')],_0x33bd('0x4c')),_0x33bd('0x45'));var _0x2303c4=ejs[_0x33bd('0x46')](_0x500566,{'networks':_0x5c2fea||[]});fs[_0x33bd('0x47')](_0x33bd('0x4d'),_0x2303c4);return respondWithRpcPromise(_0x33bd('0x4e'),_0x33bd('0x55'),{'module':'res_stun_monitor.so'});}else{var _0x576d43=fs['readFileSync'](path[_0x33bd('0x43')](config['root'],'server/files/templates/network.ejs'),_0x33bd('0x45'));var _0x2d63cc=ejs[_0x33bd('0x46')](_0x576d43,{'networks':_0x5c2fea||[]});fs[_0x33bd('0x47')](util[_0x33bd('0x56')](_0x33bd('0x4f'),_0x4c131d[_0x33bd('0x25')][_0x33bd('0x54')]()),_0x2d63cc);return respondWithRpcPromise(_0x33bd('0x4e'),_0x33bd('0x55'),{'module':_0x33bd('0x50')});}})[_0x33bd('0x13')](handleError(_0x181e1d,null));}; \ No newline at end of file +var _0x3a86=['toUpperCase','TURN','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','format','STUN','toLowerCase','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','status','offset','undefined','limit','count','update','then','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','type','VIRTUAL','filter','merge','options','Network','includeAll','include','rows','show','params','find','create','body','findAll','readFileSync','join','root','utf8','render','/etc/asterisk/stun_xcally.conf'];(function(_0x4d7a61,_0x3fb6e6){var _0x186f73=function(_0x4eeeeb){while(--_0x4eeeeb){_0x4d7a61['push'](_0x4d7a61['shift']());}};_0x186f73(++_0x3fb6e6);}(_0x3a86,0x1b7));var _0x63a8=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x3a86[_0x23e7c1];return _0x1add43;};'use strict';var util=require(_0x63a8('0x0'));var path=require(_0x63a8('0x1'));var ejs=require(_0x63a8('0x2'));var fs=require('fs');var _=require(_0x63a8('0x3'));var qs=require(_0x63a8('0x4'));var logger=require(_0x63a8('0x5'))(_0x63a8('0x6'));var config=require(_0x63a8('0x7'));var db=require(_0x63a8('0x8'))['db'];var jayson=require(_0x63a8('0x9'));var client=jayson[_0x63a8('0xa')][_0x63a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1e4e,_0x145a50,_0x3c1492,_0xe30b49){return new Promise(function(_0x4cc411,_0x587171){var _0x512cf3=_0xe30b49||client;return _0x512cf3[_0x63a8('0xc')](_0x1b1e4e,_0x3c1492)['then'](function(_0x1d85a1){logger[_0x63a8('0xd')](_0x63a8('0xe'),_0x145a50,'request\x20sent');logger[_0x63a8('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x145a50,'request\x20sent',JSON[_0x63a8('0x10')](_0x1d85a1));if(_0x1d85a1[_0x63a8('0x11')]){if(_0x1d85a1[_0x63a8('0x11')][_0x63a8('0x12')]===0x1f4){logger[_0x63a8('0x11')](_0x63a8('0xe'),_0x145a50,_0x1d85a1['error'][_0x63a8('0x13')]);return _0x587171(_0x1d85a1['error'][_0x63a8('0x13')]);}logger[_0x63a8('0x11')]('Network,\x20%s,\x20%s',_0x145a50,_0x1d85a1['error'][_0x63a8('0x13')]);return _0x4cc411(_0x1d85a1[_0x63a8('0x11')]['message']);}else{logger[_0x63a8('0xd')]('Network,\x20%s,\x20%s',_0x145a50,_0x63a8('0x14'));_0x4cc411(_0x1d85a1[_0x63a8('0x15')]['message']);}})[_0x63a8('0x16')](function(_0x5112a8){logger[_0x63a8('0x11')](_0x63a8('0xe'),_0x145a50,_0x5112a8);_0x587171(_0x5112a8);});});}function respondWithResult(_0x1e93ae,_0x593bcf){_0x593bcf=_0x593bcf||0xc8;return function(_0x2f40a0){if(_0x2f40a0){return _0x1e93ae[_0x63a8('0x17')](_0x593bcf)['json'](_0x2f40a0);}};}function respondWithFilteredResult(_0x17a13d,_0x3e7d33){return function(_0x3c9eb8){if(_0x3c9eb8){var _0x3ba199=typeof _0x3e7d33[_0x63a8('0x18')]===_0x63a8('0x19')&&typeof _0x3e7d33[_0x63a8('0x1a')]===_0x63a8('0x19');var _0x3f6b50=_0x3c9eb8[_0x63a8('0x1b')];var _0x23976e=_0x3ba199?0x0:_0x3e7d33['offset'];var _0x2ec060=_0x3ba199?_0x3c9eb8[_0x63a8('0x1b')]:_0x3e7d33[_0x63a8('0x18')]+_0x3e7d33['limit'];var _0x42d512;if(_0x2ec060>=_0x3f6b50){_0x2ec060=_0x3f6b50;_0x42d512=0xc8;}else{_0x42d512=0xce;}_0x17a13d['status'](_0x42d512);return _0x17a13d['set']('Content-Range',_0x23976e+'-'+_0x2ec060+'/'+_0x3f6b50)['json'](_0x3c9eb8);}return null;};}function saveUpdates(_0x26536c){return function(_0xffd1f3){if(_0xffd1f3){return _0xffd1f3[_0x63a8('0x1c')](_0x26536c)[_0x63a8('0x1d')](function(_0x99c0f0){return _0x99c0f0;});}return null;};}function removeEntity(_0x34accb){return function(_0x331b79){if(_0x331b79){return _0x331b79[_0x63a8('0x1e')]()[_0x63a8('0x1d')](function(){_0x34accb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x334cec){return function(_0x40dd5a){if(!_0x40dd5a){_0x334cec[_0x63a8('0x1f')](0x194);}return _0x40dd5a;};}function handleError(_0x23b420,_0x152a6f){_0x152a6f=_0x152a6f||0x1f4;return function(_0x289e85){logger[_0x63a8('0x11')](_0x289e85[_0x63a8('0x20')]);if(_0x289e85[_0x63a8('0x21')]){delete _0x289e85[_0x63a8('0x21')];}_0x23b420[_0x63a8('0x17')](_0x152a6f)['send'](_0x289e85);};}exports[_0x63a8('0x22')]=function(_0x2c1f14,_0x5ec95a){var _0x4de6e4={},_0x3d8894={},_0x47ecc8={'count':0x0,'rows':[]};var _0x5bb8f5=_['map'](db['Network'][_0x63a8('0x23')],function(_0x3a3ede){return{'name':_0x3a3ede[_0x63a8('0x24')],'type':_0x3a3ede['type'][_0x63a8('0x25')]};});_0x3d8894['model']=_[_0x63a8('0x26')](_0x5bb8f5,_0x63a8('0x21'));_0x3d8894[_0x63a8('0x27')]=_[_0x63a8('0x28')](_0x2c1f14[_0x63a8('0x27')]);_0x3d8894['filters']=_[_0x63a8('0x29')](_0x3d8894[_0x63a8('0x2a')],_0x3d8894[_0x63a8('0x27')]);_0x4de6e4['attributes']=_['intersection'](_0x3d8894[_0x63a8('0x2a')],qs[_0x63a8('0x2b')](_0x2c1f14[_0x63a8('0x27')][_0x63a8('0x2b')]));_0x4de6e4[_0x63a8('0x2c')]=_0x4de6e4['attributes']['length']?_0x4de6e4[_0x63a8('0x2c')]:_0x3d8894[_0x63a8('0x2a')];if(!_0x2c1f14[_0x63a8('0x27')][_0x63a8('0x2d')](_0x63a8('0x2e'))){_0x4de6e4[_0x63a8('0x1a')]=qs[_0x63a8('0x1a')](_0x2c1f14['query'][_0x63a8('0x1a')]);_0x4de6e4['offset']=qs['offset'](_0x2c1f14[_0x63a8('0x27')]['offset']);}_0x4de6e4['order']=qs[_0x63a8('0x2f')](_0x2c1f14[_0x63a8('0x27')][_0x63a8('0x2f')]);_0x4de6e4[_0x63a8('0x30')]=qs[_0x63a8('0x31')](_['pick'](_0x2c1f14[_0x63a8('0x27')],_0x3d8894['filters']),_0x5bb8f5);if(_0x2c1f14[_0x63a8('0x27')]['filter']){_0x4de6e4['where']=_['merge'](_0x4de6e4[_0x63a8('0x30')],{'$or':_[_0x63a8('0x26')](_0x5bb8f5,function(_0x5f2dfb){if(_0x5f2dfb[_0x63a8('0x32')]!==_0x63a8('0x33')){var _0x33827d={};_0x33827d[_0x5f2dfb['name']]={'$like':'%'+_0x2c1f14[_0x63a8('0x27')][_0x63a8('0x34')]+'%'};return _0x33827d;}})});}_0x4de6e4=_[_0x63a8('0x35')]({},_0x4de6e4,_0x2c1f14[_0x63a8('0x36')]);var _0x1dc669={'where':_0x4de6e4[_0x63a8('0x30')]};return db[_0x63a8('0x37')][_0x63a8('0x1b')](_0x1dc669)[_0x63a8('0x1d')](function(_0x1b5396){_0x47ecc8[_0x63a8('0x1b')]=_0x1b5396;if(_0x2c1f14[_0x63a8('0x27')][_0x63a8('0x38')]){_0x4de6e4[_0x63a8('0x39')]=[{'all':!![]}];}return db[_0x63a8('0x37')]['findAll'](_0x4de6e4);})[_0x63a8('0x1d')](function(_0x5b3127){_0x47ecc8[_0x63a8('0x3a')]=_0x5b3127;return _0x47ecc8;})[_0x63a8('0x1d')](respondWithFilteredResult(_0x5ec95a,_0x4de6e4))[_0x63a8('0x16')](handleError(_0x5ec95a,null));};exports[_0x63a8('0x3b')]=function(_0x5b947,_0x17c1e2){var _0x3f77cd={'raw':!![],'where':{'id':_0x5b947[_0x63a8('0x3c')]['id']}},_0x270448={};_0x270448['model']=_[_0x63a8('0x28')](db[_0x63a8('0x37')]['rawAttributes']);_0x270448[_0x63a8('0x27')]=_[_0x63a8('0x28')](_0x5b947['query']);_0x270448[_0x63a8('0x31')]=_[_0x63a8('0x29')](_0x270448['model'],_0x270448['query']);_0x3f77cd[_0x63a8('0x2c')]=_[_0x63a8('0x29')](_0x270448[_0x63a8('0x2a')],qs['fields'](_0x5b947[_0x63a8('0x27')][_0x63a8('0x2b')]));_0x3f77cd[_0x63a8('0x2c')]=_0x3f77cd[_0x63a8('0x2c')]['length']?_0x3f77cd['attributes']:_0x270448[_0x63a8('0x2a')];if(_0x5b947[_0x63a8('0x27')][_0x63a8('0x38')]){_0x3f77cd[_0x63a8('0x39')]=[{'all':!![]}];}_0x3f77cd=_['merge']({},_0x3f77cd,_0x5b947['options']);return db['Network'][_0x63a8('0x3d')](_0x3f77cd)[_0x63a8('0x1d')](handleEntityNotFound(_0x17c1e2,null))[_0x63a8('0x1d')](respondWithResult(_0x17c1e2,null))[_0x63a8('0x16')](handleError(_0x17c1e2,null));};exports['create']=function(_0x4f51f4,_0x2f2960){var _0x4d9a10;return db[_0x63a8('0x37')][_0x63a8('0x3e')](_0x4f51f4[_0x63a8('0x3f')],{'raw':!![]})[_0x63a8('0x1d')](function(_0x332798){_0x4d9a10=_0x332798;return db['Network'][_0x63a8('0x40')]({'where':{'type':_0x4f51f4[_0x63a8('0x3f')][_0x63a8('0x32')]},'raw':!![]});})[_0x63a8('0x1d')](function(_0x2d5ca8){if(_0x4d9a10[_0x63a8('0x32')]['toUpperCase']()=='STUN'){var _0x1cc3bd=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config[_0x63a8('0x43')],'server/files/templates/stun_multiple.ejs'),_0x63a8('0x44'));var _0x25bcfd=ejs[_0x63a8('0x45')](_0x1cc3bd,{'networks':_0x2d5ca8||[]});fs['writeFileSync'](_0x63a8('0x46'),_0x25bcfd);return respondWithRpcPromise('Reload',_0x63a8('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x4d9a10['type'][_0x63a8('0x47')]()==_0x63a8('0x48')){var _0x137df7=fs['readFileSync'](path['join'](config[_0x63a8('0x43')],'server/files/templates/turn_multiple.ejs'),_0x63a8('0x44'));var _0x15f1a8=ejs[_0x63a8('0x45')](_0x137df7,{'networks':_0x2d5ca8||[]});fs[_0x63a8('0x49')](_0x63a8('0x4a'),_0x15f1a8);return respondWithRpcPromise(_0x63a8('0x4b'),_0x63a8('0x3e'),{'module':_0x63a8('0x4c')});}else{var _0x507055=fs[_0x63a8('0x41')](path['join'](config[_0x63a8('0x43')],_0x63a8('0x4d')),_0x63a8('0x44'));var _0x2177f9=ejs[_0x63a8('0x45')](_0x507055,{'networks':_0x2d5ca8||[]});fs[_0x63a8('0x49')](util['format'](_0x63a8('0x4e'),_0x4f51f4[_0x63a8('0x3f')]['type']['toLowerCase']()),_0x2177f9);return respondWithRpcPromise(_0x63a8('0x4b'),'create',{'module':_0x63a8('0x4f')});}})[_0x63a8('0x1d')](function(){return _0x4d9a10;})[_0x63a8('0x1d')](respondWithResult(_0x2f2960,0xc9))[_0x63a8('0x16')](handleError(_0x2f2960,null));};exports[_0x63a8('0x1c')]=function(_0x4ad36d,_0x4692e6){var _0x3f4757;return db['Network'][_0x63a8('0x3d')]({'where':{'id':_0x4ad36d[_0x63a8('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4692e6,null))[_0x63a8('0x1d')](saveUpdates(_0x4ad36d['body'],null))[_0x63a8('0x1d')](function(_0x229ae0){if(_0x229ae0){_0x3f4757=_0x229ae0;return db[_0x63a8('0x37')][_0x63a8('0x40')]({'where':{'type':_0x3f4757[_0x63a8('0x32')]},'raw':!![]});}return null;})['then'](function(_0x55060a){if(_0x3f4757[_0x63a8('0x32')][_0x63a8('0x47')]()=='STUN'){var _0x18eb4d=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config[_0x63a8('0x43')],_0x63a8('0x50')),_0x63a8('0x44'));var _0x1356fb=ejs[_0x63a8('0x45')](_0x18eb4d,{'networks':_0x55060a||[]});fs[_0x63a8('0x49')]('/etc/asterisk/stun_xcally.conf',_0x1356fb);return respondWithRpcPromise(_0x63a8('0x4b'),_0x63a8('0x1c'),{'module':_0x63a8('0x4c')});}else if(_0x3f4757[_0x63a8('0x32')][_0x63a8('0x47')]()==_0x63a8('0x48')){var _0x27d22e=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config[_0x63a8('0x43')],_0x63a8('0x51')),_0x63a8('0x44'));var _0x1eb0c5=ejs[_0x63a8('0x45')](_0x27d22e,{'networks':_0x55060a||[]});fs[_0x63a8('0x49')](_0x63a8('0x4a'),_0x1eb0c5);return respondWithRpcPromise(_0x63a8('0x4b'),'update',{'module':_0x63a8('0x4c')});}else{var _0x1c9fe3=fs[_0x63a8('0x41')](path['join'](config['root'],_0x63a8('0x4d')),_0x63a8('0x44'));var _0x4266b3=ejs['render'](_0x1c9fe3,{'networks':_0x55060a||[]});fs[_0x63a8('0x49')](util[_0x63a8('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x4ad36d[_0x63a8('0x3f')][_0x63a8('0x32')]['toLowerCase']()),_0x4266b3);return respondWithRpcPromise(_0x63a8('0x4b'),_0x63a8('0x1c'),{'module':'chan_sip.so'});}})['then'](function(_0xba09ee){if(_0xba09ee){return _0x3f4757;}return null;})[_0x63a8('0x1d')](respondWithResult(_0x4692e6,null))[_0x63a8('0x16')](handleError(_0x4692e6,null));};exports[_0x63a8('0x1e')]=function(_0x2436ae,_0x31b014){var _0x22e754;return db[_0x63a8('0x37')]['find']({'where':{'id':_0x2436ae[_0x63a8('0x3c')]['id']}})['then'](function(_0x16a575){_0x22e754=_0x16a575;return _0x16a575;})['then'](handleEntityNotFound(_0x31b014,null))[_0x63a8('0x1d')](removeEntity(_0x31b014,null))[_0x63a8('0x1d')](function(){if(_0x22e754){return db[_0x63a8('0x37')][_0x63a8('0x40')]({'where':{'type':_0x22e754[_0x63a8('0x32')]},'raw':!![]});}})[_0x63a8('0x1d')](function(_0x509f84){if(_0x22e754['type'][_0x63a8('0x47')]()==_0x63a8('0x53')){var _0x44317c=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config['root'],_0x63a8('0x50')),_0x63a8('0x44'));var _0x155cd5=ejs[_0x63a8('0x45')](_0x44317c,{'networks':_0x509f84||[]});fs[_0x63a8('0x49')]('/etc/asterisk/stun_xcally.conf',_0x155cd5);return respondWithRpcPromise(_0x63a8('0x4b'),_0x63a8('0x1e'),{'module':_0x63a8('0x4c')});}else if(_0x22e754[_0x63a8('0x32')]['toUpperCase']()==_0x63a8('0x48')){var _0x48adbf=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config[_0x63a8('0x43')],_0x63a8('0x51')),'utf8');var _0x56860f=ejs[_0x63a8('0x45')](_0x48adbf,{'networks':_0x509f84||[]});fs[_0x63a8('0x49')]('/etc/asterisk/turn_xcally.conf',_0x56860f);return respondWithRpcPromise('Reload',_0x63a8('0x1e'),{'module':_0x63a8('0x4c')});}else{var _0xe26c17=fs[_0x63a8('0x41')](path[_0x63a8('0x42')](config[_0x63a8('0x43')],_0x63a8('0x4d')),_0x63a8('0x44'));var _0x39b79c=ejs[_0x63a8('0x45')](_0xe26c17,{'networks':_0x509f84||[]});fs[_0x63a8('0x49')](util[_0x63a8('0x52')](_0x63a8('0x4e'),_0x22e754[_0x63a8('0x32')][_0x63a8('0x54')]()),_0x39b79c);return respondWithRpcPromise(_0x63a8('0x4b'),_0x63a8('0x1e'),{'module':'chan_sip.so'});}})[_0x63a8('0x16')](handleError(_0x31b014,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index eb4ae46..432104b 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 _0x6ae2=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x343d5d,_0x5b0c5a){_0x343d5d=_0x343d5d-0x0;var _0x40a5eb=_0x6ae2[_0x343d5d];return _0x40a5eb;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require(_0x26ae('0x5'));var rp=require(_0x26ae('0x6'));var fs=require('fs');var path=require(_0x26ae('0x7'));var rimraf=require(_0x26ae('0x8'));var config=require('../../config/environment');var attributes=require(_0x26ae('0x9'));module[_0x26ae('0xa')]=function(_0x595da8,_0x5609b0){return _0x595da8[_0x26ae('0xb')](_0x26ae('0xc'),attributes,{'tableName':_0x26ae('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9099=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash'];(function(_0x2149ff,_0x2f55a6){var _0x4555cf=function(_0x4c4a8e){while(--_0x4c4a8e){_0x2149ff['push'](_0x2149ff['shift']());}};_0x4555cf(++_0x2f55a6);}(_0x9099,0x1ac));var _0x9909=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x9099[_0x39bc44];return _0x2916d8;};'use strict';var _=require(_0x9909('0x0'));var util=require('util');var logger=require(_0x9909('0x1'))(_0x9909('0x2'));var moment=require(_0x9909('0x3'));var BPromise=require(_0x9909('0x4'));var rp=require(_0x9909('0x5'));var fs=require('fs');var path=require(_0x9909('0x6'));var rimraf=require(_0x9909('0x7'));var config=require(_0x9909('0x8'));var attributes=require(_0x9909('0x9'));module[_0x9909('0xa')]=function(_0x3947ed,_0x41c07e){return _0x3947ed[_0x9909('0xb')](_0x9909('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index d8f8074..4102911 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(_0x15dfeb,_0x57637c){_0x15dfeb=_0x15dfeb-0x0;var _0xc2d4dd=_0x7a54[_0x15dfeb];return _0xc2d4dd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17764f,_0x581b4a){var _0x5deb84=function(_0x53f81f){while(--_0x53f81f){_0x17764f['push'](_0x17764f['shift']());}};_0x5deb84(++_0x581b4a);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 04c2313..a166656 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 _0x8850=['update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getInteractions','/:id/users','post','create','/:id/notify','notify','addApplications','/:id/send'];(function(_0x4c3070,_0xc2fb4c){var _0x536a44=function(_0x1412a5){while(--_0x1412a5){_0x4c3070['push'](_0x4c3070['shift']());}};_0x536a44(++_0xc2fb4c);}(_0x8850,0x138));var _0x0885=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8850[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x0885('0x0'));var util=require(_0x0885('0x1'));var path=require(_0x0885('0x2'));var timeout=require(_0x0885('0x3'));var express=require(_0x0885('0x4'));var router=express[_0x0885('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0885('0x6'));var config=require(_0x0885('0x7'));var controller=require(_0x0885('0x8'));router[_0x0885('0x9')]('/',auth['isAuthenticated'](),controller[_0x0885('0xa')]);router[_0x0885('0x9')](_0x0885('0xb'),auth[_0x0885('0xc')](),controller[_0x0885('0xd')]);router[_0x0885('0x9')](_0x0885('0xe'),auth['isAuthenticated'](),controller[_0x0885('0xf')]);router[_0x0885('0x9')](_0x0885('0x10'),auth[_0x0885('0xc')](),controller[_0x0885('0x11')]);router[_0x0885('0x9')]('/:id/canned_answers',auth[_0x0885('0xc')](),controller[_0x0885('0x12')]);router['get'](_0x0885('0x13'),auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x0885('0xc')](),controller[_0x0885('0x14')]);router[_0x0885('0x9')](_0x0885('0x15'),auth[_0x0885('0xc')](),controller['getAgents']);router[_0x0885('0x16')]('/',auth['isAuthenticated'](),controller[_0x0885('0x17')]);router['post'](_0x0885('0x10'),auth[_0x0885('0xc')](),controller['addDisposition']);router[_0x0885('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x0885('0x16')](_0x0885('0x18'),controller[_0x0885('0x19')]);router[_0x0885('0x16')](_0x0885('0x13'),auth['isAuthenticated'](),controller[_0x0885('0x1a')]);router[_0x0885('0x16')](_0x0885('0x15'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0885('0x16')](_0x0885('0x1b'),auth[_0x0885('0xc')](),controller['send']);router['put']('/:id',auth[_0x0885('0xc')](),controller[_0x0885('0x1c')]);router[_0x0885('0x1d')](_0x0885('0xe'),auth['isAuthenticated'](),controller[_0x0885('0x1e')]);router[_0x0885('0x1d')](_0x0885('0x10'),auth[_0x0885('0xc')](),controller[_0x0885('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x0885('0xc')](),controller[_0x0885('0x20')]);router[_0x0885('0x1d')](_0x0885('0x15'),auth[_0x0885('0xc')](),controller['removeAgents']);module[_0x0885('0x21')]=router; \ No newline at end of file +var _0x0c92=['getAnswers','getApplications','getInteractions','getAgents','post','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','update','delete','/:id','destroy','removeDispositions','removeAnswers','/:id/users','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','show','/:id/dispositions','/:id/canned_answers'];(function(_0x5987ac,_0x121671){var _0x4df7a2=function(_0x5998b7){while(--_0x5998b7){_0x5987ac['push'](_0x5987ac['shift']());}};_0x4df7a2(++_0x121671);}(_0x0c92,0x145));var _0x20c9=function(_0x16b667,_0xadec02){_0x16b667=_0x16b667-0x0;var _0x58620e=_0x0c92[_0x16b667];return _0x58620e;};'use strict';var multer=require(_0x20c9('0x0'));var util=require(_0x20c9('0x1'));var path=require(_0x20c9('0x2'));var timeout=require(_0x20c9('0x3'));var express=require('express');var router=express[_0x20c9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x20c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x20c9('0x6'));var controller=require(_0x20c9('0x7'));router['get']('/',auth[_0x20c9('0x8')](),controller[_0x20c9('0x9')]);router[_0x20c9('0xa')](_0x20c9('0xb'),auth[_0x20c9('0x8')](),controller['describe']);router[_0x20c9('0xa')]('/:id',auth[_0x20c9('0x8')](),controller[_0x20c9('0xc')]);router['get'](_0x20c9('0xd'),auth[_0x20c9('0x8')](),controller['getDispositions']);router[_0x20c9('0xa')](_0x20c9('0xe'),auth['isAuthenticated'](),controller[_0x20c9('0xf')]);router[_0x20c9('0xa')]('/:id/applications',auth[_0x20c9('0x8')](),controller[_0x20c9('0x10')]);router['get']('/:id/interactions',auth[_0x20c9('0x8')](),controller[_0x20c9('0x11')]);router[_0x20c9('0xa')]('/:id/users',auth[_0x20c9('0x8')](),controller[_0x20c9('0x12')]);router[_0x20c9('0x13')]('/',auth[_0x20c9('0x8')](),controller['create']);router[_0x20c9('0x13')](_0x20c9('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x20c9('0x13')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x20c9('0x13')](_0x20c9('0x14'),controller[_0x20c9('0x15')]);router[_0x20c9('0x13')](_0x20c9('0x16'),auth[_0x20c9('0x8')](),controller[_0x20c9('0x17')]);router[_0x20c9('0x13')]('/:id/users',auth[_0x20c9('0x8')](),controller['addAgents']);router['post'](_0x20c9('0x18'),auth[_0x20c9('0x8')](),controller[_0x20c9('0x19')]);router['put']('/:id',auth[_0x20c9('0x8')](),controller[_0x20c9('0x1a')]);router[_0x20c9('0x1b')](_0x20c9('0x1c'),auth['isAuthenticated'](),controller[_0x20c9('0x1d')]);router[_0x20c9('0x1b')](_0x20c9('0xd'),auth[_0x20c9('0x8')](),controller[_0x20c9('0x1e')]);router[_0x20c9('0x1b')]('/:id/canned_answers',auth[_0x20c9('0x8')](),controller[_0x20c9('0x1f')]);router[_0x20c9('0x1b')](_0x20c9('0x20'),auth[_0x20c9('0x8')](),controller['removeAgents']);module[_0x20c9('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f7c6a8a..c946e37 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 _0x1742=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x652978,_0x250907){var _0x33c7f9=function(_0x4597fc){while(--_0x4597fc){_0x652978['push'](_0x652978['shift']());}};_0x33c7f9(++_0x250907);}(_0x1742,0xab));var _0x2174=function(_0x53e74e,_0x39a29f){_0x53e74e=_0x53e74e-0x0;var _0xd3994d=_0x1742[_0x53e74e];return _0xd3994d;};'use strict';var Sequelize=require(_0x2174('0x0'));var rs=require(_0x2174('0x1'));module[_0x2174('0x2')]={'name':{'type':Sequelize[_0x2174('0x3')],'unique':_0x2174('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x2174('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2174('0x5')]();}},'replyUri':{'type':Sequelize[_0x2174('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2174('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2174('0x6')],'defaultValue':function(){return _0x2174('0x7');}},'notificationSound':{'type':Sequelize[_0x2174('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2174('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2174('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2174('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2174('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2174('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2174('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x2174('0x8')],'defaultValue':![],'comment':_0x2174('0xb'),'set':function(_0x4d763c){if(!_0x4d763c)this[_0x2174('0xc')](_0x2174('0xd'),null);this[_0x2174('0xc')](_0x2174('0xe'),_0x4d763c);}}}; \ No newline at end of file +var _0x8190=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x48f103,_0x31830a){var _0x3ad793=function(_0x526b95){while(--_0x526b95){_0x48f103['push'](_0x48f103['shift']());}};_0x3ad793(++_0x31830a);}(_0x8190,0x13c));var _0x0819=function(_0x4c204e,_0x8ac9a0){_0x4c204e=_0x4c204e-0x0;var _0x35cf52=_0x8190[_0x4c204e];return _0x35cf52;};'use strict';var Sequelize=require(_0x0819('0x0'));var rs=require('randomstring');module[_0x0819('0x1')]={'name':{'type':Sequelize[_0x0819('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0819('0x2')],'defaultValue':function(){return rs[_0x0819('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0819('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0819('0x4')],'defaultValue':function(){return _0x0819('0x5');}},'notificationSound':{'type':Sequelize[_0x0819('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0819('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0819('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0819('0x2')]},'queueTransfer':{'type':Sequelize[_0x0819('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0819('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0819('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0819('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x0819('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x0819('0x6')],'defaultValue':![],'comment':_0x0819('0x9'),'set':function(_0x51c387){if(!_0x51c387)this['setDataValue'](_0x0819('0xa'),null);this[_0x0819('0xb')](_0x0819('0xc'),_0x51c387);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b4eda18..fa3b40f 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 _0xb2b3=['sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','Applications','List','list','applications','orderBy','priority','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','User','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x101dfb,_0x5c638c){var _0x223949=function(_0x4fc907){while(--_0x4fc907){_0x101dfb['push'](_0x101dfb['shift']());}};_0x223949(++_0x5c638c);}(_0xb2b3,0x71));var _0x3b2b=function(_0x9fcd73,_0x105c17){_0x9fcd73=_0x9fcd73-0x0;var _0x364d3a=_0xb2b3[_0x9fcd73];return _0x364d3a;};'use strict';var emlformat=require(_0x3b2b('0x0'));var rimraf=require(_0x3b2b('0x1'));var zipdir=require(_0x3b2b('0x2'));var jsonpatch=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var moment=require(_0x3b2b('0x5'));var BPromise=require(_0x3b2b('0x6'));var Mustache=require('mustache');var util=require(_0x3b2b('0x7'));var path=require(_0x3b2b('0x8'));var sox=require(_0x3b2b('0x9'));var csv=require(_0x3b2b('0xa'));var ejs=require(_0x3b2b('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2b('0xc'));var _=require(_0x3b2b('0xd'));var squel=require(_0x3b2b('0xe'));var crypto=require(_0x3b2b('0xf'));var jsforce=require(_0x3b2b('0x10'));var deskjs=require(_0x3b2b('0x11'));var toCsv=require(_0x3b2b('0xa'));var querystring=require('querystring');var Papa=require(_0x3b2b('0x12'));var Redis=require(_0x3b2b('0x13'));var authService=require(_0x3b2b('0x14'));var qs=require(_0x3b2b('0x15'));var as=require(_0x3b2b('0x16'));var hardwareService=require(_0x3b2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3b2b('0x18'));var config=require(_0x3b2b('0x19'));var licenseUtil=require(_0x3b2b('0x1a'));var db=require(_0x3b2b('0x1b'))['db'];config['redis']=_[_0x3b2b('0x1c')](config[_0x3b2b('0x1d')],{'host':_0x3b2b('0x1e'),'port':0x18eb});var socket=require(_0x3b2b('0x1f'))(new Redis(config[_0x3b2b('0x1d')]));require(_0x3b2b('0x20'))['register'](socket);var jayson=require(_0x3b2b('0x21'));var client=jayson[_0x3b2b('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x3b2b('0x22')][_0x3b2b('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x9f0aa,_0x5593e4,_0x2ab175,_0x4d17c5){return new BPromise(function(_0x21743d,_0xd45d5f){var _0x57a2b4=_0x4d17c5||client;return _0x57a2b4['request'](_0x9f0aa,_0x2ab175)[_0x3b2b('0x24')](function(_0x52bba5){logger[_0x3b2b('0x25')](_0x3b2b('0x26'),_0x5593e4,'request\x20sent');logger[_0x3b2b('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5593e4,_0x3b2b('0x28'),JSON[_0x3b2b('0x29')](_0x52bba5));if(_0x52bba5['error']){if(_0x52bba5['error'][_0x3b2b('0x2a')]===0x1f4){logger[_0x3b2b('0x2b')](_0x3b2b('0x26'),_0x5593e4,_0x52bba5[_0x3b2b('0x2b')][_0x3b2b('0x2c')]);return _0xd45d5f(_0x52bba5[_0x3b2b('0x2b')][_0x3b2b('0x2c')]);}logger[_0x3b2b('0x2b')](_0x3b2b('0x26'),_0x5593e4,_0x52bba5[_0x3b2b('0x2b')][_0x3b2b('0x2c')]);return _0x21743d(_0x52bba5['error'][_0x3b2b('0x2c')]);}else{logger[_0x3b2b('0x25')](_0x3b2b('0x26'),_0x5593e4,'request\x20sent');_0x21743d(_0x52bba5[_0x3b2b('0x2d')]['message']);}})[_0x3b2b('0x2e')](function(_0x50d2e5){logger[_0x3b2b('0x2b')]('OpenchannelAccount,\x20%s,\x20%s',_0x5593e4,_0x50d2e5);_0xd45d5f(_0x50d2e5);});});}function respondWithStatusCode(_0x52da06,_0x399d72){_0x399d72=_0x399d72||0xcc;return function(_0x1aab2e){if(_0x1aab2e){return _0x52da06[_0x3b2b('0x2f')](_0x399d72);}return _0x52da06[_0x3b2b('0x30')](_0x399d72)[_0x3b2b('0x31')]();};}function respondWithResult(_0x156a3c,_0x30574a){_0x30574a=_0x30574a||0xc8;return function(_0x185830){if(_0x185830){return _0x156a3c[_0x3b2b('0x30')](_0x30574a)['json'](_0x185830);}};}function respondWithFilteredResult(_0x4ed952,_0x4fc420){return function(_0x5ca78b){if(_0x5ca78b){var _0x3e2177=typeof _0x4fc420[_0x3b2b('0x32')]===_0x3b2b('0x33')&&typeof _0x4fc420[_0x3b2b('0x34')]===_0x3b2b('0x33');var _0x34fc22=_0x5ca78b[_0x3b2b('0x35')];var _0x4fe900=_0x3e2177?0x0:_0x4fc420[_0x3b2b('0x32')];var _0x54f942=_0x3e2177?_0x5ca78b['count']:_0x4fc420[_0x3b2b('0x32')]+_0x4fc420[_0x3b2b('0x34')];var _0x281f1a;if(_0x54f942>=_0x34fc22){_0x54f942=_0x34fc22;_0x281f1a=0xc8;}else{_0x281f1a=0xce;}_0x4ed952[_0x3b2b('0x30')](_0x281f1a);return _0x4ed952['set']('Content-Range',_0x4fe900+'-'+_0x54f942+'/'+_0x34fc22)[_0x3b2b('0x36')](_0x5ca78b);}return null;};}function patchUpdates(_0x3a7b4b){return function(_0xeb5af4){try{jsonpatch[_0x3b2b('0x37')](_0xeb5af4,_0x3a7b4b,!![]);}catch(_0x2b745e){return BPromise['reject'](_0x2b745e);}return _0xeb5af4[_0x3b2b('0x38')]();};}function saveUpdates(_0x5dde72,_0x2e4311){return function(_0x156748){if(_0x156748){return _0x156748[_0x3b2b('0x39')](_0x5dde72)[_0x3b2b('0x24')](function(_0xca0678){return _0xca0678;});}return null;};}function removeEntity(_0x3fd26f,_0x340f97){return function(_0x2a9db0){if(_0x2a9db0){return _0x2a9db0['destroy']()['then'](function(){var _0x41ef7f=_0x2a9db0['get']({'plain':!![]});var _0x186e39=_0x3b2b('0x3a');return db[_0x3b2b('0x3b')][_0x3b2b('0x3c')]({'where':{'type':_0x186e39,'resourceId':_0x41ef7f['id']}})[_0x3b2b('0x24')](function(){return _0x2a9db0;});})[_0x3b2b('0x24')](function(){_0x3fd26f[_0x3b2b('0x30')](0xcc)[_0x3b2b('0x31')]();});}};}function handleEntityNotFound(_0x41b2af,_0x43ae3a){return function(_0x517eb3){if(!_0x517eb3){_0x41b2af[_0x3b2b('0x2f')](0x194);}return _0x517eb3;};}function handleError(_0x26c013,_0x423421){_0x423421=_0x423421||0x1f4;return function(_0x41a6f1){logger[_0x3b2b('0x2b')](_0x41a6f1[_0x3b2b('0x3d')]);if(_0x41a6f1[_0x3b2b('0x3e')]){delete _0x41a6f1[_0x3b2b('0x3e')];}_0x26c013[_0x3b2b('0x30')](_0x423421)[_0x3b2b('0x3f')](_0x41a6f1);};}exports[_0x3b2b('0x40')]=function(_0x392597,_0x8adb5f){var _0x2a06c4={'include':[{'model':db[_0x3b2b('0x41')],'as':_0x3b2b('0x42')}]},_0x4823bf={},_0x304ca5={'count':0x0,'rows':[]};var _0x27e415=_[_0x3b2b('0x43')](db[_0x3b2b('0x44')][_0x3b2b('0x45')],function(_0x52a867){return{'name':_0x52a867['fieldName'],'type':_0x52a867[_0x3b2b('0x46')]['key']};});_0x4823bf[_0x3b2b('0x47')]=_[_0x3b2b('0x43')](_0x27e415,_0x3b2b('0x3e'));_0x4823bf[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x392597[_0x3b2b('0x48')]);_0x4823bf[_0x3b2b('0x4a')]=_[_0x3b2b('0x4b')](_0x4823bf['model'],_0x4823bf['query']);_0x2a06c4['attributes']=_[_0x3b2b('0x4b')](_0x4823bf[_0x3b2b('0x47')],qs[_0x3b2b('0x4c')](_0x392597[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x2a06c4[_0x3b2b('0x4d')]=_0x2a06c4['attributes'][_0x3b2b('0x4e')]?_0x2a06c4['attributes']:_0x4823bf[_0x3b2b('0x47')];if(!_0x392597[_0x3b2b('0x48')][_0x3b2b('0x4f')](_0x3b2b('0x50'))){_0x2a06c4[_0x3b2b('0x34')]=qs['limit'](_0x392597[_0x3b2b('0x48')]['limit']);_0x2a06c4[_0x3b2b('0x32')]=qs['offset'](_0x392597[_0x3b2b('0x48')][_0x3b2b('0x32')]);}_0x2a06c4[_0x3b2b('0x51')]=qs[_0x3b2b('0x52')](_0x392597['query']['sort']);_0x2a06c4[_0x3b2b('0x53')]=qs['filters'](_[_0x3b2b('0x54')](_0x392597[_0x3b2b('0x48')],_0x4823bf['filters']),_0x27e415);if(_0x392597[_0x3b2b('0x48')]['filter']){_0x2a06c4[_0x3b2b('0x53')]=_[_0x3b2b('0x55')](_0x2a06c4[_0x3b2b('0x53')],{'$or':_[_0x3b2b('0x43')](_0x27e415,function(_0x11bfb2){if(_0x11bfb2['type']!=='VIRTUAL'){var _0x3b020a={};_0x3b020a[_0x11bfb2[_0x3b2b('0x3e')]]={'$like':'%'+_0x392597['query'][_0x3b2b('0x56')]+'%'};return _0x3b020a;}})});}_0x2a06c4=_[_0x3b2b('0x55')]({},_0x2a06c4,_0x392597[_0x3b2b('0x57')]);var _0x25a6d1={'where':_0x2a06c4[_0x3b2b('0x53')]};return db[_0x3b2b('0x44')][_0x3b2b('0x35')](_0x25a6d1)[_0x3b2b('0x24')](function(_0x1e722b){_0x304ca5[_0x3b2b('0x35')]=_0x1e722b;if(_0x392597[_0x3b2b('0x48')][_0x3b2b('0x58')]){_0x2a06c4[_0x3b2b('0x59')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x3b2b('0x5a')](_0x2a06c4);})[_0x3b2b('0x24')](function(_0x4c46db){_0x304ca5[_0x3b2b('0x5b')]=_0x4c46db;return _0x304ca5;})[_0x3b2b('0x24')](respondWithFilteredResult(_0x8adb5f,_0x2a06c4))[_0x3b2b('0x2e')](handleError(_0x8adb5f,null));};exports[_0x3b2b('0x5c')]=function(_0x595b5b,_0x369d9d){var _0x32c5e2={'raw':![],'where':{'id':_0x595b5b[_0x3b2b('0x5d')]['id']},'include':[{'model':db[_0x3b2b('0x41')],'as':_0x3b2b('0x42')}]},_0x413654={};_0x413654[_0x3b2b('0x47')]=_[_0x3b2b('0x49')](db[_0x3b2b('0x44')][_0x3b2b('0x45')]);_0x413654[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x595b5b[_0x3b2b('0x48')]);_0x413654['filters']=_[_0x3b2b('0x4b')](_0x413654[_0x3b2b('0x47')],_0x413654['query']);_0x32c5e2[_0x3b2b('0x4d')]=_[_0x3b2b('0x4b')](_0x413654[_0x3b2b('0x47')],qs[_0x3b2b('0x4c')](_0x595b5b[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x32c5e2['attributes']=_0x32c5e2['attributes'][_0x3b2b('0x4e')]?_0x32c5e2[_0x3b2b('0x4d')]:_0x413654[_0x3b2b('0x47')];if(_0x595b5b['query'][_0x3b2b('0x58')]){_0x32c5e2[_0x3b2b('0x59')]=[{'all':!![]}];}_0x32c5e2=_[_0x3b2b('0x55')]({},_0x32c5e2,_0x595b5b[_0x3b2b('0x57')]);return db['OpenchannelAccount'][_0x3b2b('0x5e')](_0x32c5e2)[_0x3b2b('0x24')](handleEntityNotFound(_0x369d9d,null))[_0x3b2b('0x24')](respondWithResult(_0x369d9d,null))[_0x3b2b('0x2e')](handleError(_0x369d9d,null));};exports[_0x3b2b('0x5f')]=function(_0x3de4ad,_0x484f95){return db[_0x3b2b('0x44')][_0x3b2b('0x5f')](_0x3de4ad['body'],{})['then'](function(_0x45d910){var _0x5d5dce=_0x3de4ad[_0x3b2b('0x60')][_0x3b2b('0x61')]({'plain':!![]});if(!_0x5d5dce)throw new Error(_0x3b2b('0x62'));if(_0x5d5dce[_0x3b2b('0x63')]===_0x3b2b('0x60')){var _0x71c544=_0x45d910[_0x3b2b('0x61')]({'plain':!![]});var _0x1ca7c2='OpenchannelAccounts';return db[_0x3b2b('0x64')]['find']({'where':{'name':_0x1ca7c2,'userProfileId':_0x5d5dce[_0x3b2b('0x65')]},'raw':!![]})[_0x3b2b('0x24')](function(_0x4c6dd2){if(_0x4c6dd2&&_0x4c6dd2['autoAssociation']===0x0){return db[_0x3b2b('0x3b')]['create']({'name':_0x71c544['name'],'resourceId':_0x71c544['id'],'type':_0x4c6dd2[_0x3b2b('0x3e')],'sectionId':_0x4c6dd2['id']},{})['then'](function(){return _0x45d910;});}else{return _0x45d910;}})[_0x3b2b('0x2e')](function(_0x583b52){logger[_0x3b2b('0x2b')](_0x3b2b('0x66'),_0x583b52);throw _0x583b52;});}return _0x45d910;})[_0x3b2b('0x24')](respondWithResult(_0x484f95,0xc9))[_0x3b2b('0x2e')](handleError(_0x484f95,null));};exports['update']=function(_0x4adb01,_0x157a9e){if(_0x4adb01[_0x3b2b('0x67')]['id']){delete _0x4adb01['body']['id'];}return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x4adb01['params']['id']},'include':[{'model':db[_0x3b2b('0x41')],'as':_0x3b2b('0x42')}]})['then'](handleEntityNotFound(_0x157a9e,null))[_0x3b2b('0x24')](saveUpdates(_0x4adb01[_0x3b2b('0x67')],null))[_0x3b2b('0x24')](respondWithResult(_0x157a9e,null))[_0x3b2b('0x2e')](handleError(_0x157a9e,null));};exports[_0x3b2b('0x3c')]=function(_0x21ab0e,_0x380a78){return db['OpenchannelAccount'][_0x3b2b('0x5e')]({'where':{'id':_0x21ab0e[_0x3b2b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x380a78,null))['then'](removeEntity(_0x380a78,null))[_0x3b2b('0x2e')](handleError(_0x380a78,null));};exports['describe']=function(_0x21d6bd,_0x191c6c){return db[_0x3b2b('0x44')][_0x3b2b('0x68')]()[_0x3b2b('0x24')](respondWithResult(_0x191c6c,null))[_0x3b2b('0x2e')](handleError(_0x191c6c,null));};exports[_0x3b2b('0x69')]=function(_0xe27f38,_0x427a16,_0x1b05bf){if(_0xe27f38[_0x3b2b('0x67')]['id']){delete _0xe27f38['body']['id'];}return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0xe27f38[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x427a16,null))[_0x3b2b('0x24')](function(_0x16d11f){if(_0x16d11f){_0xe27f38[_0x3b2b('0x67')]['OpenchannelAccountId']=_0x16d11f['id'];return db[_0x3b2b('0x6a')][_0x3b2b('0x5f')](_0xe27f38['body']);}})[_0x3b2b('0x24')](respondWithResult(_0x427a16,null))[_0x3b2b('0x2e')](handleError(_0x427a16,null));};exports['getDispositions']=function(_0x21dfbe,_0x3d2d67,_0xa2659b){var _0x4ee068={'raw':![],'where':{}};var _0x2e87a4={};var _0x5c6f4b={'count':0x0,'rows':[]};return db[_0x3b2b('0x44')][_0x3b2b('0x6b')]({'where':{'id':_0x21dfbe[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x3d2d67,null))['then'](function(_0x11ee3c){if(_0x11ee3c){_0x2e87a4[_0x3b2b('0x47')]=_['keys'](db[_0x3b2b('0x6a')][_0x3b2b('0x45')]);_0x2e87a4[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x21dfbe[_0x3b2b('0x48')]);_0x2e87a4[_0x3b2b('0x4a')]=_[_0x3b2b('0x4b')](_0x2e87a4[_0x3b2b('0x47')],_0x2e87a4[_0x3b2b('0x48')]);_0x4ee068['attributes']=_[_0x3b2b('0x4b')](_0x2e87a4[_0x3b2b('0x47')],qs['fields'](_0x21dfbe['query'][_0x3b2b('0x4c')]));_0x4ee068['attributes']=_0x4ee068[_0x3b2b('0x4d')][_0x3b2b('0x4e')]?_0x4ee068['attributes']:_0x2e87a4[_0x3b2b('0x47')];if(!_0x21dfbe[_0x3b2b('0x48')]['hasOwnProperty'](_0x3b2b('0x50'))){_0x4ee068[_0x3b2b('0x34')]=qs[_0x3b2b('0x34')](_0x21dfbe['query']['limit']);_0x4ee068[_0x3b2b('0x32')]=qs[_0x3b2b('0x32')](_0x21dfbe[_0x3b2b('0x48')][_0x3b2b('0x32')]);}_0x4ee068[_0x3b2b('0x51')]=qs['sort'](_0x21dfbe[_0x3b2b('0x48')]['sort']);_0x4ee068[_0x3b2b('0x53')]=qs[_0x3b2b('0x4a')](_['pick'](_0x21dfbe[_0x3b2b('0x48')],_0x2e87a4['filters']));_0x4ee068[_0x3b2b('0x53')][_0x3b2b('0x6c')]=_0x11ee3c['id'];if(_0x21dfbe[_0x3b2b('0x48')][_0x3b2b('0x56')]){_0x4ee068[_0x3b2b('0x53')]=_[_0x3b2b('0x55')](_0x4ee068[_0x3b2b('0x53')],{'$or':_[_0x3b2b('0x43')](_0x4ee068[_0x3b2b('0x4d')],function(_0x110ad6){var _0xd2150d={};_0xd2150d[_0x110ad6]={'$like':'%'+_0x21dfbe[_0x3b2b('0x48')]['filter']+'%'};return _0xd2150d;})});}_0x4ee068=_[_0x3b2b('0x55')]({},_0x4ee068,_0x21dfbe['options']);return db[_0x3b2b('0x6a')][_0x3b2b('0x35')]({'where':_0x4ee068[_0x3b2b('0x53')]})[_0x3b2b('0x24')](function(_0x2ea6cd){_0x5c6f4b[_0x3b2b('0x35')]=_0x2ea6cd;if(_0x21dfbe[_0x3b2b('0x48')][_0x3b2b('0x58')]){_0x4ee068[_0x3b2b('0x59')]=[{'all':!![]}];}return db[_0x3b2b('0x6a')][_0x3b2b('0x5a')](_0x4ee068);})[_0x3b2b('0x24')](function(_0x57e161){_0x5c6f4b[_0x3b2b('0x5b')]=_0x57e161;return _0x5c6f4b;});}})[_0x3b2b('0x24')](respondWithFilteredResult(_0x3d2d67,_0x4ee068))[_0x3b2b('0x2e')](handleError(_0x3d2d67,null));};exports[_0x3b2b('0x6d')]=function(_0x4d54d4,_0x428bad,_0x1cbc66){return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x4d54d4[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x428bad,null))['then'](function(_0x432c3e){if(_0x432c3e){return _0x432c3e['removeDispositions'](_0x4d54d4[_0x3b2b('0x48')][_0x3b2b('0x6e')]);}})[_0x3b2b('0x24')](respondWithStatusCode(_0x428bad,null))[_0x3b2b('0x2e')](handleError(_0x428bad,null));};exports[_0x3b2b('0x6f')]=function(_0x2baa18,_0x18b995,_0x53aa68){if(_0x2baa18[_0x3b2b('0x67')]['id']){delete _0x2baa18[_0x3b2b('0x67')]['id'];}return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x2baa18['params']['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x18b995,null))[_0x3b2b('0x24')](function(_0x254631){if(_0x254631){_0x2baa18[_0x3b2b('0x67')][_0x3b2b('0x6c')]=_0x254631['id'];return db[_0x3b2b('0x70')][_0x3b2b('0x5f')](_0x2baa18[_0x3b2b('0x67')]);}})['then'](respondWithResult(_0x18b995,null))[_0x3b2b('0x2e')](handleError(_0x18b995,null));};exports[_0x3b2b('0x71')]=function(_0x11ebe3,_0x3c7640,_0x52b1a8){var _0x53a134={'raw':![],'where':{}};var _0x3ce401={};var _0xdbb0d4={'count':0x0,'rows':[]};return db[_0x3b2b('0x44')][_0x3b2b('0x6b')]({'where':{'id':_0x11ebe3['params']['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x3c7640,null))[_0x3b2b('0x24')](function(_0x2e00ee){if(_0x2e00ee){_0x3ce401['model']=_[_0x3b2b('0x49')](db[_0x3b2b('0x70')][_0x3b2b('0x45')]);_0x3ce401[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x11ebe3[_0x3b2b('0x48')]);_0x3ce401['filters']=_[_0x3b2b('0x4b')](_0x3ce401[_0x3b2b('0x47')],_0x3ce401[_0x3b2b('0x48')]);_0x53a134[_0x3b2b('0x4d')]=_['intersection'](_0x3ce401['model'],qs[_0x3b2b('0x4c')](_0x11ebe3[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x53a134[_0x3b2b('0x4d')]=_0x53a134['attributes'][_0x3b2b('0x4e')]?_0x53a134['attributes']:_0x3ce401['model'];if(!_0x11ebe3[_0x3b2b('0x48')][_0x3b2b('0x4f')](_0x3b2b('0x50'))){_0x53a134['limit']=qs['limit'](_0x11ebe3[_0x3b2b('0x48')]['limit']);_0x53a134['offset']=qs['offset'](_0x11ebe3[_0x3b2b('0x48')]['offset']);}_0x53a134[_0x3b2b('0x51')]=qs['sort'](_0x11ebe3[_0x3b2b('0x48')][_0x3b2b('0x52')]);_0x53a134[_0x3b2b('0x53')]=qs[_0x3b2b('0x4a')](_['pick'](_0x11ebe3[_0x3b2b('0x48')],_0x3ce401[_0x3b2b('0x4a')]));_0x53a134[_0x3b2b('0x53')][_0x3b2b('0x6c')]=_0x2e00ee['id'];if(_0x11ebe3[_0x3b2b('0x48')]['filter']){_0x53a134['where']=_[_0x3b2b('0x55')](_0x53a134['where'],{'$or':_[_0x3b2b('0x43')](_0x53a134[_0x3b2b('0x4d')],function(_0x8fa31c){var _0xb163d2={};_0xb163d2[_0x8fa31c]={'$like':'%'+_0x11ebe3[_0x3b2b('0x48')][_0x3b2b('0x56')]+'%'};return _0xb163d2;})});}_0x53a134=_[_0x3b2b('0x55')]({},_0x53a134,_0x11ebe3['options']);return db[_0x3b2b('0x70')][_0x3b2b('0x35')]({'where':_0x53a134['where']})['then'](function(_0x166ca0){_0xdbb0d4[_0x3b2b('0x35')]=_0x166ca0;if(_0x11ebe3[_0x3b2b('0x48')]['includeAll']){_0x53a134[_0x3b2b('0x59')]=[{'all':!![]}];}return db[_0x3b2b('0x70')][_0x3b2b('0x5a')](_0x53a134);})[_0x3b2b('0x24')](function(_0x1a07f2){_0xdbb0d4[_0x3b2b('0x5b')]=_0x1a07f2;return _0xdbb0d4;});}})[_0x3b2b('0x24')](respondWithFilteredResult(_0x3c7640,_0x53a134))[_0x3b2b('0x2e')](handleError(_0x3c7640,null));};exports['removeAnswers']=function(_0x5a1106,_0x595789,_0x9afebb){return db['OpenchannelAccount'][_0x3b2b('0x5e')]({'where':{'id':_0x5a1106['params']['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x595789,null))[_0x3b2b('0x24')](function(_0x7813a1){if(_0x7813a1){return _0x7813a1[_0x3b2b('0x72')](_0x5a1106[_0x3b2b('0x48')][_0x3b2b('0x6e')]);}})['then'](respondWithStatusCode(_0x595789,null))['catch'](handleError(_0x595789,null));};exports[_0x3b2b('0x73')]=function(_0x5bb3f7,_0x3d3901,_0x1fa371){var _0x4edfbb={'body':_0x5bb3f7['body'],'channel':_0x3b2b('0x74')};var _0xab0ecd=[];var _0x53d978=[];var _0x14c6c8={};var _0xd222e2=![];return db[_0x3b2b('0x75')]['describe']()[_0x3b2b('0x24')](function(_0x495003){if(!_0x495003){throw new db[(_0x3b2b('0x76'))][(_0x3b2b('0x77'))](_0x3b2b('0x78'));}_0xab0ecd=_['difference'](_['keys'](_0x495003),['createdAt',_0x3b2b('0x79')]);_0x53d978=_[_0x3b2b('0x7a')](_['keys'](_0x495003),[_0x3b2b('0x7b'),_0x3b2b('0x79'),_0x3b2b('0x7c'),_0x3b2b('0x7d')]);if(_0x5bb3f7['body']['id']){delete _0x5bb3f7[_0x3b2b('0x67')]['id'];}if(_[_0x3b2b('0x7e')](_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x7f')])){throw new db[(_0x3b2b('0x76'))][(_0x3b2b('0x77'))](_0x3b2b('0x80'));}if(_[_0x3b2b('0x7e')](_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x67')])||_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x67')]===''){throw new db[(_0x3b2b('0x76'))][(_0x3b2b('0x77'))](_0x3b2b('0x81'));}if(_[_0x3b2b('0x7e')](_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x82')])){throw new db['Sequelize'][(_0x3b2b('0x77'))](_0x3b2b('0x83')+_0x53d978);}if(!_[_0x3b2b('0x84')](_0x53d978,_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x82')])){throw new db[(_0x3b2b('0x76'))][(_0x3b2b('0x77'))](_0x3b2b('0x85')+_0x53d978);}_0x14c6c8[_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x82')]]=_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x7f')];})[_0x3b2b('0x24')](function(){return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x5bb3f7[_0x3b2b('0x5d')]['id']},'include':[{'model':db[_0x3b2b('0x86')],'as':'List','include':[{'model':db[_0x3b2b('0x75')],'as':_0x3b2b('0x87'),'where':_0x14c6c8,'limit':0x1,'order':[['updatedAt',_0x3b2b('0x88')]]}]},{'model':db[_0x3b2b('0x89')],'as':_0x3b2b('0x8a')}]});})[_0x3b2b('0x24')](handleEntityNotFound(_0x3d3901,null))[_0x3b2b('0x24')](function(_0x4d1ca5){if(_0x4d1ca5&&_0x4d1ca5[_0x3b2b('0x8b')]){_0x4edfbb['account']=_0x4d1ca5;_0x4edfbb['applications']=_0x4d1ca5['Applications'];_0x4edfbb[_0x3b2b('0x8c')]=_0x4d1ca5[_0x3b2b('0x8b')];_0x4edfbb[_0x3b2b('0x8d')]=_[_0x3b2b('0x8e')](_0x4edfbb[_0x3b2b('0x8d')],[_0x3b2b('0x8f')],[_0x3b2b('0x90')]);if(_0x4edfbb[_0x3b2b('0x91')][_0x3b2b('0x8a')]){delete _0x4edfbb[_0x3b2b('0x91')][_0x3b2b('0x8a')];}if(_0x4edfbb[_0x3b2b('0x91')]['List']&&_0x4edfbb[_0x3b2b('0x91')][_0x3b2b('0x8b')][_0x3b2b('0x87')][_0x3b2b('0x4e')]){return _0x4edfbb[_0x3b2b('0x91')][_0x3b2b('0x8b')][_0x3b2b('0x87')][0x0];}var _0x578f0b=_[_0x3b2b('0x1c')](_0x5bb3f7['body'],{'firstName':_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x7f')],'ListId':_0x4d1ca5['ListId']});_0x578f0b[_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x82')]]=_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x7f')];return db[_0x3b2b('0x75')]['create'](_0x578f0b,{'fields':_0xab0ecd,'raw':!![]});}})['then'](handleEntityNotFound(_0x3d3901,null))['then'](function(_0x4af269){_0x4edfbb[_0x3b2b('0x92')]=_0x4af269;if(_0x4af269){var _0x26dd5e={'ContactId':_0x4af269['id'],'OpenchannelAccountId':_0x5bb3f7[_0x3b2b('0x5d')]['id'],'from':(_0x4af269[_0x3b2b('0x93')]||'')+'\x20'+(_0x4af269[_0x3b2b('0x94')]||'')};var _0x132d54={'OpenchannelAccountId':_0x5bb3f7['params']['id'],'closed':![]};if(_0x5bb3f7['body'][_0x3b2b('0x95')]){_0x132d54['threadId']=_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x95')];return db['OpenchannelInteraction'][_0x3b2b('0x5e')]({'where':_0x132d54})[_0x3b2b('0x24')](function(_0xe0ce62){if(_0xe0ce62){return[_0xe0ce62,![]];}_0x26dd5e['threadId']=_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x95')];_0x26dd5e[_0x3b2b('0x96')]=_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x96')];return db['OpenchannelInteraction'][_0x3b2b('0x5f')](_0x26dd5e)['then'](function(_0x58d12f){return[_0x58d12f,!![]];});});}else{_0x132d54[_0x3b2b('0x95')]=null;}_0x132d54['ContactId']=_0x4af269['id'];return db[_0x3b2b('0x97')][_0x3b2b('0x5e')]({'where':_0x132d54})[_0x3b2b('0x24')](function(_0x350a78){if(_0x350a78){return[_0x350a78,![]];}return db[_0x3b2b('0x97')][_0x3b2b('0x5f')](_0x26dd5e)[_0x3b2b('0x24')](function(_0x1d872d){return[_0x1d872d,!![]];});});}})['spread'](function(_0x59b124,_0x4514cc){if(_0x59b124){_0xd222e2=_0x4514cc;if(!_0x4514cc){var _0x346a0f={'from':(_0x4edfbb[_0x3b2b('0x92')][_0x3b2b('0x93')]||'')+'\x20'+(_0x4edfbb[_0x3b2b('0x92')][_0x3b2b('0x94')]||'')};if(_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x95')]&&_0x5bb3f7[_0x3b2b('0x67')]['messageId']&&_0x5bb3f7[_0x3b2b('0x67')]['threadId']!=_0x5bb3f7['body'][_0x3b2b('0x98')]){_0x346a0f[_0x3b2b('0x95')]=_0x5bb3f7['body'][_0x3b2b('0x98')];}return _0x59b124[_0x3b2b('0x39')](_0x346a0f);}else{return _0x59b124;}}})[_0x3b2b('0x24')](function(_0x4bc222){_0x4edfbb[_0x3b2b('0x99')]=_0x4bc222[_0x3b2b('0x61')]({'plain':!![]});_0x4edfbb[_0x3b2b('0x99')][_0x3b2b('0x9a')]=_0xd222e2;if(_0x4edfbb[_0x3b2b('0x99')][_0x3b2b('0x9a')]){if(_0x4edfbb[_0x3b2b('0x91')][_0x3b2b('0x9b')]){_0x4edfbb[_0x3b2b('0x8d')][_0x3b2b('0x9c')]({'id':0x0,'priority':_0x4edfbb[_0x3b2b('0x8d')]['length']+0x1,'app':_0x3b2b('0x9d'),'appdata':'unmanaged','interval':_0x3b2b('0x9e')});}}return db[_0x3b2b('0x9f')][_0x3b2b('0x5f')]({'body':_0x5bb3f7[_0x3b2b('0x67')][_0x3b2b('0x67')],'OpenchannelAccountId':_0x5bb3f7['params']['id'],'OpenchannelInteractionId':_0x4bc222['id'],'direction':'in','ContactId':_0x4edfbb[_0x3b2b('0x92')]['id'],'AttachmentId':_0x5bb3f7['body']['AttachmentId']});})[_0x3b2b('0x24')](function(_0x260fab){_0x4edfbb[_0x3b2b('0x2c')]=_0x260fab;if(_0x4edfbb[_0x3b2b('0x99')][_0x3b2b('0xa0')]){return db['User']['find']({'attributes':['id',_0x3b2b('0x3e')],'where':{'id':_0x4edfbb['interaction'][_0x3b2b('0xa0')]}})['then'](function(_0x57100b){if(_0x57100b){_0x4edfbb[_0x3b2b('0x8d')][_0x3b2b('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x57100b[_0x3b2b('0x3e')]+','+(_0x4edfbb['account'][_0x3b2b('0xa2')]||0xa),'interval':_0x3b2b('0x9e')});_0x4edfbb[_0x3b2b('0xa3')]=![];}return respondWithRpcPromise(_0x3b2b('0xa4'),_0x3b2b('0xa5'),_0x4edfbb);});}return respondWithRpcPromise(_0x3b2b('0xa4'),_0x3b2b('0xa5'),_0x4edfbb);})[_0x3b2b('0x24')](function(_0x398bf9){respondWithRpcPromise(_0x3b2b('0xa6'),'EventManager',{'event':_0x3b2b('0x73'),'message':_0x398bf9},client9002);return _0x398bf9;})['then'](respondWithResult(_0x3d3901,null))['catch'](handleError(_0x3d3901,null));};exports[_0x3b2b('0xa7')]=function(_0x21f583,_0x3456c1){var _0x436b14=_0x21f583[_0x3b2b('0x5d')]['id'];var _0x29539f=_0x21f583[_0x3b2b('0x67')];var _0x40df71=0xc8;var _0x3a3a14=null;return db[_0x3b2b('0xa8')][_0x3b2b('0xa9')]({'isolationLevel':db[_0x3b2b('0xa8')][_0x3b2b('0xaa')]['ISOLATION_LEVELS'][_0x3b2b('0xab')]},function(_0x2c13b1){return db[_0x3b2b('0x44')][_0x3b2b('0x6b')]({'where':{'id':_0x436b14},'transaction':_0x2c13b1})[_0x3b2b('0x24')](function(_0x1c5d88){if(_0x1c5d88){return db[_0x3b2b('0x89')][_0x3b2b('0x3c')]({'where':{'OpenchannelAccountId':_0x436b14},'transaction':_0x2c13b1})['then'](function(){var _0x4ca69b=_[_0x3b2b('0x43')](_0x29539f,function(_0x2ffbbe){_0x2ffbbe['OpenchannelAccountId']=_0x436b14;return _0x2ffbbe;});return db[_0x3b2b('0x89')][_0x3b2b('0xac')](_0x4ca69b,{'transaction':_0x2c13b1});});}else{_0x40df71=0x194;_0x3a3a14=[];}});})[_0x3b2b('0x24')](function(){if(_0x40df71!==0x194){return db['OpenchannelApplication'][_0x3b2b('0xad')]({'where':{'OpenchannelAccountId':_0x436b14},'order':'priority'})[_0x3b2b('0x24')](function(_0x5d8723){_0x3a3a14=_0x5d8723;});}})[_0x3b2b('0x2e')](function(_0x53b8d6){_0x40df71=0x1f4;logger[_0x3b2b('0x2b')](_0x53b8d6[_0x3b2b('0x3d')]);if(_0x53b8d6[_0x3b2b('0x3e')]){delete _0x53b8d6[_0x3b2b('0x3e')];}_0x3a3a14=_0x53b8d6;})['finally'](function(){if(_0x3a3a14===null){_0x3456c1['sendStatus'](_0x40df71);}else{if(_0x40df71===0x1f4){_0x3456c1[_0x3b2b('0x30')](_0x40df71)[_0x3b2b('0x3f')](_0x3a3a14);}else{_0x3456c1[_0x3b2b('0x30')](_0x40df71)[_0x3b2b('0x36')](_0x3a3a14);}}});};exports[_0x3b2b('0xae')]=function(_0x11c340,_0x17d388,_0x33448c){var _0x228147={};var _0x514395={};var _0x829180;var _0x19d659;return db[_0x3b2b('0x44')][_0x3b2b('0x6b')]({'where':{'id':_0x11c340[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x17d388,null))[_0x3b2b('0x24')](function(_0x273860){if(_0x273860){_0x829180=_0x273860;_0x514395[_0x3b2b('0x47')]=_['keys'](db['OpenchannelApplication'][_0x3b2b('0x45')]);_0x514395[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x11c340[_0x3b2b('0x48')]);_0x514395['filters']=_[_0x3b2b('0x4b')](_0x514395[_0x3b2b('0x47')],_0x514395['query']);_0x228147[_0x3b2b('0x4d')]=_[_0x3b2b('0x4b')](_0x514395[_0x3b2b('0x47')],qs['fields'](_0x11c340[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x228147[_0x3b2b('0x4d')]=_0x228147[_0x3b2b('0x4d')][_0x3b2b('0x4e')]?_0x228147[_0x3b2b('0x4d')]:_0x514395[_0x3b2b('0x47')];_0x228147[_0x3b2b('0x51')]=qs[_0x3b2b('0x52')](_0x11c340[_0x3b2b('0x48')][_0x3b2b('0x52')]);_0x228147['where']=qs[_0x3b2b('0x4a')](_[_0x3b2b('0x54')](_0x11c340[_0x3b2b('0x48')],_0x514395['filters']));if(_0x11c340[_0x3b2b('0x48')]['filter']){_0x228147['where']=_['merge'](_0x228147[_0x3b2b('0x53')],{'$or':_[_0x3b2b('0x43')](_0x228147[_0x3b2b('0x4d')],function(_0x3a6e0d){var _0x5d3313={};_0x5d3313[_0x3a6e0d]={'$like':'%'+_0x11c340[_0x3b2b('0x48')]['filter']+'%'};return _0x5d3313;})});}_0x228147=_['merge']({},_0x228147,_0x11c340[_0x3b2b('0x57')]);return _0x829180[_0x3b2b('0xae')](_0x228147);}})[_0x3b2b('0x24')](function(_0xd65ae2){if(_0xd65ae2){_0x19d659=_0xd65ae2[_0x3b2b('0x4e')];if(!_0x11c340['query'][_0x3b2b('0x4f')](_0x3b2b('0x50'))){_0x228147['limit']=qs[_0x3b2b('0x34')](_0x11c340[_0x3b2b('0x48')][_0x3b2b('0x34')]);_0x228147[_0x3b2b('0x32')]=qs['offset'](_0x11c340[_0x3b2b('0x48')][_0x3b2b('0x32')]);}return _0x829180[_0x3b2b('0xae')](_0x228147);}})[_0x3b2b('0x24')](function(_0xda69a8){if(_0xda69a8){return _0xda69a8?{'count':_0x19d659,'rows':_0xda69a8}:null;}})[_0x3b2b('0x24')](respondWithResult(_0x17d388,null))[_0x3b2b('0x2e')](handleError(_0x17d388,null));};exports[_0x3b2b('0xaf')]=function(_0x75e4ff,_0x21f733,_0x27b8cd){var _0x37af0c={'raw':![],'where':{}};var _0x541862={};var _0xfb4fdf={'count':0x0,'rows':[]};return db[_0x3b2b('0x44')][_0x3b2b('0x6b')]({'where':{'id':_0x75e4ff[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x21f733,null))[_0x3b2b('0x24')](function(_0x1e0ab1){if(_0x1e0ab1){_0x541862[_0x3b2b('0x47')]=_[_0x3b2b('0x49')](db['OpenchannelInteraction'][_0x3b2b('0x45')]);_0x541862['query']=_[_0x3b2b('0x49')](_0x75e4ff['query']);_0x541862[_0x3b2b('0x4a')]=_['intersection'](_0x541862[_0x3b2b('0x47')],_0x541862[_0x3b2b('0x48')]);_0x37af0c['attributes']=_[_0x3b2b('0x4b')](_0x541862[_0x3b2b('0x47')],qs[_0x3b2b('0x4c')](_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x37af0c[_0x3b2b('0x4d')]=_0x37af0c[_0x3b2b('0x4d')]['length']?_0x37af0c['attributes']:_0x541862[_0x3b2b('0x47')];if(!_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0x4f')](_0x3b2b('0x50'))){_0x37af0c['limit']=qs[_0x3b2b('0x34')](_0x75e4ff['query'][_0x3b2b('0x34')]);_0x37af0c['offset']=qs[_0x3b2b('0x32')](_0x75e4ff[_0x3b2b('0x48')]['offset']);}_0x37af0c[_0x3b2b('0x51')]=qs['sort'](_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0x52')]);_0x37af0c[_0x3b2b('0x53')]=qs[_0x3b2b('0x4a')](_[_0x3b2b('0x54')](_0x75e4ff[_0x3b2b('0x48')],_0x541862[_0x3b2b('0x4a')]));_0x37af0c['where'][_0x3b2b('0x6c')]=_0x1e0ab1['id'];if(_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0x56')]){_0x37af0c[_0x3b2b('0x53')]=_['merge'](_0x37af0c['where'],{'$or':_['map'](_0x37af0c['attributes'],function(_0x48a5c2){var _0x358322={};_0x358322[_0x48a5c2]={'$like':'%'+_0x75e4ff['query'][_0x3b2b('0x56')]+'%'};return _0x358322;})});}_0x37af0c=_[_0x3b2b('0x55')]({},_0x37af0c,_0x75e4ff['options']);return db[_0x3b2b('0x97')][_0x3b2b('0x35')]({'where':_0x37af0c[_0x3b2b('0x53')]})[_0x3b2b('0x24')](function(_0xdc29d){_0xfb4fdf[_0x3b2b('0x35')]=_0xdc29d;if(_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0x58')]){_0x37af0c['include']=[{'model':db[_0x3b2b('0x75')],'as':_0x3b2b('0xb0'),'required':![]},{'model':db['User'],'as':_0x3b2b('0xb1'),'attributes':[_0x3b2b('0x3e'),_0x3b2b('0xb2'),_0x3b2b('0xb3')],'required':![]},{'model':db[_0x3b2b('0xb4')],'as':'Tags','attributes':['id',_0x3b2b('0x3e'),_0x3b2b('0xb5')],'where':_0x75e4ff[_0x3b2b('0x48')]['tag']?{'id':_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0xb6')]}:undefined,'required':_0x75e4ff[_0x3b2b('0x48')][_0x3b2b('0xb6')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x3b2b('0x5a')](_0x37af0c);})[_0x3b2b('0x24')](function(_0x5ed560){_0xfb4fdf['rows']=_0x5ed560;return _0xfb4fdf;});}})['then'](respondWithFilteredResult(_0x21f733,_0x37af0c))[_0x3b2b('0x2e')](handleError(_0x21f733,null));};exports['addAgents']=function(_0x2db924,_0x45e87a,_0x4ba32e){return db['OpenchannelAccount'][_0x3b2b('0x5e')]({'where':{'id':_0x2db924[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x45e87a,null))[_0x3b2b('0x24')](function(_0x20eb84){if(_0x20eb84){return _0x20eb84[_0x3b2b('0xb7')](_0x2db924[_0x3b2b('0x67')][_0x3b2b('0x6e')],_[_0x3b2b('0xb8')](_0x2db924[_0x3b2b('0x67')],['ids','id'])||{})[_0x3b2b('0xb9')](function(_0x496d4c){for(var _0x570885=0x0;_0x570885<_0x2db924[_0x3b2b('0x67')]['ids'][_0x3b2b('0x4e')];_0x570885+=0x1){socket[_0x3b2b('0xba')](_0x3b2b('0xbb'),{'UserId':Number(_0x2db924['body']['ids'][_0x570885]),'OpenchannelAccountId':Number(_0x2db924[_0x3b2b('0x5d')]['id'])});}return _0x496d4c;});}})[_0x3b2b('0x24')](respondWithResult(_0x45e87a,null))[_0x3b2b('0x2e')](handleError(_0x45e87a,null));};exports[_0x3b2b('0xbc')]=function(_0x24b1bf,_0x127a88,_0x5b9150){return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x24b1bf[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x127a88,null))[_0x3b2b('0x24')](function(_0x138fde){if(_0x138fde){return _0x138fde['removeAgents'](_0x24b1bf[_0x3b2b('0x48')][_0x3b2b('0x6e')])[_0x3b2b('0x24')](function(){if(_['isArray'](_0x24b1bf[_0x3b2b('0x48')][_0x3b2b('0x6e')])){for(var _0x3fb752=0x0;_0x3fb752<_0x24b1bf[_0x3b2b('0x48')][_0x3b2b('0x6e')]['length'];_0x3fb752+=0x1){socket['emit'](_0x3b2b('0xbd'),{'UserId':Number(_0x24b1bf[_0x3b2b('0x48')]['ids'][_0x3fb752]),'OpenchannelAccountId':Number(_0x24b1bf['params']['id'])});}}else{socket[_0x3b2b('0xba')](_0x3b2b('0xbd'),{'UserId':Number(_0x24b1bf[_0x3b2b('0x48')][_0x3b2b('0x6e')]),'OpenchannelAccountId':Number(_0x24b1bf[_0x3b2b('0x5d')]['id'])});}});}})[_0x3b2b('0x24')](respondWithStatusCode(_0x127a88,null))['catch'](handleError(_0x127a88,null));};exports[_0x3b2b('0xbe')]=function(_0x46c9cc,_0x50e7cf,_0x24401c){var _0x102ce2={};var _0x250900={};var _0x3f5f7b;var _0x22bfd0;return db['OpenchannelAccount'][_0x3b2b('0x6b')]({'where':{'id':_0x46c9cc[_0x3b2b('0x5d')]['id']}})[_0x3b2b('0x24')](handleEntityNotFound(_0x50e7cf,null))['then'](function(_0x48f831){if(_0x48f831){_0x3f5f7b=_0x48f831;_0x250900['model']=_[_0x3b2b('0x49')](db[_0x3b2b('0xbf')][_0x3b2b('0x45')]);_0x250900[_0x3b2b('0x48')]=_[_0x3b2b('0x49')](_0x46c9cc[_0x3b2b('0x48')]);_0x250900['filters']=_['intersection'](_0x250900[_0x3b2b('0x47')],_0x250900[_0x3b2b('0x48')]);_0x102ce2[_0x3b2b('0x4d')]=_['intersection'](_0x250900[_0x3b2b('0x47')],qs[_0x3b2b('0x4c')](_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x4c')]));_0x102ce2['attributes']=_0x102ce2[_0x3b2b('0x4d')][_0x3b2b('0x4e')]?_0x102ce2[_0x3b2b('0x4d')]:_0x250900[_0x3b2b('0x47')];_0x102ce2[_0x3b2b('0x51')]=qs[_0x3b2b('0x52')](_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x52')]);_0x102ce2[_0x3b2b('0x53')]=qs[_0x3b2b('0x4a')](_[_0x3b2b('0x54')](_0x46c9cc[_0x3b2b('0x48')],_0x250900[_0x3b2b('0x4a')]));if(_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x56')]){_0x102ce2[_0x3b2b('0x53')]=_[_0x3b2b('0x55')](_0x102ce2[_0x3b2b('0x53')],{'$or':_[_0x3b2b('0x43')](_0x102ce2[_0x3b2b('0x4d')],function(_0x3c3a0d){var _0x3419e6={};_0x3419e6[_0x3c3a0d]={'$like':'%'+_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x56')]+'%'};return _0x3419e6;})});}_0x102ce2=_['merge']({},_0x102ce2,_0x46c9cc[_0x3b2b('0x57')]);return _0x3f5f7b[_0x3b2b('0xbe')](_0x102ce2);}})[_0x3b2b('0x24')](function(_0x3a6fb1){if(_0x3a6fb1){_0x22bfd0=_0x3a6fb1['length'];if(!_0x46c9cc[_0x3b2b('0x48')]['hasOwnProperty'](_0x3b2b('0x50'))){_0x102ce2[_0x3b2b('0x34')]=qs[_0x3b2b('0x34')](_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x34')]);_0x102ce2[_0x3b2b('0x32')]=qs[_0x3b2b('0x32')](_0x46c9cc[_0x3b2b('0x48')][_0x3b2b('0x32')]);}return _0x3f5f7b[_0x3b2b('0xbe')](_0x102ce2);}})[_0x3b2b('0x24')](function(_0x361473){if(_0x361473){return _0x361473?{'count':_0x22bfd0,'rows':_0x361473}:null;}})['then'](respondWithResult(_0x50e7cf,null))[_0x3b2b('0x2e')](handleError(_0x50e7cf,null));};exports[_0x3b2b('0x3f')]=function(_0x1d53e4,_0x9f07eb,_0x4d11c2){var _0x6b2e6,_0x273e57,_0x51984c;if(_[_0x3b2b('0x7e')](_0x1d53e4[_0x3b2b('0x67')][_0x3b2b('0x67')])||_0x1d53e4['body'][_0x3b2b('0x67')]===''){throw new db[(_0x3b2b('0x76'))][(_0x3b2b('0x77'))](_0x3b2b('0x81'));}if(_[_0x3b2b('0x7e')](_0x1d53e4[_0x3b2b('0x67')]['to'])){}_0x6b2e6=_0x1d53e4[_0x3b2b('0x67')]['to'];return db[_0x3b2b('0x44')]['findOne']({'where':{'id':_0x1d53e4[_0x3b2b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x9f07eb,null))[_0x3b2b('0x24')](function(_0x1ce7c1){if(_0x1ce7c1){return db[_0x3b2b('0x44')][_0x3b2b('0x5e')]({'where':{'id':_0x1ce7c1['id']},'include':[{'model':db['CmList'],'as':_0x3b2b('0x8b'),'include':[{'model':db[_0x3b2b('0x75')],'as':_0x3b2b('0x87'),'where':{[_0x1ce7c1[_0x3b2b('0x82')]]:_0x6b2e6},'limit':0x1,'order':[[_0x3b2b('0x79'),_0x3b2b('0x88')]]}]}]})[_0x3b2b('0x24')](handleEntityNotFound(_0x9f07eb,null))[_0x3b2b('0x24')](function(_0x2d531b){if(_0x2d531b&&_0x2d531b[_0x3b2b('0x8b')]){_0x273e57=_0x2d531b[_0x3b2b('0x61')]({'plain':!![]});if(_0x273e57[_0x3b2b('0x8b')]&&_0x273e57[_0x3b2b('0x8b')][_0x3b2b('0x87')][_0x3b2b('0x4e')]){return _0x273e57['List'][_0x3b2b('0x87')][0x0];}return db[_0x3b2b('0x75')]['create'](_[_0x3b2b('0x1c')](_0x1d53e4[_0x3b2b('0x67')],{'firstName':_0x6b2e6,[_0x2d531b[_0x3b2b('0x82')]]:_0x6b2e6,'phone':_0x6b2e6,'ListId':_0x273e57['ListId']}));}})[_0x3b2b('0x24')](handleEntityNotFound(_0x9f07eb,null))[_0x3b2b('0x24')](function(_0x4b9319){if(_0x4b9319){_0x51984c=_0x4b9319;return db['OpenchannelInteraction'][_0x3b2b('0x5e')]({'where':{'ContactId':_0x51984c['id'],'closed':![],'OpenchannelAccountId':_0x273e57['id']}})['then'](function(_0x3aebcd){if(_0x3aebcd){return[_0x3aebcd,![]];}return db[_0x3b2b('0x97')]['create']({'UserId':_0x1d53e4[_0x3b2b('0x60')]['id'],'ContactId':_0x51984c['id'],'OpenchannelAccountId':_0x273e57['id'],'lastMsgDirection':_0x3b2b('0xc0'),'firstMsgDirection':'out','Messages':[_['merge'](_0x1d53e4[_0x3b2b('0x67')],{'read':![],'body':_0x1d53e4[_0x3b2b('0x67')][_0x3b2b('0x67')],'OpenchannelAccountId':_0x273e57['id'],'UserId':_0x1d53e4[_0x3b2b('0x60')]['id'],'ContactId':_0x51984c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x3b2b('0x24')](function(_0x18f2f1){return[_0x18f2f1,!![]];});});}})[_0x3b2b('0xb9')](function(_0x4754b2,_0x2b992b){if(_0x2b992b){return _0x4754b2;}return db['OpenchannelMessage'][_0x3b2b('0x5f')](_['merge'](_0x1d53e4[_0x3b2b('0x67')],{'read':![],'body':_0x1d53e4[_0x3b2b('0x67')][_0x3b2b('0x67')],'OpenchannelAccountId':_0x273e57['id'],'OpenchannelInteractionId':_0x4754b2['id'],'UserId':_0x1d53e4['user']['id'],'ContactId':_0x51984c['id']}))[_0x3b2b('0x24')](function(_0x54cabb){_0x4754b2['dataValues'][_0x3b2b('0xc1')]=[];_0x4754b2[_0x3b2b('0xc2')][_0x3b2b('0xc1')][_0x3b2b('0x9c')](_0x54cabb['dataValues']);return _0x4754b2;});});}})['then'](respondWithResult(_0x9f07eb,null))[_0x3b2b('0x2e')](handleError(_0x9f07eb,null));}; \ No newline at end of file +var _0xb7a0=['keys','query','filters','model','intersection','fields','length','attributes','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','openchannel','Sequelize','difference','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','Contacts','defaults','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','UserId','forcedOwnership','Start','startRouting','EventManager','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','User','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','index','Pause','OpenchannelAccount','fieldName','key','map'];(function(_0x44f2b7,_0x9c567f){var _0xb7fdb9=function(_0x3a9c41){while(--_0x3a9c41){_0x44f2b7['push'](_0x44f2b7['shift']());}};_0xb7fdb9(++_0x9c567f);}(_0xb7a0,0x13b));var _0x0b7a=function(_0x12ebc7,_0x36e69b){_0x12ebc7=_0x12ebc7-0x0;var _0x32b23f=_0xb7a0[_0x12ebc7];return _0x32b23f;};'use strict';var emlformat=require(_0x0b7a('0x0'));var rimraf=require(_0x0b7a('0x1'));var zipdir=require(_0x0b7a('0x2'));var jsonpatch=require(_0x0b7a('0x3'));var rp=require('request-promise');var moment=require(_0x0b7a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0b7a('0x5'));var util=require('util');var path=require(_0x0b7a('0x6'));var sox=require(_0x0b7a('0x7'));var csv=require(_0x0b7a('0x8'));var ejs=require(_0x0b7a('0x9'));var fs=require('fs');var fs_extra=require(_0x0b7a('0xa'));var _=require(_0x0b7a('0xb'));var squel=require(_0x0b7a('0xc'));var crypto=require(_0x0b7a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b7a('0x8'));var querystring=require(_0x0b7a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0b7a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b7a('0x10'));var logger=require(_0x0b7a('0x11'))(_0x0b7a('0x12'));var utils=require(_0x0b7a('0x13'));var config=require(_0x0b7a('0x14'));var licenseUtil=require(_0x0b7a('0x15'));var db=require(_0x0b7a('0x16'))['db'];config[_0x0b7a('0x17')]=_['defaults'](config[_0x0b7a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b7a('0x18'))(new Redis(config[_0x0b7a('0x17')]));require(_0x0b7a('0x19'))[_0x0b7a('0x1a')](socket);var jayson=require(_0x0b7a('0x1b'));var client=jayson[_0x0b7a('0x1c')][_0x0b7a('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x0b7a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x215915,_0x24303b,_0x5b4d5c,_0x46c2de){return new BPromise(function(_0x122a25,_0x4269c5){var _0xb2e4aa=_0x46c2de||client;return _0xb2e4aa[_0x0b7a('0x1e')](_0x215915,_0x5b4d5c)[_0x0b7a('0x1f')](function(_0x4a6db8){logger[_0x0b7a('0x20')](_0x0b7a('0x21'),_0x24303b,_0x0b7a('0x22'));logger[_0x0b7a('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x24303b,_0x0b7a('0x22'),JSON[_0x0b7a('0x24')](_0x4a6db8));if(_0x4a6db8[_0x0b7a('0x25')]){if(_0x4a6db8[_0x0b7a('0x25')][_0x0b7a('0x26')]===0x1f4){logger[_0x0b7a('0x25')](_0x0b7a('0x21'),_0x24303b,_0x4a6db8[_0x0b7a('0x25')]['message']);return _0x4269c5(_0x4a6db8[_0x0b7a('0x25')][_0x0b7a('0x27')]);}logger[_0x0b7a('0x25')](_0x0b7a('0x21'),_0x24303b,_0x4a6db8[_0x0b7a('0x25')][_0x0b7a('0x27')]);return _0x122a25(_0x4a6db8['error'][_0x0b7a('0x27')]);}else{logger[_0x0b7a('0x20')](_0x0b7a('0x21'),_0x24303b,_0x0b7a('0x22'));_0x122a25(_0x4a6db8['result'][_0x0b7a('0x27')]);}})[_0x0b7a('0x28')](function(_0x1223ee){logger[_0x0b7a('0x25')](_0x0b7a('0x21'),_0x24303b,_0x1223ee);_0x4269c5(_0x1223ee);});});}function respondWithStatusCode(_0x3aedf3,_0x2f2f76){_0x2f2f76=_0x2f2f76||0xcc;return function(_0x4e5e0a){if(_0x4e5e0a){return _0x3aedf3[_0x0b7a('0x29')](_0x2f2f76);}return _0x3aedf3[_0x0b7a('0x2a')](_0x2f2f76)[_0x0b7a('0x2b')]();};}function respondWithResult(_0x4618f1,_0x405ca9){_0x405ca9=_0x405ca9||0xc8;return function(_0x5eb6a7){if(_0x5eb6a7){return _0x4618f1[_0x0b7a('0x2a')](_0x405ca9)[_0x0b7a('0x2c')](_0x5eb6a7);}};}function respondWithFilteredResult(_0x19f5b7,_0x2f458e){return function(_0xd28086){if(_0xd28086){var _0x3d8cb6=typeof _0x2f458e[_0x0b7a('0x2d')]===_0x0b7a('0x2e')&&typeof _0x2f458e['limit']===_0x0b7a('0x2e');var _0x73d849=_0xd28086[_0x0b7a('0x2f')];var _0x32469c=_0x3d8cb6?0x0:_0x2f458e[_0x0b7a('0x2d')];var _0x181d3f=_0x3d8cb6?_0xd28086['count']:_0x2f458e['offset']+_0x2f458e[_0x0b7a('0x30')];var _0x196dc0;if(_0x181d3f>=_0x73d849){_0x181d3f=_0x73d849;_0x196dc0=0xc8;}else{_0x196dc0=0xce;}_0x19f5b7[_0x0b7a('0x2a')](_0x196dc0);return _0x19f5b7[_0x0b7a('0x31')]('Content-Range',_0x32469c+'-'+_0x181d3f+'/'+_0x73d849)[_0x0b7a('0x2c')](_0xd28086);}return null;};}function patchUpdates(_0x2287d5){return function(_0x22350a){try{jsonpatch[_0x0b7a('0x32')](_0x22350a,_0x2287d5,!![]);}catch(_0x529d6f){return BPromise[_0x0b7a('0x33')](_0x529d6f);}return _0x22350a['save']();};}function saveUpdates(_0x2c0b83,_0x112687){return function(_0x1744cd){if(_0x1744cd){return _0x1744cd[_0x0b7a('0x34')](_0x2c0b83)[_0x0b7a('0x1f')](function(_0x3591d6){return _0x3591d6;});}return null;};}function removeEntity(_0x503fa6,_0x11622e){return function(_0x20e5d4){if(_0x20e5d4){return _0x20e5d4[_0x0b7a('0x35')]()[_0x0b7a('0x1f')](function(){var _0x132ce2=_0x20e5d4[_0x0b7a('0x36')]({'plain':!![]});var _0x532472=_0x0b7a('0x37');return db[_0x0b7a('0x38')][_0x0b7a('0x35')]({'where':{'type':_0x532472,'resourceId':_0x132ce2['id']}})[_0x0b7a('0x1f')](function(){return _0x20e5d4;});})[_0x0b7a('0x1f')](function(){_0x503fa6[_0x0b7a('0x2a')](0xcc)[_0x0b7a('0x2b')]();});}};}function handleEntityNotFound(_0x21b1ed,_0x4f556b){return function(_0x25ccbc){if(!_0x25ccbc){_0x21b1ed[_0x0b7a('0x29')](0x194);}return _0x25ccbc;};}function handleError(_0x73f1c4,_0x49800e){_0x49800e=_0x49800e||0x1f4;return function(_0x711be6){logger['error'](_0x711be6['stack']);if(_0x711be6[_0x0b7a('0x39')]){delete _0x711be6[_0x0b7a('0x39')];}_0x73f1c4[_0x0b7a('0x2a')](_0x49800e)[_0x0b7a('0x3a')](_0x711be6);};}exports[_0x0b7a('0x3b')]=function(_0x3d43cc,_0x5abf37){var _0x41e80a={'include':[{'model':db[_0x0b7a('0x3c')],'as':'mandatoryDispositionPause'}]},_0xf45b68={},_0x2c9030={'count':0x0,'rows':[]};var _0x3b06ed=_['map'](db[_0x0b7a('0x3d')]['rawAttributes'],function(_0x2292d1){return{'name':_0x2292d1[_0x0b7a('0x3e')],'type':_0x2292d1['type'][_0x0b7a('0x3f')]};});_0xf45b68['model']=_[_0x0b7a('0x40')](_0x3b06ed,'name');_0xf45b68['query']=_[_0x0b7a('0x41')](_0x3d43cc[_0x0b7a('0x42')]);_0xf45b68[_0x0b7a('0x43')]=_['intersection'](_0xf45b68[_0x0b7a('0x44')],_0xf45b68[_0x0b7a('0x42')]);_0x41e80a['attributes']=_[_0x0b7a('0x45')](_0xf45b68['model'],qs[_0x0b7a('0x46')](_0x3d43cc[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0x41e80a['attributes']=_0x41e80a['attributes'][_0x0b7a('0x47')]?_0x41e80a[_0x0b7a('0x48')]:_0xf45b68['model'];if(!_0x3d43cc[_0x0b7a('0x42')]['hasOwnProperty']('nolimit')){_0x41e80a['limit']=qs[_0x0b7a('0x30')](_0x3d43cc[_0x0b7a('0x42')]['limit']);_0x41e80a[_0x0b7a('0x2d')]=qs[_0x0b7a('0x2d')](_0x3d43cc[_0x0b7a('0x42')][_0x0b7a('0x2d')]);}_0x41e80a[_0x0b7a('0x49')]=qs['sort'](_0x3d43cc[_0x0b7a('0x42')][_0x0b7a('0x4a')]);_0x41e80a[_0x0b7a('0x4b')]=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x3d43cc['query'],_0xf45b68['filters']),_0x3b06ed);if(_0x3d43cc[_0x0b7a('0x42')][_0x0b7a('0x4d')]){_0x41e80a[_0x0b7a('0x4b')]=_[_0x0b7a('0x4e')](_0x41e80a[_0x0b7a('0x4b')],{'$or':_[_0x0b7a('0x40')](_0x3b06ed,function(_0x1774a8){if(_0x1774a8[_0x0b7a('0x4f')]!==_0x0b7a('0x50')){var _0x4346c3={};_0x4346c3[_0x1774a8[_0x0b7a('0x39')]]={'$like':'%'+_0x3d43cc['query'][_0x0b7a('0x4d')]+'%'};return _0x4346c3;}})});}_0x41e80a=_[_0x0b7a('0x4e')]({},_0x41e80a,_0x3d43cc['options']);var _0x2557ca={'where':_0x41e80a[_0x0b7a('0x4b')]};return db[_0x0b7a('0x3d')][_0x0b7a('0x2f')](_0x2557ca)[_0x0b7a('0x1f')](function(_0x1728c2){_0x2c9030[_0x0b7a('0x2f')]=_0x1728c2;if(_0x3d43cc['query'][_0x0b7a('0x51')]){_0x41e80a[_0x0b7a('0x52')]=[{'all':!![]}];}return db[_0x0b7a('0x3d')][_0x0b7a('0x53')](_0x41e80a);})['then'](function(_0x22662e){_0x2c9030[_0x0b7a('0x54')]=_0x22662e;return _0x2c9030;})[_0x0b7a('0x1f')](respondWithFilteredResult(_0x5abf37,_0x41e80a))['catch'](handleError(_0x5abf37,null));};exports[_0x0b7a('0x55')]=function(_0x9c97ed,_0x53061a){var _0xc69ba4={'raw':![],'where':{'id':_0x9c97ed[_0x0b7a('0x56')]['id']},'include':[{'model':db[_0x0b7a('0x3c')],'as':_0x0b7a('0x57')}]},_0x489cf4={};_0x489cf4['model']=_[_0x0b7a('0x41')](db[_0x0b7a('0x3d')][_0x0b7a('0x58')]);_0x489cf4[_0x0b7a('0x42')]=_[_0x0b7a('0x41')](_0x9c97ed[_0x0b7a('0x42')]);_0x489cf4[_0x0b7a('0x43')]=_[_0x0b7a('0x45')](_0x489cf4[_0x0b7a('0x44')],_0x489cf4['query']);_0xc69ba4[_0x0b7a('0x48')]=_[_0x0b7a('0x45')](_0x489cf4[_0x0b7a('0x44')],qs['fields'](_0x9c97ed[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0xc69ba4[_0x0b7a('0x48')]=_0xc69ba4['attributes'][_0x0b7a('0x47')]?_0xc69ba4[_0x0b7a('0x48')]:_0x489cf4['model'];if(_0x9c97ed[_0x0b7a('0x42')][_0x0b7a('0x51')]){_0xc69ba4[_0x0b7a('0x52')]=[{'all':!![]}];}_0xc69ba4=_[_0x0b7a('0x4e')]({},_0xc69ba4,_0x9c97ed[_0x0b7a('0x59')]);return db['OpenchannelAccount'][_0x0b7a('0x5a')](_0xc69ba4)[_0x0b7a('0x1f')](handleEntityNotFound(_0x53061a,null))[_0x0b7a('0x1f')](respondWithResult(_0x53061a,null))[_0x0b7a('0x28')](handleError(_0x53061a,null));};exports[_0x0b7a('0x5b')]=function(_0x34037a,_0x10bc44){return db[_0x0b7a('0x3d')][_0x0b7a('0x5b')](_0x34037a[_0x0b7a('0x5c')],{})['then'](function(_0x179a96){var _0x10b54e=_0x34037a['user']['get']({'plain':!![]});if(!_0x10b54e)throw new Error(_0x0b7a('0x5d'));if(_0x10b54e[_0x0b7a('0x5e')]===_0x0b7a('0x5f')){var _0x5a8738=_0x179a96[_0x0b7a('0x36')]({'plain':!![]});var _0x3d72cf=_0x0b7a('0x37');return db[_0x0b7a('0x60')][_0x0b7a('0x5a')]({'where':{'name':_0x3d72cf,'userProfileId':_0x10b54e[_0x0b7a('0x61')]},'raw':!![]})[_0x0b7a('0x1f')](function(_0x185133){if(_0x185133&&_0x185133[_0x0b7a('0x62')]===0x0){return db[_0x0b7a('0x38')][_0x0b7a('0x5b')]({'name':_0x5a8738[_0x0b7a('0x39')],'resourceId':_0x5a8738['id'],'type':_0x185133['name'],'sectionId':_0x185133['id']},{})[_0x0b7a('0x1f')](function(){return _0x179a96;});}else{return _0x179a96;}})['catch'](function(_0x4dd708){logger[_0x0b7a('0x25')](_0x0b7a('0x63'),_0x4dd708);throw _0x4dd708;});}return _0x179a96;})[_0x0b7a('0x1f')](respondWithResult(_0x10bc44,0xc9))[_0x0b7a('0x28')](handleError(_0x10bc44,null));};exports[_0x0b7a('0x34')]=function(_0x5af3a4,_0x3c15dd){if(_0x5af3a4[_0x0b7a('0x5c')]['id']){delete _0x5af3a4[_0x0b7a('0x5c')]['id'];}return db['OpenchannelAccount'][_0x0b7a('0x5a')]({'where':{'id':_0x5af3a4[_0x0b7a('0x56')]['id']},'include':[{'model':db[_0x0b7a('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3c15dd,null))['then'](saveUpdates(_0x5af3a4['body'],null))[_0x0b7a('0x1f')](respondWithResult(_0x3c15dd,null))['catch'](handleError(_0x3c15dd,null));};exports['destroy']=function(_0x255747,_0x161efc){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x255747['params']['id']}})['then'](handleEntityNotFound(_0x161efc,null))[_0x0b7a('0x1f')](removeEntity(_0x161efc,null))[_0x0b7a('0x28')](handleError(_0x161efc,null));};exports[_0x0b7a('0x64')]=function(_0x5bdf03,_0x58c5f5){return db[_0x0b7a('0x3d')][_0x0b7a('0x64')]()[_0x0b7a('0x1f')](respondWithResult(_0x58c5f5,null))[_0x0b7a('0x28')](handleError(_0x58c5f5,null));};exports[_0x0b7a('0x65')]=function(_0x316bf4,_0x441530,_0x21ed18){if(_0x316bf4[_0x0b7a('0x5c')]['id']){delete _0x316bf4[_0x0b7a('0x5c')]['id'];}return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x316bf4[_0x0b7a('0x56')]['id']}})['then'](handleEntityNotFound(_0x441530,null))['then'](function(_0x31ddf6){if(_0x31ddf6){_0x316bf4['body'][_0x0b7a('0x66')]=_0x31ddf6['id'];return db[_0x0b7a('0x67')]['create'](_0x316bf4['body']);}})[_0x0b7a('0x1f')](respondWithResult(_0x441530,null))[_0x0b7a('0x28')](handleError(_0x441530,null));};exports[_0x0b7a('0x68')]=function(_0x2fcab4,_0x49a45a,_0x2910fc){var _0x35b133={'raw':![],'where':{}};var _0x1d089a={};var _0x4f9eb8={'count':0x0,'rows':[]};return db[_0x0b7a('0x3d')][_0x0b7a('0x69')]({'where':{'id':_0x2fcab4[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x49a45a,null))['then'](function(_0x1ae8b4){if(_0x1ae8b4){_0x1d089a[_0x0b7a('0x44')]=_['keys'](db[_0x0b7a('0x67')]['rawAttributes']);_0x1d089a['query']=_['keys'](_0x2fcab4[_0x0b7a('0x42')]);_0x1d089a['filters']=_[_0x0b7a('0x45')](_0x1d089a['model'],_0x1d089a[_0x0b7a('0x42')]);_0x35b133[_0x0b7a('0x48')]=_[_0x0b7a('0x45')](_0x1d089a[_0x0b7a('0x44')],qs[_0x0b7a('0x46')](_0x2fcab4[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0x35b133[_0x0b7a('0x48')]=_0x35b133[_0x0b7a('0x48')][_0x0b7a('0x47')]?_0x35b133[_0x0b7a('0x48')]:_0x1d089a[_0x0b7a('0x44')];if(!_0x2fcab4['query']['hasOwnProperty'](_0x0b7a('0x6a'))){_0x35b133[_0x0b7a('0x30')]=qs['limit'](_0x2fcab4['query'][_0x0b7a('0x30')]);_0x35b133[_0x0b7a('0x2d')]=qs[_0x0b7a('0x2d')](_0x2fcab4['query'][_0x0b7a('0x2d')]);}_0x35b133[_0x0b7a('0x49')]=qs['sort'](_0x2fcab4[_0x0b7a('0x42')][_0x0b7a('0x4a')]);_0x35b133['where']=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x2fcab4['query'],_0x1d089a[_0x0b7a('0x43')]));_0x35b133[_0x0b7a('0x4b')][_0x0b7a('0x66')]=_0x1ae8b4['id'];if(_0x2fcab4[_0x0b7a('0x42')][_0x0b7a('0x4d')]){_0x35b133['where']=_[_0x0b7a('0x4e')](_0x35b133[_0x0b7a('0x4b')],{'$or':_['map'](_0x35b133[_0x0b7a('0x48')],function(_0x38092b){var _0x247cfe={};_0x247cfe[_0x38092b]={'$like':'%'+_0x2fcab4[_0x0b7a('0x42')][_0x0b7a('0x4d')]+'%'};return _0x247cfe;})});}_0x35b133=_[_0x0b7a('0x4e')]({},_0x35b133,_0x2fcab4[_0x0b7a('0x59')]);return db[_0x0b7a('0x67')][_0x0b7a('0x2f')]({'where':_0x35b133[_0x0b7a('0x4b')]})[_0x0b7a('0x1f')](function(_0x33f6f5){_0x4f9eb8[_0x0b7a('0x2f')]=_0x33f6f5;if(_0x2fcab4[_0x0b7a('0x42')]['includeAll']){_0x35b133[_0x0b7a('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x0b7a('0x53')](_0x35b133);})[_0x0b7a('0x1f')](function(_0xd872e4){_0x4f9eb8['rows']=_0xd872e4;return _0x4f9eb8;});}})['then'](respondWithFilteredResult(_0x49a45a,_0x35b133))[_0x0b7a('0x28')](handleError(_0x49a45a,null));};exports[_0x0b7a('0x6b')]=function(_0x2041c0,_0x7f39da,_0x545c50){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x2041c0[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x7f39da,null))[_0x0b7a('0x1f')](function(_0x9dfd4d){if(_0x9dfd4d){return _0x9dfd4d[_0x0b7a('0x6b')](_0x2041c0['query'][_0x0b7a('0x6c')]);}})[_0x0b7a('0x1f')](respondWithStatusCode(_0x7f39da,null))[_0x0b7a('0x28')](handleError(_0x7f39da,null));};exports[_0x0b7a('0x6d')]=function(_0x226871,_0x376d07,_0x3d9e72){if(_0x226871[_0x0b7a('0x5c')]['id']){delete _0x226871[_0x0b7a('0x5c')]['id'];}return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x226871[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x376d07,null))[_0x0b7a('0x1f')](function(_0x3ec809){if(_0x3ec809){_0x226871['body'][_0x0b7a('0x66')]=_0x3ec809['id'];return db[_0x0b7a('0x6e')][_0x0b7a('0x5b')](_0x226871[_0x0b7a('0x5c')]);}})[_0x0b7a('0x1f')](respondWithResult(_0x376d07,null))[_0x0b7a('0x28')](handleError(_0x376d07,null));};exports[_0x0b7a('0x6f')]=function(_0x3b0f25,_0x31033a,_0x474268){var _0x313723={'raw':![],'where':{}};var _0x4a61ae={};var _0x5a4030={'count':0x0,'rows':[]};return db[_0x0b7a('0x3d')]['findOne']({'where':{'id':_0x3b0f25[_0x0b7a('0x56')]['id']}})['then'](handleEntityNotFound(_0x31033a,null))[_0x0b7a('0x1f')](function(_0x1112a6){if(_0x1112a6){_0x4a61ae[_0x0b7a('0x44')]=_[_0x0b7a('0x41')](db['CannedAnswer']['rawAttributes']);_0x4a61ae[_0x0b7a('0x42')]=_[_0x0b7a('0x41')](_0x3b0f25[_0x0b7a('0x42')]);_0x4a61ae[_0x0b7a('0x43')]=_[_0x0b7a('0x45')](_0x4a61ae[_0x0b7a('0x44')],_0x4a61ae['query']);_0x313723['attributes']=_[_0x0b7a('0x45')](_0x4a61ae[_0x0b7a('0x44')],qs[_0x0b7a('0x46')](_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0x313723[_0x0b7a('0x48')]=_0x313723['attributes'][_0x0b7a('0x47')]?_0x313723[_0x0b7a('0x48')]:_0x4a61ae[_0x0b7a('0x44')];if(!_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x70')](_0x0b7a('0x6a'))){_0x313723[_0x0b7a('0x30')]=qs[_0x0b7a('0x30')](_0x3b0f25['query']['limit']);_0x313723[_0x0b7a('0x2d')]=qs['offset'](_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x2d')]);}_0x313723[_0x0b7a('0x49')]=qs[_0x0b7a('0x4a')](_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x4a')]);_0x313723[_0x0b7a('0x4b')]=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x3b0f25[_0x0b7a('0x42')],_0x4a61ae[_0x0b7a('0x43')]));_0x313723[_0x0b7a('0x4b')]['OpenchannelAccountId']=_0x1112a6['id'];if(_0x3b0f25['query'][_0x0b7a('0x4d')]){_0x313723[_0x0b7a('0x4b')]=_[_0x0b7a('0x4e')](_0x313723[_0x0b7a('0x4b')],{'$or':_[_0x0b7a('0x40')](_0x313723['attributes'],function(_0x10a86f){var _0x3fd0f1={};_0x3fd0f1[_0x10a86f]={'$like':'%'+_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x4d')]+'%'};return _0x3fd0f1;})});}_0x313723=_[_0x0b7a('0x4e')]({},_0x313723,_0x3b0f25[_0x0b7a('0x59')]);return db[_0x0b7a('0x6e')][_0x0b7a('0x2f')]({'where':_0x313723[_0x0b7a('0x4b')]})[_0x0b7a('0x1f')](function(_0x474e46){_0x5a4030[_0x0b7a('0x2f')]=_0x474e46;if(_0x3b0f25[_0x0b7a('0x42')][_0x0b7a('0x51')]){_0x313723[_0x0b7a('0x52')]=[{'all':!![]}];}return db[_0x0b7a('0x6e')][_0x0b7a('0x53')](_0x313723);})[_0x0b7a('0x1f')](function(_0x34fc7e){_0x5a4030[_0x0b7a('0x54')]=_0x34fc7e;return _0x5a4030;});}})[_0x0b7a('0x1f')](respondWithFilteredResult(_0x31033a,_0x313723))['catch'](handleError(_0x31033a,null));};exports[_0x0b7a('0x71')]=function(_0x173048,_0xe260c8,_0x4f76bd){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x173048[_0x0b7a('0x56')]['id']}})['then'](handleEntityNotFound(_0xe260c8,null))['then'](function(_0x3aa1fa){if(_0x3aa1fa){return _0x3aa1fa[_0x0b7a('0x71')](_0x173048[_0x0b7a('0x42')]['ids']);}})[_0x0b7a('0x1f')](respondWithStatusCode(_0xe260c8,null))[_0x0b7a('0x28')](handleError(_0xe260c8,null));};exports[_0x0b7a('0x72')]=function(_0x2a57a5,_0x230f5c,_0x495f17){var _0x46913a={'body':_0x2a57a5[_0x0b7a('0x5c')],'channel':_0x0b7a('0x73')};var _0x460d60=[];var _0x47cde7=[];var _0x5b2d2b={};var _0x56c8b3=![];return db['CmContact'][_0x0b7a('0x64')]()[_0x0b7a('0x1f')](function(_0x773bba){if(!_0x773bba){throw new db[(_0x0b7a('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x460d60=_[_0x0b7a('0x75')](_[_0x0b7a('0x41')](_0x773bba),['createdAt',_0x0b7a('0x76')]);_0x47cde7=_[_0x0b7a('0x75')](_[_0x0b7a('0x41')](_0x773bba),['createdAt',_0x0b7a('0x76'),_0x0b7a('0x77'),_0x0b7a('0x78')]);if(_0x2a57a5[_0x0b7a('0x5c')]['id']){delete _0x2a57a5['body']['id'];}if(_[_0x0b7a('0x79')](_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x7a')])){throw new db['Sequelize'][(_0x0b7a('0x7b'))](_0x0b7a('0x7c'));}if(_['isNil'](_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x5c')])||_0x2a57a5['body']['body']===''){throw new db[(_0x0b7a('0x74'))][(_0x0b7a('0x7b'))](_0x0b7a('0x7d'));}if(_['isNil'](_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x7e')])){throw new db['Sequelize'][(_0x0b7a('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47cde7);}if(!_['includes'](_0x47cde7,_0x2a57a5['body']['mapKey'])){throw new db[(_0x0b7a('0x74'))][(_0x0b7a('0x7b'))](_0x0b7a('0x7f')+_0x47cde7);}_0x5b2d2b[_0x2a57a5[_0x0b7a('0x5c')]['mapKey']]=_0x2a57a5[_0x0b7a('0x5c')]['from'];})['then'](function(){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x2a57a5[_0x0b7a('0x56')]['id']},'include':[{'model':db[_0x0b7a('0x80')],'as':_0x0b7a('0x81'),'include':[{'model':db[_0x0b7a('0x82')],'as':'Contacts','where':_0x5b2d2b,'limit':0x1,'order':[[_0x0b7a('0x76'),_0x0b7a('0x83')]]}]},{'model':db[_0x0b7a('0x84')],'as':_0x0b7a('0x85')}]});})['then'](handleEntityNotFound(_0x230f5c,null))['then'](function(_0x74f2cd){if(_0x74f2cd&&_0x74f2cd[_0x0b7a('0x81')]){_0x46913a[_0x0b7a('0x86')]=_0x74f2cd;_0x46913a[_0x0b7a('0x87')]=_0x74f2cd[_0x0b7a('0x85')];_0x46913a[_0x0b7a('0x88')]=_0x74f2cd['List'];_0x46913a['applications']=_[_0x0b7a('0x89')](_0x46913a[_0x0b7a('0x87')],[_0x0b7a('0x8a')],[_0x0b7a('0x8b')]);if(_0x46913a[_0x0b7a('0x86')][_0x0b7a('0x85')]){delete _0x46913a['account'][_0x0b7a('0x85')];}if(_0x46913a[_0x0b7a('0x86')][_0x0b7a('0x81')]&&_0x46913a['account'][_0x0b7a('0x81')][_0x0b7a('0x8c')]['length']){return _0x46913a[_0x0b7a('0x86')]['List'][_0x0b7a('0x8c')][0x0];}var _0x4553ac=_[_0x0b7a('0x8d')](_0x2a57a5[_0x0b7a('0x5c')],{'firstName':_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x7a')],'ListId':_0x74f2cd[_0x0b7a('0x78')]});_0x4553ac[_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x7e')]]=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x7a')];return db[_0x0b7a('0x82')][_0x0b7a('0x5b')](_0x4553ac,{'fields':_0x460d60,'raw':!![]});}})['then'](handleEntityNotFound(_0x230f5c,null))[_0x0b7a('0x1f')](function(_0x217671){_0x46913a['contact']=_0x217671;if(_0x217671){var _0x1de58c={'ContactId':_0x217671['id'],'OpenchannelAccountId':_0x2a57a5['params']['id'],'from':(_0x217671[_0x0b7a('0x8e')]||'')+'\x20'+(_0x217671[_0x0b7a('0x8f')]||'')};var _0x1d3d81={'OpenchannelAccountId':_0x2a57a5[_0x0b7a('0x56')]['id'],'closed':![]};if(_0x2a57a5['body'][_0x0b7a('0x90')]){_0x1d3d81[_0x0b7a('0x90')]=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x90')];return db[_0x0b7a('0x91')][_0x0b7a('0x5a')]({'where':_0x1d3d81})['then'](function(_0x335380){if(_0x335380){return[_0x335380,![]];}_0x1de58c[_0x0b7a('0x90')]=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x90')];_0x1de58c[_0x0b7a('0x92')]=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x92')];return db[_0x0b7a('0x91')]['create'](_0x1de58c)[_0x0b7a('0x1f')](function(_0x2c168d){return[_0x2c168d,!![]];});});}else{_0x1d3d81[_0x0b7a('0x90')]=null;}_0x1d3d81[_0x0b7a('0x93')]=_0x217671['id'];return db[_0x0b7a('0x91')][_0x0b7a('0x5a')]({'where':_0x1d3d81})[_0x0b7a('0x1f')](function(_0x2092c0){if(_0x2092c0){return[_0x2092c0,![]];}return db['OpenchannelInteraction']['create'](_0x1de58c)[_0x0b7a('0x1f')](function(_0x35afff){return[_0x35afff,!![]];});});}})[_0x0b7a('0x94')](function(_0x8e78a2,_0x28f15b){if(_0x8e78a2){_0x56c8b3=_0x28f15b;if(!_0x28f15b){var _0x38c9e3={'from':(_0x46913a[_0x0b7a('0x95')][_0x0b7a('0x8e')]||'')+'\x20'+(_0x46913a[_0x0b7a('0x95')][_0x0b7a('0x8f')]||'')};if(_0x2a57a5['body'][_0x0b7a('0x90')]&&_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x96')]&&_0x2a57a5[_0x0b7a('0x5c')]['threadId']!=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x96')]){_0x38c9e3[_0x0b7a('0x90')]=_0x2a57a5[_0x0b7a('0x5c')][_0x0b7a('0x96')];}return _0x8e78a2[_0x0b7a('0x34')](_0x38c9e3);}else{return _0x8e78a2;}}})[_0x0b7a('0x1f')](function(_0x34f094){_0x46913a['interaction']=_0x34f094['get']({'plain':!![]});_0x46913a[_0x0b7a('0x97')]['created']=_0x56c8b3;if(_0x46913a[_0x0b7a('0x97')]['created']){if(_0x46913a[_0x0b7a('0x86')][_0x0b7a('0x98')]){_0x46913a[_0x0b7a('0x87')][_0x0b7a('0x99')]({'id':0x0,'priority':_0x46913a[_0x0b7a('0x87')][_0x0b7a('0x47')]+0x1,'app':'close','appdata':_0x0b7a('0x9a'),'interval':_0x0b7a('0x9b')});}}return db[_0x0b7a('0x9c')][_0x0b7a('0x5b')]({'body':_0x2a57a5[_0x0b7a('0x5c')]['body'],'OpenchannelAccountId':_0x2a57a5[_0x0b7a('0x56')]['id'],'OpenchannelInteractionId':_0x34f094['id'],'direction':'in','ContactId':_0x46913a['contact']['id'],'AttachmentId':_0x2a57a5['body']['AttachmentId']});})['then'](function(_0x1f00da){_0x46913a[_0x0b7a('0x27')]=_0x1f00da;if(_0x46913a[_0x0b7a('0x97')][_0x0b7a('0x9d')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x46913a[_0x0b7a('0x97')][_0x0b7a('0x9d')]}})[_0x0b7a('0x1f')](function(_0x489161){if(_0x489161){_0x46913a[_0x0b7a('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x489161[_0x0b7a('0x39')]+','+(_0x46913a[_0x0b7a('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0x0b7a('0x9b')});_0x46913a[_0x0b7a('0x9e')]=![];}return respondWithRpcPromise(_0x0b7a('0x9f'),'startRouting',_0x46913a);});}return respondWithRpcPromise('Start',_0x0b7a('0xa0'),_0x46913a);})[_0x0b7a('0x1f')](function(_0x5cccad){respondWithRpcPromise(_0x0b7a('0xa1'),_0x0b7a('0xa1'),{'event':'notify','message':_0x5cccad},client9002);return _0x5cccad;})['then'](respondWithResult(_0x230f5c,null))[_0x0b7a('0x28')](handleError(_0x230f5c,null));};exports['addApplications']=function(_0x2d2d4e,_0x4154a7){var _0x35fee5=_0x2d2d4e[_0x0b7a('0x56')]['id'];var _0x5898d2=_0x2d2d4e[_0x0b7a('0x5c')];var _0x40c9be=0xc8;var _0xb2f688=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x0b7a('0xa2')][_0x0b7a('0xa3')][_0x0b7a('0xa4')][_0x0b7a('0xa5')]},function(_0xfe629f){return db[_0x0b7a('0x3d')][_0x0b7a('0x69')]({'where':{'id':_0x35fee5},'transaction':_0xfe629f})['then'](function(_0x473ec8){if(_0x473ec8){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x35fee5},'transaction':_0xfe629f})[_0x0b7a('0x1f')](function(){var _0x41fc99=_[_0x0b7a('0x40')](_0x5898d2,function(_0x2d19e1){_0x2d19e1[_0x0b7a('0x66')]=_0x35fee5;return _0x2d19e1;});return db[_0x0b7a('0x84')][_0x0b7a('0xa6')](_0x41fc99,{'transaction':_0xfe629f});});}else{_0x40c9be=0x194;_0xb2f688=[];}});})['then'](function(){if(_0x40c9be!==0x194){return db['OpenchannelApplication'][_0x0b7a('0xa7')]({'where':{'OpenchannelAccountId':_0x35fee5},'order':'priority'})[_0x0b7a('0x1f')](function(_0x97d99b){_0xb2f688=_0x97d99b;});}})['catch'](function(_0x311ce0){_0x40c9be=0x1f4;logger[_0x0b7a('0x25')](_0x311ce0[_0x0b7a('0xa8')]);if(_0x311ce0[_0x0b7a('0x39')]){delete _0x311ce0[_0x0b7a('0x39')];}_0xb2f688=_0x311ce0;})[_0x0b7a('0xa9')](function(){if(_0xb2f688===null){_0x4154a7[_0x0b7a('0x29')](_0x40c9be);}else{if(_0x40c9be===0x1f4){_0x4154a7[_0x0b7a('0x2a')](_0x40c9be)[_0x0b7a('0x3a')](_0xb2f688);}else{_0x4154a7[_0x0b7a('0x2a')](_0x40c9be)[_0x0b7a('0x2c')](_0xb2f688);}}});};exports[_0x0b7a('0xaa')]=function(_0x186858,_0xb16071,_0x4152d7){var _0x2e6c3b={};var _0x4bacf6={};var _0x5924dd;var _0x567a78;return db[_0x0b7a('0x3d')][_0x0b7a('0x69')]({'where':{'id':_0x186858['params']['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0xb16071,null))[_0x0b7a('0x1f')](function(_0x4d2914){if(_0x4d2914){_0x5924dd=_0x4d2914;_0x4bacf6[_0x0b7a('0x44')]=_[_0x0b7a('0x41')](db['OpenchannelApplication'][_0x0b7a('0x58')]);_0x4bacf6[_0x0b7a('0x42')]=_['keys'](_0x186858[_0x0b7a('0x42')]);_0x4bacf6[_0x0b7a('0x43')]=_[_0x0b7a('0x45')](_0x4bacf6[_0x0b7a('0x44')],_0x4bacf6[_0x0b7a('0x42')]);_0x2e6c3b[_0x0b7a('0x48')]=_[_0x0b7a('0x45')](_0x4bacf6[_0x0b7a('0x44')],qs[_0x0b7a('0x46')](_0x186858['query'][_0x0b7a('0x46')]));_0x2e6c3b[_0x0b7a('0x48')]=_0x2e6c3b[_0x0b7a('0x48')][_0x0b7a('0x47')]?_0x2e6c3b[_0x0b7a('0x48')]:_0x4bacf6[_0x0b7a('0x44')];_0x2e6c3b[_0x0b7a('0x49')]=qs[_0x0b7a('0x4a')](_0x186858[_0x0b7a('0x42')][_0x0b7a('0x4a')]);_0x2e6c3b[_0x0b7a('0x4b')]=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x186858['query'],_0x4bacf6[_0x0b7a('0x43')]));if(_0x186858[_0x0b7a('0x42')][_0x0b7a('0x4d')]){_0x2e6c3b['where']=_[_0x0b7a('0x4e')](_0x2e6c3b['where'],{'$or':_['map'](_0x2e6c3b['attributes'],function(_0x3c5581){var _0xb40570={};_0xb40570[_0x3c5581]={'$like':'%'+_0x186858[_0x0b7a('0x42')]['filter']+'%'};return _0xb40570;})});}_0x2e6c3b=_['merge']({},_0x2e6c3b,_0x186858[_0x0b7a('0x59')]);return _0x5924dd[_0x0b7a('0xaa')](_0x2e6c3b);}})['then'](function(_0x44a327){if(_0x44a327){_0x567a78=_0x44a327[_0x0b7a('0x47')];if(!_0x186858['query'][_0x0b7a('0x70')](_0x0b7a('0x6a'))){_0x2e6c3b[_0x0b7a('0x30')]=qs[_0x0b7a('0x30')](_0x186858['query'][_0x0b7a('0x30')]);_0x2e6c3b[_0x0b7a('0x2d')]=qs[_0x0b7a('0x2d')](_0x186858['query'][_0x0b7a('0x2d')]);}return _0x5924dd['getApplications'](_0x2e6c3b);}})['then'](function(_0x3687ca){if(_0x3687ca){return _0x3687ca?{'count':_0x567a78,'rows':_0x3687ca}:null;}})[_0x0b7a('0x1f')](respondWithResult(_0xb16071,null))[_0x0b7a('0x28')](handleError(_0xb16071,null));};exports[_0x0b7a('0xab')]=function(_0x432b40,_0x25fd0e,_0x2f3e5a){var _0x50c6f3={'raw':![],'where':{}};var _0x14e813={};var _0x5b9463={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x0b7a('0x69')]({'where':{'id':_0x432b40['params']['id']}})['then'](handleEntityNotFound(_0x25fd0e,null))['then'](function(_0x5a265c){if(_0x5a265c){_0x14e813[_0x0b7a('0x44')]=_[_0x0b7a('0x41')](db[_0x0b7a('0x91')][_0x0b7a('0x58')]);_0x14e813[_0x0b7a('0x42')]=_[_0x0b7a('0x41')](_0x432b40[_0x0b7a('0x42')]);_0x14e813['filters']=_['intersection'](_0x14e813['model'],_0x14e813[_0x0b7a('0x42')]);_0x50c6f3[_0x0b7a('0x48')]=_['intersection'](_0x14e813[_0x0b7a('0x44')],qs[_0x0b7a('0x46')](_0x432b40[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0x50c6f3[_0x0b7a('0x48')]=_0x50c6f3[_0x0b7a('0x48')][_0x0b7a('0x47')]?_0x50c6f3[_0x0b7a('0x48')]:_0x14e813[_0x0b7a('0x44')];if(!_0x432b40['query'][_0x0b7a('0x70')](_0x0b7a('0x6a'))){_0x50c6f3[_0x0b7a('0x30')]=qs['limit'](_0x432b40['query']['limit']);_0x50c6f3[_0x0b7a('0x2d')]=qs[_0x0b7a('0x2d')](_0x432b40[_0x0b7a('0x42')][_0x0b7a('0x2d')]);}_0x50c6f3['order']=qs[_0x0b7a('0x4a')](_0x432b40['query'][_0x0b7a('0x4a')]);_0x50c6f3[_0x0b7a('0x4b')]=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x432b40[_0x0b7a('0x42')],_0x14e813['filters']));_0x50c6f3['where']['OpenchannelAccountId']=_0x5a265c['id'];if(_0x432b40[_0x0b7a('0x42')]['filter']){_0x50c6f3[_0x0b7a('0x4b')]=_[_0x0b7a('0x4e')](_0x50c6f3[_0x0b7a('0x4b')],{'$or':_[_0x0b7a('0x40')](_0x50c6f3[_0x0b7a('0x48')],function(_0x1023b3){var _0x83c58={};_0x83c58[_0x1023b3]={'$like':'%'+_0x432b40['query']['filter']+'%'};return _0x83c58;})});}_0x50c6f3=_[_0x0b7a('0x4e')]({},_0x50c6f3,_0x432b40['options']);return db['OpenchannelInteraction']['count']({'where':_0x50c6f3['where']})[_0x0b7a('0x1f')](function(_0xf6cf59){_0x5b9463[_0x0b7a('0x2f')]=_0xf6cf59;if(_0x432b40[_0x0b7a('0x42')]['includeAll']){_0x50c6f3['include']=[{'model':db[_0x0b7a('0x82')],'as':_0x0b7a('0xac'),'required':![]},{'model':db['User'],'as':_0x0b7a('0xad'),'attributes':['name',_0x0b7a('0xae'),_0x0b7a('0xaf')],'required':![]},{'model':db[_0x0b7a('0xb0')],'as':'Tags','attributes':['id',_0x0b7a('0x39'),_0x0b7a('0xb1')],'where':_0x432b40[_0x0b7a('0x42')][_0x0b7a('0xb2')]?{'id':_0x432b40[_0x0b7a('0x42')][_0x0b7a('0xb2')]}:undefined,'required':_0x432b40[_0x0b7a('0x42')]['tag']?!![]:![]}];}return db[_0x0b7a('0x91')][_0x0b7a('0x53')](_0x50c6f3);})[_0x0b7a('0x1f')](function(_0x53cae1){_0x5b9463[_0x0b7a('0x54')]=_0x53cae1;return _0x5b9463;});}})[_0x0b7a('0x1f')](respondWithFilteredResult(_0x25fd0e,_0x50c6f3))['catch'](handleError(_0x25fd0e,null));};exports[_0x0b7a('0xb3')]=function(_0x2c1cb7,_0x3e0314,_0x4665b2){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0x2c1cb7[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x3e0314,null))[_0x0b7a('0x1f')](function(_0x39d0a4){if(_0x39d0a4){return _0x39d0a4[_0x0b7a('0xb3')](_0x2c1cb7[_0x0b7a('0x5c')][_0x0b7a('0x6c')],_[_0x0b7a('0xb4')](_0x2c1cb7[_0x0b7a('0x5c')],[_0x0b7a('0x6c'),'id'])||{})[_0x0b7a('0x94')](function(_0x196b8f){for(var _0xb5509c=0x0;_0xb5509c<_0x2c1cb7[_0x0b7a('0x5c')][_0x0b7a('0x6c')][_0x0b7a('0x47')];_0xb5509c+=0x1){socket['emit'](_0x0b7a('0xb5'),{'UserId':Number(_0x2c1cb7[_0x0b7a('0x5c')][_0x0b7a('0x6c')][_0xb5509c]),'OpenchannelAccountId':Number(_0x2c1cb7[_0x0b7a('0x56')]['id'])});}return _0x196b8f;});}})[_0x0b7a('0x1f')](respondWithResult(_0x3e0314,null))[_0x0b7a('0x28')](handleError(_0x3e0314,null));};exports[_0x0b7a('0xb6')]=function(_0x7526c5,_0x45e0c7,_0x319541){return db['OpenchannelAccount']['find']({'where':{'id':_0x7526c5[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x45e0c7,null))['then'](function(_0xa5b46){if(_0xa5b46){return _0xa5b46[_0x0b7a('0xb6')](_0x7526c5['query'][_0x0b7a('0x6c')])[_0x0b7a('0x1f')](function(){if(_['isArray'](_0x7526c5[_0x0b7a('0x42')][_0x0b7a('0x6c')])){for(var _0x2051dd=0x0;_0x2051dd<_0x7526c5['query']['ids'][_0x0b7a('0x47')];_0x2051dd+=0x1){socket[_0x0b7a('0xb7')](_0x0b7a('0xb8'),{'UserId':Number(_0x7526c5[_0x0b7a('0x42')]['ids'][_0x2051dd]),'OpenchannelAccountId':Number(_0x7526c5[_0x0b7a('0x56')]['id'])});}}else{socket['emit'](_0x0b7a('0xb8'),{'UserId':Number(_0x7526c5[_0x0b7a('0x42')][_0x0b7a('0x6c')]),'OpenchannelAccountId':Number(_0x7526c5[_0x0b7a('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x45e0c7,null))['catch'](handleError(_0x45e0c7,null));};exports[_0x0b7a('0xb9')]=function(_0x23d6e5,_0x5f5c3e,_0x10c779){var _0x51faaa={};var _0x57d9fa={};var _0x2df28d;var _0x26d8db;return db[_0x0b7a('0x3d')][_0x0b7a('0x69')]({'where':{'id':_0x23d6e5[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x5f5c3e,null))['then'](function(_0x13d9bb){if(_0x13d9bb){_0x2df28d=_0x13d9bb;_0x57d9fa[_0x0b7a('0x44')]=_['keys'](db[_0x0b7a('0xba')][_0x0b7a('0x58')]);_0x57d9fa[_0x0b7a('0x42')]=_[_0x0b7a('0x41')](_0x23d6e5[_0x0b7a('0x42')]);_0x57d9fa[_0x0b7a('0x43')]=_['intersection'](_0x57d9fa[_0x0b7a('0x44')],_0x57d9fa[_0x0b7a('0x42')]);_0x51faaa[_0x0b7a('0x48')]=_[_0x0b7a('0x45')](_0x57d9fa[_0x0b7a('0x44')],qs[_0x0b7a('0x46')](_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x46')]));_0x51faaa[_0x0b7a('0x48')]=_0x51faaa[_0x0b7a('0x48')][_0x0b7a('0x47')]?_0x51faaa[_0x0b7a('0x48')]:_0x57d9fa[_0x0b7a('0x44')];_0x51faaa[_0x0b7a('0x49')]=qs[_0x0b7a('0x4a')](_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x4a')]);_0x51faaa['where']=qs[_0x0b7a('0x43')](_[_0x0b7a('0x4c')](_0x23d6e5['query'],_0x57d9fa[_0x0b7a('0x43')]));if(_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x4d')]){_0x51faaa[_0x0b7a('0x4b')]=_[_0x0b7a('0x4e')](_0x51faaa[_0x0b7a('0x4b')],{'$or':_['map'](_0x51faaa[_0x0b7a('0x48')],function(_0x5d9b0d){var _0x30d8b3={};_0x30d8b3[_0x5d9b0d]={'$like':'%'+_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x4d')]+'%'};return _0x30d8b3;})});}_0x51faaa=_['merge']({},_0x51faaa,_0x23d6e5['options']);return _0x2df28d[_0x0b7a('0xb9')](_0x51faaa);}})[_0x0b7a('0x1f')](function(_0xce5d71){if(_0xce5d71){_0x26d8db=_0xce5d71[_0x0b7a('0x47')];if(!_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x70')]('nolimit')){_0x51faaa[_0x0b7a('0x30')]=qs[_0x0b7a('0x30')](_0x23d6e5[_0x0b7a('0x42')]['limit']);_0x51faaa[_0x0b7a('0x2d')]=qs['offset'](_0x23d6e5[_0x0b7a('0x42')][_0x0b7a('0x2d')]);}return _0x2df28d['getAgents'](_0x51faaa);}})['then'](function(_0x2266cf){if(_0x2266cf){return _0x2266cf?{'count':_0x26d8db,'rows':_0x2266cf}:null;}})[_0x0b7a('0x1f')](respondWithResult(_0x5f5c3e,null))[_0x0b7a('0x28')](handleError(_0x5f5c3e,null));};exports[_0x0b7a('0x3a')]=function(_0x19a048,_0x2fe376,_0x20f740){var _0x577466,_0x33d4e3,_0x26d28e;if(_[_0x0b7a('0x79')](_0x19a048[_0x0b7a('0x5c')][_0x0b7a('0x5c')])||_0x19a048[_0x0b7a('0x5c')][_0x0b7a('0x5c')]===''){throw new db[(_0x0b7a('0x74'))][(_0x0b7a('0x7b'))](_0x0b7a('0x7d'));}if(_[_0x0b7a('0x79')](_0x19a048['body']['to'])){}_0x577466=_0x19a048[_0x0b7a('0x5c')]['to'];return db[_0x0b7a('0x3d')][_0x0b7a('0x69')]({'where':{'id':_0x19a048[_0x0b7a('0x56')]['id']}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x2fe376,null))['then'](function(_0xd1a7ab){if(_0xd1a7ab){return db[_0x0b7a('0x3d')][_0x0b7a('0x5a')]({'where':{'id':_0xd1a7ab['id']},'include':[{'model':db['CmList'],'as':_0x0b7a('0x81'),'include':[{'model':db[_0x0b7a('0x82')],'as':_0x0b7a('0x8c'),'where':{[_0xd1a7ab[_0x0b7a('0x7e')]]:_0x577466},'limit':0x1,'order':[[_0x0b7a('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x2fe376,null))[_0x0b7a('0x1f')](function(_0x205d71){if(_0x205d71&&_0x205d71[_0x0b7a('0x81')]){_0x33d4e3=_0x205d71[_0x0b7a('0x36')]({'plain':!![]});if(_0x33d4e3[_0x0b7a('0x81')]&&_0x33d4e3[_0x0b7a('0x81')][_0x0b7a('0x8c')]['length']){return _0x33d4e3[_0x0b7a('0x81')]['Contacts'][0x0];}return db[_0x0b7a('0x82')]['create'](_['defaults'](_0x19a048[_0x0b7a('0x5c')],{'firstName':_0x577466,[_0x205d71[_0x0b7a('0x7e')]]:_0x577466,'phone':_0x577466,'ListId':_0x33d4e3[_0x0b7a('0x78')]}));}})[_0x0b7a('0x1f')](handleEntityNotFound(_0x2fe376,null))[_0x0b7a('0x1f')](function(_0x7470bd){if(_0x7470bd){_0x26d28e=_0x7470bd;return db[_0x0b7a('0x91')][_0x0b7a('0x5a')]({'where':{'ContactId':_0x26d28e['id'],'closed':![],'OpenchannelAccountId':_0x33d4e3['id']}})[_0x0b7a('0x1f')](function(_0x207d82){if(_0x207d82){return[_0x207d82,![]];}return db[_0x0b7a('0x91')][_0x0b7a('0x5b')]({'UserId':_0x19a048[_0x0b7a('0x5f')]['id'],'ContactId':_0x26d28e['id'],'OpenchannelAccountId':_0x33d4e3['id'],'lastMsgDirection':'out','firstMsgDirection':_0x0b7a('0xbb'),'Messages':[_[_0x0b7a('0x4e')](_0x19a048['body'],{'read':![],'body':_0x19a048[_0x0b7a('0x5c')][_0x0b7a('0x5c')],'OpenchannelAccountId':_0x33d4e3['id'],'UserId':_0x19a048[_0x0b7a('0x5f')]['id'],'ContactId':_0x26d28e['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x0b7a('0xbc')}]})['then'](function(_0x16e704){return[_0x16e704,!![]];});});}})[_0x0b7a('0x94')](function(_0x7704bc,_0x7bac97){if(_0x7bac97){return _0x7704bc;}return db['OpenchannelMessage']['create'](_[_0x0b7a('0x4e')](_0x19a048['body'],{'read':![],'body':_0x19a048['body'][_0x0b7a('0x5c')],'OpenchannelAccountId':_0x33d4e3['id'],'OpenchannelInteractionId':_0x7704bc['id'],'UserId':_0x19a048[_0x0b7a('0x5f')]['id'],'ContactId':_0x26d28e['id']}))['then'](function(_0x47e392){_0x7704bc[_0x0b7a('0xbd')]['Messages']=[];_0x7704bc['dataValues'][_0x0b7a('0xbc')]['push'](_0x47e392['dataValues']);return _0x7704bc;});});}})[_0x0b7a('0x1f')](respondWithResult(_0x2fe376,null))[_0x0b7a('0x28')](handleError(_0x2fe376,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 2e57940..ebb2879 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 _0x702d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x424b2b,_0x5b2dae){var _0x1b193e=function(_0x53a3d4){while(--_0x53a3d4){_0x424b2b['push'](_0x424b2b['shift']());}};_0x1b193e(++_0x5b2dae);}(_0x702d,0x147));var _0xd702=function(_0x14275e,_0x47798a){_0x14275e=_0x14275e-0x0;var _0x25ca9e=_0x702d[_0x14275e];return _0x25ca9e;};'use strict';var EventEmitter=require(_0xd702('0x0'));var OpenchannelAccount=require(_0xd702('0x1'))['db'][_0xd702('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd702('0x3')](0x0);var events={'afterCreate':_0xd702('0x4'),'afterUpdate':'update','afterDestroy':_0xd702('0x5')};function emitEvent(_0xebbd7c){return function(_0x27b260,_0x1c5a32,_0x481ee0){OpenchannelAccountEvents[_0xd702('0x6')](_0xebbd7c+':'+_0x27b260['id'],_0x27b260);OpenchannelAccountEvents['emit'](_0xebbd7c,_0x27b260);_0x481ee0(null);};}for(var e in events){if(events[_0xd702('0x7')](e)){var event=events[e];OpenchannelAccount[_0xd702('0x8')](e,emitEvent(event));}}module[_0xd702('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x33b910,_0xf2751e){var _0x3d7deb=function(_0x2ebbb0){while(--_0x2ebbb0){_0x33b910['push'](_0x33b910['shift']());}};_0x3d7deb(++_0xf2751e);}(_0xac4a,0x13f));var _0xaac4=function(_0x4c4eb0,_0x120d16){_0x4c4eb0=_0x4c4eb0-0x0;var _0x437d8a=_0xac4a[_0x4c4eb0];return _0x437d8a;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 39d5321..bdace79 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(_0x70f096,_0x3d5ec7){var _0x417647=function(_0x1599a9){while(--_0x1599a9){_0x70f096['push'](_0x70f096['shift']());}};_0x417647(++_0x3d5ec7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x30ff42,_0x59b4fd){var _0x441a2d=function(_0x298eef){while(--_0x298eef){_0x30ff42['push'](_0x30ff42['shift']());}};_0x441a2d(++_0x59b4fd);}(_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 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 12e4b4c..482de65 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 _0x1339=['OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info'];(function(_0x3c40f4,_0x500b8a){var _0x1209d=function(_0x46b429){while(--_0x46b429){_0x3c40f4['push'](_0x3c40f4['shift']());}};_0x1209d(++_0x500b8a);}(_0x1339,0x1ed));var _0x9133=function(_0x36c80c,_0x5f1d7f){_0x36c80c=_0x36c80c-0x0;var _0x15e446=_0x1339[_0x36c80c];return _0x15e446;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});config['redis']=_[_0x9133('0xb')](config[_0x9133('0xc')],{'host':_0x9133('0xd'),'port':0x18eb});var socket=require(_0x9133('0xe'))(new Redis(config[_0x9133('0xc')]));require(_0x9133('0xf'))[_0x9133('0x10')](socket);function respondWithRpcPromise(_0x245134,_0x10a9e4,_0xd588c){return new BPromise(function(_0x4c4517,_0x3f9650){return client[_0x9133('0x11')](_0x245134,_0xd588c)[_0x9133('0x12')](function(_0x452481){logger[_0x9133('0x13')](_0x9133('0x14'),_0x10a9e4,'request\x20sent');logger[_0x9133('0x15')](_0x9133('0x16'),_0x10a9e4,'request\x20sent',JSON['stringify'](_0x452481));if(_0x452481[_0x9133('0x17')]){if(_0x452481['error'][_0x9133('0x18')]===0x1f4){logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481[_0x9133('0x17')][_0x9133('0x19')]);return _0x3f9650(_0x452481[_0x9133('0x17')]['message']);}logger[_0x9133('0x17')](_0x9133('0x14'),_0x10a9e4,_0x452481['error'][_0x9133('0x19')]);return _0x4c4517(_0x452481[_0x9133('0x17')][_0x9133('0x19')]);}else{logger[_0x9133('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x10a9e4,_0x9133('0x1a'));_0x4c4517(_0x452481['result'][_0x9133('0x19')]);}})['catch'](function(_0x115ee8){logger[_0x9133('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x10a9e4,_0x115ee8);_0x3f9650(_0x115ee8);});});} \ No newline at end of file +var _0x422f=['socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x422f,0x1c7));var _0xf422=function(_0x466f76,_0x4a4b7d){_0x466f76=_0x466f76-0x0;var _0x119bec=_0x422f[_0x466f76];return _0x119bec;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var moment=require('moment');var BPromise=require(_0xf422('0x1'));var rs=require(_0xf422('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf422('0x3'))['db'];var utils=require(_0xf422('0x4'));var logger=require(_0xf422('0x5'))(_0xf422('0x6'));var config=require(_0xf422('0x7'));var jayson=require(_0xf422('0x8'));var client=jayson[_0xf422('0x9')][_0xf422('0xa')]({'port':0x232a});config[_0xf422('0xb')]=_['defaults'](config[_0xf422('0xb')],{'host':_0xf422('0xc'),'port':0x18eb});var socket=require(_0xf422('0xd'))(new Redis(config[_0xf422('0xb')]));require(_0xf422('0xe'))['register'](socket);function respondWithRpcPromise(_0x419ec4,_0x526c03,_0x599177){return new BPromise(function(_0x85cccc,_0x39f67b){return client[_0xf422('0xf')](_0x419ec4,_0x599177)[_0xf422('0x10')](function(_0x22eeb2){logger['info'](_0xf422('0x11'),_0x526c03,_0xf422('0x12'));logger['debug'](_0xf422('0x13'),_0x526c03,_0xf422('0x12'),JSON[_0xf422('0x14')](_0x22eeb2));if(_0x22eeb2[_0xf422('0x15')]){if(_0x22eeb2[_0xf422('0x15')][_0xf422('0x16')]===0x1f4){logger[_0xf422('0x15')](_0xf422('0x11'),_0x526c03,_0x22eeb2[_0xf422('0x15')]['message']);return _0x39f67b(_0x22eeb2['error']['message']);}logger[_0xf422('0x15')](_0xf422('0x11'),_0x526c03,_0x22eeb2[_0xf422('0x15')][_0xf422('0x17')]);return _0x85cccc(_0x22eeb2['error'][_0xf422('0x17')]);}else{logger[_0xf422('0x18')](_0xf422('0x11'),_0x526c03,_0xf422('0x12'));_0x85cccc(_0x22eeb2[_0xf422('0x19')][_0xf422('0x17')]);}})['catch'](function(_0x502976){logger[_0xf422('0x15')](_0xf422('0x11'),_0x526c03,_0x502976);_0x39f67b(_0x502976);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c65d887..b6c81da 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 _0x6898=['register','length','openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener'];(function(_0x22d7a3,_0x23b517){var _0x1ef757=function(_0x1b8340){while(--_0x1b8340){_0x22d7a3['push'](_0x22d7a3['shift']());}};_0x1ef757(++_0x23b517);}(_0x6898,0x11b));var _0x8689=function(_0x3f5d9c,_0x4c2d34){_0x3f5d9c=_0x3f5d9c-0x0;var _0x118131=_0x6898[_0x3f5d9c];return _0x118131;};'use strict';var OpenchannelAccountEvents=require(_0x8689('0x0'));var events=['save',_0x8689('0x1'),_0x8689('0x2')];function createListener(_0x472b9d,_0x13fbdb){return function(_0x3ae917){_0x13fbdb[_0x8689('0x3')](_0x472b9d,_0x3ae917);};}function removeListener(_0x524f81,_0x5038aa){return function(){OpenchannelAccountEvents[_0x8689('0x4')](_0x524f81,_0x5038aa);};}exports[_0x8689('0x5')]=function(_0x2c723e){for(var _0x4e776d=0x0,_0xbc1b52=events[_0x8689('0x6')];_0x4e776d<_0xbc1b52;_0x4e776d++){var _0x9ab197=events[_0x4e776d];var _0x4e5261=createListener(_0x8689('0x7')+_0x9ab197,_0x2c723e);OpenchannelAccountEvents['on'](_0x9ab197,_0x4e5261);}}; \ No newline at end of file +var _0xcd31=['openchannelAccount:','save','remove','update','emit','removeListener'];(function(_0x5f37ce,_0x407d3b){var _0x132b02=function(_0x41638f){while(--_0x41638f){_0x5f37ce['push'](_0x5f37ce['shift']());}};_0x132b02(++_0x407d3b);}(_0xcd31,0x15d));var _0x1cd3=function(_0x4f90c4,_0x3bc9d4){_0x4f90c4=_0x4f90c4-0x0;var _0x44c184=_0xcd31[_0x4f90c4];return _0x44c184;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x1cd3('0x0'),_0x1cd3('0x1'),_0x1cd3('0x2')];function createListener(_0x5708ef,_0x3da1e3){return function(_0x19dd0c){_0x3da1e3[_0x1cd3('0x3')](_0x5708ef,_0x19dd0c);};}function removeListener(_0x28c67f,_0x295933){return function(){OpenchannelAccountEvents[_0x1cd3('0x4')](_0x28c67f,_0x295933);};}exports['register']=function(_0x26ffcb){for(var _0x1ca151=0x0,_0xedb6d1=events['length'];_0x1ca151<_0xedb6d1;_0x1ca151++){var _0x45cc24=events[_0x1ca151];var _0x11b139=createListener(_0x1cd3('0x5')+_0x45cc24,_0x26ffcb);OpenchannelAccountEvents['on'](_0x45cc24,_0x11b139);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8d5913a..6857214 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 _0x307f=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x307f,0x9e));var _0xf307=function(_0x4ed929,_0x1728cd){_0x4ed929=_0x4ed929-0x0;var _0x196013=_0x307f[_0x4ed929];return _0x196013;};'use strict';var multer=require(_0xf307('0x0'));var util=require(_0xf307('0x1'));var path=require(_0xf307('0x2'));var timeout=require(_0xf307('0x3'));var express=require(_0xf307('0x4'));var router=express[_0xf307('0x5')]();var fs_extra=require(_0xf307('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf307('0x7'));var config=require(_0xf307('0x8'));var controller=require('./openchannelApplication.controller');router[_0xf307('0x9')]('/',auth[_0xf307('0xa')](),controller[_0xf307('0xb')]);router[_0xf307('0x9')](_0xf307('0xc'),auth[_0xf307('0xa')](),controller[_0xf307('0xd')]);router[_0xf307('0xe')]('/',auth[_0xf307('0xa')](),controller[_0xf307('0xf')]);router[_0xf307('0x10')]('/:id',auth[_0xf307('0xa')](),controller[_0xf307('0x11')]);router[_0xf307('0x12')](_0xf307('0xc'),auth[_0xf307('0xa')](),controller['destroy']);module[_0xf307('0x13')]=router; \ No newline at end of file +var _0x2ba7=['create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x484f0e,_0x546288){var _0x2670b5=function(_0x1e73e4){while(--_0x1e73e4){_0x484f0e['push'](_0x484f0e['shift']());}};_0x2670b5(++_0x546288);}(_0x2ba7,0x195));var _0x72ba=function(_0x55f2c9,_0x4b40c4){_0x55f2c9=_0x55f2c9-0x0;var _0xdf374=_0x2ba7[_0x55f2c9];return _0xdf374;};'use strict';var multer=require(_0x72ba('0x0'));var util=require('util');var path=require(_0x72ba('0x1'));var timeout=require(_0x72ba('0x2'));var express=require(_0x72ba('0x3'));var router=express[_0x72ba('0x4')]();var fs_extra=require(_0x72ba('0x5'));var auth=require(_0x72ba('0x6'));var interaction=require(_0x72ba('0x7'));var config=require(_0x72ba('0x8'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x72ba('0x9')](),controller[_0x72ba('0xa')]);router[_0x72ba('0xb')](_0x72ba('0xc'),auth[_0x72ba('0x9')](),controller[_0x72ba('0xd')]);router[_0x72ba('0xe')]('/',auth[_0x72ba('0x9')](),controller[_0x72ba('0xf')]);router[_0x72ba('0x10')](_0x72ba('0xc'),auth[_0x72ba('0x9')](),controller[_0x72ba('0x11')]);router[_0x72ba('0x12')](_0x72ba('0xc'),auth[_0x72ba('0x9')](),controller[_0x72ba('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 535df2e..6f86b3f 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 _0x5569=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x3d2e92,_0x1c24b1){var _0x1097c1=function(_0x421498){while(--_0x421498){_0x3d2e92['push'](_0x3d2e92['shift']());}};_0x1097c1(++_0x1c24b1);}(_0x5569,0x6e));var _0x9556=function(_0x326f81,_0x57c9d8){_0x326f81=_0x326f81-0x0;var _0x8a3c6e=_0x5569[_0x326f81];return _0x8a3c6e;};'use strict';var Sequelize=require(_0x9556('0x0'));module[_0x9556('0x1')]={'priority':{'type':Sequelize[_0x9556('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9556('0x3')},'appdata':{'type':Sequelize[_0x9556('0x4')]()},'description':{'type':Sequelize[_0x9556('0x5')]},'interval':{'type':Sequelize[_0x9556('0x5')],'defaultValue':_0x9556('0x6')}}; \ No newline at end of file +var _0x44da=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x4bb98d,_0x1b7aec){var _0x4bb669=function(_0x332736){while(--_0x332736){_0x4bb98d['push'](_0x4bb98d['shift']());}};_0x4bb669(++_0x1b7aec);}(_0x44da,0x85));var _0xa44d=function(_0x44676a,_0x347442){_0x44676a=_0x44676a-0x0;var _0x465ed1=_0x44da[_0x44676a];return _0x465ed1;};'use strict';var Sequelize=require(_0xa44d('0x0'));module[_0xa44d('0x1')]={'priority':{'type':Sequelize[_0xa44d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa44d('0x3')],'allowNull':![],'defaultValue':_0xa44d('0x4')},'appdata':{'type':Sequelize[_0xa44d('0x5')]()},'description':{'type':Sequelize[_0xa44d('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa44d('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 7aebc17..64995a6 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 _0x7a8e=['destroy','then','status','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','body','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x12210d,_0x455796){var _0x346ca6=function(_0x3daaac){while(--_0x3daaac){_0x12210d['push'](_0x12210d['shift']());}};_0x346ca6(++_0x455796);}(_0x7a8e,0xb0));var _0xe7a8=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0x7a8e[_0x3d5351];return _0x1db4db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe7a8('0x0'));var zipdir=require(_0xe7a8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a8('0x2'));var moment=require('moment');var BPromise=require(_0xe7a8('0x3'));var Mustache=require(_0xe7a8('0x4'));var util=require(_0xe7a8('0x5'));var path=require(_0xe7a8('0x6'));var sox=require(_0xe7a8('0x7'));var csv=require(_0xe7a8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe7a8('0x9'));var crypto=require('crypto');var jsforce=require(_0xe7a8('0xa'));var deskjs=require(_0xe7a8('0xb'));var toCsv=require(_0xe7a8('0x8'));var querystring=require(_0xe7a8('0xc'));var Papa=require('papaparse');var Redis=require(_0xe7a8('0xd'));var authService=require(_0xe7a8('0xe'));var qs=require(_0xe7a8('0xf'));var as=require(_0xe7a8('0x10'));var hardwareService=require(_0xe7a8('0x11'));var logger=require(_0xe7a8('0x12'))(_0xe7a8('0x13'));var utils=require(_0xe7a8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe7a8('0x15'))['db'];function respondWithStatusCode(_0x5f2321,_0x926b93){_0x926b93=_0x926b93||0xcc;return function(_0x1cfd05){if(_0x1cfd05){return _0x5f2321[_0xe7a8('0x16')](_0x926b93);}return _0x5f2321['status'](_0x926b93)[_0xe7a8('0x17')]();};}function respondWithResult(_0x91443a,_0x1bffbe){_0x1bffbe=_0x1bffbe||0xc8;return function(_0x8db53a){if(_0x8db53a){return _0x91443a['status'](_0x1bffbe)[_0xe7a8('0x18')](_0x8db53a);}};}function respondWithFilteredResult(_0x2c3119,_0x47d229){return function(_0x15710a){if(_0x15710a){var _0x1221b1=typeof _0x47d229[_0xe7a8('0x19')]===_0xe7a8('0x1a')&&typeof _0x47d229[_0xe7a8('0x1b')]==='undefined';var _0x2b5022=_0x15710a['count'];var _0x494b1e=_0x1221b1?0x0:_0x47d229['offset'];var _0x459535=_0x1221b1?_0x15710a[_0xe7a8('0x1c')]:_0x47d229[_0xe7a8('0x19')]+_0x47d229[_0xe7a8('0x1b')];var _0x51f88e;if(_0x459535>=_0x2b5022){_0x459535=_0x2b5022;_0x51f88e=0xc8;}else{_0x51f88e=0xce;}_0x2c3119['status'](_0x51f88e);return _0x2c3119['set'](_0xe7a8('0x1d'),_0x494b1e+'-'+_0x459535+'/'+_0x2b5022)[_0xe7a8('0x18')](_0x15710a);}return null;};}function patchUpdates(_0x1d0225){return function(_0x33fbdd){try{jsonpatch[_0xe7a8('0x1e')](_0x33fbdd,_0x1d0225,!![]);}catch(_0x642bde){return BPromise['reject'](_0x642bde);}return _0x33fbdd['save']();};}function saveUpdates(_0xf4a9ef,_0x414511){return function(_0x170568){if(_0x170568){return _0x170568['update'](_0xf4a9ef)['then'](function(_0x10a77c){return _0x10a77c;});}return null;};}function removeEntity(_0x4545c3,_0x37c498){return function(_0x4aef32){if(_0x4aef32){return _0x4aef32[_0xe7a8('0x1f')]()[_0xe7a8('0x20')](function(){_0x4545c3[_0xe7a8('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fd9f,_0x3af51d){return function(_0x38c5dd){if(!_0x38c5dd){_0x39fd9f[_0xe7a8('0x16')](0x194);}return _0x38c5dd;};}function handleError(_0x285573,_0x32b04d){_0x32b04d=_0x32b04d||0x1f4;return function(_0x3f62c2){logger['error'](_0x3f62c2[_0xe7a8('0x22')]);if(_0x3f62c2[_0xe7a8('0x23')]){delete _0x3f62c2['name'];}_0x285573[_0xe7a8('0x21')](_0x32b04d)[_0xe7a8('0x24')](_0x3f62c2);};}exports[_0xe7a8('0x25')]=function(_0x15d86b,_0x44d427){var _0x514cf0={},_0x35ffb3={},_0x2707f2={'count':0x0,'rows':[]};var _0x2cc34f=_[_0xe7a8('0x26')](db[_0xe7a8('0x27')]['rawAttributes'],function(_0x4ed5ed){return{'name':_0x4ed5ed[_0xe7a8('0x28')],'type':_0x4ed5ed[_0xe7a8('0x29')][_0xe7a8('0x2a')]};});_0x35ffb3[_0xe7a8('0x2b')]=_[_0xe7a8('0x26')](_0x2cc34f,_0xe7a8('0x23'));_0x35ffb3[_0xe7a8('0x2c')]=_[_0xe7a8('0x2d')](_0x15d86b['query']);_0x35ffb3[_0xe7a8('0x2e')]=_[_0xe7a8('0x2f')](_0x35ffb3[_0xe7a8('0x2b')],_0x35ffb3[_0xe7a8('0x2c')]);_0x514cf0[_0xe7a8('0x30')]=_[_0xe7a8('0x2f')](_0x35ffb3[_0xe7a8('0x2b')],qs['fields'](_0x15d86b[_0xe7a8('0x2c')]['fields']));_0x514cf0['attributes']=_0x514cf0['attributes'][_0xe7a8('0x31')]?_0x514cf0[_0xe7a8('0x30')]:_0x35ffb3['model'];if(!_0x15d86b[_0xe7a8('0x2c')][_0xe7a8('0x32')](_0xe7a8('0x33'))){_0x514cf0[_0xe7a8('0x1b')]=qs[_0xe7a8('0x1b')](_0x15d86b[_0xe7a8('0x2c')][_0xe7a8('0x1b')]);_0x514cf0[_0xe7a8('0x19')]=qs[_0xe7a8('0x19')](_0x15d86b['query'][_0xe7a8('0x19')]);}_0x514cf0[_0xe7a8('0x34')]=qs[_0xe7a8('0x35')](_0x15d86b[_0xe7a8('0x2c')][_0xe7a8('0x35')]);_0x514cf0[_0xe7a8('0x36')]=qs[_0xe7a8('0x2e')](_['pick'](_0x15d86b[_0xe7a8('0x2c')],_0x35ffb3[_0xe7a8('0x2e')]),_0x2cc34f);if(_0x15d86b['query'][_0xe7a8('0x37')]){_0x514cf0[_0xe7a8('0x36')]=_['merge'](_0x514cf0['where'],{'$or':_[_0xe7a8('0x26')](_0x2cc34f,function(_0x2160cd){if(_0x2160cd[_0xe7a8('0x29')]!=='VIRTUAL'){var _0x289634={};_0x289634[_0x2160cd['name']]={'$like':'%'+_0x15d86b[_0xe7a8('0x2c')][_0xe7a8('0x37')]+'%'};return _0x289634;}})});}_0x514cf0=_[_0xe7a8('0x38')]({},_0x514cf0,_0x15d86b[_0xe7a8('0x39')]);var _0xab695c={'where':_0x514cf0[_0xe7a8('0x36')]};return db[_0xe7a8('0x27')][_0xe7a8('0x1c')](_0xab695c)[_0xe7a8('0x20')](function(_0x58f3cd){_0x2707f2['count']=_0x58f3cd;if(_0x15d86b['query']['includeAll']){_0x514cf0['include']=[{'all':!![]}];}return db[_0xe7a8('0x27')][_0xe7a8('0x3a')](_0x514cf0);})[_0xe7a8('0x20')](function(_0x1b9597){_0x2707f2[_0xe7a8('0x3b')]=_0x1b9597;return _0x2707f2;})['then'](respondWithFilteredResult(_0x44d427,_0x514cf0))[_0xe7a8('0x3c')](handleError(_0x44d427,null));};exports[_0xe7a8('0x3d')]=function(_0x38e4cd,_0x5a6e48){var _0x3cd4cc={'raw':!![],'where':{'id':_0x38e4cd['params']['id']}},_0x4bd3d9={};_0x4bd3d9[_0xe7a8('0x2b')]=_['keys'](db['OpenchannelApplication'][_0xe7a8('0x3e')]);_0x4bd3d9[_0xe7a8('0x2c')]=_[_0xe7a8('0x2d')](_0x38e4cd['query']);_0x4bd3d9[_0xe7a8('0x2e')]=_['intersection'](_0x4bd3d9[_0xe7a8('0x2b')],_0x4bd3d9['query']);_0x3cd4cc[_0xe7a8('0x30')]=_[_0xe7a8('0x2f')](_0x4bd3d9['model'],qs['fields'](_0x38e4cd['query'][_0xe7a8('0x3f')]));_0x3cd4cc['attributes']=_0x3cd4cc[_0xe7a8('0x30')]['length']?_0x3cd4cc[_0xe7a8('0x30')]:_0x4bd3d9[_0xe7a8('0x2b')];if(_0x38e4cd[_0xe7a8('0x2c')][_0xe7a8('0x40')]){_0x3cd4cc['include']=[{'all':!![]}];}_0x3cd4cc=_[_0xe7a8('0x38')]({},_0x3cd4cc,_0x38e4cd['options']);return db[_0xe7a8('0x27')][_0xe7a8('0x41')](_0x3cd4cc)[_0xe7a8('0x20')](handleEntityNotFound(_0x5a6e48,null))[_0xe7a8('0x20')](respondWithResult(_0x5a6e48,null))[_0xe7a8('0x3c')](handleError(_0x5a6e48,null));};exports['create']=function(_0x143e3d,_0x153ffe){return db[_0xe7a8('0x27')][_0xe7a8('0x42')](_0x143e3d[_0xe7a8('0x43')],{})[_0xe7a8('0x20')](respondWithResult(_0x153ffe,0xc9))[_0xe7a8('0x3c')](handleError(_0x153ffe,null));};exports['update']=function(_0x1f6e03,_0x556466){if(_0x1f6e03[_0xe7a8('0x43')]['id']){delete _0x1f6e03[_0xe7a8('0x43')]['id'];}return db[_0xe7a8('0x27')][_0xe7a8('0x41')]({'where':{'id':_0x1f6e03[_0xe7a8('0x44')]['id']}})[_0xe7a8('0x20')](handleEntityNotFound(_0x556466,null))['then'](saveUpdates(_0x1f6e03[_0xe7a8('0x43')],null))[_0xe7a8('0x20')](respondWithResult(_0x556466,null))[_0xe7a8('0x3c')](handleError(_0x556466,null));};exports['destroy']=function(_0xde955b,_0x118f47){return db[_0xe7a8('0x27')][_0xe7a8('0x41')]({'where':{'id':_0xde955b[_0xe7a8('0x44')]['id']}})[_0xe7a8('0x20')](handleEntityNotFound(_0x118f47,null))[_0xe7a8('0x20')](removeEntity(_0x118f47,null))[_0xe7a8('0x3c')](handleError(_0x118f47,null));}; \ No newline at end of file +var _0xb26e=['send','index','map','OpenchannelApplication','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/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','then','destroy','error','stack','name'];(function(_0x13d343,_0xff2df3){var _0x55d49a=function(_0x1585a){while(--_0x1585a){_0x13d343['push'](_0x13d343['shift']());}};_0x55d49a(++_0xff2df3);}(_0xb26e,0x1e7));var _0xeb26=function(_0x177f58,_0x7eb824){_0x177f58=_0x177f58-0x0;var _0x30c13d=_0xb26e[_0x177f58];return _0x30c13d;};'use strict';var emlformat=require(_0xeb26('0x0'));var rimraf=require(_0xeb26('0x1'));var zipdir=require(_0xeb26('0x2'));var jsonpatch=require(_0xeb26('0x3'));var rp=require(_0xeb26('0x4'));var moment=require(_0xeb26('0x5'));var BPromise=require(_0xeb26('0x6'));var Mustache=require(_0xeb26('0x7'));var util=require(_0xeb26('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb26('0x9'));var ejs=require(_0xeb26('0xa'));var fs=require('fs');var fs_extra=require(_0xeb26('0xb'));var _=require('lodash');var squel=require(_0xeb26('0xc'));var crypto=require(_0xeb26('0xd'));var jsforce=require(_0xeb26('0xe'));var deskjs=require(_0xeb26('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb26('0x10'));var Papa=require(_0xeb26('0x11'));var Redis=require(_0xeb26('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeb26('0x13'));var hardwareService=require(_0xeb26('0x14'));var logger=require(_0xeb26('0x15'))(_0xeb26('0x16'));var utils=require(_0xeb26('0x17'));var config=require(_0xeb26('0x18'));var licenseUtil=require(_0xeb26('0x19'));var db=require(_0xeb26('0x1a'))['db'];function respondWithStatusCode(_0x124ce2,_0x16409b){_0x16409b=_0x16409b||0xcc;return function(_0x72bba5){if(_0x72bba5){return _0x124ce2[_0xeb26('0x1b')](_0x16409b);}return _0x124ce2[_0xeb26('0x1c')](_0x16409b)[_0xeb26('0x1d')]();};}function respondWithResult(_0x42777e,_0x50f8a){_0x50f8a=_0x50f8a||0xc8;return function(_0x10ad2c){if(_0x10ad2c){return _0x42777e[_0xeb26('0x1c')](_0x50f8a)[_0xeb26('0x1e')](_0x10ad2c);}};}function respondWithFilteredResult(_0x4a26b3,_0x570327){return function(_0x3dbb9c){if(_0x3dbb9c){var _0x28675e=typeof _0x570327[_0xeb26('0x1f')]===_0xeb26('0x20')&&typeof _0x570327[_0xeb26('0x21')]==='undefined';var _0x5afa6d=_0x3dbb9c[_0xeb26('0x22')];var _0x3b41f5=_0x28675e?0x0:_0x570327[_0xeb26('0x1f')];var _0x19e9db=_0x28675e?_0x3dbb9c[_0xeb26('0x22')]:_0x570327[_0xeb26('0x1f')]+_0x570327[_0xeb26('0x21')];var _0x1f63f0;if(_0x19e9db>=_0x5afa6d){_0x19e9db=_0x5afa6d;_0x1f63f0=0xc8;}else{_0x1f63f0=0xce;}_0x4a26b3[_0xeb26('0x1c')](_0x1f63f0);return _0x4a26b3[_0xeb26('0x23')](_0xeb26('0x24'),_0x3b41f5+'-'+_0x19e9db+'/'+_0x5afa6d)[_0xeb26('0x1e')](_0x3dbb9c);}return null;};}function patchUpdates(_0x21dca2){return function(_0x546795){try{jsonpatch[_0xeb26('0x25')](_0x546795,_0x21dca2,!![]);}catch(_0x1fccf2){return BPromise[_0xeb26('0x26')](_0x1fccf2);}return _0x546795[_0xeb26('0x27')]();};}function saveUpdates(_0x5899f0,_0x3d304c){return function(_0x58f4f4){if(_0x58f4f4){return _0x58f4f4['update'](_0x5899f0)[_0xeb26('0x28')](function(_0x20ef71){return _0x20ef71;});}return null;};}function removeEntity(_0xabb7e2,_0x51435a){return function(_0xd57cca){if(_0xd57cca){return _0xd57cca[_0xeb26('0x29')]()[_0xeb26('0x28')](function(){_0xabb7e2[_0xeb26('0x1c')](0xcc)[_0xeb26('0x1d')]();});}};}function handleEntityNotFound(_0x14d6ca,_0x5a3b3b){return function(_0x2780b8){if(!_0x2780b8){_0x14d6ca[_0xeb26('0x1b')](0x194);}return _0x2780b8;};}function handleError(_0x4aeca3,_0x415df3){_0x415df3=_0x415df3||0x1f4;return function(_0x1e642b){logger[_0xeb26('0x2a')](_0x1e642b[_0xeb26('0x2b')]);if(_0x1e642b['name']){delete _0x1e642b[_0xeb26('0x2c')];}_0x4aeca3[_0xeb26('0x1c')](_0x415df3)[_0xeb26('0x2d')](_0x1e642b);};}exports[_0xeb26('0x2e')]=function(_0x8703fa,_0x26ca62){var _0x4a2285={},_0x224a80={},_0x74cacf={'count':0x0,'rows':[]};var _0x68b42f=_[_0xeb26('0x2f')](db[_0xeb26('0x30')][_0xeb26('0x31')],function(_0x3327b7){return{'name':_0x3327b7['fieldName'],'type':_0x3327b7[_0xeb26('0x32')]['key']};});_0x224a80[_0xeb26('0x33')]=_['map'](_0x68b42f,_0xeb26('0x2c'));_0x224a80[_0xeb26('0x34')]=_[_0xeb26('0x35')](_0x8703fa['query']);_0x224a80[_0xeb26('0x36')]=_[_0xeb26('0x37')](_0x224a80[_0xeb26('0x33')],_0x224a80[_0xeb26('0x34')]);_0x4a2285[_0xeb26('0x38')]=_[_0xeb26('0x37')](_0x224a80['model'],qs['fields'](_0x8703fa[_0xeb26('0x34')][_0xeb26('0x39')]));_0x4a2285[_0xeb26('0x38')]=_0x4a2285['attributes'][_0xeb26('0x3a')]?_0x4a2285[_0xeb26('0x38')]:_0x224a80[_0xeb26('0x33')];if(!_0x8703fa[_0xeb26('0x34')]['hasOwnProperty'](_0xeb26('0x3b'))){_0x4a2285['limit']=qs[_0xeb26('0x21')](_0x8703fa[_0xeb26('0x34')][_0xeb26('0x21')]);_0x4a2285['offset']=qs[_0xeb26('0x1f')](_0x8703fa[_0xeb26('0x34')][_0xeb26('0x1f')]);}_0x4a2285[_0xeb26('0x3c')]=qs[_0xeb26('0x3d')](_0x8703fa['query']['sort']);_0x4a2285[_0xeb26('0x3e')]=qs[_0xeb26('0x36')](_['pick'](_0x8703fa[_0xeb26('0x34')],_0x224a80[_0xeb26('0x36')]),_0x68b42f);if(_0x8703fa[_0xeb26('0x34')][_0xeb26('0x3f')]){_0x4a2285['where']=_[_0xeb26('0x40')](_0x4a2285[_0xeb26('0x3e')],{'$or':_[_0xeb26('0x2f')](_0x68b42f,function(_0xaa0b68){if(_0xaa0b68[_0xeb26('0x32')]!==_0xeb26('0x41')){var _0x2acebb={};_0x2acebb[_0xaa0b68[_0xeb26('0x2c')]]={'$like':'%'+_0x8703fa[_0xeb26('0x34')][_0xeb26('0x3f')]+'%'};return _0x2acebb;}})});}_0x4a2285=_[_0xeb26('0x40')]({},_0x4a2285,_0x8703fa[_0xeb26('0x42')]);var _0x1f79d5={'where':_0x4a2285[_0xeb26('0x3e')]};return db[_0xeb26('0x30')]['count'](_0x1f79d5)[_0xeb26('0x28')](function(_0x1c4b49){_0x74cacf[_0xeb26('0x22')]=_0x1c4b49;if(_0x8703fa['query']['includeAll']){_0x4a2285[_0xeb26('0x43')]=[{'all':!![]}];}return db[_0xeb26('0x30')][_0xeb26('0x44')](_0x4a2285);})[_0xeb26('0x28')](function(_0x476b33){_0x74cacf[_0xeb26('0x45')]=_0x476b33;return _0x74cacf;})[_0xeb26('0x28')](respondWithFilteredResult(_0x26ca62,_0x4a2285))[_0xeb26('0x46')](handleError(_0x26ca62,null));};exports['show']=function(_0x3cabc0,_0x13235a){var _0x44c569={'raw':!![],'where':{'id':_0x3cabc0[_0xeb26('0x47')]['id']}},_0x289226={};_0x289226[_0xeb26('0x33')]=_['keys'](db['OpenchannelApplication'][_0xeb26('0x31')]);_0x289226['query']=_[_0xeb26('0x35')](_0x3cabc0[_0xeb26('0x34')]);_0x289226[_0xeb26('0x36')]=_[_0xeb26('0x37')](_0x289226['model'],_0x289226['query']);_0x44c569['attributes']=_[_0xeb26('0x37')](_0x289226[_0xeb26('0x33')],qs['fields'](_0x3cabc0[_0xeb26('0x34')][_0xeb26('0x39')]));_0x44c569[_0xeb26('0x38')]=_0x44c569[_0xeb26('0x38')][_0xeb26('0x3a')]?_0x44c569[_0xeb26('0x38')]:_0x289226[_0xeb26('0x33')];if(_0x3cabc0[_0xeb26('0x34')]['includeAll']){_0x44c569[_0xeb26('0x43')]=[{'all':!![]}];}_0x44c569=_[_0xeb26('0x40')]({},_0x44c569,_0x3cabc0[_0xeb26('0x42')]);return db[_0xeb26('0x30')][_0xeb26('0x48')](_0x44c569)['then'](handleEntityNotFound(_0x13235a,null))[_0xeb26('0x28')](respondWithResult(_0x13235a,null))[_0xeb26('0x46')](handleError(_0x13235a,null));};exports['create']=function(_0x2acd40,_0x5c5fe2){return db[_0xeb26('0x30')][_0xeb26('0x49')](_0x2acd40[_0xeb26('0x4a')],{})['then'](respondWithResult(_0x5c5fe2,0xc9))['catch'](handleError(_0x5c5fe2,null));};exports[_0xeb26('0x4b')]=function(_0x12edbe,_0x5f073a){if(_0x12edbe[_0xeb26('0x4a')]['id']){delete _0x12edbe[_0xeb26('0x4a')]['id'];}return db[_0xeb26('0x30')][_0xeb26('0x48')]({'where':{'id':_0x12edbe[_0xeb26('0x47')]['id']}})[_0xeb26('0x28')](handleEntityNotFound(_0x5f073a,null))[_0xeb26('0x28')](saveUpdates(_0x12edbe['body'],null))[_0xeb26('0x28')](respondWithResult(_0x5f073a,null))[_0xeb26('0x46')](handleError(_0x5f073a,null));};exports['destroy']=function(_0xda9eaa,_0x21a275){return db[_0xeb26('0x30')][_0xeb26('0x48')]({'where':{'id':_0xda9eaa[_0xeb26('0x47')]['id']}})[_0xeb26('0x28')](handleEntityNotFound(_0x21a275,null))[_0xeb26('0x28')](removeEntity(_0x21a275,null))[_0xeb26('0x46')](handleError(_0x21a275,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1ed23be..83b62e7 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 _0xaf25=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications'];(function(_0x4ef880,_0x3148a7){var _0x28ddca=function(_0x342dc9){while(--_0x342dc9){_0x4ef880['push'](_0x4ef880['shift']());}};_0x28ddca(++_0x3148a7);}(_0xaf25,0x1d5));var _0x5af2=function(_0x488de9,_0x5d5052){_0x488de9=_0x488de9-0x0;var _0x30a6f9=_0xaf25[_0x488de9];return _0x30a6f9;};'use strict';var _=require(_0x5af2('0x0'));var util=require(_0x5af2('0x1'));var logger=require(_0x5af2('0x2'))('api');var moment=require(_0x5af2('0x3'));var BPromise=require(_0x5af2('0x4'));var rp=require(_0x5af2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5af2('0x6'));var config=require(_0x5af2('0x7'));var attributes=require(_0x5af2('0x8'));module[_0x5af2('0x9')]=function(_0x524917,_0x13dfb1){return _0x524917['define'](_0x5af2('0xa'),attributes,{'tableName':_0x5af2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5af2('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb59e=['rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb59e,0x102));var _0xeb59=function(_0x15278c,_0x259d51){_0x15278c=_0x15278c-0x0;var _0x54af63=_0xb59e[_0x15278c];return _0x54af63;};'use strict';var _=require(_0xeb59('0x0'));var util=require(_0xeb59('0x1'));var logger=require(_0xeb59('0x2'))(_0xeb59('0x3'));var moment=require(_0xeb59('0x4'));var BPromise=require(_0xeb59('0x5'));var rp=require(_0xeb59('0x6'));var fs=require('fs');var path=require(_0xeb59('0x7'));var rimraf=require(_0xeb59('0x8'));var config=require(_0xeb59('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0xeb59('0xa')]=function(_0x156666,_0x5a2af0){return _0x156666[_0xeb59('0xb')](_0xeb59('0xc'),attributes,{'tableName':_0xeb59('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 9b96162..bfa1f8b 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 _0xa28c=['message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d0ec5,_0x2ec2d1){var _0x2e4811=function(_0x5c3754){while(--_0x5c3754){_0x2d0ec5['push'](_0x2d0ec5['shift']());}};_0x2e4811(++_0x2ec2d1);}(_0xa28c,0xc4));var _0xca28=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xa28c[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xca28('0x0'));var util=require(_0xca28('0x1'));var moment=require(_0xca28('0x2'));var BPromise=require(_0xca28('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca28('0x4'));var db=require(_0xca28('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca28('0x6'))(_0xca28('0x7'));var config=require(_0xca28('0x8'));var jayson=require(_0xca28('0x9'));var client=jayson[_0xca28('0xa')][_0xca28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x375cd7,_0x445b40,_0x8f7aa9){return new BPromise(function(_0x4f1f42,_0x251b22){return client[_0xca28('0xc')](_0x375cd7,_0x8f7aa9)[_0xca28('0xd')](function(_0x3077a1){logger[_0xca28('0xe')](_0xca28('0xf'),_0x445b40,_0xca28('0x10'));logger['debug'](_0xca28('0x11'),_0x445b40,_0xca28('0x10'),JSON[_0xca28('0x12')](_0x3077a1));if(_0x3077a1[_0xca28('0x13')]){if(_0x3077a1['error'][_0xca28('0x14')]===0x1f4){logger[_0xca28('0x13')](_0xca28('0xf'),_0x445b40,_0x3077a1['error'][_0xca28('0x15')]);return _0x251b22(_0x3077a1[_0xca28('0x13')]['message']);}logger['error'](_0xca28('0xf'),_0x445b40,_0x3077a1[_0xca28('0x13')][_0xca28('0x15')]);return _0x4f1f42(_0x3077a1[_0xca28('0x13')][_0xca28('0x15')]);}else{logger[_0xca28('0xe')](_0xca28('0xf'),_0x445b40,'request\x20sent');_0x4f1f42(_0x3077a1[_0xca28('0x16')][_0xca28('0x15')]);}})[_0xca28('0x17')](function(_0x3ec8a2){logger[_0xca28('0x13')](_0xca28('0xf'),_0x445b40,_0x3ec8a2);_0x251b22(_0x3ec8a2);});});}exports[_0xca28('0x18')]=function(_0x4cf7f7){var _0x156645=this;return new Promise(function(_0x59d7f1,_0x40747d){return db[_0xca28('0x19')]['update'](_0x4cf7f7[_0xca28('0x1a')],{'raw':_0x4cf7f7[_0xca28('0x1b')]?_0x4cf7f7[_0xca28('0x1b')][_0xca28('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf7f7['options']?_0x4cf7f7[_0xca28('0x1b')][_0xca28('0x1d')]||null:null,'attributes':_0x4cf7f7['options']?_0x4cf7f7[_0xca28('0x1b')]['attributes']||null:null,'limit':_0x4cf7f7[_0xca28('0x1b')]?_0x4cf7f7['options'][_0xca28('0x1e')]||null:null})['then'](function(_0x180d10){logger['info']('UpdateOpenchannelApplication',_0x4cf7f7);logger['debug'](_0xca28('0x18'),_0x4cf7f7,JSON[_0xca28('0x12')](_0x180d10));_0x59d7f1(_0x180d10);})[_0xca28('0x17')](function(_0x54e745){logger[_0xca28('0x13')](_0xca28('0x18'),_0x54e745[_0xca28('0x15')],_0x4cf7f7);_0x40747d(_0x156645[_0xca28('0x13')](0x1f4,_0x54e745[_0xca28('0x15')]));});});}; \ No newline at end of file +var _0x66ae=['stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','limit','debug','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s'];(function(_0x426059,_0x5be0cd){var _0x5a68da=function(_0x1a813c){while(--_0x1a813c){_0x426059['push'](_0x426059['shift']());}};_0x5a68da(++_0x5be0cd);}(_0x66ae,0x117));var _0xe66a=function(_0x592ffa,_0x2fe78a){_0x592ffa=_0x592ffa-0x0;var _0x5cb513=_0x66ae[_0x592ffa];return _0x5cb513;};'use strict';var _=require(_0xe66a('0x0'));var util=require(_0xe66a('0x1'));var moment=require(_0xe66a('0x2'));var BPromise=require(_0xe66a('0x3'));var rs=require(_0xe66a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe66a('0x5'))['db'];var utils=require(_0xe66a('0x6'));var logger=require(_0xe66a('0x7'))(_0xe66a('0x8'));var config=require(_0xe66a('0x9'));var jayson=require(_0xe66a('0xa'));var client=jayson[_0xe66a('0xb')][_0xe66a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e30a3,_0x2a27ea,_0xb9d0c9){return new BPromise(function(_0xb242e4,_0x34793c){return client[_0xe66a('0xd')](_0x1e30a3,_0xb9d0c9)[_0xe66a('0xe')](function(_0x1c2e50){logger[_0xe66a('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x2a27ea,_0xe66a('0x10'));logger['debug'](_0xe66a('0x11'),_0x2a27ea,_0xe66a('0x10'),JSON[_0xe66a('0x12')](_0x1c2e50));if(_0x1c2e50['error']){if(_0x1c2e50[_0xe66a('0x13')]['code']===0x1f4){logger[_0xe66a('0x13')](_0xe66a('0x14'),_0x2a27ea,_0x1c2e50[_0xe66a('0x13')]['message']);return _0x34793c(_0x1c2e50['error'][_0xe66a('0x15')]);}logger[_0xe66a('0x13')](_0xe66a('0x14'),_0x2a27ea,_0x1c2e50['error'][_0xe66a('0x15')]);return _0xb242e4(_0x1c2e50[_0xe66a('0x13')][_0xe66a('0x15')]);}else{logger[_0xe66a('0xf')](_0xe66a('0x14'),_0x2a27ea,_0xe66a('0x10'));_0xb242e4(_0x1c2e50[_0xe66a('0x16')][_0xe66a('0x15')]);}})['catch'](function(_0x5825e3){logger[_0xe66a('0x13')](_0xe66a('0x14'),_0x2a27ea,_0x5825e3);_0x34793c(_0x5825e3);});});}exports[_0xe66a('0x17')]=function(_0x36deb8){var _0x4ee07f=this;return new Promise(function(_0x1850b1,_0x43d7f4){return db[_0xe66a('0x18')][_0xe66a('0x19')](_0x36deb8[_0xe66a('0x1a')],{'raw':_0x36deb8['options']?_0x36deb8[_0xe66a('0x1b')][_0xe66a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36deb8[_0xe66a('0x1b')]?_0x36deb8[_0xe66a('0x1b')]['where']||null:null,'attributes':_0x36deb8[_0xe66a('0x1b')]?_0x36deb8[_0xe66a('0x1b')][_0xe66a('0x1d')]||null:null,'limit':_0x36deb8['options']?_0x36deb8[_0xe66a('0x1b')][_0xe66a('0x1e')]||null:null})[_0xe66a('0xe')](function(_0x22ebc9){logger['info'](_0xe66a('0x17'),_0x36deb8);logger[_0xe66a('0x1f')](_0xe66a('0x17'),_0x36deb8,JSON[_0xe66a('0x12')](_0x22ebc9));_0x1850b1(_0x22ebc9);})[_0xe66a('0x20')](function(_0x4445ef){logger[_0xe66a('0x13')](_0xe66a('0x17'),_0x4445ef[_0xe66a('0x15')],_0x36deb8);_0x43d7f4(_0x4ee07f[_0xe66a('0x13')](0x1f4,_0x4445ef[_0xe66a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 238a626..623c061 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 _0xd5a9=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5a3c67,_0x2da13c){var _0x3d46bd=function(_0x1c15be){while(--_0x1c15be){_0x5a3c67['push'](_0x5a3c67['shift']());}};_0x3d46bd(++_0x2da13c);}(_0xd5a9,0xa0));var _0x9d5a=function(_0x284a44,_0x3bfc79){_0x284a44=_0x284a44-0x0;var _0x4974b4=_0xd5a9[_0x284a44];return _0x4974b4;};'use strict';var multer=require(_0x9d5a('0x0'));var util=require('util');var path=require(_0x9d5a('0x1'));var timeout=require(_0x9d5a('0x2'));var express=require(_0x9d5a('0x3'));var router=express[_0x9d5a('0x4')]();var fs_extra=require(_0x9d5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d5a('0x6'));var config=require(_0x9d5a('0x7'));var controller=require(_0x9d5a('0x8'));router['get']('/',auth[_0x9d5a('0x9')](),controller[_0x9d5a('0xa')]);router[_0x9d5a('0xb')](_0x9d5a('0xc'),auth[_0x9d5a('0x9')](),controller[_0x9d5a('0xd')]);router[_0x9d5a('0xb')]('/:id',auth[_0x9d5a('0x9')](),controller[_0x9d5a('0xe')]);router[_0x9d5a('0xb')](_0x9d5a('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x9d5a('0xb')](_0x9d5a('0x10'),auth[_0x9d5a('0x9')](),controller[_0x9d5a('0x11')]);router[_0x9d5a('0x12')]('/',auth[_0x9d5a('0x9')](),controller[_0x9d5a('0x13')]);router[_0x9d5a('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x9d5a('0x14')]);router[_0x9d5a('0x12')](_0x9d5a('0x15'),auth[_0x9d5a('0x9')](),interaction[_0x9d5a('0x16')](_0x9d5a('0x17'),'openchannelinteraction:addtags'),controller[_0x9d5a('0x18')]);router[_0x9d5a('0x19')](_0x9d5a('0x1a'),auth[_0x9d5a('0x9')](),interaction[_0x9d5a('0x16')](_0x9d5a('0x17'),_0x9d5a('0x1b')),controller[_0x9d5a('0x1c')]);router[_0x9d5a('0x1d')](_0x9d5a('0x1a'),auth[_0x9d5a('0x9')](),interaction['tracked']('openchannel',_0x9d5a('0x1e')),controller[_0x9d5a('0x1f')]);router[_0x9d5a('0x1d')](_0x9d5a('0x15'),auth[_0x9d5a('0x9')](),controller['removeTags']);module[_0x9d5a('0x20')]=router; \ No newline at end of file +var _0x01e9=['/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get'];(function(_0xa77f04,_0x5e142c){var _0x36531f=function(_0x10f2c3){while(--_0x10f2c3){_0xa77f04['push'](_0xa77f04['shift']());}};_0x36531f(++_0x5e142c);}(_0x01e9,0x135));var _0x901e=function(_0x2e6ce1,_0x39e46d){_0x2e6ce1=_0x2e6ce1-0x0;var _0x247c23=_0x01e9[_0x2e6ce1];return _0x247c23;};'use strict';var multer=require(_0x901e('0x0'));var util=require(_0x901e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x901e('0x2'));var router=express[_0x901e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x901e('0x4'));var interaction=require(_0x901e('0x5'));var config=require(_0x901e('0x6'));var controller=require(_0x901e('0x7'));router['get']('/',auth[_0x901e('0x8')](),controller[_0x901e('0x9')]);router[_0x901e('0xa')](_0x901e('0xb'),auth['isAuthenticated'](),controller[_0x901e('0xc')]);router['get'](_0x901e('0xd'),auth[_0x901e('0x8')](),controller[_0x901e('0xe')]);router[_0x901e('0xa')](_0x901e('0xf'),auth['isAuthenticated'](),controller[_0x901e('0x10')]);router[_0x901e('0xa')]('/:id/download',auth[_0x901e('0x8')](),controller[_0x901e('0x11')]);router[_0x901e('0x12')]('/',auth[_0x901e('0x8')](),controller['create']);router[_0x901e('0x12')](_0x901e('0xf'),auth['isAuthenticated'](),controller[_0x901e('0x13')]);router[_0x901e('0x12')](_0x901e('0x14'),auth[_0x901e('0x8')](),interaction[_0x901e('0x15')](_0x901e('0x16'),'openchannelinteraction:addtags'),controller[_0x901e('0x17')]);router[_0x901e('0x18')](_0x901e('0xd'),auth['isAuthenticated'](),interaction[_0x901e('0x15')](_0x901e('0x16'),_0x901e('0x19')),controller[_0x901e('0x1a')]);router[_0x901e('0x1b')]('/:id',auth[_0x901e('0x8')](),interaction[_0x901e('0x15')](_0x901e('0x16'),_0x901e('0x1c')),controller[_0x901e('0x1d')]);router['delete'](_0x901e('0x14'),auth['isAuthenticated'](),controller[_0x901e('0x1e')]);module[_0x901e('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index cc89f8f..f445d9e 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 _0x80c7=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x1be514,_0x46451e){var _0x5d7e10=function(_0x124593){while(--_0x124593){_0x1be514['push'](_0x1be514['shift']());}};_0x5d7e10(++_0x46451e);}(_0x80c7,0x8d));var _0x780c=function(_0x41da16,_0x1e4fd9){_0x41da16=_0x41da16-0x0;var _0x8b9e24=_0x80c7[_0x41da16];return _0x8b9e24;};'use strict';var Sequelize=require(_0x780c('0x0'));module[_0x780c('0x1')]={'closed':{'type':Sequelize[_0x780c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x780c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x780c('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x780c('0x3')]},'threadId':{'type':Sequelize[_0x780c('0x4')]},'externalUrl':{'type':Sequelize[_0x780c('0x4')]},'lastMsgAt':{'type':Sequelize[_0x780c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x780c('0x5')]('in',_0x780c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x780c('0x5')]('in',_0x780c('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x780c('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x780c('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x80ce=['ENUM','out','DATE','STRING'];(function(_0x45d923,_0xf7c0b4){var _0x21b24c=function(_0x5593a4){while(--_0x5593a4){_0x45d923['push'](_0x45d923['shift']());}};_0x21b24c(++_0xf7c0b4);}(_0x80ce,0xae));var _0xe80c=function(_0x321511,_0xe134e7){_0x321511=_0x321511-0x0;var _0x5d6bd1=_0x80ce[_0x321511];return _0x5d6bd1;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe80c('0x0')]},'disposition':{'type':Sequelize[_0xe80c('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe80c('0x1')]},'note':{'type':Sequelize[_0xe80c('0x1')]},'read1stAt':{'type':Sequelize[_0xe80c('0x0')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe80c('0x2')]('in',_0xe80c('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe80c('0x2')]('in',_0xe80c('0x3')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'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 16aa2f8..f904d3b 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 _0xc3c2=['rimraf','util','path','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','openchannel','query','user','then','catch','show','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','create','body','find','describe','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','pick','where','OpenchannelInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','files','join','attachments','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','filter','existsSync','createReadStream','createWriteStream','basename','direction','out','System','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc3c2,0x186));var _0x2c3c=function(_0x409f1e,_0x495a48){_0x409f1e=_0x409f1e-0x0;var _0x2112a5=_0xc3c2[_0x409f1e];return _0x2112a5;};'use strict';var rimraf=require(_0x2c3c('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var util=require(_0x2c3c('0x1'));var path=require(_0x2c3c('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c3c('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0x2c3c('0x4'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x2c3c('0x5'));var config=require(_0x2c3c('0x6'));var db=require(_0x2c3c('0x7'))['db'];config[_0x2c3c('0x8')]=_[_0x2c3c('0x9')](config[_0x2c3c('0x8')],{'host':_0x2c3c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2c3c('0xb'))[_0x2c3c('0xc')](socket);function respondWithStatusCode(_0x1ec3af,_0x564097){_0x564097=_0x564097||0xcc;return function(_0x4528a3){if(_0x4528a3){return _0x1ec3af[_0x2c3c('0xd')](_0x564097);}return _0x1ec3af[_0x2c3c('0xe')](_0x564097)[_0x2c3c('0xf')]();};}function respondWithResult(_0x2fcfd5,_0x34234e){_0x34234e=_0x34234e||0xc8;return function(_0x16d02a){if(_0x16d02a){return _0x2fcfd5[_0x2c3c('0xe')](_0x34234e)[_0x2c3c('0x10')](_0x16d02a);}};}function respondWithFilteredResult(_0x3eb9f2,_0x5e4f03){return function(_0x1c70a0){if(_0x1c70a0){var _0x3a0167=typeof _0x5e4f03[_0x2c3c('0x11')]===_0x2c3c('0x12')&&typeof _0x5e4f03['limit']==='undefined';var _0x313860=_0x1c70a0[_0x2c3c('0x13')];var _0x2bbc19=_0x3a0167?0x0:_0x5e4f03['offset'];var _0x3aa918=_0x3a0167?_0x1c70a0[_0x2c3c('0x13')]:_0x5e4f03[_0x2c3c('0x11')]+_0x5e4f03[_0x2c3c('0x14')];var _0x1cfc7e;if(_0x3aa918>=_0x313860){_0x3aa918=_0x313860;_0x1cfc7e=0xc8;}else{_0x1cfc7e=0xce;}_0x3eb9f2['status'](_0x1cfc7e);return _0x3eb9f2[_0x2c3c('0x15')](_0x2c3c('0x16'),_0x2bbc19+'-'+_0x3aa918+'/'+_0x313860)['json'](_0x1c70a0);}return null;};}function saveUpdates(_0x3bdd63){return function(_0x38eef2){if(_0x38eef2){return _0x38eef2[_0x2c3c('0x17')](_0x3bdd63)['then'](function(_0x14f26a){return _0x14f26a;});}return null;};}function removeEntity(_0x33fdad){return function(_0x3e1d6d){if(_0x3e1d6d){return _0x3e1d6d[_0x2c3c('0x18')]()['then'](function(){_0x33fdad[_0x2c3c('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x213db1){return function(_0x4daccb){if(!_0x4daccb){_0x213db1['sendStatus'](0x194);}return _0x4daccb;};}function handleError(_0x3e57e7,_0x14840b){_0x14840b=_0x14840b||0x1f4;return function(_0x19900a){logger[_0x2c3c('0x19')](_0x19900a[_0x2c3c('0x1a')]);if(_0x19900a['name']){delete _0x19900a[_0x2c3c('0x1b')];}_0x3e57e7[_0x2c3c('0xe')](_0x14840b)[_0x2c3c('0x1c')](_0x19900a);};}exports['index']=function(_0x5edb9c,_0x352792){var _0x40a558={};var _0x595fd2=_[_0x2c3c('0x1d')](db[_0x2c3c('0x1e')][_0x2c3c('0x1f')],function(_0x414ded){return{'name':_0x414ded[_0x2c3c('0x20')],'type':_0x414ded[_0x2c3c('0x21')][_0x2c3c('0x22')]};});_0x40a558=qs['getOptions'](_0x595fd2,_0x5edb9c);return interaction['findAll'](_0x2c3c('0x23'),_0x5edb9c[_0x2c3c('0x24')],_0x5edb9c[_0x2c3c('0x25')],_0x40a558,_0x595fd2)[_0x2c3c('0x26')](respondWithFilteredResult(_0x352792,_0x40a558))[_0x2c3c('0x27')](handleError(_0x352792,null));};exports[_0x2c3c('0x28')]=function(_0x38d835,_0x4e849c){var _0x2989c7={};if(_0x38d835[_0x2c3c('0x24')]['type']&&_0x38d835[_0x2c3c('0x24')][_0x2c3c('0x21')]===_0x2c3c('0x29')){_0x2989c7[_0x2c3c('0x29')]=_0x38d835[_0x2c3c('0x2a')]['id'];}else{_0x2989c7['id']=_0x38d835['params']['id'];}var _0x3a948f={'raw':![],'where':_0x2989c7},_0x89482a={};_0x89482a[_0x2c3c('0x2b')]=_[_0x2c3c('0x2c')](db[_0x2c3c('0x1e')][_0x2c3c('0x1f')]);_0x89482a[_0x2c3c('0x24')]=_[_0x2c3c('0x2c')](_0x38d835[_0x2c3c('0x24')]);_0x89482a[_0x2c3c('0x2d')]=_[_0x2c3c('0x2e')](_0x89482a['model'],_0x89482a[_0x2c3c('0x24')]);_0x3a948f[_0x2c3c('0x2f')]=_[_0x2c3c('0x2e')](_0x89482a['model'],qs[_0x2c3c('0x30')](_0x38d835[_0x2c3c('0x24')][_0x2c3c('0x30')]));_0x3a948f[_0x2c3c('0x2f')]=_0x3a948f[_0x2c3c('0x2f')]['length']?_0x3a948f[_0x2c3c('0x2f')]:_0x89482a['model'];if(_0x38d835['query'][_0x2c3c('0x31')]){_0x3a948f[_0x2c3c('0x32')]=[{'all':!![]}];}_0x3a948f=_[_0x2c3c('0x33')]({},_0x3a948f,_0x38d835['options']);return db['OpenchannelInteraction']['find'](_0x3a948f)['then'](handleEntityNotFound(_0x4e849c,null))['then'](respondWithResult(_0x4e849c,null))[_0x2c3c('0x27')](handleError(_0x4e849c,null));};exports['create']=function(_0x3c7526,_0x5d77bf){return db[_0x2c3c('0x1e')][_0x2c3c('0x34')](_0x3c7526[_0x2c3c('0x35')],{})[_0x2c3c('0x26')](respondWithResult(_0x5d77bf,0xc9))[_0x2c3c('0x27')](handleError(_0x5d77bf,null));};exports[_0x2c3c('0x17')]=function(_0x525fbf,_0x57c8a8){if(_0x525fbf[_0x2c3c('0x35')]['id']){delete _0x525fbf['body']['id'];}return db[_0x2c3c('0x1e')][_0x2c3c('0x36')]({'where':{'id':_0x525fbf[_0x2c3c('0x2a')]['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x57c8a8,null))['then'](saveUpdates(_0x525fbf[_0x2c3c('0x35')],null))[_0x2c3c('0x26')](respondWithResult(_0x57c8a8,null))[_0x2c3c('0x27')](handleError(_0x57c8a8,null));};exports['destroy']=function(_0x7932d4,_0x5c483b){return db[_0x2c3c('0x1e')][_0x2c3c('0x36')]({'where':{'id':_0x7932d4[_0x2c3c('0x2a')]['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x5c483b,null))['then'](removeEntity(_0x5c483b,null))[_0x2c3c('0x27')](handleError(_0x5c483b,null));};exports[_0x2c3c('0x37')]=function(_0x5413fc,_0x1ca0c0){return db[_0x2c3c('0x1e')][_0x2c3c('0x37')]()[_0x2c3c('0x26')](respondWithResult(_0x1ca0c0,null))[_0x2c3c('0x27')](handleError(_0x1ca0c0,null));};exports['addMessage']=function(_0x467808,_0x21d83f){return db[_0x2c3c('0x38')][_0x2c3c('0x36')]({'where':{'id':_0x467808[_0x2c3c('0x2a')]['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x21d83f,null))[_0x2c3c('0x26')](function(_0x25b372){if(_0x25b372){return _0x25b372['addMessage'](_0x467808[_0x2c3c('0x35')][_0x2c3c('0x39')],_[_0x2c3c('0x3a')](_0x467808[_0x2c3c('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x21d83f,null))['catch'](handleError(_0x21d83f,null));};exports[_0x2c3c('0x3b')]=function(_0x2c474c,_0x11e83d){var _0xc3d7e4={'raw':![],'where':{}};var _0x4c6cb9={};var _0x40059e={'count':0x0,'rows':[]};return db[_0x2c3c('0x1e')][_0x2c3c('0x3c')]({'where':{'id':_0x2c474c['params']['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x11e83d,null))[_0x2c3c('0x26')](function(_0x348d46){if(_0x348d46){_0x4c6cb9[_0x2c3c('0x2b')]=_[_0x2c3c('0x2c')](db[_0x2c3c('0x38')][_0x2c3c('0x1f')]);_0x4c6cb9['query']=_[_0x2c3c('0x2c')](_0x2c474c[_0x2c3c('0x24')]);_0x4c6cb9[_0x2c3c('0x2d')]=_[_0x2c3c('0x2e')](_0x4c6cb9[_0x2c3c('0x2b')],_0x4c6cb9[_0x2c3c('0x24')]);_0xc3d7e4[_0x2c3c('0x2f')]=_['intersection'](_0x4c6cb9[_0x2c3c('0x2b')],qs[_0x2c3c('0x30')](_0x2c474c[_0x2c3c('0x24')]['fields']));_0xc3d7e4[_0x2c3c('0x2f')]=_0xc3d7e4[_0x2c3c('0x2f')]['length']?_0xc3d7e4[_0x2c3c('0x2f')]:_0x4c6cb9[_0x2c3c('0x2b')];if(!_0x2c474c[_0x2c3c('0x24')][_0x2c3c('0x3d')]('nolimit')){_0xc3d7e4[_0x2c3c('0x14')]=qs[_0x2c3c('0x14')](_0x2c474c['query']['limit']);_0xc3d7e4[_0x2c3c('0x11')]=qs[_0x2c3c('0x11')](_0x2c474c['query']['offset']);}_0xc3d7e4[_0x2c3c('0x3e')]=qs[_0x2c3c('0x3f')](_0x2c474c['query'][_0x2c3c('0x3f')]);_0xc3d7e4['where']=qs[_0x2c3c('0x2d')](_[_0x2c3c('0x40')](_0x2c474c['query'],_0x4c6cb9[_0x2c3c('0x2d')]));_0xc3d7e4[_0x2c3c('0x41')][_0x2c3c('0x42')]=_0x348d46['id'];if(_0x2c474c[_0x2c3c('0x24')]['filter']){_0xc3d7e4[_0x2c3c('0x41')]=_[_0x2c3c('0x33')](_0xc3d7e4[_0x2c3c('0x41')],{'$or':_[_0x2c3c('0x1d')](_0xc3d7e4[_0x2c3c('0x2f')],function(_0x36408b){var _0x3aff5a={};_0x3aff5a[_0x36408b]={'$like':'%'+_0x2c474c[_0x2c3c('0x24')]['filter']+'%'};return _0x3aff5a;})});}if(_0x2c474c[_0x2c3c('0x24')]['$gte']){var _0x2ef1ba=_0x2c474c[_0x2c3c('0x24')][_0x2c3c('0x43')][_0x2c3c('0x44')](',');var _0x3a3908={};_0x3a3908[_0x2ef1ba[0x0]]={'$gte':moment(_0x2ef1ba[0x1])['format'](_0x2c3c('0x45'))};_0xc3d7e4[_0x2c3c('0x41')]=_[_0x2c3c('0x33')](_0xc3d7e4[_0x2c3c('0x41')],_0x3a3908);}_0xc3d7e4=_[_0x2c3c('0x33')]({},_0xc3d7e4,_0x2c474c[_0x2c3c('0x46')]);return db[_0x2c3c('0x38')][_0x2c3c('0x13')]({'where':_0xc3d7e4[_0x2c3c('0x41')]})[_0x2c3c('0x26')](function(_0x5cb772){_0x40059e[_0x2c3c('0x13')]=_0x5cb772;if(_0x2c474c[_0x2c3c('0x24')][_0x2c3c('0x31')]){_0xc3d7e4['include']=[{'all':!![]}];}return db[_0x2c3c('0x38')][_0x2c3c('0x47')](_0xc3d7e4);})[_0x2c3c('0x26')](function(_0x85f6c0){_0x40059e[_0x2c3c('0x48')]=_0x85f6c0;return _0x40059e;});}})[_0x2c3c('0x26')](respondWithFilteredResult(_0x11e83d,_0xc3d7e4))[_0x2c3c('0x27')](handleError(_0x11e83d,null));};exports['addTags']=function(_0x2580ff,_0x4d6000){return db[_0x2c3c('0x1e')]['find']({'where':{'id':_0x2580ff['params']['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x4d6000,null))[_0x2c3c('0x26')](function(_0x5a3277){if(_0x5a3277){return _0x5a3277[_0x2c3c('0x49')](_0x2580ff[_0x2c3c('0x35')]['ids'],_[_0x2c3c('0x3a')](_0x2580ff[_0x2c3c('0x35')],['ids','id'])||{})[_0x2c3c('0x4a')](function(){return db[_0x2c3c('0x4b')][_0x2c3c('0x47')]({'attributes':['id',_0x2c3c('0x1b'),_0x2c3c('0x4c')],'where':{'id':_0x2580ff[_0x2c3c('0x35')][_0x2c3c('0x39')]}});})['then'](function(_0x46e73c){socket[_0x2c3c('0x4d')](_0x2c3c('0x4e'),{'id':Number(_0x2580ff[_0x2c3c('0x2a')]['id']),'tags':_0x46e73c||[]});return{'id':Number(_0x2580ff[_0x2c3c('0x2a')]['id']),'tags':_0x46e73c||[]};});}})[_0x2c3c('0x26')](respondWithResult(_0x4d6000,null))[_0x2c3c('0x27')](handleError(_0x4d6000,null));};exports[_0x2c3c('0x4f')]=function(_0x3e9bfd,_0x5e5278){return db[_0x2c3c('0x1e')][_0x2c3c('0x36')]({'where':{'id':_0x3e9bfd[_0x2c3c('0x2a')]['id']}})[_0x2c3c('0x26')](handleEntityNotFound(_0x5e5278,null))[_0x2c3c('0x26')](function(_0x1fd6e1){if(_0x1fd6e1){return _0x1fd6e1[_0x2c3c('0x4f')](_0x3e9bfd['query'][_0x2c3c('0x39')]);}})[_0x2c3c('0x26')](respondWithStatusCode(_0x5e5278,null))[_0x2c3c('0x27')](handleError(_0x5e5278,null));};exports[_0x2c3c('0x50')]=function(_0xdb9fd6,_0x4519a5){var _0x197f7e=moment()[_0x2c3c('0x51')]()[_0x2c3c('0x52')]();var _0x53cfb5=path['join'](config[_0x2c3c('0x53')],_0x2c3c('0x54'),_0x2c3c('0x55'),'tmp');var _0x1e15ed=path[_0x2c3c('0x56')](config[_0x2c3c('0x53')],_0x2c3c('0x54'),'files',_0x2c3c('0x57'));var _0x1d8e0e=path[_0x2c3c('0x56')](_0x53cfb5,_0x197f7e);var _0x3326ba=util[_0x2c3c('0x58')](_0x2c3c('0x59'),_0xdb9fd6[_0x2c3c('0x2a')]['id'],_0x197f7e);var _0x502f82=path[_0x2c3c('0x56')](_0x53cfb5,_0x3326ba);var _0xf10581=[];_0xf10581[_0x2c3c('0x5a')]({'model':db[_0x2c3c('0x5b')],'as':_0x2c3c('0x5b'),'attributes':['id',_0x2c3c('0x5c')],'raw':!![]});_0xf10581[_0x2c3c('0x5a')]({'model':db['CmContact'],'as':_0x2c3c('0x5d'),'attributes':['id',_0x2c3c('0x5e'),'lastName'],'raw':!![]});if(_0xdb9fd6['query']['attachments']){_0xf10581['push']({'model':db[_0x2c3c('0x5f')],'as':_0x2c3c('0x5f'),'raw':!![]});}var _0x2c4cd4=[{'model':db[_0x2c3c('0x38')],'as':_0x2c3c('0x60'),'attributes':['id',_0x2c3c('0x35'),_0x2c3c('0x61'),'direction',_0x2c3c('0x62'),'read'],'include':_0xf10581}];_0x2c4cd4[_0x2c3c('0x5a')]({'model':db[_0x2c3c('0x63')],'as':_0x2c3c('0x64'),'attributes':['id',_0x2c3c('0x1b')]});_0x2c4cd4[_0x2c3c('0x5a')]({'model':db[_0x2c3c('0x5b')],'as':_0x2c3c('0x65'),'attributes':['id',_0x2c3c('0x5c')]});return db[_0x2c3c('0x1e')][_0x2c3c('0x36')]({'where':{'id':_0xdb9fd6['params']['id']},'include':_0x2c4cd4})[_0x2c3c('0x26')](handleEntityNotFound(_0x4519a5,null))[_0x2c3c('0x26')](function(_0x454e1f){if(_0x454e1f){var _0x5de35c=_0x454e1f[_0x2c3c('0x66')]({'plain':!![]});fs[_0x2c3c('0x67')](_0x1d8e0e);var _0x509bf4={'channel':_0x2c3c('0x68'),'account':_0x5de35c['Account'][_0x2c3c('0x1b')],'agent':_0x5de35c['Owner']?_0x5de35c[_0x2c3c('0x65')][_0x2c3c('0x5c')]:_0x2c3c('0x69'),'createdAt':moment(_0x5de35c[_0x2c3c('0x61')])[_0x2c3c('0x58')](_0x2c3c('0x45'))[_0x2c3c('0x52')](),'closedAt':_0x5de35c[_0x2c3c('0x6a')]?moment(_0x5de35c[_0x2c3c('0x6b')])[_0x2c3c('0x58')](_0x2c3c('0x45'))[_0x2c3c('0x52')]():'','disposition':_0x5de35c[_0x2c3c('0x6c')],'visibility':_0x5de35c[_0x2c3c('0x6d')]?_0x2c3c('0x6e'):_0x2c3c('0x6f'),'messages':_(_0x5de35c[_0x2c3c('0x60')])[_0x2c3c('0x70')]({'secret':![]})[_0x2c3c('0x1d')](function(_0x5a0e0f){if(_0x5a0e0f['Attachment']){var _0x1bc4a3=path['join'](_0x1e15ed,_0x5a0e0f[_0x2c3c('0x5f')]['basename']);if(fs[_0x2c3c('0x71')](_0x1bc4a3)){fs[_0x2c3c('0x72')](_0x1bc4a3)['pipe'](fs[_0x2c3c('0x73')](path[_0x2c3c('0x56')](_0x1d8e0e,_0x5a0e0f['Attachment'][_0x2c3c('0x74')])));}}return{'date':moment(_0x5a0e0f[_0x2c3c('0x61')])[_0x2c3c('0x58')](_0x2c3c('0x45'))[_0x2c3c('0x52')](),'sender':_0x5a0e0f[_0x2c3c('0x75')]===_0x2c3c('0x76')?_0x5a0e0f[_0x2c3c('0x5b')]?_0x5a0e0f[_0x2c3c('0x5b')][_0x2c3c('0x5c')]:_0x2c3c('0x77'):_0x5a0e0f[_0x2c3c('0x5d')][_0x2c3c('0x5e')]+(_0x5a0e0f[_0x2c3c('0x5d')]['lastName']?'\x20'+_0x5a0e0f['Contact'][_0x2c3c('0x78')]:''),'body':_0x5a0e0f[_0x2c3c('0x5f')]?_0x5a0e0f['Attachment'][_0x2c3c('0x74')]:_0x5a0e0f['body'],'direction':_0x5a0e0f['direction']===_0x2c3c('0x76')?'A':'C','secret':_0x5a0e0f['secret'],'read':_0x5a0e0f[_0x2c3c('0x79')],'attachment':_0x5a0e0f[_0x2c3c('0x5f')]};})[_0x2c3c('0x7a')]()};return ejs[_0x2c3c('0x7b')](path['join'](config[_0x2c3c('0x53')],_0x2c3c('0x54'),_0x2c3c('0x7c'),_0x2c3c('0x7d')),{'interaction':_0x509bf4})['then'](function(_0x3cc80a){var _0x47f81e=path[_0x2c3c('0x56')](_0x1d8e0e,_0x2c3c('0x7e')+_0x5de35c['id']+'-'+_0x197f7e+'.pdf');var _0x157011={'path':_0x47f81e,'channel':_0x2c3c('0x68'),'interactionId':_0x5de35c['id']};return pdf[_0x2c3c('0x7f')](_0x3cc80a,_0x157011);})[_0x2c3c('0x26')](function(){return new Promise(function(_0x29fe54,_0x1d57cf){zipdir(_0x1d8e0e,{'saveTo':_0x502f82},function(_0x218bdf,_0x1624e2){if(_0x218bdf)return _0x1d57cf(_0x218bdf);return _0x29fe54(_0x1624e2);});})[_0x2c3c('0x26')](function(){return new Promise(function(_0x31914c,_0x4c10cc){rimraf(_0x1d8e0e,function(_0x8e6d1f){if(_0x8e6d1f)_0x4c10cc(_0x8e6d1f);return _0x31914c();});});})[_0x2c3c('0x26')](function(){return _0x4519a5[_0x2c3c('0x50')](_0x502f82,_0x3326ba,function(_0x20b0d5){if(_0x20b0d5){logger['error'](_0x2c3c('0x80'),_0x20b0d5);}else{fs[_0x2c3c('0x81')](_0x502f82);}});});});}else{return _0x4519a5[_0x2c3c('0xd')](0xc8);}})[_0x2c3c('0x27')](handleError(_0x4519a5,null));}; \ No newline at end of file +var _0xfc87=['YYYY-MM-DD\x20HH:mm:ss','disposition','Public','Private','basename','createReadStream','direction','out','System','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','api','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','stack','name','send','index','map','OpenchannelInteraction','fieldName','key','findAll','openchannel','query','user','show','type','from','params','model','keys','rawAttributes','filters','intersection','attributes','includeAll','include','options','find','catch','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','length','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','split','format','rows','addTags','setTags','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','fullname','CmContact','Contact','lastName','push','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','User','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt'];(function(_0x1ed2af,_0x35b554){var _0x444c90=function(_0x56348e){while(--_0x56348e){_0x1ed2af['push'](_0x1ed2af['shift']());}};_0x444c90(++_0x35b554);}(_0xfc87,0x116));var _0x7fc8=function(_0x27f2eb,_0x3c2f16){_0x27f2eb=_0x27f2eb-0x0;var _0x2f0891=_0xfc87[_0x27f2eb];return _0x2f0891;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x7fc8('0x0'));var moment=require(_0x7fc8('0x1'));var util=require(_0x7fc8('0x2'));var path=require(_0x7fc8('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x7fc8('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x7fc8('0x5'));var pdf=require(_0x7fc8('0x6'));var logger=require('../../config/logger')(_0x7fc8('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7fc8('0x8')]=_[_0x7fc8('0x9')](config[_0x7fc8('0x8')],{'host':_0x7fc8('0xa'),'port':0x18eb});var socket=require(_0x7fc8('0xb'))(new Redis(config[_0x7fc8('0x8')]));require(_0x7fc8('0xc'))[_0x7fc8('0xd')](socket);function respondWithStatusCode(_0x51d51c,_0x34c8a3){_0x34c8a3=_0x34c8a3||0xcc;return function(_0x5a2430){if(_0x5a2430){return _0x51d51c[_0x7fc8('0xe')](_0x34c8a3);}return _0x51d51c[_0x7fc8('0xf')](_0x34c8a3)[_0x7fc8('0x10')]();};}function respondWithResult(_0x1b936e,_0x3aab89){_0x3aab89=_0x3aab89||0xc8;return function(_0x2b1c5d){if(_0x2b1c5d){return _0x1b936e[_0x7fc8('0xf')](_0x3aab89)['json'](_0x2b1c5d);}};}function respondWithFilteredResult(_0x2af3e1,_0x2cfc79){return function(_0x548112){if(_0x548112){var _0x4b7606=typeof _0x2cfc79[_0x7fc8('0x11')]==='undefined'&&typeof _0x2cfc79[_0x7fc8('0x12')]===_0x7fc8('0x13');var _0x9ce559=_0x548112[_0x7fc8('0x14')];var _0x3eceed=_0x4b7606?0x0:_0x2cfc79[_0x7fc8('0x11')];var _0x462be7=_0x4b7606?_0x548112[_0x7fc8('0x14')]:_0x2cfc79[_0x7fc8('0x11')]+_0x2cfc79[_0x7fc8('0x12')];var _0xe133fb;if(_0x462be7>=_0x9ce559){_0x462be7=_0x9ce559;_0xe133fb=0xc8;}else{_0xe133fb=0xce;}_0x2af3e1[_0x7fc8('0xf')](_0xe133fb);return _0x2af3e1[_0x7fc8('0x15')](_0x7fc8('0x16'),_0x3eceed+'-'+_0x462be7+'/'+_0x9ce559)[_0x7fc8('0x17')](_0x548112);}return null;};}function saveUpdates(_0x756f9c){return function(_0x32a2a3){if(_0x32a2a3){return _0x32a2a3[_0x7fc8('0x18')](_0x756f9c)[_0x7fc8('0x19')](function(_0xfa9960){return _0xfa9960;});}return null;};}function removeEntity(_0x1b1fc7){return function(_0x2827ac){if(_0x2827ac){return _0x2827ac[_0x7fc8('0x1a')]()[_0x7fc8('0x19')](function(){_0x1b1fc7[_0x7fc8('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a2546){return function(_0x2e6450){if(!_0x2e6450){_0x4a2546[_0x7fc8('0xe')](0x194);}return _0x2e6450;};}function handleError(_0xfcb3ed,_0xa8b3a8){_0xa8b3a8=_0xa8b3a8||0x1f4;return function(_0x3ca44b){logger['error'](_0x3ca44b[_0x7fc8('0x1b')]);if(_0x3ca44b['name']){delete _0x3ca44b[_0x7fc8('0x1c')];}_0xfcb3ed[_0x7fc8('0xf')](_0xa8b3a8)[_0x7fc8('0x1d')](_0x3ca44b);};}exports[_0x7fc8('0x1e')]=function(_0x2c9af7,_0x34e3e8){var _0x766108={};var _0x5cc4ef=_[_0x7fc8('0x1f')](db[_0x7fc8('0x20')]['rawAttributes'],function(_0x508d24){return{'name':_0x508d24[_0x7fc8('0x21')],'type':_0x508d24['type'][_0x7fc8('0x22')]};});_0x766108=qs['getOptions'](_0x5cc4ef,_0x2c9af7);return interaction[_0x7fc8('0x23')](_0x7fc8('0x24'),_0x2c9af7[_0x7fc8('0x25')],_0x2c9af7[_0x7fc8('0x26')],_0x766108,_0x5cc4ef)['then'](respondWithFilteredResult(_0x34e3e8,_0x766108))['catch'](handleError(_0x34e3e8,null));};exports[_0x7fc8('0x27')]=function(_0x566491,_0x74bad4){var _0xd33f14={};if(_0x566491[_0x7fc8('0x25')][_0x7fc8('0x28')]&&_0x566491[_0x7fc8('0x25')][_0x7fc8('0x28')]===_0x7fc8('0x29')){_0xd33f14[_0x7fc8('0x29')]=_0x566491[_0x7fc8('0x2a')]['id'];}else{_0xd33f14['id']=_0x566491[_0x7fc8('0x2a')]['id'];}var _0x1acc9c={'raw':![],'where':_0xd33f14},_0x2e23d8={};_0x2e23d8[_0x7fc8('0x2b')]=_[_0x7fc8('0x2c')](db[_0x7fc8('0x20')][_0x7fc8('0x2d')]);_0x2e23d8[_0x7fc8('0x25')]=_[_0x7fc8('0x2c')](_0x566491[_0x7fc8('0x25')]);_0x2e23d8[_0x7fc8('0x2e')]=_[_0x7fc8('0x2f')](_0x2e23d8[_0x7fc8('0x2b')],_0x2e23d8[_0x7fc8('0x25')]);_0x1acc9c[_0x7fc8('0x30')]=_[_0x7fc8('0x2f')](_0x2e23d8[_0x7fc8('0x2b')],qs['fields'](_0x566491['query']['fields']));_0x1acc9c[_0x7fc8('0x30')]=_0x1acc9c[_0x7fc8('0x30')]['length']?_0x1acc9c[_0x7fc8('0x30')]:_0x2e23d8[_0x7fc8('0x2b')];if(_0x566491['query'][_0x7fc8('0x31')]){_0x1acc9c[_0x7fc8('0x32')]=[{'all':!![]}];}_0x1acc9c=_['merge']({},_0x1acc9c,_0x566491[_0x7fc8('0x33')]);return db[_0x7fc8('0x20')][_0x7fc8('0x34')](_0x1acc9c)[_0x7fc8('0x19')](handleEntityNotFound(_0x74bad4,null))[_0x7fc8('0x19')](respondWithResult(_0x74bad4,null))[_0x7fc8('0x35')](handleError(_0x74bad4,null));};exports['create']=function(_0x24fcf4,_0x49d672){return db[_0x7fc8('0x20')]['create'](_0x24fcf4[_0x7fc8('0x36')],{})[_0x7fc8('0x19')](respondWithResult(_0x49d672,0xc9))[_0x7fc8('0x35')](handleError(_0x49d672,null));};exports['update']=function(_0x486cea,_0x201219){if(_0x486cea[_0x7fc8('0x36')]['id']){delete _0x486cea[_0x7fc8('0x36')]['id'];}return db[_0x7fc8('0x20')][_0x7fc8('0x34')]({'where':{'id':_0x486cea[_0x7fc8('0x2a')]['id']}})['then'](handleEntityNotFound(_0x201219,null))[_0x7fc8('0x19')](saveUpdates(_0x486cea[_0x7fc8('0x36')],null))[_0x7fc8('0x19')](respondWithResult(_0x201219,null))[_0x7fc8('0x35')](handleError(_0x201219,null));};exports[_0x7fc8('0x1a')]=function(_0x7b6f69,_0x363e35){return db['OpenchannelInteraction'][_0x7fc8('0x34')]({'where':{'id':_0x7b6f69[_0x7fc8('0x2a')]['id']}})[_0x7fc8('0x19')](handleEntityNotFound(_0x363e35,null))[_0x7fc8('0x19')](removeEntity(_0x363e35,null))[_0x7fc8('0x35')](handleError(_0x363e35,null));};exports[_0x7fc8('0x37')]=function(_0x3ea269,_0x28517a){return db[_0x7fc8('0x20')]['describe']()[_0x7fc8('0x19')](respondWithResult(_0x28517a,null))[_0x7fc8('0x35')](handleError(_0x28517a,null));};exports[_0x7fc8('0x38')]=function(_0x5051ea,_0x236247){return db['OpenchannelMessage'][_0x7fc8('0x34')]({'where':{'id':_0x5051ea['params']['id']}})[_0x7fc8('0x19')](handleEntityNotFound(_0x236247,null))[_0x7fc8('0x19')](function(_0x3a0ddd){if(_0x3a0ddd){return _0x3a0ddd[_0x7fc8('0x38')](_0x5051ea[_0x7fc8('0x36')][_0x7fc8('0x39')],_[_0x7fc8('0x3a')](_0x5051ea[_0x7fc8('0x36')],[_0x7fc8('0x39'),'id'])||{});}})[_0x7fc8('0x19')](respondWithResult(_0x236247,null))[_0x7fc8('0x35')](handleError(_0x236247,null));};exports[_0x7fc8('0x3b')]=function(_0x179d0e,_0x54af65){var _0x5a0bab={'raw':![],'where':{}};var _0x2b8478={};var _0x3d9a84={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x7fc8('0x3c')]({'where':{'id':_0x179d0e[_0x7fc8('0x2a')]['id']}})['then'](handleEntityNotFound(_0x54af65,null))[_0x7fc8('0x19')](function(_0x4f280a){if(_0x4f280a){_0x2b8478[_0x7fc8('0x2b')]=_[_0x7fc8('0x2c')](db[_0x7fc8('0x3d')][_0x7fc8('0x2d')]);_0x2b8478['query']=_['keys'](_0x179d0e[_0x7fc8('0x25')]);_0x2b8478['filters']=_[_0x7fc8('0x2f')](_0x2b8478[_0x7fc8('0x2b')],_0x2b8478[_0x7fc8('0x25')]);_0x5a0bab['attributes']=_[_0x7fc8('0x2f')](_0x2b8478['model'],qs['fields'](_0x179d0e['query']['fields']));_0x5a0bab['attributes']=_0x5a0bab['attributes'][_0x7fc8('0x3e')]?_0x5a0bab[_0x7fc8('0x30')]:_0x2b8478[_0x7fc8('0x2b')];if(!_0x179d0e['query'][_0x7fc8('0x3f')](_0x7fc8('0x40'))){_0x5a0bab[_0x7fc8('0x12')]=qs[_0x7fc8('0x12')](_0x179d0e[_0x7fc8('0x25')]['limit']);_0x5a0bab[_0x7fc8('0x11')]=qs[_0x7fc8('0x11')](_0x179d0e[_0x7fc8('0x25')]['offset']);}_0x5a0bab[_0x7fc8('0x41')]=qs[_0x7fc8('0x42')](_0x179d0e[_0x7fc8('0x25')]['sort']);_0x5a0bab[_0x7fc8('0x43')]=qs[_0x7fc8('0x2e')](_[_0x7fc8('0x44')](_0x179d0e[_0x7fc8('0x25')],_0x2b8478['filters']));_0x5a0bab[_0x7fc8('0x43')][_0x7fc8('0x45')]=_0x4f280a['id'];if(_0x179d0e[_0x7fc8('0x25')][_0x7fc8('0x46')]){_0x5a0bab[_0x7fc8('0x43')]=_[_0x7fc8('0x47')](_0x5a0bab[_0x7fc8('0x43')],{'$or':_[_0x7fc8('0x1f')](_0x5a0bab['attributes'],function(_0x537ce1){var _0x3b9e48={};_0x3b9e48[_0x537ce1]={'$like':'%'+_0x179d0e[_0x7fc8('0x25')][_0x7fc8('0x46')]+'%'};return _0x3b9e48;})});}if(_0x179d0e[_0x7fc8('0x25')][_0x7fc8('0x48')]){var _0x16e22a=_0x179d0e[_0x7fc8('0x25')][_0x7fc8('0x48')][_0x7fc8('0x49')](',');var _0x4994ba={};_0x4994ba[_0x16e22a[0x0]]={'$gte':moment(_0x16e22a[0x1])[_0x7fc8('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5a0bab[_0x7fc8('0x43')]=_[_0x7fc8('0x47')](_0x5a0bab[_0x7fc8('0x43')],_0x4994ba);}_0x5a0bab=_[_0x7fc8('0x47')]({},_0x5a0bab,_0x179d0e['options']);return db[_0x7fc8('0x3d')][_0x7fc8('0x14')]({'where':_0x5a0bab[_0x7fc8('0x43')]})[_0x7fc8('0x19')](function(_0x515ac0){_0x3d9a84[_0x7fc8('0x14')]=_0x515ac0;if(_0x179d0e[_0x7fc8('0x25')]['includeAll']){_0x5a0bab['include']=[{'all':!![]}];}return db[_0x7fc8('0x3d')][_0x7fc8('0x23')](_0x5a0bab);})[_0x7fc8('0x19')](function(_0xe17f0b){_0x3d9a84[_0x7fc8('0x4b')]=_0xe17f0b;return _0x3d9a84;});}})[_0x7fc8('0x19')](respondWithFilteredResult(_0x54af65,_0x5a0bab))[_0x7fc8('0x35')](handleError(_0x54af65,null));};exports[_0x7fc8('0x4c')]=function(_0x329168,_0x5fe267){return db['OpenchannelInteraction'][_0x7fc8('0x34')]({'where':{'id':_0x329168[_0x7fc8('0x2a')]['id']}})[_0x7fc8('0x19')](handleEntityNotFound(_0x5fe267,null))[_0x7fc8('0x19')](function(_0xc9766b){if(_0xc9766b){return _0xc9766b[_0x7fc8('0x4d')](_0x329168['body'][_0x7fc8('0x39')],_[_0x7fc8('0x3a')](_0x329168[_0x7fc8('0x36')],[_0x7fc8('0x39'),'id'])||{})['spread'](function(){return db['Tag'][_0x7fc8('0x23')]({'attributes':['id','name','color'],'where':{'id':_0x329168['body'][_0x7fc8('0x39')]}});})['then'](function(_0x3fdf37){socket[_0x7fc8('0x4e')](_0x7fc8('0x4f'),{'id':Number(_0x329168[_0x7fc8('0x2a')]['id']),'tags':_0x3fdf37||[]});return{'id':Number(_0x329168[_0x7fc8('0x2a')]['id']),'tags':_0x3fdf37||[]};});}})[_0x7fc8('0x19')](respondWithResult(_0x5fe267,null))[_0x7fc8('0x35')](handleError(_0x5fe267,null));};exports[_0x7fc8('0x50')]=function(_0x4d7645,_0x1fa4d1){return db[_0x7fc8('0x20')][_0x7fc8('0x34')]({'where':{'id':_0x4d7645[_0x7fc8('0x2a')]['id']}})[_0x7fc8('0x19')](handleEntityNotFound(_0x1fa4d1,null))[_0x7fc8('0x19')](function(_0x447725){if(_0x447725){return _0x447725[_0x7fc8('0x50')](_0x4d7645[_0x7fc8('0x25')][_0x7fc8('0x39')]);}})[_0x7fc8('0x19')](respondWithStatusCode(_0x1fa4d1,null))[_0x7fc8('0x35')](handleError(_0x1fa4d1,null));};exports[_0x7fc8('0x51')]=function(_0x441abc,_0x3beee5){var _0x53d07d=moment()[_0x7fc8('0x52')]()[_0x7fc8('0x53')]();var _0x3f53e5=path['join'](config[_0x7fc8('0x54')],_0x7fc8('0x55'),_0x7fc8('0x56'),_0x7fc8('0x57'));var _0x562840=path[_0x7fc8('0x58')](config[_0x7fc8('0x54')],_0x7fc8('0x55'),'files',_0x7fc8('0x59'));var _0x49c037=path[_0x7fc8('0x58')](_0x3f53e5,_0x53d07d);var _0xc8d333=util[_0x7fc8('0x4a')]('transcript-%d-%s.zip',_0x441abc[_0x7fc8('0x2a')]['id'],_0x53d07d);var _0x3cd135=path[_0x7fc8('0x58')](_0x3f53e5,_0xc8d333);var _0x38624a=[];_0x38624a['push']({'model':db['User'],'as':'User','attributes':['id',_0x7fc8('0x5a')],'raw':!![]});_0x38624a['push']({'model':db[_0x7fc8('0x5b')],'as':_0x7fc8('0x5c'),'attributes':['id','firstName',_0x7fc8('0x5d')],'raw':!![]});if(_0x441abc[_0x7fc8('0x25')][_0x7fc8('0x59')]){_0x38624a[_0x7fc8('0x5e')]({'model':db[_0x7fc8('0x5f')],'as':_0x7fc8('0x5f'),'raw':!![]});}var _0x517c55=[{'model':db['OpenchannelMessage'],'as':_0x7fc8('0x60'),'attributes':['id','body',_0x7fc8('0x61'),'direction',_0x7fc8('0x62'),'read'],'include':_0x38624a}];_0x517c55[_0x7fc8('0x5e')]({'model':db[_0x7fc8('0x63')],'as':_0x7fc8('0x64'),'attributes':['id','name']});_0x517c55[_0x7fc8('0x5e')]({'model':db[_0x7fc8('0x65')],'as':_0x7fc8('0x66'),'attributes':['id',_0x7fc8('0x5a')]});return db['OpenchannelInteraction'][_0x7fc8('0x34')]({'where':{'id':_0x441abc[_0x7fc8('0x2a')]['id']},'include':_0x517c55})[_0x7fc8('0x19')](handleEntityNotFound(_0x3beee5,null))[_0x7fc8('0x19')](function(_0x309e88){if(_0x309e88){var _0x5e2c46=_0x309e88[_0x7fc8('0x67')]({'plain':!![]});fs[_0x7fc8('0x68')](_0x49c037);var _0x39ecd1={'channel':_0x7fc8('0x69'),'account':_0x5e2c46['Account'][_0x7fc8('0x1c')],'agent':_0x5e2c46['Owner']?_0x5e2c46[_0x7fc8('0x66')]['fullname']:_0x7fc8('0x6a'),'createdAt':moment(_0x5e2c46[_0x7fc8('0x61')])[_0x7fc8('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7fc8('0x53')](),'closedAt':_0x5e2c46[_0x7fc8('0x6b')]?moment(_0x5e2c46[_0x7fc8('0x6c')])['format'](_0x7fc8('0x6d'))['toString']():'','disposition':_0x5e2c46[_0x7fc8('0x6e')],'visibility':_0x5e2c46['threadId']?_0x7fc8('0x6f'):_0x7fc8('0x70'),'messages':_(_0x5e2c46[_0x7fc8('0x60')])[_0x7fc8('0x46')]({'secret':![]})['map'](function(_0x1507fa){if(_0x1507fa[_0x7fc8('0x5f')]){var _0xa43e7a=path[_0x7fc8('0x58')](_0x562840,_0x1507fa['Attachment'][_0x7fc8('0x71')]);if(fs['existsSync'](_0xa43e7a)){fs[_0x7fc8('0x72')](_0xa43e7a)['pipe'](fs['createWriteStream'](path[_0x7fc8('0x58')](_0x49c037,_0x1507fa[_0x7fc8('0x5f')]['basename'])));}}return{'date':moment(_0x1507fa['createdAt'])[_0x7fc8('0x4a')](_0x7fc8('0x6d'))[_0x7fc8('0x53')](),'sender':_0x1507fa[_0x7fc8('0x73')]===_0x7fc8('0x74')?_0x1507fa[_0x7fc8('0x65')]?_0x1507fa[_0x7fc8('0x65')][_0x7fc8('0x5a')]:_0x7fc8('0x75'):_0x1507fa[_0x7fc8('0x5c')]['firstName']+(_0x1507fa[_0x7fc8('0x5c')]['lastName']?'\x20'+_0x1507fa[_0x7fc8('0x5c')][_0x7fc8('0x5d')]:''),'body':_0x1507fa[_0x7fc8('0x5f')]?_0x1507fa[_0x7fc8('0x5f')][_0x7fc8('0x71')]:_0x1507fa['body'],'direction':_0x1507fa['direction']===_0x7fc8('0x74')?'A':'C','secret':_0x1507fa[_0x7fc8('0x62')],'read':_0x1507fa[_0x7fc8('0x76')],'attachment':_0x1507fa[_0x7fc8('0x5f')]};})[_0x7fc8('0x77')]()};return ejs[_0x7fc8('0x78')](path[_0x7fc8('0x58')](config[_0x7fc8('0x54')],_0x7fc8('0x55'),_0x7fc8('0x79'),_0x7fc8('0x7a')),{'interaction':_0x39ecd1})[_0x7fc8('0x19')](function(_0x201b0a){var _0x2b8bd0=path[_0x7fc8('0x58')](_0x49c037,_0x7fc8('0x7b')+_0x5e2c46['id']+'-'+_0x53d07d+_0x7fc8('0x7c'));var _0x395c12={'path':_0x2b8bd0,'channel':_0x7fc8('0x69'),'interactionId':_0x5e2c46['id']};return pdf[_0x7fc8('0x7d')](_0x201b0a,_0x395c12);})[_0x7fc8('0x19')](function(){return new Promise(function(_0x3c7f19,_0x13a684){zipdir(_0x49c037,{'saveTo':_0x3cd135},function(_0x47d828,_0xcdebac){if(_0x47d828)return _0x13a684(_0x47d828);return _0x3c7f19(_0xcdebac);});})[_0x7fc8('0x19')](function(){return new Promise(function(_0xb43bee,_0x4d58d3){rimraf(_0x49c037,function(_0x1a5ef1){if(_0x1a5ef1)_0x4d58d3(_0x1a5ef1);return _0xb43bee();});});})[_0x7fc8('0x19')](function(){return _0x3beee5[_0x7fc8('0x51')](_0x3cd135,_0xc8d333,function(_0x4fc91c){if(_0x4fc91c){logger[_0x7fc8('0x7e')](_0x7fc8('0x7f'),_0x4fc91c);}else{fs[_0x7fc8('0x80')](_0x3cd135);}});});});}else{return _0x3beee5['sendStatus'](0xc8);}})[_0x7fc8('0x35')](handleError(_0x3beee5,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index baf1a02..04b7d56 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 _0xecf1=['unreadMessages','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','then','Users','map','findAll','setDataValue'];(function(_0x20ca00,_0x2bfe9b){var _0x2c1037=function(_0x4f5993){while(--_0x4f5993){_0x20ca00['push'](_0x20ca00['shift']());}};_0x2c1037(++_0x2bfe9b);}(_0xecf1,0x174));var _0x1ecf=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xecf1[_0x4d40dd];return _0x1c51f2;};'use strict';var EventEmitter=require(_0x1ecf('0x0'));var OpenchannelInteraction=require(_0x1ecf('0x1'))['db'][_0x1ecf('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x1ecf('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1ecf('0x4')](0x0);var events={'afterCreate':_0x1ecf('0x5'),'afterUpdate':_0x1ecf('0x6'),'afterDestroy':'remove'};function emitEvent(_0x15b5f9){return function(_0x267cc8,_0x58fa41,_0x4574e2){_0x267cc8['getUsers']({'attributes':['id'],'raw':!![]})[_0x1ecf('0x7')](function(_0x129eab){_0x267cc8['setDataValue'](_0x1ecf('0x8'),_0x129eab[_0x1ecf('0x9')](function(_0x4747ce){return{'id':_0x4747ce['id']};}));return OpenchannelMessage[_0x1ecf('0xa')]({'where':{'OpenchannelInteractionId':_0x267cc8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x430212){_0x267cc8[_0x1ecf('0xb')](_0x1ecf('0xc'),_0x430212['length']);OpenchannelInteractionEvents['emit'](_0x15b5f9+':'+_0x267cc8['id'],_0x267cc8);OpenchannelInteractionEvents['emit'](_0x15b5f9,_0x267cc8);_0x4574e2(null);})[_0x1ecf('0xd')](_0x4574e2(null));};}for(var e in events){if(events[_0x1ecf('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x1ecf('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xfc44=['hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc44,0x1aa));var _0x4fc4=function(_0x399a22,_0x46261f){_0x399a22=_0x399a22-0x0;var _0x23af05=_0xfc44[_0x399a22];return _0x23af05;};'use strict';var EventEmitter=require(_0x4fc4('0x0'));var OpenchannelInteraction=require(_0x4fc4('0x1'))['db'][_0x4fc4('0x2')];var OpenchannelMessage=require(_0x4fc4('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4fc4('0x3')](0x0);var events={'afterCreate':_0x4fc4('0x4'),'afterUpdate':_0x4fc4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fc09a){return function(_0x4f1303,_0x3b5cb0,_0x48c23d){_0x4f1303[_0x4fc4('0x6')]({'attributes':['id'],'raw':!![]})[_0x4fc4('0x7')](function(_0x1c5ce1){_0x4f1303[_0x4fc4('0x8')](_0x4fc4('0x9'),_0x1c5ce1[_0x4fc4('0xa')](function(_0x3c0296){return{'id':_0x3c0296['id']};}));return OpenchannelMessage[_0x4fc4('0xb')]({'where':{'OpenchannelInteractionId':_0x4f1303['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4fc4('0x7')](function(_0x42b387){_0x4f1303['setDataValue'](_0x4fc4('0xc'),_0x42b387[_0x4fc4('0xd')]);OpenchannelInteractionEvents[_0x4fc4('0xe')](_0x4fc09a+':'+_0x4f1303['id'],_0x4f1303);OpenchannelInteractionEvents['emit'](_0x4fc09a,_0x4f1303);_0x48c23d(null);})['catch'](_0x48c23d(null));};}for(var e in events){if(events[_0x4fc4('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x4fc4('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ec9f8bb..55789d2 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 _0xc6c0=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','openchannel_interactions','utf8mb4','changed','closed','closedAt'];(function(_0x20d93a,_0x422a10){var _0x4e5cec=function(_0x56089c){while(--_0x56089c){_0x20d93a['push'](_0x20d93a['shift']());}};_0x4e5cec(++_0x422a10);}(_0xc6c0,0x142));var _0x0c6c=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xc6c0[_0x34f545];return _0x1ff6b8;};'use strict';var _=require(_0x0c6c('0x0'));var util=require(_0x0c6c('0x1'));var logger=require('../../config/logger')(_0x0c6c('0x2'));var moment=require(_0x0c6c('0x3'));var BPromise=require(_0x0c6c('0x4'));var rp=require(_0x0c6c('0x5'));var fs=require('fs');var path=require(_0x0c6c('0x6'));var rimraf=require('rimraf');var config=require(_0x0c6c('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x0c6c('0x8')]=function(_0x4ad14c,_0x9078a7){return _0x4ad14c['define']('OpenchannelInteraction',attributes,{'tableName':_0x0c6c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0c6c('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x220439,_0x38b556,_0x198ff0){if(_0x220439[_0x0c6c('0xb')](_0x0c6c('0xc'))){_0x220439[_0x0c6c('0xd')]=moment()[_0x0c6c('0xe')](_0x0c6c('0xf'));}_0x198ff0(null,_0x220439);}}});}; \ No newline at end of file +var _0x589e=['api','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0xa983c9,_0x12f0a5){var _0x54d4fa=function(_0x28be0e){while(--_0x28be0e){_0xa983c9['push'](_0xa983c9['shift']());}};_0x54d4fa(++_0x12f0a5);}(_0x589e,0x7e));var _0xe589=function(_0x57d3cf,_0x327774){_0x57d3cf=_0x57d3cf-0x0;var _0x2368ff=_0x589e[_0x57d3cf];return _0x2368ff;};'use strict';var _=require('lodash');var util=require(_0xe589('0x0'));var logger=require(_0xe589('0x1'))(_0xe589('0x2'));var moment=require('moment');var BPromise=require(_0xe589('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe589('0x4'));var config=require(_0xe589('0x5'));var attributes=require(_0xe589('0x6'));module[_0xe589('0x7')]=function(_0x4e4a9c,_0x3dee0f){return _0x4e4a9c[_0xe589('0x8')]('OpenchannelInteraction',attributes,{'tableName':_0xe589('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe589('0xa'),'collate':_0xe589('0xb'),'hooks':{'beforeUpdate':function(_0x3f1fc9,_0x16a3b2,_0x23a51b){if(_0x3f1fc9[_0xe589('0xc')]('closed')){_0x3f1fc9[_0xe589('0xd')]=moment()[_0xe589('0xe')](_0xe589('0xf'));}_0x23a51b(null,_0x3f1fc9);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4c82d9d..2b7e0fc 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 _0x3310=['result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','attributes','limit','where','addTags','body','ids','AddTags','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3310,0x7a));var _0x0331=function(_0x141f63,_0x37b790){_0x141f63=_0x141f63-0x0;var _0x2c7ebd=_0x3310[_0x141f63];return _0x2c7ebd;};'use strict';var _=require('lodash');var util=require(_0x0331('0x0'));var moment=require('moment');var BPromise=require(_0x0331('0x1'));var rs=require(_0x0331('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0331('0x3'))['db'];var utils=require(_0x0331('0x4'));var logger=require(_0x0331('0x5'))(_0x0331('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0331('0x7')]({'port':0x232a});config[_0x0331('0x8')]=_[_0x0331('0x9')](config[_0x0331('0x8')],{'host':_0x0331('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0331('0x8')]));require('./openchannelInteraction.socket')[_0x0331('0xb')](socket);function respondWithRpcPromise(_0x2c50a1,_0x30bd7f,_0x5267d8){return new BPromise(function(_0x5184ed,_0x519cb2){return client[_0x0331('0xc')](_0x2c50a1,_0x5267d8)[_0x0331('0xd')](function(_0x5f5381){logger['info'](_0x0331('0xe'),_0x30bd7f,_0x0331('0xf'));logger[_0x0331('0x10')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x30bd7f,_0x0331('0xf'),JSON[_0x0331('0x11')](_0x5f5381));if(_0x5f5381['error']){if(_0x5f5381[_0x0331('0x12')][_0x0331('0x13')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x30bd7f,_0x5f5381[_0x0331('0x12')][_0x0331('0x14')]);return _0x519cb2(_0x5f5381['error'][_0x0331('0x14')]);}logger[_0x0331('0x12')](_0x0331('0xe'),_0x30bd7f,_0x5f5381[_0x0331('0x12')]['message']);return _0x5184ed(_0x5f5381[_0x0331('0x12')]['message']);}else{logger[_0x0331('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x30bd7f,'request\x20sent');_0x5184ed(_0x5f5381[_0x0331('0x16')][_0x0331('0x14')]);}})[_0x0331('0x17')](function(_0x3d7afa){logger[_0x0331('0x12')](_0x0331('0xe'),_0x30bd7f,_0x3d7afa);_0x519cb2(_0x3d7afa);});});}exports[_0x0331('0x18')]=function(_0x56dc91){var _0x402b46=this;return new Promise(function(_0x3d6b56,_0x312489){return db[_0x0331('0x19')][_0x0331('0x1a')](_0x56dc91['body'],{'raw':_0x56dc91['options']?_0x56dc91[_0x0331('0x1b')][_0x0331('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56dc91[_0x0331('0x1b')]?_0x56dc91['options']['where']||null:null,'attributes':_0x56dc91[_0x0331('0x1b')]?_0x56dc91[_0x0331('0x1b')][_0x0331('0x1d')]||null:null,'limit':_0x56dc91[_0x0331('0x1b')]?_0x56dc91[_0x0331('0x1b')][_0x0331('0x1e')]||null:null})[_0x0331('0xd')](function(_0x14c6ea){logger[_0x0331('0x15')]('UpdateOpenchannelInteraction',_0x56dc91);logger[_0x0331('0x10')](_0x0331('0x18'),_0x56dc91,JSON[_0x0331('0x11')](_0x14c6ea));_0x3d6b56(_0x14c6ea);})[_0x0331('0x17')](function(_0x302ab5){logger['error'](_0x0331('0x18'),_0x302ab5['message'],_0x56dc91);_0x312489(_0x402b46['error'](0x1f4,_0x302ab5[_0x0331('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x53ca07){return new Promise(function(_0x2fadf1,_0xd09de2){return db[_0x0331('0x19')]['find']({'where':_0x53ca07[_0x0331('0x1b')]?_0x53ca07['options'][_0x0331('0x1f')]||null:null})[_0x0331('0xd')](function(_0x272700){if(_0x272700){return _0x272700[_0x0331('0x20')](_0x53ca07[_0x0331('0x21')][_0x0331('0x22')],_['omit'](_0x53ca07[_0x0331('0x21')],[_0x0331('0x22'),'id'])||{});}})['spread'](function(_0x464b24){logger[_0x0331('0x15')](_0x0331('0x23'),_0x53ca07);logger[_0x0331('0x10')](_0x0331('0x23'),_0x53ca07,JSON[_0x0331('0x11')](_0x464b24));_0x2fadf1(_0x464b24);})['catch'](function(_0x5af170){logger['error'](_0x0331('0x23'),_0x5af170['message'],_0x53ca07);_0xd09de2(_this[_0x0331('0x12')](0x1f4,_0x5af170[_0x0331('0x14')]));});});}; \ No newline at end of file +var _0xe2b5=['stringify','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x5582a7,_0x4c88f6){var _0x533fc5=function(_0x3cfd19){while(--_0x3cfd19){_0x5582a7['push'](_0x5582a7['shift']());}};_0x533fc5(++_0x4c88f6);}(_0xe2b5,0xed));var _0x5e2b=function(_0x531b1e,_0x301978){_0x531b1e=_0x531b1e-0x0;var _0x1208b6=_0xe2b5[_0x531b1e];return _0x1208b6;};'use strict';var _=require(_0x5e2b('0x0'));var util=require(_0x5e2b('0x1'));var moment=require(_0x5e2b('0x2'));var BPromise=require(_0x5e2b('0x3'));var rs=require(_0x5e2b('0x4'));var fs=require('fs');var Redis=require(_0x5e2b('0x5'));var db=require(_0x5e2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e2b('0x7'))(_0x5e2b('0x8'));var config=require(_0x5e2b('0x9'));var jayson=require(_0x5e2b('0xa'));var client=jayson[_0x5e2b('0xb')][_0x5e2b('0xc')]({'port':0x232a});config[_0x5e2b('0xd')]=_[_0x5e2b('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e2b('0xf'))(new Redis(config[_0x5e2b('0xd')]));require('./openchannelInteraction.socket')[_0x5e2b('0x10')](socket);function respondWithRpcPromise(_0x47f0c0,_0x225e71,_0x1ccac3){return new BPromise(function(_0x404506,_0x1953c8){return client['request'](_0x47f0c0,_0x1ccac3)['then'](function(_0x48e504){logger['info'](_0x5e2b('0x11'),_0x225e71,_0x5e2b('0x12'));logger[_0x5e2b('0x13')](_0x5e2b('0x14'),_0x225e71,'request\x20sent',JSON[_0x5e2b('0x15')](_0x48e504));if(_0x48e504[_0x5e2b('0x16')]){if(_0x48e504['error'][_0x5e2b('0x17')]===0x1f4){logger[_0x5e2b('0x16')](_0x5e2b('0x11'),_0x225e71,_0x48e504[_0x5e2b('0x16')][_0x5e2b('0x18')]);return _0x1953c8(_0x48e504[_0x5e2b('0x16')][_0x5e2b('0x18')]);}logger[_0x5e2b('0x16')](_0x5e2b('0x11'),_0x225e71,_0x48e504[_0x5e2b('0x16')]['message']);return _0x404506(_0x48e504[_0x5e2b('0x16')][_0x5e2b('0x18')]);}else{logger[_0x5e2b('0x19')](_0x5e2b('0x11'),_0x225e71,'request\x20sent');_0x404506(_0x48e504[_0x5e2b('0x1a')][_0x5e2b('0x18')]);}})[_0x5e2b('0x1b')](function(_0x4077dc){logger[_0x5e2b('0x16')](_0x5e2b('0x11'),_0x225e71,_0x4077dc);_0x1953c8(_0x4077dc);});});}exports[_0x5e2b('0x1c')]=function(_0x198e20){var _0x2bc3e1=this;return new Promise(function(_0x178eb7,_0x583532){return db[_0x5e2b('0x1d')]['update'](_0x198e20[_0x5e2b('0x1e')],{'raw':_0x198e20[_0x5e2b('0x1f')]?_0x198e20[_0x5e2b('0x1f')][_0x5e2b('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198e20[_0x5e2b('0x1f')]?_0x198e20[_0x5e2b('0x1f')][_0x5e2b('0x21')]||null:null,'attributes':_0x198e20['options']?_0x198e20['options'][_0x5e2b('0x22')]||null:null,'limit':_0x198e20['options']?_0x198e20[_0x5e2b('0x1f')][_0x5e2b('0x23')]||null:null})[_0x5e2b('0x24')](function(_0x2a5e22){logger[_0x5e2b('0x19')](_0x5e2b('0x1c'),_0x198e20);logger[_0x5e2b('0x13')](_0x5e2b('0x1c'),_0x198e20,JSON[_0x5e2b('0x15')](_0x2a5e22));_0x178eb7(_0x2a5e22);})[_0x5e2b('0x1b')](function(_0x27b037){logger[_0x5e2b('0x16')](_0x5e2b('0x1c'),_0x27b037[_0x5e2b('0x18')],_0x198e20);_0x583532(_0x2bc3e1[_0x5e2b('0x16')](0x1f4,_0x27b037['message']));});});};exports[_0x5e2b('0x25')]=function(_0x1f7d39){return new Promise(function(_0x1fc443,_0xe43359){return db[_0x5e2b('0x1d')][_0x5e2b('0x26')]({'where':_0x1f7d39[_0x5e2b('0x1f')]?_0x1f7d39[_0x5e2b('0x1f')][_0x5e2b('0x21')]||null:null})[_0x5e2b('0x24')](function(_0x4741ba){if(_0x4741ba){return _0x4741ba[_0x5e2b('0x27')](_0x1f7d39['body']['ids'],_[_0x5e2b('0x28')](_0x1f7d39[_0x5e2b('0x1e')],['ids','id'])||{});}})[_0x5e2b('0x29')](function(_0x473d8d){logger[_0x5e2b('0x19')](_0x5e2b('0x2a'),_0x1f7d39);logger[_0x5e2b('0x13')](_0x5e2b('0x2a'),_0x1f7d39,JSON[_0x5e2b('0x15')](_0x473d8d));_0x1fc443(_0x473d8d);})[_0x5e2b('0x1b')](function(_0x120b63){logger[_0x5e2b('0x16')](_0x5e2b('0x2a'),_0x120b63['message'],_0x1f7d39);_0xe43359(_this['error'](0x1f4,_0x120b63['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5cd0f77..137cedf 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 _0x2b84=['length','./openchannelInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x55d434,_0x1709cb){var _0x8bdba9=function(_0x244d6a){while(--_0x244d6a){_0x55d434['push'](_0x55d434['shift']());}};_0x8bdba9(++_0x1709cb);}(_0x2b84,0x151));var _0x42b8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2b84[_0x5ddb1c];return _0x354adc;};'use strict';var OpenchannelInteractionEvents=require(_0x42b8('0x0'));var events=[_0x42b8('0x1'),_0x42b8('0x2'),_0x42b8('0x3')];function createListener(_0x18ca9c,_0x159d48){return function(_0x23b51f){_0x159d48[_0x42b8('0x4')](_0x18ca9c,_0x23b51f);};}function removeListener(_0x2ad510,_0x41e319){return function(){OpenchannelInteractionEvents[_0x42b8('0x5')](_0x2ad510,_0x41e319);};}exports[_0x42b8('0x6')]=function(_0x335ece){for(var _0x32cbe1=0x0,_0x3fc2b6=events[_0x42b8('0x7')];_0x32cbe1<_0x3fc2b6;_0x32cbe1++){var _0x1f565e=events[_0x32cbe1];var _0x28f523=createListener('openchannelInteraction:'+_0x1f565e,_0x335ece);OpenchannelInteractionEvents['on'](_0x1f565e,_0x28f523);}}; \ No newline at end of file +var _0x457b=['length','openchannelInteraction:','./openchannelInteraction.events','update','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x457b,0x1e2));var _0xb457=function(_0x1233d2,_0x5efbb1){_0x1233d2=_0x1233d2-0x0;var _0x44af31=_0x457b[_0x1233d2];return _0x44af31;};'use strict';var OpenchannelInteractionEvents=require(_0xb457('0x0'));var events=['save','remove',_0xb457('0x1')];function createListener(_0x5b1074,_0x5b94df){return function(_0x4427bb){_0x5b94df['emit'](_0x5b1074,_0x4427bb);};}function removeListener(_0x2c579c,_0x430893){return function(){OpenchannelInteractionEvents[_0xb457('0x2')](_0x2c579c,_0x430893);};}exports[_0xb457('0x3')]=function(_0x411f5a){for(var _0x41571d=0x0,_0x40c6ac=events[_0xb457('0x4')];_0x41571d<_0x40c6ac;_0x41571d++){var _0x9f504f=events[_0x41571d];var _0x1626fd=createListener(_0xb457('0x5')+_0x9f504f,_0x411f5a);OpenchannelInteractionEvents['on'](_0x9f504f,_0x1626fd);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a3766f8..0e9b056 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x1fa007,_0x5d3503){var _0x24a0c2=function(_0x261ea0){while(--_0x261ea0){_0x1fa007['push'](_0x1fa007['shift']());}};_0x24a0c2(++_0x5d3503);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x2bdad4,_0x374f36){var _0x52397a=function(_0x47f186){while(--_0x47f186){_0x2bdad4['push'](_0x2bdad4['shift']());}};_0x52397a(++_0x374f36);}(_0xe706,0xa3));var _0x6e70=function(_0x3cab38,_0x439e61){_0x3cab38=_0x3cab38-0x0;var _0x187d60=_0xe706[_0x3cab38];return _0x187d60;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index f3d0018..9cd0aaa 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 _0xe493=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xe493,0x7e));var _0x3e49=function(_0x3e2b4b,_0x55e2c1){_0x3e2b4b=_0x3e2b4b-0x0;var _0x4c3813=_0xe493[_0x3e2b4b];return _0x4c3813;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'body':{'type':Sequelize[_0x3e49('0x2')](_0x3e49('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3e49('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e49('0x5')]('in',_0x3e49('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3e49('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3e49('0x2')]}}; \ No newline at end of file +var _0xbc9d=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x40b66c,_0x578758){var _0x2fd22b=function(_0x3b721b){while(--_0x3b721b){_0x40b66c['push'](_0x40b66c['shift']());}};_0x2fd22b(++_0x578758);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x2c180d,_0x4501f0){_0x2c180d=_0x2c180d-0x0;var _0x51fe51=_0xbc9d[_0x2c180d];return _0x51fe51;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'body':{'type':Sequelize[_0xdbc9('0x2')](_0xdbc9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdbc9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbc9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdbc9('0x6')]},'providerName':{'type':Sequelize[_0xdbc9('0x7')]},'providerResponse':{'type':Sequelize[_0xdbc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e9f2709..932a7e8 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 _0x3bf5=['fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','client','http','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','count','include','findAll','rows','show','params','keys','length','includeAll','find','create','body','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','accept','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','event','eml-format','rimraf'];(function(_0x206816,_0x39799d){var _0x303418=function(_0x4dacce){while(--_0x4dacce){_0x206816['push'](_0x206816['shift']());}};_0x303418(++_0x39799d);}(_0x3bf5,0x17e));var _0x53bf=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x3bf5[_0x46428c];return _0x16a677;};'use strict';var emlformat=require(_0x53bf('0x0'));var rimraf=require(_0x53bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53bf('0x2'));var rp=require(_0x53bf('0x3'));var moment=require('moment');var BPromise=require(_0x53bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x53bf('0x5'));var sox=require(_0x53bf('0x6'));var csv=require(_0x53bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53bf('0x8'));var squel=require(_0x53bf('0x9'));var crypto=require(_0x53bf('0xa'));var jsforce=require(_0x53bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x53bf('0x7'));var querystring=require(_0x53bf('0xc'));var Papa=require(_0x53bf('0xd'));var Redis=require('ioredis');var authService=require(_0x53bf('0xe'));var qs=require(_0x53bf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53bf('0x10'));var logger=require(_0x53bf('0x11'))(_0x53bf('0x12'));var utils=require(_0x53bf('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x53bf('0x14'));var db=require('../../mysqldb')['db'];config[_0x53bf('0x15')]=_[_0x53bf('0x16')](config[_0x53bf('0x15')],{'host':_0x53bf('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53bf('0x15')]));require(_0x53bf('0x18'))[_0x53bf('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x53bf('0x1a')][_0x53bf('0x1b')]({'port':0x232c});var client9002=jayson[_0x53bf('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dd62,_0x5b7fbe,_0x2804b1,_0x46c7a5){return new BPromise(function(_0x1c7787,_0x2fc977){var _0x382570=_0x46c7a5||client;return _0x382570['request'](_0x19dd62,_0x2804b1)['then'](function(_0x383bfd){logger[_0x53bf('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x5b7fbe,_0x53bf('0x1d'));logger[_0x53bf('0x1e')](_0x53bf('0x1f'),_0x5b7fbe,'request\x20sent',JSON['stringify'](_0x383bfd));if(_0x383bfd[_0x53bf('0x20')]){if(_0x383bfd[_0x53bf('0x20')][_0x53bf('0x21')]===0x1f4){logger[_0x53bf('0x20')](_0x53bf('0x22'),_0x5b7fbe,_0x383bfd[_0x53bf('0x20')]['message']);return _0x2fc977(_0x383bfd[_0x53bf('0x20')][_0x53bf('0x23')]);}logger['error'](_0x53bf('0x22'),_0x5b7fbe,_0x383bfd['error'][_0x53bf('0x23')]);return _0x1c7787(_0x383bfd[_0x53bf('0x20')][_0x53bf('0x23')]);}else{logger[_0x53bf('0x1c')](_0x53bf('0x22'),_0x5b7fbe,_0x53bf('0x1d'));_0x1c7787(_0x383bfd[_0x53bf('0x24')][_0x53bf('0x23')]);}})[_0x53bf('0x25')](function(_0x23807d){logger[_0x53bf('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x5b7fbe,_0x23807d);_0x2fc977(_0x23807d);});});}function respondWithStatusCode(_0x380451,_0x20b5ed){_0x20b5ed=_0x20b5ed||0xcc;return function(_0x58005c){if(_0x58005c){return _0x380451[_0x53bf('0x26')](_0x20b5ed);}return _0x380451[_0x53bf('0x27')](_0x20b5ed)['end']();};}function respondWithResult(_0x35eccb,_0x2b5a6e){_0x2b5a6e=_0x2b5a6e||0xc8;return function(_0x428ec1){if(_0x428ec1){return _0x35eccb[_0x53bf('0x27')](_0x2b5a6e)['json'](_0x428ec1);}};}function respondWithFilteredResult(_0x2b643e,_0xf18bd5){return function(_0x53de98){if(_0x53de98){var _0x46555b=typeof _0xf18bd5[_0x53bf('0x28')]===_0x53bf('0x29')&&typeof _0xf18bd5[_0x53bf('0x2a')]===_0x53bf('0x29');var _0x44d9dd=_0x53de98['count'];var _0x10c41f=_0x46555b?0x0:_0xf18bd5[_0x53bf('0x28')];var _0x111ce0=_0x46555b?_0x53de98['count']:_0xf18bd5[_0x53bf('0x28')]+_0xf18bd5['limit'];var _0x583830;if(_0x111ce0>=_0x44d9dd){_0x111ce0=_0x44d9dd;_0x583830=0xc8;}else{_0x583830=0xce;}_0x2b643e[_0x53bf('0x27')](_0x583830);return _0x2b643e[_0x53bf('0x2b')](_0x53bf('0x2c'),_0x10c41f+'-'+_0x111ce0+'/'+_0x44d9dd)[_0x53bf('0x2d')](_0x53de98);}return null;};}function patchUpdates(_0x308eb1){return function(_0x5f61d7){try{jsonpatch['apply'](_0x5f61d7,_0x308eb1,!![]);}catch(_0x268809){return BPromise[_0x53bf('0x2e')](_0x268809);}return _0x5f61d7[_0x53bf('0x2f')]();};}function saveUpdates(_0x4b9bfc,_0x1fbcac){return function(_0x415777){if(_0x415777){return _0x415777[_0x53bf('0x30')](_0x4b9bfc)[_0x53bf('0x31')](function(_0x51746f){return _0x51746f;});}return null;};}function removeEntity(_0x39a2a0,_0xd0f0f8){return function(_0x4017c4){if(_0x4017c4){return _0x4017c4[_0x53bf('0x32')]()[_0x53bf('0x31')](function(){_0x39a2a0[_0x53bf('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4109ad,_0xcb2dd5){return function(_0x140893){if(!_0x140893){_0x4109ad[_0x53bf('0x26')](0x194);}return _0x140893;};}function handleError(_0x1d40fa,_0x580e01){_0x580e01=_0x580e01||0x1f4;return function(_0xbd1b95){logger['error'](_0xbd1b95[_0x53bf('0x33')]);if(_0xbd1b95['name']){delete _0xbd1b95[_0x53bf('0x34')];}_0x1d40fa['status'](_0x580e01)[_0x53bf('0x35')](_0xbd1b95);};}exports[_0x53bf('0x36')]=function(_0x1971a2,_0x487d2b){var _0x378c64={},_0x2675a8={},_0x51f551={'count':0x0,'rows':[]};var _0x33ca38=_[_0x53bf('0x37')](db[_0x53bf('0x38')][_0x53bf('0x39')],function(_0x30887a){return{'name':_0x30887a[_0x53bf('0x3a')],'type':_0x30887a[_0x53bf('0x3b')][_0x53bf('0x3c')]};});_0x2675a8['model']=_[_0x53bf('0x37')](_0x33ca38,_0x53bf('0x34'));_0x2675a8[_0x53bf('0x3d')]=_['keys'](_0x1971a2['query']);_0x2675a8[_0x53bf('0x3e')]=_[_0x53bf('0x3f')](_0x2675a8[_0x53bf('0x40')],_0x2675a8[_0x53bf('0x3d')]);_0x378c64[_0x53bf('0x41')]=_['intersection'](_0x2675a8[_0x53bf('0x40')],qs[_0x53bf('0x42')](_0x1971a2[_0x53bf('0x3d')][_0x53bf('0x42')]));_0x378c64[_0x53bf('0x41')]=_0x378c64['attributes']['length']?_0x378c64[_0x53bf('0x41')]:_0x2675a8[_0x53bf('0x40')];if(!_0x1971a2['query'][_0x53bf('0x43')]('nolimit')){_0x378c64['limit']=qs['limit'](_0x1971a2[_0x53bf('0x3d')][_0x53bf('0x2a')]);_0x378c64['offset']=qs[_0x53bf('0x28')](_0x1971a2['query']['offset']);}_0x378c64[_0x53bf('0x44')]=qs[_0x53bf('0x45')](_0x1971a2[_0x53bf('0x3d')]['sort']);_0x378c64[_0x53bf('0x46')]=qs['filters'](_['pick'](_0x1971a2[_0x53bf('0x3d')],_0x2675a8['filters']),_0x33ca38);if(_0x1971a2[_0x53bf('0x3d')][_0x53bf('0x47')]){_0x378c64[_0x53bf('0x46')]=_[_0x53bf('0x48')](_0x378c64[_0x53bf('0x46')],{'$or':_[_0x53bf('0x37')](_0x33ca38,function(_0x4f1495){if(_0x4f1495['type']!=='VIRTUAL'){var _0x27deb1={};_0x27deb1[_0x4f1495['name']]={'$like':'%'+_0x1971a2[_0x53bf('0x3d')][_0x53bf('0x47')]+'%'};return _0x27deb1;}})});}_0x378c64=_['merge']({},_0x378c64,_0x1971a2[_0x53bf('0x49')]);var _0xb9fea8={'where':_0x378c64['where']};return db[_0x53bf('0x38')]['count'](_0xb9fea8)[_0x53bf('0x31')](function(_0x4bb5ee){_0x51f551[_0x53bf('0x4a')]=_0x4bb5ee;if(_0x1971a2[_0x53bf('0x3d')]['includeAll']){_0x378c64[_0x53bf('0x4b')]=[{'all':!![]}];}return db[_0x53bf('0x38')][_0x53bf('0x4c')](_0x378c64);})[_0x53bf('0x31')](function(_0x39f22b){_0x51f551[_0x53bf('0x4d')]=_0x39f22b;return _0x51f551;})[_0x53bf('0x31')](respondWithFilteredResult(_0x487d2b,_0x378c64))[_0x53bf('0x25')](handleError(_0x487d2b,null));};exports[_0x53bf('0x4e')]=function(_0x2ef765,_0x38c9f8){var _0x570d03={'raw':!![],'where':{'id':_0x2ef765[_0x53bf('0x4f')]['id']}},_0x401382={};_0x401382['model']=_[_0x53bf('0x50')](db[_0x53bf('0x38')][_0x53bf('0x39')]);_0x401382['query']=_[_0x53bf('0x50')](_0x2ef765[_0x53bf('0x3d')]);_0x401382[_0x53bf('0x3e')]=_[_0x53bf('0x3f')](_0x401382[_0x53bf('0x40')],_0x401382[_0x53bf('0x3d')]);_0x570d03[_0x53bf('0x41')]=_[_0x53bf('0x3f')](_0x401382['model'],qs['fields'](_0x2ef765[_0x53bf('0x3d')][_0x53bf('0x42')]));_0x570d03[_0x53bf('0x41')]=_0x570d03[_0x53bf('0x41')][_0x53bf('0x51')]?_0x570d03[_0x53bf('0x41')]:_0x401382['model'];if(_0x2ef765[_0x53bf('0x3d')][_0x53bf('0x52')]){_0x570d03['include']=[{'all':!![]}];}_0x570d03=_[_0x53bf('0x48')]({},_0x570d03,_0x2ef765['options']);return db[_0x53bf('0x38')][_0x53bf('0x53')](_0x570d03)[_0x53bf('0x31')](handleEntityNotFound(_0x38c9f8,null))[_0x53bf('0x31')](respondWithResult(_0x38c9f8,null))[_0x53bf('0x25')](handleError(_0x38c9f8,null));};exports[_0x53bf('0x54')]=function(_0x36b36e,_0xc75d72){return db[_0x53bf('0x38')][_0x53bf('0x54')](_0x36b36e['body'],{})[_0x53bf('0x31')](respondWithResult(_0xc75d72,0xc9))[_0x53bf('0x25')](handleError(_0xc75d72,null));};exports[_0x53bf('0x30')]=function(_0x450a08,_0x34957c){if(_0x450a08[_0x53bf('0x55')]['id']){delete _0x450a08['body']['id'];}return db['OpenchannelMessage'][_0x53bf('0x53')]({'where':{'id':_0x450a08[_0x53bf('0x4f')]['id']}})[_0x53bf('0x31')](handleEntityNotFound(_0x34957c,null))[_0x53bf('0x31')](saveUpdates(_0x450a08[_0x53bf('0x55')],null))[_0x53bf('0x31')](respondWithResult(_0x34957c,null))['catch'](handleError(_0x34957c,null));};exports[_0x53bf('0x32')]=function(_0x1ee1d5,_0x1e003e){return db[_0x53bf('0x38')][_0x53bf('0x53')]({'where':{'id':_0x1ee1d5[_0x53bf('0x4f')]['id']}})[_0x53bf('0x31')](handleEntityNotFound(_0x1e003e,null))['then'](removeEntity(_0x1e003e,null))['catch'](handleError(_0x1e003e,null));};exports[_0x53bf('0x56')]=function(_0x1ff5ef,_0x162502){return db[_0x53bf('0x38')]['describe']()[_0x53bf('0x31')](respondWithResult(_0x162502,null))[_0x53bf('0x25')](handleError(_0x162502,null));};var interaction_log=require(_0x53bf('0x11'))(_0x53bf('0x57'));exports['accept']=function(_0x542ddb,_0x57be5e,_0x50aafc){var _0x7bb73={'agent':{},'channel':_0x53bf('0x58')};if(_0x542ddb[_0x53bf('0x55')]['id']){delete _0x542ddb[_0x53bf('0x55')]['id'];}_0x542ddb[_0x53bf('0x55')]['read']=!![];_0x542ddb[_0x53bf('0x55')][_0x53bf('0x59')]=moment()[_0x53bf('0x5a')](_0x53bf('0x5b'));_0x542ddb[_0x53bf('0x55')][_0x53bf('0x5c')]=_0x542ddb[_0x53bf('0x55')][_0x53bf('0x5c')]||_0x542ddb[_0x53bf('0x5d')]['id'];_0x7bb73[_0x53bf('0x5e')]['id']=_0x542ddb[_0x53bf('0x55')][_0x53bf('0x5c')];return db[_0x53bf('0x38')][_0x53bf('0x53')]({'where':{'id':_0x542ddb[_0x53bf('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x57be5e,null))[_0x53bf('0x31')](saveUpdates(_0x542ddb['body'],null))[_0x53bf('0x31')](function(_0x4be4de){if(_0x4be4de){_0x7bb73[_0x53bf('0x23')]=_0x4be4de[_0x53bf('0x5f')]({'plain':!![]});return db[_0x53bf('0x60')][_0x53bf('0x53')]({'where':{'id':_0x4be4de['OpenchannelInteractionId']}});}return null;})[_0x53bf('0x31')](handleEntityNotFound(_0x57be5e,null))[_0x53bf('0x31')](function(_0x30e192){if(_0x30e192){return _0x30e192[_0x53bf('0x30')]({'UserId':_0x542ddb[_0x53bf('0x55')]['UserId'],'read1stAt':_[_0x53bf('0x61')](_0x30e192[_0x53bf('0x62')])?moment()[_0x53bf('0x5a')](_0x53bf('0x5b')):undefined});}return null;})[_0x53bf('0x31')](function(_0xbdc28e){if(_0xbdc28e){_0x7bb73['interaction']=_0xbdc28e['get']({'plain':!![]});interaction_log[_0x53bf('0x1c')](_0x53bf('0x63'),_0x542ddb[_0x53bf('0x5d')]['id'],_0x542ddb[_0x53bf('0x5d')][_0x53bf('0x34')],_0x542ddb[_0x53bf('0x5d')]['role'],_0x7bb73[_0x53bf('0x64')]['id'],_0x542ddb[_0x53bf('0x55')]?JSON[_0x53bf('0x65')](_0x542ddb[_0x53bf('0x55')]):_0x53bf('0x66'));return respondWithRpcPromise('AcceptMessage',_0x53bf('0x67'),_0x7bb73);}return null;})[_0x53bf('0x31')](function(_0xd246ec){var _0x106249=_0x53bf('0x68')+_0xd246ec['message'][_0x53bf('0x69')];return db['sequelize'][_0x53bf('0x3d')](_0x106249,{'type':db['Sequelize'][_0x53bf('0x6a')][_0x53bf('0x6b')],'raw':!![]})['then'](function(_0x25b228){return _0x25b228;});})[_0x53bf('0x31')](function(_0x561e55){if(_0x561e55){_0x7bb73[_0x53bf('0x23')][_0x53bf('0x6c')]=_0x561e55[0x0];if(!_0x542ddb[_0x53bf('0x55')][_0x53bf('0x5c')])return;return db[_0x53bf('0x6d')][_0x53bf('0x53')]({'where':{'id':_0x542ddb['body'][_0x53bf('0x5c')],'role':_0x53bf('0x5e')},'attributes':['id',_0x53bf('0x34'),_0x53bf('0x6e'),_0x53bf('0x6f'),_0x53bf('0x70')],'raw':!![]});}return null;})['then'](function(_0x2cb640){if(!_0x2cb640)return null;_0x7bb73[_0x53bf('0x23')][_0x53bf('0x5e')]=_0x2cb640;return _0x7bb73;})['then'](function(_0x5b19b2){if(_0x5b19b2){if(_0x542ddb[_0x53bf('0x55')][_0x53bf('0x71')]){_0x7bb73[_0x53bf('0x23')][_0x53bf('0x72')]=util['format'](_0x53bf('0x73'),_0x542ddb[_0x53bf('0x5d')][_0x53bf('0x34')]);_0x7bb73['message']['channel']=_0x7bb73['channel'];_0x7bb73[_0x53bf('0x23')][_0x53bf('0x74')]=_0x7bb73[_0x53bf('0x75')];_0x7bb73['message']['event']=_0x53bf('0x76');return respondWithRpcPromise(_0x53bf('0x77'),_0x53bf('0x77'),{'event':_0x53bf('0x78'),'message':_0x7bb73[_0x53bf('0x23')]},client9002)['then'](function(){return _0x7bb73;});}return _0x7bb73;}return null;})[_0x53bf('0x31')](respondWithResult(_0x57be5e,null))[_0x53bf('0x25')](handleError(_0x57be5e,null));};var interaction_log=require(_0x53bf('0x11'))(_0x53bf('0x57'));exports['reject']=function(_0x572d31,_0x32f3fc,_0x1d746d){var _0x52616b={'agent':{},'channel':_0x53bf('0x58')};if(_0x572d31[_0x53bf('0x55')]['id']){delete _0x572d31[_0x53bf('0x55')]['id'];}_0x572d31[_0x53bf('0x55')][_0x53bf('0x5c')]=_0x572d31[_0x53bf('0x55')][_0x53bf('0x5c')]||_0x572d31[_0x53bf('0x5d')]['id'];_0x52616b['agent']['id']=_0x572d31['body'][_0x53bf('0x5c')];return db[_0x53bf('0x38')][_0x53bf('0x53')]({'where':{'id':_0x572d31['params']['id'],'UserId':null}})[_0x53bf('0x31')](handleEntityNotFound(_0x32f3fc,null))[_0x53bf('0x31')](function(_0x365a67){if(_0x365a67){_0x52616b['message']=_0x365a67[_0x53bf('0x5f')]({'plain':!![]});return db[_0x53bf('0x60')][_0x53bf('0x53')]({'where':{'id':_0x365a67[_0x53bf('0x79')]}});}return null;})[_0x53bf('0x31')](handleEntityNotFound(_0x32f3fc,null))['then'](function(_0xbb6f14){if(_0xbb6f14){_0x52616b[_0x53bf('0x64')]=_0xbb6f14[_0x53bf('0x5f')]({'plain':!![]});interaction_log['info'](_0x53bf('0x7a'),_0x572d31[_0x53bf('0x5d')]['id'],_0x572d31[_0x53bf('0x5d')][_0x53bf('0x34')],_0x572d31[_0x53bf('0x5d')][_0x53bf('0x7b')],_0x52616b[_0x53bf('0x64')]['id'],_0x572d31['body']?JSON[_0x53bf('0x65')](_0x572d31[_0x53bf('0x55')]):_0x53bf('0x66'));return respondWithRpcPromise(_0x53bf('0x7c'),_0x53bf('0x7d'),_0x52616b);}return null;})[_0x53bf('0x31')](function(_0x59256e){var _0x2ff7e7=_0x53bf('0x68')+_0x59256e[_0x53bf('0x23')]['ContactId'];return db[_0x53bf('0x7e')][_0x53bf('0x3d')](_0x2ff7e7,{'type':db['Sequelize'][_0x53bf('0x6a')][_0x53bf('0x6b')],'raw':!![]})[_0x53bf('0x31')](function(_0x11cd40){return _0x11cd40;});})['then'](function(_0x4f8c0a){if(_0x4f8c0a){_0x52616b['message'][_0x53bf('0x6c')]=_0x4f8c0a[0x0];if(!_0x572d31['body'][_0x53bf('0x5c')])return;return db[_0x53bf('0x6d')][_0x53bf('0x53')]({'where':{'id':_0x572d31[_0x53bf('0x55')][_0x53bf('0x5c')],'role':_0x53bf('0x5e')},'attributes':['id',_0x53bf('0x34'),_0x53bf('0x6e'),_0x53bf('0x6f'),_0x53bf('0x70')],'raw':!![]});}return null;})[_0x53bf('0x31')](function(_0x1a74d8){if(!_0x1a74d8)return null;_0x52616b[_0x53bf('0x23')][_0x53bf('0x5e')]=_0x1a74d8;return _0x52616b;})[_0x53bf('0x31')](function(_0x6a788a){if(_0x6a788a){_0x6a788a['message'][_0x53bf('0x72')]=util[_0x53bf('0x5a')](_0x53bf('0x73'),_0x572d31[_0x53bf('0x5d')][_0x53bf('0x34')]);_0x6a788a[_0x53bf('0x23')][_0x53bf('0x75')]=_0x52616b[_0x53bf('0x75')];_0x6a788a[_0x53bf('0x23')][_0x53bf('0x74')]=_0x52616b[_0x53bf('0x75')];_0x6a788a[_0x53bf('0x23')][_0x53bf('0x7f')]='reject';respondWithRpcPromise(_0x53bf('0x77'),_0x53bf('0x77'),{'event':'rejectmessage','message':_0x6a788a[_0x53bf('0x23')]},client9002);return _0x52616b;}return null;})[_0x53bf('0x31')](respondWithResult(_0x32f3fc,null))[_0x53bf('0x25')](handleError(_0x32f3fc,null));}; \ No newline at end of file +var _0x70e2=['manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','email','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','request','then','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','update','describe','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname'];(function(_0x4312cf,_0x2ef01b){var _0x2d88fd=function(_0x46a207){while(--_0x46a207){_0x4312cf['push'](_0x4312cf['shift']());}};_0x2d88fd(++_0x2ef01b);}(_0x70e2,0x119));var _0x270e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x70e2[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x270e('0x0'));var rimraf=require(_0x270e('0x1'));var zipdir=require(_0x270e('0x2'));var jsonpatch=require(_0x270e('0x3'));var rp=require(_0x270e('0x4'));var moment=require(_0x270e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x270e('0x6'));var util=require(_0x270e('0x7'));var path=require(_0x270e('0x8'));var sox=require(_0x270e('0x9'));var csv=require(_0x270e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x270e('0xb'));var _=require(_0x270e('0xc'));var squel=require(_0x270e('0xd'));var crypto=require(_0x270e('0xe'));var jsforce=require(_0x270e('0xf'));var deskjs=require(_0x270e('0x10'));var toCsv=require(_0x270e('0xa'));var querystring=require(_0x270e('0x11'));var Papa=require(_0x270e('0x12'));var Redis=require(_0x270e('0x13'));var authService=require(_0x270e('0x14'));var qs=require(_0x270e('0x15'));var as=require(_0x270e('0x16'));var hardwareService=require(_0x270e('0x17'));var logger=require(_0x270e('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x270e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x270e('0x1a'))['db'];config[_0x270e('0x1b')]=_['defaults'](config[_0x270e('0x1b')],{'host':_0x270e('0x1c'),'port':0x18eb});var socket=require(_0x270e('0x1d'))(new Redis(config['redis']));require(_0x270e('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x270e('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x270e('0x1f')][_0x270e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x49fbca,_0x3ccd08,_0x4ab29b,_0x34a7e1){return new BPromise(function(_0x2ffde3,_0x6d87da){var _0x4479cc=_0x34a7e1||client;return _0x4479cc[_0x270e('0x21')](_0x49fbca,_0x4ab29b)[_0x270e('0x22')](function(_0x691bde){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3ccd08,_0x270e('0x23'));logger[_0x270e('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3ccd08,'request\x20sent',JSON[_0x270e('0x25')](_0x691bde));if(_0x691bde['error']){if(_0x691bde[_0x270e('0x26')][_0x270e('0x27')]===0x1f4){logger[_0x270e('0x26')](_0x270e('0x28'),_0x3ccd08,_0x691bde[_0x270e('0x26')][_0x270e('0x29')]);return _0x6d87da(_0x691bde[_0x270e('0x26')][_0x270e('0x29')]);}logger[_0x270e('0x26')](_0x270e('0x28'),_0x3ccd08,_0x691bde['error']['message']);return _0x2ffde3(_0x691bde[_0x270e('0x26')][_0x270e('0x29')]);}else{logger[_0x270e('0x2a')](_0x270e('0x28'),_0x3ccd08,_0x270e('0x23'));_0x2ffde3(_0x691bde[_0x270e('0x2b')][_0x270e('0x29')]);}})['catch'](function(_0x2747aa){logger['error'](_0x270e('0x28'),_0x3ccd08,_0x2747aa);_0x6d87da(_0x2747aa);});});}function respondWithStatusCode(_0x510912,_0x37fc56){_0x37fc56=_0x37fc56||0xcc;return function(_0x238c7a){if(_0x238c7a){return _0x510912[_0x270e('0x2c')](_0x37fc56);}return _0x510912[_0x270e('0x2d')](_0x37fc56)['end']();};}function respondWithResult(_0x3197bd,_0x113c55){_0x113c55=_0x113c55||0xc8;return function(_0x483919){if(_0x483919){return _0x3197bd[_0x270e('0x2d')](_0x113c55)[_0x270e('0x2e')](_0x483919);}};}function respondWithFilteredResult(_0x3ae22b,_0x28ed3e){return function(_0x4b716b){if(_0x4b716b){var _0x40dfbf=typeof _0x28ed3e[_0x270e('0x2f')]===_0x270e('0x30')&&typeof _0x28ed3e[_0x270e('0x31')]==='undefined';var _0x3bb9e7=_0x4b716b[_0x270e('0x32')];var _0x545352=_0x40dfbf?0x0:_0x28ed3e[_0x270e('0x2f')];var _0x2ec720=_0x40dfbf?_0x4b716b[_0x270e('0x32')]:_0x28ed3e[_0x270e('0x2f')]+_0x28ed3e['limit'];var _0x1e565c;if(_0x2ec720>=_0x3bb9e7){_0x2ec720=_0x3bb9e7;_0x1e565c=0xc8;}else{_0x1e565c=0xce;}_0x3ae22b['status'](_0x1e565c);return _0x3ae22b[_0x270e('0x33')]('Content-Range',_0x545352+'-'+_0x2ec720+'/'+_0x3bb9e7)[_0x270e('0x2e')](_0x4b716b);}return null;};}function patchUpdates(_0x3b0bf7){return function(_0x5cc52d){try{jsonpatch[_0x270e('0x34')](_0x5cc52d,_0x3b0bf7,!![]);}catch(_0x5b5a72){return BPromise[_0x270e('0x35')](_0x5b5a72);}return _0x5cc52d[_0x270e('0x36')]();};}function saveUpdates(_0x503db9,_0x5092e9){return function(_0x9695dc){if(_0x9695dc){return _0x9695dc['update'](_0x503db9)[_0x270e('0x22')](function(_0x2cb096){return _0x2cb096;});}return null;};}function removeEntity(_0x21c104,_0x2c4e28){return function(_0x36f8b5){if(_0x36f8b5){return _0x36f8b5[_0x270e('0x37')]()[_0x270e('0x22')](function(){_0x21c104[_0x270e('0x2d')](0xcc)[_0x270e('0x38')]();});}};}function handleEntityNotFound(_0x3fc6a5,_0x58ab7b){return function(_0x29476c){if(!_0x29476c){_0x3fc6a5[_0x270e('0x2c')](0x194);}return _0x29476c;};}function handleError(_0x1064be,_0x410b45){_0x410b45=_0x410b45||0x1f4;return function(_0x480773){logger[_0x270e('0x26')](_0x480773[_0x270e('0x39')]);if(_0x480773[_0x270e('0x3a')]){delete _0x480773['name'];}_0x1064be[_0x270e('0x2d')](_0x410b45)[_0x270e('0x3b')](_0x480773);};}exports['index']=function(_0x48189e,_0x1c6271){var _0x466eb1={},_0x5b0cd={},_0x432200={'count':0x0,'rows':[]};var _0x46771e=_[_0x270e('0x3c')](db[_0x270e('0x3d')][_0x270e('0x3e')],function(_0x5f2b1a){return{'name':_0x5f2b1a[_0x270e('0x3f')],'type':_0x5f2b1a[_0x270e('0x40')][_0x270e('0x41')]};});_0x5b0cd['model']=_[_0x270e('0x3c')](_0x46771e,_0x270e('0x3a'));_0x5b0cd['query']=_[_0x270e('0x42')](_0x48189e['query']);_0x5b0cd[_0x270e('0x43')]=_[_0x270e('0x44')](_0x5b0cd[_0x270e('0x45')],_0x5b0cd[_0x270e('0x46')]);_0x466eb1[_0x270e('0x47')]=_['intersection'](_0x5b0cd[_0x270e('0x45')],qs[_0x270e('0x48')](_0x48189e[_0x270e('0x46')][_0x270e('0x48')]));_0x466eb1[_0x270e('0x47')]=_0x466eb1[_0x270e('0x47')][_0x270e('0x49')]?_0x466eb1[_0x270e('0x47')]:_0x5b0cd[_0x270e('0x45')];if(!_0x48189e[_0x270e('0x46')][_0x270e('0x4a')]('nolimit')){_0x466eb1[_0x270e('0x31')]=qs[_0x270e('0x31')](_0x48189e[_0x270e('0x46')][_0x270e('0x31')]);_0x466eb1[_0x270e('0x2f')]=qs[_0x270e('0x2f')](_0x48189e[_0x270e('0x46')][_0x270e('0x2f')]);}_0x466eb1[_0x270e('0x4b')]=qs[_0x270e('0x4c')](_0x48189e['query'][_0x270e('0x4c')]);_0x466eb1[_0x270e('0x4d')]=qs[_0x270e('0x43')](_[_0x270e('0x4e')](_0x48189e[_0x270e('0x46')],_0x5b0cd[_0x270e('0x43')]),_0x46771e);if(_0x48189e['query'][_0x270e('0x4f')]){_0x466eb1[_0x270e('0x4d')]=_[_0x270e('0x50')](_0x466eb1[_0x270e('0x4d')],{'$or':_[_0x270e('0x3c')](_0x46771e,function(_0xa003dd){if(_0xa003dd['type']!=='VIRTUAL'){var _0xd488e={};_0xd488e[_0xa003dd['name']]={'$like':'%'+_0x48189e[_0x270e('0x46')][_0x270e('0x4f')]+'%'};return _0xd488e;}})});}_0x466eb1=_[_0x270e('0x50')]({},_0x466eb1,_0x48189e[_0x270e('0x51')]);var _0x1532df={'where':_0x466eb1[_0x270e('0x4d')]};return db[_0x270e('0x3d')][_0x270e('0x32')](_0x1532df)[_0x270e('0x22')](function(_0x81eff2){_0x432200[_0x270e('0x32')]=_0x81eff2;if(_0x48189e['query'][_0x270e('0x52')]){_0x466eb1[_0x270e('0x53')]=[{'all':!![]}];}return db[_0x270e('0x3d')][_0x270e('0x54')](_0x466eb1);})['then'](function(_0x392bfb){_0x432200['rows']=_0x392bfb;return _0x432200;})[_0x270e('0x22')](respondWithFilteredResult(_0x1c6271,_0x466eb1))[_0x270e('0x55')](handleError(_0x1c6271,null));};exports['show']=function(_0x4e9534,_0x4a4e96){var _0x34ed66={'raw':!![],'where':{'id':_0x4e9534[_0x270e('0x56')]['id']}},_0x156f8d={};_0x156f8d[_0x270e('0x45')]=_[_0x270e('0x42')](db[_0x270e('0x3d')][_0x270e('0x3e')]);_0x156f8d[_0x270e('0x46')]=_['keys'](_0x4e9534[_0x270e('0x46')]);_0x156f8d[_0x270e('0x43')]=_[_0x270e('0x44')](_0x156f8d[_0x270e('0x45')],_0x156f8d[_0x270e('0x46')]);_0x34ed66[_0x270e('0x47')]=_[_0x270e('0x44')](_0x156f8d[_0x270e('0x45')],qs[_0x270e('0x48')](_0x4e9534[_0x270e('0x46')][_0x270e('0x48')]));_0x34ed66['attributes']=_0x34ed66[_0x270e('0x47')][_0x270e('0x49')]?_0x34ed66[_0x270e('0x47')]:_0x156f8d['model'];if(_0x4e9534[_0x270e('0x46')][_0x270e('0x52')]){_0x34ed66['include']=[{'all':!![]}];}_0x34ed66=_[_0x270e('0x50')]({},_0x34ed66,_0x4e9534['options']);return db['OpenchannelMessage'][_0x270e('0x57')](_0x34ed66)[_0x270e('0x22')](handleEntityNotFound(_0x4a4e96,null))[_0x270e('0x22')](respondWithResult(_0x4a4e96,null))[_0x270e('0x55')](handleError(_0x4a4e96,null));};exports['create']=function(_0x5de83e,_0x7aa676){return db[_0x270e('0x3d')][_0x270e('0x58')](_0x5de83e[_0x270e('0x59')],{})[_0x270e('0x22')](respondWithResult(_0x7aa676,0xc9))[_0x270e('0x55')](handleError(_0x7aa676,null));};exports[_0x270e('0x5a')]=function(_0x42a15e,_0x1de1e8){if(_0x42a15e[_0x270e('0x59')]['id']){delete _0x42a15e['body']['id'];}return db['OpenchannelMessage'][_0x270e('0x57')]({'where':{'id':_0x42a15e[_0x270e('0x56')]['id']}})[_0x270e('0x22')](handleEntityNotFound(_0x1de1e8,null))[_0x270e('0x22')](saveUpdates(_0x42a15e[_0x270e('0x59')],null))[_0x270e('0x22')](respondWithResult(_0x1de1e8,null))[_0x270e('0x55')](handleError(_0x1de1e8,null));};exports[_0x270e('0x37')]=function(_0x12cd7b,_0xb22964){return db[_0x270e('0x3d')][_0x270e('0x57')]({'where':{'id':_0x12cd7b[_0x270e('0x56')]['id']}})['then'](handleEntityNotFound(_0xb22964,null))[_0x270e('0x22')](removeEntity(_0xb22964,null))[_0x270e('0x55')](handleError(_0xb22964,null));};exports[_0x270e('0x5b')]=function(_0x29369c,_0x50bf7f){return db['OpenchannelMessage'][_0x270e('0x5b')]()[_0x270e('0x22')](respondWithResult(_0x50bf7f,null))[_0x270e('0x55')](handleError(_0x50bf7f,null));};var interaction_log=require(_0x270e('0x18'))('openchannel-interactions');exports[_0x270e('0x5c')]=function(_0x399f91,_0x5862e6,_0xc78e0b){var _0xb4c406={'agent':{},'channel':_0x270e('0x5d')};if(_0x399f91['body']['id']){delete _0x399f91[_0x270e('0x59')]['id'];}_0x399f91[_0x270e('0x59')][_0x270e('0x5e')]=!![];_0x399f91['body'][_0x270e('0x5f')]=moment()['format'](_0x270e('0x60'));_0x399f91['body'][_0x270e('0x61')]=_0x399f91[_0x270e('0x59')][_0x270e('0x61')]||_0x399f91[_0x270e('0x62')]['id'];_0xb4c406[_0x270e('0x63')]['id']=_0x399f91[_0x270e('0x59')][_0x270e('0x61')];return db['OpenchannelMessage'][_0x270e('0x57')]({'where':{'id':_0x399f91['params']['id'],'UserId':null}})[_0x270e('0x22')](handleEntityNotFound(_0x5862e6,null))[_0x270e('0x22')](saveUpdates(_0x399f91[_0x270e('0x59')],null))[_0x270e('0x22')](function(_0x890779){if(_0x890779){_0xb4c406[_0x270e('0x29')]=_0x890779[_0x270e('0x64')]({'plain':!![]});return db[_0x270e('0x65')][_0x270e('0x57')]({'where':{'id':_0x890779[_0x270e('0x66')]}});}return null;})[_0x270e('0x22')](handleEntityNotFound(_0x5862e6,null))[_0x270e('0x22')](function(_0x3b3955){if(_0x3b3955){return _0x3b3955[_0x270e('0x5a')]({'UserId':_0x399f91[_0x270e('0x59')][_0x270e('0x61')],'read1stAt':_['isNil'](_0x3b3955[_0x270e('0x67')])?moment()[_0x270e('0x68')](_0x270e('0x60')):undefined});}return null;})[_0x270e('0x22')](function(_0x2d464c){if(_0x2d464c){_0xb4c406[_0x270e('0x69')]=_0x2d464c[_0x270e('0x64')]({'plain':!![]});interaction_log[_0x270e('0x2a')](_0x270e('0x6a'),_0x399f91[_0x270e('0x62')]['id'],_0x399f91[_0x270e('0x62')][_0x270e('0x3a')],_0x399f91[_0x270e('0x62')][_0x270e('0x6b')],_0xb4c406['interaction']['id'],_0x399f91['body']?JSON[_0x270e('0x25')](_0x399f91['body']):_0x270e('0x6c'));return respondWithRpcPromise(_0x270e('0x6d'),_0x270e('0x6e'),_0xb4c406);}return null;})[_0x270e('0x22')](function(_0x35fc73){var _0x535ef1=_0x270e('0x6f')+_0x35fc73['message']['ContactId'];return db[_0x270e('0x70')][_0x270e('0x46')](_0x535ef1,{'type':db[_0x270e('0x71')][_0x270e('0x72')][_0x270e('0x73')],'raw':!![]})[_0x270e('0x22')](function(_0x5a0cde){return _0x5a0cde;});})[_0x270e('0x22')](function(_0x2f451c){if(_0x2f451c){_0xb4c406[_0x270e('0x29')][_0x270e('0x74')]=_0x2f451c[0x0];if(!_0x399f91['body'][_0x270e('0x61')])return;return db['User'][_0x270e('0x57')]({'where':{'id':_0x399f91['body'][_0x270e('0x61')],'role':'agent'},'attributes':['id',_0x270e('0x3a'),_0x270e('0x75'),'email','internal'],'raw':!![]});}return null;})[_0x270e('0x22')](function(_0x23001d){if(!_0x23001d)return null;_0xb4c406['message'][_0x270e('0x63')]=_0x23001d;return _0xb4c406;})[_0x270e('0x22')](function(_0x151cf9){if(_0x151cf9){if(_0x399f91[_0x270e('0x59')][_0x270e('0x76')]){_0xb4c406[_0x270e('0x29')][_0x270e('0x77')]=util['format'](_0x270e('0x78'),_0x399f91[_0x270e('0x62')][_0x270e('0x3a')]);_0xb4c406[_0x270e('0x29')][_0x270e('0x79')]=_0xb4c406[_0x270e('0x79')];_0xb4c406[_0x270e('0x29')][_0x270e('0x7a')]=_0xb4c406[_0x270e('0x79')];_0xb4c406[_0x270e('0x29')][_0x270e('0x7b')]='accept';return respondWithRpcPromise('EventManager',_0x270e('0x7c'),{'event':_0x270e('0x7d'),'message':_0xb4c406['message']},client9002)['then'](function(){return _0xb4c406;});}return _0xb4c406;}return null;})[_0x270e('0x22')](respondWithResult(_0x5862e6,null))[_0x270e('0x55')](handleError(_0x5862e6,null));};var interaction_log=require('../../config/logger')(_0x270e('0x7e'));exports[_0x270e('0x35')]=function(_0x3cd782,_0x5a9f8b,_0x581068){var _0x2403ef={'agent':{},'channel':_0x270e('0x5d')};if(_0x3cd782[_0x270e('0x59')]['id']){delete _0x3cd782[_0x270e('0x59')]['id'];}_0x3cd782[_0x270e('0x59')][_0x270e('0x61')]=_0x3cd782[_0x270e('0x59')][_0x270e('0x61')]||_0x3cd782[_0x270e('0x62')]['id'];_0x2403ef[_0x270e('0x63')]['id']=_0x3cd782[_0x270e('0x59')][_0x270e('0x61')];return db['OpenchannelMessage'][_0x270e('0x57')]({'where':{'id':_0x3cd782[_0x270e('0x56')]['id'],'UserId':null}})[_0x270e('0x22')](handleEntityNotFound(_0x5a9f8b,null))[_0x270e('0x22')](function(_0x308650){if(_0x308650){_0x2403ef[_0x270e('0x29')]=_0x308650[_0x270e('0x64')]({'plain':!![]});return db[_0x270e('0x65')][_0x270e('0x57')]({'where':{'id':_0x308650[_0x270e('0x66')]}});}return null;})[_0x270e('0x22')](handleEntityNotFound(_0x5a9f8b,null))[_0x270e('0x22')](function(_0x125171){if(_0x125171){_0x2403ef[_0x270e('0x69')]=_0x125171[_0x270e('0x64')]({'plain':!![]});interaction_log['info'](_0x270e('0x7f'),_0x3cd782['user']['id'],_0x3cd782[_0x270e('0x62')][_0x270e('0x3a')],_0x3cd782['user'][_0x270e('0x6b')],_0x2403ef[_0x270e('0x69')]['id'],_0x3cd782[_0x270e('0x59')]?JSON[_0x270e('0x25')](_0x3cd782[_0x270e('0x59')]):_0x270e('0x6c'));return respondWithRpcPromise('RejectMessage',_0x270e('0x80'),_0x2403ef);}return null;})['then'](function(_0x289e9e){var _0x16306a=_0x270e('0x6f')+_0x289e9e[_0x270e('0x29')][_0x270e('0x81')];return db[_0x270e('0x70')][_0x270e('0x46')](_0x16306a,{'type':db['Sequelize'][_0x270e('0x72')][_0x270e('0x73')],'raw':!![]})['then'](function(_0x202d7){return _0x202d7;});})[_0x270e('0x22')](function(_0x3090e2){if(_0x3090e2){_0x2403ef[_0x270e('0x29')][_0x270e('0x74')]=_0x3090e2[0x0];if(!_0x3cd782[_0x270e('0x59')]['UserId'])return;return db['User'][_0x270e('0x57')]({'where':{'id':_0x3cd782[_0x270e('0x59')][_0x270e('0x61')],'role':_0x270e('0x63')},'attributes':['id','name',_0x270e('0x75'),_0x270e('0x82'),_0x270e('0x83')],'raw':!![]});}return null;})[_0x270e('0x22')](function(_0x5918e3){if(!_0x5918e3)return null;_0x2403ef[_0x270e('0x29')][_0x270e('0x63')]=_0x5918e3;return _0x2403ef;})[_0x270e('0x22')](function(_0x2ab800){if(_0x2ab800){_0x2ab800[_0x270e('0x29')][_0x270e('0x77')]=util['format'](_0x270e('0x78'),_0x3cd782[_0x270e('0x62')][_0x270e('0x3a')]);_0x2ab800[_0x270e('0x29')][_0x270e('0x79')]=_0x2403ef[_0x270e('0x79')];_0x2ab800[_0x270e('0x29')][_0x270e('0x7a')]=_0x2403ef[_0x270e('0x79')];_0x2ab800['message'][_0x270e('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x270e('0x7c'),{'event':_0x270e('0x84'),'message':_0x2ab800['message']},client9002);return _0x2403ef;}return null;})[_0x270e('0x22')](respondWithResult(_0x5a9f8b,null))[_0x270e('0x55')](handleError(_0x5a9f8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index df90d42..af0e655 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 _0xbe41=['emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x593ee6,_0xded7e1){var _0x546d47=function(_0x3ce2f5){while(--_0x3ce2f5){_0x593ee6['push'](_0x593ee6['shift']());}};_0x546d47(++_0xded7e1);}(_0xbe41,0x199));var _0x1be4=function(_0x31aeb7,_0xec1fda){_0x31aeb7=_0x31aeb7-0x0;var _0x7cc086=_0xbe41[_0x31aeb7];return _0x7cc086;};'use strict';var EventEmitter=require(_0x1be4('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x1be4('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1be4('0x2')](0x0);var events={'afterCreate':_0x1be4('0x3'),'afterUpdate':_0x1be4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a1c1c){return function(_0x597f66,_0x53b70b,_0x3e7dde){OpenchannelMessageEvents[_0x1be4('0x5')](_0x2a1c1c+':'+_0x597f66['id'],_0x597f66);OpenchannelMessageEvents[_0x1be4('0x5')](_0x2a1c1c,_0x597f66);_0x3e7dde(null);};}for(var e in events){if(events[_0x1be4('0x6')](e)){var event=events[e];OpenchannelMessage[_0x1be4('0x7')](e,emitEvent(event));}}module[_0x1be4('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9547=['OpenchannelMessage','setMaxListeners','save','remove','emit','exports','events'];(function(_0x1ff2d0,_0x24399b){var _0x591a17=function(_0x2f85d7){while(--_0x2f85d7){_0x1ff2d0['push'](_0x1ff2d0['shift']());}};_0x591a17(++_0x24399b);}(_0x9547,0x19c));var _0x7954=function(_0x23ab1e,_0x52a364){_0x23ab1e=_0x23ab1e-0x0;var _0x486ee7=_0x9547[_0x23ab1e];return _0x486ee7;};'use strict';var EventEmitter=require(_0x7954('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x7954('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7954('0x2')](0x0);var events={'afterCreate':_0x7954('0x3'),'afterUpdate':'update','afterDestroy':_0x7954('0x4')};function emitEvent(_0x500960){return function(_0x1d10a4,_0xbc9014,_0x3c1330){OpenchannelMessageEvents[_0x7954('0x5')](_0x500960+':'+_0x1d10a4['id'],_0x1d10a4);OpenchannelMessageEvents[_0x7954('0x5')](_0x500960,_0x1d10a4);_0x3c1330(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x7954('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a57fd60..d1a8671 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 _0x5708=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','toLowerCase','catch','error','out','CmContact','OpenchannelAccount','find','keys','then','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','Contact','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2e030a,_0x8e4c48){var _0x597df6=function(_0x3da9ce){while(--_0x3da9ce){_0x2e030a['push'](_0x2e030a['shift']());}};_0x597df6(++_0x8e4c48);}(_0x5708,0x6b));var _0x8570=function(_0x28c6cf,_0x32cee2){_0x28c6cf=_0x28c6cf-0x0;var _0x5e090e=_0x5708[_0x28c6cf];return _0x5e090e;};'use strict';var _=require(_0x8570('0x0'));var util=require(_0x8570('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8570('0x2'));var BPromise=require(_0x8570('0x3'));var rp=require(_0x8570('0x4'));var fs=require('fs');var path=require(_0x8570('0x5'));var rimraf=require(_0x8570('0x6'));var config=require(_0x8570('0x7'));var attributes=require(_0x8570('0x8'));module['exports']=function(_0x5d3471,_0x22f06a){return _0x5d3471[_0x8570('0x9')](_0x8570('0xa'),attributes,{'tableName':_0x8570('0xb'),'paranoid':![],'indexes':[{'name':_0x8570('0xc'),'fields':[_0x8570('0xd')],'type':_0x8570('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a624f,_0x24d483,_0x14d2ff){var _0x25dec6=_0x5d3471[_0x8570('0xf')];var _0x5121de=_0x3a624f[_0x8570('0x10')]({'plain':!![]});if(_0x5121de[_0x8570('0x11')]['toLowerCase']()==='in'||_0x5121de[_0x8570('0x11')]['toLowerCase']()==='out'&&!_0x5121de[_0x8570('0x12')]&&!_[_0x8570('0x13')](_0x5121de[_0x8570('0x14')])){_0x25dec6[_0x8570('0x15')][_0x8570('0x16')]({'where':{'id':_0x5121de[_0x8570('0x17')]}})['then'](function(_0x102182){if(_0x102182){_0x102182[_0x8570('0x18')]({'lastMsgAt':_0x5121de[_0x8570('0x19')],'lastMsgDirection':_0x5121de[_0x8570('0x11')][_0x8570('0x1a')]()});}})[_0x8570('0x1b')](function(_0x294673){console[_0x8570('0x1c')](_0x294673);});}if(_0x5121de[_0x8570('0x11')]===_0x8570('0x1d')&&!_0x5121de['secret']){var _0x4d6fb1;_0x25dec6[_0x8570('0x1e')]['describe']()['then'](function(_0x46c3da){return _0x25dec6[_0x8570('0x1f')][_0x8570('0x20')]({'where':{'id':_0x5121de['OpenchannelAccountId']},'include':[{'model':_0x25dec6[_0x8570('0x15')],'as':'Interactions','where':{'id':_0x5121de['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x25dec6['CmContact'],'as':'Contact','attributes':_[_0x8570('0x21')](_0x46c3da)}]}]});})[_0x8570('0x22')](function(_0x5df4cc){_0x4d6fb1=_0x5df4cc[_0x8570('0x10')]({'plain':!![]});if(_0x4d6fb1&&_0x4d6fb1['replyUri']){logger['info'](_0x8570('0x23'),_0x8570('0x24'),util[_0x8570('0x25')](_0x8570('0x26'),_0x5121de['id'],_0x4d6fb1[_0x8570('0x27')]));if(_0x4d6fb1['Interactions']&&_0x4d6fb1[_0x8570('0x28')][_0x8570('0x29')]){_0x5121de[_0x8570('0x2a')]=_[_0x8570('0x2b')](_0x4d6fb1['Interactions'][0x0],_0x8570('0x2c'));_0x5121de[_0x8570('0x2c')]=_0x4d6fb1[_0x8570('0x28')][0x0][_0x8570('0x2c')];}var _0x24d483={'method':_0x8570('0x2d'),'uri':encodeURI(_0x4d6fb1[_0x8570('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x24d483[_0x8570('0x2e')]){case _0x8570('0x2f'):_0x24d483['qs']=_0x5121de;break;case _0x8570('0x2d'):_0x24d483[_0x8570('0xd')]=_0x5121de;break;}return rp(_0x24d483)[_0x8570('0x22')](function(_0x5be647){logger[_0x8570('0x30')](_0x8570('0x23'),'afterCreate',util[_0x8570('0x25')](_0x8570('0x31'),_0x5121de['id'],_0x4d6fb1[_0x8570('0x27')]));if(_0x5be647[_0x8570('0xd')][_0x8570('0x32')]&&_0x5be647[_0x8570('0xd')][_0x8570('0x32')]!=_0x5121de[_0x8570('0x2a')][_0x8570('0x32')]){return _0x25dec6[_0x8570('0x15')][_0x8570('0x18')]({'threadId':_0x5be647[_0x8570('0xd')][_0x8570('0x32')]},{'where':{'id':_0x5121de[_0x8570('0x2a')]['id']}});}else{return;}})[_0x8570('0x22')](function(){return _0x3a624f[_0x8570('0x18')]({'read':!![]});})[_0x8570('0x1b')](function(_0x466280){logger[_0x8570('0x1c')](_0x8570('0x23'),_0x8570('0x24'),util[_0x8570('0x33')](_0x466280,{'showHidden':![],'depth':null}));_0x14d2ff();});}else{_0x14d2ff();}})['finally'](function(){_0x14d2ff();});}else{_0x14d2ff();}}},'charset':_0x8570('0x34'),'collate':_0x8570('0x35')});}; \ No newline at end of file +var _0x7584=['length','omit','POST','method','body','threadId','OpenchannelInteraction','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','models','get','toLowerCase','direction','out','isNil','findOne','OpenchannelInteractionId','then','update','catch','error','secret','CmContact','describe','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s'];(function(_0x3b4369,_0x33b3d5){var _0xe9f642=function(_0x57c20a){while(--_0x57c20a){_0x3b4369['push'](_0x3b4369['shift']());}};_0xe9f642(++_0x33b3d5);}(_0x7584,0x12c));var _0x4758=function(_0x337724,_0x27924e){_0x337724=_0x337724-0x0;var _0x1a9e88=_0x7584[_0x337724];return _0x1a9e88;};'use strict';var _=require(_0x4758('0x0'));var util=require(_0x4758('0x1'));var logger=require(_0x4758('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4758('0x3'));var rp=require(_0x4758('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4758('0x5'));module[_0x4758('0x6')]=function(_0x5ec537,_0xb7e5ba){return _0x5ec537[_0x4758('0x7')]('OpenchannelMessage',attributes,{'tableName':_0x4758('0x8'),'paranoid':![],'indexes':[{'name':_0x4758('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29843f,_0x2aa003,_0x258194){var _0x218761=_0x5ec537[_0x4758('0xa')];var _0x23919a=_0x29843f[_0x4758('0xb')]({'plain':!![]});if(_0x23919a['direction'][_0x4758('0xc')]()==='in'||_0x23919a[_0x4758('0xd')][_0x4758('0xc')]()===_0x4758('0xe')&&!_0x23919a['secret']&&!_[_0x4758('0xf')](_0x23919a['UserId'])){_0x218761['OpenchannelInteraction'][_0x4758('0x10')]({'where':{'id':_0x23919a[_0x4758('0x11')]}})[_0x4758('0x12')](function(_0x5ef197){if(_0x5ef197){_0x5ef197[_0x4758('0x13')]({'lastMsgAt':_0x23919a['createdAt'],'lastMsgDirection':_0x23919a[_0x4758('0xd')][_0x4758('0xc')]()});}})[_0x4758('0x14')](function(_0x2b355b){console[_0x4758('0x15')](_0x2b355b);});}if(_0x23919a[_0x4758('0xd')]===_0x4758('0xe')&&!_0x23919a[_0x4758('0x16')]){var _0x5415fc;_0x218761[_0x4758('0x17')][_0x4758('0x18')]()[_0x4758('0x12')](function(_0x5ca7d3){return _0x218761['OpenchannelAccount'][_0x4758('0x19')]({'where':{'id':_0x23919a[_0x4758('0x1a')]},'include':[{'model':_0x218761['OpenchannelInteraction'],'as':_0x4758('0x1b'),'where':{'id':_0x23919a[_0x4758('0x11')]},'limit':0x1,'include':[{'model':_0x218761['CmContact'],'as':_0x4758('0x1c'),'attributes':_[_0x4758('0x1d')](_0x5ca7d3)}]}]});})[_0x4758('0x12')](function(_0x154955){_0x5415fc=_0x154955['get']({'plain':!![]});if(_0x5415fc&&_0x5415fc[_0x4758('0x1e')]){logger[_0x4758('0x1f')](_0x4758('0x20'),_0x4758('0x21'),util[_0x4758('0x22')](_0x4758('0x23'),_0x23919a['id'],_0x5415fc[_0x4758('0x1e')]));if(_0x5415fc[_0x4758('0x1b')]&&_0x5415fc[_0x4758('0x1b')][_0x4758('0x24')]){_0x23919a['Interaction']=_[_0x4758('0x25')](_0x5415fc['Interactions'][0x0],_0x4758('0x1c'));_0x23919a[_0x4758('0x1c')]=_0x5415fc[_0x4758('0x1b')][0x0][_0x4758('0x1c')];}var _0x2aa003={'method':_0x4758('0x26'),'uri':encodeURI(_0x5415fc['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aa003[_0x4758('0x27')]){case'GET':_0x2aa003['qs']=_0x23919a;break;case'POST':_0x2aa003[_0x4758('0x28')]=_0x23919a;break;}return rp(_0x2aa003)['then'](function(_0x5327bf){logger[_0x4758('0x1f')](_0x4758('0x20'),_0x4758('0x21'),util[_0x4758('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x23919a['id'],_0x5415fc[_0x4758('0x1e')]));if(_0x5327bf['body'][_0x4758('0x29')]&&_0x5327bf[_0x4758('0x28')]['threadId']!=_0x23919a['Interaction'][_0x4758('0x29')]){return _0x218761[_0x4758('0x2a')][_0x4758('0x13')]({'threadId':_0x5327bf[_0x4758('0x28')][_0x4758('0x29')]},{'where':{'id':_0x23919a[_0x4758('0x2b')]['id']}});}else{return;}})[_0x4758('0x12')](function(){return _0x29843f[_0x4758('0x13')]({'read':!![]});})[_0x4758('0x14')](function(_0x57303c){logger[_0x4758('0x15')](_0x4758('0x20'),_0x4758('0x21'),util[_0x4758('0x2c')](_0x57303c,{'showHidden':![],'depth':null}));_0x258194();});}else{_0x258194();}})[_0x4758('0x2d')](function(){_0x258194();});}else{_0x258194();}}},'charset':_0x4758('0x2e'),'collate':_0x4758('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6209130..88e3809 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(_0x2aca9a,_0x478d6d){var _0x586274=function(_0x4016df){while(--_0x4016df){_0x2aca9a['push'](_0x2aca9a['shift']());}};_0x586274(++_0x478d6d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x34c26b,_0x5e279b){var _0x2f9f58=function(_0x273abe){while(--_0x273abe){_0x34c26b['push'](_0x34c26b['shift']());}};_0x2f9f58(++_0x5e279b);}(_0xdb28,0x106));var _0x8db2=function(_0x47da76,_0x1fc80e){_0x47da76=_0x47da76-0x0;var _0x131b82=_0xdb28[_0x47da76];return _0x131b82;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a9861fb..110e3a8 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 _0xdded=['register','length','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x38937e,_0x2553b8){var _0x5e109e=function(_0x33d2fe){while(--_0x33d2fe){_0x38937e['push'](_0x38937e['shift']());}};_0x5e109e(++_0x2553b8);}(_0xdded,0x17a));var _0xddde=function(_0x44744b,_0x4e3398){_0x44744b=_0x44744b-0x0;var _0x5075de=_0xdded[_0x44744b];return _0x5075de;};'use strict';var OpenchannelMessageEvents=require(_0xddde('0x0'));var events=[_0xddde('0x1'),_0xddde('0x2'),_0xddde('0x3')];function createListener(_0x3f2b75,_0x9b8506){return function(_0x5cc90a){_0x9b8506[_0xddde('0x4')](_0x3f2b75,_0x5cc90a);};}function removeListener(_0x276cc6,_0x44468e){return function(){OpenchannelMessageEvents[_0xddde('0x5')](_0x276cc6,_0x44468e);};}exports[_0xddde('0x6')]=function(_0x39fd85){for(var _0x3c3021=0x0,_0x3cea18=events[_0xddde('0x7')];_0x3c3021<_0x3cea18;_0x3c3021++){var _0x18d8b8=events[_0x3c3021];var _0x3a5e8a=createListener('openchannelMessage:'+_0x18d8b8,_0x39fd85);OpenchannelMessageEvents['on'](_0x18d8b8,_0x3a5e8a);}}; \ No newline at end of file +var _0x5e1e=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','update','emit'];(function(_0x701847,_0xba95a2){var _0x58c8f2=function(_0x37dafa){while(--_0x37dafa){_0x701847['push'](_0x701847['shift']());}};_0x58c8f2(++_0xba95a2);}(_0x5e1e,0xe4));var _0xe5e1=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x5e1e[_0x47e7cb];return _0x2a8874;};'use strict';var OpenchannelMessageEvents=require(_0xe5e1('0x0'));var events=['save','remove',_0xe5e1('0x1')];function createListener(_0x4d6f52,_0xb30aa8){return function(_0x32ceeb){_0xb30aa8[_0xe5e1('0x2')](_0x4d6f52,_0x32ceeb);};}function removeListener(_0x176ea4,_0x2cd81d){return function(){OpenchannelMessageEvents[_0xe5e1('0x3')](_0x176ea4,_0x2cd81d);};}exports[_0xe5e1('0x4')]=function(_0x12b807){for(var _0x53bea9=0x0,_0x18d438=events[_0xe5e1('0x5')];_0x53bea9<_0x18d438;_0x53bea9++){var _0x585a31=events[_0x53bea9];var _0x221ea4=createListener(_0xe5e1('0x6')+_0x585a31,_0x12b807);OpenchannelMessageEvents['on'](_0x585a31,_0x221ea4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f638314..8d370c8 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 _0x8fe1=['create','post','addTeams','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8fe1,0x195));var _0x18fe=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x8fe1[_0x4017b0];return _0x5ed4f7;};'use strict';var multer=require(_0x18fe('0x0'));var util=require(_0x18fe('0x1'));var path=require(_0x18fe('0x2'));var timeout=require(_0x18fe('0x3'));var express=require(_0x18fe('0x4'));var router=express[_0x18fe('0x5')]();var fs_extra=require(_0x18fe('0x6'));var auth=require(_0x18fe('0x7'));var interaction=require(_0x18fe('0x8'));var config=require(_0x18fe('0x9'));var controller=require(_0x18fe('0xa'));router[_0x18fe('0xb')]('/',auth[_0x18fe('0xc')](),controller[_0x18fe('0xd')]);router[_0x18fe('0xb')](_0x18fe('0xe'),auth[_0x18fe('0xc')](),controller[_0x18fe('0xf')]);router[_0x18fe('0xb')](_0x18fe('0x10'),auth[_0x18fe('0xc')](),controller[_0x18fe('0x11')]);router[_0x18fe('0xb')](_0x18fe('0x12'),auth[_0x18fe('0xc')](),controller[_0x18fe('0x13')]);router[_0x18fe('0xb')](_0x18fe('0x14'),auth[_0x18fe('0xc')](),controller[_0x18fe('0x15')]);router[_0x18fe('0xb')](_0x18fe('0x16'),auth[_0x18fe('0xc')](),controller[_0x18fe('0x17')]);router['post']('/',auth[_0x18fe('0xc')](),controller[_0x18fe('0x18')]);router[_0x18fe('0x19')](_0x18fe('0x14'),auth['isAuthenticated'](),controller[_0x18fe('0x1a')]);router['post'](_0x18fe('0x16'),auth[_0x18fe('0xc')](),controller['addAgents']);router[_0x18fe('0x1b')](_0x18fe('0x10'),auth[_0x18fe('0xc')](),controller[_0x18fe('0x1c')]);router[_0x18fe('0x1d')](_0x18fe('0x10'),auth[_0x18fe('0xc')](),controller['destroy']);router[_0x18fe('0x1d')]('/:id/teams',auth[_0x18fe('0xc')](),controller[_0x18fe('0x1e')]);router[_0x18fe('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x18fe('0x1f')]);module[_0x18fe('0x20')]=router; \ No newline at end of file +var _0x61b2=['show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe'];(function(_0x916e5b,_0x1b6634){var _0x2126f1=function(_0x492372){while(--_0x492372){_0x916e5b['push'](_0x916e5b['shift']());}};_0x2126f1(++_0x1b6634);}(_0x61b2,0x1b5));var _0x261b=function(_0x2ef32f,_0x51fda1){_0x2ef32f=_0x2ef32f-0x0;var _0x55ac81=_0x61b2[_0x2ef32f];return _0x55ac81;};'use strict';var multer=require(_0x261b('0x0'));var util=require(_0x261b('0x1'));var path=require(_0x261b('0x2'));var timeout=require(_0x261b('0x3'));var express=require('express');var router=express[_0x261b('0x4')]();var fs_extra=require(_0x261b('0x5'));var auth=require(_0x261b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x261b('0x7')]('/',auth[_0x261b('0x8')](),controller[_0x261b('0x9')]);router[_0x261b('0x7')](_0x261b('0xa'),auth[_0x261b('0x8')](),controller['describe']);router[_0x261b('0x7')]('/:id',auth[_0x261b('0x8')](),controller[_0x261b('0xb')]);router[_0x261b('0x7')]('/:id/members',auth[_0x261b('0x8')](),controller['getMembers']);router['get'](_0x261b('0xc'),auth[_0x261b('0x8')](),controller[_0x261b('0xd')]);router['get'](_0x261b('0xe'),auth['isAuthenticated'](),controller[_0x261b('0xf')]);router[_0x261b('0x10')]('/',auth[_0x261b('0x8')](),controller[_0x261b('0x11')]);router['post'](_0x261b('0xc'),auth['isAuthenticated'](),controller[_0x261b('0x12')]);router[_0x261b('0x10')]('/:id/users',auth[_0x261b('0x8')](),controller[_0x261b('0x13')]);router[_0x261b('0x14')](_0x261b('0x15'),auth[_0x261b('0x8')](),controller[_0x261b('0x16')]);router[_0x261b('0x17')]('/:id',auth[_0x261b('0x8')](),controller[_0x261b('0x18')]);router[_0x261b('0x17')](_0x261b('0xc'),auth[_0x261b('0x8')](),controller[_0x261b('0x19')]);router[_0x261b('0x17')](_0x261b('0xe'),auth[_0x261b('0x8')](),controller[_0x261b('0x1a')]);module[_0x261b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 7263904..a57e354 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 _0x64f9=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x1deab3,_0x1fc9ef){var _0x604d7b=function(_0x5bb575){while(--_0x5bb575){_0x1deab3['push'](_0x1deab3['shift']());}};_0x604d7b(++_0x1fc9ef);}(_0x64f9,0x93));var _0x964f=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x64f9[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x964f('0x0'));module[_0x964f('0x1')]={'name':{'type':Sequelize[_0x964f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x964f('0x2')]},'timeout':{'type':Sequelize[_0x964f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x964f('0x4'),'beepall',_0x964f('0x5'))}}; \ No newline at end of file +var _0x38fd=['roundrobin','exports','STRING','ENUM','rrmemory'];(function(_0x39c747,_0x297706){var _0x523e66=function(_0x170198){while(--_0x170198){_0x39c747['push'](_0x39c747['shift']());}};_0x523e66(++_0x297706);}(_0x38fd,0x1af));var _0xd38f=function(_0x5b6fc5,_0x529e88){_0x5b6fc5=_0x5b6fc5-0x0;var _0x4e85d0=_0x38fd[_0x5b6fc5];return _0x4e85d0;};'use strict';var Sequelize=require('sequelize');module[_0xd38f('0x0')]={'name':{'type':Sequelize[_0xd38f('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd38f('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd38f('0x2')](_0xd38f('0x3'),'beepall',_0xd38f('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 9326b3a..5487421 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 _0x5e66=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','findOne','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','value','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','error','stack','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','autoAssociation'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0x5e66,0x150));var _0x65e6=function(_0x7b73ce,_0x13b3fe){_0x7b73ce=_0x7b73ce-0x0;var _0x31a748=_0x5e66[_0x7b73ce];return _0x31a748;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65e6('0x1'));var rp=require(_0x65e6('0x2'));var moment=require(_0x65e6('0x3'));var BPromise=require(_0x65e6('0x4'));var Mustache=require(_0x65e6('0x5'));var util=require(_0x65e6('0x6'));var path=require(_0x65e6('0x7'));var sox=require(_0x65e6('0x8'));var csv=require('to-csv');var ejs=require(_0x65e6('0x9'));var fs=require('fs');var fs_extra=require(_0x65e6('0xa'));var _=require(_0x65e6('0xb'));var squel=require(_0x65e6('0xc'));var crypto=require(_0x65e6('0xd'));var jsforce=require(_0x65e6('0xe'));var deskjs=require(_0x65e6('0xf'));var toCsv=require(_0x65e6('0x10'));var querystring=require(_0x65e6('0x11'));var Papa=require(_0x65e6('0x12'));var Redis=require(_0x65e6('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x65e6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x65e6('0x15'));var utils=require(_0x65e6('0x16'));var config=require(_0x65e6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x65e6('0x18'))['db'];config['redis']=_[_0x65e6('0x19')](config[_0x65e6('0x1a')],{'host':_0x65e6('0x1b'),'port':0x18eb});var socket=require(_0x65e6('0x1c'))(new Redis(config[_0x65e6('0x1a')]));require('./openchannelQueue.socket')[_0x65e6('0x1d')](socket);function respondWithStatusCode(_0x3ecc30,_0x577492){_0x577492=_0x577492||0xcc;return function(_0x3fe508){if(_0x3fe508){return _0x3ecc30[_0x65e6('0x1e')](_0x577492);}return _0x3ecc30[_0x65e6('0x1f')](_0x577492)['end']();};}function respondWithResult(_0x4a2f61,_0x4cd5b0){_0x4cd5b0=_0x4cd5b0||0xc8;return function(_0x20a20a){if(_0x20a20a){return _0x4a2f61[_0x65e6('0x1f')](_0x4cd5b0)[_0x65e6('0x20')](_0x20a20a);}};}function respondWithFilteredResult(_0x458894,_0x44f3e2){return function(_0x5713cb){if(_0x5713cb){var _0x2c795e=typeof _0x44f3e2[_0x65e6('0x21')]==='undefined'&&typeof _0x44f3e2['limit']===_0x65e6('0x22');var _0x3b9afe=_0x5713cb['count'];var _0x5d43e0=_0x2c795e?0x0:_0x44f3e2[_0x65e6('0x21')];var _0x52d8cd=_0x2c795e?_0x5713cb[_0x65e6('0x23')]:_0x44f3e2[_0x65e6('0x21')]+_0x44f3e2[_0x65e6('0x24')];var _0x525f64;if(_0x52d8cd>=_0x3b9afe){_0x52d8cd=_0x3b9afe;_0x525f64=0xc8;}else{_0x525f64=0xce;}_0x458894[_0x65e6('0x1f')](_0x525f64);return _0x458894['set'](_0x65e6('0x25'),_0x5d43e0+'-'+_0x52d8cd+'/'+_0x3b9afe)[_0x65e6('0x20')](_0x5713cb);}return null;};}function patchUpdates(_0x21f89b){return function(_0xa1e54c){try{jsonpatch[_0x65e6('0x26')](_0xa1e54c,_0x21f89b,!![]);}catch(_0xe29383){return BPromise[_0x65e6('0x27')](_0xe29383);}return _0xa1e54c[_0x65e6('0x28')]();};}function saveUpdates(_0x3ac3cb,_0x1bc26c){return function(_0xbe64ae){if(_0xbe64ae){return _0xbe64ae['update'](_0x3ac3cb)[_0x65e6('0x29')](function(_0xf68a90){return _0xf68a90;});}return null;};}function removeEntity(_0x1bedf4,_0x4cab38){return function(_0x4b0f3a){if(_0x4b0f3a){return _0x4b0f3a[_0x65e6('0x2a')]()[_0x65e6('0x29')](function(){var _0x503141=_0x4b0f3a['get']({'plain':!![]});var _0x95430e='OpenchannelQueues';return db[_0x65e6('0x2b')][_0x65e6('0x2a')]({'where':{'type':_0x95430e,'resourceId':_0x503141['id']}})[_0x65e6('0x29')](function(){return _0x4b0f3a;});})[_0x65e6('0x29')](function(){_0x1bedf4[_0x65e6('0x1f')](0xcc)[_0x65e6('0x2c')]();});}};}function handleEntityNotFound(_0x26ac41,_0x42650a){return function(_0xfa3757){if(!_0xfa3757){_0x26ac41['sendStatus'](0x194);}return _0xfa3757;};}function handleError(_0x29521e,_0x597625){_0x597625=_0x597625||0x1f4;return function(_0x639bcf){logger[_0x65e6('0x2d')](_0x639bcf[_0x65e6('0x2e')]);if(_0x639bcf['name']){delete _0x639bcf['name'];}_0x29521e[_0x65e6('0x1f')](_0x597625)['send'](_0x639bcf);};}exports[_0x65e6('0x2f')]=function(_0x5811e1,_0x19a0ab){var _0x15a40c={},_0xce5e83={},_0x49b778={'count':0x0,'rows':[]};var _0x1b81eb=_[_0x65e6('0x30')](db[_0x65e6('0x31')][_0x65e6('0x32')],function(_0x35c606){return{'name':_0x35c606[_0x65e6('0x33')],'type':_0x35c606[_0x65e6('0x34')][_0x65e6('0x35')]};});_0xce5e83[_0x65e6('0x36')]=_[_0x65e6('0x30')](_0x1b81eb,_0x65e6('0x37'));_0xce5e83['query']=_['keys'](_0x5811e1[_0x65e6('0x38')]);_0xce5e83[_0x65e6('0x39')]=_[_0x65e6('0x3a')](_0xce5e83[_0x65e6('0x36')],_0xce5e83[_0x65e6('0x38')]);_0x15a40c[_0x65e6('0x3b')]=_['intersection'](_0xce5e83[_0x65e6('0x36')],qs[_0x65e6('0x3c')](_0x5811e1[_0x65e6('0x38')][_0x65e6('0x3c')]));_0x15a40c[_0x65e6('0x3b')]=_0x15a40c[_0x65e6('0x3b')][_0x65e6('0x3d')]?_0x15a40c[_0x65e6('0x3b')]:_0xce5e83[_0x65e6('0x36')];if(!_0x5811e1[_0x65e6('0x38')]['hasOwnProperty'](_0x65e6('0x3e'))){_0x15a40c[_0x65e6('0x24')]=qs[_0x65e6('0x24')](_0x5811e1[_0x65e6('0x38')][_0x65e6('0x24')]);_0x15a40c['offset']=qs[_0x65e6('0x21')](_0x5811e1['query'][_0x65e6('0x21')]);}_0x15a40c[_0x65e6('0x3f')]=qs[_0x65e6('0x40')](_0x5811e1[_0x65e6('0x38')][_0x65e6('0x40')]);_0x15a40c[_0x65e6('0x41')]=qs[_0x65e6('0x39')](_[_0x65e6('0x42')](_0x5811e1[_0x65e6('0x38')],_0xce5e83[_0x65e6('0x39')]),_0x1b81eb);if(_0x5811e1[_0x65e6('0x38')][_0x65e6('0x43')]){_0x15a40c[_0x65e6('0x41')]=_[_0x65e6('0x44')](_0x15a40c[_0x65e6('0x41')],{'$or':_[_0x65e6('0x30')](_0x1b81eb,function(_0x2b37b0){if(_0x2b37b0['type']!==_0x65e6('0x45')){var _0x336c96={};_0x336c96[_0x2b37b0[_0x65e6('0x37')]]={'$like':'%'+_0x5811e1[_0x65e6('0x38')][_0x65e6('0x43')]+'%'};return _0x336c96;}})});}_0x15a40c=_[_0x65e6('0x44')]({},_0x15a40c,_0x5811e1[_0x65e6('0x46')]);var _0x41ef72={'where':_0x15a40c['where']};return db[_0x65e6('0x31')][_0x65e6('0x23')](_0x41ef72)['then'](function(_0x329dbc){_0x49b778['count']=_0x329dbc;if(_0x5811e1[_0x65e6('0x38')][_0x65e6('0x47')]){_0x15a40c[_0x65e6('0x48')]=[{'all':!![]}];}return db[_0x65e6('0x31')]['findAll'](_0x15a40c);})[_0x65e6('0x29')](function(_0x37bb54){_0x49b778['rows']=_0x37bb54;return _0x49b778;})[_0x65e6('0x29')](respondWithFilteredResult(_0x19a0ab,_0x15a40c))[_0x65e6('0x49')](handleError(_0x19a0ab,null));};exports[_0x65e6('0x4a')]=function(_0x1f9323,_0x414e21){var _0x4f1175={'raw':!![],'where':{'id':_0x1f9323[_0x65e6('0x4b')]['id']}},_0x55981a={};_0x55981a[_0x65e6('0x36')]=_[_0x65e6('0x4c')](db[_0x65e6('0x31')]['rawAttributes']);_0x55981a[_0x65e6('0x38')]=_['keys'](_0x1f9323['query']);_0x55981a[_0x65e6('0x39')]=_['intersection'](_0x55981a[_0x65e6('0x36')],_0x55981a[_0x65e6('0x38')]);_0x4f1175[_0x65e6('0x3b')]=_['intersection'](_0x55981a[_0x65e6('0x36')],qs['fields'](_0x1f9323[_0x65e6('0x38')][_0x65e6('0x3c')]));_0x4f1175[_0x65e6('0x3b')]=_0x4f1175[_0x65e6('0x3b')]['length']?_0x4f1175[_0x65e6('0x3b')]:_0x55981a[_0x65e6('0x36')];if(_0x1f9323[_0x65e6('0x38')][_0x65e6('0x47')]){_0x4f1175[_0x65e6('0x48')]=[{'all':!![]}];}_0x4f1175=_[_0x65e6('0x44')]({},_0x4f1175,_0x1f9323[_0x65e6('0x46')]);return db['OpenchannelQueue'][_0x65e6('0x4d')](_0x4f1175)[_0x65e6('0x29')](handleEntityNotFound(_0x414e21,null))[_0x65e6('0x29')](respondWithResult(_0x414e21,null))['catch'](handleError(_0x414e21,null));};exports[_0x65e6('0x4e')]=function(_0x208d14,_0x1cbe47){return db[_0x65e6('0x31')][_0x65e6('0x4e')](_0x208d14[_0x65e6('0x4f')],{})['then'](function(_0x22b8a3){var _0x1defd1=_0x208d14[_0x65e6('0x50')][_0x65e6('0x51')]({'plain':!![]});if(!_0x1defd1)throw new Error(_0x65e6('0x52'));if(_0x1defd1[_0x65e6('0x53')]===_0x65e6('0x50')){var _0x428afc=_0x22b8a3[_0x65e6('0x51')]({'plain':!![]});var _0x500deb=_0x65e6('0x54');return db['UserProfileSection'][_0x65e6('0x4d')]({'where':{'name':_0x500deb,'userProfileId':_0x1defd1[_0x65e6('0x55')]},'raw':!![]})[_0x65e6('0x29')](function(_0xbfa22){if(_0xbfa22&&_0xbfa22[_0x65e6('0x56')]===0x0){return db[_0x65e6('0x2b')]['create']({'name':_0x428afc['name'],'resourceId':_0x428afc['id'],'type':_0xbfa22[_0x65e6('0x37')],'sectionId':_0xbfa22['id']},{})[_0x65e6('0x29')](function(){return _0x22b8a3;});}else{return _0x22b8a3;}})[_0x65e6('0x49')](function(_0x2db813){logger[_0x65e6('0x2d')](_0x65e6('0x57'),_0x2db813);throw _0x2db813;});}return _0x22b8a3;})[_0x65e6('0x29')](respondWithResult(_0x1cbe47,0xc9))[_0x65e6('0x49')](handleError(_0x1cbe47,null));};exports[_0x65e6('0x58')]=function(_0x3326f0,_0x506f6c){if(_0x3326f0[_0x65e6('0x4f')]['id']){delete _0x3326f0[_0x65e6('0x4f')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x3326f0[_0x65e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x506f6c,null))[_0x65e6('0x29')](saveUpdates(_0x3326f0[_0x65e6('0x4f')],null))['then'](respondWithResult(_0x506f6c,null))['catch'](handleError(_0x506f6c,null));};exports['destroy']=function(_0x48cfcf,_0x33dd9b){return db['OpenchannelQueue'][_0x65e6('0x4d')]({'where':{'id':_0x48cfcf[_0x65e6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33dd9b,null))[_0x65e6('0x29')](removeEntity(_0x33dd9b,null))[_0x65e6('0x49')](handleError(_0x33dd9b,null));};exports['describe']=function(_0x3f23d,_0x1b2bc2){return db[_0x65e6('0x31')]['describe']()[_0x65e6('0x29')](respondWithResult(_0x1b2bc2,null))[_0x65e6('0x49')](handleError(_0x1b2bc2,null));};exports['getMembers']=function(_0x5601f9,_0x318743,_0x578e1f){var _0x31a6c1={'raw':!![],'where':{}},_0x50d484={},_0x5c5797;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x5601f9[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](handleEntityNotFound(_0x318743,null))[_0x65e6('0x29')](function(_0x4c13a8){if(_0x4c13a8){_0x5c5797=_0x4c13a8['get']({'plain':!![]});_0x50d484['model']=_[_0x65e6('0x4c')](db[_0x65e6('0x59')][_0x65e6('0x32')]);_0x50d484['query']=_[_0x65e6('0x4c')](_0x5601f9[_0x65e6('0x38')]);_0x50d484[_0x65e6('0x39')]=_[_0x65e6('0x3a')](_0x50d484[_0x65e6('0x36')],_0x50d484[_0x65e6('0x38')]);_0x31a6c1[_0x65e6('0x3b')]=_['intersection'](_0x50d484[_0x65e6('0x36')],qs[_0x65e6('0x3c')](_0x5601f9[_0x65e6('0x38')][_0x65e6('0x3c')]));_0x31a6c1[_0x65e6('0x3b')]=_0x31a6c1['attributes']['length']?_0x31a6c1['attributes']:_0x50d484[_0x65e6('0x36')];if(!_0x5601f9['query'][_0x65e6('0x5a')](_0x65e6('0x3e'))){_0x31a6c1[_0x65e6('0x24')]=qs[_0x65e6('0x24')](_0x5601f9[_0x65e6('0x38')]['limit']);_0x31a6c1[_0x65e6('0x21')]=qs[_0x65e6('0x21')](_0x5601f9[_0x65e6('0x38')]['offset']);}_0x31a6c1['order']=qs[_0x65e6('0x40')](_0x5601f9[_0x65e6('0x38')][_0x65e6('0x40')]);_0x31a6c1[_0x65e6('0x41')]=qs[_0x65e6('0x39')](_[_0x65e6('0x42')](_0x5601f9[_0x65e6('0x38')],_0x50d484[_0x65e6('0x39')]));_0x31a6c1[_0x65e6('0x41')][_0x65e6('0x5b')]=_0x4c13a8['id'];if(_0x5601f9[_0x65e6('0x38')][_0x65e6('0x43')]){_0x31a6c1[_0x65e6('0x41')]=_[_0x65e6('0x44')](_0x31a6c1[_0x65e6('0x41')],{'$or':_[_0x65e6('0x30')](_0x31a6c1[_0x65e6('0x3b')],function(_0xa86980){var _0x416b77={};_0x416b77[_0xa86980]={'$like':'%'+_0x5601f9[_0x65e6('0x38')]['filter']+'%'};return _0x416b77;})});}_0x31a6c1=_[_0x65e6('0x44')]({},_0x31a6c1,_0x5601f9[_0x65e6('0x46')]);return db[_0x65e6('0x59')][_0x65e6('0x5c')](_0x31a6c1);}})[_0x65e6('0x29')](function(_0x4f05cd){if(_0x4f05cd){return db[_0x65e6('0x5d')][_0x65e6('0x5e')]({'where':{'id':_['map'](_0x4f05cd,_0x65e6('0x5f')),'role':_0x65e6('0x60')},'attributes':['id',_0x65e6('0x37'),_0x65e6('0x61'),_0x65e6('0x62'),_0x65e6('0x63')]});}})['then'](function(_0xe43e1d){if(_0xe43e1d){return{'count':_0xe43e1d[_0x65e6('0x23')],'rows':_['map'](_0xe43e1d[_0x65e6('0x64')],function(_0xcd975a){return{'membername':_0xcd975a[_0x65e6('0x37')],'UserId':_0xcd975a['id'],'queue_name':_0x5c5797[_0x65e6('0x37')],'OpenchannelQueueId':_0x5c5797['id'],'interface':util['format'](_0x65e6('0x65'),_0x65e6('0x66'),_0xcd975a[_0x65e6('0x37')]),'penalty':0x0,'paused':_0xcd975a[_0x65e6('0x61')],'createdAt':_0xcd975a[_0x65e6('0x63')],'updatedAt':_0xcd975a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x65e6('0x29')](respondWithFilteredResult(_0x318743,_0x31a6c1))[_0x65e6('0x49')](handleError(_0x318743,null));};exports[_0x65e6('0x67')]=function(_0x3c46e2,_0x40f473,_0x352a92){var _0x23f332={};var _0x80069d={};var _0x3ead4e;var _0x4a881b;return db[_0x65e6('0x31')][_0x65e6('0x68')]({'where':{'id':_0x3c46e2[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](handleEntityNotFound(_0x40f473,null))[_0x65e6('0x29')](function(_0x5e25b6){if(_0x5e25b6){_0x3ead4e=_0x5e25b6;_0x80069d[_0x65e6('0x36')]=_['keys'](db[_0x65e6('0x69')][_0x65e6('0x32')]);_0x80069d[_0x65e6('0x38')]=_[_0x65e6('0x4c')](_0x3c46e2[_0x65e6('0x38')]);_0x80069d[_0x65e6('0x39')]=_[_0x65e6('0x3a')](_0x80069d[_0x65e6('0x36')],_0x80069d[_0x65e6('0x38')]);_0x23f332[_0x65e6('0x3b')]=_[_0x65e6('0x3a')](_0x80069d[_0x65e6('0x36')],qs[_0x65e6('0x3c')](_0x3c46e2[_0x65e6('0x38')]['fields']));_0x23f332[_0x65e6('0x3b')]=_0x23f332['attributes'][_0x65e6('0x3d')]?_0x23f332['attributes']:_0x80069d[_0x65e6('0x36')];_0x23f332['order']=qs['sort'](_0x3c46e2[_0x65e6('0x38')][_0x65e6('0x40')]);_0x23f332[_0x65e6('0x41')]=qs['filters'](_['pick'](_0x3c46e2[_0x65e6('0x38')],_0x80069d[_0x65e6('0x39')]));if(_0x3c46e2[_0x65e6('0x38')][_0x65e6('0x43')]){_0x23f332[_0x65e6('0x41')]=_[_0x65e6('0x44')](_0x23f332[_0x65e6('0x41')],{'$or':_[_0x65e6('0x30')](_0x23f332['attributes'],function(_0x49d673){var _0x4ef7d0={};_0x4ef7d0[_0x49d673]={'$like':'%'+_0x3c46e2['query'][_0x65e6('0x43')]+'%'};return _0x4ef7d0;})});}_0x23f332=_[_0x65e6('0x44')]({},_0x23f332,_0x3c46e2[_0x65e6('0x46')]);return _0x3ead4e[_0x65e6('0x67')](_0x23f332);}})[_0x65e6('0x29')](function(_0x56034f){if(_0x56034f){_0x4a881b=_0x56034f[_0x65e6('0x3d')];if(!_0x3c46e2['query']['hasOwnProperty'](_0x65e6('0x3e'))){_0x23f332[_0x65e6('0x24')]=qs[_0x65e6('0x24')](_0x3c46e2[_0x65e6('0x38')][_0x65e6('0x24')]);_0x23f332[_0x65e6('0x21')]=qs[_0x65e6('0x21')](_0x3c46e2[_0x65e6('0x38')][_0x65e6('0x21')]);}return _0x3ead4e['getTeams'](_0x23f332);}})[_0x65e6('0x29')](function(_0x32fd46){if(_0x32fd46){return _0x32fd46?{'count':_0x4a881b,'rows':_0x32fd46}:null;}})[_0x65e6('0x29')](respondWithResult(_0x40f473,null))['catch'](handleError(_0x40f473,null));};exports['addTeams']=function(_0x101195,_0x38b915,_0x16621e){var _0x37bbf9=_0x101195[_0x65e6('0x4f')][_0x65e6('0x6a')];return db[_0x65e6('0x69')][_0x65e6('0x5c')]({'where':{'id':_0x37bbf9},'attributes':['id'],'include':[{'model':db[_0x65e6('0x5d')],'as':_0x65e6('0x6b'),'attributes':['id',_0x65e6('0x37'),_0x65e6('0x6c'),_0x65e6('0x6d'),'interface'],'raw':!![]}]})[_0x65e6('0x29')](function(_0x367de3){if(_0x367de3){var _0x2d8062=_[_0x65e6('0x6e')](_0x367de3,function(_0x105c61){var _0x3bebed=_0x105c61[_0x65e6('0x51')]({'plain':!![]});return _0x3bebed[_0x65e6('0x6b')];});return db[_0x65e6('0x31')][_0x65e6('0x4d')]({'where':{'id':_0x101195[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](function(_0x2ab430){return db[_0x65e6('0x6f')][_0x65e6('0x70')](function(_0x3b7ee4){return _0x2ab430[_0x65e6('0x71')](_0x37bbf9,{'transaction':_0x3b7ee4})[_0x65e6('0x29')](function(){return BPromise['each'](_0x2d8062,function(_0x53583c){return db[_0x65e6('0x59')][_0x65e6('0x72')]({'where':{'UserId':_0x53583c['id'],'OpenchannelQueueId':_0x101195[_0x65e6('0x4b')]['id']},'transaction':_0x3b7ee4});});})[_0x65e6('0x29')](function(){_0x2d8062[_0x65e6('0x73')](function(_0x32c5fe){socket[_0x65e6('0x74')]('userOpenchannelQueue:save',{'UserId':_0x32c5fe['id'],'OpenchannelQueueId':_0x2ab430['id']});});});});});}})[_0x65e6('0x29')](respondWithStatusCode(_0x38b915,null))[_0x65e6('0x49')](handleError(_0x38b915,null));};exports[_0x65e6('0x75')]=function(_0x364332,_0x5504c2,_0x3de9ec){return db[_0x65e6('0x69')][_0x65e6('0x5c')]({'where':{'id':_0x364332[_0x65e6('0x38')][_0x65e6('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x65e6('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x65e6('0x29')](handleEntityNotFound(_0x5504c2,null))[_0x65e6('0x29')](function(_0x287cd3){var _0x3dc841=_[_0x65e6('0x30')](_0x287cd3,'id');var _0x7f6315=[];var _0x34066d=[];var _0x2a443f=squel['select']();_0x2a443f[_0x65e6('0x76')](_0x65e6('0x77'))[_0x65e6('0x78')]('team_has_openchannel_queues','tq')[_0x65e6('0x79')]('user_has_teams','ut',_0x65e6('0x7a'))[_0x65e6('0x41')](_0x65e6('0x7b'),_0x364332[_0x65e6('0x4b')]['id']);for(var _0x2569e1=0x0;_0x2569e1<_0x287cd3[_0x65e6('0x3d')];_0x2569e1+=0x1){let _0x148189=_0x287cd3[_0x2569e1];for(var _0x357591=0x0;_0x357591<_0x148189[_0x65e6('0x6b')][_0x65e6('0x3d')];_0x357591+=0x1){let _0x4a5fd=_0x148189[_0x65e6('0x6b')][_0x357591];var _0x2d197b=_0x2a443f[_0x65e6('0x7c')]();_0x2d197b[_0x65e6('0x41')](_0x65e6('0x7d'),_0x4a5fd['id']);_0x34066d[_0x65e6('0x7e')](db[_0x65e6('0x6f')]['query'](_0x2d197b[_0x65e6('0x7f')](),{'type':db[_0x65e6('0x6f')][_0x65e6('0x80')][_0x65e6('0x81')]})[_0x65e6('0x29')](function(_0x3dc3cd){if(_0x3dc3cd[_0x65e6('0x3d')]===0x1){return _0x4a5fd['id'];}else{var _0x3b5d10=_['every'](_[_0x65e6('0x30')](_0x3dc3cd,'TeamId'),function(_0x3e6210){return _[_0x65e6('0x82')](_0x3dc841,_0x3e6210);});if(_0x3b5d10){return _0x4a5fd['id'];}}}));}}return BPromise[_0x65e6('0x83')](_0x34066d)[_0x65e6('0x29')](function(_0x37f9b4){_0x7f6315=_(_0x7f6315)[_0x65e6('0x84')](_0x37f9b4)['compact']()[_0x65e6('0x85')]();return db['OpenchannelQueue'][_0x65e6('0x4d')]({'where':{'id':_0x364332[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](function(_0x3b5b3d){return db[_0x65e6('0x6f')]['transaction'](function(_0x2b7ee2){return _0x3b5b3d['removeTeams'](_0x364332[_0x65e6('0x38')][_0x65e6('0x6a')],{'transaction':_0x2b7ee2})[_0x65e6('0x29')](function(){if(!_['isEmpty'](_0x7f6315)){return _0x3b5b3d[_0x65e6('0x86')](_0x7f6315,{'transaction':_0x2b7ee2});}})[_0x65e6('0x29')](function(){_0x7f6315['forEach'](function(_0x463584){socket[_0x65e6('0x74')](_0x65e6('0x87'),{'UserId':_0x463584,'OpenchannelQueueId':_0x3b5b3d['id']});});});});});});})[_0x65e6('0x29')](respondWithStatusCode(_0x5504c2,null))[_0x65e6('0x49')](handleError(_0x5504c2,null));};exports[_0x65e6('0x88')]=function(_0x41bad3,_0x20c701,_0x4e638d){return db[_0x65e6('0x31')][_0x65e6('0x4d')]({'where':{'id':_0x41bad3[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](handleEntityNotFound(_0x20c701,null))[_0x65e6('0x29')](function(_0x730594){if(_0x730594){return _0x730594[_0x65e6('0x88')](_0x41bad3[_0x65e6('0x4f')][_0x65e6('0x6a')],_['omit'](_0x41bad3[_0x65e6('0x4f')],[_0x65e6('0x6a'),'id'])||{})[_0x65e6('0x89')](function(_0x41f13f){for(var _0x2375ca=0x0;_0x2375ca<_0x41bad3['body'][_0x65e6('0x6a')][_0x65e6('0x3d')];_0x2375ca+=0x1){socket[_0x65e6('0x74')](_0x65e6('0x8a'),{'UserId':Number(_0x41bad3[_0x65e6('0x4f')][_0x65e6('0x6a')][_0x2375ca]),'OpenchannelQueueId':Number(_0x41bad3['params']['id'])});}return _0x41f13f;});}})[_0x65e6('0x29')](respondWithResult(_0x20c701,null))[_0x65e6('0x49')](handleError(_0x20c701,null));};exports[_0x65e6('0x86')]=function(_0x2a109a,_0x4f4d7d,_0x37ad39){return db[_0x65e6('0x31')]['find']({'where':{'id':_0x2a109a[_0x65e6('0x4b')]['id']}})[_0x65e6('0x29')](handleEntityNotFound(_0x4f4d7d,null))[_0x65e6('0x29')](function(_0x5c4e46){if(_0x5c4e46){return _0x5c4e46[_0x65e6('0x86')](_0x2a109a['query']['ids'])[_0x65e6('0x29')](function(){if(_[_0x65e6('0x8b')](_0x2a109a[_0x65e6('0x38')][_0x65e6('0x6a')])){for(var _0x84941=0x0;_0x84941<_0x2a109a[_0x65e6('0x38')][_0x65e6('0x6a')][_0x65e6('0x3d')];_0x84941+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2a109a[_0x65e6('0x38')][_0x65e6('0x6a')][_0x84941]),'OpenchannelQueueId':Number(_0x2a109a['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2a109a[_0x65e6('0x38')][_0x65e6('0x6a')]),'OpenchannelQueueId':Number(_0x2a109a[_0x65e6('0x4b')]['id'])});}});}})[_0x65e6('0x29')](respondWithStatusCode(_0x4f4d7d,null))['catch'](handleError(_0x4f4d7d,null));};exports['getAgents']=function(_0x51b76a,_0x197d64,_0x5dd455){var _0x13632b={};var _0x56d4f2={};var _0x25d12a;var _0x197360;return db[_0x65e6('0x31')][_0x65e6('0x68')]({'where':{'id':_0x51b76a['params']['id']}})['then'](handleEntityNotFound(_0x197d64,null))[_0x65e6('0x29')](function(_0x5251e9){if(_0x5251e9){_0x25d12a=_0x5251e9;_0x56d4f2[_0x65e6('0x36')]=_[_0x65e6('0x4c')](db['User'][_0x65e6('0x32')]);_0x56d4f2[_0x65e6('0x38')]=_[_0x65e6('0x4c')](_0x51b76a[_0x65e6('0x38')]);_0x56d4f2[_0x65e6('0x39')]=_['intersection'](_0x56d4f2[_0x65e6('0x36')],_0x56d4f2[_0x65e6('0x38')]);_0x13632b[_0x65e6('0x3b')]=_[_0x65e6('0x3a')](_0x56d4f2[_0x65e6('0x36')],qs[_0x65e6('0x3c')](_0x51b76a[_0x65e6('0x38')]['fields']));_0x13632b['attributes']=_0x13632b[_0x65e6('0x3b')][_0x65e6('0x3d')]?_0x13632b[_0x65e6('0x3b')]:_0x56d4f2['model'];_0x13632b[_0x65e6('0x3f')]=qs[_0x65e6('0x40')](_0x51b76a[_0x65e6('0x38')][_0x65e6('0x40')]);_0x13632b['where']=qs[_0x65e6('0x39')](_[_0x65e6('0x42')](_0x51b76a[_0x65e6('0x38')],_0x56d4f2[_0x65e6('0x39')]));if(_0x51b76a[_0x65e6('0x38')][_0x65e6('0x43')]){_0x13632b[_0x65e6('0x41')]=_['merge'](_0x13632b[_0x65e6('0x41')],{'$or':_['map'](_0x13632b[_0x65e6('0x3b')],function(_0x3d5f7f){var _0x3a66f6={};_0x3a66f6[_0x3d5f7f]={'$like':'%'+_0x51b76a[_0x65e6('0x38')][_0x65e6('0x43')]+'%'};return _0x3a66f6;})});}_0x13632b=_['merge']({},_0x13632b,_0x51b76a['options']);return _0x25d12a[_0x65e6('0x8c')](_0x13632b);}})[_0x65e6('0x29')](function(_0x2c2cb5){if(_0x2c2cb5){_0x197360=_0x2c2cb5[_0x65e6('0x3d')];if(!_0x51b76a[_0x65e6('0x38')][_0x65e6('0x5a')](_0x65e6('0x3e'))){_0x13632b[_0x65e6('0x24')]=qs[_0x65e6('0x24')](_0x51b76a['query'][_0x65e6('0x24')]);_0x13632b[_0x65e6('0x21')]=qs[_0x65e6('0x21')](_0x51b76a['query']['offset']);}return _0x25d12a['getAgents'](_0x13632b);}})[_0x65e6('0x29')](function(_0x17118d){if(_0x17118d){return _0x17118d?{'count':_0x197360,'rows':_0x17118d}:null;}})[_0x65e6('0x29')](respondWithResult(_0x197d64,null))[_0x65e6('0x49')](handleError(_0x197d64,null));}; \ No newline at end of file +var _0x23f7=['every','includes','all','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userOpenchannelQueue:save','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','getMembers','UserOpenchannelQueue','order','OpenchannelQueueId','User','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','findAll','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','removeTeams','ids','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT'];(function(_0x38c303,_0x30cc3e){var _0x3aceb7=function(_0x3cbc5e){while(--_0x3cbc5e){_0x38c303['push'](_0x38c303['shift']());}};_0x3aceb7(++_0x30cc3e);}(_0x23f7,0x126));var _0x723f=function(_0x3d5bfe,_0x5b285e){_0x3d5bfe=_0x3d5bfe-0x0;var _0x1111f9=_0x23f7[_0x3d5bfe];return _0x1111f9;};'use strict';var emlformat=require(_0x723f('0x0'));var rimraf=require(_0x723f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x723f('0x2'));var BPromise=require(_0x723f('0x3'));var Mustache=require(_0x723f('0x4'));var util=require(_0x723f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x723f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x723f('0x7'));var _=require(_0x723f('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x723f('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x723f('0xa'));var Papa=require(_0x723f('0xb'));var Redis=require(_0x723f('0xc'));var authService=require(_0x723f('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x723f('0xe'));var logger=require(_0x723f('0xf'))(_0x723f('0x10'));var utils=require(_0x723f('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x723f('0x12'))['db'];config['redis']=_[_0x723f('0x13')](config[_0x723f('0x14')],{'host':_0x723f('0x15'),'port':0x18eb});var socket=require(_0x723f('0x16'))(new Redis(config['redis']));require(_0x723f('0x17'))[_0x723f('0x18')](socket);function respondWithStatusCode(_0x1555ad,_0x438b65){_0x438b65=_0x438b65||0xcc;return function(_0xcdbfd4){if(_0xcdbfd4){return _0x1555ad[_0x723f('0x19')](_0x438b65);}return _0x1555ad[_0x723f('0x1a')](_0x438b65)['end']();};}function respondWithResult(_0xf94b08,_0x151d9d){_0x151d9d=_0x151d9d||0xc8;return function(_0x42915b){if(_0x42915b){return _0xf94b08[_0x723f('0x1a')](_0x151d9d)[_0x723f('0x1b')](_0x42915b);}};}function respondWithFilteredResult(_0x257cdf,_0x423540){return function(_0x7d1e4f){if(_0x7d1e4f){var _0xd4ff50=typeof _0x423540[_0x723f('0x1c')]===_0x723f('0x1d')&&typeof _0x423540['limit']===_0x723f('0x1d');var _0x28148f=_0x7d1e4f[_0x723f('0x1e')];var _0x4e84d6=_0xd4ff50?0x0:_0x423540[_0x723f('0x1c')];var _0xe42436=_0xd4ff50?_0x7d1e4f['count']:_0x423540[_0x723f('0x1c')]+_0x423540[_0x723f('0x1f')];var _0x630b32;if(_0xe42436>=_0x28148f){_0xe42436=_0x28148f;_0x630b32=0xc8;}else{_0x630b32=0xce;}_0x257cdf[_0x723f('0x1a')](_0x630b32);return _0x257cdf[_0x723f('0x20')](_0x723f('0x21'),_0x4e84d6+'-'+_0xe42436+'/'+_0x28148f)[_0x723f('0x1b')](_0x7d1e4f);}return null;};}function patchUpdates(_0x32bf1f){return function(_0x1fb199){try{jsonpatch[_0x723f('0x22')](_0x1fb199,_0x32bf1f,!![]);}catch(_0x4de8fe){return BPromise[_0x723f('0x23')](_0x4de8fe);}return _0x1fb199[_0x723f('0x24')]();};}function saveUpdates(_0x1a4de3,_0x7933a4){return function(_0x433269){if(_0x433269){return _0x433269['update'](_0x1a4de3)['then'](function(_0x5900a7){return _0x5900a7;});}return null;};}function removeEntity(_0xd92ed2,_0x2c6883){return function(_0xa73a45){if(_0xa73a45){return _0xa73a45[_0x723f('0x25')]()[_0x723f('0x26')](function(){var _0x318256=_0xa73a45['get']({'plain':!![]});var _0x1bc681=_0x723f('0x27');return db[_0x723f('0x28')][_0x723f('0x25')]({'where':{'type':_0x1bc681,'resourceId':_0x318256['id']}})[_0x723f('0x26')](function(){return _0xa73a45;});})[_0x723f('0x26')](function(){_0xd92ed2[_0x723f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41bcdd,_0x21afed){return function(_0x2b6088){if(!_0x2b6088){_0x41bcdd[_0x723f('0x19')](0x194);}return _0x2b6088;};}function handleError(_0x22dc8b,_0x2616f8){_0x2616f8=_0x2616f8||0x1f4;return function(_0x4615e2){logger[_0x723f('0x29')](_0x4615e2[_0x723f('0x2a')]);if(_0x4615e2[_0x723f('0x2b')]){delete _0x4615e2[_0x723f('0x2b')];}_0x22dc8b['status'](_0x2616f8)[_0x723f('0x2c')](_0x4615e2);};}exports[_0x723f('0x2d')]=function(_0x501e77,_0x4fffc6){var _0x4f4533={},_0x126477={},_0x3dde32={'count':0x0,'rows':[]};var _0x4d4bdd=_[_0x723f('0x2e')](db[_0x723f('0x2f')][_0x723f('0x30')],function(_0x1134ba){return{'name':_0x1134ba[_0x723f('0x31')],'type':_0x1134ba['type']['key']};});_0x126477[_0x723f('0x32')]=_[_0x723f('0x2e')](_0x4d4bdd,_0x723f('0x2b'));_0x126477[_0x723f('0x33')]=_[_0x723f('0x34')](_0x501e77[_0x723f('0x33')]);_0x126477[_0x723f('0x35')]=_[_0x723f('0x36')](_0x126477['model'],_0x126477['query']);_0x4f4533[_0x723f('0x37')]=_['intersection'](_0x126477[_0x723f('0x32')],qs[_0x723f('0x38')](_0x501e77[_0x723f('0x33')][_0x723f('0x38')]));_0x4f4533[_0x723f('0x37')]=_0x4f4533[_0x723f('0x37')][_0x723f('0x39')]?_0x4f4533[_0x723f('0x37')]:_0x126477[_0x723f('0x32')];if(!_0x501e77['query'][_0x723f('0x3a')](_0x723f('0x3b'))){_0x4f4533[_0x723f('0x1f')]=qs[_0x723f('0x1f')](_0x501e77[_0x723f('0x33')]['limit']);_0x4f4533[_0x723f('0x1c')]=qs[_0x723f('0x1c')](_0x501e77[_0x723f('0x33')][_0x723f('0x1c')]);}_0x4f4533['order']=qs[_0x723f('0x3c')](_0x501e77['query']['sort']);_0x4f4533[_0x723f('0x3d')]=qs[_0x723f('0x35')](_[_0x723f('0x3e')](_0x501e77[_0x723f('0x33')],_0x126477[_0x723f('0x35')]),_0x4d4bdd);if(_0x501e77[_0x723f('0x33')]['filter']){_0x4f4533[_0x723f('0x3d')]=_[_0x723f('0x3f')](_0x4f4533['where'],{'$or':_[_0x723f('0x2e')](_0x4d4bdd,function(_0x3e3b5a){if(_0x3e3b5a[_0x723f('0x40')]!==_0x723f('0x41')){var _0x97cf90={};_0x97cf90[_0x3e3b5a[_0x723f('0x2b')]]={'$like':'%'+_0x501e77[_0x723f('0x33')][_0x723f('0x42')]+'%'};return _0x97cf90;}})});}_0x4f4533=_['merge']({},_0x4f4533,_0x501e77[_0x723f('0x43')]);var _0x3bc0a5={'where':_0x4f4533[_0x723f('0x3d')]};return db[_0x723f('0x2f')][_0x723f('0x1e')](_0x3bc0a5)[_0x723f('0x26')](function(_0x73aeb9){_0x3dde32[_0x723f('0x1e')]=_0x73aeb9;if(_0x501e77[_0x723f('0x33')]['includeAll']){_0x4f4533[_0x723f('0x44')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x4f4533);})[_0x723f('0x26')](function(_0xd3e288){_0x3dde32[_0x723f('0x45')]=_0xd3e288;return _0x3dde32;})[_0x723f('0x26')](respondWithFilteredResult(_0x4fffc6,_0x4f4533))[_0x723f('0x46')](handleError(_0x4fffc6,null));};exports[_0x723f('0x47')]=function(_0xce9512,_0x36c0be){var _0x460155={'raw':!![],'where':{'id':_0xce9512[_0x723f('0x48')]['id']}},_0x3b2b31={};_0x3b2b31[_0x723f('0x32')]=_[_0x723f('0x34')](db[_0x723f('0x2f')][_0x723f('0x30')]);_0x3b2b31['query']=_['keys'](_0xce9512[_0x723f('0x33')]);_0x3b2b31[_0x723f('0x35')]=_['intersection'](_0x3b2b31[_0x723f('0x32')],_0x3b2b31[_0x723f('0x33')]);_0x460155[_0x723f('0x37')]=_[_0x723f('0x36')](_0x3b2b31['model'],qs[_0x723f('0x38')](_0xce9512[_0x723f('0x33')][_0x723f('0x38')]));_0x460155[_0x723f('0x37')]=_0x460155['attributes'][_0x723f('0x39')]?_0x460155[_0x723f('0x37')]:_0x3b2b31[_0x723f('0x32')];if(_0xce9512[_0x723f('0x33')][_0x723f('0x49')]){_0x460155['include']=[{'all':!![]}];}_0x460155=_[_0x723f('0x3f')]({},_0x460155,_0xce9512[_0x723f('0x43')]);return db['OpenchannelQueue'][_0x723f('0x4a')](_0x460155)[_0x723f('0x26')](handleEntityNotFound(_0x36c0be,null))[_0x723f('0x26')](respondWithResult(_0x36c0be,null))[_0x723f('0x46')](handleError(_0x36c0be,null));};exports[_0x723f('0x4b')]=function(_0x43cbbf,_0x599c0d){return db['OpenchannelQueue'][_0x723f('0x4b')](_0x43cbbf[_0x723f('0x4c')],{})[_0x723f('0x26')](function(_0x4dd31d){var _0x5287f5=_0x43cbbf[_0x723f('0x4d')][_0x723f('0x4e')]({'plain':!![]});if(!_0x5287f5)throw new Error(_0x723f('0x4f'));if(_0x5287f5[_0x723f('0x50')]==='user'){var _0x565d77=_0x4dd31d[_0x723f('0x4e')]({'plain':!![]});var _0x4917db='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x4917db,'userProfileId':_0x5287f5[_0x723f('0x51')]},'raw':!![]})[_0x723f('0x26')](function(_0x1706d6){if(_0x1706d6&&_0x1706d6[_0x723f('0x52')]===0x0){return db[_0x723f('0x28')]['create']({'name':_0x565d77[_0x723f('0x2b')],'resourceId':_0x565d77['id'],'type':_0x1706d6[_0x723f('0x2b')],'sectionId':_0x1706d6['id']},{})[_0x723f('0x26')](function(){return _0x4dd31d;});}else{return _0x4dd31d;}})['catch'](function(_0x238c9c){logger[_0x723f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x238c9c);throw _0x238c9c;});}return _0x4dd31d;})[_0x723f('0x26')](respondWithResult(_0x599c0d,0xc9))[_0x723f('0x46')](handleError(_0x599c0d,null));};exports[_0x723f('0x53')]=function(_0x5ddce0,_0x207b83){if(_0x5ddce0['body']['id']){delete _0x5ddce0[_0x723f('0x4c')]['id'];}return db[_0x723f('0x2f')][_0x723f('0x4a')]({'where':{'id':_0x5ddce0[_0x723f('0x48')]['id']}})[_0x723f('0x26')](handleEntityNotFound(_0x207b83,null))['then'](saveUpdates(_0x5ddce0[_0x723f('0x4c')],null))[_0x723f('0x26')](respondWithResult(_0x207b83,null))[_0x723f('0x46')](handleError(_0x207b83,null));};exports['destroy']=function(_0x31ca21,_0x5ef95d){return db[_0x723f('0x2f')][_0x723f('0x4a')]({'where':{'id':_0x31ca21[_0x723f('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ef95d,null))['then'](removeEntity(_0x5ef95d,null))[_0x723f('0x46')](handleError(_0x5ef95d,null));};exports['describe']=function(_0x1c2e6d,_0x824974){return db[_0x723f('0x2f')]['describe']()[_0x723f('0x26')](respondWithResult(_0x824974,null))['catch'](handleError(_0x824974,null));};exports[_0x723f('0x54')]=function(_0xa32a47,_0x5a2725,_0x495d7f){var _0x5180c5={'raw':!![],'where':{}},_0x200522={},_0x41e608;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xa32a47[_0x723f('0x48')]['id']}})[_0x723f('0x26')](handleEntityNotFound(_0x5a2725,null))[_0x723f('0x26')](function(_0x52207c){if(_0x52207c){_0x41e608=_0x52207c['get']({'plain':!![]});_0x200522[_0x723f('0x32')]=_['keys'](db[_0x723f('0x55')]['rawAttributes']);_0x200522['query']=_['keys'](_0xa32a47[_0x723f('0x33')]);_0x200522[_0x723f('0x35')]=_[_0x723f('0x36')](_0x200522[_0x723f('0x32')],_0x200522[_0x723f('0x33')]);_0x5180c5[_0x723f('0x37')]=_[_0x723f('0x36')](_0x200522['model'],qs[_0x723f('0x38')](_0xa32a47[_0x723f('0x33')]['fields']));_0x5180c5[_0x723f('0x37')]=_0x5180c5['attributes'][_0x723f('0x39')]?_0x5180c5['attributes']:_0x200522[_0x723f('0x32')];if(!_0xa32a47[_0x723f('0x33')][_0x723f('0x3a')](_0x723f('0x3b'))){_0x5180c5['limit']=qs[_0x723f('0x1f')](_0xa32a47[_0x723f('0x33')][_0x723f('0x1f')]);_0x5180c5['offset']=qs['offset'](_0xa32a47[_0x723f('0x33')]['offset']);}_0x5180c5[_0x723f('0x56')]=qs[_0x723f('0x3c')](_0xa32a47[_0x723f('0x33')]['sort']);_0x5180c5['where']=qs[_0x723f('0x35')](_[_0x723f('0x3e')](_0xa32a47[_0x723f('0x33')],_0x200522['filters']));_0x5180c5[_0x723f('0x3d')][_0x723f('0x57')]=_0x52207c['id'];if(_0xa32a47['query'][_0x723f('0x42')]){_0x5180c5[_0x723f('0x3d')]=_['merge'](_0x5180c5['where'],{'$or':_[_0x723f('0x2e')](_0x5180c5[_0x723f('0x37')],function(_0x3e4791){var _0x28f114={};_0x28f114[_0x3e4791]={'$like':'%'+_0xa32a47[_0x723f('0x33')][_0x723f('0x42')]+'%'};return _0x28f114;})});}_0x5180c5=_[_0x723f('0x3f')]({},_0x5180c5,_0xa32a47[_0x723f('0x43')]);return db['UserOpenchannelQueue']['findAll'](_0x5180c5);}})[_0x723f('0x26')](function(_0x49fbe7){if(_0x49fbe7){return db[_0x723f('0x58')]['findAndCountAll']({'where':{'id':_[_0x723f('0x2e')](_0x49fbe7,_0x723f('0x59')),'role':'agent'},'attributes':['id',_0x723f('0x2b'),_0x723f('0x5a'),_0x723f('0x5b'),_0x723f('0x5c')]});}})[_0x723f('0x26')](function(_0x59471b){if(_0x59471b){return{'count':_0x59471b['count'],'rows':_['map'](_0x59471b[_0x723f('0x45')],function(_0x368d3e){return{'membername':_0x368d3e[_0x723f('0x2b')],'UserId':_0x368d3e['id'],'queue_name':_0x41e608[_0x723f('0x2b')],'OpenchannelQueueId':_0x41e608['id'],'interface':util[_0x723f('0x5d')](_0x723f('0x5e'),_0x723f('0x5f'),_0x368d3e[_0x723f('0x2b')]),'penalty':0x0,'paused':_0x368d3e[_0x723f('0x5a')],'createdAt':_0x368d3e['createdAt'],'updatedAt':_0x368d3e[_0x723f('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x723f('0x26')](respondWithFilteredResult(_0x5a2725,_0x5180c5))[_0x723f('0x46')](handleError(_0x5a2725,null));};exports[_0x723f('0x60')]=function(_0xdb4b1d,_0xb989ed,_0x25e772){var _0x146540={};var _0x2a71a3={};var _0x1165b5;var _0x59f686;return db[_0x723f('0x2f')][_0x723f('0x61')]({'where':{'id':_0xdb4b1d['params']['id']}})[_0x723f('0x26')](handleEntityNotFound(_0xb989ed,null))['then'](function(_0x2e8cd2){if(_0x2e8cd2){_0x1165b5=_0x2e8cd2;_0x2a71a3['model']=_[_0x723f('0x34')](db[_0x723f('0x62')][_0x723f('0x30')]);_0x2a71a3['query']=_['keys'](_0xdb4b1d['query']);_0x2a71a3[_0x723f('0x35')]=_[_0x723f('0x36')](_0x2a71a3[_0x723f('0x32')],_0x2a71a3[_0x723f('0x33')]);_0x146540[_0x723f('0x37')]=_['intersection'](_0x2a71a3[_0x723f('0x32')],qs[_0x723f('0x38')](_0xdb4b1d[_0x723f('0x33')][_0x723f('0x38')]));_0x146540[_0x723f('0x37')]=_0x146540[_0x723f('0x37')]['length']?_0x146540['attributes']:_0x2a71a3[_0x723f('0x32')];_0x146540[_0x723f('0x56')]=qs[_0x723f('0x3c')](_0xdb4b1d[_0x723f('0x33')][_0x723f('0x3c')]);_0x146540[_0x723f('0x3d')]=qs[_0x723f('0x35')](_['pick'](_0xdb4b1d['query'],_0x2a71a3[_0x723f('0x35')]));if(_0xdb4b1d[_0x723f('0x33')][_0x723f('0x42')]){_0x146540[_0x723f('0x3d')]=_['merge'](_0x146540['where'],{'$or':_[_0x723f('0x2e')](_0x146540[_0x723f('0x37')],function(_0x46f0b7){var _0x2ffdaa={};_0x2ffdaa[_0x46f0b7]={'$like':'%'+_0xdb4b1d['query'][_0x723f('0x42')]+'%'};return _0x2ffdaa;})});}_0x146540=_[_0x723f('0x3f')]({},_0x146540,_0xdb4b1d[_0x723f('0x43')]);return _0x1165b5[_0x723f('0x60')](_0x146540);}})[_0x723f('0x26')](function(_0x15dc28){if(_0x15dc28){_0x59f686=_0x15dc28[_0x723f('0x39')];if(!_0xdb4b1d[_0x723f('0x33')][_0x723f('0x3a')](_0x723f('0x3b'))){_0x146540[_0x723f('0x1f')]=qs['limit'](_0xdb4b1d['query'][_0x723f('0x1f')]);_0x146540[_0x723f('0x1c')]=qs['offset'](_0xdb4b1d[_0x723f('0x33')][_0x723f('0x1c')]);}return _0x1165b5[_0x723f('0x60')](_0x146540);}})[_0x723f('0x26')](function(_0x37386d){if(_0x37386d){return _0x37386d?{'count':_0x59f686,'rows':_0x37386d}:null;}})['then'](respondWithResult(_0xb989ed,null))[_0x723f('0x46')](handleError(_0xb989ed,null));};exports[_0x723f('0x63')]=function(_0x1dffb8,_0x316ebd,_0x51fd70){var _0x7e1bb0=_0x1dffb8[_0x723f('0x4c')]['ids'];return db[_0x723f('0x62')][_0x723f('0x64')]({'where':{'id':_0x7e1bb0},'attributes':['id'],'include':[{'model':db[_0x723f('0x58')],'as':_0x723f('0x65'),'attributes':['id',_0x723f('0x2b'),_0x723f('0x66'),_0x723f('0x67'),'interface'],'raw':!![]}]})[_0x723f('0x26')](function(_0x510ad6){if(_0x510ad6){var _0x30f6a0=_[_0x723f('0x68')](_0x510ad6,function(_0x3742a3){var _0x393f5b=_0x3742a3['get']({'plain':!![]});return _0x393f5b[_0x723f('0x65')];});return db[_0x723f('0x2f')][_0x723f('0x4a')]({'where':{'id':_0x1dffb8[_0x723f('0x48')]['id']}})[_0x723f('0x26')](function(_0x37e84a){return db[_0x723f('0x69')][_0x723f('0x6a')](function(_0x46c0d2){return _0x37e84a[_0x723f('0x63')](_0x7e1bb0,{'transaction':_0x46c0d2})[_0x723f('0x26')](function(){return BPromise[_0x723f('0x6b')](_0x30f6a0,function(_0x18c9aa){return db[_0x723f('0x55')]['findOrCreate']({'where':{'UserId':_0x18c9aa['id'],'OpenchannelQueueId':_0x1dffb8[_0x723f('0x48')]['id']},'transaction':_0x46c0d2});});})['then'](function(){_0x30f6a0['forEach'](function(_0x575225){socket[_0x723f('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x575225['id'],'OpenchannelQueueId':_0x37e84a['id']});});});});});}})[_0x723f('0x26')](respondWithStatusCode(_0x316ebd,null))[_0x723f('0x46')](handleError(_0x316ebd,null));};exports[_0x723f('0x6d')]=function(_0x5aad52,_0x2626d9,_0x291805){return db[_0x723f('0x62')][_0x723f('0x64')]({'where':{'id':_0x5aad52[_0x723f('0x33')][_0x723f('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x723f('0x58')],'as':_0x723f('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2626d9,null))[_0x723f('0x26')](function(_0x2a0d62){var _0x658ddc=_[_0x723f('0x2e')](_0x2a0d62,'id');var _0x2749f9=[];var _0x55ec8d=[];var _0x58e1b9=squel[_0x723f('0x6f')]();_0x58e1b9[_0x723f('0x70')](_0x723f('0x71'))['from'](_0x723f('0x72'),'tq')[_0x723f('0x73')](_0x723f('0x74'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x723f('0x3d')](_0x723f('0x75'),_0x5aad52['params']['id']);for(var _0x9d67b0=0x0;_0x9d67b0<_0x2a0d62['length'];_0x9d67b0+=0x1){let _0x2576b8=_0x2a0d62[_0x9d67b0];for(var _0x29c927=0x0;_0x29c927<_0x2576b8['Agents'][_0x723f('0x39')];_0x29c927+=0x1){let _0x3bf3c6=_0x2576b8[_0x723f('0x65')][_0x29c927];var _0x554835=_0x58e1b9[_0x723f('0x76')]();_0x554835[_0x723f('0x3d')]('ut.UserId\x20=\x20?',_0x3bf3c6['id']);_0x55ec8d[_0x723f('0x77')](db[_0x723f('0x69')][_0x723f('0x33')](_0x554835[_0x723f('0x78')](),{'type':db['sequelize'][_0x723f('0x79')][_0x723f('0x7a')]})[_0x723f('0x26')](function(_0x404ef1){if(_0x404ef1[_0x723f('0x39')]===0x1){return _0x3bf3c6['id'];}else{var _0xf21d96=_[_0x723f('0x7b')](_[_0x723f('0x2e')](_0x404ef1,'TeamId'),function(_0x1f130e){return _[_0x723f('0x7c')](_0x658ddc,_0x1f130e);});if(_0xf21d96){return _0x3bf3c6['id'];}}}));}}return BPromise[_0x723f('0x7d')](_0x55ec8d)[_0x723f('0x26')](function(_0x543da9){_0x2749f9=_(_0x2749f9)[_0x723f('0x7e')](_0x543da9)[_0x723f('0x7f')]()[_0x723f('0x80')]();return db[_0x723f('0x2f')]['find']({'where':{'id':_0x5aad52['params']['id']}})[_0x723f('0x26')](function(_0x17205f){return db['sequelize'][_0x723f('0x6a')](function(_0x5f3ae1){return _0x17205f['removeTeams'](_0x5aad52['query'][_0x723f('0x6e')],{'transaction':_0x5f3ae1})[_0x723f('0x26')](function(){if(!_[_0x723f('0x81')](_0x2749f9)){return _0x17205f[_0x723f('0x82')](_0x2749f9,{'transaction':_0x5f3ae1});}})[_0x723f('0x26')](function(){_0x2749f9[_0x723f('0x83')](function(_0x59f2c1){socket[_0x723f('0x6c')]('userOpenchannelQueue:remove',{'UserId':_0x59f2c1,'OpenchannelQueueId':_0x17205f['id']});});});});});});})[_0x723f('0x26')](respondWithStatusCode(_0x2626d9,null))[_0x723f('0x46')](handleError(_0x2626d9,null));};exports[_0x723f('0x84')]=function(_0x51a52c,_0x43358b,_0x3a1962){return db[_0x723f('0x2f')][_0x723f('0x4a')]({'where':{'id':_0x51a52c[_0x723f('0x48')]['id']}})[_0x723f('0x26')](handleEntityNotFound(_0x43358b,null))['then'](function(_0x49ddd4){if(_0x49ddd4){return _0x49ddd4[_0x723f('0x84')](_0x51a52c[_0x723f('0x4c')]['ids'],_[_0x723f('0x85')](_0x51a52c[_0x723f('0x4c')],[_0x723f('0x6e'),'id'])||{})[_0x723f('0x86')](function(_0x2d8d8c){for(var _0x25a5a7=0x0;_0x25a5a7<_0x51a52c['body'][_0x723f('0x6e')][_0x723f('0x39')];_0x25a5a7+=0x1){socket[_0x723f('0x6c')](_0x723f('0x87'),{'UserId':Number(_0x51a52c[_0x723f('0x4c')][_0x723f('0x6e')][_0x25a5a7]),'OpenchannelQueueId':Number(_0x51a52c['params']['id'])});}return _0x2d8d8c;});}})[_0x723f('0x26')](respondWithResult(_0x43358b,null))['catch'](handleError(_0x43358b,null));};exports[_0x723f('0x82')]=function(_0x38cbac,_0x4602f8,_0x39f84f){return db[_0x723f('0x2f')][_0x723f('0x4a')]({'where':{'id':_0x38cbac[_0x723f('0x48')]['id']}})[_0x723f('0x26')](handleEntityNotFound(_0x4602f8,null))[_0x723f('0x26')](function(_0x988101){if(_0x988101){return _0x988101[_0x723f('0x82')](_0x38cbac['query'][_0x723f('0x6e')])[_0x723f('0x26')](function(){if(_[_0x723f('0x88')](_0x38cbac[_0x723f('0x33')][_0x723f('0x6e')])){for(var _0x41de7b=0x0;_0x41de7b<_0x38cbac[_0x723f('0x33')][_0x723f('0x6e')][_0x723f('0x39')];_0x41de7b+=0x1){socket[_0x723f('0x6c')](_0x723f('0x89'),{'UserId':Number(_0x38cbac['query'][_0x723f('0x6e')][_0x41de7b]),'OpenchannelQueueId':Number(_0x38cbac[_0x723f('0x48')]['id'])});}}else{socket[_0x723f('0x6c')](_0x723f('0x89'),{'UserId':Number(_0x38cbac[_0x723f('0x33')]['ids']),'OpenchannelQueueId':Number(_0x38cbac[_0x723f('0x48')]['id'])});}});}})[_0x723f('0x26')](respondWithStatusCode(_0x4602f8,null))[_0x723f('0x46')](handleError(_0x4602f8,null));};exports[_0x723f('0x8a')]=function(_0xc5b2e4,_0x40a270,_0x59afcd){var _0x9c96e7={};var _0x1b821c={};var _0x25bd36;var _0x1892c3;return db[_0x723f('0x2f')][_0x723f('0x61')]({'where':{'id':_0xc5b2e4[_0x723f('0x48')]['id']}})[_0x723f('0x26')](handleEntityNotFound(_0x40a270,null))[_0x723f('0x26')](function(_0x334d4b){if(_0x334d4b){_0x25bd36=_0x334d4b;_0x1b821c[_0x723f('0x32')]=_['keys'](db[_0x723f('0x58')][_0x723f('0x30')]);_0x1b821c['query']=_[_0x723f('0x34')](_0xc5b2e4[_0x723f('0x33')]);_0x1b821c[_0x723f('0x35')]=_[_0x723f('0x36')](_0x1b821c[_0x723f('0x32')],_0x1b821c[_0x723f('0x33')]);_0x9c96e7[_0x723f('0x37')]=_[_0x723f('0x36')](_0x1b821c['model'],qs[_0x723f('0x38')](_0xc5b2e4[_0x723f('0x33')]['fields']));_0x9c96e7[_0x723f('0x37')]=_0x9c96e7[_0x723f('0x37')][_0x723f('0x39')]?_0x9c96e7[_0x723f('0x37')]:_0x1b821c[_0x723f('0x32')];_0x9c96e7['order']=qs[_0x723f('0x3c')](_0xc5b2e4['query'][_0x723f('0x3c')]);_0x9c96e7[_0x723f('0x3d')]=qs[_0x723f('0x35')](_[_0x723f('0x3e')](_0xc5b2e4[_0x723f('0x33')],_0x1b821c[_0x723f('0x35')]));if(_0xc5b2e4[_0x723f('0x33')][_0x723f('0x42')]){_0x9c96e7[_0x723f('0x3d')]=_[_0x723f('0x3f')](_0x9c96e7['where'],{'$or':_[_0x723f('0x2e')](_0x9c96e7[_0x723f('0x37')],function(_0x570b77){var _0x4be654={};_0x4be654[_0x570b77]={'$like':'%'+_0xc5b2e4['query'][_0x723f('0x42')]+'%'};return _0x4be654;})});}_0x9c96e7=_[_0x723f('0x3f')]({},_0x9c96e7,_0xc5b2e4['options']);return _0x25bd36[_0x723f('0x8a')](_0x9c96e7);}})['then'](function(_0x178bf3){if(_0x178bf3){_0x1892c3=_0x178bf3[_0x723f('0x39')];if(!_0xc5b2e4['query']['hasOwnProperty'](_0x723f('0x3b'))){_0x9c96e7[_0x723f('0x1f')]=qs['limit'](_0xc5b2e4[_0x723f('0x33')][_0x723f('0x1f')]);_0x9c96e7[_0x723f('0x1c')]=qs['offset'](_0xc5b2e4['query']['offset']);}return _0x25bd36[_0x723f('0x8a')](_0x9c96e7);}})[_0x723f('0x26')](function(_0x5eb6b8){if(_0x5eb6b8){return _0x5eb6b8?{'count':_0x1892c3,'rows':_0x5eb6b8}:null;}})['then'](respondWithResult(_0x40a270,null))[_0x723f('0x46')](handleError(_0x40a270,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e7ed3d9..d9c69d4 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 _0xd583=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x51042b,_0x12cca8){var _0x450779=function(_0x394dbc){while(--_0x394dbc){_0x51042b['push'](_0x51042b['shift']());}};_0x450779(++_0x12cca8);}(_0xd583,0x1c7));var _0x3d58=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0xd583[_0x533110];return _0xc3c866;};'use strict';var EventEmitter=require(_0x3d58('0x0'));var OpenchannelQueue=require(_0x3d58('0x1'))['db'][_0x3d58('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3d58('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d58('0x4'),'afterDestroy':_0x3d58('0x5')};function emitEvent(_0x48a28b){return function(_0x4dac22,_0x40a372,_0x2ff515){OpenchannelQueueEvents[_0x3d58('0x6')](_0x48a28b+':'+_0x4dac22['id'],_0x4dac22);OpenchannelQueueEvents[_0x3d58('0x6')](_0x48a28b,_0x4dac22);_0x2ff515(null);};}for(var e in events){if(events[_0x3d58('0x7')](e)){var event=events[e];OpenchannelQueue[_0x3d58('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x749a=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x291c99,_0x593edb){var _0x1b7c08=function(_0x3c9960){while(--_0x3c9960){_0x291c99['push'](_0x291c99['shift']());}};_0x1b7c08(++_0x593edb);}(_0x749a,0x135));var _0xa749=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x749a[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xa749('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa749('0x1')](0x0);var events={'afterCreate':_0xa749('0x2'),'afterUpdate':_0xa749('0x3'),'afterDestroy':_0xa749('0x4')};function emitEvent(_0x5d5c24){return function(_0x2f365c,_0x425c54,_0x592b2c){OpenchannelQueueEvents[_0xa749('0x5')](_0x5d5c24+':'+_0x2f365c['id'],_0x2f365c);OpenchannelQueueEvents[_0xa749('0x5')](_0x5d5c24,_0x2f365c);_0x592b2c(null);};}for(var e in events){if(events[_0xa749('0x6')](e)){var event=events[e];OpenchannelQueue[_0xa749('0x7')](e,emitEvent(event));}}module[_0xa749('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 49f313f..8622908 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 _0x0df7=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues'];(function(_0x4b0e17,_0x115014){var _0x1a9a90=function(_0x2dbbc4){while(--_0x2dbbc4){_0x4b0e17['push'](_0x4b0e17['shift']());}};_0x1a9a90(++_0x115014);}(_0x0df7,0x1bc));var _0x70df=function(_0x57d553,_0x11df2){_0x57d553=_0x57d553-0x0;var _0x45bdd4=_0x0df7[_0x57d553];return _0x45bdd4;};'use strict';var _=require(_0x70df('0x0'));var util=require('util');var logger=require(_0x70df('0x1'))(_0x70df('0x2'));var moment=require(_0x70df('0x3'));var BPromise=require('bluebird');var rp=require(_0x70df('0x4'));var fs=require('fs');var path=require(_0x70df('0x5'));var rimraf=require(_0x70df('0x6'));var config=require(_0x70df('0x7'));var attributes=require(_0x70df('0x8'));module['exports']=function(_0x32c33d,_0x330ecd){return _0x32c33d[_0x70df('0x9')](_0x70df('0xa'),attributes,{'tableName':_0x70df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf03b=['bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','api','moment'];(function(_0x30c23c,_0x643d71){var _0x16c2dd=function(_0x4bb1a0){while(--_0x4bb1a0){_0x30c23c['push'](_0x30c23c['shift']());}};_0x16c2dd(++_0x643d71);}(_0xf03b,0xb8));var _0xbf03=function(_0x1f9344,_0x56a893){_0x1f9344=_0x1f9344-0x0;var _0x683225=_0xf03b[_0x1f9344];return _0x683225;};'use strict';var _=require(_0xbf03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbf03('0x1'));var moment=require(_0xbf03('0x2'));var BPromise=require(_0xbf03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf03('0x4'));var rimraf=require(_0xbf03('0x5'));var config=require(_0xbf03('0x6'));var attributes=require(_0xbf03('0x7'));module[_0xbf03('0x8')]=function(_0x9376eb,_0x4ef717){return _0x9376eb['define'](_0xbf03('0x9'),attributes,{'tableName':_0xbf03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 42fe94f..a69d638 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 _0x492f=['model','map','ShowOpenchannelQueue','find','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','include'];(function(_0xaaea17,_0x41dab2){var _0x29a24b=function(_0x179848){while(--_0x179848){_0xaaea17['push'](_0xaaea17['shift']());}};_0x29a24b(++_0x41dab2);}(_0x492f,0x146));var _0xf492=function(_0x8b2d2e,_0x50ed7b){_0x8b2d2e=_0x8b2d2e-0x0;var _0x1c05b4=_0x492f[_0x8b2d2e];return _0x1c05b4;};'use strict';var _=require(_0xf492('0x0'));var util=require(_0xf492('0x1'));var moment=require(_0xf492('0x2'));var BPromise=require(_0xf492('0x3'));var rs=require(_0xf492('0x4'));var fs=require('fs');var Redis=require(_0xf492('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf492('0x6'));var logger=require(_0xf492('0x7'))(_0xf492('0x8'));var config=require(_0xf492('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf492('0xa')][_0xf492('0xb')]({'port':0x232a});config[_0xf492('0xc')]=_[_0xf492('0xd')](config[_0xf492('0xc')],{'host':_0xf492('0xe'),'port':0x18eb});var socket=require(_0xf492('0xf'))(new Redis(config[_0xf492('0xc')]));require(_0xf492('0x10'))['register'](socket);function respondWithRpcPromise(_0x8f6dfe,_0x16536a,_0x40a152){return new BPromise(function(_0x27b3e2,_0x294241){return client[_0xf492('0x11')](_0x8f6dfe,_0x40a152)[_0xf492('0x12')](function(_0x40db57){logger[_0xf492('0x13')](_0xf492('0x14'),_0x16536a,_0xf492('0x15'));logger[_0xf492('0x16')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x16536a,_0xf492('0x15'),JSON['stringify'](_0x40db57));if(_0x40db57[_0xf492('0x17')]){if(_0x40db57[_0xf492('0x17')][_0xf492('0x18')]===0x1f4){logger[_0xf492('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x16536a,_0x40db57[_0xf492('0x17')][_0xf492('0x19')]);return _0x294241(_0x40db57['error'][_0xf492('0x19')]);}logger[_0xf492('0x17')](_0xf492('0x14'),_0x16536a,_0x40db57[_0xf492('0x17')]['message']);return _0x27b3e2(_0x40db57[_0xf492('0x17')]['message']);}else{logger['info'](_0xf492('0x14'),_0x16536a,'request\x20sent');_0x27b3e2(_0x40db57['result'][_0xf492('0x19')]);}})[_0xf492('0x1a')](function(_0xa2f7ca){logger['error'](_0xf492('0x14'),_0x16536a,_0xa2f7ca);_0x294241(_0xa2f7ca);});});}exports[_0xf492('0x1b')]=function(_0x505317){var _0x4fe691=this;return new Promise(function(_0x834c23,_0x468fe0){return db[_0xf492('0x1c')][_0xf492('0x1d')]({'raw':_0x505317[_0xf492('0x1e')]?_0x505317[_0xf492('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x505317[_0xf492('0x1e')]?_0x505317[_0xf492('0x1e')][_0xf492('0x1f')]||null:null,'attributes':_0x505317[_0xf492('0x1e')]?_0x505317[_0xf492('0x1e')][_0xf492('0x20')]||null:null,'limit':_0x505317[_0xf492('0x1e')]?_0x505317['options']['limit']||null:null,'include':_0x505317['options']?_0x505317[_0xf492('0x1e')][_0xf492('0x21')]?_['map'](_0x505317[_0xf492('0x1e')][_0xf492('0x21')],function(_0x3e1aa2){return{'model':db[_0x3e1aa2[_0xf492('0x22')]],'as':_0x3e1aa2['as'],'attributes':_0x3e1aa2[_0xf492('0x20')],'include':_0x3e1aa2[_0xf492('0x21')]?_['map'](_0x3e1aa2[_0xf492('0x21')],function(_0x345981){return{'model':db[_0x345981['model']],'as':_0x345981['as'],'attributes':_0x345981[_0xf492('0x20')],'include':_0x345981[_0xf492('0x21')]?_[_0xf492('0x23')](_0x345981[_0xf492('0x21')],function(_0x92db73){return{'model':db[_0x92db73[_0xf492('0x22')]],'as':_0x92db73['as'],'attributes':_0x92db73['attributes']};}):[]};}):[]};}):[]:[]})[_0xf492('0x12')](function(_0x513cfc){logger['info'](_0xf492('0x1b'),_0x505317);logger[_0xf492('0x16')](_0xf492('0x1b'),_0x505317,JSON['stringify'](_0x513cfc));_0x834c23(_0x513cfc);})['catch'](function(_0x55e963){logger[_0xf492('0x17')](_0xf492('0x1b'),_0x55e963[_0xf492('0x19')],_0x505317);_0x468fe0(_0x4fe691['error'](0x1f4,_0x55e963[_0xf492('0x19')]));});});};exports[_0xf492('0x24')]=function(_0x541ad6){var _0x2c7d1a=this;return new Promise(function(_0x178b4c,_0x27a9f6){return db[_0xf492('0x1c')][_0xf492('0x25')]({'raw':_0x541ad6[_0xf492('0x1e')]?_0x541ad6[_0xf492('0x1e')][_0xf492('0x26')]===undefined?!![]:![]:!![],'where':_0x541ad6[_0xf492('0x1e')]?_0x541ad6['options']['where']||null:null,'attributes':_0x541ad6[_0xf492('0x1e')]?_0x541ad6[_0xf492('0x1e')][_0xf492('0x20')]||null:null,'include':_0x541ad6[_0xf492('0x1e')]?_0x541ad6[_0xf492('0x1e')][_0xf492('0x21')]?_[_0xf492('0x23')](_0x541ad6['options'][_0xf492('0x21')],function(_0xb06b48){return{'model':db[_0xb06b48[_0xf492('0x22')]],'as':_0xb06b48['as'],'attributes':_0xb06b48[_0xf492('0x20')],'include':_0xb06b48[_0xf492('0x21')]?_[_0xf492('0x23')](_0xb06b48[_0xf492('0x21')],function(_0xf8361){return{'model':db[_0xf8361[_0xf492('0x22')]],'as':_0xf8361['as'],'attributes':_0xf8361[_0xf492('0x20')],'include':_0xf8361[_0xf492('0x21')]?_[_0xf492('0x23')](_0xf8361['include'],function(_0x8cb971){return{'model':db[_0x8cb971[_0xf492('0x22')]],'as':_0x8cb971['as'],'attributes':_0x8cb971[_0xf492('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5164c1){logger[_0xf492('0x13')](_0xf492('0x24'),_0x541ad6);logger['debug'](_0xf492('0x24'),_0x541ad6,JSON[_0xf492('0x27')](_0x5164c1));_0x178b4c(_0x5164c1);})[_0xf492('0x1a')](function(_0x16c2f5){logger[_0xf492('0x17')](_0xf492('0x24'),_0x16c2f5[_0xf492('0x19')],_0x541ad6);_0x27a9f6(_0x2c7d1a[_0xf492('0x17')](0x1f4,_0x16c2f5[_0xf492('0x19')]));});});}; \ No newline at end of file +var _0x5bc0=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','catch','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x511a19,_0x417e36){var _0x499aa6=function(_0x270874){while(--_0x270874){_0x511a19['push'](_0x511a19['shift']());}};_0x499aa6(++_0x417e36);}(_0x5bc0,0x144));var _0x05bc=function(_0x56e028,_0x3e7924){_0x56e028=_0x56e028-0x0;var _0x4af25e=_0x5bc0[_0x56e028];return _0x4af25e;};'use strict';var _=require(_0x05bc('0x0'));var util=require(_0x05bc('0x1'));var moment=require(_0x05bc('0x2'));var BPromise=require(_0x05bc('0x3'));var rs=require(_0x05bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05bc('0x5'))['db'];var utils=require(_0x05bc('0x6'));var logger=require(_0x05bc('0x7'))(_0x05bc('0x8'));var config=require(_0x05bc('0x9'));var jayson=require(_0x05bc('0xa'));var client=jayson['client'][_0x05bc('0xb')]({'port':0x232a});config[_0x05bc('0xc')]=_[_0x05bc('0xd')](config[_0x05bc('0xc')],{'host':_0x05bc('0xe'),'port':0x18eb});var socket=require(_0x05bc('0xf'))(new Redis(config[_0x05bc('0xc')]));require(_0x05bc('0x10'))[_0x05bc('0x11')](socket);function respondWithRpcPromise(_0x37df32,_0xc11a07,_0x1175ab){return new BPromise(function(_0x3f7444,_0x33a4f7){return client[_0x05bc('0x12')](_0x37df32,_0x1175ab)[_0x05bc('0x13')](function(_0x5d9be1){logger[_0x05bc('0x14')](_0x05bc('0x15'),_0xc11a07,_0x05bc('0x16'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xc11a07,_0x05bc('0x16'),JSON[_0x05bc('0x17')](_0x5d9be1));if(_0x5d9be1[_0x05bc('0x18')]){if(_0x5d9be1[_0x05bc('0x18')][_0x05bc('0x19')]===0x1f4){logger[_0x05bc('0x18')](_0x05bc('0x15'),_0xc11a07,_0x5d9be1[_0x05bc('0x18')][_0x05bc('0x1a')]);return _0x33a4f7(_0x5d9be1['error'][_0x05bc('0x1a')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0xc11a07,_0x5d9be1[_0x05bc('0x18')][_0x05bc('0x1a')]);return _0x3f7444(_0x5d9be1[_0x05bc('0x18')][_0x05bc('0x1a')]);}else{logger[_0x05bc('0x14')](_0x05bc('0x15'),_0xc11a07,_0x05bc('0x16'));_0x3f7444(_0x5d9be1['result'][_0x05bc('0x1a')]);}})['catch'](function(_0x356f0e){logger['error'](_0x05bc('0x15'),_0xc11a07,_0x356f0e);_0x33a4f7(_0x356f0e);});});}exports[_0x05bc('0x1b')]=function(_0x1df002){var _0x1a08cd=this;return new Promise(function(_0x4685e2,_0x47eb9e){return db[_0x05bc('0x1c')][_0x05bc('0x1d')]({'raw':_0x1df002[_0x05bc('0x1e')]?_0x1df002[_0x05bc('0x1e')][_0x05bc('0x1f')]===undefined?!![]:![]:!![],'where':_0x1df002[_0x05bc('0x1e')]?_0x1df002[_0x05bc('0x1e')][_0x05bc('0x20')]||null:null,'attributes':_0x1df002['options']?_0x1df002['options'][_0x05bc('0x21')]||null:null,'limit':_0x1df002[_0x05bc('0x1e')]?_0x1df002[_0x05bc('0x1e')][_0x05bc('0x22')]||null:null,'include':_0x1df002[_0x05bc('0x1e')]?_0x1df002['options']['include']?_[_0x05bc('0x23')](_0x1df002[_0x05bc('0x1e')][_0x05bc('0x24')],function(_0x5bb9d7){return{'model':db[_0x5bb9d7[_0x05bc('0x25')]],'as':_0x5bb9d7['as'],'attributes':_0x5bb9d7[_0x05bc('0x21')],'include':_0x5bb9d7['include']?_['map'](_0x5bb9d7[_0x05bc('0x24')],function(_0x30b51f){return{'model':db[_0x30b51f[_0x05bc('0x25')]],'as':_0x30b51f['as'],'attributes':_0x30b51f[_0x05bc('0x21')],'include':_0x30b51f['include']?_[_0x05bc('0x23')](_0x30b51f[_0x05bc('0x24')],function(_0x14ef9f){return{'model':db[_0x14ef9f[_0x05bc('0x25')]],'as':_0x14ef9f['as'],'attributes':_0x14ef9f[_0x05bc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55c9fa){logger[_0x05bc('0x14')]('GetOpenchannelQueue',_0x1df002);logger[_0x05bc('0x26')]('GetOpenchannelQueue',_0x1df002,JSON[_0x05bc('0x17')](_0x55c9fa));_0x4685e2(_0x55c9fa);})[_0x05bc('0x27')](function(_0x3ee25b){logger[_0x05bc('0x18')](_0x05bc('0x1b'),_0x3ee25b['message'],_0x1df002);_0x47eb9e(_0x1a08cd['error'](0x1f4,_0x3ee25b[_0x05bc('0x1a')]));});});};exports[_0x05bc('0x28')]=function(_0x323d7d){var _0x22e38b=this;return new Promise(function(_0x4da603,_0x433204){return db[_0x05bc('0x1c')][_0x05bc('0x29')]({'raw':_0x323d7d[_0x05bc('0x1e')]?_0x323d7d[_0x05bc('0x1e')][_0x05bc('0x1f')]===undefined?!![]:![]:!![],'where':_0x323d7d[_0x05bc('0x1e')]?_0x323d7d[_0x05bc('0x1e')][_0x05bc('0x20')]||null:null,'attributes':_0x323d7d[_0x05bc('0x1e')]?_0x323d7d[_0x05bc('0x1e')]['attributes']||null:null,'include':_0x323d7d[_0x05bc('0x1e')]?_0x323d7d['options']['include']?_[_0x05bc('0x23')](_0x323d7d[_0x05bc('0x1e')][_0x05bc('0x24')],function(_0x50e3a8){return{'model':db[_0x50e3a8[_0x05bc('0x25')]],'as':_0x50e3a8['as'],'attributes':_0x50e3a8[_0x05bc('0x21')],'include':_0x50e3a8[_0x05bc('0x24')]?_[_0x05bc('0x23')](_0x50e3a8[_0x05bc('0x24')],function(_0x1a1a23){return{'model':db[_0x1a1a23[_0x05bc('0x25')]],'as':_0x1a1a23['as'],'attributes':_0x1a1a23[_0x05bc('0x21')],'include':_0x1a1a23['include']?_['map'](_0x1a1a23['include'],function(_0x3f4a99){return{'model':db[_0x3f4a99['model']],'as':_0x3f4a99['as'],'attributes':_0x3f4a99[_0x05bc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f5c0f){logger['info'](_0x05bc('0x28'),_0x323d7d);logger[_0x05bc('0x26')]('ShowOpenchannelQueue',_0x323d7d,JSON[_0x05bc('0x17')](_0x4f5c0f));_0x4da603(_0x4f5c0f);})[_0x05bc('0x27')](function(_0x34bf38){logger['error'](_0x05bc('0x28'),_0x34bf38[_0x05bc('0x1a')],_0x323d7d);_0x433204(_0x22e38b[_0x05bc('0x18')](0x1f4,_0x34bf38[_0x05bc('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d32f1b8..6900dae 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 _0xc81e=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x2e24c5,_0x14f847){var _0x2b8936=function(_0x2fd397){while(--_0x2fd397){_0x2e24c5['push'](_0x2e24c5['shift']());}};_0x2b8936(++_0x14f847);}(_0xc81e,0x78));var _0xec81=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc81e[_0x46aff0];return _0x9d78cf;};'use strict';var OpenchannelQueueEvents=require(_0xec81('0x0'));var events=[_0xec81('0x1'),_0xec81('0x2'),_0xec81('0x3')];function createListener(_0x19b701,_0x47b0f1){return function(_0x5abf55){_0x47b0f1[_0xec81('0x4')](_0x19b701,_0x5abf55);};}function removeListener(_0x44a68d,_0x48becb){return function(){OpenchannelQueueEvents[_0xec81('0x5')](_0x44a68d,_0x48becb);};}exports[_0xec81('0x6')]=function(_0x36576e){for(var _0x120bb1=0x0,_0x1ce0b7=events[_0xec81('0x7')];_0x120bb1<_0x1ce0b7;_0x120bb1++){var _0x529c36=events[_0x120bb1];var _0x4b2b5c=createListener(_0xec81('0x8')+_0x529c36,_0x36576e);OpenchannelQueueEvents['on'](_0x529c36,_0x4b2b5c);}}; \ No newline at end of file +var _0x2b82=['./openchannelQueue.events','update','emit','removeListener','register','length','openchannelQueue:'];(function(_0x1685f1,_0x1a418d){var _0x5c0c79=function(_0x4b036c){while(--_0x4b036c){_0x1685f1['push'](_0x1685f1['shift']());}};_0x5c0c79(++_0x1a418d);}(_0x2b82,0x1b9));var _0x22b8=function(_0x441b4c,_0x3768c8){_0x441b4c=_0x441b4c-0x0;var _0x3f3a5c=_0x2b82[_0x441b4c];return _0x3f3a5c;};'use strict';var OpenchannelQueueEvents=require(_0x22b8('0x0'));var events=['save','remove',_0x22b8('0x1')];function createListener(_0x540a1c,_0x5d0149){return function(_0x52be01){_0x5d0149[_0x22b8('0x2')](_0x540a1c,_0x52be01);};}function removeListener(_0x3e19fe,_0xa6c54){return function(){OpenchannelQueueEvents[_0x22b8('0x3')](_0x3e19fe,_0xa6c54);};}exports[_0x22b8('0x4')]=function(_0x3458a0){for(var _0x3270e3=0x0,_0x4a7dce=events[_0x22b8('0x5')];_0x3270e3<_0x4a7dce;_0x3270e3++){var _0xcfe186=events[_0x3270e3];var _0x35891f=createListener(_0x22b8('0x6')+_0xcfe186,_0x3458a0);OpenchannelQueueEvents['on'](_0xcfe186,_0x35891f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 93cbf36..bd40a7c 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 _0x2a75=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x4e9b1f,_0x305d28){var _0x5aad4c=function(_0x2ee5e9){while(--_0x2ee5e9){_0x4e9b1f['push'](_0x4e9b1f['shift']());}};_0x5aad4c(++_0x305d28);}(_0x2a75,0x196));var _0x52a7=function(_0x2de540,_0x4a69da){_0x2de540=_0x2de540-0x0;var _0xd0f2d8=_0x2a75[_0x2de540];return _0xd0f2d8;};'use strict';var multer=require(_0x52a7('0x0'));var util=require(_0x52a7('0x1'));var path=require(_0x52a7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x52a7('0x3')]();var fs_extra=require(_0x52a7('0x4'));var auth=require(_0x52a7('0x5'));var interaction=require(_0x52a7('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0x52a7('0x7')]('/',auth[_0x52a7('0x8')](),controller[_0x52a7('0x9')]);router[_0x52a7('0x7')](_0x52a7('0xa'),auth[_0x52a7('0x8')](),controller[_0x52a7('0xb')]);router[_0x52a7('0x7')](_0x52a7('0xc'),auth[_0x52a7('0x8')](),controller[_0x52a7('0xd')]);router['post']('/',auth[_0x52a7('0x8')](),controller[_0x52a7('0xe')]);router[_0x52a7('0xf')](_0x52a7('0xc'),auth[_0x52a7('0x8')](),controller['update']);router[_0x52a7('0x10')](_0x52a7('0xc'),auth[_0x52a7('0x8')](),controller['destroy']);module[_0x52a7('0x11')]=router; \ No newline at end of file +var _0xbf8f=['get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xbf8f,0x15d));var _0xfbf8=function(_0x40e222,_0x43284c){_0x40e222=_0x40e222-0x0;var _0x36f57f=_0xbf8f[_0x40e222];return _0x36f57f;};'use strict';var multer=require('multer');var util=require(_0xfbf8('0x0'));var path=require(_0xfbf8('0x1'));var timeout=require(_0xfbf8('0x2'));var express=require(_0xfbf8('0x3'));var router=express[_0xfbf8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfbf8('0x5'));var interaction=require(_0xfbf8('0x6'));var config=require('../../config/environment');var controller=require(_0xfbf8('0x7'));router[_0xfbf8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfbf8('0x8')](_0xfbf8('0x9'),auth[_0xfbf8('0xa')](),controller[_0xfbf8('0xb')]);router['get'](_0xfbf8('0xc'),auth['isAuthenticated'](),controller[_0xfbf8('0xd')]);router[_0xfbf8('0xe')]('/',auth[_0xfbf8('0xa')](),controller[_0xfbf8('0xf')]);router[_0xfbf8('0x10')](_0xfbf8('0xc'),auth['isAuthenticated'](),controller[_0xfbf8('0x11')]);router[_0xfbf8('0x12')](_0xfbf8('0xc'),auth['isAuthenticated'](),controller[_0xfbf8('0x13')]);module[_0xfbf8('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index fdd9777..cb08cd0 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 _0x8f13=['STRING','DATE','moment','sequelize','exports'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x8f13,0x1b0));var _0x38f1=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x8f13[_0x5ca5bc];return _0x26ca86;};'use strict';var moment=require(_0x38f1('0x0'));var Sequelize=require(_0x38f1('0x1'));module[_0x38f1('0x2')]={'uniqueid':{'type':Sequelize[_0x38f1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x38f1('0x4')]},'leaveAt':{'type':Sequelize[_0x38f1('0x4')]},'acceptAt':{'type':Sequelize[_0x38f1('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x38f1('0x3')]}}; \ No newline at end of file +var _0x34c3=['DATE','moment','sequelize','exports','STRING'];(function(_0x3a5df9,_0x4f233c){var _0x45eff5=function(_0xdf36ef){while(--_0xdf36ef){_0x3a5df9['push'](_0x3a5df9['shift']());}};_0x45eff5(++_0x4f233c);}(_0x34c3,0x1e1));var _0x334c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x34c3[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0x334c('0x0'));var Sequelize=require(_0x334c('0x1'));module[_0x334c('0x2')]={'uniqueid':{'type':Sequelize[_0x334c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x334c('0x3')]},'joinAt':{'type':Sequelize[_0x334c('0x4')]},'leaveAt':{'type':Sequelize[_0x334c('0x4')]},'acceptAt':{'type':Sequelize[_0x334c('0x4')]},'exitAt':{'type':Sequelize[_0x334c('0x4')]},'reason':{'type':Sequelize[_0x334c('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1ce0d3b..828cb13 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 _0xb734=['mustache','util','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2dbe14,_0x4358a7){var _0x58d3a0=function(_0x441c64){while(--_0x441c64){_0x2dbe14['push'](_0x2dbe14['shift']());}};_0x58d3a0(++_0x4358a7);}(_0xb734,0x1ec));var _0x4b73=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0xb734[_0x3d18af];return _0x2ef919;};'use strict';var emlformat=require(_0x4b73('0x0'));var rimraf=require(_0x4b73('0x1'));var zipdir=require(_0x4b73('0x2'));var jsonpatch=require(_0x4b73('0x3'));var rp=require(_0x4b73('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4b73('0x5'));var util=require(_0x4b73('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4b73('0x7'));var ejs=require(_0x4b73('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4b73('0x9'));var crypto=require(_0x4b73('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4b73('0xb'));var toCsv=require(_0x4b73('0x7'));var querystring=require('querystring');var Papa=require(_0x4b73('0xc'));var Redis=require(_0x4b73('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b73('0xe'));var hardwareService=require(_0x4b73('0xf'));var logger=require(_0x4b73('0x10'))(_0x4b73('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b73('0x12'));var db=require(_0x4b73('0x13'))['db'];function respondWithStatusCode(_0x4e7dab,_0x27b97a){_0x27b97a=_0x27b97a||0xcc;return function(_0x69e6f4){if(_0x69e6f4){return _0x4e7dab['sendStatus'](_0x27b97a);}return _0x4e7dab[_0x4b73('0x14')](_0x27b97a)[_0x4b73('0x15')]();};}function respondWithResult(_0x2ae7c5,_0x17a185){_0x17a185=_0x17a185||0xc8;return function(_0x134133){if(_0x134133){return _0x2ae7c5[_0x4b73('0x14')](_0x17a185)[_0x4b73('0x16')](_0x134133);}};}function respondWithFilteredResult(_0x104acb,_0x2f6750){return function(_0x5a288f){if(_0x5a288f){var _0x26d4cd=typeof _0x2f6750[_0x4b73('0x17')]===_0x4b73('0x18')&&typeof _0x2f6750[_0x4b73('0x19')]===_0x4b73('0x18');var _0x138c98=_0x5a288f[_0x4b73('0x1a')];var _0x1659c4=_0x26d4cd?0x0:_0x2f6750[_0x4b73('0x17')];var _0x1b1db1=_0x26d4cd?_0x5a288f[_0x4b73('0x1a')]:_0x2f6750[_0x4b73('0x17')]+_0x2f6750[_0x4b73('0x19')];var _0x9cded2;if(_0x1b1db1>=_0x138c98){_0x1b1db1=_0x138c98;_0x9cded2=0xc8;}else{_0x9cded2=0xce;}_0x104acb['status'](_0x9cded2);return _0x104acb['set']('Content-Range',_0x1659c4+'-'+_0x1b1db1+'/'+_0x138c98)[_0x4b73('0x16')](_0x5a288f);}return null;};}function patchUpdates(_0x471f16){return function(_0x250fa6){try{jsonpatch[_0x4b73('0x1b')](_0x250fa6,_0x471f16,!![]);}catch(_0x370b60){return BPromise[_0x4b73('0x1c')](_0x370b60);}return _0x250fa6[_0x4b73('0x1d')]();};}function saveUpdates(_0x4d3cb7,_0x2ba27d){return function(_0x5517f9){if(_0x5517f9){return _0x5517f9[_0x4b73('0x1e')](_0x4d3cb7)['then'](function(_0x4e1739){return _0x4e1739;});}return null;};}function removeEntity(_0x4cfe72,_0x1c15ee){return function(_0x47699e){if(_0x47699e){return _0x47699e[_0x4b73('0x1f')]()[_0x4b73('0x20')](function(){_0x4cfe72[_0x4b73('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcf45e4,_0x2878d6){return function(_0x1d6777){if(!_0x1d6777){_0xcf45e4[_0x4b73('0x21')](0x194);}return _0x1d6777;};}function handleError(_0x30ffdf,_0x588c49){_0x588c49=_0x588c49||0x1f4;return function(_0x241111){logger[_0x4b73('0x22')](_0x241111[_0x4b73('0x23')]);if(_0x241111[_0x4b73('0x24')]){delete _0x241111[_0x4b73('0x24')];}_0x30ffdf[_0x4b73('0x14')](_0x588c49)[_0x4b73('0x25')](_0x241111);};}exports[_0x4b73('0x26')]=function(_0x5aaf31,_0x25a3cf){var _0x322920={},_0x472a4d={},_0x50e5ac={'count':0x0,'rows':[]};var _0x1f4a78=_[_0x4b73('0x27')](db[_0x4b73('0x28')]['rawAttributes'],function(_0x4911dd){return{'name':_0x4911dd[_0x4b73('0x29')],'type':_0x4911dd[_0x4b73('0x2a')]['key']};});_0x472a4d[_0x4b73('0x2b')]=_[_0x4b73('0x27')](_0x1f4a78,_0x4b73('0x24'));_0x472a4d[_0x4b73('0x2c')]=_['keys'](_0x5aaf31[_0x4b73('0x2c')]);_0x472a4d['filters']=_['intersection'](_0x472a4d[_0x4b73('0x2b')],_0x472a4d[_0x4b73('0x2c')]);_0x322920[_0x4b73('0x2d')]=_[_0x4b73('0x2e')](_0x472a4d[_0x4b73('0x2b')],qs[_0x4b73('0x2f')](_0x5aaf31[_0x4b73('0x2c')]['fields']));_0x322920[_0x4b73('0x2d')]=_0x322920['attributes'][_0x4b73('0x30')]?_0x322920['attributes']:_0x472a4d[_0x4b73('0x2b')];if(!_0x5aaf31['query'][_0x4b73('0x31')]('nolimit')){_0x322920[_0x4b73('0x19')]=qs[_0x4b73('0x19')](_0x5aaf31[_0x4b73('0x2c')][_0x4b73('0x19')]);_0x322920['offset']=qs['offset'](_0x5aaf31[_0x4b73('0x2c')][_0x4b73('0x17')]);}_0x322920[_0x4b73('0x32')]=qs[_0x4b73('0x33')](_0x5aaf31[_0x4b73('0x2c')][_0x4b73('0x33')]);_0x322920[_0x4b73('0x34')]=qs['filters'](_['pick'](_0x5aaf31[_0x4b73('0x2c')],_0x472a4d[_0x4b73('0x35')]),_0x1f4a78);if(_0x5aaf31[_0x4b73('0x2c')][_0x4b73('0x36')]){_0x322920[_0x4b73('0x34')]=_[_0x4b73('0x37')](_0x322920[_0x4b73('0x34')],{'$or':_[_0x4b73('0x27')](_0x1f4a78,function(_0x104b34){if(_0x104b34[_0x4b73('0x2a')]!==_0x4b73('0x38')){var _0x20e840={};_0x20e840[_0x104b34[_0x4b73('0x24')]]={'$like':'%'+_0x5aaf31[_0x4b73('0x2c')][_0x4b73('0x36')]+'%'};return _0x20e840;}})});}_0x322920=_[_0x4b73('0x37')]({},_0x322920,_0x5aaf31[_0x4b73('0x39')]);var _0x37d841={'where':_0x322920[_0x4b73('0x34')]};return db[_0x4b73('0x28')][_0x4b73('0x1a')](_0x37d841)[_0x4b73('0x20')](function(_0x2edb3f){_0x50e5ac['count']=_0x2edb3f;if(_0x5aaf31['query'][_0x4b73('0x3a')]){_0x322920[_0x4b73('0x3b')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x4b73('0x3c')](_0x322920);})['then'](function(_0x3cce8a){_0x50e5ac[_0x4b73('0x3d')]=_0x3cce8a;return _0x50e5ac;})[_0x4b73('0x20')](respondWithFilteredResult(_0x25a3cf,_0x322920))[_0x4b73('0x3e')](handleError(_0x25a3cf,null));};exports[_0x4b73('0x3f')]=function(_0x2cfdec,_0xfae527){var _0x51b1bc={'raw':!![],'where':{'id':_0x2cfdec['params']['id']}},_0x2b347b={};_0x2b347b['model']=_[_0x4b73('0x40')](db[_0x4b73('0x28')][_0x4b73('0x41')]);_0x2b347b[_0x4b73('0x2c')]=_[_0x4b73('0x40')](_0x2cfdec[_0x4b73('0x2c')]);_0x2b347b['filters']=_['intersection'](_0x2b347b[_0x4b73('0x2b')],_0x2b347b['query']);_0x51b1bc[_0x4b73('0x2d')]=_[_0x4b73('0x2e')](_0x2b347b['model'],qs['fields'](_0x2cfdec[_0x4b73('0x2c')][_0x4b73('0x2f')]));_0x51b1bc[_0x4b73('0x2d')]=_0x51b1bc[_0x4b73('0x2d')][_0x4b73('0x30')]?_0x51b1bc['attributes']:_0x2b347b['model'];if(_0x2cfdec[_0x4b73('0x2c')][_0x4b73('0x3a')]){_0x51b1bc['include']=[{'all':!![]}];}_0x51b1bc=_[_0x4b73('0x37')]({},_0x51b1bc,_0x2cfdec['options']);return db[_0x4b73('0x28')][_0x4b73('0x42')](_0x51b1bc)['then'](handleEntityNotFound(_0xfae527,null))['then'](respondWithResult(_0xfae527,null))['catch'](handleError(_0xfae527,null));};exports[_0x4b73('0x43')]=function(_0x3c5222,_0x1069ec){return db[_0x4b73('0x28')]['create'](_0x3c5222[_0x4b73('0x44')],{})[_0x4b73('0x20')](respondWithResult(_0x1069ec,0xc9))[_0x4b73('0x3e')](handleError(_0x1069ec,null));};exports['update']=function(_0x28f2e1,_0x3e1ad4){if(_0x28f2e1[_0x4b73('0x44')]['id']){delete _0x28f2e1[_0x4b73('0x44')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x28f2e1[_0x4b73('0x45')]['id']}})[_0x4b73('0x20')](handleEntityNotFound(_0x3e1ad4,null))['then'](saveUpdates(_0x28f2e1[_0x4b73('0x44')],null))['then'](respondWithResult(_0x3e1ad4,null))['catch'](handleError(_0x3e1ad4,null));};exports[_0x4b73('0x1f')]=function(_0x5dc331,_0xf74380){return db[_0x4b73('0x28')][_0x4b73('0x42')]({'where':{'id':_0x5dc331[_0x4b73('0x45')]['id']}})[_0x4b73('0x20')](handleEntityNotFound(_0xf74380,null))[_0x4b73('0x20')](removeEntity(_0xf74380,null))[_0x4b73('0x3e')](handleError(_0xf74380,null));};exports[_0x4b73('0x46')]=function(_0x41350b,_0x36b788){return db[_0x4b73('0x28')]['describe']()[_0x4b73('0x20')](respondWithResult(_0x36b788,null))[_0x4b73('0x3e')](handleError(_0x36b788,null));}; \ No newline at end of file +var _0x1a9d=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment'];(function(_0x436b41,_0x26e3d3){var _0xfaa7d0=function(_0x5d054a){while(--_0x5d054a){_0x436b41['push'](_0x436b41['shift']());}};_0xfaa7d0(++_0x26e3d3);}(_0x1a9d,0x10d));var _0xd1a9=function(_0x5099c4,_0x289449){_0x5099c4=_0x5099c4-0x0;var _0x21d3ed=_0x1a9d[_0x5099c4];return _0x21d3ed;};'use strict';var emlformat=require(_0xd1a9('0x0'));var rimraf=require(_0xd1a9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1a9('0x2'));var rp=require(_0xd1a9('0x3'));var moment=require(_0xd1a9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd1a9('0x5'));var util=require('util');var path=require(_0xd1a9('0x6'));var sox=require(_0xd1a9('0x7'));var csv=require(_0xd1a9('0x8'));var ejs=require(_0xd1a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd1a9('0xa'));var squel=require('squel');var crypto=require(_0xd1a9('0xb'));var jsforce=require(_0xd1a9('0xc'));var deskjs=require(_0xd1a9('0xd'));var toCsv=require(_0xd1a9('0x8'));var querystring=require('querystring');var Papa=require(_0xd1a9('0xe'));var Redis=require(_0xd1a9('0xf'));var authService=require(_0xd1a9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd1a9('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd1a9('0x12'));var licenseUtil=require(_0xd1a9('0x13'));var db=require(_0xd1a9('0x14'))['db'];function respondWithStatusCode(_0x1e3ba4,_0x18544a){_0x18544a=_0x18544a||0xcc;return function(_0x2bd31e){if(_0x2bd31e){return _0x1e3ba4[_0xd1a9('0x15')](_0x18544a);}return _0x1e3ba4[_0xd1a9('0x16')](_0x18544a)[_0xd1a9('0x17')]();};}function respondWithResult(_0x44115c,_0x38065c){_0x38065c=_0x38065c||0xc8;return function(_0x5e948e){if(_0x5e948e){return _0x44115c[_0xd1a9('0x16')](_0x38065c)['json'](_0x5e948e);}};}function respondWithFilteredResult(_0x1ae929,_0x4b9b1c){return function(_0x441107){if(_0x441107){var _0x42f6d0=typeof _0x4b9b1c['offset']===_0xd1a9('0x18')&&typeof _0x4b9b1c['limit']==='undefined';var _0x3b0c0a=_0x441107[_0xd1a9('0x19')];var _0x28c270=_0x42f6d0?0x0:_0x4b9b1c[_0xd1a9('0x1a')];var _0x4d4427=_0x42f6d0?_0x441107['count']:_0x4b9b1c[_0xd1a9('0x1a')]+_0x4b9b1c[_0xd1a9('0x1b')];var _0x3c3122;if(_0x4d4427>=_0x3b0c0a){_0x4d4427=_0x3b0c0a;_0x3c3122=0xc8;}else{_0x3c3122=0xce;}_0x1ae929[_0xd1a9('0x16')](_0x3c3122);return _0x1ae929['set'](_0xd1a9('0x1c'),_0x28c270+'-'+_0x4d4427+'/'+_0x3b0c0a)[_0xd1a9('0x1d')](_0x441107);}return null;};}function patchUpdates(_0x4bcc39){return function(_0x18aed6){try{jsonpatch[_0xd1a9('0x1e')](_0x18aed6,_0x4bcc39,!![]);}catch(_0xd689ea){return BPromise[_0xd1a9('0x1f')](_0xd689ea);}return _0x18aed6['save']();};}function saveUpdates(_0x5269fd,_0xb30d46){return function(_0x28bbf3){if(_0x28bbf3){return _0x28bbf3[_0xd1a9('0x20')](_0x5269fd)['then'](function(_0x58fdf7){return _0x58fdf7;});}return null;};}function removeEntity(_0x5db446,_0x15af32){return function(_0x57cff8){if(_0x57cff8){return _0x57cff8['destroy']()[_0xd1a9('0x21')](function(){_0x5db446[_0xd1a9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477b60,_0x4c99d7){return function(_0x70e1df){if(!_0x70e1df){_0x477b60[_0xd1a9('0x15')](0x194);}return _0x70e1df;};}function handleError(_0x529361,_0x143e40){_0x143e40=_0x143e40||0x1f4;return function(_0xb6806d){logger[_0xd1a9('0x22')](_0xb6806d[_0xd1a9('0x23')]);if(_0xb6806d[_0xd1a9('0x24')]){delete _0xb6806d[_0xd1a9('0x24')];}_0x529361['status'](_0x143e40)[_0xd1a9('0x25')](_0xb6806d);};}exports[_0xd1a9('0x26')]=function(_0x2459fb,_0x2e8a9f){var _0x15a2b7={},_0x387b26={},_0x4bba64={'count':0x0,'rows':[]};var _0x1a22b9=_[_0xd1a9('0x27')](db[_0xd1a9('0x28')][_0xd1a9('0x29')],function(_0x17a340){return{'name':_0x17a340[_0xd1a9('0x2a')],'type':_0x17a340[_0xd1a9('0x2b')][_0xd1a9('0x2c')]};});_0x387b26[_0xd1a9('0x2d')]=_[_0xd1a9('0x27')](_0x1a22b9,'name');_0x387b26[_0xd1a9('0x2e')]=_['keys'](_0x2459fb[_0xd1a9('0x2e')]);_0x387b26[_0xd1a9('0x2f')]=_[_0xd1a9('0x30')](_0x387b26[_0xd1a9('0x2d')],_0x387b26[_0xd1a9('0x2e')]);_0x15a2b7[_0xd1a9('0x31')]=_[_0xd1a9('0x30')](_0x387b26['model'],qs['fields'](_0x2459fb[_0xd1a9('0x2e')][_0xd1a9('0x32')]));_0x15a2b7[_0xd1a9('0x31')]=_0x15a2b7[_0xd1a9('0x31')][_0xd1a9('0x33')]?_0x15a2b7[_0xd1a9('0x31')]:_0x387b26[_0xd1a9('0x2d')];if(!_0x2459fb[_0xd1a9('0x2e')]['hasOwnProperty'](_0xd1a9('0x34'))){_0x15a2b7[_0xd1a9('0x1b')]=qs[_0xd1a9('0x1b')](_0x2459fb[_0xd1a9('0x2e')][_0xd1a9('0x1b')]);_0x15a2b7[_0xd1a9('0x1a')]=qs['offset'](_0x2459fb[_0xd1a9('0x2e')]['offset']);}_0x15a2b7[_0xd1a9('0x35')]=qs[_0xd1a9('0x36')](_0x2459fb['query'][_0xd1a9('0x36')]);_0x15a2b7['where']=qs[_0xd1a9('0x2f')](_[_0xd1a9('0x37')](_0x2459fb[_0xd1a9('0x2e')],_0x387b26[_0xd1a9('0x2f')]),_0x1a22b9);if(_0x2459fb[_0xd1a9('0x2e')][_0xd1a9('0x38')]){_0x15a2b7[_0xd1a9('0x39')]=_[_0xd1a9('0x3a')](_0x15a2b7[_0xd1a9('0x39')],{'$or':_[_0xd1a9('0x27')](_0x1a22b9,function(_0x4e69e2){if(_0x4e69e2[_0xd1a9('0x2b')]!=='VIRTUAL'){var _0x785e27={};_0x785e27[_0x4e69e2[_0xd1a9('0x24')]]={'$like':'%'+_0x2459fb[_0xd1a9('0x2e')][_0xd1a9('0x38')]+'%'};return _0x785e27;}})});}_0x15a2b7=_[_0xd1a9('0x3a')]({},_0x15a2b7,_0x2459fb['options']);var _0x164316={'where':_0x15a2b7[_0xd1a9('0x39')]};return db[_0xd1a9('0x28')]['count'](_0x164316)[_0xd1a9('0x21')](function(_0x5d1330){_0x4bba64[_0xd1a9('0x19')]=_0x5d1330;if(_0x2459fb['query']['includeAll']){_0x15a2b7[_0xd1a9('0x3b')]=[{'all':!![]}];}return db[_0xd1a9('0x28')][_0xd1a9('0x3c')](_0x15a2b7);})[_0xd1a9('0x21')](function(_0x9bcd3a){_0x4bba64[_0xd1a9('0x3d')]=_0x9bcd3a;return _0x4bba64;})[_0xd1a9('0x21')](respondWithFilteredResult(_0x2e8a9f,_0x15a2b7))['catch'](handleError(_0x2e8a9f,null));};exports[_0xd1a9('0x3e')]=function(_0x337a6f,_0x1c20d){var _0x4d963f={'raw':!![],'where':{'id':_0x337a6f[_0xd1a9('0x3f')]['id']}},_0x2a74da={};_0x2a74da[_0xd1a9('0x2d')]=_[_0xd1a9('0x40')](db[_0xd1a9('0x28')]['rawAttributes']);_0x2a74da[_0xd1a9('0x2e')]=_[_0xd1a9('0x40')](_0x337a6f[_0xd1a9('0x2e')]);_0x2a74da[_0xd1a9('0x2f')]=_[_0xd1a9('0x30')](_0x2a74da[_0xd1a9('0x2d')],_0x2a74da[_0xd1a9('0x2e')]);_0x4d963f[_0xd1a9('0x31')]=_[_0xd1a9('0x30')](_0x2a74da[_0xd1a9('0x2d')],qs[_0xd1a9('0x32')](_0x337a6f[_0xd1a9('0x2e')][_0xd1a9('0x32')]));_0x4d963f[_0xd1a9('0x31')]=_0x4d963f[_0xd1a9('0x31')][_0xd1a9('0x33')]?_0x4d963f[_0xd1a9('0x31')]:_0x2a74da[_0xd1a9('0x2d')];if(_0x337a6f['query'][_0xd1a9('0x41')]){_0x4d963f['include']=[{'all':!![]}];}_0x4d963f=_[_0xd1a9('0x3a')]({},_0x4d963f,_0x337a6f['options']);return db[_0xd1a9('0x28')]['find'](_0x4d963f)[_0xd1a9('0x21')](handleEntityNotFound(_0x1c20d,null))['then'](respondWithResult(_0x1c20d,null))[_0xd1a9('0x42')](handleError(_0x1c20d,null));};exports[_0xd1a9('0x43')]=function(_0x794fac,_0x4e7e0c){return db[_0xd1a9('0x28')][_0xd1a9('0x43')](_0x794fac[_0xd1a9('0x44')],{})[_0xd1a9('0x21')](respondWithResult(_0x4e7e0c,0xc9))[_0xd1a9('0x42')](handleError(_0x4e7e0c,null));};exports[_0xd1a9('0x20')]=function(_0x19fdf7,_0xa4c7b){if(_0x19fdf7[_0xd1a9('0x44')]['id']){delete _0x19fdf7[_0xd1a9('0x44')]['id'];}return db[_0xd1a9('0x28')][_0xd1a9('0x45')]({'where':{'id':_0x19fdf7[_0xd1a9('0x3f')]['id']}})[_0xd1a9('0x21')](handleEntityNotFound(_0xa4c7b,null))['then'](saveUpdates(_0x19fdf7[_0xd1a9('0x44')],null))['then'](respondWithResult(_0xa4c7b,null))[_0xd1a9('0x42')](handleError(_0xa4c7b,null));};exports[_0xd1a9('0x46')]=function(_0x526aef,_0x5c4eff){return db[_0xd1a9('0x28')][_0xd1a9('0x45')]({'where':{'id':_0x526aef[_0xd1a9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5c4eff,null))[_0xd1a9('0x21')](removeEntity(_0x5c4eff,null))[_0xd1a9('0x42')](handleError(_0x5c4eff,null));};exports[_0xd1a9('0x47')]=function(_0x4bef5e,_0x3b5456){return db[_0xd1a9('0x28')][_0xd1a9('0x47')]()[_0xd1a9('0x21')](respondWithResult(_0x3b5456,null))[_0xd1a9('0x42')](handleError(_0x3b5456,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 8a1eebc..ede4ecb 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x814b,0x1a2));var _0xb814=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x814b[_0x59eefb];return _0x1a49e8;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x15e43b,_0x2a3132){var _0x537fcf=function(_0x8d67d2){while(--_0x8d67d2){_0x15e43b['push'](_0x15e43b['shift']());}};_0x537fcf(++_0x2a3132);}(_0x2ef3,0xba));var _0x32ef=function(_0x270b8c,_0x4047da){_0x270b8c=_0x270b8c-0x0;var _0xefeba4=_0x2ef3[_0x270b8c];return _0xefeba4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index a3d86e7..3b18cae 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x958a=['http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x12c97e,_0x31864e){var _0x4f7e3b=function(_0x433099){while(--_0x433099){_0x12c97e['push'](_0x12c97e['shift']());}};_0x4f7e3b(++_0x31864e);}(_0x958a,0x128));var _0xa958=function(_0x1ab2e7,_0x17687f){_0x1ab2e7=_0x1ab2e7-0x0;var _0x59fe74=_0x958a[_0x1ab2e7];return _0x59fe74;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a90c2){logger[_0xa958('0xc')](_0xa958('0x17'),_0x4eadc9);logger[_0xa958('0xf')]('CreateOpenchannelQueueReport',_0x4eadc9,JSON[_0xa958('0x11')](_0x4a90c2));_0x70d13e(_0x4a90c2);})[_0xa958('0x16')](function(_0x5c091a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x5c091a['message'],_0x4eadc9);_0x52a184(_0x3a053f['error'](0x1f4,_0x5c091a[_0xa958('0x14')]));});});};exports[_0xa958('0x1d')]=function(_0x50b3c3){var _0x25f461=this;return new Promise(function(_0x27097a,_0x2f03df){return db[_0xa958('0x18')][_0xa958('0x1e')](_0x50b3c3[_0xa958('0x1a')],{'raw':_0x50b3c3['options']?_0x50b3c3[_0xa958('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x1f')]||null:null,'attributes':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x20')]||null:null,'limit':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x21')]||null:null})[_0xa958('0xb')](function(_0x4c4c37){logger['info'](_0xa958('0x1d'),_0x50b3c3);logger['debug'](_0xa958('0x1d'),_0x50b3c3,JSON[_0xa958('0x11')](_0x4c4c37));_0x27097a(_0x4c4c37);})['catch'](function(_0x23bdbf){logger[_0xa958('0x12')](_0xa958('0x1d'),_0x23bdbf[_0xa958('0x14')],_0x50b3c3);_0x2f03df(_0x25f461[_0xa958('0x12')](0x1f4,_0x23bdbf['message']));});});}; \ No newline at end of file +var _0x4024=['http','request','info','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','debug','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x4024,0x89));var _0x4402=function(_0x59270d,_0x22344e){_0x59270d=_0x59270d-0x0;var _0x14ae2b=_0x4024[_0x59270d];return _0x14ae2b;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['create'](_0x231382[_0x4402('0x16')],{'raw':_0x231382[_0x4402('0x17')]?_0x231382['options'][_0x4402('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55cc8c){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x19')]('CreateOpenchannelQueueReport',_0x231382,JSON[_0x4402('0xd')](_0x55cc8c));_0x494389(_0x55cc8c);})['catch'](function(_0x47ab54){logger[_0x4402('0xe')](_0x4402('0x14'),_0x47ab54[_0x4402('0x11')],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x47ab54[_0x4402('0x11')]));});});};exports[_0x4402('0x1a')]=function(_0x289a3e){var _0x6b1fc5=this;return new Promise(function(_0x24a9b8,_0x4d6846){return db[_0x4402('0x15')]['update'](_0x289a3e[_0x4402('0x16')],{'raw':_0x289a3e[_0x4402('0x17')]?_0x289a3e[_0x4402('0x17')][_0x4402('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x289a3e['options']?_0x289a3e[_0x4402('0x17')]['where']||null:null,'attributes':_0x289a3e['options']?_0x289a3e[_0x4402('0x17')][_0x4402('0x1b')]||null:null,'limit':_0x289a3e[_0x4402('0x17')]?_0x289a3e[_0x4402('0x17')][_0x4402('0x1c')]||null:null})['then'](function(_0x41de44){logger['info'](_0x4402('0x1a'),_0x289a3e);logger[_0x4402('0x19')](_0x4402('0x1a'),_0x289a3e,JSON['stringify'](_0x41de44));_0x24a9b8(_0x41de44);})[_0x4402('0x13')](function(_0x6c87f6){logger[_0x4402('0xe')](_0x4402('0x1a'),_0x6c87f6[_0x4402('0x11')],_0x289a3e);_0x4d6846(_0x6b1fc5[_0x4402('0xe')](0x1f4,_0x6c87f6[_0x4402('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1fee3cd..ba94503 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 _0x8139=['fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x3328bd,_0x34b6cc){var _0xf2012a=function(_0x35a4e5){while(--_0x35a4e5){_0x3328bd['push'](_0x3328bd['shift']());}};_0xf2012a(++_0x34b6cc);}(_0x8139,0x93));var _0x9813=function(_0x1b1e85,_0x3822b5){_0x1b1e85=_0x1b1e85-0x0;var _0x4c3c41=_0x8139[_0x1b1e85];return _0x4c3c41;};'use strict';var multer=require(_0x9813('0x0'));var util=require(_0x9813('0x1'));var path=require(_0x9813('0x2'));var timeout=require('connect-timeout');var express=require(_0x9813('0x3'));var router=express[_0x9813('0x4')]();var fs_extra=require(_0x9813('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9813('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x9813('0x7')]('/',auth[_0x9813('0x8')](),controller['index']);router[_0x9813('0x7')](_0x9813('0x9'),auth[_0x9813('0x8')](),controller[_0x9813('0xa')]);router[_0x9813('0x7')](_0x9813('0xb'),auth[_0x9813('0x8')](),controller[_0x9813('0xc')]);router[_0x9813('0xd')]('/',auth[_0x9813('0x8')](),controller[_0x9813('0xe')]);router[_0x9813('0xf')]('/:id',auth[_0x9813('0x8')](),controller[_0x9813('0x10')]);router['delete'](_0x9813('0xb'),auth[_0x9813('0x8')](),controller[_0x9813('0x11')]);module[_0x9813('0x12')]=router; \ No newline at end of file +var _0xb2d6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','delete','destroy','multer','util','path','Router','fs-extra'];(function(_0x3358a0,_0x305225){var _0x20691d=function(_0x281b60){while(--_0x281b60){_0x3358a0['push'](_0x3358a0['shift']());}};_0x20691d(++_0x305225);}(_0xb2d6,0x1bd));var _0x6b2d=function(_0x32c40c,_0x5a48c1){_0x32c40c=_0x32c40c-0x0;var _0x56e979=_0xb2d6[_0x32c40c];return _0x56e979;};'use strict';var multer=require(_0x6b2d('0x0'));var util=require(_0x6b2d('0x1'));var path=require(_0x6b2d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6b2d('0x3')]();var fs_extra=require(_0x6b2d('0x4'));var auth=require(_0x6b2d('0x5'));var interaction=require(_0x6b2d('0x6'));var config=require(_0x6b2d('0x7'));var controller=require(_0x6b2d('0x8'));router[_0x6b2d('0x9')]('/',auth[_0x6b2d('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6b2d('0xb')]);router['get'](_0x6b2d('0xc'),auth[_0x6b2d('0xa')](),controller[_0x6b2d('0xd')]);router[_0x6b2d('0xe')]('/',auth[_0x6b2d('0xa')](),controller[_0x6b2d('0xf')]);router['put']('/:id',auth[_0x6b2d('0xa')](),controller['update']);router[_0x6b2d('0x10')]('/:id',auth[_0x6b2d('0xa')](),controller[_0x6b2d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index dad7599..d421a97 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x117a06,_0x3860e4){var _0x53bfc2=function(_0xe0458c){while(--_0xe0458c){_0x117a06['push'](_0x117a06['shift']());}};_0x53bfc2(++_0x3860e4);}(_0x008c,0x188));var _0xc008=function(_0x5219aa,_0x357da6){_0x5219aa=_0x5219aa-0x0;var _0x479261=_0x008c[_0x5219aa];return _0x479261;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x1e5cb9,_0x3a4498){var _0x153fe6=function(_0x3e57b8){while(--_0x3e57b8){_0x1e5cb9['push'](_0x1e5cb9['shift']());}};_0x153fe6(++_0x3a4498);}(_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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 57b7a5d..7d23dd3 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 _0xe833=['apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','squel','desk.js','to-csv','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x46c124,_0x136ec3){var _0x1baae0=function(_0x1c8424){while(--_0x1c8424){_0x46c124['push'](_0x46c124['shift']());}};_0x1baae0(++_0x136ec3);}(_0xe833,0x129));var _0x3e83=function(_0x338df7,_0x129ade){_0x338df7=_0x338df7-0x0;var _0x940933=_0xe833[_0x338df7];return _0x940933;};'use strict';var emlformat=require(_0x3e83('0x0'));var rimraf=require(_0x3e83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e83('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e83('0x3'));var Mustache=require(_0x3e83('0x4'));var util=require(_0x3e83('0x5'));var path=require('path');var sox=require(_0x3e83('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(_0x3e83('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3e83('0x8'));var toCsv=require(_0x3e83('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3e83('0xa'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e83('0xb'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e83('0xc'))['db'];function respondWithStatusCode(_0x36d486,_0x3a14a1){_0x3a14a1=_0x3a14a1||0xcc;return function(_0x23824a){if(_0x23824a){return _0x36d486[_0x3e83('0xd')](_0x3a14a1);}return _0x36d486[_0x3e83('0xe')](_0x3a14a1)[_0x3e83('0xf')]();};}function respondWithResult(_0x42295b,_0x334d6e){_0x334d6e=_0x334d6e||0xc8;return function(_0x3a007b){if(_0x3a007b){return _0x42295b[_0x3e83('0xe')](_0x334d6e)[_0x3e83('0x10')](_0x3a007b);}};}function respondWithFilteredResult(_0x188edc,_0x5974bf){return function(_0x4ffe3e){if(_0x4ffe3e){var _0x17cbb0=typeof _0x5974bf[_0x3e83('0x11')]===_0x3e83('0x12')&&typeof _0x5974bf[_0x3e83('0x13')]===_0x3e83('0x12');var _0x56eb29=_0x4ffe3e['count'];var _0x490b28=_0x17cbb0?0x0:_0x5974bf[_0x3e83('0x11')];var _0x5ce2d5=_0x17cbb0?_0x4ffe3e[_0x3e83('0x14')]:_0x5974bf[_0x3e83('0x11')]+_0x5974bf[_0x3e83('0x13')];var _0x1e7cfb;if(_0x5ce2d5>=_0x56eb29){_0x5ce2d5=_0x56eb29;_0x1e7cfb=0xc8;}else{_0x1e7cfb=0xce;}_0x188edc[_0x3e83('0xe')](_0x1e7cfb);return _0x188edc[_0x3e83('0x15')](_0x3e83('0x16'),_0x490b28+'-'+_0x5ce2d5+'/'+_0x56eb29)[_0x3e83('0x10')](_0x4ffe3e);}return null;};}function patchUpdates(_0x408a57){return function(_0x28d156){try{jsonpatch[_0x3e83('0x17')](_0x28d156,_0x408a57,!![]);}catch(_0xaa8871){return BPromise['reject'](_0xaa8871);}return _0x28d156[_0x3e83('0x18')]();};}function saveUpdates(_0x200800,_0x33b52b){return function(_0x568f53){if(_0x568f53){return _0x568f53['update'](_0x200800)[_0x3e83('0x19')](function(_0x51b947){return _0x51b947;});}return null;};}function removeEntity(_0x589f1f,_0x579cfc){return function(_0x4dfa71){if(_0x4dfa71){return _0x4dfa71[_0x3e83('0x1a')]()[_0x3e83('0x19')](function(){_0x589f1f[_0x3e83('0xe')](0xcc)[_0x3e83('0xf')]();});}};}function handleEntityNotFound(_0x435cbb,_0x120420){return function(_0x9a2429){if(!_0x9a2429){_0x435cbb['sendStatus'](0x194);}return _0x9a2429;};}function handleError(_0x4e01f8,_0x992daf){_0x992daf=_0x992daf||0x1f4;return function(_0x3daef0){logger['error'](_0x3daef0[_0x3e83('0x1b')]);if(_0x3daef0[_0x3e83('0x1c')]){delete _0x3daef0[_0x3e83('0x1c')];}_0x4e01f8['status'](_0x992daf)[_0x3e83('0x1d')](_0x3daef0);};}exports[_0x3e83('0x1e')]=function(_0x354c19,_0x5f3d85){var _0x5350e3={},_0x2ccd07={},_0x492449={'count':0x0,'rows':[]};var _0x310772=_[_0x3e83('0x1f')](db['OpenchannelTransferReport'][_0x3e83('0x20')],function(_0x3e8fb1){return{'name':_0x3e8fb1[_0x3e83('0x21')],'type':_0x3e8fb1[_0x3e83('0x22')]['key']};});_0x2ccd07[_0x3e83('0x23')]=_[_0x3e83('0x1f')](_0x310772,'name');_0x2ccd07[_0x3e83('0x24')]=_['keys'](_0x354c19[_0x3e83('0x24')]);_0x2ccd07['filters']=_[_0x3e83('0x25')](_0x2ccd07[_0x3e83('0x23')],_0x2ccd07[_0x3e83('0x24')]);_0x5350e3['attributes']=_['intersection'](_0x2ccd07[_0x3e83('0x23')],qs[_0x3e83('0x26')](_0x354c19[_0x3e83('0x24')]['fields']));_0x5350e3['attributes']=_0x5350e3[_0x3e83('0x27')][_0x3e83('0x28')]?_0x5350e3[_0x3e83('0x27')]:_0x2ccd07['model'];if(!_0x354c19['query']['hasOwnProperty'](_0x3e83('0x29'))){_0x5350e3['limit']=qs[_0x3e83('0x13')](_0x354c19[_0x3e83('0x24')][_0x3e83('0x13')]);_0x5350e3[_0x3e83('0x11')]=qs[_0x3e83('0x11')](_0x354c19[_0x3e83('0x24')]['offset']);}_0x5350e3[_0x3e83('0x2a')]=qs[_0x3e83('0x2b')](_0x354c19[_0x3e83('0x24')][_0x3e83('0x2b')]);_0x5350e3['where']=qs['filters'](_[_0x3e83('0x2c')](_0x354c19[_0x3e83('0x24')],_0x2ccd07[_0x3e83('0x2d')]),_0x310772);if(_0x354c19['query'][_0x3e83('0x2e')]){_0x5350e3[_0x3e83('0x2f')]=_[_0x3e83('0x30')](_0x5350e3['where'],{'$or':_[_0x3e83('0x1f')](_0x310772,function(_0x146f85){if(_0x146f85[_0x3e83('0x22')]!==_0x3e83('0x31')){var _0x31e93a={};_0x31e93a[_0x146f85[_0x3e83('0x1c')]]={'$like':'%'+_0x354c19[_0x3e83('0x24')][_0x3e83('0x2e')]+'%'};return _0x31e93a;}})});}_0x5350e3=_[_0x3e83('0x30')]({},_0x5350e3,_0x354c19['options']);var _0x538180={'where':_0x5350e3[_0x3e83('0x2f')]};return db[_0x3e83('0x32')][_0x3e83('0x14')](_0x538180)[_0x3e83('0x19')](function(_0x3c21e0){_0x492449[_0x3e83('0x14')]=_0x3c21e0;if(_0x354c19['query'][_0x3e83('0x33')]){_0x5350e3[_0x3e83('0x34')]=[{'all':!![]}];}return db[_0x3e83('0x32')][_0x3e83('0x35')](_0x5350e3);})['then'](function(_0x5209ef){_0x492449[_0x3e83('0x36')]=_0x5209ef;return _0x492449;})['then'](respondWithFilteredResult(_0x5f3d85,_0x5350e3))[_0x3e83('0x37')](handleError(_0x5f3d85,null));};exports[_0x3e83('0x38')]=function(_0xa24a07,_0x2cf1c6){var _0x130c9e={'raw':!![],'where':{'id':_0xa24a07[_0x3e83('0x39')]['id']}},_0x5a624d={};_0x5a624d[_0x3e83('0x23')]=_[_0x3e83('0x3a')](db[_0x3e83('0x32')][_0x3e83('0x20')]);_0x5a624d['query']=_['keys'](_0xa24a07[_0x3e83('0x24')]);_0x5a624d[_0x3e83('0x2d')]=_[_0x3e83('0x25')](_0x5a624d['model'],_0x5a624d[_0x3e83('0x24')]);_0x130c9e[_0x3e83('0x27')]=_[_0x3e83('0x25')](_0x5a624d[_0x3e83('0x23')],qs[_0x3e83('0x26')](_0xa24a07[_0x3e83('0x24')]['fields']));_0x130c9e[_0x3e83('0x27')]=_0x130c9e[_0x3e83('0x27')]['length']?_0x130c9e[_0x3e83('0x27')]:_0x5a624d[_0x3e83('0x23')];if(_0xa24a07[_0x3e83('0x24')][_0x3e83('0x33')]){_0x130c9e[_0x3e83('0x34')]=[{'all':!![]}];}_0x130c9e=_[_0x3e83('0x30')]({},_0x130c9e,_0xa24a07['options']);return db[_0x3e83('0x32')][_0x3e83('0x3b')](_0x130c9e)[_0x3e83('0x19')](handleEntityNotFound(_0x2cf1c6,null))['then'](respondWithResult(_0x2cf1c6,null))[_0x3e83('0x37')](handleError(_0x2cf1c6,null));};exports['create']=function(_0x2e4d36,_0x519fd9){return db[_0x3e83('0x32')][_0x3e83('0x3c')](_0x2e4d36[_0x3e83('0x3d')],{})['then'](respondWithResult(_0x519fd9,0xc9))[_0x3e83('0x37')](handleError(_0x519fd9,null));};exports[_0x3e83('0x3e')]=function(_0x3c2c25,_0x1b74fd){if(_0x3c2c25[_0x3e83('0x3d')]['id']){delete _0x3c2c25[_0x3e83('0x3d')]['id'];}return db[_0x3e83('0x32')][_0x3e83('0x3b')]({'where':{'id':_0x3c2c25['params']['id']}})[_0x3e83('0x19')](handleEntityNotFound(_0x1b74fd,null))[_0x3e83('0x19')](saveUpdates(_0x3c2c25[_0x3e83('0x3d')],null))[_0x3e83('0x19')](respondWithResult(_0x1b74fd,null))[_0x3e83('0x37')](handleError(_0x1b74fd,null));};exports['destroy']=function(_0x2bcc40,_0xf4ebc2){return db[_0x3e83('0x32')][_0x3e83('0x3b')]({'where':{'id':_0x2bcc40[_0x3e83('0x39')]['id']}})['then'](handleEntityNotFound(_0xf4ebc2,null))[_0x3e83('0x19')](removeEntity(_0xf4ebc2,null))[_0x3e83('0x37')](handleError(_0xf4ebc2,null));};exports[_0x3e83('0x3f')]=function(_0x46bfc5,_0x1a3efd){return db[_0x3e83('0x32')][_0x3e83('0x3f')]()[_0x3e83('0x19')](respondWithResult(_0x1a3efd,null))[_0x3e83('0x37')](handleError(_0x1a3efd,null));}; \ No newline at end of file +var _0x2b9a=['ejs','fs-extra','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','../../mysqldb','sendStatus','end','status','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','include','findAll','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv'];(function(_0x3d2297,_0x239f81){var _0x7b3c96=function(_0x52453e){while(--_0x52453e){_0x3d2297['push'](_0x3d2297['shift']());}};_0x7b3c96(++_0x239f81);}(_0x2b9a,0x1cc));var _0xa2b9=function(_0xc65818,_0x5cd044){_0xc65818=_0xc65818-0x0;var _0x18c3ac=_0x2b9a[_0xc65818];return _0x18c3ac;};'use strict';var emlformat=require(_0xa2b9('0x0'));var rimraf=require(_0xa2b9('0x1'));var zipdir=require(_0xa2b9('0x2'));var jsonpatch=require(_0xa2b9('0x3'));var rp=require(_0xa2b9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa2b9('0x5'));var path=require(_0xa2b9('0x6'));var sox=require('sox');var csv=require(_0xa2b9('0x7'));var ejs=require(_0xa2b9('0x8'));var fs=require('fs');var fs_extra=require(_0xa2b9('0x9'));var _=require(_0xa2b9('0xa'));var squel=require('squel');var crypto=require(_0xa2b9('0xb'));var jsforce=require(_0xa2b9('0xc'));var deskjs=require(_0xa2b9('0xd'));var toCsv=require(_0xa2b9('0x7'));var querystring=require(_0xa2b9('0xe'));var Papa=require(_0xa2b9('0xf'));var Redis=require(_0xa2b9('0x10'));var authService=require(_0xa2b9('0x11'));var qs=require(_0xa2b9('0x12'));var as=require(_0xa2b9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2b9('0x14'))(_0xa2b9('0x15'));var utils=require(_0xa2b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa2b9('0x17'));var db=require(_0xa2b9('0x18'))['db'];function respondWithStatusCode(_0x52f4db,_0xb837d0){_0xb837d0=_0xb837d0||0xcc;return function(_0x143f1c){if(_0x143f1c){return _0x52f4db[_0xa2b9('0x19')](_0xb837d0);}return _0x52f4db['status'](_0xb837d0)[_0xa2b9('0x1a')]();};}function respondWithResult(_0x44deee,_0x473f86){_0x473f86=_0x473f86||0xc8;return function(_0x36af1b){if(_0x36af1b){return _0x44deee[_0xa2b9('0x1b')](_0x473f86)[_0xa2b9('0x1c')](_0x36af1b);}};}function respondWithFilteredResult(_0x42a249,_0x317f76){return function(_0xd47477){if(_0xd47477){var _0x3d623e=typeof _0x317f76['offset']===_0xa2b9('0x1d')&&typeof _0x317f76['limit']===_0xa2b9('0x1d');var _0xb2bef6=_0xd47477['count'];var _0x100579=_0x3d623e?0x0:_0x317f76[_0xa2b9('0x1e')];var _0x27790b=_0x3d623e?_0xd47477[_0xa2b9('0x1f')]:_0x317f76[_0xa2b9('0x1e')]+_0x317f76[_0xa2b9('0x20')];var _0x5eee68;if(_0x27790b>=_0xb2bef6){_0x27790b=_0xb2bef6;_0x5eee68=0xc8;}else{_0x5eee68=0xce;}_0x42a249['status'](_0x5eee68);return _0x42a249['set'](_0xa2b9('0x21'),_0x100579+'-'+_0x27790b+'/'+_0xb2bef6)[_0xa2b9('0x1c')](_0xd47477);}return null;};}function patchUpdates(_0x5a814a){return function(_0x575904){try{jsonpatch[_0xa2b9('0x22')](_0x575904,_0x5a814a,!![]);}catch(_0xac206c){return BPromise[_0xa2b9('0x23')](_0xac206c);}return _0x575904['save']();};}function saveUpdates(_0x3a3d92,_0xde482){return function(_0x50acab){if(_0x50acab){return _0x50acab[_0xa2b9('0x24')](_0x3a3d92)[_0xa2b9('0x25')](function(_0x240095){return _0x240095;});}return null;};}function removeEntity(_0x277536,_0x5bf4d3){return function(_0x343a79){if(_0x343a79){return _0x343a79['destroy']()['then'](function(){_0x277536[_0xa2b9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39cb82,_0x2f92fb){return function(_0x5e5a49){if(!_0x5e5a49){_0x39cb82[_0xa2b9('0x19')](0x194);}return _0x5e5a49;};}function handleError(_0xa2366b,_0x242af9){_0x242af9=_0x242af9||0x1f4;return function(_0x3a9c4e){logger[_0xa2b9('0x26')](_0x3a9c4e[_0xa2b9('0x27')]);if(_0x3a9c4e[_0xa2b9('0x28')]){delete _0x3a9c4e[_0xa2b9('0x28')];}_0xa2366b[_0xa2b9('0x1b')](_0x242af9)[_0xa2b9('0x29')](_0x3a9c4e);};}exports[_0xa2b9('0x2a')]=function(_0x388626,_0x3f758e){var _0x53c24c={},_0x51f29e={},_0x391a65={'count':0x0,'rows':[]};var _0x271219=_['map'](db['OpenchannelTransferReport'][_0xa2b9('0x2b')],function(_0x121ce0){return{'name':_0x121ce0[_0xa2b9('0x2c')],'type':_0x121ce0[_0xa2b9('0x2d')][_0xa2b9('0x2e')]};});_0x51f29e['model']=_[_0xa2b9('0x2f')](_0x271219,_0xa2b9('0x28'));_0x51f29e[_0xa2b9('0x30')]=_[_0xa2b9('0x31')](_0x388626[_0xa2b9('0x30')]);_0x51f29e[_0xa2b9('0x32')]=_[_0xa2b9('0x33')](_0x51f29e[_0xa2b9('0x34')],_0x51f29e[_0xa2b9('0x30')]);_0x53c24c[_0xa2b9('0x35')]=_[_0xa2b9('0x33')](_0x51f29e[_0xa2b9('0x34')],qs[_0xa2b9('0x36')](_0x388626[_0xa2b9('0x30')][_0xa2b9('0x36')]));_0x53c24c[_0xa2b9('0x35')]=_0x53c24c['attributes'][_0xa2b9('0x37')]?_0x53c24c[_0xa2b9('0x35')]:_0x51f29e[_0xa2b9('0x34')];if(!_0x388626[_0xa2b9('0x30')][_0xa2b9('0x38')](_0xa2b9('0x39'))){_0x53c24c[_0xa2b9('0x20')]=qs['limit'](_0x388626[_0xa2b9('0x30')][_0xa2b9('0x20')]);_0x53c24c['offset']=qs['offset'](_0x388626[_0xa2b9('0x30')][_0xa2b9('0x1e')]);}_0x53c24c[_0xa2b9('0x3a')]=qs[_0xa2b9('0x3b')](_0x388626[_0xa2b9('0x30')][_0xa2b9('0x3b')]);_0x53c24c[_0xa2b9('0x3c')]=qs[_0xa2b9('0x32')](_[_0xa2b9('0x3d')](_0x388626[_0xa2b9('0x30')],_0x51f29e[_0xa2b9('0x32')]),_0x271219);if(_0x388626[_0xa2b9('0x30')][_0xa2b9('0x3e')]){_0x53c24c[_0xa2b9('0x3c')]=_[_0xa2b9('0x3f')](_0x53c24c[_0xa2b9('0x3c')],{'$or':_[_0xa2b9('0x2f')](_0x271219,function(_0x133eb){if(_0x133eb['type']!==_0xa2b9('0x40')){var _0x16d108={};_0x16d108[_0x133eb[_0xa2b9('0x28')]]={'$like':'%'+_0x388626[_0xa2b9('0x30')][_0xa2b9('0x3e')]+'%'};return _0x16d108;}})});}_0x53c24c=_['merge']({},_0x53c24c,_0x388626[_0xa2b9('0x41')]);var _0x2c68d7={'where':_0x53c24c['where']};return db[_0xa2b9('0x42')]['count'](_0x2c68d7)[_0xa2b9('0x25')](function(_0x4780da){_0x391a65[_0xa2b9('0x1f')]=_0x4780da;if(_0x388626['query']['includeAll']){_0x53c24c[_0xa2b9('0x43')]=[{'all':!![]}];}return db[_0xa2b9('0x42')][_0xa2b9('0x44')](_0x53c24c);})[_0xa2b9('0x25')](function(_0x5df660){_0x391a65['rows']=_0x5df660;return _0x391a65;})[_0xa2b9('0x25')](respondWithFilteredResult(_0x3f758e,_0x53c24c))['catch'](handleError(_0x3f758e,null));};exports[_0xa2b9('0x45')]=function(_0x2de12a,_0x148563){var _0x3cb24b={'raw':!![],'where':{'id':_0x2de12a[_0xa2b9('0x46')]['id']}},_0x34621d={};_0x34621d[_0xa2b9('0x34')]=_[_0xa2b9('0x31')](db[_0xa2b9('0x42')][_0xa2b9('0x2b')]);_0x34621d[_0xa2b9('0x30')]=_[_0xa2b9('0x31')](_0x2de12a[_0xa2b9('0x30')]);_0x34621d[_0xa2b9('0x32')]=_[_0xa2b9('0x33')](_0x34621d[_0xa2b9('0x34')],_0x34621d[_0xa2b9('0x30')]);_0x3cb24b[_0xa2b9('0x35')]=_[_0xa2b9('0x33')](_0x34621d['model'],qs[_0xa2b9('0x36')](_0x2de12a[_0xa2b9('0x30')][_0xa2b9('0x36')]));_0x3cb24b[_0xa2b9('0x35')]=_0x3cb24b[_0xa2b9('0x35')][_0xa2b9('0x37')]?_0x3cb24b[_0xa2b9('0x35')]:_0x34621d[_0xa2b9('0x34')];if(_0x2de12a[_0xa2b9('0x30')][_0xa2b9('0x47')]){_0x3cb24b[_0xa2b9('0x43')]=[{'all':!![]}];}_0x3cb24b=_[_0xa2b9('0x3f')]({},_0x3cb24b,_0x2de12a[_0xa2b9('0x41')]);return db[_0xa2b9('0x42')][_0xa2b9('0x48')](_0x3cb24b)[_0xa2b9('0x25')](handleEntityNotFound(_0x148563,null))[_0xa2b9('0x25')](respondWithResult(_0x148563,null))[_0xa2b9('0x49')](handleError(_0x148563,null));};exports[_0xa2b9('0x4a')]=function(_0x1e6f42,_0x33d7a2){return db[_0xa2b9('0x42')]['create'](_0x1e6f42[_0xa2b9('0x4b')],{})[_0xa2b9('0x25')](respondWithResult(_0x33d7a2,0xc9))[_0xa2b9('0x49')](handleError(_0x33d7a2,null));};exports[_0xa2b9('0x24')]=function(_0x803f39,_0x11aeeb){if(_0x803f39[_0xa2b9('0x4b')]['id']){delete _0x803f39[_0xa2b9('0x4b')]['id'];}return db['OpenchannelTransferReport'][_0xa2b9('0x48')]({'where':{'id':_0x803f39[_0xa2b9('0x46')]['id']}})[_0xa2b9('0x25')](handleEntityNotFound(_0x11aeeb,null))[_0xa2b9('0x25')](saveUpdates(_0x803f39[_0xa2b9('0x4b')],null))['then'](respondWithResult(_0x11aeeb,null))['catch'](handleError(_0x11aeeb,null));};exports[_0xa2b9('0x4c')]=function(_0x49365e,_0x3957f9){return db[_0xa2b9('0x42')]['find']({'where':{'id':_0x49365e['params']['id']}})[_0xa2b9('0x25')](handleEntityNotFound(_0x3957f9,null))[_0xa2b9('0x25')](removeEntity(_0x3957f9,null))[_0xa2b9('0x49')](handleError(_0x3957f9,null));};exports[_0xa2b9('0x4d')]=function(_0x3e8485,_0x5f04ab){return db[_0xa2b9('0x42')][_0xa2b9('0x4d')]()[_0xa2b9('0x25')](respondWithResult(_0x5f04ab,null))[_0xa2b9('0x49')](handleError(_0x5f04ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a931b4a..84f7c06 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 _0x9a53=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1f047e,_0x23b312){var _0x206db5=function(_0xe06955){while(--_0xe06955){_0x1f047e['push'](_0x1f047e['shift']());}};_0x206db5(++_0x23b312);}(_0x9a53,0x1e9));var _0x39a5=function(_0x13b2ea,_0xe3707f){_0x13b2ea=_0x13b2ea-0x0;var _0x411f3d=_0x9a53[_0x13b2ea];return _0x411f3d;};'use strict';var _=require(_0x39a5('0x0'));var util=require(_0x39a5('0x1'));var logger=require(_0x39a5('0x2'))(_0x39a5('0x3'));var moment=require('moment');var BPromise=require(_0x39a5('0x4'));var rp=require(_0x39a5('0x5'));var fs=require('fs');var path=require(_0x39a5('0x6'));var rimraf=require(_0x39a5('0x7'));var config=require(_0x39a5('0x8'));var attributes=require(_0x39a5('0x9'));module['exports']=function(_0x41c64a,_0x4850c9){return _0x41c64a['define']('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x39a5('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x65a4=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x65a4,0xdd));var _0x465a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x65a4[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x465a('0x0'));var util=require(_0x465a('0x1'));var logger=require('../../config/logger')(_0x465a('0x2'));var moment=require(_0x465a('0x3'));var BPromise=require(_0x465a('0x4'));var rp=require(_0x465a('0x5'));var fs=require('fs');var path=require(_0x465a('0x6'));var rimraf=require(_0x465a('0x7'));var config=require(_0x465a('0x8'));var attributes=require(_0x465a('0x9'));module['exports']=function(_0x4c5084,_0x36828b){return _0x4c5084[_0x465a('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x465a('0xb'),'paranoid':![],'indexes':[{'name':_0x465a('0xc'),'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 f547ffc..bf576b5 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 _0x27c5=['message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x161681,_0x166f68){var _0x49837f=function(_0x19f39b){while(--_0x19f39b){_0x161681['push'](_0x161681['shift']());}};_0x49837f(++_0x166f68);}(_0x27c5,0x173));var _0x527c=function(_0xe1f858,_0xb86c44){_0xe1f858=_0xe1f858-0x0;var _0x367af6=_0x27c5[_0xe1f858];return _0x367af6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x527c('0x0'));var BPromise=require(_0x527c('0x1'));var rs=require(_0x527c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x527c('0x3'))['db'];var utils=require(_0x527c('0x4'));var logger=require(_0x527c('0x5'))(_0x527c('0x6'));var config=require(_0x527c('0x7'));var jayson=require(_0x527c('0x8'));var client=jayson[_0x527c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18c413,_0x5a68e8,_0x2db820){return new BPromise(function(_0x5e07ba,_0x1071f5){return client[_0x527c('0xa')](_0x18c413,_0x2db820)[_0x527c('0xb')](function(_0x49465c){logger[_0x527c('0xc')](_0x527c('0xd'),_0x5a68e8,_0x527c('0xe'));logger[_0x527c('0xf')](_0x527c('0x10'),_0x5a68e8,_0x527c('0xe'),JSON[_0x527c('0x11')](_0x49465c));if(_0x49465c[_0x527c('0x12')]){if(_0x49465c[_0x527c('0x12')][_0x527c('0x13')]===0x1f4){logger[_0x527c('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5a68e8,_0x49465c['error'][_0x527c('0x14')]);return _0x1071f5(_0x49465c[_0x527c('0x12')][_0x527c('0x14')]);}logger[_0x527c('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5a68e8,_0x49465c[_0x527c('0x12')][_0x527c('0x14')]);return _0x5e07ba(_0x49465c['error']['message']);}else{logger[_0x527c('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x5a68e8,'request\x20sent');_0x5e07ba(_0x49465c[_0x527c('0x15')][_0x527c('0x14')]);}})[_0x527c('0x16')](function(_0x5e987c){logger[_0x527c('0x12')](_0x527c('0xd'),_0x5a68e8,_0x5e987c);_0x1071f5(_0x5e987c);});});} \ No newline at end of file +var _0x1c88=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x464d1b,_0x4d4525){var _0x1b21c0=function(_0x43ab20){while(--_0x43ab20){_0x464d1b['push'](_0x464d1b['shift']());}};_0x1b21c0(++_0x4d4525);}(_0x1c88,0x1a9));var _0x81c8=function(_0x673ea4,_0x449076){_0x673ea4=_0x673ea4-0x0;var _0x3e5938=_0x1c88[_0x673ea4];return _0x3e5938;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var moment=require(_0x81c8('0x1'));var BPromise=require(_0x81c8('0x2'));var rs=require(_0x81c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x81c8('0x4'));var logger=require(_0x81c8('0x5'))(_0x81c8('0x6'));var config=require(_0x81c8('0x7'));var jayson=require(_0x81c8('0x8'));var client=jayson[_0x81c8('0x9')][_0x81c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x182e47,_0x3a1778,_0x2111ca){return new BPromise(function(_0x191c40,_0x1ba4cb){return client[_0x81c8('0xb')](_0x182e47,_0x2111ca)['then'](function(_0x34ddaf){logger[_0x81c8('0xc')](_0x81c8('0xd'),_0x3a1778,'request\x20sent');logger['debug'](_0x81c8('0xe'),_0x3a1778,_0x81c8('0xf'),JSON[_0x81c8('0x10')](_0x34ddaf));if(_0x34ddaf['error']){if(_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x12')]===0x1f4){logger['error'](_0x81c8('0xd'),_0x3a1778,_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x13')]);return _0x1ba4cb(_0x34ddaf[_0x81c8('0x11')]['message']);}logger[_0x81c8('0x11')](_0x81c8('0xd'),_0x3a1778,_0x34ddaf[_0x81c8('0x11')]['message']);return _0x191c40(_0x34ddaf[_0x81c8('0x11')][_0x81c8('0x13')]);}else{logger[_0x81c8('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3a1778,_0x81c8('0xf'));_0x191c40(_0x34ddaf[_0x81c8('0x14')][_0x81c8('0x13')]);}})[_0x81c8('0x15')](function(_0x311b6c){logger['error'](_0x81c8('0xd'),_0x3a1778,_0x311b6c);_0x1ba4cb(_0x311b6c);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e784c3f..a802814 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 _0x3157=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3157,0x1eb));var _0x7315=function(_0x1e8e56,_0x252b7d){_0x1e8e56=_0x1e8e56-0x0;var _0x168c38=_0x3157[_0x1e8e56];return _0x168c38;};'use strict';var multer=require(_0x7315('0x0'));var util=require('util');var path=require(_0x7315('0x1'));var timeout=require(_0x7315('0x2'));var express=require(_0x7315('0x3'));var router=express[_0x7315('0x4')]();var fs_extra=require(_0x7315('0x5'));var auth=require(_0x7315('0x6'));var interaction=require(_0x7315('0x7'));var config=require(_0x7315('0x8'));var controller=require('./pause.controller');router[_0x7315('0x9')]('/',auth[_0x7315('0xa')](),controller['index']);router[_0x7315('0x9')](_0x7315('0xb'),auth['isAuthenticated'](),controller[_0x7315('0xc')]);router[_0x7315('0xd')]('/',auth['isAuthenticated'](),controller[_0x7315('0xe')]);router[_0x7315('0xf')]('/:id',auth[_0x7315('0xa')](),controller[_0x7315('0x10')]);router[_0x7315('0x11')]('/:id',auth[_0x7315('0xa')](),controller[_0x7315('0x12')]);module[_0x7315('0x13')]=router; \ No newline at end of file +var _0xee9a=['get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x25e620,_0x2d558c){var _0x1785f3=function(_0x1a258f){while(--_0x1a258f){_0x25e620['push'](_0x25e620['shift']());}};_0x1785f3(++_0x2d558c);}(_0xee9a,0x12a));var _0xaee9=function(_0x16ceb4,_0x9a6429){_0x16ceb4=_0x16ceb4-0x0;var _0x79a778=_0xee9a[_0x16ceb4];return _0x79a778;};'use strict';var multer=require('multer');var util=require(_0xaee9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaee9('0x1'));var router=express[_0xaee9('0x2')]();var fs_extra=require(_0xaee9('0x3'));var auth=require(_0xaee9('0x4'));var interaction=require(_0xaee9('0x5'));var config=require(_0xaee9('0x6'));var controller=require(_0xaee9('0x7'));router[_0xaee9('0x8')]('/',auth[_0xaee9('0x9')](),controller[_0xaee9('0xa')]);router[_0xaee9('0x8')]('/:id',auth[_0xaee9('0x9')](),controller['show']);router[_0xaee9('0xb')]('/',auth[_0xaee9('0x9')](),controller[_0xaee9('0xc')]);router[_0xaee9('0xd')](_0xaee9('0xe'),auth[_0xaee9('0x9')](),controller[_0xaee9('0xf')]);router[_0xaee9('0x10')]('/:id',auth[_0xaee9('0x9')](),controller[_0xaee9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index dd460ad..8c030a6 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 _0xeae8=['name','STRING','sequelize','exports'];(function(_0x3c222b,_0x5d2eb7){var _0xd9fdbb=function(_0x3aa0d2){while(--_0x3aa0d2){_0x3c222b['push'](_0x3c222b['shift']());}};_0xd9fdbb(++_0x5d2eb7);}(_0xeae8,0x172));var _0x8eae=function(_0x5b69a7,_0x2761e2){_0x5b69a7=_0x5b69a7-0x0;var _0x8821f5=_0xeae8[_0x5b69a7];return _0x8821f5;};'use strict';var Sequelize=require(_0x8eae('0x0'));module[_0x8eae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8eae('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8eae('0x3')]}}; \ No newline at end of file +var _0x3b6d=['exports','STRING','sequelize'];(function(_0x49cf88,_0x5aa395){var _0x4bd501=function(_0x4d2937){while(--_0x4d2937){_0x49cf88['push'](_0x49cf88['shift']());}};_0x4bd501(++_0x5aa395);}(_0x3b6d,0x98));var _0xd3b6=function(_0x1d5e5e,_0x3730d9){_0x1d5e5e=_0x1d5e5e-0x0;var _0x44981a=_0x3b6d[_0x1d5e5e];return _0x44981a;};'use strict';var Sequelize=require(_0xd3b6('0x0'));module[_0xd3b6('0x1')]={'name':{'type':Sequelize[_0xd3b6('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd3b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 3eaa92c..080a116 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 _0x498c=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','name','index','Pause','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4cc511,_0x2426cf){var _0x1a55ca=function(_0x533922){while(--_0x533922){_0x4cc511['push'](_0x4cc511['shift']());}};_0x1a55ca(++_0x2426cf);}(_0x498c,0x183));var _0xc498=function(_0x28f9c7,_0x12c915){_0x28f9c7=_0x28f9c7-0x0;var _0x1fa7c1=_0x498c[_0x28f9c7];return _0x1fa7c1;};'use strict';var emlformat=require(_0xc498('0x0'));var rimraf=require(_0xc498('0x1'));var zipdir=require(_0xc498('0x2'));var jsonpatch=require(_0xc498('0x3'));var rp=require('request-promise');var moment=require(_0xc498('0x4'));var BPromise=require(_0xc498('0x5'));var Mustache=require(_0xc498('0x6'));var util=require('util');var path=require(_0xc498('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc498('0x8'));var fs=require('fs');var fs_extra=require(_0xc498('0x9'));var _=require('lodash');var squel=require(_0xc498('0xa'));var crypto=require(_0xc498('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc498('0xc'));var querystring=require(_0xc498('0xd'));var Papa=require('papaparse');var Redis=require(_0xc498('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc498('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc498('0x10'));var logger=require(_0xc498('0x11'))(_0xc498('0x12'));var utils=require(_0xc498('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc498('0x14'));var db=require(_0xc498('0x15'))['db'];function respondWithStatusCode(_0x53d0d7,_0x34e9b9){_0x34e9b9=_0x34e9b9||0xcc;return function(_0x494756){if(_0x494756){return _0x53d0d7[_0xc498('0x16')](_0x34e9b9);}return _0x53d0d7['status'](_0x34e9b9)[_0xc498('0x17')]();};}function respondWithResult(_0x1ea1ef,_0x71c23b){_0x71c23b=_0x71c23b||0xc8;return function(_0xd6a3db){if(_0xd6a3db){return _0x1ea1ef[_0xc498('0x18')](_0x71c23b)[_0xc498('0x19')](_0xd6a3db);}};}function respondWithFilteredResult(_0x4547da,_0x26ff6d){return function(_0x4d58e9){if(_0x4d58e9){var _0x98e53a=typeof _0x26ff6d[_0xc498('0x1a')]===_0xc498('0x1b')&&typeof _0x26ff6d[_0xc498('0x1c')]===_0xc498('0x1b');var _0x102d0a=_0x4d58e9['count'];var _0xde8d33=_0x98e53a?0x0:_0x26ff6d[_0xc498('0x1a')];var _0x281e65=_0x98e53a?_0x4d58e9[_0xc498('0x1d')]:_0x26ff6d[_0xc498('0x1a')]+_0x26ff6d[_0xc498('0x1c')];var _0x217c33;if(_0x281e65>=_0x102d0a){_0x281e65=_0x102d0a;_0x217c33=0xc8;}else{_0x217c33=0xce;}_0x4547da['status'](_0x217c33);return _0x4547da[_0xc498('0x1e')]('Content-Range',_0xde8d33+'-'+_0x281e65+'/'+_0x102d0a)['json'](_0x4d58e9);}return null;};}function patchUpdates(_0x3a09f6){return function(_0x2cdae3){try{jsonpatch[_0xc498('0x1f')](_0x2cdae3,_0x3a09f6,!![]);}catch(_0x34ce1e){return BPromise[_0xc498('0x20')](_0x34ce1e);}return _0x2cdae3[_0xc498('0x21')]();};}function saveUpdates(_0xe0d841,_0x2bcbbc){return function(_0x52733e){if(_0x52733e){return _0x52733e['update'](_0xe0d841)[_0xc498('0x22')](function(_0x266136){return _0x266136;});}return null;};}function removeEntity(_0x4e39e4,_0x191642){return function(_0x35fbc6){if(_0x35fbc6){return _0x35fbc6[_0xc498('0x23')]()[_0xc498('0x22')](function(){var _0x4eb492=_0x35fbc6[_0xc498('0x24')]({'plain':!![]});var _0x5cd627=_0xc498('0x25');return db[_0xc498('0x26')][_0xc498('0x23')]({'where':{'type':_0x5cd627,'resourceId':_0x4eb492['id']}})[_0xc498('0x22')](function(){return _0x35fbc6;});})['then'](function(){_0x4e39e4['status'](0xcc)[_0xc498('0x17')]();});}};}function handleEntityNotFound(_0x1c6f2a,_0x46c82a){return function(_0x66f77a){if(!_0x66f77a){_0x1c6f2a[_0xc498('0x16')](0x194);}return _0x66f77a;};}function handleError(_0x244108,_0x35150c){_0x35150c=_0x35150c||0x1f4;return function(_0x4ac8d8){logger['error'](_0x4ac8d8['stack']);if(_0x4ac8d8['name']){delete _0x4ac8d8[_0xc498('0x27')];}_0x244108['status'](_0x35150c)['send'](_0x4ac8d8);};}exports[_0xc498('0x28')]=function(_0x3c3466,_0x461300){var _0x3bb9a4={},_0x14c9ba={},_0x11f4c2={'count':0x0,'rows':[]};var _0x1d2dcd=_['map'](db[_0xc498('0x29')][_0xc498('0x2a')],function(_0x2a466f){return{'name':_0x2a466f[_0xc498('0x2b')],'type':_0x2a466f['type'][_0xc498('0x2c')]};});_0x14c9ba[_0xc498('0x2d')]=_[_0xc498('0x2e')](_0x1d2dcd,_0xc498('0x27'));_0x14c9ba[_0xc498('0x2f')]=_['keys'](_0x3c3466['query']);_0x14c9ba['filters']=_[_0xc498('0x30')](_0x14c9ba[_0xc498('0x2d')],_0x14c9ba[_0xc498('0x2f')]);_0x3bb9a4[_0xc498('0x31')]=_[_0xc498('0x30')](_0x14c9ba['model'],qs[_0xc498('0x32')](_0x3c3466['query'][_0xc498('0x32')]));_0x3bb9a4[_0xc498('0x31')]=_0x3bb9a4[_0xc498('0x31')][_0xc498('0x33')]?_0x3bb9a4['attributes']:_0x14c9ba['model'];if(!_0x3c3466[_0xc498('0x2f')][_0xc498('0x34')](_0xc498('0x35'))){_0x3bb9a4[_0xc498('0x1c')]=qs[_0xc498('0x1c')](_0x3c3466[_0xc498('0x2f')]['limit']);_0x3bb9a4[_0xc498('0x1a')]=qs[_0xc498('0x1a')](_0x3c3466['query']['offset']);}_0x3bb9a4[_0xc498('0x36')]=qs[_0xc498('0x37')](_0x3c3466['query']['sort']);_0x3bb9a4['where']=qs[_0xc498('0x38')](_[_0xc498('0x39')](_0x3c3466[_0xc498('0x2f')],_0x14c9ba[_0xc498('0x38')]),_0x1d2dcd);if(_0x3c3466[_0xc498('0x2f')][_0xc498('0x3a')]){_0x3bb9a4[_0xc498('0x3b')]=_[_0xc498('0x3c')](_0x3bb9a4[_0xc498('0x3b')],{'$or':_[_0xc498('0x2e')](_0x1d2dcd,function(_0x1b5fb6){if(_0x1b5fb6[_0xc498('0x3d')]!=='VIRTUAL'){var _0x3f6308={};_0x3f6308[_0x1b5fb6[_0xc498('0x27')]]={'$like':'%'+_0x3c3466['query'][_0xc498('0x3a')]+'%'};return _0x3f6308;}})});}_0x3bb9a4=_[_0xc498('0x3c')]({},_0x3bb9a4,_0x3c3466[_0xc498('0x3e')]);var _0x41d499={'where':_0x3bb9a4[_0xc498('0x3b')]};return db[_0xc498('0x29')][_0xc498('0x1d')](_0x41d499)[_0xc498('0x22')](function(_0x1d72f5){_0x11f4c2[_0xc498('0x1d')]=_0x1d72f5;if(_0x3c3466[_0xc498('0x2f')][_0xc498('0x3f')]){_0x3bb9a4[_0xc498('0x40')]=[{'all':!![]}];}return db[_0xc498('0x29')][_0xc498('0x41')](_0x3bb9a4);})[_0xc498('0x22')](function(_0x14a278){_0x11f4c2['rows']=_0x14a278;return _0x11f4c2;})[_0xc498('0x22')](respondWithFilteredResult(_0x461300,_0x3bb9a4))[_0xc498('0x42')](handleError(_0x461300,null));};exports[_0xc498('0x43')]=function(_0x1134c8,_0x57e964){var _0x2f94fb={'raw':!![],'where':{'id':_0x1134c8[_0xc498('0x44')]['id']}},_0x5f09d5={};_0x5f09d5[_0xc498('0x2d')]=_[_0xc498('0x45')](db[_0xc498('0x29')][_0xc498('0x2a')]);_0x5f09d5['query']=_['keys'](_0x1134c8[_0xc498('0x2f')]);_0x5f09d5[_0xc498('0x38')]=_[_0xc498('0x30')](_0x5f09d5[_0xc498('0x2d')],_0x5f09d5['query']);_0x2f94fb[_0xc498('0x31')]=_['intersection'](_0x5f09d5['model'],qs[_0xc498('0x32')](_0x1134c8['query']['fields']));_0x2f94fb['attributes']=_0x2f94fb['attributes'][_0xc498('0x33')]?_0x2f94fb[_0xc498('0x31')]:_0x5f09d5[_0xc498('0x2d')];if(_0x1134c8[_0xc498('0x2f')][_0xc498('0x3f')]){_0x2f94fb[_0xc498('0x40')]=[{'all':!![]}];}_0x2f94fb=_[_0xc498('0x3c')]({},_0x2f94fb,_0x1134c8[_0xc498('0x3e')]);return db['Pause'][_0xc498('0x46')](_0x2f94fb)[_0xc498('0x22')](handleEntityNotFound(_0x57e964,null))['then'](respondWithResult(_0x57e964,null))[_0xc498('0x42')](handleError(_0x57e964,null));};exports[_0xc498('0x47')]=function(_0xf2623d,_0x3bdc61){return db[_0xc498('0x29')][_0xc498('0x47')](_0xf2623d[_0xc498('0x48')],{})[_0xc498('0x22')](function(_0x6c9ce3){var _0x32a2e0=_0xf2623d['user'][_0xc498('0x24')]({'plain':!![]});if(!_0x32a2e0)throw new Error(_0xc498('0x49'));if(_0x32a2e0['role']===_0xc498('0x4a')){var _0x11f4db=_0x6c9ce3[_0xc498('0x24')]({'plain':!![]});var _0x585710='Pauses';return db[_0xc498('0x4b')]['find']({'where':{'name':_0x585710,'userProfileId':_0x32a2e0[_0xc498('0x4c')]},'raw':!![]})[_0xc498('0x22')](function(_0x30d515){if(_0x30d515&&_0x30d515[_0xc498('0x4d')]===0x0){return db[_0xc498('0x26')][_0xc498('0x47')]({'name':_0x11f4db[_0xc498('0x27')],'resourceId':_0x11f4db['id'],'type':_0x30d515['name'],'sectionId':_0x30d515['id']},{})['then'](function(){return _0x6c9ce3;});}else{return _0x6c9ce3;}})['catch'](function(_0x45ea8b){logger[_0xc498('0x4e')](_0xc498('0x4f'),_0x45ea8b);throw _0x45ea8b;});}return _0x6c9ce3;})['then'](respondWithResult(_0x3bdc61,0xc9))[_0xc498('0x42')](handleError(_0x3bdc61,null));};exports[_0xc498('0x50')]=function(_0x34019f,_0x160c11){if(_0x34019f[_0xc498('0x48')]['id']){delete _0x34019f[_0xc498('0x48')]['id'];}return db[_0xc498('0x29')][_0xc498('0x46')]({'where':{'id':_0x34019f['params']['id']}})[_0xc498('0x22')](handleEntityNotFound(_0x160c11,null))[_0xc498('0x22')](saveUpdates(_0x34019f[_0xc498('0x48')],null))[_0xc498('0x22')](respondWithResult(_0x160c11,null))[_0xc498('0x42')](handleError(_0x160c11,null));};exports[_0xc498('0x23')]=function(_0x2c633c,_0x573511){return db[_0xc498('0x29')][_0xc498('0x46')]({'where':{'id':_0x2c633c['params']['id']}})[_0xc498('0x22')](handleEntityNotFound(_0x573511,null))['then'](removeEntity(_0x573511,null))['catch'](handleError(_0x573511,null));}; \ No newline at end of file +var _0x8b14=['keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','Pauses','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query'];(function(_0x233da7,_0x1e416e){var _0x1a9c19=function(_0x5797c3){while(--_0x5797c3){_0x233da7['push'](_0x233da7['shift']());}};_0x1a9c19(++_0x1e416e);}(_0x8b14,0x1d3));var _0x48b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b14[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x48b1('0x0'));var rimraf=require(_0x48b1('0x1'));var zipdir=require(_0x48b1('0x2'));var jsonpatch=require(_0x48b1('0x3'));var rp=require(_0x48b1('0x4'));var moment=require(_0x48b1('0x5'));var BPromise=require(_0x48b1('0x6'));var Mustache=require(_0x48b1('0x7'));var util=require(_0x48b1('0x8'));var path=require(_0x48b1('0x9'));var sox=require(_0x48b1('0xa'));var csv=require(_0x48b1('0xb'));var ejs=require(_0x48b1('0xc'));var fs=require('fs');var fs_extra=require(_0x48b1('0xd'));var _=require('lodash');var squel=require(_0x48b1('0xe'));var crypto=require('crypto');var jsforce=require(_0x48b1('0xf'));var deskjs=require(_0x48b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x48b1('0x11'));var Papa=require(_0x48b1('0x12'));var Redis=require(_0x48b1('0x13'));var authService=require(_0x48b1('0x14'));var qs=require(_0x48b1('0x15'));var as=require(_0x48b1('0x16'));var hardwareService=require(_0x48b1('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x48b1('0x18'));var config=require(_0x48b1('0x19'));var licenseUtil=require(_0x48b1('0x1a'));var db=require(_0x48b1('0x1b'))['db'];function respondWithStatusCode(_0x2ae97d,_0x235955){_0x235955=_0x235955||0xcc;return function(_0x1314b5){if(_0x1314b5){return _0x2ae97d[_0x48b1('0x1c')](_0x235955);}return _0x2ae97d['status'](_0x235955)[_0x48b1('0x1d')]();};}function respondWithResult(_0x555cd6,_0x37e030){_0x37e030=_0x37e030||0xc8;return function(_0x3e0705){if(_0x3e0705){return _0x555cd6[_0x48b1('0x1e')](_0x37e030)[_0x48b1('0x1f')](_0x3e0705);}};}function respondWithFilteredResult(_0x3eb0e8,_0x410fb1){return function(_0x17a1be){if(_0x17a1be){var _0x52a732=typeof _0x410fb1[_0x48b1('0x20')]===_0x48b1('0x21')&&typeof _0x410fb1[_0x48b1('0x22')]===_0x48b1('0x21');var _0x3a23ed=_0x17a1be[_0x48b1('0x23')];var _0x367259=_0x52a732?0x0:_0x410fb1[_0x48b1('0x20')];var _0x4f80e1=_0x52a732?_0x17a1be['count']:_0x410fb1['offset']+_0x410fb1[_0x48b1('0x22')];var _0x2aa3b1;if(_0x4f80e1>=_0x3a23ed){_0x4f80e1=_0x3a23ed;_0x2aa3b1=0xc8;}else{_0x2aa3b1=0xce;}_0x3eb0e8[_0x48b1('0x1e')](_0x2aa3b1);return _0x3eb0e8['set'](_0x48b1('0x24'),_0x367259+'-'+_0x4f80e1+'/'+_0x3a23ed)[_0x48b1('0x1f')](_0x17a1be);}return null;};}function patchUpdates(_0x447b47){return function(_0x5bacf8){try{jsonpatch[_0x48b1('0x25')](_0x5bacf8,_0x447b47,!![]);}catch(_0x17028f){return BPromise[_0x48b1('0x26')](_0x17028f);}return _0x5bacf8['save']();};}function saveUpdates(_0x52b603,_0x249d16){return function(_0x2dd905){if(_0x2dd905){return _0x2dd905['update'](_0x52b603)[_0x48b1('0x27')](function(_0x526c71){return _0x526c71;});}return null;};}function removeEntity(_0x49198e,_0x562206){return function(_0x393293){if(_0x393293){return _0x393293[_0x48b1('0x28')]()[_0x48b1('0x27')](function(){var _0x269297=_0x393293[_0x48b1('0x29')]({'plain':!![]});var _0x398bc3=_0x48b1('0x2a');return db['UserProfileResource'][_0x48b1('0x28')]({'where':{'type':_0x398bc3,'resourceId':_0x269297['id']}})['then'](function(){return _0x393293;});})[_0x48b1('0x27')](function(){_0x49198e['status'](0xcc)[_0x48b1('0x1d')]();});}};}function handleEntityNotFound(_0x5673be,_0x293c25){return function(_0x55f539){if(!_0x55f539){_0x5673be['sendStatus'](0x194);}return _0x55f539;};}function handleError(_0x24b7c7,_0x1bc0d3){_0x1bc0d3=_0x1bc0d3||0x1f4;return function(_0x12ec83){logger['error'](_0x12ec83[_0x48b1('0x2b')]);if(_0x12ec83[_0x48b1('0x2c')]){delete _0x12ec83[_0x48b1('0x2c')];}_0x24b7c7[_0x48b1('0x1e')](_0x1bc0d3)[_0x48b1('0x2d')](_0x12ec83);};}exports[_0x48b1('0x2e')]=function(_0x683f90,_0x53a4d6){var _0x105a12={},_0x11b847={},_0x23600a={'count':0x0,'rows':[]};var _0x26b5ec=_[_0x48b1('0x2f')](db[_0x48b1('0x30')][_0x48b1('0x31')],function(_0x582861){return{'name':_0x582861[_0x48b1('0x32')],'type':_0x582861[_0x48b1('0x33')][_0x48b1('0x34')]};});_0x11b847[_0x48b1('0x35')]=_[_0x48b1('0x2f')](_0x26b5ec,_0x48b1('0x2c'));_0x11b847[_0x48b1('0x36')]=_[_0x48b1('0x37')](_0x683f90[_0x48b1('0x36')]);_0x11b847['filters']=_[_0x48b1('0x38')](_0x11b847[_0x48b1('0x35')],_0x11b847[_0x48b1('0x36')]);_0x105a12[_0x48b1('0x39')]=_['intersection'](_0x11b847[_0x48b1('0x35')],qs['fields'](_0x683f90['query']['fields']));_0x105a12[_0x48b1('0x39')]=_0x105a12[_0x48b1('0x39')][_0x48b1('0x3a')]?_0x105a12[_0x48b1('0x39')]:_0x11b847[_0x48b1('0x35')];if(!_0x683f90[_0x48b1('0x36')]['hasOwnProperty'](_0x48b1('0x3b'))){_0x105a12[_0x48b1('0x22')]=qs[_0x48b1('0x22')](_0x683f90['query']['limit']);_0x105a12[_0x48b1('0x20')]=qs['offset'](_0x683f90[_0x48b1('0x36')]['offset']);}_0x105a12[_0x48b1('0x3c')]=qs[_0x48b1('0x3d')](_0x683f90[_0x48b1('0x36')][_0x48b1('0x3d')]);_0x105a12[_0x48b1('0x3e')]=qs[_0x48b1('0x3f')](_[_0x48b1('0x40')](_0x683f90[_0x48b1('0x36')],_0x11b847['filters']),_0x26b5ec);if(_0x683f90[_0x48b1('0x36')][_0x48b1('0x41')]){_0x105a12['where']=_[_0x48b1('0x42')](_0x105a12[_0x48b1('0x3e')],{'$or':_[_0x48b1('0x2f')](_0x26b5ec,function(_0x27dd7c){if(_0x27dd7c[_0x48b1('0x33')]!==_0x48b1('0x43')){var _0x1a3af2={};_0x1a3af2[_0x27dd7c[_0x48b1('0x2c')]]={'$like':'%'+_0x683f90[_0x48b1('0x36')][_0x48b1('0x41')]+'%'};return _0x1a3af2;}})});}_0x105a12=_[_0x48b1('0x42')]({},_0x105a12,_0x683f90[_0x48b1('0x44')]);var _0x16c85c={'where':_0x105a12['where']};return db[_0x48b1('0x30')][_0x48b1('0x23')](_0x16c85c)['then'](function(_0x5822ec){_0x23600a[_0x48b1('0x23')]=_0x5822ec;if(_0x683f90[_0x48b1('0x36')][_0x48b1('0x45')]){_0x105a12[_0x48b1('0x46')]=[{'all':!![]}];}return db['Pause'][_0x48b1('0x47')](_0x105a12);})[_0x48b1('0x27')](function(_0x290c11){_0x23600a[_0x48b1('0x48')]=_0x290c11;return _0x23600a;})[_0x48b1('0x27')](respondWithFilteredResult(_0x53a4d6,_0x105a12))['catch'](handleError(_0x53a4d6,null));};exports[_0x48b1('0x49')]=function(_0x42a7ff,_0x4352a6){var _0x81ede6={'raw':!![],'where':{'id':_0x42a7ff[_0x48b1('0x4a')]['id']}},_0x153791={};_0x153791[_0x48b1('0x35')]=_[_0x48b1('0x37')](db[_0x48b1('0x30')]['rawAttributes']);_0x153791[_0x48b1('0x36')]=_[_0x48b1('0x37')](_0x42a7ff[_0x48b1('0x36')]);_0x153791['filters']=_['intersection'](_0x153791[_0x48b1('0x35')],_0x153791[_0x48b1('0x36')]);_0x81ede6[_0x48b1('0x39')]=_[_0x48b1('0x38')](_0x153791[_0x48b1('0x35')],qs[_0x48b1('0x4b')](_0x42a7ff[_0x48b1('0x36')][_0x48b1('0x4b')]));_0x81ede6[_0x48b1('0x39')]=_0x81ede6[_0x48b1('0x39')][_0x48b1('0x3a')]?_0x81ede6['attributes']:_0x153791[_0x48b1('0x35')];if(_0x42a7ff[_0x48b1('0x36')][_0x48b1('0x45')]){_0x81ede6[_0x48b1('0x46')]=[{'all':!![]}];}_0x81ede6=_[_0x48b1('0x42')]({},_0x81ede6,_0x42a7ff['options']);return db[_0x48b1('0x30')][_0x48b1('0x4c')](_0x81ede6)['then'](handleEntityNotFound(_0x4352a6,null))[_0x48b1('0x27')](respondWithResult(_0x4352a6,null))['catch'](handleError(_0x4352a6,null));};exports[_0x48b1('0x4d')]=function(_0x110d5d,_0x569f1c){return db[_0x48b1('0x30')][_0x48b1('0x4d')](_0x110d5d[_0x48b1('0x4e')],{})[_0x48b1('0x27')](function(_0xd80df9){var _0x3de297=_0x110d5d[_0x48b1('0x4f')]['get']({'plain':!![]});if(!_0x3de297)throw new Error(_0x48b1('0x50'));if(_0x3de297[_0x48b1('0x51')]===_0x48b1('0x4f')){var _0x86ac28=_0xd80df9[_0x48b1('0x29')]({'plain':!![]});var _0x550779=_0x48b1('0x2a');return db['UserProfileSection'][_0x48b1('0x4c')]({'where':{'name':_0x550779,'userProfileId':_0x3de297[_0x48b1('0x52')]},'raw':!![]})[_0x48b1('0x27')](function(_0x7afbdd){if(_0x7afbdd&&_0x7afbdd[_0x48b1('0x53')]===0x0){return db[_0x48b1('0x54')][_0x48b1('0x4d')]({'name':_0x86ac28[_0x48b1('0x2c')],'resourceId':_0x86ac28['id'],'type':_0x7afbdd['name'],'sectionId':_0x7afbdd['id']},{})[_0x48b1('0x27')](function(){return _0xd80df9;});}else{return _0xd80df9;}})[_0x48b1('0x55')](function(_0x3bff0e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bff0e);throw _0x3bff0e;});}return _0xd80df9;})[_0x48b1('0x27')](respondWithResult(_0x569f1c,0xc9))['catch'](handleError(_0x569f1c,null));};exports[_0x48b1('0x56')]=function(_0x3a3c3a,_0x17607d){if(_0x3a3c3a[_0x48b1('0x4e')]['id']){delete _0x3a3c3a[_0x48b1('0x4e')]['id'];}return db['Pause'][_0x48b1('0x4c')]({'where':{'id':_0x3a3c3a[_0x48b1('0x4a')]['id']}})[_0x48b1('0x27')](handleEntityNotFound(_0x17607d,null))['then'](saveUpdates(_0x3a3c3a[_0x48b1('0x4e')],null))['then'](respondWithResult(_0x17607d,null))[_0x48b1('0x55')](handleError(_0x17607d,null));};exports[_0x48b1('0x28')]=function(_0x2bbcc6,_0x33c221){return db['Pause']['find']({'where':{'id':_0x2bbcc6[_0x48b1('0x4a')]['id']}})[_0x48b1('0x27')](handleEntityNotFound(_0x33c221,null))[_0x48b1('0x27')](removeEntity(_0x33c221,null))['catch'](handleError(_0x33c221,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 66d8b4d..74651fa 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6aa7,0x178));var _0x76aa=function(_0x40c0f5,_0x5734ab){_0x40c0f5=_0x40c0f5-0x0;var _0x554ea6=_0x6aa7[_0x40c0f5];return _0x554ea6;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 db68ad0..1291e31 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x11b56e,_0x5495d1){var _0x33a148=function(_0x4f7104){while(--_0x4f7104){_0x11b56e['push'](_0x11b56e['shift']());}};_0x33a148(++_0x5495d1);}(_0x7a54,0x106));var _0x47a5=function(_0x5e50c5,_0x237e62){_0x5e50c5=_0x5e50c5-0x0;var _0x2c9a21=_0x7a54[_0x5e50c5];return _0x2c9a21;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x89510e,_0x5dc9ce){var _0x3714d9=function(_0x304401){while(--_0x304401){_0x89510e['push'](_0x89510e['shift']());}};_0x3714d9(++_0x5dc9ce);}(_0x7a54,0x106));var _0x47a5=function(_0x4c946b,_0x5b0b7d){_0x4c946b=_0x4c946b-0x0;var _0x2c718e=_0x7a54[_0x4c946b];return _0x2c718e;};'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 35b99fb..efb389a 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 _0x2dae=['put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','file','upload'];(function(_0x5d01d3,_0x51dc49){var _0x3764a5=function(_0x4752d2){while(--_0x4752d2){_0x5d01d3['push'](_0x5d01d3['shift']());}};_0x3764a5(++_0x51dc49);}(_0x2dae,0xc3));var _0xe2da=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x2dae[_0x593d89];return _0x4aa403;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),controller[_0xe2da('0xc')]);router[_0xe2da('0x9')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0xf')]);router[_0xe2da('0x9')]('/:id/download',auth[_0xe2da('0xe')](),controller[_0xe2da('0x10')]);var upload=multer({'storage':multer[_0xe2da('0x11')]({'destination':function(_0x17086c,_0x3c1309,_0x44ec3e){_0x44ec3e(null,path[_0xe2da('0x12')](config[_0xe2da('0x13')],'server/files/plugins'));},'filename':function(_0xb98909,_0x5200b1,_0x4377c6){_0x5200b1[_0xe2da('0x14')]=_0x5200b1[_0xe2da('0x14')][_0xe2da('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4377c6(null,util[_0xe2da('0x16')](_0xe2da('0x17'),path[_0xe2da('0x18')](_0x5200b1['originalname'],path[_0xe2da('0x19')](_0x5200b1['originalname'])),Date['now'](),path[_0xe2da('0x19')](_0x5200b1[_0xe2da('0x14')])));}})});router[_0xe2da('0x1a')]('/',upload['single'](_0xe2da('0x1b')),controller[_0xe2da('0x1c')]);router[_0xe2da('0x1a')](_0xe2da('0xb'),controller['webhookPost']);router[_0xe2da('0x1d')](_0xe2da('0xd'),auth[_0xe2da('0xe')](),controller[_0xe2da('0x1e')]);router[_0xe2da('0x1f')]('/:id',auth[_0xe2da('0xe')](),controller[_0xe2da('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x1cc7=['path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util'];(function(_0x4fe35d,_0x21fee1){var _0x5bb28e=function(_0x214051){while(--_0x214051){_0x4fe35d['push'](_0x4fe35d['shift']());}};_0x5bb28e(++_0x21fee1);}(_0x1cc7,0x15a));var _0x71cc=function(_0x491a1b,_0x345b25){_0x491a1b=_0x491a1b-0x0;var _0x112170=_0x1cc7[_0x491a1b];return _0x112170;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')](_0x71cc('0xa'),auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0x7')](_0x71cc('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b7514,_0xeb4747,_0x2db190){_0x2db190(null,path[_0x71cc('0xd')](config['root'],_0x71cc('0xe')));},'filename':function(_0x550b3c,_0x1aad83,_0x4f9c5c){_0x1aad83[_0x71cc('0xf')]=_0x1aad83['originalname'][_0x71cc('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f9c5c(null,util[_0x71cc('0x11')](_0x71cc('0x12'),path[_0x71cc('0x13')](_0x1aad83[_0x71cc('0xf')],path['extname'](_0x1aad83[_0x71cc('0xf')])),Date[_0x71cc('0x14')](),path[_0x71cc('0x15')](_0x1aad83[_0x71cc('0xf')])));}})});router[_0x71cc('0x16')]('/',upload[_0x71cc('0x17')](_0x71cc('0x18')),controller['upload']);router[_0x71cc('0x16')](_0x71cc('0x8'),controller[_0x71cc('0x19')]);router[_0x71cc('0x1a')](_0x71cc('0xa'),auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0x1b')](_0x71cc('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x71cc('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index c08b1fd..48065b5 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 _0xf5cc=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xf5cc,0x1af));var _0xcf5c=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xf5cc[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require(_0xcf5c('0x0'));module[_0xcf5c('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xcf5c('0x2')]('html','script')},'description':{'type':Sequelize[_0xcf5c('0x3')]},'version':{'type':Sequelize[_0xcf5c('0x3')]},'path':{'type':Sequelize[_0xcf5c('0x4')],'comment':_0xcf5c('0x5')},'active':{'type':Sequelize[_0xcf5c('0x6')],'defaultValue':0x0,'comment':_0xcf5c('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xcf5c('0x8'),_0xcf5c('0x9'),'always',_0xcf5c('0xa')),'defaultValue':_0xcf5c('0xb'),'comment':_0xcf5c('0xc')},'icon':{'type':Sequelize[_0xcf5c('0x4')]},'adminUrl':{'type':Sequelize[_0xcf5c('0x4')]},'agentUrl':{'type':Sequelize[_0xcf5c('0x4')]},'scriptName':{'type':Sequelize[_0xcf5c('0x4')]},'scriptPath':{'type':Sequelize[_0xcf5c('0x4')]}}; \ No newline at end of file +var _0x236a=['sequelize','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','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x236a,0x96));var _0xa236=function(_0x445979,_0x18811a){_0x445979=_0x445979-0x0;var _0x117b2d=_0x236a[_0x445979];return _0x117b2d;};'use strict';var Sequelize=require(_0xa236('0x0'));module[_0xa236('0x1')]={'name':{'type':Sequelize[_0xa236('0x2')]},'type':{'type':Sequelize[_0xa236('0x3')](_0xa236('0x4'),_0xa236('0x5'))},'description':{'type':Sequelize[_0xa236('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xa236('0x7')},'active':{'type':Sequelize[_0xa236('0x8')],'defaultValue':0x0,'comment':_0xa236('0x9')},'sidebar':{'type':Sequelize['ENUM'](_0xa236('0xa'),_0xa236('0xb'),'always',_0xa236('0xc')),'defaultValue':_0xa236('0xd'),'comment':_0xa236('0xe')},'icon':{'type':Sequelize[_0xa236('0x2')]},'adminUrl':{'type':Sequelize[_0xa236('0x2')]},'agentUrl':{'type':Sequelize[_0xa236('0x2')]},'scriptName':{'type':Sequelize[_0xa236('0x2')]},'scriptPath':{'type':Sequelize[_0xa236('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5c7e4aa..9e40280 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 _0x1244=['where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','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','admin','agent','script','scriptName','scriptPath','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','params','delete','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-type','endsWith','statusCode','http://localhost:','content-length','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0x1244,0x65));var _0x4124=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x1244[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4124('0x0'));var jsonpatch=require(_0x4124('0x1'));var rp=require(_0x4124('0x2'));var moment=require(_0x4124('0x3'));var BPromise=require(_0x4124('0x4'));var Mustache=require('mustache');var util=require(_0x4124('0x5'));var path=require(_0x4124('0x6'));var sox=require(_0x4124('0x7'));var csv=require(_0x4124('0x8'));var ejs=require(_0x4124('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4124('0xa'));var squel=require(_0x4124('0xb'));var crypto=require('crypto');var jsforce=require(_0x4124('0xc'));var deskjs=require(_0x4124('0xd'));var toCsv=require(_0x4124('0x8'));var querystring=require(_0x4124('0xe'));var Papa=require(_0x4124('0xf'));var extract=require('extract-zip');var rimraf=require(_0x4124('0x10'));var archiver=require('archiver');var Redis=require(_0x4124('0x11'));var authService=require(_0x4124('0x12'));var qs=require(_0x4124('0x13'));var as=require(_0x4124('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4124('0x15'))(_0x4124('0x16'));var utils=require(_0x4124('0x17'));var config=require(_0x4124('0x18'));var licenseUtil=require(_0x4124('0x19'));var db=require(_0x4124('0x1a'))['db'];config[_0x4124('0x1b')]=_['defaults'](config[_0x4124('0x1b')],{'host':_0x4124('0x1c'),'port':0x18eb});var socket=require(_0x4124('0x1d'))(new Redis(config[_0x4124('0x1b')]));require(_0x4124('0x1e'))[_0x4124('0x1f')](socket);function respondWithStatusCode(_0x3bbe1b,_0xc8091){_0xc8091=_0xc8091||0xcc;return function(_0x20fb6e){if(_0x20fb6e){return _0x3bbe1b[_0x4124('0x20')](_0xc8091);}return _0x3bbe1b[_0x4124('0x21')](_0xc8091)[_0x4124('0x22')]();};}function respondWithResult(_0x17e831,_0x5a7787){_0x5a7787=_0x5a7787||0xc8;return function(_0xce2373){if(_0xce2373){return _0x17e831[_0x4124('0x21')](_0x5a7787)[_0x4124('0x23')](_0xce2373);}};}function respondWithFilteredResult(_0x4e5d07,_0x4d23a8){return function(_0x54722d){if(_0x54722d){var _0x290b8c=typeof _0x4d23a8[_0x4124('0x24')]===_0x4124('0x25')&&typeof _0x4d23a8['limit']===_0x4124('0x25');var _0x5b0166=_0x54722d['count'];var _0x4e7e78=_0x290b8c?0x0:_0x4d23a8[_0x4124('0x24')];var _0x5552b1=_0x290b8c?_0x54722d['count']:_0x4d23a8[_0x4124('0x24')]+_0x4d23a8[_0x4124('0x26')];var _0x3b2f44;if(_0x5552b1>=_0x5b0166){_0x5552b1=_0x5b0166;_0x3b2f44=0xc8;}else{_0x3b2f44=0xce;}_0x4e5d07['status'](_0x3b2f44);return _0x4e5d07[_0x4124('0x27')](_0x4124('0x28'),_0x4e7e78+'-'+_0x5552b1+'/'+_0x5b0166)['json'](_0x54722d);}return null;};}function patchUpdates(_0x581928){return function(_0xe931b7){try{jsonpatch[_0x4124('0x29')](_0xe931b7,_0x581928,!![]);}catch(_0x12c179){return BPromise[_0x4124('0x2a')](_0x12c179);}return _0xe931b7[_0x4124('0x2b')]();};}function saveUpdates(_0x3753d9,_0x1478ae){return function(_0x2659c5){if(_0x2659c5){return _0x2659c5[_0x4124('0x2c')](_0x3753d9)[_0x4124('0x2d')](function(_0xf6eeee){return _0xf6eeee;});}return null;};}function removeEntity(_0x252296,_0x39eee6){return function(_0x2d4764){if(_0x2d4764){return _0x2d4764[_0x4124('0x2e')]()[_0x4124('0x2d')](function(){var _0x270350=_0x2d4764[_0x4124('0x2f')]({'plain':!![]});var _0x109384='Plugins';return db[_0x4124('0x30')][_0x4124('0x2e')]({'where':{'type':_0x109384,'resourceId':_0x270350['id']}})['then'](function(){return _0x2d4764;});})['then'](function(){_0x252296[_0x4124('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552c52,_0x5eef0b){return function(_0x428a21){if(!_0x428a21){_0x552c52[_0x4124('0x20')](0x194);}return _0x428a21;};}function handleError(_0x5efcbe,_0x58212c){_0x58212c=_0x58212c||0x1f4;return function(_0x43e5a2){logger[_0x4124('0x31')](_0x43e5a2[_0x4124('0x32')]);if(_0x43e5a2[_0x4124('0x33')]){delete _0x43e5a2['name'];}_0x5efcbe[_0x4124('0x21')](_0x58212c)[_0x4124('0x34')](_0x43e5a2);};}exports[_0x4124('0x35')]=function(_0x3baaa0,_0x4bf09f){var _0x37c36f={},_0x166abc={},_0x52cad0={'count':0x0,'rows':[]};var _0x10f187=_[_0x4124('0x36')](db[_0x4124('0x37')][_0x4124('0x38')],function(_0x49fc0b){return{'name':_0x49fc0b[_0x4124('0x39')],'type':_0x49fc0b[_0x4124('0x3a')][_0x4124('0x3b')]};});_0x166abc[_0x4124('0x3c')]=_[_0x4124('0x36')](_0x10f187,_0x4124('0x33'));_0x166abc[_0x4124('0x3d')]=_[_0x4124('0x3e')](_0x3baaa0[_0x4124('0x3d')]);_0x166abc[_0x4124('0x3f')]=_[_0x4124('0x40')](_0x166abc['model'],_0x166abc[_0x4124('0x3d')]);_0x37c36f[_0x4124('0x41')]=_[_0x4124('0x40')](_0x166abc[_0x4124('0x3c')],qs[_0x4124('0x42')](_0x3baaa0['query'][_0x4124('0x42')]));_0x37c36f[_0x4124('0x41')]=_0x37c36f['attributes'][_0x4124('0x43')]?_0x37c36f['attributes']:_0x166abc[_0x4124('0x3c')];if(!_0x3baaa0['query']['hasOwnProperty'](_0x4124('0x44'))){_0x37c36f[_0x4124('0x26')]=qs['limit'](_0x3baaa0['query'][_0x4124('0x26')]);_0x37c36f[_0x4124('0x24')]=qs[_0x4124('0x24')](_0x3baaa0[_0x4124('0x3d')][_0x4124('0x24')]);}_0x37c36f[_0x4124('0x45')]=qs['sort'](_0x3baaa0[_0x4124('0x3d')][_0x4124('0x46')]);_0x37c36f[_0x4124('0x47')]=qs[_0x4124('0x3f')](_[_0x4124('0x48')](_0x3baaa0[_0x4124('0x3d')],_0x166abc[_0x4124('0x3f')]),_0x10f187);if(_0x3baaa0['query'][_0x4124('0x49')]){_0x37c36f[_0x4124('0x47')]=_[_0x4124('0x4a')](_0x37c36f['where'],{'$or':_[_0x4124('0x36')](_0x10f187,function(_0x3c77da){if(_0x3c77da[_0x4124('0x3a')]!==_0x4124('0x4b')){var _0xc0f58a={};_0xc0f58a[_0x3c77da['name']]={'$like':'%'+_0x3baaa0[_0x4124('0x3d')][_0x4124('0x49')]+'%'};return _0xc0f58a;}})});}_0x37c36f=_[_0x4124('0x4a')]({},_0x37c36f,_0x3baaa0[_0x4124('0x4c')]);var _0x4dd575={'where':_0x37c36f[_0x4124('0x47')]};return db[_0x4124('0x37')][_0x4124('0x4d')](_0x4dd575)[_0x4124('0x2d')](function(_0x3d9193){_0x52cad0['count']=_0x3d9193;if(_0x3baaa0[_0x4124('0x3d')][_0x4124('0x4e')]){_0x37c36f[_0x4124('0x4f')]=[{'all':!![]}];}return db[_0x4124('0x37')][_0x4124('0x50')](_0x37c36f);})[_0x4124('0x2d')](function(_0x5bb5c9){_0x52cad0['rows']=_0x5bb5c9;return _0x52cad0;})['then'](respondWithFilteredResult(_0x4bf09f,_0x37c36f))[_0x4124('0x51')](handleError(_0x4bf09f,null));};exports['show']=function(_0x36193a,_0x56788b){var _0x54447c={'raw':!![],'where':{'id':_0x36193a['params']['id']}},_0x33fec5={};_0x33fec5[_0x4124('0x3c')]=_[_0x4124('0x3e')](db[_0x4124('0x37')]['rawAttributes']);_0x33fec5['query']=_[_0x4124('0x3e')](_0x36193a[_0x4124('0x3d')]);_0x33fec5[_0x4124('0x3f')]=_[_0x4124('0x40')](_0x33fec5[_0x4124('0x3c')],_0x33fec5[_0x4124('0x3d')]);_0x54447c[_0x4124('0x41')]=_[_0x4124('0x40')](_0x33fec5[_0x4124('0x3c')],qs[_0x4124('0x42')](_0x36193a['query'][_0x4124('0x42')]));_0x54447c[_0x4124('0x41')]=_0x54447c[_0x4124('0x41')][_0x4124('0x43')]?_0x54447c[_0x4124('0x41')]:_0x33fec5[_0x4124('0x3c')];if(_0x36193a[_0x4124('0x3d')]['includeAll']){_0x54447c[_0x4124('0x4f')]=[{'all':!![]}];}_0x54447c=_[_0x4124('0x4a')]({},_0x54447c,_0x36193a[_0x4124('0x4c')]);return db[_0x4124('0x37')][_0x4124('0x52')](_0x54447c)[_0x4124('0x2d')](handleEntityNotFound(_0x56788b,null))['then'](respondWithResult(_0x56788b,null))[_0x4124('0x51')](handleError(_0x56788b,null));};exports[_0x4124('0x53')]=function(_0x13152f,_0x4ed0d3,_0x5dff2b){return db['Plugin'][_0x4124('0x52')]({'where':{'id':_0x13152f['params']['id']},'attributes':[_0x4124('0x33'),'path'],'raw':!![]})[_0x4124('0x2d')](handleEntityNotFound(_0x4ed0d3,null))['then'](function(_0x1dad11){if(_0x1dad11){var _0x42bbca=path[_0x4124('0x54')](config[_0x4124('0x55')],_0x4124('0x56'),util[_0x4124('0x57')](_0x4124('0x58'),path[_0x4124('0x59')](_0x1dad11[_0x4124('0x6')])));var _0x1c2f7e=fs[_0x4124('0x5a')](_0x42bbca);var _0x2d2d4b=archiver(_0x4124('0x5b'),{'zlib':{'level':0x9}});_0x2d2d4b['on']('warning',function(_0x28924d){if(_0x28924d[_0x4124('0x5c')]===_0x4124('0x5d')){logger[_0x4124('0x31')](_0x28924d);}else{throw new db[(_0x4124('0x5e'))][(_0x4124('0x5f'))](_0x4124('0x60'));}});_0x2d2d4b['on'](_0x4124('0x31'),function(_0x5ecbec){throw new db[(_0x4124('0x5e'))][(_0x4124('0x5f'))](_0x4124('0x60'));});_0x2d2d4b[_0x4124('0x61')](_0x1c2f7e);_0x2d2d4b['glob'](_0x4124('0x62'),{'cwd':path[_0x4124('0x54')](config[_0x4124('0x55')],_0x4124('0x56'),path['dirname'](_0x1dad11[_0x4124('0x6')])),'ignore':[path[_0x4124('0x54')](path[_0x4124('0x59')](_0x1dad11[_0x4124('0x6')]),_0x4124('0x63')),path[_0x4124('0x54')](path[_0x4124('0x59')](_0x1dad11['path']),'attachments/**/*')],'nodir':!![]})[_0x4124('0x64')]();_0x1c2f7e['on'](_0x4124('0x65'),function(){if(!fs[_0x4124('0x66')](_0x42bbca)){throw new db[(_0x4124('0x5e'))][(_0x4124('0x5f'))](_0x4124('0x67'));}return _0x4ed0d3['download'](_0x42bbca,util['format'](_0x4124('0x58'),path[_0x4124('0x59')](_0x1dad11[_0x4124('0x6')])),function(_0x124807){if(_0x124807){throw new db[(_0x4124('0x5e'))][(_0x4124('0x5f'))](_0x4124('0x68'));}fs[_0x4124('0x69')](_0x42bbca);logger[_0x4124('0x6a')](_0x4124('0x6b'));logger['info'](_0x4124('0x6c'));});});}return null;})['catch'](handleError(_0x4ed0d3,null));};exports[_0x4124('0x6d')]=function(_0x5067da,_0x5b96a8,_0x5b842f){var _0x54ae31=path[_0x4124('0x59')](_0x5067da[_0x4124('0x6e')][_0x4124('0x6f')],path[_0x4124('0x70')](_0x5067da[_0x4124('0x6e')][_0x4124('0x6f')]));var _0xdbeadc=path['join'](config[_0x4124('0x55')],_0x4124('0x56'),_0x5067da['file']['filename']);var _0xc4eb17=path[_0x4124('0x54')](config[_0x4124('0x55')],_0x4124('0x56'),_0x54ae31);logger[_0x4124('0x6a')](_0x4124('0x71'),_0xdbeadc);logger[_0x4124('0x6a')](_0x4124('0x72'),_0xc4eb17);try{fs['chmodSync'](_0xdbeadc,parseInt(_0x4124('0x73'),0x8));extract(_0xdbeadc,{'dir':_0xc4eb17},function(_0x125e24){if(_0x125e24){logger[_0x4124('0x31')](_0x125e24);handleError(_0x125e24,!![]);};var _0x4fd41a=fs[_0x4124('0x74')](_0xc4eb17);if(_0x4fd41a['length']>0x1){removeReferences(_0xdbeadc,_0xc4eb17);logger[_0x4124('0x31')](_0x4124('0x75'));return _0x5b842f(new Error('Invalid\x20plugin\x20structure'));}var _0x26238f=fs[_0x4124('0x76')](path['join'](_0xc4eb17,_0x4fd41a[0x0]));if(_0x26238f[_0x4124('0x77')]()){removeReferences(_0xdbeadc,_0xc4eb17);logger['error'](_0x4124('0x75'));return _0x5b842f(new Error('Invalid\x20plugin\x20structure'));}if(_0x26238f[_0x4124('0x78')]()){var _0x23f238=fs[_0x4124('0x74')](path[_0x4124('0x54')](_0xc4eb17,_0x4fd41a[0x0]));if(_0x23f238['length']===0x0){removeReferences(_0xdbeadc,_0xc4eb17);logger[_0x4124('0x31')](_0x4124('0x75'));return _0x5b842f(new Error(_0x4124('0x75')));}var _0x2aed7c=_0x23f238[_0x4124('0x79')](function(_0x4b4448){return _0x4b4448===_0x4124('0x7a');});if(!_0x2aed7c){return _0x5b842f(new Error(_0x4124('0x7b')));}var _0x25c674=fs[_0x4124('0x7c')](path['join'](_0xc4eb17,_0x4fd41a[0x0],_0x4124('0x7a')));var _0x1b8f41=JSON[_0x4124('0x7d')](_0x25c674);if('undefined'==typeof _0x1b8f41['name']){return _0x5b842f(new Error(_0x4124('0x7e')));}if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x3a')]){return _0x5b842f(new Error(_0x4124('0x7f')));}if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x80')]){return _0x5b842f(new Error(_0x4124('0x81')));}if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x82')]){return _0x5b842f(new Error(_0x4124('0x83')));}if(_0x1b8f41[_0x4124('0x3a')]===_0x4124('0x84')){if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')]){return _0x5b842f(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x86')]&&'undefined'==typeof _0x1b8f41[_0x4124('0x82')]['views'][_0x4124('0x87')]){return _0x5b842f(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1b8f41[_0x4124('0x3a')]===_0x4124('0x88')){if(_0x4124('0x25')==typeof _0x1b8f41['parameters'][_0x4124('0x89')]){return _0x5b842f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x4124('0x25')==typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x8a')]){return _0x5b842f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5b842f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x42a876=_0x1b8f41['name'];var _0x46d09b=_0x1b8f41[_0x4124('0x8b')];var _0x100660=_0x1b8f41['type'];var _0x27b4c3=_0x1b8f41[_0x4124('0x8c')]?_0x1b8f41['sidebar']:'always';var _0x35a19b=_0x1b8f41[_0x4124('0x8d')]?_0x1b8f41[_0x4124('0x8d')]:_0x4124('0x8e');var _0x152433='';var _0x106ad0='';var _0x30a4ba='';var _0x7662ee='';var _0x42bfba=_0x1b8f41[_0x4124('0x80')];if(_0x100660===_0x4124('0x84')){if(_0x4124('0x25')!=typeof _0x1b8f41[_0x4124('0x82')]['views']['admin']){var _0x293bd4=_0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x4124('0x8f')](_0x293bd4)){_0x152433=path['join'](_0x4124('0x90'),_0x54ae31,_0x4fd41a[0x0],_0x293bd4);}else{_0x152433=_0x293bd4;}}else{logger[_0x4124('0x6a')](_0x4124('0x91'));}if(_0x4124('0x25')!=typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x87')]){var _0x5cc795=_0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x4124('0x8f')](_0x5cc795)){_0x106ad0=path[_0x4124('0x54')](_0x4124('0x90'),_0x54ae31,_0x4fd41a[0x0],_0x5cc795);}else{_0x106ad0=_0x5cc795;}}else{logger[_0x4124('0x6a')](_0x4124('0x92'));}}else if(_0x100660==='script'){_0x30a4ba=_0x1b8f41[_0x4124('0x82')][_0x4124('0x89')];_0x7662ee=_0x1b8f41[_0x4124('0x82')][_0x4124('0x8a')];if(_0x4124('0x25')!=typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')]){if(_0x4124('0x25')!=typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x86')]){var _0x293bd4=_0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x4124('0x8f')](_0x293bd4)){_0x152433=path[_0x4124('0x54')](_0x4124('0x90'),_0x54ae31,_0x4fd41a[0x0],_0x293bd4);}else{_0x152433=_0x293bd4;}}if('undefined'!=typeof _0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x87')]){var _0x5cc795=_0x1b8f41[_0x4124('0x82')][_0x4124('0x85')][_0x4124('0x87')];if(!/^(f|ht)tps?:\/\//i[_0x4124('0x8f')](_0x5cc795)){_0x106ad0=path['join'](_0x4124('0x90'),_0x54ae31,_0x4fd41a[0x0],_0x5cc795);}else{_0x106ad0=_0x5cc795;}}}}var _0x581899={'name':_0x42a876,'description':_0x46d09b,'path':path[_0x4124('0x54')](_0x54ae31,_0x4fd41a[0x0]),'type':_0x100660,'sidebar':_0x27b4c3,'icon':_0x35a19b,'adminUrl':_0x152433,'agentUrl':_0x106ad0,'scriptName':_0x30a4ba,'scriptPath':_0x7662ee,'version':_0x42bfba};removeReferences(_0xdbeadc,null);return db[_0x4124('0x37')][_0x4124('0x93')](_0x581899)['then'](function(_0x235537){var _0x3dbc4d={'role':_0x5067da[_0x4124('0x94')][_0x4124('0x95')],'userProfileId':_0x5067da[_0x4124('0x94')][_0x4124('0x96')]};if(!_0x3dbc4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dbc4d[_0x4124('0x95')]===_0x4124('0x97')){var _0x460688=_0x235537['get']({'plain':!![]});return db[_0x4124('0x98')]['find']({'where':{'name':_0x4124('0x99'),'userProfileId':_0x3dbc4d[_0x4124('0x96')]},'raw':!![]})[_0x4124('0x2d')](function(_0x16a935){if(_0x16a935&&_0x16a935[_0x4124('0x9a')]===0x0){return db[_0x4124('0x30')][_0x4124('0x93')]({'name':_0x460688['name'],'resourceId':_0x460688['id'],'type':_0x16a935[_0x4124('0x33')],'sectionId':_0x16a935['id']},{})[_0x4124('0x2d')](function(){return _0x235537;});}else{return _0x235537;}})[_0x4124('0x51')](function(_0x3a0ed9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a0ed9);throw _0x3a0ed9;});}return _0x235537;})[_0x4124('0x2d')](respondWithResult(_0x5b96a8,null))[_0x4124('0x51')](handleError(_0x5b96a8,null));}});}catch(_0x1d0168){_0x5b96a8[_0x4124('0x21')](0x1f4)['send'](_0x1d0168);}};function removeReferences(_0x49f5ce,_0xb54a45){try{if(_0x49f5ce){fs['unlinkSync'](_0x49f5ce);logger[_0x4124('0x6a')]('Zip\x20archive\x20removed');}if(_0xb54a45){rimraf(_0xb54a45,function(){});logger[_0x4124('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x4d1166){logger['error'](_0x4d1166);}}exports['update']=function(_0x2c524f,_0xaf12a,_0x465e44){return db['Plugin'][_0x4124('0x52')]({'where':{'id':_0x2c524f[_0x4124('0x9b')]['id']}})[_0x4124('0x2d')](handleEntityNotFound(_0xaf12a,null))['then'](saveUpdates(_0x2c524f['body'],null))[_0x4124('0x2d')](respondWithResult(_0xaf12a,null))['catch'](handleError(_0xaf12a,null));};exports[_0x4124('0x9c')]=function(_0x129ba8,_0x4c4d83,_0x206523){return db[_0x4124('0x37')]['find']({'where':{'id':_0x129ba8[_0x4124('0x9b')]['id']}})['then'](function(_0x550165){if(_0x550165){return _0x550165['destroy']();}})[_0x4124('0x2d')](function(_0x47f6f0){rimraf(path['join'](config[_0x4124('0x55')],_0x4124('0x56'),path[_0x4124('0x9d')](_0x47f6f0['path'])),function(){});return _0x47f6f0;})[_0x4124('0x2d')](handleEntityNotFound(_0x4c4d83,null))[_0x4124('0x2d')](respondWithStatusCode(_0x4c4d83,null))['catch'](handleError(_0x4c4d83,null));};exports['webhookGet']=function(_0x4623fa,_0x2df324,_0x11325b){return BPromise[_0x4124('0x9e')]()['then'](function(){if(!_0x4623fa[_0x4124('0x3d')][_0x4124('0x6')]){throw new Error(_0x4124('0x9f'));}if(!_0x4623fa[_0x4124('0x3d')][_0x4124('0xa0')]){throw new Error(_0x4124('0xa1'));}var _0x1d4fbe=_0x4623fa[_0x4124('0x3d')][_0x4124('0xa2')]?_0x4623fa['query'][_0x4124('0xa2')]+':'+_0x4623fa[_0x4124('0x3d')]['port']:'http://localhost:'+_0x4623fa['query'][_0x4124('0xa0')];var _0x555ada=_0x4623fa[_0x4124('0x3d')][_0x4124('0x23')]?_0x4623fa[_0x4124('0x3d')]['json']:!![];var _0x18c4ef=_0x4623fa[_0x4124('0x3d')][_0x4124('0xa3')]?_0x4623fa[_0x4124('0x3d')][_0x4124('0xa3')]:null;var _0xce5d12={'method':_0x4623fa[_0x4124('0xa4')],'uri':util['format'](_0x4124('0xa5'),_0x1d4fbe,_0x4623fa[_0x4124('0x3d')][_0x4124('0x6')]),'json':_0x555ada,'resolveWithFullResponse':!![],'encoding':_0x18c4ef,'qs':_0x4623fa[_0x4124('0x3d')]};if(_0x4623fa[_0x4124('0xa6')]){_0xce5d12['headers']=_0x4623fa[_0x4124('0xa6')];if(_0xce5d12[_0x4124('0xa6')]['content-length']){delete _0xce5d12['headers']['content-length'];}}if(_0xce5d12[_0x4124('0xa6')][_0x4124('0xa7')]){delete _0xce5d12[_0x4124('0xa6')]['content-type'];}return rp(_0xce5d12);})[_0x4124('0x2d')](function(_0x3ae8ea){if(_0x3ae8ea){_0x2df324['set'](_0x3ae8ea[_0x4124('0xa6')]);logger[_0x4124('0x6a')](_0x3ae8ea[_0x4124('0x94')]);if(_[_0x4124('0xa8')](_0x4623fa[_0x4124('0x3d')]['path'],_0x4124('0x53'))&&_0x3ae8ea['statusCode']==0x1f4){return _0x2df324[_0x4124('0x20')](_0x3ae8ea[_0x4124('0xa9')]);}else{return _0x2df324['status'](_0x3ae8ea[_0x4124('0xa9')])['send'](_0x3ae8ea[_0x4124('0x94')]);}}else{return _0x2df324['sendStatus'](0xc8);}})[_0x4124('0x51')](handleError(_0x2df324,null));};exports['webhookPost']=function(_0xee22f8,_0x2b0c20,_0x209672){return BPromise[_0x4124('0x9e')]()[_0x4124('0x2d')](function(){if(!_0xee22f8[_0x4124('0x3d')][_0x4124('0x6')]){throw new Error(_0x4124('0x9f'));}if(!_0xee22f8[_0x4124('0x3d')][_0x4124('0xa0')]){throw new Error(_0x4124('0xa1'));}var _0x29e180=_0xee22f8[_0x4124('0x3d')][_0x4124('0xa2')]?_0xee22f8[_0x4124('0x3d')][_0x4124('0xa2')]+':'+_0xee22f8['query'][_0x4124('0xa0')]:_0x4124('0xaa')+_0xee22f8[_0x4124('0x3d')][_0x4124('0xa0')];var _0x3375b2=_0xee22f8[_0x4124('0x3d')][_0x4124('0x23')]?_0xee22f8[_0x4124('0x3d')]['json']:!![];var _0x42abd0=_0xee22f8['query']['encoding']?_0xee22f8[_0x4124('0x3d')][_0x4124('0xa3')]:null;var _0x96aa82={'method':_0xee22f8['method'],'uri':util[_0x4124('0x57')]('%s%s',_0x29e180,_0xee22f8[_0x4124('0x3d')][_0x4124('0x6')]),'json':_0x3375b2,'resolveWithFullResponse':!![],'encoding':_0x42abd0,'body':_0xee22f8['body']};if(_0xee22f8[_0x4124('0xa6')]){_0x96aa82[_0x4124('0xa6')]=_0xee22f8[_0x4124('0xa6')];if(_0x96aa82[_0x4124('0xa6')][_0x4124('0xab')]){delete _0x96aa82['headers']['content-length'];}}if(_0x96aa82['headers'][_0x4124('0xa7')]){delete _0x96aa82[_0x4124('0xa6')][_0x4124('0xa7')];}return rp(_0x96aa82);})[_0x4124('0x2d')](function(_0x510b4f){if(_0x510b4f){_0x2b0c20[_0x4124('0x27')](_0x510b4f[_0x4124('0xa6')]);logger[_0x4124('0x6a')](_0x510b4f[_0x4124('0x94')]);return _0x2b0c20['status'](_0x510b4f[_0x4124('0xa9')])['send'](_0x510b4f[_0x4124('0x94')]);}else{return _0x2b0c20[_0x4124('0x20')](0xc8);}})[_0x4124('0x51')](handleError(_0x2b0c20,null));}; \ No newline at end of file +var _0xc24c=['path','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','extname','filename','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','agent','Warning:\x20agent\x20view\x20not\x20specified','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','webhookPost','content-length','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','download'];(function(_0x5bfea9,_0xcaedd){var _0x460a21=function(_0x53bb37){while(--_0x53bb37){_0x5bfea9['push'](_0x5bfea9['shift']());}};_0x460a21(++_0xcaedd);}(_0xc24c,0x102));var _0xcc24=function(_0x5e0198,_0x1c04cd){_0x5e0198=_0x5e0198-0x0;var _0x2b0610=_0xc24c[_0x5e0198];return _0x2b0610;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc24('0x0'));var zipdir=require(_0xcc24('0x1'));var jsonpatch=require(_0xcc24('0x2'));var rp=require(_0xcc24('0x3'));var moment=require('moment');var BPromise=require(_0xcc24('0x4'));var Mustache=require(_0xcc24('0x5'));var util=require(_0xcc24('0x6'));var path=require('path');var sox=require(_0xcc24('0x7'));var csv=require(_0xcc24('0x8'));var ejs=require(_0xcc24('0x9'));var fs=require('fs');var fs_extra=require(_0xcc24('0xa'));var _=require('lodash');var squel=require(_0xcc24('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcc24('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xcc24('0x0'));var archiver=require('archiver');var Redis=require(_0xcc24('0xd'));var authService=require(_0xcc24('0xe'));var qs=require(_0xcc24('0xf'));var as=require(_0xcc24('0x10'));var hardwareService=require(_0xcc24('0x11'));var logger=require(_0xcc24('0x12'))(_0xcc24('0x13'));var utils=require('../../config/utils');var config=require(_0xcc24('0x14'));var licenseUtil=require(_0xcc24('0x15'));var db=require(_0xcc24('0x16'))['db'];config[_0xcc24('0x17')]=_[_0xcc24('0x18')](config['redis'],{'host':_0xcc24('0x19'),'port':0x18eb});var socket=require(_0xcc24('0x1a'))(new Redis(config['redis']));require(_0xcc24('0x1b'))[_0xcc24('0x1c')](socket);function respondWithStatusCode(_0x28b422,_0x315066){_0x315066=_0x315066||0xcc;return function(_0x14badf){if(_0x14badf){return _0x28b422[_0xcc24('0x1d')](_0x315066);}return _0x28b422[_0xcc24('0x1e')](_0x315066)['end']();};}function respondWithResult(_0x7a5ce0,_0x323e93){_0x323e93=_0x323e93||0xc8;return function(_0x5583ae){if(_0x5583ae){return _0x7a5ce0[_0xcc24('0x1e')](_0x323e93)['json'](_0x5583ae);}};}function respondWithFilteredResult(_0x595bf3,_0x2faa05){return function(_0xc93968){if(_0xc93968){var _0x261280=typeof _0x2faa05[_0xcc24('0x1f')]===_0xcc24('0x20')&&typeof _0x2faa05[_0xcc24('0x21')]===_0xcc24('0x20');var _0x69062e=_0xc93968[_0xcc24('0x22')];var _0x38c5ac=_0x261280?0x0:_0x2faa05[_0xcc24('0x1f')];var _0x25ee16=_0x261280?_0xc93968['count']:_0x2faa05[_0xcc24('0x1f')]+_0x2faa05['limit'];var _0x4f0209;if(_0x25ee16>=_0x69062e){_0x25ee16=_0x69062e;_0x4f0209=0xc8;}else{_0x4f0209=0xce;}_0x595bf3[_0xcc24('0x1e')](_0x4f0209);return _0x595bf3[_0xcc24('0x23')](_0xcc24('0x24'),_0x38c5ac+'-'+_0x25ee16+'/'+_0x69062e)[_0xcc24('0x25')](_0xc93968);}return null;};}function patchUpdates(_0x361135){return function(_0xf65dd6){try{jsonpatch[_0xcc24('0x26')](_0xf65dd6,_0x361135,!![]);}catch(_0x1d8415){return BPromise['reject'](_0x1d8415);}return _0xf65dd6[_0xcc24('0x27')]();};}function saveUpdates(_0x753939,_0x2ad75a){return function(_0x42593d){if(_0x42593d){return _0x42593d[_0xcc24('0x28')](_0x753939)[_0xcc24('0x29')](function(_0x1bbd5b){return _0x1bbd5b;});}return null;};}function removeEntity(_0x59d580,_0x2577fa){return function(_0x4af5db){if(_0x4af5db){return _0x4af5db[_0xcc24('0x2a')]()['then'](function(){var _0x2f6987=_0x4af5db[_0xcc24('0x2b')]({'plain':!![]});var _0xeeeca6='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0xeeeca6,'resourceId':_0x2f6987['id']}})[_0xcc24('0x29')](function(){return _0x4af5db;});})[_0xcc24('0x29')](function(){_0x59d580[_0xcc24('0x1e')](0xcc)[_0xcc24('0x2c')]();});}};}function handleEntityNotFound(_0x243757,_0x11f606){return function(_0x4c2ebe){if(!_0x4c2ebe){_0x243757[_0xcc24('0x1d')](0x194);}return _0x4c2ebe;};}function handleError(_0x45f50c,_0x50f4c2){_0x50f4c2=_0x50f4c2||0x1f4;return function(_0x2591ef){logger[_0xcc24('0x2d')](_0x2591ef[_0xcc24('0x2e')]);if(_0x2591ef['name']){delete _0x2591ef[_0xcc24('0x2f')];}_0x45f50c['status'](_0x50f4c2)[_0xcc24('0x30')](_0x2591ef);};}exports[_0xcc24('0x31')]=function(_0x1ba7fc,_0x22e50b){var _0x5dd0bd={},_0x174e43={},_0x1aef27={'count':0x0,'rows':[]};var _0x18142b=_[_0xcc24('0x32')](db[_0xcc24('0x33')][_0xcc24('0x34')],function(_0x24348c){return{'name':_0x24348c[_0xcc24('0x35')],'type':_0x24348c[_0xcc24('0x36')][_0xcc24('0x37')]};});_0x174e43[_0xcc24('0x38')]=_[_0xcc24('0x32')](_0x18142b,_0xcc24('0x2f'));_0x174e43[_0xcc24('0x39')]=_[_0xcc24('0x3a')](_0x1ba7fc[_0xcc24('0x39')]);_0x174e43[_0xcc24('0x3b')]=_['intersection'](_0x174e43[_0xcc24('0x38')],_0x174e43[_0xcc24('0x39')]);_0x5dd0bd['attributes']=_[_0xcc24('0x3c')](_0x174e43['model'],qs['fields'](_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x3d')]));_0x5dd0bd[_0xcc24('0x3e')]=_0x5dd0bd[_0xcc24('0x3e')][_0xcc24('0x3f')]?_0x5dd0bd['attributes']:_0x174e43[_0xcc24('0x38')];if(!_0x1ba7fc['query'][_0xcc24('0x40')](_0xcc24('0x41'))){_0x5dd0bd[_0xcc24('0x21')]=qs[_0xcc24('0x21')](_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x21')]);_0x5dd0bd[_0xcc24('0x1f')]=qs[_0xcc24('0x1f')](_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x1f')]);}_0x5dd0bd[_0xcc24('0x42')]=qs[_0xcc24('0x43')](_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x43')]);_0x5dd0bd[_0xcc24('0x44')]=qs[_0xcc24('0x3b')](_[_0xcc24('0x45')](_0x1ba7fc['query'],_0x174e43[_0xcc24('0x3b')]),_0x18142b);if(_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x46')]){_0x5dd0bd[_0xcc24('0x44')]=_[_0xcc24('0x47')](_0x5dd0bd[_0xcc24('0x44')],{'$or':_['map'](_0x18142b,function(_0x72cbff){if(_0x72cbff[_0xcc24('0x36')]!==_0xcc24('0x48')){var _0x2b40aa={};_0x2b40aa[_0x72cbff[_0xcc24('0x2f')]]={'$like':'%'+_0x1ba7fc['query'][_0xcc24('0x46')]+'%'};return _0x2b40aa;}})});}_0x5dd0bd=_[_0xcc24('0x47')]({},_0x5dd0bd,_0x1ba7fc['options']);var _0x2e0e6b={'where':_0x5dd0bd[_0xcc24('0x44')]};return db[_0xcc24('0x33')]['count'](_0x2e0e6b)[_0xcc24('0x29')](function(_0x22ca5f){_0x1aef27[_0xcc24('0x22')]=_0x22ca5f;if(_0x1ba7fc[_0xcc24('0x39')][_0xcc24('0x49')]){_0x5dd0bd[_0xcc24('0x4a')]=[{'all':!![]}];}return db[_0xcc24('0x33')][_0xcc24('0x4b')](_0x5dd0bd);})[_0xcc24('0x29')](function(_0x534695){_0x1aef27[_0xcc24('0x4c')]=_0x534695;return _0x1aef27;})['then'](respondWithFilteredResult(_0x22e50b,_0x5dd0bd))[_0xcc24('0x4d')](handleError(_0x22e50b,null));};exports['show']=function(_0x3c0e0d,_0x40e0e0){var _0x558b57={'raw':!![],'where':{'id':_0x3c0e0d[_0xcc24('0x4e')]['id']}},_0xaea2f0={};_0xaea2f0[_0xcc24('0x38')]=_[_0xcc24('0x3a')](db[_0xcc24('0x33')][_0xcc24('0x34')]);_0xaea2f0['query']=_['keys'](_0x3c0e0d[_0xcc24('0x39')]);_0xaea2f0[_0xcc24('0x3b')]=_[_0xcc24('0x3c')](_0xaea2f0[_0xcc24('0x38')],_0xaea2f0['query']);_0x558b57['attributes']=_[_0xcc24('0x3c')](_0xaea2f0[_0xcc24('0x38')],qs[_0xcc24('0x3d')](_0x3c0e0d['query']['fields']));_0x558b57[_0xcc24('0x3e')]=_0x558b57[_0xcc24('0x3e')][_0xcc24('0x3f')]?_0x558b57['attributes']:_0xaea2f0[_0xcc24('0x38')];if(_0x3c0e0d[_0xcc24('0x39')][_0xcc24('0x49')]){_0x558b57[_0xcc24('0x4a')]=[{'all':!![]}];}_0x558b57=_[_0xcc24('0x47')]({},_0x558b57,_0x3c0e0d[_0xcc24('0x4f')]);return db[_0xcc24('0x33')][_0xcc24('0x50')](_0x558b57)[_0xcc24('0x29')](handleEntityNotFound(_0x40e0e0,null))[_0xcc24('0x29')](respondWithResult(_0x40e0e0,null))['catch'](handleError(_0x40e0e0,null));};exports[_0xcc24('0x51')]=function(_0x774a42,_0x388555,_0x3dfaab){return db[_0xcc24('0x33')]['find']({'where':{'id':_0x774a42[_0xcc24('0x4e')]['id']},'attributes':[_0xcc24('0x2f'),_0xcc24('0x52')],'raw':!![]})[_0xcc24('0x29')](handleEntityNotFound(_0x388555,null))[_0xcc24('0x29')](function(_0x400d6c){if(_0x400d6c){var _0x28b885=path[_0xcc24('0x53')](config[_0xcc24('0x54')],_0xcc24('0x55'),util[_0xcc24('0x56')](_0xcc24('0x57'),path[_0xcc24('0x58')](_0x400d6c[_0xcc24('0x52')])));var _0x2876cb=fs['createWriteStream'](_0x28b885);var _0xdbde51=archiver(_0xcc24('0x59'),{'zlib':{'level':0x9}});_0xdbde51['on'](_0xcc24('0x5a'),function(_0x4bb05e){if(_0x4bb05e[_0xcc24('0x5b')]===_0xcc24('0x5c')){logger[_0xcc24('0x2d')](_0x4bb05e);}else{throw new db[(_0xcc24('0x5d'))][(_0xcc24('0x5e'))](_0xcc24('0x5f'));}});_0xdbde51['on'](_0xcc24('0x2d'),function(_0x4c22c7){throw new db[(_0xcc24('0x5d'))][(_0xcc24('0x5e'))](_0xcc24('0x5f'));});_0xdbde51['pipe'](_0x2876cb);_0xdbde51[_0xcc24('0x60')](_0xcc24('0x61'),{'cwd':path['join'](config['root'],_0xcc24('0x55'),path[_0xcc24('0x62')](_0x400d6c[_0xcc24('0x52')])),'ignore':[path[_0xcc24('0x53')](path[_0xcc24('0x58')](_0x400d6c['path']),_0xcc24('0x63')),path[_0xcc24('0x53')](path[_0xcc24('0x58')](_0x400d6c['path']),_0xcc24('0x64'))],'nodir':!![]})['finalize']();_0x2876cb['on'](_0xcc24('0x65'),function(){if(!fs[_0xcc24('0x66')](_0x28b885)){throw new db['Sequelize'][(_0xcc24('0x5e'))]('Plugin\x20not\x20found');}return _0x388555['download'](_0x28b885,util['format'](_0xcc24('0x57'),path['basename'](_0x400d6c[_0xcc24('0x52')])),function(_0x513025){if(_0x513025){throw new db[(_0xcc24('0x5d'))][(_0xcc24('0x5e'))](_0xcc24('0x67'));}fs[_0xcc24('0x68')](_0x28b885);logger[_0xcc24('0x69')](_0xcc24('0x6a'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xcc24('0x4d')](handleError(_0x388555,null));};exports[_0xcc24('0x6b')]=function(_0x307ed4,_0x3fd1b2,_0x59685b){var _0x55d6c1=path['basename'](_0x307ed4['file']['filename'],path[_0xcc24('0x6c')](_0x307ed4['file'][_0xcc24('0x6d')]));var _0x1608e7=path[_0xcc24('0x53')](config['root'],_0xcc24('0x55'),_0x307ed4['file'][_0xcc24('0x6d')]);var _0x12817a=path[_0xcc24('0x53')](config['root'],_0xcc24('0x55'),_0x55d6c1);logger[_0xcc24('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x1608e7);logger[_0xcc24('0x69')]('Plugin\x20upload\x20destination:\x20%s',_0x12817a);try{fs[_0xcc24('0x6e')](_0x1608e7,parseInt(_0xcc24('0x6f'),0x8));extract(_0x1608e7,{'dir':_0x12817a},function(_0x4f0557){if(_0x4f0557){logger[_0xcc24('0x2d')](_0x4f0557);handleError(_0x4f0557,!![]);};var _0x2449cd=fs[_0xcc24('0x70')](_0x12817a);if(_0x2449cd[_0xcc24('0x3f')]>0x1){removeReferences(_0x1608e7,_0x12817a);logger[_0xcc24('0x2d')](_0xcc24('0x71'));return _0x59685b(new Error('Invalid\x20plugin\x20structure'));}var _0x20e989=fs['lstatSync'](path[_0xcc24('0x53')](_0x12817a,_0x2449cd[0x0]));if(_0x20e989[_0xcc24('0x72')]()){removeReferences(_0x1608e7,_0x12817a);logger[_0xcc24('0x2d')]('Invalid\x20plugin\x20structure');return _0x59685b(new Error(_0xcc24('0x71')));}if(_0x20e989[_0xcc24('0x73')]()){var _0x146dd0=fs['readdirSync'](path[_0xcc24('0x53')](_0x12817a,_0x2449cd[0x0]));if(_0x146dd0[_0xcc24('0x3f')]===0x0){removeReferences(_0x1608e7,_0x12817a);logger[_0xcc24('0x2d')](_0xcc24('0x71'));return _0x59685b(new Error(_0xcc24('0x71')));}var _0x2fdd96=_0x146dd0[_0xcc24('0x74')](function(_0x10b56a){return _0x10b56a===_0xcc24('0x75');});if(!_0x2fdd96){return _0x59685b(new Error('Plugin\x20manifest\x20missing'));}var _0x59d291=fs[_0xcc24('0x76')](path['join'](_0x12817a,_0x2449cd[0x0],_0xcc24('0x75')));var _0x95204a=JSON[_0xcc24('0x77')](_0x59d291);if('undefined'==typeof _0x95204a[_0xcc24('0x2f')]){return _0x59685b(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xcc24('0x20')==typeof _0x95204a[_0xcc24('0x36')]){return _0x59685b(new Error(_0xcc24('0x78')));}if(_0xcc24('0x20')==typeof _0x95204a[_0xcc24('0x79')]){return _0x59685b(new Error(_0xcc24('0x7a')));}if('undefined'==typeof _0x95204a[_0xcc24('0x7b')]){return _0x59685b(new Error(_0xcc24('0x7c')));}if(_0x95204a[_0xcc24('0x36')]===_0xcc24('0x7d')){if(_0xcc24('0x20')==typeof _0x95204a['parameters'][_0xcc24('0x7e')]){return _0x59685b(new Error(_0xcc24('0x7f')));}if(_0xcc24('0x20')==typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')][_0xcc24('0x80')]&&'undefined'==typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')]['agent']){return _0x59685b(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x95204a['type']===_0xcc24('0x81')){if(_0xcc24('0x20')==typeof _0x95204a['parameters'][_0xcc24('0x82')]){return _0x59685b(new Error(_0xcc24('0x83')));}if(_0xcc24('0x20')==typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x84')]){return _0x59685b(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x59685b(new Error(_0xcc24('0x85')));}var _0x1aa9a3=_0x95204a[_0xcc24('0x2f')];var _0x5afc63=_0x95204a[_0xcc24('0x86')];var _0x414e5f=_0x95204a[_0xcc24('0x36')];var _0x11f166=_0x95204a[_0xcc24('0x87')]?_0x95204a['sidebar']:_0xcc24('0x88');var _0x39d961=_0x95204a[_0xcc24('0x89')]?_0x95204a[_0xcc24('0x89')]:_0xcc24('0x8a');var _0x24c1ce='';var _0x20cf28='';var _0x30db91='';var _0x14af97='';var _0x3435bd=_0x95204a[_0xcc24('0x79')];if(_0x414e5f===_0xcc24('0x7d')){if(_0xcc24('0x20')!=typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')][_0xcc24('0x80')]){var _0x213684=_0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')][_0xcc24('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xcc24('0x8b')](_0x213684)){_0x24c1ce=path[_0xcc24('0x53')]('plugins',_0x55d6c1,_0x2449cd[0x0],_0x213684);}else{_0x24c1ce=_0x213684;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x95204a['parameters']['views'][_0xcc24('0x8c')]){var _0x22f6ff=_0x95204a[_0xcc24('0x7b')]['views'][_0xcc24('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xcc24('0x8b')](_0x22f6ff)){_0x20cf28=path[_0xcc24('0x53')]('plugins',_0x55d6c1,_0x2449cd[0x0],_0x22f6ff);}else{_0x20cf28=_0x22f6ff;}}else{logger[_0xcc24('0x69')](_0xcc24('0x8d'));}}else if(_0x414e5f===_0xcc24('0x81')){_0x30db91=_0x95204a[_0xcc24('0x7b')][_0xcc24('0x82')];_0x14af97=_0x95204a[_0xcc24('0x7b')][_0xcc24('0x84')];if(_0xcc24('0x20')!=typeof _0x95204a[_0xcc24('0x7b')]['views']){if(_0xcc24('0x20')!=typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')]['admin']){var _0x213684=_0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')][_0xcc24('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x213684)){_0x24c1ce=path[_0xcc24('0x53')](_0xcc24('0x8e'),_0x55d6c1,_0x2449cd[0x0],_0x213684);}else{_0x24c1ce=_0x213684;}}if(_0xcc24('0x20')!=typeof _0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')]['agent']){var _0x22f6ff=_0x95204a[_0xcc24('0x7b')][_0xcc24('0x7e')][_0xcc24('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x22f6ff)){_0x20cf28=path['join'](_0xcc24('0x8e'),_0x55d6c1,_0x2449cd[0x0],_0x22f6ff);}else{_0x20cf28=_0x22f6ff;}}}}var _0x4453bc={'name':_0x1aa9a3,'description':_0x5afc63,'path':path['join'](_0x55d6c1,_0x2449cd[0x0]),'type':_0x414e5f,'sidebar':_0x11f166,'icon':_0x39d961,'adminUrl':_0x24c1ce,'agentUrl':_0x20cf28,'scriptName':_0x30db91,'scriptPath':_0x14af97,'version':_0x3435bd};removeReferences(_0x1608e7,null);return db['Plugin'][_0xcc24('0x8f')](_0x4453bc)[_0xcc24('0x29')](function(_0x3424d2){var _0x5950b0={'role':_0x307ed4[_0xcc24('0x90')][_0xcc24('0x91')],'userProfileId':_0x307ed4['body'][_0xcc24('0x92')]};if(!_0x5950b0)throw new Error(_0xcc24('0x93'));if(_0x5950b0['role']===_0xcc24('0x94')){var _0x11d699=_0x3424d2[_0xcc24('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0xcc24('0x50')]({'where':{'name':_0xcc24('0x95'),'userProfileId':_0x5950b0['userProfileId']},'raw':!![]})[_0xcc24('0x29')](function(_0x3b5c7f){if(_0x3b5c7f&&_0x3b5c7f['autoAssociation']===0x0){return db[_0xcc24('0x96')][_0xcc24('0x8f')]({'name':_0x11d699[_0xcc24('0x2f')],'resourceId':_0x11d699['id'],'type':_0x3b5c7f['name'],'sectionId':_0x3b5c7f['id']},{})['then'](function(){return _0x3424d2;});}else{return _0x3424d2;}})[_0xcc24('0x4d')](function(_0x249e3f){logger[_0xcc24('0x2d')](_0xcc24('0x97'),_0x249e3f);throw _0x249e3f;});}return _0x3424d2;})['then'](respondWithResult(_0x3fd1b2,null))[_0xcc24('0x4d')](handleError(_0x3fd1b2,null));}});}catch(_0x5be4dc){_0x3fd1b2[_0xcc24('0x1e')](0x1f4)[_0xcc24('0x30')](_0x5be4dc);}};function removeReferences(_0x569b03,_0x5e510d){try{if(_0x569b03){fs[_0xcc24('0x68')](_0x569b03);logger['info'](_0xcc24('0x98'));}if(_0x5e510d){rimraf(_0x5e510d,function(){});logger[_0xcc24('0x69')](_0xcc24('0x99'));}}catch(_0x27962f){logger[_0xcc24('0x2d')](_0x27962f);}}exports['update']=function(_0x153de9,_0x394775,_0x410b84){return db[_0xcc24('0x33')][_0xcc24('0x50')]({'where':{'id':_0x153de9[_0xcc24('0x4e')]['id']}})[_0xcc24('0x29')](handleEntityNotFound(_0x394775,null))[_0xcc24('0x29')](saveUpdates(_0x153de9[_0xcc24('0x90')],null))['then'](respondWithResult(_0x394775,null))[_0xcc24('0x4d')](handleError(_0x394775,null));};exports[_0xcc24('0x9a')]=function(_0x1c8716,_0x17ff2e,_0x27bb3f){return db[_0xcc24('0x33')][_0xcc24('0x50')]({'where':{'id':_0x1c8716['params']['id']}})['then'](function(_0x48d84b){if(_0x48d84b){return _0x48d84b[_0xcc24('0x2a')]();}})['then'](function(_0xc17097){rimraf(path['join'](config[_0xcc24('0x54')],_0xcc24('0x55'),path[_0xcc24('0x62')](_0xc17097[_0xcc24('0x52')])),function(){});return _0xc17097;})['then'](handleEntityNotFound(_0x17ff2e,null))[_0xcc24('0x29')](respondWithStatusCode(_0x17ff2e,null))[_0xcc24('0x4d')](handleError(_0x17ff2e,null));};exports['webhookGet']=function(_0x4c97c1,_0x8a1ff0,_0x21c3b2){return BPromise[_0xcc24('0x9b')]()[_0xcc24('0x29')](function(){if(!_0x4c97c1['query'][_0xcc24('0x52')]){throw new Error(_0xcc24('0x9c'));}if(!_0x4c97c1['query'][_0xcc24('0x9d')]){throw new Error(_0xcc24('0x9e'));}var _0xa40636=_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x9f')]?_0x4c97c1[_0xcc24('0x39')]['hostname']+':'+_0x4c97c1[_0xcc24('0x39')]['port']:_0xcc24('0xa0')+_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x9d')];var _0x2af4f6=_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x25')]?_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x25')]:!![];var _0x5c7ada=_0x4c97c1[_0xcc24('0x39')][_0xcc24('0xa1')]?_0x4c97c1['query'][_0xcc24('0xa1')]:null;var _0x5d0230={'method':_0x4c97c1[_0xcc24('0xa2')],'uri':util[_0xcc24('0x56')](_0xcc24('0xa3'),_0xa40636,_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x52')]),'json':_0x2af4f6,'resolveWithFullResponse':!![],'encoding':_0x5c7ada,'qs':_0x4c97c1[_0xcc24('0x39')]};if(_0x4c97c1[_0xcc24('0xa4')]){_0x5d0230[_0xcc24('0xa4')]=_0x4c97c1[_0xcc24('0xa4')];if(_0x5d0230[_0xcc24('0xa4')]['content-length']){delete _0x5d0230[_0xcc24('0xa4')]['content-length'];}}if(_0x5d0230['headers'][_0xcc24('0xa5')]){delete _0x5d0230[_0xcc24('0xa4')][_0xcc24('0xa5')];}return rp(_0x5d0230);})[_0xcc24('0x29')](function(_0x35379c){if(_0x35379c){_0x8a1ff0[_0xcc24('0x23')](_0x35379c['headers']);logger[_0xcc24('0x69')](_0x35379c[_0xcc24('0x90')]);if(_[_0xcc24('0xa6')](_0x4c97c1[_0xcc24('0x39')][_0xcc24('0x52')],'download')&&_0x35379c[_0xcc24('0xa7')]==0x1f4){return _0x8a1ff0[_0xcc24('0x1d')](_0x35379c['statusCode']);}else{return _0x8a1ff0[_0xcc24('0x1e')](_0x35379c['statusCode'])[_0xcc24('0x30')](_0x35379c[_0xcc24('0x90')]);}}else{return _0x8a1ff0['sendStatus'](0xc8);}})[_0xcc24('0x4d')](handleError(_0x8a1ff0,null));};exports[_0xcc24('0xa8')]=function(_0x1556e7,_0x570d8e,_0x2f4d4a){return BPromise[_0xcc24('0x9b')]()[_0xcc24('0x29')](function(){if(!_0x1556e7['query']['path']){throw new Error(_0xcc24('0x9c'));}if(!_0x1556e7[_0xcc24('0x39')][_0xcc24('0x9d')]){throw new Error(_0xcc24('0x9e'));}var _0x1df81e=_0x1556e7[_0xcc24('0x39')][_0xcc24('0x9f')]?_0x1556e7[_0xcc24('0x39')][_0xcc24('0x9f')]+':'+_0x1556e7[_0xcc24('0x39')][_0xcc24('0x9d')]:_0xcc24('0xa0')+_0x1556e7[_0xcc24('0x39')][_0xcc24('0x9d')];var _0x4dc587=_0x1556e7[_0xcc24('0x39')][_0xcc24('0x25')]?_0x1556e7[_0xcc24('0x39')][_0xcc24('0x25')]:!![];var _0x1f0313=_0x1556e7[_0xcc24('0x39')]['encoding']?_0x1556e7[_0xcc24('0x39')][_0xcc24('0xa1')]:null;var _0x222278={'method':_0x1556e7['method'],'uri':util[_0xcc24('0x56')](_0xcc24('0xa3'),_0x1df81e,_0x1556e7[_0xcc24('0x39')][_0xcc24('0x52')]),'json':_0x4dc587,'resolveWithFullResponse':!![],'encoding':_0x1f0313,'body':_0x1556e7[_0xcc24('0x90')]};if(_0x1556e7['headers']){_0x222278['headers']=_0x1556e7['headers'];if(_0x222278[_0xcc24('0xa4')][_0xcc24('0xa9')]){delete _0x222278[_0xcc24('0xa4')][_0xcc24('0xa9')];}}if(_0x222278[_0xcc24('0xa4')][_0xcc24('0xa5')]){delete _0x222278['headers']['content-type'];}return rp(_0x222278);})[_0xcc24('0x29')](function(_0x5904a0){if(_0x5904a0){_0x570d8e[_0xcc24('0x23')](_0x5904a0[_0xcc24('0xa4')]);logger[_0xcc24('0x69')](_0x5904a0[_0xcc24('0x90')]);return _0x570d8e[_0xcc24('0x1e')](_0x5904a0[_0xcc24('0xa7')])[_0xcc24('0x30')](_0x5904a0[_0xcc24('0x90')]);}else{return _0x570d8e['sendStatus'](0xc8);}})[_0xcc24('0x4d')](handleError(_0x570d8e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index e965286..a7f366d 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 _0x044a=['hook','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5d17d3,_0x5b664e){var _0x3456df=function(_0x337eaf){while(--_0x337eaf){_0x5d17d3['push'](_0x5d17d3['shift']());}};_0x3456df(++_0x5b664e);}(_0x044a,0x173));var _0xa044=function(_0x435975,_0x1680ff){_0x435975=_0x435975-0x0;var _0x54ad2a=_0x044a[_0x435975];return _0x54ad2a;};'use strict';var EventEmitter=require(_0xa044('0x0'));var Plugin=require(_0xa044('0x1'))['db'][_0xa044('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa044('0x3')](0x0);var events={'afterCreate':_0xa044('0x4'),'afterUpdate':_0xa044('0x5'),'afterDestroy':_0xa044('0x6')};function emitEvent(_0x30b0c9){return function(_0x25ed77,_0x116358,_0x566ddf){PluginEvents[_0xa044('0x7')](_0x30b0c9+':'+_0x25ed77['id'],_0x25ed77);PluginEvents[_0xa044('0x7')](_0x30b0c9,_0x25ed77);_0x566ddf(null);};}for(var e in events){if(events[_0xa044('0x8')](e)){var event=events[e];Plugin[_0xa044('0x9')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x8838=['events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4af78d,_0x10b5e1){var _0x1892da=function(_0x45d2a9){while(--_0x45d2a9){_0x4af78d['push'](_0x4af78d['shift']());}};_0x1892da(++_0x10b5e1);}(_0x8838,0x90));var _0x8883=function(_0x84dd5d,_0x4b96d7){_0x84dd5d=_0x84dd5d-0x0;var _0x48e59f=_0x8838[_0x84dd5d];return _0x48e59f;};'use strict';var EventEmitter=require(_0x8883('0x0'));var Plugin=require(_0x8883('0x1'))['db'][_0x8883('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8883('0x3')](0x0);var events={'afterCreate':_0x8883('0x4'),'afterUpdate':_0x8883('0x5'),'afterDestroy':_0x8883('0x6')};function emitEvent(_0x87a65f){return function(_0x3df479,_0x2d7568,_0x4c489){PluginEvents[_0x8883('0x7')](_0x87a65f+':'+_0x3df479['id'],_0x3df479);PluginEvents['emit'](_0x87a65f,_0x3df479);_0x4c489(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x8883('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e80d3b9..5dbc82c 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 _0xa969=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x1fcf36,_0x3f2539){var _0x44491f=function(_0x206816){while(--_0x206816){_0x1fcf36['push'](_0x1fcf36['shift']());}};_0x44491f(++_0x3f2539);}(_0xa969,0x114));var _0x9a96=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0xa969[_0x515afd];return _0x536d53;};'use strict';var _=require(_0x9a96('0x0'));var util=require(_0x9a96('0x1'));var logger=require(_0x9a96('0x2'))(_0x9a96('0x3'));var moment=require(_0x9a96('0x4'));var BPromise=require(_0x9a96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a96('0x6'));var rimraf=require(_0x9a96('0x7'));var config=require(_0x9a96('0x8'));var attributes=require(_0x9a96('0x9'));module['exports']=function(_0x23e3a9,_0x1c43a3){return _0x23e3a9[_0x9a96('0xa')](_0x9a96('0xb'),attributes,{'tableName':_0x9a96('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f4b=['Plugin','plugins','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x353ad8,_0x19766d){var _0x1aed7d=function(_0x592d77){while(--_0x592d77){_0x353ad8['push'](_0x353ad8['shift']());}};_0x1aed7d(++_0x19766d);}(_0x7f4b,0x154));var _0xb7f4=function(_0x42c6f1,_0x338d7b){_0x42c6f1=_0x42c6f1-0x0;var _0x3c7398=_0x7f4b[_0x42c6f1];return _0x3c7398;};'use strict';var _=require('lodash');var util=require(_0xb7f4('0x0'));var logger=require(_0xb7f4('0x1'))(_0xb7f4('0x2'));var moment=require(_0xb7f4('0x3'));var BPromise=require(_0xb7f4('0x4'));var rp=require(_0xb7f4('0x5'));var fs=require('fs');var path=require(_0xb7f4('0x6'));var rimraf=require(_0xb7f4('0x7'));var config=require(_0xb7f4('0x8'));var attributes=require(_0xb7f4('0x9'));module[_0xb7f4('0xa')]=function(_0x11f512,_0x100b0e){return _0x11f512['define'](_0xb7f4('0xb'),attributes,{'tableName':_0xb7f4('0xc'),'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 d9f0cb9..0fdac09 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 _0xf2ba=['defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreatePlugin','Plugin','body','options','raw','stringify','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x253bf7,_0x2cbcc4){var _0x13dbcb=function(_0x16c93e){while(--_0x16c93e){_0x253bf7['push'](_0x253bf7['shift']());}};_0x13dbcb(++_0x2cbcc4);}(_0xf2ba,0xab));var _0xaf2b=function(_0x3391fe,_0x5c24d9){_0x3391fe=_0x3391fe-0x0;var _0x1ae383=_0xf2ba[_0x3391fe];return _0x1ae383;};'use strict';var _=require(_0xaf2b('0x0'));var util=require(_0xaf2b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaf2b('0x2'));var fs=require('fs');var Redis=require(_0xaf2b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf2b('0x4'))(_0xaf2b('0x5'));var config=require(_0xaf2b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf2b('0x7')]({'port':0x232a});config[_0xaf2b('0x8')]=_[_0xaf2b('0x9')](config['redis'],{'host':_0xaf2b('0xa'),'port':0x18eb});var socket=require(_0xaf2b('0xb'))(new Redis(config['redis']));require('./plugin.socket')[_0xaf2b('0xc')](socket);function respondWithRpcPromise(_0x6cd595,_0x247656,_0x42bb7a){return new BPromise(function(_0x574715,_0x4f5ef8){return client[_0xaf2b('0xd')](_0x6cd595,_0x42bb7a)[_0xaf2b('0xe')](function(_0x55cd90){logger[_0xaf2b('0xf')](_0xaf2b('0x10'),_0x247656,_0xaf2b('0x11'));logger[_0xaf2b('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x247656,'request\x20sent',JSON['stringify'](_0x55cd90));if(_0x55cd90['error']){if(_0x55cd90[_0xaf2b('0x13')][_0xaf2b('0x14')]===0x1f4){logger['error'](_0xaf2b('0x10'),_0x247656,_0x55cd90['error']['message']);return _0x4f5ef8(_0x55cd90[_0xaf2b('0x13')][_0xaf2b('0x15')]);}logger[_0xaf2b('0x13')](_0xaf2b('0x10'),_0x247656,_0x55cd90['error'][_0xaf2b('0x15')]);return _0x574715(_0x55cd90[_0xaf2b('0x13')][_0xaf2b('0x15')]);}else{logger[_0xaf2b('0xf')](_0xaf2b('0x10'),_0x247656,_0xaf2b('0x11'));_0x574715(_0x55cd90[_0xaf2b('0x16')][_0xaf2b('0x15')]);}})[_0xaf2b('0x17')](function(_0xde70f9){logger[_0xaf2b('0x13')]('Plugin,\x20%s,\x20%s',_0x247656,_0xde70f9);_0x4f5ef8(_0xde70f9);});});}exports[_0xaf2b('0x18')]=function(_0x1c25d3){var _0x46eb75=this;return new Promise(function(_0x150a5a,_0xc1f62d){return db[_0xaf2b('0x19')]['create'](_0x1c25d3[_0xaf2b('0x1a')],{'raw':_0x1c25d3['options']?_0x1c25d3[_0xaf2b('0x1b')][_0xaf2b('0x1c')]===undefined?!![]:![]:!![]})[_0xaf2b('0xe')](function(_0x12b8f3){logger[_0xaf2b('0xf')]('CreatePlugin',_0x1c25d3);logger[_0xaf2b('0x12')]('CreatePlugin',_0x1c25d3,JSON[_0xaf2b('0x1d')](_0x12b8f3));_0x150a5a(_0x12b8f3);})[_0xaf2b('0x17')](function(_0x4bf923){logger[_0xaf2b('0x13')]('CreatePlugin',_0x4bf923['message'],_0x1c25d3);_0xc1f62d(_0x46eb75['error'](0x1f4,_0x4bf923[_0xaf2b('0x15')]));});});}; \ No newline at end of file +var _0x9f7b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','moment','bluebird','ioredis'];(function(_0x5db5e4,_0x3d990f){var _0x3e8ae0=function(_0x27876b){while(--_0x27876b){_0x5db5e4['push'](_0x5db5e4['shift']());}};_0x3e8ae0(++_0x3d990f);}(_0x9f7b,0x12e));var _0xb9f7=function(_0x1ef6aa,_0x350db0){_0x1ef6aa=_0x1ef6aa-0x0;var _0x27488d=_0x9f7b[_0x1ef6aa];return _0x27488d;};'use strict';var _=require(_0xb9f7('0x0'));var util=require('util');var moment=require(_0xb9f7('0x1'));var BPromise=require(_0xb9f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9f7('0x3'));var db=require(_0xb9f7('0x4'))['db'];var utils=require(_0xb9f7('0x5'));var logger=require(_0xb9f7('0x6'))(_0xb9f7('0x7'));var config=require('../../config/environment');var jayson=require(_0xb9f7('0x8'));var client=jayson[_0xb9f7('0x9')][_0xb9f7('0xa')]({'port':0x232a});config[_0xb9f7('0xb')]=_['defaults'](config[_0xb9f7('0xb')],{'host':_0xb9f7('0xc'),'port':0x18eb});var socket=require(_0xb9f7('0xd'))(new Redis(config['redis']));require(_0xb9f7('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d662a,_0x2e86fc,_0x31ac9d){return new BPromise(function(_0x1a0dc0,_0x3d1800){return client[_0xb9f7('0xf')](_0x3d662a,_0x31ac9d)[_0xb9f7('0x10')](function(_0x591429){logger[_0xb9f7('0x11')]('Plugin,\x20%s,\x20%s',_0x2e86fc,_0xb9f7('0x12'));logger['debug'](_0xb9f7('0x13'),_0x2e86fc,_0xb9f7('0x12'),JSON[_0xb9f7('0x14')](_0x591429));if(_0x591429[_0xb9f7('0x15')]){if(_0x591429[_0xb9f7('0x15')][_0xb9f7('0x16')]===0x1f4){logger[_0xb9f7('0x15')](_0xb9f7('0x17'),_0x2e86fc,_0x591429[_0xb9f7('0x15')]['message']);return _0x3d1800(_0x591429[_0xb9f7('0x15')][_0xb9f7('0x18')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x2e86fc,_0x591429['error'][_0xb9f7('0x18')]);return _0x1a0dc0(_0x591429[_0xb9f7('0x15')]['message']);}else{logger['info'](_0xb9f7('0x17'),_0x2e86fc,_0xb9f7('0x12'));_0x1a0dc0(_0x591429[_0xb9f7('0x19')][_0xb9f7('0x18')]);}})[_0xb9f7('0x1a')](function(_0x2d2475){logger[_0xb9f7('0x15')](_0xb9f7('0x17'),_0x2e86fc,_0x2d2475);_0x3d1800(_0x2d2475);});});}exports[_0xb9f7('0x1b')]=function(_0x5d8e12){var _0x1ff3a2=this;return new Promise(function(_0x3a799e,_0x8d446f){return db[_0xb9f7('0x1c')][_0xb9f7('0x1d')](_0x5d8e12[_0xb9f7('0x1e')],{'raw':_0x5d8e12[_0xb9f7('0x1f')]?_0x5d8e12[_0xb9f7('0x1f')][_0xb9f7('0x20')]===undefined?!![]:![]:!![]})[_0xb9f7('0x10')](function(_0x207453){logger['info'](_0xb9f7('0x1b'),_0x5d8e12);logger[_0xb9f7('0x21')](_0xb9f7('0x1b'),_0x5d8e12,JSON[_0xb9f7('0x14')](_0x207453));_0x3a799e(_0x207453);})['catch'](function(_0x2585bb){logger['error'](_0xb9f7('0x1b'),_0x2585bb[_0xb9f7('0x18')],_0x5d8e12);_0x8d446f(_0x1ff3a2[_0xb9f7('0x15')](0x1f4,_0x2585bb[_0xb9f7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index ffce931..32424d6 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 _0x4541=['length','plugin:','save','emit','removeListener','register'];(function(_0x16e1d5,_0x26b53b){var _0x534f2c=function(_0x324736){while(--_0x324736){_0x16e1d5['push'](_0x16e1d5['shift']());}};_0x534f2c(++_0x26b53b);}(_0x4541,0xfe));var _0x1454=function(_0x5eda4c,_0x3c8fec){_0x5eda4c=_0x5eda4c-0x0;var _0x56c3fe=_0x4541[_0x5eda4c];return _0x56c3fe;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x1454('0x0'),'remove','update'];function createListener(_0x5b8c13,_0x3a88c2){return function(_0x246ea5){_0x3a88c2[_0x1454('0x1')](_0x5b8c13,_0x246ea5);};}function removeListener(_0x57100d,_0x51dd88){return function(){PluginEvents[_0x1454('0x2')](_0x57100d,_0x51dd88);};}exports[_0x1454('0x3')]=function(_0x594f6f){for(var _0x5e52ab=0x0,_0x50caa2=events[_0x1454('0x4')];_0x5e52ab<_0x50caa2;_0x5e52ab++){var _0x240ff0=events[_0x5e52ab];var _0x163b15=createListener(_0x1454('0x5')+_0x240ff0,_0x594f6f);PluginEvents['on'](_0x240ff0,_0x163b15);}}; \ No newline at end of file +var _0x1ac4=['./plugin.events','save','update','emit','removeListener','register','plugin:'];(function(_0x1f3a33,_0x4234e2){var _0x3ce1db=function(_0x599f2b){while(--_0x599f2b){_0x1f3a33['push'](_0x1f3a33['shift']());}};_0x3ce1db(++_0x4234e2);}(_0x1ac4,0x11f));var _0x41ac=function(_0x49c445,_0x350b54){_0x49c445=_0x49c445-0x0;var _0x118bb4=_0x1ac4[_0x49c445];return _0x118bb4;};'use strict';var PluginEvents=require(_0x41ac('0x0'));var events=[_0x41ac('0x1'),'remove',_0x41ac('0x2')];function createListener(_0xd1738a,_0x147d13){return function(_0x163bac){_0x147d13[_0x41ac('0x3')](_0xd1738a,_0x163bac);};}function removeListener(_0xab79c9,_0x499a53){return function(){PluginEvents[_0x41ac('0x4')](_0xab79c9,_0x499a53);};}exports[_0x41ac('0x5')]=function(_0x4b34b8){for(var _0x5c2d88=0x0,_0x5e4c7a=events['length'];_0x5c2d88<_0x5e4c7a;_0x5c2d88++){var _0x1a4073=events[_0x5c2d88];var _0xc1b4f8=createListener(_0x41ac('0x6')+_0x1a4073,_0x4b34b8);PluginEvents['on'](_0x1a4073,_0xc1b4f8);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 175a5b5..43b8bc4 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(_0x5085d1,_0x40244f){var _0x332dd3=function(_0x3a118c){while(--_0x3a118c){_0x5085d1['push'](_0x5085d1['shift']());}};_0x332dd3(++_0x40244f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x44451e,_0x3e0201){var _0x2a4582=function(_0x57dac9){while(--_0x57dac9){_0x44451e['push'](_0x44451e['shift']());}};_0x2a4582(++_0x3e0201);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 1ed8cf4..daaef76 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 _0x1339=['body','params','delete','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','then','reject','motion2','catch','show','describe','create','../../files/plugins','cwd','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty'];(function(_0x525864,_0x1bb3ea){var _0x4f9964=function(_0x5e2c0c){while(--_0x5e2c0c){_0x525864['push'](_0x525864['shift']());}};_0x4f9964(++_0x1bb3ea);}(_0x1339,0x1ed));var _0x9133=function(_0x563140,_0x9260b4){_0x563140=_0x563140-0x0;var _0x3522a9=_0x1339[_0x563140];return _0x3522a9;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var path=require(_0x9133('0x2'));var exec=require(_0x9133('0x3'))[_0x9133('0x4')];var BPromise=require(_0x9133('0x5'));function handleEntityNotFound(_0x176e80,_0x110c51){return function(_0x558345){if(!_0x558345){_0x176e80[_0x9133('0x6')](0x194);;}return _0x558345;};}function respondWithResult(_0x855473,_0x379915){_0x379915=_0x379915||0xc8;return function(_0x539af6){if(_0x539af6){return _0x855473[_0x9133('0x7')](_0x379915)[_0x9133('0x8')](_0x539af6);}return null;};}function handleError(_0x3059c4,_0x431a55){_0x431a55=_0x431a55||0x1f4;return function(_0x261698){logger[_0x9133('0x9')](_0x261698[_0x9133('0xa')]);if(_0x261698[_0x9133('0xb')]){delete _0x261698[_0x9133('0xb')];}_0x3059c4[_0x9133('0x7')](_0x431a55)['send'](_0x261698);};}function execChildProcess(){return new BPromise(function(_0x3f9650,_0x3533fa){exec(_0x9133('0xc'),function(_0x452481,_0x3b8f89,_0x244ced){logger['info'](_0x3b8f89);logger[_0x9133('0xd')](_0x244ced);if(_0x452481){logger[_0x9133('0x9')](_0x452481);return _0x3533fa(_0x452481);}return _0x3f9650(_0x3b8f89);});});}exports['index']=function(_0x5283a3,_0x10475c){return pm2['list']()[_0x9133('0xe')](function(_0x439e1a){if(_0x439e1a){var _0x17dfd1=_[_0x9133('0xf')](_0x439e1a,function(_0x31847a){return _0x31847a[_0x9133('0xb')]==='express'||_0x31847a[_0x9133('0xb')]===_0x9133('0x10');});return{'rows':_0x17dfd1,'count':_0x17dfd1['length']};}return null;})[_0x9133('0xe')](respondWithResult(_0x10475c,null))[_0x9133('0x11')](handleError(_0x10475c,null));};exports[_0x9133('0x12')]=function(_0x427663,_0x4a2c4f){return pm2[_0x9133('0x13')](_0x427663['params']['id'])[_0x9133('0xe')](respondWithResult(_0x4a2c4f,null))['then'](handleEntityNotFound(_0x4a2c4f,null))[_0x9133('0x11')](handleError(_0x4a2c4f,null));};exports[_0x9133('0x14')]=function(_0x5e8620,_0x38dd60){if(_0x5e8620['body'][_0x9133('0xb')]&&_0x5e8620['body']['script']){var _0x2f7354=path['join'](__dirname,_0x9133('0x15'),_0x5e8620['body']['script']);var _0x4c846e=process[_0x9133('0x16')]();process[_0x9133('0x17')](path['dirname'](_0x2f7354));return execChildProcess()[_0x9133('0xe')](function(_0x3f5d0e){process[_0x9133('0x17')](_0x4c846e);return pm2[_0x9133('0x18')]({'name':_0x5e8620['body'][_0x9133('0xb')],'script':_0x2f7354});})['then'](function(_0x187e32){pm2[_0x9133('0x19')]();return _0x187e32[0x0];})[_0x9133('0xe')](respondWithResult(_0x38dd60,0xc9))[_0x9133('0x11')](handleError(_0x38dd60,null));}else{return _0x38dd60[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':_0x9133('0x1b')});}};exports[_0x9133('0x1c')]=function(_0x1b6b3e,_0x46050b){if(_0x1b6b3e['body']['id']){delete _0x1b6b3e['body']['id'];}var _0x477bf1={'online':_0x9133('0x1d'),'stopped':_0x9133('0x1e')};if(_0x477bf1[_0x9133('0x1f')](_0x1b6b3e['body']['status'])){return pm2[_0x477bf1[_0x1b6b3e[_0x9133('0x20')][_0x9133('0x7')]]](_0x1b6b3e[_0x9133('0x21')]['id'])[_0x9133('0xe')](respondWithResult(_0x46050b,0xc8))[_0x9133('0x11')](handleError(_0x46050b,null));}else{return _0x46050b[_0x9133('0x7')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x1ad222,_0x4a4a8e){if(_0x1ad222[_0x9133('0x20')]['id']){delete _0x1ad222[_0x9133('0x20')]['id'];}if(_0x1ad222['params']['id']){return pm2[_0x9133('0x22')](_0x1ad222['params']['id'])[_0x9133('0xe')](function(_0x26ca56){pm2[_0x9133('0x19')]();return _0x26ca56[0x0];})['then'](respondWithResult(_0x4a4a8e,null))[_0x9133('0x11')](handleError(_0x4a4a8e,null));}else{return _0x4a4a8e[_0x9133('0x7')](0x1f4)[_0x9133('0x1a')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x6c76=['status','npm\x20install','info','error','index','list','then','reject','motion2','length','catch','params','create','body','script','join','../../files/plugins','cwd','chdir','start','dump','send','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','sendStatus','stack','name'];(function(_0x1c6fda,_0xaf122e){var _0x4d0e83=function(_0xe8b308){while(--_0xe8b308){_0x1c6fda['push'](_0x1c6fda['shift']());}};_0x4d0e83(++_0xaf122e);}(_0x6c76,0x184));var _0x66c7=function(_0x219aef,_0x46555b){_0x219aef=_0x219aef-0x0;var _0x4405dd=_0x6c76[_0x219aef];return _0x4405dd;};'use strict';var _=require(_0x66c7('0x0'));var pm2=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var path=require(_0x66c7('0x3'));var exec=require(_0x66c7('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x2f6db7,_0x2b7cf3){return function(_0x49d437){if(!_0x49d437){_0x2f6db7[_0x66c7('0x5')](0x194);;}return _0x49d437;};}function respondWithResult(_0x45b0a5,_0x52f71b){_0x52f71b=_0x52f71b||0xc8;return function(_0x23408c){if(_0x23408c){return _0x45b0a5['status'](_0x52f71b)['json'](_0x23408c);}return null;};}function handleError(_0x208d06,_0x2b0065){_0x2b0065=_0x2b0065||0x1f4;return function(_0x24349f){logger['error'](_0x24349f[_0x66c7('0x6')]);if(_0x24349f[_0x66c7('0x7')]){delete _0x24349f[_0x66c7('0x7')];}_0x208d06[_0x66c7('0x8')](_0x2b0065)['send'](_0x24349f);};}function execChildProcess(){return new BPromise(function(_0x464085,_0x45db57){exec(_0x66c7('0x9'),function(_0x187e00,_0x21fb64,_0x406e41){logger[_0x66c7('0xa')](_0x21fb64);logger['info'](_0x406e41);if(_0x187e00){logger[_0x66c7('0xb')](_0x187e00);return _0x45db57(_0x187e00);}return _0x464085(_0x21fb64);});});}exports[_0x66c7('0xc')]=function(_0x35cbc2,_0xea3f56){return pm2[_0x66c7('0xd')]()[_0x66c7('0xe')](function(_0x618bd7){if(_0x618bd7){var _0xf3b04=_[_0x66c7('0xf')](_0x618bd7,function(_0x5d44e1){return _0x5d44e1[_0x66c7('0x7')]==='express'||_0x5d44e1[_0x66c7('0x7')]===_0x66c7('0x10');});return{'rows':_0xf3b04,'count':_0xf3b04[_0x66c7('0x11')]};}return null;})[_0x66c7('0xe')](respondWithResult(_0xea3f56,null))[_0x66c7('0x12')](handleError(_0xea3f56,null));};exports['show']=function(_0x5cf913,_0x53fb36){return pm2['describe'](_0x5cf913[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x53fb36,null))['then'](handleEntityNotFound(_0x53fb36,null))['catch'](handleError(_0x53fb36,null));};exports[_0x66c7('0x14')]=function(_0x9b65cf,_0x4756f7){if(_0x9b65cf[_0x66c7('0x15')]['name']&&_0x9b65cf['body'][_0x66c7('0x16')]){var _0x237177=path[_0x66c7('0x17')](__dirname,_0x66c7('0x18'),_0x9b65cf[_0x66c7('0x15')][_0x66c7('0x16')]);var _0x4804cf=process[_0x66c7('0x19')]();process[_0x66c7('0x1a')](path['dirname'](_0x237177));return execChildProcess()[_0x66c7('0xe')](function(_0x8b96b1){process[_0x66c7('0x1a')](_0x4804cf);return pm2[_0x66c7('0x1b')]({'name':_0x9b65cf['body'][_0x66c7('0x7')],'script':_0x237177});})[_0x66c7('0xe')](function(_0x5b28e6){pm2[_0x66c7('0x1c')]();return _0x5b28e6[0x0];})[_0x66c7('0xe')](respondWithResult(_0x4756f7,0xc9))[_0x66c7('0x12')](handleError(_0x4756f7,null));}else{return _0x4756f7[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x4e514a,_0x2dd131){if(_0x4e514a[_0x66c7('0x15')]['id']){delete _0x4e514a['body']['id'];}var _0x9afd50={'online':_0x66c7('0x1e'),'stopped':_0x66c7('0x1f')};if(_0x9afd50[_0x66c7('0x20')](_0x4e514a[_0x66c7('0x15')][_0x66c7('0x8')])){return pm2[_0x9afd50[_0x4e514a['body'][_0x66c7('0x8')]]](_0x4e514a[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](respondWithResult(_0x2dd131,0xc8))[_0x66c7('0x12')](handleError(_0x2dd131,null));}else{return _0x2dd131[_0x66c7('0x8')](0x1f4)['send']({'message':_0x66c7('0x21')});}};exports['destroy']=function(_0xfbd97,_0x543fbf){if(_0xfbd97[_0x66c7('0x15')]['id']){delete _0xfbd97[_0x66c7('0x15')]['id'];}if(_0xfbd97[_0x66c7('0x13')]['id']){return pm2[_0x66c7('0x22')](_0xfbd97[_0x66c7('0x13')]['id'])[_0x66c7('0xe')](function(_0x559ab9){pm2['dump']();return _0x559ab9[0x0];})[_0x66c7('0xe')](respondWithResult(_0x543fbf,null))[_0x66c7('0x12')](handleError(_0x543fbf,null));}else{return _0x543fbf[_0x66c7('0x8')](0x1f4)[_0x66c7('0x1d')]({'message':_0x66c7('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0e09572..082af96 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 _0x5b71=['/agents','isAuthenticated','getAgents','get','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller'];(function(_0x18e9b9,_0xb8b130){var _0xf30a71=function(_0x58bcdc){while(--_0x58bcdc){_0x18e9b9['push'](_0x18e9b9['shift']());}};_0xf30a71(++_0xb8b130);}(_0x5b71,0x1eb));var _0x15b7=function(_0x229c80,_0x572117){_0x229c80=_0x229c80-0x0;var _0x356219=_0x5b71[_0x229c80];return _0x356219;};'use strict';var express=require(_0x15b7('0x0'));var router=express[_0x15b7('0x1')]();var auth=require(_0x15b7('0x2'));var controller=require(_0x15b7('0x3'));router['get'](_0x15b7('0x4'),auth[_0x15b7('0x5')](),controller[_0x15b7('0x6')]);router[_0x15b7('0x7')](_0x15b7('0x8'),auth[_0x15b7('0x5')](),controller[_0x15b7('0x9')]);module[_0x15b7('0xa')]=router; \ No newline at end of file +var _0x134d=['Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','exports','express'];(function(_0x2b6677,_0x1dab11){var _0x56ca1a=function(_0x2c8f44){while(--_0x2c8f44){_0x2b6677['push'](_0x2b6677['shift']());}};_0x56ca1a(++_0x1dab11);}(_0x134d,0x95));var _0xd134=function(_0x3aa0c9,_0x7c73bb){_0x3aa0c9=_0x3aa0c9-0x0;var _0x1207ec=_0x134d[_0x3aa0c9];return _0x1207ec;};'use strict';var express=require(_0xd134('0x0'));var router=express[_0xd134('0x1')]();var auth=require(_0xd134('0x2'));var controller=require(_0xd134('0x3'));router[_0xd134('0x4')](_0xd134('0x5'),auth[_0xd134('0x6')](),controller[_0xd134('0x7')]);router[_0xd134('0x4')](_0xd134('0x8'),auth[_0xd134('0x6')](),controller['getQueues']);module[_0xd134('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 05f7bdb..212bf5d 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 _0x35fa=['../../mysqldb','../../errors/api','APIBadRequestError','offset','limit','undefined','count','status','set','json','getChannels','query','pauseTypeFilter','*pause','resolve','channel','isValidChannel','format','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','then','getAgentIdsByQueues','rows','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','online','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','agent','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','pause','voice','voiceStatus','sortAgentsByStatus','fields','split','pick','catch','getQueues','toLowerCase','name','outbound','dialActive','dialMethod','userProfileId','QueueCampaigns','Queues','getRealtimeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x35fa,0x99));var _0xa35f=function(_0x496296,_0x2127b0){_0x496296=_0x496296-0x0;var _0x3f6ea7=_0x35fa[_0x496296];return _0x3f6ea7;};'use strict';var _=require(_0xa35f('0x0'));var util=require(_0xa35f('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xa35f('0x2'));var qs=require(_0xa35f('0x3'));var utils=require(_0xa35f('0x4'));var db=require(_0xa35f('0x5'))['db'];var APIBadRequestError=require(_0xa35f('0x6'))[_0xa35f('0x7')];var APIHandleError=require(_0xa35f('0x6'))['handleError'];function respondWithFilteredResult(_0x16beed,_0x18b505){return function(_0x294425){if(_0x294425){var _0x3b3169=typeof _0x18b505[_0xa35f('0x8')]==='undefined'&&typeof _0x18b505[_0xa35f('0x9')]===_0xa35f('0xa');var _0x91bc49=_0x294425[_0xa35f('0xb')];var _0xe89dbc=_0x3b3169?0x0:_0x18b505['offset'];var _0x5814aa=_0x3b3169?_0x294425[_0xa35f('0xb')]:_0x18b505['offset']+_0x18b505[_0xa35f('0x9')];var _0x84b6e5;if(_0x5814aa>=_0x91bc49){_0x5814aa=_0x91bc49;_0x84b6e5=0xc8;}else{_0x84b6e5=0xce;}_0x16beed[_0xa35f('0xc')](_0x84b6e5);return _0x16beed[_0xa35f('0xd')]('Content-Range',_0xe89dbc+'-'+_0x5814aa+'/'+_0x91bc49)[_0xa35f('0xe')](_0x294425);}return null;};}exports['getAgents']=function(_0x1a3fa8,_0x420e5e){var _0xc6ae05={'count':0x0,'rows':[]};var _0x55f207={};var _0x4bbf97;var _0x4e7fb6=utils[_0xa35f('0xf')]();var _0x1fb1e2;var _0x4f1c22;var _0x1d865a=_0x1a3fa8['query']['globalQueueFilter'];var _0x4ae987=_0x1a3fa8[_0xa35f('0x10')]['globalStatusFilter'];var _0x1f3e61=_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x11')];var _0x368cd3=_0x4ae987==='pause'||_0x4ae987===_0xa35f('0x12')?!![]:![];var _0x591a10=[];var _0x3f040f;var _0x3693fc;Promise[_0xa35f('0x13')]()['then'](function(){if(_0x1a3fa8['query'][_0xa35f('0x14')]){if(!utils[_0xa35f('0x15')](_0x1a3fa8['query'][_0xa35f('0x14')])){throw new APIBadRequestError(util[_0xa35f('0x16')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x14')]));}_0x4bbf97=_0x1a3fa8['query']['channel']['toLowerCase']();}if(!_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x17')]||!_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x17')][_0xa35f('0x18')](_0xa35f('0x19'))){_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x17')]=rta[_0xa35f('0x1a')](_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x17')]);return;}var _0x11e503=rta[_0xa35f('0x1b')](_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x17')]);_0x1a3fa8['query'][_0xa35f('0x17')]=_0x11e503['fields'][_0xa35f('0x1c')](',');_0x3f040f=_0x11e503[_0xa35f('0x1d')];})[_0xa35f('0x1e')](function(){if(!_0x1d865a){return[];}return rta[_0xa35f('0x1f')](_0x1d865a,_0x4bbf97);})[_0xa35f('0x1e')](function(_0x505eca){_0x591a10=_0x505eca;return rta['getRealtimeAgents']();})[_0xa35f('0x1e')](function(_0x176602){_0x4f1c22=_0x176602[_0xa35f('0x20')];if((!_0x4ae987||_0x368cd3)&&!_0x3f040f){return _0x591a10;}if(_0x3f040f&&!_0x4ae987){return rta['getSortedAgentsIdsByStatus'](_0x4f1c22,_0x591a10,_0x3f040f);}else{return rta[_0xa35f('0x21')](_0x4f1c22,_0x591a10,_0x4ae987);}})['then'](function(_0x1f14de){_0x591a10=_0x1f14de;var _0x5efc8d=![];if(_0x591a10[_0xa35f('0x22')]===0x0){if(_0x1d865a||_0x4ae987){_0x5efc8d=!![];}if(_0x368cd3){_0x5efc8d=![];}}if(_0x5efc8d){return _0xc6ae05;}var _0x29c06b=_[_0xa35f('0x23')](db[_0xa35f('0x24')][_0xa35f('0x25')],function(_0x401b68){return{'name':_0x401b68[_0xa35f('0x26')],'type':_0x401b68[_0xa35f('0x27')][_0xa35f('0x28')]};});_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x29')]='agent';_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x2a')]=!![];_0x55f207=qs[_0xa35f('0x2b')](_0x29c06b,_0x1a3fa8);_0x55f207[_0xa35f('0x2c')]=!![];var _0x164813=[];if(_0x591a10['length']>0x0){_0x164813[_0xa35f('0x2d')]({'id':{'$in':_0x591a10}});if(_0x3f040f&&!_0x4ae987){_0x3693fc=[db[_0xa35f('0x2e')][_0xa35f('0x2f')](_0xa35f('0x30')+_0x591a10+')')];_0x55f207[_0xa35f('0x1d')]=_0x3693fc;}}if(_0x368cd3){_0x4e7fb6[_0xa35f('0x31')](function(_0x37cf12){var _0x5d2b48=!![];if(_0x4ae987==='*pause'&&_0x4bbf97!==_0x37cf12){_0x5d2b48=![];}_0x164813[_0xa35f('0x2d')]({[_0x37cf12+'Pause']:_0x5d2b48});});if(_0x1f3e61){_0x164813[_0xa35f('0x2d')]({'pauseType':_0x1f3e61});}}else if(_0x4ae987){_0x4e7fb6[_0xa35f('0x31')](function(_0x268d55){_0x164813[_0xa35f('0x2d')]({[_0x268d55+_0xa35f('0x32')]:![]});});}_0x55f207['where']=_['merge'](_0x55f207[_0xa35f('0x33')],{'$and':_0x164813});if(_0x1a3fa8['user'][_0xa35f('0x29')]==='user'){var _0x18b612={'params':{'id':_0x1a3fa8[_0xa35f('0x34')]['userProfileId']},'query':{'section':'Agents','role':_0xa35f('0x35'),'online':!![],'raw':!![],'ids':_0x591a10,'customSorting':_0x3693fc}};if(_0x368cd3){_0x18b612[_0xa35f('0x10')][_0xa35f('0x36')]=_0x164813;}_0x18b612['query']=Object[_0xa35f('0x37')](_0x18b612[_0xa35f('0x10')],_0x1a3fa8[_0xa35f('0x10')]);delete _0x18b612[_0xa35f('0x10')]['id'];return db[_0xa35f('0x38')][_0xa35f('0x39')](_0x18b612);}return db[_0xa35f('0x24')][_0xa35f('0x3a')](_0x55f207);})['then'](function(_0x4dd36b){_0xc6ae05[_0xa35f('0xb')]=_0x4dd36b['count'];_0x1fb1e2=_0x4dd36b['rows'];return _0x1fb1e2[_0xa35f('0x23')](function(_0x483978){var _0x2ddb56=_['find'](_0x4f1c22,['id',_0x483978['id']]);if(_0x2ddb56){var _0x103eef=rta[_0xa35f('0x3b')](_0x2ddb56);_['merge'](_0x483978,_0x103eef);}_0x483978['globalStatus']=rta[_0xa35f('0x3c')](_0x483978);if(_0x483978[_0xa35f('0x19')][_0xa35f('0x18')](_0xa35f('0x3d'))){_0x4e7fb6['forEach'](function(_0x193bf3){if(_0x483978[_0x193bf3+_0xa35f('0x32')]){if(_0x193bf3===_0xa35f('0x3e')){if(_0x483978[_0xa35f('0x3f')]!=='talking'){_0x483978['voiceStatus']='pause';}}else{_0x483978[_0x193bf3+'Status']=_0xa35f('0x3d');}}});}return _0x483978;});})[_0xa35f('0x1e')](function(_0x482b10){if(!_0x3f040f||_0x3693fc){return _0x482b10;}return rta[_0xa35f('0x40')](_0x482b10,_0x3f040f);})[_0xa35f('0x1e')](function(_0x331a72){var _0x54f211=null;if(_0x1a3fa8[_0xa35f('0x10')][_0xa35f('0x41')]){var _0x14da36=_0x1a3fa8['query'][_0xa35f('0x41')][_0xa35f('0x42')](',');_0x54f211=_0x331a72[_0xa35f('0x23')](function(_0x351d91){return _[_0xa35f('0x43')](_0x351d91,_0x14da36);});}_0xc6ae05[_0xa35f('0x20')]=_0x54f211||_0x331a72;return _0xc6ae05;})[_0xa35f('0x1e')](respondWithFilteredResult(_0x420e5e,_0x55f207))[_0xa35f('0x44')](APIHandleError(_0x420e5e));};exports[_0xa35f('0x45')]=function(_0x3c04eb,_0xd30174){var _0x257674={'count':0x0,'rows':[]};var _0x3395de={};var _0x18f590;var _0x6e21a;var _0x4333ed;Promise[_0xa35f('0x13')]()[_0xa35f('0x1e')](function(){if(_0x3c04eb['query']['channel']){if(!utils['isValidChannel'](_0x3c04eb['query'][_0xa35f('0x14')])){throw new APIBadRequestError(util[_0xa35f('0x16')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3c04eb[_0xa35f('0x10')][_0xa35f('0x14')]));}_0x18f590=_0x3c04eb[_0xa35f('0x10')][_0xa35f('0x14')][_0xa35f('0x46')]();}var _0x308387=_['startCase'](_0x18f590)+'Queue';var _0x2f0fd4=_[_0xa35f('0x23')](db[_0x308387]['rawAttributes'],function(_0x536f4f){return{'name':_0x536f4f[_0xa35f('0x26')],'type':_0x536f4f[_0xa35f('0x27')][_0xa35f('0x28')]};});if(!_0x3c04eb[_0xa35f('0x10')]['fields']){var _0x350cc4=['id',_0xa35f('0x47')];if(_0x18f590===_0xa35f('0x3e')){_0x350cc4[_0xa35f('0x2d')](_0xa35f('0x27'));if(_0x3c04eb[_0xa35f('0x10')][_0xa35f('0x27')]===_0xa35f('0x48')){_0x350cc4[_0xa35f('0x2d')]([_0xa35f('0x49'),_0xa35f('0x4a')]);}}_0x3c04eb[_0xa35f('0x10')][_0xa35f('0x41')]=_0x350cc4[_0xa35f('0x1c')](',');}_0x3395de=qs[_0xa35f('0x2b')](_0x2f0fd4,_0x3c04eb);if(_0x3c04eb[_0xa35f('0x34')][_0xa35f('0x29')]===_0xa35f('0x34')){var _0x1f4c5e={'params':{'id':_0x3c04eb[_0xa35f('0x34')][_0xa35f('0x4b')]},'query':{'section':_0x18f590==='voice'&&_0x3c04eb['query'][_0xa35f('0x27')]===_0xa35f('0x48')?_0xa35f('0x4c'):_['startCase'](_0x18f590)+_0xa35f('0x4d'),'type':_0x3c04eb[_0xa35f('0x10')][_0xa35f('0x27')],'nolimit':!![],'sort':_0xa35f('0x47'),'filter':_0x3c04eb[_0xa35f('0x10')]['filter']}};_0x1f4c5e[_0xa35f('0x10')]=Object[_0xa35f('0x37')](_0x1f4c5e[_0xa35f('0x10')],_0x3c04eb[_0xa35f('0x10')]);delete _0x1f4c5e[_0xa35f('0x10')]['id'];return db[_0xa35f('0x38')]['getResources'](_0x1f4c5e);}return db[_0x308387][_0xa35f('0x3a')](_0x3395de);})[_0xa35f('0x1e')](function(_0x25d46e){_0x257674[_0xa35f('0xb')]=_0x25d46e[_0xa35f('0xb')];_0x6e21a=_0x25d46e[_0xa35f('0x20')];return rtq[_0xa35f('0x4e')](_0x3c04eb,_0x18f590);})[_0xa35f('0x1e')](function(_0x45556b){_0x4333ed=_0x45556b[_0xa35f('0x20')];return rtq['initializeQueues'](_0x6e21a,_0x4333ed,_0x18f590,_0x3c04eb['query'][_0xa35f('0x27')]);})[_0xa35f('0x1e')](function(_0x1fe3ed){_0x257674['rows']=_0x1fe3ed;return _0x257674;})['then'](respondWithFilteredResult(_0xd30174,_0x3395de))[_0xa35f('0x44')](APIHandleError(_0xd30174));}; \ No newline at end of file +var _0x54ad=['pause','*pause','resolve','then','query','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','includes','sort','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','literal','FIELD(id,','forEach','Pause','where','merge','user','extraQueryConditions','assign','UserProfile','count','map','find','globalStatus','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','toLowerCase','startCase','Queue','name','voice','outbound','dialActive','userProfileId','QueueCampaigns','filter','getResources','findAndCountAll','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','status','set','Content-Range','json','getAgents','getChannels','globalQueueFilter','globalStatusFilter','pauseTypeFilter'];(function(_0x3a27ec,_0x57451f){var _0x4815ad=function(_0x4bae9a){while(--_0x4bae9a){_0x3a27ec['push'](_0x3a27ec['shift']());}};_0x4815ad(++_0x57451f);}(_0x54ad,0xf0));var _0xd54a=function(_0x5efe17,_0x4543bc){_0x5efe17=_0x5efe17-0x0;var _0x55694c=_0x54ad[_0x5efe17];return _0x55694c;};'use strict';var _=require(_0xd54a('0x0'));var util=require(_0xd54a('0x1'));var rta=require(_0xd54a('0x2'));var rtq=require(_0xd54a('0x3'));var qs=require(_0xd54a('0x4'));var utils=require(_0xd54a('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xd54a('0x6'))[_0xd54a('0x7')];var APIHandleError=require(_0xd54a('0x6'))[_0xd54a('0x8')];function respondWithFilteredResult(_0xba2178,_0x1da8be){return function(_0xc5f599){if(_0xc5f599){var _0x3f4cc5=typeof _0x1da8be[_0xd54a('0x9')]===_0xd54a('0xa')&&typeof _0x1da8be[_0xd54a('0xb')]===_0xd54a('0xa');var _0x342ecd=_0xc5f599['count'];var _0x6766e0=_0x3f4cc5?0x0:_0x1da8be[_0xd54a('0x9')];var _0x2f8b83=_0x3f4cc5?_0xc5f599['count']:_0x1da8be[_0xd54a('0x9')]+_0x1da8be['limit'];var _0x411678;if(_0x2f8b83>=_0x342ecd){_0x2f8b83=_0x342ecd;_0x411678=0xc8;}else{_0x411678=0xce;}_0xba2178[_0xd54a('0xc')](_0x411678);return _0xba2178[_0xd54a('0xd')](_0xd54a('0xe'),_0x6766e0+'-'+_0x2f8b83+'/'+_0x342ecd)[_0xd54a('0xf')](_0xc5f599);}return null;};}exports[_0xd54a('0x10')]=function(_0x4f27c2,_0xe88c2a){var _0x24bf42={'count':0x0,'rows':[]};var _0x1f4fa0={};var _0x3f69ec;var _0x1156de=utils[_0xd54a('0x11')]();var _0x517a2b;var _0x29e5b4;var _0x333f23=_0x4f27c2['query'][_0xd54a('0x12')];var _0x377cb4=_0x4f27c2['query'][_0xd54a('0x13')];var _0x5054ad=_0x4f27c2['query'][_0xd54a('0x14')];var _0x135223=_0x377cb4===_0xd54a('0x15')||_0x377cb4===_0xd54a('0x16')?!![]:![];var _0x4b208a=[];var _0xde907d;var _0x5e4c08;Promise[_0xd54a('0x17')]()[_0xd54a('0x18')](function(){if(_0x4f27c2[_0xd54a('0x19')]['channel']){if(!utils[_0xd54a('0x1a')](_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1b')])){throw new APIBadRequestError(util[_0xd54a('0x1c')](_0xd54a('0x1d'),_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1b')]));}_0x3f69ec=_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1b')]['toLowerCase']();}if(!_0x4f27c2[_0xd54a('0x19')]['sort']||!_0x4f27c2['query']['sort'][_0xd54a('0x1e')]('globalStatus')){_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1f')]=rta['validateSortParameter'](_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1f')]);return;}var _0x167a85=rta[_0xd54a('0x20')](_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1f')]);_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x1f')]=_0x167a85[_0xd54a('0x21')][_0xd54a('0x22')](',');_0xde907d=_0x167a85[_0xd54a('0x23')];})[_0xd54a('0x18')](function(){if(!_0x333f23){return[];}return rta[_0xd54a('0x24')](_0x333f23,_0x3f69ec);})[_0xd54a('0x18')](function(_0x28126c){_0x4b208a=_0x28126c;return rta[_0xd54a('0x25')]();})[_0xd54a('0x18')](function(_0x410f05){_0x29e5b4=_0x410f05[_0xd54a('0x26')];if((!_0x377cb4||_0x135223)&&!_0xde907d){return _0x4b208a;}if(_0xde907d&&!_0x377cb4){return rta[_0xd54a('0x27')](_0x29e5b4,_0x4b208a,_0xde907d);}else{return rta[_0xd54a('0x28')](_0x29e5b4,_0x4b208a,_0x377cb4);}})[_0xd54a('0x18')](function(_0x588a21){_0x4b208a=_0x588a21;var _0x5082dd=![];if(_0x4b208a[_0xd54a('0x29')]===0x0){if(_0x333f23||_0x377cb4){_0x5082dd=!![];}if(_0x135223){_0x5082dd=![];}}if(_0x5082dd){return _0x24bf42;}var _0x4975c4=_['map'](db[_0xd54a('0x2a')][_0xd54a('0x2b')],function(_0x38c0e5){return{'name':_0x38c0e5[_0xd54a('0x2c')],'type':_0x38c0e5[_0xd54a('0x2d')][_0xd54a('0x2e')]};});_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x2f')]=_0xd54a('0x30');_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x31')]=!![];_0x1f4fa0=qs[_0xd54a('0x32')](_0x4975c4,_0x4f27c2);_0x1f4fa0[_0xd54a('0x33')]=!![];var _0x1cdb1a=[];if(_0x4b208a[_0xd54a('0x29')]>0x0){_0x1cdb1a[_0xd54a('0x34')]({'id':{'$in':_0x4b208a}});if(_0xde907d&&!_0x377cb4){_0x5e4c08=[db['sequelize'][_0xd54a('0x35')](_0xd54a('0x36')+_0x4b208a+')')];_0x1f4fa0['order']=_0x5e4c08;}}if(_0x135223){_0x1156de[_0xd54a('0x37')](function(_0x3eceea){var _0x5d65d2=!![];if(_0x377cb4===_0xd54a('0x16')&&_0x3f69ec!==_0x3eceea){_0x5d65d2=![];}_0x1cdb1a[_0xd54a('0x34')]({[_0x3eceea+_0xd54a('0x38')]:_0x5d65d2});});if(_0x5054ad){_0x1cdb1a[_0xd54a('0x34')]({'pauseType':_0x5054ad});}}else if(_0x377cb4){_0x1156de[_0xd54a('0x37')](function(_0x2ee04e){_0x1cdb1a[_0xd54a('0x34')]({[_0x2ee04e+'Pause']:![]});});}_0x1f4fa0[_0xd54a('0x39')]=_[_0xd54a('0x3a')](_0x1f4fa0[_0xd54a('0x39')],{'$and':_0x1cdb1a});if(_0x4f27c2[_0xd54a('0x3b')][_0xd54a('0x2f')]===_0xd54a('0x3b')){var _0x12104b={'params':{'id':_0x4f27c2['user']['userProfileId']},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x4b208a,'customSorting':_0x5e4c08}};if(_0x135223){_0x12104b[_0xd54a('0x19')][_0xd54a('0x3c')]=_0x1cdb1a;}_0x12104b[_0xd54a('0x19')]=Object[_0xd54a('0x3d')](_0x12104b[_0xd54a('0x19')],_0x4f27c2[_0xd54a('0x19')]);delete _0x12104b[_0xd54a('0x19')]['id'];return db[_0xd54a('0x3e')]['getResources'](_0x12104b);}return db[_0xd54a('0x2a')]['findAndCountAll'](_0x1f4fa0);})[_0xd54a('0x18')](function(_0x4c371f){_0x24bf42[_0xd54a('0x3f')]=_0x4c371f[_0xd54a('0x3f')];_0x517a2b=_0x4c371f['rows'];return _0x517a2b[_0xd54a('0x40')](function(_0x519679){var _0x3cfad6=_[_0xd54a('0x41')](_0x29e5b4,['id',_0x519679['id']]);if(_0x3cfad6){var _0x5a8c1e=rta['filterAgentAttributes'](_0x3cfad6);_['merge'](_0x519679,_0x5a8c1e);}_0x519679['globalStatus']=rta['getAgentStatus'](_0x519679);if(_0x519679[_0xd54a('0x42')]['includes']('pause')){_0x1156de[_0xd54a('0x37')](function(_0x297870){if(_0x519679[_0x297870+_0xd54a('0x38')]){if(_0x297870==='voice'){if(_0x519679[_0xd54a('0x43')]!=='talking'){_0x519679['voiceStatus']=_0xd54a('0x15');}}else{_0x519679[_0x297870+_0xd54a('0x44')]='pause';}}});}return _0x519679;});})[_0xd54a('0x18')](function(_0x20c00f){if(!_0xde907d||_0x5e4c08){return _0x20c00f;}return rta[_0xd54a('0x45')](_0x20c00f,_0xde907d);})[_0xd54a('0x18')](function(_0x197cc2){var _0x9ff0d2=null;if(_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x21')]){var _0xe357f9=_0x4f27c2[_0xd54a('0x19')][_0xd54a('0x21')]['split'](',');_0x9ff0d2=_0x197cc2[_0xd54a('0x40')](function(_0x3b084c){return _[_0xd54a('0x46')](_0x3b084c,_0xe357f9);});}_0x24bf42[_0xd54a('0x26')]=_0x9ff0d2||_0x197cc2;return _0x24bf42;})[_0xd54a('0x18')](respondWithFilteredResult(_0xe88c2a,_0x1f4fa0))[_0xd54a('0x47')](APIHandleError(_0xe88c2a));};exports[_0xd54a('0x48')]=function(_0x488127,_0x1464f7){var _0x375421={'count':0x0,'rows':[]};var _0x3d98f7={};var _0x43bf28;var _0x4cd478;var _0x531dd8;Promise[_0xd54a('0x17')]()[_0xd54a('0x18')](function(){if(_0x488127['query'][_0xd54a('0x1b')]){if(!utils[_0xd54a('0x1a')](_0x488127['query']['channel'])){throw new APIBadRequestError(util[_0xd54a('0x1c')](_0xd54a('0x1d'),_0x488127[_0xd54a('0x19')][_0xd54a('0x1b')]));}_0x43bf28=_0x488127[_0xd54a('0x19')][_0xd54a('0x1b')][_0xd54a('0x49')]();}var _0x240be9=_[_0xd54a('0x4a')](_0x43bf28)+_0xd54a('0x4b');var _0x2bacd1=_[_0xd54a('0x40')](db[_0x240be9]['rawAttributes'],function(_0x3a046f){return{'name':_0x3a046f[_0xd54a('0x2c')],'type':_0x3a046f[_0xd54a('0x2d')][_0xd54a('0x2e')]};});if(!_0x488127[_0xd54a('0x19')]['fields']){var _0x1e92b0=['id',_0xd54a('0x4c')];if(_0x43bf28===_0xd54a('0x4d')){_0x1e92b0[_0xd54a('0x34')](_0xd54a('0x2d'));if(_0x488127[_0xd54a('0x19')][_0xd54a('0x2d')]===_0xd54a('0x4e')){_0x1e92b0[_0xd54a('0x34')]([_0xd54a('0x4f'),'dialMethod']);}}_0x488127['query']['fields']=_0x1e92b0[_0xd54a('0x22')](',');}_0x3d98f7=qs[_0xd54a('0x32')](_0x2bacd1,_0x488127);if(_0x488127[_0xd54a('0x3b')][_0xd54a('0x2f')]===_0xd54a('0x3b')){var _0x374bae={'params':{'id':_0x488127[_0xd54a('0x3b')][_0xd54a('0x50')]},'query':{'section':_0x43bf28==='voice'&&_0x488127[_0xd54a('0x19')]['type']===_0xd54a('0x4e')?_0xd54a('0x51'):_[_0xd54a('0x4a')](_0x43bf28)+'Queues','type':_0x488127['query'][_0xd54a('0x2d')],'nolimit':!![],'sort':_0xd54a('0x4c'),'filter':_0x488127[_0xd54a('0x19')][_0xd54a('0x52')]}};_0x374bae['query']=Object[_0xd54a('0x3d')](_0x374bae['query'],_0x488127[_0xd54a('0x19')]);delete _0x374bae['query']['id'];return db[_0xd54a('0x3e')][_0xd54a('0x53')](_0x374bae);}return db[_0x240be9][_0xd54a('0x54')](_0x3d98f7);})[_0xd54a('0x18')](function(_0x4b1288){_0x375421[_0xd54a('0x3f')]=_0x4b1288['count'];_0x4cd478=_0x4b1288[_0xd54a('0x26')];return rtq[_0xd54a('0x55')](_0x488127,_0x43bf28);})['then'](function(_0x2a76b4){_0x531dd8=_0x2a76b4[_0xd54a('0x26')];return rtq[_0xd54a('0x56')](_0x4cd478,_0x531dd8,_0x43bf28,_0x488127[_0xd54a('0x19')][_0xd54a('0x2d')]);})[_0xd54a('0x18')](function(_0x50eb74){_0x375421[_0xd54a('0x26')]=_0x50eb74;return _0x375421;})['then'](respondWithFilteredResult(_0x1464f7,_0x3d98f7))['catch'](APIHandleError(_0x1464f7));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6b1463c..bb5143b 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x41c2d7,_0x452fff){var _0x33640b=function(_0x18b81a){while(--_0x18b81a){_0x41c2d7['push'](_0x41c2d7['shift']());}};_0x33640b(++_0x452fff);}(_0xe706,0xa3));var _0x6e70=function(_0x7a3247,_0x15cb12){_0x7a3247=_0x7a3247-0x0;var _0x1bfde5=_0xe706[_0x7a3247];return _0x1bfde5;};'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(_0x501ca1,_0x6c6edc){var _0x2a99c4=function(_0x542cad){while(--_0x542cad){_0x501ca1['push'](_0x501ca1['shift']());}};_0x2a99c4(++_0x6c6edc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 4b21b5d..c66d95f 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 _0x79bf=['STRING','DATE','INTEGER','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79bf,0x1df));var _0xf79b=function(_0x1118eb,_0x476f0a){_0x1118eb=_0x1118eb-0x0;var _0x2dbcd0=_0x79bf[_0x1118eb];return _0x2dbcd0;};'use strict';var Sequelize=require('sequelize');module[_0xf79b('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf79b('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xf79b('0x1')]},'starttime':{'type':Sequelize[_0xf79b('0x2')]},'responsetime':{'type':Sequelize[_0xf79b('0x2')]},'ringtime':{'type':Sequelize[_0xf79b('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf79b('0x1')]},'campaigntype':{'type':Sequelize[_0xf79b('0x1')]},'membername':{'type':Sequelize[_0xf79b('0x1')]}}; \ No newline at end of file +var _0x510e=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0xf62e6c,_0x160938){var _0x14234f=function(_0x16fe1d){while(--_0x16fe1d){_0xf62e6c['push'](_0xf62e6c['shift']());}};_0x14234f(++_0x160938);}(_0x510e,0x1ed));var _0xe510=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x510e[_0x382e89];return _0x3a1318;};'use strict';var Sequelize=require(_0xe510('0x0'));module[_0xe510('0x1')]={'state':{'type':Sequelize[_0xe510('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe510('0x3')]},'scheduledat':{'type':Sequelize[_0xe510('0x4')]},'uniqueid':{'type':Sequelize[_0xe510('0x3')]},'starttime':{'type':Sequelize[_0xe510('0x4')]},'responsetime':{'type':Sequelize[_0xe510('0x4')]},'ringtime':{'type':Sequelize[_0xe510('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe510('0x3')]},'membername':{'type':Sequelize[_0xe510('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8c37259..62b1fea 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 _0x8947=['report_agent_preview','api','moment','request-promise','path','rimraf','../../config/environment','exports','ReportAgentPreview'];(function(_0x5a3ec5,_0x71ae0f){var _0x5749de=function(_0x149768){while(--_0x149768){_0x5a3ec5['push'](_0x5a3ec5['shift']());}};_0x5749de(++_0x71ae0f);}(_0x8947,0x76));var _0x7894=function(_0x53ec76,_0x394d0d){_0x53ec76=_0x53ec76-0x0;var _0x3919e4=_0x8947[_0x53ec76];return _0x3919e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7894('0x0'));var moment=require(_0x7894('0x1'));var BPromise=require('bluebird');var rp=require(_0x7894('0x2'));var fs=require('fs');var path=require(_0x7894('0x3'));var rimraf=require(_0x7894('0x4'));var config=require(_0x7894('0x5'));var attributes=require('./reportAgentPreview.attributes');module[_0x7894('0x6')]=function(_0x48f358,_0x45ac38){return _0x48f358['define'](_0x7894('0x7'),attributes,{'tableName':_0x7894('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffcd=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x32cd25,_0x5abf21){var _0x423f41=function(_0x16072b){while(--_0x16072b){_0x32cd25['push'](_0x32cd25['shift']());}};_0x423f41(++_0x5abf21);}(_0xffcd,0x126));var _0xdffc=function(_0x595984,_0x30cb32){_0x595984=_0x595984-0x0;var _0x3b253f=_0xffcd[_0x595984];return _0x3b253f;};'use strict';var _=require(_0xdffc('0x0'));var util=require(_0xdffc('0x1'));var logger=require(_0xdffc('0x2'))(_0xdffc('0x3'));var moment=require(_0xdffc('0x4'));var BPromise=require('bluebird');var rp=require(_0xdffc('0x5'));var fs=require('fs');var path=require(_0xdffc('0x6'));var rimraf=require(_0xdffc('0x7'));var config=require(_0xdffc('0x8'));var attributes=require(_0xdffc('0x9'));module[_0xdffc('0xa')]=function(_0x300316,_0x3b0e74){return _0x300316[_0xdffc('0xb')]('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 c01433c..6d27962 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 _0x7ff7=['jayson/promise','http','then','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2419d3,_0x51a230){var _0x559022=function(_0x5600c2){while(--_0x5600c2){_0x2419d3['push'](_0x2419d3['shift']());}};_0x559022(++_0x51a230);}(_0x7ff7,0x17e));var _0x77ff=function(_0x3ca83c,_0x83a924){_0x3ca83c=_0x3ca83c-0x0;var _0x58098b=_0x7ff7[_0x3ca83c];return _0x58098b;};'use strict';var _=require('lodash');var util=require(_0x77ff('0x0'));var moment=require(_0x77ff('0x1'));var BPromise=require(_0x77ff('0x2'));var rs=require(_0x77ff('0x3'));var fs=require('fs');var Redis=require(_0x77ff('0x4'));var db=require(_0x77ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77ff('0x6'))(_0x77ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x77ff('0x8'));var client=jayson['client'][_0x77ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x485ee7,_0x1f6f13,_0x5259d0){return new BPromise(function(_0x1fcdb2,_0x58c6cb){return client['request'](_0x485ee7,_0x5259d0)[_0x77ff('0xa')](function(_0x100832){logger[_0x77ff('0xb')](_0x77ff('0xc'),_0x1f6f13,'request\x20sent');logger['debug'](_0x77ff('0xd'),_0x1f6f13,_0x77ff('0xe'),JSON[_0x77ff('0xf')](_0x100832));if(_0x100832[_0x77ff('0x10')]){if(_0x100832['error'][_0x77ff('0x11')]===0x1f4){logger[_0x77ff('0x10')](_0x77ff('0xc'),_0x1f6f13,_0x100832['error']['message']);return _0x58c6cb(_0x100832[_0x77ff('0x10')][_0x77ff('0x12')]);}logger[_0x77ff('0x10')](_0x77ff('0xc'),_0x1f6f13,_0x100832[_0x77ff('0x10')][_0x77ff('0x12')]);return _0x1fcdb2(_0x100832[_0x77ff('0x10')][_0x77ff('0x12')]);}else{logger[_0x77ff('0xb')](_0x77ff('0xc'),_0x1f6f13,'request\x20sent');_0x1fcdb2(_0x100832[_0x77ff('0x13')][_0x77ff('0x12')]);}})[_0x77ff('0x14')](function(_0x2a1b0a){logger['error'](_0x77ff('0xc'),_0x1f6f13,_0x2a1b0a);_0x58c6cb(_0x2a1b0a);});});}exports[_0x77ff('0x15')]=function(_0x1a52e2){var _0x1b43d6=this;return new Promise(function(_0x4010f8,_0x30d23b){return db[_0x77ff('0x16')]['create'](_0x1a52e2[_0x77ff('0x17')],{'raw':_0x1a52e2[_0x77ff('0x18')]?_0x1a52e2[_0x77ff('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1b105c){logger[_0x77ff('0xb')]('CreateReportAgentPreview',_0x1a52e2);logger[_0x77ff('0x19')](_0x77ff('0x15'),_0x1a52e2,JSON['stringify'](_0x1b105c));_0x4010f8(_0x1b105c);})['catch'](function(_0x36bcea){logger[_0x77ff('0x10')](_0x77ff('0x15'),_0x36bcea[_0x77ff('0x12')],_0x1a52e2);_0x30d23b(_0x1b43d6['error'](0x1f4,_0x36bcea[_0x77ff('0x12')]));});});}; \ No newline at end of file +var _0x5443=['code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x5443,0x120));var _0x3544=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5443[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x3544('0x0'));var util=require(_0x3544('0x1'));var moment=require(_0x3544('0x2'));var BPromise=require('bluebird');var rs=require(_0x3544('0x3'));var fs=require('fs');var Redis=require(_0x3544('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3544('0x5'));var logger=require(_0x3544('0x6'))(_0x3544('0x7'));var config=require('../../config/environment');var jayson=require(_0x3544('0x8'));var client=jayson[_0x3544('0x9')][_0x3544('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca9c,_0x42615f,_0x483f79){return new BPromise(function(_0x2350f5,_0x17d2be){return client[_0x3544('0xb')](_0x1ca9c,_0x483f79)[_0x3544('0xc')](function(_0x256263){logger[_0x3544('0xd')](_0x3544('0xe'),_0x42615f,_0x3544('0xf'));logger[_0x3544('0x10')](_0x3544('0x11'),_0x42615f,_0x3544('0xf'),JSON[_0x3544('0x12')](_0x256263));if(_0x256263[_0x3544('0x13')]){if(_0x256263['error'][_0x3544('0x14')]===0x1f4){logger[_0x3544('0x13')](_0x3544('0xe'),_0x42615f,_0x256263[_0x3544('0x13')][_0x3544('0x15')]);return _0x17d2be(_0x256263[_0x3544('0x13')][_0x3544('0x15')]);}logger['error'](_0x3544('0xe'),_0x42615f,_0x256263[_0x3544('0x13')][_0x3544('0x15')]);return _0x2350f5(_0x256263[_0x3544('0x13')]['message']);}else{logger[_0x3544('0xd')](_0x3544('0xe'),_0x42615f,_0x3544('0xf'));_0x2350f5(_0x256263[_0x3544('0x16')][_0x3544('0x15')]);}})[_0x3544('0x17')](function(_0x1b40ea){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x42615f,_0x1b40ea);_0x17d2be(_0x1b40ea);});});}exports[_0x3544('0x18')]=function(_0x376579){var _0x5bf749=this;return new Promise(function(_0x199721,_0x48fc33){return db[_0x3544('0x19')]['create'](_0x376579['body'],{'raw':_0x376579['options']?_0x376579[_0x3544('0x1a')][_0x3544('0x1b')]===undefined?!![]:![]:!![]})[_0x3544('0xc')](function(_0x56b1b7){logger[_0x3544('0xd')](_0x3544('0x18'),_0x376579);logger['debug'](_0x3544('0x18'),_0x376579,JSON[_0x3544('0x12')](_0x56b1b7));_0x199721(_0x56b1b7);})['catch'](function(_0x1511e3){logger[_0x3544('0x13')](_0x3544('0x18'),_0x1511e3['message'],_0x376579);_0x48fc33(_0x5bf749['error'](0x1f4,_0x1511e3['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 659cbd3..2645222 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 _0xe2fa=['agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','exports','path','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','/outbound/channels'];(function(_0x192f98,_0x2653fb){var _0x523409=function(_0x583bab){while(--_0x583bab){_0x192f98['push'](_0x192f98['shift']());}};_0x523409(++_0x2653fb);}(_0xe2fa,0x1e0));var _0xae2f=function(_0x288dd0,_0x54536c){_0x288dd0=_0x288dd0-0x0;var _0xe2ae50=_0xe2fa[_0x288dd0];return _0xe2ae50;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae2f('0x0'));var express=require('express');var router=express[_0xae2f('0x1')]();var auth=require(_0xae2f('0x2'));var controller=require(_0xae2f('0x3'));router[_0xae2f('0x4')]('/voice/channels',auth[_0xae2f('0x5')](),controller[_0xae2f('0x6')]);router[_0xae2f('0x4')](_0xae2f('0x7'),auth['isAuthenticated'](),controller[_0xae2f('0x8')]);router[_0xae2f('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0xae2f('0x9')]);router[_0xae2f('0x4')](_0xae2f('0xa'),auth[_0xae2f('0x5')](),controller[_0xae2f('0xb')]);router[_0xae2f('0x4')](_0xae2f('0xc'),auth[_0xae2f('0x5')](),controller['chatQueues']);router[_0xae2f('0x4')](_0xae2f('0xd'),auth[_0xae2f('0x5')](),controller[_0xae2f('0xe')]);router[_0xae2f('0x4')]('/mail/accounts',auth[_0xae2f('0x5')](),controller[_0xae2f('0xf')]);router['get'](_0xae2f('0x10'),auth[_0xae2f('0x5')](),controller['openchannelQueues']);router[_0xae2f('0x4')](_0xae2f('0x11'),auth['isAuthenticated'](),controller[_0xae2f('0x12')]);router[_0xae2f('0x4')]('/whatsapp/queues',auth[_0xae2f('0x5')](),controller['whatsappQueues']);router[_0xae2f('0x4')](_0xae2f('0x13'),auth['isAuthenticated'](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xae2f('0x14')]);router['get'](_0xae2f('0x15'),auth[_0xae2f('0x5')](),controller['voiceQueuesChannels']);router['get'](_0xae2f('0x16'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x17')]);router[_0xae2f('0x4')](_0xae2f('0x18'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x19')]);router[_0xae2f('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xae2f('0x5')](),controller[_0xae2f('0x1a')]);router['get'](_0xae2f('0x1b'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0xae2f('0x1c')]('/voice/queues/:id',auth[_0xae2f('0x5')](),controller['updateVoiceQueue']);router[_0xae2f('0x4')](_0xae2f('0x1d'),auth[_0xae2f('0x5')](),controller['outbound']);router[_0xae2f('0x4')](_0xae2f('0x1e'),auth[_0xae2f('0x5')](),controller['outboundChannels']);router[_0xae2f('0x4')]('/agents',auth[_0xae2f('0x5')](),controller[_0xae2f('0x1f')]);router[_0xae2f('0x1c')](_0xae2f('0x20'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0xae2f('0x4')](_0xae2f('0x21'),auth['isAuthenticated'](),controller[_0xae2f('0x22')]);router[_0xae2f('0x4')](_0xae2f('0x23'),auth['isAuthenticated'](),controller[_0xae2f('0x24')]);router[_0xae2f('0x4')](_0xae2f('0x25'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x26')]);router['get'](_0xae2f('0x27'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xae2f('0x4')](_0xae2f('0x28'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x29')]);router[_0xae2f('0x4')](_0xae2f('0x2a'),auth[_0xae2f('0x5')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xae2f('0x2b'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x2c')]);router[_0xae2f('0x4')](_0xae2f('0x2d'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x2e')]);router[_0xae2f('0x4')](_0xae2f('0x2f'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x30')]);router[_0xae2f('0x4')](_0xae2f('0x31'),auth['isAuthenticated'](),controller[_0xae2f('0x32')]);router[_0xae2f('0x4')](_0xae2f('0x33'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router['post'](_0xae2f('0x34'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x35')](_0xae2f('0x36')));router[_0xae2f('0x4')]('/mail/queues/:id',auth[_0xae2f('0x5')](),controller[_0xae2f('0x37')]);router[_0xae2f('0x38')](_0xae2f('0x39'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x35')](_0xae2f('0x3a')));router[_0xae2f('0x4')]('/chat/queues/:id',auth[_0xae2f('0x5')](),controller[_0xae2f('0x3b')]);router[_0xae2f('0x38')](_0xae2f('0x3c'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x35')](_0xae2f('0x3d')));router[_0xae2f('0x4')](_0xae2f('0x3e'),auth['isAuthenticated'](),controller[_0xae2f('0x3f')]);router[_0xae2f('0x38')](_0xae2f('0x40'),auth[_0xae2f('0x5')](),controller[_0xae2f('0x35')](_0xae2f('0x41')));router[_0xae2f('0x4')](_0xae2f('0x42'),auth[_0xae2f('0x5')](),controller['showOpenchannelQueues']);router[_0xae2f('0x38')]('/sms/queues/:id/notify',auth[_0xae2f('0x5')](),controller[_0xae2f('0x35')](_0xae2f('0x43')));router[_0xae2f('0x38')](_0xae2f('0x44'),auth['isAuthenticated'](),controller[_0xae2f('0x35')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0xae2f('0x5')](),controller[_0xae2f('0x45')]);router[_0xae2f('0x4')](_0xae2f('0x46'),auth[_0xae2f('0x5')](),controller['showWhatsappQueues']);router[_0xae2f('0x38')](_0xae2f('0x47'),auth[_0xae2f('0x5')](),controller['agentNotify']);module[_0xae2f('0x48')]=router; \ No newline at end of file +var _0x786e=['/voice/queues/preview/:id','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','smsQueues','/whatsapp/queues','/fax/queues','faxQueues'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0x786e,0x1bc));var _0xe786=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0x786e[_0x168478];return _0x29c2f8;};'use strict';var multer=require(_0xe786('0x0'));var util=require(_0xe786('0x1'));var path=require('path');var express=require(_0xe786('0x2'));var router=express[_0xe786('0x3')]();var auth=require(_0xe786('0x4'));var controller=require('./rpc.controller');router[_0xe786('0x5')](_0xe786('0x6'),auth['isAuthenticated'](),controller[_0xe786('0x7')]);router[_0xe786('0x5')](_0xe786('0x8'),auth[_0xe786('0x9')](),controller[_0xe786('0xa')]);router[_0xe786('0x5')](_0xe786('0xb'),auth[_0xe786('0x9')](),controller[_0xe786('0xc')]);router[_0xe786('0x5')](_0xe786('0xd'),auth[_0xe786('0x9')](),controller[_0xe786('0xe')]);router[_0xe786('0x5')](_0xe786('0xf'),auth['isAuthenticated'](),controller[_0xe786('0x10')]);router[_0xe786('0x5')]('/mail/queues',auth['isAuthenticated'](),controller[_0xe786('0x11')]);router[_0xe786('0x5')](_0xe786('0x12'),auth[_0xe786('0x9')](),controller[_0xe786('0x13')]);router[_0xe786('0x5')]('/openchannel/queues',auth[_0xe786('0x9')](),controller['openchannelQueues']);router[_0xe786('0x5')]('/sms/queues',auth[_0xe786('0x9')](),controller[_0xe786('0x14')]);router[_0xe786('0x5')](_0xe786('0x15'),auth[_0xe786('0x9')](),controller['whatsappQueues']);router[_0xe786('0x5')](_0xe786('0x16'),auth[_0xe786('0x9')](),controller[_0xe786('0x17')]);router[_0xe786('0x5')](_0xe786('0x18'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0xe786('0x5')]('/voice/queues/channels',auth[_0xe786('0x9')](),controller[_0xe786('0x19')]);router[_0xe786('0x5')](_0xe786('0x1a'),auth[_0xe786('0x9')](),controller['voiceQueuesChannel']);router[_0xe786('0x5')](_0xe786('0x1b'),auth[_0xe786('0x9')](),controller[_0xe786('0x1c')]);router[_0xe786('0x5')](_0xe786('0x1d'),auth[_0xe786('0x9')](),controller[_0xe786('0x1e')]);router[_0xe786('0x5')](_0xe786('0x1f'),auth[_0xe786('0x9')](),controller['showVoiceQueues']);router['put'](_0xe786('0x1f'),auth[_0xe786('0x9')](),controller[_0xe786('0x20')]);router[_0xe786('0x5')](_0xe786('0x21'),auth[_0xe786('0x9')](),controller[_0xe786('0x22')]);router[_0xe786('0x5')]('/outbound/channels',auth[_0xe786('0x9')](),controller[_0xe786('0x23')]);router['get'](_0xe786('0x24'),auth['isAuthenticated'](),controller['agents']);router[_0xe786('0x25')](_0xe786('0x26'),auth[_0xe786('0x9')](),controller[_0xe786('0x27')]);router[_0xe786('0x5')](_0xe786('0x28'),auth[_0xe786('0x9')](),controller[_0xe786('0x29')]);router[_0xe786('0x5')](_0xe786('0x2a'),auth[_0xe786('0x9')](),controller['trunks']);router[_0xe786('0x5')](_0xe786('0x2b'),auth[_0xe786('0x9')](),controller['campaigns']);router[_0xe786('0x5')](_0xe786('0x2c'),auth[_0xe786('0x9')](),controller[_0xe786('0x2d')]);router[_0xe786('0x5')](_0xe786('0x2e'),auth[_0xe786('0x9')](),controller['chatQueuesWaitingInteractions']);router[_0xe786('0x5')](_0xe786('0x2f'),auth[_0xe786('0x9')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xe786('0x30'),auth[_0xe786('0x9')](),controller[_0xe786('0x31')]);router[_0xe786('0x5')](_0xe786('0x32'),auth[_0xe786('0x9')](),controller[_0xe786('0x33')]);router['get'](_0xe786('0x34'),auth[_0xe786('0x9')](),controller[_0xe786('0x35')]);router[_0xe786('0x5')](_0xe786('0x36'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0xe786('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe786('0x37')]);router[_0xe786('0x38')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe786('0x39')](_0xe786('0x3a')));router[_0xe786('0x5')]('/mail/queues/:id',auth[_0xe786('0x9')](),controller[_0xe786('0x3b')]);router[_0xe786('0x38')](_0xe786('0x3c'),auth[_0xe786('0x9')](),controller[_0xe786('0x39')]('chat'));router[_0xe786('0x5')](_0xe786('0x3d'),auth['isAuthenticated'](),controller[_0xe786('0x3e')]);router[_0xe786('0x38')](_0xe786('0x3f'),auth[_0xe786('0x9')](),controller[_0xe786('0x39')](_0xe786('0x40')));router[_0xe786('0x5')](_0xe786('0x41'),auth[_0xe786('0x9')](),controller['showFaxQueues']);router[_0xe786('0x38')](_0xe786('0x42'),auth[_0xe786('0x9')](),controller[_0xe786('0x39')]('openchannel'));router['get'](_0xe786('0x43'),auth[_0xe786('0x9')](),controller['showOpenchannelQueues']);router[_0xe786('0x38')](_0xe786('0x44'),auth[_0xe786('0x9')](),controller[_0xe786('0x39')](_0xe786('0x45')));router[_0xe786('0x38')](_0xe786('0x46'),auth[_0xe786('0x9')](),controller[_0xe786('0x39')](_0xe786('0x47')));router['get'](_0xe786('0x48'),auth['isAuthenticated'](),controller[_0xe786('0x49')]);router[_0xe786('0x5')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0xe786('0x4a')]);router[_0xe786('0x38')](_0xe786('0x4b'),auth[_0xe786('0x9')](),controller[_0xe786('0x4c')]);module[_0xe786('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5775579..767b779 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 _0x7910=['Website','Queue','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Message','MessageId','From','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','catch','sendStatus','stack','name','status','send','isNil','rows','voiceChannels','VoiceChannels','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','user','INTERACTION','length','updateAttributes','findOrCreate','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat'];(function(_0x10ead3,_0x25966e){var _0x5257d9=function(_0x31ee2c){while(--_0x31ee2c){_0x10ead3['push'](_0x10ead3['shift']());}};_0x5257d9(++_0x25966e);}(_0x7910,0x1a0));var _0x0791=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0x7910[_0x254abd];return _0x31bf1b;};'use strict';var BPromise=require(_0x0791('0x0'));var moment=require(_0x0791('0x1'));var _=require(_0x0791('0x2'));var util=require(_0x0791('0x3'));var db=require(_0x0791('0x4'))['db'];var logger=require(_0x0791('0x5'))(_0x0791('0x6'));var jayson=require(_0x0791('0x7'));var amiClient=jayson[_0x0791('0x8')]['http']({'port':0x232a});var mailClient=jayson[_0x0791('0x8')]['http']({'port':0x232b});var routingClient=jayson[_0x0791('0x8')][_0x0791('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x4b9d82,_0x2bea38,_0x32ffbf){return new BPromise(function(_0x5af324,_0x1eb6e5){var _0x2f13eb=_0x32ffbf?_0x32ffbf:amiClient;return _0x2f13eb[_0x0791('0xa')](_0x4b9d82,_0x2bea38)[_0x0791('0xb')](function(_0x5dc3e6){if(_0x5dc3e6[_0x0791('0xc')]){if(_0x5dc3e6[_0x0791('0xc')]['code']===0x1f4){return _0x1eb6e5(_0x5dc3e6['error'][_0x0791('0xd')]);}return _0x5af324(_0x5dc3e6['error'][_0x0791('0xd')]);}else{_0x5af324(_0x5dc3e6[_0x0791('0xe')]);}})[_0x0791('0xf')](function(_0x13b997){_0x1eb6e5(_0x13b997);});});}function respondWithResult(_0x54f20c,_0x3ea86a){_0x3ea86a=_0x3ea86a||0xc8;return function(_0x40cb66){if(_0x40cb66){return _0x54f20c['status'](_0x3ea86a)['json'](_0x40cb66);}return _0x54f20c[_0x0791('0x10')](0x194);};}function handleError(_0x7c4113,_0x34ea19){_0x34ea19=_0x34ea19||0x1f4;return function(_0x3f66da){logger[_0x0791('0xc')](_0x3f66da[_0x0791('0x11')]);if(_0x3f66da[_0x0791('0x12')]){delete _0x3f66da[_0x0791('0x12')];}_0x7c4113[_0x0791('0x13')](_0x34ea19)[_0x0791('0x14')](_0x3f66da);};}function findById(_0x5657d5){return function(_0x39d2b9){if(!_['isNil'](_0x5657d5)&&!_[_0x0791('0x15')](_0x39d2b9)&&!_[_0x0791('0x15')](_0x39d2b9[_0x0791('0x16')])){return _['find'](_0x39d2b9[_0x0791('0x16')],function(_0x1b42e1){return _0x1b42e1['id']==_0x5657d5;});}return null;};}exports[_0x0791('0x17')]=function(_0x26ff40,_0x211d90){return respondWithRpcPromise(_0x0791('0x18'),_0x26ff40['query'])[_0x0791('0xb')](respondWithResult(_0x211d90,null))[_0x0791('0xf')](handleError(_0x211d90,null));};exports['voiceChannelMixMonitor']=function(_0x3e3708,_0xd922d3){return respondWithRpcPromise(_0x0791('0x19'),_[_0x0791('0x1a')](_0x3e3708[_0x0791('0x1b')],_0x3e3708[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0xd922d3,null))[_0x0791('0xf')](handleError(_0xd922d3,null));};exports[_0x0791('0x1d')]=function(_0x281f61,_0x41135e){return respondWithRpcPromise(_0x0791('0x1e'),_[_0x0791('0x1a')](_0x281f61['query'],_0x281f61[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0x41135e,null))[_0x0791('0xf')](handleError(_0x41135e,null));};exports[_0x0791('0x1f')]=function(_0x5116b5,_0xe4bb55){return respondWithRpcPromise('VoiceQueues',_0x5116b5['query'])[_0x0791('0xb')](respondWithResult(_0xe4bb55,null))[_0x0791('0xf')](handleError(_0xe4bb55,null));};exports[_0x0791('0x20')]=function(_0x35a48f,_0x308c7a){return respondWithRpcPromise(_0x0791('0x21'),_0x35a48f[_0x0791('0x1b')])[_0x0791('0xb')](findById(_0x35a48f[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x308c7a,null))[_0x0791('0xf')](handleError(_0x308c7a,null));};exports[_0x0791('0x22')]=function(_0x503309,_0x163a6d){return respondWithRpcPromise(_0x0791('0x23'),_[_0x0791('0x1a')](_0x503309[_0x0791('0x24')],_0x503309[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0x163a6d,null))['catch'](handleError(_0x163a6d,null));};exports[_0x0791('0x25')]=function(_0x2aad42,_0x411d63){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x2aad42[_0x0791('0x1b')],_0x2aad42[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0x411d63,null))[_0x0791('0xf')](handleError(_0x411d63,null));};exports[_0x0791('0x26')]=function(_0x2763c3,_0x22dbf6){return respondWithRpcPromise('VoiceQueuesChannels',_0x2763c3[_0x0791('0x1b')])['then'](respondWithResult(_0x22dbf6,null))['catch'](handleError(_0x22dbf6,null));};exports[_0x0791('0x27')]=function(_0x779d43,_0x5cffbe){return respondWithRpcPromise(_0x0791('0x28'),_[_0x0791('0x1a')](_0x779d43[_0x0791('0x1b')],_0x779d43[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0x5cffbe,null))[_0x0791('0xf')](handleError(_0x5cffbe,null));};exports[_0x0791('0x29')]=function(_0xd0615e,_0x280e9d){return respondWithRpcPromise(_0x0791('0x2a'),_['merge'](_0xd0615e['query'],_0xd0615e[_0x0791('0x1c')]))[_0x0791('0xb')](respondWithResult(_0x280e9d,null))[_0x0791('0xf')](handleError(_0x280e9d,null));};exports[_0x0791('0x2b')]=function(_0x3162d8,_0x20009f){return respondWithRpcPromise(_0x0791('0x2c'),_['merge'](_0x3162d8[_0x0791('0x1b')],_0x3162d8['params']))[_0x0791('0xb')](respondWithResult(_0x20009f,null))['catch'](handleError(_0x20009f,null));};exports['outbound']=function(_0x494639,_0x1a7e09){return respondWithRpcPromise(_0x0791('0x2d'),_0x494639[_0x0791('0x1b')])[_0x0791('0xb')](respondWithResult(_0x1a7e09,null))[_0x0791('0xf')](handleError(_0x1a7e09,null));};exports['outboundChannels']=function(_0x481b0b,_0x1f670b){return respondWithRpcPromise(_0x0791('0x2e'),_0x481b0b[_0x0791('0x1b')])['then'](respondWithResult(_0x1f670b,null))[_0x0791('0xf')](handleError(_0x1f670b,null));};exports[_0x0791('0x2f')]=function(_0x5a833e,_0x28bcf4){var _0x2fcc7b;return respondWithRpcPromise(_0x0791('0x30'),_0x5a833e[_0x0791('0x1b')])[_0x0791('0xb')](function(_0x3f38a5){_0x2fcc7b=_0x3f38a5;return respondWithRpcPromise(_0x0791('0x30'),_0x5a833e[_0x0791('0x1b')],routingClient);})[_0x0791('0xb')](function(_0x95a8aa){return _['merge']({},_0x95a8aa,_0x2fcc7b);})[_0x0791('0xb')](respondWithResult(_0x28bcf4,null))[_0x0791('0xf')](handleError(_0x28bcf4,null));};exports[_0x0791('0x31')]=function(_0x580fc0,_0x16f9e8){if(_0x580fc0[_0x0791('0x24')]&&_0x580fc0[_0x0791('0x24')]['interaction']&&_0x580fc0['user']&&_0x580fc0['user'][_0x0791('0x12')]){for(var _0x4eee80 in _0x580fc0[_0x0791('0x24')]['interaction']){if(_0x580fc0[_0x0791('0x24')][_0x0791('0x32')][_0x0791('0x33')](_0x4eee80)){db[_0x0791('0x34')][_0x0791('0x35')]({'where':{'channel':_0x4eee80,'membername':_0x580fc0[_0x0791('0x36')][_0x0791('0x12')],'type':_0x0791('0x37'),'exitAt':null,'uniqueid':_0x580fc0[_0x0791('0x24')]['interaction'][_0x4eee80]&&_0x580fc0['body'][_0x0791('0x32')][_0x4eee80][_0x0791('0x38')]?{'$notIn':_0x580fc0[_0x0791('0x24')][_0x0791('0x32')][_0x4eee80]}:{'$ne':null}}})[_0x0791('0xb')](function(_0x14b610){var _0x26c3e0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xa6a4ee=0x0,_0x7c4f9b=_0x14b610[_0x0791('0x38')];_0xa6a4ee<_0x7c4f9b;_0xa6a4ee+=0x1){_0x14b610[_0xa6a4ee][_0x0791('0x39')]({'exitAt':_0x26c3e0});}});for(var _0x55c177=0x0;_0x55c177<_0x580fc0[_0x0791('0x24')]['interaction'][_0x4eee80][_0x0791('0x38')];_0x55c177+=0x1){db[_0x0791('0x34')][_0x0791('0x3a')]({'where':{'channel':_0x4eee80,'membername':_0x580fc0[_0x0791('0x36')][_0x0791('0x12')],'type':_0x0791('0x37'),'uniqueid':_0x580fc0['body'][_0x0791('0x32')][_0x4eee80][_0x55c177],'exitAt':null},'defaults':{'channel':_0x4eee80,'membername':_0x580fc0[_0x0791('0x36')][_0x0791('0x12')],'interface':_[_0x0791('0x15')](_0x580fc0[_0x0791('0x36')][_0x0791('0x3b')])?util['format'](_0x0791('0x3c'),_0x580fc0[_0x0791('0x36')][_0x0791('0x12')]):_0x580fc0[_0x0791('0x36')][_0x0791('0x3b')],'type':_0x0791('0x37'),'enterAt':moment()[_0x0791('0x3d')](_0x0791('0x3e')),'role':_0x0791('0x3f'),'internal':_0x580fc0[_0x0791('0x36')]['internal'],'uniqueid':_0x580fc0[_0x0791('0x24')][_0x0791('0x32')][_0x4eee80][_0x55c177]}});}}}}return respondWithRpcPromise(_0x0791('0x40'),{'id':_0x580fc0[_0x0791('0x1c')]['id'],'capacity':_0x580fc0[_0x0791('0x24')]['capacity']},routingClient)[_0x0791('0xb')](respondWithResult(_0x16f9e8,null))[_0x0791('0xf')](handleError(_0x16f9e8,null));};exports[_0x0791('0x41')]=function(_0x4b287b,_0x298288){return respondWithRpcPromise(_0x0791('0x42'),_0x4b287b[_0x0791('0x1b')])['then'](respondWithResult(_0x298288,null))[_0x0791('0xf')](handleError(_0x298288,null));};exports['trunks']=function(_0x366d14,_0x242825){return respondWithRpcPromise(_0x0791('0x43'),_0x366d14[_0x0791('0x1b')])['then'](respondWithResult(_0x242825,null))[_0x0791('0xf')](handleError(_0x242825,null));};exports[_0x0791('0x44')]=function(_0x5842ce,_0x19a36c){return respondWithRpcPromise('Campaigns',_0x5842ce[_0x0791('0x1b')])['then'](respondWithResult(_0x19a36c,null))[_0x0791('0xf')](handleError(_0x19a36c,null));};exports[_0x0791('0x45')]=function(_0x3b0a2b,_0xd2fb66){return respondWithRpcPromise(_0x0791('0x46'),_0x3b0a2b[_0x0791('0x1b')],routingClient)['then'](respondWithResult(_0xd2fb66,null))[_0x0791('0xf')](handleError(_0xd2fb66,null));};exports[_0x0791('0x47')]=function(_0x593db3,_0x577b1e){return respondWithRpcPromise('ChatQueues',_0x593db3[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](findById(_0x593db3['params']['id']))['then'](respondWithResult(_0x577b1e,null))[_0x0791('0xf')](handleError(_0x577b1e,null));};exports['mailQueues']=function(_0x56f461,_0x16677c){return respondWithRpcPromise('MailQueues',_0x56f461['query'],routingClient)[_0x0791('0xb')](respondWithResult(_0x16677c,null))[_0x0791('0xf')](handleError(_0x16677c,null));};exports[_0x0791('0x48')]=function(_0x2c0bdd,_0x2a71bb){return respondWithRpcPromise('MailQueues',_0x2c0bdd[_0x0791('0x1b')],routingClient)['then'](findById(_0x2c0bdd[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x2a71bb,null))['catch'](handleError(_0x2a71bb,null));};exports['mailAccounts']=function(_0x1811aa,_0x31a14b){return respondWithRpcPromise(_0x0791('0x49'),_0x1811aa[_0x0791('0x1b')],mailClient)[_0x0791('0xb')](respondWithResult(_0x31a14b,null))[_0x0791('0xf')](handleError(_0x31a14b,null));};exports['openchannelQueues']=function(_0x37448f,_0x58a4c1){return respondWithRpcPromise(_0x0791('0x4a'),_0x37448f['query'],routingClient)[_0x0791('0xb')](respondWithResult(_0x58a4c1,null))[_0x0791('0xf')](handleError(_0x58a4c1,null));};exports[_0x0791('0x4b')]=function(_0x17dc4f,_0x23f2a5){return respondWithRpcPromise(_0x0791('0x4a'),_0x17dc4f['query'],routingClient)[_0x0791('0xb')](findById(_0x17dc4f[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x23f2a5,null))[_0x0791('0xf')](handleError(_0x23f2a5,null));};exports[_0x0791('0x4c')]=function(_0x326c8c,_0x5131bc){return respondWithRpcPromise(_0x0791('0x4d'),_0x326c8c[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x5131bc,null))[_0x0791('0xf')](handleError(_0x5131bc,null));};exports[_0x0791('0x4e')]=function(_0x55397d,_0x5f2c76){return respondWithRpcPromise(_0x0791('0x4d'),_0x55397d[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](findById(_0x55397d[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x5f2c76,null))[_0x0791('0xf')](handleError(_0x5f2c76,null));};exports[_0x0791('0x4f')]=function(_0x21b9b3,_0x1b58d7){return respondWithRpcPromise(_0x0791('0x50'),_0x21b9b3['query'],routingClient)['then'](respondWithResult(_0x1b58d7,null))[_0x0791('0xf')](handleError(_0x1b58d7,null));};exports[_0x0791('0x51')]=function(_0x4cf721,_0x15e625){return respondWithRpcPromise(_0x0791('0x50'),_0x4cf721[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](findById(_0x4cf721[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x15e625,null))[_0x0791('0xf')](handleError(_0x15e625,null));};exports[_0x0791('0x52')]=function(_0x1ecf35,_0x178202){return respondWithRpcPromise(_0x0791('0x53'),_0x1ecf35['query'],routingClient)[_0x0791('0xb')](respondWithResult(_0x178202,null))[_0x0791('0xf')](handleError(_0x178202,null));};exports['showFaxQueues']=function(_0x4c918f,_0x3c4d7d){return respondWithRpcPromise(_0x0791('0x53'),_0x4c918f[_0x0791('0x1b')],routingClient)['then'](findById(_0x4c918f[_0x0791('0x1c')]['id']))[_0x0791('0xb')](respondWithResult(_0x3c4d7d,null))[_0x0791('0xf')](handleError(_0x3c4d7d,null));};exports[_0x0791('0x54')]=function(_0x16cb00,_0x366d8e){return respondWithRpcPromise(_0x0791('0x55'),_0x16cb00[_0x0791('0x1b')])[_0x0791('0xb')](respondWithResult(_0x366d8e,null))[_0x0791('0xf')](handleError(_0x366d8e,null));};exports[_0x0791('0x56')]=function(_0x42579f,_0x506085){return respondWithRpcPromise(_0x0791('0x57'),_0x42579f[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x506085,null))[_0x0791('0xf')](handleError(_0x506085,null));};exports[_0x0791('0x58')]=function(_0x3f56a1,_0x4b535f){return respondWithRpcPromise(_0x0791('0x59'),_0x3f56a1[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x4b535f,null))[_0x0791('0xf')](handleError(_0x4b535f,null));};exports[_0x0791('0x5a')]=function(_0x363d72,_0x2dc66c){return respondWithRpcPromise(_0x0791('0x5b'),_0x363d72[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x2dc66c,null))[_0x0791('0xf')](handleError(_0x2dc66c,null));};exports[_0x0791('0x5c')]=function(_0x25c2c0,_0x14fd9e){return respondWithRpcPromise(_0x0791('0x5b'),_0x25c2c0[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](function(_0xdd26e9){if(_0x25c2c0[_0x0791('0x1b')][_0x0791('0x5d')]!==undefined){var _0x3f33b7=_(_0xdd26e9[_0x0791('0x16')])[_0x0791('0x5e')]([_0x25c2c0[_0x0791('0x1b')][_0x0791('0x5d')],_0x25c2c0[_0x0791('0x1c')]['id']])[_0x0791('0x5f')](_0x0791('0x60'))[_0x0791('0x61')]()[_0x0791('0x62')]();return _0xdd26e9['rows'][_0x0791('0x5e')](function(_0x2097ed){return _0x3f33b7[_0x0791('0x63')](_0x2097ed[_0x0791('0x60')])>-0x1;});}else{return _0xdd26e9['rows'][_0x0791('0x5e')](function(_0x7fc6b2){return _0x7fc6b2[_0x0791('0x60')]===parseInt(_0x25c2c0[_0x0791('0x1c')]['id']);});}})['then'](respondWithResult(_0x14fd9e,null))[_0x0791('0xf')](handleError(_0x14fd9e,null));};exports[_0x0791('0x64')]=function(_0x2e333e,_0x5e64a3){return respondWithRpcPromise(_0x0791('0x65'),_0x2e333e['query'],routingClient)['then'](respondWithResult(_0x5e64a3,null))[_0x0791('0xf')](handleError(_0x5e64a3,null));};exports[_0x0791('0x66')]=function(_0x3a1c8e,_0x2ef4c3){return respondWithRpcPromise(_0x0791('0x67'),_0x3a1c8e[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x2ef4c3,null))[_0x0791('0xf')](handleError(_0x2ef4c3,null));};exports['faxQueuesWaitingInteractions']=function(_0x560beb,_0x3cbeba){return respondWithRpcPromise(_0x0791('0x68'),_0x560beb[_0x0791('0x1b')],routingClient)[_0x0791('0xb')](respondWithResult(_0x3cbeba,null))[_0x0791('0xf')](handleError(_0x3cbeba,null));};exports[_0x0791('0x69')]=function(_0x3ad09a){return function(_0x44627e,_0x1ee09b){var _0x37de6b,_0x28a14a;var _0x1b4ffe=_[_0x0791('0x6a')](_0x3ad09a);var _0x37cac7=_0x3ad09a===_0x0791('0x6b')?_0x0791('0x6c'):'Account';return db[_0x1b4ffe+_0x0791('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x44627e[_0x0791('0x1c')]['id']}})['then'](function(_0x1738c9){if(_[_0x0791('0x15')](_0x1738c9)){throw new Error(_0x1b4ffe+'\x20Queue\x20not\x20found');}_0x37de6b=_0x1738c9;return db[_0x1b4ffe+'Message'][_0x0791('0x6e')]({'where':{'id':_0x44627e[_0x0791('0x24')][_0x0791('0x6f')]},'include':[{'model':db[_0x1b4ffe+_0x0791('0x70')],'as':'Interaction'},{'model':db[_0x1b4ffe+_0x37cac7],'as':_0x0791('0x71')}]});})[_0x0791('0xb')](function(_0x2db8b2){if(_[_0x0791('0x15')](_0x2db8b2)){throw new Error(_0x1b4ffe+_0x0791('0x72'));}_0x28a14a=_0x2db8b2;return _0x2db8b2[_0x0791('0x73')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0791('0xb')](function(){var _0x421511={'uniqueid':_0x3ad09a+'.'+_0x28a14a['id']+'.'+_0x28a14a[_0x0791('0x70')]['id'],'FromUserId':_0x44627e['user']['id'],'type':_0x0791('0x74')};_0x421511[_0x1b4ffe+'MessageId']=_0x28a14a['id'];_0x421511[_0x1b4ffe+_0x0791('0x75')]=_0x28a14a[_0x0791('0x70')]['id'];_0x421511['From'+_0x1b4ffe+_0x37cac7+'Id']=_0x28a14a[_0x0791('0x71')]['id'];_0x421511['To'+_0x1b4ffe+_0x0791('0x76')]=_0x37de6b['id'];return db[_0x1b4ffe+_0x0791('0x77')][_0x0791('0x78')](_0x421511);})['then'](function(){return respondWithRpcPromise(_0x0791('0x79'),{'channel':_0x3ad09a,'interaction':_0x28a14a[_0x0791('0x70')],'message':_0x28a14a,'account':_0x28a14a[_0x0791('0x71')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0791('0x74'),'appdata':_0x37de6b[_0x0791('0x12')]+','+(_0x28a14a[_0x0791('0x71')]['queueTransferTimeout']||0x12c),'interval':_0x0791('0x7a')}]},routingClient);})[_0x0791('0xb')](respondWithResult(_0x1ee09b,null))[_0x0791('0xf')](handleError(_0x1ee09b,null));};};exports[_0x0791('0x7b')]=function(_0xfad8d8,_0x22db67){var _0x17d32e,_0x56427d;if(_[_0x0791('0x15')](_0xfad8d8['body'][_0x0791('0x7c')])){throw new Error(_0x0791('0x7d'));}var _0x29d2a7=_0xfad8d8[_0x0791('0x24')][_0x0791('0x7c')];var _0x316d47=_[_0x0791('0x6a')](_0x29d2a7);var _0x5067ee=_0x29d2a7===_0x0791('0x6b')?_0x0791('0x6c'):_0x0791('0x71');return db[_0x0791('0x7e')]['findOne']({'raw':!![],'where':{'id':_0xfad8d8['params']['id'],'role':_0x0791('0x3f')}})[_0x0791('0xb')](function(_0x3f98ef){if(_[_0x0791('0x15')](_0x3f98ef)){throw new Error('Agent\x20not\x20found');}_0x17d32e=_0x3f98ef;return db[_0x316d47+_0x0791('0x7f')][_0x0791('0x6e')]({'where':{'id':_0xfad8d8[_0x0791('0x24')][_0x0791('0x6f')]},'include':[{'model':db[_0x316d47+_0x0791('0x70')],'as':_0x0791('0x70')},{'model':db[_0x316d47+_0x5067ee],'as':_0x0791('0x71')}]});})[_0x0791('0xb')](function(_0x5e1d9f){if(_['isNil'](_0x5e1d9f)){throw new Error(_0x316d47+_0x0791('0x72'));}_0x56427d=_0x5e1d9f;return _0x5e1d9f[_0x0791('0x73')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x38a811={'uniqueid':_0x29d2a7+'.'+_0x56427d['id']+'.'+_0x56427d[_0x0791('0x70')]['id'],'FromUserId':_0xfad8d8[_0x0791('0x36')]['id'],'type':'agent','ToUserId':_0x17d32e['id']};_0x38a811[_0x316d47+_0x0791('0x80')]=_0x56427d['id'];_0x38a811[_0x316d47+_0x0791('0x75')]=_0x56427d[_0x0791('0x70')]['id'];_0x38a811[_0x0791('0x81')+_0x316d47+_0x5067ee+'Id']=_0x56427d[_0x0791('0x71')]['id'];return db[_0x316d47+_0x0791('0x77')][_0x0791('0x78')](_0x38a811);})['then'](function(){return respondWithRpcPromise(_0x0791('0x79'),{'channel':_0x29d2a7,'interaction':_0x56427d[_0x0791('0x70')],'message':_0x56427d,'account':_0x56427d[_0x0791('0x71')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0791('0x3f'),'appdata':_0x17d32e[_0x0791('0x12')]+','+(_0x56427d['Account'][_0x0791('0x82')]||0x12c),'interval':_0x0791('0x7a')}]},routingClient);})[_0x0791('0xb')](respondWithResult(_0x22db67,null))['catch'](handleError(_0x22db67,null));}; \ No newline at end of file +var _0xb191=['voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','merge','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','TransferReport','Start','queueTransferTimeout','agentNotify','channel','agent','Message','create','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','client','http','request','then','error','message','catch','status','json','sendStatus','stack','name','send','isNil','rows'];(function(_0x2598fe,_0x3cd886){var _0x12f073=function(_0x5f46ba){while(--_0x5f46ba){_0x2598fe['push'](_0x2598fe['shift']());}};_0x12f073(++_0x3cd886);}(_0xb191,0x1c5));var _0x1b19=function(_0x14dbcc,_0x2979ca){_0x14dbcc=_0x14dbcc-0x0;var _0x4b2481=_0xb191[_0x14dbcc];return _0x4b2481;};'use strict';var BPromise=require(_0x1b19('0x0'));var moment=require('moment');var _=require(_0x1b19('0x1'));var util=require(_0x1b19('0x2'));var db=require(_0x1b19('0x3'))['db'];var logger=require('../../config/logger')('api');var jayson=require('jayson/promise');var amiClient=jayson[_0x1b19('0x4')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x1b19('0x5')]({'port':0x232b});var routingClient=jayson[_0x1b19('0x4')][_0x1b19('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3d8b14,_0x24b83a,_0x11ab65){return new BPromise(function(_0x443c50,_0x45f93e){var _0x21e15e=_0x11ab65?_0x11ab65:amiClient;return _0x21e15e[_0x1b19('0x6')](_0x3d8b14,_0x24b83a)[_0x1b19('0x7')](function(_0x2d024d){if(_0x2d024d[_0x1b19('0x8')]){if(_0x2d024d[_0x1b19('0x8')]['code']===0x1f4){return _0x45f93e(_0x2d024d['error'][_0x1b19('0x9')]);}return _0x443c50(_0x2d024d[_0x1b19('0x8')]['message']);}else{_0x443c50(_0x2d024d['result']);}})[_0x1b19('0xa')](function(_0x364bd2){_0x45f93e(_0x364bd2);});});}function respondWithResult(_0xb42319,_0x310b1e){_0x310b1e=_0x310b1e||0xc8;return function(_0x4cf9f6){if(_0x4cf9f6){return _0xb42319[_0x1b19('0xb')](_0x310b1e)[_0x1b19('0xc')](_0x4cf9f6);}return _0xb42319[_0x1b19('0xd')](0x194);};}function handleError(_0x352db2,_0x3164d8){_0x3164d8=_0x3164d8||0x1f4;return function(_0x11c483){logger[_0x1b19('0x8')](_0x11c483[_0x1b19('0xe')]);if(_0x11c483[_0x1b19('0xf')]){delete _0x11c483['name'];}_0x352db2[_0x1b19('0xb')](_0x3164d8)[_0x1b19('0x10')](_0x11c483);};}function findById(_0x4e05cf){return function(_0x337ad7){if(!_[_0x1b19('0x11')](_0x4e05cf)&&!_[_0x1b19('0x11')](_0x337ad7)&&!_[_0x1b19('0x11')](_0x337ad7[_0x1b19('0x12')])){return _['find'](_0x337ad7['rows'],function(_0x3227b3){return _0x3227b3['id']==_0x4e05cf;});}return null;};}exports[_0x1b19('0x13')]=function(_0x32c261,_0x3d0847){return respondWithRpcPromise(_0x1b19('0x14'),_0x32c261[_0x1b19('0x15')])['then'](respondWithResult(_0x3d0847,null))[_0x1b19('0xa')](handleError(_0x3d0847,null));};exports[_0x1b19('0x16')]=function(_0x4d25d,_0x541c69){return respondWithRpcPromise(_0x1b19('0x17'),_['merge'](_0x4d25d[_0x1b19('0x15')],_0x4d25d['params']))[_0x1b19('0x7')](respondWithResult(_0x541c69,null))['catch'](handleError(_0x541c69,null));};exports[_0x1b19('0x18')]=function(_0x33b0be,_0x35480d){return respondWithRpcPromise(_0x1b19('0x19'),_['merge'](_0x33b0be['query'],_0x33b0be[_0x1b19('0x1a')]))['then'](respondWithResult(_0x35480d,null))[_0x1b19('0xa')](handleError(_0x35480d,null));};exports['voiceQueues']=function(_0x1196bd,_0x3d2cb6){return respondWithRpcPromise(_0x1b19('0x1b'),_0x1196bd[_0x1b19('0x15')])[_0x1b19('0x7')](respondWithResult(_0x3d2cb6,null))[_0x1b19('0xa')](handleError(_0x3d2cb6,null));};exports[_0x1b19('0x1c')]=function(_0xc9b5ab,_0x4f7ffb){return respondWithRpcPromise(_0x1b19('0x1b'),_0xc9b5ab[_0x1b19('0x15')])['then'](findById(_0xc9b5ab[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x4f7ffb,null))['catch'](handleError(_0x4f7ffb,null));};exports[_0x1b19('0x1d')]=function(_0x53d9bb,_0x3a3823){return respondWithRpcPromise(_0x1b19('0x1e'),_[_0x1b19('0x1f')](_0x53d9bb[_0x1b19('0x20')],_0x53d9bb[_0x1b19('0x1a')]))[_0x1b19('0x7')](respondWithResult(_0x3a3823,null))[_0x1b19('0xa')](handleError(_0x3a3823,null));};exports['voiceQueuesPreview']=function(_0x178548,_0x20c5f4){return respondWithRpcPromise(_0x1b19('0x21'),_[_0x1b19('0x1f')](_0x178548[_0x1b19('0x15')],_0x178548[_0x1b19('0x1a')]))[_0x1b19('0x7')](respondWithResult(_0x20c5f4,null))[_0x1b19('0xa')](handleError(_0x20c5f4,null));};exports[_0x1b19('0x22')]=function(_0x41c549,_0x347f0c){return respondWithRpcPromise(_0x1b19('0x23'),_0x41c549[_0x1b19('0x15')])['then'](respondWithResult(_0x347f0c,null))['catch'](handleError(_0x347f0c,null));};exports[_0x1b19('0x24')]=function(_0x191314,_0x4d310e){return respondWithRpcPromise(_0x1b19('0x25'),_['merge'](_0x191314[_0x1b19('0x15')],_0x191314[_0x1b19('0x1a')]))[_0x1b19('0x7')](respondWithResult(_0x4d310e,null))[_0x1b19('0xa')](handleError(_0x4d310e,null));};exports[_0x1b19('0x26')]=function(_0x31d36d,_0x4f4d39){return respondWithRpcPromise(_0x1b19('0x27'),_['merge'](_0x31d36d[_0x1b19('0x15')],_0x31d36d[_0x1b19('0x1a')]))['then'](respondWithResult(_0x4f4d39,null))[_0x1b19('0xa')](handleError(_0x4f4d39,null));};exports['voiceQueuesChannelRedirect']=function(_0x16d98a,_0x5de302){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x1b19('0x1f')](_0x16d98a[_0x1b19('0x15')],_0x16d98a['params']))[_0x1b19('0x7')](respondWithResult(_0x5de302,null))[_0x1b19('0xa')](handleError(_0x5de302,null));};exports['outbound']=function(_0x344252,_0x518e6f){return respondWithRpcPromise(_0x1b19('0x28'),_0x344252['query'])['then'](respondWithResult(_0x518e6f,null))[_0x1b19('0xa')](handleError(_0x518e6f,null));};exports[_0x1b19('0x29')]=function(_0x56c7c8,_0x1cef70){return respondWithRpcPromise(_0x1b19('0x2a'),_0x56c7c8[_0x1b19('0x15')])[_0x1b19('0x7')](respondWithResult(_0x1cef70,null))[_0x1b19('0xa')](handleError(_0x1cef70,null));};exports['agents']=function(_0x56288d,_0x20d087){var _0x24e72;return respondWithRpcPromise(_0x1b19('0x2b'),_0x56288d[_0x1b19('0x15')])['then'](function(_0xa3030){_0x24e72=_0xa3030;return respondWithRpcPromise(_0x1b19('0x2b'),_0x56288d[_0x1b19('0x15')],routingClient);})[_0x1b19('0x7')](function(_0x719137){return _[_0x1b19('0x1f')]({},_0x719137,_0x24e72);})[_0x1b19('0x7')](respondWithResult(_0x20d087,null))['catch'](handleError(_0x20d087,null));};exports[_0x1b19('0x2c')]=function(_0x508a2e,_0x28d8df){if(_0x508a2e[_0x1b19('0x20')]&&_0x508a2e[_0x1b19('0x20')][_0x1b19('0x2d')]&&_0x508a2e[_0x1b19('0x2e')]&&_0x508a2e[_0x1b19('0x2e')][_0x1b19('0xf')]){for(var _0x290988 in _0x508a2e['body']['interaction']){if(_0x508a2e[_0x1b19('0x20')][_0x1b19('0x2d')][_0x1b19('0x2f')](_0x290988)){db['MemberReport']['findAll']({'where':{'channel':_0x290988,'membername':_0x508a2e[_0x1b19('0x2e')][_0x1b19('0xf')],'type':_0x1b19('0x30'),'exitAt':null,'uniqueid':_0x508a2e[_0x1b19('0x20')][_0x1b19('0x2d')][_0x290988]&&_0x508a2e['body'][_0x1b19('0x2d')][_0x290988][_0x1b19('0x31')]?{'$notIn':_0x508a2e[_0x1b19('0x20')][_0x1b19('0x2d')][_0x290988]}:{'$ne':null}}})['then'](function(_0x39e2fa){var _0x490c55=moment()[_0x1b19('0x32')](_0x1b19('0x33'));for(var _0x3d3227=0x0,_0x23fb82=_0x39e2fa['length'];_0x3d3227<_0x23fb82;_0x3d3227+=0x1){_0x39e2fa[_0x3d3227][_0x1b19('0x34')]({'exitAt':_0x490c55});}});for(var _0xc7a472=0x0;_0xc7a472<_0x508a2e['body'][_0x1b19('0x2d')][_0x290988][_0x1b19('0x31')];_0xc7a472+=0x1){db['MemberReport'][_0x1b19('0x35')]({'where':{'channel':_0x290988,'membername':_0x508a2e['user'][_0x1b19('0xf')],'type':_0x1b19('0x30'),'uniqueid':_0x508a2e['body'][_0x1b19('0x2d')][_0x290988][_0xc7a472],'exitAt':null},'defaults':{'channel':_0x290988,'membername':_0x508a2e[_0x1b19('0x2e')][_0x1b19('0xf')],'interface':_[_0x1b19('0x11')](_0x508a2e['user'][_0x1b19('0x36')])?util['format']('SIP/%s',_0x508a2e[_0x1b19('0x2e')]['name']):_0x508a2e[_0x1b19('0x2e')]['interface'],'type':_0x1b19('0x30'),'enterAt':moment()[_0x1b19('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x508a2e[_0x1b19('0x2e')][_0x1b19('0x37')],'uniqueid':_0x508a2e[_0x1b19('0x20')][_0x1b19('0x2d')][_0x290988][_0xc7a472]}});}}}}return respondWithRpcPromise(_0x1b19('0x38'),{'id':_0x508a2e[_0x1b19('0x1a')]['id'],'capacity':_0x508a2e[_0x1b19('0x20')][_0x1b19('0x39')]},routingClient)[_0x1b19('0x7')](respondWithResult(_0x28d8df,null))[_0x1b19('0xa')](handleError(_0x28d8df,null));};exports[_0x1b19('0x3a')]=function(_0x2bb773,_0x58a531){return respondWithRpcPromise('Telephones',_0x2bb773['query'])[_0x1b19('0x7')](respondWithResult(_0x58a531,null))[_0x1b19('0xa')](handleError(_0x58a531,null));};exports[_0x1b19('0x3b')]=function(_0x940b13,_0x1c1a76){return respondWithRpcPromise(_0x1b19('0x3c'),_0x940b13[_0x1b19('0x15')])[_0x1b19('0x7')](respondWithResult(_0x1c1a76,null))['catch'](handleError(_0x1c1a76,null));};exports[_0x1b19('0x3d')]=function(_0x111f40,_0x50eda2){return respondWithRpcPromise(_0x1b19('0x3e'),_0x111f40['query'])['then'](respondWithResult(_0x50eda2,null))['catch'](handleError(_0x50eda2,null));};exports['chatQueues']=function(_0x146d75,_0x2adc56){return respondWithRpcPromise(_0x1b19('0x3f'),_0x146d75[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](respondWithResult(_0x2adc56,null))['catch'](handleError(_0x2adc56,null));};exports[_0x1b19('0x40')]=function(_0x2ef49a,_0x2cbac8){return respondWithRpcPromise('ChatQueues',_0x2ef49a[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](findById(_0x2ef49a[_0x1b19('0x1a')]['id']))['then'](respondWithResult(_0x2cbac8,null))[_0x1b19('0xa')](handleError(_0x2cbac8,null));};exports[_0x1b19('0x41')]=function(_0x39d84d,_0x59594c){return respondWithRpcPromise(_0x1b19('0x42'),_0x39d84d['query'],routingClient)[_0x1b19('0x7')](respondWithResult(_0x59594c,null))[_0x1b19('0xa')](handleError(_0x59594c,null));};exports[_0x1b19('0x43')]=function(_0x4e46e1,_0x16191e){return respondWithRpcPromise(_0x1b19('0x42'),_0x4e46e1['query'],routingClient)['then'](findById(_0x4e46e1[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x16191e,null))[_0x1b19('0xa')](handleError(_0x16191e,null));};exports[_0x1b19('0x44')]=function(_0x4e2a8b,_0x5491b4){return respondWithRpcPromise('MailAccounts',_0x4e2a8b[_0x1b19('0x15')],mailClient)[_0x1b19('0x7')](respondWithResult(_0x5491b4,null))[_0x1b19('0xa')](handleError(_0x5491b4,null));};exports[_0x1b19('0x45')]=function(_0x349ab8,_0x18d0fd){return respondWithRpcPromise('OpenchannelQueues',_0x349ab8['query'],routingClient)[_0x1b19('0x7')](respondWithResult(_0x18d0fd,null))[_0x1b19('0xa')](handleError(_0x18d0fd,null));};exports[_0x1b19('0x46')]=function(_0x256b6f,_0x3123b8){return respondWithRpcPromise('OpenchannelQueues',_0x256b6f[_0x1b19('0x15')],routingClient)['then'](findById(_0x256b6f[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x3123b8,null))['catch'](handleError(_0x3123b8,null));};exports[_0x1b19('0x47')]=function(_0x2f667d,_0x5115a4){return respondWithRpcPromise(_0x1b19('0x48'),_0x2f667d['query'],routingClient)[_0x1b19('0x7')](respondWithResult(_0x5115a4,null))[_0x1b19('0xa')](handleError(_0x5115a4,null));};exports[_0x1b19('0x49')]=function(_0xc4d48c,_0x4ace39){return respondWithRpcPromise(_0x1b19('0x48'),_0xc4d48c[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](findById(_0xc4d48c[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x4ace39,null))['catch'](handleError(_0x4ace39,null));};exports[_0x1b19('0x4a')]=function(_0x3c62d9,_0x4ddb78){return respondWithRpcPromise('WhatsappQueues',_0x3c62d9['query'],routingClient)[_0x1b19('0x7')](respondWithResult(_0x4ddb78,null))[_0x1b19('0xa')](handleError(_0x4ddb78,null));};exports[_0x1b19('0x4b')]=function(_0x2a1737,_0x2cf4ec){return respondWithRpcPromise(_0x1b19('0x4c'),_0x2a1737[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](findById(_0x2a1737[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x2cf4ec,null))[_0x1b19('0xa')](handleError(_0x2cf4ec,null));};exports[_0x1b19('0x4d')]=function(_0x141637,_0x2d684c){return respondWithRpcPromise('FaxQueues',_0x141637[_0x1b19('0x15')],routingClient)['then'](respondWithResult(_0x2d684c,null))[_0x1b19('0xa')](handleError(_0x2d684c,null));};exports[_0x1b19('0x4e')]=function(_0x2a82f0,_0x7905b9){return respondWithRpcPromise(_0x1b19('0x4f'),_0x2a82f0[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](findById(_0x2a82f0[_0x1b19('0x1a')]['id']))[_0x1b19('0x7')](respondWithResult(_0x7905b9,null))[_0x1b19('0xa')](handleError(_0x7905b9,null));};exports[_0x1b19('0x50')]=function(_0x253a65,_0x367de7){return respondWithRpcPromise(_0x1b19('0x51'),_0x253a65[_0x1b19('0x15')])['then'](respondWithResult(_0x367de7,null))[_0x1b19('0xa')](handleError(_0x367de7,null));};exports['chatQueuesWaitingInteractions']=function(_0x8b777d,_0x380cbc){return respondWithRpcPromise(_0x1b19('0x52'),_0x8b777d[_0x1b19('0x15')],routingClient)['then'](respondWithResult(_0x380cbc,null))['catch'](handleError(_0x380cbc,null));};exports['mailQueuesWaitingInteractions']=function(_0x2082e,_0x55c74e){return respondWithRpcPromise(_0x1b19('0x53'),_0x2082e[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](respondWithResult(_0x55c74e,null))[_0x1b19('0xa')](handleError(_0x55c74e,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x218e83,_0x4dfc6a){return respondWithRpcPromise(_0x1b19('0x54'),_0x218e83[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](respondWithResult(_0x4dfc6a,null))['catch'](handleError(_0x4dfc6a,null));};exports[_0x1b19('0x55')]=function(_0x4ca38d,_0x11b49e){return respondWithRpcPromise(_0x1b19('0x54'),_0x4ca38d[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](function(_0x257b7d){if(_0x4ca38d['query'][_0x1b19('0x56')]!==undefined){var _0x18883c=_(_0x257b7d['rows'])[_0x1b19('0x57')]([_0x4ca38d[_0x1b19('0x15')]['type'],_0x4ca38d[_0x1b19('0x1a')]['id']])[_0x1b19('0x58')](_0x1b19('0x59'))[_0x1b19('0x5a')]()['value']();return _0x257b7d['rows'][_0x1b19('0x57')](function(_0x34ffaf){return _0x18883c['indexOf'](_0x34ffaf[_0x1b19('0x59')])>-0x1;});}else{return _0x257b7d[_0x1b19('0x12')][_0x1b19('0x57')](function(_0x1b2a56){return _0x1b2a56[_0x1b19('0x59')]===parseInt(_0x4ca38d[_0x1b19('0x1a')]['id']);});}})[_0x1b19('0x7')](respondWithResult(_0x11b49e,null))[_0x1b19('0xa')](handleError(_0x11b49e,null));};exports['smsQueuesWaitingInteractions']=function(_0x2e0952,_0x2cf6ef){return respondWithRpcPromise(_0x1b19('0x5b'),_0x2e0952[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](respondWithResult(_0x2cf6ef,null))['catch'](handleError(_0x2cf6ef,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x489eb3,_0x2c70c6){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x489eb3[_0x1b19('0x15')],routingClient)[_0x1b19('0x7')](respondWithResult(_0x2c70c6,null))[_0x1b19('0xa')](handleError(_0x2c70c6,null));};exports[_0x1b19('0x5c')]=function(_0x19943b,_0x409b6c){return respondWithRpcPromise(_0x1b19('0x5d'),_0x19943b['query'],routingClient)[_0x1b19('0x7')](respondWithResult(_0x409b6c,null))[_0x1b19('0xa')](handleError(_0x409b6c,null));};exports['queueNotify']=function(_0x42d8a2){return function(_0x3b2aaa,_0x28ed32){var _0x12e420,_0x4dedc4;var _0x5f44a0=_[_0x1b19('0x5e')](_0x42d8a2);var _0x2671fb=_0x42d8a2===_0x1b19('0x5f')?_0x1b19('0x60'):_0x1b19('0x61');return db[_0x5f44a0+_0x1b19('0x62')][_0x1b19('0x63')]({'raw':!![],'where':{'id':_0x3b2aaa['params']['id']}})[_0x1b19('0x7')](function(_0x30a8bc){if(_[_0x1b19('0x11')](_0x30a8bc)){throw new Error(_0x5f44a0+_0x1b19('0x64'));}_0x12e420=_0x30a8bc;return db[_0x5f44a0+'Message']['findOne']({'where':{'id':_0x3b2aaa[_0x1b19('0x20')][_0x1b19('0x65')]},'include':[{'model':db[_0x5f44a0+_0x1b19('0x66')],'as':'Interaction'},{'model':db[_0x5f44a0+_0x2671fb],'as':_0x1b19('0x61')}]});})['then'](function(_0x24859e){if(_[_0x1b19('0x11')](_0x24859e)){throw new Error(_0x5f44a0+_0x1b19('0x67'));}_0x4dedc4=_0x24859e;return _0x24859e[_0x1b19('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1b19('0x7')](function(){var _0x5436dc={'uniqueid':_0x42d8a2+'.'+_0x4dedc4['id']+'.'+_0x4dedc4[_0x1b19('0x66')]['id'],'FromUserId':_0x3b2aaa[_0x1b19('0x2e')]['id'],'type':'queue'};_0x5436dc[_0x5f44a0+_0x1b19('0x69')]=_0x4dedc4['id'];_0x5436dc[_0x5f44a0+_0x1b19('0x6a')]=_0x4dedc4[_0x1b19('0x66')]['id'];_0x5436dc[_0x1b19('0x6b')+_0x5f44a0+_0x2671fb+'Id']=_0x4dedc4[_0x1b19('0x61')]['id'];_0x5436dc['To'+_0x5f44a0+'QueueId']=_0x12e420['id'];return db[_0x5f44a0+_0x1b19('0x6c')]['create'](_0x5436dc);})[_0x1b19('0x7')](function(){return respondWithRpcPromise(_0x1b19('0x6d'),{'channel':_0x42d8a2,'interaction':_0x4dedc4['Interaction'],'message':_0x4dedc4,'account':_0x4dedc4[_0x1b19('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x12e420[_0x1b19('0xf')]+','+(_0x4dedc4[_0x1b19('0x61')][_0x1b19('0x6e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x1b19('0x7')](respondWithResult(_0x28ed32,null))[_0x1b19('0xa')](handleError(_0x28ed32,null));};};exports[_0x1b19('0x6f')]=function(_0x21c0ea,_0x115af1){var _0x4deac6,_0xe6beb2;if(_[_0x1b19('0x11')](_0x21c0ea['body'][_0x1b19('0x70')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x112891=_0x21c0ea[_0x1b19('0x20')][_0x1b19('0x70')];var _0x84da5a=_['capitalize'](_0x112891);var _0x5ac58f=_0x112891===_0x1b19('0x5f')?_0x1b19('0x60'):_0x1b19('0x61');return db['User'][_0x1b19('0x63')]({'raw':!![],'where':{'id':_0x21c0ea[_0x1b19('0x1a')]['id'],'role':_0x1b19('0x71')}})[_0x1b19('0x7')](function(_0x2d3c16){if(_['isNil'](_0x2d3c16)){throw new Error('Agent\x20not\x20found');}_0x4deac6=_0x2d3c16;return db[_0x84da5a+_0x1b19('0x72')][_0x1b19('0x63')]({'where':{'id':_0x21c0ea[_0x1b19('0x20')][_0x1b19('0x65')]},'include':[{'model':db[_0x84da5a+'Interaction'],'as':_0x1b19('0x66')},{'model':db[_0x84da5a+_0x5ac58f],'as':_0x1b19('0x61')}]});})[_0x1b19('0x7')](function(_0x1efa37){if(_[_0x1b19('0x11')](_0x1efa37)){throw new Error(_0x84da5a+_0x1b19('0x67'));}_0xe6beb2=_0x1efa37;return _0x1efa37[_0x1b19('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1b19('0x7')](function(){var _0x1c5a4f={'uniqueid':_0x112891+'.'+_0xe6beb2['id']+'.'+_0xe6beb2[_0x1b19('0x66')]['id'],'FromUserId':_0x21c0ea[_0x1b19('0x2e')]['id'],'type':_0x1b19('0x71'),'ToUserId':_0x4deac6['id']};_0x1c5a4f[_0x84da5a+'MessageId']=_0xe6beb2['id'];_0x1c5a4f[_0x84da5a+'InteractionId']=_0xe6beb2[_0x1b19('0x66')]['id'];_0x1c5a4f['From'+_0x84da5a+_0x5ac58f+'Id']=_0xe6beb2[_0x1b19('0x61')]['id'];return db[_0x84da5a+'TransferReport'][_0x1b19('0x73')](_0x1c5a4f);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x112891,'interaction':_0xe6beb2[_0x1b19('0x66')],'message':_0xe6beb2,'account':_0xe6beb2[_0x1b19('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1b19('0x71'),'appdata':_0x4deac6[_0x1b19('0xf')]+','+(_0xe6beb2[_0x1b19('0x61')][_0x1b19('0x74')]||0x12c),'interval':_0x1b19('0x75')}]},routingClient);})[_0x1b19('0x7')](respondWithResult(_0x115af1,null))[_0x1b19('0xa')](handleError(_0x115af1,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 652fce7..d56e062 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 _0xa84d=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','run','post'];(function(_0x5b674f,_0x4beb57){var _0x357c43=function(_0x49f4c0){while(--_0x49f4c0){_0x5b674f['push'](_0x5b674f['shift']());}};_0x357c43(++_0x4beb57);}(_0xa84d,0xb5));var _0xda84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa84d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xda84('0x0'));var util=require(_0xda84('0x1'));var path=require(_0xda84('0x2'));var timeout=require(_0xda84('0x3'));var express=require(_0xda84('0x4'));var router=express[_0xda84('0x5')]();var fs_extra=require(_0xda84('0x6'));var auth=require(_0xda84('0x7'));var interaction=require(_0xda84('0x8'));var config=require(_0xda84('0x9'));var controller=require(_0xda84('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xda84('0xb')](_0xda84('0xc'),auth[_0xda84('0xd')](),controller[_0xda84('0xe')]);router['get']('/:id/run',auth[_0xda84('0xd')](),controller[_0xda84('0xf')]);router[_0xda84('0x10')]('/',auth[_0xda84('0xd')](),controller[_0xda84('0x11')]);router[_0xda84('0x12')]('/:id',auth[_0xda84('0xd')](),controller[_0xda84('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xda84('0x14')]);module[_0xda84('0x15')]=router; \ No newline at end of file +var _0xd9fb=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/run','run','post','create','update','destroy','exports','multer','util'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xd9fb,0xa0));var _0xbd9f=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xd9fb[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var path=require('path');var timeout=require(_0xbd9f('0x2'));var express=require(_0xbd9f('0x3'));var router=express[_0xbd9f('0x4')]();var fs_extra=require(_0xbd9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbd9f('0x6'));var config=require(_0xbd9f('0x7'));var controller=require('./schedule.controller');router[_0xbd9f('0x8')]('/',auth[_0xbd9f('0x9')](),controller['index']);router[_0xbd9f('0x8')](_0xbd9f('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xbd9f('0xb'),auth[_0xbd9f('0x9')](),controller[_0xbd9f('0xc')]);router[_0xbd9f('0xd')]('/',auth[_0xbd9f('0x9')](),controller[_0xbd9f('0xe')]);router['put'](_0xbd9f('0xa'),auth[_0xbd9f('0x9')](),controller[_0xbd9f('0xf')]);router['delete'](_0xbd9f('0xa'),auth[_0xbd9f('0x9')](),controller[_0xbd9f('0x10')]);module[_0xbd9f('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a30fd12..32c9f1b 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 _0x2b14=['months','weeks','days','hours','minutes','csv','pdf','default','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2b14,0x114));var _0x42b1=function(_0x2f620e,_0x29a447){_0x2f620e=_0x2f620e-0x0;var _0x35c6cc=_0x2b14[_0x2f620e];return _0x35c6cc;};'use strict';var Sequelize=require(_0x42b1('0x0'));module[_0x42b1('0x1')]={'name':{'type':Sequelize[_0x42b1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x42b1('0x2')]},'active':{'type':Sequelize[_0x42b1('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x42b1('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x42b1('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x42b1('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x42b1('0x6')](_0x42b1('0x7'),_0x42b1('0x8'),_0x42b1('0x9'),_0x42b1('0xa'),_0x42b1('0xb'),_0x42b1('0xc'),_0x42b1('0xd')),'allowNull':![],'defaultValue':_0x42b1('0xb')},'output':{'type':Sequelize['ENUM'](_0x42b1('0xe'),_0x42b1('0xf'),'xlsx'),'allowNull':![],'defaultValue':_0x42b1('0xe')},'type':{'type':Sequelize[_0x42b1('0x6')]('custom',_0x42b1('0x10')),'allowNull':![],'defaultValue':_0x42b1('0x11')},'sendMail':{'type':Sequelize[_0x42b1('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x42b1('0x2')]},'cc':{'type':Sequelize[_0x42b1('0x12')]},'bcc':{'type':Sequelize[_0x42b1('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x42b1('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xcdaa=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','hours','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN'];(function(_0x23b6d4,_0x4e78c2){var _0x468e0f=function(_0x37a134){while(--_0x37a134){_0x23b6d4['push'](_0x23b6d4['shift']());}};_0x468e0f(++_0x4e78c2);}(_0xcdaa,0x177));var _0xacda=function(_0x41a29f,_0xa52db8){_0x41a29f=_0x41a29f-0x0;var _0x576b3e=_0xcdaa[_0x41a29f];return _0x576b3e;};'use strict';var Sequelize=require('sequelize');module[_0xacda('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xacda('0x1')]},'active':{'type':Sequelize[_0xacda('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xacda('0x1')],'allowNull':![],'defaultValue':_0xacda('0x3')},'startAt':{'type':Sequelize[_0xacda('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xacda('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xacda('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xacda('0x6')](_0xacda('0x7'),_0xacda('0x8'),_0xacda('0x9'),'weeks',_0xacda('0xa'),_0xacda('0xb'),'minutes'),'allowNull':![],'defaultValue':_0xacda('0xa')},'output':{'type':Sequelize[_0xacda('0x6')](_0xacda('0xc'),_0xacda('0xd'),_0xacda('0xe')),'allowNull':![],'defaultValue':_0xacda('0xc')},'type':{'type':Sequelize[_0xacda('0x6')](_0xacda('0xf'),_0xacda('0x10')),'allowNull':![],'defaultValue':_0xacda('0xf')},'sendMail':{'type':Sequelize[_0xacda('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xacda('0x11')]},'bcc':{'type':Sequelize[_0xacda('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xacda('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index aa814a3..2121b61 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 _0xfeec=['../../config/schedule','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','catch','show','params','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run'];(function(_0x5fc3d8,_0x18933f){var _0x421e14=function(_0x8c36d2){while(--_0x8c36d2){_0x5fc3d8['push'](_0x5fc3d8['shift']());}};_0x421e14(++_0x18933f);}(_0xfeec,0x155));var _0xcfee=function(_0x152692,_0x1458b0){_0x152692=_0x152692-0x0;var _0x1581ac=_0xfeec[_0x152692];return _0x1581ac;};'use strict';var emlformat=require(_0xcfee('0x0'));var rimraf=require(_0xcfee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcfee('0x2'));var moment=require('moment');var BPromise=require(_0xcfee('0x3'));var Mustache=require(_0xcfee('0x4'));var util=require(_0xcfee('0x5'));var path=require(_0xcfee('0x6'));var sox=require('sox');var csv=require(_0xcfee('0x7'));var ejs=require(_0xcfee('0x8'));var fs=require('fs');var fs_extra=require(_0xcfee('0x9'));var _=require(_0xcfee('0xa'));var squel=require(_0xcfee('0xb'));var crypto=require(_0xcfee('0xc'));var jsforce=require(_0xcfee('0xd'));var deskjs=require(_0xcfee('0xe'));var toCsv=require(_0xcfee('0x7'));var querystring=require('querystring');var Papa=require(_0xcfee('0xf'));var Redis=require(_0xcfee('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcfee('0x11'));var hardwareService=require(_0xcfee('0x12'));var logger=require(_0xcfee('0x13'))(_0xcfee('0x14'));var utils=require(_0xcfee('0x15'));var config=require(_0xcfee('0x16'));var licenseUtil=require(_0xcfee('0x17'));var db=require(_0xcfee('0x18'))['db'];function respondWithStatusCode(_0xf0f730,_0x2d7ea6){_0x2d7ea6=_0x2d7ea6||0xcc;return function(_0x684c46){if(_0x684c46){return _0xf0f730[_0xcfee('0x19')](_0x2d7ea6);}return _0xf0f730['status'](_0x2d7ea6)['end']();};}function respondWithResult(_0x181c0b,_0x2aad0e){_0x2aad0e=_0x2aad0e||0xc8;return function(_0x5aafaa){if(_0x5aafaa){return _0x181c0b[_0xcfee('0x1a')](_0x2aad0e)[_0xcfee('0x1b')](_0x5aafaa);}};}function respondWithFilteredResult(_0xb00244,_0x3cc257){return function(_0x1e4257){if(_0x1e4257){var _0x165ee9=typeof _0x3cc257[_0xcfee('0x1c')]===_0xcfee('0x1d')&&typeof _0x3cc257[_0xcfee('0x1e')]===_0xcfee('0x1d');var _0x520857=_0x1e4257['count'];var _0xdcbe89=_0x165ee9?0x0:_0x3cc257['offset'];var _0x5b1396=_0x165ee9?_0x1e4257[_0xcfee('0x1f')]:_0x3cc257['offset']+_0x3cc257[_0xcfee('0x1e')];var _0x2f5254;if(_0x5b1396>=_0x520857){_0x5b1396=_0x520857;_0x2f5254=0xc8;}else{_0x2f5254=0xce;}_0xb00244[_0xcfee('0x1a')](_0x2f5254);return _0xb00244[_0xcfee('0x20')]('Content-Range',_0xdcbe89+'-'+_0x5b1396+'/'+_0x520857)[_0xcfee('0x1b')](_0x1e4257);}return null;};}function patchUpdates(_0x472522){return function(_0x1f0336){try{jsonpatch['apply'](_0x1f0336,_0x472522,!![]);}catch(_0x318bcc){return BPromise[_0xcfee('0x21')](_0x318bcc);}return _0x1f0336['save']();};}function saveUpdates(_0x334d43,_0xe63067){return function(_0x5e1978){if(_0x5e1978){return _0x5e1978['update'](_0x334d43)[_0xcfee('0x22')](function(_0x328523){return _0x328523;});}return null;};}function removeEntity(_0x246652,_0x1f256f){return function(_0x486794){if(_0x486794){return _0x486794[_0xcfee('0x23')]()[_0xcfee('0x22')](function(){var _0x434b03=_0x486794[_0xcfee('0x24')]({'plain':!![]});var _0x3ddff3='Scheduler';return db[_0xcfee('0x25')]['destroy']({'where':{'type':_0x3ddff3,'resourceId':_0x434b03['id']}})[_0xcfee('0x22')](function(){return _0x486794;});})[_0xcfee('0x22')](function(){_0x246652['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfa7c2c,_0x32365f){return function(_0xeb2cd0){if(!_0xeb2cd0){_0xfa7c2c[_0xcfee('0x19')](0x194);}return _0xeb2cd0;};}function handleError(_0x30281f,_0x5f1259){_0x5f1259=_0x5f1259||0x1f4;return function(_0x4f68fd){logger[_0xcfee('0x26')](_0x4f68fd[_0xcfee('0x27')]);if(_0x4f68fd[_0xcfee('0x28')]){delete _0x4f68fd[_0xcfee('0x28')];}_0x30281f[_0xcfee('0x1a')](_0x5f1259)[_0xcfee('0x29')](_0x4f68fd);};}exports[_0xcfee('0x2a')]=function(_0x11828b,_0x565ace){var _0xd81cac={},_0x2c0400={},_0x389366={'count':0x0,'rows':[]};var _0x47dec5=_[_0xcfee('0x2b')](db[_0xcfee('0x2c')][_0xcfee('0x2d')],function(_0x400b4c){return{'name':_0x400b4c[_0xcfee('0x2e')],'type':_0x400b4c[_0xcfee('0x2f')][_0xcfee('0x30')]};});_0x2c0400[_0xcfee('0x31')]=_['map'](_0x47dec5,_0xcfee('0x28'));_0x2c0400['query']=_[_0xcfee('0x32')](_0x11828b['query']);_0x2c0400['filters']=_[_0xcfee('0x33')](_0x2c0400[_0xcfee('0x31')],_0x2c0400[_0xcfee('0x34')]);_0xd81cac[_0xcfee('0x35')]=_[_0xcfee('0x33')](_0x2c0400[_0xcfee('0x31')],qs['fields'](_0x11828b[_0xcfee('0x34')]['fields']));_0xd81cac[_0xcfee('0x35')]=_0xd81cac[_0xcfee('0x35')][_0xcfee('0x36')]?_0xd81cac['attributes']:_0x2c0400['model'];if(!_0x11828b[_0xcfee('0x34')][_0xcfee('0x37')](_0xcfee('0x38'))){_0xd81cac[_0xcfee('0x1e')]=qs['limit'](_0x11828b[_0xcfee('0x34')][_0xcfee('0x1e')]);_0xd81cac[_0xcfee('0x1c')]=qs[_0xcfee('0x1c')](_0x11828b[_0xcfee('0x34')][_0xcfee('0x1c')]);}_0xd81cac[_0xcfee('0x39')]=qs[_0xcfee('0x3a')](_0x11828b[_0xcfee('0x34')]['sort']);_0xd81cac['where']=qs[_0xcfee('0x3b')](_[_0xcfee('0x3c')](_0x11828b[_0xcfee('0x34')],_0x2c0400[_0xcfee('0x3b')]),_0x47dec5);if(_0x11828b[_0xcfee('0x34')]['filter']){_0xd81cac[_0xcfee('0x3d')]=_[_0xcfee('0x3e')](_0xd81cac[_0xcfee('0x3d')],{'$or':_[_0xcfee('0x2b')](_0x47dec5,function(_0xe9f707){if(_0xe9f707['type']!==_0xcfee('0x3f')){var _0x41357a={};_0x41357a[_0xe9f707[_0xcfee('0x28')]]={'$like':'%'+_0x11828b[_0xcfee('0x34')][_0xcfee('0x40')]+'%'};return _0x41357a;}})});}_0xd81cac=_[_0xcfee('0x3e')]({},_0xd81cac,_0x11828b[_0xcfee('0x41')]);var _0x35f181={'where':_0xd81cac['where']};return db[_0xcfee('0x2c')][_0xcfee('0x1f')](_0x35f181)[_0xcfee('0x22')](function(_0x56a263){_0x389366[_0xcfee('0x1f')]=_0x56a263;if(_0x11828b[_0xcfee('0x34')]['includeAll']){_0xd81cac[_0xcfee('0x42')]=[{'all':!![]}];}return db[_0xcfee('0x2c')]['findAll'](_0xd81cac);})[_0xcfee('0x22')](function(_0x409805){_0x389366['rows']=_0x409805;return _0x389366;})[_0xcfee('0x22')](respondWithFilteredResult(_0x565ace,_0xd81cac))[_0xcfee('0x43')](handleError(_0x565ace,null));};exports[_0xcfee('0x44')]=function(_0x382077,_0x3abde8){var _0x4ce2c9={'raw':![],'where':{'id':_0x382077[_0xcfee('0x45')]['id']}},_0x40d406={};_0x40d406['model']=_['keys'](db['Schedule'][_0xcfee('0x2d')]);_0x40d406['query']=_[_0xcfee('0x32')](_0x382077[_0xcfee('0x34')]);_0x40d406[_0xcfee('0x3b')]=_[_0xcfee('0x33')](_0x40d406['model'],_0x40d406[_0xcfee('0x34')]);_0x4ce2c9[_0xcfee('0x35')]=_['intersection'](_0x40d406[_0xcfee('0x31')],qs[_0xcfee('0x46')](_0x382077['query'][_0xcfee('0x46')]));_0x4ce2c9[_0xcfee('0x35')]=_0x4ce2c9[_0xcfee('0x35')][_0xcfee('0x36')]?_0x4ce2c9[_0xcfee('0x35')]:_0x40d406['model'];if(_0x382077[_0xcfee('0x34')][_0xcfee('0x47')]){_0x4ce2c9[_0xcfee('0x42')]=[{'all':!![]}];}_0x4ce2c9=_['merge']({},_0x4ce2c9,_0x382077['options']);return db[_0xcfee('0x2c')][_0xcfee('0x48')](_0x4ce2c9)[_0xcfee('0x22')](handleEntityNotFound(_0x3abde8,null))[_0xcfee('0x22')](respondWithResult(_0x3abde8,null))[_0xcfee('0x43')](handleError(_0x3abde8,null));};exports[_0xcfee('0x49')]=function(_0x244b98,_0x4c3a78){return db[_0xcfee('0x2c')]['create'](_0x244b98['body'],{})[_0xcfee('0x22')](function(_0x95b662){var _0x134ccb=_0x244b98[_0xcfee('0x4a')][_0xcfee('0x24')]({'plain':!![]});if(!_0x134ccb)throw new Error(_0xcfee('0x4b'));if(_0x134ccb[_0xcfee('0x4c')]===_0xcfee('0x4a')){var _0x22e45f=_0x95b662[_0xcfee('0x24')]({'plain':!![]});var _0x36e3cf=_0xcfee('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x36e3cf,'userProfileId':_0x134ccb[_0xcfee('0x4e')]},'raw':!![]})['then'](function(_0x5dddfd){if(_0x5dddfd&&_0x5dddfd[_0xcfee('0x4f')]===0x0){return db['UserProfileResource'][_0xcfee('0x49')]({'name':_0x22e45f[_0xcfee('0x28')],'resourceId':_0x22e45f['id'],'type':_0x5dddfd['name'],'sectionId':_0x5dddfd['id']},{})[_0xcfee('0x22')](function(){return _0x95b662;});}else{return _0x95b662;}})[_0xcfee('0x43')](function(_0x1cc94){logger[_0xcfee('0x26')](_0xcfee('0x50'),_0x1cc94);throw _0x1cc94;});}return _0x95b662;})['then'](respondWithResult(_0x4c3a78,0xc9))['catch'](handleError(_0x4c3a78,null));};exports[_0xcfee('0x51')]=function(_0x1454c0,_0x3fca9f){if(_0x1454c0[_0xcfee('0x52')]['id']){delete _0x1454c0[_0xcfee('0x52')]['id'];}return db[_0xcfee('0x2c')]['find']({'where':{'id':_0x1454c0['params']['id']}})['then'](handleEntityNotFound(_0x3fca9f,null))[_0xcfee('0x22')](saveUpdates(_0x1454c0[_0xcfee('0x52')],null))['then'](respondWithResult(_0x3fca9f,null))['catch'](handleError(_0x3fca9f,null));};exports['destroy']=function(_0x2dddcc,_0x1a93a9){return db[_0xcfee('0x2c')]['find']({'where':{'id':_0x2dddcc[_0xcfee('0x45')]['id']}})[_0xcfee('0x22')](handleEntityNotFound(_0x1a93a9,null))['then'](removeEntity(_0x1a93a9,null))[_0xcfee('0x43')](handleError(_0x1a93a9,null));};exports[_0xcfee('0x53')]=function(_0x31bacd,_0x30f852,_0x256298){var _0x2d6c20=require(_0xcfee('0x54'));return db[_0xcfee('0x2c')]['find']({'where':{'id':_0x31bacd['params']['id']},'raw':!![]})[_0xcfee('0x22')](handleEntityNotFound(_0x30f852,null))[_0xcfee('0x22')](function(){_0x2d6c20[_0xcfee('0x53')](_0x31bacd[_0xcfee('0x45')]['id']);})[_0xcfee('0x22')](respondWithStatusCode(_0x30f852,null))['catch'](handleError(_0x30f852,null));}; \ No newline at end of file +var _0xd12a=['name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','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','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','sendStatus','error','stack'];(function(_0x4f3dee,_0x46bb90){var _0x291aad=function(_0x3ca8f5){while(--_0x3ca8f5){_0x4f3dee['push'](_0x4f3dee['shift']());}};_0x291aad(++_0x46bb90);}(_0xd12a,0x1dd));var _0xad12=function(_0x18c6ca,_0xe39ee7){_0x18c6ca=_0x18c6ca-0x0;var _0x445129=_0xd12a[_0x18c6ca];return _0x445129;};'use strict';var emlformat=require(_0xad12('0x0'));var rimraf=require(_0xad12('0x1'));var zipdir=require(_0xad12('0x2'));var jsonpatch=require(_0xad12('0x3'));var rp=require(_0xad12('0x4'));var moment=require(_0xad12('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xad12('0x6'));var util=require(_0xad12('0x7'));var path=require(_0xad12('0x8'));var sox=require(_0xad12('0x9'));var csv=require(_0xad12('0xa'));var ejs=require(_0xad12('0xb'));var fs=require('fs');var fs_extra=require(_0xad12('0xc'));var _=require(_0xad12('0xd'));var squel=require(_0xad12('0xe'));var crypto=require(_0xad12('0xf'));var jsforce=require(_0xad12('0x10'));var deskjs=require(_0xad12('0x11'));var toCsv=require('to-csv');var querystring=require(_0xad12('0x12'));var Papa=require(_0xad12('0x13'));var Redis=require(_0xad12('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xad12('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad12('0x16'));var logger=require(_0xad12('0x17'))(_0xad12('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x320d31,_0x459f89){_0x459f89=_0x459f89||0xcc;return function(_0x376b31){if(_0x376b31){return _0x320d31['sendStatus'](_0x459f89);}return _0x320d31['status'](_0x459f89)[_0xad12('0x19')]();};}function respondWithResult(_0xc873f7,_0x291719){_0x291719=_0x291719||0xc8;return function(_0x160b08){if(_0x160b08){return _0xc873f7[_0xad12('0x1a')](_0x291719)[_0xad12('0x1b')](_0x160b08);}};}function respondWithFilteredResult(_0x2512ec,_0x2cdb2c){return function(_0x5f2cbd){if(_0x5f2cbd){var _0x36aaf0=typeof _0x2cdb2c[_0xad12('0x1c')]===_0xad12('0x1d')&&typeof _0x2cdb2c[_0xad12('0x1e')]===_0xad12('0x1d');var _0x34c652=_0x5f2cbd[_0xad12('0x1f')];var _0xd36057=_0x36aaf0?0x0:_0x2cdb2c['offset'];var _0x2741a3=_0x36aaf0?_0x5f2cbd[_0xad12('0x1f')]:_0x2cdb2c[_0xad12('0x1c')]+_0x2cdb2c['limit'];var _0x11f3dc;if(_0x2741a3>=_0x34c652){_0x2741a3=_0x34c652;_0x11f3dc=0xc8;}else{_0x11f3dc=0xce;}_0x2512ec[_0xad12('0x1a')](_0x11f3dc);return _0x2512ec['set'](_0xad12('0x20'),_0xd36057+'-'+_0x2741a3+'/'+_0x34c652)[_0xad12('0x1b')](_0x5f2cbd);}return null;};}function patchUpdates(_0x28f1d7){return function(_0x2d344b){try{jsonpatch[_0xad12('0x21')](_0x2d344b,_0x28f1d7,!![]);}catch(_0x241e17){return BPromise[_0xad12('0x22')](_0x241e17);}return _0x2d344b[_0xad12('0x23')]();};}function saveUpdates(_0x471434,_0x3c2c50){return function(_0x5d5493){if(_0x5d5493){return _0x5d5493[_0xad12('0x24')](_0x471434)[_0xad12('0x25')](function(_0x92d503){return _0x92d503;});}return null;};}function removeEntity(_0x419fde,_0x2ac80b){return function(_0xc137f1){if(_0xc137f1){return _0xc137f1['destroy']()['then'](function(){var _0x1e1b84=_0xc137f1[_0xad12('0x26')]({'plain':!![]});var _0xd576ad=_0xad12('0x27');return db[_0xad12('0x28')][_0xad12('0x29')]({'where':{'type':_0xd576ad,'resourceId':_0x1e1b84['id']}})['then'](function(){return _0xc137f1;});})[_0xad12('0x25')](function(){_0x419fde[_0xad12('0x1a')](0xcc)[_0xad12('0x19')]();});}};}function handleEntityNotFound(_0x71a7d1,_0x4177ba){return function(_0x3cfeb1){if(!_0x3cfeb1){_0x71a7d1[_0xad12('0x2a')](0x194);}return _0x3cfeb1;};}function handleError(_0x12cd86,_0x1aa002){_0x1aa002=_0x1aa002||0x1f4;return function(_0x59ba8e){logger[_0xad12('0x2b')](_0x59ba8e[_0xad12('0x2c')]);if(_0x59ba8e[_0xad12('0x2d')]){delete _0x59ba8e[_0xad12('0x2d')];}_0x12cd86['status'](_0x1aa002)[_0xad12('0x2e')](_0x59ba8e);};}exports[_0xad12('0x2f')]=function(_0x33721f,_0x193803){var _0x3e3022={},_0x5b7c5a={},_0x523955={'count':0x0,'rows':[]};var _0x447e74=_[_0xad12('0x30')](db[_0xad12('0x31')][_0xad12('0x32')],function(_0x22a7a9){return{'name':_0x22a7a9[_0xad12('0x33')],'type':_0x22a7a9[_0xad12('0x34')][_0xad12('0x35')]};});_0x5b7c5a[_0xad12('0x36')]=_[_0xad12('0x30')](_0x447e74,_0xad12('0x2d'));_0x5b7c5a[_0xad12('0x37')]=_[_0xad12('0x38')](_0x33721f[_0xad12('0x37')]);_0x5b7c5a[_0xad12('0x39')]=_['intersection'](_0x5b7c5a[_0xad12('0x36')],_0x5b7c5a['query']);_0x3e3022[_0xad12('0x3a')]=_[_0xad12('0x3b')](_0x5b7c5a[_0xad12('0x36')],qs[_0xad12('0x3c')](_0x33721f[_0xad12('0x37')][_0xad12('0x3c')]));_0x3e3022[_0xad12('0x3a')]=_0x3e3022[_0xad12('0x3a')][_0xad12('0x3d')]?_0x3e3022[_0xad12('0x3a')]:_0x5b7c5a[_0xad12('0x36')];if(!_0x33721f['query']['hasOwnProperty'](_0xad12('0x3e'))){_0x3e3022[_0xad12('0x1e')]=qs['limit'](_0x33721f[_0xad12('0x37')][_0xad12('0x1e')]);_0x3e3022[_0xad12('0x1c')]=qs[_0xad12('0x1c')](_0x33721f[_0xad12('0x37')]['offset']);}_0x3e3022[_0xad12('0x3f')]=qs[_0xad12('0x40')](_0x33721f['query'][_0xad12('0x40')]);_0x3e3022[_0xad12('0x41')]=qs[_0xad12('0x39')](_['pick'](_0x33721f[_0xad12('0x37')],_0x5b7c5a[_0xad12('0x39')]),_0x447e74);if(_0x33721f[_0xad12('0x37')][_0xad12('0x42')]){_0x3e3022[_0xad12('0x41')]=_[_0xad12('0x43')](_0x3e3022[_0xad12('0x41')],{'$or':_[_0xad12('0x30')](_0x447e74,function(_0x38801d){if(_0x38801d[_0xad12('0x34')]!=='VIRTUAL'){var _0x2f99b6={};_0x2f99b6[_0x38801d[_0xad12('0x2d')]]={'$like':'%'+_0x33721f[_0xad12('0x37')]['filter']+'%'};return _0x2f99b6;}})});}_0x3e3022=_[_0xad12('0x43')]({},_0x3e3022,_0x33721f[_0xad12('0x44')]);var _0x4356f8={'where':_0x3e3022[_0xad12('0x41')]};return db['Schedule']['count'](_0x4356f8)[_0xad12('0x25')](function(_0x3fdddf){_0x523955[_0xad12('0x1f')]=_0x3fdddf;if(_0x33721f[_0xad12('0x37')][_0xad12('0x45')]){_0x3e3022['include']=[{'all':!![]}];}return db[_0xad12('0x31')][_0xad12('0x46')](_0x3e3022);})['then'](function(_0x5314d4){_0x523955[_0xad12('0x47')]=_0x5314d4;return _0x523955;})[_0xad12('0x25')](respondWithFilteredResult(_0x193803,_0x3e3022))[_0xad12('0x48')](handleError(_0x193803,null));};exports[_0xad12('0x49')]=function(_0x5a60a8,_0x260185){var _0x156fbd={'raw':![],'where':{'id':_0x5a60a8[_0xad12('0x4a')]['id']}},_0x3183eb={};_0x3183eb['model']=_['keys'](db[_0xad12('0x31')][_0xad12('0x32')]);_0x3183eb['query']=_[_0xad12('0x38')](_0x5a60a8[_0xad12('0x37')]);_0x3183eb['filters']=_[_0xad12('0x3b')](_0x3183eb[_0xad12('0x36')],_0x3183eb[_0xad12('0x37')]);_0x156fbd['attributes']=_['intersection'](_0x3183eb[_0xad12('0x36')],qs[_0xad12('0x3c')](_0x5a60a8['query']['fields']));_0x156fbd[_0xad12('0x3a')]=_0x156fbd[_0xad12('0x3a')][_0xad12('0x3d')]?_0x156fbd[_0xad12('0x3a')]:_0x3183eb[_0xad12('0x36')];if(_0x5a60a8['query']['includeAll']){_0x156fbd['include']=[{'all':!![]}];}_0x156fbd=_[_0xad12('0x43')]({},_0x156fbd,_0x5a60a8[_0xad12('0x44')]);return db[_0xad12('0x31')][_0xad12('0x4b')](_0x156fbd)[_0xad12('0x25')](handleEntityNotFound(_0x260185,null))[_0xad12('0x25')](respondWithResult(_0x260185,null))['catch'](handleError(_0x260185,null));};exports[_0xad12('0x4c')]=function(_0x3885e8,_0x35e209){return db[_0xad12('0x31')][_0xad12('0x4c')](_0x3885e8[_0xad12('0x4d')],{})[_0xad12('0x25')](function(_0x9ecee2){var _0xacc88b=_0x3885e8[_0xad12('0x4e')]['get']({'plain':!![]});if(!_0xacc88b)throw new Error(_0xad12('0x4f'));if(_0xacc88b[_0xad12('0x50')]===_0xad12('0x4e')){var _0x2f035b=_0x9ecee2[_0xad12('0x26')]({'plain':!![]});var _0x53ffb6='Scheduler';return db[_0xad12('0x51')][_0xad12('0x4b')]({'where':{'name':_0x53ffb6,'userProfileId':_0xacc88b[_0xad12('0x52')]},'raw':!![]})[_0xad12('0x25')](function(_0x369ae5){if(_0x369ae5&&_0x369ae5[_0xad12('0x53')]===0x0){return db[_0xad12('0x28')][_0xad12('0x4c')]({'name':_0x2f035b[_0xad12('0x2d')],'resourceId':_0x2f035b['id'],'type':_0x369ae5[_0xad12('0x2d')],'sectionId':_0x369ae5['id']},{})['then'](function(){return _0x9ecee2;});}else{return _0x9ecee2;}})[_0xad12('0x48')](function(_0x7f061){logger[_0xad12('0x2b')](_0xad12('0x54'),_0x7f061);throw _0x7f061;});}return _0x9ecee2;})[_0xad12('0x25')](respondWithResult(_0x35e209,0xc9))[_0xad12('0x48')](handleError(_0x35e209,null));};exports[_0xad12('0x24')]=function(_0x1f6f89,_0x44fe08){if(_0x1f6f89[_0xad12('0x4d')]['id']){delete _0x1f6f89[_0xad12('0x4d')]['id'];}return db['Schedule']['find']({'where':{'id':_0x1f6f89[_0xad12('0x4a')]['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x44fe08,null))[_0xad12('0x25')](saveUpdates(_0x1f6f89['body'],null))[_0xad12('0x25')](respondWithResult(_0x44fe08,null))[_0xad12('0x48')](handleError(_0x44fe08,null));};exports['destroy']=function(_0x443a61,_0xb0c9){return db[_0xad12('0x31')]['find']({'where':{'id':_0x443a61[_0xad12('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb0c9,null))['then'](removeEntity(_0xb0c9,null))[_0xad12('0x48')](handleError(_0xb0c9,null));};exports[_0xad12('0x55')]=function(_0x50a72d,_0x35b00e,_0x13aecb){var _0x12da4a=require(_0xad12('0x56'));return db[_0xad12('0x31')][_0xad12('0x4b')]({'where':{'id':_0x50a72d[_0xad12('0x4a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35b00e,null))[_0xad12('0x25')](function(){_0x12da4a['run'](_0x50a72d[_0xad12('0x4a')]['id']);})[_0xad12('0x25')](respondWithStatusCode(_0x35b00e,null))[_0xad12('0x48')](handleError(_0x35b00e,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 56e4b55..9b810e5 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 _0xbe7b=['bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util','moment'];(function(_0x1a979a,_0x4d8d8c){var _0x99a8f2=function(_0x1ea72f){while(--_0x1ea72f){_0x1a979a['push'](_0x1a979a['shift']());}};_0x99a8f2(++_0x4d8d8c);}(_0xbe7b,0x1d7));var _0xbbe7=function(_0x3486b0,_0x248021){_0x3486b0=_0x3486b0-0x0;var _0x2c8a3f=_0xbe7b[_0x3486b0];return _0x2c8a3f;};'use strict';var _=require('lodash');var util=require(_0xbbe7('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbbe7('0x1'));var BPromise=require(_0xbbe7('0x2'));var rp=require(_0xbbe7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe7('0x4'));var config=require(_0xbbe7('0x5'));var attributes=require(_0xbbe7('0x6'));module[_0xbbe7('0x7')]=function(_0x5518ba,_0x107a4b){return _0x5518ba[_0xbbe7('0x8')](_0xbbe7('0x9'),attributes,{'tableName':_0xbbe7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15f1=['request-promise','path','rimraf','./schedule.attributes','define','Schedule','lodash','moment','bluebird'];(function(_0xe10cff,_0x3816a3){var _0x252c74=function(_0x560f46){while(--_0x560f46){_0xe10cff['push'](_0xe10cff['shift']());}};_0x252c74(++_0x3816a3);}(_0x15f1,0xa8));var _0x115f=function(_0x3d28b8,_0x4ee274){_0x3d28b8=_0x3d28b8-0x0;var _0x18834b=_0x15f1[_0x3d28b8];return _0x18834b;};'use strict';var _=require(_0x115f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x115f('0x1'));var BPromise=require(_0x115f('0x2'));var rp=require(_0x115f('0x3'));var fs=require('fs');var path=require(_0x115f('0x4'));var rimraf=require(_0x115f('0x5'));var config=require('../../config/environment');var attributes=require(_0x115f('0x6'));module['exports']=function(_0x1478fd,_0x3391bc){return _0x1478fd[_0x115f('0x7')](_0x115f('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 239934a..9d26a03 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 _0x112b=['then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x112b,0x192));var _0xb112=function(_0x3dda0f,_0x5b9902){_0x3dda0f=_0x3dda0f-0x0;var _0x1b0488=_0x112b[_0x3dda0f];return _0x1b0488;};'use strict';var _=require(_0xb112('0x0'));var util=require(_0xb112('0x1'));var moment=require(_0xb112('0x2'));var BPromise=require(_0xb112('0x3'));var rs=require(_0xb112('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb112('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb112('0x6'))(_0xb112('0x7'));var config=require(_0xb112('0x8'));var jayson=require(_0xb112('0x9'));var client=jayson[_0xb112('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a84ec,_0x5d3453,_0x57facb){return new BPromise(function(_0x540686,_0x8210e5){return client[_0xb112('0xb')](_0x3a84ec,_0x57facb)[_0xb112('0xc')](function(_0x5e233b){logger[_0xb112('0xd')](_0xb112('0xe'),_0x5d3453,_0xb112('0xf'));logger['debug'](_0xb112('0x10'),_0x5d3453,'request\x20sent',JSON[_0xb112('0x11')](_0x5e233b));if(_0x5e233b[_0xb112('0x12')]){if(_0x5e233b[_0xb112('0x12')][_0xb112('0x13')]===0x1f4){logger[_0xb112('0x12')](_0xb112('0xe'),_0x5d3453,_0x5e233b['error']['message']);return _0x8210e5(_0x5e233b[_0xb112('0x12')][_0xb112('0x14')]);}logger['error'](_0xb112('0xe'),_0x5d3453,_0x5e233b[_0xb112('0x12')]['message']);return _0x540686(_0x5e233b[_0xb112('0x12')][_0xb112('0x14')]);}else{logger[_0xb112('0xd')](_0xb112('0xe'),_0x5d3453,'request\x20sent');_0x540686(_0x5e233b[_0xb112('0x15')][_0xb112('0x14')]);}})[_0xb112('0x16')](function(_0x392cae){logger['error'](_0xb112('0xe'),_0x5d3453,_0x392cae);_0x8210e5(_0x392cae);});});} \ No newline at end of file +var _0x51b3=['rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','Schedule,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x43f939,_0xcb2598){var _0x1be640=function(_0x2a6bb0){while(--_0x2a6bb0){_0x43f939['push'](_0x43f939['shift']());}};_0x1be640(++_0xcb2598);}(_0x51b3,0x86));var _0x351b=function(_0x3981fb,_0x5c1a52){_0x3981fb=_0x3981fb-0x0;var _0x1f0d29=_0x51b3[_0x3981fb];return _0x1f0d29;};'use strict';var _=require(_0x351b('0x0'));var util=require(_0x351b('0x1'));var moment=require('moment');var BPromise=require(_0x351b('0x2'));var rs=require(_0x351b('0x3'));var fs=require('fs');var Redis=require(_0x351b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x351b('0x5'));var logger=require('../../config/logger')(_0x351b('0x6'));var config=require(_0x351b('0x7'));var jayson=require(_0x351b('0x8'));var client=jayson[_0x351b('0x9')][_0x351b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10522e,_0x163980,_0x46b518){return new BPromise(function(_0x2bcfd5,_0x3889a1){return client['request'](_0x10522e,_0x46b518)['then'](function(_0x5e3845){logger['info']('Schedule,\x20%s,\x20%s',_0x163980,_0x351b('0xb'));logger[_0x351b('0xc')](_0x351b('0xd'),_0x163980,'request\x20sent',JSON['stringify'](_0x5e3845));if(_0x5e3845[_0x351b('0xe')]){if(_0x5e3845['error'][_0x351b('0xf')]===0x1f4){logger[_0x351b('0xe')]('Schedule,\x20%s,\x20%s',_0x163980,_0x5e3845[_0x351b('0xe')][_0x351b('0x10')]);return _0x3889a1(_0x5e3845[_0x351b('0xe')][_0x351b('0x10')]);}logger[_0x351b('0xe')](_0x351b('0x11'),_0x163980,_0x5e3845[_0x351b('0xe')][_0x351b('0x10')]);return _0x2bcfd5(_0x5e3845[_0x351b('0xe')][_0x351b('0x10')]);}else{logger[_0x351b('0x12')](_0x351b('0x11'),_0x163980,_0x351b('0xb'));_0x2bcfd5(_0x5e3845['result'][_0x351b('0x10')]);}})[_0x351b('0x13')](function(_0x5d9321){logger[_0x351b('0xe')](_0x351b('0x11'),_0x163980,_0x5d9321);_0x3889a1(_0x5d9321);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index c3fb90b..3af2554 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 _0xefa9=['exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','put','/:id','delete','destroy'];(function(_0x2e766b,_0x51957f){var _0x308db5=function(_0x1ac822){while(--_0x1ac822){_0x2e766b['push'](_0x2e766b['shift']());}};_0x308db5(++_0x51957f);}(_0xefa9,0x7f));var _0x9efa=function(_0x4c07eb,_0x268d0e){_0x4c07eb=_0x4c07eb-0x0;var _0x3981ae=_0xefa9[_0x4c07eb];return _0x3981ae;};'use strict';var multer=require(_0x9efa('0x0'));var util=require('util');var path=require(_0x9efa('0x1'));var timeout=require(_0x9efa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9efa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9efa('0x4'));var config=require(_0x9efa('0x5'));var controller=require(_0x9efa('0x6'));router[_0x9efa('0x7')]('/',auth[_0x9efa('0x8')](),controller[_0x9efa('0x9')]);router[_0x9efa('0x7')](_0x9efa('0xa'),auth['isAuthenticated'](),controller[_0x9efa('0xb')]);router[_0x9efa('0x7')]('/:id',auth[_0x9efa('0x8')](),controller[_0x9efa('0xc')]);router[_0x9efa('0x7')](_0x9efa('0xd'),auth[_0x9efa('0x8')](),controller[_0x9efa('0xe')]);router[_0x9efa('0xf')]('/',auth[_0x9efa('0x8')](),controller['create']);router[_0x9efa('0x10')](_0x9efa('0x11'),auth[_0x9efa('0x8')](),controller['update']);router[_0x9efa('0x12')](_0x9efa('0x11'),auth[_0x9efa('0x8')](),controller[_0x9efa('0x13')]);module[_0x9efa('0x14')]=router; \ No newline at end of file +var _0x5323=['get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller'];(function(_0x5618dd,_0x55f766){var _0x46f223=function(_0x4b6f81){while(--_0x4b6f81){_0x5618dd['push'](_0x5618dd['shift']());}};_0x46f223(++_0x55f766);}(_0x5323,0x6e));var _0x3532=function(_0x27ea1c,_0x6dc6db){_0x27ea1c=_0x27ea1c-0x0;var _0x35711a=_0x5323[_0x27ea1c];return _0x35711a;};'use strict';var multer=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var path=require(_0x3532('0x2'));var timeout=require(_0x3532('0x3'));var express=require(_0x3532('0x4'));var router=express[_0x3532('0x5')]();var fs_extra=require(_0x3532('0x6'));var auth=require(_0x3532('0x7'));var interaction=require(_0x3532('0x8'));var config=require('../../config/environment');var controller=require(_0x3532('0x9'));router[_0x3532('0xa')]('/',auth[_0x3532('0xb')](),controller[_0x3532('0xc')]);router[_0x3532('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x3532('0xd')]);router[_0x3532('0xa')](_0x3532('0xe'),auth[_0x3532('0xb')](),controller[_0x3532('0xf')]);router[_0x3532('0xa')](_0x3532('0x10'),auth[_0x3532('0xb')](),controller[_0x3532('0x11')]);router[_0x3532('0x12')]('/',auth[_0x3532('0xb')](),controller['create']);router[_0x3532('0x13')](_0x3532('0xe'),auth[_0x3532('0xb')](),controller[_0x3532('0x14')]);router[_0x3532('0x15')](_0x3532('0xe'),auth['isAuthenticated'](),controller[_0x3532('0x16')]);module[_0x3532('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 1158f68..2c148ef 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 _0x6d5e=['extname','STRING','INTEGER','setDataValue','startedAt','closedAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value'];(function(_0x42100b,_0x5e5488){var _0x200ad6=function(_0x55012d){while(--_0x55012d){_0x42100b['push'](_0x42100b['shift']());}};_0x200ad6(++_0x5e5488);}(_0x6d5e,0x103));var _0xe6d5=function(_0x75f8ea,_0x4be6b1){_0x75f8ea=_0x75f8ea-0x0;var _0x3860cd=_0x6d5e[_0x75f8ea];return _0x3860cd;};'use strict';var Sequelize=require(_0xe6d5('0x0'));var moment=require(_0xe6d5('0x1'));var path=require(_0xe6d5('0x2'));var config=require(_0xe6d5('0x3'));module['exports']={'format':{'type':Sequelize[_0xe6d5('0x4')],'get':function(){return this[_0xe6d5('0x5')](_0xe6d5('0x6'))?path[_0xe6d5('0x7')](this[_0xe6d5('0x5')](_0xe6d5('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xe6d5('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe6d5('0x8')],'set':function(_0x4c0f87){var _0x162375=_0x4c0f87['replace'](/\\/g,'/');this['setDataValue']('value',_0x162375);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe6d5('0x9')],'set':function(_0x65a619){this[_0xe6d5('0xa')](_0xe6d5('0xb'),moment()['subtract'](_0x65a619,'ms'));this[_0xe6d5('0xa')](_0xe6d5('0xc'),moment());this[_0xe6d5('0xa')]('duration',_0x65a619);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe6d5('0x5')](_0xe6d5('0xb')))[_0xe6d5('0xd')](_0xe6d5('0xe'))[_0xe6d5('0xf')]();}},'closedAt':{'type':Sequelize[_0xe6d5('0x10')],'get':function(){return moment(this[_0xe6d5('0x5')]('closedAt'))[_0xe6d5('0xd')](_0xe6d5('0xe'))[_0xe6d5('0xf')]();}},'createdAt':{'type':Sequelize[_0xe6d5('0x10')],'get':function(){return moment(this[_0xe6d5('0x5')](_0xe6d5('0x11')))[_0xe6d5('0xd')](_0xe6d5('0xe'))[_0xe6d5('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe6d5('0x5')](_0xe6d5('0x12')))[_0xe6d5('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xe6d5('0xf')]();}}}; \ No newline at end of file +var _0x7e27=['value','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','extname'];(function(_0x127db2,_0x17a1c6){var _0x4a075f=function(_0x41ac05){while(--_0x41ac05){_0x127db2['push'](_0x127db2['shift']());}};_0x4a075f(++_0x17a1c6);}(_0x7e27,0xdd));var _0x77e2=function(_0xb291f8,_0x275b03){_0xb291f8=_0xb291f8-0x0;var _0xf55b5=_0x7e27[_0xb291f8];return _0xf55b5;};'use strict';var Sequelize=require(_0x77e2('0x0'));var moment=require(_0x77e2('0x1'));var path=require('path');var config=require(_0x77e2('0x2'));module[_0x77e2('0x3')]={'format':{'type':Sequelize[_0x77e2('0x4')],'get':function(){return this[_0x77e2('0x5')]('value')?path[_0x77e2('0x6')](this[_0x77e2('0x5')](_0x77e2('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77e2('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x101e56){var _0x137a61=_0x101e56['replace'](/\\/g,'/');this[_0x77e2('0x9')](_0x77e2('0x7'),_0x137a61);}},'rating':{'type':Sequelize[_0x77e2('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x77e2('0xa')],'set':function(_0x3802ce){this[_0x77e2('0x9')](_0x77e2('0xb'),moment()['subtract'](_0x3802ce,'ms'));this['setDataValue'](_0x77e2('0xc'),moment());this['setDataValue'](_0x77e2('0xd'),_0x3802ce);}},'startedAt':{'type':Sequelize[_0x77e2('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x77e2('0xf')](_0x77e2('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x77e2('0xe')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0x77e2('0xf')](_0x77e2('0x10'))[_0x77e2('0x11')]();}},'createdAt':{'type':Sequelize[_0x77e2('0xe')],'get':function(){return moment(this[_0x77e2('0x5')]('createdAt'))[_0x77e2('0xf')](_0x77e2('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0x77e2('0xe')],'get':function(){return moment(this[_0x77e2('0x5')](_0x77e2('0x12')))[_0x77e2('0xf')](_0x77e2('0x10'))[_0x77e2('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 521096a..fe6e3cd 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 _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x3590ed,_0x3a4587){var _0x21f72f=function(_0x45be21){while(--_0x45be21){_0x3590ed['push'](_0x3590ed['shift']());}};_0x21f72f(++_0x3a4587);}(_0xabce,0x103));var _0xeabc=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xabce[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file +var _0x5075=['send','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','end','error','name','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x46b3cc,_0x160bd7){var _0x1825b0=function(_0x35fd73){while(--_0x35fd73){_0x46b3cc['push'](_0x46b3cc['shift']());}};_0x1825b0(++_0x160bd7);}(_0x5075,0x73));var _0x5507=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5075[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5507('0x0'));var rimraf=require(_0x5507('0x1'));var zipdir=require(_0x5507('0x2'));var jsonpatch=require(_0x5507('0x3'));var rp=require(_0x5507('0x4'));var moment=require(_0x5507('0x5'));var BPromise=require(_0x5507('0x6'));var Mustache=require('mustache');var util=require(_0x5507('0x7'));var path=require(_0x5507('0x8'));var sox=require(_0x5507('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5507('0xa'));var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5507('0x17'))['db'];function respondWithStatusCode(_0x2a2ea0,_0x32c872){_0x32c872=_0x32c872||0xcc;return function(_0x267f27){if(_0x267f27){return _0x2a2ea0[_0x5507('0x18')](_0x32c872);}return _0x2a2ea0[_0x5507('0x19')](_0x32c872)['end']();};}function respondWithResult(_0x9cc3f9,_0x2b7c43){_0x2b7c43=_0x2b7c43||0xc8;return function(_0xc828e5){if(_0xc828e5){return _0x9cc3f9[_0x5507('0x19')](_0x2b7c43)['json'](_0xc828e5);}};}function respondWithFilteredResult(_0x49e400,_0x10d7b9){return function(_0x2dfd06){if(_0x2dfd06){var _0x1ab167=typeof _0x10d7b9[_0x5507('0x1a')]===_0x5507('0x1b')&&typeof _0x10d7b9[_0x5507('0x1c')]===_0x5507('0x1b');var _0x3d1619=_0x2dfd06[_0x5507('0x1d')];var _0x233b6a=_0x1ab167?0x0:_0x10d7b9[_0x5507('0x1a')];var _0x3822dd=_0x1ab167?_0x2dfd06['count']:_0x10d7b9[_0x5507('0x1a')]+_0x10d7b9[_0x5507('0x1c')];var _0x4054c6;if(_0x3822dd>=_0x3d1619){_0x3822dd=_0x3d1619;_0x4054c6=0xc8;}else{_0x4054c6=0xce;}_0x49e400[_0x5507('0x19')](_0x4054c6);return _0x49e400['set'](_0x5507('0x1e'),_0x233b6a+'-'+_0x3822dd+'/'+_0x3d1619)[_0x5507('0x1f')](_0x2dfd06);}return null;};}function patchUpdates(_0x1a54b0){return function(_0x3ca1f7){try{jsonpatch[_0x5507('0x20')](_0x3ca1f7,_0x1a54b0,!![]);}catch(_0x1be8b1){return BPromise['reject'](_0x1be8b1);}return _0x3ca1f7[_0x5507('0x21')]();};}function saveUpdates(_0x105535,_0x1f6325){return function(_0xa3e2cf){if(_0xa3e2cf){return _0xa3e2cf[_0x5507('0x22')](_0x105535)[_0x5507('0x23')](function(_0x1fcc8d){return _0x1fcc8d;});}return null;};}function removeEntity(_0x10f149,_0x398911){return function(_0xa47641){if(_0xa47641){return _0xa47641[_0x5507('0x24')]()[_0x5507('0x23')](function(){_0x10f149[_0x5507('0x19')](0xcc)[_0x5507('0x25')]();});}};}function handleEntityNotFound(_0x1a2203,_0x4915ed){return function(_0x4e8906){if(!_0x4e8906){_0x1a2203['sendStatus'](0x194);}return _0x4e8906;};}function handleError(_0x26335e,_0x4ea271){_0x4ea271=_0x4ea271||0x1f4;return function(_0xa66a01){logger[_0x5507('0x26')](_0xa66a01['stack']);if(_0xa66a01['name']){delete _0xa66a01[_0x5507('0x27')];}_0x26335e[_0x5507('0x19')](_0x4ea271)['send'](_0xa66a01);};}exports[_0x5507('0x28')]=function(_0x24574b,_0x85d383){var _0x38f4d9={},_0x1e5ce6={},_0x14fdea={'count':0x0,'rows':[]};var _0x55e889=_[_0x5507('0x29')](db[_0x5507('0x2a')][_0x5507('0x2b')],function(_0x38f0f5){return{'name':_0x38f0f5[_0x5507('0x2c')],'type':_0x38f0f5['type']['key']};});_0x1e5ce6[_0x5507('0x2d')]=_[_0x5507('0x2e')](_[_0x5507('0x29')](_0x55e889,_0x5507('0x27')),['format']);_0x1e5ce6[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x24574b[_0x5507('0x2f')]);_0x1e5ce6[_0x5507('0x31')]=_[_0x5507('0x32')](_0x1e5ce6[_0x5507('0x2d')],_0x1e5ce6[_0x5507('0x2f')]);_0x38f4d9[_0x5507('0x33')]=_['intersection'](_0x1e5ce6[_0x5507('0x2d')],qs[_0x5507('0x34')](_0x24574b[_0x5507('0x2f')]['fields']));_0x38f4d9['attributes']=_0x38f4d9[_0x5507('0x33')][_0x5507('0x35')]?_0x38f4d9[_0x5507('0x33')]:_0x1e5ce6[_0x5507('0x2d')];if(!_0x24574b[_0x5507('0x2f')]['hasOwnProperty']('nolimit')){_0x38f4d9[_0x5507('0x1c')]=qs[_0x5507('0x1c')](_0x24574b[_0x5507('0x2f')][_0x5507('0x1c')]);_0x38f4d9['offset']=qs['offset'](_0x24574b[_0x5507('0x2f')]['offset']);}_0x38f4d9[_0x5507('0x36')]=qs[_0x5507('0x37')](_0x24574b[_0x5507('0x2f')][_0x5507('0x37')]);_0x38f4d9[_0x5507('0x38')]=qs[_0x5507('0x31')](_[_0x5507('0x39')](_0x24574b[_0x5507('0x2f')],_0x1e5ce6[_0x5507('0x31')]),_0x55e889);if(_0x24574b[_0x5507('0x2f')]['filter']){_0x38f4d9['where']=_['merge'](_0x38f4d9['where'],{'$or':_[_0x5507('0x29')](_0x55e889,function(_0x2cf512){if(_0x2cf512[_0x5507('0x3a')]!==_0x5507('0x3b')){var _0x2b32a5={};_0x2b32a5[_0x2cf512[_0x5507('0x27')]]={'$like':'%'+_0x24574b[_0x5507('0x2f')][_0x5507('0x3c')]+'%'};return _0x2b32a5;}})});}_0x38f4d9=_[_0x5507('0x3d')]({},_0x38f4d9,_0x24574b[_0x5507('0x3e')]);var _0x3ec0ed={'where':_0x38f4d9[_0x5507('0x38')]};return db[_0x5507('0x2a')][_0x5507('0x1d')](_0x3ec0ed)['then'](function(_0x53b3f3){_0x14fdea['count']=_0x53b3f3;if(_0x24574b[_0x5507('0x2f')][_0x5507('0x3f')]){_0x38f4d9[_0x5507('0x40')]=[{'all':!![]}];}return db[_0x5507('0x2a')][_0x5507('0x41')](_0x38f4d9);})[_0x5507('0x23')](function(_0x340c4c){_0x14fdea[_0x5507('0x42')]=_0x340c4c;return _0x14fdea;})[_0x5507('0x23')](respondWithFilteredResult(_0x85d383,_0x38f4d9))[_0x5507('0x43')](handleError(_0x85d383,null));};exports[_0x5507('0x44')]=function(_0x192a00,_0x24d7b5){var _0x25496b={'raw':![],'where':{'id':_0x192a00[_0x5507('0x45')]['id']}},_0x1b3006={};_0x1b3006[_0x5507('0x2d')]=_[_0x5507('0x30')](db[_0x5507('0x2a')]['rawAttributes']);_0x1b3006[_0x5507('0x2f')]=_[_0x5507('0x30')](_0x192a00['query']);_0x1b3006['filters']=_[_0x5507('0x32')](_0x1b3006[_0x5507('0x2d')],_0x1b3006[_0x5507('0x2f')]);_0x25496b[_0x5507('0x33')]=_[_0x5507('0x32')](_0x1b3006['model'],qs[_0x5507('0x34')](_0x192a00[_0x5507('0x2f')][_0x5507('0x34')]));_0x25496b['attributes']=_0x25496b[_0x5507('0x33')][_0x5507('0x35')]?_0x25496b[_0x5507('0x33')]:_0x1b3006[_0x5507('0x2d')];if(_0x192a00[_0x5507('0x2f')]['includeAll']){_0x25496b[_0x5507('0x40')]=[{'all':!![]}];}_0x25496b=_['merge']({},_0x25496b,_0x192a00[_0x5507('0x3e')]);return db[_0x5507('0x2a')][_0x5507('0x46')](_0x25496b)[_0x5507('0x23')](handleEntityNotFound(_0x24d7b5,null))[_0x5507('0x23')](respondWithResult(_0x24d7b5,null))[_0x5507('0x43')](handleError(_0x24d7b5,null));};exports[_0x5507('0x47')]=function(_0x3452e4,_0x549cf0){return db[_0x5507('0x2a')][_0x5507('0x47')](_0x3452e4['body'],{})['then'](respondWithResult(_0x549cf0,0xc9))['catch'](handleError(_0x549cf0,null));};exports[_0x5507('0x22')]=function(_0x5961fd,_0x403d03){if(_0x5961fd['body']['id']){delete _0x5961fd[_0x5507('0x48')]['id'];}delete _0x5961fd['body']['duration'];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x49')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4a')];delete _0x5961fd[_0x5507('0x48')][_0x5507('0x4b')];return db['ScreenRecording'][_0x5507('0x46')]({'where':{'id':_0x5961fd[_0x5507('0x45')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x403d03,null))['then'](saveUpdates(_0x5961fd[_0x5507('0x48')],null))[_0x5507('0x23')](respondWithResult(_0x403d03,null))[_0x5507('0x43')](handleError(_0x403d03,null));};exports[_0x5507('0x4c')]=function(_0x300c9f,_0x3af70f){return db[_0x5507('0x2a')][_0x5507('0x4c')]()[_0x5507('0x23')](respondWithResult(_0x3af70f,null))[_0x5507('0x43')](handleError(_0x3af70f,null));};exports[_0x5507('0x4d')]=function(_0x49a2f8,_0x570928,_0x1992fa){var _0x5d7753=require(_0x5507('0x4e'));var _0x1b34c8=![];var _0xce851d={};if(_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]&&_0x49a2f8[_0x5507('0x2f')][_0x5507('0x3a')]===_0x5507('0x4f')){_0xce851d[_0x5507('0x4f')]=_0x49a2f8[_0x5507('0x45')]['id'];}else{_0xce851d['id']=_0x49a2f8[_0x5507('0x45')]['id'];}return db[_0x5507('0x2a')][_0x5507('0x46')]({'where':_0xce851d,'attributes':['id',_0x5507('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x570928,null))[_0x5507('0x23')](function(_0x56e0cd){if(_0x56e0cd){var _0x5af5f5=path[_0x5507('0x50')](config[_0x5507('0x51')],_0x5507('0x52'),_0x56e0cd[_0x5507('0x4b')]);var _0x52b9f2=util[_0x5507('0x53')](_0x5507('0x54'),_0x5af5f5);if(fs[_0x5507('0x55')](_0x52b9f2)){_0x1b34c8=!![];return _0x5d7753[_0x5507('0x56')](_0x52b9f2,_0x5af5f5,config[_0x5507('0x57')][_0x5507('0x58')])['then'](function(){return _0x56e0cd;});}return _0x56e0cd;}})[_0x5507('0x23')](function(_0x46e589){if(_0x46e589){var _0x3a2f9f=path['join'](config['root'],_0x5507('0x52'),_0x46e589['value']);if(!fs[_0x5507('0x55')](_0x3a2f9f)){throw new db[(_0x5507('0x59'))]['ValidationError'](_0x5507('0x5a'));}if(_0x46e589[_0x5507('0x5b')]){return _0x570928[_0x5507('0x4d')](_0x3a2f9f,_0x46e589[_0x5507('0x5b')]+path[_0x5507('0x5c')](_0x3a2f9f),function(){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}else{return _0x570928[_0x5507('0x4d')](_0x3a2f9f,function(_0x2928f2){if(_0x1b34c8){fs[_0x5507('0x5d')](_0x3a2f9f);}});}}})[_0x5507('0x43')](function(_0x1453f1){if(_0x1453f1[_0x5507('0x5e')]==='ScreenRecording\x20not\x20found'){_0x570928[_0x5507('0x19')](0x194)[_0x5507('0x5f')](_0x5507('0x60'));}else{return handleError(_0x570928,null);}});};exports[_0x5507('0x24')]=function(_0x3c4422,_0x5183ae){return db[_0x5507('0x2a')]['find']({'where':{'id':_0x3c4422[_0x5507('0x45')]['id']}})[_0x5507('0x23')](function(_0x241733){if(_['isNil'](_0x241733)){throw new ReferenceError(_0x5507('0x61'));}return _0x241733;})[_0x5507('0x23')](function(_0x2a9672){var _0x56632b=path[_0x5507('0x50')](config['root'],_0x5507('0x52'),_0x2a9672['value']);logger['info'](_0x5507('0x62'),_0x56632b);if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger[_0x5507('0x64')](_0x5507('0x65')+_0x56632b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x56632b);}_0x56632b=_0x56632b+_0x5507('0x66');if(!_[_0x5507('0x63')](_0x2a9672[_0x5507('0x4b')])&&fs[_0x5507('0x55')](_0x56632b)){logger['info'](_0x5507('0x65')+_0x56632b+_0x5507('0x67'));fs[_0x5507('0x68')](_0x56632b);}return _0x2a9672;})[_0x5507('0x23')](function(_0x296cf5){if(!_0x296cf5)throw new InternalError();return _0x296cf5[_0x5507('0x24')]();})[_0x5507('0x23')](function(){_0x5183ae['status'](0xcc)[_0x5507('0x25')]();})[_0x5507('0x43')](handleError(_0x5183ae,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5d596dd..c9ffd30 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 _0xd6f2=['interactionid','util','api','moment','request-promise','path','../../config/environment','exports','ScreenRecording'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xd6f2,0x1b1));var _0x2d6f=function(_0x1e81d2,_0x25dbda){_0x1e81d2=_0x1e81d2-0x0;var _0x1ea265=_0xd6f2[_0x1e81d2];return _0x1ea265;};'use strict';var _=require('lodash');var util=require(_0x2d6f('0x0'));var logger=require('../../config/logger')(_0x2d6f('0x1'));var moment=require(_0x2d6f('0x2'));var BPromise=require('bluebird');var rp=require(_0x2d6f('0x3'));var fs=require('fs');var path=require(_0x2d6f('0x4'));var rimraf=require('rimraf');var config=require(_0x2d6f('0x5'));var attributes=require('./screenRecording.attributes');module[_0x2d6f('0x6')]=function(_0x2ba25a,_0x2628cb){return _0x2ba25a['define'](_0x2d6f('0x7'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x2d6f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c57=['lodash','util','api','moment','bluebird','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0c57,0x84));var _0x70c5=function(_0x3ef17b,_0x370e39){_0x3ef17b=_0x3ef17b-0x0;var _0x108471=_0x0c57[_0x3ef17b];return _0x108471;};'use strict';var _=require(_0x70c5('0x0'));var util=require(_0x70c5('0x1'));var logger=require('../../config/logger')(_0x70c5('0x2'));var moment=require(_0x70c5('0x3'));var BPromise=require(_0x70c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x70c5('0x5'));var config=require(_0x70c5('0x6'));var attributes=require(_0x70c5('0x7'));module[_0x70c5('0x8')]=function(_0x314f07,_0x3a98e1){return _0x314f07['define'](_0x70c5('0x9'),attributes,{'tableName':_0x70c5('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a7772e3..14a818c 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 _0xb978=['http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0xb978,0x123));var _0x8b97=function(_0x2b7be3,_0x354e7a){_0x2b7be3=_0x2b7be3-0x0;var _0x162e27=_0xb978[_0x2b7be3];return _0x162e27;};'use strict';var _=require(_0x8b97('0x0'));var util=require(_0x8b97('0x1'));var moment=require('moment');var BPromise=require(_0x8b97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b97('0x3'));var db=require(_0x8b97('0x4'))['db'];var utils=require(_0x8b97('0x5'));var logger=require('../../config/logger')(_0x8b97('0x6'));var config=require('../../config/environment');var jayson=require(_0x8b97('0x7'));var client=jayson[_0x8b97('0x8')][_0x8b97('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a247d,_0x430b62,_0x475c91){return new BPromise(function(_0x1afd1a,_0x3703eb){return client[_0x8b97('0xa')](_0x3a247d,_0x475c91)[_0x8b97('0xb')](function(_0x104ca1){logger[_0x8b97('0xc')](_0x8b97('0xd'),_0x430b62,'request\x20sent');logger[_0x8b97('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x430b62,_0x8b97('0xf'),JSON[_0x8b97('0x10')](_0x104ca1));if(_0x104ca1[_0x8b97('0x11')]){if(_0x104ca1[_0x8b97('0x11')][_0x8b97('0x12')]===0x1f4){logger[_0x8b97('0x11')](_0x8b97('0xd'),_0x430b62,_0x104ca1[_0x8b97('0x11')][_0x8b97('0x13')]);return _0x3703eb(_0x104ca1['error']['message']);}logger[_0x8b97('0x11')](_0x8b97('0xd'),_0x430b62,_0x104ca1['error']['message']);return _0x1afd1a(_0x104ca1[_0x8b97('0x11')][_0x8b97('0x13')]);}else{logger[_0x8b97('0xc')](_0x8b97('0xd'),_0x430b62,'request\x20sent');_0x1afd1a(_0x104ca1['result']['message']);}})['catch'](function(_0x308578){logger['error'](_0x8b97('0xd'),_0x430b62,_0x308578);_0x3703eb(_0x308578);});});} \ No newline at end of file +var _0x810e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x379fd8,_0x247c30){var _0x2d8502=function(_0x11a2b5){while(--_0x11a2b5){_0x379fd8['push'](_0x379fd8['shift']());}};_0x2d8502(++_0x247c30);}(_0x810e,0x7d));var _0xe810=function(_0x55ec86,_0x1047ba){_0x55ec86=_0x55ec86-0x0;var _0x54340d=_0x810e[_0x55ec86];return _0x54340d;};'use strict';var _=require(_0xe810('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe810('0x1'));var fs=require('fs');var Redis=require(_0xe810('0x2'));var db=require(_0xe810('0x3'))['db'];var utils=require(_0xe810('0x4'));var logger=require(_0xe810('0x5'))(_0xe810('0x6'));var config=require(_0xe810('0x7'));var jayson=require(_0xe810('0x8'));var client=jayson[_0xe810('0x9')][_0xe810('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ab0,_0x3cf888,_0x4ef9c9){return new BPromise(function(_0x4bbc17,_0x4ca579){return client['request'](_0x175ab0,_0x4ef9c9)['then'](function(_0x3a4a1c){logger[_0xe810('0xb')](_0xe810('0xc'),_0x3cf888,_0xe810('0xd'));logger[_0xe810('0xe')](_0xe810('0xf'),_0x3cf888,'request\x20sent',JSON[_0xe810('0x10')](_0x3a4a1c));if(_0x3a4a1c['error']){if(_0x3a4a1c[_0xe810('0x11')][_0xe810('0x12')]===0x1f4){logger[_0xe810('0x11')](_0xe810('0xc'),_0x3cf888,_0x3a4a1c['error'][_0xe810('0x13')]);return _0x4ca579(_0x3a4a1c[_0xe810('0x11')][_0xe810('0x13')]);}logger[_0xe810('0x11')](_0xe810('0xc'),_0x3cf888,_0x3a4a1c[_0xe810('0x11')][_0xe810('0x13')]);return _0x4bbc17(_0x3a4a1c[_0xe810('0x11')]['message']);}else{logger[_0xe810('0xb')](_0xe810('0xc'),_0x3cf888,'request\x20sent');_0x4bbc17(_0x3a4a1c['result'][_0xe810('0x13')]);}})[_0xe810('0x14')](function(_0x5f27ab){logger[_0xe810('0x11')](_0xe810('0xc'),_0x3cf888,_0x5f27ab);_0x4ca579(_0x5f27ab);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 30234c5..1b6aff9 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 _0xf111=['server/files/images/logos/','%s%s','logologin','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','format','logo','extname','originalname','post','single','root'];(function(_0x500d15,_0x5d0dde){var _0x45a955=function(_0xe025aa){while(--_0xe025aa){_0x500d15['push'](_0x500d15['shift']());}};_0x45a955(++_0x5d0dde);}(_0xf111,0x198));var _0x1f11=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0xf111[_0x1196b0];return _0x111c52;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1f11('0x0'));var express=require(_0x1f11('0x1'));var router=express[_0x1f11('0x2')]();var fs_extra=require(_0x1f11('0x3'));var auth=require(_0x1f11('0x4'));var interaction=require(_0x1f11('0x5'));var config=require(_0x1f11('0x6'));var controller=require(_0x1f11('0x7'));router['get']('/',auth[_0x1f11('0x8')](),controller[_0x1f11('0x9')]);router[_0x1f11('0xa')](_0x1f11('0xb'),controller[_0x1f11('0xc')]);router[_0x1f11('0xa')](_0x1f11('0xd'),controller['show']);router[_0x1f11('0xa')](_0x1f11('0xe'),controller[_0x1f11('0xf')]);router['get'](_0x1f11('0x10'),controller[_0x1f11('0x11')]);router[_0x1f11('0xa')](_0x1f11('0x12'),controller[_0x1f11('0x13')]);router['get'](_0x1f11('0x14'),controller[_0x1f11('0x15')]);router['get']('/:id/favicon',controller[_0x1f11('0x16')]);var upload=multer({'storage':multer[_0x1f11('0x17')]({'destination':function(_0x2550eb,_0x872de5,_0x42fede){_0x42fede(null,path[_0x1f11('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x32c342,_0x501317,_0x3edf12){_0x3edf12(null,util[_0x1f11('0x19')]('%s%s',_0x1f11('0x1a'),path[_0x1f11('0x1b')](_0x501317[_0x1f11('0x1c')])));}})});router[_0x1f11('0x1d')](_0x1f11('0xe'),upload[_0x1f11('0x1e')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x1f11('0x17')]({'destination':function(_0x4ebaec,_0x3c4865,_0x11bcf0){_0x11bcf0(null,path[_0x1f11('0x18')](config[_0x1f11('0x1f')],_0x1f11('0x20')));},'filename':function(_0x1c660b,_0xb10384,_0x4b43bb){_0x4b43bb(null,util[_0x1f11('0x19')](_0x1f11('0x21'),_0x1f11('0x22'),path[_0x1f11('0x1b')](_0xb10384[_0x1f11('0x1c')])));}})});router[_0x1f11('0x1d')]('/:id/logo_login',upload[_0x1f11('0x1e')](_0x1f11('0x23')),controller[_0x1f11('0x24')]);var upload=multer({'storage':multer[_0x1f11('0x17')]({'destination':function(_0x159dec,_0x5df54b,_0x231705){_0x231705(null,path[_0x1f11('0x18')](config[_0x1f11('0x1f')],_0x1f11('0x20')));},'filename':function(_0x193ad7,_0x2e5c6d,_0x894519){_0x894519(null,util['format']('%s%s',_0x1f11('0x25'),path[_0x1f11('0x1b')](_0x2e5c6d['originalname'])));}})});router['post'](_0x1f11('0x14'),upload[_0x1f11('0x1e')]('file'),controller[_0x1f11('0x26')]);var upload=multer({'storage':multer[_0x1f11('0x17')]({'destination':function(_0x2dd41f,_0x5b0957,_0x2b998c){_0x2b998c(null,path[_0x1f11('0x18')](config[_0x1f11('0x1f')],'server/files/images/logos/'));},'filename':function(_0x35ebdf,_0x1c9f05,_0x21583d){_0x21583d(null,util[_0x1f11('0x19')](_0x1f11('0x21'),_0x1f11('0x27'),path[_0x1f11('0x1b')](_0x1c9f05[_0x1f11('0x1c')])));}})});router[_0x1f11('0x1d')]('/:id/favicon',upload[_0x1f11('0x1e')](_0x1f11('0x23')),controller[_0x1f11('0x28')]);router[_0x1f11('0x29')]('/:id',auth[_0x1f11('0x8')](),controller[_0x1f11('0x2a')]);module[_0x1f11('0x2b')]=router; \ No newline at end of file +var _0x2542=['gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','originalname','post','single','file','addLogo','format','logologin','/:id/logo_login','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr'];(function(_0x3fbb30,_0x5d6fc8){var _0x42551c=function(_0x3603f6){while(--_0x3603f6){_0x3fbb30['push'](_0x3fbb30['shift']());}};_0x42551c(++_0x5d6fc8);}(_0x2542,0x114));var _0x2254=function(_0xe011cd,_0x279c15){_0xe011cd=_0xe011cd-0x0;var _0x1c2c5f=_0x2542[_0xe011cd];return _0x1c2c5f;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require('path');var timeout=require(_0x2254('0x2'));var express=require('express');var router=express[_0x2254('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x4'));var interaction=require(_0x2254('0x5'));var config=require(_0x2254('0x6'));var controller=require(_0x2254('0x7'));router[_0x2254('0x8')]('/',auth[_0x2254('0x9')](),controller[_0x2254('0xa')]);router[_0x2254('0x8')](_0x2254('0xb'),controller['getDate']);router[_0x2254('0x8')](_0x2254('0xc'),controller[_0x2254('0xd')]);router[_0x2254('0x8')](_0x2254('0xe'),controller[_0x2254('0xf')]);router[_0x2254('0x8')]('/:id/logo_login',controller[_0x2254('0x10')]);router[_0x2254('0x8')](_0x2254('0x11'),controller[_0x2254('0x12')]);router['get']('/:id/preferred',controller['getPreferred']);router[_0x2254('0x8')](_0x2254('0x13'),controller[_0x2254('0x14')]);var upload=multer({'storage':multer[_0x2254('0x15')]({'destination':function(_0x265df9,_0x9275cb,_0x3b4957){_0x3b4957(null,path[_0x2254('0x16')](config[_0x2254('0x17')],_0x2254('0x18')));},'filename':function(_0x6ddce1,_0x116c28,_0x3c605b){_0x3c605b(null,util['format'](_0x2254('0x19'),'logo',path[_0x2254('0x1a')](_0x116c28[_0x2254('0x1b')])));}})});router[_0x2254('0x1c')]('/:id/logo',upload[_0x2254('0x1d')](_0x2254('0x1e')),controller[_0x2254('0x1f')]);var upload=multer({'storage':multer[_0x2254('0x15')]({'destination':function(_0x20aec1,_0x21af96,_0x41f67b){_0x41f67b(null,path[_0x2254('0x16')](config[_0x2254('0x17')],_0x2254('0x18')));},'filename':function(_0x465c2a,_0x147e35,_0x1132fe){_0x1132fe(null,util[_0x2254('0x20')]('%s%s',_0x2254('0x21'),path[_0x2254('0x1a')](_0x147e35[_0x2254('0x1b')])));}})});router[_0x2254('0x1c')](_0x2254('0x22'),upload[_0x2254('0x1d')](_0x2254('0x1e')),controller[_0x2254('0x23')]);var upload=multer({'storage':multer[_0x2254('0x15')]({'destination':function(_0x33ed98,_0x3341fe,_0x41e908){_0x41e908(null,path[_0x2254('0x16')](config[_0x2254('0x17')],'server/files/images/logos/'));},'filename':function(_0x2cca69,_0x30ae9b,_0x8f79f0){_0x8f79f0(null,util[_0x2254('0x20')](_0x2254('0x19'),_0x2254('0x24'),path['extname'](_0x30ae9b[_0x2254('0x1b')])));}})});router[_0x2254('0x1c')](_0x2254('0x25'),upload['single']('file'),controller[_0x2254('0x26')]);var upload=multer({'storage':multer[_0x2254('0x15')]({'destination':function(_0x104bbe,_0x5abb6f,_0x5c5496){_0x5c5496(null,path[_0x2254('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x24cd79,_0x54cfbc,_0x396afb){_0x396afb(null,util['format'](_0x2254('0x19'),_0x2254('0x27'),path[_0x2254('0x1a')](_0x54cfbc[_0x2254('0x1b')])));}})});router[_0x2254('0x1c')](_0x2254('0x13'),upload['single'](_0x2254('0x1e')),controller[_0x2254('0x28')]);router['put'](_0x2254('0xc'),auth[_0x2254('0x9')](),controller['update']);module[_0x2254('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 3b4b181..b9a7302 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x593c49,_0x385ade){var _0x2926fb=function(_0x4c7ed0){while(--_0x4c7ed0){_0x593c49['push'](_0x593c49['shift']());}};_0x2926fb(++_0x385ade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x36aeda,_0x1a7415){var _0x15cd3b=function(_0x5eea7f){while(--_0x5eea7f){_0x36aeda['push'](_0x36aeda['shift']());}};_0x15cd3b(++_0x1a7415);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 62f672d..45ff139 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 _0x7047=['defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','custom','getDate','utcOffset','now','format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','body','find','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7047,0x10d));var _0x7704=function(_0x26a57d,_0x32a6d6){_0x26a57d=_0x26a57d-0x0;var _0x51edf9=_0x7047[_0x26a57d];return _0x51edf9;};'use strict';var emlformat=require(_0x7704('0x0'));var rimraf=require(_0x7704('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7704('0x2'));var moment=require(_0x7704('0x3'));var BPromise=require(_0x7704('0x4'));var Mustache=require(_0x7704('0x5'));var util=require(_0x7704('0x6'));var path=require(_0x7704('0x7'));var sox=require(_0x7704('0x8'));var csv=require(_0x7704('0x9'));var ejs=require(_0x7704('0xa'));var fs=require('fs');var fs_extra=require(_0x7704('0xb'));var _=require(_0x7704('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7704('0xd'));var deskjs=require(_0x7704('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7704('0xf'));var Papa=require(_0x7704('0x10'));var Redis=require(_0x7704('0x11'));var authService=require(_0x7704('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7704('0x13'));var logger=require(_0x7704('0x14'))(_0x7704('0x15'));var utils=require(_0x7704('0x16'));var config=require(_0x7704('0x17'));var licenseUtil=require(_0x7704('0x18'));var db=require(_0x7704('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7704('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbda615,_0x76e495,_0x4fdcb3,_0x4006d9){return new BPromise(function(_0x48f49d,_0x278842){var _0x41dc1d=_0x4006d9||client;return _0x41dc1d[_0x7704('0x1b')](_0xbda615,_0x4fdcb3)['then'](function(_0x5d9d06){logger['info'](_0x7704('0x1c'),_0x76e495,_0x7704('0x1d'));logger[_0x7704('0x1e')](_0x7704('0x1f'),_0x76e495,_0x7704('0x1d'),JSON[_0x7704('0x20')](_0x5d9d06));if(_0x5d9d06[_0x7704('0x21')]){if(_0x5d9d06[_0x7704('0x21')][_0x7704('0x22')]===0x1f4){logger[_0x7704('0x21')]('Setting,\x20%s,\x20%s',_0x76e495,_0x5d9d06['error'][_0x7704('0x23')]);return _0x278842(_0x5d9d06[_0x7704('0x21')][_0x7704('0x23')]);}logger[_0x7704('0x21')](_0x7704('0x1c'),_0x76e495,_0x5d9d06[_0x7704('0x21')][_0x7704('0x23')]);return _0x48f49d(_0x5d9d06[_0x7704('0x21')][_0x7704('0x23')]);}else{logger[_0x7704('0x24')](_0x7704('0x1c'),_0x76e495,_0x7704('0x1d'));_0x48f49d(_0x5d9d06['result'][_0x7704('0x23')]);}})[_0x7704('0x25')](function(_0x37f267){logger[_0x7704('0x21')](_0x7704('0x1c'),_0x76e495,_0x37f267);_0x278842(_0x37f267);});});}function respondWithStatusCode(_0x2d8eb5,_0x373ba5){_0x373ba5=_0x373ba5||0xcc;return function(_0x37b4b3){if(_0x37b4b3){return _0x2d8eb5[_0x7704('0x26')](_0x373ba5);}return _0x2d8eb5[_0x7704('0x27')](_0x373ba5)['end']();};}function respondWithResult(_0x1f5ca9,_0x29e4a6){_0x29e4a6=_0x29e4a6||0xc8;return function(_0x2da532){if(_0x2da532){return _0x1f5ca9[_0x7704('0x27')](_0x29e4a6)[_0x7704('0x28')](_0x2da532);}};}function respondWithFilteredResult(_0x38bd57,_0x45ea79){return function(_0x3e0a18){if(_0x3e0a18){var _0x30c39a=typeof _0x45ea79[_0x7704('0x29')]===_0x7704('0x2a')&&typeof _0x45ea79[_0x7704('0x2b')]==='undefined';var _0x46ce71=_0x3e0a18['count'];var _0x55e9ae=_0x30c39a?0x0:_0x45ea79[_0x7704('0x29')];var _0x28e513=_0x30c39a?_0x3e0a18[_0x7704('0x2c')]:_0x45ea79[_0x7704('0x29')]+_0x45ea79['limit'];var _0x710093;if(_0x28e513>=_0x46ce71){_0x28e513=_0x46ce71;_0x710093=0xc8;}else{_0x710093=0xce;}_0x38bd57[_0x7704('0x27')](_0x710093);return _0x38bd57[_0x7704('0x2d')](_0x7704('0x2e'),_0x55e9ae+'-'+_0x28e513+'/'+_0x46ce71)[_0x7704('0x28')](_0x3e0a18);}return null;};}function patchUpdates(_0x5d9a8a){return function(_0x137647){try{jsonpatch[_0x7704('0x2f')](_0x137647,_0x5d9a8a,!![]);}catch(_0x20f96){return BPromise[_0x7704('0x30')](_0x20f96);}return _0x137647[_0x7704('0x31')]();};}function saveUpdates(_0x52f691,_0x4820e7){return function(_0x5e8747){if(_0x5e8747){return _0x5e8747[_0x7704('0x32')](_0x52f691)[_0x7704('0x33')](function(_0xd12ac1){return _0xd12ac1;});}return null;};}function removeEntity(_0x2ff55c,_0x1596a4){return function(_0x53762f){if(_0x53762f){return _0x53762f[_0x7704('0x34')]()['then'](function(){_0x2ff55c[_0x7704('0x27')](0xcc)[_0x7704('0x35')]();});}};}function handleEntityNotFound(_0x58b88e,_0x3f2cff){return function(_0x3fddd9){if(!_0x3fddd9){_0x58b88e[_0x7704('0x26')](0x194);}return _0x3fddd9;};}function handleError(_0x6bc000,_0x2ce65f){_0x2ce65f=_0x2ce65f||0x1f4;return function(_0x438317){logger[_0x7704('0x21')](_0x438317['stack']);if(_0x438317[_0x7704('0x36')]){delete _0x438317[_0x7704('0x36')];}_0x6bc000[_0x7704('0x27')](_0x2ce65f)[_0x7704('0x37')](_0x438317);};}exports[_0x7704('0x38')]=function(_0x27a882,_0x3f62c9){var _0x3199d={},_0x2a02ca={},_0xe51f3a={'count':0x0,'rows':[]};var _0x227714=_[_0x7704('0x39')](db[_0x7704('0x3a')][_0x7704('0x3b')],function(_0x50c17c){return{'name':_0x50c17c[_0x7704('0x3c')],'type':_0x50c17c[_0x7704('0x3d')][_0x7704('0x3e')]};});_0x2a02ca[_0x7704('0x3f')]=_[_0x7704('0x39')](_0x227714,_0x7704('0x36'));_0x2a02ca[_0x7704('0x40')]=_[_0x7704('0x41')](_0x27a882[_0x7704('0x40')]);_0x2a02ca[_0x7704('0x42')]=_['intersection'](_0x2a02ca[_0x7704('0x3f')],_0x2a02ca['query']);_0x3199d[_0x7704('0x43')]=_[_0x7704('0x44')](_0x2a02ca['model'],qs[_0x7704('0x45')](_0x27a882[_0x7704('0x40')][_0x7704('0x45')]));_0x3199d[_0x7704('0x43')]=_0x3199d[_0x7704('0x43')]['length']?_0x3199d[_0x7704('0x43')]:_0x2a02ca[_0x7704('0x3f')];if(!_0x27a882[_0x7704('0x40')][_0x7704('0x46')]('nolimit')){_0x3199d[_0x7704('0x2b')]=qs['limit'](_0x27a882[_0x7704('0x40')][_0x7704('0x2b')]);_0x3199d[_0x7704('0x29')]=qs['offset'](_0x27a882['query'][_0x7704('0x29')]);}_0x3199d[_0x7704('0x47')]=qs[_0x7704('0x48')](_0x27a882[_0x7704('0x40')][_0x7704('0x48')]);_0x3199d[_0x7704('0x49')]=qs[_0x7704('0x42')](_['pick'](_0x27a882[_0x7704('0x40')],_0x2a02ca[_0x7704('0x42')]),_0x227714);if(_0x27a882[_0x7704('0x40')]['filter']){_0x3199d[_0x7704('0x49')]=_[_0x7704('0x4a')](_0x3199d['where'],{'$or':_['map'](_0x227714,function(_0x367e3d){if(_0x367e3d['type']!==_0x7704('0x4b')){var _0x4994d0={};_0x4994d0[_0x367e3d['name']]={'$like':'%'+_0x27a882[_0x7704('0x40')][_0x7704('0x4c')]+'%'};return _0x4994d0;}})});}_0x3199d=_[_0x7704('0x4a')]({},_0x3199d,_0x27a882[_0x7704('0x4d')]);var _0x3914f8={'where':_0x3199d[_0x7704('0x49')]};return db['Setting']['count'](_0x3914f8)[_0x7704('0x33')](function(_0x31d58e){_0xe51f3a[_0x7704('0x2c')]=_0x31d58e;if(_0x27a882[_0x7704('0x40')][_0x7704('0x4e')]){_0x3199d[_0x7704('0x4f')]=[{'all':!![]}];}return db['Setting'][_0x7704('0x50')](_0x3199d);})['then'](function(_0xcd7450){_0xe51f3a[_0x7704('0x51')]=_0xcd7450;return _0xe51f3a;})[_0x7704('0x33')](respondWithFilteredResult(_0x3f62c9,_0x3199d))[_0x7704('0x25')](handleError(_0x3f62c9,null));};exports[_0x7704('0x52')]=function(_0x27a66c,_0x228c45){var _0xc12756={'raw':![],'where':{'id':_0x27a66c[_0x7704('0x53')]['id']}},_0x4611e3={};_0x4611e3['model']=_[_0x7704('0x41')](db['Setting']['rawAttributes']);_0x4611e3[_0x7704('0x40')]=_[_0x7704('0x41')](_0x27a66c['query']);_0x4611e3[_0x7704('0x42')]=_[_0x7704('0x44')](_0x4611e3[_0x7704('0x3f')],_0x4611e3[_0x7704('0x40')]);_0xc12756['attributes']=_[_0x7704('0x44')](_0x4611e3['model'],qs[_0x7704('0x45')](_0x27a66c[_0x7704('0x40')][_0x7704('0x45')]));_0xc12756['attributes']=_0xc12756['attributes']['length']?_0xc12756['attributes']:_0x4611e3[_0x7704('0x3f')];if(_0x27a66c[_0x7704('0x40')][_0x7704('0x4e')]){_0xc12756[_0x7704('0x4f')]=[{'all':!![]}];}_0xc12756=_[_0x7704('0x4a')]({},_0xc12756,_0x27a66c[_0x7704('0x4d')]);return db['Setting']['find'](_0xc12756)[_0x7704('0x33')](handleEntityNotFound(_0x228c45,null))['then'](respondWithResult(_0x228c45,null))[_0x7704('0x25')](handleError(_0x228c45,null));};exports[_0x7704('0x32')]=function(_0x48ed4f,_0x5c17cb){if(_0x48ed4f[_0x7704('0x54')]['id']){delete _0x48ed4f[_0x7704('0x54')]['id'];}return db[_0x7704('0x3a')][_0x7704('0x55')]({'where':{'id':_0x48ed4f[_0x7704('0x53')]['id']}})[_0x7704('0x33')](handleEntityNotFound(_0x5c17cb,null))['then'](saveUpdates(_0x48ed4f[_0x7704('0x54')],null))[_0x7704('0x33')](respondWithResult(_0x5c17cb,null))[_0x7704('0x25')](handleError(_0x5c17cb,null));};exports['addLogo']=function(_0x29d95e,_0x187de3,_0x24e13c){if(_0x29d95e[_0x7704('0x56')]&&_0x29d95e['file']['filename']){_0x29d95e[_0x7704('0x54')][_0x7704('0x57')]=_0x29d95e[_0x7704('0x56')][_0x7704('0x58')];}return db['Setting']['find']({'where':{'id':_0x29d95e[_0x7704('0x53')]['id']}})[_0x7704('0x33')](handleEntityNotFound(_0x187de3,null))['then'](saveUpdates(_0x29d95e['body'],null))[_0x7704('0x33')](respondWithResult(_0x187de3,null))[_0x7704('0x25')](handleError(_0x187de3,null));};exports[_0x7704('0x59')]=function(_0x11a216,_0x274ce9,_0x85ae4b){if(_0x11a216[_0x7704('0x56')]&&_0x11a216['file'][_0x7704('0x58')]){_0x11a216[_0x7704('0x54')][_0x7704('0x5a')]=_0x11a216[_0x7704('0x56')][_0x7704('0x58')];}return db[_0x7704('0x3a')][_0x7704('0x55')]({'where':{'id':_0x11a216['params']['id']}})['then'](handleEntityNotFound(_0x274ce9,null))[_0x7704('0x33')](saveUpdates(_0x11a216[_0x7704('0x54')],null))[_0x7704('0x33')](respondWithResult(_0x274ce9,null))[_0x7704('0x25')](handleError(_0x274ce9,null));};var utilLicense=require(_0x7704('0x18'));exports[_0x7704('0x5b')]=function(_0x161f72,_0x4518ca,_0x290497){var _0x51e9c3=_0x7704('0x5c');var _0x21a8e3={'custom':![]};return utilLicense[_0x7704('0x5d')]()[_0x7704('0x33')](function(_0x10d99f){if(_0x10d99f){_0x21a8e3=_0x10d99f;}return db['Setting'][_0x7704('0x55')]({'where':{'id':_0x161f72[_0x7704('0x53')]['id']},'attributes':[_0x7704('0x57'),'loginLogo',_0x7704('0x5e'),_0x7704('0x5f'),_0x7704('0x60'),'defaultLoginLogo','defaultPreferred',_0x7704('0x61')],'raw':!![]});})[_0x7704('0x33')](handleEntityNotFound(_0x4518ca,null))[_0x7704('0x33')](function(_0x586b9f){if(_0x586b9f){var _0x1a72ba=_0x586b9f[_0x7704('0x57')]&&fs[_0x7704('0x62')](path['join'](config[_0x7704('0x63')],_0x51e9c3,_[_0x7704('0x64')](_0x586b9f['logo'])))?path[_0x7704('0x65')](config['root'],_0x51e9c3,_[_0x7704('0x64')](_0x586b9f[_0x7704('0x57')])):path[_0x7704('0x65')](config['root'],_0x51e9c3,_[_0x7704('0x64')](_0x7704('0x66')));var _0x3c1558=_0x7704('0x67')+_[_0x7704('0x68')](_0x7704('0x57'));if(_0x586b9f[_0x3c1558]||!_0x21a8e3['custom']){_0x1a72ba=path['join'](config[_0x7704('0x63')],_0x51e9c3,_[_0x7704('0x64')]('default_logo.svg'));}if(!fs[_0x7704('0x62')](_0x1a72ba)){throw new db[(_0x7704('0x69'))][(_0x7704('0x6a'))](_[_0x7704('0x68')](_0x7704('0x57'))+_0x7704('0x6b'));}return _0x4518ca[_0x7704('0x6c')](_0x1a72ba);}})['catch'](handleError(_0x4518ca,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x4ad341,_0x954064,_0x3e06ff){var _0x29a1a9=_0x7704('0x5c');var _0x145162={'custom':![]};return utilLicense[_0x7704('0x5d')]()[_0x7704('0x33')](function(_0x21a8fb){if(_0x21a8fb){_0x145162=_0x21a8fb;}return db[_0x7704('0x3a')][_0x7704('0x55')]({'where':{'id':_0x4ad341[_0x7704('0x53')]['id']},'attributes':[_0x7704('0x57'),'loginLogo',_0x7704('0x5e'),'favicon',_0x7704('0x60'),_0x7704('0x6d'),_0x7704('0x6e'),_0x7704('0x61')],'raw':!![]});})[_0x7704('0x33')](handleEntityNotFound(_0x954064,null))[_0x7704('0x33')](function(_0x412960){if(_0x412960){var _0x28e807=_0x412960[_0x7704('0x5a')]&&fs['existsSync'](path[_0x7704('0x65')](config['root'],_0x29a1a9,_['toLower'](_0x412960[_0x7704('0x5a')])))?path[_0x7704('0x65')](config['root'],_0x29a1a9,_['toLower'](_0x412960[_0x7704('0x5a')])):path[_0x7704('0x65')](config[_0x7704('0x63')],_0x29a1a9,_[_0x7704('0x64')](_0x7704('0x6f')));var _0x11a018=_0x7704('0x67')+_[_0x7704('0x68')](_0x7704('0x5a'));if(_0x412960[_0x11a018]||!_0x145162['custom']){_0x28e807=path[_0x7704('0x65')](config[_0x7704('0x63')],_0x29a1a9,_[_0x7704('0x64')](_0x7704('0x6f')));}if(!fs[_0x7704('0x62')](_0x28e807)){throw new db[(_0x7704('0x69'))]['ValidationError'](_[_0x7704('0x68')](_0x7704('0x5a'))+'\x20not\x20found');}return _0x954064[_0x7704('0x6c')](_0x28e807);}})[_0x7704('0x25')](handleError(_0x954064,null));};exports[_0x7704('0x70')]=function(_0x8c85d7,_0x3f3e3e){return db[_0x7704('0x3a')][_0x7704('0x55')]({'where':{'id':_0x8c85d7[_0x7704('0x53')]['id']},'attributes':[_0x7704('0x71')]})[_0x7704('0x33')](respondWithResult(_0x3f3e3e,null))[_0x7704('0x25')](handleError(_0x3f3e3e,null));};exports[_0x7704('0x72')]=function(_0x5afbb2,_0x14d2f3,_0x174254){if(_0x5afbb2[_0x7704('0x56')]&&_0x5afbb2[_0x7704('0x56')][_0x7704('0x58')]){_0x5afbb2[_0x7704('0x54')]['preferred']=_0x5afbb2[_0x7704('0x56')][_0x7704('0x58')];}return db[_0x7704('0x3a')]['find']({'where':{'id':_0x5afbb2['params']['id']}})['then'](handleEntityNotFound(_0x14d2f3,null))['then'](saveUpdates(_0x5afbb2['body'],null))['then'](respondWithResult(_0x14d2f3,null))[_0x7704('0x25')](handleError(_0x14d2f3,null));};var utilLicense=require(_0x7704('0x18'));exports[_0x7704('0x73')]=function(_0x2df289,_0x402b41,_0x12a3d7){var _0x395d33=_0x7704('0x5c');var _0x47d926={'custom':![]};return utilLicense[_0x7704('0x5d')]()['then'](function(_0xaa9d90){if(_0xaa9d90){_0x47d926=_0xaa9d90;}return db[_0x7704('0x3a')][_0x7704('0x55')]({'where':{'id':_0x2df289[_0x7704('0x53')]['id']},'attributes':[_0x7704('0x57'),'loginLogo',_0x7704('0x5e'),'favicon',_0x7704('0x60'),_0x7704('0x6d'),_0x7704('0x6e'),_0x7704('0x61')],'raw':!![]});})[_0x7704('0x33')](handleEntityNotFound(_0x402b41,null))[_0x7704('0x33')](function(_0x30989e){if(_0x30989e){var _0x5e26d4=_0x30989e[_0x7704('0x5e')]&&fs[_0x7704('0x62')](path[_0x7704('0x65')](config[_0x7704('0x63')],_0x395d33,_['toLower'](_0x30989e[_0x7704('0x5e')])))?path[_0x7704('0x65')](config[_0x7704('0x63')],_0x395d33,_[_0x7704('0x64')](_0x30989e[_0x7704('0x5e')])):path[_0x7704('0x65')](config[_0x7704('0x63')],_0x395d33,_[_0x7704('0x64')](_0x7704('0x74')));var _0x4d49ef=_0x7704('0x67')+_['upperFirst']('preferred');if(_0x30989e[_0x4d49ef]||!_0x47d926[_0x7704('0x75')]||!_0x47d926[_0x7704('0x5e')]){_0x5e26d4=path[_0x7704('0x65')](config[_0x7704('0x63')],_0x395d33,_[_0x7704('0x64')](_0x7704('0x74')));}if(!fs[_0x7704('0x62')](_0x5e26d4)){throw new db['Sequelize'][(_0x7704('0x6a'))](_['upperFirst']('preferred')+_0x7704('0x6b'));}return _0x402b41[_0x7704('0x6c')](_0x5e26d4);}})[_0x7704('0x25')](handleError(_0x402b41,null));};exports['addFavicon']=function(_0x19a4a6,_0x3612dc,_0x52bbbf){if(_0x19a4a6[_0x7704('0x56')]&&_0x19a4a6[_0x7704('0x56')][_0x7704('0x58')]){_0x19a4a6[_0x7704('0x54')][_0x7704('0x5f')]=_0x19a4a6[_0x7704('0x56')][_0x7704('0x58')];}return db['Setting']['find']({'where':{'id':_0x19a4a6[_0x7704('0x53')]['id']}})['then'](handleEntityNotFound(_0x3612dc,null))[_0x7704('0x33')](saveUpdates(_0x19a4a6[_0x7704('0x54')],null))[_0x7704('0x33')](respondWithResult(_0x3612dc,null))[_0x7704('0x25')](handleError(_0x3612dc,null));};var utilLicense=require(_0x7704('0x18'));exports['getFavicon']=function(_0x555444,_0x12dce1,_0x30feb2){var _0x2ad5b7=_0x7704('0x5c');var _0x4142a5={'custom':![]};return utilLicense[_0x7704('0x5d')]()[_0x7704('0x33')](function(_0x187e80){if(_0x187e80){_0x4142a5=_0x187e80;}return db['Setting'][_0x7704('0x55')]({'where':{'id':_0x555444['params']['id']},'attributes':['logo',_0x7704('0x5a'),_0x7704('0x5e'),_0x7704('0x5f'),_0x7704('0x60'),'defaultLoginLogo',_0x7704('0x6e'),_0x7704('0x61')],'raw':!![]});})[_0x7704('0x33')](handleEntityNotFound(_0x12dce1,null))[_0x7704('0x33')](function(_0x348baf){if(_0x348baf){var _0x4e12a4=_0x348baf[_0x7704('0x5f')]&&fs[_0x7704('0x62')](path[_0x7704('0x65')](config[_0x7704('0x63')],_0x2ad5b7,_['toLower'](_0x348baf['favicon'])))?path['join'](config['root'],_0x2ad5b7,_[_0x7704('0x64')](_0x348baf[_0x7704('0x5f')])):path[_0x7704('0x65')](config[_0x7704('0x63')],_0x2ad5b7,_['toLower']('default_favicon.ico'));var _0x2a1bd8=_0x7704('0x67')+_['upperFirst']('favicon');if(_0x348baf[_0x2a1bd8]||!_0x4142a5[_0x7704('0x75')]){_0x4e12a4=path[_0x7704('0x65')](config['root'],_0x2ad5b7,_['toLower']('default_favicon.ico'));}if(!fs[_0x7704('0x62')](_0x4e12a4)){throw new db[(_0x7704('0x69'))][(_0x7704('0x6a'))](_[_0x7704('0x68')](_0x7704('0x5f'))+_0x7704('0x6b'));}return _0x12dce1[_0x7704('0x6c')](_0x4e12a4);}})[_0x7704('0x25')](handleError(_0x12dce1,null));};exports[_0x7704('0x76')]=function(_0x1ebbf2,_0x416209){var _0x158d8a={'offset':moment()[_0x7704('0x77')]()};_0x158d8a[_0x7704('0x78')]=moment()[_0x7704('0x77')](_0x158d8a[_0x7704('0x29')])[_0x7704('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x416209['status'](0xc8)[_0x7704('0x37')](_0x158d8a);}; \ No newline at end of file +var _0x572b=['query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','Setting','includeAll','findAll','rows','catch','show','rawAttributes','fields','include','options','find','body','addLogo','file','filename','logo','params','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','toLower','upperFirst','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','loginLogo','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','default','custom','gdpr','securePassword','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','format','YYYY-MM-DD\x20HH:mm:ss:SSS','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','map','fieldName','type','key','model'];(function(_0x4639a8,_0x5b2661){var _0x4bcee0=function(_0x197a6a){while(--_0x197a6a){_0x4639a8['push'](_0x4639a8['shift']());}};_0x4bcee0(++_0x5b2661);}(_0x572b,0x1b2));var _0xb572=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x572b[_0x95411e];return _0x2c8718;};'use strict';var emlformat=require(_0xb572('0x0'));var rimraf=require(_0xb572('0x1'));var zipdir=require(_0xb572('0x2'));var jsonpatch=require(_0xb572('0x3'));var rp=require(_0xb572('0x4'));var moment=require('moment');var BPromise=require(_0xb572('0x5'));var Mustache=require(_0xb572('0x6'));var util=require(_0xb572('0x7'));var path=require('path');var sox=require(_0xb572('0x8'));var csv=require(_0xb572('0x9'));var ejs=require(_0xb572('0xa'));var fs=require('fs');var fs_extra=require(_0xb572('0xb'));var _=require(_0xb572('0xc'));var squel=require(_0xb572('0xd'));var crypto=require(_0xb572('0xe'));var jsforce=require(_0xb572('0xf'));var deskjs=require(_0xb572('0x10'));var toCsv=require(_0xb572('0x9'));var querystring=require('querystring');var Papa=require(_0xb572('0x11'));var Redis=require('ioredis');var authService=require(_0xb572('0x12'));var qs=require(_0xb572('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb572('0x14'))(_0xb572('0x15'));var utils=require(_0xb572('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb572('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb572('0x18')][_0xb572('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3666e5,_0x47f137,_0x175ef8,_0x13f015){return new BPromise(function(_0x23a8cb,_0x4e99a6){var _0xd6e108=_0x13f015||client;return _0xd6e108['request'](_0x3666e5,_0x175ef8)['then'](function(_0x57023a){logger[_0xb572('0x1a')](_0xb572('0x1b'),_0x47f137,_0xb572('0x1c'));logger['debug'](_0xb572('0x1d'),_0x47f137,_0xb572('0x1c'),JSON[_0xb572('0x1e')](_0x57023a));if(_0x57023a[_0xb572('0x1f')]){if(_0x57023a['error'][_0xb572('0x20')]===0x1f4){logger[_0xb572('0x1f')]('Setting,\x20%s,\x20%s',_0x47f137,_0x57023a['error'][_0xb572('0x21')]);return _0x4e99a6(_0x57023a[_0xb572('0x1f')]['message']);}logger[_0xb572('0x1f')]('Setting,\x20%s,\x20%s',_0x47f137,_0x57023a[_0xb572('0x1f')]['message']);return _0x23a8cb(_0x57023a[_0xb572('0x1f')][_0xb572('0x21')]);}else{logger[_0xb572('0x1a')]('Setting,\x20%s,\x20%s',_0x47f137,_0xb572('0x1c'));_0x23a8cb(_0x57023a[_0xb572('0x22')][_0xb572('0x21')]);}})['catch'](function(_0x190675){logger[_0xb572('0x1f')](_0xb572('0x1b'),_0x47f137,_0x190675);_0x4e99a6(_0x190675);});});}function respondWithStatusCode(_0x4b7cc6,_0x3775b9){_0x3775b9=_0x3775b9||0xcc;return function(_0x377ed7){if(_0x377ed7){return _0x4b7cc6[_0xb572('0x23')](_0x3775b9);}return _0x4b7cc6[_0xb572('0x24')](_0x3775b9)['end']();};}function respondWithResult(_0x383f4d,_0x1b4ad5){_0x1b4ad5=_0x1b4ad5||0xc8;return function(_0x2cd917){if(_0x2cd917){return _0x383f4d[_0xb572('0x24')](_0x1b4ad5)['json'](_0x2cd917);}};}function respondWithFilteredResult(_0x34bfe8,_0x25fa72){return function(_0x3a6e07){if(_0x3a6e07){var _0x2f25ca=typeof _0x25fa72['offset']===_0xb572('0x25')&&typeof _0x25fa72['limit']===_0xb572('0x25');var _0x574990=_0x3a6e07[_0xb572('0x26')];var _0x2c4b07=_0x2f25ca?0x0:_0x25fa72[_0xb572('0x27')];var _0x3c6dfa=_0x2f25ca?_0x3a6e07[_0xb572('0x26')]:_0x25fa72[_0xb572('0x27')]+_0x25fa72[_0xb572('0x28')];var _0x1b60a5;if(_0x3c6dfa>=_0x574990){_0x3c6dfa=_0x574990;_0x1b60a5=0xc8;}else{_0x1b60a5=0xce;}_0x34bfe8[_0xb572('0x24')](_0x1b60a5);return _0x34bfe8['set'](_0xb572('0x29'),_0x2c4b07+'-'+_0x3c6dfa+'/'+_0x574990)[_0xb572('0x2a')](_0x3a6e07);}return null;};}function patchUpdates(_0x36563d){return function(_0x363782){try{jsonpatch[_0xb572('0x2b')](_0x363782,_0x36563d,!![]);}catch(_0x53ef84){return BPromise[_0xb572('0x2c')](_0x53ef84);}return _0x363782[_0xb572('0x2d')]();};}function saveUpdates(_0x213f57,_0x56350e){return function(_0x45678d){if(_0x45678d){return _0x45678d[_0xb572('0x2e')](_0x213f57)[_0xb572('0x2f')](function(_0x3484fe){return _0x3484fe;});}return null;};}function removeEntity(_0x1c7972,_0x474678){return function(_0x29b897){if(_0x29b897){return _0x29b897[_0xb572('0x30')]()['then'](function(){_0x1c7972[_0xb572('0x24')](0xcc)[_0xb572('0x31')]();});}};}function handleEntityNotFound(_0x240f11,_0x234bc7){return function(_0x195427){if(!_0x195427){_0x240f11[_0xb572('0x23')](0x194);}return _0x195427;};}function handleError(_0x597ec0,_0x376cca){_0x376cca=_0x376cca||0x1f4;return function(_0x25661b){logger[_0xb572('0x1f')](_0x25661b['stack']);if(_0x25661b[_0xb572('0x32')]){delete _0x25661b[_0xb572('0x32')];}_0x597ec0['status'](_0x376cca)[_0xb572('0x33')](_0x25661b);};}exports[_0xb572('0x34')]=function(_0x55dcf3,_0x191a6c){var _0x2e6916={},_0x22caba={},_0x723115={'count':0x0,'rows':[]};var _0x58b119=_[_0xb572('0x35')](db['Setting']['rawAttributes'],function(_0x555e1e){return{'name':_0x555e1e[_0xb572('0x36')],'type':_0x555e1e[_0xb572('0x37')][_0xb572('0x38')]};});_0x22caba[_0xb572('0x39')]=_[_0xb572('0x35')](_0x58b119,_0xb572('0x32'));_0x22caba[_0xb572('0x3a')]=_[_0xb572('0x3b')](_0x55dcf3[_0xb572('0x3a')]);_0x22caba[_0xb572('0x3c')]=_[_0xb572('0x3d')](_0x22caba[_0xb572('0x39')],_0x22caba['query']);_0x2e6916['attributes']=_[_0xb572('0x3d')](_0x22caba[_0xb572('0x39')],qs['fields'](_0x55dcf3[_0xb572('0x3a')]['fields']));_0x2e6916[_0xb572('0x3e')]=_0x2e6916[_0xb572('0x3e')]['length']?_0x2e6916[_0xb572('0x3e')]:_0x22caba[_0xb572('0x39')];if(!_0x55dcf3[_0xb572('0x3a')][_0xb572('0x3f')]('nolimit')){_0x2e6916[_0xb572('0x28')]=qs[_0xb572('0x28')](_0x55dcf3[_0xb572('0x3a')][_0xb572('0x28')]);_0x2e6916[_0xb572('0x27')]=qs['offset'](_0x55dcf3[_0xb572('0x3a')][_0xb572('0x27')]);}_0x2e6916[_0xb572('0x40')]=qs[_0xb572('0x41')](_0x55dcf3[_0xb572('0x3a')][_0xb572('0x41')]);_0x2e6916[_0xb572('0x42')]=qs[_0xb572('0x3c')](_[_0xb572('0x43')](_0x55dcf3[_0xb572('0x3a')],_0x22caba[_0xb572('0x3c')]),_0x58b119);if(_0x55dcf3[_0xb572('0x3a')][_0xb572('0x44')]){_0x2e6916[_0xb572('0x42')]=_[_0xb572('0x45')](_0x2e6916[_0xb572('0x42')],{'$or':_[_0xb572('0x35')](_0x58b119,function(_0x35301c){if(_0x35301c['type']!==_0xb572('0x46')){var _0x5628c4={};_0x5628c4[_0x35301c[_0xb572('0x32')]]={'$like':'%'+_0x55dcf3[_0xb572('0x3a')][_0xb572('0x44')]+'%'};return _0x5628c4;}})});}_0x2e6916=_[_0xb572('0x45')]({},_0x2e6916,_0x55dcf3['options']);var _0x18073b={'where':_0x2e6916[_0xb572('0x42')]};return db[_0xb572('0x47')][_0xb572('0x26')](_0x18073b)[_0xb572('0x2f')](function(_0x60dcec){_0x723115['count']=_0x60dcec;if(_0x55dcf3[_0xb572('0x3a')][_0xb572('0x48')]){_0x2e6916['include']=[{'all':!![]}];}return db[_0xb572('0x47')][_0xb572('0x49')](_0x2e6916);})[_0xb572('0x2f')](function(_0x551c39){_0x723115[_0xb572('0x4a')]=_0x551c39;return _0x723115;})['then'](respondWithFilteredResult(_0x191a6c,_0x2e6916))[_0xb572('0x4b')](handleError(_0x191a6c,null));};exports[_0xb572('0x4c')]=function(_0x545e17,_0x9116ab){var _0x4e4cdb={'raw':![],'where':{'id':_0x545e17['params']['id']}},_0x162ec9={};_0x162ec9[_0xb572('0x39')]=_[_0xb572('0x3b')](db[_0xb572('0x47')][_0xb572('0x4d')]);_0x162ec9[_0xb572('0x3a')]=_[_0xb572('0x3b')](_0x545e17['query']);_0x162ec9[_0xb572('0x3c')]=_[_0xb572('0x3d')](_0x162ec9[_0xb572('0x39')],_0x162ec9[_0xb572('0x3a')]);_0x4e4cdb[_0xb572('0x3e')]=_[_0xb572('0x3d')](_0x162ec9[_0xb572('0x39')],qs[_0xb572('0x4e')](_0x545e17[_0xb572('0x3a')][_0xb572('0x4e')]));_0x4e4cdb['attributes']=_0x4e4cdb['attributes']['length']?_0x4e4cdb['attributes']:_0x162ec9[_0xb572('0x39')];if(_0x545e17['query'][_0xb572('0x48')]){_0x4e4cdb[_0xb572('0x4f')]=[{'all':!![]}];}_0x4e4cdb=_[_0xb572('0x45')]({},_0x4e4cdb,_0x545e17[_0xb572('0x50')]);return db[_0xb572('0x47')][_0xb572('0x51')](_0x4e4cdb)[_0xb572('0x2f')](handleEntityNotFound(_0x9116ab,null))[_0xb572('0x2f')](respondWithResult(_0x9116ab,null))[_0xb572('0x4b')](handleError(_0x9116ab,null));};exports[_0xb572('0x2e')]=function(_0x2f8af5,_0x54a0c0){if(_0x2f8af5[_0xb572('0x52')]['id']){delete _0x2f8af5[_0xb572('0x52')]['id'];}return db[_0xb572('0x47')][_0xb572('0x51')]({'where':{'id':_0x2f8af5['params']['id']}})[_0xb572('0x2f')](handleEntityNotFound(_0x54a0c0,null))[_0xb572('0x2f')](saveUpdates(_0x2f8af5['body'],null))[_0xb572('0x2f')](respondWithResult(_0x54a0c0,null))[_0xb572('0x4b')](handleError(_0x54a0c0,null));};exports[_0xb572('0x53')]=function(_0x17ce6e,_0xe23510,_0x47465b){if(_0x17ce6e[_0xb572('0x54')]&&_0x17ce6e[_0xb572('0x54')][_0xb572('0x55')]){_0x17ce6e['body'][_0xb572('0x56')]=_0x17ce6e[_0xb572('0x54')]['filename'];}return db['Setting'][_0xb572('0x51')]({'where':{'id':_0x17ce6e[_0xb572('0x57')]['id']}})[_0xb572('0x2f')](handleEntityNotFound(_0xe23510,null))[_0xb572('0x2f')](saveUpdates(_0x17ce6e['body'],null))['then'](respondWithResult(_0xe23510,null))[_0xb572('0x4b')](handleError(_0xe23510,null));};exports[_0xb572('0x58')]=function(_0x3f2ce6,_0x3afa24,_0x16a61f){if(_0x3f2ce6[_0xb572('0x54')]&&_0x3f2ce6[_0xb572('0x54')][_0xb572('0x55')]){_0x3f2ce6[_0xb572('0x52')]['loginLogo']=_0x3f2ce6[_0xb572('0x54')][_0xb572('0x55')];}return db[_0xb572('0x47')][_0xb572('0x51')]({'where':{'id':_0x3f2ce6[_0xb572('0x57')]['id']}})[_0xb572('0x2f')](handleEntityNotFound(_0x3afa24,null))[_0xb572('0x2f')](saveUpdates(_0x3f2ce6['body'],null))['then'](respondWithResult(_0x3afa24,null))[_0xb572('0x4b')](handleError(_0x3afa24,null));};var utilLicense=require(_0xb572('0x59'));exports[_0xb572('0x5a')]=function(_0x3a6e08,_0x3c46b8,_0x11e821){var _0x43d219=_0xb572('0x5b');var _0x49d689={'custom':![]};return utilLicense[_0xb572('0x5c')]()[_0xb572('0x2f')](function(_0x4edc2c){if(_0x4edc2c){_0x49d689=_0x4edc2c;}return db[_0xb572('0x47')][_0xb572('0x51')]({'where':{'id':_0x3a6e08[_0xb572('0x57')]['id']},'attributes':[_0xb572('0x56'),'loginLogo',_0xb572('0x5d'),_0xb572('0x5e'),_0xb572('0x5f'),'defaultLoginLogo','defaultPreferred',_0xb572('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c46b8,null))[_0xb572('0x2f')](function(_0x43c1e6){if(_0x43c1e6){var _0x338a7d=_0x43c1e6[_0xb572('0x56')]&&fs[_0xb572('0x61')](path[_0xb572('0x62')](config[_0xb572('0x63')],_0x43d219,_['toLower'](_0x43c1e6[_0xb572('0x56')])))?path[_0xb572('0x62')](config['root'],_0x43d219,_[_0xb572('0x64')](_0x43c1e6['logo'])):path['join'](config[_0xb572('0x63')],_0x43d219,_['toLower']('default_logo.svg'));var _0xe68cc6='default'+_[_0xb572('0x65')](_0xb572('0x56'));if(_0x43c1e6[_0xe68cc6]||!_0x49d689['custom']){_0x338a7d=path[_0xb572('0x62')](config[_0xb572('0x63')],_0x43d219,_[_0xb572('0x64')](_0xb572('0x66')));}if(!fs[_0xb572('0x61')](_0x338a7d)){throw new db[(_0xb572('0x67'))][(_0xb572('0x68'))](_['upperFirst'](_0xb572('0x56'))+_0xb572('0x69'));}return _0x3c46b8[_0xb572('0x6a')](_0x338a7d);}})[_0xb572('0x4b')](handleError(_0x3c46b8,null));};var utilLicense=require('../../config/license/util');exports[_0xb572('0x6b')]=function(_0x7d50b3,_0x53a6fe,_0x402a7e){var _0x331e9a=_0xb572('0x5b');var _0x50b113={'custom':![]};return utilLicense[_0xb572('0x5c')]()['then'](function(_0x12dbf7){if(_0x12dbf7){_0x50b113=_0x12dbf7;}return db[_0xb572('0x47')]['find']({'where':{'id':_0x7d50b3['params']['id']},'attributes':[_0xb572('0x56'),_0xb572('0x6c'),_0xb572('0x5d'),'favicon',_0xb572('0x5f'),_0xb572('0x6d'),_0xb572('0x6e'),_0xb572('0x60')],'raw':!![]});})[_0xb572('0x2f')](handleEntityNotFound(_0x53a6fe,null))[_0xb572('0x2f')](function(_0x555704){if(_0x555704){var _0x3fd712=_0x555704[_0xb572('0x6c')]&&fs[_0xb572('0x61')](path[_0xb572('0x62')](config[_0xb572('0x63')],_0x331e9a,_[_0xb572('0x64')](_0x555704[_0xb572('0x6c')])))?path['join'](config[_0xb572('0x63')],_0x331e9a,_[_0xb572('0x64')](_0x555704[_0xb572('0x6c')])):path[_0xb572('0x62')](config[_0xb572('0x63')],_0x331e9a,_[_0xb572('0x64')](_0xb572('0x6f')));var _0x5d53dc=_0xb572('0x70')+_[_0xb572('0x65')]('loginLogo');if(_0x555704[_0x5d53dc]||!_0x50b113[_0xb572('0x71')]){_0x3fd712=path[_0xb572('0x62')](config['root'],_0x331e9a,_[_0xb572('0x64')](_0xb572('0x6f')));}if(!fs[_0xb572('0x61')](_0x3fd712)){throw new db[(_0xb572('0x67'))][(_0xb572('0x68'))](_[_0xb572('0x65')](_0xb572('0x6c'))+'\x20not\x20found');}return _0x53a6fe[_0xb572('0x6a')](_0x3fd712);}})['catch'](handleError(_0x53a6fe,null));};exports[_0xb572('0x72')]=function(_0x394123,_0x5c7c4a){return db[_0xb572('0x47')][_0xb572('0x51')]({'where':{'id':_0x394123[_0xb572('0x57')]['id']},'attributes':[_0xb572('0x73')]})[_0xb572('0x2f')](respondWithResult(_0x5c7c4a,null))['catch'](handleError(_0x5c7c4a,null));};exports['addPreferred']=function(_0x3cffc1,_0x19796c,_0x2710ae){if(_0x3cffc1['file']&&_0x3cffc1[_0xb572('0x54')]['filename']){_0x3cffc1[_0xb572('0x52')][_0xb572('0x5d')]=_0x3cffc1[_0xb572('0x54')][_0xb572('0x55')];}return db['Setting'][_0xb572('0x51')]({'where':{'id':_0x3cffc1[_0xb572('0x57')]['id']}})[_0xb572('0x2f')](handleEntityNotFound(_0x19796c,null))[_0xb572('0x2f')](saveUpdates(_0x3cffc1[_0xb572('0x52')],null))[_0xb572('0x2f')](respondWithResult(_0x19796c,null))[_0xb572('0x4b')](handleError(_0x19796c,null));};var utilLicense=require(_0xb572('0x59'));exports[_0xb572('0x74')]=function(_0x2504fe,_0x229bfe,_0x4a3a68){var _0x3bafaf='server/files/images/logos';var _0x4d82fa={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x4449ff){if(_0x4449ff){_0x4d82fa=_0x4449ff;}return db['Setting']['find']({'where':{'id':_0x2504fe['params']['id']},'attributes':[_0xb572('0x56'),_0xb572('0x6c'),_0xb572('0x5d'),'favicon','defaultLogo','defaultLoginLogo',_0xb572('0x6e'),_0xb572('0x60')],'raw':!![]});})[_0xb572('0x2f')](handleEntityNotFound(_0x229bfe,null))[_0xb572('0x2f')](function(_0x1c1481){if(_0x1c1481){var _0x4a0546=_0x1c1481[_0xb572('0x5d')]&&fs['existsSync'](path[_0xb572('0x62')](config['root'],_0x3bafaf,_[_0xb572('0x64')](_0x1c1481[_0xb572('0x5d')])))?path[_0xb572('0x62')](config['root'],_0x3bafaf,_[_0xb572('0x64')](_0x1c1481['preferred'])):path['join'](config['root'],_0x3bafaf,_['toLower'](_0xb572('0x75')));var _0x8ea9df='default'+_[_0xb572('0x65')](_0xb572('0x5d'));if(_0x1c1481[_0x8ea9df]||!_0x4d82fa[_0xb572('0x71')]||!_0x4d82fa[_0xb572('0x5d')]){_0x4a0546=path['join'](config['root'],_0x3bafaf,_[_0xb572('0x64')](_0xb572('0x75')));}if(!fs['existsSync'](_0x4a0546)){throw new db['Sequelize'][(_0xb572('0x68'))](_[_0xb572('0x65')](_0xb572('0x5d'))+_0xb572('0x69'));}return _0x229bfe[_0xb572('0x6a')](_0x4a0546);}})['catch'](handleError(_0x229bfe,null));};exports['addFavicon']=function(_0x363e8f,_0x3d4347,_0x241113){if(_0x363e8f['file']&&_0x363e8f[_0xb572('0x54')]['filename']){_0x363e8f[_0xb572('0x52')]['favicon']=_0x363e8f['file'][_0xb572('0x55')];}return db[_0xb572('0x47')]['find']({'where':{'id':_0x363e8f[_0xb572('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d4347,null))[_0xb572('0x2f')](saveUpdates(_0x363e8f[_0xb572('0x52')],null))[_0xb572('0x2f')](respondWithResult(_0x3d4347,null))[_0xb572('0x4b')](handleError(_0x3d4347,null));};var utilLicense=require('../../config/license/util');exports[_0xb572('0x76')]=function(_0x5ab9e7,_0x500b34,_0x26b1e8){var _0x3dd7b6=_0xb572('0x5b');var _0x1d6bc3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2f1854){if(_0x2f1854){_0x1d6bc3=_0x2f1854;}return db[_0xb572('0x47')][_0xb572('0x51')]({'where':{'id':_0x5ab9e7[_0xb572('0x57')]['id']},'attributes':['logo',_0xb572('0x6c'),_0xb572('0x5d'),_0xb572('0x5e'),'defaultLogo',_0xb572('0x6d'),_0xb572('0x6e'),_0xb572('0x60')],'raw':!![]});})[_0xb572('0x2f')](handleEntityNotFound(_0x500b34,null))['then'](function(_0x4aa513){if(_0x4aa513){var _0x8eee7e=_0x4aa513[_0xb572('0x5e')]&&fs[_0xb572('0x61')](path['join'](config['root'],_0x3dd7b6,_[_0xb572('0x64')](_0x4aa513[_0xb572('0x5e')])))?path[_0xb572('0x62')](config[_0xb572('0x63')],_0x3dd7b6,_[_0xb572('0x64')](_0x4aa513[_0xb572('0x5e')])):path[_0xb572('0x62')](config[_0xb572('0x63')],_0x3dd7b6,_['toLower'](_0xb572('0x77')));var _0x39dbda=_0xb572('0x70')+_['upperFirst'](_0xb572('0x5e'));if(_0x4aa513[_0x39dbda]||!_0x1d6bc3[_0xb572('0x71')]){_0x8eee7e=path[_0xb572('0x62')](config['root'],_0x3dd7b6,_[_0xb572('0x64')]('default_favicon.ico'));}if(!fs[_0xb572('0x61')](_0x8eee7e)){throw new db[(_0xb572('0x67'))]['ValidationError'](_[_0xb572('0x65')]('favicon')+_0xb572('0x69'));}return _0x500b34[_0xb572('0x6a')](_0x8eee7e);}})[_0xb572('0x4b')](handleError(_0x500b34,null));};exports[_0xb572('0x78')]=function(_0x1b1d54,_0x1b33d2){var _0x3b823a={'offset':moment()['utcOffset']()};_0x3b823a['now']=moment()['utcOffset'](_0x3b823a['offset'])[_0xb572('0x79')](_0xb572('0x7a'));return _0x1b33d2[_0xb572('0x24')](0xc8)[_0xb572('0x33')](_0x3b823a);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 1461b25..30f65d6 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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x166d74,_0x1bf07e){var _0x13a80f=function(_0x282172){while(--_0x282172){_0x166d74['push'](_0x166d74['shift']());}};_0x13a80f(++_0x1bf07e);}(_0x3e74,0x175));var _0x43e7=function(_0x2ead36,_0x283e34){_0x2ead36=_0x2ead36-0x0;var _0x5a203c=_0x3e74[_0x2ead36];return _0x5a203c;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 81d2b13..44d5f53 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 _0x6c4e=['request\x20sent','stringify','error','code','message','result','ShowSetting','Setting','find','options','raw','where','map','include','attributes','model','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','Setting,\x20%s,\x20%s'];(function(_0x359af5,_0x19fd10){var _0x389a62=function(_0x32bd8f){while(--_0x32bd8f){_0x359af5['push'](_0x359af5['shift']());}};_0x389a62(++_0x19fd10);}(_0x6c4e,0x192));var _0xe6c4=function(_0x4551a5,_0x574589){_0x4551a5=_0x4551a5-0x0;var _0x13d7b9=_0x6c4e[_0x4551a5];return _0x13d7b9;};'use strict';var _=require(_0xe6c4('0x0'));var util=require(_0xe6c4('0x1'));var moment=require(_0xe6c4('0x2'));var BPromise=require(_0xe6c4('0x3'));var rs=require(_0xe6c4('0x4'));var fs=require('fs');var Redis=require(_0xe6c4('0x5'));var db=require(_0xe6c4('0x6'))['db'];var utils=require(_0xe6c4('0x7'));var logger=require('../../config/logger')(_0xe6c4('0x8'));var config=require('../../config/environment');var jayson=require(_0xe6c4('0x9'));var client=jayson['client'][_0xe6c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3856e5,_0x1ec06a,_0x5be135){return new BPromise(function(_0x1bf97a,_0xe892da){return client['request'](_0x3856e5,_0x5be135)[_0xe6c4('0xb')](function(_0x4614e0){logger[_0xe6c4('0xc')](_0xe6c4('0xd'),_0x1ec06a,_0xe6c4('0xe'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x1ec06a,'request\x20sent',JSON[_0xe6c4('0xf')](_0x4614e0));if(_0x4614e0['error']){if(_0x4614e0[_0xe6c4('0x10')][_0xe6c4('0x11')]===0x1f4){logger[_0xe6c4('0x10')](_0xe6c4('0xd'),_0x1ec06a,_0x4614e0[_0xe6c4('0x10')][_0xe6c4('0x12')]);return _0xe892da(_0x4614e0[_0xe6c4('0x10')]['message']);}logger[_0xe6c4('0x10')]('Setting,\x20%s,\x20%s',_0x1ec06a,_0x4614e0[_0xe6c4('0x10')][_0xe6c4('0x12')]);return _0x1bf97a(_0x4614e0[_0xe6c4('0x10')][_0xe6c4('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1ec06a,_0xe6c4('0xe'));_0x1bf97a(_0x4614e0[_0xe6c4('0x13')][_0xe6c4('0x12')]);}})['catch'](function(_0x42070e){logger[_0xe6c4('0x10')](_0xe6c4('0xd'),_0x1ec06a,_0x42070e);_0xe892da(_0x42070e);});});}exports[_0xe6c4('0x14')]=function(_0x52d881){var _0x2cde74=this;return new Promise(function(_0x2e37e0,_0xaa35f2){return db[_0xe6c4('0x15')][_0xe6c4('0x16')]({'raw':_0x52d881['options']?_0x52d881[_0xe6c4('0x17')][_0xe6c4('0x18')]===undefined?!![]:![]:!![],'where':_0x52d881[_0xe6c4('0x17')]?_0x52d881[_0xe6c4('0x17')][_0xe6c4('0x19')]||null:null,'attributes':_0x52d881[_0xe6c4('0x17')]?_0x52d881[_0xe6c4('0x17')]['attributes']||null:null,'include':_0x52d881['options']?_0x52d881[_0xe6c4('0x17')]['include']?_[_0xe6c4('0x1a')](_0x52d881[_0xe6c4('0x17')][_0xe6c4('0x1b')],function(_0x1c1611){return{'model':db[_0x1c1611['model']],'as':_0x1c1611['as'],'attributes':_0x1c1611[_0xe6c4('0x1c')],'include':_0x1c1611['include']?_[_0xe6c4('0x1a')](_0x1c1611[_0xe6c4('0x1b')],function(_0x511a33){return{'model':db[_0x511a33[_0xe6c4('0x1d')]],'as':_0x511a33['as'],'attributes':_0x511a33['attributes'],'include':_0x511a33['include']?_['map'](_0x511a33[_0xe6c4('0x1b')],function(_0x29096f){return{'model':db[_0x29096f[_0xe6c4('0x1d')]],'as':_0x29096f['as'],'attributes':_0x29096f['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6c4('0xb')](function(_0x469474){logger[_0xe6c4('0xc')]('ShowSetting',_0x52d881);logger[_0xe6c4('0x1e')]('ShowSetting',_0x52d881,JSON['stringify'](_0x469474));_0x2e37e0(_0x469474);})[_0xe6c4('0x1f')](function(_0x1e0657){logger[_0xe6c4('0x10')]('ShowSetting',_0x1e0657[_0xe6c4('0x12')],_0x52d881);_0xaa35f2(_0x2cde74['error'](0x1f4,_0x1e0657[_0xe6c4('0x12')]));});});}; \ No newline at end of file +var _0x27e5=['debug','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model'];(function(_0xb8df4a,_0x43ae53){var _0x32dfde=function(_0x40b645){while(--_0x40b645){_0xb8df4a['push'](_0xb8df4a['shift']());}};_0x32dfde(++_0x43ae53);}(_0x27e5,0xa7));var _0x527e=function(_0xc7bd03,_0x90594b){_0xc7bd03=_0xc7bd03-0x0;var _0x124627=_0x27e5[_0xc7bd03];return _0x124627;};'use strict';var _=require(_0x527e('0x0'));var util=require(_0x527e('0x1'));var moment=require('moment');var BPromise=require(_0x527e('0x2'));var rs=require(_0x527e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x527e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x527e('0x5'))(_0x527e('0x6'));var config=require(_0x527e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x527e('0x8')][_0x527e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa88a58,_0x44a8ee,_0x24cd8b){return new BPromise(function(_0x213cc0,_0x9cd087){return client[_0x527e('0xa')](_0xa88a58,_0x24cd8b)[_0x527e('0xb')](function(_0x466c95){logger[_0x527e('0xc')](_0x527e('0xd'),_0x44a8ee,_0x527e('0xe'));logger['debug'](_0x527e('0xf'),_0x44a8ee,_0x527e('0xe'),JSON['stringify'](_0x466c95));if(_0x466c95[_0x527e('0x10')]){if(_0x466c95['error'][_0x527e('0x11')]===0x1f4){logger[_0x527e('0x10')](_0x527e('0xd'),_0x44a8ee,_0x466c95[_0x527e('0x10')]['message']);return _0x9cd087(_0x466c95[_0x527e('0x10')]['message']);}logger['error'](_0x527e('0xd'),_0x44a8ee,_0x466c95[_0x527e('0x10')]['message']);return _0x213cc0(_0x466c95[_0x527e('0x10')][_0x527e('0x12')]);}else{logger[_0x527e('0xc')](_0x527e('0xd'),_0x44a8ee,_0x527e('0xe'));_0x213cc0(_0x466c95[_0x527e('0x13')][_0x527e('0x12')]);}})[_0x527e('0x14')](function(_0x5ddbb9){logger['error'](_0x527e('0xd'),_0x44a8ee,_0x5ddbb9);_0x9cd087(_0x5ddbb9);});});}exports[_0x527e('0x15')]=function(_0x26fc6f){var _0x24518b=this;return new Promise(function(_0x4704ff,_0x31a3c9){return db[_0x527e('0x16')][_0x527e('0x17')]({'raw':_0x26fc6f[_0x527e('0x18')]?_0x26fc6f[_0x527e('0x18')][_0x527e('0x19')]===undefined?!![]:![]:!![],'where':_0x26fc6f[_0x527e('0x18')]?_0x26fc6f[_0x527e('0x18')][_0x527e('0x1a')]||null:null,'attributes':_0x26fc6f[_0x527e('0x18')]?_0x26fc6f['options'][_0x527e('0x1b')]||null:null,'include':_0x26fc6f[_0x527e('0x18')]?_0x26fc6f[_0x527e('0x18')][_0x527e('0x1c')]?_[_0x527e('0x1d')](_0x26fc6f[_0x527e('0x18')][_0x527e('0x1c')],function(_0x47ff0e){return{'model':db[_0x47ff0e[_0x527e('0x1e')]],'as':_0x47ff0e['as'],'attributes':_0x47ff0e['attributes'],'include':_0x47ff0e[_0x527e('0x1c')]?_[_0x527e('0x1d')](_0x47ff0e[_0x527e('0x1c')],function(_0x86bf32){return{'model':db[_0x86bf32[_0x527e('0x1e')]],'as':_0x86bf32['as'],'attributes':_0x86bf32[_0x527e('0x1b')],'include':_0x86bf32[_0x527e('0x1c')]?_[_0x527e('0x1d')](_0x86bf32['include'],function(_0x195b43){return{'model':db[_0x195b43[_0x527e('0x1e')]],'as':_0x195b43['as'],'attributes':_0x195b43[_0x527e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27d606){logger['info']('ShowSetting',_0x26fc6f);logger[_0x527e('0x1f')]('ShowSetting',_0x26fc6f,JSON[_0x527e('0x20')](_0x27d606));_0x4704ff(_0x27d606);})[_0x527e('0x14')](function(_0x4465c2){logger[_0x527e('0x10')](_0x527e('0x15'),_0x4465c2['message'],_0x26fc6f);_0x31a3c9(_0x24518b[_0x527e('0x10')](0x1f4,_0x4465c2[_0x527e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9eb9fcc..b16e8ef 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x2a0353,_0x395d0b){var _0x246d32=function(_0x22faba){while(--_0x22faba){_0x2a0353['push'](_0x2a0353['shift']());}};_0x246d32(++_0x395d0b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x44254f,_0x3f72a3){_0x44254f=_0x44254f-0x0;var _0x3112b7=_0x8ef6[_0x44254f];return _0x3112b7;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5425b8,_0x265626){_0x5425b8=_0x5425b8-0x0;var _0x55a317=_0x1cb9[_0x5425b8];return _0x55a317;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 2679df8..c3e05df 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 _0xf4cd=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x42c404,_0x3797a7){var _0x35beaf=function(_0x4444c1){while(--_0x4444c1){_0x42c404['push'](_0x42c404['shift']());}};_0x35beaf(++_0x3797a7);}(_0xf4cd,0x16c));var _0xdf4c=function(_0x1b137c,_0x35aa6d){_0x1b137c=_0x1b137c-0x0;var _0x1bc1c8=_0xf4cd[_0x1b137c];return _0x1bc1c8;};'use strict';var Sequelize=require(_0xdf4c('0x0'));var rs=require(_0xdf4c('0x1'));module[_0xdf4c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xdf4c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xdf4c('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xdf4c('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xdf4c('0x4')],'defaultValue':function(){return rs[_0xdf4c('0x5')]();}},'phone':{'type':Sequelize[_0xdf4c('0x4')]},'type':{'type':Sequelize[_0xdf4c('0x6')](_0xdf4c('0x7'),'skebby',_0xdf4c('0x8'),_0xdf4c('0x9'),_0xdf4c('0xa'),_0xdf4c('0xb'),_0xdf4c('0xc'),_0xdf4c('0xd'),_0xdf4c('0xe'),_0xdf4c('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xdf4c('0x4')]},'authToken':{'type':Sequelize[_0xdf4c('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xdf4c('0x4')]},'apiKey':{'type':Sequelize[_0xdf4c('0x4')]},'applicationId':{'type':Sequelize[_0xdf4c('0x4')]},'accountId':{'type':Sequelize[_0xdf4c('0x4')]},'senderString':{'type':Sequelize[_0xdf4c('0x4')]},'deliveryReport':{'type':Sequelize[_0xdf4c('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xdf4c('0x4')]},'notificationTemplate':{'type':Sequelize[_0xdf4c('0x11')],'defaultValue':function(){return _0xdf4c('0x12');}},'notificationSound':{'type':Sequelize[_0xdf4c('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdf4c('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdf4c('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdf4c('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdf4c('0x13')],'comment':_0xdf4c('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xdf4c('0x10')],'defaultValue':![],'comment':_0xdf4c('0x15'),'set':function(_0xf6e7af){if(!_0xf6e7af)this[_0xdf4c('0x16')](_0xdf4c('0x17'),null);this[_0xdf4c('0x16')]('mandatoryDisposition',_0xf6e7af);}}}; \ No newline at end of file +var _0x499d=['plivo','bandwidth','csc','infobip','intelepeer','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','BOOLEAN','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','skebby','connectel','clicksend'];(function(_0x4b7adb,_0x30a94f){var _0x2722cf=function(_0x115f43){while(--_0x115f43){_0x4b7adb['push'](_0x4b7adb['shift']());}};_0x2722cf(++_0x30a94f);}(_0x499d,0xd3));var _0xd499=function(_0x54939f,_0x5482a6){_0x54939f=_0x54939f-0x0;var _0xedf635=_0x499d[_0x54939f];return _0xedf635;};'use strict';var Sequelize=require(_0xd499('0x0'));var rs=require(_0xd499('0x1'));module[_0xd499('0x2')]={'name':{'type':Sequelize[_0xd499('0x3')],'unique':_0xd499('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xd499('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd499('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd499('0x3')]},'type':{'type':Sequelize[_0xd499('0x5')]('twilio',_0xd499('0x6'),_0xd499('0x7'),_0xd499('0x8'),_0xd499('0x9'),'clickatell',_0xd499('0xa'),_0xd499('0xb'),_0xd499('0xc'),_0xd499('0xd'))},'accountSid':{'type':Sequelize[_0xd499('0x3')]},'authId':{'type':Sequelize[_0xd499('0x3')]},'authToken':{'type':Sequelize[_0xd499('0x3')]},'smsMethod':{'type':Sequelize[_0xd499('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd499('0x3')]},'password':{'type':Sequelize[_0xd499('0x3')]},'apiKey':{'type':Sequelize[_0xd499('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xd499('0x3')]},'senderString':{'type':Sequelize[_0xd499('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd499('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'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[_0xd499('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd499('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd499('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd499('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xd499('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x360e9e){if(!_0x360e9e)this['setDataValue'](_0xd499('0x11'),null);this[_0xd499('0x12')](_0xd499('0x13'),_0x360e9e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index a50a0bc..6b2b719 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 _0xcb8f=['filters','pick','filter','where','merge','map','VIRTUAL','options','SmsAccount','includeAll','include','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','SmsAccountId','Disposition','getDispositions','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','findAll','sms','SmsApplication','account','applications','orderBy','Applications','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','text','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','list','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','nolimit','findOne','Owner','internal','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','inspect','skebby_dispatch_id','requestid','statusInt','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','message-id','csc','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','end','status','json','offset','limit','undefined','count','set','save','destroy','get','SmsAccounts','stack','name','index','Pause','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x563324,_0x6be59){var _0x492dfe=function(_0x54d037){while(--_0x54d037){_0x563324['push'](_0x563324['shift']());}};_0x492dfe(++_0x6be59);}(_0xcb8f,0x170));var _0xfcb8=function(_0x409981,_0x180e94){_0x409981=_0x409981-0x0;var _0x1533e6=_0xcb8f[_0x409981];return _0x1533e6;};'use strict';var emlformat=require(_0xfcb8('0x0'));var rimraf=require(_0xfcb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcb8('0x2'));var rp=require('request-promise');var moment=require(_0xfcb8('0x3'));var BPromise=require(_0xfcb8('0x4'));var Mustache=require(_0xfcb8('0x5'));var util=require(_0xfcb8('0x6'));var path=require(_0xfcb8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfcb8('0x8'));var fs=require('fs');var fs_extra=require(_0xfcb8('0x9'));var _=require(_0xfcb8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfcb8('0xb'));var deskjs=require(_0xfcb8('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfcb8('0xd'));var Redis=require('ioredis');var authService=require(_0xfcb8('0xe'));var qs=require(_0xfcb8('0xf'));var as=require(_0xfcb8('0x10'));var hardwareService=require(_0xfcb8('0x11'));var logger=require(_0xfcb8('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfcb8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcb8('0x14'))['db'];config[_0xfcb8('0x15')]=_[_0xfcb8('0x16')](config['redis'],{'host':_0xfcb8('0x17'),'port':0x18eb});var socket=require(_0xfcb8('0x18'))(new Redis(config[_0xfcb8('0x15')]));require(_0xfcb8('0x19'))['register'](socket);var jayson=require(_0xfcb8('0x1a'));var client=jayson[_0xfcb8('0x1b')][_0xfcb8('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x571049,_0x3060be,_0x3e8299,_0x4fbce7){return new BPromise(function(_0x40c3cd,_0x52c3fe){var _0x4ac2f5=_0x4fbce7||client;return _0x4ac2f5['request'](_0x571049,_0x3e8299)[_0xfcb8('0x1d')](function(_0x4efe18){logger['info']('SmsAccount,\x20%s,\x20%s',_0x3060be,_0xfcb8('0x1e'));logger[_0xfcb8('0x1f')](_0xfcb8('0x20'),_0x3060be,'request\x20sent',JSON[_0xfcb8('0x21')](_0x4efe18));if(_0x4efe18['error']){if(_0x4efe18[_0xfcb8('0x22')][_0xfcb8('0x23')]===0x1f4){logger['error'](_0xfcb8('0x24'),_0x3060be,_0x4efe18['error'][_0xfcb8('0x25')]);return _0x52c3fe(_0x4efe18[_0xfcb8('0x22')]['message']);}logger[_0xfcb8('0x22')](_0xfcb8('0x24'),_0x3060be,_0x4efe18[_0xfcb8('0x22')][_0xfcb8('0x25')]);return _0x40c3cd(_0x4efe18[_0xfcb8('0x22')][_0xfcb8('0x25')]);}else{logger['info'](_0xfcb8('0x24'),_0x3060be,_0xfcb8('0x1e'));_0x40c3cd(_0x4efe18['result'][_0xfcb8('0x25')]);}})[_0xfcb8('0x26')](function(_0x1e9b96){logger[_0xfcb8('0x22')](_0xfcb8('0x24'),_0x3060be,_0x1e9b96);_0x52c3fe(_0x1e9b96);});});}function respondWithStatusCode(_0x531867,_0x4b41c2){_0x4b41c2=_0x4b41c2||0xcc;return function(_0x425e31){if(_0x425e31){return _0x531867['sendStatus'](_0x4b41c2);}return _0x531867['status'](_0x4b41c2)[_0xfcb8('0x27')]();};}function respondWithResult(_0x425e50,_0x3a357f){_0x3a357f=_0x3a357f||0xc8;return function(_0x1d4bd9){if(_0x1d4bd9){return _0x425e50[_0xfcb8('0x28')](_0x3a357f)[_0xfcb8('0x29')](_0x1d4bd9);}};}function respondWithFilteredResult(_0xc094fb,_0x331802){return function(_0x1a65b2){if(_0x1a65b2){var _0x58a7e2=typeof _0x331802[_0xfcb8('0x2a')]==='undefined'&&typeof _0x331802[_0xfcb8('0x2b')]===_0xfcb8('0x2c');var _0x411ab7=_0x1a65b2['count'];var _0x4cc3c9=_0x58a7e2?0x0:_0x331802[_0xfcb8('0x2a')];var _0xf745d4=_0x58a7e2?_0x1a65b2[_0xfcb8('0x2d')]:_0x331802['offset']+_0x331802[_0xfcb8('0x2b')];var _0xe0b7eb;if(_0xf745d4>=_0x411ab7){_0xf745d4=_0x411ab7;_0xe0b7eb=0xc8;}else{_0xe0b7eb=0xce;}_0xc094fb[_0xfcb8('0x28')](_0xe0b7eb);return _0xc094fb[_0xfcb8('0x2e')]('Content-Range',_0x4cc3c9+'-'+_0xf745d4+'/'+_0x411ab7)[_0xfcb8('0x29')](_0x1a65b2);}return null;};}function patchUpdates(_0x16e67c){return function(_0x34f5b8){try{jsonpatch['apply'](_0x34f5b8,_0x16e67c,!![]);}catch(_0x30c457){return BPromise['reject'](_0x30c457);}return _0x34f5b8[_0xfcb8('0x2f')]();};}function saveUpdates(_0x2d1c9f,_0x4e3c63){return function(_0x2d0372){if(_0x2d0372){return _0x2d0372['update'](_0x2d1c9f)[_0xfcb8('0x1d')](function(_0x5cf1d4){return _0x5cf1d4;});}return null;};}function removeEntity(_0x32dbe8,_0x1b644e){return function(_0x28a29e){if(_0x28a29e){return _0x28a29e[_0xfcb8('0x30')]()[_0xfcb8('0x1d')](function(){var _0x4e81f3=_0x28a29e[_0xfcb8('0x31')]({'plain':!![]});var _0x5edd07=_0xfcb8('0x32');return db['UserProfileResource'][_0xfcb8('0x30')]({'where':{'type':_0x5edd07,'resourceId':_0x4e81f3['id']}})[_0xfcb8('0x1d')](function(){return _0x28a29e;});})['then'](function(){_0x32dbe8[_0xfcb8('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7ea1,_0x2dc9d1){return function(_0x4ae949){if(!_0x4ae949){_0x3a7ea1['sendStatus'](0x194);}return _0x4ae949;};}function handleError(_0x5d56a0,_0x2763d8){_0x2763d8=_0x2763d8||0x1f4;return function(_0x9368ed){logger[_0xfcb8('0x22')](_0x9368ed[_0xfcb8('0x33')]);if(_0x9368ed[_0xfcb8('0x34')]){delete _0x9368ed[_0xfcb8('0x34')];}_0x5d56a0['status'](_0x2763d8)['send'](_0x9368ed);};}exports[_0xfcb8('0x35')]=function(_0x464a02,_0x68a7c9){var _0x2f730e={'include':[{'model':db[_0xfcb8('0x36')],'as':'mandatoryDispositionPause'}]},_0x4ca59d={},_0x2842e2={'count':0x0,'rows':[]};var _0x227190=_['map'](db['SmsAccount'][_0xfcb8('0x37')],function(_0xb75c6c){return{'name':_0xb75c6c[_0xfcb8('0x38')],'type':_0xb75c6c['type'][_0xfcb8('0x39')]};});_0x4ca59d[_0xfcb8('0x3a')]=_['map'](_0x227190,_0xfcb8('0x34'));_0x4ca59d[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x464a02[_0xfcb8('0x3b')]);_0x4ca59d['filters']=_[_0xfcb8('0x3d')](_0x4ca59d[_0xfcb8('0x3a')],_0x4ca59d['query']);_0x2f730e[_0xfcb8('0x3e')]=_[_0xfcb8('0x3d')](_0x4ca59d[_0xfcb8('0x3a')],qs['fields'](_0x464a02[_0xfcb8('0x3b')][_0xfcb8('0x3f')]));_0x2f730e[_0xfcb8('0x3e')]=_0x2f730e[_0xfcb8('0x3e')]['length']?_0x2f730e[_0xfcb8('0x3e')]:_0x4ca59d[_0xfcb8('0x3a')];if(!_0x464a02[_0xfcb8('0x3b')][_0xfcb8('0x40')]('nolimit')){_0x2f730e[_0xfcb8('0x2b')]=qs[_0xfcb8('0x2b')](_0x464a02['query'][_0xfcb8('0x2b')]);_0x2f730e[_0xfcb8('0x2a')]=qs[_0xfcb8('0x2a')](_0x464a02[_0xfcb8('0x3b')][_0xfcb8('0x2a')]);}_0x2f730e['order']=qs[_0xfcb8('0x41')](_0x464a02[_0xfcb8('0x3b')][_0xfcb8('0x41')]);_0x2f730e['where']=qs[_0xfcb8('0x42')](_[_0xfcb8('0x43')](_0x464a02['query'],_0x4ca59d['filters']),_0x227190);if(_0x464a02['query'][_0xfcb8('0x44')]){_0x2f730e[_0xfcb8('0x45')]=_[_0xfcb8('0x46')](_0x2f730e[_0xfcb8('0x45')],{'$or':_[_0xfcb8('0x47')](_0x227190,function(_0x2ef78e){if(_0x2ef78e['type']!==_0xfcb8('0x48')){var _0x1de753={};_0x1de753[_0x2ef78e[_0xfcb8('0x34')]]={'$like':'%'+_0x464a02[_0xfcb8('0x3b')]['filter']+'%'};return _0x1de753;}})});}_0x2f730e=_['merge']({},_0x2f730e,_0x464a02[_0xfcb8('0x49')]);var _0x3d4233={'where':_0x2f730e[_0xfcb8('0x45')]};return db[_0xfcb8('0x4a')][_0xfcb8('0x2d')](_0x3d4233)[_0xfcb8('0x1d')](function(_0x38fb0b){_0x2842e2[_0xfcb8('0x2d')]=_0x38fb0b;if(_0x464a02['query'][_0xfcb8('0x4b')]){_0x2f730e[_0xfcb8('0x4c')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x2f730e);})['then'](function(_0x15d09f){_0x2842e2['rows']=_0x15d09f;return _0x2842e2;})[_0xfcb8('0x1d')](respondWithFilteredResult(_0x68a7c9,_0x2f730e))[_0xfcb8('0x26')](handleError(_0x68a7c9,null));};exports['show']=function(_0x3afd75,_0x4f6654){var _0x52d874={'raw':![],'where':{'id':_0x3afd75[_0xfcb8('0x4d')]['id']},'include':[{'model':db[_0xfcb8('0x36')],'as':'mandatoryDispositionPause'}]},_0x28b102={};_0x28b102[_0xfcb8('0x3a')]=_['keys'](db[_0xfcb8('0x4a')][_0xfcb8('0x37')]);_0x28b102[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x3afd75['query']);_0x28b102['filters']=_['intersection'](_0x28b102[_0xfcb8('0x3a')],_0x28b102[_0xfcb8('0x3b')]);_0x52d874['attributes']=_['intersection'](_0x28b102[_0xfcb8('0x3a')],qs[_0xfcb8('0x3f')](_0x3afd75['query'][_0xfcb8('0x3f')]));_0x52d874[_0xfcb8('0x3e')]=_0x52d874[_0xfcb8('0x3e')][_0xfcb8('0x4e')]?_0x52d874[_0xfcb8('0x3e')]:_0x28b102[_0xfcb8('0x3a')];if(_0x3afd75[_0xfcb8('0x3b')]['includeAll']){_0x52d874[_0xfcb8('0x4c')]=[{'all':!![]}];}_0x52d874=_[_0xfcb8('0x46')]({},_0x52d874,_0x3afd75['options']);return db[_0xfcb8('0x4a')]['find'](_0x52d874)['then'](handleEntityNotFound(_0x4f6654,null))['then'](respondWithResult(_0x4f6654,null))[_0xfcb8('0x26')](handleError(_0x4f6654,null));};exports[_0xfcb8('0x4f')]=function(_0x386f19,_0x4212f1){return db[_0xfcb8('0x4a')][_0xfcb8('0x4f')](_0x386f19[_0xfcb8('0x50')],{})[_0xfcb8('0x1d')](function(_0x3847f7){var _0x40f3bc=_0x386f19[_0xfcb8('0x51')][_0xfcb8('0x31')]({'plain':!![]});if(!_0x40f3bc)throw new Error(_0xfcb8('0x52'));if(_0x40f3bc['role']===_0xfcb8('0x51')){var _0x33b596=_0x3847f7[_0xfcb8('0x31')]({'plain':!![]});var _0x157b6d=_0xfcb8('0x32');return db[_0xfcb8('0x53')][_0xfcb8('0x54')]({'where':{'name':_0x157b6d,'userProfileId':_0x40f3bc['userProfileId']},'raw':!![]})[_0xfcb8('0x1d')](function(_0x2f27ac){if(_0x2f27ac&&_0x2f27ac[_0xfcb8('0x55')]===0x0){return db[_0xfcb8('0x56')][_0xfcb8('0x4f')]({'name':_0x33b596[_0xfcb8('0x34')],'resourceId':_0x33b596['id'],'type':_0x2f27ac['name'],'sectionId':_0x2f27ac['id']},{})[_0xfcb8('0x1d')](function(){return _0x3847f7;});}else{return _0x3847f7;}})[_0xfcb8('0x26')](function(_0x11a49e){logger['error'](_0xfcb8('0x57'),_0x11a49e);throw _0x11a49e;});}return _0x3847f7;})[_0xfcb8('0x1d')](respondWithResult(_0x4212f1,0xc9))[_0xfcb8('0x26')](handleError(_0x4212f1,null));};exports[_0xfcb8('0x58')]=function(_0x5eb43a,_0x30a93e){if(_0x5eb43a[_0xfcb8('0x50')]['id']){delete _0x5eb43a[_0xfcb8('0x50')]['id'];}return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x5eb43a[_0xfcb8('0x4d')]['id']},'include':[{'model':db['Pause'],'as':_0xfcb8('0x59')}]})[_0xfcb8('0x1d')](handleEntityNotFound(_0x30a93e,null))[_0xfcb8('0x1d')](saveUpdates(_0x5eb43a[_0xfcb8('0x50')],null))[_0xfcb8('0x1d')](respondWithResult(_0x30a93e,null))[_0xfcb8('0x26')](handleError(_0x30a93e,null));};exports[_0xfcb8('0x30')]=function(_0xd77b01,_0x2f7e62){return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0xd77b01[_0xfcb8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2f7e62,null))[_0xfcb8('0x1d')](removeEntity(_0x2f7e62,null))['catch'](handleError(_0x2f7e62,null));};exports['describe']=function(_0x2e6caf,_0x16730e){return db[_0xfcb8('0x4a')][_0xfcb8('0x5a')]()[_0xfcb8('0x1d')](respondWithResult(_0x16730e,null))['catch'](handleError(_0x16730e,null));};exports['addDisposition']=function(_0x5167ad,_0x2cfa60,_0x23c71f){if(_0x5167ad[_0xfcb8('0x50')]['id']){delete _0x5167ad['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5167ad[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x2cfa60,null))[_0xfcb8('0x1d')](function(_0x356a23){if(_0x356a23){_0x5167ad[_0xfcb8('0x50')][_0xfcb8('0x5b')]=_0x356a23['id'];return db[_0xfcb8('0x5c')][_0xfcb8('0x4f')](_0x5167ad[_0xfcb8('0x50')]);}})['then'](respondWithResult(_0x2cfa60,null))[_0xfcb8('0x26')](handleError(_0x2cfa60,null));};exports[_0xfcb8('0x5d')]=function(_0x176673,_0x47ee3c,_0x5ce363){var _0x12ecf3={'raw':![],'where':{}};var _0x40184a={};var _0x119b10={'count':0x0,'rows':[]};return db[_0xfcb8('0x4a')]['findOne']({'where':{'id':_0x176673[_0xfcb8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x47ee3c,null))[_0xfcb8('0x1d')](function(_0x5a315b){if(_0x5a315b){_0x40184a[_0xfcb8('0x3a')]=_['keys'](db[_0xfcb8('0x5c')]['rawAttributes']);_0x40184a[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x176673[_0xfcb8('0x3b')]);_0x40184a['filters']=_['intersection'](_0x40184a[_0xfcb8('0x3a')],_0x40184a['query']);_0x12ecf3[_0xfcb8('0x3e')]=_[_0xfcb8('0x3d')](_0x40184a['model'],qs['fields'](_0x176673[_0xfcb8('0x3b')][_0xfcb8('0x3f')]));_0x12ecf3['attributes']=_0x12ecf3[_0xfcb8('0x3e')][_0xfcb8('0x4e')]?_0x12ecf3['attributes']:_0x40184a[_0xfcb8('0x3a')];if(!_0x176673[_0xfcb8('0x3b')][_0xfcb8('0x40')]('nolimit')){_0x12ecf3[_0xfcb8('0x2b')]=qs[_0xfcb8('0x2b')](_0x176673['query'][_0xfcb8('0x2b')]);_0x12ecf3[_0xfcb8('0x2a')]=qs[_0xfcb8('0x2a')](_0x176673[_0xfcb8('0x3b')][_0xfcb8('0x2a')]);}_0x12ecf3['order']=qs[_0xfcb8('0x41')](_0x176673['query'][_0xfcb8('0x41')]);_0x12ecf3[_0xfcb8('0x45')]=qs['filters'](_[_0xfcb8('0x43')](_0x176673[_0xfcb8('0x3b')],_0x40184a[_0xfcb8('0x42')]));_0x12ecf3[_0xfcb8('0x45')][_0xfcb8('0x5b')]=_0x5a315b['id'];if(_0x176673[_0xfcb8('0x3b')][_0xfcb8('0x44')]){_0x12ecf3[_0xfcb8('0x45')]=_[_0xfcb8('0x46')](_0x12ecf3[_0xfcb8('0x45')],{'$or':_[_0xfcb8('0x47')](_0x12ecf3[_0xfcb8('0x3e')],function(_0x4f2aae){var _0x48a3eb={};_0x48a3eb[_0x4f2aae]={'$like':'%'+_0x176673['query'][_0xfcb8('0x44')]+'%'};return _0x48a3eb;})});}_0x12ecf3=_[_0xfcb8('0x46')]({},_0x12ecf3,_0x176673['options']);return db['Disposition'][_0xfcb8('0x2d')]({'where':_0x12ecf3[_0xfcb8('0x45')]})['then'](function(_0x447c59){_0x119b10[_0xfcb8('0x2d')]=_0x447c59;if(_0x176673[_0xfcb8('0x3b')][_0xfcb8('0x4b')]){_0x12ecf3['include']=[{'all':!![]}];}return db[_0xfcb8('0x5c')]['findAll'](_0x12ecf3);})[_0xfcb8('0x1d')](function(_0x225033){_0x119b10[_0xfcb8('0x5e')]=_0x225033;return _0x119b10;});}})[_0xfcb8('0x1d')](respondWithFilteredResult(_0x47ee3c,_0x12ecf3))[_0xfcb8('0x26')](handleError(_0x47ee3c,null));};exports['removeDispositions']=function(_0x2a639b,_0x44f6bf,_0x1d18db){return db[_0xfcb8('0x4a')]['find']({'where':{'id':_0x2a639b['params']['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x44f6bf,null))[_0xfcb8('0x1d')](function(_0x3baf37){if(_0x3baf37){return _0x3baf37[_0xfcb8('0x5f')](_0x2a639b['query'][_0xfcb8('0x60')]);}})[_0xfcb8('0x1d')](respondWithStatusCode(_0x44f6bf,null))[_0xfcb8('0x26')](handleError(_0x44f6bf,null));};exports[_0xfcb8('0x61')]=function(_0x42dbe0,_0x119b84,_0x19aa21){if(_0x42dbe0[_0xfcb8('0x50')]['id']){delete _0x42dbe0[_0xfcb8('0x50')]['id'];}return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x42dbe0[_0xfcb8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x119b84,null))['then'](function(_0x24c50a){if(_0x24c50a){_0x42dbe0[_0xfcb8('0x50')]['SmsAccountId']=_0x24c50a['id'];return db[_0xfcb8('0x62')][_0xfcb8('0x4f')](_0x42dbe0[_0xfcb8('0x50')]);}})['then'](respondWithResult(_0x119b84,null))[_0xfcb8('0x26')](handleError(_0x119b84,null));};exports[_0xfcb8('0x63')]=function(_0x101229,_0x45747d,_0x28a349){var _0x2ed5ed={'raw':![],'where':{}};var _0x2a5af4={};var _0x4e8092={'count':0x0,'rows':[]};return db[_0xfcb8('0x4a')]['findOne']({'where':{'id':_0x101229[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x45747d,null))[_0xfcb8('0x1d')](function(_0x1cc41b){if(_0x1cc41b){_0x2a5af4[_0xfcb8('0x3a')]=_[_0xfcb8('0x3c')](db[_0xfcb8('0x62')][_0xfcb8('0x37')]);_0x2a5af4[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x101229['query']);_0x2a5af4['filters']=_['intersection'](_0x2a5af4[_0xfcb8('0x3a')],_0x2a5af4[_0xfcb8('0x3b')]);_0x2ed5ed[_0xfcb8('0x3e')]=_[_0xfcb8('0x3d')](_0x2a5af4[_0xfcb8('0x3a')],qs[_0xfcb8('0x3f')](_0x101229['query'][_0xfcb8('0x3f')]));_0x2ed5ed[_0xfcb8('0x3e')]=_0x2ed5ed['attributes'][_0xfcb8('0x4e')]?_0x2ed5ed[_0xfcb8('0x3e')]:_0x2a5af4[_0xfcb8('0x3a')];if(!_0x101229[_0xfcb8('0x3b')]['hasOwnProperty']('nolimit')){_0x2ed5ed[_0xfcb8('0x2b')]=qs[_0xfcb8('0x2b')](_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x2b')]);_0x2ed5ed['offset']=qs['offset'](_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x2a')]);}_0x2ed5ed[_0xfcb8('0x64')]=qs[_0xfcb8('0x41')](_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x41')]);_0x2ed5ed[_0xfcb8('0x45')]=qs[_0xfcb8('0x42')](_[_0xfcb8('0x43')](_0x101229[_0xfcb8('0x3b')],_0x2a5af4['filters']));_0x2ed5ed[_0xfcb8('0x45')][_0xfcb8('0x5b')]=_0x1cc41b['id'];if(_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x44')]){_0x2ed5ed[_0xfcb8('0x45')]=_[_0xfcb8('0x46')](_0x2ed5ed[_0xfcb8('0x45')],{'$or':_['map'](_0x2ed5ed[_0xfcb8('0x3e')],function(_0x4fadb5){var _0x2cf14b={};_0x2cf14b[_0x4fadb5]={'$like':'%'+_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x44')]+'%'};return _0x2cf14b;})});}_0x2ed5ed=_[_0xfcb8('0x46')]({},_0x2ed5ed,_0x101229[_0xfcb8('0x49')]);return db[_0xfcb8('0x62')][_0xfcb8('0x2d')]({'where':_0x2ed5ed['where']})[_0xfcb8('0x1d')](function(_0x523b7f){_0x4e8092[_0xfcb8('0x2d')]=_0x523b7f;if(_0x101229[_0xfcb8('0x3b')][_0xfcb8('0x4b')]){_0x2ed5ed['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xfcb8('0x65')](_0x2ed5ed);})[_0xfcb8('0x1d')](function(_0x24c46c){_0x4e8092[_0xfcb8('0x5e')]=_0x24c46c;return _0x4e8092;});}})[_0xfcb8('0x1d')](respondWithFilteredResult(_0x45747d,_0x2ed5ed))['catch'](handleError(_0x45747d,null));};exports['removeAnswers']=function(_0x4e6ebe,_0xb74a4b,_0x16a9ef){return db[_0xfcb8('0x4a')]['find']({'where':{'id':_0x4e6ebe[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0xb74a4b,null))[_0xfcb8('0x1d')](function(_0x9c7889){if(_0x9c7889){return _0x9c7889['removeAnswers'](_0x4e6ebe[_0xfcb8('0x3b')]['ids']);}})[_0xfcb8('0x1d')](respondWithStatusCode(_0xb74a4b,null))['catch'](handleError(_0xb74a4b,null));};exports['notify']=function(_0x3d59f5,_0x52c0ca,_0x3a5bc7){var _0x51553e={'channel':_0xfcb8('0x66')};var _0x72512d=[];var _0x16e821=[];var _0x334d39={};return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x3d59f5['params']['id']},'include':[{'model':db[_0xfcb8('0x67')],'as':'Applications'}]})[_0xfcb8('0x1d')](handleEntityNotFound(_0x52c0ca,null))[_0xfcb8('0x1d')](function(_0x26e817){_0x51553e[_0xfcb8('0x68')]=_0x26e817;_0x51553e[_0xfcb8('0x69')]=_[_0xfcb8('0x6a')](_0x26e817[_0xfcb8('0x6b')],['priority'],['asc']);if(_0x51553e[_0xfcb8('0x68')]['Applications']){delete _0x51553e[_0xfcb8('0x68')][_0xfcb8('0x6b')];}return db['CmContact']['describe']();})['then'](function(_0x1d2367){if(!_0x1d2367){throw new db[(_0xfcb8('0x6c'))][(_0xfcb8('0x6d'))](_0xfcb8('0x6e'));}_0x72512d=_[_0xfcb8('0x6f')](_[_0xfcb8('0x3c')](_0x1d2367),[_0xfcb8('0x70'),_0xfcb8('0x71')]);_0x16e821=_[_0xfcb8('0x6f')](_[_0xfcb8('0x3c')](_0x1d2367),['createdAt',_0xfcb8('0x71'),'CompanyId',_0xfcb8('0x72')]);_0x51553e[_0xfcb8('0x50')]={'mapKey':_0xfcb8('0x73')};if(_0x51553e[_0xfcb8('0x68')][_0xfcb8('0x74')]){switch(_0x51553e['account'][_0xfcb8('0x74')]){case'twilio':_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x76')];_0x51553e['body'][_0xfcb8('0x50')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x77')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x78')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x79')];break;case _0xfcb8('0x7a'):_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]='+'+_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x7b')];_0x51553e['body'][_0xfcb8('0x50')]=_0x3d59f5[_0xfcb8('0x50')]['text'];break;case _0xfcb8('0x7c'):_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x75')];_0x51553e[_0xfcb8('0x50')]['body']=_0x3d59f5[_0xfcb8('0x50')]['message'];break;case _0xfcb8('0x7d'):_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x75')];_0x51553e['body'][_0xfcb8('0x50')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x50')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x78')]=_0x3d59f5['body'][_0xfcb8('0x7e')];break;case'plivo':_0x51553e['body'][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x76')];_0x51553e['body'][_0xfcb8('0x50')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x7f')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x78')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x80')];break;case _0xfcb8('0x81'):_0x51553e['body'][_0xfcb8('0x75')]='+'+_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x82')][0x0][_0xfcb8('0x75')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x50')]=_0x3d59f5['body'][_0xfcb8('0x82')][0x0][_0xfcb8('0x83')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x78')]=_0x3d59f5[_0xfcb8('0x50')]['results'][0x0][_0xfcb8('0x78')];break;case'csc':_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x84')];_0x51553e[_0xfcb8('0x50')]['body']=_0x3d59f5['body'][_0xfcb8('0x85')][_0xfcb8('0x25')];break;case _0xfcb8('0x86'):_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x87')];_0x51553e[_0xfcb8('0x50')]['body']=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x83')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x78')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x88')];break;case'bandwidth':_0x51553e[_0xfcb8('0x50')]['messageId']=_0x3d59f5[_0xfcb8('0x50')][0x0][_0xfcb8('0x25')]['id'];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][0x0]['message'][_0xfcb8('0x75')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x50')]=_0x3d59f5['body'][0x0][_0xfcb8('0x25')][_0xfcb8('0x83')];break;case _0xfcb8('0x89'):_0x51553e['body'][_0xfcb8('0x75')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x75')];_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x50')]=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x25')];_0x51553e[_0xfcb8('0x50')]['messageId']=_0x3d59f5[_0xfcb8('0x50')][_0xfcb8('0x8a')];break;}}if(_0x51553e[_0xfcb8('0x50')]['id']){delete _0x51553e[_0xfcb8('0x50')]['id'];}if(_[_0xfcb8('0x8b')](_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')])){throw new db['Sequelize'][(_0xfcb8('0x6d'))]('from\x20is\x20mandatory');}if(_[_0xfcb8('0x8b')](_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x50')])||_0x51553e[_0xfcb8('0x50')]['body']===''){throw new db[(_0xfcb8('0x6c'))][(_0xfcb8('0x6d'))](_0xfcb8('0x8c'));}if(_[_0xfcb8('0x8b')](_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x8d')])){throw new db['Sequelize'][(_0xfcb8('0x6d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16e821);}if(!_[_0xfcb8('0x8e')](_0x16e821,_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x8d')])){throw new db[(_0xfcb8('0x6c'))][(_0xfcb8('0x6d'))](_0xfcb8('0x8f')+_0x16e821);}_0x334d39[_0x51553e['body'][_0xfcb8('0x8d')]]=_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')];return db[_0xfcb8('0x90')]['find']({'where':{'id':_0x51553e['account'][_0xfcb8('0x72')]},'include':[{'model':db[_0xfcb8('0x91')],'as':_0xfcb8('0x92'),'where':_0x334d39,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xfcb8('0x1d')](handleEntityNotFound(_0x52c0ca,null))[_0xfcb8('0x1d')](function(_0x9f89bd){if(_0x9f89bd){_0x51553e[_0xfcb8('0x93')]=_['omit'](_0x9f89bd,[_0xfcb8('0x92')]);if(_0x9f89bd['Contacts'][_0xfcb8('0x4e')]){return _0x9f89bd[_0xfcb8('0x92')][0x0];}var _0x4fe53b=_[_0xfcb8('0x16')](_0x51553e['body'],{'firstName':_0x51553e['body'][_0xfcb8('0x75')],'ListId':_0x9f89bd['id']});_0x4fe53b[_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x8d')]]=_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')];return db[_0xfcb8('0x91')]['create'](_0x4fe53b,{'fields':_0x72512d,'raw':!![]});}})['then'](handleEntityNotFound(_0x52c0ca,null))['then'](function(_0x4201ea){if(_0x4201ea){_0x51553e[_0xfcb8('0x94')]=_0x4201ea;var _0x13b1d8={'ContactId':_0x4201ea['id'],'phone':_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')],'SmsAccountId':_0x3d59f5[_0xfcb8('0x4d')]['id']};var _0x557f44={'ContactId':_0x4201ea['id'],'SmsAccountId':_0x3d59f5[_0xfcb8('0x4d')]['id'],'closed':![]};return db[_0xfcb8('0x95')][_0xfcb8('0x54')]({'where':_0x557f44})[_0xfcb8('0x1d')](function(_0x4a4689){if(_0x4a4689){return[_0x4a4689,![]];}return db[_0xfcb8('0x95')]['create'](_0x13b1d8)[_0xfcb8('0x1d')](function(_0x21a78b){return[_0x21a78b,!![]];});});}})[_0xfcb8('0x96')](function(_0x108f4d,_0x4a5582){_0x51553e[_0xfcb8('0x97')]=_0x108f4d[_0xfcb8('0x31')]({'plain':!![]});_0x51553e[_0xfcb8('0x97')][_0xfcb8('0x98')]=![];if(_0x4a5582){if(_0x51553e[_0xfcb8('0x68')][_0xfcb8('0x99')]){_0x51553e[_0xfcb8('0x69')][_0xfcb8('0x9a')]({'id':0x0,'priority':_0x51553e[_0xfcb8('0x69')]['length']+0x1,'app':_0xfcb8('0x9b'),'appdata':_0xfcb8('0x9c'),'interval':_0xfcb8('0x9d')});}_0x51553e[_0xfcb8('0x97')][_0xfcb8('0x98')]=!![];}return db[_0xfcb8('0x9e')]['create']({'phone':_0x51553e[_0xfcb8('0x50')][_0xfcb8('0x75')],'messageId':_0x51553e[_0xfcb8('0x50')]['messageId'],'body':_0x51553e[_0xfcb8('0x50')]['body'],'SmsAccountId':_0x3d59f5[_0xfcb8('0x4d')]['id'],'SmsInteractionId':_0x108f4d['id'],'direction':'in','ContactId':_0x108f4d[_0xfcb8('0x9f')],'AttachmentId':_0x51553e['body'][_0xfcb8('0xa0')]});})[_0xfcb8('0x1d')](function(_0x2c9757){_0x51553e['message']=_0x2c9757;if(_0x51553e[_0xfcb8('0x97')][_0xfcb8('0xa1')]){return db[_0xfcb8('0xa2')][_0xfcb8('0x54')]({'attributes':['id',_0xfcb8('0x34')],'where':{'id':_0x51553e[_0xfcb8('0x97')][_0xfcb8('0xa1')]}})[_0xfcb8('0x1d')](function(_0x4a0665){if(_0x4a0665){_0x51553e['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4a0665[_0xfcb8('0x34')]+','+(_0x51553e[_0xfcb8('0x68')][_0xfcb8('0xa3')]||0xa),'interval':_0xfcb8('0x9d')});}return respondWithRpcPromise('Start',_0xfcb8('0xa4'),_0x51553e);});}return respondWithRpcPromise(_0xfcb8('0xa5'),_0xfcb8('0xa4'),_0x51553e);})[_0xfcb8('0x1d')](function(_0x2dfc8d){if(_0x2dfc8d){var _0x180e82=0xc8;var _0x55372d=_0xfcb8('0xa6');logger['info'](_0xfcb8('0x20'),_0x55372d,_0x180e82,_0xfcb8('0xa7'));logger[_0xfcb8('0x1f')](_0xfcb8('0xa8'),_0x55372d,_0x180e82,_0xfcb8('0xa7'),JSON[_0xfcb8('0x21')](_0x2dfc8d));if(_0x51553e[_0xfcb8('0x68')][_0xfcb8('0x74')]==='twilio'){return _0x52c0ca[_0xfcb8('0x28')](_0x180e82)['set'](_0xfcb8('0xa9'),_0xfcb8('0xaa'))[_0xfcb8('0xab')]('\x0a');}else{return _0x52c0ca[_0xfcb8('0x28')](_0x180e82)[_0xfcb8('0x29')](_0x2dfc8d);}}})['catch'](handleError(_0x52c0ca,null));};exports[_0xfcb8('0xac')]=function(_0x15d9ab,_0x3bcf4f){var _0x54d135=_0x15d9ab[_0xfcb8('0x4d')]['id'];var _0x1edc3b=_0x15d9ab['body'];var _0x3419bd=0xc8;var _0xbea44f=null;return db['sequelize'][_0xfcb8('0xad')]({'isolationLevel':db[_0xfcb8('0xae')][_0xfcb8('0xaf')][_0xfcb8('0xb0')][_0xfcb8('0xb1')]},function(_0x9abb91){return db[_0xfcb8('0x4a')]['findOne']({'where':{'id':_0x54d135},'transaction':_0x9abb91})[_0xfcb8('0x1d')](function(_0x8b9537){if(_0x8b9537){return db[_0xfcb8('0x67')][_0xfcb8('0x30')]({'where':{'SmsAccountId':_0x54d135},'transaction':_0x9abb91})['then'](function(){var _0x9ec8c2=_[_0xfcb8('0x47')](_0x1edc3b,function(_0x4e2031){_0x4e2031[_0xfcb8('0x5b')]=_0x54d135;return _0x4e2031;});return db['SmsApplication'][_0xfcb8('0xb2')](_0x9ec8c2,{'transaction':_0x9abb91});});}else{_0x3419bd=0x194;_0xbea44f=[];}});})[_0xfcb8('0x1d')](function(){if(_0x3419bd!==0x194){return db[_0xfcb8('0x67')][_0xfcb8('0xb3')]({'where':{'SmsAccountId':_0x54d135},'order':_0xfcb8('0xb4')})['then'](function(_0x13f93f){_0xbea44f=_0x13f93f;});}})[_0xfcb8('0x26')](function(_0x5f022f){_0x3419bd=0x1f4;logger['error'](_0x5f022f[_0xfcb8('0x33')]);if(_0x5f022f[_0xfcb8('0x34')]){delete _0x5f022f[_0xfcb8('0x34')];}_0xbea44f=_0x5f022f;})[_0xfcb8('0xb5')](function(){if(_0xbea44f===null){_0x3bcf4f['sendStatus'](_0x3419bd);}else{if(_0x3419bd===0x1f4){_0x3bcf4f[_0xfcb8('0x28')](_0x3419bd)[_0xfcb8('0xab')](_0xbea44f);}else{_0x3bcf4f['status'](_0x3419bd)[_0xfcb8('0x29')](_0xbea44f);}}});};exports['getApplications']=function(_0x4d5de5,_0x46153c,_0x518b25){var _0x2aaf41={};var _0x58edf1={};var _0xb7eb49;var _0x5eeecb;return db[_0xfcb8('0x4a')]['findOne']({'where':{'id':_0x4d5de5[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x46153c,null))[_0xfcb8('0x1d')](function(_0x32d743){if(_0x32d743){_0xb7eb49=_0x32d743;_0x58edf1['model']=_['keys'](db['SmsApplication'][_0xfcb8('0x37')]);_0x58edf1[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x4d5de5['query']);_0x58edf1[_0xfcb8('0x42')]=_[_0xfcb8('0x3d')](_0x58edf1[_0xfcb8('0x3a')],_0x58edf1[_0xfcb8('0x3b')]);_0x2aaf41[_0xfcb8('0x3e')]=_[_0xfcb8('0x3d')](_0x58edf1[_0xfcb8('0x3a')],qs[_0xfcb8('0x3f')](_0x4d5de5['query'][_0xfcb8('0x3f')]));_0x2aaf41[_0xfcb8('0x3e')]=_0x2aaf41[_0xfcb8('0x3e')][_0xfcb8('0x4e')]?_0x2aaf41[_0xfcb8('0x3e')]:_0x58edf1[_0xfcb8('0x3a')];_0x2aaf41[_0xfcb8('0x64')]=qs['sort'](_0x4d5de5[_0xfcb8('0x3b')][_0xfcb8('0x41')]);_0x2aaf41['where']=qs[_0xfcb8('0x42')](_[_0xfcb8('0x43')](_0x4d5de5[_0xfcb8('0x3b')],_0x58edf1[_0xfcb8('0x42')]));if(_0x4d5de5['query'][_0xfcb8('0x44')]){_0x2aaf41[_0xfcb8('0x45')]=_['merge'](_0x2aaf41[_0xfcb8('0x45')],{'$or':_[_0xfcb8('0x47')](_0x2aaf41[_0xfcb8('0x3e')],function(_0x5a2d0d){var _0x16ff66={};_0x16ff66[_0x5a2d0d]={'$like':'%'+_0x4d5de5[_0xfcb8('0x3b')][_0xfcb8('0x44')]+'%'};return _0x16ff66;})});}_0x2aaf41=_[_0xfcb8('0x46')]({},_0x2aaf41,_0x4d5de5[_0xfcb8('0x49')]);return _0xb7eb49[_0xfcb8('0xb6')](_0x2aaf41);}})[_0xfcb8('0x1d')](function(_0x80fc31){if(_0x80fc31){_0x5eeecb=_0x80fc31[_0xfcb8('0x4e')];if(!_0x4d5de5['query'][_0xfcb8('0x40')](_0xfcb8('0xb7'))){_0x2aaf41[_0xfcb8('0x2b')]=qs[_0xfcb8('0x2b')](_0x4d5de5[_0xfcb8('0x3b')][_0xfcb8('0x2b')]);_0x2aaf41[_0xfcb8('0x2a')]=qs[_0xfcb8('0x2a')](_0x4d5de5[_0xfcb8('0x3b')][_0xfcb8('0x2a')]);}return _0xb7eb49[_0xfcb8('0xb6')](_0x2aaf41);}})[_0xfcb8('0x1d')](function(_0xe48546){if(_0xe48546){return _0xe48546?{'count':_0x5eeecb,'rows':_0xe48546}:null;}})[_0xfcb8('0x1d')](respondWithResult(_0x46153c,null))[_0xfcb8('0x26')](handleError(_0x46153c,null));};exports['getInteractions']=function(_0x3df3f5,_0x303f6a,_0x504869){var _0x2f3667={'raw':![],'where':{}};var _0xf9c54a={};var _0x428ae7={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfcb8('0xb8')]({'where':{'id':_0x3df3f5[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x303f6a,null))[_0xfcb8('0x1d')](function(_0x1dc7e2){if(_0x1dc7e2){_0xf9c54a['model']=_[_0xfcb8('0x3c')](db['SmsInteraction'][_0xfcb8('0x37')]);_0xf9c54a[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x3df3f5[_0xfcb8('0x3b')]);_0xf9c54a[_0xfcb8('0x42')]=_[_0xfcb8('0x3d')](_0xf9c54a[_0xfcb8('0x3a')],_0xf9c54a[_0xfcb8('0x3b')]);_0x2f3667['attributes']=_[_0xfcb8('0x3d')](_0xf9c54a[_0xfcb8('0x3a')],qs['fields'](_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x3f')]));_0x2f3667[_0xfcb8('0x3e')]=_0x2f3667['attributes'][_0xfcb8('0x4e')]?_0x2f3667[_0xfcb8('0x3e')]:_0xf9c54a['model'];if(!_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x40')](_0xfcb8('0xb7'))){_0x2f3667[_0xfcb8('0x2b')]=qs[_0xfcb8('0x2b')](_0x3df3f5['query'][_0xfcb8('0x2b')]);_0x2f3667['offset']=qs[_0xfcb8('0x2a')](_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x2a')]);}_0x2f3667['order']=qs[_0xfcb8('0x41')](_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x41')]);_0x2f3667['where']=qs[_0xfcb8('0x42')](_[_0xfcb8('0x43')](_0x3df3f5[_0xfcb8('0x3b')],_0xf9c54a[_0xfcb8('0x42')]));_0x2f3667['where'][_0xfcb8('0x5b')]=_0x1dc7e2['id'];if(_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x44')]){_0x2f3667[_0xfcb8('0x45')]=_['merge'](_0x2f3667[_0xfcb8('0x45')],{'$or':_['map'](_0x2f3667[_0xfcb8('0x3e')],function(_0x5f5294){var _0x4691b6={};_0x4691b6[_0x5f5294]={'$like':'%'+_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x44')]+'%'};return _0x4691b6;})});}_0x2f3667=_[_0xfcb8('0x46')]({},_0x2f3667,_0x3df3f5[_0xfcb8('0x49')]);return db['SmsInteraction']['count']({'where':_0x2f3667[_0xfcb8('0x45')]})[_0xfcb8('0x1d')](function(_0x5cfdb7){_0x428ae7[_0xfcb8('0x2d')]=_0x5cfdb7;if(_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0x4b')]){_0x2f3667[_0xfcb8('0x4c')]=[{'model':db[_0xfcb8('0x91')],'as':'Contact','required':![]},{'model':db[_0xfcb8('0xa2')],'as':_0xfcb8('0xb9'),'attributes':[_0xfcb8('0x34'),'fullname',_0xfcb8('0xba')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfcb8('0x34'),_0xfcb8('0xbb')],'where':_0x3df3f5['query'][_0xfcb8('0xbc')]?{'id':_0x3df3f5[_0xfcb8('0x3b')][_0xfcb8('0xbc')]}:undefined,'required':_0x3df3f5['query'][_0xfcb8('0xbc')]?!![]:![]}];}return db[_0xfcb8('0x95')]['findAll'](_0x2f3667);})[_0xfcb8('0x1d')](function(_0x3b959d){_0x428ae7['rows']=_0x3b959d;return _0x428ae7;});}})[_0xfcb8('0x1d')](respondWithFilteredResult(_0x303f6a,_0x2f3667))[_0xfcb8('0x26')](handleError(_0x303f6a,null));};exports[_0xfcb8('0xab')]=function(_0x41185b,_0x1d2c77,_0xe1924e){var _0x53696b,_0x38859b,_0x26359f;if(_[_0xfcb8('0x8b')](_0x41185b['body']['body'])||_0x41185b[_0xfcb8('0x50')]['body']===''){throw new db[(_0xfcb8('0x6c'))][(_0xfcb8('0x6d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfcb8('0x8b')](_0x41185b[_0xfcb8('0x50')]['to'])){throw new db[(_0xfcb8('0x6c'))][(_0xfcb8('0x6d'))](_0xfcb8('0xbd'));}_0x53696b=_0x41185b[_0xfcb8('0x50')]['to'];return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x41185b[_0xfcb8('0x4d')]['id']},'include':[{'model':db['CmList'],'as':_0xfcb8('0xbe'),'include':[{'model':db[_0xfcb8('0x91')],'as':_0xfcb8('0x92'),'where':{'mobile':_0x53696b},'limit':0x1,'order':[[_0xfcb8('0x71'),_0xfcb8('0xbf')]]}]}]})[_0xfcb8('0x1d')](handleEntityNotFound(_0x1d2c77,null))['then'](function(_0x255acc){if(_0x255acc&&_0x255acc[_0xfcb8('0xbe')]){_0x38859b=_0x255acc[_0xfcb8('0x31')]({'plain':!![]});if(_0x38859b[_0xfcb8('0xbe')]&&_0x38859b[_0xfcb8('0xbe')][_0xfcb8('0x92')][_0xfcb8('0x4e')]){return _0x38859b[_0xfcb8('0xbe')][_0xfcb8('0x92')][0x0];}return db[_0xfcb8('0x91')][_0xfcb8('0x4f')](_[_0xfcb8('0x16')](_0x41185b['body'],{'firstName':_0x53696b,'mobile':_0x53696b,'phone':_0x53696b,'ListId':_0x38859b[_0xfcb8('0x72')]}));}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x1d2c77,null))[_0xfcb8('0x1d')](function(_0x2de1d3){if(_0x2de1d3){_0x26359f=_0x2de1d3;return db[_0xfcb8('0x95')][_0xfcb8('0x54')]({'where':{'ContactId':_0x26359f['id'],'closed':![],'SmsAccountId':_0x38859b['id']}})[_0xfcb8('0x1d')](function(_0x567cde){if(_0x567cde){return[_0x567cde,![]];}return db[_0xfcb8('0x95')][_0xfcb8('0x4f')]({'UserId':_0x41185b[_0xfcb8('0x51')]['id'],'ContactId':_0x26359f['id'],'SmsAccountId':_0x38859b['id'],'phone':_0x53696b,'firstMsgDirection':_0xfcb8('0xc0'),'Messages':[_[_0xfcb8('0x46')](_0x41185b['body'],{'read':![],'body':_0x41185b[_0xfcb8('0x50')]['body'],'phone':_0x53696b,'SmsAccountId':_0x38859b['id'],'UserId':_0x41185b[_0xfcb8('0x51')]['id'],'ContactId':_0x26359f['id']})]},{'include':[{'model':db[_0xfcb8('0x9e')],'as':_0xfcb8('0xc1')}]})[_0xfcb8('0x1d')](function(_0x56e2e5){return[_0x56e2e5,!![]];});});}})[_0xfcb8('0x96')](function(_0x847c38,_0x3cfd2e){if(_0x3cfd2e){return _0x847c38;}return db[_0xfcb8('0x9e')][_0xfcb8('0x4f')](_[_0xfcb8('0x46')](_0x41185b['body'],{'read':![],'body':_0x41185b[_0xfcb8('0x50')]['body'],'phone':_0x53696b,'SmsAccountId':_0x38859b['id'],'SmsInteractionId':_0x847c38['id'],'UserId':_0x41185b[_0xfcb8('0x51')]['id'],'ContactId':_0x26359f['id']}))[_0xfcb8('0x1d')](function(_0x35704a){_0x847c38[_0xfcb8('0xc2')]['Messages']=[];_0x847c38[_0xfcb8('0xc2')][_0xfcb8('0xc1')][_0xfcb8('0x9a')](_0x35704a[_0xfcb8('0xc2')]);return _0x847c38;});})[_0xfcb8('0x1d')](respondWithResult(_0x1d2c77,null))[_0xfcb8('0x26')](handleError(_0x1d2c77,null));};exports['status']=function(_0x45c8c9,_0x81e90b,_0x250004){if(_0x45c8c9[_0xfcb8('0x50')]['id']){delete _0x45c8c9['body']['id'];}var _0x2f9a6e,_0x30537a,_0x43d191;return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x45c8c9[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x81e90b,null))[_0xfcb8('0x1d')](function(_0x282de5){if(_0x282de5){_0x43d191=_0x282de5;logger[_0xfcb8('0x1f')](_0xfcb8('0x20'),'status','received\x20delivery\x20report\x20from',_0x282de5['type'],util[_0xfcb8('0xc3')](_0x45c8c9[_0xfcb8('0x50')],{'showHidden':![],'depth':null}));switch(_0x282de5[_0xfcb8('0x74')]){case _0xfcb8('0x7a'):if(_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc4')]&&_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0x28')]){_0x30537a=_0x45c8c9[_0xfcb8('0x50')]['status'];return db[_0xfcb8('0x9e')][_0xfcb8('0x54')]({'where':{'messageId':_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc4')]}});}break;case _0xfcb8('0x7c'):if(_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc5')]&&_0x45c8c9['body'][_0xfcb8('0xc6')]){_0x30537a=_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc6')];return db[_0xfcb8('0x9e')][_0xfcb8('0x54')]({'where':{'messageId':_0x45c8c9[_0xfcb8('0x50')]['requestid']}});}break;case _0xfcb8('0x7d'):if(_0x45c8c9['body'][_0xfcb8('0x7e')]&&_0x45c8c9[_0xfcb8('0x50')]['status_code']){_0x30537a=_0x45c8c9[_0xfcb8('0x50')]['status_code'];return db[_0xfcb8('0x9e')][_0xfcb8('0x54')]({'where':{'messageId':_0x45c8c9['body']['message_id']}});}break;case _0xfcb8('0x81'):var _0x49c4fa=_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0x82')][0x0];if(_0x49c4fa[_0xfcb8('0x78')]&&_0x49c4fa[_0xfcb8('0x28')][_0xfcb8('0xc7')]===_0xfcb8('0xc8')){_0x30537a=_0x49c4fa[_0xfcb8('0x28')][_0xfcb8('0xc7')];return db[_0xfcb8('0x9e')][_0xfcb8('0x54')]({'where':{'messageId':_0x49c4fa[_0xfcb8('0x78')]}});}break;case _0xfcb8('0x86'):if(_0x45c8c9[_0xfcb8('0x50')]['messageId']&&_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0x28')]){_0x30537a=_0x45c8c9['body']['status'];return db[_0xfcb8('0x9e')]['find']({'where':{'messageId':_0x45c8c9['body']['messageId']}});}break;case'bandwidth':if(_0x45c8c9[_0xfcb8('0x50')][0x0][_0xfcb8('0x25')]['id']){_0x30537a=_0x45c8c9[_0xfcb8('0x50')][0x0][_0xfcb8('0x74')];return db['SmsMessage'][_0xfcb8('0x54')]({'where':{'messageId':_0x45c8c9[_0xfcb8('0x50')][0x0]['message']['id']}});}break;case _0xfcb8('0x89'):if(_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc9')]&&_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0x28')]){_0x30537a=_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0x28')];return db['SmsMessage'][_0xfcb8('0x54')]({'where':{'messageId':_0x45c8c9[_0xfcb8('0x50')][_0xfcb8('0xc9')]}});}break;}}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x81e90b,null))[_0xfcb8('0x1d')](function(_0xd2d102){if(_0xd2d102){_0x2f9a6e=_0xd2d102;switch(_0x43d191[_0xfcb8('0x74')]){case _0xfcb8('0x7a'):if(_0x30537a===_0xfcb8('0xc8')){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger[_0xfcb8('0x22')](_0xfcb8('0x20'),_0xfcb8('0x28'),'skebby',util[_0xfcb8('0xc3')](_0x45c8c9['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x30537a==='1'){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger[_0xfcb8('0x22')](_0xfcb8('0x20'),_0xfcb8('0x28'),_0xfcb8('0x7a'),util[_0xfcb8('0xc3')](_0x45c8c9['body'],{'showHidden':![],'depth':null}));}break;case _0xfcb8('0x7d'):if(!_0x45c8c9[_0xfcb8('0x50')]['error_code']&&_0x30537a>=0xc8&&_0x30537a<=0xce){return _0x2f9a6e['update']({'read':!![]});}else{logger[_0xfcb8('0x22')](_0xfcb8('0x20'),_0xfcb8('0x28'),'clicksend',util[_0xfcb8('0xc3')](_0x45c8c9[_0xfcb8('0x50')],{'showHidden':![],'depth':null}));}break;case _0xfcb8('0x81'):var _0x327298=_0x45c8c9['body'][_0xfcb8('0x82')][0x0];if(_0x327298[_0xfcb8('0x28')]['groupName']==='DELIVERED'){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger['error'](_0xfcb8('0x20'),'status',_0xfcb8('0x81'),util[_0xfcb8('0xc3')](_0x45c8c9['body'],{'showHidden':![],'depth':null}));}break;case _0xfcb8('0x86'):if(_0x30537a==_0xfcb8('0xca')||_0x30537a==_0xfcb8('0xcb')){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger[_0xfcb8('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfcb8('0x28'),_0xfcb8('0x86'),util[_0xfcb8('0xc3')](_0x45c8c9[_0xfcb8('0x50')],{'showHidden':![],'depth':null}));}break;case _0xfcb8('0xcc'):if(_0x30537a==_0xfcb8('0xcd')){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger['error'](_0xfcb8('0x20'),_0xfcb8('0x28'),'bandwidth',util[_0xfcb8('0xc3')](_0x45c8c9[_0xfcb8('0x50')],{'showHidden':![],'depth':null}));}break;case _0xfcb8('0x89'):if(_0x30537a===_0xfcb8('0xce')||_0x30537a==='ACCEPTD'){return _0x2f9a6e[_0xfcb8('0x58')]({'read':!![]});}else{logger[_0xfcb8('0x22')](_0xfcb8('0x20'),'status',_0xfcb8('0x89'),util[_0xfcb8('0xc3')](_0x45c8c9['body'],{'showHidden':![],'depth':null}));}break;}return _0x2f9a6e;}})['then'](respondWithResult(_0x81e90b,null))[_0xfcb8('0x26')](handleError(_0x81e90b,null));};exports['statusGet']=function(_0x523237,_0x2878d0,_0x233327){var _0x2dac6d,_0x15f500,_0x59d6ff;return db[_0xfcb8('0x4a')]['find']({'where':{'id':_0x523237[_0xfcb8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2878d0,null))[_0xfcb8('0x1d')](function(_0x374aae){if(_0x374aae){_0x59d6ff=_0x374aae;logger['debug'](_0xfcb8('0x20'),_0xfcb8('0x28'),'received\x20delivery\x20report\x20from',_0x374aae[_0xfcb8('0x74')],util[_0xfcb8('0xc3')](_0x523237[_0xfcb8('0x3b')],{'showHidden':![],'depth':null}));switch(_0x374aae['type']){case'csc':if(_0x523237[_0xfcb8('0x3b')]['message-id']&&_0x523237['query']['state']){_0x15f500=_0x523237['query']['state'];return db[_0xfcb8('0x9e')][_0xfcb8('0x54')]({'where':{'messageId':_0x523237[_0xfcb8('0x3b')][_0xfcb8('0xcf')]}});}break;}}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x2878d0,null))[_0xfcb8('0x1d')](function(_0x3e68d5){if(_0x3e68d5){_0x2dac6d=_0x3e68d5;switch(_0x59d6ff[_0xfcb8('0x74')]){case _0xfcb8('0xd0'):if(_0x15f500==='2'||_0x15f500==='6'){return _0x2dac6d[_0xfcb8('0x58')]({'read':!![]});}else{logger[_0xfcb8('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfcb8('0xd0'),util[_0xfcb8('0xc3')](_0x523237['query'],{'showHidden':![],'depth':null}));};break;}return _0x2dac6d;}})['then'](respondWithResult(_0x2878d0,null))[_0xfcb8('0x26')](handleError(_0x2878d0,null));};exports[_0xfcb8('0xd1')]=function(_0x4fe9b2,_0x366f45,_0x1f3b4b){return db['SmsAccount']['find']({'where':{'id':_0x4fe9b2[_0xfcb8('0x4d')]['id']}})['then'](handleEntityNotFound(_0x366f45,null))['then'](function(_0x310315){if(_0x310315){return _0x310315[_0xfcb8('0xd1')](_0x4fe9b2[_0xfcb8('0x50')][_0xfcb8('0x60')],_[_0xfcb8('0xd2')](_0x4fe9b2[_0xfcb8('0x50')],[_0xfcb8('0x60'),'id'])||{})['spread'](function(_0x4f232d){for(var _0x11e2e0=0x0;_0x11e2e0<_0x4fe9b2['body']['ids'][_0xfcb8('0x4e')];_0x11e2e0+=0x1){socket[_0xfcb8('0xd3')](_0xfcb8('0xd4'),{'UserId':Number(_0x4fe9b2[_0xfcb8('0x50')][_0xfcb8('0x60')][_0x11e2e0]),'SmsAccountId':Number(_0x4fe9b2[_0xfcb8('0x4d')]['id'])});}return _0x4f232d;});}})[_0xfcb8('0x1d')](respondWithResult(_0x366f45,null))[_0xfcb8('0x26')](handleError(_0x366f45,null));};exports[_0xfcb8('0xd5')]=function(_0x331711,_0x1a3571,_0x3ec732){return db[_0xfcb8('0x4a')][_0xfcb8('0x54')]({'where':{'id':_0x331711[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x1a3571,null))[_0xfcb8('0x1d')](function(_0x36b711){if(_0x36b711){return _0x36b711[_0xfcb8('0xd5')](_0x331711[_0xfcb8('0x3b')]['ids'])[_0xfcb8('0x1d')](function(){if(_[_0xfcb8('0xd6')](_0x331711[_0xfcb8('0x3b')][_0xfcb8('0x60')])){for(var _0x1350dc=0x0;_0x1350dc<_0x331711['query']['ids'][_0xfcb8('0x4e')];_0x1350dc+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x331711[_0xfcb8('0x3b')][_0xfcb8('0x60')][_0x1350dc]),'SmsAccountId':Number(_0x331711['params']['id'])});}}else{socket['emit'](_0xfcb8('0xd7'),{'UserId':Number(_0x331711[_0xfcb8('0x3b')]['ids']),'SmsAccountId':Number(_0x331711[_0xfcb8('0x4d')]['id'])});}});}})[_0xfcb8('0x1d')](respondWithStatusCode(_0x1a3571,null))[_0xfcb8('0x26')](handleError(_0x1a3571,null));};exports['getAgents']=function(_0x1ad67a,_0x37eb8b,_0x37e47c){var _0x197305={};var _0x867df4={};var _0x309fb4;var _0x59e3c5;return db[_0xfcb8('0x4a')][_0xfcb8('0xb8')]({'where':{'id':_0x1ad67a[_0xfcb8('0x4d')]['id']}})[_0xfcb8('0x1d')](handleEntityNotFound(_0x37eb8b,null))[_0xfcb8('0x1d')](function(_0x5a7b44){if(_0x5a7b44){_0x309fb4=_0x5a7b44;_0x867df4[_0xfcb8('0x3a')]=_[_0xfcb8('0x3c')](db[_0xfcb8('0xa2')][_0xfcb8('0x37')]);_0x867df4[_0xfcb8('0x3b')]=_[_0xfcb8('0x3c')](_0x1ad67a[_0xfcb8('0x3b')]);_0x867df4[_0xfcb8('0x42')]=_['intersection'](_0x867df4[_0xfcb8('0x3a')],_0x867df4[_0xfcb8('0x3b')]);_0x197305['attributes']=_['intersection'](_0x867df4[_0xfcb8('0x3a')],qs[_0xfcb8('0x3f')](_0x1ad67a[_0xfcb8('0x3b')][_0xfcb8('0x3f')]));_0x197305['attributes']=_0x197305[_0xfcb8('0x3e')]['length']?_0x197305[_0xfcb8('0x3e')]:_0x867df4[_0xfcb8('0x3a')];_0x197305[_0xfcb8('0x64')]=qs[_0xfcb8('0x41')](_0x1ad67a[_0xfcb8('0x3b')][_0xfcb8('0x41')]);_0x197305[_0xfcb8('0x45')]=qs[_0xfcb8('0x42')](_['pick'](_0x1ad67a[_0xfcb8('0x3b')],_0x867df4[_0xfcb8('0x42')]));if(_0x1ad67a[_0xfcb8('0x3b')]['filter']){_0x197305[_0xfcb8('0x45')]=_[_0xfcb8('0x46')](_0x197305[_0xfcb8('0x45')],{'$or':_['map'](_0x197305[_0xfcb8('0x3e')],function(_0x3676f6){var _0xcba341={};_0xcba341[_0x3676f6]={'$like':'%'+_0x1ad67a[_0xfcb8('0x3b')][_0xfcb8('0x44')]+'%'};return _0xcba341;})});}_0x197305=_[_0xfcb8('0x46')]({},_0x197305,_0x1ad67a[_0xfcb8('0x49')]);return _0x309fb4[_0xfcb8('0xd8')](_0x197305);}})[_0xfcb8('0x1d')](function(_0x4d9dc8){if(_0x4d9dc8){_0x59e3c5=_0x4d9dc8[_0xfcb8('0x4e')];if(!_0x1ad67a[_0xfcb8('0x3b')][_0xfcb8('0x40')]('nolimit')){_0x197305['limit']=qs[_0xfcb8('0x2b')](_0x1ad67a[_0xfcb8('0x3b')]['limit']);_0x197305[_0xfcb8('0x2a')]=qs[_0xfcb8('0x2a')](_0x1ad67a[_0xfcb8('0x3b')]['offset']);}return _0x309fb4[_0xfcb8('0xd8')](_0x197305);}})['then'](function(_0x102e18){if(_0x102e18){return _0x102e18?{'count':_0x59e3c5,'rows':_0x102e18}:null;}})[_0xfcb8('0x1d')](respondWithResult(_0x37eb8b,null))['catch'](handleError(_0x37eb8b,null));}; \ No newline at end of file +var _0xab9a=['where','pick','filter','merge','options','includeAll','rows','show','Pause','mandatoryDispositionPause','rawAttributes','intersection','fields','include','create','body','user','role','get','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','findOne','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','plivo','Text','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','SmsMessage','ContactId','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','stringify','text/xml','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','color','tag','to\x20is\x20mandatory','List','ListId','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','message_id','status_code','infobip','groupName','DELIVERED','redif','update','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','csc','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','SmsAccounts','destroy','end','name','send','index','map','SmsAccount','fieldName','type','key','keys','filters','model','query','attributes','length','nolimit','order','sort'];(function(_0x3a1b36,_0x483009){var _0x25350e=function(_0x523fbb){while(--_0x523fbb){_0x3a1b36['push'](_0x3a1b36['shift']());}};_0x25350e(++_0x483009);}(_0xab9a,0x182));var _0xaab9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xab9a[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xaab9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaab9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaab9('0x2'));var moment=require(_0xaab9('0x3'));var BPromise=require(_0xaab9('0x4'));var Mustache=require(_0xaab9('0x5'));var util=require('util');var path=require('path');var sox=require(_0xaab9('0x6'));var csv=require(_0xaab9('0x7'));var ejs=require(_0xaab9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaab9('0x9'));var crypto=require(_0xaab9('0xa'));var jsforce=require(_0xaab9('0xb'));var deskjs=require(_0xaab9('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaab9('0xd'));var Papa=require(_0xaab9('0xe'));var Redis=require(_0xaab9('0xf'));var authService=require(_0xaab9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaab9('0x11'));var hardwareService=require(_0xaab9('0x12'));var logger=require('../../config/logger')(_0xaab9('0x13'));var utils=require(_0xaab9('0x14'));var config=require(_0xaab9('0x15'));var licenseUtil=require(_0xaab9('0x16'));var db=require(_0xaab9('0x17'))['db'];config[_0xaab9('0x18')]=_[_0xaab9('0x19')](config['redis'],{'host':_0xaab9('0x1a'),'port':0x18eb});var socket=require(_0xaab9('0x1b'))(new Redis(config[_0xaab9('0x18')]));require(_0xaab9('0x1c'))[_0xaab9('0x1d')](socket);var jayson=require(_0xaab9('0x1e'));var client=jayson[_0xaab9('0x1f')][_0xaab9('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x196c96,_0x3f8540,_0xae7d30,_0x27a7ea){return new BPromise(function(_0x5363ee,_0x185443){var _0x4881d9=_0x27a7ea||client;return _0x4881d9[_0xaab9('0x21')](_0x196c96,_0xae7d30)[_0xaab9('0x22')](function(_0x474f29){logger['info'](_0xaab9('0x23'),_0x3f8540,'request\x20sent');logger[_0xaab9('0x24')](_0xaab9('0x25'),_0x3f8540,_0xaab9('0x26'),JSON['stringify'](_0x474f29));if(_0x474f29[_0xaab9('0x27')]){if(_0x474f29[_0xaab9('0x27')][_0xaab9('0x28')]===0x1f4){logger['error'](_0xaab9('0x23'),_0x3f8540,_0x474f29['error'][_0xaab9('0x29')]);return _0x185443(_0x474f29[_0xaab9('0x27')][_0xaab9('0x29')]);}logger['error'](_0xaab9('0x23'),_0x3f8540,_0x474f29['error']['message']);return _0x5363ee(_0x474f29['error'][_0xaab9('0x29')]);}else{logger[_0xaab9('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x3f8540,_0xaab9('0x26'));_0x5363ee(_0x474f29['result'][_0xaab9('0x29')]);}})[_0xaab9('0x2b')](function(_0x347868){logger[_0xaab9('0x27')](_0xaab9('0x23'),_0x3f8540,_0x347868);_0x185443(_0x347868);});});}function respondWithStatusCode(_0x1c82e0,_0x300014){_0x300014=_0x300014||0xcc;return function(_0x5e83b8){if(_0x5e83b8){return _0x1c82e0[_0xaab9('0x2c')](_0x300014);}return _0x1c82e0[_0xaab9('0x2d')](_0x300014)['end']();};}function respondWithResult(_0x297050,_0x560842){_0x560842=_0x560842||0xc8;return function(_0x2aad4c){if(_0x2aad4c){return _0x297050[_0xaab9('0x2d')](_0x560842)[_0xaab9('0x2e')](_0x2aad4c);}};}function respondWithFilteredResult(_0x1f1eef,_0x5916fd){return function(_0x5c7ef3){if(_0x5c7ef3){var _0x2bfce7=typeof _0x5916fd[_0xaab9('0x2f')]===_0xaab9('0x30')&&typeof _0x5916fd[_0xaab9('0x31')]===_0xaab9('0x30');var _0x1d601f=_0x5c7ef3[_0xaab9('0x32')];var _0x539a5f=_0x2bfce7?0x0:_0x5916fd['offset'];var _0x2a30af=_0x2bfce7?_0x5c7ef3[_0xaab9('0x32')]:_0x5916fd['offset']+_0x5916fd[_0xaab9('0x31')];var _0x16fb10;if(_0x2a30af>=_0x1d601f){_0x2a30af=_0x1d601f;_0x16fb10=0xc8;}else{_0x16fb10=0xce;}_0x1f1eef[_0xaab9('0x2d')](_0x16fb10);return _0x1f1eef[_0xaab9('0x33')](_0xaab9('0x34'),_0x539a5f+'-'+_0x2a30af+'/'+_0x1d601f)[_0xaab9('0x2e')](_0x5c7ef3);}return null;};}function patchUpdates(_0x1b54d5){return function(_0x14c7d6){try{jsonpatch[_0xaab9('0x35')](_0x14c7d6,_0x1b54d5,!![]);}catch(_0x1c3b9d){return BPromise[_0xaab9('0x36')](_0x1c3b9d);}return _0x14c7d6[_0xaab9('0x37')]();};}function saveUpdates(_0x4e54dd,_0x5ebc43){return function(_0x5042b1){if(_0x5042b1){return _0x5042b1['update'](_0x4e54dd)[_0xaab9('0x22')](function(_0x29747b){return _0x29747b;});}return null;};}function removeEntity(_0x483b62,_0xe491b1){return function(_0x551754){if(_0x551754){return _0x551754['destroy']()[_0xaab9('0x22')](function(){var _0x3ae8ff=_0x551754['get']({'plain':!![]});var _0xd9e8ee=_0xaab9('0x38');return db['UserProfileResource'][_0xaab9('0x39')]({'where':{'type':_0xd9e8ee,'resourceId':_0x3ae8ff['id']}})[_0xaab9('0x22')](function(){return _0x551754;});})[_0xaab9('0x22')](function(){_0x483b62[_0xaab9('0x2d')](0xcc)[_0xaab9('0x3a')]();});}};}function handleEntityNotFound(_0x404bc8,_0x396a8c){return function(_0x56ed11){if(!_0x56ed11){_0x404bc8['sendStatus'](0x194);}return _0x56ed11;};}function handleError(_0x1946ad,_0x2bb45d){_0x2bb45d=_0x2bb45d||0x1f4;return function(_0x23fd1f){logger[_0xaab9('0x27')](_0x23fd1f['stack']);if(_0x23fd1f[_0xaab9('0x3b')]){delete _0x23fd1f['name'];}_0x1946ad[_0xaab9('0x2d')](_0x2bb45d)[_0xaab9('0x3c')](_0x23fd1f);};}exports[_0xaab9('0x3d')]=function(_0x4c2145,_0x9bc02b){var _0x52d3a6={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4a48bb={},_0x2a6b4f={'count':0x0,'rows':[]};var _0x412523=_[_0xaab9('0x3e')](db[_0xaab9('0x3f')]['rawAttributes'],function(_0x26a94e){return{'name':_0x26a94e[_0xaab9('0x40')],'type':_0x26a94e[_0xaab9('0x41')][_0xaab9('0x42')]};});_0x4a48bb['model']=_[_0xaab9('0x3e')](_0x412523,_0xaab9('0x3b'));_0x4a48bb['query']=_[_0xaab9('0x43')](_0x4c2145['query']);_0x4a48bb[_0xaab9('0x44')]=_['intersection'](_0x4a48bb[_0xaab9('0x45')],_0x4a48bb[_0xaab9('0x46')]);_0x52d3a6[_0xaab9('0x47')]=_['intersection'](_0x4a48bb[_0xaab9('0x45')],qs['fields'](_0x4c2145[_0xaab9('0x46')]['fields']));_0x52d3a6[_0xaab9('0x47')]=_0x52d3a6[_0xaab9('0x47')][_0xaab9('0x48')]?_0x52d3a6[_0xaab9('0x47')]:_0x4a48bb[_0xaab9('0x45')];if(!_0x4c2145[_0xaab9('0x46')]['hasOwnProperty'](_0xaab9('0x49'))){_0x52d3a6['limit']=qs['limit'](_0x4c2145[_0xaab9('0x46')]['limit']);_0x52d3a6[_0xaab9('0x2f')]=qs[_0xaab9('0x2f')](_0x4c2145[_0xaab9('0x46')][_0xaab9('0x2f')]);}_0x52d3a6[_0xaab9('0x4a')]=qs[_0xaab9('0x4b')](_0x4c2145[_0xaab9('0x46')][_0xaab9('0x4b')]);_0x52d3a6[_0xaab9('0x4c')]=qs[_0xaab9('0x44')](_[_0xaab9('0x4d')](_0x4c2145[_0xaab9('0x46')],_0x4a48bb[_0xaab9('0x44')]),_0x412523);if(_0x4c2145[_0xaab9('0x46')][_0xaab9('0x4e')]){_0x52d3a6[_0xaab9('0x4c')]=_['merge'](_0x52d3a6['where'],{'$or':_[_0xaab9('0x3e')](_0x412523,function(_0x581110){if(_0x581110['type']!=='VIRTUAL'){var _0x1635a2={};_0x1635a2[_0x581110[_0xaab9('0x3b')]]={'$like':'%'+_0x4c2145[_0xaab9('0x46')][_0xaab9('0x4e')]+'%'};return _0x1635a2;}})});}_0x52d3a6=_[_0xaab9('0x4f')]({},_0x52d3a6,_0x4c2145[_0xaab9('0x50')]);var _0x410cc5={'where':_0x52d3a6[_0xaab9('0x4c')]};return db[_0xaab9('0x3f')]['count'](_0x410cc5)[_0xaab9('0x22')](function(_0x44b03c){_0x2a6b4f['count']=_0x44b03c;if(_0x4c2145[_0xaab9('0x46')][_0xaab9('0x51')]){_0x52d3a6['include']=[{'all':!![]}];}return db[_0xaab9('0x3f')]['findAll'](_0x52d3a6);})[_0xaab9('0x22')](function(_0x59a8a6){_0x2a6b4f[_0xaab9('0x52')]=_0x59a8a6;return _0x2a6b4f;})[_0xaab9('0x22')](respondWithFilteredResult(_0x9bc02b,_0x52d3a6))['catch'](handleError(_0x9bc02b,null));};exports[_0xaab9('0x53')]=function(_0x3e1c3a,_0x2610e7){var _0x1a8049={'raw':![],'where':{'id':_0x3e1c3a['params']['id']},'include':[{'model':db[_0xaab9('0x54')],'as':_0xaab9('0x55')}]},_0xb0577d={};_0xb0577d[_0xaab9('0x45')]=_['keys'](db[_0xaab9('0x3f')][_0xaab9('0x56')]);_0xb0577d[_0xaab9('0x46')]=_[_0xaab9('0x43')](_0x3e1c3a[_0xaab9('0x46')]);_0xb0577d[_0xaab9('0x44')]=_[_0xaab9('0x57')](_0xb0577d[_0xaab9('0x45')],_0xb0577d[_0xaab9('0x46')]);_0x1a8049['attributes']=_[_0xaab9('0x57')](_0xb0577d[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x3e1c3a[_0xaab9('0x46')][_0xaab9('0x58')]));_0x1a8049[_0xaab9('0x47')]=_0x1a8049[_0xaab9('0x47')][_0xaab9('0x48')]?_0x1a8049[_0xaab9('0x47')]:_0xb0577d[_0xaab9('0x45')];if(_0x3e1c3a[_0xaab9('0x46')][_0xaab9('0x51')]){_0x1a8049[_0xaab9('0x59')]=[{'all':!![]}];}_0x1a8049=_[_0xaab9('0x4f')]({},_0x1a8049,_0x3e1c3a['options']);return db[_0xaab9('0x3f')]['find'](_0x1a8049)[_0xaab9('0x22')](handleEntityNotFound(_0x2610e7,null))[_0xaab9('0x22')](respondWithResult(_0x2610e7,null))[_0xaab9('0x2b')](handleError(_0x2610e7,null));};exports[_0xaab9('0x5a')]=function(_0x59535d,_0x12ef02){return db[_0xaab9('0x3f')][_0xaab9('0x5a')](_0x59535d[_0xaab9('0x5b')],{})[_0xaab9('0x22')](function(_0x4e54f2){var _0x1b6b75=_0x59535d[_0xaab9('0x5c')]['get']({'plain':!![]});if(!_0x1b6b75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b6b75[_0xaab9('0x5d')]===_0xaab9('0x5c')){var _0x416a8e=_0x4e54f2[_0xaab9('0x5e')]({'plain':!![]});var _0x2d6af4=_0xaab9('0x38');return db['UserProfileSection'][_0xaab9('0x5f')]({'where':{'name':_0x2d6af4,'userProfileId':_0x1b6b75['userProfileId']},'raw':!![]})['then'](function(_0x1f69dc){if(_0x1f69dc&&_0x1f69dc['autoAssociation']===0x0){return db[_0xaab9('0x60')]['create']({'name':_0x416a8e[_0xaab9('0x3b')],'resourceId':_0x416a8e['id'],'type':_0x1f69dc[_0xaab9('0x3b')],'sectionId':_0x1f69dc['id']},{})['then'](function(){return _0x4e54f2;});}else{return _0x4e54f2;}})[_0xaab9('0x2b')](function(_0x13f4fe){logger[_0xaab9('0x27')](_0xaab9('0x61'),_0x13f4fe);throw _0x13f4fe;});}return _0x4e54f2;})[_0xaab9('0x22')](respondWithResult(_0x12ef02,0xc9))[_0xaab9('0x2b')](handleError(_0x12ef02,null));};exports['update']=function(_0x5b0d9f,_0xf4463c){if(_0x5b0d9f[_0xaab9('0x5b')]['id']){delete _0x5b0d9f['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5b0d9f[_0xaab9('0x62')]['id']},'include':[{'model':db[_0xaab9('0x54')],'as':_0xaab9('0x55')}]})[_0xaab9('0x22')](handleEntityNotFound(_0xf4463c,null))[_0xaab9('0x22')](saveUpdates(_0x5b0d9f[_0xaab9('0x5b')],null))['then'](respondWithResult(_0xf4463c,null))[_0xaab9('0x2b')](handleError(_0xf4463c,null));};exports['destroy']=function(_0x1b9143,_0x1f6693){return db['SmsAccount'][_0xaab9('0x5f')]({'where':{'id':_0x1b9143[_0xaab9('0x62')]['id']}})['then'](handleEntityNotFound(_0x1f6693,null))[_0xaab9('0x22')](removeEntity(_0x1f6693,null))[_0xaab9('0x2b')](handleError(_0x1f6693,null));};exports[_0xaab9('0x63')]=function(_0x378ecd,_0x525d72){return db[_0xaab9('0x3f')][_0xaab9('0x63')]()[_0xaab9('0x22')](respondWithResult(_0x525d72,null))[_0xaab9('0x2b')](handleError(_0x525d72,null));};exports['addDisposition']=function(_0x19f786,_0x5ba2db,_0x3f605f){if(_0x19f786['body']['id']){delete _0x19f786['body']['id'];}return db[_0xaab9('0x3f')][_0xaab9('0x5f')]({'where':{'id':_0x19f786['params']['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x5ba2db,null))[_0xaab9('0x22')](function(_0x1c18bb){if(_0x1c18bb){_0x19f786[_0xaab9('0x5b')][_0xaab9('0x64')]=_0x1c18bb['id'];return db[_0xaab9('0x65')][_0xaab9('0x5a')](_0x19f786['body']);}})[_0xaab9('0x22')](respondWithResult(_0x5ba2db,null))[_0xaab9('0x2b')](handleError(_0x5ba2db,null));};exports['getDispositions']=function(_0x15c0e6,_0x54a7c1,_0x2eae34){var _0x44e11e={'raw':![],'where':{}};var _0x5dd549={};var _0x48316a={'count':0x0,'rows':[]};return db['SmsAccount'][_0xaab9('0x66')]({'where':{'id':_0x15c0e6['params']['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x54a7c1,null))[_0xaab9('0x22')](function(_0x235708){if(_0x235708){_0x5dd549[_0xaab9('0x45')]=_['keys'](db[_0xaab9('0x65')][_0xaab9('0x56')]);_0x5dd549[_0xaab9('0x46')]=_['keys'](_0x15c0e6['query']);_0x5dd549[_0xaab9('0x44')]=_[_0xaab9('0x57')](_0x5dd549[_0xaab9('0x45')],_0x5dd549['query']);_0x44e11e['attributes']=_[_0xaab9('0x57')](_0x5dd549[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x15c0e6[_0xaab9('0x46')][_0xaab9('0x58')]));_0x44e11e[_0xaab9('0x47')]=_0x44e11e[_0xaab9('0x47')][_0xaab9('0x48')]?_0x44e11e[_0xaab9('0x47')]:_0x5dd549[_0xaab9('0x45')];if(!_0x15c0e6[_0xaab9('0x46')][_0xaab9('0x67')](_0xaab9('0x49'))){_0x44e11e[_0xaab9('0x31')]=qs[_0xaab9('0x31')](_0x15c0e6['query'][_0xaab9('0x31')]);_0x44e11e[_0xaab9('0x2f')]=qs[_0xaab9('0x2f')](_0x15c0e6['query'][_0xaab9('0x2f')]);}_0x44e11e[_0xaab9('0x4a')]=qs['sort'](_0x15c0e6[_0xaab9('0x46')]['sort']);_0x44e11e[_0xaab9('0x4c')]=qs[_0xaab9('0x44')](_[_0xaab9('0x4d')](_0x15c0e6[_0xaab9('0x46')],_0x5dd549[_0xaab9('0x44')]));_0x44e11e[_0xaab9('0x4c')][_0xaab9('0x64')]=_0x235708['id'];if(_0x15c0e6[_0xaab9('0x46')]['filter']){_0x44e11e['where']=_[_0xaab9('0x4f')](_0x44e11e[_0xaab9('0x4c')],{'$or':_[_0xaab9('0x3e')](_0x44e11e['attributes'],function(_0x3c9d24){var _0x5441ec={};_0x5441ec[_0x3c9d24]={'$like':'%'+_0x15c0e6[_0xaab9('0x46')]['filter']+'%'};return _0x5441ec;})});}_0x44e11e=_['merge']({},_0x44e11e,_0x15c0e6['options']);return db[_0xaab9('0x65')][_0xaab9('0x32')]({'where':_0x44e11e[_0xaab9('0x4c')]})[_0xaab9('0x22')](function(_0xa02b17){_0x48316a[_0xaab9('0x32')]=_0xa02b17;if(_0x15c0e6['query'][_0xaab9('0x51')]){_0x44e11e[_0xaab9('0x59')]=[{'all':!![]}];}return db[_0xaab9('0x65')][_0xaab9('0x68')](_0x44e11e);})[_0xaab9('0x22')](function(_0x3456de){_0x48316a[_0xaab9('0x52')]=_0x3456de;return _0x48316a;});}})['then'](respondWithFilteredResult(_0x54a7c1,_0x44e11e))['catch'](handleError(_0x54a7c1,null));};exports[_0xaab9('0x69')]=function(_0x19872d,_0x473abf,_0x235415){return db[_0xaab9('0x3f')]['find']({'where':{'id':_0x19872d[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x473abf,null))[_0xaab9('0x22')](function(_0x348085){if(_0x348085){return _0x348085[_0xaab9('0x69')](_0x19872d[_0xaab9('0x46')][_0xaab9('0x6a')]);}})[_0xaab9('0x22')](respondWithStatusCode(_0x473abf,null))[_0xaab9('0x2b')](handleError(_0x473abf,null));};exports[_0xaab9('0x6b')]=function(_0xce966d,_0x2bc2fd,_0x2e2c75){if(_0xce966d[_0xaab9('0x5b')]['id']){delete _0xce966d[_0xaab9('0x5b')]['id'];}return db[_0xaab9('0x3f')][_0xaab9('0x5f')]({'where':{'id':_0xce966d[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x2bc2fd,null))[_0xaab9('0x22')](function(_0x1cff05){if(_0x1cff05){_0xce966d[_0xaab9('0x5b')]['SmsAccountId']=_0x1cff05['id'];return db[_0xaab9('0x6c')]['create'](_0xce966d['body']);}})[_0xaab9('0x22')](respondWithResult(_0x2bc2fd,null))[_0xaab9('0x2b')](handleError(_0x2bc2fd,null));};exports[_0xaab9('0x6d')]=function(_0x828a5f,_0x129ffe,_0xbaacc1){var _0x37d170={'raw':![],'where':{}};var _0x192567={};var _0x217414={'count':0x0,'rows':[]};return db[_0xaab9('0x3f')][_0xaab9('0x66')]({'where':{'id':_0x828a5f['params']['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x129ffe,null))[_0xaab9('0x22')](function(_0x392753){if(_0x392753){_0x192567[_0xaab9('0x45')]=_[_0xaab9('0x43')](db[_0xaab9('0x6c')][_0xaab9('0x56')]);_0x192567[_0xaab9('0x46')]=_[_0xaab9('0x43')](_0x828a5f[_0xaab9('0x46')]);_0x192567[_0xaab9('0x44')]=_[_0xaab9('0x57')](_0x192567[_0xaab9('0x45')],_0x192567[_0xaab9('0x46')]);_0x37d170[_0xaab9('0x47')]=_['intersection'](_0x192567[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x828a5f['query'][_0xaab9('0x58')]));_0x37d170[_0xaab9('0x47')]=_0x37d170['attributes'][_0xaab9('0x48')]?_0x37d170[_0xaab9('0x47')]:_0x192567[_0xaab9('0x45')];if(!_0x828a5f[_0xaab9('0x46')][_0xaab9('0x67')]('nolimit')){_0x37d170[_0xaab9('0x31')]=qs[_0xaab9('0x31')](_0x828a5f[_0xaab9('0x46')][_0xaab9('0x31')]);_0x37d170[_0xaab9('0x2f')]=qs[_0xaab9('0x2f')](_0x828a5f['query'][_0xaab9('0x2f')]);}_0x37d170[_0xaab9('0x4a')]=qs[_0xaab9('0x4b')](_0x828a5f[_0xaab9('0x46')]['sort']);_0x37d170[_0xaab9('0x4c')]=qs[_0xaab9('0x44')](_[_0xaab9('0x4d')](_0x828a5f[_0xaab9('0x46')],_0x192567[_0xaab9('0x44')]));_0x37d170[_0xaab9('0x4c')][_0xaab9('0x64')]=_0x392753['id'];if(_0x828a5f[_0xaab9('0x46')][_0xaab9('0x4e')]){_0x37d170[_0xaab9('0x4c')]=_[_0xaab9('0x4f')](_0x37d170[_0xaab9('0x4c')],{'$or':_['map'](_0x37d170[_0xaab9('0x47')],function(_0x3af124){var _0x3d5a35={};_0x3d5a35[_0x3af124]={'$like':'%'+_0x828a5f[_0xaab9('0x46')][_0xaab9('0x4e')]+'%'};return _0x3d5a35;})});}_0x37d170=_[_0xaab9('0x4f')]({},_0x37d170,_0x828a5f[_0xaab9('0x50')]);return db[_0xaab9('0x6c')][_0xaab9('0x32')]({'where':_0x37d170['where']})[_0xaab9('0x22')](function(_0x3b2c92){_0x217414[_0xaab9('0x32')]=_0x3b2c92;if(_0x828a5f[_0xaab9('0x46')][_0xaab9('0x51')]){_0x37d170[_0xaab9('0x59')]=[{'all':!![]}];}return db[_0xaab9('0x6c')][_0xaab9('0x68')](_0x37d170);})['then'](function(_0x531037){_0x217414[_0xaab9('0x52')]=_0x531037;return _0x217414;});}})['then'](respondWithFilteredResult(_0x129ffe,_0x37d170))[_0xaab9('0x2b')](handleError(_0x129ffe,null));};exports[_0xaab9('0x6e')]=function(_0xb1d9cc,_0x274d78,_0x346f9d){return db['SmsAccount'][_0xaab9('0x5f')]({'where':{'id':_0xb1d9cc[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x274d78,null))[_0xaab9('0x22')](function(_0x549a5a){if(_0x549a5a){return _0x549a5a[_0xaab9('0x6e')](_0xb1d9cc[_0xaab9('0x46')][_0xaab9('0x6a')]);}})[_0xaab9('0x22')](respondWithStatusCode(_0x274d78,null))[_0xaab9('0x2b')](handleError(_0x274d78,null));};exports[_0xaab9('0x6f')]=function(_0xd23351,_0x140666,_0x377a04){var _0x100a34={'channel':_0xaab9('0x70')};var _0x3dd283=[];var _0x5d7d30=[];var _0x4de873={};return db['SmsAccount'][_0xaab9('0x5f')]({'where':{'id':_0xd23351[_0xaab9('0x62')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xaab9('0x71')}]})['then'](handleEntityNotFound(_0x140666,null))[_0xaab9('0x22')](function(_0x529911){_0x100a34[_0xaab9('0x72')]=_0x529911;_0x100a34[_0xaab9('0x73')]=_[_0xaab9('0x74')](_0x529911[_0xaab9('0x71')],[_0xaab9('0x75')],[_0xaab9('0x76')]);if(_0x100a34[_0xaab9('0x72')][_0xaab9('0x71')]){delete _0x100a34['account']['Applications'];}return db['CmContact'][_0xaab9('0x63')]();})['then'](function(_0xbc4d78){if(!_0xbc4d78){throw new db[(_0xaab9('0x77'))]['ValidationError'](_0xaab9('0x78'));}_0x3dd283=_[_0xaab9('0x79')](_['keys'](_0xbc4d78),[_0xaab9('0x7a'),_0xaab9('0x7b')]);_0x5d7d30=_['difference'](_[_0xaab9('0x43')](_0xbc4d78),[_0xaab9('0x7a'),_0xaab9('0x7b'),_0xaab9('0x7c'),'ListId']);_0x100a34[_0xaab9('0x5b')]={'mapKey':'mobile'};if(_0x100a34[_0xaab9('0x72')][_0xaab9('0x41')]){switch(_0x100a34['account'][_0xaab9('0x41')]){case _0xaab9('0x7d'):_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x7f')];_0x100a34[_0xaab9('0x5b')][_0xaab9('0x5b')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x80')];_0x100a34['body']['messageId']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x81')];break;case _0xaab9('0x82'):_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')]='+'+_0xd23351[_0xaab9('0x5b')][_0xaab9('0x83')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x84')];break;case _0xaab9('0x85'):_0x100a34['body'][_0xaab9('0x7e')]=_0xd23351['body'][_0xaab9('0x7e')];_0x100a34[_0xaab9('0x5b')][_0xaab9('0x5b')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x29')];break;case _0xaab9('0x86'):_0x100a34[_0xaab9('0x5b')]['from']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x7e')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x5b')];_0x100a34[_0xaab9('0x5b')][_0xaab9('0x87')]=_0xd23351['body']['message_id'];break;case _0xaab9('0x88'):_0x100a34['body'][_0xaab9('0x7e')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x7f')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x89')];_0x100a34[_0xaab9('0x5b')]['messageId']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8a')];break;case'infobip':_0x100a34[_0xaab9('0x5b')]['from']='+'+_0xd23351[_0xaab9('0x5b')]['results'][0x0]['from'];_0x100a34['body']['body']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8b')][0x0][_0xaab9('0x84')];_0x100a34[_0xaab9('0x5b')]['messageId']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8b')][0x0][_0xaab9('0x87')];break;case'csc':_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8c')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8d')]['message'];break;case _0xaab9('0x8e'):_0x100a34['body']['from']=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x8f')];_0x100a34['body'][_0xaab9('0x5b')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x84')];_0x100a34[_0xaab9('0x5b')][_0xaab9('0x87')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x90')];break;case _0xaab9('0x91'):_0x100a34[_0xaab9('0x5b')]['messageId']=_0xd23351[_0xaab9('0x5b')][0x0][_0xaab9('0x29')]['id'];_0x100a34['body'][_0xaab9('0x7e')]=_0xd23351[_0xaab9('0x5b')][0x0][_0xaab9('0x29')][_0xaab9('0x7e')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351[_0xaab9('0x5b')][0x0][_0xaab9('0x29')][_0xaab9('0x84')];break;case _0xaab9('0x92'):_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')]=_0xd23351[_0xaab9('0x5b')][_0xaab9('0x7e')];_0x100a34[_0xaab9('0x5b')]['body']=_0xd23351['body']['message'];_0x100a34[_0xaab9('0x5b')][_0xaab9('0x87')]=_0xd23351[_0xaab9('0x5b')]['refid'];break;}}if(_0x100a34[_0xaab9('0x5b')]['id']){delete _0x100a34['body']['id'];}if(_[_0xaab9('0x93')](_0x100a34['body']['from'])){throw new db[(_0xaab9('0x77'))][(_0xaab9('0x94'))](_0xaab9('0x95'));}if(_[_0xaab9('0x93')](_0x100a34[_0xaab9('0x5b')]['body'])||_0x100a34['body'][_0xaab9('0x5b')]===''){throw new db['Sequelize'][(_0xaab9('0x94'))](_0xaab9('0x96'));}if(_[_0xaab9('0x93')](_0x100a34['body'][_0xaab9('0x97')])){throw new db[(_0xaab9('0x77'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d7d30);}if(!_[_0xaab9('0x98')](_0x5d7d30,_0x100a34[_0xaab9('0x5b')][_0xaab9('0x97')])){throw new db['Sequelize'][(_0xaab9('0x94'))](_0xaab9('0x99')+_0x5d7d30);}_0x4de873[_0x100a34[_0xaab9('0x5b')][_0xaab9('0x97')]]=_0x100a34[_0xaab9('0x5b')]['from'];return db[_0xaab9('0x9a')]['find']({'where':{'id':_0x100a34[_0xaab9('0x72')]['ListId']},'include':[{'model':db[_0xaab9('0x9b')],'as':_0xaab9('0x9c'),'where':_0x4de873,'limit':0x1,'order':[[_0xaab9('0x7b'),_0xaab9('0x9d')]]}]});})['then'](handleEntityNotFound(_0x140666,null))[_0xaab9('0x22')](function(_0x21ed25){if(_0x21ed25){_0x100a34[_0xaab9('0x9e')]=_[_0xaab9('0x9f')](_0x21ed25,[_0xaab9('0x9c')]);if(_0x21ed25[_0xaab9('0x9c')]['length']){return _0x21ed25[_0xaab9('0x9c')][0x0];}var _0x3d997e=_[_0xaab9('0x19')](_0x100a34[_0xaab9('0x5b')],{'firstName':_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')],'ListId':_0x21ed25['id']});_0x3d997e[_0x100a34[_0xaab9('0x5b')][_0xaab9('0x97')]]=_0x100a34['body'][_0xaab9('0x7e')];return db[_0xaab9('0x9b')][_0xaab9('0x5a')](_0x3d997e,{'fields':_0x3dd283,'raw':!![]});}})[_0xaab9('0x22')](handleEntityNotFound(_0x140666,null))[_0xaab9('0x22')](function(_0x527067){if(_0x527067){_0x100a34[_0xaab9('0xa0')]=_0x527067;var _0x59e93e={'ContactId':_0x527067['id'],'phone':_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')],'SmsAccountId':_0xd23351[_0xaab9('0x62')]['id']};var _0x53b6ec={'ContactId':_0x527067['id'],'SmsAccountId':_0xd23351['params']['id'],'closed':![]};return db['SmsInteraction'][_0xaab9('0x5f')]({'where':_0x53b6ec})[_0xaab9('0x22')](function(_0x3f66cd){if(_0x3f66cd){return[_0x3f66cd,![]];}return db[_0xaab9('0xa1')][_0xaab9('0x5a')](_0x59e93e)[_0xaab9('0x22')](function(_0x33f672){return[_0x33f672,!![]];});});}})[_0xaab9('0xa2')](function(_0xca459a,_0x2e9868){_0x100a34[_0xaab9('0xa3')]=_0xca459a[_0xaab9('0x5e')]({'plain':!![]});_0x100a34[_0xaab9('0xa3')][_0xaab9('0xa4')]=![];if(_0x2e9868){if(_0x100a34[_0xaab9('0x72')][_0xaab9('0xa5')]){_0x100a34[_0xaab9('0x73')][_0xaab9('0xa6')]({'id':0x0,'priority':_0x100a34[_0xaab9('0x73')][_0xaab9('0x48')]+0x1,'app':_0xaab9('0xa7'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x100a34['interaction'][_0xaab9('0xa4')]=!![];}return db[_0xaab9('0xa8')][_0xaab9('0x5a')]({'phone':_0x100a34[_0xaab9('0x5b')][_0xaab9('0x7e')],'messageId':_0x100a34[_0xaab9('0x5b')][_0xaab9('0x87')],'body':_0x100a34[_0xaab9('0x5b')]['body'],'SmsAccountId':_0xd23351[_0xaab9('0x62')]['id'],'SmsInteractionId':_0xca459a['id'],'direction':'in','ContactId':_0xca459a[_0xaab9('0xa9')],'AttachmentId':_0x100a34[_0xaab9('0x5b')][_0xaab9('0xaa')]});})['then'](function(_0x549766){_0x100a34['message']=_0x549766;if(_0x100a34[_0xaab9('0xa3')]['UserId']){return db[_0xaab9('0xab')][_0xaab9('0x5f')]({'attributes':['id','name'],'where':{'id':_0x100a34[_0xaab9('0xa3')][_0xaab9('0xac')]}})[_0xaab9('0x22')](function(_0x12be09){if(_0x12be09){_0x100a34[_0xaab9('0x73')]['unshift']({'id':0x0,'priority':0x0,'app':_0xaab9('0xad'),'appdata':_0x12be09[_0xaab9('0x3b')]+','+(_0x100a34[_0xaab9('0x72')][_0xaab9('0xae')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xaab9('0xaf'),_0x100a34);});}return respondWithRpcPromise('Start',_0xaab9('0xaf'),_0x100a34);})[_0xaab9('0x22')](function(_0x2cd550){if(_0x2cd550){var _0x58bd40=0xc8;var _0x1073c3=_0xaab9('0xb0');logger[_0xaab9('0x2a')](_0xaab9('0x25'),_0x1073c3,_0x58bd40,_0xaab9('0xb1'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1073c3,_0x58bd40,_0xaab9('0xb1'),JSON[_0xaab9('0xb2')](_0x2cd550));if(_0x100a34[_0xaab9('0x72')][_0xaab9('0x41')]===_0xaab9('0x7d')){return _0x140666[_0xaab9('0x2d')](_0x58bd40)[_0xaab9('0x33')]('Content-Type',_0xaab9('0xb3'))[_0xaab9('0x3c')](_0xaab9('0xb4'));}else{return _0x140666['status'](_0x58bd40)[_0xaab9('0x2e')](_0x2cd550);}}})['catch'](handleError(_0x140666,null));};exports[_0xaab9('0xb5')]=function(_0x4ae8cd,_0x1d26f8){var _0x49d0ef=_0x4ae8cd[_0xaab9('0x62')]['id'];var _0x4baf41=_0x4ae8cd['body'];var _0x475003=0xc8;var _0x361188=null;return db['sequelize'][_0xaab9('0xb6')]({'isolationLevel':db[_0xaab9('0xb7')][_0xaab9('0xb8')][_0xaab9('0xb9')][_0xaab9('0xba')]},function(_0x380258){return db[_0xaab9('0x3f')]['findOne']({'where':{'id':_0x49d0ef},'transaction':_0x380258})[_0xaab9('0x22')](function(_0x382164){if(_0x382164){return db[_0xaab9('0xbb')]['destroy']({'where':{'SmsAccountId':_0x49d0ef},'transaction':_0x380258})[_0xaab9('0x22')](function(){var _0x344c2a=_[_0xaab9('0x3e')](_0x4baf41,function(_0x2654d2){_0x2654d2[_0xaab9('0x64')]=_0x49d0ef;return _0x2654d2;});return db[_0xaab9('0xbb')][_0xaab9('0xbc')](_0x344c2a,{'transaction':_0x380258});});}else{_0x475003=0x194;_0x361188=[];}});})[_0xaab9('0x22')](function(){if(_0x475003!==0x194){return db[_0xaab9('0xbb')][_0xaab9('0xbd')]({'where':{'SmsAccountId':_0x49d0ef},'order':_0xaab9('0x75')})[_0xaab9('0x22')](function(_0x2e57ab){_0x361188=_0x2e57ab;});}})[_0xaab9('0x2b')](function(_0x7e3a95){_0x475003=0x1f4;logger[_0xaab9('0x27')](_0x7e3a95['stack']);if(_0x7e3a95[_0xaab9('0x3b')]){delete _0x7e3a95['name'];}_0x361188=_0x7e3a95;})[_0xaab9('0xbe')](function(){if(_0x361188===null){_0x1d26f8['sendStatus'](_0x475003);}else{if(_0x475003===0x1f4){_0x1d26f8[_0xaab9('0x2d')](_0x475003)[_0xaab9('0x3c')](_0x361188);}else{_0x1d26f8[_0xaab9('0x2d')](_0x475003)[_0xaab9('0x2e')](_0x361188);}}});};exports[_0xaab9('0xbf')]=function(_0x298090,_0x493645,_0x558ce2){var _0x49559a={};var _0x52309d={};var _0x461690;var _0x3dd24e;return db[_0xaab9('0x3f')][_0xaab9('0x66')]({'where':{'id':_0x298090[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x493645,null))[_0xaab9('0x22')](function(_0xfed38e){if(_0xfed38e){_0x461690=_0xfed38e;_0x52309d[_0xaab9('0x45')]=_['keys'](db['SmsApplication'][_0xaab9('0x56')]);_0x52309d[_0xaab9('0x46')]=_[_0xaab9('0x43')](_0x298090[_0xaab9('0x46')]);_0x52309d[_0xaab9('0x44')]=_[_0xaab9('0x57')](_0x52309d['model'],_0x52309d[_0xaab9('0x46')]);_0x49559a[_0xaab9('0x47')]=_[_0xaab9('0x57')](_0x52309d[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x298090[_0xaab9('0x46')]['fields']));_0x49559a[_0xaab9('0x47')]=_0x49559a[_0xaab9('0x47')]['length']?_0x49559a[_0xaab9('0x47')]:_0x52309d[_0xaab9('0x45')];_0x49559a['order']=qs['sort'](_0x298090['query']['sort']);_0x49559a['where']=qs['filters'](_['pick'](_0x298090[_0xaab9('0x46')],_0x52309d[_0xaab9('0x44')]));if(_0x298090['query'][_0xaab9('0x4e')]){_0x49559a[_0xaab9('0x4c')]=_[_0xaab9('0x4f')](_0x49559a[_0xaab9('0x4c')],{'$or':_[_0xaab9('0x3e')](_0x49559a[_0xaab9('0x47')],function(_0x485fbb){var _0x2dca93={};_0x2dca93[_0x485fbb]={'$like':'%'+_0x298090[_0xaab9('0x46')][_0xaab9('0x4e')]+'%'};return _0x2dca93;})});}_0x49559a=_['merge']({},_0x49559a,_0x298090[_0xaab9('0x50')]);return _0x461690[_0xaab9('0xbf')](_0x49559a);}})[_0xaab9('0x22')](function(_0xca2889){if(_0xca2889){_0x3dd24e=_0xca2889[_0xaab9('0x48')];if(!_0x298090[_0xaab9('0x46')][_0xaab9('0x67')](_0xaab9('0x49'))){_0x49559a[_0xaab9('0x31')]=qs['limit'](_0x298090[_0xaab9('0x46')]['limit']);_0x49559a[_0xaab9('0x2f')]=qs[_0xaab9('0x2f')](_0x298090[_0xaab9('0x46')][_0xaab9('0x2f')]);}return _0x461690[_0xaab9('0xbf')](_0x49559a);}})[_0xaab9('0x22')](function(_0x2cdf59){if(_0x2cdf59){return _0x2cdf59?{'count':_0x3dd24e,'rows':_0x2cdf59}:null;}})[_0xaab9('0x22')](respondWithResult(_0x493645,null))['catch'](handleError(_0x493645,null));};exports[_0xaab9('0xc0')]=function(_0x5669be,_0x39d5cd,_0x57fb2d){var _0x59a2c9={'raw':![],'where':{}};var _0x209923={};var _0x2a535b={'count':0x0,'rows':[]};return db[_0xaab9('0x3f')][_0xaab9('0x66')]({'where':{'id':_0x5669be['params']['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x39d5cd,null))[_0xaab9('0x22')](function(_0x20d9fc){if(_0x20d9fc){_0x209923[_0xaab9('0x45')]=_[_0xaab9('0x43')](db[_0xaab9('0xa1')][_0xaab9('0x56')]);_0x209923['query']=_[_0xaab9('0x43')](_0x5669be[_0xaab9('0x46')]);_0x209923[_0xaab9('0x44')]=_[_0xaab9('0x57')](_0x209923[_0xaab9('0x45')],_0x209923[_0xaab9('0x46')]);_0x59a2c9[_0xaab9('0x47')]=_[_0xaab9('0x57')](_0x209923[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x5669be[_0xaab9('0x46')][_0xaab9('0x58')]));_0x59a2c9[_0xaab9('0x47')]=_0x59a2c9[_0xaab9('0x47')]['length']?_0x59a2c9[_0xaab9('0x47')]:_0x209923[_0xaab9('0x45')];if(!_0x5669be['query'][_0xaab9('0x67')]('nolimit')){_0x59a2c9[_0xaab9('0x31')]=qs[_0xaab9('0x31')](_0x5669be['query'][_0xaab9('0x31')]);_0x59a2c9['offset']=qs[_0xaab9('0x2f')](_0x5669be[_0xaab9('0x46')]['offset']);}_0x59a2c9[_0xaab9('0x4a')]=qs['sort'](_0x5669be[_0xaab9('0x46')][_0xaab9('0x4b')]);_0x59a2c9[_0xaab9('0x4c')]=qs[_0xaab9('0x44')](_['pick'](_0x5669be[_0xaab9('0x46')],_0x209923[_0xaab9('0x44')]));_0x59a2c9[_0xaab9('0x4c')][_0xaab9('0x64')]=_0x20d9fc['id'];if(_0x5669be[_0xaab9('0x46')][_0xaab9('0x4e')]){_0x59a2c9['where']=_['merge'](_0x59a2c9['where'],{'$or':_['map'](_0x59a2c9['attributes'],function(_0x36c97f){var _0x289d82={};_0x289d82[_0x36c97f]={'$like':'%'+_0x5669be[_0xaab9('0x46')][_0xaab9('0x4e')]+'%'};return _0x289d82;})});}_0x59a2c9=_['merge']({},_0x59a2c9,_0x5669be['options']);return db[_0xaab9('0xa1')]['count']({'where':_0x59a2c9[_0xaab9('0x4c')]})['then'](function(_0xeb9050){_0x2a535b['count']=_0xeb9050;if(_0x5669be['query'][_0xaab9('0x51')]){_0x59a2c9['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xaab9('0xab')],'as':_0xaab9('0xc1'),'attributes':[_0xaab9('0x3b'),_0xaab9('0xc2'),_0xaab9('0xc3')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xaab9('0xc4')],'where':_0x5669be[_0xaab9('0x46')][_0xaab9('0xc5')]?{'id':_0x5669be[_0xaab9('0x46')][_0xaab9('0xc5')]}:undefined,'required':_0x5669be['query'][_0xaab9('0xc5')]?!![]:![]}];}return db[_0xaab9('0xa1')][_0xaab9('0x68')](_0x59a2c9);})[_0xaab9('0x22')](function(_0x36c595){_0x2a535b[_0xaab9('0x52')]=_0x36c595;return _0x2a535b;});}})[_0xaab9('0x22')](respondWithFilteredResult(_0x39d5cd,_0x59a2c9))[_0xaab9('0x2b')](handleError(_0x39d5cd,null));};exports[_0xaab9('0x3c')]=function(_0x46267f,_0x5e48c4,_0x3d0328){var _0x4b1a63,_0x4957a1,_0x4cfdb8;if(_[_0xaab9('0x93')](_0x46267f[_0xaab9('0x5b')][_0xaab9('0x5b')])||_0x46267f[_0xaab9('0x5b')][_0xaab9('0x5b')]===''){throw new db[(_0xaab9('0x77'))][(_0xaab9('0x94'))](_0xaab9('0x96'));}if(_[_0xaab9('0x93')](_0x46267f['body']['to'])){throw new db[(_0xaab9('0x77'))]['ValidationError'](_0xaab9('0xc6'));}_0x4b1a63=_0x46267f[_0xaab9('0x5b')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x46267f[_0xaab9('0x62')]['id']},'include':[{'model':db[_0xaab9('0x9a')],'as':_0xaab9('0xc7'),'include':[{'model':db[_0xaab9('0x9b')],'as':_0xaab9('0x9c'),'where':{'mobile':_0x4b1a63},'limit':0x1,'order':[[_0xaab9('0x7b'),_0xaab9('0x9d')]]}]}]})[_0xaab9('0x22')](handleEntityNotFound(_0x5e48c4,null))['then'](function(_0x331177){if(_0x331177&&_0x331177[_0xaab9('0xc7')]){_0x4957a1=_0x331177['get']({'plain':!![]});if(_0x4957a1[_0xaab9('0xc7')]&&_0x4957a1[_0xaab9('0xc7')][_0xaab9('0x9c')][_0xaab9('0x48')]){return _0x4957a1[_0xaab9('0xc7')][_0xaab9('0x9c')][0x0];}return db[_0xaab9('0x9b')][_0xaab9('0x5a')](_[_0xaab9('0x19')](_0x46267f['body'],{'firstName':_0x4b1a63,'mobile':_0x4b1a63,'phone':_0x4b1a63,'ListId':_0x4957a1[_0xaab9('0xc8')]}));}})[_0xaab9('0x22')](handleEntityNotFound(_0x5e48c4,null))[_0xaab9('0x22')](function(_0x198b01){if(_0x198b01){_0x4cfdb8=_0x198b01;return db[_0xaab9('0xa1')][_0xaab9('0x5f')]({'where':{'ContactId':_0x4cfdb8['id'],'closed':![],'SmsAccountId':_0x4957a1['id']}})[_0xaab9('0x22')](function(_0x1fc5e6){if(_0x1fc5e6){return[_0x1fc5e6,![]];}return db[_0xaab9('0xa1')]['create']({'UserId':_0x46267f[_0xaab9('0x5c')]['id'],'ContactId':_0x4cfdb8['id'],'SmsAccountId':_0x4957a1['id'],'phone':_0x4b1a63,'firstMsgDirection':_0xaab9('0xc9'),'Messages':[_[_0xaab9('0x4f')](_0x46267f[_0xaab9('0x5b')],{'read':![],'body':_0x46267f[_0xaab9('0x5b')]['body'],'phone':_0x4b1a63,'SmsAccountId':_0x4957a1['id'],'UserId':_0x46267f[_0xaab9('0x5c')]['id'],'ContactId':_0x4cfdb8['id']})]},{'include':[{'model':db[_0xaab9('0xa8')],'as':_0xaab9('0xca')}]})[_0xaab9('0x22')](function(_0x486d0b){return[_0x486d0b,!![]];});});}})[_0xaab9('0xa2')](function(_0x17a060,_0x1e9f6b){if(_0x1e9f6b){return _0x17a060;}return db[_0xaab9('0xa8')][_0xaab9('0x5a')](_[_0xaab9('0x4f')](_0x46267f['body'],{'read':![],'body':_0x46267f[_0xaab9('0x5b')]['body'],'phone':_0x4b1a63,'SmsAccountId':_0x4957a1['id'],'SmsInteractionId':_0x17a060['id'],'UserId':_0x46267f[_0xaab9('0x5c')]['id'],'ContactId':_0x4cfdb8['id']}))[_0xaab9('0x22')](function(_0x3c6fc8){_0x17a060[_0xaab9('0xcb')]['Messages']=[];_0x17a060[_0xaab9('0xcb')]['Messages']['push'](_0x3c6fc8['dataValues']);return _0x17a060;});})[_0xaab9('0x22')](respondWithResult(_0x5e48c4,null))['catch'](handleError(_0x5e48c4,null));};exports[_0xaab9('0x2d')]=function(_0x101ca9,_0x4d2c5d,_0x2fd774){if(_0x101ca9['body']['id']){delete _0x101ca9['body']['id'];}var _0x31bca3,_0x145271,_0x345423;return db['SmsAccount'][_0xaab9('0x5f')]({'where':{'id':_0x101ca9[_0xaab9('0x62')]['id']}})['then'](handleEntityNotFound(_0x4d2c5d,null))[_0xaab9('0x22')](function(_0x2a7b48){if(_0x2a7b48){_0x345423=_0x2a7b48;logger[_0xaab9('0x24')](_0xaab9('0x25'),'status',_0xaab9('0xcc'),_0x2a7b48[_0xaab9('0x41')],util['inspect'](_0x101ca9['body'],{'showHidden':![],'depth':null}));switch(_0x2a7b48['type']){case _0xaab9('0x82'):if(_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xcd')]&&_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x2d')]){_0x145271=_0x101ca9['body'][_0xaab9('0x2d')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9['body'][_0xaab9('0xcd')]}});}break;case _0xaab9('0x85'):if(_0x101ca9['body'][_0xaab9('0xce')]&&_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xcf')]){_0x145271=_0x101ca9[_0xaab9('0x5b')]['statusInt'];return db['SmsMessage'][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xce')]}});}break;case _0xaab9('0x86'):if(_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd0')]&&_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd1')]){_0x145271=_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd1')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd0')]}});}break;case _0xaab9('0xd2'):var _0x49b79b=_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x8b')][0x0];if(_0x49b79b[_0xaab9('0x87')]&&_0x49b79b[_0xaab9('0x2d')][_0xaab9('0xd3')]===_0xaab9('0xd4')){_0x145271=_0x49b79b[_0xaab9('0x2d')][_0xaab9('0xd3')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x49b79b[_0xaab9('0x87')]}});}break;case _0xaab9('0x8e'):if(_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x87')]&&_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x2d')]){_0x145271=_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x2d')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x87')]}});}break;case'bandwidth':if(_0x101ca9[_0xaab9('0x5b')][0x0][_0xaab9('0x29')]['id']){_0x145271=_0x101ca9[_0xaab9('0x5b')][0x0][_0xaab9('0x41')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9[_0xaab9('0x5b')][0x0]['message']['id']}});}break;case _0xaab9('0x92'):if(_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd5')]&&_0x101ca9['body'][_0xaab9('0x2d')]){_0x145271=_0x101ca9['body'][_0xaab9('0x2d')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x4d2c5d,null))['then'](function(_0x5452c0){if(_0x5452c0){_0x31bca3=_0x5452c0;switch(_0x345423[_0xaab9('0x41')]){case _0xaab9('0x82'):if(_0x145271==='DELIVERED'){return _0x31bca3[_0xaab9('0xd6')]({'read':!![]});}else{logger['error'](_0xaab9('0x25'),_0xaab9('0x2d'),_0xaab9('0x82'),util[_0xaab9('0xd7')](_0x101ca9[_0xaab9('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xaab9('0x85'):if(_0x145271==='1'){return _0x31bca3[_0xaab9('0xd6')]({'read':!![]});}else{logger[_0xaab9('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaab9('0x2d'),_0xaab9('0x82'),util[_0xaab9('0xd7')](_0x101ca9['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x101ca9[_0xaab9('0x5b')][_0xaab9('0xd8')]&&_0x145271>=0xc8&&_0x145271<=0xce){return _0x31bca3[_0xaab9('0xd6')]({'read':!![]});}else{logger[_0xaab9('0x27')](_0xaab9('0x25'),_0xaab9('0x2d'),'clicksend',util[_0xaab9('0xd7')](_0x101ca9['body'],{'showHidden':![],'depth':null}));}break;case _0xaab9('0xd2'):var _0x1597e5=_0x101ca9[_0xaab9('0x5b')][_0xaab9('0x8b')][0x0];if(_0x1597e5[_0xaab9('0x2d')]['groupName']===_0xaab9('0xd4')){return _0x31bca3[_0xaab9('0xd6')]({'read':!![]});}else{logger[_0xaab9('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xaab9('0x2d'),_0xaab9('0xd2'),util['inspect'](_0x101ca9[_0xaab9('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xaab9('0x8e'):if(_0x145271==_0xaab9('0xd9')||_0x145271==_0xaab9('0xda')){return _0x31bca3['update']({'read':!![]});}else{logger[_0xaab9('0x27')](_0xaab9('0x25'),_0xaab9('0x2d'),_0xaab9('0x8e'),util[_0xaab9('0xd7')](_0x101ca9[_0xaab9('0x5b')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x145271==_0xaab9('0xdb')){return _0x31bca3['update']({'read':!![]});}else{logger[_0xaab9('0x27')](_0xaab9('0x25'),_0xaab9('0x2d'),_0xaab9('0x91'),util[_0xaab9('0xd7')](_0x101ca9['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x145271==='DELIVRD'||_0x145271===_0xaab9('0xdc')){return _0x31bca3['update']({'read':!![]});}else{logger[_0xaab9('0x27')](_0xaab9('0x25'),_0xaab9('0x2d'),_0xaab9('0x92'),util[_0xaab9('0xd7')](_0x101ca9['body'],{'showHidden':![],'depth':null}));}break;}return _0x31bca3;}})['then'](respondWithResult(_0x4d2c5d,null))[_0xaab9('0x2b')](handleError(_0x4d2c5d,null));};exports[_0xaab9('0xdd')]=function(_0x71034e,_0x4aeb92,_0x33a63f){var _0x42e624,_0xa6bbd9,_0x140ef9;return db[_0xaab9('0x3f')][_0xaab9('0x5f')]({'where':{'id':_0x71034e['params']['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x4aeb92,null))[_0xaab9('0x22')](function(_0x451a63){if(_0x451a63){_0x140ef9=_0x451a63;logger[_0xaab9('0x24')](_0xaab9('0x25'),'status',_0xaab9('0xcc'),_0x451a63[_0xaab9('0x41')],util['inspect'](_0x71034e[_0xaab9('0x46')],{'showHidden':![],'depth':null}));switch(_0x451a63[_0xaab9('0x41')]){case _0xaab9('0xde'):if(_0x71034e[_0xaab9('0x46')]['message-id']&&_0x71034e[_0xaab9('0x46')][_0xaab9('0xdf')]){_0xa6bbd9=_0x71034e[_0xaab9('0x46')][_0xaab9('0xdf')];return db[_0xaab9('0xa8')][_0xaab9('0x5f')]({'where':{'messageId':_0x71034e[_0xaab9('0x46')]['message-id']}});}break;}}})[_0xaab9('0x22')](handleEntityNotFound(_0x4aeb92,null))[_0xaab9('0x22')](function(_0x3ff09a){if(_0x3ff09a){_0x42e624=_0x3ff09a;switch(_0x140ef9[_0xaab9('0x41')]){case _0xaab9('0xde'):if(_0xa6bbd9==='2'||_0xa6bbd9==='6'){return _0x42e624[_0xaab9('0xd6')]({'read':!![]});}else{logger[_0xaab9('0x27')](_0xaab9('0x25'),_0xaab9('0x2d'),_0xaab9('0xde'),util[_0xaab9('0xd7')](_0x71034e['query'],{'showHidden':![],'depth':null}));};break;}return _0x42e624;}})['then'](respondWithResult(_0x4aeb92,null))['catch'](handleError(_0x4aeb92,null));};exports[_0xaab9('0xe0')]=function(_0xf105c0,_0x41a4c7,_0x56705a){return db['SmsAccount']['find']({'where':{'id':_0xf105c0[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x41a4c7,null))[_0xaab9('0x22')](function(_0x31200f){if(_0x31200f){return _0x31200f[_0xaab9('0xe0')](_0xf105c0[_0xaab9('0x5b')]['ids'],_[_0xaab9('0x9f')](_0xf105c0[_0xaab9('0x5b')],[_0xaab9('0x6a'),'id'])||{})[_0xaab9('0xa2')](function(_0x3f9d47){for(var _0x67290c=0x0;_0x67290c<_0xf105c0['body']['ids'][_0xaab9('0x48')];_0x67290c+=0x1){socket[_0xaab9('0xe1')](_0xaab9('0xe2'),{'UserId':Number(_0xf105c0[_0xaab9('0x5b')][_0xaab9('0x6a')][_0x67290c]),'SmsAccountId':Number(_0xf105c0[_0xaab9('0x62')]['id'])});}return _0x3f9d47;});}})[_0xaab9('0x22')](respondWithResult(_0x41a4c7,null))[_0xaab9('0x2b')](handleError(_0x41a4c7,null));};exports[_0xaab9('0xe3')]=function(_0x333db6,_0x1b4eb7,_0x566005){return db[_0xaab9('0x3f')][_0xaab9('0x5f')]({'where':{'id':_0x333db6[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x1b4eb7,null))[_0xaab9('0x22')](function(_0xd8f603){if(_0xd8f603){return _0xd8f603[_0xaab9('0xe3')](_0x333db6[_0xaab9('0x46')][_0xaab9('0x6a')])[_0xaab9('0x22')](function(){if(_[_0xaab9('0xe4')](_0x333db6[_0xaab9('0x46')][_0xaab9('0x6a')])){for(var _0x5827b7=0x0;_0x5827b7<_0x333db6[_0xaab9('0x46')]['ids'][_0xaab9('0x48')];_0x5827b7+=0x1){socket['emit'](_0xaab9('0xe5'),{'UserId':Number(_0x333db6[_0xaab9('0x46')][_0xaab9('0x6a')][_0x5827b7]),'SmsAccountId':Number(_0x333db6[_0xaab9('0x62')]['id'])});}}else{socket[_0xaab9('0xe1')](_0xaab9('0xe5'),{'UserId':Number(_0x333db6['query'][_0xaab9('0x6a')]),'SmsAccountId':Number(_0x333db6[_0xaab9('0x62')]['id'])});}});}})[_0xaab9('0x22')](respondWithStatusCode(_0x1b4eb7,null))[_0xaab9('0x2b')](handleError(_0x1b4eb7,null));};exports[_0xaab9('0xe6')]=function(_0x392ee8,_0x4fd467,_0x28e16a){var _0x113b9f={};var _0x2dd4ed={};var _0x201cec;var _0x3315c5;return db[_0xaab9('0x3f')][_0xaab9('0x66')]({'where':{'id':_0x392ee8[_0xaab9('0x62')]['id']}})[_0xaab9('0x22')](handleEntityNotFound(_0x4fd467,null))[_0xaab9('0x22')](function(_0x5ac626){if(_0x5ac626){_0x201cec=_0x5ac626;_0x2dd4ed[_0xaab9('0x45')]=_[_0xaab9('0x43')](db[_0xaab9('0xab')][_0xaab9('0x56')]);_0x2dd4ed[_0xaab9('0x46')]=_[_0xaab9('0x43')](_0x392ee8[_0xaab9('0x46')]);_0x2dd4ed['filters']=_[_0xaab9('0x57')](_0x2dd4ed[_0xaab9('0x45')],_0x2dd4ed['query']);_0x113b9f[_0xaab9('0x47')]=_[_0xaab9('0x57')](_0x2dd4ed[_0xaab9('0x45')],qs[_0xaab9('0x58')](_0x392ee8[_0xaab9('0x46')][_0xaab9('0x58')]));_0x113b9f[_0xaab9('0x47')]=_0x113b9f['attributes'][_0xaab9('0x48')]?_0x113b9f[_0xaab9('0x47')]:_0x2dd4ed[_0xaab9('0x45')];_0x113b9f[_0xaab9('0x4a')]=qs[_0xaab9('0x4b')](_0x392ee8['query'][_0xaab9('0x4b')]);_0x113b9f[_0xaab9('0x4c')]=qs[_0xaab9('0x44')](_['pick'](_0x392ee8['query'],_0x2dd4ed[_0xaab9('0x44')]));if(_0x392ee8[_0xaab9('0x46')][_0xaab9('0x4e')]){_0x113b9f[_0xaab9('0x4c')]=_[_0xaab9('0x4f')](_0x113b9f['where'],{'$or':_[_0xaab9('0x3e')](_0x113b9f['attributes'],function(_0x16c2b5){var _0x150d5d={};_0x150d5d[_0x16c2b5]={'$like':'%'+_0x392ee8['query'][_0xaab9('0x4e')]+'%'};return _0x150d5d;})});}_0x113b9f=_[_0xaab9('0x4f')]({},_0x113b9f,_0x392ee8[_0xaab9('0x50')]);return _0x201cec[_0xaab9('0xe6')](_0x113b9f);}})[_0xaab9('0x22')](function(_0x58c4b2){if(_0x58c4b2){_0x3315c5=_0x58c4b2['length'];if(!_0x392ee8[_0xaab9('0x46')]['hasOwnProperty'](_0xaab9('0x49'))){_0x113b9f[_0xaab9('0x31')]=qs[_0xaab9('0x31')](_0x392ee8['query'][_0xaab9('0x31')]);_0x113b9f[_0xaab9('0x2f')]=qs[_0xaab9('0x2f')](_0x392ee8[_0xaab9('0x46')][_0xaab9('0x2f')]);}return _0x201cec[_0xaab9('0xe6')](_0x113b9f);}})[_0xaab9('0x22')](function(_0x9bb381){if(_0x9bb381){return _0x9bb381?{'count':_0x3315c5,'rows':_0x9bb381}:null;}})['then'](respondWithResult(_0x4fd467,null))['catch'](handleError(_0x4fd467,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f1a79c9..5c5cef8 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 _0x283c=['hook','exports','events','SmsAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x283c,0x1cd));var _0xc283=function(_0x18b8ed,_0x56789e){_0x18b8ed=_0x18b8ed-0x0;var _0x8f4061=_0x283c[_0x18b8ed];return _0x8f4061;};'use strict';var EventEmitter=require(_0xc283('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xc283('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc283('0x2')](0x0);var events={'afterCreate':_0xc283('0x3'),'afterUpdate':_0xc283('0x4'),'afterDestroy':_0xc283('0x5')};function emitEvent(_0x2eff31){return function(_0xebc95c,_0x512306,_0x24755f){SmsAccountEvents['emit'](_0x2eff31+':'+_0xebc95c['id'],_0xebc95c);SmsAccountEvents['emit'](_0x2eff31,_0xebc95c);_0x24755f(null);};}for(var e in events){if(events[_0xc283('0x6')](e)){var event=events[e];SmsAccount[_0xc283('0x7')](e,emitEvent(event));}}module[_0xc283('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x385a=['save','emit','hook','exports','setMaxListeners'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0x385a,0x14e));var _0xa385=function(_0x4490d9,_0x4d061e){_0x4490d9=_0x4490d9-0x0;var _0x557a28=_0x385a[_0x4490d9];return _0x557a28;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa385('0x0')](0x0);var events={'afterCreate':_0xa385('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e1bed){return function(_0x1c475d,_0x22c497,_0x4a23d3){SmsAccountEvents[_0xa385('0x2')](_0x2e1bed+':'+_0x1c475d['id'],_0x1c475d);SmsAccountEvents['emit'](_0x2e1bed,_0x1c475d);_0x4a23d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xa385('0x3')](e,emitEvent(event));}}module[_0xa385('0x4')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index c308c47..696b8d0 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 _0x2c84=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','moment','request-promise','path','rimraf'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x2c84,0x132));var _0x42c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c84[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x42c8('0x0'));var logger=require('../../config/logger')(_0x42c8('0x1'));var moment=require(_0x42c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x42c8('0x3'));var fs=require('fs');var path=require(_0x42c8('0x4'));var rimraf=require(_0x42c8('0x5'));var config=require(_0x42c8('0x6'));var attributes=require(_0x42c8('0x7'));module[_0x42c8('0x8')]=function(_0x508b99,_0x1b2c17){return _0x508b99[_0x42c8('0x9')](_0x42c8('0xa'),attributes,{'tableName':_0x42c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd06e=['define','SmsAccount','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x57a2a3,_0x4fc852){var _0x4dc9f8=function(_0x11063f){while(--_0x11063f){_0x57a2a3['push'](_0x57a2a3['shift']());}};_0x4dc9f8(++_0x4fc852);}(_0xd06e,0x10a));var _0xed06=function(_0x1c9513,_0x28e040){_0x1c9513=_0x1c9513-0x0;var _0x2affc1=_0xd06e[_0x1c9513];return _0x2affc1;};'use strict';var _=require('lodash');var util=require(_0xed06('0x0'));var logger=require(_0xed06('0x1'))(_0xed06('0x2'));var moment=require(_0xed06('0x3'));var BPromise=require('bluebird');var rp=require(_0xed06('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed06('0x5'));var config=require(_0xed06('0x6'));var attributes=require(_0xed06('0x7'));module[_0xed06('0x8')]=function(_0x32f893,_0x37b988){return _0x32f893[_0xed06('0x9')](_0xed06('0xa'),attributes,{'tableName':'sms_accounts','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 2430f03..8e09f9c 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 _0x741a=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug'];(function(_0x3bc051,_0x3acfb6){var _0x1ce502=function(_0x4aad7c){while(--_0x4aad7c){_0x3bc051['push'](_0x3bc051['shift']());}};_0x1ce502(++_0x3acfb6);}(_0x741a,0x1ae));var _0xa741=function(_0x1865f3,_0x5154be){_0x1865f3=_0x1865f3-0x0;var _0xb69290=_0x741a[_0x1865f3];return _0xb69290;};'use strict';var _=require(_0xa741('0x0'));var util=require('util');var moment=require(_0xa741('0x1'));var BPromise=require(_0xa741('0x2'));var rs=require(_0xa741('0x3'));var fs=require('fs');var Redis=require(_0xa741('0x4'));var db=require(_0xa741('0x5'))['db'];var utils=require(_0xa741('0x6'));var logger=require(_0xa741('0x7'))(_0xa741('0x8'));var config=require(_0xa741('0x9'));var jayson=require(_0xa741('0xa'));var client=jayson[_0xa741('0xb')][_0xa741('0xc')]({'port':0x232a});config[_0xa741('0xd')]=_[_0xa741('0xe')](config[_0xa741('0xd')],{'host':_0xa741('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa741('0xd')]));require(_0xa741('0x10'))[_0xa741('0x11')](socket);function respondWithRpcPromise(_0x5d9269,_0x106628,_0x38456f){return new BPromise(function(_0x30b04e,_0x1e5b26){return client['request'](_0x5d9269,_0x38456f)[_0xa741('0x12')](function(_0x1c66e0){logger[_0xa741('0x13')](_0xa741('0x14'),_0x106628,'request\x20sent');logger['debug'](_0xa741('0x15'),_0x106628,_0xa741('0x16'),JSON['stringify'](_0x1c66e0));if(_0x1c66e0[_0xa741('0x17')]){if(_0x1c66e0[_0xa741('0x17')][_0xa741('0x18')]===0x1f4){logger[_0xa741('0x17')](_0xa741('0x14'),_0x106628,_0x1c66e0['error'][_0xa741('0x19')]);return _0x1e5b26(_0x1c66e0[_0xa741('0x17')][_0xa741('0x19')]);}logger[_0xa741('0x17')](_0xa741('0x14'),_0x106628,_0x1c66e0[_0xa741('0x17')][_0xa741('0x19')]);return _0x30b04e(_0x1c66e0[_0xa741('0x17')][_0xa741('0x19')]);}else{logger[_0xa741('0x13')](_0xa741('0x14'),_0x106628,_0xa741('0x16'));_0x30b04e(_0x1c66e0['result'][_0xa741('0x19')]);}})[_0xa741('0x1a')](function(_0x1d2dcb){logger['error']('SmsAccount,\x20%s,\x20%s',_0x106628,_0x1d2dcb);_0x1e5b26(_0x1d2dcb);});});}exports['ShowSmsAccount']=function(_0x53df2b){var _0x2e0496=this;return new Promise(function(_0x2d572d,_0x3bd739){return db[_0xa741('0x1b')][_0xa741('0x1c')]({'raw':_0x53df2b[_0xa741('0x1d')]?_0x53df2b[_0xa741('0x1d')][_0xa741('0x1e')]===undefined?!![]:![]:!![],'where':_0x53df2b[_0xa741('0x1d')]?_0x53df2b[_0xa741('0x1d')][_0xa741('0x1f')]||null:null,'attributes':_0x53df2b[_0xa741('0x1d')]?_0x53df2b['options'][_0xa741('0x20')]||null:null,'include':_0x53df2b['options']?_0x53df2b[_0xa741('0x1d')][_0xa741('0x21')]?_['map'](_0x53df2b[_0xa741('0x1d')]['include'],function(_0x4f8b77){return{'model':db[_0x4f8b77['model']],'as':_0x4f8b77['as'],'attributes':_0x4f8b77[_0xa741('0x20')],'include':_0x4f8b77['include']?_[_0xa741('0x22')](_0x4f8b77[_0xa741('0x21')],function(_0x1aa689){return{'model':db[_0x1aa689[_0xa741('0x23')]],'as':_0x1aa689['as'],'attributes':_0x1aa689[_0xa741('0x20')],'include':_0x1aa689[_0xa741('0x21')]?_[_0xa741('0x22')](_0x1aa689[_0xa741('0x21')],function(_0x5ac9b5){return{'model':db[_0x5ac9b5[_0xa741('0x23')]],'as':_0x5ac9b5['as'],'attributes':_0x5ac9b5[_0xa741('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa741('0x12')](function(_0x1ad619){logger[_0xa741('0x13')](_0xa741('0x24'),_0x53df2b);logger[_0xa741('0x25')](_0xa741('0x24'),_0x53df2b,JSON[_0xa741('0x26')](_0x1ad619));_0x2d572d(_0x1ad619);})[_0xa741('0x1a')](function(_0x489b0c){logger['error'](_0xa741('0x24'),_0x489b0c[_0xa741('0x19')],_0x53df2b);_0x3bd739(_0x2e0496[_0xa741('0x17')](0x1f4,_0x489b0c[_0xa741('0x19')]));});});}; \ No newline at end of file +var _0x27bd=['SmsAccount','find','options','raw','where','include','map','model','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount'];(function(_0x2e903c,_0x3c2157){var _0xb65f6b=function(_0x556552){while(--_0x556552){_0x2e903c['push'](_0x2e903c['shift']());}};_0xb65f6b(++_0x3c2157);}(_0x27bd,0x7b));var _0xd27b=function(_0xe59246,_0x58b419){_0xe59246=_0xe59246-0x0;var _0x575237=_0x27bd[_0xe59246];return _0x575237;};'use strict';var _=require(_0xd27b('0x0'));var util=require('util');var moment=require(_0xd27b('0x1'));var BPromise=require(_0xd27b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd27b('0x3'));var db=require(_0xd27b('0x4'))['db'];var utils=require(_0xd27b('0x5'));var logger=require('../../config/logger')(_0xd27b('0x6'));var config=require(_0xd27b('0x7'));var jayson=require(_0xd27b('0x8'));var client=jayson[_0xd27b('0x9')][_0xd27b('0xa')]({'port':0x232a});config[_0xd27b('0xb')]=_[_0xd27b('0xc')](config[_0xd27b('0xb')],{'host':_0xd27b('0xd'),'port':0x18eb});var socket=require(_0xd27b('0xe'))(new Redis(config[_0xd27b('0xb')]));require(_0xd27b('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c8a2f,_0x47c3bb,_0x214ad6){return new BPromise(function(_0x48a9a9,_0x515087){return client[_0xd27b('0x10')](_0x5c8a2f,_0x214ad6)['then'](function(_0x3ed035){logger[_0xd27b('0x11')]('SmsAccount,\x20%s,\x20%s',_0x47c3bb,_0xd27b('0x12'));logger[_0xd27b('0x13')](_0xd27b('0x14'),_0x47c3bb,_0xd27b('0x12'),JSON[_0xd27b('0x15')](_0x3ed035));if(_0x3ed035[_0xd27b('0x16')]){if(_0x3ed035[_0xd27b('0x16')][_0xd27b('0x17')]===0x1f4){logger[_0xd27b('0x16')]('SmsAccount,\x20%s,\x20%s',_0x47c3bb,_0x3ed035[_0xd27b('0x16')][_0xd27b('0x18')]);return _0x515087(_0x3ed035[_0xd27b('0x16')][_0xd27b('0x18')]);}logger[_0xd27b('0x16')](_0xd27b('0x19'),_0x47c3bb,_0x3ed035[_0xd27b('0x16')][_0xd27b('0x18')]);return _0x48a9a9(_0x3ed035[_0xd27b('0x16')][_0xd27b('0x18')]);}else{logger[_0xd27b('0x11')]('SmsAccount,\x20%s,\x20%s',_0x47c3bb,_0xd27b('0x12'));_0x48a9a9(_0x3ed035[_0xd27b('0x1a')][_0xd27b('0x18')]);}})[_0xd27b('0x1b')](function(_0x3bf918){logger[_0xd27b('0x16')]('SmsAccount,\x20%s,\x20%s',_0x47c3bb,_0x3bf918);_0x515087(_0x3bf918);});});}exports[_0xd27b('0x1c')]=function(_0x4b2656){var _0x33dac2=this;return new Promise(function(_0x1755d7,_0x5953b4){return db[_0xd27b('0x1d')][_0xd27b('0x1e')]({'raw':_0x4b2656[_0xd27b('0x1f')]?_0x4b2656[_0xd27b('0x1f')][_0xd27b('0x20')]===undefined?!![]:![]:!![],'where':_0x4b2656[_0xd27b('0x1f')]?_0x4b2656[_0xd27b('0x1f')][_0xd27b('0x21')]||null:null,'attributes':_0x4b2656['options']?_0x4b2656[_0xd27b('0x1f')]['attributes']||null:null,'include':_0x4b2656[_0xd27b('0x1f')]?_0x4b2656[_0xd27b('0x1f')]['include']?_['map'](_0x4b2656[_0xd27b('0x1f')][_0xd27b('0x22')],function(_0x3d77dd){return{'model':db[_0x3d77dd['model']],'as':_0x3d77dd['as'],'attributes':_0x3d77dd['attributes'],'include':_0x3d77dd[_0xd27b('0x22')]?_[_0xd27b('0x23')](_0x3d77dd[_0xd27b('0x22')],function(_0x2d05b6){return{'model':db[_0x2d05b6[_0xd27b('0x24')]],'as':_0x2d05b6['as'],'attributes':_0x2d05b6[_0xd27b('0x25')],'include':_0x2d05b6['include']?_[_0xd27b('0x23')](_0x2d05b6['include'],function(_0x425b82){return{'model':db[_0x425b82['model']],'as':_0x425b82['as'],'attributes':_0x425b82['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bfdc7){logger['info'](_0xd27b('0x1c'),_0x4b2656);logger[_0xd27b('0x13')]('ShowSmsAccount',_0x4b2656,JSON['stringify'](_0x2bfdc7));_0x1755d7(_0x2bfdc7);})[_0xd27b('0x1b')](function(_0x58025b){logger[_0xd27b('0x16')]('ShowSmsAccount',_0x58025b[_0xd27b('0x18')],_0x4b2656);_0x5953b4(_0x33dac2[_0xd27b('0x16')](0x1f4,_0x58025b[_0xd27b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 43b6756..3a4954b 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 9c582a3..d4bbc86 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x557f1d,_0x245ba5){var _0x56a7ef=function(_0x36b3a0){while(--_0x36b3a0){_0x557f1d['push'](_0x557f1d['shift']());}};_0x56a7ef(++_0x245ba5);}(_0x008c,0x188));var _0xc008=function(_0x176259,_0x30e46f){_0x176259=_0x176259-0x0;var _0x48dc40=_0x008c[_0x176259];return _0x48dc40;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x2ed06c,_0xa53b83){var _0x1598b3=function(_0x2817a0){while(--_0x2817a0){_0x2ed06c['push'](_0x2ed06c['shift']());}};_0x1598b3(++_0xa53b83);}(_0x55ca,0x126));var _0xa55c=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0x55ca[_0x5528c3];return _0x47ec1b;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ff49a45..50c40bc 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 _0x396f=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x14a341,_0x83c18e){var _0x35ee1a=function(_0x1ec094){while(--_0x1ec094){_0x14a341['push'](_0x14a341['shift']());}};_0x35ee1a(++_0x83c18e);}(_0x396f,0x160));var _0xf396=function(_0x4dd645,_0x3719ec){_0x4dd645=_0x4dd645-0x0;var _0x446cf1=_0x396f[_0x4dd645];return _0x446cf1;};'use strict';var Sequelize=require(_0xf396('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf396('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf396('0x2')],'allowNull':![],'defaultValue':_0xf396('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf396('0x2')],'defaultValue':_0xf396('0x4')}}; \ No newline at end of file +var _0xc742=['exports','noop','TEXT','STRING','sequelize'];(function(_0x578982,_0x5b32ba){var _0x46b40a=function(_0xfc6ad9){while(--_0xfc6ad9){_0x578982['push'](_0x578982['shift']());}};_0x46b40a(++_0x5b32ba);}(_0xc742,0x86));var _0x2c74=function(_0x239056,_0x26c26){_0x239056=_0x239056-0x0;var _0x13ae6c=_0xc742[_0x239056];return _0x13ae6c;};'use strict';var Sequelize=require(_0x2c74('0x0'));module[_0x2c74('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c74('0x2')},'appdata':{'type':Sequelize[_0x2c74('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2c74('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7166bd0..f307d84 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 _0x677e=['fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','map','SmsApplication','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','update','eml-format','rimraf'];(function(_0x142c51,_0x4ee79b){var _0xe52038=function(_0x36fc9e){while(--_0x36fc9e){_0x142c51['push'](_0x142c51['shift']());}};_0xe52038(++_0x4ee79b);}(_0x677e,0xe2));var _0xe677=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x677e[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0xe677('0x0'));var rimraf=require(_0xe677('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe677('0x2'));var rp=require(_0xe677('0x3'));var moment=require(_0xe677('0x4'));var BPromise=require(_0xe677('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe677('0x6'));var sox=require('sox');var csv=require(_0xe677('0x7'));var ejs=require(_0xe677('0x8'));var fs=require('fs');var fs_extra=require(_0xe677('0x9'));var _=require(_0xe677('0xa'));var squel=require(_0xe677('0xb'));var crypto=require(_0xe677('0xc'));var jsforce=require(_0xe677('0xd'));var deskjs=require(_0xe677('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe677('0xf'));var Redis=require(_0xe677('0x10'));var authService=require(_0xe677('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe677('0x12'));var hardwareService=require(_0xe677('0x13'));var logger=require(_0xe677('0x14'))(_0xe677('0x15'));var utils=require(_0xe677('0x16'));var config=require(_0xe677('0x17'));var licenseUtil=require(_0xe677('0x18'));var db=require(_0xe677('0x19'))['db'];function respondWithStatusCode(_0x722446,_0x3114fa){_0x3114fa=_0x3114fa||0xcc;return function(_0x5246e7){if(_0x5246e7){return _0x722446['sendStatus'](_0x3114fa);}return _0x722446[_0xe677('0x1a')](_0x3114fa)[_0xe677('0x1b')]();};}function respondWithResult(_0x20ba68,_0x37496a){_0x37496a=_0x37496a||0xc8;return function(_0x121391){if(_0x121391){return _0x20ba68[_0xe677('0x1a')](_0x37496a)[_0xe677('0x1c')](_0x121391);}};}function respondWithFilteredResult(_0x285f61,_0x3d0c87){return function(_0x55c0ff){if(_0x55c0ff){var _0x4843b0=typeof _0x3d0c87['offset']===_0xe677('0x1d')&&typeof _0x3d0c87[_0xe677('0x1e')]===_0xe677('0x1d');var _0x122648=_0x55c0ff[_0xe677('0x1f')];var _0x5dcf38=_0x4843b0?0x0:_0x3d0c87[_0xe677('0x20')];var _0x224cc0=_0x4843b0?_0x55c0ff[_0xe677('0x1f')]:_0x3d0c87[_0xe677('0x20')]+_0x3d0c87['limit'];var _0xac27bf;if(_0x224cc0>=_0x122648){_0x224cc0=_0x122648;_0xac27bf=0xc8;}else{_0xac27bf=0xce;}_0x285f61[_0xe677('0x1a')](_0xac27bf);return _0x285f61[_0xe677('0x21')](_0xe677('0x22'),_0x5dcf38+'-'+_0x224cc0+'/'+_0x122648)[_0xe677('0x1c')](_0x55c0ff);}return null;};}function patchUpdates(_0x8662b9){return function(_0x20818e){try{jsonpatch[_0xe677('0x23')](_0x20818e,_0x8662b9,!![]);}catch(_0x37c796){return BPromise['reject'](_0x37c796);}return _0x20818e[_0xe677('0x24')]();};}function saveUpdates(_0x98acf1,_0xd82bbc){return function(_0x3e75a1){if(_0x3e75a1){return _0x3e75a1['update'](_0x98acf1)[_0xe677('0x25')](function(_0x2010e5){return _0x2010e5;});}return null;};}function removeEntity(_0x4f9c7a,_0x4392ab){return function(_0x33d082){if(_0x33d082){return _0x33d082[_0xe677('0x26')]()[_0xe677('0x25')](function(){_0x4f9c7a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c176,_0xa2d1b6){return function(_0x19f8e6){if(!_0x19f8e6){_0x25c176[_0xe677('0x27')](0x194);}return _0x19f8e6;};}function handleError(_0xda7e9a,_0x342e24){_0x342e24=_0x342e24||0x1f4;return function(_0x3692d2){logger[_0xe677('0x28')](_0x3692d2[_0xe677('0x29')]);if(_0x3692d2[_0xe677('0x2a')]){delete _0x3692d2[_0xe677('0x2a')];}_0xda7e9a[_0xe677('0x1a')](_0x342e24)[_0xe677('0x2b')](_0x3692d2);};}exports['index']=function(_0xe5d698,_0x3af1a9){var _0x4a9278={},_0x5171e6={},_0xf803b9={'count':0x0,'rows':[]};var _0x170104=_[_0xe677('0x2c')](db[_0xe677('0x2d')][_0xe677('0x2e')],function(_0x4f17f6){return{'name':_0x4f17f6['fieldName'],'type':_0x4f17f6[_0xe677('0x2f')]['key']};});_0x5171e6[_0xe677('0x30')]=_[_0xe677('0x2c')](_0x170104,_0xe677('0x2a'));_0x5171e6[_0xe677('0x31')]=_[_0xe677('0x32')](_0xe5d698[_0xe677('0x31')]);_0x5171e6[_0xe677('0x33')]=_[_0xe677('0x34')](_0x5171e6['model'],_0x5171e6['query']);_0x4a9278['attributes']=_[_0xe677('0x34')](_0x5171e6[_0xe677('0x30')],qs[_0xe677('0x35')](_0xe5d698[_0xe677('0x31')]['fields']));_0x4a9278[_0xe677('0x36')]=_0x4a9278[_0xe677('0x36')][_0xe677('0x37')]?_0x4a9278[_0xe677('0x36')]:_0x5171e6[_0xe677('0x30')];if(!_0xe5d698['query'][_0xe677('0x38')](_0xe677('0x39'))){_0x4a9278[_0xe677('0x1e')]=qs[_0xe677('0x1e')](_0xe5d698[_0xe677('0x31')]['limit']);_0x4a9278[_0xe677('0x20')]=qs[_0xe677('0x20')](_0xe5d698[_0xe677('0x31')][_0xe677('0x20')]);}_0x4a9278[_0xe677('0x3a')]=qs[_0xe677('0x3b')](_0xe5d698[_0xe677('0x31')][_0xe677('0x3b')]);_0x4a9278[_0xe677('0x3c')]=qs[_0xe677('0x33')](_[_0xe677('0x3d')](_0xe5d698[_0xe677('0x31')],_0x5171e6[_0xe677('0x33')]),_0x170104);if(_0xe5d698[_0xe677('0x31')][_0xe677('0x3e')]){_0x4a9278['where']=_[_0xe677('0x3f')](_0x4a9278[_0xe677('0x3c')],{'$or':_[_0xe677('0x2c')](_0x170104,function(_0x232875){if(_0x232875[_0xe677('0x2f')]!==_0xe677('0x40')){var _0x56d957={};_0x56d957[_0x232875[_0xe677('0x2a')]]={'$like':'%'+_0xe5d698[_0xe677('0x31')][_0xe677('0x3e')]+'%'};return _0x56d957;}})});}_0x4a9278=_[_0xe677('0x3f')]({},_0x4a9278,_0xe5d698[_0xe677('0x41')]);var _0x38efeb={'where':_0x4a9278[_0xe677('0x3c')]};return db[_0xe677('0x2d')][_0xe677('0x1f')](_0x38efeb)['then'](function(_0x243beb){_0xf803b9[_0xe677('0x1f')]=_0x243beb;if(_0xe5d698[_0xe677('0x31')]['includeAll']){_0x4a9278['include']=[{'all':!![]}];}return db[_0xe677('0x2d')][_0xe677('0x42')](_0x4a9278);})['then'](function(_0x58fde1){_0xf803b9['rows']=_0x58fde1;return _0xf803b9;})[_0xe677('0x25')](respondWithFilteredResult(_0x3af1a9,_0x4a9278))[_0xe677('0x43')](handleError(_0x3af1a9,null));};exports[_0xe677('0x44')]=function(_0x376fbe,_0x12f48e){var _0x3640e0={'raw':!![],'where':{'id':_0x376fbe[_0xe677('0x45')]['id']}},_0x261f19={};_0x261f19[_0xe677('0x30')]=_[_0xe677('0x32')](db[_0xe677('0x2d')][_0xe677('0x2e')]);_0x261f19['query']=_['keys'](_0x376fbe[_0xe677('0x31')]);_0x261f19['filters']=_['intersection'](_0x261f19['model'],_0x261f19[_0xe677('0x31')]);_0x3640e0[_0xe677('0x36')]=_[_0xe677('0x34')](_0x261f19[_0xe677('0x30')],qs[_0xe677('0x35')](_0x376fbe[_0xe677('0x31')]['fields']));_0x3640e0['attributes']=_0x3640e0[_0xe677('0x36')][_0xe677('0x37')]?_0x3640e0[_0xe677('0x36')]:_0x261f19[_0xe677('0x30')];if(_0x376fbe[_0xe677('0x31')][_0xe677('0x46')]){_0x3640e0[_0xe677('0x47')]=[{'all':!![]}];}_0x3640e0=_[_0xe677('0x3f')]({},_0x3640e0,_0x376fbe[_0xe677('0x41')]);return db[_0xe677('0x2d')][_0xe677('0x48')](_0x3640e0)[_0xe677('0x25')](handleEntityNotFound(_0x12f48e,null))['then'](respondWithResult(_0x12f48e,null))['catch'](handleError(_0x12f48e,null));};exports[_0xe677('0x49')]=function(_0x9b6b94,_0x4abd9c){return db[_0xe677('0x2d')]['create'](_0x9b6b94[_0xe677('0x4a')],{})['then'](respondWithResult(_0x4abd9c,0xc9))['catch'](handleError(_0x4abd9c,null));};exports[_0xe677('0x4b')]=function(_0x18e304,_0x5d64af){if(_0x18e304[_0xe677('0x4a')]['id']){delete _0x18e304[_0xe677('0x4a')]['id'];}return db['SmsApplication'][_0xe677('0x48')]({'where':{'id':_0x18e304[_0xe677('0x45')]['id']}})[_0xe677('0x25')](handleEntityNotFound(_0x5d64af,null))['then'](saveUpdates(_0x18e304[_0xe677('0x4a')],null))[_0xe677('0x25')](respondWithResult(_0x5d64af,null))[_0xe677('0x43')](handleError(_0x5d64af,null));};exports['destroy']=function(_0x32eab1,_0x58daaf){return db[_0xe677('0x2d')][_0xe677('0x48')]({'where':{'id':_0x32eab1['params']['id']}})[_0xe677('0x25')](handleEntityNotFound(_0x58daaf,null))[_0xe677('0x25')](removeEntity(_0x58daaf,null))['catch'](handleError(_0x58daaf,null));}; \ No newline at end of file +var _0xcb43=['zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','SmsApplication','find','create','body','eml-format'];(function(_0x1865a3,_0x3d1624){var _0x3c6a68=function(_0x441d53){while(--_0x441d53){_0x1865a3['push'](_0x1865a3['shift']());}};_0x3c6a68(++_0x3d1624);}(_0xcb43,0x8d));var _0x3cb4=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xcb43[_0x41d02a];return _0x4c3983;};'use strict';var emlformat=require(_0x3cb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3cb4('0x1'));var jsonpatch=require(_0x3cb4('0x2'));var rp=require('request-promise');var moment=require(_0x3cb4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3cb4('0x4'));var util=require(_0x3cb4('0x5'));var path=require('path');var sox=require(_0x3cb4('0x6'));var csv=require(_0x3cb4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3cb4('0x8'));var squel=require(_0x3cb4('0x9'));var crypto=require('crypto');var jsforce=require(_0x3cb4('0xa'));var deskjs=require(_0x3cb4('0xb'));var toCsv=require(_0x3cb4('0x7'));var querystring=require(_0x3cb4('0xc'));var Papa=require(_0x3cb4('0xd'));var Redis=require(_0x3cb4('0xe'));var authService=require(_0x3cb4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3cb4('0x10'));var hardwareService=require(_0x3cb4('0x11'));var logger=require(_0x3cb4('0x12'))(_0x3cb4('0x13'));var utils=require(_0x3cb4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3cb4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e04e0,_0x4187c8){_0x4187c8=_0x4187c8||0xcc;return function(_0x1dd0cc){if(_0x1dd0cc){return _0x5e04e0[_0x3cb4('0x16')](_0x4187c8);}return _0x5e04e0[_0x3cb4('0x17')](_0x4187c8)['end']();};}function respondWithResult(_0x428bd3,_0x45d6f5){_0x45d6f5=_0x45d6f5||0xc8;return function(_0x13300b){if(_0x13300b){return _0x428bd3['status'](_0x45d6f5)[_0x3cb4('0x18')](_0x13300b);}};}function respondWithFilteredResult(_0x5d9983,_0x13b328){return function(_0x3bc4c3){if(_0x3bc4c3){var _0x5656e5=typeof _0x13b328['offset']===_0x3cb4('0x19')&&typeof _0x13b328[_0x3cb4('0x1a')]==='undefined';var _0x3570d6=_0x3bc4c3['count'];var _0x5ba392=_0x5656e5?0x0:_0x13b328['offset'];var _0x4fe28e=_0x5656e5?_0x3bc4c3[_0x3cb4('0x1b')]:_0x13b328[_0x3cb4('0x1c')]+_0x13b328[_0x3cb4('0x1a')];var _0x5915f1;if(_0x4fe28e>=_0x3570d6){_0x4fe28e=_0x3570d6;_0x5915f1=0xc8;}else{_0x5915f1=0xce;}_0x5d9983[_0x3cb4('0x17')](_0x5915f1);return _0x5d9983[_0x3cb4('0x1d')](_0x3cb4('0x1e'),_0x5ba392+'-'+_0x4fe28e+'/'+_0x3570d6)[_0x3cb4('0x18')](_0x3bc4c3);}return null;};}function patchUpdates(_0x2b2ca2){return function(_0x283227){try{jsonpatch[_0x3cb4('0x1f')](_0x283227,_0x2b2ca2,!![]);}catch(_0x10687d){return BPromise[_0x3cb4('0x20')](_0x10687d);}return _0x283227[_0x3cb4('0x21')]();};}function saveUpdates(_0x593615,_0x2fb558){return function(_0x3c2b2c){if(_0x3c2b2c){return _0x3c2b2c[_0x3cb4('0x22')](_0x593615)[_0x3cb4('0x23')](function(_0x2ed200){return _0x2ed200;});}return null;};}function removeEntity(_0x4156ee,_0x20b471){return function(_0x68c231){if(_0x68c231){return _0x68c231[_0x3cb4('0x24')]()[_0x3cb4('0x23')](function(){_0x4156ee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4411ea,_0x172d6d){return function(_0x5a6845){if(!_0x5a6845){_0x4411ea[_0x3cb4('0x16')](0x194);}return _0x5a6845;};}function handleError(_0x3dafec,_0x41039e){_0x41039e=_0x41039e||0x1f4;return function(_0x289116){logger[_0x3cb4('0x25')](_0x289116[_0x3cb4('0x26')]);if(_0x289116['name']){delete _0x289116[_0x3cb4('0x27')];}_0x3dafec[_0x3cb4('0x17')](_0x41039e)[_0x3cb4('0x28')](_0x289116);};}exports['index']=function(_0x398a48,_0x38edb8){var _0x5eb9e6={},_0x17bee8={},_0x320606={'count':0x0,'rows':[]};var _0x36dc4b=_['map'](db['SmsApplication']['rawAttributes'],function(_0x1eb6ee){return{'name':_0x1eb6ee[_0x3cb4('0x29')],'type':_0x1eb6ee[_0x3cb4('0x2a')]['key']};});_0x17bee8[_0x3cb4('0x2b')]=_['map'](_0x36dc4b,'name');_0x17bee8[_0x3cb4('0x2c')]=_[_0x3cb4('0x2d')](_0x398a48[_0x3cb4('0x2c')]);_0x17bee8[_0x3cb4('0x2e')]=_[_0x3cb4('0x2f')](_0x17bee8['model'],_0x17bee8[_0x3cb4('0x2c')]);_0x5eb9e6['attributes']=_['intersection'](_0x17bee8[_0x3cb4('0x2b')],qs[_0x3cb4('0x30')](_0x398a48[_0x3cb4('0x2c')][_0x3cb4('0x30')]));_0x5eb9e6[_0x3cb4('0x31')]=_0x5eb9e6[_0x3cb4('0x31')][_0x3cb4('0x32')]?_0x5eb9e6[_0x3cb4('0x31')]:_0x17bee8[_0x3cb4('0x2b')];if(!_0x398a48['query'][_0x3cb4('0x33')]('nolimit')){_0x5eb9e6['limit']=qs['limit'](_0x398a48[_0x3cb4('0x2c')]['limit']);_0x5eb9e6[_0x3cb4('0x1c')]=qs['offset'](_0x398a48[_0x3cb4('0x2c')]['offset']);}_0x5eb9e6['order']=qs[_0x3cb4('0x34')](_0x398a48[_0x3cb4('0x2c')][_0x3cb4('0x34')]);_0x5eb9e6[_0x3cb4('0x35')]=qs[_0x3cb4('0x2e')](_[_0x3cb4('0x36')](_0x398a48[_0x3cb4('0x2c')],_0x17bee8[_0x3cb4('0x2e')]),_0x36dc4b);if(_0x398a48[_0x3cb4('0x2c')][_0x3cb4('0x37')]){_0x5eb9e6[_0x3cb4('0x35')]=_['merge'](_0x5eb9e6['where'],{'$or':_[_0x3cb4('0x38')](_0x36dc4b,function(_0x3897b3){if(_0x3897b3['type']!==_0x3cb4('0x39')){var _0x4553fd={};_0x4553fd[_0x3897b3[_0x3cb4('0x27')]]={'$like':'%'+_0x398a48[_0x3cb4('0x2c')][_0x3cb4('0x37')]+'%'};return _0x4553fd;}})});}_0x5eb9e6=_[_0x3cb4('0x3a')]({},_0x5eb9e6,_0x398a48[_0x3cb4('0x3b')]);var _0x1299f4={'where':_0x5eb9e6[_0x3cb4('0x35')]};return db['SmsApplication'][_0x3cb4('0x1b')](_0x1299f4)[_0x3cb4('0x23')](function(_0x52aa0c){_0x320606[_0x3cb4('0x1b')]=_0x52aa0c;if(_0x398a48['query'][_0x3cb4('0x3c')]){_0x5eb9e6[_0x3cb4('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x3cb4('0x3e')](_0x5eb9e6);})[_0x3cb4('0x23')](function(_0x9de2ec){_0x320606[_0x3cb4('0x3f')]=_0x9de2ec;return _0x320606;})[_0x3cb4('0x23')](respondWithFilteredResult(_0x38edb8,_0x5eb9e6))[_0x3cb4('0x40')](handleError(_0x38edb8,null));};exports[_0x3cb4('0x41')]=function(_0x935a7d,_0x1e2330){var _0x570b87={'raw':!![],'where':{'id':_0x935a7d[_0x3cb4('0x42')]['id']}},_0x5c6ab8={};_0x5c6ab8[_0x3cb4('0x2b')]=_[_0x3cb4('0x2d')](db[_0x3cb4('0x43')]['rawAttributes']);_0x5c6ab8['query']=_[_0x3cb4('0x2d')](_0x935a7d['query']);_0x5c6ab8[_0x3cb4('0x2e')]=_[_0x3cb4('0x2f')](_0x5c6ab8[_0x3cb4('0x2b')],_0x5c6ab8[_0x3cb4('0x2c')]);_0x570b87[_0x3cb4('0x31')]=_[_0x3cb4('0x2f')](_0x5c6ab8[_0x3cb4('0x2b')],qs['fields'](_0x935a7d[_0x3cb4('0x2c')][_0x3cb4('0x30')]));_0x570b87['attributes']=_0x570b87[_0x3cb4('0x31')][_0x3cb4('0x32')]?_0x570b87[_0x3cb4('0x31')]:_0x5c6ab8[_0x3cb4('0x2b')];if(_0x935a7d[_0x3cb4('0x2c')]['includeAll']){_0x570b87[_0x3cb4('0x3d')]=[{'all':!![]}];}_0x570b87=_[_0x3cb4('0x3a')]({},_0x570b87,_0x935a7d[_0x3cb4('0x3b')]);return db[_0x3cb4('0x43')][_0x3cb4('0x44')](_0x570b87)['then'](handleEntityNotFound(_0x1e2330,null))[_0x3cb4('0x23')](respondWithResult(_0x1e2330,null))[_0x3cb4('0x40')](handleError(_0x1e2330,null));};exports[_0x3cb4('0x45')]=function(_0x5b48fc,_0x524466){return db[_0x3cb4('0x43')]['create'](_0x5b48fc[_0x3cb4('0x46')],{})['then'](respondWithResult(_0x524466,0xc9))[_0x3cb4('0x40')](handleError(_0x524466,null));};exports[_0x3cb4('0x22')]=function(_0x28e2a8,_0x53ccd6){if(_0x28e2a8[_0x3cb4('0x46')]['id']){delete _0x28e2a8[_0x3cb4('0x46')]['id'];}return db[_0x3cb4('0x43')]['find']({'where':{'id':_0x28e2a8['params']['id']}})[_0x3cb4('0x23')](handleEntityNotFound(_0x53ccd6,null))[_0x3cb4('0x23')](saveUpdates(_0x28e2a8[_0x3cb4('0x46')],null))[_0x3cb4('0x23')](respondWithResult(_0x53ccd6,null))['catch'](handleError(_0x53ccd6,null));};exports[_0x3cb4('0x24')]=function(_0x5af3ac,_0x12d4b1){return db[_0x3cb4('0x43')]['find']({'where':{'id':_0x5af3ac[_0x3cb4('0x42')]['id']}})[_0x3cb4('0x23')](handleEntityNotFound(_0x12d4b1,null))['then'](removeEntity(_0x12d4b1,null))[_0x3cb4('0x40')](handleError(_0x12d4b1,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index b31b487..a308f83 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 _0xb7ed=['define','sms_applications','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb7ed,0x1e7));var _0xdb7e=function(_0x542a4e,_0x23f7ef){_0x542a4e=_0x542a4e-0x0;var _0x11d75d=_0xb7ed[_0x542a4e];return _0x11d75d;};'use strict';var _=require(_0xdb7e('0x0'));var util=require('util');var logger=require(_0xdb7e('0x1'))('api');var moment=require(_0xdb7e('0x2'));var BPromise=require(_0xdb7e('0x3'));var rp=require(_0xdb7e('0x4'));var fs=require('fs');var path=require(_0xdb7e('0x5'));var rimraf=require('rimraf');var config=require(_0xdb7e('0x6'));var attributes=require(_0xdb7e('0x7'));module['exports']=function(_0x66774e,_0x1eb3a7){return _0x66774e[_0xdb7e('0x8')]('SmsApplication',attributes,{'tableName':_0xdb7e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb7e('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6138=['path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x327df9,_0x43de0d){var _0x28fd8d=function(_0x1d8127){while(--_0x1d8127){_0x327df9['push'](_0x327df9['shift']());}};_0x28fd8d(++_0x43de0d);}(_0x6138,0xbe));var _0x8613=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6138[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x8613('0x0'));var logger=require(_0x8613('0x1'))(_0x8613('0x2'));var moment=require(_0x8613('0x3'));var BPromise=require(_0x8613('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8613('0x5'));var rimraf=require(_0x8613('0x6'));var config=require(_0x8613('0x7'));var attributes=require(_0x8613('0x8'));module[_0x8613('0x9')]=function(_0x2b8f55,_0xdfba09){return _0x2b8f55[_0x8613('0xa')](_0x8613('0xb'),attributes,{'tableName':_0x8613('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8613('0xd'),'collate':_0x8613('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6941fbc..1dbe4fb 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 _0x04fa=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','request\x20sent'];(function(_0x41e175,_0x2660ec){var _0xddc288=function(_0x24c93){while(--_0x24c93){_0x41e175['push'](_0x41e175['shift']());}};_0xddc288(++_0x2660ec);}(_0x04fa,0x119));var _0xa04f=function(_0xa41436,_0x30e0a0){_0xa41436=_0xa41436-0x0;var _0x3d3665=_0x04fa[_0xa41436];return _0x3d3665;};'use strict';var _=require('lodash');var util=require(_0xa04f('0x0'));var moment=require(_0xa04f('0x1'));var BPromise=require(_0xa04f('0x2'));var rs=require(_0xa04f('0x3'));var fs=require('fs');var Redis=require(_0xa04f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa04f('0x5'));var logger=require('../../config/logger')(_0xa04f('0x6'));var config=require(_0xa04f('0x7'));var jayson=require(_0xa04f('0x8'));var client=jayson['client'][_0xa04f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c521c,_0x315771,_0x56f898){return new BPromise(function(_0x303e54,_0x4a2e03){return client['request'](_0x2c521c,_0x56f898)['then'](function(_0x5ea498){logger[_0xa04f('0xa')]('SmsApplication,\x20%s,\x20%s',_0x315771,'request\x20sent');logger[_0xa04f('0xb')](_0xa04f('0xc'),_0x315771,'request\x20sent',JSON[_0xa04f('0xd')](_0x5ea498));if(_0x5ea498['error']){if(_0x5ea498[_0xa04f('0xe')][_0xa04f('0xf')]===0x1f4){logger['error'](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')]['message']);return _0x4a2e03(_0x5ea498['error']['message']);}logger[_0xa04f('0xe')](_0xa04f('0x10'),_0x315771,_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);return _0x303e54(_0x5ea498[_0xa04f('0xe')][_0xa04f('0x11')]);}else{logger['info'](_0xa04f('0x10'),_0x315771,_0xa04f('0x12'));_0x303e54(_0x5ea498['result'][_0xa04f('0x11')]);}})[_0xa04f('0x13')](function(_0x505abc){logger[_0xa04f('0xe')]('SmsApplication,\x20%s,\x20%s',_0x315771,_0x505abc);_0x4a2e03(_0x505abc);});});} \ No newline at end of file +var _0x2581=['request','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','SmsApplication,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x594e65,_0xa04fc3){var _0x54b44f=function(_0x1806d7){while(--_0x1806d7){_0x594e65['push'](_0x594e65['shift']());}};_0x54b44f(++_0xa04fc3);}(_0x2581,0xcb));var _0x1258=function(_0x17950a,_0x4688cc){_0x17950a=_0x17950a-0x0;var _0x33b4e0=_0x2581[_0x17950a];return _0x33b4e0;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1258('0x5'))['db'];var utils=require(_0x1258('0x6'));var logger=require(_0x1258('0x7'))(_0x1258('0x8'));var config=require(_0x1258('0x9'));var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x582ed7,_0x3e1044,_0x21cd98){return new BPromise(function(_0x468494,_0x18bbac){return client[_0x1258('0xd')](_0x582ed7,_0x21cd98)[_0x1258('0xe')](function(_0x429efc){logger['info']('SmsApplication,\x20%s,\x20%s',_0x3e1044,_0x1258('0xf'));logger[_0x1258('0x10')](_0x1258('0x11'),_0x3e1044,_0x1258('0xf'),JSON['stringify'](_0x429efc));if(_0x429efc[_0x1258('0x12')]){if(_0x429efc[_0x1258('0x12')][_0x1258('0x13')]===0x1f4){logger[_0x1258('0x12')]('SmsApplication,\x20%s,\x20%s',_0x3e1044,_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);return _0x18bbac(_0x429efc[_0x1258('0x12')][_0x1258('0x14')]);}logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x429efc[_0x1258('0x12')]['message']);return _0x468494(_0x429efc[_0x1258('0x12')]['message']);}else{logger[_0x1258('0x16')](_0x1258('0x15'),_0x3e1044,_0x1258('0xf'));_0x468494(_0x429efc[_0x1258('0x17')][_0x1258('0x14')]);}})['catch'](function(_0x1645a6){logger[_0x1258('0x12')](_0x1258('0x15'),_0x3e1044,_0x1645a6);_0x18bbac(_0x1645a6);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 22f35e2..3bce11d 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c81=['express','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','addTags','tracked','sms','update','delete','smsinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout'];(function(_0x303b46,_0x32949a){var _0x2ebdb2=function(_0x53f048){while(--_0x53f048){_0x303b46['push'](_0x303b46['shift']());}};_0x2ebdb2(++_0x32949a);}(_0x3c81,0x102));var _0x13c8=function(_0x126989,_0x59031d){_0x126989=_0x126989-0x0;var _0x3202f5=_0x3c81[_0x126989];return _0x3202f5;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0x6')](_0x13c8('0xf'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router['post'](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x13')]);router[_0x13c8('0x11')]('/:id/tags',auth[_0x13c8('0x7')](),interaction['tracked']('sms','smsinteraction:addtags'),controller[_0x13c8('0x14')]);router['put'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),'smsinteraction:update'),controller[_0x13c8('0x17')]);router[_0x13c8('0x18')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),interaction[_0x13c8('0x15')](_0x13c8('0x16'),_0x13c8('0x19')),controller[_0x13c8('0x1a')]);router[_0x13c8('0x18')](_0x13c8('0x1b'),auth[_0x13c8('0x7')](),controller['removeTags']);module[_0x13c8('0x1c')]=router; \ No newline at end of file +var _0x9c00=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags'];(function(_0x358efd,_0x1937c9){var _0x56c2d9=function(_0x4f088e){while(--_0x4f088e){_0x358efd['push'](_0x358efd['shift']());}};_0x56c2d9(++_0x1937c9);}(_0x9c00,0x1a0));var _0x09c0=function(_0x46a563,_0x586712){_0x46a563=_0x46a563-0x0;var _0x10aa22=_0x9c00[_0x46a563];return _0x10aa22;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09c0('0x4'));var interaction=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var controller=require(_0x09c0('0x7'));router[_0x09c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x09c0('0x8')](_0x09c0('0x9'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xb')]);router[_0x09c0('0x8')]('/:id',auth[_0x09c0('0xa')](),controller[_0x09c0('0xc')]);router[_0x09c0('0x8')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0xe')]);router[_0x09c0('0x8')](_0x09c0('0xf'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x10')]);router[_0x09c0('0x11')]('/',auth[_0x09c0('0xa')](),controller[_0x09c0('0x12')]);router[_0x09c0('0x11')](_0x09c0('0xd'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x11')](_0x09c0('0x14'),auth[_0x09c0('0xa')](),interaction[_0x09c0('0x15')](_0x09c0('0x16'),_0x09c0('0x17')),controller[_0x09c0('0x18')]);router[_0x09c0('0x19')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction['tracked']('sms',_0x09c0('0x1b')),controller[_0x09c0('0x1c')]);router[_0x09c0('0x1d')](_0x09c0('0x1a'),auth['isAuthenticated'](),interaction[_0x09c0('0x15')]('sms','smsinteraction:destroy'),controller[_0x09c0('0x1e')]);router['delete'](_0x09c0('0x14'),auth[_0x09c0('0xa')](),controller[_0x09c0('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b8f6976..cf33eeb 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 _0xef8b=['STRING','ENUM','out','moment','exports','BOOLEAN','DATE'];(function(_0x354ec4,_0x9f0ec5){var _0x8da532=function(_0x46a421){while(--_0x46a421){_0x354ec4['push'](_0x354ec4['shift']());}};_0x8da532(++_0x9f0ec5);}(_0xef8b,0x192));var _0xbef8=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0xef8b[_0x3b0d98];return _0x296885;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbef8('0x0'));module[_0xbef8('0x1')]={'closed':{'type':Sequelize[_0xbef8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbef8('0x3')]},'disposition':{'type':Sequelize[_0xbef8('0x4')]},'secondDisposition':{'type':Sequelize[_0xbef8('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbef8('0x4')]},'note':{'type':Sequelize[_0xbef8('0x4')]},'phone':{'type':Sequelize[_0xbef8('0x4')]},'read1stAt':{'type':Sequelize[_0xbef8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbef8('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbef8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbef8('0x5')]('in',_0xbef8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4b19=['DATE','STRING','ENUM','sequelize','exports','BOOLEAN'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4b19,0x195));var _0x94b1=function(_0x535503,_0xc9b0fc){_0x535503=_0x535503-0x0;var _0x4bf177=_0x4b19[_0x535503];return _0x4bf177;};'use strict';var Sequelize=require(_0x94b1('0x0'));var moment=require('moment');module[_0x94b1('0x1')]={'closed':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x94b1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x94b1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x94b1('0x4')]},'note':{'type':Sequelize[_0x94b1('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x94b1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x94b1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x94b1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 12d391c..ef0f6bd 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 _0x79fc=['tmp','push','User','Contact','Messages','createdAt','direction','secret','SmsAccount','Account','fullname','get','mkdirSync','Owner','N.A.','out','System','firstName','lastName','read','root','.pdf','Sms','createPdfFromHTML','download','log','unlinkSync','zip-dir','moment','ejs','lodash','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','findAll','sms','query','catch','show','params','model','keys','SmsInteraction','fields','attributes','length','includeAll','include','merge','find','create','body','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','count','rows','addTags','setTags','spread','Tag','smsInteractionTags:save','removeTags','toString','join','server','files'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79fc,0x1db));var _0xc79f=function(_0x34217f,_0x4954d9){_0x34217f=_0x34217f-0x0;var _0x533721=_0x79fc[_0x34217f];return _0x533721;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc79f('0x0'));var moment=require(_0xc79f('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var ejs=require(_0xc79f('0x2'));var fs=require('fs');var _=require(_0xc79f('0x3'));var Redis=require(_0xc79f('0x4'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xc79f('0x5'));var logger=require(_0xc79f('0x6'))(_0xc79f('0x7'));var config=require(_0xc79f('0x8'));var db=require(_0xc79f('0x9'))['db'];config[_0xc79f('0xa')]=_[_0xc79f('0xb')](config[_0xc79f('0xa')],{'host':_0xc79f('0xc'),'port':0x18eb});var socket=require(_0xc79f('0xd'))(new Redis(config[_0xc79f('0xa')]));require(_0xc79f('0xe'))['register'](socket);function respondWithStatusCode(_0x24ddec,_0x6ee6c){_0x6ee6c=_0x6ee6c||0xcc;return function(_0x36422c){if(_0x36422c){return _0x24ddec[_0xc79f('0xf')](_0x6ee6c);}return _0x24ddec['status'](_0x6ee6c)[_0xc79f('0x10')]();};}function respondWithResult(_0x2cc6e7,_0x3e42e2){_0x3e42e2=_0x3e42e2||0xc8;return function(_0x235316){if(_0x235316){return _0x2cc6e7[_0xc79f('0x11')](_0x3e42e2)[_0xc79f('0x12')](_0x235316);}};}function respondWithFilteredResult(_0x7899b2,_0x508558){return function(_0x1ea13c){if(_0x1ea13c){var _0x2fa943=typeof _0x508558[_0xc79f('0x13')]==='undefined'&&typeof _0x508558[_0xc79f('0x14')]==='undefined';var _0x3e26fa=_0x1ea13c['count'];var _0x326cf5=_0x2fa943?0x0:_0x508558[_0xc79f('0x13')];var _0x23f38a=_0x2fa943?_0x1ea13c['count']:_0x508558[_0xc79f('0x13')]+_0x508558[_0xc79f('0x14')];var _0x4b68d9;if(_0x23f38a>=_0x3e26fa){_0x23f38a=_0x3e26fa;_0x4b68d9=0xc8;}else{_0x4b68d9=0xce;}_0x7899b2[_0xc79f('0x11')](_0x4b68d9);return _0x7899b2[_0xc79f('0x15')](_0xc79f('0x16'),_0x326cf5+'-'+_0x23f38a+'/'+_0x3e26fa)[_0xc79f('0x12')](_0x1ea13c);}return null;};}function saveUpdates(_0x1084c6){return function(_0x22f507){if(_0x22f507){return _0x22f507[_0xc79f('0x17')](_0x1084c6)[_0xc79f('0x18')](function(_0x17cbed){return _0x17cbed;});}return null;};}function removeEntity(_0x1e8c2a){return function(_0x39d3b9){if(_0x39d3b9){return _0x39d3b9[_0xc79f('0x19')]()[_0xc79f('0x18')](function(){_0x1e8c2a[_0xc79f('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8aff){return function(_0x182c36){if(!_0x182c36){_0x1c8aff[_0xc79f('0xf')](0x194);}return _0x182c36;};}function handleError(_0x57e870,_0x4af534){_0x4af534=_0x4af534||0x1f4;return function(_0x4f522c){logger[_0xc79f('0x1a')](_0x4f522c['stack']);if(_0x4f522c['name']){delete _0x4f522c[_0xc79f('0x1b')];}_0x57e870['status'](_0x4af534)[_0xc79f('0x1c')](_0x4f522c);};}exports[_0xc79f('0x1d')]=function(_0x4ba23d,_0x15b9af){var _0x45007c={};var _0x47717e=_[_0xc79f('0x1e')](db['SmsInteraction'][_0xc79f('0x1f')],function(_0x39fd57){return{'name':_0x39fd57[_0xc79f('0x20')],'type':_0x39fd57[_0xc79f('0x21')][_0xc79f('0x22')]};});_0x45007c=qs['getOptions'](_0x47717e,_0x4ba23d);return interaction[_0xc79f('0x23')](_0xc79f('0x24'),_0x4ba23d[_0xc79f('0x25')],_0x4ba23d['user'],_0x45007c,_0x47717e)['then'](respondWithFilteredResult(_0x15b9af,_0x45007c))[_0xc79f('0x26')](handleError(_0x15b9af,null));};exports[_0xc79f('0x27')]=function(_0x2ef574,_0x23f1be){var _0x9bd278={'raw':![],'where':{'id':_0x2ef574[_0xc79f('0x28')]['id']}},_0x33796a={};_0x33796a[_0xc79f('0x29')]=_[_0xc79f('0x2a')](db[_0xc79f('0x2b')][_0xc79f('0x1f')]);_0x33796a['query']=_[_0xc79f('0x2a')](_0x2ef574[_0xc79f('0x25')]);_0x33796a['filters']=_['intersection'](_0x33796a[_0xc79f('0x29')],_0x33796a[_0xc79f('0x25')]);_0x9bd278['attributes']=_['intersection'](_0x33796a[_0xc79f('0x29')],qs[_0xc79f('0x2c')](_0x2ef574['query']['fields']));_0x9bd278[_0xc79f('0x2d')]=_0x9bd278['attributes'][_0xc79f('0x2e')]?_0x9bd278[_0xc79f('0x2d')]:_0x33796a['model'];if(_0x2ef574[_0xc79f('0x25')][_0xc79f('0x2f')]){_0x9bd278[_0xc79f('0x30')]=[{'all':!![]}];}_0x9bd278=_[_0xc79f('0x31')]({},_0x9bd278,_0x2ef574['options']);return db['SmsInteraction'][_0xc79f('0x32')](_0x9bd278)[_0xc79f('0x18')](handleEntityNotFound(_0x23f1be,null))['then'](respondWithResult(_0x23f1be,null))[_0xc79f('0x26')](handleError(_0x23f1be,null));};exports['create']=function(_0x339ad1,_0x259815){return db[_0xc79f('0x2b')][_0xc79f('0x33')](_0x339ad1[_0xc79f('0x34')],{})[_0xc79f('0x18')](respondWithResult(_0x259815,0xc9))[_0xc79f('0x26')](handleError(_0x259815,null));};exports['update']=function(_0x55fe85,_0x2613a8){if(_0x55fe85[_0xc79f('0x34')]['id']){delete _0x55fe85['body']['id'];}return db[_0xc79f('0x2b')][_0xc79f('0x32')]({'where':{'id':_0x55fe85[_0xc79f('0x28')]['id']}})['then'](handleEntityNotFound(_0x2613a8,null))[_0xc79f('0x18')](saveUpdates(_0x55fe85[_0xc79f('0x34')],null))[_0xc79f('0x18')](respondWithResult(_0x2613a8,null))['catch'](handleError(_0x2613a8,null));};exports[_0xc79f('0x19')]=function(_0x373a1e,_0x465647){return db[_0xc79f('0x2b')][_0xc79f('0x32')]({'where':{'id':_0x373a1e[_0xc79f('0x28')]['id']}})[_0xc79f('0x18')](handleEntityNotFound(_0x465647,null))[_0xc79f('0x18')](removeEntity(_0x465647,null))['catch'](handleError(_0x465647,null));};exports[_0xc79f('0x35')]=function(_0x5ae59d,_0x4e67e7){return db[_0xc79f('0x2b')][_0xc79f('0x35')]()[_0xc79f('0x18')](respondWithResult(_0x4e67e7,null))['catch'](handleError(_0x4e67e7,null));};exports['addMessage']=function(_0x2a4d2c,_0x3ca2be){return db[_0xc79f('0x36')][_0xc79f('0x32')]({'where':{'id':_0x2a4d2c[_0xc79f('0x28')]['id']}})[_0xc79f('0x18')](handleEntityNotFound(_0x3ca2be,null))[_0xc79f('0x18')](function(_0x3a94a5){if(_0x3a94a5){return _0x3a94a5[_0xc79f('0x37')](_0x2a4d2c[_0xc79f('0x34')]['ids'],_[_0xc79f('0x38')](_0x2a4d2c['body'],[_0xc79f('0x39'),'id'])||{});}})['then'](respondWithResult(_0x3ca2be,null))[_0xc79f('0x26')](handleError(_0x3ca2be,null));};exports[_0xc79f('0x3a')]=function(_0x3d2cc0,_0x3b9bd3){var _0x25c595={'raw':![],'where':{}};var _0x516a30={};var _0xdca12e={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xc79f('0x3b')]({'where':{'id':_0x3d2cc0[_0xc79f('0x28')]['id']}})[_0xc79f('0x18')](handleEntityNotFound(_0x3b9bd3,null))[_0xc79f('0x18')](function(_0x45de38){if(_0x45de38){_0x516a30[_0xc79f('0x29')]=_['keys'](db[_0xc79f('0x36')][_0xc79f('0x1f')]);_0x516a30[_0xc79f('0x25')]=_[_0xc79f('0x2a')](_0x3d2cc0[_0xc79f('0x25')]);_0x516a30[_0xc79f('0x3c')]=_['intersection'](_0x516a30[_0xc79f('0x29')],_0x516a30[_0xc79f('0x25')]);_0x25c595[_0xc79f('0x2d')]=_['intersection'](_0x516a30[_0xc79f('0x29')],qs[_0xc79f('0x2c')](_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x2c')]));_0x25c595[_0xc79f('0x2d')]=_0x25c595['attributes'][_0xc79f('0x2e')]?_0x25c595[_0xc79f('0x2d')]:_0x516a30['model'];if(!_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x3d')](_0xc79f('0x3e'))){_0x25c595['limit']=qs[_0xc79f('0x14')](_0x3d2cc0[_0xc79f('0x25')]['limit']);_0x25c595[_0xc79f('0x13')]=qs[_0xc79f('0x13')](_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x13')]);}_0x25c595[_0xc79f('0x3f')]=qs[_0xc79f('0x40')](_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x40')]);_0x25c595[_0xc79f('0x41')]=qs[_0xc79f('0x3c')](_[_0xc79f('0x42')](_0x3d2cc0['query'],_0x516a30[_0xc79f('0x3c')]));_0x25c595[_0xc79f('0x41')][_0xc79f('0x43')]=_0x45de38['id'];if(_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x44')]){_0x25c595['where']=_[_0xc79f('0x31')](_0x25c595[_0xc79f('0x41')],{'$or':_['map'](_0x25c595['attributes'],function(_0x4cebe){var _0x197416={};_0x197416[_0x4cebe]={'$like':'%'+_0x3d2cc0[_0xc79f('0x25')]['filter']+'%'};return _0x197416;})});}if(_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x45')]){var _0xbb1ee3=_0x3d2cc0[_0xc79f('0x25')][_0xc79f('0x45')]['split'](',');var _0x46a0c0={};_0x46a0c0[_0xbb1ee3[0x0]]={'$gte':moment(_0xbb1ee3[0x1])[_0xc79f('0x46')](_0xc79f('0x47'))};_0x25c595[_0xc79f('0x41')]=_['merge'](_0x25c595[_0xc79f('0x41')],_0x46a0c0);}_0x25c595=_[_0xc79f('0x31')]({},_0x25c595,_0x3d2cc0[_0xc79f('0x48')]);return db['SmsMessage']['count']({'where':_0x25c595[_0xc79f('0x41')]})[_0xc79f('0x18')](function(_0x50f1fb){_0xdca12e[_0xc79f('0x49')]=_0x50f1fb;if(_0x3d2cc0['query'][_0xc79f('0x2f')]){_0x25c595[_0xc79f('0x30')]=[{'all':!![]}];}return db[_0xc79f('0x36')][_0xc79f('0x23')](_0x25c595);})[_0xc79f('0x18')](function(_0xd49ebc){_0xdca12e[_0xc79f('0x4a')]=_0xd49ebc;return _0xdca12e;});}})[_0xc79f('0x18')](respondWithFilteredResult(_0x3b9bd3,_0x25c595))['catch'](handleError(_0x3b9bd3,null));};exports[_0xc79f('0x4b')]=function(_0x307046,_0x36641d){return db[_0xc79f('0x2b')]['find']({'where':{'id':_0x307046['params']['id']}})[_0xc79f('0x18')](handleEntityNotFound(_0x36641d,null))[_0xc79f('0x18')](function(_0x46a882){if(_0x46a882){return _0x46a882[_0xc79f('0x4c')](_0x307046[_0xc79f('0x34')][_0xc79f('0x39')],_[_0xc79f('0x38')](_0x307046[_0xc79f('0x34')],[_0xc79f('0x39'),'id'])||{})[_0xc79f('0x4d')](function(){return db[_0xc79f('0x4e')]['findAll']({'attributes':['id',_0xc79f('0x1b'),'color'],'where':{'id':_0x307046[_0xc79f('0x34')][_0xc79f('0x39')]}});})[_0xc79f('0x18')](function(_0x5668e2){socket['emit'](_0xc79f('0x4f'),{'id':Number(_0x307046[_0xc79f('0x28')]['id']),'tags':_0x5668e2||[]});return{'id':Number(_0x307046[_0xc79f('0x28')]['id']),'tags':_0x5668e2||[]};});}})[_0xc79f('0x18')](respondWithResult(_0x36641d,null))[_0xc79f('0x26')](handleError(_0x36641d,null));};exports['removeTags']=function(_0x504b2c,_0x3f7d5e){return db[_0xc79f('0x2b')][_0xc79f('0x32')]({'where':{'id':_0x504b2c[_0xc79f('0x28')]['id']}})[_0xc79f('0x18')](handleEntityNotFound(_0x3f7d5e,null))['then'](function(_0x44685c){if(_0x44685c){return _0x44685c[_0xc79f('0x50')](_0x504b2c['query'][_0xc79f('0x39')]);}})['then'](respondWithStatusCode(_0x3f7d5e,null))[_0xc79f('0x26')](handleError(_0x3f7d5e,null));};exports['download']=function(_0x511bc2,_0x3f5a7e){var _0x113a08=moment()['unix']()[_0xc79f('0x51')]();var _0x4c26e4=path[_0xc79f('0x52')](config['root'],_0xc79f('0x53'),_0xc79f('0x54'),_0xc79f('0x55'));var _0x2521c0=path[_0xc79f('0x52')](_0x4c26e4,_0x113a08);var _0xa2c160=util['format']('transcript-%d-%s.zip',_0x511bc2[_0xc79f('0x28')]['id'],_0x113a08);var _0x2d2fad=path[_0xc79f('0x52')](_0x4c26e4,_0xa2c160);var _0x4664e0=[];_0x4664e0[_0xc79f('0x56')]({'model':db[_0xc79f('0x57')],'as':_0xc79f('0x57'),'attributes':['id','fullname'],'raw':!![]});_0x4664e0[_0xc79f('0x56')]({'model':db['CmContact'],'as':_0xc79f('0x58'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x1a7c29=[{'model':db[_0xc79f('0x36')],'as':_0xc79f('0x59'),'attributes':['id','body',_0xc79f('0x5a'),_0xc79f('0x5b'),_0xc79f('0x5c'),'read'],'include':_0x4664e0}];_0x1a7c29['push']({'model':db[_0xc79f('0x5d')],'as':_0xc79f('0x5e'),'attributes':['id',_0xc79f('0x1b')]});_0x1a7c29[_0xc79f('0x56')]({'model':db['User'],'as':'Owner','attributes':['id',_0xc79f('0x5f')]});return db[_0xc79f('0x2b')][_0xc79f('0x32')]({'where':{'id':_0x511bc2['params']['id']},'include':_0x1a7c29})[_0xc79f('0x18')](handleEntityNotFound(_0x3f5a7e,null))[_0xc79f('0x18')](function(_0x7336ff){if(_0x7336ff){var _0x43c690=_0x7336ff[_0xc79f('0x60')]({'plain':!![]});fs[_0xc79f('0x61')](_0x2521c0);var _0x1f928a={'channel':'Sms','account':_0x43c690['Account'][_0xc79f('0x1b')],'agent':_0x43c690[_0xc79f('0x62')]?_0x43c690['Owner'][_0xc79f('0x5f')]:_0xc79f('0x63'),'createdAt':moment(_0x43c690['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc79f('0x51')](),'closedAt':_0x43c690['closed']?moment(_0x43c690['closedAt'])[_0xc79f('0x46')](_0xc79f('0x47'))[_0xc79f('0x51')]():'','disposition':_0x43c690['disposition'],'messages':_(_0x43c690[_0xc79f('0x59')])['filter']({'secret':![]})[_0xc79f('0x1e')](function(_0x5315d){return{'date':moment(_0x5315d[_0xc79f('0x5a')])['format'](_0xc79f('0x47'))[_0xc79f('0x51')](),'sender':_0x5315d['direction']===_0xc79f('0x64')?_0x5315d[_0xc79f('0x57')]?_0x5315d[_0xc79f('0x57')][_0xc79f('0x5f')]:_0xc79f('0x65'):_0x5315d[_0xc79f('0x58')][_0xc79f('0x66')]+(_0x5315d['Contact']['lastName']?'\x20'+_0x5315d[_0xc79f('0x58')][_0xc79f('0x67')]:''),'body':_0x5315d['body'],'direction':_0x5315d[_0xc79f('0x5b')]===_0xc79f('0x64')?'A':'C','secret':_0x5315d['secret'],'read':_0x5315d[_0xc79f('0x68')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xc79f('0x69')],_0xc79f('0x53'),'views','downloadInteraction.ejs'),{'interaction':_0x1f928a})['then'](function(_0x20e4c6){var _0x3d4b76=path[_0xc79f('0x52')](_0x2521c0,'transcript-'+_0x43c690['id']+'-'+_0x113a08+_0xc79f('0x6a'));var _0x3a8ce7={'path':_0x3d4b76,'channel':_0xc79f('0x6b'),'interactionId':_0x43c690['id']};return pdf[_0xc79f('0x6c')](_0x20e4c6,_0x3a8ce7);})[_0xc79f('0x18')](function(){return new BPromise(function(_0x3aaddd,_0x2f4303){zipdir(_0x2521c0,{'saveTo':_0x2d2fad},function(_0x29dc27,_0x10c7ae){if(_0x29dc27)return _0x2f4303(_0x29dc27);return _0x3aaddd(_0x10c7ae);});})[_0xc79f('0x18')](function(){return new BPromise(function(_0x5c75e1,_0x4e42d4){rimraf(_0x2521c0,function(_0x37d5fe){if(_0x37d5fe)_0x4e42d4(_0x37d5fe);return _0x5c75e1();});});})['then'](function(){return _0x3f5a7e[_0xc79f('0x6d')](_0x2d2fad,_0xa2c160,function(_0x5d2454){if(_0x5d2454){console[_0xc79f('0x6e')]('err',_0x5d2454);}else{fs[_0xc79f('0x6f')](_0x2d2fad);}});});});}else{return _0x3f5a7e[_0xc79f('0xf')](0xc8);}})[_0xc79f('0x26')](handleError(_0x3f5a7e,null));}; \ No newline at end of file +var _0x966d=['views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','send','map','SmsInteraction','rawAttributes','key','getOptions','findAll','sms','query','user','catch','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','create','update','body','params','describe','addMessage','SmsMessage','find','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','SmsInteractionId','$gte','split','format','rows','addTags','spread','Tag','color','removeTags','download','unix','toString','join','server','files','tmp','User','push','CmContact','Contact','firstName','lastName','Messages','createdAt','read','SmsAccount','Account','fullname','get','mkdirSync','Sms','Owner','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','filter','direction','out','System','secret','root'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x966d,0x1e3));var _0xd966=function(_0xc48763,_0x43b8e5){_0xc48763=_0xc48763-0x0;var _0x55c1ac=_0x966d[_0xc48763];return _0x55c1ac;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd966('0x0'));var moment=require(_0xd966('0x1'));var BPromise=require(_0xd966('0x2'));var util=require(_0xd966('0x3'));var path=require(_0xd966('0x4'));var ejs=require(_0xd966('0x5'));var fs=require('fs');var _=require(_0xd966('0x6'));var Redis=require(_0xd966('0x7'));var interaction=require(_0xd966('0x8'));var qs=require(_0xd966('0x9'));var pdf=require(_0xd966('0xa'));var logger=require(_0xd966('0xb'))(_0xd966('0xc'));var config=require('../../config/environment');var db=require(_0xd966('0xd'))['db'];config[_0xd966('0xe')]=_[_0xd966('0xf')](config[_0xd966('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xd966('0x10'))(new Redis(config[_0xd966('0xe')]));require(_0xd966('0x11'))['register'](socket);function respondWithStatusCode(_0x411332,_0x79c87a){_0x79c87a=_0x79c87a||0xcc;return function(_0x5cc81a){if(_0x5cc81a){return _0x411332[_0xd966('0x12')](_0x79c87a);}return _0x411332['status'](_0x79c87a)[_0xd966('0x13')]();};}function respondWithResult(_0x1ebf12,_0x41f0c8){_0x41f0c8=_0x41f0c8||0xc8;return function(_0x1f59fe){if(_0x1f59fe){return _0x1ebf12[_0xd966('0x14')](_0x41f0c8)[_0xd966('0x15')](_0x1f59fe);}};}function respondWithFilteredResult(_0x27a391,_0x4eab9a){return function(_0x490314){if(_0x490314){var _0x4b05d7=typeof _0x4eab9a['offset']===_0xd966('0x16')&&typeof _0x4eab9a['limit']===_0xd966('0x16');var _0x15e025=_0x490314[_0xd966('0x17')];var _0x462b9c=_0x4b05d7?0x0:_0x4eab9a[_0xd966('0x18')];var _0x40ff08=_0x4b05d7?_0x490314['count']:_0x4eab9a['offset']+_0x4eab9a[_0xd966('0x19')];var _0x66b24e;if(_0x40ff08>=_0x15e025){_0x40ff08=_0x15e025;_0x66b24e=0xc8;}else{_0x66b24e=0xce;}_0x27a391[_0xd966('0x14')](_0x66b24e);return _0x27a391[_0xd966('0x1a')](_0xd966('0x1b'),_0x462b9c+'-'+_0x40ff08+'/'+_0x15e025)[_0xd966('0x15')](_0x490314);}return null;};}function saveUpdates(_0x327bb3){return function(_0x3b96c3){if(_0x3b96c3){return _0x3b96c3['update'](_0x327bb3)[_0xd966('0x1c')](function(_0x5e6362){return _0x5e6362;});}return null;};}function removeEntity(_0x1d04bd){return function(_0x16dc3e){if(_0x16dc3e){return _0x16dc3e[_0xd966('0x1d')]()[_0xd966('0x1c')](function(){_0x1d04bd['status'](0xcc)[_0xd966('0x13')]();});}};}function handleEntityNotFound(_0x28f1cf){return function(_0x2d64a3){if(!_0x2d64a3){_0x28f1cf[_0xd966('0x12')](0x194);}return _0x2d64a3;};}function handleError(_0x451386,_0x516a1b){_0x516a1b=_0x516a1b||0x1f4;return function(_0xcdef4a){logger[_0xd966('0x1e')](_0xcdef4a[_0xd966('0x1f')]);if(_0xcdef4a[_0xd966('0x20')]){delete _0xcdef4a['name'];}_0x451386['status'](_0x516a1b)[_0xd966('0x21')](_0xcdef4a);};}exports['index']=function(_0x5e0664,_0xe40e0e){var _0x548756={};var _0xc8f0ee=_[_0xd966('0x22')](db[_0xd966('0x23')][_0xd966('0x24')],function(_0x4ffcf3){return{'name':_0x4ffcf3['fieldName'],'type':_0x4ffcf3['type'][_0xd966('0x25')]};});_0x548756=qs[_0xd966('0x26')](_0xc8f0ee,_0x5e0664);return interaction[_0xd966('0x27')](_0xd966('0x28'),_0x5e0664[_0xd966('0x29')],_0x5e0664[_0xd966('0x2a')],_0x548756,_0xc8f0ee)[_0xd966('0x1c')](respondWithFilteredResult(_0xe40e0e,_0x548756))[_0xd966('0x2b')](handleError(_0xe40e0e,null));};exports['show']=function(_0x266b95,_0x3044ec){var _0xd32416={'raw':![],'where':{'id':_0x266b95['params']['id']}},_0x343786={};_0x343786[_0xd966('0x2c')]=_[_0xd966('0x2d')](db[_0xd966('0x23')][_0xd966('0x24')]);_0x343786[_0xd966('0x29')]=_['keys'](_0x266b95[_0xd966('0x29')]);_0x343786[_0xd966('0x2e')]=_[_0xd966('0x2f')](_0x343786[_0xd966('0x2c')],_0x343786[_0xd966('0x29')]);_0xd32416[_0xd966('0x30')]=_[_0xd966('0x2f')](_0x343786[_0xd966('0x2c')],qs[_0xd966('0x31')](_0x266b95[_0xd966('0x29')][_0xd966('0x31')]));_0xd32416[_0xd966('0x30')]=_0xd32416[_0xd966('0x30')]['length']?_0xd32416[_0xd966('0x30')]:_0x343786[_0xd966('0x2c')];if(_0x266b95[_0xd966('0x29')][_0xd966('0x32')]){_0xd32416[_0xd966('0x33')]=[{'all':!![]}];}_0xd32416=_[_0xd966('0x34')]({},_0xd32416,_0x266b95[_0xd966('0x35')]);return db['SmsInteraction']['find'](_0xd32416)[_0xd966('0x1c')](handleEntityNotFound(_0x3044ec,null))[_0xd966('0x1c')](respondWithResult(_0x3044ec,null))['catch'](handleError(_0x3044ec,null));};exports[_0xd966('0x36')]=function(_0x225eb8,_0xe66933){return db[_0xd966('0x23')][_0xd966('0x36')](_0x225eb8['body'],{})['then'](respondWithResult(_0xe66933,0xc9))['catch'](handleError(_0xe66933,null));};exports[_0xd966('0x37')]=function(_0x2131b6,_0x12bf65){if(_0x2131b6[_0xd966('0x38')]['id']){delete _0x2131b6[_0xd966('0x38')]['id'];}return db[_0xd966('0x23')]['find']({'where':{'id':_0x2131b6[_0xd966('0x39')]['id']}})['then'](handleEntityNotFound(_0x12bf65,null))['then'](saveUpdates(_0x2131b6[_0xd966('0x38')],null))[_0xd966('0x1c')](respondWithResult(_0x12bf65,null))[_0xd966('0x2b')](handleError(_0x12bf65,null));};exports['destroy']=function(_0x55cfdb,_0x83745e){return db[_0xd966('0x23')]['find']({'where':{'id':_0x55cfdb[_0xd966('0x39')]['id']}})[_0xd966('0x1c')](handleEntityNotFound(_0x83745e,null))[_0xd966('0x1c')](removeEntity(_0x83745e,null))[_0xd966('0x2b')](handleError(_0x83745e,null));};exports[_0xd966('0x3a')]=function(_0x79d03a,_0x522a99){return db['SmsInteraction']['describe']()[_0xd966('0x1c')](respondWithResult(_0x522a99,null))[_0xd966('0x2b')](handleError(_0x522a99,null));};exports[_0xd966('0x3b')]=function(_0xc06bd1,_0x39c4b2){return db[_0xd966('0x3c')][_0xd966('0x3d')]({'where':{'id':_0xc06bd1[_0xd966('0x39')]['id']}})[_0xd966('0x1c')](handleEntityNotFound(_0x39c4b2,null))[_0xd966('0x1c')](function(_0x364ed3){if(_0x364ed3){return _0x364ed3['addMessage'](_0xc06bd1[_0xd966('0x38')]['ids'],_[_0xd966('0x3e')](_0xc06bd1[_0xd966('0x38')],[_0xd966('0x3f'),'id'])||{});}})[_0xd966('0x1c')](respondWithResult(_0x39c4b2,null))[_0xd966('0x2b')](handleError(_0x39c4b2,null));};exports[_0xd966('0x40')]=function(_0x586364,_0x165aa1){var _0x282218={'raw':![],'where':{}};var _0x32b9fc={};var _0x23a658={'count':0x0,'rows':[]};return db[_0xd966('0x23')][_0xd966('0x41')]({'where':{'id':_0x586364['params']['id']}})[_0xd966('0x1c')](handleEntityNotFound(_0x165aa1,null))['then'](function(_0x5cbafe){if(_0x5cbafe){_0x32b9fc[_0xd966('0x2c')]=_['keys'](db[_0xd966('0x3c')][_0xd966('0x24')]);_0x32b9fc[_0xd966('0x29')]=_[_0xd966('0x2d')](_0x586364[_0xd966('0x29')]);_0x32b9fc[_0xd966('0x2e')]=_['intersection'](_0x32b9fc[_0xd966('0x2c')],_0x32b9fc[_0xd966('0x29')]);_0x282218[_0xd966('0x30')]=_['intersection'](_0x32b9fc[_0xd966('0x2c')],qs[_0xd966('0x31')](_0x586364[_0xd966('0x29')]['fields']));_0x282218[_0xd966('0x30')]=_0x282218[_0xd966('0x30')]['length']?_0x282218['attributes']:_0x32b9fc[_0xd966('0x2c')];if(!_0x586364[_0xd966('0x29')][_0xd966('0x42')]('nolimit')){_0x282218[_0xd966('0x19')]=qs[_0xd966('0x19')](_0x586364[_0xd966('0x29')]['limit']);_0x282218['offset']=qs[_0xd966('0x18')](_0x586364['query'][_0xd966('0x18')]);}_0x282218[_0xd966('0x43')]=qs[_0xd966('0x44')](_0x586364['query'][_0xd966('0x44')]);_0x282218[_0xd966('0x45')]=qs['filters'](_['pick'](_0x586364[_0xd966('0x29')],_0x32b9fc[_0xd966('0x2e')]));_0x282218['where'][_0xd966('0x46')]=_0x5cbafe['id'];if(_0x586364[_0xd966('0x29')]['filter']){_0x282218['where']=_[_0xd966('0x34')](_0x282218[_0xd966('0x45')],{'$or':_[_0xd966('0x22')](_0x282218['attributes'],function(_0x5445e0){var _0x48ef4b={};_0x48ef4b[_0x5445e0]={'$like':'%'+_0x586364[_0xd966('0x29')]['filter']+'%'};return _0x48ef4b;})});}if(_0x586364[_0xd966('0x29')][_0xd966('0x47')]){var _0x432721=_0x586364[_0xd966('0x29')][_0xd966('0x47')][_0xd966('0x48')](',');var _0x3b300a={};_0x3b300a[_0x432721[0x0]]={'$gte':moment(_0x432721[0x1])[_0xd966('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x282218['where']=_['merge'](_0x282218['where'],_0x3b300a);}_0x282218=_[_0xd966('0x34')]({},_0x282218,_0x586364['options']);return db['SmsMessage'][_0xd966('0x17')]({'where':_0x282218[_0xd966('0x45')]})['then'](function(_0xcfd7e4){_0x23a658[_0xd966('0x17')]=_0xcfd7e4;if(_0x586364[_0xd966('0x29')][_0xd966('0x32')]){_0x282218[_0xd966('0x33')]=[{'all':!![]}];}return db['SmsMessage'][_0xd966('0x27')](_0x282218);})['then'](function(_0x54be76){_0x23a658[_0xd966('0x4a')]=_0x54be76;return _0x23a658;});}})[_0xd966('0x1c')](respondWithFilteredResult(_0x165aa1,_0x282218))['catch'](handleError(_0x165aa1,null));};exports[_0xd966('0x4b')]=function(_0x26ac76,_0xa69602){return db[_0xd966('0x23')][_0xd966('0x3d')]({'where':{'id':_0x26ac76[_0xd966('0x39')]['id']}})['then'](handleEntityNotFound(_0xa69602,null))[_0xd966('0x1c')](function(_0x2fd494){if(_0x2fd494){return _0x2fd494['setTags'](_0x26ac76[_0xd966('0x38')][_0xd966('0x3f')],_[_0xd966('0x3e')](_0x26ac76[_0xd966('0x38')],['ids','id'])||{})[_0xd966('0x4c')](function(){return db[_0xd966('0x4d')]['findAll']({'attributes':['id',_0xd966('0x20'),_0xd966('0x4e')],'where':{'id':_0x26ac76[_0xd966('0x38')][_0xd966('0x3f')]}});})[_0xd966('0x1c')](function(_0x4d2fca){socket['emit']('smsInteractionTags:save',{'id':Number(_0x26ac76['params']['id']),'tags':_0x4d2fca||[]});return{'id':Number(_0x26ac76[_0xd966('0x39')]['id']),'tags':_0x4d2fca||[]};});}})[_0xd966('0x1c')](respondWithResult(_0xa69602,null))[_0xd966('0x2b')](handleError(_0xa69602,null));};exports[_0xd966('0x4f')]=function(_0x13a5c1,_0x5113b2){return db['SmsInteraction'][_0xd966('0x3d')]({'where':{'id':_0x13a5c1[_0xd966('0x39')]['id']}})[_0xd966('0x1c')](handleEntityNotFound(_0x5113b2,null))[_0xd966('0x1c')](function(_0xcf412b){if(_0xcf412b){return _0xcf412b[_0xd966('0x4f')](_0x13a5c1[_0xd966('0x29')][_0xd966('0x3f')]);}})[_0xd966('0x1c')](respondWithStatusCode(_0x5113b2,null))[_0xd966('0x2b')](handleError(_0x5113b2,null));};exports[_0xd966('0x50')]=function(_0x48004d,_0x3becb4){var _0xd03126=moment()[_0xd966('0x51')]()[_0xd966('0x52')]();var _0x2cc553=path[_0xd966('0x53')](config['root'],_0xd966('0x54'),_0xd966('0x55'),_0xd966('0x56'));var _0x357002=path[_0xd966('0x53')](_0x2cc553,_0xd03126);var _0x364133=util[_0xd966('0x49')]('transcript-%d-%s.zip',_0x48004d[_0xd966('0x39')]['id'],_0xd03126);var _0x51de3e=path[_0xd966('0x53')](_0x2cc553,_0x364133);var _0x4b42ed=[];_0x4b42ed['push']({'model':db[_0xd966('0x57')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4b42ed[_0xd966('0x58')]({'model':db[_0xd966('0x59')],'as':_0xd966('0x5a'),'attributes':['id',_0xd966('0x5b'),_0xd966('0x5c')],'raw':!![]});var _0x3fe2a3=[{'model':db[_0xd966('0x3c')],'as':_0xd966('0x5d'),'attributes':['id',_0xd966('0x38'),_0xd966('0x5e'),'direction','secret',_0xd966('0x5f')],'include':_0x4b42ed}];_0x3fe2a3['push']({'model':db[_0xd966('0x60')],'as':_0xd966('0x61'),'attributes':['id',_0xd966('0x20')]});_0x3fe2a3[_0xd966('0x58')]({'model':db[_0xd966('0x57')],'as':'Owner','attributes':['id',_0xd966('0x62')]});return db['SmsInteraction']['find']({'where':{'id':_0x48004d[_0xd966('0x39')]['id']},'include':_0x3fe2a3})[_0xd966('0x1c')](handleEntityNotFound(_0x3becb4,null))[_0xd966('0x1c')](function(_0x136067){if(_0x136067){var _0x6ee756=_0x136067[_0xd966('0x63')]({'plain':!![]});fs[_0xd966('0x64')](_0x357002);var _0x2485cb={'channel':_0xd966('0x65'),'account':_0x6ee756['Account'][_0xd966('0x20')],'agent':_0x6ee756[_0xd966('0x66')]?_0x6ee756[_0xd966('0x66')]['fullname']:'N.A.','createdAt':moment(_0x6ee756['createdAt'])[_0xd966('0x49')](_0xd966('0x67'))[_0xd966('0x52')](),'closedAt':_0x6ee756[_0xd966('0x68')]?moment(_0x6ee756[_0xd966('0x69')])['format'](_0xd966('0x67'))[_0xd966('0x52')]():'','disposition':_0x6ee756['disposition'],'messages':_(_0x6ee756[_0xd966('0x5d')])[_0xd966('0x6a')]({'secret':![]})['map'](function(_0x4c3b04){return{'date':moment(_0x4c3b04[_0xd966('0x5e')])[_0xd966('0x49')](_0xd966('0x67'))[_0xd966('0x52')](),'sender':_0x4c3b04[_0xd966('0x6b')]===_0xd966('0x6c')?_0x4c3b04['User']?_0x4c3b04[_0xd966('0x57')][_0xd966('0x62')]:_0xd966('0x6d'):_0x4c3b04['Contact'][_0xd966('0x5b')]+(_0x4c3b04['Contact'][_0xd966('0x5c')]?'\x20'+_0x4c3b04['Contact'][_0xd966('0x5c')]:''),'body':_0x4c3b04[_0xd966('0x38')],'direction':_0x4c3b04['direction']===_0xd966('0x6c')?'A':'C','secret':_0x4c3b04[_0xd966('0x6e')],'read':_0x4c3b04['read']};})['value']()};return ejs['renderFile'](path['join'](config[_0xd966('0x6f')],_0xd966('0x54'),_0xd966('0x70'),'downloadInteraction.ejs'),{'interaction':_0x2485cb})[_0xd966('0x1c')](function(_0x234fd7){var _0x2ecc95=path['join'](_0x357002,_0xd966('0x71')+_0x6ee756['id']+'-'+_0xd03126+_0xd966('0x72'));var _0x4b26de={'path':_0x2ecc95,'channel':_0xd966('0x65'),'interactionId':_0x6ee756['id']};return pdf[_0xd966('0x73')](_0x234fd7,_0x4b26de);})[_0xd966('0x1c')](function(){return new BPromise(function(_0x3305f5,_0x35cdde){zipdir(_0x357002,{'saveTo':_0x51de3e},function(_0x2ec852,_0x46645c){if(_0x2ec852)return _0x35cdde(_0x2ec852);return _0x3305f5(_0x46645c);});})['then'](function(){return new BPromise(function(_0x539ae9,_0x4df738){rimraf(_0x357002,function(_0x42f94a){if(_0x42f94a)_0x4df738(_0x42f94a);return _0x539ae9();});});})[_0xd966('0x1c')](function(){return _0x3becb4[_0xd966('0x50')](_0x51de3e,_0x364133,function(_0x443884){if(_0x443884){console[_0xd966('0x74')](_0xd966('0x75'),_0x443884);}else{fs[_0xd966('0x76')](_0x51de3e);}});});});}else{return _0x3becb4[_0xd966('0x12')](0xc8);}})[_0xd966('0x2b')](handleError(_0x3becb4,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f428e84..efbcee3 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 _0x1a85=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','update','remove','getUsers','setDataValue','map'];(function(_0x44fbda,_0x15d0e8){var _0x4cd474=function(_0x307104){while(--_0x307104){_0x44fbda['push'](_0x44fbda['shift']());}};_0x4cd474(++_0x15d0e8);}(_0x1a85,0x178));var _0x51a8=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x1a85[_0x2b91c5];return _0xbd5531;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x51a8('0x0')];var SmsMessage=require(_0x51a8('0x1'))['db'][_0x51a8('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51a8('0x3'),'afterDestroy':_0x51a8('0x4')};function emitEvent(_0x99e371){return function(_0x48a21b,_0xaac0bf,_0x4b76a8){_0x48a21b[_0x51a8('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x331117){_0x48a21b[_0x51a8('0x6')]('Users',_0x331117[_0x51a8('0x7')](function(_0x513685){return{'id':_0x513685['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x48a21b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51a8('0x8')](function(_0x2f276b){_0x48a21b[_0x51a8('0x6')](_0x51a8('0x9'),_0x2f276b[_0x51a8('0xa')]);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371+':'+_0x48a21b['id'],_0x48a21b);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371,_0x48a21b);_0x4b76a8(null);})[_0x51a8('0xc')](_0x4b76a8(null));};}for(var e in events){if(events[_0x51a8('0xd')](e)){var event=events[e];SmsInteraction[_0x51a8('0xe')](e,emitEvent(event));}}module[_0x51a8('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xfcbb=['catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x10c97f,_0x1ba134){_0x10c97f=_0x10c97f-0x0;var _0x547285=_0xfcbb[_0x10c97f];return _0x547285;};'use strict';var EventEmitter=require(_0xbfcb('0x0'));var SmsInteraction=require(_0xbfcb('0x1'))['db'][_0xbfcb('0x2')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xbfcb('0x3')](0x0);var events={'afterCreate':_0xbfcb('0x4'),'afterUpdate':_0xbfcb('0x5'),'afterDestroy':_0xbfcb('0x6')};function emitEvent(_0x1d8b50){return function(_0x5c5a1a,_0x5201d3,_0x32c2aa){_0x5c5a1a[_0xbfcb('0x7')]({'attributes':['id'],'raw':!![]})[_0xbfcb('0x8')](function(_0x2df839){_0x5c5a1a[_0xbfcb('0x9')](_0xbfcb('0xa'),_0x2df839[_0xbfcb('0xb')](function(_0x571001){return{'id':_0x571001['id']};}));return SmsMessage[_0xbfcb('0xc')]({'where':{'SmsInteractionId':_0x5c5a1a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfcb('0x8')](function(_0x346685){_0x5c5a1a['setDataValue'](_0xbfcb('0xd'),_0x346685[_0xbfcb('0xe')]);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50+':'+_0x5c5a1a['id'],_0x5c5a1a);SmsInteractionEvents[_0xbfcb('0xf')](_0x1d8b50,_0x5c5a1a);_0x32c2aa(null);})[_0xbfcb('0x10')](_0x32c2aa(null));};}for(var e in events){if(events[_0xbfcb('0x11')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xbfcb('0x12')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 8d6ed19..ae93970 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 _0x44d2=['format','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','closed','closedAt'];(function(_0x43a8da,_0x3773a0){var _0x4d5920=function(_0x33b01a){while(--_0x33b01a){_0x43a8da['push'](_0x43a8da['shift']());}};_0x4d5920(++_0x3773a0);}(_0x44d2,0x181));var _0x244d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x44d2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x244d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x244d('0x1'));var moment=require('moment');var BPromise=require(_0x244d('0x2'));var rp=require(_0x244d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x244d('0x4'));var config=require(_0x244d('0x5'));var attributes=require(_0x244d('0x6'));module['exports']=function(_0x23c8aa,_0x3272a2){return _0x23c8aa[_0x244d('0x7')](_0x244d('0x8'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1dc3a3,_0x2be310,_0x41525d){if(_0x1dc3a3['changed'](_0x244d('0x9'))){_0x1dc3a3[_0x244d('0xa')]=moment()[_0x244d('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x41525d(null,_0x1dc3a3);}}});}; \ No newline at end of file +var _0xc1e4=['SmsInteraction','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsInteraction.attributes','exports','define'];(function(_0x305c8f,_0xc5f7fb){var _0x5ddc30=function(_0x1aed6f){while(--_0x1aed6f){_0x305c8f['push'](_0x305c8f['shift']());}};_0x5ddc30(++_0xc5f7fb);}(_0xc1e4,0xb9));var _0x4c1e=function(_0x5ac1f9,_0x3f706a){_0x5ac1f9=_0x5ac1f9-0x0;var _0x1e136f=_0xc1e4[_0x5ac1f9];return _0x1e136f;};'use strict';var _=require(_0x4c1e('0x0'));var util=require(_0x4c1e('0x1'));var logger=require(_0x4c1e('0x2'))(_0x4c1e('0x3'));var moment=require(_0x4c1e('0x4'));var BPromise=require(_0x4c1e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c1e('0x6'));var rimraf=require(_0x4c1e('0x7'));var config=require('../../config/environment');var attributes=require(_0x4c1e('0x8'));module[_0x4c1e('0x9')]=function(_0x5ca8ed,_0x40e563){return _0x5ca8ed[_0x4c1e('0xa')](_0x4c1e('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc1c6da,_0x463f4b,_0x3caf96){if(_0xc1c6da[_0x4c1e('0xc')]('closed')){_0xc1c6da['closedAt']=moment()['format'](_0x4c1e('0xd'));}_0x3caf96(null,_0xc1c6da);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9f717ff..3cbff48 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 _0xd162=['jayson/promise','client','http','defaults','redis','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','update','body','options','raw','where','attributes','stringify','AddTagsToSmsInteraction','SmsInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x531117,_0x275d09){var _0xe2335d=function(_0x2eb842){while(--_0x2eb842){_0x531117['push'](_0x531117['shift']());}};_0xe2335d(++_0x275d09);}(_0xd162,0x16f));var _0x2d16=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0xd162[_0x115621];return _0x5ef5ce;};'use strict';var _=require(_0x2d16('0x0'));var util=require(_0x2d16('0x1'));var moment=require(_0x2d16('0x2'));var BPromise=require(_0x2d16('0x3'));var rs=require(_0x2d16('0x4'));var fs=require('fs');var Redis=require(_0x2d16('0x5'));var db=require(_0x2d16('0x6'))['db'];var utils=require(_0x2d16('0x7'));var logger=require(_0x2d16('0x8'))(_0x2d16('0x9'));var config=require(_0x2d16('0xa'));var jayson=require(_0x2d16('0xb'));var client=jayson[_0x2d16('0xc')][_0x2d16('0xd')]({'port':0x232a});config['redis']=_[_0x2d16('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2d16('0xf')]));require(_0x2d16('0x10'))['register'](socket);function respondWithRpcPromise(_0x5837f3,_0x5eba93,_0x48379b){return new BPromise(function(_0x2f674e,_0x1648bb){return client[_0x2d16('0x11')](_0x5837f3,_0x48379b)[_0x2d16('0x12')](function(_0x354677){logger[_0x2d16('0x13')](_0x2d16('0x14'),_0x5eba93,_0x2d16('0x15'));logger[_0x2d16('0x16')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5eba93,_0x2d16('0x15'),JSON['stringify'](_0x354677));if(_0x354677[_0x2d16('0x17')]){if(_0x354677[_0x2d16('0x17')][_0x2d16('0x18')]===0x1f4){logger[_0x2d16('0x17')](_0x2d16('0x14'),_0x5eba93,_0x354677[_0x2d16('0x17')][_0x2d16('0x19')]);return _0x1648bb(_0x354677['error']['message']);}logger[_0x2d16('0x17')](_0x2d16('0x14'),_0x5eba93,_0x354677[_0x2d16('0x17')][_0x2d16('0x19')]);return _0x2f674e(_0x354677[_0x2d16('0x17')][_0x2d16('0x19')]);}else{logger[_0x2d16('0x13')](_0x2d16('0x14'),_0x5eba93,_0x2d16('0x15'));_0x2f674e(_0x354677[_0x2d16('0x1a')][_0x2d16('0x19')]);}})[_0x2d16('0x1b')](function(_0x23764c){logger[_0x2d16('0x17')](_0x2d16('0x14'),_0x5eba93,_0x23764c);_0x1648bb(_0x23764c);});});}exports['UpdateSmsInteraction']=function(_0x28dcb7){var _0x1bc924=this;return new Promise(function(_0x1736d7,_0x547ee6){return db['SmsInteraction'][_0x2d16('0x1c')](_0x28dcb7[_0x2d16('0x1d')],{'raw':_0x28dcb7['options']?_0x28dcb7[_0x2d16('0x1e')][_0x2d16('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28dcb7[_0x2d16('0x1e')]?_0x28dcb7[_0x2d16('0x1e')][_0x2d16('0x20')]||null:null,'attributes':_0x28dcb7['options']?_0x28dcb7[_0x2d16('0x1e')][_0x2d16('0x21')]||null:null,'limit':_0x28dcb7['options']?_0x28dcb7[_0x2d16('0x1e')]['limit']||null:null})['then'](function(_0x182b63){logger[_0x2d16('0x13')]('UpdateSmsInteraction',_0x28dcb7);logger[_0x2d16('0x16')]('UpdateSmsInteraction',_0x28dcb7,JSON[_0x2d16('0x22')](_0x182b63));_0x1736d7(_0x182b63);})[_0x2d16('0x1b')](function(_0x541f4b){logger[_0x2d16('0x17')]('UpdateSmsInteraction',_0x541f4b[_0x2d16('0x19')],_0x28dcb7);_0x547ee6(_0x1bc924[_0x2d16('0x17')](0x1f4,_0x541f4b[_0x2d16('0x19')]));});});};exports[_0x2d16('0x23')]=function(_0x128b74){return new Promise(function(_0x338001,_0xbc640a){return db[_0x2d16('0x24')][_0x2d16('0x25')]({'where':_0x128b74[_0x2d16('0x1e')]?_0x128b74[_0x2d16('0x1e')][_0x2d16('0x20')]||null:null})[_0x2d16('0x12')](function(_0x34fce8){if(_0x34fce8){return _0x34fce8['addTags'](_0x128b74[_0x2d16('0x1d')][_0x2d16('0x26')],_[_0x2d16('0x27')](_0x128b74[_0x2d16('0x1d')],['ids','id'])||{});}})[_0x2d16('0x28')](function(_0x32ebb0){logger[_0x2d16('0x13')](_0x2d16('0x29'),_0x128b74);logger[_0x2d16('0x16')](_0x2d16('0x29'),_0x128b74,JSON[_0x2d16('0x22')](_0x32ebb0));_0x338001(_0x32ebb0);})[_0x2d16('0x1b')](function(_0x33e0dd){logger['error'](_0x2d16('0x29'),_0x33e0dd['message'],_0x128b74);_0xbc640a(_this[_0x2d16('0x17')](0x1f4,_0x33e0dd['message']));});});}; \ No newline at end of file +var _0xe17c=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','result','SmsInteraction,\x20%s,\x20%s','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','addTags','ids','omit','AddTags','lodash','util'];(function(_0x98a7f4,_0x26a940){var _0x1d8a5a=function(_0x47c3a8){while(--_0x47c3a8){_0x98a7f4['push'](_0x98a7f4['shift']());}};_0x1d8a5a(++_0x26a940);}(_0xe17c,0xf4));var _0xce17=function(_0x3a6bfa,_0xdac091){_0x3a6bfa=_0x3a6bfa-0x0;var _0x40a37b=_0xe17c[_0x3a6bfa];return _0x40a37b;};'use strict';var _=require(_0xce17('0x0'));var util=require(_0xce17('0x1'));var moment=require(_0xce17('0x2'));var BPromise=require(_0xce17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce17('0x4'));var db=require(_0xce17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xce17('0x6'))('rpc');var config=require(_0xce17('0x7'));var jayson=require(_0xce17('0x8'));var client=jayson[_0xce17('0x9')]['http']({'port':0x232a});config['redis']=_[_0xce17('0xa')](config[_0xce17('0xb')],{'host':_0xce17('0xc'),'port':0x18eb});var socket=require(_0xce17('0xd'))(new Redis(config[_0xce17('0xb')]));require(_0xce17('0xe'))['register'](socket);function respondWithRpcPromise(_0x2ff181,_0x52d250,_0x5d8ab8){return new BPromise(function(_0x2f5c1a,_0x8fa57d){return client[_0xce17('0xf')](_0x2ff181,_0x5d8ab8)[_0xce17('0x10')](function(_0x57a83d){logger[_0xce17('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x52d250,_0xce17('0x12'));logger[_0xce17('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x52d250,_0xce17('0x12'),JSON[_0xce17('0x14')](_0x57a83d));if(_0x57a83d[_0xce17('0x15')]){if(_0x57a83d[_0xce17('0x15')][_0xce17('0x16')]===0x1f4){logger[_0xce17('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x52d250,_0x57a83d[_0xce17('0x15')][_0xce17('0x17')]);return _0x8fa57d(_0x57a83d[_0xce17('0x15')][_0xce17('0x17')]);}logger[_0xce17('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x52d250,_0x57a83d[_0xce17('0x15')][_0xce17('0x17')]);return _0x2f5c1a(_0x57a83d[_0xce17('0x15')]['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x52d250,_0xce17('0x12'));_0x2f5c1a(_0x57a83d[_0xce17('0x18')][_0xce17('0x17')]);}})['catch'](function(_0x53d12e){logger[_0xce17('0x15')](_0xce17('0x19'),_0x52d250,_0x53d12e);_0x8fa57d(_0x53d12e);});});}exports[_0xce17('0x1a')]=function(_0x39f40a){var _0xd1069=this;return new Promise(function(_0x5a50fd,_0x2ecf34){return db[_0xce17('0x1b')][_0xce17('0x1c')](_0x39f40a[_0xce17('0x1d')],{'raw':_0x39f40a['options']?_0x39f40a[_0xce17('0x1e')][_0xce17('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f40a[_0xce17('0x1e')]?_0x39f40a['options'][_0xce17('0x20')]||null:null,'attributes':_0x39f40a[_0xce17('0x1e')]?_0x39f40a[_0xce17('0x1e')][_0xce17('0x21')]||null:null,'limit':_0x39f40a[_0xce17('0x1e')]?_0x39f40a[_0xce17('0x1e')][_0xce17('0x22')]||null:null})[_0xce17('0x10')](function(_0x356792){logger[_0xce17('0x11')](_0xce17('0x1a'),_0x39f40a);logger[_0xce17('0x13')](_0xce17('0x1a'),_0x39f40a,JSON['stringify'](_0x356792));_0x5a50fd(_0x356792);})[_0xce17('0x23')](function(_0x36b617){logger[_0xce17('0x15')](_0xce17('0x1a'),_0x36b617[_0xce17('0x17')],_0x39f40a);_0x2ecf34(_0xd1069[_0xce17('0x15')](0x1f4,_0x36b617[_0xce17('0x17')]));});});};exports[_0xce17('0x24')]=function(_0x479688){return new Promise(function(_0x5db5a6,_0x26110e){return db[_0xce17('0x1b')]['find']({'where':_0x479688[_0xce17('0x1e')]?_0x479688['options'][_0xce17('0x20')]||null:null})['then'](function(_0x18dddd){if(_0x18dddd){return _0x18dddd[_0xce17('0x25')](_0x479688['body'][_0xce17('0x26')],_[_0xce17('0x27')](_0x479688['body'],['ids','id'])||{});}})['spread'](function(_0x4ecf85){logger[_0xce17('0x11')](_0xce17('0x28'),_0x479688);logger[_0xce17('0x13')](_0xce17('0x28'),_0x479688,JSON[_0xce17('0x14')](_0x4ecf85));_0x5db5a6(_0x4ecf85);})['catch'](function(_0x3205ec){logger[_0xce17('0x15')](_0xce17('0x28'),_0x3205ec['message'],_0x479688);_0x26110e(_this[_0xce17('0x15')](0x1f4,_0x3205ec[_0xce17('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 346d3ae..8e66233 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 _0xffbb=['register','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener'];(function(_0x472de9,_0x3fe492){var _0x105151=function(_0x11145e){while(--_0x11145e){_0x472de9['push'](_0x472de9['shift']());}};_0x105151(++_0x3fe492);}(_0xffbb,0x15a));var _0xbffb=function(_0x3eb95b,_0x244ade){_0x3eb95b=_0x3eb95b-0x0;var _0x4f11b2=_0xffbb[_0x3eb95b];return _0x4f11b2;};'use strict';var SmsInteractionEvents=require(_0xbffb('0x0'));var events=[_0xbffb('0x1'),_0xbffb('0x2'),_0xbffb('0x3')];function createListener(_0x150a16,_0x3aa2eb){return function(_0x11ccb2){_0x3aa2eb[_0xbffb('0x4')](_0x150a16,_0x11ccb2);};}function removeListener(_0x5b5bf2,_0x56c9a6){return function(){SmsInteractionEvents[_0xbffb('0x5')](_0x5b5bf2,_0x56c9a6);};}exports[_0xbffb('0x6')]=function(_0x203eb5){for(var _0x1df9b0=0x0,_0x40b6f6=events['length'];_0x1df9b0<_0x40b6f6;_0x1df9b0++){var _0x1bac9f=events[_0x1df9b0];var _0x447d4c=createListener(_0xbffb('0x7')+_0x1bac9f,_0x203eb5);SmsInteractionEvents['on'](_0x1bac9f,_0x447d4c);}}; \ No newline at end of file +var _0xf423=['save','remove','emit','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x13c1bd,_0x65e2b0){var _0x5094b4=function(_0x40e476){while(--_0x40e476){_0x13c1bd['push'](_0x13c1bd['shift']());}};_0x5094b4(++_0x65e2b0);}(_0xf423,0x1f0));var _0x3f42=function(_0x1e58fe,_0x3665ed){_0x1e58fe=_0x1e58fe-0x0;var _0x1521ea=_0xf423[_0x1e58fe];return _0x1521ea;};'use strict';var SmsInteractionEvents=require(_0x3f42('0x0'));var events=[_0x3f42('0x1'),_0x3f42('0x2'),'update'];function createListener(_0x3d1235,_0x404230){return function(_0x44799c){_0x404230[_0x3f42('0x3')](_0x3d1235,_0x44799c);};}function removeListener(_0x337725,_0x4f0b67){return function(){SmsInteractionEvents[_0x3f42('0x4')](_0x337725,_0x4f0b67);};}exports[_0x3f42('0x5')]=function(_0x299ced){for(var _0x16102e=0x0,_0xb17b2a=events['length'];_0x16102e<_0xb17b2a;_0x16102e++){var _0x20a4f8=events[_0x16102e];var _0x5a661a=createListener(_0x3f42('0x6')+_0x20a4f8,_0x299ced);SmsInteractionEvents['on'](_0x20a4f8,_0x5a661a);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ba08b11..0c190b0 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 _0x38d1=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','/:id/accept','accept','put','/:id/reject','reject','destroy','exports','multer'];(function(_0x475d4a,_0x5d3524){var _0x2ab27a=function(_0x2db427){while(--_0x2db427){_0x475d4a['push'](_0x475d4a['shift']());}};_0x2ab27a(++_0x5d3524);}(_0x38d1,0xf2));var _0x138d=function(_0x6edcdb,_0x39496c){_0x6edcdb=_0x6edcdb-0x0;var _0x39f6ed=_0x38d1[_0x6edcdb];return _0x39f6ed;};'use strict';var multer=require(_0x138d('0x0'));var util=require(_0x138d('0x1'));var path=require(_0x138d('0x2'));var timeout=require(_0x138d('0x3'));var express=require('express');var router=express[_0x138d('0x4')]();var fs_extra=require(_0x138d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x138d('0x6'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x138d('0x7')]);router[_0x138d('0x8')](_0x138d('0x9'),auth[_0x138d('0xa')](),controller[_0x138d('0xb')]);router[_0x138d('0x8')](_0x138d('0xc'),auth['isAuthenticated'](),controller[_0x138d('0xd')]);router['post']('/',auth[_0x138d('0xa')](),interaction[_0x138d('0xe')](_0x138d('0xf'),_0x138d('0x10')),controller[_0x138d('0x11')]);router[_0x138d('0x12')](_0x138d('0x13'),controller['status']);router['put'](_0x138d('0xc'),auth[_0x138d('0xa')](),controller['update']);router['put'](_0x138d('0x14'),auth[_0x138d('0xa')](),controller[_0x138d('0x15')]);router[_0x138d('0x16')](_0x138d('0x17'),auth['isAuthenticated'](),controller[_0x138d('0x18')]);router['delete'](_0x138d('0xc'),auth['isAuthenticated'](),controller[_0x138d('0x19')]);module[_0x138d('0x1a')]=router; \ No newline at end of file +var _0xb8a1=['index','/describe','describe','/:id','show','post','tracked','/:id/status','status','put','update','accept','reject','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x18bb53,_0x1aaa44){var _0x3b1df5=function(_0x9b2ba6){while(--_0x9b2ba6){_0x18bb53['push'](_0x18bb53['shift']());}};_0x3b1df5(++_0x1aaa44);}(_0xb8a1,0x12d));var _0x1b8a=function(_0x145a99,_0x3b77ee){_0x145a99=_0x145a99-0x0;var _0x5ed6cf=_0xb8a1[_0x145a99];return _0x5ed6cf;};'use strict';var multer=require(_0x1b8a('0x0'));var util=require(_0x1b8a('0x1'));var path=require('path');var timeout=require(_0x1b8a('0x2'));var express=require(_0x1b8a('0x3'));var router=express['Router']();var fs_extra=require(_0x1b8a('0x4'));var auth=require(_0x1b8a('0x5'));var interaction=require(_0x1b8a('0x6'));var config=require(_0x1b8a('0x7'));var controller=require(_0x1b8a('0x8'));router[_0x1b8a('0x9')]('/',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0xb')]);router[_0x1b8a('0x9')](_0x1b8a('0xc'),auth['isAuthenticated'](),controller[_0x1b8a('0xd')]);router[_0x1b8a('0x9')](_0x1b8a('0xe'),auth[_0x1b8a('0xa')](),controller[_0x1b8a('0xf')]);router[_0x1b8a('0x10')]('/',auth[_0x1b8a('0xa')](),interaction[_0x1b8a('0x11')]('sms','smsmessage:create'),controller['create']);router['post'](_0x1b8a('0x12'),controller[_0x1b8a('0x13')]);router[_0x1b8a('0x14')](_0x1b8a('0xe'),auth['isAuthenticated'](),controller[_0x1b8a('0x15')]);router[_0x1b8a('0x14')]('/:id/accept',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x16')]);router[_0x1b8a('0x14')]('/:id/reject',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x17')]);router['delete']('/:id',auth[_0x1b8a('0xa')](),controller[_0x1b8a('0x18')]);module[_0x1b8a('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 07772d2..3c8fd58 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 _0xb8b4=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0xe4cd9,_0x1f6ba9){var _0x1eaad6=function(_0x235025){while(--_0x235025){_0xe4cd9['push'](_0xe4cd9['shift']());}};_0x1eaad6(++_0x1f6ba9);}(_0xb8b4,0x9d));var _0x4b8b=function(_0x26fc49,_0x4f94a2){_0x26fc49=_0x26fc49-0x0;var _0x3d4d60=_0xb8b4[_0x26fc49];return _0x3d4d60;};'use strict';var Sequelize=require(_0x4b8b('0x0'));module[_0x4b8b('0x1')]={'body':{'type':Sequelize[_0x4b8b('0x2')](_0x4b8b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4b8b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b8b('0x5')]('in',_0x4b8b('0x6')),'defaultValue':_0x4b8b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4b8b('0x7')](0xbe)},'phone':{'type':Sequelize[_0x4b8b('0x7')]},'readAt':{'type':Sequelize[_0x4b8b('0x8')]},'secret':{'type':Sequelize[_0x4b8b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4b8b('0x7')]},'providerResponse':{'type':Sequelize[_0x4b8b('0x2')]}}; \ No newline at end of file +var _0xac95=['sequelize','exports','TEXT','medium','out','STRING','DATE'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xac95,0xa8));var _0x5ac9=function(_0x59e13b,_0x5aca2e){_0x59e13b=_0x59e13b-0x0;var _0x19742c=_0xac95[_0x59e13b];return _0x19742c;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'body':{'type':Sequelize[_0x5ac9('0x2')](_0x5ac9('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5ac9('0x4')),'defaultValue':_0x5ac9('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5ac9('0x5')]},'readAt':{'type':Sequelize[_0x5ac9('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5ac9('0x5')]},'providerResponse':{'type':Sequelize[_0x5ac9('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 4f09968..e8c496b 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 _0xf269=['findAll','show','include','create','body','find','params','describe','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','interaction','get','[SMSMESSAGE: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','manual','interface','channel','event','accept','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','SIP/%s','motionChannel','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','update','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','inspect','infobip','results','groupName','DELIVERED','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','destroy','end','stack','name','index','map','SmsMessage','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','options','includeAll'];(function(_0x206cb8,_0x52b4a2){var _0x250455=function(_0x5d1d23){while(--_0x5d1d23){_0x206cb8['push'](_0x206cb8['shift']());}};_0x250455(++_0x52b4a2);}(_0xf269,0xd2));var _0x9f26=function(_0x4db581,_0x4e492f){_0x4db581=_0x4db581-0x0;var _0xa7f427=_0xf269[_0x4db581];return _0xa7f427;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f26('0x0'));var zipdir=require(_0x9f26('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f26('0x2'));var moment=require(_0x9f26('0x3'));var BPromise=require(_0x9f26('0x4'));var Mustache=require('mustache');var util=require(_0x9f26('0x5'));var path=require('path');var sox=require(_0x9f26('0x6'));var csv=require(_0x9f26('0x7'));var ejs=require(_0x9f26('0x8'));var fs=require('fs');var fs_extra=require(_0x9f26('0x9'));var _=require(_0x9f26('0xa'));var squel=require(_0x9f26('0xb'));var crypto=require(_0x9f26('0xc'));var jsforce=require(_0x9f26('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f26('0xe'));var Redis=require(_0x9f26('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9f26('0x10'));var hardwareService=require(_0x9f26('0x11'));var logger=require(_0x9f26('0x12'))(_0x9f26('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f26('0x14'))['db'];config[_0x9f26('0x15')]=_['defaults'](config[_0x9f26('0x15')],{'host':_0x9f26('0x16'),'port':0x18eb});var socket=require(_0x9f26('0x17'))(new Redis(config[_0x9f26('0x15')]));require(_0x9f26('0x18'))['register'](socket);var jayson=require(_0x9f26('0x19'));var client=jayson[_0x9f26('0x1a')][_0x9f26('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x9f26('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x71944f,_0x212c4e,_0x382bfe,_0x1208e0){return new BPromise(function(_0x542567,_0x3ec83e){var _0x25c021=_0x1208e0||client;return _0x25c021[_0x9f26('0x1c')](_0x71944f,_0x382bfe)[_0x9f26('0x1d')](function(_0xb0d8e5){logger[_0x9f26('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x212c4e,'request\x20sent');logger[_0x9f26('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x212c4e,_0x9f26('0x20'),JSON[_0x9f26('0x21')](_0xb0d8e5));if(_0xb0d8e5[_0x9f26('0x22')]){if(_0xb0d8e5[_0x9f26('0x22')][_0x9f26('0x23')]===0x1f4){logger[_0x9f26('0x22')](_0x9f26('0x24'),_0x212c4e,_0xb0d8e5['error'][_0x9f26('0x25')]);return _0x3ec83e(_0xb0d8e5[_0x9f26('0x22')][_0x9f26('0x25')]);}logger[_0x9f26('0x22')](_0x9f26('0x24'),_0x212c4e,_0xb0d8e5[_0x9f26('0x22')][_0x9f26('0x25')]);return _0x542567(_0xb0d8e5[_0x9f26('0x22')][_0x9f26('0x25')]);}else{logger[_0x9f26('0x1e')](_0x9f26('0x24'),_0x212c4e,_0x9f26('0x20'));_0x542567(_0xb0d8e5['result'][_0x9f26('0x25')]);}})[_0x9f26('0x26')](function(_0x6da052){logger[_0x9f26('0x22')](_0x9f26('0x24'),_0x212c4e,_0x6da052);_0x3ec83e(_0x6da052);});});}function respondWithStatusCode(_0x1b972c,_0x4ee987){_0x4ee987=_0x4ee987||0xcc;return function(_0x401bd3){if(_0x401bd3){return _0x1b972c[_0x9f26('0x27')](_0x4ee987);}return _0x1b972c['status'](_0x4ee987)['end']();};}function respondWithResult(_0x100fb5,_0x53f00d){_0x53f00d=_0x53f00d||0xc8;return function(_0x308026){if(_0x308026){return _0x100fb5['status'](_0x53f00d)[_0x9f26('0x28')](_0x308026);}};}function respondWithFilteredResult(_0x25168b,_0x4728f2){return function(_0x32b59c){if(_0x32b59c){var _0xa49ce6=typeof _0x4728f2[_0x9f26('0x29')]===_0x9f26('0x2a')&&typeof _0x4728f2[_0x9f26('0x2b')]===_0x9f26('0x2a');var _0x2ad80b=_0x32b59c[_0x9f26('0x2c')];var _0x3844ab=_0xa49ce6?0x0:_0x4728f2[_0x9f26('0x29')];var _0x24fcec=_0xa49ce6?_0x32b59c[_0x9f26('0x2c')]:_0x4728f2[_0x9f26('0x29')]+_0x4728f2[_0x9f26('0x2b')];var _0x40a469;if(_0x24fcec>=_0x2ad80b){_0x24fcec=_0x2ad80b;_0x40a469=0xc8;}else{_0x40a469=0xce;}_0x25168b[_0x9f26('0x2d')](_0x40a469);return _0x25168b[_0x9f26('0x2e')](_0x9f26('0x2f'),_0x3844ab+'-'+_0x24fcec+'/'+_0x2ad80b)[_0x9f26('0x28')](_0x32b59c);}return null;};}function patchUpdates(_0x42b778){return function(_0x3324fa){try{jsonpatch['apply'](_0x3324fa,_0x42b778,!![]);}catch(_0x982915){return BPromise[_0x9f26('0x30')](_0x982915);}return _0x3324fa[_0x9f26('0x31')]();};}function saveUpdates(_0x37fc6b,_0x36039d){return function(_0x4250fc){if(_0x4250fc){return _0x4250fc['update'](_0x37fc6b)['then'](function(_0x58712c){return _0x58712c;});}return null;};}function removeEntity(_0xfd6a30,_0x39282e){return function(_0x5492f5){if(_0x5492f5){return _0x5492f5[_0x9f26('0x32')]()[_0x9f26('0x1d')](function(){_0xfd6a30[_0x9f26('0x2d')](0xcc)[_0x9f26('0x33')]();});}};}function handleEntityNotFound(_0x1d62fb,_0x10a08c){return function(_0x58037f){if(!_0x58037f){_0x1d62fb[_0x9f26('0x27')](0x194);}return _0x58037f;};}function handleError(_0x2680ff,_0x4bd7b0){_0x4bd7b0=_0x4bd7b0||0x1f4;return function(_0x253f1f){logger['error'](_0x253f1f[_0x9f26('0x34')]);if(_0x253f1f[_0x9f26('0x35')]){delete _0x253f1f[_0x9f26('0x35')];}_0x2680ff[_0x9f26('0x2d')](_0x4bd7b0)['send'](_0x253f1f);};}exports[_0x9f26('0x36')]=function(_0x328eb6,_0x299012){var _0x4f4447={},_0x430cc6={},_0x102432={'count':0x0,'rows':[]};var _0x2d3a20=_[_0x9f26('0x37')](db[_0x9f26('0x38')][_0x9f26('0x39')],function(_0x4a241d){return{'name':_0x4a241d[_0x9f26('0x3a')],'type':_0x4a241d['type'][_0x9f26('0x3b')]};});_0x430cc6[_0x9f26('0x3c')]=_['map'](_0x2d3a20,_0x9f26('0x35'));_0x430cc6['query']=_[_0x9f26('0x3d')](_0x328eb6['query']);_0x430cc6[_0x9f26('0x3e')]=_['intersection'](_0x430cc6[_0x9f26('0x3c')],_0x430cc6[_0x9f26('0x3f')]);_0x4f4447[_0x9f26('0x40')]=_[_0x9f26('0x41')](_0x430cc6[_0x9f26('0x3c')],qs['fields'](_0x328eb6[_0x9f26('0x3f')][_0x9f26('0x42')]));_0x4f4447['attributes']=_0x4f4447['attributes'][_0x9f26('0x43')]?_0x4f4447[_0x9f26('0x40')]:_0x430cc6[_0x9f26('0x3c')];if(!_0x328eb6[_0x9f26('0x3f')]['hasOwnProperty'](_0x9f26('0x44'))){_0x4f4447[_0x9f26('0x2b')]=qs[_0x9f26('0x2b')](_0x328eb6[_0x9f26('0x3f')]['limit']);_0x4f4447[_0x9f26('0x29')]=qs['offset'](_0x328eb6['query']['offset']);}_0x4f4447['order']=qs[_0x9f26('0x45')](_0x328eb6[_0x9f26('0x3f')][_0x9f26('0x45')]);_0x4f4447['where']=qs['filters'](_[_0x9f26('0x46')](_0x328eb6['query'],_0x430cc6['filters']),_0x2d3a20);if(_0x328eb6['query'][_0x9f26('0x47')]){_0x4f4447[_0x9f26('0x48')]=_[_0x9f26('0x49')](_0x4f4447[_0x9f26('0x48')],{'$or':_[_0x9f26('0x37')](_0x2d3a20,function(_0x447b48){if(_0x447b48['type']!=='VIRTUAL'){var _0x7a7b03={};_0x7a7b03[_0x447b48[_0x9f26('0x35')]]={'$like':'%'+_0x328eb6[_0x9f26('0x3f')][_0x9f26('0x47')]+'%'};return _0x7a7b03;}})});}_0x4f4447=_['merge']({},_0x4f4447,_0x328eb6[_0x9f26('0x4a')]);var _0x1fafc6={'where':_0x4f4447['where']};return db['SmsMessage'][_0x9f26('0x2c')](_0x1fafc6)[_0x9f26('0x1d')](function(_0x2ede08){_0x102432[_0x9f26('0x2c')]=_0x2ede08;if(_0x328eb6[_0x9f26('0x3f')][_0x9f26('0x4b')]){_0x4f4447['include']=[{'all':!![]}];}return db[_0x9f26('0x38')][_0x9f26('0x4c')](_0x4f4447);})[_0x9f26('0x1d')](function(_0x4f9f54){_0x102432['rows']=_0x4f9f54;return _0x102432;})[_0x9f26('0x1d')](respondWithFilteredResult(_0x299012,_0x4f4447))[_0x9f26('0x26')](handleError(_0x299012,null));};exports[_0x9f26('0x4d')]=function(_0x2b2089,_0x327a48){var _0x5cb532={'raw':!![],'where':{'id':_0x2b2089['params']['id']}},_0x13228a={};_0x13228a[_0x9f26('0x3c')]=_['keys'](db[_0x9f26('0x38')][_0x9f26('0x39')]);_0x13228a[_0x9f26('0x3f')]=_[_0x9f26('0x3d')](_0x2b2089[_0x9f26('0x3f')]);_0x13228a[_0x9f26('0x3e')]=_[_0x9f26('0x41')](_0x13228a[_0x9f26('0x3c')],_0x13228a[_0x9f26('0x3f')]);_0x5cb532[_0x9f26('0x40')]=_['intersection'](_0x13228a[_0x9f26('0x3c')],qs[_0x9f26('0x42')](_0x2b2089[_0x9f26('0x3f')][_0x9f26('0x42')]));_0x5cb532[_0x9f26('0x40')]=_0x5cb532[_0x9f26('0x40')]['length']?_0x5cb532[_0x9f26('0x40')]:_0x13228a[_0x9f26('0x3c')];if(_0x2b2089[_0x9f26('0x3f')][_0x9f26('0x4b')]){_0x5cb532[_0x9f26('0x4e')]=[{'all':!![]}];}_0x5cb532=_[_0x9f26('0x49')]({},_0x5cb532,_0x2b2089[_0x9f26('0x4a')]);return db[_0x9f26('0x38')]['find'](_0x5cb532)[_0x9f26('0x1d')](handleEntityNotFound(_0x327a48,null))[_0x9f26('0x1d')](respondWithResult(_0x327a48,null))['catch'](handleError(_0x327a48,null));};exports[_0x9f26('0x4f')]=function(_0x5f1cee,_0x6adc4a){return db['SmsMessage'][_0x9f26('0x4f')](_0x5f1cee[_0x9f26('0x50')],{})[_0x9f26('0x1d')](respondWithResult(_0x6adc4a,0xc9))[_0x9f26('0x26')](handleError(_0x6adc4a,null));};exports['update']=function(_0x4e0011,_0x32b0fe){if(_0x4e0011[_0x9f26('0x50')]['id']){delete _0x4e0011['body']['id'];}return db[_0x9f26('0x38')][_0x9f26('0x51')]({'where':{'id':_0x4e0011[_0x9f26('0x52')]['id']}})[_0x9f26('0x1d')](handleEntityNotFound(_0x32b0fe,null))[_0x9f26('0x1d')](saveUpdates(_0x4e0011['body'],null))[_0x9f26('0x1d')](respondWithResult(_0x32b0fe,null))[_0x9f26('0x26')](handleError(_0x32b0fe,null));};exports[_0x9f26('0x32')]=function(_0xec9b00,_0x6889b0){return db[_0x9f26('0x38')]['find']({'where':{'id':_0xec9b00[_0x9f26('0x52')]['id']}})[_0x9f26('0x1d')](handleEntityNotFound(_0x6889b0,null))[_0x9f26('0x1d')](removeEntity(_0x6889b0,null))[_0x9f26('0x26')](handleError(_0x6889b0,null));};exports['describe']=function(_0x3a1129,_0x2831b6){return db[_0x9f26('0x38')][_0x9f26('0x53')]()['then'](respondWithResult(_0x2831b6,null))['catch'](handleError(_0x2831b6,null));};var interaction_log=require(_0x9f26('0x12'))(_0x9f26('0x54'));exports['accept']=function(_0x223f2d,_0x35612b,_0x2a1b3e){var _0x814e0d={'agent':{},'channel':_0x9f26('0x55')};if(_0x223f2d['body']['id']){delete _0x223f2d[_0x9f26('0x50')]['id'];}_0x223f2d[_0x9f26('0x50')][_0x9f26('0x56')]=!![];_0x223f2d['body']['readAt']=moment()[_0x9f26('0x57')](_0x9f26('0x58'));_0x223f2d[_0x9f26('0x50')][_0x9f26('0x59')]=_0x223f2d['body'][_0x9f26('0x59')]||_0x223f2d[_0x9f26('0x5a')]['id'];_0x814e0d[_0x9f26('0x5b')]['id']=_0x223f2d[_0x9f26('0x50')][_0x9f26('0x59')];return db[_0x9f26('0x38')][_0x9f26('0x51')]({'where':{'id':_0x223f2d[_0x9f26('0x52')]['id'],'UserId':null}})[_0x9f26('0x1d')](handleEntityNotFound(_0x35612b,null))[_0x9f26('0x1d')](saveUpdates(_0x223f2d[_0x9f26('0x50')],null))[_0x9f26('0x1d')](function(_0x41b63){if(_0x41b63){_0x814e0d[_0x9f26('0x25')]=_0x41b63['get']({'plain':!![]});return db[_0x9f26('0x5c')][_0x9f26('0x51')]({'where':{'id':_0x41b63[_0x9f26('0x5d')]}});}return null;})[_0x9f26('0x1d')](handleEntityNotFound(_0x35612b,null))[_0x9f26('0x1d')](function(_0x2235ee){if(_0x2235ee){return _0x2235ee['update']({'UserId':_0x223f2d['body'][_0x9f26('0x59')],'read1stAt':_['isNil'](_0x2235ee[_0x9f26('0x5e')])?moment()[_0x9f26('0x57')](_0x9f26('0x58')):undefined});}return null;})['then'](function(_0x2bb161){if(_0x2bb161){_0x814e0d[_0x9f26('0x5f')]=_0x2bb161[_0x9f26('0x60')]({'plain':!![]});interaction_log['info'](_0x9f26('0x61'),_0x223f2d[_0x9f26('0x5a')]['id'],_0x223f2d[_0x9f26('0x5a')][_0x9f26('0x35')],_0x223f2d[_0x9f26('0x5a')][_0x9f26('0x62')],_0x814e0d['interaction']['id'],_0x223f2d[_0x9f26('0x50')]?JSON['stringify'](_0x223f2d['body']):_0x9f26('0x63'));return respondWithRpcPromise(_0x9f26('0x64'),_0x9f26('0x65'),_0x814e0d);}return null;})['then'](function(_0x17a210){var _0x14d0e3=_0x9f26('0x66')+_0x17a210[_0x9f26('0x25')][_0x9f26('0x67')];return db[_0x9f26('0x68')][_0x9f26('0x3f')](_0x14d0e3,{'type':db[_0x9f26('0x69')][_0x9f26('0x6a')][_0x9f26('0x6b')],'raw':!![]})['then'](function(_0x5b043b){return _0x5b043b;});})[_0x9f26('0x1d')](function(_0x189c60){if(_0x189c60){_0x814e0d[_0x9f26('0x25')][_0x9f26('0x6c')]=_0x189c60[0x0];if(!_0x223f2d[_0x9f26('0x50')]['UserId'])return;return db[_0x9f26('0x6d')][_0x9f26('0x51')]({'where':{'id':_0x223f2d[_0x9f26('0x50')]['UserId'],'role':_0x9f26('0x5b')},'attributes':['id','name',_0x9f26('0x6e'),_0x9f26('0x6f'),'internal'],'raw':!![]});}return null;})[_0x9f26('0x1d')](function(_0x30a4a4){if(!_0x30a4a4)return null;_0x814e0d['message'][_0x9f26('0x5b')]=_0x30a4a4;return _0x814e0d;})[_0x9f26('0x1d')](function(_0x1612c1){if(_0x1612c1){if(_0x223f2d['body'][_0x9f26('0x70')]){_0x814e0d[_0x9f26('0x25')][_0x9f26('0x71')]=util[_0x9f26('0x57')]('SIP/%s',_0x223f2d[_0x9f26('0x5a')][_0x9f26('0x35')]);_0x814e0d[_0x9f26('0x25')]['channel']=_0x814e0d[_0x9f26('0x72')];_0x814e0d['message']['motionChannel']=_0x814e0d[_0x9f26('0x72')];_0x814e0d['message'][_0x9f26('0x73')]=_0x9f26('0x74');return respondWithRpcPromise(_0x9f26('0x75'),'EventManager',{'event':'acceptmessage','message':_0x814e0d['message']},client9002)[_0x9f26('0x1d')](function(){return _0x814e0d;});}return _0x814e0d;}return null;})['then'](respondWithResult(_0x35612b,null))[_0x9f26('0x26')](handleError(_0x35612b,null));};var interaction_log=require(_0x9f26('0x12'))(_0x9f26('0x54'));exports['reject']=function(_0x5c8bf7,_0x30ea5e,_0x1a6623){var _0x86d6b6={'agent':{},'channel':'sms'};if(_0x5c8bf7[_0x9f26('0x50')]['id']){delete _0x5c8bf7['body']['id'];}_0x5c8bf7[_0x9f26('0x50')][_0x9f26('0x59')]=_0x5c8bf7[_0x9f26('0x50')]['UserId']||_0x5c8bf7[_0x9f26('0x5a')]['id'];_0x86d6b6[_0x9f26('0x5b')]['id']=_0x5c8bf7['body']['UserId'];return db[_0x9f26('0x38')][_0x9f26('0x51')]({'where':{'id':_0x5c8bf7['params']['id'],'UserId':null}})[_0x9f26('0x1d')](handleEntityNotFound(_0x30ea5e,null))['then'](function(_0x33b211){if(_0x33b211){_0x86d6b6[_0x9f26('0x25')]=_0x33b211['get']({'plain':!![]});return db[_0x9f26('0x5c')][_0x9f26('0x51')]({'where':{'id':_0x33b211[_0x9f26('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x30ea5e,null))[_0x9f26('0x1d')](function(_0x4dac83){if(_0x4dac83){_0x86d6b6[_0x9f26('0x5f')]=_0x4dac83[_0x9f26('0x60')]({'plain':!![]});interaction_log[_0x9f26('0x1e')](_0x9f26('0x76'),_0x5c8bf7[_0x9f26('0x5a')]['id'],_0x5c8bf7['user'][_0x9f26('0x35')],_0x5c8bf7[_0x9f26('0x5a')][_0x9f26('0x62')],_0x86d6b6[_0x9f26('0x5f')]['id'],_0x5c8bf7[_0x9f26('0x50')]?JSON['stringify'](_0x5c8bf7[_0x9f26('0x50')]):_0x9f26('0x63'));return respondWithRpcPromise(_0x9f26('0x77'),'rejectMessage',_0x86d6b6);}return null;})[_0x9f26('0x1d')](function(_0x1c0ac4){var _0x16f262=_0x9f26('0x66')+_0x1c0ac4[_0x9f26('0x25')][_0x9f26('0x67')];return db['sequelize'][_0x9f26('0x3f')](_0x16f262,{'type':db['Sequelize'][_0x9f26('0x6a')][_0x9f26('0x6b')],'raw':!![]})[_0x9f26('0x1d')](function(_0x150e4f){return _0x150e4f;});})[_0x9f26('0x1d')](function(_0x31e0b8){if(_0x31e0b8){_0x86d6b6[_0x9f26('0x25')][_0x9f26('0x6c')]=_0x31e0b8[0x0];if(!_0x5c8bf7[_0x9f26('0x50')][_0x9f26('0x59')])return;return db[_0x9f26('0x6d')]['find']({'where':{'id':_0x5c8bf7['body'][_0x9f26('0x59')],'role':_0x9f26('0x5b')},'attributes':['id',_0x9f26('0x35'),'fullname','email',_0x9f26('0x78')],'raw':!![]});}return null;})[_0x9f26('0x1d')](function(_0xe5f90){if(!_0xe5f90)return null;_0x86d6b6['message'][_0x9f26('0x5b')]=_0xe5f90;return _0x86d6b6;})['then'](function(_0x249041){if(_0x249041){_0x249041['message'][_0x9f26('0x71')]=util[_0x9f26('0x57')](_0x9f26('0x79'),_0x5c8bf7[_0x9f26('0x5a')][_0x9f26('0x35')]);_0x249041[_0x9f26('0x25')]['channel']=_0x86d6b6[_0x9f26('0x72')];_0x249041[_0x9f26('0x25')][_0x9f26('0x7a')]=_0x86d6b6['channel'];_0x249041[_0x9f26('0x25')][_0x9f26('0x73')]=_0x9f26('0x30');respondWithRpcPromise('EventManager',_0x9f26('0x75'),{'event':_0x9f26('0x7b'),'message':_0x249041[_0x9f26('0x25')]},client9002);return _0x86d6b6;}return null;})['then'](respondWithResult(_0x30ea5e,null))[_0x9f26('0x26')](handleError(_0x30ea5e,null));};exports[_0x9f26('0x2d')]=function(_0x362da3,_0x5b6383,_0x5733d6){if(_0x362da3['body']['id']){delete _0x362da3['body']['id'];}var _0x385e5e;return db[_0x9f26('0x38')][_0x9f26('0x51')]({'where':{'id':_0x362da3[_0x9f26('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b6383,null))[_0x9f26('0x1d')](function(_0x303053){if(_0x303053){_0x385e5e=_0x303053;return db['SmsAccount'][_0x9f26('0x51')]({'where':{'id':_0x303053[_0x9f26('0x7c')]}});}})[_0x9f26('0x1d')](handleEntityNotFound(_0x5b6383,null))[_0x9f26('0x1d')](function(_0x3bee9f){if(_0x3bee9f){logger[_0x9f26('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9f26('0x2d'),_0x9f26('0x7d'),_0x3bee9f[_0x9f26('0x7e')],util['inspect'](_0x362da3[_0x9f26('0x50')],{'showHidden':![],'depth':null}));switch(_0x3bee9f['type']){case _0x9f26('0x7f'):if(_0x362da3['body'][_0x9f26('0x80')]&&_0x362da3[_0x9f26('0x50')][_0x9f26('0x80')]===_0x385e5e[_0x9f26('0x81')]){return _0x385e5e[_0x9f26('0x82')]({'read':!![]});}else{logger[_0x9f26('0x22')](_0x9f26('0x83'),_0x9f26('0x2d'),'twilio',util['inspect'](_0x362da3[_0x9f26('0x50')],{'showHidden':![],'depth':null}));}break;case _0x9f26('0x84'):if(_0x362da3['body'][_0x9f26('0x85')]&&_0x362da3[_0x9f26('0x50')][_0x9f26('0x85')]===_0x385e5e[_0x9f26('0x81')]&&_[_0x9f26('0x86')]([_0x9f26('0x87'),_0x9f26('0x88')],_0x362da3[_0x9f26('0x50')]['Status'])>=0x0){return _0x385e5e['update']({'read':!![]});}else{logger[_0x9f26('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x9f26('0x89'),util[_0x9f26('0x8a')](_0x362da3[_0x9f26('0x50')],{'showHidden':![],'depth':null}));}break;case _0x9f26('0x8b'):var _0xdff1ad=_0x362da3['body'][_0x9f26('0x8c')][0x0];if(_0xdff1ad['status'][_0x9f26('0x8d')]===_0x9f26('0x8e')){return _0x385e5e[_0x9f26('0x82')]({'read':!![]});}else{logger[_0x9f26('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9f26('0x2d'),_0x9f26('0x8b'),util['inspect'](_0x362da3['body'],{'showHidden':![],'depth':null}));}break;}return _0x385e5e;}})[_0x9f26('0x1d')](respondWithResult(_0x5b6383,null))[_0x9f26('0x26')](handleError(_0x5b6383,null));}; \ No newline at end of file +var _0xc692=['read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','format','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','inspect','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','include','rows','show','params','keys','find','create','body','accept','sms'];(function(_0x2479b3,_0x2a30f6){var _0x57e011=function(_0x11bcdf){while(--_0x11bcdf){_0x2479b3['push'](_0x2479b3['shift']());}};_0x57e011(++_0x2a30f6);}(_0xc692,0x15f));var _0x2c69=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc692[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x2c69('0x0'));var rimraf=require(_0x2c69('0x1'));var zipdir=require(_0x2c69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c69('0x3'));var BPromise=require(_0x2c69('0x4'));var Mustache=require(_0x2c69('0x5'));var util=require(_0x2c69('0x6'));var path=require(_0x2c69('0x7'));var sox=require(_0x2c69('0x8'));var csv=require(_0x2c69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c69('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c69('0xb'));var jsforce=require(_0x2c69('0xc'));var deskjs=require(_0x2c69('0xd'));var toCsv=require(_0x2c69('0x9'));var querystring=require(_0x2c69('0xe'));var Papa=require(_0x2c69('0xf'));var Redis=require('ioredis');var authService=require(_0x2c69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2c69('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c69('0x12'))(_0x2c69('0x13'));var utils=require(_0x2c69('0x14'));var config=require(_0x2c69('0x15'));var licenseUtil=require(_0x2c69('0x16'));var db=require(_0x2c69('0x17'))['db'];config['redis']=_[_0x2c69('0x18')](config['redis'],{'host':_0x2c69('0x19'),'port':0x18eb});var socket=require(_0x2c69('0x1a'))(new Redis(config[_0x2c69('0x1b')]));require(_0x2c69('0x1c'))[_0x2c69('0x1d')](socket);var jayson=require(_0x2c69('0x1e'));var client=jayson['client'][_0x2c69('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9bdd,_0x4cabe5,_0x11649b,_0x5f5bd5){return new BPromise(function(_0x59e48a,_0x5bb8ee){var _0x3bd4a3=_0x5f5bd5||client;return _0x3bd4a3[_0x2c69('0x20')](_0x2b9bdd,_0x11649b)[_0x2c69('0x21')](function(_0x5b4ca0){logger['info'](_0x2c69('0x22'),_0x4cabe5,_0x2c69('0x23'));logger[_0x2c69('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cabe5,_0x2c69('0x23'),JSON['stringify'](_0x5b4ca0));if(_0x5b4ca0[_0x2c69('0x25')]){if(_0x5b4ca0[_0x2c69('0x25')][_0x2c69('0x26')]===0x1f4){logger[_0x2c69('0x25')]('SmsMessage,\x20%s,\x20%s',_0x4cabe5,_0x5b4ca0[_0x2c69('0x25')][_0x2c69('0x27')]);return _0x5bb8ee(_0x5b4ca0[_0x2c69('0x25')]['message']);}logger[_0x2c69('0x25')]('SmsMessage,\x20%s,\x20%s',_0x4cabe5,_0x5b4ca0['error'][_0x2c69('0x27')]);return _0x59e48a(_0x5b4ca0[_0x2c69('0x25')][_0x2c69('0x27')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x4cabe5,_0x2c69('0x23'));_0x59e48a(_0x5b4ca0[_0x2c69('0x28')][_0x2c69('0x27')]);}})[_0x2c69('0x29')](function(_0x12dbca){logger[_0x2c69('0x25')](_0x2c69('0x22'),_0x4cabe5,_0x12dbca);_0x5bb8ee(_0x12dbca);});});}function respondWithStatusCode(_0x2a0569,_0x461784){_0x461784=_0x461784||0xcc;return function(_0x51a470){if(_0x51a470){return _0x2a0569[_0x2c69('0x2a')](_0x461784);}return _0x2a0569[_0x2c69('0x2b')](_0x461784)['end']();};}function respondWithResult(_0x1b29b8,_0xd85b20){_0xd85b20=_0xd85b20||0xc8;return function(_0x2238a9){if(_0x2238a9){return _0x1b29b8['status'](_0xd85b20)[_0x2c69('0x2c')](_0x2238a9);}};}function respondWithFilteredResult(_0xfe88bf,_0x4fa8eb){return function(_0x2ae236){if(_0x2ae236){var _0x3d6e87=typeof _0x4fa8eb[_0x2c69('0x2d')]===_0x2c69('0x2e')&&typeof _0x4fa8eb['limit']===_0x2c69('0x2e');var _0x77babf=_0x2ae236['count'];var _0x5c56a9=_0x3d6e87?0x0:_0x4fa8eb['offset'];var _0x41d912=_0x3d6e87?_0x2ae236['count']:_0x4fa8eb['offset']+_0x4fa8eb[_0x2c69('0x2f')];var _0x21f0bf;if(_0x41d912>=_0x77babf){_0x41d912=_0x77babf;_0x21f0bf=0xc8;}else{_0x21f0bf=0xce;}_0xfe88bf[_0x2c69('0x2b')](_0x21f0bf);return _0xfe88bf[_0x2c69('0x30')](_0x2c69('0x31'),_0x5c56a9+'-'+_0x41d912+'/'+_0x77babf)['json'](_0x2ae236);}return null;};}function patchUpdates(_0x302d3e){return function(_0xe0295c){try{jsonpatch[_0x2c69('0x32')](_0xe0295c,_0x302d3e,!![]);}catch(_0x402241){return BPromise['reject'](_0x402241);}return _0xe0295c[_0x2c69('0x33')]();};}function saveUpdates(_0xb27d5c,_0x4e276a){return function(_0x3ed129){if(_0x3ed129){return _0x3ed129[_0x2c69('0x34')](_0xb27d5c)['then'](function(_0x12570f){return _0x12570f;});}return null;};}function removeEntity(_0x43d084,_0x285584){return function(_0x1bbd99){if(_0x1bbd99){return _0x1bbd99[_0x2c69('0x35')]()[_0x2c69('0x21')](function(){_0x43d084['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fbf98,_0x11472b){return function(_0xa9d150){if(!_0xa9d150){_0x3fbf98['sendStatus'](0x194);}return _0xa9d150;};}function handleError(_0x43d1a0,_0xe24085){_0xe24085=_0xe24085||0x1f4;return function(_0x387d02){logger['error'](_0x387d02[_0x2c69('0x36')]);if(_0x387d02[_0x2c69('0x37')]){delete _0x387d02[_0x2c69('0x37')];}_0x43d1a0[_0x2c69('0x2b')](_0xe24085)[_0x2c69('0x38')](_0x387d02);};}exports['index']=function(_0x45cca4,_0x229def){var _0x2f3e17={},_0x4452c3={},_0x2fdf72={'count':0x0,'rows':[]};var _0x569989=_[_0x2c69('0x39')](db[_0x2c69('0x3a')][_0x2c69('0x3b')],function(_0xb14e44){return{'name':_0xb14e44[_0x2c69('0x3c')],'type':_0xb14e44[_0x2c69('0x3d')][_0x2c69('0x3e')]};});_0x4452c3[_0x2c69('0x3f')]=_['map'](_0x569989,_0x2c69('0x37'));_0x4452c3['query']=_['keys'](_0x45cca4['query']);_0x4452c3[_0x2c69('0x40')]=_[_0x2c69('0x41')](_0x4452c3['model'],_0x4452c3[_0x2c69('0x42')]);_0x2f3e17[_0x2c69('0x43')]=_[_0x2c69('0x41')](_0x4452c3['model'],qs['fields'](_0x45cca4[_0x2c69('0x42')][_0x2c69('0x44')]));_0x2f3e17['attributes']=_0x2f3e17['attributes'][_0x2c69('0x45')]?_0x2f3e17[_0x2c69('0x43')]:_0x4452c3[_0x2c69('0x3f')];if(!_0x45cca4['query'][_0x2c69('0x46')](_0x2c69('0x47'))){_0x2f3e17[_0x2c69('0x2f')]=qs['limit'](_0x45cca4[_0x2c69('0x42')][_0x2c69('0x2f')]);_0x2f3e17['offset']=qs[_0x2c69('0x2d')](_0x45cca4[_0x2c69('0x42')][_0x2c69('0x2d')]);}_0x2f3e17['order']=qs[_0x2c69('0x48')](_0x45cca4['query'][_0x2c69('0x48')]);_0x2f3e17['where']=qs[_0x2c69('0x40')](_[_0x2c69('0x49')](_0x45cca4['query'],_0x4452c3[_0x2c69('0x40')]),_0x569989);if(_0x45cca4[_0x2c69('0x42')][_0x2c69('0x4a')]){_0x2f3e17[_0x2c69('0x4b')]=_[_0x2c69('0x4c')](_0x2f3e17[_0x2c69('0x4b')],{'$or':_['map'](_0x569989,function(_0x33e848){if(_0x33e848['type']!==_0x2c69('0x4d')){var _0x3598dc={};_0x3598dc[_0x33e848[_0x2c69('0x37')]]={'$like':'%'+_0x45cca4[_0x2c69('0x42')]['filter']+'%'};return _0x3598dc;}})});}_0x2f3e17=_[_0x2c69('0x4c')]({},_0x2f3e17,_0x45cca4[_0x2c69('0x4e')]);var _0x4a7eed={'where':_0x2f3e17['where']};return db[_0x2c69('0x3a')][_0x2c69('0x4f')](_0x4a7eed)[_0x2c69('0x21')](function(_0x44e333){_0x2fdf72[_0x2c69('0x4f')]=_0x44e333;if(_0x45cca4['query']['includeAll']){_0x2f3e17[_0x2c69('0x50')]=[{'all':!![]}];}return db[_0x2c69('0x3a')]['findAll'](_0x2f3e17);})[_0x2c69('0x21')](function(_0x1b8ff2){_0x2fdf72[_0x2c69('0x51')]=_0x1b8ff2;return _0x2fdf72;})[_0x2c69('0x21')](respondWithFilteredResult(_0x229def,_0x2f3e17))[_0x2c69('0x29')](handleError(_0x229def,null));};exports[_0x2c69('0x52')]=function(_0x3ca9ff,_0x114beb){var _0x97c019={'raw':!![],'where':{'id':_0x3ca9ff[_0x2c69('0x53')]['id']}},_0x465e45={};_0x465e45[_0x2c69('0x3f')]=_[_0x2c69('0x54')](db[_0x2c69('0x3a')][_0x2c69('0x3b')]);_0x465e45['query']=_[_0x2c69('0x54')](_0x3ca9ff[_0x2c69('0x42')]);_0x465e45['filters']=_[_0x2c69('0x41')](_0x465e45['model'],_0x465e45[_0x2c69('0x42')]);_0x97c019[_0x2c69('0x43')]=_['intersection'](_0x465e45[_0x2c69('0x3f')],qs[_0x2c69('0x44')](_0x3ca9ff[_0x2c69('0x42')][_0x2c69('0x44')]));_0x97c019[_0x2c69('0x43')]=_0x97c019[_0x2c69('0x43')][_0x2c69('0x45')]?_0x97c019[_0x2c69('0x43')]:_0x465e45[_0x2c69('0x3f')];if(_0x3ca9ff[_0x2c69('0x42')]['includeAll']){_0x97c019[_0x2c69('0x50')]=[{'all':!![]}];}_0x97c019=_[_0x2c69('0x4c')]({},_0x97c019,_0x3ca9ff[_0x2c69('0x4e')]);return db[_0x2c69('0x3a')][_0x2c69('0x55')](_0x97c019)[_0x2c69('0x21')](handleEntityNotFound(_0x114beb,null))[_0x2c69('0x21')](respondWithResult(_0x114beb,null))['catch'](handleError(_0x114beb,null));};exports[_0x2c69('0x56')]=function(_0x3e8444,_0x503423){return db['SmsMessage']['create'](_0x3e8444[_0x2c69('0x57')],{})[_0x2c69('0x21')](respondWithResult(_0x503423,0xc9))[_0x2c69('0x29')](handleError(_0x503423,null));};exports['update']=function(_0x5eadf4,_0x2c0f27){if(_0x5eadf4['body']['id']){delete _0x5eadf4[_0x2c69('0x57')]['id'];}return db[_0x2c69('0x3a')][_0x2c69('0x55')]({'where':{'id':_0x5eadf4[_0x2c69('0x53')]['id']}})[_0x2c69('0x21')](handleEntityNotFound(_0x2c0f27,null))[_0x2c69('0x21')](saveUpdates(_0x5eadf4[_0x2c69('0x57')],null))[_0x2c69('0x21')](respondWithResult(_0x2c0f27,null))['catch'](handleError(_0x2c0f27,null));};exports[_0x2c69('0x35')]=function(_0x422f2c,_0xf98abe){return db[_0x2c69('0x3a')]['find']({'where':{'id':_0x422f2c[_0x2c69('0x53')]['id']}})[_0x2c69('0x21')](handleEntityNotFound(_0xf98abe,null))[_0x2c69('0x21')](removeEntity(_0xf98abe,null))[_0x2c69('0x29')](handleError(_0xf98abe,null));};exports['describe']=function(_0x1b122f,_0x12f224){return db[_0x2c69('0x3a')]['describe']()[_0x2c69('0x21')](respondWithResult(_0x12f224,null))[_0x2c69('0x29')](handleError(_0x12f224,null));};var interaction_log=require(_0x2c69('0x12'))('sms-interactions');exports[_0x2c69('0x58')]=function(_0xffb257,_0x3b9f47,_0x5c297e){var _0x1111c8={'agent':{},'channel':_0x2c69('0x59')};if(_0xffb257[_0x2c69('0x57')]['id']){delete _0xffb257[_0x2c69('0x57')]['id'];}_0xffb257['body'][_0x2c69('0x5a')]=!![];_0xffb257['body'][_0x2c69('0x5b')]=moment()['format'](_0x2c69('0x5c'));_0xffb257[_0x2c69('0x57')]['UserId']=_0xffb257[_0x2c69('0x57')][_0x2c69('0x5d')]||_0xffb257[_0x2c69('0x5e')]['id'];_0x1111c8[_0x2c69('0x5f')]['id']=_0xffb257[_0x2c69('0x57')][_0x2c69('0x5d')];return db['SmsMessage'][_0x2c69('0x55')]({'where':{'id':_0xffb257[_0x2c69('0x53')]['id'],'UserId':null}})[_0x2c69('0x21')](handleEntityNotFound(_0x3b9f47,null))[_0x2c69('0x21')](saveUpdates(_0xffb257['body'],null))['then'](function(_0x1264fc){if(_0x1264fc){_0x1111c8[_0x2c69('0x27')]=_0x1264fc[_0x2c69('0x60')]({'plain':!![]});return db[_0x2c69('0x61')][_0x2c69('0x55')]({'where':{'id':_0x1264fc[_0x2c69('0x62')]}});}return null;})[_0x2c69('0x21')](handleEntityNotFound(_0x3b9f47,null))[_0x2c69('0x21')](function(_0x50fbcd){if(_0x50fbcd){return _0x50fbcd['update']({'UserId':_0xffb257[_0x2c69('0x57')][_0x2c69('0x5d')],'read1stAt':_['isNil'](_0x50fbcd[_0x2c69('0x63')])?moment()[_0x2c69('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x27719c){if(_0x27719c){_0x1111c8[_0x2c69('0x65')]=_0x27719c[_0x2c69('0x60')]({'plain':!![]});interaction_log[_0x2c69('0x66')](_0x2c69('0x67'),_0xffb257[_0x2c69('0x5e')]['id'],_0xffb257[_0x2c69('0x5e')]['name'],_0xffb257['user'][_0x2c69('0x68')],_0x1111c8[_0x2c69('0x65')]['id'],_0xffb257[_0x2c69('0x57')]?JSON[_0x2c69('0x69')](_0xffb257[_0x2c69('0x57')]):_0x2c69('0x6a'));return respondWithRpcPromise(_0x2c69('0x6b'),'acceptMessage',_0x1111c8);}return null;})[_0x2c69('0x21')](function(_0x1d42a0){var _0xb3e43f=_0x2c69('0x6c')+_0x1d42a0[_0x2c69('0x27')][_0x2c69('0x6d')];return db['sequelize']['query'](_0xb3e43f,{'type':db['Sequelize'][_0x2c69('0x6e')]['SELECT'],'raw':!![]})[_0x2c69('0x21')](function(_0x25dc56){return _0x25dc56;});})[_0x2c69('0x21')](function(_0x8a86f6){if(_0x8a86f6){_0x1111c8[_0x2c69('0x27')]['contact']=_0x8a86f6[0x0];if(!_0xffb257[_0x2c69('0x57')][_0x2c69('0x5d')])return;return db[_0x2c69('0x6f')]['find']({'where':{'id':_0xffb257['body'][_0x2c69('0x5d')],'role':_0x2c69('0x5f')},'attributes':['id','name',_0x2c69('0x70'),_0x2c69('0x71'),_0x2c69('0x72')],'raw':!![]});}return null;})[_0x2c69('0x21')](function(_0x1ef843){if(!_0x1ef843)return null;_0x1111c8[_0x2c69('0x27')][_0x2c69('0x5f')]=_0x1ef843;return _0x1111c8;})[_0x2c69('0x21')](function(_0x27a153){if(_0x27a153){if(_0xffb257['body'][_0x2c69('0x73')]){_0x1111c8[_0x2c69('0x27')][_0x2c69('0x74')]=util[_0x2c69('0x64')](_0x2c69('0x75'),_0xffb257[_0x2c69('0x5e')][_0x2c69('0x37')]);_0x1111c8[_0x2c69('0x27')][_0x2c69('0x76')]=_0x1111c8['channel'];_0x1111c8['message'][_0x2c69('0x77')]=_0x1111c8['channel'];_0x1111c8['message'][_0x2c69('0x78')]=_0x2c69('0x58');return respondWithRpcPromise(_0x2c69('0x79'),_0x2c69('0x79'),{'event':_0x2c69('0x7a'),'message':_0x1111c8[_0x2c69('0x27')]},client9002)[_0x2c69('0x21')](function(){return _0x1111c8;});}return _0x1111c8;}return null;})[_0x2c69('0x21')](respondWithResult(_0x3b9f47,null))['catch'](handleError(_0x3b9f47,null));};var interaction_log=require(_0x2c69('0x12'))(_0x2c69('0x7b'));exports['reject']=function(_0x59e4f6,_0x240797,_0xfd8ff1){var _0x37dfbb={'agent':{},'channel':_0x2c69('0x59')};if(_0x59e4f6[_0x2c69('0x57')]['id']){delete _0x59e4f6['body']['id'];}_0x59e4f6[_0x2c69('0x57')][_0x2c69('0x5d')]=_0x59e4f6[_0x2c69('0x57')][_0x2c69('0x5d')]||_0x59e4f6[_0x2c69('0x5e')]['id'];_0x37dfbb[_0x2c69('0x5f')]['id']=_0x59e4f6['body'][_0x2c69('0x5d')];return db[_0x2c69('0x3a')]['find']({'where':{'id':_0x59e4f6[_0x2c69('0x53')]['id'],'UserId':null}})[_0x2c69('0x21')](handleEntityNotFound(_0x240797,null))[_0x2c69('0x21')](function(_0xf71c2d){if(_0xf71c2d){_0x37dfbb[_0x2c69('0x27')]=_0xf71c2d['get']({'plain':!![]});return db[_0x2c69('0x61')][_0x2c69('0x55')]({'where':{'id':_0xf71c2d[_0x2c69('0x62')]}});}return null;})[_0x2c69('0x21')](handleEntityNotFound(_0x240797,null))['then'](function(_0x33e202){if(_0x33e202){_0x37dfbb[_0x2c69('0x65')]=_0x33e202[_0x2c69('0x60')]({'plain':!![]});interaction_log[_0x2c69('0x66')](_0x2c69('0x7c'),_0x59e4f6['user']['id'],_0x59e4f6['user']['name'],_0x59e4f6[_0x2c69('0x5e')][_0x2c69('0x68')],_0x37dfbb[_0x2c69('0x65')]['id'],_0x59e4f6[_0x2c69('0x57')]?JSON[_0x2c69('0x69')](_0x59e4f6['body']):_0x2c69('0x6a'));return respondWithRpcPromise(_0x2c69('0x7d'),_0x2c69('0x7e'),_0x37dfbb);}return null;})['then'](function(_0x5bcc1b){var _0x3af47f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5bcc1b[_0x2c69('0x27')][_0x2c69('0x6d')];return db[_0x2c69('0x7f')][_0x2c69('0x42')](_0x3af47f,{'type':db[_0x2c69('0x80')][_0x2c69('0x6e')][_0x2c69('0x81')],'raw':!![]})[_0x2c69('0x21')](function(_0x4a12c0){return _0x4a12c0;});})[_0x2c69('0x21')](function(_0x197c9b){if(_0x197c9b){_0x37dfbb[_0x2c69('0x27')]['contact']=_0x197c9b[0x0];if(!_0x59e4f6['body'][_0x2c69('0x5d')])return;return db[_0x2c69('0x6f')]['find']({'where':{'id':_0x59e4f6['body'][_0x2c69('0x5d')],'role':_0x2c69('0x5f')},'attributes':['id','name',_0x2c69('0x70'),'email',_0x2c69('0x72')],'raw':!![]});}return null;})[_0x2c69('0x21')](function(_0x56a436){if(!_0x56a436)return null;_0x37dfbb[_0x2c69('0x27')][_0x2c69('0x5f')]=_0x56a436;return _0x37dfbb;})[_0x2c69('0x21')](function(_0x360df4){if(_0x360df4){_0x360df4[_0x2c69('0x27')]['interface']=util[_0x2c69('0x64')](_0x2c69('0x75'),_0x59e4f6[_0x2c69('0x5e')]['name']);_0x360df4[_0x2c69('0x27')]['channel']=_0x37dfbb[_0x2c69('0x76')];_0x360df4['message'][_0x2c69('0x77')]=_0x37dfbb[_0x2c69('0x76')];_0x360df4['message']['event']='reject';respondWithRpcPromise(_0x2c69('0x79'),'EventManager',{'event':_0x2c69('0x82'),'message':_0x360df4[_0x2c69('0x27')]},client9002);return _0x37dfbb;}return null;})[_0x2c69('0x21')](respondWithResult(_0x240797,null))[_0x2c69('0x29')](handleError(_0x240797,null));};exports[_0x2c69('0x2b')]=function(_0x193035,_0x32cc7a,_0x204ced){if(_0x193035['body']['id']){delete _0x193035[_0x2c69('0x57')]['id'];}var _0x1acf10;return db['SmsMessage'][_0x2c69('0x55')]({'where':{'id':_0x193035[_0x2c69('0x53')]['id']}})[_0x2c69('0x21')](handleEntityNotFound(_0x32cc7a,null))[_0x2c69('0x21')](function(_0x1c9960){if(_0x1c9960){_0x1acf10=_0x1c9960;return db[_0x2c69('0x83')][_0x2c69('0x55')]({'where':{'id':_0x1c9960[_0x2c69('0x84')]}});}})['then'](handleEntityNotFound(_0x32cc7a,null))[_0x2c69('0x21')](function(_0x20ed19){if(_0x20ed19){logger['debug'](_0x2c69('0x85'),_0x2c69('0x2b'),'received\x20delivery\x20report\x20from',_0x20ed19['type'],util['inspect'](_0x193035[_0x2c69('0x57')],{'showHidden':![],'depth':null}));switch(_0x20ed19[_0x2c69('0x3d')]){case _0x2c69('0x86'):if(_0x193035[_0x2c69('0x57')][_0x2c69('0x87')]&&_0x193035[_0x2c69('0x57')]['MessageSid']===_0x1acf10[_0x2c69('0x88')]){return _0x1acf10[_0x2c69('0x34')]({'read':!![]});}else{logger[_0x2c69('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2c69('0x2b'),_0x2c69('0x86'),util[_0x2c69('0x89')](_0x193035[_0x2c69('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x193035[_0x2c69('0x57')]['MessageUUID']&&_0x193035[_0x2c69('0x57')][_0x2c69('0x8a')]===_0x1acf10['messageId']&&_[_0x2c69('0x8b')]([_0x2c69('0x8c'),'delivered'],_0x193035[_0x2c69('0x57')][_0x2c69('0x8d')])>=0x0){return _0x1acf10[_0x2c69('0x34')]({'read':!![]});}else{logger['error'](_0x2c69('0x8e'),_0x2c69('0x2b'),_0x2c69('0x8f'),util[_0x2c69('0x89')](_0x193035[_0x2c69('0x57')],{'showHidden':![],'depth':null}));}break;case _0x2c69('0x90'):var _0x489328=_0x193035[_0x2c69('0x57')][_0x2c69('0x91')][0x0];if(_0x489328[_0x2c69('0x2b')][_0x2c69('0x92')]==='DELIVERED'){return _0x1acf10[_0x2c69('0x34')]({'read':!![]});}else{logger[_0x2c69('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2c69('0x2b'),'infobip',util[_0x2c69('0x89')](_0x193035[_0x2c69('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1acf10;}})['then'](respondWithResult(_0x32cc7a,null))[_0x2c69('0x29')](handleError(_0x32cc7a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f478ed8..6a39ac8 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 _0xe431=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0xe431,0x14f));var _0x1e43=function(_0x25582d,_0x572da5){_0x25582d=_0x25582d-0x0;var _0x2b41cd=_0xe431[_0x25582d];return _0x2b41cd;};'use strict';var EventEmitter=require(_0x1e43('0x0'));var SmsMessage=require(_0x1e43('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1e43('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1e43('0x3')};function emitEvent(_0x35978e){return function(_0x416c43,_0x1959c4,_0x22c01a){SmsMessageEvents[_0x1e43('0x4')](_0x35978e+':'+_0x416c43['id'],_0x416c43);SmsMessageEvents[_0x1e43('0x4')](_0x35978e,_0x416c43);_0x22c01a(null);};}for(var e in events){if(events[_0x1e43('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x1e43('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x3890=['emit','hook','events','save','update','remove'];(function(_0x3e7876,_0x3adc33){var _0x36c2ff=function(_0x12250f){while(--_0x12250f){_0x3e7876['push'](_0x3e7876['shift']());}};_0x36c2ff(++_0x3adc33);}(_0x3890,0xb6));var _0x0389=function(_0x4abd7c,_0x21672a){_0x4abd7c=_0x4abd7c-0x0;var _0x1dc9e4=_0x3890[_0x4abd7c];return _0x1dc9e4;};'use strict';var EventEmitter=require(_0x0389('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0389('0x1'),'afterUpdate':_0x0389('0x2'),'afterDestroy':_0x0389('0x3')};function emitEvent(_0x2da8a5){return function(_0x296892,_0x23cdb8,_0x39e74c){SmsMessageEvents[_0x0389('0x4')](_0x2da8a5+':'+_0x296892['id'],_0x296892);SmsMessageEvents[_0x0389('0x4')](_0x2da8a5,_0x296892);_0x39e74c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0389('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 325c965..1464200 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 _0x22a0=['FULLTEXT','models','get','direction','toLowerCase','out','secret','SmsInteractionId','findOne','then','update','createdAt','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','body','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','&password=','password','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','clickSend','plivo','authId','token','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','csc','apiKey','login','text','timestamp','keys','sort','createHash','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','Bearer\x20','application/json','code','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages'];(function(_0x48e0ed,_0x2cf7c7){var _0x374418=function(_0x346a17){while(--_0x346a17){_0x48e0ed['push'](_0x48e0ed['shift']());}};_0x374418(++_0x2cf7c7);}(_0x22a0,0x15a));var _0x022a=function(_0x47cb56,_0x354741){_0x47cb56=_0x47cb56-0x0;var _0x19556a=_0x22a0[_0x47cb56];return _0x19556a;};'use strict';var _=require(_0x022a('0x0'));var util=require(_0x022a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x022a('0x2'));var BPromise=require(_0x022a('0x3'));var rp=require(_0x022a('0x4'));var fs=require('fs');var path=require(_0x022a('0x5'));var rimraf=require(_0x022a('0x6'));var config=require(_0x022a('0x7'));var attributes=require('./smsMessage.attributes');module[_0x022a('0x8')]=function(_0x1bce20,_0x1b4f08){return _0x1bce20[_0x022a('0x9')](_0x022a('0xa'),attributes,{'tableName':_0x022a('0xb'),'paranoid':![],'indexes':[{'name':_0x022a('0xc'),'fields':[_0x022a('0xc')]},{'name':_0x022a('0xd'),'fields':['body'],'type':_0x022a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a8def,_0x56cccb,_0x5d5614){var _0x4b3dc8=_0x1bce20[_0x022a('0xf')];var _0xe3f2ce=_0x5a8def[_0x022a('0x10')]({'plain':!![]});if(_0xe3f2ce[_0x022a('0x11')]['toLowerCase']()==='in'||_0xe3f2ce[_0x022a('0x11')][_0x022a('0x12')]()===_0x022a('0x13')&&!_0xe3f2ce[_0x022a('0x14')]&&!_['isNil'](_0xe3f2ce['UserId'])&&!_['isNil'](_0xe3f2ce[_0x022a('0x15')])){_0x4b3dc8['SmsInteraction'][_0x022a('0x16')]({'where':{'id':_0xe3f2ce[_0x022a('0x15')]}})[_0x022a('0x17')](function(_0x1f8fb2){if(_0x1f8fb2){_0x1f8fb2[_0x022a('0x18')]({'lastMsgAt':_0xe3f2ce[_0x022a('0x19')],'lastMsgDirection':_0xe3f2ce[_0x022a('0x11')][_0x022a('0x12')]()});}})['catch'](function(_0xae9b86){console[_0x022a('0x1a')](_0xae9b86);});}if(_0xe3f2ce[_0x022a('0x11')]===_0x022a('0x13')&&!_0xe3f2ce[_0x022a('0x14')]){var _0x4ad375;_0x4b3dc8[_0x022a('0x1b')][_0x022a('0x1c')]({'where':{'id':_0xe3f2ce[_0x022a('0x1d')]},'raw':!![]})[_0x022a('0x17')](function(_0x2b2cf4){_0x4ad375=_0x2b2cf4;if(_0x4ad375&&_0x4ad375[_0x022a('0x1e')]){switch(_0x4ad375[_0x022a('0x1e')]){case _0x022a('0x1f'):var _0x2e5350=require('twilio');if(_0x4ad375[_0x022a('0x20')]&&_0x4ad375['authToken']&&_0x4ad375[_0x022a('0x21')]){var _0x261900=new _0x2e5350(_0x4ad375[_0x022a('0x20')],_0x4ad375[_0x022a('0x22')]);_0x261900[_0x022a('0x23')][_0x022a('0x24')]({'body':_0xe3f2ce[_0x022a('0x25')],'to':_0xe3f2ce[_0x022a('0x21')],'from':_0x4ad375[_0x022a('0x21')],'statusCallback':_0x4ad375[_0x022a('0x26')]+_0x022a('0x27')+_0xe3f2ce['id']+_0x022a('0x28')+_0x4ad375['token']})[_0x022a('0x17')](function(_0x14f31d){if(_0x14f31d['sid']){return _0x5a8def['update']({'messageId':_0x14f31d[_0x022a('0x29')]});}})[_0x022a('0x2a')](function(_0x5204e6){logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x1f'),util[_0x022a('0x2d')](_0x5204e6,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),_0x022a('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x022a('0x2e'):var _0x3a5787=_0x022a('0x2f');if(_0x4ad375[_0x022a('0x30')]&&_0x4ad375['password']){var _0x18a5e7={'recipient':[_0xe3f2ce[_0x022a('0x21')]],'message':_0xe3f2ce[_0x022a('0x25')],'message_type':_0x4ad375[_0x022a('0x31')]};if(_0x4ad375[_0x022a('0x31')]&&_0x4ad375[_0x022a('0x31')]!=='SI'){_0x18a5e7[_0x022a('0x32')]=_0x4ad375[_0x022a('0x21')];}var _0x19624c={'url':_0x3a5787+'login?username='+_0x4ad375[_0x022a('0x30')]+_0x022a('0x33')+_0x4ad375[_0x022a('0x34')],'method':_0x022a('0x35')};rp(_0x19624c)['then'](function(_0x3ef15c){var _0x11f86c=_0x3ef15c[_0x022a('0x36')](';');var _0xf84aa1={'user_key':_0x11f86c[0x0],'session_key':_0x11f86c[0x1]};_0x19624c={'url':_0x3a5787+_0x022a('0x37'),'method':_0x022a('0x38'),'headers':{'user_key':_0xf84aa1[_0x022a('0x39')],'Session_key':_0xf84aa1[_0x022a('0x3a')]},'json':!![],'body':_0x18a5e7};return rp(_0x19624c);})[_0x022a('0x17')](function(_0x43f34e){if(_0x43f34e['total_sent']>=0x1){var _0x113230={'messageId':_0x43f34e[_0x022a('0x3b')]};if(_0x4ad375[_0x022a('0x31')]!=='GP'||!_0x4ad375[_0x022a('0x3c')]){_0x113230[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x113230);}else{return logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x2e'),util[_0x022a('0x2d')](_0x43f34e,{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x3ea3ca){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),_0x022a('0x2e'),util[_0x022a('0x2d')](_0x3ea3ca,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),'skebby',_0x022a('0x3e'));}break;case _0x022a('0x3f'):if(_0x4ad375[_0x022a('0x22')]){var _0x130de5={'recipient':_0xe3f2ce['phone'],'message':_0xe3f2ce[_0x022a('0x25')],'sender':_0x4ad375[_0x022a('0x40')]||_0x4ad375[_0x022a('0x21')],'authorization':_0x4ad375['authToken']};var _0x56cccb={'method':_0x022a('0x38'),'uri':_0x022a('0x41'),'body':_0x130de5,'json':!![]};rp(_0x56cccb)[_0x022a('0x17')](function(_0x2e3757){var _0x5b14bc={'messageId':_0x2e3757[_0x022a('0x42')]};if(!_0x4ad375[_0x022a('0x3c')]){_0x5b14bc[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x5b14bc);})[_0x022a('0x2a')](function(_0x510b7f){logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),'connectel',util['inspect'](_0x510b7f,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x4ad375[_0x022a('0x30')]&&_0x4ad375[_0x022a('0x34')]){var _0x130de5={'messages':[{'source':_0x022a('0x43'),'to':_0xe3f2ce[_0x022a('0x21')],'body':_0xe3f2ce[_0x022a('0x25')],'from':_0x4ad375[_0x022a('0x40')]||_0x4ad375[_0x022a('0x21')]}]};var _0x4647ca=util[_0x022a('0x44')](_0x022a('0x45'),_0x4ad375[_0x022a('0x30')],_0x4ad375[_0x022a('0x34')]);var _0x56cccb={'method':_0x022a('0x38'),'uri':_0x022a('0x46'),'body':_0x130de5,'headers':{'Authorization':util['format'](_0x022a('0x47'),new Buffer(_0x4647ca)['toString'](_0x022a('0x48')))},'json':!![]};rp(_0x56cccb)[_0x022a('0x17')](function(_0x122a36){if(_0x122a36[_0x022a('0x49')]>=0xc8&&_0x122a36[_0x022a('0x49')]<=0xce){if(_0x122a36['data']&&_0x122a36[_0x022a('0x4a')][_0x022a('0x4b')]>0x0){var _0x59d2a7=_[_0x022a('0x4c')](_0x122a36[_0x022a('0x4a')][_0x022a('0x23')]);var _0x46dcf8={'messageId':_0x59d2a7['message_id']};if(!_0x4ad375[_0x022a('0x3c')]){_0x46dcf8[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x46dcf8);}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),'afterCreate',_0x022a('0x4d'),util[_0x022a('0x2d')](_0x122a36,{'showHidden':![],'depth':null}));}}else{logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),'clickSend',util[_0x022a('0x2d')](_0x122a36,{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x4f4a61){logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),'clickSend',util[_0x022a('0x2d')](_0x4f4a61,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),_0x022a('0x4d'),_0x022a('0x3e'));}break;case _0x022a('0x4e'):if(_0x4ad375[_0x022a('0x4f')]&&_0x4ad375[_0x022a('0x22')]){var _0x130de5={'dst':_0xe3f2ce[_0x022a('0x21')],'text':_0xe3f2ce['body'],'src':_0x4ad375['senderString']||_0x4ad375['phone'],'url':_0x4ad375[_0x022a('0x26')]+_0x022a('0x27')+_0xe3f2ce['id']+'/status?token='+_0x4ad375[_0x022a('0x50')]};var _0x4647ca=util[_0x022a('0x44')]('%s:%s',_0x4ad375[_0x022a('0x4f')],_0x4ad375['authToken']);var _0x56cccb={'method':_0x022a('0x38'),'uri':util[_0x022a('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x4ad375[_0x022a('0x4f')]),'body':_0x130de5,'headers':{'Authorization':util[_0x022a('0x44')]('Basic\x20%s',new Buffer(_0x4647ca)[_0x022a('0x51')](_0x022a('0x48')))},'json':!![]};rp(_0x56cccb)[_0x022a('0x17')](function(_0x278565){var _0x6ab307={'messageId':_0x278565[_0x022a('0x52')][0x0]};return _0x5a8def['update'](_0x6ab307);})[_0x022a('0x2a')](function(_0x21deed){logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),'plivo',util[_0x022a('0x2d')](_0x21deed,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x4e'),_0x022a('0x53'));}break;case _0x022a('0x54'):if(_0x4ad375[_0x022a('0x30')]&&_0x4ad375[_0x022a('0x34')]){if(_0x4ad375[_0x022a('0x55')]){var _0x507cf7={'method':'POST','uri':_0x4ad375[_0x022a('0x55')]+_0x022a('0x56'),'body':{'username':_0x4ad375['username'],'password':_0x4ad375['password']},'json':!![]};return rp(_0x507cf7)[_0x022a('0x17')](function(_0x80c923){var _0x5c25ea={'method':_0x022a('0x38'),'uri':_0x4ad375[_0x022a('0x55')]+_0x022a('0x57'),'body':{'messages':[{'from':_0x4ad375[_0x022a('0x21')],'destinations':[{'to':_0xe3f2ce[_0x022a('0x21')]}],'text':_0xe3f2ce[_0x022a('0x25')],'notifyUrl':_0x4ad375[_0x022a('0x26')]+'/api/sms/messages/'+_0xe3f2ce['id']+_0x022a('0x28')+_0x4ad375['token'],'notifyContentType':'application/json','callbackData':_0x4ad375[_0x022a('0x21')]+';'+_0xe3f2ce['body']}]},'headers':{'Authorization':_0x022a('0x58')+_0x80c923[_0x022a('0x50')]},'json':!![]};return rp(_0x5c25ea)['then'](function(_0x2fa1b5){if(_0x2fa1b5['messages']){var _0x4d42a1={'messageId':_0x2fa1b5[_0x022a('0x23')][0x0][_0x022a('0xc')]};if(!_0x4ad375[_0x022a('0x3c')]){_0x4d42a1[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x4d42a1);}else{return logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x54'),util[_0x022a('0x2d')](_0x2fa1b5,{'showHidden':![],'depth':null}));}});})[_0x022a('0x2a')](function(_0x1b78c6){return logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',util[_0x022a('0x2d')](_0x1b78c6,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x54'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x54'),_0x022a('0x3e'));}break;case _0x022a('0x59'):var _0x4224fe=require('crypto');if(_0x4ad375[_0x022a('0x5a')]){var _0x2947b4={};_0x2947b4[_0x022a('0x5b')]=_0x4ad375['username'];_0x2947b4[_0x022a('0x21')]=_0xe3f2ce['phone'];_0x2947b4[_0x022a('0x32')]=_0x4ad375[_0x022a('0x21')];_0x2947b4[_0x022a('0x5c')]=_0xe3f2ce[_0x022a('0x25')];_0x2947b4[_0x022a('0x5d')]=+new Date();var _0x304498='';var _0x8fff21='';var _0x3a7703=Object[_0x022a('0x5e')](_0x2947b4);_0x3a7703[_0x022a('0x5f')]();for(var _0x3133e=0x0;_0x3133e<_0x3a7703['length'];_0x3133e++){if(_0x304498!=''){_0x304498+='&';}_0x304498+=_0x3a7703[_0x3133e]+'='+encodeURIComponent(_0x2947b4[_0x3a7703[_0x3133e]]);_0x8fff21+=_0x2947b4[_0x3a7703[_0x3133e]];}_0x8fff21+=_0x4ad375[_0x022a('0x5a')];_0x8fff21=_0x4224fe[_0x022a('0x60')]('md5')[_0x022a('0x18')](_0x8fff21)['digest']('hex');if(_0x304498!==''){_0x304498+='&';}_0x304498+=_0x022a('0x61')+_0x8fff21;var _0x19624c={'method':'GET','uri':_0x4ad375['baseUrl']+_0x022a('0x62')+_0x304498,'json':!![]};return rp(_0x19624c)[_0x022a('0x17')](function(_0x1ea0b9){var _0x36efad=Object[_0x022a('0x5e')](_0x1ea0b9);if(_0x1ea0b9[_0x36efad[0x0]][_0x022a('0x1a')]&&parseInt(_0x1ea0b9[_0x36efad[0x0]][_0x022a('0x1a')])===0x0){var _0x2e0a7c={'messageId':_0x1ea0b9[_0x36efad[0x0]][_0x022a('0x63')]};if(!_0x4ad375[_0x022a('0x3c')]){_0x2e0a7c[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x2e0a7c);}else{return logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),_0x022a('0x59'),util['inspect'](_0x1ea0b9[_0x022a('0x1a')],{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x11d754){return logger['error'](_0x022a('0x2b'),'afterCreate',_0x022a('0x59'),util[_0x022a('0x2d')](_0x11d754,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),'afterCreate',_0x022a('0x59'),_0x022a('0x64'));}break;case _0x022a('0x65'):if(_0x4ad375['apiKey']){var _0x128ddc={'method':_0x022a('0x38'),'uri':_0x022a('0x66'),'headers':{'Authorization':_0x4ad375[_0x022a('0x5a')]},'body':{'content':_0xe3f2ce[_0x022a('0x25')],'to':[_0xe3f2ce[_0x022a('0x21')]],'from':_0x4ad375[_0x022a('0x21')],'binary':![],'clientMessageId':_0x022a('0x67'),'charset':_0x022a('0x68')},'json':!![]};rp(_0x128ddc)[_0x022a('0x17')](function(_0x2b375c){if(!_0x2b375c[_0x022a('0x1a')]){var _0x15698c={'messageId':_0x2b375c[_0x022a('0x23')][0x0]['apiMessageId']};if(!_0x4ad375[_0x022a('0x3c')]){_0x15698c[_0x022a('0x3d')]=!![];}return _0x5a8def[_0x022a('0x18')](_0x15698c);}else{return logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),'clickatell',util[_0x022a('0x2d')](_0x2b375c[_0x022a('0x1a')],{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x2988a0){return logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x65'),util[_0x022a('0x2d')](_0x2988a0,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),_0x022a('0x65'),_0x022a('0x64'));}break;case _0x022a('0x69'):if(_0x4ad375[_0x022a('0x30')]&&_0x4ad375[_0x022a('0x34')]){var _0x4647ca=util[_0x022a('0x44')]('%s:%s',_0x4ad375[_0x022a('0x30')],_0x4ad375[_0x022a('0x34')]);var _0x56cccb={'method':_0x022a('0x38'),'uri':_0x022a('0x6a')+_0x4ad375[_0x022a('0x6b')]+_0x022a('0x6c'),'body':{'to':[_0xe3f2ce[_0x022a('0x21')]],'text':_0xe3f2ce[_0x022a('0x25')],'from':_0x4ad375['phone'],'applicationId':_0x4ad375[_0x022a('0x6d')]},'headers':{'Authorization':util['format'](_0x022a('0x47'),new Buffer(_0x4647ca)['toString']('base64'))},'json':!![]};rp(_0x56cccb)[_0x022a('0x17')](function(_0x2a77bd){if(_0x2a77bd['id']){var _0x369825={'messageId':_0x2a77bd['id']};return _0x5a8def['update'](_0x369825);}else{logger[_0x022a('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x022a('0x2c'),'bandwidth',util[_0x022a('0x2d')](_0x2a77bd,{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x1af8a9){logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x69'),util['inspect'](_0x1af8a9,{'showHidden':![],'depth':null}));});}else{logger[_0x022a('0x1a')](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x69'),_0x022a('0x3e'));}break;case _0x022a('0x6e'):if(_0x4ad375[_0x022a('0x5a')]){var _0x236fa7={};var _0x19624c={'method':_0x022a('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x022a('0x6f')+_0x4ad375['apiKey'],'Content-Type':_0x022a('0x70')},'body':{'from':_0x4ad375[_0x022a('0x21')],'to':_0xe3f2ce['phone'],'text':_0xe3f2ce[_0x022a('0x25')]},'json':!![]};return rp(_0x19624c)[_0x022a('0x17')](function(_0x41f0da){if(_0x41f0da[_0x022a('0x71')]==0xca){_0x236fa7[_0x022a('0x72')]=_0x41f0da;var _0x342c26={'method':_0x022a('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x022a('0x6f')+_0x4ad375[_0x022a('0x5a')],'Content-Type':_0x022a('0x70')},'body':{'refid':_0x236fa7[_0x022a('0x72')][_0x022a('0x73')]},'json':!![]};return rp(_0x342c26)['then'](function(_0x6cb1ef){_0x236fa7[_0x022a('0x74')]=_0x6cb1ef;var _0x290fe4={'messageId':_0x236fa7[_0x022a('0x72')][_0x022a('0x73')],'read':!![]};return _0x5a8def[_0x022a('0x18')](_0x290fe4);});}else{return logger[_0x022a('0x1a')](_0x022a('0x2b'),'afterCreate','intelepeer',util[_0x022a('0x2d')](_0x41f0da,{'showHidden':![],'depth':null}));}})[_0x022a('0x2a')](function(_0x25ea1f){return logger['error'](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x6e'),util['inspect'](_0x25ea1f,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x022a('0x2b'),_0x022a('0x2c'),_0x022a('0x6e'),'Token\x20not\x20received');}break;}}})[_0x022a('0x75')](function(){_0x5d5614();});}else{_0x5d5614();}}},'charset':_0x022a('0x76'),'collate':_0x022a('0x77')});}; \ No newline at end of file +var _0x4b00=['define','SmsMessage','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','login?username=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','csc','crypto','apiKey','login','text','timestamp','sort','length','createHash','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','application/json','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','request-promise','path','../../config/environment','./smsMessage.attributes'];(function(_0x231654,_0x132b62){var _0x448af3=function(_0xd482b9){while(--_0xd482b9){_0x231654['push'](_0x231654['shift']());}};_0x448af3(++_0x132b62);}(_0x4b00,0x77));var _0x04b0=function(_0x5df830,_0x5e2506){_0x5df830=_0x5df830-0x0;var _0x1deb62=_0x4b00[_0x5df830];return _0x1deb62;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04b0('0x0'))('api');var moment=require(_0x04b0('0x1'));var BPromise=require('bluebird');var rp=require(_0x04b0('0x2'));var fs=require('fs');var path=require(_0x04b0('0x3'));var rimraf=require('rimraf');var config=require(_0x04b0('0x4'));var attributes=require(_0x04b0('0x5'));module['exports']=function(_0x1a972f,_0x4cea82){return _0x1a972f[_0x04b0('0x6')](_0x04b0('0x7'),attributes,{'tableName':_0x04b0('0x8'),'paranoid':![],'indexes':[{'name':_0x04b0('0x9'),'fields':[_0x04b0('0x9')]},{'name':_0x04b0('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x311cb7,_0x1e2306,_0x26369b){var _0x34b92f=_0x1a972f[_0x04b0('0xb')];var _0x46271b=_0x311cb7[_0x04b0('0xc')]({'plain':!![]});if(_0x46271b[_0x04b0('0xd')][_0x04b0('0xe')]()==='in'||_0x46271b[_0x04b0('0xd')][_0x04b0('0xe')]()===_0x04b0('0xf')&&!_0x46271b[_0x04b0('0x10')]&&!_[_0x04b0('0x11')](_0x46271b['UserId'])&&!_[_0x04b0('0x11')](_0x46271b[_0x04b0('0x12')])){_0x34b92f[_0x04b0('0x13')][_0x04b0('0x14')]({'where':{'id':_0x46271b[_0x04b0('0x12')]}})[_0x04b0('0x15')](function(_0x2c6d1d){if(_0x2c6d1d){_0x2c6d1d[_0x04b0('0x16')]({'lastMsgAt':_0x46271b[_0x04b0('0x17')],'lastMsgDirection':_0x46271b[_0x04b0('0xd')]['toLowerCase']()});}})[_0x04b0('0x18')](function(_0x706ffa){console['error'](_0x706ffa);});}if(_0x46271b[_0x04b0('0xd')]==='out'&&!_0x46271b['secret']){var _0x5a6a47;_0x34b92f[_0x04b0('0x19')][_0x04b0('0x1a')]({'where':{'id':_0x46271b[_0x04b0('0x1b')]},'raw':!![]})[_0x04b0('0x15')](function(_0x3dfa01){_0x5a6a47=_0x3dfa01;if(_0x5a6a47&&_0x5a6a47[_0x04b0('0x1c')]){switch(_0x5a6a47[_0x04b0('0x1c')]){case _0x04b0('0x1d'):var _0x839ff6=require('twilio');if(_0x5a6a47[_0x04b0('0x1e')]&&_0x5a6a47['authToken']&&_0x5a6a47[_0x04b0('0x1f')]){var _0x4726ae=new _0x839ff6(_0x5a6a47[_0x04b0('0x1e')],_0x5a6a47[_0x04b0('0x20')]);_0x4726ae[_0x04b0('0x21')][_0x04b0('0x22')]({'body':_0x46271b['body'],'to':_0x46271b['phone'],'from':_0x5a6a47[_0x04b0('0x1f')],'statusCallback':_0x5a6a47[_0x04b0('0x23')]+_0x04b0('0x24')+_0x46271b['id']+_0x04b0('0x25')+_0x5a6a47[_0x04b0('0x26')]})[_0x04b0('0x15')](function(_0x1b1dd9){if(_0x1b1dd9[_0x04b0('0x27')]){return _0x311cb7[_0x04b0('0x16')]({'messageId':_0x1b1dd9[_0x04b0('0x27')]});}})['catch'](function(_0x45042b){logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate','twilio',util[_0x04b0('0x2a')](_0x45042b,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),_0x04b0('0x1d'),_0x04b0('0x2c'));}break;case _0x04b0('0x2d'):var _0x2c49b3=_0x04b0('0x2e');if(_0x5a6a47[_0x04b0('0x2f')]&&_0x5a6a47[_0x04b0('0x30')]){var _0x2d7423={'recipient':[_0x46271b[_0x04b0('0x1f')]],'message':_0x46271b[_0x04b0('0x31')],'message_type':_0x5a6a47['smsMethod']};if(_0x5a6a47[_0x04b0('0x32')]&&_0x5a6a47['smsMethod']!=='SI'){_0x2d7423['sender']=_0x5a6a47['phone'];}var _0x3720d7={'url':_0x2c49b3+_0x04b0('0x33')+_0x5a6a47[_0x04b0('0x2f')]+'&password='+_0x5a6a47['password'],'method':_0x04b0('0x34')};rp(_0x3720d7)['then'](function(_0x5599ff){var _0x5131a7=_0x5599ff[_0x04b0('0x35')](';');var _0x26d146={'user_key':_0x5131a7[0x0],'session_key':_0x5131a7[0x1]};_0x3720d7={'url':_0x2c49b3+_0x04b0('0x36'),'method':_0x04b0('0x37'),'headers':{'user_key':_0x26d146[_0x04b0('0x38')],'Session_key':_0x26d146[_0x04b0('0x39')]},'json':!![],'body':_0x2d7423};return rp(_0x3720d7);})[_0x04b0('0x15')](function(_0x37c1f8){if(_0x37c1f8[_0x04b0('0x3a')]>=0x1){var _0x103597={'messageId':_0x37c1f8['internal_order_id']};if(_0x5a6a47[_0x04b0('0x32')]!=='GP'||!_0x5a6a47[_0x04b0('0x3b')]){_0x103597[_0x04b0('0x3c')]=!![];}return _0x311cb7['update'](_0x103597);}else{return logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),'skebby',util['inspect'](_0x37c1f8,{'showHidden':![],'depth':null}));}})['catch'](function(_0x18bb61){return logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),'skebby',util[_0x04b0('0x2a')](_0x18bb61,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),'skebby',_0x04b0('0x3d'));}break;case'connectel':if(_0x5a6a47[_0x04b0('0x20')]){var _0x941765={'recipient':_0x46271b['phone'],'message':_0x46271b[_0x04b0('0x31')],'sender':_0x5a6a47[_0x04b0('0x3e')]||_0x5a6a47[_0x04b0('0x1f')],'authorization':_0x5a6a47[_0x04b0('0x20')]};var _0x1e2306={'method':_0x04b0('0x37'),'uri':_0x04b0('0x3f'),'body':_0x941765,'json':!![]};rp(_0x1e2306)[_0x04b0('0x15')](function(_0x13ddd2){var _0x4bb8fd={'messageId':_0x13ddd2[_0x04b0('0x40')]};if(!_0x5a6a47['deliveryReport']){_0x4bb8fd[_0x04b0('0x3c')]=!![];}return _0x311cb7[_0x04b0('0x16')](_0x4bb8fd);})[_0x04b0('0x18')](function(_0x40b740){logger['error'](_0x04b0('0x29'),'afterCreate',_0x04b0('0x41'),util[_0x04b0('0x2a')](_0x40b740,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x41'),_0x04b0('0x42'));}break;case _0x04b0('0x43'):if(_0x5a6a47[_0x04b0('0x2f')]&&_0x5a6a47[_0x04b0('0x30')]){var _0x941765={'messages':[{'source':_0x04b0('0x44'),'to':_0x46271b[_0x04b0('0x1f')],'body':_0x46271b['body'],'from':_0x5a6a47[_0x04b0('0x3e')]||_0x5a6a47[_0x04b0('0x1f')]}]};var _0xa38444=util[_0x04b0('0x45')](_0x04b0('0x46'),_0x5a6a47[_0x04b0('0x2f')],_0x5a6a47[_0x04b0('0x30')]);var _0x1e2306={'method':'POST','uri':_0x04b0('0x47'),'body':_0x941765,'headers':{'Authorization':util[_0x04b0('0x45')]('Basic\x20%s',new Buffer(_0xa38444)[_0x04b0('0x48')](_0x04b0('0x49')))},'json':!![]};rp(_0x1e2306)[_0x04b0('0x15')](function(_0x1b8848){if(_0x1b8848[_0x04b0('0x4a')]>=0xc8&&_0x1b8848[_0x04b0('0x4a')]<=0xce){if(_0x1b8848[_0x04b0('0x4b')]&&_0x1b8848['data']['queued_count']>0x0){var _0x231625=_[_0x04b0('0x4c')](_0x1b8848[_0x04b0('0x4b')][_0x04b0('0x21')]);var _0x5bd8f2={'messageId':_0x231625[_0x04b0('0x4d')]};if(!_0x5a6a47[_0x04b0('0x3b')]){_0x5bd8f2[_0x04b0('0x3c')]=!![];}return _0x311cb7[_0x04b0('0x16')](_0x5bd8f2);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),_0x04b0('0x4e'),util['inspect'](_0x1b8848,{'showHidden':![],'depth':null}));}}else{logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),_0x04b0('0x4e'),util[_0x04b0('0x2a')](_0x1b8848,{'showHidden':![],'depth':null}));}})[_0x04b0('0x18')](function(_0x23b618){logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),'clickSend',util[_0x04b0('0x2a')](_0x23b618,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x4e'),_0x04b0('0x3d'));}break;case'plivo':if(_0x5a6a47[_0x04b0('0x4f')]&&_0x5a6a47[_0x04b0('0x20')]){var _0x941765={'dst':_0x46271b[_0x04b0('0x1f')],'text':_0x46271b[_0x04b0('0x31')],'src':_0x5a6a47[_0x04b0('0x3e')]||_0x5a6a47[_0x04b0('0x1f')],'url':_0x5a6a47['remote']+'/api/sms/messages/'+_0x46271b['id']+'/status?token='+_0x5a6a47[_0x04b0('0x26')]};var _0xa38444=util[_0x04b0('0x45')](_0x04b0('0x46'),_0x5a6a47[_0x04b0('0x4f')],_0x5a6a47[_0x04b0('0x20')]);var _0x1e2306={'method':_0x04b0('0x37'),'uri':util[_0x04b0('0x45')](_0x04b0('0x50'),_0x5a6a47[_0x04b0('0x4f')]),'body':_0x941765,'headers':{'Authorization':util[_0x04b0('0x45')](_0x04b0('0x51'),new Buffer(_0xa38444)['toString'](_0x04b0('0x49')))},'json':!![]};rp(_0x1e2306)[_0x04b0('0x15')](function(_0x2e7974){var _0x34c861={'messageId':_0x2e7974['message_uuid'][0x0]};return _0x311cb7['update'](_0x34c861);})[_0x04b0('0x18')](function(_0x34ee26){logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x52'),util[_0x04b0('0x2a')](_0x34ee26,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x04b0('0x53'):if(_0x5a6a47[_0x04b0('0x2f')]&&_0x5a6a47[_0x04b0('0x30')]){if(_0x5a6a47[_0x04b0('0x54')]){var _0x97a76b={'method':'POST','uri':_0x5a6a47[_0x04b0('0x54')]+_0x04b0('0x55'),'body':{'username':_0x5a6a47[_0x04b0('0x2f')],'password':_0x5a6a47[_0x04b0('0x30')]},'json':!![]};return rp(_0x97a76b)['then'](function(_0x3e5c76){var _0x7c21ba={'method':_0x04b0('0x37'),'uri':_0x5a6a47[_0x04b0('0x54')]+_0x04b0('0x56'),'body':{'messages':[{'from':_0x5a6a47[_0x04b0('0x1f')],'destinations':[{'to':_0x46271b['phone']}],'text':_0x46271b[_0x04b0('0x31')],'notifyUrl':_0x5a6a47[_0x04b0('0x23')]+_0x04b0('0x24')+_0x46271b['id']+'/status?token='+_0x5a6a47[_0x04b0('0x26')],'notifyContentType':'application/json','callbackData':_0x5a6a47[_0x04b0('0x1f')]+';'+_0x46271b[_0x04b0('0x31')]}]},'headers':{'Authorization':_0x04b0('0x57')+_0x3e5c76[_0x04b0('0x26')]},'json':!![]};return rp(_0x7c21ba)[_0x04b0('0x15')](function(_0x327a8a){if(_0x327a8a[_0x04b0('0x21')]){var _0x237535={'messageId':_0x327a8a['messages'][0x0]['messageId']};if(!_0x5a6a47[_0x04b0('0x3b')]){_0x237535['read']=!![];}return _0x311cb7[_0x04b0('0x16')](_0x237535);}else{return logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x53'),util['inspect'](_0x327a8a,{'showHidden':![],'depth':null}));}});})[_0x04b0('0x18')](function(_0x53af58){return logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),'infobip',util['inspect'](_0x53af58,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),'infobip',_0x04b0('0x3d'));}break;case _0x04b0('0x58'):var _0x5354d7=require(_0x04b0('0x59'));if(_0x5a6a47[_0x04b0('0x5a')]){var _0x51035d={};_0x51035d[_0x04b0('0x5b')]=_0x5a6a47[_0x04b0('0x2f')];_0x51035d['phone']=_0x46271b['phone'];_0x51035d['sender']=_0x5a6a47[_0x04b0('0x1f')];_0x51035d[_0x04b0('0x5c')]=_0x46271b[_0x04b0('0x31')];_0x51035d[_0x04b0('0x5d')]=+new Date();var _0x5bcffa='';var _0x370025='';var _0x4e5e35=Object['keys'](_0x51035d);_0x4e5e35[_0x04b0('0x5e')]();for(var _0xb036fc=0x0;_0xb036fc<_0x4e5e35[_0x04b0('0x5f')];_0xb036fc++){if(_0x5bcffa!=''){_0x5bcffa+='&';}_0x5bcffa+=_0x4e5e35[_0xb036fc]+'='+encodeURIComponent(_0x51035d[_0x4e5e35[_0xb036fc]]);_0x370025+=_0x51035d[_0x4e5e35[_0xb036fc]];}_0x370025+=_0x5a6a47[_0x04b0('0x5a')];_0x370025=_0x5354d7[_0x04b0('0x60')]('md5')[_0x04b0('0x16')](_0x370025)[_0x04b0('0x61')](_0x04b0('0x62'));if(_0x5bcffa!==''){_0x5bcffa+='&';}_0x5bcffa+=_0x04b0('0x63')+_0x370025;var _0x3720d7={'method':_0x04b0('0x34'),'uri':_0x5a6a47[_0x04b0('0x54')]+_0x04b0('0x64')+_0x5bcffa,'json':!![]};return rp(_0x3720d7)['then'](function(_0x5e6df1){var _0x3b6846=Object[_0x04b0('0x65')](_0x5e6df1);if(_0x5e6df1[_0x3b6846[0x0]]['error']&&parseInt(_0x5e6df1[_0x3b6846[0x0]][_0x04b0('0x28')])===0x0){var _0x436036={'messageId':_0x5e6df1[_0x3b6846[0x0]][_0x04b0('0x66')]};if(!_0x5a6a47[_0x04b0('0x3b')]){_0x436036['read']=!![];}return _0x311cb7['update'](_0x436036);}else{return logger['error'](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x58'),util[_0x04b0('0x2a')](_0x5e6df1[_0x04b0('0x28')],{'showHidden':![],'depth':null}));}})[_0x04b0('0x18')](function(_0x42a65b){return logger[_0x04b0('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x04b0('0x2b'),_0x04b0('0x58'),util['inspect'](_0x42a65b,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x58'),_0x04b0('0x67'));}break;case'clickatell':if(_0x5a6a47[_0x04b0('0x5a')]){var _0x3a4d41={'method':_0x04b0('0x37'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x5a6a47[_0x04b0('0x5a')]},'body':{'content':_0x46271b['body'],'to':[_0x46271b[_0x04b0('0x1f')]],'from':_0x5a6a47['phone'],'binary':![],'clientMessageId':_0x04b0('0x68'),'charset':_0x04b0('0x69')},'json':!![]};rp(_0x3a4d41)[_0x04b0('0x15')](function(_0x2de623){if(!_0x2de623[_0x04b0('0x28')]){var _0x851b52={'messageId':_0x2de623['messages'][0x0][_0x04b0('0x6a')]};if(!_0x5a6a47[_0x04b0('0x3b')]){_0x851b52[_0x04b0('0x3c')]=!![];}return _0x311cb7[_0x04b0('0x16')](_0x851b52);}else{return logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x6b'),util['inspect'](_0x2de623[_0x04b0('0x28')],{'showHidden':![],'depth':null}));}})[_0x04b0('0x18')](function(_0x4f5260){return logger['error'](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x6b'),util['inspect'](_0x4f5260,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x04b0('0x6c'):if(_0x5a6a47['username']&&_0x5a6a47[_0x04b0('0x30')]){var _0xa38444=util[_0x04b0('0x45')](_0x04b0('0x46'),_0x5a6a47['username'],_0x5a6a47['password']);var _0x1e2306={'method':_0x04b0('0x37'),'uri':_0x04b0('0x6d')+_0x5a6a47[_0x04b0('0x6e')]+_0x04b0('0x6f'),'body':{'to':[_0x46271b[_0x04b0('0x1f')]],'text':_0x46271b[_0x04b0('0x31')],'from':_0x5a6a47[_0x04b0('0x1f')],'applicationId':_0x5a6a47[_0x04b0('0x70')]},'headers':{'Authorization':util[_0x04b0('0x45')](_0x04b0('0x51'),new Buffer(_0xa38444)[_0x04b0('0x48')]('base64'))},'json':!![]};rp(_0x1e2306)[_0x04b0('0x15')](function(_0x87fe6f){if(_0x87fe6f['id']){var _0x5917e3={'messageId':_0x87fe6f['id']};return _0x311cb7[_0x04b0('0x16')](_0x5917e3);}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x6c'),util[_0x04b0('0x2a')](_0x87fe6f,{'showHidden':![],'depth':null}));}})[_0x04b0('0x18')](function(_0x3e0fe2){logger['error'](_0x04b0('0x29'),_0x04b0('0x2b'),'bandwidth',util[_0x04b0('0x2a')](_0x3e0fe2,{'showHidden':![],'depth':null}));});}else{logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x6c'),_0x04b0('0x3d'));}break;case _0x04b0('0x71'):if(_0x5a6a47[_0x04b0('0x5a')]){var _0x31ff74={};var _0x3720d7={'method':_0x04b0('0x37'),'uri':_0x04b0('0x72'),'headers':{'Authorization':_0x04b0('0x73')+_0x5a6a47['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x5a6a47[_0x04b0('0x1f')],'to':_0x46271b[_0x04b0('0x1f')],'text':_0x46271b[_0x04b0('0x31')]},'json':!![]};return rp(_0x3720d7)[_0x04b0('0x15')](function(_0x4b5dd2){if(_0x4b5dd2[_0x04b0('0x74')]==0xca){_0x31ff74[_0x04b0('0x75')]=_0x4b5dd2;var _0xd1f225={'method':_0x04b0('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x5a6a47[_0x04b0('0x5a')],'Content-Type':_0x04b0('0x76')},'body':{'refid':_0x31ff74['message'][_0x04b0('0x77')]},'json':!![]};return rp(_0xd1f225)['then'](function(_0x13499a){_0x31ff74[_0x04b0('0x78')]=_0x13499a;var _0x37d147={'messageId':_0x31ff74[_0x04b0('0x75')]['refid'],'read':!![]};return _0x311cb7['update'](_0x37d147);});}else{return logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x71'),util[_0x04b0('0x2a')](_0x4b5dd2,{'showHidden':![],'depth':null}));}})['catch'](function(_0x22a3b3){return logger[_0x04b0('0x28')](_0x04b0('0x29'),'afterCreate',_0x04b0('0x71'),util[_0x04b0('0x2a')](_0x22a3b3,{'showHidden':![],'depth':null}));});}else{return logger[_0x04b0('0x28')](_0x04b0('0x29'),_0x04b0('0x2b'),_0x04b0('0x71'),_0x04b0('0x79'));}break;}}})[_0x04b0('0x7a')](function(){_0x26369b();});}else{_0x26369b();}}},'charset':_0x04b0('0x7b'),'collate':_0x04b0('0x7c')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f82a956..637e4df 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 _0x5683=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e37e5,_0x37eddc){var _0x1bea9b=function(_0x1dc1e7){while(--_0x1dc1e7){_0x4e37e5['push'](_0x4e37e5['shift']());}};_0x1bea9b(++_0x37eddc);}(_0x5683,0x1f1));var _0x3568=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x5683[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x3568('0x0'));var util=require(_0x3568('0x1'));var moment=require(_0x3568('0x2'));var BPromise=require(_0x3568('0x3'));var rs=require(_0x3568('0x4'));var fs=require('fs');var Redis=require(_0x3568('0x5'));var db=require(_0x3568('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3568('0x7'))(_0x3568('0x8'));var config=require(_0x3568('0x9'));var jayson=require(_0x3568('0xa'));var client=jayson[_0x3568('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3568('0xc')],{'host':_0x3568('0xd'),'port':0x18eb});var socket=require(_0x3568('0xe'))(new Redis(config['redis']));require(_0x3568('0xf'))[_0x3568('0x10')](socket);function respondWithRpcPromise(_0x170661,_0x98d70e,_0x4cde64){return new BPromise(function(_0x233442,_0x1e4794){return client[_0x3568('0x11')](_0x170661,_0x4cde64)[_0x3568('0x12')](function(_0x31c83b){logger[_0x3568('0x13')](_0x3568('0x14'),_0x98d70e,_0x3568('0x15'));logger['debug'](_0x3568('0x16'),_0x98d70e,'request\x20sent',JSON[_0x3568('0x17')](_0x31c83b));if(_0x31c83b[_0x3568('0x18')]){if(_0x31c83b[_0x3568('0x18')][_0x3568('0x19')]===0x1f4){logger[_0x3568('0x18')](_0x3568('0x14'),_0x98d70e,_0x31c83b[_0x3568('0x18')][_0x3568('0x1a')]);return _0x1e4794(_0x31c83b[_0x3568('0x18')][_0x3568('0x1a')]);}logger[_0x3568('0x18')]('SmsMessage,\x20%s,\x20%s',_0x98d70e,_0x31c83b[_0x3568('0x18')]['message']);return _0x233442(_0x31c83b[_0x3568('0x18')][_0x3568('0x1a')]);}else{logger['info'](_0x3568('0x14'),_0x98d70e,_0x3568('0x15'));_0x233442(_0x31c83b[_0x3568('0x1b')]['message']);}})[_0x3568('0x1c')](function(_0x3051a1){logger[_0x3568('0x18')]('SmsMessage,\x20%s,\x20%s',_0x98d70e,_0x3051a1);_0x1e4794(_0x3051a1);});});}exports[_0x3568('0x1d')]=function(_0x30084d){var _0xa20414=this;return new Promise(function(_0x33367d,_0x431cd6){return db[_0x3568('0x1e')][_0x3568('0x1f')](_0x30084d[_0x3568('0x20')],{'raw':_0x30084d['options']?_0x30084d[_0x3568('0x21')][_0x3568('0x22')]===undefined?!![]:![]:!![]})[_0x3568('0x12')](function(_0x1edc4){logger[_0x3568('0x13')](_0x3568('0x1d'),_0x30084d);logger[_0x3568('0x23')](_0x3568('0x1d'),_0x30084d,JSON[_0x3568('0x17')](_0x1edc4));_0x33367d(_0x1edc4);})['catch'](function(_0x2a88fd){logger['error']('CreateSmsMessage',_0x2a88fd[_0x3568('0x1a')],_0x30084d);_0x431cd6(_0xa20414[_0x3568('0x18')](0x1f4,_0x2a88fd[_0x3568('0x1a')]));});});}; \ No newline at end of file +var _0xe20d=['request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s','message','CreateSmsMessage','SmsMessage','create','body','raw','then','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','info'];(function(_0x2b1c95,_0x116f52){var _0x1d16e2=function(_0x42227b){while(--_0x42227b){_0x2b1c95['push'](_0x2b1c95['shift']());}};_0x1d16e2(++_0x116f52);}(_0xe20d,0x11b));var _0xde20=function(_0x464f27,_0x45af44){_0x464f27=_0x464f27-0x0;var _0x350713=_0xe20d[_0x464f27];return _0x350713;};'use strict';var _=require('lodash');var util=require(_0xde20('0x0'));var moment=require(_0xde20('0x1'));var BPromise=require(_0xde20('0x2'));var rs=require(_0xde20('0x3'));var fs=require('fs');var Redis=require(_0xde20('0x4'));var db=require(_0xde20('0x5'))['db'];var utils=require(_0xde20('0x6'));var logger=require(_0xde20('0x7'))(_0xde20('0x8'));var config=require(_0xde20('0x9'));var jayson=require(_0xde20('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xde20('0xb')]=_[_0xde20('0xc')](config['redis'],{'host':_0xde20('0xd'),'port':0x18eb});var socket=require(_0xde20('0xe'))(new Redis(config['redis']));require(_0xde20('0xf'))['register'](socket);function respondWithRpcPromise(_0x2e8eb0,_0x206def,_0x45e986){return new BPromise(function(_0x2a0298,_0x172e0d){return client['request'](_0x2e8eb0,_0x45e986)['then'](function(_0x2484c0){logger[_0xde20('0x10')]('SmsMessage,\x20%s,\x20%s',_0x206def,_0xde20('0x11'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x206def,'request\x20sent',JSON[_0xde20('0x12')](_0x2484c0));if(_0x2484c0['error']){if(_0x2484c0['error']['code']===0x1f4){logger[_0xde20('0x13')](_0xde20('0x14'),_0x206def,_0x2484c0[_0xde20('0x13')][_0xde20('0x15')]);return _0x172e0d(_0x2484c0['error'][_0xde20('0x15')]);}logger['error'](_0xde20('0x14'),_0x206def,_0x2484c0[_0xde20('0x13')][_0xde20('0x15')]);return _0x2a0298(_0x2484c0['error'][_0xde20('0x15')]);}else{logger[_0xde20('0x10')](_0xde20('0x14'),_0x206def,_0xde20('0x11'));_0x2a0298(_0x2484c0['result'][_0xde20('0x15')]);}})['catch'](function(_0x335941){logger['error']('SmsMessage,\x20%s,\x20%s',_0x206def,_0x335941);_0x172e0d(_0x335941);});});}exports[_0xde20('0x16')]=function(_0x4263e0){var _0x46a623=this;return new Promise(function(_0xb7bfb5,_0x36ea36){return db[_0xde20('0x17')][_0xde20('0x18')](_0x4263e0[_0xde20('0x19')],{'raw':_0x4263e0['options']?_0x4263e0['options'][_0xde20('0x1a')]===undefined?!![]:![]:!![]})[_0xde20('0x1b')](function(_0x216527){logger[_0xde20('0x10')]('CreateSmsMessage',_0x4263e0);logger[_0xde20('0x1c')](_0xde20('0x16'),_0x4263e0,JSON['stringify'](_0x216527));_0xb7bfb5(_0x216527);})[_0xde20('0x1d')](function(_0x198710){logger['error'](_0xde20('0x16'),_0x198710[_0xde20('0x15')],_0x4263e0);_0x36ea36(_0x46a623[_0xde20('0x13')](0x1f4,_0x198710[_0xde20('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 2bef5ae..2d082f1 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 _0x048f=['remove','update','emit','removeListener','register','save'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x048f,0x83));var _0xf048=function(_0x48e66b,_0x121508){_0x48e66b=_0x48e66b-0x0;var _0x43b55d=_0x048f[_0x48e66b];return _0x43b55d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xf048('0x0'),_0xf048('0x1'),_0xf048('0x2')];function createListener(_0x1af8d8,_0x3c903c){return function(_0x36c3c1){_0x3c903c[_0xf048('0x3')](_0x1af8d8,_0x36c3c1);};}function removeListener(_0x1bc3dc,_0xb6dd84){return function(){SmsMessageEvents[_0xf048('0x4')](_0x1bc3dc,_0xb6dd84);};}exports[_0xf048('0x5')]=function(_0x4b97aa){for(var _0x541aae=0x0,_0x309bad=events['length'];_0x541aae<_0x309bad;_0x541aae++){var _0x47fbcc=events[_0x541aae];var _0x52088d=createListener('smsMessage:'+_0x47fbcc,_0x4b97aa);SmsMessageEvents['on'](_0x47fbcc,_0x52088d);}}; \ No newline at end of file +var _0x1575=['./smsMessage.events','remove','emit','removeListener','register','smsMessage:'];(function(_0x1a7f18,_0x23b671){var _0x1709bc=function(_0x4a6648){while(--_0x4a6648){_0x1a7f18['push'](_0x1a7f18['shift']());}};_0x1709bc(++_0x23b671);}(_0x1575,0x9c));var _0x5157=function(_0x4652e3,_0x5348a7){_0x4652e3=_0x4652e3-0x0;var _0x1b55c1=_0x1575[_0x4652e3];return _0x1b55c1;};'use strict';var SmsMessageEvents=require(_0x5157('0x0'));var events=['save',_0x5157('0x1'),'update'];function createListener(_0x723453,_0xd293b9){return function(_0x54760d){_0xd293b9[_0x5157('0x2')](_0x723453,_0x54760d);};}function removeListener(_0x4213ef,_0x3b21ee){return function(){SmsMessageEvents[_0x5157('0x3')](_0x4213ef,_0x3b21ee);};}exports[_0x5157('0x4')]=function(_0x543f90){for(var _0x47f5ad=0x0,_0x5a61a2=events['length'];_0x47f5ad<_0x5a61a2;_0x47f5ad++){var _0x58a49d=events[_0x47f5ad];var _0x2eb9a6=createListener(_0x5157('0x5')+_0x58a49d,_0x543f90);SmsMessageEvents['on'](_0x58a49d,_0x2eb9a6);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 0fdeaa4..c70d053 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 _0xe505=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0xe505,0xff));var _0x5e50=function(_0x29b2d0,_0x73bf4b){_0x29b2d0=_0x29b2d0-0x0;var _0x4af937=_0xe505[_0x29b2d0];return _0x4af937;};'use strict';var multer=require(_0x5e50('0x0'));var util=require('util');var path=require(_0x5e50('0x1'));var timeout=require('connect-timeout');var express=require(_0x5e50('0x2'));var router=express[_0x5e50('0x3')]();var fs_extra=require(_0x5e50('0x4'));var auth=require(_0x5e50('0x5'));var interaction=require(_0x5e50('0x6'));var config=require(_0x5e50('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x5e50('0x8')](),controller[_0x5e50('0x9')]);router[_0x5e50('0xa')](_0x5e50('0xb'),auth['isAuthenticated'](),controller[_0x5e50('0xc')]);router['get'](_0x5e50('0xd'),auth[_0x5e50('0x8')](),controller[_0x5e50('0xe')]);router[_0x5e50('0xa')]('/:id/members',auth[_0x5e50('0x8')](),controller['getMembers']);router['get'](_0x5e50('0xf'),auth['isAuthenticated'](),controller[_0x5e50('0x10')]);router[_0x5e50('0xa')](_0x5e50('0x11'),auth[_0x5e50('0x8')](),controller[_0x5e50('0x12')]);router[_0x5e50('0x13')]('/',auth[_0x5e50('0x8')](),controller[_0x5e50('0x14')]);router['post'](_0x5e50('0xf'),auth[_0x5e50('0x8')](),controller[_0x5e50('0x15')]);router[_0x5e50('0x13')]('/:id/users',auth[_0x5e50('0x8')](),controller[_0x5e50('0x16')]);router[_0x5e50('0x17')]('/:id',auth[_0x5e50('0x8')](),controller['update']);router[_0x5e50('0x18')](_0x5e50('0xd'),auth[_0x5e50('0x8')](),controller[_0x5e50('0x19')]);router[_0x5e50('0x18')](_0x5e50('0xf'),auth[_0x5e50('0x8')](),controller[_0x5e50('0x1a')]);router[_0x5e50('0x18')](_0x5e50('0x11'),auth['isAuthenticated'](),controller[_0x5e50('0x1b')]);module[_0x5e50('0x1c')]=router; \ No newline at end of file +var _0x0763=['isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','destroy','removeTeams','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get'];(function(_0x379178,_0x28e964){var _0x3b191c=function(_0x1ff220){while(--_0x1ff220){_0x379178['push'](_0x379178['shift']());}};_0x3b191c(++_0x28e964);}(_0x0763,0x88));var _0x3076=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x0763[_0x495b3d];return _0x4cb329;};'use strict';var multer=require(_0x3076('0x0'));var util=require('util');var path=require(_0x3076('0x1'));var timeout=require(_0x3076('0x2'));var express=require(_0x3076('0x3'));var router=express[_0x3076('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3076('0x5'));var config=require(_0x3076('0x6'));var controller=require(_0x3076('0x7'));router[_0x3076('0x8')]('/',auth[_0x3076('0x9')](),controller[_0x3076('0xa')]);router['get'](_0x3076('0xb'),auth[_0x3076('0x9')](),controller[_0x3076('0xc')]);router[_0x3076('0x8')]('/:id',auth[_0x3076('0x9')](),controller[_0x3076('0xd')]);router['get'](_0x3076('0xe'),auth[_0x3076('0x9')](),controller[_0x3076('0xf')]);router['get'](_0x3076('0x10'),auth[_0x3076('0x9')](),controller[_0x3076('0x11')]);router[_0x3076('0x8')](_0x3076('0x12'),auth[_0x3076('0x9')](),controller[_0x3076('0x13')]);router[_0x3076('0x14')]('/',auth[_0x3076('0x9')](),controller[_0x3076('0x15')]);router[_0x3076('0x14')](_0x3076('0x10'),auth[_0x3076('0x9')](),controller[_0x3076('0x16')]);router['post'](_0x3076('0x12'),auth[_0x3076('0x9')](),controller['addAgents']);router[_0x3076('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3076('0x18')]);router['delete'](_0x3076('0x10'),auth['isAuthenticated'](),controller[_0x3076('0x19')]);router[_0x3076('0x1a')](_0x3076('0x12'),auth[_0x3076('0x9')](),controller[_0x3076('0x1b')]);module[_0x3076('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 412479e..7c8da46 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 _0x6768=['ENUM','rrmemory','sequelize','exports','name','STRING','INTEGER'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x6768,0x1bb));var _0x8676=function(_0x1d4b04,_0x24d309){_0x1d4b04=_0x1d4b04-0x0;var _0x67d764=_0x6768[_0x1d4b04];return _0x67d764;};'use strict';var Sequelize=require(_0x8676('0x0'));module[_0x8676('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8676('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8676('0x3')]},'timeout':{'type':Sequelize[_0x8676('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8676('0x5')](_0x8676('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x2e19=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING'];(function(_0x23deb6,_0x2b4d1f){var _0x5ce9a7=function(_0x5f0e01){while(--_0x5f0e01){_0x23deb6['push'](_0x23deb6['shift']());}};_0x5ce9a7(++_0x2b4d1f);}(_0x2e19,0x194));var _0x92e1=function(_0x335132,_0x34604b){_0x335132=_0x335132-0x0;var _0x371e5d=_0x2e19[_0x335132];return _0x371e5d;};'use strict';var Sequelize=require(_0x92e1('0x0'));module[_0x92e1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x92e1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x92e1('0x3')]},'timeout':{'type':Sequelize[_0x92e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x92e1('0x5'),_0x92e1('0x6'),_0x92e1('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 70c530d..17bbec6 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 _0x30ad=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserSmsQueue','SmsQueueId','findAll','User','UserId','updatedAt','createdAt','rows','%s/%s','SIP','smsPause','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','transaction','removeTeams','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','catch','params','keys','fields','find','create','body','role','user','UserProfileSection','autoAssociation'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x30ad,0xb7));var _0xd30a=function(_0x3db495,_0x391f6b){_0x3db495=_0x3db495-0x0;var _0x5a1017=_0x30ad[_0x3db495];return _0x5a1017;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd30a('0x0'));var jsonpatch=require(_0xd30a('0x1'));var rp=require(_0xd30a('0x2'));var moment=require('moment');var BPromise=require(_0xd30a('0x3'));var Mustache=require(_0xd30a('0x4'));var util=require('util');var path=require(_0xd30a('0x5'));var sox=require(_0xd30a('0x6'));var csv=require(_0xd30a('0x7'));var ejs=require(_0xd30a('0x8'));var fs=require('fs');var fs_extra=require(_0xd30a('0x9'));var _=require('lodash');var squel=require(_0xd30a('0xa'));var crypto=require(_0xd30a('0xb'));var jsforce=require(_0xd30a('0xc'));var deskjs=require(_0xd30a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd30a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd30a('0xf'));var hardwareService=require(_0xd30a('0x10'));var logger=require(_0xd30a('0x11'))(_0xd30a('0x12'));var utils=require(_0xd30a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd30a('0x14'));var db=require('../../mysqldb')['db'];config[_0xd30a('0x15')]=_[_0xd30a('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd30a('0x17'))(new Redis(config['redis']));require(_0xd30a('0x18'))[_0xd30a('0x19')](socket);function respondWithStatusCode(_0x5b7020,_0x20c072){_0x20c072=_0x20c072||0xcc;return function(_0xc545aa){if(_0xc545aa){return _0x5b7020[_0xd30a('0x1a')](_0x20c072);}return _0x5b7020['status'](_0x20c072)[_0xd30a('0x1b')]();};}function respondWithResult(_0xdb4cda,_0x59e89d){_0x59e89d=_0x59e89d||0xc8;return function(_0xced212){if(_0xced212){return _0xdb4cda[_0xd30a('0x1c')](_0x59e89d)['json'](_0xced212);}};}function respondWithFilteredResult(_0x1f7231,_0x3bd89c){return function(_0x11cced){if(_0x11cced){var _0x3ff963=typeof _0x3bd89c[_0xd30a('0x1d')]===_0xd30a('0x1e')&&typeof _0x3bd89c[_0xd30a('0x1f')]===_0xd30a('0x1e');var _0x3933c9=_0x11cced[_0xd30a('0x20')];var _0x241e7c=_0x3ff963?0x0:_0x3bd89c[_0xd30a('0x1d')];var _0x2870c2=_0x3ff963?_0x11cced['count']:_0x3bd89c[_0xd30a('0x1d')]+_0x3bd89c[_0xd30a('0x1f')];var _0x3b5603;if(_0x2870c2>=_0x3933c9){_0x2870c2=_0x3933c9;_0x3b5603=0xc8;}else{_0x3b5603=0xce;}_0x1f7231[_0xd30a('0x1c')](_0x3b5603);return _0x1f7231[_0xd30a('0x21')](_0xd30a('0x22'),_0x241e7c+'-'+_0x2870c2+'/'+_0x3933c9)['json'](_0x11cced);}return null;};}function patchUpdates(_0x593cd1){return function(_0x87b97a){try{jsonpatch[_0xd30a('0x23')](_0x87b97a,_0x593cd1,!![]);}catch(_0x2eeadc){return BPromise[_0xd30a('0x24')](_0x2eeadc);}return _0x87b97a[_0xd30a('0x25')]();};}function saveUpdates(_0x300b86,_0x2fb43c){return function(_0x216109){if(_0x216109){return _0x216109['update'](_0x300b86)['then'](function(_0x3360cd){return _0x3360cd;});}return null;};}function removeEntity(_0xcb87be,_0xadd3a0){return function(_0x27c702){if(_0x27c702){return _0x27c702[_0xd30a('0x26')]()[_0xd30a('0x27')](function(){var _0x4cfcb7=_0x27c702[_0xd30a('0x28')]({'plain':!![]});var _0xf8512e=_0xd30a('0x29');return db[_0xd30a('0x2a')][_0xd30a('0x26')]({'where':{'type':_0xf8512e,'resourceId':_0x4cfcb7['id']}})['then'](function(){return _0x27c702;});})[_0xd30a('0x27')](function(){_0xcb87be[_0xd30a('0x1c')](0xcc)[_0xd30a('0x1b')]();});}};}function handleEntityNotFound(_0x1da005,_0x126ad7){return function(_0x4283c7){if(!_0x4283c7){_0x1da005[_0xd30a('0x1a')](0x194);}return _0x4283c7;};}function handleError(_0x4c7859,_0x4dfee7){_0x4dfee7=_0x4dfee7||0x1f4;return function(_0x3eb367){logger[_0xd30a('0x2b')](_0x3eb367['stack']);if(_0x3eb367[_0xd30a('0x2c')]){delete _0x3eb367['name'];}_0x4c7859['status'](_0x4dfee7)[_0xd30a('0x2d')](_0x3eb367);};}exports['index']=function(_0xe28979,_0xd8eff0){var _0x34d89f={},_0x5969b3={},_0x29891c={'count':0x0,'rows':[]};var _0x234a9b=_[_0xd30a('0x2e')](db['SmsQueue'][_0xd30a('0x2f')],function(_0x3e0c4c){return{'name':_0x3e0c4c[_0xd30a('0x30')],'type':_0x3e0c4c[_0xd30a('0x31')][_0xd30a('0x32')]};});_0x5969b3[_0xd30a('0x33')]=_[_0xd30a('0x2e')](_0x234a9b,'name');_0x5969b3[_0xd30a('0x34')]=_['keys'](_0xe28979['query']);_0x5969b3[_0xd30a('0x35')]=_['intersection'](_0x5969b3[_0xd30a('0x33')],_0x5969b3[_0xd30a('0x34')]);_0x34d89f[_0xd30a('0x36')]=_[_0xd30a('0x37')](_0x5969b3['model'],qs['fields'](_0xe28979['query']['fields']));_0x34d89f['attributes']=_0x34d89f['attributes'][_0xd30a('0x38')]?_0x34d89f[_0xd30a('0x36')]:_0x5969b3[_0xd30a('0x33')];if(!_0xe28979['query'][_0xd30a('0x39')](_0xd30a('0x3a'))){_0x34d89f[_0xd30a('0x1f')]=qs[_0xd30a('0x1f')](_0xe28979[_0xd30a('0x34')]['limit']);_0x34d89f[_0xd30a('0x1d')]=qs[_0xd30a('0x1d')](_0xe28979[_0xd30a('0x34')]['offset']);}_0x34d89f[_0xd30a('0x3b')]=qs['sort'](_0xe28979[_0xd30a('0x34')][_0xd30a('0x3c')]);_0x34d89f[_0xd30a('0x3d')]=qs[_0xd30a('0x35')](_[_0xd30a('0x3e')](_0xe28979[_0xd30a('0x34')],_0x5969b3['filters']),_0x234a9b);if(_0xe28979[_0xd30a('0x34')][_0xd30a('0x3f')]){_0x34d89f[_0xd30a('0x3d')]=_[_0xd30a('0x40')](_0x34d89f['where'],{'$or':_[_0xd30a('0x2e')](_0x234a9b,function(_0x1d2394){if(_0x1d2394[_0xd30a('0x31')]!==_0xd30a('0x41')){var _0x2b2d00={};_0x2b2d00[_0x1d2394[_0xd30a('0x2c')]]={'$like':'%'+_0xe28979[_0xd30a('0x34')][_0xd30a('0x3f')]+'%'};return _0x2b2d00;}})});}_0x34d89f=_[_0xd30a('0x40')]({},_0x34d89f,_0xe28979[_0xd30a('0x42')]);var _0x4b2bc1={'where':_0x34d89f[_0xd30a('0x3d')]};return db[_0xd30a('0x43')][_0xd30a('0x20')](_0x4b2bc1)[_0xd30a('0x27')](function(_0x543ca3){_0x29891c[_0xd30a('0x20')]=_0x543ca3;if(_0xe28979[_0xd30a('0x34')][_0xd30a('0x44')]){_0x34d89f[_0xd30a('0x45')]=[{'all':!![]}];}return db[_0xd30a('0x43')]['findAll'](_0x34d89f);})[_0xd30a('0x27')](function(_0x47d297){_0x29891c['rows']=_0x47d297;return _0x29891c;})[_0xd30a('0x27')](respondWithFilteredResult(_0xd8eff0,_0x34d89f))[_0xd30a('0x46')](handleError(_0xd8eff0,null));};exports['show']=function(_0xc68137,_0x430070){var _0x67a4c4={'raw':!![],'where':{'id':_0xc68137[_0xd30a('0x47')]['id']}},_0x259fa4={};_0x259fa4[_0xd30a('0x33')]=_[_0xd30a('0x48')](db[_0xd30a('0x43')][_0xd30a('0x2f')]);_0x259fa4[_0xd30a('0x34')]=_[_0xd30a('0x48')](_0xc68137[_0xd30a('0x34')]);_0x259fa4[_0xd30a('0x35')]=_['intersection'](_0x259fa4[_0xd30a('0x33')],_0x259fa4[_0xd30a('0x34')]);_0x67a4c4[_0xd30a('0x36')]=_['intersection'](_0x259fa4[_0xd30a('0x33')],qs[_0xd30a('0x49')](_0xc68137['query']['fields']));_0x67a4c4[_0xd30a('0x36')]=_0x67a4c4[_0xd30a('0x36')][_0xd30a('0x38')]?_0x67a4c4[_0xd30a('0x36')]:_0x259fa4[_0xd30a('0x33')];if(_0xc68137['query'][_0xd30a('0x44')]){_0x67a4c4[_0xd30a('0x45')]=[{'all':!![]}];}_0x67a4c4=_[_0xd30a('0x40')]({},_0x67a4c4,_0xc68137['options']);return db[_0xd30a('0x43')][_0xd30a('0x4a')](_0x67a4c4)[_0xd30a('0x27')](handleEntityNotFound(_0x430070,null))[_0xd30a('0x27')](respondWithResult(_0x430070,null))['catch'](handleError(_0x430070,null));};exports[_0xd30a('0x4b')]=function(_0x3d3035,_0x492d99){return db[_0xd30a('0x43')][_0xd30a('0x4b')](_0x3d3035[_0xd30a('0x4c')],{})[_0xd30a('0x27')](function(_0x3e5992){var _0xa3db4d=_0x3d3035['user'][_0xd30a('0x28')]({'plain':!![]});if(!_0xa3db4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa3db4d[_0xd30a('0x4d')]===_0xd30a('0x4e')){var _0x94955f=_0x3e5992['get']({'plain':!![]});var _0x3274aa=_0xd30a('0x29');return db[_0xd30a('0x4f')][_0xd30a('0x4a')]({'where':{'name':_0x3274aa,'userProfileId':_0xa3db4d['userProfileId']},'raw':!![]})[_0xd30a('0x27')](function(_0x3d92cc){if(_0x3d92cc&&_0x3d92cc[_0xd30a('0x50')]===0x0){return db[_0xd30a('0x2a')]['create']({'name':_0x94955f[_0xd30a('0x2c')],'resourceId':_0x94955f['id'],'type':_0x3d92cc[_0xd30a('0x2c')],'sectionId':_0x3d92cc['id']},{})[_0xd30a('0x27')](function(){return _0x3e5992;});}else{return _0x3e5992;}})[_0xd30a('0x46')](function(_0x67ffec){logger['error'](_0xd30a('0x51'),_0x67ffec);throw _0x67ffec;});}return _0x3e5992;})[_0xd30a('0x27')](respondWithResult(_0x492d99,0xc9))['catch'](handleError(_0x492d99,null));};exports[_0xd30a('0x52')]=function(_0x1a6857,_0x127314){if(_0x1a6857[_0xd30a('0x4c')]['id']){delete _0x1a6857['body']['id'];}return db[_0xd30a('0x43')][_0xd30a('0x4a')]({'where':{'id':_0x1a6857[_0xd30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x127314,null))[_0xd30a('0x27')](saveUpdates(_0x1a6857[_0xd30a('0x4c')],null))['then'](respondWithResult(_0x127314,null))[_0xd30a('0x46')](handleError(_0x127314,null));};exports[_0xd30a('0x26')]=function(_0x168c65,_0x5b2c05){return db[_0xd30a('0x43')]['find']({'where':{'id':_0x168c65[_0xd30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2c05,null))[_0xd30a('0x27')](removeEntity(_0x5b2c05,null))[_0xd30a('0x46')](handleError(_0x5b2c05,null));};exports[_0xd30a('0x53')]=function(_0x3980fa,_0x1e43ef){return db[_0xd30a('0x43')]['describe']()[_0xd30a('0x27')](respondWithResult(_0x1e43ef,null))[_0xd30a('0x46')](handleError(_0x1e43ef,null));};exports[_0xd30a('0x54')]=function(_0x498700,_0x17790b,_0x311882){var _0x22f378={'raw':!![],'where':{}},_0x25fde6={},_0x20ce78;return db[_0xd30a('0x43')]['findOne']({'where':{'id':_0x498700[_0xd30a('0x47')]['id']}})[_0xd30a('0x27')](handleEntityNotFound(_0x17790b,null))['then'](function(_0x1701e5){if(_0x1701e5){_0x20ce78=_0x1701e5[_0xd30a('0x28')]({'plain':!![]});_0x25fde6['model']=_[_0xd30a('0x48')](db[_0xd30a('0x55')]['rawAttributes']);_0x25fde6[_0xd30a('0x34')]=_[_0xd30a('0x48')](_0x498700['query']);_0x25fde6[_0xd30a('0x35')]=_[_0xd30a('0x37')](_0x25fde6['model'],_0x25fde6[_0xd30a('0x34')]);_0x22f378[_0xd30a('0x36')]=_['intersection'](_0x25fde6[_0xd30a('0x33')],qs[_0xd30a('0x49')](_0x498700[_0xd30a('0x34')][_0xd30a('0x49')]));_0x22f378[_0xd30a('0x36')]=_0x22f378['attributes']['length']?_0x22f378[_0xd30a('0x36')]:_0x25fde6[_0xd30a('0x33')];if(!_0x498700['query'][_0xd30a('0x39')]('nolimit')){_0x22f378[_0xd30a('0x1f')]=qs[_0xd30a('0x1f')](_0x498700[_0xd30a('0x34')][_0xd30a('0x1f')]);_0x22f378['offset']=qs['offset'](_0x498700[_0xd30a('0x34')]['offset']);}_0x22f378[_0xd30a('0x3b')]=qs[_0xd30a('0x3c')](_0x498700['query'][_0xd30a('0x3c')]);_0x22f378[_0xd30a('0x3d')]=qs['filters'](_[_0xd30a('0x3e')](_0x498700[_0xd30a('0x34')],_0x25fde6[_0xd30a('0x35')]));_0x22f378[_0xd30a('0x3d')][_0xd30a('0x56')]=_0x1701e5['id'];if(_0x498700['query']['filter']){_0x22f378['where']=_[_0xd30a('0x40')](_0x22f378['where'],{'$or':_[_0xd30a('0x2e')](_0x22f378[_0xd30a('0x36')],function(_0x369c2b){var _0x2695cc={};_0x2695cc[_0x369c2b]={'$like':'%'+_0x498700[_0xd30a('0x34')]['filter']+'%'};return _0x2695cc;})});}_0x22f378=_[_0xd30a('0x40')]({},_0x22f378,_0x498700[_0xd30a('0x42')]);return db['UserSmsQueue'][_0xd30a('0x57')](_0x22f378);}})[_0xd30a('0x27')](function(_0x27a2c8){if(_0x27a2c8){return db[_0xd30a('0x58')]['findAndCountAll']({'where':{'id':_[_0xd30a('0x2e')](_0x27a2c8,_0xd30a('0x59')),'role':'agent'},'attributes':['id',_0xd30a('0x2c'),'smsPause',_0xd30a('0x5a'),_0xd30a('0x5b')]});}})[_0xd30a('0x27')](function(_0x26181c){if(_0x26181c){return{'count':_0x26181c[_0xd30a('0x20')],'rows':_[_0xd30a('0x2e')](_0x26181c[_0xd30a('0x5c')],function(_0x462feb){return{'membername':_0x462feb[_0xd30a('0x2c')],'UserId':_0x462feb['id'],'queue_name':_0x20ce78[_0xd30a('0x2c')],'SmsQueueId':_0x20ce78['id'],'interface':util['format'](_0xd30a('0x5d'),_0xd30a('0x5e'),_0x462feb[_0xd30a('0x2c')]),'penalty':0x0,'paused':_0x462feb[_0xd30a('0x5f')],'createdAt':_0x462feb['createdAt'],'updatedAt':_0x462feb[_0xd30a('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17790b,_0x22f378))['catch'](handleError(_0x17790b,null));};exports[_0xd30a('0x60')]=function(_0x4a1f41,_0x20bc9c,_0x1ec352){var _0x13fdc1={};var _0x26f9b2={};var _0x5da985;var _0xb3bacc;return db['SmsQueue'][_0xd30a('0x61')]({'where':{'id':_0x4a1f41[_0xd30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x20bc9c,null))['then'](function(_0x4b648a){if(_0x4b648a){_0x5da985=_0x4b648a;_0x26f9b2[_0xd30a('0x33')]=_[_0xd30a('0x48')](db[_0xd30a('0x62')]['rawAttributes']);_0x26f9b2[_0xd30a('0x34')]=_[_0xd30a('0x48')](_0x4a1f41[_0xd30a('0x34')]);_0x26f9b2[_0xd30a('0x35')]=_[_0xd30a('0x37')](_0x26f9b2[_0xd30a('0x33')],_0x26f9b2[_0xd30a('0x34')]);_0x13fdc1[_0xd30a('0x36')]=_[_0xd30a('0x37')](_0x26f9b2[_0xd30a('0x33')],qs['fields'](_0x4a1f41['query']['fields']));_0x13fdc1[_0xd30a('0x36')]=_0x13fdc1[_0xd30a('0x36')][_0xd30a('0x38')]?_0x13fdc1[_0xd30a('0x36')]:_0x26f9b2['model'];_0x13fdc1['order']=qs[_0xd30a('0x3c')](_0x4a1f41[_0xd30a('0x34')][_0xd30a('0x3c')]);_0x13fdc1['where']=qs[_0xd30a('0x35')](_[_0xd30a('0x3e')](_0x4a1f41[_0xd30a('0x34')],_0x26f9b2[_0xd30a('0x35')]));if(_0x4a1f41['query'][_0xd30a('0x3f')]){_0x13fdc1['where']=_[_0xd30a('0x40')](_0x13fdc1['where'],{'$or':_['map'](_0x13fdc1[_0xd30a('0x36')],function(_0x170dab){var _0x5c553f={};_0x5c553f[_0x170dab]={'$like':'%'+_0x4a1f41[_0xd30a('0x34')][_0xd30a('0x3f')]+'%'};return _0x5c553f;})});}_0x13fdc1=_[_0xd30a('0x40')]({},_0x13fdc1,_0x4a1f41['options']);return _0x5da985['getTeams'](_0x13fdc1);}})['then'](function(_0x12c973){if(_0x12c973){_0xb3bacc=_0x12c973['length'];if(!_0x4a1f41[_0xd30a('0x34')][_0xd30a('0x39')](_0xd30a('0x3a'))){_0x13fdc1[_0xd30a('0x1f')]=qs[_0xd30a('0x1f')](_0x4a1f41[_0xd30a('0x34')]['limit']);_0x13fdc1[_0xd30a('0x1d')]=qs['offset'](_0x4a1f41[_0xd30a('0x34')][_0xd30a('0x1d')]);}return _0x5da985['getTeams'](_0x13fdc1);}})[_0xd30a('0x27')](function(_0x495e53){if(_0x495e53){return _0x495e53?{'count':_0xb3bacc,'rows':_0x495e53}:null;}})['then'](respondWithResult(_0x20bc9c,null))[_0xd30a('0x46')](handleError(_0x20bc9c,null));};exports['addTeams']=function(_0x1667a5,_0x8c2001,_0x596b26){var _0x36c477=_0x1667a5[_0xd30a('0x4c')][_0xd30a('0x63')];return db[_0xd30a('0x62')][_0xd30a('0x57')]({'where':{'id':_0x36c477},'attributes':['id'],'include':[{'model':db[_0xd30a('0x58')],'as':_0xd30a('0x64'),'attributes':['id',_0xd30a('0x2c'),_0xd30a('0x65'),_0xd30a('0x66'),_0xd30a('0x67')],'raw':!![]}]})[_0xd30a('0x27')](function(_0x36d152){if(_0x36d152){var _0x1ba070=_[_0xd30a('0x68')](_0x36d152,function(_0x1f02d6){var _0x428785=_0x1f02d6[_0xd30a('0x28')]({'plain':!![]});return _0x428785[_0xd30a('0x64')];});return db['SmsQueue'][_0xd30a('0x4a')]({'where':{'id':_0x1667a5[_0xd30a('0x47')]['id']}})[_0xd30a('0x27')](function(_0x4bc80c){return db[_0xd30a('0x69')]['transaction'](function(_0x4fccc1){return _0x4bc80c[_0xd30a('0x6a')](_0x36c477,{'transaction':_0x4fccc1})[_0xd30a('0x27')](function(){return BPromise['each'](_0x1ba070,function(_0x12bb13){return db[_0xd30a('0x55')]['findOrCreate']({'where':{'UserId':_0x12bb13['id'],'SmsQueueId':_0x1667a5['params']['id']},'transaction':_0x4fccc1});});})[_0xd30a('0x27')](function(){_0x1ba070[_0xd30a('0x6b')](function(_0x588274){socket[_0xd30a('0x6c')](_0xd30a('0x6d'),{'UserId':_0x588274['id'],'SmsQueueId':_0x4bc80c['id']});});});});});}})[_0xd30a('0x27')](respondWithStatusCode(_0x8c2001,null))[_0xd30a('0x46')](handleError(_0x8c2001,null));};exports['removeTeams']=function(_0x320202,_0x28c13d,_0x42ea13){return db[_0xd30a('0x62')][_0xd30a('0x57')]({'where':{'id':_0x320202[_0xd30a('0x34')][_0xd30a('0x63')]},'attributes':['id'],'include':[{'model':db[_0xd30a('0x58')],'as':_0xd30a('0x64'),'attributes':['id'],'raw':!![]}]})[_0xd30a('0x27')](handleEntityNotFound(_0x28c13d,null))[_0xd30a('0x27')](function(_0x51c6d2){var _0x34e962=_[_0xd30a('0x2e')](_0x51c6d2,'id');var _0x2fe564=[];var _0x36eac7=[];var _0x5887b5=squel[_0xd30a('0x6e')]();_0x5887b5[_0xd30a('0x6f')](_0xd30a('0x70'))[_0xd30a('0x71')](_0xd30a('0x72'),'tq')['join'](_0xd30a('0x73'),'ut',_0xd30a('0x74'))[_0xd30a('0x3d')]('SmsQueueId\x20=\x20?',_0x320202[_0xd30a('0x47')]['id']);for(var _0x33c497=0x0;_0x33c497<_0x51c6d2[_0xd30a('0x38')];_0x33c497+=0x1){let _0x246b81=_0x51c6d2[_0x33c497];for(var _0x189fd2=0x0;_0x189fd2<_0x246b81[_0xd30a('0x64')][_0xd30a('0x38')];_0x189fd2+=0x1){let _0x4bf1a1=_0x246b81[_0xd30a('0x64')][_0x189fd2];var _0x29f648=_0x5887b5['clone']();_0x29f648[_0xd30a('0x3d')](_0xd30a('0x75'),_0x4bf1a1['id']);_0x36eac7[_0xd30a('0x76')](db[_0xd30a('0x69')][_0xd30a('0x34')](_0x29f648['toString'](),{'type':db['sequelize'][_0xd30a('0x77')]['SELECT']})['then'](function(_0x213d01){if(_0x213d01['length']===0x1){return _0x4bf1a1['id'];}else{var _0x472d26=_[_0xd30a('0x78')](_[_0xd30a('0x2e')](_0x213d01,_0xd30a('0x79')),function(_0x5c53a0){return _['includes'](_0x34e962,_0x5c53a0);});if(_0x472d26){return _0x4bf1a1['id'];}}}));}}return BPromise['all'](_0x36eac7)[_0xd30a('0x27')](function(_0x4b18c8){_0x2fe564=_(_0x2fe564)[_0xd30a('0x7a')](_0x4b18c8)['compact']()[_0xd30a('0x7b')]();return db[_0xd30a('0x43')][_0xd30a('0x4a')]({'where':{'id':_0x320202[_0xd30a('0x47')]['id']}})[_0xd30a('0x27')](function(_0x5ed01c){return db[_0xd30a('0x69')][_0xd30a('0x7c')](function(_0x2089e1){return _0x5ed01c[_0xd30a('0x7d')](_0x320202[_0xd30a('0x34')][_0xd30a('0x63')],{'transaction':_0x2089e1})[_0xd30a('0x27')](function(){if(!_[_0xd30a('0x7e')](_0x2fe564)){return _0x5ed01c[_0xd30a('0x7f')](_0x2fe564,{'transaction':_0x2089e1});}})[_0xd30a('0x27')](function(){_0x2fe564[_0xd30a('0x6b')](function(_0x4797b5){socket[_0xd30a('0x6c')](_0xd30a('0x80'),{'UserId':_0x4797b5,'SmsQueueId':_0x5ed01c['id']});});});});});});})[_0xd30a('0x27')](respondWithStatusCode(_0x28c13d,null))['catch'](handleError(_0x28c13d,null));};exports[_0xd30a('0x81')]=function(_0x1030ab,_0x257879,_0x49adec){return db[_0xd30a('0x43')][_0xd30a('0x4a')]({'where':{'id':_0x1030ab[_0xd30a('0x47')]['id']}})[_0xd30a('0x27')](handleEntityNotFound(_0x257879,null))[_0xd30a('0x27')](function(_0x109ce1){if(_0x109ce1){return _0x109ce1[_0xd30a('0x81')](_0x1030ab[_0xd30a('0x4c')][_0xd30a('0x63')],_['omit'](_0x1030ab[_0xd30a('0x4c')],[_0xd30a('0x63'),'id'])||{})[_0xd30a('0x82')](function(_0x1e3bf9){for(var _0x23d050=0x0;_0x23d050<_0x1030ab['body'][_0xd30a('0x63')][_0xd30a('0x38')];_0x23d050+=0x1){socket[_0xd30a('0x6c')](_0xd30a('0x6d'),{'UserId':Number(_0x1030ab['body'][_0xd30a('0x63')][_0x23d050]),'SmsQueueId':Number(_0x1030ab[_0xd30a('0x47')]['id'])});}return _0x1e3bf9;});}})[_0xd30a('0x27')](respondWithResult(_0x257879,null))[_0xd30a('0x46')](handleError(_0x257879,null));};exports[_0xd30a('0x7f')]=function(_0x2e5030,_0x3b5768,_0x4d9e5d){return db[_0xd30a('0x43')][_0xd30a('0x4a')]({'where':{'id':_0x2e5030['params']['id']}})[_0xd30a('0x27')](handleEntityNotFound(_0x3b5768,null))[_0xd30a('0x27')](function(_0x5d3a62){if(_0x5d3a62){return _0x5d3a62[_0xd30a('0x7f')](_0x2e5030[_0xd30a('0x34')][_0xd30a('0x63')])[_0xd30a('0x27')](function(){if(_['isArray'](_0x2e5030[_0xd30a('0x34')][_0xd30a('0x63')])){for(var _0x340206=0x0;_0x340206<_0x2e5030[_0xd30a('0x34')][_0xd30a('0x63')][_0xd30a('0x38')];_0x340206+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x2e5030[_0xd30a('0x34')]['ids'][_0x340206]),'SmsQueueId':Number(_0x2e5030[_0xd30a('0x47')]['id'])});}}else{socket[_0xd30a('0x6c')](_0xd30a('0x80'),{'UserId':Number(_0x2e5030[_0xd30a('0x34')]['ids']),'SmsQueueId':Number(_0x2e5030[_0xd30a('0x47')]['id'])});}});}})[_0xd30a('0x27')](respondWithStatusCode(_0x3b5768,null))['catch'](handleError(_0x3b5768,null));};exports['getAgents']=function(_0x5b75ff,_0x5e2d36,_0x7e67a1){var _0x557f06={};var _0x380e51={};var _0x5394fd;var _0x5bc441;return db[_0xd30a('0x43')][_0xd30a('0x61')]({'where':{'id':_0x5b75ff[_0xd30a('0x47')]['id']}})[_0xd30a('0x27')](handleEntityNotFound(_0x5e2d36,null))[_0xd30a('0x27')](function(_0x1991cb){if(_0x1991cb){_0x5394fd=_0x1991cb;_0x380e51[_0xd30a('0x33')]=_['keys'](db[_0xd30a('0x58')]['rawAttributes']);_0x380e51[_0xd30a('0x34')]=_['keys'](_0x5b75ff[_0xd30a('0x34')]);_0x380e51['filters']=_['intersection'](_0x380e51[_0xd30a('0x33')],_0x380e51['query']);_0x557f06[_0xd30a('0x36')]=_[_0xd30a('0x37')](_0x380e51[_0xd30a('0x33')],qs[_0xd30a('0x49')](_0x5b75ff[_0xd30a('0x34')][_0xd30a('0x49')]));_0x557f06[_0xd30a('0x36')]=_0x557f06['attributes']['length']?_0x557f06[_0xd30a('0x36')]:_0x380e51[_0xd30a('0x33')];_0x557f06[_0xd30a('0x3b')]=qs[_0xd30a('0x3c')](_0x5b75ff[_0xd30a('0x34')]['sort']);_0x557f06[_0xd30a('0x3d')]=qs[_0xd30a('0x35')](_['pick'](_0x5b75ff[_0xd30a('0x34')],_0x380e51[_0xd30a('0x35')]));if(_0x5b75ff['query'][_0xd30a('0x3f')]){_0x557f06[_0xd30a('0x3d')]=_[_0xd30a('0x40')](_0x557f06[_0xd30a('0x3d')],{'$or':_[_0xd30a('0x2e')](_0x557f06['attributes'],function(_0x27acb9){var _0x335df7={};_0x335df7[_0x27acb9]={'$like':'%'+_0x5b75ff['query'][_0xd30a('0x3f')]+'%'};return _0x335df7;})});}_0x557f06=_[_0xd30a('0x40')]({},_0x557f06,_0x5b75ff[_0xd30a('0x42')]);return _0x5394fd[_0xd30a('0x83')](_0x557f06);}})[_0xd30a('0x27')](function(_0x5ae0d3){if(_0x5ae0d3){_0x5bc441=_0x5ae0d3[_0xd30a('0x38')];if(!_0x5b75ff[_0xd30a('0x34')][_0xd30a('0x39')](_0xd30a('0x3a'))){_0x557f06['limit']=qs[_0xd30a('0x1f')](_0x5b75ff[_0xd30a('0x34')][_0xd30a('0x1f')]);_0x557f06[_0xd30a('0x1d')]=qs[_0xd30a('0x1d')](_0x5b75ff[_0xd30a('0x34')][_0xd30a('0x1d')]);}return _0x5394fd[_0xd30a('0x83')](_0x557f06);}})[_0xd30a('0x27')](function(_0x5bcc46){if(_0x5bcc46){return _0x5bcc46?{'count':_0x5bc441,'rows':_0x5bcc46}:null;}})[_0xd30a('0x27')](respondWithResult(_0x5e2d36,null))[_0xd30a('0x46')](handleError(_0x5e2d36,null));}; \ No newline at end of file +var _0x24ee=['SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','all','union','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','end','error','stack','name','index','map','SmsQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','merge','options','where','includeAll','include','findAll','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','catch','describe','getMembers','UserSmsQueue','order','pick','User','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','interface','flatMap','each','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x24ee,0x1b2));var _0xe24e=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x24ee[_0x2fff83];return _0xa2a722;};'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(_0xe24e('0x0'));var moment=require(_0xe24e('0x1'));var BPromise=require(_0xe24e('0x2'));var Mustache=require(_0xe24e('0x3'));var util=require(_0xe24e('0x4'));var path=require(_0xe24e('0x5'));var sox=require(_0xe24e('0x6'));var csv=require(_0xe24e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe24e('0x8'));var _=require(_0xe24e('0x9'));var squel=require(_0xe24e('0xa'));var crypto=require(_0xe24e('0xb'));var jsforce=require(_0xe24e('0xc'));var deskjs=require(_0xe24e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe24e('0xe'));var Papa=require(_0xe24e('0xf'));var Redis=require('ioredis');var authService=require(_0xe24e('0x10'));var qs=require(_0xe24e('0x11'));var as=require(_0xe24e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe24e('0x13'))('api');var utils=require(_0xe24e('0x14'));var config=require(_0xe24e('0x15'));var licenseUtil=require(_0xe24e('0x16'));var db=require(_0xe24e('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe24e('0x18'))(new Redis(config['redis']));require(_0xe24e('0x19'))[_0xe24e('0x1a')](socket);function respondWithStatusCode(_0x4967e9,_0x1580f5){_0x1580f5=_0x1580f5||0xcc;return function(_0x61110a){if(_0x61110a){return _0x4967e9[_0xe24e('0x1b')](_0x1580f5);}return _0x4967e9[_0xe24e('0x1c')](_0x1580f5)['end']();};}function respondWithResult(_0x3aa137,_0x4ef24c){_0x4ef24c=_0x4ef24c||0xc8;return function(_0x2acc80){if(_0x2acc80){return _0x3aa137[_0xe24e('0x1c')](_0x4ef24c)[_0xe24e('0x1d')](_0x2acc80);}};}function respondWithFilteredResult(_0x175162,_0x252124){return function(_0x1b164d){if(_0x1b164d){var _0x33d59f=typeof _0x252124[_0xe24e('0x1e')]==='undefined'&&typeof _0x252124[_0xe24e('0x1f')]===_0xe24e('0x20');var _0x2e844c=_0x1b164d[_0xe24e('0x21')];var _0x4bb36b=_0x33d59f?0x0:_0x252124[_0xe24e('0x1e')];var _0x463fe7=_0x33d59f?_0x1b164d[_0xe24e('0x21')]:_0x252124[_0xe24e('0x1e')]+_0x252124[_0xe24e('0x1f')];var _0x2710b5;if(_0x463fe7>=_0x2e844c){_0x463fe7=_0x2e844c;_0x2710b5=0xc8;}else{_0x2710b5=0xce;}_0x175162[_0xe24e('0x1c')](_0x2710b5);return _0x175162[_0xe24e('0x22')](_0xe24e('0x23'),_0x4bb36b+'-'+_0x463fe7+'/'+_0x2e844c)[_0xe24e('0x1d')](_0x1b164d);}return null;};}function patchUpdates(_0x497d1f){return function(_0x15193c){try{jsonpatch[_0xe24e('0x24')](_0x15193c,_0x497d1f,!![]);}catch(_0x19ac7a){return BPromise[_0xe24e('0x25')](_0x19ac7a);}return _0x15193c[_0xe24e('0x26')]();};}function saveUpdates(_0xd1a30a,_0x3b5599){return function(_0x54818e){if(_0x54818e){return _0x54818e[_0xe24e('0x27')](_0xd1a30a)['then'](function(_0x1f845d){return _0x1f845d;});}return null;};}function removeEntity(_0x502a30,_0x3f1e0d){return function(_0x2f50d7){if(_0x2f50d7){return _0x2f50d7[_0xe24e('0x28')]()[_0xe24e('0x29')](function(){var _0x51b75c=_0x2f50d7[_0xe24e('0x2a')]({'plain':!![]});var _0x41daa2='SmsQueues';return db['UserProfileResource'][_0xe24e('0x28')]({'where':{'type':_0x41daa2,'resourceId':_0x51b75c['id']}})[_0xe24e('0x29')](function(){return _0x2f50d7;});})[_0xe24e('0x29')](function(){_0x502a30[_0xe24e('0x1c')](0xcc)[_0xe24e('0x2b')]();});}};}function handleEntityNotFound(_0x3e01c4,_0x5c3efc){return function(_0x42cdba){if(!_0x42cdba){_0x3e01c4['sendStatus'](0x194);}return _0x42cdba;};}function handleError(_0xe5559d,_0x11e0b6){_0x11e0b6=_0x11e0b6||0x1f4;return function(_0x56cbdb){logger[_0xe24e('0x2c')](_0x56cbdb[_0xe24e('0x2d')]);if(_0x56cbdb[_0xe24e('0x2e')]){delete _0x56cbdb[_0xe24e('0x2e')];}_0xe5559d[_0xe24e('0x1c')](_0x11e0b6)['send'](_0x56cbdb);};}exports[_0xe24e('0x2f')]=function(_0x1a3f09,_0x4c39f1){var _0x51ce81={},_0x575a91={},_0x39954d={'count':0x0,'rows':[]};var _0xb73a5c=_[_0xe24e('0x30')](db[_0xe24e('0x31')][_0xe24e('0x32')],function(_0xa6f433){return{'name':_0xa6f433['fieldName'],'type':_0xa6f433[_0xe24e('0x33')][_0xe24e('0x34')]};});_0x575a91[_0xe24e('0x35')]=_[_0xe24e('0x30')](_0xb73a5c,_0xe24e('0x2e'));_0x575a91[_0xe24e('0x36')]=_[_0xe24e('0x37')](_0x1a3f09[_0xe24e('0x36')]);_0x575a91[_0xe24e('0x38')]=_[_0xe24e('0x39')](_0x575a91[_0xe24e('0x35')],_0x575a91[_0xe24e('0x36')]);_0x51ce81['attributes']=_[_0xe24e('0x39')](_0x575a91[_0xe24e('0x35')],qs[_0xe24e('0x3a')](_0x1a3f09[_0xe24e('0x36')]['fields']));_0x51ce81['attributes']=_0x51ce81[_0xe24e('0x3b')]['length']?_0x51ce81['attributes']:_0x575a91[_0xe24e('0x35')];if(!_0x1a3f09[_0xe24e('0x36')][_0xe24e('0x3c')](_0xe24e('0x3d'))){_0x51ce81['limit']=qs[_0xe24e('0x1f')](_0x1a3f09[_0xe24e('0x36')][_0xe24e('0x1f')]);_0x51ce81[_0xe24e('0x1e')]=qs[_0xe24e('0x1e')](_0x1a3f09['query'][_0xe24e('0x1e')]);}_0x51ce81['order']=qs[_0xe24e('0x3e')](_0x1a3f09[_0xe24e('0x36')][_0xe24e('0x3e')]);_0x51ce81['where']=qs[_0xe24e('0x38')](_['pick'](_0x1a3f09['query'],_0x575a91[_0xe24e('0x38')]),_0xb73a5c);if(_0x1a3f09['query'][_0xe24e('0x3f')]){_0x51ce81['where']=_[_0xe24e('0x40')](_0x51ce81['where'],{'$or':_[_0xe24e('0x30')](_0xb73a5c,function(_0x45fb01){if(_0x45fb01[_0xe24e('0x33')]!=='VIRTUAL'){var _0x13e35b={};_0x13e35b[_0x45fb01[_0xe24e('0x2e')]]={'$like':'%'+_0x1a3f09[_0xe24e('0x36')]['filter']+'%'};return _0x13e35b;}})});}_0x51ce81=_['merge']({},_0x51ce81,_0x1a3f09[_0xe24e('0x41')]);var _0x1510a9={'where':_0x51ce81[_0xe24e('0x42')]};return db[_0xe24e('0x31')]['count'](_0x1510a9)[_0xe24e('0x29')](function(_0x3a6879){_0x39954d[_0xe24e('0x21')]=_0x3a6879;if(_0x1a3f09[_0xe24e('0x36')][_0xe24e('0x43')]){_0x51ce81[_0xe24e('0x44')]=[{'all':!![]}];}return db['SmsQueue'][_0xe24e('0x45')](_0x51ce81);})['then'](function(_0x498082){_0x39954d[_0xe24e('0x46')]=_0x498082;return _0x39954d;})['then'](respondWithFilteredResult(_0x4c39f1,_0x51ce81))['catch'](handleError(_0x4c39f1,null));};exports[_0xe24e('0x47')]=function(_0x595b7d,_0x40f393){var _0x1512ed={'raw':!![],'where':{'id':_0x595b7d['params']['id']}},_0x1c0d16={};_0x1c0d16[_0xe24e('0x35')]=_[_0xe24e('0x37')](db[_0xe24e('0x31')][_0xe24e('0x32')]);_0x1c0d16['query']=_[_0xe24e('0x37')](_0x595b7d[_0xe24e('0x36')]);_0x1c0d16[_0xe24e('0x38')]=_['intersection'](_0x1c0d16[_0xe24e('0x35')],_0x1c0d16['query']);_0x1512ed[_0xe24e('0x3b')]=_[_0xe24e('0x39')](_0x1c0d16[_0xe24e('0x35')],qs['fields'](_0x595b7d[_0xe24e('0x36')][_0xe24e('0x3a')]));_0x1512ed[_0xe24e('0x3b')]=_0x1512ed['attributes'][_0xe24e('0x48')]?_0x1512ed[_0xe24e('0x3b')]:_0x1c0d16[_0xe24e('0x35')];if(_0x595b7d[_0xe24e('0x36')][_0xe24e('0x43')]){_0x1512ed[_0xe24e('0x44')]=[{'all':!![]}];}_0x1512ed=_[_0xe24e('0x40')]({},_0x1512ed,_0x595b7d[_0xe24e('0x41')]);return db[_0xe24e('0x31')][_0xe24e('0x49')](_0x1512ed)['then'](handleEntityNotFound(_0x40f393,null))[_0xe24e('0x29')](respondWithResult(_0x40f393,null))['catch'](handleError(_0x40f393,null));};exports['create']=function(_0x118b0d,_0x4deed3){return db[_0xe24e('0x31')][_0xe24e('0x4a')](_0x118b0d[_0xe24e('0x4b')],{})[_0xe24e('0x29')](function(_0x3e8799){var _0x4df023=_0x118b0d[_0xe24e('0x4c')]['get']({'plain':!![]});if(!_0x4df023)throw new Error(_0xe24e('0x4d'));if(_0x4df023[_0xe24e('0x4e')]===_0xe24e('0x4c')){var _0x24c0ec=_0x3e8799[_0xe24e('0x2a')]({'plain':!![]});var _0x5d3a08=_0xe24e('0x4f');return db[_0xe24e('0x50')][_0xe24e('0x49')]({'where':{'name':_0x5d3a08,'userProfileId':_0x4df023['userProfileId']},'raw':!![]})['then'](function(_0x3fc78e){if(_0x3fc78e&&_0x3fc78e[_0xe24e('0x51')]===0x0){return db[_0xe24e('0x52')][_0xe24e('0x4a')]({'name':_0x24c0ec[_0xe24e('0x2e')],'resourceId':_0x24c0ec['id'],'type':_0x3fc78e[_0xe24e('0x2e')],'sectionId':_0x3fc78e['id']},{})[_0xe24e('0x29')](function(){return _0x3e8799;});}else{return _0x3e8799;}})['catch'](function(_0x18512e){logger[_0xe24e('0x2c')](_0xe24e('0x53'),_0x18512e);throw _0x18512e;});}return _0x3e8799;})[_0xe24e('0x29')](respondWithResult(_0x4deed3,0xc9))['catch'](handleError(_0x4deed3,null));};exports['update']=function(_0x5bc106,_0x1a8f9f){if(_0x5bc106['body']['id']){delete _0x5bc106[_0xe24e('0x4b')]['id'];}return db[_0xe24e('0x31')][_0xe24e('0x49')]({'where':{'id':_0x5bc106[_0xe24e('0x54')]['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0x1a8f9f,null))['then'](saveUpdates(_0x5bc106[_0xe24e('0x4b')],null))['then'](respondWithResult(_0x1a8f9f,null))[_0xe24e('0x55')](handleError(_0x1a8f9f,null));};exports[_0xe24e('0x28')]=function(_0x2bc40e,_0x2bd97b){return db[_0xe24e('0x31')]['find']({'where':{'id':_0x2bc40e['params']['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0x2bd97b,null))[_0xe24e('0x29')](removeEntity(_0x2bd97b,null))[_0xe24e('0x55')](handleError(_0x2bd97b,null));};exports[_0xe24e('0x56')]=function(_0x57ce82,_0x4136e5){return db[_0xe24e('0x31')][_0xe24e('0x56')]()[_0xe24e('0x29')](respondWithResult(_0x4136e5,null))[_0xe24e('0x55')](handleError(_0x4136e5,null));};exports[_0xe24e('0x57')]=function(_0x1dc5ae,_0x4d7eba,_0x3d41ee){var _0x56db84={'raw':!![],'where':{}},_0x1a0eaf={},_0x2d7f28;return db['SmsQueue']['findOne']({'where':{'id':_0x1dc5ae['params']['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0x4d7eba,null))[_0xe24e('0x29')](function(_0x41c65f){if(_0x41c65f){_0x2d7f28=_0x41c65f[_0xe24e('0x2a')]({'plain':!![]});_0x1a0eaf['model']=_[_0xe24e('0x37')](db[_0xe24e('0x58')][_0xe24e('0x32')]);_0x1a0eaf[_0xe24e('0x36')]=_[_0xe24e('0x37')](_0x1dc5ae[_0xe24e('0x36')]);_0x1a0eaf[_0xe24e('0x38')]=_[_0xe24e('0x39')](_0x1a0eaf[_0xe24e('0x35')],_0x1a0eaf[_0xe24e('0x36')]);_0x56db84[_0xe24e('0x3b')]=_[_0xe24e('0x39')](_0x1a0eaf[_0xe24e('0x35')],qs[_0xe24e('0x3a')](_0x1dc5ae[_0xe24e('0x36')]['fields']));_0x56db84[_0xe24e('0x3b')]=_0x56db84[_0xe24e('0x3b')]['length']?_0x56db84['attributes']:_0x1a0eaf[_0xe24e('0x35')];if(!_0x1dc5ae['query'][_0xe24e('0x3c')](_0xe24e('0x3d'))){_0x56db84['limit']=qs[_0xe24e('0x1f')](_0x1dc5ae[_0xe24e('0x36')][_0xe24e('0x1f')]);_0x56db84[_0xe24e('0x1e')]=qs[_0xe24e('0x1e')](_0x1dc5ae['query'][_0xe24e('0x1e')]);}_0x56db84[_0xe24e('0x59')]=qs[_0xe24e('0x3e')](_0x1dc5ae[_0xe24e('0x36')][_0xe24e('0x3e')]);_0x56db84['where']=qs[_0xe24e('0x38')](_[_0xe24e('0x5a')](_0x1dc5ae[_0xe24e('0x36')],_0x1a0eaf['filters']));_0x56db84[_0xe24e('0x42')]['SmsQueueId']=_0x41c65f['id'];if(_0x1dc5ae[_0xe24e('0x36')][_0xe24e('0x3f')]){_0x56db84[_0xe24e('0x42')]=_[_0xe24e('0x40')](_0x56db84[_0xe24e('0x42')],{'$or':_[_0xe24e('0x30')](_0x56db84[_0xe24e('0x3b')],function(_0x20f59d){var _0xe5908a={};_0xe5908a[_0x20f59d]={'$like':'%'+_0x1dc5ae['query'][_0xe24e('0x3f')]+'%'};return _0xe5908a;})});}_0x56db84=_[_0xe24e('0x40')]({},_0x56db84,_0x1dc5ae[_0xe24e('0x41')]);return db[_0xe24e('0x58')][_0xe24e('0x45')](_0x56db84);}})[_0xe24e('0x29')](function(_0x5b0924){if(_0x5b0924){return db[_0xe24e('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x5b0924,'UserId'),'role':_0xe24e('0x5c')},'attributes':['id',_0xe24e('0x2e'),_0xe24e('0x5d'),_0xe24e('0x5e'),_0xe24e('0x5f')]});}})[_0xe24e('0x29')](function(_0x373aad){if(_0x373aad){return{'count':_0x373aad[_0xe24e('0x21')],'rows':_['map'](_0x373aad['rows'],function(_0x5e84af){return{'membername':_0x5e84af[_0xe24e('0x2e')],'UserId':_0x5e84af['id'],'queue_name':_0x2d7f28['name'],'SmsQueueId':_0x2d7f28['id'],'interface':util[_0xe24e('0x60')]('%s/%s',_0xe24e('0x61'),_0x5e84af[_0xe24e('0x2e')]),'penalty':0x0,'paused':_0x5e84af['smsPause'],'createdAt':_0x5e84af['createdAt'],'updatedAt':_0x5e84af['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe24e('0x29')](respondWithFilteredResult(_0x4d7eba,_0x56db84))[_0xe24e('0x55')](handleError(_0x4d7eba,null));};exports[_0xe24e('0x62')]=function(_0x282a09,_0x46a6c4,_0xf7a689){var _0x3e92a6={};var _0x30867b={};var _0x5f1470;var _0x5d0b27;return db[_0xe24e('0x31')][_0xe24e('0x63')]({'where':{'id':_0x282a09['params']['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0x46a6c4,null))[_0xe24e('0x29')](function(_0xa655db){if(_0xa655db){_0x5f1470=_0xa655db;_0x30867b['model']=_[_0xe24e('0x37')](db[_0xe24e('0x64')][_0xe24e('0x32')]);_0x30867b['query']=_[_0xe24e('0x37')](_0x282a09[_0xe24e('0x36')]);_0x30867b[_0xe24e('0x38')]=_[_0xe24e('0x39')](_0x30867b[_0xe24e('0x35')],_0x30867b['query']);_0x3e92a6[_0xe24e('0x3b')]=_[_0xe24e('0x39')](_0x30867b[_0xe24e('0x35')],qs[_0xe24e('0x3a')](_0x282a09[_0xe24e('0x36')][_0xe24e('0x3a')]));_0x3e92a6[_0xe24e('0x3b')]=_0x3e92a6[_0xe24e('0x3b')][_0xe24e('0x48')]?_0x3e92a6[_0xe24e('0x3b')]:_0x30867b[_0xe24e('0x35')];_0x3e92a6['order']=qs[_0xe24e('0x3e')](_0x282a09[_0xe24e('0x36')]['sort']);_0x3e92a6['where']=qs[_0xe24e('0x38')](_[_0xe24e('0x5a')](_0x282a09['query'],_0x30867b[_0xe24e('0x38')]));if(_0x282a09[_0xe24e('0x36')]['filter']){_0x3e92a6[_0xe24e('0x42')]=_['merge'](_0x3e92a6[_0xe24e('0x42')],{'$or':_[_0xe24e('0x30')](_0x3e92a6[_0xe24e('0x3b')],function(_0x520a1e){var _0x4705ac={};_0x4705ac[_0x520a1e]={'$like':'%'+_0x282a09[_0xe24e('0x36')][_0xe24e('0x3f')]+'%'};return _0x4705ac;})});}_0x3e92a6=_[_0xe24e('0x40')]({},_0x3e92a6,_0x282a09[_0xe24e('0x41')]);return _0x5f1470['getTeams'](_0x3e92a6);}})[_0xe24e('0x29')](function(_0x5958b4){if(_0x5958b4){_0x5d0b27=_0x5958b4['length'];if(!_0x282a09[_0xe24e('0x36')][_0xe24e('0x3c')]('nolimit')){_0x3e92a6[_0xe24e('0x1f')]=qs[_0xe24e('0x1f')](_0x282a09[_0xe24e('0x36')][_0xe24e('0x1f')]);_0x3e92a6[_0xe24e('0x1e')]=qs[_0xe24e('0x1e')](_0x282a09[_0xe24e('0x36')][_0xe24e('0x1e')]);}return _0x5f1470['getTeams'](_0x3e92a6);}})[_0xe24e('0x29')](function(_0x16f23d){if(_0x16f23d){return _0x16f23d?{'count':_0x5d0b27,'rows':_0x16f23d}:null;}})[_0xe24e('0x29')](respondWithResult(_0x46a6c4,null))['catch'](handleError(_0x46a6c4,null));};exports[_0xe24e('0x65')]=function(_0x5acaf1,_0xa07f6b,_0x268a7a){var _0x582b4e=_0x5acaf1[_0xe24e('0x4b')][_0xe24e('0x66')];return db[_0xe24e('0x64')][_0xe24e('0x45')]({'where':{'id':_0x582b4e},'attributes':['id'],'include':[{'model':db[_0xe24e('0x5b')],'as':_0xe24e('0x67'),'attributes':['id',_0xe24e('0x2e'),_0xe24e('0x68'),'voicePause',_0xe24e('0x69')],'raw':!![]}]})[_0xe24e('0x29')](function(_0x48e58a){if(_0x48e58a){var _0x51e974=_[_0xe24e('0x6a')](_0x48e58a,function(_0x66af45){var _0x423217=_0x66af45[_0xe24e('0x2a')]({'plain':!![]});return _0x423217['Agents'];});return db[_0xe24e('0x31')][_0xe24e('0x49')]({'where':{'id':_0x5acaf1['params']['id']}})['then'](function(_0x4755c7){return db['sequelize']['transaction'](function(_0x34ced6){return _0x4755c7[_0xe24e('0x65')](_0x582b4e,{'transaction':_0x34ced6})[_0xe24e('0x29')](function(){return BPromise[_0xe24e('0x6b')](_0x51e974,function(_0x76b698){return db[_0xe24e('0x58')]['findOrCreate']({'where':{'UserId':_0x76b698['id'],'SmsQueueId':_0x5acaf1['params']['id']},'transaction':_0x34ced6});});})[_0xe24e('0x29')](function(){_0x51e974[_0xe24e('0x6c')](function(_0x4887d7){socket[_0xe24e('0x6d')](_0xe24e('0x6e'),{'UserId':_0x4887d7['id'],'SmsQueueId':_0x4755c7['id']});});});});});}})[_0xe24e('0x29')](respondWithStatusCode(_0xa07f6b,null))[_0xe24e('0x55')](handleError(_0xa07f6b,null));};exports[_0xe24e('0x6f')]=function(_0x59c605,_0xebc38c,_0x167720){return db[_0xe24e('0x64')][_0xe24e('0x45')]({'where':{'id':_0x59c605[_0xe24e('0x36')][_0xe24e('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe24e('0x5b')],'as':_0xe24e('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xebc38c,null))['then'](function(_0x267eae){var _0x450b7c=_['map'](_0x267eae,'id');var _0x444578=[];var _0x422928=[];var _0x3b68d1=squel[_0xe24e('0x70')]();_0x3b68d1[_0xe24e('0x71')](_0xe24e('0x72'))[_0xe24e('0x73')]('team_has_sms_queues','tq')[_0xe24e('0x74')](_0xe24e('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe24e('0x42')](_0xe24e('0x76'),_0x59c605[_0xe24e('0x54')]['id']);for(var _0x1ee8f7=0x0;_0x1ee8f7<_0x267eae[_0xe24e('0x48')];_0x1ee8f7+=0x1){let _0x160609=_0x267eae[_0x1ee8f7];for(var _0x20bcf0=0x0;_0x20bcf0<_0x160609[_0xe24e('0x67')]['length'];_0x20bcf0+=0x1){let _0x417fd4=_0x160609[_0xe24e('0x67')][_0x20bcf0];var _0x3ba0ee=_0x3b68d1[_0xe24e('0x77')]();_0x3ba0ee['where'](_0xe24e('0x78'),_0x417fd4['id']);_0x422928[_0xe24e('0x79')](db[_0xe24e('0x7a')]['query'](_0x3ba0ee['toString'](),{'type':db[_0xe24e('0x7a')][_0xe24e('0x7b')][_0xe24e('0x7c')]})[_0xe24e('0x29')](function(_0x5974b5){if(_0x5974b5[_0xe24e('0x48')]===0x1){return _0x417fd4['id'];}else{var _0x30d38a=_[_0xe24e('0x7d')](_[_0xe24e('0x30')](_0x5974b5,'TeamId'),function(_0x36ed39){return _[_0xe24e('0x7e')](_0x450b7c,_0x36ed39);});if(_0x30d38a){return _0x417fd4['id'];}}}));}}return BPromise[_0xe24e('0x7f')](_0x422928)[_0xe24e('0x29')](function(_0x2916a3){_0x444578=_(_0x444578)[_0xe24e('0x80')](_0x2916a3)['compact']()['value']();return db[_0xe24e('0x31')][_0xe24e('0x49')]({'where':{'id':_0x59c605[_0xe24e('0x54')]['id']}})[_0xe24e('0x29')](function(_0x2ca8c6){return db['sequelize'][_0xe24e('0x81')](function(_0x55b0f5){return _0x2ca8c6[_0xe24e('0x6f')](_0x59c605[_0xe24e('0x36')][_0xe24e('0x66')],{'transaction':_0x55b0f5})[_0xe24e('0x29')](function(){if(!_[_0xe24e('0x82')](_0x444578)){return _0x2ca8c6[_0xe24e('0x83')](_0x444578,{'transaction':_0x55b0f5});}})[_0xe24e('0x29')](function(){_0x444578[_0xe24e('0x6c')](function(_0x55caa5){socket[_0xe24e('0x6d')](_0xe24e('0x84'),{'UserId':_0x55caa5,'SmsQueueId':_0x2ca8c6['id']});});});});});});})['then'](respondWithStatusCode(_0xebc38c,null))['catch'](handleError(_0xebc38c,null));};exports['addAgents']=function(_0x41b473,_0x2a3868,_0x57c25f){return db[_0xe24e('0x31')][_0xe24e('0x49')]({'where':{'id':_0x41b473[_0xe24e('0x54')]['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0x2a3868,null))['then'](function(_0x5819b9){if(_0x5819b9){return _0x5819b9[_0xe24e('0x85')](_0x41b473[_0xe24e('0x4b')]['ids'],_[_0xe24e('0x86')](_0x41b473['body'],['ids','id'])||{})[_0xe24e('0x87')](function(_0x59145b){for(var _0x3f0517=0x0;_0x3f0517<_0x41b473[_0xe24e('0x4b')]['ids']['length'];_0x3f0517+=0x1){socket[_0xe24e('0x6d')](_0xe24e('0x6e'),{'UserId':Number(_0x41b473['body'][_0xe24e('0x66')][_0x3f0517]),'SmsQueueId':Number(_0x41b473[_0xe24e('0x54')]['id'])});}return _0x59145b;});}})['then'](respondWithResult(_0x2a3868,null))[_0xe24e('0x55')](handleError(_0x2a3868,null));};exports[_0xe24e('0x83')]=function(_0xbba1,_0x5ea08a,_0x514105){return db[_0xe24e('0x31')]['find']({'where':{'id':_0xbba1[_0xe24e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ea08a,null))[_0xe24e('0x29')](function(_0x1760a5){if(_0x1760a5){return _0x1760a5[_0xe24e('0x83')](_0xbba1[_0xe24e('0x36')][_0xe24e('0x66')])['then'](function(){if(_[_0xe24e('0x88')](_0xbba1[_0xe24e('0x36')][_0xe24e('0x66')])){for(var _0x409212=0x0;_0x409212<_0xbba1['query'][_0xe24e('0x66')][_0xe24e('0x48')];_0x409212+=0x1){socket[_0xe24e('0x6d')](_0xe24e('0x84'),{'UserId':Number(_0xbba1[_0xe24e('0x36')][_0xe24e('0x66')][_0x409212]),'SmsQueueId':Number(_0xbba1[_0xe24e('0x54')]['id'])});}}else{socket[_0xe24e('0x6d')](_0xe24e('0x84'),{'UserId':Number(_0xbba1['query'][_0xe24e('0x66')]),'SmsQueueId':Number(_0xbba1[_0xe24e('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x5ea08a,null))[_0xe24e('0x55')](handleError(_0x5ea08a,null));};exports['getAgents']=function(_0x53e6ba,_0xbb83a7,_0x148ece){var _0x319b87={};var _0x4a4fe0={};var _0x2030a1;var _0x27f389;return db['SmsQueue'][_0xe24e('0x63')]({'where':{'id':_0x53e6ba['params']['id']}})[_0xe24e('0x29')](handleEntityNotFound(_0xbb83a7,null))['then'](function(_0x374a2c){if(_0x374a2c){_0x2030a1=_0x374a2c;_0x4a4fe0[_0xe24e('0x35')]=_[_0xe24e('0x37')](db[_0xe24e('0x5b')][_0xe24e('0x32')]);_0x4a4fe0[_0xe24e('0x36')]=_['keys'](_0x53e6ba['query']);_0x4a4fe0[_0xe24e('0x38')]=_[_0xe24e('0x39')](_0x4a4fe0[_0xe24e('0x35')],_0x4a4fe0[_0xe24e('0x36')]);_0x319b87[_0xe24e('0x3b')]=_[_0xe24e('0x39')](_0x4a4fe0[_0xe24e('0x35')],qs[_0xe24e('0x3a')](_0x53e6ba[_0xe24e('0x36')]['fields']));_0x319b87[_0xe24e('0x3b')]=_0x319b87[_0xe24e('0x3b')][_0xe24e('0x48')]?_0x319b87[_0xe24e('0x3b')]:_0x4a4fe0[_0xe24e('0x35')];_0x319b87['order']=qs[_0xe24e('0x3e')](_0x53e6ba[_0xe24e('0x36')]['sort']);_0x319b87['where']=qs['filters'](_['pick'](_0x53e6ba[_0xe24e('0x36')],_0x4a4fe0[_0xe24e('0x38')]));if(_0x53e6ba[_0xe24e('0x36')][_0xe24e('0x3f')]){_0x319b87[_0xe24e('0x42')]=_[_0xe24e('0x40')](_0x319b87[_0xe24e('0x42')],{'$or':_[_0xe24e('0x30')](_0x319b87[_0xe24e('0x3b')],function(_0x442f02){var _0x587a4c={};_0x587a4c[_0x442f02]={'$like':'%'+_0x53e6ba[_0xe24e('0x36')][_0xe24e('0x3f')]+'%'};return _0x587a4c;})});}_0x319b87=_['merge']({},_0x319b87,_0x53e6ba[_0xe24e('0x41')]);return _0x2030a1[_0xe24e('0x89')](_0x319b87);}})['then'](function(_0xc83e33){if(_0xc83e33){_0x27f389=_0xc83e33['length'];if(!_0x53e6ba[_0xe24e('0x36')][_0xe24e('0x3c')](_0xe24e('0x3d'))){_0x319b87[_0xe24e('0x1f')]=qs[_0xe24e('0x1f')](_0x53e6ba[_0xe24e('0x36')][_0xe24e('0x1f')]);_0x319b87[_0xe24e('0x1e')]=qs[_0xe24e('0x1e')](_0x53e6ba['query'][_0xe24e('0x1e')]);}return _0x2030a1['getAgents'](_0x319b87);}})[_0xe24e('0x29')](function(_0x55b3d9){if(_0x55b3d9){return _0x55b3d9?{'count':_0x27f389,'rows':_0x55b3d9}:null;}})[_0xe24e('0x29')](respondWithResult(_0xbb83a7,null))[_0xe24e('0x55')](handleError(_0xbb83a7,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bd5a9c6..9f3d9c6 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 _0x341b=['update','remove','emit','exports','../../mysqldb','setMaxListeners','save'];(function(_0x526b8b,_0x467a76){var _0x4e7cff=function(_0x5cdd95){while(--_0x5cdd95){_0x526b8b['push'](_0x526b8b['shift']());}};_0x4e7cff(++_0x467a76);}(_0x341b,0x100));var _0xb341=function(_0x3a11ce,_0x4b9250){_0x3a11ce=_0x3a11ce-0x0;var _0x210e95=_0x341b[_0x3a11ce];return _0x210e95;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xb341('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb341('0x1')](0x0);var events={'afterCreate':_0xb341('0x2'),'afterUpdate':_0xb341('0x3'),'afterDestroy':_0xb341('0x4')};function emitEvent(_0x3d179d){return function(_0x33848e,_0x3df003,_0x55346a){SmsQueueEvents[_0xb341('0x5')](_0x3d179d+':'+_0x33848e['id'],_0x33848e);SmsQueueEvents['emit'](_0x3d179d,_0x33848e);_0x55346a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xb341('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x3e9b=['save','update','remove','emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x3e9b,0x1e2));var _0xb3e9=function(_0x35746a,_0x1c9025){_0x35746a=_0x35746a-0x0;var _0x4cdf06=_0x3e9b[_0x35746a];return _0x4cdf06;};'use strict';var EventEmitter=require(_0xb3e9('0x0'));var SmsQueue=require(_0xb3e9('0x1'))['db'][_0xb3e9('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb3e9('0x3')](0x0);var events={'afterCreate':_0xb3e9('0x4'),'afterUpdate':_0xb3e9('0x5'),'afterDestroy':_0xb3e9('0x6')};function emitEvent(_0x44fb1e){return function(_0x5bb3b6,_0x35b95a,_0x456d64){SmsQueueEvents[_0xb3e9('0x7')](_0x44fb1e+':'+_0x5bb3b6['id'],_0x5bb3b6);SmsQueueEvents['emit'](_0x44fb1e,_0x5bb3b6);_0x456d64(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xb3e9('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 152be01..ecc24db 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 _0xa5fe=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash'];(function(_0x5df5c6,_0x39ca7c){var _0x14d8ed=function(_0x454823){while(--_0x454823){_0x5df5c6['push'](_0x5df5c6['shift']());}};_0x14d8ed(++_0x39ca7c);}(_0xa5fe,0x179));var _0xea5f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa5fe[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xea5f('0x0'));var util=require(_0xea5f('0x1'));var logger=require(_0xea5f('0x2'))(_0xea5f('0x3'));var moment=require(_0xea5f('0x4'));var BPromise=require(_0xea5f('0x5'));var rp=require(_0xea5f('0x6'));var fs=require('fs');var path=require(_0xea5f('0x7'));var rimraf=require(_0xea5f('0x8'));var config=require(_0xea5f('0x9'));var attributes=require(_0xea5f('0xa'));module[_0xea5f('0xb')]=function(_0x311bbd,_0x235b7a){return _0x311bbd[_0xea5f('0xc')](_0xea5f('0xd'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0ba=['moment','request-promise','path','rimraf','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe0ba,0x97));var _0xae0b=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe0ba[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xae0b('0x0'));var util=require(_0xae0b('0x1'));var logger=require(_0xae0b('0x2'))('api');var moment=require(_0xae0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xae0b('0x4'));var fs=require('fs');var path=require(_0xae0b('0x5'));var rimraf=require(_0xae0b('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xae0b('0x7')]=function(_0x4920c3,_0x9eb25c){return _0x4920c3[_0xae0b('0x8')](_0xae0b('0x9'),attributes,{'tableName':_0xae0b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 2b34d96..4fcb856 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 _0xfbdd=['raw','attributes','limit','include','model','map','ShowSmsQueue','find','where','debug','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','register','request','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfbdd,0x17c));var _0xdfbd=function(_0x4eb34c,_0xfbe9d4){_0x4eb34c=_0x4eb34c-0x0;var _0x2bc6c4=_0xfbdd[_0x4eb34c];return _0x2bc6c4;};'use strict';var _=require(_0xdfbd('0x0'));var util=require('util');var moment=require(_0xdfbd('0x1'));var BPromise=require(_0xdfbd('0x2'));var rs=require(_0xdfbd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdfbd('0x4'));var logger=require(_0xdfbd('0x5'))(_0xdfbd('0x6'));var config=require(_0xdfbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdfbd('0x8')][_0xdfbd('0x9')]({'port':0x232a});config[_0xdfbd('0xa')]=_['defaults'](config[_0xdfbd('0xa')],{'host':_0xdfbd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfbd('0xa')]));require('./smsQueue.socket')[_0xdfbd('0xc')](socket);function respondWithRpcPromise(_0x2417f0,_0x219576,_0x3c6cbf){return new BPromise(function(_0x2dd174,_0x3734b6){return client[_0xdfbd('0xd')](_0x2417f0,_0x3c6cbf)[_0xdfbd('0xe')](function(_0x489bd1){logger[_0xdfbd('0xf')]('SmsQueue,\x20%s,\x20%s',_0x219576,_0xdfbd('0x10'));logger['debug'](_0xdfbd('0x11'),_0x219576,_0xdfbd('0x10'),JSON[_0xdfbd('0x12')](_0x489bd1));if(_0x489bd1[_0xdfbd('0x13')]){if(_0x489bd1['error'][_0xdfbd('0x14')]===0x1f4){logger[_0xdfbd('0x13')](_0xdfbd('0x15'),_0x219576,_0x489bd1[_0xdfbd('0x13')]['message']);return _0x3734b6(_0x489bd1['error'][_0xdfbd('0x16')]);}logger['error'](_0xdfbd('0x15'),_0x219576,_0x489bd1[_0xdfbd('0x13')][_0xdfbd('0x16')]);return _0x2dd174(_0x489bd1['error']['message']);}else{logger[_0xdfbd('0xf')]('SmsQueue,\x20%s,\x20%s',_0x219576,_0xdfbd('0x10'));_0x2dd174(_0x489bd1['result'][_0xdfbd('0x16')]);}})[_0xdfbd('0x17')](function(_0xd9e188){logger[_0xdfbd('0x13')](_0xdfbd('0x15'),_0x219576,_0xd9e188);_0x3734b6(_0xd9e188);});});}exports[_0xdfbd('0x18')]=function(_0x409c04){var _0x4aee45=this;return new Promise(function(_0x4a7e4d,_0x466162){return db[_0xdfbd('0x19')]['findAll']({'raw':_0x409c04['options']?_0x409c04[_0xdfbd('0x1a')][_0xdfbd('0x1b')]===undefined?!![]:![]:!![],'where':_0x409c04[_0xdfbd('0x1a')]?_0x409c04['options']['where']||null:null,'attributes':_0x409c04['options']?_0x409c04[_0xdfbd('0x1a')][_0xdfbd('0x1c')]||null:null,'limit':_0x409c04[_0xdfbd('0x1a')]?_0x409c04['options'][_0xdfbd('0x1d')]||null:null,'include':_0x409c04[_0xdfbd('0x1a')]?_0x409c04[_0xdfbd('0x1a')]['include']?_['map'](_0x409c04[_0xdfbd('0x1a')][_0xdfbd('0x1e')],function(_0xf825b5){return{'model':db[_0xf825b5[_0xdfbd('0x1f')]],'as':_0xf825b5['as'],'attributes':_0xf825b5['attributes'],'include':_0xf825b5[_0xdfbd('0x1e')]?_[_0xdfbd('0x20')](_0xf825b5[_0xdfbd('0x1e')],function(_0x379d60){return{'model':db[_0x379d60[_0xdfbd('0x1f')]],'as':_0x379d60['as'],'attributes':_0x379d60[_0xdfbd('0x1c')],'include':_0x379d60['include']?_[_0xdfbd('0x20')](_0x379d60[_0xdfbd('0x1e')],function(_0x3322ec){return{'model':db[_0x3322ec['model']],'as':_0x3322ec['as'],'attributes':_0x3322ec[_0xdfbd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdfbd('0xe')](function(_0x1309e3){logger['info'](_0xdfbd('0x18'),_0x409c04);logger['debug']('GetSmsQueue',_0x409c04,JSON[_0xdfbd('0x12')](_0x1309e3));_0x4a7e4d(_0x1309e3);})[_0xdfbd('0x17')](function(_0x336a93){logger['error'](_0xdfbd('0x18'),_0x336a93[_0xdfbd('0x16')],_0x409c04);_0x466162(_0x4aee45['error'](0x1f4,_0x336a93[_0xdfbd('0x16')]));});});};exports[_0xdfbd('0x21')]=function(_0x559150){var _0x5da149=this;return new Promise(function(_0x5f4d41,_0x36ec28){return db[_0xdfbd('0x19')][_0xdfbd('0x22')]({'raw':_0x559150[_0xdfbd('0x1a')]?_0x559150['options'][_0xdfbd('0x1b')]===undefined?!![]:![]:!![],'where':_0x559150[_0xdfbd('0x1a')]?_0x559150[_0xdfbd('0x1a')][_0xdfbd('0x23')]||null:null,'attributes':_0x559150['options']?_0x559150[_0xdfbd('0x1a')][_0xdfbd('0x1c')]||null:null,'include':_0x559150[_0xdfbd('0x1a')]?_0x559150['options']['include']?_['map'](_0x559150[_0xdfbd('0x1a')][_0xdfbd('0x1e')],function(_0x4695d8){return{'model':db[_0x4695d8['model']],'as':_0x4695d8['as'],'attributes':_0x4695d8[_0xdfbd('0x1c')],'include':_0x4695d8['include']?_[_0xdfbd('0x20')](_0x4695d8[_0xdfbd('0x1e')],function(_0x26986e){return{'model':db[_0x26986e['model']],'as':_0x26986e['as'],'attributes':_0x26986e['attributes'],'include':_0x26986e['include']?_['map'](_0x26986e['include'],function(_0x2d2295){return{'model':db[_0x2d2295['model']],'as':_0x2d2295['as'],'attributes':_0x2d2295[_0xdfbd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdfbd('0xe')](function(_0x400892){logger[_0xdfbd('0xf')]('ShowSmsQueue',_0x559150);logger[_0xdfbd('0x24')](_0xdfbd('0x21'),_0x559150,JSON[_0xdfbd('0x12')](_0x400892));_0x5f4d41(_0x400892);})[_0xdfbd('0x17')](function(_0x560624){logger[_0xdfbd('0x13')]('ShowSmsQueue',_0x560624[_0xdfbd('0x16')],_0x559150);_0x36ec28(_0x5da149['error'](0x1f4,_0x560624[_0xdfbd('0x16')]));});});}; \ No newline at end of file +var _0xe978=['find','raw','where','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSmsQueue','SmsQueue','findAll','options','limit','include','model','attributes','debug','ShowSmsQueue'];(function(_0x2c848a,_0x30bdb0){var _0x43cd06=function(_0x317374){while(--_0x317374){_0x2c848a['push'](_0x2c848a['shift']());}};_0x43cd06(++_0x30bdb0);}(_0xe978,0x176));var _0x8e97=function(_0x119d23,_0x423788){_0x119d23=_0x119d23-0x0;var _0x59cbeb=_0xe978[_0x119d23];return _0x59cbeb;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var moment=require(_0x8e97('0x2'));var BPromise=require(_0x8e97('0x3'));var rs=require(_0x8e97('0x4'));var fs=require('fs');var Redis=require(_0x8e97('0x5'));var db=require(_0x8e97('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e97('0x7'));var config=require(_0x8e97('0x8'));var jayson=require(_0x8e97('0x9'));var client=jayson['client'][_0x8e97('0xa')]({'port':0x232a});config[_0x8e97('0xb')]=_[_0x8e97('0xc')](config[_0x8e97('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e97('0xd'))(new Redis(config[_0x8e97('0xb')]));require(_0x8e97('0xe'))[_0x8e97('0xf')](socket);function respondWithRpcPromise(_0x119ac7,_0x55042a,_0x1a41d5){return new BPromise(function(_0x3d41c8,_0x3e0dda){return client[_0x8e97('0x10')](_0x119ac7,_0x1a41d5)[_0x8e97('0x11')](function(_0x6d5d9d){logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x55042a,_0x8e97('0x14'));logger['debug'](_0x8e97('0x15'),_0x55042a,_0x8e97('0x14'),JSON[_0x8e97('0x16')](_0x6d5d9d));if(_0x6d5d9d[_0x8e97('0x17')]){if(_0x6d5d9d[_0x8e97('0x17')]['code']===0x1f4){logger[_0x8e97('0x17')](_0x8e97('0x13'),_0x55042a,_0x6d5d9d[_0x8e97('0x17')][_0x8e97('0x18')]);return _0x3e0dda(_0x6d5d9d[_0x8e97('0x17')][_0x8e97('0x18')]);}logger[_0x8e97('0x17')](_0x8e97('0x13'),_0x55042a,_0x6d5d9d[_0x8e97('0x17')][_0x8e97('0x18')]);return _0x3d41c8(_0x6d5d9d['error']['message']);}else{logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x55042a,_0x8e97('0x14'));_0x3d41c8(_0x6d5d9d[_0x8e97('0x19')][_0x8e97('0x18')]);}})['catch'](function(_0x1f10b5){logger[_0x8e97('0x17')](_0x8e97('0x13'),_0x55042a,_0x1f10b5);_0x3e0dda(_0x1f10b5);});});}exports[_0x8e97('0x1a')]=function(_0x405670){var _0x44c574=this;return new Promise(function(_0x582c1a,_0x11c931){return db[_0x8e97('0x1b')][_0x8e97('0x1c')]({'raw':_0x405670[_0x8e97('0x1d')]?_0x405670[_0x8e97('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x405670['options']?_0x405670[_0x8e97('0x1d')]['where']||null:null,'attributes':_0x405670['options']?_0x405670[_0x8e97('0x1d')]['attributes']||null:null,'limit':_0x405670[_0x8e97('0x1d')]?_0x405670[_0x8e97('0x1d')][_0x8e97('0x1e')]||null:null,'include':_0x405670[_0x8e97('0x1d')]?_0x405670['options']['include']?_['map'](_0x405670['options'][_0x8e97('0x1f')],function(_0x2ff771){return{'model':db[_0x2ff771[_0x8e97('0x20')]],'as':_0x2ff771['as'],'attributes':_0x2ff771[_0x8e97('0x21')],'include':_0x2ff771[_0x8e97('0x1f')]?_['map'](_0x2ff771[_0x8e97('0x1f')],function(_0x10d032){return{'model':db[_0x10d032[_0x8e97('0x20')]],'as':_0x10d032['as'],'attributes':_0x10d032[_0x8e97('0x21')],'include':_0x10d032[_0x8e97('0x1f')]?_['map'](_0x10d032['include'],function(_0x3925b4){return{'model':db[_0x3925b4[_0x8e97('0x20')]],'as':_0x3925b4['as'],'attributes':_0x3925b4[_0x8e97('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8e97('0x11')](function(_0x49f3af){logger['info'](_0x8e97('0x1a'),_0x405670);logger[_0x8e97('0x22')](_0x8e97('0x1a'),_0x405670,JSON[_0x8e97('0x16')](_0x49f3af));_0x582c1a(_0x49f3af);})['catch'](function(_0x5ccf5b){logger['error']('GetSmsQueue',_0x5ccf5b[_0x8e97('0x18')],_0x405670);_0x11c931(_0x44c574[_0x8e97('0x17')](0x1f4,_0x5ccf5b['message']));});});};exports[_0x8e97('0x23')]=function(_0x13e386){var _0x410c41=this;return new Promise(function(_0x2c17a5,_0x51c4f7){return db[_0x8e97('0x1b')][_0x8e97('0x24')]({'raw':_0x13e386['options']?_0x13e386['options'][_0x8e97('0x25')]===undefined?!![]:![]:!![],'where':_0x13e386[_0x8e97('0x1d')]?_0x13e386[_0x8e97('0x1d')][_0x8e97('0x26')]||null:null,'attributes':_0x13e386[_0x8e97('0x1d')]?_0x13e386['options']['attributes']||null:null,'include':_0x13e386['options']?_0x13e386[_0x8e97('0x1d')][_0x8e97('0x1f')]?_[_0x8e97('0x27')](_0x13e386[_0x8e97('0x1d')][_0x8e97('0x1f')],function(_0x1e45e6){return{'model':db[_0x1e45e6[_0x8e97('0x20')]],'as':_0x1e45e6['as'],'attributes':_0x1e45e6[_0x8e97('0x21')],'include':_0x1e45e6['include']?_[_0x8e97('0x27')](_0x1e45e6[_0x8e97('0x1f')],function(_0x52c4da){return{'model':db[_0x52c4da['model']],'as':_0x52c4da['as'],'attributes':_0x52c4da[_0x8e97('0x21')],'include':_0x52c4da[_0x8e97('0x1f')]?_[_0x8e97('0x27')](_0x52c4da['include'],function(_0x2e6105){return{'model':db[_0x2e6105['model']],'as':_0x2e6105['as'],'attributes':_0x2e6105[_0x8e97('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8e97('0x11')](function(_0x1c3091){logger['info'](_0x8e97('0x23'),_0x13e386);logger[_0x8e97('0x22')](_0x8e97('0x23'),_0x13e386,JSON[_0x8e97('0x16')](_0x1c3091));_0x2c17a5(_0x1c3091);})[_0x8e97('0x28')](function(_0x4c2f56){logger[_0x8e97('0x17')]('ShowSmsQueue',_0x4c2f56['message'],_0x13e386);_0x51c4f7(_0x410c41['error'](0x1f4,_0x4c2f56[_0x8e97('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5095026..b39a079 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 _0x12d4=['smsQueue:','./smsQueue.events','update','emit','register','length'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x12d4,0x16f));var _0x412d=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x12d4[_0x4a0e68];return _0x4fb274;};'use strict';var SmsQueueEvents=require(_0x412d('0x0'));var events=['save','remove',_0x412d('0x1')];function createListener(_0x349a60,_0x69fdfc){return function(_0x103bc3){_0x69fdfc[_0x412d('0x2')](_0x349a60,_0x103bc3);};}function removeListener(_0x75e9f1,_0x9d14d3){return function(){SmsQueueEvents['removeListener'](_0x75e9f1,_0x9d14d3);};}exports[_0x412d('0x3')]=function(_0x290479){for(var _0x343f3d=0x0,_0x3f248f=events[_0x412d('0x4')];_0x343f3d<_0x3f248f;_0x343f3d++){var _0x2a5af6=events[_0x343f3d];var _0x593df4=createListener(_0x412d('0x5')+_0x2a5af6,_0x290479);SmsQueueEvents['on'](_0x2a5af6,_0x593df4);}}; \ No newline at end of file +var _0x9385=['smsQueue:','./smsQueue.events','update','emit','register'];(function(_0x1c4f23,_0x3a5c9a){var _0x50bb54=function(_0x1ec32f){while(--_0x1ec32f){_0x1c4f23['push'](_0x1c4f23['shift']());}};_0x50bb54(++_0x3a5c9a);}(_0x9385,0x119));var _0x5938=function(_0x529419,_0x58fd78){_0x529419=_0x529419-0x0;var _0x3b84e0=_0x9385[_0x529419];return _0x3b84e0;};'use strict';var SmsQueueEvents=require(_0x5938('0x0'));var events=['save','remove',_0x5938('0x1')];function createListener(_0x254371,_0x3e63a4){return function(_0x1fc882){_0x3e63a4[_0x5938('0x2')](_0x254371,_0x1fc882);};}function removeListener(_0x382dd5,_0x461f99){return function(){SmsQueueEvents['removeListener'](_0x382dd5,_0x461f99);};}exports[_0x5938('0x3')]=function(_0x5e2e25){for(var _0x9a6aa4=0x0,_0x25d9f4=events['length'];_0x9a6aa4<_0x25d9f4;_0x9a6aa4++){var _0x3f9cde=events[_0x9a6aa4];var _0x51456f=createListener(_0x5938('0x4')+_0x3f9cde,_0x5e2e25);SmsQueueEvents['on'](_0x3f9cde,_0x51456f);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3658853..3559798 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 _0x8c97=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','exports','multer','util'];(function(_0x3565a4,_0x2d3d96){var _0x567bcc=function(_0x472562){while(--_0x472562){_0x3565a4['push'](_0x3565a4['shift']());}};_0x567bcc(++_0x2d3d96);}(_0x8c97,0x1ae));var _0x78c9=function(_0xfeaca7,_0x141199){_0xfeaca7=_0xfeaca7-0x0;var _0x4fe942=_0x8c97[_0xfeaca7];return _0x4fe942;};'use strict';var multer=require(_0x78c9('0x0'));var util=require(_0x78c9('0x1'));var path=require('path');var timeout=require(_0x78c9('0x2'));var express=require('express');var router=express[_0x78c9('0x3')]();var fs_extra=require(_0x78c9('0x4'));var auth=require(_0x78c9('0x5'));var interaction=require(_0x78c9('0x6'));var config=require('../../config/environment');var controller=require(_0x78c9('0x7'));router[_0x78c9('0x8')]('/',auth[_0x78c9('0x9')](),controller[_0x78c9('0xa')]);router[_0x78c9('0x8')]('/describe',auth[_0x78c9('0x9')](),controller[_0x78c9('0xb')]);router['get'](_0x78c9('0xc'),auth[_0x78c9('0x9')](),controller[_0x78c9('0xd')]);router[_0x78c9('0xe')]('/',auth[_0x78c9('0x9')](),controller[_0x78c9('0xf')]);router[_0x78c9('0x10')](_0x78c9('0xc'),auth[_0x78c9('0x9')](),controller['update']);router['delete'](_0x78c9('0xc'),auth[_0x78c9('0x9')](),controller['destroy']);module[_0x78c9('0x11')]=router; \ No newline at end of file +var _0xf3ff=['../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','index','isAuthenticated','describe','show','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4439ac,_0x5d0890){var _0x35c093=function(_0x3285b1){while(--_0x3285b1){_0x4439ac['push'](_0x4439ac['shift']());}};_0x35c093(++_0x5d0890);}(_0xf3ff,0xae));var _0xff3f=function(_0x2bb7ba,_0x1accf8){_0x2bb7ba=_0x2bb7ba-0x0;var _0xc49f9e=_0xf3ff[_0x2bb7ba];return _0xc49f9e;};'use strict';var multer=require(_0xff3f('0x0'));var util=require('util');var path=require(_0xff3f('0x1'));var timeout=require(_0xff3f('0x2'));var express=require(_0xff3f('0x3'));var router=express[_0xff3f('0x4')]();var fs_extra=require(_0xff3f('0x5'));var auth=require(_0xff3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff3f('0x7'));var controller=require(_0xff3f('0x8'));router[_0xff3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xff3f('0xa')]);router[_0xff3f('0x9')]('/describe',auth[_0xff3f('0xb')](),controller[_0xff3f('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xff3f('0xd')]);router['post']('/',auth[_0xff3f('0xb')](),controller['create']);router[_0xff3f('0xe')](_0xff3f('0xf'),auth[_0xff3f('0xb')](),controller[_0xff3f('0x10')]);router[_0xff3f('0x11')](_0xff3f('0xf'),auth[_0xff3f('0xb')](),controller[_0xff3f('0x12')]);module[_0xff3f('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6928b41..7e12a2e 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 _0x3304=['STRING','DATE'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x3304,0xc8));var _0x4330=function(_0x205a17,_0x5594ff){_0x205a17=_0x205a17-0x0;var _0x3010cf=_0x3304[_0x205a17];return _0x3010cf;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4330('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x4330('0x0')]},'joinAt':{'type':Sequelize[_0x4330('0x1')]},'leaveAt':{'type':Sequelize[_0x4330('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4330('0x1')]},'reason':{'type':Sequelize[_0x4330('0x0')]}}; \ No newline at end of file +var _0xecd0=['sequelize','exports','STRING','DATE','moment'];(function(_0x26c756,_0x630de1){var _0x17d39c=function(_0x2d1943){while(--_0x2d1943){_0x26c756['push'](_0x26c756['shift']());}};_0x17d39c(++_0x630de1);}(_0xecd0,0x162));var _0x0ecd=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0xecd0[_0x538c70];return _0x42ae01;};'use strict';var moment=require(_0x0ecd('0x0'));var Sequelize=require(_0x0ecd('0x1'));module[_0x0ecd('0x2')]={'uniqueid':{'type':Sequelize[_0x0ecd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0ecd('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0ecd('0x4')]},'acceptAt':{'type':Sequelize[_0x0ecd('0x4')]},'exitAt':{'type':Sequelize[_0x0ecd('0x4')]},'reason':{'type':Sequelize[_0x0ecd('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 641527a..2f1a3c2 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 _0x8d5a=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x8d5a,0x1be));var _0xa8d5=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8d5a[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xa8d5('0x0'));var rimraf=require(_0xa8d5('0x1'));var zipdir=require(_0xa8d5('0x2'));var jsonpatch=require(_0xa8d5('0x3'));var rp=require('request-promise');var moment=require(_0xa8d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8d5('0x5'));var util=require(_0xa8d5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa8d5('0x7'));var ejs=require(_0xa8d5('0x8'));var fs=require('fs');var fs_extra=require(_0xa8d5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa8d5('0x7'));var querystring=require(_0xa8d5('0xa'));var Papa=require(_0xa8d5('0xb'));var Redis=require(_0xa8d5('0xc'));var authService=require(_0xa8d5('0xd'));var qs=require(_0xa8d5('0xe'));var as=require(_0xa8d5('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8d5('0x10'))(_0xa8d5('0x11'));var utils=require(_0xa8d5('0x12'));var config=require(_0xa8d5('0x13'));var licenseUtil=require(_0xa8d5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51446a,_0x5f5cb7){_0x5f5cb7=_0x5f5cb7||0xcc;return function(_0x5ab037){if(_0x5ab037){return _0x51446a['sendStatus'](_0x5f5cb7);}return _0x51446a[_0xa8d5('0x15')](_0x5f5cb7)[_0xa8d5('0x16')]();};}function respondWithResult(_0x2d1785,_0x5739fa){_0x5739fa=_0x5739fa||0xc8;return function(_0x276217){if(_0x276217){return _0x2d1785[_0xa8d5('0x15')](_0x5739fa)[_0xa8d5('0x17')](_0x276217);}};}function respondWithFilteredResult(_0x3bf6a4,_0x1121ee){return function(_0x3d3661){if(_0x3d3661){var _0x55be32=typeof _0x1121ee[_0xa8d5('0x18')]==='undefined'&&typeof _0x1121ee[_0xa8d5('0x19')]===_0xa8d5('0x1a');var _0x7e23fc=_0x3d3661['count'];var _0x51c204=_0x55be32?0x0:_0x1121ee[_0xa8d5('0x18')];var _0x3c1235=_0x55be32?_0x3d3661[_0xa8d5('0x1b')]:_0x1121ee[_0xa8d5('0x18')]+_0x1121ee['limit'];var _0x1acbc6;if(_0x3c1235>=_0x7e23fc){_0x3c1235=_0x7e23fc;_0x1acbc6=0xc8;}else{_0x1acbc6=0xce;}_0x3bf6a4[_0xa8d5('0x15')](_0x1acbc6);return _0x3bf6a4[_0xa8d5('0x1c')](_0xa8d5('0x1d'),_0x51c204+'-'+_0x3c1235+'/'+_0x7e23fc)[_0xa8d5('0x17')](_0x3d3661);}return null;};}function patchUpdates(_0x4b2331){return function(_0x4f02c9){try{jsonpatch[_0xa8d5('0x1e')](_0x4f02c9,_0x4b2331,!![]);}catch(_0x2089c1){return BPromise[_0xa8d5('0x1f')](_0x2089c1);}return _0x4f02c9[_0xa8d5('0x20')]();};}function saveUpdates(_0x4459a4,_0x4f67fc){return function(_0x3fc651){if(_0x3fc651){return _0x3fc651[_0xa8d5('0x21')](_0x4459a4)[_0xa8d5('0x22')](function(_0x341827){return _0x341827;});}return null;};}function removeEntity(_0xe49838,_0x46dadd){return function(_0x44a20c){if(_0x44a20c){return _0x44a20c[_0xa8d5('0x23')]()[_0xa8d5('0x22')](function(){_0xe49838[_0xa8d5('0x15')](0xcc)[_0xa8d5('0x16')]();});}};}function handleEntityNotFound(_0x5ce878,_0x576012){return function(_0x4d7a7a){if(!_0x4d7a7a){_0x5ce878[_0xa8d5('0x24')](0x194);}return _0x4d7a7a;};}function handleError(_0x32a6f9,_0x2280e6){_0x2280e6=_0x2280e6||0x1f4;return function(_0x1899b6){logger[_0xa8d5('0x25')](_0x1899b6['stack']);if(_0x1899b6[_0xa8d5('0x26')]){delete _0x1899b6[_0xa8d5('0x26')];}_0x32a6f9[_0xa8d5('0x15')](_0x2280e6)['send'](_0x1899b6);};}exports[_0xa8d5('0x27')]=function(_0x19760e,_0x3dcefc){var _0x97927d={},_0x246641={},_0x45fdf0={'count':0x0,'rows':[]};var _0x57dca4=_[_0xa8d5('0x28')](db[_0xa8d5('0x29')]['rawAttributes'],function(_0x1161a7){return{'name':_0x1161a7[_0xa8d5('0x2a')],'type':_0x1161a7[_0xa8d5('0x2b')][_0xa8d5('0x2c')]};});_0x246641[_0xa8d5('0x2d')]=_['map'](_0x57dca4,_0xa8d5('0x26'));_0x246641[_0xa8d5('0x2e')]=_[_0xa8d5('0x2f')](_0x19760e[_0xa8d5('0x2e')]);_0x246641[_0xa8d5('0x30')]=_[_0xa8d5('0x31')](_0x246641[_0xa8d5('0x2d')],_0x246641['query']);_0x97927d[_0xa8d5('0x32')]=_[_0xa8d5('0x31')](_0x246641[_0xa8d5('0x2d')],qs[_0xa8d5('0x33')](_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x33')]));_0x97927d[_0xa8d5('0x32')]=_0x97927d[_0xa8d5('0x32')][_0xa8d5('0x34')]?_0x97927d[_0xa8d5('0x32')]:_0x246641[_0xa8d5('0x2d')];if(!_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x35')](_0xa8d5('0x36'))){_0x97927d[_0xa8d5('0x19')]=qs[_0xa8d5('0x19')](_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x19')]);_0x97927d[_0xa8d5('0x18')]=qs[_0xa8d5('0x18')](_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x18')]);}_0x97927d[_0xa8d5('0x37')]=qs['sort'](_0x19760e['query']['sort']);_0x97927d[_0xa8d5('0x38')]=qs['filters'](_[_0xa8d5('0x39')](_0x19760e[_0xa8d5('0x2e')],_0x246641[_0xa8d5('0x30')]),_0x57dca4);if(_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x3a')]){_0x97927d['where']=_[_0xa8d5('0x3b')](_0x97927d[_0xa8d5('0x38')],{'$or':_['map'](_0x57dca4,function(_0x30f68a){if(_0x30f68a[_0xa8d5('0x2b')]!==_0xa8d5('0x3c')){var _0x20e924={};_0x20e924[_0x30f68a['name']]={'$like':'%'+_0x19760e['query']['filter']+'%'};return _0x20e924;}})});}_0x97927d=_[_0xa8d5('0x3b')]({},_0x97927d,_0x19760e[_0xa8d5('0x3d')]);var _0x590164={'where':_0x97927d['where']};return db['SmsQueueReport'][_0xa8d5('0x1b')](_0x590164)['then'](function(_0x5aa210){_0x45fdf0['count']=_0x5aa210;if(_0x19760e[_0xa8d5('0x2e')][_0xa8d5('0x3e')]){_0x97927d[_0xa8d5('0x3f')]=[{'all':!![]}];}return db[_0xa8d5('0x29')]['findAll'](_0x97927d);})[_0xa8d5('0x22')](function(_0x17c05f){_0x45fdf0[_0xa8d5('0x40')]=_0x17c05f;return _0x45fdf0;})[_0xa8d5('0x22')](respondWithFilteredResult(_0x3dcefc,_0x97927d))[_0xa8d5('0x41')](handleError(_0x3dcefc,null));};exports[_0xa8d5('0x42')]=function(_0xbf31b4,_0x217221){var _0x546eaf={'raw':!![],'where':{'id':_0xbf31b4[_0xa8d5('0x43')]['id']}},_0x2ef934={};_0x2ef934[_0xa8d5('0x2d')]=_['keys'](db[_0xa8d5('0x29')]['rawAttributes']);_0x2ef934[_0xa8d5('0x2e')]=_[_0xa8d5('0x2f')](_0xbf31b4[_0xa8d5('0x2e')]);_0x2ef934[_0xa8d5('0x30')]=_[_0xa8d5('0x31')](_0x2ef934['model'],_0x2ef934[_0xa8d5('0x2e')]);_0x546eaf['attributes']=_[_0xa8d5('0x31')](_0x2ef934[_0xa8d5('0x2d')],qs[_0xa8d5('0x33')](_0xbf31b4['query'][_0xa8d5('0x33')]));_0x546eaf[_0xa8d5('0x32')]=_0x546eaf[_0xa8d5('0x32')][_0xa8d5('0x34')]?_0x546eaf[_0xa8d5('0x32')]:_0x2ef934['model'];if(_0xbf31b4[_0xa8d5('0x2e')]['includeAll']){_0x546eaf[_0xa8d5('0x3f')]=[{'all':!![]}];}_0x546eaf=_['merge']({},_0x546eaf,_0xbf31b4[_0xa8d5('0x3d')]);return db['SmsQueueReport']['find'](_0x546eaf)[_0xa8d5('0x22')](handleEntityNotFound(_0x217221,null))[_0xa8d5('0x22')](respondWithResult(_0x217221,null))['catch'](handleError(_0x217221,null));};exports[_0xa8d5('0x44')]=function(_0xd591d3,_0x1633e5){return db[_0xa8d5('0x29')][_0xa8d5('0x44')](_0xd591d3[_0xa8d5('0x45')],{})[_0xa8d5('0x22')](respondWithResult(_0x1633e5,0xc9))['catch'](handleError(_0x1633e5,null));};exports['update']=function(_0x24d69,_0x4eb427){if(_0x24d69[_0xa8d5('0x45')]['id']){delete _0x24d69[_0xa8d5('0x45')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x24d69['params']['id']}})[_0xa8d5('0x22')](handleEntityNotFound(_0x4eb427,null))['then'](saveUpdates(_0x24d69[_0xa8d5('0x45')],null))[_0xa8d5('0x22')](respondWithResult(_0x4eb427,null))[_0xa8d5('0x41')](handleError(_0x4eb427,null));};exports[_0xa8d5('0x23')]=function(_0xb674a,_0x573f86){return db[_0xa8d5('0x29')][_0xa8d5('0x46')]({'where':{'id':_0xb674a['params']['id']}})[_0xa8d5('0x22')](handleEntityNotFound(_0x573f86,null))[_0xa8d5('0x22')](removeEntity(_0x573f86,null))[_0xa8d5('0x41')](handleError(_0x573f86,null));};exports[_0xa8d5('0x47')]=function(_0x5c6a2c,_0x409181){return db['SmsQueueReport'][_0xa8d5('0x47')]()[_0xa8d5('0x22')](respondWithResult(_0x409181,null))[_0xa8d5('0x41')](handleError(_0x409181,null));}; \ No newline at end of file +var _0x640c=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query'];(function(_0x52f463,_0x35ae2b){var _0x539935=function(_0x36b3b4){while(--_0x36b3b4){_0x52f463['push'](_0x52f463['shift']());}};_0x539935(++_0x35ae2b);}(_0x640c,0x100));var _0xc640=function(_0x2262f5,_0x5a409f){_0x2262f5=_0x2262f5-0x0;var _0x25fc8c=_0x640c[_0x2262f5];return _0x25fc8c;};'use strict';var emlformat=require(_0xc640('0x0'));var rimraf=require(_0xc640('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc640('0x2'));var rp=require(_0xc640('0x3'));var moment=require(_0xc640('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc640('0x5'));var util=require('util');var path=require(_0xc640('0x6'));var sox=require(_0xc640('0x7'));var csv=require('to-csv');var ejs=require(_0xc640('0x8'));var fs=require('fs');var fs_extra=require(_0xc640('0x9'));var _=require(_0xc640('0xa'));var squel=require(_0xc640('0xb'));var crypto=require(_0xc640('0xc'));var jsforce=require(_0xc640('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc640('0xe'));var Papa=require('papaparse');var Redis=require(_0xc640('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc640('0x10'));var as=require(_0xc640('0x11'));var hardwareService=require(_0xc640('0x12'));var logger=require('../../config/logger')(_0xc640('0x13'));var utils=require('../../config/utils');var config=require(_0xc640('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc640('0x15'))['db'];function respondWithStatusCode(_0x22f82a,_0x15ecd9){_0x15ecd9=_0x15ecd9||0xcc;return function(_0x42038b){if(_0x42038b){return _0x22f82a['sendStatus'](_0x15ecd9);}return _0x22f82a['status'](_0x15ecd9)[_0xc640('0x16')]();};}function respondWithResult(_0x2e0832,_0x17aae5){_0x17aae5=_0x17aae5||0xc8;return function(_0xbe78f7){if(_0xbe78f7){return _0x2e0832[_0xc640('0x17')](_0x17aae5)['json'](_0xbe78f7);}};}function respondWithFilteredResult(_0x38c793,_0x2f1c38){return function(_0x5e1b1f){if(_0x5e1b1f){var _0x49c02c=typeof _0x2f1c38[_0xc640('0x18')]===_0xc640('0x19')&&typeof _0x2f1c38[_0xc640('0x1a')]===_0xc640('0x19');var _0x5299d4=_0x5e1b1f[_0xc640('0x1b')];var _0x6fda56=_0x49c02c?0x0:_0x2f1c38['offset'];var _0x4b14c6=_0x49c02c?_0x5e1b1f['count']:_0x2f1c38[_0xc640('0x18')]+_0x2f1c38['limit'];var _0x58df0b;if(_0x4b14c6>=_0x5299d4){_0x4b14c6=_0x5299d4;_0x58df0b=0xc8;}else{_0x58df0b=0xce;}_0x38c793[_0xc640('0x17')](_0x58df0b);return _0x38c793[_0xc640('0x1c')](_0xc640('0x1d'),_0x6fda56+'-'+_0x4b14c6+'/'+_0x5299d4)['json'](_0x5e1b1f);}return null;};}function patchUpdates(_0x319e48){return function(_0x528e9f){try{jsonpatch[_0xc640('0x1e')](_0x528e9f,_0x319e48,!![]);}catch(_0x16bd35){return BPromise[_0xc640('0x1f')](_0x16bd35);}return _0x528e9f[_0xc640('0x20')]();};}function saveUpdates(_0x281916,_0x2b2fbb){return function(_0x5e602d){if(_0x5e602d){return _0x5e602d[_0xc640('0x21')](_0x281916)[_0xc640('0x22')](function(_0x21077e){return _0x21077e;});}return null;};}function removeEntity(_0x56591c,_0x235451){return function(_0x3ef7d9){if(_0x3ef7d9){return _0x3ef7d9['destroy']()[_0xc640('0x22')](function(){_0x56591c[_0xc640('0x17')](0xcc)[_0xc640('0x16')]();});}};}function handleEntityNotFound(_0x54bcfc,_0x5f1667){return function(_0x416567){if(!_0x416567){_0x54bcfc[_0xc640('0x23')](0x194);}return _0x416567;};}function handleError(_0x2e2c33,_0x125929){_0x125929=_0x125929||0x1f4;return function(_0x53e865){logger[_0xc640('0x24')](_0x53e865[_0xc640('0x25')]);if(_0x53e865[_0xc640('0x26')]){delete _0x53e865[_0xc640('0x26')];}_0x2e2c33[_0xc640('0x17')](_0x125929)[_0xc640('0x27')](_0x53e865);};}exports[_0xc640('0x28')]=function(_0x5a35f7,_0x4834e8){var _0x4efd15={},_0x3c3407={},_0x386d64={'count':0x0,'rows':[]};var _0x29a153=_[_0xc640('0x29')](db[_0xc640('0x2a')]['rawAttributes'],function(_0x2fa572){return{'name':_0x2fa572[_0xc640('0x2b')],'type':_0x2fa572[_0xc640('0x2c')][_0xc640('0x2d')]};});_0x3c3407[_0xc640('0x2e')]=_[_0xc640('0x29')](_0x29a153,'name');_0x3c3407[_0xc640('0x2f')]=_[_0xc640('0x30')](_0x5a35f7['query']);_0x3c3407[_0xc640('0x31')]=_[_0xc640('0x32')](_0x3c3407[_0xc640('0x2e')],_0x3c3407[_0xc640('0x2f')]);_0x4efd15[_0xc640('0x33')]=_[_0xc640('0x32')](_0x3c3407[_0xc640('0x2e')],qs[_0xc640('0x34')](_0x5a35f7[_0xc640('0x2f')][_0xc640('0x34')]));_0x4efd15[_0xc640('0x33')]=_0x4efd15[_0xc640('0x33')][_0xc640('0x35')]?_0x4efd15[_0xc640('0x33')]:_0x3c3407[_0xc640('0x2e')];if(!_0x5a35f7['query'][_0xc640('0x36')](_0xc640('0x37'))){_0x4efd15[_0xc640('0x1a')]=qs[_0xc640('0x1a')](_0x5a35f7[_0xc640('0x2f')][_0xc640('0x1a')]);_0x4efd15[_0xc640('0x18')]=qs[_0xc640('0x18')](_0x5a35f7[_0xc640('0x2f')][_0xc640('0x18')]);}_0x4efd15['order']=qs[_0xc640('0x38')](_0x5a35f7[_0xc640('0x2f')][_0xc640('0x38')]);_0x4efd15[_0xc640('0x39')]=qs[_0xc640('0x31')](_[_0xc640('0x3a')](_0x5a35f7[_0xc640('0x2f')],_0x3c3407['filters']),_0x29a153);if(_0x5a35f7[_0xc640('0x2f')][_0xc640('0x3b')]){_0x4efd15[_0xc640('0x39')]=_[_0xc640('0x3c')](_0x4efd15[_0xc640('0x39')],{'$or':_[_0xc640('0x29')](_0x29a153,function(_0x23be75){if(_0x23be75[_0xc640('0x2c')]!==_0xc640('0x3d')){var _0x2139ad={};_0x2139ad[_0x23be75['name']]={'$like':'%'+_0x5a35f7[_0xc640('0x2f')][_0xc640('0x3b')]+'%'};return _0x2139ad;}})});}_0x4efd15=_[_0xc640('0x3c')]({},_0x4efd15,_0x5a35f7[_0xc640('0x3e')]);var _0x5d97fd={'where':_0x4efd15[_0xc640('0x39')]};return db[_0xc640('0x2a')][_0xc640('0x1b')](_0x5d97fd)[_0xc640('0x22')](function(_0x1f8484){_0x386d64[_0xc640('0x1b')]=_0x1f8484;if(_0x5a35f7['query'][_0xc640('0x3f')]){_0x4efd15[_0xc640('0x40')]=[{'all':!![]}];}return db[_0xc640('0x2a')][_0xc640('0x41')](_0x4efd15);})[_0xc640('0x22')](function(_0x36b3c0){_0x386d64[_0xc640('0x42')]=_0x36b3c0;return _0x386d64;})[_0xc640('0x22')](respondWithFilteredResult(_0x4834e8,_0x4efd15))[_0xc640('0x43')](handleError(_0x4834e8,null));};exports[_0xc640('0x44')]=function(_0x2b763b,_0x13b186){var _0x142a8d={'raw':!![],'where':{'id':_0x2b763b['params']['id']}},_0x82a7fc={};_0x82a7fc[_0xc640('0x2e')]=_[_0xc640('0x30')](db[_0xc640('0x2a')][_0xc640('0x45')]);_0x82a7fc[_0xc640('0x2f')]=_[_0xc640('0x30')](_0x2b763b[_0xc640('0x2f')]);_0x82a7fc['filters']=_[_0xc640('0x32')](_0x82a7fc[_0xc640('0x2e')],_0x82a7fc[_0xc640('0x2f')]);_0x142a8d[_0xc640('0x33')]=_[_0xc640('0x32')](_0x82a7fc[_0xc640('0x2e')],qs[_0xc640('0x34')](_0x2b763b[_0xc640('0x2f')][_0xc640('0x34')]));_0x142a8d[_0xc640('0x33')]=_0x142a8d[_0xc640('0x33')][_0xc640('0x35')]?_0x142a8d[_0xc640('0x33')]:_0x82a7fc['model'];if(_0x2b763b[_0xc640('0x2f')][_0xc640('0x3f')]){_0x142a8d[_0xc640('0x40')]=[{'all':!![]}];}_0x142a8d=_[_0xc640('0x3c')]({},_0x142a8d,_0x2b763b['options']);return db[_0xc640('0x2a')][_0xc640('0x46')](_0x142a8d)[_0xc640('0x22')](handleEntityNotFound(_0x13b186,null))[_0xc640('0x22')](respondWithResult(_0x13b186,null))['catch'](handleError(_0x13b186,null));};exports[_0xc640('0x47')]=function(_0x533750,_0x88547){return db[_0xc640('0x2a')][_0xc640('0x47')](_0x533750[_0xc640('0x48')],{})[_0xc640('0x22')](respondWithResult(_0x88547,0xc9))['catch'](handleError(_0x88547,null));};exports[_0xc640('0x21')]=function(_0x54612b,_0x1ff3fd){if(_0x54612b[_0xc640('0x48')]['id']){delete _0x54612b['body']['id'];}return db[_0xc640('0x2a')][_0xc640('0x46')]({'where':{'id':_0x54612b[_0xc640('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ff3fd,null))['then'](saveUpdates(_0x54612b['body'],null))[_0xc640('0x22')](respondWithResult(_0x1ff3fd,null))[_0xc640('0x43')](handleError(_0x1ff3fd,null));};exports[_0xc640('0x4a')]=function(_0xeda03,_0xb942e8){return db[_0xc640('0x2a')][_0xc640('0x46')]({'where':{'id':_0xeda03[_0xc640('0x49')]['id']}})[_0xc640('0x22')](handleEntityNotFound(_0xb942e8,null))[_0xc640('0x22')](removeEntity(_0xb942e8,null))[_0xc640('0x43')](handleError(_0xb942e8,null));};exports[_0xc640('0x4b')]=function(_0x4170c0,_0x140356){return db[_0xc640('0x2a')]['describe']()['then'](respondWithResult(_0x140356,null))[_0xc640('0x43')](handleError(_0x140356,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0123319..39905c6 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x2fa45f,_0x1c5bec){var _0x31c97e=function(_0x2f2c9b){while(--_0x2f2c9b){_0x2fa45f['push'](_0x2fa45f['shift']());}};_0x31c97e(++_0x1c5bec);}(_0x70e0,0x17b));var _0x070e=function(_0x4fb32a,_0x108696){_0x4fb32a=_0x4fb32a-0x0;var _0x28cb03=_0x70e0[_0x4fb32a];return _0x28cb03;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('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 d704a8f..61bab77 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 _0x547e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsQueueReport','body','options','CreateSmsQueueReport','UpdateSmsQueueReport','update','raw','where','attributes','lodash','util'];(function(_0x526676,_0x48c3e2){var _0x3638fa=function(_0x11c28a){while(--_0x11c28a){_0x526676['push'](_0x526676['shift']());}};_0x3638fa(++_0x48c3e2);}(_0x547e,0x1a2));var _0xe547=function(_0x34b880,_0x39fc3d){_0x34b880=_0x34b880-0x0;var _0x56a45e=_0x547e[_0x34b880];return _0x56a45e;};'use strict';var _=require(_0xe547('0x0'));var util=require(_0xe547('0x1'));var moment=require(_0xe547('0x2'));var BPromise=require(_0xe547('0x3'));var rs=require(_0xe547('0x4'));var fs=require('fs');var Redis=require(_0xe547('0x5'));var db=require(_0xe547('0x6'))['db'];var utils=require(_0xe547('0x7'));var logger=require(_0xe547('0x8'))(_0xe547('0x9'));var config=require(_0xe547('0xa'));var jayson=require(_0xe547('0xb'));var client=jayson[_0xe547('0xc')][_0xe547('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x55cafb,_0x5b05a9,_0xd42e3){return new BPromise(function(_0xf66a0b,_0x3d3aa1){return client[_0xe547('0xe')](_0x55cafb,_0xd42e3)[_0xe547('0xf')](function(_0x33cb95){logger[_0xe547('0x10')](_0xe547('0x11'),_0x5b05a9,_0xe547('0x12'));logger[_0xe547('0x13')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5b05a9,_0xe547('0x12'),JSON[_0xe547('0x14')](_0x33cb95));if(_0x33cb95[_0xe547('0x15')]){if(_0x33cb95[_0xe547('0x15')][_0xe547('0x16')]===0x1f4){logger[_0xe547('0x15')](_0xe547('0x11'),_0x5b05a9,_0x33cb95[_0xe547('0x15')][_0xe547('0x17')]);return _0x3d3aa1(_0x33cb95['error']['message']);}logger[_0xe547('0x15')](_0xe547('0x11'),_0x5b05a9,_0x33cb95[_0xe547('0x15')][_0xe547('0x17')]);return _0xf66a0b(_0x33cb95[_0xe547('0x15')][_0xe547('0x17')]);}else{logger[_0xe547('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x5b05a9,_0xe547('0x12'));_0xf66a0b(_0x33cb95[_0xe547('0x18')][_0xe547('0x17')]);}})[_0xe547('0x19')](function(_0xb23007){logger[_0xe547('0x15')](_0xe547('0x11'),_0x5b05a9,_0xb23007);_0x3d3aa1(_0xb23007);});});}exports['CreateSmsQueueReport']=function(_0x3b4a78){var _0xc9305e=this;return new Promise(function(_0x2cda5d,_0x1b3e0b){return db[_0xe547('0x1a')]['create'](_0x3b4a78[_0xe547('0x1b')],{'raw':_0x3b4a78[_0xe547('0x1c')]?_0x3b4a78[_0xe547('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe547('0xf')](function(_0x562f35){logger[_0xe547('0x10')](_0xe547('0x1d'),_0x3b4a78);logger[_0xe547('0x13')]('CreateSmsQueueReport',_0x3b4a78,JSON[_0xe547('0x14')](_0x562f35));_0x2cda5d(_0x562f35);})[_0xe547('0x19')](function(_0x4c9dc5){logger[_0xe547('0x15')](_0xe547('0x1d'),_0x4c9dc5[_0xe547('0x17')],_0x3b4a78);_0x1b3e0b(_0xc9305e['error'](0x1f4,_0x4c9dc5[_0xe547('0x17')]));});});};exports[_0xe547('0x1e')]=function(_0x4bcd5d){var _0xea43d4=this;return new Promise(function(_0x477f7b,_0xcd16ed){return db['SmsQueueReport'][_0xe547('0x1f')](_0x4bcd5d['body'],{'raw':_0x4bcd5d[_0xe547('0x1c')]?_0x4bcd5d[_0xe547('0x1c')][_0xe547('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bcd5d[_0xe547('0x1c')]?_0x4bcd5d['options'][_0xe547('0x21')]||null:null,'attributes':_0x4bcd5d[_0xe547('0x1c')]?_0x4bcd5d['options'][_0xe547('0x22')]||null:null,'limit':_0x4bcd5d[_0xe547('0x1c')]?_0x4bcd5d[_0xe547('0x1c')]['limit']||null:null})['then'](function(_0x11ab05){logger['info'](_0xe547('0x1e'),_0x4bcd5d);logger[_0xe547('0x13')]('UpdateSmsQueueReport',_0x4bcd5d,JSON[_0xe547('0x14')](_0x11ab05));_0x477f7b(_0x11ab05);})[_0xe547('0x19')](function(_0x1560a9){logger[_0xe547('0x15')](_0xe547('0x1e'),_0x1560a9[_0xe547('0x17')],_0x4bcd5d);_0xcd16ed(_0xea43d4[_0xe547('0x15')](0x1f4,_0x1560a9['message']));});});}; \ No newline at end of file +var _0xf8dd=['request\x20sent','code','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify','UpdateSmsQueueReport','where','attributes','limit','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x18cf42,_0x16b184){var _0x1faa26=function(_0x4a9b07){while(--_0x4a9b07){_0x18cf42['push'](_0x18cf42['shift']());}};_0x1faa26(++_0x16b184);}(_0xf8dd,0x9d));var _0xdf8d=function(_0x792c95,_0x221970){_0x792c95=_0x792c95-0x0;var _0x14ea01=_0xf8dd[_0x792c95];return _0x14ea01;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xdf8d('0x0'));var rs=require(_0xdf8d('0x1'));var fs=require('fs');var Redis=require(_0xdf8d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf8d('0x3'));var logger=require(_0xdf8d('0x4'))('rpc');var config=require(_0xdf8d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4da58c,_0x50511f,_0x2c571f){return new BPromise(function(_0x3ea464,_0x3126de){return client['request'](_0x4da58c,_0x2c571f)[_0xdf8d('0x6')](function(_0x2eacf3){logger[_0xdf8d('0x7')](_0xdf8d('0x8'),_0x50511f,'request\x20sent');logger[_0xdf8d('0x9')](_0xdf8d('0xa'),_0x50511f,_0xdf8d('0xb'),JSON['stringify'](_0x2eacf3));if(_0x2eacf3['error']){if(_0x2eacf3['error'][_0xdf8d('0xc')]===0x1f4){logger[_0xdf8d('0xd')](_0xdf8d('0x8'),_0x50511f,_0x2eacf3['error']['message']);return _0x3126de(_0x2eacf3[_0xdf8d('0xd')][_0xdf8d('0xe')]);}logger[_0xdf8d('0xd')](_0xdf8d('0x8'),_0x50511f,_0x2eacf3[_0xdf8d('0xd')]['message']);return _0x3ea464(_0x2eacf3['error'][_0xdf8d('0xe')]);}else{logger[_0xdf8d('0x7')]('SmsQueueReport,\x20%s,\x20%s',_0x50511f,'request\x20sent');_0x3ea464(_0x2eacf3[_0xdf8d('0xf')][_0xdf8d('0xe')]);}})[_0xdf8d('0x10')](function(_0x3f6056){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x50511f,_0x3f6056);_0x3126de(_0x3f6056);});});}exports[_0xdf8d('0x11')]=function(_0x3573b3){var _0x13da41=this;return new Promise(function(_0x2fe348,_0x56ba52){return db[_0xdf8d('0x12')][_0xdf8d('0x13')](_0x3573b3[_0xdf8d('0x14')],{'raw':_0x3573b3[_0xdf8d('0x15')]?_0x3573b3['options'][_0xdf8d('0x16')]===undefined?!![]:![]:!![]})[_0xdf8d('0x6')](function(_0x3471a4){logger[_0xdf8d('0x7')]('CreateSmsQueueReport',_0x3573b3);logger[_0xdf8d('0x9')](_0xdf8d('0x11'),_0x3573b3,JSON[_0xdf8d('0x17')](_0x3471a4));_0x2fe348(_0x3471a4);})[_0xdf8d('0x10')](function(_0x1c989a){logger[_0xdf8d('0xd')]('CreateSmsQueueReport',_0x1c989a[_0xdf8d('0xe')],_0x3573b3);_0x56ba52(_0x13da41['error'](0x1f4,_0x1c989a[_0xdf8d('0xe')]));});});};exports[_0xdf8d('0x18')]=function(_0x1475ac){var _0x106042=this;return new Promise(function(_0x428660,_0x33d127){return db[_0xdf8d('0x12')]['update'](_0x1475ac[_0xdf8d('0x14')],{'raw':_0x1475ac[_0xdf8d('0x15')]?_0x1475ac[_0xdf8d('0x15')][_0xdf8d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1475ac[_0xdf8d('0x15')]?_0x1475ac[_0xdf8d('0x15')][_0xdf8d('0x19')]||null:null,'attributes':_0x1475ac[_0xdf8d('0x15')]?_0x1475ac[_0xdf8d('0x15')][_0xdf8d('0x1a')]||null:null,'limit':_0x1475ac['options']?_0x1475ac[_0xdf8d('0x15')][_0xdf8d('0x1b')]||null:null})[_0xdf8d('0x6')](function(_0x106fd3){logger[_0xdf8d('0x7')]('UpdateSmsQueueReport',_0x1475ac);logger['debug']('UpdateSmsQueueReport',_0x1475ac,JSON[_0xdf8d('0x17')](_0x106fd3));_0x428660(_0x106fd3);})[_0xdf8d('0x10')](function(_0x352216){logger[_0xdf8d('0xd')](_0xdf8d('0x18'),_0x352216[_0xdf8d('0xe')],_0x1475ac);_0x33d127(_0x106042[_0xdf8d('0xd')](0x1f4,_0x352216['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 0e6119a..f0f3eab 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 _0x31c2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x31c2,0x1e1));var _0x231c=function(_0x29b29f,_0x93d8ae){_0x29b29f=_0x29b29f-0x0;var _0x763c39=_0x31c2[_0x29b29f];return _0x763c39;};'use strict';var multer=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var path=require(_0x231c('0x2'));var timeout=require(_0x231c('0x3'));var express=require(_0x231c('0x4'));var router=express[_0x231c('0x5')]();var fs_extra=require(_0x231c('0x6'));var auth=require(_0x231c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x231c('0x8'));router[_0x231c('0x9')]('/',auth[_0x231c('0xa')](),controller[_0x231c('0xb')]);router['get'](_0x231c('0xc'),auth['isAuthenticated'](),controller[_0x231c('0xd')]);router[_0x231c('0x9')](_0x231c('0xe'),auth['isAuthenticated'](),controller[_0x231c('0xf')]);router[_0x231c('0x10')]('/',auth[_0x231c('0xa')](),controller[_0x231c('0x11')]);router[_0x231c('0x12')](_0x231c('0xe'),auth[_0x231c('0xa')](),controller['update']);router[_0x231c('0x13')](_0x231c('0xe'),auth['isAuthenticated'](),controller[_0x231c('0x14')]);module[_0x231c('0x15')]=router; \ No newline at end of file +var _0xbfe8=['describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x26efa2,_0x5096d2){_0x26efa2=_0x26efa2-0x0;var _0x1784bd=_0xbfe8[_0x26efa2];return _0x1784bd;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);router['delete'](_0x8bfe('0xa'),auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);module[_0x8bfe('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2f70dba..7a3cd4c 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x8bada6,_0x5a4dd1){var _0x483b3b=function(_0x8d0a34){while(--_0x8d0a34){_0x8bada6['push'](_0x8bada6['shift']());}};_0x483b3b(++_0x5a4dd1);}(_0xaa88,0x137));var _0x8aa8=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xaa88[_0x365e54];return _0x13317a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1858e4,_0x32905c){var _0x24c04d=function(_0x1d71d5){while(--_0x1d71d5){_0x1858e4['push'](_0x1858e4['shift']());}};_0x24c04d(++_0x32905c);}(_0x70e0,0x17b));var _0x070e=function(_0x1777a9,_0x300d36){_0x1777a9=_0x1777a9-0x0;var _0x5eced8=_0x70e0[_0x1777a9];return _0x5eced8;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 945914b..f5b8ef0 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 _0x1020=['update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save'];(function(_0x8a2e9d,_0xa7a01c){var _0xf64cdd=function(_0x491bd2){while(--_0x491bd2){_0x8a2e9d['push'](_0x8a2e9d['shift']());}};_0xf64cdd(++_0xa7a01c);}(_0x1020,0x78));var _0x0102=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x1020[_0x1ebeea];return _0x576465;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0102('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0102('0x1'));var moment=require(_0x0102('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0102('0x3'));var util=require(_0x0102('0x4'));var path=require(_0x0102('0x5'));var sox=require(_0x0102('0x6'));var csv=require('to-csv');var ejs=require(_0x0102('0x7'));var fs=require('fs');var fs_extra=require(_0x0102('0x8'));var _=require('lodash');var squel=require(_0x0102('0x9'));var crypto=require(_0x0102('0xa'));var jsforce=require(_0x0102('0xb'));var deskjs=require(_0x0102('0xc'));var toCsv=require(_0x0102('0xd'));var querystring=require('querystring');var Papa=require(_0x0102('0xe'));var Redis=require(_0x0102('0xf'));var authService=require(_0x0102('0x10'));var qs=require(_0x0102('0x11'));var as=require(_0x0102('0x12'));var hardwareService=require(_0x0102('0x13'));var logger=require(_0x0102('0x14'))('api');var utils=require(_0x0102('0x15'));var config=require(_0x0102('0x16'));var licenseUtil=require(_0x0102('0x17'));var db=require(_0x0102('0x18'))['db'];function respondWithStatusCode(_0x306211,_0x9d4aab){_0x9d4aab=_0x9d4aab||0xcc;return function(_0x2a7516){if(_0x2a7516){return _0x306211[_0x0102('0x19')](_0x9d4aab);}return _0x306211['status'](_0x9d4aab)[_0x0102('0x1a')]();};}function respondWithResult(_0x7e4359,_0x57cb95){_0x57cb95=_0x57cb95||0xc8;return function(_0x2ede8b){if(_0x2ede8b){return _0x7e4359[_0x0102('0x1b')](_0x57cb95)[_0x0102('0x1c')](_0x2ede8b);}};}function respondWithFilteredResult(_0x936682,_0x26e707){return function(_0x5271e9){if(_0x5271e9){var _0x3f48ba=typeof _0x26e707[_0x0102('0x1d')]===_0x0102('0x1e')&&typeof _0x26e707[_0x0102('0x1f')]==='undefined';var _0x13f333=_0x5271e9[_0x0102('0x20')];var _0x247b74=_0x3f48ba?0x0:_0x26e707[_0x0102('0x1d')];var _0x1fc613=_0x3f48ba?_0x5271e9[_0x0102('0x20')]:_0x26e707[_0x0102('0x1d')]+_0x26e707['limit'];var _0x2f2434;if(_0x1fc613>=_0x13f333){_0x1fc613=_0x13f333;_0x2f2434=0xc8;}else{_0x2f2434=0xce;}_0x936682['status'](_0x2f2434);return _0x936682[_0x0102('0x21')]('Content-Range',_0x247b74+'-'+_0x1fc613+'/'+_0x13f333)['json'](_0x5271e9);}return null;};}function patchUpdates(_0x3d0090){return function(_0x2898fd){try{jsonpatch['apply'](_0x2898fd,_0x3d0090,!![]);}catch(_0x27e370){return BPromise[_0x0102('0x22')](_0x27e370);}return _0x2898fd[_0x0102('0x23')]();};}function saveUpdates(_0x119289,_0x2bf30f){return function(_0x447699){if(_0x447699){return _0x447699[_0x0102('0x24')](_0x119289)[_0x0102('0x25')](function(_0x411b09){return _0x411b09;});}return null;};}function removeEntity(_0x45567c,_0x5273ff){return function(_0x23f9bc){if(_0x23f9bc){return _0x23f9bc[_0x0102('0x26')]()[_0x0102('0x25')](function(){_0x45567c[_0x0102('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4862,_0xe8714){return function(_0x16e575){if(!_0x16e575){_0x4d4862['sendStatus'](0x194);}return _0x16e575;};}function handleError(_0x4b0cdb,_0x57607a){_0x57607a=_0x57607a||0x1f4;return function(_0xed3846){logger['error'](_0xed3846[_0x0102('0x27')]);if(_0xed3846['name']){delete _0xed3846[_0x0102('0x28')];}_0x4b0cdb[_0x0102('0x1b')](_0x57607a)[_0x0102('0x29')](_0xed3846);};}exports[_0x0102('0x2a')]=function(_0x2d2906,_0x591c78){var _0x11bc6f={},_0x13314c={},_0x384f87={'count':0x0,'rows':[]};var _0x466ea2=_[_0x0102('0x2b')](db['SmsTransferReport'][_0x0102('0x2c')],function(_0x30b0d6){return{'name':_0x30b0d6[_0x0102('0x2d')],'type':_0x30b0d6[_0x0102('0x2e')][_0x0102('0x2f')]};});_0x13314c['model']=_[_0x0102('0x2b')](_0x466ea2,_0x0102('0x28'));_0x13314c[_0x0102('0x30')]=_[_0x0102('0x31')](_0x2d2906[_0x0102('0x30')]);_0x13314c[_0x0102('0x32')]=_[_0x0102('0x33')](_0x13314c['model'],_0x13314c[_0x0102('0x30')]);_0x11bc6f[_0x0102('0x34')]=_[_0x0102('0x33')](_0x13314c['model'],qs['fields'](_0x2d2906[_0x0102('0x30')][_0x0102('0x35')]));_0x11bc6f[_0x0102('0x34')]=_0x11bc6f[_0x0102('0x34')][_0x0102('0x36')]?_0x11bc6f[_0x0102('0x34')]:_0x13314c[_0x0102('0x37')];if(!_0x2d2906[_0x0102('0x30')][_0x0102('0x38')](_0x0102('0x39'))){_0x11bc6f['limit']=qs[_0x0102('0x1f')](_0x2d2906[_0x0102('0x30')]['limit']);_0x11bc6f[_0x0102('0x1d')]=qs['offset'](_0x2d2906[_0x0102('0x30')][_0x0102('0x1d')]);}_0x11bc6f[_0x0102('0x3a')]=qs['sort'](_0x2d2906[_0x0102('0x30')][_0x0102('0x3b')]);_0x11bc6f[_0x0102('0x3c')]=qs[_0x0102('0x32')](_[_0x0102('0x3d')](_0x2d2906[_0x0102('0x30')],_0x13314c[_0x0102('0x32')]),_0x466ea2);if(_0x2d2906['query'][_0x0102('0x3e')]){_0x11bc6f['where']=_[_0x0102('0x3f')](_0x11bc6f[_0x0102('0x3c')],{'$or':_[_0x0102('0x2b')](_0x466ea2,function(_0x54134e){if(_0x54134e[_0x0102('0x2e')]!==_0x0102('0x40')){var _0x18f1a6={};_0x18f1a6[_0x54134e['name']]={'$like':'%'+_0x2d2906[_0x0102('0x30')][_0x0102('0x3e')]+'%'};return _0x18f1a6;}})});}_0x11bc6f=_[_0x0102('0x3f')]({},_0x11bc6f,_0x2d2906[_0x0102('0x41')]);var _0x580929={'where':_0x11bc6f[_0x0102('0x3c')]};return db[_0x0102('0x42')][_0x0102('0x20')](_0x580929)['then'](function(_0x52ea06){_0x384f87[_0x0102('0x20')]=_0x52ea06;if(_0x2d2906[_0x0102('0x30')][_0x0102('0x43')]){_0x11bc6f['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x0102('0x44')](_0x11bc6f);})[_0x0102('0x25')](function(_0x3aa64b){_0x384f87[_0x0102('0x45')]=_0x3aa64b;return _0x384f87;})['then'](respondWithFilteredResult(_0x591c78,_0x11bc6f))[_0x0102('0x46')](handleError(_0x591c78,null));};exports[_0x0102('0x47')]=function(_0x1f5e81,_0x5d3dee){var _0x3d8848={'raw':!![],'where':{'id':_0x1f5e81[_0x0102('0x48')]['id']}},_0x3db0e5={};_0x3db0e5[_0x0102('0x37')]=_[_0x0102('0x31')](db['SmsTransferReport']['rawAttributes']);_0x3db0e5['query']=_[_0x0102('0x31')](_0x1f5e81[_0x0102('0x30')]);_0x3db0e5['filters']=_[_0x0102('0x33')](_0x3db0e5['model'],_0x3db0e5[_0x0102('0x30')]);_0x3d8848[_0x0102('0x34')]=_[_0x0102('0x33')](_0x3db0e5[_0x0102('0x37')],qs[_0x0102('0x35')](_0x1f5e81['query'][_0x0102('0x35')]));_0x3d8848['attributes']=_0x3d8848[_0x0102('0x34')][_0x0102('0x36')]?_0x3d8848[_0x0102('0x34')]:_0x3db0e5['model'];if(_0x1f5e81[_0x0102('0x30')]['includeAll']){_0x3d8848[_0x0102('0x49')]=[{'all':!![]}];}_0x3d8848=_[_0x0102('0x3f')]({},_0x3d8848,_0x1f5e81[_0x0102('0x41')]);return db['SmsTransferReport'][_0x0102('0x4a')](_0x3d8848)['then'](handleEntityNotFound(_0x5d3dee,null))[_0x0102('0x25')](respondWithResult(_0x5d3dee,null))[_0x0102('0x46')](handleError(_0x5d3dee,null));};exports[_0x0102('0x4b')]=function(_0xc4da1d,_0x1dde9a){return db[_0x0102('0x42')][_0x0102('0x4b')](_0xc4da1d[_0x0102('0x4c')],{})[_0x0102('0x25')](respondWithResult(_0x1dde9a,0xc9))[_0x0102('0x46')](handleError(_0x1dde9a,null));};exports[_0x0102('0x24')]=function(_0x1ae4b5,_0x2e2342){if(_0x1ae4b5[_0x0102('0x4c')]['id']){delete _0x1ae4b5['body']['id'];}return db['SmsTransferReport'][_0x0102('0x4a')]({'where':{'id':_0x1ae4b5[_0x0102('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e2342,null))['then'](saveUpdates(_0x1ae4b5['body'],null))[_0x0102('0x25')](respondWithResult(_0x2e2342,null))[_0x0102('0x46')](handleError(_0x2e2342,null));};exports['destroy']=function(_0x42b8ef,_0x1cd772){return db['SmsTransferReport'][_0x0102('0x4a')]({'where':{'id':_0x42b8ef[_0x0102('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cd772,null))[_0x0102('0x25')](removeEntity(_0x1cd772,null))[_0x0102('0x46')](handleError(_0x1cd772,null));};exports[_0x0102('0x4d')]=function(_0x311667,_0x359487){return db[_0x0102('0x42')][_0x0102('0x4d')]()[_0x0102('0x25')](respondWithResult(_0x359487,null))['catch'](handleError(_0x359487,null));}; \ No newline at end of file +var _0xdc35=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick'];(function(_0x85d209,_0x3eb77b){var _0x25a56d=function(_0x3ea23e){while(--_0x3ea23e){_0x85d209['push'](_0x85d209['shift']());}};_0x25a56d(++_0x3eb77b);}(_0xdc35,0x133));var _0x5dc3=function(_0x2c4c64,_0x4e72d7){_0x2c4c64=_0x2c4c64-0x0;var _0x2916be=_0xdc35[_0x2c4c64];return _0x2916be;};'use strict';var emlformat=require(_0x5dc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5dc3('0x1'));var jsonpatch=require(_0x5dc3('0x2'));var rp=require(_0x5dc3('0x3'));var moment=require('moment');var BPromise=require(_0x5dc3('0x4'));var Mustache=require(_0x5dc3('0x5'));var util=require(_0x5dc3('0x6'));var path=require(_0x5dc3('0x7'));var sox=require('sox');var csv=require(_0x5dc3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5dc3('0x9'));var _=require(_0x5dc3('0xa'));var squel=require(_0x5dc3('0xb'));var crypto=require(_0x5dc3('0xc'));var jsforce=require(_0x5dc3('0xd'));var deskjs=require(_0x5dc3('0xe'));var toCsv=require(_0x5dc3('0x8'));var querystring=require('querystring');var Papa=require(_0x5dc3('0xf'));var Redis=require(_0x5dc3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5dc3('0x11'));var as=require(_0x5dc3('0x12'));var hardwareService=require(_0x5dc3('0x13'));var logger=require(_0x5dc3('0x14'))(_0x5dc3('0x15'));var utils=require('../../config/utils');var config=require(_0x5dc3('0x16'));var licenseUtil=require(_0x5dc3('0x17'));var db=require(_0x5dc3('0x18'))['db'];function respondWithStatusCode(_0x51b4a2,_0x15a798){_0x15a798=_0x15a798||0xcc;return function(_0x2c4625){if(_0x2c4625){return _0x51b4a2['sendStatus'](_0x15a798);}return _0x51b4a2[_0x5dc3('0x19')](_0x15a798)[_0x5dc3('0x1a')]();};}function respondWithResult(_0x101a23,_0x488ae7){_0x488ae7=_0x488ae7||0xc8;return function(_0x318f89){if(_0x318f89){return _0x101a23[_0x5dc3('0x19')](_0x488ae7)[_0x5dc3('0x1b')](_0x318f89);}};}function respondWithFilteredResult(_0x5b4b8a,_0x30ee25){return function(_0x18ff8e){if(_0x18ff8e){var _0x3a1ec2=typeof _0x30ee25[_0x5dc3('0x1c')]===_0x5dc3('0x1d')&&typeof _0x30ee25[_0x5dc3('0x1e')]===_0x5dc3('0x1d');var _0x1f1e80=_0x18ff8e[_0x5dc3('0x1f')];var _0x56474f=_0x3a1ec2?0x0:_0x30ee25[_0x5dc3('0x1c')];var _0x32510b=_0x3a1ec2?_0x18ff8e[_0x5dc3('0x1f')]:_0x30ee25['offset']+_0x30ee25['limit'];var _0x49341b;if(_0x32510b>=_0x1f1e80){_0x32510b=_0x1f1e80;_0x49341b=0xc8;}else{_0x49341b=0xce;}_0x5b4b8a[_0x5dc3('0x19')](_0x49341b);return _0x5b4b8a[_0x5dc3('0x20')]('Content-Range',_0x56474f+'-'+_0x32510b+'/'+_0x1f1e80)[_0x5dc3('0x1b')](_0x18ff8e);}return null;};}function patchUpdates(_0x9f75e9){return function(_0x39b627){try{jsonpatch[_0x5dc3('0x21')](_0x39b627,_0x9f75e9,!![]);}catch(_0x4b13df){return BPromise['reject'](_0x4b13df);}return _0x39b627['save']();};}function saveUpdates(_0xcaddf0,_0x76a16e){return function(_0x14a68e){if(_0x14a68e){return _0x14a68e[_0x5dc3('0x22')](_0xcaddf0)[_0x5dc3('0x23')](function(_0x16ed7e){return _0x16ed7e;});}return null;};}function removeEntity(_0x8ae971,_0x1abad7){return function(_0x18deb4){if(_0x18deb4){return _0x18deb4[_0x5dc3('0x24')]()[_0x5dc3('0x23')](function(){_0x8ae971[_0x5dc3('0x19')](0xcc)[_0x5dc3('0x1a')]();});}};}function handleEntityNotFound(_0x4f665f,_0x9434ab){return function(_0x1fddea){if(!_0x1fddea){_0x4f665f[_0x5dc3('0x25')](0x194);}return _0x1fddea;};}function handleError(_0x5b5f6a,_0x5484a0){_0x5484a0=_0x5484a0||0x1f4;return function(_0x584464){logger['error'](_0x584464['stack']);if(_0x584464[_0x5dc3('0x26')]){delete _0x584464[_0x5dc3('0x26')];}_0x5b5f6a[_0x5dc3('0x19')](_0x5484a0)['send'](_0x584464);};}exports[_0x5dc3('0x27')]=function(_0x135e6a,_0x3728a8){var _0x379e3a={},_0x39ee5f={},_0x2387b0={'count':0x0,'rows':[]};var _0x2655ec=_[_0x5dc3('0x28')](db[_0x5dc3('0x29')][_0x5dc3('0x2a')],function(_0x3a96cf){return{'name':_0x3a96cf[_0x5dc3('0x2b')],'type':_0x3a96cf[_0x5dc3('0x2c')][_0x5dc3('0x2d')]};});_0x39ee5f['model']=_[_0x5dc3('0x28')](_0x2655ec,_0x5dc3('0x26'));_0x39ee5f[_0x5dc3('0x2e')]=_[_0x5dc3('0x2f')](_0x135e6a['query']);_0x39ee5f['filters']=_[_0x5dc3('0x30')](_0x39ee5f[_0x5dc3('0x31')],_0x39ee5f[_0x5dc3('0x2e')]);_0x379e3a[_0x5dc3('0x32')]=_[_0x5dc3('0x30')](_0x39ee5f[_0x5dc3('0x31')],qs['fields'](_0x135e6a[_0x5dc3('0x2e')][_0x5dc3('0x33')]));_0x379e3a['attributes']=_0x379e3a['attributes'][_0x5dc3('0x34')]?_0x379e3a['attributes']:_0x39ee5f[_0x5dc3('0x31')];if(!_0x135e6a[_0x5dc3('0x2e')]['hasOwnProperty'](_0x5dc3('0x35'))){_0x379e3a[_0x5dc3('0x1e')]=qs[_0x5dc3('0x1e')](_0x135e6a[_0x5dc3('0x2e')][_0x5dc3('0x1e')]);_0x379e3a[_0x5dc3('0x1c')]=qs[_0x5dc3('0x1c')](_0x135e6a[_0x5dc3('0x2e')]['offset']);}_0x379e3a['order']=qs[_0x5dc3('0x36')](_0x135e6a['query']['sort']);_0x379e3a[_0x5dc3('0x37')]=qs[_0x5dc3('0x38')](_[_0x5dc3('0x39')](_0x135e6a['query'],_0x39ee5f[_0x5dc3('0x38')]),_0x2655ec);if(_0x135e6a[_0x5dc3('0x2e')][_0x5dc3('0x3a')]){_0x379e3a['where']=_[_0x5dc3('0x3b')](_0x379e3a['where'],{'$or':_[_0x5dc3('0x28')](_0x2655ec,function(_0x389310){if(_0x389310[_0x5dc3('0x2c')]!==_0x5dc3('0x3c')){var _0x21fb5c={};_0x21fb5c[_0x389310[_0x5dc3('0x26')]]={'$like':'%'+_0x135e6a['query'][_0x5dc3('0x3a')]+'%'};return _0x21fb5c;}})});}_0x379e3a=_['merge']({},_0x379e3a,_0x135e6a[_0x5dc3('0x3d')]);var _0x2f6f68={'where':_0x379e3a[_0x5dc3('0x37')]};return db[_0x5dc3('0x29')][_0x5dc3('0x1f')](_0x2f6f68)[_0x5dc3('0x23')](function(_0x509c36){_0x2387b0[_0x5dc3('0x1f')]=_0x509c36;if(_0x135e6a[_0x5dc3('0x2e')][_0x5dc3('0x3e')]){_0x379e3a[_0x5dc3('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x5dc3('0x40')](_0x379e3a);})['then'](function(_0x3e32f4){_0x2387b0[_0x5dc3('0x41')]=_0x3e32f4;return _0x2387b0;})[_0x5dc3('0x23')](respondWithFilteredResult(_0x3728a8,_0x379e3a))[_0x5dc3('0x42')](handleError(_0x3728a8,null));};exports[_0x5dc3('0x43')]=function(_0x400eb6,_0x5a9802){var _0x29bf4a={'raw':!![],'where':{'id':_0x400eb6[_0x5dc3('0x44')]['id']}},_0x5a8a01={};_0x5a8a01[_0x5dc3('0x31')]=_[_0x5dc3('0x2f')](db[_0x5dc3('0x29')][_0x5dc3('0x2a')]);_0x5a8a01[_0x5dc3('0x2e')]=_[_0x5dc3('0x2f')](_0x400eb6[_0x5dc3('0x2e')]);_0x5a8a01[_0x5dc3('0x38')]=_[_0x5dc3('0x30')](_0x5a8a01[_0x5dc3('0x31')],_0x5a8a01[_0x5dc3('0x2e')]);_0x29bf4a[_0x5dc3('0x32')]=_[_0x5dc3('0x30')](_0x5a8a01[_0x5dc3('0x31')],qs[_0x5dc3('0x33')](_0x400eb6[_0x5dc3('0x2e')][_0x5dc3('0x33')]));_0x29bf4a[_0x5dc3('0x32')]=_0x29bf4a['attributes'][_0x5dc3('0x34')]?_0x29bf4a[_0x5dc3('0x32')]:_0x5a8a01[_0x5dc3('0x31')];if(_0x400eb6[_0x5dc3('0x2e')]['includeAll']){_0x29bf4a[_0x5dc3('0x3f')]=[{'all':!![]}];}_0x29bf4a=_['merge']({},_0x29bf4a,_0x400eb6['options']);return db[_0x5dc3('0x29')][_0x5dc3('0x45')](_0x29bf4a)[_0x5dc3('0x23')](handleEntityNotFound(_0x5a9802,null))[_0x5dc3('0x23')](respondWithResult(_0x5a9802,null))['catch'](handleError(_0x5a9802,null));};exports[_0x5dc3('0x46')]=function(_0x1f5a3,_0x3d0dcf){return db['SmsTransferReport']['create'](_0x1f5a3[_0x5dc3('0x47')],{})[_0x5dc3('0x23')](respondWithResult(_0x3d0dcf,0xc9))[_0x5dc3('0x42')](handleError(_0x3d0dcf,null));};exports[_0x5dc3('0x22')]=function(_0x3880b4,_0x20f2c1){if(_0x3880b4[_0x5dc3('0x47')]['id']){delete _0x3880b4[_0x5dc3('0x47')]['id'];}return db[_0x5dc3('0x29')]['find']({'where':{'id':_0x3880b4[_0x5dc3('0x44')]['id']}})[_0x5dc3('0x23')](handleEntityNotFound(_0x20f2c1,null))[_0x5dc3('0x23')](saveUpdates(_0x3880b4['body'],null))[_0x5dc3('0x23')](respondWithResult(_0x20f2c1,null))[_0x5dc3('0x42')](handleError(_0x20f2c1,null));};exports[_0x5dc3('0x24')]=function(_0x5b28bd,_0x355178){return db[_0x5dc3('0x29')][_0x5dc3('0x45')]({'where':{'id':_0x5b28bd[_0x5dc3('0x44')]['id']}})[_0x5dc3('0x23')](handleEntityNotFound(_0x355178,null))[_0x5dc3('0x23')](removeEntity(_0x355178,null))['catch'](handleError(_0x355178,null));};exports[_0x5dc3('0x48')]=function(_0x2dfd08,_0x2fc795){return db[_0x5dc3('0x29')][_0x5dc3('0x48')]()[_0x5dc3('0x23')](respondWithResult(_0x2fc795,null))[_0x5dc3('0x42')](handleError(_0x2fc795,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 33dd575..d89c7f5 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 _0x0970=['api','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0970,0x11e));var _0x0097=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0970[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x0097('0x0'));var logger=require(_0x0097('0x1'))(_0x0097('0x2'));var moment=require(_0x0097('0x3'));var BPromise=require(_0x0097('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0097('0x5'));var rimraf=require('rimraf');var config=require(_0x0097('0x6'));var attributes=require(_0x0097('0x7'));module['exports']=function(_0x2293dc,_0x187da0){return _0x2293dc[_0x0097('0x8')](_0x0097('0x9'),attributes,{'tableName':_0x0097('0xa'),'paranoid':![],'indexes':[{'name':_0x0097('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbfb=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','exports','define'];(function(_0xcd2f34,_0x4c6fe4){var _0x578b1f=function(_0xa79595){while(--_0xa79595){_0xcd2f34['push'](_0xcd2f34['shift']());}};_0x578b1f(++_0x4c6fe4);}(_0xdbfb,0x16b));var _0xbdbf=function(_0x32abf7,_0x22c097){_0x32abf7=_0x32abf7-0x0;var _0x2720bc=_0xdbfb[_0x32abf7];return _0x2720bc;};'use strict';var _=require(_0xbdbf('0x0'));var util=require(_0xbdbf('0x1'));var logger=require('../../config/logger')(_0xbdbf('0x2'));var moment=require(_0xbdbf('0x3'));var BPromise=require('bluebird');var rp=require(_0xbdbf('0x4'));var fs=require('fs');var path=require(_0xbdbf('0x5'));var rimraf=require(_0xbdbf('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xbdbf('0x7')]=function(_0x1dd17f,_0x37e176){return _0x1dd17f[_0xbdbf('0x8')](_0xbdbf('0x9'),attributes,{'tableName':_0xbdbf('0xa'),'paranoid':![],'indexes':[{'name':_0xbdbf('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 6bfadfc..3e08594 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 _0xabe8=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','info'];(function(_0xf1c752,_0x4c49eb){var _0x155ff1=function(_0x314017){while(--_0x314017){_0xf1c752['push'](_0xf1c752['shift']());}};_0x155ff1(++_0x4c49eb);}(_0xabe8,0x8c));var _0x8abe=function(_0x4a8359,_0x30ab0d){_0x4a8359=_0x4a8359-0x0;var _0x152188=_0xabe8[_0x4a8359];return _0x152188;};'use strict';var _=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var moment=require(_0x8abe('0x2'));var BPromise=require('bluebird');var rs=require(_0x8abe('0x3'));var fs=require('fs');var Redis=require(_0x8abe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8abe('0x5'));var logger=require('../../config/logger')(_0x8abe('0x6'));var config=require(_0x8abe('0x7'));var jayson=require(_0x8abe('0x8'));var client=jayson[_0x8abe('0x9')][_0x8abe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e49d7,_0x57355d,_0x27ebd9){return new BPromise(function(_0xd686ac,_0x45ea69){return client[_0x8abe('0xb')](_0x4e49d7,_0x27ebd9)[_0x8abe('0xc')](function(_0x16e5e9){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x57355d,'request\x20sent');logger[_0x8abe('0xd')](_0x8abe('0xe'),_0x57355d,_0x8abe('0xf'),JSON[_0x8abe('0x10')](_0x16e5e9));if(_0x16e5e9[_0x8abe('0x11')]){if(_0x16e5e9['error']['code']===0x1f4){logger[_0x8abe('0x11')](_0x8abe('0x12'),_0x57355d,_0x16e5e9[_0x8abe('0x11')][_0x8abe('0x13')]);return _0x45ea69(_0x16e5e9['error']['message']);}logger['error'](_0x8abe('0x12'),_0x57355d,_0x16e5e9['error'][_0x8abe('0x13')]);return _0xd686ac(_0x16e5e9['error'][_0x8abe('0x13')]);}else{logger[_0x8abe('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x57355d,_0x8abe('0xf'));_0xd686ac(_0x16e5e9[_0x8abe('0x15')][_0x8abe('0x13')]);}})[_0x8abe('0x16')](function(_0x34b2c7){logger[_0x8abe('0x11')](_0x8abe('0x12'),_0x57355d,_0x34b2c7);_0x45ea69(_0x34b2c7);});});} \ No newline at end of file +var _0xde6c=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5eca6f,_0x76ec15){var _0x4c34b7=function(_0x52cbe1){while(--_0x52cbe1){_0x5eca6f['push'](_0x5eca6f['shift']());}};_0x4c34b7(++_0x76ec15);}(_0xde6c,0x119));var _0xcde6=function(_0x31cc6e,_0x4da430){_0x31cc6e=_0x31cc6e-0x0;var _0x39a234=_0xde6c[_0x31cc6e];return _0x39a234;};'use strict';var _=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var moment=require('moment');var BPromise=require(_0xcde6('0x2'));var rs=require(_0xcde6('0x3'));var fs=require('fs');var Redis=require(_0xcde6('0x4'));var db=require(_0xcde6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde6('0x6'))(_0xcde6('0x7'));var config=require(_0xcde6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcde6('0x9')][_0xcde6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5543d9,_0x4c37b1,_0x2f7de6){return new BPromise(function(_0x4f07e8,_0x19d6b2){return client[_0xcde6('0xb')](_0x5543d9,_0x2f7de6)[_0xcde6('0xc')](function(_0x353b84){logger['info'](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));logger['debug'](_0xcde6('0xf'),_0x4c37b1,_0xcde6('0xe'),JSON[_0xcde6('0x10')](_0x353b84));if(_0x353b84[_0xcde6('0x11')]){if(_0x353b84[_0xcde6('0x11')][_0xcde6('0x12')]===0x1f4){logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x19d6b2(_0x353b84['error'][_0xcde6('0x13')]);}logger[_0xcde6('0x11')](_0xcde6('0xd'),_0x4c37b1,_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);return _0x4f07e8(_0x353b84[_0xcde6('0x11')][_0xcde6('0x13')]);}else{logger[_0xcde6('0x14')](_0xcde6('0xd'),_0x4c37b1,_0xcde6('0xe'));_0x4f07e8(_0x353b84['result'][_0xcde6('0x13')]);}})[_0xcde6('0x15')](function(_0x38f82a){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x4c37b1,_0x38f82a);_0x19d6b2(_0x38f82a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 249e6fe..4524036 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 _0x09f1=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','single','put'];(function(_0x312acf,_0x427334){var _0x1c3f7b=function(_0x27c57a){while(--_0x27c57a){_0x312acf['push'](_0x312acf['shift']());}};_0x1c3f7b(++_0x427334);}(_0x09f1,0x177));var _0x109f=function(_0x3350fd,_0x4bbad4){_0x3350fd=_0x3350fd-0x0;var _0x1740f6=_0x09f1[_0x3350fd];return _0x1740f6;};'use strict';var multer=require(_0x109f('0x0'));var util=require(_0x109f('0x1'));var path=require(_0x109f('0x2'));var timeout=require(_0x109f('0x3'));var express=require(_0x109f('0x4'));var router=express[_0x109f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x109f('0x6'));var interaction=require(_0x109f('0x7'));var config=require(_0x109f('0x8'));var controller=require(_0x109f('0x9'));router[_0x109f('0xa')]('/',auth[_0x109f('0xb')](),controller[_0x109f('0xc')]);router[_0x109f('0xa')](_0x109f('0xd'),auth[_0x109f('0xb')](),controller[_0x109f('0xe')]);router['get'](_0x109f('0xf'),auth[_0x109f('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x109f('0x10')]({'destination':function(_0x3c5a65,_0xcab90d,_0x1074c2){_0x1074c2(null,path[_0x109f('0x11')](config[_0x109f('0x12')],'server/files/sounds/original/'));},'filename':function(_0x549e7f,_0x1524d3,_0x3d926c){_0x1524d3[_0x109f('0x13')]=_0x1524d3[_0x109f('0x13')][_0x109f('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d926c(null,util[_0x109f('0x15')](_0x109f('0x16'),path[_0x109f('0x17')](_0x1524d3['originalname'],path[_0x109f('0x18')](_0x1524d3[_0x109f('0x13')])),Date['now'](),path['extname'](_0x1524d3[_0x109f('0x13')])));}})});router[_0x109f('0x19')]('/',upload[_0x109f('0x1a')]('file'),controller['create']);router[_0x109f('0x1b')](_0x109f('0xd'),auth[_0x109f('0xb')](),controller[_0x109f('0x1c')]);router[_0x109f('0x1d')](_0x109f('0xd'),auth[_0x109f('0xb')](),controller[_0x109f('0x1d')]);module[_0x109f('0x1e')]=router; \ No newline at end of file +var _0x95d9=['server/files/sounds/original/','originalname','replace','format','basename','extname','post','single','file','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','root'];(function(_0x188be5,_0x58d066){var _0x464205=function(_0x398e35){while(--_0x398e35){_0x188be5['push'](_0x188be5['shift']());}};_0x464205(++_0x58d066);}(_0x95d9,0x138));var _0x995d=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x95d9[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var path=require(_0x995d('0x2'));var timeout=require(_0x995d('0x3'));var express=require(_0x995d('0x4'));var router=express[_0x995d('0x5')]();var fs_extra=require(_0x995d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x995d('0x7'));var config=require('../../config/environment');var controller=require(_0x995d('0x8'));router[_0x995d('0x9')]('/',auth[_0x995d('0xa')](),controller['index']);router[_0x995d('0x9')](_0x995d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x995d('0x9')]('/:id/download',auth[_0x995d('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4572d6,_0x47cf9d,_0x54984d){_0x54984d(null,path['join'](config[_0x995d('0xc')],_0x995d('0xd')));},'filename':function(_0x50de6a,_0x440e41,_0x1517b7){_0x440e41[_0x995d('0xe')]=_0x440e41['originalname'][_0x995d('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1517b7(null,util[_0x995d('0x10')]('%s-%s%s',path[_0x995d('0x11')](_0x440e41[_0x995d('0xe')],path[_0x995d('0x12')](_0x440e41[_0x995d('0xe')])),Date['now'](),path['extname'](_0x440e41[_0x995d('0xe')])));}})});router[_0x995d('0x13')]('/',upload[_0x995d('0x14')](_0x995d('0x15')),controller['create']);router[_0x995d('0x16')](_0x995d('0xb'),auth['isAuthenticated'](),controller[_0x995d('0x17')]);router[_0x995d('0x18')](_0x995d('0xb'),auth[_0x995d('0xa')](),controller[_0x995d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index e3bf183..184934a 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 _0x1e26=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x2064d9,_0xb788eb){var _0x4d4e55=function(_0x5add5e){while(--_0x5add5e){_0x2064d9['push'](_0x2064d9['shift']());}};_0x4d4e55(++_0xb788eb);}(_0x1e26,0x18f));var _0x61e2=function(_0x5498c4,_0x24233e){_0x5498c4=_0x5498c4-0x0;var _0x2b26d7=_0x1e26[_0x5498c4];return _0x2b26d7;};'use strict';var Sequelize=require(_0x61e2('0x0'));module[_0x61e2('0x1')]={'name':{'type':Sequelize[_0x61e2('0x2')],'unique':_0x61e2('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x61e2('0x2')]},'display_name':{'type':Sequelize[_0x61e2('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x61e2('0x4')]},'original_sampleCount':{'type':Sequelize[_0x61e2('0x5')]},'original_channelCount':{'type':Sequelize[_0x61e2('0x6')]},'original_bitRate':{'type':Sequelize[_0x61e2('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x61e2('0x5')]},'converted_channelCount':{'type':Sequelize[_0x61e2('0x6')]},'converted_bitRate':{'type':Sequelize[_0x61e2('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6561=['INTEGER','sequelize','STRING','name','BIGINT'];(function(_0x426c24,_0x4ea696){var _0x1e0dda=function(_0x19ceed){while(--_0x19ceed){_0x426c24['push'](_0x426c24['shift']());}};_0x1e0dda(++_0x4ea696);}(_0x6561,0xba));var _0x1656=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0x6561[_0x498b38];return _0x10feb7;};'use strict';var Sequelize=require(_0x1656('0x0'));module['exports']={'name':{'type':Sequelize[_0x1656('0x1')],'unique':_0x1656('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1656('0x1')]},'display_name':{'type':Sequelize[_0x1656('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x1656('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x1656('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x1656('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x1656('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x1656('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x1656('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 531c3cc..0294bfb 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 _0x80e3=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','download','save_name','converted_format','existsSync','root','Sequelize','ValidationError','Sound\x20not\x20found','join','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','original_format','eml-format','rimraf','fast-json-patch'];(function(_0x43bf52,_0x445353){var _0x2dd589=function(_0x19729e){while(--_0x19729e){_0x43bf52['push'](_0x43bf52['shift']());}};_0x2dd589(++_0x445353);}(_0x80e3,0x1ed));var _0x380e=function(_0x2f842d,_0x4214aa){_0x2f842d=_0x2f842d-0x0;var _0x50c500=_0x80e3[_0x2f842d];return _0x50c500;};'use strict';var emlformat=require(_0x380e('0x0'));var rimraf=require(_0x380e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x380e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x380e('0x3'));var Mustache=require(_0x380e('0x4'));var util=require(_0x380e('0x5'));var path=require(_0x380e('0x6'));var sox=require('sox');var csv=require(_0x380e('0x7'));var ejs=require(_0x380e('0x8'));var fs=require('fs');var fs_extra=require(_0x380e('0x9'));var _=require(_0x380e('0xa'));var squel=require(_0x380e('0xb'));var crypto=require(_0x380e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x380e('0xd'));var Papa=require(_0x380e('0xe'));var Redis=require(_0x380e('0xf'));var authService=require(_0x380e('0x10'));var qs=require(_0x380e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x380e('0x12'))(_0x380e('0x13'));var utils=require(_0x380e('0x14'));var config=require(_0x380e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x380e('0x16'))['db'];function respondWithStatusCode(_0x4583f5,_0x7bfacb){_0x7bfacb=_0x7bfacb||0xcc;return function(_0x203019){if(_0x203019){return _0x4583f5[_0x380e('0x17')](_0x7bfacb);}return _0x4583f5[_0x380e('0x18')](_0x7bfacb)[_0x380e('0x19')]();};}function respondWithResult(_0x186e8c,_0x5b30f3){_0x5b30f3=_0x5b30f3||0xc8;return function(_0x4f868a){if(_0x4f868a){return _0x186e8c[_0x380e('0x18')](_0x5b30f3)['json'](_0x4f868a);}};}function respondWithFilteredResult(_0x429440,_0x1824cd){return function(_0x3932ab){if(_0x3932ab){var _0x3560a2=typeof _0x1824cd['offset']===_0x380e('0x1a')&&typeof _0x1824cd[_0x380e('0x1b')]===_0x380e('0x1a');var _0x18cc57=_0x3932ab[_0x380e('0x1c')];var _0x5a814c=_0x3560a2?0x0:_0x1824cd[_0x380e('0x1d')];var _0x4aa0b4=_0x3560a2?_0x3932ab[_0x380e('0x1c')]:_0x1824cd[_0x380e('0x1d')]+_0x1824cd[_0x380e('0x1b')];var _0x213058;if(_0x4aa0b4>=_0x18cc57){_0x4aa0b4=_0x18cc57;_0x213058=0xc8;}else{_0x213058=0xce;}_0x429440[_0x380e('0x18')](_0x213058);return _0x429440[_0x380e('0x1e')]('Content-Range',_0x5a814c+'-'+_0x4aa0b4+'/'+_0x18cc57)[_0x380e('0x1f')](_0x3932ab);}return null;};}function patchUpdates(_0x9d4f28){return function(_0x47d385){try{jsonpatch['apply'](_0x47d385,_0x9d4f28,!![]);}catch(_0x1e12c7){return BPromise[_0x380e('0x20')](_0x1e12c7);}return _0x47d385[_0x380e('0x21')]();};}function saveUpdates(_0x29609e,_0x3e8f6d){return function(_0x277318){if(_0x277318){return _0x277318[_0x380e('0x22')](_0x29609e)[_0x380e('0x23')](function(_0x371777){return _0x371777;});}return null;};}function removeEntity(_0x83ca42,_0x288e94){return function(_0x544e01){if(_0x544e01){return _0x544e01[_0x380e('0x24')]()[_0x380e('0x23')](function(){var _0x2f5f61=_0x544e01[_0x380e('0x25')]({'plain':!![]});var _0x2517a4='Sounds';return db[_0x380e('0x26')][_0x380e('0x24')]({'where':{'type':_0x2517a4,'resourceId':_0x2f5f61['id']}})['then'](function(){return _0x544e01;});})[_0x380e('0x23')](function(){_0x83ca42[_0x380e('0x18')](0xcc)[_0x380e('0x19')]();});}};}function handleEntityNotFound(_0x28a1a9,_0x406c2a){return function(_0x195466){if(!_0x195466){_0x28a1a9[_0x380e('0x17')](0x194);}return _0x195466;};}function handleError(_0x1eaace,_0x54e203){_0x54e203=_0x54e203||0x1f4;return function(_0x541c18){logger['error'](_0x541c18[_0x380e('0x27')]);if(_0x541c18[_0x380e('0x28')]){delete _0x541c18[_0x380e('0x28')];}_0x1eaace[_0x380e('0x18')](_0x54e203)['send'](_0x541c18);};}exports[_0x380e('0x29')]=function(_0x474d4c,_0x28558c){var _0x21d6dc={},_0x4bd1d0={},_0x55fe54={'count':0x0,'rows':[]};var _0x5defb=_[_0x380e('0x2a')](db[_0x380e('0x2b')][_0x380e('0x2c')],function(_0x19a6de){return{'name':_0x19a6de[_0x380e('0x2d')],'type':_0x19a6de[_0x380e('0x2e')][_0x380e('0x2f')]};});_0x4bd1d0[_0x380e('0x30')]=_[_0x380e('0x2a')](_0x5defb,_0x380e('0x28'));_0x4bd1d0[_0x380e('0x31')]=_[_0x380e('0x32')](_0x474d4c['query']);_0x4bd1d0[_0x380e('0x33')]=_[_0x380e('0x34')](_0x4bd1d0['model'],_0x4bd1d0[_0x380e('0x31')]);_0x21d6dc[_0x380e('0x35')]=_[_0x380e('0x34')](_0x4bd1d0['model'],qs[_0x380e('0x36')](_0x474d4c[_0x380e('0x31')][_0x380e('0x36')]));_0x21d6dc[_0x380e('0x35')]=_0x21d6dc[_0x380e('0x35')][_0x380e('0x37')]?_0x21d6dc[_0x380e('0x35')]:_0x4bd1d0[_0x380e('0x30')];if(!_0x474d4c[_0x380e('0x31')]['hasOwnProperty'](_0x380e('0x38'))){_0x21d6dc[_0x380e('0x1b')]=qs[_0x380e('0x1b')](_0x474d4c[_0x380e('0x31')][_0x380e('0x1b')]);_0x21d6dc[_0x380e('0x1d')]=qs[_0x380e('0x1d')](_0x474d4c[_0x380e('0x31')][_0x380e('0x1d')]);}_0x21d6dc['order']=qs[_0x380e('0x39')](_0x474d4c[_0x380e('0x31')]['sort']);_0x21d6dc[_0x380e('0x3a')]=qs[_0x380e('0x33')](_[_0x380e('0x3b')](_0x474d4c[_0x380e('0x31')],_0x4bd1d0[_0x380e('0x33')]),_0x5defb);if(_0x474d4c[_0x380e('0x31')][_0x380e('0x3c')]){_0x21d6dc[_0x380e('0x3a')]=_[_0x380e('0x3d')](_0x21d6dc[_0x380e('0x3a')],{'$or':_[_0x380e('0x2a')](_0x5defb,function(_0x3b0c70){if(_0x3b0c70[_0x380e('0x2e')]!==_0x380e('0x3e')){var _0x521680={};_0x521680[_0x3b0c70[_0x380e('0x28')]]={'$like':'%'+_0x474d4c[_0x380e('0x31')][_0x380e('0x3c')]+'%'};return _0x521680;}})});}_0x21d6dc=_[_0x380e('0x3d')]({},_0x21d6dc,_0x474d4c[_0x380e('0x3f')]);var _0x246424={'where':_0x21d6dc[_0x380e('0x3a')]};return db['Sound']['count'](_0x246424)[_0x380e('0x23')](function(_0x1ef270){_0x55fe54[_0x380e('0x1c')]=_0x1ef270;if(_0x474d4c[_0x380e('0x31')][_0x380e('0x40')]){_0x21d6dc[_0x380e('0x41')]=[{'all':!![]}];}return db[_0x380e('0x2b')][_0x380e('0x42')](_0x21d6dc);})[_0x380e('0x23')](function(_0x5acacd){_0x55fe54[_0x380e('0x43')]=_0x5acacd;return _0x55fe54;})[_0x380e('0x23')](respondWithFilteredResult(_0x28558c,_0x21d6dc))[_0x380e('0x44')](handleError(_0x28558c,null));};exports['show']=function(_0x9656e4,_0x119a18){var _0x35acd5={'raw':!![],'where':{'id':_0x9656e4[_0x380e('0x45')]['id']}},_0x35e220={};_0x35e220[_0x380e('0x30')]=_['keys'](db[_0x380e('0x2b')][_0x380e('0x2c')]);_0x35e220[_0x380e('0x31')]=_[_0x380e('0x32')](_0x9656e4[_0x380e('0x31')]);_0x35e220[_0x380e('0x33')]=_[_0x380e('0x34')](_0x35e220[_0x380e('0x30')],_0x35e220[_0x380e('0x31')]);_0x35acd5['attributes']=_[_0x380e('0x34')](_0x35e220[_0x380e('0x30')],qs[_0x380e('0x36')](_0x9656e4[_0x380e('0x31')][_0x380e('0x36')]));_0x35acd5[_0x380e('0x35')]=_0x35acd5[_0x380e('0x35')][_0x380e('0x37')]?_0x35acd5['attributes']:_0x35e220[_0x380e('0x30')];if(_0x9656e4[_0x380e('0x31')][_0x380e('0x40')]){_0x35acd5['include']=[{'all':!![]}];}_0x35acd5=_[_0x380e('0x3d')]({},_0x35acd5,_0x9656e4['options']);return db[_0x380e('0x2b')]['find'](_0x35acd5)['then'](handleEntityNotFound(_0x119a18,null))[_0x380e('0x23')](respondWithResult(_0x119a18,null))[_0x380e('0x44')](handleError(_0x119a18,null));};exports[_0x380e('0x46')]=function(_0xd45017,_0x2300b3,_0x1ef164){return db[_0x380e('0x2b')]['find']({'where':{'id':_0xd45017[_0x380e('0x45')]['id']},'attributes':[_0x380e('0x28'),_0x380e('0x47'),_0x380e('0x48')],'raw':!![]})[_0x380e('0x23')](handleEntityNotFound(_0x2300b3,null))[_0x380e('0x23')](function(_0x49387b){if(_0x49387b){if(!fs[_0x380e('0x49')](path['join'](config[_0x380e('0x4a')],'server/files/sounds/converted',_0x49387b['save_name']+'.'+_0x49387b[_0x380e('0x48')]))){throw new db[(_0x380e('0x4b'))][(_0x380e('0x4c'))](_0x380e('0x4d'));}return _0x2300b3['download'](path[_0x380e('0x4e')](config[_0x380e('0x4a')],_0x380e('0x4f'),util[_0x380e('0x50')](_0x380e('0x51'),_0x49387b[_0x380e('0x47')],_0x49387b[_0x380e('0x48')])),util[_0x380e('0x50')](_0x380e('0x51'),_0x49387b[_0x380e('0x28')],_0x49387b['converted_format']));}return null;})[_0x380e('0x44')](handleError(_0x2300b3,null));};exports[_0x380e('0x52')]=function(_0x361e22,_0xd9bae5,_0x487653){var _0x317a84={'name':path[_0x380e('0x53')](_0x361e22[_0x380e('0x54')][_0x380e('0x55')],path[_0x380e('0x56')](_0x361e22[_0x380e('0x54')]['originalname'])),'save_name':path['basename'](_0x361e22[_0x380e('0x54')][_0x380e('0x57')],path[_0x380e('0x56')](_0x361e22[_0x380e('0x54')][_0x380e('0x57')])),'original_format':path[_0x380e('0x56')](_0x361e22[_0x380e('0x54')]['originalname'])[_0x380e('0x58')](0x1),'converted_format':_0x380e('0x59')};var _0x15fa28=path[_0x380e('0x4e')](config[_0x380e('0x4a')],_0x380e('0x5a'),_0x361e22['file']['filename']);var _0x18da88=path[_0x380e('0x4e')](config['root'],_0x380e('0x4f'),util[_0x380e('0x50')](_0x380e('0x51'),path['basename'](_0x361e22[_0x380e('0x54')]['filename'],path[_0x380e('0x56')](_0x361e22['file']['filename'])),_0x317a84['converted_format']));logger[_0x380e('0x5b')](_0x380e('0x5c'),_0x15fa28);logger['info'](_0x380e('0x5d'),_0x18da88);try{fs[_0x380e('0x5e')](_0x15fa28,parseInt(_0x380e('0x5f'),0x8));var _0x214d8b=sox[_0x380e('0x60')](_0x15fa28,_0x18da88,{'sampleRate':0x1f40,'format':_0x380e('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x214d8b['on'](_0x380e('0x61'),function(_0x5ea8d7){fs[_0x380e('0x62')](_0x15fa28);_0xd9bae5[_0x380e('0x18')](0x1f4)[_0x380e('0x63')](_0x5ea8d7);});_0x214d8b['on']('src',function(_0x1af662){_0x317a84[_0x380e('0x64')]=isNaN(_0x1af662['duration'])?null:_0x1af662[_0x380e('0x65')]*0x3e8;_0x317a84['original_sampleCount']=isNaN(_0x1af662['sampleCount'])?null:_0x1af662[_0x380e('0x66')];_0x317a84[_0x380e('0x67')]=isNaN(_0x1af662[_0x380e('0x68')])?null:_0x1af662[_0x380e('0x68')];_0x317a84[_0x380e('0x69')]=isNaN(_0x1af662[_0x380e('0x6a')])?null:_0x1af662[_0x380e('0x6a')];_0x317a84[_0x380e('0x6b')]=isNaN(_0x1af662[_0x380e('0x6c')])?null:_0x1af662[_0x380e('0x6c')];});_0x214d8b['on'](_0x380e('0x6d'),function(_0x52c326){_0x317a84[_0x380e('0x6e')]=isNaN(_0x52c326[_0x380e('0x65')])?null:_0x52c326[_0x380e('0x65')]*0x3e8;_0x317a84[_0x380e('0x6f')]=isNaN(_0x52c326[_0x380e('0x66')])?null:_0x52c326[_0x380e('0x66')];_0x317a84[_0x380e('0x70')]=isNaN(_0x52c326[_0x380e('0x68')])?null:_0x52c326[_0x380e('0x68')];_0x317a84['converted_bitRate']=isNaN(_0x52c326[_0x380e('0x6a')])?null:_0x52c326[_0x380e('0x6a')];_0x317a84[_0x380e('0x71')]=isNaN(_0x52c326[_0x380e('0x6c')])?null:_0x52c326[_0x380e('0x6c')];});_0x214d8b['on']('end',function(){fs['chmodSync'](_0x18da88,parseInt(_0x380e('0x5f'),0x8));return db['Sound'][_0x380e('0x52')](_0x317a84)[_0x380e('0x23')](function(_0x21b578){var _0x249af6={'role':_0x361e22[_0x380e('0x72')]['role'],'userProfileId':_0x361e22[_0x380e('0x72')][_0x380e('0x73')]};if(!_0x249af6)throw new Error(_0x380e('0x74'));if(_0x249af6[_0x380e('0x75')]===_0x380e('0x76')){var _0x106bf0=_0x21b578[_0x380e('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x380e('0x77')]({'where':{'name':_0x380e('0x78'),'userProfileId':_0x249af6[_0x380e('0x73')]},'raw':!![]})[_0x380e('0x23')](function(_0x1c05e8){if(_0x1c05e8&&_0x1c05e8['autoAssociation']===0x0){return db[_0x380e('0x26')][_0x380e('0x52')]({'name':_0x106bf0[_0x380e('0x28')],'resourceId':_0x106bf0['id'],'type':_0x1c05e8['name'],'sectionId':_0x1c05e8['id']},{})[_0x380e('0x23')](function(){return _0x21b578;});}else{return _0x21b578;}})[_0x380e('0x44')](function(_0x57ec50){logger[_0x380e('0x61')](_0x380e('0x79'),_0x57ec50);throw _0x57ec50;});}return _0x21b578;})[_0x380e('0x23')](respondWithResult(_0xd9bae5,null))['catch'](handleError(_0xd9bae5,null));});_0x214d8b['start']();}catch(_0x19828c){_0xd9bae5[_0x380e('0x18')](0x1f4)[_0x380e('0x63')](_0x19828c);}};exports[_0x380e('0x22')]=function(_0x5733a7,_0x2e2633,_0x36621d){return db[_0x380e('0x2b')]['find']({'where':{'id':_0x5733a7[_0x380e('0x45')]['id']}})[_0x380e('0x23')](handleEntityNotFound(_0x2e2633,null))[_0x380e('0x23')](saveUpdates(_[_0x380e('0x3b')](_0x5733a7[_0x380e('0x72')],[_0x380e('0x28'),_0x380e('0x7a')]),null))[_0x380e('0x23')](respondWithResult(_0x2e2633,null))['catch'](handleError(_0x2e2633,null));};exports['delete']=function(_0x902c26,_0x3df4ba,_0x1f4af9){return db[_0x380e('0x2b')][_0x380e('0x77')]({'where':{'id':_0x902c26[_0x380e('0x45')]['id']}})[_0x380e('0x23')](function(_0x58427b){if(_0x58427b){return _0x58427b['destroy']();}})[_0x380e('0x23')](function(_0xfa6db7){var _0x5c666b=path[_0x380e('0x4e')](config[_0x380e('0x4a')],_0x380e('0x5a'),util[_0x380e('0x50')]('%s.%s',_0xfa6db7['save_name'],_0xfa6db7[_0x380e('0x7b')]));var _0x362085=path['join'](config[_0x380e('0x4a')],_0x380e('0x4f'),util[_0x380e('0x50')](_0x380e('0x51'),_0xfa6db7[_0x380e('0x47')],_0xfa6db7[_0x380e('0x48')]));fs[_0x380e('0x62')](_0x5c666b);fs['unlinkSync'](_0x362085);return _0xfa6db7;})[_0x380e('0x23')](function(_0x1055b1){if(_0x1055b1){return _0x3df4ba[_0x380e('0x18')](0xcc)[_0x380e('0x19')]();}})[_0x380e('0x23')](handleEntityNotFound(_0x3df4ba,null))['catch'](handleError(_0x3df4ba,null));}; \ No newline at end of file +var _0x8230=['autoAssociation','start','update','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','Sounds','UserProfileResource','error','name','send','map','Sound','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','catch','save_name','existsSync','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','join','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','root','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','find'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x8230,0x101));var _0x0823=function(_0x264662,_0x3b66be){_0x264662=_0x264662-0x0;var _0x3c4792=_0x8230[_0x264662];return _0x3c4792;};'use strict';var emlformat=require(_0x0823('0x0'));var rimraf=require(_0x0823('0x1'));var zipdir=require(_0x0823('0x2'));var jsonpatch=require(_0x0823('0x3'));var rp=require('request-promise');var moment=require(_0x0823('0x4'));var BPromise=require(_0x0823('0x5'));var Mustache=require(_0x0823('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0823('0x7'));var csv=require('to-csv');var ejs=require(_0x0823('0x8'));var fs=require('fs');var fs_extra=require(_0x0823('0x9'));var _=require(_0x0823('0xa'));var squel=require(_0x0823('0xb'));var crypto=require(_0x0823('0xc'));var jsforce=require(_0x0823('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0823('0xe'));var querystring=require(_0x0823('0xf'));var Papa=require(_0x0823('0x10'));var Redis=require('ioredis');var authService=require(_0x0823('0x11'));var qs=require(_0x0823('0x12'));var as=require(_0x0823('0x13'));var hardwareService=require(_0x0823('0x14'));var logger=require(_0x0823('0x15'))('api');var utils=require(_0x0823('0x16'));var config=require(_0x0823('0x17'));var licenseUtil=require(_0x0823('0x18'));var db=require(_0x0823('0x19'))['db'];function respondWithStatusCode(_0x298d5f,_0x2c5a7f){_0x2c5a7f=_0x2c5a7f||0xcc;return function(_0xe10190){if(_0xe10190){return _0x298d5f[_0x0823('0x1a')](_0x2c5a7f);}return _0x298d5f[_0x0823('0x1b')](_0x2c5a7f)[_0x0823('0x1c')]();};}function respondWithResult(_0x3a7b1b,_0x387aba){_0x387aba=_0x387aba||0xc8;return function(_0x5b1d6e){if(_0x5b1d6e){return _0x3a7b1b[_0x0823('0x1b')](_0x387aba)[_0x0823('0x1d')](_0x5b1d6e);}};}function respondWithFilteredResult(_0x42b987,_0x264d23){return function(_0x24aaf4){if(_0x24aaf4){var _0x3fdfd0=typeof _0x264d23[_0x0823('0x1e')]===_0x0823('0x1f')&&typeof _0x264d23[_0x0823('0x20')]===_0x0823('0x1f');var _0x4826ec=_0x24aaf4[_0x0823('0x21')];var _0x3ae16e=_0x3fdfd0?0x0:_0x264d23[_0x0823('0x1e')];var _0xf7868=_0x3fdfd0?_0x24aaf4['count']:_0x264d23[_0x0823('0x1e')]+_0x264d23[_0x0823('0x20')];var _0x40835d;if(_0xf7868>=_0x4826ec){_0xf7868=_0x4826ec;_0x40835d=0xc8;}else{_0x40835d=0xce;}_0x42b987[_0x0823('0x1b')](_0x40835d);return _0x42b987[_0x0823('0x22')](_0x0823('0x23'),_0x3ae16e+'-'+_0xf7868+'/'+_0x4826ec)[_0x0823('0x1d')](_0x24aaf4);}return null;};}function patchUpdates(_0x3a8d33){return function(_0xd6ffdc){try{jsonpatch[_0x0823('0x24')](_0xd6ffdc,_0x3a8d33,!![]);}catch(_0x5851b8){return BPromise[_0x0823('0x25')](_0x5851b8);}return _0xd6ffdc['save']();};}function saveUpdates(_0x1f99ab,_0x3e5855){return function(_0x48a1f2){if(_0x48a1f2){return _0x48a1f2['update'](_0x1f99ab)[_0x0823('0x26')](function(_0x3e6eac){return _0x3e6eac;});}return null;};}function removeEntity(_0x5f1893,_0x36ab12){return function(_0x417f68){if(_0x417f68){return _0x417f68['destroy']()[_0x0823('0x26')](function(){var _0x1eae00=_0x417f68[_0x0823('0x27')]({'plain':!![]});var _0x12b3b0=_0x0823('0x28');return db[_0x0823('0x29')]['destroy']({'where':{'type':_0x12b3b0,'resourceId':_0x1eae00['id']}})[_0x0823('0x26')](function(){return _0x417f68;});})[_0x0823('0x26')](function(){_0x5f1893[_0x0823('0x1b')](0xcc)[_0x0823('0x1c')]();});}};}function handleEntityNotFound(_0x44a423,_0x513ead){return function(_0xd424c1){if(!_0xd424c1){_0x44a423[_0x0823('0x1a')](0x194);}return _0xd424c1;};}function handleError(_0x3aa7b6,_0x117305){_0x117305=_0x117305||0x1f4;return function(_0x58c548){logger[_0x0823('0x2a')](_0x58c548['stack']);if(_0x58c548[_0x0823('0x2b')]){delete _0x58c548[_0x0823('0x2b')];}_0x3aa7b6[_0x0823('0x1b')](_0x117305)[_0x0823('0x2c')](_0x58c548);};}exports['index']=function(_0x5ddf5c,_0x3f60c0){var _0x41c5f0={},_0x233418={},_0x3f3c32={'count':0x0,'rows':[]};var _0x1620b7=_[_0x0823('0x2d')](db[_0x0823('0x2e')]['rawAttributes'],function(_0x58cc57){return{'name':_0x58cc57[_0x0823('0x2f')],'type':_0x58cc57['type'][_0x0823('0x30')]};});_0x233418[_0x0823('0x31')]=_[_0x0823('0x2d')](_0x1620b7,_0x0823('0x2b'));_0x233418[_0x0823('0x32')]=_[_0x0823('0x33')](_0x5ddf5c[_0x0823('0x32')]);_0x233418[_0x0823('0x34')]=_[_0x0823('0x35')](_0x233418[_0x0823('0x31')],_0x233418['query']);_0x41c5f0['attributes']=_[_0x0823('0x35')](_0x233418[_0x0823('0x31')],qs['fields'](_0x5ddf5c['query'][_0x0823('0x36')]));_0x41c5f0[_0x0823('0x37')]=_0x41c5f0['attributes'][_0x0823('0x38')]?_0x41c5f0[_0x0823('0x37')]:_0x233418[_0x0823('0x31')];if(!_0x5ddf5c[_0x0823('0x32')][_0x0823('0x39')](_0x0823('0x3a'))){_0x41c5f0[_0x0823('0x20')]=qs[_0x0823('0x20')](_0x5ddf5c[_0x0823('0x32')][_0x0823('0x20')]);_0x41c5f0['offset']=qs[_0x0823('0x1e')](_0x5ddf5c[_0x0823('0x32')][_0x0823('0x1e')]);}_0x41c5f0['order']=qs[_0x0823('0x3b')](_0x5ddf5c[_0x0823('0x32')]['sort']);_0x41c5f0['where']=qs[_0x0823('0x34')](_[_0x0823('0x3c')](_0x5ddf5c[_0x0823('0x32')],_0x233418[_0x0823('0x34')]),_0x1620b7);if(_0x5ddf5c['query'][_0x0823('0x3d')]){_0x41c5f0[_0x0823('0x3e')]=_[_0x0823('0x3f')](_0x41c5f0[_0x0823('0x3e')],{'$or':_[_0x0823('0x2d')](_0x1620b7,function(_0x6ee89b){if(_0x6ee89b[_0x0823('0x40')]!==_0x0823('0x41')){var _0x4e9cac={};_0x4e9cac[_0x6ee89b[_0x0823('0x2b')]]={'$like':'%'+_0x5ddf5c['query']['filter']+'%'};return _0x4e9cac;}})});}_0x41c5f0=_[_0x0823('0x3f')]({},_0x41c5f0,_0x5ddf5c[_0x0823('0x42')]);var _0x5bcaa2={'where':_0x41c5f0['where']};return db[_0x0823('0x2e')][_0x0823('0x21')](_0x5bcaa2)[_0x0823('0x26')](function(_0xb6986f){_0x3f3c32[_0x0823('0x21')]=_0xb6986f;if(_0x5ddf5c[_0x0823('0x32')][_0x0823('0x43')]){_0x41c5f0[_0x0823('0x44')]=[{'all':!![]}];}return db['Sound'][_0x0823('0x45')](_0x41c5f0);})[_0x0823('0x26')](function(_0xbcbc6){_0x3f3c32['rows']=_0xbcbc6;return _0x3f3c32;})['then'](respondWithFilteredResult(_0x3f60c0,_0x41c5f0))['catch'](handleError(_0x3f60c0,null));};exports[_0x0823('0x46')]=function(_0xd98a7b,_0x431e93){var _0x216718={'raw':!![],'where':{'id':_0xd98a7b[_0x0823('0x47')]['id']}},_0xf12a4b={};_0xf12a4b['model']=_[_0x0823('0x33')](db[_0x0823('0x2e')][_0x0823('0x48')]);_0xf12a4b['query']=_[_0x0823('0x33')](_0xd98a7b['query']);_0xf12a4b[_0x0823('0x34')]=_[_0x0823('0x35')](_0xf12a4b[_0x0823('0x31')],_0xf12a4b['query']);_0x216718[_0x0823('0x37')]=_['intersection'](_0xf12a4b['model'],qs['fields'](_0xd98a7b[_0x0823('0x32')][_0x0823('0x36')]));_0x216718[_0x0823('0x37')]=_0x216718[_0x0823('0x37')][_0x0823('0x38')]?_0x216718[_0x0823('0x37')]:_0xf12a4b[_0x0823('0x31')];if(_0xd98a7b['query']['includeAll']){_0x216718[_0x0823('0x44')]=[{'all':!![]}];}_0x216718=_[_0x0823('0x3f')]({},_0x216718,_0xd98a7b[_0x0823('0x42')]);return db[_0x0823('0x2e')]['find'](_0x216718)[_0x0823('0x26')](handleEntityNotFound(_0x431e93,null))[_0x0823('0x26')](respondWithResult(_0x431e93,null))[_0x0823('0x49')](handleError(_0x431e93,null));};exports['download']=function(_0x4c5943,_0xebd30f,_0x291fbd){return db[_0x0823('0x2e')]['find']({'where':{'id':_0x4c5943[_0x0823('0x47')]['id']},'attributes':['name',_0x0823('0x4a'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0xebd30f,null))['then'](function(_0x26509d){if(_0x26509d){if(!fs[_0x0823('0x4b')](path['join'](config['root'],_0x0823('0x4c'),_0x26509d['save_name']+'.'+_0x26509d[_0x0823('0x4d')]))){throw new db[(_0x0823('0x4e'))][(_0x0823('0x4f'))](_0x0823('0x50'));}return _0xebd30f[_0x0823('0x51')](path[_0x0823('0x52')](config['root'],_0x0823('0x4c'),util[_0x0823('0x53')](_0x0823('0x54'),_0x26509d[_0x0823('0x4a')],_0x26509d[_0x0823('0x4d')])),util[_0x0823('0x53')](_0x0823('0x54'),_0x26509d[_0x0823('0x2b')],_0x26509d[_0x0823('0x4d')]));}return null;})['catch'](handleError(_0xebd30f,null));};exports[_0x0823('0x55')]=function(_0x324e60,_0x24443e,_0x56e15d){var _0x1f277c={'name':path[_0x0823('0x56')](_0x324e60[_0x0823('0x57')][_0x0823('0x58')],path['extname'](_0x324e60[_0x0823('0x57')][_0x0823('0x58')])),'save_name':path[_0x0823('0x56')](_0x324e60['file'][_0x0823('0x59')],path[_0x0823('0x5a')](_0x324e60['file'][_0x0823('0x59')])),'original_format':path[_0x0823('0x5a')](_0x324e60[_0x0823('0x57')][_0x0823('0x58')])[_0x0823('0x5b')](0x1),'converted_format':_0x0823('0x5c')};var _0x42dbc6=path[_0x0823('0x52')](config[_0x0823('0x5d')],'server/files/sounds/original',_0x324e60[_0x0823('0x57')][_0x0823('0x59')]);var _0x288ab1=path[_0x0823('0x52')](config[_0x0823('0x5d')],_0x0823('0x4c'),util[_0x0823('0x53')](_0x0823('0x54'),path[_0x0823('0x56')](_0x324e60[_0x0823('0x57')][_0x0823('0x59')],path[_0x0823('0x5a')](_0x324e60['file'][_0x0823('0x59')])),_0x1f277c['converted_format']));logger[_0x0823('0x5e')](_0x0823('0x5f'),_0x42dbc6);logger['info'](_0x0823('0x60'),_0x288ab1);try{fs[_0x0823('0x61')](_0x42dbc6,parseInt('0777',0x8));var _0x5dea28=sox[_0x0823('0x62')](_0x42dbc6,_0x288ab1,{'sampleRate':0x1f40,'format':_0x0823('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5dea28['on']('error',function(_0x2a112d){fs['unlinkSync'](_0x42dbc6);_0x24443e[_0x0823('0x1b')](0x1f4)[_0x0823('0x2c')](_0x2a112d);});_0x5dea28['on'](_0x0823('0x63'),function(_0x4a9d88){_0x1f277c[_0x0823('0x64')]=isNaN(_0x4a9d88[_0x0823('0x65')])?null:_0x4a9d88[_0x0823('0x65')]*0x3e8;_0x1f277c[_0x0823('0x66')]=isNaN(_0x4a9d88[_0x0823('0x67')])?null:_0x4a9d88[_0x0823('0x67')];_0x1f277c['original_channelCount']=isNaN(_0x4a9d88[_0x0823('0x68')])?null:_0x4a9d88[_0x0823('0x68')];_0x1f277c[_0x0823('0x69')]=isNaN(_0x4a9d88[_0x0823('0x6a')])?null:_0x4a9d88[_0x0823('0x6a')];_0x1f277c[_0x0823('0x6b')]=isNaN(_0x4a9d88[_0x0823('0x6c')])?null:_0x4a9d88[_0x0823('0x6c')];});_0x5dea28['on'](_0x0823('0x6d'),function(_0x375bc4){_0x1f277c['converted_duration']=isNaN(_0x375bc4[_0x0823('0x65')])?null:_0x375bc4['duration']*0x3e8;_0x1f277c[_0x0823('0x6e')]=isNaN(_0x375bc4[_0x0823('0x67')])?null:_0x375bc4[_0x0823('0x67')];_0x1f277c[_0x0823('0x6f')]=isNaN(_0x375bc4['channelCount'])?null:_0x375bc4['channelCount'];_0x1f277c['converted_bitRate']=isNaN(_0x375bc4[_0x0823('0x6a')])?null:_0x375bc4[_0x0823('0x6a')];_0x1f277c[_0x0823('0x70')]=isNaN(_0x375bc4[_0x0823('0x6c')])?null:_0x375bc4[_0x0823('0x6c')];});_0x5dea28['on']('end',function(){fs[_0x0823('0x61')](_0x288ab1,parseInt('0777',0x8));return db['Sound'][_0x0823('0x55')](_0x1f277c)[_0x0823('0x26')](function(_0x523211){var _0x907292={'role':_0x324e60[_0x0823('0x71')][_0x0823('0x72')],'userProfileId':_0x324e60[_0x0823('0x71')][_0x0823('0x73')]};if(!_0x907292)throw new Error(_0x0823('0x74'));if(_0x907292[_0x0823('0x72')]==='user'){var _0xd0a031=_0x523211[_0x0823('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x0823('0x75')]({'where':{'name':_0x0823('0x28'),'userProfileId':_0x907292[_0x0823('0x73')]},'raw':!![]})['then'](function(_0x17bf2d){if(_0x17bf2d&&_0x17bf2d[_0x0823('0x76')]===0x0){return db[_0x0823('0x29')][_0x0823('0x55')]({'name':_0xd0a031[_0x0823('0x2b')],'resourceId':_0xd0a031['id'],'type':_0x17bf2d[_0x0823('0x2b')],'sectionId':_0x17bf2d['id']},{})[_0x0823('0x26')](function(){return _0x523211;});}else{return _0x523211;}})[_0x0823('0x49')](function(_0x12430a){logger[_0x0823('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12430a);throw _0x12430a;});}return _0x523211;})['then'](respondWithResult(_0x24443e,null))['catch'](handleError(_0x24443e,null));});_0x5dea28[_0x0823('0x77')]();}catch(_0x44abf5){_0x24443e[_0x0823('0x1b')](0x1f4)[_0x0823('0x2c')](_0x44abf5);}};exports[_0x0823('0x78')]=function(_0xe01606,_0xcca25c,_0x2606e3){return db['Sound'][_0x0823('0x75')]({'where':{'id':_0xe01606[_0x0823('0x47')]['id']}})['then'](handleEntityNotFound(_0xcca25c,null))['then'](saveUpdates(_[_0x0823('0x3c')](_0xe01606[_0x0823('0x71')],[_0x0823('0x2b'),_0x0823('0x79')]),null))[_0x0823('0x26')](respondWithResult(_0xcca25c,null))[_0x0823('0x49')](handleError(_0xcca25c,null));};exports[_0x0823('0x7a')]=function(_0x5507f2,_0x330878,_0x192615){return db[_0x0823('0x2e')]['find']({'where':{'id':_0x5507f2['params']['id']}})[_0x0823('0x26')](function(_0x3d7ce5){if(_0x3d7ce5){return _0x3d7ce5['destroy']();}})['then'](function(_0x29e483){var _0x4c72d6=path['join'](config[_0x0823('0x5d')],_0x0823('0x7b'),util[_0x0823('0x53')](_0x0823('0x54'),_0x29e483[_0x0823('0x4a')],_0x29e483[_0x0823('0x7c')]));var _0x1e07e1=path[_0x0823('0x52')](config[_0x0823('0x5d')],'server/files/sounds/converted',util[_0x0823('0x53')](_0x0823('0x54'),_0x29e483[_0x0823('0x4a')],_0x29e483[_0x0823('0x4d')]));fs['unlinkSync'](_0x4c72d6);fs['unlinkSync'](_0x1e07e1);return _0x29e483;})[_0x0823('0x26')](function(_0x3216f4){if(_0x3216f4){return _0x330878[_0x0823('0x1b')](0xcc)['end']();}})[_0x0823('0x26')](handleEntityNotFound(_0x330878,null))[_0x0823('0x49')](handleError(_0x330878,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e581e6d..ca78b2a 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 _0xca16=['request-promise','path','../../config/environment','exports','Sound','lodash','util','../../config/logger','moment'];(function(_0x3a7082,_0x231d09){var _0x5bdcd6=function(_0x25c781){while(--_0x25c781){_0x3a7082['push'](_0x3a7082['shift']());}};_0x5bdcd6(++_0x231d09);}(_0xca16,0xd4));var _0x6ca1=function(_0x9fcc92,_0x3120f8){_0x9fcc92=_0x9fcc92-0x0;var _0x52b7a3=_0xca16[_0x9fcc92];return _0x52b7a3;};'use strict';var _=require(_0x6ca1('0x0'));var util=require(_0x6ca1('0x1'));var logger=require(_0x6ca1('0x2'))('api');var moment=require(_0x6ca1('0x3'));var BPromise=require('bluebird');var rp=require(_0x6ca1('0x4'));var fs=require('fs');var path=require(_0x6ca1('0x5'));var rimraf=require('rimraf');var config=require(_0x6ca1('0x6'));var attributes=require('./sound.attributes');module[_0x6ca1('0x7')]=function(_0x40997a,_0x49ad19){return _0x40997a['define'](_0x6ca1('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fd3=['./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3e5661,_0x1298cf){var _0xd97ed=function(_0x2161cf){while(--_0x2161cf){_0x3e5661['push'](_0x3e5661['shift']());}};_0xd97ed(++_0x1298cf);}(_0x5fd3,0x191));var _0x35fd=function(_0x12fff8,_0x16a13a){_0x12fff8=_0x12fff8-0x0;var _0x122703=_0x5fd3[_0x12fff8];return _0x122703;};'use strict';var _=require('lodash');var util=require(_0x35fd('0x0'));var logger=require(_0x35fd('0x1'))(_0x35fd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x35fd('0x3'));var fs=require('fs');var path=require(_0x35fd('0x4'));var rimraf=require(_0x35fd('0x5'));var config=require('../../config/environment');var attributes=require(_0x35fd('0x6'));module[_0x35fd('0x7')]=function(_0x3fb530,_0x4f3995){return _0x3fb530[_0x35fd('0x8')](_0x35fd('0x9'),attributes,{'tableName':_0x35fd('0xa'),'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 2c47262..00e4ec1 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 _0x779c=['include','model','map','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','attributes'];(function(_0x834bb6,_0x1c5e35){var _0xa35d00=function(_0x14aeb3){while(--_0x14aeb3){_0x834bb6['push'](_0x834bb6['shift']());}};_0xa35d00(++_0x1c5e35);}(_0x779c,0xb8));var _0xc779=function(_0x222fa1,_0x281603){_0x222fa1=_0x222fa1-0x0;var _0x460e27=_0x779c[_0x222fa1];return _0x460e27;};'use strict';var _=require(_0xc779('0x0'));var util=require(_0xc779('0x1'));var moment=require(_0xc779('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc779('0x3'));var db=require(_0xc779('0x4'))['db'];var utils=require(_0xc779('0x5'));var logger=require(_0xc779('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc779('0x7'));var client=jayson['client'][_0xc779('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38de5f,_0x265936,_0x34567f){return new BPromise(function(_0x1d14be,_0x57e0d7){return client[_0xc779('0x9')](_0x38de5f,_0x34567f)[_0xc779('0xa')](function(_0x3f8d14){logger[_0xc779('0xb')](_0xc779('0xc'),_0x265936,_0xc779('0xd'));logger['debug'](_0xc779('0xe'),_0x265936,_0xc779('0xd'),JSON[_0xc779('0xf')](_0x3f8d14));if(_0x3f8d14[_0xc779('0x10')]){if(_0x3f8d14[_0xc779('0x10')][_0xc779('0x11')]===0x1f4){logger[_0xc779('0x10')](_0xc779('0xc'),_0x265936,_0x3f8d14[_0xc779('0x10')][_0xc779('0x12')]);return _0x57e0d7(_0x3f8d14['error']['message']);}logger['error'](_0xc779('0xc'),_0x265936,_0x3f8d14['error'][_0xc779('0x12')]);return _0x1d14be(_0x3f8d14['error'][_0xc779('0x12')]);}else{logger[_0xc779('0xb')](_0xc779('0xc'),_0x265936,_0xc779('0xd'));_0x1d14be(_0x3f8d14[_0xc779('0x13')][_0xc779('0x12')]);}})[_0xc779('0x14')](function(_0x2155fa){logger[_0xc779('0x10')](_0xc779('0xc'),_0x265936,_0x2155fa);_0x57e0d7(_0x2155fa);});});}exports[_0xc779('0x15')]=function(_0x2d34a8){var _0x4c5afa=this;return new Promise(function(_0x59fda6,_0x4a7ff4){return db[_0xc779('0x16')]['find']({'raw':_0x2d34a8[_0xc779('0x17')]?_0x2d34a8['options'][_0xc779('0x18')]===undefined?!![]:![]:!![],'where':_0x2d34a8['options']?_0x2d34a8[_0xc779('0x17')]['where']||null:null,'attributes':_0x2d34a8[_0xc779('0x17')]?_0x2d34a8[_0xc779('0x17')][_0xc779('0x19')]||null:null,'include':_0x2d34a8[_0xc779('0x17')]?_0x2d34a8[_0xc779('0x17')][_0xc779('0x1a')]?_['map'](_0x2d34a8[_0xc779('0x17')][_0xc779('0x1a')],function(_0x9c401b){return{'model':db[_0x9c401b[_0xc779('0x1b')]],'as':_0x9c401b['as'],'attributes':_0x9c401b[_0xc779('0x19')],'include':_0x9c401b[_0xc779('0x1a')]?_[_0xc779('0x1c')](_0x9c401b[_0xc779('0x1a')],function(_0x567027){return{'model':db[_0x567027['model']],'as':_0x567027['as'],'attributes':_0x567027['attributes'],'include':_0x567027[_0xc779('0x1a')]?_['map'](_0x567027['include'],function(_0x1962cf){return{'model':db[_0x1962cf['model']],'as':_0x1962cf['as'],'attributes':_0x1962cf[_0xc779('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc779('0xa')](function(_0x4fb43e){logger[_0xc779('0xb')](_0xc779('0x15'),_0x2d34a8);logger[_0xc779('0x1d')](_0xc779('0x15'),_0x2d34a8,JSON[_0xc779('0xf')](_0x4fb43e));_0x59fda6(_0x4fb43e);})[_0xc779('0x14')](function(_0x5b80e2){logger['error']('ShowSound',_0x5b80e2[_0xc779('0x12')],_0x2d34a8);_0x4a7ff4(_0x4c5afa['error'](0x1f4,_0x5b80e2[_0xc779('0x12')]));});});}; \ No newline at end of file +var _0xc9fc=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Sound,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3ed070,_0x107a02){var _0x40a997=function(_0xc1be3a){while(--_0xc1be3a){_0x3ed070['push'](_0x3ed070['shift']());}};_0x40a997(++_0x107a02);}(_0xc9fc,0x1bb));var _0xcc9f=function(_0x3517dc,_0x47b8cb){_0x3517dc=_0x3517dc-0x0;var _0x1949f6=_0xc9fc[_0x3517dc];return _0x1949f6;};'use strict';var _=require(_0xcc9f('0x0'));var util=require('util');var moment=require(_0xcc9f('0x1'));var BPromise=require(_0xcc9f('0x2'));var rs=require(_0xcc9f('0x3'));var fs=require('fs');var Redis=require(_0xcc9f('0x4'));var db=require(_0xcc9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc9f('0x6'))(_0xcc9f('0x7'));var config=require(_0xcc9f('0x8'));var jayson=require(_0xcc9f('0x9'));var client=jayson[_0xcc9f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2855cd,_0x2b353a,_0x2a69fc){return new BPromise(function(_0x1e10d1,_0xd3796f){return client[_0xcc9f('0xb')](_0x2855cd,_0x2a69fc)[_0xcc9f('0xc')](function(_0x41835b){logger['info'](_0xcc9f('0xd'),_0x2b353a,'request\x20sent');logger[_0xcc9f('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x2b353a,'request\x20sent',JSON[_0xcc9f('0xf')](_0x41835b));if(_0x41835b[_0xcc9f('0x10')]){if(_0x41835b['error'][_0xcc9f('0x11')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x2b353a,_0x41835b[_0xcc9f('0x10')][_0xcc9f('0x12')]);return _0xd3796f(_0x41835b[_0xcc9f('0x10')][_0xcc9f('0x12')]);}logger[_0xcc9f('0x10')](_0xcc9f('0xd'),_0x2b353a,_0x41835b[_0xcc9f('0x10')]['message']);return _0x1e10d1(_0x41835b[_0xcc9f('0x10')]['message']);}else{logger['info'](_0xcc9f('0xd'),_0x2b353a,_0xcc9f('0x13'));_0x1e10d1(_0x41835b['result']['message']);}})['catch'](function(_0x579891){logger[_0xcc9f('0x10')](_0xcc9f('0xd'),_0x2b353a,_0x579891);_0xd3796f(_0x579891);});});}exports[_0xcc9f('0x14')]=function(_0x289b14){var _0x51134a=this;return new Promise(function(_0x26d666,_0x22c829){return db[_0xcc9f('0x15')][_0xcc9f('0x16')]({'raw':_0x289b14[_0xcc9f('0x17')]?_0x289b14['options'][_0xcc9f('0x18')]===undefined?!![]:![]:!![],'where':_0x289b14['options']?_0x289b14[_0xcc9f('0x17')][_0xcc9f('0x19')]||null:null,'attributes':_0x289b14['options']?_0x289b14[_0xcc9f('0x17')]['attributes']||null:null,'include':_0x289b14['options']?_0x289b14[_0xcc9f('0x17')][_0xcc9f('0x1a')]?_[_0xcc9f('0x1b')](_0x289b14['options'][_0xcc9f('0x1a')],function(_0x385578){return{'model':db[_0x385578[_0xcc9f('0x1c')]],'as':_0x385578['as'],'attributes':_0x385578[_0xcc9f('0x1d')],'include':_0x385578['include']?_[_0xcc9f('0x1b')](_0x385578['include'],function(_0x101d91){return{'model':db[_0x101d91[_0xcc9f('0x1c')]],'as':_0x101d91['as'],'attributes':_0x101d91[_0xcc9f('0x1d')],'include':_0x101d91[_0xcc9f('0x1a')]?_['map'](_0x101d91[_0xcc9f('0x1a')],function(_0x4594fe){return{'model':db[_0x4594fe[_0xcc9f('0x1c')]],'as':_0x4594fe['as'],'attributes':_0x4594fe[_0xcc9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcc9f('0xc')](function(_0x27b88c){logger[_0xcc9f('0x1e')](_0xcc9f('0x14'),_0x289b14);logger[_0xcc9f('0xe')](_0xcc9f('0x14'),_0x289b14,JSON['stringify'](_0x27b88c));_0x26d666(_0x27b88c);})[_0xcc9f('0x1f')](function(_0x2210e5){logger['error'](_0xcc9f('0x14'),_0x2210e5[_0xcc9f('0x12')],_0x289b14);_0x22c829(_0x51134a[_0xcc9f('0x10')](0x1f4,_0x2210e5[_0xcc9f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 64079f0..1de32eb 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x2dfe6c,_0x255709){var _0x52cb46=function(_0x353ee1){while(--_0x353ee1){_0x2dfe6c['push'](_0x2dfe6c['shift']());}};_0x52cb46(++_0x255709);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x5eb8[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb6bddf,_0x2372c3){var _0x1a7749=function(_0x3e020e){while(--_0x3e020e){_0xb6bddf['push'](_0xb6bddf['shift']());}};_0x1a7749(++_0x2372c3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0x0b0e[_0x486008];return _0x2fefc7;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 45d10d4..905a06a 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 _0xc281=['medium','ENUM','out','exports','STRING','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc281,0x81));var _0x1c28=function(_0x545c11,_0x59dbf7){_0x545c11=_0x545c11-0x0;var _0x4b6de2=_0xc281[_0x545c11];return _0x4b6de2;};'use strict';var Sequelize=require('sequelize');module[_0x1c28('0x0')]={'uniqueid':{'type':Sequelize[_0x1c28('0x1')]},'body':{'type':Sequelize[_0x1c28('0x2')](_0x1c28('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x1c28('0x4')]('in',_0x1c28('0x5')),'defaultValue':_0x1c28('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x1c28('0x1')]},'providerResponse':{'type':Sequelize[_0x1c28('0x2')]}}; \ No newline at end of file +var _0x67ec=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x225083,_0x530396){var _0x1e2ed6=function(_0x2474f4){while(--_0x2474f4){_0x225083['push'](_0x225083['shift']());}};_0x1e2ed6(++_0x530396);}(_0x67ec,0x11c));var _0xc67e=function(_0x532da0,_0x274e0a){_0x532da0=_0x532da0-0x0;var _0x2e4930=_0x67ec[_0x532da0];return _0x2e4930;};'use strict';var Sequelize=require(_0xc67e('0x0'));module[_0xc67e('0x1')]={'uniqueid':{'type':Sequelize[_0xc67e('0x2')]},'body':{'type':Sequelize[_0xc67e('0x3')](_0xc67e('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xc67e('0x5')]('in',_0xc67e('0x6')),'defaultValue':_0xc67e('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc67e('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0135436..ebb6796 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 _0x11ec=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','options','includeAll','include','SquareMessage','findAll','rows','catch','show','params','create','body','eml-format'];(function(_0x3dd567,_0x276ca9){var _0x415024=function(_0x3ae159){while(--_0x3ae159){_0x3dd567['push'](_0x3dd567['shift']());}};_0x415024(++_0x276ca9);}(_0x11ec,0xda));var _0xc11e=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x11ec[_0x37756b];return _0x46efec;};'use strict';var emlformat=require(_0xc11e('0x0'));var rimraf=require(_0xc11e('0x1'));var zipdir=require(_0xc11e('0x2'));var jsonpatch=require(_0xc11e('0x3'));var rp=require(_0xc11e('0x4'));var moment=require(_0xc11e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc11e('0x6'));var util=require('util');var path=require(_0xc11e('0x7'));var sox=require(_0xc11e('0x8'));var csv=require(_0xc11e('0x9'));var ejs=require(_0xc11e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc11e('0xb'));var squel=require(_0xc11e('0xc'));var crypto=require('crypto');var jsforce=require(_0xc11e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc11e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc11e('0xe'));var authService=require(_0xc11e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc11e('0x10'));var logger=require(_0xc11e('0x11'))(_0xc11e('0x12'));var utils=require(_0xc11e('0x13'));var config=require(_0xc11e('0x14'));var licenseUtil=require(_0xc11e('0x15'));var db=require(_0xc11e('0x16'))['db'];function respondWithStatusCode(_0x4fb5c6,_0x6cd04d){_0x6cd04d=_0x6cd04d||0xcc;return function(_0x299f07){if(_0x299f07){return _0x4fb5c6[_0xc11e('0x17')](_0x6cd04d);}return _0x4fb5c6[_0xc11e('0x18')](_0x6cd04d)['end']();};}function respondWithResult(_0x101455,_0x476932){_0x476932=_0x476932||0xc8;return function(_0x28520d){if(_0x28520d){return _0x101455['status'](_0x476932)[_0xc11e('0x19')](_0x28520d);}};}function respondWithFilteredResult(_0x4b144f,_0x43520f){return function(_0xa670a9){if(_0xa670a9){var _0x11046f=typeof _0x43520f[_0xc11e('0x1a')]===_0xc11e('0x1b')&&typeof _0x43520f[_0xc11e('0x1c')]===_0xc11e('0x1b');var _0x502ea8=_0xa670a9[_0xc11e('0x1d')];var _0x2abb22=_0x11046f?0x0:_0x43520f[_0xc11e('0x1a')];var _0x26b62b=_0x11046f?_0xa670a9[_0xc11e('0x1d')]:_0x43520f[_0xc11e('0x1a')]+_0x43520f[_0xc11e('0x1c')];var _0x44b398;if(_0x26b62b>=_0x502ea8){_0x26b62b=_0x502ea8;_0x44b398=0xc8;}else{_0x44b398=0xce;}_0x4b144f['status'](_0x44b398);return _0x4b144f[_0xc11e('0x1e')]('Content-Range',_0x2abb22+'-'+_0x26b62b+'/'+_0x502ea8)[_0xc11e('0x19')](_0xa670a9);}return null;};}function patchUpdates(_0x423d99){return function(_0x43446b){try{jsonpatch[_0xc11e('0x1f')](_0x43446b,_0x423d99,!![]);}catch(_0x2bbb2){return BPromise['reject'](_0x2bbb2);}return _0x43446b[_0xc11e('0x20')]();};}function saveUpdates(_0x2067d,_0x5ef223){return function(_0x17b24c){if(_0x17b24c){return _0x17b24c[_0xc11e('0x21')](_0x2067d)[_0xc11e('0x22')](function(_0x2fd35e){return _0x2fd35e;});}return null;};}function removeEntity(_0x187b89,_0x3975cc){return function(_0x20cbb6){if(_0x20cbb6){return _0x20cbb6[_0xc11e('0x23')]()[_0xc11e('0x22')](function(){_0x187b89['status'](0xcc)[_0xc11e('0x24')]();});}};}function handleEntityNotFound(_0x33b418,_0x2b7b17){return function(_0x15963c){if(!_0x15963c){_0x33b418[_0xc11e('0x17')](0x194);}return _0x15963c;};}function handleError(_0x153bbf,_0x2efb81){_0x2efb81=_0x2efb81||0x1f4;return function(_0x548e4e){logger[_0xc11e('0x25')](_0x548e4e[_0xc11e('0x26')]);if(_0x548e4e[_0xc11e('0x27')]){delete _0x548e4e[_0xc11e('0x27')];}_0x153bbf[_0xc11e('0x18')](_0x2efb81)[_0xc11e('0x28')](_0x548e4e);};}exports[_0xc11e('0x29')]=function(_0x2cd53e,_0x536f80){var _0x30ef0d={},_0x2262d8={},_0x187af6={'count':0x0,'rows':[]};var _0x6bfe83=_[_0xc11e('0x2a')](db['SquareMessage'][_0xc11e('0x2b')],function(_0x492d08){return{'name':_0x492d08[_0xc11e('0x2c')],'type':_0x492d08[_0xc11e('0x2d')][_0xc11e('0x2e')]};});_0x2262d8[_0xc11e('0x2f')]=_[_0xc11e('0x2a')](_0x6bfe83,'name');_0x2262d8[_0xc11e('0x30')]=_[_0xc11e('0x31')](_0x2cd53e[_0xc11e('0x30')]);_0x2262d8[_0xc11e('0x32')]=_[_0xc11e('0x33')](_0x2262d8['model'],_0x2262d8[_0xc11e('0x30')]);_0x30ef0d['attributes']=_['intersection'](_0x2262d8[_0xc11e('0x2f')],qs[_0xc11e('0x34')](_0x2cd53e[_0xc11e('0x30')]['fields']));_0x30ef0d[_0xc11e('0x35')]=_0x30ef0d['attributes'][_0xc11e('0x36')]?_0x30ef0d[_0xc11e('0x35')]:_0x2262d8['model'];if(!_0x2cd53e[_0xc11e('0x30')][_0xc11e('0x37')](_0xc11e('0x38'))){_0x30ef0d['limit']=qs[_0xc11e('0x1c')](_0x2cd53e[_0xc11e('0x30')]['limit']);_0x30ef0d[_0xc11e('0x1a')]=qs[_0xc11e('0x1a')](_0x2cd53e[_0xc11e('0x30')][_0xc11e('0x1a')]);}_0x30ef0d[_0xc11e('0x39')]=qs['sort'](_0x2cd53e[_0xc11e('0x30')]['sort']);_0x30ef0d[_0xc11e('0x3a')]=qs[_0xc11e('0x32')](_['pick'](_0x2cd53e['query'],_0x2262d8['filters']),_0x6bfe83);if(_0x2cd53e[_0xc11e('0x30')][_0xc11e('0x3b')]){_0x30ef0d['where']=_['merge'](_0x30ef0d[_0xc11e('0x3a')],{'$or':_['map'](_0x6bfe83,function(_0x256561){if(_0x256561[_0xc11e('0x2d')]!==_0xc11e('0x3c')){var _0xdbcefc={};_0xdbcefc[_0x256561[_0xc11e('0x27')]]={'$like':'%'+_0x2cd53e[_0xc11e('0x30')][_0xc11e('0x3b')]+'%'};return _0xdbcefc;}})});}_0x30ef0d=_[_0xc11e('0x3d')]({},_0x30ef0d,_0x2cd53e[_0xc11e('0x3e')]);var _0x3eb7ce={'where':_0x30ef0d[_0xc11e('0x3a')]};return db['SquareMessage'][_0xc11e('0x1d')](_0x3eb7ce)[_0xc11e('0x22')](function(_0xe289f4){_0x187af6[_0xc11e('0x1d')]=_0xe289f4;if(_0x2cd53e[_0xc11e('0x30')][_0xc11e('0x3f')]){_0x30ef0d[_0xc11e('0x40')]=[{'all':!![]}];}return db[_0xc11e('0x41')][_0xc11e('0x42')](_0x30ef0d);})[_0xc11e('0x22')](function(_0x2e47be){_0x187af6[_0xc11e('0x43')]=_0x2e47be;return _0x187af6;})[_0xc11e('0x22')](respondWithFilteredResult(_0x536f80,_0x30ef0d))[_0xc11e('0x44')](handleError(_0x536f80,null));};exports[_0xc11e('0x45')]=function(_0xe29a6,_0x432a77){var _0xd98b26={'raw':!![],'where':{'id':_0xe29a6[_0xc11e('0x46')]['id']}},_0xd8ef83={};_0xd8ef83[_0xc11e('0x2f')]=_[_0xc11e('0x31')](db[_0xc11e('0x41')][_0xc11e('0x2b')]);_0xd8ef83[_0xc11e('0x30')]=_[_0xc11e('0x31')](_0xe29a6[_0xc11e('0x30')]);_0xd8ef83[_0xc11e('0x32')]=_[_0xc11e('0x33')](_0xd8ef83[_0xc11e('0x2f')],_0xd8ef83[_0xc11e('0x30')]);_0xd98b26['attributes']=_[_0xc11e('0x33')](_0xd8ef83[_0xc11e('0x2f')],qs[_0xc11e('0x34')](_0xe29a6[_0xc11e('0x30')][_0xc11e('0x34')]));_0xd98b26[_0xc11e('0x35')]=_0xd98b26[_0xc11e('0x35')][_0xc11e('0x36')]?_0xd98b26[_0xc11e('0x35')]:_0xd8ef83['model'];if(_0xe29a6[_0xc11e('0x30')][_0xc11e('0x3f')]){_0xd98b26[_0xc11e('0x40')]=[{'all':!![]}];}_0xd98b26=_[_0xc11e('0x3d')]({},_0xd98b26,_0xe29a6[_0xc11e('0x3e')]);return db[_0xc11e('0x41')]['find'](_0xd98b26)[_0xc11e('0x22')](handleEntityNotFound(_0x432a77,null))[_0xc11e('0x22')](respondWithResult(_0x432a77,null))['catch'](handleError(_0x432a77,null));};exports[_0xc11e('0x47')]=function(_0x539b42,_0x5ad42b){return db[_0xc11e('0x41')][_0xc11e('0x47')](_0x539b42[_0xc11e('0x48')],{})[_0xc11e('0x22')](respondWithResult(_0x5ad42b,0xc9))[_0xc11e('0x44')](handleError(_0x5ad42b,null));};exports[_0xc11e('0x21')]=function(_0x236381,_0x303062){if(_0x236381[_0xc11e('0x48')]['id']){delete _0x236381[_0xc11e('0x48')]['id'];}return db[_0xc11e('0x41')]['find']({'where':{'id':_0x236381[_0xc11e('0x46')]['id']}})[_0xc11e('0x22')](handleEntityNotFound(_0x303062,null))[_0xc11e('0x22')](saveUpdates(_0x236381['body'],null))[_0xc11e('0x22')](respondWithResult(_0x303062,null))[_0xc11e('0x44')](handleError(_0x303062,null));};exports[_0xc11e('0x23')]=function(_0x315b1d,_0x12283c){return db[_0xc11e('0x41')]['find']({'where':{'id':_0x315b1d[_0xc11e('0x46')]['id']}})[_0xc11e('0x22')](handleEntityNotFound(_0x12283c,null))[_0xc11e('0x22')](removeEntity(_0x12283c,null))[_0xc11e('0x44')](handleError(_0x12283c,null));}; \ No newline at end of file +var _0xa833=['query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','name','merge','options','includeAll','include','catch','show','params','intersection','length','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','index','map','SquareMessage','rawAttributes','fieldName','type','model'];(function(_0x5060d1,_0x50d698){var _0x4bf964=function(_0x481a13){while(--_0x481a13){_0x5060d1['push'](_0x5060d1['shift']());}};_0x4bf964(++_0x50d698);}(_0xa833,0x139));var _0x3a83=function(_0x25e079,_0x539734){_0x25e079=_0x25e079-0x0;var _0x4be00e=_0xa833[_0x25e079];return _0x4be00e;};'use strict';var emlformat=require(_0x3a83('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a83('0x1'));var rp=require(_0x3a83('0x2'));var moment=require(_0x3a83('0x3'));var BPromise=require(_0x3a83('0x4'));var Mustache=require(_0x3a83('0x5'));var util=require('util');var path=require(_0x3a83('0x6'));var sox=require('sox');var csv=require(_0x3a83('0x7'));var ejs=require(_0x3a83('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3a83('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3a83('0xa'));var toCsv=require(_0x3a83('0x7'));var querystring=require(_0x3a83('0xb'));var Papa=require(_0x3a83('0xc'));var Redis=require(_0x3a83('0xd'));var authService=require(_0x3a83('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3a83('0xf'));var hardwareService=require(_0x3a83('0x10'));var logger=require(_0x3a83('0x11'))(_0x3a83('0x12'));var utils=require(_0x3a83('0x13'));var config=require(_0x3a83('0x14'));var licenseUtil=require(_0x3a83('0x15'));var db=require(_0x3a83('0x16'))['db'];function respondWithStatusCode(_0x35db6a,_0x360f1f){_0x360f1f=_0x360f1f||0xcc;return function(_0x49f752){if(_0x49f752){return _0x35db6a[_0x3a83('0x17')](_0x360f1f);}return _0x35db6a[_0x3a83('0x18')](_0x360f1f)[_0x3a83('0x19')]();};}function respondWithResult(_0x56c5aa,_0x2690af){_0x2690af=_0x2690af||0xc8;return function(_0x29f7b6){if(_0x29f7b6){return _0x56c5aa[_0x3a83('0x18')](_0x2690af)[_0x3a83('0x1a')](_0x29f7b6);}};}function respondWithFilteredResult(_0x557729,_0x39ebd1){return function(_0x1be7fa){if(_0x1be7fa){var _0x332fd8=typeof _0x39ebd1[_0x3a83('0x1b')]===_0x3a83('0x1c')&&typeof _0x39ebd1[_0x3a83('0x1d')]===_0x3a83('0x1c');var _0x534002=_0x1be7fa[_0x3a83('0x1e')];var _0x5ad54a=_0x332fd8?0x0:_0x39ebd1['offset'];var _0x3d7bdb=_0x332fd8?_0x1be7fa[_0x3a83('0x1e')]:_0x39ebd1[_0x3a83('0x1b')]+_0x39ebd1['limit'];var _0x2c21b1;if(_0x3d7bdb>=_0x534002){_0x3d7bdb=_0x534002;_0x2c21b1=0xc8;}else{_0x2c21b1=0xce;}_0x557729[_0x3a83('0x18')](_0x2c21b1);return _0x557729[_0x3a83('0x1f')](_0x3a83('0x20'),_0x5ad54a+'-'+_0x3d7bdb+'/'+_0x534002)[_0x3a83('0x1a')](_0x1be7fa);}return null;};}function patchUpdates(_0x5b1bd5){return function(_0x4b06ae){try{jsonpatch[_0x3a83('0x21')](_0x4b06ae,_0x5b1bd5,!![]);}catch(_0x1646bd){return BPromise[_0x3a83('0x22')](_0x1646bd);}return _0x4b06ae[_0x3a83('0x23')]();};}function saveUpdates(_0x2d9939,_0x50485d){return function(_0x23d0e2){if(_0x23d0e2){return _0x23d0e2[_0x3a83('0x24')](_0x2d9939)[_0x3a83('0x25')](function(_0x9733e7){return _0x9733e7;});}return null;};}function removeEntity(_0x527a3d,_0x325cab){return function(_0x487b22){if(_0x487b22){return _0x487b22[_0x3a83('0x26')]()[_0x3a83('0x25')](function(){_0x527a3d[_0x3a83('0x18')](0xcc)[_0x3a83('0x19')]();});}};}function handleEntityNotFound(_0x3379aa,_0x58dd46){return function(_0x608648){if(!_0x608648){_0x3379aa[_0x3a83('0x17')](0x194);}return _0x608648;};}function handleError(_0x2098c6,_0x50a597){_0x50a597=_0x50a597||0x1f4;return function(_0x5d1110){logger[_0x3a83('0x27')](_0x5d1110['stack']);if(_0x5d1110['name']){delete _0x5d1110['name'];}_0x2098c6['status'](_0x50a597)['send'](_0x5d1110);};}exports[_0x3a83('0x28')]=function(_0x18c2a2,_0xa968e9){var _0x4daf2a={},_0x375031={},_0x15e968={'count':0x0,'rows':[]};var _0x190db9=_[_0x3a83('0x29')](db[_0x3a83('0x2a')][_0x3a83('0x2b')],function(_0x19fa0a){return{'name':_0x19fa0a[_0x3a83('0x2c')],'type':_0x19fa0a[_0x3a83('0x2d')]['key']};});_0x375031[_0x3a83('0x2e')]=_[_0x3a83('0x29')](_0x190db9,'name');_0x375031[_0x3a83('0x2f')]=_[_0x3a83('0x30')](_0x18c2a2[_0x3a83('0x2f')]);_0x375031[_0x3a83('0x31')]=_['intersection'](_0x375031['model'],_0x375031[_0x3a83('0x2f')]);_0x4daf2a['attributes']=_['intersection'](_0x375031[_0x3a83('0x2e')],qs[_0x3a83('0x32')](_0x18c2a2[_0x3a83('0x2f')][_0x3a83('0x32')]));_0x4daf2a['attributes']=_0x4daf2a[_0x3a83('0x33')]['length']?_0x4daf2a[_0x3a83('0x33')]:_0x375031[_0x3a83('0x2e')];if(!_0x18c2a2['query'][_0x3a83('0x34')]('nolimit')){_0x4daf2a['limit']=qs[_0x3a83('0x1d')](_0x18c2a2[_0x3a83('0x2f')]['limit']);_0x4daf2a[_0x3a83('0x1b')]=qs[_0x3a83('0x1b')](_0x18c2a2['query']['offset']);}_0x4daf2a[_0x3a83('0x35')]=qs[_0x3a83('0x36')](_0x18c2a2[_0x3a83('0x2f')]['sort']);_0x4daf2a[_0x3a83('0x37')]=qs[_0x3a83('0x31')](_[_0x3a83('0x38')](_0x18c2a2[_0x3a83('0x2f')],_0x375031['filters']),_0x190db9);if(_0x18c2a2[_0x3a83('0x2f')][_0x3a83('0x39')]){_0x4daf2a[_0x3a83('0x37')]=_['merge'](_0x4daf2a[_0x3a83('0x37')],{'$or':_['map'](_0x190db9,function(_0xd0e730){if(_0xd0e730['type']!==_0x3a83('0x3a')){var _0xb0c42f={};_0xb0c42f[_0xd0e730[_0x3a83('0x3b')]]={'$like':'%'+_0x18c2a2[_0x3a83('0x2f')][_0x3a83('0x39')]+'%'};return _0xb0c42f;}})});}_0x4daf2a=_[_0x3a83('0x3c')]({},_0x4daf2a,_0x18c2a2[_0x3a83('0x3d')]);var _0x406eee={'where':_0x4daf2a['where']};return db[_0x3a83('0x2a')]['count'](_0x406eee)[_0x3a83('0x25')](function(_0x1b3172){_0x15e968['count']=_0x1b3172;if(_0x18c2a2['query'][_0x3a83('0x3e')]){_0x4daf2a[_0x3a83('0x3f')]=[{'all':!![]}];}return db[_0x3a83('0x2a')]['findAll'](_0x4daf2a);})[_0x3a83('0x25')](function(_0xff922d){_0x15e968['rows']=_0xff922d;return _0x15e968;})[_0x3a83('0x25')](respondWithFilteredResult(_0xa968e9,_0x4daf2a))[_0x3a83('0x40')](handleError(_0xa968e9,null));};exports[_0x3a83('0x41')]=function(_0x205a42,_0x2acccd){var _0x34dab4={'raw':!![],'where':{'id':_0x205a42[_0x3a83('0x42')]['id']}},_0x4226a5={};_0x4226a5[_0x3a83('0x2e')]=_[_0x3a83('0x30')](db[_0x3a83('0x2a')][_0x3a83('0x2b')]);_0x4226a5[_0x3a83('0x2f')]=_['keys'](_0x205a42['query']);_0x4226a5['filters']=_[_0x3a83('0x43')](_0x4226a5[_0x3a83('0x2e')],_0x4226a5['query']);_0x34dab4['attributes']=_[_0x3a83('0x43')](_0x4226a5[_0x3a83('0x2e')],qs[_0x3a83('0x32')](_0x205a42[_0x3a83('0x2f')]['fields']));_0x34dab4[_0x3a83('0x33')]=_0x34dab4[_0x3a83('0x33')][_0x3a83('0x44')]?_0x34dab4[_0x3a83('0x33')]:_0x4226a5[_0x3a83('0x2e')];if(_0x205a42[_0x3a83('0x2f')][_0x3a83('0x3e')]){_0x34dab4[_0x3a83('0x3f')]=[{'all':!![]}];}_0x34dab4=_[_0x3a83('0x3c')]({},_0x34dab4,_0x205a42[_0x3a83('0x3d')]);return db[_0x3a83('0x2a')][_0x3a83('0x45')](_0x34dab4)[_0x3a83('0x25')](handleEntityNotFound(_0x2acccd,null))['then'](respondWithResult(_0x2acccd,null))[_0x3a83('0x40')](handleError(_0x2acccd,null));};exports[_0x3a83('0x46')]=function(_0x664007,_0x5d7403){return db[_0x3a83('0x2a')][_0x3a83('0x46')](_0x664007[_0x3a83('0x47')],{})['then'](respondWithResult(_0x5d7403,0xc9))[_0x3a83('0x40')](handleError(_0x5d7403,null));};exports['update']=function(_0x4e1a15,_0x1b5369){if(_0x4e1a15[_0x3a83('0x47')]['id']){delete _0x4e1a15[_0x3a83('0x47')]['id'];}return db[_0x3a83('0x2a')][_0x3a83('0x45')]({'where':{'id':_0x4e1a15[_0x3a83('0x42')]['id']}})['then'](handleEntityNotFound(_0x1b5369,null))[_0x3a83('0x25')](saveUpdates(_0x4e1a15[_0x3a83('0x47')],null))[_0x3a83('0x25')](respondWithResult(_0x1b5369,null))[_0x3a83('0x40')](handleError(_0x1b5369,null));};exports[_0x3a83('0x26')]=function(_0x1de746,_0x11dd61){return db['SquareMessage'][_0x3a83('0x45')]({'where':{'id':_0x1de746[_0x3a83('0x42')]['id']}})[_0x3a83('0x25')](handleEntityNotFound(_0x11dd61,null))[_0x3a83('0x25')](removeEntity(_0x11dd61,null))[_0x3a83('0x40')](handleError(_0x11dd61,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index e928656..5b79341 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 _0x4418=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d6028,_0x1f514b){var _0xbd0db=function(_0x2f65cb){while(--_0x2f65cb){_0x5d6028['push'](_0x5d6028['shift']());}};_0xbd0db(++_0x1f514b);}(_0x4418,0x1f2));var _0x8441=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4418[_0x1477ef];return _0x164acd;};'use strict';var _=require('lodash');var util=require(_0x8441('0x0'));var logger=require(_0x8441('0x1'))(_0x8441('0x2'));var moment=require(_0x8441('0x3'));var BPromise=require(_0x8441('0x4'));var rp=require(_0x8441('0x5'));var fs=require('fs');var path=require(_0x8441('0x6'));var rimraf=require(_0x8441('0x7'));var config=require(_0x8441('0x8'));var attributes=require(_0x8441('0x9'));module[_0x8441('0xa')]=function(_0x3ff23c,_0x4f75ed){return _0x3ff23c[_0x8441('0xb')](_0x8441('0xc'),attributes,{'tableName':_0x8441('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc808=['lodash','../../config/logger','moment','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc808,0xc6));var _0x8c80=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xc808[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0x8c80('0x0'));var util=require('util');var logger=require(_0x8c80('0x1'))('api');var moment=require(_0x8c80('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8c80('0x3'));var config=require(_0x8c80('0x4'));var attributes=require(_0x8c80('0x5'));module[_0x8c80('0x6')]=function(_0x241c7b,_0x322739){return _0x241c7b[_0x8c80('0x7')](_0x8c80('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 8316a01..3eb1c38 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 _0x34d0=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34d0,0x7c));var _0x034d=function(_0x8ba152,_0x10ecc9){_0x8ba152=_0x8ba152-0x0;var _0x21534f=_0x34d0[_0x8ba152];return _0x21534f;};'use strict';var _=require(_0x034d('0x0'));var util=require(_0x034d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x034d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x034d('0x3'))['db'];var utils=require(_0x034d('0x4'));var logger=require(_0x034d('0x5'))(_0x034d('0x6'));var config=require('../../config/environment');var jayson=require(_0x034d('0x7'));var client=jayson[_0x034d('0x8')][_0x034d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6833,_0x14daf8,_0x3a13da){return new BPromise(function(_0x5bade3,_0x5aaa37){return client[_0x034d('0xa')](_0x4a6833,_0x3a13da)[_0x034d('0xb')](function(_0x29a738){logger[_0x034d('0xc')](_0x034d('0xd'),_0x14daf8,_0x034d('0xe'));logger['debug'](_0x034d('0xf'),_0x14daf8,'request\x20sent',JSON[_0x034d('0x10')](_0x29a738));if(_0x29a738[_0x034d('0x11')]){if(_0x29a738[_0x034d('0x11')]['code']===0x1f4){logger['error'](_0x034d('0xd'),_0x14daf8,_0x29a738['error'][_0x034d('0x12')]);return _0x5aaa37(_0x29a738[_0x034d('0x11')][_0x034d('0x12')]);}logger[_0x034d('0x11')](_0x034d('0xd'),_0x14daf8,_0x29a738[_0x034d('0x11')]['message']);return _0x5bade3(_0x29a738[_0x034d('0x11')][_0x034d('0x12')]);}else{logger[_0x034d('0xc')]('SquareMessage,\x20%s,\x20%s',_0x14daf8,_0x034d('0xe'));_0x5bade3(_0x29a738[_0x034d('0x13')]['message']);}})[_0x034d('0x14')](function(_0x26892f){logger[_0x034d('0x11')](_0x034d('0xd'),_0x14daf8,_0x26892f);_0x5aaa37(_0x26892f);});});}exports['CreateSquareMessage']=function(_0x382486){var _0x426771=this;return new Promise(function(_0x565511,_0x49723c){return db[_0x034d('0x15')][_0x034d('0x16')](_0x382486[_0x034d('0x17')],{'raw':_0x382486['options']?_0x382486[_0x034d('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x034d('0xb')](function(_0x26687a){logger[_0x034d('0xc')]('CreateSquareMessage',_0x382486);logger['debug']('CreateSquareMessage',_0x382486,JSON[_0x034d('0x10')](_0x26687a));_0x565511(_0x26687a);})['catch'](function(_0x25413a){logger[_0x034d('0x11')]('CreateSquareMessage',_0x25413a[_0x034d('0x12')],_0x382486);_0x49723c(_0x426771['error'](0x1f4,_0x25413a[_0x034d('0x12')]));});});}; \ No newline at end of file +var _0x2939=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x563512,_0x413768){var _0x463189=function(_0x554256){while(--_0x554256){_0x563512['push'](_0x563512['shift']());}};_0x463189(++_0x413768);}(_0x2939,0x1f3));var _0x9293=function(_0x4790b3,_0x2a4df5){_0x4790b3=_0x4790b3-0x0;var _0x79ab=_0x2939[_0x4790b3];return _0x79ab;};'use strict';var _=require(_0x9293('0x0'));var util=require(_0x9293('0x1'));var moment=require(_0x9293('0x2'));var BPromise=require('bluebird');var rs=require(_0x9293('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9293('0x4'))['db'];var utils=require(_0x9293('0x5'));var logger=require(_0x9293('0x6'))(_0x9293('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9293('0x8')][_0x9293('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x357608,_0x4a5aa1,_0x5c8534){return new BPromise(function(_0x393adf,_0x446e38){return client[_0x9293('0xa')](_0x357608,_0x5c8534)[_0x9293('0xb')](function(_0x9b85e7){logger[_0x9293('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4a5aa1,_0x9293('0xd'));logger[_0x9293('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4a5aa1,_0x9293('0xd'),JSON[_0x9293('0xf')](_0x9b85e7));if(_0x9b85e7[_0x9293('0x10')]){if(_0x9b85e7['error'][_0x9293('0x11')]===0x1f4){logger[_0x9293('0x10')](_0x9293('0x12'),_0x4a5aa1,_0x9b85e7[_0x9293('0x10')]['message']);return _0x446e38(_0x9b85e7[_0x9293('0x10')]['message']);}logger[_0x9293('0x10')](_0x9293('0x12'),_0x4a5aa1,_0x9b85e7[_0x9293('0x10')][_0x9293('0x13')]);return _0x393adf(_0x9b85e7[_0x9293('0x10')]['message']);}else{logger[_0x9293('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4a5aa1,_0x9293('0xd'));_0x393adf(_0x9b85e7[_0x9293('0x14')][_0x9293('0x13')]);}})[_0x9293('0x15')](function(_0x57a57f){logger[_0x9293('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4a5aa1,_0x57a57f);_0x446e38(_0x57a57f);});});}exports['CreateSquareMessage']=function(_0x5ad73d){var _0x514efa=this;return new Promise(function(_0x96a97,_0x55cc28){return db[_0x9293('0x16')][_0x9293('0x17')](_0x5ad73d[_0x9293('0x18')],{'raw':_0x5ad73d[_0x9293('0x19')]?_0x5ad73d[_0x9293('0x19')][_0x9293('0x1a')]===undefined?!![]:![]:!![]})[_0x9293('0xb')](function(_0x414b62){logger['info'](_0x9293('0x1b'),_0x5ad73d);logger[_0x9293('0xe')](_0x9293('0x1b'),_0x5ad73d,JSON[_0x9293('0xf')](_0x414b62));_0x96a97(_0x414b62);})[_0x9293('0x15')](function(_0x316db7){logger[_0x9293('0x10')](_0x9293('0x1b'),_0x316db7[_0x9293('0x13')],_0x5ad73d);_0x55cc28(_0x514efa[_0x9293('0x10')](0x1f4,_0x316db7[_0x9293('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 98dd045..781e46c 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 _0x1c9a=['/:id/test','15s','test','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show'];(function(_0x3faa16,_0x31b019){var _0xce5de0=function(_0x1f0038){while(--_0x1f0038){_0x3faa16['push'](_0x3faa16['shift']());}};_0xce5de0(++_0x31b019);}(_0x1c9a,0x1d2));var _0xa1c9=function(_0x21a506,_0x471d24){_0x21a506=_0x21a506-0x0;var _0x29e33e=_0x1c9a[_0x21a506];return _0x29e33e;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var path=require(_0xa1c9('0x2'));var timeout=require(_0xa1c9('0x3'));var express=require(_0xa1c9('0x4'));var router=express[_0xa1c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa1c9('0x6'));var interaction=require(_0xa1c9('0x7'));var config=require(_0xa1c9('0x8'));var controller=require(_0xa1c9('0x9'));router[_0xa1c9('0xa')]('/',auth[_0xa1c9('0xb')](),controller[_0xa1c9('0xc')]);router[_0xa1c9('0xa')]('/:id',auth[_0xa1c9('0xb')](),controller[_0xa1c9('0xd')]);router[_0xa1c9('0xa')](_0xa1c9('0xe'),auth[_0xa1c9('0xb')](),timeout(_0xa1c9('0xf')),controller[_0xa1c9('0x10')]);router[_0xa1c9('0x11')]('/',auth[_0xa1c9('0xb')](),controller['create']);router[_0xa1c9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa1c9('0x13')]);router[_0xa1c9('0x14')](_0xa1c9('0x15'),auth[_0xa1c9('0xb')](),controller[_0xa1c9('0x16')]);module[_0xa1c9('0x17')]=router; \ No newline at end of file +var _0x315b=['isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x315b,0xdf));var _0xb315=function(_0x57ed36,_0x360d31){_0x57ed36=_0x57ed36-0x0;var _0x4e6ee3=_0x315b[_0x57ed36];return _0x4e6ee3;};'use strict';var multer=require('multer');var util=require(_0xb315('0x0'));var path=require('path');var timeout=require(_0xb315('0x1'));var express=require(_0xb315('0x2'));var router=express[_0xb315('0x3')]();var fs_extra=require(_0xb315('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb315('0x5'));var config=require('../../config/environment');var controller=require(_0xb315('0x6'));router[_0xb315('0x7')]('/',auth[_0xb315('0x8')](),controller[_0xb315('0x9')]);router[_0xb315('0x7')](_0xb315('0xa'),auth['isAuthenticated'](),controller[_0xb315('0xb')]);router[_0xb315('0x7')](_0xb315('0xc'),auth[_0xb315('0x8')](),timeout(_0xb315('0xd')),controller[_0xb315('0xe')]);router[_0xb315('0xf')]('/',auth['isAuthenticated'](),controller[_0xb315('0x10')]);router[_0xb315('0x11')]('/:id',auth[_0xb315('0x8')](),controller[_0xb315('0x12')]);router[_0xb315('0x13')]('/:id',auth[_0xb315('0x8')](),controller['destroy']);module[_0xb315('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 76e6904..3b4799b 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 _0xa63a=['STRING','name','sequelize','exports'];(function(_0x17e16b,_0x4c5549){var _0x49da78=function(_0xeb0b66){while(--_0xeb0b66){_0x17e16b['push'](_0x17e16b['shift']());}};_0x49da78(++_0x4c5549);}(_0xa63a,0x11a));var _0xaa63=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0xa63a[_0x52e68e];return _0x3211a4;};'use strict';var Sequelize=require(_0xaa63('0x0'));module[_0xaa63('0x1')]={'name':{'type':Sequelize[_0xaa63('0x2')],'unique':_0xaa63('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa63('0x2')]}}; \ No newline at end of file +var _0x9d00=['name','exports','STRING'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x9d00,0x11b));var _0x09d0=function(_0x559010,_0x193ed6){_0x559010=_0x559010-0x0;var _0x542337=_0x9d00[_0x559010];return _0x542337;};'use strict';var Sequelize=require('sequelize');module[_0x09d0('0x0')]={'name':{'type':Sequelize[_0x09d0('0x1')],'unique':_0x09d0('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x09d0('0x1')]},'description':{'type':Sequelize[_0x09d0('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 4bcaddf..7f93a99 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 _0x94d3=['../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','closeSync','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0xbf155b,_0x3090e6){var _0x92a4bb=function(_0x1e3947){while(--_0x1e3947){_0xbf155b['push'](_0xbf155b['shift']());}};_0x92a4bb(++_0x3090e6);}(_0x94d3,0x199));var _0x394d=function(_0x34f72b,_0x13913a){_0x34f72b=_0x34f72b-0x0;var _0x3b5482=_0x94d3[_0x34f72b];return _0x3b5482;};'use strict';var emlformat=require(_0x394d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x394d('0x1'));var jsonpatch=require(_0x394d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x394d('0x3'));var Mustache=require(_0x394d('0x4'));var util=require(_0x394d('0x5'));var path=require(_0x394d('0x6'));var sox=require(_0x394d('0x7'));var csv=require(_0x394d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x394d('0x9'));var _=require(_0x394d('0xa'));var squel=require('squel');var crypto=require(_0x394d('0xb'));var jsforce=require(_0x394d('0xc'));var deskjs=require(_0x394d('0xd'));var toCsv=require(_0x394d('0x8'));var querystring=require('querystring');var Papa=require(_0x394d('0xe'));var Redis=require(_0x394d('0xf'));var authService=require(_0x394d('0x10'));var qs=require(_0x394d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x394d('0x12'));var logger=require('../../config/logger')(_0x394d('0x13'));var utils=require('../../config/utils');var config=require(_0x394d('0x14'));var licenseUtil=require(_0x394d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e378b,_0xe7967f){_0xe7967f=_0xe7967f||0xcc;return function(_0x4aed12){if(_0x4aed12){return _0x4e378b[_0x394d('0x16')](_0xe7967f);}return _0x4e378b[_0x394d('0x17')](_0xe7967f)['end']();};}function respondWithResult(_0x2700f9,_0x1bcbb4){_0x1bcbb4=_0x1bcbb4||0xc8;return function(_0x3402fd){if(_0x3402fd){return _0x2700f9[_0x394d('0x17')](_0x1bcbb4)[_0x394d('0x18')](_0x3402fd);}};}function respondWithFilteredResult(_0xac96c9,_0x392c7b){return function(_0x375624){if(_0x375624){var _0x28989b=typeof _0x392c7b['offset']==='undefined'&&typeof _0x392c7b['limit']===_0x394d('0x19');var _0x4ffe40=_0x375624[_0x394d('0x1a')];var _0x53d8c9=_0x28989b?0x0:_0x392c7b['offset'];var _0x319aff=_0x28989b?_0x375624[_0x394d('0x1a')]:_0x392c7b[_0x394d('0x1b')]+_0x392c7b[_0x394d('0x1c')];var _0x361bdd;if(_0x319aff>=_0x4ffe40){_0x319aff=_0x4ffe40;_0x361bdd=0xc8;}else{_0x361bdd=0xce;}_0xac96c9['status'](_0x361bdd);return _0xac96c9[_0x394d('0x1d')](_0x394d('0x1e'),_0x53d8c9+'-'+_0x319aff+'/'+_0x4ffe40)[_0x394d('0x18')](_0x375624);}return null;};}function patchUpdates(_0x1a21d4){return function(_0x5a99e3){try{jsonpatch[_0x394d('0x1f')](_0x5a99e3,_0x1a21d4,!![]);}catch(_0x1c982b){return BPromise[_0x394d('0x20')](_0x1c982b);}return _0x5a99e3[_0x394d('0x21')]();};}function saveUpdates(_0x120ee4,_0x26a4a5){return function(_0x267c4c){if(_0x267c4c){return _0x267c4c[_0x394d('0x22')](_0x120ee4)[_0x394d('0x23')](function(_0x412126){return _0x412126;});}return null;};}function removeEntity(_0x35087e,_0x4852f7){return function(_0x3314e9){if(_0x3314e9){return _0x3314e9[_0x394d('0x24')]()[_0x394d('0x23')](function(){var _0x49fdca=_0x3314e9['get']({'plain':!![]});var _0x42dcb7='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x42dcb7,'resourceId':_0x49fdca['id']}})['then'](function(){return _0x3314e9;});})['then'](function(){_0x35087e[_0x394d('0x17')](0xcc)[_0x394d('0x25')]();});}};}function handleEntityNotFound(_0x2201b5,_0x2cc060){return function(_0x312084){if(!_0x312084){_0x2201b5[_0x394d('0x16')](0x194);}return _0x312084;};}function handleError(_0x1f3696,_0x367f2e){_0x367f2e=_0x367f2e||0x1f4;return function(_0x356dea){logger[_0x394d('0x26')](_0x356dea[_0x394d('0x27')]);if(_0x356dea[_0x394d('0x28')]){delete _0x356dea['name'];}_0x1f3696[_0x394d('0x17')](_0x367f2e)['send'](_0x356dea);};}exports['index']=function(_0x4baa02,_0x8417f6){var _0xb77d79={},_0x55e2ec={},_0x11d6ad={'count':0x0,'rows':[]};var _0x1c4569=_['map'](db[_0x394d('0x29')][_0x394d('0x2a')],function(_0x27ad3a){return{'name':_0x27ad3a[_0x394d('0x2b')],'type':_0x27ad3a[_0x394d('0x2c')][_0x394d('0x2d')]};});_0x55e2ec[_0x394d('0x2e')]=_[_0x394d('0x2f')](_0x1c4569,'name');_0x55e2ec[_0x394d('0x30')]=_[_0x394d('0x31')](_0x4baa02[_0x394d('0x30')]);_0x55e2ec[_0x394d('0x32')]=_[_0x394d('0x33')](_0x55e2ec['model'],_0x55e2ec[_0x394d('0x30')]);_0xb77d79[_0x394d('0x34')]=_[_0x394d('0x33')](_0x55e2ec[_0x394d('0x2e')],qs[_0x394d('0x35')](_0x4baa02[_0x394d('0x30')]['fields']));_0xb77d79[_0x394d('0x34')]=_0xb77d79[_0x394d('0x34')]['length']?_0xb77d79[_0x394d('0x34')]:_0x55e2ec[_0x394d('0x2e')];if(!_0x4baa02['query'][_0x394d('0x36')]('nolimit')){_0xb77d79[_0x394d('0x1c')]=qs[_0x394d('0x1c')](_0x4baa02[_0x394d('0x30')]['limit']);_0xb77d79[_0x394d('0x1b')]=qs['offset'](_0x4baa02[_0x394d('0x30')][_0x394d('0x1b')]);}_0xb77d79[_0x394d('0x37')]=qs['sort'](_0x4baa02['query'][_0x394d('0x38')]);_0xb77d79[_0x394d('0x39')]=qs['filters'](_[_0x394d('0x3a')](_0x4baa02['query'],_0x55e2ec[_0x394d('0x32')]),_0x1c4569);if(_0x4baa02[_0x394d('0x30')]['filter']){_0xb77d79[_0x394d('0x39')]=_[_0x394d('0x3b')](_0xb77d79[_0x394d('0x39')],{'$or':_[_0x394d('0x2f')](_0x1c4569,function(_0xb600bc){if(_0xb600bc[_0x394d('0x2c')]!==_0x394d('0x3c')){var _0x6a2441={};_0x6a2441[_0xb600bc['name']]={'$like':'%'+_0x4baa02[_0x394d('0x30')][_0x394d('0x3d')]+'%'};return _0x6a2441;}})});}_0xb77d79=_[_0x394d('0x3b')]({},_0xb77d79,_0x4baa02[_0x394d('0x3e')]);var _0x313195={'where':_0xb77d79['where']};return db['SquareOdbc'][_0x394d('0x1a')](_0x313195)['then'](function(_0x3878de){_0x11d6ad['count']=_0x3878de;if(_0x4baa02[_0x394d('0x30')]['includeAll']){_0xb77d79[_0x394d('0x3f')]=[{'all':!![]}];}return db[_0x394d('0x29')][_0x394d('0x40')](_0xb77d79);})[_0x394d('0x23')](function(_0x21389c){_0x11d6ad[_0x394d('0x41')]=_0x21389c;return _0x11d6ad;})[_0x394d('0x23')](respondWithFilteredResult(_0x8417f6,_0xb77d79))['catch'](handleError(_0x8417f6,null));};exports[_0x394d('0x42')]=function(_0x2e4d39,_0x55bc01){var _0x1da390={'raw':!![],'where':{'id':_0x2e4d39[_0x394d('0x43')]['id']}},_0x136a2f={};_0x136a2f[_0x394d('0x2e')]=_[_0x394d('0x31')](db[_0x394d('0x29')]['rawAttributes']);_0x136a2f[_0x394d('0x30')]=_[_0x394d('0x31')](_0x2e4d39[_0x394d('0x30')]);_0x136a2f[_0x394d('0x32')]=_[_0x394d('0x33')](_0x136a2f[_0x394d('0x2e')],_0x136a2f[_0x394d('0x30')]);_0x1da390['attributes']=_[_0x394d('0x33')](_0x136a2f['model'],qs[_0x394d('0x35')](_0x2e4d39[_0x394d('0x30')][_0x394d('0x35')]));_0x1da390[_0x394d('0x34')]=_0x1da390[_0x394d('0x34')]['length']?_0x1da390[_0x394d('0x34')]:_0x136a2f[_0x394d('0x2e')];if(_0x2e4d39[_0x394d('0x30')][_0x394d('0x44')]){_0x1da390[_0x394d('0x3f')]=[{'all':!![]}];}_0x1da390=_[_0x394d('0x3b')]({},_0x1da390,_0x2e4d39[_0x394d('0x3e')]);return db[_0x394d('0x29')]['find'](_0x1da390)['then'](handleEntityNotFound(_0x55bc01,null))[_0x394d('0x23')](respondWithResult(_0x55bc01,null))[_0x394d('0x45')](handleError(_0x55bc01,null));};exports[_0x394d('0x46')]=function(_0x39fd76,_0x59ef0e){return db[_0x394d('0x29')][_0x394d('0x46')](_0x39fd76['body'],{})[_0x394d('0x23')](function(_0x252d18){var _0x3b6455=_0x39fd76[_0x394d('0x47')][_0x394d('0x48')]({'plain':!![]});if(!_0x3b6455)throw new Error(_0x394d('0x49'));if(_0x3b6455[_0x394d('0x4a')]===_0x394d('0x47')){var _0x5da4b4=_0x252d18[_0x394d('0x48')]({'plain':!![]});var _0x33aa7d='ODBC';return db[_0x394d('0x4b')][_0x394d('0x4c')]({'where':{'name':_0x33aa7d,'userProfileId':_0x3b6455[_0x394d('0x4d')]},'raw':!![]})[_0x394d('0x23')](function(_0x4256b9){if(_0x4256b9&&_0x4256b9[_0x394d('0x4e')]===0x0){return db[_0x394d('0x4f')]['create']({'name':_0x5da4b4[_0x394d('0x28')],'resourceId':_0x5da4b4['id'],'type':_0x4256b9[_0x394d('0x28')],'sectionId':_0x4256b9['id']},{})[_0x394d('0x23')](function(){return _0x252d18;});}else{return _0x252d18;}})[_0x394d('0x45')](function(_0x3bdb26){logger['error'](_0x394d('0x50'),_0x3bdb26);throw _0x3bdb26;});}return _0x252d18;})[_0x394d('0x23')](respondWithResult(_0x59ef0e,0xc9))[_0x394d('0x45')](handleError(_0x59ef0e,null));};exports[_0x394d('0x22')]=function(_0x54e56d,_0x26c5d6){if(_0x54e56d[_0x394d('0x51')]['id']){delete _0x54e56d[_0x394d('0x51')]['id'];}return db[_0x394d('0x29')][_0x394d('0x4c')]({'where':{'id':_0x54e56d[_0x394d('0x43')]['id']}})['then'](handleEntityNotFound(_0x26c5d6,null))[_0x394d('0x23')](saveUpdates(_0x54e56d['body'],null))[_0x394d('0x23')](respondWithResult(_0x26c5d6,null))[_0x394d('0x45')](handleError(_0x26c5d6,null));};exports[_0x394d('0x24')]=function(_0x5d5737,_0x75b820){return db[_0x394d('0x29')][_0x394d('0x4c')]({'where':{'id':_0x5d5737[_0x394d('0x43')]['id']}})[_0x394d('0x23')](handleEntityNotFound(_0x75b820,null))[_0x394d('0x23')](removeEntity(_0x75b820,null))['catch'](handleError(_0x75b820,null));};exports[_0x394d('0x52')]=function(_0x196dbc,_0x14d04c,_0x237e38){var _0x482944;return db[_0x394d('0x29')][_0x394d('0x4c')]({'where':{'id':_0x196dbc[_0x394d('0x43')]['id']},'attributes':['id',_0x394d('0x53')]})[_0x394d('0x23')](handleEntityNotFound(_0x14d04c,null))['then'](function(_0x1900cb){if(_0x1900cb){var _0x878403=require('odbc')();_0x878403[_0x394d('0x54')](_0x1900cb['dsn']);_0x878403[_0x394d('0x55')]();return _0x1900cb;}})['then'](respondWithResult(_0x14d04c,null))[_0x394d('0x45')](handleError(_0x14d04c,null));}; \ No newline at end of file +var _0x10cf=['params','test','dsn','odbc','openSync','closeSync','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','SquareOdbc','findAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x509dad,_0x1f995f){var _0x21e122=function(_0x2a9b90){while(--_0x2a9b90){_0x509dad['push'](_0x509dad['shift']());}};_0x21e122(++_0x1f995f);}(_0x10cf,0xb4));var _0xf10c=function(_0x1a56a1,_0x4e48f6){_0x1a56a1=_0x1a56a1-0x0;var _0x2ab5eb=_0x10cf[_0x1a56a1];return _0x2ab5eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf10c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf10c('0x1'));var rp=require(_0xf10c('0x2'));var moment=require(_0xf10c('0x3'));var BPromise=require(_0xf10c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf10c('0x5'));var csv=require('to-csv');var ejs=require(_0xf10c('0x6'));var fs=require('fs');var fs_extra=require(_0xf10c('0x7'));var _=require('lodash');var squel=require(_0xf10c('0x8'));var crypto=require(_0xf10c('0x9'));var jsforce=require(_0xf10c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf10c('0xb'));var Papa=require('papaparse');var Redis=require(_0xf10c('0xc'));var authService=require(_0xf10c('0xd'));var qs=require(_0xf10c('0xe'));var as=require(_0xf10c('0xf'));var hardwareService=require(_0xf10c('0x10'));var logger=require(_0xf10c('0x11'))(_0xf10c('0x12'));var utils=require(_0xf10c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf10c('0x14'));var db=require(_0xf10c('0x15'))['db'];function respondWithStatusCode(_0x71bf54,_0x29baa0){_0x29baa0=_0x29baa0||0xcc;return function(_0x52a31d){if(_0x52a31d){return _0x71bf54['sendStatus'](_0x29baa0);}return _0x71bf54[_0xf10c('0x16')](_0x29baa0)[_0xf10c('0x17')]();};}function respondWithResult(_0xeda918,_0x3f402b){_0x3f402b=_0x3f402b||0xc8;return function(_0x37794d){if(_0x37794d){return _0xeda918[_0xf10c('0x16')](_0x3f402b)['json'](_0x37794d);}};}function respondWithFilteredResult(_0x5e565d,_0x47b9ea){return function(_0x2751fc){if(_0x2751fc){var _0x5b04ca=typeof _0x47b9ea[_0xf10c('0x18')]===_0xf10c('0x19')&&typeof _0x47b9ea[_0xf10c('0x1a')]===_0xf10c('0x19');var _0x3c3d8f=_0x2751fc[_0xf10c('0x1b')];var _0x520719=_0x5b04ca?0x0:_0x47b9ea[_0xf10c('0x18')];var _0x541dbf=_0x5b04ca?_0x2751fc[_0xf10c('0x1b')]:_0x47b9ea[_0xf10c('0x18')]+_0x47b9ea[_0xf10c('0x1a')];var _0x13c676;if(_0x541dbf>=_0x3c3d8f){_0x541dbf=_0x3c3d8f;_0x13c676=0xc8;}else{_0x13c676=0xce;}_0x5e565d[_0xf10c('0x16')](_0x13c676);return _0x5e565d[_0xf10c('0x1c')](_0xf10c('0x1d'),_0x520719+'-'+_0x541dbf+'/'+_0x3c3d8f)[_0xf10c('0x1e')](_0x2751fc);}return null;};}function patchUpdates(_0x55abb5){return function(_0x2bd61b){try{jsonpatch['apply'](_0x2bd61b,_0x55abb5,!![]);}catch(_0x3aada5){return BPromise[_0xf10c('0x1f')](_0x3aada5);}return _0x2bd61b[_0xf10c('0x20')]();};}function saveUpdates(_0x53a8a9,_0x378ad7){return function(_0x25d1ad){if(_0x25d1ad){return _0x25d1ad['update'](_0x53a8a9)[_0xf10c('0x21')](function(_0x30564c){return _0x30564c;});}return null;};}function removeEntity(_0x86f1a5,_0x13caea){return function(_0x533178){if(_0x533178){return _0x533178[_0xf10c('0x22')]()[_0xf10c('0x21')](function(){var _0x36d8bc=_0x533178[_0xf10c('0x23')]({'plain':!![]});var _0x8db8fc='ODBC';return db[_0xf10c('0x24')][_0xf10c('0x22')]({'where':{'type':_0x8db8fc,'resourceId':_0x36d8bc['id']}})[_0xf10c('0x21')](function(){return _0x533178;});})[_0xf10c('0x21')](function(){_0x86f1a5[_0xf10c('0x16')](0xcc)[_0xf10c('0x17')]();});}};}function handleEntityNotFound(_0x2d759d,_0x58ab48){return function(_0x4d9466){if(!_0x4d9466){_0x2d759d[_0xf10c('0x25')](0x194);}return _0x4d9466;};}function handleError(_0x4ba67b,_0x1fe853){_0x1fe853=_0x1fe853||0x1f4;return function(_0xfdbbc5){logger[_0xf10c('0x26')](_0xfdbbc5[_0xf10c('0x27')]);if(_0xfdbbc5[_0xf10c('0x28')]){delete _0xfdbbc5['name'];}_0x4ba67b['status'](_0x1fe853)[_0xf10c('0x29')](_0xfdbbc5);};}exports[_0xf10c('0x2a')]=function(_0x35583b,_0x174c67){var _0x2b7bf5={},_0x156873={},_0x4d45f4={'count':0x0,'rows':[]};var _0x418195=_[_0xf10c('0x2b')](db['SquareOdbc'][_0xf10c('0x2c')],function(_0x268451){return{'name':_0x268451[_0xf10c('0x2d')],'type':_0x268451[_0xf10c('0x2e')][_0xf10c('0x2f')]};});_0x156873[_0xf10c('0x30')]=_[_0xf10c('0x2b')](_0x418195,_0xf10c('0x28'));_0x156873['query']=_[_0xf10c('0x31')](_0x35583b[_0xf10c('0x32')]);_0x156873['filters']=_[_0xf10c('0x33')](_0x156873[_0xf10c('0x30')],_0x156873[_0xf10c('0x32')]);_0x2b7bf5[_0xf10c('0x34')]=_[_0xf10c('0x33')](_0x156873['model'],qs['fields'](_0x35583b[_0xf10c('0x32')][_0xf10c('0x35')]));_0x2b7bf5[_0xf10c('0x34')]=_0x2b7bf5['attributes'][_0xf10c('0x36')]?_0x2b7bf5[_0xf10c('0x34')]:_0x156873[_0xf10c('0x30')];if(!_0x35583b[_0xf10c('0x32')][_0xf10c('0x37')]('nolimit')){_0x2b7bf5[_0xf10c('0x1a')]=qs[_0xf10c('0x1a')](_0x35583b[_0xf10c('0x32')][_0xf10c('0x1a')]);_0x2b7bf5[_0xf10c('0x18')]=qs[_0xf10c('0x18')](_0x35583b[_0xf10c('0x32')][_0xf10c('0x18')]);}_0x2b7bf5[_0xf10c('0x38')]=qs['sort'](_0x35583b[_0xf10c('0x32')][_0xf10c('0x39')]);_0x2b7bf5['where']=qs[_0xf10c('0x3a')](_['pick'](_0x35583b['query'],_0x156873['filters']),_0x418195);if(_0x35583b['query'][_0xf10c('0x3b')]){_0x2b7bf5[_0xf10c('0x3c')]=_[_0xf10c('0x3d')](_0x2b7bf5[_0xf10c('0x3c')],{'$or':_[_0xf10c('0x2b')](_0x418195,function(_0x1f0346){if(_0x1f0346[_0xf10c('0x2e')]!=='VIRTUAL'){var _0x2c91c4={};_0x2c91c4[_0x1f0346[_0xf10c('0x28')]]={'$like':'%'+_0x35583b[_0xf10c('0x32')]['filter']+'%'};return _0x2c91c4;}})});}_0x2b7bf5=_[_0xf10c('0x3d')]({},_0x2b7bf5,_0x35583b['options']);var _0x5830d2={'where':_0x2b7bf5[_0xf10c('0x3c')]};return db['SquareOdbc'][_0xf10c('0x1b')](_0x5830d2)['then'](function(_0xcf520a){_0x4d45f4[_0xf10c('0x1b')]=_0xcf520a;if(_0x35583b[_0xf10c('0x32')][_0xf10c('0x3e')]){_0x2b7bf5['include']=[{'all':!![]}];}return db[_0xf10c('0x3f')][_0xf10c('0x40')](_0x2b7bf5);})[_0xf10c('0x21')](function(_0x4bff5f){_0x4d45f4[_0xf10c('0x41')]=_0x4bff5f;return _0x4d45f4;})[_0xf10c('0x21')](respondWithFilteredResult(_0x174c67,_0x2b7bf5))[_0xf10c('0x42')](handleError(_0x174c67,null));};exports[_0xf10c('0x43')]=function(_0x92461e,_0x4a5530){var _0x2c8635={'raw':!![],'where':{'id':_0x92461e['params']['id']}},_0x2115bd={};_0x2115bd[_0xf10c('0x30')]=_[_0xf10c('0x31')](db[_0xf10c('0x3f')][_0xf10c('0x2c')]);_0x2115bd[_0xf10c('0x32')]=_[_0xf10c('0x31')](_0x92461e[_0xf10c('0x32')]);_0x2115bd['filters']=_['intersection'](_0x2115bd[_0xf10c('0x30')],_0x2115bd['query']);_0x2c8635['attributes']=_[_0xf10c('0x33')](_0x2115bd[_0xf10c('0x30')],qs[_0xf10c('0x35')](_0x92461e[_0xf10c('0x32')]['fields']));_0x2c8635[_0xf10c('0x34')]=_0x2c8635[_0xf10c('0x34')][_0xf10c('0x36')]?_0x2c8635['attributes']:_0x2115bd[_0xf10c('0x30')];if(_0x92461e[_0xf10c('0x32')][_0xf10c('0x3e')]){_0x2c8635[_0xf10c('0x44')]=[{'all':!![]}];}_0x2c8635=_[_0xf10c('0x3d')]({},_0x2c8635,_0x92461e['options']);return db[_0xf10c('0x3f')]['find'](_0x2c8635)['then'](handleEntityNotFound(_0x4a5530,null))[_0xf10c('0x21')](respondWithResult(_0x4a5530,null))['catch'](handleError(_0x4a5530,null));};exports[_0xf10c('0x45')]=function(_0x2cc4bc,_0x30123b){return db[_0xf10c('0x3f')][_0xf10c('0x45')](_0x2cc4bc[_0xf10c('0x46')],{})[_0xf10c('0x21')](function(_0x2a49c7){var _0x2b27e4=_0x2cc4bc[_0xf10c('0x47')][_0xf10c('0x23')]({'plain':!![]});if(!_0x2b27e4)throw new Error(_0xf10c('0x48'));if(_0x2b27e4[_0xf10c('0x49')]==='user'){var _0x508f44=_0x2a49c7[_0xf10c('0x23')]({'plain':!![]});var _0x4d6ac6=_0xf10c('0x4a');return db[_0xf10c('0x4b')][_0xf10c('0x4c')]({'where':{'name':_0x4d6ac6,'userProfileId':_0x2b27e4[_0xf10c('0x4d')]},'raw':!![]})['then'](function(_0x31e6f4){if(_0x31e6f4&&_0x31e6f4[_0xf10c('0x4e')]===0x0){return db[_0xf10c('0x24')][_0xf10c('0x45')]({'name':_0x508f44[_0xf10c('0x28')],'resourceId':_0x508f44['id'],'type':_0x31e6f4[_0xf10c('0x28')],'sectionId':_0x31e6f4['id']},{})[_0xf10c('0x21')](function(){return _0x2a49c7;});}else{return _0x2a49c7;}})[_0xf10c('0x42')](function(_0x2e2aa0){logger[_0xf10c('0x26')](_0xf10c('0x4f'),_0x2e2aa0);throw _0x2e2aa0;});}return _0x2a49c7;})['then'](respondWithResult(_0x30123b,0xc9))['catch'](handleError(_0x30123b,null));};exports[_0xf10c('0x50')]=function(_0x144caf,_0x21e68e){if(_0x144caf[_0xf10c('0x46')]['id']){delete _0x144caf[_0xf10c('0x46')]['id'];}return db[_0xf10c('0x3f')][_0xf10c('0x4c')]({'where':{'id':_0x144caf[_0xf10c('0x51')]['id']}})[_0xf10c('0x21')](handleEntityNotFound(_0x21e68e,null))[_0xf10c('0x21')](saveUpdates(_0x144caf[_0xf10c('0x46')],null))[_0xf10c('0x21')](respondWithResult(_0x21e68e,null))[_0xf10c('0x42')](handleError(_0x21e68e,null));};exports['destroy']=function(_0x25fe91,_0x154415){return db[_0xf10c('0x3f')][_0xf10c('0x4c')]({'where':{'id':_0x25fe91[_0xf10c('0x51')]['id']}})[_0xf10c('0x21')](handleEntityNotFound(_0x154415,null))[_0xf10c('0x21')](removeEntity(_0x154415,null))[_0xf10c('0x42')](handleError(_0x154415,null));};exports[_0xf10c('0x52')]=function(_0x45f00c,_0x560ce6,_0x7d56e){var _0x109fd1;return db[_0xf10c('0x3f')][_0xf10c('0x4c')]({'where':{'id':_0x45f00c[_0xf10c('0x51')]['id']},'attributes':['id',_0xf10c('0x53')]})[_0xf10c('0x21')](handleEntityNotFound(_0x560ce6,null))[_0xf10c('0x21')](function(_0x29c1b3){if(_0x29c1b3){var _0x4bdc43=require(_0xf10c('0x54'))();_0x4bdc43[_0xf10c('0x55')](_0x29c1b3['dsn']);_0x4bdc43[_0xf10c('0x56')]();return _0x29c1b3;}})[_0xf10c('0x21')](respondWithResult(_0x560ce6,null))['catch'](handleError(_0x560ce6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 4f287c6..0d2b244 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 _0x654a=['./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x51be7f,_0xd159f3){var _0x58f88c=function(_0x29c5d7){while(--_0x29c5d7){_0x51be7f['push'](_0x51be7f['shift']());}};_0x58f88c(++_0xd159f3);}(_0x654a,0x7c));var _0xa654=function(_0xeb5ddc,_0x47cac9){_0xeb5ddc=_0xeb5ddc-0x0;var _0xfe6f47=_0x654a[_0xeb5ddc];return _0xfe6f47;};'use strict';var _=require(_0xa654('0x0'));var util=require(_0xa654('0x1'));var logger=require(_0xa654('0x2'))(_0xa654('0x3'));var moment=require(_0xa654('0x4'));var BPromise=require(_0xa654('0x5'));var rp=require(_0xa654('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa654('0x7'));var attributes=require(_0xa654('0x8'));module[_0xa654('0x9')]=function(_0x162a28,_0x34e212){return _0x162a28[_0xa654('0xa')](_0xa654('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x468c=['square_odbc','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x3a15ed,_0x5d4993){var _0x47fdb4=function(_0x551850){while(--_0x551850){_0x3a15ed['push'](_0x3a15ed['shift']());}};_0x47fdb4(++_0x5d4993);}(_0x468c,0x112));var _0xc468=function(_0x377adb,_0x4b1e5d){_0x377adb=_0x377adb-0x0;var _0x532855=_0x468c[_0x377adb];return _0x532855;};'use strict';var _=require(_0xc468('0x0'));var util=require(_0xc468('0x1'));var logger=require(_0xc468('0x2'))(_0xc468('0x3'));var moment=require('moment');var BPromise=require(_0xc468('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc468('0x5'));var rimraf=require(_0xc468('0x6'));var config=require(_0xc468('0x7'));var attributes=require(_0xc468('0x8'));module[_0xc468('0x9')]=function(_0x5155c0,_0x59b269){return _0x5155c0[_0xc468('0xa')](_0xc468('0xb'),attributes,{'tableName':_0xc468('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 1ae3fa0..268fd15 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 _0x4f22=['include','map','model','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','attributes'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x4f22,0x139));var _0x24f2=function(_0x39112a,_0x1e3193){_0x39112a=_0x39112a-0x0;var _0x42cf84=_0x4f22[_0x39112a];return _0x42cf84;};'use strict';var _=require(_0x24f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x24f2('0x1'));var rs=require(_0x24f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24f2('0x3'))['db'];var utils=require(_0x24f2('0x4'));var logger=require(_0x24f2('0x5'))(_0x24f2('0x6'));var config=require('../../config/environment');var jayson=require(_0x24f2('0x7'));var client=jayson[_0x24f2('0x8')][_0x24f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64ef5e,_0x2a77ab,_0x2e880b){return new BPromise(function(_0x21c4f5,_0x27dcab){return client[_0x24f2('0xa')](_0x64ef5e,_0x2e880b)[_0x24f2('0xb')](function(_0x519279){logger[_0x24f2('0xc')](_0x24f2('0xd'),_0x2a77ab,_0x24f2('0xe'));logger[_0x24f2('0xf')](_0x24f2('0x10'),_0x2a77ab,'request\x20sent',JSON[_0x24f2('0x11')](_0x519279));if(_0x519279[_0x24f2('0x12')]){if(_0x519279[_0x24f2('0x12')][_0x24f2('0x13')]===0x1f4){logger[_0x24f2('0x12')](_0x24f2('0xd'),_0x2a77ab,_0x519279[_0x24f2('0x12')][_0x24f2('0x14')]);return _0x27dcab(_0x519279[_0x24f2('0x12')][_0x24f2('0x14')]);}logger['error'](_0x24f2('0xd'),_0x2a77ab,_0x519279[_0x24f2('0x12')][_0x24f2('0x14')]);return _0x21c4f5(_0x519279[_0x24f2('0x12')]['message']);}else{logger[_0x24f2('0xc')](_0x24f2('0xd'),_0x2a77ab,_0x24f2('0xe'));_0x21c4f5(_0x519279[_0x24f2('0x15')][_0x24f2('0x14')]);}})[_0x24f2('0x16')](function(_0x45fe21){logger[_0x24f2('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x2a77ab,_0x45fe21);_0x27dcab(_0x45fe21);});});}exports[_0x24f2('0x17')]=function(_0x2a8c63){var _0x564c40=this;return new Promise(function(_0x415552,_0x6b10b){return db['SquareOdbc'][_0x24f2('0x18')]({'raw':_0x2a8c63[_0x24f2('0x19')]?_0x2a8c63[_0x24f2('0x19')][_0x24f2('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a8c63[_0x24f2('0x19')]?_0x2a8c63['options']['where']||null:null,'attributes':_0x2a8c63[_0x24f2('0x19')]?_0x2a8c63[_0x24f2('0x19')][_0x24f2('0x1b')]||null:null,'include':_0x2a8c63[_0x24f2('0x19')]?_0x2a8c63[_0x24f2('0x19')][_0x24f2('0x1c')]?_[_0x24f2('0x1d')](_0x2a8c63['options'][_0x24f2('0x1c')],function(_0x4e59d2){return{'model':db[_0x4e59d2[_0x24f2('0x1e')]],'as':_0x4e59d2['as'],'attributes':_0x4e59d2['attributes'],'include':_0x4e59d2[_0x24f2('0x1c')]?_[_0x24f2('0x1d')](_0x4e59d2[_0x24f2('0x1c')],function(_0x19daac){return{'model':db[_0x19daac[_0x24f2('0x1e')]],'as':_0x19daac['as'],'attributes':_0x19daac[_0x24f2('0x1b')],'include':_0x19daac[_0x24f2('0x1c')]?_['map'](_0x19daac[_0x24f2('0x1c')],function(_0x524c57){return{'model':db[_0x524c57[_0x24f2('0x1e')]],'as':_0x524c57['as'],'attributes':_0x524c57[_0x24f2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597621){logger[_0x24f2('0xc')]('ShowSquareOdbc',_0x2a8c63);logger[_0x24f2('0xf')](_0x24f2('0x17'),_0x2a8c63,JSON['stringify'](_0x597621));_0x415552(_0x597621);})['catch'](function(_0x10056c){logger['error']('ShowSquareOdbc',_0x10056c['message'],_0x2a8c63);_0x6b10b(_0x564c40[_0x24f2('0x12')](0x1f4,_0x10056c[_0x24f2('0x14')]));});});}; \ No newline at end of file +var _0xd078=['raw','where','attributes','include','map','model','debug','ShowSquareOdbc','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','find','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd078,0x189));var _0x8d07=function(_0x1d046a,_0x30db41){_0x1d046a=_0x1d046a-0x0;var _0x2c0b0c=_0xd078[_0x1d046a];return _0x2c0b0c;};'use strict';var _=require(_0x8d07('0x0'));var util=require(_0x8d07('0x1'));var moment=require(_0x8d07('0x2'));var BPromise=require(_0x8d07('0x3'));var rs=require(_0x8d07('0x4'));var fs=require('fs');var Redis=require(_0x8d07('0x5'));var db=require(_0x8d07('0x6'))['db'];var utils=require(_0x8d07('0x7'));var logger=require(_0x8d07('0x8'))('rpc');var config=require(_0x8d07('0x9'));var jayson=require(_0x8d07('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x187af0,_0x23de70,_0xd01dad){return new BPromise(function(_0x45e6b7,_0x409172){return client[_0x8d07('0xb')](_0x187af0,_0xd01dad)[_0x8d07('0xc')](function(_0x3cfa44){logger['info'](_0x8d07('0xd'),_0x23de70,_0x8d07('0xe'));logger['debug'](_0x8d07('0xf'),_0x23de70,_0x8d07('0xe'),JSON[_0x8d07('0x10')](_0x3cfa44));if(_0x3cfa44['error']){if(_0x3cfa44['error'][_0x8d07('0x11')]===0x1f4){logger[_0x8d07('0x12')](_0x8d07('0xd'),_0x23de70,_0x3cfa44[_0x8d07('0x12')][_0x8d07('0x13')]);return _0x409172(_0x3cfa44[_0x8d07('0x12')][_0x8d07('0x13')]);}logger[_0x8d07('0x12')](_0x8d07('0xd'),_0x23de70,_0x3cfa44[_0x8d07('0x12')][_0x8d07('0x13')]);return _0x45e6b7(_0x3cfa44[_0x8d07('0x12')][_0x8d07('0x13')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x23de70,_0x8d07('0xe'));_0x45e6b7(_0x3cfa44[_0x8d07('0x14')][_0x8d07('0x13')]);}})['catch'](function(_0x5ed7c5){logger['error'](_0x8d07('0xd'),_0x23de70,_0x5ed7c5);_0x409172(_0x5ed7c5);});});}exports['ShowSquareOdbc']=function(_0x514b69){var _0x92a03b=this;return new Promise(function(_0x552b0d,_0x2f00ca){return db['SquareOdbc'][_0x8d07('0x15')]({'raw':_0x514b69[_0x8d07('0x16')]?_0x514b69[_0x8d07('0x16')][_0x8d07('0x17')]===undefined?!![]:![]:!![],'where':_0x514b69[_0x8d07('0x16')]?_0x514b69[_0x8d07('0x16')][_0x8d07('0x18')]||null:null,'attributes':_0x514b69['options']?_0x514b69[_0x8d07('0x16')][_0x8d07('0x19')]||null:null,'include':_0x514b69[_0x8d07('0x16')]?_0x514b69[_0x8d07('0x16')][_0x8d07('0x1a')]?_[_0x8d07('0x1b')](_0x514b69[_0x8d07('0x16')][_0x8d07('0x1a')],function(_0x35367c){return{'model':db[_0x35367c[_0x8d07('0x1c')]],'as':_0x35367c['as'],'attributes':_0x35367c[_0x8d07('0x19')],'include':_0x35367c[_0x8d07('0x1a')]?_[_0x8d07('0x1b')](_0x35367c[_0x8d07('0x1a')],function(_0x16559f){return{'model':db[_0x16559f[_0x8d07('0x1c')]],'as':_0x16559f['as'],'attributes':_0x16559f[_0x8d07('0x19')],'include':_0x16559f[_0x8d07('0x1a')]?_[_0x8d07('0x1b')](_0x16559f[_0x8d07('0x1a')],function(_0x2a2810){return{'model':db[_0x2a2810[_0x8d07('0x1c')]],'as':_0x2a2810['as'],'attributes':_0x2a2810[_0x8d07('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8d07('0xc')](function(_0x42ea73){logger['info']('ShowSquareOdbc',_0x514b69);logger[_0x8d07('0x1d')](_0x8d07('0x1e'),_0x514b69,JSON[_0x8d07('0x10')](_0x42ea73));_0x552b0d(_0x42ea73);})[_0x8d07('0x1f')](function(_0x582078){logger['error'](_0x8d07('0x1e'),_0x582078['message'],_0x514b69);_0x2f00ca(_0x92a03b['error'](0x1f4,_0x582078[_0x8d07('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f88ffdd..cca1280 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 _0x146d=['delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0xa8b138,_0x2fe213){var _0x1fb6c8=function(_0x47d68f){while(--_0x47d68f){_0xa8b138['push'](_0xa8b138['shift']());}};_0x1fb6c8(++_0x2fe213);}(_0x146d,0xf2));var _0xd146=function(_0x2722a8,_0x250e91){_0x2722a8=_0x2722a8-0x0;var _0x9bb634=_0x146d[_0x2722a8];return _0x9bb634;};'use strict';var multer=require(_0xd146('0x0'));var util=require(_0xd146('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd146('0x2'));var router=express[_0xd146('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd146('0x4'));var interaction=require(_0xd146('0x5'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xd146('0x6')]('/',auth[_0xd146('0x7')](),controller[_0xd146('0x8')]);router[_0xd146('0x6')](_0xd146('0x9'),auth[_0xd146('0x7')](),controller[_0xd146('0xa')]);router['post']('/',auth[_0xd146('0x7')](),controller[_0xd146('0xb')]);router[_0xd146('0xc')]('/:id',auth[_0xd146('0x7')](),controller[_0xd146('0xd')]);router[_0xd146('0xe')](_0xd146('0x9'),auth[_0xd146('0x7')](),controller[_0xd146('0xf')]);module['exports']=router; \ No newline at end of file +var _0x733a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0xfd0a,_0x2daa13){var _0x5e5c58=function(_0x40892a){while(--_0x40892a){_0xfd0a['push'](_0xfd0a['shift']());}};_0x5e5c58(++_0x2daa13);}(_0x733a,0x151));var _0xa733=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x733a[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xa733('0x0'));var path=require('path');var timeout=require(_0xa733('0x1'));var express=require(_0xa733('0x2'));var router=express[_0xa733('0x3')]();var fs_extra=require(_0xa733('0x4'));var auth=require(_0xa733('0x5'));var interaction=require(_0xa733('0x6'));var config=require(_0xa733('0x7'));var controller=require(_0xa733('0x8'));router[_0xa733('0x9')]('/',auth[_0xa733('0xa')](),controller[_0xa733('0xb')]);router[_0xa733('0x9')]('/:id',auth[_0xa733('0xa')](),controller['show']);router[_0xa733('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa733('0xd')](_0xa733('0xe'),auth[_0xa733('0xa')](),controller[_0xa733('0xf')]);router[_0xa733('0x10')]('/:id',auth[_0xa733('0xa')](),controller[_0xa733('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 655542f..cdbd252 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 _0x199d=['toString','utf8','long','production','DATE','sequelize','exports','STRING','name','BLOB','getDataValue','preproduction'];(function(_0x47c5f8,_0x1d9959){var _0x3607bd=function(_0x5c789a){while(--_0x5c789a){_0x47c5f8['push'](_0x47c5f8['shift']());}};_0x3607bd(++_0x1d9959);}(_0x199d,0x13d));var _0xd199=function(_0x45ee03,_0x2f5319){_0x45ee03=_0x45ee03-0x0;var _0x13d535=_0x199d[_0x45ee03];return _0x13d535;};'use strict';var Sequelize=require(_0xd199('0x0'));module[_0xd199('0x1')]={'name':{'type':Sequelize[_0xd199('0x2')],'unique':_0xd199('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd199('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xd199('0x4')]('long'),'get':function(){if(this[_0xd199('0x5')](_0xd199('0x6'))){return this[_0xd199('0x5')]('preproduction')[_0xd199('0x7')](_0xd199('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0xd199('0x9')),'get':function(){if(this[_0xd199('0x5')](_0xd199('0xa'))){return this['getDataValue'](_0xd199('0xa'))[_0xd199('0x7')](_0xd199('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd199('0xb')]}}; \ No newline at end of file +var _0x3a1a=['production','utf8','DATE','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x272a42,_0x41ff3e){var _0x45c141=function(_0x585c8d){while(--_0x585c8d){_0x272a42['push'](_0x272a42['shift']());}};_0x45c141(++_0x41ff3e);}(_0x3a1a,0x15f));var _0xa3a1=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3a1a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0xa3a1('0x0')]={'name':{'type':Sequelize[_0xa3a1('0x1')],'unique':_0xa3a1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa3a1('0x1')]},'notes':{'type':Sequelize[_0xa3a1('0x3')]},'preproduction':{'type':Sequelize[_0xa3a1('0x4')](_0xa3a1('0x5')),'get':function(){if(this[_0xa3a1('0x6')]('preproduction')){return this[_0xa3a1('0x6')](_0xa3a1('0x7'))[_0xa3a1('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xa3a1('0x4')](_0xa3a1('0x5')),'get':function(){if(this['getDataValue'](_0xa3a1('0x9'))){return this['getDataValue'](_0xa3a1('0x9'))['toString'](_0xa3a1('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xa3a1('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0026c06..f62b684 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 _0xfeac=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','publish','agi','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','json','undefined','limit','offset','count','status','set','update','then','destroy','get','SquareProjects','UserProfileResource','stringify','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','params','length','create','body','user'];(function(_0x4beb08,_0x38a1e4){var _0x56a591=function(_0x26d077){while(--_0x26d077){_0x4beb08['push'](_0x4beb08['shift']());}};_0x56a591(++_0x38a1e4);}(_0xfeac,0x1cf));var _0xcfea=function(_0x544f46,_0x168b65){_0x544f46=_0x544f46-0x0;var _0x21e7f2=_0xfeac[_0x544f46];return _0x21e7f2;};'use strict';var _=require('lodash');var Redis=require(_0xcfea('0x0'));var qs=require(_0xcfea('0x1'));var logger=require(_0xcfea('0x2'))(_0xcfea('0x3'));var config=require(_0xcfea('0x4'));var db=require('../../mysqldb')['db'];config[_0xcfea('0x5')]=_[_0xcfea('0x6')](config[_0xcfea('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xcfea('0x7'))(new Redis(config[_0xcfea('0x5')]));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x513106,_0x4349b5){_0x4349b5=_0x4349b5||0xc8;return function(_0x547bcf){if(_0x547bcf){return _0x513106['status'](_0x4349b5)[_0xcfea('0x8')](_0x547bcf);}};}function respondWithFilteredResult(_0x27e75a,_0x31ae80){return function(_0x467a47){if(_0x467a47){var _0x199ab9=typeof _0x31ae80['offset']===_0xcfea('0x9')&&typeof _0x31ae80[_0xcfea('0xa')]===_0xcfea('0x9');var _0xabbdbb=_0x467a47['count'];var _0x5b5431=_0x199ab9?0x0:_0x31ae80[_0xcfea('0xb')];var _0x218b40=_0x199ab9?_0x467a47[_0xcfea('0xc')]:_0x31ae80[_0xcfea('0xb')]+_0x31ae80[_0xcfea('0xa')];var _0x457029;if(_0x218b40>=_0xabbdbb){_0x218b40=_0xabbdbb;_0x457029=0xc8;}else{_0x457029=0xce;}_0x27e75a[_0xcfea('0xd')](_0x457029);return _0x27e75a[_0xcfea('0xe')]('Content-Range',_0x5b5431+'-'+_0x218b40+'/'+_0xabbdbb)[_0xcfea('0x8')](_0x467a47);}return null;};}function saveUpdates(_0x44d23c){return function(_0xd871f1){if(_0xd871f1){return _0xd871f1[_0xcfea('0xf')](_0x44d23c)[_0xcfea('0x10')](function(_0x209047){return _0x209047;});}return null;};}function removeEntity(_0x4d1174){return function(_0x12ab4d){if(_0x12ab4d){return _0x12ab4d[_0xcfea('0x11')]()['then'](function(){var _0x509e81=_0x12ab4d[_0xcfea('0x12')]({'plain':!![]});var _0x26ef6e=_0xcfea('0x13');return db[_0xcfea('0x14')][_0xcfea('0x11')]({'where':{'type':_0x26ef6e,'resourceId':_0x509e81['id']}})[_0xcfea('0x10')](function(){return _0x12ab4d;});})['then'](function(){var _0x57f638=new Redis(config['redis']);_0x57f638['publish']('agi',JSON[_0xcfea('0x15')]({'id':_0x12ab4d['id'],'deleted':!![]}));})[_0xcfea('0x10')](function(){_0x4d1174[_0xcfea('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x497de3){return function(_0x67c05f){if(!_0x67c05f){_0x497de3[_0xcfea('0x16')](0x194);}return _0x67c05f;};}function handleError(_0x1ea77a,_0x4aed8d){_0x4aed8d=_0x4aed8d||0x1f4;return function(_0x243ef7){logger[_0xcfea('0x17')](_0x243ef7['stack']);if(_0x243ef7[_0xcfea('0x18')]){delete _0x243ef7[_0xcfea('0x18')];}_0x1ea77a[_0xcfea('0xd')](_0x4aed8d)[_0xcfea('0x19')](_0x243ef7);};}exports[_0xcfea('0x1a')]=function(_0x47f93c,_0x4c4e40){var _0x56db83={},_0x18dbb6={},_0x5562be={'count':0x0,'rows':[]};var _0x116025=_[_0xcfea('0x1b')](db['SquareProject'][_0xcfea('0x1c')],function(_0x24161f){return{'name':_0x24161f[_0xcfea('0x1d')],'type':_0x24161f[_0xcfea('0x1e')]['key']};});_0x18dbb6[_0xcfea('0x1f')]=_['map'](_0x116025,_0xcfea('0x18'));_0x18dbb6[_0xcfea('0x20')]=_[_0xcfea('0x21')](_0x47f93c[_0xcfea('0x20')]);_0x18dbb6[_0xcfea('0x22')]=_['intersection'](_0x18dbb6[_0xcfea('0x1f')],_0x18dbb6[_0xcfea('0x20')]);_0x56db83['attributes']=_[_0xcfea('0x23')](_0x18dbb6[_0xcfea('0x1f')],qs[_0xcfea('0x24')](_0x47f93c['query']['fields']));_0x56db83[_0xcfea('0x25')]=_0x56db83['attributes']['length']?_0x56db83['attributes']:_0x18dbb6[_0xcfea('0x1f')];if(!_0x47f93c['query'][_0xcfea('0x26')](_0xcfea('0x27'))){_0x56db83[_0xcfea('0xa')]=qs[_0xcfea('0xa')](_0x47f93c[_0xcfea('0x20')][_0xcfea('0xa')]);_0x56db83[_0xcfea('0xb')]=qs[_0xcfea('0xb')](_0x47f93c[_0xcfea('0x20')][_0xcfea('0xb')]);}_0x56db83[_0xcfea('0x28')]=qs[_0xcfea('0x29')](_0x47f93c['query'][_0xcfea('0x29')]);_0x56db83[_0xcfea('0x2a')]=qs[_0xcfea('0x22')](_['pick'](_0x47f93c['query'],_0x18dbb6[_0xcfea('0x22')]),_0x116025);if(_0x47f93c[_0xcfea('0x20')][_0xcfea('0x2b')]){_0x56db83[_0xcfea('0x2a')]=_[_0xcfea('0x2c')](_0x56db83[_0xcfea('0x2a')],{'$or':_[_0xcfea('0x1b')](_0x116025,function(_0x29cf87){if(_0x29cf87[_0xcfea('0x1e')]!==_0xcfea('0x2d')){var _0x3a897d={};_0x3a897d[_0x29cf87[_0xcfea('0x18')]]={'$like':'%'+_0x47f93c['query'][_0xcfea('0x2b')]+'%'};return _0x3a897d;}})});}_0x56db83=_[_0xcfea('0x2c')]({},_0x56db83,_0x47f93c[_0xcfea('0x2e')]);var _0x3c624f={'where':_0x56db83[_0xcfea('0x2a')]};return db[_0xcfea('0x2f')][_0xcfea('0xc')](_0x3c624f)[_0xcfea('0x10')](function(_0x9b1def){_0x5562be[_0xcfea('0xc')]=_0x9b1def;if(_0x47f93c[_0xcfea('0x20')][_0xcfea('0x30')]){_0x56db83[_0xcfea('0x31')]=[{'all':!![]}];}return db[_0xcfea('0x2f')][_0xcfea('0x32')](_0x56db83);})['then'](function(_0x3a1456){_0x5562be[_0xcfea('0x33')]=_0x3a1456;return _0x5562be;})['then'](respondWithFilteredResult(_0x4c4e40,_0x56db83))['catch'](handleError(_0x4c4e40,null));};exports['show']=function(_0xb4f948,_0x1ad50f){var _0x195926={'raw':![],'where':{'id':_0xb4f948[_0xcfea('0x34')]['id']}},_0x13c32a={};_0x13c32a['model']=_['keys'](db['SquareProject'][_0xcfea('0x1c')]);_0x13c32a[_0xcfea('0x20')]=_[_0xcfea('0x21')](_0xb4f948[_0xcfea('0x20')]);_0x13c32a['filters']=_[_0xcfea('0x23')](_0x13c32a['model'],_0x13c32a[_0xcfea('0x20')]);_0x195926[_0xcfea('0x25')]=_[_0xcfea('0x23')](_0x13c32a[_0xcfea('0x1f')],qs[_0xcfea('0x24')](_0xb4f948[_0xcfea('0x20')][_0xcfea('0x24')]));_0x195926['attributes']=_0x195926['attributes'][_0xcfea('0x35')]?_0x195926[_0xcfea('0x25')]:_0x13c32a['model'];if(_0xb4f948[_0xcfea('0x20')]['includeAll']){_0x195926[_0xcfea('0x31')]=[{'all':!![]}];}_0x195926=_[_0xcfea('0x2c')]({},_0x195926,_0xb4f948[_0xcfea('0x2e')]);return db[_0xcfea('0x2f')]['find'](_0x195926)[_0xcfea('0x10')](handleEntityNotFound(_0x1ad50f,null))[_0xcfea('0x10')](respondWithResult(_0x1ad50f,null))['catch'](handleError(_0x1ad50f,null));};exports[_0xcfea('0x36')]=function(_0x27b02a,_0x286cb2){return db[_0xcfea('0x2f')][_0xcfea('0x36')](_0x27b02a[_0xcfea('0x37')],{})[_0xcfea('0x10')](function(_0x5676ea){var _0x43cbc6=_0x27b02a[_0xcfea('0x38')][_0xcfea('0x12')]({'plain':!![]});if(!_0x43cbc6)throw new Error(_0xcfea('0x39'));if(_0x43cbc6[_0xcfea('0x3a')]===_0xcfea('0x38')){var _0x356fb9=_0x5676ea[_0xcfea('0x12')]({'plain':!![]});var _0x5cf254='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x5cf254,'userProfileId':_0x43cbc6['userProfileId']},'raw':!![]})[_0xcfea('0x10')](function(_0x15d559){if(_0x15d559&&_0x15d559[_0xcfea('0x3b')]===0x0){return db['UserProfileResource'][_0xcfea('0x36')]({'name':_0x356fb9['name'],'resourceId':_0x356fb9['id'],'type':_0x15d559['name'],'sectionId':_0x15d559['id']},{})[_0xcfea('0x10')](function(){return _0x5676ea;});}else{return _0x5676ea;}})[_0xcfea('0x3c')](function(_0x577f74){logger[_0xcfea('0x17')](_0xcfea('0x3d'),_0x577f74);throw _0x577f74;});}return _0x5676ea;})[_0xcfea('0x10')](respondWithResult(_0x286cb2,0xc9))[_0xcfea('0x3c')](handleError(_0x286cb2,null));};exports[_0xcfea('0xf')]=function(_0x5de710,_0x322b77){if(_0x5de710[_0xcfea('0x37')]['id']){delete _0x5de710[_0xcfea('0x37')]['id'];}return db[_0xcfea('0x2f')][_0xcfea('0x3e')]({'where':{'id':_0x5de710[_0xcfea('0x34')]['id']}})['then'](handleEntityNotFound(_0x322b77,null))[_0xcfea('0x10')](saveUpdates(_0x5de710[_0xcfea('0x37')],null))[_0xcfea('0x10')](function(_0x483658){if(!_0x483658)return;var _0x2375bf=_0x483658[_0xcfea('0x12')]({'plain':!![]});return _0x2375bf;})[_0xcfea('0x10')](function(_0x2e411a){var _0x310be0=new Redis(config[_0xcfea('0x5')]);_0x310be0[_0xcfea('0x3f')](_0xcfea('0x40'),JSON[_0xcfea('0x15')](_['pick'](_0x2e411a,['id','name','production'])));return _0x2e411a;})[_0xcfea('0x10')](respondWithResult(_0x322b77,null))[_0xcfea('0x3c')](handleError(_0x322b77,null));};exports[_0xcfea('0x11')]=function(_0x5c6f1f,_0x21557c){return db['SquareProject'][_0xcfea('0x3e')]({'where':{'id':_0x5c6f1f[_0xcfea('0x34')]['id']}})['then'](handleEntityNotFound(_0x21557c,null))['then'](removeEntity(_0x21557c,null))[_0xcfea('0x3c')](handleError(_0x21557c,null));}; \ No newline at end of file +var _0xca8e=['rows','catch','show','params','rawAttributes','fields','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','agi','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','socket.io-emitter','status','json','offset','count','limit','set','update','then','SquareProjects','UserProfileResource','destroy','publish','stringify','end','sendStatus','error','name','send','index','map','SquareProject','type','key','keys','query','model','attributes','intersection','length','order','sort','where','filters','merge','filter','options','includeAll','include','findAll'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0xca8e,0x91));var _0xeca8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca8e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeca8('0x0'));var Redis=require(_0xeca8('0x1'));var qs=require(_0xeca8('0x2'));var logger=require(_0xeca8('0x3'))(_0xeca8('0x4'));var config=require(_0xeca8('0x5'));var db=require('../../mysqldb')['db'];config[_0xeca8('0x6')]=_['defaults'](config[_0xeca8('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xeca8('0x7'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithResult(_0xf9291e,_0x27f500){_0x27f500=_0x27f500||0xc8;return function(_0x5f406a){if(_0x5f406a){return _0xf9291e[_0xeca8('0x8')](_0x27f500)[_0xeca8('0x9')](_0x5f406a);}};}function respondWithFilteredResult(_0x1d8b92,_0x52df1b){return function(_0x2ae93a){if(_0x2ae93a){var _0x26cfca=typeof _0x52df1b[_0xeca8('0xa')]==='undefined'&&typeof _0x52df1b['limit']==='undefined';var _0x1bdd0a=_0x2ae93a[_0xeca8('0xb')];var _0x597fba=_0x26cfca?0x0:_0x52df1b[_0xeca8('0xa')];var _0x4fb2ab=_0x26cfca?_0x2ae93a[_0xeca8('0xb')]:_0x52df1b[_0xeca8('0xa')]+_0x52df1b[_0xeca8('0xc')];var _0x4aede9;if(_0x4fb2ab>=_0x1bdd0a){_0x4fb2ab=_0x1bdd0a;_0x4aede9=0xc8;}else{_0x4aede9=0xce;}_0x1d8b92[_0xeca8('0x8')](_0x4aede9);return _0x1d8b92[_0xeca8('0xd')]('Content-Range',_0x597fba+'-'+_0x4fb2ab+'/'+_0x1bdd0a)['json'](_0x2ae93a);}return null;};}function saveUpdates(_0x528147){return function(_0x198c38){if(_0x198c38){return _0x198c38[_0xeca8('0xe')](_0x528147)['then'](function(_0x419ea0){return _0x419ea0;});}return null;};}function removeEntity(_0x36a82c){return function(_0x36aee8){if(_0x36aee8){return _0x36aee8['destroy']()[_0xeca8('0xf')](function(){var _0x20842c=_0x36aee8['get']({'plain':!![]});var _0x41bbd2=_0xeca8('0x10');return db[_0xeca8('0x11')][_0xeca8('0x12')]({'where':{'type':_0x41bbd2,'resourceId':_0x20842c['id']}})['then'](function(){return _0x36aee8;});})[_0xeca8('0xf')](function(){var _0x527049=new Redis(config[_0xeca8('0x6')]);_0x527049[_0xeca8('0x13')]('agi',JSON[_0xeca8('0x14')]({'id':_0x36aee8['id'],'deleted':!![]}));})[_0xeca8('0xf')](function(){_0x36a82c[_0xeca8('0x8')](0xcc)[_0xeca8('0x15')]();});}};}function handleEntityNotFound(_0x3363e8){return function(_0x19ff2c){if(!_0x19ff2c){_0x3363e8[_0xeca8('0x16')](0x194);}return _0x19ff2c;};}function handleError(_0x520b80,_0x384470){_0x384470=_0x384470||0x1f4;return function(_0x46e6c9){logger[_0xeca8('0x17')](_0x46e6c9['stack']);if(_0x46e6c9[_0xeca8('0x18')]){delete _0x46e6c9[_0xeca8('0x18')];}_0x520b80[_0xeca8('0x8')](_0x384470)[_0xeca8('0x19')](_0x46e6c9);};}exports[_0xeca8('0x1a')]=function(_0x2c9ace,_0xad8e9a){var _0x44b938={},_0x5be309={},_0x3988c0={'count':0x0,'rows':[]};var _0x46d2b8=_[_0xeca8('0x1b')](db[_0xeca8('0x1c')]['rawAttributes'],function(_0x32c0ee){return{'name':_0x32c0ee['fieldName'],'type':_0x32c0ee[_0xeca8('0x1d')][_0xeca8('0x1e')]};});_0x5be309['model']=_[_0xeca8('0x1b')](_0x46d2b8,'name');_0x5be309['query']=_[_0xeca8('0x1f')](_0x2c9ace[_0xeca8('0x20')]);_0x5be309['filters']=_['intersection'](_0x5be309[_0xeca8('0x21')],_0x5be309[_0xeca8('0x20')]);_0x44b938[_0xeca8('0x22')]=_[_0xeca8('0x23')](_0x5be309[_0xeca8('0x21')],qs['fields'](_0x2c9ace[_0xeca8('0x20')]['fields']));_0x44b938[_0xeca8('0x22')]=_0x44b938[_0xeca8('0x22')][_0xeca8('0x24')]?_0x44b938[_0xeca8('0x22')]:_0x5be309['model'];if(!_0x2c9ace[_0xeca8('0x20')]['hasOwnProperty']('nolimit')){_0x44b938['limit']=qs[_0xeca8('0xc')](_0x2c9ace[_0xeca8('0x20')]['limit']);_0x44b938['offset']=qs[_0xeca8('0xa')](_0x2c9ace['query']['offset']);}_0x44b938[_0xeca8('0x25')]=qs[_0xeca8('0x26')](_0x2c9ace['query'][_0xeca8('0x26')]);_0x44b938[_0xeca8('0x27')]=qs['filters'](_['pick'](_0x2c9ace[_0xeca8('0x20')],_0x5be309[_0xeca8('0x28')]),_0x46d2b8);if(_0x2c9ace[_0xeca8('0x20')]['filter']){_0x44b938[_0xeca8('0x27')]=_[_0xeca8('0x29')](_0x44b938[_0xeca8('0x27')],{'$or':_['map'](_0x46d2b8,function(_0x142263){if(_0x142263[_0xeca8('0x1d')]!=='VIRTUAL'){var _0x5c31ca={};_0x5c31ca[_0x142263[_0xeca8('0x18')]]={'$like':'%'+_0x2c9ace[_0xeca8('0x20')][_0xeca8('0x2a')]+'%'};return _0x5c31ca;}})});}_0x44b938=_['merge']({},_0x44b938,_0x2c9ace[_0xeca8('0x2b')]);var _0x2014e2={'where':_0x44b938['where']};return db[_0xeca8('0x1c')][_0xeca8('0xb')](_0x2014e2)[_0xeca8('0xf')](function(_0x343df1){_0x3988c0[_0xeca8('0xb')]=_0x343df1;if(_0x2c9ace[_0xeca8('0x20')][_0xeca8('0x2c')]){_0x44b938[_0xeca8('0x2d')]=[{'all':!![]}];}return db[_0xeca8('0x1c')][_0xeca8('0x2e')](_0x44b938);})[_0xeca8('0xf')](function(_0x4c42e1){_0x3988c0[_0xeca8('0x2f')]=_0x4c42e1;return _0x3988c0;})[_0xeca8('0xf')](respondWithFilteredResult(_0xad8e9a,_0x44b938))[_0xeca8('0x30')](handleError(_0xad8e9a,null));};exports[_0xeca8('0x31')]=function(_0x13c5a7,_0x1efd13){var _0x27e8a4={'raw':![],'where':{'id':_0x13c5a7[_0xeca8('0x32')]['id']}},_0xcbd115={};_0xcbd115[_0xeca8('0x21')]=_[_0xeca8('0x1f')](db['SquareProject'][_0xeca8('0x33')]);_0xcbd115['query']=_['keys'](_0x13c5a7[_0xeca8('0x20')]);_0xcbd115[_0xeca8('0x28')]=_[_0xeca8('0x23')](_0xcbd115[_0xeca8('0x21')],_0xcbd115[_0xeca8('0x20')]);_0x27e8a4['attributes']=_[_0xeca8('0x23')](_0xcbd115[_0xeca8('0x21')],qs['fields'](_0x13c5a7['query'][_0xeca8('0x34')]));_0x27e8a4[_0xeca8('0x22')]=_0x27e8a4[_0xeca8('0x22')]['length']?_0x27e8a4['attributes']:_0xcbd115[_0xeca8('0x21')];if(_0x13c5a7[_0xeca8('0x20')][_0xeca8('0x2c')]){_0x27e8a4[_0xeca8('0x2d')]=[{'all':!![]}];}_0x27e8a4=_[_0xeca8('0x29')]({},_0x27e8a4,_0x13c5a7['options']);return db[_0xeca8('0x1c')][_0xeca8('0x35')](_0x27e8a4)[_0xeca8('0xf')](handleEntityNotFound(_0x1efd13,null))[_0xeca8('0xf')](respondWithResult(_0x1efd13,null))[_0xeca8('0x30')](handleError(_0x1efd13,null));};exports['create']=function(_0x5561c1,_0x12b777){return db['SquareProject'][_0xeca8('0x36')](_0x5561c1['body'],{})[_0xeca8('0xf')](function(_0x5b5f61){var _0xa7a078=_0x5561c1[_0xeca8('0x37')][_0xeca8('0x38')]({'plain':!![]});if(!_0xa7a078)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa7a078[_0xeca8('0x39')]===_0xeca8('0x37')){var _0xf41e85=_0x5b5f61[_0xeca8('0x38')]({'plain':!![]});var _0x3feba5=_0xeca8('0x10');return db[_0xeca8('0x3a')][_0xeca8('0x35')]({'where':{'name':_0x3feba5,'userProfileId':_0xa7a078[_0xeca8('0x3b')]},'raw':!![]})[_0xeca8('0xf')](function(_0x3c0b6e){if(_0x3c0b6e&&_0x3c0b6e[_0xeca8('0x3c')]===0x0){return db[_0xeca8('0x11')][_0xeca8('0x36')]({'name':_0xf41e85['name'],'resourceId':_0xf41e85['id'],'type':_0x3c0b6e['name'],'sectionId':_0x3c0b6e['id']},{})[_0xeca8('0xf')](function(){return _0x5b5f61;});}else{return _0x5b5f61;}})[_0xeca8('0x30')](function(_0x1338cc){logger[_0xeca8('0x17')](_0xeca8('0x3d'),_0x1338cc);throw _0x1338cc;});}return _0x5b5f61;})[_0xeca8('0xf')](respondWithResult(_0x12b777,0xc9))[_0xeca8('0x30')](handleError(_0x12b777,null));};exports[_0xeca8('0xe')]=function(_0x1c2d97,_0x38f9aa){if(_0x1c2d97['body']['id']){delete _0x1c2d97['body']['id'];}return db[_0xeca8('0x1c')]['find']({'where':{'id':_0x1c2d97[_0xeca8('0x32')]['id']}})[_0xeca8('0xf')](handleEntityNotFound(_0x38f9aa,null))[_0xeca8('0xf')](saveUpdates(_0x1c2d97[_0xeca8('0x3e')],null))['then'](function(_0x74b80c){if(!_0x74b80c)return;var _0x122e34=_0x74b80c[_0xeca8('0x38')]({'plain':!![]});return _0x122e34;})[_0xeca8('0xf')](function(_0xb6feba){var _0x2ab9c9=new Redis(config['redis']);_0x2ab9c9['publish'](_0xeca8('0x3f'),JSON[_0xeca8('0x14')](_['pick'](_0xb6feba,['id',_0xeca8('0x18'),'production'])));return _0xb6feba;})[_0xeca8('0xf')](respondWithResult(_0x38f9aa,null))[_0xeca8('0x30')](handleError(_0x38f9aa,null));};exports[_0xeca8('0x12')]=function(_0x301a5b,_0x41afeb){return db[_0xeca8('0x1c')][_0xeca8('0x35')]({'where':{'id':_0x301a5b[_0xeca8('0x32')]['id']}})[_0xeca8('0xf')](handleEntityNotFound(_0x41afeb,null))[_0xeca8('0xf')](removeEntity(_0x41afeb,null))[_0xeca8('0x30')](handleError(_0x41afeb,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d981810..6b2cb27 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 _0x60ee=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x454022,_0x3f6ab9){var _0xf0ad1b=function(_0x1116af){while(--_0x1116af){_0x454022['push'](_0x454022['shift']());}};_0xf0ad1b(++_0x3f6ab9);}(_0x60ee,0xd0));var _0xe60e=function(_0x1e172a,_0x52102b){_0x1e172a=_0x1e172a-0x0;var _0x96338b=_0x60ee[_0x1e172a];return _0x96338b;};'use strict';var EventEmitter=require(_0xe60e('0x0'));var SquareProject=require(_0xe60e('0x1'))['db'][_0xe60e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe60e('0x3')](0x0);var events={'afterCreate':_0xe60e('0x4'),'afterUpdate':_0xe60e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3bd2e9){return function(_0x53dd77,_0x278004,_0x497821){SquareProjectEvents[_0xe60e('0x6')](_0x3bd2e9+':'+_0x53dd77['id'],_0x53dd77);SquareProjectEvents[_0xe60e('0x6')](_0x3bd2e9,_0x53dd77);_0x497821(null);};}for(var e in events){if(events[_0xe60e('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xe60e('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xfc53=['emit','hook','exports','events','../../mysqldb','SquareProject','save','update'];(function(_0x3fffeb,_0x13b026){var _0x3a6321=function(_0x3f318d){while(--_0x3f318d){_0x3fffeb['push'](_0x3fffeb['shift']());}};_0x3a6321(++_0x13b026);}(_0xfc53,0x15b));var _0x3fc5=function(_0x3fc218,_0x503866){_0x3fc218=_0x3fc218-0x0;var _0x1e7532=_0xfc53[_0x3fc218];return _0x1e7532;};'use strict';var EventEmitter=require(_0x3fc5('0x0'));var SquareProject=require(_0x3fc5('0x1'))['db'][_0x3fc5('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3fc5('0x3'),'afterUpdate':_0x3fc5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x36faae){return function(_0x43bc8c,_0x2c5628,_0x2b0cf9){SquareProjectEvents[_0x3fc5('0x5')](_0x36faae+':'+_0x43bc8c['id'],_0x43bc8c);SquareProjectEvents[_0x3fc5('0x5')](_0x36faae,_0x43bc8c);_0x2b0cf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x3fc5('0x6')](e,emitEvent(event));}}module[_0x3fc5('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a86b9e0..c236a86 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 _0x671a=['format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x671a,0x15d));var _0xa671=function(_0x32146e,_0x2be230){_0x32146e=_0x32146e-0x0;var _0x375cc7=_0x671a[_0x32146e];return _0x375cc7;};'use strict';var _=require('lodash');var util=require(_0xa671('0x0'));var logger=require(_0xa671('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa671('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa671('0x3'));var config=require('../../config/environment');var attributes=require(_0xa671('0x4'));module[_0xa671('0x5')]=function(_0x508516,_0x5e1efd){return _0x508516[_0xa671('0x6')](_0xa671('0x7'),attributes,{'tableName':_0xa671('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc7ccb5,_0x2d19d2,_0x57790c){if(_0xc7ccb5[_0xa671('0x9')]('preproduction')){_0xc7ccb5[_0xa671('0xa')]=moment()[_0xa671('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xc7ccb5[_0xa671('0x9')](_0xa671('0xc'))){_0xc7ccb5[_0xa671('0xd')]=moment()[_0xa671('0xb')](_0xa671('0xe'));}_0x57790c(null,_0xc7ccb5);}}});}; \ No newline at end of file +var _0x7c9b=['production','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format'];(function(_0x32a032,_0x1b373b){var _0x24a388=function(_0x51daca){while(--_0x51daca){_0x32a032['push'](_0x32a032['shift']());}};_0x24a388(++_0x1b373b);}(_0x7c9b,0xbc));var _0xb7c9=function(_0x395a70,_0x59aacc){_0x395a70=_0x395a70-0x0;var _0x2c294f=_0x7c9b[_0x395a70];return _0x2c294f;};'use strict';var _=require(_0xb7c9('0x0'));var util=require('util');var logger=require(_0xb7c9('0x1'))(_0xb7c9('0x2'));var moment=require(_0xb7c9('0x3'));var BPromise=require(_0xb7c9('0x4'));var rp=require(_0xb7c9('0x5'));var fs=require('fs');var path=require(_0xb7c9('0x6'));var rimraf=require('rimraf');var config=require(_0xb7c9('0x7'));var attributes=require('./squareProject.attributes');module[_0xb7c9('0x8')]=function(_0x2e977d,_0x2c3afb){return _0x2e977d[_0xb7c9('0x9')](_0xb7c9('0xa'),attributes,{'tableName':_0xb7c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a1124,_0x3f46ef,_0x20856d){if(_0x3a1124[_0xb7c9('0xc')](_0xb7c9('0xd'))){_0x3a1124[_0xb7c9('0xe')]=moment()[_0xb7c9('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3a1124[_0xb7c9('0xc')](_0xb7c9('0x10'))){_0x3a1124['publishedAt']=moment()[_0xb7c9('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x20856d(null,_0x3a1124);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5928ab2..372b7fc 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 _0xdb4d=['limit','include','map','model','then','GetSquareProjects','catch','message','error','find','info','ShowSquareProject','debug','lodash','ioredis','../../mysqldb','rpc','redis','defaults','socket.io-emitter','register','SquareProject','findAll','options','raw','attributes'];(function(_0x12f451,_0x3b618f){var _0x5e9589=function(_0x3153d2){while(--_0x3153d2){_0x12f451['push'](_0x12f451['shift']());}};_0x5e9589(++_0x3b618f);}(_0xdb4d,0x1e1));var _0xddb4=function(_0x34f245,_0x25e9af){_0x34f245=_0x34f245-0x0;var _0x31ba8a=_0xdb4d[_0x34f245];return _0x31ba8a;};'use strict';var _=require(_0xddb4('0x0'));var Redis=require(_0xddb4('0x1'));var db=require(_0xddb4('0x2'))['db'];var logger=require('../../config/logger')(_0xddb4('0x3'));var config=require('../../config/environment');config[_0xddb4('0x4')]=_[_0xddb4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xddb4('0x6'))(new Redis(config[_0xddb4('0x4')]));require('./squareProject.socket')[_0xddb4('0x7')](socket);exports['GetSquareProjects']=function(_0x2b8d26){var _0x47d55e=this;return new Promise(function(_0x52b21b,_0x417db1){return db[_0xddb4('0x8')][_0xddb4('0x9')]({'raw':_0x2b8d26[_0xddb4('0xa')]?_0x2b8d26[_0xddb4('0xa')][_0xddb4('0xb')]===undefined?!![]:![]:!![],'where':_0x2b8d26[_0xddb4('0xa')]?_0x2b8d26[_0xddb4('0xa')]['where']||null:null,'attributes':_0x2b8d26[_0xddb4('0xa')]?_0x2b8d26['options'][_0xddb4('0xc')]||null:null,'limit':_0x2b8d26[_0xddb4('0xa')]?_0x2b8d26[_0xddb4('0xa')][_0xddb4('0xd')]||null:null,'include':_0x2b8d26[_0xddb4('0xa')]?_0x2b8d26[_0xddb4('0xa')][_0xddb4('0xe')]?_[_0xddb4('0xf')](_0x2b8d26[_0xddb4('0xa')]['include'],function(_0x3e6891){return{'model':db[_0x3e6891['model']],'as':_0x3e6891['as'],'attributes':_0x3e6891['attributes'],'include':_0x3e6891[_0xddb4('0xe')]?_[_0xddb4('0xf')](_0x3e6891['include'],function(_0x33d882){return{'model':db[_0x33d882[_0xddb4('0x10')]],'as':_0x33d882['as'],'attributes':_0x33d882['attributes'],'include':_0x33d882[_0xddb4('0xe')]?_['map'](_0x33d882['include'],function(_0x45f341){return{'model':db[_0x45f341[_0xddb4('0x10')]],'as':_0x45f341['as'],'attributes':_0x45f341[_0xddb4('0xc')]};}):[]};}):[]};}):[]:[]})[_0xddb4('0x11')](function(_0x2649a8){logger['info'](_0xddb4('0x12'),_0x2b8d26);logger['debug'](_0xddb4('0x12'),_0x2b8d26,JSON['stringify'](_0x2649a8));_0x52b21b(_0x2649a8);})[_0xddb4('0x13')](function(_0x5e7eb7){logger['error']('GetSquareProjects',_0x5e7eb7[_0xddb4('0x14')],_0x2b8d26);_0x417db1(_0x47d55e[_0xddb4('0x15')](0x1f4,_0x5e7eb7[_0xddb4('0x14')]));});});};exports['ShowSquareProject']=function(_0x5ef971){var _0x15d9cd=this;return new Promise(function(_0x3f2006,_0x44ea47){return db[_0xddb4('0x8')][_0xddb4('0x16')]({'raw':_0x5ef971[_0xddb4('0xa')]?_0x5ef971[_0xddb4('0xa')][_0xddb4('0xb')]===undefined?!![]:![]:!![],'where':_0x5ef971['options']?_0x5ef971['options']['where']||null:null,'attributes':_0x5ef971['options']?_0x5ef971['options'][_0xddb4('0xc')]||null:null,'include':_0x5ef971[_0xddb4('0xa')]?_0x5ef971[_0xddb4('0xa')][_0xddb4('0xe')]?_[_0xddb4('0xf')](_0x5ef971[_0xddb4('0xa')][_0xddb4('0xe')],function(_0x4ef15d){return{'model':db[_0x4ef15d[_0xddb4('0x10')]],'as':_0x4ef15d['as'],'attributes':_0x4ef15d[_0xddb4('0xc')],'include':_0x4ef15d[_0xddb4('0xe')]?_[_0xddb4('0xf')](_0x4ef15d[_0xddb4('0xe')],function(_0x48346c){return{'model':db[_0x48346c['model']],'as':_0x48346c['as'],'attributes':_0x48346c[_0xddb4('0xc')],'include':_0x48346c['include']?_[_0xddb4('0xf')](_0x48346c[_0xddb4('0xe')],function(_0x358f36){return{'model':db[_0x358f36[_0xddb4('0x10')]],'as':_0x358f36['as'],'attributes':_0x358f36[_0xddb4('0xc')]};}):[]};}):[]};}):[]:[]})[_0xddb4('0x11')](function(_0x29e271){logger[_0xddb4('0x17')](_0xddb4('0x18'),_0x5ef971);logger[_0xddb4('0x19')]('ShowSquareProject',_0x5ef971,JSON['stringify'](_0x29e271));_0x3f2006(_0x29e271);})['catch'](function(_0x5e287a){logger[_0xddb4('0x15')](_0xddb4('0x18'),_0x5e287a[_0xddb4('0x14')],_0x5ef971);_0x44ea47(_0x15d9cd['error'](0x1f4,_0x5e287a[_0xddb4('0x14')]));});});}; \ No newline at end of file +var _0x5fce=['limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowSquareProject','lodash','ioredis','../../mysqldb','rpc','redis','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes'];(function(_0x4a50bf,_0x424e7b){var _0x405516=function(_0x3c9f3d){while(--_0x3c9f3d){_0x4a50bf['push'](_0x4a50bf['shift']());}};_0x405516(++_0x424e7b);}(_0x5fce,0xed));var _0xe5fc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5fce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe5fc('0x0'));var Redis=require(_0xe5fc('0x1'));var db=require(_0xe5fc('0x2'))['db'];var logger=require('../../config/logger')(_0xe5fc('0x3'));var config=require('../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5fc('0x4')]));require(_0xe5fc('0x5'))['register'](socket);exports[_0xe5fc('0x6')]=function(_0x252836){var _0xfa54e9=this;return new Promise(function(_0x191553,_0x4c0c3a){return db[_0xe5fc('0x7')][_0xe5fc('0x8')]({'raw':_0x252836[_0xe5fc('0x9')]?_0x252836[_0xe5fc('0x9')][_0xe5fc('0xa')]===undefined?!![]:![]:!![],'where':_0x252836[_0xe5fc('0x9')]?_0x252836[_0xe5fc('0x9')][_0xe5fc('0xb')]||null:null,'attributes':_0x252836['options']?_0x252836[_0xe5fc('0x9')][_0xe5fc('0xc')]||null:null,'limit':_0x252836[_0xe5fc('0x9')]?_0x252836[_0xe5fc('0x9')][_0xe5fc('0xd')]||null:null,'include':_0x252836[_0xe5fc('0x9')]?_0x252836[_0xe5fc('0x9')][_0xe5fc('0xe')]?_[_0xe5fc('0xf')](_0x252836[_0xe5fc('0x9')][_0xe5fc('0xe')],function(_0x10afc6){return{'model':db[_0x10afc6[_0xe5fc('0x10')]],'as':_0x10afc6['as'],'attributes':_0x10afc6['attributes'],'include':_0x10afc6[_0xe5fc('0xe')]?_[_0xe5fc('0xf')](_0x10afc6[_0xe5fc('0xe')],function(_0x38b285){return{'model':db[_0x38b285['model']],'as':_0x38b285['as'],'attributes':_0x38b285['attributes'],'include':_0x38b285['include']?_[_0xe5fc('0xf')](_0x38b285['include'],function(_0x5a88ed){return{'model':db[_0x5a88ed[_0xe5fc('0x10')]],'as':_0x5a88ed['as'],'attributes':_0x5a88ed['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5fc('0x11')](function(_0x3a67d8){logger[_0xe5fc('0x12')](_0xe5fc('0x6'),_0x252836);logger[_0xe5fc('0x13')](_0xe5fc('0x6'),_0x252836,JSON[_0xe5fc('0x14')](_0x3a67d8));_0x191553(_0x3a67d8);})[_0xe5fc('0x15')](function(_0x2e93ec){logger[_0xe5fc('0x16')](_0xe5fc('0x6'),_0x2e93ec[_0xe5fc('0x17')],_0x252836);_0x4c0c3a(_0xfa54e9[_0xe5fc('0x16')](0x1f4,_0x2e93ec[_0xe5fc('0x17')]));});});};exports[_0xe5fc('0x18')]=function(_0x2743f5){var _0x75ed9d=this;return new Promise(function(_0x51ada6,_0x4e996c){return db[_0xe5fc('0x7')]['find']({'raw':_0x2743f5[_0xe5fc('0x9')]?_0x2743f5['options'][_0xe5fc('0xa')]===undefined?!![]:![]:!![],'where':_0x2743f5['options']?_0x2743f5[_0xe5fc('0x9')]['where']||null:null,'attributes':_0x2743f5[_0xe5fc('0x9')]?_0x2743f5[_0xe5fc('0x9')]['attributes']||null:null,'include':_0x2743f5['options']?_0x2743f5[_0xe5fc('0x9')]['include']?_[_0xe5fc('0xf')](_0x2743f5[_0xe5fc('0x9')][_0xe5fc('0xe')],function(_0x1f4d31){return{'model':db[_0x1f4d31[_0xe5fc('0x10')]],'as':_0x1f4d31['as'],'attributes':_0x1f4d31[_0xe5fc('0xc')],'include':_0x1f4d31[_0xe5fc('0xe')]?_['map'](_0x1f4d31[_0xe5fc('0xe')],function(_0x110c36){return{'model':db[_0x110c36[_0xe5fc('0x10')]],'as':_0x110c36['as'],'attributes':_0x110c36[_0xe5fc('0xc')],'include':_0x110c36[_0xe5fc('0xe')]?_[_0xe5fc('0xf')](_0x110c36[_0xe5fc('0xe')],function(_0x4bc725){return{'model':db[_0x4bc725[_0xe5fc('0x10')]],'as':_0x4bc725['as'],'attributes':_0x4bc725['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5fc('0x11')](function(_0x1c99f2){logger[_0xe5fc('0x12')](_0xe5fc('0x18'),_0x2743f5);logger[_0xe5fc('0x13')](_0xe5fc('0x18'),_0x2743f5,JSON[_0xe5fc('0x14')](_0x1c99f2));_0x51ada6(_0x1c99f2);})[_0xe5fc('0x15')](function(_0x21d7e3){logger['error']('ShowSquareProject',_0x21d7e3[_0xe5fc('0x17')],_0x2743f5);_0x4e996c(_0x75ed9d[_0xe5fc('0x16')](0x1f4,_0x21d7e3[_0xe5fc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index b20b3e5..4fd8065 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 _0x3378=['length','squareProject:','./squareProject.events','save','remove','update','emit','register'];(function(_0x21b7f3,_0x16e277){var _0x24d773=function(_0x4849a2){while(--_0x4849a2){_0x21b7f3['push'](_0x21b7f3['shift']());}};_0x24d773(++_0x16e277);}(_0x3378,0x7a));var _0x8337=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x3378[_0x45ce08];return _0x23dff2;};'use strict';var SquareProjectEvents=require(_0x8337('0x0'));var events=[_0x8337('0x1'),_0x8337('0x2'),_0x8337('0x3')];function createListener(_0x5d6956,_0x570f43){return function(_0x21806f){_0x570f43[_0x8337('0x4')](_0x5d6956,_0x21806f);};}function removeListener(_0x3eb067,_0x3fd9ea){return function(){SquareProjectEvents['removeListener'](_0x3eb067,_0x3fd9ea);};}exports[_0x8337('0x5')]=function(_0xd7670a){for(var _0x3fb790=0x0,_0x54a0d4=events[_0x8337('0x6')];_0x3fb790<_0x54a0d4;_0x3fb790++){var _0x305048=events[_0x3fb790];var _0xdc935b=createListener(_0x8337('0x7')+_0x305048,_0xd7670a);SquareProjectEvents['on'](_0x305048,_0xdc935b);}}; \ No newline at end of file +var _0x77d9=['length','squareProject:','save','update'];(function(_0x3c9f41,_0x8e3665){var _0xbc4407=function(_0x1fbd58){while(--_0x1fbd58){_0x3c9f41['push'](_0x3c9f41['shift']());}};_0xbc4407(++_0x8e3665);}(_0x77d9,0x1b2));var _0x977d=function(_0x895ad0,_0xf67203){_0x895ad0=_0x895ad0-0x0;var _0x3d32f9=_0x77d9[_0x895ad0];return _0x3d32f9;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x977d('0x0'),'remove',_0x977d('0x1')];function createListener(_0x438d49,_0x3f715c){return function(_0xb9293){_0x3f715c['emit'](_0x438d49,_0xb9293);};}function removeListener(_0x47308d,_0x2c48b1){return function(){SquareProjectEvents['removeListener'](_0x47308d,_0x2c48b1);};}exports['register']=function(_0x285b0d){for(var _0x2eca21=0x0,_0x9e97cc=events[_0x977d('0x2')];_0x2eca21<_0x9e97cc;_0x2eca21++){var _0x2d41f9=events[_0x2eca21];var _0x1c40fc=createListener(_0x977d('0x3')+_0x2d41f9,_0x285b0d);SquareProjectEvents['on'](_0x2d41f9,_0x1c40fc);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 09aee4b..78a5f73 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x233f43,_0x600ccb){var _0x3059d4=function(_0x3673e3){while(--_0x3673e3){_0x233f43['push'](_0x233f43['shift']());}};_0x3059d4(++_0x600ccb);}(_0x326f,0xd1));var _0xf326=function(_0x28e7e1,_0x4a0560){_0x28e7e1=_0x28e7e1-0x0;var _0x4aca5e=_0x326f[_0x28e7e1];return _0x4aca5e;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4c3911,_0x51b94a){var _0x2fee87=function(_0x3ff647){while(--_0x3ff647){_0x4c3911['push'](_0x4c3911['shift']());}};_0x2fee87(++_0x51b94a);}(_0x4975,0x86));var _0x5497=function(_0x3a8b00,_0x3a239f){_0x3a8b00=_0x3a8b00-0x0;var _0x7b9f79=_0x4975[_0x3a8b00];return _0x7b9f79;};'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 7ebff6f..9323e40 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 _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x3f88fc,_0x4f5b60){var _0x6fb940=function(_0x3d0755){while(--_0x3d0755){_0x3f88fc['push'](_0x3f88fc['shift']());}};_0x6fb940(++_0x4f5b60);}(_0x814b,0x1a2));var _0xb814=function(_0xa63ea3,_0x4367ff){_0xa63ea3=_0xa63ea3-0x0;var _0x2aa5ff=_0x814b[_0xa63ea3];return _0x2aa5ff;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}}; \ No newline at end of file +var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x29f781,_0x4867ae){var _0xaa0331=function(_0x2f8a55){while(--_0x2f8a55){_0x29f781['push'](_0x29f781['shift']());}};_0xaa0331(++_0x4867ae);}(_0x425d,0x1e0));var _0xd425=function(_0x343e70,_0xe5f373){_0x343e70=_0x343e70-0x0;var _0x2742fd=_0x425d[_0x343e70];return _0x2742fd;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9629fa3..8799fa1 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 _0xacb0=['keys','include','find','create','body','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','send','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','limit','count','json','apply','reject','update','then','destroy','error','name','map','SquareRecording','rawAttributes','fieldName','type','model','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','params'];(function(_0x272402,_0x283488){var _0x4f8f2b=function(_0x55bc53){while(--_0x55bc53){_0x272402['push'](_0x272402['shift']());}};_0x4f8f2b(++_0x283488);}(_0xacb0,0x173));var _0x0acb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xacb0[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0acb('0x0'));var rimraf=require(_0x0acb('0x1'));var zipdir=require(_0x0acb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0acb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0acb('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0acb('0x5'));var csv=require(_0x0acb('0x6'));var ejs=require(_0x0acb('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0acb('0x8'));var squel=require(_0x0acb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0acb('0xa'));var toCsv=require(_0x0acb('0x6'));var querystring=require('querystring');var Papa=require(_0x0acb('0xb'));var Redis=require('ioredis');var authService=require(_0x0acb('0xc'));var qs=require(_0x0acb('0xd'));var as=require(_0x0acb('0xe'));var hardwareService=require(_0x0acb('0xf'));var logger=require(_0x0acb('0x10'))(_0x0acb('0x11'));var utils=require('../../config/utils');var config=require(_0x0acb('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16ec78,_0x2e4617){_0x2e4617=_0x2e4617||0xcc;return function(_0x16146f){if(_0x16146f){return _0x16ec78[_0x0acb('0x13')](_0x2e4617);}return _0x16ec78[_0x0acb('0x14')](_0x2e4617)[_0x0acb('0x15')]();};}function respondWithResult(_0x462c4a,_0x5cb532){_0x5cb532=_0x5cb532||0xc8;return function(_0xb66150){if(_0xb66150){return _0x462c4a[_0x0acb('0x14')](_0x5cb532)['json'](_0xb66150);}};}function respondWithFilteredResult(_0x453026,_0x162dc3){return function(_0x90cafb){if(_0x90cafb){var _0x6e47c1=typeof _0x162dc3[_0x0acb('0x16')]==='undefined'&&typeof _0x162dc3[_0x0acb('0x17')]==='undefined';var _0x17fc61=_0x90cafb[_0x0acb('0x18')];var _0x7c46a3=_0x6e47c1?0x0:_0x162dc3[_0x0acb('0x16')];var _0xcac76c=_0x6e47c1?_0x90cafb['count']:_0x162dc3[_0x0acb('0x16')]+_0x162dc3[_0x0acb('0x17')];var _0x36d5ff;if(_0xcac76c>=_0x17fc61){_0xcac76c=_0x17fc61;_0x36d5ff=0xc8;}else{_0x36d5ff=0xce;}_0x453026['status'](_0x36d5ff);return _0x453026['set']('Content-Range',_0x7c46a3+'-'+_0xcac76c+'/'+_0x17fc61)[_0x0acb('0x19')](_0x90cafb);}return null;};}function patchUpdates(_0x1c3a0f){return function(_0x413cdf){try{jsonpatch[_0x0acb('0x1a')](_0x413cdf,_0x1c3a0f,!![]);}catch(_0x534167){return BPromise[_0x0acb('0x1b')](_0x534167);}return _0x413cdf['save']();};}function saveUpdates(_0x2e2b8d,_0x5a17a1){return function(_0x582fcf){if(_0x582fcf){return _0x582fcf[_0x0acb('0x1c')](_0x2e2b8d)[_0x0acb('0x1d')](function(_0x532ced){return _0x532ced;});}return null;};}function removeEntity(_0xcb51d3,_0x3f9e39){return function(_0x5db30f){if(_0x5db30f){return _0x5db30f[_0x0acb('0x1e')]()['then'](function(){_0xcb51d3[_0x0acb('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20193b,_0x2db769){return function(_0x107071){if(!_0x107071){_0x20193b[_0x0acb('0x13')](0x194);}return _0x107071;};}function handleError(_0x352c95,_0x4fe213){_0x4fe213=_0x4fe213||0x1f4;return function(_0x13c2d7){logger[_0x0acb('0x1f')](_0x13c2d7['stack']);if(_0x13c2d7[_0x0acb('0x20')]){delete _0x13c2d7[_0x0acb('0x20')];}_0x352c95[_0x0acb('0x14')](_0x4fe213)['send'](_0x13c2d7);};}exports['index']=function(_0x20f862,_0x3a7f62){var _0x370fa9={},_0x868b8e={},_0x3c9daa={'count':0x0,'rows':[]};var _0x20a876=_[_0x0acb('0x21')](db[_0x0acb('0x22')][_0x0acb('0x23')],function(_0x4b68aa){return{'name':_0x4b68aa[_0x0acb('0x24')],'type':_0x4b68aa[_0x0acb('0x25')]['key']};});_0x868b8e[_0x0acb('0x26')]=_[_0x0acb('0x21')](_0x20a876,'name');_0x868b8e['query']=_['keys'](_0x20f862['query']);_0x868b8e[_0x0acb('0x27')]=_['intersection'](_0x868b8e['model'],_0x868b8e[_0x0acb('0x28')]);_0x370fa9['attributes']=_[_0x0acb('0x29')](_0x868b8e[_0x0acb('0x26')],qs[_0x0acb('0x2a')](_0x20f862[_0x0acb('0x28')][_0x0acb('0x2a')]));_0x370fa9[_0x0acb('0x2b')]=_0x370fa9[_0x0acb('0x2b')][_0x0acb('0x2c')]?_0x370fa9[_0x0acb('0x2b')]:_0x868b8e[_0x0acb('0x26')];if(!_0x20f862[_0x0acb('0x28')][_0x0acb('0x2d')](_0x0acb('0x2e'))){_0x370fa9['limit']=qs['limit'](_0x20f862[_0x0acb('0x28')][_0x0acb('0x17')]);_0x370fa9[_0x0acb('0x16')]=qs[_0x0acb('0x16')](_0x20f862[_0x0acb('0x28')][_0x0acb('0x16')]);}_0x370fa9[_0x0acb('0x2f')]=qs['sort'](_0x20f862[_0x0acb('0x28')][_0x0acb('0x30')]);_0x370fa9[_0x0acb('0x31')]=qs[_0x0acb('0x27')](_[_0x0acb('0x32')](_0x20f862['query'],_0x868b8e[_0x0acb('0x27')]),_0x20a876);if(_0x20f862['query']['filter']){_0x370fa9[_0x0acb('0x31')]=_[_0x0acb('0x33')](_0x370fa9[_0x0acb('0x31')],{'$or':_[_0x0acb('0x21')](_0x20a876,function(_0x5eb2a7){if(_0x5eb2a7[_0x0acb('0x25')]!=='VIRTUAL'){var _0x5277d7={};_0x5277d7[_0x5eb2a7[_0x0acb('0x20')]]={'$like':'%'+_0x20f862[_0x0acb('0x28')][_0x0acb('0x34')]+'%'};return _0x5277d7;}})});}_0x370fa9=_['merge']({},_0x370fa9,_0x20f862[_0x0acb('0x35')]);var _0x57b9e0={'where':_0x370fa9[_0x0acb('0x31')]};return db[_0x0acb('0x22')][_0x0acb('0x18')](_0x57b9e0)['then'](function(_0xad43c9){_0x3c9daa[_0x0acb('0x18')]=_0xad43c9;if(_0x20f862[_0x0acb('0x28')][_0x0acb('0x36')]){_0x370fa9['include']=[{'all':!![]}];}return db[_0x0acb('0x22')][_0x0acb('0x37')](_0x370fa9);})['then'](function(_0x7c5624){_0x3c9daa[_0x0acb('0x38')]=_0x7c5624;return _0x3c9daa;})[_0x0acb('0x1d')](respondWithFilteredResult(_0x3a7f62,_0x370fa9))[_0x0acb('0x39')](handleError(_0x3a7f62,null));};exports['show']=function(_0x234597,_0x348ec8){var _0x4a4d5a={'raw':!![],'where':{'id':_0x234597[_0x0acb('0x3a')]['id']}},_0x4603df={};_0x4603df['model']=_[_0x0acb('0x3b')](db[_0x0acb('0x22')]['rawAttributes']);_0x4603df[_0x0acb('0x28')]=_['keys'](_0x234597[_0x0acb('0x28')]);_0x4603df[_0x0acb('0x27')]=_['intersection'](_0x4603df[_0x0acb('0x26')],_0x4603df[_0x0acb('0x28')]);_0x4a4d5a[_0x0acb('0x2b')]=_[_0x0acb('0x29')](_0x4603df[_0x0acb('0x26')],qs[_0x0acb('0x2a')](_0x234597[_0x0acb('0x28')][_0x0acb('0x2a')]));_0x4a4d5a[_0x0acb('0x2b')]=_0x4a4d5a['attributes'][_0x0acb('0x2c')]?_0x4a4d5a[_0x0acb('0x2b')]:_0x4603df['model'];if(_0x234597[_0x0acb('0x28')][_0x0acb('0x36')]){_0x4a4d5a[_0x0acb('0x3c')]=[{'all':!![]}];}_0x4a4d5a=_[_0x0acb('0x33')]({},_0x4a4d5a,_0x234597[_0x0acb('0x35')]);return db[_0x0acb('0x22')][_0x0acb('0x3d')](_0x4a4d5a)['then'](handleEntityNotFound(_0x348ec8,null))[_0x0acb('0x1d')](respondWithResult(_0x348ec8,null))['catch'](handleError(_0x348ec8,null));};exports[_0x0acb('0x3e')]=function(_0x46b461,_0x26fdff){return db[_0x0acb('0x22')][_0x0acb('0x3e')](_0x46b461[_0x0acb('0x3f')],{})[_0x0acb('0x1d')](respondWithResult(_0x26fdff,0xc9))[_0x0acb('0x39')](handleError(_0x26fdff,null));};exports[_0x0acb('0x1c')]=function(_0x383eec,_0xae9c47){if(_0x383eec[_0x0acb('0x3f')]['id']){delete _0x383eec['body']['id'];}return db[_0x0acb('0x22')][_0x0acb('0x3d')]({'where':{'id':_0x383eec['params']['id']}})['then'](handleEntityNotFound(_0xae9c47,null))['then'](saveUpdates(_0x383eec['body'],null))['then'](respondWithResult(_0xae9c47,null))[_0x0acb('0x39')](handleError(_0xae9c47,null));};exports['download']=function(_0x45b540,_0x422979,_0x28e442){var _0x142648=require('../../components/encryptor');var _0x1cdcdf=![];var _0x1515aa={};if(_0x45b540[_0x0acb('0x28')][_0x0acb('0x25')]&&_0x45b540['query'][_0x0acb('0x25')]===_0x0acb('0x40')){_0x1515aa['uniqueid']=_0x45b540[_0x0acb('0x3a')]['id'];}else{_0x1515aa['id']=_0x45b540[_0x0acb('0x3a')]['id'];}return db[_0x0acb('0x22')][_0x0acb('0x3d')]({'where':_0x1515aa,'attributes':['id','savePath',_0x0acb('0x41')],'raw':!![]})[_0x0acb('0x1d')](handleEntityNotFound(_0x422979,null))[_0x0acb('0x1d')](function(_0x22755d){if(_0x22755d){var _0x236a1a=_0x22755d[_0x0acb('0x42')];var _0x350e81=util[_0x0acb('0x43')](_0x0acb('0x44'),_0x236a1a);if(fs[_0x0acb('0x45')](_0x350e81)){_0x1cdcdf=!![];return _0x142648[_0x0acb('0x46')](_0x350e81,_0x236a1a,config['secrets'][_0x0acb('0x47')])[_0x0acb('0x1d')](function(){return _0x22755d;});}return _0x22755d;}})[_0x0acb('0x1d')](function(_0x35bd91){if(_0x35bd91){var _0x91be8f=_0x35bd91[_0x0acb('0x42')];if(!fs[_0x0acb('0x45')](_0x91be8f)){throw new db[(_0x0acb('0x48'))][(_0x0acb('0x49'))](_0x0acb('0x4a'));}if(_0x35bd91[_0x0acb('0x41')]){return _0x422979[_0x0acb('0x4b')](_0x91be8f,_0x35bd91['filename']+path[_0x0acb('0x4c')](_0x91be8f),function(){if(_0x1cdcdf){fs[_0x0acb('0x4d')](_0x91be8f);}});}else{return _0x422979[_0x0acb('0x4b')](_0x91be8f,function(_0xcad0f7){if(_0x1cdcdf){fs[_0x0acb('0x4d')](_0x91be8f);}});}}})[_0x0acb('0x39')](function(_0x463df9){if(_0x463df9['message']===_0x0acb('0x4a')){_0x422979[_0x0acb('0x14')](0x194)[_0x0acb('0x4e')](_0x0acb('0x4f'));}else{return handleError(_0x422979,null);}});};exports[_0x0acb('0x1e')]=function(_0x3f52d5,_0x3ed409){return db['SquareRecording'][_0x0acb('0x3d')]({'where':{'id':_0x3f52d5[_0x0acb('0x3a')]['id']}})['then'](function(_0x266008){if(_['isNil'](_0x266008)){throw new ReferenceError(_0x0acb('0x50'));}return _0x266008;})[_0x0acb('0x1d')](function(_0x3cc92f){var _0x1a2d7e=_0x3cc92f[_0x0acb('0x42')];logger[_0x0acb('0x51')]('cancellazione\x20fisica\x20documento\x20%s',_0x1a2d7e);if(!_[_0x0acb('0x52')](_0x3cc92f[_0x0acb('0x42')])&&fs[_0x0acb('0x45')](_0x1a2d7e)){logger[_0x0acb('0x51')](_0x0acb('0x53')+_0x1a2d7e+_0x0acb('0x54'));fs[_0x0acb('0x55')](_0x1a2d7e);}_0x1a2d7e=_0x1a2d7e+'.cypher';if(!_[_0x0acb('0x52')](_0x3cc92f[_0x0acb('0x42')])&&fs[_0x0acb('0x45')](_0x1a2d7e)){logger[_0x0acb('0x51')](_0x0acb('0x53')+_0x1a2d7e+_0x0acb('0x54'));fs[_0x0acb('0x55')](_0x1a2d7e);}return _0x3cc92f;})[_0x0acb('0x1d')](function(_0x20e81a){if(!_0x20e81a)throw new InternalError();return _0x20e81a[_0x0acb('0x1e')]();})[_0x0acb('0x1d')](function(){_0x3ed409['status'](0xcc)[_0x0acb('0x15')]();})[_0x0acb('0x39')](handleError(_0x3ed409,null));}; \ No newline at end of file +var _0xdc5e=['params','keys','filters','includeAll','merge','find','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','unlink','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','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','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','findAll','rows','catch'];(function(_0x313b77,_0x579e14){var _0x2a35ab=function(_0x1fe8c7){while(--_0x1fe8c7){_0x313b77['push'](_0x313b77['shift']());}};_0x2a35ab(++_0x579e14);}(_0xdc5e,0x131));var _0xedc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedc5('0x0'));var zipdir=require(_0xedc5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xedc5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xedc5('0x3'));var util=require(_0xedc5('0x4'));var path=require(_0xedc5('0x5'));var sox=require(_0xedc5('0x6'));var csv=require(_0xedc5('0x7'));var ejs=require(_0xedc5('0x8'));var fs=require('fs');var fs_extra=require(_0xedc5('0x9'));var _=require('lodash');var squel=require(_0xedc5('0xa'));var crypto=require(_0xedc5('0xb'));var jsforce=require(_0xedc5('0xc'));var deskjs=require(_0xedc5('0xd'));var toCsv=require(_0xedc5('0x7'));var querystring=require(_0xedc5('0xe'));var Papa=require(_0xedc5('0xf'));var Redis=require(_0xedc5('0x10'));var authService=require(_0xedc5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xedc5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedc5('0x13'));var utils=require(_0xedc5('0x14'));var config=require(_0xedc5('0x15'));var licenseUtil=require(_0xedc5('0x16'));var db=require(_0xedc5('0x17'))['db'];function respondWithStatusCode(_0x1debe0,_0x40bc34){_0x40bc34=_0x40bc34||0xcc;return function(_0x5f3369){if(_0x5f3369){return _0x1debe0[_0xedc5('0x18')](_0x40bc34);}return _0x1debe0[_0xedc5('0x19')](_0x40bc34)[_0xedc5('0x1a')]();};}function respondWithResult(_0x439f2b,_0x1b00de){_0x1b00de=_0x1b00de||0xc8;return function(_0x583b4f){if(_0x583b4f){return _0x439f2b['status'](_0x1b00de)[_0xedc5('0x1b')](_0x583b4f);}};}function respondWithFilteredResult(_0x1fd4cf,_0x439b62){return function(_0x5edc3c){if(_0x5edc3c){var _0x3efaa3=typeof _0x439b62[_0xedc5('0x1c')]===_0xedc5('0x1d')&&typeof _0x439b62[_0xedc5('0x1e')]===_0xedc5('0x1d');var _0x1a8e4f=_0x5edc3c[_0xedc5('0x1f')];var _0x1cab67=_0x3efaa3?0x0:_0x439b62[_0xedc5('0x1c')];var _0x2711ef=_0x3efaa3?_0x5edc3c[_0xedc5('0x1f')]:_0x439b62[_0xedc5('0x1c')]+_0x439b62[_0xedc5('0x1e')];var _0x708e71;if(_0x2711ef>=_0x1a8e4f){_0x2711ef=_0x1a8e4f;_0x708e71=0xc8;}else{_0x708e71=0xce;}_0x1fd4cf[_0xedc5('0x19')](_0x708e71);return _0x1fd4cf[_0xedc5('0x20')](_0xedc5('0x21'),_0x1cab67+'-'+_0x2711ef+'/'+_0x1a8e4f)[_0xedc5('0x1b')](_0x5edc3c);}return null;};}function patchUpdates(_0x1165a4){return function(_0x33d21e){try{jsonpatch[_0xedc5('0x22')](_0x33d21e,_0x1165a4,!![]);}catch(_0xf24ecb){return BPromise[_0xedc5('0x23')](_0xf24ecb);}return _0x33d21e[_0xedc5('0x24')]();};}function saveUpdates(_0x1a559c,_0x1916a0){return function(_0x3db89d){if(_0x3db89d){return _0x3db89d[_0xedc5('0x25')](_0x1a559c)[_0xedc5('0x26')](function(_0x3a138e){return _0x3a138e;});}return null;};}function removeEntity(_0x150ba2,_0x578c49){return function(_0xa3d311){if(_0xa3d311){return _0xa3d311[_0xedc5('0x27')]()[_0xedc5('0x26')](function(){_0x150ba2[_0xedc5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ab6fb,_0x202954){return function(_0x1f8901){if(!_0x1f8901){_0x2ab6fb[_0xedc5('0x18')](0x194);}return _0x1f8901;};}function handleError(_0x2084c4,_0x29665a){_0x29665a=_0x29665a||0x1f4;return function(_0x14a5d6){logger[_0xedc5('0x28')](_0x14a5d6[_0xedc5('0x29')]);if(_0x14a5d6[_0xedc5('0x2a')]){delete _0x14a5d6['name'];}_0x2084c4[_0xedc5('0x19')](_0x29665a)[_0xedc5('0x2b')](_0x14a5d6);};}exports['index']=function(_0x2987d7,_0x206ec6){var _0x1370c9={},_0x563169={},_0x5300cb={'count':0x0,'rows':[]};var _0x53fc09=_[_0xedc5('0x2c')](db[_0xedc5('0x2d')][_0xedc5('0x2e')],function(_0x41d425){return{'name':_0x41d425[_0xedc5('0x2f')],'type':_0x41d425[_0xedc5('0x30')][_0xedc5('0x31')]};});_0x563169[_0xedc5('0x32')]=_[_0xedc5('0x2c')](_0x53fc09,_0xedc5('0x2a'));_0x563169[_0xedc5('0x33')]=_['keys'](_0x2987d7[_0xedc5('0x33')]);_0x563169['filters']=_[_0xedc5('0x34')](_0x563169['model'],_0x563169[_0xedc5('0x33')]);_0x1370c9[_0xedc5('0x35')]=_[_0xedc5('0x34')](_0x563169['model'],qs[_0xedc5('0x36')](_0x2987d7['query'][_0xedc5('0x36')]));_0x1370c9[_0xedc5('0x35')]=_0x1370c9[_0xedc5('0x35')][_0xedc5('0x37')]?_0x1370c9[_0xedc5('0x35')]:_0x563169[_0xedc5('0x32')];if(!_0x2987d7[_0xedc5('0x33')][_0xedc5('0x38')]('nolimit')){_0x1370c9[_0xedc5('0x1e')]=qs[_0xedc5('0x1e')](_0x2987d7[_0xedc5('0x33')]['limit']);_0x1370c9[_0xedc5('0x1c')]=qs[_0xedc5('0x1c')](_0x2987d7[_0xedc5('0x33')][_0xedc5('0x1c')]);}_0x1370c9[_0xedc5('0x39')]=qs[_0xedc5('0x3a')](_0x2987d7[_0xedc5('0x33')]['sort']);_0x1370c9['where']=qs['filters'](_[_0xedc5('0x3b')](_0x2987d7[_0xedc5('0x33')],_0x563169['filters']),_0x53fc09);if(_0x2987d7[_0xedc5('0x33')][_0xedc5('0x3c')]){_0x1370c9[_0xedc5('0x3d')]=_['merge'](_0x1370c9['where'],{'$or':_[_0xedc5('0x2c')](_0x53fc09,function(_0x4622a3){if(_0x4622a3['type']!==_0xedc5('0x3e')){var _0x1a802c={};_0x1a802c[_0x4622a3[_0xedc5('0x2a')]]={'$like':'%'+_0x2987d7['query'][_0xedc5('0x3c')]+'%'};return _0x1a802c;}})});}_0x1370c9=_['merge']({},_0x1370c9,_0x2987d7[_0xedc5('0x3f')]);var _0x240971={'where':_0x1370c9[_0xedc5('0x3d')]};return db[_0xedc5('0x2d')]['count'](_0x240971)[_0xedc5('0x26')](function(_0x241775){_0x5300cb[_0xedc5('0x1f')]=_0x241775;if(_0x2987d7[_0xedc5('0x33')]['includeAll']){_0x1370c9['include']=[{'all':!![]}];}return db[_0xedc5('0x2d')][_0xedc5('0x40')](_0x1370c9);})[_0xedc5('0x26')](function(_0x130413){_0x5300cb[_0xedc5('0x41')]=_0x130413;return _0x5300cb;})[_0xedc5('0x26')](respondWithFilteredResult(_0x206ec6,_0x1370c9))[_0xedc5('0x42')](handleError(_0x206ec6,null));};exports['show']=function(_0x182dad,_0x9bac63){var _0x3e309e={'raw':!![],'where':{'id':_0x182dad[_0xedc5('0x43')]['id']}},_0x2b75d2={};_0x2b75d2[_0xedc5('0x32')]=_['keys'](db[_0xedc5('0x2d')][_0xedc5('0x2e')]);_0x2b75d2[_0xedc5('0x33')]=_[_0xedc5('0x44')](_0x182dad['query']);_0x2b75d2[_0xedc5('0x45')]=_['intersection'](_0x2b75d2[_0xedc5('0x32')],_0x2b75d2['query']);_0x3e309e[_0xedc5('0x35')]=_[_0xedc5('0x34')](_0x2b75d2['model'],qs['fields'](_0x182dad[_0xedc5('0x33')][_0xedc5('0x36')]));_0x3e309e[_0xedc5('0x35')]=_0x3e309e[_0xedc5('0x35')][_0xedc5('0x37')]?_0x3e309e[_0xedc5('0x35')]:_0x2b75d2[_0xedc5('0x32')];if(_0x182dad[_0xedc5('0x33')][_0xedc5('0x46')]){_0x3e309e['include']=[{'all':!![]}];}_0x3e309e=_[_0xedc5('0x47')]({},_0x3e309e,_0x182dad[_0xedc5('0x3f')]);return db[_0xedc5('0x2d')][_0xedc5('0x48')](_0x3e309e)['then'](handleEntityNotFound(_0x9bac63,null))[_0xedc5('0x26')](respondWithResult(_0x9bac63,null))[_0xedc5('0x42')](handleError(_0x9bac63,null));};exports['create']=function(_0x53cbd1,_0x48632c){return db[_0xedc5('0x2d')]['create'](_0x53cbd1['body'],{})['then'](respondWithResult(_0x48632c,0xc9))['catch'](handleError(_0x48632c,null));};exports['update']=function(_0x69e431,_0x3c787a){if(_0x69e431[_0xedc5('0x49')]['id']){delete _0x69e431[_0xedc5('0x49')]['id'];}return db['SquareRecording'][_0xedc5('0x48')]({'where':{'id':_0x69e431[_0xedc5('0x43')]['id']}})[_0xedc5('0x26')](handleEntityNotFound(_0x3c787a,null))[_0xedc5('0x26')](saveUpdates(_0x69e431[_0xedc5('0x49')],null))[_0xedc5('0x26')](respondWithResult(_0x3c787a,null))['catch'](handleError(_0x3c787a,null));};exports[_0xedc5('0x4a')]=function(_0x2c5277,_0x350966,_0x484f66){var _0x3511b5=require(_0xedc5('0x4b'));var _0x4faa48=![];var _0x14001a={};if(_0x2c5277[_0xedc5('0x33')][_0xedc5('0x30')]&&_0x2c5277[_0xedc5('0x33')][_0xedc5('0x30')]===_0xedc5('0x4c')){_0x14001a[_0xedc5('0x4c')]=_0x2c5277['params']['id'];}else{_0x14001a['id']=_0x2c5277[_0xedc5('0x43')]['id'];}return db[_0xedc5('0x2d')][_0xedc5('0x48')]({'where':_0x14001a,'attributes':['id',_0xedc5('0x4d'),_0xedc5('0x4e')],'raw':!![]})[_0xedc5('0x26')](handleEntityNotFound(_0x350966,null))[_0xedc5('0x26')](function(_0x5e1115){if(_0x5e1115){var _0x22bcb9=_0x5e1115['savePath'];var _0x4fa295=util[_0xedc5('0x4f')](_0xedc5('0x50'),_0x22bcb9);if(fs[_0xedc5('0x51')](_0x4fa295)){_0x4faa48=!![];return _0x3511b5[_0xedc5('0x52')](_0x4fa295,_0x22bcb9,config[_0xedc5('0x53')][_0xedc5('0x54')])['then'](function(){return _0x5e1115;});}return _0x5e1115;}})[_0xedc5('0x26')](function(_0x46c9bd){if(_0x46c9bd){var _0x5e8704=_0x46c9bd['savePath'];if(!fs[_0xedc5('0x51')](_0x5e8704)){throw new db['Sequelize'][(_0xedc5('0x55'))](_0xedc5('0x56'));}if(_0x46c9bd[_0xedc5('0x4e')]){return _0x350966[_0xedc5('0x4a')](_0x5e8704,_0x46c9bd[_0xedc5('0x4e')]+path['extname'](_0x5e8704),function(){if(_0x4faa48){fs[_0xedc5('0x57')](_0x5e8704);}});}else{return _0x350966['download'](_0x5e8704,function(_0xbaf91e){if(_0x4faa48){fs[_0xedc5('0x57')](_0x5e8704);}});}}})[_0xedc5('0x42')](function(_0x3d66fe){if(_0x3d66fe['message']==='SquareRecording\x20not\x20found'){_0x350966[_0xedc5('0x19')](0x194)[_0xedc5('0x2b')]('Not\x20found');}else{return handleError(_0x350966,null);}});};exports[_0xedc5('0x27')]=function(_0x8b3afd,_0x17967f){return db[_0xedc5('0x2d')][_0xedc5('0x48')]({'where':{'id':_0x8b3afd[_0xedc5('0x43')]['id']}})[_0xedc5('0x26')](function(_0x2cd731){if(_[_0xedc5('0x58')](_0x2cd731)){throw new ReferenceError(_0xedc5('0x59'));}return _0x2cd731;})[_0xedc5('0x26')](function(_0x8870c0){var _0x54bd4c=_0x8870c0['savePath'];logger['info'](_0xedc5('0x5a'),_0x54bd4c);if(!_['isNil'](_0x8870c0[_0xedc5('0x4d')])&&fs[_0xedc5('0x51')](_0x54bd4c)){logger[_0xedc5('0x5b')]('File:\x20\x22'+_0x54bd4c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54bd4c);}_0x54bd4c=_0x54bd4c+_0xedc5('0x5c');if(!_[_0xedc5('0x58')](_0x8870c0['savePath'])&&fs[_0xedc5('0x51')](_0x54bd4c)){logger[_0xedc5('0x5b')]('File:\x20\x22'+_0x54bd4c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54bd4c);}return _0x8870c0;})[_0xedc5('0x26')](function(_0x25dd6){if(!_0x25dd6)throw new InternalError();return _0x25dd6[_0xedc5('0x27')]();})[_0xedc5('0x26')](function(){_0x17967f[_0xedc5('0x19')](0xcc)[_0xedc5('0x1a')]();})['catch'](handleError(_0x17967f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 9ea2151..8efd17f 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 _0x1c75=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','moment','bluebird'];(function(_0x50e944,_0x13a411){var _0x9eb69=function(_0x5aa90f){while(--_0x5aa90f){_0x50e944['push'](_0x50e944['shift']());}};_0x9eb69(++_0x13a411);}(_0x1c75,0xce));var _0x51c7=function(_0x1ce71c,_0x1f2369){_0x1ce71c=_0x1ce71c-0x0;var _0x38c215=_0x1c75[_0x1ce71c];return _0x38c215;};'use strict';var _=require(_0x51c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x51c7('0x1'));var BPromise=require(_0x51c7('0x2'));var rp=require(_0x51c7('0x3'));var fs=require('fs');var path=require(_0x51c7('0x4'));var rimraf=require(_0x51c7('0x5'));var config=require(_0x51c7('0x6'));var attributes=require(_0x51c7('0x7'));module[_0x51c7('0x8')]=function(_0x3209ef,_0x19f2d6){return _0x3209ef[_0x51c7('0x9')]('SquareRecording',attributes,{'tableName':_0x51c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb67=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x251a63,_0x26f4c2){var _0xb88007=function(_0x4ced7b){while(--_0x4ced7b){_0x251a63['push'](_0x251a63['shift']());}};_0xb88007(++_0x26f4c2);}(_0xfb67,0xdd));var _0x7fb6=function(_0x855236,_0x3f18b3){_0x855236=_0x855236-0x0;var _0x582ff7=_0xfb67[_0x855236];return _0x582ff7;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var logger=require(_0x7fb6('0x2'))(_0x7fb6('0x3'));var moment=require(_0x7fb6('0x4'));var BPromise=require(_0x7fb6('0x5'));var rp=require(_0x7fb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fb6('0x7'));var config=require(_0x7fb6('0x8'));var attributes=require(_0x7fb6('0x9'));module[_0x7fb6('0xa')]=function(_0x3e7393,_0x59b2e2){return _0x3e7393[_0x7fb6('0xb')](_0x7fb6('0xc'),attributes,{'tableName':_0x7fb6('0xd'),'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 3d3b511..4a2ee46 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 _0xdd86=['CreateSquareRecording','body','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4e0a01,_0x7d15ff){var _0x1aa533=function(_0x170e21){while(--_0x170e21){_0x4e0a01['push'](_0x4e0a01['shift']());}};_0x1aa533(++_0x7d15ff);}(_0xdd86,0x1a4));var _0x6dd8=function(_0x1641f0,_0x3122ed){_0x1641f0=_0x1641f0-0x0;var _0x9a9f08=_0xdd86[_0x1641f0];return _0x9a9f08;};'use strict';var _=require(_0x6dd8('0x0'));var util=require(_0x6dd8('0x1'));var moment=require(_0x6dd8('0x2'));var BPromise=require(_0x6dd8('0x3'));var rs=require(_0x6dd8('0x4'));var fs=require('fs');var Redis=require(_0x6dd8('0x5'));var db=require(_0x6dd8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dd8('0x7'))(_0x6dd8('0x8'));var config=require(_0x6dd8('0x9'));var jayson=require(_0x6dd8('0xa'));var client=jayson['client'][_0x6dd8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x322e13,_0x2678e1,_0x27508f){return new BPromise(function(_0x451d96,_0x131d66){return client[_0x6dd8('0xc')](_0x322e13,_0x27508f)['then'](function(_0x4dc99c){logger[_0x6dd8('0xd')](_0x6dd8('0xe'),_0x2678e1,_0x6dd8('0xf'));logger['debug'](_0x6dd8('0x10'),_0x2678e1,'request\x20sent',JSON['stringify'](_0x4dc99c));if(_0x4dc99c[_0x6dd8('0x11')]){if(_0x4dc99c[_0x6dd8('0x11')][_0x6dd8('0x12')]===0x1f4){logger[_0x6dd8('0x11')](_0x6dd8('0xe'),_0x2678e1,_0x4dc99c[_0x6dd8('0x11')][_0x6dd8('0x13')]);return _0x131d66(_0x4dc99c[_0x6dd8('0x11')][_0x6dd8('0x13')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x2678e1,_0x4dc99c['error']['message']);return _0x451d96(_0x4dc99c[_0x6dd8('0x11')][_0x6dd8('0x13')]);}else{logger[_0x6dd8('0xd')]('SquareRecording,\x20%s,\x20%s',_0x2678e1,_0x6dd8('0xf'));_0x451d96(_0x4dc99c[_0x6dd8('0x14')][_0x6dd8('0x13')]);}})[_0x6dd8('0x15')](function(_0xfabf08){logger[_0x6dd8('0x11')](_0x6dd8('0xe'),_0x2678e1,_0xfabf08);_0x131d66(_0xfabf08);});});}exports[_0x6dd8('0x16')]=function(_0x2c79cb){var _0x54b802=this;return new Promise(function(_0x2f4ea8,_0x94d022){return db['SquareRecording']['create'](_0x2c79cb[_0x6dd8('0x17')],{'raw':_0x2c79cb['options']?_0x2c79cb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x10be83){logger[_0x6dd8('0xd')](_0x6dd8('0x16'),_0x2c79cb);logger[_0x6dd8('0x18')]('CreateSquareRecording',_0x2c79cb,JSON[_0x6dd8('0x19')](_0x10be83));_0x2f4ea8(_0x10be83);})[_0x6dd8('0x15')](function(_0x22a389){logger[_0x6dd8('0x11')](_0x6dd8('0x16'),_0x22a389['message'],_0x2c79cb);_0x94d022(_0x54b802[_0x6dd8('0x11')](0x1f4,_0x22a389[_0x6dd8('0x13')]));});});}; \ No newline at end of file +var _0x7dd1=['message','info','SquareRecording,\x20%s,\x20%s','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','request\x20sent','debug','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7dd1,0x169));var _0x17dd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7dd1[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x17dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x17dd('0x1'));var rs=require(_0x17dd('0x2'));var fs=require('fs');var Redis=require(_0x17dd('0x3'));var db=require(_0x17dd('0x4'))['db'];var utils=require(_0x17dd('0x5'));var logger=require(_0x17dd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x17dd('0x7'));var client=jayson['client'][_0x17dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b9038,_0x591bbf,_0x44a3ed){return new BPromise(function(_0x29b28f,_0x5b1bd4){return client[_0x17dd('0x9')](_0x1b9038,_0x44a3ed)['then'](function(_0x4122db){logger['info']('SquareRecording,\x20%s,\x20%s',_0x591bbf,_0x17dd('0xa'));logger[_0x17dd('0xb')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x591bbf,_0x17dd('0xa'),JSON[_0x17dd('0xc')](_0x4122db));if(_0x4122db[_0x17dd('0xd')]){if(_0x4122db['error']['code']===0x1f4){logger[_0x17dd('0xd')]('SquareRecording,\x20%s,\x20%s',_0x591bbf,_0x4122db[_0x17dd('0xd')][_0x17dd('0xe')]);return _0x5b1bd4(_0x4122db[_0x17dd('0xd')][_0x17dd('0xe')]);}logger[_0x17dd('0xd')]('SquareRecording,\x20%s,\x20%s',_0x591bbf,_0x4122db[_0x17dd('0xd')][_0x17dd('0xe')]);return _0x29b28f(_0x4122db[_0x17dd('0xd')][_0x17dd('0xe')]);}else{logger[_0x17dd('0xf')](_0x17dd('0x10'),_0x591bbf,'request\x20sent');_0x29b28f(_0x4122db[_0x17dd('0x11')]['message']);}})['catch'](function(_0x2ccde7){logger[_0x17dd('0xd')]('SquareRecording,\x20%s,\x20%s',_0x591bbf,_0x2ccde7);_0x5b1bd4(_0x2ccde7);});});}exports[_0x17dd('0x12')]=function(_0x3345c5){var _0x5c0342=this;return new Promise(function(_0x41b9f2,_0x15ae11){return db[_0x17dd('0x13')][_0x17dd('0x14')](_0x3345c5[_0x17dd('0x15')],{'raw':_0x3345c5[_0x17dd('0x16')]?_0x3345c5[_0x17dd('0x16')][_0x17dd('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x30d55a){logger[_0x17dd('0xf')]('CreateSquareRecording',_0x3345c5);logger[_0x17dd('0xb')](_0x17dd('0x12'),_0x3345c5,JSON[_0x17dd('0xc')](_0x30d55a));_0x41b9f2(_0x30d55a);})[_0x17dd('0x18')](function(_0x31c75d){logger[_0x17dd('0xd')]('CreateSquareRecording',_0x31c75d[_0x17dd('0xe')],_0x3345c5);_0x15ae11(_0x5c0342[_0x17dd('0xd')](0x1f4,_0x31c75d[_0x17dd('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 597bb9b..f4fea71 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x46ba4f,_0x1ed70b){var _0x133549=function(_0x4785c0){while(--_0x4785c0){_0x46ba4f['push'](_0x46ba4f['shift']());}};_0x133549(++_0x1ed70b);}(_0xe706,0xa3));var _0x6e70=function(_0x20c512,_0x36c198){_0x20c512=_0x20c512-0x0;var _0x25236e=_0xe706[_0x20c512];return _0x25236e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +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(_0x4e18c1,_0x4ad01c){var _0x44c9e5=function(_0x3d3fae){while(--_0x3d3fae){_0x4e18c1['push'](_0x4e18c1['shift']());}};_0x44c9e5(++_0x4ad01c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index c868f18..3632d54 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 _0x1de0=['exports','STRING','DATE','sequelize'];(function(_0x36565d,_0x37395c){var _0x2032ed=function(_0x52a9d3){while(--_0x52a9d3){_0x36565d['push'](_0x36565d['shift']());}};_0x2032ed(++_0x37395c);}(_0x1de0,0x1b3));var _0x01de=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0x1de0[_0xd206ce];return _0x5b3ec6;};'use strict';var Sequelize=require(_0x01de('0x0'));module[_0x01de('0x1')]={'network':{'type':Sequelize[_0x01de('0x2')]},'network_script':{'type':Sequelize[_0x01de('0x2')]},'request':{'type':Sequelize[_0x01de('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x01de('0x2')]},'type':{'type':Sequelize[_0x01de('0x2')]},'uniqueid':{'type':Sequelize[_0x01de('0x2')]},'version':{'type':Sequelize[_0x01de('0x2')]},'callerid':{'type':Sequelize[_0x01de('0x2')]},'calleridname':{'type':Sequelize[_0x01de('0x2')]},'callingpres':{'type':Sequelize[_0x01de('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x01de('0x2')]},'callingtns':{'type':Sequelize[_0x01de('0x2')]},'dnid':{'type':Sequelize[_0x01de('0x2')]},'rdnis':{'type':Sequelize[_0x01de('0x2')]},'context':{'type':Sequelize[_0x01de('0x2')]},'extension':{'type':Sequelize[_0x01de('0x2')]},'priority':{'type':Sequelize[_0x01de('0x2')]},'enhanced':{'type':Sequelize[_0x01de('0x2')]},'accountcode':{'type':Sequelize[_0x01de('0x2')]},'threadid':{'type':Sequelize[_0x01de('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x01de('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4243=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x214322,_0x15b192){var _0x1d2ad7=function(_0x465f4e){while(--_0x465f4e){_0x214322['push'](_0x214322['shift']());}};_0x1d2ad7(++_0x15b192);}(_0x4243,0x13d));var _0x3424=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4243[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3424('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x3424('0x1')]},'request':{'type':Sequelize[_0x3424('0x1')]},'channel':{'type':Sequelize[_0x3424('0x1')]},'language':{'type':Sequelize[_0x3424('0x1')]},'type':{'type':Sequelize[_0x3424('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x3424('0x1')]},'callerid':{'type':Sequelize[_0x3424('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x3424('0x1')]},'callington':{'type':Sequelize[_0x3424('0x1')]},'callingtns':{'type':Sequelize[_0x3424('0x1')]},'dnid':{'type':Sequelize[_0x3424('0x1')]},'rdnis':{'type':Sequelize[_0x3424('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3424('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x3424('0x1')]},'accountcode':{'type':Sequelize[_0x3424('0x1')]},'threadid':{'type':Sequelize[_0x3424('0x1')]},'project_name':{'type':Sequelize[_0x3424('0x1')]},'joinAt':{'type':Sequelize[_0x3424('0x2')]},'leaveAt':{'type':Sequelize[_0x3424('0x2')]},'bot':{'type':Sequelize[_0x3424('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 4644fff..b094763 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 _0x0404=['to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','set','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','intersection','length','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x5b0991,_0x5ab093){var _0x244229=function(_0x111ccb){while(--_0x111ccb){_0x5b0991['push'](_0x5b0991['shift']());}};_0x244229(++_0x5ab093);}(_0x0404,0x173));var _0x4040=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0x0404[_0x2aefb6];return _0x202772;};'use strict';var emlformat=require(_0x4040('0x0'));var rimraf=require(_0x4040('0x1'));var zipdir=require(_0x4040('0x2'));var jsonpatch=require(_0x4040('0x3'));var rp=require(_0x4040('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4040('0x5'));var util=require(_0x4040('0x6'));var path=require(_0x4040('0x7'));var sox=require(_0x4040('0x8'));var csv=require(_0x4040('0x9'));var ejs=require(_0x4040('0xa'));var fs=require('fs');var fs_extra=require(_0x4040('0xb'));var _=require('lodash');var squel=require(_0x4040('0xc'));var crypto=require(_0x4040('0xd'));var jsforce=require(_0x4040('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4040('0xf'));var Redis=require(_0x4040('0x10'));var authService=require(_0x4040('0x11'));var qs=require(_0x4040('0x12'));var as=require(_0x4040('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4040('0x14'))(_0x4040('0x15'));var utils=require(_0x4040('0x16'));var config=require(_0x4040('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4040('0x18'))['db'];function respondWithStatusCode(_0x5bf4c7,_0x2e267b){_0x2e267b=_0x2e267b||0xcc;return function(_0x532dc3){if(_0x532dc3){return _0x5bf4c7[_0x4040('0x19')](_0x2e267b);}return _0x5bf4c7['status'](_0x2e267b)[_0x4040('0x1a')]();};}function respondWithResult(_0x4e5a41,_0x36b782){_0x36b782=_0x36b782||0xc8;return function(_0xab79a9){if(_0xab79a9){return _0x4e5a41[_0x4040('0x1b')](_0x36b782)['json'](_0xab79a9);}};}function respondWithFilteredResult(_0xf89d59,_0x6b926f){return function(_0x4a909f){if(_0x4a909f){var _0x5ff9f6=typeof _0x6b926f['offset']==='undefined'&&typeof _0x6b926f[_0x4040('0x1c')]===_0x4040('0x1d');var _0x1f5500=_0x4a909f[_0x4040('0x1e')];var _0x41d0a0=_0x5ff9f6?0x0:_0x6b926f[_0x4040('0x1f')];var _0x5a8489=_0x5ff9f6?_0x4a909f[_0x4040('0x1e')]:_0x6b926f['offset']+_0x6b926f[_0x4040('0x1c')];var _0x24a4aa;if(_0x5a8489>=_0x1f5500){_0x5a8489=_0x1f5500;_0x24a4aa=0xc8;}else{_0x24a4aa=0xce;}_0xf89d59['status'](_0x24a4aa);return _0xf89d59[_0x4040('0x20')]('Content-Range',_0x41d0a0+'-'+_0x5a8489+'/'+_0x1f5500)[_0x4040('0x21')](_0x4a909f);}return null;};}function patchUpdates(_0x46476e){return function(_0x30cbeb){try{jsonpatch[_0x4040('0x22')](_0x30cbeb,_0x46476e,!![]);}catch(_0x1e3300){return BPromise[_0x4040('0x23')](_0x1e3300);}return _0x30cbeb[_0x4040('0x24')]();};}function saveUpdates(_0x322c6a,_0x297d3d){return function(_0x1c3dc1){if(_0x1c3dc1){return _0x1c3dc1['update'](_0x322c6a)['then'](function(_0x450e3e){return _0x450e3e;});}return null;};}function removeEntity(_0xfdff01,_0x3cb866){return function(_0x4c23f3){if(_0x4c23f3){return _0x4c23f3[_0x4040('0x25')]()[_0x4040('0x26')](function(){_0xfdff01[_0x4040('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f49f,_0x1a532e){return function(_0x2d6c55){if(!_0x2d6c55){_0x44f49f[_0x4040('0x19')](0x194);}return _0x2d6c55;};}function handleError(_0x2be8a2,_0x688c18){_0x688c18=_0x688c18||0x1f4;return function(_0x4dc0f0){logger[_0x4040('0x27')](_0x4dc0f0[_0x4040('0x28')]);if(_0x4dc0f0[_0x4040('0x29')]){delete _0x4dc0f0[_0x4040('0x29')];}_0x2be8a2[_0x4040('0x1b')](_0x688c18)[_0x4040('0x2a')](_0x4dc0f0);};}exports[_0x4040('0x2b')]=function(_0x17295f,_0x1f7a9d){var _0xcca383={},_0xe32d82={},_0x3eb7b3={'count':0x0,'rows':[]};var _0x4083ff=_[_0x4040('0x2c')](db[_0x4040('0x2d')]['rawAttributes'],function(_0x337ea8){return{'name':_0x337ea8[_0x4040('0x2e')],'type':_0x337ea8[_0x4040('0x2f')][_0x4040('0x30')]};});_0xe32d82[_0x4040('0x31')]=_['map'](_0x4083ff,_0x4040('0x29'));_0xe32d82[_0x4040('0x32')]=_[_0x4040('0x33')](_0x17295f['query']);_0xe32d82[_0x4040('0x34')]=_['intersection'](_0xe32d82[_0x4040('0x31')],_0xe32d82[_0x4040('0x32')]);_0xcca383['attributes']=_['intersection'](_0xe32d82[_0x4040('0x31')],qs[_0x4040('0x35')](_0x17295f[_0x4040('0x32')][_0x4040('0x35')]));_0xcca383[_0x4040('0x36')]=_0xcca383[_0x4040('0x36')]['length']?_0xcca383[_0x4040('0x36')]:_0xe32d82['model'];if(!_0x17295f['query'][_0x4040('0x37')]('nolimit')){_0xcca383['limit']=qs[_0x4040('0x1c')](_0x17295f[_0x4040('0x32')][_0x4040('0x1c')]);_0xcca383[_0x4040('0x1f')]=qs['offset'](_0x17295f['query']['offset']);}_0xcca383[_0x4040('0x38')]=qs['sort'](_0x17295f['query'][_0x4040('0x39')]);_0xcca383[_0x4040('0x3a')]=qs['filters'](_[_0x4040('0x3b')](_0x17295f[_0x4040('0x32')],_0xe32d82['filters']),_0x4083ff);if(_0x17295f[_0x4040('0x32')][_0x4040('0x3c')]){_0xcca383['where']=_[_0x4040('0x3d')](_0xcca383[_0x4040('0x3a')],{'$or':_[_0x4040('0x2c')](_0x4083ff,function(_0x2cbfc4){if(_0x2cbfc4[_0x4040('0x2f')]!=='VIRTUAL'){var _0xa65f50={};_0xa65f50[_0x2cbfc4[_0x4040('0x29')]]={'$like':'%'+_0x17295f[_0x4040('0x32')][_0x4040('0x3c')]+'%'};return _0xa65f50;}})});}_0xcca383=_[_0x4040('0x3d')]({},_0xcca383,_0x17295f[_0x4040('0x3e')]);var _0x5c739c={'where':_0xcca383[_0x4040('0x3a')]};return db[_0x4040('0x2d')][_0x4040('0x1e')](_0x5c739c)['then'](function(_0x579f24){_0x3eb7b3[_0x4040('0x1e')]=_0x579f24;if(_0x17295f[_0x4040('0x32')][_0x4040('0x3f')]){_0xcca383[_0x4040('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0x4040('0x41')](_0xcca383);})[_0x4040('0x26')](function(_0x514f10){_0x3eb7b3['rows']=_0x514f10;return _0x3eb7b3;})[_0x4040('0x26')](respondWithFilteredResult(_0x1f7a9d,_0xcca383))[_0x4040('0x42')](handleError(_0x1f7a9d,null));};exports['show']=function(_0x574d21,_0x1af2f2){var _0x2ee0cd={'raw':!![],'where':{'id':_0x574d21[_0x4040('0x43')]['id']}},_0x4a1829={};_0x4a1829[_0x4040('0x31')]=_[_0x4040('0x33')](db['SquareReport'][_0x4040('0x44')]);_0x4a1829[_0x4040('0x32')]=_['keys'](_0x574d21[_0x4040('0x32')]);_0x4a1829[_0x4040('0x34')]=_['intersection'](_0x4a1829[_0x4040('0x31')],_0x4a1829[_0x4040('0x32')]);_0x2ee0cd[_0x4040('0x36')]=_[_0x4040('0x45')](_0x4a1829[_0x4040('0x31')],qs[_0x4040('0x35')](_0x574d21[_0x4040('0x32')][_0x4040('0x35')]));_0x2ee0cd[_0x4040('0x36')]=_0x2ee0cd[_0x4040('0x36')][_0x4040('0x46')]?_0x2ee0cd[_0x4040('0x36')]:_0x4a1829[_0x4040('0x31')];if(_0x574d21[_0x4040('0x32')][_0x4040('0x3f')]){_0x2ee0cd[_0x4040('0x40')]=[{'all':!![]}];}_0x2ee0cd=_[_0x4040('0x3d')]({},_0x2ee0cd,_0x574d21[_0x4040('0x3e')]);return db[_0x4040('0x2d')][_0x4040('0x47')](_0x2ee0cd)[_0x4040('0x26')](handleEntityNotFound(_0x1af2f2,null))[_0x4040('0x26')](respondWithResult(_0x1af2f2,null))['catch'](handleError(_0x1af2f2,null));};exports[_0x4040('0x48')]=function(_0x5dea5a,_0xd0feb5){return db[_0x4040('0x2d')]['create'](_0x5dea5a['body'],{})[_0x4040('0x26')](respondWithResult(_0xd0feb5,0xc9))['catch'](handleError(_0xd0feb5,null));};exports[_0x4040('0x49')]=function(_0x1d882d,_0x54fc43){if(_0x1d882d[_0x4040('0x4a')]['id']){delete _0x1d882d['body']['id'];}return db[_0x4040('0x2d')][_0x4040('0x47')]({'where':{'id':_0x1d882d[_0x4040('0x43')]['id']}})[_0x4040('0x26')](handleEntityNotFound(_0x54fc43,null))['then'](saveUpdates(_0x1d882d['body'],null))[_0x4040('0x26')](respondWithResult(_0x54fc43,null))[_0x4040('0x42')](handleError(_0x54fc43,null));};exports[_0x4040('0x25')]=function(_0x3580b6,_0x5372c0){return db[_0x4040('0x2d')][_0x4040('0x47')]({'where':{'id':_0x3580b6[_0x4040('0x43')]['id']}})[_0x4040('0x26')](handleEntityNotFound(_0x5372c0,null))[_0x4040('0x26')](removeEntity(_0x5372c0,null))['catch'](handleError(_0x5372c0,null));};exports[_0x4040('0x4b')]=function(_0x23f40d,_0x298cb2){return db[_0x4040('0x2d')]['describe']()['then'](respondWithResult(_0x298cb2,null))[_0x4040('0x42')](handleError(_0x298cb2,null));}; \ No newline at end of file +var _0x2207=['limit','undefined','count','json','reject','save','update','then','destroy','error','stack','name','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2207,0xc0));var _0x7220=function(_0x3e22ec,_0x59e837){_0x3e22ec=_0x3e22ec-0x0;var _0x21669d=_0x2207[_0x3e22ec];return _0x21669d;};'use strict';var emlformat=require(_0x7220('0x0'));var rimraf=require(_0x7220('0x1'));var zipdir=require(_0x7220('0x2'));var jsonpatch=require(_0x7220('0x3'));var rp=require('request-promise');var moment=require(_0x7220('0x4'));var BPromise=require(_0x7220('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7220('0x6'));var sox=require('sox');var csv=require(_0x7220('0x7'));var ejs=require(_0x7220('0x8'));var fs=require('fs');var fs_extra=require(_0x7220('0x9'));var _=require(_0x7220('0xa'));var squel=require(_0x7220('0xb'));var crypto=require(_0x7220('0xc'));var jsforce=require(_0x7220('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7220('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7220('0xf'));var qs=require(_0x7220('0x10'));var as=require(_0x7220('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7220('0x12'));var utils=require(_0x7220('0x13'));var config=require(_0x7220('0x14'));var licenseUtil=require(_0x7220('0x15'));var db=require(_0x7220('0x16'))['db'];function respondWithStatusCode(_0x5bd028,_0x22e3b9){_0x22e3b9=_0x22e3b9||0xcc;return function(_0x1d2732){if(_0x1d2732){return _0x5bd028[_0x7220('0x17')](_0x22e3b9);}return _0x5bd028[_0x7220('0x18')](_0x22e3b9)[_0x7220('0x19')]();};}function respondWithResult(_0x31ce5f,_0xb6b998){_0xb6b998=_0xb6b998||0xc8;return function(_0x3b063b){if(_0x3b063b){return _0x31ce5f[_0x7220('0x18')](_0xb6b998)['json'](_0x3b063b);}};}function respondWithFilteredResult(_0x4e2ff5,_0x171374){return function(_0x32dd8d){if(_0x32dd8d){var _0x374fda=typeof _0x171374[_0x7220('0x1a')]==='undefined'&&typeof _0x171374[_0x7220('0x1b')]===_0x7220('0x1c');var _0x2cc723=_0x32dd8d[_0x7220('0x1d')];var _0x5d6c76=_0x374fda?0x0:_0x171374[_0x7220('0x1a')];var _0xa87688=_0x374fda?_0x32dd8d[_0x7220('0x1d')]:_0x171374[_0x7220('0x1a')]+_0x171374[_0x7220('0x1b')];var _0x525bcf;if(_0xa87688>=_0x2cc723){_0xa87688=_0x2cc723;_0x525bcf=0xc8;}else{_0x525bcf=0xce;}_0x4e2ff5['status'](_0x525bcf);return _0x4e2ff5['set']('Content-Range',_0x5d6c76+'-'+_0xa87688+'/'+_0x2cc723)[_0x7220('0x1e')](_0x32dd8d);}return null;};}function patchUpdates(_0x42db61){return function(_0x3003ac){try{jsonpatch['apply'](_0x3003ac,_0x42db61,!![]);}catch(_0x35e062){return BPromise[_0x7220('0x1f')](_0x35e062);}return _0x3003ac[_0x7220('0x20')]();};}function saveUpdates(_0x3c7d5a,_0x1f521a){return function(_0xae446c){if(_0xae446c){return _0xae446c[_0x7220('0x21')](_0x3c7d5a)[_0x7220('0x22')](function(_0x2f3445){return _0x2f3445;});}return null;};}function removeEntity(_0x33ba2d,_0x6176ff){return function(_0x4a9530){if(_0x4a9530){return _0x4a9530[_0x7220('0x23')]()[_0x7220('0x22')](function(){_0x33ba2d['status'](0xcc)[_0x7220('0x19')]();});}};}function handleEntityNotFound(_0x47fe17,_0x175541){return function(_0x225807){if(!_0x225807){_0x47fe17['sendStatus'](0x194);}return _0x225807;};}function handleError(_0x1d1380,_0x145e4e){_0x145e4e=_0x145e4e||0x1f4;return function(_0x3277c6){logger[_0x7220('0x24')](_0x3277c6[_0x7220('0x25')]);if(_0x3277c6[_0x7220('0x26')]){delete _0x3277c6['name'];}_0x1d1380[_0x7220('0x18')](_0x145e4e)['send'](_0x3277c6);};}exports[_0x7220('0x27')]=function(_0x227f85,_0x219d6d){var _0x4490b8={},_0x1ab4fd={},_0x2eff6e={'count':0x0,'rows':[]};var _0x17d2bf=_[_0x7220('0x28')](db[_0x7220('0x29')][_0x7220('0x2a')],function(_0x23c130){return{'name':_0x23c130[_0x7220('0x2b')],'type':_0x23c130[_0x7220('0x2c')][_0x7220('0x2d')]};});_0x1ab4fd[_0x7220('0x2e')]=_[_0x7220('0x28')](_0x17d2bf,_0x7220('0x26'));_0x1ab4fd['query']=_[_0x7220('0x2f')](_0x227f85[_0x7220('0x30')]);_0x1ab4fd['filters']=_[_0x7220('0x31')](_0x1ab4fd[_0x7220('0x2e')],_0x1ab4fd[_0x7220('0x30')]);_0x4490b8[_0x7220('0x32')]=_[_0x7220('0x31')](_0x1ab4fd[_0x7220('0x2e')],qs[_0x7220('0x33')](_0x227f85[_0x7220('0x30')][_0x7220('0x33')]));_0x4490b8[_0x7220('0x32')]=_0x4490b8[_0x7220('0x32')][_0x7220('0x34')]?_0x4490b8[_0x7220('0x32')]:_0x1ab4fd[_0x7220('0x2e')];if(!_0x227f85['query']['hasOwnProperty'](_0x7220('0x35'))){_0x4490b8['limit']=qs[_0x7220('0x1b')](_0x227f85['query'][_0x7220('0x1b')]);_0x4490b8[_0x7220('0x1a')]=qs[_0x7220('0x1a')](_0x227f85['query']['offset']);}_0x4490b8[_0x7220('0x36')]=qs[_0x7220('0x37')](_0x227f85[_0x7220('0x30')][_0x7220('0x37')]);_0x4490b8[_0x7220('0x38')]=qs[_0x7220('0x39')](_[_0x7220('0x3a')](_0x227f85[_0x7220('0x30')],_0x1ab4fd[_0x7220('0x39')]),_0x17d2bf);if(_0x227f85[_0x7220('0x30')][_0x7220('0x3b')]){_0x4490b8[_0x7220('0x38')]=_['merge'](_0x4490b8[_0x7220('0x38')],{'$or':_['map'](_0x17d2bf,function(_0x254234){if(_0x254234[_0x7220('0x2c')]!=='VIRTUAL'){var _0x17348a={};_0x17348a[_0x254234['name']]={'$like':'%'+_0x227f85['query'][_0x7220('0x3b')]+'%'};return _0x17348a;}})});}_0x4490b8=_[_0x7220('0x3c')]({},_0x4490b8,_0x227f85[_0x7220('0x3d')]);var _0x5b426f={'where':_0x4490b8['where']};return db[_0x7220('0x29')]['count'](_0x5b426f)[_0x7220('0x22')](function(_0x1ee249){_0x2eff6e['count']=_0x1ee249;if(_0x227f85[_0x7220('0x30')][_0x7220('0x3e')]){_0x4490b8[_0x7220('0x3f')]=[{'all':!![]}];}return db[_0x7220('0x29')][_0x7220('0x40')](_0x4490b8);})[_0x7220('0x22')](function(_0x5333d6){_0x2eff6e[_0x7220('0x41')]=_0x5333d6;return _0x2eff6e;})['then'](respondWithFilteredResult(_0x219d6d,_0x4490b8))[_0x7220('0x42')](handleError(_0x219d6d,null));};exports[_0x7220('0x43')]=function(_0x52e5f3,_0x3d4f00){var _0x276c63={'raw':!![],'where':{'id':_0x52e5f3['params']['id']}},_0x188d6c={};_0x188d6c['model']=_[_0x7220('0x2f')](db[_0x7220('0x29')][_0x7220('0x2a')]);_0x188d6c[_0x7220('0x30')]=_[_0x7220('0x2f')](_0x52e5f3['query']);_0x188d6c[_0x7220('0x39')]=_[_0x7220('0x31')](_0x188d6c[_0x7220('0x2e')],_0x188d6c[_0x7220('0x30')]);_0x276c63[_0x7220('0x32')]=_['intersection'](_0x188d6c['model'],qs[_0x7220('0x33')](_0x52e5f3['query'][_0x7220('0x33')]));_0x276c63['attributes']=_0x276c63[_0x7220('0x32')]['length']?_0x276c63['attributes']:_0x188d6c[_0x7220('0x2e')];if(_0x52e5f3['query'][_0x7220('0x3e')]){_0x276c63['include']=[{'all':!![]}];}_0x276c63=_[_0x7220('0x3c')]({},_0x276c63,_0x52e5f3['options']);return db[_0x7220('0x29')][_0x7220('0x44')](_0x276c63)[_0x7220('0x22')](handleEntityNotFound(_0x3d4f00,null))['then'](respondWithResult(_0x3d4f00,null))[_0x7220('0x42')](handleError(_0x3d4f00,null));};exports[_0x7220('0x45')]=function(_0x493b28,_0x1b35b8){return db[_0x7220('0x29')][_0x7220('0x45')](_0x493b28[_0x7220('0x46')],{})[_0x7220('0x22')](respondWithResult(_0x1b35b8,0xc9))[_0x7220('0x42')](handleError(_0x1b35b8,null));};exports[_0x7220('0x21')]=function(_0x4af283,_0x17b1c8){if(_0x4af283[_0x7220('0x46')]['id']){delete _0x4af283[_0x7220('0x46')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x4af283[_0x7220('0x47')]['id']}})['then'](handleEntityNotFound(_0x17b1c8,null))['then'](saveUpdates(_0x4af283['body'],null))[_0x7220('0x22')](respondWithResult(_0x17b1c8,null))['catch'](handleError(_0x17b1c8,null));};exports['destroy']=function(_0x2b652a,_0x56c692){return db['SquareReport'][_0x7220('0x44')]({'where':{'id':_0x2b652a[_0x7220('0x47')]['id']}})[_0x7220('0x22')](handleEntityNotFound(_0x56c692,null))[_0x7220('0x22')](removeEntity(_0x56c692,null))[_0x7220('0x42')](handleError(_0x56c692,null));};exports[_0x7220('0x48')]=function(_0x2490f9,_0x15d803){return db['SquareReport'][_0x7220('0x48')]()[_0x7220('0x22')](respondWithResult(_0x15d803,null))[_0x7220('0x42')](handleError(_0x15d803,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 4f827d4..115fcb5 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 _0x8524=['./squareReport.attributes','exports','define','report_square','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x8524,0x1e1));var _0x4852=function(_0x1d7a75,_0x52b0fb){_0x1d7a75=_0x1d7a75-0x0;var _0x42306a=_0x8524[_0x1d7a75];return _0x42306a;};'use strict';var _=require(_0x4852('0x0'));var util=require('util');var logger=require(_0x4852('0x1'))(_0x4852('0x2'));var moment=require(_0x4852('0x3'));var BPromise=require(_0x4852('0x4'));var rp=require(_0x4852('0x5'));var fs=require('fs');var path=require(_0x4852('0x6'));var rimraf=require(_0x4852('0x7'));var config=require(_0x4852('0x8'));var attributes=require(_0x4852('0x9'));module[_0x4852('0xa')]=function(_0x2b6aa4,_0x29d071){return _0x2b6aa4[_0x4852('0xb')]('SquareReport',attributes,{'tableName':_0x4852('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0x4852('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf04=['api','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0xaf04,0x1ed));var _0x4af0=function(_0x52f6d2,_0x2384e6){_0x52f6d2=_0x52f6d2-0x0;var _0x16499a=_0xaf04[_0x52f6d2];return _0x16499a;};'use strict';var _=require(_0x4af0('0x0'));var util=require('util');var logger=require(_0x4af0('0x1'))(_0x4af0('0x2'));var moment=require('moment');var BPromise=require(_0x4af0('0x3'));var rp=require(_0x4af0('0x4'));var fs=require('fs');var path=require(_0x4af0('0x5'));var rimraf=require('rimraf');var config=require(_0x4af0('0x6'));var attributes=require(_0x4af0('0x7'));module[_0x4af0('0x8')]=function(_0x1420cc,_0x41429a){return _0x1420cc[_0x4af0('0x9')](_0x4af0('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x4af0('0xb'),'fields':[_0x4af0('0xc'),_0x4af0('0xd')]},{'name':_0x4af0('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0300117..c500065 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 _0x4564=['client','http','then','info','SquareReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','catch','UpdateSquareReport','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x5575ce,_0x232520){var _0x46e631=function(_0x5ad1f4){while(--_0x5ad1f4){_0x5575ce['push'](_0x5575ce['shift']());}};_0x46e631(++_0x232520);}(_0x4564,0x1b8));var _0x4456=function(_0x39e4bb,_0x202712){_0x39e4bb=_0x39e4bb-0x0;var _0x54e9b6=_0x4564[_0x39e4bb];return _0x54e9b6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4456('0x0'));var BPromise=require(_0x4456('0x1'));var rs=require(_0x4456('0x2'));var fs=require('fs');var Redis=require(_0x4456('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4456('0x4'));var logger=require(_0x4456('0x5'))(_0x4456('0x6'));var config=require('../../config/environment');var jayson=require(_0x4456('0x7'));var client=jayson[_0x4456('0x8')][_0x4456('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb33cb6,_0x76a391,_0x2891e9){return new BPromise(function(_0x818576,_0x213f8e){return client['request'](_0xb33cb6,_0x2891e9)[_0x4456('0xa')](function(_0x374a8e){logger[_0x4456('0xb')](_0x4456('0xc'),_0x76a391,'request\x20sent');logger[_0x4456('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x76a391,_0x4456('0xe'),JSON[_0x4456('0xf')](_0x374a8e));if(_0x374a8e[_0x4456('0x10')]){if(_0x374a8e[_0x4456('0x10')][_0x4456('0x11')]===0x1f4){logger['error'](_0x4456('0xc'),_0x76a391,_0x374a8e[_0x4456('0x10')][_0x4456('0x12')]);return _0x213f8e(_0x374a8e[_0x4456('0x10')][_0x4456('0x12')]);}logger[_0x4456('0x10')]('SquareReport,\x20%s,\x20%s',_0x76a391,_0x374a8e[_0x4456('0x10')][_0x4456('0x12')]);return _0x818576(_0x374a8e[_0x4456('0x10')][_0x4456('0x12')]);}else{logger[_0x4456('0xb')](_0x4456('0xc'),_0x76a391,'request\x20sent');_0x818576(_0x374a8e[_0x4456('0x13')][_0x4456('0x12')]);}})['catch'](function(_0x1126f0){logger['error']('SquareReport,\x20%s,\x20%s',_0x76a391,_0x1126f0);_0x213f8e(_0x1126f0);});});}exports[_0x4456('0x14')]=function(_0x5c7a00){var _0x3f39d9=this;return new Promise(function(_0x3a0163,_0x18708a){return db[_0x4456('0x15')][_0x4456('0x16')](_0x5c7a00[_0x4456('0x17')],{'raw':_0x5c7a00['options']?_0x5c7a00[_0x4456('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4456('0xa')](function(_0x301495){logger[_0x4456('0xb')](_0x4456('0x14'),_0x5c7a00);logger[_0x4456('0xd')](_0x4456('0x14'),_0x5c7a00,JSON['stringify'](_0x301495));_0x3a0163(_0x301495);})[_0x4456('0x19')](function(_0x323553){logger[_0x4456('0x10')]('CreateSquareReport',_0x323553[_0x4456('0x12')],_0x5c7a00);_0x18708a(_0x3f39d9['error'](0x1f4,_0x323553[_0x4456('0x12')]));});});};exports[_0x4456('0x1a')]=function(_0x297ba1){var _0x45d805=this;return new Promise(function(_0x342811,_0x32ba4b){return db[_0x4456('0x15')][_0x4456('0x1b')](_0x297ba1[_0x4456('0x17')],{'raw':_0x297ba1[_0x4456('0x18')]?_0x297ba1['options'][_0x4456('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x297ba1[_0x4456('0x18')]?_0x297ba1['options'][_0x4456('0x1d')]||null:null,'attributes':_0x297ba1[_0x4456('0x18')]?_0x297ba1[_0x4456('0x18')][_0x4456('0x1e')]||null:null,'limit':_0x297ba1[_0x4456('0x18')]?_0x297ba1[_0x4456('0x18')][_0x4456('0x1f')]||null:null})[_0x4456('0xa')](function(_0x516a25){logger[_0x4456('0xb')]('UpdateSquareReport',_0x297ba1);logger[_0x4456('0xd')]('UpdateSquareReport',_0x297ba1,JSON[_0x4456('0xf')](_0x516a25));_0x342811(_0x516a25);})[_0x4456('0x19')](function(_0x4446b7){logger['error'](_0x4456('0x1a'),_0x4446b7['message'],_0x297ba1);_0x32ba4b(_0x45d805[_0x4456('0x10')](0x1f4,_0x4446b7['message']));});});}; \ No newline at end of file +var _0xc1a0=['debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','SquareReport','create','options','raw','CreateSquareReport','stringify','UpdateSquareReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1658ad,_0x487c1f){var _0x3b1927=function(_0xc06bb2){while(--_0xc06bb2){_0x1658ad['push'](_0x1658ad['shift']());}};_0x3b1927(++_0x487c1f);}(_0xc1a0,0x166));var _0x0c1a=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xc1a0[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x0c1a('0x0'));var util=require(_0x0c1a('0x1'));var moment=require(_0x0c1a('0x2'));var BPromise=require('bluebird');var rs=require(_0x0c1a('0x3'));var fs=require('fs');var Redis=require(_0x0c1a('0x4'));var db=require(_0x0c1a('0x5'))['db'];var utils=require(_0x0c1a('0x6'));var logger=require(_0x0c1a('0x7'))(_0x0c1a('0x8'));var config=require(_0x0c1a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0c1a('0xa')][_0x0c1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4021d7,_0x266892,_0x5a7fe3){return new BPromise(function(_0x2d8899,_0x656de1){return client['request'](_0x4021d7,_0x5a7fe3)[_0x0c1a('0xc')](function(_0x163d64){logger[_0x0c1a('0xd')](_0x0c1a('0xe'),_0x266892,_0x0c1a('0xf'));logger[_0x0c1a('0x10')](_0x0c1a('0x11'),_0x266892,_0x0c1a('0xf'),JSON['stringify'](_0x163d64));if(_0x163d64[_0x0c1a('0x12')]){if(_0x163d64[_0x0c1a('0x12')]['code']===0x1f4){logger[_0x0c1a('0x12')](_0x0c1a('0xe'),_0x266892,_0x163d64['error'][_0x0c1a('0x13')]);return _0x656de1(_0x163d64['error'][_0x0c1a('0x13')]);}logger[_0x0c1a('0x12')](_0x0c1a('0xe'),_0x266892,_0x163d64[_0x0c1a('0x12')][_0x0c1a('0x13')]);return _0x2d8899(_0x163d64[_0x0c1a('0x12')][_0x0c1a('0x13')]);}else{logger[_0x0c1a('0xd')](_0x0c1a('0xe'),_0x266892,'request\x20sent');_0x2d8899(_0x163d64[_0x0c1a('0x14')]['message']);}})[_0x0c1a('0x15')](function(_0x417c4e){logger['error']('SquareReport,\x20%s,\x20%s',_0x266892,_0x417c4e);_0x656de1(_0x417c4e);});});}exports['CreateSquareReport']=function(_0x1c8258){var _0x552988=this;return new Promise(function(_0x2c0c13,_0x40011a){return db[_0x0c1a('0x16')][_0x0c1a('0x17')](_0x1c8258['body'],{'raw':_0x1c8258['options']?_0x1c8258[_0x0c1a('0x18')][_0x0c1a('0x19')]===undefined?!![]:![]:!![]})[_0x0c1a('0xc')](function(_0x243438){logger[_0x0c1a('0xd')](_0x0c1a('0x1a'),_0x1c8258);logger[_0x0c1a('0x10')](_0x0c1a('0x1a'),_0x1c8258,JSON[_0x0c1a('0x1b')](_0x243438));_0x2c0c13(_0x243438);})[_0x0c1a('0x15')](function(_0x2c25f5){logger[_0x0c1a('0x12')](_0x0c1a('0x1a'),_0x2c25f5[_0x0c1a('0x13')],_0x1c8258);_0x40011a(_0x552988['error'](0x1f4,_0x2c25f5[_0x0c1a('0x13')]));});});};exports[_0x0c1a('0x1c')]=function(_0xf2a30){var _0x208090=this;return new Promise(function(_0x259220,_0x367b9c){return db[_0x0c1a('0x16')][_0x0c1a('0x1d')](_0xf2a30[_0x0c1a('0x1e')],{'raw':_0xf2a30['options']?_0xf2a30['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2a30['options']?_0xf2a30[_0x0c1a('0x18')][_0x0c1a('0x1f')]||null:null,'attributes':_0xf2a30[_0x0c1a('0x18')]?_0xf2a30[_0x0c1a('0x18')][_0x0c1a('0x20')]||null:null,'limit':_0xf2a30[_0x0c1a('0x18')]?_0xf2a30[_0x0c1a('0x18')][_0x0c1a('0x21')]||null:null})[_0x0c1a('0xc')](function(_0x3ca433){logger[_0x0c1a('0xd')](_0x0c1a('0x1c'),_0xf2a30);logger['debug'](_0x0c1a('0x1c'),_0xf2a30,JSON[_0x0c1a('0x1b')](_0x3ca433));_0x259220(_0x3ca433);})[_0x0c1a('0x15')](function(_0x1706a1){logger[_0x0c1a('0x12')]('UpdateSquareReport',_0x1706a1['message'],_0xf2a30);_0x367b9c(_0x208090[_0x0c1a('0x12')](0x1f4,_0x1706a1[_0x0c1a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ed3ae62..868200a 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 _0xff7e=['create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','post'];(function(_0x192de3,_0x15a264){var _0x53844f=function(_0x255b29){while(--_0x255b29){_0x192de3['push'](_0x192de3['shift']());}};_0x53844f(++_0x15a264);}(_0xff7e,0xba));var _0xeff7=function(_0x1df67c,_0x1fcf02){_0x1df67c=_0x1df67c-0x0;var _0x1b7241=_0xff7e[_0x1df67c];return _0x1b7241;};'use strict';var multer=require('multer');var util=require(_0xeff7('0x0'));var path=require(_0xeff7('0x1'));var timeout=require('connect-timeout');var express=require(_0xeff7('0x2'));var router=express[_0xeff7('0x3')]();var fs_extra=require(_0xeff7('0x4'));var auth=require(_0xeff7('0x5'));var interaction=require(_0xeff7('0x6'));var config=require(_0xeff7('0x7'));var controller=require(_0xeff7('0x8'));router[_0xeff7('0x9')]('/',auth[_0xeff7('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xeff7('0xb')]);router[_0xeff7('0x9')](_0xeff7('0xc'),auth[_0xeff7('0xa')](),controller['show']);router[_0xeff7('0xd')]('/',auth['isAuthenticated'](),controller[_0xeff7('0xe')]);router[_0xeff7('0xf')]('/:id',auth[_0xeff7('0xa')](),controller[_0xeff7('0x10')]);router[_0xeff7('0x11')](_0xeff7('0xc'),auth['isAuthenticated'](),controller[_0xeff7('0x12')]);module[_0xeff7('0x13')]=router; \ No newline at end of file +var _0x8f1a=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated','/:id','create','put','update'];(function(_0x41cdd4,_0x501b1d){var _0x5fed68=function(_0x15f3ec){while(--_0x15f3ec){_0x41cdd4['push'](_0x41cdd4['shift']());}};_0x5fed68(++_0x501b1d);}(_0x8f1a,0x1c5));var _0xa8f1=function(_0x429abd,_0x5a6d67){_0x429abd=_0x429abd-0x0;var _0x2b2f4a=_0x8f1a[_0x429abd];return _0x2b2f4a;};'use strict';var multer=require('multer');var util=require(_0xa8f1('0x0'));var path=require(_0xa8f1('0x1'));var timeout=require('connect-timeout');var express=require(_0xa8f1('0x2'));var router=express[_0xa8f1('0x3')]();var fs_extra=require(_0xa8f1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa8f1('0x5'));var config=require(_0xa8f1('0x6'));var controller=require(_0xa8f1('0x7'));router[_0xa8f1('0x8')]('/',auth['isAuthenticated'](),controller[_0xa8f1('0x9')]);router[_0xa8f1('0x8')]('/describe',auth[_0xa8f1('0xa')](),controller['describe']);router['get'](_0xa8f1('0xb'),auth[_0xa8f1('0xa')](),controller['show']);router['post']('/',auth[_0xa8f1('0xa')](),controller[_0xa8f1('0xc')]);router[_0xa8f1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa8f1('0xe')]);router[_0xa8f1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa8f1('0x10')]);module[_0xa8f1('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index aba581f..1a1c340 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 _0x373b=['STRING','TEXT','sequelize','exports'];(function(_0x1f7428,_0xedc78){var _0x1d6392=function(_0x3cd33d){while(--_0x3cd33d){_0x1f7428['push'](_0x1f7428['shift']());}};_0x1d6392(++_0xedc78);}(_0x373b,0xf6));var _0xb373=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x373b[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0xb373('0x0'));module[_0xb373('0x1')]={'uniqueid':{'type':Sequelize[_0xb373('0x2')]},'node':{'type':Sequelize[_0xb373('0x2')]},'application':{'type':Sequelize[_0xb373('0x2')]},'data':{'type':Sequelize[_0xb373('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe659=['STRING','TEXT','sequelize'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xe659,0x1e2));var _0x9e65=function(_0x4ae6e9,_0x4a8468){_0x4ae6e9=_0x4ae6e9-0x0;var _0x2906ec=_0xe659[_0x4ae6e9];return _0x2906ec;};'use strict';var Sequelize=require(_0x9e65('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9e65('0x1')]},'node':{'type':Sequelize[_0x9e65('0x1')]},'application':{'type':Sequelize[_0x9e65('0x1')]},'data':{'type':Sequelize[_0x9e65('0x2')]},'project_name':{'type':Sequelize[_0x9e65('0x1')]},'callerid':{'type':Sequelize[_0x9e65('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c4ed605..3fcdb51 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 _0xed46=['reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply'];(function(_0x39f698,_0x272eed){var _0x479e2c=function(_0x482a28){while(--_0x482a28){_0x39f698['push'](_0x39f698['shift']());}};_0x479e2c(++_0x272eed);}(_0xed46,0x1de));var _0x6ed4=function(_0x5a3c7b,_0x3fad44){_0x5a3c7b=_0x5a3c7b-0x0;var _0x5763f5=_0xed46[_0x5a3c7b];return _0x5763f5;};'use strict';var emlformat=require(_0x6ed4('0x0'));var rimraf=require(_0x6ed4('0x1'));var zipdir=require(_0x6ed4('0x2'));var jsonpatch=require(_0x6ed4('0x3'));var rp=require(_0x6ed4('0x4'));var moment=require('moment');var BPromise=require(_0x6ed4('0x5'));var Mustache=require(_0x6ed4('0x6'));var util=require(_0x6ed4('0x7'));var path=require(_0x6ed4('0x8'));var sox=require(_0x6ed4('0x9'));var csv=require(_0x6ed4('0xa'));var ejs=require(_0x6ed4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ed4('0xc'));var squel=require(_0x6ed4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ed4('0xe'));var toCsv=require(_0x6ed4('0xa'));var querystring=require(_0x6ed4('0xf'));var Papa=require(_0x6ed4('0x10'));var Redis=require(_0x6ed4('0x11'));var authService=require(_0x6ed4('0x12'));var qs=require(_0x6ed4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ed4('0x14'));var logger=require(_0x6ed4('0x15'))(_0x6ed4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6ed4('0x17'))['db'];function respondWithStatusCode(_0xb801a0,_0x268193){_0x268193=_0x268193||0xcc;return function(_0x177b49){if(_0x177b49){return _0xb801a0['sendStatus'](_0x268193);}return _0xb801a0[_0x6ed4('0x18')](_0x268193)[_0x6ed4('0x19')]();};}function respondWithResult(_0x4240b8,_0x1eb84e){_0x1eb84e=_0x1eb84e||0xc8;return function(_0x48038d){if(_0x48038d){return _0x4240b8['status'](_0x1eb84e)[_0x6ed4('0x1a')](_0x48038d);}};}function respondWithFilteredResult(_0x3d7e41,_0x19d84b){return function(_0x191b18){if(_0x191b18){var _0x54c1f2=typeof _0x19d84b['offset']==='undefined'&&typeof _0x19d84b[_0x6ed4('0x1b')]===_0x6ed4('0x1c');var _0x3a6e75=_0x191b18[_0x6ed4('0x1d')];var _0x28114e=_0x54c1f2?0x0:_0x19d84b[_0x6ed4('0x1e')];var _0x51310a=_0x54c1f2?_0x191b18[_0x6ed4('0x1d')]:_0x19d84b[_0x6ed4('0x1e')]+_0x19d84b[_0x6ed4('0x1b')];var _0x4ba974;if(_0x51310a>=_0x3a6e75){_0x51310a=_0x3a6e75;_0x4ba974=0xc8;}else{_0x4ba974=0xce;}_0x3d7e41[_0x6ed4('0x18')](_0x4ba974);return _0x3d7e41['set'](_0x6ed4('0x1f'),_0x28114e+'-'+_0x51310a+'/'+_0x3a6e75)[_0x6ed4('0x1a')](_0x191b18);}return null;};}function patchUpdates(_0x5c1877){return function(_0x48234b){try{jsonpatch[_0x6ed4('0x20')](_0x48234b,_0x5c1877,!![]);}catch(_0x50ce1c){return BPromise[_0x6ed4('0x21')](_0x50ce1c);}return _0x48234b[_0x6ed4('0x22')]();};}function saveUpdates(_0x1fba4c,_0x512d81){return function(_0x3c52da){if(_0x3c52da){return _0x3c52da[_0x6ed4('0x23')](_0x1fba4c)[_0x6ed4('0x24')](function(_0x2adca1){return _0x2adca1;});}return null;};}function removeEntity(_0x29db73,_0x42eacc){return function(_0x26d6ff){if(_0x26d6ff){return _0x26d6ff[_0x6ed4('0x25')]()[_0x6ed4('0x24')](function(){_0x29db73[_0x6ed4('0x18')](0xcc)[_0x6ed4('0x19')]();});}};}function handleEntityNotFound(_0x204426,_0x5a2f62){return function(_0x1a2c48){if(!_0x1a2c48){_0x204426[_0x6ed4('0x26')](0x194);}return _0x1a2c48;};}function handleError(_0xb2d143,_0x4fe6b7){_0x4fe6b7=_0x4fe6b7||0x1f4;return function(_0x2975f0){logger[_0x6ed4('0x27')](_0x2975f0[_0x6ed4('0x28')]);if(_0x2975f0[_0x6ed4('0x29')]){delete _0x2975f0[_0x6ed4('0x29')];}_0xb2d143[_0x6ed4('0x18')](_0x4fe6b7)[_0x6ed4('0x2a')](_0x2975f0);};}exports['index']=function(_0x42b053,_0x57da80){var _0x5d2c53={},_0x3534e8={},_0x3f2b4f={'count':0x0,'rows':[]};var _0x3b423d=_[_0x6ed4('0x2b')](db[_0x6ed4('0x2c')][_0x6ed4('0x2d')],function(_0x3af61f){return{'name':_0x3af61f[_0x6ed4('0x2e')],'type':_0x3af61f[_0x6ed4('0x2f')]['key']};});_0x3534e8['model']=_[_0x6ed4('0x2b')](_0x3b423d,_0x6ed4('0x29'));_0x3534e8[_0x6ed4('0x30')]=_[_0x6ed4('0x31')](_0x42b053[_0x6ed4('0x30')]);_0x3534e8['filters']=_[_0x6ed4('0x32')](_0x3534e8[_0x6ed4('0x33')],_0x3534e8[_0x6ed4('0x30')]);_0x5d2c53['attributes']=_[_0x6ed4('0x32')](_0x3534e8[_0x6ed4('0x33')],qs[_0x6ed4('0x34')](_0x42b053['query'][_0x6ed4('0x34')]));_0x5d2c53['attributes']=_0x5d2c53[_0x6ed4('0x35')]['length']?_0x5d2c53[_0x6ed4('0x35')]:_0x3534e8['model'];if(!_0x42b053[_0x6ed4('0x30')]['hasOwnProperty'](_0x6ed4('0x36'))){_0x5d2c53[_0x6ed4('0x1b')]=qs[_0x6ed4('0x1b')](_0x42b053[_0x6ed4('0x30')][_0x6ed4('0x1b')]);_0x5d2c53[_0x6ed4('0x1e')]=qs[_0x6ed4('0x1e')](_0x42b053['query'][_0x6ed4('0x1e')]);}_0x5d2c53['order']=qs[_0x6ed4('0x37')](_0x42b053[_0x6ed4('0x30')][_0x6ed4('0x37')]);_0x5d2c53['where']=qs['filters'](_[_0x6ed4('0x38')](_0x42b053[_0x6ed4('0x30')],_0x3534e8[_0x6ed4('0x39')]),_0x3b423d);if(_0x42b053[_0x6ed4('0x30')][_0x6ed4('0x3a')]){_0x5d2c53[_0x6ed4('0x3b')]=_[_0x6ed4('0x3c')](_0x5d2c53[_0x6ed4('0x3b')],{'$or':_['map'](_0x3b423d,function(_0x1dc6d4){if(_0x1dc6d4[_0x6ed4('0x2f')]!=='VIRTUAL'){var _0x5f0779={};_0x5f0779[_0x1dc6d4[_0x6ed4('0x29')]]={'$like':'%'+_0x42b053[_0x6ed4('0x30')][_0x6ed4('0x3a')]+'%'};return _0x5f0779;}})});}_0x5d2c53=_[_0x6ed4('0x3c')]({},_0x5d2c53,_0x42b053[_0x6ed4('0x3d')]);var _0x1faa44={'where':_0x5d2c53[_0x6ed4('0x3b')]};return db['SquareDetailsReport'][_0x6ed4('0x1d')](_0x1faa44)['then'](function(_0x1c197b){_0x3f2b4f['count']=_0x1c197b;if(_0x42b053[_0x6ed4('0x30')][_0x6ed4('0x3e')]){_0x5d2c53[_0x6ed4('0x3f')]=[{'all':!![]}];}return db[_0x6ed4('0x2c')][_0x6ed4('0x40')](_0x5d2c53);})[_0x6ed4('0x24')](function(_0x315caa){_0x3f2b4f[_0x6ed4('0x41')]=_0x315caa;return _0x3f2b4f;})[_0x6ed4('0x24')](respondWithFilteredResult(_0x57da80,_0x5d2c53))[_0x6ed4('0x42')](handleError(_0x57da80,null));};exports['show']=function(_0x346b44,_0x480d79){var _0x3896f8={'raw':!![],'where':{'id':_0x346b44[_0x6ed4('0x43')]['id']}},_0x50e99d={};_0x50e99d['model']=_[_0x6ed4('0x31')](db['SquareDetailsReport'][_0x6ed4('0x2d')]);_0x50e99d[_0x6ed4('0x30')]=_['keys'](_0x346b44[_0x6ed4('0x30')]);_0x50e99d['filters']=_[_0x6ed4('0x32')](_0x50e99d[_0x6ed4('0x33')],_0x50e99d[_0x6ed4('0x30')]);_0x3896f8[_0x6ed4('0x35')]=_['intersection'](_0x50e99d[_0x6ed4('0x33')],qs[_0x6ed4('0x34')](_0x346b44[_0x6ed4('0x30')][_0x6ed4('0x34')]));_0x3896f8[_0x6ed4('0x35')]=_0x3896f8[_0x6ed4('0x35')][_0x6ed4('0x44')]?_0x3896f8[_0x6ed4('0x35')]:_0x50e99d['model'];if(_0x346b44[_0x6ed4('0x30')][_0x6ed4('0x3e')]){_0x3896f8[_0x6ed4('0x3f')]=[{'all':!![]}];}_0x3896f8=_[_0x6ed4('0x3c')]({},_0x3896f8,_0x346b44[_0x6ed4('0x3d')]);return db['SquareDetailsReport'][_0x6ed4('0x45')](_0x3896f8)[_0x6ed4('0x24')](handleEntityNotFound(_0x480d79,null))[_0x6ed4('0x24')](respondWithResult(_0x480d79,null))[_0x6ed4('0x42')](handleError(_0x480d79,null));};exports[_0x6ed4('0x46')]=function(_0x5c0791,_0x293609){return db[_0x6ed4('0x2c')]['create'](_0x5c0791[_0x6ed4('0x47')],{})[_0x6ed4('0x24')](respondWithResult(_0x293609,0xc9))['catch'](handleError(_0x293609,null));};exports['update']=function(_0x3ba45b,_0x48c14e){if(_0x3ba45b['body']['id']){delete _0x3ba45b[_0x6ed4('0x47')]['id'];}return db[_0x6ed4('0x2c')][_0x6ed4('0x45')]({'where':{'id':_0x3ba45b[_0x6ed4('0x43')]['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x48c14e,null))['then'](saveUpdates(_0x3ba45b[_0x6ed4('0x47')],null))['then'](respondWithResult(_0x48c14e,null))['catch'](handleError(_0x48c14e,null));};exports[_0x6ed4('0x25')]=function(_0x43ffc0,_0x20c3e6){return db[_0x6ed4('0x2c')][_0x6ed4('0x45')]({'where':{'id':_0x43ffc0['params']['id']}})[_0x6ed4('0x24')](handleEntityNotFound(_0x20c3e6,null))[_0x6ed4('0x24')](removeEntity(_0x20c3e6,null))[_0x6ed4('0x42')](handleError(_0x20c3e6,null));};exports[_0x6ed4('0x48')]=function(_0x5139d,_0x41b349){return db[_0x6ed4('0x2c')][_0x6ed4('0x48')]()[_0x6ed4('0x24')](respondWithResult(_0x41b349,null))[_0x6ed4('0x42')](handleError(_0x41b349,null));}; \ No newline at end of file +var _0xc6fe=['offset','set','Content-Range','save','update','destroy','then','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xc6fe,0x158));var _0xec6f=function(_0x1cb37d,_0x3a1ae7){_0x1cb37d=_0x1cb37d-0x0;var _0x3b8714=_0xc6fe[_0x1cb37d];return _0x3b8714;};'use strict';var emlformat=require(_0xec6f('0x0'));var rimraf=require(_0xec6f('0x1'));var zipdir=require(_0xec6f('0x2'));var jsonpatch=require(_0xec6f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xec6f('0x4'));var Mustache=require(_0xec6f('0x5'));var util=require(_0xec6f('0x6'));var path=require('path');var sox=require(_0xec6f('0x7'));var csv=require(_0xec6f('0x8'));var ejs=require(_0xec6f('0x9'));var fs=require('fs');var fs_extra=require(_0xec6f('0xa'));var _=require('lodash');var squel=require(_0xec6f('0xb'));var crypto=require(_0xec6f('0xc'));var jsforce=require(_0xec6f('0xd'));var deskjs=require(_0xec6f('0xe'));var toCsv=require(_0xec6f('0x8'));var querystring=require(_0xec6f('0xf'));var Papa=require(_0xec6f('0x10'));var Redis=require('ioredis');var authService=require(_0xec6f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xec6f('0x12'));var hardwareService=require(_0xec6f('0x13'));var logger=require(_0xec6f('0x14'))(_0xec6f('0x15'));var utils=require(_0xec6f('0x16'));var config=require(_0xec6f('0x17'));var licenseUtil=require(_0xec6f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xab0602,_0x33148b){_0x33148b=_0x33148b||0xcc;return function(_0x276c03){if(_0x276c03){return _0xab0602[_0xec6f('0x19')](_0x33148b);}return _0xab0602[_0xec6f('0x1a')](_0x33148b)[_0xec6f('0x1b')]();};}function respondWithResult(_0x194896,_0x10b982){_0x10b982=_0x10b982||0xc8;return function(_0x30190f){if(_0x30190f){return _0x194896[_0xec6f('0x1a')](_0x10b982)[_0xec6f('0x1c')](_0x30190f);}};}function respondWithFilteredResult(_0xfebcf8,_0x8cdadb){return function(_0x88414c){if(_0x88414c){var _0x21115a=typeof _0x8cdadb['offset']===_0xec6f('0x1d')&&typeof _0x8cdadb['limit']===_0xec6f('0x1d');var _0x12cb9e=_0x88414c[_0xec6f('0x1e')];var _0x53363b=_0x21115a?0x0:_0x8cdadb['offset'];var _0x4a7146=_0x21115a?_0x88414c[_0xec6f('0x1e')]:_0x8cdadb[_0xec6f('0x1f')]+_0x8cdadb['limit'];var _0x19917a;if(_0x4a7146>=_0x12cb9e){_0x4a7146=_0x12cb9e;_0x19917a=0xc8;}else{_0x19917a=0xce;}_0xfebcf8['status'](_0x19917a);return _0xfebcf8[_0xec6f('0x20')](_0xec6f('0x21'),_0x53363b+'-'+_0x4a7146+'/'+_0x12cb9e)[_0xec6f('0x1c')](_0x88414c);}return null;};}function patchUpdates(_0x363986){return function(_0x2a57a6){try{jsonpatch['apply'](_0x2a57a6,_0x363986,!![]);}catch(_0x27775b){return BPromise['reject'](_0x27775b);}return _0x2a57a6[_0xec6f('0x22')]();};}function saveUpdates(_0x398e92,_0x5a1580){return function(_0x56ca7a){if(_0x56ca7a){return _0x56ca7a[_0xec6f('0x23')](_0x398e92)['then'](function(_0x41f72b){return _0x41f72b;});}return null;};}function removeEntity(_0x398628,_0x1d473d){return function(_0x3be681){if(_0x3be681){return _0x3be681[_0xec6f('0x24')]()[_0xec6f('0x25')](function(){_0x398628[_0xec6f('0x1a')](0xcc)[_0xec6f('0x1b')]();});}};}function handleEntityNotFound(_0x341c60,_0x2394ed){return function(_0x67c5a2){if(!_0x67c5a2){_0x341c60[_0xec6f('0x19')](0x194);}return _0x67c5a2;};}function handleError(_0x432dc0,_0x1b4fef){_0x1b4fef=_0x1b4fef||0x1f4;return function(_0x14bb63){logger['error'](_0x14bb63[_0xec6f('0x26')]);if(_0x14bb63[_0xec6f('0x27')]){delete _0x14bb63[_0xec6f('0x27')];}_0x432dc0[_0xec6f('0x1a')](_0x1b4fef)[_0xec6f('0x28')](_0x14bb63);};}exports['index']=function(_0x222842,_0x416a72){var _0x1897f0={},_0x5583ff={},_0x1e77fc={'count':0x0,'rows':[]};var _0x73a1c0=_[_0xec6f('0x29')](db[_0xec6f('0x2a')][_0xec6f('0x2b')],function(_0x15bb2e){return{'name':_0x15bb2e[_0xec6f('0x2c')],'type':_0x15bb2e[_0xec6f('0x2d')]['key']};});_0x5583ff['model']=_[_0xec6f('0x29')](_0x73a1c0,_0xec6f('0x27'));_0x5583ff['query']=_[_0xec6f('0x2e')](_0x222842[_0xec6f('0x2f')]);_0x5583ff[_0xec6f('0x30')]=_[_0xec6f('0x31')](_0x5583ff[_0xec6f('0x32')],_0x5583ff[_0xec6f('0x2f')]);_0x1897f0[_0xec6f('0x33')]=_[_0xec6f('0x31')](_0x5583ff[_0xec6f('0x32')],qs['fields'](_0x222842[_0xec6f('0x2f')]['fields']));_0x1897f0[_0xec6f('0x33')]=_0x1897f0[_0xec6f('0x33')][_0xec6f('0x34')]?_0x1897f0[_0xec6f('0x33')]:_0x5583ff[_0xec6f('0x32')];if(!_0x222842[_0xec6f('0x2f')][_0xec6f('0x35')](_0xec6f('0x36'))){_0x1897f0[_0xec6f('0x37')]=qs[_0xec6f('0x37')](_0x222842['query']['limit']);_0x1897f0[_0xec6f('0x1f')]=qs[_0xec6f('0x1f')](_0x222842[_0xec6f('0x2f')]['offset']);}_0x1897f0['order']=qs['sort'](_0x222842[_0xec6f('0x2f')][_0xec6f('0x38')]);_0x1897f0[_0xec6f('0x39')]=qs[_0xec6f('0x30')](_[_0xec6f('0x3a')](_0x222842[_0xec6f('0x2f')],_0x5583ff['filters']),_0x73a1c0);if(_0x222842[_0xec6f('0x2f')][_0xec6f('0x3b')]){_0x1897f0[_0xec6f('0x39')]=_[_0xec6f('0x3c')](_0x1897f0[_0xec6f('0x39')],{'$or':_[_0xec6f('0x29')](_0x73a1c0,function(_0x28a96c){if(_0x28a96c['type']!==_0xec6f('0x3d')){var _0x1ff2c9={};_0x1ff2c9[_0x28a96c[_0xec6f('0x27')]]={'$like':'%'+_0x222842['query'][_0xec6f('0x3b')]+'%'};return _0x1ff2c9;}})});}_0x1897f0=_[_0xec6f('0x3c')]({},_0x1897f0,_0x222842[_0xec6f('0x3e')]);var _0xc5a0d5={'where':_0x1897f0[_0xec6f('0x39')]};return db['SquareDetailsReport']['count'](_0xc5a0d5)[_0xec6f('0x25')](function(_0x47bfc8){_0x1e77fc['count']=_0x47bfc8;if(_0x222842[_0xec6f('0x2f')]['includeAll']){_0x1897f0[_0xec6f('0x3f')]=[{'all':!![]}];}return db[_0xec6f('0x2a')][_0xec6f('0x40')](_0x1897f0);})[_0xec6f('0x25')](function(_0x515b8d){_0x1e77fc[_0xec6f('0x41')]=_0x515b8d;return _0x1e77fc;})[_0xec6f('0x25')](respondWithFilteredResult(_0x416a72,_0x1897f0))[_0xec6f('0x42')](handleError(_0x416a72,null));};exports[_0xec6f('0x43')]=function(_0x56d559,_0xa7bad9){var _0x3e4ce0={'raw':!![],'where':{'id':_0x56d559[_0xec6f('0x44')]['id']}},_0xaf8687={};_0xaf8687[_0xec6f('0x32')]=_[_0xec6f('0x2e')](db[_0xec6f('0x2a')][_0xec6f('0x2b')]);_0xaf8687[_0xec6f('0x2f')]=_[_0xec6f('0x2e')](_0x56d559[_0xec6f('0x2f')]);_0xaf8687[_0xec6f('0x30')]=_[_0xec6f('0x31')](_0xaf8687[_0xec6f('0x32')],_0xaf8687[_0xec6f('0x2f')]);_0x3e4ce0['attributes']=_[_0xec6f('0x31')](_0xaf8687[_0xec6f('0x32')],qs[_0xec6f('0x45')](_0x56d559[_0xec6f('0x2f')][_0xec6f('0x45')]));_0x3e4ce0['attributes']=_0x3e4ce0['attributes'][_0xec6f('0x34')]?_0x3e4ce0['attributes']:_0xaf8687['model'];if(_0x56d559['query'][_0xec6f('0x46')]){_0x3e4ce0[_0xec6f('0x3f')]=[{'all':!![]}];}_0x3e4ce0=_[_0xec6f('0x3c')]({},_0x3e4ce0,_0x56d559[_0xec6f('0x3e')]);return db[_0xec6f('0x2a')]['find'](_0x3e4ce0)[_0xec6f('0x25')](handleEntityNotFound(_0xa7bad9,null))[_0xec6f('0x25')](respondWithResult(_0xa7bad9,null))['catch'](handleError(_0xa7bad9,null));};exports[_0xec6f('0x47')]=function(_0xa93ab6,_0x2dbe99){return db['SquareDetailsReport'][_0xec6f('0x47')](_0xa93ab6['body'],{})[_0xec6f('0x25')](respondWithResult(_0x2dbe99,0xc9))[_0xec6f('0x42')](handleError(_0x2dbe99,null));};exports[_0xec6f('0x23')]=function(_0x54a591,_0x2aa124){if(_0x54a591[_0xec6f('0x48')]['id']){delete _0x54a591[_0xec6f('0x48')]['id'];}return db[_0xec6f('0x2a')][_0xec6f('0x49')]({'where':{'id':_0x54a591['params']['id']}})[_0xec6f('0x25')](handleEntityNotFound(_0x2aa124,null))['then'](saveUpdates(_0x54a591[_0xec6f('0x48')],null))[_0xec6f('0x25')](respondWithResult(_0x2aa124,null))[_0xec6f('0x42')](handleError(_0x2aa124,null));};exports[_0xec6f('0x24')]=function(_0x7fa0a2,_0x32b828){return db[_0xec6f('0x2a')][_0xec6f('0x49')]({'where':{'id':_0x7fa0a2['params']['id']}})['then'](handleEntityNotFound(_0x32b828,null))[_0xec6f('0x25')](removeEntity(_0x32b828,null))['catch'](handleError(_0x32b828,null));};exports[_0xec6f('0x4a')]=function(_0x1ff4a4,_0x726522){return db[_0xec6f('0x2a')][_0xec6f('0x4a')]()['then'](respondWithResult(_0x726522,null))[_0xec6f('0x42')](handleError(_0x726522,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index aae884b..41a57d7 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 _0x7be4=['exports','define','SquareDetailsReport','report_square_details','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x7be4,0x1be));var _0x47be=function(_0x53bcd9,_0x3bac40){_0x53bcd9=_0x53bcd9-0x0;var _0x51aa59=_0x7be4[_0x53bcd9];return _0x51aa59;};'use strict';var _=require(_0x47be('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x47be('0x1'));var moment=require(_0x47be('0x2'));var BPromise=require(_0x47be('0x3'));var rp=require(_0x47be('0x4'));var fs=require('fs');var path=require(_0x47be('0x5'));var rimraf=require(_0x47be('0x6'));var config=require(_0x47be('0x7'));var attributes=require(_0x47be('0x8'));module[_0x47be('0x9')]=function(_0x52c2ea,_0x341697){return _0x52c2ea[_0x47be('0xa')](_0x47be('0xb'),attributes,{'tableName':_0x47be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0d0=['request-promise','path','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','bluebird'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0xb0d0,0x1df));var _0x0b0d=function(_0x34ac7c,_0x4beec4){_0x34ac7c=_0x34ac7c-0x0;var _0x329c13=_0xb0d0[_0x34ac7c];return _0x329c13;};'use strict';var _=require('lodash');var util=require(_0x0b0d('0x0'));var logger=require(_0x0b0d('0x1'))(_0x0b0d('0x2'));var moment=require(_0x0b0d('0x3'));var BPromise=require(_0x0b0d('0x4'));var rp=require(_0x0b0d('0x5'));var fs=require('fs');var path=require(_0x0b0d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0b0d('0x7'));module[_0x0b0d('0x8')]=function(_0x107a7f,_0x3eaec4){return _0x107a7f['define'](_0x0b0d('0x9'),attributes,{'tableName':_0x0b0d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 3c65c42..74c00f2 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 _0x065e=['ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','catch','lodash','randomstring'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x065e,0x1a7));var _0xe065=function(_0x2d0223,_0x5f1ce4){_0x2d0223=_0x2d0223-0x0;var _0x29779a=_0x065e[_0x2d0223];return _0x29779a;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x189d72,_0x52403a,_0x267122){return new BPromise(function(_0x5afbd4,_0x273e22){return client[_0xe065('0x8')](_0x189d72,_0x267122)[_0xe065('0x9')](function(_0x114497){logger[_0xe065('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x52403a,_0xe065('0xb'));logger[_0xe065('0xc')](_0xe065('0xd'),_0x52403a,_0xe065('0xb'),JSON[_0xe065('0xe')](_0x114497));if(_0x114497[_0xe065('0xf')]){if(_0x114497['error']['code']===0x1f4){logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x273e22(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x5afbd4(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}else{logger[_0xe065('0xa')](_0xe065('0x10'),_0x52403a,_0xe065('0xb'));_0x5afbd4(_0x114497[_0xe065('0x12')][_0xe065('0x11')]);}})['catch'](function(_0x1ba88d){logger[_0xe065('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x52403a,_0x1ba88d);_0x273e22(_0x1ba88d);});});}exports[_0xe065('0x13')]=function(_0x1d2f7a){var _0x397f05=this;return new Promise(function(_0x14c97c,_0x1e7177){return db[_0xe065('0x14')][_0xe065('0x15')](_0x1d2f7a['body'],{'raw':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a['options'][_0xe065('0x17')]===undefined?!![]:![]:!![]})[_0xe065('0x9')](function(_0x55f55c){logger[_0xe065('0xa')]('CreateSquareDetailsReport',_0x1d2f7a);logger[_0xe065('0xc')](_0xe065('0x13'),_0x1d2f7a,JSON[_0xe065('0xe')](_0x55f55c));_0x14c97c(_0x55f55c);})[_0xe065('0x18')](function(_0x3ecd13){logger[_0xe065('0xf')](_0xe065('0x13'),_0x3ecd13[_0xe065('0x11')],_0x1d2f7a);_0x1e7177(_0x397f05[_0xe065('0xf')](0x1f4,_0x3ecd13['message']));});});}; \ No newline at end of file +var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util'];(function(_0x52f669,_0x64641c){var _0x150690=function(_0x20c0bb){while(--_0x20c0bb){_0x52f669['push'](_0x52f669['shift']());}};_0x150690(++_0x64641c);}(_0xb62e,0x1de));var _0xeb62=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb62e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});}exports[_0xeb62('0x18')]=function(_0x39b138){var _0x27fd84=this;return new Promise(function(_0x27efc8,_0x11d516){return db[_0xeb62('0x19')]['create'](_0x39b138[_0xeb62('0x1a')],{'raw':_0x39b138[_0xeb62('0x1b')]?_0x39b138[_0xeb62('0x1b')][_0xeb62('0x1c')]===undefined?!![]:![]:!![]})[_0xeb62('0x1d')](function(_0x24cbf3){logger[_0xeb62('0xd')]('CreateSquareDetailsReport',_0x39b138);logger['debug'](_0xeb62('0x18'),_0x39b138,JSON[_0xeb62('0x12')](_0x24cbf3));_0x27efc8(_0x24cbf3);})[_0xeb62('0x17')](function(_0x13243f){logger[_0xeb62('0x13')]('CreateSquareDetailsReport',_0x13243f['message'],_0x39b138);_0x11d516(_0x27fd84[_0xeb62('0x13')](0x1f4,_0x13243f[_0xeb62('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3692fc5..e6db911 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 _0xa664=['exports','Router','./system.controller','isAuthenticated','index','get','/process/:pid/kill','killProcess'];(function(_0x592cea,_0x4e72f1){var _0x1e9cc6=function(_0x166217){while(--_0x166217){_0x592cea['push'](_0x592cea['shift']());}};_0x1e9cc6(++_0x4e72f1);}(_0xa664,0x1b9));var _0x4a66=function(_0x360b1a,_0x6d4fb){_0x360b1a=_0x360b1a-0x0;var _0x47aa81=_0xa664[_0x360b1a];return _0x47aa81;};'use strict';var express=require('express');var router=express[_0x4a66('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x4a66('0x1'));router['get']('/',auth[_0x4a66('0x2')](),controller[_0x4a66('0x3')]);router[_0x4a66('0x4')](_0x4a66('0x5'),auth[_0x4a66('0x2')](),controller[_0x4a66('0x6')]);module[_0x4a66('0x7')]=router; \ No newline at end of file +var _0xf594=['index','/process/:pid/kill','exports','express','Router','get'];(function(_0x3fcca7,_0x27dfb1){var _0x489ed4=function(_0x31dafe){while(--_0x31dafe){_0x3fcca7['push'](_0x3fcca7['shift']());}};_0x489ed4(++_0x27dfb1);}(_0xf594,0x1d1));var _0x4f59=function(_0x185ae4,_0x294e7a){_0x185ae4=_0x185ae4-0x0;var _0x3df401=_0xf594[_0x185ae4];return _0x3df401;};'use strict';var express=require(_0x4f59('0x0'));var router=express[_0x4f59('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x4f59('0x2')]('/',auth['isAuthenticated'](),controller[_0x4f59('0x3')]);router['get'](_0x4f59('0x4'),auth['isAuthenticated'](),controller['killProcess']);module[_0x4f59('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5212a3b..6c1df43 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 _0xd202=['killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','error','inspect','name','getAllData','then','status','json','catch'];(function(_0x3f0d04,_0x45a272){var _0x4b65b8=function(_0x394084){while(--_0x394084){_0x3f0d04['push'](_0x3f0d04['shift']());}};_0x4b65b8(++_0x45a272);}(_0xd202,0x15a));var _0x2d20=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd202[_0x7e2eb0];return _0xd92de4;};'use strict';var info=require(_0x2d20('0x0'));var exec=require(_0x2d20('0x1'))[_0x2d20('0x2')];var logger=require(_0x2d20('0x3'))(_0x2d20('0x4'));var util=require(_0x2d20('0x5'));var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x23a1d7,_0x271856,_0x414535){_0x271856=_0x271856||0x1f4;return function(_0x5df17f){logger[_0x2d20('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x414535,_0x271856,util[_0x2d20('0x7')](_0x5df17f,{'showHidden':![],'depth':null}));delete _0x5df17f[_0x2d20('0x8')];_0x23a1d7['status'](_0x271856)['send'](_0x5df17f);};}exports['index']=function(_0x3c228c,_0x33e016){return info[_0x2d20('0x9')]()[_0x2d20('0xa')](function(_0x556b9b){return _0x33e016[_0x2d20('0xb')](0xc8)[_0x2d20('0xc')](_0x556b9b);})[_0x2d20('0xd')](function(_0x21c07d){return _0x33e016[_0x2d20('0xb')](0x1f4)[_0x2d20('0xc')](_0x21c07d);});};exports[_0x2d20('0xe')]=function(_0x49fc03,_0x27bee0){var _0x5304db=[_0x2d20('0xf')];return new BPromise(function(_0x31d84d,_0x7c1fc9){return exec(util[_0x2d20('0x10')](_0x2d20('0x11'),_0x49fc03[_0x2d20('0x12')][_0x2d20('0x13')]),function(_0x30dd4c,_0x267a03,_0x3dad85){if(_0x30dd4c){return _0x7c1fc9(_0x30dd4c);}return _0x31d84d(_0x267a03);});})[_0x2d20('0xa')](function(_0x6029f7){var _0x124015=![];var _0x15098f=_0x6029f7['split'](/\n/);for(var _0x20a499=0x0,_0x3cc7ea=_0x5304db['length'];_0x20a499<_0x3cc7ea,_0x124015===![];_0x20a499+=0x1){if(_0x6029f7[_0x2d20('0x14')](_0x5304db[_0x20a499])>=0x0){_0x124015=!![];}}if(!_0x124015){throw new Error(util['format'](_0x2d20('0x15'),_0x49fc03['params'][_0x2d20('0x13')]));}process[_0x2d20('0x16')](_0x49fc03[_0x2d20('0x12')][_0x2d20('0x13')],_0x2d20('0x17'));return _0x27bee0[_0x2d20('0xb')](0xc8)[_0x2d20('0xc')]({'message':util[_0x2d20('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x49fc03[_0x2d20('0x12')][_0x2d20('0x13')])});})[_0x2d20('0xd')](handleError(_0x27bee0,null,_0x2d20('0xe')));}; \ No newline at end of file +var _0xe48c=['util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api'];(function(_0x116ecc,_0x30f13f){var _0x355701=function(_0x535982){while(--_0x535982){_0x116ecc['push'](_0x116ecc['shift']());}};_0x355701(++_0x30f13f);}(_0xe48c,0x19d));var _0xce48=function(_0x55c0fe,_0x24ebad){_0x55c0fe=_0x55c0fe-0x0;var _0x2ac363=_0xe48c[_0x55c0fe];return _0x2ac363;};'use strict';var info=require('systeminformation');var exec=require(_0xce48('0x0'))['exec'];var logger=require(_0xce48('0x1'))(_0xce48('0x2'));var util=require(_0xce48('0x3'));var BPromise=require(_0xce48('0x4'));var _=require('lodash');function handleError(_0x4ca935,_0x539954,_0xc7329e){_0x539954=_0x539954||0x1f4;return function(_0x25f979){logger[_0xce48('0x5')](_0xce48('0x6'),_0xc7329e,_0x539954,util[_0xce48('0x7')](_0x25f979,{'showHidden':![],'depth':null}));delete _0x25f979[_0xce48('0x8')];_0x4ca935['status'](_0x539954)[_0xce48('0x9')](_0x25f979);};}exports[_0xce48('0xa')]=function(_0x33611b,_0x4d61fe){return info['getAllData']()[_0xce48('0xb')](function(_0x2e6646){return _0x4d61fe[_0xce48('0xc')](0xc8)[_0xce48('0xd')](_0x2e6646);})[_0xce48('0xe')](function(_0x1d1ebf){return _0x4d61fe['status'](0x1f4)[_0xce48('0xd')](_0x1d1ebf);});};exports[_0xce48('0xf')]=function(_0x4e6ffe,_0x49fba6){var _0x448ad0=[_0xce48('0x10')];return new BPromise(function(_0x1bc5c5,_0x2d4912){return exec(util[_0xce48('0x11')](_0xce48('0x12'),_0x4e6ffe[_0xce48('0x13')][_0xce48('0x14')]),function(_0xac2dd7,_0x202443,_0x2ad996){if(_0xac2dd7){return _0x2d4912(_0xac2dd7);}return _0x1bc5c5(_0x202443);});})[_0xce48('0xb')](function(_0x37f20d){var _0x4eb49b=![];var _0x544dec=_0x37f20d[_0xce48('0x15')](/\n/);for(var _0x3533d9=0x0,_0xc414be=_0x448ad0[_0xce48('0x16')];_0x3533d9<_0xc414be,_0x4eb49b===![];_0x3533d9+=0x1){if(_0x37f20d['indexOf'](_0x448ad0[_0x3533d9])>=0x0){_0x4eb49b=!![];}}if(!_0x4eb49b){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x4e6ffe[_0xce48('0x13')]['pid']));}process[_0xce48('0x17')](_0x4e6ffe[_0xce48('0x13')][_0xce48('0x14')],_0xce48('0x18'));return _0x49fba6['status'](0xc8)[_0xce48('0xd')]({'message':util[_0xce48('0x11')](_0xce48('0x19'),_0x4e6ffe[_0xce48('0x13')][_0xce48('0x14')])});})[_0xce48('0xe')](handleError(_0x49fba6,null,_0xce48('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 2f402bd..49f58e7 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 _0x705f=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','show','post','put','/:id','update'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x705f,0x1f0));var _0xf705=function(_0x1155e6,_0x233e73){_0x1155e6=_0x1155e6-0x0;var _0x35dd79=_0x705f[_0x1155e6];return _0x35dd79;};'use strict';var multer=require('multer');var util=require(_0xf705('0x0'));var path=require(_0xf705('0x1'));var timeout=require(_0xf705('0x2'));var express=require(_0xf705('0x3'));var router=express[_0xf705('0x4')]();var fs_extra=require(_0xf705('0x5'));var auth=require(_0xf705('0x6'));var interaction=require(_0xf705('0x7'));var config=require(_0xf705('0x8'));var controller=require(_0xf705('0x9'));router[_0xf705('0xa')]('/',auth[_0xf705('0xb')](),controller['index']);router[_0xf705('0xa')]('/:id',auth[_0xf705('0xb')](),controller[_0xf705('0xc')]);router[_0xf705('0xd')]('/',auth[_0xf705('0xb')](),controller['create']);router[_0xf705('0xe')](_0xf705('0xf'),auth[_0xf705('0xb')](),controller[_0xf705('0x10')]);router[_0xf705('0x11')](_0xf705('0xf'),auth[_0xf705('0xb')](),controller[_0xf705('0x12')]);module['exports']=router; \ No newline at end of file +var _0x55a6=['put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','show','post','create'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x55a6,0x74));var _0x655a=function(_0x5c06a2,_0x3372b4){_0x5c06a2=_0x5c06a2-0x0;var _0x5d7bcb=_0x55a6[_0x5c06a2];return _0x5d7bcb;};'use strict';var multer=require(_0x655a('0x0'));var util=require(_0x655a('0x1'));var path=require(_0x655a('0x2'));var timeout=require(_0x655a('0x3'));var express=require(_0x655a('0x4'));var router=express[_0x655a('0x5')]();var fs_extra=require(_0x655a('0x6'));var auth=require(_0x655a('0x7'));var interaction=require(_0x655a('0x8'));var config=require('../../config/environment');var controller=require(_0x655a('0x9'));router[_0x655a('0xa')]('/',auth[_0x655a('0xb')](),controller[_0x655a('0xc')]);router[_0x655a('0xa')]('/:id',auth[_0x655a('0xb')](),controller[_0x655a('0xd')]);router[_0x655a('0xe')]('/',auth[_0x655a('0xb')](),controller[_0x655a('0xf')]);router[_0x655a('0x10')]('/:id',auth[_0x655a('0xb')](),controller[_0x655a('0x11')]);router[_0x655a('0x12')](_0x655a('0x13'),auth[_0x655a('0xb')](),controller[_0x655a('0x14')]);module[_0x655a('0x15')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 03b7f17..731ece0 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 _0x6c9c=['name','STRING','#0091EA','sequelize','exports'];(function(_0x36327c,_0x21f0dd){var _0x3a2681=function(_0x5c8461){while(--_0x5c8461){_0x36327c['push'](_0x36327c['shift']());}};_0x3a2681(++_0x21f0dd);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x3abfb7,_0x38afa3){_0x3abfb7=_0x3abfb7-0x0;var _0x3f4ffd=_0x6c9c[_0x3abfb7];return _0x3f4ffd;};'use strict';var Sequelize=require(_0xc6c9('0x0'));module[_0xc6c9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc6c9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc6c9('0x3')],'defaultValue':_0xc6c9('0x4')},'description':{'type':Sequelize[_0xc6c9('0x3')]}}; \ No newline at end of file +var _0x7d98=['STRING','name','#0091EA','sequelize'];(function(_0x450d5b,_0x639c78){var _0x18f6cd=function(_0x2ddca0){while(--_0x2ddca0){_0x450d5b['push'](_0x450d5b['shift']());}};_0x18f6cd(++_0x639c78);}(_0x7d98,0xe7));var _0x87d9=function(_0x39872b,_0x343e6b){_0x39872b=_0x39872b-0x0;var _0x55fa18=_0x7d98[_0x39872b];return _0x55fa18;};'use strict';var Sequelize=require(_0x87d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x87d9('0x1')],'unique':_0x87d9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x87d9('0x1')],'defaultValue':_0x87d9('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 704d62b..1c7f2b7 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 _0xe644=['type','options','includeAll','include','findAll','rows','show','params','keys','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','then','destroy','get','Tags','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4e64('0x0'));var rimraf=require(_0x4e64('0x1'));var zipdir=require(_0x4e64('0x2'));var jsonpatch=require(_0x4e64('0x3'));var rp=require(_0x4e64('0x4'));var moment=require(_0x4e64('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e64('0x6'));var util=require(_0x4e64('0x7'));var path=require(_0x4e64('0x8'));var sox=require(_0x4e64('0x9'));var csv=require(_0x4e64('0xa'));var ejs=require(_0x4e64('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e64('0xc'));var squel=require(_0x4e64('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4e64('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4e64('0xf'));var Redis=require(_0x4e64('0x10'));var authService=require(_0x4e64('0x11'));var qs=require(_0x4e64('0x12'));var as=require(_0x4e64('0x13'));var hardwareService=require(_0x4e64('0x14'));var logger=require('../../config/logger')(_0x4e64('0x15'));var utils=require(_0x4e64('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4e64('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c7ce0,_0x573e67){_0x573e67=_0x573e67||0xcc;return function(_0x4c1cf3){if(_0x4c1cf3){return _0x4c7ce0[_0x4e64('0x18')](_0x573e67);}return _0x4c7ce0[_0x4e64('0x19')](_0x573e67)[_0x4e64('0x1a')]();};}function respondWithResult(_0x2aa800,_0x352eca){_0x352eca=_0x352eca||0xc8;return function(_0xb36502){if(_0xb36502){return _0x2aa800[_0x4e64('0x19')](_0x352eca)['json'](_0xb36502);}};}function respondWithFilteredResult(_0x1d274c,_0x5573af){return function(_0x78cdc6){if(_0x78cdc6){var _0x5b35b0=typeof _0x5573af[_0x4e64('0x1b')]===_0x4e64('0x1c')&&typeof _0x5573af[_0x4e64('0x1d')]===_0x4e64('0x1c');var _0x2bbaaa=_0x78cdc6[_0x4e64('0x1e')];var _0x135ffb=_0x5b35b0?0x0:_0x5573af[_0x4e64('0x1b')];var _0x1be196=_0x5b35b0?_0x78cdc6[_0x4e64('0x1e')]:_0x5573af['offset']+_0x5573af[_0x4e64('0x1d')];var _0x112797;if(_0x1be196>=_0x2bbaaa){_0x1be196=_0x2bbaaa;_0x112797=0xc8;}else{_0x112797=0xce;}_0x1d274c['status'](_0x112797);return _0x1d274c[_0x4e64('0x1f')]('Content-Range',_0x135ffb+'-'+_0x1be196+'/'+_0x2bbaaa)['json'](_0x78cdc6);}return null;};}function patchUpdates(_0x18a1d3){return function(_0x120f14){try{jsonpatch[_0x4e64('0x20')](_0x120f14,_0x18a1d3,!![]);}catch(_0x4a97a4){return BPromise[_0x4e64('0x21')](_0x4a97a4);}return _0x120f14['save']();};}function saveUpdates(_0x30e356,_0x336c53){return function(_0x2df7a0){if(_0x2df7a0){return _0x2df7a0['update'](_0x30e356)[_0x4e64('0x22')](function(_0x58ea85){return _0x58ea85;});}return null;};}function removeEntity(_0x2431eb,_0x27d33e){return function(_0x445864){if(_0x445864){return _0x445864[_0x4e64('0x23')]()[_0x4e64('0x22')](function(){var _0x5abddb=_0x445864[_0x4e64('0x24')]({'plain':!![]});var _0x29b4f8=_0x4e64('0x25');return db['UserProfileResource'][_0x4e64('0x23')]({'where':{'type':_0x29b4f8,'resourceId':_0x5abddb['id']}})[_0x4e64('0x22')](function(){return _0x445864;});})[_0x4e64('0x22')](function(){_0x2431eb[_0x4e64('0x19')](0xcc)[_0x4e64('0x1a')]();});}};}function handleEntityNotFound(_0x5f0d42,_0x3185ba){return function(_0x2b1f2b){if(!_0x2b1f2b){_0x5f0d42[_0x4e64('0x18')](0x194);}return _0x2b1f2b;};}function handleError(_0x194f33,_0x39e5ed){_0x39e5ed=_0x39e5ed||0x1f4;return function(_0x1057d0){logger[_0x4e64('0x26')](_0x1057d0[_0x4e64('0x27')]);if(_0x1057d0['name']){delete _0x1057d0[_0x4e64('0x28')];}_0x194f33[_0x4e64('0x19')](_0x39e5ed)[_0x4e64('0x29')](_0x1057d0);};}exports[_0x4e64('0x2a')]=function(_0x3f00d5,_0x3b1f16){var _0x439b2f={},_0x4c4559={},_0x67698d={'count':0x0,'rows':[]};var _0x13c3e2=_[_0x4e64('0x2b')](db[_0x4e64('0x2c')][_0x4e64('0x2d')],function(_0x3d6cec){return{'name':_0x3d6cec[_0x4e64('0x2e')],'type':_0x3d6cec['type'][_0x4e64('0x2f')]};});_0x4c4559[_0x4e64('0x30')]=_[_0x4e64('0x2b')](_0x13c3e2,'name');_0x4c4559[_0x4e64('0x31')]=_['keys'](_0x3f00d5[_0x4e64('0x31')]);_0x4c4559[_0x4e64('0x32')]=_['intersection'](_0x4c4559['model'],_0x4c4559['query']);_0x439b2f[_0x4e64('0x33')]=_['intersection'](_0x4c4559[_0x4e64('0x30')],qs[_0x4e64('0x34')](_0x3f00d5[_0x4e64('0x31')][_0x4e64('0x34')]));_0x439b2f[_0x4e64('0x33')]=_0x439b2f[_0x4e64('0x33')][_0x4e64('0x35')]?_0x439b2f['attributes']:_0x4c4559[_0x4e64('0x30')];if(!_0x3f00d5['query'][_0x4e64('0x36')]('nolimit')){_0x439b2f['limit']=qs['limit'](_0x3f00d5[_0x4e64('0x31')]['limit']);_0x439b2f['offset']=qs[_0x4e64('0x1b')](_0x3f00d5[_0x4e64('0x31')][_0x4e64('0x1b')]);}_0x439b2f[_0x4e64('0x37')]=qs[_0x4e64('0x38')](_0x3f00d5[_0x4e64('0x31')][_0x4e64('0x38')]);_0x439b2f['where']=qs['filters'](_['pick'](_0x3f00d5[_0x4e64('0x31')],_0x4c4559[_0x4e64('0x32')]),_0x13c3e2);if(_0x3f00d5[_0x4e64('0x31')][_0x4e64('0x39')]){_0x439b2f['where']=_[_0x4e64('0x3a')](_0x439b2f[_0x4e64('0x3b')],{'$or':_[_0x4e64('0x2b')](_0x13c3e2,function(_0x2cea0f){if(_0x2cea0f[_0x4e64('0x3c')]!=='VIRTUAL'){var _0x4faf59={};_0x4faf59[_0x2cea0f[_0x4e64('0x28')]]={'$like':'%'+_0x3f00d5['query'][_0x4e64('0x39')]+'%'};return _0x4faf59;}})});}_0x439b2f=_[_0x4e64('0x3a')]({},_0x439b2f,_0x3f00d5[_0x4e64('0x3d')]);var _0x24e863={'where':_0x439b2f[_0x4e64('0x3b')]};return db[_0x4e64('0x2c')][_0x4e64('0x1e')](_0x24e863)['then'](function(_0x15ca67){_0x67698d[_0x4e64('0x1e')]=_0x15ca67;if(_0x3f00d5[_0x4e64('0x31')][_0x4e64('0x3e')]){_0x439b2f[_0x4e64('0x3f')]=[{'all':!![]}];}return db[_0x4e64('0x2c')][_0x4e64('0x40')](_0x439b2f);})[_0x4e64('0x22')](function(_0x496e6f){_0x67698d[_0x4e64('0x41')]=_0x496e6f;return _0x67698d;})[_0x4e64('0x22')](respondWithFilteredResult(_0x3b1f16,_0x439b2f))['catch'](handleError(_0x3b1f16,null));};exports[_0x4e64('0x42')]=function(_0x306b4d,_0x497f98){var _0xab75={'raw':!![],'where':{'id':_0x306b4d[_0x4e64('0x43')]['id']}},_0x1ddcf2={};_0x1ddcf2[_0x4e64('0x30')]=_[_0x4e64('0x44')](db['Tag'][_0x4e64('0x2d')]);_0x1ddcf2[_0x4e64('0x31')]=_[_0x4e64('0x44')](_0x306b4d[_0x4e64('0x31')]);_0x1ddcf2[_0x4e64('0x32')]=_[_0x4e64('0x45')](_0x1ddcf2[_0x4e64('0x30')],_0x1ddcf2[_0x4e64('0x31')]);_0xab75['attributes']=_['intersection'](_0x1ddcf2[_0x4e64('0x30')],qs[_0x4e64('0x34')](_0x306b4d[_0x4e64('0x31')]['fields']));_0xab75[_0x4e64('0x33')]=_0xab75[_0x4e64('0x33')][_0x4e64('0x35')]?_0xab75[_0x4e64('0x33')]:_0x1ddcf2[_0x4e64('0x30')];if(_0x306b4d['query'][_0x4e64('0x3e')]){_0xab75['include']=[{'all':!![]}];}_0xab75=_[_0x4e64('0x3a')]({},_0xab75,_0x306b4d[_0x4e64('0x3d')]);return db[_0x4e64('0x2c')][_0x4e64('0x46')](_0xab75)['then'](handleEntityNotFound(_0x497f98,null))[_0x4e64('0x22')](respondWithResult(_0x497f98,null))[_0x4e64('0x47')](handleError(_0x497f98,null));};exports[_0x4e64('0x48')]=function(_0x38a885,_0x32db0b){return db['Tag'][_0x4e64('0x48')](_0x38a885[_0x4e64('0x49')],{})[_0x4e64('0x22')](function(_0x1be224){var _0x2249fa=_0x38a885[_0x4e64('0x4a')]['get']({'plain':!![]});if(!_0x2249fa)throw new Error(_0x4e64('0x4b'));if(_0x2249fa[_0x4e64('0x4c')]===_0x4e64('0x4a')){var _0x4c2948=_0x1be224[_0x4e64('0x24')]({'plain':!![]});var _0x3cee8c='Tags';return db[_0x4e64('0x4d')]['find']({'where':{'name':_0x3cee8c,'userProfileId':_0x2249fa[_0x4e64('0x4e')]},'raw':!![]})['then'](function(_0x16d6fa){if(_0x16d6fa&&_0x16d6fa['autoAssociation']===0x0){return db[_0x4e64('0x4f')][_0x4e64('0x48')]({'name':_0x4c2948[_0x4e64('0x28')],'resourceId':_0x4c2948['id'],'type':_0x16d6fa[_0x4e64('0x28')],'sectionId':_0x16d6fa['id']},{})[_0x4e64('0x22')](function(){return _0x1be224;});}else{return _0x1be224;}})[_0x4e64('0x47')](function(_0x2d8682){logger['error'](_0x4e64('0x50'),_0x2d8682);throw _0x2d8682;});}return _0x1be224;})[_0x4e64('0x22')](respondWithResult(_0x32db0b,0xc9))[_0x4e64('0x47')](handleError(_0x32db0b,null));};exports['update']=function(_0x50cd6a,_0x9ddc22){if(_0x50cd6a['body']['id']){delete _0x50cd6a[_0x4e64('0x49')]['id'];}return db[_0x4e64('0x2c')][_0x4e64('0x46')]({'where':{'id':_0x50cd6a[_0x4e64('0x43')]['id']}})[_0x4e64('0x22')](handleEntityNotFound(_0x9ddc22,null))['then'](saveUpdates(_0x50cd6a['body'],null))[_0x4e64('0x22')](respondWithResult(_0x9ddc22,null))[_0x4e64('0x47')](handleError(_0x9ddc22,null));};exports[_0x4e64('0x23')]=function(_0x1a9dba,_0x3def87){return db[_0x4e64('0x2c')][_0x4e64('0x46')]({'where':{'id':_0x1a9dba[_0x4e64('0x43')]['id']}})['then'](handleEntityNotFound(_0x3def87,null))[_0x4e64('0x22')](removeEntity(_0x3def87,null))[_0x4e64('0x47')](handleError(_0x3def87,null));}; \ No newline at end of file +var _0xb717=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Tags','end','sendStatus','stack','name','send','map','Tag','rawAttributes','fieldName','type','model'];(function(_0x430821,_0x4f6a22){var _0x282fa0=function(_0x2386bc){while(--_0x2386bc){_0x430821['push'](_0x430821['shift']());}};_0x282fa0(++_0x4f6a22);}(_0xb717,0x1b4));var _0x7b71=function(_0x53e9f9,_0xfe79f9){_0x53e9f9=_0x53e9f9-0x0;var _0x46c9f2=_0xb717[_0x53e9f9];return _0x46c9f2;};'use strict';var emlformat=require(_0x7b71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b71('0x2'));var moment=require(_0x7b71('0x3'));var BPromise=require(_0x7b71('0x4'));var Mustache=require('mustache');var util=require(_0x7b71('0x5'));var path=require(_0x7b71('0x6'));var sox=require(_0x7b71('0x7'));var csv=require(_0x7b71('0x8'));var ejs=require(_0x7b71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b71('0xa'));var squel=require(_0x7b71('0xb'));var crypto=require(_0x7b71('0xc'));var jsforce=require(_0x7b71('0xd'));var deskjs=require(_0x7b71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b71('0xf'));var Papa=require(_0x7b71('0x10'));var Redis=require('ioredis');var authService=require(_0x7b71('0x11'));var qs=require(_0x7b71('0x12'));var as=require(_0x7b71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b71('0x14'))('api');var utils=require(_0x7b71('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7b71('0x16'));var db=require(_0x7b71('0x17'))['db'];function respondWithStatusCode(_0x291ba5,_0x101181){_0x101181=_0x101181||0xcc;return function(_0x45c890){if(_0x45c890){return _0x291ba5['sendStatus'](_0x101181);}return _0x291ba5[_0x7b71('0x18')](_0x101181)['end']();};}function respondWithResult(_0x121e8f,_0x22114a){_0x22114a=_0x22114a||0xc8;return function(_0x4f1f41){if(_0x4f1f41){return _0x121e8f[_0x7b71('0x18')](_0x22114a)[_0x7b71('0x19')](_0x4f1f41);}};}function respondWithFilteredResult(_0x4266e5,_0x5888f9){return function(_0x5e7c3a){if(_0x5e7c3a){var _0xadd51e=typeof _0x5888f9[_0x7b71('0x1a')]===_0x7b71('0x1b')&&typeof _0x5888f9[_0x7b71('0x1c')]==='undefined';var _0x268090=_0x5e7c3a['count'];var _0x4adce8=_0xadd51e?0x0:_0x5888f9[_0x7b71('0x1a')];var _0xbde25=_0xadd51e?_0x5e7c3a[_0x7b71('0x1d')]:_0x5888f9[_0x7b71('0x1a')]+_0x5888f9[_0x7b71('0x1c')];var _0x51d647;if(_0xbde25>=_0x268090){_0xbde25=_0x268090;_0x51d647=0xc8;}else{_0x51d647=0xce;}_0x4266e5[_0x7b71('0x18')](_0x51d647);return _0x4266e5[_0x7b71('0x1e')](_0x7b71('0x1f'),_0x4adce8+'-'+_0xbde25+'/'+_0x268090)[_0x7b71('0x19')](_0x5e7c3a);}return null;};}function patchUpdates(_0x206000){return function(_0x297918){try{jsonpatch['apply'](_0x297918,_0x206000,!![]);}catch(_0x459c8b){return BPromise[_0x7b71('0x20')](_0x459c8b);}return _0x297918[_0x7b71('0x21')]();};}function saveUpdates(_0x375f85,_0x47d933){return function(_0x55ed9c){if(_0x55ed9c){return _0x55ed9c[_0x7b71('0x22')](_0x375f85)[_0x7b71('0x23')](function(_0x467f1a){return _0x467f1a;});}return null;};}function removeEntity(_0x33ad80,_0x3aca34){return function(_0x478dd8){if(_0x478dd8){return _0x478dd8[_0x7b71('0x24')]()['then'](function(){var _0x16c1f3=_0x478dd8[_0x7b71('0x25')]({'plain':!![]});var _0x19a6f5=_0x7b71('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x19a6f5,'resourceId':_0x16c1f3['id']}})[_0x7b71('0x23')](function(){return _0x478dd8;});})[_0x7b71('0x23')](function(){_0x33ad80['status'](0xcc)[_0x7b71('0x27')]();});}};}function handleEntityNotFound(_0x214555,_0x7c978b){return function(_0x2f9ca9){if(!_0x2f9ca9){_0x214555[_0x7b71('0x28')](0x194);}return _0x2f9ca9;};}function handleError(_0x5209b6,_0x55ae81){_0x55ae81=_0x55ae81||0x1f4;return function(_0x2b323b){logger['error'](_0x2b323b[_0x7b71('0x29')]);if(_0x2b323b['name']){delete _0x2b323b[_0x7b71('0x2a')];}_0x5209b6[_0x7b71('0x18')](_0x55ae81)[_0x7b71('0x2b')](_0x2b323b);};}exports['index']=function(_0x1e4e89,_0xc29e2b){var _0x21ef65={},_0x5b5a4b={},_0x5e11e1={'count':0x0,'rows':[]};var _0xd100d4=_[_0x7b71('0x2c')](db[_0x7b71('0x2d')][_0x7b71('0x2e')],function(_0x43925c){return{'name':_0x43925c[_0x7b71('0x2f')],'type':_0x43925c[_0x7b71('0x30')]['key']};});_0x5b5a4b[_0x7b71('0x31')]=_[_0x7b71('0x2c')](_0xd100d4,_0x7b71('0x2a'));_0x5b5a4b['query']=_[_0x7b71('0x32')](_0x1e4e89[_0x7b71('0x33')]);_0x5b5a4b[_0x7b71('0x34')]=_[_0x7b71('0x35')](_0x5b5a4b[_0x7b71('0x31')],_0x5b5a4b[_0x7b71('0x33')]);_0x21ef65['attributes']=_[_0x7b71('0x35')](_0x5b5a4b[_0x7b71('0x31')],qs[_0x7b71('0x36')](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x36')]));_0x21ef65['attributes']=_0x21ef65[_0x7b71('0x37')][_0x7b71('0x38')]?_0x21ef65[_0x7b71('0x37')]:_0x5b5a4b[_0x7b71('0x31')];if(!_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x39')](_0x7b71('0x3a'))){_0x21ef65[_0x7b71('0x1c')]=qs['limit'](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x1c')]);_0x21ef65[_0x7b71('0x1a')]=qs[_0x7b71('0x1a')](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x1a')]);}_0x21ef65[_0x7b71('0x3b')]=qs['sort'](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3c')]);_0x21ef65[_0x7b71('0x3d')]=qs[_0x7b71('0x34')](_['pick'](_0x1e4e89[_0x7b71('0x33')],_0x5b5a4b[_0x7b71('0x34')]),_0xd100d4);if(_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3e')]){_0x21ef65[_0x7b71('0x3d')]=_[_0x7b71('0x3f')](_0x21ef65[_0x7b71('0x3d')],{'$or':_[_0x7b71('0x2c')](_0xd100d4,function(_0x30e9d1){if(_0x30e9d1[_0x7b71('0x30')]!==_0x7b71('0x40')){var _0x154dd5={};_0x154dd5[_0x30e9d1['name']]={'$like':'%'+_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3e')]+'%'};return _0x154dd5;}})});}_0x21ef65=_['merge']({},_0x21ef65,_0x1e4e89[_0x7b71('0x41')]);var _0x411c57={'where':_0x21ef65[_0x7b71('0x3d')]};return db[_0x7b71('0x2d')][_0x7b71('0x1d')](_0x411c57)['then'](function(_0x37cf27){_0x5e11e1[_0x7b71('0x1d')]=_0x37cf27;if(_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x42')]){_0x21ef65[_0x7b71('0x43')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x21ef65);})[_0x7b71('0x23')](function(_0x541730){_0x5e11e1[_0x7b71('0x44')]=_0x541730;return _0x5e11e1;})[_0x7b71('0x23')](respondWithFilteredResult(_0xc29e2b,_0x21ef65))[_0x7b71('0x45')](handleError(_0xc29e2b,null));};exports[_0x7b71('0x46')]=function(_0x3c3ffb,_0x324b28){var _0x23a762={'raw':!![],'where':{'id':_0x3c3ffb[_0x7b71('0x47')]['id']}},_0x5b73a6={};_0x5b73a6[_0x7b71('0x31')]=_['keys'](db[_0x7b71('0x2d')][_0x7b71('0x2e')]);_0x5b73a6[_0x7b71('0x33')]=_[_0x7b71('0x32')](_0x3c3ffb[_0x7b71('0x33')]);_0x5b73a6[_0x7b71('0x34')]=_[_0x7b71('0x35')](_0x5b73a6[_0x7b71('0x31')],_0x5b73a6[_0x7b71('0x33')]);_0x23a762[_0x7b71('0x37')]=_[_0x7b71('0x35')](_0x5b73a6[_0x7b71('0x31')],qs[_0x7b71('0x36')](_0x3c3ffb['query'][_0x7b71('0x36')]));_0x23a762[_0x7b71('0x37')]=_0x23a762['attributes']['length']?_0x23a762['attributes']:_0x5b73a6[_0x7b71('0x31')];if(_0x3c3ffb[_0x7b71('0x33')][_0x7b71('0x42')]){_0x23a762['include']=[{'all':!![]}];}_0x23a762=_[_0x7b71('0x3f')]({},_0x23a762,_0x3c3ffb[_0x7b71('0x41')]);return db['Tag'][_0x7b71('0x48')](_0x23a762)[_0x7b71('0x23')](handleEntityNotFound(_0x324b28,null))[_0x7b71('0x23')](respondWithResult(_0x324b28,null))['catch'](handleError(_0x324b28,null));};exports[_0x7b71('0x49')]=function(_0x18cb19,_0x945c68){return db[_0x7b71('0x2d')][_0x7b71('0x49')](_0x18cb19[_0x7b71('0x4a')],{})[_0x7b71('0x23')](function(_0x30e8d8){var _0xdb438=_0x18cb19[_0x7b71('0x4b')][_0x7b71('0x25')]({'plain':!![]});if(!_0xdb438)throw new Error(_0x7b71('0x4c'));if(_0xdb438['role']===_0x7b71('0x4b')){var _0x504cdf=_0x30e8d8[_0x7b71('0x25')]({'plain':!![]});var _0x154f72=_0x7b71('0x26');return db[_0x7b71('0x4d')][_0x7b71('0x48')]({'where':{'name':_0x154f72,'userProfileId':_0xdb438[_0x7b71('0x4e')]},'raw':!![]})['then'](function(_0x318605){if(_0x318605&&_0x318605['autoAssociation']===0x0){return db['UserProfileResource'][_0x7b71('0x49')]({'name':_0x504cdf['name'],'resourceId':_0x504cdf['id'],'type':_0x318605[_0x7b71('0x2a')],'sectionId':_0x318605['id']},{})[_0x7b71('0x23')](function(){return _0x30e8d8;});}else{return _0x30e8d8;}})[_0x7b71('0x45')](function(_0x38cf0e){logger[_0x7b71('0x4f')](_0x7b71('0x50'),_0x38cf0e);throw _0x38cf0e;});}return _0x30e8d8;})[_0x7b71('0x23')](respondWithResult(_0x945c68,0xc9))[_0x7b71('0x45')](handleError(_0x945c68,null));};exports[_0x7b71('0x22')]=function(_0x38395a,_0xbb46b3){if(_0x38395a['body']['id']){delete _0x38395a['body']['id'];}return db[_0x7b71('0x2d')]['find']({'where':{'id':_0x38395a[_0x7b71('0x47')]['id']}})[_0x7b71('0x23')](handleEntityNotFound(_0xbb46b3,null))[_0x7b71('0x23')](saveUpdates(_0x38395a['body'],null))['then'](respondWithResult(_0xbb46b3,null))['catch'](handleError(_0xbb46b3,null));};exports[_0x7b71('0x24')]=function(_0x48b486,_0x1d3acf){return db[_0x7b71('0x2d')]['find']({'where':{'id':_0x48b486[_0x7b71('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d3acf,null))[_0x7b71('0x23')](removeEntity(_0x1d3acf,null))['catch'](handleError(_0x1d3acf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 39952e9..04b021e 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 _0x2daf=['request-promise','path','rimraf','./tag.attributes','exports','define','Tag','tools_tags','../../config/logger','moment','bluebird'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x2daf,0xef));var _0xf2da=function(_0xa0ab99,_0x5496c1){_0xa0ab99=_0xa0ab99-0x0;var _0x3bf6b5=_0x2daf[_0xa0ab99];return _0x3bf6b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf2da('0x0'))('api');var moment=require(_0xf2da('0x1'));var BPromise=require(_0xf2da('0x2'));var rp=require(_0xf2da('0x3'));var fs=require('fs');var path=require(_0xf2da('0x4'));var rimraf=require(_0xf2da('0x5'));var config=require('../../config/environment');var attributes=require(_0xf2da('0x6'));module[_0xf2da('0x7')]=function(_0x349ec6,_0x464c15){return _0x349ec6[_0xf2da('0x8')](_0xf2da('0x9'),attributes,{'tableName':_0xf2da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a47=['./tag.attributes','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x373624,_0x43fb17){var _0x124590=function(_0xf8a5d){while(--_0xf8a5d){_0x373624['push'](_0x373624['shift']());}};_0x124590(++_0x43fb17);}(_0x8a47,0x17e));var _0x78a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a47[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x78a4('0x0'));var util=require(_0x78a4('0x1'));var logger=require(_0x78a4('0x2'))(_0x78a4('0x3'));var moment=require('moment');var BPromise=require(_0x78a4('0x4'));var rp=require(_0x78a4('0x5'));var fs=require('fs');var path=require(_0x78a4('0x6'));var rimraf=require(_0x78a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x78a4('0x8'));module['exports']=function(_0x4184fc,_0x2d7ec3){return _0x4184fc['define']('Tag',attributes,{'tableName':_0x78a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 69c130c..c047641 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 _0x2494=['../../config/utils','../../config/environment','client','http','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1a9fdd,_0x447a28){var _0x41e8e0=function(_0x11c53f){while(--_0x11c53f){_0x1a9fdd['push'](_0x1a9fdd['shift']());}};_0x41e8e0(++_0x447a28);}(_0x2494,0x82));var _0x4249=function(_0xed6d2b,_0x1cbc6e){_0xed6d2b=_0xed6d2b-0x0;var _0x4e2779=_0x2494[_0xed6d2b];return _0x4e2779;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var moment=require(_0x4249('0x1'));var BPromise=require(_0x4249('0x2'));var rs=require(_0x4249('0x3'));var fs=require('fs');var Redis=require(_0x4249('0x4'));var db=require(_0x4249('0x5'))['db'];var utils=require(_0x4249('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4249('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4249('0x8')][_0x4249('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed716a,_0x5b1b17,_0x326336){return new BPromise(function(_0x2b7934,_0x21060d){return client['request'](_0xed716a,_0x326336)['then'](function(_0x3efaa6){logger[_0x4249('0xa')](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));logger[_0x4249('0xd')](_0x4249('0xe'),_0x5b1b17,_0x4249('0xc'),JSON['stringify'](_0x3efaa6));if(_0x3efaa6['error']){if(_0x3efaa6[_0x4249('0xf')]['code']===0x1f4){logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6['error'][_0x4249('0x10')]);return _0x21060d(_0x3efaa6[_0x4249('0xf')]['message']);}logger[_0x4249('0xf')](_0x4249('0xb'),_0x5b1b17,_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);return _0x2b7934(_0x3efaa6[_0x4249('0xf')][_0x4249('0x10')]);}else{logger['info'](_0x4249('0xb'),_0x5b1b17,_0x4249('0xc'));_0x2b7934(_0x3efaa6['result'][_0x4249('0x10')]);}})['catch'](function(_0x501e9c){logger['error'](_0x4249('0xb'),_0x5b1b17,_0x501e9c);_0x21060d(_0x501e9c);});});} \ No newline at end of file +var _0x9567=['info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x9567,0xdc));var _0x7956=function(_0x4709b2,_0x33044f){_0x4709b2=_0x4709b2-0x0;var _0x4e26d2=_0x9567[_0x4709b2];return _0x4e26d2;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Tag,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index dca4630..efe85da 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 fcbdb22..9ca2c10 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x3c9c5a,_0x321c18){var _0x29b7e4=function(_0x8defc){while(--_0x8defc){_0x3c9c5a['push'](_0x3c9c5a['shift']());}};_0x29b7e4(++_0x321c18);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c7502,_0x5d2c70){_0x1c7502=_0x1c7502-0x0;var _0x2165fa=_0xb10b[_0x1c7502];return _0x2165fa;};'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 _0xb7e7=['STRING','sequelize'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e431d1a..ef0442b 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 _0xa870=['undefined','count','offset','set','Content-Range','json','apply','update','then','error','stack','name','send','index','map','Team','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','intersection','include','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','find','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','order','Queues','addQueues','findOne','add','capitalize','ids','removeQueues','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','defaults','TeamVoiceQueue','User','emit','findAll','voicePause','upsert','isNil','interface','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x49e52e,_0x15f616){var _0x36a6e6=function(_0x2f7be2){while(--_0x2f7be2){_0x49e52e['push'](_0x49e52e['shift']());}};_0x36a6e6(++_0x15f616);}(_0xa870,0x11c));var _0x0a87=function(_0x51c02a,_0x3b7536){_0x51c02a=_0x51c02a-0x0;var _0x2fbaf5=_0xa870[_0x51c02a];return _0x2fbaf5;};'use strict';var emlformat=require(_0x0a87('0x0'));var rimraf=require(_0x0a87('0x1'));var zipdir=require(_0x0a87('0x2'));var jsonpatch=require(_0x0a87('0x3'));var rp=require(_0x0a87('0x4'));var moment=require(_0x0a87('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0a87('0x6'));var util=require(_0x0a87('0x7'));var path=require(_0x0a87('0x8'));var sox=require(_0x0a87('0x9'));var csv=require(_0x0a87('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a87('0xb'));var _=require(_0x0a87('0xc'));var squel=require(_0x0a87('0xd'));var crypto=require('crypto');var jsforce=require(_0x0a87('0xe'));var deskjs=require(_0x0a87('0xf'));var toCsv=require(_0x0a87('0xa'));var querystring=require(_0x0a87('0x10'));var Papa=require('papaparse');var Redis=require(_0x0a87('0x11'));var authService=require(_0x0a87('0x12'));var qs=require(_0x0a87('0x13'));var as=require(_0x0a87('0x14'));var hardwareService=require(_0x0a87('0x15'));var logger=require(_0x0a87('0x16'))(_0x0a87('0x17'));var utils=require(_0x0a87('0x18'));var config=require(_0x0a87('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0a87('0x1a')]=_['defaults'](config[_0x0a87('0x1a')],{'host':_0x0a87('0x1b'),'port':0x18eb});var socket=require(_0x0a87('0x1c'))(new Redis(config['redis']));require('./team.socket')[_0x0a87('0x1d')](socket);function respondWithStatusCode(_0x517c30,_0x2f315d){_0x2f315d=_0x2f315d||0xcc;return function(_0x459f10){if(_0x459f10){return _0x517c30[_0x0a87('0x1e')](_0x2f315d);}return _0x517c30[_0x0a87('0x1f')](_0x2f315d)['end']();};}function respondWithResult(_0x42d1c2,_0x522c2e){_0x522c2e=_0x522c2e||0xc8;return function(_0x1de625){if(_0x1de625){return _0x42d1c2[_0x0a87('0x1f')](_0x522c2e)['json'](_0x1de625);}};}function respondWithFilteredResult(_0x46c454,_0x5308e6){return function(_0x490b84){if(_0x490b84){var _0x57e4fa=typeof _0x5308e6['offset']==='undefined'&&typeof _0x5308e6['limit']===_0x0a87('0x20');var _0x5204ad=_0x490b84[_0x0a87('0x21')];var _0x881b13=_0x57e4fa?0x0:_0x5308e6[_0x0a87('0x22')];var _0x365a31=_0x57e4fa?_0x490b84[_0x0a87('0x21')]:_0x5308e6[_0x0a87('0x22')]+_0x5308e6['limit'];var _0x49893f;if(_0x365a31>=_0x5204ad){_0x365a31=_0x5204ad;_0x49893f=0xc8;}else{_0x49893f=0xce;}_0x46c454['status'](_0x49893f);return _0x46c454[_0x0a87('0x23')](_0x0a87('0x24'),_0x881b13+'-'+_0x365a31+'/'+_0x5204ad)[_0x0a87('0x25')](_0x490b84);}return null;};}function patchUpdates(_0x44afec){return function(_0x9e5e){try{jsonpatch[_0x0a87('0x26')](_0x9e5e,_0x44afec,!![]);}catch(_0x4d9f56){return BPromise['reject'](_0x4d9f56);}return _0x9e5e['save']();};}function saveUpdates(_0x16c6e1,_0x2e060d){return function(_0x4c4243){if(_0x4c4243){return _0x4c4243[_0x0a87('0x27')](_0x16c6e1)[_0x0a87('0x28')](function(_0x191cc8){return _0x191cc8;});}return null;};}function handleEntityNotFound(_0x4bc73b,_0x219323){return function(_0x492f14){if(!_0x492f14){_0x4bc73b[_0x0a87('0x1e')](0x194);}return _0x492f14;};}function handleError(_0x5c51b0,_0x4f2697){_0x4f2697=_0x4f2697||0x1f4;return function(_0x35ad82){logger[_0x0a87('0x29')](_0x35ad82[_0x0a87('0x2a')]);if(_0x35ad82[_0x0a87('0x2b')]){delete _0x35ad82[_0x0a87('0x2b')];}_0x5c51b0[_0x0a87('0x1f')](_0x4f2697)[_0x0a87('0x2c')](_0x35ad82);};}exports[_0x0a87('0x2d')]=function(_0x28988b,_0x4e63c1){var _0x26f500={},_0x2d6bb7={},_0x2e6768={'count':0x0,'rows':[]};var _0x260664=_[_0x0a87('0x2e')](db[_0x0a87('0x2f')][_0x0a87('0x30')],function(_0x4a92d6){return{'name':_0x4a92d6['fieldName'],'type':_0x4a92d6[_0x0a87('0x31')][_0x0a87('0x32')]};});_0x2d6bb7['model']=_['map'](_0x260664,_0x0a87('0x2b'));_0x2d6bb7[_0x0a87('0x33')]=_[_0x0a87('0x34')](_0x28988b[_0x0a87('0x33')]);_0x2d6bb7[_0x0a87('0x35')]=_['intersection'](_0x2d6bb7[_0x0a87('0x36')],_0x2d6bb7[_0x0a87('0x33')]);_0x26f500[_0x0a87('0x37')]=_['intersection'](_0x2d6bb7[_0x0a87('0x36')],qs[_0x0a87('0x38')](_0x28988b[_0x0a87('0x33')][_0x0a87('0x38')]));_0x26f500[_0x0a87('0x37')]=_0x26f500[_0x0a87('0x37')][_0x0a87('0x39')]?_0x26f500[_0x0a87('0x37')]:_0x2d6bb7[_0x0a87('0x36')];if(!_0x28988b[_0x0a87('0x33')][_0x0a87('0x3a')]('nolimit')){_0x26f500[_0x0a87('0x3b')]=qs[_0x0a87('0x3b')](_0x28988b[_0x0a87('0x33')][_0x0a87('0x3b')]);_0x26f500['offset']=qs['offset'](_0x28988b[_0x0a87('0x33')][_0x0a87('0x22')]);}_0x26f500['order']=qs[_0x0a87('0x3c')](_0x28988b[_0x0a87('0x33')][_0x0a87('0x3c')]);_0x26f500['where']=qs[_0x0a87('0x35')](_[_0x0a87('0x3d')](_0x28988b['query'],_0x2d6bb7[_0x0a87('0x35')]),_0x260664);if(_0x28988b['query'][_0x0a87('0x3e')]){_0x26f500[_0x0a87('0x3f')]=_[_0x0a87('0x40')](_0x26f500[_0x0a87('0x3f')],{'$or':_[_0x0a87('0x2e')](_0x260664,function(_0x576ab0){if(_0x576ab0[_0x0a87('0x31')]!==_0x0a87('0x41')){var _0x20425d={};_0x20425d[_0x576ab0[_0x0a87('0x2b')]]={'$like':'%'+_0x28988b['query'][_0x0a87('0x3e')]+'%'};return _0x20425d;}})});}_0x26f500=_[_0x0a87('0x40')]({},_0x26f500,_0x28988b[_0x0a87('0x42')]);var _0x3fdb52={'where':_0x26f500[_0x0a87('0x3f')]};return db[_0x0a87('0x2f')][_0x0a87('0x21')](_0x3fdb52)['then'](function(_0x5c06a8){_0x2e6768[_0x0a87('0x21')]=_0x5c06a8;if(_0x28988b[_0x0a87('0x33')][_0x0a87('0x43')]){_0x26f500['include']=[{'all':!![]}];}return db[_0x0a87('0x2f')]['findAll'](_0x26f500);})[_0x0a87('0x28')](function(_0x52cb49){_0x2e6768[_0x0a87('0x44')]=_0x52cb49;return _0x2e6768;})['then'](respondWithFilteredResult(_0x4e63c1,_0x26f500))['catch'](handleError(_0x4e63c1,null));};exports[_0x0a87('0x45')]=function(_0x32e834,_0x4222d0){var _0x5cbbf2={'raw':![],'where':{'id':_0x32e834[_0x0a87('0x46')]['id']}},_0x31d5d6={};_0x31d5d6['model']=_[_0x0a87('0x34')](db[_0x0a87('0x2f')][_0x0a87('0x30')]);_0x31d5d6[_0x0a87('0x33')]=_[_0x0a87('0x34')](_0x32e834[_0x0a87('0x33')]);_0x31d5d6[_0x0a87('0x35')]=_[_0x0a87('0x47')](_0x31d5d6['model'],_0x31d5d6['query']);_0x5cbbf2[_0x0a87('0x37')]=_[_0x0a87('0x47')](_0x31d5d6['model'],qs[_0x0a87('0x38')](_0x32e834[_0x0a87('0x33')]['fields']));_0x5cbbf2[_0x0a87('0x37')]=_0x5cbbf2[_0x0a87('0x37')][_0x0a87('0x39')]?_0x5cbbf2[_0x0a87('0x37')]:_0x31d5d6['model'];if(_0x32e834[_0x0a87('0x33')]['includeAll']){_0x5cbbf2[_0x0a87('0x48')]=[{'all':!![]}];}_0x5cbbf2=_[_0x0a87('0x40')]({},_0x5cbbf2,_0x32e834[_0x0a87('0x42')]);return db[_0x0a87('0x2f')]['find'](_0x5cbbf2)['then'](handleEntityNotFound(_0x4222d0,null))[_0x0a87('0x28')](respondWithResult(_0x4222d0,null))['catch'](handleError(_0x4222d0,null));};exports[_0x0a87('0x49')]=function(_0x2cc77e,_0x92252){return db['Team']['create'](_0x2cc77e[_0x0a87('0x4a')],{})[_0x0a87('0x28')](function(_0x48cfb0){var _0x42da3c=_0x2cc77e['user'][_0x0a87('0x4b')]({'plain':!![]});if(!_0x42da3c)throw new Error(_0x0a87('0x4c'));if(_0x42da3c[_0x0a87('0x4d')]===_0x0a87('0x4e')){var _0x53c546=_0x48cfb0[_0x0a87('0x4b')]({'plain':!![]});var _0x27c0b7=_0x0a87('0x4f');return db[_0x0a87('0x50')][_0x0a87('0x51')]({'where':{'name':_0x27c0b7,'userProfileId':_0x42da3c[_0x0a87('0x52')]},'raw':!![]})[_0x0a87('0x28')](function(_0x4d5e14){if(_0x4d5e14&&_0x4d5e14['autoAssociation']===0x0){return db[_0x0a87('0x53')][_0x0a87('0x49')]({'name':_0x53c546[_0x0a87('0x2b')],'resourceId':_0x53c546['id'],'type':_0x4d5e14[_0x0a87('0x2b')],'sectionId':_0x4d5e14['id']},{})[_0x0a87('0x28')](function(){return _0x48cfb0;});}else{return _0x48cfb0;}})[_0x0a87('0x54')](function(_0x13a2ac){logger[_0x0a87('0x29')](_0x0a87('0x55'),_0x13a2ac);throw _0x13a2ac;});}return _0x48cfb0;})[_0x0a87('0x28')](respondWithResult(_0x92252,0xc9))['catch'](handleError(_0x92252,null));};exports[_0x0a87('0x27')]=function(_0x491375,_0x46e4a5){if(_0x491375[_0x0a87('0x4a')]['id']){delete _0x491375['body']['id'];}return db[_0x0a87('0x2f')][_0x0a87('0x51')]({'where':{'id':_0x491375[_0x0a87('0x46')]['id']}})[_0x0a87('0x28')](handleEntityNotFound(_0x46e4a5,null))[_0x0a87('0x28')](saveUpdates(_0x491375[_0x0a87('0x4a')],null))[_0x0a87('0x28')](respondWithResult(_0x46e4a5,null))[_0x0a87('0x54')](handleError(_0x46e4a5,null));};exports['destroy']=function(_0x573454,_0x43d629){var _0x404cda=_0x573454[_0x0a87('0x46')]['id'];var _0x5b28ca=[];return db[_0x0a87('0x56')][_0x0a87('0x57')](function(_0x282117){var _0xe5e75c=_0x0a87('0x58')+_0x404cda;return db['sequelize'][_0x0a87('0x33')](_0xe5e75c,{'type':db['Sequelize'][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117})[_0x0a87('0x28')](function(_0x457cec){_0x5b28ca=_['map'](_0x457cec,function(_0x14863d){return Number(_0x14863d['UserId']);});})[_0x0a87('0x28')](function(){var _0x450a2a=_0x0a87('0x5b')+_0x404cda;return db[_0x0a87('0x56')][_0x0a87('0x33')](_0x450a2a,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})['then'](function(_0x178c74){var _0x18d2f6=_[_0x0a87('0x2e')](_0x178c74,function(_0x241858){return Number(_0x241858[_0x0a87('0x5d')]);});return db[_0x0a87('0x5e')]['destroy']({'where':{'UserId':{'$in':_0x5b28ca},'VoiceQueueId':{'$in':_0x18d2f6}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){var _0x47c11f=_0x0a87('0x5f')+_0x404cda;return db[_0x0a87('0x56')][_0x0a87('0x33')](_0x47c11f,{'type':db[_0x0a87('0x5c')]['QueryTypes'][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0x67d043){var _0x4adb46=_[_0x0a87('0x2e')](_0x67d043,function(_0x6c6034){return Number(_0x6c6034[_0x0a87('0x60')]);});return db[_0x0a87('0x61')][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'MailQueueId':{'$in':_0x4adb46}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){var _0x5b4201=_0x0a87('0x63')+_0x404cda;return db[_0x0a87('0x56')][_0x0a87('0x33')](_0x5b4201,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0xf7520b){var _0x306398=_[_0x0a87('0x2e')](_0xf7520b,function(_0x478926){return Number(_0x478926[_0x0a87('0x64')]);});return db['UserSmsQueue'][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'SmsQueueId':{'$in':_0x306398}},'transaction':_0x282117});})['then'](function(){var _0x320d88=_0x0a87('0x65')+_0x404cda;return db['sequelize'][_0x0a87('0x33')](_0x320d88,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0x3fb61f){var _0x43eb4a=_[_0x0a87('0x2e')](_0x3fb61f,function(_0x11be86){return Number(_0x11be86[_0x0a87('0x66')]);});return db['UserChatQueue'][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'ChatQueueId':{'$in':_0x43eb4a}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){var _0x50946c=_0x0a87('0x67')+_0x404cda;return db[_0x0a87('0x56')][_0x0a87('0x33')](_0x50946c,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0x384fd6){var _0x4ff2d8=_['map'](_0x384fd6,function(_0xf20f7e){return Number(_0xf20f7e[_0x0a87('0x68')]);});return db['UserFaxQueue'][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'FaxQueueId':{'$in':_0x4ff2d8}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){var _0x34fe36=_0x0a87('0x69')+_0x404cda;return db[_0x0a87('0x56')]['query'](_0x34fe36,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})['then'](function(_0x4bf328){var _0x1f23b2=_[_0x0a87('0x2e')](_0x4bf328,function(_0x2cf266){return Number(_0x2cf266['OpenchannelQueueId']);});return db[_0x0a87('0x6a')][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'OpenchannelQueueId':{'$in':_0x1f23b2}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){var _0x58689f=_0x0a87('0x6b')+_0x404cda;return db[_0x0a87('0x56')][_0x0a87('0x33')](_0x58689f,{'type':db[_0x0a87('0x5c')][_0x0a87('0x59')][_0x0a87('0x5a')],'raw':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0x13b237){var _0x434df6=_[_0x0a87('0x2e')](_0x13b237,function(_0x1b60f5){return Number(_0x1b60f5[_0x0a87('0x6c')]);});return db[_0x0a87('0x6d')][_0x0a87('0x62')]({'where':{'UserId':{'$in':_0x5b28ca},'WhatsappQueueId':{'$in':_0x434df6}},'transaction':_0x282117});})[_0x0a87('0x28')](function(){return db[_0x0a87('0x6e')][_0x0a87('0x51')]({'where':{'TeamId':_0x404cda}});})['then'](function(_0x1bc73e){if(_0x1bc73e===null){return;}return db[_0x0a87('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x5b28ca},'VoicePrefixId':_0x1bc73e['VoicePrefixId']},'transaction':_0x282117});})[_0x0a87('0x28')](function(){return db['Team'][_0x0a87('0x62')]({'where':{'id':_0x404cda},'cascade':!![],'transaction':_0x282117});})[_0x0a87('0x28')](function(_0x188c55){if(_0x188c55===0x0){_0x43d629[_0x0a87('0x1e')](0x194);}else{return db[_0x0a87('0x53')]['destroy']({'where':{'type':_0x0a87('0x4f'),'resourceId':_0x404cda},'cascade':!![],'transaction':_0x282117})[_0x0a87('0x28')](function(){_0x43d629[_0x0a87('0x1f')](0xcc)['end']();});}})['catch'](function(_0x2bf3ca){_0x43d629[_0x0a87('0x1f')](0x1f4)[_0x0a87('0x2c')](_0x2bf3ca);});});};exports[_0x0a87('0x70')]=function(_0x5663b5,_0x2c0e2d,_0xbf61c8){return db[_0x0a87('0x2f')]['findOne']({'where':{'id':_0x5663b5[_0x0a87('0x46')]['id']}})[_0x0a87('0x28')](handleEntityNotFound(_0x2c0e2d,null))[_0x0a87('0x28')](function(_0x235009){if(!_0x5663b5[_0x0a87('0x33')][_0x0a87('0x71')]||!utils[_0x0a87('0x72')](_0x5663b5['query'][_0x0a87('0x71')])){throw new db[(_0x0a87('0x5c'))][(_0x0a87('0x73'))](_0x0a87('0x74'));}var _0x4453ac={};var _0x11e5f7={};_0x11e5f7[_0x0a87('0x36')]=_[_0x0a87('0x34')](db[_['capitalize'](_0x5663b5[_0x0a87('0x33')][_0x0a87('0x71')][_0x0a87('0x75')]())+_0x0a87('0x76')][_0x0a87('0x30')]);_0x11e5f7[_0x0a87('0x33')]=_[_0x0a87('0x34')](_0x5663b5['query']);_0x11e5f7[_0x0a87('0x35')]=_[_0x0a87('0x47')](_0x11e5f7['model'],_0x11e5f7[_0x0a87('0x33')]);_0x4453ac[_0x0a87('0x37')]=_[_0x0a87('0x47')](_0x11e5f7[_0x0a87('0x36')],qs[_0x0a87('0x38')](_0x5663b5[_0x0a87('0x33')][_0x0a87('0x38')]));_0x4453ac['attributes']=_0x4453ac[_0x0a87('0x37')]['length']?_0x4453ac[_0x0a87('0x37')]:_0x11e5f7[_0x0a87('0x36')];_0x4453ac['limit']=qs[_0x0a87('0x3b')](_0x5663b5[_0x0a87('0x33')][_0x0a87('0x3b')]);_0x4453ac['offset']=qs[_0x0a87('0x22')](_0x5663b5[_0x0a87('0x33')][_0x0a87('0x22')]);_0x4453ac[_0x0a87('0x77')]=qs[_0x0a87('0x3c')](_0x5663b5[_0x0a87('0x33')][_0x0a87('0x3c')]);_0x4453ac[_0x0a87('0x3f')]=qs['filters'](_[_0x0a87('0x3d')](_0x5663b5[_0x0a87('0x33')],_0x11e5f7['filters']));_0x4453ac=_['merge']({},_0x4453ac,_0x5663b5[_0x0a87('0x42')]);return _0x235009[_0x0a87('0x4b')+_['capitalize'](_0x5663b5['query']['channel']['toLowerCase']())+_0x0a87('0x78')](_0x4453ac);})[_0x0a87('0x28')](respondWithResult(_0x2c0e2d,null))[_0x0a87('0x54')](handleError(_0x2c0e2d,null));};exports[_0x0a87('0x79')]=function(_0x535628,_0x35901e,_0x5abae9){return db[_0x0a87('0x2f')][_0x0a87('0x7a')]({'where':{'id':_0x535628[_0x0a87('0x46')]['id']}})[_0x0a87('0x28')](function(_0x88da59){if(_0x88da59){if(!_0x535628[_0x0a87('0x4a')][_0x0a87('0x71')]||!utils[_0x0a87('0x72')](_0x535628[_0x0a87('0x4a')][_0x0a87('0x71')])){throw new db[(_0x0a87('0x5c'))][(_0x0a87('0x73'))](_0x0a87('0x74'));}return _0x88da59[_0x0a87('0x7b')+_[_0x0a87('0x7c')](_0x535628[_0x0a87('0x4a')]['channel']['toLowerCase']())+'Queues'](_0x535628[_0x0a87('0x4a')][_0x0a87('0x7d')]);}return null;})[_0x0a87('0x28')](handleEntityNotFound(_0x35901e,null))[_0x0a87('0x28')](respondWithStatusCode(_0x35901e,null))[_0x0a87('0x54')](handleError(_0x35901e,null));};exports[_0x0a87('0x7e')]=function(_0x54160e,_0x51801d,_0x268e33){return db[_0x0a87('0x2f')][_0x0a87('0x7a')]({'where':{'id':_0x54160e[_0x0a87('0x46')]['id']}})['then'](function(_0xec3a4d){if(_0xec3a4d){if(!_0x54160e[_0x0a87('0x33')][_0x0a87('0x71')]||!utils[_0x0a87('0x72')](_0x54160e[_0x0a87('0x33')][_0x0a87('0x71')])){throw new db[(_0x0a87('0x5c'))][(_0x0a87('0x73'))](_0x0a87('0x74'));}return _0xec3a4d['remove'+_[_0x0a87('0x7c')](_0x54160e['query'][_0x0a87('0x71')][_0x0a87('0x75')]())+'Queues'](_0x54160e[_0x0a87('0x33')]['ids']);}return null;})[_0x0a87('0x28')](handleEntityNotFound(_0x51801d,null))[_0x0a87('0x28')](respondWithStatusCode(_0x51801d,null))[_0x0a87('0x54')](handleError(_0x51801d,null));};exports[_0x0a87('0x7f')]=function(_0x163b2b,_0xa9483){var _0xd9763a=_[_0x0a87('0x80')](_0x163b2b[_0x0a87('0x4a')][_0x0a87('0x7d')])?_0x163b2b['body'][_0x0a87('0x7d')]:[_0x163b2b[_0x0a87('0x4a')][_0x0a87('0x7d')]];var _0x483510=_0x163b2b[_0x0a87('0x46')]['id'];return db[_0x0a87('0x2f')][_0x0a87('0x51')]({'where':{'id':_0x483510}})['then'](handleEntityNotFound(_0xa9483,null))[_0x0a87('0x28')](function(_0x48fa0d){if(_0x48fa0d){var _0x1ed3fc=[_0x0a87('0x81'),_0x0a87('0x82'),_0x0a87('0x83'),_0x0a87('0x84'),_0x0a87('0x85'),_0x0a87('0x86'),_0x0a87('0x87')];return db['sequelize']['transaction'](function(_0x3cd5ca){var _0x3fe644=_['map'](_0x1ed3fc,function(_0x15c466){var _0x175c49={'attributes':['id','name']};if(_0x15c466===_0x0a87('0x81')){_0x175c49[_0x0a87('0x88')]={'attributes':[_0x0a87('0x89')]};}return _0x48fa0d['get'+_0x15c466+_0x0a87('0x78')](_0x175c49)[_0x0a87('0x28')](function(_0x142ccc){var _0x5b9d4e=_[_0x0a87('0x2e')](_0x142ccc,function(_0x4397a6){var _0x174ca5=_[_0x0a87('0x2e')](_0xd9763a,function(_0x5dc5ea){var _0x2a2eca={'where':{'UserId':_0x5dc5ea,[_0x15c466+_0x0a87('0x8a')]:_0x4397a6['id']},'transaction':_0x3cd5ca};if(_0x15c466===_0x0a87('0x81')){_0x2a2eca[_0x0a87('0x8b')]={'penalty':_0x4397a6[_0x0a87('0x8c')][_0x0a87('0x89')]};}return db[_0x0a87('0x8d')+_0x15c466+'Queue']['findOrCreate'](_0x2a2eca)[_0x0a87('0x28')](function(){socket[_0x0a87('0x8e')]('user'+_0x15c466+'Queue:save',{'UserId':_0x5dc5ea,[_0x15c466+_0x0a87('0x8a')]:_0x4397a6['id']});if(_0x15c466!==_0x0a87('0x81')){return;}return db[_0x0a87('0x8d')][_0x0a87('0x8f')]({'where':{'id':_0xd9763a,'online':0x1},'attributes':['id',_0x0a87('0x2b'),'online',_0x0a87('0x90'),'interface'],'raw':!![]})[_0x0a87('0x28')](function(_0x366ef2){var _0xc42721=_['map'](_0x366ef2,function(_0x3e938f){return db['UserVoiceQueueRt'][_0x0a87('0x91')]({'membername':_0x3e938f[_0x0a87('0x2b')],'UserId':_0x3e938f['id'],'queue_name':_0x4397a6[_0x0a87('0x2b')],'VoiceQueueId':_0x4397a6['id'],'interface':_[_0x0a87('0x92')](_0x3e938f[_0x0a87('0x93')])?util[_0x0a87('0x94')](_0x0a87('0x95'),_0x3e938f[_0x0a87('0x2b')]):_0x3e938f[_0x0a87('0x93')],'paused':_0x3e938f[_0x0a87('0x90')]||![],'penalty':_0x4397a6[_0x0a87('0x8c')][_0x0a87('0x89')]},{'transaction':_0x3cd5ca});});return Promise[_0x0a87('0x96')](_0xc42721);});});});return Promise[_0x0a87('0x96')](_0x174ca5);});return Promise[_0x0a87('0x96')](_0x5b9d4e);})[_0x0a87('0x28')](function(){return db[_0x0a87('0x6e')]['findOne']({'where':{'teamId':_0x483510}})['then'](function(_0x2f741a){if(_0x2f741a){var _0x488d5a=_[_0x0a87('0x2e')](_0xd9763a,function(_0x5e8936){db[_0x0a87('0x6f')]['upsert']({'UserId':_0x5e8936,'VoicePrefixId':_0x2f741a[_0x0a87('0x97')]});});return Promise[_0x0a87('0x96')](_0x488d5a);}});});});return Promise[_0x0a87('0x96')](_0x3fe644)['then'](function(){return _0x48fa0d[_0x0a87('0x7f')](_0xd9763a,{'transaction':_0x3cd5ca})[_0x0a87('0x98')](function(_0x150fbd){return _0x150fbd;});});});}})[_0x0a87('0x28')](respondWithResult(_0xa9483,null))[_0x0a87('0x54')](handleError(_0xa9483,null));};exports[_0x0a87('0x99')]=function(_0x2418b5,_0x7125e5){var _0x2310bc=_[_0x0a87('0x80')](_0x2418b5[_0x0a87('0x33')][_0x0a87('0x7d')])?_0x2418b5[_0x0a87('0x33')][_0x0a87('0x7d')]:[_0x2418b5[_0x0a87('0x33')]['ids']];var _0x3bc0e4=_0x2418b5[_0x0a87('0x46')]['id'];return db[_0x0a87('0x2f')][_0x0a87('0x51')]({'where':{'id':_0x3bc0e4}})[_0x0a87('0x28')](handleEntityNotFound(_0x7125e5,null))[_0x0a87('0x28')](function(_0x3d6037){if(_0x3d6037){var _0x21984e=[_0x0a87('0x81'),_0x0a87('0x82'),_0x0a87('0x83'),_0x0a87('0x84'),_0x0a87('0x85'),_0x0a87('0x86'),_0x0a87('0x87')];return db[_0x0a87('0x56')][_0x0a87('0x57')](function(_0x3ba116){var _0x2b74b3=_['map'](_0x21984e,function(_0x27a2aa){var _0x1ce369={'attributes':['id',_0x0a87('0x2b')]};return _0x3d6037[_0x0a87('0x4b')+_0x27a2aa+_0x0a87('0x78')](_0x1ce369)[_0x0a87('0x28')](function(_0x1e1028){var _0x3d7b09=_[_0x0a87('0x2e')](_0x1e1028,function(_0x2be23b){return _0x2be23b[_0x0a87('0x99')](_0x2310bc,{'transaction':_0x3ba116})[_0x0a87('0x28')](function(){var _0x401a95=_[_0x0a87('0x2e')](_0x2310bc,function(_0x498b6b){socket[_0x0a87('0x8e')]('user'+_0x27a2aa+_0x0a87('0x9a'),{'UserId':Number(_0x498b6b),[_0x27a2aa+_0x0a87('0x8a')]:_0x2be23b['id']});if(_0x27a2aa!=='Voice'){return;}return db[_0x0a87('0x9b')]['destroy']({'where':{'VoiceQueueId':_0x2be23b['id'],'UserId':_0x498b6b},'transaction':_0x3ba116});});return Promise[_0x0a87('0x96')](_0x401a95);});});return Promise[_0x0a87('0x96')](_0x3d7b09);});});return Promise[_0x0a87('0x96')](_0x2b74b3)[_0x0a87('0x28')](function(){return _0x3d6037[_0x0a87('0x99')](_0x2310bc,{'transaction':_0x3ba116});})[_0x0a87('0x28')](function(){return db[_0x0a87('0x6e')][_0x0a87('0x7a')]({'where':{'teamId':_0x3bc0e4}})[_0x0a87('0x28')](function(_0x10c301){if(_0x10c301){var _0x11ff69=_[_0x0a87('0x2e')](_0x2310bc,function(_0x1dc663){db[_0x0a87('0x6f')]['destroy']({'where':{'UserId':_0x1dc663,'VoicePrefixId':_0x10c301['VoicePrefixId']}});});return Promise[_0x0a87('0x96')](_0x11ff69);}});});});}})[_0x0a87('0x28')](respondWithStatusCode(_0x7125e5,null))[_0x0a87('0x54')](handleError(_0x7125e5,null));};exports[_0x0a87('0x9c')]=function(_0x3bec1f,_0x1417a6,_0x495a6e){var _0x597892={};var _0xa30ef3={};var _0x10a5ed;var _0x1ca2fa;return db[_0x0a87('0x2f')]['findOne']({'where':{'id':_0x3bec1f[_0x0a87('0x46')]['id']}})[_0x0a87('0x28')](handleEntityNotFound(_0x1417a6,null))[_0x0a87('0x28')](function(_0x576f82){if(_0x576f82){_0x10a5ed=_0x576f82;_0xa30ef3[_0x0a87('0x36')]=_[_0x0a87('0x34')](db[_0x0a87('0x8d')][_0x0a87('0x30')]);_0xa30ef3['query']=_[_0x0a87('0x34')](_0x3bec1f[_0x0a87('0x33')]);_0xa30ef3[_0x0a87('0x35')]=_[_0x0a87('0x47')](_0xa30ef3['model'],_0xa30ef3['query']);_0x597892['attributes']=_[_0x0a87('0x47')](_0xa30ef3[_0x0a87('0x36')],qs[_0x0a87('0x38')](_0x3bec1f['query'][_0x0a87('0x38')]));_0x597892['attributes']=_0x597892[_0x0a87('0x37')][_0x0a87('0x39')]?_0x597892[_0x0a87('0x37')]:_0xa30ef3[_0x0a87('0x36')];_0x597892[_0x0a87('0x77')]=qs[_0x0a87('0x3c')](_0x3bec1f[_0x0a87('0x33')][_0x0a87('0x3c')]);_0x597892['where']=qs['filters'](_[_0x0a87('0x3d')](_0x3bec1f[_0x0a87('0x33')],_0xa30ef3[_0x0a87('0x35')]));if(_0x3bec1f[_0x0a87('0x33')][_0x0a87('0x3e')]){_0x597892[_0x0a87('0x3f')]=_[_0x0a87('0x40')](_0x597892[_0x0a87('0x3f')],{'$or':_['map'](_0x597892[_0x0a87('0x37')],function(_0x33f69a){var _0x3759b2={};_0x3759b2[_0x33f69a]={'$like':'%'+_0x3bec1f['query'][_0x0a87('0x3e')]+'%'};return _0x3759b2;})});}_0x597892=_[_0x0a87('0x40')]({},_0x597892,_0x3bec1f[_0x0a87('0x42')]);return _0x10a5ed[_0x0a87('0x9c')](_0x597892);}})[_0x0a87('0x28')](function(_0x50f6bc){if(_0x50f6bc){_0x1ca2fa=_0x50f6bc['length'];if(!_0x3bec1f[_0x0a87('0x33')][_0x0a87('0x3a')](_0x0a87('0x9d'))){_0x597892[_0x0a87('0x3b')]=qs[_0x0a87('0x3b')](_0x3bec1f[_0x0a87('0x33')][_0x0a87('0x3b')]);_0x597892['offset']=qs[_0x0a87('0x22')](_0x3bec1f[_0x0a87('0x33')]['offset']);}return _0x10a5ed['getAgents'](_0x597892);}})[_0x0a87('0x28')](function(_0xefe3b8){if(_0xefe3b8){return _0xefe3b8?{'count':_0x1ca2fa,'rows':_0xefe3b8}:null;}})[_0x0a87('0x28')](respondWithResult(_0x1417a6,null))[_0x0a87('0x54')](handleError(_0x1417a6,null));}; \ No newline at end of file +var _0x99ad=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Team','includeAll','include','findAll','rows','catch','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Sms','Fax','Openchannel','transaction','Voice','through','QueueId','defaults','penalty','User','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','upsert','VoicePrefixId','spread','Chat','Mail','Whatsapp','removeAgents','emit','Queue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x17de48,_0x2a114c){var _0x24f9ca=function(_0x66fd4e){while(--_0x66fd4e){_0x17de48['push'](_0x17de48['shift']());}};_0x24f9ca(++_0x2a114c);}(_0x99ad,0x129));var _0xd99a=function(_0x499dca,_0x22f500){_0x499dca=_0x499dca-0x0;var _0x57f37c=_0x99ad[_0x499dca];return _0x57f37c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd99a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd99a('0x1'));var rp=require(_0xd99a('0x2'));var moment=require(_0xd99a('0x3'));var BPromise=require(_0xd99a('0x4'));var Mustache=require('mustache');var util=require(_0xd99a('0x5'));var path=require(_0xd99a('0x6'));var sox=require(_0xd99a('0x7'));var csv=require(_0xd99a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd99a('0x9'));var _=require('lodash');var squel=require(_0xd99a('0xa'));var crypto=require(_0xd99a('0xb'));var jsforce=require(_0xd99a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd99a('0xd'));var Papa=require(_0xd99a('0xe'));var Redis=require(_0xd99a('0xf'));var authService=require(_0xd99a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd99a('0x11'));var hardwareService=require(_0xd99a('0x12'));var logger=require(_0xd99a('0x13'))(_0xd99a('0x14'));var utils=require(_0xd99a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd99a('0x16'));var db=require(_0xd99a('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd99a('0x18'),'port':0x18eb});var socket=require(_0xd99a('0x19'))(new Redis(config['redis']));require('./team.socket')[_0xd99a('0x1a')](socket);function respondWithStatusCode(_0x325d9e,_0x483e4f){_0x483e4f=_0x483e4f||0xcc;return function(_0x1f0f61){if(_0x1f0f61){return _0x325d9e[_0xd99a('0x1b')](_0x483e4f);}return _0x325d9e[_0xd99a('0x1c')](_0x483e4f)[_0xd99a('0x1d')]();};}function respondWithResult(_0x5e8eed,_0x22c452){_0x22c452=_0x22c452||0xc8;return function(_0x34da40){if(_0x34da40){return _0x5e8eed[_0xd99a('0x1c')](_0x22c452)[_0xd99a('0x1e')](_0x34da40);}};}function respondWithFilteredResult(_0x118e8b,_0x2093c6){return function(_0xccfba9){if(_0xccfba9){var _0x311cc6=typeof _0x2093c6[_0xd99a('0x1f')]==='undefined'&&typeof _0x2093c6[_0xd99a('0x20')]===_0xd99a('0x21');var _0x5d29c6=_0xccfba9[_0xd99a('0x22')];var _0x5a859d=_0x311cc6?0x0:_0x2093c6[_0xd99a('0x1f')];var _0x26282f=_0x311cc6?_0xccfba9[_0xd99a('0x22')]:_0x2093c6[_0xd99a('0x1f')]+_0x2093c6[_0xd99a('0x20')];var _0x18285c;if(_0x26282f>=_0x5d29c6){_0x26282f=_0x5d29c6;_0x18285c=0xc8;}else{_0x18285c=0xce;}_0x118e8b[_0xd99a('0x1c')](_0x18285c);return _0x118e8b[_0xd99a('0x23')](_0xd99a('0x24'),_0x5a859d+'-'+_0x26282f+'/'+_0x5d29c6)[_0xd99a('0x1e')](_0xccfba9);}return null;};}function patchUpdates(_0x52a8db){return function(_0x5025d3){try{jsonpatch['apply'](_0x5025d3,_0x52a8db,!![]);}catch(_0x229837){return BPromise[_0xd99a('0x25')](_0x229837);}return _0x5025d3['save']();};}function saveUpdates(_0x14b89e,_0x46658e){return function(_0x1e1ab8){if(_0x1e1ab8){return _0x1e1ab8[_0xd99a('0x26')](_0x14b89e)[_0xd99a('0x27')](function(_0x481a4a){return _0x481a4a;});}return null;};}function handleEntityNotFound(_0x21de55,_0x192cbf){return function(_0x25d8e8){if(!_0x25d8e8){_0x21de55['sendStatus'](0x194);}return _0x25d8e8;};}function handleError(_0x2ee244,_0x3b9fb8){_0x3b9fb8=_0x3b9fb8||0x1f4;return function(_0x495803){logger[_0xd99a('0x28')](_0x495803[_0xd99a('0x29')]);if(_0x495803[_0xd99a('0x2a')]){delete _0x495803[_0xd99a('0x2a')];}_0x2ee244['status'](_0x3b9fb8)[_0xd99a('0x2b')](_0x495803);};}exports[_0xd99a('0x2c')]=function(_0x49c7f4,_0x16ae88){var _0x4279cb={},_0x71d438={},_0x422f92={'count':0x0,'rows':[]};var _0x7e68f4=_['map'](db['Team'][_0xd99a('0x2d')],function(_0x543a68){return{'name':_0x543a68[_0xd99a('0x2e')],'type':_0x543a68[_0xd99a('0x2f')][_0xd99a('0x30')]};});_0x71d438[_0xd99a('0x31')]=_[_0xd99a('0x32')](_0x7e68f4,'name');_0x71d438['query']=_[_0xd99a('0x33')](_0x49c7f4['query']);_0x71d438[_0xd99a('0x34')]=_[_0xd99a('0x35')](_0x71d438[_0xd99a('0x31')],_0x71d438[_0xd99a('0x36')]);_0x4279cb[_0xd99a('0x37')]=_[_0xd99a('0x35')](_0x71d438['model'],qs[_0xd99a('0x38')](_0x49c7f4[_0xd99a('0x36')]['fields']));_0x4279cb[_0xd99a('0x37')]=_0x4279cb['attributes'][_0xd99a('0x39')]?_0x4279cb[_0xd99a('0x37')]:_0x71d438[_0xd99a('0x31')];if(!_0x49c7f4[_0xd99a('0x36')][_0xd99a('0x3a')](_0xd99a('0x3b'))){_0x4279cb[_0xd99a('0x20')]=qs[_0xd99a('0x20')](_0x49c7f4['query'][_0xd99a('0x20')]);_0x4279cb[_0xd99a('0x1f')]=qs[_0xd99a('0x1f')](_0x49c7f4[_0xd99a('0x36')][_0xd99a('0x1f')]);}_0x4279cb[_0xd99a('0x3c')]=qs['sort'](_0x49c7f4[_0xd99a('0x36')][_0xd99a('0x3d')]);_0x4279cb[_0xd99a('0x3e')]=qs[_0xd99a('0x34')](_[_0xd99a('0x3f')](_0x49c7f4[_0xd99a('0x36')],_0x71d438[_0xd99a('0x34')]),_0x7e68f4);if(_0x49c7f4[_0xd99a('0x36')]['filter']){_0x4279cb[_0xd99a('0x3e')]=_['merge'](_0x4279cb[_0xd99a('0x3e')],{'$or':_[_0xd99a('0x32')](_0x7e68f4,function(_0x6470ee){if(_0x6470ee[_0xd99a('0x2f')]!==_0xd99a('0x40')){var _0x43c224={};_0x43c224[_0x6470ee[_0xd99a('0x2a')]]={'$like':'%'+_0x49c7f4[_0xd99a('0x36')][_0xd99a('0x41')]+'%'};return _0x43c224;}})});}_0x4279cb=_[_0xd99a('0x42')]({},_0x4279cb,_0x49c7f4[_0xd99a('0x43')]);var _0x3802c3={'where':_0x4279cb[_0xd99a('0x3e')]};return db[_0xd99a('0x44')][_0xd99a('0x22')](_0x3802c3)[_0xd99a('0x27')](function(_0x2d7864){_0x422f92[_0xd99a('0x22')]=_0x2d7864;if(_0x49c7f4[_0xd99a('0x36')][_0xd99a('0x45')]){_0x4279cb[_0xd99a('0x46')]=[{'all':!![]}];}return db[_0xd99a('0x44')][_0xd99a('0x47')](_0x4279cb);})['then'](function(_0x120252){_0x422f92[_0xd99a('0x48')]=_0x120252;return _0x422f92;})[_0xd99a('0x27')](respondWithFilteredResult(_0x16ae88,_0x4279cb))[_0xd99a('0x49')](handleError(_0x16ae88,null));};exports['show']=function(_0x259e7f,_0x14aae2){var _0x495dad={'raw':![],'where':{'id':_0x259e7f['params']['id']}},_0x21cbaa={};_0x21cbaa[_0xd99a('0x31')]=_[_0xd99a('0x33')](db['Team'][_0xd99a('0x2d')]);_0x21cbaa[_0xd99a('0x36')]=_['keys'](_0x259e7f[_0xd99a('0x36')]);_0x21cbaa[_0xd99a('0x34')]=_['intersection'](_0x21cbaa[_0xd99a('0x31')],_0x21cbaa[_0xd99a('0x36')]);_0x495dad['attributes']=_[_0xd99a('0x35')](_0x21cbaa[_0xd99a('0x31')],qs[_0xd99a('0x38')](_0x259e7f[_0xd99a('0x36')][_0xd99a('0x38')]));_0x495dad[_0xd99a('0x37')]=_0x495dad['attributes']['length']?_0x495dad[_0xd99a('0x37')]:_0x21cbaa[_0xd99a('0x31')];if(_0x259e7f[_0xd99a('0x36')][_0xd99a('0x45')]){_0x495dad['include']=[{'all':!![]}];}_0x495dad=_[_0xd99a('0x42')]({},_0x495dad,_0x259e7f[_0xd99a('0x43')]);return db[_0xd99a('0x44')][_0xd99a('0x4a')](_0x495dad)[_0xd99a('0x27')](handleEntityNotFound(_0x14aae2,null))['then'](respondWithResult(_0x14aae2,null))['catch'](handleError(_0x14aae2,null));};exports['create']=function(_0x5373a4,_0x572c43){return db[_0xd99a('0x44')][_0xd99a('0x4b')](_0x5373a4['body'],{})[_0xd99a('0x27')](function(_0x1dee50){var _0x972a12=_0x5373a4[_0xd99a('0x4c')][_0xd99a('0x4d')]({'plain':!![]});if(!_0x972a12)throw new Error(_0xd99a('0x4e'));if(_0x972a12[_0xd99a('0x4f')]==='user'){var _0x361564=_0x1dee50[_0xd99a('0x4d')]({'plain':!![]});var _0x1ced86=_0xd99a('0x50');return db['UserProfileSection'][_0xd99a('0x4a')]({'where':{'name':_0x1ced86,'userProfileId':_0x972a12[_0xd99a('0x51')]},'raw':!![]})[_0xd99a('0x27')](function(_0x8e410c){if(_0x8e410c&&_0x8e410c[_0xd99a('0x52')]===0x0){return db[_0xd99a('0x53')][_0xd99a('0x4b')]({'name':_0x361564[_0xd99a('0x2a')],'resourceId':_0x361564['id'],'type':_0x8e410c[_0xd99a('0x2a')],'sectionId':_0x8e410c['id']},{})[_0xd99a('0x27')](function(){return _0x1dee50;});}else{return _0x1dee50;}})[_0xd99a('0x49')](function(_0x4b4f14){logger[_0xd99a('0x28')](_0xd99a('0x54'),_0x4b4f14);throw _0x4b4f14;});}return _0x1dee50;})[_0xd99a('0x27')](respondWithResult(_0x572c43,0xc9))[_0xd99a('0x49')](handleError(_0x572c43,null));};exports[_0xd99a('0x26')]=function(_0x501070,_0x1988cc){if(_0x501070[_0xd99a('0x55')]['id']){delete _0x501070[_0xd99a('0x55')]['id'];}return db[_0xd99a('0x44')][_0xd99a('0x4a')]({'where':{'id':_0x501070['params']['id']}})[_0xd99a('0x27')](handleEntityNotFound(_0x1988cc,null))['then'](saveUpdates(_0x501070[_0xd99a('0x55')],null))[_0xd99a('0x27')](respondWithResult(_0x1988cc,null))[_0xd99a('0x49')](handleError(_0x1988cc,null));};exports['destroy']=function(_0x4f2765,_0x5505b9){var _0x470aec=_0x4f2765[_0xd99a('0x56')]['id'];var _0x407451=[];return db[_0xd99a('0x57')]['transaction'](function(_0x1205eb){var _0x39ec5e=_0xd99a('0x58')+_0x470aec;return db[_0xd99a('0x57')]['query'](_0x39ec5e,{'type':db[_0xd99a('0x59')][_0xd99a('0x5a')]['SELECT'],'raw':!![],'transaction':_0x1205eb})[_0xd99a('0x27')](function(_0x2e237e){_0x407451=_['map'](_0x2e237e,function(_0x5e179a){return Number(_0x5e179a['UserId']);});})['then'](function(){var _0x30a48c=_0xd99a('0x5b')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x30a48c,{'type':db[_0xd99a('0x59')][_0xd99a('0x5a')][_0xd99a('0x5c')],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x2b9f5b){var _0x19ebdf=_[_0xd99a('0x32')](_0x2b9f5b,function(_0x28ecc2){return Number(_0x28ecc2[_0xd99a('0x5d')]);});return db[_0xd99a('0x5e')][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'VoiceQueueId':{'$in':_0x19ebdf}},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){var _0x5caacb=_0xd99a('0x60')+_0x470aec;return db['sequelize'][_0xd99a('0x36')](_0x5caacb,{'type':db['Sequelize'][_0xd99a('0x5a')]['SELECT'],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x1bebe1){var _0x41cc64=_[_0xd99a('0x32')](_0x1bebe1,function(_0x4aefcc){return Number(_0x4aefcc[_0xd99a('0x61')]);});return db['UserMailQueue'][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'MailQueueId':{'$in':_0x41cc64}},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){var _0x2beb4d=_0xd99a('0x62')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x2beb4d,{'type':db[_0xd99a('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1205eb});})['then'](function(_0x3a79aa){var _0x50a1af=_[_0xd99a('0x32')](_0x3a79aa,function(_0x120fea){return Number(_0x120fea[_0xd99a('0x63')]);});return db['UserSmsQueue'][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'SmsQueueId':{'$in':_0x50a1af}},'transaction':_0x1205eb});})['then'](function(){var _0x2a73eb=_0xd99a('0x64')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x2a73eb,{'type':db[_0xd99a('0x59')][_0xd99a('0x5a')][_0xd99a('0x5c')],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x4e4ee5){var _0x35f439=_[_0xd99a('0x32')](_0x4e4ee5,function(_0x212100){return Number(_0x212100[_0xd99a('0x65')]);});return db[_0xd99a('0x66')]['destroy']({'where':{'UserId':{'$in':_0x407451},'ChatQueueId':{'$in':_0x35f439}},'transaction':_0x1205eb});})['then'](function(){var _0x4fe759=_0xd99a('0x67')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x4fe759,{'type':db['Sequelize'][_0xd99a('0x5a')][_0xd99a('0x5c')],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x191e23){var _0x161735=_[_0xd99a('0x32')](_0x191e23,function(_0x783d2a){return Number(_0x783d2a[_0xd99a('0x68')]);});return db[_0xd99a('0x69')][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'FaxQueueId':{'$in':_0x161735}},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){var _0x24fd34=_0xd99a('0x6a')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x24fd34,{'type':db[_0xd99a('0x59')][_0xd99a('0x5a')][_0xd99a('0x5c')],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x37c889){var _0x3c85c7=_[_0xd99a('0x32')](_0x37c889,function(_0x4fd1ad){return Number(_0x4fd1ad['OpenchannelQueueId']);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x407451},'OpenchannelQueueId':{'$in':_0x3c85c7}},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){var _0x1e7396=_0xd99a('0x6b')+_0x470aec;return db[_0xd99a('0x57')][_0xd99a('0x36')](_0x1e7396,{'type':db[_0xd99a('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x366cab){var _0x188e50=_[_0xd99a('0x32')](_0x366cab,function(_0x8f2c9){return Number(_0x8f2c9['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'WhatsappQueueId':{'$in':_0x188e50}},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){return db['TeamVoicePrefix'][_0xd99a('0x4a')]({'where':{'TeamId':_0x470aec}});})[_0xd99a('0x27')](function(_0xc6f22d){if(_0xc6f22d===null){return;}return db[_0xd99a('0x6c')][_0xd99a('0x5f')]({'where':{'UserId':{'$in':_0x407451},'VoicePrefixId':_0xc6f22d['VoicePrefixId']},'transaction':_0x1205eb});})[_0xd99a('0x27')](function(){return db[_0xd99a('0x44')]['destroy']({'where':{'id':_0x470aec},'cascade':!![],'transaction':_0x1205eb});})[_0xd99a('0x27')](function(_0x24aeff){if(_0x24aeff===0x0){_0x5505b9[_0xd99a('0x1b')](0x194);}else{return db['UserProfileResource']['destroy']({'where':{'type':'Teams','resourceId':_0x470aec},'cascade':!![],'transaction':_0x1205eb})[_0xd99a('0x27')](function(){_0x5505b9[_0xd99a('0x1c')](0xcc)[_0xd99a('0x1d')]();});}})[_0xd99a('0x49')](function(_0x5388ef){_0x5505b9[_0xd99a('0x1c')](0x1f4)[_0xd99a('0x2b')](_0x5388ef);});});};exports[_0xd99a('0x6d')]=function(_0x3e9cf8,_0x2fd994,_0x4a1299){return db[_0xd99a('0x44')][_0xd99a('0x6e')]({'where':{'id':_0x3e9cf8[_0xd99a('0x56')]['id']}})[_0xd99a('0x27')](handleEntityNotFound(_0x2fd994,null))['then'](function(_0x4817c8){if(!_0x3e9cf8[_0xd99a('0x36')][_0xd99a('0x6f')]||!utils[_0xd99a('0x70')](_0x3e9cf8[_0xd99a('0x36')][_0xd99a('0x6f')])){throw new db[(_0xd99a('0x59'))][(_0xd99a('0x71'))](_0xd99a('0x72'));}var _0x50bc0e={};var _0x565ac1={};_0x565ac1['model']=_[_0xd99a('0x33')](db[_['capitalize'](_0x3e9cf8[_0xd99a('0x36')][_0xd99a('0x6f')][_0xd99a('0x73')]())+_0xd99a('0x74')][_0xd99a('0x2d')]);_0x565ac1['query']=_[_0xd99a('0x33')](_0x3e9cf8[_0xd99a('0x36')]);_0x565ac1[_0xd99a('0x34')]=_['intersection'](_0x565ac1[_0xd99a('0x31')],_0x565ac1[_0xd99a('0x36')]);_0x50bc0e[_0xd99a('0x37')]=_['intersection'](_0x565ac1[_0xd99a('0x31')],qs['fields'](_0x3e9cf8[_0xd99a('0x36')][_0xd99a('0x38')]));_0x50bc0e[_0xd99a('0x37')]=_0x50bc0e[_0xd99a('0x37')][_0xd99a('0x39')]?_0x50bc0e[_0xd99a('0x37')]:_0x565ac1['model'];_0x50bc0e[_0xd99a('0x20')]=qs[_0xd99a('0x20')](_0x3e9cf8[_0xd99a('0x36')]['limit']);_0x50bc0e[_0xd99a('0x1f')]=qs[_0xd99a('0x1f')](_0x3e9cf8[_0xd99a('0x36')]['offset']);_0x50bc0e[_0xd99a('0x3c')]=qs['sort'](_0x3e9cf8['query'][_0xd99a('0x3d')]);_0x50bc0e[_0xd99a('0x3e')]=qs[_0xd99a('0x34')](_[_0xd99a('0x3f')](_0x3e9cf8[_0xd99a('0x36')],_0x565ac1[_0xd99a('0x34')]));_0x50bc0e=_['merge']({},_0x50bc0e,_0x3e9cf8[_0xd99a('0x43')]);return _0x4817c8[_0xd99a('0x4d')+_[_0xd99a('0x75')](_0x3e9cf8[_0xd99a('0x36')]['channel']['toLowerCase']())+_0xd99a('0x76')](_0x50bc0e);})[_0xd99a('0x27')](respondWithResult(_0x2fd994,null))[_0xd99a('0x49')](handleError(_0x2fd994,null));};exports[_0xd99a('0x77')]=function(_0x45bd8b,_0x4f3dd7,_0x59e700){return db[_0xd99a('0x44')][_0xd99a('0x6e')]({'where':{'id':_0x45bd8b[_0xd99a('0x56')]['id']}})['then'](function(_0x2f1481){if(_0x2f1481){if(!_0x45bd8b[_0xd99a('0x55')][_0xd99a('0x6f')]||!utils['isValidChannel'](_0x45bd8b[_0xd99a('0x55')][_0xd99a('0x6f')])){throw new db['Sequelize']['ValidationError'](_0xd99a('0x72'));}return _0x2f1481[_0xd99a('0x78')+_[_0xd99a('0x75')](_0x45bd8b[_0xd99a('0x55')][_0xd99a('0x6f')][_0xd99a('0x73')]())+_0xd99a('0x76')](_0x45bd8b[_0xd99a('0x55')][_0xd99a('0x79')]);}return null;})['then'](handleEntityNotFound(_0x4f3dd7,null))[_0xd99a('0x27')](respondWithStatusCode(_0x4f3dd7,null))[_0xd99a('0x49')](handleError(_0x4f3dd7,null));};exports[_0xd99a('0x7a')]=function(_0x1e5a36,_0x19dfea,_0x3e0e5b){return db['Team'][_0xd99a('0x6e')]({'where':{'id':_0x1e5a36[_0xd99a('0x56')]['id']}})[_0xd99a('0x27')](function(_0x5d675c){if(_0x5d675c){if(!_0x1e5a36[_0xd99a('0x36')][_0xd99a('0x6f')]||!utils[_0xd99a('0x70')](_0x1e5a36[_0xd99a('0x36')]['channel'])){throw new db[(_0xd99a('0x59'))][(_0xd99a('0x71'))]('Unknown\x20channel');}return _0x5d675c[_0xd99a('0x7b')+_[_0xd99a('0x75')](_0x1e5a36['query'][_0xd99a('0x6f')]['toLowerCase']())+_0xd99a('0x76')](_0x1e5a36[_0xd99a('0x36')][_0xd99a('0x79')]);}return null;})[_0xd99a('0x27')](handleEntityNotFound(_0x19dfea,null))['then'](respondWithStatusCode(_0x19dfea,null))[_0xd99a('0x49')](handleError(_0x19dfea,null));};exports[_0xd99a('0x7c')]=function(_0x107bcd,_0x14ffea){var _0x37d4e1=_[_0xd99a('0x7d')](_0x107bcd[_0xd99a('0x55')][_0xd99a('0x79')])?_0x107bcd[_0xd99a('0x55')][_0xd99a('0x79')]:[_0x107bcd['body']['ids']];var _0x98776f=_0x107bcd[_0xd99a('0x56')]['id'];return db[_0xd99a('0x44')][_0xd99a('0x4a')]({'where':{'id':_0x98776f}})[_0xd99a('0x27')](handleEntityNotFound(_0x14ffea,null))['then'](function(_0x423ce1){if(_0x423ce1){var _0x497343=['Voice','Chat','Mail',_0xd99a('0x7e'),_0xd99a('0x7f'),_0xd99a('0x80'),'Whatsapp'];return db[_0xd99a('0x57')][_0xd99a('0x81')](function(_0xd14d29){var _0x71cf3a=_[_0xd99a('0x32')](_0x497343,function(_0x167ad9){var _0x5cb030={'attributes':['id','name']};if(_0x167ad9===_0xd99a('0x82')){_0x5cb030[_0xd99a('0x83')]={'attributes':['penalty']};}return _0x423ce1[_0xd99a('0x4d')+_0x167ad9+_0xd99a('0x76')](_0x5cb030)[_0xd99a('0x27')](function(_0x3b4fa7){var _0xd1eef9=_[_0xd99a('0x32')](_0x3b4fa7,function(_0x283023){var _0x249b7f=_[_0xd99a('0x32')](_0x37d4e1,function(_0x3eed5d){var _0x295a7f={'where':{'UserId':_0x3eed5d,[_0x167ad9+_0xd99a('0x84')]:_0x283023['id']},'transaction':_0xd14d29};if(_0x167ad9===_0xd99a('0x82')){_0x295a7f[_0xd99a('0x85')]={'penalty':_0x283023['TeamVoiceQueue'][_0xd99a('0x86')]};}return db[_0xd99a('0x87')+_0x167ad9+_0xd99a('0x74')][_0xd99a('0x88')](_0x295a7f)['then'](function(){socket['emit'](_0xd99a('0x4c')+_0x167ad9+'Queue:save',{'UserId':_0x3eed5d,[_0x167ad9+_0xd99a('0x84')]:_0x283023['id']});if(_0x167ad9!==_0xd99a('0x82')){return;}return db[_0xd99a('0x87')][_0xd99a('0x47')]({'where':{'id':_0x37d4e1,'online':0x1},'attributes':['id',_0xd99a('0x2a'),_0xd99a('0x89'),_0xd99a('0x8a'),_0xd99a('0x8b')],'raw':!![]})['then'](function(_0xcf26c2){var _0x557bab=_['map'](_0xcf26c2,function(_0x1b11e2){return db[_0xd99a('0x8c')]['upsert']({'membername':_0x1b11e2[_0xd99a('0x2a')],'UserId':_0x1b11e2['id'],'queue_name':_0x283023[_0xd99a('0x2a')],'VoiceQueueId':_0x283023['id'],'interface':_[_0xd99a('0x8d')](_0x1b11e2[_0xd99a('0x8b')])?util[_0xd99a('0x8e')](_0xd99a('0x8f'),_0x1b11e2['name']):_0x1b11e2['interface'],'paused':_0x1b11e2[_0xd99a('0x8a')]||![],'penalty':_0x283023[_0xd99a('0x90')][_0xd99a('0x86')]},{'transaction':_0xd14d29});});return Promise[_0xd99a('0x91')](_0x557bab);});});});return Promise[_0xd99a('0x91')](_0x249b7f);});return Promise[_0xd99a('0x91')](_0xd1eef9);})[_0xd99a('0x27')](function(){return db[_0xd99a('0x92')][_0xd99a('0x6e')]({'where':{'teamId':_0x98776f}})['then'](function(_0x19b7cf){if(_0x19b7cf){var _0x2fd4b3=_[_0xd99a('0x32')](_0x37d4e1,function(_0x4fe41b){db[_0xd99a('0x6c')][_0xd99a('0x93')]({'UserId':_0x4fe41b,'VoicePrefixId':_0x19b7cf[_0xd99a('0x94')]});});return Promise['all'](_0x2fd4b3);}});});});return Promise[_0xd99a('0x91')](_0x71cf3a)[_0xd99a('0x27')](function(){return _0x423ce1['addAgents'](_0x37d4e1,{'transaction':_0xd14d29})[_0xd99a('0x95')](function(_0x1762d6){return _0x1762d6;});});});}})['then'](respondWithResult(_0x14ffea,null))[_0xd99a('0x49')](handleError(_0x14ffea,null));};exports['removeAgents']=function(_0x4b269b,_0x1f3e36){var _0x6e8702=_[_0xd99a('0x7d')](_0x4b269b[_0xd99a('0x36')][_0xd99a('0x79')])?_0x4b269b['query'][_0xd99a('0x79')]:[_0x4b269b[_0xd99a('0x36')][_0xd99a('0x79')]];var _0x2b764f=_0x4b269b[_0xd99a('0x56')]['id'];return db[_0xd99a('0x44')]['find']({'where':{'id':_0x2b764f}})[_0xd99a('0x27')](handleEntityNotFound(_0x1f3e36,null))[_0xd99a('0x27')](function(_0x5112b5){if(_0x5112b5){var _0x3d9fbd=[_0xd99a('0x82'),_0xd99a('0x96'),_0xd99a('0x97'),'Sms',_0xd99a('0x7f'),'Openchannel',_0xd99a('0x98')];return db[_0xd99a('0x57')][_0xd99a('0x81')](function(_0x212062){var _0x1a4dfb=_[_0xd99a('0x32')](_0x3d9fbd,function(_0x175b43){var _0x26be01={'attributes':['id',_0xd99a('0x2a')]};return _0x5112b5[_0xd99a('0x4d')+_0x175b43+_0xd99a('0x76')](_0x26be01)[_0xd99a('0x27')](function(_0x61dff8){var _0x4f200a=_[_0xd99a('0x32')](_0x61dff8,function(_0x168711){return _0x168711[_0xd99a('0x99')](_0x6e8702,{'transaction':_0x212062})[_0xd99a('0x27')](function(){var _0x1ff618=_[_0xd99a('0x32')](_0x6e8702,function(_0x249cee){socket[_0xd99a('0x9a')](_0xd99a('0x4c')+_0x175b43+_0xd99a('0x9b'),{'UserId':Number(_0x249cee),[_0x175b43+_0xd99a('0x84')]:_0x168711['id']});if(_0x175b43!==_0xd99a('0x82')){return;}return db['UserVoiceQueueRt'][_0xd99a('0x5f')]({'where':{'VoiceQueueId':_0x168711['id'],'UserId':_0x249cee},'transaction':_0x212062});});return Promise['all'](_0x1ff618);});});return Promise[_0xd99a('0x91')](_0x4f200a);});});return Promise[_0xd99a('0x91')](_0x1a4dfb)['then'](function(){return _0x5112b5[_0xd99a('0x99')](_0x6e8702,{'transaction':_0x212062});})[_0xd99a('0x27')](function(){return db[_0xd99a('0x92')][_0xd99a('0x6e')]({'where':{'teamId':_0x2b764f}})[_0xd99a('0x27')](function(_0x5f5bdc){if(_0x5f5bdc){var _0x3ec3e2=_[_0xd99a('0x32')](_0x6e8702,function(_0x29bc1f){db[_0xd99a('0x6c')]['destroy']({'where':{'UserId':_0x29bc1f,'VoicePrefixId':_0x5f5bdc[_0xd99a('0x94')]}});});return Promise[_0xd99a('0x91')](_0x3ec3e2);}});});});}})['then'](respondWithStatusCode(_0x1f3e36,null))[_0xd99a('0x49')](handleError(_0x1f3e36,null));};exports[_0xd99a('0x9c')]=function(_0x25a663,_0x585f53,_0xc3ab3c){var _0x255e50={};var _0x4366d5={};var _0xf4c2ac;var _0x18e329;return db['Team'][_0xd99a('0x6e')]({'where':{'id':_0x25a663[_0xd99a('0x56')]['id']}})[_0xd99a('0x27')](handleEntityNotFound(_0x585f53,null))[_0xd99a('0x27')](function(_0x1ba98e){if(_0x1ba98e){_0xf4c2ac=_0x1ba98e;_0x4366d5[_0xd99a('0x31')]=_[_0xd99a('0x33')](db[_0xd99a('0x87')]['rawAttributes']);_0x4366d5[_0xd99a('0x36')]=_[_0xd99a('0x33')](_0x25a663[_0xd99a('0x36')]);_0x4366d5['filters']=_[_0xd99a('0x35')](_0x4366d5[_0xd99a('0x31')],_0x4366d5[_0xd99a('0x36')]);_0x255e50[_0xd99a('0x37')]=_[_0xd99a('0x35')](_0x4366d5[_0xd99a('0x31')],qs[_0xd99a('0x38')](_0x25a663[_0xd99a('0x36')][_0xd99a('0x38')]));_0x255e50[_0xd99a('0x37')]=_0x255e50['attributes'][_0xd99a('0x39')]?_0x255e50['attributes']:_0x4366d5['model'];_0x255e50[_0xd99a('0x3c')]=qs[_0xd99a('0x3d')](_0x25a663['query']['sort']);_0x255e50[_0xd99a('0x3e')]=qs[_0xd99a('0x34')](_['pick'](_0x25a663['query'],_0x4366d5[_0xd99a('0x34')]));if(_0x25a663[_0xd99a('0x36')][_0xd99a('0x41')]){_0x255e50[_0xd99a('0x3e')]=_['merge'](_0x255e50[_0xd99a('0x3e')],{'$or':_[_0xd99a('0x32')](_0x255e50[_0xd99a('0x37')],function(_0x308395){var _0x11441f={};_0x11441f[_0x308395]={'$like':'%'+_0x25a663[_0xd99a('0x36')][_0xd99a('0x41')]+'%'};return _0x11441f;})});}_0x255e50=_['merge']({},_0x255e50,_0x25a663[_0xd99a('0x43')]);return _0xf4c2ac[_0xd99a('0x9c')](_0x255e50);}})['then'](function(_0x51dd91){if(_0x51dd91){_0x18e329=_0x51dd91['length'];if(!_0x25a663['query']['hasOwnProperty'](_0xd99a('0x3b'))){_0x255e50[_0xd99a('0x20')]=qs[_0xd99a('0x20')](_0x25a663['query'][_0xd99a('0x20')]);_0x255e50[_0xd99a('0x1f')]=qs[_0xd99a('0x1f')](_0x25a663['query'][_0xd99a('0x1f')]);}return _0xf4c2ac[_0xd99a('0x9c')](_0x255e50);}})[_0xd99a('0x27')](function(_0xa92ec1){if(_0xa92ec1){return _0xa92ec1?{'count':_0x18e329,'rows':_0xa92ec1}:null;}})[_0xd99a('0x27')](respondWithResult(_0x585f53,null))[_0xd99a('0x49')](handleError(_0x585f53,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 7b567c0..2a7fc72 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 _0xd61a=['hook','exports','events','Team','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x47d582,_0x175d08){var _0x1683a2=function(_0x9b4413){while(--_0x9b4413){_0x47d582['push'](_0x47d582['shift']());}};_0x1683a2(++_0x175d08);}(_0xd61a,0x192));var _0xad61=function(_0x179d07,_0x29431a){_0x179d07=_0x179d07-0x0;var _0xbcbe0b=_0xd61a[_0x179d07];return _0xbcbe0b;};'use strict';var EventEmitter=require(_0xad61('0x0'));var Team=require('../../mysqldb')['db'][_0xad61('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xad61('0x2')](0x0);var events={'afterCreate':_0xad61('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x526837){return function(_0x2090fc,_0x2e0f47,_0x46ed45){TeamEvents[_0xad61('0x4')](_0x526837+':'+_0x2090fc['id'],_0x2090fc);TeamEvents[_0xad61('0x4')](_0x526837,_0x2090fc);_0x46ed45(null);};}for(var e in events){if(events[_0xad61('0x5')](e)){var event=events[e];Team[_0xad61('0x6')](e,emitEvent(event));}}module[_0xad61('0x7')]=TeamEvents; \ No newline at end of file +var _0xf3b1=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners'];(function(_0xda4776,_0x2485e0){var _0x39effb=function(_0x5b0764){while(--_0x5b0764){_0xda4776['push'](_0xda4776['shift']());}};_0x39effb(++_0x2485e0);}(_0xf3b1,0x115));var _0x1f3b=function(_0x52d529,_0x258725){_0x52d529=_0x52d529-0x0;var _0x585c33=_0xf3b1[_0x52d529];return _0x585c33;};'use strict';var EventEmitter=require('events');var Team=require(_0x1f3b('0x0'))['db'][_0x1f3b('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x1f3b('0x2')](0x0);var events={'afterCreate':_0x1f3b('0x3'),'afterUpdate':_0x1f3b('0x4'),'afterDestroy':_0x1f3b('0x5')};function emitEvent(_0x3f3331){return function(_0x554035,_0x4ee1cd,_0x161333){TeamEvents[_0x1f3b('0x6')](_0x3f3331+':'+_0x554035['id'],_0x554035);TeamEvents['emit'](_0x3f3331,_0x554035);_0x161333(null);};}for(var e in events){if(events[_0x1f3b('0x7')](e)){var event=events[e];Team[_0x1f3b('0x8')](e,emitEvent(event));}}module[_0x1f3b('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 4b5dfbf..57ee07a 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 _0xc0eb=['get','then','setDataValue','channel','catch','exports','define','Team','Chat','Mail','Openchannel','resolve','map','all','./team.attributes'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xc0eb,0x1a3));var _0xbc0e=function(_0x5b9029,_0x2f77f5){_0x5b9029=_0x5b9029-0x0;var _0x518754=_0xc0eb[_0x5b9029];return _0x518754;};'use strict';var _=require('lodash');var attributes=require(_0xbc0e('0x0'));function getQueuesByChannel(_0x60b5eb,_0x40dd99){var _0x4d54cc=_0xbc0e('0x1')+_0x40dd99+'Queues';return _0x60b5eb[_0x4d54cc]()[_0xbc0e('0x2')](function(_0x543143){return _['map'](_0x543143,function(_0x4673e5){_0x4673e5[_0xbc0e('0x3')](_0xbc0e('0x4'),_0x40dd99);return _0x4673e5;});})[_0xbc0e('0x5')](function(_0x3d3640){throw _0x3d3640;});}module[_0xbc0e('0x6')]=function(_0x485139){return _0x485139[_0xbc0e('0x7')](_0xbc0e('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1cb004=this;var _0x5e066c=[_0xbc0e('0x9'),'Fax',_0xbc0e('0xa'),_0xbc0e('0xb'),'Sms','Voice','Whatsapp'];return Promise[_0xbc0e('0xc')]()[_0xbc0e('0x2')](function(){var _0x355243=_[_0xbc0e('0xd')](_0x5e066c,function(_0x2ffacf){return getQueuesByChannel(_0x1cb004,_0x2ffacf);});return Promise[_0xbc0e('0xe')](_0x355243);})['catch'](function(_0x452cf7){throw _0x452cf7;});}}});}; \ No newline at end of file +var _0xd24b=['Chat','Fax','Openchannel','Sms','Voice','Whatsapp','resolve','all','lodash','./team.attributes','Queues','then','map','setDataValue','channel','catch','exports','teams'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd24b,0x1ca));var _0xbd24=function(_0x3e543d,_0x4f3548){_0x3e543d=_0x3e543d-0x0;var _0x51285c=_0xd24b[_0x3e543d];return _0x51285c;};'use strict';var _=require(_0xbd24('0x0'));var attributes=require(_0xbd24('0x1'));function getQueuesByChannel(_0x26c332,_0x4d1e0e){var _0x7cd7c6='get'+_0x4d1e0e+_0xbd24('0x2');return _0x26c332[_0x7cd7c6]()[_0xbd24('0x3')](function(_0x3ee1af){return _[_0xbd24('0x4')](_0x3ee1af,function(_0x413cf1){_0x413cf1[_0xbd24('0x5')](_0xbd24('0x6'),_0x4d1e0e);return _0x413cf1;});})[_0xbd24('0x7')](function(_0x33c4c2){throw _0x33c4c2;});}module[_0xbd24('0x8')]=function(_0x1e56fc){return _0x1e56fc['define']('Team',attributes,{'tableName':_0xbd24('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x531bce=this;var _0x274931=[_0xbd24('0xa'),_0xbd24('0xb'),'Mail',_0xbd24('0xc'),_0xbd24('0xd'),_0xbd24('0xe'),_0xbd24('0xf')];return Promise[_0xbd24('0x10')]()['then'](function(){var _0x3768fe=_[_0xbd24('0x4')](_0x274931,function(_0x59811c){return getQueuesByChannel(_0x531bce,_0x59811c);});return Promise[_0xbd24('0x11')](_0x3768fe);})[_0xbd24('0x7')](function(_0x50edd7){throw _0x50edd7;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 3248d8d..9f7cdb0 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 _0x2c6d=['register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./team.socket'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x2c6d,0x64));var _0xd2c6=function(_0xe72008,_0x585e49){_0xe72008=_0xe72008-0x0;var _0x3214e0=_0x2c6d[_0xe72008];return _0x3214e0;};'use strict';var _=require(_0xd2c6('0x0'));var util=require(_0xd2c6('0x1'));var moment=require(_0xd2c6('0x2'));var BPromise=require(_0xd2c6('0x3'));var rs=require(_0xd2c6('0x4'));var fs=require('fs');var Redis=require(_0xd2c6('0x5'));var db=require(_0xd2c6('0x6'))['db'];var utils=require(_0xd2c6('0x7'));var logger=require(_0xd2c6('0x8'))('rpc');var config=require(_0xd2c6('0x9'));var jayson=require(_0xd2c6('0xa'));var client=jayson['client'][_0xd2c6('0xb')]({'port':0x232a});config[_0xd2c6('0xc')]=_[_0xd2c6('0xd')](config[_0xd2c6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd2c6('0xe'))(new Redis(config['redis']));require(_0xd2c6('0xf'))[_0xd2c6('0x10')](socket);function respondWithRpcPromise(_0x3fbe3f,_0x5b9f8d,_0x3285f3){return new BPromise(function(_0x4b8897,_0x5389b4){return client[_0xd2c6('0x11')](_0x3fbe3f,_0x3285f3)[_0xd2c6('0x12')](function(_0x10d4ef){logger[_0xd2c6('0x13')](_0xd2c6('0x14'),_0x5b9f8d,_0xd2c6('0x15'));logger[_0xd2c6('0x16')](_0xd2c6('0x17'),_0x5b9f8d,'request\x20sent',JSON[_0xd2c6('0x18')](_0x10d4ef));if(_0x10d4ef[_0xd2c6('0x19')]){if(_0x10d4ef[_0xd2c6('0x19')][_0xd2c6('0x1a')]===0x1f4){logger[_0xd2c6('0x19')]('Team,\x20%s,\x20%s',_0x5b9f8d,_0x10d4ef[_0xd2c6('0x19')]['message']);return _0x5389b4(_0x10d4ef[_0xd2c6('0x19')]['message']);}logger['error'](_0xd2c6('0x14'),_0x5b9f8d,_0x10d4ef['error'][_0xd2c6('0x1b')]);return _0x4b8897(_0x10d4ef[_0xd2c6('0x19')][_0xd2c6('0x1b')]);}else{logger['info'](_0xd2c6('0x14'),_0x5b9f8d,_0xd2c6('0x15'));_0x4b8897(_0x10d4ef[_0xd2c6('0x1c')]['message']);}})['catch'](function(_0x4b3f8f){logger[_0xd2c6('0x19')](_0xd2c6('0x14'),_0x5b9f8d,_0x4b3f8f);_0x5389b4(_0x4b3f8f);});});} \ No newline at end of file +var _0xb190=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x86a411,_0x459440){var _0x6e98e4=function(_0x2c5c9b){while(--_0x2c5c9b){_0x86a411['push'](_0x86a411['shift']());}};_0x6e98e4(++_0x459440);}(_0xb190,0x1ca));var _0x0b19=function(_0x20cf81,_0x4c8ba6){_0x20cf81=_0x20cf81-0x0;var _0x246890=_0xb190[_0x20cf81];return _0x246890;};'use strict';var _=require(_0x0b19('0x0'));var util=require('util');var moment=require(_0x0b19('0x1'));var BPromise=require(_0x0b19('0x2'));var rs=require(_0x0b19('0x3'));var fs=require('fs');var Redis=require(_0x0b19('0x4'));var db=require(_0x0b19('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b19('0x6'));var jayson=require(_0x0b19('0x7'));var client=jayson[_0x0b19('0x8')][_0x0b19('0x9')]({'port':0x232a});config[_0x0b19('0xa')]=_[_0x0b19('0xb')](config[_0x0b19('0xa')],{'host':_0x0b19('0xc'),'port':0x18eb});var socket=require(_0x0b19('0xd'))(new Redis(config['redis']));require(_0x0b19('0xe'))[_0x0b19('0xf')](socket);function respondWithRpcPromise(_0x24ba7b,_0x267736,_0x40329f){return new BPromise(function(_0x5e381d,_0x8ee0cc){return client[_0x0b19('0x10')](_0x24ba7b,_0x40329f)[_0x0b19('0x11')](function(_0x222d13){logger[_0x0b19('0x12')](_0x0b19('0x13'),_0x267736,_0x0b19('0x14'));logger[_0x0b19('0x15')](_0x0b19('0x16'),_0x267736,_0x0b19('0x14'),JSON['stringify'](_0x222d13));if(_0x222d13[_0x0b19('0x17')]){if(_0x222d13[_0x0b19('0x17')][_0x0b19('0x18')]===0x1f4){logger[_0x0b19('0x17')](_0x0b19('0x13'),_0x267736,_0x222d13[_0x0b19('0x17')][_0x0b19('0x19')]);return _0x8ee0cc(_0x222d13[_0x0b19('0x17')][_0x0b19('0x19')]);}logger[_0x0b19('0x17')]('Team,\x20%s,\x20%s',_0x267736,_0x222d13[_0x0b19('0x17')][_0x0b19('0x19')]);return _0x5e381d(_0x222d13['error'][_0x0b19('0x19')]);}else{logger['info'](_0x0b19('0x13'),_0x267736,_0x0b19('0x14'));_0x5e381d(_0x222d13[_0x0b19('0x1a')][_0x0b19('0x19')]);}})['catch'](function(_0x1a4cab){logger[_0x0b19('0x17')](_0x0b19('0x13'),_0x267736,_0x1a4cab);_0x8ee0cc(_0x1a4cab);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index a2c52e3..35256fd 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 _0x4e94=['save','update','emit','length','team:','./team.events'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x4e94,0x155));var _0x44e9=function(_0x3b6652,_0x32486d){_0x3b6652=_0x3b6652-0x0;var _0x14d39f=_0x4e94[_0x3b6652];return _0x14d39f;};'use strict';var TeamEvents=require(_0x44e9('0x0'));var events=[_0x44e9('0x1'),'remove',_0x44e9('0x2')];function createListener(_0xd34fab,_0x4819b9){return function(_0x588834){_0x4819b9[_0x44e9('0x3')](_0xd34fab,_0x588834);};}function removeListener(_0x589ab3,_0x3a7f9b){return function(){TeamEvents['removeListener'](_0x589ab3,_0x3a7f9b);};}exports['register']=function(_0x4ae4f4){for(var _0x3c2680=0x0,_0x1b9c32=events[_0x44e9('0x4')];_0x3c2680<_0x1b9c32;_0x3c2680++){var _0x55b18a=events[_0x3c2680];var _0xdc9afd=createListener(_0x44e9('0x5')+_0x55b18a,_0x4ae4f4);TeamEvents['on'](_0x55b18a,_0xdc9afd);}}; \ No newline at end of file +var _0xff83=['emit','team:','save','remove','update'];(function(_0x28678d,_0x54324f){var _0x1643e9=function(_0x873a6c){while(--_0x873a6c){_0x28678d['push'](_0x28678d['shift']());}};_0x1643e9(++_0x54324f);}(_0xff83,0x98));var _0x3ff8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xff83[_0x311c35];return _0x5cc50c;};'use strict';var TeamEvents=require('./team.events');var events=[_0x3ff8('0x0'),_0x3ff8('0x1'),_0x3ff8('0x2')];function createListener(_0x3280af,_0x4d8bb8){return function(_0x4db20d){_0x4d8bb8[_0x3ff8('0x3')](_0x3280af,_0x4db20d);};}function removeListener(_0x173f67,_0x3b185d){return function(){TeamEvents['removeListener'](_0x173f67,_0x3b185d);};}exports['register']=function(_0x163c8c){for(var _0x533bba=0x0,_0x49f70f=events['length'];_0x533bba<_0x49f70f;_0x533bba++){var _0x65158c=events[_0x533bba];var _0x184b3f=createListener(_0x3ff8('0x4')+_0x65158c,_0x163c8c);TeamEvents['on'](_0x65158c,_0x184b3f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 26f84df..b4b037e 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 _0x44d4=['sequelize'];(function(_0x21a4e3,_0x1b2882){var _0x5ab977=function(_0x162fce){while(--_0x162fce){_0x21a4e3['push'](_0x21a4e3['shift']());}};_0x5ab977(++_0x1b2882);}(_0x44d4,0x161));var _0x444d=function(_0x373a1b,_0x5d97b6){_0x373a1b=_0x373a1b-0x0;var _0x2a754e=_0x44d4[_0x373a1b];return _0x2a754e;};'use strict';var Sequelize=require(_0x444d('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf82e=['INTEGER','sequelize','exports'];(function(_0x3496c0,_0x2c108d){var _0x35e985=function(_0x51d9bb){while(--_0x51d9bb){_0x3496c0['push'](_0x3496c0['shift']());}};_0x35e985(++_0x2c108d);}(_0xf82e,0x172));var _0xef82=function(_0x2983b6,_0x2dc13c){_0x2983b6=_0x2983b6-0x0;var _0x3c24f9=_0xf82e[_0x2983b6];return _0x3c24f9;};'use strict';var Sequelize=require(_0xef82('0x0'));module[_0xef82('0x1')]={'TeamId':{'type':Sequelize[_0xef82('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xef82('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 470cc83..2c1fa99 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 _0xf3e2=['moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x54ac3e,_0x2aaa57){var _0x5e8c04=function(_0x42e792){while(--_0x42e792){_0x54ac3e['push'](_0x54ac3e['shift']());}};_0x5e8c04(++_0x2aaa57);}(_0xf3e2,0x168));var _0x2f3e=function(_0x1a8192,_0x3453f2){_0x1a8192=_0x1a8192-0x0;var _0x131de2=_0xf3e2[_0x1a8192];return _0x131de2;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var logger=require(_0x2f3e('0x2'))(_0x2f3e('0x3'));var moment=require(_0x2f3e('0x4'));var BPromise=require(_0x2f3e('0x5'));var rp=require(_0x2f3e('0x6'));var fs=require('fs');var path=require(_0x2f3e('0x7'));var rimraf=require('rimraf');var config=require(_0x2f3e('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0x2f3e('0x9')]=function(_0xd3f5b,_0x3a0b5a){return _0xd3f5b[_0x2f3e('0xa')](_0x2f3e('0xb'),attributes,{'tableName':_0x2f3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab23=['rimraf','../../config/environment','./teamVoicePrefix.attributes','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xab23,0x1bc));var _0x3ab2=function(_0x582c7d,_0x24ed82){_0x582c7d=_0x582c7d-0x0;var _0x3caa7d=_0xab23[_0x582c7d];return _0x3caa7d;};'use strict';var _=require(_0x3ab2('0x0'));var util=require(_0x3ab2('0x1'));var logger=require(_0x3ab2('0x2'))(_0x3ab2('0x3'));var moment=require(_0x3ab2('0x4'));var BPromise=require(_0x3ab2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ab2('0x6'));var rimraf=require(_0x3ab2('0x7'));var config=require(_0x3ab2('0x8'));var attributes=require(_0x3ab2('0x9'));module['exports']=function(_0x5222ba,_0x3445f2){return _0x5222ba['define']('TeamVoicePrefix',attributes,{'tableName':_0x3ab2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b0147c5..f3efb98 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x261c28,_0xdc5b7f){var _0x2a0966=function(_0x3ad24c){while(--_0x3ad24c){_0x261c28['push'](_0x261c28['shift']());}};_0x2a0966(++_0xdc5b7f);}(_0xedd9,0xfc));var _0x9edd=function(_0x502871,_0x1e2991){_0x502871=_0x502871-0x0;var _0x593666=_0xedd9[_0x502871];return _0x593666;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4d4062,_0x219da8){var _0x8b964b=function(_0x3eb912){while(--_0x3eb912){_0x4d4062['push'](_0x4d4062['shift']());}};_0x8b964b(++_0x219da8);}(_0x70e0,0x17b));var _0x070e=function(_0x5cc222,_0x48e591){_0x5cc222=_0x5cc222-0x0;var _0x88aa01=_0x70e0[_0x5cc222];return _0x88aa01;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 10e793b..12972bf 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 _0xbcfe=['sequelize','exports'];(function(_0x4151ca,_0x473036){var _0x353f3a=function(_0x555312){while(--_0x555312){_0x4151ca['push'](_0x4151ca['shift']());}};_0x353f3a(++_0x473036);}(_0xbcfe,0xe6));var _0xebcf=function(_0x11ecd9,_0x49c81d){_0x11ecd9=_0x11ecd9-0x0;var _0x3e0008=_0xbcfe[_0x11ecd9];return _0x3e0008;};'use strict';var Sequelize=require(_0xebcf('0x0'));module[_0xebcf('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1388=['sequelize'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x1388,0x101));var _0x8138=function(_0x27c7b2,_0x3c8adc){_0x27c7b2=_0x27c7b2-0x0;var _0x33829e=_0x1388[_0x27c7b2];return _0x33829e;};'use strict';var Sequelize=require(_0x8138('0x0'));module['exports']={'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 4a925a0..6a86f1c 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 _0x4b19=['api','moment','request-promise','path','rimraf','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4b19,0x195));var _0x94b1=function(_0x17775c,_0x5a1634){_0x17775c=_0x17775c-0x0;var _0x44262b=_0x4b19[_0x17775c];return _0x44262b;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var logger=require(_0x94b1('0x1'))(_0x94b1('0x2'));var moment=require(_0x94b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x94b1('0x4'));var fs=require('fs');var path=require(_0x94b1('0x5'));var rimraf=require(_0x94b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x94b1('0x7'));module[_0x94b1('0x8')]=function(_0x52d6c1,_0x24df76){return _0x52d6c1[_0x94b1('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x94b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38c3=['api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x452bc8,_0x26a1d2){var _0x422d19=function(_0x5984c1){while(--_0x5984c1){_0x452bc8['push'](_0x452bc8['shift']());}};_0x422d19(++_0x26a1d2);}(_0x38c3,0x13d));var _0x338c=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x38c3[_0xdd82b4];return _0x549bb2;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var logger=require('../../config/logger')(_0x338c('0x2'));var moment=require(_0x338c('0x3'));var BPromise=require(_0x338c('0x4'));var rp=require(_0x338c('0x5'));var fs=require('fs');var path=require(_0x338c('0x6'));var rimraf=require(_0x338c('0x7'));var config=require('../../config/environment');var attributes=require(_0x338c('0x8'));module['exports']=function(_0x41c16d,_0x28eeb3){return _0x41c16d['define'](_0x338c('0x9'),attributes,{'tableName':_0x338c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 61ced9f..f26e813 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 _0xc8de=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util'];(function(_0x5a77fb,_0x2d2d59){var _0x6ca4fb=function(_0x428777){while(--_0x428777){_0x5a77fb['push'](_0x5a77fb['shift']());}};_0x6ca4fb(++_0x2d2d59);}(_0xc8de,0x167));var _0xec8d=function(_0x30bfd8,_0x5a26f2){_0x30bfd8=_0x30bfd8-0x0;var _0x4f46b2=_0xc8de[_0x30bfd8];return _0x4f46b2;};'use strict';var _=require('lodash');var util=require(_0xec8d('0x0'));var moment=require(_0xec8d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec8d('0x2'));var db=require(_0xec8d('0x3'))['db'];var utils=require(_0xec8d('0x4'));var logger=require(_0xec8d('0x5'))(_0xec8d('0x6'));var config=require(_0xec8d('0x7'));var jayson=require(_0xec8d('0x8'));var client=jayson['client'][_0xec8d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55e36c,_0x11308b,_0x596921){return new BPromise(function(_0x37de69,_0x597c70){return client[_0xec8d('0xa')](_0x55e36c,_0x596921)['then'](function(_0x2e028d){logger[_0xec8d('0xb')](_0xec8d('0xc'),_0x11308b,_0xec8d('0xd'));logger[_0xec8d('0xe')](_0xec8d('0xf'),_0x11308b,_0xec8d('0xd'),JSON[_0xec8d('0x10')](_0x2e028d));if(_0x2e028d[_0xec8d('0x11')]){if(_0x2e028d[_0xec8d('0x11')]['code']===0x1f4){logger[_0xec8d('0x11')](_0xec8d('0xc'),_0x11308b,_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);return _0x597c70(_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);}logger[_0xec8d('0x11')](_0xec8d('0xc'),_0x11308b,_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);return _0x37de69(_0x2e028d[_0xec8d('0x11')][_0xec8d('0x12')]);}else{logger['info'](_0xec8d('0xc'),_0x11308b,_0xec8d('0xd'));_0x37de69(_0x2e028d[_0xec8d('0x13')][_0xec8d('0x12')]);}})['catch'](function(_0x2fb24f){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x11308b,_0x2fb24f);_0x597c70(_0x2fb24f);});});} \ No newline at end of file +var _0x498a=['message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x498a,0x1bc));var _0xa498=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x498a[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xa498('0x0'));var util=require(_0xa498('0x1'));var moment=require('moment');var BPromise=require(_0xa498('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa498('0x3'))['db'];var utils=require(_0xa498('0x4'));var logger=require(_0xa498('0x5'))(_0xa498('0x6'));var config=require('../../config/environment');var jayson=require(_0xa498('0x7'));var client=jayson['client'][_0xa498('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x346d01,_0x5212fe,_0xe38dd){return new BPromise(function(_0x703b,_0x55cace){return client[_0xa498('0x9')](_0x346d01,_0xe38dd)[_0xa498('0xa')](function(_0x48f8d3){logger[_0xa498('0xb')](_0xa498('0xc'),_0x5212fe,_0xa498('0xd'));logger[_0xa498('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5212fe,_0xa498('0xd'),JSON[_0xa498('0xf')](_0x48f8d3));if(_0x48f8d3[_0xa498('0x10')]){if(_0x48f8d3['error'][_0xa498('0x11')]===0x1f4){logger[_0xa498('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5212fe,_0x48f8d3[_0xa498('0x10')]['message']);return _0x55cace(_0x48f8d3['error'][_0xa498('0x12')]);}logger[_0xa498('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5212fe,_0x48f8d3[_0xa498('0x10')][_0xa498('0x12')]);return _0x703b(_0x48f8d3[_0xa498('0x10')][_0xa498('0x12')]);}else{logger[_0xa498('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5212fe,_0xa498('0xd'));_0x703b(_0x48f8d3[_0xa498('0x13')][_0xa498('0x12')]);}})[_0xa498('0x14')](function(_0x1cbd56){logger['error'](_0xa498('0xc'),_0x5212fe,_0x1cbd56);_0x55cace(_0x1cbd56);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ac95910..3369615 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 _0x6edc=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x1acaf8,_0xda1220){var _0x5e248a=function(_0x14e5ea){while(--_0x14e5ea){_0x1acaf8['push'](_0x1acaf8['shift']());}};_0x5e248a(++_0xda1220);}(_0x6edc,0x138));var _0xc6ed=function(_0x529717,_0x72866e){_0x529717=_0x529717-0x0;var _0x415c82=_0x6edc[_0x529717];return _0x415c82;};'use strict';var multer=require(_0xc6ed('0x0'));var util=require(_0xc6ed('0x1'));var path=require(_0xc6ed('0x2'));var timeout=require(_0xc6ed('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc6ed('0x4'));var auth=require(_0xc6ed('0x5'));var interaction=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var controller=require('./template.controller');router[_0xc6ed('0x8')]('/',auth[_0xc6ed('0x9')](),controller[_0xc6ed('0xa')]);router['get'](_0xc6ed('0xb'),auth['isAuthenticated'](),controller[_0xc6ed('0xc')]);router[_0xc6ed('0xd')]('/',auth[_0xc6ed('0x9')](),controller[_0xc6ed('0xe')]);router['put'](_0xc6ed('0xb'),auth[_0xc6ed('0x9')](),controller[_0xc6ed('0xf')]);router['delete']('/:id',auth[_0xc6ed('0x9')](),controller[_0xc6ed('0x10')]);module[_0xc6ed('0x11')]=router; \ No newline at end of file +var _0x5ae0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router'];(function(_0x16b119,_0x59e983){var _0x4afddf=function(_0x5ee09b){while(--_0x5ee09b){_0x16b119['push'](_0x16b119['shift']());}};_0x4afddf(++_0x59e983);}(_0x5ae0,0xf8));var _0x05ae=function(_0x481728,_0x1c1f96){_0x481728=_0x481728-0x0;var _0x3ce6ca=_0x5ae0[_0x481728];return _0x3ce6ca;};'use strict';var multer=require('multer');var util=require(_0x05ae('0x0'));var path=require(_0x05ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x05ae('0x2'));var router=express[_0x05ae('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05ae('0x4'));var interaction=require(_0x05ae('0x5'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x05ae('0x6')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0x8')]);router['get'](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xa')]);router[_0x05ae('0xb')]('/',auth[_0x05ae('0x7')](),controller[_0x05ae('0xc')]);router[_0x05ae('0xd')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0xe')]);router[_0x05ae('0xf')](_0x05ae('0x9'),auth[_0x05ae('0x7')](),controller[_0x05ae('0x10')]);module[_0x05ae('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 457f0f6..ae98e01 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 _0x4973=['STRING','TEXT','sequelize'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4973,0x1d6));var _0x3497=function(_0x58175f,_0x275d92){_0x58175f=_0x58175f-0x0;var _0x37e6bc=_0x4973[_0x58175f];return _0x37e6bc;};'use strict';var Sequelize=require(_0x3497('0x0'));module['exports']={'name':{'type':Sequelize[_0x3497('0x1')]},'description':{'type':Sequelize[_0x3497('0x1')]},'html':{'type':Sequelize[_0x3497('0x2')]}}; \ No newline at end of file +var _0x68a1=['STRING','TEXT','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68a1,0x155));var _0x168a=function(_0x4afa51,_0x4a20f1){_0x4afa51=_0x4afa51-0x0;var _0x19a1de=_0x68a1[_0x4afa51];return _0x19a1de;};'use strict';var Sequelize=require('sequelize');module[_0x168a('0x0')]={'name':{'type':Sequelize[_0x168a('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x168a('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a19e870..7203452 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 _0x46b0=['set','apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','Template','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Templates','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count'];(function(_0x2fc870,_0x2f12d1){var _0x3d67e6=function(_0x1e52f5){while(--_0x1e52f5){_0x2fc870['push'](_0x2fc870['shift']());}};_0x3d67e6(++_0x2f12d1);}(_0x46b0,0xcc));var _0x046b=function(_0x1a432d,_0xbaf3b){_0x1a432d=_0x1a432d-0x0;var _0x443849=_0x46b0[_0x1a432d];return _0x443849;};'use strict';var emlformat=require(_0x046b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x046b('0x1'));var rp=require('request-promise');var moment=require(_0x046b('0x2'));var BPromise=require(_0x046b('0x3'));var Mustache=require(_0x046b('0x4'));var util=require(_0x046b('0x5'));var path=require(_0x046b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x046b('0x7'));var fs=require('fs');var fs_extra=require(_0x046b('0x8'));var _=require(_0x046b('0x9'));var squel=require(_0x046b('0xa'));var crypto=require(_0x046b('0xb'));var jsforce=require(_0x046b('0xc'));var deskjs=require(_0x046b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x046b('0xe'));var Redis=require(_0x046b('0xf'));var authService=require(_0x046b('0x10'));var qs=require(_0x046b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x046b('0x12'));var logger=require(_0x046b('0x13'))(_0x046b('0x14'));var utils=require(_0x046b('0x15'));var config=require(_0x046b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1631bc,_0xe5eba2){_0xe5eba2=_0xe5eba2||0xcc;return function(_0x86562f){if(_0x86562f){return _0x1631bc[_0x046b('0x17')](_0xe5eba2);}return _0x1631bc[_0x046b('0x18')](_0xe5eba2)[_0x046b('0x19')]();};}function respondWithResult(_0x3e1bb0,_0x257763){_0x257763=_0x257763||0xc8;return function(_0x393d0a){if(_0x393d0a){return _0x3e1bb0[_0x046b('0x18')](_0x257763)[_0x046b('0x1a')](_0x393d0a);}};}function respondWithFilteredResult(_0x3b3321,_0x385e01){return function(_0x35baf0){if(_0x35baf0){var _0x4e84e2=typeof _0x385e01[_0x046b('0x1b')]==='undefined'&&typeof _0x385e01[_0x046b('0x1c')]==='undefined';var _0x55e7f4=_0x35baf0[_0x046b('0x1d')];var _0x1f56ff=_0x4e84e2?0x0:_0x385e01['offset'];var _0x2823d7=_0x4e84e2?_0x35baf0['count']:_0x385e01[_0x046b('0x1b')]+_0x385e01['limit'];var _0x4953b7;if(_0x2823d7>=_0x55e7f4){_0x2823d7=_0x55e7f4;_0x4953b7=0xc8;}else{_0x4953b7=0xce;}_0x3b3321[_0x046b('0x18')](_0x4953b7);return _0x3b3321[_0x046b('0x1e')]('Content-Range',_0x1f56ff+'-'+_0x2823d7+'/'+_0x55e7f4)[_0x046b('0x1a')](_0x35baf0);}return null;};}function patchUpdates(_0xa87135){return function(_0x546cab){try{jsonpatch[_0x046b('0x1f')](_0x546cab,_0xa87135,!![]);}catch(_0x473257){return BPromise[_0x046b('0x20')](_0x473257);}return _0x546cab['save']();};}function saveUpdates(_0x487146,_0x5bda65){return function(_0x24cf02){if(_0x24cf02){return _0x24cf02[_0x046b('0x21')](_0x487146)[_0x046b('0x22')](function(_0x427d37){return _0x427d37;});}return null;};}function removeEntity(_0x463ddb,_0xcb5816){return function(_0x1cc461){if(_0x1cc461){return _0x1cc461['destroy']()[_0x046b('0x22')](function(){var _0x3e4bac=_0x1cc461[_0x046b('0x23')]({'plain':!![]});var _0x22099a='Templates';return db[_0x046b('0x24')][_0x046b('0x25')]({'where':{'type':_0x22099a,'resourceId':_0x3e4bac['id']}})['then'](function(){return _0x1cc461;});})[_0x046b('0x22')](function(){_0x463ddb['status'](0xcc)[_0x046b('0x19')]();});}};}function handleEntityNotFound(_0x26746c,_0x44931a){return function(_0x51ec6c){if(!_0x51ec6c){_0x26746c[_0x046b('0x17')](0x194);}return _0x51ec6c;};}function handleError(_0x314705,_0x2d5d39){_0x2d5d39=_0x2d5d39||0x1f4;return function(_0x2d438e){logger[_0x046b('0x26')](_0x2d438e[_0x046b('0x27')]);if(_0x2d438e[_0x046b('0x28')]){delete _0x2d438e[_0x046b('0x28')];}_0x314705[_0x046b('0x18')](_0x2d5d39)[_0x046b('0x29')](_0x2d438e);};}exports['index']=function(_0xdf9223,_0x37d603){var _0x1f8fb6={},_0x3dff63={},_0x48690e={'count':0x0,'rows':[]};var _0x15c614=_[_0x046b('0x2a')](db[_0x046b('0x2b')]['rawAttributes'],function(_0x41387c){return{'name':_0x41387c[_0x046b('0x2c')],'type':_0x41387c[_0x046b('0x2d')]['key']};});_0x3dff63[_0x046b('0x2e')]=_[_0x046b('0x2a')](_0x15c614,_0x046b('0x28'));_0x3dff63[_0x046b('0x2f')]=_[_0x046b('0x30')](_0xdf9223[_0x046b('0x2f')]);_0x3dff63[_0x046b('0x31')]=_[_0x046b('0x32')](_0x3dff63[_0x046b('0x2e')],_0x3dff63[_0x046b('0x2f')]);_0x1f8fb6[_0x046b('0x33')]=_[_0x046b('0x32')](_0x3dff63['model'],qs[_0x046b('0x34')](_0xdf9223['query'][_0x046b('0x34')]));_0x1f8fb6['attributes']=_0x1f8fb6['attributes'][_0x046b('0x35')]?_0x1f8fb6[_0x046b('0x33')]:_0x3dff63[_0x046b('0x2e')];if(!_0xdf9223[_0x046b('0x2f')]['hasOwnProperty']('nolimit')){_0x1f8fb6[_0x046b('0x1c')]=qs[_0x046b('0x1c')](_0xdf9223['query'][_0x046b('0x1c')]);_0x1f8fb6['offset']=qs['offset'](_0xdf9223[_0x046b('0x2f')][_0x046b('0x1b')]);}_0x1f8fb6[_0x046b('0x36')]=qs[_0x046b('0x37')](_0xdf9223[_0x046b('0x2f')]['sort']);_0x1f8fb6['where']=qs[_0x046b('0x31')](_[_0x046b('0x38')](_0xdf9223[_0x046b('0x2f')],_0x3dff63[_0x046b('0x31')]),_0x15c614);if(_0xdf9223[_0x046b('0x2f')][_0x046b('0x39')]){_0x1f8fb6[_0x046b('0x3a')]=_['merge'](_0x1f8fb6[_0x046b('0x3a')],{'$or':_[_0x046b('0x2a')](_0x15c614,function(_0x5ed359){if(_0x5ed359[_0x046b('0x2d')]!==_0x046b('0x3b')){var _0x64e7cb={};_0x64e7cb[_0x5ed359[_0x046b('0x28')]]={'$like':'%'+_0xdf9223['query'][_0x046b('0x39')]+'%'};return _0x64e7cb;}})});}_0x1f8fb6=_[_0x046b('0x3c')]({},_0x1f8fb6,_0xdf9223[_0x046b('0x3d')]);var _0x12746c={'where':_0x1f8fb6[_0x046b('0x3a')]};return db[_0x046b('0x2b')]['count'](_0x12746c)[_0x046b('0x22')](function(_0x18489c){_0x48690e[_0x046b('0x1d')]=_0x18489c;if(_0xdf9223['query'][_0x046b('0x3e')]){_0x1f8fb6[_0x046b('0x3f')]=[{'all':!![]}];}return db[_0x046b('0x2b')][_0x046b('0x40')](_0x1f8fb6);})[_0x046b('0x22')](function(_0xef22){_0x48690e[_0x046b('0x41')]=_0xef22;return _0x48690e;})['then'](respondWithFilteredResult(_0x37d603,_0x1f8fb6))[_0x046b('0x42')](handleError(_0x37d603,null));};exports[_0x046b('0x43')]=function(_0x46fa73,_0x20b5fd){var _0x352c17={'raw':!![],'where':{'id':_0x46fa73[_0x046b('0x44')]['id']}},_0xdcf88f={};_0xdcf88f['model']=_[_0x046b('0x30')](db[_0x046b('0x2b')][_0x046b('0x45')]);_0xdcf88f['query']=_[_0x046b('0x30')](_0x46fa73[_0x046b('0x2f')]);_0xdcf88f[_0x046b('0x31')]=_[_0x046b('0x32')](_0xdcf88f['model'],_0xdcf88f[_0x046b('0x2f')]);_0x352c17[_0x046b('0x33')]=_[_0x046b('0x32')](_0xdcf88f[_0x046b('0x2e')],qs[_0x046b('0x34')](_0x46fa73[_0x046b('0x2f')][_0x046b('0x34')]));_0x352c17['attributes']=_0x352c17['attributes'][_0x046b('0x35')]?_0x352c17[_0x046b('0x33')]:_0xdcf88f['model'];if(_0x46fa73['query'][_0x046b('0x3e')]){_0x352c17[_0x046b('0x3f')]=[{'all':!![]}];}_0x352c17=_['merge']({},_0x352c17,_0x46fa73[_0x046b('0x3d')]);return db['Template'][_0x046b('0x46')](_0x352c17)['then'](handleEntityNotFound(_0x20b5fd,null))[_0x046b('0x22')](respondWithResult(_0x20b5fd,null))[_0x046b('0x42')](handleError(_0x20b5fd,null));};exports[_0x046b('0x47')]=function(_0x382f98,_0x2a83a8){return db[_0x046b('0x2b')][_0x046b('0x47')](_0x382f98['body'],{})[_0x046b('0x22')](function(_0x5e3dab){var _0x708d8=_0x382f98[_0x046b('0x48')][_0x046b('0x23')]({'plain':!![]});if(!_0x708d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x708d8['role']==='user'){var _0x988653=_0x5e3dab['get']({'plain':!![]});var _0x4c7ad5=_0x046b('0x49');return db['UserProfileSection'][_0x046b('0x46')]({'where':{'name':_0x4c7ad5,'userProfileId':_0x708d8[_0x046b('0x4a')]},'raw':!![]})[_0x046b('0x22')](function(_0x24c9ad){if(_0x24c9ad&&_0x24c9ad[_0x046b('0x4b')]===0x0){return db[_0x046b('0x24')][_0x046b('0x47')]({'name':_0x988653[_0x046b('0x28')],'resourceId':_0x988653['id'],'type':_0x24c9ad[_0x046b('0x28')],'sectionId':_0x24c9ad['id']},{})[_0x046b('0x22')](function(){return _0x5e3dab;});}else{return _0x5e3dab;}})[_0x046b('0x42')](function(_0x18092c){logger['error'](_0x046b('0x4c'),_0x18092c);throw _0x18092c;});}return _0x5e3dab;})[_0x046b('0x22')](respondWithResult(_0x2a83a8,0xc9))[_0x046b('0x42')](handleError(_0x2a83a8,null));};exports[_0x046b('0x21')]=function(_0x55cf00,_0xa3adb5){if(_0x55cf00['body']['id']){delete _0x55cf00['body']['id'];}return db[_0x046b('0x2b')][_0x046b('0x46')]({'where':{'id':_0x55cf00['params']['id']}})[_0x046b('0x22')](handleEntityNotFound(_0xa3adb5,null))['then'](saveUpdates(_0x55cf00[_0x046b('0x4d')],null))[_0x046b('0x22')](respondWithResult(_0xa3adb5,null))['catch'](handleError(_0xa3adb5,null));};exports[_0x046b('0x25')]=function(_0x37f49f,_0x5c356c){return db[_0x046b('0x2b')][_0x046b('0x46')]({'where':{'id':_0x37f49f[_0x046b('0x44')]['id']}})[_0x046b('0x22')](handleEntityNotFound(_0x5c356c,null))[_0x046b('0x22')](removeEntity(_0x5c356c,null))[_0x046b('0x42')](handleError(_0x5c356c,null));}; \ No newline at end of file +var _0xa086=['limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Templates','error','name','send','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','Template','rows','catch','show','params','includeAll','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xa086,0x174));var _0x6a08=function(_0x57e3fc,_0x5308d3){_0x57e3fc=_0x57e3fc-0x0;var _0x2f5723=_0xa086[_0x57e3fc];return _0x2f5723;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a08('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a08('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a08('0x2'));var util=require(_0x6a08('0x3'));var path=require('path');var sox=require(_0x6a08('0x4'));var csv=require(_0x6a08('0x5'));var ejs=require(_0x6a08('0x6'));var fs=require('fs');var fs_extra=require(_0x6a08('0x7'));var _=require(_0x6a08('0x8'));var squel=require(_0x6a08('0x9'));var crypto=require(_0x6a08('0xa'));var jsforce=require(_0x6a08('0xb'));var deskjs=require(_0x6a08('0xc'));var toCsv=require(_0x6a08('0x5'));var querystring=require(_0x6a08('0xd'));var Papa=require(_0x6a08('0xe'));var Redis=require(_0x6a08('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6a08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a08('0x11'))(_0x6a08('0x12'));var utils=require(_0x6a08('0x13'));var config=require(_0x6a08('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a08('0x15'))['db'];function respondWithStatusCode(_0x1b1750,_0x5645d5){_0x5645d5=_0x5645d5||0xcc;return function(_0x468cac){if(_0x468cac){return _0x1b1750[_0x6a08('0x16')](_0x5645d5);}return _0x1b1750[_0x6a08('0x17')](_0x5645d5)[_0x6a08('0x18')]();};}function respondWithResult(_0x10d6d0,_0x49a4e4){_0x49a4e4=_0x49a4e4||0xc8;return function(_0x18b985){if(_0x18b985){return _0x10d6d0['status'](_0x49a4e4)[_0x6a08('0x19')](_0x18b985);}};}function respondWithFilteredResult(_0x5bc491,_0x566ad0){return function(_0xad88d2){if(_0xad88d2){var _0xfdb2fb=typeof _0x566ad0[_0x6a08('0x1a')]===_0x6a08('0x1b')&&typeof _0x566ad0[_0x6a08('0x1c')]===_0x6a08('0x1b');var _0x4b1c8a=_0xad88d2[_0x6a08('0x1d')];var _0xb7e623=_0xfdb2fb?0x0:_0x566ad0[_0x6a08('0x1a')];var _0x48c0f8=_0xfdb2fb?_0xad88d2[_0x6a08('0x1d')]:_0x566ad0[_0x6a08('0x1a')]+_0x566ad0[_0x6a08('0x1c')];var _0x3dabf4;if(_0x48c0f8>=_0x4b1c8a){_0x48c0f8=_0x4b1c8a;_0x3dabf4=0xc8;}else{_0x3dabf4=0xce;}_0x5bc491[_0x6a08('0x17')](_0x3dabf4);return _0x5bc491[_0x6a08('0x1e')](_0x6a08('0x1f'),_0xb7e623+'-'+_0x48c0f8+'/'+_0x4b1c8a)[_0x6a08('0x19')](_0xad88d2);}return null;};}function patchUpdates(_0x4c243e){return function(_0x366bb5){try{jsonpatch[_0x6a08('0x20')](_0x366bb5,_0x4c243e,!![]);}catch(_0x2a88d2){return BPromise[_0x6a08('0x21')](_0x2a88d2);}return _0x366bb5[_0x6a08('0x22')]();};}function saveUpdates(_0x3c4dd8,_0x5bd14e){return function(_0x7ef186){if(_0x7ef186){return _0x7ef186['update'](_0x3c4dd8)[_0x6a08('0x23')](function(_0x50cef5){return _0x50cef5;});}return null;};}function removeEntity(_0x252115,_0x3b1890){return function(_0xddd7a0){if(_0xddd7a0){return _0xddd7a0[_0x6a08('0x24')]()[_0x6a08('0x23')](function(){var _0x2a48cc=_0xddd7a0[_0x6a08('0x25')]({'plain':!![]});var _0x30b8d4=_0x6a08('0x26');return db['UserProfileResource'][_0x6a08('0x24')]({'where':{'type':_0x30b8d4,'resourceId':_0x2a48cc['id']}})[_0x6a08('0x23')](function(){return _0xddd7a0;});})[_0x6a08('0x23')](function(){_0x252115[_0x6a08('0x17')](0xcc)[_0x6a08('0x18')]();});}};}function handleEntityNotFound(_0x61b568,_0x1a5da6){return function(_0x214a5e){if(!_0x214a5e){_0x61b568[_0x6a08('0x16')](0x194);}return _0x214a5e;};}function handleError(_0xe28ea7,_0x5dd7d8){_0x5dd7d8=_0x5dd7d8||0x1f4;return function(_0x245633){logger[_0x6a08('0x27')](_0x245633['stack']);if(_0x245633[_0x6a08('0x28')]){delete _0x245633[_0x6a08('0x28')];}_0xe28ea7[_0x6a08('0x17')](_0x5dd7d8)[_0x6a08('0x29')](_0x245633);};}exports['index']=function(_0x5d3550,_0xa670ad){var _0x17a906={},_0x5cdfa0={},_0x301cef={'count':0x0,'rows':[]};var _0xc3bc65=_['map'](db['Template']['rawAttributes'],function(_0x4df2f4){return{'name':_0x4df2f4[_0x6a08('0x2a')],'type':_0x4df2f4[_0x6a08('0x2b')][_0x6a08('0x2c')]};});_0x5cdfa0[_0x6a08('0x2d')]=_['map'](_0xc3bc65,'name');_0x5cdfa0[_0x6a08('0x2e')]=_[_0x6a08('0x2f')](_0x5d3550[_0x6a08('0x2e')]);_0x5cdfa0[_0x6a08('0x30')]=_[_0x6a08('0x31')](_0x5cdfa0[_0x6a08('0x2d')],_0x5cdfa0[_0x6a08('0x2e')]);_0x17a906[_0x6a08('0x32')]=_['intersection'](_0x5cdfa0[_0x6a08('0x2d')],qs[_0x6a08('0x33')](_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x33')]));_0x17a906[_0x6a08('0x32')]=_0x17a906['attributes'][_0x6a08('0x34')]?_0x17a906[_0x6a08('0x32')]:_0x5cdfa0[_0x6a08('0x2d')];if(!_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x35')](_0x6a08('0x36'))){_0x17a906['limit']=qs[_0x6a08('0x1c')](_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x1c')]);_0x17a906[_0x6a08('0x1a')]=qs[_0x6a08('0x1a')](_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x1a')]);}_0x17a906[_0x6a08('0x37')]=qs['sort'](_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x38')]);_0x17a906[_0x6a08('0x39')]=qs[_0x6a08('0x30')](_[_0x6a08('0x3a')](_0x5d3550[_0x6a08('0x2e')],_0x5cdfa0[_0x6a08('0x30')]),_0xc3bc65);if(_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x3b')]){_0x17a906[_0x6a08('0x39')]=_[_0x6a08('0x3c')](_0x17a906[_0x6a08('0x39')],{'$or':_[_0x6a08('0x3d')](_0xc3bc65,function(_0x8be9de){if(_0x8be9de['type']!==_0x6a08('0x3e')){var _0x5b9765={};_0x5b9765[_0x8be9de[_0x6a08('0x28')]]={'$like':'%'+_0x5d3550[_0x6a08('0x2e')][_0x6a08('0x3b')]+'%'};return _0x5b9765;}})});}_0x17a906=_[_0x6a08('0x3c')]({},_0x17a906,_0x5d3550['options']);var _0x340ee4={'where':_0x17a906['where']};return db[_0x6a08('0x3f')][_0x6a08('0x1d')](_0x340ee4)[_0x6a08('0x23')](function(_0x3fa553){_0x301cef[_0x6a08('0x1d')]=_0x3fa553;if(_0x5d3550['query']['includeAll']){_0x17a906['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x17a906);})[_0x6a08('0x23')](function(_0x3637d2){_0x301cef[_0x6a08('0x40')]=_0x3637d2;return _0x301cef;})[_0x6a08('0x23')](respondWithFilteredResult(_0xa670ad,_0x17a906))[_0x6a08('0x41')](handleError(_0xa670ad,null));};exports[_0x6a08('0x42')]=function(_0x139824,_0x3e0452){var _0x59e979={'raw':!![],'where':{'id':_0x139824[_0x6a08('0x43')]['id']}},_0x50d417={};_0x50d417[_0x6a08('0x2d')]=_[_0x6a08('0x2f')](db[_0x6a08('0x3f')]['rawAttributes']);_0x50d417[_0x6a08('0x2e')]=_[_0x6a08('0x2f')](_0x139824[_0x6a08('0x2e')]);_0x50d417[_0x6a08('0x30')]=_[_0x6a08('0x31')](_0x50d417[_0x6a08('0x2d')],_0x50d417[_0x6a08('0x2e')]);_0x59e979['attributes']=_[_0x6a08('0x31')](_0x50d417[_0x6a08('0x2d')],qs[_0x6a08('0x33')](_0x139824['query'][_0x6a08('0x33')]));_0x59e979[_0x6a08('0x32')]=_0x59e979[_0x6a08('0x32')][_0x6a08('0x34')]?_0x59e979[_0x6a08('0x32')]:_0x50d417['model'];if(_0x139824[_0x6a08('0x2e')][_0x6a08('0x44')]){_0x59e979[_0x6a08('0x45')]=[{'all':!![]}];}_0x59e979=_[_0x6a08('0x3c')]({},_0x59e979,_0x139824[_0x6a08('0x46')]);return db[_0x6a08('0x3f')][_0x6a08('0x47')](_0x59e979)[_0x6a08('0x23')](handleEntityNotFound(_0x3e0452,null))[_0x6a08('0x23')](respondWithResult(_0x3e0452,null))[_0x6a08('0x41')](handleError(_0x3e0452,null));};exports[_0x6a08('0x48')]=function(_0x521fc7,_0x3e9665){return db[_0x6a08('0x3f')][_0x6a08('0x48')](_0x521fc7[_0x6a08('0x49')],{})['then'](function(_0x24acc6){var _0x711879=_0x521fc7['user']['get']({'plain':!![]});if(!_0x711879)throw new Error(_0x6a08('0x4a'));if(_0x711879['role']===_0x6a08('0x4b')){var _0x237f2b=_0x24acc6[_0x6a08('0x25')]({'plain':!![]});var _0x3885c0=_0x6a08('0x26');return db[_0x6a08('0x4c')][_0x6a08('0x47')]({'where':{'name':_0x3885c0,'userProfileId':_0x711879[_0x6a08('0x4d')]},'raw':!![]})[_0x6a08('0x23')](function(_0x421ff9){if(_0x421ff9&&_0x421ff9['autoAssociation']===0x0){return db[_0x6a08('0x4e')][_0x6a08('0x48')]({'name':_0x237f2b[_0x6a08('0x28')],'resourceId':_0x237f2b['id'],'type':_0x421ff9['name'],'sectionId':_0x421ff9['id']},{})[_0x6a08('0x23')](function(){return _0x24acc6;});}else{return _0x24acc6;}})[_0x6a08('0x41')](function(_0x42b85e){logger[_0x6a08('0x27')](_0x6a08('0x4f'),_0x42b85e);throw _0x42b85e;});}return _0x24acc6;})['then'](respondWithResult(_0x3e9665,0xc9))[_0x6a08('0x41')](handleError(_0x3e9665,null));};exports['update']=function(_0xf7a74e,_0x51ccb1){if(_0xf7a74e[_0x6a08('0x49')]['id']){delete _0xf7a74e[_0x6a08('0x49')]['id'];}return db[_0x6a08('0x3f')][_0x6a08('0x47')]({'where':{'id':_0xf7a74e['params']['id']}})[_0x6a08('0x23')](handleEntityNotFound(_0x51ccb1,null))[_0x6a08('0x23')](saveUpdates(_0xf7a74e['body'],null))[_0x6a08('0x23')](respondWithResult(_0x51ccb1,null))['catch'](handleError(_0x51ccb1,null));};exports['destroy']=function(_0x23ae7b,_0xcacd8a){return db[_0x6a08('0x3f')][_0x6a08('0x47')]({'where':{'id':_0x23ae7b[_0x6a08('0x43')]['id']}})['then'](handleEntityNotFound(_0xcacd8a,null))[_0x6a08('0x23')](removeEntity(_0xcacd8a,null))[_0x6a08('0x41')](handleError(_0xcacd8a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a528411..267067f 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 _0x7c5c=['util','api','moment','path','rimraf','./template.attributes','define','Template','lodash'];(function(_0x53ffbf,_0x1e36a5){var _0x5014cc=function(_0x3783f8){while(--_0x3783f8){_0x53ffbf['push'](_0x53ffbf['shift']());}};_0x5014cc(++_0x1e36a5);}(_0x7c5c,0xa1));var _0xc7c5=function(_0x121090,_0x303207){_0x121090=_0x121090-0x0;var _0x1a56a8=_0x7c5c[_0x121090];return _0x1a56a8;};'use strict';var _=require(_0xc7c5('0x0'));var util=require(_0xc7c5('0x1'));var logger=require('../../config/logger')(_0xc7c5('0x2'));var moment=require(_0xc7c5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7c5('0x4'));var rimraf=require(_0xc7c5('0x5'));var config=require('../../config/environment');var attributes=require(_0xc7c5('0x6'));module['exports']=function(_0x475814,_0x217fca){return _0x475814[_0xc7c5('0x7')](_0xc7c5('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96e0=['request-promise','../../config/environment','./template.attributes','exports','Template','lodash','util','../../config/logger','api','moment'];(function(_0x511d41,_0x14b3ca){var _0x1030e3=function(_0x4e38d2){while(--_0x4e38d2){_0x511d41['push'](_0x511d41['shift']());}};_0x1030e3(++_0x14b3ca);}(_0x96e0,0x14f));var _0x096e=function(_0x44c9a0,_0x898781){_0x44c9a0=_0x44c9a0-0x0;var _0x76fb85=_0x96e0[_0x44c9a0];return _0x76fb85;};'use strict';var _=require(_0x096e('0x0'));var util=require(_0x096e('0x1'));var logger=require(_0x096e('0x2'))(_0x096e('0x3'));var moment=require(_0x096e('0x4'));var BPromise=require('bluebird');var rp=require(_0x096e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x096e('0x6'));var attributes=require(_0x096e('0x7'));module[_0x096e('0x8')]=function(_0x19b700,_0x18a39d){return _0x19b700['define'](_0x096e('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 951859e..dd3a915 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 _0xc737=['result','catch','GetTemplate','Template','options','where','attributes','limit','include','map','model','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc737,0xb6));var _0x7c73=function(_0x504072,_0x2b7160){_0x504072=_0x504072-0x0;var _0x545ba4=_0xc737[_0x504072];return _0x545ba4;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require('moment');var BPromise=require(_0x7c73('0x2'));var rs=require(_0x7c73('0x3'));var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require(_0x7c73('0x7'))(_0x7c73('0x8'));var config=require(_0x7c73('0x9'));var jayson=require(_0x7c73('0xa'));var client=jayson[_0x7c73('0xb')][_0x7c73('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40ca6e,_0x189c23,_0x34cc13){return new BPromise(function(_0x13f074,_0x4ff068){return client[_0x7c73('0xd')](_0x40ca6e,_0x34cc13)[_0x7c73('0xe')](function(_0x5bf831){logger['info'](_0x7c73('0xf'),_0x189c23,_0x7c73('0x10'));logger[_0x7c73('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x189c23,_0x7c73('0x10'),JSON[_0x7c73('0x12')](_0x5bf831));if(_0x5bf831[_0x7c73('0x13')]){if(_0x5bf831[_0x7c73('0x13')][_0x7c73('0x14')]===0x1f4){logger['error'](_0x7c73('0xf'),_0x189c23,_0x5bf831['error'][_0x7c73('0x15')]);return _0x4ff068(_0x5bf831[_0x7c73('0x13')][_0x7c73('0x15')]);}logger['error'](_0x7c73('0xf'),_0x189c23,_0x5bf831[_0x7c73('0x13')][_0x7c73('0x15')]);return _0x13f074(_0x5bf831['error'][_0x7c73('0x15')]);}else{logger['info'](_0x7c73('0xf'),_0x189c23,'request\x20sent');_0x13f074(_0x5bf831[_0x7c73('0x16')]['message']);}})[_0x7c73('0x17')](function(_0x29b816){logger[_0x7c73('0x13')](_0x7c73('0xf'),_0x189c23,_0x29b816);_0x4ff068(_0x29b816);});});}exports[_0x7c73('0x18')]=function(_0xb71f65){var _0x5e9154=this;return new Promise(function(_0xdef589,_0x1d0db2){return db[_0x7c73('0x19')]['findAll']({'raw':_0xb71f65[_0x7c73('0x1a')]?_0xb71f65[_0x7c73('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xb71f65[_0x7c73('0x1a')]?_0xb71f65[_0x7c73('0x1a')][_0x7c73('0x1b')]||null:null,'attributes':_0xb71f65[_0x7c73('0x1a')]?_0xb71f65['options'][_0x7c73('0x1c')]||null:null,'limit':_0xb71f65[_0x7c73('0x1a')]?_0xb71f65[_0x7c73('0x1a')][_0x7c73('0x1d')]||null:null,'include':_0xb71f65['options']?_0xb71f65[_0x7c73('0x1a')][_0x7c73('0x1e')]?_[_0x7c73('0x1f')](_0xb71f65[_0x7c73('0x1a')][_0x7c73('0x1e')],function(_0x4b2f74){return{'model':db[_0x4b2f74[_0x7c73('0x20')]],'as':_0x4b2f74['as'],'attributes':_0x4b2f74[_0x7c73('0x1c')],'include':_0x4b2f74[_0x7c73('0x1e')]?_[_0x7c73('0x1f')](_0x4b2f74[_0x7c73('0x1e')],function(_0x50776e){return{'model':db[_0x50776e[_0x7c73('0x20')]],'as':_0x50776e['as'],'attributes':_0x50776e[_0x7c73('0x1c')],'include':_0x50776e['include']?_['map'](_0x50776e[_0x7c73('0x1e')],function(_0x20de12){return{'model':db[_0x20de12['model']],'as':_0x20de12['as'],'attributes':_0x20de12[_0x7c73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c73('0xe')](function(_0x295eab){logger[_0x7c73('0x21')]('GetTemplate',_0xb71f65);logger['debug'](_0x7c73('0x18'),_0xb71f65,JSON[_0x7c73('0x12')](_0x295eab));_0xdef589(_0x295eab);})[_0x7c73('0x17')](function(_0xb7bbaf){logger[_0x7c73('0x13')](_0x7c73('0x18'),_0xb7bbaf['message'],_0xb71f65);_0x1d0db2(_0x5e9154[_0x7c73('0x13')](0x1f4,_0xb7bbaf['message']));});});}; \ No newline at end of file +var _0xd751=['then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xd751,0x79));var _0x1d75=function(_0x34ce72,_0x19ce31){_0x34ce72=_0x34ce72-0x0;var _0x4a3fe8=_0xd751[_0x34ce72];return _0x4a3fe8;};'use strict';var _=require(_0x1d75('0x0'));var util=require('util');var moment=require(_0x1d75('0x1'));var BPromise=require(_0x1d75('0x2'));var rs=require(_0x1d75('0x3'));var fs=require('fs');var Redis=require(_0x1d75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d75('0x5'));var logger=require('../../config/logger')(_0x1d75('0x6'));var config=require(_0x1d75('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1d75('0x8')][_0x1d75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b25e7,_0x4af55c,_0x4ed67e){return new BPromise(function(_0x41de5e,_0x4a5df9){return client[_0x1d75('0xa')](_0x9b25e7,_0x4ed67e)[_0x1d75('0xb')](function(_0x201ff6){logger[_0x1d75('0xc')](_0x1d75('0xd'),_0x4af55c,_0x1d75('0xe'));logger[_0x1d75('0xf')](_0x1d75('0x10'),_0x4af55c,_0x1d75('0xe'),JSON[_0x1d75('0x11')](_0x201ff6));if(_0x201ff6[_0x1d75('0x12')]){if(_0x201ff6[_0x1d75('0x12')][_0x1d75('0x13')]===0x1f4){logger[_0x1d75('0x12')](_0x1d75('0xd'),_0x4af55c,_0x201ff6[_0x1d75('0x12')]['message']);return _0x4a5df9(_0x201ff6[_0x1d75('0x12')][_0x1d75('0x14')]);}logger[_0x1d75('0x12')](_0x1d75('0xd'),_0x4af55c,_0x201ff6[_0x1d75('0x12')][_0x1d75('0x14')]);return _0x41de5e(_0x201ff6[_0x1d75('0x12')]['message']);}else{logger[_0x1d75('0xc')](_0x1d75('0xd'),_0x4af55c,_0x1d75('0xe'));_0x41de5e(_0x201ff6[_0x1d75('0x15')][_0x1d75('0x14')]);}})[_0x1d75('0x16')](function(_0x4be130){logger['error']('Template,\x20%s,\x20%s',_0x4af55c,_0x4be130);_0x4a5df9(_0x4be130);});});}exports['GetTemplate']=function(_0x5e8d0e){var _0x4e9f1a=this;return new Promise(function(_0x327b7b,_0x3b9db5){return db['Template'][_0x1d75('0x17')]({'raw':_0x5e8d0e[_0x1d75('0x18')]?_0x5e8d0e[_0x1d75('0x18')][_0x1d75('0x19')]===undefined?!![]:![]:!![],'where':_0x5e8d0e[_0x1d75('0x18')]?_0x5e8d0e[_0x1d75('0x18')][_0x1d75('0x1a')]||null:null,'attributes':_0x5e8d0e[_0x1d75('0x18')]?_0x5e8d0e['options'][_0x1d75('0x1b')]||null:null,'limit':_0x5e8d0e[_0x1d75('0x18')]?_0x5e8d0e['options'][_0x1d75('0x1c')]||null:null,'include':_0x5e8d0e[_0x1d75('0x18')]?_0x5e8d0e[_0x1d75('0x18')][_0x1d75('0x1d')]?_[_0x1d75('0x1e')](_0x5e8d0e[_0x1d75('0x18')][_0x1d75('0x1d')],function(_0x35c2b8){return{'model':db[_0x35c2b8[_0x1d75('0x1f')]],'as':_0x35c2b8['as'],'attributes':_0x35c2b8[_0x1d75('0x1b')],'include':_0x35c2b8[_0x1d75('0x1d')]?_[_0x1d75('0x1e')](_0x35c2b8[_0x1d75('0x1d')],function(_0x28bde2){return{'model':db[_0x28bde2['model']],'as':_0x28bde2['as'],'attributes':_0x28bde2[_0x1d75('0x1b')],'include':_0x28bde2[_0x1d75('0x1d')]?_[_0x1d75('0x1e')](_0x28bde2['include'],function(_0x1a1ee6){return{'model':db[_0x1a1ee6[_0x1d75('0x1f')]],'as':_0x1a1ee6['as'],'attributes':_0x1a1ee6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d75('0xb')](function(_0x594d46){logger[_0x1d75('0xc')](_0x1d75('0x20'),_0x5e8d0e);logger[_0x1d75('0xf')](_0x1d75('0x20'),_0x5e8d0e,JSON['stringify'](_0x594d46));_0x327b7b(_0x594d46);})[_0x1d75('0x16')](function(_0xb49e5){logger[_0x1d75('0x12')](_0x1d75('0x20'),_0xb49e5[_0x1d75('0x14')],_0x5e8d0e);_0x3b9db5(_0x4e9f1a['error'](0x1f4,_0xb49e5['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index be824c5..f19299e 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 _0x00da=['update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./trigger.controller','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','isAuthenticated','get','/:id/actions','create','post','addAction','put'];(function(_0x234fba,_0x56beb6){var _0x5d5ed7=function(_0x2fd4ca){while(--_0x2fd4ca){_0x234fba['push'](_0x234fba['shift']());}};_0x5d5ed7(++_0x56beb6);}(_0x00da,0x1cf));var _0xa00d=function(_0x12da8d,_0x34b1c4){_0x12da8d=_0x12da8d-0x0;var _0x26b1fb=_0x00da[_0x12da8d];return _0x26b1fb;};'use strict';var multer=require(_0xa00d('0x0'));var util=require(_0xa00d('0x1'));var path=require('path');var timeout=require(_0xa00d('0x2'));var express=require(_0xa00d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa00d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa00d('0x5'));var controller=require(_0xa00d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa00d('0x7')]);router['get'](_0xa00d('0x8'),auth['isAuthenticated'](),controller[_0xa00d('0x9')]);router['get'](_0xa00d('0xa'),auth['isAuthenticated'](),controller[_0xa00d('0xb')]);router['get'](_0xa00d('0xc'),auth[_0xa00d('0xd')](),controller['getAnyConditions']);router[_0xa00d('0xe')](_0xa00d('0xf'),auth[_0xa00d('0xd')](),controller['getActions']);router['post']('/',auth[_0xa00d('0xd')](),controller[_0xa00d('0x10')]);router['post'](_0xa00d('0xa'),auth[_0xa00d('0xd')](),controller['addAllCondition']);router[_0xa00d('0x11')](_0xa00d('0xc'),auth[_0xa00d('0xd')](),controller['addAnyCondition']);router[_0xa00d('0x11')](_0xa00d('0xf'),auth[_0xa00d('0xd')](),controller[_0xa00d('0x12')]);router[_0xa00d('0x13')]('/:id',auth[_0xa00d('0xd')](),controller[_0xa00d('0x14')]);router[_0xa00d('0x15')](_0xa00d('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xa00d('0x16')]=router; \ No newline at end of file +var _0x7fff=['index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','isAuthenticated','getActions','post','addAllCondition','addAnyCondition','/:id/actions','addAction','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get'];(function(_0x560466,_0x38714a){var _0x1b3eb7=function(_0x2fb05f){while(--_0x2fb05f){_0x560466['push'](_0x560466['shift']());}};_0x1b3eb7(++_0x38714a);}(_0x7fff,0x1a6));var _0xf7ff=function(_0x594bbe,_0x2afb6e){_0x594bbe=_0x594bbe-0x0;var _0x6b1b1a=_0x7fff[_0x594bbe];return _0x6b1b1a;};'use strict';var multer=require(_0xf7ff('0x0'));var util=require(_0xf7ff('0x1'));var path=require('path');var timeout=require(_0xf7ff('0x2'));var express=require(_0xf7ff('0x3'));var router=express[_0xf7ff('0x4')]();var fs_extra=require(_0xf7ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf7ff('0x6'));var config=require(_0xf7ff('0x7'));var controller=require(_0xf7ff('0x8'));router[_0xf7ff('0x9')]('/',auth['isAuthenticated'](),controller[_0xf7ff('0xa')]);router[_0xf7ff('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf7ff('0xb')]);router[_0xf7ff('0x9')](_0xf7ff('0xc'),auth['isAuthenticated'](),controller[_0xf7ff('0xd')]);router[_0xf7ff('0x9')](_0xf7ff('0xe'),auth[_0xf7ff('0xf')](),controller['getAnyConditions']);router[_0xf7ff('0x9')]('/:id/actions',auth[_0xf7ff('0xf')](),controller[_0xf7ff('0x10')]);router[_0xf7ff('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf7ff('0x11')](_0xf7ff('0xc'),auth[_0xf7ff('0xf')](),controller[_0xf7ff('0x12')]);router['post']('/:id/any_conditions',auth[_0xf7ff('0xf')](),controller[_0xf7ff('0x13')]);router[_0xf7ff('0x11')](_0xf7ff('0x14'),auth['isAuthenticated'](),controller[_0xf7ff('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf7ff('0x16')]);router[_0xf7ff('0x17')](_0xf7ff('0x18'),auth['isAuthenticated'](),controller[_0xf7ff('0x19')]);module[_0xf7ff('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 5d8567b..fbe8912 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 _0xf9ff=['BOOLEAN','sequelize','STRING'];(function(_0x589a6c,_0x544b28){var _0x4bb0c7=function(_0x483497){while(--_0x483497){_0x589a6c['push'](_0x589a6c['shift']());}};_0x4bb0c7(++_0x544b28);}(_0xf9ff,0x133));var _0xff9f=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xf9ff[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0xff9f('0x0'));module['exports']={'name':{'type':Sequelize[_0xff9f('0x1')]},'channel':{'type':Sequelize[_0xff9f('0x1')]},'description':{'type':Sequelize[_0xff9f('0x1')]},'status':{'type':Sequelize[_0xff9f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf32=['exports','STRING','BOOLEAN','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaf32,0x14b));var _0x2af3=function(_0x42cc1f,_0xe9eb20){_0x42cc1f=_0x42cc1f-0x0;var _0x175df5=_0xaf32[_0x42cc1f];return _0x175df5;};'use strict';var Sequelize=require(_0x2af3('0x0'));module[_0x2af3('0x1')]={'name':{'type':Sequelize[_0x2af3('0x2')]},'channel':{'type':Sequelize[_0x2af3('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2af3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index d572be0..b339415 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 _0x6a3a=['addAnyCondition','getAllConditions','findOne','order','hasOwnProperty','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','get','Triggers','destroy','sendStatus','stack','name','index','map','fieldName','key','model','query','filters','attributes','fields','length','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','Trigger','findAll','catch','show','keys','rawAttributes','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','update','params','TriggerAllId','Condition'];(function(_0x3b4453,_0x4d4115){var _0x480515=function(_0xc7309){while(--_0xc7309){_0x3b4453['push'](_0x3b4453['shift']());}};_0x480515(++_0x4d4115);}(_0x6a3a,0xc5));var _0xa6a3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6a3a[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6a3('0x0'));var zipdir=require(_0xa6a3('0x1'));var jsonpatch=require(_0xa6a3('0x2'));var rp=require(_0xa6a3('0x3'));var moment=require(_0xa6a3('0x4'));var BPromise=require(_0xa6a3('0x5'));var Mustache=require(_0xa6a3('0x6'));var util=require(_0xa6a3('0x7'));var path=require('path');var sox=require(_0xa6a3('0x8'));var csv=require(_0xa6a3('0x9'));var ejs=require(_0xa6a3('0xa'));var fs=require('fs');var fs_extra=require(_0xa6a3('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa6a3('0xc'));var jsforce=require(_0xa6a3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa6a3('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa6a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa6a3('0xf'));var as=require(_0xa6a3('0x10'));var hardwareService=require(_0xa6a3('0x11'));var logger=require(_0xa6a3('0x12'))(_0xa6a3('0x13'));var utils=require(_0xa6a3('0x14'));var config=require(_0xa6a3('0x15'));var licenseUtil=require(_0xa6a3('0x16'));var db=require(_0xa6a3('0x17'))['db'];function respondWithStatusCode(_0x4da17e,_0x30b5c7){_0x30b5c7=_0x30b5c7||0xcc;return function(_0x5db177){if(_0x5db177){return _0x4da17e['sendStatus'](_0x30b5c7);}return _0x4da17e['status'](_0x30b5c7)[_0xa6a3('0x18')]();};}function respondWithResult(_0x4cdbce,_0x1e40b0){_0x1e40b0=_0x1e40b0||0xc8;return function(_0x28b8df){if(_0x28b8df){return _0x4cdbce[_0xa6a3('0x19')](_0x1e40b0)[_0xa6a3('0x1a')](_0x28b8df);}};}function respondWithFilteredResult(_0x2134ff,_0x50f446){return function(_0x2458fc){if(_0x2458fc){var _0x2a2a4a=typeof _0x50f446[_0xa6a3('0x1b')]===_0xa6a3('0x1c')&&typeof _0x50f446[_0xa6a3('0x1d')]===_0xa6a3('0x1c');var _0x2cdaab=_0x2458fc[_0xa6a3('0x1e')];var _0x2a9254=_0x2a2a4a?0x0:_0x50f446['offset'];var _0x4b4e44=_0x2a2a4a?_0x2458fc[_0xa6a3('0x1e')]:_0x50f446[_0xa6a3('0x1b')]+_0x50f446['limit'];var _0xb1c912;if(_0x4b4e44>=_0x2cdaab){_0x4b4e44=_0x2cdaab;_0xb1c912=0xc8;}else{_0xb1c912=0xce;}_0x2134ff['status'](_0xb1c912);return _0x2134ff['set'](_0xa6a3('0x1f'),_0x2a9254+'-'+_0x4b4e44+'/'+_0x2cdaab)[_0xa6a3('0x1a')](_0x2458fc);}return null;};}function patchUpdates(_0x230c4c){return function(_0xa630e3){try{jsonpatch['apply'](_0xa630e3,_0x230c4c,!![]);}catch(_0x521082){return BPromise[_0xa6a3('0x20')](_0x521082);}return _0xa630e3[_0xa6a3('0x21')]();};}function saveUpdates(_0x5e7451,_0x1ddaca){return function(_0x27c4b1){if(_0x27c4b1){return _0x27c4b1['update'](_0x5e7451)[_0xa6a3('0x22')](function(_0xec87b7){return _0xec87b7;});}return null;};}function removeEntity(_0x7d11f4,_0x2761ab){return function(_0x37fef3){if(_0x37fef3){return _0x37fef3['destroy']()[_0xa6a3('0x22')](function(){var _0x224ecf=_0x37fef3[_0xa6a3('0x23')]({'plain':!![]});var _0x4f0b26=_0xa6a3('0x24');return db['UserProfileResource'][_0xa6a3('0x25')]({'where':{'type':_0x4f0b26,'resourceId':_0x224ecf['id']}})['then'](function(){return _0x37fef3;});})[_0xa6a3('0x22')](function(){_0x7d11f4['status'](0xcc)[_0xa6a3('0x18')]();});}};}function handleEntityNotFound(_0xc83189,_0x2e5bae){return function(_0x52b9bc){if(!_0x52b9bc){_0xc83189[_0xa6a3('0x26')](0x194);}return _0x52b9bc;};}function handleError(_0x27016e,_0x29bc20){_0x29bc20=_0x29bc20||0x1f4;return function(_0x385b23){logger['error'](_0x385b23[_0xa6a3('0x27')]);if(_0x385b23['name']){delete _0x385b23[_0xa6a3('0x28')];}_0x27016e[_0xa6a3('0x19')](_0x29bc20)['send'](_0x385b23);};}exports[_0xa6a3('0x29')]=function(_0x1bc22b,_0x6d4220){var _0x3dd32a={},_0x328e11={},_0x57f95f={'count':0x0,'rows':[]};var _0x3cb9f1=_[_0xa6a3('0x2a')](db['Trigger']['rawAttributes'],function(_0x15387e){return{'name':_0x15387e[_0xa6a3('0x2b')],'type':_0x15387e['type'][_0xa6a3('0x2c')]};});_0x328e11[_0xa6a3('0x2d')]=_[_0xa6a3('0x2a')](_0x3cb9f1,'name');_0x328e11[_0xa6a3('0x2e')]=_['keys'](_0x1bc22b['query']);_0x328e11[_0xa6a3('0x2f')]=_['intersection'](_0x328e11['model'],_0x328e11[_0xa6a3('0x2e')]);_0x3dd32a[_0xa6a3('0x30')]=_['intersection'](_0x328e11['model'],qs[_0xa6a3('0x31')](_0x1bc22b[_0xa6a3('0x2e')][_0xa6a3('0x31')]));_0x3dd32a[_0xa6a3('0x30')]=_0x3dd32a[_0xa6a3('0x30')][_0xa6a3('0x32')]?_0x3dd32a[_0xa6a3('0x30')]:_0x328e11[_0xa6a3('0x2d')];if(!_0x1bc22b['query']['hasOwnProperty']('nolimit')){_0x3dd32a[_0xa6a3('0x1d')]=qs[_0xa6a3('0x1d')](_0x1bc22b[_0xa6a3('0x2e')][_0xa6a3('0x1d')]);_0x3dd32a[_0xa6a3('0x1b')]=qs[_0xa6a3('0x1b')](_0x1bc22b[_0xa6a3('0x2e')]['offset']);}_0x3dd32a['order']=qs['sort'](_0x1bc22b['query'][_0xa6a3('0x33')]);_0x3dd32a[_0xa6a3('0x34')]=qs[_0xa6a3('0x2f')](_[_0xa6a3('0x35')](_0x1bc22b[_0xa6a3('0x2e')],_0x328e11[_0xa6a3('0x2f')]),_0x3cb9f1);if(_0x1bc22b[_0xa6a3('0x2e')][_0xa6a3('0x36')]){_0x3dd32a[_0xa6a3('0x34')]=_[_0xa6a3('0x37')](_0x3dd32a['where'],{'$or':_['map'](_0x3cb9f1,function(_0x13aefa){if(_0x13aefa[_0xa6a3('0x38')]!==_0xa6a3('0x39')){var _0x5e0024={};_0x5e0024[_0x13aefa['name']]={'$like':'%'+_0x1bc22b[_0xa6a3('0x2e')]['filter']+'%'};return _0x5e0024;}})});}_0x3dd32a=_['merge']({},_0x3dd32a,_0x1bc22b['options']);var _0x5489af={'where':_0x3dd32a['where']};return db['Trigger']['count'](_0x5489af)[_0xa6a3('0x22')](function(_0x1e3387){_0x57f95f[_0xa6a3('0x1e')]=_0x1e3387;if(_0x1bc22b[_0xa6a3('0x2e')][_0xa6a3('0x3a')]){_0x3dd32a[_0xa6a3('0x3b')]=[{'all':!![]}];}return db[_0xa6a3('0x3c')][_0xa6a3('0x3d')](_0x3dd32a);})[_0xa6a3('0x22')](function(_0x2a8957){_0x57f95f['rows']=_0x2a8957;return _0x57f95f;})[_0xa6a3('0x22')](respondWithFilteredResult(_0x6d4220,_0x3dd32a))[_0xa6a3('0x3e')](handleError(_0x6d4220,null));};exports[_0xa6a3('0x3f')]=function(_0x1956ff,_0x1a1d3d){var _0x375fb8={'raw':![],'where':{'id':_0x1956ff['params']['id']}},_0x18a920={};_0x18a920[_0xa6a3('0x2d')]=_[_0xa6a3('0x40')](db[_0xa6a3('0x3c')][_0xa6a3('0x41')]);_0x18a920[_0xa6a3('0x2e')]=_[_0xa6a3('0x40')](_0x1956ff[_0xa6a3('0x2e')]);_0x18a920['filters']=_[_0xa6a3('0x42')](_0x18a920[_0xa6a3('0x2d')],_0x18a920[_0xa6a3('0x2e')]);_0x375fb8[_0xa6a3('0x30')]=_[_0xa6a3('0x42')](_0x18a920['model'],qs[_0xa6a3('0x31')](_0x1956ff[_0xa6a3('0x2e')][_0xa6a3('0x31')]));_0x375fb8['attributes']=_0x375fb8[_0xa6a3('0x30')][_0xa6a3('0x32')]?_0x375fb8[_0xa6a3('0x30')]:_0x18a920[_0xa6a3('0x2d')];if(_0x1956ff[_0xa6a3('0x2e')][_0xa6a3('0x3a')]){_0x375fb8[_0xa6a3('0x3b')]=[{'all':!![]}];}_0x375fb8=_['merge']({},_0x375fb8,_0x1956ff[_0xa6a3('0x43')]);return db[_0xa6a3('0x3c')][_0xa6a3('0x44')](_0x375fb8)[_0xa6a3('0x22')](handleEntityNotFound(_0x1a1d3d,null))[_0xa6a3('0x22')](respondWithResult(_0x1a1d3d,null))['catch'](handleError(_0x1a1d3d,null));};exports[_0xa6a3('0x45')]=function(_0x4d448f,_0x2b627b){return db['Trigger'][_0xa6a3('0x45')](_0x4d448f[_0xa6a3('0x46')],{})[_0xa6a3('0x22')](function(_0x36329d){var _0x3982f3=_0x4d448f[_0xa6a3('0x47')][_0xa6a3('0x23')]({'plain':!![]});if(!_0x3982f3)throw new Error(_0xa6a3('0x48'));if(_0x3982f3[_0xa6a3('0x49')]==='user'){var _0x555a7e=_0x36329d[_0xa6a3('0x23')]({'plain':!![]});var _0x50a7e7=_0xa6a3('0x24');return db[_0xa6a3('0x4a')][_0xa6a3('0x44')]({'where':{'name':_0x50a7e7,'userProfileId':_0x3982f3[_0xa6a3('0x4b')]},'raw':!![]})[_0xa6a3('0x22')](function(_0x347e3d){if(_0x347e3d&&_0x347e3d['autoAssociation']===0x0){return db[_0xa6a3('0x4c')]['create']({'name':_0x555a7e['name'],'resourceId':_0x555a7e['id'],'type':_0x347e3d['name'],'sectionId':_0x347e3d['id']},{})[_0xa6a3('0x22')](function(){return _0x36329d;});}else{return _0x36329d;}})[_0xa6a3('0x3e')](function(_0x5d2a0a){logger[_0xa6a3('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d2a0a);throw _0x5d2a0a;});}return _0x36329d;})[_0xa6a3('0x22')](respondWithResult(_0x2b627b,0xc9))[_0xa6a3('0x3e')](handleError(_0x2b627b,null));};exports[_0xa6a3('0x4e')]=function(_0x3f1759,_0x4d9def){if(_0x3f1759[_0xa6a3('0x46')]['id']){delete _0x3f1759[_0xa6a3('0x46')]['id'];}return db[_0xa6a3('0x3c')][_0xa6a3('0x44')]({'where':{'id':_0x3f1759[_0xa6a3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d9def,null))[_0xa6a3('0x22')](saveUpdates(_0x3f1759['body'],null))[_0xa6a3('0x22')](respondWithResult(_0x4d9def,null))[_0xa6a3('0x3e')](handleError(_0x4d9def,null));};exports[_0xa6a3('0x25')]=function(_0x14f093,_0x360d02){return db['Trigger'][_0xa6a3('0x44')]({'where':{'id':_0x14f093[_0xa6a3('0x4f')]['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x360d02,null))[_0xa6a3('0x22')](removeEntity(_0x360d02,null))['catch'](handleError(_0x360d02,null));};exports['addAllCondition']=function(_0xe31892,_0x9693b1,_0x421489){if(_0xe31892[_0xa6a3('0x46')]['id']){delete _0xe31892[_0xa6a3('0x46')]['id'];}return db[_0xa6a3('0x3c')][_0xa6a3('0x44')]({'where':{'id':_0xe31892[_0xa6a3('0x4f')]['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x9693b1,null))[_0xa6a3('0x22')](function(_0x559023){if(_0x559023){_0xe31892[_0xa6a3('0x46')][_0xa6a3('0x50')]=_0x559023['id'];return db[_0xa6a3('0x51')][_0xa6a3('0x45')](_0xe31892[_0xa6a3('0x46')]);}})[_0xa6a3('0x22')](respondWithResult(_0x9693b1,null))['catch'](handleError(_0x9693b1,null));};exports[_0xa6a3('0x52')]=function(_0x1bddb6,_0x4d5068,_0x5e4c79){if(_0x1bddb6[_0xa6a3('0x46')]['id']){delete _0x1bddb6['body']['id'];}return db[_0xa6a3('0x3c')][_0xa6a3('0x44')]({'where':{'id':_0x1bddb6['params']['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x4d5068,null))[_0xa6a3('0x22')](function(_0x1d0d02){if(_0x1d0d02){_0x1bddb6[_0xa6a3('0x46')]['TriggerAnyId']=_0x1d0d02['id'];return db[_0xa6a3('0x51')][_0xa6a3('0x45')](_0x1bddb6[_0xa6a3('0x46')]);}})[_0xa6a3('0x22')](respondWithResult(_0x4d5068,null))['catch'](handleError(_0x4d5068,null));};exports[_0xa6a3('0x53')]=function(_0x37a972,_0x2f0a32,_0x30fb73){var _0x234235={};var _0x1e7c3d={};var _0x2ca89a;var _0x41f726;return db[_0xa6a3('0x3c')][_0xa6a3('0x54')]({'where':{'id':_0x37a972[_0xa6a3('0x4f')]['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x2f0a32,null))[_0xa6a3('0x22')](function(_0x2a121d){if(_0x2a121d){_0x2ca89a=_0x2a121d;_0x1e7c3d[_0xa6a3('0x2d')]=_['keys'](db['Condition']['rawAttributes']);_0x1e7c3d[_0xa6a3('0x2e')]=_[_0xa6a3('0x40')](_0x37a972['query']);_0x1e7c3d[_0xa6a3('0x2f')]=_[_0xa6a3('0x42')](_0x1e7c3d[_0xa6a3('0x2d')],_0x1e7c3d['query']);_0x234235[_0xa6a3('0x30')]=_['intersection'](_0x1e7c3d[_0xa6a3('0x2d')],qs[_0xa6a3('0x31')](_0x37a972['query'][_0xa6a3('0x31')]));_0x234235[_0xa6a3('0x30')]=_0x234235[_0xa6a3('0x30')]['length']?_0x234235[_0xa6a3('0x30')]:_0x1e7c3d[_0xa6a3('0x2d')];_0x234235[_0xa6a3('0x55')]=qs[_0xa6a3('0x33')](_0x37a972['query'][_0xa6a3('0x33')]);_0x234235[_0xa6a3('0x34')]=qs[_0xa6a3('0x2f')](_[_0xa6a3('0x35')](_0x37a972[_0xa6a3('0x2e')],_0x1e7c3d[_0xa6a3('0x2f')]));if(_0x37a972['query'][_0xa6a3('0x36')]){_0x234235[_0xa6a3('0x34')]=_[_0xa6a3('0x37')](_0x234235['where'],{'$or':_[_0xa6a3('0x2a')](_0x234235['attributes'],function(_0x1065d1){var _0x21997c={};_0x21997c[_0x1065d1]={'$like':'%'+_0x37a972['query'][_0xa6a3('0x36')]+'%'};return _0x21997c;})});}_0x234235=_[_0xa6a3('0x37')]({},_0x234235,_0x37a972['options']);return _0x2ca89a['getAllConditions'](_0x234235);}})[_0xa6a3('0x22')](function(_0x468d34){if(_0x468d34){_0x41f726=_0x468d34[_0xa6a3('0x32')];if(!_0x37a972['query']['hasOwnProperty']('nolimit')){_0x234235[_0xa6a3('0x1d')]=qs[_0xa6a3('0x1d')](_0x37a972[_0xa6a3('0x2e')][_0xa6a3('0x1d')]);_0x234235['offset']=qs[_0xa6a3('0x1b')](_0x37a972['query']['offset']);}return _0x2ca89a['getAllConditions'](_0x234235);}})['then'](function(_0x4fcb06){if(_0x4fcb06){return _0x4fcb06?{'count':_0x41f726,'rows':_0x4fcb06}:null;}})[_0xa6a3('0x22')](respondWithResult(_0x2f0a32,null))[_0xa6a3('0x3e')](handleError(_0x2f0a32,null));};exports['getAnyConditions']=function(_0x2b5248,_0x83ab81,_0x5a6dca){var _0x4f88e6={};var _0x3f3f7b={};var _0x185dff;var _0x4228b6;return db[_0xa6a3('0x3c')]['findOne']({'where':{'id':_0x2b5248[_0xa6a3('0x4f')]['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x83ab81,null))[_0xa6a3('0x22')](function(_0x287bfe){if(_0x287bfe){_0x185dff=_0x287bfe;_0x3f3f7b[_0xa6a3('0x2d')]=_[_0xa6a3('0x40')](db[_0xa6a3('0x51')]['rawAttributes']);_0x3f3f7b[_0xa6a3('0x2e')]=_['keys'](_0x2b5248[_0xa6a3('0x2e')]);_0x3f3f7b[_0xa6a3('0x2f')]=_[_0xa6a3('0x42')](_0x3f3f7b[_0xa6a3('0x2d')],_0x3f3f7b['query']);_0x4f88e6[_0xa6a3('0x30')]=_[_0xa6a3('0x42')](_0x3f3f7b[_0xa6a3('0x2d')],qs[_0xa6a3('0x31')](_0x2b5248[_0xa6a3('0x2e')][_0xa6a3('0x31')]));_0x4f88e6[_0xa6a3('0x30')]=_0x4f88e6[_0xa6a3('0x30')][_0xa6a3('0x32')]?_0x4f88e6[_0xa6a3('0x30')]:_0x3f3f7b[_0xa6a3('0x2d')];_0x4f88e6[_0xa6a3('0x55')]=qs['sort'](_0x2b5248[_0xa6a3('0x2e')][_0xa6a3('0x33')]);_0x4f88e6[_0xa6a3('0x34')]=qs[_0xa6a3('0x2f')](_['pick'](_0x2b5248[_0xa6a3('0x2e')],_0x3f3f7b[_0xa6a3('0x2f')]));if(_0x2b5248[_0xa6a3('0x2e')]['filter']){_0x4f88e6['where']=_[_0xa6a3('0x37')](_0x4f88e6['where'],{'$or':_[_0xa6a3('0x2a')](_0x4f88e6['attributes'],function(_0x3ff205){var _0x2327c2={};_0x2327c2[_0x3ff205]={'$like':'%'+_0x2b5248['query'][_0xa6a3('0x36')]+'%'};return _0x2327c2;})});}_0x4f88e6=_[_0xa6a3('0x37')]({},_0x4f88e6,_0x2b5248[_0xa6a3('0x43')]);return _0x185dff['getAnyConditions'](_0x4f88e6);}})[_0xa6a3('0x22')](function(_0x1d7166){if(_0x1d7166){_0x4228b6=_0x1d7166[_0xa6a3('0x32')];if(!_0x2b5248[_0xa6a3('0x2e')][_0xa6a3('0x56')](_0xa6a3('0x57'))){_0x4f88e6[_0xa6a3('0x1d')]=qs[_0xa6a3('0x1d')](_0x2b5248['query'][_0xa6a3('0x1d')]);_0x4f88e6[_0xa6a3('0x1b')]=qs[_0xa6a3('0x1b')](_0x2b5248[_0xa6a3('0x2e')][_0xa6a3('0x1b')]);}return _0x185dff[_0xa6a3('0x58')](_0x4f88e6);}})[_0xa6a3('0x22')](function(_0x293283){if(_0x293283){return _0x293283?{'count':_0x4228b6,'rows':_0x293283}:null;}})['then'](respondWithResult(_0x83ab81,null))[_0xa6a3('0x3e')](handleError(_0x83ab81,null));};exports[_0xa6a3('0x59')]=function(_0x2017f6,_0x46020d,_0x1e99e5){if(_0x2017f6[_0xa6a3('0x46')]['id']){delete _0x2017f6[_0xa6a3('0x46')]['id'];}return db[_0xa6a3('0x3c')]['find']({'where':{'id':_0x2017f6[_0xa6a3('0x4f')]['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x46020d,null))[_0xa6a3('0x22')](function(_0xa1a464){if(_0xa1a464){_0x2017f6[_0xa6a3('0x46')][_0xa6a3('0x5a')]=_0xa1a464['id'];return db[_0xa6a3('0x5b')][_0xa6a3('0x45')](_0x2017f6['body']);}})[_0xa6a3('0x22')](respondWithResult(_0x46020d,null))[_0xa6a3('0x3e')](handleError(_0x46020d,null));};exports['getActions']=function(_0x4d5656,_0x32ebc7,_0xf1bdb4){var _0x22e590={};var _0x4b1312={};var _0x4192a7;var _0x1104a2;return db[_0xa6a3('0x3c')][_0xa6a3('0x54')]({'where':{'id':_0x4d5656['params']['id']}})[_0xa6a3('0x22')](handleEntityNotFound(_0x32ebc7,null))['then'](function(_0x1a997c){if(_0x1a997c){_0x4192a7=_0x1a997c;_0x4b1312[_0xa6a3('0x2d')]=_[_0xa6a3('0x40')](db['Action'][_0xa6a3('0x41')]);_0x4b1312[_0xa6a3('0x2e')]=_[_0xa6a3('0x40')](_0x4d5656[_0xa6a3('0x2e')]);_0x4b1312[_0xa6a3('0x2f')]=_['intersection'](_0x4b1312['model'],_0x4b1312[_0xa6a3('0x2e')]);_0x22e590[_0xa6a3('0x30')]=_[_0xa6a3('0x42')](_0x4b1312['model'],qs['fields'](_0x4d5656[_0xa6a3('0x2e')]['fields']));_0x22e590[_0xa6a3('0x30')]=_0x22e590[_0xa6a3('0x30')]['length']?_0x22e590['attributes']:_0x4b1312[_0xa6a3('0x2d')];_0x22e590['order']=qs[_0xa6a3('0x33')](_0x4d5656['query'][_0xa6a3('0x33')]);_0x22e590[_0xa6a3('0x34')]=qs[_0xa6a3('0x2f')](_[_0xa6a3('0x35')](_0x4d5656[_0xa6a3('0x2e')],_0x4b1312[_0xa6a3('0x2f')]));if(_0x4d5656[_0xa6a3('0x2e')][_0xa6a3('0x36')]){_0x22e590['where']=_[_0xa6a3('0x37')](_0x22e590[_0xa6a3('0x34')],{'$or':_['map'](_0x22e590[_0xa6a3('0x30')],function(_0x5caee3){var _0x1fbad3={};_0x1fbad3[_0x5caee3]={'$like':'%'+_0x4d5656[_0xa6a3('0x2e')][_0xa6a3('0x36')]+'%'};return _0x1fbad3;})});}_0x22e590=_[_0xa6a3('0x37')]({},_0x22e590,_0x4d5656[_0xa6a3('0x43')]);return _0x4192a7[_0xa6a3('0x5c')](_0x22e590);}})['then'](function(_0x1e8a0c){if(_0x1e8a0c){_0x1104a2=_0x1e8a0c['length'];if(!_0x4d5656[_0xa6a3('0x2e')][_0xa6a3('0x56')](_0xa6a3('0x57'))){_0x22e590[_0xa6a3('0x1d')]=qs[_0xa6a3('0x1d')](_0x4d5656['query'][_0xa6a3('0x1d')]);_0x22e590[_0xa6a3('0x1b')]=qs[_0xa6a3('0x1b')](_0x4d5656['query']['offset']);}return _0x4192a7['getActions'](_0x22e590);}})[_0xa6a3('0x22')](function(_0x435b1e){if(_0x435b1e){return _0x435b1e?{'count':_0x1104a2,'rows':_0x435b1e}:null;}})[_0xa6a3('0x22')](respondWithResult(_0x32ebc7,null))['catch'](handleError(_0x32ebc7,null));}; \ No newline at end of file +var _0x120a=['order','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','map','Trigger','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','type','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x120a,0x192));var _0xa120=function(_0x338990,_0x4755d9){_0x338990=_0x338990-0x0;var _0x14f156=_0x120a[_0x338990];return _0x14f156;};'use strict';var emlformat=require(_0xa120('0x0'));var rimraf=require(_0xa120('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa120('0x2'));var rp=require(_0xa120('0x3'));var moment=require(_0xa120('0x4'));var BPromise=require(_0xa120('0x5'));var Mustache=require(_0xa120('0x6'));var util=require(_0xa120('0x7'));var path=require(_0xa120('0x8'));var sox=require(_0xa120('0x9'));var csv=require(_0xa120('0xa'));var ejs=require(_0xa120('0xb'));var fs=require('fs');var fs_extra=require(_0xa120('0xc'));var _=require(_0xa120('0xd'));var squel=require(_0xa120('0xe'));var crypto=require(_0xa120('0xf'));var jsforce=require(_0xa120('0x10'));var deskjs=require(_0xa120('0x11'));var toCsv=require(_0xa120('0xa'));var querystring=require(_0xa120('0x12'));var Papa=require(_0xa120('0x13'));var Redis=require(_0xa120('0x14'));var authService=require(_0xa120('0x15'));var qs=require(_0xa120('0x16'));var as=require(_0xa120('0x17'));var hardwareService=require(_0xa120('0x18'));var logger=require(_0xa120('0x19'))(_0xa120('0x1a'));var utils=require(_0xa120('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xa120('0x1c'));var db=require(_0xa120('0x1d'))['db'];function respondWithStatusCode(_0x1e6dfd,_0x4780f6){_0x4780f6=_0x4780f6||0xcc;return function(_0x11cc26){if(_0x11cc26){return _0x1e6dfd[_0xa120('0x1e')](_0x4780f6);}return _0x1e6dfd['status'](_0x4780f6)[_0xa120('0x1f')]();};}function respondWithResult(_0x477e4d,_0x4f501d){_0x4f501d=_0x4f501d||0xc8;return function(_0x5e3930){if(_0x5e3930){return _0x477e4d[_0xa120('0x20')](_0x4f501d)[_0xa120('0x21')](_0x5e3930);}};}function respondWithFilteredResult(_0x347159,_0x54a5a6){return function(_0x556776){if(_0x556776){var _0x1ee4f8=typeof _0x54a5a6['offset']===_0xa120('0x22')&&typeof _0x54a5a6[_0xa120('0x23')]===_0xa120('0x22');var _0x20a3ea=_0x556776['count'];var _0x1171cc=_0x1ee4f8?0x0:_0x54a5a6[_0xa120('0x24')];var _0x46c059=_0x1ee4f8?_0x556776[_0xa120('0x25')]:_0x54a5a6[_0xa120('0x24')]+_0x54a5a6[_0xa120('0x23')];var _0x3de35a;if(_0x46c059>=_0x20a3ea){_0x46c059=_0x20a3ea;_0x3de35a=0xc8;}else{_0x3de35a=0xce;}_0x347159[_0xa120('0x20')](_0x3de35a);return _0x347159[_0xa120('0x26')](_0xa120('0x27'),_0x1171cc+'-'+_0x46c059+'/'+_0x20a3ea)[_0xa120('0x21')](_0x556776);}return null;};}function patchUpdates(_0x22f800){return function(_0x5e803f){try{jsonpatch[_0xa120('0x28')](_0x5e803f,_0x22f800,!![]);}catch(_0x40536b){return BPromise['reject'](_0x40536b);}return _0x5e803f[_0xa120('0x29')]();};}function saveUpdates(_0x430c09,_0x4bc737){return function(_0x4ab06c){if(_0x4ab06c){return _0x4ab06c[_0xa120('0x2a')](_0x430c09)[_0xa120('0x2b')](function(_0x3ffae3){return _0x3ffae3;});}return null;};}function removeEntity(_0x35009b,_0x21664f){return function(_0x7a257c){if(_0x7a257c){return _0x7a257c[_0xa120('0x2c')]()[_0xa120('0x2b')](function(){var _0x409aec=_0x7a257c[_0xa120('0x2d')]({'plain':!![]});var _0x1f316a=_0xa120('0x2e');return db[_0xa120('0x2f')]['destroy']({'where':{'type':_0x1f316a,'resourceId':_0x409aec['id']}})[_0xa120('0x2b')](function(){return _0x7a257c;});})['then'](function(){_0x35009b[_0xa120('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296246,_0x5e4148){return function(_0x1dde1a){if(!_0x1dde1a){_0x296246[_0xa120('0x1e')](0x194);}return _0x1dde1a;};}function handleError(_0x32b9bb,_0x569481){_0x569481=_0x569481||0x1f4;return function(_0x35d842){logger[_0xa120('0x30')](_0x35d842['stack']);if(_0x35d842[_0xa120('0x31')]){delete _0x35d842[_0xa120('0x31')];}_0x32b9bb[_0xa120('0x20')](_0x569481)[_0xa120('0x32')](_0x35d842);};}exports['index']=function(_0x5d2440,_0x13efc0){var _0x321276={},_0x3e5bc7={},_0x1a09b8={'count':0x0,'rows':[]};var _0x34da68=_[_0xa120('0x33')](db[_0xa120('0x34')][_0xa120('0x35')],function(_0x455f1b){return{'name':_0x455f1b[_0xa120('0x36')],'type':_0x455f1b['type'][_0xa120('0x37')]};});_0x3e5bc7[_0xa120('0x38')]=_[_0xa120('0x33')](_0x34da68,_0xa120('0x31'));_0x3e5bc7[_0xa120('0x39')]=_[_0xa120('0x3a')](_0x5d2440[_0xa120('0x39')]);_0x3e5bc7['filters']=_[_0xa120('0x3b')](_0x3e5bc7[_0xa120('0x38')],_0x3e5bc7[_0xa120('0x39')]);_0x321276[_0xa120('0x3c')]=_['intersection'](_0x3e5bc7[_0xa120('0x38')],qs['fields'](_0x5d2440[_0xa120('0x39')][_0xa120('0x3d')]));_0x321276[_0xa120('0x3c')]=_0x321276[_0xa120('0x3c')][_0xa120('0x3e')]?_0x321276[_0xa120('0x3c')]:_0x3e5bc7[_0xa120('0x38')];if(!_0x5d2440[_0xa120('0x39')][_0xa120('0x3f')](_0xa120('0x40'))){_0x321276[_0xa120('0x23')]=qs[_0xa120('0x23')](_0x5d2440['query'][_0xa120('0x23')]);_0x321276[_0xa120('0x24')]=qs['offset'](_0x5d2440[_0xa120('0x39')][_0xa120('0x24')]);}_0x321276['order']=qs[_0xa120('0x41')](_0x5d2440[_0xa120('0x39')][_0xa120('0x41')]);_0x321276['where']=qs[_0xa120('0x42')](_[_0xa120('0x43')](_0x5d2440[_0xa120('0x39')],_0x3e5bc7[_0xa120('0x42')]),_0x34da68);if(_0x5d2440[_0xa120('0x39')]['filter']){_0x321276[_0xa120('0x44')]=_['merge'](_0x321276[_0xa120('0x44')],{'$or':_[_0xa120('0x33')](_0x34da68,function(_0xc53e3d){if(_0xc53e3d[_0xa120('0x45')]!=='VIRTUAL'){var _0x34baf4={};_0x34baf4[_0xc53e3d[_0xa120('0x31')]]={'$like':'%'+_0x5d2440[_0xa120('0x39')][_0xa120('0x46')]+'%'};return _0x34baf4;}})});}_0x321276=_[_0xa120('0x47')]({},_0x321276,_0x5d2440[_0xa120('0x48')]);var _0x46029a={'where':_0x321276[_0xa120('0x44')]};return db[_0xa120('0x34')]['count'](_0x46029a)[_0xa120('0x2b')](function(_0x2c3bf0){_0x1a09b8[_0xa120('0x25')]=_0x2c3bf0;if(_0x5d2440['query'][_0xa120('0x49')]){_0x321276['include']=[{'all':!![]}];}return db[_0xa120('0x34')][_0xa120('0x4a')](_0x321276);})['then'](function(_0x38ecbc){_0x1a09b8[_0xa120('0x4b')]=_0x38ecbc;return _0x1a09b8;})['then'](respondWithFilteredResult(_0x13efc0,_0x321276))[_0xa120('0x4c')](handleError(_0x13efc0,null));};exports[_0xa120('0x4d')]=function(_0x363c1a,_0x2f8370){var _0x28cf92={'raw':![],'where':{'id':_0x363c1a[_0xa120('0x4e')]['id']}},_0x348462={};_0x348462['model']=_[_0xa120('0x3a')](db[_0xa120('0x34')]['rawAttributes']);_0x348462['query']=_[_0xa120('0x3a')](_0x363c1a[_0xa120('0x39')]);_0x348462[_0xa120('0x42')]=_[_0xa120('0x3b')](_0x348462[_0xa120('0x38')],_0x348462[_0xa120('0x39')]);_0x28cf92[_0xa120('0x3c')]=_[_0xa120('0x3b')](_0x348462[_0xa120('0x38')],qs[_0xa120('0x3d')](_0x363c1a[_0xa120('0x39')][_0xa120('0x3d')]));_0x28cf92['attributes']=_0x28cf92[_0xa120('0x3c')][_0xa120('0x3e')]?_0x28cf92[_0xa120('0x3c')]:_0x348462[_0xa120('0x38')];if(_0x363c1a[_0xa120('0x39')]['includeAll']){_0x28cf92[_0xa120('0x4f')]=[{'all':!![]}];}_0x28cf92=_[_0xa120('0x47')]({},_0x28cf92,_0x363c1a[_0xa120('0x48')]);return db[_0xa120('0x34')][_0xa120('0x50')](_0x28cf92)[_0xa120('0x2b')](handleEntityNotFound(_0x2f8370,null))[_0xa120('0x2b')](respondWithResult(_0x2f8370,null))[_0xa120('0x4c')](handleError(_0x2f8370,null));};exports[_0xa120('0x51')]=function(_0x562b6b,_0x2c7f86){return db['Trigger'][_0xa120('0x51')](_0x562b6b['body'],{})[_0xa120('0x2b')](function(_0x3df601){var _0xf5f6a2=_0x562b6b[_0xa120('0x52')][_0xa120('0x2d')]({'plain':!![]});if(!_0xf5f6a2)throw new Error(_0xa120('0x53'));if(_0xf5f6a2['role']===_0xa120('0x52')){var _0x184b41=_0x3df601[_0xa120('0x2d')]({'plain':!![]});var _0x39a817=_0xa120('0x2e');return db[_0xa120('0x54')][_0xa120('0x50')]({'where':{'name':_0x39a817,'userProfileId':_0xf5f6a2['userProfileId']},'raw':!![]})['then'](function(_0x28fe17){if(_0x28fe17&&_0x28fe17[_0xa120('0x55')]===0x0){return db[_0xa120('0x2f')][_0xa120('0x51')]({'name':_0x184b41[_0xa120('0x31')],'resourceId':_0x184b41['id'],'type':_0x28fe17[_0xa120('0x31')],'sectionId':_0x28fe17['id']},{})[_0xa120('0x2b')](function(){return _0x3df601;});}else{return _0x3df601;}})[_0xa120('0x4c')](function(_0x2640a4){logger[_0xa120('0x30')](_0xa120('0x56'),_0x2640a4);throw _0x2640a4;});}return _0x3df601;})[_0xa120('0x2b')](respondWithResult(_0x2c7f86,0xc9))['catch'](handleError(_0x2c7f86,null));};exports['update']=function(_0x3449d7,_0x3f7012){if(_0x3449d7[_0xa120('0x57')]['id']){delete _0x3449d7['body']['id'];}return db[_0xa120('0x34')][_0xa120('0x50')]({'where':{'id':_0x3449d7['params']['id']}})['then'](handleEntityNotFound(_0x3f7012,null))['then'](saveUpdates(_0x3449d7[_0xa120('0x57')],null))['then'](respondWithResult(_0x3f7012,null))[_0xa120('0x4c')](handleError(_0x3f7012,null));};exports['destroy']=function(_0x522a47,_0x478edd){return db['Trigger'][_0xa120('0x50')]({'where':{'id':_0x522a47[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x478edd,null))[_0xa120('0x2b')](removeEntity(_0x478edd,null))['catch'](handleError(_0x478edd,null));};exports[_0xa120('0x58')]=function(_0x3d6858,_0x3e5cde,_0x570fdc){if(_0x3d6858[_0xa120('0x57')]['id']){delete _0x3d6858[_0xa120('0x57')]['id'];}return db[_0xa120('0x34')][_0xa120('0x50')]({'where':{'id':_0x3d6858[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x3e5cde,null))[_0xa120('0x2b')](function(_0x212fd6){if(_0x212fd6){_0x3d6858['body']['TriggerAllId']=_0x212fd6['id'];return db[_0xa120('0x59')]['create'](_0x3d6858[_0xa120('0x57')]);}})[_0xa120('0x2b')](respondWithResult(_0x3e5cde,null))[_0xa120('0x4c')](handleError(_0x3e5cde,null));};exports[_0xa120('0x5a')]=function(_0x36bc26,_0x15246f,_0x9c37da){if(_0x36bc26[_0xa120('0x57')]['id']){delete _0x36bc26[_0xa120('0x57')]['id'];}return db[_0xa120('0x34')][_0xa120('0x50')]({'where':{'id':_0x36bc26[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x15246f,null))[_0xa120('0x2b')](function(_0x29c8e8){if(_0x29c8e8){_0x36bc26[_0xa120('0x57')]['TriggerAnyId']=_0x29c8e8['id'];return db[_0xa120('0x59')][_0xa120('0x51')](_0x36bc26['body']);}})['then'](respondWithResult(_0x15246f,null))[_0xa120('0x4c')](handleError(_0x15246f,null));};exports[_0xa120('0x5b')]=function(_0xe32d23,_0x261fd3,_0x49b95c){var _0x5b7f0a={};var _0x3ab6d3={};var _0x2270e7;var _0x363315;return db[_0xa120('0x34')][_0xa120('0x5c')]({'where':{'id':_0xe32d23[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x261fd3,null))[_0xa120('0x2b')](function(_0x40f923){if(_0x40f923){_0x2270e7=_0x40f923;_0x3ab6d3[_0xa120('0x38')]=_['keys'](db['Condition'][_0xa120('0x35')]);_0x3ab6d3[_0xa120('0x39')]=_[_0xa120('0x3a')](_0xe32d23[_0xa120('0x39')]);_0x3ab6d3[_0xa120('0x42')]=_['intersection'](_0x3ab6d3[_0xa120('0x38')],_0x3ab6d3[_0xa120('0x39')]);_0x5b7f0a['attributes']=_['intersection'](_0x3ab6d3['model'],qs[_0xa120('0x3d')](_0xe32d23[_0xa120('0x39')][_0xa120('0x3d')]));_0x5b7f0a['attributes']=_0x5b7f0a[_0xa120('0x3c')]['length']?_0x5b7f0a[_0xa120('0x3c')]:_0x3ab6d3[_0xa120('0x38')];_0x5b7f0a[_0xa120('0x5d')]=qs[_0xa120('0x41')](_0xe32d23[_0xa120('0x39')]['sort']);_0x5b7f0a[_0xa120('0x44')]=qs[_0xa120('0x42')](_[_0xa120('0x43')](_0xe32d23['query'],_0x3ab6d3['filters']));if(_0xe32d23[_0xa120('0x39')][_0xa120('0x46')]){_0x5b7f0a['where']=_[_0xa120('0x47')](_0x5b7f0a['where'],{'$or':_[_0xa120('0x33')](_0x5b7f0a[_0xa120('0x3c')],function(_0x3cc232){var _0x2bfba2={};_0x2bfba2[_0x3cc232]={'$like':'%'+_0xe32d23[_0xa120('0x39')][_0xa120('0x46')]+'%'};return _0x2bfba2;})});}_0x5b7f0a=_[_0xa120('0x47')]({},_0x5b7f0a,_0xe32d23[_0xa120('0x48')]);return _0x2270e7['getAllConditions'](_0x5b7f0a);}})[_0xa120('0x2b')](function(_0x4a6f1a){if(_0x4a6f1a){_0x363315=_0x4a6f1a[_0xa120('0x3e')];if(!_0xe32d23[_0xa120('0x39')][_0xa120('0x3f')](_0xa120('0x40'))){_0x5b7f0a[_0xa120('0x23')]=qs['limit'](_0xe32d23['query']['limit']);_0x5b7f0a[_0xa120('0x24')]=qs[_0xa120('0x24')](_0xe32d23['query'][_0xa120('0x24')]);}return _0x2270e7[_0xa120('0x5b')](_0x5b7f0a);}})['then'](function(_0x593997){if(_0x593997){return _0x593997?{'count':_0x363315,'rows':_0x593997}:null;}})[_0xa120('0x2b')](respondWithResult(_0x261fd3,null))[_0xa120('0x4c')](handleError(_0x261fd3,null));};exports[_0xa120('0x5e')]=function(_0x4e7459,_0x1f29cb,_0x3e7369){var _0x4129f2={};var _0x1e8dd4={};var _0x5e6d6f;var _0xd8c709;return db[_0xa120('0x34')][_0xa120('0x5c')]({'where':{'id':_0x4e7459[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x1f29cb,null))[_0xa120('0x2b')](function(_0x22670c){if(_0x22670c){_0x5e6d6f=_0x22670c;_0x1e8dd4[_0xa120('0x38')]=_[_0xa120('0x3a')](db[_0xa120('0x59')]['rawAttributes']);_0x1e8dd4[_0xa120('0x39')]=_[_0xa120('0x3a')](_0x4e7459[_0xa120('0x39')]);_0x1e8dd4[_0xa120('0x42')]=_[_0xa120('0x3b')](_0x1e8dd4['model'],_0x1e8dd4[_0xa120('0x39')]);_0x4129f2['attributes']=_[_0xa120('0x3b')](_0x1e8dd4[_0xa120('0x38')],qs['fields'](_0x4e7459[_0xa120('0x39')]['fields']));_0x4129f2[_0xa120('0x3c')]=_0x4129f2[_0xa120('0x3c')][_0xa120('0x3e')]?_0x4129f2['attributes']:_0x1e8dd4[_0xa120('0x38')];_0x4129f2['order']=qs[_0xa120('0x41')](_0x4e7459[_0xa120('0x39')][_0xa120('0x41')]);_0x4129f2[_0xa120('0x44')]=qs[_0xa120('0x42')](_['pick'](_0x4e7459[_0xa120('0x39')],_0x1e8dd4['filters']));if(_0x4e7459['query'][_0xa120('0x46')]){_0x4129f2[_0xa120('0x44')]=_[_0xa120('0x47')](_0x4129f2['where'],{'$or':_[_0xa120('0x33')](_0x4129f2[_0xa120('0x3c')],function(_0x2eba83){var _0x2a15be={};_0x2a15be[_0x2eba83]={'$like':'%'+_0x4e7459[_0xa120('0x39')]['filter']+'%'};return _0x2a15be;})});}_0x4129f2=_[_0xa120('0x47')]({},_0x4129f2,_0x4e7459['options']);return _0x5e6d6f[_0xa120('0x5e')](_0x4129f2);}})[_0xa120('0x2b')](function(_0x1d78e5){if(_0x1d78e5){_0xd8c709=_0x1d78e5[_0xa120('0x3e')];if(!_0x4e7459[_0xa120('0x39')][_0xa120('0x3f')](_0xa120('0x40'))){_0x4129f2['limit']=qs['limit'](_0x4e7459[_0xa120('0x39')][_0xa120('0x23')]);_0x4129f2[_0xa120('0x24')]=qs[_0xa120('0x24')](_0x4e7459['query'][_0xa120('0x24')]);}return _0x5e6d6f[_0xa120('0x5e')](_0x4129f2);}})[_0xa120('0x2b')](function(_0x136361){if(_0x136361){return _0x136361?{'count':_0xd8c709,'rows':_0x136361}:null;}})[_0xa120('0x2b')](respondWithResult(_0x1f29cb,null))[_0xa120('0x4c')](handleError(_0x1f29cb,null));};exports[_0xa120('0x5f')]=function(_0x220779,_0x5116a6,_0x4aa8dd){if(_0x220779[_0xa120('0x57')]['id']){delete _0x220779[_0xa120('0x57')]['id'];}return db[_0xa120('0x34')][_0xa120('0x50')]({'where':{'id':_0x220779['params']['id']}})['then'](handleEntityNotFound(_0x5116a6,null))[_0xa120('0x2b')](function(_0x1286d1){if(_0x1286d1){_0x220779[_0xa120('0x57')][_0xa120('0x60')]=_0x1286d1['id'];return db[_0xa120('0x61')]['create'](_0x220779['body']);}})['then'](respondWithResult(_0x5116a6,null))['catch'](handleError(_0x5116a6,null));};exports[_0xa120('0x62')]=function(_0x2957d9,_0x5993be,_0x4e3a27){var _0x36f812={};var _0xed32df={};var _0x194613;var _0x2ccb05;return db[_0xa120('0x34')][_0xa120('0x5c')]({'where':{'id':_0x2957d9[_0xa120('0x4e')]['id']}})[_0xa120('0x2b')](handleEntityNotFound(_0x5993be,null))[_0xa120('0x2b')](function(_0x1e2057){if(_0x1e2057){_0x194613=_0x1e2057;_0xed32df[_0xa120('0x38')]=_['keys'](db[_0xa120('0x61')][_0xa120('0x35')]);_0xed32df[_0xa120('0x39')]=_[_0xa120('0x3a')](_0x2957d9[_0xa120('0x39')]);_0xed32df[_0xa120('0x42')]=_[_0xa120('0x3b')](_0xed32df[_0xa120('0x38')],_0xed32df[_0xa120('0x39')]);_0x36f812['attributes']=_['intersection'](_0xed32df[_0xa120('0x38')],qs[_0xa120('0x3d')](_0x2957d9['query'][_0xa120('0x3d')]));_0x36f812['attributes']=_0x36f812[_0xa120('0x3c')][_0xa120('0x3e')]?_0x36f812[_0xa120('0x3c')]:_0xed32df[_0xa120('0x38')];_0x36f812[_0xa120('0x5d')]=qs['sort'](_0x2957d9['query'][_0xa120('0x41')]);_0x36f812[_0xa120('0x44')]=qs[_0xa120('0x42')](_['pick'](_0x2957d9['query'],_0xed32df[_0xa120('0x42')]));if(_0x2957d9[_0xa120('0x39')][_0xa120('0x46')]){_0x36f812[_0xa120('0x44')]=_[_0xa120('0x47')](_0x36f812[_0xa120('0x44')],{'$or':_[_0xa120('0x33')](_0x36f812[_0xa120('0x3c')],function(_0x59fa6b){var _0x8de246={};_0x8de246[_0x59fa6b]={'$like':'%'+_0x2957d9['query'][_0xa120('0x46')]+'%'};return _0x8de246;})});}_0x36f812=_[_0xa120('0x47')]({},_0x36f812,_0x2957d9[_0xa120('0x48')]);return _0x194613[_0xa120('0x62')](_0x36f812);}})[_0xa120('0x2b')](function(_0x4579b1){if(_0x4579b1){_0x2ccb05=_0x4579b1[_0xa120('0x3e')];if(!_0x2957d9[_0xa120('0x39')][_0xa120('0x3f')](_0xa120('0x40'))){_0x36f812[_0xa120('0x23')]=qs[_0xa120('0x23')](_0x2957d9[_0xa120('0x39')][_0xa120('0x23')]);_0x36f812['offset']=qs[_0xa120('0x24')](_0x2957d9[_0xa120('0x39')]['offset']);}return _0x194613[_0xa120('0x62')](_0x36f812);}})[_0xa120('0x2b')](function(_0x9369e){if(_0x9369e){return _0x9369e?{'count':_0x2ccb05,'rows':_0x9369e}:null;}})['then'](respondWithResult(_0x5993be,null))['catch'](handleError(_0x5993be,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 7a0743c..53f1097 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 _0x1da6=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x1da6,0x7c));var _0x61da=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0x1da6[_0x4d093a];return _0x5d7227;};'use strict';var _=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var logger=require(_0x61da('0x2'))(_0x61da('0x3'));var moment=require(_0x61da('0x4'));var BPromise=require(_0x61da('0x5'));var rp=require(_0x61da('0x6'));var fs=require('fs');var path=require(_0x61da('0x7'));var rimraf=require(_0x61da('0x8'));var config=require(_0x61da('0x9'));var attributes=require(_0x61da('0xa'));module[_0x61da('0xb')]=function(_0x16cd66,_0x2c40c6){return _0x16cd66[_0x61da('0xc')](_0x61da('0xd'),attributes,{'tableName':_0x61da('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf041=['path','../../config/environment','define','Trigger','tools_triggers','../../config/logger','api','moment','bluebird'];(function(_0x39efa2,_0x5c159d){var _0x62f0a8=function(_0x117831){while(--_0x117831){_0x39efa2['push'](_0x39efa2['shift']());}};_0x62f0a8(++_0x5c159d);}(_0xf041,0x15b));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f04('0x0'))(_0x1f04('0x1'));var moment=require(_0x1f04('0x2'));var BPromise=require(_0x1f04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f04('0x4'));var rimraf=require('rimraf');var config=require(_0x1f04('0x5'));var attributes=require('./trigger.attributes');module['exports']=function(_0x25d578,_0x504d71){return _0x25d578[_0x1f04('0x6')](_0x1f04('0x7'),attributes,{'tableName':_0x1f04('0x8'),'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 e1c3349..180e517 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 _0x4b0b=['limit','include','model','map','GetTrigger','find','ShowTrigger','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Trigger','findAll','options','raw','where','attributes'];(function(_0x2cad38,_0x22b22b){var _0xf2093a=function(_0x2874f4){while(--_0x2874f4){_0x2cad38['push'](_0x2cad38['shift']());}};_0xf2093a(++_0x22b22b);}(_0x4b0b,0x74));var _0xb4b0=function(_0x3d47e4,_0x1d01c0){_0x3d47e4=_0x3d47e4-0x0;var _0x1e555b=_0x4b0b[_0x3d47e4];return _0x1e555b;};'use strict';var _=require(_0xb4b0('0x0'));var util=require(_0xb4b0('0x1'));var moment=require('moment');var BPromise=require(_0xb4b0('0x2'));var rs=require(_0xb4b0('0x3'));var fs=require('fs');var Redis=require(_0xb4b0('0x4'));var db=require(_0xb4b0('0x5'))['db'];var utils=require(_0xb4b0('0x6'));var logger=require('../../config/logger')(_0xb4b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4b0('0x8'));var client=jayson['client'][_0xb4b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x422b81,_0x5665fc,_0x3aacd6){return new BPromise(function(_0x476620,_0x28fb53){return client[_0xb4b0('0xa')](_0x422b81,_0x3aacd6)[_0xb4b0('0xb')](function(_0xe268d8){logger[_0xb4b0('0xc')](_0xb4b0('0xd'),_0x5665fc,_0xb4b0('0xe'));logger[_0xb4b0('0xf')](_0xb4b0('0x10'),_0x5665fc,_0xb4b0('0xe'),JSON[_0xb4b0('0x11')](_0xe268d8));if(_0xe268d8[_0xb4b0('0x12')]){if(_0xe268d8[_0xb4b0('0x12')][_0xb4b0('0x13')]===0x1f4){logger[_0xb4b0('0x12')](_0xb4b0('0xd'),_0x5665fc,_0xe268d8[_0xb4b0('0x12')]['message']);return _0x28fb53(_0xe268d8['error'][_0xb4b0('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x5665fc,_0xe268d8[_0xb4b0('0x12')][_0xb4b0('0x14')]);return _0x476620(_0xe268d8['error'][_0xb4b0('0x14')]);}else{logger['info'](_0xb4b0('0xd'),_0x5665fc,_0xb4b0('0xe'));_0x476620(_0xe268d8[_0xb4b0('0x15')][_0xb4b0('0x14')]);}})['catch'](function(_0x46b6c6){logger[_0xb4b0('0x12')]('Trigger,\x20%s,\x20%s',_0x5665fc,_0x46b6c6);_0x28fb53(_0x46b6c6);});});}exports['GetTrigger']=function(_0x12b2b3){var _0x16df1a=this;return new Promise(function(_0x5a282d,_0xabd8e1){return db[_0xb4b0('0x16')][_0xb4b0('0x17')]({'raw':_0x12b2b3['options']?_0x12b2b3[_0xb4b0('0x18')][_0xb4b0('0x19')]===undefined?!![]:![]:!![],'where':_0x12b2b3[_0xb4b0('0x18')]?_0x12b2b3[_0xb4b0('0x18')][_0xb4b0('0x1a')]||null:null,'attributes':_0x12b2b3[_0xb4b0('0x18')]?_0x12b2b3['options'][_0xb4b0('0x1b')]||null:null,'limit':_0x12b2b3[_0xb4b0('0x18')]?_0x12b2b3[_0xb4b0('0x18')][_0xb4b0('0x1c')]||null:null,'include':_0x12b2b3[_0xb4b0('0x18')]?_0x12b2b3['options']['include']?_['map'](_0x12b2b3[_0xb4b0('0x18')][_0xb4b0('0x1d')],function(_0x165af5){return{'model':db[_0x165af5[_0xb4b0('0x1e')]],'as':_0x165af5['as'],'attributes':_0x165af5['attributes'],'include':_0x165af5[_0xb4b0('0x1d')]?_[_0xb4b0('0x1f')](_0x165af5[_0xb4b0('0x1d')],function(_0x59090b){return{'model':db[_0x59090b['model']],'as':_0x59090b['as'],'attributes':_0x59090b['attributes'],'include':_0x59090b[_0xb4b0('0x1d')]?_[_0xb4b0('0x1f')](_0x59090b[_0xb4b0('0x1d')],function(_0x5de756){return{'model':db[_0x5de756[_0xb4b0('0x1e')]],'as':_0x5de756['as'],'attributes':_0x5de756[_0xb4b0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3acf0e){logger[_0xb4b0('0xc')](_0xb4b0('0x20'),_0x12b2b3);logger[_0xb4b0('0xf')](_0xb4b0('0x20'),_0x12b2b3,JSON[_0xb4b0('0x11')](_0x3acf0e));_0x5a282d(_0x3acf0e);})['catch'](function(_0x1b30a0){logger[_0xb4b0('0x12')](_0xb4b0('0x20'),_0x1b30a0[_0xb4b0('0x14')],_0x12b2b3);_0xabd8e1(_0x16df1a[_0xb4b0('0x12')](0x1f4,_0x1b30a0[_0xb4b0('0x14')]));});});};exports['ShowTrigger']=function(_0x4088e4){var _0x57ab43=this;return new Promise(function(_0x1fe60f,_0x3b1598){return db['Trigger'][_0xb4b0('0x21')]({'raw':_0x4088e4[_0xb4b0('0x18')]?_0x4088e4[_0xb4b0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4088e4[_0xb4b0('0x18')]?_0x4088e4['options'][_0xb4b0('0x1a')]||null:null,'attributes':_0x4088e4['options']?_0x4088e4[_0xb4b0('0x18')]['attributes']||null:null,'include':_0x4088e4[_0xb4b0('0x18')]?_0x4088e4[_0xb4b0('0x18')][_0xb4b0('0x1d')]?_[_0xb4b0('0x1f')](_0x4088e4[_0xb4b0('0x18')]['include'],function(_0x1a6821){return{'model':db[_0x1a6821[_0xb4b0('0x1e')]],'as':_0x1a6821['as'],'attributes':_0x1a6821['attributes'],'include':_0x1a6821[_0xb4b0('0x1d')]?_[_0xb4b0('0x1f')](_0x1a6821[_0xb4b0('0x1d')],function(_0x4fdc03){return{'model':db[_0x4fdc03[_0xb4b0('0x1e')]],'as':_0x4fdc03['as'],'attributes':_0x4fdc03[_0xb4b0('0x1b')],'include':_0x4fdc03['include']?_[_0xb4b0('0x1f')](_0x4fdc03['include'],function(_0x182826){return{'model':db[_0x182826[_0xb4b0('0x1e')]],'as':_0x182826['as'],'attributes':_0x182826[_0xb4b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb4b0('0xb')](function(_0x11985b){logger[_0xb4b0('0xc')](_0xb4b0('0x22'),_0x4088e4);logger[_0xb4b0('0xf')](_0xb4b0('0x22'),_0x4088e4,JSON[_0xb4b0('0x11')](_0x11985b));_0x1fe60f(_0x11985b);})[_0xb4b0('0x23')](function(_0x3dfa8b){logger[_0xb4b0('0x12')](_0xb4b0('0x22'),_0x3dfa8b[_0xb4b0('0x14')],_0x4088e4);_0x3b1598(_0x57ab43[_0xb4b0('0x12')](0x1f4,_0x3dfa8b[_0xb4b0('0x14')]));});});}; \ No newline at end of file +var _0x2aad=['catch','GetTrigger','findAll','options','raw','attributes','include','model','map','stringify','ShowTrigger','find','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x2aad,0x140));var _0xd2aa=function(_0x3d47eb,_0x57b1ef){_0x3d47eb=_0x3d47eb-0x0;var _0x4532e2=_0x2aad[_0x3d47eb];return _0x4532e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd2aa('0x0'));var BPromise=require(_0xd2aa('0x1'));var rs=require(_0xd2aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd2aa('0x4'));var jayson=require(_0xd2aa('0x5'));var client=jayson[_0xd2aa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28c621,_0x5063e6,_0x554bd2){return new BPromise(function(_0x5d192e,_0x4a73d9){return client[_0xd2aa('0x7')](_0x28c621,_0x554bd2)[_0xd2aa('0x8')](function(_0x3f86b1){logger[_0xd2aa('0x9')](_0xd2aa('0xa'),_0x5063e6,_0xd2aa('0xb'));logger[_0xd2aa('0xc')](_0xd2aa('0xd'),_0x5063e6,_0xd2aa('0xb'),JSON['stringify'](_0x3f86b1));if(_0x3f86b1[_0xd2aa('0xe')]){if(_0x3f86b1[_0xd2aa('0xe')]['code']===0x1f4){logger[_0xd2aa('0xe')](_0xd2aa('0xa'),_0x5063e6,_0x3f86b1[_0xd2aa('0xe')][_0xd2aa('0xf')]);return _0x4a73d9(_0x3f86b1[_0xd2aa('0xe')][_0xd2aa('0xf')]);}logger[_0xd2aa('0xe')](_0xd2aa('0xa'),_0x5063e6,_0x3f86b1[_0xd2aa('0xe')][_0xd2aa('0xf')]);return _0x5d192e(_0x3f86b1[_0xd2aa('0xe')]['message']);}else{logger[_0xd2aa('0x9')](_0xd2aa('0xa'),_0x5063e6,_0xd2aa('0xb'));_0x5d192e(_0x3f86b1['result'][_0xd2aa('0xf')]);}})[_0xd2aa('0x10')](function(_0x542b25){logger['error'](_0xd2aa('0xa'),_0x5063e6,_0x542b25);_0x4a73d9(_0x542b25);});});}exports[_0xd2aa('0x11')]=function(_0x364943){var _0x2a5644=this;return new Promise(function(_0x43cd90,_0x38a8c1){return db['Trigger'][_0xd2aa('0x12')]({'raw':_0x364943[_0xd2aa('0x13')]?_0x364943[_0xd2aa('0x13')][_0xd2aa('0x14')]===undefined?!![]:![]:!![],'where':_0x364943['options']?_0x364943[_0xd2aa('0x13')]['where']||null:null,'attributes':_0x364943[_0xd2aa('0x13')]?_0x364943[_0xd2aa('0x13')][_0xd2aa('0x15')]||null:null,'limit':_0x364943['options']?_0x364943[_0xd2aa('0x13')]['limit']||null:null,'include':_0x364943[_0xd2aa('0x13')]?_0x364943['options'][_0xd2aa('0x16')]?_['map'](_0x364943[_0xd2aa('0x13')][_0xd2aa('0x16')],function(_0x223931){return{'model':db[_0x223931[_0xd2aa('0x17')]],'as':_0x223931['as'],'attributes':_0x223931['attributes'],'include':_0x223931[_0xd2aa('0x16')]?_[_0xd2aa('0x18')](_0x223931[_0xd2aa('0x16')],function(_0x8a050f){return{'model':db[_0x8a050f[_0xd2aa('0x17')]],'as':_0x8a050f['as'],'attributes':_0x8a050f['attributes'],'include':_0x8a050f[_0xd2aa('0x16')]?_[_0xd2aa('0x18')](_0x8a050f['include'],function(_0x189836){return{'model':db[_0x189836[_0xd2aa('0x17')]],'as':_0x189836['as'],'attributes':_0x189836[_0xd2aa('0x15')]};}):[]};}):[]};}):[]:[]})[_0xd2aa('0x8')](function(_0x18d3fa){logger[_0xd2aa('0x9')](_0xd2aa('0x11'),_0x364943);logger[_0xd2aa('0xc')]('GetTrigger',_0x364943,JSON[_0xd2aa('0x19')](_0x18d3fa));_0x43cd90(_0x18d3fa);})[_0xd2aa('0x10')](function(_0x5e2c1b){logger[_0xd2aa('0xe')]('GetTrigger',_0x5e2c1b['message'],_0x364943);_0x38a8c1(_0x2a5644[_0xd2aa('0xe')](0x1f4,_0x5e2c1b[_0xd2aa('0xf')]));});});};exports[_0xd2aa('0x1a')]=function(_0x5811b1){var _0x15036a=this;return new Promise(function(_0x4f4c17,_0x4a8717){return db['Trigger'][_0xd2aa('0x1b')]({'raw':_0x5811b1[_0xd2aa('0x13')]?_0x5811b1['options'][_0xd2aa('0x14')]===undefined?!![]:![]:!![],'where':_0x5811b1[_0xd2aa('0x13')]?_0x5811b1[_0xd2aa('0x13')]['where']||null:null,'attributes':_0x5811b1[_0xd2aa('0x13')]?_0x5811b1[_0xd2aa('0x13')][_0xd2aa('0x15')]||null:null,'include':_0x5811b1[_0xd2aa('0x13')]?_0x5811b1[_0xd2aa('0x13')][_0xd2aa('0x16')]?_['map'](_0x5811b1[_0xd2aa('0x13')][_0xd2aa('0x16')],function(_0x5a1480){return{'model':db[_0x5a1480['model']],'as':_0x5a1480['as'],'attributes':_0x5a1480[_0xd2aa('0x15')],'include':_0x5a1480[_0xd2aa('0x16')]?_['map'](_0x5a1480[_0xd2aa('0x16')],function(_0x53130e){return{'model':db[_0x53130e[_0xd2aa('0x17')]],'as':_0x53130e['as'],'attributes':_0x53130e[_0xd2aa('0x15')],'include':_0x53130e[_0xd2aa('0x16')]?_[_0xd2aa('0x18')](_0x53130e[_0xd2aa('0x16')],function(_0x4fd546){return{'model':db[_0x4fd546[_0xd2aa('0x17')]],'as':_0x4fd546['as'],'attributes':_0x4fd546[_0xd2aa('0x15')]};}):[]};}):[]};}):[]:[]})[_0xd2aa('0x8')](function(_0x45bd2c){logger[_0xd2aa('0x9')](_0xd2aa('0x1a'),_0x5811b1);logger['debug'](_0xd2aa('0x1a'),_0x5811b1,JSON[_0xd2aa('0x19')](_0x45bd2c));_0x4f4c17(_0x45bd2c);})['catch'](function(_0x396514){logger[_0xd2aa('0xe')](_0xd2aa('0x1a'),_0x396514[_0xd2aa('0xf')],_0x5811b1);_0x4a8717(_0x15036a[_0xd2aa('0xe')](0x1f4,_0x396514[_0xd2aa('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index cd6222b..c64cc5b 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 _0xcabc=['show','post','/:id/clone','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','/:id','isAuthenticated'];(function(_0x32de0a,_0x3a98b3){var _0x376921=function(_0x1ced57){while(--_0x1ced57){_0x32de0a['push'](_0x32de0a['shift']());}};_0x376921(++_0x3a98b3);}(_0xcabc,0xf9));var _0xccab=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xcabc[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xccab('0x0'));var util=require(_0xccab('0x1'));var path=require('path');var timeout=require(_0xccab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xccab('0x3'));var auth=require(_0xccab('0x4'));var interaction=require(_0xccab('0x5'));var config=require(_0xccab('0x6'));var controller=require(_0xccab('0x7'));router[_0xccab('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xccab('0x9'),auth[_0xccab('0xa')](),controller[_0xccab('0xb')]);router[_0xccab('0xc')](_0xccab('0xd'),auth[_0xccab('0xa')](),controller['clone']);router[_0xccab('0xc')]('/',auth[_0xccab('0xa')](),controller[_0xccab('0xe')]);router[_0xccab('0xf')](_0xccab('0x9'),auth[_0xccab('0xa')](),controller[_0xccab('0x10')]);router[_0xccab('0x11')](_0xccab('0x9'),auth[_0xccab('0xa')](),controller[_0xccab('0x12')]);module[_0xccab('0x13')]=router; \ No newline at end of file +var _0x9c5f=['express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post','/:id/clone','clone','create','delete','multer','path'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x9c5f,0x11f));var _0xf9c5=function(_0x1ed213,_0x25027e){_0x1ed213=_0x1ed213-0x0;var _0x1afede=_0x9c5f[_0x1ed213];return _0x1afede;};'use strict';var multer=require(_0xf9c5('0x0'));var util=require('util');var path=require(_0xf9c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xf9c5('0x2'));var router=express[_0xf9c5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf9c5('0x4'));var config=require(_0xf9c5('0x5'));var controller=require(_0xf9c5('0x6'));router[_0xf9c5('0x7')]('/',auth['isAuthenticated'](),controller[_0xf9c5('0x8')]);router['get'](_0xf9c5('0x9'),auth[_0xf9c5('0xa')](),controller[_0xf9c5('0xb')]);router[_0xf9c5('0xc')](_0xf9c5('0xd'),auth[_0xf9c5('0xa')](),controller[_0xf9c5('0xe')]);router[_0xf9c5('0xc')]('/',auth[_0xf9c5('0xa')](),controller[_0xf9c5('0xf')]);router['put'](_0xf9c5('0x9'),auth[_0xf9c5('0xa')](),controller['update']);router[_0xf9c5('0x10')]('/:id',auth[_0xf9c5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c71750a..29ea739 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 _0xa6f3=['nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','certificate','actpass','dynamic','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia'];(function(_0xf54034,_0x1d510f){var _0x5144d9=function(_0x163422){while(--_0x163422){_0xf54034['push'](_0xf54034['shift']());}};_0x5144d9(++_0x1d510f);}(_0xa6f3,0x173));var _0x3a6f=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0xa6f3[_0x97c6ea];return _0x2d7f50;};'use strict';var Sequelize=require(_0x3a6f('0x0'));module[_0x3a6f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3a6f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x4'),_0x3a6f('0x5'),_0x3a6f('0x6')),'allowNull':![],'defaultValue':_0x3a6f('0x4')},'context':{'type':Sequelize[_0x3a6f('0x7')],'allowNull':![],'defaultValue':_0x3a6f('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0x3a6f('0x9'),'ALLOWED_PASSED_SCREEN',_0x3a6f('0xa'),_0x3a6f('0xb'),_0x3a6f('0xc'),'PROHIB_PASSED_SCREEN',_0x3a6f('0xd'),_0x3a6f('0xe'))},'deny':{'type':Sequelize[_0x3a6f('0x7')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x3a6f('0x7')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x3a6f('0x7')],'defaultValue':'udp','set':function(_0x4794e5){this[_0x3a6f('0xf')](_0x3a6f('0x10'),_0x4794e5?_0x4794e5[_0x3a6f('0x11')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x3a6f('0x12')](_0x3a6f('0x10'))[_0x3a6f('0x13')](','):null;},'comment':_0x3a6f('0x14')},'dtmfmode':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x15'),'info',_0x3a6f('0x16'),_0x3a6f('0x17'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no',_0x3a6f('0x19'),_0x3a6f('0x1a'),_0x3a6f('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3a6f('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3a6f('0x7')]},'directmediadeny':{'type':Sequelize[_0x3a6f('0x7')]},'nat':{'type':Sequelize[_0x3a6f('0x7')],'defaultValue':_0x3a6f('0x1c'),'set':function(_0x12bbaf){this[_0x3a6f('0xf')]('nat',_0x12bbaf?_0x12bbaf['join'](','):null);},'get':function(){return this[_0x3a6f('0x12')](_0x3a6f('0x1d'))?this['getDataValue'](_0x3a6f('0x1d'))[_0x3a6f('0x13')](','):null;},'comment':_0x3a6f('0x1e')},'callgroup':{'type':Sequelize[_0x3a6f('0x7')]},'namedcallgroup':{'type':Sequelize[_0x3a6f('0x7')]},'pickupgroup':{'type':Sequelize[_0x3a6f('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x3a6f('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3a6f('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3a6f('0x7')],'defaultValue':_0x3a6f('0x1f')},'allow':{'type':Sequelize[_0x3a6f('0x7')],'allowNull':![],'defaultValue':_0x3a6f('0x20'),'set':function(_0xa9abcc){this['setDataValue'](_0x3a6f('0x21'),_0xa9abcc?_0xa9abcc[_0x3a6f('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x3a6f('0x12')]('allow')?this[_0x3a6f('0x12')]('allow')['split'](';'):null;},'comment':_0x3a6f('0x22')},'autoframing':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'insecure':{'type':Sequelize[_0x3a6f('0x7')],'defaultValue':_0x3a6f('0x23'),'set':function(_0x2d417f){this['setDataValue']('insecure',_0x2d417f?_0x2d417f[_0x3a6f('0x11')](','):null);},'get':function(){return this[_0x3a6f('0x12')](_0x3a6f('0x24'))?this[_0x3a6f('0x12')](_0x3a6f('0x24'))[_0x3a6f('0x13')](','):null;},'comment':_0x3a6f('0x25')},'trustrpid':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3a6f('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no',_0x3a6f('0x26'))},'promiscredir':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x3a6f('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'setvar':{'type':Sequelize[_0x3a6f('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x3a6f('0x7')]},'callcounter':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3a6f('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x3a6f('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x3a6f('0x7')]},'template':{'type':Sequelize[_0x3a6f('0x7')]},'videosupport':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no',_0x3a6f('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'mailbox':{'type':Sequelize[_0x3a6f('0x7')]},'session_timers':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x29'),_0x3a6f('0x2a'),_0x3a6f('0x2b'))},'session_expires':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x2c'),_0x3a6f('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x3a6f('0x7')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3a6f('0x7')]},'fromuser':{'type':Sequelize[_0x3a6f('0x7')]},'port':{'type':Sequelize[_0x3a6f('0x27')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x3a6f('0x7')]},'defaultuser':{'type':Sequelize[_0x3a6f('0x7')]},'rtptimeout':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3a6f('0x7')]},'callbackextension':{'type':Sequelize[_0x3a6f('0x7')]},'timert1':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'timerb':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x3a6f('0x7')]},'contactdeny':{'type':Sequelize[_0x3a6f('0x7')]},'contactacl':{'type':Sequelize[_0x3a6f('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0x3a6f('0x7')]},'use_q850_reason':{'type':Sequelize[_0x3a6f('0x7')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'force_avp':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no')},'icesupport':{'type':Sequelize[_0x3a6f('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no','fingerprint',_0x3a6f('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x3a6f('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3a6f('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0x3a6f('0x7')]},'dtlscipher':{'type':Sequelize[_0x3a6f('0x7')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x3a6f('0x3')]('active','passive',_0x3a6f('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3a6f('0x7')]},'usereqphone':{'type':Sequelize[_0x3a6f('0x3')](_0x3a6f('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x3a6f('0x7')]},'call_limit':{'type':Sequelize[_0x3a6f('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3a6f('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x3a6f('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x3a6f('0x7')]},'mohinterpret':{'type':Sequelize[_0x3a6f('0x7')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x3a6f('0x7')]},'description':{'type':Sequelize[_0x3a6f('0x7')]},'host':{'type':Sequelize[_0x3a6f('0x7')],'defaultValue':_0x3a6f('0x30')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x3a6f('0x19'),_0x3a6f('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x3a6f('0x7')]},'active':{'type':Sequelize[_0x3a6f('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xd6eb=['rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','\x22\x22\x20<>','INTEGER','always','accept','refuse','uac','uas','active','passive','dynamic','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_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x4ee848,_0x3e29b2){var _0x1a55c0=function(_0x2838af){while(--_0x2838af){_0x4ee848['push'](_0x4ee848['shift']());}};_0x1a55c0(++_0x3e29b2);}(_0xd6eb,0xb4));var _0xbd6e=function(_0x3fffb3,_0x140ea8){_0x3fffb3=_0x3fffb3-0x0;var _0x260f9a=_0xd6eb[_0x3fffb3];return _0x260f9a;};'use strict';var Sequelize=require(_0xbd6e('0x0'));module[_0xbd6e('0x1')]={'name':{'type':Sequelize[_0xbd6e('0x2')],'allowNull':![],'unique':_0xbd6e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x5'),_0xbd6e('0x6'),_0xbd6e('0x7')),'allowNull':![],'defaultValue':_0xbd6e('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd6e('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xbd6e('0x9'),'ALLOWED_PASSED_SCREEN',_0xbd6e('0xa'),_0xbd6e('0xb'),_0xbd6e('0xc'),_0xbd6e('0xd'),_0xbd6e('0xe'),_0xbd6e('0xf'))},'deny':{'type':Sequelize[_0xbd6e('0x2')]},'permit':{'type':Sequelize[_0xbd6e('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xbd6e('0x2')]},'remotesecret':{'type':Sequelize[_0xbd6e('0x2')]},'transport':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':'udp','set':function(_0x5d6f17){this[_0xbd6e('0x10')]('transport',_0x5d6f17?_0x5d6f17['join'](','):null);},'get':function(){return this['getDataValue'](_0xbd6e('0x11'))?this[_0xbd6e('0x12')](_0xbd6e('0x11'))['split'](','):null;},'comment':_0xbd6e('0x13')},'dtmfmode':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x14'),'info',_0xbd6e('0x15'),_0xbd6e('0x16'),_0xbd6e('0x17')),'defaultValue':_0xbd6e('0x14')},'directmedia':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no',_0xbd6e('0x19'),_0xbd6e('0x1a'),_0xbd6e('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbd6e('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':_0xbd6e('0x1c'),'set':function(_0x1c649d){this[_0xbd6e('0x10')](_0xbd6e('0x1d'),_0x1c649d?_0x1c649d[_0xbd6e('0x1e')](','):null);},'get':function(){return this[_0xbd6e('0x12')](_0xbd6e('0x1d'))?this[_0xbd6e('0x12')](_0xbd6e('0x1d'))[_0xbd6e('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xbd6e('0x2')]},'namedcallgroup':{'type':Sequelize[_0xbd6e('0x2')]},'pickupgroup':{'type':Sequelize[_0xbd6e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xbd6e('0x2')]},'language':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbd6e('0x20')},'allow':{'type':Sequelize[_0xbd6e('0x2')],'allowNull':![],'defaultValue':_0xbd6e('0x21'),'set':function(_0x3186b9){this[_0xbd6e('0x10')](_0xbd6e('0x22'),_0x3186b9?_0x3186b9[_0xbd6e('0x1e')](';'):_0xbd6e('0x21'));},'get':function(){return this['getDataValue'](_0xbd6e('0x22'))?this[_0xbd6e('0x12')](_0xbd6e('0x22'))['split'](';'):null;},'comment':_0xbd6e('0x23')},'autoframing':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'insecure':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':_0xbd6e('0x24'),'set':function(_0x4c5b55){this['setDataValue'](_0xbd6e('0x25'),_0x4c5b55?_0x4c5b55['join'](','):null);},'get':function(){return this[_0xbd6e('0x12')]('insecure')?this[_0xbd6e('0x12')](_0xbd6e('0x25'))[_0xbd6e('0x1f')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xbd6e('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xbd6e('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xbd6e('0x2')]},'callerid':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':_0xbd6e('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xbd6e('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xbd6e('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xbd6e('0x4')]('yes','no',_0xbd6e('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'mailbox':{'type':Sequelize[_0xbd6e('0x2')]},'session_timers':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x29'),_0xbd6e('0x2a'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x2b'),_0xbd6e('0x2c')),'defaultValue':_0xbd6e('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xbd6e('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xbd6e('0x18'),'no'),'defaultValue':_0xbd6e('0x18')},'keepalive':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'defaultip':{'type':Sequelize[_0xbd6e('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbd6e('0x2')]},'callbackextension':{'type':Sequelize[_0xbd6e('0x2')]},'timert1':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'timerb':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0xbd6e('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0xbd6e('0x2')]},'contactdeny':{'type':Sequelize[_0xbd6e('0x2')]},'contactacl':{'type':Sequelize[_0xbd6e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xbd6e('0x2')]},'use_q850_reason':{'type':Sequelize[_0xbd6e('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbd6e('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0xbd6e('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xbd6e('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xbd6e('0x2')]},'dtlscafile':{'type':Sequelize[_0xbd6e('0x2')]},'dtlscapath':{'type':Sequelize[_0xbd6e('0x2')]},'dtlssetup':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x2d'),_0xbd6e('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbd6e('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xbd6e('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbd6e('0x2')]},'recordofffeature':{'type':Sequelize[_0xbd6e('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no')},'vmexten':{'type':Sequelize[_0xbd6e('0x2')]},'mohinterpret':{'type':Sequelize[_0xbd6e('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xbd6e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbd6e('0x2f')},'canreinvite':{'type':Sequelize[_0xbd6e('0x4')](_0xbd6e('0x18'),'no',_0xbd6e('0x19'),_0xbd6e('0x1a'),_0xbd6e('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbd6e('0x2')]},'otherFields':{'type':Sequelize[_0xbd6e('0x2')]},'active':{'type':Sequelize[_0xbd6e('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbd6e('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 70a7443..6c89738 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 _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(_0x3f0bb8,_0x4cc442){var _0x41db16=function(_0x497e88){while(--_0x497e88){_0x3f0bb8['push'](_0x3f0bb8['shift']());}};_0x41db16(++_0x4cc442);}(_0x98a8,0x12c));var _0x898a=function(_0x2aea6d,_0x10d7ff){_0x2aea6d=_0x2aea6d-0x0;var _0x275736=_0x98a8[_0x2aea6d];return _0x275736;};'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 +var _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x4b84[_0x4d1ee9];return _0x9a5456;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ec6c3c0..c6c83b5 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 _0xef78=['./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x19d986,_0xd6e4a5){var _0x33e542=function(_0x5768ee){while(--_0x5768ee){_0x19d986['push'](_0x19d986['shift']());}};_0x33e542(++_0xd6e4a5);}(_0xef78,0x79));var _0x8ef7=function(_0xdaa40,_0x8492f3){_0xdaa40=_0xdaa40-0x0;var _0x32b79d=_0xef78[_0xdaa40];return _0x32b79d;};'use strict';var _=require(_0x8ef7('0x0'));var util=require(_0x8ef7('0x1'));var logger=require(_0x8ef7('0x2'))(_0x8ef7('0x3'));var moment=require(_0x8ef7('0x4'));var BPromise=require('bluebird');var rp=require(_0x8ef7('0x5'));var fs=require('fs');var path=require(_0x8ef7('0x6'));var rimraf=require(_0x8ef7('0x7'));var config=require(_0x8ef7('0x8'));var attributes=require(_0x8ef7('0x9'));module[_0x8ef7('0xa')]=function(_0x4352da,_0x292feb){return _0x4352da['define'](_0x8ef7('0xb'),attributes,{'tableName':_0x8ef7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xead2=['tools_trunks','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x31df77,_0x4378c5){var _0xdea181=function(_0x25baad){while(--_0x25baad){_0x31df77['push'](_0x31df77['shift']());}};_0xdea181(++_0x4378c5);}(_0xead2,0x1f0));var _0x2ead=function(_0x10c0f0,_0x6db401){_0x10c0f0=_0x10c0f0-0x0;var _0x1d769f=_0xead2[_0x10c0f0];return _0x1d769f;};'use strict';var _=require(_0x2ead('0x0'));var util=require('util');var logger=require(_0x2ead('0x1'))(_0x2ead('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ead('0x3'));var fs=require('fs');var path=require(_0x2ead('0x4'));var rimraf=require(_0x2ead('0x5'));var config=require(_0x2ead('0x6'));var attributes=require(_0x2ead('0x7'));module[_0x2ead('0x8')]=function(_0x140882,_0xd269ef){return _0x140882[_0x2ead('0x9')]('Trunk',attributes,{'tableName':_0x2ead('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index e590059..dc6f740 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 _0x62f1=['info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','GetTrunk','ShowTrunk','then','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x2bd056,_0x271da0){var _0x4b50a3=function(_0x46016b){while(--_0x46016b){_0x2bd056['push'](_0x2bd056['shift']());}};_0x4b50a3(++_0x271da0);}(_0x62f1,0x161));var _0x162f=function(_0x319ff8,_0x45ca90){_0x319ff8=_0x319ff8-0x0;var _0x11d674=_0x62f1[_0x319ff8];return _0x11d674;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x162f('0x0'));var BPromise=require(_0x162f('0x1'));var rs=require(_0x162f('0x2'));var fs=require('fs');var Redis=require(_0x162f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x162f('0x4'));var logger=require(_0x162f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x162f('0x6'));var client=jayson[_0x162f('0x7')][_0x162f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6afabf,_0x4a91b6,_0x3dfd21){return new BPromise(function(_0x10a580,_0x166d09){return client[_0x162f('0x9')](_0x6afabf,_0x3dfd21)['then'](function(_0x3e000c){logger[_0x162f('0xa')](_0x162f('0xb'),_0x4a91b6,'request\x20sent');logger[_0x162f('0xc')](_0x162f('0xd'),_0x4a91b6,_0x162f('0xe'),JSON[_0x162f('0xf')](_0x3e000c));if(_0x3e000c['error']){if(_0x3e000c[_0x162f('0x10')][_0x162f('0x11')]===0x1f4){logger[_0x162f('0x10')](_0x162f('0xb'),_0x4a91b6,_0x3e000c[_0x162f('0x10')][_0x162f('0x12')]);return _0x166d09(_0x3e000c[_0x162f('0x10')][_0x162f('0x12')]);}logger[_0x162f('0x10')](_0x162f('0xb'),_0x4a91b6,_0x3e000c[_0x162f('0x10')][_0x162f('0x12')]);return _0x10a580(_0x3e000c[_0x162f('0x10')][_0x162f('0x12')]);}else{logger[_0x162f('0xa')](_0x162f('0xb'),_0x4a91b6,_0x162f('0xe'));_0x10a580(_0x3e000c['result'][_0x162f('0x12')]);}})[_0x162f('0x13')](function(_0x2f8c2e){logger[_0x162f('0x10')](_0x162f('0xb'),_0x4a91b6,_0x2f8c2e);_0x166d09(_0x2f8c2e);});});}exports['GetTrunk']=function(_0x3cc36e){var _0x339e=this;return new Promise(function(_0x1b5bcb,_0x8c146c){return db[_0x162f('0x14')][_0x162f('0x15')]({'raw':_0x3cc36e[_0x162f('0x16')]?_0x3cc36e[_0x162f('0x16')][_0x162f('0x17')]===undefined?!![]:![]:!![],'where':_0x3cc36e[_0x162f('0x16')]?_0x3cc36e['options'][_0x162f('0x18')]||null:null,'attributes':_0x3cc36e[_0x162f('0x16')]?_0x3cc36e[_0x162f('0x16')]['attributes']||null:null,'limit':_0x3cc36e[_0x162f('0x16')]?_0x3cc36e['options'][_0x162f('0x19')]||null:null,'include':_0x3cc36e[_0x162f('0x16')]?_0x3cc36e[_0x162f('0x16')][_0x162f('0x1a')]?_[_0x162f('0x1b')](_0x3cc36e['options'][_0x162f('0x1a')],function(_0x2fa049){return{'model':db[_0x2fa049[_0x162f('0x1c')]],'as':_0x2fa049['as'],'attributes':_0x2fa049['attributes'],'include':_0x2fa049['include']?_[_0x162f('0x1b')](_0x2fa049[_0x162f('0x1a')],function(_0x28accb){return{'model':db[_0x28accb[_0x162f('0x1c')]],'as':_0x28accb['as'],'attributes':_0x28accb['attributes'],'include':_0x28accb[_0x162f('0x1a')]?_[_0x162f('0x1b')](_0x28accb[_0x162f('0x1a')],function(_0x10417c){return{'model':db[_0x10417c[_0x162f('0x1c')]],'as':_0x10417c['as'],'attributes':_0x10417c[_0x162f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cccc9){logger[_0x162f('0xa')](_0x162f('0x1e'),_0x3cc36e);logger[_0x162f('0xc')](_0x162f('0x1e'),_0x3cc36e,JSON['stringify'](_0x5cccc9));_0x1b5bcb(_0x5cccc9);})['catch'](function(_0x20bf1c){logger[_0x162f('0x10')](_0x162f('0x1e'),_0x20bf1c[_0x162f('0x12')],_0x3cc36e);_0x8c146c(_0x339e['error'](0x1f4,_0x20bf1c['message']));});});};exports[_0x162f('0x1f')]=function(_0x11a62a){var _0x33eebf=this;return new Promise(function(_0x340d77,_0xb75919){return db[_0x162f('0x14')]['find']({'raw':_0x11a62a[_0x162f('0x16')]?_0x11a62a[_0x162f('0x16')][_0x162f('0x17')]===undefined?!![]:![]:!![],'where':_0x11a62a[_0x162f('0x16')]?_0x11a62a[_0x162f('0x16')][_0x162f('0x18')]||null:null,'attributes':_0x11a62a['options']?_0x11a62a['options'][_0x162f('0x1d')]||null:null,'include':_0x11a62a[_0x162f('0x16')]?_0x11a62a[_0x162f('0x16')][_0x162f('0x1a')]?_[_0x162f('0x1b')](_0x11a62a[_0x162f('0x16')]['include'],function(_0x1b607a){return{'model':db[_0x1b607a[_0x162f('0x1c')]],'as':_0x1b607a['as'],'attributes':_0x1b607a['attributes'],'include':_0x1b607a[_0x162f('0x1a')]?_[_0x162f('0x1b')](_0x1b607a[_0x162f('0x1a')],function(_0x376744){return{'model':db[_0x376744[_0x162f('0x1c')]],'as':_0x376744['as'],'attributes':_0x376744[_0x162f('0x1d')],'include':_0x376744[_0x162f('0x1a')]?_[_0x162f('0x1b')](_0x376744[_0x162f('0x1a')],function(_0x3447b4){return{'model':db[_0x3447b4[_0x162f('0x1c')]],'as':_0x3447b4['as'],'attributes':_0x3447b4[_0x162f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x162f('0x20')](function(_0x451fe2){logger[_0x162f('0xa')](_0x162f('0x1f'),_0x11a62a);logger[_0x162f('0xc')](_0x162f('0x1f'),_0x11a62a,JSON['stringify'](_0x451fe2));_0x340d77(_0x451fe2);})[_0x162f('0x13')](function(_0x12cf85){logger[_0x162f('0x10')](_0x162f('0x1f'),_0x12cf85[_0x162f('0x12')],_0x11a62a);_0xb75919(_0x33eebf[_0x162f('0x10')](0x1f4,_0x12cf85[_0x162f('0x12')]));});});}; \ No newline at end of file +var _0x88c9=['attributes','limit','map','model','include','then','ShowTrunk','find','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where'];(function(_0x238600,_0x45aed1){var _0x45e5a8=function(_0x27ed0d){while(--_0x27ed0d){_0x238600['push'](_0x238600['shift']());}};_0x45e5a8(++_0x45aed1);}(_0x88c9,0x6e));var _0x988c=function(_0x560491,_0x1584f6){_0x560491=_0x560491-0x0;var _0x209a11=_0x88c9[_0x560491];return _0x209a11;};'use strict';var _=require(_0x988c('0x0'));var util=require(_0x988c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x988c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x988c('0x3'));var logger=require('../../config/logger')(_0x988c('0x4'));var config=require(_0x988c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x988c('0x6')][_0x988c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48dff3,_0x29859c,_0x2d6813){return new BPromise(function(_0x1d7d5e,_0x4da7fe){return client[_0x988c('0x8')](_0x48dff3,_0x2d6813)['then'](function(_0x57ba55){logger['info'](_0x988c('0x9'),_0x29859c,_0x988c('0xa'));logger[_0x988c('0xb')](_0x988c('0xc'),_0x29859c,'request\x20sent',JSON[_0x988c('0xd')](_0x57ba55));if(_0x57ba55['error']){if(_0x57ba55[_0x988c('0xe')][_0x988c('0xf')]===0x1f4){logger[_0x988c('0xe')](_0x988c('0x9'),_0x29859c,_0x57ba55[_0x988c('0xe')][_0x988c('0x10')]);return _0x4da7fe(_0x57ba55[_0x988c('0xe')]['message']);}logger['error'](_0x988c('0x9'),_0x29859c,_0x57ba55[_0x988c('0xe')]['message']);return _0x1d7d5e(_0x57ba55[_0x988c('0xe')][_0x988c('0x10')]);}else{logger[_0x988c('0x11')]('Trunk,\x20%s,\x20%s',_0x29859c,'request\x20sent');_0x1d7d5e(_0x57ba55[_0x988c('0x12')]['message']);}})[_0x988c('0x13')](function(_0x19a396){logger['error']('Trunk,\x20%s,\x20%s',_0x29859c,_0x19a396);_0x4da7fe(_0x19a396);});});}exports[_0x988c('0x14')]=function(_0x1d491a){var _0x31057d=this;return new Promise(function(_0x5b4a79,_0x5b1cdc){return db[_0x988c('0x15')][_0x988c('0x16')]({'raw':_0x1d491a[_0x988c('0x17')]?_0x1d491a[_0x988c('0x17')][_0x988c('0x18')]===undefined?!![]:![]:!![],'where':_0x1d491a[_0x988c('0x17')]?_0x1d491a[_0x988c('0x17')][_0x988c('0x19')]||null:null,'attributes':_0x1d491a[_0x988c('0x17')]?_0x1d491a['options'][_0x988c('0x1a')]||null:null,'limit':_0x1d491a[_0x988c('0x17')]?_0x1d491a[_0x988c('0x17')][_0x988c('0x1b')]||null:null,'include':_0x1d491a[_0x988c('0x17')]?_0x1d491a[_0x988c('0x17')]['include']?_[_0x988c('0x1c')](_0x1d491a[_0x988c('0x17')]['include'],function(_0x56e16c){return{'model':db[_0x56e16c[_0x988c('0x1d')]],'as':_0x56e16c['as'],'attributes':_0x56e16c[_0x988c('0x1a')],'include':_0x56e16c[_0x988c('0x1e')]?_[_0x988c('0x1c')](_0x56e16c[_0x988c('0x1e')],function(_0x4faedc){return{'model':db[_0x4faedc['model']],'as':_0x4faedc['as'],'attributes':_0x4faedc['attributes'],'include':_0x4faedc[_0x988c('0x1e')]?_[_0x988c('0x1c')](_0x4faedc['include'],function(_0x20abc7){return{'model':db[_0x20abc7['model']],'as':_0x20abc7['as'],'attributes':_0x20abc7['attributes']};}):[]};}):[]};}):[]:[]})[_0x988c('0x1f')](function(_0x5b91e4){logger[_0x988c('0x11')]('GetTrunk',_0x1d491a);logger['debug'](_0x988c('0x14'),_0x1d491a,JSON[_0x988c('0xd')](_0x5b91e4));_0x5b4a79(_0x5b91e4);})[_0x988c('0x13')](function(_0x54646e){logger[_0x988c('0xe')](_0x988c('0x14'),_0x54646e[_0x988c('0x10')],_0x1d491a);_0x5b1cdc(_0x31057d[_0x988c('0xe')](0x1f4,_0x54646e[_0x988c('0x10')]));});});};exports[_0x988c('0x20')]=function(_0x3997cb){var _0x47eb0d=this;return new Promise(function(_0xb7d692,_0x5b5d48){return db['Trunk'][_0x988c('0x21')]({'raw':_0x3997cb[_0x988c('0x17')]?_0x3997cb[_0x988c('0x17')][_0x988c('0x18')]===undefined?!![]:![]:!![],'where':_0x3997cb[_0x988c('0x17')]?_0x3997cb[_0x988c('0x17')][_0x988c('0x19')]||null:null,'attributes':_0x3997cb[_0x988c('0x17')]?_0x3997cb['options']['attributes']||null:null,'include':_0x3997cb[_0x988c('0x17')]?_0x3997cb[_0x988c('0x17')]['include']?_['map'](_0x3997cb['options'][_0x988c('0x1e')],function(_0x9be429){return{'model':db[_0x9be429[_0x988c('0x1d')]],'as':_0x9be429['as'],'attributes':_0x9be429['attributes'],'include':_0x9be429['include']?_['map'](_0x9be429[_0x988c('0x1e')],function(_0x1bd189){return{'model':db[_0x1bd189[_0x988c('0x1d')]],'as':_0x1bd189['as'],'attributes':_0x1bd189[_0x988c('0x1a')],'include':_0x1bd189[_0x988c('0x1e')]?_[_0x988c('0x1c')](_0x1bd189[_0x988c('0x1e')],function(_0x2b9ccc){return{'model':db[_0x2b9ccc[_0x988c('0x1d')]],'as':_0x2b9ccc['as'],'attributes':_0x2b9ccc['attributes']};}):[]};}):[]};}):[]:[]})[_0x988c('0x1f')](function(_0xe9e6e8){logger[_0x988c('0x11')](_0x988c('0x20'),_0x3997cb);logger[_0x988c('0xb')](_0x988c('0x20'),_0x3997cb,JSON['stringify'](_0xe9e6e8));_0xb7d692(_0xe9e6e8);})[_0x988c('0x13')](function(_0x472a52){logger[_0x988c('0xe')](_0x988c('0x20'),_0x472a52[_0x988c('0x10')],_0x3997cb);_0x5b5d48(_0x47eb0d['error'](0x1f4,_0x472a52[_0x988c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 5cbe960..6617986 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9219=['isAuthenticated','update','exports','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x9219,0xe3));var _0x9921=function(_0x390b0c,_0x18c911){_0x390b0c=_0x390b0c-0x0;var _0x2e48d6=_0x9219[_0x390b0c];return _0x2e48d6;};'use strict';var express=require(_0x9921('0x0'));var router=express[_0x9921('0x1')]();var auth=require(_0x9921('0x2'));var controller=require(_0x9921('0x3'));router[_0x9921('0x4')]('/:id',auth[_0x9921('0x5')](),controller[_0x9921('0x6')]);module[_0x9921('0x7')]=router; \ No newline at end of file +var _0x0016=['exports','express','Router','../../components/auth/service','put','isAuthenticated'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0x0016,0x151));var _0x6001=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0x0016[_0x2d3ab3];return _0x321f9e;};'use strict';var express=require(_0x6001('0x0'));var router=express[_0x6001('0x1')]();var auth=require(_0x6001('0x2'));var controller=require('./user-setting.controller');router[_0x6001('0x3')]('/:id',auth[_0x6001('0x4')](),controller['update']);module[_0x6001('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 7751668..ad1a433 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb003=['UserId','sequelize','error','info','debug','ENUM','DATE','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb003,0x1e1));var _0x3b00=function(_0x222472,_0x33ea87){_0x222472=_0x222472-0x0;var _0x5d601f=_0xb003[_0x222472];return _0x5d601f;};'use strict';var Sequelize=require(_0x3b00('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x3b00('0x1'),'warning',_0x3b00('0x2'),_0x3b00('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x3b00('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x3b00('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x3b00('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x3b00('0x6')],'unique':_0x3b00('0x7')}}; \ No newline at end of file +var _0xe5a5=['info','debug','exports','ENUM','BOOLEAN','sequelize','warning'];(function(_0x2e2219,_0x490ba9){var _0x1f5937=function(_0x339b6e){while(--_0x339b6e){_0x2e2219['push'](_0x2e2219['shift']());}};_0x1f5937(++_0x490ba9);}(_0xe5a5,0x91));var _0x5e5a=function(_0x21bcd6,_0x31ef4f){_0x21bcd6=_0x21bcd6-0x0;var _0x5077d5=_0xe5a5[_0x21bcd6];return _0x5077d5;};'use strict';var Sequelize=require(_0x5e5a('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x5e5a('0x1'),_0x5e5a('0x2'),_0x5e5a('0x3')];module[_0x5e5a('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5e5a('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5e5a('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index bfb09ab..8407f70 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd737=['catch','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','register','redis','localhost','status','json','then','stack','name','send','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd737,0x85));var _0x7d73=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0xd737[_0x56138f];return _0x1acaf7;};'use strict';var _=require(_0x7d73('0x0'));var Redis=require('ioredis');var logger=require(_0x7d73('0x1'))('api');var config=require(_0x7d73('0x2'));var db=require(_0x7d73('0x3'))['db'];var socket=require(_0x7d73('0x4'))(new Redis(config['redis']));require('./user-setting.socket')[_0x7d73('0x5')](socket);config['redis']=_['defaults'](config[_0x7d73('0x6')],{'host':_0x7d73('0x7'),'port':0x18eb});function respondWithResult(_0x70a9f1,_0x1bd2f4){_0x1bd2f4=_0x1bd2f4||0xc8;return function(_0x10dec9){if(_0x10dec9){return _0x70a9f1[_0x7d73('0x8')](_0x1bd2f4)[_0x7d73('0x9')](_0x10dec9);}};}function saveUpdates(_0x179cc4){return function(_0x491347){if(_0x491347){return _0x491347['update'](_0x179cc4)[_0x7d73('0xa')](function(_0x3252fc){return _0x3252fc;});}return null;};}function handleEntityNotFound(_0x5c6f19){return function(_0x1c1d21){if(!_0x1c1d21){_0x5c6f19['sendStatus'](0x194);}return _0x1c1d21;};}function handleError(_0x34704b,_0x3e2d6e){_0x3e2d6e=_0x3e2d6e||0x1f4;return function(_0x2c65ba){logger['error'](_0x2c65ba[_0x7d73('0xb')]);if(_0x2c65ba[_0x7d73('0xc')]){delete _0x2c65ba['name'];}_0x34704b[_0x7d73('0x8')](_0x3e2d6e)[_0x7d73('0xd')](_0x2c65ba);};}exports[_0x7d73('0xe')]=function(_0x41c05a,_0x492a18){if(_0x41c05a[_0x7d73('0xf')]['role']!=='admin')throw new Error(_0x7d73('0x10'));if(isNaN(Number(_0x41c05a[_0x7d73('0x11')]['id'])))throw new Error(_0x7d73('0x12'));return db['UserSetting'][_0x7d73('0x13')]({'where':{'id':_0x41c05a[_0x7d73('0x11')]['id']}})[_0x7d73('0xa')](handleEntityNotFound(_0x492a18,null))[_0x7d73('0xa')](saveUpdates(_0x41c05a[_0x7d73('0x14')],null))[_0x7d73('0xa')](respondWithResult(_0x492a18,null))[_0x7d73('0x15')](handleError(_0x492a18,null));}; \ No newline at end of file +var _0xff98=['Invalid\x20user\x20setting\x20id','UserSetting','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','./user-setting.socket','redis','localhost','status','json','update','then','sendStatus','stack','name','send','user','role','admin','params'];(function(_0x2aeaf1,_0x2ad65c){var _0x1eb11b=function(_0x221138){while(--_0x221138){_0x2aeaf1['push'](_0x2aeaf1['shift']());}};_0x1eb11b(++_0x2ad65c);}(_0xff98,0x9c));var _0x8ff9=function(_0x312e57,_0x4e9453){_0x312e57=_0x312e57-0x0;var _0x44f949=_0xff98[_0x312e57];return _0x44f949;};'use strict';var _=require('lodash');var Redis=require(_0x8ff9('0x0'));var logger=require(_0x8ff9('0x1'))(_0x8ff9('0x2'));var config=require(_0x8ff9('0x3'));var db=require('../../mysqldb')['db'];var socket=require(_0x8ff9('0x4'))(new Redis(config['redis']));require(_0x8ff9('0x5'))['register'](socket);config[_0x8ff9('0x6')]=_['defaults'](config[_0x8ff9('0x6')],{'host':_0x8ff9('0x7'),'port':0x18eb});function respondWithResult(_0x4122b2,_0x3e6002){_0x3e6002=_0x3e6002||0xc8;return function(_0x280acf){if(_0x280acf){return _0x4122b2[_0x8ff9('0x8')](_0x3e6002)[_0x8ff9('0x9')](_0x280acf);}};}function saveUpdates(_0x22c681){return function(_0x58b8aa){if(_0x58b8aa){return _0x58b8aa[_0x8ff9('0xa')](_0x22c681)[_0x8ff9('0xb')](function(_0x1bab3d){return _0x1bab3d;});}return null;};}function handleEntityNotFound(_0x725644){return function(_0xee279a){if(!_0xee279a){_0x725644[_0x8ff9('0xc')](0x194);}return _0xee279a;};}function handleError(_0x177f72,_0x5164c8){_0x5164c8=_0x5164c8||0x1f4;return function(_0x593faa){logger['error'](_0x593faa[_0x8ff9('0xd')]);if(_0x593faa[_0x8ff9('0xe')]){delete _0x593faa[_0x8ff9('0xe')];}_0x177f72['status'](_0x5164c8)[_0x8ff9('0xf')](_0x593faa);};}exports[_0x8ff9('0xa')]=function(_0x24798a,_0x2e2a89){if(_0x24798a[_0x8ff9('0x10')][_0x8ff9('0x11')]!==_0x8ff9('0x12'))throw new Error('Unauthorized');if(isNaN(Number(_0x24798a[_0x8ff9('0x13')]['id'])))throw new Error(_0x8ff9('0x14'));return db[_0x8ff9('0x15')]['find']({'where':{'id':_0x24798a[_0x8ff9('0x13')]['id']}})['then'](handleEntityNotFound(_0x2e2a89,null))[_0x8ff9('0xb')](saveUpdates(_0x24798a['body'],null))['then'](respondWithResult(_0x2e2a89,null))['catch'](handleError(_0x2e2a89,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 685d51e..8b88e26 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe7e1=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','remove'];(function(_0x318cc9,_0x2f26f4){var _0x1a376d=function(_0x38cd16){while(--_0x38cd16){_0x318cc9['push'](_0x318cc9['shift']());}};_0x1a376d(++_0x2f26f4);}(_0xe7e1,0x175));var _0x1e7e=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xe7e1[_0x9fd887];return _0x1a54ab;};'use strict';var EventEmitter=require(_0x1e7e('0x0'));var UserSetting=require(_0x1e7e('0x1'))['db'][_0x1e7e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1e7e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1e7e('0x4')};function emitEvent(_0x4e579f){return function(_0x48f33c,_0x12fb51,_0x2acb40){UserSettingEvents['emit'](_0x4e579f+':'+_0x48f33c['id'],_0x48f33c);UserSettingEvents[_0x1e7e('0x5')](_0x4e579f,_0x48f33c);_0x2acb40(null);};}for(var e in events){if(events[_0x1e7e('0x6')](e)){var event=events[e];UserSetting[_0x1e7e('0x7')](e,emitEvent(event));}}module[_0x1e7e('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x2066=['../../mysqldb','UserSetting','setMaxListeners','emit','hasOwnProperty','hook','events'];(function(_0x2700ae,_0x2a27c9){var _0x30b54c=function(_0x225cd8){while(--_0x225cd8){_0x2700ae['push'](_0x2700ae['shift']());}};_0x30b54c(++_0x2a27c9);}(_0x2066,0x1b1));var _0x6206=function(_0x4252a0,_0x269d8c){_0x4252a0=_0x4252a0-0x0;var _0x26a492=_0x2066[_0x4252a0];return _0x26a492;};'use strict';var EventEmitter=require(_0x6206('0x0'));var UserSetting=require(_0x6206('0x1'))['db'][_0x6206('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x6206('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x169693){return function(_0x3c24c5,_0x3651d4,_0x28b861){UserSettingEvents[_0x6206('0x4')](_0x169693+':'+_0x3c24c5['id'],_0x3c24c5);UserSettingEvents[_0x6206('0x4')](_0x169693,_0x3c24c5);_0x28b861(null);};}for(var e in events){if(events[_0x6206('0x5')](e)){var event=events[e];UserSetting[_0x6206('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 53e7f6f..f1012c6 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x94d2=['clientSideLoggingEnabledSince','define','UserSetting','user_settings'];(function(_0x16d411,_0x5e0970){var _0x20336d=function(_0x15d8aa){while(--_0x15d8aa){_0x16d411['push'](_0x16d411['shift']());}};_0x20336d(++_0x5e0970);}(_0x94d2,0x1cd));var _0x294d=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x94d2[_0x413aac];return _0x569b11;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x30eae3){return _0x30eae3[_0x294d('0x0')](_0x294d('0x1'),attributes,{'tableName':_0x294d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33a820){if(!_0x33a820['clientSideLoggingEnabled'])_0x33a820['clientSideLoggingEnabledSince']=null;else if(_0x33a820[_0x294d('0x3')]===null)_0x33a820[_0x294d('0x3')]=new Date();}}});}; \ No newline at end of file +var _0xae2b=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define'];(function(_0x550d2f,_0x367bea){var _0x28e111=function(_0x2e47eb){while(--_0x2e47eb){_0x550d2f['push'](_0x550d2f['shift']());}};_0x28e111(++_0x367bea);}(_0xae2b,0xb3));var _0xbae2=function(_0x1a06a2,_0x293c52){_0x1a06a2=_0x1a06a2-0x0;var _0xb4a6ed=_0xae2b[_0x1a06a2];return _0xb4a6ed;};'use strict';var attributes=require(_0xbae2('0x0'));module[_0xbae2('0x1')]=function(_0x55ac17){return _0x55ac17[_0xbae2('0x2')](_0xbae2('0x3'),attributes,{'tableName':_0xbae2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x214f0e){if(!_0x214f0e[_0xbae2('0x5')])_0x214f0e[_0xbae2('0x6')]=null;else if(_0x214f0e['clientSideLoggingEnabledSince']===null)_0x214f0e[_0xbae2('0x6')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 47ebeae..9bb976f 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb2ab=['length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update','UserId','register'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xb2ab,0x8e));var _0xbb2a=function(_0x2eb30d,_0x53e5bf){_0x2eb30d=_0x2eb30d-0x0;var _0x189c50=_0xb2ab[_0x2eb30d];return _0x189c50;};'use strict';var UserSettingEvents=require(_0xbb2a('0x0'));var events=[_0xbb2a('0x1'),_0xbb2a('0x2'),_0xbb2a('0x3')];function createListener(_0x3f9695,_0x562a94){return function(_0x49a80b){_0x562a94[_0xbb2a('0x4')](_0x3f9695,_0x49a80b);if(_0x3f9695===_0xbb2a('0x5')){_0x562a94[_0xbb2a('0x4')]('user-setting:update:user-'+_0x49a80b[_0xbb2a('0x6')],_0x49a80b);}};}exports[_0xbb2a('0x7')]=function(_0xe36de9){for(var _0x3b263e=0x0,_0x2aa88b=events[_0xbb2a('0x8')];_0x3b263e<_0x2aa88b;_0x3b263e++){var _0x241f8c=events[_0x3b263e];var _0x52b4ac=createListener(_0xbb2a('0x9')+_0x241f8c,_0xe36de9);UserSettingEvents['on'](_0x241f8c,_0x52b4ac);}}; \ No newline at end of file +var _0x6141=['./user-setting.events','save','remove','emit','user-setting:update:user-','UserId','register','length'];(function(_0x1f9e2d,_0x5f194f){var _0x3d76be=function(_0x40e8fb){while(--_0x40e8fb){_0x1f9e2d['push'](_0x1f9e2d['shift']());}};_0x3d76be(++_0x5f194f);}(_0x6141,0x1a8));var _0x1614=function(_0x514078,_0x13b0c6){_0x514078=_0x514078-0x0;var _0x40cffd=_0x6141[_0x514078];return _0x40cffd;};'use strict';var UserSettingEvents=require(_0x1614('0x0'));var events=[_0x1614('0x1'),_0x1614('0x2'),'update'];function createListener(_0x3af033,_0x125068){return function(_0x25dc37){_0x125068[_0x1614('0x3')](_0x3af033,_0x25dc37);if(_0x3af033==='user-setting:update'){_0x125068['emit'](_0x1614('0x4')+_0x25dc37[_0x1614('0x5')],_0x25dc37);}};}exports[_0x1614('0x6')]=function(_0x2ccc1b){for(var _0x197292=0x0,_0x21517e=events[_0x1614('0x7')];_0x197292<_0x21517e;_0x197292++){var _0x49c7fc=events[_0x197292];var _0x5f4955=createListener('user-setting:'+_0x49c7fc,_0x2ccc1b);UserSettingEvents['on'](_0x49c7fc,_0x5f4955);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d9cd13f..db11032 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 _0xed7a=['server/files/images/','%s-%s','now','originalname','/:id/avatar','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','/:id/api_key','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','index','isAuthenticated','/whoami','whoami','/presence','/:id','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','getAgents','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root'];(function(_0x128ca2,_0x338033){var _0x565ef5=function(_0x4f970b){while(--_0x4f970b){_0x128ca2['push'](_0x128ca2['shift']());}};_0x565ef5(++_0x338033);}(_0xed7a,0x9f));var _0xaed7=function(_0x37a97e,_0x54f926){_0x37a97e=_0x37a97e-0x0;var _0x406099=_0xed7a[_0x37a97e];return _0x406099;};'use strict';var multer=require(_0xaed7('0x0'));var util=require(_0xaed7('0x1'));var path=require('path');var timeout=require(_0xaed7('0x2'));var express=require(_0xaed7('0x3'));var router=express[_0xaed7('0x4')]();var fs_extra=require(_0xaed7('0x5'));var auth=require(_0xaed7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaed7('0x7'));var controller=require(_0xaed7('0x8'));router[_0xaed7('0x9')]('/',auth['isAuthenticated'](),controller[_0xaed7('0xa')]);router[_0xaed7('0x9')]('/describe',auth[_0xaed7('0xb')](),controller['describe']);router['get'](_0xaed7('0xc'),auth[_0xaed7('0xb')](),controller[_0xaed7('0xd')]);router[_0xaed7('0x9')](_0xaed7('0xe'),auth[_0xaed7('0xb')](),controller['getPresence']);router[_0xaed7('0x9')](_0xaed7('0xf'),auth[_0xaed7('0xb')](),controller['show']);router[_0xaed7('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xaed7('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0xaed7('0x10')]);router[_0xaed7('0x9')](_0xaed7('0x11'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x12')]);router[_0xaed7('0x9')]('/:id/queues',auth[_0xaed7('0xb')](),controller[_0xaed7('0x13')]);router[_0xaed7('0x9')]('/:id/queues_rt',auth[_0xaed7('0xb')](),controller[_0xaed7('0x14')]);router[_0xaed7('0x9')](_0xaed7('0x15'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x16')]);router['get'](_0xaed7('0x17'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x18')]);router[_0xaed7('0x9')](_0xaed7('0x19'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x1a')]);router[_0xaed7('0x9')](_0xaed7('0x1b'),auth[_0xaed7('0xb')](),controller['getChatInteractions']);router[_0xaed7('0x9')](_0xaed7('0x1c'),auth[_0xaed7('0xb')](),controller['getOpenchannelInteractions']);router[_0xaed7('0x9')](_0xaed7('0x1d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x1e')]);router[_0xaed7('0x9')](_0xaed7('0x1f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x20')]);router[_0xaed7('0x9')](_0xaed7('0x21'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x22')]);router[_0xaed7('0x9')](_0xaed7('0x23'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x24')]);router[_0xaed7('0x9')](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller['getTeams']);router['get']('/:id/lists',auth[_0xaed7('0xb')](),controller[_0xaed7('0x26')]);router[_0xaed7('0x9')]('/:id/agents',auth[_0xaed7('0xb')](),controller[_0xaed7('0x27')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xaed7('0x9')]('/:id/fax_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x28')]);router[_0xaed7('0x9')](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller['getMailAccounts']);router['get'](_0xaed7('0x2a'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x2b')]);router[_0xaed7('0x9')]('/:id/sms_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x2c')]);router[_0xaed7('0x9')](_0xaed7('0x2d'),auth['isAuthenticated'](),controller[_0xaed7('0x2e')]);router[_0xaed7('0x9')](_0xaed7('0x2f'),auth[_0xaed7('0xb')](),controller['getWhatsappAccounts']);router['get'](_0xaed7('0x30'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x31')]);router[_0xaed7('0x9')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xaed7('0x32')]);router['post'](_0xaed7('0x11'),auth[_0xaed7('0xb')](),controller['addContacts']);router['post']('/',auth[_0xaed7('0xb')](),controller['create']);router[_0xaed7('0x33')](_0xaed7('0x34'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x35')]);router[_0xaed7('0x33')](_0xaed7('0x36'),auth['isAuthenticated'](),controller[_0xaed7('0x37')]);var upload=multer({'storage':multer[_0xaed7('0x38')]({'destination':function(_0x4ab955,_0x18b874,_0xb5fc52){_0xb5fc52(null,path[_0xaed7('0x39')](config[_0xaed7('0x3a')],_0xaed7('0x3b')));},'filename':function(_0x3e2060,_0x2f02e0,_0x592a80){_0x592a80(null,util['format'](_0xaed7('0x3c'),Date[_0xaed7('0x3d')](),_0x2f02e0[_0xaed7('0x3e')]));}})});router[_0xaed7('0x33')](_0xaed7('0x3f'),upload['single'](_0xaed7('0x40')),controller['addAvatar']);router['post']('/:id/login',auth[_0xaed7('0xb')](),controller[_0xaed7('0x41')]);router['post'](_0xaed7('0x42'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x43')]);router[_0xaed7('0x33')](_0xaed7('0x44'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x45')]);router[_0xaed7('0x33')](_0xaed7('0x46'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x47')]);router['post'](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x48')]);router['post'](_0xaed7('0x49'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4a')]);router[_0xaed7('0x33')](_0xaed7('0x4b'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4c')]);router[_0xaed7('0x33')](_0xaed7('0x4d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4e')]);router[_0xaed7('0x33')](_0xaed7('0x4f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x50')]);router[_0xaed7('0x33')](_0xaed7('0x51'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x52')]);router[_0xaed7('0x33')](_0xaed7('0x53'),auth[_0xaed7('0xb')](),controller['addWhatsappInteractions']);router['post'](_0xaed7('0x54'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xaed7('0x33')](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x55')]);router[_0xaed7('0x33')]('/:id/openchannel_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x56')]);router[_0xaed7('0x33')]('/:id/sms_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x57')]);router[_0xaed7('0x33')](_0xaed7('0x2d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x58')]);router[_0xaed7('0x33')](_0xaed7('0x2f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x59')]);router[_0xaed7('0x33')]('/:id/api_key',auth[_0xaed7('0xb')](),controller[_0xaed7('0x5a')]);router[_0xaed7('0x5b')]('/:id',auth['isAuthenticated'](),controller[_0xaed7('0x5c')]);router[_0xaed7('0x5b')](_0xaed7('0x5d'),auth[_0xaed7('0xb')](),controller['changePassword']);router[_0xaed7('0x5e')](_0xaed7('0x36'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x5f')]);router[_0xaed7('0x5e')](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x60')]);router[_0xaed7('0x5e')](_0xaed7('0xf'),auth[_0xaed7('0xb')](),controller['destroy']);router[_0xaed7('0x5e')]('/:id/chat_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x61')]);router['delete']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xaed7('0x62')]);router[_0xaed7('0x5e')]('/:id/fax_interactions',auth[_0xaed7('0xb')](),controller['removeFaxInteractions']);router[_0xaed7('0x5e')]('/:id/sms_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x63')]);router['delete'](_0xaed7('0x51'),auth['isAuthenticated'](),controller[_0xaed7('0x64')]);router[_0xaed7('0x5e')]('/:id/whatsapp_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x65')]);router[_0xaed7('0x5e')](_0xaed7('0x54'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x66')]);router['delete'](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x67')]);router['delete'](_0xaed7('0x2a'),auth['isAuthenticated'](),controller[_0xaed7('0x68')]);router[_0xaed7('0x5e')](_0xaed7('0x69'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x6a')]);router[_0xaed7('0x5e')](_0xaed7('0x2d'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xaed7('0x5e')]('/:id/whatsapp_accounts',auth[_0xaed7('0xb')](),controller['removeWhatsappAccounts']);router[_0xaed7('0x5e')](_0xaed7('0x6b'),auth[_0xaed7('0xb')](),controller['removeApiKey']);module[_0xaed7('0x6c')]=router; \ No newline at end of file +var _0x6bc9=['removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','/describe','describe','get','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','createApiKey','put','update','delete','removeTeams','destroy','removeChatInteractions'];(function(_0x2b0935,_0x47b187){var _0x3bf7b7=function(_0x548243){while(--_0x548243){_0x2b0935['push'](_0x2b0935['shift']());}};_0x3bf7b7(++_0x47b187);}(_0x6bc9,0x1c2));var _0x96bc=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x6bc9[_0x2aee2f];return _0x19337f;};'use strict';var multer=require(_0x96bc('0x0'));var util=require(_0x96bc('0x1'));var path=require('path');var timeout=require(_0x96bc('0x2'));var express=require(_0x96bc('0x3'));var router=express[_0x96bc('0x4')]();var fs_extra=require(_0x96bc('0x5'));var auth=require(_0x96bc('0x6'));var interaction=require(_0x96bc('0x7'));var config=require(_0x96bc('0x8'));var controller=require(_0x96bc('0x9'));router['get']('/',auth[_0x96bc('0xa')](),controller['index']);router['get'](_0x96bc('0xb'),auth['isAuthenticated'](),controller[_0x96bc('0xc')]);router[_0x96bc('0xd')](_0x96bc('0xe'),auth['isAuthenticated'](),controller[_0x96bc('0xf')]);router[_0x96bc('0xd')]('/presence',auth[_0x96bc('0xa')](),controller[_0x96bc('0x10')]);router[_0x96bc('0xd')](_0x96bc('0x11'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x12')]);router[_0x96bc('0xd')](_0x96bc('0x13'),controller[_0x96bc('0x14')]);router['get'](_0x96bc('0x15'),auth['isAuthenticated'](),controller[_0x96bc('0x16')]);router[_0x96bc('0xd')](_0x96bc('0x17'),auth['isAuthenticated'](),controller[_0x96bc('0x18')]);router['get'](_0x96bc('0x19'),auth[_0x96bc('0xa')](),controller['getQueues']);router['get'](_0x96bc('0x1a'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x1b')]);router[_0x96bc('0xd')]('/:id/groups',auth[_0x96bc('0xa')](),controller[_0x96bc('0x1c')]);router[_0x96bc('0xd')](_0x96bc('0x1d'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x1e')]);router[_0x96bc('0xd')]('/:id/screen_recordings',auth[_0x96bc('0xa')](),controller[_0x96bc('0x1f')]);router['get']('/:id/chat/interactions',auth[_0x96bc('0xa')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0x96bc('0xa')](),controller['getOpenchannelInteractions']);router[_0x96bc('0xd')](_0x96bc('0x20'),auth['isAuthenticated'](),controller[_0x96bc('0x21')]);router[_0x96bc('0xd')](_0x96bc('0x22'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x23')]);router['get'](_0x96bc('0x24'),auth['isAuthenticated'](),controller[_0x96bc('0x25')]);router[_0x96bc('0xd')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get'](_0x96bc('0x26'),auth[_0x96bc('0xa')](),controller['getTeams']);router[_0x96bc('0xd')](_0x96bc('0x27'),auth[_0x96bc('0xa')](),controller['getLists']);router[_0x96bc('0xd')](_0x96bc('0x28'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x29')]);router[_0x96bc('0xd')]('/:id/prefixes',auth[_0x96bc('0xa')](),controller['getVoicePrefixes']);router[_0x96bc('0xd')](_0x96bc('0x2a'),auth['isAuthenticated'](),controller[_0x96bc('0x2b')]);router[_0x96bc('0xd')](_0x96bc('0x2c'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x2d')]);router['get'](_0x96bc('0x2e'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x2f')]);router[_0x96bc('0xd')]('/:id/sms_accounts',auth[_0x96bc('0xa')](),controller['getSmsAccounts']);router[_0x96bc('0xd')](_0x96bc('0x30'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x31')]);router[_0x96bc('0xd')](_0x96bc('0x32'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x33')]);router[_0x96bc('0xd')](_0x96bc('0x34'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x35')]);router[_0x96bc('0xd')](_0x96bc('0x36'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x37')]);router[_0x96bc('0x38')]('/:id/contacts',auth[_0x96bc('0xa')](),controller[_0x96bc('0x39')]);router[_0x96bc('0x38')]('/',auth[_0x96bc('0xa')](),controller[_0x96bc('0x3a')]);router[_0x96bc('0x38')](_0x96bc('0x3b'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x3c')]);router['post']('/:id/queues',auth[_0x96bc('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26d046,_0x206a7d,_0x4300f1){_0x4300f1(null,path[_0x96bc('0x3d')](config['root'],_0x96bc('0x3e')));},'filename':function(_0x17d6e5,_0x41d90a,_0x3fb9d3){_0x3fb9d3(null,util[_0x96bc('0x3f')](_0x96bc('0x40'),Date[_0x96bc('0x41')](),_0x41d90a[_0x96bc('0x42')]));}})});router[_0x96bc('0x38')](_0x96bc('0x13'),upload[_0x96bc('0x43')](_0x96bc('0x44')),controller[_0x96bc('0x45')]);router[_0x96bc('0x38')](_0x96bc('0x46'),auth['isAuthenticated'](),controller[_0x96bc('0x47')]);router[_0x96bc('0x38')](_0x96bc('0x48'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x49')]);router[_0x96bc('0x38')]('/:id/pause',auth[_0x96bc('0xa')](),controller['pause']);router[_0x96bc('0x38')](_0x96bc('0x4a'),auth[_0x96bc('0xa')](),controller['unpause']);router[_0x96bc('0x38')](_0x96bc('0x26'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x4b')]);router[_0x96bc('0x38')](_0x96bc('0x4c'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x4d')]);router[_0x96bc('0x38')](_0x96bc('0x4e'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x4f')]);router[_0x96bc('0x38')]('/:id/fax_interactions',auth[_0x96bc('0xa')](),controller[_0x96bc('0x50')]);router[_0x96bc('0x38')]('/:id/sms_interactions',auth[_0x96bc('0xa')](),controller[_0x96bc('0x51')]);router['post']('/:id/openchannel_interactions',auth[_0x96bc('0xa')](),controller['addOpenchannelInteractions']);router['post'](_0x96bc('0x52'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x53')]);router[_0x96bc('0x38')](_0x96bc('0x2a'),auth[_0x96bc('0xa')](),controller['addFaxAccounts']);router[_0x96bc('0x38')](_0x96bc('0x2c'),auth[_0x96bc('0xa')](),controller['addMailAccounts']);router[_0x96bc('0x38')](_0x96bc('0x2e'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x54')]);router[_0x96bc('0x38')](_0x96bc('0x55'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x56')]);router['post'](_0x96bc('0x30'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x57')]);router['post'](_0x96bc('0x32'),auth[_0x96bc('0xa')](),controller['addWhatsappAccounts']);router[_0x96bc('0x38')](_0x96bc('0x36'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x58')]);router[_0x96bc('0x59')]('/:id',auth[_0x96bc('0xa')](),controller[_0x96bc('0x5a')]);router[_0x96bc('0x59')]('/:id/password',auth[_0x96bc('0xa')](),controller['changePassword']);router[_0x96bc('0x5b')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x96bc('0x26'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x5c')]);router['delete'](_0x96bc('0x11'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x5d')]);router['delete']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x96bc('0x5e')]);router[_0x96bc('0x5b')]('/:id/mail_interactions',auth[_0x96bc('0xa')](),controller[_0x96bc('0x5f')]);router['delete']('/:id/fax_interactions',auth[_0x96bc('0xa')](),controller[_0x96bc('0x60')]);router[_0x96bc('0x5b')](_0x96bc('0x61'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x62')]);router[_0x96bc('0x5b')](_0x96bc('0x63'),auth['isAuthenticated'](),controller[_0x96bc('0x64')]);router[_0x96bc('0x5b')](_0x96bc('0x52'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x65')]);router[_0x96bc('0x5b')](_0x96bc('0x2a'),auth['isAuthenticated'](),controller[_0x96bc('0x66')]);router['delete'](_0x96bc('0x2c'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x67')]);router[_0x96bc('0x5b')](_0x96bc('0x2e'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x68')]);router['delete'](_0x96bc('0x55'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x69')]);router[_0x96bc('0x5b')]('/:id/chat_websites',auth[_0x96bc('0xa')](),controller[_0x96bc('0x6a')]);router[_0x96bc('0x5b')](_0x96bc('0x32'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x6b')]);router['delete'](_0x96bc('0x36'),auth[_0x96bc('0xa')](),controller[_0x96bc('0x6c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9b8abcc..2123afa 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 _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x52525d,_0x565354){var _0x4e2949=function(_0x1c4bf5){while(--_0x1c4bf5){_0x52525d['push'](_0x52525d['shift']());}};_0x4e2949(++_0x565354);}(_0x008c,0x188));var _0xc008=function(_0xaee9b2,_0x4f74cf){_0xaee9b2=_0xaee9b2-0x0;var _0x8c26c1=_0x008c[_0xaee9b2];return _0x8c26c1;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 05785b9..2651505 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 _0x83aa=['dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','flatten','lower','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','QueryTypes','SELECT','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','jayson/promise','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','status','offset','undefined','limit','count','set','Content-Range','json','update','then','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','Telephones','filter','ignore','map','value','includes','UserProfileResource','end','error','stack','name','User','rawAttributes','fieldName','type','key','previousPasswords','resetPasswordToken','md5secret','getOptions','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','mail','openchannel','whatsapp','all','catch','show','params','merge','options','sms','body','find','describe','addContacts','ids','omit','internal','Setting','securePassword','password','max','min_internal','isNil','sequelize','from','mailbox','permissions','102','113','110','104','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','isEmpty','autoAssociation','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','penalty','spread','capitalize','QueueId','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','removeQueues','remove','toLowerCase','Queues','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','fax','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','User\x20with\x20id\x20%s\x20not\x20found','CmList','List','Tag','Tags','color','tag','getQueues','model','keys','Queue','fields','order','sort','filters','pick','where','hasOwnProperty','getVoiceQueuesRt','intersection','nolimit','getRecordings','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','lastPauseAt','getTeams','Team','Body\x20parameter\x20\x27ids\x27\x20is\x20required','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','getLists','getAgents','getVoiceQueues','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','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','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contained','firstName','lastName','phone','CmContact','Contact'];(function(_0x5e743f,_0x3924f5){var _0x334a1f=function(_0x409502){while(--_0x409502){_0x5e743f['push'](_0x5e743f['shift']());}};_0x334a1f(++_0x3924f5);}(_0x83aa,0x1b3));var _0xa83a=function(_0x747391,_0x1244cd){_0x747391=_0x747391-0x0;var _0x5ea224=_0x83aa[_0x747391];return _0x5ea224;};'use strict';var moment=require(_0xa83a('0x0'));var util=require('util');var path=require(_0xa83a('0x1'));var fs=require('fs');var _=require(_0xa83a('0x2'));var squel=require(_0xa83a('0x3'));var jayson=require(_0xa83a('0x4'));var Redis=require(_0xa83a('0x5'));var authService=require('../../components/auth/service');var contacts=require('../../components/contacts');var qs=require(_0xa83a('0x6'));var logger=require(_0xa83a('0x7'))('api');var utils=require(_0xa83a('0x8'));var config=require(_0xa83a('0x9'));var licenseUtil=require(_0xa83a('0xa'));var APIBadRequestError=require(_0xa83a('0xb'))[_0xa83a('0xc')];var APINotFoundError=require(_0xa83a('0xb'))[_0xa83a('0xd')];var APIHandleError=require(_0xa83a('0xb'))[_0xa83a('0xe')];var db=require('../../mysqldb')['db'];var socket=require(_0xa83a('0xf'))(new Redis(config[_0xa83a('0x10')]));require(_0xa83a('0x11'))['register'](socket);config[_0xa83a('0x10')]=_[_0xa83a('0x12')](config['redis'],{'host':_0xa83a('0x13'),'port':0x18eb});var amiClient=jayson[_0xa83a('0x14')][_0xa83a('0x15')]({'port':0x232a});var values;function respondWithStatusCode(_0xd4ab80,_0x485c4f){_0x485c4f=_0x485c4f||0xcc;return function(_0x5cea34){if(_0x5cea34){return _0xd4ab80['sendStatus'](_0x485c4f);}return _0xd4ab80['status'](_0x485c4f)['end']();};}function respondWithResult(_0x2d97cb,_0x5f3cc1){_0x5f3cc1=_0x5f3cc1||0xc8;return function(_0xa0195b){if(_0xa0195b){return _0x2d97cb[_0xa83a('0x16')](_0x5f3cc1)['json'](_0xa0195b);}};}function respondWithFilteredResult(_0x573656,_0x12ed18){return function(_0x448d74){if(_0x448d74){var _0x3ef996=typeof _0x12ed18[_0xa83a('0x17')]===_0xa83a('0x18')&&typeof _0x12ed18[_0xa83a('0x19')]===_0xa83a('0x18');var _0x37725c=_0x448d74[_0xa83a('0x1a')];var _0xa1c366=_0x3ef996?0x0:_0x12ed18[_0xa83a('0x17')];var _0x24dafb=_0x3ef996?_0x448d74[_0xa83a('0x1a')]:_0x12ed18[_0xa83a('0x17')]+_0x12ed18[_0xa83a('0x19')];var _0x13ced4;if(_0x24dafb>=_0x37725c){_0x24dafb=_0x37725c;_0x13ced4=0xc8;}else{_0x13ced4=0xce;}_0x573656['status'](_0x13ced4);return _0x573656[_0xa83a('0x1b')](_0xa83a('0x1c'),_0xa1c366+'-'+_0x24dafb+'/'+_0x37725c)[_0xa83a('0x1d')](_0x448d74);}return null;};}function saveUpdates(_0xd946ab){return function(_0x5a7073){if(_0x5a7073){return _0x5a7073[_0xa83a('0x1e')](_0xd946ab)[_0xa83a('0x1f')](function(_0x4b5e73){if(_0x4b5e73[_0xa83a('0x20')]===_0xa83a('0x21')){socket[_0xa83a('0x22')](_0xa83a('0x23')+_0x4b5e73['id'],_0x4b5e73);}return _0x4b5e73;});}return null;};}function removeEntity(_0x3be2f5){return function(_0x4a714c){if(_0x4a714c){return _0x4a714c[_0xa83a('0x24')]()['then'](function(){var _0x49589c=_0x4a714c[_0xa83a('0x25')]({'plain':!![]});if(_0x49589c['role']===_0xa83a('0x26'))return;var _0x4868f5=[{'name':_0xa83a('0x27'),'value':_0xa83a('0x28'),'ignore':!![]},{'name':_0xa83a('0x29'),'value':'agent','ignore':![]},{'name':_0xa83a('0x2a'),'value':'telephone','ignore':![]}];var _0x35ec47=_(_0x4868f5)[_0xa83a('0x2b')](_0xa83a('0x2c'))[_0xa83a('0x2d')](_0xa83a('0x2e'))[_0xa83a('0x2e')]();if(_[_0xa83a('0x2f')](_0x35ec47,_0x49589c[_0xa83a('0x20')])){return;}var _0x26d3fd=_['find'](_0x4868f5,[_0xa83a('0x2e'),_0x49589c[_0xa83a('0x20')]])['name'];return db[_0xa83a('0x30')][_0xa83a('0x24')]({'where':{'type':_0x26d3fd,'resourceId':_0x49589c['id']}})['then'](function(){return _0x4a714c;});})[_0xa83a('0x1f')](function(){_0x3be2f5[_0xa83a('0x16')](0xcc)[_0xa83a('0x31')]();});}};}function handleEntityNotFound(_0x23dc64){return function(_0xe27583){if(!_0xe27583){_0x23dc64['sendStatus'](0x194);}return _0xe27583;};}function handleError(_0xecc978,_0x53c3fd){_0x53c3fd=_0x53c3fd||0x1f4;return function(_0x4f450a){logger[_0xa83a('0x32')](_0x4f450a[_0xa83a('0x33')]);if(_0x4f450a[_0xa83a('0x34')]){delete _0x4f450a[_0xa83a('0x34')];}_0xecc978['status'](_0x53c3fd)['send'](_0x4f450a);};}function getUserAttributes(){return _(db[_0xa83a('0x35')][_0xa83a('0x36')])[_0xa83a('0x2d')](function(_0x5cc596){return{'name':_0x5cc596[_0xa83a('0x37')],'type':_0x5cc596[_0xa83a('0x38')][_0xa83a('0x39')]};})[_0xa83a('0x2b')](function(_0x13d024){return!['password','salt',_0xa83a('0x3a'),_0xa83a('0x3b'),'resetPasswordExpires','passwordResetAt',_0xa83a('0x3c')]['includes'](_0x13d024[_0xa83a('0x34')]);})['value']();}exports['index']=function(_0x4349ad,_0x14d7dd){var _0x135eb9={},_0x4d931b={'count':0x0,'rows':[]};var _0x41dfb8=getUserAttributes();_0x135eb9=qs[_0xa83a('0x3d')](_0x41dfb8,_0x4349ad);var _0x5385fb={'where':_0x135eb9['where']};return db[_0xa83a('0x35')]['count'](_0x5385fb)[_0xa83a('0x1f')](function(_0x26adec){_0x4d931b[_0xa83a('0x1a')]=_0x26adec;if(_0x4349ad[_0xa83a('0x3e')][_0xa83a('0x3f')]){_0x135eb9[_0xa83a('0x40')]=[{'all':!![]}];}if(_0x4349ad['query'][_0xa83a('0x41')]===_0xa83a('0x42')){_0x135eb9[_0xa83a('0x40')]=[{'model':db[_0xa83a('0x43')],'as':'userSetting'}];}if(!_[_0xa83a('0x2f')](_0x135eb9[_0xa83a('0x44')],'id')){_0x135eb9[_0xa83a('0x44')][_0xa83a('0x45')]('id');}return db[_0xa83a('0x35')][_0xa83a('0x46')](_0x135eb9);})[_0xa83a('0x1f')](function(_0x1dee91){_0x4d931b[_0xa83a('0x47')]=_0x1dee91;if(_0x4349ad['query'][_0xa83a('0x48')]==='true'){var _0xe14073=[];for(var _0x113bf5=0x0;_0x113bf5<_0x4d931b[_0xa83a('0x47')][_0xa83a('0x49')];_0x113bf5++){_0xe14073[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4a'),_0x4d931b['rows'][_0x113bf5]['dataValues']));_0xe14073[_0xa83a('0x45')](get_open_tabs('sms',_0x4d931b[_0xa83a('0x47')][_0x113bf5][_0xa83a('0x4b')]));_0xe14073[_0xa83a('0x45')](get_open_tabs('fax',_0x4d931b[_0xa83a('0x47')][_0x113bf5]['dataValues']));_0xe14073[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4c'),_0x4d931b[_0xa83a('0x47')][_0x113bf5][_0xa83a('0x4b')]));_0xe14073[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4d'),_0x4d931b['rows'][_0x113bf5][_0xa83a('0x4b')]));_0xe14073[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4e'),_0x4d931b[_0xa83a('0x47')][_0x113bf5][_0xa83a('0x4b')]));}return Promise[_0xa83a('0x4f')](_0xe14073)['then'](function(){return _0x4d931b;});}else{return _0x4d931b;}})[_0xa83a('0x1f')](respondWithFilteredResult(_0x14d7dd,_0x135eb9))[_0xa83a('0x50')](handleError(_0x14d7dd,null));};exports[_0xa83a('0x51')]=function(_0x82055a,_0x2f193f){var _0x55c12a=getUserAttributes();_0x82055a[_0xa83a('0x3e')]['id']=_0x82055a[_0xa83a('0x52')]['id'];var _0xfc89ae=qs['getOptions'](_0x55c12a,_0x82055a);if(_0x82055a[_0xa83a('0x3e')][_0xa83a('0x3f')]){_0xfc89ae[_0xa83a('0x40')]=[{'all':!![]}];}if(_0x82055a[_0xa83a('0x3e')][_0xa83a('0x41')]===_0xa83a('0x42')){_0xfc89ae[_0xa83a('0x40')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0xfc89ae=_[_0xa83a('0x53')]({},_0xfc89ae,_0x82055a[_0xa83a('0x54')]);if(!_[_0xa83a('0x2f')](_0xfc89ae['attributes'],'id')){_0xfc89ae['attributes']['push']('id');}return db[_0xa83a('0x35')]['find'](_0xfc89ae)[_0xa83a('0x1f')](handleEntityNotFound(_0x2f193f,null))['then'](function(_0x4e24bd){var _0x1041ed=[];values=_0x4e24bd;if(_0x82055a[_0xa83a('0x3e')][_0xa83a('0x48')]===_0xa83a('0x42')){_0x1041ed['push'](get_open_tabs('chat',_0x4e24bd[_0xa83a('0x4b')]));_0x1041ed['push'](get_open_tabs(_0xa83a('0x55'),_0x4e24bd['dataValues']));_0x1041ed['push'](get_open_tabs('openchannel',_0x4e24bd['dataValues']));_0x1041ed['push'](get_open_tabs(_0xa83a('0x4e'),_0x4e24bd['dataValues']));_0x1041ed[_0xa83a('0x45')](get_open_tabs('fax',_0x4e24bd['dataValues']));_0x1041ed['push'](get_open_tabs(_0xa83a('0x4c'),_0x4e24bd[_0xa83a('0x4b')]));return Promise[_0xa83a('0x4f')](_0x1041ed);}else{return values;}})[_0xa83a('0x1f')](function(){return values;})['then'](respondWithResult(_0x2f193f,null))[_0xa83a('0x50')](handleError(_0x2f193f,null));};exports[_0xa83a('0x1e')]=function(_0x1c09ef,_0x4f3ff2){if(_0x1c09ef[_0xa83a('0x56')]['id']){delete _0x1c09ef[_0xa83a('0x56')]['id'];}delete _0x1c09ef[_0xa83a('0x56')][_0xa83a('0x20')];return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x1c09ef['params']['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x4f3ff2,null))[_0xa83a('0x1f')](saveUpdates(_0x1c09ef[_0xa83a('0x56')],null))[_0xa83a('0x1f')](respondWithResult(_0x4f3ff2,null))[_0xa83a('0x50')](handleError(_0x4f3ff2,null));};exports[_0xa83a('0x58')]=function(_0xdb8f27,_0x575b5b){return db[_0xa83a('0x35')]['describe']()[_0xa83a('0x1f')](respondWithResult(_0x575b5b,null))[_0xa83a('0x50')](handleError(_0x575b5b,null));};exports[_0xa83a('0x59')]=function(_0x431875,_0x52e384){return db['User'][_0xa83a('0x57')]({'where':{'id':_0x431875[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x52e384,null))['then'](function(_0xdb2d7b){if(_0xdb2d7b){return _0xdb2d7b[_0xa83a('0x59')](_0x431875[_0xa83a('0x56')][_0xa83a('0x5a')],_[_0xa83a('0x5b')](_0x431875[_0xa83a('0x56')],[_0xa83a('0x5a'),'id'])||{});}})[_0xa83a('0x1f')](respondWithResult(_0x52e384,null))[_0xa83a('0x50')](handleError(_0x52e384,null));};function validateUser(_0xc4256f){return new Promise(function(_0x45fa55,_0x417ab5){if(_0xc4256f[_0xa83a('0x5c')])return _0x45fa55(_0xc4256f);return db[_0xa83a('0x5d')]['findById'](0x1)[_0xa83a('0x1f')](function(_0x368c2b){if(_0x368c2b[_0xa83a('0x5e')])authService['validatePasswordPattern'](_0xc4256f[_0xa83a('0x5f')]);db[_0xa83a('0x35')][_0xa83a('0x60')](_0xa83a('0x5c'))['then'](function(_0x32291c){if(_['isNil'](_0x32291c)){_0xc4256f[_0xa83a('0x5c')]=_0x368c2b[_0xa83a('0x61')]||0x1;return;}if(_[_0xa83a('0x62')](_0x368c2b[_0xa83a('0x61')])||_0x368c2b[_0xa83a('0x61')]===_0x32291c){_0xc4256f[_0xa83a('0x5c')]=_0x32291c+0x1;return;}if(_0x368c2b[_0xa83a('0x61')]>_0x32291c){_0xc4256f['internal']=_0x368c2b[_0xa83a('0x61')];return;}return db[_0xa83a('0x63')][_0xa83a('0x3e')]('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']['QueryTypes']['SELECT']})['then'](function(_0x380cc1){if(_0x380cc1&&_0x380cc1[_0xa83a('0x49')]){for(var _0x288dbe=0x0,_0x107bd0=_0x380cc1[_0xa83a('0x49')];_0x288dbe<_0x107bd0&&_[_0xa83a('0x62')](_0xc4256f['internal']);_0x288dbe++){if(_0x368c2b[_0xa83a('0x61')]<=_0x380cc1[_0x288dbe][_0xa83a('0x64')]){_0xc4256f[_0xa83a('0x5c')]=_0x380cc1[_0x288dbe][_0xa83a('0x64')];}else if(_0x368c2b['min_internal']>_0x380cc1[_0x288dbe]['from']&&_0x368c2b[_0xa83a('0x61')]<=_0x380cc1[_0x288dbe]['to']){_0xc4256f[_0xa83a('0x5c')]=_0x368c2b['min_internal'];}}}if(_['isNil'](_0xc4256f[_0xa83a('0x5c')])){_0xc4256f['internal']=_0x32291c+0x1;}return _0x45fa55(_0xc4256f);});});})[_0xa83a('0x50')](function(_0x50b643){_0x417ab5(_0x50b643);});});}function updateUser(_0x49902d){return new Promise(function(_0x380c49,_0x2bcef8){try{if(_0x49902d['voicemail']){_0x49902d[_0xa83a('0x65')]=_0x49902d[_0xa83a('0x5c')];_0x49902d['VoiceMail']={'mailbox':_0x49902d[_0xa83a('0x5c')],'password':_0x49902d['password'],'fullname':_0x49902d['fullname'],'email':_0x49902d['email']};}if(_0x49902d['role']===_0xa83a('0x21')){if(!_0x49902d['permissions'])_0x49902d[_0xa83a('0x66')]=['101',_0xa83a('0x67'),'103',_0xa83a('0x68'),_0xa83a('0x69'),_0xa83a('0x6a'),'105','106','107',_0xa83a('0x6b'),_0xa83a('0x6c'),_0xa83a('0x6d'),_0xa83a('0x6e'),_0xa83a('0x6f'),_0xa83a('0x70')];}_0x380c49(_0x49902d);}catch(_0x406cc9){_0x2bcef8(_0x406cc9);}});}exports[_0xa83a('0x71')]=function(_0xa89d88,_0x344a76){if(_0xa89d88['user']['role']===_0xa83a('0x21'))throw new Error(_0xa83a('0x72'));if(_0xa89d88[_0xa83a('0x56')]['role']===_0xa83a('0x28')&&_0xa89d88[_0xa83a('0x28')][_0xa83a('0x20')]!==_0xa83a('0x26')){throw new Error(_0xa83a('0x73'));}if(_0xa89d88[_0xa83a('0x56')][_0xa83a('0x20')]===_0xa83a('0x26')&&_0xa89d88['user'][_0xa83a('0x20')]!==_0xa83a('0x26')){throw new Error(_0xa83a('0x74'));}return licenseUtil[_0xa83a('0x75')]([_0xa89d88[_0xa83a('0x56')]])[_0xa83a('0x1f')](function(){return validateUser(_0xa89d88[_0xa83a('0x56')]);})[_0xa83a('0x1f')](function(_0x4a2479){return updateUser(_0x4a2479)[_0xa83a('0x1f')](function(_0x5a74bd){if(_0x5a74bd[_0xa83a('0x20')]===_0xa83a('0x26')){_0x5a74bd[_0xa83a('0x76')]=_0xa89d88[_0xa83a('0x28')][_0xa83a('0x76')];delete _0x5a74bd[_0xa83a('0x77')];}return _0x5a74bd;});})[_0xa83a('0x1f')](function(_0x1c0f79){return db['User'][_0xa83a('0x71')](_0x1c0f79,{'include':[{'model':db['VoiceMail'],'as':_0xa83a('0x78')}]});})[_0xa83a('0x1f')](function(_0x4ed91b){if(_0xa89d88[_0xa83a('0x56')][_0xa83a('0x20')]===_0xa83a('0x28'))return _0x4ed91b;if(_0xa89d88[_0xa83a('0x28')][_0xa83a('0x20')]!=='user')return _0x4ed91b;return db[_0xa83a('0x79')][_0xa83a('0x57')]({'where':{'name':_0x4ed91b[_0xa83a('0x20')]===_0xa83a('0x21')?'Agents':'Telephones','userProfileId':_0xa89d88[_0xa83a('0x28')][_0xa83a('0x77')]},'raw':!![]})[_0xa83a('0x1f')](function(_0x1d045b){if(!_0x1d045b||_0x1d045b['autoAssociation']!=0x0)return _0x4ed91b;return db[_0xa83a('0x30')]['create']({'name':_0x4ed91b[_0xa83a('0x34')],'resourceId':_0x4ed91b['id'],'type':_0x1d045b['name'],'sectionId':_0x1d045b['id']},{})[_0xa83a('0x1f')](function(){return _0x4ed91b;});})[_0xa83a('0x50')](function(_0xe88053){logger[_0xa83a('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe88053);throw _0xe88053;});})['then'](respondWithResult(_0x344a76,0xc9))[_0xa83a('0x50')](handleError(_0x344a76,null));};exports[_0xa83a('0x7a')]=function(_0x38d101,_0x31e40e){var _0x2154ff=_0x38d101[_0xa83a('0x56')];var _0x26c89d=[];if(_0x38d101[_0xa83a('0x28')][_0xa83a('0x20')]===_0xa83a('0x21'))throw new Error(_0xa83a('0x72'));if(_[_0xa83a('0x7b')](_0x2154ff,[_0xa83a('0x20'),_0xa83a('0x28')])&&_0x38d101[_0xa83a('0x28')]['role']!=='admin'){throw new Error(_0xa83a('0x73'));}if(_[_0xa83a('0x7b')](_0x2154ff,[_0xa83a('0x20'),_0xa83a('0x26')])&&_0x38d101[_0xa83a('0x28')][_0xa83a('0x20')]!==_0xa83a('0x26')){throw new Error(_0xa83a('0x7c'));}return licenseUtil[_0xa83a('0x75')](_0x2154ff)[_0xa83a('0x1f')](function(){return validateUser(_0x2154ff[0x0]);})[_0xa83a('0x1f')](function(){for(var _0x546974=0x1;_0x546974<_0x2154ff['length'];_0x546974++){var _0x5c4c9d=_0x2154ff[_0x546974-0x1][_0xa83a('0x5c')];if(!_0x2154ff[_0x546974][_0xa83a('0x5c')])_0x2154ff[_0x546974][_0xa83a('0x5c')]=_0x5c4c9d+0x1;_0x26c89d['push'](validateUser(_0x2154ff[_0x546974]));}return Promise[_0xa83a('0x4f')](_0x26c89d);})[_0xa83a('0x1f')](function(){_0x26c89d=[];for(var _0x3a58e0=0x0;_0x3a58e0<_0x2154ff[_0xa83a('0x49')];_0x3a58e0++){_0x26c89d[_0xa83a('0x45')](updateUser(_0x2154ff[_0x3a58e0]));}return Promise[_0xa83a('0x4f')](_0x26c89d);})['then'](function(){_0x26c89d=_0x2154ff[_0xa83a('0x2d')](function(_0x32e853){return db['User'][_0xa83a('0x71')](_0x32e853,{'include':[{'model':db['VoiceMail'],'as':_0xa83a('0x78')}]})[_0xa83a('0x1f')](function(_0x4a7dbb){_0x32e853['id']=_0x4a7dbb['id'];return _0x32e853;});});return Promise[_0xa83a('0x4f')](_0x26c89d);})[_0xa83a('0x1f')](function(_0x28fdb5){if(_0x38d101[_0xa83a('0x56')][_0xa83a('0x20')]===_0xa83a('0x28'))return _0x28fdb5;if(_0x38d101[_0xa83a('0x28')][_0xa83a('0x20')]!==_0xa83a('0x28'))return _0x28fdb5;var _0x3b02ca=_['some'](_0x28fdb5,function(_0x137ce2){return _0x137ce2[_0xa83a('0x20')]===_0xa83a('0x21')||_0x137ce2[_0xa83a('0x20')]===_0xa83a('0x7d');});if(!_0x3b02ca)return _0x28fdb5;return db[_0xa83a('0x79')][_0xa83a('0x46')]({'where':{'name':{'$or':[_0xa83a('0x29'),_0xa83a('0x2a')]},'userProfileId':_0x38d101[_0xa83a('0x28')][_0xa83a('0x77')]},'raw':!![]})[_0xa83a('0x1f')](function(_0x1cc7ff){if(_[_0xa83a('0x7e')](_0x1cc7ff)||!_['some'](_0x1cc7ff,[_0xa83a('0x7f'),0x0]))return _0x28fdb5;_0x26c89d=[];var _0x466bed=_(_0x1cc7ff)[_0xa83a('0x2d')](function(_0x2de193){if(_0x2de193[_0xa83a('0x7f')]===0x1)return;return _0x2de193[_0xa83a('0x34')]===_0xa83a('0x29')?_0xa83a('0x21'):'telephone';})['compact']()[_0xa83a('0x2e')]();for(var _0x15b923=0x0;_0x15b923<_0x28fdb5[_0xa83a('0x49')];_0x15b923++){if(!_[_0xa83a('0x2f')](_0x466bed,_0x28fdb5[_0x15b923][_0xa83a('0x20')]))return;var _0x2090a5=_0x28fdb5[_0x15b923][_0xa83a('0x20')]===_0xa83a('0x21')?_0xa83a('0x29'):_0xa83a('0x2a');_0x26c89d[_0xa83a('0x45')](db['UserProfileResource']['create']({'name':_0x28fdb5[_0x15b923][_0xa83a('0x34')],'resourceId':_0x28fdb5[_0x15b923]['id'],'type':_0x2090a5,'sectionId':_['find'](_0x1cc7ff,['name',_0x2090a5])['id']},{}));}return Promise[_0xa83a('0x4f')](_0x26c89d);});})[_0xa83a('0x1f')](respondWithResult(_0x31e40e,0xc9))[_0xa83a('0x50')](handleError(_0x31e40e,null));};exports[_0xa83a('0x80')]=function(_0x184fad,_0x2c8d3a){if(_0x184fad[_0xa83a('0x56')]['id']){delete _0x184fad[_0xa83a('0x56')]['id'];}return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x184fad['params']['id']}})['then'](function(_0x20ddf1){if(!_0x20ddf1)return null;if(_0x20ddf1['id']===_0x184fad['user']['id']){if(!_0x184fad[_0xa83a('0x56')][_0xa83a('0x81')]||!_0x184fad[_0xa83a('0x56')][_0xa83a('0x82')]){throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x20ddf1[_0xa83a('0x85')](_0x184fad[_0xa83a('0x56')][_0xa83a('0x81')])){throw new db[(_0xa83a('0x83'))]['ValidationError'](_0xa83a('0x86'));}if(_0x184fad[_0xa83a('0x56')]['oldPassword']===_0x184fad['body']['newPassword']){throw new db['Sequelize'][(_0xa83a('0x84'))](_0xa83a('0x87'));}}else if(_0x184fad[_0xa83a('0x28')][_0xa83a('0x20')]===_0xa83a('0x26')){if(!_0x184fad[_0xa83a('0x56')][_0xa83a('0x82')]){throw new db['Sequelize'][(_0xa83a('0x84'))](_0xa83a('0x88'));}}else if(_0x184fad[_0xa83a('0x28')]['role']==='user'){if(!_0x184fad[_0xa83a('0x56')][_0xa83a('0x82')]){throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x20ddf1[_0xa83a('0x20')]!==_0xa83a('0x21')){throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))](_0xa83a('0x72'));}}else{throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))]('Unauthorized');}return _0x20ddf1;})[_0xa83a('0x1f')](handleEntityNotFound(_0x2c8d3a,null))[_0xa83a('0x1f')](function(_0x8c0ff8){return db['Setting']['findOne']({'attributes':['id',_0xa83a('0x5e'),'enforcePasswordHistory',_0xa83a('0x89')]})[_0xa83a('0x1f')](function(_0x172ef6){if(_0x172ef6[_0xa83a('0x5e')])authService['validatePasswordPattern'](_0x184fad[_0xa83a('0x56')]['newPassword']);if(!_0x172ef6[_0xa83a('0x8a')]||!_0x8c0ff8[_0xa83a('0x3a')])return _0x8c0ff8;authService[_0xa83a('0x8b')](_0x184fad['body']['newPassword'],_0x8c0ff8[_0xa83a('0x3a')],_0x172ef6[_0xa83a('0x89')]);return _0x8c0ff8;})[_0xa83a('0x1f')](saveUpdates({'password':_0x184fad[_0xa83a('0x56')]['newPassword'],'passwordResetAt':_0x184fad[_0xa83a('0x28')]['id']==_0x184fad[_0xa83a('0x52')]['id']?moment():null,'previousPasswords':authService[_0xa83a('0x8c')](_0x184fad[_0xa83a('0x56')]['newPassword'],_0x8c0ff8[_0xa83a('0x3a')])},null));})[_0xa83a('0x1f')](respondWithResult(_0x2c8d3a,null))[_0xa83a('0x50')](handleError(_0x2c8d3a,null));};exports[_0xa83a('0x8d')]=function(_0x1d44fa,_0x5b7c2c){var _0x3d2924=_0x1d44fa[_0xa83a('0x56')][_0xa83a('0x8e')];return db[_0xa83a('0x35')]['find']({'where':{'id':_0x1d44fa[_0xa83a('0x52')]['id']},'attributes':['id',_0xa83a('0x34'),_0xa83a('0x20'),_0xa83a('0x8f'),'loginInPause',_0xa83a('0x90'),_0xa83a('0x91')]})['then'](handleEntityNotFound(_0x5b7c2c,null))[_0xa83a('0x1f')](function(_0x37ba37){if(_0x37ba37){if(!utils[_0xa83a('0x92')](_0x3d2924)){throw new db['Sequelize'][(_0xa83a('0x84'))](_0xa83a('0x93'));}return _0x37ba37[_0xa83a('0x94')+_['capitalize'](_0x3d2924['toLowerCase']())+'Queues'](_0x1d44fa[_0xa83a('0x56')]['ids'],{'penalty':_0x1d44fa[_0xa83a('0x56')][_0xa83a('0x95')]||0x0})[_0xa83a('0x96')](function(_0x254f26){for(var _0x44c4df=0x0;_0x44c4df<_0x1d44fa[_0xa83a('0x56')][_0xa83a('0x5a')][_0xa83a('0x49')];_0x44c4df+=0x1){var _0x1d6f9a={'UserId':Number(_0x1d44fa[_0xa83a('0x52')]['id'])};_0x1d6f9a[_[_0xa83a('0x97')](_0x3d2924['toLowerCase']())+_0xa83a('0x98')]=Number(_0x1d44fa['body'][_0xa83a('0x5a')][_0x44c4df]);socket['emit']('user'+_[_0xa83a('0x97')](_0x3d2924['toLowerCase']())+_0xa83a('0x99'),_0x1d6f9a);}return _0x254f26;})['then'](function(){if(_0x3d2924===_0xa83a('0x9a')){return db[_0xa83a('0x9b')]['findAll']({'where':{'id':_0x1d44fa[_0xa83a('0x56')][_0xa83a('0x5a')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x3e5f9d){var _0x296976=_0x37ba37[_0xa83a('0x25')]({'plain':!![]});var _0x210147=[];if(_0x3d2924==='voice'&&_0x296976[_0xa83a('0x20')]==='agent'&&_0x296976['online']){for(let _0x37cec5=0x0;_0x37cec5<_0x3e5f9d[_0xa83a('0x49')];_0x37cec5+=0x1){_0x210147[_0xa83a('0x45')]({'membername':_0x296976[_0xa83a('0x34')],'UserId':_0x296976['id'],'queue_name':_0x3e5f9d[_0x37cec5]['name'],'VoiceQueueId':_0x3e5f9d[_0x37cec5]['id'],'interface':_[_0xa83a('0x62')](_0x296976[_0xa83a('0x91')])?util[_0xa83a('0x9c')]('SIP/%s',_0x296976[_0xa83a('0x34')]):_0x296976[_0xa83a('0x91')],'paused':_0x296976[_0xa83a('0x90')]||![],'penalty':_0x1d44fa[_0xa83a('0x56')][_0xa83a('0x95')]||0x0});}return Promise[_0xa83a('0x4f')](_0x210147['map'](function(_0x463a4c){return db[_0xa83a('0x9d')][_0xa83a('0x9e')](_0x463a4c);}));}return _0x37ba37;});}})[_0xa83a('0x1f')](respondWithStatusCode(_0x5b7c2c,null))[_0xa83a('0x50')](handleError(_0x5b7c2c,null));};exports[_0xa83a('0x9f')]=function(_0x5b5b47,_0x3f54c5){var _0x311a3d,_0x2015d6;return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x5b5b47['params']['id']},'attributes':['id',_0xa83a('0x34'),'role']})[_0xa83a('0x1f')](handleEntityNotFound(_0x3f54c5,null))['then'](function(_0x2b5ccb){if(_0x2b5ccb){_0x311a3d=_0x2b5ccb;if(!_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x8e')]||!utils[_0xa83a('0x92')](_0x5b5b47[_0xa83a('0x3e')]['channel'])){throw new db['Sequelize'][(_0xa83a('0x84'))]('Unknown\x20channel');}return _0x2b5ccb[_0xa83a('0xa0')+_[_0xa83a('0x97')](_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x8e')][_0xa83a('0xa1')]())+_0xa83a('0xa2')](_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x5a')]);}})[_0xa83a('0x1f')](function(_0x146a48){if(_[_0xa83a('0xa3')](_0x5b5b47['query']['ids'])){for(var _0x123382=0x0;_0x123382<_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x5a')][_0xa83a('0x49')];_0x123382+=0x1){_0x2015d6={'UserId':Number(_0x5b5b47[_0xa83a('0x52')]['id'])};_0x2015d6[_[_0xa83a('0x97')](_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x8e')]['toLowerCase']())+'QueueId']=Number(_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x5a')][_0x123382]);socket[_0xa83a('0x22')](_0xa83a('0x28')+_['capitalize'](_0x5b5b47[_0xa83a('0x3e')]['channel'][_0xa83a('0xa1')]())+'Queue:remove',_0x2015d6);}}else{_0x2015d6={'UserId':Number(_0x5b5b47[_0xa83a('0x52')]['id'])};_0x2015d6[_[_0xa83a('0x97')](_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x8e')][_0xa83a('0xa1')]())+_0xa83a('0x98')]=Number(_0x5b5b47['query'][_0xa83a('0x5a')]);socket[_0xa83a('0x22')](_0xa83a('0x28')+_[_0xa83a('0x97')](_0x5b5b47[_0xa83a('0x3e')]['channel'][_0xa83a('0xa1')]())+_0xa83a('0xa4'),_0x2015d6);}return _0x146a48;})['then'](function(){if(_0x5b5b47[_0xa83a('0x3e')]['channel']==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x5b5b47[_0xa83a('0x52')]['id'],'VoiceQueueId':_0x5b5b47[_0xa83a('0x3e')][_0xa83a('0x5a')]},'individualHooks':!![]})[_0xa83a('0x1f')](function(){return _0x311a3d;});}return _0x311a3d;})[_0xa83a('0x1f')](respondWithStatusCode(_0x3f54c5,null))[_0xa83a('0x50')](handleError(_0x3f54c5,null));};exports[_0xa83a('0xa5')]=function(_0x3b1533,_0x51cb12){_0x3b1533['body'][_0xa83a('0xa6')]=_0x3b1533[_0xa83a('0xa7')]['filename'];return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x3b1533[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x51cb12,null))[_0xa83a('0x1f')](saveUpdates(_0x3b1533[_0xa83a('0x56')],null))[_0xa83a('0x1f')](respondWithResult(_0x51cb12,null))[_0xa83a('0x50')](handleError(_0x51cb12,null));};exports[_0xa83a('0xa8')]=function(_0x231c9a,_0x2594d1){var _0x1e3042=path[_0xa83a('0xa9')](config[_0xa83a('0xaa')],_0xa83a('0xab'));return db[_0xa83a('0x35')]['find']({'where':{'id':_0x231c9a[_0xa83a('0x52')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xa83a('0x1f')](handleEntityNotFound(_0x2594d1,null))['then'](function(_0x1641bc){if(_0x1641bc){if(_['isNil'](_0x1641bc[_0xa83a('0xa6')])){return _0x2594d1[_0xa83a('0xac')](_0x1e3042);}else{if(!fs[_0xa83a('0xad')](path[_0xa83a('0xa9')](config['root'],_0xa83a('0xae'),_0x1641bc[_0xa83a('0xa6')]))){return _0x2594d1[_0xa83a('0xac')](_0x1e3042);}return _0x2594d1[_0xa83a('0xac')](path['join'](config['root'],'server/files/images/',_0x1641bc[_0xa83a('0xa6')]));}}})['catch'](handleError(_0x2594d1,null));};exports[_0xa83a('0xaf')]=function(_0xfb5a38,_0x17c849){return db[_0xa83a('0x35')]['find']({'where':{'id':_0xfb5a38['params']['id']},'attributes':['id']})[_0xa83a('0x1f')](handleEntityNotFound(_0x17c849,null))[_0xa83a('0x1f')](function(_0x1bb330){var _0x27aa2c=[];values=_0x1bb330['dataValues'];_0x27aa2c[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4a'),_0x1bb330['dataValues']));_0x27aa2c[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x55'),_0x1bb330[_0xa83a('0x4b')]));_0x27aa2c[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4d'),_0x1bb330['dataValues']));_0x27aa2c[_0xa83a('0x45')](get_open_tabs(_0xa83a('0x4e'),_0x1bb330[_0xa83a('0x4b')]));_0x27aa2c[_0xa83a('0x45')](get_open_tabs(_0xa83a('0xb0'),_0x1bb330['dataValues']));_0x27aa2c[_0xa83a('0x45')](get_open_tabs('mail',_0x1bb330[_0xa83a('0x4b')]));return Promise['all'](_0x27aa2c);})['then'](function(_0x39dce1){if(_0x39dce1){var _0x478342=_[_0xa83a('0x2d')](values[_0xa83a('0xb1')],function(_0x26bc30){return{'channel':_0xa83a('0xb2'),'id':_0x26bc30['id'],'createdAt':_0x26bc30[_0xa83a('0xb3')]};});var _0x30d3c7=_[_0xa83a('0x2d')](values[_0xa83a('0xb4')],function(_0x296d96){return{'channel':_0xa83a('0xb5'),'id':_0x296d96['id'],'createdAt':_0x296d96['createdAt']};});var _0x262751=_['map'](values[_0xa83a('0xb6')],function(_0x2b6a15){return{'channel':_0xa83a('0xb7'),'id':_0x2b6a15['id'],'createdAt':_0x2b6a15['createdAt']};});var _0x366ba9=_[_0xa83a('0x2d')](values[_0xa83a('0xb8')],function(_0x30c279){return{'channel':'MAIL','id':_0x30c279['id'],'createdAt':_0x30c279[_0xa83a('0xb3')]};});var _0x43f83a=_['map'](values[_0xa83a('0xb9')],function(_0x10a0f9){return{'channel':_0xa83a('0xba'),'id':_0x10a0f9['id'],'createdAt':_0x10a0f9[_0xa83a('0xb3')]};});var _0x3eccc7=_['map'](values[_0xa83a('0xbb')],function(_0x4ce498){return{'channel':_0xa83a('0xbc'),'id':_0x4ce498['id'],'createdAt':_0x4ce498['createdAt']};});var _0x197a75=_[_0xa83a('0xbd')](_0x478342,_0x30d3c7,_0x262751,_0x366ba9,_0x43f83a,_0x3eccc7);var _0x567005={'count':_0x197a75[_0xa83a('0x49')],'rows':_0x197a75};return _0x567005;}else return null;})[_0xa83a('0x1f')](respondWithResult(_0x17c849,null))[_0xa83a('0x50')](handleError(_0x17c849,null));};exports[_0xa83a('0xbe')]=function(_0xea0e54,_0x293373){var _0x21009e={};return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0xea0e54['params']['id']}})[_0xa83a('0x1f')](function(_0x423295){if(!_0x423295){throw new APINotFoundError(util[_0xa83a('0x9c')](_0xa83a('0xc0'),_0xea0e54[_0xa83a('0x52')]['id']));}return contacts['describe']();})[_0xa83a('0x1f')](function(_0x5591fe){_0xea0e54[_0xa83a('0x3e')][_0xa83a('0x35')]=_0xea0e54[_0xa83a('0x52')]['id'];_0x21009e=qs[_0xa83a('0x3d')](_0x5591fe,_0xea0e54);if(_0xea0e54[_0xa83a('0x3e')]['hasOwnProperty']('includeAll')){_0x21009e['include']=[{'model':db[_0xa83a('0xc1')],'as':_0xa83a('0xc2'),'required':![]},{'model':db[_0xa83a('0xc3')],'as':_0xa83a('0xc4'),'attributes':['id',_0xa83a('0x34'),_0xa83a('0xc5')],'where':_0xea0e54['query'][_0xa83a('0xc6')]?{'id':_0xea0e54[_0xa83a('0x3e')][_0xa83a('0xc6')]}:undefined,'required':_0xea0e54[_0xa83a('0x3e')][_0xa83a('0xc6')]?!![]:![]}];}return contacts[_0xa83a('0x46')](_0xea0e54[_0xa83a('0x3e')],_0xea0e54[_0xa83a('0x28')],_0x21009e,_0x5591fe);})[_0xa83a('0x1f')](respondWithFilteredResult(_0x293373,_0x21009e))[_0xa83a('0x50')](APIHandleError(_0x293373));};exports[_0xa83a('0xc7')]=function(_0x49009b,_0x571a55){var _0x369839;var _0x25d3bc={};var _0x18bf5f;return db[_0xa83a('0x35')]['findOne']({'where':{'id':_0x49009b['params']['id']},'attributes':['id','name','role']})[_0xa83a('0x1f')](handleEntityNotFound(_0x571a55,null))[_0xa83a('0x1f')](function(_0x504453){if(!utils[_0xa83a('0x92')](_0x49009b[_0xa83a('0x3e')][_0xa83a('0x8e')])){throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))]('Unknown\x20channel');}_0x369839=_0x504453;var _0xf3208b={};_0xf3208b[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db[_[_0xa83a('0x97')](_0x49009b[_0xa83a('0x3e')]['channel'])+_0xa83a('0xca')][_0xa83a('0x36')]);_0xf3208b[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x49009b[_0xa83a('0x3e')]);_0xf3208b['filters']=_['intersection'](_0xf3208b[_0xa83a('0xc8')],_0xf3208b[_0xa83a('0x3e')]);_0x25d3bc[_0xa83a('0x44')]=_['intersection'](_0xf3208b[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x49009b[_0xa83a('0x3e')]['fields']));_0x25d3bc[_0xa83a('0x44')]=_0x25d3bc[_0xa83a('0x44')][_0xa83a('0x49')]?_0x25d3bc[_0xa83a('0x44')]:_0xf3208b[_0xa83a('0xc8')];_0x25d3bc[_0xa83a('0xcc')]=qs['sort'](_0x49009b['query'][_0xa83a('0xcd')]);_0x25d3bc['where']=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x49009b[_0xa83a('0x3e')],_0xf3208b[_0xa83a('0xce')]));if(_0x49009b[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x25d3bc[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x25d3bc[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x25d3bc[_0xa83a('0x44')],function(_0x3fddc9){var _0x4d3526={};_0x4d3526[_0x3fddc9]={'$like':'%'+_0x49009b[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x4d3526;})});}_0x25d3bc=_[_0xa83a('0x53')]({},_0x25d3bc,_0x49009b[_0xa83a('0x54')]);switch(_0x369839[_0xa83a('0x20')]){case'admin':return db[_[_0xa83a('0x97')](_0x49009b['query']['channel'])+'Queue'][_0xa83a('0x46')](_0x25d3bc);case _0xa83a('0x28'):case _0xa83a('0x21'):return _0x369839[_0xa83a('0x25')+_[_0xa83a('0x97')](_0x49009b[_0xa83a('0x3e')][_0xa83a('0x8e')])+_0xa83a('0xa2')](_0x25d3bc);default:throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))]('Unknown\x20role');}})['then'](function(_0x2b2ea8){_0x18bf5f=_0x2b2ea8[_0xa83a('0x49')];if(!_0x49009b[_0xa83a('0x3e')][_0xa83a('0xd1')]('nolimit')){_0x25d3bc[_0xa83a('0x19')]=qs[_0xa83a('0x19')](_0x49009b['query']['limit']);_0x25d3bc[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0x49009b[_0xa83a('0x3e')][_0xa83a('0x17')]);}switch(_0x369839[_0xa83a('0x20')]){case _0xa83a('0x26'):return db[_[_0xa83a('0x97')](_0x49009b[_0xa83a('0x3e')][_0xa83a('0x8e')])+'Queue'][_0xa83a('0x46')](_0x25d3bc);case _0xa83a('0x28'):case _0xa83a('0x21'):return _0x369839['get'+_[_0xa83a('0x97')](_0x49009b[_0xa83a('0x3e')][_0xa83a('0x8e')])+_0xa83a('0xa2')](_0x25d3bc);}})[_0xa83a('0x1f')](function(_0x586364){return{'count':_0x18bf5f,'rows':_0x586364};})[_0xa83a('0x1f')](respondWithResult(_0x571a55,null))['catch'](handleError(_0x571a55,null));};exports[_0xa83a('0xd2')]=function(_0x4b4dbb,_0x1bd207){var _0x3d77a3={};var _0x10f36b={};var _0x3121e5;var _0x50b478;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x4b4dbb['params']['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x1bd207,null))[_0xa83a('0x1f')](function(_0x1f33a5){if(_0x1f33a5){_0x3121e5=_0x1f33a5;_0x10f36b[_0xa83a('0xc8')]=_['keys'](db[_0xa83a('0x9d')]['rawAttributes']);_0x10f36b['query']=_[_0xa83a('0xc9')](_0x4b4dbb['query']);_0x10f36b[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x10f36b[_0xa83a('0xc8')],_0x10f36b[_0xa83a('0x3e')]);_0x3d77a3[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x10f36b[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x4b4dbb['query'][_0xa83a('0xcb')]));_0x3d77a3['attributes']=_0x3d77a3[_0xa83a('0x44')]['length']?_0x3d77a3[_0xa83a('0x44')]:_0x10f36b['model'];_0x3d77a3['order']=qs[_0xa83a('0xcd')](_0x4b4dbb['query'][_0xa83a('0xcd')]);_0x3d77a3[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x4b4dbb[_0xa83a('0x3e')],_0x10f36b['filters']));if(_0x4b4dbb[_0xa83a('0x3e')]['filter']){_0x3d77a3[_0xa83a('0xd0')]=_['merge'](_0x3d77a3[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x3d77a3['attributes'],function(_0xfaf8eb){var _0x5931b4={};_0x5931b4[_0xfaf8eb]={'$like':'%'+_0x4b4dbb[_0xa83a('0x3e')]['filter']+'%'};return _0x5931b4;})});}_0x3d77a3=_[_0xa83a('0x53')]({},_0x3d77a3,_0x4b4dbb[_0xa83a('0x54')]);return _0x3121e5['getVoiceQueuesRt'](_0x3d77a3);}})[_0xa83a('0x1f')](function(_0xc1cf75){if(_0xc1cf75){_0x50b478=_0xc1cf75[_0xa83a('0x49')];if(!_0x4b4dbb[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x3d77a3[_0xa83a('0x19')]=qs['limit'](_0x4b4dbb[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x3d77a3['offset']=qs[_0xa83a('0x17')](_0x4b4dbb['query'][_0xa83a('0x17')]);}return _0x3121e5[_0xa83a('0xd2')](_0x3d77a3);}})['then'](function(_0x256037){if(_0x256037){return _0x256037?{'count':_0x50b478,'rows':_0x256037}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x1bd207,null))[_0xa83a('0x50')](handleError(_0x1bd207,null));};exports['getGroups']=function(_0x1be69b,_0x205e3d){var _0x435cc1={};var _0x2fb015={};var _0x3d75c5;var _0x2fa1fd;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x1be69b[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x205e3d,null))[_0xa83a('0x1f')](function(_0x10f126){if(_0x10f126){_0x3d75c5=_0x10f126;_0x2fb015['model']=_[_0xa83a('0xc9')](db['ChatGroup'][_0xa83a('0x36')]);_0x2fb015[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x1be69b[_0xa83a('0x3e')]);_0x2fb015[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x2fb015[_0xa83a('0xc8')],_0x2fb015['query']);_0x435cc1['attributes']=_[_0xa83a('0xd3')](_0x2fb015[_0xa83a('0xc8')],qs['fields'](_0x1be69b[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x435cc1['attributes']=_0x435cc1['attributes'][_0xa83a('0x49')]?_0x435cc1[_0xa83a('0x44')]:_0x2fb015['model'];_0x435cc1[_0xa83a('0xcc')]=qs[_0xa83a('0xcd')](_0x1be69b['query']['sort']);_0x435cc1[_0xa83a('0xd0')]=qs['filters'](_['pick'](_0x1be69b[_0xa83a('0x3e')],_0x2fb015[_0xa83a('0xce')]));if(_0x1be69b[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x435cc1[_0xa83a('0xd0')]=_['merge'](_0x435cc1[_0xa83a('0xd0')],{'$or':_['map'](_0x435cc1[_0xa83a('0x44')],function(_0x5f5210){var _0x48c452={};_0x48c452[_0x5f5210]={'$like':'%'+_0x1be69b[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x48c452;})});}_0x435cc1=_[_0xa83a('0x53')]({},_0x435cc1,_0x1be69b[_0xa83a('0x54')]);return _0x3d75c5['getGroups'](_0x435cc1);}})[_0xa83a('0x1f')](function(_0x583616){if(_0x583616){_0x2fa1fd=_0x583616[_0xa83a('0x49')];if(!_0x1be69b[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x435cc1[_0xa83a('0x19')]=qs['limit'](_0x1be69b['query']['limit']);_0x435cc1[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0x1be69b[_0xa83a('0x3e')][_0xa83a('0x17')]);}return _0x3d75c5['getGroups'](_0x435cc1);}})[_0xa83a('0x1f')](function(_0x5ea0ee){if(_0x5ea0ee){return _0x5ea0ee?{'count':_0x2fa1fd,'rows':_0x5ea0ee}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x205e3d,null))['catch'](handleError(_0x205e3d,null));};exports[_0xa83a('0xd5')]=function(_0x66d859,_0x2f847f){var _0x3d204e={'raw':!![],'where':{}};var _0x4877f0={};var _0x5210d7={'count':0x0,'rows':[]};return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x66d859[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x2f847f,null))['then'](function(_0x4f4d3f){if(_0x4f4d3f){_0x4877f0[_0xa83a('0xc8')]=_['keys'](db[_0xa83a('0xd6')][_0xa83a('0x36')]);_0x4877f0[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x66d859[_0xa83a('0x3e')]);_0x4877f0[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x4877f0['model'],_0x4877f0[_0xa83a('0x3e')]);_0x3d204e[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x4877f0['model'],qs['fields'](_0x66d859[_0xa83a('0x3e')]['fields']));_0x3d204e[_0xa83a('0x44')]=_0x3d204e['attributes'][_0xa83a('0x49')]?_0x3d204e['attributes']:_0x4877f0[_0xa83a('0xc8')];if(!_0x66d859['query']['hasOwnProperty']('nolimit')){_0x3d204e[_0xa83a('0x19')]=qs['limit'](_0x66d859[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x3d204e[_0xa83a('0x17')]=qs['offset'](_0x66d859['query'][_0xa83a('0x17')]);}_0x3d204e[_0xa83a('0xcc')]=qs[_0xa83a('0xcd')](_0x66d859['query'][_0xa83a('0xcd')]);_0x3d204e[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x66d859['query'],_0x4877f0[_0xa83a('0xce')]));_0x3d204e[_0xa83a('0xd0')]['UserId']=_0x4f4d3f['id'];if(_0x66d859[_0xa83a('0x3e')]['filter']){_0x3d204e[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x3d204e['where'],{'$or':_[_0xa83a('0x2d')](_0x3d204e['attributes'],function(_0x8dda53){var _0x2c501c={};_0x2c501c[_0x8dda53]={'$like':'%'+_0x66d859['query'][_0xa83a('0x2b')]+'%'};return _0x2c501c;})});}_0x3d204e=_['merge']({},_0x3d204e,_0x66d859[_0xa83a('0x54')]);return db[_0xa83a('0xd6')][_0xa83a('0x1a')]({'where':_0x3d204e[_0xa83a('0xd0')]})[_0xa83a('0x1f')](function(_0x35cdc4){_0x5210d7['count']=_0x35cdc4;if(_0x66d859['query'][_0xa83a('0x3f')]){_0x3d204e[_0xa83a('0x40')]=[{'all':!![]}];}return db[_0xa83a('0xd6')]['findAll'](_0x3d204e);})['then'](function(_0x46f7d0){_0x5210d7[_0xa83a('0x47')]=_0x46f7d0;return _0x5210d7;});}})['then'](respondWithFilteredResult(_0x2f847f,_0x3d204e))['catch'](handleError(_0x2f847f,null));};exports['getScreenRecordings']=function(_0x46c497,_0x21bc55){var _0x3fbc90={'raw':!![],'where':{}};var _0x486cb9={};var _0x19710d={'count':0x0,'rows':[]};return db['User'][_0xa83a('0xbf')]({'where':{'id':_0x46c497[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x21bc55,null))['then'](function(_0x464c25){if(_0x464c25){_0x486cb9[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db[_0xa83a('0xd7')]['rawAttributes']);_0x486cb9[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x46c497[_0xa83a('0x3e')]);_0x486cb9[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x486cb9[_0xa83a('0xc8')],_0x486cb9['query']);_0x3fbc90[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x486cb9[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x46c497[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x3fbc90[_0xa83a('0x44')]=_0x3fbc90[_0xa83a('0x44')][_0xa83a('0x49')]?_0x3fbc90[_0xa83a('0x44')]:_0x486cb9[_0xa83a('0xc8')];if(!_0x46c497[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x3fbc90[_0xa83a('0x19')]=qs[_0xa83a('0x19')](_0x46c497['query']['limit']);_0x3fbc90[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0x46c497[_0xa83a('0x3e')][_0xa83a('0x17')]);}_0x3fbc90['order']=qs[_0xa83a('0xcd')](_0x46c497['query'][_0xa83a('0xcd')]);_0x3fbc90[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x46c497[_0xa83a('0x3e')],_0x486cb9[_0xa83a('0xce')]));_0x3fbc90['where']['UserId']=_0x464c25['id'];if(_0x46c497['query'][_0xa83a('0x2b')]){_0x3fbc90[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x3fbc90[_0xa83a('0xd0')],{'$or':_['map'](_0x3fbc90[_0xa83a('0x44')],function(_0x156273){var _0xcfb99={};_0xcfb99[_0x156273]={'$like':'%'+_0x46c497['query'][_0xa83a('0x2b')]+'%'};return _0xcfb99;})});}_0x3fbc90=_['merge']({},_0x3fbc90,_0x46c497['options']);return db[_0xa83a('0xd7')]['count']({'where':_0x3fbc90[_0xa83a('0xd0')]})[_0xa83a('0x1f')](function(_0x577042){_0x19710d[_0xa83a('0x1a')]=_0x577042;if(_0x46c497[_0xa83a('0x3e')][_0xa83a('0x3f')]){_0x3fbc90[_0xa83a('0x40')]=[{'all':!![]}];}return db[_0xa83a('0xd7')][_0xa83a('0x46')](_0x3fbc90);})['then'](function(_0x54faf4){_0x19710d[_0xa83a('0x47')]=_0x54faf4;return _0x19710d;});}})['then'](respondWithFilteredResult(_0x21bc55,_0x3fbc90))[_0xa83a('0x50')](handleError(_0x21bc55,null));};exports[_0xa83a('0xd8')]=function(_0x2c14c6,_0x1db827){var _0x143ec0={};var _0x4eda6a={};var _0x19e36a;var _0xf5e212;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x2c14c6[_0xa83a('0x52')]['id']}})['then'](handleEntityNotFound(_0x1db827,null))['then'](function(_0x17b829){if(_0x17b829){_0x19e36a=_0x17b829;_0x4eda6a[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db[_0xa83a('0xd9')][_0xa83a('0x36')]);_0x4eda6a[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x2c14c6[_0xa83a('0x3e')]);_0x4eda6a[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x4eda6a['model'],_0x4eda6a[_0xa83a('0x3e')]);_0x143ec0[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x4eda6a[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x2c14c6[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x143ec0[_0xa83a('0x44')]=_0x143ec0[_0xa83a('0x44')][_0xa83a('0x49')]?_0x143ec0[_0xa83a('0x44')]:_0x4eda6a['model'];_0x143ec0['order']=qs[_0xa83a('0xcd')](_0x2c14c6[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x143ec0[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x2c14c6[_0xa83a('0x3e')],_0x4eda6a[_0xa83a('0xce')]));if(_0x2c14c6[_0xa83a('0x3e')]['filter']){_0x143ec0[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x143ec0['where'],{'$or':_[_0xa83a('0x2d')](_0x143ec0[_0xa83a('0x44')],function(_0xe88201){var _0x35943a={};_0x35943a[_0xe88201]={'$like':'%'+_0x2c14c6[_0xa83a('0x3e')]['filter']+'%'};return _0x35943a;})});}_0x143ec0=_[_0xa83a('0x53')]({},_0x143ec0,_0x2c14c6[_0xa83a('0x54')]);return _0x19e36a[_0xa83a('0xd8')](_0x143ec0);}})[_0xa83a('0x1f')](function(_0x463914){if(_0x463914){_0xf5e212=_0x463914['length'];if(!_0x2c14c6[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x143ec0[_0xa83a('0x19')]=qs[_0xa83a('0x19')](_0x2c14c6[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x143ec0['offset']=qs['offset'](_0x2c14c6[_0xa83a('0x3e')]['offset']);}return _0x19e36a[_0xa83a('0xd8')](_0x143ec0);}})[_0xa83a('0x1f')](function(_0x517a77){if(_0x517a77){return _0x517a77?{'count':_0xf5e212,'rows':_0x517a77}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x1db827,null))['catch'](handleError(_0x1db827,null));};exports[_0xa83a('0xda')]=function(_0x50011f,_0x35e368){var _0x459403={};var _0x16ddaf={};var _0x1ac2d0;var _0x14cb18;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x50011f[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x35e368,null))[_0xa83a('0x1f')](function(_0x1a79d9){if(_0x1a79d9){_0x1ac2d0=_0x1a79d9;_0x16ddaf['model']=_[_0xa83a('0xc9')](db[_0xa83a('0xdb')][_0xa83a('0x36')]);_0x16ddaf[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x50011f[_0xa83a('0x3e')]);_0x16ddaf[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x16ddaf[_0xa83a('0xc8')],_0x16ddaf[_0xa83a('0x3e')]);_0x459403[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x16ddaf[_0xa83a('0xc8')],qs['fields'](_0x50011f[_0xa83a('0x3e')]['fields']));_0x459403[_0xa83a('0x44')]=_0x459403[_0xa83a('0x44')][_0xa83a('0x49')]?_0x459403[_0xa83a('0x44')]:_0x16ddaf['model'];_0x459403[_0xa83a('0xcc')]=qs['sort'](_0x50011f[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x459403[_0xa83a('0xd0')]=qs['filters'](_[_0xa83a('0xcf')](_0x50011f['query'],_0x16ddaf[_0xa83a('0xce')]));if(_0x50011f['query'][_0xa83a('0x2b')]){_0x459403[_0xa83a('0xd0')]=_['merge'](_0x459403[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x459403[_0xa83a('0x44')],function(_0x104cf4){var _0x5d3f01={};_0x5d3f01[_0x104cf4]={'$like':'%'+_0x50011f['query'][_0xa83a('0x2b')]+'%'};return _0x5d3f01;})});}_0x459403=_[_0xa83a('0x53')]({},_0x459403,_0x50011f['options']);return _0x1ac2d0[_0xa83a('0xda')](_0x459403);}})[_0xa83a('0x1f')](function(_0x16fe3d){if(_0x16fe3d){_0x14cb18=_0x16fe3d[_0xa83a('0x49')];if(!_0x50011f['query'][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x459403[_0xa83a('0x19')]=qs[_0xa83a('0x19')](_0x50011f[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x459403['offset']=qs['offset'](_0x50011f[_0xa83a('0x3e')]['offset']);}return _0x1ac2d0[_0xa83a('0xda')](_0x459403);}})[_0xa83a('0x1f')](function(_0x2488d4){if(_0x2488d4){return _0x2488d4?{'count':_0x14cb18,'rows':_0x2488d4}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x35e368,null))[_0xa83a('0x50')](handleError(_0x35e368,null));};exports[_0xa83a('0xdc')]=function(_0x152edc,_0x30e22f){var _0x5157be={'raw':!![],'where':{}};var _0xd9c3d0={};var _0x155f6c={'count':0x0,'rows':[]};return db[_0xa83a('0x35')]['findOne']({'where':{'id':_0x152edc[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x30e22f,null))[_0xa83a('0x1f')](function(_0xeb1667){if(_0xeb1667){_0xd9c3d0['model']=_[_0xa83a('0xc9')](db[_0xa83a('0xdd')][_0xa83a('0x36')]);_0xd9c3d0[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x152edc[_0xa83a('0x3e')]);_0xd9c3d0[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0xd9c3d0[_0xa83a('0xc8')],_0xd9c3d0['query']);_0x5157be['attributes']=_['intersection'](_0xd9c3d0[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x152edc[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x5157be[_0xa83a('0x44')]=_0x5157be['attributes'][_0xa83a('0x49')]?_0x5157be[_0xa83a('0x44')]:_0xd9c3d0['model'];if(!_0x152edc[_0xa83a('0x3e')]['hasOwnProperty'](_0xa83a('0xd4'))){_0x5157be[_0xa83a('0x19')]=qs['limit'](_0x152edc['query'][_0xa83a('0x19')]);_0x5157be['offset']=qs[_0xa83a('0x17')](_0x152edc['query'][_0xa83a('0x17')]);}_0x5157be['order']=qs[_0xa83a('0xcd')](_0x152edc[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x5157be[_0xa83a('0xd0')]=qs['filters'](_[_0xa83a('0xcf')](_0x152edc[_0xa83a('0x3e')],_0xd9c3d0['filters']));_0x5157be['where'][_0xa83a('0xde')]=_0xeb1667['id'];if(_0x152edc[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x5157be[_0xa83a('0xd0')]=_['merge'](_0x5157be[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x5157be[_0xa83a('0x44')],function(_0x88ca6c){var _0x5445a3={};_0x5445a3[_0x88ca6c]={'$like':'%'+_0x152edc[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x5445a3;})});}_0x5157be=_['merge']({},_0x5157be,_0x152edc[_0xa83a('0x54')]);return db[_0xa83a('0xdd')]['count']({'where':_0x5157be[_0xa83a('0xd0')]})[_0xa83a('0x1f')](function(_0x4d9085){_0x155f6c[_0xa83a('0x1a')]=_0x4d9085;if(_0x152edc[_0xa83a('0x3e')]['includeAll']){_0x5157be['include']=[{'all':!![]}];}return db[_0xa83a('0xdd')][_0xa83a('0x46')](_0x5157be);})[_0xa83a('0x1f')](function(_0x2db290){_0x155f6c['rows']=_0x2db290;return _0x155f6c;});}})[_0xa83a('0x1f')](respondWithFilteredResult(_0x30e22f,_0x5157be))[_0xa83a('0x50')](handleError(_0x30e22f,null));};exports[_0xa83a('0xdf')]=function(_0xc8a910,_0x4d55d9){var _0x59b428={};var _0x3ddce0={};var _0x561606;var _0x4e2619;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0xc8a910[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x4d55d9,null))['then'](function(_0x281aac){if(_0x281aac){_0x561606=_0x281aac;_0x3ddce0[_0xa83a('0xc8')]=_['keys'](db[_0xa83a('0xe0')][_0xa83a('0x36')]);_0x3ddce0[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0xc8a910[_0xa83a('0x3e')]);_0x3ddce0[_0xa83a('0xce')]=_['intersection'](_0x3ddce0['model'],_0x3ddce0[_0xa83a('0x3e')]);_0x59b428[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x3ddce0['model'],qs['fields'](_0xc8a910[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x59b428[_0xa83a('0x44')]=_0x59b428[_0xa83a('0x44')][_0xa83a('0x49')]?_0x59b428[_0xa83a('0x44')]:_0x3ddce0[_0xa83a('0xc8')];_0x59b428['order']=qs['sort'](_0xc8a910[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x59b428[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0xc8a910[_0xa83a('0x3e')],_0x3ddce0[_0xa83a('0xce')]));if(_0xc8a910[_0xa83a('0x3e')]['filter']){_0x59b428[_0xa83a('0xd0')]=_['merge'](_0x59b428['where'],{'$or':_[_0xa83a('0x2d')](_0x59b428['attributes'],function(_0x9f9dfa){var _0x8dadde={};_0x8dadde[_0x9f9dfa]={'$like':'%'+_0xc8a910[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x8dadde;})});}_0x59b428=_[_0xa83a('0x53')]({},_0x59b428,_0xc8a910['options']);return _0x561606[_0xa83a('0xdf')](_0x59b428);}})[_0xa83a('0x1f')](function(_0x2d0818){if(_0x2d0818){_0x4e2619=_0x2d0818[_0xa83a('0x49')];if(!_0xc8a910[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x59b428[_0xa83a('0x19')]=qs['limit'](_0xc8a910[_0xa83a('0x3e')]['limit']);_0x59b428[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0xc8a910[_0xa83a('0x3e')][_0xa83a('0x17')]);}return _0x561606[_0xa83a('0xdf')](_0x59b428);}})[_0xa83a('0x1f')](function(_0x16f493){if(_0x16f493){return _0x16f493?{'count':_0x4e2619,'rows':_0x16f493}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x4d55d9,null))[_0xa83a('0x50')](handleError(_0x4d55d9,null));};exports[_0xa83a('0xe1')]=function(_0xbcf66d,_0x999227){var _0x49d4ac={};var _0x2f1a98={};var _0x4dad0a;var _0x11b2d1;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0xbcf66d['params']['id']}})['then'](handleEntityNotFound(_0x999227,null))[_0xa83a('0x1f')](function(_0x5a8c37){if(_0x5a8c37){_0x4dad0a=_0x5a8c37;_0x2f1a98['model']=_[_0xa83a('0xc9')](db[_0xa83a('0xe2')][_0xa83a('0x36')]);_0x2f1a98[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0xbcf66d[_0xa83a('0x3e')]);_0x2f1a98['filters']=_[_0xa83a('0xd3')](_0x2f1a98[_0xa83a('0xc8')],_0x2f1a98[_0xa83a('0x3e')]);_0x49d4ac[_0xa83a('0x44')]=_[_0xa83a('0xd3')](_0x2f1a98['model'],qs[_0xa83a('0xcb')](_0xbcf66d[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x49d4ac[_0xa83a('0x44')]=_0x49d4ac['attributes'][_0xa83a('0x49')]?_0x49d4ac['attributes']:_0x2f1a98['model'];_0x49d4ac[_0xa83a('0xcc')]=qs['sort'](_0xbcf66d['query'][_0xa83a('0xcd')]);_0x49d4ac[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_['pick'](_0xbcf66d[_0xa83a('0x3e')],_0x2f1a98[_0xa83a('0xce')]));if(_0xbcf66d[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x49d4ac['where']=_[_0xa83a('0x53')](_0x49d4ac[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x49d4ac['attributes'],function(_0x1011c9){var _0x3405a0={};_0x3405a0[_0x1011c9]={'$like':'%'+_0xbcf66d[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x3405a0;})});}_0x49d4ac=_['merge']({},_0x49d4ac,_0xbcf66d[_0xa83a('0x54')]);return _0x4dad0a[_0xa83a('0xe1')](_0x49d4ac);}})[_0xa83a('0x1f')](function(_0x4e1cc7){if(_0x4e1cc7){_0x11b2d1=_0x4e1cc7[_0xa83a('0x49')];if(!_0xbcf66d[_0xa83a('0x3e')][_0xa83a('0xd1')]('nolimit')){_0x49d4ac[_0xa83a('0x19')]=qs[_0xa83a('0x19')](_0xbcf66d[_0xa83a('0x3e')]['limit']);_0x49d4ac[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0xbcf66d[_0xa83a('0x3e')]['offset']);}return _0x4dad0a[_0xa83a('0xe1')](_0x49d4ac);}})[_0xa83a('0x1f')](function(_0x18a7ea){if(_0x18a7ea){return _0x18a7ea?{'count':_0x11b2d1,'rows':_0x18a7ea}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x999227,null))[_0xa83a('0x50')](handleError(_0x999227,null));};exports[_0xa83a('0xe3')]=function(_0x45af47,_0x59c0bd){var _0x44c8e9={};var _0x3e4b1e={};var _0x22b245;var _0x45ffb2;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x45af47[_0xa83a('0x52')]['id']}})['then'](handleEntityNotFound(_0x59c0bd,null))[_0xa83a('0x1f')](function(_0x120860){if(_0x120860){_0x22b245=_0x120860;_0x3e4b1e[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db[_0xa83a('0xe4')]['rawAttributes']);_0x3e4b1e[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x45af47[_0xa83a('0x3e')]);_0x3e4b1e[_0xa83a('0xce')]=_['intersection'](_0x3e4b1e['model'],_0x3e4b1e[_0xa83a('0x3e')]);_0x44c8e9['attributes']=_[_0xa83a('0xd3')](_0x3e4b1e[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x45af47[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x44c8e9['attributes']=_0x44c8e9[_0xa83a('0x44')]['length']?_0x44c8e9[_0xa83a('0x44')]:_0x3e4b1e[_0xa83a('0xc8')];_0x44c8e9[_0xa83a('0xcc')]=qs[_0xa83a('0xcd')](_0x45af47['query']['sort']);_0x44c8e9[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x45af47['query'],_0x3e4b1e[_0xa83a('0xce')]));if(_0x45af47[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x44c8e9[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x44c8e9['where'],{'$or':_[_0xa83a('0x2d')](_0x44c8e9[_0xa83a('0x44')],function(_0x482769){var _0x70bd40={};_0x70bd40[_0x482769]={'$like':'%'+_0x45af47[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x70bd40;})});}_0x44c8e9=_['merge']({},_0x44c8e9,_0x45af47[_0xa83a('0x54')]);return _0x22b245['getWhatsappInteractions'](_0x44c8e9);}})[_0xa83a('0x1f')](function(_0x83da4b){if(_0x83da4b){_0x45ffb2=_0x83da4b['length'];if(!_0x45af47[_0xa83a('0x3e')][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x44c8e9['limit']=qs[_0xa83a('0x19')](_0x45af47['query']['limit']);_0x44c8e9['offset']=qs[_0xa83a('0x17')](_0x45af47['query']['offset']);}return _0x22b245[_0xa83a('0xe3')](_0x44c8e9);}})[_0xa83a('0x1f')](function(_0x1f1ce9){if(_0x1f1ce9){return _0x1f1ce9?{'count':_0x45ffb2,'rows':_0x1f1ce9}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x59c0bd,null))[_0xa83a('0x50')](handleError(_0x59c0bd,null));};exports[_0xa83a('0xe5')]=function(_0x2fce90,_0x20a4e2,_0x1a6779){var _0x5198e0;var _0x41fea8;var _0x57fa9b;var _0x452f4e=!_[_0xa83a('0x62')](_0x2fce90[_0xa83a('0x52')]['id'])?_0x2fce90[_0xa83a('0x52')]['id']:!_['isNil'](_0x2fce90[_0xa83a('0x28')]['id'])?_0x2fce90[_0xa83a('0x28')]['id']:null;return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x452f4e,'role':{'$or':[_0xa83a('0x26'),_0xa83a('0x28'),_0xa83a('0x21')]}},'attributes':['id',_0xa83a('0x34'),'phone',_0xa83a('0xe6'),_0xa83a('0x20'),_0xa83a('0x5c'),_0xa83a('0xe7')]})['then'](function(_0x6a04de){if(_0x6a04de){if(_0x6a04de['role']==='agent'){_0x5198e0=_0x6a04de;if(_0x2fce90[_0xa83a('0x56')][_0xa83a('0x91')]){_0x57fa9b=util[_0xa83a('0x9c')](_0xa83a('0xe8'),_0x5198e0[_0x2fce90[_0xa83a('0x56')][_0xa83a('0x91')]]);}else if(_0x2fce90[_0xa83a('0x56')][_0xa83a('0xe9')]){_0x57fa9b=util[_0xa83a('0x9c')](_0xa83a('0xea'),_0x2fce90[_0xa83a('0x56')][_0xa83a('0xe9')]);}else{_0x57fa9b=util[_0xa83a('0x9c')](_0xa83a('0xea'),_0x5198e0['name']);}socket['to'](util[_0xa83a('0x9c')](_0xa83a('0xeb'),_0x5198e0['name']))[_0xa83a('0x22')](_0xa83a('0xec'),{'user':{'id':_0x5198e0['id'],'name':_0x5198e0[_0xa83a('0x34')]},'ip':_0x2fce90['headers'][_0xa83a('0xed')]||_0x2fce90['connection'][_0xa83a('0xee')]||_0x2fce90[_0xa83a('0xef')]['remoteAddress']||_0x2fce90[_0xa83a('0xf0')][_0xa83a('0xef')][_0xa83a('0xee')]});return db[_0xa83a('0x9d')][_0xa83a('0x24')]({'where':{'membername':_0x5198e0['name']},'individualHooks':!![]});}}else{throw new db[(_0xa83a('0x83'))][(_0xa83a('0x84'))](_0xa83a('0xf1'));}})[_0xa83a('0x1f')](function(){if(_0x5198e0){return _0x5198e0['getVoiceQueues']({'raw':!![]});}})[_0xa83a('0x1f')](function(_0x527548){if(_0x5198e0){if(_0x527548){_0x41fea8=_0x527548;if(_0x41fea8[_0xa83a('0x49')]){var _0x668eac=_0x41fea8[_0xa83a('0x2d')](function(_0x44639b){var _0x2e3d5a={'membername':_0x5198e0[_0xa83a('0x34')],'UserId':_0x5198e0['id'],'queue_name':_0x44639b[_0xa83a('0x34')],'VoiceQueueId':_0x44639b['id'],'interface':_0x57fa9b,'paused':_0x5198e0[_0xa83a('0xe7')]||![],'penalty':_0x44639b['UserVoiceQueue.penalty']||0x0};return db[_0xa83a('0x9d')][_0xa83a('0x9e')](_0x2e3d5a);});return Promise[_0xa83a('0x4f')](_0x668eac);}}}})[_0xa83a('0x1f')](function(){if(_0x5198e0){return db[_0xa83a('0xf2')][_0xa83a('0x46')]({'where':{'membername':_0x5198e0[_0xa83a('0x34')],'exitAt':null}});}})[_0xa83a('0x1f')](function(_0x22c51e){if(_0x5198e0){var _0x160e38=[];_0x22c51e[_0xa83a('0xf3')](function(_0x57b1da){_0x160e38[_0xa83a('0x45')](_0x57b1da['update']({'exitAt':moment()['format'](_0xa83a('0xf4'))}));});return Promise[_0xa83a('0x4f')](_0x160e38);}})[_0xa83a('0x1f')](function(){if(_0x5198e0){var _0x22678a=[];var _0x452412=[];var _0x5cc581=utils[_0xa83a('0xf5')]();var _0x5ac481={'membername':_0x5198e0['name'],'interface':_0x57fa9b,'enterAt':moment()[_0xa83a('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5198e0[_0xa83a('0x20')],'internal':_0x5198e0[_0xa83a('0x5c')]};_0x5cc581[_0xa83a('0xf3')](function(_0x30f336){_0x22678a[_0xa83a('0x45')](_['merge']({'channel':_0x30f336,'type':_0xa83a('0xf6'),'data1':_0x2fce90[_0xa83a('0x56')][_0xa83a('0xf7')],'data2':_0x57fa9b},_0x5ac481));if(_0x5198e0[_0xa83a('0xe7')]){_0x452412[_0xa83a('0x45')](_[_0xa83a('0x53')]({'channel':_0x30f336,'type':_0xa83a('0xf8'),'data1':_0xa83a('0xf9')},_0x5ac481));}});return db['MemberReport'][_0xa83a('0x7a')](_0x22678a[_0xa83a('0xbd')](_0x452412),{'individualHooks':!![]});}})[_0xa83a('0x1f')](function(){if(_0x5198e0){return _0x5198e0[_0xa83a('0x1e')]({'online':!![],'lastLoginAt':moment()[_0xa83a('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5198e0[_0xa83a('0xe7')]||![],'mailPause':_0x5198e0[_0xa83a('0xe7')]||![],'chatPause':_0x5198e0[_0xa83a('0xe7')]||![],'faxPause':_0x5198e0[_0xa83a('0xe7')]||![],'smsPause':_0x5198e0[_0xa83a('0xe7')]||![],'openchannelPause':_0x5198e0['loginInPause']||![],'whatsappPause':_0x5198e0[_0xa83a('0xe7')]||![],'pauseType':_0x5198e0['loginInPause']?_0xa83a('0xf9'):null,'interface':_0x57fa9b,'lastPauseAt':moment()[_0xa83a('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xa83a('0x1f')](function(_0x5b3830){if(_0x2fce90[_0xa83a('0xfa')]){return _0x1a6779();}else{return Promise[_0xa83a('0xfb')](_0x5b3830)[_0xa83a('0x1f')](respondWithResult(_0x20a4e2,null));}})[_0xa83a('0x50')](handleError(_0x20a4e2,null));};exports[_0xa83a('0xfc')]=function(_0x2185d3,_0x364af3){var _0x2c4cdb;return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x2185d3[_0xa83a('0x52')]['id'],'role':'agent'},'attributes':['id',_0xa83a('0x34'),_0xa83a('0x20')]})[_0xa83a('0x1f')](handleEntityNotFound(_0x364af3,null))[_0xa83a('0x1f')](function(_0x50608d){if(_0x50608d){_0x2c4cdb=_0x50608d;return db[_0xa83a('0x9d')][_0xa83a('0x24')]({'where':{'membername':_0x2c4cdb[_0xa83a('0x34')]},'individualHooks':!![]});}})[_0xa83a('0x1f')](function(){return db[_0xa83a('0xf2')][_0xa83a('0x46')]({'where':{'membername':_0x2c4cdb[_0xa83a('0x34')],'exitAt':null}});})[_0xa83a('0x1f')](function(_0x43da06){var _0x3c63ec=[];_0x43da06['forEach'](function(_0x3d0530){_0x3c63ec[_0xa83a('0x45')](_0x3d0530[_0xa83a('0x1e')]({'exitAt':moment()[_0xa83a('0x9c')](_0xa83a('0xf4'))}));});return Promise['all'](_0x3c63ec);})[_0xa83a('0x1f')](function(){return _0x2c4cdb[_0xa83a('0x1e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x364af3,null))[_0xa83a('0x50')](handleError(_0x364af3,null));};exports[_0xa83a('0xfd')]=function(_0x15f5fa,_0x21c3b2){var _0x5ce635;return db['UserVoiceQueueRt'][_0xa83a('0x1e')]({'paused':0x1},{'where':{'UserId':_0x15f5fa[_0xa83a('0x52')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x15f5fa[_0xa83a('0x52')]['id'],'role':_0xa83a('0x21')},'attributes':['id',_0xa83a('0x34'),_0xa83a('0x20'),_0xa83a('0x5c'),_0xa83a('0x91'),'online']});})['then'](handleEntityNotFound(_0x21c3b2,null))['then'](function(_0x45ba3b){if(_0x45ba3b){_0x5ce635=_0x45ba3b;return db[_0xa83a('0xf2')][_0xa83a('0x46')]({'where':{'membername':_0x5ce635['name'],'type':'PAUSE','exitAt':null}});}})[_0xa83a('0x1f')](function(_0x1cf613){if(_0x1cf613['length']){var _0x2de7de=moment()[_0xa83a('0x9c')](_0xa83a('0xf4'));for(var _0x36a101=0x0,_0x1a0603=_0x1cf613[_0xa83a('0x49')];_0x36a101<_0x1a0603;_0x36a101++){_0x1cf613[_0x36a101]['updateAttributes']({'exitAt':_0x2de7de});}}})['then'](function(){var _0x2afcf0=[];var _0x50b0c4=utils[_0xa83a('0xf5')]();_0x50b0c4[_0xa83a('0xf3')](function(_0x5d9b48){_0x2afcf0[_0xa83a('0x45')]({'channel':_0x5d9b48,'membername':_0x5ce635[_0xa83a('0x34')],'interface':_[_0xa83a('0x62')](_0x5ce635[_0xa83a('0x91')])?util[_0xa83a('0x9c')](_0xa83a('0xea'),_0x5ce635[_0xa83a('0x34')]):_0x5ce635[_0xa83a('0x91')],'type':_0xa83a('0xf8'),'enterAt':moment()[_0xa83a('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x15f5fa[_0xa83a('0x56')][_0xa83a('0x38')]||_0xa83a('0xfe'),'role':_0x5ce635[_0xa83a('0x20')],'internal':_0x5ce635[_0xa83a('0x5c')]});});return db[_0xa83a('0xf2')]['bulkCreate'](_0x2afcf0,{'individualHooks':!![]});})[_0xa83a('0x1f')](function(){return _0x5ce635['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x15f5fa[_0xa83a('0x56')][_0xa83a('0x38')]||_0xa83a('0xfe'),'lastPauseAt':moment()[_0xa83a('0x9c')](_0xa83a('0xf4'))});})[_0xa83a('0x1f')](respondWithResult(_0x21c3b2,null))[_0xa83a('0x50')](handleError(_0x21c3b2,null));};exports[_0xa83a('0xff')]=function(_0x26c777,_0xc4eb4){if(_0x26c777[_0xa83a('0x56')]['channel']&&!utils[_0xa83a('0x92')](_0x26c777['body']['channel'])){throw new APIBadRequestError(util[_0xa83a('0x9c')](_0xa83a('0x100'),_0x26c777['body'][_0xa83a('0x8e')]));}return db[_0xa83a('0x35')][_0xa83a('0x57')]({'where':{'id':_0x26c777['params']['id']},'attributes':['id','name',_0xa83a('0x20'),'internal',_0xa83a('0x91'),_0xa83a('0x8f'),_0xa83a('0x90'),_0xa83a('0x101'),_0xa83a('0x102'),_0xa83a('0x103'),_0xa83a('0x104'),'smsPause','whatsappPause','pauseType',_0xa83a('0x105')]})['then'](function(_0x581487){if(!_0x581487){throw new APINotFoundError(util[_0xa83a('0x9c')](_0xa83a('0xc0'),_0x26c777[_0xa83a('0x52')]['id']));}return _0x581487[_0xa83a('0xff')](_0x26c777[_0xa83a('0x56')][_0xa83a('0x8e')]);})[_0xa83a('0x1f')](respondWithResult(_0xc4eb4,null))['catch'](APIHandleError(_0xc4eb4));};exports[_0xa83a('0x106')]=function(_0x11589b,_0x59f275){var _0x1b1e38={};var _0x30ed73={};var _0x5bc1d6;var _0x4244ec;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x11589b['params']['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x59f275,null))[_0xa83a('0x1f')](function(_0x10f8c5){if(_0x10f8c5){_0x5bc1d6=_0x10f8c5;_0x30ed73[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db[_0xa83a('0x107')]['rawAttributes']);_0x30ed73[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0x11589b[_0xa83a('0x3e')]);_0x30ed73[_0xa83a('0xce')]=_[_0xa83a('0xd3')](_0x30ed73[_0xa83a('0xc8')],_0x30ed73['query']);_0x1b1e38['attributes']=_[_0xa83a('0xd3')](_0x30ed73[_0xa83a('0xc8')],qs[_0xa83a('0xcb')](_0x11589b[_0xa83a('0x3e')]['fields']));_0x1b1e38['attributes']=_0x1b1e38[_0xa83a('0x44')][_0xa83a('0x49')]?_0x1b1e38[_0xa83a('0x44')]:_0x30ed73[_0xa83a('0xc8')];_0x1b1e38[_0xa83a('0xcc')]=qs[_0xa83a('0xcd')](_0x11589b[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x1b1e38[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x11589b['query'],_0x30ed73[_0xa83a('0xce')]));if(_0x11589b['query']['filter']){_0x1b1e38[_0xa83a('0xd0')]=_['merge'](_0x1b1e38[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x1b1e38[_0xa83a('0x44')],function(_0x4a8ee7){var _0x15eb20={};_0x15eb20[_0x4a8ee7]={'$like':'%'+_0x11589b['query'][_0xa83a('0x2b')]+'%'};return _0x15eb20;})});}_0x1b1e38=_['merge']({},_0x1b1e38,_0x11589b[_0xa83a('0x54')]);return _0x5bc1d6[_0xa83a('0x106')](_0x1b1e38);}})[_0xa83a('0x1f')](function(_0x441ffd){if(_0x441ffd){_0x4244ec=_0x441ffd['length'];if(!_0x11589b[_0xa83a('0x3e')][_0xa83a('0xd1')]('nolimit')){_0x1b1e38[_0xa83a('0x19')]=qs['limit'](_0x11589b[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x1b1e38['offset']=qs[_0xa83a('0x17')](_0x11589b['query']['offset']);}return _0x5bc1d6['getTeams'](_0x1b1e38);}})['then'](function(_0x640a2c){if(_0x640a2c){return _0x640a2c?{'count':_0x4244ec,'rows':_0x640a2c}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x59f275,null))[_0xa83a('0x50')](handleError(_0x59f275,null));};exports['addTeams']=function(_0x2d4603,_0x26b887){var _0xe79c4b=_0x2d4603[_0xa83a('0x52')]['id'];var _0x5b8afd=_0x2d4603['body']?_0x2d4603[_0xa83a('0x56')][_0xa83a('0x5a')]:null;var _0x1f945e=[];return Promise[_0xa83a('0xfb')]()[_0xa83a('0x1f')](function(){if(!_0x5b8afd)throw new APIBadRequestError(_0xa83a('0x108'));})[_0xa83a('0x1f')](function(){return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0xe79c4b}});})[_0xa83a('0x1f')](function(_0x434c80){if(!_0x434c80)throw new APINotFoundError(util[_0xa83a('0x9c')](_0xa83a('0xc0'),_0x2d4603[_0xa83a('0x52')]['id']));return db['sequelize']['transaction'](function(_0x119ec2){return _0x434c80['addTeams'](_0x5b8afd,{'transaction':_0x119ec2})[_0xa83a('0x1f')](function(){return db[_0xa83a('0x107')][_0xa83a('0x46')]({'where':{'id':{'$in':_0x5b8afd}}});})['then'](function(_0x63213b){var _0x1f84f4=_['map'](_0x63213b,function(_0x26468d){return _0x26468d['getAssociatedQueues']();});return Promise[_0xa83a('0x4f')](_0x1f84f4);})[_0xa83a('0x1f')](function(_0x22a6b6){_0x1f945e=_['flattenDeep'](_0x22a6b6);var _0x1cccc2=_[_0xa83a('0x2d')](_0x1f945e,function(_0x35c493){return _0x35c493[_0xa83a('0x109')](_0x434c80['id'],{'transaction':_0x119ec2});});return Promise[_0xa83a('0x4f')](_0x1cccc2);})[_0xa83a('0x1f')](function(){if(!_0x434c80[_0xa83a('0x8f')])return;var _0x1cc7c5=_[_0xa83a('0x2b')](_0x1f945e,function(_0x354fae){return _0x354fae[_0xa83a('0x10a')](_0xa83a('0x8e'))===_0xa83a('0x10b');});var _0x29c1b2=_[_0xa83a('0x2d')](_0x1cc7c5,function(_0x562413){return db[_0xa83a('0x9d')][_0xa83a('0x9e')]({'membername':_0x434c80['name'],'UserId':_0x434c80['id'],'queue_name':_0x562413[_0xa83a('0x34')],'VoiceQueueId':_0x562413['id'],'interface':_[_0xa83a('0x62')](_0x434c80['interface'])?util[_0xa83a('0x9c')](_0xa83a('0xea'),_0x434c80[_0xa83a('0x34')]):_0x434c80[_0xa83a('0x91')],'paused':_0x434c80[_0xa83a('0x90')]||![],'penalty':_0x434c80[_0xa83a('0x95')]},{'transaction':_0x119ec2});});return Promise[_0xa83a('0x4f')](_0x29c1b2);})['then'](function(){return db[_0xa83a('0x10c')][_0xa83a('0x46')]({'where':{'teamId':{'$in':_0x5b8afd}}});})[_0xa83a('0x1f')](function(_0x20817d){var _0xecf50d=_['map'](_0x20817d,function(_0x170c75){return db[_0xa83a('0x10d')][_0xa83a('0x71')]({'UserId':_0x434c80['id'],'VoicePrefixId':_0x170c75[_0xa83a('0x10e')]},{'transaction':_0x119ec2});});return Promise[_0xa83a('0x4f')](_0xecf50d);});});})[_0xa83a('0x1f')](function(){for(var _0x2d2ecc=0x0;_0x2d2ecc<_0x1f945e[_0xa83a('0x49')];_0x2d2ecc++){var _0x59890e=_0x1f945e[_0x2d2ecc][_0xa83a('0x10a')](_0xa83a('0x8e'));var _0x4d4761=_0x59890e+_0xa83a('0x98');socket[_0xa83a('0x22')](_0xa83a('0x28')+_0x59890e+_0xa83a('0x99'),{'UserId':_0xe79c4b,['queueField']:_0x1f945e[_0x2d2ecc]['id']});}})['then'](respondWithStatusCode(_0x26b887,null))[_0xa83a('0x50')](APIHandleError(_0x26b887));};exports[_0xa83a('0x10f')]=function(_0x46053b,_0x35e3d6){var _0x4ab05e=_0x46053b[_0xa83a('0x52')]['id'];var _0x441a44=null;if(_0x46053b[_0xa83a('0x3e')][_0xa83a('0x5a')]){_0x441a44=_[_0xa83a('0xa3')](_0x46053b['query']['ids'])?_0x46053b[_0xa83a('0x3e')][_0xa83a('0x5a')]:[_0x46053b[_0xa83a('0x3e')][_0xa83a('0x5a')]];}var _0x286159=[];return Promise[_0xa83a('0xfb')]()[_0xa83a('0x1f')](function(){if(!_0x441a44)throw new APIBadRequestError(_0xa83a('0x110'));})['then'](function(){return db['User']['findOne']({'where':{'id':_0x4ab05e}});})[_0xa83a('0x1f')](function(_0x2064a1){if(!_0x2064a1)throw new APINotFoundError(util[_0xa83a('0x9c')](_0xa83a('0xc0'),_0x46053b[_0xa83a('0x52')]['id']));return db[_0xa83a('0x63')]['transaction'](function(_0x24de33){return _0x2064a1['removeTeams'](_0x441a44,{'transaction':_0x24de33})[_0xa83a('0x1f')](function(){return db[_0xa83a('0x107')][_0xa83a('0x46')]({'where':{'id':{'$in':_0x441a44}}});})[_0xa83a('0x1f')](function(_0x1c8823){var _0x1e456c=_['map'](_0x1c8823,function(_0x297678){return _0x297678[_0xa83a('0x111')]();});return Promise['all'](_0x1e456c);})[_0xa83a('0x1f')](function(_0x4bed64){_0x286159=_[_0xa83a('0x112')](_0x4bed64);var _0x2e26b2=_[_0xa83a('0x2d')](_0x286159,function(_0x1fe8fb){return _0x1fe8fb['removeAgent'](_0x2064a1['id'],{'transaction':_0x24de33});});return Promise['all'](_0x2e26b2);})[_0xa83a('0x1f')](function(){if(!_0x2064a1[_0xa83a('0x8f')])return;var _0x237167=_[_0xa83a('0x2b')](_0x286159,function(_0x1dead1){return _0x1dead1['getDataValue'](_0xa83a('0x8e'))===_0xa83a('0x10b');});var _0x4d9188=_[_0xa83a('0x2d')](_0x237167,function(_0x44b777){return db[_0xa83a('0x9d')][_0xa83a('0x24')]({'where':{'VoiceQueueId':_0x44b777['id'],'UserId':_0x2064a1['id']},'transaction':_0x24de33});});return Promise[_0xa83a('0x4f')](_0x4d9188);})[_0xa83a('0x1f')](function(){return db['TeamVoicePrefix'][_0xa83a('0x46')]({'where':{'teamId':{'$in':_0x441a44}}});})['then'](function(_0x4577a7){var _0x1fca8e=_[_0xa83a('0x2d')](_0x4577a7,function(_0x5d6b83){return db['UserVoicePrefix'][_0xa83a('0x24')]({'where':{'UserId':_0x2064a1['id'],'VoicePrefixId':_0x5d6b83[_0xa83a('0x10e')]}},{'transaction':_0x24de33});});return Promise[_0xa83a('0x4f')](_0x1fca8e);});});})[_0xa83a('0x1f')](function(){for(var _0x2a75d1=0x0;_0x2a75d1<_0x286159['length'];_0x2a75d1++){var _0x2b4fd6=_0x286159[_0x2a75d1]['getDataValue'](_0xa83a('0x8e'));var _0x161e06=_0x2b4fd6+'QueueId';socket[_0xa83a('0x22')](_0xa83a('0x28')+_0x2b4fd6+_0xa83a('0xa4'),{'UserId':_0x4ab05e,['queueField']:_0x286159[_0x2a75d1]['id']});}})['then'](respondWithStatusCode(_0x35e3d6,null))['catch'](APIHandleError(_0x35e3d6));};exports[_0xa83a('0x113')]=function(_0x5a52d6,_0x3a18d0){var _0x578d1a={};var _0x2acbff={};var _0x1a9adf;var _0x3dcc5e;return db[_0xa83a('0x35')][_0xa83a('0xbf')]({'where':{'id':_0x5a52d6[_0xa83a('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a18d0,null))['then'](function(_0x33f2bd){if(_0x33f2bd){_0x1a9adf=_0x33f2bd;_0x2acbff[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db['CmList'][_0xa83a('0x36')]);_0x2acbff['query']=_[_0xa83a('0xc9')](_0x5a52d6[_0xa83a('0x3e')]);_0x2acbff['filters']=_[_0xa83a('0xd3')](_0x2acbff[_0xa83a('0xc8')],_0x2acbff[_0xa83a('0x3e')]);_0x578d1a['attributes']=_[_0xa83a('0xd3')](_0x2acbff[_0xa83a('0xc8')],qs['fields'](_0x5a52d6[_0xa83a('0x3e')]['fields']));_0x578d1a['attributes']=_0x578d1a[_0xa83a('0x44')][_0xa83a('0x49')]?_0x578d1a[_0xa83a('0x44')]:_0x2acbff[_0xa83a('0xc8')];_0x578d1a[_0xa83a('0xcc')]=qs[_0xa83a('0xcd')](_0x5a52d6[_0xa83a('0x3e')][_0xa83a('0xcd')]);_0x578d1a[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0x5a52d6['query'],_0x2acbff['filters']));if(_0x5a52d6[_0xa83a('0x3e')][_0xa83a('0x2b')]){_0x578d1a[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x578d1a['where'],{'$or':_[_0xa83a('0x2d')](_0x578d1a[_0xa83a('0x44')],function(_0x1c5fea){var _0x3f1c88={};_0x3f1c88[_0x1c5fea]={'$like':'%'+_0x5a52d6['query'][_0xa83a('0x2b')]+'%'};return _0x3f1c88;})});}_0x578d1a=_[_0xa83a('0x53')]({},_0x578d1a,_0x5a52d6[_0xa83a('0x54')]);return _0x1a9adf[_0xa83a('0x113')](_0x578d1a);}})[_0xa83a('0x1f')](function(_0x3bb485){if(_0x3bb485){_0x3dcc5e=_0x3bb485[_0xa83a('0x49')];if(!_0x5a52d6['query'][_0xa83a('0xd1')](_0xa83a('0xd4'))){_0x578d1a[_0xa83a('0x19')]=qs['limit'](_0x5a52d6[_0xa83a('0x3e')][_0xa83a('0x19')]);_0x578d1a[_0xa83a('0x17')]=qs[_0xa83a('0x17')](_0x5a52d6[_0xa83a('0x3e')][_0xa83a('0x17')]);}return _0x1a9adf[_0xa83a('0x113')](_0x578d1a);}})[_0xa83a('0x1f')](function(_0x459c62){if(_0x459c62){return _0x459c62?{'count':_0x3dcc5e,'rows':_0x459c62}:null;}})[_0xa83a('0x1f')](respondWithResult(_0x3a18d0,null))[_0xa83a('0x50')](handleError(_0x3a18d0,null));};exports[_0xa83a('0x114')]=function(_0xf8d43e,_0x42c6c4){var _0x5f4d3d={};var _0x254ed8={};var _0x482955;return db[_0xa83a('0x35')]['findOne']({'where':{'id':_0xf8d43e[_0xa83a('0x52')]['id']}})[_0xa83a('0x1f')](handleEntityNotFound(_0x42c6c4,null))[_0xa83a('0x1f')](function(_0x107eb5){if(_0x107eb5){_0x482955=_0x107eb5;_0x254ed8[_0xa83a('0xc8')]=_[_0xa83a('0xc9')](db['User'][_0xa83a('0x36')]);_0x254ed8[_0xa83a('0x3e')]=_[_0xa83a('0xc9')](_0xf8d43e['query']);_0x254ed8['filters']=_[_0xa83a('0xd3')](_0x254ed8[_0xa83a('0xc8')],_0x254ed8[_0xa83a('0x3e')]);_0x5f4d3d['attributes']=_[_0xa83a('0xd3')](_0x254ed8[_0xa83a('0xc8')],qs['fields'](_0xf8d43e[_0xa83a('0x3e')][_0xa83a('0xcb')]));_0x5f4d3d[_0xa83a('0x44')]=_0x5f4d3d[_0xa83a('0x44')][_0xa83a('0x49')]?_0x5f4d3d['attributes']:_0x254ed8[_0xa83a('0xc8')];_0x5f4d3d['order']=qs[_0xa83a('0xcd')](_0xf8d43e['query'][_0xa83a('0xcd')]);_0x5f4d3d[_0xa83a('0xd0')]=qs[_0xa83a('0xce')](_[_0xa83a('0xcf')](_0xf8d43e[_0xa83a('0x3e')],_0x254ed8[_0xa83a('0xce')]));if(_0xf8d43e[_0xa83a('0x3e')]['filter']){_0x5f4d3d[_0xa83a('0xd0')]=_[_0xa83a('0x53')](_0x5f4d3d[_0xa83a('0xd0')],{'$or':_[_0xa83a('0x2d')](_0x5f4d3d[_0xa83a('0x44')],function(_0x487f99){var _0x17100d={};_0x17100d[_0x487f99]={'$like':'%'+_0xf8d43e[_0xa83a('0x3e')][_0xa83a('0x2b')]+'%'};return _0x17100d;})});}_0x5f4d3d[_0xa83a('0xc8')]=db[_0xa83a('0x35')];_0x5f4d3d['as']=_0xa83a('0x29');_0x5f4d3d=_[_0xa83a('0x53')]({},_0x5f4d3d,_0xf8d43e[_0xa83a('0x54')]);return _0x482955[_0xa83a('0x115')]({'include':[_0x5f4d3d]});}})[_0xa83a('0x1f')](function(_0x2865b1){if(_0x2865b1){var _0x7aa7c={},_0x4cc935=[];for(var _0xf0cf4a=0x0;_0xf0cf4a<_0x2865b1[_0xa83a('0x49')];_0xf0cf4a+=0x1){for(var _0x46ef16=0x0,_0x5f5986;_0x46ef16<_0x2865b1[_0xf0cf4a][_0xa83a('0x29')][_0xa83a('0x49')];_0x46ef16+=0x1){_0x5f5986=_0x2865b1[_0xf0cf4a][_0xa83a('0x29')][_0x46ef16][_0xa83a('0x25')]({'plain':!![]});_0x7aa7c[_0x5f5986['id']]=_0x5f5986;}}_0x7aa7c=_['values'](_0x7aa7c);for(var _0x452549=qs[_0xa83a('0x17')](_0xf8d43e[_0xa83a('0x3e')][_0xa83a('0x17')]);_0x452549<_0x7aa7c[_0xa83a('0x49')]&&_0x4cc935['length']=_0x244906){_0x5bd955=_0x244906;_0x12e7ac=0xc8;}else{_0x12e7ac=0xce;}_0x4ad625[_0x0478('0x13')](_0x12e7ac);return _0x4ad625['set']('Content-Range',_0x5af34b+'-'+_0x5bd955+'/'+_0x244906)[_0x0478('0x14')](_0x2d43c3);}return null;};}function saveUpdates(_0x593e04){return function(_0x41dd94){if(_0x41dd94){return _0x41dd94[_0x0478('0x18')](_0x593e04)[_0x0478('0x19')](function(_0xd081c2){if(_0xd081c2[_0x0478('0x1a')]==='agent'){socket[_0x0478('0x1b')]('userNotification:recalc:'+_0xd081c2['id'],_0xd081c2);}return _0xd081c2;});}return null;};}function removeEntity(_0x75cee7){return function(_0x396c58){if(_0x396c58){return _0x396c58[_0x0478('0x1c')]()[_0x0478('0x19')](function(){var _0x2e1033=_0x396c58[_0x0478('0x1d')]({'plain':!![]});if(_0x2e1033[_0x0478('0x1a')]===_0x0478('0x1e'))return;var _0x423400=[{'name':_0x0478('0x1f'),'value':_0x0478('0x20'),'ignore':!![]},{'name':_0x0478('0x21'),'value':_0x0478('0x22'),'ignore':![]},{'name':'Telephones','value':_0x0478('0x23'),'ignore':![]}];var _0x420976=_(_0x423400)[_0x0478('0x24')](_0x0478('0x25'))['map'](_0x0478('0x26'))[_0x0478('0x26')]();if(_[_0x0478('0x27')](_0x420976,_0x2e1033[_0x0478('0x1a')])){return;}var _0xec4d44=_[_0x0478('0x28')](_0x423400,['value',_0x2e1033[_0x0478('0x1a')]])[_0x0478('0x29')];return db[_0x0478('0x2a')][_0x0478('0x1c')]({'where':{'type':_0xec4d44,'resourceId':_0x2e1033['id']}})[_0x0478('0x19')](function(){return _0x396c58;});})[_0x0478('0x19')](function(){_0x75cee7[_0x0478('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc849){return function(_0x390437){if(!_0x390437){_0x5dc849[_0x0478('0x12')](0x194);}return _0x390437;};}function handleError(_0x570c95,_0x3fa35e){_0x3fa35e=_0x3fa35e||0x1f4;return function(_0x5cd8b5){logger['error'](_0x5cd8b5[_0x0478('0x2b')]);if(_0x5cd8b5[_0x0478('0x29')]){delete _0x5cd8b5[_0x0478('0x29')];}_0x570c95[_0x0478('0x13')](_0x3fa35e)[_0x0478('0x2c')](_0x5cd8b5);};}function getUserAttributes(){return _(db[_0x0478('0x2d')][_0x0478('0x2e')])[_0x0478('0x2f')](function(_0xd557ed){return{'name':_0xd557ed['fieldName'],'type':_0xd557ed[_0x0478('0x30')][_0x0478('0x31')]};})['filter'](function(_0x135cad){return![_0x0478('0x32'),_0x0478('0x33'),_0x0478('0x34'),'resetPasswordToken',_0x0478('0x35'),_0x0478('0x36'),_0x0478('0x37')]['includes'](_0x135cad['name']);})[_0x0478('0x26')]();}exports[_0x0478('0x38')]=function(_0x1717db,_0x332de5){var _0x8b1dad={},_0x4cc1c4={'count':0x0,'rows':[]};var _0x4a2947=getUserAttributes();_0x8b1dad=qs[_0x0478('0x39')](_0x4a2947,_0x1717db);var _0x1c6834={'where':_0x8b1dad[_0x0478('0x3a')]};return db[_0x0478('0x2d')][_0x0478('0x17')](_0x1c6834)[_0x0478('0x19')](function(_0x469599){_0x4cc1c4[_0x0478('0x17')]=_0x469599;if(_0x1717db[_0x0478('0x3b')][_0x0478('0x3c')]){_0x8b1dad[_0x0478('0x3d')]=[{'all':!![]}];}if(_0x1717db[_0x0478('0x3b')][_0x0478('0x3e')]===_0x0478('0x3f')){_0x8b1dad[_0x0478('0x3d')]=[{'model':db[_0x0478('0x40')],'as':_0x0478('0x3e')}];}if(!_[_0x0478('0x27')](_0x8b1dad['attributes'],'id')){_0x8b1dad['attributes']['push']('id');}return db['User'][_0x0478('0x41')](_0x8b1dad);})[_0x0478('0x19')](function(_0x4d8554){_0x4cc1c4[_0x0478('0x42')]=_0x4d8554;if(_0x1717db['query'][_0x0478('0x43')]===_0x0478('0x3f')){var _0xb80de3=[];for(var _0x15f1fd=0x0;_0x15f1fd<_0x4cc1c4[_0x0478('0x42')][_0x0478('0x44')];_0x15f1fd++){_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x46'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd][_0x0478('0x47')]));_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x48'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd][_0x0478('0x47')]));_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x49'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd][_0x0478('0x47')]));_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x4a'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd][_0x0478('0x47')]));_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x4b'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd][_0x0478('0x47')]));_0xb80de3[_0x0478('0x45')](get_open_tabs(_0x0478('0x4c'),_0x4cc1c4[_0x0478('0x42')][_0x15f1fd]['dataValues']));}return Promise[_0x0478('0x4d')](_0xb80de3)[_0x0478('0x19')](function(){return _0x4cc1c4;});}else{return _0x4cc1c4;}})[_0x0478('0x19')](respondWithFilteredResult(_0x332de5,_0x8b1dad))[_0x0478('0x4e')](handleError(_0x332de5,null));};exports[_0x0478('0x4f')]=function(_0x99a8d4,_0x219a98){var _0xb78906=getUserAttributes();_0x99a8d4[_0x0478('0x3b')]['id']=_0x99a8d4[_0x0478('0x50')]['id'];var _0x1277eb=qs[_0x0478('0x39')](_0xb78906,_0x99a8d4);if(_0x99a8d4[_0x0478('0x3b')]['includeAll']){_0x1277eb[_0x0478('0x3d')]=[{'all':!![]}];}if(_0x99a8d4[_0x0478('0x3b')][_0x0478('0x3e')]===_0x0478('0x3f')){_0x1277eb[_0x0478('0x3d')]=[{'model':db[_0x0478('0x40')],'as':_0x0478('0x3e')}];}_0x1277eb=_['merge']({},_0x1277eb,_0x99a8d4[_0x0478('0x51')]);if(!_['includes'](_0x1277eb[_0x0478('0x52')],'id')){_0x1277eb['attributes'][_0x0478('0x45')]('id');}return db[_0x0478('0x2d')]['find'](_0x1277eb)[_0x0478('0x19')](handleEntityNotFound(_0x219a98,null))[_0x0478('0x19')](function(_0x1473a8){var _0x47127d=[];values=_0x1473a8;if(_0x99a8d4[_0x0478('0x3b')][_0x0478('0x43')]==='true'){_0x47127d['push'](get_open_tabs(_0x0478('0x46'),_0x1473a8['dataValues']));_0x47127d[_0x0478('0x45')](get_open_tabs(_0x0478('0x48'),_0x1473a8[_0x0478('0x47')]));_0x47127d[_0x0478('0x45')](get_open_tabs(_0x0478('0x4b'),_0x1473a8[_0x0478('0x47')]));_0x47127d['push'](get_open_tabs(_0x0478('0x4c'),_0x1473a8['dataValues']));_0x47127d[_0x0478('0x45')](get_open_tabs(_0x0478('0x49'),_0x1473a8[_0x0478('0x47')]));_0x47127d[_0x0478('0x45')](get_open_tabs('mail',_0x1473a8['dataValues']));return Promise[_0x0478('0x4d')](_0x47127d);}else{return values;}})[_0x0478('0x19')](function(){return values;})['then'](respondWithResult(_0x219a98,null))['catch'](handleError(_0x219a98,null));};exports['update']=function(_0x566007,_0x4f6e83){if(_0x566007[_0x0478('0x53')]['id']){delete _0x566007[_0x0478('0x53')]['id'];}delete _0x566007[_0x0478('0x53')]['role'];return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x566007[_0x0478('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f6e83,null))[_0x0478('0x19')](saveUpdates(_0x566007['body'],null))[_0x0478('0x19')](respondWithResult(_0x4f6e83,null))[_0x0478('0x4e')](handleError(_0x4f6e83,null));};exports[_0x0478('0x54')]=function(_0x2fa07e,_0x2c0597){return db[_0x0478('0x2d')][_0x0478('0x54')]()[_0x0478('0x19')](respondWithResult(_0x2c0597,null))[_0x0478('0x4e')](handleError(_0x2c0597,null));};exports[_0x0478('0x55')]=function(_0x1afc93,_0x301c13){return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x1afc93[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x301c13,null))[_0x0478('0x19')](function(_0x2d7f2f){if(_0x2d7f2f){return _0x2d7f2f['addContacts'](_0x1afc93[_0x0478('0x53')][_0x0478('0x56')],_[_0x0478('0x57')](_0x1afc93['body'],[_0x0478('0x56'),'id'])||{});}})[_0x0478('0x19')](respondWithResult(_0x301c13,null))[_0x0478('0x4e')](handleError(_0x301c13,null));};function validateUser(_0x24db28){return new Promise(function(_0x36ab16,_0x5d414a){if(_0x24db28[_0x0478('0x58')])return _0x36ab16(_0x24db28);return db[_0x0478('0x59')]['findById'](0x1)[_0x0478('0x19')](function(_0xa12e16){if(_0xa12e16['securePassword'])authService['validatePasswordPattern'](_0x24db28[_0x0478('0x32')]);db[_0x0478('0x2d')][_0x0478('0x5a')](_0x0478('0x58'))[_0x0478('0x19')](function(_0x45ed46){if(_[_0x0478('0x5b')](_0x45ed46)){_0x24db28[_0x0478('0x58')]=_0xa12e16[_0x0478('0x5c')]||0x1;return;}if(_[_0x0478('0x5b')](_0xa12e16[_0x0478('0x5c')])||_0xa12e16['min_internal']===_0x45ed46){_0x24db28['internal']=_0x45ed46+0x1;return;}if(_0xa12e16[_0x0478('0x5c')]>_0x45ed46){_0x24db28['internal']=_0xa12e16['min_internal'];return;}return db[_0x0478('0x5d')][_0x0478('0x3b')](_0x0478('0x5e'),{'type':db['sequelize'][_0x0478('0x5f')][_0x0478('0x60')]})[_0x0478('0x19')](function(_0x32b58f){if(_0x32b58f&&_0x32b58f['length']){for(var _0x4e8020=0x0,_0x42cb6a=_0x32b58f[_0x0478('0x44')];_0x4e8020<_0x42cb6a&&_['isNil'](_0x24db28[_0x0478('0x58')]);_0x4e8020++){if(_0xa12e16[_0x0478('0x5c')]<=_0x32b58f[_0x4e8020][_0x0478('0x61')]){_0x24db28[_0x0478('0x58')]=_0x32b58f[_0x4e8020][_0x0478('0x61')];}else if(_0xa12e16[_0x0478('0x5c')]>_0x32b58f[_0x4e8020]['from']&&_0xa12e16[_0x0478('0x5c')]<=_0x32b58f[_0x4e8020]['to']){_0x24db28['internal']=_0xa12e16[_0x0478('0x5c')];}}}if(_[_0x0478('0x5b')](_0x24db28['internal'])){_0x24db28[_0x0478('0x58')]=_0x45ed46+0x1;}return _0x36ab16(_0x24db28);});});})['catch'](function(_0x16fe13){_0x5d414a(_0x16fe13);});});}function updateUser(_0x3028df){return new Promise(function(_0x5cf8df,_0x4f7d4f){try{if(_0x3028df[_0x0478('0x62')]){_0x3028df[_0x0478('0x63')]=_0x3028df['internal'];_0x3028df['VoiceMail']={'mailbox':_0x3028df[_0x0478('0x58')],'password':_0x3028df['password'],'fullname':_0x3028df[_0x0478('0x64')],'email':_0x3028df[_0x0478('0x65')]};}if(_0x3028df[_0x0478('0x1a')]===_0x0478('0x22')){if(!_0x3028df[_0x0478('0x66')])_0x3028df['permissions']=[_0x0478('0x67'),_0x0478('0x68'),'103',_0x0478('0x69'),_0x0478('0x6a'),'104',_0x0478('0x6b'),_0x0478('0x6c'),_0x0478('0x6d'),'108',_0x0478('0x6e'),_0x0478('0x6f'),'111','114',_0x0478('0x70')];}_0x5cf8df(_0x3028df);}catch(_0x43b773){_0x4f7d4f(_0x43b773);}});}exports['create']=function(_0x32cf5d,_0x25ce78){if(_0x32cf5d['user']['role']==='agent')throw new Error('Unauthorized');if(_0x32cf5d[_0x0478('0x53')][_0x0478('0x1a')]===_0x0478('0x20')&&_0x32cf5d[_0x0478('0x20')]['role']!==_0x0478('0x1e')){throw new Error(_0x0478('0x71'));}if(_0x32cf5d[_0x0478('0x53')]['role']===_0x0478('0x1e')&&_0x32cf5d['user'][_0x0478('0x1a')]!==_0x0478('0x1e')){throw new Error(_0x0478('0x72'));}return licenseUtil['checkUserLimits']([_0x32cf5d[_0x0478('0x53')]])[_0x0478('0x19')](function(){return validateUser(_0x32cf5d[_0x0478('0x53')]);})[_0x0478('0x19')](function(_0x23ea64){return updateUser(_0x23ea64)[_0x0478('0x19')](function(_0x9e6ba7){if(_0x9e6ba7['role']==='admin'){_0x9e6ba7[_0x0478('0x73')]=_0x32cf5d['user'][_0x0478('0x73')];delete _0x9e6ba7[_0x0478('0x74')];}return _0x9e6ba7;});})[_0x0478('0x19')](function(_0xa0947){return db['User'][_0x0478('0x75')](_0xa0947,{'include':[{'model':db[_0x0478('0x76')],'as':_0x0478('0x76')}]});})[_0x0478('0x19')](function(_0x3a5227){if(_0x32cf5d[_0x0478('0x53')][_0x0478('0x1a')]===_0x0478('0x20'))return _0x3a5227;if(_0x32cf5d[_0x0478('0x20')]['role']!==_0x0478('0x20'))return _0x3a5227;return db[_0x0478('0x77')]['find']({'where':{'name':_0x3a5227[_0x0478('0x1a')]==='agent'?_0x0478('0x21'):'Telephones','userProfileId':_0x32cf5d[_0x0478('0x20')][_0x0478('0x74')]},'raw':!![]})[_0x0478('0x19')](function(_0x43686a){if(!_0x43686a||_0x43686a[_0x0478('0x78')]!=0x0)return _0x3a5227;return db['UserProfileResource'][_0x0478('0x75')]({'name':_0x3a5227[_0x0478('0x29')],'resourceId':_0x3a5227['id'],'type':_0x43686a[_0x0478('0x29')],'sectionId':_0x43686a['id']},{})[_0x0478('0x19')](function(){return _0x3a5227;});})[_0x0478('0x4e')](function(_0x1ea1d0){logger[_0x0478('0x79')](_0x0478('0x7a'),_0x1ea1d0);throw _0x1ea1d0;});})['then'](respondWithResult(_0x25ce78,0xc9))[_0x0478('0x4e')](handleError(_0x25ce78,null));};exports[_0x0478('0x7b')]=function(_0x5d9b79,_0x1345dc){var _0x23f8c8=_0x5d9b79['body'];var _0x43ceff=[];if(_0x5d9b79[_0x0478('0x20')][_0x0478('0x1a')]===_0x0478('0x22'))throw new Error(_0x0478('0x7c'));if(_[_0x0478('0x7d')](_0x23f8c8,[_0x0478('0x1a'),'user'])&&_0x5d9b79[_0x0478('0x20')]['role']!=='admin'){throw new Error(_0x0478('0x71'));}if(_['some'](_0x23f8c8,[_0x0478('0x1a'),_0x0478('0x1e')])&&_0x5d9b79[_0x0478('0x20')]['role']!==_0x0478('0x1e')){throw new Error(_0x0478('0x7e'));}return licenseUtil[_0x0478('0x7f')](_0x23f8c8)[_0x0478('0x19')](function(){return validateUser(_0x23f8c8[0x0]);})[_0x0478('0x19')](function(){for(var _0x3bfc8e=0x1;_0x3bfc8e<_0x23f8c8['length'];_0x3bfc8e++){var _0x2ebd62=_0x23f8c8[_0x3bfc8e-0x1][_0x0478('0x58')];if(!_0x23f8c8[_0x3bfc8e][_0x0478('0x58')])_0x23f8c8[_0x3bfc8e][_0x0478('0x58')]=_0x2ebd62+0x1;_0x43ceff[_0x0478('0x45')](validateUser(_0x23f8c8[_0x3bfc8e]));}return Promise[_0x0478('0x4d')](_0x43ceff);})[_0x0478('0x19')](function(){_0x43ceff=[];for(var _0x54b489=0x0;_0x54b489<_0x23f8c8[_0x0478('0x44')];_0x54b489++){_0x43ceff[_0x0478('0x45')](updateUser(_0x23f8c8[_0x54b489]));}return Promise[_0x0478('0x4d')](_0x43ceff);})[_0x0478('0x19')](function(){_0x43ceff=_0x23f8c8[_0x0478('0x2f')](function(_0x151c9c){return db[_0x0478('0x2d')]['create'](_0x151c9c,{'include':[{'model':db[_0x0478('0x76')],'as':_0x0478('0x76')}]})['then'](function(_0x1e48e1){_0x151c9c['id']=_0x1e48e1['id'];return _0x151c9c;});});return Promise[_0x0478('0x4d')](_0x43ceff);})[_0x0478('0x19')](function(_0x2fc632){if(_0x5d9b79['body'][_0x0478('0x1a')]===_0x0478('0x20'))return _0x2fc632;if(_0x5d9b79[_0x0478('0x20')][_0x0478('0x1a')]!=='user')return _0x2fc632;var _0x13379b=_[_0x0478('0x7d')](_0x2fc632,function(_0x498c10){return _0x498c10[_0x0478('0x1a')]===_0x0478('0x22')||_0x498c10[_0x0478('0x1a')]==='telephone';});if(!_0x13379b)return _0x2fc632;return db[_0x0478('0x77')]['findAll']({'where':{'name':{'$or':[_0x0478('0x21'),_0x0478('0x80')]},'userProfileId':_0x5d9b79[_0x0478('0x20')][_0x0478('0x74')]},'raw':!![]})[_0x0478('0x19')](function(_0x53fea8){if(_[_0x0478('0x81')](_0x53fea8)||!_[_0x0478('0x7d')](_0x53fea8,[_0x0478('0x78'),0x0]))return _0x2fc632;_0x43ceff=[];var _0x4a8fa8=_(_0x53fea8)['map'](function(_0x34da60){if(_0x34da60[_0x0478('0x78')]===0x1)return;return _0x34da60[_0x0478('0x29')]===_0x0478('0x21')?_0x0478('0x22'):_0x0478('0x23');})[_0x0478('0x82')]()[_0x0478('0x26')]();for(var _0x7f52f0=0x0;_0x7f52f0<_0x2fc632[_0x0478('0x44')];_0x7f52f0++){if(!_['includes'](_0x4a8fa8,_0x2fc632[_0x7f52f0][_0x0478('0x1a')]))return;var _0x395f0c=_0x2fc632[_0x7f52f0][_0x0478('0x1a')]===_0x0478('0x22')?_0x0478('0x21'):'Telephones';_0x43ceff['push'](db[_0x0478('0x2a')]['create']({'name':_0x2fc632[_0x7f52f0]['name'],'resourceId':_0x2fc632[_0x7f52f0]['id'],'type':_0x395f0c,'sectionId':_[_0x0478('0x28')](_0x53fea8,[_0x0478('0x29'),_0x395f0c])['id']},{}));}return Promise[_0x0478('0x4d')](_0x43ceff);});})['then'](respondWithResult(_0x1345dc,0xc9))[_0x0478('0x4e')](handleError(_0x1345dc,null));};exports['changePassword']=function(_0x98a3a3,_0x260c6b){if(_0x98a3a3['body']['id']){delete _0x98a3a3[_0x0478('0x53')]['id'];}return db['User'][_0x0478('0x28')]({'where':{'id':_0x98a3a3['params']['id']}})[_0x0478('0x19')](function(_0x590559){if(!_0x590559)return null;if(_0x590559['id']===_0x98a3a3['user']['id']){if(!_0x98a3a3[_0x0478('0x53')][_0x0478('0x83')]||!_0x98a3a3['body'][_0x0478('0x84')]){throw new db['Sequelize']['ValidationError'](_0x0478('0x85'));}if(!_0x590559[_0x0478('0x86')](_0x98a3a3[_0x0478('0x53')][_0x0478('0x83')])){throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))](_0x0478('0x89'));}if(_0x98a3a3[_0x0478('0x53')][_0x0478('0x83')]===_0x98a3a3[_0x0478('0x53')][_0x0478('0x84')]){throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))](_0x0478('0x8a'));}}else if(_0x98a3a3['user'][_0x0478('0x1a')]==='admin'){if(!_0x98a3a3['body'][_0x0478('0x84')]){throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))](_0x0478('0x8b'));}}else if(_0x98a3a3['user'][_0x0478('0x1a')]===_0x0478('0x20')){if(!_0x98a3a3['body'][_0x0478('0x84')]){throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))](_0x0478('0x8b'));}if(_0x590559[_0x0478('0x1a')]!==_0x0478('0x22')){throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))]('Unauthorized');}}else{throw new db['Sequelize'][(_0x0478('0x88'))]('Unauthorized');}return _0x590559;})[_0x0478('0x19')](handleEntityNotFound(_0x260c6b,null))[_0x0478('0x19')](function(_0x5f14db){return db[_0x0478('0x59')]['findOne']({'attributes':['id',_0x0478('0x8c'),_0x0478('0x8d'),_0x0478('0x8e')]})[_0x0478('0x19')](function(_0x5af374){if(_0x5af374[_0x0478('0x8c')])authService[_0x0478('0x8f')](_0x98a3a3[_0x0478('0x53')]['newPassword']);if(!_0x5af374[_0x0478('0x8d')]||!_0x5f14db[_0x0478('0x34')])return _0x5f14db;authService[_0x0478('0x90')](_0x98a3a3[_0x0478('0x53')]['newPassword'],_0x5f14db[_0x0478('0x34')],_0x5af374[_0x0478('0x8e')]);return _0x5f14db;})[_0x0478('0x19')](saveUpdates({'password':_0x98a3a3[_0x0478('0x53')]['newPassword'],'passwordResetAt':_0x98a3a3[_0x0478('0x20')]['id']==_0x98a3a3['params']['id']?moment():null,'previousPasswords':authService[_0x0478('0x91')](_0x98a3a3['body'][_0x0478('0x84')],_0x5f14db[_0x0478('0x34')])},null));})[_0x0478('0x19')](respondWithResult(_0x260c6b,null))[_0x0478('0x4e')](handleError(_0x260c6b,null));};exports[_0x0478('0x92')]=function(_0x5614e8,_0x5d7ed1){var _0x28d7b7=_0x5614e8[_0x0478('0x53')][_0x0478('0x93')];return db['User'][_0x0478('0x28')]({'where':{'id':_0x5614e8[_0x0478('0x50')]['id']},'attributes':['id','name','role',_0x0478('0x94'),_0x0478('0x95'),_0x0478('0x96'),'interface']})[_0x0478('0x19')](handleEntityNotFound(_0x5d7ed1,null))['then'](function(_0xdfae57){if(_0xdfae57){if(!utils['isValidChannel'](_0x28d7b7)){throw new db[(_0x0478('0x87'))]['ValidationError'](_0x0478('0x97'));}return _0xdfae57[_0x0478('0x98')+_['capitalize'](_0x28d7b7['toLowerCase']())+'Queues'](_0x5614e8[_0x0478('0x53')][_0x0478('0x56')],{'penalty':_0x5614e8[_0x0478('0x53')][_0x0478('0x99')]||0x0})[_0x0478('0x9a')](function(_0x306c45){for(var _0x1e4fc0=0x0;_0x1e4fc0<_0x5614e8[_0x0478('0x53')][_0x0478('0x56')][_0x0478('0x44')];_0x1e4fc0+=0x1){var _0x303b66={'UserId':Number(_0x5614e8[_0x0478('0x50')]['id'])};_0x303b66[_[_0x0478('0x9b')](_0x28d7b7['toLowerCase']())+'QueueId']=Number(_0x5614e8[_0x0478('0x53')]['ids'][_0x1e4fc0]);socket['emit'](_0x0478('0x20')+_['capitalize'](_0x28d7b7['toLowerCase']())+'Queue:save',_0x303b66);}return _0x306c45;})[_0x0478('0x19')](function(){if(_0x28d7b7===_0x0478('0x9c')){return db['VoiceQueue'][_0x0478('0x41')]({'where':{'id':_0x5614e8['body'][_0x0478('0x56')]||[]},'raw':!![],'attributes':['id',_0x0478('0x29')]});}})[_0x0478('0x19')](function(_0x1ee6e5){var _0xec7fe=_0xdfae57[_0x0478('0x1d')]({'plain':!![]});var _0x516a02=[];if(_0x28d7b7===_0x0478('0x9c')&&_0xec7fe['role']===_0x0478('0x22')&&_0xec7fe[_0x0478('0x94')]){for(let _0x3b29ef=0x0;_0x3b29ef<_0x1ee6e5[_0x0478('0x44')];_0x3b29ef+=0x1){_0x516a02['push']({'membername':_0xec7fe[_0x0478('0x29')],'UserId':_0xec7fe['id'],'queue_name':_0x1ee6e5[_0x3b29ef][_0x0478('0x29')],'VoiceQueueId':_0x1ee6e5[_0x3b29ef]['id'],'interface':_[_0x0478('0x5b')](_0xec7fe[_0x0478('0x9d')])?util['format'](_0x0478('0x9e'),_0xec7fe[_0x0478('0x29')]):_0xec7fe[_0x0478('0x9d')],'paused':_0xec7fe[_0x0478('0x96')]||![],'penalty':_0x5614e8[_0x0478('0x53')][_0x0478('0x99')]||0x0});}return Promise[_0x0478('0x4d')](_0x516a02[_0x0478('0x2f')](function(_0x1df37a){return db[_0x0478('0x9f')][_0x0478('0xa0')](_0x1df37a);}));}return _0xdfae57;});}})[_0x0478('0x19')](respondWithStatusCode(_0x5d7ed1,null))[_0x0478('0x4e')](handleError(_0x5d7ed1,null));};exports['removeQueues']=function(_0x4c9d4d,_0x55c375){var _0x24e756,_0x4ab760;return db['User'][_0x0478('0x28')]({'where':{'id':_0x4c9d4d[_0x0478('0x50')]['id']},'attributes':['id',_0x0478('0x29'),_0x0478('0x1a')]})[_0x0478('0x19')](handleEntityNotFound(_0x55c375,null))['then'](function(_0x4061a2){if(_0x4061a2){_0x24e756=_0x4061a2;if(!_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')]||!utils[_0x0478('0xa1')](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')])){throw new db[(_0x0478('0x87'))]['ValidationError'](_0x0478('0x97'));}return _0x4061a2[_0x0478('0xa2')+_[_0x0478('0x9b')](_0x4c9d4d['query']['channel']['toLowerCase']())+_0x0478('0xa3')](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x56')]);}})['then'](function(_0x1a4b5f){if(_['isArray'](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x56')])){for(var _0x45e1e5=0x0;_0x45e1e5<_0x4c9d4d[_0x0478('0x3b')]['ids']['length'];_0x45e1e5+=0x1){_0x4ab760={'UserId':Number(_0x4c9d4d[_0x0478('0x50')]['id'])};_0x4ab760[_['capitalize'](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')][_0x0478('0xa4')]())+_0x0478('0xa5')]=Number(_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x56')][_0x45e1e5]);socket['emit']('user'+_['capitalize'](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')][_0x0478('0xa4')]())+'Queue:remove',_0x4ab760);}}else{_0x4ab760={'UserId':Number(_0x4c9d4d[_0x0478('0x50')]['id'])};_0x4ab760[_[_0x0478('0x9b')](_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')][_0x0478('0xa4')]())+_0x0478('0xa5')]=Number(_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x56')]);socket[_0x0478('0x1b')](_0x0478('0x20')+_['capitalize'](_0x4c9d4d[_0x0478('0x3b')]['channel'][_0x0478('0xa4')]())+'Queue:remove',_0x4ab760);}return _0x1a4b5f;})['then'](function(){if(_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x93')]===_0x0478('0x9c')){return db[_0x0478('0x9f')][_0x0478('0x1c')]({'where':{'UserId':_0x4c9d4d[_0x0478('0x50')]['id'],'VoiceQueueId':_0x4c9d4d[_0x0478('0x3b')][_0x0478('0x56')]},'individualHooks':!![]})[_0x0478('0x19')](function(){return _0x24e756;});}return _0x24e756;})[_0x0478('0x19')](respondWithStatusCode(_0x55c375,null))[_0x0478('0x4e')](handleError(_0x55c375,null));};exports[_0x0478('0xa6')]=function(_0x3137f7,_0x379d61){_0x3137f7[_0x0478('0x53')][_0x0478('0xa7')]=_0x3137f7[_0x0478('0xa8')][_0x0478('0xa9')];return db['User']['find']({'where':{'id':_0x3137f7[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x379d61,null))[_0x0478('0x19')](saveUpdates(_0x3137f7[_0x0478('0x53')],null))['then'](respondWithResult(_0x379d61,null))[_0x0478('0x4e')](handleError(_0x379d61,null));};exports[_0x0478('0xaa')]=function(_0x23dc10,_0x4dfa1b){var _0x298c6e=path[_0x0478('0xab')](config[_0x0478('0xac')],'server/files/images/logos/default_profile.png');return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x23dc10[_0x0478('0x50')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x0478('0x19')](handleEntityNotFound(_0x4dfa1b,null))[_0x0478('0x19')](function(_0x23bce7){if(_0x23bce7){if(_['isNil'](_0x23bce7[_0x0478('0xa7')])){return _0x4dfa1b[_0x0478('0xad')](_0x298c6e);}else{if(!fs[_0x0478('0xae')](path['join'](config[_0x0478('0xac')],_0x0478('0xaf'),_0x23bce7[_0x0478('0xa7')]))){return _0x4dfa1b[_0x0478('0xad')](_0x298c6e);}return _0x4dfa1b[_0x0478('0xad')](path[_0x0478('0xab')](config[_0x0478('0xac')],'server/files/images/',_0x23bce7[_0x0478('0xa7')]));}}})[_0x0478('0x4e')](handleError(_0x4dfa1b,null));};exports[_0x0478('0xb0')]=function(_0xbfd407,_0x3d371a){return db['User'][_0x0478('0x28')]({'where':{'id':_0xbfd407[_0x0478('0x50')]['id']},'attributes':['id']})[_0x0478('0x19')](handleEntityNotFound(_0x3d371a,null))[_0x0478('0x19')](function(_0x4d7fdf){var _0x515cd8=[];values=_0x4d7fdf[_0x0478('0x47')];_0x515cd8[_0x0478('0x45')](get_open_tabs(_0x0478('0x46'),_0x4d7fdf['dataValues']));_0x515cd8['push'](get_open_tabs(_0x0478('0x48'),_0x4d7fdf[_0x0478('0x47')]));_0x515cd8[_0x0478('0x45')](get_open_tabs(_0x0478('0x4b'),_0x4d7fdf['dataValues']));_0x515cd8[_0x0478('0x45')](get_open_tabs('whatsapp',_0x4d7fdf[_0x0478('0x47')]));_0x515cd8[_0x0478('0x45')](get_open_tabs(_0x0478('0x49'),_0x4d7fdf[_0x0478('0x47')]));_0x515cd8[_0x0478('0x45')](get_open_tabs(_0x0478('0x4a'),_0x4d7fdf[_0x0478('0x47')]));return Promise['all'](_0x515cd8);})['then'](function(_0x5ae191){if(_0x5ae191){var _0x159729=_[_0x0478('0x2f')](values[_0x0478('0xb1')],function(_0x13b6e2){return{'channel':_0x0478('0xb2'),'id':_0x13b6e2['id'],'createdAt':_0x13b6e2[_0x0478('0xb3')]};});var _0x28f086=_[_0x0478('0x2f')](values[_0x0478('0xb4')],function(_0x47bddd){return{'channel':'FAX','id':_0x47bddd['id'],'createdAt':_0x47bddd[_0x0478('0xb3')]};});var _0x25b50c=_[_0x0478('0x2f')](values[_0x0478('0xb5')],function(_0x3656cf){return{'channel':'OPENCHANNEL','id':_0x3656cf['id'],'createdAt':_0x3656cf[_0x0478('0xb3')]};});var _0x1846dc=_[_0x0478('0x2f')](values[_0x0478('0xb6')],function(_0x2b3efb){return{'channel':_0x0478('0xb7'),'id':_0x2b3efb['id'],'createdAt':_0x2b3efb[_0x0478('0xb3')]};});var _0xcd46e0=_[_0x0478('0x2f')](values[_0x0478('0xb8')],function(_0x1a18a3){return{'channel':'SMS','id':_0x1a18a3['id'],'createdAt':_0x1a18a3[_0x0478('0xb3')]};});var _0x8443fa=_['map'](values[_0x0478('0xb9')],function(_0x6c308d){return{'channel':_0x0478('0xba'),'id':_0x6c308d['id'],'createdAt':_0x6c308d['createdAt']};});var _0x7a2f4d=_['concat'](_0x159729,_0x28f086,_0x25b50c,_0x1846dc,_0xcd46e0,_0x8443fa);var _0x3386a7={'count':_0x7a2f4d[_0x0478('0x44')],'rows':_0x7a2f4d};return _0x3386a7;}else return null;})['then'](respondWithResult(_0x3d371a,null))[_0x0478('0x4e')](handleError(_0x3d371a,null));};exports['getContacts']=function(_0x4e4b23,_0x182e43){var _0x9bc56d={};return db[_0x0478('0x2d')]['findOne']({'where':{'id':_0x4e4b23[_0x0478('0x50')]['id']}})[_0x0478('0x19')](function(_0x260549){if(!_0x260549){throw new APINotFoundError(util[_0x0478('0xbb')](_0x0478('0xbc'),_0x4e4b23[_0x0478('0x50')]['id']));}return contacts[_0x0478('0x54')]();})[_0x0478('0x19')](function(_0x12d219){_0x4e4b23[_0x0478('0x3b')][_0x0478('0x2d')]=_0x4e4b23[_0x0478('0x50')]['id'];_0x9bc56d=qs[_0x0478('0x39')](_0x12d219,_0x4e4b23);if(_0x4e4b23[_0x0478('0x3b')]['hasOwnProperty'](_0x0478('0x3c'))){_0x9bc56d[_0x0478('0x3d')]=[{'model':db[_0x0478('0xbd')],'as':'List','required':![]},{'model':db[_0x0478('0xbe')],'as':'Tags','attributes':['id',_0x0478('0x29'),_0x0478('0xbf')],'where':_0x4e4b23['query'][_0x0478('0xc0')]?{'id':_0x4e4b23[_0x0478('0x3b')]['tag']}:undefined,'required':_0x4e4b23['query'][_0x0478('0xc0')]?!![]:![]}];}return contacts[_0x0478('0x41')](_0x4e4b23[_0x0478('0x3b')],_0x4e4b23[_0x0478('0x20')],_0x9bc56d,_0x12d219);})['then'](respondWithFilteredResult(_0x182e43,_0x9bc56d))['catch'](APIHandleError(_0x182e43));};exports[_0x0478('0xc1')]=function(_0x307ba9,_0x3a9630){var _0x5d7240;var _0x54b70c={};var _0x37e7b0;return db['User'][_0x0478('0xc2')]({'where':{'id':_0x307ba9[_0x0478('0x50')]['id']},'attributes':['id',_0x0478('0x29'),_0x0478('0x1a')]})[_0x0478('0x19')](handleEntityNotFound(_0x3a9630,null))[_0x0478('0x19')](function(_0x151ebf){if(!utils[_0x0478('0xa1')](_0x307ba9[_0x0478('0x3b')]['channel'])){throw new db[(_0x0478('0x87'))]['ValidationError'](_0x0478('0x97'));}_0x5d7240=_0x151ebf;var _0x24444f={};_0x24444f[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_[_0x0478('0x9b')](_0x307ba9[_0x0478('0x3b')][_0x0478('0x93')])+_0x0478('0xc5')]['rawAttributes']);_0x24444f['query']=_['keys'](_0x307ba9['query']);_0x24444f[_0x0478('0xc6')]=_['intersection'](_0x24444f[_0x0478('0xc3')],_0x24444f[_0x0478('0x3b')]);_0x54b70c[_0x0478('0x52')]=_['intersection'](_0x24444f[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x307ba9[_0x0478('0x3b')][_0x0478('0xc7')]));_0x54b70c['attributes']=_0x54b70c[_0x0478('0x52')]['length']?_0x54b70c[_0x0478('0x52')]:_0x24444f[_0x0478('0xc3')];_0x54b70c[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x307ba9['query']['sort']);_0x54b70c[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x307ba9['query'],_0x24444f[_0x0478('0xc6')]));if(_0x307ba9[_0x0478('0x3b')][_0x0478('0x24')]){_0x54b70c[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x54b70c[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x54b70c[_0x0478('0x52')],function(_0x3f127e){var _0x3bee6f={};_0x3bee6f[_0x3f127e]={'$like':'%'+_0x307ba9[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x3bee6f;})});}_0x54b70c=_[_0x0478('0xcb')]({},_0x54b70c,_0x307ba9[_0x0478('0x51')]);switch(_0x5d7240[_0x0478('0x1a')]){case _0x0478('0x1e'):return db[_['capitalize'](_0x307ba9['query']['channel'])+'Queue'][_0x0478('0x41')](_0x54b70c);case _0x0478('0x20'):case _0x0478('0x22'):return _0x5d7240['get'+_[_0x0478('0x9b')](_0x307ba9[_0x0478('0x3b')]['channel'])+_0x0478('0xa3')](_0x54b70c);default:throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))]('Unknown\x20role');}})['then'](function(_0x1e6d96){_0x37e7b0=_0x1e6d96[_0x0478('0x44')];if(!_0x307ba9['query'][_0x0478('0xcc')](_0x0478('0xcd'))){_0x54b70c[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x307ba9[_0x0478('0x3b')][_0x0478('0xce')]);_0x54b70c[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x307ba9[_0x0478('0x3b')]['offset']);}switch(_0x5d7240['role']){case'admin':return db[_[_0x0478('0x9b')](_0x307ba9[_0x0478('0x3b')][_0x0478('0x93')])+_0x0478('0xc5')]['findAll'](_0x54b70c);case _0x0478('0x20'):case _0x0478('0x22'):return _0x5d7240[_0x0478('0x1d')+_['capitalize'](_0x307ba9[_0x0478('0x3b')][_0x0478('0x93')])+_0x0478('0xa3')](_0x54b70c);}})[_0x0478('0x19')](function(_0x1287ce){return{'count':_0x37e7b0,'rows':_0x1287ce};})[_0x0478('0x19')](respondWithResult(_0x3a9630,null))['catch'](handleError(_0x3a9630,null));};exports[_0x0478('0xcf')]=function(_0xa8a6d6,_0x76aaba){var _0x384f36={};var _0x2f7eb5={};var _0x5d98f7;var _0x44c51c;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0xa8a6d6[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x76aaba,null))[_0x0478('0x19')](function(_0xf972b3){if(_0xf972b3){_0x5d98f7=_0xf972b3;_0x2f7eb5['model']=_[_0x0478('0xc4')](db[_0x0478('0x9f')][_0x0478('0x2e')]);_0x2f7eb5[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0xa8a6d6[_0x0478('0x3b')]);_0x2f7eb5[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x2f7eb5[_0x0478('0xc3')],_0x2f7eb5['query']);_0x384f36[_0x0478('0x52')]=_[_0x0478('0xd0')](_0x2f7eb5['model'],qs[_0x0478('0xc7')](_0xa8a6d6[_0x0478('0x3b')][_0x0478('0xc7')]));_0x384f36[_0x0478('0x52')]=_0x384f36[_0x0478('0x52')][_0x0478('0x44')]?_0x384f36['attributes']:_0x2f7eb5[_0x0478('0xc3')];_0x384f36[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0xa8a6d6[_0x0478('0x3b')][_0x0478('0xc9')]);_0x384f36[_0x0478('0x3a')]=qs['filters'](_[_0x0478('0xca')](_0xa8a6d6[_0x0478('0x3b')],_0x2f7eb5[_0x0478('0xc6')]));if(_0xa8a6d6[_0x0478('0x3b')]['filter']){_0x384f36[_0x0478('0x3a')]=_['merge'](_0x384f36[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x384f36[_0x0478('0x52')],function(_0x2c8559){var _0x1b8bb7={};_0x1b8bb7[_0x2c8559]={'$like':'%'+_0xa8a6d6[_0x0478('0x3b')]['filter']+'%'};return _0x1b8bb7;})});}_0x384f36=_['merge']({},_0x384f36,_0xa8a6d6[_0x0478('0x51')]);return _0x5d98f7[_0x0478('0xcf')](_0x384f36);}})[_0x0478('0x19')](function(_0x3c5fbc){if(_0x3c5fbc){_0x44c51c=_0x3c5fbc['length'];if(!_0xa8a6d6[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x384f36[_0x0478('0xce')]=qs[_0x0478('0xce')](_0xa8a6d6['query'][_0x0478('0xce')]);_0x384f36[_0x0478('0x15')]=qs[_0x0478('0x15')](_0xa8a6d6['query'][_0x0478('0x15')]);}return _0x5d98f7[_0x0478('0xcf')](_0x384f36);}})['then'](function(_0x529f4c){if(_0x529f4c){return _0x529f4c?{'count':_0x44c51c,'rows':_0x529f4c}:null;}})[_0x0478('0x19')](respondWithResult(_0x76aaba,null))['catch'](handleError(_0x76aaba,null));};exports[_0x0478('0xd1')]=function(_0x378d71,_0x892f69){var _0xce5928={};var _0x4ea7f3={};var _0x47468b;var _0x34fee2;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x378d71[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x892f69,null))['then'](function(_0x2e3195){if(_0x2e3195){_0x47468b=_0x2e3195;_0x4ea7f3[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_0x0478('0xd2')][_0x0478('0x2e')]);_0x4ea7f3[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x378d71[_0x0478('0x3b')]);_0x4ea7f3[_0x0478('0xc6')]=_['intersection'](_0x4ea7f3['model'],_0x4ea7f3[_0x0478('0x3b')]);_0xce5928['attributes']=_[_0x0478('0xd0')](_0x4ea7f3['model'],qs[_0x0478('0xc7')](_0x378d71['query'][_0x0478('0xc7')]));_0xce5928[_0x0478('0x52')]=_0xce5928[_0x0478('0x52')][_0x0478('0x44')]?_0xce5928['attributes']:_0x4ea7f3[_0x0478('0xc3')];_0xce5928[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x378d71[_0x0478('0x3b')]['sort']);_0xce5928[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x378d71[_0x0478('0x3b')],_0x4ea7f3['filters']));if(_0x378d71[_0x0478('0x3b')][_0x0478('0x24')]){_0xce5928[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0xce5928[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0xce5928[_0x0478('0x52')],function(_0x178496){var _0x11e502={};_0x11e502[_0x178496]={'$like':'%'+_0x378d71[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x11e502;})});}_0xce5928=_[_0x0478('0xcb')]({},_0xce5928,_0x378d71[_0x0478('0x51')]);return _0x47468b['getGroups'](_0xce5928);}})[_0x0478('0x19')](function(_0x2c122d){if(_0x2c122d){_0x34fee2=_0x2c122d[_0x0478('0x44')];if(!_0x378d71['query']['hasOwnProperty'](_0x0478('0xcd'))){_0xce5928['limit']=qs[_0x0478('0xce')](_0x378d71[_0x0478('0x3b')][_0x0478('0xce')]);_0xce5928['offset']=qs[_0x0478('0x15')](_0x378d71['query'][_0x0478('0x15')]);}return _0x47468b['getGroups'](_0xce5928);}})[_0x0478('0x19')](function(_0x296eee){if(_0x296eee){return _0x296eee?{'count':_0x34fee2,'rows':_0x296eee}:null;}})[_0x0478('0x19')](respondWithResult(_0x892f69,null))[_0x0478('0x4e')](handleError(_0x892f69,null));};exports[_0x0478('0xd3')]=function(_0x47956f,_0x2d4a74){var _0x1a5acb={'raw':!![],'where':{}};var _0x3aff4a={};var _0x149699={'count':0x0,'rows':[]};return db['User'][_0x0478('0xc2')]({'where':{'id':_0x47956f[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x2d4a74,null))[_0x0478('0x19')](function(_0x1f3ef7){if(_0x1f3ef7){_0x3aff4a['model']=_['keys'](db[_0x0478('0xd4')][_0x0478('0x2e')]);_0x3aff4a[_0x0478('0x3b')]=_['keys'](_0x47956f['query']);_0x3aff4a[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x3aff4a[_0x0478('0xc3')],_0x3aff4a['query']);_0x1a5acb['attributes']=_['intersection'](_0x3aff4a[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x47956f[_0x0478('0x3b')]['fields']));_0x1a5acb['attributes']=_0x1a5acb[_0x0478('0x52')]['length']?_0x1a5acb[_0x0478('0x52')]:_0x3aff4a[_0x0478('0xc3')];if(!_0x47956f[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x1a5acb[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x47956f[_0x0478('0x3b')][_0x0478('0xce')]);_0x1a5acb[_0x0478('0x15')]=qs['offset'](_0x47956f[_0x0478('0x3b')][_0x0478('0x15')]);}_0x1a5acb[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x47956f[_0x0478('0x3b')]['sort']);_0x1a5acb[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x47956f[_0x0478('0x3b')],_0x3aff4a['filters']));_0x1a5acb['where'][_0x0478('0xd5')]=_0x1f3ef7['id'];if(_0x47956f[_0x0478('0x3b')][_0x0478('0x24')]){_0x1a5acb['where']=_[_0x0478('0xcb')](_0x1a5acb[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x1a5acb[_0x0478('0x52')],function(_0x4fd8d7){var _0x5b2a4f={};_0x5b2a4f[_0x4fd8d7]={'$like':'%'+_0x47956f['query'][_0x0478('0x24')]+'%'};return _0x5b2a4f;})});}_0x1a5acb=_[_0x0478('0xcb')]({},_0x1a5acb,_0x47956f[_0x0478('0x51')]);return db[_0x0478('0xd4')][_0x0478('0x17')]({'where':_0x1a5acb[_0x0478('0x3a')]})[_0x0478('0x19')](function(_0x134787){_0x149699['count']=_0x134787;if(_0x47956f[_0x0478('0x3b')]['includeAll']){_0x1a5acb[_0x0478('0x3d')]=[{'all':!![]}];}return db[_0x0478('0xd4')][_0x0478('0x41')](_0x1a5acb);})[_0x0478('0x19')](function(_0x3cc81b){_0x149699['rows']=_0x3cc81b;return _0x149699;});}})[_0x0478('0x19')](respondWithFilteredResult(_0x2d4a74,_0x1a5acb))['catch'](handleError(_0x2d4a74,null));};exports[_0x0478('0xd6')]=function(_0x820f5a,_0x5c0d81){var _0x347a38={'raw':!![],'where':{}};var _0x12bc18={};var _0x143b8d={'count':0x0,'rows':[]};return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x820f5a[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x5c0d81,null))[_0x0478('0x19')](function(_0x4711ec){if(_0x4711ec){_0x12bc18[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_0x0478('0xd7')][_0x0478('0x2e')]);_0x12bc18[_0x0478('0x3b')]=_['keys'](_0x820f5a[_0x0478('0x3b')]);_0x12bc18[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x12bc18[_0x0478('0xc3')],_0x12bc18[_0x0478('0x3b')]);_0x347a38[_0x0478('0x52')]=_['intersection'](_0x12bc18['model'],qs[_0x0478('0xc7')](_0x820f5a[_0x0478('0x3b')]['fields']));_0x347a38[_0x0478('0x52')]=_0x347a38[_0x0478('0x52')]['length']?_0x347a38[_0x0478('0x52')]:_0x12bc18['model'];if(!_0x820f5a['query'][_0x0478('0xcc')](_0x0478('0xcd'))){_0x347a38[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x820f5a[_0x0478('0x3b')][_0x0478('0xce')]);_0x347a38[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x820f5a['query']['offset']);}_0x347a38[_0x0478('0xc8')]=qs['sort'](_0x820f5a['query']['sort']);_0x347a38['where']=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x820f5a[_0x0478('0x3b')],_0x12bc18[_0x0478('0xc6')]));_0x347a38[_0x0478('0x3a')][_0x0478('0xd5')]=_0x4711ec['id'];if(_0x820f5a[_0x0478('0x3b')]['filter']){_0x347a38[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x347a38[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x347a38['attributes'],function(_0x3bd616){var _0x57c56d={};_0x57c56d[_0x3bd616]={'$like':'%'+_0x820f5a[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x57c56d;})});}_0x347a38=_[_0x0478('0xcb')]({},_0x347a38,_0x820f5a['options']);return db['ScreenRecording']['count']({'where':_0x347a38[_0x0478('0x3a')]})[_0x0478('0x19')](function(_0x33c454){_0x143b8d['count']=_0x33c454;if(_0x820f5a['query'][_0x0478('0x3c')]){_0x347a38[_0x0478('0x3d')]=[{'all':!![]}];}return db[_0x0478('0xd7')][_0x0478('0x41')](_0x347a38);})[_0x0478('0x19')](function(_0x1ddf56){_0x143b8d[_0x0478('0x42')]=_0x1ddf56;return _0x143b8d;});}})[_0x0478('0x19')](respondWithFilteredResult(_0x5c0d81,_0x347a38))['catch'](handleError(_0x5c0d81,null));};exports[_0x0478('0xd8')]=function(_0x50660e,_0x3d2e70){var _0x236f5a={};var _0x18dbdd={};var _0x89992c;var _0x204639;return db[_0x0478('0x2d')]['findOne']({'where':{'id':_0x50660e[_0x0478('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d2e70,null))[_0x0478('0x19')](function(_0x12263c){if(_0x12263c){_0x89992c=_0x12263c;_0x18dbdd['model']=_[_0x0478('0xc4')](db[_0x0478('0xd9')][_0x0478('0x2e')]);_0x18dbdd[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x50660e[_0x0478('0x3b')]);_0x18dbdd[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x18dbdd[_0x0478('0xc3')],_0x18dbdd['query']);_0x236f5a[_0x0478('0x52')]=_['intersection'](_0x18dbdd[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x50660e[_0x0478('0x3b')]['fields']));_0x236f5a[_0x0478('0x52')]=_0x236f5a[_0x0478('0x52')]['length']?_0x236f5a[_0x0478('0x52')]:_0x18dbdd[_0x0478('0xc3')];_0x236f5a[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x50660e['query'][_0x0478('0xc9')]);_0x236f5a[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x50660e[_0x0478('0x3b')],_0x18dbdd['filters']));if(_0x50660e[_0x0478('0x3b')][_0x0478('0x24')]){_0x236f5a[_0x0478('0x3a')]=_['merge'](_0x236f5a['where'],{'$or':_[_0x0478('0x2f')](_0x236f5a['attributes'],function(_0x2ca743){var _0x1cb203={};_0x1cb203[_0x2ca743]={'$like':'%'+_0x50660e['query'][_0x0478('0x24')]+'%'};return _0x1cb203;})});}_0x236f5a=_[_0x0478('0xcb')]({},_0x236f5a,_0x50660e[_0x0478('0x51')]);return _0x89992c[_0x0478('0xd8')](_0x236f5a);}})[_0x0478('0x19')](function(_0x4d8a50){if(_0x4d8a50){_0x204639=_0x4d8a50[_0x0478('0x44')];if(!_0x50660e[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x236f5a[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x50660e['query'][_0x0478('0xce')]);_0x236f5a[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x50660e[_0x0478('0x3b')][_0x0478('0x15')]);}return _0x89992c['getChatInteractions'](_0x236f5a);}})[_0x0478('0x19')](function(_0x226cb0){if(_0x226cb0){return _0x226cb0?{'count':_0x204639,'rows':_0x226cb0}:null;}})[_0x0478('0x19')](respondWithResult(_0x3d2e70,null))[_0x0478('0x4e')](handleError(_0x3d2e70,null));};exports[_0x0478('0xda')]=function(_0x7c2657,_0x1e125d){var _0xf29121={};var _0x53c752={};var _0x3454e2;var _0x4609be;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x7c2657[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x1e125d,null))[_0x0478('0x19')](function(_0x4dff67){if(_0x4dff67){_0x3454e2=_0x4dff67;_0x53c752['model']=_[_0x0478('0xc4')](db[_0x0478('0xdb')][_0x0478('0x2e')]);_0x53c752[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x7c2657[_0x0478('0x3b')]);_0x53c752[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x53c752[_0x0478('0xc3')],_0x53c752['query']);_0xf29121[_0x0478('0x52')]=_['intersection'](_0x53c752[_0x0478('0xc3')],qs['fields'](_0x7c2657[_0x0478('0x3b')][_0x0478('0xc7')]));_0xf29121[_0x0478('0x52')]=_0xf29121['attributes'][_0x0478('0x44')]?_0xf29121[_0x0478('0x52')]:_0x53c752['model'];_0xf29121[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x7c2657[_0x0478('0x3b')][_0x0478('0xc9')]);_0xf29121['where']=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x7c2657['query'],_0x53c752[_0x0478('0xc6')]));if(_0x7c2657['query']['filter']){_0xf29121['where']=_[_0x0478('0xcb')](_0xf29121[_0x0478('0x3a')],{'$or':_['map'](_0xf29121[_0x0478('0x52')],function(_0x2ba71c){var _0x6470d0={};_0x6470d0[_0x2ba71c]={'$like':'%'+_0x7c2657[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x6470d0;})});}_0xf29121=_[_0x0478('0xcb')]({},_0xf29121,_0x7c2657[_0x0478('0x51')]);return _0x3454e2[_0x0478('0xda')](_0xf29121);}})['then'](function(_0x205fc8){if(_0x205fc8){_0x4609be=_0x205fc8[_0x0478('0x44')];if(!_0x7c2657[_0x0478('0x3b')][_0x0478('0xcc')]('nolimit')){_0xf29121[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x7c2657['query'][_0x0478('0xce')]);_0xf29121[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x7c2657[_0x0478('0x3b')]['offset']);}return _0x3454e2['getOpenchannelInteractions'](_0xf29121);}})[_0x0478('0x19')](function(_0x58d5e2){if(_0x58d5e2){return _0x58d5e2?{'count':_0x4609be,'rows':_0x58d5e2}:null;}})[_0x0478('0x19')](respondWithResult(_0x1e125d,null))[_0x0478('0x4e')](handleError(_0x1e125d,null));};exports['getMailInteractions']=function(_0x1612e8,_0x39f5f9){var _0x48ef02={'raw':!![],'where':{}};var _0x3558fe={};var _0x2a00b2={'count':0x0,'rows':[]};return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x1612e8['params']['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x39f5f9,null))[_0x0478('0x19')](function(_0x4caa90){if(_0x4caa90){_0x3558fe['model']=_[_0x0478('0xc4')](db['MailInteraction'][_0x0478('0x2e')]);_0x3558fe[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x1612e8[_0x0478('0x3b')]);_0x3558fe['filters']=_[_0x0478('0xd0')](_0x3558fe[_0x0478('0xc3')],_0x3558fe[_0x0478('0x3b')]);_0x48ef02[_0x0478('0x52')]=_['intersection'](_0x3558fe[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x1612e8[_0x0478('0x3b')][_0x0478('0xc7')]));_0x48ef02[_0x0478('0x52')]=_0x48ef02[_0x0478('0x52')][_0x0478('0x44')]?_0x48ef02[_0x0478('0x52')]:_0x3558fe[_0x0478('0xc3')];if(!_0x1612e8[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x48ef02[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x1612e8['query'][_0x0478('0xce')]);_0x48ef02[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x1612e8[_0x0478('0x3b')][_0x0478('0x15')]);}_0x48ef02[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x1612e8['query'][_0x0478('0xc9')]);_0x48ef02[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x1612e8[_0x0478('0x3b')],_0x3558fe[_0x0478('0xc6')]));_0x48ef02[_0x0478('0x3a')][_0x0478('0xd5')]=_0x4caa90['id'];if(_0x1612e8[_0x0478('0x3b')]['filter']){_0x48ef02[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x48ef02[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x48ef02['attributes'],function(_0x100f98){var _0x6e8f24={};_0x6e8f24[_0x100f98]={'$like':'%'+_0x1612e8[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x6e8f24;})});}_0x48ef02=_[_0x0478('0xcb')]({},_0x48ef02,_0x1612e8['options']);return db[_0x0478('0xdc')][_0x0478('0x17')]({'where':_0x48ef02[_0x0478('0x3a')]})[_0x0478('0x19')](function(_0x3cab1f){_0x2a00b2[_0x0478('0x17')]=_0x3cab1f;if(_0x1612e8[_0x0478('0x3b')][_0x0478('0x3c')]){_0x48ef02['include']=[{'all':!![]}];}return db['MailInteraction'][_0x0478('0x41')](_0x48ef02);})[_0x0478('0x19')](function(_0xf258c3){_0x2a00b2[_0x0478('0x42')]=_0xf258c3;return _0x2a00b2;});}})[_0x0478('0x19')](respondWithFilteredResult(_0x39f5f9,_0x48ef02))[_0x0478('0x4e')](handleError(_0x39f5f9,null));};exports[_0x0478('0xdd')]=function(_0x401331,_0x155796){var _0x9e79b5={};var _0x1bdc33={};var _0x271dfa;var _0x131913;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x401331[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x155796,null))[_0x0478('0x19')](function(_0x2ccafe){if(_0x2ccafe){_0x271dfa=_0x2ccafe;_0x1bdc33[_0x0478('0xc3')]=_[_0x0478('0xc4')](db['SmsInteraction'][_0x0478('0x2e')]);_0x1bdc33['query']=_[_0x0478('0xc4')](_0x401331['query']);_0x1bdc33[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x1bdc33[_0x0478('0xc3')],_0x1bdc33[_0x0478('0x3b')]);_0x9e79b5['attributes']=_[_0x0478('0xd0')](_0x1bdc33[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x401331['query'][_0x0478('0xc7')]));_0x9e79b5[_0x0478('0x52')]=_0x9e79b5['attributes'][_0x0478('0x44')]?_0x9e79b5[_0x0478('0x52')]:_0x1bdc33[_0x0478('0xc3')];_0x9e79b5['order']=qs[_0x0478('0xc9')](_0x401331[_0x0478('0x3b')][_0x0478('0xc9')]);_0x9e79b5['where']=qs['filters'](_[_0x0478('0xca')](_0x401331[_0x0478('0x3b')],_0x1bdc33[_0x0478('0xc6')]));if(_0x401331[_0x0478('0x3b')][_0x0478('0x24')]){_0x9e79b5[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x9e79b5[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x9e79b5[_0x0478('0x52')],function(_0x3a8d83){var _0x197254={};_0x197254[_0x3a8d83]={'$like':'%'+_0x401331[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x197254;})});}_0x9e79b5=_[_0x0478('0xcb')]({},_0x9e79b5,_0x401331[_0x0478('0x51')]);return _0x271dfa[_0x0478('0xdd')](_0x9e79b5);}})[_0x0478('0x19')](function(_0x1d6560){if(_0x1d6560){_0x131913=_0x1d6560['length'];if(!_0x401331[_0x0478('0x3b')][_0x0478('0xcc')]('nolimit')){_0x9e79b5[_0x0478('0xce')]=qs['limit'](_0x401331[_0x0478('0x3b')][_0x0478('0xce')]);_0x9e79b5[_0x0478('0x15')]=qs['offset'](_0x401331[_0x0478('0x3b')][_0x0478('0x15')]);}return _0x271dfa[_0x0478('0xdd')](_0x9e79b5);}})[_0x0478('0x19')](function(_0x437430){if(_0x437430){return _0x437430?{'count':_0x131913,'rows':_0x437430}:null;}})[_0x0478('0x19')](respondWithResult(_0x155796,null))[_0x0478('0x4e')](handleError(_0x155796,null));};exports[_0x0478('0xde')]=function(_0x48dfe0,_0x9f05f7){var _0x57f597={};var _0x2b1fd1={};var _0x41a14f;var _0x319cef;return db['User']['findOne']({'where':{'id':_0x48dfe0[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x9f05f7,null))['then'](function(_0x3939a7){if(_0x3939a7){_0x41a14f=_0x3939a7;_0x2b1fd1[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_0x0478('0xdf')][_0x0478('0x2e')]);_0x2b1fd1[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x48dfe0[_0x0478('0x3b')]);_0x2b1fd1[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x2b1fd1[_0x0478('0xc3')],_0x2b1fd1['query']);_0x57f597[_0x0478('0x52')]=_[_0x0478('0xd0')](_0x2b1fd1['model'],qs[_0x0478('0xc7')](_0x48dfe0[_0x0478('0x3b')]['fields']));_0x57f597[_0x0478('0x52')]=_0x57f597[_0x0478('0x52')]['length']?_0x57f597['attributes']:_0x2b1fd1[_0x0478('0xc3')];_0x57f597[_0x0478('0xc8')]=qs['sort'](_0x48dfe0[_0x0478('0x3b')]['sort']);_0x57f597['where']=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x48dfe0[_0x0478('0x3b')],_0x2b1fd1['filters']));if(_0x48dfe0['query'][_0x0478('0x24')]){_0x57f597[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x57f597[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x57f597[_0x0478('0x52')],function(_0x132598){var _0x62caea={};_0x62caea[_0x132598]={'$like':'%'+_0x48dfe0[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x62caea;})});}_0x57f597=_[_0x0478('0xcb')]({},_0x57f597,_0x48dfe0[_0x0478('0x51')]);return _0x41a14f[_0x0478('0xde')](_0x57f597);}})[_0x0478('0x19')](function(_0x6d1f7f){if(_0x6d1f7f){_0x319cef=_0x6d1f7f[_0x0478('0x44')];if(!_0x48dfe0[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x57f597[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x48dfe0['query'][_0x0478('0xce')]);_0x57f597[_0x0478('0x15')]=qs['offset'](_0x48dfe0['query']['offset']);}return _0x41a14f[_0x0478('0xde')](_0x57f597);}})[_0x0478('0x19')](function(_0x5ae8b1){if(_0x5ae8b1){return _0x5ae8b1?{'count':_0x319cef,'rows':_0x5ae8b1}:null;}})[_0x0478('0x19')](respondWithResult(_0x9f05f7,null))[_0x0478('0x4e')](handleError(_0x9f05f7,null));};exports[_0x0478('0xe0')]=function(_0x2020eb,_0xca9cc6){var _0x584578={};var _0x2fe738={};var _0x3dc6f7;var _0x336771;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x2020eb[_0x0478('0x50')]['id']}})['then'](handleEntityNotFound(_0xca9cc6,null))[_0x0478('0x19')](function(_0x13b825){if(_0x13b825){_0x3dc6f7=_0x13b825;_0x2fe738[_0x0478('0xc3')]=_[_0x0478('0xc4')](db['WhatsappInteraction'][_0x0478('0x2e')]);_0x2fe738[_0x0478('0x3b')]=_['keys'](_0x2020eb[_0x0478('0x3b')]);_0x2fe738[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x2fe738[_0x0478('0xc3')],_0x2fe738[_0x0478('0x3b')]);_0x584578[_0x0478('0x52')]=_['intersection'](_0x2fe738[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x2020eb[_0x0478('0x3b')][_0x0478('0xc7')]));_0x584578[_0x0478('0x52')]=_0x584578[_0x0478('0x52')]['length']?_0x584578[_0x0478('0x52')]:_0x2fe738['model'];_0x584578[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x2020eb[_0x0478('0x3b')][_0x0478('0xc9')]);_0x584578[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x2020eb[_0x0478('0x3b')],_0x2fe738['filters']));if(_0x2020eb[_0x0478('0x3b')][_0x0478('0x24')]){_0x584578[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x584578['where'],{'$or':_[_0x0478('0x2f')](_0x584578[_0x0478('0x52')],function(_0x173393){var _0x43b0c5={};_0x43b0c5[_0x173393]={'$like':'%'+_0x2020eb[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x43b0c5;})});}_0x584578=_[_0x0478('0xcb')]({},_0x584578,_0x2020eb['options']);return _0x3dc6f7[_0x0478('0xe0')](_0x584578);}})[_0x0478('0x19')](function(_0x240203){if(_0x240203){_0x336771=_0x240203[_0x0478('0x44')];if(!_0x2020eb[_0x0478('0x3b')][_0x0478('0xcc')](_0x0478('0xcd'))){_0x584578[_0x0478('0xce')]=qs[_0x0478('0xce')](_0x2020eb[_0x0478('0x3b')][_0x0478('0xce')]);_0x584578['offset']=qs['offset'](_0x2020eb['query'][_0x0478('0x15')]);}return _0x3dc6f7[_0x0478('0xe0')](_0x584578);}})[_0x0478('0x19')](function(_0xd39b31){if(_0xd39b31){return _0xd39b31?{'count':_0x336771,'rows':_0xd39b31}:null;}})['then'](respondWithResult(_0xca9cc6,null))[_0x0478('0x4e')](handleError(_0xca9cc6,null));};exports[_0x0478('0xe1')]=function(_0x3cbbb9,_0x23d39b,_0x1c8d5c){var _0x274f58;var _0x455a4f;var _0x5d76d8;var _0x2cd2d3=!_[_0x0478('0x5b')](_0x3cbbb9[_0x0478('0x50')]['id'])?_0x3cbbb9['params']['id']:!_['isNil'](_0x3cbbb9[_0x0478('0x20')]['id'])?_0x3cbbb9[_0x0478('0x20')]['id']:null;return db[_0x0478('0x2d')]['find']({'where':{'id':_0x2cd2d3,'role':{'$or':[_0x0478('0x1e'),_0x0478('0x20'),_0x0478('0x22')]}},'attributes':['id',_0x0478('0x29'),_0x0478('0xe2'),_0x0478('0xe3'),_0x0478('0x1a'),_0x0478('0x58'),_0x0478('0x95')]})[_0x0478('0x19')](function(_0x2d22a9){if(_0x2d22a9){if(_0x2d22a9[_0x0478('0x1a')]===_0x0478('0x22')){_0x274f58=_0x2d22a9;if(_0x3cbbb9[_0x0478('0x53')][_0x0478('0x9d')]){_0x5d76d8=util[_0x0478('0xbb')](_0x0478('0xe4'),_0x274f58[_0x3cbbb9[_0x0478('0x53')][_0x0478('0x9d')]]);}else if(_0x3cbbb9[_0x0478('0x53')][_0x0478('0xe5')]){_0x5d76d8=util['format'](_0x0478('0x9e'),_0x3cbbb9[_0x0478('0x53')][_0x0478('0xe5')]);}else{_0x5d76d8=util[_0x0478('0xbb')](_0x0478('0x9e'),_0x274f58['name']);}socket['to'](util['format'](_0x0478('0xe6'),_0x274f58[_0x0478('0x29')]))['emit']('user:forcelogout',{'user':{'id':_0x274f58['id'],'name':_0x274f58[_0x0478('0x29')]},'ip':_0x3cbbb9[_0x0478('0xe7')][_0x0478('0xe8')]||_0x3cbbb9[_0x0478('0xe9')][_0x0478('0xea')]||_0x3cbbb9[_0x0478('0xeb')][_0x0478('0xea')]||_0x3cbbb9[_0x0478('0xe9')][_0x0478('0xeb')]['remoteAddress']});return db[_0x0478('0x9f')]['destroy']({'where':{'membername':_0x274f58[_0x0478('0x29')]},'individualHooks':!![]});}}else{throw new db[(_0x0478('0x87'))][(_0x0478('0x88'))](_0x0478('0xec'));}})[_0x0478('0x19')](function(){if(_0x274f58){return _0x274f58[_0x0478('0xed')]({'raw':!![]});}})[_0x0478('0x19')](function(_0x4ae7ea){if(_0x274f58){if(_0x4ae7ea){_0x455a4f=_0x4ae7ea;if(_0x455a4f['length']){var _0x376a7f=_0x455a4f[_0x0478('0x2f')](function(_0xa561d){var _0x3361ba={'membername':_0x274f58[_0x0478('0x29')],'UserId':_0x274f58['id'],'queue_name':_0xa561d[_0x0478('0x29')],'VoiceQueueId':_0xa561d['id'],'interface':_0x5d76d8,'paused':_0x274f58['loginInPause']||![],'penalty':_0xa561d[_0x0478('0xee')]||0x0};return db[_0x0478('0x9f')][_0x0478('0xa0')](_0x3361ba);});return Promise[_0x0478('0x4d')](_0x376a7f);}}}})[_0x0478('0x19')](function(){if(_0x274f58){return db[_0x0478('0xef')][_0x0478('0x41')]({'where':{'membername':_0x274f58[_0x0478('0x29')],'exitAt':null}});}})[_0x0478('0x19')](function(_0x37ea00){if(_0x274f58){var _0xaded19=[];_0x37ea00[_0x0478('0xf0')](function(_0x2031f5){_0xaded19[_0x0478('0x45')](_0x2031f5['update']({'exitAt':moment()[_0x0478('0xbb')](_0x0478('0xf1'))}));});return Promise[_0x0478('0x4d')](_0xaded19);}})[_0x0478('0x19')](function(){if(_0x274f58){var _0x22493d=[];var _0x5e31bf=[];var _0x3e5d37=utils[_0x0478('0xf2')]();var _0x3f61d3={'membername':_0x274f58[_0x0478('0x29')],'interface':_0x5d76d8,'enterAt':moment()[_0x0478('0xbb')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x274f58[_0x0478('0x1a')],'internal':_0x274f58[_0x0478('0x58')]};_0x3e5d37[_0x0478('0xf0')](function(_0x1880c3){_0x22493d[_0x0478('0x45')](_['merge']({'channel':_0x1880c3,'type':_0x0478('0xf3'),'data1':_0x3cbbb9[_0x0478('0x53')][_0x0478('0xf4')],'data2':_0x5d76d8},_0x3f61d3));if(_0x274f58[_0x0478('0x95')]){_0x5e31bf[_0x0478('0x45')](_[_0x0478('0xcb')]({'channel':_0x1880c3,'type':_0x0478('0xf5'),'data1':_0x0478('0xf6')},_0x3f61d3));}});return db['MemberReport']['bulkCreate'](_0x22493d[_0x0478('0xf7')](_0x5e31bf),{'individualHooks':!![]});}})[_0x0478('0x19')](function(){if(_0x274f58){return _0x274f58[_0x0478('0x18')]({'online':!![],'lastLoginAt':moment()[_0x0478('0xbb')](_0x0478('0xf1')),'voicePause':_0x274f58[_0x0478('0x95')]||![],'mailPause':_0x274f58[_0x0478('0x95')]||![],'chatPause':_0x274f58[_0x0478('0x95')]||![],'faxPause':_0x274f58[_0x0478('0x95')]||![],'smsPause':_0x274f58[_0x0478('0x95')]||![],'openchannelPause':_0x274f58['loginInPause']||![],'whatsappPause':_0x274f58['loginInPause']||![],'pauseType':_0x274f58[_0x0478('0x95')]?_0x0478('0xf6'):null,'interface':_0x5d76d8,'lastPauseAt':moment()[_0x0478('0xbb')](_0x0478('0xf1'))});}})[_0x0478('0x19')](function(_0x410d38){if(_0x3cbbb9['isMiddleware']){return _0x1c8d5c();}else{return Promise[_0x0478('0xf8')](_0x410d38)['then'](respondWithResult(_0x23d39b,null));}})[_0x0478('0x4e')](handleError(_0x23d39b,null));};exports[_0x0478('0xf9')]=function(_0x84c4e9,_0x2667b1){var _0x3d33a6;return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x84c4e9[_0x0478('0x50')]['id'],'role':_0x0478('0x22')},'attributes':['id',_0x0478('0x29'),_0x0478('0x1a')]})[_0x0478('0x19')](handleEntityNotFound(_0x2667b1,null))['then'](function(_0x2bd790){if(_0x2bd790){_0x3d33a6=_0x2bd790;return db[_0x0478('0x9f')][_0x0478('0x1c')]({'where':{'membername':_0x3d33a6[_0x0478('0x29')]},'individualHooks':!![]});}})[_0x0478('0x19')](function(){return db['MemberReport'][_0x0478('0x41')]({'where':{'membername':_0x3d33a6[_0x0478('0x29')],'exitAt':null}});})[_0x0478('0x19')](function(_0xcd19fa){var _0x135aa9=[];_0xcd19fa[_0x0478('0xf0')](function(_0x53aa7c){_0x135aa9['push'](_0x53aa7c[_0x0478('0x18')]({'exitAt':moment()[_0x0478('0xbb')](_0x0478('0xf1'))}));});return Promise[_0x0478('0x4d')](_0x135aa9);})[_0x0478('0x19')](function(){return _0x3d33a6['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0478('0x19')](respondWithResult(_0x2667b1,null))[_0x0478('0x4e')](handleError(_0x2667b1,null));};exports[_0x0478('0xfa')]=function(_0x569315,_0x2988c8){var _0x4c6a1a;return db[_0x0478('0x9f')][_0x0478('0x18')]({'paused':0x1},{'where':{'UserId':_0x569315[_0x0478('0x50')]['id']},'individualHooks':!![]})[_0x0478('0x19')](function(){return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x569315[_0x0478('0x50')]['id'],'role':_0x0478('0x22')},'attributes':['id','name','role',_0x0478('0x58'),_0x0478('0x9d'),_0x0478('0x94')]});})[_0x0478('0x19')](handleEntityNotFound(_0x2988c8,null))[_0x0478('0x19')](function(_0xcee03){if(_0xcee03){_0x4c6a1a=_0xcee03;return db['MemberReport']['findAll']({'where':{'membername':_0x4c6a1a[_0x0478('0x29')],'type':_0x0478('0xf5'),'exitAt':null}});}})['then'](function(_0x1e428e){if(_0x1e428e[_0x0478('0x44')]){var _0x5d9b2d=moment()[_0x0478('0xbb')](_0x0478('0xf1'));for(var _0x43c4a8=0x0,_0xd5106b=_0x1e428e[_0x0478('0x44')];_0x43c4a8<_0xd5106b;_0x43c4a8++){_0x1e428e[_0x43c4a8][_0x0478('0xfb')]({'exitAt':_0x5d9b2d});}}})[_0x0478('0x19')](function(){var _0x28374f=[];var _0x22b2f5=utils['getChannels']();_0x22b2f5[_0x0478('0xf0')](function(_0x387950){_0x28374f['push']({'channel':_0x387950,'membername':_0x4c6a1a['name'],'interface':_[_0x0478('0x5b')](_0x4c6a1a[_0x0478('0x9d')])?util[_0x0478('0xbb')]('SIP/%s',_0x4c6a1a[_0x0478('0x29')]):_0x4c6a1a[_0x0478('0x9d')],'type':_0x0478('0xf5'),'enterAt':moment()[_0x0478('0xbb')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x569315[_0x0478('0x53')]['type']||'DEFAULT\x20PAUSE','role':_0x4c6a1a[_0x0478('0x1a')],'internal':_0x4c6a1a[_0x0478('0x58')]});});return db['MemberReport'][_0x0478('0x7b')](_0x28374f,{'individualHooks':!![]});})['then'](function(){return _0x4c6a1a[_0x0478('0x18')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x569315['body'][_0x0478('0x30')]||_0x0478('0xfc'),'lastPauseAt':moment()['format'](_0x0478('0xf1'))});})['then'](respondWithResult(_0x2988c8,null))[_0x0478('0x4e')](handleError(_0x2988c8,null));};exports[_0x0478('0xfd')]=function(_0x53ec6a,_0x20099f){if(_0x53ec6a[_0x0478('0x53')][_0x0478('0x93')]&&!utils[_0x0478('0xa1')](_0x53ec6a[_0x0478('0x53')][_0x0478('0x93')])){throw new APIBadRequestError(util[_0x0478('0xbb')](_0x0478('0xfe'),_0x53ec6a[_0x0478('0x53')][_0x0478('0x93')]));}return db[_0x0478('0x2d')][_0x0478('0x28')]({'where':{'id':_0x53ec6a[_0x0478('0x50')]['id']},'attributes':['id',_0x0478('0x29'),_0x0478('0x1a'),_0x0478('0x58'),_0x0478('0x9d'),_0x0478('0x94'),'voicePause',_0x0478('0xff'),_0x0478('0x100'),'faxPause',_0x0478('0x101'),_0x0478('0x102'),'whatsappPause',_0x0478('0x103'),_0x0478('0x104')]})[_0x0478('0x19')](function(_0x4f1ddc){if(!_0x4f1ddc){throw new APINotFoundError(util[_0x0478('0xbb')](_0x0478('0xbc'),_0x53ec6a[_0x0478('0x50')]['id']));}return _0x4f1ddc[_0x0478('0xfd')](_0x53ec6a['body']['channel']);})[_0x0478('0x19')](respondWithResult(_0x20099f,null))['catch'](APIHandleError(_0x20099f));};exports[_0x0478('0x105')]=function(_0x541b6d,_0x17de3d){var _0x4a72e7={};var _0x1c07f4={};var _0x11b9ce;var _0x38f930;return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x541b6d[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x17de3d,null))[_0x0478('0x19')](function(_0x4f5965){if(_0x4f5965){_0x11b9ce=_0x4f5965;_0x1c07f4[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_0x0478('0x106')][_0x0478('0x2e')]);_0x1c07f4['query']=_['keys'](_0x541b6d[_0x0478('0x3b')]);_0x1c07f4[_0x0478('0xc6')]=_[_0x0478('0xd0')](_0x1c07f4['model'],_0x1c07f4[_0x0478('0x3b')]);_0x4a72e7[_0x0478('0x52')]=_[_0x0478('0xd0')](_0x1c07f4[_0x0478('0xc3')],qs['fields'](_0x541b6d[_0x0478('0x3b')]['fields']));_0x4a72e7[_0x0478('0x52')]=_0x4a72e7[_0x0478('0x52')][_0x0478('0x44')]?_0x4a72e7[_0x0478('0x52')]:_0x1c07f4[_0x0478('0xc3')];_0x4a72e7[_0x0478('0xc8')]=qs['sort'](_0x541b6d[_0x0478('0x3b')][_0x0478('0xc9')]);_0x4a72e7['where']=qs[_0x0478('0xc6')](_['pick'](_0x541b6d['query'],_0x1c07f4[_0x0478('0xc6')]));if(_0x541b6d['query'][_0x0478('0x24')]){_0x4a72e7[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x4a72e7[_0x0478('0x3a')],{'$or':_['map'](_0x4a72e7[_0x0478('0x52')],function(_0x5a7181){var _0x5d25f4={};_0x5d25f4[_0x5a7181]={'$like':'%'+_0x541b6d[_0x0478('0x3b')][_0x0478('0x24')]+'%'};return _0x5d25f4;})});}_0x4a72e7=_[_0x0478('0xcb')]({},_0x4a72e7,_0x541b6d[_0x0478('0x51')]);return _0x11b9ce[_0x0478('0x105')](_0x4a72e7);}})[_0x0478('0x19')](function(_0x5a2d75){if(_0x5a2d75){_0x38f930=_0x5a2d75[_0x0478('0x44')];if(!_0x541b6d['query'][_0x0478('0xcc')](_0x0478('0xcd'))){_0x4a72e7[_0x0478('0xce')]=qs['limit'](_0x541b6d[_0x0478('0x3b')][_0x0478('0xce')]);_0x4a72e7[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x541b6d[_0x0478('0x3b')][_0x0478('0x15')]);}return _0x11b9ce[_0x0478('0x105')](_0x4a72e7);}})[_0x0478('0x19')](function(_0x4aaa0a){if(_0x4aaa0a){return _0x4aaa0a?{'count':_0x38f930,'rows':_0x4aaa0a}:null;}})[_0x0478('0x19')](respondWithResult(_0x17de3d,null))[_0x0478('0x4e')](handleError(_0x17de3d,null));};exports[_0x0478('0x107')]=function(_0x5a1d56,_0x1b6a21){var _0x47cbdd=_0x5a1d56[_0x0478('0x50')]['id'];var _0x512f95=_0x5a1d56[_0x0478('0x53')]?_0x5a1d56[_0x0478('0x53')]['ids']:null;var _0x4d4490=[];return Promise[_0x0478('0xf8')]()[_0x0478('0x19')](function(){if(!_0x512f95)throw new APIBadRequestError(_0x0478('0x108'));})[_0x0478('0x19')](function(){return db[_0x0478('0x2d')]['findOne']({'where':{'id':_0x47cbdd}});})['then'](function(_0x22eba2){if(!_0x22eba2)throw new APINotFoundError(util['format'](_0x0478('0xbc'),_0x5a1d56['params']['id']));return db[_0x0478('0x5d')][_0x0478('0x109')](function(_0x31e1e6){return _0x22eba2[_0x0478('0x107')](_0x512f95,{'transaction':_0x31e1e6})[_0x0478('0x19')](function(){return db[_0x0478('0x106')][_0x0478('0x41')]({'where':{'id':{'$in':_0x512f95}}});})['then'](function(_0x1d4b39){var _0x2acada=_[_0x0478('0x2f')](_0x1d4b39,function(_0x39987e){return _0x39987e['getAssociatedQueues']();});return Promise['all'](_0x2acada);})[_0x0478('0x19')](function(_0x3f0107){_0x4d4490=_[_0x0478('0x10a')](_0x3f0107);var _0x108ff0=_[_0x0478('0x2f')](_0x4d4490,function(_0x73704e){return _0x73704e[_0x0478('0x10b')](_0x22eba2['id'],{'transaction':_0x31e1e6});});return Promise['all'](_0x108ff0);})['then'](function(){if(!_0x22eba2['online'])return;var _0x25eb9c=_['filter'](_0x4d4490,function(_0xc60561){return _0xc60561[_0x0478('0x10c')](_0x0478('0x93'))===_0x0478('0x10d');});var _0x327a74=_[_0x0478('0x2f')](_0x25eb9c,function(_0x6e5378){return db['UserVoiceQueueRt'][_0x0478('0xa0')]({'membername':_0x22eba2[_0x0478('0x29')],'UserId':_0x22eba2['id'],'queue_name':_0x6e5378[_0x0478('0x29')],'VoiceQueueId':_0x6e5378['id'],'interface':_[_0x0478('0x5b')](_0x22eba2['interface'])?util[_0x0478('0xbb')](_0x0478('0x9e'),_0x22eba2[_0x0478('0x29')]):_0x22eba2[_0x0478('0x9d')],'paused':_0x22eba2[_0x0478('0x96')]||![],'penalty':_0x22eba2['penalty']},{'transaction':_0x31e1e6});});return Promise[_0x0478('0x4d')](_0x327a74);})['then'](function(){return db[_0x0478('0x10e')][_0x0478('0x41')]({'where':{'teamId':{'$in':_0x512f95}}});})['then'](function(_0xa7d511){var _0x4ae4e1=_[_0x0478('0x2f')](_0xa7d511,function(_0x57a9f2){return db[_0x0478('0x10f')]['create']({'UserId':_0x22eba2['id'],'VoicePrefixId':_0x57a9f2[_0x0478('0x110')]},{'transaction':_0x31e1e6});});return Promise[_0x0478('0x4d')](_0x4ae4e1);});});})[_0x0478('0x19')](function(){for(var _0xc79251=0x0;_0xc79251<_0x4d4490[_0x0478('0x44')];_0xc79251++){var _0x77df76=_0x4d4490[_0xc79251][_0x0478('0x10c')](_0x0478('0x93'));var _0x337b18=_0x77df76+'QueueId';socket[_0x0478('0x1b')]('user'+_0x77df76+_0x0478('0x111'),{'UserId':_0x47cbdd,['queueField']:_0x4d4490[_0xc79251]['id']});}})['then'](respondWithStatusCode(_0x1b6a21,null))[_0x0478('0x4e')](APIHandleError(_0x1b6a21));};exports[_0x0478('0x112')]=function(_0x1a42f2,_0x4b8181){var _0x346866=_0x1a42f2[_0x0478('0x50')]['id'];var _0x20b6b4=null;if(_0x1a42f2[_0x0478('0x3b')][_0x0478('0x56')]){_0x20b6b4=_[_0x0478('0x113')](_0x1a42f2[_0x0478('0x3b')][_0x0478('0x56')])?_0x1a42f2[_0x0478('0x3b')][_0x0478('0x56')]:[_0x1a42f2['query'][_0x0478('0x56')]];}var _0x513b82=[];return Promise[_0x0478('0xf8')]()[_0x0478('0x19')](function(){if(!_0x20b6b4)throw new APIBadRequestError(_0x0478('0x114'));})['then'](function(){return db[_0x0478('0x2d')][_0x0478('0xc2')]({'where':{'id':_0x346866}});})[_0x0478('0x19')](function(_0x3234e9){if(!_0x3234e9)throw new APINotFoundError(util[_0x0478('0xbb')](_0x0478('0xbc'),_0x1a42f2[_0x0478('0x50')]['id']));return db[_0x0478('0x5d')]['transaction'](function(_0x47ed80){return _0x3234e9[_0x0478('0x112')](_0x20b6b4,{'transaction':_0x47ed80})[_0x0478('0x19')](function(){return db[_0x0478('0x106')][_0x0478('0x41')]({'where':{'id':{'$in':_0x20b6b4}}});})['then'](function(_0x475dc4){var _0x403d6f=_['map'](_0x475dc4,function(_0x1e6ae0){return _0x1e6ae0[_0x0478('0x115')]();});return Promise['all'](_0x403d6f);})[_0x0478('0x19')](function(_0x210cc9){_0x513b82=_[_0x0478('0x10a')](_0x210cc9);var _0x5e29cf=_[_0x0478('0x2f')](_0x513b82,function(_0x200377){return _0x200377[_0x0478('0x116')](_0x3234e9['id'],{'transaction':_0x47ed80});});return Promise[_0x0478('0x4d')](_0x5e29cf);})[_0x0478('0x19')](function(){if(!_0x3234e9['online'])return;var _0x3fb39e=_[_0x0478('0x24')](_0x513b82,function(_0x2830ad){return _0x2830ad[_0x0478('0x10c')](_0x0478('0x93'))===_0x0478('0x10d');});var _0x39dbfe=_[_0x0478('0x2f')](_0x3fb39e,function(_0x12e7d8){return db[_0x0478('0x9f')]['destroy']({'where':{'VoiceQueueId':_0x12e7d8['id'],'UserId':_0x3234e9['id']},'transaction':_0x47ed80});});return Promise['all'](_0x39dbfe);})[_0x0478('0x19')](function(){return db[_0x0478('0x10e')][_0x0478('0x41')]({'where':{'teamId':{'$in':_0x20b6b4}}});})[_0x0478('0x19')](function(_0x4955b8){var _0x152b8a=_[_0x0478('0x2f')](_0x4955b8,function(_0x3ed00c){return db[_0x0478('0x10f')][_0x0478('0x1c')]({'where':{'UserId':_0x3234e9['id'],'VoicePrefixId':_0x3ed00c[_0x0478('0x110')]}},{'transaction':_0x47ed80});});return Promise[_0x0478('0x4d')](_0x152b8a);});});})[_0x0478('0x19')](function(){for(var _0xd653bb=0x0;_0xd653bb<_0x513b82[_0x0478('0x44')];_0xd653bb++){var _0x5ece87=_0x513b82[_0xd653bb][_0x0478('0x10c')](_0x0478('0x93'));var _0x3d5da1=_0x5ece87+_0x0478('0xa5');socket['emit'](_0x0478('0x20')+_0x5ece87+'Queue:remove',{'UserId':_0x346866,['queueField']:_0x513b82[_0xd653bb]['id']});}})[_0x0478('0x19')](respondWithStatusCode(_0x4b8181,null))[_0x0478('0x4e')](APIHandleError(_0x4b8181));};exports[_0x0478('0x117')]=function(_0x152a6b,_0x47257b){var _0x671ef4={};var _0x534b5a={};var _0x3c4d88;var _0x51b020;return db['User']['findOne']({'where':{'id':_0x152a6b[_0x0478('0x50')]['id']}})['then'](handleEntityNotFound(_0x47257b,null))[_0x0478('0x19')](function(_0xb5966b){if(_0xb5966b){_0x3c4d88=_0xb5966b;_0x534b5a[_0x0478('0xc3')]=_['keys'](db['CmList'][_0x0478('0x2e')]);_0x534b5a[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x152a6b[_0x0478('0x3b')]);_0x534b5a[_0x0478('0xc6')]=_['intersection'](_0x534b5a[_0x0478('0xc3')],_0x534b5a['query']);_0x671ef4['attributes']=_[_0x0478('0xd0')](_0x534b5a['model'],qs['fields'](_0x152a6b['query'][_0x0478('0xc7')]));_0x671ef4[_0x0478('0x52')]=_0x671ef4[_0x0478('0x52')]['length']?_0x671ef4[_0x0478('0x52')]:_0x534b5a[_0x0478('0xc3')];_0x671ef4[_0x0478('0xc8')]=qs['sort'](_0x152a6b[_0x0478('0x3b')][_0x0478('0xc9')]);_0x671ef4[_0x0478('0x3a')]=qs['filters'](_[_0x0478('0xca')](_0x152a6b[_0x0478('0x3b')],_0x534b5a[_0x0478('0xc6')]));if(_0x152a6b[_0x0478('0x3b')]['filter']){_0x671ef4['where']=_['merge'](_0x671ef4[_0x0478('0x3a')],{'$or':_[_0x0478('0x2f')](_0x671ef4[_0x0478('0x52')],function(_0xee527b){var _0x50a602={};_0x50a602[_0xee527b]={'$like':'%'+_0x152a6b['query'][_0x0478('0x24')]+'%'};return _0x50a602;})});}_0x671ef4=_[_0x0478('0xcb')]({},_0x671ef4,_0x152a6b['options']);return _0x3c4d88[_0x0478('0x117')](_0x671ef4);}})['then'](function(_0x58b4d8){if(_0x58b4d8){_0x51b020=_0x58b4d8['length'];if(!_0x152a6b['query'][_0x0478('0xcc')](_0x0478('0xcd'))){_0x671ef4[_0x0478('0xce')]=qs['limit'](_0x152a6b[_0x0478('0x3b')][_0x0478('0xce')]);_0x671ef4[_0x0478('0x15')]=qs[_0x0478('0x15')](_0x152a6b[_0x0478('0x3b')]['offset']);}return _0x3c4d88[_0x0478('0x117')](_0x671ef4);}})['then'](function(_0x4e95d7){if(_0x4e95d7){return _0x4e95d7?{'count':_0x51b020,'rows':_0x4e95d7}:null;}})[_0x0478('0x19')](respondWithResult(_0x47257b,null))[_0x0478('0x4e')](handleError(_0x47257b,null));};exports['getAgents']=function(_0x252e2f,_0x2dd600){var _0x504961={};var _0x1e76a5={};var _0x5cf507;return db[_0x0478('0x2d')]['findOne']({'where':{'id':_0x252e2f[_0x0478('0x50')]['id']}})[_0x0478('0x19')](handleEntityNotFound(_0x2dd600,null))[_0x0478('0x19')](function(_0xde525d){if(_0xde525d){_0x5cf507=_0xde525d;_0x1e76a5[_0x0478('0xc3')]=_[_0x0478('0xc4')](db[_0x0478('0x2d')]['rawAttributes']);_0x1e76a5[_0x0478('0x3b')]=_[_0x0478('0xc4')](_0x252e2f[_0x0478('0x3b')]);_0x1e76a5[_0x0478('0xc6')]=_['intersection'](_0x1e76a5[_0x0478('0xc3')],_0x1e76a5['query']);_0x504961[_0x0478('0x52')]=_['intersection'](_0x1e76a5[_0x0478('0xc3')],qs[_0x0478('0xc7')](_0x252e2f['query'][_0x0478('0xc7')]));_0x504961['attributes']=_0x504961['attributes'][_0x0478('0x44')]?_0x504961[_0x0478('0x52')]:_0x1e76a5[_0x0478('0xc3')];_0x504961[_0x0478('0xc8')]=qs[_0x0478('0xc9')](_0x252e2f[_0x0478('0x3b')]['sort']);_0x504961[_0x0478('0x3a')]=qs[_0x0478('0xc6')](_[_0x0478('0xca')](_0x252e2f[_0x0478('0x3b')],_0x1e76a5['filters']));if(_0x252e2f['query']['filter']){_0x504961[_0x0478('0x3a')]=_[_0x0478('0xcb')](_0x504961[_0x0478('0x3a')],{'$or':_['map'](_0x504961[_0x0478('0x52')],function(_0x5d219b){var _0x4c723a={};_0x4c723a[_0x5d219b]={'$like':'%'+_0x252e2f['query'][_0x0478('0x24')]+'%'};return _0x4c723a;})});}_0x504961[_0x0478('0xc3')]=db[_0x0478('0x2d')];_0x504961['as']='Agents';_0x504961=_['merge']({},_0x504961,_0x252e2f['options']);return _0x5cf507['getVoiceQueues']({'include':[_0x504961]});}})['then'](function(_0x467fa0){if(_0x467fa0){var _0xd725d={},_0x19074e=[];for(var _0x5c1a77=0x0;_0x5c1a77<_0x467fa0[_0x0478('0x44')];_0x5c1a77+=0x1){for(var _0xd2e74d=0x0,_0x1084cf;_0xd2e74d<_0x467fa0[_0x5c1a77][_0x0478('0x21')][_0x0478('0x44')];_0xd2e74d+=0x1){_0x1084cf=_0x467fa0[_0x5c1a77][_0x0478('0x21')][_0xd2e74d][_0x0478('0x1d')]({'plain':!![]});_0xd725d[_0x1084cf['id']]=_0x1084cf;}}_0xd725d=_['values'](_0xd725d);for(var _0x353835=qs[_0x0478('0x15')](_0x252e2f[_0x0478('0x3b')]['offset']);_0x353835<_0xd725d[_0x0478('0x44')]&&_0x19074e[_0x0478('0x44')]=_0x363060[_0x595b('0x4b')]){throw new Error(_0x595b('0x4c'));}})[_0x595b('0x19')](function(){if(_0x622f82){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x622f82[_0x595b('0x23')]},'individualHooks':!![]});}})[_0x595b('0x19')](function(){if(_0x622f82){return _0x622f82['getVoiceQueues']({'raw':!![]});}})[_0x595b('0x19')](function(_0x2f184){if(_0x622f82){if(_0x2f184){var _0x287518=[];_0x54301f=_0x2f184;if(_0x54301f[_0x595b('0x2d')]){for(var _0x159efd=0x0;_0x159efd<_0x54301f[_0x595b('0x2d')];_0x159efd++){_0x287518['push'](db[_0x595b('0x28')][_0x595b('0x4d')]({'membername':_0x622f82[_0x595b('0x23')],'UserId':_0x622f82['id'],'queue_name':_0x54301f[_0x159efd][_0x595b('0x23')],'VoiceQueueId':_0x54301f[_0x159efd]['id'],'interface':_0x26627e,'paused':_0x622f82[_0x595b('0x47')]||![],'penalty':_0x54301f[_0x159efd][_0x595b('0x4e')]||0x0}));}return BPromise[_0x595b('0x46')](_0x287518);}}}})[_0x595b('0x19')](function(){if(_0x622f82){return db[_0x595b('0x2a')][_0x595b('0x10')]({'where':{'membername':_0x622f82[_0x595b('0x23')],'exitAt':null}});}})[_0x595b('0x19')](function(_0x1d4f04){if(_0x622f82){if(_0x1d4f04&&_0x1d4f04[_0x595b('0x2d')]){var _0x332855=[];_0x1d4f04['forEach'](function(_0x4fe7f0){_0x332855[_0x595b('0x45')](_0x4fe7f0[_0x595b('0x29')]({'exitAt':moment()[_0x595b('0x26')](_0x595b('0x2c'))}));});return BPromise[_0x595b('0x46')](_0x332855);}}})['then'](function(){if(_0x622f82){var _0x4239fe=[];var _0x3bc583=[];var _0x538bfe=utils[_0x595b('0x2f')]();var _0x9aacc={'membername':_0x622f82[_0x595b('0x23')],'interface':_0x26627e,'enterAt':moment()[_0x595b('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x622f82[_0x595b('0x24')],'internal':_0x622f82[_0x595b('0x25')]};_0x538bfe[_0x595b('0x44')](function(_0x163cf3){_0x4239fe[_0x595b('0x45')](_[_0x595b('0x4f')]({'channel':_0x163cf3,'type':'LOGIN','data1':_0x595b('0x50'),'data2':_0x26627e},_0x9aacc));if(_0x622f82[_0x595b('0x47')]){_0x3bc583[_0x595b('0x45')](_[_0x595b('0x4f')]({'channel':_0x163cf3,'type':'PAUSE','data1':_0x595b('0x51')},_0x9aacc));}});return db['MemberReport']['bulkCreate'](_0x4239fe[_0x595b('0x52')](_0x3bc583),{'individualHooks':!![]});}})[_0x595b('0x19')](function(){if(_0x622f82){return _0x622f82[_0x595b('0x29')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x622f82[_0x595b('0x47')]||![],'mailPause':_0x622f82['loginInPause']||![],'chatPause':_0x622f82[_0x595b('0x47')]||![],'faxPause':_0x622f82[_0x595b('0x47')]||![],'smsPause':_0x622f82['loginInPause']||![],'openchannelPause':_0x622f82[_0x595b('0x47')]||![],'pauseType':_0x622f82[_0x595b('0x47')]?_0x595b('0x51'):null,'lastPauseAt':moment()[_0x595b('0x26')](_0x595b('0x2c')),'interface':_0x26627e});}})[_0x595b('0x19')](function(_0x23ad1d){_0x2a00c7(_0x23ad1d);})[_0x595b('0x1d')](function(_0x52a1b1){_0x907b0b(_0x38dfb7[_0x595b('0x1e')](0x1f4,_0x52a1b1[_0x595b('0x1f')]));});});}; \ No newline at end of file +var _0x29cb=['format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','resolve','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','faxPause','openchannelPause','whatsappPause','pauseType','unpause','system','all','LoginUser','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','catch','error','message','ShowUser','find','then','stringify','PauseUser','name','role','internal','interface'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x29cb,0x87));var _0xb29c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x29cb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xb29c('0x0'));var util=require('util');var moment=require(_0xb29c('0x1'));var BPromise=require('bluebird');var Redis=require(_0xb29c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb29c('0x3'));var logger=require('../../config/logger')(_0xb29c('0x4'));var config=require(_0xb29c('0x5'));config[_0xb29c('0x6')]=_[_0xb29c('0x7')](config[_0xb29c('0x6')],{'host':_0xb29c('0x8'),'port':0x18eb});var socket=require(_0xb29c('0x9'))(new Redis(config[_0xb29c('0x6')]));require(_0xb29c('0xa'))[_0xb29c('0xb')](socket);exports[_0xb29c('0xc')]=function(_0x16d7f5){var _0x53f4c5=this;return new Promise(function(_0xf3e2ca,_0x41351f){return db[_0xb29c('0xd')][_0xb29c('0xe')]({'raw':_0x16d7f5['options']?_0x16d7f5[_0xb29c('0xf')][_0xb29c('0x10')]===undefined?!![]:![]:!![],'where':_0x16d7f5[_0xb29c('0xf')]?_0x16d7f5[_0xb29c('0xf')][_0xb29c('0x11')]||null:null,'attributes':_0x16d7f5[_0xb29c('0xf')]?_0x16d7f5[_0xb29c('0xf')][_0xb29c('0x12')]||null:null,'limit':_0x16d7f5['options']?_0x16d7f5[_0xb29c('0xf')][_0xb29c('0x13')]||null:null,'include':_0x16d7f5[_0xb29c('0xf')]?_0x16d7f5[_0xb29c('0xf')][_0xb29c('0x14')]?_[_0xb29c('0x15')](_0x16d7f5['options'][_0xb29c('0x14')],function(_0x28c5cb){return{'model':db[_0x28c5cb[_0xb29c('0x16')]],'as':_0x28c5cb['as'],'attributes':_0x28c5cb[_0xb29c('0x12')],'include':_0x28c5cb[_0xb29c('0x14')]?_['map'](_0x28c5cb[_0xb29c('0x14')],function(_0x1434f5){return{'model':db[_0x1434f5[_0xb29c('0x16')]],'as':_0x1434f5['as'],'attributes':_0x1434f5[_0xb29c('0x12')],'include':_0x1434f5['include']?_['map'](_0x1434f5[_0xb29c('0x14')],function(_0xf5f943){return{'model':db[_0xf5f943[_0xb29c('0x16')]],'as':_0xf5f943['as'],'attributes':_0xf5f943[_0xb29c('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e980c){logger[_0xb29c('0x17')](_0xb29c('0xc'),_0x16d7f5);logger[_0xb29c('0x18')](_0xb29c('0xc'),_0x16d7f5,JSON['stringify'](_0x1e980c));_0xf3e2ca(_0x1e980c);})[_0xb29c('0x19')](function(_0x43b9be){logger[_0xb29c('0x1a')](_0xb29c('0xc'),_0x43b9be['message'],_0x16d7f5);_0x41351f(_0x53f4c5['error'](0x1f4,_0x43b9be[_0xb29c('0x1b')]));});});};exports[_0xb29c('0x1c')]=function(_0x3c6475){var _0x19db05=this;return new Promise(function(_0x37e270,_0x9cf310){return db[_0xb29c('0xd')][_0xb29c('0x1d')]({'raw':_0x3c6475[_0xb29c('0xf')]?_0x3c6475[_0xb29c('0xf')][_0xb29c('0x10')]===undefined?!![]:![]:!![],'where':_0x3c6475[_0xb29c('0xf')]?_0x3c6475[_0xb29c('0xf')][_0xb29c('0x11')]||null:null,'attributes':_0x3c6475[_0xb29c('0xf')]?_0x3c6475[_0xb29c('0xf')][_0xb29c('0x12')]||null:null,'include':_0x3c6475[_0xb29c('0xf')]?_0x3c6475['options'][_0xb29c('0x14')]?_[_0xb29c('0x15')](_0x3c6475['options'][_0xb29c('0x14')],function(_0x3b90f1){return{'model':db[_0x3b90f1[_0xb29c('0x16')]],'as':_0x3b90f1['as'],'attributes':_0x3b90f1[_0xb29c('0x12')],'include':_0x3b90f1['include']?_[_0xb29c('0x15')](_0x3b90f1['include'],function(_0x1f34f7){return{'model':db[_0x1f34f7[_0xb29c('0x16')]],'as':_0x1f34f7['as'],'attributes':_0x1f34f7[_0xb29c('0x12')],'include':_0x1f34f7['include']?_[_0xb29c('0x15')](_0x1f34f7[_0xb29c('0x14')],function(_0x3227d8){return{'model':db[_0x3227d8[_0xb29c('0x16')]],'as':_0x3227d8['as'],'attributes':_0x3227d8[_0xb29c('0x12')]};}):[]};}):[]};}):[]:[]})[_0xb29c('0x1e')](function(_0xbba17b){logger[_0xb29c('0x17')](_0xb29c('0x1c'),_0x3c6475);logger[_0xb29c('0x18')](_0xb29c('0x1c'),_0x3c6475,JSON[_0xb29c('0x1f')](_0xbba17b));_0x37e270(_0xbba17b);})[_0xb29c('0x19')](function(_0x27f2a7){logger[_0xb29c('0x1a')]('ShowUser',_0x27f2a7[_0xb29c('0x1b')],_0x3c6475);_0x9cf310(_0x19db05[_0xb29c('0x1a')](0x1f4,_0x27f2a7[_0xb29c('0x1b')]));});});};exports[_0xb29c('0x20')]=function(_0x22e4c0){var _0x4455d3;return db[_0xb29c('0xd')][_0xb29c('0x1d')]({'where':_0x22e4c0['options']['where']||{},'attributes':['id',_0xb29c('0x21'),_0xb29c('0x22'),_0xb29c('0x23'),_0xb29c('0x24')]})[_0xb29c('0x1e')](function(_0x1f0471){if(!_0x1f0471){throw new Error(util[_0xb29c('0x25')](_0xb29c('0x26'),_0x22e4c0['params']['id']));}_0x4455d3=_0x1f0471;return db[_0xb29c('0x27')][_0xb29c('0x28')]({'paused':0x1},{'where':{'UserId':_0x4455d3['id']},'individualHooks':!![]});})[_0xb29c('0x1e')](function(){return db[_0xb29c('0x29')][_0xb29c('0xe')]({'where':{'membername':_0x4455d3['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0xc2ecec){if(_0xc2ecec&&_0xc2ecec[_0xb29c('0x2a')]){var _0xf92427=moment()[_0xb29c('0x25')](_0xb29c('0x2b'));for(var _0x1cb789=0x0,_0x1ebb3b=_0xc2ecec[_0xb29c('0x2a')];_0x1cb789<_0x1ebb3b;_0x1cb789++){_0xc2ecec[_0x1cb789][_0xb29c('0x2c')]({'exitAt':_0xf92427});}}})['then'](function(){var _0x16bf78=[];var _0x37efed=utils[_0xb29c('0x2d')]();_0x37efed[_0xb29c('0x2e')](function(_0x5f2ea5){_0x16bf78[_0xb29c('0x2f')]({'channel':_0x5f2ea5,'membername':_0x4455d3[_0xb29c('0x21')],'interface':_[_0xb29c('0x30')](_0x4455d3['interface'])?util[_0xb29c('0x25')](_0xb29c('0x31'),_0x4455d3[_0xb29c('0x21')]):_0x4455d3[_0xb29c('0x24')],'type':_0xb29c('0x32'),'enterAt':moment()[_0xb29c('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x22e4c0[_0xb29c('0x33')][_0xb29c('0x34')]||_0xb29c('0x35'),'role':_0x4455d3['role'],'internal':_0x4455d3[_0xb29c('0x23')],'uniqueid':_0x22e4c0[_0xb29c('0x33')][_0xb29c('0x36')]||null});});return db[_0xb29c('0x29')]['bulkCreate'](_0x16bf78,{'individualHooks':!![]});})[_0xb29c('0x1e')](function(){return _0x4455d3[_0xb29c('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x22e4c0[_0xb29c('0x33')]['type']||_0xb29c('0x35'),'lastPauseAt':moment()[_0xb29c('0x25')](_0xb29c('0x2b'))});})['catch'](function(_0x4e4a00){throw _0x4e4a00;});};exports[_0xb29c('0x37')]=function(_0x234734){return Promise[_0xb29c('0x38')]()[_0xb29c('0x1e')](function(){if(_0x234734[_0xb29c('0x33')]['channel']&&!utils[_0xb29c('0x39')](_0x234734[_0xb29c('0x33')][_0xb29c('0x3a')])){throw new Error(util['format'](_0xb29c('0x3b'),_0x234734['body'][_0xb29c('0x3a')]));}return db[_0xb29c('0xd')][_0xb29c('0x3c')]({'where':_0x234734[_0xb29c('0xf')][_0xb29c('0x11')]||{},'attributes':['id',_0xb29c('0x21'),_0xb29c('0x22'),_0xb29c('0x23'),_0xb29c('0x24'),'online',_0xb29c('0x3d'),_0xb29c('0x3e'),'chatPause',_0xb29c('0x3f'),_0xb29c('0x40'),'smsPause',_0xb29c('0x41'),_0xb29c('0x42'),'lastPauseAt']});})[_0xb29c('0x1e')](function(_0x5c1509){if(!_0x5c1509){throw new Error(util['format'](_0xb29c('0x26'),_0x234734['params']['id']));}return _0x5c1509[_0xb29c('0x43')](_0x234734[_0xb29c('0x33')][_0xb29c('0x3a')],_0xb29c('0x44'));})[_0xb29c('0x19')](function(_0x2425d4){throw _0x2425d4;});};exports['LogoutUser']=function(_0x2ac569){var _0x599fcc=this;return new Promise(function(_0x528e89,_0x507f97){var _0x26f969;return db[_0xb29c('0xd')][_0xb29c('0x3c')]({'where':_0x2ac569['options']['where']||{},'attributes':['id',_0xb29c('0x21')]})[_0xb29c('0x1e')](function(_0x48e37a){if(_0x48e37a){_0x26f969=_0x48e37a;return db[_0xb29c('0x27')]['destroy']({'where':{'membername':_0x26f969[_0xb29c('0x21')]},'individualHooks':!![]});}})[_0xb29c('0x1e')](function(){if(_0x26f969){return db['MemberReport'][_0xb29c('0xe')]({'where':{'membername':_0x26f969[_0xb29c('0x21')],'exitAt':null}});}})['then'](function(_0x1df613){if(_0x26f969){if(_0x1df613&&_0x1df613[_0xb29c('0x2a')]){var _0x36161f=[];_0x1df613['forEach'](function(_0x55cf12){_0x36161f[_0xb29c('0x2f')](_0x55cf12[_0xb29c('0x28')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xb29c('0x45')](_0x36161f);}}})[_0xb29c('0x1e')](function(){if(_0x26f969){return _0x26f969[_0xb29c('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x59f753){_0x528e89(_0x59f753);})[_0xb29c('0x19')](function(_0x31674b){_0x507f97(_0x599fcc[_0xb29c('0x1a')](0x1f4,_0x31674b[_0xb29c('0x1b')]));});});};exports[_0xb29c('0x46')]=function(_0x1702b8){var _0x2c64b2=this;return new Promise(function(_0x56bdda,_0x2be619){var _0x20764c;var _0x29a7df;var _0x236203;var _0x4fcbec;return db['User'][_0xb29c('0x3c')]({'where':_0x1702b8[_0xb29c('0xf')][_0xb29c('0x11')]||{},'attributes':['id',_0xb29c('0x21'),_0xb29c('0x22'),'mobile',_0xb29c('0x47'),'internal',_0xb29c('0x48'),'interface']})['then'](function(_0xe069e0){if(_0xe069e0){_0x20764c=_0xe069e0;_0x4fcbec=_0x1702b8[_0xb29c('0x33')][_0xb29c('0x24')]?_0x1702b8[_0xb29c('0x33')][_0xb29c('0x24')]:util[_0xb29c('0x25')](_0xb29c('0x31'),_0x20764c['name']);return db['User'][_0xb29c('0x49')]({'where':{'role':_0xb29c('0x4a'),'online':!![],'id':{'$ne':_0x20764c['id']}}});}})[_0xb29c('0x1e')](function(_0x42d00e){if(_0x42d00e){_0x236203=_0x42d00e;return require(_0xb29c('0x4b'))['getLicense']();}})['then'](function(_0xd51d76){if(_0xd51d76&&_0xd51d76[_0xb29c('0x4c')]&&_0x236203>=_0xd51d76[_0xb29c('0x4c')]){throw new Error(_0xb29c('0x4d'));}})[_0xb29c('0x1e')](function(){if(_0x20764c){return db['UserVoiceQueueRt'][_0xb29c('0x4e')]({'where':{'membername':_0x20764c[_0xb29c('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x20764c){return _0x20764c[_0xb29c('0x4f')]({'raw':!![]});}})[_0xb29c('0x1e')](function(_0x3daf5d){if(_0x20764c){if(_0x3daf5d){var _0x5066e5=[];_0x29a7df=_0x3daf5d;if(_0x29a7df[_0xb29c('0x2a')]){for(var _0x52566e=0x0;_0x52566e<_0x29a7df[_0xb29c('0x2a')];_0x52566e++){_0x5066e5[_0xb29c('0x2f')](db['UserVoiceQueueRt'][_0xb29c('0x50')]({'membername':_0x20764c['name'],'UserId':_0x20764c['id'],'queue_name':_0x29a7df[_0x52566e][_0xb29c('0x21')],'VoiceQueueId':_0x29a7df[_0x52566e]['id'],'interface':_0x4fcbec,'paused':_0x20764c[_0xb29c('0x48')]||![],'penalty':_0x29a7df[_0x52566e][_0xb29c('0x51')]||0x0}));}return BPromise[_0xb29c('0x45')](_0x5066e5);}}}})[_0xb29c('0x1e')](function(){if(_0x20764c){return db['MemberReport']['findAll']({'where':{'membername':_0x20764c[_0xb29c('0x21')],'exitAt':null}});}})[_0xb29c('0x1e')](function(_0x1f8875){if(_0x20764c){if(_0x1f8875&&_0x1f8875[_0xb29c('0x2a')]){var _0x438db3=[];_0x1f8875['forEach'](function(_0x517a91){_0x438db3[_0xb29c('0x2f')](_0x517a91['update']({'exitAt':moment()[_0xb29c('0x25')](_0xb29c('0x2b'))}));});return BPromise[_0xb29c('0x45')](_0x438db3);}}})['then'](function(){if(_0x20764c){var _0x59769f=[];var _0x3e4c4a=[];var _0x435663=utils[_0xb29c('0x2d')]();var _0x1e7ba5={'membername':_0x20764c[_0xb29c('0x21')],'interface':_0x4fcbec,'enterAt':moment()[_0xb29c('0x25')](_0xb29c('0x2b')),'role':_0x20764c[_0xb29c('0x22')],'internal':_0x20764c['internal']};_0x435663[_0xb29c('0x2e')](function(_0x519b3a){_0x59769f[_0xb29c('0x2f')](_[_0xb29c('0x52')]({'channel':_0x519b3a,'type':_0xb29c('0x53'),'data1':'callysquare','data2':_0x4fcbec},_0x1e7ba5));if(_0x20764c[_0xb29c('0x48')]){_0x3e4c4a[_0xb29c('0x2f')](_[_0xb29c('0x52')]({'channel':_0x519b3a,'type':_0xb29c('0x32'),'data1':_0xb29c('0x54')},_0x1e7ba5));}});return db[_0xb29c('0x29')]['bulkCreate'](_0x59769f[_0xb29c('0x55')](_0x3e4c4a),{'individualHooks':!![]});}})[_0xb29c('0x1e')](function(){if(_0x20764c){return _0x20764c['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x20764c[_0xb29c('0x48')]||![],'mailPause':_0x20764c[_0xb29c('0x48')]||![],'chatPause':_0x20764c['loginInPause']||![],'faxPause':_0x20764c[_0xb29c('0x48')]||![],'smsPause':_0x20764c['loginInPause']||![],'openchannelPause':_0x20764c[_0xb29c('0x48')]||![],'pauseType':_0x20764c[_0xb29c('0x48')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xb29c('0x25')](_0xb29c('0x2b')),'interface':_0x4fcbec});}})[_0xb29c('0x1e')](function(_0x956ca6){_0x56bdda(_0x956ca6);})['catch'](function(_0x5dd777){_0x2be619(_0x2c64b2['error'](0x1f4,_0x5dd777[_0xb29c('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f16d10a..69443aa 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 _0xe1b4=['./user.events','remove','register','user:'];(function(_0x5cd613,_0x2c4a21){var _0x4699d1=function(_0x179a95){while(--_0x179a95){_0x5cd613['push'](_0x5cd613['shift']());}};_0x4699d1(++_0x2c4a21);}(_0xe1b4,0x18c));var _0x4e1b=function(_0x4d8f6f,_0x559720){_0x4d8f6f=_0x4d8f6f-0x0;var _0x441c71=_0xe1b4[_0x4d8f6f];return _0x441c71;};'use strict';var UserEvents=require(_0x4e1b('0x0'));var events=['save',_0x4e1b('0x1'),'update'];function createListener(_0x706d6,_0x55db03){return function(_0x5aa7f4){_0x55db03['emit'](_0x706d6,_0x5aa7f4);};}function removeListener(_0x1325fa,_0x55bb80){return function(){UserEvents['removeListener'](_0x1325fa,_0x55bb80);};}exports[_0x4e1b('0x2')]=function(_0x536076){for(var _0x1aa2a1=0x0,_0xbf0ce8=events['length'];_0x1aa2a1<_0xbf0ce8;_0x1aa2a1++){var _0x2af2be=events[_0x1aa2a1];var _0x2859ec=createListener(_0x4e1b('0x3')+_0x2af2be,_0x536076);UserEvents['on'](_0x2af2be,_0x2859ec);}}; \ No newline at end of file +var _0x4eb2=['user:','./user.events','save','remove','emit','removeListener','register','length'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x4eb2,0xb9));var _0x24eb=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x4eb2[_0x125ff8];return _0x2d9ef;};'use strict';var UserEvents=require(_0x24eb('0x0'));var events=[_0x24eb('0x1'),_0x24eb('0x2'),'update'];function createListener(_0x55802a,_0x396b8b){return function(_0xb40f47){_0x396b8b[_0x24eb('0x3')](_0x55802a,_0xb40f47);};}function removeListener(_0x4dc368,_0x325023){return function(){UserEvents[_0x24eb('0x4')](_0x4dc368,_0x325023);};}exports[_0x24eb('0x5')]=function(_0x5569ca){for(var _0x350a1a=0x0,_0x5e01c8=events[_0x24eb('0x6')];_0x350a1a<_0x5e01c8;_0x350a1a++){var _0xff459b=events[_0x350a1a];var _0x2e057a=createListener(_0x24eb('0x7')+_0xff459b,_0x5569ca);UserEvents['on'](_0xff459b,_0x2e057a);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 820a33a..fccc95b 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2364b8,_0x1c3637){var _0x6b5fac=function(_0xc442fc){while(--_0xc442fc){_0x2364b8['push'](_0x2364b8['shift']());}};_0x6b5fac(++_0x1c3637);}(_0x70e0,0x17b));var _0x070e=function(_0x22b7fd,_0x4bd2ae){_0x22b7fd=_0x22b7fd-0x0;var _0x4e5d03=_0x70e0[_0x22b7fd];return _0x4e5d03;};'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(_0x209c3b,_0x5e71f9){var _0x299e78=function(_0x37c9a8){while(--_0x37c9a8){_0x209c3b['push'](_0x209c3b['shift']());}};_0x299e78(++_0x5e71f9);}(_0xe706,0xa3));var _0x6e70=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe706[_0x409353];return _0x4f4b59;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 04d45c5..55300fd 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 _0x742e=['sequelize','exports'];(function(_0x89064d,_0x3b096a){var _0x318fc9=function(_0x4dfcd3){while(--_0x4dfcd3){_0x89064d['push'](_0x89064d['shift']());}};_0x318fc9(++_0x3b096a);}(_0x742e,0xa2));var _0xe742=function(_0x3af7c1,_0x4d9454){_0x3af7c1=_0x3af7c1-0x0;var _0x342af8=_0x742e[_0x3af7c1];return _0x342af8;};'use strict';var Sequelize=require(_0xe742('0x0'));module[_0xe742('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ed7=['sequelize','INTEGER'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9ed7,0x168));var _0x79ed=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x9ed7[_0xd63e3a];return _0x19c178;};'use strict';var Sequelize=require(_0x79ed('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x79ed('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index cdaca74..c4d17fc 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 _0x0cd4=['path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x2e5e73,_0x30d4d9){var _0x4cf641=function(_0x26b1b6){while(--_0x26b1b6){_0x2e5e73['push'](_0x2e5e73['shift']());}};_0x4cf641(++_0x30d4d9);}(_0x0cd4,0xa3));var _0x40cd=function(_0x5036ba,_0x4bdf4f){_0x5036ba=_0x5036ba-0x0;var _0x2d4dbf=_0x0cd4[_0x5036ba];return _0x2d4dbf;};'use strict';var _=require('lodash');var util=require(_0x40cd('0x0'));var logger=require(_0x40cd('0x1'))(_0x40cd('0x2'));var moment=require(_0x40cd('0x3'));var BPromise=require(_0x40cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40cd('0x5'));var rimraf=require('rimraf');var config=require(_0x40cd('0x6'));var attributes=require(_0x40cd('0x7'));module[_0x40cd('0x8')]=function(_0xcd068d,_0x2a0840){return _0xcd068d[_0x40cd('0x9')](_0x40cd('0xa'),attributes,{'tableName':_0x40cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6e=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','util'];(function(_0x357766,_0x1ade36){var _0xe28a73=function(_0x1d8449){while(--_0x1d8449){_0x357766['push'](_0x357766['shift']());}};_0xe28a73(++_0x1ade36);}(_0x3c6e,0xd7));var _0xe3c6=function(_0x1ab357,_0x2319c1){_0x1ab357=_0x1ab357-0x0;var _0x3975eb=_0x3c6e[_0x1ab357];return _0x3975eb;};'use strict';var _=require('lodash');var util=require(_0xe3c6('0x0'));var logger=require(_0xe3c6('0x1'))(_0xe3c6('0x2'));var moment=require(_0xe3c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3c6('0x4'));var fs=require('fs');var path=require(_0xe3c6('0x5'));var rimraf=require(_0xe3c6('0x6'));var config=require(_0xe3c6('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x419d41,_0x2d1010){return _0x419d41[_0xe3c6('0x8')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 1de7f60..3918836 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 _0x39e3=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x39e3,0x1b2));var _0x339e=function(_0x5cb071,_0x572a5d){_0x5cb071=_0x5cb071-0x0;var _0x30d388=_0x39e3[_0x5cb071];return _0x30d388;};'use strict';var _=require(_0x339e('0x0'));var util=require(_0x339e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x339e('0x2'));var fs=require('fs');var Redis=require(_0x339e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x339e('0x4'));var logger=require('../../config/logger')(_0x339e('0x5'));var config=require('../../config/environment');var jayson=require(_0x339e('0x6'));var client=jayson[_0x339e('0x7')][_0x339e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b6262,_0x5a3f04,_0x492e92){return new BPromise(function(_0x3498e5,_0x3236fa){return client[_0x339e('0x9')](_0x1b6262,_0x492e92)[_0x339e('0xa')](function(_0x305c8e){logger[_0x339e('0xb')](_0x339e('0xc'),_0x5a3f04,_0x339e('0xd'));logger[_0x339e('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5a3f04,'request\x20sent',JSON[_0x339e('0xf')](_0x305c8e));if(_0x305c8e[_0x339e('0x10')]){if(_0x305c8e[_0x339e('0x10')][_0x339e('0x11')]===0x1f4){logger[_0x339e('0x10')](_0x339e('0xc'),_0x5a3f04,_0x305c8e[_0x339e('0x10')]['message']);return _0x3236fa(_0x305c8e['error'][_0x339e('0x12')]);}logger[_0x339e('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x5a3f04,_0x305c8e[_0x339e('0x10')][_0x339e('0x12')]);return _0x3498e5(_0x305c8e[_0x339e('0x10')]['message']);}else{logger[_0x339e('0xb')](_0x339e('0xc'),_0x5a3f04,_0x339e('0xd'));_0x3498e5(_0x305c8e[_0x339e('0x13')][_0x339e('0x12')]);}})[_0x339e('0x14')](function(_0x576cb5){logger[_0x339e('0x10')](_0x339e('0xc'),_0x5a3f04,_0x576cb5);_0x3236fa(_0x576cb5);});});} \ No newline at end of file +var _0x31c3=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserChatQueue,\x20%s,\x20%s'];(function(_0xc2b23,_0x111eec){var _0x8090b8=function(_0x5c180f){while(--_0x5c180f){_0xc2b23['push'](_0xc2b23['shift']());}};_0x8090b8(++_0x111eec);}(_0x31c3,0x77));var _0x331c=function(_0x4ae60f,_0x3fa2a3){_0x4ae60f=_0x4ae60f-0x0;var _0x15759a=_0x31c3[_0x4ae60f];return _0x15759a;};'use strict';var _=require(_0x331c('0x0'));var util=require('util');var moment=require(_0x331c('0x1'));var BPromise=require(_0x331c('0x2'));var rs=require(_0x331c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x331c('0x4'))['db'];var utils=require(_0x331c('0x5'));var logger=require(_0x331c('0x6'))(_0x331c('0x7'));var config=require(_0x331c('0x8'));var jayson=require(_0x331c('0x9'));var client=jayson['client'][_0x331c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x335103,_0x228a2c,_0x32ead8){return new BPromise(function(_0x539c17,_0x585bcb){return client['request'](_0x335103,_0x32ead8)[_0x331c('0xb')](function(_0x82526a){logger['info'](_0x331c('0xc'),_0x228a2c,'request\x20sent');logger[_0x331c('0xd')](_0x331c('0xe'),_0x228a2c,_0x331c('0xf'),JSON[_0x331c('0x10')](_0x82526a));if(_0x82526a[_0x331c('0x11')]){if(_0x82526a[_0x331c('0x11')][_0x331c('0x12')]===0x1f4){logger[_0x331c('0x11')](_0x331c('0xc'),_0x228a2c,_0x82526a[_0x331c('0x11')][_0x331c('0x13')]);return _0x585bcb(_0x82526a[_0x331c('0x11')][_0x331c('0x13')]);}logger[_0x331c('0x11')](_0x331c('0xc'),_0x228a2c,_0x82526a[_0x331c('0x11')]['message']);return _0x539c17(_0x82526a[_0x331c('0x11')][_0x331c('0x13')]);}else{logger[_0x331c('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x228a2c,'request\x20sent');_0x539c17(_0x82526a['result'][_0x331c('0x13')]);}})[_0x331c('0x15')](function(_0x50a323){logger[_0x331c('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x228a2c,_0x50a323);_0x585bcb(_0x50a323);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0d92b1a..07114fa 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xac1d19,_0x447fa8){var _0x1133e0=function(_0x44a661){while(--_0x44a661){_0xac1d19['push'](_0xac1d19['shift']());}};_0x1133e0(++_0x447fa8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1d66e2,_0x195dc7){var _0x3765d0=function(_0x40c7f1){while(--_0x40c7f1){_0x1d66e2['push'](_0x1d66e2['shift']());}};_0x3765d0(++_0x195dc7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c743a48..c76e590 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 _0x9b38=['STRING','sequelize','INTEGER'];(function(_0x465b6f,_0x252683){var _0x4b2193=function(_0x368e28){while(--_0x368e28){_0x465b6f['push'](_0x465b6f['shift']());}};_0x4b2193(++_0x252683);}(_0x9b38,0x11e));var _0x89b3=function(_0x354352,_0xb0dcc1){_0x354352=_0x354352-0x0;var _0xfbb346=_0x9b38[_0x354352];return _0xfbb346;};'use strict';var Sequelize=require(_0x89b3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x89b3('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x89b3('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x89b3('0x2')]}}; \ No newline at end of file +var _0xcbde=['sequelize','INTEGER','STRING'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xcbde,0x1e9));var _0xecbd=function(_0x5886eb,_0x317b49){_0x5886eb=_0x5886eb-0x0;var _0x3ae673=_0xcbde[_0x5886eb];return _0x3ae673;};'use strict';var Sequelize=require(_0xecbd('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xecbd('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xecbd('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xecbd('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 91af095..8197a64 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 _0xe1be=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0xe1be,0x11d));var _0xee1b=function(_0x56578c,_0x17c0ef){_0x56578c=_0x56578c-0x0;var _0xff736d=_0xe1be[_0x56578c];return _0xff736d;};'use strict';var _=require(_0xee1b('0x0'));var util=require(_0xee1b('0x1'));var logger=require(_0xee1b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee1b('0x3'));var rp=require(_0xee1b('0x4'));var fs=require('fs');var path=require(_0xee1b('0x5'));var rimraf=require(_0xee1b('0x6'));var config=require(_0xee1b('0x7'));var attributes=require(_0xee1b('0x8'));module[_0xee1b('0x9')]=function(_0x28bb16,_0x1d1f8a){return _0x28bb16[_0xee1b('0xa')](_0xee1b('0xb'),attributes,{'tableName':_0xee1b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff25=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0xff25,0xb6));var _0x5ff2=function(_0x2bc5e5,_0x203f7c){_0x2bc5e5=_0x2bc5e5-0x0;var _0x341ac4=_0xff25[_0x2bc5e5];return _0x341ac4;};'use strict';var _=require(_0x5ff2('0x0'));var util=require('util');var logger=require(_0x5ff2('0x1'))(_0x5ff2('0x2'));var moment=require(_0x5ff2('0x3'));var BPromise=require(_0x5ff2('0x4'));var rp=require(_0x5ff2('0x5'));var fs=require('fs');var path=require(_0x5ff2('0x6'));var rimraf=require(_0x5ff2('0x7'));var config=require(_0x5ff2('0x8'));var attributes=require(_0x5ff2('0x9'));module['exports']=function(_0x46d54f,_0x3678ea){return _0x46d54f[_0x5ff2('0xa')](_0x5ff2('0xb'),attributes,{'tableName':_0x5ff2('0xc'),'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 c7b6f42..4023f1a 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 _0xddd1=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xddd1,0xe9));var _0x1ddd=function(_0x3d5205,_0x51e463){_0x3d5205=_0x3d5205-0x0;var _0x5561fb=_0xddd1[_0x3d5205];return _0x5561fb;};'use strict';var _=require(_0x1ddd('0x0'));var util=require(_0x1ddd('0x1'));var moment=require(_0x1ddd('0x2'));var BPromise=require(_0x1ddd('0x3'));var rs=require(_0x1ddd('0x4'));var fs=require('fs');var Redis=require(_0x1ddd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ddd('0x6'));var logger=require('../../config/logger')(_0x1ddd('0x7'));var config=require(_0x1ddd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ddd('0x9')][_0x1ddd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dea4e,_0x466f76,_0x59f850){return new BPromise(function(_0x58b6bf,_0xea3e7d){return client[_0x1ddd('0xb')](_0x3dea4e,_0x59f850)[_0x1ddd('0xc')](function(_0x30909f){logger[_0x1ddd('0xd')](_0x1ddd('0xe'),_0x466f76,_0x1ddd('0xf'));logger[_0x1ddd('0x10')](_0x1ddd('0x11'),_0x466f76,_0x1ddd('0xf'),JSON[_0x1ddd('0x12')](_0x30909f));if(_0x30909f[_0x1ddd('0x13')]){if(_0x30909f[_0x1ddd('0x13')]['code']===0x1f4){logger['error'](_0x1ddd('0xe'),_0x466f76,_0x30909f[_0x1ddd('0x13')][_0x1ddd('0x14')]);return _0xea3e7d(_0x30909f[_0x1ddd('0x13')][_0x1ddd('0x14')]);}logger['error'](_0x1ddd('0xe'),_0x466f76,_0x30909f[_0x1ddd('0x13')][_0x1ddd('0x14')]);return _0x58b6bf(_0x30909f[_0x1ddd('0x13')][_0x1ddd('0x14')]);}else{logger[_0x1ddd('0xd')](_0x1ddd('0xe'),_0x466f76,_0x1ddd('0xf'));_0x58b6bf(_0x30909f[_0x1ddd('0x15')][_0x1ddd('0x14')]);}})[_0x1ddd('0x16')](function(_0x4c61b6){logger[_0x1ddd('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x466f76,_0x4c61b6);_0xea3e7d(_0x4c61b6);});});} \ No newline at end of file +var _0x9acd=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x4b7e37,_0x2e3fd5){var _0x4404af=function(_0x3cb16f){while(--_0x3cb16f){_0x4b7e37['push'](_0x4b7e37['shift']());}};_0x4404af(++_0x2e3fd5);}(_0x9acd,0x71));var _0xd9ac=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9acd[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd9ac('0x0'));var util=require(_0xd9ac('0x1'));var moment=require('moment');var BPromise=require(_0xd9ac('0x2'));var rs=require(_0xd9ac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9ac('0x4'))['db'];var utils=require(_0xd9ac('0x5'));var logger=require(_0xd9ac('0x6'))(_0xd9ac('0x7'));var config=require('../../config/environment');var jayson=require(_0xd9ac('0x8'));var client=jayson[_0xd9ac('0x9')][_0xd9ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514b1c,_0x5b9ee1,_0x372936){return new BPromise(function(_0x4128d9,_0x330a80){return client[_0xd9ac('0xb')](_0x514b1c,_0x372936)[_0xd9ac('0xc')](function(_0x3d9ae1){logger[_0xd9ac('0xd')](_0xd9ac('0xe'),_0x5b9ee1,_0xd9ac('0xf'));logger[_0xd9ac('0x10')](_0xd9ac('0x11'),_0x5b9ee1,'request\x20sent',JSON['stringify'](_0x3d9ae1));if(_0x3d9ae1['error']){if(_0x3d9ae1[_0xd9ac('0x12')][_0xd9ac('0x13')]===0x1f4){logger['error'](_0xd9ac('0xe'),_0x5b9ee1,_0x3d9ae1['error'][_0xd9ac('0x14')]);return _0x330a80(_0x3d9ae1['error'][_0xd9ac('0x14')]);}logger[_0xd9ac('0x12')](_0xd9ac('0xe'),_0x5b9ee1,_0x3d9ae1[_0xd9ac('0x12')][_0xd9ac('0x14')]);return _0x4128d9(_0x3d9ae1['error'][_0xd9ac('0x14')]);}else{logger[_0xd9ac('0xd')](_0xd9ac('0xe'),_0x5b9ee1,_0xd9ac('0xf'));_0x4128d9(_0x3d9ae1[_0xd9ac('0x15')][_0xd9ac('0x14')]);}})[_0xd9ac('0x16')](function(_0x3de483){logger[_0xd9ac('0x12')](_0xd9ac('0xe'),_0x5b9ee1,_0x3de483);_0x330a80(_0x3de483);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f0f2d98..b7dc912 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54a19b,_0x295df7){var _0x5de355=function(_0x132afc){while(--_0x132afc){_0x54a19b['push'](_0x54a19b['shift']());}};_0x5de355(++_0x295df7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xcb91[_0x1b1a3b];return _0x385347;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1c571e,_0x548a78){var _0x4c546e=function(_0x4402b0){while(--_0x4402b0){_0x1c571e['push'](_0x1c571e['shift']());}};_0x4c546e(++_0x548a78);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9b13cf1..9d2a17e 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 _0x37f5=['exports'];(function(_0x2c0c4a,_0x43c0cd){var _0x466fce=function(_0x236a8c){while(--_0x236a8c){_0x2c0c4a['push'](_0x2c0c4a['shift']());}};_0x466fce(++_0x43c0cd);}(_0x37f5,0x7b));var _0x537f=function(_0x536ff4,_0x5bc6cd){_0x536ff4=_0x536ff4-0x0;var _0x5d7557=_0x37f5[_0x536ff4];return _0x5d7557;};'use strict';var Sequelize=require('sequelize');module[_0x537f('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa6a1=['INTEGER','sequelize'];(function(_0xd35de5,_0x5ee3cc){var _0x5bb99d=function(_0x54182b){while(--_0x54182b){_0xd35de5['push'](_0xd35de5['shift']());}};_0x5bb99d(++_0x5ee3cc);}(_0xa6a1,0xbb));var _0x1a6a=function(_0x65f8ff,_0xf40934){_0x65f8ff=_0x65f8ff-0x0;var _0x5ae092=_0xa6a1[_0x65f8ff];return _0x5ae092;};'use strict';var Sequelize=require(_0x1a6a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1a6a('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 af9ffb3..317deec 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 _0x0937=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','api'];(function(_0x573caa,_0x40a378){var _0x5450d5=function(_0x2a2ddf){while(--_0x2a2ddf){_0x573caa['push'](_0x573caa['shift']());}};_0x5450d5(++_0x40a378);}(_0x0937,0xa6));var _0x7093=function(_0x2f98ec,_0x25a6a5){_0x2f98ec=_0x2f98ec-0x0;var _0x57ec11=_0x0937[_0x2f98ec];return _0x57ec11;};'use strict';var _=require(_0x7093('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7093('0x1'));var moment=require('moment');var BPromise=require(_0x7093('0x2'));var rp=require(_0x7093('0x3'));var fs=require('fs');var path=require(_0x7093('0x4'));var rimraf=require(_0x7093('0x5'));var config=require(_0x7093('0x6'));var attributes=require(_0x7093('0x7'));module[_0x7093('0x8')]=function(_0x444fea,_0xc40e61){return _0x444fea[_0x7093('0x9')](_0x7093('0xa'),attributes,{'tableName':_0x7093('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x455e=['request-promise','path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14911e,_0x578e33){var _0x46ed87=function(_0x315ad6){while(--_0x315ad6){_0x14911e['push'](_0x14911e['shift']());}};_0x46ed87(++_0x578e33);}(_0x455e,0xd7));var _0xe455=function(_0x30f5e3,_0x41d3ba){_0x30f5e3=_0x30f5e3-0x0;var _0x22ed90=_0x455e[_0x30f5e3];return _0x22ed90;};'use strict';var _=require(_0xe455('0x0'));var util=require(_0xe455('0x1'));var logger=require(_0xe455('0x2'))(_0xe455('0x3'));var moment=require(_0xe455('0x4'));var BPromise=require(_0xe455('0x5'));var rp=require(_0xe455('0x6'));var fs=require('fs');var path=require(_0xe455('0x7'));var rimraf=require('rimraf');var config=require(_0xe455('0x8'));var attributes=require(_0xe455('0x9'));module[_0xe455('0xa')]=function(_0x5d1ec4,_0x573433){return _0x5d1ec4[_0xe455('0xb')](_0xe455('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 10f4290..05de9dd 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1a9209,_0x3a6b29){_0x1a9209=_0x1a9209-0x0;var _0x4a04cc=_0x1cb9[_0x1a9209];return _0x4a04cc;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +var _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(_0x3f93a6,_0x9df034){var _0x33af95=function(_0x26a8c8){while(--_0x26a8c8){_0x3f93a6['push'](_0x3f93a6['shift']());}};_0x33af95(++_0x9df034);}(_0x3e74,0x175));var _0x43e7=function(_0x1ec994,_0x25700e){_0x1ec994=_0x1ec994-0x0;var _0x116d24=_0x3e74[_0x1ec994];return _0x116d24;};'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 25aaa58..d0bed60 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 _0xedf2=['sendUserNotification','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x399849,_0x3b630d){var _0xfbb04=function(_0x4fea04){while(--_0x4fea04){_0x399849['push'](_0x399849['shift']());}};_0xfbb04(++_0x3b630d);}(_0xedf2,0x1ba));var _0x2edf=function(_0x503768,_0x79abd4){_0x503768=_0x503768-0x0;var _0x172d44=_0xedf2[_0x503768];return _0x172d44;};'use strict';var multer=require('multer');var util=require(_0x2edf('0x0'));var path=require('path');var timeout=require(_0x2edf('0x1'));var express=require(_0x2edf('0x2'));var router=express[_0x2edf('0x3')]();var fs_extra=require(_0x2edf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2edf('0x5'));var config=require(_0x2edf('0x6'));var controller=require(_0x2edf('0x7'));router['post']('/',auth['isAuthenticated'](),controller[_0x2edf('0x8')]);module['exports']=router; \ No newline at end of file +var _0x38e1=['sendUserNotification','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x38e1,0x1a6));var _0x138e=function(_0x1c1567,_0x488e61){_0x1c1567=_0x1c1567-0x0;var _0xbb709b=_0x38e1[_0x1c1567];return _0xbb709b;};'use strict';var multer=require(_0x138e('0x0'));var util=require(_0x138e('0x1'));var path=require(_0x138e('0x2'));var timeout=require(_0x138e('0x3'));var express=require(_0x138e('0x4'));var router=express['Router']();var fs_extra=require(_0x138e('0x5'));var auth=require(_0x138e('0x6'));var interaction=require(_0x138e('0x7'));var config=require(_0x138e('0x8'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x138e('0x9')](),controller[_0x138e('0xa')]);module[_0x138e('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 8a129fd..7523314 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 _0xde32=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x47d172,_0x24d685){var _0x3126f0=function(_0x5c2968){while(--_0x5c2968){_0x47d172['push'](_0x47d172['shift']());}};_0x3126f0(++_0x24d685);}(_0xde32,0xd6));var _0x2de3=function(_0x8563a0,_0x9d2a3f){_0x8563a0=_0x8563a0-0x0;var _0x5d5f9d=_0xde32[_0x8563a0];return _0x5d5f9d;};'use strict';var Sequelize=require(_0x2de3('0x0'));module[_0x2de3('0x1')]={'body':{'type':Sequelize[_0x2de3('0x2')]},'senderName':{'type':Sequelize[_0x2de3('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x2de3('0x3')]},'beep':{'type':Sequelize[_0x2de3('0x4')]}}; \ No newline at end of file +var _0xa0c2=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa0c2,0x122));var _0x2a0c=function(_0x232e16,_0x1328d3){_0x232e16=_0x232e16-0x0;var _0x29719c=_0xa0c2[_0x232e16];return _0x29719c;};'use strict';var Sequelize=require(_0x2a0c('0x0'));module[_0x2a0c('0x1')]={'body':{'type':Sequelize[_0x2a0c('0x2')]},'senderName':{'type':Sequelize[_0x2a0c('0x3')]},'recipientsId':{'type':Sequelize[_0x2a0c('0x2')]},'recipientsDescription':{'type':Sequelize[_0x2a0c('0x3')]},'beep':{'type':Sequelize[_0x2a0c('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 2189508..db8fafe 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 _0x7c5d=['../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','includes','queue','replace','Queue','push','all','flatten','catch','findOne','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x550ac6,_0x5ed43e){var _0x24c233=function(_0x549f79){while(--_0x549f79){_0x550ac6['push'](_0x550ac6['shift']());}};_0x24c233(++_0x5ed43e);}(_0x7c5d,0xbc));var _0xd7c5=function(_0x4767ec,_0x54e3a1){_0x4767ec=_0x4767ec-0x0;var _0x3446ed=_0x7c5d[_0x4767ec];return _0x3446ed;};'use strict';var emlformat=require(_0xd7c5('0x0'));var rimraf=require(_0xd7c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd7c5('0x2'));var moment=require(_0xd7c5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd7c5('0x4'));var util=require(_0xd7c5('0x5'));var path=require(_0xd7c5('0x6'));var sox=require('sox');var csv=require(_0xd7c5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd7c5('0x8'));var crypto=require(_0xd7c5('0x9'));var jsforce=require(_0xd7c5('0xa'));var deskjs=require(_0xd7c5('0xb'));var toCsv=require(_0xd7c5('0x7'));var querystring=require(_0xd7c5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd7c5('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd7c5('0xe'));var hardwareService=require(_0xd7c5('0xf'));var logger=require(_0xd7c5('0x10'))('api');var utils=require(_0xd7c5('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd7c5('0x12'))['db'];config[_0xd7c5('0x13')]=_[_0xd7c5('0x14')](config[_0xd7c5('0x13')],{'host':_0xd7c5('0x15'),'port':0x18eb});var socket=require(_0xd7c5('0x16'))(new Redis(config[_0xd7c5('0x13')]));require(_0xd7c5('0x17'))[_0xd7c5('0x18')](socket);function respondWithStatusCode(_0x582d57,_0x3d2406){_0x3d2406=_0x3d2406||0xcc;return function(_0x3c66c8){if(_0x3c66c8){return _0x582d57[_0xd7c5('0x19')](_0x3d2406);}return _0x582d57['status'](_0x3d2406)[_0xd7c5('0x1a')]();};}function respondWithResult(_0x2bf0da,_0x2a9f98){_0x2a9f98=_0x2a9f98||0xc8;return function(_0x2d0c29){if(_0x2d0c29){return _0x2bf0da[_0xd7c5('0x1b')](_0x2a9f98)[_0xd7c5('0x1c')](_0x2d0c29);}};}function respondWithFilteredResult(_0x5cfe75,_0x298921){return function(_0x2d04e2){if(_0x2d04e2){var _0x1e5da5=typeof _0x298921[_0xd7c5('0x1d')]===_0xd7c5('0x1e')&&typeof _0x298921[_0xd7c5('0x1f')]===_0xd7c5('0x1e');var _0x226e59=_0x2d04e2[_0xd7c5('0x20')];var _0x5572d0=_0x1e5da5?0x0:_0x298921['offset'];var _0x18571c=_0x1e5da5?_0x2d04e2[_0xd7c5('0x20')]:_0x298921['offset']+_0x298921[_0xd7c5('0x1f')];var _0x919b92;if(_0x18571c>=_0x226e59){_0x18571c=_0x226e59;_0x919b92=0xc8;}else{_0x919b92=0xce;}_0x5cfe75[_0xd7c5('0x1b')](_0x919b92);return _0x5cfe75[_0xd7c5('0x21')](_0xd7c5('0x22'),_0x5572d0+'-'+_0x18571c+'/'+_0x226e59)[_0xd7c5('0x1c')](_0x2d04e2);}return null;};}function patchUpdates(_0x53acd1){return function(_0x22fb1e){try{jsonpatch[_0xd7c5('0x23')](_0x22fb1e,_0x53acd1,!![]);}catch(_0x3d3811){return BPromise[_0xd7c5('0x24')](_0x3d3811);}return _0x22fb1e[_0xd7c5('0x25')]();};}function saveUpdates(_0xe8b6dc,_0x408362){return function(_0x2e3a63){if(_0x2e3a63){return _0x2e3a63[_0xd7c5('0x26')](_0xe8b6dc)[_0xd7c5('0x27')](function(_0x402b78){return _0x402b78;});}return null;};}function removeEntity(_0xdbe78b,_0x798c12){return function(_0x15002b){if(_0x15002b){return _0x15002b[_0xd7c5('0x28')]()['then'](function(){_0xdbe78b['status'](0xcc)[_0xd7c5('0x1a')]();});}};}function handleEntityNotFound(_0x51c119,_0x5b220a){return function(_0x29f82f){if(!_0x29f82f){_0x51c119[_0xd7c5('0x19')](0x194);}return _0x29f82f;};}function handleError(_0x3afe59,_0x4c33b8){_0x4c33b8=_0x4c33b8||0x1f4;return function(_0x22df50){logger[_0xd7c5('0x29')](_0x22df50[_0xd7c5('0x2a')]);if(_0x22df50['name']){delete _0x22df50['name'];}_0x3afe59[_0xd7c5('0x1b')](_0x4c33b8)[_0xd7c5('0x2b')](_0x22df50);};}exports[_0xd7c5('0x2c')]=function(_0x44c689,_0x4fe078,_0x14d210){if(!_0x44c689['body']['hasOwnProperty']('text')&&!_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x2e')](_0xd7c5('0x2f'))){throw new db[(_0xd7c5('0x30'))][(_0xd7c5('0x31'))](_0xd7c5('0x32'));}else{if(_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x2e')](_0xd7c5('0x2f'))&&!_0x44c689['body']['hasOwnProperty'](_0xd7c5('0x33'))){throw new db[(_0xd7c5('0x30'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x2e')](_0xd7c5('0x34'))){throw new db[(_0xd7c5('0x30'))]['ValidationError'](_0xd7c5('0x35'));}else{try{var _0x2afad8=JSON[_0xd7c5('0x36')](_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x34')]);}catch(_0x5dcc7d){logger[_0xd7c5('0x29')](_0x5dcc7d);throw new db[(_0xd7c5('0x30'))][(_0xd7c5('0x31'))](_0xd7c5('0x37'));}var _0x20ccc7=[_0xd7c5('0x38'),_0xd7c5('0x39'),_0xd7c5('0x3a'),_0xd7c5('0x3b'),_0xd7c5('0x3c'),_0xd7c5('0x3d'),_0xd7c5('0x3e'),'team',_0xd7c5('0x3f')];if(_[_0xd7c5('0x40')](_0x2afad8,function(_0x448316){return!_['includes'](_0x20ccc7,_0x448316[_0xd7c5('0x41')][_0xd7c5('0x42')]());})){throw new db['Sequelize'][(_0xd7c5('0x31'))](_0xd7c5('0x43'));}}}var _0x1e4be7={};_0x1e4be7['senderName']=_0x44c689['body']['hasOwnProperty'](_0xd7c5('0x44'))?_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x44')]:_0x44c689[_0xd7c5('0x3f')][_0xd7c5('0x45')];_0x1e4be7[_0xd7c5('0x46')]=_[_0xd7c5('0x47')](_0x44c689['body'][_0xd7c5('0x46')])?null:_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x46')];_0x1e4be7[_0xd7c5('0x48')]=_0x44c689[_0xd7c5('0x2d')][_0xd7c5('0x48')]||![];_0x1e4be7[_0xd7c5('0x49')]=_0x44c689[_0xd7c5('0x3f')]['id'];return getContent(_0x44c689[_0xd7c5('0x2d')])[_0xd7c5('0x27')](function(_0x1f8651){_0x1e4be7[_0xd7c5('0x2d')]=_0x1f8651;return getRecipients(_0x2afad8);})[_0xd7c5('0x27')](function(_0x258b90){_0x1e4be7[_0xd7c5('0x4a')]=_['sortBy'](_0x258b90)[_0xd7c5('0x4b')](',');return db[_0xd7c5('0x4c')][_0xd7c5('0x4d')](function(_0x512d09){return db[_0xd7c5('0x4e')][_0xd7c5('0x4f')](_0x1e4be7,{'raw':!![],'transaction':_0x512d09})[_0xd7c5('0x27')](function(_0x231369){var _0x1f7f26={'sender':_0x1e4be7[_0xd7c5('0x44')],'description':_0x1e4be7[_0xd7c5('0x46')],'content':_0x1e4be7[_0xd7c5('0x2d')],'beep':_0x1e4be7[_0xd7c5('0x48')]};_0x258b90[_0xd7c5('0x50')](function(_0x4f4ef9){_0x1f7f26[_0xd7c5('0x51')]=_0x4f4ef9;socket[_0xd7c5('0x52')]('userNotification:send',_0x1f7f26);});return _0x231369;});});})[_0xd7c5('0x27')](respondWithResult(_0x4fe078,0xc9))['catch'](handleError(_0x4fe078,null));};function getContent(_0x1baa36){return new BPromise(function(_0x2d4421,_0x2402e4){if(_0x1baa36[_0xd7c5('0x53')]){_0x2d4421(_0x1baa36[_0xd7c5('0x53')]);return;}return db[_0xd7c5('0x54')]['findOne']({'attributes':[_0xd7c5('0x55')],'where':{'id':_0x1baa36[_0xd7c5('0x2f')]},'raw':!![]})['then'](function(_0x27cadc){if(!_0x27cadc)throw new db[(_0xd7c5('0x30'))][(_0xd7c5('0x31'))](_0xd7c5('0x56'));var _0x3bf06b=Mustache[_0xd7c5('0x57')](_0x27cadc['html'],_0x1baa36[_0xd7c5('0x33')]);_0x2d4421(_0x3bf06b);})['catch'](function(_0x2570d3){_0x2402e4(_0x2570d3);});});}function getRecipients(_0x36ed25){return new BPromise(function(_0x5e8e02,_0x1f5e83){var _0x2ce75c=[];var _0x199aff=[];_0x36ed25['forEach'](function(_0x4f01e1){var _0x40aeee=_[_0xd7c5('0x58')](_0x4f01e1[_0xd7c5('0x41')]['toLowerCase']());if(_0x40aeee===_0xd7c5('0x59')){_0x2ce75c=_[_0xd7c5('0x5a')](_0x2ce75c,_0x4f01e1[_0xd7c5('0x5b')]);}else{if(_[_0xd7c5('0x5c')](_0x40aeee,_0xd7c5('0x5d')))_0x40aeee=_0x40aeee[_0xd7c5('0x5e')](_0xd7c5('0x5d'),_0xd7c5('0x5f'));_0x4f01e1[_0xd7c5('0x5b')][_0xd7c5('0x50')](function(_0x43d370){_0x199aff[_0xd7c5('0x60')](getAgents(_0x40aeee,_0x43d370));});}});return BPromise[_0xd7c5('0x61')](_0x199aff)[_0xd7c5('0x27')](function(_0x554b82){_0x2ce75c=_['union'](_0x2ce75c,_[_0xd7c5('0x62')](_0x554b82));_0x5e8e02(_0x2ce75c);})[_0xd7c5('0x63')](function(_0x273a90){_0x1f5e83(_0x273a90);});});}function getAgents(_0xb90eaa,_0x4299e4){return new BPromise(function(_0x182f60,_0xdf32fa){return db[_0xb90eaa][_0xd7c5('0x64')]({'where':{'id':_0x4299e4}})['then'](function(_0x13217f){return _0x13217f[_0xd7c5('0x65')]({'attributes':['id'],'raw':!![]})[_0xd7c5('0x27')](function(_0x1c69b1){var _0x2afdfe=_['map'](_0x1c69b1,'id');_0x182f60(_0x2afdfe);});})[_0xd7c5('0x63')](function(_0x5bc175){_0xdf32fa(_0x5bc175);});});} \ No newline at end of file +var _0x2530=['./userNotification.socket','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','then','end','sendStatus','error','name','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','catch','Template','TemplateId','render','html','view','startCase','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x5d0818,_0x188411){var _0x37fcdb=function(_0x10c95a){while(--_0x10c95a){_0x5d0818['push'](_0x5d0818['shift']());}};_0x37fcdb(++_0x188411);}(_0x2530,0xa4));var _0x0253=function(_0x7c1bbe,_0x596795){_0x7c1bbe=_0x7c1bbe-0x0;var _0x1cfaba=_0x2530[_0x7c1bbe];return _0x1cfaba;};'use strict';var emlformat=require(_0x0253('0x0'));var rimraf=require(_0x0253('0x1'));var zipdir=require(_0x0253('0x2'));var jsonpatch=require(_0x0253('0x3'));var rp=require(_0x0253('0x4'));var moment=require('moment');var BPromise=require(_0x0253('0x5'));var Mustache=require('mustache');var util=require(_0x0253('0x6'));var path=require('path');var sox=require(_0x0253('0x7'));var csv=require(_0x0253('0x8'));var ejs=require(_0x0253('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0253('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0253('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0253('0x8'));var querystring=require(_0x0253('0xc'));var Papa=require('papaparse');var Redis=require(_0x0253('0xd'));var authService=require(_0x0253('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0253('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0253('0x10'))(_0x0253('0x11'));var utils=require(_0x0253('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x0253('0x13'));var db=require(_0x0253('0x14'))['db'];config[_0x0253('0x15')]=_[_0x0253('0x16')](config[_0x0253('0x15')],{'host':_0x0253('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0253('0x15')]));require(_0x0253('0x18'))['register'](socket);function respondWithStatusCode(_0x5d7ab7,_0x2dbcf0){_0x2dbcf0=_0x2dbcf0||0xcc;return function(_0x446366){if(_0x446366){return _0x5d7ab7['sendStatus'](_0x2dbcf0);}return _0x5d7ab7[_0x0253('0x19')](_0x2dbcf0)['end']();};}function respondWithResult(_0x56bb3c,_0x2d99e1){_0x2d99e1=_0x2d99e1||0xc8;return function(_0x259f79){if(_0x259f79){return _0x56bb3c[_0x0253('0x19')](_0x2d99e1)['json'](_0x259f79);}};}function respondWithFilteredResult(_0x4799f6,_0x2b3878){return function(_0xccbea){if(_0xccbea){var _0x347bc4=typeof _0x2b3878[_0x0253('0x1a')]==='undefined'&&typeof _0x2b3878[_0x0253('0x1b')]===_0x0253('0x1c');var _0x27cd0f=_0xccbea[_0x0253('0x1d')];var _0x31d66b=_0x347bc4?0x0:_0x2b3878['offset'];var _0x4763a0=_0x347bc4?_0xccbea[_0x0253('0x1d')]:_0x2b3878[_0x0253('0x1a')]+_0x2b3878[_0x0253('0x1b')];var _0x3a6d05;if(_0x4763a0>=_0x27cd0f){_0x4763a0=_0x27cd0f;_0x3a6d05=0xc8;}else{_0x3a6d05=0xce;}_0x4799f6[_0x0253('0x19')](_0x3a6d05);return _0x4799f6[_0x0253('0x1e')](_0x0253('0x1f'),_0x31d66b+'-'+_0x4763a0+'/'+_0x27cd0f)[_0x0253('0x20')](_0xccbea);}return null;};}function patchUpdates(_0x9005f4){return function(_0x51c0e8){try{jsonpatch['apply'](_0x51c0e8,_0x9005f4,!![]);}catch(_0x2beec3){return BPromise[_0x0253('0x21')](_0x2beec3);}return _0x51c0e8[_0x0253('0x22')]();};}function saveUpdates(_0x4fa65e,_0x15d6b1){return function(_0x11ac4a){if(_0x11ac4a){return _0x11ac4a['update'](_0x4fa65e)[_0x0253('0x23')](function(_0x3681b6){return _0x3681b6;});}return null;};}function removeEntity(_0x1985ca,_0x402e76){return function(_0x4c5a42){if(_0x4c5a42){return _0x4c5a42['destroy']()[_0x0253('0x23')](function(){_0x1985ca[_0x0253('0x19')](0xcc)[_0x0253('0x24')]();});}};}function handleEntityNotFound(_0x4b8ea4,_0x353a6f){return function(_0x88fac6){if(!_0x88fac6){_0x4b8ea4[_0x0253('0x25')](0x194);}return _0x88fac6;};}function handleError(_0x596b22,_0x4ddec5){_0x4ddec5=_0x4ddec5||0x1f4;return function(_0x5b5a98){logger[_0x0253('0x26')](_0x5b5a98['stack']);if(_0x5b5a98[_0x0253('0x27')]){delete _0x5b5a98[_0x0253('0x27')];}_0x596b22[_0x0253('0x19')](_0x4ddec5)['send'](_0x5b5a98);};}exports['sendUserNotification']=function(_0x1ba562,_0x3534ee,_0x1c3955){if(!_0x1ba562[_0x0253('0x28')][_0x0253('0x29')](_0x0253('0x2a'))&&!_0x1ba562[_0x0253('0x28')][_0x0253('0x29')]('TemplateId')){throw new db[(_0x0253('0x2b'))][(_0x0253('0x2c'))](_0x0253('0x2d'));}else{if(_0x1ba562[_0x0253('0x28')][_0x0253('0x29')]('TemplateId')&&!_0x1ba562[_0x0253('0x28')][_0x0253('0x29')]('view')){throw new db[(_0x0253('0x2b'))][(_0x0253('0x2c'))](_0x0253('0x2e'));}if(!_0x1ba562['body']['hasOwnProperty'](_0x0253('0x2f'))){throw new db[(_0x0253('0x2b'))][(_0x0253('0x2c'))](_0x0253('0x30'));}else{try{var _0x16de19=JSON[_0x0253('0x31')](_0x1ba562['body'][_0x0253('0x2f')]);}catch(_0x434b68){logger['error'](_0x434b68);throw new db[(_0x0253('0x2b'))][(_0x0253('0x2c'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xb14948=[_0x0253('0x32'),_0x0253('0x33'),_0x0253('0x34'),_0x0253('0x35'),_0x0253('0x36'),'voicequeue',_0x0253('0x37'),_0x0253('0x38'),_0x0253('0x39')];if(_[_0x0253('0x3a')](_0x16de19,function(_0x2594c7){return!_[_0x0253('0x3b')](_0xb14948,_0x2594c7[_0x0253('0x3c')][_0x0253('0x3d')]());})){throw new db[(_0x0253('0x2b'))][(_0x0253('0x2c'))](_0x0253('0x3e'));}}}var _0x115d8f={};_0x115d8f[_0x0253('0x3f')]=_0x1ba562[_0x0253('0x28')][_0x0253('0x29')](_0x0253('0x3f'))?_0x1ba562[_0x0253('0x28')][_0x0253('0x3f')]:_0x1ba562[_0x0253('0x39')]['fullname'];_0x115d8f[_0x0253('0x40')]=_[_0x0253('0x41')](_0x1ba562[_0x0253('0x28')][_0x0253('0x40')])?null:_0x1ba562[_0x0253('0x28')][_0x0253('0x40')];_0x115d8f[_0x0253('0x42')]=_0x1ba562[_0x0253('0x28')]['beep']||![];_0x115d8f[_0x0253('0x43')]=_0x1ba562[_0x0253('0x39')]['id'];return getContent(_0x1ba562[_0x0253('0x28')])[_0x0253('0x23')](function(_0x190eac){_0x115d8f[_0x0253('0x28')]=_0x190eac;return getRecipients(_0x16de19);})[_0x0253('0x23')](function(_0x5ead62){_0x115d8f[_0x0253('0x44')]=_[_0x0253('0x45')](_0x5ead62)[_0x0253('0x46')](',');return db[_0x0253('0x47')][_0x0253('0x48')](function(_0x54b260){return db[_0x0253('0x49')][_0x0253('0x4a')](_0x115d8f,{'raw':!![],'transaction':_0x54b260})[_0x0253('0x23')](function(_0x499bbc){var _0x20adb6={'sender':_0x115d8f[_0x0253('0x3f')],'description':_0x115d8f[_0x0253('0x40')],'content':_0x115d8f[_0x0253('0x28')],'beep':_0x115d8f[_0x0253('0x42')]};_0x5ead62[_0x0253('0x4b')](function(_0x34f863){_0x20adb6[_0x0253('0x4c')]=_0x34f863;socket[_0x0253('0x4d')]('userNotification:send',_0x20adb6);});return _0x499bbc;});});})[_0x0253('0x23')](respondWithResult(_0x3534ee,0xc9))[_0x0253('0x4e')](handleError(_0x3534ee,null));};function getContent(_0x434fa4){return new BPromise(function(_0x14ecef,_0x56f61d){if(_0x434fa4[_0x0253('0x2a')]){_0x14ecef(_0x434fa4[_0x0253('0x2a')]);return;}return db[_0x0253('0x4f')]['findOne']({'attributes':['html'],'where':{'id':_0x434fa4[_0x0253('0x50')]},'raw':!![]})[_0x0253('0x23')](function(_0x1b402a){if(!_0x1b402a)throw new db[(_0x0253('0x2b'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x21eeb9=Mustache[_0x0253('0x51')](_0x1b402a[_0x0253('0x52')],_0x434fa4[_0x0253('0x53')]);_0x14ecef(_0x21eeb9);})[_0x0253('0x4e')](function(_0x283d7b){_0x56f61d(_0x283d7b);});});}function getRecipients(_0x3228cb){return new BPromise(function(_0x324e1a,_0x5cc019){var _0x2fe9c6=[];var _0x599322=[];_0x3228cb['forEach'](function(_0x514704){var _0x4dc65f=_[_0x0253('0x54')](_0x514704[_0x0253('0x3c')][_0x0253('0x3d')]());if(_0x4dc65f==='User'){_0x2fe9c6=_[_0x0253('0x55')](_0x2fe9c6,_0x514704[_0x0253('0x56')]);}else{if(_[_0x0253('0x3b')](_0x4dc65f,_0x0253('0x57')))_0x4dc65f=_0x4dc65f[_0x0253('0x58')](_0x0253('0x57'),_0x0253('0x59'));_0x514704['ids']['forEach'](function(_0x49a3b3){_0x599322[_0x0253('0x5a')](getAgents(_0x4dc65f,_0x49a3b3));});}});return BPromise[_0x0253('0x5b')](_0x599322)['then'](function(_0x759f7c){_0x2fe9c6=_[_0x0253('0x55')](_0x2fe9c6,_['flatten'](_0x759f7c));_0x324e1a(_0x2fe9c6);})['catch'](function(_0x65c80f){_0x5cc019(_0x65c80f);});});}function getAgents(_0x26bd21,_0x1c2afb){return new BPromise(function(_0x24a914,_0x30f950){return db[_0x26bd21]['findOne']({'where':{'id':_0x1c2afb}})[_0x0253('0x23')](function(_0x5e9ab8){return _0x5e9ab8[_0x0253('0x5c')]({'attributes':['id'],'raw':!![]})[_0x0253('0x23')](function(_0x578614){var _0x6e8bda=_[_0x0253('0x5d')](_0x578614,'id');_0x24a914(_0x6e8bda);});})[_0x0253('0x4e')](function(_0x20e1e3){_0x30f950(_0x20e1e3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 75172b1..bde593a 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 _0x1bf0=['events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ba00c,_0x10f136){var _0x4a4853=function(_0x42add8){while(--_0x42add8){_0x2ba00c['push'](_0x2ba00c['shift']());}};_0x4a4853(++_0x10f136);}(_0x1bf0,0x156));var _0x01bf=function(_0x2bf0b0,_0xbb08c5){_0x2bf0b0=_0x2bf0b0-0x0;var _0x10a6bf=_0x1bf0[_0x2bf0b0];return _0x10a6bf;};'use strict';var EventEmitter=require(_0x01bf('0x0'));var UserNotification=require(_0x01bf('0x1'))['db'][_0x01bf('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01bf('0x3'),'afterUpdate':_0x01bf('0x4'),'afterDestroy':_0x01bf('0x5')};function emitEvent(_0x2a878d){return function(_0x515837,_0x43896c,_0x1ea8d0){UserNotificationEvents[_0x01bf('0x6')](_0x2a878d+':'+_0x515837['id'],_0x515837);UserNotificationEvents[_0x01bf('0x6')](_0x2a878d,_0x515837);_0x1ea8d0(null);};}for(var e in events){if(events[_0x01bf('0x7')](e)){var event=events[e];UserNotification[_0x01bf('0x8')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x0e0f=['../../mysqldb','UserNotification','save','update','hasOwnProperty','hook','exports','events'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x0e0f,0xd7));var _0xf0e0=function(_0x361630,_0x535450){_0x361630=_0x361630-0x0;var _0x61efd7=_0x0e0f[_0x361630];return _0x61efd7;};'use strict';var EventEmitter=require(_0xf0e0('0x0'));var UserNotification=require(_0xf0e0('0x1'))['db'][_0xf0e0('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0e0('0x3'),'afterUpdate':_0xf0e0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1eab8f){return function(_0x30ed1c,_0x4e47a4,_0x558155){UserNotificationEvents['emit'](_0x1eab8f+':'+_0x30ed1c['id'],_0x30ed1c);UserNotificationEvents['emit'](_0x1eab8f,_0x30ed1c);_0x558155(null);};}for(var e in events){if(events[_0xf0e0('0x5')](e)){var event=events[e];UserNotification[_0xf0e0('0x6')](e,emitEvent(event));}}module[_0xf0e0('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 83bf9bc..e8c7619 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 _0x952f=['moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','lodash','api'];(function(_0x258653,_0x3fb029){var _0x550ab8=function(_0x236ba2){while(--_0x236ba2){_0x258653['push'](_0x258653['shift']());}};_0x550ab8(++_0x3fb029);}(_0x952f,0x1ed));var _0xf952=function(_0x3d89ce,_0x5d5e4b){_0x3d89ce=_0x3d89ce-0x0;var _0x494a2e=_0x952f[_0x3d89ce];return _0x494a2e;};'use strict';var _=require(_0xf952('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf952('0x1'));var moment=require(_0xf952('0x2'));var BPromise=require('bluebird');var rp=require(_0xf952('0x3'));var fs=require('fs');var path=require(_0xf952('0x4'));var rimraf=require(_0xf952('0x5'));var config=require(_0xf952('0x6'));var attributes=require(_0xf952('0x7'));module[_0xf952('0x8')]=function(_0x487ba7,_0x1a55eb){return _0x487ba7['define'](_0xf952('0x9'),attributes,{'tableName':_0xf952('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbe49=['api','moment','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0xbe49,0x1b7));var _0x9be4=function(_0x5976a3,_0x50616e){_0x5976a3=_0x5976a3-0x0;var _0x3d8dfa=_0xbe49[_0x5976a3];return _0x3d8dfa;};'use strict';var _=require(_0x9be4('0x0'));var util=require(_0x9be4('0x1'));var logger=require(_0x9be4('0x2'))(_0x9be4('0x3'));var moment=require(_0x9be4('0x4'));var BPromise=require('bluebird');var rp=require(_0x9be4('0x5'));var fs=require('fs');var path=require(_0x9be4('0x6'));var rimraf=require(_0x9be4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9be4('0x8'));module[_0x9be4('0x9')]=function(_0x1e536a,_0x8d453c){return _0x1e536a[_0x9be4('0xa')](_0x9be4('0xb'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9be4('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6fabd9c..d72ddf3 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 _0x3cb1=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x21599b,_0x5dc6c9){var _0xe35621=function(_0x29ed09){while(--_0x29ed09){_0x21599b['push'](_0x21599b['shift']());}};_0xe35621(++_0x5dc6c9);}(_0x3cb1,0x1b0));var _0x13cb=function(_0x5413df,_0xb6b70f){_0x5413df=_0x5413df-0x0;var _0x4d0ee1=_0x3cb1[_0x5413df];return _0x4d0ee1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x13cb('0x0'));var fs=require('fs');var Redis=require(_0x13cb('0x1'));var db=require(_0x13cb('0x2'))['db'];var utils=require(_0x13cb('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x13cb('0x4')][_0x13cb('0x5')]({'port':0x232a});config[_0x13cb('0x6')]=_[_0x13cb('0x7')](config[_0x13cb('0x6')],{'host':_0x13cb('0x8'),'port':0x18eb});var socket=require(_0x13cb('0x9'))(new Redis(config['redis']));require(_0x13cb('0xa'))[_0x13cb('0xb')](socket);function respondWithRpcPromise(_0x1ff4b7,_0x396528,_0x3706a3){return new BPromise(function(_0x5b91d9,_0xade676){return client[_0x13cb('0xc')](_0x1ff4b7,_0x3706a3)[_0x13cb('0xd')](function(_0x3296cb){logger[_0x13cb('0xe')](_0x13cb('0xf'),_0x396528,_0x13cb('0x10'));logger[_0x13cb('0x11')](_0x13cb('0x12'),_0x396528,_0x13cb('0x10'),JSON[_0x13cb('0x13')](_0x3296cb));if(_0x3296cb[_0x13cb('0x14')]){if(_0x3296cb[_0x13cb('0x14')][_0x13cb('0x15')]===0x1f4){logger[_0x13cb('0x14')]('UserNotification,\x20%s,\x20%s',_0x396528,_0x3296cb[_0x13cb('0x14')][_0x13cb('0x16')]);return _0xade676(_0x3296cb[_0x13cb('0x14')][_0x13cb('0x16')]);}logger[_0x13cb('0x14')]('UserNotification,\x20%s,\x20%s',_0x396528,_0x3296cb[_0x13cb('0x14')][_0x13cb('0x16')]);return _0x5b91d9(_0x3296cb['error']['message']);}else{logger[_0x13cb('0xe')](_0x13cb('0xf'),_0x396528,_0x13cb('0x10'));_0x5b91d9(_0x3296cb[_0x13cb('0x17')][_0x13cb('0x16')]);}})[_0x13cb('0x18')](function(_0x197a14){logger[_0x13cb('0x14')](_0x13cb('0xf'),_0x396528,_0x197a14);_0xade676(_0x197a14);});});} \ No newline at end of file +var _0x5020=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x1ff68e,_0x51026b){var _0x6da642=function(_0x5a677f){while(--_0x5a677f){_0x1ff68e['push'](_0x1ff68e['shift']());}};_0x6da642(++_0x51026b);}(_0x5020,0x9f));var _0x0502=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5020[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x0502('0x0'));var moment=require(_0x0502('0x1'));var BPromise=require(_0x0502('0x2'));var rs=require(_0x0502('0x3'));var fs=require('fs');var Redis=require(_0x0502('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0502('0x5'))(_0x0502('0x6'));var config=require(_0x0502('0x7'));var jayson=require(_0x0502('0x8'));var client=jayson[_0x0502('0x9')][_0x0502('0xa')]({'port':0x232a});config[_0x0502('0xb')]=_['defaults'](config[_0x0502('0xb')],{'host':_0x0502('0xc'),'port':0x18eb});var socket=require(_0x0502('0xd'))(new Redis(config[_0x0502('0xb')]));require(_0x0502('0xe'))[_0x0502('0xf')](socket);function respondWithRpcPromise(_0x1a83c8,_0x1395cf,_0x2f0651){return new BPromise(function(_0xa8e4b2,_0x19f2f5){return client[_0x0502('0x10')](_0x1a83c8,_0x2f0651)['then'](function(_0x37b833){logger[_0x0502('0x11')](_0x0502('0x12'),_0x1395cf,'request\x20sent');logger[_0x0502('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x1395cf,_0x0502('0x14'),JSON['stringify'](_0x37b833));if(_0x37b833[_0x0502('0x15')]){if(_0x37b833[_0x0502('0x15')][_0x0502('0x16')]===0x1f4){logger[_0x0502('0x15')]('UserNotification,\x20%s,\x20%s',_0x1395cf,_0x37b833[_0x0502('0x15')][_0x0502('0x17')]);return _0x19f2f5(_0x37b833[_0x0502('0x15')][_0x0502('0x17')]);}logger[_0x0502('0x15')](_0x0502('0x12'),_0x1395cf,_0x37b833[_0x0502('0x15')]['message']);return _0xa8e4b2(_0x37b833[_0x0502('0x15')][_0x0502('0x17')]);}else{logger[_0x0502('0x11')](_0x0502('0x12'),_0x1395cf,'request\x20sent');_0xa8e4b2(_0x37b833[_0x0502('0x18')][_0x0502('0x17')]);}})[_0x0502('0x19')](function(_0x55d8ff){logger['error']('UserNotification,\x20%s,\x20%s',_0x1395cf,_0x55d8ff);_0x19f2f5(_0x55d8ff);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ef3ade5..3083a62 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 _0xd634=['register','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x1ac33b,_0x5e027b){var _0x42c871=function(_0x359e85){while(--_0x359e85){_0x1ac33b['push'](_0x1ac33b['shift']());}};_0x42c871(++_0x5e027b);}(_0xd634,0x16d));var _0x4d63=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xd634[_0x257642];return _0x3d813b;};'use strict';var UserNotificationEvents=require(_0x4d63('0x0'));var events=[_0x4d63('0x1'),_0x4d63('0x2'),_0x4d63('0x3')];function createListener(_0x3c19d9,_0xaae62){return function(_0x32ecfc){_0xaae62[_0x4d63('0x4')](_0x3c19d9,_0x32ecfc);};}function removeListener(_0x45ef6a,_0x417cc1){return function(){UserNotificationEvents[_0x4d63('0x5')](_0x45ef6a,_0x417cc1);};}exports[_0x4d63('0x6')]=function(_0x3cd8d2){for(var _0x20c8f8=0x0,_0x8a6f83=events['length'];_0x20c8f8<_0x8a6f83;_0x20c8f8++){var _0x98217=events[_0x20c8f8];var _0x52e21c=createListener('userNotification:'+_0x98217,_0x3cd8d2);UserNotificationEvents['on'](_0x98217,_0x52e21c);}}; \ No newline at end of file +var _0xf43e=['register','length','./userNotification.events','save','remove','removeListener'];(function(_0x3941d4,_0x445e2f){var _0x42e507=function(_0x50a584){while(--_0x50a584){_0x3941d4['push'](_0x3941d4['shift']());}};_0x42e507(++_0x445e2f);}(_0xf43e,0xf8));var _0xef43=function(_0x360bc4,_0x38f1){_0x360bc4=_0x360bc4-0x0;var _0x327a89=_0xf43e[_0x360bc4];return _0x327a89;};'use strict';var UserNotificationEvents=require(_0xef43('0x0'));var events=[_0xef43('0x1'),_0xef43('0x2'),'update'];function createListener(_0x2139b5,_0x3011be){return function(_0x38316a){_0x3011be['emit'](_0x2139b5,_0x38316a);};}function removeListener(_0x2abd48,_0x40f3e4){return function(){UserNotificationEvents[_0xef43('0x3')](_0x2abd48,_0x40f3e4);};}exports[_0xef43('0x4')]=function(_0x13481c){for(var _0x1686db=0x0,_0x3113f2=events[_0xef43('0x5')];_0x1686db<_0x3113f2;_0x1686db++){var _0x35c00c=events[_0x1686db];var _0x2951ce=createListener('userNotification:'+_0x35c00c,_0x13481c);UserNotificationEvents['on'](_0x35c00c,_0x2951ce);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 74c593d..d4d761a 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x298615,_0x5b514){var _0x427243=function(_0x2d817d){while(--_0x2d817d){_0x298615['push'](_0x298615['shift']());}};_0x427243(++_0x5b514);}(_0xedd9,0xfc));var _0x9edd=function(_0x173f04,_0x219684){_0x173f04=_0x173f04-0x0;var _0x3888bf=_0xedd9[_0x173f04];return _0x3888bf;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x343857,_0x951b15){var _0x392e37=function(_0x2d555e){while(--_0x2d555e){_0x343857['push'](_0x343857['shift']());}};_0x392e37(++_0x951b15);}(_0xedd9,0xfc));var _0x9edd=function(_0x2c33f4,_0x25ece0){_0x2c33f4=_0x2c33f4-0x0;var _0x51023=_0xedd9[_0x2c33f4];return _0x51023;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 5f946a1..2c1314f 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 _0xd771=['sequelize','INTEGER'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0xd771,0x7a));var _0x1d77=function(_0xeef697,_0x3644df){_0xeef697=_0xeef697-0x0;var _0x5a6115=_0xd771[_0xeef697];return _0x5a6115;};'use strict';var Sequelize=require(_0x1d77('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1d77('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5bb8=['exports','INTEGER','sequelize'];(function(_0x34b167,_0x87c65e){var _0x2f9831=function(_0x46252f){while(--_0x46252f){_0x34b167['push'](_0x34b167['shift']());}};_0x2f9831(++_0x87c65e);}(_0x5bb8,0x158));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x85bb('0x0'));module[_0x85bb('0x1')]={'penalty':{'type':Sequelize[_0x85bb('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 06f48c3..eb16243 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 _0xe138=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x424012,_0x5cb32c){var _0x4ece5f=function(_0x5ae6a0){while(--_0x5ae6a0){_0x424012['push'](_0x424012['shift']());}};_0x4ece5f(++_0x5cb32c);}(_0xe138,0xa8));var _0x8e13=function(_0x4ebb72,_0x4110e1){_0x4ebb72=_0x4ebb72-0x0;var _0x14f72a=_0xe138[_0x4ebb72];return _0x14f72a;};'use strict';var _=require(_0x8e13('0x0'));var util=require(_0x8e13('0x1'));var logger=require(_0x8e13('0x2'))(_0x8e13('0x3'));var moment=require('moment');var BPromise=require(_0x8e13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e13('0x5'));var rimraf=require(_0x8e13('0x6'));var config=require(_0x8e13('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x8e13('0x8')]=function(_0x33a959,_0x5cace7){return _0x33a959[_0x8e13('0x9')](_0x8e13('0xa'),attributes,{'tableName':_0x8e13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7026=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues'];(function(_0x72ad36,_0x4c4898){var _0x41926f=function(_0xbb9691){while(--_0xbb9691){_0x72ad36['push'](_0x72ad36['shift']());}};_0x41926f(++_0x4c4898);}(_0x7026,0x18c));var _0x6702=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7026[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6702('0x0'))(_0x6702('0x1'));var moment=require(_0x6702('0x2'));var BPromise=require(_0x6702('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6702('0x4'));var rimraf=require(_0x6702('0x5'));var config=require(_0x6702('0x6'));var attributes=require(_0x6702('0x7'));module[_0x6702('0x8')]=function(_0x29eca6,_0x3884a5){return _0x29eca6[_0x6702('0x9')]('UserOpenchannelQueue',attributes,{'tableName':_0x6702('0xa'),'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 4c42d50..5d4edf0 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 _0x9fc2=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5bf756,_0x313666){var _0x5d3f18=function(_0xe5fd02){while(--_0xe5fd02){_0x5bf756['push'](_0x5bf756['shift']());}};_0x5d3f18(++_0x313666);}(_0x9fc2,0x1a1));var _0x29fc=function(_0xdc81d7,_0x5b9182){_0xdc81d7=_0xdc81d7-0x0;var _0x41ddc6=_0x9fc2[_0xdc81d7];return _0x41ddc6;};'use strict';var _=require(_0x29fc('0x0'));var util=require(_0x29fc('0x1'));var moment=require(_0x29fc('0x2'));var BPromise=require(_0x29fc('0x3'));var rs=require(_0x29fc('0x4'));var fs=require('fs');var Redis=require(_0x29fc('0x5'));var db=require(_0x29fc('0x6'))['db'];var utils=require(_0x29fc('0x7'));var logger=require(_0x29fc('0x8'))(_0x29fc('0x9'));var config=require(_0x29fc('0xa'));var jayson=require(_0x29fc('0xb'));var client=jayson[_0x29fc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x150b73,_0x544bde,_0x512404){return new BPromise(function(_0x4f6811,_0xb6c5d3){return client[_0x29fc('0xd')](_0x150b73,_0x512404)[_0x29fc('0xe')](function(_0x3ed0cb){logger[_0x29fc('0xf')](_0x29fc('0x10'),_0x544bde,_0x29fc('0x11'));logger[_0x29fc('0x12')](_0x29fc('0x13'),_0x544bde,_0x29fc('0x11'),JSON[_0x29fc('0x14')](_0x3ed0cb));if(_0x3ed0cb[_0x29fc('0x15')]){if(_0x3ed0cb['error'][_0x29fc('0x16')]===0x1f4){logger[_0x29fc('0x15')](_0x29fc('0x10'),_0x544bde,_0x3ed0cb[_0x29fc('0x15')][_0x29fc('0x17')]);return _0xb6c5d3(_0x3ed0cb[_0x29fc('0x15')][_0x29fc('0x17')]);}logger[_0x29fc('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x544bde,_0x3ed0cb[_0x29fc('0x15')][_0x29fc('0x17')]);return _0x4f6811(_0x3ed0cb['error'][_0x29fc('0x17')]);}else{logger[_0x29fc('0xf')](_0x29fc('0x10'),_0x544bde,_0x29fc('0x11'));_0x4f6811(_0x3ed0cb[_0x29fc('0x18')]['message']);}})[_0x29fc('0x19')](function(_0x2ad604){logger[_0x29fc('0x15')](_0x29fc('0x10'),_0x544bde,_0x2ad604);_0xb6c5d3(_0x2ad604);});});} \ No newline at end of file +var _0xbf1a=['stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x508f50,_0x1c557c){var _0x3aab22=function(_0x316e63){while(--_0x316e63){_0x508f50['push'](_0x508f50['shift']());}};_0x3aab22(++_0x1c557c);}(_0xbf1a,0x1a4));var _0xabf1=function(_0x493bd0,_0x1960e7){_0x493bd0=_0x493bd0-0x0;var _0x47c5d3=_0xbf1a[_0x493bd0];return _0x47c5d3;};'use strict';var _=require(_0xabf1('0x0'));var util=require('util');var moment=require(_0xabf1('0x1'));var BPromise=require(_0xabf1('0x2'));var rs=require(_0xabf1('0x3'));var fs=require('fs');var Redis=require(_0xabf1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabf1('0x5'));var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));var config=require(_0xabf1('0x8'));var jayson=require(_0xabf1('0x9'));var client=jayson['client'][_0xabf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c842e,_0x277283,_0x2e513d){return new BPromise(function(_0x2c05f4,_0x466fa3){return client[_0xabf1('0xb')](_0x2c842e,_0x2e513d)[_0xabf1('0xc')](function(_0x409ca0){logger['info'](_0xabf1('0xd'),_0x277283,_0xabf1('0xe'));logger[_0xabf1('0xf')](_0xabf1('0x10'),_0x277283,_0xabf1('0xe'),JSON[_0xabf1('0x11')](_0x409ca0));if(_0x409ca0[_0xabf1('0x12')]){if(_0x409ca0[_0xabf1('0x12')]['code']===0x1f4){logger[_0xabf1('0x12')](_0xabf1('0xd'),_0x277283,_0x409ca0['error'][_0xabf1('0x13')]);return _0x466fa3(_0x409ca0['error'][_0xabf1('0x13')]);}logger[_0xabf1('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x277283,_0x409ca0[_0xabf1('0x12')][_0xabf1('0x13')]);return _0x2c05f4(_0x409ca0[_0xabf1('0x12')][_0xabf1('0x13')]);}else{logger[_0xabf1('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x277283,_0xabf1('0xe'));_0x2c05f4(_0x409ca0[_0xabf1('0x15')][_0xabf1('0x13')]);}})[_0xabf1('0x16')](function(_0x2447cb){logger['error'](_0xabf1('0xd'),_0x277283,_0x2447cb);_0x466fa3(_0x2447cb);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a7cf459..6b7240c 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 _0x0dd6=['getResources','post','create','/:id/clone','clone','/:id/sections','addSections','put','update','delete','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','get','describe','/:id','show','/:id/resources'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0dd6,0x98));var _0x60dd=function(_0x2c6a9c,_0x244ed9){_0x2c6a9c=_0x2c6a9c-0x0;var _0x21591f=_0x0dd6[_0x2c6a9c];return _0x21591f;};'use strict';var multer=require(_0x60dd('0x0'));var util=require(_0x60dd('0x1'));var path=require(_0x60dd('0x2'));var timeout=require(_0x60dd('0x3'));var express=require(_0x60dd('0x4'));var router=express[_0x60dd('0x5')]();var fs_extra=require(_0x60dd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x60dd('0x7'));var config=require('../../config/environment');var controller=require(_0x60dd('0x8'));router['get']('/',auth[_0x60dd('0x9')](),controller[_0x60dd('0xa')]);router[_0x60dd('0xb')]('/describe',auth[_0x60dd('0x9')](),controller[_0x60dd('0xc')]);router[_0x60dd('0xb')](_0x60dd('0xd'),auth[_0x60dd('0x9')](),controller[_0x60dd('0xe')]);router['get']('/:id/sections',auth[_0x60dd('0x9')](),controller['getSections']);router[_0x60dd('0xb')](_0x60dd('0xf'),auth[_0x60dd('0x9')](),controller[_0x60dd('0x10')]);router[_0x60dd('0x11')]('/',auth[_0x60dd('0x9')](),controller[_0x60dd('0x12')]);router[_0x60dd('0x11')](_0x60dd('0x13'),auth[_0x60dd('0x9')](),controller[_0x60dd('0x14')]);router[_0x60dd('0x11')](_0x60dd('0x15'),auth[_0x60dd('0x9')](),controller[_0x60dd('0x16')]);router['post'](_0x60dd('0xf'),auth[_0x60dd('0x9')](),controller['addResources']);router[_0x60dd('0x17')](_0x60dd('0xd'),auth['isAuthenticated'](),controller[_0x60dd('0x18')]);router['delete'](_0x60dd('0xd'),auth[_0x60dd('0x9')](),controller['destroy']);router[_0x60dd('0x19')]('/:id/sections',auth['isAuthenticated'](),controller[_0x60dd('0x1a')]);router[_0x60dd('0x19')](_0x60dd('0xf'),auth[_0x60dd('0x9')](),controller[_0x60dd('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xfd61=['/:id/resources','create','post','/:id/clone','clone','addResources','put','update','delete','destroy','/:id/sections','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','getSections'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfd61,0x176));var _0x1fd6=function(_0x339f54,_0x3ff67e){_0x339f54=_0x339f54-0x0;var _0x23bb0a=_0xfd61[_0x339f54];return _0x23bb0a;};'use strict';var multer=require(_0x1fd6('0x0'));var util=require(_0x1fd6('0x1'));var path=require(_0x1fd6('0x2'));var timeout=require(_0x1fd6('0x3'));var express=require(_0x1fd6('0x4'));var router=express[_0x1fd6('0x5')]();var fs_extra=require(_0x1fd6('0x6'));var auth=require(_0x1fd6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1fd6('0x8'));var controller=require(_0x1fd6('0x9'));router[_0x1fd6('0xa')]('/',auth[_0x1fd6('0xb')](),controller['index']);router[_0x1fd6('0xa')](_0x1fd6('0xc'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0xd')]);router[_0x1fd6('0xa')](_0x1fd6('0xe'),auth[_0x1fd6('0xb')](),controller['show']);router['get']('/:id/sections',auth['isAuthenticated'](),controller[_0x1fd6('0xf')]);router[_0x1fd6('0xa')](_0x1fd6('0x10'),auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x11')]);router[_0x1fd6('0x12')](_0x1fd6('0x13'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x14')]);router[_0x1fd6('0x12')]('/:id/sections',auth[_0x1fd6('0xb')](),controller['addSections']);router[_0x1fd6('0x12')](_0x1fd6('0x10'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x15')]);router[_0x1fd6('0x16')](_0x1fd6('0xe'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x17')]);router[_0x1fd6('0x18')](_0x1fd6('0xe'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x19')]);router[_0x1fd6('0x18')](_0x1fd6('0x1a'),auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x1b')]);router['delete']('/:id/resources',auth[_0x1fd6('0xb')](),controller[_0x1fd6('0x1c')]);module[_0x1fd6('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 6ec8e14..2482e1f 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 _0xae93=['crudPermissions','getDataValue','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xae93,0x168));var _0x3ae9=function(_0x187dc8,_0x526ed6){_0x187dc8=_0x187dc8-0x0;var _0xb02eaa=_0xae93[_0x187dc8];return _0xb02eaa;};'use strict';var Sequelize=require('sequelize');module[_0x3ae9('0x0')]={'name':{'type':Sequelize[_0x3ae9('0x1')],'allowNull':![],'unique':_0x3ae9('0x2')},'crudPermissions':{'type':Sequelize[_0x3ae9('0x1')],'set':function(_0x21907c){this[_0x3ae9('0x3')](_0x3ae9('0x4'),_0x21907c?_0x21907c['join'](''):[]);},'get':function(){return this[_0x3ae9('0x5')](_0x3ae9('0x4'))?this[_0x3ae9('0x5')](_0x3ae9('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3ae9('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2796=['getDataValue','split','BOOLEAN','sequelize','STRING','crudPermissions','join'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2796,0x106));var _0x6279=function(_0x71ea77,_0x3ee3e){_0x71ea77=_0x71ea77-0x0;var _0x43a078=_0x2796[_0x71ea77];return _0x43a078;};'use strict';var Sequelize=require(_0x6279('0x0'));module['exports']={'name':{'type':Sequelize[_0x6279('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x6279('0x1')],'set':function(_0x5ebc67){this['setDataValue'](_0x6279('0x2'),_0x5ebc67?_0x5ebc67[_0x6279('0x3')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x6279('0x4')]('crudPermissions')[_0x6279('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6279('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6279('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6279('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x6279('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x6279('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6279('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x6279('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 55f3a13..b2a143f 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 _0xa903=['Resources','UserProfileSection','update','addSections','destroy','sectionId','removeSections','ids','getSections','enabled','includes','subsections','push','findOne','Dashboard','forEach','resourceId','userProfileId','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./userProfile.socket','status','end','json','limit','undefined','count','offset','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','filters','intersection','create','body','params','includeAll','include','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','findAll','each','autoAssociation','UserProfileResource'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0xa903,0x163));var _0x3a90=function(_0x5c4a29,_0x21b060){_0x5c4a29=_0x5c4a29-0x0;var _0x6e0cb9=_0xa903[_0x5c4a29];return _0x6e0cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a90('0x0'));var zipdir=require(_0x3a90('0x1'));var jsonpatch=require(_0x3a90('0x2'));var rp=require(_0x3a90('0x3'));var moment=require(_0x3a90('0x4'));var BPromise=require(_0x3a90('0x5'));var Mustache=require(_0x3a90('0x6'));var util=require('util');var path=require(_0x3a90('0x7'));var sox=require(_0x3a90('0x8'));var csv=require(_0x3a90('0x9'));var ejs=require(_0x3a90('0xa'));var fs=require('fs');var fs_extra=require(_0x3a90('0xb'));var _=require(_0x3a90('0xc'));var squel=require(_0x3a90('0xd'));var crypto=require(_0x3a90('0xe'));var jsforce=require(_0x3a90('0xf'));var deskjs=require(_0x3a90('0x10'));var toCsv=require(_0x3a90('0x9'));var querystring=require(_0x3a90('0x11'));var Papa=require(_0x3a90('0x12'));var Redis=require(_0x3a90('0x13'));var authService=require(_0x3a90('0x14'));var qs=require(_0x3a90('0x15'));var as=require(_0x3a90('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a90('0x17'));var utils=require(_0x3a90('0x18'));var config=require(_0x3a90('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3a90('0x1a')]=_[_0x3a90('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3a90('0x1c'))(new Redis(config['redis']));require(_0x3a90('0x1d'))['register'](socket);function respondWithStatusCode(_0x59638f,_0x143f33){_0x143f33=_0x143f33||0xcc;return function(_0x12a8f6){if(_0x12a8f6){return _0x59638f['sendStatus'](_0x143f33);}return _0x59638f[_0x3a90('0x1e')](_0x143f33)[_0x3a90('0x1f')]();};}function respondWithResult(_0x111837,_0x389659){_0x389659=_0x389659||0xc8;return function(_0x1432ae){if(_0x1432ae){return _0x111837[_0x3a90('0x1e')](_0x389659)[_0x3a90('0x20')](_0x1432ae);}};}function respondWithFilteredResult(_0x5e86de,_0x27168f){return function(_0x57df6c){if(_0x57df6c){var _0x1d7383=typeof _0x27168f['offset']==='undefined'&&typeof _0x27168f[_0x3a90('0x21')]===_0x3a90('0x22');var _0x1137c9=_0x57df6c[_0x3a90('0x23')];var _0x4cd2d5=_0x1d7383?0x0:_0x27168f[_0x3a90('0x24')];var _0xb0aa62=_0x1d7383?_0x57df6c[_0x3a90('0x23')]:_0x27168f[_0x3a90('0x24')]+_0x27168f[_0x3a90('0x21')];var _0x43557e;if(_0xb0aa62>=_0x1137c9){_0xb0aa62=_0x1137c9;_0x43557e=0xc8;}else{_0x43557e=0xce;}_0x5e86de[_0x3a90('0x1e')](_0x43557e);return _0x5e86de['set']('Content-Range',_0x4cd2d5+'-'+_0xb0aa62+'/'+_0x1137c9)[_0x3a90('0x20')](_0x57df6c);}return null;};}function patchUpdates(_0x4ba76b){return function(_0x263f58){try{jsonpatch[_0x3a90('0x25')](_0x263f58,_0x4ba76b,!![]);}catch(_0x423185){return BPromise[_0x3a90('0x26')](_0x423185);}return _0x263f58[_0x3a90('0x27')]();};}function saveUpdates(_0x3f3275,_0x240ced){return function(_0x522d95){if(_0x522d95){return _0x522d95['update'](_0x3f3275)[_0x3a90('0x28')](function(_0x406a84){return _0x406a84;});}return null;};}function removeEntity(_0x34ad00,_0x4dcaf9){return function(_0x3ae64b){if(_0x3ae64b){return _0x3ae64b['destroy']()[_0x3a90('0x28')](function(){_0x34ad00['status'](0xcc)[_0x3a90('0x1f')]();});}};}function handleEntityNotFound(_0x4065e2,_0x279c84){return function(_0x1ed47d){if(!_0x1ed47d){_0x4065e2[_0x3a90('0x29')](0x194);}return _0x1ed47d;};}function handleError(_0x7f758d,_0x1a3cb3){_0x1a3cb3=_0x1a3cb3||0x1f4;return function(_0x83667){logger[_0x3a90('0x2a')](_0x83667[_0x3a90('0x2b')]);if(_0x83667['name']){delete _0x83667[_0x3a90('0x2c')];}_0x7f758d[_0x3a90('0x1e')](_0x1a3cb3)[_0x3a90('0x2d')](_0x83667);};}exports[_0x3a90('0x2e')]=function(_0x3460f0,_0x1483a8){var _0x226731={},_0x167f97={},_0x413c17={'count':0x0,'rows':[]};var _0x51810b=_[_0x3a90('0x2f')](db[_0x3a90('0x30')][_0x3a90('0x31')],function(_0x320bab){return{'name':_0x320bab[_0x3a90('0x32')],'type':_0x320bab[_0x3a90('0x33')]['key']};});_0x167f97[_0x3a90('0x34')]=_[_0x3a90('0x2f')](_0x51810b,_0x3a90('0x2c'));_0x167f97['query']=_[_0x3a90('0x35')](_0x3460f0[_0x3a90('0x36')]);_0x167f97['filters']=_['intersection'](_0x167f97[_0x3a90('0x34')],_0x167f97[_0x3a90('0x36')]);_0x226731[_0x3a90('0x37')]=_['intersection'](_0x167f97[_0x3a90('0x34')],qs[_0x3a90('0x38')](_0x3460f0[_0x3a90('0x36')][_0x3a90('0x38')]));_0x226731[_0x3a90('0x37')]=_0x226731[_0x3a90('0x37')][_0x3a90('0x39')]?_0x226731[_0x3a90('0x37')]:_0x167f97[_0x3a90('0x34')];if(!_0x3460f0['query'][_0x3a90('0x3a')](_0x3a90('0x3b'))){_0x226731[_0x3a90('0x21')]=qs['limit'](_0x3460f0[_0x3a90('0x36')][_0x3a90('0x21')]);_0x226731['offset']=qs['offset'](_0x3460f0[_0x3a90('0x36')][_0x3a90('0x24')]);}_0x226731[_0x3a90('0x3c')]=qs[_0x3a90('0x3d')](_0x3460f0['query'][_0x3a90('0x3d')]);_0x226731[_0x3a90('0x3e')]=qs['filters'](_[_0x3a90('0x3f')](_0x3460f0['query'],_0x167f97['filters']),_0x51810b);if(_0x3460f0[_0x3a90('0x36')][_0x3a90('0x40')]){_0x226731[_0x3a90('0x3e')]=_[_0x3a90('0x41')](_0x226731[_0x3a90('0x3e')],{'$or':_[_0x3a90('0x2f')](_0x51810b,function(_0x40d21e){if(_0x40d21e[_0x3a90('0x33')]!==_0x3a90('0x42')){var _0x1db934={};_0x1db934[_0x40d21e[_0x3a90('0x2c')]]={'$like':'%'+_0x3460f0[_0x3a90('0x36')][_0x3a90('0x40')]+'%'};return _0x1db934;}})});}_0x226731=_[_0x3a90('0x41')]({},_0x226731,_0x3460f0[_0x3a90('0x43')]);var _0x2d8cd4={'where':_0x226731['where']};return db[_0x3a90('0x30')]['count'](_0x2d8cd4)[_0x3a90('0x28')](function(_0x38a980){_0x413c17[_0x3a90('0x23')]=_0x38a980;if(_0x3460f0[_0x3a90('0x36')]['includeAll']){_0x226731['include']=[{'all':!![]}];}return db[_0x3a90('0x30')]['findAll'](_0x226731);})[_0x3a90('0x28')](function(_0x5b56d6){_0x413c17['rows']=_0x5b56d6;return _0x413c17;})[_0x3a90('0x28')](respondWithFilteredResult(_0x1483a8,_0x226731))[_0x3a90('0x44')](handleError(_0x1483a8,null));};exports[_0x3a90('0x45')]=function(_0x426ebf,_0x3226b5){var _0x5aeb8b={'raw':![],'where':{'id':_0x426ebf['params']['id']}},_0x5c3a08={};_0x5c3a08[_0x3a90('0x34')]=_[_0x3a90('0x35')](db[_0x3a90('0x30')][_0x3a90('0x31')]);_0x5c3a08['query']=_[_0x3a90('0x35')](_0x426ebf[_0x3a90('0x36')]);_0x5c3a08[_0x3a90('0x46')]=_[_0x3a90('0x47')](_0x5c3a08[_0x3a90('0x34')],_0x5c3a08[_0x3a90('0x36')]);_0x5aeb8b[_0x3a90('0x37')]=_[_0x3a90('0x47')](_0x5c3a08['model'],qs[_0x3a90('0x38')](_0x426ebf['query'][_0x3a90('0x38')]));_0x5aeb8b[_0x3a90('0x37')]=_0x5aeb8b[_0x3a90('0x37')][_0x3a90('0x39')]?_0x5aeb8b[_0x3a90('0x37')]:_0x5c3a08[_0x3a90('0x34')];if(_0x426ebf[_0x3a90('0x36')]['includeAll']){_0x5aeb8b['include']=[{'all':!![]}];}_0x5aeb8b=_[_0x3a90('0x41')]({},_0x5aeb8b,_0x426ebf['options']);return db[_0x3a90('0x30')]['find'](_0x5aeb8b)[_0x3a90('0x28')](handleEntityNotFound(_0x3226b5,null))[_0x3a90('0x28')](respondWithResult(_0x3226b5,null))['catch'](handleError(_0x3226b5,null));};exports[_0x3a90('0x48')]=function(_0x44c2d6,_0x416e1d){return db[_0x3a90('0x30')][_0x3a90('0x48')](_0x44c2d6[_0x3a90('0x49')],{})[_0x3a90('0x28')](respondWithResult(_0x416e1d,0xc9))[_0x3a90('0x44')](handleError(_0x416e1d,null));};exports['clone']=function(_0x46565e,_0x49bfa0){var _0x49b953={'where':{'id':_0x46565e[_0x3a90('0x4a')]['id']}},_0x4224ca={};_0x4224ca[_0x3a90('0x34')]=_['keys'](db[_0x3a90('0x30')][_0x3a90('0x31')]);_0x49b953['attributes']=_[_0x3a90('0x47')](_0x4224ca[_0x3a90('0x34')],qs[_0x3a90('0x38')](_0x46565e[_0x3a90('0x36')]['fields']));_0x49b953[_0x3a90('0x37')]=_0x49b953[_0x3a90('0x37')][_0x3a90('0x39')]?_0x49b953['attributes']:_0x4224ca[_0x3a90('0x34')];if(_0x46565e[_0x3a90('0x36')][_0x3a90('0x4b')]){_0x49b953[_0x3a90('0x4c')]=[{'all':!![]}];}_0x49b953=_[_0x3a90('0x41')]({},_0x49b953,_0x46565e[_0x3a90('0x43')]);return db[_0x3a90('0x30')][_0x3a90('0x4d')](_0x49b953)[_0x3a90('0x28')](handleEntityNotFound(_0x49bfa0,null))[_0x3a90('0x28')](function(_0x1f2c57){if(_0x1f2c57){var _0x37c203=_0x1f2c57[_0x3a90('0x4e')]({'plain':!![]});_0x37c203=qs[_0x3a90('0x4f')](_0x37c203,['id',_0x3a90('0x50'),_0x3a90('0x51'),_0x3a90('0x52')]);_0x46565e[_0x3a90('0x49')]=_[_0x3a90('0x4f')](_0x46565e[_0x3a90('0x49')],['id',_0x3a90('0x50'),_0x3a90('0x51')]);return db[_0x3a90('0x53')][_0x3a90('0x54')](function(_0x4e0c06){return db['UserProfile']['create'](_[_0x3a90('0x41')](_0x37c203,_0x46565e[_0x3a90('0x49')]),{'include':_0x46565e[_0x3a90('0x36')][_0x3a90('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x4e0c06})[_0x3a90('0x28')](function(_0x5f1cdb){var _0x3c9a40=_0x5f1cdb[_0x3a90('0x4e')]({'plain':!![]});return db['UserProfileSection'][_0x3a90('0x55')]({'where':{'userProfileId':_0x46565e[_0x3a90('0x4a')]['id']},'raw':!![]})[_0x3a90('0x28')](function(_0x5e3d08){if(_0x5e3d08){return BPromise[_0x3a90('0x56')](_0x5e3d08,function(_0xcafba5){return new BPromise(function(_0x5a296d,_0x378f3f){if(_0xcafba5[_0x3a90('0x57')]===null||_0xcafba5[_0x3a90('0x57')]===0x1)_0x5a296d(null);return db[_0x3a90('0x58')][_0x3a90('0x55')]({'where':{'sectionId':_0xcafba5['id']},'raw':!![]})[_0x3a90('0x28')](function(_0x297b15){var _0x1e4575=_[_0x3a90('0x2f')](_0x297b15,function(_0x3fd0de){return qs[_0x3a90('0x4f')](_0x3fd0de,['id','createdAt',_0x3a90('0x51'),'sectionId']);});_0x5a296d(_0x1e4575);})['catch'](function(_0x2a978d){_0x378f3f(_0x2a978d);});})['then'](function(_0x54b76b){var _0x288db4=qs['omit'](_0xcafba5,['id',_0x3a90('0x50'),_0x3a90('0x51')]);_0x288db4['userProfileId']=_0x3c9a40['id'];if(_0x54b76b)_0x288db4[_0x3a90('0x59')]=_0x54b76b;return _0x288db4;})[_0x3a90('0x28')](function(_0x2d70ae){return db[_0x3a90('0x5a')][_0x3a90('0x48')](_0x2d70ae,{'include':[{'model':db[_0x3a90('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x4e0c06});});})[_0x3a90('0x28')](function(){return _0x3c9a40;});}});});});}})[_0x3a90('0x28')](respondWithResult(_0x49bfa0,0xc9))[_0x3a90('0x44')](handleError(_0x49bfa0,null));};exports[_0x3a90('0x5b')]=function(_0x4ef8c1,_0x43c0c0){if(_0x4ef8c1[_0x3a90('0x49')]['id']){delete _0x4ef8c1[_0x3a90('0x49')]['id'];}return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0x4ef8c1[_0x3a90('0x4a')]['id']}})[_0x3a90('0x28')](handleEntityNotFound(_0x43c0c0,null))['then'](saveUpdates(_0x4ef8c1['body'],null))['then'](respondWithResult(_0x43c0c0,null))[_0x3a90('0x44')](handleError(_0x43c0c0,null));};exports['destroy']=function(_0x962875,_0x48ab2d){return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0x962875[_0x3a90('0x4a')]['id']}})[_0x3a90('0x28')](handleEntityNotFound(_0x48ab2d,null))[_0x3a90('0x28')](removeEntity(_0x48ab2d,null))[_0x3a90('0x44')](handleError(_0x48ab2d,null));};exports['describe']=function(_0x581a2f,_0x5ed44d){return db[_0x3a90('0x30')]['describe']()[_0x3a90('0x28')](respondWithResult(_0x5ed44d,null))[_0x3a90('0x44')](handleError(_0x5ed44d,null));};exports[_0x3a90('0x5c')]=function(_0x180ea7,_0x2b1d42){var _0x3a8c82=_0x180ea7[_0x3a90('0x49')];return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0x180ea7[_0x3a90('0x4a')]['id']}})[_0x3a90('0x28')](handleEntityNotFound(_0x2b1d42,null))[_0x3a90('0x28')](function(_0x6f368){if(_0x6f368){return db[_0x3a90('0x53')][_0x3a90('0x54')](function(_0x4a46bf){return db[_0x3a90('0x5a')][_0x3a90('0x5d')]({'where':{'userProfileId':_0x180ea7[_0x3a90('0x4a')]['id'],'sectionId':_[_0x3a90('0x2f')](_0x3a8c82,function(_0x44adf3){return _0x44adf3[_0x3a90('0x5e')];})},'transaction':_0x4a46bf})[_0x3a90('0x28')](function(){var _0x50cb11=_['map'](_0x3a8c82,function(_0x15fb65){_0x15fb65['userProfileId']=_0x180ea7[_0x3a90('0x4a')]['id'];return _0x15fb65;});var _0x3d8690=[];return BPromise['each'](_0x50cb11,function(_0xa733ae){return db[_0x3a90('0x5a')][_0x3a90('0x48')](_0xa733ae,{'include':[{'model':db[_0x3a90('0x58')],'as':_0x3a90('0x59')}],'raw':!![],'transaction':_0x4a46bf})['then'](function(_0x5d010a){_0x3d8690['push'](_0x5d010a[_0x3a90('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x3d8690;});});});}})[_0x3a90('0x28')](function(_0x55bc1d){return _0x55bc1d;})['then'](respondWithResult(_0x2b1d42,null))['catch'](handleError(_0x2b1d42,null));};exports[_0x3a90('0x5f')]=function(_0xb8c78d,_0x95397e){var _0x5f0934;return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0xb8c78d[_0x3a90('0x4a')]['id']},'attributes':['id',_0x3a90('0x2c')]})[_0x3a90('0x28')](handleEntityNotFound(_0x95397e,null))[_0x3a90('0x28')](function(_0xab700c){if(_0xab700c){_0x5f0934=_0xab700c;return db[_0x3a90('0x5a')][_0x3a90('0x5d')]({'where':{'userProfileId':_0xb8c78d[_0x3a90('0x4a')]['id'],'sectionId':_0xb8c78d['query'][_0x3a90('0x60')]}});}})[_0x3a90('0x28')](function(){return _0x5f0934;})['then'](respondWithStatusCode(_0x95397e,null))[_0x3a90('0x44')](handleError(_0x95397e,null));};exports[_0x3a90('0x61')]=function(_0x3bd20f,_0x51c89a){var _0x4f66b7=[];var _0x435434=[];return db[_0x3a90('0x5a')]['findAll']({'where':{'userProfileId':_0x3bd20f[_0x3a90('0x4a')]['id']},'raw':!![]})['then'](function(_0x310cc2){_0x4f66b7=_[_0x3a90('0x40')](_0x310cc2,function(_0x4bea60){return _0x4bea60[_0x3a90('0x62')]===0x1||_[_0x3a90('0x63')]([0x3eb,0x709],_0x4bea60['sectionId']);});if(!_['isEmpty'](_0x4f66b7)){return _['map'](_0x4f66b7,function(_0x3220ee){return _0x3220ee['sectionId'];});}else{return;}})[_0x3a90('0x28')](function(_0x3c1dc4){if(_0x3c1dc4)_0x435434=_0x3c1dc4;if(_[_0x3a90('0x63')](_0x435434,0x64)){var _0x29895c=_['find'](_0x4f66b7,{'sectionId':0x64});return hasDefaultDashboard(_0x29895c)['then'](function(_0x4dbb87){return _[_0x3a90('0x2f')](_0x4f66b7,function(_0x1be94f){if(_0x1be94f[_0x3a90('0x5e')]===0x64){_0x1be94f['subsections']=_0x4dbb87;}return _0x1be94f;});});}else{return;}})[_0x3a90('0x28')](function(_0x4046a1){if(_0x4046a1)_0x4f66b7=_0x4046a1;if(_['includes'](_0x435434,0x3eb)){var _0x26bac1=_['find'](_0x4f66b7,{'sectionId':0x3eb});return getCustomDashboards(_0x26bac1)[_0x3a90('0x28')](function(_0x305e3b){return _[_0x3a90('0x2f')](_0x4f66b7,function(_0x327760){if(_0x26bac1[_0x3a90('0x62')]){if(_0x327760['sectionId']===0x3eb){_0x327760[_0x3a90('0x64')]=_0x305e3b;}}else{if(_0x327760['sectionId']===0x64){if(!_0x327760['subsections']){_0x327760[_0x3a90('0x64')]=[];}_0x327760[_0x3a90('0x64')]=_0x327760[_0x3a90('0x64')]['concat'](_0x305e3b);}}return _0x327760;});});}else{return;}})[_0x3a90('0x28')](function(_0x3277d7){if(_0x3277d7)_0x4f66b7=_0x3277d7;if(_[_0x3a90('0x63')](_0x435434,0x709)){var _0x282c1f=_['find'](_0x4f66b7,{'sectionId':0x709});return getPlugins(_0x282c1f)[_0x3a90('0x28')](function(_0x95def1){if(_0x282c1f[_0x3a90('0x62')]){return _[_0x3a90('0x2f')](_0x4f66b7,function(_0x24f00b){if(_0x24f00b[_0x3a90('0x5e')]===0x709){_0x24f00b[_0x3a90('0x64')]=_0x95def1;}return _0x24f00b;});}else{var _0x1260ac={'sectionId':0x76c,'enabled':0x1,'subsections':_0x95def1};var _0x30a447=_['map'](_0x4f66b7);_0x30a447[_0x3a90('0x65')](_0x1260ac);return _0x30a447;}});}else{return;}})[_0x3a90('0x28')](function(_0x503485){if(_0x503485)_0x4f66b7=_0x503485;return _[_0x3a90('0x40')](_0x4f66b7,['enabled',0x1]);})[_0x3a90('0x28')](respondWithResult(_0x51c89a,null))['catch'](handleError(_0x51c89a,null));};function hasDefaultDashboard(_0x43c731){var _0x54d395=[0x65];return new BPromise(function(_0xd7f24e,_0x3387c6){try{if(_0x43c731['autoAssociation']){_0xd7f24e(_0x54d395);}else{return db[_0x3a90('0x58')][_0x3a90('0x66')]({'where':{'sectionId':_0x43c731['id']},'raw':!![]})[_0x3a90('0x28')](function(_0x5b668c){_0x5b668c?_0xd7f24e(_0x54d395):_0xd7f24e();});}}catch(_0x3c556c){_0x3387c6(_0x3c556c);}});}function getCustomDashboards(_0x3e8da5){var _0xa722af=[];return new BPromise(function(_0x4842f2,_0x324311){try{if(_0x3e8da5[_0x3a90('0x57')]){return db[_0x3a90('0x67')][_0x3a90('0x55')]({'raw':!![]})[_0x3a90('0x28')](function(_0x54af12){_0x54af12['forEach'](function(_0x369d64){_0xa722af[_0x3a90('0x65')](_0x369d64['id']+0x1869f);});_0x4842f2(_0xa722af);});}else{return db[_0x3a90('0x58')][_0x3a90('0x55')]({'where':{'sectionId':_0x3e8da5['id']},'raw':!![]})[_0x3a90('0x28')](function(_0xdf4f35){_0xdf4f35['forEach'](function(_0x4b789f){_0xa722af['push'](_0x4b789f['resourceId']+0x1869f);});_0x4842f2(_0xa722af);});}}catch(_0xb115fe){_0x324311(_0xb115fe);}});}function getPlugins(_0x595072){var _0x4e101f=[];return new BPromise(function(_0x4fb735,_0x38fb50){try{if(_0x595072[_0x3a90('0x57')]){return db['Plugin'][_0x3a90('0x55')]({'raw':!![]})['then'](function(_0x660dc4){_0x660dc4[_0x3a90('0x68')](function(_0x19ef50){_0x4e101f['push'](_0x19ef50['id']+0x15b38);});_0x4fb735(_0x4e101f);});}else{return db[_0x3a90('0x58')][_0x3a90('0x55')]({'where':{'sectionId':_0x595072['id']},'raw':!![]})[_0x3a90('0x28')](function(_0x33a2d5){_0x33a2d5[_0x3a90('0x68')](function(_0x274396){_0x4e101f[_0x3a90('0x65')](_0x274396[_0x3a90('0x69')]+0x15b38);});_0x4fb735(_0x4e101f);});}}catch(_0x50338d){_0x38fb50(_0x50338d);}});}exports['addResources']=function(_0x44031e,_0x6f4f87){return db[_0x3a90('0x30')]['find']({'where':{'id':_0x44031e[_0x3a90('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6f4f87,null))[_0x3a90('0x28')](function(_0x29c268){if(_0x29c268){return db['sequelize'][_0x3a90('0x54')](function(_0x5d60a9){return db[_0x3a90('0x5a')][_0x3a90('0x55')]({'where':{'userProfileId':_0x44031e[_0x3a90('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x3a90('0x28')](function(_0x7ab37f){if(_0x7ab37f){return db[_0x3a90('0x5a')][_0x3a90('0x5d')]({'where':{'userProfileId':_0x44031e[_0x3a90('0x4a')]['id'],'id':_[_0x3a90('0x2f')](_0x7ab37f,function(_0x37c81d){return _0x37c81d['id'];})},'transaction':_0x5d60a9});}})['then'](function(_0x3d61a7){var _0x304024=_['map'](_0x44031e['body'],function(_0xcbd271){_0xcbd271['userProfileId']=_0x44031e[_0x3a90('0x4a')]['id'];return _0xcbd271;});return db[_0x3a90('0x5a')]['bulkCreate'](_0x304024,{'raw':!![],'transaction':_0x5d60a9});})[_0x3a90('0x28')](function(_0x4a2e73){var _0xf7ea3=_[_0x3a90('0x40')](_[_0x3a90('0x2f')](_0x4a2e73,function(_0x529052){return _0x529052[_0x3a90('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0xf7ea3){return db['UserProfileSection'][_0x3a90('0x55')]({'where':{'userProfileId':_0x44031e['params']['id'],'sectionId':_[_0x3a90('0x2f')](_0xf7ea3,function(_0x1932ee){return _0x1932ee[_0x3a90('0x5e')];})},'attributes':['id',_0x3a90('0x5e')],'raw':!![]})[_0x3a90('0x28')](function(_0x41bc0c){var _0x23f704=_[_0x3a90('0x2f')](_0x44031e[_0x3a90('0x49')],function(_0x35e621){_0x35e621[_0x3a90('0x6a')]=_0x44031e[_0x3a90('0x4a')]['id'];return _0x35e621;});return db[_0x3a90('0x58')][_0x3a90('0x6b')](_0x23f704,{'raw':!![],'transaction':_0x5d60a9});});}})[_0x3a90('0x44')](handleError(_0x6f4f87,null));});}})[_0x3a90('0x28')](function(_0x515553){var _0x3c1c08=_[_0x3a90('0x2f')](_0x515553,function(_0x23a9ee){return _0x23a9ee['get']({'plain':!![]});});})[_0x3a90('0x28')](respondWithResult(_0x6f4f87,null))[_0x3a90('0x44')](handleError(_0x6f4f87,null));};exports['removeResources']=function(_0x14305d,_0xd0c038,_0x33421e){return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0x14305d[_0x3a90('0x4a')]['id']}})[_0x3a90('0x28')](handleEntityNotFound(_0xd0c038,null))[_0x3a90('0x28')](function(_0x4a857d){if(_0x4a857d){return _0x4a857d[_0x3a90('0x6c')](_0x14305d[_0x3a90('0x36')][_0x3a90('0x60')]);}})[_0x3a90('0x28')](respondWithStatusCode(_0xd0c038,null))[_0x3a90('0x44')](handleError(_0xd0c038,null));};exports[_0x3a90('0x6d')]=function(_0x44d306,_0x238c24){var _0x510127={};if(!_0x44d306['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0x44d306[_0x3a90('0x36')]['hasOwnProperty']('nolimit')){_0x510127[_0x3a90('0x21')]=qs[_0x3a90('0x21')](_0x44d306[_0x3a90('0x36')]['limit']);_0x510127[_0x3a90('0x24')]=qs[_0x3a90('0x24')](_0x44d306['query'][_0x3a90('0x24')]);}return db[_0x3a90('0x30')][_0x3a90('0x4d')]({'where':{'id':_0x44d306[_0x3a90('0x4a')]['id']}})[_0x3a90('0x28')](function(_0x3625ab){if(!_0x3625ab)throw new Error(_0x3a90('0x6e')+_0x44d306[_0x3a90('0x4a')]['id']);return db[_0x3a90('0x30')][_0x3a90('0x6d')](_0x44d306);})[_0x3a90('0x28')](respondWithFilteredResult(_0x238c24,_0x510127))[_0x3a90('0x44')](handleError(_0x238c24,null));}; \ No newline at end of file +var _0xd532=['Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','nolimit','limit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','destroy','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','clone','length','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','describe','addSections','userProfileId','removeSections','ids','includes','isEmpty','enabled','subsections','concat','findOne','Dashboard','forEach','push','resourceId'];(function(_0x288124,_0x43d146){var _0x40e990=function(_0x27525){while(--_0x27525){_0x288124['push'](_0x288124['shift']());}};_0x40e990(++_0x43d146);}(_0xd532,0x80));var _0x2d53=function(_0x1c8d08,_0x2c11b4){_0x1c8d08=_0x1c8d08-0x0;var _0x74a0c9=_0xd532[_0x1c8d08];return _0x74a0c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d53('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d53('0x1'));var rp=require('request-promise');var moment=require(_0x2d53('0x2'));var BPromise=require(_0x2d53('0x3'));var Mustache=require(_0x2d53('0x4'));var util=require(_0x2d53('0x5'));var path=require(_0x2d53('0x6'));var sox=require(_0x2d53('0x7'));var csv=require('to-csv');var ejs=require(_0x2d53('0x8'));var fs=require('fs');var fs_extra=require(_0x2d53('0x9'));var _=require(_0x2d53('0xa'));var squel=require(_0x2d53('0xb'));var crypto=require(_0x2d53('0xc'));var jsforce=require(_0x2d53('0xd'));var deskjs=require(_0x2d53('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d53('0xf'));var Papa=require(_0x2d53('0x10'));var Redis=require(_0x2d53('0x11'));var authService=require(_0x2d53('0x12'));var qs=require(_0x2d53('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d53('0x14'));var logger=require(_0x2d53('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2d53('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d53('0x17'))['db'];config[_0x2d53('0x18')]=_[_0x2d53('0x19')](config[_0x2d53('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d53('0x1a'))(new Redis(config['redis']));require(_0x2d53('0x1b'))[_0x2d53('0x1c')](socket);function respondWithStatusCode(_0x59ec82,_0x1c69fd){_0x1c69fd=_0x1c69fd||0xcc;return function(_0x5cf3c7){if(_0x5cf3c7){return _0x59ec82[_0x2d53('0x1d')](_0x1c69fd);}return _0x59ec82[_0x2d53('0x1e')](_0x1c69fd)[_0x2d53('0x1f')]();};}function respondWithResult(_0x56e4b0,_0x3e9405){_0x3e9405=_0x3e9405||0xc8;return function(_0x267a8b){if(_0x267a8b){return _0x56e4b0[_0x2d53('0x1e')](_0x3e9405)[_0x2d53('0x20')](_0x267a8b);}};}function respondWithFilteredResult(_0x463dc9,_0x4d3ce9){return function(_0x303298){if(_0x303298){var _0x5429d6=typeof _0x4d3ce9[_0x2d53('0x21')]===_0x2d53('0x22')&&typeof _0x4d3ce9['limit']===_0x2d53('0x22');var _0x5f110d=_0x303298[_0x2d53('0x23')];var _0x3ed50e=_0x5429d6?0x0:_0x4d3ce9[_0x2d53('0x21')];var _0x3fb66e=_0x5429d6?_0x303298[_0x2d53('0x23')]:_0x4d3ce9[_0x2d53('0x21')]+_0x4d3ce9['limit'];var _0x17c463;if(_0x3fb66e>=_0x5f110d){_0x3fb66e=_0x5f110d;_0x17c463=0xc8;}else{_0x17c463=0xce;}_0x463dc9[_0x2d53('0x1e')](_0x17c463);return _0x463dc9[_0x2d53('0x24')]('Content-Range',_0x3ed50e+'-'+_0x3fb66e+'/'+_0x5f110d)[_0x2d53('0x20')](_0x303298);}return null;};}function patchUpdates(_0x47d3eb){return function(_0x37431d){try{jsonpatch[_0x2d53('0x25')](_0x37431d,_0x47d3eb,!![]);}catch(_0x3e620f){return BPromise[_0x2d53('0x26')](_0x3e620f);}return _0x37431d['save']();};}function saveUpdates(_0x35d207,_0x57a633){return function(_0x1094b5){if(_0x1094b5){return _0x1094b5[_0x2d53('0x27')](_0x35d207)[_0x2d53('0x28')](function(_0x4dd6f9){return _0x4dd6f9;});}return null;};}function removeEntity(_0x2c65b5,_0x13a5f4){return function(_0x39a60e){if(_0x39a60e){return _0x39a60e[_0x2d53('0x29')]()[_0x2d53('0x28')](function(){_0x2c65b5['status'](0xcc)[_0x2d53('0x1f')]();});}};}function handleEntityNotFound(_0x433976,_0x497005){return function(_0xfc536){if(!_0xfc536){_0x433976[_0x2d53('0x1d')](0x194);}return _0xfc536;};}function handleError(_0x4b6831,_0x214b80){_0x214b80=_0x214b80||0x1f4;return function(_0x27a9aa){logger['error'](_0x27a9aa[_0x2d53('0x2a')]);if(_0x27a9aa[_0x2d53('0x2b')]){delete _0x27a9aa[_0x2d53('0x2b')];}_0x4b6831[_0x2d53('0x1e')](_0x214b80)[_0x2d53('0x2c')](_0x27a9aa);};}exports[_0x2d53('0x2d')]=function(_0x130a90,_0x231a6a){var _0x51a258={},_0x580de1={},_0x184655={'count':0x0,'rows':[]};var _0x37c4aa=_['map'](db[_0x2d53('0x2e')][_0x2d53('0x2f')],function(_0x266faf){return{'name':_0x266faf[_0x2d53('0x30')],'type':_0x266faf[_0x2d53('0x31')][_0x2d53('0x32')]};});_0x580de1[_0x2d53('0x33')]=_[_0x2d53('0x34')](_0x37c4aa,_0x2d53('0x2b'));_0x580de1[_0x2d53('0x35')]=_[_0x2d53('0x36')](_0x130a90[_0x2d53('0x35')]);_0x580de1['filters']=_[_0x2d53('0x37')](_0x580de1[_0x2d53('0x33')],_0x580de1[_0x2d53('0x35')]);_0x51a258[_0x2d53('0x38')]=_[_0x2d53('0x37')](_0x580de1[_0x2d53('0x33')],qs[_0x2d53('0x39')](_0x130a90[_0x2d53('0x35')][_0x2d53('0x39')]));_0x51a258[_0x2d53('0x38')]=_0x51a258[_0x2d53('0x38')]['length']?_0x51a258[_0x2d53('0x38')]:_0x580de1[_0x2d53('0x33')];if(!_0x130a90[_0x2d53('0x35')]['hasOwnProperty']('nolimit')){_0x51a258['limit']=qs['limit'](_0x130a90[_0x2d53('0x35')]['limit']);_0x51a258[_0x2d53('0x21')]=qs[_0x2d53('0x21')](_0x130a90[_0x2d53('0x35')][_0x2d53('0x21')]);}_0x51a258[_0x2d53('0x3a')]=qs['sort'](_0x130a90[_0x2d53('0x35')]['sort']);_0x51a258[_0x2d53('0x3b')]=qs['filters'](_[_0x2d53('0x3c')](_0x130a90[_0x2d53('0x35')],_0x580de1['filters']),_0x37c4aa);if(_0x130a90[_0x2d53('0x35')]['filter']){_0x51a258[_0x2d53('0x3b')]=_[_0x2d53('0x3d')](_0x51a258[_0x2d53('0x3b')],{'$or':_['map'](_0x37c4aa,function(_0x29ba10){if(_0x29ba10[_0x2d53('0x31')]!==_0x2d53('0x3e')){var _0x19ca7a={};_0x19ca7a[_0x29ba10['name']]={'$like':'%'+_0x130a90[_0x2d53('0x35')][_0x2d53('0x3f')]+'%'};return _0x19ca7a;}})});}_0x51a258=_[_0x2d53('0x3d')]({},_0x51a258,_0x130a90[_0x2d53('0x40')]);var _0xdd5624={'where':_0x51a258[_0x2d53('0x3b')]};return db['UserProfile'][_0x2d53('0x23')](_0xdd5624)['then'](function(_0xaced9d){_0x184655[_0x2d53('0x23')]=_0xaced9d;if(_0x130a90[_0x2d53('0x35')][_0x2d53('0x41')]){_0x51a258[_0x2d53('0x42')]=[{'all':!![]}];}return db[_0x2d53('0x2e')][_0x2d53('0x43')](_0x51a258);})[_0x2d53('0x28')](function(_0x159586){_0x184655[_0x2d53('0x44')]=_0x159586;return _0x184655;})[_0x2d53('0x28')](respondWithFilteredResult(_0x231a6a,_0x51a258))[_0x2d53('0x45')](handleError(_0x231a6a,null));};exports[_0x2d53('0x46')]=function(_0x37e3d9,_0x456bdc){var _0x33bf55={'raw':![],'where':{'id':_0x37e3d9[_0x2d53('0x47')]['id']}},_0x303a6b={};_0x303a6b[_0x2d53('0x33')]=_['keys'](db[_0x2d53('0x2e')][_0x2d53('0x2f')]);_0x303a6b[_0x2d53('0x35')]=_[_0x2d53('0x36')](_0x37e3d9[_0x2d53('0x35')]);_0x303a6b[_0x2d53('0x48')]=_[_0x2d53('0x37')](_0x303a6b[_0x2d53('0x33')],_0x303a6b[_0x2d53('0x35')]);_0x33bf55['attributes']=_[_0x2d53('0x37')](_0x303a6b[_0x2d53('0x33')],qs[_0x2d53('0x39')](_0x37e3d9[_0x2d53('0x35')][_0x2d53('0x39')]));_0x33bf55[_0x2d53('0x38')]=_0x33bf55[_0x2d53('0x38')]['length']?_0x33bf55[_0x2d53('0x38')]:_0x303a6b[_0x2d53('0x33')];if(_0x37e3d9[_0x2d53('0x35')][_0x2d53('0x41')]){_0x33bf55[_0x2d53('0x42')]=[{'all':!![]}];}_0x33bf55=_['merge']({},_0x33bf55,_0x37e3d9['options']);return db[_0x2d53('0x2e')][_0x2d53('0x49')](_0x33bf55)[_0x2d53('0x28')](handleEntityNotFound(_0x456bdc,null))[_0x2d53('0x28')](respondWithResult(_0x456bdc,null))[_0x2d53('0x45')](handleError(_0x456bdc,null));};exports[_0x2d53('0x4a')]=function(_0x5528c8,_0x27d571){return db[_0x2d53('0x2e')][_0x2d53('0x4a')](_0x5528c8[_0x2d53('0x4b')],{})[_0x2d53('0x28')](respondWithResult(_0x27d571,0xc9))[_0x2d53('0x45')](handleError(_0x27d571,null));};exports[_0x2d53('0x4c')]=function(_0x2117a7,_0x59d93){var _0x18da8f={'where':{'id':_0x2117a7[_0x2d53('0x47')]['id']}},_0x407ee3={};_0x407ee3[_0x2d53('0x33')]=_['keys'](db['UserProfile'][_0x2d53('0x2f')]);_0x18da8f['attributes']=_[_0x2d53('0x37')](_0x407ee3['model'],qs[_0x2d53('0x39')](_0x2117a7[_0x2d53('0x35')]['fields']));_0x18da8f['attributes']=_0x18da8f[_0x2d53('0x38')][_0x2d53('0x4d')]?_0x18da8f[_0x2d53('0x38')]:_0x407ee3[_0x2d53('0x33')];if(_0x2117a7[_0x2d53('0x35')][_0x2d53('0x41')]){_0x18da8f[_0x2d53('0x42')]=[{'all':!![]}];}_0x18da8f=_['merge']({},_0x18da8f,_0x2117a7[_0x2d53('0x40')]);return db[_0x2d53('0x2e')][_0x2d53('0x49')](_0x18da8f)[_0x2d53('0x28')](handleEntityNotFound(_0x59d93,null))[_0x2d53('0x28')](function(_0x1317c1){if(_0x1317c1){var _0xfa46ac=_0x1317c1[_0x2d53('0x4e')]({'plain':!![]});_0xfa46ac=qs[_0x2d53('0x4f')](_0xfa46ac,['id',_0x2d53('0x50'),'updatedAt',_0x2d53('0x51')]);_0x2117a7[_0x2d53('0x4b')]=_['omit'](_0x2117a7['body'],['id',_0x2d53('0x50'),_0x2d53('0x52')]);return db[_0x2d53('0x53')][_0x2d53('0x54')](function(_0x361563){return db[_0x2d53('0x2e')][_0x2d53('0x4a')](_['merge'](_0xfa46ac,_0x2117a7['body']),{'include':_0x2117a7[_0x2d53('0x35')][_0x2d53('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x361563})[_0x2d53('0x28')](function(_0x4e6bb3){var _0x2c7ced=_0x4e6bb3[_0x2d53('0x4e')]({'plain':!![]});return db[_0x2d53('0x55')][_0x2d53('0x43')]({'where':{'userProfileId':_0x2117a7[_0x2d53('0x47')]['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x59bb2d){if(_0x59bb2d){return BPromise[_0x2d53('0x56')](_0x59bb2d,function(_0x11f03f){return new BPromise(function(_0x408754,_0x4d7f95){if(_0x11f03f[_0x2d53('0x57')]===null||_0x11f03f['autoAssociation']===0x1)_0x408754(null);return db['UserProfileResource'][_0x2d53('0x43')]({'where':{'sectionId':_0x11f03f['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x3b8350){var _0x99a617=_[_0x2d53('0x34')](_0x3b8350,function(_0x470e14){return qs[_0x2d53('0x4f')](_0x470e14,['id',_0x2d53('0x50'),_0x2d53('0x52'),_0x2d53('0x58')]);});_0x408754(_0x99a617);})[_0x2d53('0x45')](function(_0x58867d){_0x4d7f95(_0x58867d);});})[_0x2d53('0x28')](function(_0x5d7bab){var _0x2ac0dd=qs[_0x2d53('0x4f')](_0x11f03f,['id',_0x2d53('0x50'),_0x2d53('0x52')]);_0x2ac0dd['userProfileId']=_0x2c7ced['id'];if(_0x5d7bab)_0x2ac0dd[_0x2d53('0x59')]=_0x5d7bab;return _0x2ac0dd;})[_0x2d53('0x28')](function(_0x1b3ea4){return db[_0x2d53('0x55')][_0x2d53('0x4a')](_0x1b3ea4,{'include':[{'model':db[_0x2d53('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x361563});});})[_0x2d53('0x28')](function(){return _0x2c7ced;});}});});});}})[_0x2d53('0x28')](respondWithResult(_0x59d93,0xc9))[_0x2d53('0x45')](handleError(_0x59d93,null));};exports[_0x2d53('0x27')]=function(_0x2f46c9,_0x488358){if(_0x2f46c9[_0x2d53('0x4b')]['id']){delete _0x2f46c9[_0x2d53('0x4b')]['id'];}return db['UserProfile'][_0x2d53('0x49')]({'where':{'id':_0x2f46c9[_0x2d53('0x47')]['id']}})[_0x2d53('0x28')](handleEntityNotFound(_0x488358,null))[_0x2d53('0x28')](saveUpdates(_0x2f46c9[_0x2d53('0x4b')],null))[_0x2d53('0x28')](respondWithResult(_0x488358,null))[_0x2d53('0x45')](handleError(_0x488358,null));};exports[_0x2d53('0x29')]=function(_0x4d2329,_0x1ff3fc){return db[_0x2d53('0x2e')][_0x2d53('0x49')]({'where':{'id':_0x4d2329[_0x2d53('0x47')]['id']}})[_0x2d53('0x28')](handleEntityNotFound(_0x1ff3fc,null))[_0x2d53('0x28')](removeEntity(_0x1ff3fc,null))[_0x2d53('0x45')](handleError(_0x1ff3fc,null));};exports[_0x2d53('0x5b')]=function(_0x48de1e,_0x11a84a){return db[_0x2d53('0x2e')][_0x2d53('0x5b')]()[_0x2d53('0x28')](respondWithResult(_0x11a84a,null))[_0x2d53('0x45')](handleError(_0x11a84a,null));};exports[_0x2d53('0x5c')]=function(_0x222214,_0x13041f){var _0xb5159a=_0x222214[_0x2d53('0x4b')];return db[_0x2d53('0x2e')][_0x2d53('0x49')]({'where':{'id':_0x222214[_0x2d53('0x47')]['id']}})[_0x2d53('0x28')](handleEntityNotFound(_0x13041f,null))[_0x2d53('0x28')](function(_0x3d7cf9){if(_0x3d7cf9){return db[_0x2d53('0x53')][_0x2d53('0x54')](function(_0x2d3896){return db[_0x2d53('0x55')][_0x2d53('0x29')]({'where':{'userProfileId':_0x222214[_0x2d53('0x47')]['id'],'sectionId':_[_0x2d53('0x34')](_0xb5159a,function(_0x2f8c04){return _0x2f8c04[_0x2d53('0x58')];})},'transaction':_0x2d3896})[_0x2d53('0x28')](function(){var _0x297fc5=_[_0x2d53('0x34')](_0xb5159a,function(_0x1b9d7d){_0x1b9d7d[_0x2d53('0x5d')]=_0x222214[_0x2d53('0x47')]['id'];return _0x1b9d7d;});var _0x704ab0=[];return BPromise['each'](_0x297fc5,function(_0x5cd5a0){return db[_0x2d53('0x55')][_0x2d53('0x4a')](_0x5cd5a0,{'include':[{'model':db[_0x2d53('0x5a')],'as':_0x2d53('0x59')}],'raw':!![],'transaction':_0x2d3896})[_0x2d53('0x28')](function(_0xb63f8f){_0x704ab0['push'](_0xb63f8f[_0x2d53('0x4e')]({'plain':!![]}));});})[_0x2d53('0x28')](function(){return _0x704ab0;});});});}})['then'](function(_0x1c764d){return _0x1c764d;})[_0x2d53('0x28')](respondWithResult(_0x13041f,null))[_0x2d53('0x45')](handleError(_0x13041f,null));};exports[_0x2d53('0x5e')]=function(_0x47207c,_0x475307){var _0x5b4dca;return db[_0x2d53('0x2e')][_0x2d53('0x49')]({'where':{'id':_0x47207c[_0x2d53('0x47')]['id']},'attributes':['id','name']})[_0x2d53('0x28')](handleEntityNotFound(_0x475307,null))['then'](function(_0x4e1ed0){if(_0x4e1ed0){_0x5b4dca=_0x4e1ed0;return db['UserProfileSection'][_0x2d53('0x29')]({'where':{'userProfileId':_0x47207c['params']['id'],'sectionId':_0x47207c['query'][_0x2d53('0x5f')]}});}})[_0x2d53('0x28')](function(){return _0x5b4dca;})[_0x2d53('0x28')](respondWithStatusCode(_0x475307,null))[_0x2d53('0x45')](handleError(_0x475307,null));};exports['getSections']=function(_0x5a90b4,_0x376c4b){var _0x4d82f5=[];var _0x3a847b=[];return db['UserProfileSection'][_0x2d53('0x43')]({'where':{'userProfileId':_0x5a90b4['params']['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x13d65a){_0x4d82f5=_[_0x2d53('0x3f')](_0x13d65a,function(_0x6fe9a0){return _0x6fe9a0['enabled']===0x1||_[_0x2d53('0x60')]([0x3eb,0x709],_0x6fe9a0[_0x2d53('0x58')]);});if(!_[_0x2d53('0x61')](_0x4d82f5)){return _[_0x2d53('0x34')](_0x4d82f5,function(_0x2c271e){return _0x2c271e[_0x2d53('0x58')];});}else{return;}})[_0x2d53('0x28')](function(_0x1cc839){if(_0x1cc839)_0x3a847b=_0x1cc839;if(_[_0x2d53('0x60')](_0x3a847b,0x64)){var _0x5833c6=_['find'](_0x4d82f5,{'sectionId':0x64});return hasDefaultDashboard(_0x5833c6)[_0x2d53('0x28')](function(_0xab8a62){return _[_0x2d53('0x34')](_0x4d82f5,function(_0x263c78){if(_0x263c78[_0x2d53('0x58')]===0x64){_0x263c78['subsections']=_0xab8a62;}return _0x263c78;});});}else{return;}})[_0x2d53('0x28')](function(_0x1aeb4b){if(_0x1aeb4b)_0x4d82f5=_0x1aeb4b;if(_[_0x2d53('0x60')](_0x3a847b,0x3eb)){var _0x210739=_['find'](_0x4d82f5,{'sectionId':0x3eb});return getCustomDashboards(_0x210739)[_0x2d53('0x28')](function(_0x2d1518){return _[_0x2d53('0x34')](_0x4d82f5,function(_0x3e24dc){if(_0x210739[_0x2d53('0x62')]){if(_0x3e24dc[_0x2d53('0x58')]===0x3eb){_0x3e24dc[_0x2d53('0x63')]=_0x2d1518;}}else{if(_0x3e24dc[_0x2d53('0x58')]===0x64){if(!_0x3e24dc[_0x2d53('0x63')]){_0x3e24dc[_0x2d53('0x63')]=[];}_0x3e24dc[_0x2d53('0x63')]=_0x3e24dc[_0x2d53('0x63')][_0x2d53('0x64')](_0x2d1518);}}return _0x3e24dc;});});}else{return;}})[_0x2d53('0x28')](function(_0x7c0f55){if(_0x7c0f55)_0x4d82f5=_0x7c0f55;if(_['includes'](_0x3a847b,0x709)){var _0xbef6e2=_[_0x2d53('0x49')](_0x4d82f5,{'sectionId':0x709});return getPlugins(_0xbef6e2)[_0x2d53('0x28')](function(_0x3683d0){if(_0xbef6e2[_0x2d53('0x62')]){return _[_0x2d53('0x34')](_0x4d82f5,function(_0x435c09){if(_0x435c09['sectionId']===0x709){_0x435c09[_0x2d53('0x63')]=_0x3683d0;}return _0x435c09;});}else{var _0x2d7cfb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3683d0};var _0x271169=_['map'](_0x4d82f5);_0x271169['push'](_0x2d7cfb);return _0x271169;}});}else{return;}})[_0x2d53('0x28')](function(_0x23686b){if(_0x23686b)_0x4d82f5=_0x23686b;return _['filter'](_0x4d82f5,[_0x2d53('0x62'),0x1]);})[_0x2d53('0x28')](respondWithResult(_0x376c4b,null))[_0x2d53('0x45')](handleError(_0x376c4b,null));};function hasDefaultDashboard(_0x4885ad){var _0x3430eb=[0x65];return new BPromise(function(_0x1458d6,_0x3c421d){try{if(_0x4885ad[_0x2d53('0x57')]){_0x1458d6(_0x3430eb);}else{return db[_0x2d53('0x5a')][_0x2d53('0x65')]({'where':{'sectionId':_0x4885ad['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x1b55f8){_0x1b55f8?_0x1458d6(_0x3430eb):_0x1458d6();});}}catch(_0x582237){_0x3c421d(_0x582237);}});}function getCustomDashboards(_0x347739){var _0x4c05aa=[];return new BPromise(function(_0x2e5220,_0x3cbd08){try{if(_0x347739['autoAssociation']){return db[_0x2d53('0x66')][_0x2d53('0x43')]({'raw':!![]})['then'](function(_0x104727){_0x104727[_0x2d53('0x67')](function(_0x23fa21){_0x4c05aa['push'](_0x23fa21['id']+0x1869f);});_0x2e5220(_0x4c05aa);});}else{return db[_0x2d53('0x5a')][_0x2d53('0x43')]({'where':{'sectionId':_0x347739['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x368df2){_0x368df2[_0x2d53('0x67')](function(_0x3bf6b1){_0x4c05aa[_0x2d53('0x68')](_0x3bf6b1[_0x2d53('0x69')]+0x1869f);});_0x2e5220(_0x4c05aa);});}}catch(_0x2b61dc){_0x3cbd08(_0x2b61dc);}});}function getPlugins(_0x546537){var _0x4de169=[];return new BPromise(function(_0x9a3b96,_0x1423de){try{if(_0x546537[_0x2d53('0x57')]){return db[_0x2d53('0x6a')][_0x2d53('0x43')]({'raw':!![]})[_0x2d53('0x28')](function(_0x371080){_0x371080[_0x2d53('0x67')](function(_0x35677f){_0x4de169[_0x2d53('0x68')](_0x35677f['id']+0x15b38);});_0x9a3b96(_0x4de169);});}else{return db['UserProfileResource'][_0x2d53('0x43')]({'where':{'sectionId':_0x546537['id']},'raw':!![]})[_0x2d53('0x28')](function(_0x4a1e4d){_0x4a1e4d[_0x2d53('0x67')](function(_0x3d34dd){_0x4de169[_0x2d53('0x68')](_0x3d34dd['resourceId']+0x15b38);});_0x9a3b96(_0x4de169);});}}catch(_0x51031e){_0x1423de(_0x51031e);}});}exports[_0x2d53('0x6b')]=function(_0x7ecbbc,_0x1d7be4){return db['UserProfile'][_0x2d53('0x49')]({'where':{'id':_0x7ecbbc[_0x2d53('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d7be4,null))[_0x2d53('0x28')](function(_0x593e5f){if(_0x593e5f){return db[_0x2d53('0x53')]['transaction'](function(_0x5ef26b){return db[_0x2d53('0x55')][_0x2d53('0x43')]({'where':{'userProfileId':_0x7ecbbc['params']['id']},'attributes':['id'],'raw':!![]})[_0x2d53('0x28')](function(_0x30e0d6){if(_0x30e0d6){return db['UserProfileSection'][_0x2d53('0x29')]({'where':{'userProfileId':_0x7ecbbc[_0x2d53('0x47')]['id'],'id':_[_0x2d53('0x34')](_0x30e0d6,function(_0x1c708c){return _0x1c708c['id'];})},'transaction':_0x5ef26b});}})['then'](function(_0x3ef046){var _0x5c85df=_[_0x2d53('0x34')](_0x7ecbbc[_0x2d53('0x4b')],function(_0x157c16){_0x157c16[_0x2d53('0x5d')]=_0x7ecbbc[_0x2d53('0x47')]['id'];return _0x157c16;});return db[_0x2d53('0x55')][_0x2d53('0x6c')](_0x5c85df,{'raw':!![],'transaction':_0x5ef26b});})[_0x2d53('0x28')](function(_0x12fcbb){var _0x5db103=_[_0x2d53('0x3f')](_['map'](_0x12fcbb,function(_0x2acee8){return _0x2acee8['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5db103){return db[_0x2d53('0x55')][_0x2d53('0x43')]({'where':{'userProfileId':_0x7ecbbc[_0x2d53('0x47')]['id'],'sectionId':_[_0x2d53('0x34')](_0x5db103,function(_0x563556){return _0x563556[_0x2d53('0x58')];})},'attributes':['id',_0x2d53('0x58')],'raw':!![]})[_0x2d53('0x28')](function(_0x3d422a){var _0x355ddc=_[_0x2d53('0x34')](_0x7ecbbc[_0x2d53('0x4b')],function(_0x1608dc){_0x1608dc[_0x2d53('0x5d')]=_0x7ecbbc['params']['id'];return _0x1608dc;});return db['UserProfileResource'][_0x2d53('0x6c')](_0x355ddc,{'raw':!![],'transaction':_0x5ef26b});});}})['catch'](handleError(_0x1d7be4,null));});}})[_0x2d53('0x28')](function(_0x5ab7ff){var _0x772c3f=_[_0x2d53('0x34')](_0x5ab7ff,function(_0x3b4c78){return _0x3b4c78['get']({'plain':!![]});});})['then'](respondWithResult(_0x1d7be4,null))[_0x2d53('0x45')](handleError(_0x1d7be4,null));};exports[_0x2d53('0x6d')]=function(_0x2af06d,_0x276eff,_0x458937){return db[_0x2d53('0x2e')][_0x2d53('0x49')]({'where':{'id':_0x2af06d[_0x2d53('0x47')]['id']}})[_0x2d53('0x28')](handleEntityNotFound(_0x276eff,null))['then'](function(_0x214473){if(_0x214473){return _0x214473[_0x2d53('0x6d')](_0x2af06d['query'][_0x2d53('0x5f')]);}})[_0x2d53('0x28')](respondWithStatusCode(_0x276eff,null))['catch'](handleError(_0x276eff,null));};exports[_0x2d53('0x6e')]=function(_0x8187f9,_0x530f09){var _0x6ad17e={};if(!_0x8187f9['query'][_0x2d53('0x6f')])throw new Error(_0x2d53('0x70'));if(!_0x8187f9[_0x2d53('0x35')][_0x2d53('0x71')](_0x2d53('0x72'))){_0x6ad17e['limit']=qs[_0x2d53('0x73')](_0x8187f9[_0x2d53('0x35')][_0x2d53('0x73')]);_0x6ad17e[_0x2d53('0x21')]=qs[_0x2d53('0x21')](_0x8187f9[_0x2d53('0x35')]['offset']);}return db[_0x2d53('0x2e')][_0x2d53('0x49')]({'where':{'id':_0x8187f9[_0x2d53('0x47')]['id']}})[_0x2d53('0x28')](function(_0x11dd6a){if(!_0x11dd6a)throw new Error(_0x2d53('0x74')+_0x8187f9[_0x2d53('0x47')]['id']);return db['UserProfile']['getResources'](_0x8187f9);})[_0x2d53('0x28')](respondWithFilteredResult(_0x530f09,_0x6ad17e))[_0x2d53('0x45')](handleError(_0x530f09,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 678c962..04ae827 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 _0x398a=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1341a6,_0x23816a){var _0x37658e=function(_0xbe0a4d){while(--_0xbe0a4d){_0x1341a6['push'](_0x1341a6['shift']());}};_0x37658e(++_0x23816a);}(_0x398a,0x11a));var _0xa398=function(_0x42e216,_0x3d9f5e){_0x42e216=_0x42e216-0x0;var _0x44a84f=_0x398a[_0x42e216];return _0x44a84f;};'use strict';var EventEmitter=require(_0xa398('0x0'));var UserProfile=require(_0xa398('0x1'))['db'][_0xa398('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa398('0x3')](0x0);var events={'afterCreate':_0xa398('0x4'),'afterUpdate':_0xa398('0x5'),'afterDestroy':'remove'};function emitEvent(_0x538105){return function(_0x51a35c,_0x29c575,_0x3d14ae){UserProfileEvents[_0xa398('0x6')](_0x538105+':'+_0x51a35c['id'],_0x51a35c);UserProfileEvents[_0xa398('0x6')](_0x538105,_0x51a35c);_0x3d14ae(null);};}for(var e in events){if(events[_0xa398('0x7')](e)){var event=events[e];UserProfile[_0xa398('0x8')](e,emitEvent(event));}}module[_0xa398('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xe2fe=['exports','events','setMaxListeners','update','remove','emit','hook'];(function(_0x42f7a3,_0x2ef719){var _0x3cace2=function(_0x21d251){while(--_0x21d251){_0x42f7a3['push'](_0x42f7a3['shift']());}};_0x3cace2(++_0x2ef719);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xee2f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xee2f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee2f('0x2'),'afterDestroy':_0xee2f('0x3')};function emitEvent(_0xe5ad8a){return function(_0x2d2b03,_0xcb45e6,_0x4ba89f){UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a+':'+_0x2d2b03['id'],_0x2d2b03);UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a,_0x2d2b03);_0x4ba89f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xee2f('0x5')](e,emitEvent(event));}}module[_0xee2f('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 3ca53f8..d353097 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 _0x49a6=['VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','ids','customSorting','extraQueryConditions','color','tag','ThroughTags','openTabs','true','rows','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','models','filter','field','value','findAll','map','catch','then','name','resolve','UserProfileResource','associatedResources','resourceId','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','childModel','SquareRecording','parentSections','SquareProjects','JscriptyProject','contacts','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','VoiceContext','voicemails','voicerecordings','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','queuecampaigns','users','agents','Users','admin','Agents','ZendeskAccount','salesforceaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Dashboard','intervals','scheduler','sounds','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','InteractionId','ui.createdAt','from','user_has_','sequelize','query','toString','OpenTabs','define','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','params','all','ignore','isEmpty','union','push','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','key'];(function(_0x5845ad,_0x489f3d){var _0x2aaade=function(_0x29d92d){while(--_0x29d92d){_0x5845ad['push'](_0x5845ad['shift']());}};_0x2aaade(++_0x489f3d);}(_0x49a6,0xd6));var _0x649a=function(_0x73bb55,_0x5d9fbf){_0x73bb55=_0x73bb55-0x0;var _0x55543b=_0x49a6[_0x73bb55];return _0x55543b;};'use strict';var _=require(_0x649a('0x0'));var attributes=require(_0x649a('0x1'));var qs=require('../../components/parsers/qs');var squel=require('squel');module['exports']=function(_0x1efdee){var _0x984a16=_0x1efdee[_0x649a('0x2')];function _0x59cb18(_0x25fcac,_0x256673){return new Promise(function(_0x2ee484,_0x1d4cc7){if(!_0x256673)return _0x2ee484(null);var _0x53aa14=_0x256673[_0x649a('0x3')]?{[_0x256673['filter'][_0x649a('0x4')]]:_0x256673[_0x649a('0x3')][_0x649a('0x5')]}:undefined;return _0x984a16[_0x25fcac][_0x649a('0x6')]({'where':_0x53aa14,'raw':!![]})['then'](function(_0x3e8877){_0x256673['associatedResources']=_[_0x649a('0x7')](_0x3e8877,'id');_0x2ee484(_0x256673);})[_0x649a('0x8')](function(_0x70ec82){_0x1d4cc7(_0x70ec82);});});}function _0x2ab776(_0x2592e9,_0x4a1031){return new Promise(function(_0x24abda,_0x775707){var _0x981009=_0x2592e9[_0x649a('0x3')]?{[_0x2592e9[_0x649a('0x3')][_0x649a('0x4')]]:_0x2592e9[_0x649a('0x3')][_0x649a('0x5')]}:undefined;return _0x984a16[_0x2592e9['model']][_0x649a('0x6')]({'where':_0x981009,'raw':!![]})[_0x649a('0x9')](function(_0x2b8c9a){_0x4a1031['associatedResources']=_[_0x649a('0x7')](_0x2b8c9a,function(_0x4e7ea6){return _0x4e7ea6[_0x649a('0xa')];});_0x24abda(_0x4a1031);})[_0x649a('0x8')](function(_0x38be33){_0x775707(_0x38be33);});});}function _0x440259(_0x548ed4,_0x3f25ca,_0x343df1){if(!_0x3f25ca)return Promise[_0x649a('0xb')](null);return new Promise(function(_0x2dfd6e,_0x3f0519){return _0x984a16[_0x649a('0xc')][_0x649a('0x6')]({'where':{'sectionId':_0x3f25ca['id']},'raw':!![]})[_0x649a('0x9')](function(_0x38a174){if(_0x548ed4[_0x649a('0x4')]&&_0x548ed4[_0x649a('0x4')]!=='id'){_0x3f25ca[_0x649a('0xd')]=_[_0x649a('0x7')](_0x38a174,function(_0x343016){return _0x343016[_0x548ed4[_0x649a('0x4')]];});}else{if(_0x343df1==='AnalyticExtractedReport'){_0x3f25ca['associatedResources']=_['map'](_0x38a174,function(_0x47390f){return{'id':_0x47390f[_0x649a('0xe')],'type':_0x47390f['type']};});}else{_0x3f25ca['associatedResources']=_['map'](_0x38a174,function(_0x185c57){return _0x185c57['resourceId'];});}}_0x2dfd6e(_0x3f25ca);})[_0x649a('0x8')](function(_0x28d369){_0x3f0519(_0x28d369);});});}function _0x59a5f9(_0x297950,_0x10104d){var _0x459087={'parentSections':[]};switch(_0x297950[_0x649a('0xf')]()){case _0x649a('0x10'):_0x459087['childModel']=_0x649a('0x11');break;case _0x649a('0x12'):_0x459087['childModel']=_0x649a('0x13');break;case _0x649a('0x14'):_0x459087[_0x649a('0x15')]=_0x649a('0x16');_0x459087[_0x649a('0x17')]=[{'name':_0x649a('0x18'),'field':'name','foreignKey':'projectName'}];break;case'projects':_0x459087[_0x649a('0x15')]=_0x649a('0x19');break;case _0x649a('0x1a'):_0x459087[_0x649a('0x15')]='CmContact';_0x459087[_0x649a('0x17')]=[{'name':_0x649a('0x1b'),'field':'id','foreignKey':_0x649a('0x1c')}];break;case'lists':_0x459087[_0x649a('0x15')]=_0x649a('0x1d');break;case _0x649a('0x1e'):_0x459087[_0x649a('0x15')]='CmCompany';break;case _0x649a('0x1f'):_0x459087['childModel']=_0x649a('0x20');break;case _0x649a('0x21'):_0x459087[_0x649a('0x15')]=_0x649a('0x22');break;case'chatwebsites':_0x459087[_0x649a('0x15')]=_0x649a('0x23');break;case'faxqueues':_0x459087[_0x649a('0x15')]=_0x649a('0x24');break;case _0x649a('0x25'):_0x459087['childModel']=_0x649a('0x26');break;case _0x649a('0x27'):case'internalroutes':case'outboundroutes':_0x459087[_0x649a('0x15')]='VoiceExtension';break;case'contexts':_0x459087[_0x649a('0x15')]=_0x649a('0x28');break;case _0x649a('0x29'):_0x459087[_0x649a('0x15')]='VoiceMail';break;case _0x649a('0x2a'):_0x459087[_0x649a('0x15')]='VoiceRecording';_0x459087[_0x649a('0x17')]=[{'name':'Agents','field':'name','foreignKey':'membername','model':_0x649a('0x2b'),'filter':{'field':_0x649a('0x2c'),'value':[_0x649a('0x2d')]}},{'name':_0x649a('0x2e'),'field':_0x649a('0xa'),'foreignKey':_0x649a('0x2f'),'model':_0x649a('0x2b'),'filter':{'field':_0x649a('0x2c'),'value':[_0x649a('0x30')]}},{'name':_0x649a('0x31'),'field':_0x649a('0xa'),'foreignKey':_0x649a('0x32'),'model':_0x649a('0x33'),'filter':{'field':_0x649a('0x34'),'value':[_0x649a('0x35')]}},{'name':_0x649a('0x36'),'field':_0x649a('0xa'),'foreignKey':_0x649a('0x32'),'model':_0x649a('0x33'),'filter':{'field':'type','value':[_0x649a('0x37')]}}];break;case _0x649a('0x38'):_0x459087[_0x649a('0x15')]=_0x649a('0x39');break;case'chanspies':_0x459087[_0x649a('0x15')]=_0x649a('0x3a');break;case _0x649a('0x3b'):_0x459087[_0x649a('0x15')]=_0x649a('0x3c');break;case _0x649a('0x3d'):_0x459087[_0x649a('0x15')]=_0x649a('0x3e');break;case _0x649a('0x3f'):_0x459087[_0x649a('0x15')]=_0x649a('0x40');break;case _0x649a('0x41'):_0x459087[_0x649a('0x15')]='MailAccount';break;case _0x649a('0x42'):_0x459087[_0x649a('0x15')]=_0x649a('0x43');break;case _0x649a('0x44'):_0x459087[_0x649a('0x15')]=_0x649a('0x45');break;case'openchannelaccounts':_0x459087['childModel']=_0x649a('0x46');break;case _0x649a('0x47'):_0x459087[_0x649a('0x15')]='SmsQueue';break;case _0x649a('0x48'):_0x459087['childModel']=_0x649a('0x49');break;case _0x649a('0x4a'):_0x459087[_0x649a('0x15')]=_0x649a('0x4b');break;case _0x649a('0x4c'):_0x459087[_0x649a('0x15')]=_0x649a('0x4d');break;case _0x649a('0x4e'):_0x459087['childModel']=_0x649a('0x4f');break;case'voicequeues':case _0x649a('0x50'):_0x459087[_0x649a('0x15')]=_0x649a('0x33');if(_0x10104d){_0x459087['parentSections']=[{'name':_0x649a('0x31')},{'name':_0x649a('0x36')}];}break;case _0x649a('0x51'):case _0x649a('0x52'):case'telephones':_0x459087[_0x649a('0x15')]=_0x649a('0x2b');if(_0x10104d){_0x459087['parentSections']=[{'name':_0x649a('0x53'),'filter':{'field':_0x649a('0x2c'),'value':[_0x649a('0x54'),'user']},'ignore':!![]},{'name':_0x649a('0x55')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x459087[_0x649a('0x15')]=_0x649a('0x56');break;case _0x649a('0x57'):_0x459087['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x459087[_0x649a('0x15')]=_0x649a('0x58');break;case'sugarcrmaccounts':_0x459087[_0x649a('0x15')]=_0x649a('0x59');break;case _0x649a('0x5a'):_0x459087[_0x649a('0x15')]='DeskAccount';break;case _0x649a('0x5b'):_0x459087['childModel']=_0x649a('0x5c');break;case'vtigeraccounts':_0x459087[_0x649a('0x15')]=_0x649a('0x2b');break;case'cannedanswers':_0x459087[_0x649a('0x15')]=_0x649a('0x5d');break;case _0x649a('0x5e'):_0x459087['childModel']='Disposition';break;case'customdashboards':_0x459087[_0x649a('0x15')]=_0x649a('0x5f');break;case _0x649a('0x60'):_0x459087['childModel']='Interval';break;case'pauses':_0x459087[_0x649a('0x15')]='Pause';break;case _0x649a('0x61'):_0x459087[_0x649a('0x15')]='Schedule';break;case _0x649a('0x62'):_0x459087['childModel']=_0x649a('0x63');break;case _0x649a('0x64'):_0x459087[_0x649a('0x15')]=_0x649a('0x65');break;case'templates':_0x459087['childModel']=_0x649a('0x66');break;case _0x649a('0x67'):_0x459087[_0x649a('0x15')]=_0x649a('0x68');break;case'trunks':_0x459087[_0x649a('0x15')]=_0x649a('0x69');break;case _0x649a('0x6a'):_0x459087[_0x649a('0x15')]=_0x649a('0x6b');break;case _0x649a('0x6c'):_0x459087[_0x649a('0x15')]=_0x649a('0x6d');break;case'extractedreports':_0x459087['childModel']=_0x649a('0x6e');_0x459087[_0x649a('0x17')]=[{'name':_0x649a('0x6f'),'field':'id','foreignKey':_0x649a('0x70')}];break;case _0x649a('0x71'):_0x459087['childModel']=_0x649a('0x72');break;}return _0x459087;}function _0xb223fb(_0xe8614a,_0x475b29){var _0x1274b3=_0xe8614a['charAt'](0x0)[_0x649a('0x73')]()+_0xe8614a[_0x649a('0x74')](0x1);var _0xb65925={'type':_0x984a16[_0x649a('0x75')]['QueryTypes'][_0x649a('0x76')],'raw':!![]};return new Promise(function(_0x186a47,_0x21aa3a){var _0x3e3250=squel[_0x649a('0x77')]()['field']('ui.'+_0x1274b3+_0x649a('0x78'),'id')[_0x649a('0x4')](_0x649a('0x79'))[_0x649a('0x7a')](_0x649a('0x7b')+_0xe8614a+'_interactions','ui')['where']('ui.UserId\x20=\x20?',_0x475b29['id']);return _0x984a16[_0x649a('0x7c')][_0x649a('0x7d')](_0x3e3250[_0x649a('0x7e')](),_0xb65925)[_0x649a('0x9')](function(_0x32f296){_0x475b29[_0x1274b3+_0x649a('0x7f')]=_0x32f296;_0x186a47(_0x32f296);})[_0x649a('0x8')](function(_0x4af8f1){_0x21aa3a(_0x4af8f1);});});}return _0x1efdee[_0x649a('0x80')](_0x649a('0x81'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xe5c9a6){var _0x91a85a={'raw':_0xe5c9a6['query'][_0x649a('0x82')],'where':{}};var _0xc404b9={};var _0x2b5b15={'count':0x0,'rows':[]};var _0x44d24b=_0xe5c9a6[_0x649a('0x7d')][_0x649a('0x83')];var _0x135712=_0xe5c9a6[_0x649a('0x7d')][_0x649a('0x84')]||![];var _0x2b16cc=_0x59a5f9(_0x44d24b,_0x135712);if(!_0x2b16cc['childModel'])throw new Error(_0x649a('0x85')+_0x44d24b+'\x27');var _0x603b88=[{'name':_0x44d24b}];if(!_['isEmpty'](_0x2b16cc[_0x649a('0x17')]))_0x603b88=_0x2b16cc['parentSections'];var _0x57a4c4=[];for(var _0x4fcaff=0x0;_0x4fcaff<_0x603b88[_0x649a('0x86')];_0x4fcaff++){_0x57a4c4['push'](_0x984a16[_0x649a('0x87')][_0x649a('0x88')]({'where':{'userProfileId':_0xe5c9a6[_0x649a('0x89')]['id'],'name':_0x603b88[_0x4fcaff]['name']},'raw':!![]}));}return Promise[_0x649a('0x8a')](_0x57a4c4)['then'](function(_0xb443fd){var _0x332335=_['filter'](_0xb443fd,function(_0x2d90ae){return _0x2d90ae?_0x2d90ae:undefined;});var _0x4fa156=_['filter'](_0x603b88,[_0x649a('0x8b'),!![]]);var _0x14927d=_[_0x649a('0x8c')](_0x332335)&&_[_0x649a('0x8c')](_0x4fa156)?null:_[_0x649a('0x8d')](_0x4fa156,_0x332335);if(!_0x14927d)return null;var _0x27ebcf=[];for(var _0x14d18b=0x0;_0x14d18b<_0x14927d[_0x649a('0x86')];_0x14d18b++){var _0x46153d=_['find'](_0x603b88,function(_0x348d7f){return _0x14927d[_0x14d18b]?_0x348d7f[_0x649a('0xa')]===_0x14927d[_0x14d18b][_0x649a('0xa')]:null;});if(_0x46153d){if(_0x14927d[_0x14d18b][_0x649a('0x8b')]){_0x27ebcf[_0x649a('0x8e')](_0x59cb18(_0x2b16cc[_0x649a('0x15')],_0x14927d[_0x14d18b]));}else{if(!_0x14927d[_0x14d18b][_0x649a('0x8f')]){_0x27ebcf[_0x649a('0x8e')](_0x440259(_0x46153d,_0x14927d[_0x14d18b],_0x2b16cc[_0x649a('0x15')]));}else{if(_0x46153d[_0x649a('0x90')]){_0x27ebcf[_0x649a('0x8e')](_0x2ab776(_0x46153d,_0x14927d[_0x14d18b]));}}}}}return Promise[_0x649a('0x8a')](_0x27ebcf);})[_0x649a('0x9')](function(_0x2e9dae){var _0x1404df=_0x2e9dae;var _0x1886c5=null;if(_0x1404df){_0x1886c5=_0x1404df['length']===0x1?_0x1404df[0x0]:null;}if(!_0x1886c5&&!_0x1404df)return _0x2b5b15;var _0x27fa47=_0x984a16[_0x2b16cc[_0x649a('0x15')]][_0x649a('0x91')];_0xc404b9['model']=_[_0x649a('0x92')](_0x27fa47);_0xc404b9['query']=_['keys'](_0xe5c9a6[_0x649a('0x7d')]);_0xc404b9[_0x649a('0x93')]=_[_0x649a('0x94')](_0xc404b9[_0x649a('0x90')],_0xc404b9['query']);_0x91a85a[_0x649a('0x95')]=_[_0x649a('0x94')](_0xc404b9[_0x649a('0x90')],qs[_0x649a('0x96')](_0xe5c9a6[_0x649a('0x7d')]['fields']));_0x91a85a[_0x649a('0x95')]=_0x91a85a[_0x649a('0x95')][_0x649a('0x86')]?_0x91a85a['attributes']:_0xc404b9[_0x649a('0x90')];if(!_0xe5c9a6[_0x649a('0x7d')][_0x649a('0x97')](_0x649a('0x98'))){_0x91a85a[_0x649a('0x99')]=qs['limit'](_0xe5c9a6[_0x649a('0x7d')]['limit']);_0x91a85a[_0x649a('0x9a')]=qs[_0x649a('0x9a')](_0xe5c9a6['query'][_0x649a('0x9a')]);}_0x91a85a[_0x649a('0x9b')]=qs[_0x649a('0x9c')](_0xe5c9a6[_0x649a('0x7d')][_0x649a('0x9c')]);_0x91a85a['where']=qs[_0x649a('0x93')](_['pick'](_0xe5c9a6['query'],_0xc404b9[_0x649a('0x93')]));if(_0xe5c9a6[_0x649a('0x7d')]['filter']){_0x91a85a[_0x649a('0x9d')]=_[_0x649a('0x9e')](_0x91a85a['where'],{'$or':_[_0x649a('0x7')](_0x27fa47,function(_0x47d9c6){if(_0x47d9c6[_0x649a('0x34')][_0x649a('0x9f')]!==_0x649a('0xa0')){var _0x3e0dcf={};_0x3e0dcf[_0x47d9c6[_0x649a('0x4')]]={'$like':'%'+_0xe5c9a6['query']['filter']+'%'};return _0x3e0dcf;}})});}var _0x1b1f5e=[];var _0x5c3469=null;var _0x39a27f={};if(_0x1886c5){_0x5c3469=_[_0x649a('0x88')](_0x603b88,['name',_0x1886c5[_0x649a('0xa')]]);if(_0x5c3469['field']){_0x39a27f={};if(_0x2b16cc[_0x649a('0x15')]===_0x649a('0x6e')){_0x39a27f[_0x5c3469[_0x649a('0xa1')]]=_['map'](_0x1886c5['associatedResources'],'id');}else{_0x39a27f[_0x5c3469[_0x649a('0xa1')]]=_0x1886c5['associatedResources'];}_0x1b1f5e[_0x649a('0x8e')](_0x39a27f);}else{_0x91a85a[_0x649a('0x9d')]['id']=_0x1886c5[_0x649a('0xd')];}}else{for(var _0x36f756=0x0;_0x36f756<_0x1404df[_0x649a('0x86')];_0x36f756++){_0x5c3469=_[_0x649a('0x88')](_0x603b88,[_0x649a('0xa'),_0x1404df[_0x36f756]['name']]);if(_0x5c3469[_0x649a('0x4')]){_0x39a27f={};_0x39a27f[_0x5c3469[_0x649a('0xa1')]]=_0x1404df[_0x36f756][_0x649a('0xd')];_0x1b1f5e[_0x649a('0x8e')](_0x39a27f);}else{if(!_0x91a85a['where']['id'])_0x91a85a[_0x649a('0x9d')]['id']=[];_0x1404df[_0x36f756][_0x649a('0xd')][_0x649a('0xa2')](function(_0x14729f){_0x91a85a[_0x649a('0x9d')]['id'][_0x649a('0x8e')](_0x14729f);});}}}if(!_['isEmpty'](_0x1b1f5e)){_0x91a85a[_0x649a('0x9d')]=_['merge'](_0x91a85a[_0x649a('0x9d')],{'$and':{'$or':_0x1b1f5e}});}_0x91a85a=_['merge']({},_0x91a85a,_0xe5c9a6[_0x649a('0xa3')]);if(_0x1886c5&&!_0x1886c5[_0x649a('0x8f')]&&_0x2b16cc[_0x649a('0x15')]==='AnalyticExtractedReport'){if(_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xa4')]){_0x91a85a[_0x649a('0xa5')]=[{'all':!![]}];}return _0x984a16[_0x2b16cc[_0x649a('0x15')]][_0x649a('0x6')](_0x91a85a)[_0x649a('0x9')](function(_0x3fac2a){var _0xfd226d=[];_0x3fac2a[_0x649a('0xa2')](function(_0x4beb87){var _0x4b6017;switch(_0x4beb87[_0x649a('0xa6')]){case _0x649a('0xa7'):_0x4b6017=_[_0x649a('0x88')](_0x1886c5[_0x649a('0xd')],function(_0x570486){return _0x570486['id']===_0x4beb87[_0x649a('0x70')]&&_0x570486[_0x649a('0x34')]===_0x649a('0xa8');});break;case _0x649a('0xa9'):_0x4b6017=_[_0x649a('0x88')](_0x1886c5[_0x649a('0xd')],function(_0x8e0dd7){return _0x8e0dd7['id']===_0x4beb87['reportId']&&_0x8e0dd7['type']===_0x649a('0xaa');});break;}if(_0x4b6017)_0xfd226d['push'](_0x4beb87);});_0x2b5b15[_0x649a('0xab')]=_0xfd226d[_0x649a('0x86')];_0x2b5b15['rows']=_0xfd226d;return _0x2b5b15;});}else{if(!_[_0x649a('0x8c')](_0xe5c9a6['query']['ids'])){_0x91a85a['where']['id']=_0x91a85a[_0x649a('0x9d')]['id']?_[_0x649a('0x94')](_0x91a85a[_0x649a('0x9d')]['id'],_0xe5c9a6[_0x649a('0x7d')]['ids']):_0xe5c9a6['query'][_0x649a('0xac')];if(_0xe5c9a6['query'][_0x649a('0xad')]){_0x91a85a['order']=_0xe5c9a6[_0x649a('0x7d')]['customSorting'];}}if(_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xae')]){_0x91a85a[_0x649a('0x9d')]=_[_0x649a('0x9e')](_0x91a85a['where'],{'$and':_0xe5c9a6[_0x649a('0x7d')]['extraQueryConditions']});}return _0x984a16[_0x2b16cc[_0x649a('0x15')]][_0x649a('0xab')]({'where':_0x91a85a['where']})[_0x649a('0x9')](function(_0x560699){_0x2b5b15[_0x649a('0xab')]=_0x560699;if(_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xa4')]){if(_0x2b16cc['childModel']==='CmContact'){_0x91a85a['include']=[{'model':_0x984a16[_0x649a('0x65')],'as':'Tags','attributes':['id',_0x649a('0xa'),_0x649a('0xaf')],'required':_0xe5c9a6['query'][_0x649a('0xb0')]?!![]:![]},{'model':_0x984a16['Tag'],'as':_0x649a('0xb1'),'attributes':['id','name',_0x649a('0xaf')],'through':_0xe5c9a6[_0x649a('0x7d')]['tag']?{'attributes':[],'where':{'TagId':_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xb0')]||undefined}}:{},'required':_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xb0')]?!![]:![]}];}else{_0x91a85a[_0x649a('0xa5')]=[{'all':!![]}];}}return _0x984a16[_0x2b16cc[_0x649a('0x15')]][_0x649a('0x6')](_0x91a85a);})['then'](function(_0x58fff0){_0x2b5b15['rows']=_0x58fff0;if(_0x44d24b==='Agents'&&_0xe5c9a6[_0x649a('0x7d')][_0x649a('0xb2')]===_0x649a('0xb3')){var _0x503fa4=[];for(var _0x3646be=0x0;_0x3646be<_0x2b5b15[_0x649a('0xb4')]['length'];_0x3646be++){_0x503fa4['push'](_0xb223fb('chat',_0x2b5b15[_0x649a('0xb4')][_0x3646be][_0x649a('0xb5')]));_0x503fa4[_0x649a('0x8e')](_0xb223fb(_0x649a('0xb6'),_0x2b5b15['rows'][_0x3646be]['dataValues']));_0x503fa4['push'](_0xb223fb(_0x649a('0xb7'),_0x2b5b15[_0x649a('0xb4')][_0x3646be][_0x649a('0xb5')]));_0x503fa4['push'](_0xb223fb(_0x649a('0xb8'),_0x2b5b15[_0x649a('0xb4')][_0x3646be][_0x649a('0xb5')]));_0x503fa4[_0x649a('0x8e')](_0xb223fb(_0x649a('0xb9'),_0x2b5b15[_0x649a('0xb4')][_0x3646be]['dataValues']));_0x503fa4[_0x649a('0x8e')](_0xb223fb(_0x649a('0xba'),_0x2b5b15[_0x649a('0xb4')][_0x3646be]['dataValues']));}return Promise[_0x649a('0x8a')](_0x503fa4)[_0x649a('0x9')](function(){return _0x2b5b15;});}return _0x2b5b15;});}});}}});}; \ No newline at end of file +var _0xf33a=['whatsappaccounts','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','User','Users','role','zendeskaccounts','ZendeskAccount','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Template','triggers','trunks','Trunk','variables','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','user_has_','_interactions','where','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','Tag','Tags','color','tag','openTabs','fax','mail','openchannel','dataValues','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','then','model','associatedResources','name','catch','resolve','UserProfileResource','field','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','chatwebsites','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','agent','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues'];(function(_0x2a1fa3,_0x154c71){var _0x3e286f=function(_0x12145c){while(--_0x12145c){_0x2a1fa3['push'](_0x2a1fa3['shift']());}};_0x3e286f(++_0x154c71);}(_0xf33a,0x12a));var _0xaf33=function(_0x49a0f8,_0x21c323){_0x49a0f8=_0x49a0f8-0x0;var _0x4054fe=_0xf33a[_0x49a0f8];return _0x4054fe;};'use strict';var _=require(_0xaf33('0x0'));var attributes=require(_0xaf33('0x1'));var qs=require(_0xaf33('0x2'));var squel=require(_0xaf33('0x3'));module[_0xaf33('0x4')]=function(_0x597cfb){var _0x57b3dd=_0x597cfb[_0xaf33('0x5')];function _0x4ad1a8(_0x3c87d8,_0x4ddeb9){return new Promise(function(_0x15b9f1,_0x37f0e4){if(!_0x4ddeb9)return _0x15b9f1(null);var _0x26d4c9=_0x4ddeb9['filter']?{[_0x4ddeb9[_0xaf33('0x6')]['field']]:_0x4ddeb9[_0xaf33('0x6')][_0xaf33('0x7')]}:undefined;return _0x57b3dd[_0x3c87d8][_0xaf33('0x8')]({'where':_0x26d4c9,'raw':!![]})[_0xaf33('0x9')](function(_0x348fbb){_0x4ddeb9['associatedResources']=_['map'](_0x348fbb,'id');_0x15b9f1(_0x4ddeb9);})['catch'](function(_0x4bbd1c){_0x37f0e4(_0x4bbd1c);});});}function _0x19c8c6(_0x4f384c,_0x2fb9f8){return new Promise(function(_0x4b91da,_0xed15a4){var _0x1f5ab8=_0x4f384c['filter']?{[_0x4f384c[_0xaf33('0x6')]['field']]:_0x4f384c[_0xaf33('0x6')][_0xaf33('0x7')]}:undefined;return _0x57b3dd[_0x4f384c[_0xaf33('0xa')]][_0xaf33('0x8')]({'where':_0x1f5ab8,'raw':!![]})[_0xaf33('0x9')](function(_0x372732){_0x2fb9f8[_0xaf33('0xb')]=_['map'](_0x372732,function(_0x3b40e0){return _0x3b40e0[_0xaf33('0xc')];});_0x4b91da(_0x2fb9f8);})[_0xaf33('0xd')](function(_0x48fb62){_0xed15a4(_0x48fb62);});});}function _0x2ebb42(_0xb1b320,_0x1c7130,_0x13d824){if(!_0x1c7130)return Promise[_0xaf33('0xe')](null);return new Promise(function(_0x1a9543,_0xc0a724){return _0x57b3dd[_0xaf33('0xf')][_0xaf33('0x8')]({'where':{'sectionId':_0x1c7130['id']},'raw':!![]})['then'](function(_0x3e7201){if(_0xb1b320[_0xaf33('0x10')]&&_0xb1b320['field']!=='id'){_0x1c7130[_0xaf33('0xb')]=_[_0xaf33('0x11')](_0x3e7201,function(_0x858361){return _0x858361[_0xb1b320[_0xaf33('0x10')]];});}else{if(_0x13d824===_0xaf33('0x12')){_0x1c7130[_0xaf33('0xb')]=_[_0xaf33('0x11')](_0x3e7201,function(_0x43ead4){return{'id':_0x43ead4[_0xaf33('0x13')],'type':_0x43ead4[_0xaf33('0x14')]};});}else{_0x1c7130[_0xaf33('0xb')]=_['map'](_0x3e7201,function(_0x4a8d33){return _0x4a8d33[_0xaf33('0x13')];});}}_0x1a9543(_0x1c7130);})[_0xaf33('0xd')](function(_0x4aa69e){_0xc0a724(_0x4aa69e);});});}function _0x5b1e3d(_0x11a37e,_0x56c379){var _0x350172={'parentSections':[]};switch(_0x11a37e[_0xaf33('0x15')]()){case _0xaf33('0x16'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x18');break;case'odbc':_0x350172['childModel']=_0xaf33('0x19');break;case _0xaf33('0x1a'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x1b');_0x350172['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':_0xaf33('0x1c')}];break;case _0xaf33('0x1d'):_0x350172['childModel']='JscriptyProject';break;case _0xaf33('0x1e'):_0x350172['childModel']=_0xaf33('0x1f');_0x350172[_0xaf33('0x20')]=[{'name':_0xaf33('0x21'),'field':'id','foreignKey':_0xaf33('0x22')}];break;case _0xaf33('0x23'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x24');break;case _0xaf33('0x25'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x26');break;case _0xaf33('0x27'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x28');break;case _0xaf33('0x29'):_0x350172[_0xaf33('0x17')]='ChatQueue';break;case _0xaf33('0x2a'):_0x350172['childModel']='ChatWebsite';break;case'faxqueues':_0x350172[_0xaf33('0x17')]=_0xaf33('0x2b');break;case _0xaf33('0x2c'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x2d');break;case'inboundroutes':case _0xaf33('0x2e'):case _0xaf33('0x2f'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x30');break;case'contexts':_0x350172[_0xaf33('0x17')]=_0xaf33('0x31');break;case _0xaf33('0x32'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x33');break;case _0xaf33('0x34'):_0x350172[_0xaf33('0x17')]='VoiceRecording';_0x350172[_0xaf33('0x20')]=[{'name':_0xaf33('0x35'),'field':_0xaf33('0xc'),'foreignKey':_0xaf33('0x36'),'model':'User','filter':{'field':'role','value':[_0xaf33('0x37')]}},{'name':_0xaf33('0x38'),'field':'name','foreignKey':_0xaf33('0x36'),'model':'User','filter':{'field':'role','value':[_0xaf33('0x39')]}},{'name':'VoiceQueues','field':_0xaf33('0xc'),'foreignKey':_0xaf33('0x3a'),'model':_0xaf33('0x3b'),'filter':{'field':_0xaf33('0x14'),'value':[_0xaf33('0x3c')]}},{'name':_0xaf33('0x3d'),'field':_0xaf33('0xc'),'foreignKey':_0xaf33('0x3a'),'model':'VoiceQueue','filter':{'field':_0xaf33('0x14'),'value':[_0xaf33('0x3e')]}}];break;case'musiconholds':_0x350172[_0xaf33('0x17')]=_0xaf33('0x3f');break;case'chanspies':_0x350172[_0xaf33('0x17')]=_0xaf33('0x40');break;case _0xaf33('0x41'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x42');break;case _0xaf33('0x43'):_0x350172['childModel']='Campaign';break;case _0xaf33('0x44'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x45');break;case _0xaf33('0x46'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x47');break;case _0xaf33('0x48'):_0x350172['childModel']='MailSubstatus';break;case _0xaf33('0x49'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x4a');break;case'openchannelaccounts':_0x350172[_0xaf33('0x17')]='OpenchannelAccount';break;case _0xaf33('0x4b'):_0x350172['childModel']=_0xaf33('0x4c');break;case _0xaf33('0x4d'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x4e');break;case _0xaf33('0x4f'):_0x350172[_0xaf33('0x17')]='WhatsappQueue';break;case _0xaf33('0x50'):_0x350172[_0xaf33('0x17')]='WhatsappAccount';break;case'teams':_0x350172[_0xaf33('0x17')]=_0xaf33('0x51');break;case _0xaf33('0x52'):case _0xaf33('0x53'):_0x350172['childModel']=_0xaf33('0x3b');if(_0x56c379){_0x350172[_0xaf33('0x20')]=[{'name':_0xaf33('0x54')},{'name':_0xaf33('0x3d')}];}break;case _0xaf33('0x55'):case _0xaf33('0x56'):case'telephones':_0x350172[_0xaf33('0x17')]=_0xaf33('0x57');if(_0x56c379){_0x350172[_0xaf33('0x20')]=[{'name':_0xaf33('0x58'),'filter':{'field':_0xaf33('0x59'),'value':['admin','user']},'ignore':!![]},{'name':_0xaf33('0x35')},{'name':_0xaf33('0x38')}];}break;case _0xaf33('0x5a'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x5b');break;case'salesforceaccounts':_0x350172[_0xaf33('0x17')]=_0xaf33('0x5c');break;case'freshdeskaccounts':_0x350172[_0xaf33('0x17')]=_0xaf33('0x5d');break;case _0xaf33('0x5e'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x5f');break;case _0xaf33('0x60'):_0x350172['childModel']=_0xaf33('0x61');break;case'zohoaccounts':_0x350172['childModel']=_0xaf33('0x62');break;case'vtigeraccounts':_0x350172[_0xaf33('0x17')]=_0xaf33('0x57');break;case _0xaf33('0x63'):_0x350172['childModel']=_0xaf33('0x64');break;case _0xaf33('0x65'):_0x350172['childModel']='Disposition';break;case _0xaf33('0x66'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x67');break;case'intervals':_0x350172[_0xaf33('0x17')]='Interval';break;case _0xaf33('0x68'):_0x350172['childModel']=_0xaf33('0x69');break;case _0xaf33('0x6a'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x6b');break;case _0xaf33('0x6c'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x6d');break;case _0xaf33('0x6e'):_0x350172[_0xaf33('0x17')]='Tag';break;case'templates':_0x350172['childModel']=_0xaf33('0x6f');break;case _0xaf33('0x70'):_0x350172[_0xaf33('0x17')]='Trigger';break;case _0xaf33('0x71'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x72');break;case _0xaf33('0x73'):_0x350172[_0xaf33('0x17')]='Variable';break;case'plugins':_0x350172[_0xaf33('0x17')]=_0xaf33('0x74');break;case _0xaf33('0x75'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x12');_0x350172[_0xaf33('0x20')]=[{'name':_0xaf33('0x76'),'field':'id','foreignKey':_0xaf33('0x77')}];break;case _0xaf33('0x78'):_0x350172[_0xaf33('0x17')]=_0xaf33('0x79');break;}return _0x350172;}function _0x26d7bc(_0x560f77,_0x193e61){var _0x323e8e=_0x560f77['charAt'](0x0)[_0xaf33('0x7a')]()+_0x560f77[_0xaf33('0x7b')](0x1);var _0x255f7c={'type':_0x57b3dd[_0xaf33('0x7c')][_0xaf33('0x7d')][_0xaf33('0x7e')],'raw':!![]};return new Promise(function(_0x4825a6,_0x224a75){var _0x1e7569=squel[_0xaf33('0x7f')]()['field'](_0xaf33('0x80')+_0x323e8e+'InteractionId','id')['field'](_0xaf33('0x81'))['from'](_0xaf33('0x82')+_0x560f77+_0xaf33('0x83'),'ui')[_0xaf33('0x84')]('ui.UserId\x20=\x20?',_0x193e61['id']);return _0x57b3dd[_0xaf33('0x85')][_0xaf33('0x86')](_0x1e7569['toString'](),_0x255f7c)[_0xaf33('0x9')](function(_0xc9bfe6){_0x193e61[_0x323e8e+_0xaf33('0x87')]=_0xc9bfe6;_0x4825a6(_0xc9bfe6);})['catch'](function(_0x5067da){_0x224a75(_0x5067da);});});}return _0x597cfb[_0xaf33('0x88')](_0xaf33('0x89'),attributes,{'tableName':_0xaf33('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5e3108){var _0x41ec2b={'raw':_0x5e3108['query']['raw'],'where':{}};var _0x3ea063={};var _0xe0fbce={'count':0x0,'rows':[]};var _0x3ac51f=_0x5e3108[_0xaf33('0x86')][_0xaf33('0x8b')];var _0x1cfb56=_0x5e3108[_0xaf33('0x86')][_0xaf33('0x8c')]||![];var _0x37551d=_0x5b1e3d(_0x3ac51f,_0x1cfb56);if(!_0x37551d[_0xaf33('0x17')])throw new Error(_0xaf33('0x8d')+_0x3ac51f+'\x27');var _0x1ea6b5=[{'name':_0x3ac51f}];if(!_[_0xaf33('0x8e')](_0x37551d[_0xaf33('0x20')]))_0x1ea6b5=_0x37551d['parentSections'];var _0x19c6ba=[];for(var _0x5dcb98=0x0;_0x5dcb98<_0x1ea6b5[_0xaf33('0x8f')];_0x5dcb98++){_0x19c6ba['push'](_0x57b3dd[_0xaf33('0x90')][_0xaf33('0x91')]({'where':{'userProfileId':_0x5e3108[_0xaf33('0x92')]['id'],'name':_0x1ea6b5[_0x5dcb98][_0xaf33('0xc')]},'raw':!![]}));}return Promise[_0xaf33('0x93')](_0x19c6ba)[_0xaf33('0x9')](function(_0x5312ba){var _0x31a8af=_['filter'](_0x5312ba,function(_0x2c4ae8){return _0x2c4ae8?_0x2c4ae8:undefined;});var _0xb96d07=_[_0xaf33('0x6')](_0x1ea6b5,[_0xaf33('0x94'),!![]]);var _0x571419=_[_0xaf33('0x8e')](_0x31a8af)&&_[_0xaf33('0x8e')](_0xb96d07)?null:_[_0xaf33('0x95')](_0xb96d07,_0x31a8af);if(!_0x571419)return null;var _0xd8b3bc=[];for(var _0x3429d3=0x0;_0x3429d3<_0x571419[_0xaf33('0x8f')];_0x3429d3++){var _0x5f535b=_['find'](_0x1ea6b5,function(_0x537850){return _0x571419[_0x3429d3]?_0x537850[_0xaf33('0xc')]===_0x571419[_0x3429d3][_0xaf33('0xc')]:null;});if(_0x5f535b){if(_0x571419[_0x3429d3]['ignore']){_0xd8b3bc[_0xaf33('0x96')](_0x4ad1a8(_0x37551d[_0xaf33('0x17')],_0x571419[_0x3429d3]));}else{if(!_0x571419[_0x3429d3][_0xaf33('0x97')]){_0xd8b3bc['push'](_0x2ebb42(_0x5f535b,_0x571419[_0x3429d3],_0x37551d['childModel']));}else{if(_0x5f535b[_0xaf33('0xa')]){_0xd8b3bc['push'](_0x19c8c6(_0x5f535b,_0x571419[_0x3429d3]));}}}}}return Promise[_0xaf33('0x93')](_0xd8b3bc);})[_0xaf33('0x9')](function(_0x11e80a){var _0x2a3d6d=_0x11e80a;var _0x429466=null;if(_0x2a3d6d){_0x429466=_0x2a3d6d[_0xaf33('0x8f')]===0x1?_0x2a3d6d[0x0]:null;}if(!_0x429466&&!_0x2a3d6d)return _0xe0fbce;var _0x7d5536=_0x57b3dd[_0x37551d[_0xaf33('0x17')]][_0xaf33('0x98')];_0x3ea063['model']=_[_0xaf33('0x99')](_0x7d5536);_0x3ea063['query']=_[_0xaf33('0x99')](_0x5e3108[_0xaf33('0x86')]);_0x3ea063[_0xaf33('0x9a')]=_[_0xaf33('0x9b')](_0x3ea063[_0xaf33('0xa')],_0x3ea063[_0xaf33('0x86')]);_0x41ec2b[_0xaf33('0x9c')]=_[_0xaf33('0x9b')](_0x3ea063['model'],qs[_0xaf33('0x9d')](_0x5e3108['query']['fields']));_0x41ec2b[_0xaf33('0x9c')]=_0x41ec2b[_0xaf33('0x9c')][_0xaf33('0x8f')]?_0x41ec2b['attributes']:_0x3ea063[_0xaf33('0xa')];if(!_0x5e3108[_0xaf33('0x86')]['hasOwnProperty'](_0xaf33('0x9e'))){_0x41ec2b[_0xaf33('0x9f')]=qs[_0xaf33('0x9f')](_0x5e3108[_0xaf33('0x86')][_0xaf33('0x9f')]);_0x41ec2b[_0xaf33('0xa0')]=qs[_0xaf33('0xa0')](_0x5e3108['query']['offset']);}_0x41ec2b[_0xaf33('0xa1')]=qs[_0xaf33('0xa2')](_0x5e3108['query'][_0xaf33('0xa2')]);_0x41ec2b[_0xaf33('0x84')]=qs[_0xaf33('0x9a')](_['pick'](_0x5e3108[_0xaf33('0x86')],_0x3ea063['filters']));if(_0x5e3108[_0xaf33('0x86')]['filter']){_0x41ec2b[_0xaf33('0x84')]=_[_0xaf33('0xa3')](_0x41ec2b[_0xaf33('0x84')],{'$or':_[_0xaf33('0x11')](_0x7d5536,function(_0x565485){if(_0x565485['type']['key']!==_0xaf33('0xa4')){var _0x3de490={};_0x3de490[_0x565485['field']]={'$like':'%'+_0x5e3108['query'][_0xaf33('0x6')]+'%'};return _0x3de490;}})});}var _0x309f0a=[];var _0x1245a3=null;var _0x502b56={};if(_0x429466){_0x1245a3=_['find'](_0x1ea6b5,['name',_0x429466[_0xaf33('0xc')]]);if(_0x1245a3[_0xaf33('0x10')]){_0x502b56={};if(_0x37551d[_0xaf33('0x17')]===_0xaf33('0x12')){_0x502b56[_0x1245a3['foreignKey']]=_[_0xaf33('0x11')](_0x429466[_0xaf33('0xb')],'id');}else{_0x502b56[_0x1245a3[_0xaf33('0xa5')]]=_0x429466[_0xaf33('0xb')];}_0x309f0a[_0xaf33('0x96')](_0x502b56);}else{_0x41ec2b[_0xaf33('0x84')]['id']=_0x429466[_0xaf33('0xb')];}}else{for(var _0x433b14=0x0;_0x433b14<_0x2a3d6d[_0xaf33('0x8f')];_0x433b14++){_0x1245a3=_[_0xaf33('0x91')](_0x1ea6b5,[_0xaf33('0xc'),_0x2a3d6d[_0x433b14][_0xaf33('0xc')]]);if(_0x1245a3['field']){_0x502b56={};_0x502b56[_0x1245a3['foreignKey']]=_0x2a3d6d[_0x433b14]['associatedResources'];_0x309f0a[_0xaf33('0x96')](_0x502b56);}else{if(!_0x41ec2b[_0xaf33('0x84')]['id'])_0x41ec2b[_0xaf33('0x84')]['id']=[];_0x2a3d6d[_0x433b14][_0xaf33('0xb')]['forEach'](function(_0x4c6402){_0x41ec2b['where']['id'][_0xaf33('0x96')](_0x4c6402);});}}}if(!_['isEmpty'](_0x309f0a)){_0x41ec2b['where']=_[_0xaf33('0xa3')](_0x41ec2b[_0xaf33('0x84')],{'$and':{'$or':_0x309f0a}});}_0x41ec2b=_[_0xaf33('0xa3')]({},_0x41ec2b,_0x5e3108[_0xaf33('0xa6')]);if(_0x429466&&!_0x429466[_0xaf33('0x97')]&&_0x37551d[_0xaf33('0x17')]===_0xaf33('0x12')){if(_0x5e3108[_0xaf33('0x86')][_0xaf33('0xa7')]){_0x41ec2b[_0xaf33('0xa8')]=[{'all':!![]}];}return _0x57b3dd[_0x37551d[_0xaf33('0x17')]][_0xaf33('0x8')](_0x41ec2b)[_0xaf33('0x9')](function(_0x4dd06e){var _0x10d9c9=[];_0x4dd06e[_0xaf33('0xa9')](function(_0x3e3f06){var _0x527ac5;switch(_0x3e3f06[_0xaf33('0xaa')]){case _0xaf33('0xab'):_0x527ac5=_['find'](_0x429466[_0xaf33('0xb')],function(_0x30dbe7){return _0x30dbe7['id']===_0x3e3f06['reportId']&&_0x30dbe7[_0xaf33('0x14')]===_0xaf33('0xac');});break;case _0xaf33('0xad'):_0x527ac5=_[_0xaf33('0x91')](_0x429466[_0xaf33('0xb')],function(_0x253291){return _0x253291['id']===_0x3e3f06[_0xaf33('0x77')]&&_0x253291[_0xaf33('0x14')]==='CustomReports';});break;}if(_0x527ac5)_0x10d9c9[_0xaf33('0x96')](_0x3e3f06);});_0xe0fbce[_0xaf33('0xae')]=_0x10d9c9[_0xaf33('0x8f')];_0xe0fbce[_0xaf33('0xaf')]=_0x10d9c9;return _0xe0fbce;});}else{if(!_[_0xaf33('0x8e')](_0x5e3108[_0xaf33('0x86')][_0xaf33('0xb0')])){_0x41ec2b[_0xaf33('0x84')]['id']=_0x41ec2b[_0xaf33('0x84')]['id']?_['intersection'](_0x41ec2b[_0xaf33('0x84')]['id'],_0x5e3108[_0xaf33('0x86')]['ids']):_0x5e3108[_0xaf33('0x86')]['ids'];if(_0x5e3108[_0xaf33('0x86')][_0xaf33('0xb1')]){_0x41ec2b[_0xaf33('0xa1')]=_0x5e3108[_0xaf33('0x86')]['customSorting'];}}if(_0x5e3108[_0xaf33('0x86')][_0xaf33('0xb2')]){_0x41ec2b[_0xaf33('0x84')]=_[_0xaf33('0xa3')](_0x41ec2b[_0xaf33('0x84')],{'$and':_0x5e3108[_0xaf33('0x86')][_0xaf33('0xb2')]});}return _0x57b3dd[_0x37551d['childModel']][_0xaf33('0xae')]({'where':_0x41ec2b['where']})['then'](function(_0x3e8ddd){_0xe0fbce[_0xaf33('0xae')]=_0x3e8ddd;if(_0x5e3108[_0xaf33('0x86')][_0xaf33('0xa7')]){if(_0x37551d['childModel']===_0xaf33('0x1f')){_0x41ec2b['include']=[{'model':_0x57b3dd[_0xaf33('0xb3')],'as':_0xaf33('0xb4'),'attributes':['id',_0xaf33('0xc'),_0xaf33('0xb5')],'required':_0x5e3108[_0xaf33('0x86')]['tag']?!![]:![]},{'model':_0x57b3dd[_0xaf33('0xb3')],'as':'ThroughTags','attributes':['id',_0xaf33('0xc'),_0xaf33('0xb5')],'through':_0x5e3108['query']['tag']?{'attributes':[],'where':{'TagId':_0x5e3108['query'][_0xaf33('0xb6')]||undefined}}:{},'required':_0x5e3108[_0xaf33('0x86')]['tag']?!![]:![]}];}else{_0x41ec2b[_0xaf33('0xa8')]=[{'all':!![]}];}}return _0x57b3dd[_0x37551d[_0xaf33('0x17')]]['findAll'](_0x41ec2b);})[_0xaf33('0x9')](function(_0x58a242){_0xe0fbce[_0xaf33('0xaf')]=_0x58a242;if(_0x3ac51f==='Agents'&&_0x5e3108[_0xaf33('0x86')][_0xaf33('0xb7')]==='true'){var _0x1d7dbf=[];for(var _0x1170f7=0x0;_0x1170f7<_0xe0fbce[_0xaf33('0xaf')][_0xaf33('0x8f')];_0x1170f7++){_0x1d7dbf['push'](_0x26d7bc('chat',_0xe0fbce[_0xaf33('0xaf')][_0x1170f7]['dataValues']));_0x1d7dbf[_0xaf33('0x96')](_0x26d7bc('sms',_0xe0fbce[_0xaf33('0xaf')][_0x1170f7]['dataValues']));_0x1d7dbf[_0xaf33('0x96')](_0x26d7bc(_0xaf33('0xb8'),_0xe0fbce[_0xaf33('0xaf')][_0x1170f7]['dataValues']));_0x1d7dbf[_0xaf33('0x96')](_0x26d7bc(_0xaf33('0xb9'),_0xe0fbce[_0xaf33('0xaf')][_0x1170f7]['dataValues']));_0x1d7dbf['push'](_0x26d7bc(_0xaf33('0xba'),_0xe0fbce[_0xaf33('0xaf')][_0x1170f7][_0xaf33('0xbb')]));_0x1d7dbf['push'](_0x26d7bc(_0xaf33('0xbc'),_0xe0fbce[_0xaf33('0xaf')][_0x1170f7][_0xaf33('0xbb')]));}return Promise[_0xaf33('0x93')](_0x1d7dbf)[_0xaf33('0x9')](function(){return _0xe0fbce;});}return _0xe0fbce;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 64a12c1..dae0d89 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 _0x1410=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x1410,0x130));var _0x0141=function(_0x46052c,_0x28ad1b){_0x46052c=_0x46052c-0x0;var _0x2b94e0=_0x1410[_0x46052c];return _0x2b94e0;};'use strict';var _=require(_0x0141('0x0'));var util=require(_0x0141('0x1'));var moment=require(_0x0141('0x2'));var BPromise=require(_0x0141('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0141('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0141('0x5'));var logger=require('../../config/logger')(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});config[_0x0141('0xb')]=_[_0x0141('0xc')](config[_0x0141('0xb')],{'host':_0x0141('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0141('0xb')]));require(_0x0141('0xe'))[_0x0141('0xf')](socket);function respondWithRpcPromise(_0x3465f2,_0x1b6b66,_0x1798ae){return new BPromise(function(_0x3f5e8f,_0x5f368f){return client['request'](_0x3465f2,_0x1798ae)[_0x0141('0x10')](function(_0x3b7718){logger[_0x0141('0x11')](_0x0141('0x12'),_0x1b6b66,'request\x20sent');logger['debug'](_0x0141('0x13'),_0x1b6b66,_0x0141('0x14'),JSON['stringify'](_0x3b7718));if(_0x3b7718[_0x0141('0x15')]){if(_0x3b7718[_0x0141('0x15')][_0x0141('0x16')]===0x1f4){logger[_0x0141('0x15')](_0x0141('0x12'),_0x1b6b66,_0x3b7718['error'][_0x0141('0x17')]);return _0x5f368f(_0x3b7718['error'][_0x0141('0x17')]);}logger[_0x0141('0x15')](_0x0141('0x12'),_0x1b6b66,_0x3b7718[_0x0141('0x15')][_0x0141('0x17')]);return _0x3f5e8f(_0x3b7718[_0x0141('0x15')]['message']);}else{logger['info'](_0x0141('0x12'),_0x1b6b66,_0x0141('0x14'));_0x3f5e8f(_0x3b7718['result'][_0x0141('0x17')]);}})[_0x0141('0x18')](function(_0x8beed8){logger[_0x0141('0x15')]('UserProfile,\x20%s,\x20%s',_0x1b6b66,_0x8beed8);_0x5f368f(_0x8beed8);});});} \ No newline at end of file +var _0x07fa=['message','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','defaults','./userProfile.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s'];(function(_0x16818d,_0x1b85a6){var _0x2edfeb=function(_0x58811d){while(--_0x58811d){_0x16818d['push'](_0x16818d['shift']());}};_0x2edfeb(++_0x1b85a6);}(_0x07fa,0x177));var _0xa07f=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x07fa[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var moment=require(_0xa07f('0x1'));var BPromise=require(_0xa07f('0x2'));var rs=require(_0xa07f('0x3'));var fs=require('fs');var Redis=require(_0xa07f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa07f('0x5'));var logger=require(_0xa07f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa07f('0x7')][_0xa07f('0x8')]({'port':0x232a});config['redis']=_[_0xa07f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa07f('0xa'))[_0xa07f('0xb')](socket);function respondWithRpcPromise(_0x5812ff,_0xd3bdbf,_0x4401fa){return new BPromise(function(_0x151dda,_0x3679de){return client[_0xa07f('0xc')](_0x5812ff,_0x4401fa)[_0xa07f('0xd')](function(_0x7873c2){logger[_0xa07f('0xe')]('UserProfile,\x20%s,\x20%s',_0xd3bdbf,_0xa07f('0xf'));logger[_0xa07f('0x10')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xd3bdbf,_0xa07f('0xf'),JSON[_0xa07f('0x11')](_0x7873c2));if(_0x7873c2[_0xa07f('0x12')]){if(_0x7873c2['error'][_0xa07f('0x13')]===0x1f4){logger['error'](_0xa07f('0x14'),_0xd3bdbf,_0x7873c2[_0xa07f('0x12')][_0xa07f('0x15')]);return _0x3679de(_0x7873c2[_0xa07f('0x12')]['message']);}logger[_0xa07f('0x12')](_0xa07f('0x14'),_0xd3bdbf,_0x7873c2[_0xa07f('0x12')][_0xa07f('0x15')]);return _0x151dda(_0x7873c2[_0xa07f('0x12')]['message']);}else{logger[_0xa07f('0xe')]('UserProfile,\x20%s,\x20%s',_0xd3bdbf,'request\x20sent');_0x151dda(_0x7873c2['result']['message']);}})['catch'](function(_0x54b2dd){logger[_0xa07f('0x12')](_0xa07f('0x14'),_0xd3bdbf,_0x54b2dd);_0x3679de(_0x54b2dd);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 09f1f59..6f784b7 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 _0x46b8=['userProfile:','./userProfile.events','save','remove','update','emit','length'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x46b8,0x1dd));var _0x846b=function(_0x378ea0,_0x4d5b5f){_0x378ea0=_0x378ea0-0x0;var _0x2cdad6=_0x46b8[_0x378ea0];return _0x2cdad6;};'use strict';var UserProfileEvents=require(_0x846b('0x0'));var events=[_0x846b('0x1'),_0x846b('0x2'),_0x846b('0x3')];function createListener(_0xe91584,_0x28a92c){return function(_0x4ad04d){_0x28a92c[_0x846b('0x4')](_0xe91584,_0x4ad04d);};}function removeListener(_0x477026,_0x5d8918){return function(){UserProfileEvents['removeListener'](_0x477026,_0x5d8918);};}exports['register']=function(_0x491bc5){for(var _0x3d7d86=0x0,_0x44bb69=events[_0x846b('0x5')];_0x3d7d86<_0x44bb69;_0x3d7d86++){var _0x5cbc5e=events[_0x3d7d86];var _0x35037e=createListener(_0x846b('0x6')+_0x5cbc5e,_0x491bc5);UserProfileEvents['on'](_0x5cbc5e,_0x35037e);}}; \ No newline at end of file +var _0xc072=['length','userProfile:','./userProfile.events','save','update','emit','removeListener','register'];(function(_0x54c65f,_0x5a4eea){var _0x535b20=function(_0x4a99be){while(--_0x4a99be){_0x54c65f['push'](_0x54c65f['shift']());}};_0x535b20(++_0x5a4eea);}(_0xc072,0x122));var _0x2c07=function(_0x5ec098,_0x399e8e){_0x5ec098=_0x5ec098-0x0;var _0x3c251f=_0xc072[_0x5ec098];return _0x3c251f;};'use strict';var UserProfileEvents=require(_0x2c07('0x0'));var events=[_0x2c07('0x1'),'remove',_0x2c07('0x2')];function createListener(_0x14b5c4,_0x36acb4){return function(_0x363563){_0x36acb4[_0x2c07('0x3')](_0x14b5c4,_0x363563);};}function removeListener(_0x10c6d9,_0x46767a){return function(){UserProfileEvents[_0x2c07('0x4')](_0x10c6d9,_0x46767a);};}exports[_0x2c07('0x5')]=function(_0x852eab){for(var _0x1a3501=0x0,_0x4ab882=events[_0x2c07('0x6')];_0x1a3501<_0x4ab882;_0x1a3501++){var _0x26cd9b=events[_0x1a3501];var _0x39ea25=createListener(_0x2c07('0x7')+_0x26cd9b,_0x852eab);UserProfileEvents['on'](_0x26cd9b,_0x39ea25);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2b879b1..a9e1d83 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 _0xb48a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xb48a,0x19b));var _0xab48=function(_0x3861e6,_0xbf65e){_0x3861e6=_0x3861e6-0x0;var _0x34cbc3=_0xb48a[_0x3861e6];return _0x34cbc3;};'use strict';var multer=require(_0xab48('0x0'));var util=require(_0xab48('0x1'));var path=require(_0xab48('0x2'));var timeout=require(_0xab48('0x3'));var express=require(_0xab48('0x4'));var router=express[_0xab48('0x5')]();var fs_extra=require(_0xab48('0x6'));var auth=require(_0xab48('0x7'));var interaction=require(_0xab48('0x8'));var config=require(_0xab48('0x9'));var controller=require(_0xab48('0xa'));router[_0xab48('0xb')]('/',auth['isAuthenticated'](),controller[_0xab48('0xc')]);router['get'](_0xab48('0xd'),auth[_0xab48('0xe')](),controller['describe']);router['get'](_0xab48('0xf'),auth['isAuthenticated'](),controller[_0xab48('0x10')]);router['post']('/',auth[_0xab48('0xe')](),controller[_0xab48('0x11')]);router[_0xab48('0x12')](_0xab48('0xf'),auth[_0xab48('0xe')](),controller[_0xab48('0x13')]);router['delete']('/:id',auth[_0xab48('0xe')](),controller[_0xab48('0x14')]);module[_0xab48('0x15')]=router; \ No newline at end of file +var _0x1bde=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','show','create','put','/:id','update','delete','destroy','multer','path','fs-extra','../../components/auth/service'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x1bde,0x11d));var _0xe1bd=function(_0x540cdb,_0xf5fe44){_0x540cdb=_0x540cdb-0x0;var _0x52f1ff=_0x1bde[_0x540cdb];return _0x52f1ff;};'use strict';var multer=require(_0xe1bd('0x0'));var util=require('util');var path=require(_0xe1bd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe1bd('0x2'));var auth=require(_0xe1bd('0x3'));var interaction=require(_0xe1bd('0x4'));var config=require(_0xe1bd('0x5'));var controller=require(_0xe1bd('0x6'));router[_0xe1bd('0x7')]('/',auth[_0xe1bd('0x8')](),controller['index']);router[_0xe1bd('0x7')](_0xe1bd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xe1bd('0x7')]('/:id',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0xa')]);router['post']('/',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0xb')]);router[_0xe1bd('0xc')](_0xe1bd('0xd'),auth['isAuthenticated'](),controller[_0xe1bd('0xe')]);router[_0xe1bd('0xf')]('/:id',auth[_0xe1bd('0x8')](),controller[_0xe1bd('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 8fa44e1..d72664f 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 _0xeaff=['exports','INTEGER','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeaff,0x164));var _0xfeaf=function(_0x27b93d,_0x16df02){_0x27b93d=_0x27b93d-0x0;var _0x3c3498=_0xeaff[_0x27b93d];return _0x3c3498;};'use strict';var Sequelize=require(_0xfeaf('0x0'));module[_0xfeaf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfeaf('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6a36=['INTEGER','sequelize','STRING'];(function(_0x4e6d36,_0x491afa){var _0xcc4e12=function(_0x188552){while(--_0x188552){_0x4e6d36['push'](_0x4e6d36['shift']());}};_0xcc4e12(++_0x491afa);}(_0x6a36,0xb8));var _0x66a3=function(_0x29c76b,_0x2f7371){_0x29c76b=_0x29c76b-0x0;var _0x2b5b35=_0x6a36[_0x29c76b];return _0x2b5b35;};'use strict';var Sequelize=require(_0x66a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x66a3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x66a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x66a3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3b84613..2a2b4f9 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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0xba34,0x119));var _0x4ba3=function(_0x3308e9,_0x4bd024){_0x3308e9=_0x3308e9-0x0;var _0x50d70a=_0xba34[_0x3308e9];return _0x50d70a;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['UserProfileResource'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['UserProfileResource']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['UserProfileResource'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 0bb4717..d3a29bc 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 _0xe8e7=['UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xe8e7,0xa9));var _0x7e8e=function(_0x2eeba1,_0x5d496d){_0x2eeba1=_0x2eeba1-0x0;var _0x1d795e=_0xe8e7[_0x2eeba1];return _0x1d795e;};'use strict';var _=require(_0x7e8e('0x0'));var util=require(_0x7e8e('0x1'));var logger=require(_0x7e8e('0x2'))('api');var moment=require(_0x7e8e('0x3'));var BPromise=require(_0x7e8e('0x4'));var rp=require(_0x7e8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e8e('0x6'));var config=require(_0x7e8e('0x7'));var attributes=require(_0x7e8e('0x8'));module[_0x7e8e('0x9')]=function(_0x340faf,_0x512bc8){return _0x340faf[_0x7e8e('0xa')](_0x7e8e('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7e8e('0xc'),'fields':[_0x7e8e('0xd'),_0x7e8e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf68b=['exports','define','UserProfileResource','user_profile_has_resources','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x42c5c8,_0x5c6a63){var _0x3fc894=function(_0x25b288){while(--_0x25b288){_0x42c5c8['push'](_0x42c5c8['shift']());}};_0x3fc894(++_0x5c6a63);}(_0xf68b,0x1e5));var _0xbf68=function(_0x11cc66,_0x59da98){_0x11cc66=_0x11cc66-0x0;var _0x19d7e6=_0xf68b[_0x11cc66];return _0x19d7e6;};'use strict';var _=require(_0xbf68('0x0'));var util=require(_0xbf68('0x1'));var logger=require(_0xbf68('0x2'))('api');var moment=require(_0xbf68('0x3'));var BPromise=require(_0xbf68('0x4'));var rp=require(_0xbf68('0x5'));var fs=require('fs');var path=require(_0xbf68('0x6'));var rimraf=require(_0xbf68('0x7'));var config=require(_0xbf68('0x8'));var attributes=require(_0xbf68('0x9'));module[_0xbf68('0xa')]=function(_0x304c19,_0x4c6467){return _0x304c19[_0xbf68('0xb')](_0xbf68('0xc'),attributes,{'tableName':_0xbf68('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xbf68('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index fafcc93..7814978 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 _0x2552=['result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','stringify','error','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x2552,0x122));var _0x2255=function(_0x12c406,_0x42c02e){_0x12c406=_0x12c406-0x0;var _0x3fba16=_0x2552[_0x12c406];return _0x3fba16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2255('0x0'));var BPromise=require(_0x2255('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2255('0x2'));var db=require(_0x2255('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2255('0x4'))(_0x2255('0x5'));var config=require(_0x2255('0x6'));var jayson=require(_0x2255('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a5904,_0x543414,_0x18b203){return new BPromise(function(_0x26e670,_0x322f2d){return client[_0x2255('0x8')](_0x5a5904,_0x18b203)['then'](function(_0x33484b){logger[_0x2255('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x543414,_0x2255('0xa'));logger[_0x2255('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x543414,'request\x20sent',JSON[_0x2255('0xc')](_0x33484b));if(_0x33484b[_0x2255('0xd')]){if(_0x33484b['error']['code']===0x1f4){logger[_0x2255('0xd')](_0x2255('0xe'),_0x543414,_0x33484b['error'][_0x2255('0xf')]);return _0x322f2d(_0x33484b[_0x2255('0xd')]['message']);}logger[_0x2255('0xd')](_0x2255('0xe'),_0x543414,_0x33484b[_0x2255('0xd')][_0x2255('0xf')]);return _0x26e670(_0x33484b[_0x2255('0xd')][_0x2255('0xf')]);}else{logger[_0x2255('0x9')](_0x2255('0xe'),_0x543414,'request\x20sent');_0x26e670(_0x33484b[_0x2255('0x10')][_0x2255('0xf')]);}})[_0x2255('0x11')](function(_0x2bcc9e){logger['error'](_0x2255('0xe'),_0x543414,_0x2bcc9e);_0x322f2d(_0x2bcc9e);});});} \ No newline at end of file +var _0x9a2b=['jayson/promise','then','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','UserProfileResource,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x569257,_0x1da54f){var _0xb56f90=function(_0x7475ac){while(--_0x7475ac){_0x569257['push'](_0x569257['shift']());}};_0xb56f90(++_0x1da54f);}(_0x9a2b,0xd5));var _0xb9a2=function(_0x265721,_0x1503f2){_0x265721=_0x265721-0x0;var _0x11ec95=_0x9a2b[_0x265721];return _0x11ec95;};'use strict';var _=require(_0xb9a2('0x0'));var util=require(_0xb9a2('0x1'));var moment=require(_0xb9a2('0x2'));var BPromise=require(_0xb9a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9a2('0x4'));var db=require(_0xb9a2('0x5'))['db'];var utils=require(_0xb9a2('0x6'));var logger=require(_0xb9a2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb9a2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d8a88,_0x255ac5,_0x20fc43){return new BPromise(function(_0x45a827,_0x182142){return client['request'](_0x1d8a88,_0x20fc43)[_0xb9a2('0x9')](function(_0x1f69fe){logger[_0xb9a2('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x255ac5,_0xb9a2('0xb'));logger['debug'](_0xb9a2('0xc'),_0x255ac5,'request\x20sent',JSON[_0xb9a2('0xd')](_0x1f69fe));if(_0x1f69fe[_0xb9a2('0xe')]){if(_0x1f69fe[_0xb9a2('0xe')]['code']===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x255ac5,_0x1f69fe[_0xb9a2('0xe')]['message']);return _0x182142(_0x1f69fe[_0xb9a2('0xe')][_0xb9a2('0xf')]);}logger[_0xb9a2('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x255ac5,_0x1f69fe[_0xb9a2('0xe')][_0xb9a2('0xf')]);return _0x45a827(_0x1f69fe[_0xb9a2('0xe')][_0xb9a2('0xf')]);}else{logger[_0xb9a2('0xa')](_0xb9a2('0x10'),_0x255ac5,_0xb9a2('0xb'));_0x45a827(_0x1f69fe['result']['message']);}})['catch'](function(_0x2f197f){logger[_0xb9a2('0xe')](_0xb9a2('0x10'),_0x255ac5,_0x2f197f);_0x182142(_0x2f197f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 743668a..c746131 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 _0xe542=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','path'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0xe542,0x18e));var _0x2e54=function(_0x1f0b55,_0x20360a){_0x1f0b55=_0x1f0b55-0x0;var _0x49df7e=_0xe542[_0x1f0b55];return _0x49df7e;};'use strict';var multer=require('multer');var util=require(_0x2e54('0x0'));var path=require(_0x2e54('0x1'));var timeout=require(_0x2e54('0x2'));var express=require(_0x2e54('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e54('0x4'));var interaction=require(_0x2e54('0x5'));var config=require('../../config/environment');var controller=require(_0x2e54('0x6'));router['get']('/',auth[_0x2e54('0x7')](),controller[_0x2e54('0x8')]);router[_0x2e54('0x9')](_0x2e54('0xa'),auth[_0x2e54('0x7')](),controller[_0x2e54('0xb')]);router[_0x2e54('0x9')](_0x2e54('0xc'),auth[_0x2e54('0x7')](),controller[_0x2e54('0xd')]);router[_0x2e54('0xe')]('/',auth[_0x2e54('0x7')](),controller[_0x2e54('0xf')]);router[_0x2e54('0x10')](_0x2e54('0xc'),auth[_0x2e54('0x7')](),controller[_0x2e54('0x11')]);router[_0x2e54('0x12')]('/:id',auth[_0x2e54('0x7')](),controller['destroy']);module[_0x2e54('0x13')]=router; \ No newline at end of file +var _0x7a3a=['isAuthenticated','describe','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','index'];(function(_0x2fed48,_0x13df44){var _0xea0f77=function(_0x25edec){while(--_0x25edec){_0x2fed48['push'](_0x2fed48['shift']());}};_0xea0f77(++_0x13df44);}(_0x7a3a,0xe5));var _0xa7a3=function(_0x2ee8f7,_0x3f106b){_0x2ee8f7=_0x2ee8f7-0x0;var _0x1184e2=_0x7a3a[_0x2ee8f7];return _0x1184e2;};'use strict';var multer=require('multer');var util=require(_0xa7a3('0x0'));var path=require(_0xa7a3('0x1'));var timeout=require(_0xa7a3('0x2'));var express=require(_0xa7a3('0x3'));var router=express[_0xa7a3('0x4')]();var fs_extra=require(_0xa7a3('0x5'));var auth=require(_0xa7a3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7a3('0x7'));var controller=require(_0xa7a3('0x8'));router[_0xa7a3('0x9')]('/',auth['isAuthenticated'](),controller[_0xa7a3('0xa')]);router['get']('/describe',auth[_0xa7a3('0xb')](),controller[_0xa7a3('0xc')]);router['get']('/:id',auth[_0xa7a3('0xb')](),controller['show']);router[_0xa7a3('0xd')]('/',auth['isAuthenticated'](),controller[_0xa7a3('0xe')]);router[_0xa7a3('0xf')](_0xa7a3('0x10'),auth[_0xa7a3('0xb')](),controller[_0xa7a3('0x11')]);router[_0xa7a3('0x12')](_0xa7a3('0x10'),auth[_0xa7a3('0xb')](),controller['destroy']);module[_0xa7a3('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5258f02..2d1bfcc 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 _0x1eba=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x2f4076,_0x1dbab7){var _0x474038=function(_0x114f13){while(--_0x114f13){_0x2f4076['push'](_0x2f4076['shift']());}};_0x474038(++_0x1dbab7);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x1eba[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xa1eb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa1eb('0x2')],'set':function(_0x34be5a){this[_0xa1eb('0x4')](_0xa1eb('0x5'),_0x34be5a?_0x34be5a[_0xa1eb('0x6')](''):[]);},'get':function(){return this[_0xa1eb('0x7')](_0xa1eb('0x5'))?this[_0xa1eb('0x7')](_0xa1eb('0x5'))[_0xa1eb('0x8')](''):[];}}}; \ No newline at end of file +var _0x4b17=['STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x4767bb,_0x86d5c6){var _0x2de2a7=function(_0x4930be){while(--_0x4930be){_0x4767bb['push'](_0x4767bb['shift']());}};_0x2de2a7(++_0x86d5c6);}(_0x4b17,0x10f));var _0x74b1=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x4b17[_0xc5a279];return _0xc755d3;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x74b1('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x74b1('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x74b1('0x1')],'set':function(_0x4f206f){this['setDataValue'](_0x74b1('0x4'),_0x4f206f?_0x4f206f[_0x74b1('0x5')](''):[]);},'get':function(){return this[_0x74b1('0x6')](_0x74b1('0x4'))?this[_0x74b1('0x6')](_0x74b1('0x4'))[_0x74b1('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index c192e92..424724d 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 _0xdf81=['map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','then','end','stack','name','send'];(function(_0x49a6ba,_0xbafa08){var _0x136d13=function(_0x2a8aca){while(--_0x2a8aca){_0x49a6ba['push'](_0x49a6ba['shift']());}};_0x136d13(++_0xbafa08);}(_0xdf81,0xb7));var _0x1df8=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xdf81[_0x5627e1];return _0x2f013f;};'use strict';var emlformat=require(_0x1df8('0x0'));var rimraf=require(_0x1df8('0x1'));var zipdir=require(_0x1df8('0x2'));var jsonpatch=require(_0x1df8('0x3'));var rp=require(_0x1df8('0x4'));var moment=require(_0x1df8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1df8('0x6'));var util=require(_0x1df8('0x7'));var path=require(_0x1df8('0x8'));var sox=require('sox');var csv=require(_0x1df8('0x9'));var ejs=require(_0x1df8('0xa'));var fs=require('fs');var fs_extra=require(_0x1df8('0xb'));var _=require(_0x1df8('0xc'));var squel=require(_0x1df8('0xd'));var crypto=require(_0x1df8('0xe'));var jsforce=require(_0x1df8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1df8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1df8('0x10'));var authService=require(_0x1df8('0x11'));var qs=require(_0x1df8('0x12'));var as=require(_0x1df8('0x13'));var hardwareService=require(_0x1df8('0x14'));var logger=require(_0x1df8('0x15'))(_0x1df8('0x16'));var utils=require(_0x1df8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1df8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d12a2,_0x5eb0ea){_0x5eb0ea=_0x5eb0ea||0xcc;return function(_0x31e03d){if(_0x31e03d){return _0x4d12a2[_0x1df8('0x19')](_0x5eb0ea);}return _0x4d12a2[_0x1df8('0x1a')](_0x5eb0ea)['end']();};}function respondWithResult(_0x66b3c6,_0x20f22e){_0x20f22e=_0x20f22e||0xc8;return function(_0x4c779d){if(_0x4c779d){return _0x66b3c6[_0x1df8('0x1a')](_0x20f22e)[_0x1df8('0x1b')](_0x4c779d);}};}function respondWithFilteredResult(_0x480b94,_0x4cb03b){return function(_0x42a1ea){if(_0x42a1ea){var _0x258184=typeof _0x4cb03b[_0x1df8('0x1c')]===_0x1df8('0x1d')&&typeof _0x4cb03b['limit']===_0x1df8('0x1d');var _0x4c1b7b=_0x42a1ea['count'];var _0xf0bd84=_0x258184?0x0:_0x4cb03b[_0x1df8('0x1c')];var _0x5e0260=_0x258184?_0x42a1ea[_0x1df8('0x1e')]:_0x4cb03b[_0x1df8('0x1c')]+_0x4cb03b['limit'];var _0x5caba2;if(_0x5e0260>=_0x4c1b7b){_0x5e0260=_0x4c1b7b;_0x5caba2=0xc8;}else{_0x5caba2=0xce;}_0x480b94[_0x1df8('0x1a')](_0x5caba2);return _0x480b94[_0x1df8('0x1f')](_0x1df8('0x20'),_0xf0bd84+'-'+_0x5e0260+'/'+_0x4c1b7b)['json'](_0x42a1ea);}return null;};}function patchUpdates(_0x23489b){return function(_0x1d465b){try{jsonpatch[_0x1df8('0x21')](_0x1d465b,_0x23489b,!![]);}catch(_0x40aa5c){return BPromise['reject'](_0x40aa5c);}return _0x1d465b['save']();};}function saveUpdates(_0x499a58,_0x123fc3){return function(_0x8c837d){if(_0x8c837d){return _0x8c837d['update'](_0x499a58)[_0x1df8('0x22')](function(_0x3783d7){return _0x3783d7;});}return null;};}function removeEntity(_0x540b95,_0xe2d8b5){return function(_0x1884aa){if(_0x1884aa){return _0x1884aa['destroy']()['then'](function(){_0x540b95[_0x1df8('0x1a')](0xcc)[_0x1df8('0x23')]();});}};}function handleEntityNotFound(_0x758b97,_0x279baa){return function(_0x4aead4){if(!_0x4aead4){_0x758b97[_0x1df8('0x19')](0x194);}return _0x4aead4;};}function handleError(_0x6e7832,_0x39f84e){_0x39f84e=_0x39f84e||0x1f4;return function(_0x11cbc0){logger['error'](_0x11cbc0[_0x1df8('0x24')]);if(_0x11cbc0[_0x1df8('0x25')]){delete _0x11cbc0['name'];}_0x6e7832[_0x1df8('0x1a')](_0x39f84e)[_0x1df8('0x26')](_0x11cbc0);};}exports['index']=function(_0x46c466,_0x17d0e8){var _0x516272={},_0x3a5647={},_0xb3a88c={'count':0x0,'rows':[]};var _0xaa5a9a=_[_0x1df8('0x27')](db[_0x1df8('0x28')][_0x1df8('0x29')],function(_0x271fb5){return{'name':_0x271fb5[_0x1df8('0x2a')],'type':_0x271fb5[_0x1df8('0x2b')][_0x1df8('0x2c')]};});_0x3a5647[_0x1df8('0x2d')]=_[_0x1df8('0x27')](_0xaa5a9a,'name');_0x3a5647[_0x1df8('0x2e')]=_['keys'](_0x46c466[_0x1df8('0x2e')]);_0x3a5647['filters']=_[_0x1df8('0x2f')](_0x3a5647[_0x1df8('0x2d')],_0x3a5647[_0x1df8('0x2e')]);_0x516272[_0x1df8('0x30')]=_[_0x1df8('0x2f')](_0x3a5647[_0x1df8('0x2d')],qs['fields'](_0x46c466[_0x1df8('0x2e')]['fields']));_0x516272[_0x1df8('0x30')]=_0x516272[_0x1df8('0x30')]['length']?_0x516272['attributes']:_0x3a5647[_0x1df8('0x2d')];if(!_0x46c466[_0x1df8('0x2e')][_0x1df8('0x31')](_0x1df8('0x32'))){_0x516272[_0x1df8('0x33')]=qs[_0x1df8('0x33')](_0x46c466[_0x1df8('0x2e')][_0x1df8('0x33')]);_0x516272[_0x1df8('0x1c')]=qs[_0x1df8('0x1c')](_0x46c466[_0x1df8('0x2e')]['offset']);}_0x516272[_0x1df8('0x34')]=qs[_0x1df8('0x35')](_0x46c466[_0x1df8('0x2e')][_0x1df8('0x35')]);_0x516272['where']=qs[_0x1df8('0x36')](_['pick'](_0x46c466[_0x1df8('0x2e')],_0x3a5647[_0x1df8('0x36')]),_0xaa5a9a);if(_0x46c466[_0x1df8('0x2e')][_0x1df8('0x37')]){_0x516272[_0x1df8('0x38')]=_[_0x1df8('0x39')](_0x516272[_0x1df8('0x38')],{'$or':_['map'](_0xaa5a9a,function(_0xcdc69e){if(_0xcdc69e[_0x1df8('0x2b')]!==_0x1df8('0x3a')){var _0x55181e={};_0x55181e[_0xcdc69e[_0x1df8('0x25')]]={'$like':'%'+_0x46c466['query'][_0x1df8('0x37')]+'%'};return _0x55181e;}})});}_0x516272=_[_0x1df8('0x39')]({},_0x516272,_0x46c466[_0x1df8('0x3b')]);var _0x1dbe13={'where':_0x516272['where']};return db['UserProfileSection'][_0x1df8('0x1e')](_0x1dbe13)[_0x1df8('0x22')](function(_0x53cf7c){_0xb3a88c[_0x1df8('0x1e')]=_0x53cf7c;if(_0x46c466[_0x1df8('0x2e')][_0x1df8('0x3c')]){_0x516272[_0x1df8('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1df8('0x3e')](_0x516272);})[_0x1df8('0x22')](function(_0x1f57d8){_0xb3a88c[_0x1df8('0x3f')]=_0x1f57d8;return _0xb3a88c;})[_0x1df8('0x22')](respondWithFilteredResult(_0x17d0e8,_0x516272))[_0x1df8('0x40')](handleError(_0x17d0e8,null));};exports[_0x1df8('0x41')]=function(_0x1352ce,_0x13e2e5){var _0x2da9f6={'raw':![],'where':{'id':_0x1352ce[_0x1df8('0x42')]['id']}},_0x3b46fc={};_0x3b46fc[_0x1df8('0x2d')]=_[_0x1df8('0x43')](db[_0x1df8('0x28')][_0x1df8('0x29')]);_0x3b46fc['query']=_['keys'](_0x1352ce['query']);_0x3b46fc[_0x1df8('0x36')]=_['intersection'](_0x3b46fc['model'],_0x3b46fc['query']);_0x2da9f6['attributes']=_['intersection'](_0x3b46fc[_0x1df8('0x2d')],qs['fields'](_0x1352ce[_0x1df8('0x2e')][_0x1df8('0x44')]));_0x2da9f6[_0x1df8('0x30')]=_0x2da9f6['attributes'][_0x1df8('0x45')]?_0x2da9f6[_0x1df8('0x30')]:_0x3b46fc[_0x1df8('0x2d')];if(_0x1352ce['query'][_0x1df8('0x3c')]){_0x2da9f6[_0x1df8('0x3d')]=[{'all':!![]}];}_0x2da9f6=_[_0x1df8('0x39')]({},_0x2da9f6,_0x1352ce[_0x1df8('0x3b')]);return db['UserProfileSection']['find'](_0x2da9f6)[_0x1df8('0x22')](handleEntityNotFound(_0x13e2e5,null))[_0x1df8('0x22')](respondWithResult(_0x13e2e5,null))['catch'](handleError(_0x13e2e5,null));};exports[_0x1df8('0x46')]=function(_0x1a53d2,_0x2a2d1e){return db['UserProfileSection'][_0x1df8('0x46')](_0x1a53d2[_0x1df8('0x47')],{})[_0x1df8('0x22')](respondWithResult(_0x2a2d1e,0xc9))[_0x1df8('0x40')](handleError(_0x2a2d1e,null));};exports['update']=function(_0x3c2e33,_0x17d009){if(_0x3c2e33[_0x1df8('0x47')]['id']){delete _0x3c2e33['body']['id'];}return db['UserProfileSection'][_0x1df8('0x48')]({'where':{'id':_0x3c2e33['params']['id']}})['then'](handleEntityNotFound(_0x17d009,null))[_0x1df8('0x22')](saveUpdates(_0x3c2e33[_0x1df8('0x47')],null))[_0x1df8('0x22')](respondWithResult(_0x17d009,null))['catch'](handleError(_0x17d009,null));};exports['destroy']=function(_0x5cb8d7,_0x21ede5){return db[_0x1df8('0x28')]['find']({'where':{'id':_0x5cb8d7['params']['id']}})[_0x1df8('0x22')](handleEntityNotFound(_0x21ede5,null))['then'](removeEntity(_0x21ede5,null))[_0x1df8('0x40')](handleError(_0x21ede5,null));};exports[_0x1df8('0x49')]=function(_0x5d47da,_0x5a4d15){return db[_0x1df8('0x28')]['describe']()[_0x1df8('0x22')](respondWithResult(_0x5a4d15,null))['catch'](handleError(_0x5a4d15,null));}; \ No newline at end of file +var _0x94ce=['fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes'];(function(_0x1f006b,_0x228e9e){var _0x3073bc=function(_0x3629fa){while(--_0x3629fa){_0x1f006b['push'](_0x1f006b['shift']());}};_0x3073bc(++_0x228e9e);}(_0x94ce,0x141));var _0xe94c=function(_0x84706,_0x1544a3){_0x84706=_0x84706-0x0;var _0x119ed1=_0x94ce[_0x84706];return _0x119ed1;};'use strict';var emlformat=require(_0xe94c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe94c('0x1'));var rp=require(_0xe94c('0x2'));var moment=require(_0xe94c('0x3'));var BPromise=require(_0xe94c('0x4'));var Mustache=require('mustache');var util=require(_0xe94c('0x5'));var path=require(_0xe94c('0x6'));var sox=require(_0xe94c('0x7'));var csv=require(_0xe94c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe94c('0x9'));var _=require(_0xe94c('0xa'));var squel=require('squel');var crypto=require(_0xe94c('0xb'));var jsforce=require(_0xe94c('0xc'));var deskjs=require(_0xe94c('0xd'));var toCsv=require(_0xe94c('0x8'));var querystring=require(_0xe94c('0xe'));var Papa=require(_0xe94c('0xf'));var Redis=require(_0xe94c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe94c('0x11'));var as=require(_0xe94c('0x12'));var hardwareService=require(_0xe94c('0x13'));var logger=require(_0xe94c('0x14'))('api');var utils=require(_0xe94c('0x15'));var config=require(_0xe94c('0x16'));var licenseUtil=require(_0xe94c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3966fd,_0x4740b4){_0x4740b4=_0x4740b4||0xcc;return function(_0x1f43e0){if(_0x1f43e0){return _0x3966fd['sendStatus'](_0x4740b4);}return _0x3966fd[_0xe94c('0x18')](_0x4740b4)[_0xe94c('0x19')]();};}function respondWithResult(_0x3c4fd9,_0x4d062d){_0x4d062d=_0x4d062d||0xc8;return function(_0x3bc55c){if(_0x3bc55c){return _0x3c4fd9[_0xe94c('0x18')](_0x4d062d)[_0xe94c('0x1a')](_0x3bc55c);}};}function respondWithFilteredResult(_0x27446d,_0x589ca4){return function(_0x56e547){if(_0x56e547){var _0x4f654a=typeof _0x589ca4[_0xe94c('0x1b')]===_0xe94c('0x1c')&&typeof _0x589ca4[_0xe94c('0x1d')]===_0xe94c('0x1c');var _0x2d53dc=_0x56e547['count'];var _0x1af427=_0x4f654a?0x0:_0x589ca4[_0xe94c('0x1b')];var _0x27e2c3=_0x4f654a?_0x56e547[_0xe94c('0x1e')]:_0x589ca4[_0xe94c('0x1b')]+_0x589ca4[_0xe94c('0x1d')];var _0x284a34;if(_0x27e2c3>=_0x2d53dc){_0x27e2c3=_0x2d53dc;_0x284a34=0xc8;}else{_0x284a34=0xce;}_0x27446d[_0xe94c('0x18')](_0x284a34);return _0x27446d['set'](_0xe94c('0x1f'),_0x1af427+'-'+_0x27e2c3+'/'+_0x2d53dc)[_0xe94c('0x1a')](_0x56e547);}return null;};}function patchUpdates(_0x2f7811){return function(_0x1b87b0){try{jsonpatch[_0xe94c('0x20')](_0x1b87b0,_0x2f7811,!![]);}catch(_0x3911f8){return BPromise[_0xe94c('0x21')](_0x3911f8);}return _0x1b87b0['save']();};}function saveUpdates(_0x1906c2,_0x1b8cfd){return function(_0x20d33a){if(_0x20d33a){return _0x20d33a[_0xe94c('0x22')](_0x1906c2)[_0xe94c('0x23')](function(_0x445072){return _0x445072;});}return null;};}function removeEntity(_0x28d31c,_0x2b8469){return function(_0x7c7c6a){if(_0x7c7c6a){return _0x7c7c6a['destroy']()[_0xe94c('0x23')](function(){_0x28d31c[_0xe94c('0x18')](0xcc)[_0xe94c('0x19')]();});}};}function handleEntityNotFound(_0x2df61f,_0x3ca99f){return function(_0xff4edc){if(!_0xff4edc){_0x2df61f['sendStatus'](0x194);}return _0xff4edc;};}function handleError(_0x4dda7e,_0x1fd593){_0x1fd593=_0x1fd593||0x1f4;return function(_0x246972){logger[_0xe94c('0x24')](_0x246972[_0xe94c('0x25')]);if(_0x246972[_0xe94c('0x26')]){delete _0x246972['name'];}_0x4dda7e[_0xe94c('0x18')](_0x1fd593)[_0xe94c('0x27')](_0x246972);};}exports[_0xe94c('0x28')]=function(_0x3ccac0,_0x29ae2e){var _0x1d5dc4={},_0x53aca2={},_0x39c353={'count':0x0,'rows':[]};var _0x35f9a8=_[_0xe94c('0x29')](db[_0xe94c('0x2a')][_0xe94c('0x2b')],function(_0x2d2999){return{'name':_0x2d2999[_0xe94c('0x2c')],'type':_0x2d2999[_0xe94c('0x2d')]['key']};});_0x53aca2[_0xe94c('0x2e')]=_['map'](_0x35f9a8,_0xe94c('0x26'));_0x53aca2[_0xe94c('0x2f')]=_[_0xe94c('0x30')](_0x3ccac0['query']);_0x53aca2[_0xe94c('0x31')]=_[_0xe94c('0x32')](_0x53aca2[_0xe94c('0x2e')],_0x53aca2[_0xe94c('0x2f')]);_0x1d5dc4['attributes']=_[_0xe94c('0x32')](_0x53aca2[_0xe94c('0x2e')],qs[_0xe94c('0x33')](_0x3ccac0[_0xe94c('0x2f')][_0xe94c('0x33')]));_0x1d5dc4['attributes']=_0x1d5dc4[_0xe94c('0x34')][_0xe94c('0x35')]?_0x1d5dc4['attributes']:_0x53aca2['model'];if(!_0x3ccac0[_0xe94c('0x2f')][_0xe94c('0x36')](_0xe94c('0x37'))){_0x1d5dc4[_0xe94c('0x1d')]=qs[_0xe94c('0x1d')](_0x3ccac0[_0xe94c('0x2f')][_0xe94c('0x1d')]);_0x1d5dc4[_0xe94c('0x1b')]=qs[_0xe94c('0x1b')](_0x3ccac0[_0xe94c('0x2f')][_0xe94c('0x1b')]);}_0x1d5dc4['order']=qs[_0xe94c('0x38')](_0x3ccac0[_0xe94c('0x2f')]['sort']);_0x1d5dc4[_0xe94c('0x39')]=qs['filters'](_['pick'](_0x3ccac0[_0xe94c('0x2f')],_0x53aca2[_0xe94c('0x31')]),_0x35f9a8);if(_0x3ccac0[_0xe94c('0x2f')]['filter']){_0x1d5dc4[_0xe94c('0x39')]=_[_0xe94c('0x3a')](_0x1d5dc4[_0xe94c('0x39')],{'$or':_[_0xe94c('0x29')](_0x35f9a8,function(_0x3b3cce){if(_0x3b3cce[_0xe94c('0x2d')]!==_0xe94c('0x3b')){var _0x1db059={};_0x1db059[_0x3b3cce['name']]={'$like':'%'+_0x3ccac0['query'][_0xe94c('0x3c')]+'%'};return _0x1db059;}})});}_0x1d5dc4=_['merge']({},_0x1d5dc4,_0x3ccac0[_0xe94c('0x3d')]);var _0x4bdfde={'where':_0x1d5dc4[_0xe94c('0x39')]};return db[_0xe94c('0x2a')][_0xe94c('0x1e')](_0x4bdfde)['then'](function(_0x4aeb65){_0x39c353[_0xe94c('0x1e')]=_0x4aeb65;if(_0x3ccac0['query'][_0xe94c('0x3e')]){_0x1d5dc4[_0xe94c('0x3f')]=[{'all':!![]}];}return db[_0xe94c('0x2a')]['findAll'](_0x1d5dc4);})[_0xe94c('0x23')](function(_0x490850){_0x39c353[_0xe94c('0x40')]=_0x490850;return _0x39c353;})[_0xe94c('0x23')](respondWithFilteredResult(_0x29ae2e,_0x1d5dc4))[_0xe94c('0x41')](handleError(_0x29ae2e,null));};exports[_0xe94c('0x42')]=function(_0x1a03a1,_0x85dcae){var _0x31fb46={'raw':![],'where':{'id':_0x1a03a1[_0xe94c('0x43')]['id']}},_0x8f5294={};_0x8f5294['model']=_[_0xe94c('0x30')](db[_0xe94c('0x2a')][_0xe94c('0x2b')]);_0x8f5294[_0xe94c('0x2f')]=_[_0xe94c('0x30')](_0x1a03a1[_0xe94c('0x2f')]);_0x8f5294[_0xe94c('0x31')]=_[_0xe94c('0x32')](_0x8f5294[_0xe94c('0x2e')],_0x8f5294[_0xe94c('0x2f')]);_0x31fb46['attributes']=_['intersection'](_0x8f5294[_0xe94c('0x2e')],qs[_0xe94c('0x33')](_0x1a03a1[_0xe94c('0x2f')]['fields']));_0x31fb46['attributes']=_0x31fb46[_0xe94c('0x34')][_0xe94c('0x35')]?_0x31fb46[_0xe94c('0x34')]:_0x8f5294['model'];if(_0x1a03a1[_0xe94c('0x2f')][_0xe94c('0x3e')]){_0x31fb46[_0xe94c('0x3f')]=[{'all':!![]}];}_0x31fb46=_[_0xe94c('0x3a')]({},_0x31fb46,_0x1a03a1[_0xe94c('0x3d')]);return db[_0xe94c('0x2a')][_0xe94c('0x44')](_0x31fb46)[_0xe94c('0x23')](handleEntityNotFound(_0x85dcae,null))['then'](respondWithResult(_0x85dcae,null))['catch'](handleError(_0x85dcae,null));};exports[_0xe94c('0x45')]=function(_0x5194d8,_0x240e60){return db['UserProfileSection'][_0xe94c('0x45')](_0x5194d8[_0xe94c('0x46')],{})[_0xe94c('0x23')](respondWithResult(_0x240e60,0xc9))[_0xe94c('0x41')](handleError(_0x240e60,null));};exports['update']=function(_0x314ff2,_0x5e25bb){if(_0x314ff2[_0xe94c('0x46')]['id']){delete _0x314ff2['body']['id'];}return db[_0xe94c('0x2a')][_0xe94c('0x44')]({'where':{'id':_0x314ff2[_0xe94c('0x43')]['id']}})[_0xe94c('0x23')](handleEntityNotFound(_0x5e25bb,null))[_0xe94c('0x23')](saveUpdates(_0x314ff2[_0xe94c('0x46')],null))[_0xe94c('0x23')](respondWithResult(_0x5e25bb,null))['catch'](handleError(_0x5e25bb,null));};exports[_0xe94c('0x47')]=function(_0x186c3e,_0x31784b){return db[_0xe94c('0x2a')][_0xe94c('0x44')]({'where':{'id':_0x186c3e[_0xe94c('0x43')]['id']}})[_0xe94c('0x23')](handleEntityNotFound(_0x31784b,null))[_0xe94c('0x23')](removeEntity(_0x31784b,null))[_0xe94c('0x41')](handleError(_0x31784b,null));};exports[_0xe94c('0x48')]=function(_0x51a5a5,_0x150c5a){return db[_0xe94c('0x2a')]['describe']()[_0xe94c('0x23')](respondWithResult(_0x150c5a,null))[_0xe94c('0x41')](handleError(_0x150c5a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index eb02eab..1b740c0 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 _0xe030=['UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x4eb168,_0x209d1f){var _0x130fac=function(_0x516a31){while(--_0x516a31){_0x4eb168['push'](_0x4eb168['shift']());}};_0x130fac(++_0x209d1f);}(_0xe030,0xdc));var _0x0e03=function(_0x2335e6,_0x1bade8){_0x2335e6=_0x2335e6-0x0;var _0x370a50=_0xe030[_0x2335e6];return _0x370a50;};'use strict';var _=require(_0x0e03('0x0'));var util=require(_0x0e03('0x1'));var logger=require(_0x0e03('0x2'))(_0x0e03('0x3'));var moment=require('moment');var BPromise=require(_0x0e03('0x4'));var rp=require(_0x0e03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0e03('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x0e03('0x7')]=function(_0x5232d0,_0x1cbb58){return _0x5232d0['define'](_0x0e03('0x8'),attributes,{'tableName':_0x0e03('0x9'),'paranoid':![],'indexes':[{'name':_0x0e03('0xa'),'fields':['sectionId',_0x0e03('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda3b=['userProfileId','lodash','util','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0xda3b,0x18d));var _0xbda3=function(_0x9a25f5,_0x27e259){_0x9a25f5=_0x9a25f5-0x0;var _0x2b72c3=_0xda3b[_0x9a25f5];return _0x2b72c3;};'use strict';var _=require(_0xbda3('0x0'));var util=require(_0xbda3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbda3('0x2'));var fs=require('fs');var path=require(_0xbda3('0x3'));var rimraf=require(_0xbda3('0x4'));var config=require('../../config/environment');var attributes=require(_0xbda3('0x5'));module[_0xbda3('0x6')]=function(_0x16261a,_0x4e71aa){return _0x16261a[_0xbda3('0x7')]('UserProfileSection',attributes,{'tableName':_0xbda3('0x8'),'paranoid':![],'indexes':[{'name':_0xbda3('0x9'),'fields':['sectionId',_0xbda3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cb67f65..09b339c 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 _0xfc98=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x316b36,_0x157b33){var _0x245f4d=function(_0x438fab){while(--_0x438fab){_0x316b36['push'](_0x316b36['shift']());}};_0x245f4d(++_0x157b33);}(_0xfc98,0x154));var _0x8fc9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xfc98[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8fc9('0x0'));var util=require('util');var moment=require(_0x8fc9('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fc9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fc9('0x3'))['db'];var utils=require(_0x8fc9('0x4'));var logger=require(_0x8fc9('0x5'))(_0x8fc9('0x6'));var config=require('../../config/environment');var jayson=require(_0x8fc9('0x7'));var client=jayson[_0x8fc9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x300d07,_0x2b8b4a,_0x45658f){return new BPromise(function(_0x47de8c,_0xa2a202){return client[_0x8fc9('0x9')](_0x300d07,_0x45658f)[_0x8fc9('0xa')](function(_0x287549){logger[_0x8fc9('0xb')](_0x8fc9('0xc'),_0x2b8b4a,_0x8fc9('0xd'));logger['debug'](_0x8fc9('0xe'),_0x2b8b4a,'request\x20sent',JSON[_0x8fc9('0xf')](_0x287549));if(_0x287549['error']){if(_0x287549[_0x8fc9('0x10')]['code']===0x1f4){logger[_0x8fc9('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x2b8b4a,_0x287549[_0x8fc9('0x10')][_0x8fc9('0x11')]);return _0xa2a202(_0x287549[_0x8fc9('0x10')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2b8b4a,_0x287549['error'][_0x8fc9('0x11')]);return _0x47de8c(_0x287549['error'][_0x8fc9('0x11')]);}else{logger[_0x8fc9('0xb')](_0x8fc9('0xc'),_0x2b8b4a,'request\x20sent');_0x47de8c(_0x287549[_0x8fc9('0x12')][_0x8fc9('0x11')]);}})['catch'](function(_0x2ed94d){logger[_0x8fc9('0x10')](_0x8fc9('0xc'),_0x2b8b4a,_0x2ed94d);_0xa2a202(_0x2ed94d);});});} \ No newline at end of file +var _0xfa78=['UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x4a85a2,_0x44c241){var _0x498251=function(_0x3a89cf){while(--_0x3a89cf){_0x4a85a2['push'](_0x4a85a2['shift']());}};_0x498251(++_0x44c241);}(_0xfa78,0x1e2));var _0x8fa7=function(_0x21d2cc,_0x4916fb){_0x21d2cc=_0x21d2cc-0x0;var _0x38fb66=_0xfa78[_0x21d2cc];return _0x38fb66;};'use strict';var _=require('lodash');var util=require(_0x8fa7('0x0'));var moment=require(_0x8fa7('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fa7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fa7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fa7('0x4'))(_0x8fa7('0x5'));var config=require(_0x8fa7('0x6'));var jayson=require(_0x8fa7('0x7'));var client=jayson[_0x8fa7('0x8')][_0x8fa7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b9da1,_0x43c250,_0x4e579b){return new BPromise(function(_0x42602a,_0x1fbf84){return client['request'](_0x2b9da1,_0x4e579b)[_0x8fa7('0xa')](function(_0x5e498a){logger[_0x8fa7('0xb')](_0x8fa7('0xc'),_0x43c250,'request\x20sent');logger['debug'](_0x8fa7('0xd'),_0x43c250,_0x8fa7('0xe'),JSON[_0x8fa7('0xf')](_0x5e498a));if(_0x5e498a[_0x8fa7('0x10')]){if(_0x5e498a['error']['code']===0x1f4){logger[_0x8fa7('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x43c250,_0x5e498a[_0x8fa7('0x10')][_0x8fa7('0x11')]);return _0x1fbf84(_0x5e498a[_0x8fa7('0x10')][_0x8fa7('0x11')]);}logger['error'](_0x8fa7('0xc'),_0x43c250,_0x5e498a[_0x8fa7('0x10')][_0x8fa7('0x11')]);return _0x42602a(_0x5e498a['error']['message']);}else{logger[_0x8fa7('0xb')](_0x8fa7('0xc'),_0x43c250,'request\x20sent');_0x42602a(_0x5e498a['result'][_0x8fa7('0x11')]);}})[_0x8fa7('0x12')](function(_0x2bb6c4){logger['error'](_0x8fa7('0xc'),_0x43c250,_0x2bb6c4);_0x1fbf84(_0x2bb6c4);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 7537bae..02317d5 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(_0x4d217,_0x5ba0fc){var _0x323f17=function(_0x5ba07e){while(--_0x5ba07e){_0x4d217['push'](_0x4d217['shift']());}};_0x323f17(++_0x5ba0fc);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b756f,_0x253774){var _0x3ed29a=function(_0xc14f63){while(--_0xc14f63){_0x4b756f['push'](_0x4b756f['shift']());}};_0x3ed29a(++_0x253774);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e44893e..0953ed6 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 _0x4790=['INTEGER'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x4790,0x105));var _0x0479=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x4790[_0x55e839];return _0x39c61a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x0479('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x94df=['exports','INTEGER','sequelize'];(function(_0x395c24,_0x48d2cb){var _0x1d708b=function(_0x517a7b){while(--_0x517a7b){_0x395c24['push'](_0x395c24['shift']());}};_0x1d708b(++_0x48d2cb);}(_0x94df,0xe3));var _0xf94d=function(_0x178e62,_0x3cb98a){_0x178e62=_0x178e62-0x0;var _0xd666e=_0x94df[_0x178e62];return _0xd666e;};'use strict';var Sequelize=require(_0xf94d('0x0'));module[_0xf94d('0x1')]={'penalty':{'type':Sequelize[_0xf94d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 2797e17..e6b481e 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 _0x524e=['define','UserSmsQueue','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x5e6c6b,_0x394668){var _0x14a242=function(_0x5dc425){while(--_0x5dc425){_0x5e6c6b['push'](_0x5e6c6b['shift']());}};_0x14a242(++_0x394668);}(_0x524e,0x15e));var _0xe524=function(_0x140e67,_0x1c5b64){_0x140e67=_0x140e67-0x0;var _0x5e3feb=_0x524e[_0x140e67];return _0x5e3feb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues','lodash'];(function(_0x4ae055,_0x4f718c){var _0x230a65=function(_0x391d81){while(--_0x391d81){_0x4ae055['push'](_0x4ae055['shift']());}};_0x230a65(++_0x4f718c);}(_0x5496,0x175));var _0x6549=function(_0x379599,_0x29f27e){_0x379599=_0x379599-0x0;var _0x2f79b2=_0x5496[_0x379599];return _0x2f79b2;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('UserSmsQueue',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 760cb0d..fd72379 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 _0x7d98=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x15c261,_0x2b170a){var _0x3b059b=function(_0x494edf){while(--_0x494edf){_0x15c261['push'](_0x15c261['shift']());}};_0x3b059b(++_0x2b170a);}(_0x7d98,0x167));var _0x87d9=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x7d98[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x87d9('0x0'));var util=require(_0x87d9('0x1'));var moment=require(_0x87d9('0x2'));var BPromise=require(_0x87d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87d9('0x5'))(_0x87d9('0x6'));var config=require(_0x87d9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x87d9('0x8')][_0x87d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x426c0c,_0x247eb7,_0x5b565a){return new BPromise(function(_0x33c506,_0xcd73d8){return client[_0x87d9('0xa')](_0x426c0c,_0x5b565a)[_0x87d9('0xb')](function(_0x51d9df){logger[_0x87d9('0xc')](_0x87d9('0xd'),_0x247eb7,_0x87d9('0xe'));logger[_0x87d9('0xf')](_0x87d9('0x10'),_0x247eb7,_0x87d9('0xe'),JSON[_0x87d9('0x11')](_0x51d9df));if(_0x51d9df[_0x87d9('0x12')]){if(_0x51d9df[_0x87d9('0x12')]['code']===0x1f4){logger[_0x87d9('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x247eb7,_0x51d9df[_0x87d9('0x12')]['message']);return _0xcd73d8(_0x51d9df['error'][_0x87d9('0x13')]);}logger[_0x87d9('0x12')](_0x87d9('0xd'),_0x247eb7,_0x51d9df[_0x87d9('0x12')]['message']);return _0x33c506(_0x51d9df[_0x87d9('0x12')][_0x87d9('0x13')]);}else{logger[_0x87d9('0xc')](_0x87d9('0xd'),_0x247eb7,_0x87d9('0xe'));_0x33c506(_0x51d9df[_0x87d9('0x14')]['message']);}})[_0x87d9('0x15')](function(_0x4b655c){logger[_0x87d9('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x247eb7,_0x4b655c);_0xcd73d8(_0x4b655c);});});} \ No newline at end of file +var _0xe114=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment'];(function(_0x525cdb,_0x5402a2){var _0x5e99cf=function(_0x4ce13d){while(--_0x4ce13d){_0x525cdb['push'](_0x525cdb['shift']());}};_0x5e99cf(++_0x5402a2);}(_0xe114,0x141));var _0x4e11=function(_0x68e606,_0x22570e){_0x68e606=_0x68e606-0x0;var _0x12b58d=_0xe114[_0x68e606];return _0x12b58d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e11('0x0'));var BPromise=require(_0x4e11('0x1'));var rs=require(_0x4e11('0x2'));var fs=require('fs');var Redis=require(_0x4e11('0x3'));var db=require(_0x4e11('0x4'))['db'];var utils=require(_0x4e11('0x5'));var logger=require(_0x4e11('0x6'))(_0x4e11('0x7'));var config=require(_0x4e11('0x8'));var jayson=require(_0x4e11('0x9'));var client=jayson['client'][_0x4e11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22f369,_0xc2ac9c,_0x241501){return new BPromise(function(_0x3f14da,_0x1cdbb1){return client[_0x4e11('0xb')](_0x22f369,_0x241501)[_0x4e11('0xc')](function(_0x25c4bc){logger[_0x4e11('0xd')](_0x4e11('0xe'),_0xc2ac9c,_0x4e11('0xf'));logger[_0x4e11('0x10')](_0x4e11('0x11'),_0xc2ac9c,_0x4e11('0xf'),JSON[_0x4e11('0x12')](_0x25c4bc));if(_0x25c4bc[_0x4e11('0x13')]){if(_0x25c4bc[_0x4e11('0x13')][_0x4e11('0x14')]===0x1f4){logger[_0x4e11('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0xc2ac9c,_0x25c4bc[_0x4e11('0x13')][_0x4e11('0x15')]);return _0x1cdbb1(_0x25c4bc['error'][_0x4e11('0x15')]);}logger['error'](_0x4e11('0xe'),_0xc2ac9c,_0x25c4bc[_0x4e11('0x13')][_0x4e11('0x15')]);return _0x3f14da(_0x25c4bc[_0x4e11('0x13')][_0x4e11('0x15')]);}else{logger[_0x4e11('0xd')](_0x4e11('0xe'),_0xc2ac9c,_0x4e11('0xf'));_0x3f14da(_0x25c4bc[_0x4e11('0x16')][_0x4e11('0x15')]);}})['catch'](function(_0x8e3b5c){logger[_0x4e11('0x13')](_0x4e11('0xe'),_0xc2ac9c,_0x8e3b5c);_0x1cdbb1(_0x8e3b5c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ed9a06a..6004dbf 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 _0x27e4=['sequelize','exports'];(function(_0x24e3cf,_0x3f5c23){var _0x52dde0=function(_0x5be91a){while(--_0x5be91a){_0x24e3cf['push'](_0x24e3cf['shift']());}};_0x52dde0(++_0x3f5c23);}(_0x27e4,0x112));var _0x427e=function(_0x304f00,_0x7deb5a){_0x304f00=_0x304f00-0x0;var _0x3de226=_0x27e4[_0x304f00];return _0x3de226;};'use strict';var Sequelize=require(_0x427e('0x0'));module[_0x427e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9ed1=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ed1,0x18d));var _0x19ed=function(_0x3d91ca,_0xe4f45b){_0x3d91ca=_0x3d91ca-0x0;var _0xc4b68c=_0x9ed1[_0x3d91ca];return _0xc4b68c;};'use strict';var Sequelize=require(_0x19ed('0x0'));module[_0x19ed('0x1')]={'UserId':{'type':Sequelize[_0x19ed('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x19ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index b07d189..ae69f3b 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(_0x4d26a2,_0x2c8147){var _0x393900=function(_0x569be5){while(--_0x569be5){_0x4d26a2['push'](_0x4d26a2['shift']());}};_0x393900(++_0x2c8147);}(_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':'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(_0x146f2c,_0x752c62){var _0x4b81e9=function(_0x2a948c){while(--_0x2a948c){_0x146f2c['push'](_0x146f2c['shift']());}};_0x4b81e9(++_0x752c62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 80f6dd6..a1bf6d2 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x13b5b7,_0x56f34b){var _0x979f53=function(_0x56c39a){while(--_0x56c39a){_0x13b5b7['push'](_0x13b5b7['shift']());}};_0x979f53(++_0x56f34b);}(_0xe706,0xa3));var _0x6e70=function(_0x239b5e,_0x208a3f){_0x239b5e=_0x239b5e-0x0;var _0x577f3d=_0xe706[_0x239b5e];return _0x577f3d;};'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(_0x57a8e8,_0x559564){var _0x2a365b=function(_0x3f29d6){while(--_0x3f29d6){_0x57a8e8['push'](_0x57a8e8['shift']());}};_0x2a365b(++_0x559564);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d930c9e..bfb86c8 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 _0x34b4=['exports','INTEGER','sequelize'];(function(_0x47c492,_0x311a27){var _0x32105d=function(_0x5b0289){while(--_0x5b0289){_0x47c492['push'](_0x47c492['shift']());}};_0x32105d(++_0x311a27);}(_0x34b4,0x155));var _0x434b=function(_0x1dbf86,_0x5be767){_0x1dbf86=_0x1dbf86-0x0;var _0x2c035a=_0x34b4[_0x1dbf86];return _0x2c035a;};'use strict';var Sequelize=require(_0x434b('0x0'));module[_0x434b('0x1')]={'penalty':{'type':Sequelize[_0x434b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x28a2=['INTEGER','exports'];(function(_0x12c859,_0x1220ee){var _0x54e16a=function(_0x338a22){while(--_0x338a22){_0x12c859['push'](_0x12c859['shift']());}};_0x54e16a(++_0x1220ee);}(_0x28a2,0x6d));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x228a('0x0')]={'penalty':{'type':Sequelize[_0x228a('0x1')],'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 1b021f9..8874712 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 _0x781f=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x781f,0x13f));var _0xf781=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x781f[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0xf781('0x0'));var util=require(_0xf781('0x1'));var logger=require('../../config/logger')(_0xf781('0x2'));var moment=require('moment');var BPromise=require(_0xf781('0x3'));var rp=require(_0xf781('0x4'));var fs=require('fs');var path=require(_0xf781('0x5'));var rimraf=require(_0xf781('0x6'));var config=require(_0xf781('0x7'));var attributes=require(_0xf781('0x8'));module[_0xf781('0x9')]=function(_0x1e9c0e,_0x41c82b){return _0x1e9c0e[_0xf781('0xa')](_0xf781('0xb'),attributes,{'tableName':_0xf781('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc330=['api','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0x278062,_0x5a8ca4){var _0x5bc303=function(_0x12d07f){while(--_0x12d07f){_0x278062['push'](_0x278062['shift']());}};_0x5bc303(++_0x5a8ca4);}(_0xc330,0xe2));var _0x0c33=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc330[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0x0c33('0x0'));var logger=require(_0x0c33('0x1'))(_0x0c33('0x2'));var moment=require('moment');var BPromise=require(_0x0c33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c33('0x4'));var rimraf=require(_0x0c33('0x5'));var config=require(_0x0c33('0x6'));var attributes=require(_0x0c33('0x7'));module[_0x0c33('0x8')]=function(_0x10419a,_0x54345a){return _0x10419a[_0x0c33('0x9')](_0x0c33('0xa'),attributes,{'tableName':_0x0c33('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 5acc51f..2038cc3 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 _0xab6e=['debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xab6e,0x93));var _0xeab6=function(_0x7c1a77,_0x1cefe3){_0x7c1a77=_0x7c1a77-0x0;var _0x3496d7=_0xab6e[_0x7c1a77];return _0x3496d7;};'use strict';var _=require(_0xeab6('0x0'));var util=require(_0xeab6('0x1'));var moment=require(_0xeab6('0x2'));var BPromise=require('bluebird');var rs=require(_0xeab6('0x3'));var fs=require('fs');var Redis=require(_0xeab6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeab6('0x5'));var config=require(_0xeab6('0x6'));var jayson=require(_0xeab6('0x7'));var client=jayson[_0xeab6('0x8')][_0xeab6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x383f39,_0x280d00,_0x39b948){return new BPromise(function(_0x42c3d9,_0x3f3eb2){return client[_0xeab6('0xa')](_0x383f39,_0x39b948)[_0xeab6('0xb')](function(_0x5063e6){logger['info'](_0xeab6('0xc'),_0x280d00,'request\x20sent');logger[_0xeab6('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x280d00,'request\x20sent',JSON[_0xeab6('0xe')](_0x5063e6));if(_0x5063e6[_0xeab6('0xf')]){if(_0x5063e6[_0xeab6('0xf')][_0xeab6('0x10')]===0x1f4){logger[_0xeab6('0xf')](_0xeab6('0xc'),_0x280d00,_0x5063e6[_0xeab6('0xf')][_0xeab6('0x11')]);return _0x3f3eb2(_0x5063e6['error'][_0xeab6('0x11')]);}logger[_0xeab6('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x280d00,_0x5063e6[_0xeab6('0xf')][_0xeab6('0x11')]);return _0x42c3d9(_0x5063e6[_0xeab6('0xf')][_0xeab6('0x11')]);}else{logger['info'](_0xeab6('0xc'),_0x280d00,_0xeab6('0x12'));_0x42c3d9(_0x5063e6[_0xeab6('0x13')][_0xeab6('0x11')]);}})['catch'](function(_0x1fe331){logger[_0xeab6('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x280d00,_0x1fe331);_0x3f3eb2(_0x1fe331);});});} \ No newline at end of file +var _0xcf7a=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x25ac44,_0x4bca2b){var _0x36ba24=function(_0x2a18c8){while(--_0x2a18c8){_0x25ac44['push'](_0x25ac44['shift']());}};_0x36ba24(++_0x4bca2b);}(_0xcf7a,0x9f));var _0xacf7=function(_0x1ee6ff,_0x2bd521){_0x1ee6ff=_0x1ee6ff-0x0;var _0x4f83a7=_0xcf7a[_0x1ee6ff];return _0x4f83a7;};'use strict';var _=require(_0xacf7('0x0'));var util=require(_0xacf7('0x1'));var moment=require(_0xacf7('0x2'));var BPromise=require(_0xacf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacf7('0x4'));var db=require(_0xacf7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacf7('0x6'))(_0xacf7('0x7'));var config=require(_0xacf7('0x8'));var jayson=require(_0xacf7('0x9'));var client=jayson['client'][_0xacf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdd48fa,_0x191789,_0x523915){return new BPromise(function(_0x7567da,_0x3641da){return client[_0xacf7('0xb')](_0xdd48fa,_0x523915)[_0xacf7('0xc')](function(_0x40aff3){logger[_0xacf7('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x191789,'request\x20sent');logger['debug'](_0xacf7('0xe'),_0x191789,_0xacf7('0xf'),JSON[_0xacf7('0x10')](_0x40aff3));if(_0x40aff3['error']){if(_0x40aff3[_0xacf7('0x11')][_0xacf7('0x12')]===0x1f4){logger[_0xacf7('0x11')](_0xacf7('0x13'),_0x191789,_0x40aff3[_0xacf7('0x11')]['message']);return _0x3641da(_0x40aff3['error'][_0xacf7('0x14')]);}logger[_0xacf7('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x191789,_0x40aff3[_0xacf7('0x11')][_0xacf7('0x14')]);return _0x7567da(_0x40aff3[_0xacf7('0x11')]['message']);}else{logger[_0xacf7('0xd')](_0xacf7('0x13'),_0x191789,_0xacf7('0xf'));_0x7567da(_0x40aff3[_0xacf7('0x15')][_0xacf7('0x14')]);}})[_0xacf7('0x16')](function(_0x32ab16){logger[_0xacf7('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x191789,_0x32ab16);_0x3641da(_0x32ab16);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index f66a7fe..59a41c6 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3e28cd,_0x19506c){var _0x5d30c1=function(_0x18c8d1){while(--_0x18c8d1){_0x3e28cd['push'](_0x3e28cd['shift']());}};_0x5d30c1(++_0x19506c);}(_0xedd9,0xfc));var _0x9edd=function(_0x93d7e0,_0x3ecdf4){_0x93d7e0=_0x93d7e0-0x0;var _0x1e93e8=_0xedd9[_0x93d7e0];return _0x1e93e8;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2c0931,_0x503573){var _0x3d781f=function(_0x3f84ac){while(--_0x3f84ac){_0x2c0931['push'](_0x2c0931['shift']());}};_0x3d781f(++_0x503573);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 82a34a9..7528996 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 _0xf64f=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3f7dc3,_0x1cacbc){var _0xf50a6c=function(_0x3f04c0){while(--_0x3f04c0){_0x3f7dc3['push'](_0x3f7dc3['shift']());}};_0xf50a6c(++_0x1cacbc);}(_0xf64f,0xb4));var _0xff64=function(_0x18425d,_0x37470d){_0x18425d=_0x18425d-0x0;var _0x32611e=_0xf64f[_0x18425d];return _0x32611e;};'use strict';var Sequelize=require(_0xff64('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xff64('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xff64('0x2')},'membername':{'type':Sequelize[_0xff64('0x3')],'allowNull':![],'comment':_0xff64('0x2')},'UserId':{'type':Sequelize[_0xff64('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xff64('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xff64('0x2')},'VoiceQueueId':{'type':Sequelize[_0xff64('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xff64('0x3')],'allowNull':![],'unique':_0xff64('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xff64('0x1')](0xb),'defaultValue':0x0,'comment':_0xff64('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xff64('0x2')}}; \ No newline at end of file +var _0x83b3=['INTEGER','STRING','Required\x20by\x20Asterisk','sequelize','exports'];(function(_0x3b93e6,_0x4aadef){var _0x4a9afb=function(_0x3358bc){while(--_0x3358bc){_0x3b93e6['push'](_0x3b93e6['shift']());}};_0x4a9afb(++_0x4aadef);}(_0x83b3,0x13e));var _0x383b=function(_0x1b310b,_0x338af6){_0x1b310b=_0x1b310b-0x0;var _0x1703bd=_0x83b3[_0x1b310b];return _0x1703bd;};'use strict';var Sequelize=require(_0x383b('0x0'));module[_0x383b('0x1')]={'uniqueid':{'type':Sequelize[_0x383b('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x383b('0x3')],'allowNull':![],'comment':_0x383b('0x4')},'UserId':{'type':Sequelize[_0x383b('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x383b('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x383b('0x4')},'VoiceQueueId':{'type':Sequelize[_0x383b('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x383b('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x383b('0x4')},'penalty':{'type':Sequelize[_0x383b('0x2')](0xb),'defaultValue':0x0,'comment':_0x383b('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x383b('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8d63d24..e79c711 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 _0x1092=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x12335b,_0x48f4b7){var _0x38b3da=function(_0x53d015){while(--_0x53d015){_0x12335b['push'](_0x12335b['shift']());}};_0x38b3da(++_0x48f4b7);}(_0x1092,0x1dd));var _0x2109=function(_0x5a5879,_0x4f7573){_0x5a5879=_0x5a5879-0x0;var _0xa5737b=_0x1092[_0x5a5879];return _0xa5737b;};'use strict';var EventEmitter=require(_0x2109('0x0'));var UserVoiceQueueRt=require(_0x2109('0x1'))['db'][_0x2109('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2109('0x3')](0x0);var events={'afterCreate':_0x2109('0x4'),'afterUpdate':_0x2109('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5ee56f){return function(_0x103efb,_0x183497,_0x56edca){UserVoiceQueueRtEvents[_0x2109('0x6')](_0x5ee56f+':'+_0x103efb['id'],_0x103efb);UserVoiceQueueRtEvents[_0x2109('0x6')](_0x5ee56f,_0x103efb);_0x56edca(null);};}for(var e in events){if(events[_0x2109('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x2109('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xe125=['exports','events','../../mysqldb','emit','hasOwnProperty','hook'];(function(_0x454893,_0x7560b7){var _0x5eaa56=function(_0x5bbbca){while(--_0x5bbbca){_0x454893['push'](_0x454893['shift']());}};_0x5eaa56(++_0x7560b7);}(_0xe125,0x15d));var _0x5e12=function(_0x43f148,_0x4c7123){_0x43f148=_0x43f148-0x0;var _0x11a9f3=_0xe125[_0x43f148];return _0x11a9f3;};'use strict';var EventEmitter=require(_0x5e12('0x0'));var UserVoiceQueueRt=require(_0x5e12('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56bb13){return function(_0x2fb3aa,_0x4091d1,_0x20c19a){UserVoiceQueueRtEvents[_0x5e12('0x2')](_0x56bb13+':'+_0x2fb3aa['id'],_0x2fb3aa);UserVoiceQueueRtEvents[_0x5e12('0x2')](_0x56bb13,_0x2fb3aa);_0x20c19a(null);};}for(var e in events){if(events[_0x5e12('0x3')](e)){var event=events[e];UserVoiceQueueRt[_0x5e12('0x4')](e,emitEvent(event));}}module[_0x5e12('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index fac7712..6165489 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 _0x1247=['util','../../config/logger','moment','bluebird','request-promise','path','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x117e5f,_0x255476){var _0x1ee0da=function(_0x3f4712){while(--_0x3f4712){_0x117e5f['push'](_0x117e5f['shift']());}};_0x1ee0da(++_0x255476);}(_0x1247,0x83));var _0x7124=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x1247[_0x11e03f];return _0x5666fe;};'use strict';var _=require(_0x7124('0x0'));var util=require(_0x7124('0x1'));var logger=require(_0x7124('0x2'))('api');var moment=require(_0x7124('0x3'));var BPromise=require(_0x7124('0x4'));var rp=require(_0x7124('0x5'));var fs=require('fs');var path=require(_0x7124('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x7124('0x7')]=function(_0x2bd86c,_0x39dea2){return _0x2bd86c[_0x7124('0x8')](_0x7124('0x9'),attributes,{'tableName':_0x7124('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3d4=['exports','UserVoiceQueueRt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x576272,_0x57a184){var _0x4ed9fc=function(_0x13d210){while(--_0x13d210){_0x576272['push'](_0x576272['shift']());}};_0x4ed9fc(++_0x57a184);}(_0xb3d4,0x1a6));var _0x4b3d=function(_0x20399b,_0x43c8ee){_0x20399b=_0x20399b-0x0;var _0x35eb6d=_0xb3d4[_0x20399b];return _0x35eb6d;};'use strict';var _=require(_0x4b3d('0x0'));var util=require(_0x4b3d('0x1'));var logger=require(_0x4b3d('0x2'))(_0x4b3d('0x3'));var moment=require('moment');var BPromise=require(_0x4b3d('0x4'));var rp=require(_0x4b3d('0x5'));var fs=require('fs');var path=require(_0x4b3d('0x6'));var rimraf=require(_0x4b3d('0x7'));var config=require(_0x4b3d('0x8'));var attributes=require(_0x4b3d('0x9'));module[_0x4b3d('0xa')]=function(_0x3f88a2,_0xbf7d1d){return _0x3f88a2['define'](_0x4b3d('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','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 e48d4a3..72191f5 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 _0xa53d=['request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register'];(function(_0x248214,_0x2feee4){var _0x4a8a3f=function(_0x11277f){while(--_0x11277f){_0x248214['push'](_0x248214['shift']());}};_0x4a8a3f(++_0x2feee4);}(_0xa53d,0xba));var _0xda53=function(_0x536b45,_0x327b62){_0x536b45=_0x536b45-0x0;var _0x379275=_0xa53d[_0x536b45];return _0x379275;};'use strict';var _=require(_0xda53('0x0'));var util=require(_0xda53('0x1'));var moment=require(_0xda53('0x2'));var BPromise=require(_0xda53('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda53('0x4'));var db=require(_0xda53('0x5'))['db'];var utils=require(_0xda53('0x6'));var logger=require(_0xda53('0x7'))(_0xda53('0x8'));var config=require(_0xda53('0x9'));var jayson=require(_0xda53('0xa'));var client=jayson[_0xda53('0xb')][_0xda53('0xc')]({'port':0x232a});config[_0xda53('0xd')]=_[_0xda53('0xe')](config[_0xda53('0xd')],{'host':_0xda53('0xf'),'port':0x18eb});var socket=require(_0xda53('0x10'))(new Redis(config['redis']));require(_0xda53('0x11'))[_0xda53('0x12')](socket);function respondWithRpcPromise(_0x155be0,_0x44b4c2,_0x36d524){return new BPromise(function(_0x1463f3,_0x7eb273){return client[_0xda53('0x13')](_0x155be0,_0x36d524)[_0xda53('0x14')](function(_0x332540){logger[_0xda53('0x15')](_0xda53('0x16'),_0x44b4c2,_0xda53('0x17'));logger['debug'](_0xda53('0x18'),_0x44b4c2,_0xda53('0x17'),JSON[_0xda53('0x19')](_0x332540));if(_0x332540[_0xda53('0x1a')]){if(_0x332540[_0xda53('0x1a')][_0xda53('0x1b')]===0x1f4){logger[_0xda53('0x1a')](_0xda53('0x16'),_0x44b4c2,_0x332540[_0xda53('0x1a')][_0xda53('0x1c')]);return _0x7eb273(_0x332540[_0xda53('0x1a')][_0xda53('0x1c')]);}logger[_0xda53('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x44b4c2,_0x332540[_0xda53('0x1a')]['message']);return _0x1463f3(_0x332540[_0xda53('0x1a')][_0xda53('0x1c')]);}else{logger[_0xda53('0x15')](_0xda53('0x16'),_0x44b4c2,'request\x20sent');_0x1463f3(_0x332540[_0xda53('0x1d')]['message']);}})[_0xda53('0x1e')](function(_0x20951f){logger['error'](_0xda53('0x16'),_0x44b4c2,_0x20951f);_0x7eb273(_0x20951f);});});}exports[_0xda53('0x1f')]=function(_0x21d3a9){var _0x5e773c=this;return new Promise(function(_0x51c61c,_0x53966e){return db[_0xda53('0x20')][_0xda53('0x21')]({'raw':_0x21d3a9[_0xda53('0x22')]?_0x21d3a9[_0xda53('0x22')][_0xda53('0x23')]===undefined?!![]:![]:!![],'where':_0x21d3a9[_0xda53('0x22')]?_0x21d3a9[_0xda53('0x22')]['where']||null:null,'attributes':[[db[_0xda53('0x24')]['fn'](_0xda53('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0xda53('0x26')](_0xda53('0x27')))),'outboundQueuePauses']]})['then'](function(_0x194879){logger[_0xda53('0x15')](_0xda53('0x1f'),_0x21d3a9);logger[_0xda53('0x28')]('GetVoiceQueueRtPauses',_0x21d3a9,JSON[_0xda53('0x19')](_0x194879));_0x51c61c(_0x194879);})[_0xda53('0x1e')](function(_0x3ffff5){logger['error'](_0xda53('0x1f'),_0x3ffff5[_0xda53('0x1c')],_0x21d3a9);_0x53966e(_0x5e773c[_0xda53('0x1a')](0x1f4,_0x3ffff5[_0xda53('0x1c')]));});});}; \ No newline at end of file +var _0x648f=['catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','GetVoiceQueueRtPauses','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result'];(function(_0x122d95,_0x15e1a9){var _0x55ddd8=function(_0x2ed874){while(--_0x2ed874){_0x122d95['push'](_0x122d95['shift']());}};_0x55ddd8(++_0x15e1a9);}(_0x648f,0x101));var _0xf648=function(_0x2b18e5,_0x1a141c){_0x2b18e5=_0x2b18e5-0x0;var _0x12e52c=_0x648f[_0x2b18e5];return _0x12e52c;};'use strict';var _=require(_0xf648('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf648('0x1'));var fs=require('fs');var Redis=require(_0xf648('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf648('0x3'));var logger=require(_0xf648('0x4'))(_0xf648('0x5'));var config=require(_0xf648('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf648('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf648('0x8')],{'host':_0xf648('0x9'),'port':0x18eb});var socket=require(_0xf648('0xa'))(new Redis(config[_0xf648('0x8')]));require(_0xf648('0xb'))[_0xf648('0xc')](socket);function respondWithRpcPromise(_0x284f05,_0x3d416c,_0x566457){return new BPromise(function(_0x2177bd,_0x985871){return client[_0xf648('0xd')](_0x284f05,_0x566457)[_0xf648('0xe')](function(_0x35d976){logger[_0xf648('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3d416c,_0xf648('0x10'));logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3d416c,_0xf648('0x10'),JSON[_0xf648('0x11')](_0x35d976));if(_0x35d976[_0xf648('0x12')]){if(_0x35d976[_0xf648('0x12')][_0xf648('0x13')]===0x1f4){logger[_0xf648('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3d416c,_0x35d976['error'][_0xf648('0x14')]);return _0x985871(_0x35d976['error'][_0xf648('0x14')]);}logger['error'](_0xf648('0x15'),_0x3d416c,_0x35d976[_0xf648('0x12')][_0xf648('0x14')]);return _0x2177bd(_0x35d976[_0xf648('0x12')][_0xf648('0x14')]);}else{logger[_0xf648('0xf')](_0xf648('0x15'),_0x3d416c,_0xf648('0x10'));_0x2177bd(_0x35d976[_0xf648('0x16')][_0xf648('0x14')]);}})[_0xf648('0x17')](function(_0x2b6d0f){logger[_0xf648('0x12')](_0xf648('0x15'),_0x3d416c,_0x2b6d0f);_0x985871(_0x2b6d0f);});});}exports['GetVoiceQueueRtPauses']=function(_0x44392f){var _0x25827a=this;return new Promise(function(_0x5be935,_0x332bad){return db[_0xf648('0x18')]['findAll']({'raw':_0x44392f[_0xf648('0x19')]?_0x44392f[_0xf648('0x19')][_0xf648('0x1a')]===undefined?!![]:![]:!![],'where':_0x44392f[_0xf648('0x19')]?_0x44392f['options'][_0xf648('0x1b')]||null:null,'attributes':[[db[_0xf648('0x1c')]['fn'](_0xf648('0x1d'),db[_0xf648('0x1c')]['fn']('IF',db[_0xf648('0x1c')][_0xf648('0x1e')](_0xf648('0x1f')))),_0xf648('0x20')]]})['then'](function(_0x27c478){logger[_0xf648('0xf')]('GetVoiceQueueRtPauses',_0x44392f);logger[_0xf648('0x21')](_0xf648('0x22'),_0x44392f,JSON[_0xf648('0x11')](_0x27c478));_0x5be935(_0x27c478);})[_0xf648('0x17')](function(_0x41743d){logger[_0xf648('0x12')](_0xf648('0x22'),_0x41743d['message'],_0x44392f);_0x332bad(_0x25827a['error'](0x1f4,_0x41743d[_0xf648('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1a41bff..0f4f88c 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 _0x00f0=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x00f0,0xec));var _0x000f=function(_0x5a52f2,_0x3a244d){_0x5a52f2=_0x5a52f2-0x0;var _0xc62c98=_0x00f0[_0x5a52f2];return _0xc62c98;};'use strict';var UserVoiceQueueRtEvents=require(_0x000f('0x0'));var events=[_0x000f('0x1'),_0x000f('0x2'),_0x000f('0x3')];function createListener(_0x55b9cf,_0x4d5c3d){return function(_0x4095d5){_0x4d5c3d['emit'](_0x55b9cf,_0x4095d5);};}function removeListener(_0x3cd8ed,_0x53989d){return function(){UserVoiceQueueRtEvents[_0x000f('0x4')](_0x3cd8ed,_0x53989d);};}exports[_0x000f('0x5')]=function(_0x4ce2d9){for(var _0x7827b=0x0,_0x3c54d0=events[_0x000f('0x6')];_0x7827b<_0x3c54d0;_0x7827b++){var _0x621ab6=events[_0x7827b];var _0x330e11=createListener(_0x000f('0x7')+_0x621ab6,_0x4ce2d9);UserVoiceQueueRtEvents['on'](_0x621ab6,_0x330e11);}}; \ No newline at end of file +var _0x9a22=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x3c7974,_0x1cf7ba){var _0x411bf3=function(_0x2c0bd5){while(--_0x2c0bd5){_0x3c7974['push'](_0x3c7974['shift']());}};_0x411bf3(++_0x1cf7ba);}(_0x9a22,0x75));var _0x29a2=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x9a22[_0x2576d7];return _0x16a08c;};'use strict';var UserVoiceQueueRtEvents=require(_0x29a2('0x0'));var events=[_0x29a2('0x1'),_0x29a2('0x2'),_0x29a2('0x3')];function createListener(_0x2f7a2d,_0xc7dd1f){return function(_0x195e9e){_0xc7dd1f['emit'](_0x2f7a2d,_0x195e9e);};}function removeListener(_0x4e617e,_0x427d51){return function(){UserVoiceQueueRtEvents[_0x29a2('0x4')](_0x4e617e,_0x427d51);};}exports[_0x29a2('0x5')]=function(_0x2ea411){for(var _0x261835=0x0,_0xfb91e8=events[_0x29a2('0x6')];_0x261835<_0xfb91e8;_0x261835++){var _0x2887e1=events[_0x261835];var _0x4b55de=createListener(_0x29a2('0x7')+_0x2887e1,_0x2ea411);UserVoiceQueueRtEvents['on'](_0x2887e1,_0x4b55de);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index edc502e..f22cb37 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x20f0e6,_0x29b640){var _0x3d1b23=function(_0x1465ae){while(--_0x1465ae){_0x20f0e6['push'](_0x20f0e6['shift']());}};_0x3d1b23(++_0x29b640);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0xcb91[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4c76cd,_0x14f044){var _0x68b4e0=function(_0x259520){while(--_0x259520){_0x4c76cd['push'](_0x4c76cd['shift']());}};_0x68b4e0(++_0x14f044);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 51c4a0d..deb3ed0 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 _0x9384=['sequelize','exports','INTEGER'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x9384,0xc0));var _0x4938=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9384[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x4938('0x0'));module[_0x4938('0x1')]={'penalty':{'type':Sequelize[_0x4938('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9c5=['INTEGER'];(function(_0x3091f9,_0x532951){var _0x523516=function(_0xe1e58b){while(--_0xe1e58b){_0x3091f9['push'](_0x3091f9['shift']());}};_0x523516(++_0x532951);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x288264,_0x3bbb6b){_0x288264=_0x288264-0x0;var _0x1a7cdd=_0xb9c5[_0x288264];return _0x1a7cdd;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x5b9c('0x0')],'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 1966fc2..f9e4fb1 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 _0xb336=['define','UserWhatsappQueue','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xb336,0x183));var _0x6b33=function(_0x43f468,_0x5a8191){_0x43f468=_0x43f468-0x0;var _0x2f9bdc=_0xb336[_0x43f468];return _0x2f9bdc;};'use strict';var _=require(_0x6b33('0x0'));var util=require('util');var logger=require(_0x6b33('0x1'))(_0x6b33('0x2'));var moment=require(_0x6b33('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b33('0x4'));var fs=require('fs');var path=require(_0x6b33('0x5'));var rimraf=require('rimraf');var config=require(_0x6b33('0x6'));var attributes=require(_0x6b33('0x7'));module[_0x6b33('0x8')]=function(_0x5de909,_0x356f23){return _0x5de909[_0x6b33('0x9')](_0x6b33('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc31b=['bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment'];(function(_0x754fd2,_0x27ac7d){var _0x1d7dbc=function(_0x122da9){while(--_0x122da9){_0x754fd2['push'](_0x754fd2['shift']());}};_0x1d7dbc(++_0x27ac7d);}(_0xc31b,0xd9));var _0xbc31=function(_0x334832,_0x5086b3){_0x334832=_0x334832-0x0;var _0x23b871=_0xc31b[_0x334832];return _0x23b871;};'use strict';var _=require(_0xbc31('0x0'));var util=require(_0xbc31('0x1'));var logger=require(_0xbc31('0x2'))('api');var moment=require(_0xbc31('0x3'));var BPromise=require(_0xbc31('0x4'));var rp=require(_0xbc31('0x5'));var fs=require('fs');var path=require(_0xbc31('0x6'));var rimraf=require('rimraf');var config=require(_0xbc31('0x7'));var attributes=require(_0xbc31('0x8'));module[_0xbc31('0x9')]=function(_0x5ecdeb,_0x5cf691){return _0x5ecdeb[_0xbc31('0xa')](_0xbc31('0xb'),attributes,{'tableName':_0xbc31('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 dfa65c5..8be64cf 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 _0x21a6=['rpc','jayson/promise','client','http','request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../config/utils'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0x21a6,0x150));var _0x621a=function(_0x555ebb,_0x4b1b68){_0x555ebb=_0x555ebb-0x0;var _0x3c0a4a=_0x21a6[_0x555ebb];return _0x3c0a4a;};'use strict';var _=require(_0x621a('0x0'));var util=require(_0x621a('0x1'));var moment=require('moment');var BPromise=require(_0x621a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x621a('0x3'));var logger=require('../../config/logger')(_0x621a('0x4'));var config=require('../../config/environment');var jayson=require(_0x621a('0x5'));var client=jayson[_0x621a('0x6')][_0x621a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d6014,_0x164b24,_0x1c26c2){return new BPromise(function(_0x547edd,_0x110b13){return client[_0x621a('0x8')](_0x3d6014,_0x1c26c2)[_0x621a('0x9')](function(_0x11c6b6){logger[_0x621a('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x164b24,'request\x20sent');logger[_0x621a('0xb')](_0x621a('0xc'),_0x164b24,_0x621a('0xd'),JSON[_0x621a('0xe')](_0x11c6b6));if(_0x11c6b6[_0x621a('0xf')]){if(_0x11c6b6[_0x621a('0xf')]['code']===0x1f4){logger[_0x621a('0xf')](_0x621a('0x10'),_0x164b24,_0x11c6b6[_0x621a('0xf')]['message']);return _0x110b13(_0x11c6b6[_0x621a('0xf')]['message']);}logger['error'](_0x621a('0x10'),_0x164b24,_0x11c6b6[_0x621a('0xf')]['message']);return _0x547edd(_0x11c6b6[_0x621a('0xf')][_0x621a('0x11')]);}else{logger['info'](_0x621a('0x10'),_0x164b24,_0x621a('0xd'));_0x547edd(_0x11c6b6[_0x621a('0x12')][_0x621a('0x11')]);}})[_0x621a('0x13')](function(_0x13aa84){logger[_0x621a('0xf')](_0x621a('0x10'),_0x164b24,_0x13aa84);_0x110b13(_0x13aa84);});});} \ No newline at end of file +var _0x5931=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','catch','lodash','bluebird'];(function(_0x1bc148,_0x23471c){var _0x38f977=function(_0x284967){while(--_0x284967){_0x1bc148['push'](_0x1bc148['shift']());}};_0x38f977(++_0x23471c);}(_0x5931,0x6c));var _0x1593=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x5931[_0x21cb7f];return _0x5a079a;};'use strict';var _=require(_0x1593('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1593('0x1'));var rs=require(_0x1593('0x2'));var fs=require('fs');var Redis=require(_0x1593('0x3'));var db=require(_0x1593('0x4'))['db'];var utils=require(_0x1593('0x5'));var logger=require(_0x1593('0x6'))(_0x1593('0x7'));var config=require(_0x1593('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1593('0x9')][_0x1593('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510afc,_0x33f344,_0x1d50d7){return new BPromise(function(_0x52ee33,_0x34b1cc){return client[_0x1593('0xb')](_0x510afc,_0x1d50d7)[_0x1593('0xc')](function(_0x20423b){logger[_0x1593('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x33f344,_0x1593('0xe'));logger['debug'](_0x1593('0xf'),_0x33f344,_0x1593('0xe'),JSON[_0x1593('0x10')](_0x20423b));if(_0x20423b[_0x1593('0x11')]){if(_0x20423b[_0x1593('0x11')][_0x1593('0x12')]===0x1f4){logger[_0x1593('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x33f344,_0x20423b[_0x1593('0x11')]['message']);return _0x34b1cc(_0x20423b[_0x1593('0x11')][_0x1593('0x13')]);}logger[_0x1593('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x33f344,_0x20423b[_0x1593('0x11')][_0x1593('0x13')]);return _0x52ee33(_0x20423b[_0x1593('0x11')]['message']);}else{logger['info'](_0x1593('0x14'),_0x33f344,_0x1593('0xe'));_0x52ee33(_0x20423b['result'][_0x1593('0x13')]);}})[_0x1593('0x15')](function(_0x29d754){logger[_0x1593('0x11')](_0x1593('0x14'),_0x33f344,_0x29d754);_0x34b1cc(_0x29d754);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ecef787..fab3493 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 _0x032a=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','put','/:id','update'];(function(_0x4fa17d,_0x496001){var _0x125d07=function(_0x1afb72){while(--_0x1afb72){_0x4fa17d['push'](_0x4fa17d['shift']());}};_0x125d07(++_0x496001);}(_0x032a,0xf0));var _0xa032=function(_0x3303fb,_0x1266dd){_0x3303fb=_0x3303fb-0x0;var _0x71a686=_0x032a[_0x3303fb];return _0x71a686;};'use strict';var multer=require('multer');var util=require(_0xa032('0x0'));var path=require('path');var timeout=require(_0xa032('0x1'));var express=require(_0xa032('0x2'));var router=express[_0xa032('0x3')]();var fs_extra=require(_0xa032('0x4'));var auth=require(_0xa032('0x5'));var interaction=require(_0xa032('0x6'));var config=require(_0xa032('0x7'));var controller=require(_0xa032('0x8'));router[_0xa032('0x9')]('/',auth[_0xa032('0xa')](),controller[_0xa032('0xb')]);router[_0xa032('0x9')]('/:id',auth[_0xa032('0xa')](),controller['show']);router['post']('/',auth[_0xa032('0xa')](),controller['create']);router[_0xa032('0xc')](_0xa032('0xd'),auth[_0xa032('0xa')](),controller[_0xa032('0xe')]);router[_0xa032('0xf')]('/:id',auth[_0xa032('0xa')](),controller[_0xa032('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3fc6=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x3fc6,0x159));var _0x63fc=function(_0x1c46c3,_0x27f511){_0x1c46c3=_0x1c46c3-0x0;var _0x4f0457=_0x3fc6[_0x1c46c3];return _0x4f0457;};'use strict';var multer=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var path=require(_0x63fc('0x2'));var timeout=require('connect-timeout');var express=require(_0x63fc('0x3'));var router=express[_0x63fc('0x4')]();var fs_extra=require(_0x63fc('0x5'));var auth=require(_0x63fc('0x6'));var interaction=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var controller=require('./variable.controller');router['get']('/',auth[_0x63fc('0x9')](),controller[_0x63fc('0xa')]);router[_0x63fc('0xb')]('/:id',auth[_0x63fc('0x9')](),controller[_0x63fc('0xc')]);router['post']('/',auth[_0x63fc('0x9')](),controller[_0x63fc('0xd')]);router[_0x63fc('0xe')](_0x63fc('0xf'),auth[_0x63fc('0x9')](),controller[_0x63fc('0x10')]);router[_0x63fc('0x11')](_0x63fc('0xf'),auth[_0x63fc('0x9')](),controller[_0x63fc('0x12')]);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 c6dad6c..27fd850 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 _0xde17=['STRING','name','sequelize','exports'];(function(_0x5ca10f,_0x239ec9){var _0x5ca553=function(_0x34bb87){while(--_0x34bb87){_0x5ca10f['push'](_0x5ca10f['shift']());}};_0x5ca553(++_0x239ec9);}(_0xde17,0x186));var _0x7de1=function(_0x5f1797,_0x38e985){_0x5f1797=_0x5f1797-0x0;var _0x202ec5=_0xde17[_0x5f1797];return _0x202ec5;};'use strict';var Sequelize=require(_0x7de1('0x0'));module[_0x7de1('0x1')]={'name':{'type':Sequelize[_0x7de1('0x2')],'unique':_0x7de1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7de1('0x2')]}}; \ No newline at end of file +var _0x5d53=['exports','STRING','name'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x5d53,0x81));var _0x35d5=function(_0xfd9239,_0x2fea4f){_0xfd9239=_0xfd9239-0x0;var _0x48f447=_0x5d53[_0xfd9239];return _0x48f447;};'use strict';var Sequelize=require('sequelize');module[_0x35d5('0x0')]={'name':{'type':Sequelize[_0x35d5('0x1')],'unique':_0x35d5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x35d5('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index dcdeca3..a697a69 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 _0x81d3=['offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','end','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','include','catch','keys','length','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count'];(function(_0x59fd72,_0x2417d0){var _0x529410=function(_0x322006){while(--_0x322006){_0x59fd72['push'](_0x59fd72['shift']());}};_0x529410(++_0x2417d0);}(_0x81d3,0x175));var _0x381d=function(_0x5d1380,_0x1c6a3d){_0x5d1380=_0x5d1380-0x0;var _0x52091d=_0x81d3[_0x5d1380];return _0x52091d;};'use strict';var emlformat=require(_0x381d('0x0'));var rimraf=require(_0x381d('0x1'));var zipdir=require(_0x381d('0x2'));var jsonpatch=require(_0x381d('0x3'));var rp=require(_0x381d('0x4'));var moment=require(_0x381d('0x5'));var BPromise=require(_0x381d('0x6'));var Mustache=require(_0x381d('0x7'));var util=require('util');var path=require(_0x381d('0x8'));var sox=require(_0x381d('0x9'));var csv=require(_0x381d('0xa'));var ejs=require(_0x381d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x381d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x381d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x381d('0xa'));var querystring=require(_0x381d('0xe'));var Papa=require(_0x381d('0xf'));var Redis=require('ioredis');var authService=require(_0x381d('0x10'));var qs=require(_0x381d('0x11'));var as=require(_0x381d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x381d('0x13'));var utils=require('../../config/utils');var config=require(_0x381d('0x14'));var licenseUtil=require(_0x381d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55c1c9,_0x3c31ca){_0x3c31ca=_0x3c31ca||0xcc;return function(_0x2cfaa5){if(_0x2cfaa5){return _0x55c1c9[_0x381d('0x16')](_0x3c31ca);}return _0x55c1c9[_0x381d('0x17')](_0x3c31ca)['end']();};}function respondWithResult(_0x4396b7,_0x4bf428){_0x4bf428=_0x4bf428||0xc8;return function(_0x2b9799){if(_0x2b9799){return _0x4396b7[_0x381d('0x17')](_0x4bf428)[_0x381d('0x18')](_0x2b9799);}};}function respondWithFilteredResult(_0x3d357e,_0x29b4c9){return function(_0x3ef818){if(_0x3ef818){var _0x499c8d=typeof _0x29b4c9['offset']===_0x381d('0x19')&&typeof _0x29b4c9['limit']===_0x381d('0x19');var _0x2470a0=_0x3ef818[_0x381d('0x1a')];var _0x3fe878=_0x499c8d?0x0:_0x29b4c9['offset'];var _0x265cfc=_0x499c8d?_0x3ef818['count']:_0x29b4c9[_0x381d('0x1b')]+_0x29b4c9[_0x381d('0x1c')];var _0x5d91db;if(_0x265cfc>=_0x2470a0){_0x265cfc=_0x2470a0;_0x5d91db=0xc8;}else{_0x5d91db=0xce;}_0x3d357e[_0x381d('0x17')](_0x5d91db);return _0x3d357e['set'](_0x381d('0x1d'),_0x3fe878+'-'+_0x265cfc+'/'+_0x2470a0)[_0x381d('0x18')](_0x3ef818);}return null;};}function patchUpdates(_0x48b518){return function(_0x3db3d5){try{jsonpatch[_0x381d('0x1e')](_0x3db3d5,_0x48b518,!![]);}catch(_0x284e31){return BPromise[_0x381d('0x1f')](_0x284e31);}return _0x3db3d5[_0x381d('0x20')]();};}function saveUpdates(_0x5472c4,_0x3b00cd){return function(_0x21f589){if(_0x21f589){return _0x21f589[_0x381d('0x21')](_0x5472c4)[_0x381d('0x22')](function(_0xa3e213){return _0xa3e213;});}return null;};}function removeEntity(_0x469672,_0x1c1cc7){return function(_0x1fc913){if(_0x1fc913){return _0x1fc913[_0x381d('0x23')]()['then'](function(){var _0x8799ab=_0x1fc913[_0x381d('0x24')]({'plain':!![]});var _0x440e7d=_0x381d('0x25');return db[_0x381d('0x26')]['destroy']({'where':{'type':_0x440e7d,'resourceId':_0x8799ab['id']}})[_0x381d('0x22')](function(){return _0x1fc913;});})['then'](function(){_0x469672['status'](0xcc)[_0x381d('0x27')]();});}};}function handleEntityNotFound(_0x16379f,_0x3ae8eb){return function(_0x4715ed){if(!_0x4715ed){_0x16379f['sendStatus'](0x194);}return _0x4715ed;};}function handleError(_0x5c89fb,_0x11522d){_0x11522d=_0x11522d||0x1f4;return function(_0x4314c1){logger[_0x381d('0x28')](_0x4314c1[_0x381d('0x29')]);if(_0x4314c1[_0x381d('0x2a')]){delete _0x4314c1[_0x381d('0x2a')];}_0x5c89fb[_0x381d('0x17')](_0x11522d)[_0x381d('0x2b')](_0x4314c1);};}exports[_0x381d('0x2c')]=function(_0x5ae685,_0x10f664){var _0x46c2b6={},_0x59bb91={},_0x4cdd95={'count':0x0,'rows':[]};var _0x2ab4ee=_[_0x381d('0x2d')](db[_0x381d('0x2e')][_0x381d('0x2f')],function(_0x4d0950){return{'name':_0x4d0950[_0x381d('0x30')],'type':_0x4d0950[_0x381d('0x31')]['key']};});_0x59bb91[_0x381d('0x32')]=_['map'](_0x2ab4ee,_0x381d('0x2a'));_0x59bb91[_0x381d('0x33')]=_['keys'](_0x5ae685[_0x381d('0x33')]);_0x59bb91[_0x381d('0x34')]=_[_0x381d('0x35')](_0x59bb91[_0x381d('0x32')],_0x59bb91[_0x381d('0x33')]);_0x46c2b6[_0x381d('0x36')]=_[_0x381d('0x35')](_0x59bb91[_0x381d('0x32')],qs[_0x381d('0x37')](_0x5ae685[_0x381d('0x33')]['fields']));_0x46c2b6['attributes']=_0x46c2b6['attributes']['length']?_0x46c2b6[_0x381d('0x36')]:_0x59bb91[_0x381d('0x32')];if(!_0x5ae685['query'][_0x381d('0x38')](_0x381d('0x39'))){_0x46c2b6[_0x381d('0x1c')]=qs['limit'](_0x5ae685['query'][_0x381d('0x1c')]);_0x46c2b6[_0x381d('0x1b')]=qs['offset'](_0x5ae685[_0x381d('0x33')]['offset']);}_0x46c2b6['order']=qs['sort'](_0x5ae685[_0x381d('0x33')][_0x381d('0x3a')]);_0x46c2b6[_0x381d('0x3b')]=qs[_0x381d('0x34')](_['pick'](_0x5ae685[_0x381d('0x33')],_0x59bb91[_0x381d('0x34')]),_0x2ab4ee);if(_0x5ae685[_0x381d('0x33')][_0x381d('0x3c')]){_0x46c2b6['where']=_['merge'](_0x46c2b6[_0x381d('0x3b')],{'$or':_['map'](_0x2ab4ee,function(_0x15a34e){if(_0x15a34e[_0x381d('0x31')]!==_0x381d('0x3d')){var _0x203a0={};_0x203a0[_0x15a34e['name']]={'$like':'%'+_0x5ae685[_0x381d('0x33')][_0x381d('0x3c')]+'%'};return _0x203a0;}})});}_0x46c2b6=_[_0x381d('0x3e')]({},_0x46c2b6,_0x5ae685[_0x381d('0x3f')]);var _0x3f5d27={'where':_0x46c2b6[_0x381d('0x3b')]};return db['Variable']['count'](_0x3f5d27)[_0x381d('0x22')](function(_0x306df3){_0x4cdd95[_0x381d('0x1a')]=_0x306df3;if(_0x5ae685[_0x381d('0x33')]['includeAll']){_0x46c2b6[_0x381d('0x40')]=[{'all':!![]}];}return db[_0x381d('0x2e')]['findAll'](_0x46c2b6);})[_0x381d('0x22')](function(_0x3b9488){_0x4cdd95['rows']=_0x3b9488;return _0x4cdd95;})[_0x381d('0x22')](respondWithFilteredResult(_0x10f664,_0x46c2b6))[_0x381d('0x41')](handleError(_0x10f664,null));};exports['show']=function(_0x4a9f6b,_0x464a7e){var _0x2ad76f={'raw':!![],'where':{'id':_0x4a9f6b['params']['id']}},_0x560ba0={};_0x560ba0[_0x381d('0x32')]=_[_0x381d('0x42')](db[_0x381d('0x2e')]['rawAttributes']);_0x560ba0[_0x381d('0x33')]=_['keys'](_0x4a9f6b[_0x381d('0x33')]);_0x560ba0[_0x381d('0x34')]=_[_0x381d('0x35')](_0x560ba0['model'],_0x560ba0[_0x381d('0x33')]);_0x2ad76f[_0x381d('0x36')]=_['intersection'](_0x560ba0[_0x381d('0x32')],qs[_0x381d('0x37')](_0x4a9f6b['query'][_0x381d('0x37')]));_0x2ad76f[_0x381d('0x36')]=_0x2ad76f[_0x381d('0x36')][_0x381d('0x43')]?_0x2ad76f[_0x381d('0x36')]:_0x560ba0[_0x381d('0x32')];if(_0x4a9f6b[_0x381d('0x33')][_0x381d('0x44')]){_0x2ad76f[_0x381d('0x40')]=[{'all':!![]}];}_0x2ad76f=_[_0x381d('0x3e')]({},_0x2ad76f,_0x4a9f6b[_0x381d('0x3f')]);return db['Variable'][_0x381d('0x45')](_0x2ad76f)[_0x381d('0x22')](handleEntityNotFound(_0x464a7e,null))[_0x381d('0x22')](respondWithResult(_0x464a7e,null))['catch'](handleError(_0x464a7e,null));};exports[_0x381d('0x46')]=function(_0x1556d1,_0x452c99){return db[_0x381d('0x2e')][_0x381d('0x46')](_0x1556d1['body'],{})[_0x381d('0x22')](function(_0x436cd1){var _0x2e9ff0=_0x1556d1['user'][_0x381d('0x24')]({'plain':!![]});if(!_0x2e9ff0)throw new Error(_0x381d('0x47'));if(_0x2e9ff0[_0x381d('0x48')]===_0x381d('0x49')){var _0x1287d0=_0x436cd1[_0x381d('0x24')]({'plain':!![]});var _0x522719=_0x381d('0x25');return db[_0x381d('0x4a')][_0x381d('0x45')]({'where':{'name':_0x522719,'userProfileId':_0x2e9ff0[_0x381d('0x4b')]},'raw':!![]})[_0x381d('0x22')](function(_0x432bdb){if(_0x432bdb&&_0x432bdb[_0x381d('0x4c')]===0x0){return db[_0x381d('0x26')][_0x381d('0x46')]({'name':_0x1287d0[_0x381d('0x2a')],'resourceId':_0x1287d0['id'],'type':_0x432bdb[_0x381d('0x2a')],'sectionId':_0x432bdb['id']},{})[_0x381d('0x22')](function(){return _0x436cd1;});}else{return _0x436cd1;}})[_0x381d('0x41')](function(_0x31fe0a){logger[_0x381d('0x28')](_0x381d('0x4d'),_0x31fe0a);throw _0x31fe0a;});}return _0x436cd1;})[_0x381d('0x22')](respondWithResult(_0x452c99,0xc9))[_0x381d('0x41')](handleError(_0x452c99,null));};exports[_0x381d('0x21')]=function(_0xbff670,_0x1927ec){if(_0xbff670[_0x381d('0x4e')]['id']){delete _0xbff670[_0x381d('0x4e')]['id'];}return db[_0x381d('0x2e')][_0x381d('0x45')]({'where':{'id':_0xbff670[_0x381d('0x4f')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x1927ec,null))[_0x381d('0x22')](saveUpdates(_0xbff670[_0x381d('0x4e')],null))['then'](respondWithResult(_0x1927ec,null))['catch'](handleError(_0x1927ec,null));};exports[_0x381d('0x23')]=function(_0x454a78,_0x52ac13){return db[_0x381d('0x2e')][_0x381d('0x45')]({'where':{'id':_0x454a78[_0x381d('0x4f')]['id']}})[_0x381d('0x22')](handleEntityNotFound(_0x52ac13,null))['then'](removeEntity(_0x52ac13,null))[_0x381d('0x41')](handleError(_0x52ac13,null));}; \ No newline at end of file +var _0x07f6=['length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','Variables','UserProfileResource','destroy','name','send','index','map','Variable','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys'];(function(_0x53bfcf,_0x24937a){var _0x2825e4=function(_0x2ffd0a){while(--_0x2ffd0a){_0x53bfcf['push'](_0x53bfcf['shift']());}};_0x2825e4(++_0x24937a);}(_0x07f6,0x149));var _0x607f=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x07f6[_0x4e5552];return _0x60a338;};'use strict';var emlformat=require(_0x607f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x607f('0x1'));var jsonpatch=require(_0x607f('0x2'));var rp=require('request-promise');var moment=require(_0x607f('0x3'));var BPromise=require(_0x607f('0x4'));var Mustache=require(_0x607f('0x5'));var util=require(_0x607f('0x6'));var path=require(_0x607f('0x7'));var sox=require(_0x607f('0x8'));var csv=require(_0x607f('0x9'));var ejs=require(_0x607f('0xa'));var fs=require('fs');var fs_extra=require(_0x607f('0xb'));var _=require(_0x607f('0xc'));var squel=require(_0x607f('0xd'));var crypto=require(_0x607f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x607f('0xf'));var toCsv=require(_0x607f('0x9'));var querystring=require(_0x607f('0x10'));var Papa=require(_0x607f('0x11'));var Redis=require('ioredis');var authService=require(_0x607f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x607f('0x13'));var logger=require(_0x607f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x607f('0x15'));var licenseUtil=require(_0x607f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4659b0,_0xf07fd2){_0xf07fd2=_0xf07fd2||0xcc;return function(_0x4d32ae){if(_0x4d32ae){return _0x4659b0[_0x607f('0x17')](_0xf07fd2);}return _0x4659b0[_0x607f('0x18')](_0xf07fd2)[_0x607f('0x19')]();};}function respondWithResult(_0x2b7381,_0x5c581b){_0x5c581b=_0x5c581b||0xc8;return function(_0x44d205){if(_0x44d205){return _0x2b7381[_0x607f('0x18')](_0x5c581b)[_0x607f('0x1a')](_0x44d205);}};}function respondWithFilteredResult(_0x17f7ee,_0x51252c){return function(_0x58ad69){if(_0x58ad69){var _0x14bec8=typeof _0x51252c[_0x607f('0x1b')]===_0x607f('0x1c')&&typeof _0x51252c[_0x607f('0x1d')]===_0x607f('0x1c');var _0x1bfb98=_0x58ad69[_0x607f('0x1e')];var _0x228117=_0x14bec8?0x0:_0x51252c['offset'];var _0x4fe78c=_0x14bec8?_0x58ad69[_0x607f('0x1e')]:_0x51252c[_0x607f('0x1b')]+_0x51252c[_0x607f('0x1d')];var _0x52d460;if(_0x4fe78c>=_0x1bfb98){_0x4fe78c=_0x1bfb98;_0x52d460=0xc8;}else{_0x52d460=0xce;}_0x17f7ee[_0x607f('0x18')](_0x52d460);return _0x17f7ee[_0x607f('0x1f')](_0x607f('0x20'),_0x228117+'-'+_0x4fe78c+'/'+_0x1bfb98)[_0x607f('0x1a')](_0x58ad69);}return null;};}function patchUpdates(_0x56d490){return function(_0x38fe8a){try{jsonpatch['apply'](_0x38fe8a,_0x56d490,!![]);}catch(_0x3f93d0){return BPromise[_0x607f('0x21')](_0x3f93d0);}return _0x38fe8a['save']();};}function saveUpdates(_0x5c4be7,_0x1f6750){return function(_0x3f4cf5){if(_0x3f4cf5){return _0x3f4cf5['update'](_0x5c4be7)[_0x607f('0x22')](function(_0x20ec28){return _0x20ec28;});}return null;};}function removeEntity(_0x27bf22,_0x476075){return function(_0x33b240){if(_0x33b240){return _0x33b240['destroy']()['then'](function(){var _0x334a52=_0x33b240['get']({'plain':!![]});var _0x354f9f=_0x607f('0x23');return db[_0x607f('0x24')][_0x607f('0x25')]({'where':{'type':_0x354f9f,'resourceId':_0x334a52['id']}})[_0x607f('0x22')](function(){return _0x33b240;});})[_0x607f('0x22')](function(){_0x27bf22[_0x607f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19d425,_0x3f00f5){return function(_0x3240a1){if(!_0x3240a1){_0x19d425[_0x607f('0x17')](0x194);}return _0x3240a1;};}function handleError(_0x38c7a4,_0x26c002){_0x26c002=_0x26c002||0x1f4;return function(_0x59393f){logger['error'](_0x59393f['stack']);if(_0x59393f['name']){delete _0x59393f[_0x607f('0x26')];}_0x38c7a4['status'](_0x26c002)[_0x607f('0x27')](_0x59393f);};}exports[_0x607f('0x28')]=function(_0x40ecf4,_0x4d8ee0){var _0x38999e={},_0x94f7a={},_0x157a0e={'count':0x0,'rows':[]};var _0x160a61=_[_0x607f('0x29')](db[_0x607f('0x2a')]['rawAttributes'],function(_0x503ed0){return{'name':_0x503ed0[_0x607f('0x2b')],'type':_0x503ed0[_0x607f('0x2c')][_0x607f('0x2d')]};});_0x94f7a[_0x607f('0x2e')]=_[_0x607f('0x29')](_0x160a61,_0x607f('0x26'));_0x94f7a['query']=_['keys'](_0x40ecf4['query']);_0x94f7a[_0x607f('0x2f')]=_[_0x607f('0x30')](_0x94f7a[_0x607f('0x2e')],_0x94f7a[_0x607f('0x31')]);_0x38999e[_0x607f('0x32')]=_['intersection'](_0x94f7a[_0x607f('0x2e')],qs['fields'](_0x40ecf4[_0x607f('0x31')][_0x607f('0x33')]));_0x38999e[_0x607f('0x32')]=_0x38999e[_0x607f('0x32')]['length']?_0x38999e['attributes']:_0x94f7a[_0x607f('0x2e')];if(!_0x40ecf4[_0x607f('0x31')][_0x607f('0x34')](_0x607f('0x35'))){_0x38999e[_0x607f('0x1d')]=qs['limit'](_0x40ecf4['query'][_0x607f('0x1d')]);_0x38999e['offset']=qs[_0x607f('0x1b')](_0x40ecf4[_0x607f('0x31')][_0x607f('0x1b')]);}_0x38999e['order']=qs['sort'](_0x40ecf4[_0x607f('0x31')][_0x607f('0x36')]);_0x38999e[_0x607f('0x37')]=qs[_0x607f('0x2f')](_['pick'](_0x40ecf4[_0x607f('0x31')],_0x94f7a[_0x607f('0x2f')]),_0x160a61);if(_0x40ecf4[_0x607f('0x31')]['filter']){_0x38999e['where']=_[_0x607f('0x38')](_0x38999e['where'],{'$or':_[_0x607f('0x29')](_0x160a61,function(_0x11aae4){if(_0x11aae4[_0x607f('0x2c')]!==_0x607f('0x39')){var _0x55a1a6={};_0x55a1a6[_0x11aae4['name']]={'$like':'%'+_0x40ecf4['query']['filter']+'%'};return _0x55a1a6;}})});}_0x38999e=_[_0x607f('0x38')]({},_0x38999e,_0x40ecf4[_0x607f('0x3a')]);var _0x387fac={'where':_0x38999e[_0x607f('0x37')]};return db[_0x607f('0x2a')][_0x607f('0x1e')](_0x387fac)[_0x607f('0x22')](function(_0x4694a3){_0x157a0e[_0x607f('0x1e')]=_0x4694a3;if(_0x40ecf4['query'][_0x607f('0x3b')]){_0x38999e[_0x607f('0x3c')]=[{'all':!![]}];}return db[_0x607f('0x2a')][_0x607f('0x3d')](_0x38999e);})[_0x607f('0x22')](function(_0x27d631){_0x157a0e[_0x607f('0x3e')]=_0x27d631;return _0x157a0e;})[_0x607f('0x22')](respondWithFilteredResult(_0x4d8ee0,_0x38999e))[_0x607f('0x3f')](handleError(_0x4d8ee0,null));};exports[_0x607f('0x40')]=function(_0x53d49a,_0x289161){var _0x25787f={'raw':!![],'where':{'id':_0x53d49a['params']['id']}},_0x39f077={};_0x39f077[_0x607f('0x2e')]=_[_0x607f('0x41')](db['Variable']['rawAttributes']);_0x39f077[_0x607f('0x31')]=_[_0x607f('0x41')](_0x53d49a['query']);_0x39f077[_0x607f('0x2f')]=_[_0x607f('0x30')](_0x39f077[_0x607f('0x2e')],_0x39f077['query']);_0x25787f[_0x607f('0x32')]=_[_0x607f('0x30')](_0x39f077['model'],qs['fields'](_0x53d49a[_0x607f('0x31')][_0x607f('0x33')]));_0x25787f[_0x607f('0x32')]=_0x25787f['attributes'][_0x607f('0x42')]?_0x25787f[_0x607f('0x32')]:_0x39f077[_0x607f('0x2e')];if(_0x53d49a[_0x607f('0x31')][_0x607f('0x3b')]){_0x25787f[_0x607f('0x3c')]=[{'all':!![]}];}_0x25787f=_[_0x607f('0x38')]({},_0x25787f,_0x53d49a[_0x607f('0x3a')]);return db[_0x607f('0x2a')][_0x607f('0x43')](_0x25787f)[_0x607f('0x22')](handleEntityNotFound(_0x289161,null))[_0x607f('0x22')](respondWithResult(_0x289161,null))['catch'](handleError(_0x289161,null));};exports[_0x607f('0x44')]=function(_0x3d4060,_0x472962){return db[_0x607f('0x2a')][_0x607f('0x44')](_0x3d4060[_0x607f('0x45')],{})[_0x607f('0x22')](function(_0x4b6004){var _0x2c767f=_0x3d4060[_0x607f('0x46')][_0x607f('0x47')]({'plain':!![]});if(!_0x2c767f)throw new Error(_0x607f('0x48'));if(_0x2c767f[_0x607f('0x49')]==='user'){var _0x33cfd1=_0x4b6004['get']({'plain':!![]});var _0x3f95a6=_0x607f('0x23');return db[_0x607f('0x4a')]['find']({'where':{'name':_0x3f95a6,'userProfileId':_0x2c767f[_0x607f('0x4b')]},'raw':!![]})[_0x607f('0x22')](function(_0x4857c4){if(_0x4857c4&&_0x4857c4[_0x607f('0x4c')]===0x0){return db[_0x607f('0x24')][_0x607f('0x44')]({'name':_0x33cfd1[_0x607f('0x26')],'resourceId':_0x33cfd1['id'],'type':_0x4857c4[_0x607f('0x26')],'sectionId':_0x4857c4['id']},{})[_0x607f('0x22')](function(){return _0x4b6004;});}else{return _0x4b6004;}})['catch'](function(_0x446653){logger['error'](_0x607f('0x4d'),_0x446653);throw _0x446653;});}return _0x4b6004;})[_0x607f('0x22')](respondWithResult(_0x472962,0xc9))[_0x607f('0x3f')](handleError(_0x472962,null));};exports['update']=function(_0x2d773d,_0x5065b2){if(_0x2d773d[_0x607f('0x45')]['id']){delete _0x2d773d[_0x607f('0x45')]['id'];}return db['Variable'][_0x607f('0x43')]({'where':{'id':_0x2d773d[_0x607f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5065b2,null))[_0x607f('0x22')](saveUpdates(_0x2d773d[_0x607f('0x45')],null))[_0x607f('0x22')](respondWithResult(_0x5065b2,null))[_0x607f('0x3f')](handleError(_0x5065b2,null));};exports[_0x607f('0x25')]=function(_0x18de13,_0x497c69){return db[_0x607f('0x2a')][_0x607f('0x43')]({'where':{'id':_0x18de13['params']['id']}})[_0x607f('0x22')](handleEntityNotFound(_0x497c69,null))['then'](removeEntity(_0x497c69,null))[_0x607f('0x3f')](handleError(_0x497c69,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a18d10b..53c2d55 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 _0x1b41=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./variable.attributes','Variable','tools_variables','util'];(function(_0x575111,_0x3e4217){var _0x277057=function(_0x1836f){while(--_0x1836f){_0x575111['push'](_0x575111['shift']());}};_0x277057(++_0x3e4217);}(_0x1b41,0x1f3));var _0x11b4=function(_0x8f82df,_0x4ad0e9){_0x8f82df=_0x8f82df-0x0;var _0x19212a=_0x1b41[_0x8f82df];return _0x19212a;};'use strict';var _=require('lodash');var util=require(_0x11b4('0x0'));var logger=require(_0x11b4('0x1'))(_0x11b4('0x2'));var moment=require(_0x11b4('0x3'));var BPromise=require(_0x11b4('0x4'));var rp=require(_0x11b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x11b4('0x6'));var attributes=require(_0x11b4('0x7'));module['exports']=function(_0xa81368,_0x3333e3){return _0xa81368['define'](_0x11b4('0x8'),attributes,{'tableName':_0x11b4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43b1=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','Variable','tools_variables','lodash'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0x43b1,0xdb));var _0x143b=function(_0x417a2c,_0x23916e){_0x417a2c=_0x417a2c-0x0;var _0x47e18a=_0x43b1[_0x417a2c];return _0x47e18a;};'use strict';var _=require(_0x143b('0x0'));var util=require('util');var logger=require(_0x143b('0x1'))(_0x143b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x143b('0x3'));var fs=require('fs');var path=require(_0x143b('0x4'));var rimraf=require(_0x143b('0x5'));var config=require(_0x143b('0x6'));var attributes=require('./variable.attributes');module[_0x143b('0x7')]=function(_0x553da9,_0xe867c8){return _0x553da9['define'](_0x143b('0x8'),attributes,{'tableName':_0x143b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 08b70fe..eafc8c5 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x311c92,_0x9166a3){var _0x2914d0=function(_0x3476d2){while(--_0x3476d2){_0x311c92['push'](_0x311c92['shift']());}};_0x2914d0(++_0x9166a3);}(_0xe14b,0x93));var _0xbe14=function(_0x4d1f0c,_0x5ec163){_0x4d1f0c=_0x4d1f0c-0x0;var _0x277fae=_0xe14b[_0x4d1f0c];return _0x277fae;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x40d394,_0x27f0de){var _0x4f285d=function(_0x2c6c7e){while(--_0x2c6c7e){_0x40d394['push'](_0x40d394['shift']());}};_0x4f285d(++_0x27f0de);}(_0x55ca,0x126));var _0xa55c=function(_0x286f2b,_0x171c07){_0x286f2b=_0x286f2b-0x0;var _0x33d6f4=_0x55ca[_0x286f2b];return _0x33d6f4;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 7645eed..978b4d0 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 _0x6b42=['../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','restart','/migrations','exports','express'];(function(_0x44449b,_0x5e16ea){var _0x1dde55=function(_0x3c50f0){while(--_0x3c50f0){_0x44449b['push'](_0x44449b['shift']());}};_0x1dde55(++_0x5e16ea);}(_0x6b42,0x6b));var _0x26b4=function(_0x4a04e0,_0x9a0ce6){_0x4a04e0=_0x4a04e0-0x0;var _0x5f1398=_0x6b42[_0x4a04e0];return _0x5f1398;};'use strict';var express=require(_0x26b4('0x0'));var router=express['Router']();var auth=require(_0x26b4('0x1'));var controller=require('./version.controller');router['get']('/',controller['index']);router[_0x26b4('0x2')](_0x26b4('0x3'),auth[_0x26b4('0x4')](),auth[_0x26b4('0x5')](),controller[_0x26b4('0x6')]);router['get']('/reset',auth[_0x26b4('0x4')](),auth[_0x26b4('0x5')](),controller[_0x26b4('0x7')]);router['get'](_0x26b4('0x8'),auth[_0x26b4('0x4')](),auth[_0x26b4('0x5')](),controller['pull']);router[_0x26b4('0x2')]('/restart',auth[_0x26b4('0x4')](),controller[_0x26b4('0x9')]);router[_0x26b4('0x2')](_0x26b4('0xa'),controller['migrations']);module[_0x26b4('0xb')]=router; \ No newline at end of file +var _0x7032=['Router','../../components/auth/service','./version.controller','/fetch','fetch','get','/reset','isAuthenticated','/pull','pull','/restart','restart','exports','express'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x7032,0x125));var _0x2703=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x7032[_0x38fb8b];return _0x1ec681;};'use strict';var express=require(_0x2703('0x0'));var router=express[_0x2703('0x1')]();var auth=require(_0x2703('0x2'));var controller=require(_0x2703('0x3'));router['get']('/',controller['index']);router['get'](_0x2703('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2703('0x5')]);router[_0x2703('0x6')](_0x2703('0x7'),auth[_0x2703('0x8')](),auth['canUpdate'](),controller['reset']);router[_0x2703('0x6')](_0x2703('0x9'),auth[_0x2703('0x8')](),auth['canUpdate'](),controller[_0x2703('0xa')]);router[_0x2703('0x6')](_0x2703('0xb'),auth['isAuthenticated'](),controller[_0x2703('0xc')]);router[_0x2703('0x6')]('/migrations',controller['migrations']);module[_0x2703('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 0b5f954..799d19d 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 _0x8818=['getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','server','migrations','length','replace','.js','push','sort','sequelize','Migration'];(function(_0x302b51,_0x29ddad){var _0x7f1357=function(_0x59a55b){while(--_0x59a55b){_0x302b51['push'](_0x302b51['shift']());}};_0x7f1357(++_0x29ddad);}(_0x8818,0xe1));var _0x8881=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x8818[_0x334841];return _0x5beb4b;};'use strict';var Umzug=require(_0x8881('0x0'));var path=require(_0x8881('0x1'));var fs=require('fs');var _=require(_0x8881('0x2'));var pkginfo=require(_0x8881('0x3'))(module,_0x8881('0x4'));var compareVersions=require(_0x8881('0x5'));var exec=require(_0x8881('0x6'))[_0x8881('0x7')];var db=require(_0x8881('0x8'))['db'];var config=require('../../config/environment');var pm2=require(_0x8881('0x9'));var logger=require(_0x8881('0xa'))(_0x8881('0xb'));var git=require(_0x8881('0xc'))(config[_0x8881('0xd')]);exports[_0x8881('0xe')]=function(_0x15b37e,_0x1915c2){var _0x25e614={'current':module[_0x8881('0xf')][_0x8881('0x4')],'phonebar':0x2};if(_0x15b37e['query']&&_0x15b37e[_0x8881('0x10')][_0x8881('0x11')]){return git[_0x8881('0x12')]()[_0x8881('0x13')](function(_0x2fb65c,_0x569a6b){_0x25e614['latest']=(_0x2fb65c?module[_0x8881('0xf')][_0x8881('0x4')]:_0x569a6b[_0x8881('0x11')])||_0x8881('0x14');return _0x1915c2[_0x8881('0x15')](0xc8)['json'](_0x25e614);});}else{return _0x1915c2[_0x8881('0x15')](0xc8)[_0x8881('0x16')](_0x25e614);}};exports[_0x8881('0x12')]=function(_0x45296d,_0x2432e7){return git[_0x8881('0x12')]([_0x8881('0x17'),_0x8881('0x18')],function(_0x14535f){if(_0x14535f){logger['error'](_0x14535f);return _0x2432e7['status'](0x1f4)['json'](_0x14535f);}logger[_0x8881('0x19')](_0x8881('0x1a'));return _0x2432e7[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':_0x8881('0x1b')});});};exports[_0x8881('0x1c')]=function(_0xfbbac4,_0x58b40b){return git['reset'](['--hard',_0x8881('0x1d')],function(_0x100eba){if(_0x100eba){logger[_0x8881('0x1e')](_0x100eba);return _0x58b40b['status'](0x1f4)['json'](_0x100eba);}logger[_0x8881('0x19')](_0x8881('0x1f'));return _0x58b40b[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':_0x8881('0x20')});});};exports[_0x8881('0x21')]=function(_0x1d13a6,_0x32b150){exec('npm\x20install\x20--production',function(_0x2b74b5,_0x46c506,_0x2ea6b2){logger['info'](_0x46c506);logger['info'](_0x2ea6b2);if(_0x2b74b5){logger['error'](_0x2b74b5);return _0x32b150['status'](0x1f4)[_0x8881('0x16')](_0x2b74b5);}return _0x32b150[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':_0x46c506});});};exports[_0x8881('0x22')]=function(_0x396e25,_0x55c077){return pm2[_0x8881('0x22')](_0x8881('0x23'))[_0x8881('0x24')](function(_0x56cd37){logger[_0x8881('0x19')](_0x8881('0x25'),_0x56cd37);return _0x55c077[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x8881('0x26')](function(_0x1dee37){logger[_0x8881('0x1e')](_0x1dee37);return _0x55c077[_0x8881('0x15')](0x1f4)['json'](_0x1dee37);});};exports['migrations']=function(_0x515fc5,_0x35f5b3){var _0x56f1c8=fs[_0x8881('0x27')](path[_0x8881('0x28')](config[_0x8881('0xd')],_0x8881('0x29'),_0x8881('0x2a')));var _0x61df44=[];for(var _0x2e3a4a=0x0;_0x2e3a4a<_0x56f1c8[_0x8881('0x2b')];_0x2e3a4a++){var _0x2e6571=_0x56f1c8[_0x2e3a4a][_0x8881('0x2c')](_0x8881('0x2d'),'');if(compareVersions(module[_0x8881('0xf')][_0x8881('0x4')],_0x2e6571)===-0x1){_0x61df44[_0x8881('0x2e')](_0x2e6571);}}if(_0x61df44[_0x8881('0x2b')]){var _0x436ad8=_0x61df44[_0x8881('0x2f')](compareVersions);var _0x19caec=new Umzug({'storage':_0x8881('0x30'),'storageOptions':{'model':db[_0x8881('0x31')],'modelName':_0x8881('0x31'),'columnName':_0x8881('0x4')},'migrations':{'params':[db[_0x8881('0x30')][_0x8881('0x32')](),db[_0x8881('0x30')]['constructor'],function(){throw new Error(_0x8881('0x33'));}],'path':path[_0x8881('0x28')](config[_0x8881('0xd')],_0x8881('0x29'),'migrations'),'pattern':/\.js$/}});_0x19caec['up']({'migrations':_['map'](_0x436ad8,function(_0x3d6553){return _0x3d6553+_0x8881('0x2d');})})[_0x8881('0x24')](function(){return _0x35f5b3[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8881('0xf')][_0x8881('0x4')]+_0x8881('0x34')+_['last'](_0x436ad8),'migrations':_[_0x8881('0x28')](_0x436ad8)});})[_0x8881('0x26')](function(_0x38ba19){if(_0x38ba19 instanceof db[_0x8881('0x30')][_0x8881('0x35')]){return _0x35f5b3[_0x8881('0x15')](0xc8)[_0x8881('0x16')]({'output':_0x8881('0x36')});}else{return _0x35f5b3[_0x8881('0x15')](0x1f4)['json'](_0x38ba19);}});}else{return _0x35f5b3['status'](0xc8)[_0x8881('0x16')]({'output':_0x8881('0x36')});}}; \ No newline at end of file +var _0xfb4c=['query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','length','replace','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','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','join','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','exec','../../config/pm2','../../config/logger','update','simple-git','root','exports'];(function(_0x5ca464,_0x1ed391){var _0x2654b5=function(_0x5245b3){while(--_0x5245b3){_0x5ca464['push'](_0x5ca464['shift']());}};_0x2654b5(++_0x1ed391);}(_0xfb4c,0x1df));var _0xcfb4=function(_0xf2b812,_0x5788ec){_0xf2b812=_0xf2b812-0x0;var _0x24df75=_0xfb4c[_0xf2b812];return _0x24df75;};'use strict';var Umzug=require(_0xcfb4('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xcfb4('0x1'))(module,_0xcfb4('0x2'));var compareVersions=require(_0xcfb4('0x3'));var exec=require('child_process')[_0xcfb4('0x4')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0xcfb4('0x5'));var logger=require(_0xcfb4('0x6'))(_0xcfb4('0x7'));var git=require(_0xcfb4('0x8'))(config[_0xcfb4('0x9')]);exports['index']=function(_0x37f39c,_0x5269c5){var _0x1b825a={'current':module[_0xcfb4('0xa')][_0xcfb4('0x2')],'phonebar':0x2};if(_0x37f39c[_0xcfb4('0xb')]&&_0x37f39c[_0xcfb4('0xb')][_0xcfb4('0xc')]){return git[_0xcfb4('0xd')]()[_0xcfb4('0xe')](function(_0x4367ab,_0xce32f1){_0x1b825a[_0xcfb4('0xc')]=(_0x4367ab?module['exports'][_0xcfb4('0x2')]:_0xce32f1['latest'])||_0xcfb4('0xf');return _0x5269c5[_0xcfb4('0x10')](0xc8)['json'](_0x1b825a);});}else{return _0x5269c5[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')](_0x1b825a);}};exports[_0xcfb4('0xd')]=function(_0x5c6c80,_0x27bcad){return git[_0xcfb4('0xd')](['origin',_0xcfb4('0x12')],function(_0x370125){if(_0x370125){logger[_0xcfb4('0x13')](_0x370125);return _0x27bcad[_0xcfb4('0x10')](0x1f4)['json'](_0x370125);}logger[_0xcfb4('0x14')]('git\x20fetch');return _0x27bcad[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':_0xcfb4('0x15')});});};exports['reset']=function(_0x42ca06,_0xfea028){return git[_0xcfb4('0x16')](['--hard',_0xcfb4('0x17')],function(_0x4a6df0){if(_0x4a6df0){logger['error'](_0x4a6df0);return _0xfea028[_0xcfb4('0x10')](0x1f4)['json'](_0x4a6df0);}logger[_0xcfb4('0x14')](_0xcfb4('0x18'));return _0xfea028[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':_0xcfb4('0x19')});});};exports[_0xcfb4('0x1a')]=function(_0x2a2722,_0x4de36d){exec('npm\x20install\x20--production',function(_0x1b8b49,_0x100494,_0x4a0a53){logger[_0xcfb4('0x14')](_0x100494);logger[_0xcfb4('0x14')](_0x4a0a53);if(_0x1b8b49){logger[_0xcfb4('0x13')](_0x1b8b49);return _0x4de36d[_0xcfb4('0x10')](0x1f4)[_0xcfb4('0x11')](_0x1b8b49);}return _0x4de36d['status'](0xc8)[_0xcfb4('0x11')]({'output':_0x100494});});};exports[_0xcfb4('0x1b')]=function(_0x115f11,_0x536480){return pm2['restart']('motion2')[_0xcfb4('0x1c')](function(_0x1c54a0){logger['info']('pm2\x20restart\x20motion\x20%s',_0x1c54a0);return _0x536480[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':_0xcfb4('0x1d')});})[_0xcfb4('0x1e')](function(_0x3fe102){logger[_0xcfb4('0x13')](_0x3fe102);return _0x536480['status'](0x1f4)[_0xcfb4('0x11')](_0x3fe102);});};exports[_0xcfb4('0x1f')]=function(_0x5732a6,_0x3810c2){var _0x5c75e8=fs[_0xcfb4('0x20')](path['join'](config[_0xcfb4('0x9')],_0xcfb4('0x21'),_0xcfb4('0x1f')));var _0xe371e7=[];for(var _0x1e67ad=0x0;_0x1e67ad<_0x5c75e8[_0xcfb4('0x22')];_0x1e67ad++){var _0x1e34f3=_0x5c75e8[_0x1e67ad][_0xcfb4('0x23')]('.js','');if(compareVersions(module[_0xcfb4('0xa')][_0xcfb4('0x2')],_0x1e34f3)===-0x1){_0xe371e7['push'](_0x1e34f3);}}if(_0xe371e7['length']){var _0x571c93=_0xe371e7[_0xcfb4('0x24')](compareVersions);var _0x45a754=new Umzug({'storage':_0xcfb4('0x25'),'storageOptions':{'model':db[_0xcfb4('0x26')],'modelName':_0xcfb4('0x26'),'columnName':_0xcfb4('0x2')},'migrations':{'params':[db[_0xcfb4('0x25')][_0xcfb4('0x27')](),db[_0xcfb4('0x25')][_0xcfb4('0x28')],function(){throw new Error(_0xcfb4('0x29'));}],'path':path['join'](config['root'],'server',_0xcfb4('0x1f')),'pattern':/\.js$/}});_0x45a754['up']({'migrations':_[_0xcfb4('0x2a')](_0x571c93,function(_0x1eb379){return _0x1eb379+_0xcfb4('0x2b');})})['then'](function(){return _0x3810c2[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':_0xcfb4('0x2c')+module[_0xcfb4('0xa')][_0xcfb4('0x2')]+_0xcfb4('0x2d')+_[_0xcfb4('0x2e')](_0x571c93),'migrations':_[_0xcfb4('0x2f')](_0x571c93)});})['catch'](function(_0x4c83f8){if(_0x4c83f8 instanceof db[_0xcfb4('0x25')]['UniqueConstraintError']){return _0x3810c2[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':_0xcfb4('0x30')});}else{return _0x3810c2['status'](0x1f4)[_0xcfb4('0x11')](_0x4c83f8);}});}else{return _0x3810c2[_0xcfb4('0x10')](0xc8)[_0xcfb4('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ab17b9b..4088ffb 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 _0x9fd6=['index','/describe','get','show','post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated'];(function(_0x3d347f,_0x297f3b){var _0x11054f=function(_0x553142){while(--_0x553142){_0x3d347f['push'](_0x3d347f['shift']());}};_0x11054f(++_0x297f3b);}(_0x9fd6,0xb6));var _0x69fd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fd6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x69fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x69fd('0x1'));var express=require('express');var router=express[_0x69fd('0x2')]();var fs_extra=require(_0x69fd('0x3'));var auth=require(_0x69fd('0x4'));var interaction=require(_0x69fd('0x5'));var config=require('../../config/environment');var controller=require(_0x69fd('0x6'));router['get']('/',auth[_0x69fd('0x7')](),controller[_0x69fd('0x8')]);router['get'](_0x69fd('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x69fd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x69fd('0xb')]);router[_0x69fd('0xc')]('/',auth[_0x69fd('0x7')](),controller[_0x69fd('0xd')]);router['put'](_0x69fd('0xe'),auth[_0x69fd('0x7')](),controller[_0x69fd('0xf')]);router[_0x69fd('0x10')](_0x69fd('0xe'),auth[_0x69fd('0x7')](),controller[_0x69fd('0x11')]);module[_0x69fd('0x12')]=router; \ No newline at end of file +var _0x7c4c=['isAuthenticated','index','get','/describe','describe','/:id','show','create','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x588d38,_0x3a3925){var _0x46fd44=function(_0x40ae9b){while(--_0x40ae9b){_0x588d38['push'](_0x588d38['shift']());}};_0x46fd44(++_0x3a3925);}(_0x7c4c,0x1b0));var _0xc7c4=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7c4c[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require('multer');var util=require(_0xc7c4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7c4('0x1'));var router=express[_0xc7c4('0x2')]();var fs_extra=require(_0xc7c4('0x3'));var auth=require(_0xc7c4('0x4'));var interaction=require(_0xc7c4('0x5'));var config=require(_0xc7c4('0x6'));var controller=require(_0xc7c4('0x7'));router['get']('/',auth[_0xc7c4('0x8')](),controller[_0xc7c4('0x9')]);router[_0xc7c4('0xa')](_0xc7c4('0xb'),auth['isAuthenticated'](),controller[_0xc7c4('0xc')]);router[_0xc7c4('0xa')](_0xc7c4('0xd'),auth[_0xc7c4('0x8')](),controller[_0xc7c4('0xe')]);router['post']('/',auth[_0xc7c4('0x8')](),controller[_0xc7c4('0xf')]);router['put'](_0xc7c4('0xd'),auth[_0xc7c4('0x8')](),controller[_0xc7c4('0x10')]);router[_0xc7c4('0x11')](_0xc7c4('0xd'),auth[_0xc7c4('0x8')](),controller[_0xc7c4('0x12')]);module[_0xc7c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 0edc5f7..525d13d 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 _0x215d=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x5e1ba9,_0x17e64e){var _0x3e1bcd=function(_0x5e13fe){while(--_0x5e13fe){_0x5e1ba9['push'](_0x5e1ba9['shift']());}};_0x3e1bcd(++_0x17e64e);}(_0x215d,0x187));var _0xd215=function(_0x24d994,_0x4b33da){_0x24d994=_0x24d994-0x0;var _0x5ae16f=_0x215d[_0x24d994];return _0x5ae16f;};'use strict';var Sequelize=require(_0xd215('0x0'));module['exports']={'type':{'type':Sequelize[_0xd215('0x1')]},'uniqueid':{'type':Sequelize[_0xd215('0x1')]},'calleridnum':{'type':Sequelize[_0xd215('0x1')]},'calleridname':{'type':Sequelize[_0xd215('0x1')]},'queue':{'type':Sequelize[_0xd215('0x1')]},'interface':{'type':Sequelize[_0xd215('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xd215('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xd215('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd215('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd215('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd215('0x4')]},'agentacw':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xd215('0x1')]},'lastevent':{'type':Sequelize[_0xd215('0x1')]},'channel':{'type':Sequelize[_0xd215('0x1')]},'channelstate':{'type':Sequelize[_0xd215('0x4')]},'channelstatedesc':{'type':Sequelize[_0xd215('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd215('0x1')]},'language':{'type':Sequelize[_0xd215('0x1')]},'accountcode':{'type':Sequelize[_0xd215('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xd215('0x1')]},'priority':{'type':Sequelize[_0xd215('0x1')]},'destchannel':{'type':Sequelize[_0xd215('0x1')]},'destchannelstate':{'type':Sequelize[_0xd215('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd215('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xd215('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd215('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd215('0x1')]},'destlanguage':{'type':Sequelize[_0xd215('0x1')]},'destaccountcode':{'type':Sequelize[_0xd215('0x1')]},'destcontext':{'type':Sequelize[_0xd215('0x1')]},'destexten':{'type':Sequelize[_0xd215('0x1')]},'destpriority':{'type':Sequelize[_0xd215('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd215('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd215('0x1')]},'transfer':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd215('0x1')],'comment':_0xd215('0x5')},'transferexten':{'type':Sequelize[_0xd215('0x1')]},'transferuniqueid':{'type':Sequelize[_0xd215('0x1')]},'agententerreason':{'type':Sequelize[_0xd215('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x48ac=['STRING','DATE','BOOLEAN','INTEGER','exports'];(function(_0x56fe8d,_0x40acbd){var _0x3bc23d=function(_0x2882a8){while(--_0x2882a8){_0x56fe8d['push'](_0x56fe8d['shift']());}};_0x3bc23d(++_0x40acbd);}(_0x48ac,0xe0));var _0xc48a=function(_0x315a30,_0x3f0006){_0x315a30=_0x315a30-0x0;var _0x27aa8a=_0x48ac[_0x315a30];return _0x27aa8a;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc48a('0x1')]},'calleridnum':{'type':Sequelize[_0xc48a('0x1')]},'calleridname':{'type':Sequelize[_0xc48a('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc48a('0x1')]},'membername':{'type':Sequelize[_0xc48a('0x1')]},'agentcalledAt':{'type':Sequelize[_0xc48a('0x2')]},'agentconnectAt':{'type':Sequelize[_0xc48a('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xc48a('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc48a('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc48a('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xc48a('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc48a('0x4')]},'reason':{'type':Sequelize[_0xc48a('0x1')]},'lastevent':{'type':Sequelize[_0xc48a('0x1')]},'channel':{'type':Sequelize[_0xc48a('0x1')]},'channelstate':{'type':Sequelize[_0xc48a('0x4')]},'channelstatedesc':{'type':Sequelize[_0xc48a('0x1')]},'connectedlinenum':{'type':Sequelize[_0xc48a('0x1')]},'connectedlinename':{'type':Sequelize[_0xc48a('0x1')]},'language':{'type':Sequelize[_0xc48a('0x1')]},'accountcode':{'type':Sequelize[_0xc48a('0x1')]},'context':{'type':Sequelize[_0xc48a('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc48a('0x1')]},'destchannel':{'type':Sequelize[_0xc48a('0x1')]},'destchannelstate':{'type':Sequelize[_0xc48a('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc48a('0x1')]},'destcalleridname':{'type':Sequelize[_0xc48a('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xc48a('0x1')]},'destlanguage':{'type':Sequelize[_0xc48a('0x1')]},'destaccountcode':{'type':Sequelize[_0xc48a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc48a('0x1')]},'destpriority':{'type':Sequelize[_0xc48a('0x1')]},'destuniqueid':{'type':Sequelize[_0xc48a('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xc48a('0x1')]},'transfer':{'type':Sequelize[_0xc48a('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xc48a('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xc48a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 9a2a75c..7aa1088 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(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 aaf88c9..8e53f1d 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 _0x1a8f=['request-promise','exports','VoiceAgentReport','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2c5b42,_0x1b0576){var _0x5f18d5=function(_0xa6dab6){while(--_0xa6dab6){_0x2c5b42['push'](_0x2c5b42['shift']());}};_0x5f18d5(++_0x1b0576);}(_0x1a8f,0x87));var _0xf1a8=function(_0x361078,_0x283dcb){_0x361078=_0x361078-0x0;var _0x22d9e8=_0x1a8f[_0x361078];return _0x22d9e8;};'use strict';var _=require(_0xf1a8('0x0'));var util=require('util');var logger=require(_0xf1a8('0x1'))(_0xf1a8('0x2'));var moment=require(_0xf1a8('0x3'));var BPromise=require(_0xf1a8('0x4'));var rp=require(_0xf1a8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xf1a8('0x6')]=function(_0x515ff3,_0x29dc33){return _0x515ff3['define'](_0xf1a8('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xf1a8('0x8'),_0xf1a8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe132=['report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','VoiceAgentReport'];(function(_0x1e919c,_0x4987ef){var _0xaf5297=function(_0x491479){while(--_0x491479){_0x1e919c['push'](_0x1e919c['shift']());}};_0xaf5297(++_0x4987ef);}(_0xe132,0x162));var _0x2e13=function(_0x6cb262,_0x124cce){_0x6cb262=_0x6cb262-0x0;var _0x12bb02=_0xe132[_0x6cb262];return _0x12bb02;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2e13('0xb'),_0x2e13('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 270b8df..d7df440 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 _0x8f65=['stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','catch','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x12d534,_0x5d3562){var _0x5ca4b0=function(_0x3f7204){while(--_0x3f7204){_0x12d534['push'](_0x12d534['shift']());}};_0x5ca4b0(++_0x5d3562);}(_0x8f65,0xb5));var _0x58f6=function(_0xe11a0c,_0x493568){_0xe11a0c=_0xe11a0c-0x0;var _0x1be886=_0x8f65[_0xe11a0c];return _0x1be886;};'use strict';var _=require(_0x58f6('0x0'));var util=require(_0x58f6('0x1'));var moment=require(_0x58f6('0x2'));var BPromise=require(_0x58f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58f6('0x4'))['db'];var utils=require(_0x58f6('0x5'));var logger=require(_0x58f6('0x6'))(_0x58f6('0x7'));var config=require('../../config/environment');var jayson=require(_0x58f6('0x8'));var client=jayson[_0x58f6('0x9')][_0x58f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4512e9,_0x3ea317,_0x26fbec){return new BPromise(function(_0x27fcc9,_0x1ad3e8){return client[_0x58f6('0xb')](_0x4512e9,_0x26fbec)[_0x58f6('0xc')](function(_0x25d465){logger[_0x58f6('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3ea317,'request\x20sent');logger[_0x58f6('0xe')](_0x58f6('0xf'),_0x3ea317,_0x58f6('0x10'),JSON[_0x58f6('0x11')](_0x25d465));if(_0x25d465[_0x58f6('0x12')]){if(_0x25d465[_0x58f6('0x12')][_0x58f6('0x13')]===0x1f4){logger['error'](_0x58f6('0x14'),_0x3ea317,_0x25d465[_0x58f6('0x12')]['message']);return _0x1ad3e8(_0x25d465[_0x58f6('0x12')]['message']);}logger[_0x58f6('0x12')](_0x58f6('0x14'),_0x3ea317,_0x25d465[_0x58f6('0x12')][_0x58f6('0x15')]);return _0x27fcc9(_0x25d465['error'][_0x58f6('0x15')]);}else{logger[_0x58f6('0xd')](_0x58f6('0x14'),_0x3ea317,_0x58f6('0x10'));_0x27fcc9(_0x25d465['result']['message']);}})['catch'](function(_0x41a534){logger[_0x58f6('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x3ea317,_0x41a534);_0x1ad3e8(_0x41a534);});});}exports[_0x58f6('0x16')]=function(_0x179004){var _0x353e4e=this;return new Promise(function(_0x2f395c,_0x29b924){return db[_0x58f6('0x17')][_0x58f6('0x18')](_0x179004[_0x58f6('0x19')],{'raw':_0x179004[_0x58f6('0x1a')]?_0x179004[_0x58f6('0x1a')][_0x58f6('0x1b')]===undefined?!![]:![]:!![]})[_0x58f6('0xc')](function(_0x43a4af){logger['info'](_0x58f6('0x16'),_0x179004);logger[_0x58f6('0xe')](_0x58f6('0x16'),_0x179004,JSON[_0x58f6('0x11')](_0x43a4af));_0x2f395c(_0x43a4af);})[_0x58f6('0x1c')](function(_0x62660){logger[_0x58f6('0x12')](_0x58f6('0x16'),_0x62660[_0x58f6('0x15')],_0x179004);_0x29b924(_0x353e4e['error'](0x1f4,_0x62660['message']));});});};exports[_0x58f6('0x1d')]=function(_0x470967){var _0x597a36=this;return new Promise(function(_0x53ec54,_0x14e885){return db['VoiceAgentReport'][_0x58f6('0x1e')](_0x470967[_0x58f6('0x19')],{'raw':_0x470967[_0x58f6('0x1a')]?_0x470967['options'][_0x58f6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x470967[_0x58f6('0x1a')]?_0x470967[_0x58f6('0x1a')]['where']||null:null,'attributes':_0x470967[_0x58f6('0x1a')]?_0x470967[_0x58f6('0x1a')][_0x58f6('0x1f')]||null:null,'limit':_0x470967[_0x58f6('0x1a')]?_0x470967[_0x58f6('0x1a')][_0x58f6('0x20')]||null:null})[_0x58f6('0xc')](function(_0x58cf1c){logger[_0x58f6('0xd')](_0x58f6('0x1d'),_0x470967);logger['debug'](_0x58f6('0x1d'),_0x470967,JSON['stringify'](_0x58cf1c));_0x53ec54(_0x58cf1c);})[_0x58f6('0x1c')](function(_0x5b39df){logger[_0x58f6('0x12')]('UpdateVoiceAgentReport',_0x5b39df[_0x58f6('0x15')],_0x470967);_0x14e885(_0x597a36[_0x58f6('0x12')](0x1f4,_0x5b39df[_0x58f6('0x15')]));});});}; \ No newline at end of file +var _0xf779=['UpdateVoiceAgentReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xf779,0x1b5));var _0x9f77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf779[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9f77('0x0'));var util=require(_0x9f77('0x1'));var moment=require(_0x9f77('0x2'));var BPromise=require(_0x9f77('0x3'));var rs=require(_0x9f77('0x4'));var fs=require('fs');var Redis=require(_0x9f77('0x5'));var db=require(_0x9f77('0x6'))['db'];var utils=require(_0x9f77('0x7'));var logger=require('../../config/logger')(_0x9f77('0x8'));var config=require('../../config/environment');var jayson=require(_0x9f77('0x9'));var client=jayson['client'][_0x9f77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x606075,_0x1fab3a,_0x42294c){return new BPromise(function(_0x4b674c,_0x4aa6e6){return client[_0x9f77('0xb')](_0x606075,_0x42294c)[_0x9f77('0xc')](function(_0x111bc6){logger[_0x9f77('0xd')](_0x9f77('0xe'),_0x1fab3a,'request\x20sent');logger[_0x9f77('0xf')](_0x9f77('0x10'),_0x1fab3a,_0x9f77('0x11'),JSON[_0x9f77('0x12')](_0x111bc6));if(_0x111bc6[_0x9f77('0x13')]){if(_0x111bc6[_0x9f77('0x13')]['code']===0x1f4){logger[_0x9f77('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1fab3a,_0x111bc6[_0x9f77('0x13')][_0x9f77('0x14')]);return _0x4aa6e6(_0x111bc6['error'][_0x9f77('0x14')]);}logger[_0x9f77('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x1fab3a,_0x111bc6[_0x9f77('0x13')][_0x9f77('0x14')]);return _0x4b674c(_0x111bc6['error'][_0x9f77('0x14')]);}else{logger[_0x9f77('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x1fab3a,_0x9f77('0x11'));_0x4b674c(_0x111bc6[_0x9f77('0x15')]['message']);}})[_0x9f77('0x16')](function(_0x23bdb6){logger[_0x9f77('0x13')](_0x9f77('0xe'),_0x1fab3a,_0x23bdb6);_0x4aa6e6(_0x23bdb6);});});}exports[_0x9f77('0x17')]=function(_0x705a7b){var _0xf2e976=this;return new Promise(function(_0x24e071,_0x4b64ea){return db[_0x9f77('0x18')]['create'](_0x705a7b[_0x9f77('0x19')],{'raw':_0x705a7b['options']?_0x705a7b[_0x9f77('0x1a')][_0x9f77('0x1b')]===undefined?!![]:![]:!![]})[_0x9f77('0xc')](function(_0x33d23d){logger[_0x9f77('0xd')](_0x9f77('0x17'),_0x705a7b);logger[_0x9f77('0xf')](_0x9f77('0x17'),_0x705a7b,JSON[_0x9f77('0x12')](_0x33d23d));_0x24e071(_0x33d23d);})[_0x9f77('0x16')](function(_0x51aaf6){logger[_0x9f77('0x13')](_0x9f77('0x17'),_0x51aaf6[_0x9f77('0x14')],_0x705a7b);_0x4b64ea(_0xf2e976[_0x9f77('0x13')](0x1f4,_0x51aaf6[_0x9f77('0x14')]));});});};exports[_0x9f77('0x1c')]=function(_0xe479fc){var _0x20be12=this;return new Promise(function(_0x1bc6b2,_0x1de6d2){return db[_0x9f77('0x18')][_0x9f77('0x1d')](_0xe479fc[_0x9f77('0x19')],{'raw':_0xe479fc[_0x9f77('0x1a')]?_0xe479fc[_0x9f77('0x1a')][_0x9f77('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe479fc[_0x9f77('0x1a')]?_0xe479fc['options']['where']||null:null,'attributes':_0xe479fc['options']?_0xe479fc[_0x9f77('0x1a')]['attributes']||null:null,'limit':_0xe479fc[_0x9f77('0x1a')]?_0xe479fc[_0x9f77('0x1a')][_0x9f77('0x1e')]||null:null})['then'](function(_0x1d6fcb){logger[_0x9f77('0xd')](_0x9f77('0x1c'),_0xe479fc);logger[_0x9f77('0xf')](_0x9f77('0x1c'),_0xe479fc,JSON[_0x9f77('0x12')](_0x1d6fcb));_0x1bc6b2(_0x1d6fcb);})[_0x9f77('0x16')](function(_0x3a03c7){logger['error'](_0x9f77('0x1c'),_0x3a03c7['message'],_0xe479fc);_0x1de6d2(_0x20be12[_0x9f77('0x13')](0x1f4,_0x3a03c7[_0x9f77('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index d672e2f..6d303c3 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 _0xf2ca=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','delete'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x21e034,_0x59fc14){_0x21e034=_0x21e034-0x0;var _0x1faab3=_0xf2ca[_0x21e034];return _0x1faab3;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./voiceCallReport.controller');router[_0xaf2c('0x9')]('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xb')]);router[_0xaf2c('0x9')]('/describe',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xc')]);router['get'](_0xaf2c('0xd'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['post']('/',auth[_0xaf2c('0xa')](),controller[_0xaf2c('0xf')]);router[_0xaf2c('0x10')](_0xaf2c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaf2c('0x11')](_0xaf2c('0xd'),auth[_0xaf2c('0xa')](),controller[_0xaf2c('0x12')]);module[_0xaf2c('0x13')]=router; \ No newline at end of file +var _0x29d4=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','destroy','exports','multer','path','connect-timeout'];(function(_0x174490,_0x457074){var _0x4a6446=function(_0x1e6f73){while(--_0x1e6f73){_0x174490['push'](_0x174490['shift']());}};_0x4a6446(++_0x457074);}(_0x29d4,0x1a1));var _0x429d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x29d4[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),auth['isAuthenticated'](),controller[_0x429d('0xd')]);router['get'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0xf')]);router['post']('/',auth[_0x429d('0xa')](),controller[_0x429d('0x10')]);router['put'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x11')]);router['delete'](_0x429d('0xe'),auth[_0x429d('0xa')](),controller[_0x429d('0x12')]);module[_0x429d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index fa31349..8d8377a 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 _0x7fdd=['STRING','ENUM','outbound','dialer','TEXT','DATE','INTEGER','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fdd,0x18f));var _0xd7fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7fdd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xd7fd('0x0')]={'uniqueid':{'type':Sequelize[_0xd7fd('0x1')]},'type':{'type':Sequelize[_0xd7fd('0x2')]('inbound','internal',_0xd7fd('0x3'),'inbound-fax','outbound-fax',_0xd7fd('0x4'))},'tag':{'type':Sequelize[_0xd7fd('0x1')]},'accountcode':{'type':Sequelize[_0xd7fd('0x1')]},'source':{'type':Sequelize[_0xd7fd('0x1')]},'destination':{'type':Sequelize[_0xd7fd('0x1')]},'destinationcontext':{'type':Sequelize[_0xd7fd('0x1')]},'callerid':{'type':Sequelize[_0xd7fd('0x1')]},'channel':{'type':Sequelize[_0xd7fd('0x1')]},'destinationchannel':{'type':Sequelize[_0xd7fd('0x1')]},'lastapplication':{'type':Sequelize[_0xd7fd('0x1')]},'lastdata':{'type':Sequelize[_0xd7fd('0x5')]},'starttime':{'type':Sequelize[_0xd7fd('0x6')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xd7fd('0x6')]},'endtime':{'type':Sequelize[_0xd7fd('0x6')]},'duration':{'type':Sequelize[_0xd7fd('0x7')]},'billableseconds':{'type':Sequelize[_0xd7fd('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd7fd('0x1')]},'amaflags':{'type':Sequelize[_0xd7fd('0x1')]},'userfield':{'type':Sequelize[_0xd7fd('0x1')]},'userDisposition':{'type':Sequelize[_0xd7fd('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xd7fd('0x1')]},'note':{'type':Sequelize[_0xd7fd('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xd7fd('0x1')]}}; \ No newline at end of file +var _0xa1e0=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','TEXT'];(function(_0x50aa80,_0x2927a5){var _0x3ac6af=function(_0x47bd85){while(--_0x47bd85){_0x50aa80['push'](_0x50aa80['shift']());}};_0x3ac6af(++_0x2927a5);}(_0xa1e0,0xb2));var _0x0a1e=function(_0x32b493,_0x264127){_0x32b493=_0x32b493-0x0;var _0x42b6f4=_0xa1e0[_0x32b493];return _0x42b6f4;};'use strict';var Sequelize=require(_0x0a1e('0x0'));module[_0x0a1e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a1e('0x2')]},'type':{'type':Sequelize[_0x0a1e('0x3')](_0x0a1e('0x4'),'internal',_0x0a1e('0x5'),_0x0a1e('0x6'),_0x0a1e('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0a1e('0x2')]},'source':{'type':Sequelize[_0x0a1e('0x2')]},'destination':{'type':Sequelize[_0x0a1e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a1e('0x2')]},'callerid':{'type':Sequelize[_0x0a1e('0x2')]},'channel':{'type':Sequelize[_0x0a1e('0x2')]},'destinationchannel':{'type':Sequelize[_0x0a1e('0x2')]},'lastapplication':{'type':Sequelize[_0x0a1e('0x2')]},'lastdata':{'type':Sequelize[_0x0a1e('0x8')]},'starttime':{'type':Sequelize[_0x0a1e('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0a1e('0x9')]},'endtime':{'type':Sequelize[_0x0a1e('0x9')]},'duration':{'type':Sequelize[_0x0a1e('0xa')]},'billableseconds':{'type':Sequelize[_0x0a1e('0xa')]},'mohtime':{'type':Sequelize[_0x0a1e('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0a1e('0x2')]},'userfield':{'type':Sequelize[_0x0a1e('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a1e('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0a1e('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 34087d3..6bcb33d 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 _0x0b0e=['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','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x30bb57,_0x3df186){var _0x2f139f=function(_0x110926){while(--_0x110926){_0x30bb57['push'](_0x30bb57['shift']());}};_0x2f139f(++_0x3df186);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0x0b0e[_0x25ccbe];return _0x289529;};'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['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xadb5,0xad));var _0x5adb=function(_0x28be48,_0x401958){_0x28be48=_0x28be48-0x0;var _0x1dc8a9=_0xadb5[_0x28be48];return _0x1dc8a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f7493a0..6349f75 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 _0x271e=['./voiceCallReport.attributes','exports','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58fac9,_0x290a65){var _0x35da60=function(_0xff9be0){while(--_0xff9be0){_0x58fac9['push'](_0x58fac9['shift']());}};_0x35da60(++_0x290a65);}(_0x271e,0x123));var _0xe271=function(_0x27688b,_0x2cd85b){_0x27688b=_0x27688b-0x0;var _0x2630c7=_0x271e[_0x27688b];return _0x2630c7;};'use strict';var _=require(_0xe271('0x0'));var util=require(_0xe271('0x1'));var logger=require(_0xe271('0x2'))(_0xe271('0x3'));var moment=require(_0xe271('0x4'));var BPromise=require(_0xe271('0x5'));var rp=require(_0xe271('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe271('0x7'));var config=require(_0xe271('0x8'));var attributes=require(_0xe271('0x9'));module[_0xe271('0xa')]=function(_0xc8765d,_0x27742d){return _0xc8765d['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xe271('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d92=['request-promise','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x8d92,0x124));var _0x28d9=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0x8d92[_0x418549];return _0x288826;};'use strict';var _=require(_0x28d9('0x0'));var util=require(_0x28d9('0x1'));var logger=require(_0x28d9('0x2'))('api');var moment=require(_0x28d9('0x3'));var BPromise=require(_0x28d9('0x4'));var rp=require(_0x28d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x28d9('0x6'));var attributes=require(_0x28d9('0x7'));module[_0x28d9('0x8')]=function(_0x2dda65,_0x41a40a){return _0x2dda65['define']('VoiceCallReport',attributes,{'tableName':_0x28d9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x28d9('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 dbdac6d..88b3b05 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 _0x4051=['include','map','model','info','CreateVoiceCallReport','create','body','then','UpdateVoiceCallReport','update','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit'];(function(_0x2fb03a,_0x33595d){var _0x2fd4c1=function(_0x251eb9){while(--_0x251eb9){_0x2fb03a['push'](_0x2fb03a['shift']());}};_0x2fd4c1(++_0x33595d);}(_0x4051,0xb4));var _0x1405=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4051[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1405('0x0'));var BPromise=require(_0x1405('0x1'));var rs=require(_0x1405('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1405('0x3'))['db'];var utils=require(_0x1405('0x4'));var logger=require('../../config/logger')(_0x1405('0x5'));var config=require('../../config/environment');var jayson=require(_0x1405('0x6'));var client=jayson[_0x1405('0x7')][_0x1405('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ba72a,_0x519f32,_0x381f77){return new BPromise(function(_0x293069,_0x27bf8f){return client['request'](_0x2ba72a,_0x381f77)['then'](function(_0x50537c){logger['info'](_0x1405('0x9'),_0x519f32,_0x1405('0xa'));logger[_0x1405('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x519f32,_0x1405('0xa'),JSON[_0x1405('0xc')](_0x50537c));if(_0x50537c['error']){if(_0x50537c['error'][_0x1405('0xd')]===0x1f4){logger[_0x1405('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x519f32,_0x50537c[_0x1405('0xe')][_0x1405('0xf')]);return _0x27bf8f(_0x50537c[_0x1405('0xe')][_0x1405('0xf')]);}logger['error'](_0x1405('0x9'),_0x519f32,_0x50537c[_0x1405('0xe')][_0x1405('0xf')]);return _0x293069(_0x50537c['error'][_0x1405('0xf')]);}else{logger['info'](_0x1405('0x9'),_0x519f32,_0x1405('0xa'));_0x293069(_0x50537c['result'][_0x1405('0xf')]);}})[_0x1405('0x10')](function(_0x3cab9c){logger[_0x1405('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x519f32,_0x3cab9c);_0x27bf8f(_0x3cab9c);});});}exports[_0x1405('0x11')]=function(_0x4593fb){var _0xf57a4e=this;return new Promise(function(_0x4de8f1,_0x2eb64d){return db[_0x1405('0x12')]['findAll']({'raw':_0x4593fb[_0x1405('0x13')]?_0x4593fb[_0x1405('0x13')][_0x1405('0x14')]===undefined?!![]:![]:!![],'where':_0x4593fb[_0x1405('0x13')]?_0x4593fb['options'][_0x1405('0x15')]||null:null,'attributes':_0x4593fb[_0x1405('0x13')]?_0x4593fb[_0x1405('0x13')][_0x1405('0x16')]||null:null,'limit':_0x4593fb[_0x1405('0x13')]?_0x4593fb[_0x1405('0x13')][_0x1405('0x17')]||null:null,'include':_0x4593fb['options']?_0x4593fb[_0x1405('0x13')][_0x1405('0x18')]?_['map'](_0x4593fb['options'][_0x1405('0x18')],function(_0x4dc979){return{'model':db[_0x4dc979['model']],'as':_0x4dc979['as'],'attributes':_0x4dc979[_0x1405('0x16')],'include':_0x4dc979[_0x1405('0x18')]?_[_0x1405('0x19')](_0x4dc979[_0x1405('0x18')],function(_0x50af00){return{'model':db[_0x50af00[_0x1405('0x1a')]],'as':_0x50af00['as'],'attributes':_0x50af00[_0x1405('0x16')],'include':_0x50af00[_0x1405('0x18')]?_[_0x1405('0x19')](_0x50af00[_0x1405('0x18')],function(_0x1f3604){return{'model':db[_0x1f3604['model']],'as':_0x1f3604['as'],'attributes':_0x1f3604[_0x1405('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x589f47){logger[_0x1405('0x1b')]('GetVoiceCallReport',_0x4593fb);logger[_0x1405('0xb')](_0x1405('0x11'),_0x4593fb,JSON[_0x1405('0xc')](_0x589f47));_0x4de8f1(_0x589f47);})['catch'](function(_0x1f8154){logger[_0x1405('0xe')](_0x1405('0x11'),_0x1f8154[_0x1405('0xf')],_0x4593fb);_0x2eb64d(_0xf57a4e[_0x1405('0xe')](0x1f4,_0x1f8154[_0x1405('0xf')]));});});};exports[_0x1405('0x1c')]=function(_0x2eb851){var _0x2cdbb8=this;return new Promise(function(_0x58f9ec,_0x368bdc){return db[_0x1405('0x12')][_0x1405('0x1d')](_0x2eb851[_0x1405('0x1e')],{'raw':_0x2eb851[_0x1405('0x13')]?_0x2eb851['options']['raw']===undefined?!![]:![]:!![]})[_0x1405('0x1f')](function(_0x27f12b){logger['info'](_0x1405('0x1c'),_0x2eb851);logger['debug'](_0x1405('0x1c'),_0x2eb851,JSON[_0x1405('0xc')](_0x27f12b));_0x58f9ec(_0x27f12b);})['catch'](function(_0x14e151){logger[_0x1405('0xe')](_0x1405('0x1c'),_0x14e151[_0x1405('0xf')],_0x2eb851);_0x368bdc(_0x2cdbb8['error'](0x1f4,_0x14e151[_0x1405('0xf')]));});});};exports[_0x1405('0x20')]=function(_0x50070d){var _0x4c064c=this;return new Promise(function(_0x39586c,_0x4143a4){return db[_0x1405('0x12')][_0x1405('0x21')](_0x50070d[_0x1405('0x1e')],{'raw':_0x50070d[_0x1405('0x13')]?_0x50070d['options'][_0x1405('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50070d[_0x1405('0x13')]?_0x50070d[_0x1405('0x13')][_0x1405('0x15')]||null:null,'attributes':_0x50070d[_0x1405('0x13')]?_0x50070d[_0x1405('0x13')][_0x1405('0x16')]||null:null,'limit':_0x50070d[_0x1405('0x13')]?_0x50070d[_0x1405('0x13')][_0x1405('0x17')]||null:null})['then'](function(_0x40ba7d){logger[_0x1405('0x1b')]('UpdateVoiceCallReport',_0x50070d);logger['debug']('UpdateVoiceCallReport',_0x50070d,JSON[_0x1405('0xc')](_0x40ba7d));_0x39586c(_0x40ba7d);})[_0x1405('0x10')](function(_0x4d9f44){logger['error'](_0x1405('0x20'),_0x4d9f44[_0x1405('0xf')],_0x50070d);_0x4143a4(_0x4c064c['error'](0x1f4,_0x4d9f44[_0x1405('0xf')]));});});}; \ No newline at end of file +var _0x95a1=['raw','attributes','limit','include','map','model','create','body','CreateVoiceCallReport','where','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95a1,0x14f));var _0x195a=function(_0x2ee80b,_0x56504a){_0x2ee80b=_0x2ee80b-0x0;var _0x2c17cf=_0x95a1[_0x2ee80b];return _0x2c17cf;};'use strict';var _=require(_0x195a('0x0'));var util=require(_0x195a('0x1'));var moment=require('moment');var BPromise=require(_0x195a('0x2'));var rs=require(_0x195a('0x3'));var fs=require('fs');var Redis=require(_0x195a('0x4'));var db=require(_0x195a('0x5'))['db'];var utils=require(_0x195a('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x195a('0x7'));var client=jayson[_0x195a('0x8')][_0x195a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4014be,_0xfb2d43,_0x2bbd27){return new BPromise(function(_0x3dae99,_0x4a239f){return client['request'](_0x4014be,_0x2bbd27)[_0x195a('0xa')](function(_0x250f84){logger[_0x195a('0xb')](_0x195a('0xc'),_0xfb2d43,_0x195a('0xd'));logger[_0x195a('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xfb2d43,_0x195a('0xd'),JSON[_0x195a('0xf')](_0x250f84));if(_0x250f84[_0x195a('0x10')]){if(_0x250f84['error'][_0x195a('0x11')]===0x1f4){logger[_0x195a('0x10')](_0x195a('0xc'),_0xfb2d43,_0x250f84[_0x195a('0x10')][_0x195a('0x12')]);return _0x4a239f(_0x250f84[_0x195a('0x10')][_0x195a('0x12')]);}logger[_0x195a('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0xfb2d43,_0x250f84[_0x195a('0x10')][_0x195a('0x12')]);return _0x3dae99(_0x250f84[_0x195a('0x10')][_0x195a('0x12')]);}else{logger[_0x195a('0xb')](_0x195a('0xc'),_0xfb2d43,_0x195a('0xd'));_0x3dae99(_0x250f84[_0x195a('0x13')][_0x195a('0x12')]);}})[_0x195a('0x14')](function(_0x45bf3d){logger[_0x195a('0x10')](_0x195a('0xc'),_0xfb2d43,_0x45bf3d);_0x4a239f(_0x45bf3d);});});}exports[_0x195a('0x15')]=function(_0x2c0a82){var _0x456b65=this;return new Promise(function(_0x447f5b,_0x539188){return db[_0x195a('0x16')][_0x195a('0x17')]({'raw':_0x2c0a82[_0x195a('0x18')]?_0x2c0a82[_0x195a('0x18')][_0x195a('0x19')]===undefined?!![]:![]:!![],'where':_0x2c0a82['options']?_0x2c0a82[_0x195a('0x18')]['where']||null:null,'attributes':_0x2c0a82[_0x195a('0x18')]?_0x2c0a82[_0x195a('0x18')][_0x195a('0x1a')]||null:null,'limit':_0x2c0a82[_0x195a('0x18')]?_0x2c0a82[_0x195a('0x18')][_0x195a('0x1b')]||null:null,'include':_0x2c0a82['options']?_0x2c0a82[_0x195a('0x18')][_0x195a('0x1c')]?_['map'](_0x2c0a82[_0x195a('0x18')][_0x195a('0x1c')],function(_0x3abfca){return{'model':db[_0x3abfca['model']],'as':_0x3abfca['as'],'attributes':_0x3abfca[_0x195a('0x1a')],'include':_0x3abfca['include']?_[_0x195a('0x1d')](_0x3abfca[_0x195a('0x1c')],function(_0xf44139){return{'model':db[_0xf44139['model']],'as':_0xf44139['as'],'attributes':_0xf44139['attributes'],'include':_0xf44139['include']?_[_0x195a('0x1d')](_0xf44139[_0x195a('0x1c')],function(_0x387b1b){return{'model':db[_0x387b1b[_0x195a('0x1e')]],'as':_0x387b1b['as'],'attributes':_0x387b1b[_0x195a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x195a('0xa')](function(_0x2857c7){logger[_0x195a('0xb')](_0x195a('0x15'),_0x2c0a82);logger[_0x195a('0xe')](_0x195a('0x15'),_0x2c0a82,JSON[_0x195a('0xf')](_0x2857c7));_0x447f5b(_0x2857c7);})[_0x195a('0x14')](function(_0x3605ed){logger['error'](_0x195a('0x15'),_0x3605ed['message'],_0x2c0a82);_0x539188(_0x456b65[_0x195a('0x10')](0x1f4,_0x3605ed[_0x195a('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x110512){var _0x3509b2=this;return new Promise(function(_0x355ad4,_0x33fcec){return db['VoiceCallReport'][_0x195a('0x1f')](_0x110512[_0x195a('0x20')],{'raw':_0x110512[_0x195a('0x18')]?_0x110512[_0x195a('0x18')][_0x195a('0x19')]===undefined?!![]:![]:!![]})[_0x195a('0xa')](function(_0x16e0e2){logger[_0x195a('0xb')]('CreateVoiceCallReport',_0x110512);logger[_0x195a('0xe')](_0x195a('0x21'),_0x110512,JSON['stringify'](_0x16e0e2));_0x355ad4(_0x16e0e2);})[_0x195a('0x14')](function(_0x120d81){logger['error']('CreateVoiceCallReport',_0x120d81[_0x195a('0x12')],_0x110512);_0x33fcec(_0x3509b2['error'](0x1f4,_0x120d81[_0x195a('0x12')]));});});};exports['UpdateVoiceCallReport']=function(_0x4099fc){var _0x4dfc15=this;return new Promise(function(_0x11a8b,_0x3f00c2){return db[_0x195a('0x16')]['update'](_0x4099fc[_0x195a('0x20')],{'raw':_0x4099fc['options']?_0x4099fc[_0x195a('0x18')][_0x195a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4099fc[_0x195a('0x18')]?_0x4099fc[_0x195a('0x18')][_0x195a('0x22')]||null:null,'attributes':_0x4099fc[_0x195a('0x18')]?_0x4099fc[_0x195a('0x18')][_0x195a('0x1a')]||null:null,'limit':_0x4099fc[_0x195a('0x18')]?_0x4099fc['options'][_0x195a('0x1b')]||null:null})['then'](function(_0xd682c9){logger[_0x195a('0xb')]('UpdateVoiceCallReport',_0x4099fc);logger[_0x195a('0xe')](_0x195a('0x23'),_0x4099fc,JSON['stringify'](_0xd682c9));_0x11a8b(_0xd682c9);})[_0x195a('0x14')](function(_0x1fcd3b){logger[_0x195a('0x10')](_0x195a('0x23'),_0x1fcd3b[_0x195a('0x12')],_0x4099fc);_0x3f00c2(_0x4dfc15[_0x195a('0x10')](0x1f4,_0x1fcd3b[_0x195a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 0759b39..87598dd 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 _0x068f=['index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x068f,0x159));var _0xf068=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x068f[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xf068('0x0'));var util=require(_0xf068('0x1'));var path=require(_0xf068('0x2'));var timeout=require(_0xf068('0x3'));var express=require(_0xf068('0x4'));var router=express[_0xf068('0x5')]();var fs_extra=require(_0xf068('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf068('0x7'));var config=require(_0xf068('0x8'));var controller=require(_0xf068('0x9'));router[_0xf068('0xa')]('/',auth[_0xf068('0xb')](),controller[_0xf068('0xc')]);router[_0xf068('0xa')](_0xf068('0xd'),auth[_0xf068('0xb')](),controller[_0xf068('0xe')]);router[_0xf068('0xf')]('/',auth['isAuthenticated'](),controller[_0xf068('0x10')]);router[_0xf068('0x11')](_0xf068('0xd'),auth[_0xf068('0xb')](),controller[_0xf068('0x12')]);router['delete'](_0xf068('0xd'),auth['isAuthenticated'](),controller[_0xf068('0x13')]);module[_0xf068('0x14')]=router; \ No newline at end of file +var _0xbddc=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer','path'];(function(_0x4f9423,_0x31aeb9){var _0x41799c=function(_0x5aa068){while(--_0x5aa068){_0x4f9423['push'](_0x4f9423['shift']());}};_0x41799c(++_0x31aeb9);}(_0xbddc,0x142));var _0xcbdd=function(_0x51278f,_0x1e3f43){_0x51278f=_0x51278f-0x0;var _0x59def5=_0xbddc[_0x51278f];return _0x59def5;};'use strict';var multer=require(_0xcbdd('0x0'));var util=require('util');var path=require(_0xcbdd('0x1'));var timeout=require(_0xcbdd('0x2'));var express=require(_0xcbdd('0x3'));var router=express[_0xcbdd('0x4')]();var fs_extra=require(_0xcbdd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcbdd('0x6'));var config=require(_0xcbdd('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xcbdd('0x8')]('/',auth[_0xcbdd('0x9')](),controller[_0xcbdd('0xa')]);router[_0xcbdd('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcbdd('0xb')]);router[_0xcbdd('0xc')]('/',auth['isAuthenticated'](),controller[_0xcbdd('0xd')]);router[_0xcbdd('0xe')](_0xcbdd('0xf'),auth[_0xcbdd('0x9')](),controller[_0xcbdd('0x10')]);router[_0xcbdd('0x11')](_0xcbdd('0xf'),auth[_0xcbdd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fd008ae..f841a0b 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 _0xa1dc=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xa1dc,0xa4));var _0xca1d=function(_0x2f8c9a,_0x2b026d){_0x2f8c9a=_0x2f8c9a-0x0;var _0x1a980f=_0xa1dc[_0x2f8c9a];return _0x1a980f;};'use strict';var Sequelize=require(_0xca1d('0x0'));module[_0xca1d('0x1')]={'name':{'type':Sequelize[_0xca1d('0x2')]},'prefix':{'type':Sequelize[_0xca1d('0x2')],'unique':_0xca1d('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xca1d('0x2')],'set':function(_0x1eb3de){this[_0xca1d('0x4')](_0xca1d('0x5'),_0x1eb3de?_0x1eb3de[_0xca1d('0x6')](''):[]);},'get':function(){return this[_0xca1d('0x7')]('options')?this['getDataValue'](_0xca1d('0x5'))[_0xca1d('0x8')](''):[];}},'auth':{'type':Sequelize[_0xca1d('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xca1d('0x2')]},'record':{'type':Sequelize[_0xca1d('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xca1d('0x2')]},'description':{'type':Sequelize[_0xca1d('0x2')]}}; \ No newline at end of file +var _0x4860=['options','split','STRING','sequelize','exports','name','setDataValue','join','getDataValue'];(function(_0x56b8eb,_0x1b90ab){var _0x31494f=function(_0x865155){while(--_0x865155){_0x56b8eb['push'](_0x56b8eb['shift']());}};_0x31494f(++_0x1b90ab);}(_0x4860,0x12c));var _0x0486=function(_0x29ffe4,_0x42729e){_0x29ffe4=_0x29ffe4-0x0;var _0x6eb95c=_0x4860[_0x29ffe4];return _0x6eb95c;};'use strict';var Sequelize=require(_0x0486('0x0'));module[_0x0486('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x0486('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x24ed1f){this[_0x0486('0x3')]('options',_0x24ed1f?_0x24ed1f[_0x0486('0x4')](''):[]);},'get':function(){return this[_0x0486('0x5')](_0x0486('0x6'))?this[_0x0486('0x5')]('options')[_0x0486('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x0486('0x8')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0486('0x8')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 72bb238..81d3d69 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 _0x2209=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','count','set','Content-Range','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','map','VoiceChanSpy','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','merge','find','create','body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse'];(function(_0x413766,_0x501853){var _0x5ebf93=function(_0x4698c4){while(--_0x4698c4){_0x413766['push'](_0x413766['shift']());}};_0x5ebf93(++_0x501853);}(_0x2209,0x95));var _0x9220=function(_0x439bda,_0x4f26c1){_0x439bda=_0x439bda-0x0;var _0x571e00=_0x2209[_0x439bda];return _0x571e00;};'use strict';var emlformat=require(_0x9220('0x0'));var rimraf=require(_0x9220('0x1'));var zipdir=require(_0x9220('0x2'));var jsonpatch=require(_0x9220('0x3'));var rp=require(_0x9220('0x4'));var moment=require('moment');var BPromise=require(_0x9220('0x5'));var Mustache=require('mustache');var util=require(_0x9220('0x6'));var path=require(_0x9220('0x7'));var sox=require(_0x9220('0x8'));var csv=require(_0x9220('0x9'));var ejs=require(_0x9220('0xa'));var fs=require('fs');var fs_extra=require(_0x9220('0xb'));var _=require(_0x9220('0xc'));var squel=require(_0x9220('0xd'));var crypto=require(_0x9220('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9220('0xf'));var toCsv=require(_0x9220('0x9'));var querystring=require('querystring');var Papa=require(_0x9220('0x10'));var Redis=require(_0x9220('0x11'));var authService=require(_0x9220('0x12'));var qs=require(_0x9220('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9220('0x14'));var logger=require(_0x9220('0x15'))(_0x9220('0x16'));var utils=require(_0x9220('0x17'));var config=require(_0x9220('0x18'));var licenseUtil=require(_0x9220('0x19'));var db=require(_0x9220('0x1a'))['db'];function respondWithStatusCode(_0x2d65d4,_0x4c58e9){_0x4c58e9=_0x4c58e9||0xcc;return function(_0x2cbe2a){if(_0x2cbe2a){return _0x2d65d4['sendStatus'](_0x4c58e9);}return _0x2d65d4[_0x9220('0x1b')](_0x4c58e9)['end']();};}function respondWithResult(_0x6c9ba4,_0x4d8bf1){_0x4d8bf1=_0x4d8bf1||0xc8;return function(_0xa13cd){if(_0xa13cd){return _0x6c9ba4[_0x9220('0x1b')](_0x4d8bf1)[_0x9220('0x1c')](_0xa13cd);}};}function respondWithFilteredResult(_0x1f7bf7,_0x493744){return function(_0x3fe2c1){if(_0x3fe2c1){var _0x1f484b=typeof _0x493744['offset']==='undefined'&&typeof _0x493744[_0x9220('0x1d')]==='undefined';var _0x388089=_0x3fe2c1[_0x9220('0x1e')];var _0x44713f=_0x1f484b?0x0:_0x493744['offset'];var _0x4a9507=_0x1f484b?_0x3fe2c1[_0x9220('0x1e')]:_0x493744['offset']+_0x493744[_0x9220('0x1d')];var _0x558c28;if(_0x4a9507>=_0x388089){_0x4a9507=_0x388089;_0x558c28=0xc8;}else{_0x558c28=0xce;}_0x1f7bf7['status'](_0x558c28);return _0x1f7bf7[_0x9220('0x1f')](_0x9220('0x20'),_0x44713f+'-'+_0x4a9507+'/'+_0x388089)[_0x9220('0x1c')](_0x3fe2c1);}return null;};}function patchUpdates(_0x16626d){return function(_0x2ded94){try{jsonpatch[_0x9220('0x21')](_0x2ded94,_0x16626d,!![]);}catch(_0x3c13b1){return BPromise[_0x9220('0x22')](_0x3c13b1);}return _0x2ded94[_0x9220('0x23')]();};}function saveUpdates(_0x9d19fe,_0x462798){return function(_0x2eb9f3){if(_0x2eb9f3){return _0x2eb9f3[_0x9220('0x24')](_0x9d19fe)['then'](function(_0x1cfabf){return _0x1cfabf;});}return null;};}function removeEntity(_0x379c1f,_0x48ee62){return function(_0xfde27f){if(_0xfde27f){return _0xfde27f['destroy']()[_0x9220('0x25')](function(){var _0x293b63=_0xfde27f[_0x9220('0x26')]({'plain':!![]});var _0x284ed7=_0x9220('0x27');return db[_0x9220('0x28')]['destroy']({'where':{'type':_0x284ed7,'resourceId':_0x293b63['id']}})[_0x9220('0x25')](function(){return _0xfde27f;});})[_0x9220('0x25')](function(){_0x379c1f[_0x9220('0x1b')](0xcc)[_0x9220('0x29')]();});}};}function handleEntityNotFound(_0x5594c8,_0x5e6918){return function(_0x330268){if(!_0x330268){_0x5594c8[_0x9220('0x2a')](0x194);}return _0x330268;};}function handleError(_0x173472,_0x5c001c){_0x5c001c=_0x5c001c||0x1f4;return function(_0x57bcb3){logger[_0x9220('0x2b')](_0x57bcb3[_0x9220('0x2c')]);if(_0x57bcb3['name']){delete _0x57bcb3[_0x9220('0x2d')];}_0x173472[_0x9220('0x1b')](_0x5c001c)[_0x9220('0x2e')](_0x57bcb3);};}exports['index']=function(_0x18bb7d,_0x21376b){var _0x1e23d1={},_0x3737f8={},_0x14fee4={'count':0x0,'rows':[]};var _0x107fcd=_[_0x9220('0x2f')](db[_0x9220('0x30')][_0x9220('0x31')],function(_0x3e6e91){return{'name':_0x3e6e91['fieldName'],'type':_0x3e6e91[_0x9220('0x32')][_0x9220('0x33')]};});_0x3737f8['model']=_['map'](_0x107fcd,_0x9220('0x2d'));_0x3737f8['query']=_[_0x9220('0x34')](_0x18bb7d[_0x9220('0x35')]);_0x3737f8[_0x9220('0x36')]=_[_0x9220('0x37')](_0x3737f8[_0x9220('0x38')],_0x3737f8[_0x9220('0x35')]);_0x1e23d1['attributes']=_[_0x9220('0x37')](_0x3737f8[_0x9220('0x38')],qs[_0x9220('0x39')](_0x18bb7d[_0x9220('0x35')][_0x9220('0x39')]));_0x1e23d1[_0x9220('0x3a')]=_0x1e23d1[_0x9220('0x3a')]['length']?_0x1e23d1['attributes']:_0x3737f8['model'];if(!_0x18bb7d[_0x9220('0x35')]['hasOwnProperty'](_0x9220('0x3b'))){_0x1e23d1[_0x9220('0x1d')]=qs[_0x9220('0x1d')](_0x18bb7d[_0x9220('0x35')]['limit']);_0x1e23d1[_0x9220('0x3c')]=qs[_0x9220('0x3c')](_0x18bb7d[_0x9220('0x35')][_0x9220('0x3c')]);}_0x1e23d1[_0x9220('0x3d')]=qs[_0x9220('0x3e')](_0x18bb7d[_0x9220('0x35')][_0x9220('0x3e')]);_0x1e23d1['where']=qs['filters'](_[_0x9220('0x3f')](_0x18bb7d[_0x9220('0x35')],_0x3737f8[_0x9220('0x36')]),_0x107fcd);if(_0x18bb7d[_0x9220('0x35')][_0x9220('0x40')]){_0x1e23d1['where']=_['merge'](_0x1e23d1[_0x9220('0x41')],{'$or':_[_0x9220('0x2f')](_0x107fcd,function(_0x4968d){if(_0x4968d[_0x9220('0x32')]!==_0x9220('0x42')){var _0x19fd74={};_0x19fd74[_0x4968d[_0x9220('0x2d')]]={'$like':'%'+_0x18bb7d[_0x9220('0x35')][_0x9220('0x40')]+'%'};return _0x19fd74;}})});}_0x1e23d1=_['merge']({},_0x1e23d1,_0x18bb7d[_0x9220('0x43')]);var _0x3d3410={'where':_0x1e23d1[_0x9220('0x41')]};return db['VoiceChanSpy'][_0x9220('0x1e')](_0x3d3410)[_0x9220('0x25')](function(_0x22169b){_0x14fee4[_0x9220('0x1e')]=_0x22169b;if(_0x18bb7d[_0x9220('0x35')]['includeAll']){_0x1e23d1[_0x9220('0x44')]=[{'all':!![]}];}return db[_0x9220('0x30')][_0x9220('0x45')](_0x1e23d1);})[_0x9220('0x25')](function(_0x1e8170){_0x14fee4[_0x9220('0x46')]=_0x1e8170;return _0x14fee4;})[_0x9220('0x25')](respondWithFilteredResult(_0x21376b,_0x1e23d1))[_0x9220('0x47')](handleError(_0x21376b,null));};exports['show']=function(_0x1ac4c5,_0x3510b3){var _0x5acf51={'raw':![],'where':{'id':_0x1ac4c5[_0x9220('0x48')]['id']}},_0x241cbe={};_0x241cbe[_0x9220('0x38')]=_['keys'](db[_0x9220('0x30')]['rawAttributes']);_0x241cbe[_0x9220('0x35')]=_[_0x9220('0x34')](_0x1ac4c5[_0x9220('0x35')]);_0x241cbe[_0x9220('0x36')]=_[_0x9220('0x37')](_0x241cbe[_0x9220('0x38')],_0x241cbe[_0x9220('0x35')]);_0x5acf51[_0x9220('0x3a')]=_[_0x9220('0x37')](_0x241cbe['model'],qs[_0x9220('0x39')](_0x1ac4c5[_0x9220('0x35')][_0x9220('0x39')]));_0x5acf51[_0x9220('0x3a')]=_0x5acf51[_0x9220('0x3a')][_0x9220('0x49')]?_0x5acf51['attributes']:_0x241cbe[_0x9220('0x38')];if(_0x1ac4c5[_0x9220('0x35')][_0x9220('0x4a')]){_0x5acf51[_0x9220('0x44')]=[{'all':!![]}];}_0x5acf51=_[_0x9220('0x4b')]({},_0x5acf51,_0x1ac4c5[_0x9220('0x43')]);return db[_0x9220('0x30')][_0x9220('0x4c')](_0x5acf51)[_0x9220('0x25')](handleEntityNotFound(_0x3510b3,null))[_0x9220('0x25')](respondWithResult(_0x3510b3,null))[_0x9220('0x47')](handleError(_0x3510b3,null));};exports[_0x9220('0x4d')]=function(_0x3ed09b,_0x26f07b){return db['VoiceChanSpy'][_0x9220('0x4d')](_0x3ed09b[_0x9220('0x4e')],{})['then'](function(_0x13f378){var _0x125dea=_0x3ed09b[_0x9220('0x4f')][_0x9220('0x26')]({'plain':!![]});if(!_0x125dea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x125dea[_0x9220('0x50')]==='user'){var _0x174464=_0x13f378[_0x9220('0x26')]({'plain':!![]});var _0xf6934f=_0x9220('0x27');return db[_0x9220('0x51')]['find']({'where':{'name':_0xf6934f,'userProfileId':_0x125dea['userProfileId']},'raw':!![]})[_0x9220('0x25')](function(_0x39a832){if(_0x39a832&&_0x39a832['autoAssociation']===0x0){return db[_0x9220('0x28')]['create']({'name':_0x174464['name'],'resourceId':_0x174464['id'],'type':_0x39a832[_0x9220('0x2d')],'sectionId':_0x39a832['id']},{})['then'](function(){return _0x13f378;});}else{return _0x13f378;}})[_0x9220('0x47')](function(_0x1c89cd){logger[_0x9220('0x2b')](_0x9220('0x52'),_0x1c89cd);throw _0x1c89cd;});}return _0x13f378;})['then'](respondWithResult(_0x26f07b,0xc9))[_0x9220('0x47')](handleError(_0x26f07b,null));};exports[_0x9220('0x24')]=function(_0x47dd12,_0x2e397e){if(_0x47dd12['body']['id']){delete _0x47dd12['body']['id'];}return db['VoiceChanSpy'][_0x9220('0x4c')]({'where':{'id':_0x47dd12[_0x9220('0x48')]['id']}})[_0x9220('0x25')](handleEntityNotFound(_0x2e397e,null))[_0x9220('0x25')](saveUpdates(_0x47dd12[_0x9220('0x4e')],null))['then'](respondWithResult(_0x2e397e,null))['catch'](handleError(_0x2e397e,null));};exports['destroy']=function(_0x295f0f,_0x1c5e00){return db[_0x9220('0x30')][_0x9220('0x4c')]({'where':{'id':_0x295f0f['params']['id']}})[_0x9220('0x25')](handleEntityNotFound(_0x1c5e00,null))[_0x9220('0x25')](removeEntity(_0x1c5e00,null))[_0x9220('0x47')](handleError(_0x1c5e00,null));}; \ No newline at end of file +var _0x720c=['body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','offset','count','limit','set','apply','reject','save','update','destroy','then','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','findAll','rows','catch','show','includeAll','find'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x720c,0x154));var _0xc720=function(_0x27ebe4,_0x2bcb38){_0x27ebe4=_0x27ebe4-0x0;var _0x402a55=_0x720c[_0x27ebe4];return _0x402a55;};'use strict';var emlformat=require(_0xc720('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc720('0x1'));var jsonpatch=require(_0xc720('0x2'));var rp=require(_0xc720('0x3'));var moment=require(_0xc720('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc720('0x5'));var util=require(_0xc720('0x6'));var path=require(_0xc720('0x7'));var sox=require(_0xc720('0x8'));var csv=require(_0xc720('0x9'));var ejs=require(_0xc720('0xa'));var fs=require('fs');var fs_extra=require(_0xc720('0xb'));var _=require('lodash');var squel=require(_0xc720('0xc'));var crypto=require(_0xc720('0xd'));var jsforce=require(_0xc720('0xe'));var deskjs=require(_0xc720('0xf'));var toCsv=require(_0xc720('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc720('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc720('0x11'));var as=require(_0xc720('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc720('0x13'))(_0xc720('0x14'));var utils=require(_0xc720('0x15'));var config=require(_0xc720('0x16'));var licenseUtil=require(_0xc720('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18b088,_0x40f2f6){_0x40f2f6=_0x40f2f6||0xcc;return function(_0x24b8c1){if(_0x24b8c1){return _0x18b088[_0xc720('0x18')](_0x40f2f6);}return _0x18b088['status'](_0x40f2f6)[_0xc720('0x19')]();};}function respondWithResult(_0x267bf5,_0x3df0eb){_0x3df0eb=_0x3df0eb||0xc8;return function(_0x487d64){if(_0x487d64){return _0x267bf5[_0xc720('0x1a')](_0x3df0eb)[_0xc720('0x1b')](_0x487d64);}};}function respondWithFilteredResult(_0x37f24d,_0x2f7eaf){return function(_0xebcb34){if(_0xebcb34){var _0x4f351a=typeof _0x2f7eaf['offset']===_0xc720('0x1c')&&typeof _0x2f7eaf['limit']===_0xc720('0x1c');var _0x26014e=_0xebcb34['count'];var _0x34de4c=_0x4f351a?0x0:_0x2f7eaf[_0xc720('0x1d')];var _0x195cf3=_0x4f351a?_0xebcb34[_0xc720('0x1e')]:_0x2f7eaf[_0xc720('0x1d')]+_0x2f7eaf[_0xc720('0x1f')];var _0xf92a2f;if(_0x195cf3>=_0x26014e){_0x195cf3=_0x26014e;_0xf92a2f=0xc8;}else{_0xf92a2f=0xce;}_0x37f24d[_0xc720('0x1a')](_0xf92a2f);return _0x37f24d[_0xc720('0x20')]('Content-Range',_0x34de4c+'-'+_0x195cf3+'/'+_0x26014e)['json'](_0xebcb34);}return null;};}function patchUpdates(_0x52cdf7){return function(_0x387bac){try{jsonpatch[_0xc720('0x21')](_0x387bac,_0x52cdf7,!![]);}catch(_0x1e8a00){return BPromise[_0xc720('0x22')](_0x1e8a00);}return _0x387bac[_0xc720('0x23')]();};}function saveUpdates(_0x4f0312,_0x358cfe){return function(_0x56d824){if(_0x56d824){return _0x56d824[_0xc720('0x24')](_0x4f0312)['then'](function(_0x38ac8a){return _0x38ac8a;});}return null;};}function removeEntity(_0x211aa0,_0x5ee6e7){return function(_0xfc7d7b){if(_0xfc7d7b){return _0xfc7d7b[_0xc720('0x25')]()[_0xc720('0x26')](function(){var _0x232cb1=_0xfc7d7b[_0xc720('0x27')]({'plain':!![]});var _0x141cb5=_0xc720('0x28');return db['UserProfileResource'][_0xc720('0x25')]({'where':{'type':_0x141cb5,'resourceId':_0x232cb1['id']}})[_0xc720('0x26')](function(){return _0xfc7d7b;});})['then'](function(){_0x211aa0[_0xc720('0x1a')](0xcc)[_0xc720('0x19')]();});}};}function handleEntityNotFound(_0x4ff333,_0x31603f){return function(_0x4e0d3a){if(!_0x4e0d3a){_0x4ff333[_0xc720('0x18')](0x194);}return _0x4e0d3a;};}function handleError(_0x46c41b,_0x1d7797){_0x1d7797=_0x1d7797||0x1f4;return function(_0x84d71e){logger[_0xc720('0x29')](_0x84d71e[_0xc720('0x2a')]);if(_0x84d71e[_0xc720('0x2b')]){delete _0x84d71e['name'];}_0x46c41b['status'](_0x1d7797)[_0xc720('0x2c')](_0x84d71e);};}exports[_0xc720('0x2d')]=function(_0x531cee,_0x1c1bdd){var _0x51973a={},_0x237ee9={},_0x18b9da={'count':0x0,'rows':[]};var _0x4c7618=_[_0xc720('0x2e')](db[_0xc720('0x2f')][_0xc720('0x30')],function(_0x19954b){return{'name':_0x19954b[_0xc720('0x31')],'type':_0x19954b[_0xc720('0x32')][_0xc720('0x33')]};});_0x237ee9[_0xc720('0x34')]=_[_0xc720('0x2e')](_0x4c7618,_0xc720('0x2b'));_0x237ee9['query']=_[_0xc720('0x35')](_0x531cee['query']);_0x237ee9[_0xc720('0x36')]=_['intersection'](_0x237ee9['model'],_0x237ee9[_0xc720('0x37')]);_0x51973a[_0xc720('0x38')]=_[_0xc720('0x39')](_0x237ee9[_0xc720('0x34')],qs['fields'](_0x531cee[_0xc720('0x37')][_0xc720('0x3a')]));_0x51973a['attributes']=_0x51973a[_0xc720('0x38')][_0xc720('0x3b')]?_0x51973a[_0xc720('0x38')]:_0x237ee9[_0xc720('0x34')];if(!_0x531cee['query'][_0xc720('0x3c')](_0xc720('0x3d'))){_0x51973a['limit']=qs['limit'](_0x531cee[_0xc720('0x37')][_0xc720('0x1f')]);_0x51973a['offset']=qs[_0xc720('0x1d')](_0x531cee['query'][_0xc720('0x1d')]);}_0x51973a[_0xc720('0x3e')]=qs[_0xc720('0x3f')](_0x531cee[_0xc720('0x37')][_0xc720('0x3f')]);_0x51973a['where']=qs[_0xc720('0x36')](_['pick'](_0x531cee[_0xc720('0x37')],_0x237ee9['filters']),_0x4c7618);if(_0x531cee['query'][_0xc720('0x40')]){_0x51973a[_0xc720('0x41')]=_[_0xc720('0x42')](_0x51973a[_0xc720('0x41')],{'$or':_[_0xc720('0x2e')](_0x4c7618,function(_0x517536){if(_0x517536[_0xc720('0x32')]!=='VIRTUAL'){var _0x427145={};_0x427145[_0x517536[_0xc720('0x2b')]]={'$like':'%'+_0x531cee['query'][_0xc720('0x40')]+'%'};return _0x427145;}})});}_0x51973a=_[_0xc720('0x42')]({},_0x51973a,_0x531cee[_0xc720('0x43')]);var _0x27c5c4={'where':_0x51973a[_0xc720('0x41')]};return db[_0xc720('0x2f')][_0xc720('0x1e')](_0x27c5c4)['then'](function(_0x45cf18){_0x18b9da[_0xc720('0x1e')]=_0x45cf18;if(_0x531cee[_0xc720('0x37')]['includeAll']){_0x51973a[_0xc720('0x44')]=[{'all':!![]}];}return db[_0xc720('0x2f')][_0xc720('0x45')](_0x51973a);})[_0xc720('0x26')](function(_0x5c5a3b){_0x18b9da[_0xc720('0x46')]=_0x5c5a3b;return _0x18b9da;})[_0xc720('0x26')](respondWithFilteredResult(_0x1c1bdd,_0x51973a))[_0xc720('0x47')](handleError(_0x1c1bdd,null));};exports[_0xc720('0x48')]=function(_0x53b70e,_0x25a228){var _0x3c2e99={'raw':![],'where':{'id':_0x53b70e['params']['id']}},_0x1b292e={};_0x1b292e[_0xc720('0x34')]=_[_0xc720('0x35')](db[_0xc720('0x2f')]['rawAttributes']);_0x1b292e[_0xc720('0x37')]=_[_0xc720('0x35')](_0x53b70e[_0xc720('0x37')]);_0x1b292e[_0xc720('0x36')]=_[_0xc720('0x39')](_0x1b292e[_0xc720('0x34')],_0x1b292e[_0xc720('0x37')]);_0x3c2e99[_0xc720('0x38')]=_['intersection'](_0x1b292e[_0xc720('0x34')],qs[_0xc720('0x3a')](_0x53b70e[_0xc720('0x37')][_0xc720('0x3a')]));_0x3c2e99[_0xc720('0x38')]=_0x3c2e99[_0xc720('0x38')]['length']?_0x3c2e99[_0xc720('0x38')]:_0x1b292e['model'];if(_0x53b70e[_0xc720('0x37')][_0xc720('0x49')]){_0x3c2e99[_0xc720('0x44')]=[{'all':!![]}];}_0x3c2e99=_[_0xc720('0x42')]({},_0x3c2e99,_0x53b70e['options']);return db[_0xc720('0x2f')][_0xc720('0x4a')](_0x3c2e99)[_0xc720('0x26')](handleEntityNotFound(_0x25a228,null))['then'](respondWithResult(_0x25a228,null))['catch'](handleError(_0x25a228,null));};exports['create']=function(_0x4baab4,_0x4f152c){return db[_0xc720('0x2f')]['create'](_0x4baab4[_0xc720('0x4b')],{})['then'](function(_0x3a895c){var _0x566ad8=_0x4baab4[_0xc720('0x4c')][_0xc720('0x27')]({'plain':!![]});if(!_0x566ad8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x566ad8[_0xc720('0x4d')]===_0xc720('0x4c')){var _0x5009e3=_0x3a895c[_0xc720('0x27')]({'plain':!![]});var _0x1d1d8c='ChanSpies';return db[_0xc720('0x4e')][_0xc720('0x4a')]({'where':{'name':_0x1d1d8c,'userProfileId':_0x566ad8[_0xc720('0x4f')]},'raw':!![]})[_0xc720('0x26')](function(_0x428923){if(_0x428923&&_0x428923[_0xc720('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x5009e3[_0xc720('0x2b')],'resourceId':_0x5009e3['id'],'type':_0x428923[_0xc720('0x2b')],'sectionId':_0x428923['id']},{})[_0xc720('0x26')](function(){return _0x3a895c;});}else{return _0x3a895c;}})[_0xc720('0x47')](function(_0x2778e2){logger['error'](_0xc720('0x51'),_0x2778e2);throw _0x2778e2;});}return _0x3a895c;})['then'](respondWithResult(_0x4f152c,0xc9))[_0xc720('0x47')](handleError(_0x4f152c,null));};exports[_0xc720('0x24')]=function(_0x3d97ce,_0x3e9609){if(_0x3d97ce[_0xc720('0x4b')]['id']){delete _0x3d97ce[_0xc720('0x4b')]['id'];}return db[_0xc720('0x2f')][_0xc720('0x4a')]({'where':{'id':_0x3d97ce[_0xc720('0x52')]['id']}})[_0xc720('0x26')](handleEntityNotFound(_0x3e9609,null))[_0xc720('0x26')](saveUpdates(_0x3d97ce[_0xc720('0x4b')],null))[_0xc720('0x26')](respondWithResult(_0x3e9609,null))[_0xc720('0x47')](handleError(_0x3e9609,null));};exports[_0xc720('0x25')]=function(_0x3930a4,_0x1a4bd8){return db[_0xc720('0x2f')][_0xc720('0x4a')]({'where':{'id':_0x3930a4[_0xc720('0x52')]['id']}})[_0xc720('0x26')](handleEntityNotFound(_0x1a4bd8,null))['then'](removeEntity(_0x1a4bd8,null))[_0xc720('0x47')](handleError(_0x1a4bd8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e4ff2e4..9e02c23 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 _0x88e7=['findAll','exports','models','define','VoiceChanSpy','voice_chanspy','then','length','bulkCreate','catch','destroy','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','Set','format','chanspy','record','merge','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','join','StopMixMonitor','concat','internal','User'];(function(_0x72dcf5,_0x3cf4b3){var _0x27317c=function(_0x284563){while(--_0x284563){_0x72dcf5['push'](_0x72dcf5['shift']());}};_0x27317c(++_0x3cf4b3);}(_0x88e7,0x144));var _0x788e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x88e7[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x788e('0x0'));var util=require(_0x788e('0x1'));var BPromise=require(_0x788e('0x2'));var attributes=require(_0x788e('0x3'));var getUserApplications=function(_0x46c08c,_0x524131,_0x1b4749){var _0x5b5d8a=0x1;var _0x274503=[];var _0x5ab63a={'context':_0x524131[_0x788e('0x4')]||_0x788e('0x5'),'exten':util['format'](_0x788e('0x6'),_0x46c08c[_0x788e('0x7')],_0x1b4749),'type':_0x788e('0x8'),'isApp':![],'ChanSpyId':_0x46c08c['id'],'UserId':_0x524131['id']};_0x274503[_0x788e('0x9')](_['merge']({'app':_0x788e('0xa'),'appdata':util[_0x788e('0xb')]('CDR(type)=%s',_0x788e('0xc')),'priority':_0x5b5d8a++},_0x5ab63a));if(_0x46c08c[_0x788e('0xd')]){_0x274503[_0x788e('0x9')](_[_0x788e('0xe')]({'app':'MixMonitor','appdata':util['format'](_0x788e('0xf'),_0x46c08c['recordingFormat']),'priority':_0x5b5d8a++},_0x5ab63a));}if(_0x46c08c[_0x788e('0x10')]){_0x274503[_0x788e('0x9')](_['merge']({'app':_0x788e('0x11'),'appdata':_0x46c08c[_0x788e('0x12')],'priority':_0x5b5d8a++},_0x5ab63a));}_0x274503[_0x788e('0x9')](_['merge']({'app':_0x788e('0x13'),'appdata':util[_0x788e('0xb')](_0x788e('0x14'),_0x524131[_0x788e('0x15')],_0x46c08c['options']?_0x46c08c['options'][_0x788e('0x16')](''):''),'priority':_0x5b5d8a++},_0x5ab63a));if(_0x46c08c['record']){_0x274503[_0x788e('0x9')](_[_0x788e('0xe')]({'app':_0x788e('0x17'),'priority':_0x5b5d8a++},_0x5ab63a));}return _0x274503;};var getChanSpyApplications=function(_0xe7de27,_0x135680){var _0x2d297b=[];for(var _0xd3cc29=0x0,_0x463581=0x1;_0xd3cc29<_0x135680['length'];_0xd3cc29++,_0x463581=0x1){_0x2d297b=_0x2d297b[_0x788e('0x18')](getUserApplications(_0xe7de27,_0x135680[_0xd3cc29],_0x135680[_0xd3cc29]['internal']));if(_0x135680[_0xd3cc29][_0x788e('0x19')]!=_0x135680[_0xd3cc29]['name']){_0x2d297b=_0x2d297b[_0x788e('0x18')](getUserApplications(_0xe7de27,_0x135680[_0xd3cc29],_0x135680[_0xd3cc29][_0x788e('0x15')]));}}return _0x2d297b;};var getChanSpyPromise=function(_0x41ba8b,_0x4e3ede){return new BPromise(function(_0x48b32b,_0x4eb1ad){return _0x41ba8b[_0x788e('0x1a')][_0x788e('0x1b')]({'attributes':['id',_0x788e('0x15'),_0x788e('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x5b3309){if(_0x5b3309){return _0x48b32b(getChanSpyApplications(_0x4e3ede,_0x5b3309));}return _0x48b32b([]);})['catch'](function(_0xda4b64){_0x4eb1ad(_0xda4b64);});});};module[_0x788e('0x1c')]=function(_0x589a5c,_0x344d3f){var _0x1411c1=_0x589a5c[_0x788e('0x1d')];return _0x589a5c[_0x788e('0x1e')](_0x788e('0x1f'),attributes,{'tableName':_0x788e('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc5a81e,_0x3bacf4,_0x26d65b){return getChanSpyPromise(_0x1411c1,_0xc5a81e)[_0x788e('0x21')](function(_0x4cf7d5){if(_0x4cf7d5&&_0x4cf7d5[_0x788e('0x22')]){return _0x1411c1['VoiceExtension'][_0x788e('0x23')](_0x4cf7d5);}})[_0x788e('0x21')](function(){_0x26d65b();})[_0x788e('0x24')](function(_0x567df7){_0x26d65b(_0x567df7);});},'afterUpdate':function(_0x32a9b9,_0x69a9bf,_0x3acf5f){return _0x1411c1['VoiceExtension'][_0x788e('0x25')]({'where':{'ChanSpyId':_0x32a9b9['id']}})[_0x788e('0x21')](function(){return getChanSpyPromise(_0x1411c1,_0x32a9b9);})[_0x788e('0x21')](function(_0x31733a){if(_0x31733a&&_0x31733a['length']){return _0x1411c1[_0x788e('0x26')][_0x788e('0x23')](_0x31733a);}})[_0x788e('0x21')](function(){_0x3acf5f();})[_0x788e('0x24')](function(_0x88efd2){_0x3acf5f(_0x88efd2);});},'afterDestroy':function(_0x186a3a,_0x66da0,_0x561324){return _0x1411c1[_0x788e('0x26')]['destroy']({'where':{'ChanSpyId':_0x186a3a['id']}})[_0x788e('0x21')](function(){_0x561324();})[_0x788e('0x24')](function(_0x5c7b28){_0x561324(_0x5c7b28);});}}});}; \ No newline at end of file +var _0xf14a=['push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','length','internal','concat','User','findAll','then','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record'];(function(_0x108069,_0xbd95b){var _0x39e919=function(_0x14c18f){while(--_0x14c18f){_0x108069['push'](_0x108069['shift']());}};_0x39e919(++_0xbd95b);}(_0xf14a,0xfd));var _0xaf14=function(_0x2a0704,_0x133fbd){_0x2a0704=_0x2a0704-0x0;var _0x24243a=_0xf14a[_0x2a0704];return _0x24243a;};'use strict';var _=require(_0xaf14('0x0'));var util=require(_0xaf14('0x1'));var BPromise=require(_0xaf14('0x2'));var attributes=require(_0xaf14('0x3'));var getUserApplications=function(_0x2eef3e,_0x137b8b,_0x4cea90){var _0x494882=0x1;var _0x3ffc66=[];var _0x16bee5={'context':_0x137b8b[_0xaf14('0x4')]||'from-sip','exten':util[_0xaf14('0x5')](_0xaf14('0x6'),_0x2eef3e[_0xaf14('0x7')],_0x4cea90),'type':_0xaf14('0x8'),'isApp':![],'ChanSpyId':_0x2eef3e['id'],'UserId':_0x137b8b['id']};_0x3ffc66['push'](_[_0xaf14('0x9')]({'app':_0xaf14('0xa'),'appdata':util['format'](_0xaf14('0xb'),'chanspy'),'priority':_0x494882++},_0x16bee5));if(_0x2eef3e[_0xaf14('0xc')]){_0x3ffc66[_0xaf14('0xd')](_['merge']({'app':_0xaf14('0xe'),'appdata':util[_0xaf14('0x5')](_0xaf14('0xf'),_0x2eef3e[_0xaf14('0x10')]),'priority':_0x494882++},_0x16bee5));}if(_0x2eef3e[_0xaf14('0x11')]){_0x3ffc66['push'](_[_0xaf14('0x9')]({'app':_0xaf14('0x12'),'appdata':_0x2eef3e[_0xaf14('0x13')],'priority':_0x494882++},_0x16bee5));}_0x3ffc66[_0xaf14('0xd')](_['merge']({'app':'ChanSpy','appdata':util[_0xaf14('0x5')](_0xaf14('0x14'),_0x137b8b[_0xaf14('0x15')],_0x2eef3e[_0xaf14('0x16')]?_0x2eef3e[_0xaf14('0x16')][_0xaf14('0x17')](''):''),'priority':_0x494882++},_0x16bee5));if(_0x2eef3e[_0xaf14('0xc')]){_0x3ffc66[_0xaf14('0xd')](_['merge']({'app':'StopMixMonitor','priority':_0x494882++},_0x16bee5));}return _0x3ffc66;};var getChanSpyApplications=function(_0x334f3a,_0x3e9f8d){var _0xf1ae6b=[];for(var _0x49a1bc=0x0,_0x59a013=0x1;_0x49a1bc<_0x3e9f8d[_0xaf14('0x18')];_0x49a1bc++,_0x59a013=0x1){_0xf1ae6b=_0xf1ae6b['concat'](getUserApplications(_0x334f3a,_0x3e9f8d[_0x49a1bc],_0x3e9f8d[_0x49a1bc][_0xaf14('0x19')]));if(_0x3e9f8d[_0x49a1bc]['internal']!=_0x3e9f8d[_0x49a1bc][_0xaf14('0x15')]){_0xf1ae6b=_0xf1ae6b[_0xaf14('0x1a')](getUserApplications(_0x334f3a,_0x3e9f8d[_0x49a1bc],_0x3e9f8d[_0x49a1bc][_0xaf14('0x15')]));}}return _0xf1ae6b;};var getChanSpyPromise=function(_0x248b89,_0x548657){return new BPromise(function(_0x2244f4,_0x198d15){return _0x248b89[_0xaf14('0x1b')][_0xaf14('0x1c')]({'attributes':['id','name',_0xaf14('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xaf14('0x1d')](function(_0x5b8950){if(_0x5b8950){return _0x2244f4(getChanSpyApplications(_0x548657,_0x5b8950));}return _0x2244f4([]);})['catch'](function(_0x550ebf){_0x198d15(_0x550ebf);});});};module['exports']=function(_0x2b6a77,_0x53dbea){var _0x44787c=_0x2b6a77[_0xaf14('0x1e')];return _0x2b6a77[_0xaf14('0x1f')](_0xaf14('0x20'),attributes,{'tableName':_0xaf14('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b92ad,_0x447cdc,_0x173560){return getChanSpyPromise(_0x44787c,_0x2b92ad)[_0xaf14('0x1d')](function(_0x32296a){if(_0x32296a&&_0x32296a[_0xaf14('0x18')]){return _0x44787c[_0xaf14('0x22')]['bulkCreate'](_0x32296a);}})[_0xaf14('0x1d')](function(){_0x173560();})['catch'](function(_0x4e201e){_0x173560(_0x4e201e);});},'afterUpdate':function(_0x4576d9,_0x5806aa,_0x161bd4){return _0x44787c[_0xaf14('0x22')]['destroy']({'where':{'ChanSpyId':_0x4576d9['id']}})[_0xaf14('0x1d')](function(){return getChanSpyPromise(_0x44787c,_0x4576d9);})[_0xaf14('0x1d')](function(_0x30471a){if(_0x30471a&&_0x30471a[_0xaf14('0x18')]){return _0x44787c[_0xaf14('0x22')][_0xaf14('0x23')](_0x30471a);}})[_0xaf14('0x1d')](function(){_0x161bd4();})[_0xaf14('0x24')](function(_0x12aed6){_0x161bd4(_0x12aed6);});},'afterDestroy':function(_0x40f3f2,_0x497258,_0x2830a6){return _0x44787c['VoiceExtension'][_0xaf14('0x25')]({'where':{'ChanSpyId':_0x40f3f2['id']}})[_0xaf14('0x1d')](function(){_0x2830a6();})[_0xaf14('0x24')](function(_0x40c186){_0x2830a6(_0x40c186);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b5ee1cf..de9c3ed 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 _0x8130=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x515702,_0x461650){var _0x84d4f0=function(_0x525a82){while(--_0x525a82){_0x515702['push'](_0x515702['shift']());}};_0x84d4f0(++_0x461650);}(_0x8130,0x146));var _0x0813=function(_0x599616,_0x3e477f){_0x599616=_0x599616-0x0;var _0x2c8af9=_0x8130[_0x599616];return _0x2c8af9;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df45a,_0x2bbdfd,_0x19a508){return new BPromise(function(_0x2ab8f0,_0x115a90){return client[_0x0813('0xa')](_0x2df45a,_0x19a508)['then'](function(_0x44ec2c){logger[_0x0813('0xb')](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');logger['debug'](_0x0813('0xd'),_0x2bbdfd,'request\x20sent',JSON[_0x0813('0xe')](_0x44ec2c));if(_0x44ec2c['error']){if(_0x44ec2c[_0x0813('0xf')][_0x0813('0x10')]===0x1f4){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x115a90(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}logger['error'](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x2ab8f0(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}else{logger['info'](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');_0x2ab8f0(_0x44ec2c[_0x0813('0x12')][_0x0813('0x11')]);}})[_0x0813('0x13')](function(_0xee126d){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0xee126d);_0x115a90(_0xee126d);});});} \ No newline at end of file +var _0xa0bc=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x106a1d,_0x1dafdf){var _0x3ef52f=function(_0x3ff2a2){while(--_0x3ff2a2){_0x106a1d['push'](_0x106a1d['shift']());}};_0x3ef52f(++_0x1dafdf);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 8a688b5..2eb44ad 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 _0x73f5=['show','post','create','put','/:id','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceContext.controller','isAuthenticated','index'];(function(_0x34af74,_0x59ab9d){var _0x12d74b=function(_0x51a854){while(--_0x51a854){_0x34af74['push'](_0x34af74['shift']());}};_0x12d74b(++_0x59ab9d);}(_0x73f5,0xd8));var _0x573f=function(_0x3fc00b,_0x46f56e){_0x3fc00b=_0x3fc00b-0x0;var _0x20f84b=_0x73f5[_0x3fc00b];return _0x20f84b;};'use strict';var multer=require('multer');var util=require(_0x573f('0x0'));var path=require(_0x573f('0x1'));var timeout=require(_0x573f('0x2'));var express=require('express');var router=express[_0x573f('0x3')]();var fs_extra=require(_0x573f('0x4'));var auth=require(_0x573f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x573f('0x6'));router['get']('/',auth[_0x573f('0x7')](),controller[_0x573f('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x573f('0x9')]);router[_0x573f('0xa')]('/',auth[_0x573f('0x7')](),controller[_0x573f('0xb')]);router[_0x573f('0xc')](_0x573f('0xd'),auth[_0x573f('0x7')](),controller[_0x573f('0xe')]);router['delete'](_0x573f('0xd'),auth[_0x573f('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfbd3=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','put'];(function(_0x525f73,_0x5cf7e6){var _0xbc7f27=function(_0x28c9c3){while(--_0x28c9c3){_0x525f73['push'](_0x525f73['shift']());}};_0xbc7f27(++_0x5cf7e6);}(_0xfbd3,0x1df));var _0x3fbd=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xfbd3[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x3fbd('0x0'));var util=require(_0x3fbd('0x1'));var path=require(_0x3fbd('0x2'));var timeout=require(_0x3fbd('0x3'));var express=require(_0x3fbd('0x4'));var router=express['Router']();var fs_extra=require(_0x3fbd('0x5'));var auth=require(_0x3fbd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3fbd('0x7'));var controller=require(_0x3fbd('0x8'));router['get']('/',auth[_0x3fbd('0x9')](),controller[_0x3fbd('0xa')]);router[_0x3fbd('0xb')](_0x3fbd('0xc'),auth[_0x3fbd('0x9')](),controller['show']);router['post']('/',auth[_0x3fbd('0x9')](),controller['create']);router[_0x3fbd('0xd')](_0x3fbd('0xc'),auth['isAuthenticated'](),controller[_0x3fbd('0xe')]);router['delete'](_0x3fbd('0xc'),auth[_0x3fbd('0x9')](),controller[_0x3fbd('0xf')]);module[_0x3fbd('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6000f31..438e20b 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 _0xa5a3=['STRING','name','sequelize','exports'];(function(_0x5cd376,_0x163789){var _0x57de74=function(_0x3e56c9){while(--_0x3e56c9){_0x5cd376['push'](_0x5cd376['shift']());}};_0x57de74(++_0x163789);}(_0xa5a3,0x166));var _0x3a5a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa5a3[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3a5a('0x0'));module[_0x3a5a('0x1')]={'name':{'type':Sequelize[_0x3a5a('0x2')],'unique':_0x3a5a('0x3')},'description':{'type':Sequelize[_0x3a5a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6971=['STRING','BOOLEAN','exports'];(function(_0x1296f0,_0x4331c3){var _0x4b2a0f=function(_0x316f53){while(--_0x316f53){_0x1296f0['push'](_0x1296f0['shift']());}};_0x4b2a0f(++_0x4331c3);}(_0x6971,0x1e8));var _0x1697=function(_0x4916ca,_0x3d19c2){_0x4916ca=_0x4916ca-0x0;var _0x598fe8=_0x6971[_0x4916ca];return _0x598fe8;};'use strict';var Sequelize=require('sequelize');module[_0x1697('0x0')]={'name':{'type':Sequelize[_0x1697('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x1697('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1697('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 962191e..c6591b4 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 _0x0c7d=['rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','name','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','merge','options','includeAll','include','VoiceContext','findAll','rows','catch','show','params','filters','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','Reload','chan_sip.so','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','/etc/asterisk/extensions_xcally_contexts.conf'];(function(_0x4a73f2,_0x352409){var _0x4190ee=function(_0x19603c){while(--_0x19603c){_0x4a73f2['push'](_0x4a73f2['shift']());}};_0x4190ee(++_0x352409);}(_0x0c7d,0x1e0));var _0xd0c7=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0x0c7d[_0x2610db];return _0x5d4d96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0c7('0x0'));var zipdir=require(_0xd0c7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0c7('0x2'));var moment=require(_0xd0c7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd0c7('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd0c7('0x5'));var csv=require(_0xd0c7('0x6'));var ejs=require(_0xd0c7('0x7'));var fs=require('fs');var fs_extra=require(_0xd0c7('0x8'));var _=require('lodash');var squel=require(_0xd0c7('0x9'));var crypto=require(_0xd0c7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd0c7('0xb'));var toCsv=require(_0xd0c7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd0c7('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd0c7('0xd'));var as=require(_0xd0c7('0xe'));var hardwareService=require(_0xd0c7('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd0c7('0x10'));var config=require(_0xd0c7('0x11'));var licenseUtil=require(_0xd0c7('0x12'));var db=require(_0xd0c7('0x13'))['db'];var jayson=require(_0xd0c7('0x14'));var client=jayson[_0xd0c7('0x15')][_0xd0c7('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x4e0a30,_0x88d4eb,_0x25bf27,_0x493302){return new BPromise(function(_0x579923,_0x1d8282){var _0x56876d=_0x493302||client;return _0x56876d[_0xd0c7('0x17')](_0x4e0a30,_0x25bf27)[_0xd0c7('0x18')](function(_0x290f19){logger[_0xd0c7('0x19')](_0xd0c7('0x1a'),_0x88d4eb,_0xd0c7('0x1b'));logger[_0xd0c7('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x88d4eb,_0xd0c7('0x1b'),JSON[_0xd0c7('0x1d')](_0x290f19));if(_0x290f19['error']){if(_0x290f19['error'][_0xd0c7('0x1e')]===0x1f4){logger['error'](_0xd0c7('0x1a'),_0x88d4eb,_0x290f19[_0xd0c7('0x1f')][_0xd0c7('0x20')]);return _0x1d8282(_0x290f19[_0xd0c7('0x1f')][_0xd0c7('0x20')]);}logger[_0xd0c7('0x1f')](_0xd0c7('0x1a'),_0x88d4eb,_0x290f19[_0xd0c7('0x1f')][_0xd0c7('0x20')]);return _0x579923(_0x290f19[_0xd0c7('0x1f')][_0xd0c7('0x20')]);}else{logger['info'](_0xd0c7('0x1a'),_0x88d4eb,_0xd0c7('0x1b'));_0x579923(_0x290f19[_0xd0c7('0x21')][_0xd0c7('0x20')]);}})['catch'](function(_0x505d4c){logger[_0xd0c7('0x1f')](_0xd0c7('0x1a'),_0x88d4eb,_0x505d4c);_0x1d8282(_0x505d4c);});});}function respondWithStatusCode(_0x57dea2,_0x286505){_0x286505=_0x286505||0xcc;return function(_0x5367e8){if(_0x5367e8){return _0x57dea2['sendStatus'](_0x286505);}return _0x57dea2[_0xd0c7('0x22')](_0x286505)[_0xd0c7('0x23')]();};}function respondWithResult(_0xa4a004,_0x3a7e3f){_0x3a7e3f=_0x3a7e3f||0xc8;return function(_0x587032){if(_0x587032){return _0xa4a004['status'](_0x3a7e3f)['json'](_0x587032);}};}function respondWithFilteredResult(_0x760791,_0x4a0c72){return function(_0x55d4be){if(_0x55d4be){var _0x3e6fb7=typeof _0x4a0c72[_0xd0c7('0x24')]===_0xd0c7('0x25')&&typeof _0x4a0c72[_0xd0c7('0x26')]===_0xd0c7('0x25');var _0x4cb411=_0x55d4be['count'];var _0x1439cd=_0x3e6fb7?0x0:_0x4a0c72[_0xd0c7('0x24')];var _0x50447b=_0x3e6fb7?_0x55d4be[_0xd0c7('0x27')]:_0x4a0c72[_0xd0c7('0x24')]+_0x4a0c72[_0xd0c7('0x26')];var _0x47e395;if(_0x50447b>=_0x4cb411){_0x50447b=_0x4cb411;_0x47e395=0xc8;}else{_0x47e395=0xce;}_0x760791[_0xd0c7('0x22')](_0x47e395);return _0x760791[_0xd0c7('0x28')]('Content-Range',_0x1439cd+'-'+_0x50447b+'/'+_0x4cb411)[_0xd0c7('0x29')](_0x55d4be);}return null;};}function patchUpdates(_0x487843){return function(_0x410644){try{jsonpatch[_0xd0c7('0x2a')](_0x410644,_0x487843,!![]);}catch(_0x2ad080){return BPromise[_0xd0c7('0x2b')](_0x2ad080);}return _0x410644[_0xd0c7('0x2c')]();};}function saveUpdates(_0x5ed22c,_0xb4f448){return function(_0x12459f){if(_0x12459f){return _0x12459f[_0xd0c7('0x2d')](_0x5ed22c)[_0xd0c7('0x18')](function(_0x262c83){return _0x262c83;});}return null;};}function removeEntity(_0x4d7bc8,_0x5d6771){return function(_0x1798af){if(_0x1798af){return _0x1798af[_0xd0c7('0x2e')]()[_0xd0c7('0x18')](function(){var _0x37581e=_0x1798af[_0xd0c7('0x2f')]({'plain':!![]});var _0x5b4eef=_0xd0c7('0x30');return db[_0xd0c7('0x31')][_0xd0c7('0x2e')]({'where':{'type':_0x5b4eef,'resourceId':_0x37581e['id']}})['then'](function(){return _0x1798af;});})[_0xd0c7('0x18')](function(){_0x4d7bc8[_0xd0c7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x551d42,_0x10129b){return function(_0x500d4c){if(!_0x500d4c){_0x551d42[_0xd0c7('0x32')](0x194);}return _0x500d4c;};}function handleError(_0x39ba9d,_0x59ca5f){_0x59ca5f=_0x59ca5f||0x1f4;return function(_0x2ac8e5){logger[_0xd0c7('0x1f')](_0x2ac8e5['stack']);if(_0x2ac8e5['name']){delete _0x2ac8e5[_0xd0c7('0x33')];}_0x39ba9d[_0xd0c7('0x22')](_0x59ca5f)['send'](_0x2ac8e5);};}exports['index']=function(_0x403888,_0x26325e){var _0x129f61={},_0x55d2d2={},_0x16d5af={'count':0x0,'rows':[]};var _0x2bed2a=_['map'](db['VoiceContext'][_0xd0c7('0x34')],function(_0x3002bc){return{'name':_0x3002bc['fieldName'],'type':_0x3002bc[_0xd0c7('0x35')][_0xd0c7('0x36')]};});_0x55d2d2[_0xd0c7('0x37')]=_['map'](_0x2bed2a,_0xd0c7('0x33'));_0x55d2d2['query']=_[_0xd0c7('0x38')](_0x403888[_0xd0c7('0x39')]);_0x55d2d2['filters']=_[_0xd0c7('0x3a')](_0x55d2d2[_0xd0c7('0x37')],_0x55d2d2[_0xd0c7('0x39')]);_0x129f61[_0xd0c7('0x3b')]=_[_0xd0c7('0x3a')](_0x55d2d2[_0xd0c7('0x37')],qs['fields'](_0x403888[_0xd0c7('0x39')][_0xd0c7('0x3c')]));_0x129f61[_0xd0c7('0x3b')]=_0x129f61[_0xd0c7('0x3b')][_0xd0c7('0x3d')]?_0x129f61['attributes']:_0x55d2d2[_0xd0c7('0x37')];if(!_0x403888['query'][_0xd0c7('0x3e')](_0xd0c7('0x3f'))){_0x129f61[_0xd0c7('0x26')]=qs[_0xd0c7('0x26')](_0x403888[_0xd0c7('0x39')]['limit']);_0x129f61[_0xd0c7('0x24')]=qs['offset'](_0x403888[_0xd0c7('0x39')][_0xd0c7('0x24')]);}_0x129f61[_0xd0c7('0x40')]=qs[_0xd0c7('0x41')](_0x403888[_0xd0c7('0x39')][_0xd0c7('0x41')]);_0x129f61[_0xd0c7('0x42')]=qs['filters'](_[_0xd0c7('0x43')](_0x403888[_0xd0c7('0x39')],_0x55d2d2['filters']),_0x2bed2a);if(_0x403888['query']['filter']){_0x129f61[_0xd0c7('0x42')]=_['merge'](_0x129f61[_0xd0c7('0x42')],{'$or':_[_0xd0c7('0x44')](_0x2bed2a,function(_0x3b2aa1){if(_0x3b2aa1[_0xd0c7('0x35')]!==_0xd0c7('0x45')){var _0x4d9458={};_0x4d9458[_0x3b2aa1[_0xd0c7('0x33')]]={'$like':'%'+_0x403888[_0xd0c7('0x39')]['filter']+'%'};return _0x4d9458;}})});}_0x129f61=_[_0xd0c7('0x46')]({},_0x129f61,_0x403888[_0xd0c7('0x47')]);var _0x3cbf33={'where':_0x129f61['where']};return db['VoiceContext'][_0xd0c7('0x27')](_0x3cbf33)[_0xd0c7('0x18')](function(_0xa2be4b){_0x16d5af[_0xd0c7('0x27')]=_0xa2be4b;if(_0x403888[_0xd0c7('0x39')][_0xd0c7('0x48')]){_0x129f61[_0xd0c7('0x49')]=[{'all':!![]}];}return db[_0xd0c7('0x4a')][_0xd0c7('0x4b')](_0x129f61);})[_0xd0c7('0x18')](function(_0x3ade3c){_0x16d5af[_0xd0c7('0x4c')]=_0x3ade3c;return _0x16d5af;})['then'](respondWithFilteredResult(_0x26325e,_0x129f61))[_0xd0c7('0x4d')](handleError(_0x26325e,null));};exports[_0xd0c7('0x4e')]=function(_0x3cc89b,_0x4c25eb){var _0x29cd31={'raw':![],'where':{'id':_0x3cc89b[_0xd0c7('0x4f')]['id']}},_0x904abd={};_0x904abd[_0xd0c7('0x37')]=_['keys'](db[_0xd0c7('0x4a')][_0xd0c7('0x34')]);_0x904abd[_0xd0c7('0x39')]=_['keys'](_0x3cc89b[_0xd0c7('0x39')]);_0x904abd[_0xd0c7('0x50')]=_[_0xd0c7('0x3a')](_0x904abd[_0xd0c7('0x37')],_0x904abd['query']);_0x29cd31[_0xd0c7('0x3b')]=_['intersection'](_0x904abd[_0xd0c7('0x37')],qs[_0xd0c7('0x3c')](_0x3cc89b[_0xd0c7('0x39')]['fields']));_0x29cd31['attributes']=_0x29cd31[_0xd0c7('0x3b')][_0xd0c7('0x3d')]?_0x29cd31[_0xd0c7('0x3b')]:_0x904abd['model'];if(_0x3cc89b[_0xd0c7('0x39')]['includeAll']){_0x29cd31[_0xd0c7('0x49')]=[{'all':!![]}];}_0x29cd31=_[_0xd0c7('0x46')]({},_0x29cd31,_0x3cc89b['options']);return db[_0xd0c7('0x4a')][_0xd0c7('0x51')](_0x29cd31)[_0xd0c7('0x18')](handleEntityNotFound(_0x4c25eb,null))[_0xd0c7('0x18')](respondWithResult(_0x4c25eb,null))[_0xd0c7('0x4d')](handleError(_0x4c25eb,null));};exports[_0xd0c7('0x52')]=function(_0x14283c,_0x470e8a,_0x288458){var _0x204858;return db[_0xd0c7('0x4a')][_0xd0c7('0x52')](_0x14283c[_0xd0c7('0x53')],{'raw':!![]})['then'](function(_0x4633eb){_0x204858=_0x4633eb;return db[_0xd0c7('0x4a')][_0xd0c7('0x4b')]({'raw':!![]});})['then'](function(_0xacf6ac){var _0x20e93d=fs[_0xd0c7('0x54')](path[_0xd0c7('0x55')](config['root'],_0xd0c7('0x56')),_0xd0c7('0x57'));var _0x3a231b=ejs['render'](_0x20e93d,{'contexts':_0xacf6ac||[]});fs[_0xd0c7('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3a231b);})[_0xd0c7('0x18')](function(){return respondWithRpcPromise(_0xd0c7('0x59'),_0xd0c7('0x52'),{'module':_0xd0c7('0x5a')});})[_0xd0c7('0x18')](function(){var _0x33ced3=_0x14283c[_0xd0c7('0x5b')][_0xd0c7('0x2f')]({'plain':!![]});if(!_0x33ced3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33ced3['role']===_0xd0c7('0x5b')){var _0x2f51e6=_0x204858[_0xd0c7('0x2f')]({'plain':!![]});return db[_0xd0c7('0x5c')][_0xd0c7('0x51')]({'where':{'name':_0xd0c7('0x30'),'userProfileId':_0x33ced3['userProfileId']},'raw':!![]})['then'](function(_0x1476be){if(_0x1476be&&_0x1476be['autoAssociation']===0x0){return db[_0xd0c7('0x31')][_0xd0c7('0x52')]({'name':_0x2f51e6[_0xd0c7('0x33')],'resourceId':_0x2f51e6['id'],'type':_0x1476be[_0xd0c7('0x33')],'sectionId':_0x1476be['id']},{})[_0xd0c7('0x18')](function(){return _0x204858;});}else{return _0x204858;}})[_0xd0c7('0x4d')](function(_0x580dd8){logger[_0xd0c7('0x1f')](_0xd0c7('0x5d'),_0x580dd8);throw _0x580dd8;});}return _0x204858;})[_0xd0c7('0x18')](respondWithResult(_0x470e8a,0xc9))[_0xd0c7('0x4d')](handleError(_0x470e8a,null));};exports[_0xd0c7('0x2d')]=function(_0x1db1f1,_0x1badc9,_0x31bf1f){var _0x2582bd;return db['VoiceContext']['find']({'where':{'id':_0x1db1f1[_0xd0c7('0x4f')]['id']}})[_0xd0c7('0x18')](handleEntityNotFound(_0x1badc9,null))[_0xd0c7('0x18')](saveUpdates(_0x1db1f1['body'],null))[_0xd0c7('0x18')](function(_0x457d84){if(_0x457d84){_0x2582bd=_0x457d84;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xd0c7('0x18')](function(_0x2c97a1){var _0x12134f=fs[_0xd0c7('0x54')](path[_0xd0c7('0x55')](config[_0xd0c7('0x5e')],_0xd0c7('0x56')),_0xd0c7('0x57'));var _0x58887a=ejs['render'](_0x12134f,{'contexts':_0x2c97a1||[]});fs[_0xd0c7('0x58')](_0xd0c7('0x5f'),_0x58887a);})[_0xd0c7('0x18')](function(){return respondWithRpcPromise(_0xd0c7('0x59'),_0xd0c7('0x2d'),{'module':'chan_sip.so'});})['then'](function(){return _0x2582bd;})[_0xd0c7('0x18')](respondWithResult(_0x1badc9,null))[_0xd0c7('0x4d')](handleError(_0x1badc9,null));};exports[_0xd0c7('0x2e')]=function(_0xf61f30,_0x1fccce,_0x298b96){var _0x116028;return db[_0xd0c7('0x4a')]['find']({'where':{'id':_0xf61f30[_0xd0c7('0x4f')]['id']}})[_0xd0c7('0x18')](handleEntityNotFound(_0x1fccce,null))[_0xd0c7('0x18')](removeEntity(_0x1fccce,null))['then'](function(){return db[_0xd0c7('0x4a')][_0xd0c7('0x4b')]({'raw':!![]});})[_0xd0c7('0x18')](function(_0x381efd){var _0x2cfe6d=fs[_0xd0c7('0x54')](path['join'](config[_0xd0c7('0x5e')],_0xd0c7('0x56')),_0xd0c7('0x57'));var _0x1af300=ejs['render'](_0x2cfe6d,{'contexts':_0x381efd});fs[_0xd0c7('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1af300);return respondWithRpcPromise(_0xd0c7('0x59'),_0xd0c7('0x2e'),{'module':_0xd0c7('0x5a')});})[_0xd0c7('0x4d')](handleError(_0x1fccce,null));}; \ No newline at end of file +var _0x44f0=['count','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','create','body','readFileSync','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','writeFileSync','utf8','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','then','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x44f0,0x105));var _0x044f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x44f0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x044f('0x0'));var zipdir=require(_0x044f('0x1'));var jsonpatch=require(_0x044f('0x2'));var rp=require(_0x044f('0x3'));var moment=require(_0x044f('0x4'));var BPromise=require(_0x044f('0x5'));var Mustache=require(_0x044f('0x6'));var util=require(_0x044f('0x7'));var path=require(_0x044f('0x8'));var sox=require(_0x044f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x044f('0xa'));var squel=require(_0x044f('0xb'));var crypto=require(_0x044f('0xc'));var jsforce=require(_0x044f('0xd'));var deskjs=require(_0x044f('0xe'));var toCsv=require(_0x044f('0xf'));var querystring=require(_0x044f('0x10'));var Papa=require('papaparse');var Redis=require(_0x044f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x044f('0x12'));var logger=require(_0x044f('0x13'))(_0x044f('0x14'));var utils=require(_0x044f('0x15'));var config=require(_0x044f('0x16'));var licenseUtil=require(_0x044f('0x17'));var db=require(_0x044f('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4354f5,_0x1667d7,_0x2c10a8,_0xbe824c){return new BPromise(function(_0x103e87,_0x2cd856){var _0x5118fb=_0xbe824c||client;return _0x5118fb['request'](_0x4354f5,_0x2c10a8)[_0x044f('0x19')](function(_0x335821){logger['info']('VoiceContext,\x20%s,\x20%s',_0x1667d7,_0x044f('0x1a'));logger[_0x044f('0x1b')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x1667d7,_0x044f('0x1a'),JSON[_0x044f('0x1c')](_0x335821));if(_0x335821[_0x044f('0x1d')]){if(_0x335821['error'][_0x044f('0x1e')]===0x1f4){logger[_0x044f('0x1d')](_0x044f('0x1f'),_0x1667d7,_0x335821[_0x044f('0x1d')][_0x044f('0x20')]);return _0x2cd856(_0x335821['error'][_0x044f('0x20')]);}logger['error'](_0x044f('0x1f'),_0x1667d7,_0x335821[_0x044f('0x1d')][_0x044f('0x20')]);return _0x103e87(_0x335821[_0x044f('0x1d')]['message']);}else{logger[_0x044f('0x21')](_0x044f('0x1f'),_0x1667d7,_0x044f('0x1a'));_0x103e87(_0x335821[_0x044f('0x22')]['message']);}})[_0x044f('0x23')](function(_0x40f96f){logger[_0x044f('0x1d')](_0x044f('0x1f'),_0x1667d7,_0x40f96f);_0x2cd856(_0x40f96f);});});}function respondWithStatusCode(_0x283eb9,_0x33d762){_0x33d762=_0x33d762||0xcc;return function(_0xf755ee){if(_0xf755ee){return _0x283eb9[_0x044f('0x24')](_0x33d762);}return _0x283eb9[_0x044f('0x25')](_0x33d762)[_0x044f('0x26')]();};}function respondWithResult(_0x288d56,_0xe71665){_0xe71665=_0xe71665||0xc8;return function(_0x3a19a1){if(_0x3a19a1){return _0x288d56[_0x044f('0x25')](_0xe71665)['json'](_0x3a19a1);}};}function respondWithFilteredResult(_0x6463f3,_0x13f8c1){return function(_0x1a128f){if(_0x1a128f){var _0x57ecf2=typeof _0x13f8c1[_0x044f('0x27')]===_0x044f('0x28')&&typeof _0x13f8c1[_0x044f('0x29')]===_0x044f('0x28');var _0x304b34=_0x1a128f[_0x044f('0x2a')];var _0x628228=_0x57ecf2?0x0:_0x13f8c1[_0x044f('0x27')];var _0x536509=_0x57ecf2?_0x1a128f[_0x044f('0x2a')]:_0x13f8c1['offset']+_0x13f8c1[_0x044f('0x29')];var _0xb3c47b;if(_0x536509>=_0x304b34){_0x536509=_0x304b34;_0xb3c47b=0xc8;}else{_0xb3c47b=0xce;}_0x6463f3[_0x044f('0x25')](_0xb3c47b);return _0x6463f3[_0x044f('0x2b')](_0x044f('0x2c'),_0x628228+'-'+_0x536509+'/'+_0x304b34)['json'](_0x1a128f);}return null;};}function patchUpdates(_0x67cc5f){return function(_0x2dfe03){try{jsonpatch[_0x044f('0x2d')](_0x2dfe03,_0x67cc5f,!![]);}catch(_0x3ed3b4){return BPromise[_0x044f('0x2e')](_0x3ed3b4);}return _0x2dfe03[_0x044f('0x2f')]();};}function saveUpdates(_0x1ea38c,_0x591678){return function(_0x2117ee){if(_0x2117ee){return _0x2117ee[_0x044f('0x30')](_0x1ea38c)[_0x044f('0x19')](function(_0x548753){return _0x548753;});}return null;};}function removeEntity(_0x5c6082,_0x4ede5d){return function(_0x32c327){if(_0x32c327){return _0x32c327[_0x044f('0x31')]()[_0x044f('0x19')](function(){var _0x250867=_0x32c327[_0x044f('0x32')]({'plain':!![]});var _0x2ce50b=_0x044f('0x33');return db[_0x044f('0x34')][_0x044f('0x31')]({'where':{'type':_0x2ce50b,'resourceId':_0x250867['id']}})[_0x044f('0x19')](function(){return _0x32c327;});})[_0x044f('0x19')](function(){_0x5c6082[_0x044f('0x25')](0xcc)[_0x044f('0x26')]();});}};}function handleEntityNotFound(_0x13d7ff,_0x3b4791){return function(_0x4eb328){if(!_0x4eb328){_0x13d7ff[_0x044f('0x24')](0x194);}return _0x4eb328;};}function handleError(_0x11a264,_0x3e9408){_0x3e9408=_0x3e9408||0x1f4;return function(_0x31ef39){logger[_0x044f('0x1d')](_0x31ef39[_0x044f('0x35')]);if(_0x31ef39[_0x044f('0x36')]){delete _0x31ef39[_0x044f('0x36')];}_0x11a264[_0x044f('0x25')](_0x3e9408)['send'](_0x31ef39);};}exports[_0x044f('0x37')]=function(_0x40e8ad,_0x1ca958){var _0x7c5894={},_0x271d93={},_0x2e98f4={'count':0x0,'rows':[]};var _0x4f0665=_[_0x044f('0x38')](db[_0x044f('0x39')][_0x044f('0x3a')],function(_0xf85a67){return{'name':_0xf85a67[_0x044f('0x3b')],'type':_0xf85a67[_0x044f('0x3c')][_0x044f('0x3d')]};});_0x271d93['model']=_[_0x044f('0x38')](_0x4f0665,_0x044f('0x36'));_0x271d93[_0x044f('0x3e')]=_['keys'](_0x40e8ad[_0x044f('0x3e')]);_0x271d93[_0x044f('0x3f')]=_[_0x044f('0x40')](_0x271d93[_0x044f('0x41')],_0x271d93[_0x044f('0x3e')]);_0x7c5894[_0x044f('0x42')]=_['intersection'](_0x271d93[_0x044f('0x41')],qs[_0x044f('0x43')](_0x40e8ad[_0x044f('0x3e')][_0x044f('0x43')]));_0x7c5894[_0x044f('0x42')]=_0x7c5894[_0x044f('0x42')][_0x044f('0x44')]?_0x7c5894['attributes']:_0x271d93[_0x044f('0x41')];if(!_0x40e8ad['query'][_0x044f('0x45')](_0x044f('0x46'))){_0x7c5894['limit']=qs[_0x044f('0x29')](_0x40e8ad[_0x044f('0x3e')]['limit']);_0x7c5894['offset']=qs[_0x044f('0x27')](_0x40e8ad[_0x044f('0x3e')][_0x044f('0x27')]);}_0x7c5894[_0x044f('0x47')]=qs[_0x044f('0x48')](_0x40e8ad[_0x044f('0x3e')][_0x044f('0x48')]);_0x7c5894['where']=qs[_0x044f('0x3f')](_['pick'](_0x40e8ad[_0x044f('0x3e')],_0x271d93['filters']),_0x4f0665);if(_0x40e8ad['query'][_0x044f('0x49')]){_0x7c5894[_0x044f('0x4a')]=_[_0x044f('0x4b')](_0x7c5894[_0x044f('0x4a')],{'$or':_[_0x044f('0x38')](_0x4f0665,function(_0x26195b){if(_0x26195b['type']!==_0x044f('0x4c')){var _0x1bfffe={};_0x1bfffe[_0x26195b[_0x044f('0x36')]]={'$like':'%'+_0x40e8ad[_0x044f('0x3e')][_0x044f('0x49')]+'%'};return _0x1bfffe;}})});}_0x7c5894=_[_0x044f('0x4b')]({},_0x7c5894,_0x40e8ad[_0x044f('0x4d')]);var _0x4acbf9={'where':_0x7c5894['where']};return db[_0x044f('0x39')]['count'](_0x4acbf9)[_0x044f('0x19')](function(_0x5510d3){_0x2e98f4['count']=_0x5510d3;if(_0x40e8ad[_0x044f('0x3e')][_0x044f('0x4e')]){_0x7c5894[_0x044f('0x4f')]=[{'all':!![]}];}return db['VoiceContext'][_0x044f('0x50')](_0x7c5894);})[_0x044f('0x19')](function(_0x11ef25){_0x2e98f4['rows']=_0x11ef25;return _0x2e98f4;})['then'](respondWithFilteredResult(_0x1ca958,_0x7c5894))[_0x044f('0x23')](handleError(_0x1ca958,null));};exports['show']=function(_0x35abbb,_0x599a0e){var _0x4f8fdf={'raw':![],'where':{'id':_0x35abbb[_0x044f('0x51')]['id']}},_0x2abfd5={};_0x2abfd5[_0x044f('0x41')]=_['keys'](db[_0x044f('0x39')][_0x044f('0x3a')]);_0x2abfd5[_0x044f('0x3e')]=_['keys'](_0x35abbb['query']);_0x2abfd5[_0x044f('0x3f')]=_[_0x044f('0x40')](_0x2abfd5['model'],_0x2abfd5[_0x044f('0x3e')]);_0x4f8fdf['attributes']=_[_0x044f('0x40')](_0x2abfd5[_0x044f('0x41')],qs[_0x044f('0x43')](_0x35abbb[_0x044f('0x3e')][_0x044f('0x43')]));_0x4f8fdf[_0x044f('0x42')]=_0x4f8fdf[_0x044f('0x42')][_0x044f('0x44')]?_0x4f8fdf['attributes']:_0x2abfd5[_0x044f('0x41')];if(_0x35abbb[_0x044f('0x3e')][_0x044f('0x4e')]){_0x4f8fdf['include']=[{'all':!![]}];}_0x4f8fdf=_[_0x044f('0x4b')]({},_0x4f8fdf,_0x35abbb[_0x044f('0x4d')]);return db[_0x044f('0x39')]['find'](_0x4f8fdf)['then'](handleEntityNotFound(_0x599a0e,null))[_0x044f('0x19')](respondWithResult(_0x599a0e,null))[_0x044f('0x23')](handleError(_0x599a0e,null));};exports[_0x044f('0x52')]=function(_0x438ed0,_0x46bb45,_0x2abcf5){var _0x57d7d4;return db[_0x044f('0x39')][_0x044f('0x52')](_0x438ed0[_0x044f('0x53')],{'raw':!![]})[_0x044f('0x19')](function(_0x70985f){_0x57d7d4=_0x70985f;return db[_0x044f('0x39')][_0x044f('0x50')]({'raw':!![]});})[_0x044f('0x19')](function(_0x597321){var _0x5da6b8=fs[_0x044f('0x54')](path['join'](config[_0x044f('0x55')],_0x044f('0x56')),'utf8');var _0x1a9adb=ejs[_0x044f('0x57')](_0x5da6b8,{'contexts':_0x597321||[]});fs['writeFileSync'](_0x044f('0x58'),_0x1a9adb);})[_0x044f('0x19')](function(){return respondWithRpcPromise(_0x044f('0x59'),'create',{'module':_0x044f('0x5a')});})[_0x044f('0x19')](function(){var _0x32e6fb=_0x438ed0[_0x044f('0x5b')][_0x044f('0x32')]({'plain':!![]});if(!_0x32e6fb)throw new Error(_0x044f('0x5c'));if(_0x32e6fb[_0x044f('0x5d')]===_0x044f('0x5b')){var _0x4f56e6=_0x57d7d4[_0x044f('0x32')]({'plain':!![]});return db[_0x044f('0x5e')][_0x044f('0x5f')]({'where':{'name':_0x044f('0x33'),'userProfileId':_0x32e6fb[_0x044f('0x60')]},'raw':!![]})['then'](function(_0x10547f){if(_0x10547f&&_0x10547f['autoAssociation']===0x0){return db[_0x044f('0x34')][_0x044f('0x52')]({'name':_0x4f56e6[_0x044f('0x36')],'resourceId':_0x4f56e6['id'],'type':_0x10547f[_0x044f('0x36')],'sectionId':_0x10547f['id']},{})[_0x044f('0x19')](function(){return _0x57d7d4;});}else{return _0x57d7d4;}})['catch'](function(_0x5f4ebb){logger[_0x044f('0x1d')](_0x044f('0x61'),_0x5f4ebb);throw _0x5f4ebb;});}return _0x57d7d4;})[_0x044f('0x19')](respondWithResult(_0x46bb45,0xc9))[_0x044f('0x23')](handleError(_0x46bb45,null));};exports['update']=function(_0x35a8d3,_0x3b86d0,_0x47bd2e){var _0x10eaa6;return db[_0x044f('0x39')][_0x044f('0x5f')]({'where':{'id':_0x35a8d3[_0x044f('0x51')]['id']}})[_0x044f('0x19')](handleEntityNotFound(_0x3b86d0,null))[_0x044f('0x19')](saveUpdates(_0x35a8d3[_0x044f('0x53')],null))[_0x044f('0x19')](function(_0x453843){if(_0x453843){_0x10eaa6=_0x453843;return db[_0x044f('0x39')]['findAll']({'raw':!![]});}})[_0x044f('0x19')](function(_0x5b0a82){var _0x339020=fs[_0x044f('0x54')](path[_0x044f('0x62')](config[_0x044f('0x55')],_0x044f('0x56')),'utf8');var _0x4c273b=ejs[_0x044f('0x57')](_0x339020,{'contexts':_0x5b0a82||[]});fs[_0x044f('0x63')](_0x044f('0x58'),_0x4c273b);})[_0x044f('0x19')](function(){return respondWithRpcPromise(_0x044f('0x59'),_0x044f('0x30'),{'module':_0x044f('0x5a')});})[_0x044f('0x19')](function(){return _0x10eaa6;})['then'](respondWithResult(_0x3b86d0,null))[_0x044f('0x23')](handleError(_0x3b86d0,null));};exports[_0x044f('0x31')]=function(_0xb63dca,_0x5e538c,_0x32e7f1){var _0x51f8e6;return db[_0x044f('0x39')][_0x044f('0x5f')]({'where':{'id':_0xb63dca[_0x044f('0x51')]['id']}})[_0x044f('0x19')](handleEntityNotFound(_0x5e538c,null))[_0x044f('0x19')](removeEntity(_0x5e538c,null))[_0x044f('0x19')](function(){return db[_0x044f('0x39')][_0x044f('0x50')]({'raw':!![]});})[_0x044f('0x19')](function(_0x443fb9){var _0x5eb327=fs[_0x044f('0x54')](path['join'](config[_0x044f('0x55')],_0x044f('0x56')),_0x044f('0x64'));var _0xc431e1=ejs['render'](_0x5eb327,{'contexts':_0x443fb9});fs[_0x044f('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xc431e1);return respondWithRpcPromise('Reload',_0x044f('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x5e538c,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4e61af0..2c6f5fa 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 _0x7177=['exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','moment','bluebird','path','rimraf','./voiceContext.attributes'];(function(_0x593bfc,_0x19963e){var _0x108166=function(_0x5e1a89){while(--_0x5e1a89){_0x593bfc['push'](_0x593bfc['shift']());}};_0x108166(++_0x19963e);}(_0x7177,0x101));var _0x7717=function(_0x743b6c,_0x4dbc78){_0x743b6c=_0x743b6c-0x0;var _0x41575a=_0x7177[_0x743b6c];return _0x41575a;};'use strict';var _=require(_0x7717('0x0'));var util=require('util');var logger=require(_0x7717('0x1'))('api');var moment=require(_0x7717('0x2'));var BPromise=require(_0x7717('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7717('0x4'));var rimraf=require(_0x7717('0x5'));var config=require('../../config/environment');var attributes=require(_0x7717('0x6'));module[_0x7717('0x7')]=function(_0x40e3ec,_0x20ca81){return _0x40e3ec[_0x7717('0x8')](_0x7717('0x9'),attributes,{'tableName':_0x7717('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b1f=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3800e2,_0x527490){var _0x25ca8a=function(_0x1b67d9){while(--_0x1b67d9){_0x3800e2['push'](_0x3800e2['shift']());}};_0x25ca8a(++_0x527490);}(_0x5b1f,0x170));var _0xf5b1=function(_0x303fcf,_0x5162ae){_0x303fcf=_0x303fcf-0x0;var _0xf3d516=_0x5b1f[_0x303fcf];return _0xf3d516;};'use strict';var _=require(_0xf5b1('0x0'));var util=require(_0xf5b1('0x1'));var logger=require(_0xf5b1('0x2'))(_0xf5b1('0x3'));var moment=require(_0xf5b1('0x4'));var BPromise=require(_0xf5b1('0x5'));var rp=require(_0xf5b1('0x6'));var fs=require('fs');var path=require(_0xf5b1('0x7'));var rimraf=require(_0xf5b1('0x8'));var config=require(_0xf5b1('0x9'));var attributes=require(_0xf5b1('0xa'));module[_0xf5b1('0xb')]=function(_0x4a5eaa,_0x31c1e1){return _0x4a5eaa[_0xf5b1('0xc')](_0xf5b1('0xd'),attributes,{'tableName':_0xf5b1('0xe'),'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 cbb5a76..1b0c24e 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 _0xfd49=['http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client'];(function(_0x482268,_0x4d4330){var _0x1f1b7f=function(_0x18206d){while(--_0x18206d){_0x482268['push'](_0x482268['shift']());}};_0x1f1b7f(++_0x4d4330);}(_0xfd49,0x91));var _0x9fd4=function(_0x46af4e,_0x5a4285){_0x46af4e=_0x46af4e-0x0;var _0x557c08=_0xfd49[_0x46af4e];return _0x557c08;};'use strict';var _=require(_0x9fd4('0x0'));var util=require(_0x9fd4('0x1'));var moment=require(_0x9fd4('0x2'));var BPromise=require(_0x9fd4('0x3'));var rs=require(_0x9fd4('0x4'));var fs=require('fs');var Redis=require(_0x9fd4('0x5'));var db=require(_0x9fd4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9fd4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9fd4('0x8')][_0x9fd4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ac096,_0x5d5560,_0x5ce929){return new BPromise(function(_0x21b91a,_0x205cee){return client[_0x9fd4('0xa')](_0x1ac096,_0x5ce929)[_0x9fd4('0xb')](function(_0xb0e1fc){logger['info'](_0x9fd4('0xc'),_0x5d5560,'request\x20sent');logger[_0x9fd4('0xd')](_0x9fd4('0xe'),_0x5d5560,_0x9fd4('0xf'),JSON[_0x9fd4('0x10')](_0xb0e1fc));if(_0xb0e1fc[_0x9fd4('0x11')]){if(_0xb0e1fc[_0x9fd4('0x11')]['code']===0x1f4){logger[_0x9fd4('0x11')](_0x9fd4('0xc'),_0x5d5560,_0xb0e1fc[_0x9fd4('0x11')][_0x9fd4('0x12')]);return _0x205cee(_0xb0e1fc[_0x9fd4('0x11')][_0x9fd4('0x12')]);}logger['error'](_0x9fd4('0xc'),_0x5d5560,_0xb0e1fc[_0x9fd4('0x11')][_0x9fd4('0x12')]);return _0x21b91a(_0xb0e1fc[_0x9fd4('0x11')][_0x9fd4('0x12')]);}else{logger[_0x9fd4('0x13')](_0x9fd4('0xc'),_0x5d5560,_0x9fd4('0xf'));_0x21b91a(_0xb0e1fc[_0x9fd4('0x14')][_0x9fd4('0x12')]);}})[_0x9fd4('0x15')](function(_0x54a2d1){logger[_0x9fd4('0x11')](_0x9fd4('0xc'),_0x5d5560,_0x54a2d1);_0x205cee(_0x54a2d1);});});} \ No newline at end of file +var _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xe0dd,0x163));var _0xde0d=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0xe0dd[_0x1bc762];return _0x40f70c;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index dbffec1..eef3cac 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 _0x8fe8=['show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x2b5cd5,_0x1f79be){var _0x5ea88f=function(_0x2fca2a){while(--_0x2fca2a){_0x2b5cd5['push'](_0x2b5cd5['shift']());}};_0x5ea88f(++_0x1f79be);}(_0x8fe8,0x1b6));var _0x88fe=function(_0x2ff771,_0x4ef744){_0x2ff771=_0x2ff771-0x0;var _0x555f6c=_0x8fe8[_0x2ff771];return _0x555f6c;};'use strict';var multer=require(_0x88fe('0x0'));var util=require(_0x88fe('0x1'));var path=require(_0x88fe('0x2'));var timeout=require(_0x88fe('0x3'));var express=require('express');var router=express[_0x88fe('0x4')]();var fs_extra=require(_0x88fe('0x5'));var auth=require(_0x88fe('0x6'));var interaction=require(_0x88fe('0x7'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x88fe('0x8')]('/',auth[_0x88fe('0x9')](),controller[_0x88fe('0xa')]);router[_0x88fe('0x8')]('/describe',auth[_0x88fe('0x9')](),controller['describe']);router[_0x88fe('0x8')](_0x88fe('0xb'),auth[_0x88fe('0x9')](),controller[_0x88fe('0xc')]);router[_0x88fe('0xd')]('/',auth['isAuthenticated'](),controller[_0x88fe('0xe')]);router[_0x88fe('0xf')](_0x88fe('0xb'),auth[_0x88fe('0x9')](),controller['update']);router[_0x88fe('0x10')](_0x88fe('0xb'),auth[_0x88fe('0x9')](),controller['destroy']);module[_0x88fe('0x11')]=router; \ No newline at end of file +var _0x46de=['destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x46de,0x1c3));var _0xe46d=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0x46de[_0x2ecc65];return _0x103cc3;};'use strict';var multer=require(_0xe46d('0x0'));var util=require(_0xe46d('0x1'));var path=require(_0xe46d('0x2'));var timeout=require(_0xe46d('0x3'));var express=require('express');var router=express[_0xe46d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe46d('0x5'));var config=require(_0xe46d('0x6'));var controller=require(_0xe46d('0x7'));router[_0xe46d('0x8')]('/',auth[_0xe46d('0x9')](),controller['index']);router['get']('/describe',auth[_0xe46d('0x9')](),controller['describe']);router[_0xe46d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe46d('0xa')]);router[_0xe46d('0xb')]('/',auth['isAuthenticated'](),controller[_0xe46d('0xc')]);router[_0xe46d('0xd')](_0xe46d('0xe'),auth['isAuthenticated'](),controller[_0xe46d('0xf')]);router[_0xe46d('0x10')]('/:id',auth[_0xe46d('0x9')](),controller[_0xe46d('0x11')]);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 1dc747d..03b9702 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x12bce9,_0x29c528){var _0x59adcd=function(_0x1ddd8b){while(--_0x1ddd8b){_0x12bce9['push'](_0x12bce9['shift']());}};_0x59adcd(++_0x29c528);}(_0x425d,0x1e0));var _0xd425=function(_0x4a8fea,_0x4603f4){_0x4a8fea=_0x4a8fea-0x0;var _0x5e23a4=_0x425d[_0x4a8fea];return _0x5e23a4;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x277eb4,_0x3076f9){var _0x41dfb7=function(_0x426f2f){while(--_0x426f2f){_0x277eb4['push'](_0x277eb4['shift']());}};_0x41dfb7(++_0x3076f9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x33d9b9,_0x5f1969){_0x33d9b9=_0x33d9b9-0x0;var _0x466ae1=_0x8d0e[_0x33d9b9];return _0x466ae1;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 245c473..adae184 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 _0x921d=['VIRTUAL','options','VoiceDialReport','rows','catch','keys','includeAll','include','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','merge','where'];(function(_0x5da82e,_0x2cf875){var _0x49a714=function(_0xc240b0){while(--_0xc240b0){_0x5da82e['push'](_0x5da82e['shift']());}};_0x49a714(++_0x2cf875);}(_0x921d,0x1cf));var _0xd921=function(_0x1aca63,_0xde7170){_0x1aca63=_0x1aca63-0x0;var _0x5dbddb=_0x921d[_0x1aca63];return _0x5dbddb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd921('0x0'));var zipdir=require(_0xd921('0x1'));var jsonpatch=require(_0xd921('0x2'));var rp=require('request-promise');var moment=require(_0xd921('0x3'));var BPromise=require(_0xd921('0x4'));var Mustache=require(_0xd921('0x5'));var util=require(_0xd921('0x6'));var path=require('path');var sox=require(_0xd921('0x7'));var csv=require(_0xd921('0x8'));var ejs=require(_0xd921('0x9'));var fs=require('fs');var fs_extra=require(_0xd921('0xa'));var _=require(_0xd921('0xb'));var squel=require('squel');var crypto=require(_0xd921('0xc'));var jsforce=require(_0xd921('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd921('0x8'));var querystring=require(_0xd921('0xe'));var Papa=require('papaparse');var Redis=require(_0xd921('0xf'));var authService=require(_0xd921('0x10'));var qs=require(_0xd921('0x11'));var as=require(_0xd921('0x12'));var hardwareService=require(_0xd921('0x13'));var logger=require('../../config/logger')(_0xd921('0x14'));var utils=require(_0xd921('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd921('0x16'));var db=require(_0xd921('0x17'))['db'];function respondWithStatusCode(_0x59a672,_0x28592c){_0x28592c=_0x28592c||0xcc;return function(_0x3c4009){if(_0x3c4009){return _0x59a672[_0xd921('0x18')](_0x28592c);}return _0x59a672[_0xd921('0x19')](_0x28592c)[_0xd921('0x1a')]();};}function respondWithResult(_0x373f34,_0x4ded72){_0x4ded72=_0x4ded72||0xc8;return function(_0x3f7c93){if(_0x3f7c93){return _0x373f34[_0xd921('0x19')](_0x4ded72)[_0xd921('0x1b')](_0x3f7c93);}};}function respondWithFilteredResult(_0x3f010e,_0x35824b){return function(_0x3ca9a2){if(_0x3ca9a2){var _0x425fb9=typeof _0x35824b['offset']===_0xd921('0x1c')&&typeof _0x35824b[_0xd921('0x1d')]===_0xd921('0x1c');var _0x195f65=_0x3ca9a2[_0xd921('0x1e')];var _0x3f711b=_0x425fb9?0x0:_0x35824b['offset'];var _0x2474b3=_0x425fb9?_0x3ca9a2[_0xd921('0x1e')]:_0x35824b['offset']+_0x35824b['limit'];var _0x4621f0;if(_0x2474b3>=_0x195f65){_0x2474b3=_0x195f65;_0x4621f0=0xc8;}else{_0x4621f0=0xce;}_0x3f010e[_0xd921('0x19')](_0x4621f0);return _0x3f010e[_0xd921('0x1f')]('Content-Range',_0x3f711b+'-'+_0x2474b3+'/'+_0x195f65)[_0xd921('0x1b')](_0x3ca9a2);}return null;};}function patchUpdates(_0x1baeec){return function(_0x353244){try{jsonpatch[_0xd921('0x20')](_0x353244,_0x1baeec,!![]);}catch(_0x4b7c4e){return BPromise[_0xd921('0x21')](_0x4b7c4e);}return _0x353244[_0xd921('0x22')]();};}function saveUpdates(_0x27bf1a,_0x514e99){return function(_0x5d2784){if(_0x5d2784){return _0x5d2784[_0xd921('0x23')](_0x27bf1a)[_0xd921('0x24')](function(_0x422bad){return _0x422bad;});}return null;};}function removeEntity(_0x488016,_0x296319){return function(_0x525ea6){if(_0x525ea6){return _0x525ea6[_0xd921('0x25')]()[_0xd921('0x24')](function(){_0x488016[_0xd921('0x19')](0xcc)[_0xd921('0x1a')]();});}};}function handleEntityNotFound(_0xf516c0,_0x145603){return function(_0x429f4b){if(!_0x429f4b){_0xf516c0[_0xd921('0x18')](0x194);}return _0x429f4b;};}function handleError(_0x28859a,_0x54755f){_0x54755f=_0x54755f||0x1f4;return function(_0x3f8dba){logger[_0xd921('0x26')](_0x3f8dba[_0xd921('0x27')]);if(_0x3f8dba[_0xd921('0x28')]){delete _0x3f8dba[_0xd921('0x28')];}_0x28859a[_0xd921('0x19')](_0x54755f)[_0xd921('0x29')](_0x3f8dba);};}exports[_0xd921('0x2a')]=function(_0x3c8cf9,_0x5ebb57){var _0x5c4e20={},_0x3c56dc={},_0x7c5674={'count':0x0,'rows':[]};var _0x2b162e=_[_0xd921('0x2b')](db['VoiceDialReport']['rawAttributes'],function(_0x8b700e){return{'name':_0x8b700e[_0xd921('0x2c')],'type':_0x8b700e[_0xd921('0x2d')][_0xd921('0x2e')]};});_0x3c56dc[_0xd921('0x2f')]=_[_0xd921('0x2b')](_0x2b162e,_0xd921('0x28'));_0x3c56dc[_0xd921('0x30')]=_['keys'](_0x3c8cf9[_0xd921('0x30')]);_0x3c56dc[_0xd921('0x31')]=_[_0xd921('0x32')](_0x3c56dc[_0xd921('0x2f')],_0x3c56dc['query']);_0x5c4e20[_0xd921('0x33')]=_[_0xd921('0x32')](_0x3c56dc['model'],qs[_0xd921('0x34')](_0x3c8cf9[_0xd921('0x30')][_0xd921('0x34')]));_0x5c4e20[_0xd921('0x33')]=_0x5c4e20[_0xd921('0x33')][_0xd921('0x35')]?_0x5c4e20[_0xd921('0x33')]:_0x3c56dc['model'];if(!_0x3c8cf9[_0xd921('0x30')][_0xd921('0x36')]('nolimit')){_0x5c4e20['limit']=qs[_0xd921('0x1d')](_0x3c8cf9['query']['limit']);_0x5c4e20[_0xd921('0x37')]=qs['offset'](_0x3c8cf9['query']['offset']);}_0x5c4e20[_0xd921('0x38')]=qs[_0xd921('0x39')](_0x3c8cf9[_0xd921('0x30')][_0xd921('0x39')]);_0x5c4e20['where']=qs[_0xd921('0x31')](_[_0xd921('0x3a')](_0x3c8cf9[_0xd921('0x30')],_0x3c56dc[_0xd921('0x31')]),_0x2b162e);if(_0x3c8cf9[_0xd921('0x30')][_0xd921('0x3b')]){_0x5c4e20['where']=_[_0xd921('0x3c')](_0x5c4e20[_0xd921('0x3d')],{'$or':_['map'](_0x2b162e,function(_0x214f5c){if(_0x214f5c[_0xd921('0x2d')]!==_0xd921('0x3e')){var _0x5034ff={};_0x5034ff[_0x214f5c[_0xd921('0x28')]]={'$like':'%'+_0x3c8cf9[_0xd921('0x30')][_0xd921('0x3b')]+'%'};return _0x5034ff;}})});}_0x5c4e20=_[_0xd921('0x3c')]({},_0x5c4e20,_0x3c8cf9[_0xd921('0x3f')]);var _0x490c47={'where':_0x5c4e20[_0xd921('0x3d')]};return db[_0xd921('0x40')][_0xd921('0x1e')](_0x490c47)[_0xd921('0x24')](function(_0x191a5d){_0x7c5674[_0xd921('0x1e')]=_0x191a5d;if(_0x3c8cf9[_0xd921('0x30')]['includeAll']){_0x5c4e20['include']=[{'all':!![]}];}return db[_0xd921('0x40')]['findAll'](_0x5c4e20);})[_0xd921('0x24')](function(_0xf0810f){_0x7c5674[_0xd921('0x41')]=_0xf0810f;return _0x7c5674;})[_0xd921('0x24')](respondWithFilteredResult(_0x5ebb57,_0x5c4e20))[_0xd921('0x42')](handleError(_0x5ebb57,null));};exports['show']=function(_0x5ed94a,_0x7cb91c){var _0x1eec30={'raw':!![],'where':{'id':_0x5ed94a['params']['id']}},_0x42250e={};_0x42250e['model']=_[_0xd921('0x43')](db['VoiceDialReport']['rawAttributes']);_0x42250e['query']=_[_0xd921('0x43')](_0x5ed94a[_0xd921('0x30')]);_0x42250e[_0xd921('0x31')]=_[_0xd921('0x32')](_0x42250e[_0xd921('0x2f')],_0x42250e['query']);_0x1eec30[_0xd921('0x33')]=_[_0xd921('0x32')](_0x42250e[_0xd921('0x2f')],qs[_0xd921('0x34')](_0x5ed94a[_0xd921('0x30')][_0xd921('0x34')]));_0x1eec30[_0xd921('0x33')]=_0x1eec30['attributes']['length']?_0x1eec30[_0xd921('0x33')]:_0x42250e[_0xd921('0x2f')];if(_0x5ed94a[_0xd921('0x30')][_0xd921('0x44')]){_0x1eec30[_0xd921('0x45')]=[{'all':!![]}];}_0x1eec30=_[_0xd921('0x3c')]({},_0x1eec30,_0x5ed94a['options']);return db[_0xd921('0x40')][_0xd921('0x46')](_0x1eec30)['then'](handleEntityNotFound(_0x7cb91c,null))[_0xd921('0x24')](respondWithResult(_0x7cb91c,null))[_0xd921('0x42')](handleError(_0x7cb91c,null));};exports[_0xd921('0x47')]=function(_0x2c8083,_0x205a90){return db[_0xd921('0x40')][_0xd921('0x47')](_0x2c8083[_0xd921('0x48')],{})[_0xd921('0x24')](respondWithResult(_0x205a90,0xc9))[_0xd921('0x42')](handleError(_0x205a90,null));};exports[_0xd921('0x23')]=function(_0x1bd872,_0x2b16e2){if(_0x1bd872[_0xd921('0x48')]['id']){delete _0x1bd872[_0xd921('0x48')]['id'];}return db[_0xd921('0x40')]['find']({'where':{'id':_0x1bd872[_0xd921('0x49')]['id']}})[_0xd921('0x24')](handleEntityNotFound(_0x2b16e2,null))[_0xd921('0x24')](saveUpdates(_0x1bd872[_0xd921('0x48')],null))[_0xd921('0x24')](respondWithResult(_0x2b16e2,null))['catch'](handleError(_0x2b16e2,null));};exports['destroy']=function(_0x16218a,_0x2668dc){return db[_0xd921('0x40')][_0xd921('0x46')]({'where':{'id':_0x16218a[_0xd921('0x49')]['id']}})[_0xd921('0x24')](handleEntityNotFound(_0x2668dc,null))[_0xd921('0x24')](removeEntity(_0x2668dc,null))['catch'](handleError(_0x2668dc,null));};exports['describe']=function(_0x4b82f0,_0x1437da){return db[_0xd921('0x40')][_0xd921('0x4a')]()[_0xd921('0x24')](respondWithResult(_0x1437da,null))[_0xd921('0x42')](handleError(_0x1437da,null));}; \ No newline at end of file +var _0xf85b=['mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','VoiceDialReport','findAll','rows','catch','show','params','intersection','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x342136,_0x55dab7){var _0x194c7f=function(_0x5e0924){while(--_0x5e0924){_0x342136['push'](_0x342136['shift']());}};_0x194c7f(++_0x55dab7);}(_0xf85b,0xd1));var _0xbf85=function(_0x19e838,_0x1f961d){_0x19e838=_0x19e838-0x0;var _0x343f29=_0xf85b[_0x19e838];return _0x343f29;};'use strict';var emlformat=require(_0xbf85('0x0'));var rimraf=require(_0xbf85('0x1'));var zipdir=require(_0xbf85('0x2'));var jsonpatch=require(_0xbf85('0x3'));var rp=require(_0xbf85('0x4'));var moment=require(_0xbf85('0x5'));var BPromise=require(_0xbf85('0x6'));var Mustache=require(_0xbf85('0x7'));var util=require('util');var path=require(_0xbf85('0x8'));var sox=require('sox');var csv=require(_0xbf85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf85('0xa'));var squel=require('squel');var crypto=require(_0xbf85('0xb'));var jsforce=require(_0xbf85('0xc'));var deskjs=require(_0xbf85('0xd'));var toCsv=require(_0xbf85('0x9'));var querystring=require(_0xbf85('0xe'));var Papa=require(_0xbf85('0xf'));var Redis=require('ioredis');var authService=require(_0xbf85('0x10'));var qs=require(_0xbf85('0x11'));var as=require(_0xbf85('0x12'));var hardwareService=require(_0xbf85('0x13'));var logger=require(_0xbf85('0x14'))('api');var utils=require(_0xbf85('0x15'));var config=require(_0xbf85('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3dd9,_0xe4ad01){_0xe4ad01=_0xe4ad01||0xcc;return function(_0x448a9b){if(_0x448a9b){return _0x2b3dd9[_0xbf85('0x17')](_0xe4ad01);}return _0x2b3dd9[_0xbf85('0x18')](_0xe4ad01)[_0xbf85('0x19')]();};}function respondWithResult(_0x3faa7b,_0x108eab){_0x108eab=_0x108eab||0xc8;return function(_0x353ca4){if(_0x353ca4){return _0x3faa7b[_0xbf85('0x18')](_0x108eab)[_0xbf85('0x1a')](_0x353ca4);}};}function respondWithFilteredResult(_0x2c142e,_0x2b263b){return function(_0x3d0fd6){if(_0x3d0fd6){var _0x247179=typeof _0x2b263b[_0xbf85('0x1b')]===_0xbf85('0x1c')&&typeof _0x2b263b[_0xbf85('0x1d')]===_0xbf85('0x1c');var _0x29608a=_0x3d0fd6[_0xbf85('0x1e')];var _0x5cd00d=_0x247179?0x0:_0x2b263b[_0xbf85('0x1b')];var _0x1fe572=_0x247179?_0x3d0fd6[_0xbf85('0x1e')]:_0x2b263b[_0xbf85('0x1b')]+_0x2b263b[_0xbf85('0x1d')];var _0x5e7eef;if(_0x1fe572>=_0x29608a){_0x1fe572=_0x29608a;_0x5e7eef=0xc8;}else{_0x5e7eef=0xce;}_0x2c142e[_0xbf85('0x18')](_0x5e7eef);return _0x2c142e['set'](_0xbf85('0x1f'),_0x5cd00d+'-'+_0x1fe572+'/'+_0x29608a)[_0xbf85('0x1a')](_0x3d0fd6);}return null;};}function patchUpdates(_0x440319){return function(_0x2204cb){try{jsonpatch['apply'](_0x2204cb,_0x440319,!![]);}catch(_0x4f8c90){return BPromise[_0xbf85('0x20')](_0x4f8c90);}return _0x2204cb[_0xbf85('0x21')]();};}function saveUpdates(_0x261c05,_0x3ccbec){return function(_0x1782ad){if(_0x1782ad){return _0x1782ad[_0xbf85('0x22')](_0x261c05)['then'](function(_0xee8851){return _0xee8851;});}return null;};}function removeEntity(_0x4db421,_0x527995){return function(_0x8ced51){if(_0x8ced51){return _0x8ced51[_0xbf85('0x23')]()[_0xbf85('0x24')](function(){_0x4db421['status'](0xcc)[_0xbf85('0x19')]();});}};}function handleEntityNotFound(_0x269afe,_0x56265d){return function(_0x2be921){if(!_0x2be921){_0x269afe['sendStatus'](0x194);}return _0x2be921;};}function handleError(_0x645c07,_0x53779c){_0x53779c=_0x53779c||0x1f4;return function(_0xe760d0){logger[_0xbf85('0x25')](_0xe760d0[_0xbf85('0x26')]);if(_0xe760d0[_0xbf85('0x27')]){delete _0xe760d0[_0xbf85('0x27')];}_0x645c07[_0xbf85('0x18')](_0x53779c)['send'](_0xe760d0);};}exports[_0xbf85('0x28')]=function(_0x9367b,_0x41ece4){var _0x1737ed={},_0xfff0d2={},_0x55bef9={'count':0x0,'rows':[]};var _0x3a1d89=_[_0xbf85('0x29')](db['VoiceDialReport'][_0xbf85('0x2a')],function(_0x7dc7d2){return{'name':_0x7dc7d2[_0xbf85('0x2b')],'type':_0x7dc7d2[_0xbf85('0x2c')]['key']};});_0xfff0d2[_0xbf85('0x2d')]=_[_0xbf85('0x29')](_0x3a1d89,_0xbf85('0x27'));_0xfff0d2['query']=_[_0xbf85('0x2e')](_0x9367b['query']);_0xfff0d2[_0xbf85('0x2f')]=_['intersection'](_0xfff0d2[_0xbf85('0x2d')],_0xfff0d2[_0xbf85('0x30')]);_0x1737ed[_0xbf85('0x31')]=_['intersection'](_0xfff0d2[_0xbf85('0x2d')],qs[_0xbf85('0x32')](_0x9367b['query'][_0xbf85('0x32')]));_0x1737ed[_0xbf85('0x31')]=_0x1737ed[_0xbf85('0x31')][_0xbf85('0x33')]?_0x1737ed['attributes']:_0xfff0d2[_0xbf85('0x2d')];if(!_0x9367b['query'][_0xbf85('0x34')](_0xbf85('0x35'))){_0x1737ed[_0xbf85('0x1d')]=qs[_0xbf85('0x1d')](_0x9367b[_0xbf85('0x30')][_0xbf85('0x1d')]);_0x1737ed[_0xbf85('0x1b')]=qs[_0xbf85('0x1b')](_0x9367b[_0xbf85('0x30')]['offset']);}_0x1737ed['order']=qs[_0xbf85('0x36')](_0x9367b['query'][_0xbf85('0x36')]);_0x1737ed[_0xbf85('0x37')]=qs['filters'](_[_0xbf85('0x38')](_0x9367b[_0xbf85('0x30')],_0xfff0d2[_0xbf85('0x2f')]),_0x3a1d89);if(_0x9367b[_0xbf85('0x30')][_0xbf85('0x39')]){_0x1737ed['where']=_[_0xbf85('0x3a')](_0x1737ed['where'],{'$or':_[_0xbf85('0x29')](_0x3a1d89,function(_0x3846db){if(_0x3846db[_0xbf85('0x2c')]!==_0xbf85('0x3b')){var _0x5a402e={};_0x5a402e[_0x3846db[_0xbf85('0x27')]]={'$like':'%'+_0x9367b[_0xbf85('0x30')][_0xbf85('0x39')]+'%'};return _0x5a402e;}})});}_0x1737ed=_[_0xbf85('0x3a')]({},_0x1737ed,_0x9367b[_0xbf85('0x3c')]);var _0x1b33a0={'where':_0x1737ed[_0xbf85('0x37')]};return db['VoiceDialReport'][_0xbf85('0x1e')](_0x1b33a0)[_0xbf85('0x24')](function(_0x38ab5d){_0x55bef9[_0xbf85('0x1e')]=_0x38ab5d;if(_0x9367b[_0xbf85('0x30')][_0xbf85('0x3d')]){_0x1737ed['include']=[{'all':!![]}];}return db[_0xbf85('0x3e')][_0xbf85('0x3f')](_0x1737ed);})[_0xbf85('0x24')](function(_0x28b45f){_0x55bef9[_0xbf85('0x40')]=_0x28b45f;return _0x55bef9;})[_0xbf85('0x24')](respondWithFilteredResult(_0x41ece4,_0x1737ed))[_0xbf85('0x41')](handleError(_0x41ece4,null));};exports[_0xbf85('0x42')]=function(_0x31890e,_0x5a461d){var _0x229c63={'raw':!![],'where':{'id':_0x31890e[_0xbf85('0x43')]['id']}},_0x11b4e5={};_0x11b4e5[_0xbf85('0x2d')]=_[_0xbf85('0x2e')](db[_0xbf85('0x3e')]['rawAttributes']);_0x11b4e5[_0xbf85('0x30')]=_[_0xbf85('0x2e')](_0x31890e[_0xbf85('0x30')]);_0x11b4e5[_0xbf85('0x2f')]=_[_0xbf85('0x44')](_0x11b4e5[_0xbf85('0x2d')],_0x11b4e5[_0xbf85('0x30')]);_0x229c63[_0xbf85('0x31')]=_[_0xbf85('0x44')](_0x11b4e5[_0xbf85('0x2d')],qs[_0xbf85('0x32')](_0x31890e['query'][_0xbf85('0x32')]));_0x229c63[_0xbf85('0x31')]=_0x229c63['attributes'][_0xbf85('0x33')]?_0x229c63[_0xbf85('0x31')]:_0x11b4e5[_0xbf85('0x2d')];if(_0x31890e['query'][_0xbf85('0x3d')]){_0x229c63['include']=[{'all':!![]}];}_0x229c63=_[_0xbf85('0x3a')]({},_0x229c63,_0x31890e['options']);return db[_0xbf85('0x3e')][_0xbf85('0x45')](_0x229c63)['then'](handleEntityNotFound(_0x5a461d,null))[_0xbf85('0x24')](respondWithResult(_0x5a461d,null))[_0xbf85('0x41')](handleError(_0x5a461d,null));};exports['create']=function(_0x28f7b1,_0x516ed9){return db[_0xbf85('0x3e')]['create'](_0x28f7b1[_0xbf85('0x46')],{})[_0xbf85('0x24')](respondWithResult(_0x516ed9,0xc9))[_0xbf85('0x41')](handleError(_0x516ed9,null));};exports[_0xbf85('0x22')]=function(_0x58390a,_0x50abb5){if(_0x58390a[_0xbf85('0x46')]['id']){delete _0x58390a[_0xbf85('0x46')]['id'];}return db[_0xbf85('0x3e')][_0xbf85('0x45')]({'where':{'id':_0x58390a[_0xbf85('0x43')]['id']}})[_0xbf85('0x24')](handleEntityNotFound(_0x50abb5,null))['then'](saveUpdates(_0x58390a[_0xbf85('0x46')],null))[_0xbf85('0x24')](respondWithResult(_0x50abb5,null))[_0xbf85('0x41')](handleError(_0x50abb5,null));};exports[_0xbf85('0x23')]=function(_0x4461e1,_0x38218a){return db[_0xbf85('0x3e')][_0xbf85('0x45')]({'where':{'id':_0x4461e1[_0xbf85('0x43')]['id']}})[_0xbf85('0x24')](handleEntityNotFound(_0x38218a,null))['then'](removeEntity(_0x38218a,null))[_0xbf85('0x41')](handleError(_0x38218a,null));};exports['describe']=function(_0x3a9f40,_0x42e0d1){return db[_0xbf85('0x3e')][_0xbf85('0x47')]()[_0xbf85('0x24')](respondWithResult(_0x42e0d1,null))[_0xbf85('0x41')](handleError(_0x42e0d1,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5268c04..b7564da 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 _0xe526=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','uniqueid','util','api'];(function(_0x30b076,_0x8d6de2){var _0x5eef6e=function(_0x3910af){while(--_0x3910af){_0x30b076['push'](_0x30b076['shift']());}};_0x5eef6e(++_0x8d6de2);}(_0xe526,0x6c));var _0x6e52=function(_0x5d2d4f,_0x4b7dde){_0x5d2d4f=_0x5d2d4f-0x0;var _0x5e1044=_0xe526[_0x5d2d4f];return _0x5e1044;};'use strict';var _=require('lodash');var util=require(_0x6e52('0x0'));var logger=require('../../config/logger')(_0x6e52('0x1'));var moment=require('moment');var BPromise=require(_0x6e52('0x2'));var rp=require(_0x6e52('0x3'));var fs=require('fs');var path=require(_0x6e52('0x4'));var rimraf=require(_0x6e52('0x5'));var config=require(_0x6e52('0x6'));var attributes=require(_0x6e52('0x7'));module['exports']=function(_0xf6cc3a,_0x652124){return _0xf6cc3a[_0x6e52('0x8')](_0x6e52('0x9'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x6e52('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94cf=['VoiceDialReport','report_dial','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2b80c3,_0x37315f){var _0xd975c8=function(_0xba5ec6){while(--_0xba5ec6){_0x2b80c3['push'](_0x2b80c3['shift']());}};_0xd975c8(++_0x37315f);}(_0x94cf,0xc2));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf94c('0x0'));var logger=require(_0xf94c('0x1'))(_0xf94c('0x2'));var moment=require('moment');var BPromise=require(_0xf94c('0x3'));var rp=require(_0xf94c('0x4'));var fs=require('fs');var path=require(_0xf94c('0x5'));var rimraf=require(_0xf94c('0x6'));var config=require(_0xf94c('0x7'));var attributes=require(_0xf94c('0x8'));module[_0xf94c('0x9')]=function(_0x1c0879,_0x139ac3){return _0x1c0879['define'](_0xf94c('0xa'),attributes,{'tableName':_0xf94c('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 0ec2a96..d3d2fa3 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 _0x7cfd=['../../config/environment','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','VoiceDialReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19359a,_0x2f2c09){var _0x1231af=function(_0x15e097){while(--_0x15e097){_0x19359a['push'](_0x19359a['shift']());}};_0x1231af(++_0x2f2c09);}(_0x7cfd,0xd8));var _0xd7cf=function(_0x52d7c1,_0x5f1d4e){_0x52d7c1=_0x52d7c1-0x0;var _0x5752e9=_0x7cfd[_0x52d7c1];return _0x5752e9;};'use strict';var _=require('lodash');var util=require(_0xd7cf('0x0'));var moment=require(_0xd7cf('0x1'));var BPromise=require(_0xd7cf('0x2'));var rs=require(_0xd7cf('0x3'));var fs=require('fs');var Redis=require(_0xd7cf('0x4'));var db=require(_0xd7cf('0x5'))['db'];var utils=require(_0xd7cf('0x6'));var logger=require(_0xd7cf('0x7'))('rpc');var config=require(_0xd7cf('0x8'));var jayson=require(_0xd7cf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x334ae2,_0x4ba33e,_0x2a29f9){return new BPromise(function(_0x1423ec,_0x3d5bca){return client[_0xd7cf('0xa')](_0x334ae2,_0x2a29f9)[_0xd7cf('0xb')](function(_0x242386){logger[_0xd7cf('0xc')](_0xd7cf('0xd'),_0x4ba33e,_0xd7cf('0xe'));logger[_0xd7cf('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4ba33e,_0xd7cf('0xe'),JSON['stringify'](_0x242386));if(_0x242386[_0xd7cf('0x10')]){if(_0x242386[_0xd7cf('0x10')][_0xd7cf('0x11')]===0x1f4){logger[_0xd7cf('0x10')](_0xd7cf('0xd'),_0x4ba33e,_0x242386[_0xd7cf('0x10')][_0xd7cf('0x12')]);return _0x3d5bca(_0x242386[_0xd7cf('0x10')][_0xd7cf('0x12')]);}logger['error'](_0xd7cf('0xd'),_0x4ba33e,_0x242386['error'][_0xd7cf('0x12')]);return _0x1423ec(_0x242386[_0xd7cf('0x10')][_0xd7cf('0x12')]);}else{logger[_0xd7cf('0xc')](_0xd7cf('0xd'),_0x4ba33e,_0xd7cf('0xe'));_0x1423ec(_0x242386[_0xd7cf('0x13')][_0xd7cf('0x12')]);}})[_0xd7cf('0x14')](function(_0x1ecc3b){logger[_0xd7cf('0x10')](_0xd7cf('0xd'),_0x4ba33e,_0x1ecc3b);_0x3d5bca(_0x1ecc3b);});});}exports[_0xd7cf('0x15')]=function(_0x292c91){var _0x3a38ca=this;return new Promise(function(_0x38409e,_0xefed02){return db['VoiceDialReport'][_0xd7cf('0x16')](_0x292c91[_0xd7cf('0x17')],{'raw':_0x292c91[_0xd7cf('0x18')]?_0x292c91[_0xd7cf('0x18')][_0xd7cf('0x19')]===undefined?!![]:![]:!![]})[_0xd7cf('0xb')](function(_0x4a162f){logger[_0xd7cf('0xc')](_0xd7cf('0x15'),_0x292c91);logger[_0xd7cf('0xf')](_0xd7cf('0x15'),_0x292c91,JSON[_0xd7cf('0x1a')](_0x4a162f));_0x38409e(_0x4a162f);})['catch'](function(_0x1ee6de){logger[_0xd7cf('0x10')]('CreateVoiceDialReport',_0x1ee6de[_0xd7cf('0x12')],_0x292c91);_0xefed02(_0x3a38ca[_0xd7cf('0x10')](0x1f4,_0x1ee6de[_0xd7cf('0x12')]));});});};exports[_0xd7cf('0x1b')]=function(_0x6e29ee){var _0x3bfb5f=this;return new Promise(function(_0x2bc5f8,_0x2e4a2e){return db[_0xd7cf('0x1c')]['update'](_0x6e29ee[_0xd7cf('0x17')],{'raw':_0x6e29ee[_0xd7cf('0x18')]?_0x6e29ee[_0xd7cf('0x18')][_0xd7cf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6e29ee[_0xd7cf('0x18')]?_0x6e29ee[_0xd7cf('0x18')][_0xd7cf('0x1d')]||null:null,'attributes':_0x6e29ee[_0xd7cf('0x18')]?_0x6e29ee['options'][_0xd7cf('0x1e')]||null:null,'limit':_0x6e29ee[_0xd7cf('0x18')]?_0x6e29ee[_0xd7cf('0x18')][_0xd7cf('0x1f')]||null:null})['then'](function(_0x349d6c){logger[_0xd7cf('0xc')](_0xd7cf('0x1b'),_0x6e29ee);logger[_0xd7cf('0xf')](_0xd7cf('0x1b'),_0x6e29ee,JSON['stringify'](_0x349d6c));_0x2bc5f8(_0x349d6c);})['catch'](function(_0x439904){logger[_0xd7cf('0x10')]('UpdateVoiceDialReport',_0x439904[_0xd7cf('0x12')],_0x6e29ee);_0x2e4a2e(_0x3bfb5f[_0xd7cf('0x10')](0x1f4,_0x439904[_0xd7cf('0x12')]));});});}; \ No newline at end of file +var _0xca82=['CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','UpdateVoiceDialReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x3ea3e4,_0xb8d7b5){var _0x508411=function(_0x8a1f68){while(--_0x8a1f68){_0x3ea3e4['push'](_0x3ea3e4['shift']());}};_0x508411(++_0xb8d7b5);}(_0xca82,0x10b));var _0x2ca8=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xca82[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x2ca8('0x0'));var util=require(_0x2ca8('0x1'));var moment=require(_0x2ca8('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ca8('0x3'));var fs=require('fs');var Redis=require(_0x2ca8('0x4'));var db=require(_0x2ca8('0x5'))['db'];var utils=require(_0x2ca8('0x6'));var logger=require(_0x2ca8('0x7'))(_0x2ca8('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ca8('0x9'));var client=jayson['client'][_0x2ca8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x275511,_0x5f4ea4,_0x23cb0f){return new BPromise(function(_0x5e0282,_0x19a1fa){return client[_0x2ca8('0xb')](_0x275511,_0x23cb0f)['then'](function(_0x411b2f){logger['info'](_0x2ca8('0xc'),_0x5f4ea4,_0x2ca8('0xd'));logger[_0x2ca8('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5f4ea4,_0x2ca8('0xd'),JSON[_0x2ca8('0xf')](_0x411b2f));if(_0x411b2f[_0x2ca8('0x10')]){if(_0x411b2f[_0x2ca8('0x10')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5f4ea4,_0x411b2f[_0x2ca8('0x10')][_0x2ca8('0x11')]);return _0x19a1fa(_0x411b2f[_0x2ca8('0x10')][_0x2ca8('0x11')]);}logger['error'](_0x2ca8('0xc'),_0x5f4ea4,_0x411b2f[_0x2ca8('0x10')][_0x2ca8('0x11')]);return _0x5e0282(_0x411b2f[_0x2ca8('0x10')][_0x2ca8('0x11')]);}else{logger[_0x2ca8('0x12')](_0x2ca8('0xc'),_0x5f4ea4,_0x2ca8('0xd'));_0x5e0282(_0x411b2f[_0x2ca8('0x13')][_0x2ca8('0x11')]);}})[_0x2ca8('0x14')](function(_0x2a8028){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5f4ea4,_0x2a8028);_0x19a1fa(_0x2a8028);});});}exports[_0x2ca8('0x15')]=function(_0x52f2ea){var _0x56de27=this;return new Promise(function(_0x1e7929,_0xd9de1f){return db[_0x2ca8('0x16')][_0x2ca8('0x17')](_0x52f2ea[_0x2ca8('0x18')],{'raw':_0x52f2ea[_0x2ca8('0x19')]?_0x52f2ea['options'][_0x2ca8('0x1a')]===undefined?!![]:![]:!![]})[_0x2ca8('0x1b')](function(_0x5f16a1){logger[_0x2ca8('0x12')]('CreateVoiceDialReport',_0x52f2ea);logger[_0x2ca8('0xe')](_0x2ca8('0x15'),_0x52f2ea,JSON['stringify'](_0x5f16a1));_0x1e7929(_0x5f16a1);})['catch'](function(_0x273aa4){logger[_0x2ca8('0x10')](_0x2ca8('0x15'),_0x273aa4[_0x2ca8('0x11')],_0x52f2ea);_0xd9de1f(_0x56de27[_0x2ca8('0x10')](0x1f4,_0x273aa4[_0x2ca8('0x11')]));});});};exports[_0x2ca8('0x1c')]=function(_0x131860){var _0x31519d=this;return new Promise(function(_0x4e9208,_0x30b42e){return db['VoiceDialReport']['update'](_0x131860[_0x2ca8('0x18')],{'raw':_0x131860[_0x2ca8('0x19')]?_0x131860[_0x2ca8('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131860['options']?_0x131860['options'][_0x2ca8('0x1d')]||null:null,'attributes':_0x131860['options']?_0x131860[_0x2ca8('0x19')][_0x2ca8('0x1e')]||null:null,'limit':_0x131860['options']?_0x131860['options'][_0x2ca8('0x1f')]||null:null})[_0x2ca8('0x1b')](function(_0x1c263b){logger['info'](_0x2ca8('0x1c'),_0x131860);logger[_0x2ca8('0xe')](_0x2ca8('0x1c'),_0x131860,JSON['stringify'](_0x1c263b));_0x4e9208(_0x1c263b);})[_0x2ca8('0x14')](function(_0x1a2dc7){logger[_0x2ca8('0x10')]('UpdateVoiceDialReport',_0x1a2dc7[_0x2ca8('0x11')],_0x131860);_0x30b42e(_0x31519d[_0x2ca8('0x10')](0x1f4,_0x1a2dc7[_0x2ca8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 34a2f25..52f07a8 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 _0x89bd=['get','/:id','show','create','/:id/applications','addApplications','put','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x444bb3,_0x4e4f03){var _0x18de2c=function(_0x4de2ef){while(--_0x4de2ef){_0x444bb3['push'](_0x444bb3['shift']());}};_0x18de2c(++_0x4e4f03);}(_0x89bd,0xb5));var _0xd89b=function(_0x4c5276,_0x29c86c){_0x4c5276=_0x4c5276-0x0;var _0x17d86a=_0x89bd[_0x4c5276];return _0x17d86a;};'use strict';var multer=require(_0xd89b('0x0'));var util=require(_0xd89b('0x1'));var path=require(_0xd89b('0x2'));var timeout=require('connect-timeout');var express=require(_0xd89b('0x3'));var router=express[_0xd89b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd89b('0x5'));var config=require(_0xd89b('0x6'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xd89b('0x7')](),controller[_0xd89b('0x8')]);router[_0xd89b('0x9')](_0xd89b('0xa'),auth['isAuthenticated'](),controller[_0xd89b('0xb')]);router['post']('/',auth[_0xd89b('0x7')](),controller[_0xd89b('0xc')]);router['post'](_0xd89b('0xd'),auth[_0xd89b('0x7')](),controller[_0xd89b('0xe')]);router[_0xd89b('0xf')](_0xd89b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xd89b('0x10')](_0xd89b('0xa'),auth['isAuthenticated'](),controller[_0xd89b('0x11')]);module[_0xd89b('0x12')]=router; \ No newline at end of file +var _0xbee6=['post','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show'];(function(_0x25cd63,_0x3e4f82){var _0x312099=function(_0x3ce6ef){while(--_0x3ce6ef){_0x25cd63['push'](_0x25cd63['shift']());}};_0x312099(++_0x3e4f82);}(_0xbee6,0xce));var _0x6bee=function(_0x2c7ec5,_0x43e06c){_0x2c7ec5=_0x2c7ec5-0x0;var _0x3c6c0a=_0xbee6[_0x2c7ec5];return _0x3c6c0a;};'use strict';var multer=require(_0x6bee('0x0'));var util=require('util');var path=require(_0x6bee('0x1'));var timeout=require(_0x6bee('0x2'));var express=require(_0x6bee('0x3'));var router=express[_0x6bee('0x4')]();var fs_extra=require(_0x6bee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6bee('0x6'));var config=require(_0x6bee('0x7'));var controller=require(_0x6bee('0x8'));router[_0x6bee('0x9')]('/',auth[_0x6bee('0xa')](),controller[_0x6bee('0xb')]);router[_0x6bee('0x9')](_0x6bee('0xc'),auth[_0x6bee('0xa')](),controller[_0x6bee('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6bee('0xe')](_0x6bee('0xf'),auth['isAuthenticated'](),controller[_0x6bee('0x10')]);router[_0x6bee('0x11')](_0x6bee('0xc'),auth[_0x6bee('0xa')](),controller[_0x6bee('0x12')]);router[_0x6bee('0x13')](_0x6bee('0xc'),auth[_0x6bee('0xa')](),controller[_0x6bee('0x14')]);module[_0x6bee('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index aa92e61..3ebc2c9 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 _0x4e5d=['compositeIndex','STRING','NoOp','outbound','internal','inbound-fax','outbound-fax','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','exports'];(function(_0x2ad19a,_0xb1e06a){var _0x4e4e65=function(_0x4aedaa){while(--_0x4aedaa){_0x2ad19a['push'](_0x2ad19a['shift']());}};_0x4e4e65(++_0xb1e06a);}(_0x4e5d,0xb3));var _0xd4e5=function(_0x5c59f0,_0x222e3d){_0x5c59f0=_0x5c59f0-0x0;var _0x1c87e8=_0x4e5d[_0x5c59f0];return _0x1c87e8;};'use strict';var Sequelize=require('sequelize');module[_0xd4e5('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd4e5('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd4e5('0x2')],'allowNull':![],'unique':_0xd4e5('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xd4e5('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd4e5('0x2')],'allowNull':![],'defaultValue':_0xd4e5('0x3')},'appdata':{'type':Sequelize[_0xd4e5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xd4e5('0x4'),_0xd4e5('0x5'),_0xd4e5('0x6'),_0xd4e5('0x7'),'system',_0xd4e5('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xd4e5('0x2')]},'interval':{'type':Sequelize[_0xd4e5('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xd4e5('0x9')]},'isApp':{'type':Sequelize[_0xd4e5('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd4e5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xd4e5('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd4e5('0x9')]},'recordingFormat':{'type':Sequelize[_0xd4e5('0x2')],'defaultValue':_0xd4e5('0xb')},'answer':{'type':Sequelize[_0xd4e5('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd4e5('0xc')],'get':function(_0xbbeaf7){return this[_0xd4e5('0xd')](_0xd4e5('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x652d=['VIRTUAL','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav'];(function(_0x4fa5e3,_0x2f75dc){var _0x1a2f1e=function(_0x5bcfc0){while(--_0x5bcfc0){_0x4fa5e3['push'](_0x4fa5e3['shift']());}};_0x1a2f1e(++_0x2f75dc);}(_0x652d,0x141));var _0xd652=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x652d[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xd652('0x0'));module[_0xd652('0x1')]={'context':{'type':Sequelize[_0xd652('0x2')],'allowNull':![],'unique':_0xd652('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd652('0x2')],'allowNull':![],'unique':_0xd652('0x3')},'priority':{'type':Sequelize[_0xd652('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xd652('0x3')},'tag':{'type':Sequelize[_0xd652('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd652('0x4')},'appdata':{'type':Sequelize[_0xd652('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd652('0x5')](_0xd652('0x6'),_0xd652('0x7'),_0xd652('0x8'),_0xd652('0x9'),_0xd652('0xa'),_0xd652('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd652('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xd652('0xc')]},'isApp':{'type':Sequelize[_0xd652('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd652('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xd652('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xd652('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xd652('0x2')],'defaultValue':_0xd652('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xd652('0xf')],'get':function(_0x44875a){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xd652('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 89dd6b0..03c3337 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 _0xa7be=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','rawAttributes','include','params','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','cast(priority\x20as\x20unsigned)','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','UserProfileResource','destroy','stack','name','send','index','VoiceExtension','fieldName','key','model'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0xa7be,0x19a));var _0xea7b=function(_0x9b360d,_0x3a0e88){_0x9b360d=_0x9b360d-0x0;var _0x45e2da=_0xa7be[_0x9b360d];return _0x45e2da;};'use strict';var _=require('lodash');var Redis=require(_0xea7b('0x0'));var qs=require(_0xea7b('0x1'));var logger=require(_0xea7b('0x2'))(_0xea7b('0x3'));var config=require(_0xea7b('0x4'));var db=require(_0xea7b('0x5'))['db'];config[_0xea7b('0x6')]=_[_0xea7b('0x7')](config['redis'],{'host':_0xea7b('0x8'),'port':0x18eb});var socket=require(_0xea7b('0x9'))(new Redis(config[_0xea7b('0x6')]));require(_0xea7b('0xa'))[_0xea7b('0xb')](socket);function respondWithStatusCode(_0x39ab9a,_0x543563){_0x543563=_0x543563||0xcc;return function(_0x383e72){if(_0x383e72){return _0x39ab9a[_0xea7b('0xc')](_0x543563);}return _0x39ab9a['status'](_0x543563)[_0xea7b('0xd')]();};}function respondWithResult(_0xb67a6b,_0xab0a38){_0xab0a38=_0xab0a38||0xc8;return function(_0x1d5076){if(_0x1d5076){return _0xb67a6b[_0xea7b('0xe')](_0xab0a38)[_0xea7b('0xf')](_0x1d5076);}};}function respondWithFilteredResult(_0x1e7fa4,_0x396d2c){return function(_0x389678){if(_0x389678){var _0x377c11=typeof _0x396d2c[_0xea7b('0x10')]===_0xea7b('0x11')&&typeof _0x396d2c[_0xea7b('0x12')]===_0xea7b('0x11');var _0x2be989=_0x389678['count'];var _0x9a055e=_0x377c11?0x0:_0x396d2c[_0xea7b('0x10')];var _0x50725b=_0x377c11?_0x389678[_0xea7b('0x13')]:_0x396d2c['offset']+_0x396d2c[_0xea7b('0x12')];var _0x769410;if(_0x50725b>=_0x2be989){_0x50725b=_0x2be989;_0x769410=0xc8;}else{_0x769410=0xce;}_0x1e7fa4[_0xea7b('0xe')](_0x769410);return _0x1e7fa4['set'](_0xea7b('0x14'),_0x9a055e+'-'+_0x50725b+'/'+_0x2be989)[_0xea7b('0xf')](_0x389678);}return null;};}function removeEntity(_0x5ce575){return function(_0x345446){if(_0x345446){return _0x345446['destroy']()[_0xea7b('0x15')](function(){var _0x2295d5=_0x345446[_0xea7b('0x16')]({'plain':!![]});var _0x3436fd=[{'name':_0xea7b('0x17'),'value':_0xea7b('0x18'),'ignore':![]},{'name':_0xea7b('0x19'),'value':_0xea7b('0x1a'),'ignore':![]},{'name':_0xea7b('0x1b'),'value':_0xea7b('0x1c'),'ignore':![]}];var _0x3a94b5=_(_0x3436fd)[_0xea7b('0x1d')](_0xea7b('0x1e'))[_0xea7b('0x1f')]('value')[_0xea7b('0x20')]();if(_['includes'](_0x3a94b5,_0x2295d5[_0xea7b('0x21')])){return;}var _0x54e295=_[_0xea7b('0x22')](_0x3436fd,[_0xea7b('0x20'),_0x2295d5[_0xea7b('0x21')]])['name'];return db[_0xea7b('0x23')][_0xea7b('0x24')]({'where':{'type':_0x54e295,'resourceId':_0x2295d5['id']}})[_0xea7b('0x15')](function(){return _0x345446;});})[_0xea7b('0x15')](function(){_0x5ce575[_0xea7b('0xe')](0xcc)[_0xea7b('0xd')]();});}};}function handleEntityNotFound(_0x1328f7){return function(_0x35e63d){if(!_0x35e63d){_0x1328f7[_0xea7b('0xc')](0x194);}return _0x35e63d;};}function handleError(_0x1900cf,_0xa08791){_0xa08791=_0xa08791||0x1f4;return function(_0x2c359a){logger['error'](_0x2c359a[_0xea7b('0x25')]);if(_0x2c359a[_0xea7b('0x26')]){delete _0x2c359a[_0xea7b('0x26')];}_0x1900cf[_0xea7b('0xe')](_0xa08791)[_0xea7b('0x27')](_0x2c359a);};}exports[_0xea7b('0x28')]=function(_0x5b9172,_0x2b8967){var _0xba0b92={},_0x22d121={},_0x150fae={'count':0x0,'rows':[]};var _0x525d7f=_['map'](db[_0xea7b('0x29')]['rawAttributes'],function(_0x39ed38){return{'name':_0x39ed38[_0xea7b('0x2a')],'type':_0x39ed38[_0xea7b('0x21')][_0xea7b('0x2b')]};});_0x22d121[_0xea7b('0x2c')]=_[_0xea7b('0x1f')](_0x525d7f,_0xea7b('0x26'));_0x22d121[_0xea7b('0x2d')]=_['keys'](_0x5b9172[_0xea7b('0x2d')]);_0x22d121[_0xea7b('0x2e')]=_[_0xea7b('0x2f')](_0x22d121['model'],_0x22d121[_0xea7b('0x2d')]);_0xba0b92['attributes']=_['intersection'](_0x22d121[_0xea7b('0x2c')],qs[_0xea7b('0x30')](_0x5b9172['query'][_0xea7b('0x30')]));_0xba0b92[_0xea7b('0x31')]=_0xba0b92[_0xea7b('0x31')][_0xea7b('0x32')]?_0xba0b92[_0xea7b('0x31')]:_0x22d121['model'];if(!_0x5b9172[_0xea7b('0x2d')]['hasOwnProperty'](_0xea7b('0x33'))){_0xba0b92[_0xea7b('0x12')]=qs[_0xea7b('0x12')](_0x5b9172[_0xea7b('0x2d')]['limit']);_0xba0b92[_0xea7b('0x10')]=qs[_0xea7b('0x10')](_0x5b9172['query'][_0xea7b('0x10')]);}_0xba0b92[_0xea7b('0x34')]=qs[_0xea7b('0x35')](_0x5b9172[_0xea7b('0x2d')][_0xea7b('0x35')]);_0xba0b92[_0xea7b('0x36')]=qs[_0xea7b('0x2e')](_['pick'](_0x5b9172['query'],_0x22d121['filters']),_0x525d7f);if(_0x5b9172[_0xea7b('0x2d')][_0xea7b('0x1d')]){_0xba0b92['where']=_[_0xea7b('0x37')](_0xba0b92[_0xea7b('0x36')],{'$or':_[_0xea7b('0x1f')](_0x525d7f,function(_0x507bb6){if(_0x507bb6[_0xea7b('0x21')]!==_0xea7b('0x38')){var _0x1615bf={};_0x1615bf[_0x507bb6[_0xea7b('0x26')]]={'$like':'%'+_0x5b9172[_0xea7b('0x2d')]['filter']+'%'};return _0x1615bf;}})});}_0xba0b92=_['merge']({},_0xba0b92,_0x5b9172[_0xea7b('0x39')]);var _0x21ea6d={'where':_0xba0b92[_0xea7b('0x36')]};return db[_0xea7b('0x29')][_0xea7b('0x13')](_0x21ea6d)['then'](function(_0xc267b2){_0x150fae[_0xea7b('0x13')]=_0xc267b2;if(_0x5b9172[_0xea7b('0x2d')][_0xea7b('0x3a')]){_0xba0b92['include']=[{'all':!![]}];}return db[_0xea7b('0x29')]['findAll'](_0xba0b92);})[_0xea7b('0x15')](function(_0x4dfca3){_0x150fae[_0xea7b('0x3b')]=_0x4dfca3;return _0x150fae;})[_0xea7b('0x15')](respondWithFilteredResult(_0x2b8967,_0xba0b92))[_0xea7b('0x3c')](handleError(_0x2b8967,null));};exports[_0xea7b('0x3d')]=function(_0x20a996,_0x4850fc){var _0x23f3c0={'raw':![],'where':{'id':_0x20a996['params']['id']}},_0x2be794={};_0x2be794['model']=_[_0xea7b('0x3e')](db[_0xea7b('0x29')][_0xea7b('0x3f')]);_0x2be794[_0xea7b('0x2d')]=_[_0xea7b('0x3e')](_0x20a996['query']);_0x2be794[_0xea7b('0x2e')]=_['intersection'](_0x2be794[_0xea7b('0x2c')],_0x2be794[_0xea7b('0x2d')]);_0x23f3c0[_0xea7b('0x31')]=_[_0xea7b('0x2f')](_0x2be794[_0xea7b('0x2c')],qs[_0xea7b('0x30')](_0x20a996[_0xea7b('0x2d')][_0xea7b('0x30')]));_0x23f3c0[_0xea7b('0x31')]=_0x23f3c0[_0xea7b('0x31')][_0xea7b('0x32')]?_0x23f3c0[_0xea7b('0x31')]:_0x2be794['model'];if(_0x20a996[_0xea7b('0x2d')]['includeAll']){_0x23f3c0[_0xea7b('0x40')]=[{'all':!![]}];}_0x23f3c0=_['merge']({},_0x23f3c0,_0x20a996[_0xea7b('0x39')]);return db['VoiceExtension'][_0xea7b('0x22')](_0x23f3c0)[_0xea7b('0x15')](handleEntityNotFound(_0x4850fc,null))[_0xea7b('0x15')](respondWithResult(_0x4850fc,null))[_0xea7b('0x3c')](handleError(_0x4850fc,null));};exports[_0xea7b('0x24')]=function(_0x34c8d3,_0x3de165){return db['VoiceExtension'][_0xea7b('0x22')]({'where':{'id':_0x34c8d3[_0xea7b('0x41')]['id']}})[_0xea7b('0x15')](handleEntityNotFound(_0x3de165,null))[_0xea7b('0x15')](removeEntity(_0x3de165,null))[_0xea7b('0x3c')](handleError(_0x3de165,null));};exports[_0xea7b('0x42')]=function(_0x51afbc,_0x167bd0){if(_0x51afbc[_0xea7b('0x43')]['type']==='outbound'&&!_[_0xea7b('0x44')](_0x51afbc[_0xea7b('0x43')][_0xea7b('0x45')],'_')){_0x51afbc[_0xea7b('0x43')][_0xea7b('0x45')]='_'[_0xea7b('0x46')](_0x51afbc[_0xea7b('0x43')][_0xea7b('0x45')]);}return db['VoiceExtension'][_0xea7b('0x42')](_0x51afbc[_0xea7b('0x43')],{'raw':![]})['then'](function(_0x3248e4){var _0x1ba74a=_0x51afbc['user']['get']({'plain':!![]});if(!_0x1ba74a)throw new Error(_0xea7b('0x47'));if(_0x1ba74a['role']==='user'){var _0x18fd20=_0x3248e4[_0xea7b('0x16')]({'plain':!![]});var _0xc52be4=[{'name':_0xea7b('0x17'),'value':'inbound'},{'name':_0xea7b('0x19'),'value':_0xea7b('0x1a')},{'name':_0xea7b('0x1b'),'value':'internal'}];var _0x3b785d=_[_0xea7b('0x22')](_0xc52be4,[_0xea7b('0x20'),_0x18fd20[_0xea7b('0x21')]])[_0xea7b('0x26')];return db[_0xea7b('0x48')]['find']({'where':{'name':_0x3b785d,'userProfileId':_0x1ba74a['userProfileId']},'raw':!![]})['then'](function(_0x50f6d1){if(_0x50f6d1&&_0x50f6d1[_0xea7b('0x49')]===0x0){return db[_0xea7b('0x23')][_0xea7b('0x42')]({'name':_0x18fd20[_0xea7b('0x26')],'resourceId':_0x18fd20['id'],'type':_0x50f6d1[_0xea7b('0x26')],'sectionId':_0x50f6d1['id']},{})[_0xea7b('0x15')](function(){return _0x3248e4;});}else{return _0x3248e4;}})[_0xea7b('0x3c')](function(_0x256bce){logger[_0xea7b('0x4a')](_0xea7b('0x4b'),_0x256bce);throw _0x256bce;});}return _0x3248e4;})[_0xea7b('0x15')](respondWithResult(_0x167bd0,0xc9))[_0xea7b('0x3c')](handleError(_0x167bd0,null));};exports['update']=function(_0x12d2c4,_0xe2099e){if(_0x12d2c4['body']['id']){delete _0x12d2c4['body']['id'];}return db[_0xea7b('0x29')][_0xea7b('0x22')]({'where':{'id':_0x12d2c4[_0xea7b('0x41')]['id']}})[_0xea7b('0x15')](handleEntityNotFound(_0xe2099e,null))[_0xea7b('0x15')](function(_0x475297){if(_0x475297){return db[_0xea7b('0x29')]['update'](_[_0xea7b('0x4c')](_0x12d2c4[_0xea7b('0x43')],[_0xea7b('0x45'),_0xea7b('0x4d'),_0xea7b('0x4e'),_0xea7b('0x4f'),'cutdigits','mandatoryDisposition',_0xea7b('0x50')]),{'where':{'context':_0x475297[_0xea7b('0x4d')],'exten':_0x475297['exten']},'individualHooks':!![]})['then'](function(_0x1aa84d){return _0x1aa84d;});}return null;})[_0xea7b('0x15')](respondWithStatusCode(_0xe2099e,null))['catch'](handleError(_0xe2099e,null));};exports[_0xea7b('0x51')]=function(_0x4d27fb,_0x538381){var _0x59476a=_0x4d27fb[_0xea7b('0x41')]['id'];var _0x31955b=_0x4d27fb['body'];var _0x12735c=0xc8;var _0x498d69=null;return db[_0xea7b('0x52')][_0xea7b('0x53')]({'isolationLevel':db[_0xea7b('0x52')]['Transaction'][_0xea7b('0x54')][_0xea7b('0x55')]},function(_0x1afab0){return db[_0xea7b('0x29')][_0xea7b('0x56')]({'where':{'id':_0x59476a},'transaction':_0x1afab0})[_0xea7b('0x15')](function(_0x2afc31){if(_0x2afc31){return db[_0xea7b('0x29')][_0xea7b('0x24')]({'where':{'VoiceExtensionId':_0x59476a},'transaction':_0x1afab0})[_0xea7b('0x15')](function(){var _0x3f3c7a=_[_0xea7b('0x1f')](_0x31955b,function(_0x56f82b){_0x56f82b[_0xea7b('0x57')]=_0x59476a;_0x56f82b[_0xea7b('0x58')]=!![];return _0x56f82b;});return _0x2afc31[_0xea7b('0x59')](_0x3f3c7a);})['then'](function(_0x339261){return db[_0xea7b('0x29')]['bulkCreate'](_0x339261,{'transaction':_0x1afab0});});}else{_0x12735c=0x194;_0x498d69=[];}});})[_0xea7b('0x15')](function(){if(_0x12735c!==0x194){return db[_0xea7b('0x29')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x59476a},'order':_0xea7b('0x5a')})['then'](function(_0x1551fb){_0x498d69=_0x1551fb;});}})['catch'](function(_0x228647){_0x12735c=0x1f4;logger[_0xea7b('0x4a')](_0x228647[_0xea7b('0x25')]);if(_0x228647[_0xea7b('0x26')]){delete _0x228647[_0xea7b('0x26')];}_0x498d69=_0x228647;})['finally'](function(){if(_0x498d69===null){_0x538381[_0xea7b('0xc')](_0x12735c);}else{if(_0x12735c===0x1f4){_0x538381[_0xea7b('0xe')](_0x12735c)['send'](_0x498d69);}else{_0x538381[_0xea7b('0xe')](_0x12735c)[_0xea7b('0xf')](_0x498d69);}}});}; \ No newline at end of file +var _0x8bfc=['addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./voiceExtension.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','VoiceExtension','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','alias'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8bfc,0x71));var _0xc8bf=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x8bfc[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xc8bf('0x0'));var Redis=require('ioredis');var qs=require(_0xc8bf('0x1'));var logger=require(_0xc8bf('0x2'))(_0xc8bf('0x3'));var config=require(_0xc8bf('0x4'));var db=require(_0xc8bf('0x5'))['db'];config[_0xc8bf('0x6')]=_[_0xc8bf('0x7')](config[_0xc8bf('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc8bf('0x8'))['register'](socket);function respondWithStatusCode(_0x4dfd60,_0x40623f){_0x40623f=_0x40623f||0xcc;return function(_0x3f3fe3){if(_0x3f3fe3){return _0x4dfd60[_0xc8bf('0x9')](_0x40623f);}return _0x4dfd60[_0xc8bf('0xa')](_0x40623f)[_0xc8bf('0xb')]();};}function respondWithResult(_0x4cc4b6,_0x325865){_0x325865=_0x325865||0xc8;return function(_0x281ed7){if(_0x281ed7){return _0x4cc4b6['status'](_0x325865)[_0xc8bf('0xc')](_0x281ed7);}};}function respondWithFilteredResult(_0x2701f4,_0x22ae65){return function(_0x2d1b6f){if(_0x2d1b6f){var _0x237098=typeof _0x22ae65[_0xc8bf('0xd')]==='undefined'&&typeof _0x22ae65[_0xc8bf('0xe')]===_0xc8bf('0xf');var _0x46d77e=_0x2d1b6f[_0xc8bf('0x10')];var _0x4f6d35=_0x237098?0x0:_0x22ae65[_0xc8bf('0xd')];var _0xefc11e=_0x237098?_0x2d1b6f[_0xc8bf('0x10')]:_0x22ae65[_0xc8bf('0xd')]+_0x22ae65[_0xc8bf('0xe')];var _0x25f3bb;if(_0xefc11e>=_0x46d77e){_0xefc11e=_0x46d77e;_0x25f3bb=0xc8;}else{_0x25f3bb=0xce;}_0x2701f4[_0xc8bf('0xa')](_0x25f3bb);return _0x2701f4[_0xc8bf('0x11')](_0xc8bf('0x12'),_0x4f6d35+'-'+_0xefc11e+'/'+_0x46d77e)[_0xc8bf('0xc')](_0x2d1b6f);}return null;};}function removeEntity(_0x38b8e1){return function(_0x38ca36){if(_0x38ca36){return _0x38ca36[_0xc8bf('0x13')]()[_0xc8bf('0x14')](function(){var _0x4b56f2=_0x38ca36[_0xc8bf('0x15')]({'plain':!![]});var _0x59551c=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xc8bf('0x16'),'value':_0xc8bf('0x17'),'ignore':![]},{'name':_0xc8bf('0x18'),'value':_0xc8bf('0x19'),'ignore':![]}];var _0x237c0c=_(_0x59551c)[_0xc8bf('0x1a')](_0xc8bf('0x1b'))[_0xc8bf('0x1c')](_0xc8bf('0x1d'))[_0xc8bf('0x1d')]();if(_[_0xc8bf('0x1e')](_0x237c0c,_0x4b56f2[_0xc8bf('0x1f')])){return;}var _0x15c129=_['find'](_0x59551c,['value',_0x4b56f2['type']])[_0xc8bf('0x20')];return db[_0xc8bf('0x21')][_0xc8bf('0x13')]({'where':{'type':_0x15c129,'resourceId':_0x4b56f2['id']}})[_0xc8bf('0x14')](function(){return _0x38ca36;});})[_0xc8bf('0x14')](function(){_0x38b8e1[_0xc8bf('0xa')](0xcc)[_0xc8bf('0xb')]();});}};}function handleEntityNotFound(_0x143507){return function(_0x1a7835){if(!_0x1a7835){_0x143507['sendStatus'](0x194);}return _0x1a7835;};}function handleError(_0x13a6fd,_0x52c1d8){_0x52c1d8=_0x52c1d8||0x1f4;return function(_0x51c39e){logger[_0xc8bf('0x22')](_0x51c39e[_0xc8bf('0x23')]);if(_0x51c39e[_0xc8bf('0x20')]){delete _0x51c39e[_0xc8bf('0x20')];}_0x13a6fd[_0xc8bf('0xa')](_0x52c1d8)['send'](_0x51c39e);};}exports['index']=function(_0x17c2b3,_0x4fddc4){var _0x53824d={},_0x50339c={},_0x404276={'count':0x0,'rows':[]};var _0x38279a=_[_0xc8bf('0x1c')](db[_0xc8bf('0x24')][_0xc8bf('0x25')],function(_0x41b0c6){return{'name':_0x41b0c6['fieldName'],'type':_0x41b0c6[_0xc8bf('0x1f')][_0xc8bf('0x26')]};});_0x50339c[_0xc8bf('0x27')]=_[_0xc8bf('0x1c')](_0x38279a,_0xc8bf('0x20'));_0x50339c[_0xc8bf('0x28')]=_[_0xc8bf('0x29')](_0x17c2b3[_0xc8bf('0x28')]);_0x50339c['filters']=_[_0xc8bf('0x2a')](_0x50339c[_0xc8bf('0x27')],_0x50339c[_0xc8bf('0x28')]);_0x53824d['attributes']=_['intersection'](_0x50339c[_0xc8bf('0x27')],qs['fields'](_0x17c2b3[_0xc8bf('0x28')][_0xc8bf('0x2b')]));_0x53824d[_0xc8bf('0x2c')]=_0x53824d[_0xc8bf('0x2c')][_0xc8bf('0x2d')]?_0x53824d['attributes']:_0x50339c['model'];if(!_0x17c2b3[_0xc8bf('0x28')][_0xc8bf('0x2e')](_0xc8bf('0x2f'))){_0x53824d['limit']=qs[_0xc8bf('0xe')](_0x17c2b3['query'][_0xc8bf('0xe')]);_0x53824d[_0xc8bf('0xd')]=qs[_0xc8bf('0xd')](_0x17c2b3[_0xc8bf('0x28')]['offset']);}_0x53824d[_0xc8bf('0x30')]=qs[_0xc8bf('0x31')](_0x17c2b3['query'][_0xc8bf('0x31')]);_0x53824d[_0xc8bf('0x32')]=qs[_0xc8bf('0x33')](_[_0xc8bf('0x34')](_0x17c2b3['query'],_0x50339c[_0xc8bf('0x33')]),_0x38279a);if(_0x17c2b3[_0xc8bf('0x28')][_0xc8bf('0x1a')]){_0x53824d[_0xc8bf('0x32')]=_['merge'](_0x53824d['where'],{'$or':_[_0xc8bf('0x1c')](_0x38279a,function(_0x2c0e1b){if(_0x2c0e1b['type']!==_0xc8bf('0x35')){var _0x3c2e75={};_0x3c2e75[_0x2c0e1b[_0xc8bf('0x20')]]={'$like':'%'+_0x17c2b3[_0xc8bf('0x28')][_0xc8bf('0x1a')]+'%'};return _0x3c2e75;}})});}_0x53824d=_[_0xc8bf('0x36')]({},_0x53824d,_0x17c2b3[_0xc8bf('0x37')]);var _0xa87475={'where':_0x53824d[_0xc8bf('0x32')]};return db['VoiceExtension'][_0xc8bf('0x10')](_0xa87475)[_0xc8bf('0x14')](function(_0x14d38b){_0x404276[_0xc8bf('0x10')]=_0x14d38b;if(_0x17c2b3[_0xc8bf('0x28')][_0xc8bf('0x38')]){_0x53824d['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xc8bf('0x39')](_0x53824d);})[_0xc8bf('0x14')](function(_0x2b23b2){_0x404276[_0xc8bf('0x3a')]=_0x2b23b2;return _0x404276;})['then'](respondWithFilteredResult(_0x4fddc4,_0x53824d))[_0xc8bf('0x3b')](handleError(_0x4fddc4,null));};exports[_0xc8bf('0x3c')]=function(_0x220d65,_0x23b991){var _0x2591ac={'raw':![],'where':{'id':_0x220d65[_0xc8bf('0x3d')]['id']}},_0x4a474b={};_0x4a474b[_0xc8bf('0x27')]=_['keys'](db[_0xc8bf('0x24')][_0xc8bf('0x25')]);_0x4a474b[_0xc8bf('0x28')]=_['keys'](_0x220d65[_0xc8bf('0x28')]);_0x4a474b['filters']=_['intersection'](_0x4a474b['model'],_0x4a474b[_0xc8bf('0x28')]);_0x2591ac[_0xc8bf('0x2c')]=_[_0xc8bf('0x2a')](_0x4a474b[_0xc8bf('0x27')],qs[_0xc8bf('0x2b')](_0x220d65[_0xc8bf('0x28')][_0xc8bf('0x2b')]));_0x2591ac[_0xc8bf('0x2c')]=_0x2591ac[_0xc8bf('0x2c')][_0xc8bf('0x2d')]?_0x2591ac[_0xc8bf('0x2c')]:_0x4a474b[_0xc8bf('0x27')];if(_0x220d65[_0xc8bf('0x28')][_0xc8bf('0x38')]){_0x2591ac[_0xc8bf('0x3e')]=[{'all':!![]}];}_0x2591ac=_[_0xc8bf('0x36')]({},_0x2591ac,_0x220d65[_0xc8bf('0x37')]);return db[_0xc8bf('0x24')][_0xc8bf('0x3f')](_0x2591ac)[_0xc8bf('0x14')](handleEntityNotFound(_0x23b991,null))[_0xc8bf('0x14')](respondWithResult(_0x23b991,null))[_0xc8bf('0x3b')](handleError(_0x23b991,null));};exports[_0xc8bf('0x13')]=function(_0x12f7b6,_0x520820){return db[_0xc8bf('0x24')][_0xc8bf('0x3f')]({'where':{'id':_0x12f7b6[_0xc8bf('0x3d')]['id']}})[_0xc8bf('0x14')](handleEntityNotFound(_0x520820,null))[_0xc8bf('0x14')](removeEntity(_0x520820,null))[_0xc8bf('0x3b')](handleError(_0x520820,null));};exports[_0xc8bf('0x40')]=function(_0x1a9f6c,_0x1448ff){if(_0x1a9f6c[_0xc8bf('0x41')][_0xc8bf('0x1f')]==='outbound'&&!_[_0xc8bf('0x42')](_0x1a9f6c['body']['exten'],'_')){_0x1a9f6c['body'][_0xc8bf('0x43')]='_'[_0xc8bf('0x44')](_0x1a9f6c['body'][_0xc8bf('0x43')]);}return db[_0xc8bf('0x24')][_0xc8bf('0x40')](_0x1a9f6c[_0xc8bf('0x41')],{'raw':![]})[_0xc8bf('0x14')](function(_0x232ecd){var _0x5c8edc=_0x1a9f6c[_0xc8bf('0x45')]['get']({'plain':!![]});if(!_0x5c8edc)throw new Error(_0xc8bf('0x46'));if(_0x5c8edc[_0xc8bf('0x47')]===_0xc8bf('0x45')){var _0x4b0679=_0x232ecd[_0xc8bf('0x15')]({'plain':!![]});var _0x214234=[{'name':_0xc8bf('0x48'),'value':'inbound'},{'name':_0xc8bf('0x16'),'value':_0xc8bf('0x17')},{'name':_0xc8bf('0x18'),'value':'internal'}];var _0x4bf216=_[_0xc8bf('0x3f')](_0x214234,[_0xc8bf('0x1d'),_0x4b0679[_0xc8bf('0x1f')]])[_0xc8bf('0x20')];return db[_0xc8bf('0x49')]['find']({'where':{'name':_0x4bf216,'userProfileId':_0x5c8edc[_0xc8bf('0x4a')]},'raw':!![]})['then'](function(_0x271bfd){if(_0x271bfd&&_0x271bfd[_0xc8bf('0x4b')]===0x0){return db[_0xc8bf('0x21')][_0xc8bf('0x40')]({'name':_0x4b0679[_0xc8bf('0x20')],'resourceId':_0x4b0679['id'],'type':_0x271bfd[_0xc8bf('0x20')],'sectionId':_0x271bfd['id']},{})['then'](function(){return _0x232ecd;});}else{return _0x232ecd;}})[_0xc8bf('0x3b')](function(_0x24a13e){logger['error'](_0xc8bf('0x4c'),_0x24a13e);throw _0x24a13e;});}return _0x232ecd;})[_0xc8bf('0x14')](respondWithResult(_0x1448ff,0xc9))[_0xc8bf('0x3b')](handleError(_0x1448ff,null));};exports[_0xc8bf('0x4d')]=function(_0x5ecd27,_0x2c9a63){if(_0x5ecd27[_0xc8bf('0x41')]['id']){delete _0x5ecd27[_0xc8bf('0x41')]['id'];}return db[_0xc8bf('0x24')][_0xc8bf('0x3f')]({'where':{'id':_0x5ecd27['params']['id']}})[_0xc8bf('0x14')](handleEntityNotFound(_0x2c9a63,null))[_0xc8bf('0x14')](function(_0x5722b7){if(_0x5722b7){return db[_0xc8bf('0x24')][_0xc8bf('0x4d')](_[_0xc8bf('0x34')](_0x5ecd27[_0xc8bf('0x41')],[_0xc8bf('0x43'),_0xc8bf('0x4e'),_0xc8bf('0x4f'),_0xc8bf('0x50'),_0xc8bf('0x51'),'mandatoryDisposition',_0xc8bf('0x52')]),{'where':{'context':_0x5722b7[_0xc8bf('0x4e')],'exten':_0x5722b7[_0xc8bf('0x43')]},'individualHooks':!![]})[_0xc8bf('0x14')](function(_0x3ea9ff){return _0x3ea9ff;});}return null;})[_0xc8bf('0x14')](respondWithStatusCode(_0x2c9a63,null))[_0xc8bf('0x3b')](handleError(_0x2c9a63,null));};exports[_0xc8bf('0x53')]=function(_0x2328d5,_0x5d3e3e){var _0x13de98=_0x2328d5[_0xc8bf('0x3d')]['id'];var _0x757799=_0x2328d5[_0xc8bf('0x41')];var _0xa9d58a=0xc8;var _0x4e32bc=null;return db[_0xc8bf('0x54')][_0xc8bf('0x55')]({'isolationLevel':db[_0xc8bf('0x54')][_0xc8bf('0x56')][_0xc8bf('0x57')][_0xc8bf('0x58')]},function(_0x2825e9){return db['VoiceExtension'][_0xc8bf('0x59')]({'where':{'id':_0x13de98},'transaction':_0x2825e9})[_0xc8bf('0x14')](function(_0x5b4c78){if(_0x5b4c78){return db[_0xc8bf('0x24')][_0xc8bf('0x13')]({'where':{'VoiceExtensionId':_0x13de98},'transaction':_0x2825e9})['then'](function(){var _0xe55826=_[_0xc8bf('0x1c')](_0x757799,function(_0x45177d){_0x45177d[_0xc8bf('0x5a')]=_0x13de98;_0x45177d[_0xc8bf('0x5b')]=!![];return _0x45177d;});return _0x5b4c78[_0xc8bf('0x5c')](_0xe55826);})[_0xc8bf('0x14')](function(_0x5ef752){return db[_0xc8bf('0x24')][_0xc8bf('0x5d')](_0x5ef752,{'transaction':_0x2825e9});});}else{_0xa9d58a=0x194;_0x4e32bc=[];}});})['then'](function(){if(_0xa9d58a!==0x194){return db[_0xc8bf('0x24')][_0xc8bf('0x5e')]({'where':{'isApp':!![],'VoiceExtensionId':_0x13de98},'order':_0xc8bf('0x5f')})['then'](function(_0x4dfc60){_0x4e32bc=_0x4dfc60;});}})[_0xc8bf('0x3b')](function(_0x855199){_0xa9d58a=0x1f4;logger[_0xc8bf('0x22')](_0x855199[_0xc8bf('0x23')]);if(_0x855199[_0xc8bf('0x20')]){delete _0x855199[_0xc8bf('0x20')];}_0x4e32bc=_0x855199;})[_0xc8bf('0x60')](function(){if(_0x4e32bc===null){_0x5d3e3e['sendStatus'](_0xa9d58a);}else{if(_0xa9d58a===0x1f4){_0x5d3e3e[_0xc8bf('0xa')](_0xa9d58a)[_0xc8bf('0x61')](_0x4e32bc);}else{_0x5d3e3e['status'](_0xa9d58a)['json'](_0x4e32bc);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 59e1615..cc60763 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 _0xcbaf=['update','emit','hasOwnProperty','hook','VoiceExtension','setMaxListeners','save'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xcbaf,0x100));var _0xfcba=function(_0x477332,_0x2ce779){_0x477332=_0x477332-0x0;var _0x1140af=_0xcbaf[_0x477332];return _0x1140af;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xfcba('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfcba('0x1')](0x0);var events={'afterCreate':_0xfcba('0x2'),'afterUpdate':_0xfcba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x20d668){return function(_0x28c3ed,_0x352793,_0x137dbd){VoiceExtensionEvents['emit'](_0x20d668+':'+_0x28c3ed['id'],_0x28c3ed);VoiceExtensionEvents[_0xfcba('0x4')](_0x20d668,_0x28c3ed);_0x137dbd(null);};}for(var e in events){if(events[_0xfcba('0x5')](e)){var event=events[e];VoiceExtension[_0xfcba('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x1edb=['hook','events','setMaxListeners','save','remove','hasOwnProperty'];(function(_0xb98169,_0x104b77){var _0x1c7aa4=function(_0x177eac){while(--_0x177eac){_0xb98169['push'](_0xb98169['shift']());}};_0x1c7aa4(++_0x104b77);}(_0x1edb,0x85));var _0xb1ed=function(_0x3e0b53,_0x354369){_0x3e0b53=_0x3e0b53-0x0;var _0x1f54b0=_0x1edb[_0x3e0b53];return _0x1f54b0;};'use strict';var EventEmitter=require(_0xb1ed('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb1ed('0x1')](0x0);var events={'afterCreate':_0xb1ed('0x2'),'afterUpdate':'update','afterDestroy':_0xb1ed('0x3')};function emitEvent(_0x5923b3){return function(_0x5c8f9,_0x4335d3,_0x96466d){VoiceExtensionEvents['emit'](_0x5923b3+':'+_0x5c8f9['id'],_0x5c8f9);VoiceExtensionEvents['emit'](_0x5923b3,_0x5c8f9);_0x96466d(null);};}for(var e in events){if(events[_0xb1ed('0x4')](e)){var event=events[e];VoiceExtension[_0xb1ed('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index de655d5..5977808 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 _0xbd50=['catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','CDR(type)=','type','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','Set','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','url','split','length','name','param','phone','prefix','SIP','join','options','none','U(xcally-mixmonitor-context)','replace','Interval','findAll','then','interval','*,*,*,*','intervals','IntervalId','map','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','app','toLowerCase','appType','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','outboundDial','appdata','priority','last','concat'];(function(_0x551739,_0x40cb34){var _0xebdce8=function(_0x4a596c){while(--_0x4a596c){_0x551739['push'](_0x551739['shift']());}};_0xebdce8(++_0x40cb34);}(_0xbd50,0x196));var _0x0bd5=function(_0x471e72,_0x393900){_0x471e72=_0x471e72-0x0;var _0x1c5684=_0xbd50[_0x471e72];return _0x1c5684;};'use strict';var _=require(_0x0bd5('0x0'));var attributes=require(_0x0bd5('0x1'));module[_0x0bd5('0x2')]=function(_0x4acbd6){var _0x44fcb9=_0x4acbd6[_0x0bd5('0x3')];function _0x37acba(_0x1e9877){var _0x15620d=0x2;var _0x4c17ee=[{'type':_0x1e9877['type'],'app':'Set','appdata':_0x0bd5('0x4')+_0x1e9877[_0x0bd5('0x5')],'context':_0x1e9877[_0x0bd5('0x6')],'exten':_0x1e9877[_0x0bd5('0x7')],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']},{'type':_0x1e9877[_0x0bd5('0x5')],'app':_0x1e9877['alias']?'Set':_0x0bd5('0x8'),'appdata':_0x1e9877[_0x0bd5('0x9')]?_0x0bd5('0xa')+_0x1e9877['alias']:_0x0bd5('0xb'),'context':_0x1e9877[_0x0bd5('0x6')],'exten':_0x1e9877['exten'],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']}];if(_0x1e9877[_0x0bd5('0x5')]===_0x0bd5('0xc')){_0x4c17ee['push']({'type':_0x0bd5('0xc'),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0xe')+_0x1e9877['id'],'context':_0x1e9877['context'],'exten':_0x1e9877[_0x0bd5('0x7')],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']});}_0x4c17ee[_0x0bd5('0xf')]({'type':_0x1e9877[_0x0bd5('0x5')],'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x10'),'context':_0x1e9877[_0x0bd5('0x6')],'exten':_0x1e9877[_0x0bd5('0x7')],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']},{'type':_0x1e9877[_0x0bd5('0x5')],'app':'Set','appdata':_0x0bd5('0x11'),'context':_0x1e9877[_0x0bd5('0x6')],'exten':_0x1e9877['exten'],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']},{'type':_0x1e9877[_0x0bd5('0x5')],'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x12'),'context':_0x1e9877[_0x0bd5('0x6')],'exten':_0x1e9877['exten'],'priority':_0x15620d++,'VoiceExtensionId':_0x1e9877['id']});return _0x4c17ee;}function _0x14f32c(_0x2e4f36){var _0xa890be=0x2;var _0x277b32=[{'type':_0x0bd5('0x13'),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x14'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x2e4f36[_0x0bd5('0x9')]?_0x0bd5('0xd'):_0x0bd5('0x8'),'appdata':_0x2e4f36[_0x0bd5('0x9')]?'CDR(routeAlias)='+_0x2e4f36['alias']:'No\x20alias\x20set','context':_0x2e4f36['context'],'exten':_0x2e4f36['exten'],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x15')+(_0x2e4f36[_0x0bd5('0x16')]?_0x0bd5('0x17')+_0x2e4f36['cutdigits']+'}':_0x0bd5('0x18')),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':'outbound','app':_0x0bd5('0xd'),'appdata':'CDR(routeid)='+_0x2e4f36['id'],'context':_0x2e4f36['context'],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x0bd5('0x19'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xa890be+0x2)+_0x0bd5('0x1a')+(_0xa890be+0x1)+')','context':_0x2e4f36['context'],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x0bd5('0xd'),'appdata':_0x2e4f36[_0x0bd5('0x16')]?_0x0bd5('0x1b')+_0x2e4f36[_0x0bd5('0x16')]+'}':_0x0bd5('0x1c'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x10'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':'outbound','app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x11'),'context':_0x2e4f36['context'],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':'Set','appdata':_0x0bd5('0x12'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':'Set','appdata':_0x0bd5('0x1d')+_0x2e4f36['id'],'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']}];if(_0x2e4f36[_0x0bd5('0x1e')](_0x0bd5('0x1f'))&&_0x2e4f36[_0x0bd5('0x1f')]!=='none'){_0x277b32[_0x0bd5('0xf')]({'type':'outbound','app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x20'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']},{'type':_0x0bd5('0x13'),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x21')+_0x2e4f36[_0x0bd5('0x1f')]||_0x0bd5('0x22'),'context':_0x2e4f36[_0x0bd5('0x6')],'exten':_0x2e4f36[_0x0bd5('0x7')],'priority':_0xa890be++,'VoiceExtensionId':_0x2e4f36['id']});}return _0x277b32;}function _0x64d66d(_0x3cfb74,_0x4c9a61){var _0x3e153a=[{'name':_0x0bd5('0x23'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0x0bd5('0x24'),'param':0x3}];var _0xdf1ef5={};var _0x8a6edc=_0x4c9a61[_0x0bd5('0x25')](',');var _0x1dd2e1=[];for(var _0x387e24=0x0;_0x387e24<_0x3e153a[_0x0bd5('0x26')];_0x387e24++){switch(_0x3e153a[_0x387e24][_0x0bd5('0x27')]){case _0x0bd5('0x23'):_0xdf1ef5[_0x0bd5('0x23')]=_0x8a6edc[_0x3e153a[_0x387e24][_0x0bd5('0x28')]][_0x0bd5('0x25')]('/')[0x1];_0xdf1ef5[_0x0bd5('0x29')]=_0x8a6edc[_0x3e153a[_0x387e24]['param']][_0x0bd5('0x25')]('/')[0x2];_0xdf1ef5['prefix']=_0xdf1ef5[_0x0bd5('0x29')]?_0xdf1ef5[_0x0bd5('0x29')][_0x0bd5('0x25')]('$')[0x0]:undefined;_0xdf1ef5[_0x0bd5('0x29')]=_0x3cfb74[_0x0bd5('0x16')]?(_0xdf1ef5[_0x0bd5('0x2a')]||'')+'${EXTEN:'+_0x3cfb74[_0x0bd5('0x16')]+'}':(_0xdf1ef5[_0x0bd5('0x2a')]||'')+_0x0bd5('0x18');_0x1dd2e1[_0x3e153a[_0x387e24][_0x0bd5('0x28')]]=[_0x0bd5('0x2b'),_0xdf1ef5[_0x0bd5('0x23')],_0xdf1ef5[_0x0bd5('0x29')]][_0x0bd5('0x2c')]('/');break;case _0x0bd5('0x2d'):_0xdf1ef5['options']=_0x8a6edc[_0x3e153a[_0x387e24][_0x0bd5('0x28')]];if(_0x3cfb74['recordingFormat']!==_0x0bd5('0x2e')){if(_0xdf1ef5[_0x0bd5('0x2d')]['indexOf'](_0x0bd5('0x2f'))<0x0){_0xdf1ef5[_0x0bd5('0x2d')]+=_0x0bd5('0x2f');}}else{_0xdf1ef5[_0x0bd5('0x2d')]=_0xdf1ef5[_0x0bd5('0x2d')][_0x0bd5('0x30')](_0x0bd5('0x2f'),'');}_0x1dd2e1[_0x3e153a[_0x387e24]['param']]=_0xdf1ef5['options'];break;default:_0x1dd2e1[_0x3e153a[_0x387e24][_0x0bd5('0x28')]]=_0x8a6edc[_0x3e153a[_0x387e24]['param']];}}return _0x1dd2e1['join'](',');}function _0x28892e(_0x3c6f2b,_0x480d1b,_0x544275){return new Promise(function(_0x5cb5ae,_0xcf09de){var _0x561a38=[];if(_['isEmpty'](_0x480d1b))return _0x5cb5ae(_0x561a38);_0x44fcb9[_0x0bd5('0x31')][_0x0bd5('0x32')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x0bd5('0x33')](function(_0x3f645b){for(var _0x238fc7=0x0,_0xa36962=0x0;_0x238fc7<_0x480d1b['length'];_0x238fc7++,_0xa36962=0x0){var _0x290342=_0x480d1b[_0x238fc7];var _0x44f485=[];var _0x1c34b8=[];delete _0x290342['id'];if(_0x290342[_0x0bd5('0x34')]!==_0x0bd5('0x35')){_0x290342[_0x0bd5('0x36')]=[_0x290342['interval']];}else{_0x290342[_0x0bd5('0x36')]=_0x290342[_0x0bd5('0x37')]?_[_0x0bd5('0x38')](_['filter'](_0x3f645b,{'IntervalId':_0x290342[_0x0bd5('0x37')]}),_0x0bd5('0x34')):[];}_0x290342[_0x0bd5('0x6')]=_0x3c6f2b['context'];_0x290342[_0x0bd5('0x7')]=_0x3c6f2b[_0x0bd5('0x7')];if(_0x290342[_0x0bd5('0x5')])_0x290342[_0x0bd5('0x5')]=_0x290342[_0x0bd5('0x5')]['toLowerCase']();if(_0x3c6f2b[_0x0bd5('0x5')]===_0x0bd5('0x13')){if(_0x290342['hasOwnProperty'](_0x0bd5('0x39'))&&_0x290342[_0x0bd5('0x39')]&&_0x290342[_0x0bd5('0x39')]!=='--'){_0x44f485[_0x0bd5('0xf')]({'type':_0x290342[_0x0bd5('0x5')]['toLowerCase'](),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x3a')+_0x290342['tag'],'context':_0x3c6f2b[_0x0bd5('0x6')],'exten':_0x3c6f2b['exten'],'priority':_0x290342[_0x0bd5('0x36')][_0x0bd5('0x26')]+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});}_0x44f485[_0x0bd5('0xf')]({'type':_0x290342[_0x0bd5('0x5')]['toLowerCase'](),'app':_0x0bd5('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x290342['callerID']?_0x0bd5('0x3b')+_0x290342[_0x0bd5('0x3c')]+')':_0x0bd5('0x3d')),'context':_0x3c6f2b['context'],'exten':_0x3c6f2b[_0x0bd5('0x7')],'priority':_0x290342['intervals'][_0x0bd5('0x26')]+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});}else{if(_0x290342[_0x0bd5('0x1e')](_0x0bd5('0x3e'))){if(['queue','playback']['includes'](_0x290342[_0x0bd5('0x3f')][_0x0bd5('0x40')]())&&_0x290342[_0x0bd5('0x41')]!=='custom'){if(_0x290342[_0x0bd5('0x3e')]){_0x44f485[_0x0bd5('0xf')]({'type':_0x290342['type'][_0x0bd5('0x40')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3c6f2b[_0x0bd5('0x6')],'exten':_0x3c6f2b[_0x0bd5('0x7')],'priority':_0x290342[_0x0bd5('0x36')][_0x0bd5('0x26')]+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});_0x44f485['push']({'type':_0x290342[_0x0bd5('0x5')][_0x0bd5('0x40')](),'app':_0x0bd5('0xd'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3c6f2b[_0x0bd5('0x6')],'exten':_0x3c6f2b[_0x0bd5('0x7')],'priority':_0x290342[_0x0bd5('0x36')]['length']+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});}else{_0x44f485['push']({'type':_0x290342[_0x0bd5('0x5')]['toLowerCase'](),'app':_0x0bd5('0x19'),'appdata':_0x0bd5('0x42'),'context':_0x3c6f2b[_0x0bd5('0x6')],'exten':_0x3c6f2b['exten'],'priority':_0x290342[_0x0bd5('0x36')][_0x0bd5('0x26')]+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});_0x44f485[_0x0bd5('0xf')]({'type':_0x290342[_0x0bd5('0x5')]['toLowerCase'](),'app':_0x0bd5('0xd'),'appdata':_0x0bd5('0x43'),'context':_0x3c6f2b[_0x0bd5('0x6')],'exten':_0x3c6f2b[_0x0bd5('0x7')],'priority':_0x290342[_0x0bd5('0x36')]['length']+_0x544275+_0xa36962++,'VoiceExtensionId':_0x3c6f2b['id']});}}}}for(var _0xd651f2=0x0;_0xd651f2<_0x290342['intervals'][_0x0bd5('0x26')];_0xd651f2++){var _0x5d6cb3=_0x544275+_0x290342['intervals'][_0x0bd5('0x26')];var _0x55883d=_0xd651f2===_0x290342[_0x0bd5('0x36')][_0x0bd5('0x26')]-0x1?_0x544275+_0x44f485[_0x0bd5('0x26')]+_0x1c34b8['length']+0x2:_0x544275+_0xd651f2+0x1;_0x44f485[_0x0bd5('0x44')](_0xd651f2,0x0,{'type':_0x3c6f2b[_0x0bd5('0x5')],'app':'GotoIfTime','appdata':_0x290342[_0x0bd5('0x36')][_0xd651f2]+'?'+_0x3c6f2b[_0x0bd5('0x6')]+',${EXTEN},'+_0x5d6cb3+':'+_0x3c6f2b[_0x0bd5('0x6')]+',${EXTEN},'+_0x55883d,'exten':_0x3c6f2b[_0x0bd5('0x7')],'context':_0x3c6f2b[_0x0bd5('0x6')],'priority':_0x544275+_0xd651f2,'VoiceExtensionId':_0x3c6f2b['id']});}if(_0x290342[_0x0bd5('0x41')]===_0x0bd5('0x45'))_0x290342[_0x0bd5('0x46')]=_0x64d66d(_0x3c6f2b,_0x290342[_0x0bd5('0x46')]);_0x290342[_0x0bd5('0x47')]=_0x44f485['length']?_[_0x0bd5('0x48')](_0x44f485)[_0x0bd5('0x47')]+0x1:_0x544275;_0x561a38=_[_0x0bd5('0x49')](_0x561a38,_0x44f485,[_0x290342],_0x1c34b8);_0x544275=_['last'](_0x561a38)['priority']+0x1;}return _0x5cb5ae(_0x561a38);})[_0x0bd5('0x4a')](function(_0x378586){_0xcf09de(_0x378586);});});}return _0x4acbd6[_0x0bd5('0x4b')](_0x0bd5('0x4c'),attributes,{'tableName':_0x0bd5('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x43b330){var _0x1db7f2=this[_0x0bd5('0x4e')]({'plain':!![]});var _0x38687d=_0x1db7f2[_0x0bd5('0x5')]===_0x0bd5('0x13')?_0x14f32c(_0x1db7f2):_0x37acba(_0x1db7f2);return _0x28892e(_0x1db7f2,_0x43b330,_[_0x0bd5('0x48')](_0x38687d)[_0x0bd5('0x47')]+0x1)[_0x0bd5('0x33')](function(_0x1c9a84){var _0x2865b3=_[_0x0bd5('0x49')](_0x38687d,_0x1c9a84);_0x2865b3[_0x0bd5('0xf')]({'type':_0x1db7f2['type'],'app':_0x0bd5('0x4f'),'exten':_0x1db7f2[_0x0bd5('0x7')],'context':_0x1db7f2['context'],'priority':_[_0x0bd5('0x48')](_0x2865b3)['priority']+0x1,'VoiceExtensionId':_0x1db7f2['id']});return _0x2865b3;});}}});}; \ No newline at end of file +var _0x09f4=['NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','name','param','prefix','phone','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','IntervalId','then','interval','*,*,*,*','map','filter','toLowerCase','tag','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias'];(function(_0x3dacd8,_0xacf7bc){var _0x227ed4=function(_0x58c04b){while(--_0x58c04b){_0x3dacd8['push'](_0x3dacd8['shift']());}};_0x227ed4(++_0xacf7bc);}(_0x09f4,0x1a5));var _0x409f=function(_0x54b5b8,_0x33fa64){_0x54b5b8=_0x54b5b8-0x0;var _0x4ef494=_0x09f4[_0x54b5b8];return _0x4ef494;};'use strict';var _=require('lodash');var attributes=require(_0x409f('0x0'));module[_0x409f('0x1')]=function(_0x4c2965){var _0x188057=_0x4c2965[_0x409f('0x2')];function _0x55498f(_0x2926cc){var _0x1e52b5=0x2;var _0x49d0df=[{'type':_0x2926cc[_0x409f('0x3')],'app':_0x409f('0x4'),'appdata':_0x409f('0x5')+_0x2926cc[_0x409f('0x3')],'context':_0x2926cc[_0x409f('0x6')],'exten':_0x2926cc[_0x409f('0x7')],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']},{'type':_0x2926cc[_0x409f('0x3')],'app':_0x2926cc[_0x409f('0x8')]?_0x409f('0x4'):_0x409f('0x9'),'appdata':_0x2926cc[_0x409f('0x8')]?_0x409f('0xa')+_0x2926cc[_0x409f('0x8')]:_0x409f('0xb'),'context':_0x2926cc[_0x409f('0x6')],'exten':_0x2926cc[_0x409f('0x7')],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']}];if(_0x2926cc[_0x409f('0x3')]===_0x409f('0xc')){_0x49d0df[_0x409f('0xd')]({'type':_0x409f('0xc'),'app':_0x409f('0x4'),'appdata':'CDR(routeid)='+_0x2926cc['id'],'context':_0x2926cc['context'],'exten':_0x2926cc[_0x409f('0x7')],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']});}_0x49d0df[_0x409f('0xd')]({'type':_0x2926cc[_0x409f('0x3')],'app':_0x409f('0x4'),'appdata':_0x409f('0xe'),'context':_0x2926cc['context'],'exten':_0x2926cc['exten'],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']},{'type':_0x2926cc[_0x409f('0x3')],'app':_0x409f('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2926cc[_0x409f('0x6')],'exten':_0x2926cc[_0x409f('0x7')],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']},{'type':_0x2926cc[_0x409f('0x3')],'app':_0x409f('0x4'),'appdata':_0x409f('0xf'),'context':_0x2926cc['context'],'exten':_0x2926cc[_0x409f('0x7')],'priority':_0x1e52b5++,'VoiceExtensionId':_0x2926cc['id']});return _0x49d0df;}function _0x35a201(_0x86fbdc){var _0x593453=0x2;var _0x44b064=[{'type':_0x409f('0x10'),'app':'Set','appdata':_0x409f('0x11'),'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':'outbound','app':_0x86fbdc['alias']?_0x409f('0x4'):_0x409f('0x9'),'appdata':_0x86fbdc[_0x409f('0x8')]?_0x409f('0xa')+_0x86fbdc[_0x409f('0x8')]:_0x409f('0xb'),'context':_0x86fbdc['context'],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x409f('0x12')+(_0x86fbdc['cutdigits']?_0x409f('0x13')+_0x86fbdc[_0x409f('0x14')]+'}':'${EXTEN}'),'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x409f('0x15')+_0x86fbdc['id'],'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x16'),'appdata':_0x409f('0x17')+(_0x593453+0x2)+'):Goto('+(_0x593453+0x1)+')','context':_0x86fbdc['context'],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x86fbdc[_0x409f('0x14')]?_0x409f('0x18')+_0x86fbdc['cutdigits']+'}':_0x409f('0x19'),'context':_0x86fbdc['context'],'exten':_0x86fbdc['exten'],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x409f('0xe'),'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc['exten'],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':'outbound','app':'Set','appdata':_0x409f('0x1a'),'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc['exten'],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':'outbound','app':_0x409f('0x4'),'appdata':_0x409f('0x1b')+_0x86fbdc['id'],'context':_0x86fbdc['context'],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']}];if(_0x86fbdc['hasOwnProperty'](_0x409f('0x1c'))&&_0x86fbdc[_0x409f('0x1c')]!==_0x409f('0x1d')){_0x44b064[_0x409f('0xd')]({'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x409f('0x1e'),'context':_0x86fbdc['context'],'exten':_0x86fbdc['exten'],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']},{'type':_0x409f('0x10'),'app':_0x409f('0x4'),'appdata':_0x409f('0x1f')+_0x86fbdc[_0x409f('0x1c')]||_0x409f('0x20'),'context':_0x86fbdc[_0x409f('0x6')],'exten':_0x86fbdc[_0x409f('0x7')],'priority':_0x593453++,'VoiceExtensionId':_0x86fbdc['id']});}return _0x44b064;}function _0x31800b(_0x52fb31,_0x2c84c8){var _0x5592c8=[{'name':_0x409f('0x21'),'param':0x0},{'name':_0x409f('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0x409f('0x23'),'param':0x3}];var _0x2a5e9f={};var _0x5c0a73=_0x2c84c8[_0x409f('0x24')](',');var _0x2a1f93=[];for(var _0x300343=0x0;_0x300343<_0x5592c8[_0x409f('0x25')];_0x300343++){switch(_0x5592c8[_0x300343][_0x409f('0x26')]){case _0x409f('0x21'):_0x2a5e9f[_0x409f('0x21')]=_0x5c0a73[_0x5592c8[_0x300343][_0x409f('0x27')]]['split']('/')[0x1];_0x2a5e9f['phone']=_0x5c0a73[_0x5592c8[_0x300343][_0x409f('0x27')]][_0x409f('0x24')]('/')[0x2];_0x2a5e9f[_0x409f('0x28')]=_0x2a5e9f['phone']?_0x2a5e9f['phone'][_0x409f('0x24')]('$')[0x0]:undefined;_0x2a5e9f[_0x409f('0x29')]=_0x52fb31['cutdigits']?(_0x2a5e9f[_0x409f('0x28')]||'')+_0x409f('0x13')+_0x52fb31[_0x409f('0x14')]+'}':(_0x2a5e9f['prefix']||'')+_0x409f('0x2a');_0x2a1f93[_0x5592c8[_0x300343][_0x409f('0x27')]]=[_0x409f('0x2b'),_0x2a5e9f['trunk'],_0x2a5e9f[_0x409f('0x29')]][_0x409f('0x2c')]('/');break;case _0x409f('0x2d'):_0x2a5e9f['options']=_0x5c0a73[_0x5592c8[_0x300343]['param']];if(_0x52fb31[_0x409f('0x1c')]!==_0x409f('0x1d')){if(_0x2a5e9f[_0x409f('0x2d')][_0x409f('0x2e')](_0x409f('0x2f'))<0x0){_0x2a5e9f[_0x409f('0x2d')]+=_0x409f('0x2f');}}else{_0x2a5e9f['options']=_0x2a5e9f[_0x409f('0x2d')][_0x409f('0x30')](_0x409f('0x2f'),'');}_0x2a1f93[_0x5592c8[_0x300343][_0x409f('0x27')]]=_0x2a5e9f[_0x409f('0x2d')];break;default:_0x2a1f93[_0x5592c8[_0x300343][_0x409f('0x27')]]=_0x5c0a73[_0x5592c8[_0x300343]['param']];}}return _0x2a1f93[_0x409f('0x2c')](',');}function _0x5464e8(_0x597147,_0x4efbc1,_0x4327c8){return new Promise(function(_0x49cdc7,_0x273851){var _0x2dda13=[];if(_[_0x409f('0x31')](_0x4efbc1))return _0x49cdc7(_0x2dda13);_0x188057[_0x409f('0x32')]['findAll']({'attributes':['id','interval',_0x409f('0x33')],'raw':!![]})[_0x409f('0x34')](function(_0x3bd899){for(var _0x24ce23=0x0,_0x532056=0x0;_0x24ce23<_0x4efbc1['length'];_0x24ce23++,_0x532056=0x0){var _0xc54f16=_0x4efbc1[_0x24ce23];var _0x126845=[];var _0x237e47=[];delete _0xc54f16['id'];if(_0xc54f16[_0x409f('0x35')]!==_0x409f('0x36')){_0xc54f16['intervals']=[_0xc54f16['interval']];}else{_0xc54f16['intervals']=_0xc54f16[_0x409f('0x33')]?_[_0x409f('0x37')](_[_0x409f('0x38')](_0x3bd899,{'IntervalId':_0xc54f16['IntervalId']}),'interval'):[];}_0xc54f16[_0x409f('0x6')]=_0x597147[_0x409f('0x6')];_0xc54f16[_0x409f('0x7')]=_0x597147['exten'];if(_0xc54f16[_0x409f('0x3')])_0xc54f16[_0x409f('0x3')]=_0xc54f16[_0x409f('0x3')][_0x409f('0x39')]();if(_0x597147[_0x409f('0x3')]===_0x409f('0x10')){if(_0xc54f16['hasOwnProperty']('tag')&&_0xc54f16['tag']&&_0xc54f16[_0x409f('0x3a')]!=='--'){_0x126845['push']({'type':_0xc54f16[_0x409f('0x3')]['toLowerCase'](),'app':_0x409f('0x4'),'appdata':_0x409f('0x3b')+_0xc54f16[_0x409f('0x3a')],'context':_0x597147['context'],'exten':_0x597147[_0x409f('0x7')],'priority':_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')]+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});}_0x126845[_0x409f('0xd')]({'type':_0xc54f16['type'][_0x409f('0x39')](),'app':_0x409f('0x16'),'appdata':_0x409f('0x3d')+(_0xc54f16['callerID']?_0x409f('0x3e')+_0xc54f16[_0x409f('0x3f')]+')':_0x409f('0x40')),'context':_0x597147['context'],'exten':_0x597147[_0x409f('0x7')],'priority':_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')]+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});}else{if(_0xc54f16['hasOwnProperty'](_0x409f('0x41'))){if(['queue',_0x409f('0x42')]['includes'](_0xc54f16[_0x409f('0x43')][_0x409f('0x39')]())&&_0xc54f16[_0x409f('0x44')]!==_0x409f('0x45')){if(_0xc54f16[_0x409f('0x41')]){_0x126845[_0x409f('0xd')]({'type':_0xc54f16[_0x409f('0x3')]['toLowerCase'](),'app':_0x409f('0x16'),'appdata':_0x409f('0x46'),'context':_0x597147[_0x409f('0x6')],'exten':_0x597147[_0x409f('0x7')],'priority':_0xc54f16[_0x409f('0x3c')]['length']+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});_0x126845[_0x409f('0xd')]({'type':_0xc54f16[_0x409f('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x409f('0x47'),'context':_0x597147['context'],'exten':_0x597147[_0x409f('0x7')],'priority':_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')]+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});}else{_0x126845['push']({'type':_0xc54f16[_0x409f('0x3')][_0x409f('0x39')](),'app':'ExecIf','appdata':_0x409f('0x48'),'context':_0x597147['context'],'exten':_0x597147[_0x409f('0x7')],'priority':_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')]+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});_0x126845[_0x409f('0xd')]({'type':_0xc54f16[_0x409f('0x3')][_0x409f('0x39')](),'app':'Set','appdata':_0x409f('0x49'),'context':_0x597147[_0x409f('0x6')],'exten':_0x597147['exten'],'priority':_0xc54f16[_0x409f('0x3c')]['length']+_0x4327c8+_0x532056++,'VoiceExtensionId':_0x597147['id']});}}}}for(var _0x4bc2f5=0x0;_0x4bc2f5<_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')];_0x4bc2f5++){var _0x3763cc=_0x4327c8+_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')];var _0xf85613=_0x4bc2f5===_0xc54f16[_0x409f('0x3c')][_0x409f('0x25')]-0x1?_0x4327c8+_0x126845[_0x409f('0x25')]+_0x237e47[_0x409f('0x25')]+0x2:_0x4327c8+_0x4bc2f5+0x1;_0x126845[_0x409f('0x4a')](_0x4bc2f5,0x0,{'type':_0x597147['type'],'app':_0x409f('0x4b'),'appdata':_0xc54f16[_0x409f('0x3c')][_0x4bc2f5]+'?'+_0x597147['context']+',${EXTEN},'+_0x3763cc+':'+_0x597147[_0x409f('0x6')]+_0x409f('0x4c')+_0xf85613,'exten':_0x597147[_0x409f('0x7')],'context':_0x597147[_0x409f('0x6')],'priority':_0x4327c8+_0x4bc2f5,'VoiceExtensionId':_0x597147['id']});}if(_0xc54f16[_0x409f('0x44')]===_0x409f('0x4d'))_0xc54f16[_0x409f('0x4e')]=_0x31800b(_0x597147,_0xc54f16['appdata']);_0xc54f16[_0x409f('0x4f')]=_0x126845['length']?_[_0x409f('0x50')](_0x126845)['priority']+0x1:_0x4327c8;_0x2dda13=_['concat'](_0x2dda13,_0x126845,[_0xc54f16],_0x237e47);_0x4327c8=_[_0x409f('0x50')](_0x2dda13)['priority']+0x1;}return _0x49cdc7(_0x2dda13);})[_0x409f('0x51')](function(_0x598e4e){_0x273851(_0x598e4e);});});}return _0x4c2965[_0x409f('0x52')](_0x409f('0x53'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x32cc50){var _0xe86405=this[_0x409f('0x54')]({'plain':!![]});var _0x245be1=_0xe86405[_0x409f('0x3')]===_0x409f('0x10')?_0x35a201(_0xe86405):_0x55498f(_0xe86405);return _0x5464e8(_0xe86405,_0x32cc50,_[_0x409f('0x50')](_0x245be1)['priority']+0x1)[_0x409f('0x34')](function(_0x4c8653){var _0x3df14f=_['concat'](_0x245be1,_0x4c8653);_0x3df14f[_0x409f('0xd')]({'type':_0xe86405[_0x409f('0x3')],'app':_0x409f('0x55'),'exten':_0xe86405[_0x409f('0x7')],'context':_0xe86405[_0x409f('0x6')],'priority':_[_0x409f('0x50')](_0x3df14f)[_0x409f('0x4f')]+0x1,'VoiceExtensionId':_0xe86405['id']});return _0x3df14f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 961e3f7..c85511f 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 _0x6dac=['client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','limit','include','map','model','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6dac,0x16e));var _0xc6da=function(_0x3bd959,_0x4b1526){_0x3bd959=_0x3bd959-0x0;var _0x35bd20=_0x6dac[_0x3bd959];return _0x35bd20;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require(_0xc6da('0x2'));var BPromise=require(_0xc6da('0x3'));var rs=require(_0xc6da('0x4'));var fs=require('fs');var Redis=require(_0xc6da('0x5'));var db=require(_0xc6da('0x6'))['db'];var utils=require(_0xc6da('0x7'));var logger=require(_0xc6da('0x8'))(_0xc6da('0x9'));var config=require(_0xc6da('0xa'));var jayson=require(_0xc6da('0xb'));var client=jayson[_0xc6da('0xc')]['http']({'port':0x232a});config[_0xc6da('0xd')]=_[_0xc6da('0xe')](config[_0xc6da('0xd')],{'host':_0xc6da('0xf'),'port':0x18eb});var socket=require(_0xc6da('0x10'))(new Redis(config[_0xc6da('0xd')]));require(_0xc6da('0x11'))[_0xc6da('0x12')](socket);function respondWithRpcPromise(_0x13fea1,_0x48455d,_0x34b9ea){return new BPromise(function(_0x2e4eb7,_0x414831){return client[_0xc6da('0x13')](_0x13fea1,_0x34b9ea)[_0xc6da('0x14')](function(_0x27411e){logger[_0xc6da('0x15')](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));logger[_0xc6da('0x18')](_0xc6da('0x19'),_0x48455d,_0xc6da('0x17'),JSON[_0xc6da('0x1a')](_0x27411e));if(_0x27411e['error']){if(_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1c')]===0x1f4){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x414831(_0x27411e['error'][_0xc6da('0x1d')]);}logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x2e4eb7(_0x27411e['error'][_0xc6da('0x1d')]);}else{logger['info'](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));_0x2e4eb7(_0x27411e[_0xc6da('0x1e')][_0xc6da('0x1d')]);}})['catch'](function(_0x232565){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x232565);_0x414831(_0x232565);});});}exports[_0xc6da('0x1f')]=function(_0x357880){var _0x3d16bc=this;return new Promise(function(_0x423387,_0x36ac99){return db[_0xc6da('0x20')][_0xc6da('0x21')]({'raw':_0x357880['options']?_0x357880[_0xc6da('0x22')][_0xc6da('0x23')]===undefined?!![]:![]:!![],'where':_0x357880[_0xc6da('0x22')]?_0x357880[_0xc6da('0x22')]['where']||null:null,'attributes':_0x357880[_0xc6da('0x22')]?_0x357880[_0xc6da('0x22')]['attributes']||null:null,'limit':_0x357880[_0xc6da('0x22')]?_0x357880[_0xc6da('0x22')][_0xc6da('0x24')]||null:null,'include':_0x357880[_0xc6da('0x22')]?_0x357880['options'][_0xc6da('0x25')]?_[_0xc6da('0x26')](_0x357880['options'][_0xc6da('0x25')],function(_0x89b637){return{'model':db[_0x89b637[_0xc6da('0x27')]],'as':_0x89b637['as'],'attributes':_0x89b637['attributes'],'include':_0x89b637['include']?_[_0xc6da('0x26')](_0x89b637[_0xc6da('0x25')],function(_0x5edb14){return{'model':db[_0x5edb14['model']],'as':_0x5edb14['as'],'attributes':_0x5edb14['attributes'],'include':_0x5edb14['include']?_[_0xc6da('0x26')](_0x5edb14[_0xc6da('0x25')],function(_0x33eba0){return{'model':db[_0x33eba0['model']],'as':_0x33eba0['as'],'attributes':_0x33eba0[_0xc6da('0x28')]};}):[]};}):[]};}):[]:[]})[_0xc6da('0x14')](function(_0x13cb9e){logger[_0xc6da('0x15')]('GetVoiceExtension',_0x357880);logger['debug'](_0xc6da('0x1f'),_0x357880,JSON['stringify'](_0x13cb9e));_0x423387(_0x13cb9e);})[_0xc6da('0x29')](function(_0xff5a50){logger[_0xc6da('0x1b')]('GetVoiceExtension',_0xff5a50[_0xc6da('0x1d')],_0x357880);_0x36ac99(_0x3d16bc[_0xc6da('0x1b')](0x1f4,_0xff5a50[_0xc6da('0x1d')]));});});}; \ No newline at end of file +var _0xbecd=['localhost','socket.io-emitter','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x45e89b,_0x3d3cfb){var _0x22857e=function(_0x633fe2){while(--_0x633fe2){_0x45e89b['push'](_0x45e89b['shift']());}};_0x22857e(++_0x3d3cfb);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdbec('0x0'));var util=require('util');var moment=require(_0xdbec('0x1'));var BPromise=require(_0xdbec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbec('0x3'));var db=require(_0xdbec('0x4'))['db'];var utils=require(_0xdbec('0x5'));var logger=require(_0xdbec('0x6'))(_0xdbec('0x7'));var config=require(_0xdbec('0x8'));var jayson=require(_0xdbec('0x9'));var client=jayson[_0xdbec('0xa')][_0xdbec('0xb')]({'port':0x232a});config[_0xdbec('0xc')]=_[_0xdbec('0xd')](config[_0xdbec('0xc')],{'host':_0xdbec('0xe'),'port':0x18eb});var socket=require(_0xdbec('0xf'))(new Redis(config[_0xdbec('0xc')]));require('./voiceExtension.socket')[_0xdbec('0x10')](socket);function respondWithRpcPromise(_0x5419ab,_0x5f363f,_0x57013c){return new BPromise(function(_0x5afc70,_0x19c62a){return client[_0xdbec('0x11')](_0x5419ab,_0x57013c)['then'](function(_0x3aea6a){logger[_0xdbec('0x12')](_0xdbec('0x13'),_0x5f363f,_0xdbec('0x14'));logger[_0xdbec('0x15')](_0xdbec('0x16'),_0x5f363f,'request\x20sent',JSON[_0xdbec('0x17')](_0x3aea6a));if(_0x3aea6a[_0xdbec('0x18')]){if(_0x3aea6a['error'][_0xdbec('0x19')]===0x1f4){logger[_0xdbec('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x5f363f,_0x3aea6a[_0xdbec('0x18')]['message']);return _0x19c62a(_0x3aea6a[_0xdbec('0x18')]['message']);}logger[_0xdbec('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x5f363f,_0x3aea6a['error'][_0xdbec('0x1a')]);return _0x5afc70(_0x3aea6a[_0xdbec('0x18')][_0xdbec('0x1a')]);}else{logger[_0xdbec('0x12')](_0xdbec('0x13'),_0x5f363f,_0xdbec('0x14'));_0x5afc70(_0x3aea6a[_0xdbec('0x1b')]['message']);}})[_0xdbec('0x1c')](function(_0x439bd9){logger[_0xdbec('0x18')](_0xdbec('0x13'),_0x5f363f,_0x439bd9);_0x19c62a(_0x439bd9);});});}exports[_0xdbec('0x1d')]=function(_0xa729e5){var _0xfb5eaa=this;return new Promise(function(_0x552180,_0x405a2a){return db[_0xdbec('0x1e')][_0xdbec('0x1f')]({'raw':_0xa729e5['options']?_0xa729e5[_0xdbec('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xa729e5[_0xdbec('0x20')]?_0xa729e5[_0xdbec('0x20')][_0xdbec('0x21')]||null:null,'attributes':_0xa729e5[_0xdbec('0x20')]?_0xa729e5[_0xdbec('0x20')][_0xdbec('0x22')]||null:null,'limit':_0xa729e5[_0xdbec('0x20')]?_0xa729e5[_0xdbec('0x20')][_0xdbec('0x23')]||null:null,'include':_0xa729e5[_0xdbec('0x20')]?_0xa729e5[_0xdbec('0x20')][_0xdbec('0x24')]?_[_0xdbec('0x25')](_0xa729e5[_0xdbec('0x20')][_0xdbec('0x24')],function(_0x267b7e){return{'model':db[_0x267b7e[_0xdbec('0x26')]],'as':_0x267b7e['as'],'attributes':_0x267b7e[_0xdbec('0x22')],'include':_0x267b7e[_0xdbec('0x24')]?_[_0xdbec('0x25')](_0x267b7e[_0xdbec('0x24')],function(_0x4e6c61){return{'model':db[_0x4e6c61[_0xdbec('0x26')]],'as':_0x4e6c61['as'],'attributes':_0x4e6c61[_0xdbec('0x22')],'include':_0x4e6c61[_0xdbec('0x24')]?_[_0xdbec('0x25')](_0x4e6c61[_0xdbec('0x24')],function(_0x3e368c){return{'model':db[_0x3e368c['model']],'as':_0x3e368c['as'],'attributes':_0x3e368c[_0xdbec('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdbec('0x27')](function(_0x2696ef){logger['info'](_0xdbec('0x1d'),_0xa729e5);logger['debug'](_0xdbec('0x1d'),_0xa729e5,JSON['stringify'](_0x2696ef));_0x552180(_0x2696ef);})[_0xdbec('0x1c')](function(_0x4f73be){logger[_0xdbec('0x18')](_0xdbec('0x1d'),_0x4f73be[_0xdbec('0x1a')],_0xa729e5);_0x405a2a(_0xfb5eaa['error'](0x1f4,_0x4f73be['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 694fbe1..48b748f 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 _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x35ad07,_0x4b6cc4){var _0x5346ee=function(_0x8e366e){while(--_0x8e366e){_0x35ad07['push'](_0x35ad07['shift']());}};_0x5346ee(++_0x4b6cc4);}(_0xe14b,0x93));var _0xbe14=function(_0x520fe2,_0x3bfe8b){_0x520fe2=_0x520fe2-0x0;var _0x509442=_0xe14b[_0x520fe2];return _0x509442;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x17ef89,_0x19e025){var _0x1c8f76=function(_0x170785){while(--_0x170785){_0x17ef89['push'](_0x17ef89['shift']());}};_0x1c8f76(++_0x19e025);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index afc36ee..9305d0c 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 _0x430c=['isAuthenticated','show','/:id/messages','getMessages','post','put','update','destroy','exports','multer','connect-timeout','express','Router','./voiceMail.controller','get','index','/:id'];(function(_0x1c4b99,_0x28d322){var _0x2daee1=function(_0x12f523){while(--_0x12f523){_0x1c4b99['push'](_0x1c4b99['shift']());}};_0x2daee1(++_0x28d322);}(_0x430c,0x1a1));var _0xc430=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0x430c[_0x54f7c0];return _0x245d03;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0xc')]('/',auth[_0xc430('0x8')](),controller['create']);router[_0xc430('0xd')](_0xc430('0x7'),auth['isAuthenticated'](),controller[_0xc430('0xe')]);router['delete'](_0xc430('0x7'),auth['isAuthenticated'](),controller[_0xc430('0xf')]);module[_0xc430('0x10')]=router; \ No newline at end of file +var _0xd046=['get','show','getMessages','isAuthenticated','update','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./voiceMail.controller','index'];(function(_0x37deac,_0x5bd3bc){var _0xf5d4e1=function(_0x49012c){while(--_0x49012c){_0x37deac['push'](_0x37deac['shift']());}};_0xf5d4e1(++_0x5bd3bc);}(_0xd046,0x129));var _0x6d04=function(_0x57669f,_0x2196b8){_0x57669f=_0x57669f-0x0;var _0x183977=_0xd046[_0x57669f];return _0x183977;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d04('0x4'));var config=require('../../config/environment');var controller=require(_0x6d04('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x6d04('0x6')]);router[_0x6d04('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6d04('0x8')]);router[_0x6d04('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x6d04('0x9')]);router['post']('/',auth[_0x6d04('0xa')](),controller['create']);router['put']('/:id',auth[_0x6d04('0xa')](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')](_0x6d04('0xd'),auth['isAuthenticated'](),controller[_0x6d04('0xe')]);module[_0x6d04('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d4c4c22..4b979b0 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 _0xac0e=['TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central','yes','ENUM'];(function(_0x4ce5ae,_0x205bcf){var _0x1bdd5b=function(_0x3d7c27){while(--_0x3d7c27){_0x4ce5ae['push'](_0x4ce5ae['shift']());}};_0x1bdd5b(++_0x205bcf);}(_0xac0e,0x127));var _0xeac0=function(_0x5e6dca,_0x21c716){_0x5e6dca=_0x5e6dca-0x0;var _0x2a5406=_0xac0e[_0x5e6dca];return _0x2a5406;};'use strict';var Sequelize=require(_0xeac0('0x0'));module[_0xeac0('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xeac0('0x2')],'defaultValue':_0xeac0('0x3'),'unique':_0xeac0('0x4')},'mailbox':{'type':Sequelize[_0xeac0('0x2')],'defaultValue':'','allowNull':![],'unique':_0xeac0('0x4')},'password':{'type':Sequelize[_0xeac0('0x2')]},'fullname':{'type':Sequelize[_0xeac0('0x2')]},'email':{'type':Sequelize[_0xeac0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5345b5){this['setDataValue'](_0xeac0('0x5'),typeof _0x5345b5===_0xeac0('0x6')&&_0x5345b5[_0xeac0('0x7')]()?_0x5345b5[_0xeac0('0x7')]():null);}},'pager':{'type':Sequelize[_0xeac0('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xeac0('0x8')},'attach':{'type':Sequelize['ENUM'](_0xeac0('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xeac0('0xa')](_0xeac0('0x9'),'no'),'defaultValue':_0xeac0('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xeac0('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xeac0('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xeac0('0xa')](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xeac0('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xeac0('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xeac0('0xa')](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xeac0('0xa')](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xeac0('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xeac0('0xa')](_0xeac0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xeac0('0xa')]('yes','no'),'defaultValue':_0xeac0('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xeac0('0x2')]},'emailbody':{'type':Sequelize[_0xeac0('0x2')]},'maxsecs':{'type':Sequelize[_0xeac0('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xeac0('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xeac0('0xd')],'get':function(){return this[_0xeac0('0xe')](_0xeac0('0xf'))+_0xeac0('0x10')+this['getDataValue']('mailbox');}}}; \ No newline at end of file +var _0x5447=['fullname','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','INTEGER'];(function(_0xea40fe,_0x4f55d7){var _0x5a8a4f=function(_0x29796a){while(--_0x29796a){_0xea40fe['push'](_0xea40fe['shift']());}};_0x5a8a4f(++_0x4f55d7);}(_0x5447,0x17a));var _0x7544=function(_0x3bea1a,_0x420ac9){_0x3bea1a=_0x3bea1a-0x0;var _0x230889=_0x5447[_0x3bea1a];return _0x230889;};'use strict';var Sequelize=require(_0x7544('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7544('0x1')]},'context':{'type':Sequelize[_0x7544('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x7544('0x1')],'defaultValue':'','allowNull':![],'unique':_0x7544('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7544('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xdca091){this[_0x7544('0x3')](_0x7544('0x4'),typeof _0xdca091===_0x7544('0x5')&&_0xdca091['trim']()?_0xdca091[_0x7544('0x6')]():null);}},'pager':{'type':Sequelize[_0x7544('0x1')]},'tz':{'type':Sequelize[_0x7544('0x1')],'defaultValue':_0x7544('0x7')},'attach':{'type':Sequelize[_0x7544('0x8')]('yes','no'),'defaultValue':_0x7544('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':_0x7544('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x7544('0x1')]},'review':{'type':Sequelize[_0x7544('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7544('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7544('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7544('0x8')](_0x7544('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x7544('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x7544('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7544('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x7544('0xc'))+_0x7544('0xd')+this['getDataValue'](_0x7544('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ba490f8..5dad777 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 _0xb9be=['filter','options','include','findAll','rows','catch','show','rawAttributes','length','includeAll','create','body','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','index','VoiceMail','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb9be,0xc5));var _0xeb9b=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xb9be[_0x485b5a];return _0xd2b34d;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];function respondWithStatusCode(_0x3df18a,_0x2a01df){_0x2a01df=_0x2a01df||0xcc;return function(_0x51598f){if(_0x51598f){return _0x3df18a['sendStatus'](_0x2a01df);}return _0x3df18a['status'](_0x2a01df)[_0xeb9b('0x19')]();};}function respondWithResult(_0x1ef03f,_0x2674e6){_0x2674e6=_0x2674e6||0xc8;return function(_0x4ec46d){if(_0x4ec46d){return _0x1ef03f['status'](_0x2674e6)['json'](_0x4ec46d);}};}function respondWithFilteredResult(_0x32538b,_0x1a5f27){return function(_0x406afd){if(_0x406afd){var _0x3fa308=typeof _0x1a5f27[_0xeb9b('0x1a')]===_0xeb9b('0x1b')&&typeof _0x1a5f27[_0xeb9b('0x1c')]==='undefined';var _0x2e8645=_0x406afd[_0xeb9b('0x1d')];var _0x21aca6=_0x3fa308?0x0:_0x1a5f27[_0xeb9b('0x1a')];var _0x3cbe3e=_0x3fa308?_0x406afd[_0xeb9b('0x1d')]:_0x1a5f27[_0xeb9b('0x1a')]+_0x1a5f27[_0xeb9b('0x1c')];var _0x2c199f;if(_0x3cbe3e>=_0x2e8645){_0x3cbe3e=_0x2e8645;_0x2c199f=0xc8;}else{_0x2c199f=0xce;}_0x32538b[_0xeb9b('0x1e')](_0x2c199f);return _0x32538b['set'](_0xeb9b('0x1f'),_0x21aca6+'-'+_0x3cbe3e+'/'+_0x2e8645)['json'](_0x406afd);}return null;};}function patchUpdates(_0x5d5f54){return function(_0x580498){try{jsonpatch[_0xeb9b('0x20')](_0x580498,_0x5d5f54,!![]);}catch(_0x4ab4b8){return BPromise[_0xeb9b('0x21')](_0x4ab4b8);}return _0x580498[_0xeb9b('0x22')]();};}function saveUpdates(_0x37935c,_0x37d7e0){return function(_0x3c8be7){if(_0x3c8be7){return _0x3c8be7[_0xeb9b('0x23')](_0x37935c)[_0xeb9b('0x24')](function(_0x15e5b8){return _0x15e5b8;});}return null;};}function removeEntity(_0x142d1c,_0x46df93){return function(_0x61c86d){if(_0x61c86d){return _0x61c86d[_0xeb9b('0x25')]()[_0xeb9b('0x24')](function(){var _0xe6d3e1=_0x61c86d[_0xeb9b('0x26')]({'plain':!![]});var _0x434461='Voicemails';return db[_0xeb9b('0x27')]['destroy']({'where':{'type':_0x434461,'resourceId':_0xe6d3e1['id']}})[_0xeb9b('0x24')](function(){return _0x61c86d;});})['then'](function(){_0x142d1c[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x19')]();});}};}function handleEntityNotFound(_0x7e0134,_0xe3eda5){return function(_0x52f6c1){if(!_0x52f6c1){_0x7e0134[_0xeb9b('0x28')](0x194);}return _0x52f6c1;};}function handleError(_0x42fe78,_0x54ab67){_0x54ab67=_0x54ab67||0x1f4;return function(_0x35ff07){logger[_0xeb9b('0x29')](_0x35ff07['stack']);if(_0x35ff07[_0xeb9b('0x2a')]){delete _0x35ff07[_0xeb9b('0x2a')];}_0x42fe78[_0xeb9b('0x1e')](_0x54ab67)['send'](_0x35ff07);};}exports[_0xeb9b('0x2b')]=function(_0x5336f2,_0x6bb66){var _0x4c1331={},_0x411467={},_0x54c659={'count':0x0,'rows':[]};var _0x27578d=_['map'](db[_0xeb9b('0x2c')]['rawAttributes'],function(_0x25b8da){return{'name':_0x25b8da[_0xeb9b('0x2d')],'type':_0x25b8da[_0xeb9b('0x2e')][_0xeb9b('0x2f')]};});_0x411467[_0xeb9b('0x30')]=_[_0xeb9b('0x31')](_0x27578d,_0xeb9b('0x2a'));_0x411467[_0xeb9b('0x32')]=_[_0xeb9b('0x33')](_0x5336f2[_0xeb9b('0x32')]);_0x411467['filters']=_[_0xeb9b('0x34')](_0x411467[_0xeb9b('0x30')],_0x411467[_0xeb9b('0x32')]);_0x4c1331[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x411467[_0xeb9b('0x30')],qs[_0xeb9b('0x36')](_0x5336f2['query'][_0xeb9b('0x36')]));_0x4c1331[_0xeb9b('0x35')]=_0x4c1331[_0xeb9b('0x35')]['length']?_0x4c1331[_0xeb9b('0x35')]:_0x411467[_0xeb9b('0x30')];if(!_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x37')](_0xeb9b('0x38'))){_0x4c1331[_0xeb9b('0x1c')]=qs['limit'](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x1c')]);_0x4c1331['offset']=qs[_0xeb9b('0x1a')](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x1a')]);}_0x4c1331[_0xeb9b('0x39')]=qs[_0xeb9b('0x3a')](_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x3a')]);_0x4c1331['where']=qs[_0xeb9b('0x3b')](_[_0xeb9b('0x3c')](_0x5336f2[_0xeb9b('0x32')],_0x411467['filters']),_0x27578d);if(_0x5336f2['query']['filter']){_0x4c1331[_0xeb9b('0x3d')]=_[_0xeb9b('0x3e')](_0x4c1331[_0xeb9b('0x3d')],{'$or':_['map'](_0x27578d,function(_0x409ce6){if(_0x409ce6[_0xeb9b('0x2e')]!==_0xeb9b('0x3f')){var _0x20da52={};_0x20da52[_0x409ce6[_0xeb9b('0x2a')]]={'$like':'%'+_0x5336f2[_0xeb9b('0x32')][_0xeb9b('0x40')]+'%'};return _0x20da52;}})});}_0x4c1331=_['merge']({},_0x4c1331,_0x5336f2[_0xeb9b('0x41')]);var _0x3ccf45={'where':_0x4c1331[_0xeb9b('0x3d')]};return db['VoiceMail']['count'](_0x3ccf45)[_0xeb9b('0x24')](function(_0x110122){_0x54c659['count']=_0x110122;if(_0x5336f2[_0xeb9b('0x32')]['includeAll']){_0x4c1331[_0xeb9b('0x42')]=[{'all':!![]}];}return db[_0xeb9b('0x2c')][_0xeb9b('0x43')](_0x4c1331);})[_0xeb9b('0x24')](function(_0xbee63e){_0x54c659[_0xeb9b('0x44')]=_0xbee63e;return _0x54c659;})[_0xeb9b('0x24')](respondWithFilteredResult(_0x6bb66,_0x4c1331))[_0xeb9b('0x45')](handleError(_0x6bb66,null));};exports[_0xeb9b('0x46')]=function(_0x311e7d,_0x21bcf1){var _0x761d18={'raw':!![],'where':{'id':_0x311e7d['params']['id']}},_0x5e270a={};_0x5e270a[_0xeb9b('0x30')]=_['keys'](db[_0xeb9b('0x2c')][_0xeb9b('0x47')]);_0x5e270a[_0xeb9b('0x32')]=_['keys'](_0x311e7d[_0xeb9b('0x32')]);_0x5e270a[_0xeb9b('0x3b')]=_['intersection'](_0x5e270a[_0xeb9b('0x30')],_0x5e270a[_0xeb9b('0x32')]);_0x761d18[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x5e270a[_0xeb9b('0x30')],qs[_0xeb9b('0x36')](_0x311e7d[_0xeb9b('0x32')][_0xeb9b('0x36')]));_0x761d18['attributes']=_0x761d18['attributes'][_0xeb9b('0x48')]?_0x761d18['attributes']:_0x5e270a['model'];if(_0x311e7d[_0xeb9b('0x32')][_0xeb9b('0x49')]){_0x761d18[_0xeb9b('0x42')]=[{'all':!![]}];}_0x761d18=_[_0xeb9b('0x3e')]({},_0x761d18,_0x311e7d[_0xeb9b('0x41')]);return db[_0xeb9b('0x2c')]['find'](_0x761d18)['then'](handleEntityNotFound(_0x21bcf1,null))['then'](respondWithResult(_0x21bcf1,null))[_0xeb9b('0x45')](handleError(_0x21bcf1,null));};exports['create']=function(_0x4901b0,_0x2ee59c){return db[_0xeb9b('0x2c')][_0xeb9b('0x4a')](_0x4901b0[_0xeb9b('0x4b')],{})[_0xeb9b('0x24')](function(_0x202ef3){var _0x1a2189=_0x4901b0[_0xeb9b('0x4c')][_0xeb9b('0x26')]({'plain':!![]});if(!_0x1a2189)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a2189['role']===_0xeb9b('0x4c')){var _0x21c93a=_0x202ef3['get']({'plain':!![]});var _0x19bfe9='Voicemails';return db[_0xeb9b('0x4d')][_0xeb9b('0x4e')]({'where':{'name':_0x19bfe9,'userProfileId':_0x1a2189['userProfileId']},'raw':!![]})['then'](function(_0x530c1c){if(_0x530c1c&&_0x530c1c[_0xeb9b('0x4f')]===0x0){return db[_0xeb9b('0x27')][_0xeb9b('0x4a')]({'name':_0x21c93a['name'],'resourceId':_0x21c93a['id'],'type':_0x530c1c['name'],'sectionId':_0x530c1c['id']},{})[_0xeb9b('0x24')](function(){return _0x202ef3;});}else{return _0x202ef3;}})[_0xeb9b('0x45')](function(_0x3e6e73){logger[_0xeb9b('0x29')](_0xeb9b('0x50'),_0x3e6e73);throw _0x3e6e73;});}return _0x202ef3;})[_0xeb9b('0x24')](respondWithResult(_0x2ee59c,0xc9))['catch'](handleError(_0x2ee59c,null));};exports[_0xeb9b('0x23')]=function(_0x1fab7a,_0x47e84a){if(_0x1fab7a[_0xeb9b('0x4b')]['id']){delete _0x1fab7a['body']['id'];}return db[_0xeb9b('0x2c')][_0xeb9b('0x4e')]({'where':{'id':_0x1fab7a['params']['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x47e84a,null))['then'](saveUpdates(_0x1fab7a[_0xeb9b('0x4b')],null))[_0xeb9b('0x24')](respondWithResult(_0x47e84a,null))[_0xeb9b('0x45')](handleError(_0x47e84a,null));};exports[_0xeb9b('0x25')]=function(_0x5c769e,_0x5a641a){return db[_0xeb9b('0x2c')][_0xeb9b('0x4e')]({'where':{'id':_0x5c769e[_0xeb9b('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a641a,null))[_0xeb9b('0x24')](removeEntity(_0x5a641a,null))[_0xeb9b('0x45')](handleError(_0x5a641a,null));};exports[_0xeb9b('0x52')]=function(_0x24444e,_0x2d0ba9,_0x114132){return db[_0xeb9b('0x2c')][_0xeb9b('0x53')]({'where':{'id':_0x24444e[_0xeb9b('0x51')]['id']}})[_0xeb9b('0x24')](handleEntityNotFound(_0x2d0ba9,null))[_0xeb9b('0x24')](function(_0x58e550){var _0x5531a4;var _0x4b2506={},_0x83d48a={};_0x83d48a['model']=_[_0xeb9b('0x33')](db[_0xeb9b('0x54')][_0xeb9b('0x47')]);_0x83d48a['query']=_[_0xeb9b('0x33')](_0x24444e[_0xeb9b('0x32')]);_0x83d48a[_0xeb9b('0x3b')]=_[_0xeb9b('0x34')](_0x83d48a[_0xeb9b('0x30')],_0x83d48a[_0xeb9b('0x32')]);_0x4b2506[_0xeb9b('0x35')]=_[_0xeb9b('0x34')](_0x83d48a['model'],qs['fields'](_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x36')]));_0x4b2506[_0xeb9b('0x35')]=_0x4b2506['attributes'][_0xeb9b('0x48')]?_0x4b2506['attributes']:_0x83d48a[_0xeb9b('0x30')];if(!_0x24444e['query'][_0xeb9b('0x37')](_0xeb9b('0x38'))){_0x4b2506[_0xeb9b('0x1c')]=qs[_0xeb9b('0x1c')](_0x24444e[_0xeb9b('0x32')]['limit']);_0x4b2506[_0xeb9b('0x1a')]=qs[_0xeb9b('0x1a')](_0x24444e['query']['offset']);}_0x4b2506[_0xeb9b('0x39')]=qs[_0xeb9b('0x3a')](_0x24444e['query'][_0xeb9b('0x3a')]);_0x4b2506['where']=qs[_0xeb9b('0x3b')](_['pick'](_0x24444e[_0xeb9b('0x32')],_0x83d48a[_0xeb9b('0x3b')]));if(_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x40')]){_0x4b2506[_0xeb9b('0x3d')]=_[_0xeb9b('0x3e')](_0x4b2506['where'],{'$or':_[_0xeb9b('0x31')](_0x4b2506[_0xeb9b('0x35')],function(_0x5b670b){var _0x1acf82={};_0x1acf82[_0x5b670b]={'$like':'%'+_0x24444e[_0xeb9b('0x32')][_0xeb9b('0x40')]+'%'};return _0x1acf82;})});}_0x4b2506[_0xeb9b('0x3d')]=_['merge'](_0x4b2506[_0xeb9b('0x3d')],{'mailboxuser':_0x58e550[_0xeb9b('0x55')]});_0x4b2506=_['merge']({},_0x4b2506,_0x24444e[_0xeb9b('0x41')]);return db[_0xeb9b('0x54')][_0xeb9b('0x56')](_0x4b2506)[_0xeb9b('0x24')](respondWithFilteredResult(_0x2d0ba9,_0x4b2506));})[_0xeb9b('0x45')](handleError(_0x2d0ba9,null));}; \ No newline at end of file +var _0x750a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMail','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','getMessages','findOne','VoiceMailMessage','length','findAndCountAll','rimraf','request-promise','moment','bluebird'];(function(_0x401b3e,_0xed8de5){var _0x4f290f=function(_0xa45f77){while(--_0xa45f77){_0x401b3e['push'](_0x401b3e['shift']());}};_0x4f290f(++_0xed8de5);}(_0x750a,0x140));var _0xa750=function(_0x3b6732,_0x4e47a9){_0x3b6732=_0x3b6732-0x0;var _0x218263=_0x750a[_0x3b6732];return _0x218263;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['VoiceMail'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['VoiceMail'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['VoiceMail']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));};exports[_0xa750('0x4c')]=function(_0x13528a,_0x599e7e,_0x590b1c){return db[_0xa750('0x3e')][_0xa750('0x4d')]({'where':{'id':_0x13528a[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x599e7e,null))[_0xa750('0x1d')](function(_0x5a3cd5){var _0x4030b3;var _0xaa63be={},_0x2c7dd0={};_0x2c7dd0[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x4e')][_0xa750('0x28')]);_0x2c7dd0[_0xa750('0x30')]=_['keys'](_0x13528a[_0xa750('0x30')]);_0x2c7dd0[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],_0x2c7dd0[_0xa750('0x30')]);_0xaa63be['attributes']=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x13528a[_0xa750('0x30')][_0xa750('0x31')]));_0xaa63be[_0xa750('0x32')]=_0xaa63be[_0xa750('0x32')][_0xa750('0x4f')]?_0xaa63be[_0xa750('0x32')]:_0x2c7dd0[_0xa750('0x2c')];if(!_0x13528a[_0xa750('0x30')][_0xa750('0x33')](_0xa750('0x34'))){_0xaa63be[_0xa750('0x35')]=qs[_0xa750('0x35')](_0x13528a[_0xa750('0x30')]['limit']);_0xaa63be[_0xa750('0x17')]=qs['offset'](_0x13528a[_0xa750('0x30')][_0xa750('0x17')]);}_0xaa63be[_0xa750('0x36')]=qs['sort'](_0x13528a[_0xa750('0x30')][_0xa750('0x37')]);_0xaa63be[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x39')](_0x13528a[_0xa750('0x30')],_0x2c7dd0['filters']));if(_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]){_0xaa63be['where']=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'$or':_[_0xa750('0x27')](_0xaa63be[_0xa750('0x32')],function(_0x3255c7){var _0x1b7597={};_0x1b7597[_0x3255c7]={'$like':'%'+_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]+'%'};return _0x1b7597;})});}_0xaa63be[_0xa750('0x38')]=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'mailboxuser':_0x5a3cd5['mailbox']});_0xaa63be=_['merge']({},_0xaa63be,_0x13528a[_0xa750('0x3d')]);return db[_0xa750('0x4e')][_0xa750('0x50')](_0xaa63be)[_0xa750('0x1d')](respondWithFilteredResult(_0x599e7e,_0xaa63be));})['catch'](handleError(_0x599e7e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 076b8a9..d6e987e 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 _0x4856=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x1e3f3d,_0x51900b){var _0x39f856=function(_0x3b0800){while(--_0x3b0800){_0x1e3f3d['push'](_0x1e3f3d['shift']());}};_0x39f856(++_0x51900b);}(_0x4856,0x188));var _0x6485=function(_0x2b50e0,_0x48d2bb){_0x2b50e0=_0x2b50e0-0x0;var _0x379c45=_0x4856[_0x2b50e0];return _0x379c45;};'use strict';var _=require(_0x6485('0x0'));var util=require(_0x6485('0x1'));var logger=require('../../config/logger')(_0x6485('0x2'));var moment=require('moment');var BPromise=require(_0x6485('0x3'));var rp=require(_0x6485('0x4'));var fs=require('fs');var path=require(_0x6485('0x5'));var rimraf=require(_0x6485('0x6'));var config=require(_0x6485('0x7'));var attributes=require(_0x6485('0x8'));module['exports']=function(_0x1af99b,_0x595437){return _0x1af99b[_0x6485('0x9')](_0x6485('0xa'),attributes,{'tableName':_0x6485('0xb'),'paranoid':![],'indexes':[{'name':_0x6485('0xc'),'fields':[_0x6485('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e6c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x22853,_0xbfcf3e){var _0x3bcd80=function(_0x558f8c){while(--_0x558f8c){_0x22853['push'](_0x22853['shift']());}};_0x3bcd80(++_0xbfcf3e);}(_0x1e6c,0x69));var _0xc1e6=function(_0x5253c3,_0x3e4a0a){_0x5253c3=_0x5253c3-0x0;var _0x3c3917=_0x1e6c[_0x5253c3];return _0x3c3917;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1e6('0x0'))(_0xc1e6('0x1'));var moment=require('moment');var BPromise=require(_0xc1e6('0x2'));var rp=require(_0xc1e6('0x3'));var fs=require('fs');var path=require(_0xc1e6('0x4'));var rimraf=require(_0xc1e6('0x5'));var config=require(_0xc1e6('0x6'));var attributes=require(_0xc1e6('0x7'));module[_0xc1e6('0x8')]=function(_0x4c72af,_0x446cc7){return _0x4c72af[_0xc1e6('0x9')](_0xc1e6('0xa'),attributes,{'tableName':_0xc1e6('0xb'),'paranoid':![],'indexes':[{'name':_0xc1e6('0xc'),'fields':[_0xc1e6('0xd'),_0xc1e6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index e68f0ca..ef7b70a 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 _0x7045=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20caec,_0x265d8c){var _0xf69f5e=function(_0x4acf97){while(--_0x4acf97){_0x20caec['push'](_0x20caec['shift']());}};_0xf69f5e(++_0x265d8c);}(_0x7045,0x6a));var _0x5704=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7045[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5704('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5704('0x1'));var db=require(_0x5704('0x2'))['db'];var utils=require(_0x5704('0x3'));var logger=require(_0x5704('0x4'))(_0x5704('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5704('0x6')][_0x5704('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31cd10,_0x5a2e0e,_0x350a4d){return new BPromise(function(_0x322b0d,_0x1a555c){return client[_0x5704('0x8')](_0x31cd10,_0x350a4d)[_0x5704('0x9')](function(_0x36bd71){logger[_0x5704('0xa')](_0x5704('0xb'),_0x5a2e0e,_0x5704('0xc'));logger[_0x5704('0xd')](_0x5704('0xe'),_0x5a2e0e,_0x5704('0xc'),JSON[_0x5704('0xf')](_0x36bd71));if(_0x36bd71['error']){if(_0x36bd71[_0x5704('0x10')][_0x5704('0x11')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x5a2e0e,_0x36bd71[_0x5704('0x10')][_0x5704('0x12')]);return _0x1a555c(_0x36bd71[_0x5704('0x10')][_0x5704('0x12')]);}logger[_0x5704('0x10')](_0x5704('0xb'),_0x5a2e0e,_0x36bd71[_0x5704('0x10')][_0x5704('0x12')]);return _0x322b0d(_0x36bd71['error'][_0x5704('0x12')]);}else{logger[_0x5704('0xa')](_0x5704('0xb'),_0x5a2e0e,_0x5704('0xc'));_0x322b0d(_0x36bd71[_0x5704('0x13')][_0x5704('0x12')]);}})['catch'](function(_0x2facde){logger[_0x5704('0x10')](_0x5704('0xb'),_0x5a2e0e,_0x2facde);_0x1a555c(_0x2facde);});});} \ No newline at end of file +var _0x42b4=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x459c2b,_0x44b2d9){var _0x26bc62=function(_0xf8c480){while(--_0xf8c480){_0x459c2b['push'](_0x459c2b['shift']());}};_0x26bc62(++_0x44b2d9);}(_0x42b4,0x73));var _0x442b=function(_0x5cef5c,_0x375597){_0x5cef5c=_0x5cef5c-0x0;var _0x2684bd=_0x42b4[_0x5cef5c];return _0x2684bd;};'use strict';var _=require(_0x442b('0x0'));var util=require(_0x442b('0x1'));var moment=require(_0x442b('0x2'));var BPromise=require(_0x442b('0x3'));var rs=require(_0x442b('0x4'));var fs=require('fs');var Redis=require(_0x442b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x442b('0x6'));var logger=require('../../config/logger')(_0x442b('0x7'));var config=require(_0x442b('0x8'));var jayson=require(_0x442b('0x9'));var client=jayson[_0x442b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5df7f8,_0x11fe99,_0xd79d4b){return new BPromise(function(_0x44b5c9,_0xa2e94b){return client[_0x442b('0xb')](_0x5df7f8,_0xd79d4b)[_0x442b('0xc')](function(_0x38ca28){logger[_0x442b('0xd')](_0x442b('0xe'),_0x11fe99,'request\x20sent');logger[_0x442b('0xf')](_0x442b('0x10'),_0x11fe99,_0x442b('0x11'),JSON['stringify'](_0x38ca28));if(_0x38ca28['error']){if(_0x38ca28[_0x442b('0x12')][_0x442b('0x13')]===0x1f4){logger[_0x442b('0x12')](_0x442b('0xe'),_0x11fe99,_0x38ca28[_0x442b('0x12')]['message']);return _0xa2e94b(_0x38ca28[_0x442b('0x12')][_0x442b('0x14')]);}logger[_0x442b('0x12')]('VoiceMail,\x20%s,\x20%s',_0x11fe99,_0x38ca28[_0x442b('0x12')][_0x442b('0x14')]);return _0x44b5c9(_0x38ca28[_0x442b('0x12')]['message']);}else{logger[_0x442b('0xd')](_0x442b('0xe'),_0x11fe99,_0x442b('0x11'));_0x44b5c9(_0x38ca28[_0x442b('0x15')][_0x442b('0x14')]);}})[_0x442b('0x16')](function(_0x37c80a){logger[_0x442b('0x12')](_0x442b('0xe'),_0x11fe99,_0x37c80a);_0xa2e94b(_0x37c80a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d3ad76f..7189518 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 _0xb30f=['post','create','delete','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','show','/:id/download','isAuthenticated'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0xb30f,0x195));var _0xfb30=function(_0x142891,_0x4b9d6c){_0x142891=_0x142891-0x0;var _0x51df81=_0xb30f[_0x142891];return _0x51df81;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfb30('0x0'));var express=require('express');var router=express[_0xfb30('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfb30('0x2'));var interaction=require(_0xfb30('0x3'));var config=require(_0xfb30('0x4'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xfb30('0x5')]);router[_0xfb30('0x6')](_0xfb30('0x7'),auth['isAuthenticated'](),controller[_0xfb30('0x8')]);router[_0xfb30('0x6')](_0xfb30('0x9'),auth[_0xfb30('0xa')](),controller['download']);router[_0xfb30('0xb')]('/',auth[_0xfb30('0xa')](),controller[_0xfb30('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfb30('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xfb30('0xe')]);module[_0xfb30('0xf')]=router; \ No newline at end of file +var _0x4838=['isAuthenticated','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./voiceMailMessage.controller','get'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x4838,0xbf));var _0x8483=function(_0xed9299,_0x25f580){_0xed9299=_0xed9299-0x0;var _0x57bd5c=_0x4838[_0xed9299];return _0x57bd5c;};'use strict';var multer=require(_0x8483('0x0'));var util=require(_0x8483('0x1'));var path=require(_0x8483('0x2'));var timeout=require('connect-timeout');var express=require(_0x8483('0x3'));var router=express[_0x8483('0x4')]();var fs_extra=require(_0x8483('0x5'));var auth=require(_0x8483('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8483('0x7'));router[_0x8483('0x8')]('/',auth[_0x8483('0x9')](),controller['index']);router[_0x8483('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8483('0xa'),auth[_0x8483('0x9')](),controller[_0x8483('0xb')]);router[_0x8483('0xc')]('/',auth[_0x8483('0x9')](),controller[_0x8483('0xd')]);router[_0x8483('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8483('0xf')]);router[_0x8483('0x10')](_0x8483('0x11'),auth[_0x8483('0x9')](),controller[_0x8483('0x12')]);module[_0x8483('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 3ee7612..4e8d51c 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 _0xce8b=['INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x5e4d54,_0x4c590a){var _0x22523c=function(_0x55784a){while(--_0x55784a){_0x5e4d54['push'](_0x5e4d54['shift']());}};_0x22523c(++_0x4c590a);}(_0xce8b,0x1f0));var _0xbce8=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xce8b[_0x3bfdde];return _0x3f752a;};'use strict';var Sequelize=require(_0xbce8('0x0'));module[_0xbce8('0x1')]={'name':{'type':Sequelize[_0xbce8('0x2')],'get':function(_0xbe0d0d){return this[_0xbce8('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xbce8('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xbce8('0x6')](_0xbce8('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xbce8('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xbce8('0x8'),'defaultValue':Sequelize['literal'](_0xbce8('0x9'))}}; \ No newline at end of file +var _0xf74a=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x5b8f91,_0x2c2354){var _0x2c7db5=function(_0x1f53f5){while(--_0x1f53f5){_0x5b8f91['push'](_0x5b8f91['shift']());}};_0x2c7db5(++_0x2c2354);}(_0xf74a,0x8c));var _0xaf74=function(_0x207c88,_0x433988){_0x207c88=_0x207c88-0x0;var _0xe742d3=_0xf74a[_0x207c88];return _0xe742d3;};'use strict';var Sequelize=require('sequelize');module[_0xaf74('0x0')]={'name':{'type':Sequelize[_0xaf74('0x1')],'get':function(_0x54a1f4){return this[_0xaf74('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xaf74('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xaf74('0x5')](_0xaf74('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xaf74('0x4')],'defaultValue':''},'stamp':{'type':_0xaf74('0x7'),'defaultValue':Sequelize[_0xaf74('0x8')](_0xaf74('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9e2c228..3abc108 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 _0x1886=['merge','type','VIRTUAL','options','include','VoiceMailMessage','findAll','rows','show','params','rawAttributes','includeAll','catch','create','body','update','find','destroy','download','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','map','key','model','differenceBy','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter'];(function(_0x410ca2,_0x4359b7){var _0xa7b1f7=function(_0x817a13){while(--_0x817a13){_0x410ca2['push'](_0x410ca2['shift']());}};_0xa7b1f7(++_0x4359b7);}(_0x1886,0x16b));var _0x6188=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1886[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6188('0x0'));var rimraf=require(_0x6188('0x1'));var zipdir=require(_0x6188('0x2'));var jsonpatch=require(_0x6188('0x3'));var rp=require('request-promise');var moment=require(_0x6188('0x4'));var BPromise=require(_0x6188('0x5'));var Mustache=require('mustache');var util=require(_0x6188('0x6'));var path=require(_0x6188('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6188('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6188('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6188('0xa'));var deskjs=require(_0x6188('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6188('0xc'));var Papa=require(_0x6188('0xd'));var Redis=require('ioredis');var authService=require(_0x6188('0xe'));var qs=require(_0x6188('0xf'));var as=require(_0x6188('0x10'));var hardwareService=require(_0x6188('0x11'));var logger=require('../../config/logger')(_0x6188('0x12'));var utils=require(_0x6188('0x13'));var config=require(_0x6188('0x14'));var licenseUtil=require(_0x6188('0x15'));var db=require(_0x6188('0x16'))['db'];function respondWithStatusCode(_0x40d9cd,_0x43cfcd){_0x43cfcd=_0x43cfcd||0xcc;return function(_0x2302ab){if(_0x2302ab){return _0x40d9cd[_0x6188('0x17')](_0x43cfcd);}return _0x40d9cd[_0x6188('0x18')](_0x43cfcd)['end']();};}function respondWithResult(_0x2f5762,_0x43e9c0){_0x43e9c0=_0x43e9c0||0xc8;return function(_0x4ac0e4){if(_0x4ac0e4){return _0x2f5762[_0x6188('0x18')](_0x43e9c0)[_0x6188('0x19')](_0x4ac0e4);}};}function respondWithFilteredResult(_0x3c8a02,_0x13b849){return function(_0x3817b4){if(_0x3817b4){var _0x305c67=typeof _0x13b849[_0x6188('0x1a')]==='undefined'&&typeof _0x13b849['limit']===_0x6188('0x1b');var _0x5e55ae=_0x3817b4['count'];var _0x4d15e6=_0x305c67?0x0:_0x13b849['offset'];var _0x17b37=_0x305c67?_0x3817b4[_0x6188('0x1c')]:_0x13b849[_0x6188('0x1a')]+_0x13b849[_0x6188('0x1d')];var _0x2c04cf;if(_0x17b37>=_0x5e55ae){_0x17b37=_0x5e55ae;_0x2c04cf=0xc8;}else{_0x2c04cf=0xce;}_0x3c8a02[_0x6188('0x18')](_0x2c04cf);return _0x3c8a02[_0x6188('0x1e')](_0x6188('0x1f'),_0x4d15e6+'-'+_0x17b37+'/'+_0x5e55ae)[_0x6188('0x19')](_0x3817b4);}return null;};}function patchUpdates(_0x34e923){return function(_0x180e87){try{jsonpatch[_0x6188('0x20')](_0x180e87,_0x34e923,!![]);}catch(_0x32b4e1){return BPromise[_0x6188('0x21')](_0x32b4e1);}return _0x180e87[_0x6188('0x22')]();};}function saveUpdates(_0x2b20c0,_0xdce979){return function(_0x3845d6){if(_0x3845d6){return _0x3845d6['update'](_0x2b20c0)[_0x6188('0x23')](function(_0x1855b8){return _0x1855b8;});}return null;};}function removeEntity(_0x3eae0f,_0x210d3c){return function(_0x7cb077){if(_0x7cb077){return _0x7cb077['destroy']()[_0x6188('0x23')](function(){_0x3eae0f[_0x6188('0x18')](0xcc)[_0x6188('0x24')]();});}};}function handleEntityNotFound(_0x12af1a,_0x348779){return function(_0x58dd92){if(!_0x58dd92){_0x12af1a[_0x6188('0x17')](0x194);}return _0x58dd92;};}function handleError(_0x597745,_0x110a3e){_0x110a3e=_0x110a3e||0x1f4;return function(_0x31f7ed){logger[_0x6188('0x25')](_0x31f7ed[_0x6188('0x26')]);if(_0x31f7ed[_0x6188('0x27')]){delete _0x31f7ed[_0x6188('0x27')];}_0x597745[_0x6188('0x18')](_0x110a3e)[_0x6188('0x28')](_0x31f7ed);};}exports['index']=function(_0x50d4b6,_0xd53faa){var _0x594a10={},_0x10841f={},_0x54f87f={'count':0x0,'rows':[]};var _0x23864f=_[_0x6188('0x29')](db['VoiceMailMessage']['rawAttributes'],function(_0x2ae1c5){return{'name':_0x2ae1c5['fieldName'],'type':_0x2ae1c5['type'][_0x6188('0x2a')]};});_0x10841f[_0x6188('0x2b')]=_[_0x6188('0x2c')](_['map'](_0x23864f,_0x6188('0x27')),['name']);_0x10841f['query']=_[_0x6188('0x2d')](_0x50d4b6[_0x6188('0x2e')]);_0x10841f['filters']=_['intersection'](_0x10841f['model'],_0x10841f[_0x6188('0x2e')]);_0x594a10[_0x6188('0x2f')]=_[_0x6188('0x30')](_0x10841f['model'],qs[_0x6188('0x31')](_0x50d4b6[_0x6188('0x2e')]['fields']));_0x594a10['attributes']=_0x594a10[_0x6188('0x2f')][_0x6188('0x32')]?_0x594a10[_0x6188('0x2f')]:_0x10841f[_0x6188('0x2b')];if(!_0x50d4b6[_0x6188('0x2e')][_0x6188('0x33')]('nolimit')){_0x594a10[_0x6188('0x1d')]=qs[_0x6188('0x1d')](_0x50d4b6[_0x6188('0x2e')][_0x6188('0x1d')]);_0x594a10['offset']=qs[_0x6188('0x1a')](_0x50d4b6['query'][_0x6188('0x1a')]);}_0x594a10[_0x6188('0x34')]=qs['sort'](_0x50d4b6['query']['sort']);_0x594a10[_0x6188('0x35')]=qs[_0x6188('0x36')](_[_0x6188('0x37')](_0x50d4b6[_0x6188('0x2e')],_0x10841f[_0x6188('0x36')]),_0x23864f);if(_0x50d4b6[_0x6188('0x2e')][_0x6188('0x38')]){_0x594a10['where']=_[_0x6188('0x39')](_0x594a10[_0x6188('0x35')],{'$or':_[_0x6188('0x29')](_0x23864f,function(_0xa94c79){if(_0xa94c79[_0x6188('0x3a')]!==_0x6188('0x3b')){var _0x31941a={};_0x31941a[_0xa94c79[_0x6188('0x27')]]={'$like':'%'+_0x50d4b6[_0x6188('0x2e')][_0x6188('0x38')]+'%'};return _0x31941a;}})});}_0x594a10=_[_0x6188('0x39')]({},_0x594a10,_0x50d4b6[_0x6188('0x3c')]);var _0x869d09={'where':_0x594a10[_0x6188('0x35')]};return db['VoiceMailMessage'][_0x6188('0x1c')](_0x869d09)[_0x6188('0x23')](function(_0x149aa6){_0x54f87f['count']=_0x149aa6;if(_0x50d4b6['query']['includeAll']){_0x594a10[_0x6188('0x3d')]=[{'all':!![]}];}return db[_0x6188('0x3e')][_0x6188('0x3f')](_0x594a10);})[_0x6188('0x23')](function(_0x229090){_0x54f87f[_0x6188('0x40')]=_0x229090;return _0x54f87f;})[_0x6188('0x23')](respondWithFilteredResult(_0xd53faa,_0x594a10))['catch'](handleError(_0xd53faa,null));};exports[_0x6188('0x41')]=function(_0x53241d,_0x11e5aa){var _0x51b00f={'raw':!![],'where':{'id':_0x53241d[_0x6188('0x42')]['id']}},_0x117454={};_0x117454[_0x6188('0x2b')]=_['keys'](db[_0x6188('0x3e')][_0x6188('0x43')]);_0x117454[_0x6188('0x2e')]=_[_0x6188('0x2d')](_0x53241d[_0x6188('0x2e')]);_0x117454[_0x6188('0x36')]=_[_0x6188('0x30')](_0x117454[_0x6188('0x2b')],_0x117454[_0x6188('0x2e')]);_0x51b00f['attributes']=_['intersection'](_0x117454[_0x6188('0x2b')],qs[_0x6188('0x31')](_0x53241d[_0x6188('0x2e')][_0x6188('0x31')]));_0x51b00f[_0x6188('0x2f')]=_0x51b00f[_0x6188('0x2f')][_0x6188('0x32')]?_0x51b00f[_0x6188('0x2f')]:_0x117454[_0x6188('0x2b')];if(_0x53241d[_0x6188('0x2e')][_0x6188('0x44')]){_0x51b00f[_0x6188('0x3d')]=[{'all':!![]}];}_0x51b00f=_[_0x6188('0x39')]({},_0x51b00f,_0x53241d['options']);return db['VoiceMailMessage']['find'](_0x51b00f)[_0x6188('0x23')](handleEntityNotFound(_0x11e5aa,null))[_0x6188('0x23')](respondWithResult(_0x11e5aa,null))[_0x6188('0x45')](handleError(_0x11e5aa,null));};exports[_0x6188('0x46')]=function(_0x1c528e,_0x4dfb2b){return db[_0x6188('0x3e')]['create'](_0x1c528e[_0x6188('0x47')],{})[_0x6188('0x23')](respondWithResult(_0x4dfb2b,0xc9))[_0x6188('0x45')](handleError(_0x4dfb2b,null));};exports[_0x6188('0x48')]=function(_0x432e9,_0x416f4a){if(_0x432e9[_0x6188('0x47')]['id']){delete _0x432e9['body']['id'];}return db['VoiceMailMessage'][_0x6188('0x49')]({'where':{'id':_0x432e9[_0x6188('0x42')]['id']}})[_0x6188('0x23')](handleEntityNotFound(_0x416f4a,null))['then'](saveUpdates(_0x432e9['body'],null))[_0x6188('0x23')](respondWithResult(_0x416f4a,null))[_0x6188('0x45')](handleError(_0x416f4a,null));};exports[_0x6188('0x4a')]=function(_0x210db8,_0x216458){return db[_0x6188('0x3e')][_0x6188('0x49')]({'where':{'id':_0x210db8[_0x6188('0x42')]['id']}})[_0x6188('0x23')](handleEntityNotFound(_0x216458,null))[_0x6188('0x23')](removeEntity(_0x216458,null))[_0x6188('0x45')](handleError(_0x216458,null));};exports[_0x6188('0x4b')]=function(_0x3012c3,_0xaf41b8,_0x573252){return db[_0x6188('0x3e')][_0x6188('0x49')]({'where':{'id':_0x3012c3[_0x6188('0x42')]['id']},'attributes':['id','recording',_0x6188('0x4c')]})[_0x6188('0x23')](handleEntityNotFound(_0xaf41b8,null))[_0x6188('0x23')](function(_0x3404e5){if(_0x3404e5){if(!_0x3404e5['recording']){throw new db[(_0x6188('0x4d'))]['ValidationError'](_0x6188('0x4e'));}var _0x5a8ad9={'Content-Type':'audio/wav','Content-Disposition':_0x6188('0x4f')};if(_0x3404e5[_0x6188('0x4c')]){_0x5a8ad9[_0x6188('0x50')]=_0x6188('0x51')+_0x3404e5[_0x6188('0x4c')]+_0x6188('0x52');}_0xaf41b8[_0x6188('0x1e')](_0x5a8ad9);return _0xaf41b8[_0x6188('0x28')](new Buffer(_0x3404e5[_0x6188('0x53')]));}})['catch'](handleError(_0xaf41b8,null));}; \ No newline at end of file +var _0x3318=['then','rows','catch','show','keys','create','body','find','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','.wav\x22','send','eml-format','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','reject','update','destroy','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','count','include','findAll'];(function(_0x46b993,_0x4a215b){var _0x477845=function(_0x444c25){while(--_0x444c25){_0x46b993['push'](_0x46b993['shift']());}};_0x477845(++_0x4a215b);}(_0x3318,0x10c));var _0x8331=function(_0x9d0c16,_0x228248){_0x9d0c16=_0x9d0c16-0x0;var _0x2b48cf=_0x3318[_0x9d0c16];return _0x2b48cf;};'use strict';var emlformat=require(_0x8331('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8331('0x1'));var rp=require('request-promise');var moment=require(_0x8331('0x2'));var BPromise=require(_0x8331('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8331('0x4'));var ejs=require(_0x8331('0x5'));var fs=require('fs');var fs_extra=require(_0x8331('0x6'));var _=require(_0x8331('0x7'));var squel=require(_0x8331('0x8'));var crypto=require(_0x8331('0x9'));var jsforce=require(_0x8331('0xa'));var deskjs=require(_0x8331('0xb'));var toCsv=require(_0x8331('0x4'));var querystring=require(_0x8331('0xc'));var Papa=require(_0x8331('0xd'));var Redis=require(_0x8331('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8331('0xf'));var as=require(_0x8331('0x10'));var hardwareService=require(_0x8331('0x11'));var logger=require('../../config/logger')(_0x8331('0x12'));var utils=require(_0x8331('0x13'));var config=require(_0x8331('0x14'));var licenseUtil=require(_0x8331('0x15'));var db=require(_0x8331('0x16'))['db'];function respondWithStatusCode(_0x5439fc,_0x468183){_0x468183=_0x468183||0xcc;return function(_0x37d7df){if(_0x37d7df){return _0x5439fc[_0x8331('0x17')](_0x468183);}return _0x5439fc[_0x8331('0x18')](_0x468183)[_0x8331('0x19')]();};}function respondWithResult(_0x20067d,_0x2bc904){_0x2bc904=_0x2bc904||0xc8;return function(_0x3505b7){if(_0x3505b7){return _0x20067d[_0x8331('0x18')](_0x2bc904)['json'](_0x3505b7);}};}function respondWithFilteredResult(_0x5d6d81,_0x3e64c6){return function(_0x5b8757){if(_0x5b8757){var _0x3c894d=typeof _0x3e64c6[_0x8331('0x1a')]===_0x8331('0x1b')&&typeof _0x3e64c6['limit']===_0x8331('0x1b');var _0xf1751e=_0x5b8757['count'];var _0x425daa=_0x3c894d?0x0:_0x3e64c6[_0x8331('0x1a')];var _0x5cfee9=_0x3c894d?_0x5b8757['count']:_0x3e64c6[_0x8331('0x1a')]+_0x3e64c6[_0x8331('0x1c')];var _0x97433a;if(_0x5cfee9>=_0xf1751e){_0x5cfee9=_0xf1751e;_0x97433a=0xc8;}else{_0x97433a=0xce;}_0x5d6d81[_0x8331('0x18')](_0x97433a);return _0x5d6d81[_0x8331('0x1d')](_0x8331('0x1e'),_0x425daa+'-'+_0x5cfee9+'/'+_0xf1751e)[_0x8331('0x1f')](_0x5b8757);}return null;};}function patchUpdates(_0x337a3c){return function(_0x497232){try{jsonpatch['apply'](_0x497232,_0x337a3c,!![]);}catch(_0x158c74){return BPromise[_0x8331('0x20')](_0x158c74);}return _0x497232['save']();};}function saveUpdates(_0x3ba4a6,_0x5d714d){return function(_0xeb1289){if(_0xeb1289){return _0xeb1289[_0x8331('0x21')](_0x3ba4a6)['then'](function(_0x3cffa8){return _0x3cffa8;});}return null;};}function removeEntity(_0x244689,_0x23ee0f){return function(_0x55a951){if(_0x55a951){return _0x55a951[_0x8331('0x22')]()['then'](function(){_0x244689[_0x8331('0x18')](0xcc)[_0x8331('0x19')]();});}};}function handleEntityNotFound(_0x33d4a7,_0xd3f739){return function(_0x26fc1c){if(!_0x26fc1c){_0x33d4a7[_0x8331('0x17')](0x194);}return _0x26fc1c;};}function handleError(_0x538ea4,_0x575dab){_0x575dab=_0x575dab||0x1f4;return function(_0x1a3f71){logger[_0x8331('0x23')](_0x1a3f71[_0x8331('0x24')]);if(_0x1a3f71['name']){delete _0x1a3f71[_0x8331('0x25')];}_0x538ea4[_0x8331('0x18')](_0x575dab)['send'](_0x1a3f71);};}exports[_0x8331('0x26')]=function(_0x41baf2,_0x493c28){var _0x33296a={},_0x2a97a5={},_0x44ed4f={'count':0x0,'rows':[]};var _0x45836a=_[_0x8331('0x27')](db[_0x8331('0x28')][_0x8331('0x29')],function(_0x444220){return{'name':_0x444220[_0x8331('0x2a')],'type':_0x444220['type'][_0x8331('0x2b')]};});_0x2a97a5[_0x8331('0x2c')]=_[_0x8331('0x2d')](_['map'](_0x45836a,_0x8331('0x25')),[_0x8331('0x25')]);_0x2a97a5[_0x8331('0x2e')]=_['keys'](_0x41baf2['query']);_0x2a97a5[_0x8331('0x2f')]=_[_0x8331('0x30')](_0x2a97a5['model'],_0x2a97a5[_0x8331('0x2e')]);_0x33296a[_0x8331('0x31')]=_[_0x8331('0x30')](_0x2a97a5[_0x8331('0x2c')],qs[_0x8331('0x32')](_0x41baf2[_0x8331('0x2e')][_0x8331('0x32')]));_0x33296a[_0x8331('0x31')]=_0x33296a[_0x8331('0x31')][_0x8331('0x33')]?_0x33296a['attributes']:_0x2a97a5[_0x8331('0x2c')];if(!_0x41baf2[_0x8331('0x2e')][_0x8331('0x34')](_0x8331('0x35'))){_0x33296a['limit']=qs['limit'](_0x41baf2[_0x8331('0x2e')][_0x8331('0x1c')]);_0x33296a[_0x8331('0x1a')]=qs[_0x8331('0x1a')](_0x41baf2['query']['offset']);}_0x33296a[_0x8331('0x36')]=qs[_0x8331('0x37')](_0x41baf2[_0x8331('0x2e')][_0x8331('0x37')]);_0x33296a[_0x8331('0x38')]=qs[_0x8331('0x2f')](_['pick'](_0x41baf2[_0x8331('0x2e')],_0x2a97a5[_0x8331('0x2f')]),_0x45836a);if(_0x41baf2[_0x8331('0x2e')][_0x8331('0x39')]){_0x33296a[_0x8331('0x38')]=_[_0x8331('0x3a')](_0x33296a[_0x8331('0x38')],{'$or':_['map'](_0x45836a,function(_0x527f55){if(_0x527f55[_0x8331('0x3b')]!=='VIRTUAL'){var _0xea3738={};_0xea3738[_0x527f55[_0x8331('0x25')]]={'$like':'%'+_0x41baf2[_0x8331('0x2e')]['filter']+'%'};return _0xea3738;}})});}_0x33296a=_[_0x8331('0x3a')]({},_0x33296a,_0x41baf2[_0x8331('0x3c')]);var _0xc935db={'where':_0x33296a[_0x8331('0x38')]};return db[_0x8331('0x28')]['count'](_0xc935db)['then'](function(_0x55bb4c){_0x44ed4f[_0x8331('0x3d')]=_0x55bb4c;if(_0x41baf2['query']['includeAll']){_0x33296a[_0x8331('0x3e')]=[{'all':!![]}];}return db[_0x8331('0x28')][_0x8331('0x3f')](_0x33296a);})[_0x8331('0x40')](function(_0x1d8c4d){_0x44ed4f[_0x8331('0x41')]=_0x1d8c4d;return _0x44ed4f;})['then'](respondWithFilteredResult(_0x493c28,_0x33296a))[_0x8331('0x42')](handleError(_0x493c28,null));};exports[_0x8331('0x43')]=function(_0x44e26c,_0x2c37ff){var _0x23e848={'raw':!![],'where':{'id':_0x44e26c['params']['id']}},_0x56ca7d={};_0x56ca7d[_0x8331('0x2c')]=_['keys'](db[_0x8331('0x28')][_0x8331('0x29')]);_0x56ca7d['query']=_[_0x8331('0x44')](_0x44e26c[_0x8331('0x2e')]);_0x56ca7d['filters']=_[_0x8331('0x30')](_0x56ca7d['model'],_0x56ca7d[_0x8331('0x2e')]);_0x23e848[_0x8331('0x31')]=_['intersection'](_0x56ca7d[_0x8331('0x2c')],qs['fields'](_0x44e26c[_0x8331('0x2e')][_0x8331('0x32')]));_0x23e848[_0x8331('0x31')]=_0x23e848[_0x8331('0x31')][_0x8331('0x33')]?_0x23e848[_0x8331('0x31')]:_0x56ca7d[_0x8331('0x2c')];if(_0x44e26c['query']['includeAll']){_0x23e848[_0x8331('0x3e')]=[{'all':!![]}];}_0x23e848=_[_0x8331('0x3a')]({},_0x23e848,_0x44e26c['options']);return db[_0x8331('0x28')]['find'](_0x23e848)[_0x8331('0x40')](handleEntityNotFound(_0x2c37ff,null))[_0x8331('0x40')](respondWithResult(_0x2c37ff,null))['catch'](handleError(_0x2c37ff,null));};exports[_0x8331('0x45')]=function(_0x4c9fed,_0x2d9c81){return db[_0x8331('0x28')][_0x8331('0x45')](_0x4c9fed[_0x8331('0x46')],{})[_0x8331('0x40')](respondWithResult(_0x2d9c81,0xc9))[_0x8331('0x42')](handleError(_0x2d9c81,null));};exports[_0x8331('0x21')]=function(_0x245168,_0x22a48c){if(_0x245168[_0x8331('0x46')]['id']){delete _0x245168[_0x8331('0x46')]['id'];}return db[_0x8331('0x28')][_0x8331('0x47')]({'where':{'id':_0x245168['params']['id']}})['then'](handleEntityNotFound(_0x22a48c,null))[_0x8331('0x40')](saveUpdates(_0x245168[_0x8331('0x46')],null))['then'](respondWithResult(_0x22a48c,null))[_0x8331('0x42')](handleError(_0x22a48c,null));};exports[_0x8331('0x22')]=function(_0x3d168c,_0x4f75f4){return db[_0x8331('0x28')][_0x8331('0x47')]({'where':{'id':_0x3d168c[_0x8331('0x48')]['id']}})[_0x8331('0x40')](handleEntityNotFound(_0x4f75f4,null))[_0x8331('0x40')](removeEntity(_0x4f75f4,null))['catch'](handleError(_0x4f75f4,null));};exports[_0x8331('0x49')]=function(_0x548357,_0x2f1ee8,_0xcb1e1d){return db['VoiceMailMessage'][_0x8331('0x47')]({'where':{'id':_0x548357[_0x8331('0x48')]['id']},'attributes':['id',_0x8331('0x4a'),_0x8331('0x4b')]})[_0x8331('0x40')](handleEntityNotFound(_0x2f1ee8,null))[_0x8331('0x40')](function(_0x1fc57c){if(_0x1fc57c){if(!_0x1fc57c[_0x8331('0x4a')]){throw new db[(_0x8331('0x4c'))][(_0x8331('0x4d'))](_0x8331('0x4e'));}var _0xc149e5={'Content-Type':'audio/wav','Content-Disposition':_0x8331('0x4f')};if(_0x1fc57c[_0x8331('0x4b')]){_0xc149e5[_0x8331('0x50')]='attachment;\x20filename=\x22'+_0x1fc57c['msg_id']+_0x8331('0x51');}_0x2f1ee8[_0x8331('0x1d')](_0xc149e5);return _0x2f1ee8[_0x8331('0x52')](new Buffer(_0x1fc57c[_0x8331('0x4a')]));}})[_0x8331('0x42')](handleError(_0x2f1ee8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 3001a23..f042547 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 _0xe93f=['request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47643e,_0x337374){var _0x2aa5db=function(_0x5dcbf2){while(--_0x5dcbf2){_0x47643e['push'](_0x47643e['shift']());}};_0x2aa5db(++_0x337374);}(_0xe93f,0x1ce));var _0xfe93=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe93f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfe93('0x0'));var util=require(_0xfe93('0x1'));var logger=require(_0xfe93('0x2'))(_0xfe93('0x3'));var moment=require(_0xfe93('0x4'));var BPromise=require(_0xfe93('0x5'));var rp=require(_0xfe93('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe93('0x7'));var config=require(_0xfe93('0x8'));var attributes=require(_0xfe93('0x9'));module[_0xfe93('0xa')]=function(_0x1e19ef,_0x4d477d){return _0x1e19ef[_0xfe93('0xb')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xfe93('0xc'),'fields':[_0xfe93('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb617=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1964e9,_0x3df886){var _0x2121ed=function(_0x34b82b){while(--_0x34b82b){_0x1964e9['push'](_0x1964e9['shift']());}};_0x2121ed(++_0x3df886);}(_0xb617,0x90));var _0x7b61=function(_0x23dae1,_0x1c09fc){_0x23dae1=_0x23dae1-0x0;var _0xebb4c0=_0xb617[_0x23dae1];return _0xebb4c0;};'use strict';var _=require(_0x7b61('0x0'));var util=require(_0x7b61('0x1'));var logger=require(_0x7b61('0x2'))(_0x7b61('0x3'));var moment=require(_0x7b61('0x4'));var BPromise=require(_0x7b61('0x5'));var rp=require(_0x7b61('0x6'));var fs=require('fs');var path=require(_0x7b61('0x7'));var rimraf=require(_0x7b61('0x8'));var config=require(_0x7b61('0x9'));var attributes=require('./voiceMailMessage.attributes');module[_0x7b61('0xa')]=function(_0x1f15f6,_0x49dda6){return _0x1f15f6[_0x7b61('0xb')](_0x7b61('0xc'),attributes,{'tableName':_0x7b61('0xd'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x7b61('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index bc4c16a..571e9cf 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 _0x6010=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x5217bf,_0x3cb838){var _0x407d67=function(_0x373de8){while(--_0x373de8){_0x5217bf['push'](_0x5217bf['shift']());}};_0x407d67(++_0x3cb838);}(_0x6010,0x1b5));var _0x0601=function(_0x3cbaa5,_0x38438a){_0x3cbaa5=_0x3cbaa5-0x0;var _0x3ab256=_0x6010[_0x3cbaa5];return _0x3ab256;};'use strict';var _=require(_0x0601('0x0'));var util=require(_0x0601('0x1'));var moment=require('moment');var BPromise=require(_0x0601('0x2'));var rs=require(_0x0601('0x3'));var fs=require('fs');var Redis=require(_0x0601('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0601('0x5'));var logger=require(_0x0601('0x6'))('rpc');var config=require(_0x0601('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0601('0x8')][_0x0601('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80870c,_0x1d04ae,_0x4a0b76){return new BPromise(function(_0x1e8e47,_0x330ad5){return client[_0x0601('0xa')](_0x80870c,_0x4a0b76)[_0x0601('0xb')](function(_0x5638fb){logger[_0x0601('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d04ae,_0x0601('0xd'));logger[_0x0601('0xe')](_0x0601('0xf'),_0x1d04ae,_0x0601('0xd'),JSON[_0x0601('0x10')](_0x5638fb));if(_0x5638fb['error']){if(_0x5638fb[_0x0601('0x11')]['code']===0x1f4){logger[_0x0601('0x11')](_0x0601('0x12'),_0x1d04ae,_0x5638fb[_0x0601('0x11')][_0x0601('0x13')]);return _0x330ad5(_0x5638fb[_0x0601('0x11')][_0x0601('0x13')]);}logger[_0x0601('0x11')](_0x0601('0x12'),_0x1d04ae,_0x5638fb[_0x0601('0x11')][_0x0601('0x13')]);return _0x1e8e47(_0x5638fb[_0x0601('0x11')][_0x0601('0x13')]);}else{logger[_0x0601('0xc')](_0x0601('0x12'),_0x1d04ae,_0x0601('0xd'));_0x1e8e47(_0x5638fb[_0x0601('0x14')][_0x0601('0x13')]);}})[_0x0601('0x15')](function(_0x2ff7ff){logger[_0x0601('0x11')](_0x0601('0x12'),_0x1d04ae,_0x2ff7ff);_0x330ad5(_0x2ff7ff);});});} \ No newline at end of file +var _0x6aa6=['client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6aa6,0x75));var _0x66aa=function(_0xf90f2d,_0x33e494){_0xf90f2d=_0xf90f2d-0x0;var _0x3d9694=_0x6aa6[_0xf90f2d];return _0x3d9694;};'use strict';var _=require(_0x66aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x66aa('0x1'));var rs=require(_0x66aa('0x2'));var fs=require('fs');var Redis=require(_0x66aa('0x3'));var db=require(_0x66aa('0x4'))['db'];var utils=require(_0x66aa('0x5'));var logger=require(_0x66aa('0x6'))(_0x66aa('0x7'));var config=require(_0x66aa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66aa('0x9')][_0x66aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10f63b,_0x1eafb8,_0x214cd9){return new BPromise(function(_0x1d8bec,_0xde0d86){return client['request'](_0x10f63b,_0x214cd9)[_0x66aa('0xb')](function(_0x424236){logger['info'](_0x66aa('0xc'),_0x1eafb8,_0x66aa('0xd'));logger[_0x66aa('0xe')](_0x66aa('0xf'),_0x1eafb8,'request\x20sent',JSON[_0x66aa('0x10')](_0x424236));if(_0x424236[_0x66aa('0x11')]){if(_0x424236[_0x66aa('0x11')]['code']===0x1f4){logger[_0x66aa('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x1eafb8,_0x424236[_0x66aa('0x11')][_0x66aa('0x12')]);return _0xde0d86(_0x424236['error']['message']);}logger[_0x66aa('0x11')](_0x66aa('0xc'),_0x1eafb8,_0x424236[_0x66aa('0x11')]['message']);return _0x1d8bec(_0x424236[_0x66aa('0x11')][_0x66aa('0x12')]);}else{logger[_0x66aa('0x13')](_0x66aa('0xc'),_0x1eafb8,_0x66aa('0xd'));_0x1d8bec(_0x424236['result'][_0x66aa('0x12')]);}})[_0x66aa('0x14')](function(_0x235967){logger[_0x66aa('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x1eafb8,_0x235967);_0xde0d86(_0x235967);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index a7acbe8..4460f7e 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 _0x8ab6=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','/:id/sounds','getSounds','post','update','delete','removeSound','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x48edc4,_0x511029){var _0x57e137=function(_0x20656e){while(--_0x20656e){_0x48edc4['push'](_0x48edc4['shift']());}};_0x57e137(++_0x511029);}(_0x8ab6,0x189));var _0x68ab=function(_0x1e62fe,_0x4ff801){_0x1e62fe=_0x1e62fe-0x0;var _0x3f4cc6=_0x8ab6[_0x1e62fe];return _0x3f4cc6;};'use strict';var multer=require(_0x68ab('0x0'));var util=require('util');var path=require(_0x68ab('0x1'));var timeout=require(_0x68ab('0x2'));var express=require(_0x68ab('0x3'));var router=express['Router']();var fs_extra=require(_0x68ab('0x4'));var auth=require(_0x68ab('0x5'));var interaction=require(_0x68ab('0x6'));var config=require(_0x68ab('0x7'));var controller=require(_0x68ab('0x8'));router[_0x68ab('0x9')]('/',auth['isAuthenticated'](),controller[_0x68ab('0xa')]);router[_0x68ab('0x9')](_0x68ab('0xb'),auth[_0x68ab('0xc')](),controller['show']);router[_0x68ab('0x9')](_0x68ab('0xd'),auth[_0x68ab('0xc')](),controller[_0x68ab('0xe')]);router[_0x68ab('0xf')]('/',auth[_0x68ab('0xc')](),controller['create']);router[_0x68ab('0xf')](_0x68ab('0xd'),auth[_0x68ab('0xc')](),controller['addSound']);router['put'](_0x68ab('0xb'),auth['isAuthenticated'](),controller[_0x68ab('0x10')]);router[_0x68ab('0x11')](_0x68ab('0xb'),auth[_0x68ab('0xc')](),controller['destroy']);router[_0x68ab('0x11')]('/:id/sounds/:id2',auth[_0x68ab('0xc')](),controller[_0x68ab('0x12')]);module['exports']=router; \ No newline at end of file +var _0x97d8=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','addSound','update','delete','/:id','destroy','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x253b37,_0xdb7ae0){var _0x24b147=function(_0x38c58d){while(--_0x38c58d){_0x253b37['push'](_0x253b37['shift']());}};_0x24b147(++_0xdb7ae0);}(_0x97d8,0x1dc));var _0x897d=function(_0x108f82,_0x38c340){_0x108f82=_0x108f82-0x0;var _0x2c9f88=_0x97d8[_0x108f82];return _0x2c9f88;};'use strict';var multer=require(_0x897d('0x0'));var util=require(_0x897d('0x1'));var path=require('path');var timeout=require(_0x897d('0x2'));var express=require(_0x897d('0x3'));var router=express['Router']();var fs_extra=require(_0x897d('0x4'));var auth=require(_0x897d('0x5'));var interaction=require(_0x897d('0x6'));var config=require(_0x897d('0x7'));var controller=require(_0x897d('0x8'));router[_0x897d('0x9')]('/',auth[_0x897d('0xa')](),controller[_0x897d('0xb')]);router[_0x897d('0x9')]('/:id',auth[_0x897d('0xa')](),controller[_0x897d('0xc')]);router[_0x897d('0x9')](_0x897d('0xd'),auth[_0x897d('0xa')](),controller[_0x897d('0xe')]);router[_0x897d('0xf')]('/',auth[_0x897d('0xa')](),controller['create']);router[_0x897d('0xf')](_0x897d('0xd'),auth[_0x897d('0xa')](),controller[_0x897d('0x10')]);router['put']('/:id',auth[_0x897d('0xa')](),controller[_0x897d('0x11')]);router[_0x897d('0x12')](_0x897d('0x13'),auth[_0x897d('0xa')](),controller[_0x897d('0x14')]);router[_0x897d('0x12')](_0x897d('0x15'),auth[_0x897d('0xa')](),controller['removeSound']);module[_0x897d('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 579da21..57ce87c 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 _0x5a88=['name','ENUM','custom','files','quietmp3nb','mp3','STRING','TIMESTAMP','BOOLEAN','sequelize','exports'];(function(_0xf7eaae,_0x2ed4c6){var _0x29683e=function(_0x3431b4){while(--_0x3431b4){_0xf7eaae['push'](_0xf7eaae['shift']());}};_0x29683e(++_0x2ed4c6);}(_0x5a88,0x153));var _0x85a8=function(_0x5b14e4,_0x8a1255){_0x5b14e4=_0x5b14e4-0x0;var _0x584855=_0x5a88[_0x5b14e4];return _0x584855;};'use strict';var Sequelize=require(_0x85a8('0x0'));module[_0x85a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x85a8('0x2')},'mode':{'type':Sequelize[_0x85a8('0x3')](_0x85a8('0x4'),_0x85a8('0x5'),'mp3nb',_0x85a8('0x6'),'quietmp3',_0x85a8('0x7')),'allowNull':!![],'defaultValue':_0x85a8('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x85a8('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x85a8('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x85a8('0x8')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x85a8('0x8')],'allowNull':!![]},'stamp':{'type':_0x85a8('0x9')},'defaultEntry':{'type':Sequelize[_0x85a8('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x47c1=['exports','name','custom','files','mp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x478b89,_0x184edc){var _0x4a9193=function(_0x2f3c21){while(--_0x2f3c21){_0x478b89['push'](_0x478b89['shift']());}};_0x4a9193(++_0x184edc);}(_0x47c1,0x14f));var _0x147c=function(_0x4d4f61,_0x56d7a7){_0x4d4f61=_0x4d4f61-0x0;var _0x297414=_0x47c1[_0x4d4f61];return _0x297414;};'use strict';var Sequelize=require(_0x147c('0x0'));module[_0x147c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x147c('0x2')},'mode':{'type':Sequelize['ENUM'](_0x147c('0x3'),_0x147c('0x4'),_0x147c('0x5'),'quietmp3nb',_0x147c('0x6'),_0x147c('0x7')),'allowNull':!![],'defaultValue':_0x147c('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x147c('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x147c('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x147c('0x8')],'allowNull':!![],'defaultValue':_0x147c('0x9')},'format':{'type':Sequelize[_0x147c('0x8')],'allowNull':!![]},'stamp':{'type':_0x147c('0xa')},'defaultEntry':{'type':Sequelize[_0x147c('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 18f81b8..4036e52 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 _0x66df=['name','index','map','VoiceMusicOnHold','rawAttributes','key','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','model','find','body','transaction','mode','join','root','server/files/moh','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','directory','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','converted_format','symlinkSync','Sequelize','removeSound','id2','getSounds','filters','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','end','error'];(function(_0x367dd8,_0xd8ff8){var _0x54b23f=function(_0xcbdfc3){while(--_0xcbdfc3){_0x367dd8['push'](_0x367dd8['shift']());}};_0x54b23f(++_0xd8ff8);}(_0x66df,0x19a));var _0xf66d=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x66df[_0x1aba25];return _0x47d997;};'use strict';var emlformat=require(_0xf66d('0x0'));var rimraf=require(_0xf66d('0x1'));var zipdir=require(_0xf66d('0x2'));var jsonpatch=require(_0xf66d('0x3'));var rp=require(_0xf66d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf66d('0x5'));var path=require('path');var sox=require(_0xf66d('0x6'));var csv=require(_0xf66d('0x7'));var ejs=require(_0xf66d('0x8'));var fs=require('fs');var fs_extra=require(_0xf66d('0x9'));var _=require(_0xf66d('0xa'));var squel=require(_0xf66d('0xb'));var crypto=require(_0xf66d('0xc'));var jsforce=require(_0xf66d('0xd'));var deskjs=require(_0xf66d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf66d('0xf'));var Papa=require(_0xf66d('0x10'));var Redis=require(_0xf66d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf66d('0x12'));var as=require(_0xf66d('0x13'));var hardwareService=require(_0xf66d('0x14'));var logger=require(_0xf66d('0x15'))(_0xf66d('0x16'));var utils=require(_0xf66d('0x17'));var config=require(_0xf66d('0x18'));var licenseUtil=require(_0xf66d('0x19'));var db=require(_0xf66d('0x1a'))['db'];function respondWithStatusCode(_0x38a082,_0x1560eb){_0x1560eb=_0x1560eb||0xcc;return function(_0x5ddaeb){if(_0x5ddaeb){return _0x38a082[_0xf66d('0x1b')](_0x1560eb);}return _0x38a082[_0xf66d('0x1c')](_0x1560eb)['end']();};}function respondWithResult(_0x5bf1e4,_0x164602){_0x164602=_0x164602||0xc8;return function(_0x4fadb4){if(_0x4fadb4){return _0x5bf1e4[_0xf66d('0x1c')](_0x164602)[_0xf66d('0x1d')](_0x4fadb4);}};}function respondWithFilteredResult(_0xe8849d,_0x40125d){return function(_0x107d3e){if(_0x107d3e){var _0x4261fb=typeof _0x40125d['offset']===_0xf66d('0x1e')&&typeof _0x40125d[_0xf66d('0x1f')]===_0xf66d('0x1e');var _0x14dbfa=_0x107d3e[_0xf66d('0x20')];var _0x5cbf8c=_0x4261fb?0x0:_0x40125d['offset'];var _0x2bccee=_0x4261fb?_0x107d3e[_0xf66d('0x20')]:_0x40125d[_0xf66d('0x21')]+_0x40125d[_0xf66d('0x1f')];var _0x52162b;if(_0x2bccee>=_0x14dbfa){_0x2bccee=_0x14dbfa;_0x52162b=0xc8;}else{_0x52162b=0xce;}_0xe8849d[_0xf66d('0x1c')](_0x52162b);return _0xe8849d[_0xf66d('0x22')](_0xf66d('0x23'),_0x5cbf8c+'-'+_0x2bccee+'/'+_0x14dbfa)['json'](_0x107d3e);}return null;};}function patchUpdates(_0x497d41){return function(_0x532b35){try{jsonpatch[_0xf66d('0x24')](_0x532b35,_0x497d41,!![]);}catch(_0x18fd53){return BPromise[_0xf66d('0x25')](_0x18fd53);}return _0x532b35[_0xf66d('0x26')]();};}function saveUpdates(_0x4cf261,_0x21803c){return function(_0x188be8){if(_0x188be8){return _0x188be8[_0xf66d('0x27')](_0x4cf261)[_0xf66d('0x28')](function(_0x30e0ee){return _0x30e0ee;});}return null;};}function removeEntity(_0x4fd41a,_0x435449){return function(_0x3fc722){if(_0x3fc722){return _0x3fc722[_0xf66d('0x29')]()['then'](function(){var _0x175585=_0x3fc722['get']({'plain':!![]});var _0x47bf22=_0xf66d('0x2a');return db[_0xf66d('0x2b')][_0xf66d('0x29')]({'where':{'type':_0x47bf22,'resourceId':_0x175585['id']}})[_0xf66d('0x28')](function(){return _0x3fc722;});})['then'](function(){_0x4fd41a[_0xf66d('0x1c')](0xcc)[_0xf66d('0x2c')]();});}};}function handleEntityNotFound(_0x4ec4e3,_0x1eaa06){return function(_0x19b30a){if(!_0x19b30a){_0x4ec4e3[_0xf66d('0x1b')](0x194);}return _0x19b30a;};}function handleError(_0x50e8e9,_0x21b16f){_0x21b16f=_0x21b16f||0x1f4;return function(_0x10176c){logger[_0xf66d('0x2d')](_0x10176c['stack']);if(_0x10176c[_0xf66d('0x2e')]){delete _0x10176c[_0xf66d('0x2e')];}_0x50e8e9[_0xf66d('0x1c')](_0x21b16f)['send'](_0x10176c);};}exports[_0xf66d('0x2f')]=function(_0x375873,_0x585967){var _0x5e94df={},_0x45a430={},_0x210d10={'count':0x0,'rows':[]};var _0x53f07d=_[_0xf66d('0x30')](db[_0xf66d('0x31')][_0xf66d('0x32')],function(_0x3fb20d){return{'name':_0x3fb20d['fieldName'],'type':_0x3fb20d['type'][_0xf66d('0x33')]};});_0x45a430['model']=_[_0xf66d('0x30')](_0x53f07d,_0xf66d('0x2e'));_0x45a430[_0xf66d('0x34')]=_['keys'](_0x375873[_0xf66d('0x34')]);_0x45a430['filters']=_['intersection'](_0x45a430['model'],_0x45a430[_0xf66d('0x34')]);_0x5e94df[_0xf66d('0x35')]=_[_0xf66d('0x36')](_0x45a430['model'],qs['fields'](_0x375873[_0xf66d('0x34')][_0xf66d('0x37')]));_0x5e94df[_0xf66d('0x35')]=_0x5e94df[_0xf66d('0x35')][_0xf66d('0x38')]?_0x5e94df[_0xf66d('0x35')]:_0x45a430['model'];if(!_0x375873[_0xf66d('0x34')]['hasOwnProperty'](_0xf66d('0x39'))){_0x5e94df['limit']=qs[_0xf66d('0x1f')](_0x375873['query'][_0xf66d('0x1f')]);_0x5e94df[_0xf66d('0x21')]=qs[_0xf66d('0x21')](_0x375873[_0xf66d('0x34')][_0xf66d('0x21')]);}_0x5e94df[_0xf66d('0x3a')]=qs[_0xf66d('0x3b')](_0x375873[_0xf66d('0x34')][_0xf66d('0x3b')]);delete _0x375873[_0xf66d('0x34')][_0xf66d('0x3b')];_0x5e94df[_0xf66d('0x3c')]=qs['filters'](_[_0xf66d('0x3d')](_0x375873[_0xf66d('0x34')],_0x45a430['filters']),_0x53f07d);if(_0x375873['query']['filter']){_0x5e94df[_0xf66d('0x3c')]=_['merge'](_0x5e94df[_0xf66d('0x3c')],{'$or':_['map'](_0x53f07d,function(_0x445ef2){if(_0x445ef2['type']!=='VIRTUAL'){var _0x100f47={};_0x100f47[_0x445ef2['name']]={'$like':'%'+_0x375873['query'][_0xf66d('0x3e')]+'%'};return _0x100f47;}})});}_0x5e94df=_[_0xf66d('0x3f')]({},_0x5e94df,_0x375873[_0xf66d('0x40')]);var _0x236ae0={'where':_0x5e94df[_0xf66d('0x3c')]};return db['VoiceMusicOnHold']['count'](_0x236ae0)['then'](function(_0x99794e){_0x210d10[_0xf66d('0x20')]=_0x99794e;if(_0x375873[_0xf66d('0x34')][_0xf66d('0x41')]){_0x5e94df[_0xf66d('0x42')]=[{'all':!![]}];}return db[_0xf66d('0x31')][_0xf66d('0x43')](_0x5e94df);})['then'](function(_0x2c070c){_0x210d10[_0xf66d('0x44')]=_0x2c070c;return _0x210d10;})[_0xf66d('0x28')](respondWithFilteredResult(_0x585967,_0x5e94df))[_0xf66d('0x45')](handleError(_0x585967,null));};exports[_0xf66d('0x46')]=function(_0x22717a,_0x40733b){var _0x589b28={'raw':![],'where':{'id':_0x22717a[_0xf66d('0x47')]['id']}},_0x4911b9={};_0x4911b9['model']=_['keys'](db[_0xf66d('0x31')]['rawAttributes']);_0x4911b9['query']=_[_0xf66d('0x48')](_0x22717a['query']);_0x4911b9['filters']=_[_0xf66d('0x36')](_0x4911b9[_0xf66d('0x49')],_0x4911b9[_0xf66d('0x34')]);_0x589b28['attributes']=_['intersection'](_0x4911b9[_0xf66d('0x49')],qs[_0xf66d('0x37')](_0x22717a[_0xf66d('0x34')]['fields']));_0x589b28[_0xf66d('0x35')]=_0x589b28[_0xf66d('0x35')]['length']?_0x589b28[_0xf66d('0x35')]:_0x4911b9['model'];if(_0x22717a[_0xf66d('0x34')][_0xf66d('0x41')]){_0x589b28[_0xf66d('0x42')]=[{'all':!![]}];}_0x589b28=_[_0xf66d('0x3f')]({},_0x589b28,_0x22717a[_0xf66d('0x40')]);return db[_0xf66d('0x31')][_0xf66d('0x4a')](_0x589b28)[_0xf66d('0x28')](handleEntityNotFound(_0x40733b,null))[_0xf66d('0x28')](respondWithResult(_0x40733b,null))[_0xf66d('0x45')](handleError(_0x40733b,null));};exports['update']=function(_0x2a8e58,_0x5b182c){if(_0x2a8e58[_0xf66d('0x4b')]['id']){delete _0x2a8e58['body']['id'];}return db[_0xf66d('0x31')][_0xf66d('0x4a')]({'where':{'id':_0x2a8e58[_0xf66d('0x47')]['id']}})[_0xf66d('0x28')](handleEntityNotFound(_0x5b182c,null))[_0xf66d('0x28')](saveUpdates(_0x2a8e58[_0xf66d('0x4b')],null))[_0xf66d('0x28')](respondWithResult(_0x5b182c,null))[_0xf66d('0x45')](handleError(_0x5b182c,null));};exports['create']=function(_0x4401a7,_0x7ead02,_0x4a7fc6){return db['sequelize'][_0xf66d('0x4c')](function(_0x103239){if(_0x4401a7[_0xf66d('0x4b')][_0xf66d('0x4d')]==='files'){_0x4401a7[_0xf66d('0x4b')]['directory']=path[_0xf66d('0x4e')](config[_0xf66d('0x4f')],_0xf66d('0x50'),_0x4401a7[_0xf66d('0x4b')][_0xf66d('0x2e')]);}return db[_0xf66d('0x31')][_0xf66d('0x51')](_0x4401a7[_0xf66d('0x4b')],{'transaction':_0x103239})[_0xf66d('0x28')](function(_0x1c7d2f){if(_0x4401a7[_0xf66d('0x4b')][_0xf66d('0x4d')]==='files'){fs['mkdirSync'](_0x1c7d2f['directory'],parseInt('0777',0x8));}var _0x2b1547=_0x4401a7['user'][_0xf66d('0x52')]({'plain':!![]});if(!_0x2b1547)throw new Error(_0xf66d('0x53'));if(_0x2b1547[_0xf66d('0x54')]===_0xf66d('0x55')){var _0x53e3f9=_0x1c7d2f[_0xf66d('0x52')]({'plain':!![]});return db[_0xf66d('0x56')]['find']({'where':{'name':_0xf66d('0x2a'),'userProfileId':_0x2b1547['userProfileId']},'raw':!![]})[_0xf66d('0x28')](function(_0x34738a){if(_0x34738a&&_0x34738a[_0xf66d('0x57')]===0x0){return db[_0xf66d('0x2b')][_0xf66d('0x51')]({'name':_0x53e3f9[_0xf66d('0x2e')],'resourceId':_0x53e3f9['id'],'type':_0x34738a[_0xf66d('0x2e')],'sectionId':_0x34738a['id']},{})[_0xf66d('0x28')](function(){return _0x1c7d2f;});}else{return _0x1c7d2f;}})[_0xf66d('0x45')](function(_0x3d2a0a){logger[_0xf66d('0x2d')](_0xf66d('0x58'),_0x3d2a0a);});}return _0x1c7d2f;});})['then'](respondWithResult(_0x7ead02,0xc9))[_0xf66d('0x45')](handleError(_0x7ead02,null));};exports['destroy']=function(_0x52c4e5,_0x21618d,_0x54ccae){var _0x2aa740;return db[_0xf66d('0x31')][_0xf66d('0x4a')]({'where':{'id':_0x52c4e5[_0xf66d('0x47')]['id']}})[_0xf66d('0x28')](function(_0x4ce8ea){if(_0x4ce8ea){return db[_0xf66d('0x59')][_0xf66d('0x4c')](function(_0x54eb6d){return _0x4ce8ea['destroy']({'transaction':_0x54eb6d,'raw':!![]})['then'](function(_0x504f3c){if(_0x504f3c['directory']){fs[_0xf66d('0x5a')](_0x504f3c[_0xf66d('0x5b')])[_0xf66d('0x5c')](function(_0x5d595a){fs[_0xf66d('0x5d')](path[_0xf66d('0x4e')](_0x504f3c[_0xf66d('0x5b')],_0x5d595a));});fs[_0xf66d('0x5e')](_0x504f3c[_0xf66d('0x5b')]);}return _0x504f3c;});})['catch'](function(_0x4cf1fc){throw new db['Sequelize'][(_0xf66d('0x5f'))](_0x4cf1fc[_0xf66d('0x60')]);});}})[_0xf66d('0x28')](handleEntityNotFound(_0x21618d,null))[_0xf66d('0x28')](removeEntity(_0x21618d,null))[_0xf66d('0x45')](handleError(_0x21618d,null));};exports['addSound']=function(_0x322989,_0x422b8a,_0x2fb913){return db[_0xf66d('0x59')][_0xf66d('0x4c')](function(_0x4be033){var _0x4d5ce1;return db[_0xf66d('0x31')][_0xf66d('0x4a')]({'where':{'id':_0x322989['params']['id']}})[_0xf66d('0x28')](function(_0x2bdc89){if(_0x2bdc89){_0x4d5ce1=_0x2bdc89;return _0x2bdc89[_0xf66d('0x61')](_0x322989['body']['id'],{'transaction':_0x4be033});}})[_0xf66d('0x28')](function(_0x37ac44){if(_0x37ac44){return db[_0xf66d('0x62')][_0xf66d('0x63')]({'where':{'id':_0x322989[_0xf66d('0x4b')]['id']},'attributes':['id',_0xf66d('0x2e'),_0xf66d('0x64'),'converted_format',_0xf66d('0x65')],'raw':!![]});}})[_0xf66d('0x28')](function(_0x1201b7){if(_0x1201b7){var _0x4b1197=path[_0xf66d('0x4e')](config[_0xf66d('0x4f')],_0xf66d('0x66'),util[_0xf66d('0x67')]('%s.%s',path[_0xf66d('0x68')](_0x1201b7['save_name'],path[_0xf66d('0x69')](_0x1201b7['save_name'])),_0x1201b7['converted_format']));var _0x35668b=path[_0xf66d('0x4e')](config[_0xf66d('0x4f')],_0xf66d('0x50'),_0x4d5ce1['name'],util[_0xf66d('0x67')](_0xf66d('0x6a'),_0x1201b7['name'],_0x1201b7[_0xf66d('0x6b')]));fs[_0xf66d('0x6c')](_0x4b1197,_0x35668b);return _0x1201b7;}})['catch'](function(_0x72c4ff){throw new db[(_0xf66d('0x6d'))]['ValidationError'](_0x72c4ff[_0xf66d('0x60')]);});})['then'](handleEntityNotFound(_0x422b8a,null))[_0xf66d('0x28')](respondWithResult(_0x422b8a,0xc9))[_0xf66d('0x45')](handleError(_0x422b8a,null));};exports[_0xf66d('0x6e')]=function(_0x4cfaa9,_0x331309,_0x2c90f8){return db[_0xf66d('0x59')][_0xf66d('0x4c')](function(_0x4756fa){var _0x18f8b6;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x4cfaa9[_0xf66d('0x47')]['id']}})[_0xf66d('0x28')](handleEntityNotFound(_0x331309,null))['then'](function(_0x395947){if(_0x395947){_0x18f8b6=_0x395947;return _0x395947[_0xf66d('0x6e')](_0x4cfaa9[_0xf66d('0x47')][_0xf66d('0x6f')]);}})['then'](function(_0x1136d9){if(_0x1136d9){return db[_0xf66d('0x62')][_0xf66d('0x63')]({'where':{'id':_0x4cfaa9['params']['id2']},'attributes':['id','name',_0xf66d('0x64'),_0xf66d('0x6b'),_0xf66d('0x65')],'raw':!![]});}})[_0xf66d('0x28')](function(_0x28c7da){if(_0x28c7da){fs[_0xf66d('0x5d')](path['join'](_0x18f8b6[_0xf66d('0x5b')],util[_0xf66d('0x67')](_0xf66d('0x6a'),_0x28c7da[_0xf66d('0x2e')],_0x28c7da['converted_format'])));return _0x28c7da;}})[_0xf66d('0x45')](function(_0x1c0838){throw new db['Sequelize']['ValidationError'](_0x1c0838[_0xf66d('0x60')]);});})[_0xf66d('0x28')](handleEntityNotFound(_0x331309,null))[_0xf66d('0x28')](respondWithStatusCode(_0x331309,0xcc))[_0xf66d('0x45')](handleError(_0x331309,null));};exports[_0xf66d('0x70')]=function(_0x293692,_0x9fd86b,_0x4242cb){var _0x37936b={};var _0x32d0b2={};var _0x846f6c;var _0x3f76c4;return db[_0xf66d('0x31')][_0xf66d('0x63')]({'where':{'id':_0x293692['params']['id']}})[_0xf66d('0x28')](handleEntityNotFound(_0x9fd86b,null))[_0xf66d('0x28')](function(_0x36fb47){if(_0x36fb47){_0x846f6c=_0x36fb47;_0x32d0b2['model']=_[_0xf66d('0x48')](db['Sound'][_0xf66d('0x32')]);_0x32d0b2[_0xf66d('0x34')]=_[_0xf66d('0x48')](_0x293692['query']);_0x32d0b2['filters']=_[_0xf66d('0x36')](_0x32d0b2[_0xf66d('0x49')],_0x32d0b2[_0xf66d('0x34')]);_0x37936b[_0xf66d('0x35')]=_['intersection'](_0x32d0b2[_0xf66d('0x49')],qs[_0xf66d('0x37')](_0x293692[_0xf66d('0x34')]['fields']));_0x37936b['attributes']=_0x37936b['attributes'][_0xf66d('0x38')]?_0x37936b[_0xf66d('0x35')]:_0x32d0b2[_0xf66d('0x49')];_0x37936b['order']=qs[_0xf66d('0x3b')](_0x293692[_0xf66d('0x34')][_0xf66d('0x3b')]);_0x37936b[_0xf66d('0x3c')]=qs[_0xf66d('0x71')](_[_0xf66d('0x3d')](_0x293692[_0xf66d('0x34')],_0x32d0b2[_0xf66d('0x71')]));if(_0x293692[_0xf66d('0x34')][_0xf66d('0x3e')]){_0x37936b[_0xf66d('0x3c')]=_['merge'](_0x37936b[_0xf66d('0x3c')],{'$or':_[_0xf66d('0x30')](_0x37936b[_0xf66d('0x35')],function(_0x575585){var _0x419d75={};_0x419d75[_0x575585]={'$like':'%'+_0x293692['query'][_0xf66d('0x3e')]+'%'};return _0x419d75;})});}_0x37936b=_['merge']({},_0x37936b,_0x293692[_0xf66d('0x40')]);return _0x846f6c[_0xf66d('0x70')](_0x37936b);}})['then'](function(_0xebb87){if(_0xebb87){_0x3f76c4=_0xebb87[_0xf66d('0x38')];if(!_0x293692[_0xf66d('0x34')]['hasOwnProperty'](_0xf66d('0x39'))){_0x37936b[_0xf66d('0x1f')]=qs[_0xf66d('0x1f')](_0x293692[_0xf66d('0x34')]['limit']);_0x37936b[_0xf66d('0x21')]=qs['offset'](_0x293692['query'][_0xf66d('0x21')]);}return _0x846f6c[_0xf66d('0x70')](_0x37936b);}})[_0xf66d('0x28')](function(_0xeec090){if(_0xeec090){return _0xeec090?{'count':_0x3f76c4,'rows':_0xeec090}:null;}})[_0xf66d('0x28')](respondWithResult(_0x9fd86b,null))[_0xf66d('0x45')](handleError(_0x9fd86b,null));}; \ No newline at end of file +var _0x356a=['UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','merge','find','body','sequelize','transaction','directory','join','create','mode','files','mkdirSync','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','format','basename','extname','root','server/files/moh','removeSound','findOne','id2','getSounds','order','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','save','update','then','destroy','get','MusicOnHolds'];(function(_0x34233f,_0x533ddb){var _0x4a4b1f=function(_0x49f6ad){while(--_0x49f6ad){_0x34233f['push'](_0x34233f['shift']());}};_0x4a4b1f(++_0x533ddb);}(_0x356a,0x11e));var _0xa356=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x356a[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa356('0x0'));var zipdir=require(_0xa356('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa356('0x2'));var moment=require(_0xa356('0x3'));var BPromise=require(_0xa356('0x4'));var Mustache=require(_0xa356('0x5'));var util=require(_0xa356('0x6'));var path=require(_0xa356('0x7'));var sox=require(_0xa356('0x8'));var csv=require(_0xa356('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa356('0xa'));var _=require(_0xa356('0xb'));var squel=require('squel');var crypto=require(_0xa356('0xc'));var jsforce=require(_0xa356('0xd'));var deskjs=require(_0xa356('0xe'));var toCsv=require(_0xa356('0x9'));var querystring=require(_0xa356('0xf'));var Papa=require(_0xa356('0x10'));var Redis=require(_0xa356('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa356('0x12'));var as=require(_0xa356('0x13'));var hardwareService=require(_0xa356('0x14'));var logger=require(_0xa356('0x15'))(_0xa356('0x16'));var utils=require('../../config/utils');var config=require(_0xa356('0x17'));var licenseUtil=require(_0xa356('0x18'));var db=require(_0xa356('0x19'))['db'];function respondWithStatusCode(_0x17c500,_0x48a0a2){_0x48a0a2=_0x48a0a2||0xcc;return function(_0x584707){if(_0x584707){return _0x17c500[_0xa356('0x1a')](_0x48a0a2);}return _0x17c500[_0xa356('0x1b')](_0x48a0a2)[_0xa356('0x1c')]();};}function respondWithResult(_0x479003,_0x1416cf){_0x1416cf=_0x1416cf||0xc8;return function(_0x1daa6d){if(_0x1daa6d){return _0x479003[_0xa356('0x1b')](_0x1416cf)['json'](_0x1daa6d);}};}function respondWithFilteredResult(_0x3a6107,_0x256d8f){return function(_0x184ccd){if(_0x184ccd){var _0x1131c1=typeof _0x256d8f[_0xa356('0x1d')]==='undefined'&&typeof _0x256d8f[_0xa356('0x1e')]===_0xa356('0x1f');var _0x5c42c3=_0x184ccd['count'];var _0x4c43f8=_0x1131c1?0x0:_0x256d8f[_0xa356('0x1d')];var _0x17c4b3=_0x1131c1?_0x184ccd[_0xa356('0x20')]:_0x256d8f[_0xa356('0x1d')]+_0x256d8f[_0xa356('0x1e')];var _0x161269;if(_0x17c4b3>=_0x5c42c3){_0x17c4b3=_0x5c42c3;_0x161269=0xc8;}else{_0x161269=0xce;}_0x3a6107[_0xa356('0x1b')](_0x161269);return _0x3a6107[_0xa356('0x21')]('Content-Range',_0x4c43f8+'-'+_0x17c4b3+'/'+_0x5c42c3)[_0xa356('0x22')](_0x184ccd);}return null;};}function patchUpdates(_0x3b2983){return function(_0x14190f){try{jsonpatch['apply'](_0x14190f,_0x3b2983,!![]);}catch(_0x1c90ef){return BPromise['reject'](_0x1c90ef);}return _0x14190f[_0xa356('0x23')]();};}function saveUpdates(_0x379ba7,_0x46a1a1){return function(_0x5066f0){if(_0x5066f0){return _0x5066f0[_0xa356('0x24')](_0x379ba7)[_0xa356('0x25')](function(_0x226955){return _0x226955;});}return null;};}function removeEntity(_0x5e263e,_0x1d7925){return function(_0x55c32b){if(_0x55c32b){return _0x55c32b[_0xa356('0x26')]()['then'](function(){var _0x381355=_0x55c32b[_0xa356('0x27')]({'plain':!![]});var _0xedee26=_0xa356('0x28');return db[_0xa356('0x29')][_0xa356('0x26')]({'where':{'type':_0xedee26,'resourceId':_0x381355['id']}})[_0xa356('0x25')](function(){return _0x55c32b;});})[_0xa356('0x25')](function(){_0x5e263e['status'](0xcc)[_0xa356('0x1c')]();});}};}function handleEntityNotFound(_0x271496,_0x598a5c){return function(_0x3cdbdf){if(!_0x3cdbdf){_0x271496[_0xa356('0x1a')](0x194);}return _0x3cdbdf;};}function handleError(_0x455b8e,_0x8bdcaf){_0x8bdcaf=_0x8bdcaf||0x1f4;return function(_0x207af8){logger[_0xa356('0x2a')](_0x207af8[_0xa356('0x2b')]);if(_0x207af8[_0xa356('0x2c')]){delete _0x207af8[_0xa356('0x2c')];}_0x455b8e['status'](_0x8bdcaf)['send'](_0x207af8);};}exports[_0xa356('0x2d')]=function(_0x47e374,_0x25ca27){var _0x1e08f3={},_0x5890eb={},_0xe1f7fe={'count':0x0,'rows':[]};var _0xaad642=_[_0xa356('0x2e')](db[_0xa356('0x2f')][_0xa356('0x30')],function(_0x431635){return{'name':_0x431635[_0xa356('0x31')],'type':_0x431635['type'][_0xa356('0x32')]};});_0x5890eb['model']=_[_0xa356('0x2e')](_0xaad642,_0xa356('0x2c'));_0x5890eb[_0xa356('0x33')]=_[_0xa356('0x34')](_0x47e374[_0xa356('0x33')]);_0x5890eb[_0xa356('0x35')]=_[_0xa356('0x36')](_0x5890eb['model'],_0x5890eb[_0xa356('0x33')]);_0x1e08f3[_0xa356('0x37')]=_[_0xa356('0x36')](_0x5890eb[_0xa356('0x38')],qs[_0xa356('0x39')](_0x47e374[_0xa356('0x33')][_0xa356('0x39')]));_0x1e08f3[_0xa356('0x37')]=_0x1e08f3[_0xa356('0x37')][_0xa356('0x3a')]?_0x1e08f3[_0xa356('0x37')]:_0x5890eb[_0xa356('0x38')];if(!_0x47e374[_0xa356('0x33')][_0xa356('0x3b')](_0xa356('0x3c'))){_0x1e08f3[_0xa356('0x1e')]=qs[_0xa356('0x1e')](_0x47e374[_0xa356('0x33')][_0xa356('0x1e')]);_0x1e08f3[_0xa356('0x1d')]=qs[_0xa356('0x1d')](_0x47e374[_0xa356('0x33')][_0xa356('0x1d')]);}_0x1e08f3['order']=qs['sort'](_0x47e374['query'][_0xa356('0x3d')]);delete _0x47e374[_0xa356('0x33')][_0xa356('0x3d')];_0x1e08f3[_0xa356('0x3e')]=qs['filters'](_[_0xa356('0x3f')](_0x47e374[_0xa356('0x33')],_0x5890eb[_0xa356('0x35')]),_0xaad642);if(_0x47e374['query'][_0xa356('0x40')]){_0x1e08f3['where']=_['merge'](_0x1e08f3[_0xa356('0x3e')],{'$or':_[_0xa356('0x2e')](_0xaad642,function(_0x8ff40d){if(_0x8ff40d['type']!==_0xa356('0x41')){var _0x57b1c2={};_0x57b1c2[_0x8ff40d[_0xa356('0x2c')]]={'$like':'%'+_0x47e374[_0xa356('0x33')][_0xa356('0x40')]+'%'};return _0x57b1c2;}})});}_0x1e08f3=_['merge']({},_0x1e08f3,_0x47e374[_0xa356('0x42')]);var _0x1a998d={'where':_0x1e08f3[_0xa356('0x3e')]};return db['VoiceMusicOnHold']['count'](_0x1a998d)[_0xa356('0x25')](function(_0xfdcf0b){_0xe1f7fe['count']=_0xfdcf0b;if(_0x47e374[_0xa356('0x33')][_0xa356('0x43')]){_0x1e08f3[_0xa356('0x44')]=[{'all':!![]}];}return db[_0xa356('0x2f')][_0xa356('0x45')](_0x1e08f3);})[_0xa356('0x25')](function(_0x33912c){_0xe1f7fe[_0xa356('0x46')]=_0x33912c;return _0xe1f7fe;})[_0xa356('0x25')](respondWithFilteredResult(_0x25ca27,_0x1e08f3))[_0xa356('0x47')](handleError(_0x25ca27,null));};exports['show']=function(_0x5c3138,_0x3da70e){var _0x59fc71={'raw':![],'where':{'id':_0x5c3138[_0xa356('0x48')]['id']}},_0x594563={};_0x594563[_0xa356('0x38')]=_[_0xa356('0x34')](db[_0xa356('0x2f')][_0xa356('0x30')]);_0x594563[_0xa356('0x33')]=_[_0xa356('0x34')](_0x5c3138[_0xa356('0x33')]);_0x594563[_0xa356('0x35')]=_['intersection'](_0x594563[_0xa356('0x38')],_0x594563[_0xa356('0x33')]);_0x59fc71[_0xa356('0x37')]=_[_0xa356('0x36')](_0x594563[_0xa356('0x38')],qs[_0xa356('0x39')](_0x5c3138['query'][_0xa356('0x39')]));_0x59fc71[_0xa356('0x37')]=_0x59fc71[_0xa356('0x37')][_0xa356('0x3a')]?_0x59fc71[_0xa356('0x37')]:_0x594563[_0xa356('0x38')];if(_0x5c3138[_0xa356('0x33')][_0xa356('0x43')]){_0x59fc71[_0xa356('0x44')]=[{'all':!![]}];}_0x59fc71=_[_0xa356('0x49')]({},_0x59fc71,_0x5c3138[_0xa356('0x42')]);return db[_0xa356('0x2f')][_0xa356('0x4a')](_0x59fc71)[_0xa356('0x25')](handleEntityNotFound(_0x3da70e,null))[_0xa356('0x25')](respondWithResult(_0x3da70e,null))[_0xa356('0x47')](handleError(_0x3da70e,null));};exports['update']=function(_0x563f29,_0x3ef736){if(_0x563f29[_0xa356('0x4b')]['id']){delete _0x563f29[_0xa356('0x4b')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x563f29[_0xa356('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ef736,null))[_0xa356('0x25')](saveUpdates(_0x563f29[_0xa356('0x4b')],null))[_0xa356('0x25')](respondWithResult(_0x3ef736,null))['catch'](handleError(_0x3ef736,null));};exports['create']=function(_0x50193e,_0xb644ad,_0x2d8497){return db[_0xa356('0x4c')][_0xa356('0x4d')](function(_0x440ca4){if(_0x50193e[_0xa356('0x4b')]['mode']==='files'){_0x50193e[_0xa356('0x4b')][_0xa356('0x4e')]=path[_0xa356('0x4f')](config['root'],'server/files/moh',_0x50193e['body']['name']);}return db[_0xa356('0x2f')][_0xa356('0x50')](_0x50193e[_0xa356('0x4b')],{'transaction':_0x440ca4})[_0xa356('0x25')](function(_0x59ba68){if(_0x50193e[_0xa356('0x4b')][_0xa356('0x51')]===_0xa356('0x52')){fs[_0xa356('0x53')](_0x59ba68['directory'],parseInt('0777',0x8));}var _0xd3aadb=_0x50193e[_0xa356('0x54')][_0xa356('0x27')]({'plain':!![]});if(!_0xd3aadb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd3aadb['role']===_0xa356('0x54')){var _0x4fad35=_0x59ba68['get']({'plain':!![]});return db[_0xa356('0x55')][_0xa356('0x4a')]({'where':{'name':_0xa356('0x28'),'userProfileId':_0xd3aadb[_0xa356('0x56')]},'raw':!![]})[_0xa356('0x25')](function(_0xb3460e){if(_0xb3460e&&_0xb3460e['autoAssociation']===0x0){return db[_0xa356('0x29')][_0xa356('0x50')]({'name':_0x4fad35[_0xa356('0x2c')],'resourceId':_0x4fad35['id'],'type':_0xb3460e[_0xa356('0x2c')],'sectionId':_0xb3460e['id']},{})[_0xa356('0x25')](function(){return _0x59ba68;});}else{return _0x59ba68;}})['catch'](function(_0x48502b){logger[_0xa356('0x2a')](_0xa356('0x57'),_0x48502b);});}return _0x59ba68;});})['then'](respondWithResult(_0xb644ad,0xc9))[_0xa356('0x47')](handleError(_0xb644ad,null));};exports[_0xa356('0x26')]=function(_0xa1182b,_0x3b4185,_0x4d5c1d){var _0x59249e;return db[_0xa356('0x2f')][_0xa356('0x4a')]({'where':{'id':_0xa1182b[_0xa356('0x48')]['id']}})[_0xa356('0x25')](function(_0x5e8c3c){if(_0x5e8c3c){return db[_0xa356('0x4c')][_0xa356('0x4d')](function(_0x1afc53){return _0x5e8c3c[_0xa356('0x26')]({'transaction':_0x1afc53,'raw':!![]})[_0xa356('0x25')](function(_0x45107a){if(_0x45107a['directory']){fs['readdirSync'](_0x45107a['directory'])[_0xa356('0x58')](function(_0x317330){fs[_0xa356('0x59')](path[_0xa356('0x4f')](_0x45107a['directory'],_0x317330));});fs[_0xa356('0x5a')](_0x45107a[_0xa356('0x4e')]);}return _0x45107a;});})['catch'](function(_0x412d9a){throw new db[(_0xa356('0x5b'))][(_0xa356('0x5c'))](_0x412d9a[_0xa356('0x5d')]);});}})[_0xa356('0x25')](handleEntityNotFound(_0x3b4185,null))[_0xa356('0x25')](removeEntity(_0x3b4185,null))[_0xa356('0x47')](handleError(_0x3b4185,null));};exports['addSound']=function(_0x3ec03e,_0x2b6524,_0x104c36){return db[_0xa356('0x4c')]['transaction'](function(_0x42634a){var _0x57c2f2;return db[_0xa356('0x2f')][_0xa356('0x4a')]({'where':{'id':_0x3ec03e[_0xa356('0x48')]['id']}})[_0xa356('0x25')](function(_0x4c62bf){if(_0x4c62bf){_0x57c2f2=_0x4c62bf;return _0x4c62bf[_0xa356('0x5e')](_0x3ec03e[_0xa356('0x4b')]['id'],{'transaction':_0x42634a});}})[_0xa356('0x25')](function(_0x58f814){if(_0x58f814){return db[_0xa356('0x5f')]['findOne']({'where':{'id':_0x3ec03e['body']['id']},'attributes':['id','name',_0xa356('0x60'),_0xa356('0x61'),_0xa356('0x62')],'raw':!![]});}})[_0xa356('0x25')](function(_0x2387cf){if(_0x2387cf){var _0xb1a4f5=path['join'](config['root'],'server/files/sounds/converted',util[_0xa356('0x63')]('%s.%s',path[_0xa356('0x64')](_0x2387cf[_0xa356('0x60')],path[_0xa356('0x65')](_0x2387cf[_0xa356('0x60')])),_0x2387cf[_0xa356('0x61')]));var _0x5750cd=path[_0xa356('0x4f')](config[_0xa356('0x66')],_0xa356('0x67'),_0x57c2f2['name'],util[_0xa356('0x63')]('%s.%s',_0x2387cf[_0xa356('0x2c')],_0x2387cf[_0xa356('0x61')]));fs['symlinkSync'](_0xb1a4f5,_0x5750cd);return _0x2387cf;}})[_0xa356('0x47')](function(_0x17c930){throw new db[(_0xa356('0x5b'))][(_0xa356('0x5c'))](_0x17c930[_0xa356('0x5d')]);});})['then'](handleEntityNotFound(_0x2b6524,null))[_0xa356('0x25')](respondWithResult(_0x2b6524,0xc9))['catch'](handleError(_0x2b6524,null));};exports[_0xa356('0x68')]=function(_0x3c5cee,_0x2aa6b0,_0x5a48c3){return db[_0xa356('0x4c')][_0xa356('0x4d')](function(_0x292584){var _0x1a5914;return db[_0xa356('0x2f')][_0xa356('0x69')]({'where':{'id':_0x3c5cee[_0xa356('0x48')]['id']}})[_0xa356('0x25')](handleEntityNotFound(_0x2aa6b0,null))['then'](function(_0x31d068){if(_0x31d068){_0x1a5914=_0x31d068;return _0x31d068[_0xa356('0x68')](_0x3c5cee['params'][_0xa356('0x6a')]);}})[_0xa356('0x25')](function(_0x5d9b85){if(_0x5d9b85){return db[_0xa356('0x5f')][_0xa356('0x69')]({'where':{'id':_0x3c5cee[_0xa356('0x48')][_0xa356('0x6a')]},'attributes':['id',_0xa356('0x2c'),_0xa356('0x60'),_0xa356('0x61'),_0xa356('0x62')],'raw':!![]});}})['then'](function(_0x3ba8d9){if(_0x3ba8d9){fs['unlinkSync'](path[_0xa356('0x4f')](_0x1a5914[_0xa356('0x4e')],util['format']('%s.%s',_0x3ba8d9[_0xa356('0x2c')],_0x3ba8d9[_0xa356('0x61')])));return _0x3ba8d9;}})[_0xa356('0x47')](function(_0x52f895){throw new db[(_0xa356('0x5b'))]['ValidationError'](_0x52f895[_0xa356('0x5d')]);});})[_0xa356('0x25')](handleEntityNotFound(_0x2aa6b0,null))[_0xa356('0x25')](respondWithStatusCode(_0x2aa6b0,0xcc))['catch'](handleError(_0x2aa6b0,null));};exports[_0xa356('0x6b')]=function(_0xd1fc12,_0x318665,_0x3bf06e){var _0x5cb360={};var _0x2b8400={};var _0x5b8a4c;var _0xa7b263;return db[_0xa356('0x2f')][_0xa356('0x69')]({'where':{'id':_0xd1fc12[_0xa356('0x48')]['id']}})['then'](handleEntityNotFound(_0x318665,null))[_0xa356('0x25')](function(_0x41e81f){if(_0x41e81f){_0x5b8a4c=_0x41e81f;_0x2b8400[_0xa356('0x38')]=_[_0xa356('0x34')](db[_0xa356('0x5f')]['rawAttributes']);_0x2b8400[_0xa356('0x33')]=_[_0xa356('0x34')](_0xd1fc12[_0xa356('0x33')]);_0x2b8400[_0xa356('0x35')]=_[_0xa356('0x36')](_0x2b8400[_0xa356('0x38')],_0x2b8400[_0xa356('0x33')]);_0x5cb360[_0xa356('0x37')]=_[_0xa356('0x36')](_0x2b8400[_0xa356('0x38')],qs[_0xa356('0x39')](_0xd1fc12[_0xa356('0x33')][_0xa356('0x39')]));_0x5cb360[_0xa356('0x37')]=_0x5cb360[_0xa356('0x37')][_0xa356('0x3a')]?_0x5cb360[_0xa356('0x37')]:_0x2b8400['model'];_0x5cb360[_0xa356('0x6c')]=qs['sort'](_0xd1fc12[_0xa356('0x33')][_0xa356('0x3d')]);_0x5cb360[_0xa356('0x3e')]=qs[_0xa356('0x35')](_['pick'](_0xd1fc12[_0xa356('0x33')],_0x2b8400[_0xa356('0x35')]));if(_0xd1fc12['query'][_0xa356('0x40')]){_0x5cb360[_0xa356('0x3e')]=_['merge'](_0x5cb360[_0xa356('0x3e')],{'$or':_[_0xa356('0x2e')](_0x5cb360[_0xa356('0x37')],function(_0x48b529){var _0xa4d221={};_0xa4d221[_0x48b529]={'$like':'%'+_0xd1fc12[_0xa356('0x33')][_0xa356('0x40')]+'%'};return _0xa4d221;})});}_0x5cb360=_[_0xa356('0x49')]({},_0x5cb360,_0xd1fc12[_0xa356('0x42')]);return _0x5b8a4c[_0xa356('0x6b')](_0x5cb360);}})[_0xa356('0x25')](function(_0x59a808){if(_0x59a808){_0xa7b263=_0x59a808[_0xa356('0x3a')];if(!_0xd1fc12[_0xa356('0x33')]['hasOwnProperty'](_0xa356('0x3c'))){_0x5cb360['limit']=qs['limit'](_0xd1fc12['query'][_0xa356('0x1e')]);_0x5cb360[_0xa356('0x1d')]=qs['offset'](_0xd1fc12['query'][_0xa356('0x1d')]);}return _0x5b8a4c[_0xa356('0x6b')](_0x5cb360);}})['then'](function(_0x2945f2){if(_0x2945f2){return _0x2945f2?{'count':_0xa7b263,'rows':_0x2945f2}:null;}})[_0xa356('0x25')](respondWithResult(_0x318665,null))[_0xa356('0x47')](handleError(_0x318665,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1c23531..e6d4537 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 _0x594a=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x549720,_0x488410){var _0x3c1a6a=function(_0x372036){while(--_0x372036){_0x549720['push'](_0x549720['shift']());}};_0x3c1a6a(++_0x488410);}(_0x594a,0x1a5));var _0xa594=function(_0x5b43f6,_0x411397){_0x5b43f6=_0x5b43f6-0x0;var _0x4372b9=_0x594a[_0x5b43f6];return _0x4372b9;};'use strict';var _=require('lodash');var util=require(_0xa594('0x0'));var logger=require(_0xa594('0x1'))(_0xa594('0x2'));var moment=require(_0xa594('0x3'));var BPromise=require(_0xa594('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa594('0x5'));var rimraf=require(_0xa594('0x6'));var config=require(_0xa594('0x7'));var attributes=require(_0xa594('0x8'));module[_0xa594('0x9')]=function(_0x5843a1,_0x17c968){return _0x5843a1[_0xa594('0xa')](_0xa594('0xb'),attributes,{'tableName':_0xa594('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99b0=['bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','api','moment'];(function(_0x14c55f,_0x38d253){var _0x56ab8b=function(_0xa4c62e){while(--_0xa4c62e){_0x14c55f['push'](_0x14c55f['shift']());}};_0x56ab8b(++_0x38d253);}(_0x99b0,0x1d0));var _0x099b=function(_0x260e4b,_0x54668d){_0x260e4b=_0x260e4b-0x0;var _0x18dfba=_0x99b0[_0x260e4b];return _0x18dfba;};'use strict';var _=require(_0x099b('0x0'));var util=require(_0x099b('0x1'));var logger=require('../../config/logger')(_0x099b('0x2'));var moment=require(_0x099b('0x3'));var BPromise=require(_0x099b('0x4'));var rp=require(_0x099b('0x5'));var fs=require('fs');var path=require(_0x099b('0x6'));var rimraf=require('rimraf');var config=require(_0x099b('0x7'));var attributes=require(_0x099b('0x8'));module[_0x099b('0x9')]=function(_0x48f3cd,_0x211c0d){return _0x48f3cd[_0x099b('0xa')](_0x099b('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 816c657..5133c1c 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x557799,_0x38c8c5){var _0x3e550a=function(_0x22e033){while(--_0x22e033){_0x557799['push'](_0x557799['shift']());}};_0x3e550a(++_0x38c8c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 _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(_0x4239b1,_0x509382){var _0x46bf7c=function(_0x12e400){while(--_0x12e400){_0x4239b1['push'](_0x4239b1['shift']());}};_0x46bf7c(++_0x509382);}(_0xe706,0xa3));var _0x6e70=function(_0x380fa9,_0x5123eb){_0x380fa9=_0x380fa9-0x0;var _0x4f2532=_0xe706[_0x380fa9];return _0x4f2532;};'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 ec5ea1c..4dc4c08 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 _0x7edb=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./voicePrefix.controller'];(function(_0x561def,_0x40e0e2){var _0x44d233=function(_0x2fe034){while(--_0x2fe034){_0x561def['push'](_0x561def['shift']());}};_0x44d233(++_0x40e0e2);}(_0x7edb,0x158));var _0xb7ed=function(_0x2715d8,_0x1e4b9d){_0x2715d8=_0x2715d8-0x0;var _0x5e2401=_0x7edb[_0x2715d8];return _0x5e2401;};'use strict';var multer=require('multer');var util=require(_0xb7ed('0x0'));var path=require(_0xb7ed('0x1'));var timeout=require(_0xb7ed('0x2'));var express=require(_0xb7ed('0x3'));var router=express[_0xb7ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7ed('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb7ed('0x6'));router[_0xb7ed('0x7')]('/',auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x9')]);router[_0xb7ed('0x7')](_0xb7ed('0xa'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xb')]);router[_0xb7ed('0x7')](_0xb7ed('0xc'),auth['isAuthenticated'](),controller[_0xb7ed('0xd')]);router[_0xb7ed('0x7')](_0xb7ed('0xe'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0xf')]);router[_0xb7ed('0x7')](_0xb7ed('0x10'),auth['isAuthenticated'](),controller[_0xb7ed('0x11')]);router[_0xb7ed('0x12')]('/',auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x13')]);router[_0xb7ed('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0xb7ed('0x14')]);router['post'](_0xb7ed('0x10'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x15')]);router[_0xb7ed('0x16')](_0xb7ed('0xc'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x17')]);router[_0xb7ed('0x18')](_0xb7ed('0xc'),auth[_0xb7ed('0x8')](),controller[_0xb7ed('0x19')]);router[_0xb7ed('0x18')]('/:id/users',auth[_0xb7ed('0x8')](),controller['removeAgents']);router[_0xb7ed('0x18')](_0xb7ed('0x10'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xb7ed('0x1a')]=router; \ No newline at end of file +var _0xa348=['update','delete','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put'];(function(_0x2a0189,_0x5277d6){var _0x57b03c=function(_0x4e4474){while(--_0x4e4474){_0x2a0189['push'](_0x2a0189['shift']());}};_0x57b03c(++_0x5277d6);}(_0xa348,0xb2));var _0x8a34=function(_0x534774,_0x1efcd8){_0x534774=_0x534774-0x0;var _0xe582ad=_0xa348[_0x534774];return _0xe582ad;};'use strict';var multer=require(_0x8a34('0x0'));var util=require('util');var path=require(_0x8a34('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a34('0x2'));var auth=require(_0x8a34('0x3'));var interaction=require(_0x8a34('0x4'));var config=require(_0x8a34('0x5'));var controller=require(_0x8a34('0x6'));router[_0x8a34('0x7')]('/',auth[_0x8a34('0x8')](),controller[_0x8a34('0x9')]);router[_0x8a34('0x7')](_0x8a34('0xa'),auth['isAuthenticated'](),controller[_0x8a34('0xb')]);router[_0x8a34('0x7')](_0x8a34('0xc'),auth[_0x8a34('0x8')](),controller['show']);router[_0x8a34('0x7')](_0x8a34('0xd'),auth['isAuthenticated'](),controller[_0x8a34('0xe')]);router[_0x8a34('0x7')](_0x8a34('0xf'),auth[_0x8a34('0x8')](),controller[_0x8a34('0x10')]);router[_0x8a34('0x11')]('/',auth[_0x8a34('0x8')](),controller[_0x8a34('0x12')]);router['post']('/:id/users',auth[_0x8a34('0x8')](),controller[_0x8a34('0x13')]);router['post'](_0x8a34('0xf'),auth[_0x8a34('0x8')](),controller[_0x8a34('0x14')]);router[_0x8a34('0x15')](_0x8a34('0xc'),auth[_0x8a34('0x8')](),controller[_0x8a34('0x16')]);router[_0x8a34('0x17')](_0x8a34('0xc'),auth[_0x8a34('0x8')](),controller['destroy']);router[_0x8a34('0x17')](_0x8a34('0xd'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x8a34('0x17')](_0x8a34('0xf'),auth[_0x8a34('0x8')](),controller['removeTeams']);module[_0x8a34('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a5bbf6f..c573ec4 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 _0xc4b1=['VIRTUAL','system-','getDataValue','STRING','sequelize','name'];(function(_0x47eee6,_0x2ac644){var _0x50048f=function(_0x42e9f5){while(--_0x42e9f5){_0x47eee6['push'](_0x47eee6['shift']());}};_0x50048f(++_0x2ac644);}(_0xc4b1,0xb2));var _0x1c4b=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xc4b1[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x1c4b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1c4b('0x1')},'prefix':{'type':Sequelize[_0x1c4b('0x2')],'get':function(_0x5ea960){return _0x1c4b('0x3')+this[_0x1c4b('0x4')](_0x1c4b('0x1'))+'-';}},'description':{'type':Sequelize[_0x1c4b('0x5')]},'callerIdAll':{'type':Sequelize[_0x1c4b('0x5')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x098f=['STRING','INTEGER','sequelize','exports','name','system-'];(function(_0x5cf5d8,_0x202d0a){var _0x4305a2=function(_0x2495b3){while(--_0x2495b3){_0x5cf5d8['push'](_0x5cf5d8['shift']());}};_0x4305a2(++_0x202d0a);}(_0x098f,0xc2));var _0xf098=function(_0x1277c7,_0x3b3d62){_0x1277c7=_0x1277c7-0x0;var _0x4e5258=_0x098f[_0x1277c7];return _0x4e5258;};'use strict';var Sequelize=require(_0xf098('0x0'));module[_0xf098('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf098('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x13a2c0){return _0xf098('0x3')+this['getDataValue'](_0xf098('0x2'))+'-';}},'description':{'type':Sequelize[_0xf098('0x4')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xf098('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 57c5f0b..ff5f3fc 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 _0x5f66=['map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoicePrefix','count','includeAll','include','findAll','rows','catch','find','destroy','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','goto','charAt','system-','findById','params','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','getAgents','hasOwnProperty','getTeams','Team','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','from','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','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','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','update','get','VoicePrefixes','UserProfileResource','then','error','stack','send'];(function(_0x244e2d,_0x302d40){var _0x3df084=function(_0x4bfc1f){while(--_0x4bfc1f){_0x244e2d['push'](_0x244e2d['shift']());}};_0x3df084(++_0x302d40);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'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'];config[_0x65f6('0x14')]=_['defaults'](config[_0x65f6('0x14')],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x14')]));require(_0x65f6('0x17'))[_0x65f6('0x18')](socket);function respondWithStatusCode(_0x44144b,_0xb1d40a){_0xb1d40a=_0xb1d40a||0xcc;return function(_0x46dbc6){if(_0x46dbc6){return _0x44144b[_0x65f6('0x19')](_0xb1d40a);}return _0x44144b['status'](_0xb1d40a)[_0x65f6('0x1a')]();};}function respondWithResult(_0x49a913,_0x5dd324){_0x5dd324=_0x5dd324||0xc8;return function(_0x1693e6){if(_0x1693e6){return _0x49a913[_0x65f6('0x1b')](_0x5dd324)[_0x65f6('0x1c')](_0x1693e6);}};}function respondWithFilteredResult(_0x1c955c,_0x1b1cbb){return function(_0x1f974c){if(_0x1f974c){var _0xc8660c=typeof _0x1b1cbb[_0x65f6('0x1d')]==='undefined'&&typeof _0x1b1cbb['limit']===_0x65f6('0x1e');var _0x5b4055=_0x1f974c['count'];var _0x5c5b91=_0xc8660c?0x0:_0x1b1cbb[_0x65f6('0x1d')];var _0x21ea88=_0xc8660c?_0x1f974c['count']:_0x1b1cbb[_0x65f6('0x1d')]+_0x1b1cbb[_0x65f6('0x1f')];var _0xbee6a4;if(_0x21ea88>=_0x5b4055){_0x21ea88=_0x5b4055;_0xbee6a4=0xc8;}else{_0xbee6a4=0xce;}_0x1c955c[_0x65f6('0x1b')](_0xbee6a4);return _0x1c955c[_0x65f6('0x20')](_0x65f6('0x21'),_0x5c5b91+'-'+_0x21ea88+'/'+_0x5b4055)['json'](_0x1f974c);}return null;};}function patchUpdates(_0x197a49){return function(_0x4bb39e){try{jsonpatch['apply'](_0x4bb39e,_0x197a49,!![]);}catch(_0x212247){return BPromise[_0x65f6('0x22')](_0x212247);}return _0x4bb39e['save']();};}function saveUpdates(_0x1eeaaa,_0x471a33){return function(_0x2317ce){if(_0x2317ce){return _0x2317ce[_0x65f6('0x23')](_0x1eeaaa)['then'](function(_0x9d7bb0){return _0x9d7bb0;});}return null;};}function removeEntity(_0x59ea32,_0x20a161){return function(_0x5963e0){if(_0x5963e0){return _0x5963e0['destroy']()['then'](function(){var _0x29abdb=_0x5963e0[_0x65f6('0x24')]({'plain':!![]});var _0x4b2292=_0x65f6('0x25');return db[_0x65f6('0x26')]['destroy']({'where':{'type':_0x4b2292,'resourceId':_0x29abdb['id']}})[_0x65f6('0x27')](function(){return _0x5963e0;});})[_0x65f6('0x27')](function(){_0x59ea32[_0x65f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac04b,_0x488d36){return function(_0x266cfe){if(!_0x266cfe){_0x4ac04b[_0x65f6('0x19')](0x194);}return _0x266cfe;};}function handleError(_0x4344b3,_0x408ccc){_0x408ccc=_0x408ccc||0x1f4;return function(_0x518cac){logger[_0x65f6('0x28')](_0x518cac[_0x65f6('0x29')]);if(_0x518cac['name']){delete _0x518cac['name'];}_0x4344b3[_0x65f6('0x1b')](_0x408ccc)[_0x65f6('0x2a')](_0x518cac);};}exports['index']=function(_0x4e50c0,_0x10b368){var _0x1ce43c={},_0x11fe3b={},_0xc53cb7={'count':0x0,'rows':[]};var _0x1217fd=_[_0x65f6('0x2b')](db['VoicePrefix'][_0x65f6('0x2c')],function(_0x38f3c6){return{'name':_0x38f3c6[_0x65f6('0x2d')],'type':_0x38f3c6['type'][_0x65f6('0x2e')]};});_0x11fe3b[_0x65f6('0x2f')]=_[_0x65f6('0x2b')](_0x1217fd,_0x65f6('0x30'));_0x11fe3b[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4e50c0['query']);_0x11fe3b[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x11fe3b['model'],_0x11fe3b[_0x65f6('0x31')]);_0x1ce43c['attributes']=_[_0x65f6('0x34')](_0x11fe3b['model'],qs[_0x65f6('0x35')](_0x4e50c0[_0x65f6('0x31')]['fields']));_0x1ce43c[_0x65f6('0x36')]=_0x1ce43c[_0x65f6('0x36')][_0x65f6('0x37')]?_0x1ce43c['attributes']:_0x11fe3b['model'];if(!_0x4e50c0[_0x65f6('0x31')]['hasOwnProperty'](_0x65f6('0x38'))){_0x1ce43c['limit']=qs[_0x65f6('0x1f')](_0x4e50c0[_0x65f6('0x31')]['limit']);_0x1ce43c[_0x65f6('0x1d')]=qs['offset'](_0x4e50c0['query'][_0x65f6('0x1d')]);}_0x1ce43c[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3a')]);_0x1ce43c[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4e50c0['query'],_0x11fe3b[_0x65f6('0x33')]),_0x1217fd);if(_0x4e50c0['query'][_0x65f6('0x3d')]){_0x1ce43c[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x1ce43c[_0x65f6('0x3b')],{'$or':_['map'](_0x1217fd,function(_0x32148f){if(_0x32148f[_0x65f6('0x3f')]!==_0x65f6('0x40')){var _0x3fb1c6={};_0x3fb1c6[_0x32148f[_0x65f6('0x30')]]={'$like':'%'+_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x3fb1c6;}})});}_0x1ce43c=_[_0x65f6('0x3e')]({},_0x1ce43c,_0x4e50c0[_0x65f6('0x41')]);var _0x5d8e48={'where':_0x1ce43c[_0x65f6('0x3b')]};return db[_0x65f6('0x42')][_0x65f6('0x43')](_0x5d8e48)[_0x65f6('0x27')](function(_0x83e2d9){_0xc53cb7[_0x65f6('0x43')]=_0x83e2d9;if(_0x4e50c0[_0x65f6('0x31')][_0x65f6('0x44')]){_0x1ce43c[_0x65f6('0x45')]=[{'all':!![]}];}return db[_0x65f6('0x42')][_0x65f6('0x46')](_0x1ce43c);})[_0x65f6('0x27')](function(_0x6c4d94){_0xc53cb7[_0x65f6('0x47')]=_0x6c4d94;return _0xc53cb7;})[_0x65f6('0x27')](respondWithFilteredResult(_0x10b368,_0x1ce43c))[_0x65f6('0x48')](handleError(_0x10b368,null));};exports['show']=function(_0x2dd16c,_0x37cd36){var _0x2d8c45={'raw':![],'where':{'id':_0x2dd16c['params']['id']}},_0x3828c9={};_0x3828c9[_0x65f6('0x2f')]=_[_0x65f6('0x32')](db[_0x65f6('0x42')]['rawAttributes']);_0x3828c9[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x2dd16c[_0x65f6('0x31')]);_0x3828c9[_0x65f6('0x33')]=_['intersection'](_0x3828c9[_0x65f6('0x2f')],_0x3828c9['query']);_0x2d8c45[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x3828c9['model'],qs[_0x65f6('0x35')](_0x2dd16c['query'][_0x65f6('0x35')]));_0x2d8c45[_0x65f6('0x36')]=_0x2d8c45[_0x65f6('0x36')][_0x65f6('0x37')]?_0x2d8c45[_0x65f6('0x36')]:_0x3828c9[_0x65f6('0x2f')];if(_0x2dd16c['query']['includeAll']){_0x2d8c45[_0x65f6('0x45')]=[{'all':!![]}];}_0x2d8c45=_[_0x65f6('0x3e')]({},_0x2d8c45,_0x2dd16c[_0x65f6('0x41')]);return db[_0x65f6('0x42')][_0x65f6('0x49')](_0x2d8c45)[_0x65f6('0x27')](handleEntityNotFound(_0x37cd36,null))[_0x65f6('0x27')](respondWithResult(_0x37cd36,null))[_0x65f6('0x48')](handleError(_0x37cd36,null));};exports[_0x65f6('0x4a')]=function(_0x517a47,_0x1f16cf){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x517a47['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x1f16cf,null))[_0x65f6('0x27')](removeEntity(_0x1f16cf,null))['catch'](handleError(_0x1f16cf,null));};exports[_0x65f6('0x4b')]=function(_0x253d52,_0x57eb04){return db[_0x65f6('0x42')]['describe']()[_0x65f6('0x27')](respondWithResult(_0x57eb04,null))[_0x65f6('0x48')](handleError(_0x57eb04,null));};exports[_0x65f6('0x4c')]=function(_0x4b9f0a,_0x1646c5){var _0x43a52e;return db['sequelize'][_0x65f6('0x4d')](function(_0x34312c){return db['VoicePrefix'][_0x65f6('0x4c')](_0x4b9f0a[_0x65f6('0x4e')],{'transaction':_0x34312c})[_0x65f6('0x27')](function(_0x25d504){_0x43a52e=_0x25d504[_0x65f6('0x24')]({'plain':!![]});return db[_0x65f6('0x4f')][_0x65f6('0x49')]({'where':{'id':_0x43a52e[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x52c5a4){return createVoicePrefixExtensions(_0x43a52e,_0x52c5a4,_0x34312c);});});})['then'](function(){var _0x19f40c=_0x4b9f0a[_0x65f6('0x51')][_0x65f6('0x24')]({'plain':!![]});if(!_0x19f40c)throw new Error(_0x65f6('0x52'));if(_0x19f40c['role']===_0x65f6('0x51')){var _0x2032b9=_0x43a52e;return db[_0x65f6('0x53')]['find']({'where':{'name':_0x65f6('0x25'),'userProfileId':_0x19f40c[_0x65f6('0x54')]},'raw':!![]})[_0x65f6('0x27')](function(_0x4e289e){if(_0x4e289e&&_0x4e289e['autoAssociation']===0x0){return db[_0x65f6('0x26')][_0x65f6('0x4c')]({'name':_0x2032b9[_0x65f6('0x30')],'resourceId':_0x2032b9['id'],'type':_0x4e289e[_0x65f6('0x30')],'sectionId':_0x4e289e['id']},{})[_0x65f6('0x27')](function(){return _0x43a52e;});}else{return _0x43a52e;}})[_0x65f6('0x48')](function(_0x35d77f){logger[_0x65f6('0x28')](_0x65f6('0x55'),_0x35d77f);throw _0x35d77f;});}return _0x43a52e;})[_0x65f6('0x27')](respondWithResult(_0x1646c5,null))[_0x65f6('0x48')](handleError(_0x1646c5,null));};function Extension(_0x141fcc,_0x30adee,_0x3e3143,_0x5ba9c6){this[_0x65f6('0x56')]=_0x65f6('0x57');this[_0x65f6('0x58')]=_0x141fcc;this['app']=_0x3e3143;this[_0x65f6('0x3f')]=_0x65f6('0x59');this[_0x65f6('0x5a')]=_0x65f6('0x5b');this['priority']=_0x30adee;this[_0x65f6('0x5c')]=_0x5ba9c6;}function createVoicePrefixExtensions(_0x4227f5,_0xe5fc65,_0x3e0d8b){return new BPromise(function(_0x553ff0,_0x2923ff){var _0x2fc20f=new Extension(formatPrefixName(_0x4227f5['prefix']),0x1,_0x65f6('0x5d'),_0x65f6('0x5e'));_0x2fc20f[_0x65f6('0x5f')]=_0x4227f5['id'];return db['VoiceExtension'][_0x65f6('0x4c')](_0x2fc20f,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0x3974ef){var _0x3c23e3=_0x3974ef[_0x65f6('0x24')]({'plain':!![]});var _0x334fa1=_['map'](addVoicePrefixExtensions(_0x4227f5,_0xe5fc65),function(_0x4ee8bd){_0x4ee8bd['VoiceExtensionId']=_0x3c23e3['id'];_0x4ee8bd[_0x65f6('0x5f')]=_0x4227f5['id'];return _0x4ee8bd;});return db[_0x65f6('0x4f')][_0x65f6('0x60')](_0x334fa1,{'transaction':_0x3e0d8b})[_0x65f6('0x27')](function(_0xab6f0){if(!_0xab6f0){return _0x2923ff(_0x65f6('0x61'));}else{return _0x553ff0(_0xab6f0);}})['catch'](function(_0xfbfebc){return _0x2923ff(_0xfbfebc);});});;});};function addVoicePrefixExtensions(_0x1d1532,_0x54b569){var _0x225aeb=[];var _0x39c244=formatPrefixName(_0x1d1532[_0x65f6('0x62')]);_0x225aeb['push'](new Extension(_0x39c244,0x2,_0x65f6('0x63'),_0x65f6('0x64')+_0x1d1532['name']));if(_0x1d1532[_0x65f6('0x65')]){_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x63'),_0x65f6('0x67')+_0x1d1532[_0x65f6('0x65')]));}else{_0x225aeb[_0x65f6('0x66')](new Extension(_0x39c244,0x3,_0x65f6('0x5d'),'No\x20callerid\x20available'));}_0x225aeb['push'](new Extension(_0x39c244,0x4,_0x65f6('0x68'),_0x54b569[_0x65f6('0x56')]+','+'${EXTEN:'+(0x8+_0x1d1532[_0x65f6('0x30')]['length'])+'}'+','+0x1));return _0x225aeb;}function formatPrefixName(_0x3a483b){var _0x4e0450='_';for(var _0x440df1=0x0;_0x440df1<_0x3a483b[_0x65f6('0x37')];_0x440df1++){if(_0x3a483b[_0x65f6('0x69')](_0x440df1)=='-'){_0x4e0450+=_0x3a483b[_0x65f6('0x69')](_0x440df1);}else{_0x4e0450+='['+_0x3a483b[_0x65f6('0x69')](_0x440df1)+']';}}_0x4e0450+='.';return _0x4e0450;}exports[_0x65f6('0x23')]=function(_0x1aaf75,_0x1cc66a,_0x2405a7){var _0x4b7ecd=_0x1aaf75['body'];_0x4b7ecd[_0x65f6('0x62')]=_0x65f6('0x6a')+_0x4b7ecd[_0x65f6('0x30')]+'-';return db['sequelize']['transaction'](function(_0x2dbec2){return db[_0x65f6('0x42')][_0x65f6('0x23')](_0x4b7ecd,{'where':{'id':_0x4b7ecd['id']},'transaction':_0x2dbec2})[_0x65f6('0x27')](function(){return db[_0x65f6('0x4f')][_0x65f6('0x4a')]({'where':{'VoicePrefixId':_0x4b7ecd['id']},'transaction':_0x2dbec2})['then'](function(){return db['VoiceExtension'][_0x65f6('0x49')]({'where':{'id':_0x4b7ecd[_0x65f6('0x50')]},'raw':!![]})['then'](function(_0x219bf8){return createVoicePrefixExtensions(_0x4b7ecd,_0x219bf8,_0x2dbec2);});});});})['then'](function(){return db[_0x65f6('0x42')][_0x65f6('0x6b')](_0x4b7ecd['id']);})[_0x65f6('0x27')](respondWithResult(_0x1cc66a,null))[_0x65f6('0x48')](handleError(_0x1cc66a,null));};exports['addAgents']=function(_0x34ab7b,_0x351d43,_0x11411c){return db['VoicePrefix']['find']({'where':{'id':_0x34ab7b[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0x351d43,null))[_0x65f6('0x27')](function(_0xf6de){if(_0xf6de){return _0xf6de[_0x65f6('0x6d')](_0x34ab7b[_0x65f6('0x4e')]['ids'],_['omit'](_0x34ab7b['body'],[_0x65f6('0x6e'),'id'])||{})[_0x65f6('0x6f')](function(_0x161fb2){for(var _0x57464e=0x0;_0x57464e<_0x34ab7b[_0x65f6('0x4e')][_0x65f6('0x6e')][_0x65f6('0x37')];_0x57464e+=0x1){socket['emit'](_0x65f6('0x70'),{'UserId':Number(_0x34ab7b[_0x65f6('0x4e')]['ids'][_0x57464e]),'VoicePrefixId':Number(_0x34ab7b[_0x65f6('0x6c')]['id'])});}return _0x161fb2;});}})[_0x65f6('0x27')](respondWithResult(_0x351d43,null))['catch'](handleError(_0x351d43,null));};exports[_0x65f6('0x71')]=function(_0x5ef825,_0xe8449b,_0x55ea91){return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x5ef825['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0xe8449b,null))[_0x65f6('0x27')](function(_0x2a700b){if(_0x2a700b){return _0x2a700b[_0x65f6('0x71')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])[_0x65f6('0x27')](function(){if(_[_0x65f6('0x72')](_0x5ef825[_0x65f6('0x31')][_0x65f6('0x6e')])){for(var _0x288eb0=0x0;_0x288eb0<_0x5ef825['query'][_0x65f6('0x6e')][_0x65f6('0x37')];_0x288eb0+=0x1){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')][_0x288eb0]),'VoicePrefixId':Number(_0x5ef825[_0x65f6('0x6c')]['id'])});}}else{socket['emit'](_0x65f6('0x74'),{'UserId':Number(_0x5ef825['query'][_0x65f6('0x6e')]),'VoicePrefixId':Number(_0x5ef825['params']['id'])});}});}})[_0x65f6('0x27')](respondWithStatusCode(_0xe8449b,null))[_0x65f6('0x48')](handleError(_0xe8449b,null));};exports['getAgents']=function(_0x4946c7,_0xa4a742,_0x413c21){var _0x5158c9={};var _0x2d86c8={};var _0x3b3bd5;var _0x73d359;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x4946c7[_0x65f6('0x6c')]['id']}})['then'](handleEntityNotFound(_0xa4a742,null))[_0x65f6('0x27')](function(_0x504b39){if(_0x504b39){_0x3b3bd5=_0x504b39;_0x2d86c8[_0x65f6('0x2f')]=_['keys'](db['User'][_0x65f6('0x2c')]);_0x2d86c8[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4946c7[_0x65f6('0x31')]);_0x2d86c8[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x2d86c8[_0x65f6('0x2f')],_0x2d86c8[_0x65f6('0x31')]);_0x5158c9['attributes']=_['intersection'](_0x2d86c8[_0x65f6('0x2f')],qs['fields'](_0x4946c7[_0x65f6('0x31')][_0x65f6('0x35')]));_0x5158c9[_0x65f6('0x36')]=_0x5158c9[_0x65f6('0x36')][_0x65f6('0x37')]?_0x5158c9['attributes']:_0x2d86c8[_0x65f6('0x2f')];_0x5158c9[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x4946c7['query'][_0x65f6('0x3a')]);_0x5158c9[_0x65f6('0x3b')]=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x4946c7[_0x65f6('0x31')],_0x2d86c8[_0x65f6('0x33')]));if(_0x4946c7['query']['filter']){_0x5158c9[_0x65f6('0x3b')]=_[_0x65f6('0x3e')](_0x5158c9[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0x5158c9['attributes'],function(_0x4bda86){var _0x336076={};_0x336076[_0x4bda86]={'$like':'%'+_0x4946c7[_0x65f6('0x31')][_0x65f6('0x3d')]+'%'};return _0x336076;})});}_0x5158c9=_[_0x65f6('0x3e')]({},_0x5158c9,_0x4946c7[_0x65f6('0x41')]);return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x4d607a){if(_0x4d607a){_0x73d359=_0x4d607a['length'];if(!_0x4946c7[_0x65f6('0x31')][_0x65f6('0x77')](_0x65f6('0x38'))){_0x5158c9[_0x65f6('0x1f')]=qs['limit'](_0x4946c7['query'][_0x65f6('0x1f')]);_0x5158c9[_0x65f6('0x1d')]=qs['offset'](_0x4946c7[_0x65f6('0x31')]['offset']);}return _0x3b3bd5[_0x65f6('0x76')](_0x5158c9);}})['then'](function(_0x3a30ed){if(_0x3a30ed){return _0x3a30ed?{'count':_0x73d359,'rows':_0x3a30ed}:null;}})[_0x65f6('0x27')](respondWithResult(_0xa4a742,null))['catch'](handleError(_0xa4a742,null));};exports[_0x65f6('0x78')]=function(_0x330e18,_0x13c03b,_0x9f6e0c){var _0xec6a56={};var _0x144db0={};var _0x584ea4;var _0x45b3e6;return db['VoicePrefix'][_0x65f6('0x75')]({'where':{'id':_0x330e18['params']['id']}})[_0x65f6('0x27')](handleEntityNotFound(_0x13c03b,null))[_0x65f6('0x27')](function(_0xdf396c){if(_0xdf396c){_0x584ea4=_0xdf396c;_0x144db0[_0x65f6('0x2f')]=_['keys'](db[_0x65f6('0x79')][_0x65f6('0x2c')]);_0x144db0[_0x65f6('0x31')]=_['keys'](_0x330e18['query']);_0x144db0[_0x65f6('0x33')]=_[_0x65f6('0x34')](_0x144db0['model'],_0x144db0[_0x65f6('0x31')]);_0xec6a56[_0x65f6('0x36')]=_[_0x65f6('0x34')](_0x144db0['model'],qs[_0x65f6('0x35')](_0x330e18[_0x65f6('0x31')]['fields']));_0xec6a56[_0x65f6('0x36')]=_0xec6a56[_0x65f6('0x36')][_0x65f6('0x37')]?_0xec6a56['attributes']:_0x144db0[_0x65f6('0x2f')];_0xec6a56[_0x65f6('0x39')]=qs[_0x65f6('0x3a')](_0x330e18['query'][_0x65f6('0x3a')]);_0xec6a56['where']=qs[_0x65f6('0x33')](_[_0x65f6('0x3c')](_0x330e18[_0x65f6('0x31')],_0x144db0[_0x65f6('0x33')]));if(_0x330e18[_0x65f6('0x31')][_0x65f6('0x3d')]){_0xec6a56['where']=_[_0x65f6('0x3e')](_0xec6a56[_0x65f6('0x3b')],{'$or':_[_0x65f6('0x2b')](_0xec6a56[_0x65f6('0x36')],function(_0x207d15){var _0x59407d={};_0x59407d[_0x207d15]={'$like':'%'+_0x330e18['query']['filter']+'%'};return _0x59407d;})});}_0xec6a56=_[_0x65f6('0x3e')]({},_0xec6a56,_0x330e18[_0x65f6('0x41')]);return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})['then'](function(_0x151cee){if(_0x151cee){_0x45b3e6=_0x151cee['length'];if(!_0x330e18['query'][_0x65f6('0x77')](_0x65f6('0x38'))){_0xec6a56['limit']=qs[_0x65f6('0x1f')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1f')]);_0xec6a56[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x330e18[_0x65f6('0x31')][_0x65f6('0x1d')]);}return _0x584ea4[_0x65f6('0x78')](_0xec6a56);}})[_0x65f6('0x27')](function(_0x350641){if(_0x350641){return _0x350641?{'count':_0x45b3e6,'rows':_0x350641}:null;}})[_0x65f6('0x27')](respondWithResult(_0x13c03b,null))[_0x65f6('0x48')](handleError(_0x13c03b,null));};exports['addTeams']=function(_0x349af7,_0x52dc75,_0x55355f){var _0x24d524=_0x349af7[_0x65f6('0x4e')][_0x65f6('0x6e')];var _0x3727f9;return db['Team'][_0x65f6('0x46')]({'where':{'id':_0x24d524},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x65f6('0x30'),_0x65f6('0x7a'),_0x65f6('0x7b'),_0x65f6('0x7c')],'raw':!![]}]})[_0x65f6('0x27')](function(_0xcdfebe){if(_0xcdfebe){_0x3727f9=_0xcdfebe;var _0x5a33cf=_[_0x65f6('0x7d')](_0xcdfebe,function(_0x56bf49){var _0x1ef2a0=_0x56bf49[_0x65f6('0x24')]({'plain':!![]});return _0x1ef2a0[_0x65f6('0x7e')];});return db['VoicePrefix'][_0x65f6('0x49')]({'where':{'id':_0x349af7['params']['id']}})['then'](function(_0x377d5e){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0xf364a9){return _0x377d5e[_0x65f6('0x80')](_0x24d524,{'transaction':_0xf364a9})['then'](function(){return BPromise[_0x65f6('0x81')](_0x3727f9,function(_0x400633){return db[_0x65f6('0x82')][_0x65f6('0x83')]({'TeamId':_0x400633['id'],'VoicePrefixId':_0x349af7['params']['id']},{'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){return BPromise[_0x65f6('0x81')](_0x5a33cf,function(_0x344163){return db[_0x65f6('0x84')][_0x65f6('0x85')]({'where':{'UserId':_0x344163['id'],'VoicePrefixId':_0x349af7[_0x65f6('0x6c')]['id']},'transaction':_0xf364a9});});})[_0x65f6('0x27')](function(){_0x5a33cf[_0x65f6('0x86')](function(_0x558410){socket[_0x65f6('0x73')](_0x65f6('0x70'),{'UserId':_0x558410['id'],'VoicePrefixId':_0x377d5e['id']});});});});});}})[_0x65f6('0x27')](respondWithStatusCode(_0x52dc75,null))[_0x65f6('0x48')](handleError(_0x52dc75,null));};exports[_0x65f6('0x87')]=function(_0x4171a1,_0x57667e,_0x3fd6ee){return db[_0x65f6('0x79')]['findAll']({'where':{'id':_0x4171a1[_0x65f6('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x65f6('0x88')],'as':_0x65f6('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x27')](handleEntityNotFound(_0x57667e,null))[_0x65f6('0x27')](function(_0x2177f1){var _0x55c9bd=_[_0x65f6('0x2b')](_0x2177f1,'id');var _0x395642=[];var _0x2394eb=[];var _0x31870f=squel[_0x65f6('0x89')]();_0x31870f['field']('tq.TeamId')[_0x65f6('0x8a')](_0x65f6('0x8b'),'tq')[_0x65f6('0x8c')](_0x65f6('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoicePrefixId\x20=\x20?',_0x4171a1[_0x65f6('0x6c')]['id']);for(var _0x3b0a97=0x0;_0x3b0a97<_0x2177f1[_0x65f6('0x37')];_0x3b0a97+=0x1){let _0x50e159=_0x2177f1[_0x3b0a97];for(var _0x12730b=0x0;_0x12730b<_0x50e159[_0x65f6('0x7e')][_0x65f6('0x37')];_0x12730b+=0x1){let _0x18c6a8=_0x50e159[_0x65f6('0x7e')][_0x12730b];var _0x54e258=_0x31870f[_0x65f6('0x8e')]();_0x54e258[_0x65f6('0x3b')]('ut.UserId\x20=\x20?',_0x18c6a8['id']);_0x2394eb['push'](db[_0x65f6('0x7f')][_0x65f6('0x31')](_0x54e258[_0x65f6('0x8f')](),{'type':db[_0x65f6('0x7f')][_0x65f6('0x90')]['SELECT']})[_0x65f6('0x27')](function(_0x4b080a){if(_0x4b080a[_0x65f6('0x37')]===0x1){return _0x18c6a8['id'];}else{var _0x5d181a=_[_0x65f6('0x91')](_['map'](_0x4b080a,_0x65f6('0x92')),function(_0x48a9df){return _[_0x65f6('0x93')](_0x55c9bd,_0x48a9df);});if(_0x5d181a){return _0x18c6a8['id'];}}}));}}return BPromise[_0x65f6('0x94')](_0x2394eb)['then'](function(_0x4f2f43){_0x395642=_(_0x395642)[_0x65f6('0x95')](_0x4f2f43)[_0x65f6('0x96')]()[_0x65f6('0x97')]();return db[_0x65f6('0x42')][_0x65f6('0x49')]({'where':{'id':_0x4171a1[_0x65f6('0x6c')]['id']}})[_0x65f6('0x27')](function(_0x1b5957){return db[_0x65f6('0x7f')][_0x65f6('0x4d')](function(_0x4a90e3){return _0x1b5957[_0x65f6('0x87')](_0x4171a1[_0x65f6('0x31')][_0x65f6('0x6e')],{'transaction':_0x4a90e3})[_0x65f6('0x27')](function(){if(!_[_0x65f6('0x98')](_0x395642)){return _0x1b5957[_0x65f6('0x71')](_0x395642,{'transaction':_0x4a90e3});}})['then'](function(){_0x395642[_0x65f6('0x86')](function(_0x91d7bf){socket[_0x65f6('0x73')](_0x65f6('0x74'),{'UserId':_0x91d7bf,'VoicePrefixId':_0x1b5957['id']});});});});});});})[_0x65f6('0x27')](respondWithStatusCode(_0x57667e,null))[_0x65f6('0x48')](handleError(_0x57667e,null));}; \ No newline at end of file +var _0xb9be=['addAgents','emit','userVoicePrefix:save','ids','isArray','userVoicePrefix:remove','getAgents','findOne','order','Team','pick','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x465b0c,_0x569d90){var _0x502ff0=function(_0x221757){while(--_0x221757){_0x465b0c['push'](_0x465b0c['shift']());}};_0x502ff0(++_0x569d90);}(_0xb9be,0xc5));var _0xeb9b=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0xb9be[_0x496738];return _0xee1381;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];config[_0xeb9b('0x19')]=_[_0xeb9b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb9b('0x19')]));require(_0xeb9b('0x1b'))[_0xeb9b('0x1c')](socket);function respondWithStatusCode(_0x4ec46d,_0x5926e1){_0x5926e1=_0x5926e1||0xcc;return function(_0x4f8182){if(_0x4f8182){return _0x4ec46d[_0xeb9b('0x1d')](_0x5926e1);}return _0x4ec46d[_0xeb9b('0x1e')](_0x5926e1)[_0xeb9b('0x1f')]();};}function respondWithResult(_0x3fa308,_0x2c9aa6){_0x2c9aa6=_0x2c9aa6||0xc8;return function(_0x10da6e){if(_0x10da6e){return _0x3fa308[_0xeb9b('0x1e')](_0x2c9aa6)['json'](_0x10da6e);}};}function respondWithFilteredResult(_0x2e8645,_0x36e871){return function(_0x21aca6){if(_0x21aca6){var _0x3a11e3=typeof _0x36e871[_0xeb9b('0x20')]===_0xeb9b('0x21')&&typeof _0x36e871[_0xeb9b('0x22')]===_0xeb9b('0x21');var _0x2c199f=_0x21aca6[_0xeb9b('0x23')];var _0x4f436e=_0x3a11e3?0x0:_0x36e871[_0xeb9b('0x20')];var _0x5a7ffd=_0x3a11e3?_0x21aca6['count']:_0x36e871[_0xeb9b('0x20')]+_0x36e871[_0xeb9b('0x22')];var _0x4ab4b8;if(_0x5a7ffd>=_0x2c199f){_0x5a7ffd=_0x2c199f;_0x4ab4b8=0xc8;}else{_0x4ab4b8=0xce;}_0x2e8645[_0xeb9b('0x1e')](_0x4ab4b8);return _0x2e8645[_0xeb9b('0x24')](_0xeb9b('0x25'),_0x4f436e+'-'+_0x5a7ffd+'/'+_0x2c199f)[_0xeb9b('0x26')](_0x21aca6);}return null;};}function patchUpdates(_0x3c8be7){return function(_0x43dab8){try{jsonpatch[_0xeb9b('0x27')](_0x43dab8,_0x3c8be7,!![]);}catch(_0x15e5b8){return BPromise[_0xeb9b('0x28')](_0x15e5b8);}return _0x43dab8[_0xeb9b('0x29')]();};}function saveUpdates(_0x61c86d,_0x296f95){return function(_0x1a4faf){if(_0x1a4faf){return _0x1a4faf[_0xeb9b('0x2a')](_0x61c86d)[_0xeb9b('0x2b')](function(_0x434461){return _0x434461;});}return null;};}function removeEntity(_0x4c997e,_0xd57390){return function(_0x4ed960){if(_0x4ed960){return _0x4ed960[_0xeb9b('0x2c')]()['then'](function(){var _0x347ec1=_0x4ed960[_0xeb9b('0x2d')]({'plain':!![]});var _0x7e0134=_0xeb9b('0x2e');return db['UserProfileResource'][_0xeb9b('0x2c')]({'where':{'type':_0x7e0134,'resourceId':_0x347ec1['id']}})[_0xeb9b('0x2b')](function(){return _0x4ed960;});})['then'](function(){_0x4c997e[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x1f')]();});}};}function handleEntityNotFound(_0x5ce745,_0x2a4b51){return function(_0x2ea20f){if(!_0x2ea20f){_0x5ce745[_0xeb9b('0x1d')](0x194);}return _0x2ea20f;};}function handleError(_0x48c5f4,_0x309bad){_0x309bad=_0x309bad||0x1f4;return function(_0x5336f2){logger[_0xeb9b('0x2f')](_0x5336f2['stack']);if(_0x5336f2[_0xeb9b('0x30')]){delete _0x5336f2['name'];}_0x48c5f4[_0xeb9b('0x1e')](_0x309bad)['send'](_0x5336f2);};}exports[_0xeb9b('0x31')]=function(_0x4c8e4c,_0x25b8da){var _0x370dbe={},_0x20e577={},_0x2e6034={'count':0x0,'rows':[]};var _0x112129=_[_0xeb9b('0x32')](db[_0xeb9b('0x33')][_0xeb9b('0x34')],function(_0x41e6c4){return{'name':_0x41e6c4[_0xeb9b('0x35')],'type':_0x41e6c4['type'][_0xeb9b('0x36')]};});_0x20e577[_0xeb9b('0x37')]=_[_0xeb9b('0x32')](_0x112129,_0xeb9b('0x30'));_0x20e577[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x4c8e4c[_0xeb9b('0x38')]);_0x20e577['filters']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],_0x20e577[_0xeb9b('0x38')]);_0x370dbe['attributes']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x370dbe[_0xeb9b('0x3c')]=_0x370dbe['attributes'][_0xeb9b('0x3d')]?_0x370dbe[_0xeb9b('0x3c')]:_0x20e577['model'];if(!_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x370dbe[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x370dbe['offset']=qs[_0xeb9b('0x20')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x20')]);}_0x370dbe['order']=qs['sort'](_0x4c8e4c['query'][_0xeb9b('0x40')]);_0x370dbe[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_['pick'](_0x4c8e4c[_0xeb9b('0x38')],_0x20e577[_0xeb9b('0x42')]),_0x112129);if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x370dbe[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x370dbe[_0xeb9b('0x41')],{'$or':_['map'](_0x112129,function(_0x5e597a){if(_0x5e597a[_0xeb9b('0x45')]!==_0xeb9b('0x46')){var _0x4ee3cd={};_0x4ee3cd[_0x5e597a['name']]={'$like':'%'+_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]+'%'};return _0x4ee3cd;}})});}_0x370dbe=_['merge']({},_0x370dbe,_0x4c8e4c[_0xeb9b('0x47')]);var _0x535e73={'where':_0x370dbe[_0xeb9b('0x41')]};return db[_0xeb9b('0x33')][_0xeb9b('0x23')](_0x535e73)[_0xeb9b('0x2b')](function(_0xbee63e){_0x2e6034[_0xeb9b('0x23')]=_0xbee63e;if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x48')]){_0x370dbe[_0xeb9b('0x49')]=[{'all':!![]}];}return db[_0xeb9b('0x33')][_0xeb9b('0x4a')](_0x370dbe);})[_0xeb9b('0x2b')](function(_0x5e270a){_0x2e6034['rows']=_0x5e270a;return _0x2e6034;})[_0xeb9b('0x2b')](respondWithFilteredResult(_0x25b8da,_0x370dbe))['catch'](handleError(_0x25b8da,null));};exports[_0xeb9b('0x4b')]=function(_0x232731,_0x2c00ed){var _0x5eee9b={'raw':![],'where':{'id':_0x232731[_0xeb9b('0x4c')]['id']}},_0x1e2d25={};_0x1e2d25['model']=_[_0xeb9b('0x39')](db[_0xeb9b('0x33')][_0xeb9b('0x34')]);_0x1e2d25[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x232731[_0xeb9b('0x38')]);_0x1e2d25[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x1e2d25['model'],_0x1e2d25['query']);_0x5eee9b[_0xeb9b('0x3c')]=_['intersection'](_0x1e2d25['model'],qs[_0xeb9b('0x3b')](_0x232731[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x5eee9b[_0xeb9b('0x3c')]=_0x5eee9b[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x5eee9b['attributes']:_0x1e2d25['model'];if(_0x232731['query'][_0xeb9b('0x48')]){_0x5eee9b['include']=[{'all':!![]}];}_0x5eee9b=_[_0xeb9b('0x44')]({},_0x5eee9b,_0x232731[_0xeb9b('0x47')]);return db[_0xeb9b('0x33')][_0xeb9b('0x4d')](_0x5eee9b)[_0xeb9b('0x2b')](handleEntityNotFound(_0x2c00ed,null))[_0xeb9b('0x2b')](respondWithResult(_0x2c00ed,null))[_0xeb9b('0x4e')](handleError(_0x2c00ed,null));};exports[_0xeb9b('0x2c')]=function(_0x34755f,_0x28968b){return db['VoicePrefix']['find']({'where':{'id':_0x34755f[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x28968b,null))['then'](removeEntity(_0x28968b,null))[_0xeb9b('0x4e')](handleError(_0x28968b,null));};exports['describe']=function(_0x2ceb23,_0x1f7b31){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x1f7b31,null))[_0xeb9b('0x4e')](handleError(_0x1f7b31,null));};exports[_0xeb9b('0x4f')]=function(_0x263453,_0x4fe9d0){var _0x4ded40;return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3e6e73){return db[_0xeb9b('0x33')][_0xeb9b('0x4f')](_0x263453[_0xeb9b('0x52')],{'transaction':_0x3e6e73})['then'](function(_0x20dbea){_0x4ded40=_0x20dbea[_0xeb9b('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0xeb9b('0x4d')]({'where':{'id':_0x4ded40['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x12f8d6){return createVoicePrefixExtensions(_0x4ded40,_0x12f8d6,_0x3e6e73);});});})['then'](function(){var _0x396aa9=_0x263453['user'][_0xeb9b('0x2d')]({'plain':!![]});if(!_0x396aa9)throw new Error(_0xeb9b('0x53'));if(_0x396aa9[_0xeb9b('0x54')]===_0xeb9b('0x55')){var _0x5c769e=_0x4ded40;return db['UserProfileSection'][_0xeb9b('0x4d')]({'where':{'name':_0xeb9b('0x2e'),'userProfileId':_0x396aa9[_0xeb9b('0x56')]},'raw':!![]})['then'](function(_0x3126d9){if(_0x3126d9&&_0x3126d9[_0xeb9b('0x57')]===0x0){return db[_0xeb9b('0x58')][_0xeb9b('0x4f')]({'name':_0x5c769e[_0xeb9b('0x30')],'resourceId':_0x5c769e['id'],'type':_0x3126d9[_0xeb9b('0x30')],'sectionId':_0x3126d9['id']},{})[_0xeb9b('0x2b')](function(){return _0x4ded40;});}else{return _0x4ded40;}})[_0xeb9b('0x4e')](function(_0x2f8b0f){logger[_0xeb9b('0x2f')](_0xeb9b('0x59'),_0x2f8b0f);throw _0x2f8b0f;});}return _0x4ded40;})['then'](respondWithResult(_0x4fe9d0,null))['catch'](handleError(_0x4fe9d0,null));};function Extension(_0x4b2506,_0x83d48a,_0x4cf8bf,_0x34ff5f){this[_0xeb9b('0x5a')]=_0xeb9b('0x5b');this['exten']=_0x4b2506;this[_0xeb9b('0x5c')]=_0x4cf8bf;this[_0xeb9b('0x45')]=_0xeb9b('0x5d');this[_0xeb9b('0x5e')]=_0xeb9b('0x5f');this[_0xeb9b('0x60')]=_0x83d48a;this[_0xeb9b('0x61')]=_0x34ff5f;}function createVoicePrefixExtensions(_0x295d81,_0x58a3e2,_0x5b55a6){return new BPromise(function(_0x27a445,_0x37f20c){var _0xa0146b=new Extension(formatPrefixName(_0x295d81['prefix']),0x1,_0xeb9b('0x62'),'Voice\x20Prefix');_0xa0146b[_0xeb9b('0x63')]=_0x295d81['id'];return db['VoiceExtension'][_0xeb9b('0x4f')](_0xa0146b,{'transaction':_0x5b55a6})[_0xeb9b('0x2b')](function(_0x3d223f){var _0x1b2a7a=_0x3d223f[_0xeb9b('0x2d')]({'plain':!![]});var _0x4be938=_[_0xeb9b('0x32')](addVoicePrefixExtensions(_0x295d81,_0x58a3e2),function(_0x1c7569){_0x1c7569['VoiceExtensionId']=_0x1b2a7a['id'];_0x1c7569['VoicePrefixId']=_0x295d81['id'];return _0x1c7569;});return db[_0xeb9b('0x64')][_0xeb9b('0x65')](_0x4be938,{'transaction':_0x5b55a6})['then'](function(_0xeb81b9){if(!_0xeb81b9){return _0x37f20c('Extensions\x20creation\x20failed');}else{return _0x27a445(_0xeb81b9);}})[_0xeb9b('0x4e')](function(_0x515a97){return _0x37f20c(_0x515a97);});});;});};function addVoicePrefixExtensions(_0x36376f,_0x382d3a){var _0x417221=[];var _0x1fea34=formatPrefixName(_0x36376f[_0xeb9b('0x66')]);_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x2,'Set',_0xeb9b('0x68')+_0x36376f[_0xeb9b('0x30')]));if(_0x36376f['callerIdAll']){_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x3,_0xeb9b('0x69'),_0xeb9b('0x6a')+_0x36376f[_0xeb9b('0x6b')]));}else{_0x417221['push'](new Extension(_0x1fea34,0x3,_0xeb9b('0x62'),_0xeb9b('0x6c')));}_0x417221['push'](new Extension(_0x1fea34,0x4,_0xeb9b('0x6d'),_0x382d3a[_0xeb9b('0x5a')]+','+_0xeb9b('0x6e')+(0x8+_0x36376f[_0xeb9b('0x30')][_0xeb9b('0x3d')])+'}'+','+0x1));return _0x417221;}function formatPrefixName(_0x48b0ec){var _0x3f9ce0='_';for(var _0x4a48f6=0x0;_0x4a48f6<_0x48b0ec[_0xeb9b('0x3d')];_0x4a48f6++){if(_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)=='-'){_0x3f9ce0+=_0x48b0ec['charAt'](_0x4a48f6);}else{_0x3f9ce0+='['+_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)+']';}}_0x3f9ce0+='.';return _0x3f9ce0;}exports[_0xeb9b('0x2a')]=function(_0x2fb07e,_0x25398e,_0x51de75){var _0xb0080f=_0x2fb07e[_0xeb9b('0x52')];_0xb0080f[_0xeb9b('0x66')]=_0xeb9b('0x70')+_0xb0080f[_0xeb9b('0x30')]+'-';return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3836bd){return db[_0xeb9b('0x33')][_0xeb9b('0x2a')](_0xb0080f,{'where':{'id':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x2c')]({'where':{'VoicePrefixId':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x4d')]({'where':{'id':_0xb0080f['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x3e4ef2){return createVoicePrefixExtensions(_0xb0080f,_0x3e4ef2,_0x3836bd);});});});})[_0xeb9b('0x2b')](function(){return db['VoicePrefix']['findById'](_0xb0080f['id']);})[_0xeb9b('0x2b')](respondWithResult(_0x25398e,null))['catch'](handleError(_0x25398e,null));};exports[_0xeb9b('0x71')]=function(_0x463767,_0x279f71,_0x12a271){return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x463767[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x279f71,null))[_0xeb9b('0x2b')](function(_0x46ce60){if(_0x46ce60){return _0x46ce60[_0xeb9b('0x71')](_0x463767[_0xeb9b('0x52')]['ids'],_['omit'](_0x463767[_0xeb9b('0x52')],['ids','id'])||{})['spread'](function(_0x95e1d0){for(var _0x4bdaf5=0x0;_0x4bdaf5<_0x463767['body']['ids'][_0xeb9b('0x3d')];_0x4bdaf5+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x73'),{'UserId':Number(_0x463767[_0xeb9b('0x52')]['ids'][_0x4bdaf5]),'VoicePrefixId':Number(_0x463767[_0xeb9b('0x4c')]['id'])});}return _0x95e1d0;});}})[_0xeb9b('0x2b')](respondWithResult(_0x279f71,null))[_0xeb9b('0x4e')](handleError(_0x279f71,null));};exports['removeAgents']=function(_0x5c010d,_0x3ea644,_0x4ffa9e){return db[_0xeb9b('0x33')]['find']({'where':{'id':_0x5c010d['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3ea644,null))['then'](function(_0x3aca78){if(_0x3aca78){return _0x3aca78['removeAgents'](_0x5c010d['query'][_0xeb9b('0x74')])[_0xeb9b('0x2b')](function(){if(_[_0xeb9b('0x75')](_0x5c010d[_0xeb9b('0x38')]['ids'])){for(var _0x193ffc=0x0;_0x193ffc<_0x5c010d[_0xeb9b('0x38')][_0xeb9b('0x74')][_0xeb9b('0x3d')];_0x193ffc+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')][_0x193ffc]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}}else{socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3ea644,null))['catch'](handleError(_0x3ea644,null));};exports[_0xeb9b('0x77')]=function(_0x36af5a,_0x41af31,_0x14db1d){var _0x31b0c5={};var _0x24bac5={};var _0x462fa2;var _0x5bf4a4;return db[_0xeb9b('0x33')][_0xeb9b('0x78')]({'where':{'id':_0x36af5a['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x41af31,null))[_0xeb9b('0x2b')](function(_0x16f500){if(_0x16f500){_0x462fa2=_0x16f500;_0x24bac5['model']=_['keys'](db['User'][_0xeb9b('0x34')]);_0x24bac5[_0xeb9b('0x38')]=_['keys'](_0x36af5a[_0xeb9b('0x38')]);_0x24bac5[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x24bac5[_0xeb9b('0x37')],_0x24bac5[_0xeb9b('0x38')]);_0x31b0c5[_0xeb9b('0x3c')]=_['intersection'](_0x24bac5[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x31b0c5[_0xeb9b('0x3c')]=_0x31b0c5[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x31b0c5[_0xeb9b('0x3c')]:_0x24bac5[_0xeb9b('0x37')];_0x31b0c5[_0xeb9b('0x79')]=qs[_0xeb9b('0x40')](_0x36af5a['query'][_0xeb9b('0x40')]);_0x31b0c5[_0xeb9b('0x41')]=qs['filters'](_['pick'](_0x36af5a[_0xeb9b('0x38')],_0x24bac5[_0xeb9b('0x42')]));if(_0x36af5a['query'][_0xeb9b('0x43')]){_0x31b0c5[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x31b0c5[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x31b0c5[_0xeb9b('0x3c')],function(_0x3cb938){var _0x44562a={};_0x44562a[_0x3cb938]={'$like':'%'+_0x36af5a[_0xeb9b('0x38')]['filter']+'%'};return _0x44562a;})});}_0x31b0c5=_[_0xeb9b('0x44')]({},_0x31b0c5,_0x36af5a[_0xeb9b('0x47')]);return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x4d894e){if(_0x4d894e){_0x5bf4a4=_0x4d894e[_0xeb9b('0x3d')];if(!_0x36af5a['query']['hasOwnProperty'](_0xeb9b('0x3f'))){_0x31b0c5[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x31b0c5['offset']=qs[_0xeb9b('0x20')](_0x36af5a['query'][_0xeb9b('0x20')]);}return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x51628d){if(_0x51628d){return _0x51628d?{'count':_0x5bf4a4,'rows':_0x51628d}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x41af31,null))['catch'](handleError(_0x41af31,null));};exports['getTeams']=function(_0x3f9806,_0x3332ba,_0x25e684){var _0x841fc6={};var _0x175afe={};var _0x57a99e;var _0x2ee62d;return db[_0xeb9b('0x33')]['findOne']({'where':{'id':_0x3f9806[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3332ba,null))[_0xeb9b('0x2b')](function(_0x4c303d){if(_0x4c303d){_0x57a99e=_0x4c303d;_0x175afe[_0xeb9b('0x37')]=_[_0xeb9b('0x39')](db[_0xeb9b('0x7a')][_0xeb9b('0x34')]);_0x175afe[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x3f9806['query']);_0x175afe[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],_0x175afe[_0xeb9b('0x38')]);_0x841fc6[_0xeb9b('0x3c')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x841fc6[_0xeb9b('0x3c')]=_0x841fc6['attributes'][_0xeb9b('0x3d')]?_0x841fc6[_0xeb9b('0x3c')]:_0x175afe[_0xeb9b('0x37')];_0x841fc6[_0xeb9b('0x79')]=qs['sort'](_0x3f9806['query'][_0xeb9b('0x40')]);_0x841fc6[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_[_0xeb9b('0x7b')](_0x3f9806[_0xeb9b('0x38')],_0x175afe[_0xeb9b('0x42')]));if(_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x841fc6[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x841fc6[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x841fc6[_0xeb9b('0x3c')],function(_0x5b456a){var _0x13db61={};_0x13db61[_0x5b456a]={'$like':'%'+_0x3f9806[_0xeb9b('0x38')]['filter']+'%'};return _0x13db61;})});}_0x841fc6=_[_0xeb9b('0x44')]({},_0x841fc6,_0x3f9806[_0xeb9b('0x47')]);return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})['then'](function(_0x5c0da1){if(_0x5c0da1){_0x2ee62d=_0x5c0da1[_0xeb9b('0x3d')];if(!_0x3f9806['query'][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x841fc6[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x841fc6[_0xeb9b('0x20')]=qs[_0xeb9b('0x20')](_0x3f9806['query'][_0xeb9b('0x20')]);}return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})[_0xeb9b('0x2b')](function(_0x5e7146){if(_0x5e7146){return _0x5e7146?{'count':_0x2ee62d,'rows':_0x5e7146}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x3332ba,null))['catch'](handleError(_0x3332ba,null));};exports[_0xeb9b('0x7d')]=function(_0x26d380,_0x3d3b2c,_0x50dae3){var _0x461392=_0x26d380[_0xeb9b('0x52')]['ids'];var _0x33adad;return db[_0xeb9b('0x7a')]['findAll']({'where':{'id':_0x461392},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb9b('0x7e'),'attributes':['id',_0xeb9b('0x30'),_0xeb9b('0x7f'),_0xeb9b('0x80'),_0xeb9b('0x81')],'raw':!![]}]})[_0xeb9b('0x2b')](function(_0x1a49a7){if(_0x1a49a7){_0x33adad=_0x1a49a7;var _0x40c30f=_[_0xeb9b('0x82')](_0x1a49a7,function(_0xcda621){var _0xb409e0=_0xcda621[_0xeb9b('0x2d')]({'plain':!![]});return _0xb409e0[_0xeb9b('0x7e')];});return db['VoicePrefix'][_0xeb9b('0x4d')]({'where':{'id':_0x26d380[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x52bd7a){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x33e5c3){return _0x52bd7a[_0xeb9b('0x7d')](_0x461392,{'transaction':_0x33e5c3})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x33adad,function(_0x45b94f){return db[_0xeb9b('0x84')]['upsert']({'TeamId':_0x45b94f['id'],'VoicePrefixId':_0x26d380[_0xeb9b('0x4c')]['id']},{'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x40c30f,function(_0x193304){return db[_0xeb9b('0x85')][_0xeb9b('0x86')]({'where':{'UserId':_0x193304['id'],'VoicePrefixId':_0x26d380['params']['id']},'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){_0x40c30f[_0xeb9b('0x87')](function(_0xe7dcc5){socket['emit']('userVoicePrefix:save',{'UserId':_0xe7dcc5['id'],'VoicePrefixId':_0x52bd7a['id']});});});});});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3d3b2c,null))[_0xeb9b('0x4e')](handleError(_0x3d3b2c,null));};exports[_0xeb9b('0x88')]=function(_0x122550,_0x3e804b,_0x41659f){return db[_0xeb9b('0x7a')][_0xeb9b('0x4a')]({'where':{'id':_0x122550[_0xeb9b('0x38')][_0xeb9b('0x74')]},'attributes':['id'],'include':[{'model':db[_0xeb9b('0x89')],'as':_0xeb9b('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e804b,null))[_0xeb9b('0x2b')](function(_0x4b273d){var _0x16c4a5=_['map'](_0x4b273d,'id');var _0x4d39a7=[];var _0x384fba=[];var _0x23893b=squel[_0xeb9b('0x8a')]();_0x23893b[_0xeb9b('0x8b')](_0xeb9b('0x8c'))['from'](_0xeb9b('0x8d'),'tq')['join'](_0xeb9b('0x8e'),'ut',_0xeb9b('0x8f'))[_0xeb9b('0x41')](_0xeb9b('0x90'),_0x122550['params']['id']);for(var _0x1a9933=0x0;_0x1a9933<_0x4b273d[_0xeb9b('0x3d')];_0x1a9933+=0x1){let _0x2bc3b5=_0x4b273d[_0x1a9933];for(var _0x3b28ef=0x0;_0x3b28ef<_0x2bc3b5[_0xeb9b('0x7e')][_0xeb9b('0x3d')];_0x3b28ef+=0x1){let _0x427672=_0x2bc3b5['Agents'][_0x3b28ef];var _0x276e1f=_0x23893b[_0xeb9b('0x91')]();_0x276e1f[_0xeb9b('0x41')](_0xeb9b('0x92'),_0x427672['id']);_0x384fba['push'](db[_0xeb9b('0x50')][_0xeb9b('0x38')](_0x276e1f[_0xeb9b('0x93')](),{'type':db[_0xeb9b('0x50')]['QueryTypes'][_0xeb9b('0x94')]})[_0xeb9b('0x2b')](function(_0x519eff){if(_0x519eff['length']===0x1){return _0x427672['id'];}else{var _0x564125=_[_0xeb9b('0x95')](_['map'](_0x519eff,_0xeb9b('0x96')),function(_0x44ba4b){return _['includes'](_0x16c4a5,_0x44ba4b);});if(_0x564125){return _0x427672['id'];}}}));}}return BPromise['all'](_0x384fba)[_0xeb9b('0x2b')](function(_0x245892){_0x4d39a7=_(_0x4d39a7)[_0xeb9b('0x97')](_0x245892)[_0xeb9b('0x98')]()[_0xeb9b('0x99')]();return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x122550[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x4d5919){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x5d3fdf){return _0x4d5919[_0xeb9b('0x88')](_0x122550['query'][_0xeb9b('0x74')],{'transaction':_0x5d3fdf})[_0xeb9b('0x2b')](function(){if(!_[_0xeb9b('0x9a')](_0x4d39a7)){return _0x4d5919['removeAgents'](_0x4d39a7,{'transaction':_0x5d3fdf});}})['then'](function(){_0x4d39a7['forEach'](function(_0x8680da){socket[_0xeb9b('0x72')]('userVoicePrefix:remove',{'UserId':_0x8680da,'VoicePrefixId':_0x4d5919['id']});});});});});});})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3e804b,null))[_0xeb9b('0x4e')](handleError(_0x3e804b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c8f08c5..ab78dbc 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 _0xb637=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x220bbb,_0x45973d){var _0x58dc4d=function(_0x4741c4){while(--_0x4741c4){_0x220bbb['push'](_0x220bbb['shift']());}};_0x58dc4d(++_0x45973d);}(_0xb637,0x1ab));var _0x7b63=function(_0x185a55,_0x33e5f9){_0x185a55=_0x185a55-0x0;var _0x22e2e5=_0xb637[_0x185a55];return _0x22e2e5;};'use strict';var EventEmitter=require(_0x7b63('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7b63('0x1')](0x0);var events={'afterCreate':_0x7b63('0x2'),'afterUpdate':_0x7b63('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ce408){return function(_0xcbe3d0,_0x2865b9,_0x2f05a4){VoicePrefixEvents[_0x7b63('0x4')](_0x3ce408+':'+_0xcbe3d0['id'],_0xcbe3d0);VoicePrefixEvents[_0x7b63('0x4')](_0x3ce408,_0xcbe3d0);_0x2f05a4(null);};}for(var e in events){if(events[_0x7b63('0x5')](e)){var event=events[e];VoicePrefix[_0x7b63('0x6')](e,emitEvent(event));}}module[_0x7b63('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0x722e=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x1dce4a,_0x45dc6d){var _0x1231eb=function(_0x649d36){while(--_0x649d36){_0x1dce4a['push'](_0x1dce4a['shift']());}};_0x1231eb(++_0x45dc6d);}(_0x722e,0x140));var _0xe722=function(_0x1423ed,_0x45b68b){_0x1423ed=_0x1423ed-0x0;var _0x2456d0=_0x722e[_0x1423ed];return _0x2456d0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xe722('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe722('0x1')](0x0);var events={'afterCreate':_0xe722('0x2'),'afterUpdate':_0xe722('0x3'),'afterDestroy':_0xe722('0x4')};function emitEvent(_0x32a8f6){return function(_0x5283f7,_0x35b88f,_0x477e48){VoicePrefixEvents[_0xe722('0x5')](_0x32a8f6+':'+_0x5283f7['id'],_0x5283f7);VoicePrefixEvents['emit'](_0x32a8f6,_0x5283f7);_0x477e48(null);};}for(var e in events){if(events[_0xe722('0x6')](e)){var event=events[e];VoicePrefix[_0xe722('0x7')](e,emitEvent(event));}}module[_0xe722('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index deabc63..f10bb10 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 _0x2f3c=['api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x2f3c,0xb3));var _0xc2f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f3c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2f3('0x0'));var util=require(_0xc2f3('0x1'));var logger=require(_0xc2f3('0x2'))(_0xc2f3('0x3'));var moment=require(_0xc2f3('0x4'));var BPromise=require(_0xc2f3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc2f3('0x6'));var rimraf=require(_0xc2f3('0x7'));var config=require(_0xc2f3('0x8'));var attributes=require(_0xc2f3('0x9'));module[_0xc2f3('0xa')]=function(_0x4ab832,_0x2dc24a){return _0x4ab832[_0xc2f3('0xb')](_0xc2f3('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a32=['util','moment','request-promise','path','rimraf','exports','define','lodash'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0x1a32,0xcf));var _0x21a3=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x1a32[_0x4c05da];return _0x1614db;};'use strict';var _=require(_0x21a3('0x0'));var util=require(_0x21a3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x21a3('0x2'));var BPromise=require('bluebird');var rp=require(_0x21a3('0x3'));var fs=require('fs');var path=require(_0x21a3('0x4'));var rimraf=require(_0x21a3('0x5'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module[_0x21a3('0x6')]=function(_0x3d1cff,_0x560a5c){return _0x3d1cff[_0x21a3('0x7')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 2e6761f..53cab4b 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 _0xf06c=['VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','register','then','info','request\x20sent','debug'];(function(_0x20e214,_0x3afe50){var _0x2661ed=function(_0x41b276){while(--_0x41b276){_0x20e214['push'](_0x20e214['shift']());}};_0x2661ed(++_0x3afe50);}(_0xf06c,0xc7));var _0xcf06=function(_0x26ee16,_0x4da133){_0x26ee16=_0x26ee16-0x0;var _0x4fb841=_0xf06c[_0x26ee16];return _0x4fb841;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var moment=require(_0xcf06('0x2'));var BPromise=require(_0xcf06('0x3'));var rs=require(_0xcf06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf06('0x5'))['db'];var utils=require(_0xcf06('0x6'));var logger=require(_0xcf06('0x7'))('rpc');var config=require(_0xcf06('0x8'));var jayson=require(_0xcf06('0x9'));var client=jayson[_0xcf06('0xa')]['http']({'port':0x232a});config[_0xcf06('0xb')]=_['defaults'](config[_0xcf06('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0xcf06('0xc')](socket);function respondWithRpcPromise(_0xfd85ed,_0x41dea0,_0x59d6ba){return new BPromise(function(_0x4ed56b,_0x463309){return client['request'](_0xfd85ed,_0x59d6ba)[_0xcf06('0xd')](function(_0x544ac2){logger[_0xcf06('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x41dea0,_0xcf06('0xf'));logger[_0xcf06('0x10')](_0xcf06('0x11'),_0x41dea0,_0xcf06('0xf'),JSON['stringify'](_0x544ac2));if(_0x544ac2['error']){if(_0x544ac2[_0xcf06('0x12')][_0xcf06('0x13')]===0x1f4){logger[_0xcf06('0x12')](_0xcf06('0x14'),_0x41dea0,_0x544ac2['error'][_0xcf06('0x15')]);return _0x463309(_0x544ac2[_0xcf06('0x12')]['message']);}logger['error'](_0xcf06('0x14'),_0x41dea0,_0x544ac2[_0xcf06('0x12')][_0xcf06('0x15')]);return _0x4ed56b(_0x544ac2['error'][_0xcf06('0x15')]);}else{logger[_0xcf06('0xe')](_0xcf06('0x14'),_0x41dea0,'request\x20sent');_0x4ed56b(_0x544ac2[_0xcf06('0x16')][_0xcf06('0x15')]);}})[_0xcf06('0x17')](function(_0x1aad31){logger[_0xcf06('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x41dea0,_0x1aad31);_0x463309(_0x1aad31);});});} \ No newline at end of file +var _0x1fa9=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1fa9,0x136));var _0x91fa=function(_0x485c6c,_0x5d9e66){_0x485c6c=_0x485c6c-0x0;var _0x2a9e70=_0x1fa9[_0x485c6c];return _0x2a9e70;};'use strict';var _=require(_0x91fa('0x0'));var util=require('util');var moment=require(_0x91fa('0x1'));var BPromise=require('bluebird');var rs=require(_0x91fa('0x2'));var fs=require('fs');var Redis=require(_0x91fa('0x3'));var db=require(_0x91fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91fa('0x5'))(_0x91fa('0x6'));var config=require(_0x91fa('0x7'));var jayson=require(_0x91fa('0x8'));var client=jayson[_0x91fa('0x9')]['http']({'port':0x232a});config[_0x91fa('0xa')]=_[_0x91fa('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x91fa('0xc'))(new Redis(config[_0x91fa('0xa')]));require(_0x91fa('0xd'))[_0x91fa('0xe')](socket);function respondWithRpcPromise(_0x1f246b,_0x886fc1,_0x132eb2){return new BPromise(function(_0x595295,_0x544f1c){return client[_0x91fa('0xf')](_0x1f246b,_0x132eb2)[_0x91fa('0x10')](function(_0x17fc65){logger[_0x91fa('0x11')](_0x91fa('0x12'),_0x886fc1,_0x91fa('0x13'));logger[_0x91fa('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x886fc1,'request\x20sent',JSON['stringify'](_0x17fc65));if(_0x17fc65[_0x91fa('0x15')]){if(_0x17fc65['error'][_0x91fa('0x16')]===0x1f4){logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x17fc65[_0x91fa('0x15')]['message']);return _0x544f1c(_0x17fc65[_0x91fa('0x15')][_0x91fa('0x17')]);}logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x17fc65[_0x91fa('0x15')][_0x91fa('0x17')]);return _0x595295(_0x17fc65['error'][_0x91fa('0x17')]);}else{logger[_0x91fa('0x11')](_0x91fa('0x12'),_0x886fc1,_0x91fa('0x13'));_0x595295(_0x17fc65[_0x91fa('0x18')]['message']);}})[_0x91fa('0x19')](function(_0x433cf5){logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x433cf5);_0x544f1c(_0x433cf5);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 00b81be..afdbcd1 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 _0xb04a=['save','remove','update','emit','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x1e1b5a,_0x13b534){var _0x3206db=function(_0x5d6c2f){while(--_0x5d6c2f){_0x1e1b5a['push'](_0x1e1b5a['shift']());}};_0x3206db(++_0x13b534);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require(_0xab04('0x0'));var events=[_0xab04('0x1'),_0xab04('0x2'),_0xab04('0x3')];function createListener(_0x565575,_0x28963e){return function(_0x4657c4){_0x28963e[_0xab04('0x4')](_0x565575,_0x4657c4);};}function removeListener(_0x4b8c0f,_0x2b5b06){return function(){VoicePrefixEvents[_0xab04('0x5')](_0x4b8c0f,_0x2b5b06);};}exports[_0xab04('0x6')]=function(_0x488ced){for(var _0x3b68e3=0x0,_0x46d9b2=events['length'];_0x3b68e3<_0x46d9b2;_0x3b68e3++){var _0x53a969=events[_0x3b68e3];var _0x4d47f5=createListener(_0xab04('0x7')+_0x53a969,_0x488ced);VoicePrefixEvents['on'](_0x53a969,_0x4d47f5);}}; \ No newline at end of file +var _0x3f8c=['remove','update','register','length','voicePrefix:'];(function(_0xbc376e,_0x12af1c){var _0x22d022=function(_0x3155e1){while(--_0x3155e1){_0xbc376e['push'](_0xbc376e['shift']());}};_0x22d022(++_0x12af1c);}(_0x3f8c,0x104));var _0xc3f8=function(_0x2aca9f,_0x3c6e0a){_0x2aca9f=_0x2aca9f-0x0;var _0x121784=_0x3f8c[_0x2aca9f];return _0x121784;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0xc3f8('0x0'),_0xc3f8('0x1')];function createListener(_0x2e70c4,_0xab5f83){return function(_0x4de1c7){_0xab5f83['emit'](_0x2e70c4,_0x4de1c7);};}function removeListener(_0x54035a,_0x4e5dbd){return function(){VoicePrefixEvents['removeListener'](_0x54035a,_0x4e5dbd);};}exports[_0xc3f8('0x2')]=function(_0x1a6976){for(var _0x3a4e2f=0x0,_0x44c25d=events[_0xc3f8('0x3')];_0x3a4e2f<_0x44c25d;_0x3a4e2f++){var _0x15512a=events[_0x3a4e2f];var _0x51093a=createListener(_0xc3f8('0x4')+_0x15512a,_0x1a6976);VoicePrefixEvents['on'](_0x15512a,_0x51093a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 9b08920..b82dfe6 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x40393b,_0x387c81){var _0x42dc4e=function(_0x3d87ec){while(--_0x3d87ec){_0x40393b['push'](_0x40393b['shift']());}};_0x42dc4e(++_0x387c81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1177a0,_0x431f77){var _0x39714b=function(_0x4acda7){while(--_0x4acda7){_0x1177a0['push'](_0x1177a0['shift']());}};_0x39714b(++_0x431f77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 15cbe15..80fcc1d 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 _0x74c8=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','inbound','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','outbound','preview','booked','roundrobin','includes','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','FLOAT','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\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,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#NoSuchNumber\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)'];(function(_0x16c93f,_0x2a921d){var _0x54327a=function(_0x57f30e){while(--_0x57f30e){_0x16c93f['push'](_0x16c93f['shift']());}};_0x54327a(++_0x2a921d);}(_0x74c8,0x1d7));var _0x874c=function(_0x268473,_0xc9f239){_0x268473=_0x268473-0x0;var _0x56d376=_0x74c8[_0x268473];return _0x56d376;};'use strict';var Sequelize=require(_0x874c('0x0'));module['exports']={'name':{'type':Sequelize[_0x874c('0x1')],'allowNull':![],'unique':_0x874c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x874c('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x874c('0x3')},'musiconhold':{'type':Sequelize[_0x874c('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x874c('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall','leastrecent','fewestcalls',_0x874c('0x4'),_0x874c('0x5'),'linear',_0x874c('0x6'),_0x874c('0x7')),'allowNull':![],'defaultValue':_0x874c('0x8'),'set':function(_0x332158){this[_0x874c('0x9')](_0x874c('0xa'),_0x332158?_0x332158:'rrmemory');},'get':function(){var _0x4f6b49=this[_0x874c('0xb')](_0x874c('0xc'));var _0x2ca98d=this[_0x874c('0xb')](_0x874c('0xd'));var _0x4fd130=this[_0x874c('0xb')](_0x874c('0xa'));if(_0x4f6b49===_0x874c('0xe')){if(_0x2ca98d===_0x874c('0xf')){return null;}if(_0x2ca98d===_0x874c('0x10')&&![_0x874c('0x5'),_0x874c('0x11')][_0x874c('0x12')](_0x4fd130)){this['setDataValue'](_0x874c('0xa'),_0x874c('0x5'));}}return _0x4fd130;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x874c('0x13')](0xb)},'timeout':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x874c('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':_0x874c('0x15')},'autopause':{'type':Sequelize['ENUM'](_0x874c('0x15'),'no',_0x874c('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x874c('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x874c('0x14')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x874c('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x874c('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':_0x874c('0x15')},'announce_holdtime':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no',_0x874c('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x874c('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x874c('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x874c('0x14')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x874c('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x874c('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x874c('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x874c('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x874c('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x874c('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x874c('0x1')]},'queue_quantity1':{'type':Sequelize[_0x874c('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x874c('0x1')]},'periodic_announce':{'type':Sequelize[_0x874c('0x18')],'set':function(_0x4ea32b){this[_0x874c('0x9')](_0x874c('0x19'),_0x4ea32b?_0x4ea32b[_0x874c('0x1a')](','):[]);},'get':function(){return this[_0x874c('0xb')]('periodic_announce')?this[_0x874c('0xb')](_0x874c('0x19'))[_0x874c('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x874c('0x1')],'defaultValue':_0x874c('0x15'),'set':function(_0x156a44){this[_0x874c('0x9')](_0x874c('0x1c'),_0x156a44?_0x156a44[_0x874c('0x1a')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x874c('0xb')]('joinempty')[_0x874c('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x874c('0x1')],'defaultValue':'no','set':function(_0x56ac3b){this['setDataValue']('leavewhenempty',_0x56ac3b?_0x56ac3b[_0x874c('0x1a')](','):undefined);},'get':function(){return this[_0x874c('0xb')]('leavewhenempty')?this['getDataValue'](_0x874c('0x1d'))[_0x874c('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x874c('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x35f45c){this['setDataValue'](_0x874c('0x1e'),_0x35f45c);if(_0x35f45c){if(this[_0x874c('0xb')](_0x874c('0x1f'))<0x2){this['setDataValue'](_0x874c('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x874c('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x874c('0x20')},'dialMethod':{'type':Sequelize[_0x874c('0x14')](_0x874c('0xf'),_0x874c('0x21'),_0x874c('0x22'),_0x874c('0x23'),'booked'),'defaultValue':'progressive','comment':_0x874c('0x24')},'dialLimitChannel':{'type':Sequelize[_0x874c('0x13')](0x4)[_0x874c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x874c('0x26')},'dialLimitQueue':{'type':Sequelize[_0x874c('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x874c('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x874c('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x874c('0x28'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x874c('0x29')](0x2)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x874c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x874c('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x874c('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x874c('0x13')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x874c('0x1')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x2c')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x2e')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'comment':_0x874c('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x874c('0x33')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x874c('0x1')],'defaultValue':_0x874c('0x34')},'dialPrefix':{'type':Sequelize[_0x874c('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x35'),_0x874c('0x36'),_0x874c('0x37')),'defaultValue':_0x874c('0x35')},'dialAMDActive':{'type':Sequelize[_0x874c('0x38')],'defaultValue':0x0,'comment':_0x874c('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x874c('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x874c('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x874c('0x13')](0x9)[_0x874c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x874c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x874c('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x874c('0x13')](0x9)[_0x874c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x874c('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x874c('0x13')](0x9)[_0x874c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x874c('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x874c('0x13')](0x9)[_0x874c('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x874c('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x874c('0x13')](0x9)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x874c('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x874c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x874c('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x874c('0x38')],'defaultValue':0x0,'comment':_0x874c('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x874c('0x14')](_0x874c('0x42'),_0x874c('0x43')),'defaultValue':_0x874c('0x42')},'dialQueueProject2':{'type':Sequelize[_0x874c('0x1')],'comment':_0x874c('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x874c('0x38')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x874c('0x38')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x874c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x874c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x874c('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x874c('0x13')](0x5)[_0x874c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x874c('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x874c('0x13')],'allowNull':!![],'comment':_0x874c('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x874c('0x4c'),'set':function(_0x32a0a8){if(!_0x32a0a8)this[_0x874c('0x9')](_0x874c('0x4d'),null);this['setDataValue']('mandatoryDisposition',_0x32a0a8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x874c('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x874c('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x874c('0x38')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x874c('0x13')](0x3)[_0x874c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x874c('0x38')],'defaultValue':![]}}; \ No newline at end of file +var _0x191e=['BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','ENUM','inbound','outbound','default','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','strategy','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty'];(function(_0x5b453e,_0x31e024){var _0x16f816=function(_0x4a9c92){while(--_0x4a9c92){_0x5b453e['push'](_0x5b453e['shift']());}};_0x16f816(++_0x31e024);}(_0x191e,0x1d8));var _0xe191=function(_0x3a805c,_0x282353){_0x3a805c=_0x3a805c-0x0;var _0x3c8364=_0x191e[_0x3a805c];return _0x3c8364;};'use strict';var Sequelize=require('sequelize');module[_0xe191('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe191('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x3'),_0xe191('0x4')),'allowNull':![],'defaultValue':_0xe191('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xe191('0x5')},'announce':{'type':Sequelize[_0xe191('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xe191('0x7'),_0xe191('0x8'),_0xe191('0x9'),_0xe191('0xa'),_0xe191('0xb'),_0xe191('0xc'),_0xe191('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0xe191('0x7'),'set':function(_0x313579){this[_0xe191('0xe')]('strategy',_0x313579?_0x313579:_0xe191('0xb'));},'get':function(){var _0x16a68f=this[_0xe191('0xf')](_0xe191('0x10'));var _0x369f1e=this[_0xe191('0xf')](_0xe191('0x11'));var _0x724819=this[_0xe191('0xf')]('strategy');if(_0x16a68f===_0xe191('0x4')){if(_0x369f1e===_0xe191('0x12')){return null;}if(_0x369f1e===_0xe191('0x13')&&!['rrmemory',_0xe191('0x14')][_0xe191('0x15')](_0x724819)){this[_0xe191('0xe')](_0xe191('0x16'),'rrmemory');}}return _0x724819;}},'servicelevel':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe191('0x17')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe191('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':_0xe191('0x18')},'autopause':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe191('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe191('0x2')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe191('0x2')]('yes','no'),'defaultValue':_0xe191('0x18')},'announce_holdtime':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no',_0xe191('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe191('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe191('0x6')]},'queue_youarenext':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe191('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xe191('0x6')]},'queue_quantity2':{'type':Sequelize[_0xe191('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xe191('0x6')]},'queue_less_than':{'type':Sequelize[_0xe191('0x6')]},'periodic_announce':{'type':Sequelize[_0xe191('0x1a')],'set':function(_0x1f661e){this[_0xe191('0xe')](_0xe191('0x1b'),_0x1f661e?_0x1f661e[_0xe191('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xe191('0x1b'))?this[_0xe191('0xf')](_0xe191('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xe191('0x6')],'defaultValue':'yes','set':function(_0x49c1f0){this[_0xe191('0xe')]('joinempty',_0x49c1f0?_0x49c1f0[_0xe191('0x1c')](','):undefined);},'get':function(){return this[_0xe191('0xf')](_0xe191('0x1d'))?this['getDataValue'](_0xe191('0x1d'))[_0xe191('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xe191('0x6')],'defaultValue':'no','set':function(_0x1255dd){this['setDataValue'](_0xe191('0x1f'),_0x1255dd?_0x1255dd[_0xe191('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xe191('0x1f'))?this[_0xe191('0xf')]('leavewhenempty')[_0xe191('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe191('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe191('0x6')]},'description':{'type':Sequelize[_0xe191('0x6')]},'acw':{'type':Sequelize[_0xe191('0x20')],'defaultValue':0x0,'set':function(_0x2eabf3){this[_0xe191('0xe')](_0xe191('0x21'),_0x2eabf3);if(_0x2eabf3){if(this[_0xe191('0xf')](_0xe191('0x22'))<0x2){this[_0xe191('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe191('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe191('0x20')],'defaultValue':0x0,'comment':_0xe191('0x23')},'dialMethod':{'type':Sequelize[_0xe191('0x2')](_0xe191('0x12'),'progressive','power',_0xe191('0x24'),'booked'),'defaultValue':_0xe191('0x25'),'comment':_0xe191('0x26')},'dialLimitChannel':{'type':Sequelize[_0xe191('0x17')](0x4)[_0xe191('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe191('0x28')},'dialLimitQueue':{'type':Sequelize[_0xe191('0x17')](0x4)[_0xe191('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe191('0x29')},'dialPowerLevel':{'type':Sequelize[_0xe191('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe191('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xe191('0x2c'),_0xe191('0x2d')),'defaultValue':_0xe191('0x2d'),'comment':_0xe191('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe191('0x2f')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe191('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe191('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x31')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xe191('0x32'),'comment':_0xe191('0x33')},'dialQueueTimeout':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x34')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)[_0xe191('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x3,'comment':_0xe191('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe191('0x39')},'dialTimezone':{'type':Sequelize[_0xe191('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe191('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe191('0x2')]('always',_0xe191('0x3a'),_0xe191('0x3b')),'defaultValue':_0xe191('0x3c')},'dialAMDActive':{'type':Sequelize[_0xe191('0x20')],'defaultValue':0x0,'comment':_0xe191('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe191('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe191('0x3e')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe191('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe191('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe191('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe191('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe191('0x17')](0x9)[_0xe191('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe191('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xe191('0x17')](0x5)[_0xe191('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe191('0x20')],'defaultValue':0x0,'comment':_0xe191('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe191('0x2')]('DESC',_0xe191('0x44')),'defaultValue':_0xe191('0x45')},'dialQueueProject2':{'type':Sequelize[_0xe191('0x6')],'comment':_0xe191('0x46')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe191('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe191('0x47')},'dialCutDigit':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe191('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)[_0xe191('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)[_0xe191('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe191('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe191('0x17')](0x5)[_0xe191('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe191('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe191('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe191('0x20')],'defaultValue':![],'comment':_0xe191('0x51'),'set':function(_0x15b20d){if(!_0x15b20d)this[_0xe191('0xe')](_0xe191('0x52'),null);this['setDataValue'](_0xe191('0x53'),_0x15b20d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe191('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe191('0x20')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe191('0x17')](0x3)[_0xe191('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe191('0x20')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 614b5b2..58e7c6e 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 _0xef66=['omit','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','hasOwnProperty','VoiceQueueId','CmHopper','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','interface','flatMap','penalty','sequelize','each','upsert','findOrCreate','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','online','UserVoiceQueueRt','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','cm_hopper','phone','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','into','fromQuery','scheduledAt','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','all','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.OrderBy+1','cm_contact_has_items','join','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','error','send','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','VoiceQueue','findAll','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','params','createdAt','updatedAt'];(function(_0x2f74a2,_0x4f2ae0){var _0xdbb1ec=function(_0x444ddd){while(--_0x444ddd){_0x2f74a2['push'](_0x2f74a2['shift']());}};_0xdbb1ec(++_0x4f2ae0);}(_0xef66,0x1db));var _0x6ef6=function(_0xa13f25,_0x116b5b){_0xa13f25=_0xa13f25-0x0;var _0x33c917=_0xef66[_0xa13f25];return _0x33c917;};'use strict';var emlformat=require(_0x6ef6('0x0'));var rimraf=require(_0x6ef6('0x1'));var zipdir=require(_0x6ef6('0x2'));var jsonpatch=require(_0x6ef6('0x3'));var rp=require(_0x6ef6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ef6('0x5'));var util=require(_0x6ef6('0x6'));var path=require(_0x6ef6('0x7'));var sox=require(_0x6ef6('0x8'));var csv=require(_0x6ef6('0x9'));var ejs=require(_0x6ef6('0xa'));var fs=require('fs');var fs_extra=require(_0x6ef6('0xb'));var _=require(_0x6ef6('0xc'));var squel=require(_0x6ef6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ef6('0xe'));var toCsv=require(_0x6ef6('0x9'));var querystring=require(_0x6ef6('0xf'));var Papa=require(_0x6ef6('0x10'));var Redis=require(_0x6ef6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ef6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef6('0x13'))('api');var utils=require(_0x6ef6('0x14'));var config=require(_0x6ef6('0x15'));var licenseUtil=require(_0x6ef6('0x16'));var db=require(_0x6ef6('0x17'))['db'];config['redis']=_[_0x6ef6('0x18')](config[_0x6ef6('0x19')],{'host':_0x6ef6('0x1a'),'port':0x18eb});var socket=require(_0x6ef6('0x1b'))(new Redis(config['redis']));require(_0x6ef6('0x1c'))['register'](socket);function respondWithStatusCode(_0x40d198,_0x29510e){_0x29510e=_0x29510e||0xcc;return function(_0x587806){if(_0x587806){return _0x40d198[_0x6ef6('0x1d')](_0x29510e);}return _0x40d198[_0x6ef6('0x1e')](_0x29510e)[_0x6ef6('0x1f')]();};}function respondWithResult(_0x3f0a84,_0x3fa688){_0x3fa688=_0x3fa688||0xc8;return function(_0x2e6eb6){if(_0x2e6eb6){return _0x3f0a84[_0x6ef6('0x1e')](_0x3fa688)[_0x6ef6('0x20')](_0x2e6eb6);}};}function respondWithFilteredResult(_0x1ed381,_0x2ddb6a){return function(_0x53586d){if(_0x53586d){var _0x3fc3d1=typeof _0x2ddb6a[_0x6ef6('0x21')]===_0x6ef6('0x22')&&typeof _0x2ddb6a[_0x6ef6('0x23')]===_0x6ef6('0x22');var _0x2e6e52=_0x53586d[_0x6ef6('0x24')];var _0x5a87e9=_0x3fc3d1?0x0:_0x2ddb6a[_0x6ef6('0x21')];var _0x20ef96=_0x3fc3d1?_0x53586d[_0x6ef6('0x24')]:_0x2ddb6a[_0x6ef6('0x21')]+_0x2ddb6a['limit'];var _0x164ed9;if(_0x20ef96>=_0x2e6e52){_0x20ef96=_0x2e6e52;_0x164ed9=0xc8;}else{_0x164ed9=0xce;}_0x1ed381[_0x6ef6('0x1e')](_0x164ed9);return _0x1ed381[_0x6ef6('0x25')]('Content-Range',_0x5a87e9+'-'+_0x20ef96+'/'+_0x2e6e52)[_0x6ef6('0x20')](_0x53586d);}return null;};}function patchUpdates(_0x1096de){return function(_0x5c943c){try{jsonpatch[_0x6ef6('0x26')](_0x5c943c,_0x1096de,!![]);}catch(_0x3c225f){return BPromise['reject'](_0x3c225f);}return _0x5c943c[_0x6ef6('0x27')]();};}function saveUpdates(_0xb1c6b0,_0x2072a1){return function(_0x414def){if(_0x414def){return _0x414def[_0x6ef6('0x28')](_0xb1c6b0)[_0x6ef6('0x29')](function(_0x1cd549){return _0x1cd549;});}return null;};}function removeEntity(_0x499d4f,_0x2e5059){return function(_0x503379){if(_0x503379){return _0x503379[_0x6ef6('0x2a')]()[_0x6ef6('0x29')](function(){var _0x443ded=_0x503379[_0x6ef6('0x2b')]({'plain':!![]});var _0x1faa2c=[{'name':_0x6ef6('0x2c'),'value':_0x6ef6('0x2d'),'ignore':![]},{'name':_0x6ef6('0x2e'),'value':_0x6ef6('0x2f'),'ignore':![]}];var _0x1c4d4d=_(_0x1faa2c)[_0x6ef6('0x30')](_0x6ef6('0x31'))[_0x6ef6('0x32')](_0x6ef6('0x33'))[_0x6ef6('0x33')]();if(_[_0x6ef6('0x34')](_0x1c4d4d,_0x443ded[_0x6ef6('0x35')])){return;}var _0x17d261=_[_0x6ef6('0x36')](_0x1faa2c,[_0x6ef6('0x33'),_0x443ded['type']])[_0x6ef6('0x37')];return db['UserProfileResource'][_0x6ef6('0x2a')]({'where':{'type':_0x17d261,'resourceId':_0x443ded['id']}})[_0x6ef6('0x29')](function(){return _0x503379;});})[_0x6ef6('0x29')](function(){_0x499d4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd97cd0,_0x300051){return function(_0x335b1d){if(!_0x335b1d){_0xd97cd0['sendStatus'](0x194);}return _0x335b1d;};}function handleError(_0x364d4d,_0x5ed542){_0x5ed542=_0x5ed542||0x1f4;return function(_0x3cc6a3){logger[_0x6ef6('0x38')](_0x3cc6a3['stack']);if(_0x3cc6a3['name']){delete _0x3cc6a3[_0x6ef6('0x37')];}_0x364d4d['status'](_0x5ed542)[_0x6ef6('0x39')](_0x3cc6a3);};}exports['index']=function(_0x3f0ada,_0x4b8d24){var _0x5e132a={},_0x72c277={},_0x220b88={'count':0x0,'rows':[]};var _0x5d1db9=_[_0x6ef6('0x32')](db['VoiceQueue'][_0x6ef6('0x3a')],function(_0x515908){return{'name':_0x515908[_0x6ef6('0x3b')],'type':_0x515908['type'][_0x6ef6('0x3c')]};});_0x72c277[_0x6ef6('0x3d')]=_[_0x6ef6('0x32')](_0x5d1db9,'name');_0x72c277['query']=_[_0x6ef6('0x3e')](_0x3f0ada[_0x6ef6('0x3f')]);_0x72c277[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x72c277['model'],_0x72c277['query']);_0x5e132a[_0x6ef6('0x42')]=_['intersection'](_0x72c277['model'],qs[_0x6ef6('0x43')](_0x3f0ada['query'][_0x6ef6('0x43')]));_0x5e132a[_0x6ef6('0x42')]=_0x5e132a[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x5e132a[_0x6ef6('0x42')]:_0x72c277[_0x6ef6('0x3d')];if(!_0x3f0ada[_0x6ef6('0x3f')]['hasOwnProperty'](_0x6ef6('0x45'))){_0x5e132a['limit']=qs['limit'](_0x3f0ada[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x5e132a[_0x6ef6('0x21')]=qs['offset'](_0x3f0ada[_0x6ef6('0x3f')][_0x6ef6('0x21')]);}_0x5e132a[_0x6ef6('0x46')]=qs['sort'](_0x3f0ada[_0x6ef6('0x3f')][_0x6ef6('0x47')]);_0x5e132a[_0x6ef6('0x48')]=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x3f0ada[_0x6ef6('0x3f')],_0x72c277[_0x6ef6('0x40')]),_0x5d1db9);if(_0x3f0ada[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x5e132a[_0x6ef6('0x48')]=_['merge'](_0x5e132a[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x5d1db9,function(_0x3be8e3){if(_0x3be8e3[_0x6ef6('0x35')]!==_0x6ef6('0x4a')){var _0x23abee={};_0x23abee[_0x3be8e3[_0x6ef6('0x37')]]={'$like':'%'+_0x3f0ada[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x23abee;}})});}_0x5e132a=_[_0x6ef6('0x4b')]({},_0x5e132a,_0x3f0ada[_0x6ef6('0x4c')]);var _0x5a5e91={'where':_0x5e132a[_0x6ef6('0x48')]};return db['VoiceQueue'][_0x6ef6('0x24')](_0x5a5e91)['then'](function(_0x2b7b21){_0x220b88[_0x6ef6('0x24')]=_0x2b7b21;if(_0x3f0ada['query'][_0x6ef6('0x4d')]){_0x5e132a[_0x6ef6('0x4e')]=[{'all':!![]}];}return db[_0x6ef6('0x4f')][_0x6ef6('0x50')](_0x5e132a);})[_0x6ef6('0x29')](function(_0x5dfd25){_0x220b88[_0x6ef6('0x51')]=_0x5dfd25;return _0x220b88;})[_0x6ef6('0x29')](respondWithFilteredResult(_0x4b8d24,_0x5e132a))[_0x6ef6('0x52')](handleError(_0x4b8d24,null));};exports[_0x6ef6('0x53')]=function(_0x26e869,_0x30be57){var _0x3144ea={'raw':![],'where':{'id':_0x26e869['params']['id']}},_0x435231={};_0x435231[_0x6ef6('0x3d')]=_[_0x6ef6('0x3e')](db['VoiceQueue']['rawAttributes']);_0x435231[_0x6ef6('0x3f')]=_['keys'](_0x26e869[_0x6ef6('0x3f')]);_0x435231['filters']=_[_0x6ef6('0x41')](_0x435231[_0x6ef6('0x3d')],_0x435231[_0x6ef6('0x3f')]);_0x3144ea[_0x6ef6('0x42')]=_['intersection'](_0x435231['model'],qs['fields'](_0x26e869['query'][_0x6ef6('0x43')]));_0x3144ea[_0x6ef6('0x42')]=_0x3144ea[_0x6ef6('0x42')]['length']?_0x3144ea[_0x6ef6('0x42')]:_0x435231[_0x6ef6('0x3d')];if(_0x26e869[_0x6ef6('0x3f')][_0x6ef6('0x4d')]){_0x3144ea[_0x6ef6('0x4e')]=[{'all':!![]}];}_0x3144ea=_[_0x6ef6('0x4b')]({},_0x3144ea,_0x26e869[_0x6ef6('0x4c')]);return db['VoiceQueue'][_0x6ef6('0x36')](_0x3144ea)['then'](handleEntityNotFound(_0x30be57,null))[_0x6ef6('0x29')](respondWithResult(_0x30be57,null))[_0x6ef6('0x52')](handleError(_0x30be57,null));};exports['create']=function(_0x501c03,_0xac8647){return db[_0x6ef6('0x4f')][_0x6ef6('0x54')](_0x501c03[_0x6ef6('0x55')],{})[_0x6ef6('0x29')](function(_0x3070f9){var _0x3e4a64=_0x501c03['user'][_0x6ef6('0x2b')]({'plain':!![]});if(!_0x3e4a64)throw new Error(_0x6ef6('0x56'));if(_0x3e4a64[_0x6ef6('0x57')]==='user'){var _0x3a0533=_0x3070f9[_0x6ef6('0x2b')]({'plain':!![]});var _0x4c9213=[{'name':_0x6ef6('0x2c'),'value':_0x6ef6('0x2d')},{'name':_0x6ef6('0x2e'),'value':_0x6ef6('0x2f')}];var _0x10ba90=_[_0x6ef6('0x36')](_0x4c9213,[_0x6ef6('0x33'),_0x3a0533[_0x6ef6('0x35')]])['name'];return db[_0x6ef6('0x58')][_0x6ef6('0x36')]({'where':{'name':_0x10ba90,'userProfileId':_0x3e4a64[_0x6ef6('0x59')]},'raw':!![]})[_0x6ef6('0x29')](function(_0x4f7472){if(_0x4f7472&&_0x4f7472[_0x6ef6('0x5a')]===0x0){return db['UserProfileResource'][_0x6ef6('0x54')]({'name':_0x3a0533[_0x6ef6('0x37')],'resourceId':_0x3a0533['id'],'type':_0x4f7472[_0x6ef6('0x37')],'sectionId':_0x4f7472['id']},{})['then'](function(){return _0x3070f9;});}else{return _0x3070f9;}})[_0x6ef6('0x52')](function(_0x308f63){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x308f63);throw _0x308f63;});}return _0x3070f9;})[_0x6ef6('0x29')](respondWithResult(_0xac8647,0xc9))[_0x6ef6('0x52')](handleError(_0xac8647,null));};exports[_0x6ef6('0x5b')]=function(_0x59a1f7,_0x266d2e){var _0x5c5f1d={'where':{'id':_0x59a1f7[_0x6ef6('0x5c')]['id']}},_0x5b5d1b={};_0x5b5d1b[_0x6ef6('0x3d')]=_['keys'](db[_0x6ef6('0x4f')][_0x6ef6('0x3a')]);_0x5c5f1d[_0x6ef6('0x42')]=_[_0x6ef6('0x41')](_0x5b5d1b['model'],qs[_0x6ef6('0x43')](_0x59a1f7[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x5c5f1d[_0x6ef6('0x42')]=_0x5c5f1d[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x5c5f1d['attributes']:_0x5b5d1b['model'];if(_0x59a1f7['query'][_0x6ef6('0x4d')]){_0x5c5f1d[_0x6ef6('0x4e')]=[{'all':!![]}];}_0x5c5f1d=_[_0x6ef6('0x4b')]({},_0x5c5f1d,_0x59a1f7[_0x6ef6('0x4c')]);return db[_0x6ef6('0x4f')][_0x6ef6('0x36')](_0x5c5f1d)[_0x6ef6('0x29')](handleEntityNotFound(_0x266d2e,null))[_0x6ef6('0x29')](function(_0x338b57){if(_0x338b57){var _0x25e61e=_0x338b57[_0x6ef6('0x2b')]({'plain':!![]});_0x25e61e=qs['omit'](_0x25e61e,['id',_0x6ef6('0x5d'),_0x6ef6('0x5e')]);_0x59a1f7[_0x6ef6('0x55')]=_[_0x6ef6('0x5f')](_0x59a1f7[_0x6ef6('0x55')],['id',_0x6ef6('0x5d'),_0x6ef6('0x5e')]);return db[_0x6ef6('0x4f')]['create'](_[_0x6ef6('0x4b')](_0x25e61e,_0x59a1f7['body']),{'include':_0x59a1f7[_0x6ef6('0x3f')][_0x6ef6('0x4d')]?[{'all':!![]}]:undefined})[_0x6ef6('0x29')](function(_0x52a442){var _0x1aa427=_0x59a1f7[_0x6ef6('0x60')][_0x6ef6('0x2b')]({'plain':!![]});if(!_0x1aa427)throw new Error(_0x6ef6('0x56'));if(_0x1aa427['role']===_0x6ef6('0x60')){var _0x4135c5=_0x52a442[_0x6ef6('0x2b')]({'plain':!![]});var _0x3d4060=[{'name':_0x6ef6('0x2c'),'value':_0x6ef6('0x2d')},{'name':_0x6ef6('0x2e'),'value':_0x6ef6('0x2f')}];var _0x1a6aed=_[_0x6ef6('0x36')](_0x3d4060,['value',_0x4135c5[_0x6ef6('0x35')]])[_0x6ef6('0x37')];return db[_0x6ef6('0x58')][_0x6ef6('0x36')]({'where':{'name':_0x1a6aed,'userProfileId':_0x1aa427['userProfileId']},'raw':!![]})[_0x6ef6('0x29')](function(_0x3af65){if(_0x3af65&&_0x3af65[_0x6ef6('0x5a')]===0x0){return db[_0x6ef6('0x61')][_0x6ef6('0x54')]({'name':_0x4135c5['name'],'resourceId':_0x4135c5['id'],'type':_0x3af65['name'],'sectionId':_0x3af65['id']},{})[_0x6ef6('0x29')](function(){return _0x52a442;});}else{return _0x52a442;}})['catch'](function(_0x34f9ea){logger[_0x6ef6('0x38')](_0x6ef6('0x62'),_0x34f9ea);throw _0x34f9ea;});}return _0x52a442;});}})[_0x6ef6('0x29')](respondWithResult(_0x266d2e,0xc9))[_0x6ef6('0x52')](handleError(_0x266d2e,null));};exports[_0x6ef6('0x28')]=function(_0x2999a8,_0x30f096){if(_0x2999a8['body']['id']){delete _0x2999a8['body']['id'];}return db['VoiceQueue'][_0x6ef6('0x36')]({'where':{'id':_0x2999a8[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x30f096,null))['then'](saveUpdates(_0x2999a8[_0x6ef6('0x55')],null))['then'](respondWithResult(_0x30f096,null))['catch'](handleError(_0x30f096,null));};exports[_0x6ef6('0x2a')]=function(_0x307e33,_0x576174){return db['VoiceQueue'][_0x6ef6('0x36')]({'where':{'id':_0x307e33['params']['id']}})['then'](handleEntityNotFound(_0x576174,null))[_0x6ef6('0x29')](removeEntity(_0x576174,null))[_0x6ef6('0x52')](handleError(_0x576174,null));};exports[_0x6ef6('0x63')]=function(_0x614770,_0x1d1da7,_0x2cd616){var _0x529853={'raw':![],'where':{}};var _0x128d65={};var _0x6a81eb={'count':0x0,'rows':[]};return db[_0x6ef6('0x4f')]['findOne']({'where':{'id':_0x614770[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x1d1da7,null))[_0x6ef6('0x29')](function(_0x17d5e7){if(_0x17d5e7){_0x128d65['model']=_[_0x6ef6('0x3e')](db['CmHopper'][_0x6ef6('0x3a')]);_0x128d65[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x614770[_0x6ef6('0x3f')]);_0x128d65[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x128d65[_0x6ef6('0x3d')],_0x128d65[_0x6ef6('0x3f')]);_0x529853[_0x6ef6('0x42')]=_[_0x6ef6('0x41')](_0x128d65['model'],qs[_0x6ef6('0x43')](_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x529853[_0x6ef6('0x42')]=_0x529853[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x529853[_0x6ef6('0x42')]:_0x128d65[_0x6ef6('0x3d')];if(!_0x614770['query'][_0x6ef6('0x64')]('nolimit')){_0x529853[_0x6ef6('0x23')]=qs['limit'](_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x529853[_0x6ef6('0x21')]=qs['offset'](_0x614770['query'][_0x6ef6('0x21')]);}_0x529853[_0x6ef6('0x46')]=qs['sort'](_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x47')]);_0x529853[_0x6ef6('0x48')]=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x614770[_0x6ef6('0x3f')],_0x128d65[_0x6ef6('0x40')]));_0x529853[_0x6ef6('0x48')][_0x6ef6('0x65')]=_0x17d5e7['id'];if(_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x529853[_0x6ef6('0x48')]=_['merge'](_0x529853[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x529853['attributes'],function(_0x5d9e4f){var _0x79816c={};_0x79816c[_0x5d9e4f]={'$like':'%'+_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x79816c;})});}_0x529853=_[_0x6ef6('0x4b')]({},_0x529853,_0x614770[_0x6ef6('0x4c')]);return db[_0x6ef6('0x66')][_0x6ef6('0x24')]({'where':_0x529853['where']})[_0x6ef6('0x29')](function(_0x4ec67a){_0x6a81eb[_0x6ef6('0x24')]=_0x4ec67a;if(_0x614770[_0x6ef6('0x3f')][_0x6ef6('0x4d')]){_0x529853[_0x6ef6('0x4e')]=[{'all':!![]}];}return db[_0x6ef6('0x66')]['findAll'](_0x529853);})[_0x6ef6('0x29')](function(_0x40d669){_0x6a81eb[_0x6ef6('0x51')]=_0x40d669;return _0x6a81eb;});}})['then'](respondWithFilteredResult(_0x1d1da7,_0x529853))[_0x6ef6('0x52')](handleError(_0x1d1da7,null));};exports['getHopperHistories']=function(_0x19c241,_0x4c13b0,_0x4a9892){var _0x5bb2ec={'raw':!![],'where':{}};var _0x3287bc={};var _0x1fbfb5={'count':0x0,'rows':[]};return db[_0x6ef6('0x4f')][_0x6ef6('0x67')]({'where':{'id':_0x19c241[_0x6ef6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4c13b0,null))[_0x6ef6('0x29')](function(_0x2f86ce){if(_0x2f86ce){_0x3287bc['model']=_[_0x6ef6('0x3e')](db[_0x6ef6('0x68')][_0x6ef6('0x3a')]);_0x3287bc['query']=_[_0x6ef6('0x3e')](_0x19c241['query']);_0x3287bc[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x3287bc[_0x6ef6('0x3d')],_0x3287bc[_0x6ef6('0x3f')]);_0x5bb2ec[_0x6ef6('0x42')]=_['intersection'](_0x3287bc['model'],qs[_0x6ef6('0x43')](_0x19c241[_0x6ef6('0x3f')]['fields']));_0x5bb2ec[_0x6ef6('0x42')]=_0x5bb2ec[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x5bb2ec[_0x6ef6('0x42')]:_0x3287bc[_0x6ef6('0x3d')];if(!_0x19c241['query'][_0x6ef6('0x64')]('nolimit')){_0x5bb2ec['limit']=qs[_0x6ef6('0x23')](_0x19c241[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x5bb2ec[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x19c241[_0x6ef6('0x3f')]['offset']);}_0x5bb2ec[_0x6ef6('0x46')]=qs[_0x6ef6('0x47')](_0x19c241['query'][_0x6ef6('0x47')]);_0x5bb2ec['where']=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x19c241[_0x6ef6('0x3f')],_0x3287bc['filters']));_0x5bb2ec[_0x6ef6('0x48')][_0x6ef6('0x65')]=_0x2f86ce['id'];if(_0x19c241[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x5bb2ec['where']=_[_0x6ef6('0x4b')](_0x5bb2ec[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x5bb2ec[_0x6ef6('0x42')],function(_0x17a7b0){var _0x5cf22b={};_0x5cf22b[_0x17a7b0]={'$like':'%'+_0x19c241[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x5cf22b;})});}_0x5bb2ec=_[_0x6ef6('0x4b')]({},_0x5bb2ec,_0x19c241[_0x6ef6('0x4c')]);return db[_0x6ef6('0x68')][_0x6ef6('0x24')]({'where':_0x5bb2ec[_0x6ef6('0x48')]})[_0x6ef6('0x29')](function(_0x52757a){_0x1fbfb5[_0x6ef6('0x24')]=_0x52757a;if(_0x19c241[_0x6ef6('0x3f')][_0x6ef6('0x4d')]){_0x5bb2ec['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6ef6('0x50')](_0x5bb2ec);})[_0x6ef6('0x29')](function(_0x3c1748){_0x1fbfb5['rows']=_0x3c1748;return _0x1fbfb5;});}})[_0x6ef6('0x29')](respondWithFilteredResult(_0x4c13b0,_0x5bb2ec))[_0x6ef6('0x52')](handleError(_0x4c13b0,null));};exports['getHopperFinals']=function(_0x5719ad,_0x56429d,_0x55a4d5){var _0x195cea={'raw':!![],'where':{}};var _0x5cfa09={};var _0x2c70fe={'count':0x0,'rows':[]};return db[_0x6ef6('0x4f')][_0x6ef6('0x67')]({'where':{'id':_0x5719ad[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x56429d,null))[_0x6ef6('0x29')](function(_0x1e8674){if(_0x1e8674){_0x5cfa09['model']=_[_0x6ef6('0x3e')](db[_0x6ef6('0x69')][_0x6ef6('0x3a')]);_0x5cfa09[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x5719ad['query']);_0x5cfa09[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x5cfa09['model'],_0x5cfa09[_0x6ef6('0x3f')]);_0x195cea[_0x6ef6('0x42')]=_['intersection'](_0x5cfa09[_0x6ef6('0x3d')],qs[_0x6ef6('0x43')](_0x5719ad[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x195cea[_0x6ef6('0x42')]=_0x195cea[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x195cea['attributes']:_0x5cfa09['model'];if(!_0x5719ad['query']['hasOwnProperty'](_0x6ef6('0x45'))){_0x195cea[_0x6ef6('0x23')]=qs[_0x6ef6('0x23')](_0x5719ad[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x195cea[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x5719ad['query'][_0x6ef6('0x21')]);}_0x195cea['order']=qs[_0x6ef6('0x47')](_0x5719ad[_0x6ef6('0x3f')][_0x6ef6('0x47')]);_0x195cea['where']=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x5719ad[_0x6ef6('0x3f')],_0x5cfa09[_0x6ef6('0x40')]));_0x195cea['where'][_0x6ef6('0x65')]=_0x1e8674['id'];if(_0x5719ad['query'][_0x6ef6('0x30')]){_0x195cea[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x195cea['where'],{'$or':_['map'](_0x195cea['attributes'],function(_0xf7d3d5){var _0x59994b={};_0x59994b[_0xf7d3d5]={'$like':'%'+_0x5719ad['query'][_0x6ef6('0x30')]+'%'};return _0x59994b;})});}_0x195cea=_[_0x6ef6('0x4b')]({},_0x195cea,_0x5719ad['options']);return db[_0x6ef6('0x69')][_0x6ef6('0x24')]({'where':_0x195cea[_0x6ef6('0x48')]})[_0x6ef6('0x29')](function(_0x2e3ed3){_0x2c70fe['count']=_0x2e3ed3;if(_0x5719ad[_0x6ef6('0x3f')][_0x6ef6('0x4d')]){_0x195cea[_0x6ef6('0x4e')]=[{'all':!![]}];}return db[_0x6ef6('0x69')][_0x6ef6('0x50')](_0x195cea);})[_0x6ef6('0x29')](function(_0x526b89){_0x2c70fe['rows']=_0x526b89;return _0x2c70fe;});}})['then'](respondWithFilteredResult(_0x56429d,_0x195cea))[_0x6ef6('0x52')](handleError(_0x56429d,null));};exports[_0x6ef6('0x6a')]=function(_0x240637,_0x8c775c,_0x1a9bda){var _0x291f90={'raw':!![],'where':{}};var _0x5c201a={};var _0x292d58={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6ef6('0x67')]({'where':{'id':_0x240637[_0x6ef6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8c775c,null))[_0x6ef6('0x29')](function(_0x3bc477){if(_0x3bc477){_0x5c201a[_0x6ef6('0x3d')]=_['keys'](db[_0x6ef6('0x6b')][_0x6ef6('0x3a')]);_0x5c201a[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x240637[_0x6ef6('0x3f')]);_0x5c201a[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x5c201a[_0x6ef6('0x3d')],_0x5c201a['query']);_0x291f90['attributes']=_[_0x6ef6('0x41')](_0x5c201a['model'],qs[_0x6ef6('0x43')](_0x240637[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x291f90[_0x6ef6('0x42')]=_0x291f90[_0x6ef6('0x42')]['length']?_0x291f90[_0x6ef6('0x42')]:_0x5c201a[_0x6ef6('0x3d')];if(!_0x240637[_0x6ef6('0x3f')][_0x6ef6('0x64')](_0x6ef6('0x45'))){_0x291f90[_0x6ef6('0x23')]=qs[_0x6ef6('0x23')](_0x240637['query'][_0x6ef6('0x23')]);_0x291f90[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x240637['query'][_0x6ef6('0x21')]);}_0x291f90['order']=qs[_0x6ef6('0x47')](_0x240637[_0x6ef6('0x3f')]['sort']);_0x291f90['where']=qs[_0x6ef6('0x40')](_['pick'](_0x240637['query'],_0x5c201a[_0x6ef6('0x40')]));_0x291f90[_0x6ef6('0x48')][_0x6ef6('0x65')]=_0x3bc477['id'];if(_0x240637[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x291f90[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x291f90[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x291f90[_0x6ef6('0x42')],function(_0x46a80f){var _0x3deb57={};_0x3deb57[_0x46a80f]={'$like':'%'+_0x240637[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x3deb57;})});}_0x291f90=_['merge']({},_0x291f90,_0x240637[_0x6ef6('0x4c')]);return db['CmHopperBlack'][_0x6ef6('0x24')]({'where':_0x291f90['where']})[_0x6ef6('0x29')](function(_0x523591){_0x292d58[_0x6ef6('0x24')]=_0x523591;if(_0x240637['query'][_0x6ef6('0x4d')]){_0x291f90['include']=[{'all':!![]}];}return db[_0x6ef6('0x6b')][_0x6ef6('0x50')](_0x291f90);})[_0x6ef6('0x29')](function(_0x1c571a){_0x292d58[_0x6ef6('0x51')]=_0x1c571a;return _0x292d58;});}})[_0x6ef6('0x29')](respondWithFilteredResult(_0x8c775c,_0x291f90))[_0x6ef6('0x52')](handleError(_0x8c775c,null));};exports[_0x6ef6('0x6c')]=function(_0x16c53c,_0x4be0b3,_0x45737d){var _0x4cf81a={};var _0x94ddc5={};var _0x23709f;var _0x25a772;return db[_0x6ef6('0x4f')][_0x6ef6('0x67')]({'where':{'id':_0x16c53c['params']['id']}})['then'](handleEntityNotFound(_0x4be0b3,null))[_0x6ef6('0x29')](function(_0x50370d){if(_0x50370d){_0x23709f=_0x50370d;_0x94ddc5[_0x6ef6('0x3d')]=_['keys'](db[_0x6ef6('0x6d')][_0x6ef6('0x3a')]);_0x94ddc5[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x16c53c[_0x6ef6('0x3f')]);_0x94ddc5[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x94ddc5[_0x6ef6('0x3d')],_0x94ddc5['query']);_0x4cf81a[_0x6ef6('0x42')]=_[_0x6ef6('0x41')](_0x94ddc5['model'],qs[_0x6ef6('0x43')](_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x4cf81a['attributes']=_0x4cf81a[_0x6ef6('0x42')]['length']?_0x4cf81a[_0x6ef6('0x42')]:_0x94ddc5[_0x6ef6('0x3d')];_0x4cf81a[_0x6ef6('0x46')]=qs[_0x6ef6('0x47')](_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x47')]);_0x4cf81a[_0x6ef6('0x48')]=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x16c53c[_0x6ef6('0x3f')],_0x94ddc5['filters']));if(_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x4cf81a[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x4cf81a[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x4cf81a[_0x6ef6('0x42')],function(_0x104720){var _0x216614={};_0x216614[_0x104720]={'$like':'%'+_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x216614;})});}_0x4cf81a=_[_0x6ef6('0x4b')]({},_0x4cf81a,_0x16c53c[_0x6ef6('0x4c')]);return _0x23709f['getTeams'](_0x4cf81a);}})[_0x6ef6('0x29')](function(_0x504c51){if(_0x504c51){_0x25a772=_0x504c51[_0x6ef6('0x44')];if(!_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x64')](_0x6ef6('0x45'))){_0x4cf81a[_0x6ef6('0x23')]=qs['limit'](_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x4cf81a[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x16c53c[_0x6ef6('0x3f')][_0x6ef6('0x21')]);}return _0x23709f['getTeams'](_0x4cf81a);}})[_0x6ef6('0x29')](function(_0x406e52){if(_0x406e52){return _0x406e52?{'count':_0x25a772,'rows':_0x406e52}:null;}})[_0x6ef6('0x29')](respondWithResult(_0x4be0b3,null))[_0x6ef6('0x52')](handleError(_0x4be0b3,null));};exports[_0x6ef6('0x6e')]=function(_0x547672,_0x36e4ce,_0x1e8424){var _0x3bafa6=_0x547672[_0x6ef6('0x55')][_0x6ef6('0x6f')];var _0x19380a=_[_0x6ef6('0x32')](_0x3bafa6,'id');return db[_0x6ef6('0x6d')][_0x6ef6('0x50')]({'where':{'id':_0x19380a},'attributes':['id'],'include':[{'model':db[_0x6ef6('0x70')],'as':_0x6ef6('0x71'),'attributes':['id',_0x6ef6('0x37'),'online','voicePause',_0x6ef6('0x72')],'raw':!![]}]})['then'](function(_0x2affc0){if(_0x2affc0){var _0x2330f7=_[_0x6ef6('0x73')](_0x2affc0,function(_0x377f23){var _0x51171c=_0x377f23[_0x6ef6('0x2b')]({'plain':!![]});_0x51171c[_0x6ef6('0x71')]['forEach'](function(_0x266973){_0x266973[_0x6ef6('0x74')]=_[_0x6ef6('0x36')](_0x3bafa6,{'id':_0x51171c['id']})['penalty'];});return _0x51171c[_0x6ef6('0x71')];});return db[_0x6ef6('0x4f')][_0x6ef6('0x36')]({'where':{'id':_0x547672[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](function(_0x55fe99){return db[_0x6ef6('0x75')]['transaction'](function(_0xee89c9){return _0x55fe99[_0x6ef6('0x6e')](_0x19380a,{'transaction':_0xee89c9})[_0x6ef6('0x29')](function(){return BPromise[_0x6ef6('0x76')](_0x3bafa6,function(_0x2390d1){return db['TeamVoiceQueue'][_0x6ef6('0x77')]({'TeamId':_0x2390d1['id'],'VoiceQueueId':_0x547672[_0x6ef6('0x5c')]['id'],'penalty':_0x2390d1[_0x6ef6('0x74')]},{'transaction':_0xee89c9});});})[_0x6ef6('0x29')](function(){return BPromise['each'](_0x2330f7,function(_0x4208ba){return db['UserVoiceQueue'][_0x6ef6('0x78')]({'where':{'UserId':_0x4208ba['id'],'VoiceQueueId':_0x547672['params']['id']},'defaults':{'penalty':_0x4208ba[_0x6ef6('0x74')]},'transaction':_0xee89c9});});})['then'](function(){return BPromise['each'](_[_0x6ef6('0x30')](_0x2330f7,{'online':!![]}),function(_0x25a137){return db['UserVoiceQueueRt']['upsert']({'membername':_0x25a137[_0x6ef6('0x37')],'UserId':_0x25a137['id'],'queue_name':_0x55fe99['name'],'VoiceQueueId':_0x55fe99['id'],'interface':_[_0x6ef6('0x79')](_0x25a137['interface'])?util[_0x6ef6('0x7a')](_0x6ef6('0x7b'),_0x25a137[_0x6ef6('0x37')]):_0x25a137[_0x6ef6('0x72')],'paused':_0x25a137[_0x6ef6('0x7c')]||![],'penalty':_0x25a137['penalty']},{'transaction':_0xee89c9});});})['then'](function(){_0x2330f7['forEach'](function(_0x1237c4){socket[_0x6ef6('0x7d')](_0x6ef6('0x7e'),{'UserId':_0x1237c4['id'],'VoiceQueueId':_0x55fe99['id']});});});});});}})[_0x6ef6('0x29')](respondWithStatusCode(_0x36e4ce,null))[_0x6ef6('0x52')](handleError(_0x36e4ce,null));};exports[_0x6ef6('0x7f')]=function(_0x256328,_0x373937,_0x176f12){return db['Team']['findAll']({'where':{'id':_0x256328['query'][_0x6ef6('0x80')]},'attributes':['id'],'include':[{'model':db[_0x6ef6('0x70')],'as':_0x6ef6('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x373937,null))[_0x6ef6('0x29')](function(_0x5b2fb4){var _0x3691a0=_[_0x6ef6('0x32')](_0x5b2fb4,'id');var _0x2ddeec=[];var _0x5e9224=[];var _0x1975c0=squel[_0x6ef6('0x81')]();_0x1975c0[_0x6ef6('0x82')](_0x6ef6('0x83'))[_0x6ef6('0x84')]('team_has_voice_queues','tq')['join'](_0x6ef6('0x85'),'ut',_0x6ef6('0x86'))[_0x6ef6('0x48')](_0x6ef6('0x87'),_0x256328['params']['id']);for(var _0x2ed386=0x0;_0x2ed386<_0x5b2fb4[_0x6ef6('0x44')];_0x2ed386+=0x1){let _0x479784=_0x5b2fb4[_0x2ed386];for(var _0x57b44b=0x0;_0x57b44b<_0x479784[_0x6ef6('0x71')]['length'];_0x57b44b+=0x1){let _0x2eac13=_0x479784[_0x6ef6('0x71')][_0x57b44b];var _0x331a40=_0x1975c0[_0x6ef6('0x5b')]();_0x331a40['where'](_0x6ef6('0x88'),_0x2eac13['id']);_0x5e9224[_0x6ef6('0x89')](db[_0x6ef6('0x75')][_0x6ef6('0x3f')](_0x331a40[_0x6ef6('0x8a')](),{'type':db[_0x6ef6('0x75')][_0x6ef6('0x8b')][_0x6ef6('0x8c')]})[_0x6ef6('0x29')](function(_0x2ad20a){if(_0x2ad20a['length']===0x1){return _0x2eac13['id'];}else{var _0x576d9d=_[_0x6ef6('0x8d')](_['map'](_0x2ad20a,'TeamId'),function(_0x32b9d5){return _[_0x6ef6('0x34')](_0x3691a0,_0x32b9d5);});if(_0x576d9d){return _0x2eac13['id'];}}}));}}return BPromise['all'](_0x5e9224)[_0x6ef6('0x29')](function(_0x248c75){_0x2ddeec=_(_0x2ddeec)[_0x6ef6('0x8e')](_0x248c75)[_0x6ef6('0x8f')]()[_0x6ef6('0x33')]();return db['VoiceQueue'][_0x6ef6('0x36')]({'where':{'id':_0x256328[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](function(_0x29d2db){return db[_0x6ef6('0x75')]['transaction'](function(_0x121440){return _0x29d2db[_0x6ef6('0x7f')](_0x256328[_0x6ef6('0x3f')][_0x6ef6('0x80')],{'transaction':_0x121440})[_0x6ef6('0x29')](function(){if(!_[_0x6ef6('0x90')](_0x2ddeec)){return _0x29d2db['removeAgents'](_0x2ddeec,{'transaction':_0x121440})[_0x6ef6('0x29')](function(){return db['UserVoiceQueueRt'][_0x6ef6('0x2a')]({'where':{'VoiceQueueId':_0x256328[_0x6ef6('0x5c')]['id'],'UserId':_0x2ddeec},'transaction':_0x121440});});}})['then'](function(){_0x2ddeec['forEach'](function(_0x462ccb){socket[_0x6ef6('0x7d')](_0x6ef6('0x91'),{'UserId':_0x462ccb,'VoiceQueueId':_0x29d2db['id']});});});});});});})['then'](respondWithStatusCode(_0x373937,null))[_0x6ef6('0x52')](handleError(_0x373937,null));};exports[_0x6ef6('0x92')]=function(_0x108617,_0x2ce2ff,_0x18fb4f){var _0x4c1b03,_0x556e5b;return db[_0x6ef6('0x4f')]['find']({'where':{'id':_0x108617[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x2ce2ff,null))[_0x6ef6('0x29')](function(_0x527ec4){if(_0x527ec4){_0x556e5b=_0x527ec4;return _0x527ec4['addAgents'](_0x108617[_0x6ef6('0x55')]['ids'],_[_0x6ef6('0x5f')](_0x108617[_0x6ef6('0x55')],[_0x6ef6('0x80'),'id'])||{})[_0x6ef6('0x93')](function(_0x5b26b9){for(var _0x2369a7=0x0;_0x2369a7<_0x108617[_0x6ef6('0x55')]['ids']['length'];_0x2369a7+=0x1){socket[_0x6ef6('0x7d')](_0x6ef6('0x7e'),{'UserId':Number(_0x108617['body'][_0x6ef6('0x80')][_0x2369a7]),'VoiceQueueId':Number(_0x108617[_0x6ef6('0x5c')]['id'])});}return _0x5b26b9;});}})[_0x6ef6('0x29')](function(_0x3bff3d){_0x4c1b03=_0x3bff3d||[];if(_0x556e5b){return db[_0x6ef6('0x70')][_0x6ef6('0x50')]({'where':{'id':_0x108617[_0x6ef6('0x55')][_0x6ef6('0x80')]},'attributes':['id','name','online','voicePause',_0x6ef6('0x72')],'raw':!![]});}})[_0x6ef6('0x29')](function(_0x466f4a){if(!_[_0x6ef6('0x90')](_0x466f4a)){var _0x108634=[];for(var _0x88f564=0x0;_0x88f564<_0x466f4a['length'];_0x88f564++){if(_0x466f4a[_0x88f564][_0x6ef6('0x94')]){_0x108634[_0x6ef6('0x89')](db[_0x6ef6('0x95')][_0x6ef6('0x77')]({'membername':_0x466f4a[_0x88f564][_0x6ef6('0x37')],'UserId':_0x466f4a[_0x88f564]['id'],'queue_name':_0x556e5b[_0x6ef6('0x37')],'VoiceQueueId':_0x556e5b['id'],'interface':_[_0x6ef6('0x79')](_0x466f4a[_0x88f564][_0x6ef6('0x72')])?util[_0x6ef6('0x7a')](_0x6ef6('0x7b'),_0x466f4a[_0x88f564][_0x6ef6('0x37')]):_0x466f4a[_0x88f564][_0x6ef6('0x72')],'paused':_0x466f4a[_0x88f564][_0x6ef6('0x7c')]||![],'penalty':_0x108617['body'][_0x6ef6('0x74')]||0x0}));}}return BPromise['all'](_0x108634);}})[_0x6ef6('0x29')](function(){return _0x4c1b03;})['then'](respondWithResult(_0x2ce2ff,null))[_0x6ef6('0x52')](handleError(_0x2ce2ff,null));};exports['removeAgents']=function(_0x35ebae,_0x1047b1,_0x331c56){return db[_0x6ef6('0x4f')][_0x6ef6('0x36')]({'where':{'id':_0x35ebae[_0x6ef6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1047b1,null))[_0x6ef6('0x29')](function(_0x4710cb){if(_0x4710cb){return _0x4710cb['removeAgents'](_0x35ebae[_0x6ef6('0x3f')][_0x6ef6('0x80')])[_0x6ef6('0x29')](function(){if(_['isArray'](_0x35ebae[_0x6ef6('0x3f')][_0x6ef6('0x80')])){for(var _0x5bc045=0x0;_0x5bc045<_0x35ebae[_0x6ef6('0x3f')][_0x6ef6('0x80')][_0x6ef6('0x44')];_0x5bc045+=0x1){socket[_0x6ef6('0x7d')](_0x6ef6('0x91'),{'UserId':Number(_0x35ebae[_0x6ef6('0x3f')][_0x6ef6('0x80')][_0x5bc045]),'VoiceQueueId':Number(_0x35ebae[_0x6ef6('0x5c')]['id'])});}}else{socket['emit'](_0x6ef6('0x91'),{'UserId':Number(_0x35ebae[_0x6ef6('0x3f')][_0x6ef6('0x80')]),'VoiceQueueId':Number(_0x35ebae['params']['id'])});}});}})['then'](function(_0x273eff){return db[_0x6ef6('0x95')]['destroy']({'where':{'VoiceQueueId':_0x35ebae[_0x6ef6('0x5c')]['id'],'UserId':_0x35ebae[_0x6ef6('0x3f')]['ids']}})[_0x6ef6('0x29')](function(){return _0x273eff;});})['then'](respondWithStatusCode(_0x1047b1,null))[_0x6ef6('0x52')](handleError(_0x1047b1,null));};exports['getAgents']=function(_0x18a0b7,_0x1d1073,_0x3321ab){var _0xa990f5={};var _0x1e7d64={};var _0x5def5a;var _0x405ad0;return db[_0x6ef6('0x4f')][_0x6ef6('0x67')]({'where':{'id':_0x18a0b7['params']['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x1d1073,null))[_0x6ef6('0x29')](function(_0x44c744){if(_0x44c744){_0x5def5a=_0x44c744;_0x1e7d64['model']=_['keys'](db['User']['rawAttributes']);_0x1e7d64['query']=_[_0x6ef6('0x3e')](_0x18a0b7[_0x6ef6('0x3f')]);_0x1e7d64[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x1e7d64['model'],_0x1e7d64['query']);_0xa990f5[_0x6ef6('0x42')]=_[_0x6ef6('0x41')](_0x1e7d64['model'],qs['fields'](_0x18a0b7['query']['fields']));_0xa990f5[_0x6ef6('0x42')]=_0xa990f5[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0xa990f5[_0x6ef6('0x42')]:_0x1e7d64[_0x6ef6('0x3d')];_0xa990f5['order']=qs['sort'](_0x18a0b7[_0x6ef6('0x3f')]['sort']);_0xa990f5['where']=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x18a0b7['query'],_0x1e7d64[_0x6ef6('0x40')]));if(_0x18a0b7['query'][_0x6ef6('0x30')]){_0xa990f5['where']=_[_0x6ef6('0x4b')](_0xa990f5[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0xa990f5[_0x6ef6('0x42')],function(_0x493eff){var _0x40b0e4={};_0x40b0e4[_0x493eff]={'$like':'%'+_0x18a0b7['query'][_0x6ef6('0x30')]+'%'};return _0x40b0e4;})});}_0xa990f5=_['merge']({},_0xa990f5,_0x18a0b7[_0x6ef6('0x4c')]);return _0x5def5a['getAgents'](_0xa990f5);}})[_0x6ef6('0x29')](function(_0x6fe77d){if(_0x6fe77d){_0x405ad0=_0x6fe77d[_0x6ef6('0x44')];if(!_0x18a0b7[_0x6ef6('0x3f')][_0x6ef6('0x64')](_0x6ef6('0x45'))){_0xa990f5[_0x6ef6('0x23')]=qs['limit'](_0x18a0b7[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0xa990f5[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x18a0b7[_0x6ef6('0x3f')][_0x6ef6('0x21')]);}return _0x5def5a[_0x6ef6('0x96')](_0xa990f5);}})[_0x6ef6('0x29')](function(_0x2c49dd){if(_0x2c49dd){return _0x2c49dd?{'count':_0x405ad0,'rows':_0x2c49dd}:null;}})[_0x6ef6('0x29')](respondWithResult(_0x1d1073,null))[_0x6ef6('0x52')](handleError(_0x1d1073,null));};exports[_0x6ef6('0x97')]=function(_0x4aedeb,_0x193508,_0x47e358){var _0x2c15a9={};var _0x1e61fc={};var _0x4c5a70;var _0x38c80a;return db['VoiceQueue'][_0x6ef6('0x67')]({'where':{'id':_0x4aedeb[_0x6ef6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x193508,null))[_0x6ef6('0x29')](function(_0x4ca57d){if(_0x4ca57d){_0x4c5a70=_0x4ca57d;_0x1e61fc[_0x6ef6('0x3d')]=_['keys'](db[_0x6ef6('0x95')]['rawAttributes']);_0x1e61fc['query']=_[_0x6ef6('0x3e')](_0x4aedeb['query']);_0x1e61fc[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x1e61fc[_0x6ef6('0x3d')],_0x1e61fc['query']);_0x2c15a9[_0x6ef6('0x42')]=_['intersection'](_0x1e61fc['model'],qs['fields'](_0x4aedeb['query'][_0x6ef6('0x43')]));_0x2c15a9[_0x6ef6('0x42')]=_0x2c15a9[_0x6ef6('0x42')]['length']?_0x2c15a9[_0x6ef6('0x42')]:_0x1e61fc[_0x6ef6('0x3d')];_0x2c15a9['order']=qs[_0x6ef6('0x47')](_0x4aedeb[_0x6ef6('0x3f')]['sort']);_0x2c15a9[_0x6ef6('0x48')]=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x4aedeb['query'],_0x1e61fc[_0x6ef6('0x40')]));if(_0x4aedeb[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x2c15a9[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x2c15a9[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x2c15a9[_0x6ef6('0x42')],function(_0x43a6f9){var _0x5dca43={};_0x5dca43[_0x43a6f9]={'$like':'%'+_0x4aedeb['query'][_0x6ef6('0x30')]+'%'};return _0x5dca43;})});}_0x2c15a9=_[_0x6ef6('0x4b')]({},_0x2c15a9,_0x4aedeb[_0x6ef6('0x4c')]);return _0x4c5a70[_0x6ef6('0x97')](_0x2c15a9);}})[_0x6ef6('0x29')](function(_0x20f0c1){if(_0x20f0c1){_0x38c80a=_0x20f0c1[_0x6ef6('0x44')];if(!_0x4aedeb[_0x6ef6('0x3f')]['hasOwnProperty']('nolimit')){_0x2c15a9[_0x6ef6('0x23')]=qs[_0x6ef6('0x23')](_0x4aedeb[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x2c15a9['offset']=qs[_0x6ef6('0x21')](_0x4aedeb[_0x6ef6('0x3f')][_0x6ef6('0x21')]);}return _0x4c5a70[_0x6ef6('0x97')](_0x2c15a9);}})['then'](function(_0x4af3e0){return _0x4af3e0?{'count':_0x38c80a,'rows':_0x4af3e0}:null;})[_0x6ef6('0x29')](respondWithResult(_0x193508,null))[_0x6ef6('0x52')](handleError(_0x193508,null));};exports[_0x6ef6('0x98')]=function(_0x16f6c2,_0x354caa,_0x34a887){var _0x2bfd7d={};var _0x518571={};var _0x239f99;var _0x15c215;return db[_0x6ef6('0x4f')][_0x6ef6('0x67')]({'where':{'id':_0x16f6c2[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x354caa,null))[_0x6ef6('0x29')](function(_0x59289e){if(_0x59289e){_0x239f99=_0x59289e;_0x518571[_0x6ef6('0x3d')]=_[_0x6ef6('0x3e')](db['CmList'][_0x6ef6('0x3a')]);_0x518571[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x16f6c2[_0x6ef6('0x3f')]);_0x518571['filters']=_[_0x6ef6('0x41')](_0x518571[_0x6ef6('0x3d')],_0x518571[_0x6ef6('0x3f')]);_0x2bfd7d['attributes']=_['intersection'](_0x518571['model'],qs[_0x6ef6('0x43')](_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x43')]));_0x2bfd7d[_0x6ef6('0x42')]=_0x2bfd7d[_0x6ef6('0x42')][_0x6ef6('0x44')]?_0x2bfd7d['attributes']:_0x518571[_0x6ef6('0x3d')];_0x2bfd7d[_0x6ef6('0x46')]=qs[_0x6ef6('0x47')](_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x47')]);_0x2bfd7d[_0x6ef6('0x48')]=qs[_0x6ef6('0x40')](_['pick'](_0x16f6c2[_0x6ef6('0x3f')],_0x518571[_0x6ef6('0x40')]));if(_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x30')]){_0x2bfd7d[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x2bfd7d[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x2bfd7d[_0x6ef6('0x42')],function(_0x4534d1){var _0x51abf6={};_0x51abf6[_0x4534d1]={'$like':'%'+_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x51abf6;})});}_0x2bfd7d=_[_0x6ef6('0x4b')]({},_0x2bfd7d,_0x16f6c2[_0x6ef6('0x4c')]);return _0x239f99[_0x6ef6('0x98')](_0x2bfd7d);}})['then'](function(_0x328538){if(_0x328538){_0x15c215=_0x328538[_0x6ef6('0x44')];if(!_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x64')](_0x6ef6('0x45'))){_0x2bfd7d[_0x6ef6('0x23')]=qs[_0x6ef6('0x23')](_0x16f6c2[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x2bfd7d[_0x6ef6('0x21')]=qs[_0x6ef6('0x21')](_0x16f6c2[_0x6ef6('0x3f')]['offset']);}return _0x239f99[_0x6ef6('0x98')](_0x2bfd7d);}})[_0x6ef6('0x29')](function(_0x33f369){if(_0x33f369){return _0x33f369?{'count':_0x15c215,'rows':_0x33f369}:null;}})['then'](respondWithResult(_0x354caa,null))[_0x6ef6('0x52')](handleError(_0x354caa,null));};exports[_0x6ef6('0x99')]=function(_0x37747f,_0x32c170,_0x30ecc3){var _0x469e54=moment()[_0x6ef6('0x7a')](_0x6ef6('0x9a'));var _0x4c914c,_0x4faebd;return db[_0x6ef6('0x4f')][_0x6ef6('0x36')]({'where':{'id':_0x37747f['params']['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x32c170,null))['then'](function(_0x43f543){if(_0x43f543){_0x4faebd=_0x43f543;return _0x43f543[_0x6ef6('0x99')](_0x37747f[_0x6ef6('0x55')][_0x6ef6('0x80')],_['omit'](_0x37747f[_0x6ef6('0x55')],['ids','id'])||{});}return null;})[_0x6ef6('0x93')](function(_0x26228d){var _0x3a6396;_0x4c914c=_0x26228d||[];var _0x23851c=[];if(_0x26228d){for(var _0x8884c3=0x0;_0x8884c3<_0x26228d['length'];_0x8884c3+=0x1){var _0x36506c=_0x26228d[_0x8884c3]['get']({'plain':!![]});_0x4faebd[_0x6ef6('0x9b')]=_0x37747f[_0x6ef6('0x55')]['dialCheckDuplicateType']?_0x37747f[_0x6ef6('0x55')][_0x6ef6('0x9b')]:_0x4faebd[_0x6ef6('0x9b')];switch(_0x4faebd['dialCheckDuplicateType']){case _0x6ef6('0x9c'):_0x3a6396=squel[_0x6ef6('0x9d')]()['into'](_0x6ef6('0x9e'))['fromQuery']([_0x6ef6('0x9f'),'scheduledAt',_0x6ef6('0xa0'),_0x6ef6('0xa1'),_0x6ef6('0x65'),_0x6ef6('0x5d'),'updatedAt'],squel['select']()[_0x6ef6('0x82')](_0x6ef6('0x9f'),_0x6ef6('0x9f'))['field']('\x27'+_0x469e54+'\x27','scheduledAt')['field']('id',_0x6ef6('0xa0'))[_0x6ef6('0x82')](_0x36506c[_0x6ef6('0xa2')][_0x6ef6('0x8a')](),_0x6ef6('0xa1'))[_0x6ef6('0x82')](_0x37747f['params']['id'][_0x6ef6('0x8a')](),_0x6ef6('0x65'))[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0x5d'))[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0x5e'))[_0x6ef6('0x84')]('cm_contacts')[_0x6ef6('0x48')](_0x6ef6('0xa3'))[_0x6ef6('0x48')]('ListId\x20=\x20?',_0x36506c[_0x6ef6('0xa2')][_0x6ef6('0x8a')]())[_0x6ef6('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x6ef6('0x48')](_0x6ef6('0xa4'),squel[_0x6ef6('0x81')]()[_0x6ef6('0x82')](_0x6ef6('0xa5'))[_0x6ef6('0x84')](_0x6ef6('0xa6'))[_0x6ef6('0x48')](_0x6ef6('0x87'),_0x37747f['params']['id'][_0x6ef6('0x8a')]()))[_0x6ef6('0x48')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x6ef6('0xa7'))[_0x6ef6('0x84')](_0x6ef6('0x9e'))['where'](_0x6ef6('0x87'),_0x37747f[_0x6ef6('0x5c')]['id'][_0x6ef6('0x8a')]())))[_0x6ef6('0x8a')]();break;case'onlyIfOpen':_0x3a6396=squel[_0x6ef6('0x9d')]()[_0x6ef6('0xa8')](_0x6ef6('0x9e'))[_0x6ef6('0xa9')]([_0x6ef6('0x9f'),_0x6ef6('0xaa'),_0x6ef6('0xa0'),_0x6ef6('0xa1'),'VoiceQueueId',_0x6ef6('0x5d'),'updatedAt'],squel['select']()[_0x6ef6('0x82')]('phone',_0x6ef6('0x9f'))[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0xaa'))['field']('id','ContactId')[_0x6ef6('0x82')](_0x36506c[_0x6ef6('0xa2')][_0x6ef6('0x8a')](),_0x6ef6('0xa1'))[_0x6ef6('0x82')](_0x37747f[_0x6ef6('0x5c')]['id'][_0x6ef6('0x8a')](),'VoiceQueueId')[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27','createdAt')[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0x5e'))['from'](_0x6ef6('0xab'))[_0x6ef6('0x48')](_0x6ef6('0xa3'))[_0x6ef6('0x48')](_0x6ef6('0xac'),_0x36506c[_0x6ef6('0xa2')][_0x6ef6('0x8a')]())['where'](_0x6ef6('0xad'))[_0x6ef6('0x48')](_0x6ef6('0xa4'),squel[_0x6ef6('0x81')]()[_0x6ef6('0x82')](_0x6ef6('0xa7'))[_0x6ef6('0x84')](_0x6ef6('0x9e'))[_0x6ef6('0x48')](_0x6ef6('0x87'),_0x37747f['params']['id'][_0x6ef6('0x8a')]())))[_0x6ef6('0x8a')]();break;default:_0x3a6396=squel[_0x6ef6('0x9d')]()[_0x6ef6('0xa8')](_0x6ef6('0x9e'))[_0x6ef6('0xa9')]([_0x6ef6('0x9f'),'scheduledAt',_0x6ef6('0xa0'),_0x6ef6('0xa1'),'VoiceQueueId',_0x6ef6('0x5d'),'updatedAt'],squel[_0x6ef6('0x81')]()['field']('phone',_0x6ef6('0x9f'))['field']('\x27'+_0x469e54+'\x27',_0x6ef6('0xaa'))[_0x6ef6('0x82')]('id','ContactId')['field'](_0x36506c[_0x6ef6('0xa2')][_0x6ef6('0x8a')](),_0x6ef6('0xa1'))['field'](_0x37747f[_0x6ef6('0x5c')]['id'][_0x6ef6('0x8a')](),_0x6ef6('0x65'))['field']('\x27'+_0x469e54+'\x27',_0x6ef6('0x5d'))[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0x5e'))[_0x6ef6('0x84')]('cm_contacts')[_0x6ef6('0x48')](_0x6ef6('0xa3'))[_0x6ef6('0x48')](_0x6ef6('0xac'),_0x36506c[_0x6ef6('0xa2')]['toString']())[_0x6ef6('0x48')]('phone\x20IS\x20NOT\x20NULL'))[_0x6ef6('0x8a')]();}_0x23851c[_0x6ef6('0x89')](db['sequelize'][_0x6ef6('0x3f')](_0x3a6396));}return BPromise[_0x6ef6('0xae')](_0x23851c);}})[_0x6ef6('0x29')](function(){var _0x1c1e11=[];var _0x1d1243=squel[_0x6ef6('0x9d')]()[_0x6ef6('0xa8')](_0x6ef6('0xaf'))[_0x6ef6('0xa9')]([_0x6ef6('0xb0'),_0x6ef6('0x9f'),_0x6ef6('0xb1'),_0x6ef6('0x5d'),_0x6ef6('0x5e')],squel[_0x6ef6('0x81')]()['field']('h.id')['field']('ci.item')['field'](_0x6ef6('0xb2'))['field']('\x27'+_0x469e54+'\x27',_0x6ef6('0x5d'))[_0x6ef6('0x82')]('\x27'+_0x469e54+'\x27',_0x6ef6('0x5e'))[_0x6ef6('0x84')](_0x6ef6('0xb3'),'ci')[_0x6ef6('0xb4')](_0x6ef6('0x9e'),'h','h.ContactId=ci.CmContactId')[_0x6ef6('0x48')]('h.scheduledat=?',_0x469e54)['where'](_0x6ef6('0xb5'),_0x6ef6('0xb6')))[_0x6ef6('0x8a')]();_0x1c1e11['push'](db[_0x6ef6('0x75')][_0x6ef6('0x3f')](_0x1d1243));return BPromise[_0x6ef6('0xae')](_0x1c1e11);})[_0x6ef6('0x29')](function(){return _0x4c914c;})[_0x6ef6('0x29')](respondWithResult(_0x32c170,null))['catch'](handleError(_0x32c170,null));};exports['removeLists']=function(_0x3ec248,_0x2d7880,_0x202b9){return db[_0x6ef6('0x4f')][_0x6ef6('0x36')]({'where':{'id':_0x3ec248['params']['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x2d7880,null))[_0x6ef6('0x29')](function(_0x4cabe2){if(_0x4cabe2){return _0x4cabe2[_0x6ef6('0xb7')](_0x3ec248[_0x6ef6('0x3f')][_0x6ef6('0x80')]);}})[_0x6ef6('0x29')](function(_0x32036f){if(_0x32036f){return db[_0x6ef6('0x66')][_0x6ef6('0x2a')]({'where':{'ListId':_0x3ec248['query'][_0x6ef6('0x80')],'VoiceQueueId':_0x3ec248[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](function(){return _0x32036f;});}})[_0x6ef6('0x29')](respondWithStatusCode(_0x2d7880,null))[_0x6ef6('0x52')](handleError(_0x2d7880,null));};exports[_0x6ef6('0xb8')]=function(_0x2d4ee6,_0x582116,_0x220a66){var _0x320a9e={};var _0x3a48a7={};var _0x4fd0b8;var _0x222e7e;return db['VoiceQueue'][_0x6ef6('0x67')]({'where':{'id':_0x2d4ee6[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x582116,null))[_0x6ef6('0x29')](function(_0x15c5c4){if(_0x15c5c4){_0x4fd0b8=_0x15c5c4;_0x3a48a7[_0x6ef6('0x3d')]=_[_0x6ef6('0x3e')](db[_0x6ef6('0xb9')][_0x6ef6('0x3a')]);_0x3a48a7[_0x6ef6('0x3f')]=_[_0x6ef6('0x3e')](_0x2d4ee6[_0x6ef6('0x3f')]);_0x3a48a7[_0x6ef6('0x40')]=_[_0x6ef6('0x41')](_0x3a48a7[_0x6ef6('0x3d')],_0x3a48a7[_0x6ef6('0x3f')]);_0x320a9e[_0x6ef6('0x42')]=_[_0x6ef6('0x41')](_0x3a48a7['model'],qs[_0x6ef6('0x43')](_0x2d4ee6[_0x6ef6('0x3f')]['fields']));_0x320a9e[_0x6ef6('0x42')]=_0x320a9e['attributes']['length']?_0x320a9e[_0x6ef6('0x42')]:_0x3a48a7[_0x6ef6('0x3d')];_0x320a9e[_0x6ef6('0x46')]=qs['sort'](_0x2d4ee6[_0x6ef6('0x3f')]['sort']);_0x320a9e['where']=qs[_0x6ef6('0x40')](_[_0x6ef6('0x49')](_0x2d4ee6[_0x6ef6('0x3f')],_0x3a48a7[_0x6ef6('0x40')]));if(_0x2d4ee6[_0x6ef6('0x3f')]['filter']){_0x320a9e[_0x6ef6('0x48')]=_[_0x6ef6('0x4b')](_0x320a9e[_0x6ef6('0x48')],{'$or':_[_0x6ef6('0x32')](_0x320a9e[_0x6ef6('0x42')],function(_0x32c85c){var _0x235df3={};_0x235df3[_0x32c85c]={'$like':'%'+_0x2d4ee6[_0x6ef6('0x3f')][_0x6ef6('0x30')]+'%'};return _0x235df3;})});}_0x320a9e=_[_0x6ef6('0x4b')]({},_0x320a9e,_0x2d4ee6[_0x6ef6('0x4c')]);return _0x4fd0b8[_0x6ef6('0xb8')](_0x320a9e);}})[_0x6ef6('0x29')](function(_0x495bce){if(_0x495bce){_0x222e7e=_0x495bce[_0x6ef6('0x44')];if(!_0x2d4ee6[_0x6ef6('0x3f')][_0x6ef6('0x64')](_0x6ef6('0x45'))){_0x320a9e[_0x6ef6('0x23')]=qs[_0x6ef6('0x23')](_0x2d4ee6[_0x6ef6('0x3f')][_0x6ef6('0x23')]);_0x320a9e[_0x6ef6('0x21')]=qs['offset'](_0x2d4ee6[_0x6ef6('0x3f')]['offset']);}return _0x4fd0b8[_0x6ef6('0xb8')](_0x320a9e);}})[_0x6ef6('0x29')](function(_0x2e1609){if(_0x2e1609){return _0x2e1609?{'count':_0x222e7e,'rows':_0x2e1609}:null;}})[_0x6ef6('0x29')](respondWithResult(_0x582116,null))[_0x6ef6('0x52')](handleError(_0x582116,null));};exports[_0x6ef6('0xba')]=function(_0x3b2aee,_0x111adf,_0x1de26c){var _0x33b673,_0x412132;return db[_0x6ef6('0x4f')]['find']({'where':{'id':_0x3b2aee[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x111adf,null))['then'](function(_0xa05c0e){if(_0xa05c0e){_0x412132=_0xa05c0e;return _0xa05c0e[_0x6ef6('0xba')](_0x3b2aee[_0x6ef6('0x55')][_0x6ef6('0x80')],_['omit'](_0x3b2aee['body'],[_0x6ef6('0x80'),'id'])||{});}return null;})[_0x6ef6('0x93')](function(_0x7e1435){var _0x2f186d;_0x33b673=_0x7e1435||[];var _0x108eb1=[];if(_0x7e1435){for(var _0x44ea37=0x0;_0x44ea37<_0x7e1435[_0x6ef6('0x44')];_0x44ea37+=0x1){var _0x5ab4da=_0x7e1435[_0x44ea37]['get']({'plain':!![]});_0x2f186d=squel['insert']()[_0x6ef6('0xa8')](_0x6ef6('0xbb'))['fromQuery'](['phone',_0x6ef6('0xa0'),'ListId',_0x6ef6('0x65'),_0x6ef6('0x5d'),'updatedAt'],squel[_0x6ef6('0x81')]()[_0x6ef6('0x82')](_0x6ef6('0x9f'),_0x6ef6('0x9f'))[_0x6ef6('0x82')]('id','ContactId')[_0x6ef6('0x82')](_0x5ab4da[_0x6ef6('0xa2')]['toString'](),_0x6ef6('0xa1'))[_0x6ef6('0x82')](_0x3b2aee[_0x6ef6('0x5c')]['id'][_0x6ef6('0x8a')](),_0x6ef6('0x65'))[_0x6ef6('0x82')](_0x6ef6('0xbc'),_0x6ef6('0x5d'))[_0x6ef6('0x82')](_0x6ef6('0xbc'),'updatedAt')[_0x6ef6('0x84')]('cm_contacts')[_0x6ef6('0x48')]('deletedAt\x20IS\x20NULL')[_0x6ef6('0x48')](_0x6ef6('0xac'),_0x5ab4da['CmListId'][_0x6ef6('0x8a')]())[_0x6ef6('0x48')](_0x6ef6('0xad')))[_0x6ef6('0x8a')]();_0x108eb1['push'](db[_0x6ef6('0x75')][_0x6ef6('0x3f')](_0x2f186d));}return BPromise[_0x6ef6('0xae')](_0x108eb1);}})[_0x6ef6('0x29')](function(){return _0x33b673;})[_0x6ef6('0x29')](respondWithResult(_0x111adf,null))[_0x6ef6('0x52')](handleError(_0x111adf,null));};exports[_0x6ef6('0xbd')]=function(_0x35968f,_0x3eda56,_0x591939){return db[_0x6ef6('0x4f')]['find']({'where':{'id':_0x35968f[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](handleEntityNotFound(_0x3eda56,null))[_0x6ef6('0x29')](function(_0x286d3d){if(_0x286d3d){return _0x286d3d[_0x6ef6('0xbd')](_0x35968f[_0x6ef6('0x3f')]['ids']);}})['then'](function(_0x526e47){if(_0x526e47){return db[_0x6ef6('0x6b')][_0x6ef6('0x2a')]({'where':{'ListId':_0x35968f[_0x6ef6('0x3f')]['ids'],'VoiceQueueId':_0x35968f[_0x6ef6('0x5c')]['id']}})[_0x6ef6('0x29')](function(){return _0x526e47;});}})[_0x6ef6('0x29')](respondWithStatusCode(_0x3eda56,null))[_0x6ef6('0x52')](handleError(_0x3eda56,null));}; \ No newline at end of file +var _0x9bdb=['options','include','findAll','rows','catch','show','params','fields','includeAll','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','findOne','hasOwnProperty','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','User','online','voicePause','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','TeamVoiceQueue','upsert','UserVoiceQueue','each','UserVoiceQueueRt','isNil','interface','format','SIP/%s','emit','removeTeams','select','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','userVoiceQueue:save','all','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','field','ContactId','toString','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_contacts','insert','CmHopperId','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','filter'];(function(_0x3dfa94,_0x484cda){var _0x101a77=function(_0x319d3a){while(--_0x319d3a){_0x3dfa94['push'](_0x3dfa94['shift']());}};_0x101a77(++_0x484cda);}(_0x9bdb,0x13c));var _0xb9bd=function(_0x27cf2c,_0x1aaeb5){_0x27cf2c=_0x27cf2c-0x0;var _0x2672c1=_0x9bdb[_0x27cf2c];return _0x2672c1;};'use strict';var emlformat=require(_0xb9bd('0x0'));var rimraf=require(_0xb9bd('0x1'));var zipdir=require(_0xb9bd('0x2'));var jsonpatch=require(_0xb9bd('0x3'));var rp=require('request-promise');var moment=require(_0xb9bd('0x4'));var BPromise=require(_0xb9bd('0x5'));var Mustache=require(_0xb9bd('0x6'));var util=require(_0xb9bd('0x7'));var path=require(_0xb9bd('0x8'));var sox=require(_0xb9bd('0x9'));var csv=require(_0xb9bd('0xa'));var ejs=require(_0xb9bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9bd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9bd('0xd'));var deskjs=require(_0xb9bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb9bd('0xf'));var Papa=require(_0xb9bd('0x10'));var Redis=require(_0xb9bd('0x11'));var authService=require(_0xb9bd('0x12'));var qs=require(_0xb9bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9bd('0x14'))(_0xb9bd('0x15'));var utils=require(_0xb9bd('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9bd('0x17'))['db'];config[_0xb9bd('0x18')]=_['defaults'](config[_0xb9bd('0x18')],{'host':_0xb9bd('0x19'),'port':0x18eb});var socket=require(_0xb9bd('0x1a'))(new Redis(config['redis']));require(_0xb9bd('0x1b'))[_0xb9bd('0x1c')](socket);function respondWithStatusCode(_0x2b951c,_0x559855){_0x559855=_0x559855||0xcc;return function(_0x56450d){if(_0x56450d){return _0x2b951c[_0xb9bd('0x1d')](_0x559855);}return _0x2b951c['status'](_0x559855)[_0xb9bd('0x1e')]();};}function respondWithResult(_0x507236,_0x1e0c3a){_0x1e0c3a=_0x1e0c3a||0xc8;return function(_0x1ad774){if(_0x1ad774){return _0x507236[_0xb9bd('0x1f')](_0x1e0c3a)[_0xb9bd('0x20')](_0x1ad774);}};}function respondWithFilteredResult(_0x427640,_0x15dc9f){return function(_0x2f6edc){if(_0x2f6edc){var _0xd65adc=typeof _0x15dc9f[_0xb9bd('0x21')]===_0xb9bd('0x22')&&typeof _0x15dc9f[_0xb9bd('0x23')]==='undefined';var _0x48e7a5=_0x2f6edc[_0xb9bd('0x24')];var _0x2be079=_0xd65adc?0x0:_0x15dc9f[_0xb9bd('0x21')];var _0x1d3ffd=_0xd65adc?_0x2f6edc[_0xb9bd('0x24')]:_0x15dc9f['offset']+_0x15dc9f[_0xb9bd('0x23')];var _0x3657b5;if(_0x1d3ffd>=_0x48e7a5){_0x1d3ffd=_0x48e7a5;_0x3657b5=0xc8;}else{_0x3657b5=0xce;}_0x427640[_0xb9bd('0x1f')](_0x3657b5);return _0x427640[_0xb9bd('0x25')](_0xb9bd('0x26'),_0x2be079+'-'+_0x1d3ffd+'/'+_0x48e7a5)[_0xb9bd('0x20')](_0x2f6edc);}return null;};}function patchUpdates(_0x4657cb){return function(_0x3162b7){try{jsonpatch[_0xb9bd('0x27')](_0x3162b7,_0x4657cb,!![]);}catch(_0x4d2307){return BPromise[_0xb9bd('0x28')](_0x4d2307);}return _0x3162b7[_0xb9bd('0x29')]();};}function saveUpdates(_0x52e526,_0x50dced){return function(_0x4b3940){if(_0x4b3940){return _0x4b3940[_0xb9bd('0x2a')](_0x52e526)[_0xb9bd('0x2b')](function(_0x5eba05){return _0x5eba05;});}return null;};}function removeEntity(_0x9f087d,_0x18f4c1){return function(_0x3b9846){if(_0x3b9846){return _0x3b9846[_0xb9bd('0x2c')]()[_0xb9bd('0x2b')](function(){var _0x3a6cdb=_0x3b9846[_0xb9bd('0x2d')]({'plain':!![]});var _0x31e0cb=[{'name':_0xb9bd('0x2e'),'value':_0xb9bd('0x2f'),'ignore':![]},{'name':_0xb9bd('0x30'),'value':_0xb9bd('0x31'),'ignore':![]}];var _0x5d09c9=_(_0x31e0cb)['filter'](_0xb9bd('0x32'))[_0xb9bd('0x33')](_0xb9bd('0x34'))[_0xb9bd('0x34')]();if(_[_0xb9bd('0x35')](_0x5d09c9,_0x3a6cdb[_0xb9bd('0x36')])){return;}var _0x29cde6=_[_0xb9bd('0x37')](_0x31e0cb,[_0xb9bd('0x34'),_0x3a6cdb['type']])[_0xb9bd('0x38')];return db[_0xb9bd('0x39')][_0xb9bd('0x2c')]({'where':{'type':_0x29cde6,'resourceId':_0x3a6cdb['id']}})[_0xb9bd('0x2b')](function(){return _0x3b9846;});})['then'](function(){_0x9f087d[_0xb9bd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d9d5,_0x111bc9){return function(_0x235a99){if(!_0x235a99){_0x23d9d5[_0xb9bd('0x1d')](0x194);}return _0x235a99;};}function handleError(_0x162046,_0x8efeea){_0x8efeea=_0x8efeea||0x1f4;return function(_0x4207d5){logger[_0xb9bd('0x3a')](_0x4207d5[_0xb9bd('0x3b')]);if(_0x4207d5[_0xb9bd('0x38')]){delete _0x4207d5[_0xb9bd('0x38')];}_0x162046[_0xb9bd('0x1f')](_0x8efeea)[_0xb9bd('0x3c')](_0x4207d5);};}exports[_0xb9bd('0x3d')]=function(_0x481309,_0x502e02){var _0x16254a={},_0x5a6f20={},_0x4e85e8={'count':0x0,'rows':[]};var _0x438b23=_[_0xb9bd('0x33')](db[_0xb9bd('0x3e')][_0xb9bd('0x3f')],function(_0x352339){return{'name':_0x352339[_0xb9bd('0x40')],'type':_0x352339[_0xb9bd('0x36')][_0xb9bd('0x41')]};});_0x5a6f20[_0xb9bd('0x42')]=_[_0xb9bd('0x33')](_0x438b23,_0xb9bd('0x38'));_0x5a6f20['query']=_[_0xb9bd('0x43')](_0x481309[_0xb9bd('0x44')]);_0x5a6f20[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x5a6f20['model'],_0x5a6f20['query']);_0x16254a[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x5a6f20[_0xb9bd('0x42')],qs['fields'](_0x481309[_0xb9bd('0x44')]['fields']));_0x16254a[_0xb9bd('0x47')]=_0x16254a[_0xb9bd('0x47')][_0xb9bd('0x48')]?_0x16254a[_0xb9bd('0x47')]:_0x5a6f20[_0xb9bd('0x42')];if(!_0x481309[_0xb9bd('0x44')]['hasOwnProperty'](_0xb9bd('0x49'))){_0x16254a[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x481309[_0xb9bd('0x44')][_0xb9bd('0x23')]);_0x16254a[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x481309[_0xb9bd('0x44')]['offset']);}_0x16254a[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x481309[_0xb9bd('0x44')]['sort']);_0x16254a[_0xb9bd('0x4c')]=qs['filters'](_[_0xb9bd('0x4d')](_0x481309[_0xb9bd('0x44')],_0x5a6f20[_0xb9bd('0x45')]),_0x438b23);if(_0x481309[_0xb9bd('0x44')]['filter']){_0x16254a[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x16254a[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0x438b23,function(_0x53a0a7){if(_0x53a0a7[_0xb9bd('0x36')]!=='VIRTUAL'){var _0x301656={};_0x301656[_0x53a0a7[_0xb9bd('0x38')]]={'$like':'%'+_0x481309[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x301656;}})});}_0x16254a=_['merge']({},_0x16254a,_0x481309[_0xb9bd('0x50')]);var _0x4d8278={'where':_0x16254a['where']};return db[_0xb9bd('0x3e')]['count'](_0x4d8278)[_0xb9bd('0x2b')](function(_0x4e1246){_0x4e85e8[_0xb9bd('0x24')]=_0x4e1246;if(_0x481309[_0xb9bd('0x44')]['includeAll']){_0x16254a[_0xb9bd('0x51')]=[{'all':!![]}];}return db[_0xb9bd('0x3e')][_0xb9bd('0x52')](_0x16254a);})[_0xb9bd('0x2b')](function(_0x5bd420){_0x4e85e8[_0xb9bd('0x53')]=_0x5bd420;return _0x4e85e8;})[_0xb9bd('0x2b')](respondWithFilteredResult(_0x502e02,_0x16254a))[_0xb9bd('0x54')](handleError(_0x502e02,null));};exports[_0xb9bd('0x55')]=function(_0x38734c,_0x171dc5){var _0x5e547a={'raw':![],'where':{'id':_0x38734c[_0xb9bd('0x56')]['id']}},_0x65d0e4={};_0x65d0e4[_0xb9bd('0x42')]=_[_0xb9bd('0x43')](db['VoiceQueue'][_0xb9bd('0x3f')]);_0x65d0e4[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x38734c[_0xb9bd('0x44')]);_0x65d0e4[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x65d0e4[_0xb9bd('0x42')],_0x65d0e4[_0xb9bd('0x44')]);_0x5e547a[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x65d0e4[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x38734c[_0xb9bd('0x44')]['fields']));_0x5e547a[_0xb9bd('0x47')]=_0x5e547a['attributes'][_0xb9bd('0x48')]?_0x5e547a['attributes']:_0x65d0e4[_0xb9bd('0x42')];if(_0x38734c[_0xb9bd('0x44')][_0xb9bd('0x58')]){_0x5e547a['include']=[{'all':!![]}];}_0x5e547a=_[_0xb9bd('0x4e')]({},_0x5e547a,_0x38734c['options']);return db[_0xb9bd('0x3e')][_0xb9bd('0x37')](_0x5e547a)['then'](handleEntityNotFound(_0x171dc5,null))['then'](respondWithResult(_0x171dc5,null))['catch'](handleError(_0x171dc5,null));};exports[_0xb9bd('0x59')]=function(_0x916d63,_0x15bc7e){return db[_0xb9bd('0x3e')]['create'](_0x916d63[_0xb9bd('0x5a')],{})[_0xb9bd('0x2b')](function(_0x42cdc6){var _0x562e8e=_0x916d63[_0xb9bd('0x5b')][_0xb9bd('0x2d')]({'plain':!![]});if(!_0x562e8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x562e8e[_0xb9bd('0x5c')]===_0xb9bd('0x5b')){var _0x583a34=_0x42cdc6['get']({'plain':!![]});var _0x5314ba=[{'name':_0xb9bd('0x2e'),'value':_0xb9bd('0x2f')},{'name':'QueueCampaigns','value':_0xb9bd('0x31')}];var _0x34cc3a=_[_0xb9bd('0x37')](_0x5314ba,[_0xb9bd('0x34'),_0x583a34[_0xb9bd('0x36')]])['name'];return db['UserProfileSection'][_0xb9bd('0x37')]({'where':{'name':_0x34cc3a,'userProfileId':_0x562e8e[_0xb9bd('0x5d')]},'raw':!![]})[_0xb9bd('0x2b')](function(_0x2c5c32){if(_0x2c5c32&&_0x2c5c32['autoAssociation']===0x0){return db['UserProfileResource'][_0xb9bd('0x59')]({'name':_0x583a34['name'],'resourceId':_0x583a34['id'],'type':_0x2c5c32[_0xb9bd('0x38')],'sectionId':_0x2c5c32['id']},{})[_0xb9bd('0x2b')](function(){return _0x42cdc6;});}else{return _0x42cdc6;}})['catch'](function(_0x5763c8){logger['error'](_0xb9bd('0x5e'),_0x5763c8);throw _0x5763c8;});}return _0x42cdc6;})[_0xb9bd('0x2b')](respondWithResult(_0x15bc7e,0xc9))['catch'](handleError(_0x15bc7e,null));};exports['clone']=function(_0x46b091,_0x36a175){var _0x122084={'where':{'id':_0x46b091[_0xb9bd('0x56')]['id']}},_0x1dd45b={};_0x1dd45b['model']=_['keys'](db[_0xb9bd('0x3e')]['rawAttributes']);_0x122084[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x1dd45b[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x46b091['query'][_0xb9bd('0x57')]));_0x122084[_0xb9bd('0x47')]=_0x122084['attributes'][_0xb9bd('0x48')]?_0x122084[_0xb9bd('0x47')]:_0x1dd45b[_0xb9bd('0x42')];if(_0x46b091[_0xb9bd('0x44')][_0xb9bd('0x58')]){_0x122084['include']=[{'all':!![]}];}_0x122084=_['merge']({},_0x122084,_0x46b091[_0xb9bd('0x50')]);return db[_0xb9bd('0x3e')][_0xb9bd('0x37')](_0x122084)[_0xb9bd('0x2b')](handleEntityNotFound(_0x36a175,null))[_0xb9bd('0x2b')](function(_0x4a0898){if(_0x4a0898){var _0x250586=_0x4a0898['get']({'plain':!![]});_0x250586=qs[_0xb9bd('0x5f')](_0x250586,['id','createdAt',_0xb9bd('0x60')]);_0x46b091[_0xb9bd('0x5a')]=_[_0xb9bd('0x5f')](_0x46b091[_0xb9bd('0x5a')],['id',_0xb9bd('0x61'),_0xb9bd('0x60')]);return db['VoiceQueue'][_0xb9bd('0x59')](_[_0xb9bd('0x4e')](_0x250586,_0x46b091[_0xb9bd('0x5a')]),{'include':_0x46b091[_0xb9bd('0x44')][_0xb9bd('0x58')]?[{'all':!![]}]:undefined})['then'](function(_0x264350){var _0x3247dc=_0x46b091[_0xb9bd('0x5b')][_0xb9bd('0x2d')]({'plain':!![]});if(!_0x3247dc)throw new Error(_0xb9bd('0x62'));if(_0x3247dc[_0xb9bd('0x5c')]==='user'){var _0x4041ec=_0x264350[_0xb9bd('0x2d')]({'plain':!![]});var _0x353730=[{'name':_0xb9bd('0x2e'),'value':'inbound'},{'name':_0xb9bd('0x30'),'value':_0xb9bd('0x31')}];var _0x30f0ba=_[_0xb9bd('0x37')](_0x353730,['value',_0x4041ec[_0xb9bd('0x36')]])[_0xb9bd('0x38')];return db[_0xb9bd('0x63')][_0xb9bd('0x37')]({'where':{'name':_0x30f0ba,'userProfileId':_0x3247dc['userProfileId']},'raw':!![]})['then'](function(_0x65ea07){if(_0x65ea07&&_0x65ea07[_0xb9bd('0x64')]===0x0){return db[_0xb9bd('0x39')][_0xb9bd('0x59')]({'name':_0x4041ec[_0xb9bd('0x38')],'resourceId':_0x4041ec['id'],'type':_0x65ea07['name'],'sectionId':_0x65ea07['id']},{})[_0xb9bd('0x2b')](function(){return _0x264350;});}else{return _0x264350;}})['catch'](function(_0x4025d6){logger[_0xb9bd('0x3a')](_0xb9bd('0x5e'),_0x4025d6);throw _0x4025d6;});}return _0x264350;});}})[_0xb9bd('0x2b')](respondWithResult(_0x36a175,0xc9))[_0xb9bd('0x54')](handleError(_0x36a175,null));};exports['update']=function(_0x4c6d06,_0xec8974){if(_0x4c6d06[_0xb9bd('0x5a')]['id']){delete _0x4c6d06[_0xb9bd('0x5a')]['id'];}return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x4c6d06[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0xec8974,null))[_0xb9bd('0x2b')](saveUpdates(_0x4c6d06[_0xb9bd('0x5a')],null))['then'](respondWithResult(_0xec8974,null))[_0xb9bd('0x54')](handleError(_0xec8974,null));};exports[_0xb9bd('0x2c')]=function(_0x1a2398,_0x498b45){return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x1a2398[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x498b45,null))[_0xb9bd('0x2b')](removeEntity(_0x498b45,null))[_0xb9bd('0x54')](handleError(_0x498b45,null));};exports['getHoppers']=function(_0x1f9196,_0xf3289a,_0x5a4dad){var _0x4fc4ee={'raw':![],'where':{}};var _0x2d0669={};var _0x4ecb1a={'count':0x0,'rows':[]};return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x1f9196[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0xf3289a,null))['then'](function(_0x32bdb8){if(_0x32bdb8){_0x2d0669[_0xb9bd('0x42')]=_['keys'](db['CmHopper'][_0xb9bd('0x3f')]);_0x2d0669[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x1f9196[_0xb9bd('0x44')]);_0x2d0669[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x2d0669[_0xb9bd('0x42')],_0x2d0669[_0xb9bd('0x44')]);_0x4fc4ee[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x2d0669['model'],qs[_0xb9bd('0x57')](_0x1f9196[_0xb9bd('0x44')][_0xb9bd('0x57')]));_0x4fc4ee[_0xb9bd('0x47')]=_0x4fc4ee['attributes'][_0xb9bd('0x48')]?_0x4fc4ee[_0xb9bd('0x47')]:_0x2d0669[_0xb9bd('0x42')];if(!_0x1f9196[_0xb9bd('0x44')][_0xb9bd('0x66')]('nolimit')){_0x4fc4ee[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x1f9196['query'][_0xb9bd('0x23')]);_0x4fc4ee[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x1f9196[_0xb9bd('0x44')]['offset']);}_0x4fc4ee['order']=qs[_0xb9bd('0x4b')](_0x1f9196[_0xb9bd('0x44')][_0xb9bd('0x4b')]);_0x4fc4ee['where']=qs[_0xb9bd('0x45')](_[_0xb9bd('0x4d')](_0x1f9196[_0xb9bd('0x44')],_0x2d0669[_0xb9bd('0x45')]));_0x4fc4ee[_0xb9bd('0x4c')]['VoiceQueueId']=_0x32bdb8['id'];if(_0x1f9196[_0xb9bd('0x44')]['filter']){_0x4fc4ee[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x4fc4ee[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0x4fc4ee[_0xb9bd('0x47')],function(_0x38d985){var _0x596770={};_0x596770[_0x38d985]={'$like':'%'+_0x1f9196[_0xb9bd('0x44')]['filter']+'%'};return _0x596770;})});}_0x4fc4ee=_['merge']({},_0x4fc4ee,_0x1f9196[_0xb9bd('0x50')]);return db['CmHopper'][_0xb9bd('0x24')]({'where':_0x4fc4ee[_0xb9bd('0x4c')]})['then'](function(_0x4b95f3){_0x4ecb1a[_0xb9bd('0x24')]=_0x4b95f3;if(_0x1f9196['query'][_0xb9bd('0x58')]){_0x4fc4ee[_0xb9bd('0x51')]=[{'all':!![]}];}return db[_0xb9bd('0x67')]['findAll'](_0x4fc4ee);})[_0xb9bd('0x2b')](function(_0x2914c7){_0x4ecb1a['rows']=_0x2914c7;return _0x4ecb1a;});}})[_0xb9bd('0x2b')](respondWithFilteredResult(_0xf3289a,_0x4fc4ee))[_0xb9bd('0x54')](handleError(_0xf3289a,null));};exports[_0xb9bd('0x68')]=function(_0x4f0bd4,_0x58834e,_0xc85290){var _0x35a49c={'raw':!![],'where':{}};var _0x47a43c={};var _0x4e6595={'count':0x0,'rows':[]};return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x4f0bd4[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x58834e,null))[_0xb9bd('0x2b')](function(_0x1f8f0e){if(_0x1f8f0e){_0x47a43c[_0xb9bd('0x42')]=_[_0xb9bd('0x43')](db[_0xb9bd('0x69')]['rawAttributes']);_0x47a43c[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x4f0bd4['query']);_0x47a43c[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x47a43c[_0xb9bd('0x42')],_0x47a43c['query']);_0x35a49c[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x47a43c['model'],qs['fields'](_0x4f0bd4['query'][_0xb9bd('0x57')]));_0x35a49c[_0xb9bd('0x47')]=_0x35a49c[_0xb9bd('0x47')][_0xb9bd('0x48')]?_0x35a49c[_0xb9bd('0x47')]:_0x47a43c[_0xb9bd('0x42')];if(!_0x4f0bd4[_0xb9bd('0x44')][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0x35a49c[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x4f0bd4[_0xb9bd('0x44')][_0xb9bd('0x23')]);_0x35a49c[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x4f0bd4[_0xb9bd('0x44')][_0xb9bd('0x21')]);}_0x35a49c[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x4f0bd4[_0xb9bd('0x44')]['sort']);_0x35a49c[_0xb9bd('0x4c')]=qs['filters'](_[_0xb9bd('0x4d')](_0x4f0bd4[_0xb9bd('0x44')],_0x47a43c[_0xb9bd('0x45')]));_0x35a49c[_0xb9bd('0x4c')][_0xb9bd('0x6a')]=_0x1f8f0e['id'];if(_0x4f0bd4[_0xb9bd('0x44')]['filter']){_0x35a49c['where']=_[_0xb9bd('0x4e')](_0x35a49c[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0x35a49c[_0xb9bd('0x47')],function(_0x3b4a0c){var _0x374f38={};_0x374f38[_0x3b4a0c]={'$like':'%'+_0x4f0bd4[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x374f38;})});}_0x35a49c=_['merge']({},_0x35a49c,_0x4f0bd4[_0xb9bd('0x50')]);return db['CmHopperHistory'][_0xb9bd('0x24')]({'where':_0x35a49c[_0xb9bd('0x4c')]})[_0xb9bd('0x2b')](function(_0x347180){_0x4e6595[_0xb9bd('0x24')]=_0x347180;if(_0x4f0bd4[_0xb9bd('0x44')][_0xb9bd('0x58')]){_0x35a49c[_0xb9bd('0x51')]=[{'all':!![]}];}return db[_0xb9bd('0x69')][_0xb9bd('0x52')](_0x35a49c);})[_0xb9bd('0x2b')](function(_0x1fe8c7){_0x4e6595[_0xb9bd('0x53')]=_0x1fe8c7;return _0x4e6595;});}})['then'](respondWithFilteredResult(_0x58834e,_0x35a49c))[_0xb9bd('0x54')](handleError(_0x58834e,null));};exports[_0xb9bd('0x6b')]=function(_0x147cd7,_0x31cc6e,_0x3ed6ab){var _0x429575={'raw':!![],'where':{}};var _0x20149d={};var _0x50a5a3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb9bd('0x65')]({'where':{'id':_0x147cd7[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x31cc6e,null))[_0xb9bd('0x2b')](function(_0x350214){if(_0x350214){_0x20149d[_0xb9bd('0x42')]=_['keys'](db[_0xb9bd('0x6c')]['rawAttributes']);_0x20149d[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x147cd7[_0xb9bd('0x44')]);_0x20149d[_0xb9bd('0x45')]=_['intersection'](_0x20149d[_0xb9bd('0x42')],_0x20149d[_0xb9bd('0x44')]);_0x429575[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x20149d[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x147cd7['query'][_0xb9bd('0x57')]));_0x429575['attributes']=_0x429575['attributes'][_0xb9bd('0x48')]?_0x429575[_0xb9bd('0x47')]:_0x20149d[_0xb9bd('0x42')];if(!_0x147cd7['query'][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0x429575[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x147cd7['query'][_0xb9bd('0x23')]);_0x429575[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x147cd7[_0xb9bd('0x44')][_0xb9bd('0x21')]);}_0x429575[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x147cd7[_0xb9bd('0x44')][_0xb9bd('0x4b')]);_0x429575[_0xb9bd('0x4c')]=qs[_0xb9bd('0x45')](_[_0xb9bd('0x4d')](_0x147cd7[_0xb9bd('0x44')],_0x20149d[_0xb9bd('0x45')]));_0x429575['where']['VoiceQueueId']=_0x350214['id'];if(_0x147cd7[_0xb9bd('0x44')][_0xb9bd('0x4f')]){_0x429575[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x429575[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0x429575[_0xb9bd('0x47')],function(_0x50677c){var _0x2bf5c5={};_0x2bf5c5[_0x50677c]={'$like':'%'+_0x147cd7[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x2bf5c5;})});}_0x429575=_[_0xb9bd('0x4e')]({},_0x429575,_0x147cd7[_0xb9bd('0x50')]);return db['CmHopperFinal'][_0xb9bd('0x24')]({'where':_0x429575[_0xb9bd('0x4c')]})[_0xb9bd('0x2b')](function(_0x37e26e){_0x50a5a3[_0xb9bd('0x24')]=_0x37e26e;if(_0x147cd7[_0xb9bd('0x44')]['includeAll']){_0x429575[_0xb9bd('0x51')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xb9bd('0x52')](_0x429575);})[_0xb9bd('0x2b')](function(_0x5cd364){_0x50a5a3['rows']=_0x5cd364;return _0x50a5a3;});}})['then'](respondWithFilteredResult(_0x31cc6e,_0x429575))[_0xb9bd('0x54')](handleError(_0x31cc6e,null));};exports['getHopperBlacks']=function(_0x7bdb59,_0x2ce8c8,_0x599cb1){var _0x3bea7f={'raw':!![],'where':{}};var _0x5938d8={};var _0x52d8cf={'count':0x0,'rows':[]};return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x7bdb59[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x2ce8c8,null))[_0xb9bd('0x2b')](function(_0x3fea13){if(_0x3fea13){_0x5938d8['model']=_[_0xb9bd('0x43')](db[_0xb9bd('0x6d')][_0xb9bd('0x3f')]);_0x5938d8['query']=_[_0xb9bd('0x43')](_0x7bdb59[_0xb9bd('0x44')]);_0x5938d8[_0xb9bd('0x45')]=_['intersection'](_0x5938d8[_0xb9bd('0x42')],_0x5938d8[_0xb9bd('0x44')]);_0x3bea7f[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x5938d8[_0xb9bd('0x42')],qs['fields'](_0x7bdb59['query']['fields']));_0x3bea7f[_0xb9bd('0x47')]=_0x3bea7f['attributes'][_0xb9bd('0x48')]?_0x3bea7f[_0xb9bd('0x47')]:_0x5938d8[_0xb9bd('0x42')];if(!_0x7bdb59['query']['hasOwnProperty']('nolimit')){_0x3bea7f['limit']=qs[_0xb9bd('0x23')](_0x7bdb59[_0xb9bd('0x44')][_0xb9bd('0x23')]);_0x3bea7f[_0xb9bd('0x21')]=qs['offset'](_0x7bdb59[_0xb9bd('0x44')][_0xb9bd('0x21')]);}_0x3bea7f[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x7bdb59['query']['sort']);_0x3bea7f[_0xb9bd('0x4c')]=qs['filters'](_[_0xb9bd('0x4d')](_0x7bdb59['query'],_0x5938d8[_0xb9bd('0x45')]));_0x3bea7f[_0xb9bd('0x4c')]['VoiceQueueId']=_0x3fea13['id'];if(_0x7bdb59[_0xb9bd('0x44')][_0xb9bd('0x4f')]){_0x3bea7f[_0xb9bd('0x4c')]=_['merge'](_0x3bea7f[_0xb9bd('0x4c')],{'$or':_['map'](_0x3bea7f[_0xb9bd('0x47')],function(_0x104f2f){var _0x2fbb9c={};_0x2fbb9c[_0x104f2f]={'$like':'%'+_0x7bdb59[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x2fbb9c;})});}_0x3bea7f=_[_0xb9bd('0x4e')]({},_0x3bea7f,_0x7bdb59[_0xb9bd('0x50')]);return db[_0xb9bd('0x6d')][_0xb9bd('0x24')]({'where':_0x3bea7f[_0xb9bd('0x4c')]})[_0xb9bd('0x2b')](function(_0x26b30a){_0x52d8cf['count']=_0x26b30a;if(_0x7bdb59['query'][_0xb9bd('0x58')]){_0x3bea7f['include']=[{'all':!![]}];}return db[_0xb9bd('0x6d')][_0xb9bd('0x52')](_0x3bea7f);})['then'](function(_0x1968b0){_0x52d8cf[_0xb9bd('0x53')]=_0x1968b0;return _0x52d8cf;});}})['then'](respondWithFilteredResult(_0x2ce8c8,_0x3bea7f))['catch'](handleError(_0x2ce8c8,null));};exports[_0xb9bd('0x6e')]=function(_0x2fc7ff,_0x412282,_0x118ae6){var _0x2ce86a={};var _0x3a48ff={};var _0x460a27;var _0x5af5c5;return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x2fc7ff[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x412282,null))[_0xb9bd('0x2b')](function(_0x307436){if(_0x307436){_0x460a27=_0x307436;_0x3a48ff[_0xb9bd('0x42')]=_['keys'](db[_0xb9bd('0x6f')][_0xb9bd('0x3f')]);_0x3a48ff[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x2fc7ff[_0xb9bd('0x44')]);_0x3a48ff['filters']=_['intersection'](_0x3a48ff[_0xb9bd('0x42')],_0x3a48ff[_0xb9bd('0x44')]);_0x2ce86a[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x3a48ff['model'],qs[_0xb9bd('0x57')](_0x2fc7ff['query'][_0xb9bd('0x57')]));_0x2ce86a[_0xb9bd('0x47')]=_0x2ce86a[_0xb9bd('0x47')]['length']?_0x2ce86a[_0xb9bd('0x47')]:_0x3a48ff['model'];_0x2ce86a['order']=qs[_0xb9bd('0x4b')](_0x2fc7ff[_0xb9bd('0x44')][_0xb9bd('0x4b')]);_0x2ce86a['where']=qs[_0xb9bd('0x45')](_[_0xb9bd('0x4d')](_0x2fc7ff[_0xb9bd('0x44')],_0x3a48ff[_0xb9bd('0x45')]));if(_0x2fc7ff[_0xb9bd('0x44')][_0xb9bd('0x4f')]){_0x2ce86a[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x2ce86a['where'],{'$or':_[_0xb9bd('0x33')](_0x2ce86a[_0xb9bd('0x47')],function(_0x574ec7){var _0x10681d={};_0x10681d[_0x574ec7]={'$like':'%'+_0x2fc7ff['query'][_0xb9bd('0x4f')]+'%'};return _0x10681d;})});}_0x2ce86a=_[_0xb9bd('0x4e')]({},_0x2ce86a,_0x2fc7ff[_0xb9bd('0x50')]);return _0x460a27[_0xb9bd('0x6e')](_0x2ce86a);}})[_0xb9bd('0x2b')](function(_0x2dbbd0){if(_0x2dbbd0){_0x5af5c5=_0x2dbbd0['length'];if(!_0x2fc7ff['query'][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0x2ce86a[_0xb9bd('0x23')]=qs['limit'](_0x2fc7ff[_0xb9bd('0x44')][_0xb9bd('0x23')]);_0x2ce86a[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x2fc7ff['query']['offset']);}return _0x460a27[_0xb9bd('0x6e')](_0x2ce86a);}})[_0xb9bd('0x2b')](function(_0xef06d0){if(_0xef06d0){return _0xef06d0?{'count':_0x5af5c5,'rows':_0xef06d0}:null;}})[_0xb9bd('0x2b')](respondWithResult(_0x412282,null))[_0xb9bd('0x54')](handleError(_0x412282,null));};exports['addTeams']=function(_0x194141,_0x289b76,_0x174e4e){var _0x49be7f=_0x194141[_0xb9bd('0x5a')]['teams'];var _0x1f3125=_[_0xb9bd('0x33')](_0x49be7f,'id');return db[_0xb9bd('0x6f')][_0xb9bd('0x52')]({'where':{'id':_0x1f3125},'attributes':['id'],'include':[{'model':db[_0xb9bd('0x70')],'as':'Agents','attributes':['id',_0xb9bd('0x38'),_0xb9bd('0x71'),_0xb9bd('0x72'),'interface'],'raw':!![]}]})[_0xb9bd('0x2b')](function(_0x10ee50){if(_0x10ee50){var _0x4d70e1=_[_0xb9bd('0x73')](_0x10ee50,function(_0x2e5633){var _0x23aaa3=_0x2e5633['get']({'plain':!![]});_0x23aaa3[_0xb9bd('0x74')][_0xb9bd('0x75')](function(_0x41089d){_0x41089d[_0xb9bd('0x76')]=_[_0xb9bd('0x37')](_0x49be7f,{'id':_0x23aaa3['id']})[_0xb9bd('0x76')];});return _0x23aaa3['Agents'];});return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x194141[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](function(_0x57cd1b){return db[_0xb9bd('0x77')][_0xb9bd('0x78')](function(_0x5f1ecc){return _0x57cd1b[_0xb9bd('0x79')](_0x1f3125,{'transaction':_0x5f1ecc})[_0xb9bd('0x2b')](function(){return BPromise['each'](_0x49be7f,function(_0x4fde8a){return db[_0xb9bd('0x7a')][_0xb9bd('0x7b')]({'TeamId':_0x4fde8a['id'],'VoiceQueueId':_0x194141[_0xb9bd('0x56')]['id'],'penalty':_0x4fde8a[_0xb9bd('0x76')]},{'transaction':_0x5f1ecc});});})[_0xb9bd('0x2b')](function(){return BPromise['each'](_0x4d70e1,function(_0x770a16){return db[_0xb9bd('0x7c')]['findOrCreate']({'where':{'UserId':_0x770a16['id'],'VoiceQueueId':_0x194141[_0xb9bd('0x56')]['id']},'defaults':{'penalty':_0x770a16[_0xb9bd('0x76')]},'transaction':_0x5f1ecc});});})['then'](function(){return BPromise[_0xb9bd('0x7d')](_[_0xb9bd('0x4f')](_0x4d70e1,{'online':!![]}),function(_0x4d43fb){return db[_0xb9bd('0x7e')][_0xb9bd('0x7b')]({'membername':_0x4d43fb[_0xb9bd('0x38')],'UserId':_0x4d43fb['id'],'queue_name':_0x57cd1b[_0xb9bd('0x38')],'VoiceQueueId':_0x57cd1b['id'],'interface':_[_0xb9bd('0x7f')](_0x4d43fb[_0xb9bd('0x80')])?util[_0xb9bd('0x81')](_0xb9bd('0x82'),_0x4d43fb[_0xb9bd('0x38')]):_0x4d43fb['interface'],'paused':_0x4d43fb[_0xb9bd('0x72')]||![],'penalty':_0x4d43fb['penalty']},{'transaction':_0x5f1ecc});});})['then'](function(){_0x4d70e1[_0xb9bd('0x75')](function(_0x10d6c2){socket[_0xb9bd('0x83')]('userVoiceQueue:save',{'UserId':_0x10d6c2['id'],'VoiceQueueId':_0x57cd1b['id']});});});});});}})['then'](respondWithStatusCode(_0x289b76,null))[_0xb9bd('0x54')](handleError(_0x289b76,null));};exports[_0xb9bd('0x84')]=function(_0x46032b,_0x3f7166,_0x2c409a){return db[_0xb9bd('0x6f')][_0xb9bd('0x52')]({'where':{'id':_0x46032b['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb9bd('0x74'),'attributes':['id'],'raw':!![]}]})[_0xb9bd('0x2b')](handleEntityNotFound(_0x3f7166,null))[_0xb9bd('0x2b')](function(_0x4cfd71){var _0x1069f6=_[_0xb9bd('0x33')](_0x4cfd71,'id');var _0x4989ef=[];var _0x1e4d01=[];var _0x30ac3f=squel[_0xb9bd('0x85')]();_0x30ac3f['field']('tq.TeamId')[_0xb9bd('0x86')](_0xb9bd('0x87'),'tq')[_0xb9bd('0x88')]('user_has_teams','ut',_0xb9bd('0x89'))[_0xb9bd('0x4c')]('VoiceQueueId\x20=\x20?',_0x46032b[_0xb9bd('0x56')]['id']);for(var _0x88c6f5=0x0;_0x88c6f5<_0x4cfd71['length'];_0x88c6f5+=0x1){let _0x25b29b=_0x4cfd71[_0x88c6f5];for(var _0x230471=0x0;_0x230471<_0x25b29b[_0xb9bd('0x74')][_0xb9bd('0x48')];_0x230471+=0x1){let _0x1f5c74=_0x25b29b[_0xb9bd('0x74')][_0x230471];var _0xfc0ce7=_0x30ac3f[_0xb9bd('0x8a')]();_0xfc0ce7[_0xb9bd('0x4c')](_0xb9bd('0x8b'),_0x1f5c74['id']);_0x1e4d01[_0xb9bd('0x8c')](db[_0xb9bd('0x77')]['query'](_0xfc0ce7['toString'](),{'type':db[_0xb9bd('0x77')][_0xb9bd('0x8d')][_0xb9bd('0x8e')]})[_0xb9bd('0x2b')](function(_0x4cc472){if(_0x4cc472[_0xb9bd('0x48')]===0x1){return _0x1f5c74['id'];}else{var _0x2f0138=_[_0xb9bd('0x8f')](_[_0xb9bd('0x33')](_0x4cc472,_0xb9bd('0x90')),function(_0x66226b){return _[_0xb9bd('0x35')](_0x1069f6,_0x66226b);});if(_0x2f0138){return _0x1f5c74['id'];}}}));}}return BPromise['all'](_0x1e4d01)['then'](function(_0x25a91d){_0x4989ef=_(_0x4989ef)[_0xb9bd('0x91')](_0x25a91d)[_0xb9bd('0x92')]()[_0xb9bd('0x34')]();return db['VoiceQueue'][_0xb9bd('0x37')]({'where':{'id':_0x46032b['params']['id']}})[_0xb9bd('0x2b')](function(_0x32954a){return db[_0xb9bd('0x77')][_0xb9bd('0x78')](function(_0x3da944){return _0x32954a['removeTeams'](_0x46032b[_0xb9bd('0x44')][_0xb9bd('0x93')],{'transaction':_0x3da944})[_0xb9bd('0x2b')](function(){if(!_[_0xb9bd('0x94')](_0x4989ef)){return _0x32954a[_0xb9bd('0x95')](_0x4989ef,{'transaction':_0x3da944})[_0xb9bd('0x2b')](function(){return db[_0xb9bd('0x7e')][_0xb9bd('0x2c')]({'where':{'VoiceQueueId':_0x46032b[_0xb9bd('0x56')]['id'],'UserId':_0x4989ef},'transaction':_0x3da944});});}})['then'](function(){_0x4989ef[_0xb9bd('0x75')](function(_0x279766){socket['emit'](_0xb9bd('0x96'),{'UserId':_0x279766,'VoiceQueueId':_0x32954a['id']});});});});});});})[_0xb9bd('0x2b')](respondWithStatusCode(_0x3f7166,null))[_0xb9bd('0x54')](handleError(_0x3f7166,null));};exports['addAgents']=function(_0x53b7da,_0x153e5b,_0x3429a2){var _0x449649,_0x39a73f;return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x53b7da[_0xb9bd('0x56')]['id']}})['then'](handleEntityNotFound(_0x153e5b,null))['then'](function(_0x124c27){if(_0x124c27){_0x39a73f=_0x124c27;return _0x124c27[_0xb9bd('0x97')](_0x53b7da['body'][_0xb9bd('0x93')],_[_0xb9bd('0x5f')](_0x53b7da[_0xb9bd('0x5a')],[_0xb9bd('0x93'),'id'])||{})['spread'](function(_0x295a56){for(var _0x11b90f=0x0;_0x11b90f<_0x53b7da[_0xb9bd('0x5a')]['ids'][_0xb9bd('0x48')];_0x11b90f+=0x1){socket['emit'](_0xb9bd('0x98'),{'UserId':Number(_0x53b7da[_0xb9bd('0x5a')][_0xb9bd('0x93')][_0x11b90f]),'VoiceQueueId':Number(_0x53b7da['params']['id'])});}return _0x295a56;});}})['then'](function(_0x344c46){_0x449649=_0x344c46||[];if(_0x39a73f){return db[_0xb9bd('0x70')][_0xb9bd('0x52')]({'where':{'id':_0x53b7da[_0xb9bd('0x5a')][_0xb9bd('0x93')]},'attributes':['id',_0xb9bd('0x38'),_0xb9bd('0x71'),_0xb9bd('0x72'),_0xb9bd('0x80')],'raw':!![]});}})['then'](function(_0x557c3e){if(!_[_0xb9bd('0x94')](_0x557c3e)){var _0x111907=[];for(var _0x58373b=0x0;_0x58373b<_0x557c3e[_0xb9bd('0x48')];_0x58373b++){if(_0x557c3e[_0x58373b]['online']){_0x111907[_0xb9bd('0x8c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x557c3e[_0x58373b][_0xb9bd('0x38')],'UserId':_0x557c3e[_0x58373b]['id'],'queue_name':_0x39a73f[_0xb9bd('0x38')],'VoiceQueueId':_0x39a73f['id'],'interface':_['isNil'](_0x557c3e[_0x58373b][_0xb9bd('0x80')])?util['format'](_0xb9bd('0x82'),_0x557c3e[_0x58373b][_0xb9bd('0x38')]):_0x557c3e[_0x58373b][_0xb9bd('0x80')],'paused':_0x557c3e[_0x58373b][_0xb9bd('0x72')]||![],'penalty':_0x53b7da[_0xb9bd('0x5a')][_0xb9bd('0x76')]||0x0}));}}return BPromise[_0xb9bd('0x99')](_0x111907);}})[_0xb9bd('0x2b')](function(){return _0x449649;})[_0xb9bd('0x2b')](respondWithResult(_0x153e5b,null))['catch'](handleError(_0x153e5b,null));};exports[_0xb9bd('0x95')]=function(_0x4e1c6c,_0x49315a,_0x37be79){return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x4e1c6c['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x49315a,null))[_0xb9bd('0x2b')](function(_0x41e1c1){if(_0x41e1c1){return _0x41e1c1['removeAgents'](_0x4e1c6c[_0xb9bd('0x44')][_0xb9bd('0x93')])[_0xb9bd('0x2b')](function(){if(_[_0xb9bd('0x9a')](_0x4e1c6c[_0xb9bd('0x44')]['ids'])){for(var _0x42eed0=0x0;_0x42eed0<_0x4e1c6c[_0xb9bd('0x44')][_0xb9bd('0x93')][_0xb9bd('0x48')];_0x42eed0+=0x1){socket[_0xb9bd('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x4e1c6c[_0xb9bd('0x44')]['ids'][_0x42eed0]),'VoiceQueueId':Number(_0x4e1c6c[_0xb9bd('0x56')]['id'])});}}else{socket[_0xb9bd('0x83')](_0xb9bd('0x96'),{'UserId':Number(_0x4e1c6c['query'][_0xb9bd('0x93')]),'VoiceQueueId':Number(_0x4e1c6c[_0xb9bd('0x56')]['id'])});}});}})['then'](function(_0x5e23ec){return db[_0xb9bd('0x7e')][_0xb9bd('0x2c')]({'where':{'VoiceQueueId':_0x4e1c6c[_0xb9bd('0x56')]['id'],'UserId':_0x4e1c6c['query'][_0xb9bd('0x93')]}})[_0xb9bd('0x2b')](function(){return _0x5e23ec;});})[_0xb9bd('0x2b')](respondWithStatusCode(_0x49315a,null))['catch'](handleError(_0x49315a,null));};exports[_0xb9bd('0x9b')]=function(_0x35b930,_0x185197,_0x2c7917){var _0xce7044={};var _0x1add01={};var _0x40c058;var _0x5bd847;return db['VoiceQueue'][_0xb9bd('0x65')]({'where':{'id':_0x35b930['params']['id']}})['then'](handleEntityNotFound(_0x185197,null))[_0xb9bd('0x2b')](function(_0x59de46){if(_0x59de46){_0x40c058=_0x59de46;_0x1add01[_0xb9bd('0x42')]=_[_0xb9bd('0x43')](db[_0xb9bd('0x70')][_0xb9bd('0x3f')]);_0x1add01[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x35b930[_0xb9bd('0x44')]);_0x1add01[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x1add01[_0xb9bd('0x42')],_0x1add01['query']);_0xce7044[_0xb9bd('0x47')]=_['intersection'](_0x1add01['model'],qs[_0xb9bd('0x57')](_0x35b930[_0xb9bd('0x44')][_0xb9bd('0x57')]));_0xce7044[_0xb9bd('0x47')]=_0xce7044[_0xb9bd('0x47')][_0xb9bd('0x48')]?_0xce7044[_0xb9bd('0x47')]:_0x1add01['model'];_0xce7044['order']=qs[_0xb9bd('0x4b')](_0x35b930[_0xb9bd('0x44')][_0xb9bd('0x4b')]);_0xce7044[_0xb9bd('0x4c')]=qs[_0xb9bd('0x45')](_[_0xb9bd('0x4d')](_0x35b930[_0xb9bd('0x44')],_0x1add01[_0xb9bd('0x45')]));if(_0x35b930[_0xb9bd('0x44')]['filter']){_0xce7044['where']=_[_0xb9bd('0x4e')](_0xce7044[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0xce7044[_0xb9bd('0x47')],function(_0x5bc02b){var _0x18ede2={};_0x18ede2[_0x5bc02b]={'$like':'%'+_0x35b930[_0xb9bd('0x44')]['filter']+'%'};return _0x18ede2;})});}_0xce7044=_[_0xb9bd('0x4e')]({},_0xce7044,_0x35b930[_0xb9bd('0x50')]);return _0x40c058[_0xb9bd('0x9b')](_0xce7044);}})[_0xb9bd('0x2b')](function(_0x34d0ed){if(_0x34d0ed){_0x5bd847=_0x34d0ed[_0xb9bd('0x48')];if(!_0x35b930[_0xb9bd('0x44')][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0xce7044[_0xb9bd('0x23')]=qs['limit'](_0x35b930['query'][_0xb9bd('0x23')]);_0xce7044['offset']=qs[_0xb9bd('0x21')](_0x35b930['query']['offset']);}return _0x40c058['getAgents'](_0xce7044);}})[_0xb9bd('0x2b')](function(_0x40b2f7){if(_0x40b2f7){return _0x40b2f7?{'count':_0x5bd847,'rows':_0x40b2f7}:null;}})[_0xb9bd('0x2b')](respondWithResult(_0x185197,null))['catch'](handleError(_0x185197,null));};exports[_0xb9bd('0x9c')]=function(_0x4365e1,_0x4bd9ac,_0x23cb5a){var _0x10e08f={};var _0x3eb29a={};var _0x21b3b3;var _0x515179;return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x4365e1[_0xb9bd('0x56')]['id']}})['then'](handleEntityNotFound(_0x4bd9ac,null))[_0xb9bd('0x2b')](function(_0x436b2b){if(_0x436b2b){_0x21b3b3=_0x436b2b;_0x3eb29a['model']=_[_0xb9bd('0x43')](db[_0xb9bd('0x7e')]['rawAttributes']);_0x3eb29a[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x4365e1[_0xb9bd('0x44')]);_0x3eb29a['filters']=_['intersection'](_0x3eb29a['model'],_0x3eb29a[_0xb9bd('0x44')]);_0x10e08f[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x3eb29a[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x4365e1[_0xb9bd('0x44')][_0xb9bd('0x57')]));_0x10e08f['attributes']=_0x10e08f['attributes'][_0xb9bd('0x48')]?_0x10e08f[_0xb9bd('0x47')]:_0x3eb29a[_0xb9bd('0x42')];_0x10e08f[_0xb9bd('0x4a')]=qs['sort'](_0x4365e1[_0xb9bd('0x44')]['sort']);_0x10e08f[_0xb9bd('0x4c')]=qs[_0xb9bd('0x45')](_['pick'](_0x4365e1[_0xb9bd('0x44')],_0x3eb29a[_0xb9bd('0x45')]));if(_0x4365e1['query'][_0xb9bd('0x4f')]){_0x10e08f[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x10e08f[_0xb9bd('0x4c')],{'$or':_['map'](_0x10e08f[_0xb9bd('0x47')],function(_0x32b540){var _0x4b7f8a={};_0x4b7f8a[_0x32b540]={'$like':'%'+_0x4365e1[_0xb9bd('0x44')]['filter']+'%'};return _0x4b7f8a;})});}_0x10e08f=_[_0xb9bd('0x4e')]({},_0x10e08f,_0x4365e1[_0xb9bd('0x50')]);return _0x21b3b3['getMembers'](_0x10e08f);}})['then'](function(_0x5e61f2){if(_0x5e61f2){_0x515179=_0x5e61f2[_0xb9bd('0x48')];if(!_0x4365e1[_0xb9bd('0x44')][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0x10e08f['limit']=qs[_0xb9bd('0x23')](_0x4365e1['query'][_0xb9bd('0x23')]);_0x10e08f[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x4365e1[_0xb9bd('0x44')][_0xb9bd('0x21')]);}return _0x21b3b3['getMembers'](_0x10e08f);}})[_0xb9bd('0x2b')](function(_0x280acc){return _0x280acc?{'count':_0x515179,'rows':_0x280acc}:null;})[_0xb9bd('0x2b')](respondWithResult(_0x4bd9ac,null))[_0xb9bd('0x54')](handleError(_0x4bd9ac,null));};exports[_0xb9bd('0x9d')]=function(_0x335983,_0xa2cb31,_0x1ab0a5){var _0x1cfa8b={};var _0x3228a8={};var _0x8e52f1;var _0x38bc8f;return db[_0xb9bd('0x3e')][_0xb9bd('0x65')]({'where':{'id':_0x335983[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0xa2cb31,null))['then'](function(_0x33d958){if(_0x33d958){_0x8e52f1=_0x33d958;_0x3228a8[_0xb9bd('0x42')]=_[_0xb9bd('0x43')](db[_0xb9bd('0x9e')][_0xb9bd('0x3f')]);_0x3228a8['query']=_['keys'](_0x335983[_0xb9bd('0x44')]);_0x3228a8[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x3228a8[_0xb9bd('0x42')],_0x3228a8[_0xb9bd('0x44')]);_0x1cfa8b[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x3228a8[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x335983[_0xb9bd('0x44')][_0xb9bd('0x57')]));_0x1cfa8b[_0xb9bd('0x47')]=_0x1cfa8b[_0xb9bd('0x47')][_0xb9bd('0x48')]?_0x1cfa8b[_0xb9bd('0x47')]:_0x3228a8[_0xb9bd('0x42')];_0x1cfa8b[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x335983[_0xb9bd('0x44')][_0xb9bd('0x4b')]);_0x1cfa8b['where']=qs['filters'](_[_0xb9bd('0x4d')](_0x335983['query'],_0x3228a8[_0xb9bd('0x45')]));if(_0x335983['query'][_0xb9bd('0x4f')]){_0x1cfa8b[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x1cfa8b[_0xb9bd('0x4c')],{'$or':_[_0xb9bd('0x33')](_0x1cfa8b[_0xb9bd('0x47')],function(_0x2a96d4){var _0x14ac33={};_0x14ac33[_0x2a96d4]={'$like':'%'+_0x335983[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x14ac33;})});}_0x1cfa8b=_[_0xb9bd('0x4e')]({},_0x1cfa8b,_0x335983['options']);return _0x8e52f1['getLists'](_0x1cfa8b);}})[_0xb9bd('0x2b')](function(_0x2af9a8){if(_0x2af9a8){_0x38bc8f=_0x2af9a8[_0xb9bd('0x48')];if(!_0x335983[_0xb9bd('0x44')]['hasOwnProperty'](_0xb9bd('0x49'))){_0x1cfa8b['limit']=qs['limit'](_0x335983['query'][_0xb9bd('0x23')]);_0x1cfa8b['offset']=qs[_0xb9bd('0x21')](_0x335983[_0xb9bd('0x44')]['offset']);}return _0x8e52f1['getLists'](_0x1cfa8b);}})['then'](function(_0xcb4791){if(_0xcb4791){return _0xcb4791?{'count':_0x38bc8f,'rows':_0xcb4791}:null;}})['then'](respondWithResult(_0xa2cb31,null))[_0xb9bd('0x54')](handleError(_0xa2cb31,null));};exports[_0xb9bd('0x9f')]=function(_0x4a5049,_0x5de762,_0x13a8be){var _0x353971=moment()[_0xb9bd('0x81')](_0xb9bd('0xa0'));var _0x46bddc,_0x554265;return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x4a5049['params']['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x5de762,null))[_0xb9bd('0x2b')](function(_0x7b770){if(_0x7b770){_0x554265=_0x7b770;return _0x7b770['addLists'](_0x4a5049['body'][_0xb9bd('0x93')],_[_0xb9bd('0x5f')](_0x4a5049[_0xb9bd('0x5a')],[_0xb9bd('0x93'),'id'])||{});}return null;})[_0xb9bd('0xa1')](function(_0x5d84c2){var _0x11e71c;_0x46bddc=_0x5d84c2||[];var _0x433016=[];if(_0x5d84c2){for(var _0x295810=0x0;_0x295810<_0x5d84c2[_0xb9bd('0x48')];_0x295810+=0x1){var _0x29f652=_0x5d84c2[_0x295810][_0xb9bd('0x2d')]({'plain':!![]});_0x554265['dialCheckDuplicateType']=_0x4a5049[_0xb9bd('0x5a')][_0xb9bd('0xa2')]?_0x4a5049[_0xb9bd('0x5a')][_0xb9bd('0xa2')]:_0x554265[_0xb9bd('0xa2')];switch(_0x554265[_0xb9bd('0xa2')]){case'always':_0x11e71c=squel['insert']()['into'](_0xb9bd('0xa3'))[_0xb9bd('0xa4')]([_0xb9bd('0xa5'),_0xb9bd('0xa6'),'ContactId','ListId',_0xb9bd('0x6a'),_0xb9bd('0x61'),_0xb9bd('0x60')],squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')](_0xb9bd('0xa5'),_0xb9bd('0xa5'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0xa6'))[_0xb9bd('0xa7')]('id',_0xb9bd('0xa8'))[_0xb9bd('0xa7')](_0x29f652['CmListId'][_0xb9bd('0xa9')](),_0xb9bd('0xaa'))[_0xb9bd('0xa7')](_0x4a5049[_0xb9bd('0x56')]['id'][_0xb9bd('0xa9')](),'VoiceQueueId')[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0x61'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27','updatedAt')[_0xb9bd('0x86')]('cm_contacts')[_0xb9bd('0x4c')](_0xb9bd('0xab'))['where'](_0xb9bd('0xac'),_0x29f652[_0xb9bd('0xad')]['toString']())[_0xb9bd('0x4c')](_0xb9bd('0xae'))['where'](_0xb9bd('0xaf'),squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')](_0xb9bd('0xb0'))[_0xb9bd('0x86')](_0xb9bd('0xb1'))[_0xb9bd('0x4c')](_0xb9bd('0xb2'),_0x4a5049['params']['id'][_0xb9bd('0xa9')]()))[_0xb9bd('0x4c')](_0xb9bd('0xaf'),squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')](_0xb9bd('0xb3'))[_0xb9bd('0x86')]('cm_hopper')[_0xb9bd('0x4c')]('VoiceQueueId\x20=\x20?',_0x4a5049['params']['id'][_0xb9bd('0xa9')]())))[_0xb9bd('0xa9')]();break;case _0xb9bd('0xb4'):_0x11e71c=squel['insert']()[_0xb9bd('0xb5')]('cm_hopper')[_0xb9bd('0xa4')]([_0xb9bd('0xa5'),'scheduledAt','ContactId',_0xb9bd('0xaa'),_0xb9bd('0x6a'),_0xb9bd('0x61'),_0xb9bd('0x60')],squel['select']()[_0xb9bd('0xa7')]('phone',_0xb9bd('0xa5'))['field']('\x27'+_0x353971+'\x27','scheduledAt')[_0xb9bd('0xa7')]('id','ContactId')[_0xb9bd('0xa7')](_0x29f652[_0xb9bd('0xad')][_0xb9bd('0xa9')](),_0xb9bd('0xaa'))[_0xb9bd('0xa7')](_0x4a5049[_0xb9bd('0x56')]['id'][_0xb9bd('0xa9')](),_0xb9bd('0x6a'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0x61'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0x60'))[_0xb9bd('0x86')](_0xb9bd('0xb6'))[_0xb9bd('0x4c')](_0xb9bd('0xab'))['where']('ListId\x20=\x20?',_0x29f652['CmListId'][_0xb9bd('0xa9')]())[_0xb9bd('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0xb9bd('0x4c')](_0xb9bd('0xaf'),squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')]('COALESCE(phone,\x27\x27)')[_0xb9bd('0x86')](_0xb9bd('0xa3'))[_0xb9bd('0x4c')](_0xb9bd('0xb2'),_0x4a5049['params']['id'][_0xb9bd('0xa9')]())))[_0xb9bd('0xa9')]();break;default:_0x11e71c=squel[_0xb9bd('0xb7')]()[_0xb9bd('0xb5')]('cm_hopper')[_0xb9bd('0xa4')]([_0xb9bd('0xa5'),'scheduledAt',_0xb9bd('0xa8'),'ListId',_0xb9bd('0x6a'),_0xb9bd('0x61'),'updatedAt'],squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')]('phone',_0xb9bd('0xa5'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0xa6'))[_0xb9bd('0xa7')]('id',_0xb9bd('0xa8'))[_0xb9bd('0xa7')](_0x29f652[_0xb9bd('0xad')]['toString'](),_0xb9bd('0xaa'))[_0xb9bd('0xa7')](_0x4a5049[_0xb9bd('0x56')]['id'][_0xb9bd('0xa9')](),_0xb9bd('0x6a'))['field']('\x27'+_0x353971+'\x27',_0xb9bd('0x61'))[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0x60'))[_0xb9bd('0x86')](_0xb9bd('0xb6'))[_0xb9bd('0x4c')](_0xb9bd('0xab'))[_0xb9bd('0x4c')]('ListId\x20=\x20?',_0x29f652['CmListId'][_0xb9bd('0xa9')]())[_0xb9bd('0x4c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x433016[_0xb9bd('0x8c')](db['sequelize'][_0xb9bd('0x44')](_0x11e71c));}return BPromise[_0xb9bd('0x99')](_0x433016);}})[_0xb9bd('0x2b')](function(){var _0x56b903=[];var _0x21e9e2=squel[_0xb9bd('0xb7')]()['into']('cm_hopper_additional_phones')[_0xb9bd('0xa4')]([_0xb9bd('0xb8'),'phone','OrderBy',_0xb9bd('0x61'),'updatedAt'],squel[_0xb9bd('0x85')]()[_0xb9bd('0xa7')](_0xb9bd('0xb9'))[_0xb9bd('0xa7')](_0xb9bd('0xba'))[_0xb9bd('0xa7')]('ci.OrderBy+1')['field']('\x27'+_0x353971+'\x27','createdAt')[_0xb9bd('0xa7')]('\x27'+_0x353971+'\x27',_0xb9bd('0x60'))[_0xb9bd('0x86')](_0xb9bd('0xbb'),'ci')['join'](_0xb9bd('0xa3'),'h',_0xb9bd('0xbc'))[_0xb9bd('0x4c')](_0xb9bd('0xbd'),_0x353971)[_0xb9bd('0x4c')](_0xb9bd('0xbe'),_0xb9bd('0xbf')))[_0xb9bd('0xa9')]();_0x56b903[_0xb9bd('0x8c')](db[_0xb9bd('0x77')][_0xb9bd('0x44')](_0x21e9e2));return BPromise[_0xb9bd('0x99')](_0x56b903);})['then'](function(){return _0x46bddc;})[_0xb9bd('0x2b')](respondWithResult(_0x5de762,null))[_0xb9bd('0x54')](handleError(_0x5de762,null));};exports['removeLists']=function(_0x4f9cfe,_0x2f6d4a,_0x1b2098){return db[_0xb9bd('0x3e')][_0xb9bd('0x37')]({'where':{'id':_0x4f9cfe[_0xb9bd('0x56')]['id']}})['then'](handleEntityNotFound(_0x2f6d4a,null))['then'](function(_0xa79ad2){if(_0xa79ad2){return _0xa79ad2[_0xb9bd('0xc0')](_0x4f9cfe[_0xb9bd('0x44')]['ids']);}})['then'](function(_0x5f1acb){if(_0x5f1acb){return db[_0xb9bd('0x67')][_0xb9bd('0x2c')]({'where':{'ListId':_0x4f9cfe[_0xb9bd('0x44')][_0xb9bd('0x93')],'VoiceQueueId':_0x4f9cfe[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](function(){return _0x5f1acb;});}})[_0xb9bd('0x2b')](respondWithStatusCode(_0x2f6d4a,null))[_0xb9bd('0x54')](handleError(_0x2f6d4a,null));};exports[_0xb9bd('0xc1')]=function(_0x27fb08,_0x4b6ca5,_0x2f975a){var _0x3ec240={};var _0x9cc200={};var _0x5d3471;var _0x23b2a6;return db[_0xb9bd('0x3e')]['findOne']({'where':{'id':_0x27fb08[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x4b6ca5,null))['then'](function(_0x398830){if(_0x398830){_0x5d3471=_0x398830;_0x9cc200[_0xb9bd('0x42')]=_[_0xb9bd('0x43')](db[_0xb9bd('0x9e')][_0xb9bd('0x3f')]);_0x9cc200[_0xb9bd('0x44')]=_[_0xb9bd('0x43')](_0x27fb08[_0xb9bd('0x44')]);_0x9cc200[_0xb9bd('0x45')]=_[_0xb9bd('0x46')](_0x9cc200[_0xb9bd('0x42')],_0x9cc200[_0xb9bd('0x44')]);_0x3ec240[_0xb9bd('0x47')]=_[_0xb9bd('0x46')](_0x9cc200[_0xb9bd('0x42')],qs[_0xb9bd('0x57')](_0x27fb08[_0xb9bd('0x44')][_0xb9bd('0x57')]));_0x3ec240['attributes']=_0x3ec240['attributes'][_0xb9bd('0x48')]?_0x3ec240['attributes']:_0x9cc200[_0xb9bd('0x42')];_0x3ec240[_0xb9bd('0x4a')]=qs[_0xb9bd('0x4b')](_0x27fb08['query']['sort']);_0x3ec240[_0xb9bd('0x4c')]=qs['filters'](_['pick'](_0x27fb08[_0xb9bd('0x44')],_0x9cc200['filters']));if(_0x27fb08['query'][_0xb9bd('0x4f')]){_0x3ec240[_0xb9bd('0x4c')]=_[_0xb9bd('0x4e')](_0x3ec240['where'],{'$or':_[_0xb9bd('0x33')](_0x3ec240[_0xb9bd('0x47')],function(_0x2455d8){var _0x22c6f9={};_0x22c6f9[_0x2455d8]={'$like':'%'+_0x27fb08[_0xb9bd('0x44')][_0xb9bd('0x4f')]+'%'};return _0x22c6f9;})});}_0x3ec240=_[_0xb9bd('0x4e')]({},_0x3ec240,_0x27fb08[_0xb9bd('0x50')]);return _0x5d3471['getBlackLists'](_0x3ec240);}})[_0xb9bd('0x2b')](function(_0x273898){if(_0x273898){_0x23b2a6=_0x273898[_0xb9bd('0x48')];if(!_0x27fb08[_0xb9bd('0x44')][_0xb9bd('0x66')](_0xb9bd('0x49'))){_0x3ec240[_0xb9bd('0x23')]=qs[_0xb9bd('0x23')](_0x27fb08[_0xb9bd('0x44')][_0xb9bd('0x23')]);_0x3ec240[_0xb9bd('0x21')]=qs[_0xb9bd('0x21')](_0x27fb08[_0xb9bd('0x44')][_0xb9bd('0x21')]);}return _0x5d3471['getBlackLists'](_0x3ec240);}})[_0xb9bd('0x2b')](function(_0x2c894b){if(_0x2c894b){return _0x2c894b?{'count':_0x23b2a6,'rows':_0x2c894b}:null;}})[_0xb9bd('0x2b')](respondWithResult(_0x4b6ca5,null))[_0xb9bd('0x54')](handleError(_0x4b6ca5,null));};exports[_0xb9bd('0xc2')]=function(_0x4be017,_0x5e59f8,_0x5c1185){var _0x5c46d6,_0x132129;return db['VoiceQueue'][_0xb9bd('0x37')]({'where':{'id':_0x4be017['params']['id']}})['then'](handleEntityNotFound(_0x5e59f8,null))[_0xb9bd('0x2b')](function(_0x5898dd){if(_0x5898dd){_0x132129=_0x5898dd;return _0x5898dd['addBlackLists'](_0x4be017[_0xb9bd('0x5a')][_0xb9bd('0x93')],_[_0xb9bd('0x5f')](_0x4be017[_0xb9bd('0x5a')],['ids','id'])||{});}return null;})[_0xb9bd('0xa1')](function(_0x85a455){var _0x4cc349;_0x5c46d6=_0x85a455||[];var _0x4d9e26=[];if(_0x85a455){for(var _0x1221a8=0x0;_0x1221a8<_0x85a455[_0xb9bd('0x48')];_0x1221a8+=0x1){var _0x22418e=_0x85a455[_0x1221a8]['get']({'plain':!![]});_0x4cc349=squel[_0xb9bd('0xb7')]()[_0xb9bd('0xb5')](_0xb9bd('0xc3'))[_0xb9bd('0xa4')]([_0xb9bd('0xa5'),'ContactId',_0xb9bd('0xaa'),_0xb9bd('0x6a'),_0xb9bd('0x61'),'updatedAt'],squel['select']()[_0xb9bd('0xa7')]('phone','phone')[_0xb9bd('0xa7')]('id',_0xb9bd('0xa8'))['field'](_0x22418e['CmListId'][_0xb9bd('0xa9')](),_0xb9bd('0xaa'))[_0xb9bd('0xa7')](_0x4be017[_0xb9bd('0x56')]['id'][_0xb9bd('0xa9')](),_0xb9bd('0x6a'))[_0xb9bd('0xa7')]('NOW()',_0xb9bd('0x61'))[_0xb9bd('0xa7')](_0xb9bd('0xc4'),_0xb9bd('0x60'))[_0xb9bd('0x86')]('cm_contacts')[_0xb9bd('0x4c')]('deletedAt\x20IS\x20NULL')[_0xb9bd('0x4c')](_0xb9bd('0xac'),_0x22418e['CmListId'][_0xb9bd('0xa9')]())[_0xb9bd('0x4c')]('phone\x20IS\x20NOT\x20NULL'))[_0xb9bd('0xa9')]();_0x4d9e26[_0xb9bd('0x8c')](db[_0xb9bd('0x77')]['query'](_0x4cc349));}return BPromise[_0xb9bd('0x99')](_0x4d9e26);}})[_0xb9bd('0x2b')](function(){return _0x5c46d6;})[_0xb9bd('0x2b')](respondWithResult(_0x5e59f8,null))[_0xb9bd('0x54')](handleError(_0x5e59f8,null));};exports['removeBlackLists']=function(_0x15a495,_0x50363c,_0x4ad295){return db[_0xb9bd('0x3e')]['find']({'where':{'id':_0x15a495[_0xb9bd('0x56')]['id']}})[_0xb9bd('0x2b')](handleEntityNotFound(_0x50363c,null))['then'](function(_0x6e7255){if(_0x6e7255){return _0x6e7255[_0xb9bd('0xc5')](_0x15a495[_0xb9bd('0x44')][_0xb9bd('0x93')]);}})[_0xb9bd('0x2b')](function(_0xc12f0d){if(_0xc12f0d){return db[_0xb9bd('0x6d')][_0xb9bd('0x2c')]({'where':{'ListId':_0x15a495[_0xb9bd('0x44')][_0xb9bd('0x93')],'VoiceQueueId':_0x15a495[_0xb9bd('0x56')]['id']}})['then'](function(){return _0xc12f0d;});}})['then'](respondWithStatusCode(_0x50363c,null))[_0xb9bd('0x54')](handleError(_0x50363c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 168dd71..172a58a 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 _0x8595=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x1e14d8,_0x43f992){var _0x27b1ce=function(_0x4c5e55){while(--_0x4c5e55){_0x1e14d8['push'](_0x1e14d8['shift']());}};_0x27b1ce(++_0x43f992);}(_0x8595,0x171));var _0x5859=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x8595[_0x409353];return _0x4f4b59;};'use strict';var EventEmitter=require(_0x5859('0x0'));var VoiceQueue=require(_0x5859('0x1'))['db'][_0x5859('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5859('0x3')](0x0);var events={'afterCreate':_0x5859('0x4'),'afterUpdate':_0x5859('0x5'),'afterDestroy':'remove'};function emitEvent(_0x504cfe){return function(_0x40ef07,_0x4ed54f,_0x523064){VoiceQueueEvents[_0x5859('0x6')](_0x504cfe+':'+_0x40ef07['id'],_0x40ef07);VoiceQueueEvents[_0x5859('0x6')](_0x504cfe,_0x40ef07);_0x523064(null);};}for(var e in events){if(events[_0x5859('0x7')](e)){var event=events[e];VoiceQueue[_0x5859('0x8')](e,emitEvent(event));}}module[_0x5859('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x598d=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1088d5,_0x1d6044){var _0x3f05e2=function(_0x4467c5){while(--_0x4467c5){_0x1088d5['push'](_0x1088d5['shift']());}};_0x3f05e2(++_0x1d6044);}(_0x598d,0x160));var _0xd598=function(_0x17af76,_0x4604bb){_0x17af76=_0x17af76-0x0;var _0x22c8e0=_0x598d[_0x17af76];return _0x22c8e0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xd598('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd598('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd598('0x2'),'afterDestroy':_0xd598('0x3')};function emitEvent(_0x2b2b64){return function(_0x12f806,_0x5f265b,_0x3a38e0){VoiceQueueEvents[_0xd598('0x4')](_0x2b2b64+':'+_0x12f806['id'],_0x12f806);VoiceQueueEvents['emit'](_0x2b2b64,_0x12f806);_0x3a38e0(null);};}for(var e in events){if(events[_0xd598('0x5')](e)){var event=events[e];VoiceQueue[_0xd598('0x6')](e,emitEvent(event));}}module[_0xd598('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 76f6ec9..78b93cf 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x582fd4,_0x4f336d){var _0x5725c5=function(_0x338ba4){while(--_0x338ba4){_0x582fd4['push'](_0x582fd4['shift']());}};_0x5725c5(++_0x4f336d);}(_0xedd9,0xfc));var _0x9edd=function(_0x518d16,_0x53cb8d){_0x518d16=_0x518d16-0x0;var _0x4d3bdc=_0xedd9[_0x518d16];return _0x4d3bdc;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1ca928,_0x26f4dd){var _0x138818=function(_0x344077){while(--_0x344077){_0x1ca928['push'](_0x1ca928['shift']());}};_0x138818(++_0x26f4dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 717f2c3..f4b928a 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 _0xaf77=['VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f3f71,_0x1e35ce){var _0x559c25=function(_0x1d874e){while(--_0x1d874e){_0x4f3f71['push'](_0x4f3f71['shift']());}};_0x559c25(++_0x1e35ce);}(_0xaf77,0x16f));var _0x7af7=function(_0x2a69b5,_0xa0fe8e){_0x2a69b5=_0x2a69b5-0x0;var _0x14622e=_0xaf77[_0x2a69b5];return _0x14622e;};'use strict';var _=require(_0x7af7('0x0'));var util=require('util');var moment=require(_0x7af7('0x1'));var BPromise=require(_0x7af7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7af7('0x3'));var db=require(_0x7af7('0x4'))['db'];var utils=require(_0x7af7('0x5'));var logger=require('../../config/logger')(_0x7af7('0x6'));var config=require(_0x7af7('0x7'));var jayson=require(_0x7af7('0x8'));var client=jayson[_0x7af7('0x9')][_0x7af7('0xa')]({'port':0x232a});config[_0x7af7('0xb')]=_[_0x7af7('0xc')](config[_0x7af7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7af7('0xd'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x7af7('0xe')](socket);function respondWithRpcPromise(_0x4bf17f,_0x567d3a,_0x4c5627){return new BPromise(function(_0x8b6569,_0x382cfd){return client['request'](_0x4bf17f,_0x4c5627)[_0x7af7('0xf')](function(_0x5e945d){logger[_0x7af7('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x567d3a,_0x7af7('0x11'));logger[_0x7af7('0x12')](_0x7af7('0x13'),_0x567d3a,'request\x20sent',JSON[_0x7af7('0x14')](_0x5e945d));if(_0x5e945d[_0x7af7('0x15')]){if(_0x5e945d[_0x7af7('0x15')][_0x7af7('0x16')]===0x1f4){logger[_0x7af7('0x15')](_0x7af7('0x17'),_0x567d3a,_0x5e945d[_0x7af7('0x15')]['message']);return _0x382cfd(_0x5e945d['error'][_0x7af7('0x18')]);}logger[_0x7af7('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x567d3a,_0x5e945d['error'][_0x7af7('0x18')]);return _0x8b6569(_0x5e945d[_0x7af7('0x15')][_0x7af7('0x18')]);}else{logger[_0x7af7('0x10')](_0x7af7('0x17'),_0x567d3a,_0x7af7('0x11'));_0x8b6569(_0x5e945d['result'][_0x7af7('0x18')]);}})[_0x7af7('0x19')](function(_0x2ace0e){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x567d3a,_0x2ace0e);_0x382cfd(_0x2ace0e);});});}exports[_0x7af7('0x1a')]=function(_0x50e789){var _0x217e12=this;return new Promise(function(_0x42c44f,_0x4305b7){return db[_0x7af7('0x1b')][_0x7af7('0x1c')]({'raw':_0x50e789[_0x7af7('0x1d')]?_0x50e789[_0x7af7('0x1d')][_0x7af7('0x1e')]===undefined?!![]:![]:!![],'where':_0x50e789[_0x7af7('0x1d')]?_0x50e789['options'][_0x7af7('0x1f')]||null:null,'attributes':_0x50e789[_0x7af7('0x1d')]?_0x50e789['options'][_0x7af7('0x20')]||null:null,'limit':_0x50e789['options']?_0x50e789[_0x7af7('0x1d')][_0x7af7('0x21')]||null:null,'include':_0x50e789[_0x7af7('0x1d')]?_0x50e789['options'][_0x7af7('0x22')]?_[_0x7af7('0x23')](_0x50e789[_0x7af7('0x1d')][_0x7af7('0x22')],function(_0x433b9e){return{'model':db[_0x433b9e[_0x7af7('0x24')]],'as':_0x433b9e['as'],'attributes':_0x433b9e[_0x7af7('0x20')],'include':_0x433b9e[_0x7af7('0x22')]?_[_0x7af7('0x23')](_0x433b9e[_0x7af7('0x22')],function(_0x32971b){return{'model':db[_0x32971b[_0x7af7('0x24')]],'as':_0x32971b['as'],'attributes':_0x32971b[_0x7af7('0x20')],'include':_0x32971b[_0x7af7('0x22')]?_['map'](_0x32971b['include'],function(_0x2e90d6){return{'model':db[_0x2e90d6[_0x7af7('0x24')]],'as':_0x2e90d6['as'],'attributes':_0x2e90d6['attributes']};}):[]};}):[]};}):[]:[]})[_0x7af7('0xf')](function(_0x537758){logger[_0x7af7('0x10')]('GetVoiceQueue',_0x50e789);logger[_0x7af7('0x12')]('GetVoiceQueue',_0x50e789,JSON[_0x7af7('0x14')](_0x537758));_0x42c44f(_0x537758);})['catch'](function(_0x4fe70b){logger[_0x7af7('0x15')]('GetVoiceQueue',_0x4fe70b['message'],_0x50e789);_0x4305b7(_0x217e12[_0x7af7('0x15')](0x1f4,_0x4fe70b['message']));});});};exports[_0x7af7('0x25')]=function(_0x54c52a){var _0x286af4=this;return new Promise(function(_0x5c882d,_0x34c4de){return db['VoiceQueue'][_0x7af7('0x26')]({'raw':_0x54c52a[_0x7af7('0x1d')]?_0x54c52a['options']['raw']===undefined?!![]:![]:!![],'where':_0x54c52a[_0x7af7('0x1d')]?_0x54c52a[_0x7af7('0x1d')][_0x7af7('0x1f')]||null:null,'attributes':_0x54c52a['options']?_0x54c52a[_0x7af7('0x1d')][_0x7af7('0x20')]||null:null,'include':_0x54c52a[_0x7af7('0x1d')]?_0x54c52a[_0x7af7('0x1d')][_0x7af7('0x22')]?_[_0x7af7('0x23')](_0x54c52a[_0x7af7('0x1d')][_0x7af7('0x22')],function(_0xd439be){return{'model':db[_0xd439be['model']],'as':_0xd439be['as'],'attributes':_0xd439be[_0x7af7('0x20')],'include':_0xd439be[_0x7af7('0x22')]?_[_0x7af7('0x23')](_0xd439be[_0x7af7('0x22')],function(_0x148733){return{'model':db[_0x148733[_0x7af7('0x24')]],'as':_0x148733['as'],'attributes':_0x148733[_0x7af7('0x20')],'include':_0x148733[_0x7af7('0x22')]?_[_0x7af7('0x23')](_0x148733[_0x7af7('0x22')],function(_0x382fdb){return{'model':db[_0x382fdb[_0x7af7('0x24')]],'as':_0x382fdb['as'],'attributes':_0x382fdb[_0x7af7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7af7('0xf')](function(_0xc9af08){logger['info'](_0x7af7('0x25'),_0x54c52a);logger['debug'](_0x7af7('0x25'),_0x54c52a,JSON[_0x7af7('0x14')](_0xc9af08));_0x5c882d(_0xc9af08);})[_0x7af7('0x19')](function(_0x5b2cc2){logger[_0x7af7('0x15')](_0x7af7('0x25'),_0x5b2cc2[_0x7af7('0x18')],_0x54c52a);_0x34c4de(_0x286af4[_0x7af7('0x15')](0x1f4,_0x5b2cc2[_0x7af7('0x18')]));});});}; \ No newline at end of file +var _0x470c=['options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','VoiceQueue','find','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','VoiceQueue,\x20%s,\x20%s','message','GetVoiceQueue','findAll'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x470c,0xf6));var _0xc470=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x470c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xc470('0x0'));var moment=require(_0xc470('0x1'));var BPromise=require('bluebird');var rs=require(_0xc470('0x2'));var fs=require('fs');var Redis=require(_0xc470('0x3'));var db=require(_0xc470('0x4'))['db'];var utils=require(_0xc470('0x5'));var logger=require(_0xc470('0x6'))(_0xc470('0x7'));var config=require('../../config/environment');var jayson=require(_0xc470('0x8'));var client=jayson[_0xc470('0x9')][_0xc470('0xa')]({'port':0x232a});config['redis']=_[_0xc470('0xb')](config[_0xc470('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc470('0xd'))(new Redis(config['redis']));require(_0xc470('0xe'))[_0xc470('0xf')](socket);function respondWithRpcPromise(_0x4814dc,_0x542dd5,_0x32039d){return new BPromise(function(_0x53010e,_0x15bc79){return client[_0xc470('0x10')](_0x4814dc,_0x32039d)[_0xc470('0x11')](function(_0x13eed1){logger[_0xc470('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x542dd5,_0xc470('0x13'));logger[_0xc470('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x542dd5,_0xc470('0x13'),JSON[_0xc470('0x15')](_0x13eed1));if(_0x13eed1[_0xc470('0x16')]){if(_0x13eed1[_0xc470('0x16')]['code']===0x1f4){logger['error'](_0xc470('0x17'),_0x542dd5,_0x13eed1[_0xc470('0x16')]['message']);return _0x15bc79(_0x13eed1[_0xc470('0x16')][_0xc470('0x18')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x542dd5,_0x13eed1[_0xc470('0x16')]['message']);return _0x53010e(_0x13eed1['error'][_0xc470('0x18')]);}else{logger[_0xc470('0x12')](_0xc470('0x17'),_0x542dd5,'request\x20sent');_0x53010e(_0x13eed1['result']['message']);}})['catch'](function(_0x3f7b9f){logger['error'](_0xc470('0x17'),_0x542dd5,_0x3f7b9f);_0x15bc79(_0x3f7b9f);});});}exports[_0xc470('0x19')]=function(_0x2e92f8){var _0x28f7b7=this;return new Promise(function(_0x4f3159,_0x11aa85){return db['VoiceQueue'][_0xc470('0x1a')]({'raw':_0x2e92f8[_0xc470('0x1b')]?_0x2e92f8['options'][_0xc470('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e92f8[_0xc470('0x1b')]?_0x2e92f8[_0xc470('0x1b')][_0xc470('0x1d')]||null:null,'attributes':_0x2e92f8['options']?_0x2e92f8[_0xc470('0x1b')][_0xc470('0x1e')]||null:null,'limit':_0x2e92f8[_0xc470('0x1b')]?_0x2e92f8['options'][_0xc470('0x1f')]||null:null,'include':_0x2e92f8[_0xc470('0x1b')]?_0x2e92f8[_0xc470('0x1b')][_0xc470('0x20')]?_[_0xc470('0x21')](_0x2e92f8['options'][_0xc470('0x20')],function(_0x47dd15){return{'model':db[_0x47dd15[_0xc470('0x22')]],'as':_0x47dd15['as'],'attributes':_0x47dd15[_0xc470('0x1e')],'include':_0x47dd15[_0xc470('0x20')]?_[_0xc470('0x21')](_0x47dd15[_0xc470('0x20')],function(_0x24e095){return{'model':db[_0x24e095[_0xc470('0x22')]],'as':_0x24e095['as'],'attributes':_0x24e095['attributes'],'include':_0x24e095['include']?_[_0xc470('0x21')](_0x24e095[_0xc470('0x20')],function(_0x1e86cc){return{'model':db[_0x1e86cc[_0xc470('0x22')]],'as':_0x1e86cc['as'],'attributes':_0x1e86cc[_0xc470('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548116){logger[_0xc470('0x12')](_0xc470('0x19'),_0x2e92f8);logger[_0xc470('0x14')]('GetVoiceQueue',_0x2e92f8,JSON['stringify'](_0x548116));_0x4f3159(_0x548116);})['catch'](function(_0x4ac738){logger[_0xc470('0x16')]('GetVoiceQueue',_0x4ac738[_0xc470('0x18')],_0x2e92f8);_0x11aa85(_0x28f7b7[_0xc470('0x16')](0x1f4,_0x4ac738[_0xc470('0x18')]));});});};exports[_0xc470('0x23')]=function(_0x43b437){var _0xe780b2=this;return new Promise(function(_0x49ead8,_0x5403c8){return db[_0xc470('0x24')][_0xc470('0x25')]({'raw':_0x43b437['options']?_0x43b437[_0xc470('0x1b')][_0xc470('0x1c')]===undefined?!![]:![]:!![],'where':_0x43b437[_0xc470('0x1b')]?_0x43b437[_0xc470('0x1b')][_0xc470('0x1d')]||null:null,'attributes':_0x43b437['options']?_0x43b437[_0xc470('0x1b')]['attributes']||null:null,'include':_0x43b437['options']?_0x43b437[_0xc470('0x1b')][_0xc470('0x20')]?_[_0xc470('0x21')](_0x43b437[_0xc470('0x1b')][_0xc470('0x20')],function(_0x20e9a0){return{'model':db[_0x20e9a0[_0xc470('0x22')]],'as':_0x20e9a0['as'],'attributes':_0x20e9a0[_0xc470('0x1e')],'include':_0x20e9a0[_0xc470('0x20')]?_[_0xc470('0x21')](_0x20e9a0[_0xc470('0x20')],function(_0x1d6353){return{'model':db[_0x1d6353[_0xc470('0x22')]],'as':_0x1d6353['as'],'attributes':_0x1d6353['attributes'],'include':_0x1d6353[_0xc470('0x20')]?_[_0xc470('0x21')](_0x1d6353['include'],function(_0x3a052a){return{'model':db[_0x3a052a[_0xc470('0x22')]],'as':_0x3a052a['as'],'attributes':_0x3a052a[_0xc470('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc470('0x11')](function(_0x519607){logger[_0xc470('0x12')](_0xc470('0x23'),_0x43b437);logger[_0xc470('0x14')](_0xc470('0x23'),_0x43b437,JSON[_0xc470('0x15')](_0x519607));_0x49ead8(_0x519607);})[_0xc470('0x26')](function(_0x402443){logger[_0xc470('0x16')](_0xc470('0x23'),_0x402443['message'],_0x43b437);_0x5403c8(_0xe780b2[_0xc470('0x16')](0x1f4,_0x402443['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 9642943..499387f 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 _0x44ad=['emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3a7111,_0x1fad2d){var _0x1a38f3=function(_0x18ae14){while(--_0x18ae14){_0x3a7111['push'](_0x3a7111['shift']());}};_0x1a38f3(++_0x1fad2d);}(_0x44ad,0x15d));var _0xd44a=function(_0x6e609d,_0x455314){_0x6e609d=_0x6e609d-0x0;var _0x5b78ce=_0x44ad[_0x6e609d];return _0x5b78ce;};'use strict';var VoiceQueueEvents=require(_0xd44a('0x0'));var events=[_0xd44a('0x1'),_0xd44a('0x2'),'update'];function createListener(_0x566276,_0x4cb6bd){return function(_0x1b2638){_0x4cb6bd[_0xd44a('0x3')](_0x566276,_0x1b2638);};}function removeListener(_0x1b5222,_0x2fcbb5){return function(){VoiceQueueEvents[_0xd44a('0x4')](_0x1b5222,_0x2fcbb5);};}exports[_0xd44a('0x5')]=function(_0x59f19e){for(var _0x202e34=0x0,_0x286588=events[_0xd44a('0x6')];_0x202e34<_0x286588;_0x202e34++){var _0x5b55af=events[_0x202e34];var _0x1b77dc=createListener(_0xd44a('0x7')+_0x5b55af,_0x59f19e);VoiceQueueEvents['on'](_0x5b55af,_0x1b77dc);}}; \ No newline at end of file +var _0x3901=['voiceQueue:','./voiceQueue.events','update','emit','removeListener','register','length'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x3901,0x16d));var _0x1390=function(_0x4666c5,_0x3ff2f2){_0x4666c5=_0x4666c5-0x0;var _0x5a0a31=_0x3901[_0x4666c5];return _0x5a0a31;};'use strict';var VoiceQueueEvents=require(_0x1390('0x0'));var events=['save','remove',_0x1390('0x1')];function createListener(_0x22cf12,_0x17dc28){return function(_0xd77fb){_0x17dc28[_0x1390('0x2')](_0x22cf12,_0xd77fb);};}function removeListener(_0x80e4c7,_0x418705){return function(){VoiceQueueEvents[_0x1390('0x3')](_0x80e4c7,_0x418705);};}exports[_0x1390('0x4')]=function(_0x1923d1){for(var _0x15ac9e=0x0,_0x2044d9=events[_0x1390('0x5')];_0x15ac9e<_0x2044d9;_0x15ac9e++){var _0x1d0988=events[_0x15ac9e];var _0x2e4d90=createListener(_0x1390('0x6')+_0x1d0988,_0x1923d1);VoiceQueueEvents['on'](_0x1d0988,_0x2e4d90);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 9311f19..469545d 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 _0x1f7a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','show','post','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x3a946a,_0xb9e500){var _0x50e9e7=function(_0x224529){while(--_0x224529){_0x3a946a['push'](_0x3a946a['shift']());}};_0x50e9e7(++_0xb9e500);}(_0x1f7a,0xb1));var _0xa1f7=function(_0x9ceff7,_0x5892f2){_0x9ceff7=_0x9ceff7-0x0;var _0x4c936c=_0x1f7a[_0x9ceff7];return _0x4c936c;};'use strict';var multer=require(_0xa1f7('0x0'));var util=require('util');var path=require(_0xa1f7('0x1'));var timeout=require(_0xa1f7('0x2'));var express=require('express');var router=express[_0xa1f7('0x3')]();var fs_extra=require(_0xa1f7('0x4'));var auth=require(_0xa1f7('0x5'));var interaction=require(_0xa1f7('0x6'));var config=require('../../config/environment');var controller=require(_0xa1f7('0x7'));router[_0xa1f7('0x8')]('/',auth[_0xa1f7('0x9')](),controller[_0xa1f7('0xa')]);router[_0xa1f7('0x8')](_0xa1f7('0xb'),auth[_0xa1f7('0x9')](),controller[_0xa1f7('0xc')]);router[_0xa1f7('0x8')]('/index',auth['isAuthenticated'](),controller[_0xa1f7('0xd')]);router[_0xa1f7('0x8')]('/:id',auth[_0xa1f7('0x9')](),controller[_0xa1f7('0xe')]);router[_0xa1f7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa1f7('0x10')]);router['delete'](_0xa1f7('0x11'),auth[_0xa1f7('0x9')](),controller[_0xa1f7('0x12')]);module[_0xa1f7('0x13')]=router; \ No newline at end of file +var _0x93e0=['delete','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put'];(function(_0x555e79,_0x9ee00e){var _0x36cb67=function(_0x207ec7){while(--_0x207ec7){_0x555e79['push'](_0x555e79['shift']());}};_0x36cb67(++_0x9ee00e);}(_0x93e0,0x1e1));var _0x093e=function(_0x23de48,_0x3d0849){_0x23de48=_0x23de48-0x0;var _0x5560fc=_0x93e0[_0x23de48];return _0x5560fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x093e('0x0'));var timeout=require(_0x093e('0x1'));var express=require(_0x093e('0x2'));var router=express[_0x093e('0x3')]();var fs_extra=require(_0x093e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x093e('0x5'));var config=require(_0x093e('0x6'));var controller=require('./voiceQueueReport.controller');router[_0x093e('0x7')]('/',auth[_0x093e('0x8')](),controller[_0x093e('0x9')]);router[_0x093e('0x7')](_0x093e('0xa'),auth[_0x093e('0x8')](),controller[_0x093e('0xb')]);router[_0x093e('0x7')](_0x093e('0xc'),auth[_0x093e('0x8')](),controller[_0x093e('0xd')]);router[_0x093e('0x7')](_0x093e('0xe'),auth[_0x093e('0x8')](),controller[_0x093e('0xf')]);router[_0x093e('0x10')]('/',auth[_0x093e('0x8')](),controller[_0x093e('0x11')]);router[_0x093e('0x12')](_0x093e('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x093e('0x13')]('/:id',auth[_0x093e('0x8')](),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 2e4822c..9df2b54 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 _0x6eb8=['YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x6eb8,0xf8));var _0x86eb=function(_0x222e27,_0x52e835){_0x222e27=_0x222e27-0x0;var _0xc79276=_0x6eb8[_0x222e27];return _0xc79276;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x86eb('0x0')]},'uniqueid':{'type':Sequelize[_0x86eb('0x0')]},'calleridnum':{'type':Sequelize[_0x86eb('0x0')]},'calleridname':{'type':Sequelize[_0x86eb('0x0')]},'queue':{'type':Sequelize[_0x86eb('0x0')]},'queuecallerjoinAt':{'type':Sequelize[_0x86eb('0x1')]},'queuecallerleaveAt':{'type':Sequelize[_0x86eb('0x1')],'set':function(_0x5e33be){var _0x32f5d8=moment(_0x5e33be);var _0xd19e88=moment(this[_0x86eb('0x2')](_0x86eb('0x3')))[_0x86eb('0x4')](_0x86eb('0x5'));var _0x187149=_0x32f5d8['diff'](_0xd19e88,_0x86eb('0x6'));this[_0x86eb('0x7')]('queuecallerleaveAt',_0x5e33be);this['setDataValue']('holdtime',_0x187149||null);}},'position':{'type':Sequelize[_0x86eb('0x8')]},'count':{'type':Sequelize[_0x86eb('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x86eb('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x86eb('0x1')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x86eb('0x1')]},'queuecallerexit':{'type':Sequelize[_0x86eb('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x86eb('0x0')],'comment':_0x86eb('0xa')},'originalposition':{'type':Sequelize[_0x86eb('0x8')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x86eb('0x0')]},'connectedlinename':{'type':Sequelize[_0x86eb('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x86eb('0x0')]},'priority':{'type':Sequelize[_0x86eb('0x0')]},'holdtime':{'type':Sequelize[_0x86eb('0x8')]},'mohtime':{'type':Sequelize[_0x86eb('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x86eb('0x0')]},'transfer':{'type':Sequelize[_0x86eb('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x86eb('0x0')]},'disposition':{'type':Sequelize[_0x86eb('0x0')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x86eb('0x0')]},'queuecallerenterreason':{'type':Sequelize[_0x86eb('0x8')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x35e3=['queuecallerjoinAt','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','exports','STRING','DATE'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x35e3,0x1b4));var _0x335e=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0x35e3[_0x5581ba];return _0x1e927f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x335e('0x0'));module[_0x335e('0x1')]={'type':{'type':Sequelize[_0x335e('0x2')]},'uniqueid':{'type':Sequelize[_0x335e('0x2')]},'calleridnum':{'type':Sequelize[_0x335e('0x2')]},'calleridname':{'type':Sequelize[_0x335e('0x2')]},'queue':{'type':Sequelize[_0x335e('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x335e('0x3')],'set':function(_0x35513c){var _0x31c6e5=moment(_0x35513c);var _0x32a574=moment(this['getDataValue'](_0x335e('0x4')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3288c7=_0x31c6e5[_0x335e('0x5')](_0x32a574,_0x335e('0x6'));this[_0x335e('0x7')]('queuecallerleaveAt',_0x35513c);this[_0x335e('0x7')]('holdtime',_0x3288c7||null);}},'position':{'type':Sequelize[_0x335e('0x8')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x335e('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x335e('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x335e('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x335e('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x335e('0xa')},'originalposition':{'type':Sequelize[_0x335e('0x8')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x335e('0x2')]},'connectedlinename':{'type':Sequelize[_0x335e('0x2')]},'accountcode':{'type':Sequelize[_0x335e('0x2')]},'context':{'type':Sequelize[_0x335e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x335e('0x8')]},'mohtime':{'type':Sequelize[_0x335e('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x335e('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x335e('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x335e('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x335e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x335e('0x2')]},'disposition':{'type':Sequelize[_0x335e('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x335e('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x335e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 4300d66..02dc6da 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 _0xe092=['register','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','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','redis','defaults','socket.io-emitter','./voiceQueueReport.socket'];(function(_0x1f5a16,_0x237c37){var _0x34db7a=function(_0x125ffb){while(--_0x125ffb){_0x1f5a16['push'](_0x1f5a16['shift']());}};_0x34db7a(++_0x237c37);}(_0xe092,0xda));var _0x2e09=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0xe092[_0x3358ba];return _0x296e73;};'use strict';var emlformat=require(_0x2e09('0x0'));var rimraf=require(_0x2e09('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e09('0x2'));var rp=require(_0x2e09('0x3'));var moment=require(_0x2e09('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2e09('0x5'));var util=require('util');var path=require(_0x2e09('0x6'));var sox=require(_0x2e09('0x7'));var csv=require(_0x2e09('0x8'));var ejs=require(_0x2e09('0x9'));var fs=require('fs');var fs_extra=require(_0x2e09('0xa'));var _=require(_0x2e09('0xb'));var squel=require(_0x2e09('0xc'));var crypto=require('crypto');var jsforce=require(_0x2e09('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e09('0xe'));var Redis=require(_0x2e09('0xf'));var authService=require(_0x2e09('0x10'));var qs=require(_0x2e09('0x11'));var as=require(_0x2e09('0x12'));var hardwareService=require(_0x2e09('0x13'));var logger=require(_0x2e09('0x14'))('api');var utils=require(_0x2e09('0x15'));var config=require(_0x2e09('0x16'));var licenseUtil=require(_0x2e09('0x17'));var db=require('../../mysqldb')['db'];config[_0x2e09('0x18')]=_[_0x2e09('0x19')](config[_0x2e09('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e09('0x1a'))(new Redis(config['redis']));require(_0x2e09('0x1b'))[_0x2e09('0x1c')](socket);function respondWithStatusCode(_0x46dbeb,_0x45c0da){_0x45c0da=_0x45c0da||0xcc;return function(_0x9c8a98){if(_0x9c8a98){return _0x46dbeb[_0x2e09('0x1d')](_0x45c0da);}return _0x46dbeb['status'](_0x45c0da)['end']();};}function respondWithResult(_0x523799,_0x20574d){_0x20574d=_0x20574d||0xc8;return function(_0x3c1156){if(_0x3c1156){return _0x523799[_0x2e09('0x1e')](_0x20574d)['json'](_0x3c1156);}};}function respondWithFilteredResult(_0x2252fd,_0x33b406){return function(_0x3bc5fe){if(_0x3bc5fe){var _0x33af10=typeof _0x33b406[_0x2e09('0x1f')]===_0x2e09('0x20')&&typeof _0x33b406['limit']==='undefined';var _0x2ed2e8=_0x3bc5fe['count'];var _0x59d88a=_0x33af10?0x0:_0x33b406[_0x2e09('0x1f')];var _0x1c450c=_0x33af10?_0x3bc5fe[_0x2e09('0x21')]:_0x33b406['offset']+_0x33b406[_0x2e09('0x22')];var _0x10df1c;if(_0x1c450c>=_0x2ed2e8){_0x1c450c=_0x2ed2e8;_0x10df1c=0xc8;}else{_0x10df1c=0xce;}_0x2252fd[_0x2e09('0x1e')](_0x10df1c);return _0x2252fd[_0x2e09('0x23')]('Content-Range',_0x59d88a+'-'+_0x1c450c+'/'+_0x2ed2e8)['json'](_0x3bc5fe);}return null;};}function patchUpdates(_0x5e15d7){return function(_0x32bc3a){try{jsonpatch[_0x2e09('0x24')](_0x32bc3a,_0x5e15d7,!![]);}catch(_0x14b014){return BPromise[_0x2e09('0x25')](_0x14b014);}return _0x32bc3a[_0x2e09('0x26')]();};}function saveUpdates(_0x34440f,_0x304e5a){return function(_0xe32af8){if(_0xe32af8){return _0xe32af8['update'](_0x34440f)[_0x2e09('0x27')](function(_0x494bb9){return _0x494bb9;});}return null;};}function removeEntity(_0xf6bd9b,_0x4975a9){return function(_0x560012){if(_0x560012){return _0x560012[_0x2e09('0x28')]()['then'](function(){_0xf6bd9b[_0x2e09('0x1e')](0xcc)[_0x2e09('0x29')]();});}};}function handleEntityNotFound(_0x403d37,_0x11a6a3){return function(_0x598041){if(!_0x598041){_0x403d37['sendStatus'](0x194);}return _0x598041;};}function handleError(_0x23c6b6,_0x110237){_0x110237=_0x110237||0x1f4;return function(_0x399446){logger[_0x2e09('0x2a')](_0x399446[_0x2e09('0x2b')]);if(_0x399446[_0x2e09('0x2c')]){delete _0x399446['name'];}_0x23c6b6[_0x2e09('0x1e')](_0x110237)[_0x2e09('0x2d')](_0x399446);};}exports[_0x2e09('0x2e')]=function(_0x5e082a,_0x3ab44d){var _0x4bdf5c={},_0x453437={},_0x457199={'count':0x0,'rows':[]};var _0x26dd93=_[_0x2e09('0x2f')](db[_0x2e09('0x30')][_0x2e09('0x31')],function(_0x40ad1a){return{'name':_0x40ad1a[_0x2e09('0x32')],'type':_0x40ad1a[_0x2e09('0x33')][_0x2e09('0x34')]};});_0x453437[_0x2e09('0x35')]=_['map'](_0x26dd93,_0x2e09('0x2c'));_0x453437[_0x2e09('0x36')]=_[_0x2e09('0x37')](_0x5e082a['query']);_0x453437['filters']=_[_0x2e09('0x38')](_0x453437[_0x2e09('0x35')],_0x453437[_0x2e09('0x36')]);_0x4bdf5c[_0x2e09('0x39')]=_[_0x2e09('0x38')](_0x453437['model'],qs[_0x2e09('0x3a')](_0x5e082a[_0x2e09('0x36')]['fields']));_0x4bdf5c['attributes']=_0x4bdf5c[_0x2e09('0x39')][_0x2e09('0x3b')]?_0x4bdf5c[_0x2e09('0x39')]:_0x453437[_0x2e09('0x35')];if(!_0x5e082a[_0x2e09('0x36')][_0x2e09('0x3c')](_0x2e09('0x3d'))){_0x4bdf5c[_0x2e09('0x22')]=qs[_0x2e09('0x22')](_0x5e082a[_0x2e09('0x36')][_0x2e09('0x22')]);_0x4bdf5c[_0x2e09('0x1f')]=qs[_0x2e09('0x1f')](_0x5e082a[_0x2e09('0x36')][_0x2e09('0x1f')]);}_0x4bdf5c[_0x2e09('0x3e')]=qs[_0x2e09('0x3f')](_0x5e082a[_0x2e09('0x36')][_0x2e09('0x3f')]);_0x4bdf5c['where']=qs[_0x2e09('0x40')](_[_0x2e09('0x41')](_0x5e082a[_0x2e09('0x36')],_0x453437[_0x2e09('0x40')]),_0x26dd93);if(_0x5e082a[_0x2e09('0x36')][_0x2e09('0x42')]){_0x4bdf5c[_0x2e09('0x43')]=_[_0x2e09('0x44')](_0x4bdf5c[_0x2e09('0x43')],{'$or':_[_0x2e09('0x2f')](_0x26dd93,function(_0x1444c2){if(_0x1444c2[_0x2e09('0x33')]!==_0x2e09('0x45')){var _0x399dc2={};_0x399dc2[_0x1444c2['name']]={'$like':'%'+_0x5e082a[_0x2e09('0x36')][_0x2e09('0x42')]+'%'};return _0x399dc2;}})});}_0x4bdf5c=_[_0x2e09('0x44')]({},_0x4bdf5c,_0x5e082a[_0x2e09('0x46')]);var _0x227072={'where':_0x4bdf5c[_0x2e09('0x43')]};return db['VoiceQueueReport']['count'](_0x227072)[_0x2e09('0x27')](function(_0x7e16cc){_0x457199[_0x2e09('0x21')]=_0x7e16cc;if(_0x5e082a[_0x2e09('0x36')][_0x2e09('0x47')]){_0x4bdf5c[_0x2e09('0x48')]=[{'all':!![]}];}return db[_0x2e09('0x30')]['findAll'](_0x4bdf5c);})[_0x2e09('0x27')](function(_0x40347b){_0x457199[_0x2e09('0x49')]=_0x40347b;return _0x457199;})['then'](respondWithFilteredResult(_0x3ab44d,_0x4bdf5c))['catch'](handleError(_0x3ab44d,null));};exports[_0x2e09('0x4a')]=function(_0x277719,_0x4cc564){var _0x221d18={'raw':![],'where':{'id':_0x277719[_0x2e09('0x4b')]['id']}},_0x275a71={};_0x275a71['model']=_['keys'](db[_0x2e09('0x30')]['rawAttributes']);_0x275a71[_0x2e09('0x36')]=_[_0x2e09('0x37')](_0x277719[_0x2e09('0x36')]);_0x275a71[_0x2e09('0x40')]=_[_0x2e09('0x38')](_0x275a71['model'],_0x275a71[_0x2e09('0x36')]);_0x221d18['attributes']=_[_0x2e09('0x38')](_0x275a71[_0x2e09('0x35')],qs[_0x2e09('0x3a')](_0x277719[_0x2e09('0x36')][_0x2e09('0x3a')]));_0x221d18[_0x2e09('0x39')]=_0x221d18[_0x2e09('0x39')]['length']?_0x221d18[_0x2e09('0x39')]:_0x275a71[_0x2e09('0x35')];if(_0x277719[_0x2e09('0x36')]['includeAll']){_0x221d18[_0x2e09('0x48')]=[{'all':!![]}];}_0x221d18=_[_0x2e09('0x44')]({},_0x221d18,_0x277719[_0x2e09('0x46')]);return db['VoiceQueueReport'][_0x2e09('0x4c')](_0x221d18)[_0x2e09('0x27')](handleEntityNotFound(_0x4cc564,null))['then'](respondWithResult(_0x4cc564,null))[_0x2e09('0x4d')](handleError(_0x4cc564,null));};exports[_0x2e09('0x4e')]=function(_0x9f8dfe,_0x4d35e0){return db[_0x2e09('0x30')]['create'](_0x9f8dfe[_0x2e09('0x4f')],{})['then'](respondWithResult(_0x4d35e0,0xc9))[_0x2e09('0x4d')](handleError(_0x4d35e0,null));};exports['update']=function(_0x16aef1,_0x2fc55a){if(_0x16aef1[_0x2e09('0x4f')]['id']){delete _0x16aef1[_0x2e09('0x4f')]['id'];}return db[_0x2e09('0x30')]['find']({'where':{'id':_0x16aef1[_0x2e09('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2fc55a,null))['then'](saveUpdates(_0x16aef1[_0x2e09('0x4f')],null))[_0x2e09('0x27')](respondWithResult(_0x2fc55a,null))[_0x2e09('0x4d')](handleError(_0x2fc55a,null));};exports[_0x2e09('0x28')]=function(_0x2e808c,_0x4ba886){return db[_0x2e09('0x30')][_0x2e09('0x4c')]({'where':{'id':_0x2e808c['params']['id']}})[_0x2e09('0x27')](handleEntityNotFound(_0x4ba886,null))[_0x2e09('0x27')](removeEntity(_0x4ba886,null))[_0x2e09('0x4d')](handleError(_0x4ba886,null));};exports[_0x2e09('0x50')]=function(_0x5774ee,_0x1b167a){return db[_0x2e09('0x30')][_0x2e09('0x50')]()['then'](respondWithResult(_0x1b167a,null))['catch'](handleError(_0x1b167a,null));};exports[_0x2e09('0x51')]=function(_0x2ae283,_0x3aabfa){var _0x137be6={},_0x577ce1={},_0x2054a4={'count':0x0,'rows':[]};_0x577ce1[_0x2e09('0x35')]=_[_0x2e09('0x37')](db[_0x2e09('0x30')][_0x2e09('0x31')]);_0x577ce1[_0x2e09('0x36')]=_[_0x2e09('0x37')](_0x2ae283[_0x2e09('0x36')]);_0x577ce1['filters']=_[_0x2e09('0x38')](_0x577ce1[_0x2e09('0x35')],_0x577ce1[_0x2e09('0x36')]);_0x137be6[_0x2e09('0x39')]=_[_0x2e09('0x38')](_0x577ce1['model'],qs[_0x2e09('0x3a')](_0x2ae283[_0x2e09('0x36')][_0x2e09('0x3a')]));_0x137be6[_0x2e09('0x39')]=_0x137be6['attributes'][_0x2e09('0x3b')]?_0x137be6['attributes']:_0x577ce1[_0x2e09('0x35')];if(!_0x2ae283[_0x2e09('0x36')][_0x2e09('0x3c')](_0x2e09('0x3d'))){_0x137be6[_0x2e09('0x22')]=qs['limit'](_0x2ae283[_0x2e09('0x36')][_0x2e09('0x22')]);_0x137be6[_0x2e09('0x1f')]=qs[_0x2e09('0x1f')](_0x2ae283[_0x2e09('0x36')][_0x2e09('0x1f')]);}_0x137be6['order']=qs['sort'](_0x2ae283[_0x2e09('0x36')]['sort']);_0x137be6[_0x2e09('0x43')]=qs[_0x2e09('0x40')](_[_0x2e09('0x41')](_0x2ae283[_0x2e09('0x36')],_0x577ce1['filters']));if(_0x2ae283['query'][_0x2e09('0x42')]){_0x137be6['where']=_[_0x2e09('0x44')](_0x137be6['where'],{'$or':_['map'](_0x137be6[_0x2e09('0x39')],function(_0x1a3a06){var _0x2fc7ed={};_0x2fc7ed[_0x1a3a06]={'$like':'%'+_0x2ae283[_0x2e09('0x36')]['filter']+'%'};return _0x2fc7ed;})});}_0x137be6=_[_0x2e09('0x44')]({},_0x137be6,_0x2ae283[_0x2e09('0x46')]);var _0x38a6df={'where':_0x137be6[_0x2e09('0x43')]};return db[_0x2e09('0x30')][_0x2e09('0x21')](_0x38a6df)[_0x2e09('0x27')](function(_0x17cd32){_0x2054a4[_0x2e09('0x21')]=_0x17cd32;if(_0x2ae283[_0x2e09('0x36')][_0x2e09('0x47')]){_0x137be6[_0x2e09('0x48')]=[{'all':!![]}];}return db[_0x2e09('0x30')]['findAll'](_0x137be6);})[_0x2e09('0x27')](function(_0x389668){_0x2054a4['rows']=_0x389668;return _0x2054a4;})[_0x2e09('0x27')](respondWithFilteredResult(_0x3aabfa,_0x137be6,'getVoiceQueuesReport'))[_0x2e09('0x4d')](handleError(_0x3aabfa,null,_0x2e09('0x51')));}; \ No newline at end of file +var _0x40dd=['./voiceQueueReport.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x3e36a2,_0x5a38fa){var _0x1dcc46=function(_0xfaebd7){while(--_0xfaebd7){_0x3e36a2['push'](_0x3e36a2['shift']());}};_0x1dcc46(++_0x5a38fa);}(_0x40dd,0x12a));var _0xd40d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x40dd[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xd40d('0x0'));var rimraf=require(_0xd40d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd40d('0x2'));var rp=require(_0xd40d('0x3'));var moment=require(_0xd40d('0x4'));var BPromise=require(_0xd40d('0x5'));var Mustache=require('mustache');var util=require(_0xd40d('0x6'));var path=require(_0xd40d('0x7'));var sox=require(_0xd40d('0x8'));var csv=require(_0xd40d('0x9'));var ejs=require(_0xd40d('0xa'));var fs=require('fs');var fs_extra=require(_0xd40d('0xb'));var _=require(_0xd40d('0xc'));var squel=require(_0xd40d('0xd'));var crypto=require(_0xd40d('0xe'));var jsforce=require(_0xd40d('0xf'));var deskjs=require(_0xd40d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd40d('0x11'));var Redis=require(_0xd40d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd40d('0x13'));var as=require(_0xd40d('0x14'));var hardwareService=require(_0xd40d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xd40d('0x16'));var config=require(_0xd40d('0x17'));var licenseUtil=require(_0xd40d('0x18'));var db=require('../../mysqldb')['db'];config[_0xd40d('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd40d('0x19')]));require(_0xd40d('0x1a'))[_0xd40d('0x1b')](socket);function respondWithStatusCode(_0x550635,_0x591bff){_0x591bff=_0x591bff||0xcc;return function(_0x2b6dc1){if(_0x2b6dc1){return _0x550635[_0xd40d('0x1c')](_0x591bff);}return _0x550635['status'](_0x591bff)['end']();};}function respondWithResult(_0x4b1a63,_0x5094ce){_0x5094ce=_0x5094ce||0xc8;return function(_0x522c1b){if(_0x522c1b){return _0x4b1a63[_0xd40d('0x1d')](_0x5094ce)[_0xd40d('0x1e')](_0x522c1b);}};}function respondWithFilteredResult(_0x1644a3,_0x3fdd21){return function(_0x108952){if(_0x108952){var _0x22d76d=typeof _0x3fdd21['offset']===_0xd40d('0x1f')&&typeof _0x3fdd21[_0xd40d('0x20')]===_0xd40d('0x1f');var _0xb4fe34=_0x108952[_0xd40d('0x21')];var _0x3b760e=_0x22d76d?0x0:_0x3fdd21['offset'];var _0x6417f5=_0x22d76d?_0x108952[_0xd40d('0x21')]:_0x3fdd21[_0xd40d('0x22')]+_0x3fdd21[_0xd40d('0x20')];var _0x2ce683;if(_0x6417f5>=_0xb4fe34){_0x6417f5=_0xb4fe34;_0x2ce683=0xc8;}else{_0x2ce683=0xce;}_0x1644a3[_0xd40d('0x1d')](_0x2ce683);return _0x1644a3[_0xd40d('0x23')](_0xd40d('0x24'),_0x3b760e+'-'+_0x6417f5+'/'+_0xb4fe34)[_0xd40d('0x1e')](_0x108952);}return null;};}function patchUpdates(_0x3824ba){return function(_0x379719){try{jsonpatch[_0xd40d('0x25')](_0x379719,_0x3824ba,!![]);}catch(_0x33e2fe){return BPromise[_0xd40d('0x26')](_0x33e2fe);}return _0x379719[_0xd40d('0x27')]();};}function saveUpdates(_0x5d248f,_0x2187b1){return function(_0x444886){if(_0x444886){return _0x444886[_0xd40d('0x28')](_0x5d248f)[_0xd40d('0x29')](function(_0x427249){return _0x427249;});}return null;};}function removeEntity(_0x3080e9,_0x405ad9){return function(_0x529b0c){if(_0x529b0c){return _0x529b0c[_0xd40d('0x2a')]()[_0xd40d('0x29')](function(){_0x3080e9[_0xd40d('0x1d')](0xcc)[_0xd40d('0x2b')]();});}};}function handleEntityNotFound(_0x24e0dd,_0x3bc585){return function(_0x381db7){if(!_0x381db7){_0x24e0dd[_0xd40d('0x1c')](0x194);}return _0x381db7;};}function handleError(_0x1369d8,_0x55e5cc){_0x55e5cc=_0x55e5cc||0x1f4;return function(_0x3ed3b6){logger['error'](_0x3ed3b6['stack']);if(_0x3ed3b6[_0xd40d('0x2c')]){delete _0x3ed3b6['name'];}_0x1369d8[_0xd40d('0x1d')](_0x55e5cc)['send'](_0x3ed3b6);};}exports[_0xd40d('0x2d')]=function(_0x5203d2,_0x42f2d6){var _0x51b358={},_0x124efa={},_0x1fc044={'count':0x0,'rows':[]};var _0x2b552c=_[_0xd40d('0x2e')](db[_0xd40d('0x2f')][_0xd40d('0x30')],function(_0x49b427){return{'name':_0x49b427[_0xd40d('0x31')],'type':_0x49b427[_0xd40d('0x32')][_0xd40d('0x33')]};});_0x124efa[_0xd40d('0x34')]=_[_0xd40d('0x2e')](_0x2b552c,'name');_0x124efa[_0xd40d('0x35')]=_[_0xd40d('0x36')](_0x5203d2['query']);_0x124efa['filters']=_[_0xd40d('0x37')](_0x124efa[_0xd40d('0x34')],_0x124efa[_0xd40d('0x35')]);_0x51b358[_0xd40d('0x38')]=_['intersection'](_0x124efa[_0xd40d('0x34')],qs[_0xd40d('0x39')](_0x5203d2[_0xd40d('0x35')]['fields']));_0x51b358[_0xd40d('0x38')]=_0x51b358['attributes'][_0xd40d('0x3a')]?_0x51b358[_0xd40d('0x38')]:_0x124efa['model'];if(!_0x5203d2[_0xd40d('0x35')][_0xd40d('0x3b')](_0xd40d('0x3c'))){_0x51b358[_0xd40d('0x20')]=qs[_0xd40d('0x20')](_0x5203d2[_0xd40d('0x35')]['limit']);_0x51b358['offset']=qs[_0xd40d('0x22')](_0x5203d2[_0xd40d('0x35')][_0xd40d('0x22')]);}_0x51b358[_0xd40d('0x3d')]=qs[_0xd40d('0x3e')](_0x5203d2[_0xd40d('0x35')]['sort']);_0x51b358[_0xd40d('0x3f')]=qs[_0xd40d('0x40')](_[_0xd40d('0x41')](_0x5203d2[_0xd40d('0x35')],_0x124efa[_0xd40d('0x40')]),_0x2b552c);if(_0x5203d2['query'][_0xd40d('0x42')]){_0x51b358['where']=_[_0xd40d('0x43')](_0x51b358[_0xd40d('0x3f')],{'$or':_[_0xd40d('0x2e')](_0x2b552c,function(_0xd96188){if(_0xd96188[_0xd40d('0x32')]!==_0xd40d('0x44')){var _0xf4a86e={};_0xf4a86e[_0xd96188['name']]={'$like':'%'+_0x5203d2[_0xd40d('0x35')]['filter']+'%'};return _0xf4a86e;}})});}_0x51b358=_[_0xd40d('0x43')]({},_0x51b358,_0x5203d2[_0xd40d('0x45')]);var _0x82e0cf={'where':_0x51b358[_0xd40d('0x3f')]};return db[_0xd40d('0x2f')][_0xd40d('0x21')](_0x82e0cf)[_0xd40d('0x29')](function(_0x2886ed){_0x1fc044['count']=_0x2886ed;if(_0x5203d2['query'][_0xd40d('0x46')]){_0x51b358[_0xd40d('0x47')]=[{'all':!![]}];}return db[_0xd40d('0x2f')][_0xd40d('0x48')](_0x51b358);})[_0xd40d('0x29')](function(_0x2c7983){_0x1fc044[_0xd40d('0x49')]=_0x2c7983;return _0x1fc044;})[_0xd40d('0x29')](respondWithFilteredResult(_0x42f2d6,_0x51b358))[_0xd40d('0x4a')](handleError(_0x42f2d6,null));};exports[_0xd40d('0x4b')]=function(_0x550ede,_0xec757a){var _0x50c363={'raw':![],'where':{'id':_0x550ede[_0xd40d('0x4c')]['id']}},_0x52559c={};_0x52559c[_0xd40d('0x34')]=_[_0xd40d('0x36')](db[_0xd40d('0x2f')][_0xd40d('0x30')]);_0x52559c[_0xd40d('0x35')]=_[_0xd40d('0x36')](_0x550ede['query']);_0x52559c[_0xd40d('0x40')]=_[_0xd40d('0x37')](_0x52559c[_0xd40d('0x34')],_0x52559c[_0xd40d('0x35')]);_0x50c363[_0xd40d('0x38')]=_[_0xd40d('0x37')](_0x52559c[_0xd40d('0x34')],qs[_0xd40d('0x39')](_0x550ede[_0xd40d('0x35')][_0xd40d('0x39')]));_0x50c363['attributes']=_0x50c363[_0xd40d('0x38')]['length']?_0x50c363['attributes']:_0x52559c[_0xd40d('0x34')];if(_0x550ede['query']['includeAll']){_0x50c363[_0xd40d('0x47')]=[{'all':!![]}];}_0x50c363=_[_0xd40d('0x43')]({},_0x50c363,_0x550ede[_0xd40d('0x45')]);return db[_0xd40d('0x2f')][_0xd40d('0x4d')](_0x50c363)['then'](handleEntityNotFound(_0xec757a,null))['then'](respondWithResult(_0xec757a,null))[_0xd40d('0x4a')](handleError(_0xec757a,null));};exports['create']=function(_0x1ddb19,_0x23461e){return db[_0xd40d('0x2f')]['create'](_0x1ddb19[_0xd40d('0x4e')],{})['then'](respondWithResult(_0x23461e,0xc9))[_0xd40d('0x4a')](handleError(_0x23461e,null));};exports[_0xd40d('0x28')]=function(_0x39aadf,_0x5c8446){if(_0x39aadf[_0xd40d('0x4e')]['id']){delete _0x39aadf['body']['id'];}return db[_0xd40d('0x2f')][_0xd40d('0x4d')]({'where':{'id':_0x39aadf[_0xd40d('0x4c')]['id']}})[_0xd40d('0x29')](handleEntityNotFound(_0x5c8446,null))['then'](saveUpdates(_0x39aadf[_0xd40d('0x4e')],null))[_0xd40d('0x29')](respondWithResult(_0x5c8446,null))[_0xd40d('0x4a')](handleError(_0x5c8446,null));};exports[_0xd40d('0x2a')]=function(_0xc2238b,_0x3be545){return db[_0xd40d('0x2f')][_0xd40d('0x4d')]({'where':{'id':_0xc2238b[_0xd40d('0x4c')]['id']}})[_0xd40d('0x29')](handleEntityNotFound(_0x3be545,null))[_0xd40d('0x29')](removeEntity(_0x3be545,null))['catch'](handleError(_0x3be545,null));};exports[_0xd40d('0x4f')]=function(_0x3304b4,_0x4b828c){return db[_0xd40d('0x2f')][_0xd40d('0x4f')]()[_0xd40d('0x29')](respondWithResult(_0x4b828c,null))['catch'](handleError(_0x4b828c,null));};exports['getVoiceQueuesReport']=function(_0x19c6fc,_0x1566c0){var _0x39cda7={},_0x5395b0={},_0x58d47d={'count':0x0,'rows':[]};_0x5395b0[_0xd40d('0x34')]=_[_0xd40d('0x36')](db[_0xd40d('0x2f')][_0xd40d('0x30')]);_0x5395b0[_0xd40d('0x35')]=_[_0xd40d('0x36')](_0x19c6fc[_0xd40d('0x35')]);_0x5395b0['filters']=_[_0xd40d('0x37')](_0x5395b0[_0xd40d('0x34')],_0x5395b0[_0xd40d('0x35')]);_0x39cda7['attributes']=_['intersection'](_0x5395b0['model'],qs['fields'](_0x19c6fc[_0xd40d('0x35')]['fields']));_0x39cda7[_0xd40d('0x38')]=_0x39cda7[_0xd40d('0x38')]['length']?_0x39cda7[_0xd40d('0x38')]:_0x5395b0[_0xd40d('0x34')];if(!_0x19c6fc[_0xd40d('0x35')][_0xd40d('0x3b')]('nolimit')){_0x39cda7[_0xd40d('0x20')]=qs[_0xd40d('0x20')](_0x19c6fc[_0xd40d('0x35')]['limit']);_0x39cda7[_0xd40d('0x22')]=qs['offset'](_0x19c6fc[_0xd40d('0x35')][_0xd40d('0x22')]);}_0x39cda7[_0xd40d('0x3d')]=qs['sort'](_0x19c6fc[_0xd40d('0x35')][_0xd40d('0x3e')]);_0x39cda7[_0xd40d('0x3f')]=qs[_0xd40d('0x40')](_['pick'](_0x19c6fc['query'],_0x5395b0['filters']));if(_0x19c6fc['query'][_0xd40d('0x42')]){_0x39cda7[_0xd40d('0x3f')]=_[_0xd40d('0x43')](_0x39cda7['where'],{'$or':_[_0xd40d('0x2e')](_0x39cda7['attributes'],function(_0x4a48a9){var _0xd0ab88={};_0xd0ab88[_0x4a48a9]={'$like':'%'+_0x19c6fc['query']['filter']+'%'};return _0xd0ab88;})});}_0x39cda7=_['merge']({},_0x39cda7,_0x19c6fc[_0xd40d('0x45')]);var _0x80f7a0={'where':_0x39cda7[_0xd40d('0x3f')]};return db[_0xd40d('0x2f')][_0xd40d('0x21')](_0x80f7a0)[_0xd40d('0x29')](function(_0x2fbd4c){_0x58d47d[_0xd40d('0x21')]=_0x2fbd4c;if(_0x19c6fc[_0xd40d('0x35')][_0xd40d('0x46')]){_0x39cda7[_0xd40d('0x47')]=[{'all':!![]}];}return db[_0xd40d('0x2f')][_0xd40d('0x48')](_0x39cda7);})[_0xd40d('0x29')](function(_0x27f70c){_0x58d47d[_0xd40d('0x49')]=_0x27f70c;return _0x58d47d;})['then'](respondWithFilteredResult(_0x1566c0,_0x39cda7,_0xd40d('0x50')))[_0xd40d('0x4a')](handleError(_0x1566c0,null,_0xd40d('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index b155b2e..ffbdabd 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 _0x7b20=['save','update','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7b20,0x184));var _0x07b2=function(_0x3a3036,_0x5daa1b){_0x3a3036=_0x3a3036-0x0;var _0x44e21f=_0x7b20[_0x3a3036];return _0x44e21f;};'use strict';var EventEmitter=require(_0x07b2('0x0'));var VoiceQueueReport=require(_0x07b2('0x1'))['db'][_0x07b2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x07b2('0x3')](0x0);var events={'afterCreate':_0x07b2('0x4'),'afterUpdate':_0x07b2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x39f4c7){return function(_0x2a1940,_0x268ec7,_0x626fc2){VoiceQueueReportEvents['emit'](_0x39f4c7+':'+_0x2a1940['id'],_0x2a1940);VoiceQueueReportEvents['emit'](_0x39f4c7,_0x2a1940);_0x626fc2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x07b2('0x6')](e,emitEvent(event));}}module[_0x07b2('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x983c=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x983c,0x154));var _0xc983=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x983c[_0x5e238b];return _0x389bea;};'use strict';var EventEmitter=require(_0xc983('0x0'));var VoiceQueueReport=require(_0xc983('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc983('0x2')](0x0);var events={'afterCreate':_0xc983('0x3'),'afterUpdate':_0xc983('0x4'),'afterDestroy':_0xc983('0x5')};function emitEvent(_0x384d0a){return function(_0x1bddfe,_0x1ea523,_0x2119a7){VoiceQueueReportEvents[_0xc983('0x6')](_0x384d0a+':'+_0x1bddfe['id'],_0x1bddfe);VoiceQueueReportEvents['emit'](_0x384d0a,_0x1bddfe);_0x2119a7(null);};}for(var e in events){if(events[_0xc983('0x7')](e)){var event=events[e];VoiceQueueReport[_0xc983('0x8')](e,emitEvent(event));}}module[_0xc983('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index b88a5f2..c0f82d1 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 _0x76c6=['define','report_queue','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x4453ba,_0x2f1d11){var _0xb839be=function(_0xe1f0d9){while(--_0xe1f0d9){_0x4453ba['push'](_0x4453ba['shift']());}};_0xb839be(++_0x2f1d11);}(_0x76c6,0x123));var _0x676c=function(_0x39a968,_0x364d93){_0x39a968=_0x39a968-0x0;var _0x47b0a5=_0x76c6[_0x39a968];return _0x47b0a5;};'use strict';var _=require('lodash');var util=require(_0x676c('0x0'));var logger=require(_0x676c('0x1'))('api');var moment=require(_0x676c('0x2'));var BPromise=require(_0x676c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x676c('0x4'));var rimraf=require(_0x676c('0x5'));var config=require(_0x676c('0x6'));var attributes=require(_0x676c('0x7'));module[_0x676c('0x8')]=function(_0x204ea5,_0x3b359a){return _0x204ea5[_0x676c('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x676c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x676c('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0a8=['request-promise','path','rimraf','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x384e15,_0x13a1f2){var _0x1a7809=function(_0xdd0de3){while(--_0xdd0de3){_0x384e15['push'](_0x384e15['shift']());}};_0x1a7809(++_0x13a1f2);}(_0xc0a8,0xbc));var _0x8c0a=function(_0x426a1e,_0x427f6f){_0x426a1e=_0x426a1e-0x0;var _0x26d40e=_0xc0a8[_0x426a1e];return _0x26d40e;};'use strict';var _=require(_0x8c0a('0x0'));var util=require('util');var logger=require(_0x8c0a('0x1'))('api');var moment=require(_0x8c0a('0x2'));var BPromise=require(_0x8c0a('0x3'));var rp=require(_0x8c0a('0x4'));var fs=require('fs');var path=require(_0x8c0a('0x5'));var rimraf=require(_0x8c0a('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x8c0a('0x7')]=function(_0x474e24,_0x3f3057){return _0x474e24[_0x8c0a('0x8')](_0x8c0a('0x9'),attributes,{'tableName':_0x8c0a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x8c0a('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 53d7c58..0092885 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 _0xa2ee=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','model','attributes','map','debug','CreateVoiceQueueReport','create','body','then','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa2ee,0x19d));var _0xea2e=function(_0xf458ea,_0x5767e5){_0xf458ea=_0xf458ea-0x0;var _0x20f763=_0xa2ee[_0xf458ea];return _0x20f763;};'use strict';var _=require('lodash');var util=require(_0xea2e('0x0'));var moment=require(_0xea2e('0x1'));var BPromise=require(_0xea2e('0x2'));var rs=require(_0xea2e('0x3'));var fs=require('fs');var Redis=require(_0xea2e('0x4'));var db=require(_0xea2e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea2e('0x6'))(_0xea2e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xea2e('0x8')][_0xea2e('0x9')]({'port':0x232a});config[_0xea2e('0xa')]=_[_0xea2e('0xb')](config[_0xea2e('0xa')],{'host':_0xea2e('0xc'),'port':0x18eb});var socket=require(_0xea2e('0xd'))(new Redis(config[_0xea2e('0xa')]));require(_0xea2e('0xe'))[_0xea2e('0xf')](socket);function respondWithRpcPromise(_0x9c010f,_0x1cb197,_0x2dd9b3){return new BPromise(function(_0x140073,_0x3da34d){return client[_0xea2e('0x10')](_0x9c010f,_0x2dd9b3)['then'](function(_0x2d96d7){logger['info'](_0xea2e('0x11'),_0x1cb197,_0xea2e('0x12'));logger['debug'](_0xea2e('0x13'),_0x1cb197,_0xea2e('0x12'),JSON[_0xea2e('0x14')](_0x2d96d7));if(_0x2d96d7['error']){if(_0x2d96d7['error']['code']===0x1f4){logger[_0xea2e('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x1cb197,_0x2d96d7[_0xea2e('0x15')]['message']);return _0x3da34d(_0x2d96d7['error'][_0xea2e('0x16')]);}logger['error'](_0xea2e('0x11'),_0x1cb197,_0x2d96d7[_0xea2e('0x15')][_0xea2e('0x16')]);return _0x140073(_0x2d96d7[_0xea2e('0x15')][_0xea2e('0x16')]);}else{logger[_0xea2e('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x1cb197,_0xea2e('0x12'));_0x140073(_0x2d96d7[_0xea2e('0x18')][_0xea2e('0x16')]);}})[_0xea2e('0x19')](function(_0x292564){logger[_0xea2e('0x15')](_0xea2e('0x11'),_0x1cb197,_0x292564);_0x3da34d(_0x292564);});});}exports[_0xea2e('0x1a')]=function(_0x3ebcd1){var _0x48833c=this;return new Promise(function(_0xed90a9,_0x12eb72){return db[_0xea2e('0x1b')][_0xea2e('0x1c')]({'raw':_0x3ebcd1[_0xea2e('0x1d')]?_0x3ebcd1[_0xea2e('0x1d')][_0xea2e('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ebcd1[_0xea2e('0x1d')]?_0x3ebcd1['options'][_0xea2e('0x1f')]||null:null,'attributes':_0x3ebcd1['options']?_0x3ebcd1[_0xea2e('0x1d')]['attributes']||null:null,'limit':_0x3ebcd1[_0xea2e('0x1d')]?_0x3ebcd1[_0xea2e('0x1d')][_0xea2e('0x20')]||null:null,'include':_0x3ebcd1[_0xea2e('0x1d')]?_0x3ebcd1[_0xea2e('0x1d')]['include']?_['map'](_0x3ebcd1[_0xea2e('0x1d')][_0xea2e('0x21')],function(_0x15dd93){return{'model':db[_0x15dd93[_0xea2e('0x22')]],'as':_0x15dd93['as'],'attributes':_0x15dd93[_0xea2e('0x23')],'include':_0x15dd93[_0xea2e('0x21')]?_['map'](_0x15dd93[_0xea2e('0x21')],function(_0x4ed6b9){return{'model':db[_0x4ed6b9[_0xea2e('0x22')]],'as':_0x4ed6b9['as'],'attributes':_0x4ed6b9[_0xea2e('0x23')],'include':_0x4ed6b9['include']?_[_0xea2e('0x24')](_0x4ed6b9['include'],function(_0xc9e15){return{'model':db[_0xc9e15[_0xea2e('0x22')]],'as':_0xc9e15['as'],'attributes':_0xc9e15['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c13c8){logger[_0xea2e('0x17')](_0xea2e('0x1a'),_0x3ebcd1);logger[_0xea2e('0x25')]('GetVoiceQueueReport',_0x3ebcd1,JSON['stringify'](_0x3c13c8));_0xed90a9(_0x3c13c8);})[_0xea2e('0x19')](function(_0x2dca21){logger['error']('GetVoiceQueueReport',_0x2dca21[_0xea2e('0x16')],_0x3ebcd1);_0x12eb72(_0x48833c[_0xea2e('0x15')](0x1f4,_0x2dca21['message']));});});};exports[_0xea2e('0x26')]=function(_0x7f7b06){var _0x35d0ff=this;return new Promise(function(_0x2e2506,_0x15bc39){return db[_0xea2e('0x1b')][_0xea2e('0x27')](_0x7f7b06[_0xea2e('0x28')],{'raw':_0x7f7b06[_0xea2e('0x1d')]?_0x7f7b06[_0xea2e('0x1d')][_0xea2e('0x1e')]===undefined?!![]:![]:!![]})[_0xea2e('0x29')](function(_0x4c77e6){logger[_0xea2e('0x17')](_0xea2e('0x26'),_0x7f7b06);logger[_0xea2e('0x25')]('CreateVoiceQueueReport',_0x7f7b06,JSON[_0xea2e('0x14')](_0x4c77e6));_0x2e2506(_0x4c77e6);})['catch'](function(_0x35debc){logger[_0xea2e('0x15')](_0xea2e('0x26'),_0x35debc[_0xea2e('0x16')],_0x7f7b06);_0x15bc39(_0x35d0ff[_0xea2e('0x15')](0x1f4,_0x35debc[_0xea2e('0x16')]));});});};exports[_0xea2e('0x2a')]=function(_0x260335){var _0x469940=this;return new Promise(function(_0xa1339e,_0x12fbb0){return db[_0xea2e('0x1b')]['update'](_0x260335[_0xea2e('0x28')],{'raw':_0x260335[_0xea2e('0x1d')]?_0x260335[_0xea2e('0x1d')][_0xea2e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x260335[_0xea2e('0x1d')]?_0x260335[_0xea2e('0x1d')][_0xea2e('0x1f')]||null:null,'attributes':_0x260335[_0xea2e('0x1d')]?_0x260335['options'][_0xea2e('0x23')]||null:null,'limit':_0x260335[_0xea2e('0x1d')]?_0x260335['options'][_0xea2e('0x20')]||null:null})[_0xea2e('0x29')](function(_0x26f872){logger[_0xea2e('0x17')](_0xea2e('0x2a'),_0x260335);logger[_0xea2e('0x25')](_0xea2e('0x2a'),_0x260335,JSON[_0xea2e('0x14')](_0x26f872));_0xa1339e(_0x26f872);})[_0xea2e('0x19')](function(_0x4ef8e1){logger[_0xea2e('0x15')](_0xea2e('0x2a'),_0x4ef8e1['message'],_0x260335);_0x12fbb0(_0x469940['error'](0x1f4,_0x4ef8e1[_0xea2e('0x16')]));});});}; \ No newline at end of file +var _0x0860=['raw','where','limit','UpdateVoiceQueueReport','lodash','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueueReport','VoiceQueueReport','findAll','options','include','map','model','attributes','CreateVoiceQueueReport','create','body','stringify','catch','update'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x0860,0x151));var _0x0086=function(_0x4da0c5,_0x579420){_0x4da0c5=_0x4da0c5-0x0;var _0x1a311f=_0x0860[_0x4da0c5];return _0x1a311f;};'use strict';var _=require(_0x0086('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0086('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0086('0x2'))['db'];var utils=require(_0x0086('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x0086('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0086('0x5')][_0x0086('0x6')]({'port':0x232a});config[_0x0086('0x7')]=_[_0x0086('0x8')](config['redis'],{'host':_0x0086('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x83a5de,_0x4ba800,_0x4e0850){return new BPromise(function(_0x255ab3,_0x310193){return client['request'](_0x83a5de,_0x4e0850)[_0x0086('0xa')](function(_0x16bbab){logger[_0x0086('0xb')](_0x0086('0xc'),_0x4ba800,_0x0086('0xd'));logger[_0x0086('0xe')](_0x0086('0xf'),_0x4ba800,'request\x20sent',JSON['stringify'](_0x16bbab));if(_0x16bbab[_0x0086('0x10')]){if(_0x16bbab[_0x0086('0x10')][_0x0086('0x11')]===0x1f4){logger[_0x0086('0x10')](_0x0086('0xc'),_0x4ba800,_0x16bbab[_0x0086('0x10')][_0x0086('0x12')]);return _0x310193(_0x16bbab[_0x0086('0x10')]['message']);}logger[_0x0086('0x10')](_0x0086('0xc'),_0x4ba800,_0x16bbab['error'][_0x0086('0x12')]);return _0x255ab3(_0x16bbab['error'][_0x0086('0x12')]);}else{logger[_0x0086('0xb')](_0x0086('0xc'),_0x4ba800,_0x0086('0xd'));_0x255ab3(_0x16bbab['result']['message']);}})['catch'](function(_0x3d4e7b){logger['error'](_0x0086('0xc'),_0x4ba800,_0x3d4e7b);_0x310193(_0x3d4e7b);});});}exports[_0x0086('0x13')]=function(_0x379acf){var _0x5b2120=this;return new Promise(function(_0x497fdb,_0x57bee5){return db[_0x0086('0x14')][_0x0086('0x15')]({'raw':_0x379acf[_0x0086('0x16')]?_0x379acf[_0x0086('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x379acf['options']?_0x379acf[_0x0086('0x16')]['where']||null:null,'attributes':_0x379acf['options']?_0x379acf['options']['attributes']||null:null,'limit':_0x379acf[_0x0086('0x16')]?_0x379acf[_0x0086('0x16')]['limit']||null:null,'include':_0x379acf[_0x0086('0x16')]?_0x379acf['options'][_0x0086('0x17')]?_[_0x0086('0x18')](_0x379acf[_0x0086('0x16')]['include'],function(_0x1ece36){return{'model':db[_0x1ece36[_0x0086('0x19')]],'as':_0x1ece36['as'],'attributes':_0x1ece36[_0x0086('0x1a')],'include':_0x1ece36[_0x0086('0x17')]?_[_0x0086('0x18')](_0x1ece36[_0x0086('0x17')],function(_0x50c5c8){return{'model':db[_0x50c5c8[_0x0086('0x19')]],'as':_0x50c5c8['as'],'attributes':_0x50c5c8['attributes'],'include':_0x50c5c8[_0x0086('0x17')]?_[_0x0086('0x18')](_0x50c5c8[_0x0086('0x17')],function(_0x21cb1f){return{'model':db[_0x21cb1f['model']],'as':_0x21cb1f['as'],'attributes':_0x21cb1f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17654d){logger['info'](_0x0086('0x13'),_0x379acf);logger[_0x0086('0xe')](_0x0086('0x13'),_0x379acf,JSON['stringify'](_0x17654d));_0x497fdb(_0x17654d);})['catch'](function(_0x49f77b){logger[_0x0086('0x10')](_0x0086('0x13'),_0x49f77b[_0x0086('0x12')],_0x379acf);_0x57bee5(_0x5b2120['error'](0x1f4,_0x49f77b['message']));});});};exports[_0x0086('0x1b')]=function(_0x2ad59){var _0x24bd0d=this;return new Promise(function(_0x393ee9,_0x3f8a0e){return db['VoiceQueueReport'][_0x0086('0x1c')](_0x2ad59[_0x0086('0x1d')],{'raw':_0x2ad59['options']?_0x2ad59[_0x0086('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x0086('0xa')](function(_0x4a5ce8){logger[_0x0086('0xb')](_0x0086('0x1b'),_0x2ad59);logger[_0x0086('0xe')](_0x0086('0x1b'),_0x2ad59,JSON[_0x0086('0x1e')](_0x4a5ce8));_0x393ee9(_0x4a5ce8);})[_0x0086('0x1f')](function(_0x4924a2){logger['error'](_0x0086('0x1b'),_0x4924a2[_0x0086('0x12')],_0x2ad59);_0x3f8a0e(_0x24bd0d[_0x0086('0x10')](0x1f4,_0x4924a2[_0x0086('0x12')]));});});};exports['UpdateVoiceQueueReport']=function(_0x38da2c){var _0x9c82b5=this;return new Promise(function(_0x65c9a2,_0xf3d074){return db['VoiceQueueReport'][_0x0086('0x20')](_0x38da2c[_0x0086('0x1d')],{'raw':_0x38da2c['options']?_0x38da2c[_0x0086('0x16')][_0x0086('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38da2c[_0x0086('0x16')]?_0x38da2c[_0x0086('0x16')][_0x0086('0x22')]||null:null,'attributes':_0x38da2c[_0x0086('0x16')]?_0x38da2c['options'][_0x0086('0x1a')]||null:null,'limit':_0x38da2c[_0x0086('0x16')]?_0x38da2c['options'][_0x0086('0x23')]||null:null})['then'](function(_0x9cd981){logger['info'](_0x0086('0x24'),_0x38da2c);logger['debug'](_0x0086('0x24'),_0x38da2c,JSON[_0x0086('0x1e')](_0x9cd981));_0x65c9a2(_0x9cd981);})[_0x0086('0x1f')](function(_0x4b8f82){logger[_0x0086('0x10')](_0x0086('0x24'),_0x4b8f82[_0x0086('0x12')],_0x38da2c);_0xf3d074(_0x9c82b5[_0x0086('0x10')](0x1f4,_0x4b8f82[_0x0086('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5d57f37..67c14d7 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 _0xed1f=['register','length','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed1f,0x6a));var _0xfed1=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xed1f[_0x12fc8d];return _0x3f9d04;};'use strict';var VoiceQueueReportEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),_0xfed1('0x2'),_0xfed1('0x3')];function createListener(_0xa45937,_0x25f345){return function(_0x1dd614){_0x25f345[_0xfed1('0x4')](_0xa45937,_0x1dd614);};}function removeListener(_0x2209b3,_0x45c3c1){return function(){VoiceQueueReportEvents[_0xfed1('0x5')](_0x2209b3,_0x45c3c1);};}exports[_0xfed1('0x6')]=function(_0x3d6706){for(var _0x42751d=0x0,_0x380e18=events[_0xfed1('0x7')];_0x42751d<_0x380e18;_0x42751d++){var _0x2a6082=events[_0x42751d];var _0x2967ef=createListener('voiceQueueReport:'+_0x2a6082,_0x3d6706);VoiceQueueReportEvents['on'](_0x2a6082,_0x2967ef);}}; \ No newline at end of file +var _0x3937=['register','length','./voiceQueueReport.events','remove','update','emit','removeListener'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3937,0xbf));var _0x7393=function(_0x290f55,_0x4a946c){_0x290f55=_0x290f55-0x0;var _0x2ae65a=_0x3937[_0x290f55];return _0x2ae65a;};'use strict';var VoiceQueueReportEvents=require(_0x7393('0x0'));var events=['save',_0x7393('0x1'),_0x7393('0x2')];function createListener(_0x49aa96,_0x45cd02){return function(_0x503841){_0x45cd02[_0x7393('0x3')](_0x49aa96,_0x503841);};}function removeListener(_0x4c9c71,_0x992b15){return function(){VoiceQueueReportEvents[_0x7393('0x4')](_0x4c9c71,_0x992b15);};}exports[_0x7393('0x5')]=function(_0x1f538f){for(var _0x15eabd=0x0,_0x42bdd1=events[_0x7393('0x6')];_0x15eabd<_0x42bdd1;_0x15eabd++){var _0x26668a=events[_0x15eabd];var _0x944b0b=createListener('voiceQueueReport:'+_0x26668a,_0x1f538f);VoiceQueueReportEvents['on'](_0x26668a,_0x944b0b);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index ab3e8b8..e5cb3ba 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 _0xaa5b=['get','isAuthenticated','index','/:id','show','create','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x3b686b,_0x32f06c){var _0x8cb331=function(_0x14b6b0){while(--_0x14b6b0){_0x3b686b['push'](_0x3b686b['shift']());}};_0x8cb331(++_0x32f06c);}(_0xaa5b,0x129));var _0xbaa5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa5b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xbaa5('0x0'));var util=require(_0xbaa5('0x1'));var path=require('path');var timeout=require(_0xbaa5('0x2'));var express=require('express');var router=express[_0xbaa5('0x3')]();var fs_extra=require(_0xbaa5('0x4'));var auth=require(_0xbaa5('0x5'));var interaction=require(_0xbaa5('0x6'));var config=require(_0xbaa5('0x7'));var controller=require(_0xbaa5('0x8'));router[_0xbaa5('0x9')]('/',auth[_0xbaa5('0xa')](),controller[_0xbaa5('0xb')]);router[_0xbaa5('0x9')](_0xbaa5('0xc'),auth['isAuthenticated'](),controller[_0xbaa5('0xd')]);router['post']('/',auth[_0xbaa5('0xa')](),controller[_0xbaa5('0xe')]);router[_0xbaa5('0xf')](_0xbaa5('0xc'),auth['isAuthenticated'](),controller[_0xbaa5('0x10')]);router['delete']('/:id',auth[_0xbaa5('0xa')](),controller['destroy']);module[_0xbaa5('0x11')]=router; \ No newline at end of file +var _0x30d6=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','put','update','delete'];(function(_0x278eea,_0x2f4603){var _0xb8eb73=function(_0x31c08c){while(--_0x31c08c){_0x278eea['push'](_0x278eea['shift']());}};_0xb8eb73(++_0x2f4603);}(_0x30d6,0x80));var _0x630d=function(_0x11efe8,_0xe6ad7e){_0x11efe8=_0x11efe8-0x0;var _0x5954b8=_0x30d6[_0x11efe8];return _0x5954b8;};'use strict';var multer=require('multer');var util=require(_0x630d('0x0'));var path=require(_0x630d('0x1'));var timeout=require(_0x630d('0x2'));var express=require(_0x630d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x630d('0x4'));var interaction=require(_0x630d('0x5'));var config=require(_0x630d('0x6'));var controller=require(_0x630d('0x7'));router['get']('/',auth[_0x630d('0x8')](),controller[_0x630d('0x9')]);router[_0x630d('0xa')](_0x630d('0xb'),auth[_0x630d('0x8')](),controller[_0x630d('0xc')]);router['post']('/',auth[_0x630d('0x8')](),controller['create']);router[_0x630d('0xd')](_0x630d('0xb'),auth[_0x630d('0x8')](),controller[_0x630d('0xe')]);router[_0x630d('0xf')](_0x630d('0xb'),auth[_0x630d('0x8')](),controller['destroy']);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 8518a15..3984426 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 _0xbafd=['literal','sequelize','exports','STRING','DATE'];(function(_0x34c889,_0xea69ac){var _0x4b4751=function(_0x4d5cfe){while(--_0x4d5cfe){_0x34c889['push'](_0x34c889['shift']());}};_0x4b4751(++_0xea69ac);}(_0xbafd,0xdd));var _0xdbaf=function(_0x3b9479,_0x1a6c61){_0x3b9479=_0x3b9479-0x0;var _0x38e331=_0xbafd[_0x3b9479];return _0x38e331;};'use strict';var Sequelize=require(_0xdbaf('0x0'));var moment=require('moment');module[_0xdbaf('0x1')]={'time':{'type':Sequelize[_0xdbaf('0x2')]},'callid':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xdbaf('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdbaf('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xdbaf('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xe627=['DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xe627,0x1a7));var _0x7e62=function(_0xc35b9a,_0xcbbd71){_0xc35b9a=_0xc35b9a-0x0;var _0x2d2d30=_0xe627[_0xc35b9a];return _0x2d2d30;};'use strict';var Sequelize=require(_0x7e62('0x0'));var moment=require(_0x7e62('0x1'));module[_0x7e62('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x7e62('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7e62('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x7e62('0x5')](_0x7e62('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7e4e176..d156d04 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 _0x578e=['error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','keys','query','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','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','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x578e,0x1f1));var _0xe578=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x578e[_0x15cdcb];return _0x37b069;};'use strict';var emlformat=require(_0xe578('0x0'));var rimraf=require(_0xe578('0x1'));var zipdir=require(_0xe578('0x2'));var jsonpatch=require(_0xe578('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe578('0x4'));var Mustache=require(_0xe578('0x5'));var util=require('util');var path=require(_0xe578('0x6'));var sox=require(_0xe578('0x7'));var csv=require(_0xe578('0x8'));var ejs=require(_0xe578('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe578('0xa'));var crypto=require('crypto');var jsforce=require(_0xe578('0xb'));var deskjs=require(_0xe578('0xc'));var toCsv=require(_0xe578('0x8'));var querystring=require(_0xe578('0xd'));var Papa=require(_0xe578('0xe'));var Redis=require(_0xe578('0xf'));var authService=require(_0xe578('0x10'));var qs=require(_0xe578('0x11'));var as=require(_0xe578('0x12'));var hardwareService=require(_0xe578('0x13'));var logger=require(_0xe578('0x14'))(_0xe578('0x15'));var utils=require(_0xe578('0x16'));var config=require(_0xe578('0x17'));var licenseUtil=require(_0xe578('0x18'));var db=require(_0xe578('0x19'))['db'];function respondWithStatusCode(_0x28a559,_0x5351dc){_0x5351dc=_0x5351dc||0xcc;return function(_0x28b06e){if(_0x28b06e){return _0x28a559[_0xe578('0x1a')](_0x5351dc);}return _0x28a559['status'](_0x5351dc)[_0xe578('0x1b')]();};}function respondWithResult(_0x43a10c,_0x14d7b0){_0x14d7b0=_0x14d7b0||0xc8;return function(_0x719f82){if(_0x719f82){return _0x43a10c[_0xe578('0x1c')](_0x14d7b0)['json'](_0x719f82);}};}function respondWithFilteredResult(_0x2bbcd7,_0x32d7d9){return function(_0x5eeeb1){if(_0x5eeeb1){var _0x4fecb7=typeof _0x32d7d9[_0xe578('0x1d')]===_0xe578('0x1e')&&typeof _0x32d7d9['limit']===_0xe578('0x1e');var _0x52ce89=_0x5eeeb1['count'];var _0x4b6ae4=_0x4fecb7?0x0:_0x32d7d9['offset'];var _0x4a5ad3=_0x4fecb7?_0x5eeeb1[_0xe578('0x1f')]:_0x32d7d9[_0xe578('0x1d')]+_0x32d7d9[_0xe578('0x20')];var _0x4a879a;if(_0x4a5ad3>=_0x52ce89){_0x4a5ad3=_0x52ce89;_0x4a879a=0xc8;}else{_0x4a879a=0xce;}_0x2bbcd7['status'](_0x4a879a);return _0x2bbcd7[_0xe578('0x21')](_0xe578('0x22'),_0x4b6ae4+'-'+_0x4a5ad3+'/'+_0x52ce89)[_0xe578('0x23')](_0x5eeeb1);}return null;};}function patchUpdates(_0x517c25){return function(_0x6d184c){try{jsonpatch[_0xe578('0x24')](_0x6d184c,_0x517c25,!![]);}catch(_0x1cc890){return BPromise[_0xe578('0x25')](_0x1cc890);}return _0x6d184c[_0xe578('0x26')]();};}function saveUpdates(_0x1da9f6,_0x563ca4){return function(_0x5b2d4b){if(_0x5b2d4b){return _0x5b2d4b[_0xe578('0x27')](_0x1da9f6)['then'](function(_0x8440d6){return _0x8440d6;});}return null;};}function removeEntity(_0x11af6c,_0x10993e){return function(_0x4ba6f5){if(_0x4ba6f5){return _0x4ba6f5[_0xe578('0x28')]()[_0xe578('0x29')](function(){_0x11af6c[_0xe578('0x1c')](0xcc)[_0xe578('0x1b')]();});}};}function handleEntityNotFound(_0x1f2a3d,_0x2a215e){return function(_0x4bed0c){if(!_0x4bed0c){_0x1f2a3d[_0xe578('0x1a')](0x194);}return _0x4bed0c;};}function handleError(_0x1ca79d,_0xaee393){_0xaee393=_0xaee393||0x1f4;return function(_0x3aeaa3){logger[_0xe578('0x2a')](_0x3aeaa3[_0xe578('0x2b')]);if(_0x3aeaa3['name']){delete _0x3aeaa3[_0xe578('0x2c')];}_0x1ca79d[_0xe578('0x1c')](_0xaee393)[_0xe578('0x2d')](_0x3aeaa3);};}exports[_0xe578('0x2e')]=function(_0x1f1305,_0x7c32b4){var _0x882932={},_0x3019de={},_0x1955c0={'count':0x0,'rows':[]};var _0xc8f828=_[_0xe578('0x2f')](db[_0xe578('0x30')][_0xe578('0x31')],function(_0x5bb55d){return{'name':_0x5bb55d['fieldName'],'type':_0x5bb55d[_0xe578('0x32')][_0xe578('0x33')]};});_0x3019de['model']=_['map'](_0xc8f828,'name');_0x3019de['query']=_[_0xe578('0x34')](_0x1f1305[_0xe578('0x35')]);_0x3019de[_0xe578('0x36')]=_['intersection'](_0x3019de[_0xe578('0x37')],_0x3019de[_0xe578('0x35')]);_0x882932[_0xe578('0x38')]=_[_0xe578('0x39')](_0x3019de[_0xe578('0x37')],qs[_0xe578('0x3a')](_0x1f1305['query'][_0xe578('0x3a')]));_0x882932[_0xe578('0x38')]=_0x882932[_0xe578('0x38')][_0xe578('0x3b')]?_0x882932[_0xe578('0x38')]:_0x3019de['model'];if(!_0x1f1305[_0xe578('0x35')]['hasOwnProperty']('nolimit')){_0x882932[_0xe578('0x20')]=qs['limit'](_0x1f1305[_0xe578('0x35')][_0xe578('0x20')]);_0x882932[_0xe578('0x1d')]=qs[_0xe578('0x1d')](_0x1f1305[_0xe578('0x35')]['offset']);}_0x882932[_0xe578('0x3c')]=qs[_0xe578('0x3d')](_0x1f1305[_0xe578('0x35')]['sort']);_0x882932[_0xe578('0x3e')]=qs[_0xe578('0x36')](_[_0xe578('0x3f')](_0x1f1305['query'],_0x3019de['filters']),_0xc8f828);if(_0x1f1305[_0xe578('0x35')][_0xe578('0x40')]){_0x882932[_0xe578('0x3e')]=_[_0xe578('0x41')](_0x882932['where'],{'$or':_[_0xe578('0x2f')](_0xc8f828,function(_0x3af8a7){if(_0x3af8a7[_0xe578('0x32')]!=='VIRTUAL'){var _0x514304={};_0x514304[_0x3af8a7['name']]={'$like':'%'+_0x1f1305['query'][_0xe578('0x40')]+'%'};return _0x514304;}})});}_0x882932=_[_0xe578('0x41')]({},_0x882932,_0x1f1305[_0xe578('0x42')]);var _0xfd5ea8={'where':_0x882932['where']};return db[_0xe578('0x30')]['count'](_0xfd5ea8)[_0xe578('0x29')](function(_0x4bc97c){_0x1955c0[_0xe578('0x1f')]=_0x4bc97c;if(_0x1f1305[_0xe578('0x35')][_0xe578('0x43')]){_0x882932[_0xe578('0x44')]=[{'all':!![]}];}return db[_0xe578('0x30')][_0xe578('0x45')](_0x882932);})[_0xe578('0x29')](function(_0x349368){_0x1955c0[_0xe578('0x46')]=_0x349368;return _0x1955c0;})['then'](respondWithFilteredResult(_0x7c32b4,_0x882932))['catch'](handleError(_0x7c32b4,null));};exports[_0xe578('0x47')]=function(_0x54bf27,_0x4e412b){var _0x5dda39={'raw':!![],'where':{'id':_0x54bf27[_0xe578('0x48')]['id']}},_0x3f3e76={};_0x3f3e76['model']=_['keys'](db[_0xe578('0x30')][_0xe578('0x31')]);_0x3f3e76[_0xe578('0x35')]=_[_0xe578('0x34')](_0x54bf27['query']);_0x3f3e76[_0xe578('0x36')]=_[_0xe578('0x39')](_0x3f3e76[_0xe578('0x37')],_0x3f3e76[_0xe578('0x35')]);_0x5dda39[_0xe578('0x38')]=_[_0xe578('0x39')](_0x3f3e76[_0xe578('0x37')],qs[_0xe578('0x3a')](_0x54bf27[_0xe578('0x35')][_0xe578('0x3a')]));_0x5dda39[_0xe578('0x38')]=_0x5dda39['attributes'][_0xe578('0x3b')]?_0x5dda39[_0xe578('0x38')]:_0x3f3e76[_0xe578('0x37')];if(_0x54bf27[_0xe578('0x35')][_0xe578('0x43')]){_0x5dda39[_0xe578('0x44')]=[{'all':!![]}];}_0x5dda39=_[_0xe578('0x41')]({},_0x5dda39,_0x54bf27[_0xe578('0x42')]);return db[_0xe578('0x30')][_0xe578('0x49')](_0x5dda39)['then'](handleEntityNotFound(_0x4e412b,null))[_0xe578('0x29')](respondWithResult(_0x4e412b,null))[_0xe578('0x4a')](handleError(_0x4e412b,null));};exports[_0xe578('0x4b')]=function(_0x151e98,_0x238d9b){return db[_0xe578('0x30')][_0xe578('0x4b')](_0x151e98[_0xe578('0x4c')],{})[_0xe578('0x29')](respondWithResult(_0x238d9b,0xc9))[_0xe578('0x4a')](handleError(_0x238d9b,null));};exports['update']=function(_0x2e0064,_0x21a176){if(_0x2e0064['body']['id']){delete _0x2e0064[_0xe578('0x4c')]['id'];}return db[_0xe578('0x30')]['find']({'where':{'id':_0x2e0064[_0xe578('0x48')]['id']}})[_0xe578('0x29')](handleEntityNotFound(_0x21a176,null))[_0xe578('0x29')](saveUpdates(_0x2e0064[_0xe578('0x4c')],null))[_0xe578('0x29')](respondWithResult(_0x21a176,null))['catch'](handleError(_0x21a176,null));};exports[_0xe578('0x28')]=function(_0x173b7c,_0x181797){return db[_0xe578('0x30')][_0xe578('0x49')]({'where':{'id':_0x173b7c[_0xe578('0x48')]['id']}})['then'](handleEntityNotFound(_0x181797,null))[_0xe578('0x29')](removeEntity(_0x181797,null))['catch'](handleError(_0x181797,null));}; \ No newline at end of file +var _0x7313=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','reject','save','update','then','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x4a8bb0,_0x528f8d){var _0x4d4bdb=function(_0x3e025b){while(--_0x3e025b){_0x4a8bb0['push'](_0x4a8bb0['shift']());}};_0x4d4bdb(++_0x528f8d);}(_0x7313,0x93));var _0x3731=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x7313[_0x10004e];return _0x5af990;};'use strict';var emlformat=require(_0x3731('0x0'));var rimraf=require(_0x3731('0x1'));var zipdir=require(_0x3731('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3731('0x3'));var moment=require('moment');var BPromise=require(_0x3731('0x4'));var Mustache=require(_0x3731('0x5'));var util=require(_0x3731('0x6'));var path=require(_0x3731('0x7'));var sox=require(_0x3731('0x8'));var csv=require(_0x3731('0x9'));var ejs=require(_0x3731('0xa'));var fs=require('fs');var fs_extra=require(_0x3731('0xb'));var _=require(_0x3731('0xc'));var squel=require(_0x3731('0xd'));var crypto=require(_0x3731('0xe'));var jsforce=require(_0x3731('0xf'));var deskjs=require(_0x3731('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3731('0x11'));var authService=require(_0x3731('0x12'));var qs=require(_0x3731('0x13'));var as=require(_0x3731('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3731('0x15'))(_0x3731('0x16'));var utils=require(_0x3731('0x17'));var config=require(_0x3731('0x18'));var licenseUtil=require(_0x3731('0x19'));var db=require(_0x3731('0x1a'))['db'];function respondWithStatusCode(_0x227c32,_0x2b6641){_0x2b6641=_0x2b6641||0xcc;return function(_0x420fa2){if(_0x420fa2){return _0x227c32[_0x3731('0x1b')](_0x2b6641);}return _0x227c32[_0x3731('0x1c')](_0x2b6641)[_0x3731('0x1d')]();};}function respondWithResult(_0x5220f0,_0x476bdb){_0x476bdb=_0x476bdb||0xc8;return function(_0x203693){if(_0x203693){return _0x5220f0[_0x3731('0x1c')](_0x476bdb)['json'](_0x203693);}};}function respondWithFilteredResult(_0xb51e55,_0x537723){return function(_0x2e929f){if(_0x2e929f){var _0x12de1a=typeof _0x537723[_0x3731('0x1e')]===_0x3731('0x1f')&&typeof _0x537723['limit']===_0x3731('0x1f');var _0x5a075b=_0x2e929f['count'];var _0x1d370a=_0x12de1a?0x0:_0x537723[_0x3731('0x1e')];var _0xe8f50f=_0x12de1a?_0x2e929f[_0x3731('0x20')]:_0x537723[_0x3731('0x1e')]+_0x537723['limit'];var _0x361865;if(_0xe8f50f>=_0x5a075b){_0xe8f50f=_0x5a075b;_0x361865=0xc8;}else{_0x361865=0xce;}_0xb51e55[_0x3731('0x1c')](_0x361865);return _0xb51e55[_0x3731('0x21')](_0x3731('0x22'),_0x1d370a+'-'+_0xe8f50f+'/'+_0x5a075b)['json'](_0x2e929f);}return null;};}function patchUpdates(_0x4872b8){return function(_0x1535b6){try{jsonpatch['apply'](_0x1535b6,_0x4872b8,!![]);}catch(_0x1decbe){return BPromise[_0x3731('0x23')](_0x1decbe);}return _0x1535b6[_0x3731('0x24')]();};}function saveUpdates(_0x35967f,_0x5c5491){return function(_0x168d73){if(_0x168d73){return _0x168d73[_0x3731('0x25')](_0x35967f)[_0x3731('0x26')](function(_0xdfebcf){return _0xdfebcf;});}return null;};}function removeEntity(_0x57e3ac,_0x21d8c4){return function(_0xe40294){if(_0xe40294){return _0xe40294['destroy']()['then'](function(){_0x57e3ac[_0x3731('0x1c')](0xcc)[_0x3731('0x1d')]();});}};}function handleEntityNotFound(_0xff97a0,_0x36beeb){return function(_0x38043c){if(!_0x38043c){_0xff97a0[_0x3731('0x1b')](0x194);}return _0x38043c;};}function handleError(_0x35e8ff,_0x31a8f7){_0x31a8f7=_0x31a8f7||0x1f4;return function(_0x3eb429){logger['error'](_0x3eb429[_0x3731('0x27')]);if(_0x3eb429[_0x3731('0x28')]){delete _0x3eb429[_0x3731('0x28')];}_0x35e8ff[_0x3731('0x1c')](_0x31a8f7)[_0x3731('0x29')](_0x3eb429);};}exports['index']=function(_0x29db36,_0x2416e6){var _0x5527c9={},_0x2bbddb={},_0x8c3a91={'count':0x0,'rows':[]};var _0x326296=_[_0x3731('0x2a')](db[_0x3731('0x2b')][_0x3731('0x2c')],function(_0x39a2c3){return{'name':_0x39a2c3[_0x3731('0x2d')],'type':_0x39a2c3[_0x3731('0x2e')][_0x3731('0x2f')]};});_0x2bbddb['model']=_[_0x3731('0x2a')](_0x326296,_0x3731('0x28'));_0x2bbddb[_0x3731('0x30')]=_[_0x3731('0x31')](_0x29db36[_0x3731('0x30')]);_0x2bbddb[_0x3731('0x32')]=_[_0x3731('0x33')](_0x2bbddb['model'],_0x2bbddb[_0x3731('0x30')]);_0x5527c9[_0x3731('0x34')]=_[_0x3731('0x33')](_0x2bbddb['model'],qs['fields'](_0x29db36[_0x3731('0x30')][_0x3731('0x35')]));_0x5527c9[_0x3731('0x34')]=_0x5527c9['attributes'][_0x3731('0x36')]?_0x5527c9[_0x3731('0x34')]:_0x2bbddb[_0x3731('0x37')];if(!_0x29db36[_0x3731('0x30')][_0x3731('0x38')](_0x3731('0x39'))){_0x5527c9['limit']=qs['limit'](_0x29db36[_0x3731('0x30')][_0x3731('0x3a')]);_0x5527c9[_0x3731('0x1e')]=qs[_0x3731('0x1e')](_0x29db36[_0x3731('0x30')][_0x3731('0x1e')]);}_0x5527c9[_0x3731('0x3b')]=qs['sort'](_0x29db36[_0x3731('0x30')][_0x3731('0x3c')]);_0x5527c9[_0x3731('0x3d')]=qs['filters'](_[_0x3731('0x3e')](_0x29db36[_0x3731('0x30')],_0x2bbddb[_0x3731('0x32')]),_0x326296);if(_0x29db36['query'][_0x3731('0x3f')]){_0x5527c9[_0x3731('0x3d')]=_[_0x3731('0x40')](_0x5527c9[_0x3731('0x3d')],{'$or':_['map'](_0x326296,function(_0x590876){if(_0x590876['type']!==_0x3731('0x41')){var _0x35e53e={};_0x35e53e[_0x590876[_0x3731('0x28')]]={'$like':'%'+_0x29db36[_0x3731('0x30')][_0x3731('0x3f')]+'%'};return _0x35e53e;}})});}_0x5527c9=_[_0x3731('0x40')]({},_0x5527c9,_0x29db36[_0x3731('0x42')]);var _0x1cb632={'where':_0x5527c9['where']};return db[_0x3731('0x2b')][_0x3731('0x20')](_0x1cb632)['then'](function(_0xe11e06){_0x8c3a91[_0x3731('0x20')]=_0xe11e06;if(_0x29db36[_0x3731('0x30')][_0x3731('0x43')]){_0x5527c9['include']=[{'all':!![]}];}return db[_0x3731('0x2b')][_0x3731('0x44')](_0x5527c9);})[_0x3731('0x26')](function(_0x4f4ad4){_0x8c3a91[_0x3731('0x45')]=_0x4f4ad4;return _0x8c3a91;})['then'](respondWithFilteredResult(_0x2416e6,_0x5527c9))[_0x3731('0x46')](handleError(_0x2416e6,null));};exports[_0x3731('0x47')]=function(_0x5c062a,_0x4cd336){var _0x1be205={'raw':!![],'where':{'id':_0x5c062a[_0x3731('0x48')]['id']}},_0x240f0c={};_0x240f0c[_0x3731('0x37')]=_[_0x3731('0x31')](db['VoiceQueuesLog'][_0x3731('0x2c')]);_0x240f0c[_0x3731('0x30')]=_[_0x3731('0x31')](_0x5c062a['query']);_0x240f0c['filters']=_[_0x3731('0x33')](_0x240f0c[_0x3731('0x37')],_0x240f0c[_0x3731('0x30')]);_0x1be205[_0x3731('0x34')]=_[_0x3731('0x33')](_0x240f0c[_0x3731('0x37')],qs['fields'](_0x5c062a[_0x3731('0x30')][_0x3731('0x35')]));_0x1be205[_0x3731('0x34')]=_0x1be205[_0x3731('0x34')][_0x3731('0x36')]?_0x1be205[_0x3731('0x34')]:_0x240f0c['model'];if(_0x5c062a['query']['includeAll']){_0x1be205['include']=[{'all':!![]}];}_0x1be205=_[_0x3731('0x40')]({},_0x1be205,_0x5c062a[_0x3731('0x42')]);return db[_0x3731('0x2b')]['find'](_0x1be205)[_0x3731('0x26')](handleEntityNotFound(_0x4cd336,null))[_0x3731('0x26')](respondWithResult(_0x4cd336,null))[_0x3731('0x46')](handleError(_0x4cd336,null));};exports[_0x3731('0x49')]=function(_0x2e4878,_0x2af9c6){return db[_0x3731('0x2b')][_0x3731('0x49')](_0x2e4878['body'],{})['then'](respondWithResult(_0x2af9c6,0xc9))[_0x3731('0x46')](handleError(_0x2af9c6,null));};exports[_0x3731('0x25')]=function(_0x454f8b,_0xe1dcf9){if(_0x454f8b[_0x3731('0x4a')]['id']){delete _0x454f8b['body']['id'];}return db[_0x3731('0x2b')][_0x3731('0x4b')]({'where':{'id':_0x454f8b[_0x3731('0x48')]['id']}})[_0x3731('0x26')](handleEntityNotFound(_0xe1dcf9,null))[_0x3731('0x26')](saveUpdates(_0x454f8b['body'],null))[_0x3731('0x26')](respondWithResult(_0xe1dcf9,null))[_0x3731('0x46')](handleError(_0xe1dcf9,null));};exports[_0x3731('0x4c')]=function(_0x1d94c1,_0x5d8110){return db[_0x3731('0x2b')][_0x3731('0x4b')]({'where':{'id':_0x1d94c1['params']['id']}})['then'](handleEntityNotFound(_0x5d8110,null))[_0x3731('0x26')](removeEntity(_0x5d8110,null))[_0x3731('0x46')](handleError(_0x5d8110,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index dfb4363..56fa52c 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 _0x58ea=['event_dtm','event','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log'];(function(_0xf71725,_0x2bf8b4){var _0x10477f=function(_0x1ecabd){while(--_0x1ecabd){_0xf71725['push'](_0xf71725['shift']());}};_0x10477f(++_0x2bf8b4);}(_0x58ea,0xa7));var _0xa58e=function(_0x227578,_0x4b4e46){_0x227578=_0x227578-0x0;var _0x16e4ce=_0x58ea[_0x227578];return _0x16e4ce;};'use strict';var _=require('lodash');var util=require(_0xa58e('0x0'));var logger=require(_0xa58e('0x1'))(_0xa58e('0x2'));var moment=require(_0xa58e('0x3'));var BPromise=require(_0xa58e('0x4'));var rp=require(_0xa58e('0x5'));var fs=require('fs');var path=require(_0xa58e('0x6'));var rimraf=require(_0xa58e('0x7'));var config=require(_0xa58e('0x8'));var attributes=require(_0xa58e('0x9'));module[_0xa58e('0xa')]=function(_0x24249e,_0x1182a3){return _0x24249e[_0xa58e('0xb')]('VoiceQueuesLog',attributes,{'tableName':_0xa58e('0xc'),'paranoid':![],'indexes':[{'name':_0xa58e('0xd'),'fields':[_0xa58e('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x2394=['request-promise','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event_dtm','event','dtm','lodash','api','moment','bluebird'];(function(_0x4d696c,_0x56a1ec){var _0x1c4d91=function(_0x3e780c){while(--_0x3e780c){_0x4d696c['push'](_0x4d696c['shift']());}};_0x1c4d91(++_0x56a1ec);}(_0x2394,0x1f4));var _0x4239=function(_0x2eba5e,_0x304173){_0x2eba5e=_0x2eba5e-0x0;var _0x5baf3d=_0x2394[_0x2eba5e];return _0x5baf3d;};'use strict';var _=require(_0x4239('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4239('0x1'));var moment=require(_0x4239('0x2'));var BPromise=require(_0x4239('0x3'));var rp=require(_0x4239('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4239('0x5'));var attributes=require(_0x4239('0x6'));module['exports']=function(_0x3d6d9e,_0x27415e){return _0x3d6d9e[_0x4239('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0x4239('0x8'),'paranoid':![],'indexes':[{'name':_0x4239('0x9'),'fields':[_0x4239('0xa'),_0x4239('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index c0d6ba2..def79c4 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 _0x4d71=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring'];(function(_0x2a06fc,_0x25be89){var _0x2dac8f=function(_0x5c5e5c){while(--_0x5c5e5c){_0x2a06fc['push'](_0x2a06fc['shift']());}};_0x2dac8f(++_0x25be89);}(_0x4d71,0x6b));var _0x14d7=function(_0x48a335,_0x359b33){_0x48a335=_0x48a335-0x0;var _0xd83ca8=_0x4d71[_0x48a335];return _0xd83ca8;};'use strict';var _=require(_0x14d7('0x0'));var util=require('util');var moment=require(_0x14d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x14d7('0x2'));var fs=require('fs');var Redis=require(_0x14d7('0x3'));var db=require(_0x14d7('0x4'))['db'];var utils=require(_0x14d7('0x5'));var logger=require('../../config/logger')(_0x14d7('0x6'));var config=require(_0x14d7('0x7'));var jayson=require(_0x14d7('0x8'));var client=jayson[_0x14d7('0x9')][_0x14d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ee6e6,_0x364142,_0x3e4efd){return new BPromise(function(_0x5a9294,_0x9c7dc5){return client['request'](_0x2ee6e6,_0x3e4efd)[_0x14d7('0xb')](function(_0x238619){logger[_0x14d7('0xc')](_0x14d7('0xd'),_0x364142,_0x14d7('0xe'));logger[_0x14d7('0xf')](_0x14d7('0x10'),_0x364142,_0x14d7('0xe'),JSON[_0x14d7('0x11')](_0x238619));if(_0x238619[_0x14d7('0x12')]){if(_0x238619[_0x14d7('0x12')]['code']===0x1f4){logger[_0x14d7('0x12')](_0x14d7('0xd'),_0x364142,_0x238619[_0x14d7('0x12')]['message']);return _0x9c7dc5(_0x238619[_0x14d7('0x12')][_0x14d7('0x13')]);}logger[_0x14d7('0x12')](_0x14d7('0xd'),_0x364142,_0x238619[_0x14d7('0x12')][_0x14d7('0x13')]);return _0x5a9294(_0x238619[_0x14d7('0x12')]['message']);}else{logger[_0x14d7('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x364142,_0x14d7('0xe'));_0x5a9294(_0x238619[_0x14d7('0x14')]['message']);}})[_0x14d7('0x15')](function(_0x3474b4){logger['error'](_0x14d7('0xd'),_0x364142,_0x3474b4);_0x9c7dc5(_0x3474b4);});});} \ No newline at end of file +var _0x4522=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2e180c,_0x5d9dd1){var _0x2496a3=function(_0x27c9ee){while(--_0x27c9ee){_0x2e180c['push'](_0x2e180c['shift']());}};_0x2496a3(++_0x5d9dd1);}(_0x4522,0x1a0));var _0x2452=function(_0x33dcfc,_0x34f7d6){_0x33dcfc=_0x33dcfc-0x0;var _0x2a2dec=_0x4522[_0x33dcfc];return _0x2a2dec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3f13d97..d89adee 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 _0x47cb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','/:id','/:id/download','download','/:id/transcribe','downloadTranscribe','post','update','delete','destroy','exports','multer'];(function(_0x4ea17a,_0x4b9c83){var _0x58e65f=function(_0x46ad6d){while(--_0x46ad6d){_0x4ea17a['push'](_0x4ea17a['shift']());}};_0x58e65f(++_0x4b9c83);}(_0x47cb,0x107));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb47c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb47c('0x1'));var router=express[_0xb47c('0x2')]();var fs_extra=require(_0xb47c('0x3'));var auth=require(_0xb47c('0x4'));var interaction=require(_0xb47c('0x5'));var config=require(_0xb47c('0x6'));var controller=require(_0xb47c('0x7'));router[_0xb47c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb47c('0x9')]);router[_0xb47c('0x8')]('/describe',auth[_0xb47c('0xa')](),controller[_0xb47c('0xb')]);router[_0xb47c('0x8')](_0xb47c('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb47c('0xd'),auth[_0xb47c('0xa')](),controller[_0xb47c('0xe')]);router[_0xb47c('0x8')]('/:id/downloads',controller['downloads']);router[_0xb47c('0x8')](_0xb47c('0xf'),auth['isAuthenticated'](),controller[_0xb47c('0x10')]);router[_0xb47c('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb47c('0x11')](_0xb47c('0xf'),auth[_0xb47c('0xa')](),controller['runTranscribe']);router['put'](_0xb47c('0xc'),auth['isAuthenticated'](),controller[_0xb47c('0x12')]);router[_0xb47c('0x13')](_0xb47c('0xc'),auth[_0xb47c('0xa')](),controller[_0xb47c('0x14')]);module[_0xb47c('0x15')]=router; \ No newline at end of file +var _0xb232=['runTranscribe','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post'];(function(_0x56f0,_0x4e1f39){var _0x4fe5ab=function(_0x245834){while(--_0x245834){_0x56f0['push'](_0x56f0['shift']());}};_0x4fe5ab(++_0x4e1f39);}(_0xb232,0x1b5));var _0x2b23=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xb232[_0x3747ae];return _0x339035;};'use strict';var multer=require(_0x2b23('0x0'));var util=require(_0x2b23('0x1'));var path=require(_0x2b23('0x2'));var timeout=require(_0x2b23('0x3'));var express=require('express');var router=express[_0x2b23('0x4')]();var fs_extra=require(_0x2b23('0x5'));var auth=require(_0x2b23('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2b23('0x7'));var controller=require(_0x2b23('0x8'));router[_0x2b23('0x9')]('/',auth[_0x2b23('0xa')](),controller[_0x2b23('0xb')]);router[_0x2b23('0x9')]('/describe',auth[_0x2b23('0xa')](),controller[_0x2b23('0xc')]);router[_0x2b23('0x9')](_0x2b23('0xd'),auth[_0x2b23('0xa')](),controller['show']);router[_0x2b23('0x9')](_0x2b23('0xe'),auth[_0x2b23('0xa')](),controller[_0x2b23('0xf')]);router[_0x2b23('0x9')](_0x2b23('0x10'),controller[_0x2b23('0x11')]);router[_0x2b23('0x9')](_0x2b23('0x12'),auth['isAuthenticated'](),controller[_0x2b23('0x13')]);router['post']('/',auth[_0x2b23('0xa')](),controller[_0x2b23('0x14')]);router[_0x2b23('0x15')](_0x2b23('0x12'),auth[_0x2b23('0xa')](),controller[_0x2b23('0x16')]);router['put']('/:id',auth[_0x2b23('0xa')](),controller[_0x2b23('0x17')]);router[_0x2b23('0x18')](_0x2b23('0xd'),auth['isAuthenticated'](),controller[_0x2b23('0x19')]);module[_0x2b23('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9593482..08b1da0 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(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 8fa1d6d..8e08bb3 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 _0xb9fc=['findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','uuid/v4','ioredis','../../components/auth/service','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','stack','name','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','rawAttributes','length','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','unlink','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','token','$and','push','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','listBuckets','upload','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','runTranscribe'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xb9fc,0x1cb));var _0xcb9f=function(_0x4c6c70,_0x35f5c4){_0x4c6c70=_0x4c6c70-0x0;var _0x1ad010=_0xb9fc[_0x4c6c70];return _0x1ad010;};'use strict';var emlformat=require(_0xcb9f('0x0'));var rimraf=require(_0xcb9f('0x1'));var zipdir=require(_0xcb9f('0x2'));var jsonpatch=require(_0xcb9f('0x3'));var rp=require(_0xcb9f('0x4'));var moment=require(_0xcb9f('0x5'));var BPromise=require(_0xcb9f('0x6'));var Mustache=require('mustache');var util=require(_0xcb9f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xcb9f('0x8'));var ejs=require(_0xcb9f('0x9'));var fs=require('fs');var fs_extra=require(_0xcb9f('0xa'));var _=require(_0xcb9f('0xb'));var squel=require(_0xcb9f('0xc'));var crypto=require(_0xcb9f('0xd'));var jsforce=require(_0xcb9f('0xe'));var deskjs=require(_0xcb9f('0xf'));var toCsv=require(_0xcb9f('0x8'));var querystring=require(_0xcb9f('0x10'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xcb9f('0x11'));var Redis=require(_0xcb9f('0x12'));var authService=require(_0xcb9f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcb9f('0x14'));var utils=require('../../config/utils');var config=require(_0xcb9f('0x15'));var licenseUtil=require(_0xcb9f('0x16'));var db=require(_0xcb9f('0x17'))['db'];function respondWithStatusCode(_0x538d61,_0x336e75){_0x336e75=_0x336e75||0xcc;return function(_0x34db9c){if(_0x34db9c){return _0x538d61[_0xcb9f('0x18')](_0x336e75);}return _0x538d61['status'](_0x336e75)[_0xcb9f('0x19')]();};}function respondWithResult(_0x519ceb,_0x31370f){_0x31370f=_0x31370f||0xc8;return function(_0xdd1348){if(_0xdd1348){return _0x519ceb[_0xcb9f('0x1a')](_0x31370f)[_0xcb9f('0x1b')](_0xdd1348);}};}function respondWithFilteredResult(_0x145761,_0x4bbfae){return function(_0x1e6bf9){if(_0x1e6bf9){var _0x30059f=typeof _0x4bbfae[_0xcb9f('0x1c')]===_0xcb9f('0x1d')&&typeof _0x4bbfae['limit']===_0xcb9f('0x1d');var _0x52f80f=_0x1e6bf9[_0xcb9f('0x1e')];var _0x54ef56=_0x30059f?0x0:_0x4bbfae['offset'];var _0xa22ac5=_0x30059f?_0x1e6bf9['count']:_0x4bbfae[_0xcb9f('0x1c')]+_0x4bbfae[_0xcb9f('0x1f')];var _0x59f6b7;if(_0xa22ac5>=_0x52f80f){_0xa22ac5=_0x52f80f;_0x59f6b7=0xc8;}else{_0x59f6b7=0xce;}_0x145761[_0xcb9f('0x1a')](_0x59f6b7);return _0x145761['set'](_0xcb9f('0x20'),_0x54ef56+'-'+_0xa22ac5+'/'+_0x52f80f)[_0xcb9f('0x1b')](_0x1e6bf9);}return null;};}function patchUpdates(_0x20963d){return function(_0x9ffe81){try{jsonpatch[_0xcb9f('0x21')](_0x9ffe81,_0x20963d,!![]);}catch(_0x1a808c){return BPromise['reject'](_0x1a808c);}return _0x9ffe81[_0xcb9f('0x22')]();};}function saveUpdates(_0x136fab,_0x2332e0){return function(_0x15dc53){if(_0x15dc53){return _0x15dc53[_0xcb9f('0x23')](_0x136fab)[_0xcb9f('0x24')](function(_0x151504){return _0x151504;});}return null;};}function removeEntity(_0x5c6096,_0x111784){return function(_0x955aa0){if(_0x955aa0){return _0x955aa0[_0xcb9f('0x25')]()[_0xcb9f('0x24')](function(){_0x5c6096[_0xcb9f('0x1a')](0xcc)[_0xcb9f('0x19')]();});}};}function handleEntityNotFound(_0x511c32,_0x4e59a5){return function(_0x144d02){if(!_0x144d02){_0x511c32[_0xcb9f('0x18')](0x194);}return _0x144d02;};}function handleError(_0x507967,_0x155c26){_0x155c26=_0x155c26||0x1f4;return function(_0xf186d){logger['error'](_0xf186d[_0xcb9f('0x26')]);if(_0xf186d[_0xcb9f('0x27')]){delete _0xf186d[_0xcb9f('0x27')];}_0x507967[_0xcb9f('0x1a')](_0x155c26)['send'](_0xf186d);};}exports[_0xcb9f('0x28')]=function(_0x2a1b2b,_0x291f3c){var _0x7df42f={},_0xaaf19e={},_0x362d05={'count':0x0,'rows':[]};var _0x3fc772=_[_0xcb9f('0x29')](db[_0xcb9f('0x2a')]['rawAttributes'],function(_0x1874d0){return{'name':_0x1874d0[_0xcb9f('0x2b')],'type':_0x1874d0[_0xcb9f('0x2c')][_0xcb9f('0x2d')]};});_0xaaf19e[_0xcb9f('0x2e')]=_[_0xcb9f('0x2f')](_[_0xcb9f('0x29')](_0x3fc772,_0xcb9f('0x27')),[_0xcb9f('0x30')]);_0xaaf19e[_0xcb9f('0x31')]=_[_0xcb9f('0x32')](_0x2a1b2b[_0xcb9f('0x31')]);_0xaaf19e[_0xcb9f('0x33')]=_[_0xcb9f('0x34')](_0xaaf19e[_0xcb9f('0x2e')],_0xaaf19e['query']);_0x7df42f[_0xcb9f('0x35')]=_[_0xcb9f('0x34')](_0xaaf19e[_0xcb9f('0x2e')],qs[_0xcb9f('0x36')](_0x2a1b2b[_0xcb9f('0x31')][_0xcb9f('0x36')]));_0x7df42f['attributes']=_0x7df42f[_0xcb9f('0x35')]['length']?_0x7df42f[_0xcb9f('0x35')]:_0xaaf19e['model'];if(!_0x2a1b2b[_0xcb9f('0x31')][_0xcb9f('0x37')]('nolimit')){_0x7df42f[_0xcb9f('0x1f')]=qs[_0xcb9f('0x1f')](_0x2a1b2b[_0xcb9f('0x31')][_0xcb9f('0x1f')]);_0x7df42f[_0xcb9f('0x1c')]=qs[_0xcb9f('0x1c')](_0x2a1b2b[_0xcb9f('0x31')]['offset']);}_0x7df42f['order']=qs[_0xcb9f('0x38')](_0x2a1b2b['query'][_0xcb9f('0x38')]);_0x7df42f[_0xcb9f('0x39')]=qs['filters'](_[_0xcb9f('0x3a')](_0x2a1b2b[_0xcb9f('0x31')],_0xaaf19e[_0xcb9f('0x33')]),_0x3fc772);if(_0x2a1b2b[_0xcb9f('0x31')]['filter']){_0x7df42f['where']=_[_0xcb9f('0x3b')](_0x7df42f['where'],{'$or':_[_0xcb9f('0x29')](_0x3fc772,function(_0x550e4e){if(_0x550e4e[_0xcb9f('0x2c')]!==_0xcb9f('0x3c')){var _0x5d5eff={};_0x5d5eff[_0x550e4e['name']]={'$like':'%'+_0x2a1b2b[_0xcb9f('0x31')][_0xcb9f('0x3d')]+'%'};return _0x5d5eff;}})});}_0x7df42f=_[_0xcb9f('0x3b')]({},_0x7df42f,_0x2a1b2b[_0xcb9f('0x3e')]);var _0x112c2d={'where':_0x7df42f['where']};return db[_0xcb9f('0x2a')]['count'](_0x112c2d)['then'](function(_0x237b06){_0x362d05[_0xcb9f('0x1e')]=_0x237b06;if(_0x2a1b2b[_0xcb9f('0x31')][_0xcb9f('0x3f')]){_0x7df42f[_0xcb9f('0x40')]=[{'all':!![]}];}return db[_0xcb9f('0x2a')]['findAll'](_0x7df42f);})[_0xcb9f('0x24')](function(_0x4a8b0d){_0x362d05['rows']=_0x4a8b0d;return _0x362d05;})[_0xcb9f('0x24')](respondWithFilteredResult(_0x291f3c,_0x7df42f))[_0xcb9f('0x41')](handleError(_0x291f3c,null));};exports[_0xcb9f('0x42')]=function(_0x4daa21,_0x28df35){var _0xc83a93={'raw':![],'where':{'id':_0x4daa21[_0xcb9f('0x43')]['id']}},_0x203ce3={};_0x203ce3[_0xcb9f('0x2e')]=_[_0xcb9f('0x32')](db[_0xcb9f('0x2a')][_0xcb9f('0x44')]);_0x203ce3[_0xcb9f('0x31')]=_[_0xcb9f('0x32')](_0x4daa21['query']);_0x203ce3[_0xcb9f('0x33')]=_[_0xcb9f('0x34')](_0x203ce3['model'],_0x203ce3['query']);_0xc83a93[_0xcb9f('0x35')]=_['intersection'](_0x203ce3['model'],qs['fields'](_0x4daa21['query'][_0xcb9f('0x36')]));_0xc83a93['attributes']=_0xc83a93[_0xcb9f('0x35')][_0xcb9f('0x45')]?_0xc83a93[_0xcb9f('0x35')]:_0x203ce3[_0xcb9f('0x2e')];if(_0x4daa21[_0xcb9f('0x31')][_0xcb9f('0x3f')]){_0xc83a93[_0xcb9f('0x40')]=[{'all':!![]}];}_0xc83a93=_['merge']({},_0xc83a93,_0x4daa21[_0xcb9f('0x3e')]);return db[_0xcb9f('0x2a')][_0xcb9f('0x46')](_0xc83a93)[_0xcb9f('0x24')](handleEntityNotFound(_0x28df35,null))['then'](respondWithResult(_0x28df35,null))[_0xcb9f('0x41')](handleError(_0x28df35,null));};exports[_0xcb9f('0x47')]=function(_0x1ad352,_0x4d7332){return db[_0xcb9f('0x2a')][_0xcb9f('0x47')](_0x1ad352['body'],{})[_0xcb9f('0x24')](respondWithResult(_0x4d7332,0xc9))['catch'](handleError(_0x4d7332,null));};exports[_0xcb9f('0x23')]=function(_0x195d5c,_0x47acf6){if(_0x195d5c[_0xcb9f('0x48')]['id']){delete _0x195d5c['body']['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x195d5c[_0xcb9f('0x43')]['id']}})[_0xcb9f('0x24')](handleEntityNotFound(_0x47acf6,null))['then'](saveUpdates(_0x195d5c[_0xcb9f('0x48')],null))[_0xcb9f('0x24')](respondWithResult(_0x47acf6,null))[_0xcb9f('0x41')](handleError(_0x47acf6,null));};exports[_0xcb9f('0x49')]=function(_0x529d5d,_0x2001f4){return db['VoiceRecording'][_0xcb9f('0x49')]()[_0xcb9f('0x24')](respondWithResult(_0x2001f4,null))[_0xcb9f('0x41')](handleError(_0x2001f4,null));};exports[_0xcb9f('0x4a')]=function(_0x52474d,_0x286d57,_0x318611){var _0x3147e5=require('../../components/encryptor');var _0x4d39c6=![];var _0x20d029={};if(_0x52474d[_0xcb9f('0x31')]['type']&&_0x52474d[_0xcb9f('0x31')][_0xcb9f('0x2c')]==='uniqueid'){_0x20d029[_0xcb9f('0x4b')]=_0x52474d[_0xcb9f('0x43')]['id'];}else{_0x20d029['id']=_0x52474d[_0xcb9f('0x43')]['id'];}return db[_0xcb9f('0x2a')]['find']({'where':_0x20d029,'attributes':['id',_0xcb9f('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x286d57,null))['then'](function(_0x2c2b7b){if(_0x2c2b7b){var _0x569b3c=_0x2c2b7b[_0xcb9f('0x4c')];var _0xd6d0f1=util['format'](_0xcb9f('0x4d'),_0x569b3c);if(fs[_0xcb9f('0x4e')](_0xd6d0f1)){_0x4d39c6=!![];return _0x3147e5[_0xcb9f('0x4f')](_0xd6d0f1,_0x569b3c,config[_0xcb9f('0x50')][_0xcb9f('0x51')])['then'](function(){return _0x2c2b7b;});}return _0x2c2b7b;}})['then'](function(_0x3762a5){if(_0x3762a5){var _0x3f3db2=_0x3762a5[_0xcb9f('0x4c')];if(!fs[_0xcb9f('0x4e')](_0x3f3db2)){throw new db[(_0xcb9f('0x52'))][(_0xcb9f('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x3762a5[_0xcb9f('0x54')]){return _0x286d57[_0xcb9f('0x4a')](_0x3f3db2,_0x3762a5[_0xcb9f('0x54')]+path['extname'](_0x3f3db2),function(){if(_0x4d39c6){fs[_0xcb9f('0x55')](_0x3f3db2);}});}else{return _0x286d57[_0xcb9f('0x4a')](_0x3f3db2,function(_0x3b89c4){if(_0x4d39c6){fs[_0xcb9f('0x55')](_0x3f3db2);}});}}})[_0xcb9f('0x41')](function(_0x569fe3){if(_0x569fe3['message']===_0xcb9f('0x56')){_0x286d57[_0xcb9f('0x1a')](0x194)[_0xcb9f('0x57')](_0xcb9f('0x58'));}else{return handleError(_0x286d57,null);}});};exports[_0xcb9f('0x59')]=function(_0x9cbaa4,_0x560587,_0x44f921){var _0x597924=require(_0xcb9f('0x5a'));var _0x377ed0=![];var _0x2d1429={'$and':[db[_0xcb9f('0x5b')][_0xcb9f('0x39')](db[_0xcb9f('0x5b')]['fn'](_0xcb9f('0x5c'),db[_0xcb9f('0x5b')]['col'](_0xcb9f('0x4b'))),_0x9cbaa4[_0xcb9f('0x31')][_0xcb9f('0x5d')])]};if(_0x9cbaa4['query'][_0xcb9f('0x2c')]&&_0x9cbaa4[_0xcb9f('0x31')][_0xcb9f('0x2c')]==='uniqueid'){_0x2d1429[_0xcb9f('0x5e')][_0xcb9f('0x5f')]({'uniqueid':_0x9cbaa4[_0xcb9f('0x43')]['id']});}else{_0x2d1429[_0xcb9f('0x5e')][_0xcb9f('0x5f')]({'id':_0x9cbaa4['params']['id']});}return db['VoiceRecording'][_0xcb9f('0x46')]({'where':_0x2d1429,'attributes':['id',_0xcb9f('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x560587,null))[_0xcb9f('0x24')](function(_0xcc7a6b){if(_0xcc7a6b){var _0x1032be=util[_0xcb9f('0x30')](_0xcb9f('0x4d'),_0xcc7a6b[_0xcb9f('0x4c')]);if(fs[_0xcb9f('0x4e')](_0x1032be)){_0x377ed0=!![];return _0x597924['decryptFile'](_0x1032be,_0xcc7a6b[_0xcb9f('0x4c')],config['secrets'][_0xcb9f('0x51')])[_0xcb9f('0x24')](function(){return _0xcc7a6b;});}return _0xcc7a6b;}})['then'](function(_0x4fffe0){if(_0x4fffe0){if(!fs[_0xcb9f('0x4e')](_0x4fffe0['value'])){throw new db[(_0xcb9f('0x52'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x4fffe0[_0xcb9f('0x54')]){return _0x560587['download'](_0x4fffe0['value'],_0x4fffe0[_0xcb9f('0x54')]+path['extname'](_0x4fffe0[_0xcb9f('0x4c')]),function(){if(_0x377ed0){fs[_0xcb9f('0x55')](_0x4fffe0[_0xcb9f('0x4c')]);}});}else{return _0x560587['download'](_0x4fffe0[_0xcb9f('0x4c')],function(_0x293159){if(_0x377ed0){fs['unlink'](_0x4fffe0[_0xcb9f('0x4c')]);}});}}})['catch'](handleError(_0x560587,null));};exports[_0xcb9f('0x25')]=function(_0x393233,_0x4e1bfb){return db[_0xcb9f('0x2a')]['find']({'where':{'id':_0x393233['params']['id']}})[_0xcb9f('0x24')](function(_0x5beb9a){if(_[_0xcb9f('0x60')](_0x5beb9a)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5beb9a;})[_0xcb9f('0x24')](function(_0x1da5c0){var _0x1fe3c6=_0x1da5c0[_0xcb9f('0x4c')];logger[_0xcb9f('0x61')](_0xcb9f('0x62'),_0x1fe3c6);if(!_[_0xcb9f('0x60')](_0x1da5c0[_0xcb9f('0x4c')])&&fs['existsSync'](_0x1fe3c6)){logger[_0xcb9f('0x61')]('File:\x20\x22'+_0x1fe3c6+_0xcb9f('0x63'));fs['unlinkSync'](_0x1fe3c6);}_0x1fe3c6=_0x1fe3c6+_0xcb9f('0x64');if(!_[_0xcb9f('0x60')](_0x1da5c0[_0xcb9f('0x4c')])&&fs[_0xcb9f('0x4e')](_0x1fe3c6)){logger['info'](_0xcb9f('0x65')+_0x1fe3c6+_0xcb9f('0x63'));fs['unlinkSync'](_0x1fe3c6);}return _0x1da5c0;})[_0xcb9f('0x24')](function(_0x5ae1d5){if(!_0x5ae1d5)throw new InternalError();return _0x5ae1d5['destroy']();})[_0xcb9f('0x24')](function(){_0x4e1bfb['status'](0xcc)[_0xcb9f('0x19')]();})[_0xcb9f('0x41')](handleError(_0x4e1bfb,null));};function getBucketslist(_0x828079,_0x2a7859,_0x483fb6){return new Promise(function(_0xab8fcc,_0x548429){var _0x6aa903=new AWS['S3']({'accessKeyId':_0x2a7859,'secretAccessKey':_0x828079,'region':_0x483fb6});_0x6aa903[_0xcb9f('0x66')]({},function(_0xa93fb8,_0xb4111e){if(_0xa93fb8){return _0x548429(_0xa93fb8);}else{return _0xab8fcc(_0xb4111e);}});});}function createBucket(_0x1be12a,_0x5da6ba,_0x294de8,_0x97e01b){return new Promise(function(_0x2e98f0,_0x509a8c){var _0xcc048e=new AWS['S3']({'accessKeyId':_0x5da6ba,'secretAccessKey':_0x1be12a,'region':_0x294de8});_0xcc048e['createBucket']({'Bucket':_0x97e01b},function(_0x22867d,_0x14d9b8){if(_0x22867d){return _0x509a8c(_0x22867d);}else{return _0x2e98f0(_0x14d9b8);}});});}function uploadFile(_0x4d599b,_0x5a5a57,_0x4ed0ad,_0x4ecebe,_0x1d58e3,_0x53b464){return new Promise(function(_0x13589a,_0x5262bf){var _0x212d7d=new AWS['S3']({'accessKeyId':_0x5a5a57,'secretAccessKey':_0x4d599b,'region':_0x4ed0ad});_0x212d7d[_0xcb9f('0x67')]({'Bucket':_0x4ecebe,'Key':_0x1d58e3,'Body':_0x53b464},function(_0x38f0d2,_0x4b767f){if(_0x38f0d2){return _0x5262bf(_0x38f0d2);}else{return _0x13589a(_0x4b767f);}});});}function startTranscribe(_0x4ae6dd,_0x16f3db,_0xfc50b0,_0x33cccf,_0x3b94b6,_0x126468){return new Promise(function(_0x295423,_0x51d1e5){var _0x2f38c7=new AWS['TranscribeService']({'accessKeyId':_0x16f3db,'secretAccessKey':_0x4ae6dd,'region':_0xfc50b0});_0x2f38c7[_0xcb9f('0x68')]({'TranscriptionJobName':_0x33cccf,'LanguageCode':_0x3b94b6,'Media':{'MediaFileUri':_0x126468}},function(_0x67c6ce,_0x17758e){if(_0x67c6ce){return _0x51d1e5(_0x67c6ce);}else{return _0x295423(_0x17758e);}});});}function transcribe(_0x47c445,_0x2fcad4,_0x1dc387,_0x469968,_0x31edbc,_0x7afc99,_0x538096){return new Promise(function(_0x59ef45,_0xf9f6c1){var _0x412e57={};logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x47c445,_0x31edbc));return uploadFile(_0x2fcad4,_0x1dc387,_0x469968,_0x31edbc,path['basename'](_0x7afc99),fs[_0xcb9f('0x69')](_0x7afc99))[_0xcb9f('0x24')](function(_0x9540ce){logger[_0xcb9f('0x61')](util[_0xcb9f('0x30')](_0xcb9f('0x6a'),_0x47c445,_0x31edbc,_0x9540ce[_0xcb9f('0x6b')]));_0x412e57['bucket']=_0x9540ce['Bucket'];_0x412e57['location']=_0x9540ce[_0xcb9f('0x6b')];logger[_0xcb9f('0x61')](util[_0xcb9f('0x30')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x47c445));return startTranscribe(_0x2fcad4,_0x1dc387,_0x469968,uuidv4(),_0x538096,_0x9540ce[_0xcb9f('0x6b')]);})[_0xcb9f('0x24')](function(_0x468d14){logger[_0xcb9f('0x61')](util[_0xcb9f('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x47c445,_0x468d14[_0xcb9f('0x6c')]['TranscriptionJobName']));_0x412e57[_0xcb9f('0x6d')]=_0x468d14[_0xcb9f('0x6c')][_0xcb9f('0x6e')];_0x412e57['transcribeStatus']=_0x468d14[_0xcb9f('0x6c')][_0xcb9f('0x6f')];return _0x59ef45(_0x412e57);})[_0xcb9f('0x41')](function(_0xd08cc){return _0xf9f6c1(_0xd08cc);});});}exports[_0xcb9f('0x70')]=function(_0x3a0182,_0x25c76c,_0xf93088){var _0x101473;var _0x1ad876;var _0x1263ee;var _0x217db0=require(_0xcb9f('0x5a'));return db[_0xcb9f('0x2a')][_0xcb9f('0x71')]({'where':{'id':_0x3a0182[_0xcb9f('0x43')]['id']}})['then'](function(_0x1dad04){if(_0x1dad04){var _0x2be082=util['format'](_0xcb9f('0x4d'),_0x1dad04[_0xcb9f('0x4c')]);if(fs[_0xcb9f('0x4e')](_0x2be082)){cypher=!![];return _0x217db0[_0xcb9f('0x4f')](_0x2be082,_0x1dad04[_0xcb9f('0x4c')],config[_0xcb9f('0x50')]['recording'])[_0xcb9f('0x24')](function(){return _0x1dad04;});}return _0x1dad04;}})[_0xcb9f('0x24')](function(_0x186e3d){if(!_0x186e3d){throw new db[(_0xcb9f('0x52'))][(_0xcb9f('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x1ad876=_0x186e3d;return db[_0xcb9f('0x72')]['findOne']({'where':{'id':0x1}});})[_0xcb9f('0x24')](handleEntityNotFound(_0x25c76c,null))['then'](function(_0x2ca6f9){if(_0x2ca6f9){_0x101473=_0x2ca6f9;if(!_0x101473[_0xcb9f('0x73')]||!_0x101473[_0xcb9f('0x74')]||!_0x101473[_0xcb9f('0x75')]||!_0x101473['language']||!_0x101473[_0xcb9f('0x76')]){throw new db['Sequelize'][(_0xcb9f('0x53'))]('Transcribe\x20not\x20configured');}if(_0x3a0182[_0xcb9f('0x48')][_0xcb9f('0x77')]&&(!_0x101473[_0xcb9f('0x78')]||!_0x101473[_0xcb9f('0x79')]||!_0x101473[_0xcb9f('0x7a')]||!_0x101473['language']||!_0x101473[_0xcb9f('0x76')])){throw new db['Sequelize'][(_0xcb9f('0x53'))](_0xcb9f('0x7b'));}return db[_0xcb9f('0x7c')][_0xcb9f('0x71')]({'where':{'id':_0x101473[_0xcb9f('0x74')]}});}})[_0xcb9f('0x24')](function(_0x3b341e){if(!_0x3b341e){throw new db[(_0xcb9f('0x52'))]['ValidationError'](_0xcb9f('0x7d'));}if(!_0x3b341e[_0xcb9f('0x7e')]||!_0x3b341e[_0xcb9f('0x7f')]){throw new db['Sequelize'][(_0xcb9f('0x53'))](_0xcb9f('0x80'));}_0x1263ee=_0x3b341e;return getBucketslist(_0x1263ee['data1'],_0x1263ee['data2'],_0x101473[_0xcb9f('0x75')]);})[_0xcb9f('0x24')](function(_0x27f64f){if(_0x27f64f&&_0x27f64f['Buckets']){var _0x11f376=_[_0xcb9f('0x46')](_0x27f64f['Buckets'],function(_0x3e285d){return _0x3e285d[_0xcb9f('0x81')]===_0x101473[_0xcb9f('0x76')];});if(!_0x11f376){logger['info'](util['format'](_0xcb9f('0x82'),_0x3a0182[_0xcb9f('0x43')]['id'],_0x101473[_0xcb9f('0x76')]));return createBucket(_0x1263ee[_0xcb9f('0x7e')],_0x1263ee[_0xcb9f('0x7f')],_0x101473[_0xcb9f('0x75')],_0x101473[_0xcb9f('0x76')]);}logger[_0xcb9f('0x61')](util[_0xcb9f('0x30')](_0xcb9f('0x83'),_0x3a0182[_0xcb9f('0x43')]['id'],_0x101473[_0xcb9f('0x76')]));return;}})[_0xcb9f('0x24')](function(_0x4dd1a6){if(_0x1ad876[_0xcb9f('0x84')]===_0xcb9f('0x85')){return transcribe(_0x3a0182[_0xcb9f('0x43')]['id'],_0x1263ee['data1'],_0x1263ee['data2'],_0x101473[_0xcb9f('0x75')],_0x101473[_0xcb9f('0x76')],_0x1ad876[_0xcb9f('0x4c')],_0x101473[_0xcb9f('0x86')]);}else{logger['info'](util[_0xcb9f('0x30')](_0xcb9f('0x87'),_0x3a0182[_0xcb9f('0x43')]['id']));return{'transcribeStatus':_0xcb9f('0x88')};}})['then'](function(_0x19f2fa){if(_0x19f2fa){_0x19f2fa['tempSentiment']=_0x3a0182[_0xcb9f('0x48')][_0xcb9f('0x77')];return _0x1ad876[_0xcb9f('0x89')](_0x19f2fa);}})[_0xcb9f('0x24')](respondWithResult(_0x25c76c,null))[_0xcb9f('0x41')](handleError(_0x25c76c,null));};function writeFile(_0x2cc000,_0x444ac5){return new Promise(function(_0x519e62,_0x5e12e4){fs[_0xcb9f('0x8a')](_0x444ac5,_0x2cc000,function(_0x2c0c95,_0xe2f5d9){if(_0x2c0c95){return _0x5e12e4(_0x2c0c95);}else{return _0x519e62(_0xe2f5d9);}});});}exports[_0xcb9f('0x8b')]=function(_0x5659f4,_0x496a98,_0x508cf6){return db[_0xcb9f('0x2a')][_0xcb9f('0x71')]({'where':{'id':_0x5659f4[_0xcb9f('0x43')]['id']}})[_0xcb9f('0x24')](handleEntityNotFound(_0x496a98))[_0xcb9f('0x24')](function(_0x2d2b16){if(_0x2d2b16&&_0x2d2b16[_0xcb9f('0x8c')]){var _0x3185f0=_0x2d2b16[_0xcb9f('0x8c')];var _0x27c946=config['root']+_0xcb9f('0x8d')+_0x2d2b16['id']+_0xcb9f('0x8e');if(fs['existsSync'](_0x27c946)){return _0x27c946;}return writeFile(_0x3185f0,_0x27c946)[_0xcb9f('0x24')](function(){return _0x27c946;});}else{throw new db[(_0xcb9f('0x52'))][(_0xcb9f('0x53'))]('Transcript\x20not\x20available');}})[_0xcb9f('0x24')](function(_0x536083){return _0x496a98['download'](_0x536083);})['catch'](handleError(_0x496a98));}; \ No newline at end of file +var _0xac48=['message','downloads','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','findOne','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac48,0xd3));var _0x8ac4=function(_0x31a2ad,_0x32520f){_0x31a2ad=_0x31a2ad-0x0;var _0x12f749=_0xac48[_0x31a2ad];return _0x12f749;};'use strict';var emlformat=require(_0x8ac4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ac4('0x1'));var jsonpatch=require(_0x8ac4('0x2'));var rp=require(_0x8ac4('0x3'));var moment=require(_0x8ac4('0x4'));var BPromise=require(_0x8ac4('0x5'));var Mustache=require(_0x8ac4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8ac4('0x7'));var csv=require(_0x8ac4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ac4('0x9'));var squel=require(_0x8ac4('0xa'));var crypto=require(_0x8ac4('0xb'));var jsforce=require(_0x8ac4('0xc'));var deskjs=require(_0x8ac4('0xd'));var toCsv=require(_0x8ac4('0x8'));var querystring=require(_0x8ac4('0xe'));var Papa=require(_0x8ac4('0xf'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x8ac4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8ac4('0x11'));var as=require(_0x8ac4('0x12'));var hardwareService=require(_0x8ac4('0x13'));var logger=require(_0x8ac4('0x14'))('api');var utils=require(_0x8ac4('0x15'));var config=require(_0x8ac4('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18fee6,_0x2b979c){_0x2b979c=_0x2b979c||0xcc;return function(_0x4585d5){if(_0x4585d5){return _0x18fee6[_0x8ac4('0x17')](_0x2b979c);}return _0x18fee6[_0x8ac4('0x18')](_0x2b979c)[_0x8ac4('0x19')]();};}function respondWithResult(_0x5214d0,_0x30e8dd){_0x30e8dd=_0x30e8dd||0xc8;return function(_0x42b32e){if(_0x42b32e){return _0x5214d0['status'](_0x30e8dd)[_0x8ac4('0x1a')](_0x42b32e);}};}function respondWithFilteredResult(_0x468783,_0x5afd7f){return function(_0x42d04c){if(_0x42d04c){var _0x508af4=typeof _0x5afd7f[_0x8ac4('0x1b')]===_0x8ac4('0x1c')&&typeof _0x5afd7f['limit']==='undefined';var _0x5ad555=_0x42d04c[_0x8ac4('0x1d')];var _0x45068f=_0x508af4?0x0:_0x5afd7f[_0x8ac4('0x1b')];var _0x1f4431=_0x508af4?_0x42d04c['count']:_0x5afd7f[_0x8ac4('0x1b')]+_0x5afd7f[_0x8ac4('0x1e')];var _0x298a78;if(_0x1f4431>=_0x5ad555){_0x1f4431=_0x5ad555;_0x298a78=0xc8;}else{_0x298a78=0xce;}_0x468783[_0x8ac4('0x18')](_0x298a78);return _0x468783[_0x8ac4('0x1f')](_0x8ac4('0x20'),_0x45068f+'-'+_0x1f4431+'/'+_0x5ad555)[_0x8ac4('0x1a')](_0x42d04c);}return null;};}function patchUpdates(_0x254212){return function(_0x135591){try{jsonpatch[_0x8ac4('0x21')](_0x135591,_0x254212,!![]);}catch(_0xacc4e4){return BPromise[_0x8ac4('0x22')](_0xacc4e4);}return _0x135591[_0x8ac4('0x23')]();};}function saveUpdates(_0x46b302,_0x13931d){return function(_0x3cc541){if(_0x3cc541){return _0x3cc541[_0x8ac4('0x24')](_0x46b302)[_0x8ac4('0x25')](function(_0x351d07){return _0x351d07;});}return null;};}function removeEntity(_0x408ebc,_0x38073a){return function(_0x1aa20a){if(_0x1aa20a){return _0x1aa20a[_0x8ac4('0x26')]()[_0x8ac4('0x25')](function(){_0x408ebc[_0x8ac4('0x18')](0xcc)[_0x8ac4('0x19')]();});}};}function handleEntityNotFound(_0x3bcc42,_0x348cac){return function(_0x51972c){if(!_0x51972c){_0x3bcc42[_0x8ac4('0x17')](0x194);}return _0x51972c;};}function handleError(_0x438ba1,_0x12807e){_0x12807e=_0x12807e||0x1f4;return function(_0x562c61){logger[_0x8ac4('0x27')](_0x562c61[_0x8ac4('0x28')]);if(_0x562c61[_0x8ac4('0x29')]){delete _0x562c61['name'];}_0x438ba1['status'](_0x12807e)[_0x8ac4('0x2a')](_0x562c61);};}exports[_0x8ac4('0x2b')]=function(_0x4232cc,_0x190c4a){var _0x544382={},_0x10cb6c={},_0x973567={'count':0x0,'rows':[]};var _0xf598f3=_[_0x8ac4('0x2c')](db[_0x8ac4('0x2d')]['rawAttributes'],function(_0x5143ee){return{'name':_0x5143ee[_0x8ac4('0x2e')],'type':_0x5143ee[_0x8ac4('0x2f')][_0x8ac4('0x30')]};});_0x10cb6c[_0x8ac4('0x31')]=_[_0x8ac4('0x32')](_['map'](_0xf598f3,_0x8ac4('0x29')),[_0x8ac4('0x33')]);_0x10cb6c['query']=_[_0x8ac4('0x34')](_0x4232cc[_0x8ac4('0x35')]);_0x10cb6c['filters']=_['intersection'](_0x10cb6c[_0x8ac4('0x31')],_0x10cb6c['query']);_0x544382[_0x8ac4('0x36')]=_[_0x8ac4('0x37')](_0x10cb6c['model'],qs[_0x8ac4('0x38')](_0x4232cc[_0x8ac4('0x35')][_0x8ac4('0x38')]));_0x544382[_0x8ac4('0x36')]=_0x544382[_0x8ac4('0x36')][_0x8ac4('0x39')]?_0x544382[_0x8ac4('0x36')]:_0x10cb6c[_0x8ac4('0x31')];if(!_0x4232cc[_0x8ac4('0x35')][_0x8ac4('0x3a')](_0x8ac4('0x3b'))){_0x544382[_0x8ac4('0x1e')]=qs[_0x8ac4('0x1e')](_0x4232cc['query'][_0x8ac4('0x1e')]);_0x544382['offset']=qs[_0x8ac4('0x1b')](_0x4232cc[_0x8ac4('0x35')][_0x8ac4('0x1b')]);}_0x544382[_0x8ac4('0x3c')]=qs[_0x8ac4('0x3d')](_0x4232cc['query'][_0x8ac4('0x3d')]);_0x544382[_0x8ac4('0x3e')]=qs['filters'](_[_0x8ac4('0x3f')](_0x4232cc[_0x8ac4('0x35')],_0x10cb6c['filters']),_0xf598f3);if(_0x4232cc[_0x8ac4('0x35')][_0x8ac4('0x40')]){_0x544382['where']=_[_0x8ac4('0x41')](_0x544382[_0x8ac4('0x3e')],{'$or':_[_0x8ac4('0x2c')](_0xf598f3,function(_0x469c50){if(_0x469c50['type']!==_0x8ac4('0x42')){var _0x3773af={};_0x3773af[_0x469c50['name']]={'$like':'%'+_0x4232cc[_0x8ac4('0x35')]['filter']+'%'};return _0x3773af;}})});}_0x544382=_[_0x8ac4('0x41')]({},_0x544382,_0x4232cc[_0x8ac4('0x43')]);var _0x5c688e={'where':_0x544382[_0x8ac4('0x3e')]};return db[_0x8ac4('0x2d')][_0x8ac4('0x1d')](_0x5c688e)[_0x8ac4('0x25')](function(_0x4959c7){_0x973567['count']=_0x4959c7;if(_0x4232cc['query'][_0x8ac4('0x44')]){_0x544382[_0x8ac4('0x45')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x544382);})[_0x8ac4('0x25')](function(_0x4ce009){_0x973567[_0x8ac4('0x46')]=_0x4ce009;return _0x973567;})[_0x8ac4('0x25')](respondWithFilteredResult(_0x190c4a,_0x544382))[_0x8ac4('0x47')](handleError(_0x190c4a,null));};exports['show']=function(_0xb48ad7,_0x1a6907){var _0x3dcdf6={'raw':![],'where':{'id':_0xb48ad7[_0x8ac4('0x48')]['id']}},_0x27b20b={};_0x27b20b[_0x8ac4('0x31')]=_[_0x8ac4('0x34')](db['VoiceRecording']['rawAttributes']);_0x27b20b[_0x8ac4('0x35')]=_['keys'](_0xb48ad7[_0x8ac4('0x35')]);_0x27b20b['filters']=_['intersection'](_0x27b20b[_0x8ac4('0x31')],_0x27b20b['query']);_0x3dcdf6[_0x8ac4('0x36')]=_[_0x8ac4('0x37')](_0x27b20b[_0x8ac4('0x31')],qs['fields'](_0xb48ad7[_0x8ac4('0x35')]['fields']));_0x3dcdf6[_0x8ac4('0x36')]=_0x3dcdf6['attributes'][_0x8ac4('0x39')]?_0x3dcdf6[_0x8ac4('0x36')]:_0x27b20b[_0x8ac4('0x31')];if(_0xb48ad7['query'][_0x8ac4('0x44')]){_0x3dcdf6['include']=[{'all':!![]}];}_0x3dcdf6=_[_0x8ac4('0x41')]({},_0x3dcdf6,_0xb48ad7[_0x8ac4('0x43')]);return db[_0x8ac4('0x2d')][_0x8ac4('0x49')](_0x3dcdf6)[_0x8ac4('0x25')](handleEntityNotFound(_0x1a6907,null))[_0x8ac4('0x25')](respondWithResult(_0x1a6907,null))['catch'](handleError(_0x1a6907,null));};exports[_0x8ac4('0x4a')]=function(_0x34b047,_0x1edb7e){return db[_0x8ac4('0x2d')][_0x8ac4('0x4a')](_0x34b047[_0x8ac4('0x4b')],{})['then'](respondWithResult(_0x1edb7e,0xc9))[_0x8ac4('0x47')](handleError(_0x1edb7e,null));};exports[_0x8ac4('0x24')]=function(_0x88df6f,_0x22015b){if(_0x88df6f[_0x8ac4('0x4b')]['id']){delete _0x88df6f[_0x8ac4('0x4b')]['id'];}return db[_0x8ac4('0x2d')][_0x8ac4('0x49')]({'where':{'id':_0x88df6f[_0x8ac4('0x48')]['id']}})[_0x8ac4('0x25')](handleEntityNotFound(_0x22015b,null))[_0x8ac4('0x25')](saveUpdates(_0x88df6f['body'],null))['then'](respondWithResult(_0x22015b,null))[_0x8ac4('0x47')](handleError(_0x22015b,null));};exports[_0x8ac4('0x4c')]=function(_0x3fe82b,_0x248949){return db['VoiceRecording'][_0x8ac4('0x4c')]()[_0x8ac4('0x25')](respondWithResult(_0x248949,null))[_0x8ac4('0x47')](handleError(_0x248949,null));};exports[_0x8ac4('0x4d')]=function(_0x1ecbd3,_0x1ad774,_0x51ea7e){var _0x329288=require('../../components/encryptor');var _0x5274eb=![];var _0x524d28={};if(_0x1ecbd3[_0x8ac4('0x35')]['type']&&_0x1ecbd3[_0x8ac4('0x35')][_0x8ac4('0x2f')]===_0x8ac4('0x4e')){_0x524d28[_0x8ac4('0x4e')]=_0x1ecbd3[_0x8ac4('0x48')]['id'];}else{_0x524d28['id']=_0x1ecbd3['params']['id'];}return db['VoiceRecording'][_0x8ac4('0x49')]({'where':_0x524d28,'attributes':['id',_0x8ac4('0x4f')],'raw':!![]})[_0x8ac4('0x25')](handleEntityNotFound(_0x1ad774,null))['then'](function(_0x3a9623){if(_0x3a9623){var _0x78146e=_0x3a9623[_0x8ac4('0x4f')];var _0x1e5317=util[_0x8ac4('0x33')](_0x8ac4('0x50'),_0x78146e);if(fs[_0x8ac4('0x51')](_0x1e5317)){_0x5274eb=!![];return _0x329288[_0x8ac4('0x52')](_0x1e5317,_0x78146e,config[_0x8ac4('0x53')][_0x8ac4('0x54')])['then'](function(){return _0x3a9623;});}return _0x3a9623;}})[_0x8ac4('0x25')](function(_0x111a07){if(_0x111a07){var _0x5088d3=_0x111a07[_0x8ac4('0x4f')];if(!fs[_0x8ac4('0x51')](_0x5088d3)){throw new db[(_0x8ac4('0x55'))][(_0x8ac4('0x56'))](_0x8ac4('0x57'));}if(_0x111a07[_0x8ac4('0x58')]){return _0x1ad774[_0x8ac4('0x4d')](_0x5088d3,_0x111a07[_0x8ac4('0x58')]+path[_0x8ac4('0x59')](_0x5088d3),function(){if(_0x5274eb){fs[_0x8ac4('0x5a')](_0x5088d3);}});}else{return _0x1ad774[_0x8ac4('0x4d')](_0x5088d3,function(_0x36d397){if(_0x5274eb){fs[_0x8ac4('0x5a')](_0x5088d3);}});}}})['catch'](function(_0x56bcd8){if(_0x56bcd8[_0x8ac4('0x5b')]===_0x8ac4('0x57')){_0x1ad774[_0x8ac4('0x18')](0x194)[_0x8ac4('0x2a')]('Not\x20found');}else{return handleError(_0x1ad774,null);}});};exports[_0x8ac4('0x5c')]=function(_0x1f1964,_0x31c006,_0x220287){var _0xd35e4b=require('../../components/encryptor');var _0x1d62d6=![];var _0x16b8cd={'$and':[db['sequelize'][_0x8ac4('0x3e')](db[_0x8ac4('0x5d')]['fn'](_0x8ac4('0x5e'),db['sequelize'][_0x8ac4('0x5f')](_0x8ac4('0x4e'))),_0x1f1964[_0x8ac4('0x35')][_0x8ac4('0x60')])]};if(_0x1f1964[_0x8ac4('0x35')][_0x8ac4('0x2f')]&&_0x1f1964[_0x8ac4('0x35')][_0x8ac4('0x2f')]===_0x8ac4('0x4e')){_0x16b8cd[_0x8ac4('0x61')][_0x8ac4('0x62')]({'uniqueid':_0x1f1964[_0x8ac4('0x48')]['id']});}else{_0x16b8cd[_0x8ac4('0x61')][_0x8ac4('0x62')]({'id':_0x1f1964[_0x8ac4('0x48')]['id']});}return db[_0x8ac4('0x2d')][_0x8ac4('0x49')]({'where':_0x16b8cd,'attributes':['id','value'],'raw':!![]})[_0x8ac4('0x25')](handleEntityNotFound(_0x31c006,null))[_0x8ac4('0x25')](function(_0x4d6874){if(_0x4d6874){var _0x52c899=util['format']('%s.cypher',_0x4d6874[_0x8ac4('0x4f')]);if(fs['existsSync'](_0x52c899)){_0x1d62d6=!![];return _0xd35e4b[_0x8ac4('0x52')](_0x52c899,_0x4d6874['value'],config['secrets'][_0x8ac4('0x54')])[_0x8ac4('0x25')](function(){return _0x4d6874;});}return _0x4d6874;}})[_0x8ac4('0x25')](function(_0x81b1fc){if(_0x81b1fc){if(!fs[_0x8ac4('0x51')](_0x81b1fc['value'])){throw new db[(_0x8ac4('0x55'))][(_0x8ac4('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x81b1fc['filename']){return _0x31c006[_0x8ac4('0x4d')](_0x81b1fc[_0x8ac4('0x4f')],_0x81b1fc['filename']+path[_0x8ac4('0x59')](_0x81b1fc[_0x8ac4('0x4f')]),function(){if(_0x1d62d6){fs[_0x8ac4('0x5a')](_0x81b1fc[_0x8ac4('0x4f')]);}});}else{return _0x31c006[_0x8ac4('0x4d')](_0x81b1fc['value'],function(_0x2276c7){if(_0x1d62d6){fs[_0x8ac4('0x5a')](_0x81b1fc[_0x8ac4('0x4f')]);}});}}})[_0x8ac4('0x47')](handleError(_0x31c006,null));};exports[_0x8ac4('0x26')]=function(_0x38dea4,_0xb0231a){return db['VoiceRecording'][_0x8ac4('0x49')]({'where':{'id':_0x38dea4[_0x8ac4('0x48')]['id']}})[_0x8ac4('0x25')](function(_0x466c69){if(_[_0x8ac4('0x63')](_0x466c69)){throw new ReferenceError(_0x8ac4('0x64'));}return _0x466c69;})[_0x8ac4('0x25')](function(_0x69c07b){var _0x2a9822=_0x69c07b[_0x8ac4('0x4f')];logger[_0x8ac4('0x65')](_0x8ac4('0x66'),_0x2a9822);if(!_['isNil'](_0x69c07b[_0x8ac4('0x4f')])&&fs[_0x8ac4('0x51')](_0x2a9822)){logger[_0x8ac4('0x65')](_0x8ac4('0x67')+_0x2a9822+_0x8ac4('0x68'));fs['unlinkSync'](_0x2a9822);}_0x2a9822=_0x2a9822+'.cypher';if(!_[_0x8ac4('0x63')](_0x69c07b[_0x8ac4('0x4f')])&&fs['existsSync'](_0x2a9822)){logger[_0x8ac4('0x65')]('File:\x20\x22'+_0x2a9822+_0x8ac4('0x68'));fs['unlinkSync'](_0x2a9822);}return _0x69c07b;})[_0x8ac4('0x25')](function(_0x3476f8){if(!_0x3476f8)throw new InternalError();return _0x3476f8[_0x8ac4('0x26')]();})[_0x8ac4('0x25')](function(){_0xb0231a['status'](0xcc)['end']();})[_0x8ac4('0x47')](handleError(_0xb0231a,null));};function getBucketslist(_0x405328,_0x2b471a,_0x206c4a){return new Promise(function(_0x4e50b0,_0x430906){var _0x1c92ff=new AWS['S3']({'accessKeyId':_0x2b471a,'secretAccessKey':_0x405328,'region':_0x206c4a});_0x1c92ff[_0x8ac4('0x69')]({},function(_0xbf0de0,_0x426c04){if(_0xbf0de0){return _0x430906(_0xbf0de0);}else{return _0x4e50b0(_0x426c04);}});});}function createBucket(_0x3e1c19,_0x3a7061,_0x1241da,_0x10b0fe){return new Promise(function(_0x17e328,_0x339578){var _0x4e929b=new AWS['S3']({'accessKeyId':_0x3a7061,'secretAccessKey':_0x3e1c19,'region':_0x1241da});_0x4e929b[_0x8ac4('0x6a')]({'Bucket':_0x10b0fe},function(_0x3e967a,_0x525250){if(_0x3e967a){return _0x339578(_0x3e967a);}else{return _0x17e328(_0x525250);}});});}function uploadFile(_0x21f550,_0x510277,_0x43a31f,_0x3bed20,_0x1f679f,_0x466eac){return new Promise(function(_0x50b125,_0x5deec6){var _0x4acef1=new AWS['S3']({'accessKeyId':_0x510277,'secretAccessKey':_0x21f550,'region':_0x43a31f});_0x4acef1[_0x8ac4('0x6b')]({'Bucket':_0x3bed20,'Key':_0x1f679f,'Body':_0x466eac},function(_0x160b00,_0x2bbb3e){if(_0x160b00){return _0x5deec6(_0x160b00);}else{return _0x50b125(_0x2bbb3e);}});});}function startTranscribe(_0x1e73b2,_0x3aa801,_0x4fc54e,_0x224633,_0x5afd68,_0x160f81){return new Promise(function(_0x44209b,_0x241c05){var _0x1cd5e6=new AWS[(_0x8ac4('0x6c'))]({'accessKeyId':_0x3aa801,'secretAccessKey':_0x1e73b2,'region':_0x4fc54e});_0x1cd5e6[_0x8ac4('0x6d')]({'TranscriptionJobName':_0x224633,'LanguageCode':_0x5afd68,'Media':{'MediaFileUri':_0x160f81}},function(_0x47a517,_0x159363){if(_0x47a517){return _0x241c05(_0x47a517);}else{return _0x44209b(_0x159363);}});});}function transcribe(_0x23be0d,_0x505c6a,_0x5045e9,_0xf44959,_0x4e3e8c,_0x2bd85d,_0x4a75da){return new Promise(function(_0x18fda1,_0x2dbec2){var _0x4b2aeb={};logger['info'](util[_0x8ac4('0x33')](_0x8ac4('0x6e'),_0x23be0d,_0x4e3e8c));return uploadFile(_0x505c6a,_0x5045e9,_0xf44959,_0x4e3e8c,path[_0x8ac4('0x6f')](_0x2bd85d),fs[_0x8ac4('0x70')](_0x2bd85d))[_0x8ac4('0x25')](function(_0x5aeff1){logger[_0x8ac4('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x23be0d,_0x4e3e8c,_0x5aeff1[_0x8ac4('0x71')]));_0x4b2aeb[_0x8ac4('0x72')]=_0x5aeff1[_0x8ac4('0x73')];_0x4b2aeb['location']=_0x5aeff1['Location'];logger['info'](util[_0x8ac4('0x33')](_0x8ac4('0x74'),_0x23be0d));return startTranscribe(_0x505c6a,_0x5045e9,_0xf44959,uuidv4(),_0x4a75da,_0x5aeff1[_0x8ac4('0x71')]);})[_0x8ac4('0x25')](function(_0xcab2f5){logger[_0x8ac4('0x65')](util[_0x8ac4('0x33')](_0x8ac4('0x75'),_0x23be0d,_0xcab2f5[_0x8ac4('0x76')][_0x8ac4('0x77')]));_0x4b2aeb['transcribeName']=_0xcab2f5['TranscriptionJob']['TranscriptionJobName'];_0x4b2aeb['transcribeStatus']=_0xcab2f5[_0x8ac4('0x76')][_0x8ac4('0x78')];return _0x18fda1(_0x4b2aeb);})[_0x8ac4('0x47')](function(_0x35f85d){return _0x2dbec2(_0x35f85d);});});}exports[_0x8ac4('0x79')]=function(_0x5e0a4f,_0x308452,_0x55347e){var _0x5ac717;var _0x12ce0d;var _0x5c318d;var _0x1872de=require(_0x8ac4('0x7a'));return db[_0x8ac4('0x2d')]['findOne']({'where':{'id':_0x5e0a4f['params']['id']}})[_0x8ac4('0x25')](function(_0x38a55d){if(_0x38a55d){var _0x4bf8c7=util['format'](_0x8ac4('0x50'),_0x38a55d[_0x8ac4('0x4f')]);if(fs[_0x8ac4('0x51')](_0x4bf8c7)){cypher=!![];return _0x1872de['decryptFile'](_0x4bf8c7,_0x38a55d[_0x8ac4('0x4f')],config['secrets'][_0x8ac4('0x54')])[_0x8ac4('0x25')](function(){return _0x38a55d;});}return _0x38a55d;}})[_0x8ac4('0x25')](function(_0x6bbcfd){if(!_0x6bbcfd){throw new db[(_0x8ac4('0x55'))][(_0x8ac4('0x56'))](_0x8ac4('0x7b'));}_0x12ce0d=_0x6bbcfd;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x308452,null))[_0x8ac4('0x25')](function(_0x20b028){if(_0x20b028){_0x5ac717=_0x20b028;if(!_0x5ac717[_0x8ac4('0x7c')]||!_0x5ac717[_0x8ac4('0x7d')]||!_0x5ac717['transcribeRegion']||!_0x5ac717[_0x8ac4('0x7e')]||!_0x5ac717['bucket']){throw new db[(_0x8ac4('0x55'))][(_0x8ac4('0x56'))](_0x8ac4('0x7f'));}if(_0x5e0a4f['body'][_0x8ac4('0x80')]&&(!_0x5ac717[_0x8ac4('0x81')]||!_0x5ac717[_0x8ac4('0x82')]||!_0x5ac717['sentimentRegion']||!_0x5ac717[_0x8ac4('0x7e')]||!_0x5ac717[_0x8ac4('0x72')])){throw new db['Sequelize']['ValidationError'](_0x8ac4('0x83'));}return db['CloudProvider'][_0x8ac4('0x84')]({'where':{'id':_0x5ac717[_0x8ac4('0x7d')]}});}})[_0x8ac4('0x25')](function(_0x488828){if(!_0x488828){throw new db[(_0x8ac4('0x55'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x488828[_0x8ac4('0x85')]||!_0x488828[_0x8ac4('0x86')]){throw new db['Sequelize'][(_0x8ac4('0x56'))](_0x8ac4('0x87'));}_0x5c318d=_0x488828;return getBucketslist(_0x5c318d[_0x8ac4('0x85')],_0x5c318d[_0x8ac4('0x86')],_0x5ac717[_0x8ac4('0x88')]);})['then'](function(_0x1e33ce){if(_0x1e33ce&&_0x1e33ce[_0x8ac4('0x89')]){var _0x29760c=_[_0x8ac4('0x49')](_0x1e33ce[_0x8ac4('0x89')],function(_0x26887f){return _0x26887f[_0x8ac4('0x8a')]===_0x5ac717['bucket'];});if(!_0x29760c){logger[_0x8ac4('0x65')](util[_0x8ac4('0x33')](_0x8ac4('0x8b'),_0x5e0a4f[_0x8ac4('0x48')]['id'],_0x5ac717['bucket']));return createBucket(_0x5c318d['data1'],_0x5c318d[_0x8ac4('0x86')],_0x5ac717[_0x8ac4('0x88')],_0x5ac717[_0x8ac4('0x72')]);}logger['info'](util[_0x8ac4('0x33')](_0x8ac4('0x8c'),_0x5e0a4f[_0x8ac4('0x48')]['id'],_0x5ac717[_0x8ac4('0x72')]));return;}})[_0x8ac4('0x25')](function(_0x53b975){if(_0x12ce0d[_0x8ac4('0x8d')]===_0x8ac4('0x8e')){return transcribe(_0x5e0a4f[_0x8ac4('0x48')]['id'],_0x5c318d['data1'],_0x5c318d[_0x8ac4('0x86')],_0x5ac717[_0x8ac4('0x88')],_0x5ac717['bucket'],_0x12ce0d[_0x8ac4('0x4f')],_0x5ac717[_0x8ac4('0x7e')]);}else{logger['info'](util[_0x8ac4('0x33')](_0x8ac4('0x8f'),_0x5e0a4f['params']['id']));return{'transcribeStatus':_0x8ac4('0x90')};}})[_0x8ac4('0x25')](function(_0x4fd60a){if(_0x4fd60a){_0x4fd60a[_0x8ac4('0x91')]=_0x5e0a4f[_0x8ac4('0x4b')][_0x8ac4('0x80')];return _0x12ce0d['updateAttributes'](_0x4fd60a);}})[_0x8ac4('0x25')](respondWithResult(_0x308452,null))[_0x8ac4('0x47')](handleError(_0x308452,null));};function writeFile(_0x5aacf7,_0x3fcc69){return new Promise(function(_0x5d0d3f,_0x411124){fs[_0x8ac4('0x92')](_0x3fcc69,_0x5aacf7,function(_0x57eca2,_0x43023b){if(_0x57eca2){return _0x411124(_0x57eca2);}else{return _0x5d0d3f(_0x43023b);}});});}exports[_0x8ac4('0x93')]=function(_0x59a7f3,_0x19afd9,_0x13281e){return db[_0x8ac4('0x2d')][_0x8ac4('0x84')]({'where':{'id':_0x59a7f3['params']['id']}})[_0x8ac4('0x25')](handleEntityNotFound(_0x19afd9))['then'](function(_0x594da0){if(_0x594da0&&_0x594da0[_0x8ac4('0x94')]){var _0x4b8d74=_0x594da0[_0x8ac4('0x94')];var _0x4f2c5e=config[_0x8ac4('0x95')]+'/server/files/transcribes/transcribe_'+_0x594da0['id']+_0x8ac4('0x96');if(fs['existsSync'](_0x4f2c5e)){return _0x4f2c5e;}return writeFile(_0x4b8d74,_0x4f2c5e)[_0x8ac4('0x25')](function(){return _0x4f2c5e;});}else{throw new db['Sequelize'][(_0x8ac4('0x56'))]('Transcript\x20not\x20available');}})[_0x8ac4('0x25')](function(_0x212c18){return _0x19afd9[_0x8ac4('0x4d')](_0x212c18);})[_0x8ac4('0x47')](handleError(_0x19afd9));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c71a8bc..b5f812e 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 _0x0269=['define','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x32efcb,_0x55523f){var _0x1dae88=function(_0x11c606){while(--_0x11c606){_0x32efcb['push'](_0x32efcb['shift']());}};_0x1dae88(++_0x55523f);}(_0x0269,0x135));var _0x9026=function(_0xdf1c60,_0x3b6d78){_0xdf1c60=_0xdf1c60-0x0;var _0x5da15c=_0x0269[_0xdf1c60];return _0x5da15c;};'use strict';var attributes=require(_0x9026('0x0'));module['exports']=function(_0x1c4837,_0x5c3ab8){return _0x1c4837[_0x9026('0x1')]('VoiceRecording',attributes,{'tableName':_0x9026('0x2'),'paranoid':![],'indexes':[{'name':_0x9026('0x3'),'fields':[_0x9026('0x3')]},{'name':_0x9026('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3379=['transcribeStatus','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x3379,0x115));var _0x9337=function(_0x414da6,_0x19c7ca){_0x414da6=_0x414da6-0x0;var _0x47f446=_0x3379[_0x414da6];return _0x47f446;};'use strict';var attributes=require(_0x9337('0x0'));module[_0x9337('0x1')]=function(_0x43fb11,_0x3338dd){return _0x43fb11['define'](_0x9337('0x2'),attributes,{'tableName':_0x9337('0x3'),'paranoid':![],'indexes':[{'name':_0x9337('0x4'),'fields':[_0x9337('0x4')]},{'name':'transcribeStatus','fields':[_0x9337('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7594916..c6c7610 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 _0x430c=['../../components/encryptor','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','recording','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','body','options','raw','where','limit','UpdateVoiceRecording','catch','CreateVoiceRecording'];(function(_0x171244,_0x4e239a){var _0x189fc2=function(_0x1f5e87){while(--_0x1f5e87){_0x171244['push'](_0x171244['shift']());}};_0x189fc2(++_0x4e239a);}(_0x430c,0x1a1));var _0xc430=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x430c[_0x4f4c2a];return _0xd15be6;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});}exports['UpdateVoiceRecording']=function(_0x5d3acc){var _0x36d112=this;return new Promise(function(_0x4c1937,_0x2bcb21){return db['VoiceRecording']['update'](_0x5d3acc[_0xc430('0x11')],{'raw':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')][_0xc430('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d3acc[_0xc430('0x12')]?_0x5d3acc[_0xc430('0x12')][_0xc430('0x14')]||null:null,'attributes':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')]['attributes']||null:null,'limit':_0x5d3acc['options']?_0x5d3acc[_0xc430('0x12')][_0xc430('0x15')]||null:null})[_0xc430('0x8')](function(_0x56dd16){logger[_0xc430('0x9')]('UpdateVoiceRecording',_0x5d3acc);logger[_0xc430('0xb')](_0xc430('0x16'),_0x5d3acc,JSON['stringify'](_0x56dd16));_0x4c1937(_0x56dd16);})[_0xc430('0x17')](function(_0x3cdbd3){logger['error'](_0xc430('0x16'),_0x3cdbd3['message'],_0x5d3acc);_0x2bcb21(_0x36d112[_0xc430('0xe')](0x1f4,_0x3cdbd3['message']));});});};exports[_0xc430('0x18')]=function(_0x21e28a){var _0x50110b=this;return new Promise(function(_0x33433f,_0x2ec021){var _0x2c0422=require(_0xc430('0x19'));var _0x285407;return db['Setting'][_0xc430('0x1a')]({'attributes':['id',_0xc430('0x1b')],'where':{'id':0x1},'raw':!![]})[_0xc430('0x8')](function(_0x1591e3){_0x285407=_0x1591e3;return db['VoiceRecording'][_0xc430('0x1c')](_0x21e28a['body']);})[_0xc430('0x8')](function(_0x4ad29e){if(_0x285407[_0xc430('0x1b')]&&fs[_0xc430('0x1d')](_0x4ad29e[_0xc430('0x1e')])){var _0x3d7ccf=util['format'](_0xc430('0x1f'),_0x4ad29e[_0xc430('0x1e')]);return _0x2c0422[_0xc430('0x20')](_0x4ad29e[_0xc430('0x1e')],_0x3d7ccf,config['secrets'][_0xc430('0x21')])[_0xc430('0x8')](function(){fs['unlink'](_0x4ad29e[_0xc430('0x1e')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x4ad29e;});}return _0x4ad29e;})[_0xc430('0x8')](function(_0x973a39){logger[_0xc430('0x9')](_0xc430('0x18'),_0x21e28a);logger[_0xc430('0xb')](_0xc430('0x18'),_0x21e28a,JSON[_0xc430('0xd')](_0x973a39));_0x33433f(_0x973a39);})[_0xc430('0x17')](function(_0x47da0d){logger[_0xc430('0xe')]('CreateVoiceRecording',_0x47da0d[_0xc430('0xf')],_0x21e28a);_0x2ec021(_0x50110b[_0xc430('0xe')](0x1f4,_0x47da0d[_0xc430('0xf')]));});});}; \ No newline at end of file +var _0x5b12=['Setting','callRecordingEncryption','create','body','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','UpdateVoiceRecording','VoiceRecording','options','raw','attributes','CreateVoiceRecording','../../components/encryptor'];(function(_0x188f29,_0x3875e6){var _0x4a5489=function(_0x66e5c4){while(--_0x66e5c4){_0x188f29['push'](_0x188f29['shift']());}};_0x4a5489(++_0x3875e6);}(_0x5b12,0xa3));var _0x25b1=function(_0x1efdec,_0x172902){_0x1efdec=_0x1efdec-0x0;var _0x3dd959=_0x5b12[_0x1efdec];return _0x3dd959;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});}exports[_0x25b1('0x14')]=function(_0x27ccc9){var _0x1f78c2=this;return new Promise(function(_0x2a7d14,_0x17024a){return db[_0x25b1('0x15')]['update'](_0x27ccc9['body'],{'raw':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27ccc9['options']?_0x27ccc9[_0x25b1('0x16')]['where']||null:null,'attributes':_0x27ccc9[_0x25b1('0x16')]?_0x27ccc9['options'][_0x25b1('0x18')]||null:null,'limit':_0x27ccc9['options']?_0x27ccc9['options']['limit']||null:null})[_0x25b1('0x9')](function(_0x150436){logger['info'](_0x25b1('0x14'),_0x27ccc9);logger[_0x25b1('0xc')](_0x25b1('0x14'),_0x27ccc9,JSON[_0x25b1('0xe')](_0x150436));_0x2a7d14(_0x150436);})[_0x25b1('0x13')](function(_0x5e6b6b){logger[_0x25b1('0xf')](_0x25b1('0x14'),_0x5e6b6b[_0x25b1('0x12')],_0x27ccc9);_0x17024a(_0x1f78c2[_0x25b1('0xf')](0x1f4,_0x5e6b6b[_0x25b1('0x12')]));});});};exports[_0x25b1('0x19')]=function(_0x5d9ed7){var _0x3c05c6=this;return new Promise(function(_0x27dd68,_0x3d279f){var _0x5bc8fc=require(_0x25b1('0x1a'));var _0x9e175f;return db[_0x25b1('0x1b')]['findOne']({'attributes':['id',_0x25b1('0x1c')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x19ecd1){_0x9e175f=_0x19ecd1;return db[_0x25b1('0x15')][_0x25b1('0x1d')](_0x5d9ed7[_0x25b1('0x1e')]);})[_0x25b1('0x9')](function(_0x300a14){if(_0x9e175f[_0x25b1('0x1c')]&&fs['existsSync'](_0x300a14[_0x25b1('0x1f')])){var _0xca56f0=util[_0x25b1('0x20')](_0x25b1('0x21'),_0x300a14[_0x25b1('0x1f')]);return _0x5bc8fc['encryptFile'](_0x300a14[_0x25b1('0x1f')],_0xca56f0,config[_0x25b1('0x22')][_0x25b1('0x23')])[_0x25b1('0x9')](function(){fs[_0x25b1('0x24')](_0x300a14['value']);logger['info'](_0x25b1('0x25'));return _0x300a14;});}return _0x300a14;})['then'](function(_0x446984){logger[_0x25b1('0xa')](_0x25b1('0x19'),_0x5d9ed7);logger['debug']('CreateVoiceRecording',_0x5d9ed7,JSON[_0x25b1('0xe')](_0x446984));_0x27dd68(_0x446984);})[_0x25b1('0x13')](function(_0x26d3bc){logger['error'](_0x25b1('0x19'),_0x26d3bc[_0x25b1('0x12')],_0x5d9ed7);_0x3d279f(_0x3c05c6[_0x25b1('0xf')](0x1f4,_0x26d3bc[_0x25b1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index f82c2b2..6f0c357 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 _0x05a0=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x05a0,0x125));var _0x005a=function(_0x5b1ae5,_0x2bd80f){_0x5b1ae5=_0x5b1ae5-0x0;var _0x199f52=_0x05a0[_0x5b1ae5];return _0x199f52;};'use strict';var multer=require(_0x005a('0x0'));var util=require(_0x005a('0x1'));var path=require(_0x005a('0x2'));var timeout=require(_0x005a('0x3'));var express=require(_0x005a('0x4'));var router=express['Router']();var fs_extra=require(_0x005a('0x5'));var auth=require(_0x005a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x005a('0x7'));var controller=require(_0x005a('0x8'));router[_0x005a('0x9')]('/',auth['isAuthenticated'](),controller[_0x005a('0xa')]);router[_0x005a('0x9')](_0x005a('0xb'),auth[_0x005a('0xc')](),controller[_0x005a('0xd')]);router[_0x005a('0x9')](_0x005a('0xe'),auth[_0x005a('0xc')](),controller[_0x005a('0xf')]);router[_0x005a('0x10')]('/',auth[_0x005a('0xc')](),controller[_0x005a('0x11')]);router['put'](_0x005a('0xe'),auth['isAuthenticated'](),controller[_0x005a('0x12')]);router[_0x005a('0x13')]('/:id',auth[_0x005a('0xc')](),controller[_0x005a('0x14')]);module[_0x005a('0x15')]=router; \ No newline at end of file +var _0x1231=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','index','get','/describe','isAuthenticated','describe','post','create','put','update','delete','/:id','exports','multer','util','path','express','Router'];(function(_0x575d37,_0x48033b){var _0x8046bd=function(_0x6039a8){while(--_0x6039a8){_0x575d37['push'](_0x575d37['shift']());}};_0x8046bd(++_0x48033b);}(_0x1231,0xc1));var _0x1123=function(_0x5d20d7,_0x3e0eba){_0x5d20d7=_0x5d20d7-0x0;var _0x4c280a=_0x1231[_0x5d20d7];return _0x4c280a;};'use strict';var multer=require(_0x1123('0x0'));var util=require(_0x1123('0x1'));var path=require(_0x1123('0x2'));var timeout=require('connect-timeout');var express=require(_0x1123('0x3'));var router=express[_0x1123('0x4')]();var fs_extra=require(_0x1123('0x5'));var auth=require(_0x1123('0x6'));var interaction=require(_0x1123('0x7'));var config=require(_0x1123('0x8'));var controller=require(_0x1123('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1123('0xa')]);router[_0x1123('0xb')](_0x1123('0xc'),auth[_0x1123('0xd')](),controller[_0x1123('0xe')]);router[_0x1123('0xb')]('/:id',auth[_0x1123('0xd')](),controller['show']);router[_0x1123('0xf')]('/',auth[_0x1123('0xd')](),controller[_0x1123('0x10')]);router[_0x1123('0x11')]('/:id',auth[_0x1123('0xd')](),controller[_0x1123('0x12')]);router[_0x1123('0x13')](_0x1123('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0x1123('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index fc7e30e..420e799 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 _0x6a9b=['sequelize','moment','exports','attended','STRING','ENUM','Yes'];(function(_0x5e9c00,_0x8ef29f){var _0x42cb5c=function(_0x570aa2){while(--_0x570aa2){_0x5e9c00['push'](_0x5e9c00['shift']());}};_0x42cb5c(++_0x8ef29f);}(_0x6a9b,0x1ab));var _0xb6a9=function(_0x2970fc,_0x3dcdb1){_0x2970fc=_0x2970fc-0x0;var _0x1ed337=_0x6a9b[_0x2970fc];return _0x1ed337;};'use strict';var Sequelize=require(_0xb6a9('0x0'));var moment=require(_0xb6a9('0x1'));module[_0xb6a9('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0xb6a9('0x3'))},'result':{'type':Sequelize[_0xb6a9('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb6a9('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb6a9('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb6a9('0x4')]},'transferercontext':{'type':Sequelize[_0xb6a9('0x4')]},'transfererexten':{'type':Sequelize[_0xb6a9('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xb6a9('0x4')]},'transfereechannel':{'type':Sequelize[_0xb6a9('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xb6a9('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb6a9('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb6a9('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xb6a9('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xb6a9('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xb6a9('0x4')]},'isexternal':{'type':Sequelize[_0xb6a9('0x5')](_0xb6a9('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb6a9('0x4')]}}; \ No newline at end of file +var _0xd5f9=['attended','STRING','Yes','moment','ENUM','blind'];(function(_0x3bda0a,_0x5b404e){var _0x5b7f12=function(_0x4aa0a6){while(--_0x4aa0a6){_0x3bda0a['push'](_0x3bda0a['shift']());}};_0x5b7f12(++_0x5b404e);}(_0xd5f9,0x13b));var _0x9d5f=function(_0x3328b4,_0x403a24){_0x3328b4=_0x3328b4-0x0;var _0x530143=_0xd5f9[_0x3328b4];return _0x530143;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9d5f('0x0'));module['exports']={'type':{'type':Sequelize[_0x9d5f('0x1')](_0x9d5f('0x2'),_0x9d5f('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x9d5f('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9d5f('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x9d5f('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x9d5f('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x9d5f('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x9d5f('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x9d5f('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9d5f('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9d5f('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9d5f('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x9d5f('0x4')]},'transfereecontext':{'type':Sequelize[_0x9d5f('0x4')]},'transfereeexten':{'type':Sequelize[_0x9d5f('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x9d5f('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x9d5f('0x5'),'No')},'context':{'type':Sequelize[_0x9d5f('0x4')]},'extension':{'type':Sequelize[_0x9d5f('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3496826..03f2a5f 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 _0xe56e=['VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xe56e,0x1ed));var _0xee56=function(_0xa1947d,_0xeb1015){_0xa1947d=_0xa1947d-0x0;var _0xccc41a=_0xe56e[_0xa1947d];return _0xccc41a;};'use strict';var emlformat=require(_0xee56('0x0'));var rimraf=require(_0xee56('0x1'));var zipdir=require(_0xee56('0x2'));var jsonpatch=require(_0xee56('0x3'));var rp=require(_0xee56('0x4'));var moment=require(_0xee56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xee56('0x6'));var util=require(_0xee56('0x7'));var path=require('path');var sox=require(_0xee56('0x8'));var csv=require(_0xee56('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee56('0xa'));var _=require(_0xee56('0xb'));var squel=require(_0xee56('0xc'));var crypto=require(_0xee56('0xd'));var jsforce=require(_0xee56('0xe'));var deskjs=require(_0xee56('0xf'));var toCsv=require(_0xee56('0x9'));var querystring=require(_0xee56('0x10'));var Papa=require(_0xee56('0x11'));var Redis=require('ioredis');var authService=require(_0xee56('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xee56('0x13'));var hardwareService=require(_0xee56('0x14'));var logger=require(_0xee56('0x15'))(_0xee56('0x16'));var utils=require(_0xee56('0x17'));var config=require(_0xee56('0x18'));var licenseUtil=require(_0xee56('0x19'));var db=require(_0xee56('0x1a'))['db'];function respondWithStatusCode(_0x2a8c37,_0x4b35f9){_0x4b35f9=_0x4b35f9||0xcc;return function(_0x2a1f18){if(_0x2a1f18){return _0x2a8c37[_0xee56('0x1b')](_0x4b35f9);}return _0x2a8c37[_0xee56('0x1c')](_0x4b35f9)[_0xee56('0x1d')]();};}function respondWithResult(_0x4dd78b,_0x533dd2){_0x533dd2=_0x533dd2||0xc8;return function(_0x457d76){if(_0x457d76){return _0x4dd78b[_0xee56('0x1c')](_0x533dd2)['json'](_0x457d76);}};}function respondWithFilteredResult(_0x136bd1,_0x3dffe6){return function(_0x5ddbeb){if(_0x5ddbeb){var _0x4b1eaf=typeof _0x3dffe6[_0xee56('0x1e')]==='undefined'&&typeof _0x3dffe6[_0xee56('0x1f')]===_0xee56('0x20');var _0xba0fbf=_0x5ddbeb['count'];var _0xc7f95d=_0x4b1eaf?0x0:_0x3dffe6[_0xee56('0x1e')];var _0x418f15=_0x4b1eaf?_0x5ddbeb[_0xee56('0x21')]:_0x3dffe6['offset']+_0x3dffe6[_0xee56('0x1f')];var _0x34bba2;if(_0x418f15>=_0xba0fbf){_0x418f15=_0xba0fbf;_0x34bba2=0xc8;}else{_0x34bba2=0xce;}_0x136bd1[_0xee56('0x1c')](_0x34bba2);return _0x136bd1[_0xee56('0x22')](_0xee56('0x23'),_0xc7f95d+'-'+_0x418f15+'/'+_0xba0fbf)[_0xee56('0x24')](_0x5ddbeb);}return null;};}function patchUpdates(_0x129099){return function(_0x8c8af7){try{jsonpatch['apply'](_0x8c8af7,_0x129099,!![]);}catch(_0x2175bf){return BPromise[_0xee56('0x25')](_0x2175bf);}return _0x8c8af7[_0xee56('0x26')]();};}function saveUpdates(_0x3ff639,_0x9be83c){return function(_0x244f7d){if(_0x244f7d){return _0x244f7d[_0xee56('0x27')](_0x3ff639)[_0xee56('0x28')](function(_0x5d43af){return _0x5d43af;});}return null;};}function removeEntity(_0x40b374,_0x27117c){return function(_0x42aee6){if(_0x42aee6){return _0x42aee6[_0xee56('0x29')]()[_0xee56('0x28')](function(){_0x40b374[_0xee56('0x1c')](0xcc)[_0xee56('0x1d')]();});}};}function handleEntityNotFound(_0x3a3f89,_0x1fc0d5){return function(_0x154500){if(!_0x154500){_0x3a3f89[_0xee56('0x1b')](0x194);}return _0x154500;};}function handleError(_0x3db745,_0x44766a){_0x44766a=_0x44766a||0x1f4;return function(_0x42f8cd){logger[_0xee56('0x2a')](_0x42f8cd[_0xee56('0x2b')]);if(_0x42f8cd['name']){delete _0x42f8cd[_0xee56('0x2c')];}_0x3db745[_0xee56('0x1c')](_0x44766a)[_0xee56('0x2d')](_0x42f8cd);};}exports[_0xee56('0x2e')]=function(_0x17dd79,_0x8db937){var _0xaaef74={},_0x1d820f={},_0x3eb457={'count':0x0,'rows':[]};var _0x14f370=_[_0xee56('0x2f')](db[_0xee56('0x30')][_0xee56('0x31')],function(_0x3d0491){return{'name':_0x3d0491[_0xee56('0x32')],'type':_0x3d0491[_0xee56('0x33')][_0xee56('0x34')]};});_0x1d820f[_0xee56('0x35')]=_[_0xee56('0x2f')](_0x14f370,_0xee56('0x2c'));_0x1d820f[_0xee56('0x36')]=_[_0xee56('0x37')](_0x17dd79[_0xee56('0x36')]);_0x1d820f[_0xee56('0x38')]=_['intersection'](_0x1d820f['model'],_0x1d820f[_0xee56('0x36')]);_0xaaef74['attributes']=_[_0xee56('0x39')](_0x1d820f[_0xee56('0x35')],qs[_0xee56('0x3a')](_0x17dd79[_0xee56('0x36')][_0xee56('0x3a')]));_0xaaef74[_0xee56('0x3b')]=_0xaaef74['attributes']['length']?_0xaaef74[_0xee56('0x3b')]:_0x1d820f[_0xee56('0x35')];if(!_0x17dd79['query'][_0xee56('0x3c')](_0xee56('0x3d'))){_0xaaef74[_0xee56('0x1f')]=qs['limit'](_0x17dd79[_0xee56('0x36')][_0xee56('0x1f')]);_0xaaef74[_0xee56('0x1e')]=qs[_0xee56('0x1e')](_0x17dd79[_0xee56('0x36')][_0xee56('0x1e')]);}_0xaaef74['order']=qs['sort'](_0x17dd79[_0xee56('0x36')][_0xee56('0x3e')]);_0xaaef74[_0xee56('0x3f')]=qs[_0xee56('0x38')](_[_0xee56('0x40')](_0x17dd79[_0xee56('0x36')],_0x1d820f[_0xee56('0x38')]),_0x14f370);if(_0x17dd79[_0xee56('0x36')][_0xee56('0x41')]){_0xaaef74['where']=_[_0xee56('0x42')](_0xaaef74[_0xee56('0x3f')],{'$or':_[_0xee56('0x2f')](_0x14f370,function(_0xa54507){if(_0xa54507[_0xee56('0x33')]!==_0xee56('0x43')){var _0x3d1499={};_0x3d1499[_0xa54507['name']]={'$like':'%'+_0x17dd79['query']['filter']+'%'};return _0x3d1499;}})});}_0xaaef74=_['merge']({},_0xaaef74,_0x17dd79[_0xee56('0x44')]);var _0x139394={'where':_0xaaef74['where']};return db[_0xee56('0x30')][_0xee56('0x21')](_0x139394)[_0xee56('0x28')](function(_0x8d6345){_0x3eb457['count']=_0x8d6345;if(_0x17dd79[_0xee56('0x36')][_0xee56('0x45')]){_0xaaef74['include']=[{'all':!![]}];}return db[_0xee56('0x30')][_0xee56('0x46')](_0xaaef74);})[_0xee56('0x28')](function(_0x57fec2){_0x3eb457[_0xee56('0x47')]=_0x57fec2;return _0x3eb457;})['then'](respondWithFilteredResult(_0x8db937,_0xaaef74))[_0xee56('0x48')](handleError(_0x8db937,null));};exports[_0xee56('0x49')]=function(_0x9d8173,_0x437c2e){var _0x56792d={'raw':!![],'where':{'id':_0x9d8173['params']['id']}},_0x538962={};_0x538962[_0xee56('0x35')]=_[_0xee56('0x37')](db[_0xee56('0x30')][_0xee56('0x31')]);_0x538962[_0xee56('0x36')]=_[_0xee56('0x37')](_0x9d8173[_0xee56('0x36')]);_0x538962[_0xee56('0x38')]=_[_0xee56('0x39')](_0x538962[_0xee56('0x35')],_0x538962[_0xee56('0x36')]);_0x56792d[_0xee56('0x3b')]=_[_0xee56('0x39')](_0x538962[_0xee56('0x35')],qs[_0xee56('0x3a')](_0x9d8173['query'][_0xee56('0x3a')]));_0x56792d['attributes']=_0x56792d[_0xee56('0x3b')]['length']?_0x56792d[_0xee56('0x3b')]:_0x538962['model'];if(_0x9d8173[_0xee56('0x36')][_0xee56('0x45')]){_0x56792d[_0xee56('0x4a')]=[{'all':!![]}];}_0x56792d=_['merge']({},_0x56792d,_0x9d8173[_0xee56('0x44')]);return db['VoiceTransferReport'][_0xee56('0x4b')](_0x56792d)[_0xee56('0x28')](handleEntityNotFound(_0x437c2e,null))[_0xee56('0x28')](respondWithResult(_0x437c2e,null))['catch'](handleError(_0x437c2e,null));};exports[_0xee56('0x4c')]=function(_0x22302a,_0x3606be){return db['VoiceTransferReport'][_0xee56('0x4c')](_0x22302a[_0xee56('0x4d')],{})['then'](respondWithResult(_0x3606be,0xc9))[_0xee56('0x48')](handleError(_0x3606be,null));};exports[_0xee56('0x27')]=function(_0x32dcac,_0x5510e4){if(_0x32dcac['body']['id']){delete _0x32dcac[_0xee56('0x4d')]['id'];}return db[_0xee56('0x30')][_0xee56('0x4b')]({'where':{'id':_0x32dcac[_0xee56('0x4e')]['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x5510e4,null))[_0xee56('0x28')](saveUpdates(_0x32dcac['body'],null))[_0xee56('0x28')](respondWithResult(_0x5510e4,null))['catch'](handleError(_0x5510e4,null));};exports[_0xee56('0x29')]=function(_0x2e4710,_0x36d87a){return db[_0xee56('0x30')][_0xee56('0x4b')]({'where':{'id':_0x2e4710['params']['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x36d87a,null))[_0xee56('0x28')](removeEntity(_0x36d87a,null))['catch'](handleError(_0x36d87a,null));};exports[_0xee56('0x4f')]=function(_0x453dcf,_0x21ea52){return db[_0xee56('0x30')][_0xee56('0x4f')]()['then'](respondWithResult(_0x21ea52,null))[_0xee56('0x48')](handleError(_0x21ea52,null));}; \ No newline at end of file +var _0xd25c=['merge','filter','options','includeAll','include','VoiceTransferReport','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','then','end','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick'];(function(_0x369e31,_0x5f1558){var _0x33b750=function(_0x264483){while(--_0x264483){_0x369e31['push'](_0x369e31['shift']());}};_0x33b750(++_0x5f1558);}(_0xd25c,0x1db));var _0xcd25=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd25c[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require(_0xcd25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd25('0x1'));var jsonpatch=require(_0xcd25('0x2'));var rp=require(_0xcd25('0x3'));var moment=require(_0xcd25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd25('0x5'));var util=require(_0xcd25('0x6'));var path=require(_0xcd25('0x7'));var sox=require(_0xcd25('0x8'));var csv=require(_0xcd25('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd25('0xa'));var _=require(_0xcd25('0xb'));var squel=require(_0xcd25('0xc'));var crypto=require(_0xcd25('0xd'));var jsforce=require(_0xcd25('0xe'));var deskjs=require(_0xcd25('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcd25('0x10'));var Papa=require(_0xcd25('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd25('0x12'));var as=require(_0xcd25('0x13'));var hardwareService=require(_0xcd25('0x14'));var logger=require(_0xcd25('0x15'))(_0xcd25('0x16'));var utils=require(_0xcd25('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd25('0x18'));var db=require(_0xcd25('0x19'))['db'];function respondWithStatusCode(_0x593d74,_0x27f536){_0x27f536=_0x27f536||0xcc;return function(_0x4cea2c){if(_0x4cea2c){return _0x593d74[_0xcd25('0x1a')](_0x27f536);}return _0x593d74[_0xcd25('0x1b')](_0x27f536)['end']();};}function respondWithResult(_0x16236d,_0x427aae){_0x427aae=_0x427aae||0xc8;return function(_0xcd8900){if(_0xcd8900){return _0x16236d[_0xcd25('0x1b')](_0x427aae)['json'](_0xcd8900);}};}function respondWithFilteredResult(_0x5f22e0,_0x192f83){return function(_0x562e91){if(_0x562e91){var _0x1fec83=typeof _0x192f83[_0xcd25('0x1c')]===_0xcd25('0x1d')&&typeof _0x192f83[_0xcd25('0x1e')]===_0xcd25('0x1d');var _0x3646a4=_0x562e91['count'];var _0x4f635e=_0x1fec83?0x0:_0x192f83['offset'];var _0x2e6cf2=_0x1fec83?_0x562e91[_0xcd25('0x1f')]:_0x192f83[_0xcd25('0x1c')]+_0x192f83['limit'];var _0x35eb03;if(_0x2e6cf2>=_0x3646a4){_0x2e6cf2=_0x3646a4;_0x35eb03=0xc8;}else{_0x35eb03=0xce;}_0x5f22e0[_0xcd25('0x1b')](_0x35eb03);return _0x5f22e0['set'](_0xcd25('0x20'),_0x4f635e+'-'+_0x2e6cf2+'/'+_0x3646a4)[_0xcd25('0x21')](_0x562e91);}return null;};}function patchUpdates(_0x1a19b1){return function(_0x3b56b4){try{jsonpatch[_0xcd25('0x22')](_0x3b56b4,_0x1a19b1,!![]);}catch(_0x34bbff){return BPromise['reject'](_0x34bbff);}return _0x3b56b4[_0xcd25('0x23')]();};}function saveUpdates(_0x572e6b,_0x5049cb){return function(_0x4ba13f){if(_0x4ba13f){return _0x4ba13f['update'](_0x572e6b)['then'](function(_0x24cbb1){return _0x24cbb1;});}return null;};}function removeEntity(_0x5725a5,_0x25e734){return function(_0x404587){if(_0x404587){return _0x404587['destroy']()[_0xcd25('0x24')](function(){_0x5725a5[_0xcd25('0x1b')](0xcc)[_0xcd25('0x25')]();});}};}function handleEntityNotFound(_0x46a683,_0x577797){return function(_0x29f5c2){if(!_0x29f5c2){_0x46a683[_0xcd25('0x1a')](0x194);}return _0x29f5c2;};}function handleError(_0x53f79a,_0x532ddb){_0x532ddb=_0x532ddb||0x1f4;return function(_0x191b56){logger[_0xcd25('0x26')](_0x191b56[_0xcd25('0x27')]);if(_0x191b56[_0xcd25('0x28')]){delete _0x191b56[_0xcd25('0x28')];}_0x53f79a[_0xcd25('0x1b')](_0x532ddb)[_0xcd25('0x29')](_0x191b56);};}exports[_0xcd25('0x2a')]=function(_0x3101c1,_0x9a66bd){var _0x5bb2ba={},_0xc9a8b5={},_0x511b58={'count':0x0,'rows':[]};var _0x2b626c=_[_0xcd25('0x2b')](db['VoiceTransferReport']['rawAttributes'],function(_0xf59ea1){return{'name':_0xf59ea1[_0xcd25('0x2c')],'type':_0xf59ea1[_0xcd25('0x2d')]['key']};});_0xc9a8b5[_0xcd25('0x2e')]=_[_0xcd25('0x2b')](_0x2b626c,_0xcd25('0x28'));_0xc9a8b5[_0xcd25('0x2f')]=_[_0xcd25('0x30')](_0x3101c1[_0xcd25('0x2f')]);_0xc9a8b5[_0xcd25('0x31')]=_[_0xcd25('0x32')](_0xc9a8b5['model'],_0xc9a8b5['query']);_0x5bb2ba[_0xcd25('0x33')]=_['intersection'](_0xc9a8b5[_0xcd25('0x2e')],qs[_0xcd25('0x34')](_0x3101c1[_0xcd25('0x2f')][_0xcd25('0x34')]));_0x5bb2ba[_0xcd25('0x33')]=_0x5bb2ba[_0xcd25('0x33')]['length']?_0x5bb2ba[_0xcd25('0x33')]:_0xc9a8b5[_0xcd25('0x2e')];if(!_0x3101c1['query']['hasOwnProperty']('nolimit')){_0x5bb2ba['limit']=qs[_0xcd25('0x1e')](_0x3101c1[_0xcd25('0x2f')][_0xcd25('0x1e')]);_0x5bb2ba['offset']=qs[_0xcd25('0x1c')](_0x3101c1[_0xcd25('0x2f')][_0xcd25('0x1c')]);}_0x5bb2ba[_0xcd25('0x35')]=qs[_0xcd25('0x36')](_0x3101c1[_0xcd25('0x2f')][_0xcd25('0x36')]);_0x5bb2ba[_0xcd25('0x37')]=qs[_0xcd25('0x31')](_[_0xcd25('0x38')](_0x3101c1[_0xcd25('0x2f')],_0xc9a8b5[_0xcd25('0x31')]),_0x2b626c);if(_0x3101c1[_0xcd25('0x2f')]['filter']){_0x5bb2ba[_0xcd25('0x37')]=_[_0xcd25('0x39')](_0x5bb2ba[_0xcd25('0x37')],{'$or':_['map'](_0x2b626c,function(_0xef9c15){if(_0xef9c15[_0xcd25('0x2d')]!=='VIRTUAL'){var _0x2233e7={};_0x2233e7[_0xef9c15[_0xcd25('0x28')]]={'$like':'%'+_0x3101c1['query'][_0xcd25('0x3a')]+'%'};return _0x2233e7;}})});}_0x5bb2ba=_['merge']({},_0x5bb2ba,_0x3101c1[_0xcd25('0x3b')]);var _0x470e14={'where':_0x5bb2ba[_0xcd25('0x37')]};return db['VoiceTransferReport']['count'](_0x470e14)[_0xcd25('0x24')](function(_0x3644a7){_0x511b58[_0xcd25('0x1f')]=_0x3644a7;if(_0x3101c1[_0xcd25('0x2f')][_0xcd25('0x3c')]){_0x5bb2ba[_0xcd25('0x3d')]=[{'all':!![]}];}return db[_0xcd25('0x3e')][_0xcd25('0x3f')](_0x5bb2ba);})[_0xcd25('0x24')](function(_0x39efe9){_0x511b58[_0xcd25('0x40')]=_0x39efe9;return _0x511b58;})[_0xcd25('0x24')](respondWithFilteredResult(_0x9a66bd,_0x5bb2ba))[_0xcd25('0x41')](handleError(_0x9a66bd,null));};exports[_0xcd25('0x42')]=function(_0x2dd3e9,_0x2d18bb){var _0x1ace0e={'raw':!![],'where':{'id':_0x2dd3e9[_0xcd25('0x43')]['id']}},_0x478806={};_0x478806['model']=_[_0xcd25('0x30')](db[_0xcd25('0x3e')][_0xcd25('0x44')]);_0x478806['query']=_[_0xcd25('0x30')](_0x2dd3e9['query']);_0x478806['filters']=_[_0xcd25('0x32')](_0x478806[_0xcd25('0x2e')],_0x478806[_0xcd25('0x2f')]);_0x1ace0e['attributes']=_[_0xcd25('0x32')](_0x478806[_0xcd25('0x2e')],qs['fields'](_0x2dd3e9[_0xcd25('0x2f')][_0xcd25('0x34')]));_0x1ace0e[_0xcd25('0x33')]=_0x1ace0e[_0xcd25('0x33')][_0xcd25('0x45')]?_0x1ace0e[_0xcd25('0x33')]:_0x478806[_0xcd25('0x2e')];if(_0x2dd3e9[_0xcd25('0x2f')][_0xcd25('0x3c')]){_0x1ace0e[_0xcd25('0x3d')]=[{'all':!![]}];}_0x1ace0e=_['merge']({},_0x1ace0e,_0x2dd3e9['options']);return db['VoiceTransferReport'][_0xcd25('0x46')](_0x1ace0e)[_0xcd25('0x24')](handleEntityNotFound(_0x2d18bb,null))[_0xcd25('0x24')](respondWithResult(_0x2d18bb,null))[_0xcd25('0x41')](handleError(_0x2d18bb,null));};exports[_0xcd25('0x47')]=function(_0x90a0,_0x105835){return db[_0xcd25('0x3e')]['create'](_0x90a0[_0xcd25('0x48')],{})[_0xcd25('0x24')](respondWithResult(_0x105835,0xc9))[_0xcd25('0x41')](handleError(_0x105835,null));};exports[_0xcd25('0x49')]=function(_0x520ca3,_0x143658){if(_0x520ca3[_0xcd25('0x48')]['id']){delete _0x520ca3[_0xcd25('0x48')]['id'];}return db[_0xcd25('0x3e')][_0xcd25('0x46')]({'where':{'id':_0x520ca3[_0xcd25('0x43')]['id']}})[_0xcd25('0x24')](handleEntityNotFound(_0x143658,null))[_0xcd25('0x24')](saveUpdates(_0x520ca3[_0xcd25('0x48')],null))[_0xcd25('0x24')](respondWithResult(_0x143658,null))[_0xcd25('0x41')](handleError(_0x143658,null));};exports[_0xcd25('0x4a')]=function(_0x2c165a,_0x3608af){return db[_0xcd25('0x3e')]['find']({'where':{'id':_0x2c165a[_0xcd25('0x43')]['id']}})['then'](handleEntityNotFound(_0x3608af,null))['then'](removeEntity(_0x3608af,null))[_0xcd25('0x41')](handleError(_0x3608af,null));};exports[_0xcd25('0x4b')]=function(_0x1636cf,_0x5927f1){return db[_0xcd25('0x3e')][_0xcd25('0x4b')]()[_0xcd25('0x24')](respondWithResult(_0x5927f1,null))[_0xcd25('0x41')](handleError(_0x5927f1,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 93d7fa1..26cfd41 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 _0xcee7=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c578a,_0x906599){var _0x5954ae=function(_0x4a95a3){while(--_0x4a95a3){_0x3c578a['push'](_0x3c578a['shift']());}};_0x5954ae(++_0x906599);}(_0xcee7,0x14b));var _0x7cee=function(_0x3ee2c7,_0x23d9e7){_0x3ee2c7=_0x3ee2c7-0x0;var _0x161e78=_0xcee7[_0x3ee2c7];return _0x161e78;};'use strict';var _=require(_0x7cee('0x0'));var util=require('util');var logger=require(_0x7cee('0x1'))(_0x7cee('0x2'));var moment=require(_0x7cee('0x3'));var BPromise=require(_0x7cee('0x4'));var rp=require(_0x7cee('0x5'));var fs=require('fs');var path=require(_0x7cee('0x6'));var rimraf=require(_0x7cee('0x7'));var config=require(_0x7cee('0x8'));var attributes=require(_0x7cee('0x9'));module[_0x7cee('0xa')]=function(_0xe03b92,_0x4ee46c){return _0xe03b92[_0x7cee('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x7cee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6643=['report_call_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x3de3de,_0x26e5ea){var _0x4a30b4=function(_0x390976){while(--_0x390976){_0x3de3de['push'](_0x3de3de['shift']());}};_0x4a30b4(++_0x26e5ea);}(_0x6643,0x1c8));var _0x3664=function(_0xc5e99d,_0x3880d8){_0xc5e99d=_0xc5e99d-0x0;var _0x26fbbe=_0x6643[_0xc5e99d];return _0x26fbbe;};'use strict';var _=require(_0x3664('0x0'));var util=require(_0x3664('0x1'));var logger=require(_0x3664('0x2'))(_0x3664('0x3'));var moment=require('moment');var BPromise=require(_0x3664('0x4'));var rp=require(_0x3664('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3664('0x6'));var config=require(_0x3664('0x7'));var attributes=require(_0x3664('0x8'));module[_0x3664('0x9')]=function(_0x23e9f0,_0x20f7af){return _0x23e9f0[_0x3664('0xa')](_0x3664('0xb'),attributes,{'tableName':_0x3664('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 a8726ca..121218c 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 _0x308a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','moment','bluebird','randomstring'];(function(_0x3af61c,_0x51db90){var _0x339d71=function(_0x3b9da3){while(--_0x3b9da3){_0x3af61c['push'](_0x3af61c['shift']());}};_0x339d71(++_0x51db90);}(_0x308a,0xf4));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa308('0x0'));var moment=require(_0xa308('0x1'));var BPromise=require(_0xa308('0x2'));var rs=require(_0xa308('0x3'));var fs=require('fs');var Redis=require(_0xa308('0x4'));var db=require(_0xa308('0x5'))['db'];var utils=require(_0xa308('0x6'));var logger=require(_0xa308('0x7'))(_0xa308('0x8'));var config=require(_0xa308('0x9'));var jayson=require(_0xa308('0xa'));var client=jayson[_0xa308('0xb')][_0xa308('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24faa9,_0x11b9ba,_0x379116){return new BPromise(function(_0x42d3b4,_0x3c3351){return client[_0xa308('0xd')](_0x24faa9,_0x379116)[_0xa308('0xe')](function(_0x95d10e){logger[_0xa308('0xf')](_0xa308('0x10'),_0x11b9ba,_0xa308('0x11'));logger[_0xa308('0x12')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x11b9ba,_0xa308('0x11'),JSON[_0xa308('0x13')](_0x95d10e));if(_0x95d10e['error']){if(_0x95d10e[_0xa308('0x14')][_0xa308('0x15')]===0x1f4){logger['error'](_0xa308('0x10'),_0x11b9ba,_0x95d10e[_0xa308('0x14')][_0xa308('0x16')]);return _0x3c3351(_0x95d10e[_0xa308('0x14')][_0xa308('0x16')]);}logger[_0xa308('0x14')](_0xa308('0x10'),_0x11b9ba,_0x95d10e[_0xa308('0x14')][_0xa308('0x16')]);return _0x42d3b4(_0x95d10e[_0xa308('0x14')][_0xa308('0x16')]);}else{logger[_0xa308('0xf')](_0xa308('0x10'),_0x11b9ba,_0xa308('0x11'));_0x42d3b4(_0x95d10e[_0xa308('0x17')][_0xa308('0x16')]);}})[_0xa308('0x18')](function(_0x12a47b){logger['error'](_0xa308('0x10'),_0x11b9ba,_0x12a47b);_0x3c3351(_0x12a47b);});});}exports[_0xa308('0x19')]=function(_0x566d63){var _0x53196f=this;return new Promise(function(_0x23880c,_0x148c70){return db[_0xa308('0x1a')][_0xa308('0x1b')](_0x566d63[_0xa308('0x1c')],{'raw':_0x566d63[_0xa308('0x1d')]?_0x566d63['options'][_0xa308('0x1e')]===undefined?!![]:![]:!![]})[_0xa308('0xe')](function(_0x58f78f){logger[_0xa308('0xf')](_0xa308('0x19'),_0x566d63);logger[_0xa308('0x12')](_0xa308('0x19'),_0x566d63,JSON[_0xa308('0x13')](_0x58f78f));_0x23880c(_0x58f78f);})[_0xa308('0x18')](function(_0x57e3e3){logger['error'](_0xa308('0x19'),_0x57e3e3['message'],_0x566d63);_0x148c70(_0x53196f['error'](0x1f4,_0x57e3e3[_0xa308('0x16')]));});});}; \ No newline at end of file +var _0xfc9c=['client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','CreateVoiceTransferReport','create','body','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x629e00,_0x55df2f){var _0x27e096=function(_0x1d75ff){while(--_0x1d75ff){_0x629e00['push'](_0x629e00['shift']());}};_0x27e096(++_0x55df2f);}(_0xfc9c,0x18d));var _0xcfc9=function(_0x41703c,_0x380af7){_0x41703c=_0x41703c-0x0;var _0x5988f9=_0xfc9c[_0x41703c];return _0x5988f9;};'use strict';var _=require('lodash');var util=require(_0xcfc9('0x0'));var moment=require(_0xcfc9('0x1'));var BPromise=require(_0xcfc9('0x2'));var rs=require(_0xcfc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfc9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfc9('0x5'))(_0xcfc9('0x6'));var config=require(_0xcfc9('0x7'));var jayson=require(_0xcfc9('0x8'));var client=jayson[_0xcfc9('0x9')][_0xcfc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b1501,_0x21d94b,_0x335981){return new BPromise(function(_0x434aed,_0xac9b35){return client[_0xcfc9('0xb')](_0x3b1501,_0x335981)[_0xcfc9('0xc')](function(_0x2d797c){logger['info'](_0xcfc9('0xd'),_0x21d94b,_0xcfc9('0xe'));logger[_0xcfc9('0xf')](_0xcfc9('0x10'),_0x21d94b,_0xcfc9('0xe'),JSON[_0xcfc9('0x11')](_0x2d797c));if(_0x2d797c['error']){if(_0x2d797c['error'][_0xcfc9('0x12')]===0x1f4){logger[_0xcfc9('0x13')](_0xcfc9('0xd'),_0x21d94b,_0x2d797c[_0xcfc9('0x13')]['message']);return _0xac9b35(_0x2d797c[_0xcfc9('0x13')][_0xcfc9('0x14')]);}logger[_0xcfc9('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x21d94b,_0x2d797c[_0xcfc9('0x13')][_0xcfc9('0x14')]);return _0x434aed(_0x2d797c[_0xcfc9('0x13')]['message']);}else{logger[_0xcfc9('0x15')](_0xcfc9('0xd'),_0x21d94b,_0xcfc9('0xe'));_0x434aed(_0x2d797c[_0xcfc9('0x16')][_0xcfc9('0x14')]);}})[_0xcfc9('0x17')](function(_0x555627){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x21d94b,_0x555627);_0xac9b35(_0x555627);});});}exports[_0xcfc9('0x18')]=function(_0x143776){var _0x52e8ed=this;return new Promise(function(_0x44acea,_0x56c2e4){return db['VoiceTransferReport'][_0xcfc9('0x19')](_0x143776[_0xcfc9('0x1a')],{'raw':_0x143776['options']?_0x143776[_0xcfc9('0x1b')][_0xcfc9('0x1c')]===undefined?!![]:![]:!![]})[_0xcfc9('0xc')](function(_0x1794fe){logger[_0xcfc9('0x15')](_0xcfc9('0x18'),_0x143776);logger[_0xcfc9('0xf')](_0xcfc9('0x18'),_0x143776,JSON[_0xcfc9('0x11')](_0x1794fe));_0x44acea(_0x1794fe);})['catch'](function(_0x56055f){logger[_0xcfc9('0x13')]('CreateVoiceTransferReport',_0x56055f[_0xcfc9('0x14')],_0x143776);_0x56c2e4(_0x52e8ed['error'](0x1f4,_0x56055f[_0xcfc9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index dd2a85c..864a81f 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 _0x0bb5=['unhold','/calls','calls','/transfer','exports','express','Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/answer','/hold','hold','/unhold'];(function(_0x302a7e,_0x447eeb){var _0x58fc22=function(_0x44c1c6){while(--_0x44c1c6){_0x302a7e['push'](_0x302a7e['shift']());}};_0x58fc22(++_0x447eeb);}(_0x0bb5,0x148));var _0x50bb=function(_0x13ada9,_0x132e03){_0x13ada9=_0x13ada9-0x0;var _0x5cc9f6=_0x0bb5[_0x13ada9];return _0x5cc9f6;};'use strict';var express=require(_0x50bb('0x0'));var router=express[_0x50bb('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0x50bb('0x2')](_0x50bb('0x3'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0x6')]);router[_0x50bb('0x2')](_0x50bb('0x7'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller['hangup']);router[_0x50bb('0x2')](_0x50bb('0x8'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['answer']);router['post'](_0x50bb('0x9'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xa')]);router['post'](_0x50bb('0xb'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller[_0x50bb('0xc')]);router[_0x50bb('0x2')](_0x50bb('0xd'),auth[_0x50bb('0x4')](),auth['isWebrtcLicence'](),controller[_0x50bb('0xe')]);router['post'](_0x50bb('0xf'),auth[_0x50bb('0x4')](),auth[_0x50bb('0x5')](),controller['transfer']);module[_0x50bb('0x10')]=router; \ No newline at end of file +var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x13d5e1,_0x2413ef){var _0x29a530=function(_0x3e8679){while(--_0x3e8679){_0x13d5e1['push'](_0x13d5e1['shift']());}};_0x29a530(++_0x2413ef);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0xb4e6[_0x2440fe];return _0x5cf734;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 679b179..f1b45a8 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 _0xd3d1=['send','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','sessionId','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','handleError:','stack','name','status'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xd3d1,0x172));var _0x1d3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3d1[_0x20a584];return _0x4b41a8;};'use strict';var path=require(_0x1d3d('0x0'));var fs=require('fs');var _=require(_0x1d3d('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1d3d('0x2'));var BPromise=require(_0x1d3d('0x3'));var jayson=require(_0x1d3d('0x4'));var amiClient=jayson[_0x1d3d('0x5')][_0x1d3d('0x6')]({'port':0x232a});var logger=require(_0x1d3d('0x7'))(_0x1d3d('0x8'));var Redis=require(_0x1d3d('0x9'));config[_0x1d3d('0xa')]=_[_0x1d3d('0xb')](config[_0x1d3d('0xa')],{'host':_0x1d3d('0xc'),'port':0x18eb});var io=require(_0x1d3d('0xd'))(new Redis(config[_0x1d3d('0xa')]));var Schema=require(_0x1d3d('0xe'));var originateValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'callNumber':{'type':'string','required':[!![],_0x1d3d('0x11')]},'callerId':{'type':_0x1d3d('0x12')},'callbackUrl':{'type':_0x1d3d('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':'string','required':[!![],_0x1d3d('0x13')]},'transferNumber':{'type':_0x1d3d('0x12'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1d3d('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1d3d('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1d3d('0xf'),'required':[!![],_0x1d3d('0x10')]}});function emit(_0x24bb8c,_0x21c2e4,_0x1bdbdc){logger[_0x1d3d('0x14')](_0x24bb8c,_0x21c2e4,JSON['stringify'](_0x1bdbdc));io['to'](_0x24bb8c)['emit'](_0x21c2e4,_0x1bdbdc);}function handleError(_0x316ab4){return function(_0xe0a583){console['log'](_0x1d3d('0x15'),_0xe0a583,_0xe0a583 instanceof RangeError);logger['error'](_0xe0a583[_0x1d3d('0x16')]);if(_0xe0a583 instanceof RangeError){if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583[_0x1d3d('0x17')];}_0x316ab4[_0x1d3d('0x18')](0x194)['send'](_0xe0a583);}else{if(_0xe0a583[_0x1d3d('0x17')]){delete _0xe0a583['name'];}_0x316ab4['status'](0x1f4)[_0x1d3d('0x19')](_0xe0a583);}};}function checkError(){return function(_0x2bfac3){if(!_0x2bfac3){throw new RangeError(_0x1d3d('0x1a'));}return _0x2bfac3;};}function respondWithRpcPromise(_0x344a03,_0xa6f180){return new BPromise(function(_0xe4afa2,_0x471df5){var _0xa55c43=amiClient;return _0xa55c43[_0x1d3d('0x1b')](_0x344a03,_0xa6f180)[_0x1d3d('0x1c')](function(_0x1610a6){if(_0x1610a6['error']){if(_0x1610a6[_0x1d3d('0x1d')][_0x1d3d('0x1e')]===0x1f4){return _0x471df5(_0x1610a6['error'][_0x1d3d('0x1f')]);}return _0xe4afa2(_0x1610a6['error'][_0x1d3d('0x1f')]);}else{_0xe4afa2(_0x1610a6[_0x1d3d('0x20')]);}})[_0x1d3d('0x21')](function(_0x4235fd){_0x471df5(_0x4235fd);});});}function getAgent(_0x44e03e){return db[_0x1d3d('0x22')][_0x1d3d('0x23')]({'where':{'id':_0x44e03e,'role':_0x1d3d('0x24')}})[_0x1d3d('0x1c')](checkError());}function getAgentCheckSession(_0x2df7b7,_0x172dbd){return new BPromise(function(_0x4f0aa7,_0x3f5681){var _0x5b2986=respondWithRpcPromise(_0x1d3d('0x25'));var _0x2bcc2=getAgent(_0x2df7b7);Promise['all']([_0x5b2986,_0x2bcc2])[_0x1d3d('0x1c')](function(_0x16b7b3){var _0x3cb011=_0x16b7b3[0x0];var _0x2a3812=_0x16b7b3[0x1];var _0x4abbfc=_[_0x1d3d('0x26')](_0x3cb011[_0x1d3d('0x27')],function(_0x5d1b6c){return _0x5d1b6c[_0x1d3d('0x28')]==_0x2a3812['id']&&_0x5d1b6c['sessionId']==_0x172dbd;});if(_0x4abbfc[_0x1d3d('0x29')]==0x1){_0x4f0aa7(_0x2a3812);}else{_0x3f5681(new RangeError(_0x1d3d('0x2a')+_0x172dbd+'\x20not\x20found!'));}});});}exports[_0x1d3d('0x2b')]=function(_0x192f60,_0x102b70){logger[_0x1d3d('0x14')](_0x1d3d('0x2c'),_0x192f60[_0x1d3d('0x2d')]);var _0x4fc03a=originateValidation[_0x1d3d('0xe')](_0x192f60[_0x1d3d('0x2d')]);if(_0x4fc03a['length']>0x0){return _0x102b70[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x4fc03a);}var _0x4017b2=_0x192f60[_0x1d3d('0x2d')]['userId'];var _0x4a1e67=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x2f')];var _0x47a8e3=_0x192f60[_0x1d3d('0x2d')][_0x1d3d('0x30')];var _0x2888f9=_0x192f60[_0x1d3d('0x2d')]['callbackUrl'];return getAgent(_0x4017b2)['then'](function(_0x29fa6c){logger['info'](_0x1d3d('0x31'),_0x29fa6c[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x29fa6c[_0x1d3d('0x17')]),_0x1d3d('0x34'),{'callNumber':_0x4a1e67,'callerId':_0x47a8e3,'callbackUrl':_0x2888f9});return _0x102b70[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0x1d3d('0x21')](handleError(_0x102b70));};exports['hangup']=function(_0x58ae8e,_0x206e4c){logger['info'](_0x1d3d('0x35'),_0x58ae8e[_0x1d3d('0x2d')]);var _0x182083=hangupValidation[_0x1d3d('0xe')](_0x58ae8e['body']);if(_0x182083['length']>0x0){return _0x206e4c[_0x1d3d('0x18')](0x190)['json'](_0x182083);}var _0x290853=_0x58ae8e[_0x1d3d('0x2d')]['userId'];var _0x1ad7a6=_0x58ae8e[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x290853)[_0x1d3d('0x1c')](function(_0x40f8ca){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x40f8ca[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x40f8ca[_0x1d3d('0x17')]),_0x1d3d('0x36'),{'sessionId':_0x1ad7a6});return _0x206e4c[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x37')});})['catch'](handleError(_0x206e4c));};exports[_0x1d3d('0x38')]=function(_0x2ccba6,_0x1c0cc6){logger[_0x1d3d('0x14')]('answer\x20fired:',_0x2ccba6[_0x1d3d('0x2d')]);var _0x977ea8=answerValidation[_0x1d3d('0xe')](_0x2ccba6[_0x1d3d('0x2d')]);if(_0x977ea8[_0x1d3d('0x29')]>0x0){return _0x1c0cc6['status'](0x190)['json'](_0x977ea8);}var _0x229f48=_0x2ccba6[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x66efd=_0x2ccba6[_0x1d3d('0x2d')]['sessionId'];return getAgent(_0x229f48)[_0x1d3d('0x1c')](function(_0x557a25){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x557a25[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')]('user:%s',_0x557a25[_0x1d3d('0x17')]),_0x1d3d('0x3a'),{'sessionId':_0x66efd});return _0x1c0cc6[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x3b')});})[_0x1d3d('0x21')](handleError(_0x1c0cc6));};exports[_0x1d3d('0x3c')]=function(_0x55aa8a,_0x3c5ccf){logger['info'](_0x1d3d('0x3d'),_0x55aa8a[_0x1d3d('0x2d')]);var _0x5e8ec0=holdValidation[_0x1d3d('0xe')](_0x55aa8a['body']);if(_0x5e8ec0[_0x1d3d('0x29')]>0x0){return _0x3c5ccf['status'](0x190)[_0x1d3d('0x2e')](_0x5e8ec0);}var _0xebd1f4=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0xea9cf2=_0x55aa8a[_0x1d3d('0x2d')][_0x1d3d('0x3e')];return getAgent(_0xebd1f4)[_0x1d3d('0x1c')](function(_0x59e88a){logger['info']('entityFound:',_0x59e88a[_0x1d3d('0x17')]);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x59e88a[_0x1d3d('0x17')]),_0x1d3d('0x3f'),{'sessionId':_0xea9cf2});return _0x3c5ccf[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x3c5ccf));};exports['unhold']=function(_0x3dc5ca,_0x21620d){logger[_0x1d3d('0x14')](_0x1d3d('0x40'),_0x3dc5ca[_0x1d3d('0x2d')]);var _0x363f4c=unholdValidation[_0x1d3d('0xe')](_0x3dc5ca[_0x1d3d('0x2d')]);if(_0x363f4c[_0x1d3d('0x29')]>0x0){return _0x21620d[_0x1d3d('0x18')](0x190)[_0x1d3d('0x2e')](_0x363f4c);}var _0xb88d59=_0x3dc5ca[_0x1d3d('0x2d')][_0x1d3d('0x39')];var _0x311b05=_0x3dc5ca['body'][_0x1d3d('0x3e')];return getAgent(_0xb88d59)[_0x1d3d('0x1c')](function(_0x1bbfc8){logger[_0x1d3d('0x14')]('entityFound:',_0x1bbfc8[_0x1d3d('0x17')]);emit(util['format']('user:%s',_0x1bbfc8[_0x1d3d('0x17')]),_0x1d3d('0x41'),{'sessionId':_0x311b05});return _0x21620d['status'](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x42')});})['catch'](handleError(_0x21620d));};exports[_0x1d3d('0x43')]=function(_0x7af4dd,_0x15d9b4){logger[_0x1d3d('0x14')](_0x1d3d('0x44'),_0x15d9b4[_0x1d3d('0x2d')]);var _0x213b0b=callsValidation[_0x1d3d('0xe')](_0x7af4dd[_0x1d3d('0x2d')]);if(_0x213b0b['length']>0x0){return _0x15d9b4[_0x1d3d('0x18')](0x190)['json'](_0x213b0b);}var _0x482c31=_0x7af4dd['body']['userId'];var _0x17c3ab=respondWithRpcPromise(_0x1d3d('0x25'));var _0x32aaa2=getAgent(_0x482c31);return Promise[_0x1d3d('0x45')]([_0x17c3ab,_0x32aaa2])['then'](function(_0xecfc7e){var _0x480439=_0xecfc7e[0x0];var _0x44273d=_0xecfc7e[0x1];var _0xd3f336=_['filter'](_0x480439[_0x1d3d('0x27')],function(_0x45419e){return _0x45419e['UserId']==_0x44273d['id'];});return _0x15d9b4[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'count':_0xd3f336[_0x1d3d('0x29')],'rows':_0xd3f336});})[_0x1d3d('0x21')](handleError(_0x15d9b4));};exports[_0x1d3d('0x46')]=function(_0x16e757,_0x4e47d5){logger[_0x1d3d('0x14')](_0x1d3d('0x47'),_0x16e757[_0x1d3d('0x2d')]);var _0x1183c0=conferenceValidation[_0x1d3d('0xe')](_0x16e757['body']);if(_0x1183c0[_0x1d3d('0x29')]>0x0){return _0x4e47d5['status'](0x190)[_0x1d3d('0x2e')](_0x1183c0);}var _0x5dcad1=_0x16e757[_0x1d3d('0x2d')][_0x1d3d('0x39')];return getAgent(_0x5dcad1)[_0x1d3d('0x1c')](function(_0x1711ee){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x1711ee[_0x1d3d('0x17')]);emit(util['format'](_0x1d3d('0x33'),_0x1711ee[_0x1d3d('0x17')]),_0x1d3d('0x48'));return _0x4e47d5[_0x1d3d('0x18')](0xc8)[_0x1d3d('0x2e')]({'error':![],'message':_0x1d3d('0x49')});})['catch'](handleError(_0x4e47d5));};exports[_0x1d3d('0x4a')]=function(_0x2ca216,_0xa8891a){logger[_0x1d3d('0x14')](_0x1d3d('0x4b'),_0x2ca216['body']);var _0xe83c1d=transferValidation[_0x1d3d('0xe')](_0x2ca216[_0x1d3d('0x2d')]);if(_0xe83c1d['length']>0x0){return _0xa8891a[_0x1d3d('0x18')](0x190)['json'](_0xe83c1d);}var _0x2ee6ca=_0x2ca216['body'][_0x1d3d('0x39')];var _0x378878=_0x2ca216[_0x1d3d('0x2d')]['sessionId'];var _0x389330=_0x2ca216[_0x1d3d('0x2d')][_0x1d3d('0x4c')];return getAgent(_0x2ee6ca)['then'](function(_0x19a126){logger[_0x1d3d('0x14')](_0x1d3d('0x31'),_0x19a126['name']);emit(util[_0x1d3d('0x32')](_0x1d3d('0x33'),_0x19a126[_0x1d3d('0x17')]),_0x1d3d('0x4d'),{'sessionId':_0x378878,'transferNumber':_0x389330});return _0xa8891a[_0x1d3d('0x18')](0xc8)['json']({'error':![],'message':_0x1d3d('0x4e')});})[_0x1d3d('0x21')](handleError(_0xa8891a));}; \ No newline at end of file +var _0xda55=['sessionId\x20','\x20not\x20found!','originate','info','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','catch','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','transfer','transfer\x20fired:','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','stack','name','status','send','NotFound','then','error','code','message','result','User','VoiceChannels','all','filter','rows','length'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xda55,0x6d));var _0x5da5=function(_0x1cd2ac,_0x718d01){_0x1cd2ac=_0x1cd2ac-0x0;var _0x50164a=_0xda55[_0x1cd2ac];return _0x50164a;};'use strict';var path=require(_0x5da5('0x0'));var fs=require('fs');var _=require(_0x5da5('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var jayson=require(_0x5da5('0x4'));var amiClient=jayson[_0x5da5('0x5')][_0x5da5('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x5da5('0x7'));var Redis=require('ioredis');config[_0x5da5('0x8')]=_['defaults'](config[_0x5da5('0x8')],{'host':_0x5da5('0x9'),'port':0x18eb});var io=require(_0x5da5('0xa'))(new Redis(config[_0x5da5('0x8')]));var Schema=require(_0x5da5('0xb'));var originateValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'callNumber':{'type':_0x5da5('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x5da5('0xe')},'callbackUrl':{'type':_0x5da5('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':'string','required':[!![],_0x5da5('0xf')]},'transferNumber':{'type':_0x5da5('0xe'),'required':[!![],_0x5da5('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]},'sessionId':{'type':_0x5da5('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5da5('0xc'),'required':[!![],_0x5da5('0xd')]}});function emit(_0x11bd3,_0x134afa,_0x3aff51){logger['info'](_0x11bd3,_0x134afa,JSON[_0x5da5('0x11')](_0x3aff51));io['to'](_0x11bd3)[_0x5da5('0x12')](_0x134afa,_0x3aff51);}function handleError(_0x1a4849){return function(_0x16b11f){console[_0x5da5('0x13')](_0x5da5('0x14'),_0x16b11f,_0x16b11f instanceof RangeError);logger['error'](_0x16b11f[_0x5da5('0x15')]);if(_0x16b11f instanceof RangeError){if(_0x16b11f[_0x5da5('0x16')]){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x194)[_0x5da5('0x18')](_0x16b11f);}else{if(_0x16b11f['name']){delete _0x16b11f[_0x5da5('0x16')];}_0x1a4849[_0x5da5('0x17')](0x1f4)[_0x5da5('0x18')](_0x16b11f);}};}function checkError(){return function(_0x560ea7){if(!_0x560ea7){throw new RangeError(_0x5da5('0x19'));}return _0x560ea7;};}function respondWithRpcPromise(_0x15aa62,_0x20c8a6){return new BPromise(function(_0x2e68d5,_0xec69f2){var _0x436960=amiClient;return _0x436960['request'](_0x15aa62,_0x20c8a6)[_0x5da5('0x1a')](function(_0x568ddf){if(_0x568ddf[_0x5da5('0x1b')]){if(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1c')]===0x1f4){return _0xec69f2(_0x568ddf['error'][_0x5da5('0x1d')]);}return _0x2e68d5(_0x568ddf[_0x5da5('0x1b')][_0x5da5('0x1d')]);}else{_0x2e68d5(_0x568ddf[_0x5da5('0x1e')]);}})['catch'](function(_0x5b0b43){_0xec69f2(_0x5b0b43);});});}function getAgent(_0x50aadc){return db[_0x5da5('0x1f')]['findOne']({'where':{'id':_0x50aadc,'role':'agent'}})[_0x5da5('0x1a')](checkError());}function getAgentCheckSession(_0x3974d8,_0x5740a7){return new BPromise(function(_0x1798ae,_0x1ab83e){var _0x558b12=respondWithRpcPromise(_0x5da5('0x20'));var _0x27de55=getAgent(_0x3974d8);Promise[_0x5da5('0x21')]([_0x558b12,_0x27de55])[_0x5da5('0x1a')](function(_0x766ed9){var _0x5734ce=_0x766ed9[0x0];var _0x3ae664=_0x766ed9[0x1];var _0x2e3c5d=_[_0x5da5('0x22')](_0x5734ce[_0x5da5('0x23')],function(_0x55e2bf){return _0x55e2bf['UserId']==_0x3ae664['id']&&_0x55e2bf['sessionId']==_0x5740a7;});if(_0x2e3c5d[_0x5da5('0x24')]==0x1){_0x1798ae(_0x3ae664);}else{_0x1ab83e(new RangeError(_0x5da5('0x25')+_0x5740a7+_0x5da5('0x26')));}});});}exports[_0x5da5('0x27')]=function(_0x51b712,_0x585298){logger[_0x5da5('0x28')]('originate\x20fired:',_0x51b712['body']);var _0x2dd4b6=originateValidation['validate'](_0x51b712[_0x5da5('0x29')]);if(_0x2dd4b6[_0x5da5('0x24')]>0x0){return _0x585298[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2dd4b6);}var _0x6c556d=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x3dc66a=_0x51b712['body'][_0x5da5('0x2c')];var _0x48de0b=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2d')];var _0x28c5eb=_0x51b712[_0x5da5('0x29')][_0x5da5('0x2e')];return getAgent(_0x6c556d)[_0x5da5('0x1a')](function(_0x325ccd){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x325ccd[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x325ccd[_0x5da5('0x16')]),'webbar:originate',{'callNumber':_0x3dc66a,'callerId':_0x48de0b,'callbackUrl':_0x28c5eb});return _0x585298[_0x5da5('0x17')](0xc8)['json']({'error':![],'message':_0x5da5('0x32')});})[_0x5da5('0x33')](handleError(_0x585298));};exports[_0x5da5('0x34')]=function(_0x24842c,_0x59c92e){logger[_0x5da5('0x28')](_0x5da5('0x35'),_0x24842c[_0x5da5('0x29')]);var _0x56fd57=hangupValidation[_0x5da5('0xb')](_0x24842c[_0x5da5('0x29')]);if(_0x56fd57['length']>0x0){return _0x59c92e[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x56fd57);}var _0xe9888e=_0x24842c[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x664a8d=_0x24842c['body'][_0x5da5('0x36')];return getAgent(_0xe9888e)[_0x5da5('0x1a')](function(_0x14c3f5){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x14c3f5['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x14c3f5['name']),_0x5da5('0x37'),{'sessionId':_0x664a8d});return _0x59c92e['status'](0xc8)['json']({'error':![],'message':_0x5da5('0x38')});})[_0x5da5('0x33')](handleError(_0x59c92e));};exports[_0x5da5('0x39')]=function(_0x29d9a7,_0x52b618){logger[_0x5da5('0x28')](_0x5da5('0x3a'),_0x29d9a7[_0x5da5('0x29')]);var _0x40cf69=answerValidation[_0x5da5('0xb')](_0x29d9a7[_0x5da5('0x29')]);if(_0x40cf69[_0x5da5('0x24')]>0x0){return _0x52b618[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x40cf69);}var _0x284d40=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4464a7=_0x29d9a7[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x284d40)['then'](function(_0x485326){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x485326['name']);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x485326[_0x5da5('0x16')]),_0x5da5('0x3b'),{'sessionId':_0x4464a7});return _0x52b618[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x3c')});})[_0x5da5('0x33')](handleError(_0x52b618));};exports[_0x5da5('0x3d')]=function(_0x44de08,_0x4fc584){logger[_0x5da5('0x28')]('hold\x20fired:',_0x44de08['body']);var _0x2a0fb6=holdValidation[_0x5da5('0xb')](_0x44de08[_0x5da5('0x29')]);if(_0x2a0fb6[_0x5da5('0x24')]>0x0){return _0x4fc584[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x2a0fb6);}var _0x5aa561=_0x44de08[_0x5da5('0x29')]['userId'];var _0x5325ad=_0x44de08[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x5aa561)['then'](function(_0x419d74){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x419d74[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x419d74[_0x5da5('0x16')]),'webbar:hold',{'sessionId':_0x5325ad});return _0x4fc584['status'](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'hold\x20executed!'});})[_0x5da5('0x33')](handleError(_0x4fc584));};exports[_0x5da5('0x3e')]=function(_0x17581a,_0x1ec725){logger[_0x5da5('0x28')](_0x5da5('0x3f'),_0x17581a['body']);var _0x5cb8d8=unholdValidation[_0x5da5('0xb')](_0x17581a[_0x5da5('0x29')]);if(_0x5cb8d8['length']>0x0){return _0x1ec725['status'](0x190)[_0x5da5('0x2a')](_0x5cb8d8);}var _0x4c1321=_0x17581a[_0x5da5('0x29')]['userId'];var _0x505ea4=_0x17581a[_0x5da5('0x29')][_0x5da5('0x36')];return getAgent(_0x4c1321)[_0x5da5('0x1a')](function(_0x39d428){logger['info'](_0x5da5('0x2f'),_0x39d428[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')]('user:%s',_0x39d428[_0x5da5('0x16')]),_0x5da5('0x40'),{'sessionId':_0x505ea4});return _0x1ec725[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':_0x5da5('0x41')});})[_0x5da5('0x33')](handleError(_0x1ec725));};exports[_0x5da5('0x42')]=function(_0x53c7dd,_0x3d1a54){logger[_0x5da5('0x28')](_0x5da5('0x43'),_0x3d1a54[_0x5da5('0x29')]);var _0x211b80=callsValidation[_0x5da5('0xb')](_0x53c7dd[_0x5da5('0x29')]);if(_0x211b80[_0x5da5('0x24')]>0x0){return _0x3d1a54[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x211b80);}var _0x191691=_0x53c7dd[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x4cc539=respondWithRpcPromise(_0x5da5('0x20'));var _0x35939b=getAgent(_0x191691);return Promise['all']([_0x4cc539,_0x35939b])['then'](function(_0x509c9e){var _0x1959af=_0x509c9e[0x0];var _0x469907=_0x509c9e[0x1];var _0x20c269=_['filter'](_0x1959af['rows'],function(_0x462317){return _0x462317[_0x5da5('0x44')]==_0x469907['id'];});return _0x3d1a54[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'count':_0x20c269['length'],'rows':_0x20c269});})[_0x5da5('0x33')](handleError(_0x3d1a54));};exports[_0x5da5('0x45')]=function(_0x34b4b0,_0x4e4ffa){logger[_0x5da5('0x28')]('conference\x20fired:',_0x34b4b0[_0x5da5('0x29')]);var _0x4496d2=conferenceValidation[_0x5da5('0xb')](_0x34b4b0[_0x5da5('0x29')]);if(_0x4496d2[_0x5da5('0x24')]>0x0){return _0x4e4ffa[_0x5da5('0x17')](0x190)[_0x5da5('0x2a')](_0x4496d2);}var _0x2c13f1=_0x34b4b0[_0x5da5('0x29')][_0x5da5('0x2b')];return getAgent(_0x2c13f1)[_0x5da5('0x1a')](function(_0xe3fc79){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0xe3fc79[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0xe3fc79[_0x5da5('0x16')]),_0x5da5('0x46'));return _0x4e4ffa[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x4e4ffa));};exports[_0x5da5('0x47')]=function(_0x35cca1,_0x4041e8){logger['info'](_0x5da5('0x48'),_0x35cca1[_0x5da5('0x29')]);var _0x43b55e=transferValidation[_0x5da5('0xb')](_0x35cca1['body']);if(_0x43b55e[_0x5da5('0x24')]>0x0){return _0x4041e8['status'](0x190)[_0x5da5('0x2a')](_0x43b55e);}var _0x5f862f=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x2b')];var _0x57966d=_0x35cca1[_0x5da5('0x29')][_0x5da5('0x36')];var _0x512f01=_0x35cca1['body']['transferNumber'];return getAgent(_0x5f862f)[_0x5da5('0x1a')](function(_0x446241){logger[_0x5da5('0x28')](_0x5da5('0x2f'),_0x446241[_0x5da5('0x16')]);emit(util[_0x5da5('0x30')](_0x5da5('0x31'),_0x446241[_0x5da5('0x16')]),'webbar:transfer',{'sessionId':_0x57966d,'transferNumber':_0x512f01});return _0x4041e8[_0x5da5('0x17')](0xc8)[_0x5da5('0x2a')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x4041e8));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 5d44a0c..a80e97c 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 _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x47c5,0x165));var _0x547c=function(_0x40676d,_0x531472){_0x40676d=_0x40676d-0x0;var _0x4623eb=_0x47c5[_0x40676d];return _0x4623eb;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file +var _0x4975=['describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAgents','/:id/applications','getApplications','post','create','addAnswer','/:id/users','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeDispositions','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated'];(function(_0x47792a,_0x4bd474){var _0x480c14=function(_0x4b0e5e){while(--_0x4b0e5e){_0x47792a['push'](_0x47792a['shift']());}};_0x480c14(++_0x4bd474);}(_0x4975,0x86));var _0x5497=function(_0x48b3ba,_0x4db526){_0x48b3ba=_0x48b3ba-0x0;var _0x4b2b3d=_0x4975[_0x48b3ba];return _0x4b2b3d;};'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('0xa')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0xa')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller['getAnswers']);router['get']('/:id/users',auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router[_0x5497('0xa')](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x16')]);router[_0x5497('0x17')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x18')]);router[_0x5497('0x17')]('/:id/dispositions',auth[_0x5497('0xd')](),controller['addDisposition']);router[_0x5497('0x17')](_0x5497('0x13'),auth[_0x5497('0xd')](),controller[_0x5497('0x19')]);router[_0x5497('0x17')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller['addAgents']);router['post'](_0x5497('0x15'),auth[_0x5497('0xd')](),controller[_0x5497('0x1b')]);router['post'](_0x5497('0x1c'),controller[_0x5497('0x1d')]);router[_0x5497('0x17')](_0x5497('0x1e'),auth[_0x5497('0xd')](),controller[_0x5497('0x1f')]);router[_0x5497('0x20')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x21')]);router[_0x5497('0x22')]('/:id',auth[_0x5497('0xd')](),controller['destroy']);router[_0x5497('0x22')](_0x5497('0x11'),auth[_0x5497('0xd')](),controller[_0x5497('0x23')]);router[_0x5497('0x22')](_0x5497('0x13'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x5497('0x22')](_0x5497('0x1a'),auth[_0x5497('0xd')](),controller[_0x5497('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 2eed156..b79719c 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 _0xf649=['ENUM','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate'];(function(_0x58e0ae,_0x236bf2){var _0x32ac79=function(_0x4fe09d){while(--_0x4fe09d){_0x58e0ae['push'](_0x58e0ae['shift']());}};_0x32ac79(++_0x236bf2);}(_0xf649,0x1bd));var _0x9f64=function(_0x55d3c6,_0x491a7f){_0x55d3c6=_0x55d3c6-0x0;var _0x55a03b=_0xf649[_0x55d3c6];return _0x55a03b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9f64('0x0'));module[_0x9f64('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9f64('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9f64('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9f64('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9f64('0x3')],'defaultValue':function(){return rs[_0x9f64('0x4')]();}},'phone':{'type':Sequelize[_0x9f64('0x3')]},'type':{'type':Sequelize[_0x9f64('0x5')]('twilio',_0x9f64('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9f64('0x7');}},'notificationSound':{'type':Sequelize[_0x9f64('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9f64('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9f64('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f64('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9f64('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f64('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f64('0x9')],'comment':_0x9f64('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x9f64('0x8')],'defaultValue':![],'comment':_0x9f64('0xb'),'set':function(_0x50f1ff){if(!_0x50f1ff){this[_0x9f64('0xc')](_0x9f64('0xd'),null);}this[_0x9f64('0xc')](_0x9f64('0xe'),_0x50f1ff);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x681e=['STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId','setDataValue','sequelize','exports'];(function(_0x21bbfc,_0x511146){var _0x1fce1c=function(_0xb84971){while(--_0xb84971){_0x21bbfc['push'](_0x21bbfc['shift']());}};_0x1fce1c(++_0x511146);}(_0x681e,0x8d));var _0xe681=function(_0x5e6b42,_0x357ad2){_0x5e6b42=_0x5e6b42-0x0;var _0x52343f=_0x681e[_0x5e6b42];return _0x52343f;};'use strict';var Sequelize=require(_0xe681('0x0'));var rs=require('randomstring');module[_0xe681('0x1')]={'name':{'type':Sequelize[_0xe681('0x2')],'unique':_0xe681('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xe681('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xe681('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xe681('0x2')],'defaultValue':function(){return rs[_0xe681('0x4')]();}},'phone':{'type':Sequelize[_0xe681('0x2')]},'type':{'type':Sequelize[_0xe681('0x5')](_0xe681('0x6'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0xe681('0x2')]},'authToken':{'type':Sequelize[_0xe681('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe681('0x7')],'defaultValue':function(){return _0xe681('0x8');}},'notificationSound':{'type':Sequelize[_0xe681('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe681('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe681('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe681('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe681('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe681('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe681('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe681('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x589b38){if(!_0x589b38){this['setDataValue'](_0xe681('0xb'),null);}this[_0xe681('0xc')]('mandatoryDisposition',_0x589b38);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 28b746e..6d83eda 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 _0x65fe=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','messageId','notifications','message_id','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','contact','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','WhatsappInteraction','out','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','offset','limit','count','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x9778a1,_0x5a1b5f){var _0x2afc0d=function(_0x45a907){while(--_0x45a907){_0x9778a1['push'](_0x9778a1['shift']());}};_0x2afc0d(++_0x5a1b5f);}(_0x65fe,0x78));var _0xe65f=function(_0x22099c,_0x164994){_0x22099c=_0x22099c-0x0;var _0x48dee8=_0x65fe[_0x22099c];return _0x48dee8;};'use strict';var emlformat=require(_0xe65f('0x0'));var rimraf=require(_0xe65f('0x1'));var zipdir=require(_0xe65f('0x2'));var jsonpatch=require(_0xe65f('0x3'));var rp=require(_0xe65f('0x4'));var moment=require(_0xe65f('0x5'));var BPromise=require(_0xe65f('0x6'));var Mustache=require(_0xe65f('0x7'));var util=require(_0xe65f('0x8'));var path=require('path');var sox=require(_0xe65f('0x9'));var csv=require(_0xe65f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe65f('0xb'));var _=require(_0xe65f('0xc'));var squel=require(_0xe65f('0xd'));var crypto=require(_0xe65f('0xe'));var jsforce=require(_0xe65f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe65f('0xa'));var querystring=require('querystring');var Papa=require(_0xe65f('0x10'));var Redis=require(_0xe65f('0x11'));var authService=require(_0xe65f('0x12'));var qs=require(_0xe65f('0x13'));var as=require(_0xe65f('0x14'));var hardwareService=require(_0xe65f('0x15'));var logger=require(_0xe65f('0x16'))('api');var utils=require(_0xe65f('0x17'));var config=require(_0xe65f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe65f('0x19'))['db'];config[_0xe65f('0x1a')]=_[_0xe65f('0x1b')](config[_0xe65f('0x1a')],{'host':_0xe65f('0x1c'),'port':0x18eb});var socket=require(_0xe65f('0x1d'))(new Redis(config[_0xe65f('0x1a')]));require(_0xe65f('0x1e'))[_0xe65f('0x1f')](socket);var jayson=require(_0xe65f('0x20'));var client=jayson[_0xe65f('0x21')][_0xe65f('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x6453d2,_0x371405,_0x3581a1,_0x4aa32f){return new BPromise(function(_0x13e535,_0x12f72c){var _0x290d57=_0x4aa32f||client;return _0x290d57[_0xe65f('0x23')](_0x6453d2,_0x3581a1)[_0xe65f('0x24')](function(_0x4bb119){logger[_0xe65f('0x25')](_0xe65f('0x26'),_0x371405,_0xe65f('0x27'));logger[_0xe65f('0x28')](_0xe65f('0x29'),_0x371405,'request\x20sent',JSON[_0xe65f('0x2a')](_0x4bb119));if(_0x4bb119[_0xe65f('0x2b')]){if(_0x4bb119[_0xe65f('0x2b')]['code']===0x1f4){logger[_0xe65f('0x2b')](_0xe65f('0x26'),_0x371405,_0x4bb119['error'][_0xe65f('0x2c')]);return _0x12f72c(_0x4bb119[_0xe65f('0x2b')][_0xe65f('0x2c')]);}logger[_0xe65f('0x2b')](_0xe65f('0x26'),_0x371405,_0x4bb119[_0xe65f('0x2b')][_0xe65f('0x2c')]);return _0x13e535(_0x4bb119[_0xe65f('0x2b')][_0xe65f('0x2c')]);}else{logger[_0xe65f('0x25')](_0xe65f('0x26'),_0x371405,_0xe65f('0x27'));_0x13e535(_0x4bb119['result']['message']);}})[_0xe65f('0x2d')](function(_0x2ff17b){logger[_0xe65f('0x2b')](_0xe65f('0x26'),_0x371405,_0x2ff17b);_0x12f72c(_0x2ff17b);});});}function respondWithStatusCode(_0xfdd027,_0x459d2b){_0x459d2b=_0x459d2b||0xcc;return function(_0x6a110d){if(_0x6a110d){return _0xfdd027[_0xe65f('0x2e')](_0x459d2b);}return _0xfdd027[_0xe65f('0x2f')](_0x459d2b)[_0xe65f('0x30')]();};}function respondWithResult(_0x563c5a,_0x136dba){_0x136dba=_0x136dba||0xc8;return function(_0x14345f){if(_0x14345f){return _0x563c5a['status'](_0x136dba)['json'](_0x14345f);}};}function respondWithFilteredResult(_0x1d2991,_0x1c722c){return function(_0x2b3bb9){if(_0x2b3bb9){var _0x45057d=typeof _0x1c722c[_0xe65f('0x31')]==='undefined'&&typeof _0x1c722c[_0xe65f('0x32')]==='undefined';var _0x25d75e=_0x2b3bb9[_0xe65f('0x33')];var _0x521d7f=_0x45057d?0x0:_0x1c722c[_0xe65f('0x31')];var _0x2f2fa4=_0x45057d?_0x2b3bb9['count']:_0x1c722c[_0xe65f('0x31')]+_0x1c722c['limit'];var _0x5c88f0;if(_0x2f2fa4>=_0x25d75e){_0x2f2fa4=_0x25d75e;_0x5c88f0=0xc8;}else{_0x5c88f0=0xce;}_0x1d2991[_0xe65f('0x2f')](_0x5c88f0);return _0x1d2991['set'](_0xe65f('0x34'),_0x521d7f+'-'+_0x2f2fa4+'/'+_0x25d75e)['json'](_0x2b3bb9);}return null;};}function patchUpdates(_0x1ade48){return function(_0xe83c3){try{jsonpatch[_0xe65f('0x35')](_0xe83c3,_0x1ade48,!![]);}catch(_0x5274b8){return BPromise[_0xe65f('0x36')](_0x5274b8);}return _0xe83c3[_0xe65f('0x37')]();};}function saveUpdates(_0xbea473,_0x4f5f8c){return function(_0x3a5189){if(_0x3a5189){return _0x3a5189[_0xe65f('0x38')](_0xbea473)['then'](function(_0x5dee98){return _0x5dee98;});}return null;};}function removeEntity(_0x220329,_0x54f815){return function(_0x459354){if(_0x459354){return _0x459354[_0xe65f('0x39')]()[_0xe65f('0x24')](function(){var _0x189e52=_0x459354[_0xe65f('0x3a')]({'plain':!![]});var _0x2f30ef=_0xe65f('0x3b');return db[_0xe65f('0x3c')][_0xe65f('0x39')]({'where':{'type':_0x2f30ef,'resourceId':_0x189e52['id']}})['then'](function(){return _0x459354;});})[_0xe65f('0x24')](function(){_0x220329[_0xe65f('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534532,_0xdc78a){return function(_0x5448f3){if(!_0x5448f3){_0x534532['sendStatus'](0x194);}return _0x5448f3;};}function handleError(_0x2f074d,_0x3481a8){_0x3481a8=_0x3481a8||0x1f4;return function(_0x41cb8f){logger[_0xe65f('0x2b')](_0x41cb8f[_0xe65f('0x3d')]);if(_0x41cb8f['name']){delete _0x41cb8f[_0xe65f('0x3e')];}_0x2f074d[_0xe65f('0x2f')](_0x3481a8)['send'](_0x41cb8f);};}exports['index']=function(_0x214270,_0x18431c){var _0x4ca492={'include':[{'model':db[_0xe65f('0x3f')],'as':_0xe65f('0x40')}]},_0x1d2776={},_0x2fe602={'count':0x0,'rows':[]};var _0x24885b=_[_0xe65f('0x41')](db[_0xe65f('0x42')][_0xe65f('0x43')],function(_0x2d3e2d){return{'name':_0x2d3e2d['fieldName'],'type':_0x2d3e2d['type'][_0xe65f('0x44')]};});_0x1d2776[_0xe65f('0x45')]=_[_0xe65f('0x41')](_0x24885b,_0xe65f('0x3e'));_0x1d2776[_0xe65f('0x46')]=_['keys'](_0x214270['query']);_0x1d2776[_0xe65f('0x47')]=_[_0xe65f('0x48')](_0x1d2776[_0xe65f('0x45')],_0x1d2776['query']);_0x4ca492[_0xe65f('0x49')]=_['intersection'](_0x1d2776[_0xe65f('0x45')],qs['fields'](_0x214270[_0xe65f('0x46')][_0xe65f('0x4a')]));_0x4ca492[_0xe65f('0x49')]=_0x4ca492[_0xe65f('0x49')][_0xe65f('0x4b')]?_0x4ca492[_0xe65f('0x49')]:_0x1d2776['model'];if(!_0x214270[_0xe65f('0x46')][_0xe65f('0x4c')](_0xe65f('0x4d'))){_0x4ca492[_0xe65f('0x32')]=qs[_0xe65f('0x32')](_0x214270[_0xe65f('0x46')][_0xe65f('0x32')]);_0x4ca492[_0xe65f('0x31')]=qs[_0xe65f('0x31')](_0x214270[_0xe65f('0x46')][_0xe65f('0x31')]);}_0x4ca492[_0xe65f('0x4e')]=qs['sort'](_0x214270[_0xe65f('0x46')][_0xe65f('0x4f')]);_0x4ca492[_0xe65f('0x50')]=qs['filters'](_[_0xe65f('0x51')](_0x214270['query'],_0x1d2776['filters']),_0x24885b);if(_0x214270[_0xe65f('0x46')][_0xe65f('0x52')]){_0x4ca492['where']=_[_0xe65f('0x53')](_0x4ca492[_0xe65f('0x50')],{'$or':_[_0xe65f('0x41')](_0x24885b,function(_0x2dd992){if(_0x2dd992[_0xe65f('0x54')]!==_0xe65f('0x55')){var _0x15738e={};_0x15738e[_0x2dd992['name']]={'$like':'%'+_0x214270[_0xe65f('0x46')]['filter']+'%'};return _0x15738e;}})});}_0x4ca492=_[_0xe65f('0x53')]({},_0x4ca492,_0x214270[_0xe65f('0x56')]);var _0x5d84f1={'where':_0x4ca492[_0xe65f('0x50')]};return db[_0xe65f('0x42')][_0xe65f('0x33')](_0x5d84f1)[_0xe65f('0x24')](function(_0x2be9a1){_0x2fe602[_0xe65f('0x33')]=_0x2be9a1;if(_0x214270['query'][_0xe65f('0x57')]){_0x4ca492[_0xe65f('0x58')]=[{'all':!![]}];}return db[_0xe65f('0x42')]['findAll'](_0x4ca492);})['then'](function(_0xa28a53){_0x2fe602[_0xe65f('0x59')]=_0xa28a53;return _0x2fe602;})[_0xe65f('0x24')](respondWithFilteredResult(_0x18431c,_0x4ca492))['catch'](handleError(_0x18431c,null));};exports[_0xe65f('0x5a')]=function(_0x24cee5,_0x259428){var _0x5e0a7b={'raw':![],'where':{'id':_0x24cee5[_0xe65f('0x5b')]['id']},'include':[{'model':db[_0xe65f('0x3f')],'as':_0xe65f('0x40')}]},_0x41bea4={};_0x41bea4[_0xe65f('0x45')]=_[_0xe65f('0x5c')](db[_0xe65f('0x42')][_0xe65f('0x43')]);_0x41bea4[_0xe65f('0x46')]=_[_0xe65f('0x5c')](_0x24cee5['query']);_0x41bea4[_0xe65f('0x47')]=_[_0xe65f('0x48')](_0x41bea4['model'],_0x41bea4['query']);_0x5e0a7b[_0xe65f('0x49')]=_['intersection'](_0x41bea4[_0xe65f('0x45')],qs[_0xe65f('0x4a')](_0x24cee5[_0xe65f('0x46')][_0xe65f('0x4a')]));_0x5e0a7b[_0xe65f('0x49')]=_0x5e0a7b[_0xe65f('0x49')][_0xe65f('0x4b')]?_0x5e0a7b[_0xe65f('0x49')]:_0x41bea4[_0xe65f('0x45')];if(_0x24cee5[_0xe65f('0x46')][_0xe65f('0x57')]){_0x5e0a7b['include']=[{'all':!![]}];}_0x5e0a7b=_[_0xe65f('0x53')]({},_0x5e0a7b,_0x24cee5[_0xe65f('0x56')]);return db['WhatsappAccount'][_0xe65f('0x5d')](_0x5e0a7b)[_0xe65f('0x24')](handleEntityNotFound(_0x259428,null))[_0xe65f('0x24')](respondWithResult(_0x259428,null))[_0xe65f('0x2d')](handleError(_0x259428,null));};exports[_0xe65f('0x5e')]=function(_0x2f7122,_0xeff65c){return db[_0xe65f('0x42')]['create'](_0x2f7122[_0xe65f('0x5f')],{})['then'](function(_0x24a24d){var _0x5dd541=_0x2f7122[_0xe65f('0x60')][_0xe65f('0x3a')]({'plain':!![]});if(!_0x5dd541)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dd541['role']===_0xe65f('0x60')){var _0x2a980f=_0x24a24d[_0xe65f('0x3a')]({'plain':!![]});var _0x27c746=_0xe65f('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x27c746,'userProfileId':_0x5dd541[_0xe65f('0x61')]},'raw':!![]})[_0xe65f('0x24')](function(_0x14faf8){if(_0x14faf8&&_0x14faf8['autoAssociation']===0x0){return db[_0xe65f('0x3c')][_0xe65f('0x5e')]({'name':_0x2a980f[_0xe65f('0x3e')],'resourceId':_0x2a980f['id'],'type':_0x14faf8[_0xe65f('0x3e')],'sectionId':_0x14faf8['id']},{})[_0xe65f('0x24')](function(){return _0x24a24d;});}else{return _0x24a24d;}})[_0xe65f('0x2d')](function(_0x14e975){logger[_0xe65f('0x2b')](_0xe65f('0x62'),_0x14e975);throw _0x14e975;});}return _0x24a24d;})['then'](respondWithResult(_0xeff65c,0xc9))[_0xe65f('0x2d')](handleError(_0xeff65c,null));};exports[_0xe65f('0x38')]=function(_0x27feb6,_0x55dee4){if(_0x27feb6[_0xe65f('0x5f')]['id']){delete _0x27feb6[_0xe65f('0x5f')]['id'];}return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x27feb6['params']['id']},'include':[{'model':db[_0xe65f('0x3f')],'as':_0xe65f('0x40')}]})['then'](handleEntityNotFound(_0x55dee4,null))[_0xe65f('0x24')](saveUpdates(_0x27feb6['body'],null))[_0xe65f('0x24')](respondWithResult(_0x55dee4,null))[_0xe65f('0x2d')](handleError(_0x55dee4,null));};exports[_0xe65f('0x39')]=function(_0xa141cf,_0x5b49d0){return db['WhatsappAccount'][_0xe65f('0x5d')]({'where':{'id':_0xa141cf[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x5b49d0,null))['then'](removeEntity(_0x5b49d0,null))['catch'](handleError(_0x5b49d0,null));};exports[_0xe65f('0x63')]=function(_0x2c4746,_0x44c645){return db['WhatsappAccount'][_0xe65f('0x63')]()[_0xe65f('0x24')](respondWithResult(_0x44c645,null))['catch'](handleError(_0x44c645,null));};exports[_0xe65f('0x64')]=function(_0x29d187,_0xcf9d65,_0x429b1b){if(_0x29d187[_0xe65f('0x5f')]['id']){delete _0x29d187[_0xe65f('0x5f')]['id'];}return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x29d187['params']['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0xcf9d65,null))[_0xe65f('0x24')](function(_0x5d6bba){if(_0x5d6bba){_0x29d187['body'][_0xe65f('0x65')]=_0x5d6bba['id'];return db[_0xe65f('0x66')][_0xe65f('0x5e')](_0x29d187[_0xe65f('0x5f')]);}})[_0xe65f('0x24')](respondWithResult(_0xcf9d65,null))['catch'](handleError(_0xcf9d65,null));};exports[_0xe65f('0x67')]=function(_0xc69b67,_0x4c38b7,_0x2b3155){var _0xcff9ec={'raw':![],'where':{}};var _0x5cdaca={};var _0x1861aa={'count':0x0,'rows':[]};return db[_0xe65f('0x42')][_0xe65f('0x68')]({'where':{'id':_0xc69b67[_0xe65f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4c38b7,null))[_0xe65f('0x24')](function(_0x4c29f6){if(_0x4c29f6){_0x5cdaca['model']=_[_0xe65f('0x5c')](db[_0xe65f('0x66')][_0xe65f('0x43')]);_0x5cdaca[_0xe65f('0x46')]=_[_0xe65f('0x5c')](_0xc69b67[_0xe65f('0x46')]);_0x5cdaca[_0xe65f('0x47')]=_[_0xe65f('0x48')](_0x5cdaca['model'],_0x5cdaca[_0xe65f('0x46')]);_0xcff9ec['attributes']=_[_0xe65f('0x48')](_0x5cdaca[_0xe65f('0x45')],qs['fields'](_0xc69b67[_0xe65f('0x46')][_0xe65f('0x4a')]));_0xcff9ec[_0xe65f('0x49')]=_0xcff9ec[_0xe65f('0x49')][_0xe65f('0x4b')]?_0xcff9ec[_0xe65f('0x49')]:_0x5cdaca[_0xe65f('0x45')];if(!_0xc69b67[_0xe65f('0x46')][_0xe65f('0x4c')](_0xe65f('0x4d'))){_0xcff9ec[_0xe65f('0x32')]=qs[_0xe65f('0x32')](_0xc69b67[_0xe65f('0x46')]['limit']);_0xcff9ec['offset']=qs['offset'](_0xc69b67[_0xe65f('0x46')][_0xe65f('0x31')]);}_0xcff9ec[_0xe65f('0x4e')]=qs[_0xe65f('0x4f')](_0xc69b67[_0xe65f('0x46')]['sort']);_0xcff9ec['where']=qs[_0xe65f('0x47')](_[_0xe65f('0x51')](_0xc69b67[_0xe65f('0x46')],_0x5cdaca[_0xe65f('0x47')]));_0xcff9ec['where'][_0xe65f('0x65')]=_0x4c29f6['id'];if(_0xc69b67[_0xe65f('0x46')][_0xe65f('0x52')]){_0xcff9ec[_0xe65f('0x50')]=_['merge'](_0xcff9ec[_0xe65f('0x50')],{'$or':_[_0xe65f('0x41')](_0xcff9ec['attributes'],function(_0x25f48d){var _0x1dfcea={};_0x1dfcea[_0x25f48d]={'$like':'%'+_0xc69b67[_0xe65f('0x46')][_0xe65f('0x52')]+'%'};return _0x1dfcea;})});}_0xcff9ec=_['merge']({},_0xcff9ec,_0xc69b67['options']);return db[_0xe65f('0x66')][_0xe65f('0x33')]({'where':_0xcff9ec[_0xe65f('0x50')]})[_0xe65f('0x24')](function(_0x1a46f){_0x1861aa[_0xe65f('0x33')]=_0x1a46f;if(_0xc69b67['query'][_0xe65f('0x57')]){_0xcff9ec[_0xe65f('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xe65f('0x69')](_0xcff9ec);})[_0xe65f('0x24')](function(_0x4996f7){_0x1861aa['rows']=_0x4996f7;return _0x1861aa;});}})[_0xe65f('0x24')](respondWithFilteredResult(_0x4c38b7,_0xcff9ec))[_0xe65f('0x2d')](handleError(_0x4c38b7,null));};exports[_0xe65f('0x6a')]=function(_0x25e5f0,_0x92b21,_0xdf34bd){return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x25e5f0[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x92b21,null))[_0xe65f('0x24')](function(_0x417056){if(_0x417056){return _0x417056[_0xe65f('0x6a')](_0x25e5f0[_0xe65f('0x46')][_0xe65f('0x6b')]);}})[_0xe65f('0x24')](respondWithStatusCode(_0x92b21,null))['catch'](handleError(_0x92b21,null));};exports[_0xe65f('0x6c')]=function(_0x1a38a1,_0x11c6ac,_0x382273){if(_0x1a38a1[_0xe65f('0x5f')]['id']){delete _0x1a38a1['body']['id'];}return db[_0xe65f('0x42')]['find']({'where':{'id':_0x1a38a1[_0xe65f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11c6ac,null))[_0xe65f('0x24')](function(_0x56fe52){if(_0x56fe52){_0x1a38a1[_0xe65f('0x5f')]['WhatsappAccountId']=_0x56fe52['id'];return db[_0xe65f('0x6d')][_0xe65f('0x5e')](_0x1a38a1[_0xe65f('0x5f')]);}})[_0xe65f('0x24')](respondWithResult(_0x11c6ac,null))[_0xe65f('0x2d')](handleError(_0x11c6ac,null));};exports['getAnswers']=function(_0x12b1e,_0x2f25fe,_0x6e4629){var _0x25b5c4={'raw':![],'where':{}};var _0x350f82={};var _0x1fc454={'count':0x0,'rows':[]};return db[_0xe65f('0x42')][_0xe65f('0x68')]({'where':{'id':_0x12b1e['params']['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x2f25fe,null))[_0xe65f('0x24')](function(_0x24232d){if(_0x24232d){_0x350f82['model']=_[_0xe65f('0x5c')](db[_0xe65f('0x6d')][_0xe65f('0x43')]);_0x350f82[_0xe65f('0x46')]=_[_0xe65f('0x5c')](_0x12b1e['query']);_0x350f82[_0xe65f('0x47')]=_[_0xe65f('0x48')](_0x350f82[_0xe65f('0x45')],_0x350f82['query']);_0x25b5c4[_0xe65f('0x49')]=_['intersection'](_0x350f82['model'],qs['fields'](_0x12b1e['query'][_0xe65f('0x4a')]));_0x25b5c4[_0xe65f('0x49')]=_0x25b5c4[_0xe65f('0x49')][_0xe65f('0x4b')]?_0x25b5c4[_0xe65f('0x49')]:_0x350f82[_0xe65f('0x45')];if(!_0x12b1e['query'][_0xe65f('0x4c')](_0xe65f('0x4d'))){_0x25b5c4['limit']=qs[_0xe65f('0x32')](_0x12b1e[_0xe65f('0x46')][_0xe65f('0x32')]);_0x25b5c4[_0xe65f('0x31')]=qs[_0xe65f('0x31')](_0x12b1e[_0xe65f('0x46')][_0xe65f('0x31')]);}_0x25b5c4['order']=qs[_0xe65f('0x4f')](_0x12b1e[_0xe65f('0x46')][_0xe65f('0x4f')]);_0x25b5c4[_0xe65f('0x50')]=qs[_0xe65f('0x47')](_[_0xe65f('0x51')](_0x12b1e['query'],_0x350f82[_0xe65f('0x47')]));_0x25b5c4['where'][_0xe65f('0x65')]=_0x24232d['id'];if(_0x12b1e[_0xe65f('0x46')][_0xe65f('0x52')]){_0x25b5c4[_0xe65f('0x50')]=_[_0xe65f('0x53')](_0x25b5c4[_0xe65f('0x50')],{'$or':_[_0xe65f('0x41')](_0x25b5c4['attributes'],function(_0x12b505){var _0x4f573f={};_0x4f573f[_0x12b505]={'$like':'%'+_0x12b1e[_0xe65f('0x46')][_0xe65f('0x52')]+'%'};return _0x4f573f;})});}_0x25b5c4=_[_0xe65f('0x53')]({},_0x25b5c4,_0x12b1e[_0xe65f('0x56')]);return db[_0xe65f('0x6d')][_0xe65f('0x33')]({'where':_0x25b5c4[_0xe65f('0x50')]})['then'](function(_0x3f26f6){_0x1fc454[_0xe65f('0x33')]=_0x3f26f6;if(_0x12b1e[_0xe65f('0x46')][_0xe65f('0x57')]){_0x25b5c4['include']=[{'all':!![]}];}return db[_0xe65f('0x6d')]['findAll'](_0x25b5c4);})[_0xe65f('0x24')](function(_0x3bac5c){_0x1fc454['rows']=_0x3bac5c;return _0x1fc454;});}})[_0xe65f('0x24')](respondWithFilteredResult(_0x2f25fe,_0x25b5c4))['catch'](handleError(_0x2f25fe,null));};exports[_0xe65f('0x6e')]=function(_0xc99e59,_0x3d8c34,_0x3d72a0){return db['WhatsappAccount'][_0xe65f('0x5d')]({'where':{'id':_0xc99e59[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x3d8c34,null))[_0xe65f('0x24')](function(_0x2366c3){if(_0x2366c3){return _0x2366c3['removeAnswers'](_0xc99e59[_0xe65f('0x46')]['ids']);}})[_0xe65f('0x24')](respondWithStatusCode(_0x3d8c34,null))[_0xe65f('0x2d')](handleError(_0x3d8c34,null));};exports[_0xe65f('0x6f')]=function(_0x6e8c9f,_0x29722a,_0x1b18ac){return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x6e8c9f[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x29722a,null))[_0xe65f('0x24')](function(_0x27abc4){if(_0x27abc4){return _0x27abc4[_0xe65f('0x6f')](_0x6e8c9f[_0xe65f('0x5f')][_0xe65f('0x6b')],_[_0xe65f('0x70')](_0x6e8c9f[_0xe65f('0x5f')],['ids','id'])||{})[_0xe65f('0x71')](function(_0x2c23f9){for(var _0x231170=0x0;_0x231170<_0x6e8c9f[_0xe65f('0x5f')][_0xe65f('0x6b')]['length'];_0x231170+=0x1){socket[_0xe65f('0x72')](_0xe65f('0x73'),{'UserId':Number(_0x6e8c9f[_0xe65f('0x5f')][_0xe65f('0x6b')][_0x231170]),'WhatsappAccountId':Number(_0x6e8c9f[_0xe65f('0x5b')]['id'])});}return _0x2c23f9;});}})['then'](respondWithResult(_0x29722a,null))[_0xe65f('0x2d')](handleError(_0x29722a,null));};exports[_0xe65f('0x74')]=function(_0x5daeb0,_0x3dac73,_0x596951){return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x5daeb0[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x3dac73,null))['then'](function(_0x4c9e49){if(_0x4c9e49){return _0x4c9e49[_0xe65f('0x74')](_0x5daeb0['query'][_0xe65f('0x6b')])[_0xe65f('0x24')](function(){if(_['isArray'](_0x5daeb0[_0xe65f('0x46')][_0xe65f('0x6b')])){for(var _0x4f5179=0x0;_0x4f5179<_0x5daeb0[_0xe65f('0x46')][_0xe65f('0x6b')][_0xe65f('0x4b')];_0x4f5179+=0x1){socket[_0xe65f('0x72')](_0xe65f('0x75'),{'UserId':Number(_0x5daeb0['query'][_0xe65f('0x6b')][_0x4f5179]),'WhatsappAccountId':Number(_0x5daeb0['params']['id'])});}}else{socket[_0xe65f('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x5daeb0[_0xe65f('0x46')][_0xe65f('0x6b')]),'WhatsappAccountId':Number(_0x5daeb0[_0xe65f('0x5b')]['id'])});}});}})[_0xe65f('0x24')](respondWithStatusCode(_0x3dac73,null))[_0xe65f('0x2d')](handleError(_0x3dac73,null));};exports['getAgents']=function(_0x1abfd1,_0x147845,_0x1661b8){var _0x17dcfc={};var _0x1c9a74={};var _0x1fb364;var _0x4c90ab;return db[_0xe65f('0x42')][_0xe65f('0x68')]({'where':{'id':_0x1abfd1['params']['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x147845,null))['then'](function(_0x41170c){if(_0x41170c){_0x1fb364=_0x41170c;_0x1c9a74[_0xe65f('0x45')]=_['keys'](db[_0xe65f('0x76')][_0xe65f('0x43')]);_0x1c9a74[_0xe65f('0x46')]=_[_0xe65f('0x5c')](_0x1abfd1[_0xe65f('0x46')]);_0x1c9a74[_0xe65f('0x47')]=_['intersection'](_0x1c9a74[_0xe65f('0x45')],_0x1c9a74[_0xe65f('0x46')]);_0x17dcfc[_0xe65f('0x49')]=_['intersection'](_0x1c9a74['model'],qs[_0xe65f('0x4a')](_0x1abfd1[_0xe65f('0x46')][_0xe65f('0x4a')]));_0x17dcfc[_0xe65f('0x49')]=_0x17dcfc[_0xe65f('0x49')][_0xe65f('0x4b')]?_0x17dcfc[_0xe65f('0x49')]:_0x1c9a74[_0xe65f('0x45')];_0x17dcfc[_0xe65f('0x4e')]=qs[_0xe65f('0x4f')](_0x1abfd1[_0xe65f('0x46')][_0xe65f('0x4f')]);_0x17dcfc[_0xe65f('0x50')]=qs['filters'](_['pick'](_0x1abfd1[_0xe65f('0x46')],_0x1c9a74[_0xe65f('0x47')]));if(_0x1abfd1[_0xe65f('0x46')][_0xe65f('0x52')]){_0x17dcfc['where']=_[_0xe65f('0x53')](_0x17dcfc[_0xe65f('0x50')],{'$or':_['map'](_0x17dcfc['attributes'],function(_0x26040c){var _0x2ace1b={};_0x2ace1b[_0x26040c]={'$like':'%'+_0x1abfd1[_0xe65f('0x46')][_0xe65f('0x52')]+'%'};return _0x2ace1b;})});}_0x17dcfc=_[_0xe65f('0x53')]({},_0x17dcfc,_0x1abfd1[_0xe65f('0x56')]);return _0x1fb364[_0xe65f('0x77')](_0x17dcfc);}})[_0xe65f('0x24')](function(_0xc2eda){if(_0xc2eda){_0x4c90ab=_0xc2eda[_0xe65f('0x4b')];if(!_0x1abfd1[_0xe65f('0x46')]['hasOwnProperty'](_0xe65f('0x4d'))){_0x17dcfc[_0xe65f('0x32')]=qs[_0xe65f('0x32')](_0x1abfd1[_0xe65f('0x46')]['limit']);_0x17dcfc[_0xe65f('0x31')]=qs[_0xe65f('0x31')](_0x1abfd1[_0xe65f('0x46')]['offset']);}return _0x1fb364[_0xe65f('0x77')](_0x17dcfc);}})['then'](function(_0x22cb7a){if(_0x22cb7a){return _0x22cb7a?{'count':_0x4c90ab,'rows':_0x22cb7a}:null;}})[_0xe65f('0x24')](respondWithResult(_0x147845,null))[_0xe65f('0x2d')](handleError(_0x147845,null));};exports[_0xe65f('0x78')]=function(_0x688cbf,_0x34fa45){var _0x2e0394=_0x688cbf['params']['id'];var _0x4c6e64=_0x688cbf[_0xe65f('0x5f')];var _0x7035be=0xc8;var _0x454387=null;return db[_0xe65f('0x79')]['transaction']({'isolationLevel':db[_0xe65f('0x79')][_0xe65f('0x7a')][_0xe65f('0x7b')][_0xe65f('0x7c')]},function(_0x9ad2a7){return db['WhatsappAccount'][_0xe65f('0x68')]({'where':{'id':_0x2e0394},'transaction':_0x9ad2a7})[_0xe65f('0x24')](function(_0x992912){if(_0x992912){return db[_0xe65f('0x7d')]['destroy']({'where':{'WhatsappAccountId':_0x2e0394},'transaction':_0x9ad2a7})[_0xe65f('0x24')](function(){var _0x11fa7d=_[_0xe65f('0x41')](_0x4c6e64,function(_0x55200a){_0x55200a[_0xe65f('0x65')]=_0x2e0394;return _0x55200a;});return db[_0xe65f('0x7d')][_0xe65f('0x7e')](_0x11fa7d,{'transaction':_0x9ad2a7});});}else{_0x7035be=0x194;_0x454387=[];}});})[_0xe65f('0x24')](function(){if(_0x7035be!==0x194){return db[_0xe65f('0x7d')][_0xe65f('0x7f')]({'where':{'WhatsappAccountId':_0x2e0394},'order':_0xe65f('0x80')})[_0xe65f('0x24')](function(_0x13a251){_0x454387=_0x13a251;});}})[_0xe65f('0x2d')](function(_0x5bbb38){_0x7035be=0x1f4;logger['error'](_0x5bbb38[_0xe65f('0x3d')]);if(_0x5bbb38[_0xe65f('0x3e')]){delete _0x5bbb38[_0xe65f('0x3e')];}_0x454387=_0x5bbb38;})[_0xe65f('0x81')](function(){if(_0x454387===null){_0x34fa45[_0xe65f('0x2e')](_0x7035be);}else{if(_0x7035be===0x1f4){_0x34fa45[_0xe65f('0x2f')](_0x7035be)[_0xe65f('0x82')](_0x454387);}else{_0x34fa45['status'](_0x7035be)[_0xe65f('0x83')](_0x454387);}}});};exports[_0xe65f('0x84')]=function(_0x14a4a6,_0x2716d9,_0x406958){var _0x5c8772={};var _0x185f6e={};var _0x7d7455;var _0x4c152a;return db[_0xe65f('0x42')][_0xe65f('0x68')]({'where':{'id':_0x14a4a6[_0xe65f('0x5b')]['id']}})[_0xe65f('0x24')](handleEntityNotFound(_0x2716d9,null))[_0xe65f('0x24')](function(_0x4fc195){if(_0x4fc195){_0x7d7455=_0x4fc195;_0x185f6e[_0xe65f('0x45')]=_['keys'](db['WhatsappApplication'][_0xe65f('0x43')]);_0x185f6e[_0xe65f('0x46')]=_[_0xe65f('0x5c')](_0x14a4a6[_0xe65f('0x46')]);_0x185f6e['filters']=_[_0xe65f('0x48')](_0x185f6e[_0xe65f('0x45')],_0x185f6e[_0xe65f('0x46')]);_0x5c8772[_0xe65f('0x49')]=_[_0xe65f('0x48')](_0x185f6e[_0xe65f('0x45')],qs['fields'](_0x14a4a6[_0xe65f('0x46')][_0xe65f('0x4a')]));_0x5c8772[_0xe65f('0x49')]=_0x5c8772[_0xe65f('0x49')][_0xe65f('0x4b')]?_0x5c8772[_0xe65f('0x49')]:_0x185f6e['model'];_0x5c8772[_0xe65f('0x4e')]=qs['sort'](_0x14a4a6[_0xe65f('0x46')][_0xe65f('0x4f')]);_0x5c8772[_0xe65f('0x50')]=qs[_0xe65f('0x47')](_[_0xe65f('0x51')](_0x14a4a6[_0xe65f('0x46')],_0x185f6e[_0xe65f('0x47')]));if(_0x14a4a6[_0xe65f('0x46')][_0xe65f('0x52')]){_0x5c8772[_0xe65f('0x50')]=_['merge'](_0x5c8772[_0xe65f('0x50')],{'$or':_[_0xe65f('0x41')](_0x5c8772['attributes'],function(_0x53b1e5){var _0x4f4724={};_0x4f4724[_0x53b1e5]={'$like':'%'+_0x14a4a6['query'][_0xe65f('0x52')]+'%'};return _0x4f4724;})});}_0x5c8772=_[_0xe65f('0x53')]({},_0x5c8772,_0x14a4a6['options']);return _0x7d7455[_0xe65f('0x84')](_0x5c8772);}})['then'](function(_0x2a8a87){if(_0x2a8a87){_0x4c152a=_0x2a8a87[_0xe65f('0x4b')];if(!_0x14a4a6['query'][_0xe65f('0x4c')](_0xe65f('0x4d'))){_0x5c8772[_0xe65f('0x32')]=qs['limit'](_0x14a4a6[_0xe65f('0x46')][_0xe65f('0x32')]);_0x5c8772['offset']=qs['offset'](_0x14a4a6[_0xe65f('0x46')][_0xe65f('0x31')]);}return _0x7d7455[_0xe65f('0x84')](_0x5c8772);}})[_0xe65f('0x24')](function(_0x12832a){if(_0x12832a){return _0x12832a?{'count':_0x4c152a,'rows':_0x12832a}:null;}})[_0xe65f('0x24')](respondWithResult(_0x2716d9,null))[_0xe65f('0x2d')](handleError(_0x2716d9,null));};exports[_0xe65f('0x85')]=function(_0x5a03b1,_0x4d69ef,_0x48306f){var _0x474d01={'channel':_0xe65f('0x86')};var _0x56c5c1=[];var _0x5e7d5e=[];var _0x3cd0b6={};return db[_0xe65f('0x42')][_0xe65f('0x5d')]({'where':{'id':_0x5a03b1[_0xe65f('0x5b')]['id']},'include':[{'model':db[_0xe65f('0x7d')],'as':_0xe65f('0x87')}]})['then'](handleEntityNotFound(_0x4d69ef,null))[_0xe65f('0x24')](function(_0x33763c){_0x474d01[_0xe65f('0x88')]=_0x33763c;if(_0x474d01[_0xe65f('0x88')]&&_0x474d01['account'][_0xe65f('0x54')]===_0xe65f('0x89')&&_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x8a')]){if(_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x8a')]['length']===0x0)return;if(_0x5a03b1['body'][_0xe65f('0x8a')][0x0][_0xe65f('0x8b')]!==_0xe65f('0x8c'))return;return db['WhatsappMessage'][_0xe65f('0x38')]({'read':!![],'readAt':_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x8a')][0x0]['timestamp']},{'where':{'messageId':_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x8a')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0xbf1ed9){return _0x4d69ef[_0xe65f('0x2f')](0xc8)[_0xe65f('0x83')](_0xbf1ed9);});}_0x474d01[_0xe65f('0x8d')]=_['orderBy'](_0x33763c['Applications'],[_0xe65f('0x80')],[_0xe65f('0x8e')]);if(_0x474d01[_0xe65f('0x88')]['Applications']){delete _0x474d01[_0xe65f('0x88')][_0xe65f('0x87')];}return db[_0xe65f('0x8f')]['describe']()[_0xe65f('0x24')](function(_0x3e534b){if(!_0x3e534b){throw new db[(_0xe65f('0x90'))][(_0xe65f('0x91'))](_0xe65f('0x92'));}_0x56c5c1=_[_0xe65f('0x93')](_[_0xe65f('0x5c')](_0x3e534b),['createdAt','updatedAt']);_0x5e7d5e=_[_0xe65f('0x93')](_[_0xe65f('0x5c')](_0x3e534b),[_0xe65f('0x94'),_0xe65f('0x95'),_0xe65f('0x96'),_0xe65f('0x97')]);_0x474d01['body']={'mapKey':_0xe65f('0x98')};if(_0x474d01[_0xe65f('0x88')]&&_0x474d01['account']['type']===_0xe65f('0x99')){_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')]=_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x9b')][_0xe65f('0x9c')]('whatsapp:','');_0x474d01['body'][_0xe65f('0x5f')]=_0x5a03b1[_0xe65f('0x5f')]['Body'];_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9d')]=_0x5a03b1[_0xe65f('0x5f')]['MessageSid'];}if(_0x474d01[_0xe65f('0x88')]&&_0x474d01[_0xe65f('0x88')][_0xe65f('0x54')]==='sinch'){_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')]=_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x9e')][0x0][_0xe65f('0x9a')];_0x474d01['body']['body']=_0x5a03b1[_0xe65f('0x5f')]['notifications'][0x0][_0xe65f('0x2c')]['body'];_0x474d01['body'][_0xe65f('0x9d')]=_0x5a03b1[_0xe65f('0x5f')][_0xe65f('0x9e')][0x0][_0xe65f('0x9f')];}if(_0x474d01[_0xe65f('0x5f')]['id']){delete _0x474d01['body']['id'];}if(_[_0xe65f('0xa0')](_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')])){throw new db[(_0xe65f('0x90'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xe65f('0xa0')](_0x474d01[_0xe65f('0x5f')][_0xe65f('0x5f')])||_0x474d01[_0xe65f('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xe65f('0xa1'));}if(_['isNil'](_0x474d01[_0xe65f('0x5f')][_0xe65f('0xa2')])){throw new db[(_0xe65f('0x90'))][(_0xe65f('0x91'))](_0xe65f('0xa3')+_0x5e7d5e);}if(!_[_0xe65f('0xa4')](_0x5e7d5e,_0x474d01[_0xe65f('0x5f')][_0xe65f('0xa2')])){throw new db[(_0xe65f('0x90'))][(_0xe65f('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e7d5e);}_0x3cd0b6[_0x474d01[_0xe65f('0x5f')][_0xe65f('0xa2')]]=_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')];return db[_0xe65f('0xa5')][_0xe65f('0x5d')]({'where':{'id':_0x474d01[_0xe65f('0x88')][_0xe65f('0x97')]},'include':[{'model':db['CmContact'],'as':_0xe65f('0xa6'),'where':_0x3cd0b6,'limit':0x1,'order':[[_0xe65f('0x95'),_0xe65f('0xa7')]]}]});})[_0xe65f('0x24')](handleEntityNotFound(_0x4d69ef,null))['then'](function(_0x3eaee1){if(_0x3eaee1){_0x474d01[_0xe65f('0xa8')]=_[_0xe65f('0x70')](_0x3eaee1,[_0xe65f('0xa6')]);if(_0x3eaee1[_0xe65f('0xa6')][_0xe65f('0x4b')]){return _0x3eaee1['Contacts'][0x0];}var _0x2e2084=_[_0xe65f('0x1b')](_0x474d01['body'],{'firstName':_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')],'ListId':_0x3eaee1['id']});_0x2e2084[_0x474d01['body'][_0xe65f('0xa2')]]=_0x474d01['body'][_0xe65f('0x9a')];return db['CmContact'][_0xe65f('0x5e')](_0x2e2084,{'fields':_0x56c5c1,'raw':!![]});}})[_0xe65f('0x24')](handleEntityNotFound(_0x4d69ef,null))['then'](function(_0x1924e6){if(_0x1924e6){_0x474d01[_0xe65f('0xa9')]=_0x1924e6;var _0x55a7f7={'ContactId':_0x1924e6['id'],'phone':_0x474d01['body'][_0xe65f('0x9a')],'WhatsappAccountId':_0x5a03b1['params']['id']};var _0x337718={'ContactId':_0x1924e6['id'],'WhatsappAccountId':_0x5a03b1['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0xe65f('0x5d')]({'where':_0x337718})[_0xe65f('0x24')](function(_0x299300){if(_0x299300){return[_0x299300,![]];}return db['WhatsappInteraction'][_0xe65f('0x5e')](_0x55a7f7)['then'](function(_0x1779a0){return[_0x1779a0,!![]];});});}})['spread'](function(_0x30cf60,_0x53d45e){_0x474d01[_0xe65f('0xaa')]=_0x30cf60[_0xe65f('0x3a')]({'plain':!![]});_0x474d01['interaction'][_0xe65f('0xab')]=![];if(_0x53d45e){if(_0x474d01['account'][_0xe65f('0xac')]){_0x474d01['applications'][_0xe65f('0xad')]({'id':0x0,'priority':_0x474d01[_0xe65f('0x8d')]['length']+0x1,'app':_0xe65f('0xae'),'appdata':_0xe65f('0xaf'),'interval':_0xe65f('0xb0')});}_0x474d01[_0xe65f('0xaa')][_0xe65f('0xab')]=!![];}return db['WhatsappMessage'][_0xe65f('0x5e')]({'phone':_0x474d01[_0xe65f('0x5f')][_0xe65f('0x9a')],'messageId':_0x474d01['body']['messageId'],'body':_0x474d01[_0xe65f('0x5f')]['body'],'WhatsappAccountId':_0x5a03b1['params']['id'],'WhatsappInteractionId':_0x30cf60['id'],'direction':'in','ContactId':_0x30cf60['ContactId'],'AttachmentId':_0x474d01['body'][_0xe65f('0xb1')]});})[_0xe65f('0x24')](function(_0x2b9ae5){_0x474d01['message']=_0x2b9ae5;if(_0x474d01[_0xe65f('0xaa')][_0xe65f('0xb2')]){return db[_0xe65f('0x76')][_0xe65f('0x5d')]({'attributes':['id','name'],'where':{'id':_0x474d01[_0xe65f('0xaa')]['UserId']}})[_0xe65f('0x24')](function(_0x36466d){if(_0x36466d){_0x474d01[_0xe65f('0x8d')][_0xe65f('0xb3')]({'id':0x0,'priority':0x0,'app':_0xe65f('0xb4'),'appdata':_0x36466d[_0xe65f('0x3e')]+','+(_0x474d01['account'][_0xe65f('0xb5')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe65f('0xb6'),_0xe65f('0xb7'),_0x474d01);});}return respondWithRpcPromise(_0xe65f('0xb6'),_0xe65f('0xb7'),_0x474d01);})[_0xe65f('0x24')](function(_0x5aa1f1){if(_0x5aa1f1){var _0x176d64=0xc8;var _0x42a07d=_0xe65f('0xb8');logger[_0xe65f('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x42a07d,_0x176d64,'entity\x20found');logger[_0xe65f('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x42a07d,_0x176d64,_0xe65f('0xb9'),JSON[_0xe65f('0x2a')](_0x5aa1f1));if(_0x474d01[_0xe65f('0x88')][_0xe65f('0x54')]===_0xe65f('0x99')){return _0x4d69ef[_0xe65f('0x2f')](_0x176d64)[_0xe65f('0xba')](_0xe65f('0xbb'),_0xe65f('0xbc'))[_0xe65f('0x82')](_0xe65f('0xbd'));}else{return _0x4d69ef[_0xe65f('0x2f')](_0x176d64)[_0xe65f('0x83')](_0x5aa1f1);}}});})[_0xe65f('0x2d')](handleError(_0x4d69ef,null));};exports[_0xe65f('0x82')]=function(_0x3dc5b3,_0x159a7b,_0x47647f){var _0x3eca67,_0x27f725,_0x33aa80;if(_[_0xe65f('0xa0')](_0x3dc5b3[_0xe65f('0x5f')][_0xe65f('0x5f')])||_0x3dc5b3[_0xe65f('0x5f')]['body']===''){throw new db[(_0xe65f('0x90'))]['ValidationError'](_0xe65f('0xa1'));}if(_['isNil'](_0x3dc5b3[_0xe65f('0x5f')]['to'])){throw new db['Sequelize']['ValidationError'](_0xe65f('0xbe'));}_0x3eca67=_0x3dc5b3[_0xe65f('0x5f')]['to'];return db[_0xe65f('0x42')]['find']({'where':{'id':_0x3dc5b3['params']['id']},'include':[{'model':db[_0xe65f('0xa5')],'as':_0xe65f('0xbf'),'include':[{'model':db[_0xe65f('0x8f')],'as':'Contacts','where':{'mobile':_0x3eca67},'limit':0x1,'order':[[_0xe65f('0x95'),'DESC']]}]}]})[_0xe65f('0x24')](handleEntityNotFound(_0x159a7b,null))['then'](function(_0x315e68){if(_0x315e68&&_0x315e68['List']){_0x27f725=_0x315e68[_0xe65f('0x3a')]({'plain':!![]});if(_0x27f725[_0xe65f('0xbf')]&&_0x27f725[_0xe65f('0xbf')][_0xe65f('0xa6')][_0xe65f('0x4b')]){return _0x27f725[_0xe65f('0xbf')][_0xe65f('0xa6')][0x0];}return db['CmContact'][_0xe65f('0x5e')](_[_0xe65f('0x1b')](_0x3dc5b3[_0xe65f('0x5f')],{'firstName':_0x3eca67,'mobile':_0x3eca67,'phone':_0x3eca67,'ListId':_0x27f725['ListId']}));}})[_0xe65f('0x24')](handleEntityNotFound(_0x159a7b,null))[_0xe65f('0x24')](function(_0xd5725f){if(_0xd5725f){_0x33aa80=_0xd5725f;return db[_0xe65f('0xc0')]['find']({'where':{'ContactId':_0x33aa80['id'],'closed':![],'WhatsappAccountId':_0x27f725['id']}})['then'](function(_0x19747f){if(_0x19747f){return[_0x19747f,![]];}return db[_0xe65f('0xc0')][_0xe65f('0x5e')]({'UserId':_0x3dc5b3[_0xe65f('0x60')]['id'],'ContactId':_0x33aa80['id'],'WhatsappAccountId':_0x27f725['id'],'phone':_0x3eca67,'firstMsgDirection':_0xe65f('0xc1'),'Messages':[_['merge'](_0x3dc5b3[_0xe65f('0x5f')],{'read':![],'body':_0x3dc5b3['body']['body'],'phone':_0x3eca67,'WhatsappAccountId':_0x27f725['id'],'UserId':_0x3dc5b3[_0xe65f('0x60')]['id'],'ContactId':_0x33aa80['id']})]},{'include':[{'model':db[_0xe65f('0xc2')],'as':_0xe65f('0xc3')}]})[_0xe65f('0x24')](function(_0x54140a){return[_0x54140a,!![]];});});}})[_0xe65f('0x71')](function(_0x92f7b3,_0x32cf33){if(_0x32cf33){return _0x92f7b3;}return db['WhatsappMessage'][_0xe65f('0x5e')](_[_0xe65f('0x53')](_0x3dc5b3['body'],{'read':![],'body':_0x3dc5b3['body'][_0xe65f('0x5f')],'phone':_0x3eca67,'WhatsappAccountId':_0x27f725['id'],'WhatsappInteractionId':_0x92f7b3['id'],'UserId':_0x3dc5b3[_0xe65f('0x60')]['id'],'ContactId':_0x33aa80['id']}))[_0xe65f('0x24')](function(_0x45b95f){_0x92f7b3[_0xe65f('0xc4')][_0xe65f('0xc3')]=[];_0x92f7b3[_0xe65f('0xc4')][_0xe65f('0xc3')][_0xe65f('0xad')](_0x45b95f[_0xe65f('0xc4')]);return _0x92f7b3;});})[_0xe65f('0x24')](respondWithResult(_0x159a7b,null))['catch'](handleError(_0x159a7b,null));}; \ No newline at end of file +var _0x5caa=['List','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','./whatsappAccount.socket','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','send','index','mandatoryDispositionPause','rawAttributes','key','map','keys','query','filters','model','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','rows','show','intersection','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','addDisposition','WhatsappAccountId','Disposition','findOne','hasOwnProperty','nolimit','order','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','stack','finally','getApplications','notify','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','From','replace','Body','messageId','MessageSid','notifications','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','omit','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','entity\x20found','text/xml','\x0a','to\x20is\x20mandatory'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5caa,0x187));var _0xa5ca=function(_0x3c8f26,_0x453699){_0x3c8f26=_0x3c8f26-0x0;var _0x5a4dd7=_0x5caa[_0x3c8f26];return _0x5a4dd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5ca('0x0'));var zipdir=require(_0xa5ca('0x1'));var jsonpatch=require(_0xa5ca('0x2'));var rp=require(_0xa5ca('0x3'));var moment=require('moment');var BPromise=require(_0xa5ca('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ca('0x5'));var sox=require('sox');var csv=require(_0xa5ca('0x6'));var ejs=require(_0xa5ca('0x7'));var fs=require('fs');var fs_extra=require(_0xa5ca('0x8'));var _=require(_0xa5ca('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa5ca('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa5ca('0xb'));var Papa=require('papaparse');var Redis=require(_0xa5ca('0xc'));var authService=require(_0xa5ca('0xd'));var qs=require(_0xa5ca('0xe'));var as=require(_0xa5ca('0xf'));var hardwareService=require(_0xa5ca('0x10'));var logger=require(_0xa5ca('0x11'))(_0xa5ca('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa5ca('0x13'))['db'];config[_0xa5ca('0x14')]=_['defaults'](config[_0xa5ca('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5ca('0x14')]));require(_0xa5ca('0x15'))['register'](socket);var jayson=require(_0xa5ca('0x16'));var client=jayson[_0xa5ca('0x17')][_0xa5ca('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x5f4950,_0x2ab413,_0x5c3496,_0x5efcaa){return new BPromise(function(_0x254df5,_0x3e5e1f){var _0x242306=_0x5efcaa||client;return _0x242306['request'](_0x5f4950,_0x5c3496)[_0xa5ca('0x19')](function(_0x4dce8e){logger[_0xa5ca('0x1a')](_0xa5ca('0x1b'),_0x2ab413,_0xa5ca('0x1c'));logger[_0xa5ca('0x1d')](_0xa5ca('0x1e'),_0x2ab413,_0xa5ca('0x1c'),JSON[_0xa5ca('0x1f')](_0x4dce8e));if(_0x4dce8e[_0xa5ca('0x20')]){if(_0x4dce8e[_0xa5ca('0x20')][_0xa5ca('0x21')]===0x1f4){logger[_0xa5ca('0x20')](_0xa5ca('0x1b'),_0x2ab413,_0x4dce8e[_0xa5ca('0x20')][_0xa5ca('0x22')]);return _0x3e5e1f(_0x4dce8e[_0xa5ca('0x20')][_0xa5ca('0x22')]);}logger[_0xa5ca('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x2ab413,_0x4dce8e[_0xa5ca('0x20')][_0xa5ca('0x22')]);return _0x254df5(_0x4dce8e[_0xa5ca('0x20')][_0xa5ca('0x22')]);}else{logger[_0xa5ca('0x1a')](_0xa5ca('0x1b'),_0x2ab413,_0xa5ca('0x1c'));_0x254df5(_0x4dce8e['result'][_0xa5ca('0x22')]);}})[_0xa5ca('0x23')](function(_0x33a97d){logger[_0xa5ca('0x20')](_0xa5ca('0x1b'),_0x2ab413,_0x33a97d);_0x3e5e1f(_0x33a97d);});});}function respondWithStatusCode(_0x26c2b0,_0x3f8ea1){_0x3f8ea1=_0x3f8ea1||0xcc;return function(_0x2a8d34){if(_0x2a8d34){return _0x26c2b0['sendStatus'](_0x3f8ea1);}return _0x26c2b0[_0xa5ca('0x24')](_0x3f8ea1)[_0xa5ca('0x25')]();};}function respondWithResult(_0x553e5b,_0xa89c94){_0xa89c94=_0xa89c94||0xc8;return function(_0x80eaa0){if(_0x80eaa0){return _0x553e5b[_0xa5ca('0x24')](_0xa89c94)['json'](_0x80eaa0);}};}function respondWithFilteredResult(_0x5f32f4,_0x584b9f){return function(_0x553d8e){if(_0x553d8e){var _0x345663=typeof _0x584b9f[_0xa5ca('0x26')]==='undefined'&&typeof _0x584b9f[_0xa5ca('0x27')]===_0xa5ca('0x28');var _0x18ee9f=_0x553d8e[_0xa5ca('0x29')];var _0x3bb61e=_0x345663?0x0:_0x584b9f[_0xa5ca('0x26')];var _0x5da624=_0x345663?_0x553d8e['count']:_0x584b9f[_0xa5ca('0x26')]+_0x584b9f[_0xa5ca('0x27')];var _0x14097a;if(_0x5da624>=_0x18ee9f){_0x5da624=_0x18ee9f;_0x14097a=0xc8;}else{_0x14097a=0xce;}_0x5f32f4[_0xa5ca('0x24')](_0x14097a);return _0x5f32f4['set'](_0xa5ca('0x2a'),_0x3bb61e+'-'+_0x5da624+'/'+_0x18ee9f)[_0xa5ca('0x2b')](_0x553d8e);}return null;};}function patchUpdates(_0x52944e){return function(_0x5d1dd8){try{jsonpatch[_0xa5ca('0x2c')](_0x5d1dd8,_0x52944e,!![]);}catch(_0x54ad67){return BPromise[_0xa5ca('0x2d')](_0x54ad67);}return _0x5d1dd8[_0xa5ca('0x2e')]();};}function saveUpdates(_0x5940a0,_0x398afc){return function(_0x2e2c6e){if(_0x2e2c6e){return _0x2e2c6e[_0xa5ca('0x2f')](_0x5940a0)['then'](function(_0x9a0026){return _0x9a0026;});}return null;};}function removeEntity(_0x10241b,_0x569f95){return function(_0x240a09){if(_0x240a09){return _0x240a09[_0xa5ca('0x30')]()[_0xa5ca('0x19')](function(){var _0x2eeec6=_0x240a09[_0xa5ca('0x31')]({'plain':!![]});var _0x12b430=_0xa5ca('0x32');return db[_0xa5ca('0x33')][_0xa5ca('0x30')]({'where':{'type':_0x12b430,'resourceId':_0x2eeec6['id']}})['then'](function(){return _0x240a09;});})['then'](function(){_0x10241b[_0xa5ca('0x24')](0xcc)[_0xa5ca('0x25')]();});}};}function handleEntityNotFound(_0x44a854,_0x377fbd){return function(_0x29c376){if(!_0x29c376){_0x44a854[_0xa5ca('0x34')](0x194);}return _0x29c376;};}function handleError(_0x5deff2,_0x3273b6){_0x3273b6=_0x3273b6||0x1f4;return function(_0x52f490){logger[_0xa5ca('0x20')](_0x52f490['stack']);if(_0x52f490['name']){delete _0x52f490[_0xa5ca('0x35')];}_0x5deff2['status'](_0x3273b6)[_0xa5ca('0x36')](_0x52f490);};}exports[_0xa5ca('0x37')]=function(_0x4f5aaf,_0x53685b){var _0x8c06a2={'include':[{'model':db['Pause'],'as':_0xa5ca('0x38')}]},_0x1fb87c={},_0x364e05={'count':0x0,'rows':[]};var _0xe60dfe=_['map'](db['WhatsappAccount'][_0xa5ca('0x39')],function(_0x5de0f0){return{'name':_0x5de0f0['fieldName'],'type':_0x5de0f0['type'][_0xa5ca('0x3a')]};});_0x1fb87c['model']=_[_0xa5ca('0x3b')](_0xe60dfe,_0xa5ca('0x35'));_0x1fb87c['query']=_[_0xa5ca('0x3c')](_0x4f5aaf[_0xa5ca('0x3d')]);_0x1fb87c[_0xa5ca('0x3e')]=_['intersection'](_0x1fb87c[_0xa5ca('0x3f')],_0x1fb87c[_0xa5ca('0x3d')]);_0x8c06a2[_0xa5ca('0x40')]=_['intersection'](_0x1fb87c['model'],qs[_0xa5ca('0x41')](_0x4f5aaf[_0xa5ca('0x3d')]['fields']));_0x8c06a2[_0xa5ca('0x40')]=_0x8c06a2[_0xa5ca('0x40')][_0xa5ca('0x42')]?_0x8c06a2[_0xa5ca('0x40')]:_0x1fb87c['model'];if(!_0x4f5aaf[_0xa5ca('0x3d')]['hasOwnProperty']('nolimit')){_0x8c06a2[_0xa5ca('0x27')]=qs['limit'](_0x4f5aaf[_0xa5ca('0x3d')][_0xa5ca('0x27')]);_0x8c06a2[_0xa5ca('0x26')]=qs[_0xa5ca('0x26')](_0x4f5aaf[_0xa5ca('0x3d')][_0xa5ca('0x26')]);}_0x8c06a2['order']=qs[_0xa5ca('0x43')](_0x4f5aaf['query'][_0xa5ca('0x43')]);_0x8c06a2[_0xa5ca('0x44')]=qs[_0xa5ca('0x3e')](_['pick'](_0x4f5aaf['query'],_0x1fb87c[_0xa5ca('0x3e')]),_0xe60dfe);if(_0x4f5aaf[_0xa5ca('0x3d')][_0xa5ca('0x45')]){_0x8c06a2[_0xa5ca('0x44')]=_[_0xa5ca('0x46')](_0x8c06a2[_0xa5ca('0x44')],{'$or':_[_0xa5ca('0x3b')](_0xe60dfe,function(_0x4198e0){if(_0x4198e0['type']!==_0xa5ca('0x47')){var _0x58527b={};_0x58527b[_0x4198e0[_0xa5ca('0x35')]]={'$like':'%'+_0x4f5aaf[_0xa5ca('0x3d')][_0xa5ca('0x45')]+'%'};return _0x58527b;}})});}_0x8c06a2=_[_0xa5ca('0x46')]({},_0x8c06a2,_0x4f5aaf[_0xa5ca('0x48')]);var _0x5b84e5={'where':_0x8c06a2[_0xa5ca('0x44')]};return db[_0xa5ca('0x49')][_0xa5ca('0x29')](_0x5b84e5)[_0xa5ca('0x19')](function(_0x534b0f){_0x364e05[_0xa5ca('0x29')]=_0x534b0f;if(_0x4f5aaf[_0xa5ca('0x3d')][_0xa5ca('0x4a')]){_0x8c06a2[_0xa5ca('0x4b')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xa5ca('0x4c')](_0x8c06a2);})[_0xa5ca('0x19')](function(_0x4eddc2){_0x364e05[_0xa5ca('0x4d')]=_0x4eddc2;return _0x364e05;})[_0xa5ca('0x19')](respondWithFilteredResult(_0x53685b,_0x8c06a2))['catch'](handleError(_0x53685b,null));};exports[_0xa5ca('0x4e')]=function(_0x3c5cc3,_0x53e091){var _0x57c9e6={'raw':![],'where':{'id':_0x3c5cc3['params']['id']},'include':[{'model':db['Pause'],'as':_0xa5ca('0x38')}]},_0x587722={};_0x587722[_0xa5ca('0x3f')]=_[_0xa5ca('0x3c')](db[_0xa5ca('0x49')][_0xa5ca('0x39')]);_0x587722[_0xa5ca('0x3d')]=_[_0xa5ca('0x3c')](_0x3c5cc3['query']);_0x587722[_0xa5ca('0x3e')]=_[_0xa5ca('0x4f')](_0x587722['model'],_0x587722[_0xa5ca('0x3d')]);_0x57c9e6[_0xa5ca('0x40')]=_['intersection'](_0x587722[_0xa5ca('0x3f')],qs['fields'](_0x3c5cc3[_0xa5ca('0x3d')][_0xa5ca('0x41')]));_0x57c9e6[_0xa5ca('0x40')]=_0x57c9e6['attributes']['length']?_0x57c9e6[_0xa5ca('0x40')]:_0x587722['model'];if(_0x3c5cc3[_0xa5ca('0x3d')][_0xa5ca('0x4a')]){_0x57c9e6[_0xa5ca('0x4b')]=[{'all':!![]}];}_0x57c9e6=_[_0xa5ca('0x46')]({},_0x57c9e6,_0x3c5cc3[_0xa5ca('0x48')]);return db[_0xa5ca('0x49')][_0xa5ca('0x50')](_0x57c9e6)[_0xa5ca('0x19')](handleEntityNotFound(_0x53e091,null))[_0xa5ca('0x19')](respondWithResult(_0x53e091,null))[_0xa5ca('0x23')](handleError(_0x53e091,null));};exports[_0xa5ca('0x51')]=function(_0x3cde20,_0x5c74a0){return db[_0xa5ca('0x49')]['create'](_0x3cde20[_0xa5ca('0x52')],{})['then'](function(_0xde325a){var _0x4fd052=_0x3cde20[_0xa5ca('0x53')][_0xa5ca('0x31')]({'plain':!![]});if(!_0x4fd052)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fd052[_0xa5ca('0x54')]===_0xa5ca('0x53')){var _0x18d726=_0xde325a[_0xa5ca('0x31')]({'plain':!![]});var _0x2077ac='WhatsappAccounts';return db[_0xa5ca('0x55')][_0xa5ca('0x50')]({'where':{'name':_0x2077ac,'userProfileId':_0x4fd052[_0xa5ca('0x56')]},'raw':!![]})[_0xa5ca('0x19')](function(_0x39d7ff){if(_0x39d7ff&&_0x39d7ff[_0xa5ca('0x57')]===0x0){return db[_0xa5ca('0x33')][_0xa5ca('0x51')]({'name':_0x18d726['name'],'resourceId':_0x18d726['id'],'type':_0x39d7ff[_0xa5ca('0x35')],'sectionId':_0x39d7ff['id']},{})[_0xa5ca('0x19')](function(){return _0xde325a;});}else{return _0xde325a;}})['catch'](function(_0x425d45){logger['error'](_0xa5ca('0x58'),_0x425d45);throw _0x425d45;});}return _0xde325a;})[_0xa5ca('0x19')](respondWithResult(_0x5c74a0,0xc9))[_0xa5ca('0x23')](handleError(_0x5c74a0,null));};exports[_0xa5ca('0x2f')]=function(_0x41fc4c,_0x33f73e){if(_0x41fc4c[_0xa5ca('0x52')]['id']){delete _0x41fc4c[_0xa5ca('0x52')]['id'];}return db['WhatsappAccount'][_0xa5ca('0x50')]({'where':{'id':_0x41fc4c[_0xa5ca('0x59')]['id']},'include':[{'model':db[_0xa5ca('0x5a')],'as':_0xa5ca('0x38')}]})[_0xa5ca('0x19')](handleEntityNotFound(_0x33f73e,null))[_0xa5ca('0x19')](saveUpdates(_0x41fc4c[_0xa5ca('0x52')],null))[_0xa5ca('0x19')](respondWithResult(_0x33f73e,null))['catch'](handleError(_0x33f73e,null));};exports[_0xa5ca('0x30')]=function(_0x5e4c7b,_0x35f7fb){return db['WhatsappAccount']['find']({'where':{'id':_0x5e4c7b['params']['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x35f7fb,null))[_0xa5ca('0x19')](removeEntity(_0x35f7fb,null))['catch'](handleError(_0x35f7fb,null));};exports[_0xa5ca('0x5b')]=function(_0x35569a,_0x2a30fb){return db[_0xa5ca('0x49')][_0xa5ca('0x5b')]()[_0xa5ca('0x19')](respondWithResult(_0x2a30fb,null))[_0xa5ca('0x23')](handleError(_0x2a30fb,null));};exports[_0xa5ca('0x5c')]=function(_0x5a5a77,_0x30867e,_0x2bd89b){if(_0x5a5a77[_0xa5ca('0x52')]['id']){delete _0x5a5a77['body']['id'];}return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x5a5a77[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x30867e,null))[_0xa5ca('0x19')](function(_0x1cc710){if(_0x1cc710){_0x5a5a77[_0xa5ca('0x52')][_0xa5ca('0x5d')]=_0x1cc710['id'];return db[_0xa5ca('0x5e')][_0xa5ca('0x51')](_0x5a5a77[_0xa5ca('0x52')]);}})[_0xa5ca('0x19')](respondWithResult(_0x30867e,null))[_0xa5ca('0x23')](handleError(_0x30867e,null));};exports['getDispositions']=function(_0x1b86e9,_0x1e1a1a,_0x134a49){var _0x487e57={'raw':![],'where':{}};var _0x5779b1={};var _0x5c28c8={'count':0x0,'rows':[]};return db[_0xa5ca('0x49')][_0xa5ca('0x5f')]({'where':{'id':_0x1b86e9[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x1e1a1a,null))[_0xa5ca('0x19')](function(_0x4a7546){if(_0x4a7546){_0x5779b1[_0xa5ca('0x3f')]=_[_0xa5ca('0x3c')](db[_0xa5ca('0x5e')][_0xa5ca('0x39')]);_0x5779b1[_0xa5ca('0x3d')]=_['keys'](_0x1b86e9[_0xa5ca('0x3d')]);_0x5779b1['filters']=_[_0xa5ca('0x4f')](_0x5779b1[_0xa5ca('0x3f')],_0x5779b1[_0xa5ca('0x3d')]);_0x487e57[_0xa5ca('0x40')]=_[_0xa5ca('0x4f')](_0x5779b1[_0xa5ca('0x3f')],qs[_0xa5ca('0x41')](_0x1b86e9[_0xa5ca('0x3d')]['fields']));_0x487e57['attributes']=_0x487e57[_0xa5ca('0x40')]['length']?_0x487e57[_0xa5ca('0x40')]:_0x5779b1['model'];if(!_0x1b86e9['query'][_0xa5ca('0x60')](_0xa5ca('0x61'))){_0x487e57[_0xa5ca('0x27')]=qs[_0xa5ca('0x27')](_0x1b86e9[_0xa5ca('0x3d')][_0xa5ca('0x27')]);_0x487e57[_0xa5ca('0x26')]=qs[_0xa5ca('0x26')](_0x1b86e9[_0xa5ca('0x3d')][_0xa5ca('0x26')]);}_0x487e57[_0xa5ca('0x62')]=qs['sort'](_0x1b86e9[_0xa5ca('0x3d')][_0xa5ca('0x43')]);_0x487e57[_0xa5ca('0x44')]=qs[_0xa5ca('0x3e')](_[_0xa5ca('0x63')](_0x1b86e9[_0xa5ca('0x3d')],_0x5779b1['filters']));_0x487e57['where'][_0xa5ca('0x5d')]=_0x4a7546['id'];if(_0x1b86e9['query'][_0xa5ca('0x45')]){_0x487e57[_0xa5ca('0x44')]=_['merge'](_0x487e57[_0xa5ca('0x44')],{'$or':_[_0xa5ca('0x3b')](_0x487e57['attributes'],function(_0xcc755b){var _0x8438a6={};_0x8438a6[_0xcc755b]={'$like':'%'+_0x1b86e9['query'][_0xa5ca('0x45')]+'%'};return _0x8438a6;})});}_0x487e57=_[_0xa5ca('0x46')]({},_0x487e57,_0x1b86e9[_0xa5ca('0x48')]);return db['Disposition'][_0xa5ca('0x29')]({'where':_0x487e57[_0xa5ca('0x44')]})[_0xa5ca('0x19')](function(_0x34a980){_0x5c28c8['count']=_0x34a980;if(_0x1b86e9['query'][_0xa5ca('0x4a')]){_0x487e57[_0xa5ca('0x4b')]=[{'all':!![]}];}return db[_0xa5ca('0x5e')]['findAll'](_0x487e57);})[_0xa5ca('0x19')](function(_0x15dc5e){_0x5c28c8[_0xa5ca('0x4d')]=_0x15dc5e;return _0x5c28c8;});}})['then'](respondWithFilteredResult(_0x1e1a1a,_0x487e57))[_0xa5ca('0x23')](handleError(_0x1e1a1a,null));};exports['removeDispositions']=function(_0xb7af50,_0x92fc8c,_0x30bcc4){return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0xb7af50[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x92fc8c,null))[_0xa5ca('0x19')](function(_0x236ad7){if(_0x236ad7){return _0x236ad7[_0xa5ca('0x64')](_0xb7af50[_0xa5ca('0x3d')]['ids']);}})[_0xa5ca('0x19')](respondWithStatusCode(_0x92fc8c,null))['catch'](handleError(_0x92fc8c,null));};exports[_0xa5ca('0x65')]=function(_0x31f7ab,_0xb19c4d,_0xccc1ac){if(_0x31f7ab[_0xa5ca('0x52')]['id']){delete _0x31f7ab[_0xa5ca('0x52')]['id'];}return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x31f7ab[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0xb19c4d,null))[_0xa5ca('0x19')](function(_0x57df91){if(_0x57df91){_0x31f7ab['body'][_0xa5ca('0x5d')]=_0x57df91['id'];return db[_0xa5ca('0x66')][_0xa5ca('0x51')](_0x31f7ab[_0xa5ca('0x52')]);}})[_0xa5ca('0x19')](respondWithResult(_0xb19c4d,null))[_0xa5ca('0x23')](handleError(_0xb19c4d,null));};exports[_0xa5ca('0x67')]=function(_0x71c18d,_0x4adb01,_0x35de18){var _0x5165b5={'raw':![],'where':{}};var _0x2d6a72={};var _0xc43f4e={'count':0x0,'rows':[]};return db[_0xa5ca('0x49')][_0xa5ca('0x5f')]({'where':{'id':_0x71c18d['params']['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x4adb01,null))[_0xa5ca('0x19')](function(_0x5bb90e){if(_0x5bb90e){_0x2d6a72['model']=_[_0xa5ca('0x3c')](db[_0xa5ca('0x66')][_0xa5ca('0x39')]);_0x2d6a72[_0xa5ca('0x3d')]=_['keys'](_0x71c18d[_0xa5ca('0x3d')]);_0x2d6a72[_0xa5ca('0x3e')]=_['intersection'](_0x2d6a72['model'],_0x2d6a72[_0xa5ca('0x3d')]);_0x5165b5['attributes']=_[_0xa5ca('0x4f')](_0x2d6a72[_0xa5ca('0x3f')],qs[_0xa5ca('0x41')](_0x71c18d[_0xa5ca('0x3d')][_0xa5ca('0x41')]));_0x5165b5[_0xa5ca('0x40')]=_0x5165b5['attributes']['length']?_0x5165b5['attributes']:_0x2d6a72[_0xa5ca('0x3f')];if(!_0x71c18d[_0xa5ca('0x3d')]['hasOwnProperty']('nolimit')){_0x5165b5[_0xa5ca('0x27')]=qs['limit'](_0x71c18d['query']['limit']);_0x5165b5[_0xa5ca('0x26')]=qs[_0xa5ca('0x26')](_0x71c18d[_0xa5ca('0x3d')][_0xa5ca('0x26')]);}_0x5165b5[_0xa5ca('0x62')]=qs[_0xa5ca('0x43')](_0x71c18d[_0xa5ca('0x3d')][_0xa5ca('0x43')]);_0x5165b5[_0xa5ca('0x44')]=qs[_0xa5ca('0x3e')](_['pick'](_0x71c18d[_0xa5ca('0x3d')],_0x2d6a72[_0xa5ca('0x3e')]));_0x5165b5[_0xa5ca('0x44')][_0xa5ca('0x5d')]=_0x5bb90e['id'];if(_0x71c18d[_0xa5ca('0x3d')][_0xa5ca('0x45')]){_0x5165b5['where']=_[_0xa5ca('0x46')](_0x5165b5[_0xa5ca('0x44')],{'$or':_[_0xa5ca('0x3b')](_0x5165b5['attributes'],function(_0xb9fd6a){var _0x36dff3={};_0x36dff3[_0xb9fd6a]={'$like':'%'+_0x71c18d[_0xa5ca('0x3d')]['filter']+'%'};return _0x36dff3;})});}_0x5165b5=_[_0xa5ca('0x46')]({},_0x5165b5,_0x71c18d[_0xa5ca('0x48')]);return db['CannedAnswer']['count']({'where':_0x5165b5[_0xa5ca('0x44')]})[_0xa5ca('0x19')](function(_0x5cb51d){_0xc43f4e[_0xa5ca('0x29')]=_0x5cb51d;if(_0x71c18d[_0xa5ca('0x3d')]['includeAll']){_0x5165b5[_0xa5ca('0x4b')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5165b5);})[_0xa5ca('0x19')](function(_0x375acc){_0xc43f4e[_0xa5ca('0x4d')]=_0x375acc;return _0xc43f4e;});}})[_0xa5ca('0x19')](respondWithFilteredResult(_0x4adb01,_0x5165b5))[_0xa5ca('0x23')](handleError(_0x4adb01,null));};exports[_0xa5ca('0x68')]=function(_0x5e4a4a,_0x3796d6,_0x291962){return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x5e4a4a[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x3796d6,null))[_0xa5ca('0x19')](function(_0x1638ac){if(_0x1638ac){return _0x1638ac[_0xa5ca('0x68')](_0x5e4a4a[_0xa5ca('0x3d')][_0xa5ca('0x69')]);}})[_0xa5ca('0x19')](respondWithStatusCode(_0x3796d6,null))['catch'](handleError(_0x3796d6,null));};exports[_0xa5ca('0x6a')]=function(_0x28e010,_0x590e11,_0x1d98db){return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x28e010[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x590e11,null))[_0xa5ca('0x19')](function(_0x43b0f6){if(_0x43b0f6){return _0x43b0f6[_0xa5ca('0x6a')](_0x28e010[_0xa5ca('0x52')][_0xa5ca('0x69')],_['omit'](_0x28e010['body'],[_0xa5ca('0x69'),'id'])||{})[_0xa5ca('0x6b')](function(_0x1bf4ac){for(var _0x273238=0x0;_0x273238<_0x28e010[_0xa5ca('0x52')]['ids'][_0xa5ca('0x42')];_0x273238+=0x1){socket[_0xa5ca('0x6c')](_0xa5ca('0x6d'),{'UserId':Number(_0x28e010[_0xa5ca('0x52')][_0xa5ca('0x69')][_0x273238]),'WhatsappAccountId':Number(_0x28e010[_0xa5ca('0x59')]['id'])});}return _0x1bf4ac;});}})[_0xa5ca('0x19')](respondWithResult(_0x590e11,null))[_0xa5ca('0x23')](handleError(_0x590e11,null));};exports['removeAgents']=function(_0x5eb9a6,_0x769bef,_0x159804){return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x5eb9a6[_0xa5ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x769bef,null))[_0xa5ca('0x19')](function(_0x166be4){if(_0x166be4){return _0x166be4[_0xa5ca('0x6e')](_0x5eb9a6[_0xa5ca('0x3d')]['ids'])[_0xa5ca('0x19')](function(){if(_[_0xa5ca('0x6f')](_0x5eb9a6[_0xa5ca('0x3d')][_0xa5ca('0x69')])){for(var _0x24b5c3=0x0;_0x24b5c3<_0x5eb9a6[_0xa5ca('0x3d')][_0xa5ca('0x69')][_0xa5ca('0x42')];_0x24b5c3+=0x1){socket[_0xa5ca('0x6c')](_0xa5ca('0x70'),{'UserId':Number(_0x5eb9a6[_0xa5ca('0x3d')][_0xa5ca('0x69')][_0x24b5c3]),'WhatsappAccountId':Number(_0x5eb9a6[_0xa5ca('0x59')]['id'])});}}else{socket[_0xa5ca('0x6c')](_0xa5ca('0x70'),{'UserId':Number(_0x5eb9a6['query'][_0xa5ca('0x69')]),'WhatsappAccountId':Number(_0x5eb9a6[_0xa5ca('0x59')]['id'])});}});}})[_0xa5ca('0x19')](respondWithStatusCode(_0x769bef,null))[_0xa5ca('0x23')](handleError(_0x769bef,null));};exports['getAgents']=function(_0x1b9153,_0x2e2ab7,_0x285e3b){var _0x1913dd={};var _0x39ae31={};var _0xcd690a;var _0x474ee0;return db[_0xa5ca('0x49')][_0xa5ca('0x5f')]({'where':{'id':_0x1b9153[_0xa5ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e2ab7,null))[_0xa5ca('0x19')](function(_0x1ec40f){if(_0x1ec40f){_0xcd690a=_0x1ec40f;_0x39ae31[_0xa5ca('0x3f')]=_[_0xa5ca('0x3c')](db[_0xa5ca('0x71')][_0xa5ca('0x39')]);_0x39ae31[_0xa5ca('0x3d')]=_[_0xa5ca('0x3c')](_0x1b9153['query']);_0x39ae31['filters']=_[_0xa5ca('0x4f')](_0x39ae31[_0xa5ca('0x3f')],_0x39ae31[_0xa5ca('0x3d')]);_0x1913dd[_0xa5ca('0x40')]=_['intersection'](_0x39ae31[_0xa5ca('0x3f')],qs[_0xa5ca('0x41')](_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x41')]));_0x1913dd['attributes']=_0x1913dd[_0xa5ca('0x40')][_0xa5ca('0x42')]?_0x1913dd[_0xa5ca('0x40')]:_0x39ae31[_0xa5ca('0x3f')];_0x1913dd['order']=qs[_0xa5ca('0x43')](_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x43')]);_0x1913dd[_0xa5ca('0x44')]=qs['filters'](_[_0xa5ca('0x63')](_0x1b9153[_0xa5ca('0x3d')],_0x39ae31[_0xa5ca('0x3e')]));if(_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x45')]){_0x1913dd[_0xa5ca('0x44')]=_[_0xa5ca('0x46')](_0x1913dd[_0xa5ca('0x44')],{'$or':_[_0xa5ca('0x3b')](_0x1913dd[_0xa5ca('0x40')],function(_0x1ad42a){var _0x4f39d3={};_0x4f39d3[_0x1ad42a]={'$like':'%'+_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x45')]+'%'};return _0x4f39d3;})});}_0x1913dd=_[_0xa5ca('0x46')]({},_0x1913dd,_0x1b9153['options']);return _0xcd690a['getAgents'](_0x1913dd);}})[_0xa5ca('0x19')](function(_0x4216ef){if(_0x4216ef){_0x474ee0=_0x4216ef[_0xa5ca('0x42')];if(!_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x60')](_0xa5ca('0x61'))){_0x1913dd['limit']=qs[_0xa5ca('0x27')](_0x1b9153['query'][_0xa5ca('0x27')]);_0x1913dd['offset']=qs[_0xa5ca('0x26')](_0x1b9153[_0xa5ca('0x3d')][_0xa5ca('0x26')]);}return _0xcd690a[_0xa5ca('0x72')](_0x1913dd);}})['then'](function(_0x5beb40){if(_0x5beb40){return _0x5beb40?{'count':_0x474ee0,'rows':_0x5beb40}:null;}})[_0xa5ca('0x19')](respondWithResult(_0x2e2ab7,null))[_0xa5ca('0x23')](handleError(_0x2e2ab7,null));};exports[_0xa5ca('0x73')]=function(_0x35c7ce,_0x1580e9){var _0x31f8a5=_0x35c7ce['params']['id'];var _0x3d1398=_0x35c7ce[_0xa5ca('0x52')];var _0x57174f=0xc8;var _0xaebb0e=null;return db['sequelize'][_0xa5ca('0x74')]({'isolationLevel':db['sequelize'][_0xa5ca('0x75')][_0xa5ca('0x76')][_0xa5ca('0x77')]},function(_0x5cf3df){return db[_0xa5ca('0x49')][_0xa5ca('0x5f')]({'where':{'id':_0x31f8a5},'transaction':_0x5cf3df})['then'](function(_0x71c59f){if(_0x71c59f){return db[_0xa5ca('0x78')][_0xa5ca('0x30')]({'where':{'WhatsappAccountId':_0x31f8a5},'transaction':_0x5cf3df})[_0xa5ca('0x19')](function(){var _0x2ae5b6=_[_0xa5ca('0x3b')](_0x3d1398,function(_0x7a6e65){_0x7a6e65['WhatsappAccountId']=_0x31f8a5;return _0x7a6e65;});return db[_0xa5ca('0x78')]['bulkCreate'](_0x2ae5b6,{'transaction':_0x5cf3df});});}else{_0x57174f=0x194;_0xaebb0e=[];}});})[_0xa5ca('0x19')](function(){if(_0x57174f!==0x194){return db['WhatsappApplication'][_0xa5ca('0x79')]({'where':{'WhatsappAccountId':_0x31f8a5},'order':_0xa5ca('0x7a')})['then'](function(_0x360fca){_0xaebb0e=_0x360fca;});}})[_0xa5ca('0x23')](function(_0x49ff22){_0x57174f=0x1f4;logger[_0xa5ca('0x20')](_0x49ff22[_0xa5ca('0x7b')]);if(_0x49ff22[_0xa5ca('0x35')]){delete _0x49ff22[_0xa5ca('0x35')];}_0xaebb0e=_0x49ff22;})[_0xa5ca('0x7c')](function(){if(_0xaebb0e===null){_0x1580e9[_0xa5ca('0x34')](_0x57174f);}else{if(_0x57174f===0x1f4){_0x1580e9['status'](_0x57174f)[_0xa5ca('0x36')](_0xaebb0e);}else{_0x1580e9[_0xa5ca('0x24')](_0x57174f)[_0xa5ca('0x2b')](_0xaebb0e);}}});};exports[_0xa5ca('0x7d')]=function(_0x56b453,_0x518d70,_0x23adbb){var _0x92bef6={};var _0x34e987={};var _0x1c3ef0;var _0x3995e4;return db[_0xa5ca('0x49')][_0xa5ca('0x5f')]({'where':{'id':_0x56b453[_0xa5ca('0x59')]['id']}})[_0xa5ca('0x19')](handleEntityNotFound(_0x518d70,null))['then'](function(_0x5c4d56){if(_0x5c4d56){_0x1c3ef0=_0x5c4d56;_0x34e987[_0xa5ca('0x3f')]=_[_0xa5ca('0x3c')](db[_0xa5ca('0x78')]['rawAttributes']);_0x34e987[_0xa5ca('0x3d')]=_[_0xa5ca('0x3c')](_0x56b453[_0xa5ca('0x3d')]);_0x34e987['filters']=_[_0xa5ca('0x4f')](_0x34e987[_0xa5ca('0x3f')],_0x34e987['query']);_0x92bef6[_0xa5ca('0x40')]=_['intersection'](_0x34e987['model'],qs[_0xa5ca('0x41')](_0x56b453[_0xa5ca('0x3d')]['fields']));_0x92bef6['attributes']=_0x92bef6[_0xa5ca('0x40')][_0xa5ca('0x42')]?_0x92bef6[_0xa5ca('0x40')]:_0x34e987[_0xa5ca('0x3f')];_0x92bef6[_0xa5ca('0x62')]=qs['sort'](_0x56b453[_0xa5ca('0x3d')][_0xa5ca('0x43')]);_0x92bef6[_0xa5ca('0x44')]=qs[_0xa5ca('0x3e')](_[_0xa5ca('0x63')](_0x56b453[_0xa5ca('0x3d')],_0x34e987[_0xa5ca('0x3e')]));if(_0x56b453[_0xa5ca('0x3d')][_0xa5ca('0x45')]){_0x92bef6['where']=_['merge'](_0x92bef6[_0xa5ca('0x44')],{'$or':_[_0xa5ca('0x3b')](_0x92bef6[_0xa5ca('0x40')],function(_0x423ade){var _0x4210d0={};_0x4210d0[_0x423ade]={'$like':'%'+_0x56b453[_0xa5ca('0x3d')]['filter']+'%'};return _0x4210d0;})});}_0x92bef6=_[_0xa5ca('0x46')]({},_0x92bef6,_0x56b453[_0xa5ca('0x48')]);return _0x1c3ef0[_0xa5ca('0x7d')](_0x92bef6);}})[_0xa5ca('0x19')](function(_0x338bed){if(_0x338bed){_0x3995e4=_0x338bed[_0xa5ca('0x42')];if(!_0x56b453[_0xa5ca('0x3d')][_0xa5ca('0x60')](_0xa5ca('0x61'))){_0x92bef6[_0xa5ca('0x27')]=qs[_0xa5ca('0x27')](_0x56b453[_0xa5ca('0x3d')]['limit']);_0x92bef6['offset']=qs[_0xa5ca('0x26')](_0x56b453['query'][_0xa5ca('0x26')]);}return _0x1c3ef0[_0xa5ca('0x7d')](_0x92bef6);}})['then'](function(_0x5aa671){if(_0x5aa671){return _0x5aa671?{'count':_0x3995e4,'rows':_0x5aa671}:null;}})[_0xa5ca('0x19')](respondWithResult(_0x518d70,null))[_0xa5ca('0x23')](handleError(_0x518d70,null));};exports[_0xa5ca('0x7e')]=function(_0x7e03ff,_0x271586,_0x22e59e){var _0x212346={'channel':'whatsapp'};var _0x225b54=[];var _0x3e977d=[];var _0x420587={};return db[_0xa5ca('0x49')]['find']({'where':{'id':_0x7e03ff[_0xa5ca('0x59')]['id']},'include':[{'model':db[_0xa5ca('0x78')],'as':_0xa5ca('0x7f')}]})[_0xa5ca('0x19')](handleEntityNotFound(_0x271586,null))[_0xa5ca('0x19')](function(_0x3bd84b){_0x212346['account']=_0x3bd84b;if(_0x212346['account']&&_0x212346[_0xa5ca('0x80')]['type']===_0xa5ca('0x81')&&_0x7e03ff['body'][_0xa5ca('0x82')]){if(_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x82')]['length']===0x0)return;if(_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x82')][0x0][_0xa5ca('0x83')]!=='read')return;return db[_0xa5ca('0x84')][_0xa5ca('0x2f')]({'read':!![],'readAt':_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x82')][0x0][_0xa5ca('0x85')]},{'where':{'messageId':_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x82')][0x0][_0xa5ca('0x86')]},'individualHooks':!![]})[_0xa5ca('0x19')](function(_0x3cabe0){return _0x271586[_0xa5ca('0x24')](0xc8)[_0xa5ca('0x2b')](_0x3cabe0);});}_0x212346[_0xa5ca('0x87')]=_[_0xa5ca('0x88')](_0x3bd84b[_0xa5ca('0x7f')],[_0xa5ca('0x7a')],[_0xa5ca('0x89')]);if(_0x212346[_0xa5ca('0x80')][_0xa5ca('0x7f')]){delete _0x212346[_0xa5ca('0x80')][_0xa5ca('0x7f')];}return db['CmContact'][_0xa5ca('0x5b')]()[_0xa5ca('0x19')](function(_0x17df28){if(!_0x17df28){throw new db[(_0xa5ca('0x8a'))][(_0xa5ca('0x8b'))](_0xa5ca('0x8c'));}_0x225b54=_['difference'](_['keys'](_0x17df28),[_0xa5ca('0x8d'),_0xa5ca('0x8e')]);_0x3e977d=_['difference'](_['keys'](_0x17df28),['createdAt',_0xa5ca('0x8e'),_0xa5ca('0x8f'),_0xa5ca('0x90')]);_0x212346[_0xa5ca('0x52')]={'mapKey':_0xa5ca('0x91')};if(_0x212346[_0xa5ca('0x80')]&&_0x212346[_0xa5ca('0x80')][_0xa5ca('0x92')]===_0xa5ca('0x93')){_0x212346[_0xa5ca('0x52')]['from']=_0x7e03ff['body'][_0xa5ca('0x94')][_0xa5ca('0x95')]('whatsapp:','');_0x212346['body'][_0xa5ca('0x52')]=_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x96')];_0x212346[_0xa5ca('0x52')][_0xa5ca('0x97')]=_0x7e03ff['body'][_0xa5ca('0x98')];}if(_0x212346[_0xa5ca('0x80')]&&_0x212346[_0xa5ca('0x80')][_0xa5ca('0x92')]===_0xa5ca('0x81')){_0x212346['body']['from']=_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x99')][0x0]['from'];_0x212346[_0xa5ca('0x52')][_0xa5ca('0x52')]=_0x7e03ff['body'][_0xa5ca('0x99')][0x0][_0xa5ca('0x22')][_0xa5ca('0x52')];_0x212346[_0xa5ca('0x52')]['messageId']=_0x7e03ff[_0xa5ca('0x52')][_0xa5ca('0x99')][0x0][_0xa5ca('0x86')];}if(_0x212346['body']['id']){delete _0x212346['body']['id'];}if(_[_0xa5ca('0x9a')](_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9b')])){throw new db[(_0xa5ca('0x8a'))][(_0xa5ca('0x8b'))](_0xa5ca('0x9c'));}if(_[_0xa5ca('0x9a')](_0x212346[_0xa5ca('0x52')]['body'])||_0x212346[_0xa5ca('0x52')][_0xa5ca('0x52')]===''){throw new db[(_0xa5ca('0x8a'))][(_0xa5ca('0x8b'))](_0xa5ca('0x9d'));}if(_['isNil'](_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9e')])){throw new db[(_0xa5ca('0x8a'))][(_0xa5ca('0x8b'))](_0xa5ca('0x9f')+_0x3e977d);}if(!_[_0xa5ca('0xa0')](_0x3e977d,_0x212346[_0xa5ca('0x52')]['mapKey'])){throw new db['Sequelize'][(_0xa5ca('0x8b'))](_0xa5ca('0xa1')+_0x3e977d);}_0x420587[_0x212346[_0xa5ca('0x52')]['mapKey']]=_0x212346['body'][_0xa5ca('0x9b')];return db[_0xa5ca('0xa2')][_0xa5ca('0x50')]({'where':{'id':_0x212346[_0xa5ca('0x80')][_0xa5ca('0x90')]},'include':[{'model':db[_0xa5ca('0xa3')],'as':'Contacts','where':_0x420587,'limit':0x1,'order':[[_0xa5ca('0x8e'),_0xa5ca('0xa4')]]}]});})[_0xa5ca('0x19')](handleEntityNotFound(_0x271586,null))[_0xa5ca('0x19')](function(_0x5c91d4){if(_0x5c91d4){_0x212346[_0xa5ca('0xa5')]=_[_0xa5ca('0xa6')](_0x5c91d4,[_0xa5ca('0xa7')]);if(_0x5c91d4[_0xa5ca('0xa7')][_0xa5ca('0x42')]){return _0x5c91d4['Contacts'][0x0];}var _0x46d3fc=_[_0xa5ca('0xa8')](_0x212346['body'],{'firstName':_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9b')],'ListId':_0x5c91d4['id']});_0x46d3fc[_0x212346['body']['mapKey']]=_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9b')];return db[_0xa5ca('0xa3')][_0xa5ca('0x51')](_0x46d3fc,{'fields':_0x225b54,'raw':!![]});}})['then'](handleEntityNotFound(_0x271586,null))[_0xa5ca('0x19')](function(_0x4a4260){if(_0x4a4260){_0x212346[_0xa5ca('0xa9')]=_0x4a4260;var _0x25c544={'ContactId':_0x4a4260['id'],'phone':_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9b')],'WhatsappAccountId':_0x7e03ff[_0xa5ca('0x59')]['id']};var _0x3149fe={'ContactId':_0x4a4260['id'],'WhatsappAccountId':_0x7e03ff[_0xa5ca('0x59')]['id'],'closed':![]};return db[_0xa5ca('0xaa')][_0xa5ca('0x50')]({'where':_0x3149fe})[_0xa5ca('0x19')](function(_0x70e917){if(_0x70e917){return[_0x70e917,![]];}return db[_0xa5ca('0xaa')][_0xa5ca('0x51')](_0x25c544)[_0xa5ca('0x19')](function(_0x1da1b5){return[_0x1da1b5,!![]];});});}})[_0xa5ca('0x6b')](function(_0x2d3373,_0x711ab6){_0x212346[_0xa5ca('0xab')]=_0x2d3373['get']({'plain':!![]});_0x212346[_0xa5ca('0xab')][_0xa5ca('0xac')]=![];if(_0x711ab6){if(_0x212346[_0xa5ca('0x80')][_0xa5ca('0xad')]){_0x212346[_0xa5ca('0x87')]['push']({'id':0x0,'priority':_0x212346[_0xa5ca('0x87')][_0xa5ca('0x42')]+0x1,'app':'close','appdata':_0xa5ca('0xae'),'interval':'*,*,*,*'});}_0x212346[_0xa5ca('0xab')]['created']=!![];}return db[_0xa5ca('0x84')][_0xa5ca('0x51')]({'phone':_0x212346[_0xa5ca('0x52')][_0xa5ca('0x9b')],'messageId':_0x212346[_0xa5ca('0x52')][_0xa5ca('0x97')],'body':_0x212346['body']['body'],'WhatsappAccountId':_0x7e03ff['params']['id'],'WhatsappInteractionId':_0x2d3373['id'],'direction':'in','ContactId':_0x2d3373[_0xa5ca('0xaf')],'AttachmentId':_0x212346['body'][_0xa5ca('0xb0')]});})[_0xa5ca('0x19')](function(_0x2d8542){_0x212346[_0xa5ca('0x22')]=_0x2d8542;if(_0x212346[_0xa5ca('0xab')][_0xa5ca('0xb1')]){return db[_0xa5ca('0x71')][_0xa5ca('0x50')]({'attributes':['id',_0xa5ca('0x35')],'where':{'id':_0x212346[_0xa5ca('0xab')]['UserId']}})[_0xa5ca('0x19')](function(_0x3c689e){if(_0x3c689e){_0x212346[_0xa5ca('0x87')][_0xa5ca('0xb2')]({'id':0x0,'priority':0x0,'app':_0xa5ca('0xb3'),'appdata':_0x3c689e[_0xa5ca('0x35')]+','+(_0x212346[_0xa5ca('0x80')][_0xa5ca('0xb4')]||0xa),'interval':_0xa5ca('0xb5')});}return respondWithRpcPromise('Start',_0xa5ca('0xb6'),_0x212346);});}return respondWithRpcPromise(_0xa5ca('0xb7'),_0xa5ca('0xb6'),_0x212346);})[_0xa5ca('0x19')](function(_0x3ff6de){if(_0x3ff6de){var _0x3ec06b=0xc8;var _0x182bcf='receiveMessage';logger['info'](_0xa5ca('0x1e'),_0x182bcf,_0x3ec06b,_0xa5ca('0xb8'));logger[_0xa5ca('0x1d')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x182bcf,_0x3ec06b,_0xa5ca('0xb8'),JSON[_0xa5ca('0x1f')](_0x3ff6de));if(_0x212346[_0xa5ca('0x80')]['type']===_0xa5ca('0x93')){return _0x271586[_0xa5ca('0x24')](_0x3ec06b)['set']('Content-Type',_0xa5ca('0xb9'))['send'](_0xa5ca('0xba'));}else{return _0x271586['status'](_0x3ec06b)[_0xa5ca('0x2b')](_0x3ff6de);}}});})[_0xa5ca('0x23')](handleError(_0x271586,null));};exports['send']=function(_0x4324b8,_0xb1cf59,_0x5d0161){var _0x3b8c50,_0x20a49e,_0x3bac13;if(_[_0xa5ca('0x9a')](_0x4324b8[_0xa5ca('0x52')][_0xa5ca('0x52')])||_0x4324b8[_0xa5ca('0x52')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa5ca('0x9a')](_0x4324b8['body']['to'])){throw new db['Sequelize']['ValidationError'](_0xa5ca('0xbb'));}_0x3b8c50=_0x4324b8[_0xa5ca('0x52')]['to'];return db[_0xa5ca('0x49')][_0xa5ca('0x50')]({'where':{'id':_0x4324b8[_0xa5ca('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xa5ca('0xbc'),'include':[{'model':db[_0xa5ca('0xa3')],'as':_0xa5ca('0xa7'),'where':{'mobile':_0x3b8c50},'limit':0x1,'order':[[_0xa5ca('0x8e'),_0xa5ca('0xa4')]]}]}]})[_0xa5ca('0x19')](handleEntityNotFound(_0xb1cf59,null))[_0xa5ca('0x19')](function(_0x53d3ba){if(_0x53d3ba&&_0x53d3ba[_0xa5ca('0xbc')]){_0x20a49e=_0x53d3ba[_0xa5ca('0x31')]({'plain':!![]});if(_0x20a49e[_0xa5ca('0xbc')]&&_0x20a49e[_0xa5ca('0xbc')]['Contacts'][_0xa5ca('0x42')]){return _0x20a49e[_0xa5ca('0xbc')][_0xa5ca('0xa7')][0x0];}return db['CmContact']['create'](_[_0xa5ca('0xa8')](_0x4324b8['body'],{'firstName':_0x3b8c50,'mobile':_0x3b8c50,'phone':_0x3b8c50,'ListId':_0x20a49e[_0xa5ca('0x90')]}));}})['then'](handleEntityNotFound(_0xb1cf59,null))[_0xa5ca('0x19')](function(_0x3f2146){if(_0x3f2146){_0x3bac13=_0x3f2146;return db[_0xa5ca('0xaa')][_0xa5ca('0x50')]({'where':{'ContactId':_0x3bac13['id'],'closed':![],'WhatsappAccountId':_0x20a49e['id']}})[_0xa5ca('0x19')](function(_0x3a9c8f){if(_0x3a9c8f){return[_0x3a9c8f,![]];}return db['WhatsappInteraction'][_0xa5ca('0x51')]({'UserId':_0x4324b8['user']['id'],'ContactId':_0x3bac13['id'],'WhatsappAccountId':_0x20a49e['id'],'phone':_0x3b8c50,'firstMsgDirection':_0xa5ca('0xbd'),'Messages':[_[_0xa5ca('0x46')](_0x4324b8[_0xa5ca('0x52')],{'read':![],'body':_0x4324b8[_0xa5ca('0x52')][_0xa5ca('0x52')],'phone':_0x3b8c50,'WhatsappAccountId':_0x20a49e['id'],'UserId':_0x4324b8[_0xa5ca('0x53')]['id'],'ContactId':_0x3bac13['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xa5ca('0xbe')}]})[_0xa5ca('0x19')](function(_0x47afe8){return[_0x47afe8,!![]];});});}})[_0xa5ca('0x6b')](function(_0x1661c3,_0x6adcb8){if(_0x6adcb8){return _0x1661c3;}return db[_0xa5ca('0x84')][_0xa5ca('0x51')](_[_0xa5ca('0x46')](_0x4324b8[_0xa5ca('0x52')],{'read':![],'body':_0x4324b8[_0xa5ca('0x52')][_0xa5ca('0x52')],'phone':_0x3b8c50,'WhatsappAccountId':_0x20a49e['id'],'WhatsappInteractionId':_0x1661c3['id'],'UserId':_0x4324b8['user']['id'],'ContactId':_0x3bac13['id']}))[_0xa5ca('0x19')](function(_0x1a1c97){_0x1661c3[_0xa5ca('0xbf')]['Messages']=[];_0x1661c3[_0xa5ca('0xbf')][_0xa5ca('0xbe')][_0xa5ca('0xc0')](_0x1a1c97[_0xa5ca('0xbf')]);return _0x1661c3;});})['then'](respondWithResult(_0xb1cf59,null))[_0xa5ca('0x23')](handleError(_0xb1cf59,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index e865f77..df37923 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 _0xe1f3=['../../mysqldb','WhatsappAccount','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5399aa,_0x474fa1){var _0x1b4654=function(_0x4abcdc){while(--_0x4abcdc){_0x5399aa['push'](_0x5399aa['shift']());}};_0x1b4654(++_0x474fa1);}(_0xe1f3,0x11f));var _0x3e1f=function(_0x255036,_0x4c8d6e){_0x255036=_0x255036-0x0;var _0x15e026=_0xe1f3[_0x255036];return _0x15e026;};'use strict';var EventEmitter=require(_0x3e1f('0x0'));var WhatsappAccount=require(_0x3e1f('0x1'))['db'][_0x3e1f('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e1f('0x3'),'afterDestroy':_0x3e1f('0x4')};function emitEvent(_0xa93900){return function(_0xf370c6,_0x31234c,_0x207c8e){WhatsappAccountEvents[_0x3e1f('0x5')](_0xa93900+':'+_0xf370c6['id'],_0xf370c6);WhatsappAccountEvents[_0x3e1f('0x5')](_0xa93900,_0xf370c6);_0x207c8e(null);};}for(var e in events){if(events[_0x3e1f('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x3e1f('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9b44=['remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x3da2a5,_0x5c5c70){var _0x57bb9e=function(_0x593581){while(--_0x593581){_0x3da2a5['push'](_0x3da2a5['shift']());}};_0x57bb9e(++_0x5c5c70);}(_0x9b44,0x90));var _0x49b4=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x9b44[_0x334fea];return _0x3c5829;};'use strict';var EventEmitter=require(_0x49b4('0x0'));var WhatsappAccount=require(_0x49b4('0x1'))['db'][_0x49b4('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x49b4('0x3')](0x0);var events={'afterCreate':_0x49b4('0x4'),'afterUpdate':_0x49b4('0x5'),'afterDestroy':_0x49b4('0x6')};function emitEvent(_0x5d4ad6){return function(_0x183b0b,_0x1defa0,_0x306a8b){WhatsappAccountEvents['emit'](_0x5d4ad6+':'+_0x183b0b['id'],_0x183b0b);WhatsappAccountEvents[_0x49b4('0x7')](_0x5d4ad6,_0x183b0b);_0x306a8b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x49b4('0x8')](e,emitEvent(event));}}module[_0x49b4('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 938a7c7..5c8bbac 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 _0x79a4=['whatsapp_accounts','util','../../config/logger','moment','../../config/environment','./whatsappAccount.attributes','define'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x79a4,0x19e));var _0x479a=function(_0x1b3e11,_0x15787b){_0x1b3e11=_0x1b3e11-0x0;var _0x564b5a=_0x79a4[_0x1b3e11];return _0x564b5a;};'use strict';var _=require('lodash');var util=require(_0x479a('0x0'));var logger=require(_0x479a('0x1'))('api');var moment=require(_0x479a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x479a('0x3'));var attributes=require(_0x479a('0x4'));module['exports']=function(_0x5c0b9a,_0x303000){return _0x5c0b9a[_0x479a('0x5')]('WhatsappAccount',attributes,{'tableName':_0x479a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e1f=['request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','lodash','util','../../config/logger','moment'];(function(_0x4ab489,_0x4d389d){var _0x16e07b=function(_0x3bb9b2){while(--_0x3bb9b2){_0x4ab489['push'](_0x4ab489['shift']());}};_0x16e07b(++_0x4d389d);}(_0x3e1f,0x96));var _0xf3e1=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x3e1f[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0xf3e1('0x0'));var util=require(_0xf3e1('0x1'));var logger=require(_0xf3e1('0x2'))('api');var moment=require(_0xf3e1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf3e1('0x4'));var fs=require('fs');var path=require(_0xf3e1('0x5'));var rimraf=require('rimraf');var config=require(_0xf3e1('0x6'));var attributes=require(_0xf3e1('0x7'));module[_0xf3e1('0x8')]=function(_0x152ec3,_0x3c2950){return _0x152ec3[_0xf3e1('0x9')]('WhatsappAccount',attributes,{'tableName':_0xf3e1('0xa'),'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 5437137..6bf7152 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 _0x18cb=['raw','include','map','model','attributes','info','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x495110,_0x3a7833){var _0x18707e=function(_0x531fe2){while(--_0x531fe2){_0x495110['push'](_0x495110['shift']());}};_0x18707e(++_0x3a7833);}(_0x18cb,0xe6));var _0xb18c=function(_0x2da0ef,_0x20856b){_0x2da0ef=_0x2da0ef-0x0;var _0x2fdba4=_0x18cb[_0x2da0ef];return _0x2fdba4;};'use strict';var _=require(_0xb18c('0x0'));var util=require(_0xb18c('0x1'));var moment=require(_0xb18c('0x2'));var BPromise=require(_0xb18c('0x3'));var rs=require(_0xb18c('0x4'));var fs=require('fs');var Redis=require(_0xb18c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb18c('0x6'));var logger=require(_0xb18c('0x7'))(_0xb18c('0x8'));var config=require(_0xb18c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb18c('0xa')][_0xb18c('0xb')]({'port':0x232a});config[_0xb18c('0xc')]=_[_0xb18c('0xd')](config[_0xb18c('0xc')],{'host':_0xb18c('0xe'),'port':0x18eb});var socket=require(_0xb18c('0xf'))(new Redis(config[_0xb18c('0xc')]));require(_0xb18c('0x10'))['register'](socket);function respondWithRpcPromise(_0xd1c560,_0x5b420d,_0x47a5b4){return new BPromise(function(_0x4d2757,_0x5e802a){return client['request'](_0xd1c560,_0x47a5b4)['then'](function(_0x552484){logger['info'](_0xb18c('0x11'),_0x5b420d,_0xb18c('0x12'));logger[_0xb18c('0x13')](_0xb18c('0x14'),_0x5b420d,'request\x20sent',JSON['stringify'](_0x552484));if(_0x552484[_0xb18c('0x15')]){if(_0x552484['error'][_0xb18c('0x16')]===0x1f4){logger[_0xb18c('0x15')](_0xb18c('0x11'),_0x5b420d,_0x552484[_0xb18c('0x15')][_0xb18c('0x17')]);return _0x5e802a(_0x552484[_0xb18c('0x15')][_0xb18c('0x17')]);}logger[_0xb18c('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x5b420d,_0x552484[_0xb18c('0x15')][_0xb18c('0x17')]);return _0x4d2757(_0x552484['error'][_0xb18c('0x17')]);}else{logger['info'](_0xb18c('0x11'),_0x5b420d,_0xb18c('0x12'));_0x4d2757(_0x552484[_0xb18c('0x18')][_0xb18c('0x17')]);}})['catch'](function(_0x48bd21){logger[_0xb18c('0x15')](_0xb18c('0x11'),_0x5b420d,_0x48bd21);_0x5e802a(_0x48bd21);});});}exports[_0xb18c('0x19')]=function(_0x93836c){var _0x1a4de9=this;return new Promise(function(_0x508748,_0x46109c){return db[_0xb18c('0x1a')][_0xb18c('0x1b')]({'raw':_0x93836c[_0xb18c('0x1c')]?_0x93836c[_0xb18c('0x1c')][_0xb18c('0x1d')]===undefined?!![]:![]:!![],'where':_0x93836c[_0xb18c('0x1c')]?_0x93836c['options']['where']||null:null,'attributes':_0x93836c[_0xb18c('0x1c')]?_0x93836c[_0xb18c('0x1c')]['attributes']||null:null,'include':_0x93836c[_0xb18c('0x1c')]?_0x93836c[_0xb18c('0x1c')][_0xb18c('0x1e')]?_[_0xb18c('0x1f')](_0x93836c[_0xb18c('0x1c')][_0xb18c('0x1e')],function(_0x275a67){return{'model':db[_0x275a67[_0xb18c('0x20')]],'as':_0x275a67['as'],'attributes':_0x275a67[_0xb18c('0x21')],'include':_0x275a67[_0xb18c('0x1e')]?_['map'](_0x275a67[_0xb18c('0x1e')],function(_0x4673c4){return{'model':db[_0x4673c4[_0xb18c('0x20')]],'as':_0x4673c4['as'],'attributes':_0x4673c4[_0xb18c('0x21')],'include':_0x4673c4[_0xb18c('0x1e')]?_['map'](_0x4673c4[_0xb18c('0x1e')],function(_0x24291f){return{'model':db[_0x24291f[_0xb18c('0x20')]],'as':_0x24291f['as'],'attributes':_0x24291f[_0xb18c('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a2600){logger[_0xb18c('0x22')]('ShowWhatsappAccount',_0x93836c);logger['debug'](_0xb18c('0x19'),_0x93836c,JSON[_0xb18c('0x23')](_0x2a2600));_0x508748(_0x2a2600);})[_0xb18c('0x24')](function(_0x3b84f3){logger['error'](_0xb18c('0x19'),_0x3b84f3[_0xb18c('0x17')],_0x93836c);_0x46109c(_0x1a4de9[_0xb18c('0x15')](0x1f4,_0x3b84f3['message']));});});}; \ No newline at end of file +var _0x7f65=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','WhatsappAccount','find','options','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x294e77,_0x1cd2cb){var _0x8d33fe=function(_0x19eb8e){while(--_0x19eb8e){_0x294e77['push'](_0x294e77['shift']());}};_0x8d33fe(++_0x1cd2cb);}(_0x7f65,0x91));var _0x57f6=function(_0xe91770,_0x4f47c4){_0xe91770=_0xe91770-0x0;var _0x33ca30=_0x7f65[_0xe91770];return _0x33ca30;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var moment=require(_0x57f6('0x2'));var BPromise=require(_0x57f6('0x3'));var rs=require(_0x57f6('0x4'));var fs=require('fs');var Redis=require(_0x57f6('0x5'));var db=require(_0x57f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x57f6('0x7'))('rpc');var config=require(_0x57f6('0x8'));var jayson=require(_0x57f6('0x9'));var client=jayson['client'][_0x57f6('0xa')]({'port':0x232a});config[_0x57f6('0xb')]=_[_0x57f6('0xc')](config[_0x57f6('0xb')],{'host':_0x57f6('0xd'),'port':0x18eb});var socket=require(_0x57f6('0xe'))(new Redis(config[_0x57f6('0xb')]));require(_0x57f6('0xf'))[_0x57f6('0x10')](socket);function respondWithRpcPromise(_0x5e3518,_0x3099b5,_0x375e13){return new BPromise(function(_0x3d9ad1,_0x410ec3){return client[_0x57f6('0x11')](_0x5e3518,_0x375e13)[_0x57f6('0x12')](function(_0x288f65){logger['info'](_0x57f6('0x13'),_0x3099b5,_0x57f6('0x14'));logger[_0x57f6('0x15')](_0x57f6('0x16'),_0x3099b5,_0x57f6('0x14'),JSON[_0x57f6('0x17')](_0x288f65));if(_0x288f65[_0x57f6('0x18')]){if(_0x288f65['error'][_0x57f6('0x19')]===0x1f4){logger['error'](_0x57f6('0x13'),_0x3099b5,_0x288f65['error'][_0x57f6('0x1a')]);return _0x410ec3(_0x288f65[_0x57f6('0x18')][_0x57f6('0x1a')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3099b5,_0x288f65[_0x57f6('0x18')][_0x57f6('0x1a')]);return _0x3d9ad1(_0x288f65[_0x57f6('0x18')][_0x57f6('0x1a')]);}else{logger[_0x57f6('0x1b')](_0x57f6('0x13'),_0x3099b5,_0x57f6('0x14'));_0x3d9ad1(_0x288f65[_0x57f6('0x1c')][_0x57f6('0x1a')]);}})['catch'](function(_0x4da55a){logger[_0x57f6('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x3099b5,_0x4da55a);_0x410ec3(_0x4da55a);});});}exports['ShowWhatsappAccount']=function(_0x3c9c57){var _0xb4ca36=this;return new Promise(function(_0x59b597,_0x27a55c){return db[_0x57f6('0x1d')][_0x57f6('0x1e')]({'raw':_0x3c9c57[_0x57f6('0x1f')]?_0x3c9c57['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c9c57[_0x57f6('0x1f')]?_0x3c9c57['options'][_0x57f6('0x20')]||null:null,'attributes':_0x3c9c57[_0x57f6('0x1f')]?_0x3c9c57[_0x57f6('0x1f')][_0x57f6('0x21')]||null:null,'include':_0x3c9c57[_0x57f6('0x1f')]?_0x3c9c57[_0x57f6('0x1f')][_0x57f6('0x22')]?_[_0x57f6('0x23')](_0x3c9c57['options'][_0x57f6('0x22')],function(_0x11520a){return{'model':db[_0x11520a[_0x57f6('0x24')]],'as':_0x11520a['as'],'attributes':_0x11520a[_0x57f6('0x21')],'include':_0x11520a[_0x57f6('0x22')]?_['map'](_0x11520a[_0x57f6('0x22')],function(_0x474935){return{'model':db[_0x474935[_0x57f6('0x24')]],'as':_0x474935['as'],'attributes':_0x474935[_0x57f6('0x21')],'include':_0x474935[_0x57f6('0x22')]?_['map'](_0x474935[_0x57f6('0x22')],function(_0x399a43){return{'model':db[_0x399a43['model']],'as':_0x399a43['as'],'attributes':_0x399a43['attributes']};}):[]};}):[]};}):[]:[]})[_0x57f6('0x12')](function(_0x46aced){logger[_0x57f6('0x1b')](_0x57f6('0x25'),_0x3c9c57);logger[_0x57f6('0x15')](_0x57f6('0x25'),_0x3c9c57,JSON[_0x57f6('0x17')](_0x46aced));_0x59b597(_0x46aced);})['catch'](function(_0x2cf066){logger[_0x57f6('0x18')](_0x57f6('0x25'),_0x2cf066[_0x57f6('0x1a')],_0x3c9c57);_0x27a55c(_0xb4ca36[_0x57f6('0x18')](0x1f4,_0x2cf066[_0x57f6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a6f7ff5..26548b6 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 _0x8711=['remove','update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8711,0x110));var _0x1871=function(_0x4868af,_0x5e8e37){_0x4868af=_0x4868af-0x0;var _0x2ad800=_0x8711[_0x4868af];return _0x2ad800;};'use strict';var WhatsappAccountEvents=require(_0x1871('0x0'));var events=['save',_0x1871('0x1'),_0x1871('0x2')];function createListener(_0x1d006d,_0x223b6b){return function(_0x1bd92d){_0x223b6b[_0x1871('0x3')](_0x1d006d,_0x1bd92d);};}function removeListener(_0x68cbe4,_0x3c3053){return function(){WhatsappAccountEvents[_0x1871('0x4')](_0x68cbe4,_0x3c3053);};}exports[_0x1871('0x5')]=function(_0x43c675){for(var _0x1936f9=0x0,_0x168b0c=events['length'];_0x1936f9<_0x168b0c;_0x1936f9++){var _0x4a6c96=events[_0x1936f9];var _0x3b129a=createListener(_0x1871('0x6')+_0x4a6c96,_0x43c675);WhatsappAccountEvents['on'](_0x4a6c96,_0x3b129a);}}; \ No newline at end of file +var _0x38fe=['update','emit','removeListener','length','whatsappAccount:','save','remove'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x38fe,0xbb));var _0xe38f=function(_0x4a3fdf,_0x3c2c54){_0x4a3fdf=_0x4a3fdf-0x0;var _0x8c4ecc=_0x38fe[_0x4a3fdf];return _0x8c4ecc;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xe38f('0x0'),_0xe38f('0x1'),_0xe38f('0x2')];function createListener(_0x270540,_0x2e8d8a){return function(_0x25153f){_0x2e8d8a[_0xe38f('0x3')](_0x270540,_0x25153f);};}function removeListener(_0x529930,_0x520ebe){return function(){WhatsappAccountEvents[_0xe38f('0x4')](_0x529930,_0x520ebe);};}exports['register']=function(_0x4b7f23){for(var _0x1313ca=0x0,_0xd6424b=events[_0xe38f('0x5')];_0x1313ca<_0xd6424b;_0x1313ca++){var _0x520e78=events[_0x1313ca];var _0x5c5bcd=createListener(_0xe38f('0x6')+_0x520e78,_0x4b7f23);WhatsappAccountEvents['on'](_0x520e78,_0x5c5bcd);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ad9ba92..6eb6fcf 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 _0xc15f=['isAuthenticated','index','show','post','put','/:id','update','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xc15f,0x1a8));var _0xfc15=function(_0x41f15f,_0x1a39ef){_0x41f15f=_0x41f15f-0x0;var _0x269a71=_0xc15f[_0x41f15f];return _0x269a71;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfc15('0x0'));var timeout=require(_0xfc15('0x1'));var express=require(_0xfc15('0x2'));var router=express[_0xfc15('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfc15('0x4'));var interaction=require(_0xfc15('0x5'));var config=require('../../config/environment');var controller=require(_0xfc15('0x6'));router[_0xfc15('0x7')]('/',auth[_0xfc15('0x8')](),controller[_0xfc15('0x9')]);router[_0xfc15('0x7')]('/:id',auth[_0xfc15('0x8')](),controller[_0xfc15('0xa')]);router[_0xfc15('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfc15('0xc')](_0xfc15('0xd'),auth[_0xfc15('0x8')](),controller[_0xfc15('0xe')]);router[_0xfc15('0xf')](_0xfc15('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2a70=['isAuthenticated','post','put','/:id','update','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2a70,0x1e8));var _0x02a7=function(_0x6c9b2c,_0x2e1e98){_0x6c9b2c=_0x6c9b2c-0x0;var _0x2dbb9c=_0x2a70[_0x6c9b2c];return _0x2dbb9c;};'use strict';var multer=require('multer');var util=require(_0x02a7('0x0'));var path=require('path');var timeout=require(_0x02a7('0x1'));var express=require(_0x02a7('0x2'));var router=express[_0x02a7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x02a7('0x4'));var config=require(_0x02a7('0x5'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x02a7('0x6')](),controller['index']);router['get']('/:id',auth[_0x02a7('0x6')](),controller['show']);router[_0x02a7('0x7')]('/',auth[_0x02a7('0x6')](),controller['create']);router[_0x02a7('0x8')](_0x02a7('0x9'),auth[_0x02a7('0x6')](),controller[_0x02a7('0xa')]);router[_0x02a7('0xb')](_0x02a7('0x9'),auth[_0x02a7('0x6')](),controller['destroy']);module[_0x02a7('0xc')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3414039..5fae714 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 _0x1e06=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x1e06,0x1b7));var _0x61e0=function(_0x345bb7,_0x386dbf){_0x345bb7=_0x345bb7-0x0;var _0x2b1799=_0x1e06[_0x345bb7];return _0x2b1799;};'use strict';var Sequelize=require(_0x61e0('0x0'));module[_0x61e0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x61e0('0x2')],'allowNull':![],'defaultValue':_0x61e0('0x3')},'appdata':{'type':Sequelize[_0x61e0('0x4')]()},'description':{'type':Sequelize[_0x61e0('0x2')]},'interval':{'type':Sequelize[_0x61e0('0x2')],'defaultValue':_0x61e0('0x5')}}; \ No newline at end of file +var _0xa96d=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xa96d,0x66));var _0xda96=function(_0x1b69aa,_0x5aa147){_0x1b69aa=_0x1b69aa-0x0;var _0x42647d=_0xa96d[_0x1b69aa];return _0x42647d;};'use strict';var Sequelize=require(_0xda96('0x0'));module[_0xda96('0x1')]={'priority':{'type':Sequelize[_0xda96('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xda96('0x3')],'allowNull':![],'defaultValue':_0xda96('0x4')},'appdata':{'type':Sequelize[_0xda96('0x5')]()},'description':{'type':Sequelize[_0xda96('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index a9041e2..13255ad 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 _0xf06c=['ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','then','destroy','sendStatus','name','send','index','WhatsappApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','papaparse'];(function(_0x4d41f6,_0x2c4d5e){var _0x4c3143=function(_0xfb3b67){while(--_0xfb3b67){_0x4d41f6['push'](_0x4d41f6['shift']());}};_0x4c3143(++_0x2c4d5e);}(_0xf06c,0xc7));var _0xcf06=function(_0x28d78e,_0x433f96){_0x28d78e=_0x28d78e-0x0;var _0x1addab=_0xf06c[_0x28d78e];return _0x1addab;};'use strict';var emlformat=require(_0xcf06('0x0'));var rimraf=require(_0xcf06('0x1'));var zipdir=require(_0xcf06('0x2'));var jsonpatch=require(_0xcf06('0x3'));var rp=require(_0xcf06('0x4'));var moment=require('moment');var BPromise=require(_0xcf06('0x5'));var Mustache=require(_0xcf06('0x6'));var util=require(_0xcf06('0x7'));var path=require('path');var sox=require(_0xcf06('0x8'));var csv=require(_0xcf06('0x9'));var ejs=require(_0xcf06('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf06('0xb'));var squel=require('squel');var crypto=require(_0xcf06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcf06('0xd'));var Redis=require(_0xcf06('0xe'));var authService=require(_0xcf06('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf06('0x10'));var logger=require('../../config/logger')(_0xcf06('0x11'));var utils=require('../../config/utils');var config=require(_0xcf06('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf06('0x13'))['db'];function respondWithStatusCode(_0x570965,_0x2aaa5f){_0x2aaa5f=_0x2aaa5f||0xcc;return function(_0x3dc669){if(_0x3dc669){return _0x570965['sendStatus'](_0x2aaa5f);}return _0x570965['status'](_0x2aaa5f)[_0xcf06('0x14')]();};}function respondWithResult(_0x45f66a,_0x2fd686){_0x2fd686=_0x2fd686||0xc8;return function(_0x157689){if(_0x157689){return _0x45f66a['status'](_0x2fd686)[_0xcf06('0x15')](_0x157689);}};}function respondWithFilteredResult(_0x4aa0d,_0x5db932){return function(_0x584d2c){if(_0x584d2c){var _0x15a795=typeof _0x5db932[_0xcf06('0x16')]===_0xcf06('0x17')&&typeof _0x5db932['limit']===_0xcf06('0x17');var _0x18cd3f=_0x584d2c[_0xcf06('0x18')];var _0x569bbf=_0x15a795?0x0:_0x5db932[_0xcf06('0x16')];var _0x2a5ef5=_0x15a795?_0x584d2c[_0xcf06('0x18')]:_0x5db932[_0xcf06('0x16')]+_0x5db932[_0xcf06('0x19')];var _0x48886d;if(_0x2a5ef5>=_0x18cd3f){_0x2a5ef5=_0x18cd3f;_0x48886d=0xc8;}else{_0x48886d=0xce;}_0x4aa0d[_0xcf06('0x1a')](_0x48886d);return _0x4aa0d[_0xcf06('0x1b')](_0xcf06('0x1c'),_0x569bbf+'-'+_0x2a5ef5+'/'+_0x18cd3f)['json'](_0x584d2c);}return null;};}function patchUpdates(_0x465eed){return function(_0x19305d){try{jsonpatch['apply'](_0x19305d,_0x465eed,!![]);}catch(_0x362fcc){return BPromise[_0xcf06('0x1d')](_0x362fcc);}return _0x19305d['save']();};}function saveUpdates(_0x2edadc,_0x132eaa){return function(_0x139b17){if(_0x139b17){return _0x139b17[_0xcf06('0x1e')](_0x2edadc)[_0xcf06('0x1f')](function(_0x13fa04){return _0x13fa04;});}return null;};}function removeEntity(_0xe3304a,_0x26a685){return function(_0xb039dd){if(_0xb039dd){return _0xb039dd[_0xcf06('0x20')]()[_0xcf06('0x1f')](function(){_0xe3304a[_0xcf06('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58840a,_0x87440){return function(_0x27beb7){if(!_0x27beb7){_0x58840a[_0xcf06('0x21')](0x194);}return _0x27beb7;};}function handleError(_0x27cbd9,_0x2e1617){_0x2e1617=_0x2e1617||0x1f4;return function(_0x6c3dcf){logger['error'](_0x6c3dcf['stack']);if(_0x6c3dcf[_0xcf06('0x22')]){delete _0x6c3dcf['name'];}_0x27cbd9[_0xcf06('0x1a')](_0x2e1617)[_0xcf06('0x23')](_0x6c3dcf);};}exports[_0xcf06('0x24')]=function(_0x474bfe,_0x120d0c){var _0x4651f4={},_0x303823={},_0x2b2508={'count':0x0,'rows':[]};var _0x2ec5b7=_['map'](db[_0xcf06('0x25')]['rawAttributes'],function(_0x92666b){return{'name':_0x92666b[_0xcf06('0x26')],'type':_0x92666b[_0xcf06('0x27')][_0xcf06('0x28')]};});_0x303823[_0xcf06('0x29')]=_[_0xcf06('0x2a')](_0x2ec5b7,'name');_0x303823[_0xcf06('0x2b')]=_[_0xcf06('0x2c')](_0x474bfe[_0xcf06('0x2b')]);_0x303823[_0xcf06('0x2d')]=_[_0xcf06('0x2e')](_0x303823[_0xcf06('0x29')],_0x303823[_0xcf06('0x2b')]);_0x4651f4[_0xcf06('0x2f')]=_[_0xcf06('0x2e')](_0x303823[_0xcf06('0x29')],qs['fields'](_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x30')]));_0x4651f4[_0xcf06('0x2f')]=_0x4651f4[_0xcf06('0x2f')][_0xcf06('0x31')]?_0x4651f4[_0xcf06('0x2f')]:_0x303823[_0xcf06('0x29')];if(!_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x32')](_0xcf06('0x33'))){_0x4651f4[_0xcf06('0x19')]=qs['limit'](_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x19')]);_0x4651f4['offset']=qs[_0xcf06('0x16')](_0x474bfe['query'][_0xcf06('0x16')]);}_0x4651f4[_0xcf06('0x34')]=qs[_0xcf06('0x35')](_0x474bfe[_0xcf06('0x2b')]['sort']);_0x4651f4[_0xcf06('0x36')]=qs[_0xcf06('0x2d')](_[_0xcf06('0x37')](_0x474bfe[_0xcf06('0x2b')],_0x303823[_0xcf06('0x2d')]),_0x2ec5b7);if(_0x474bfe['query'][_0xcf06('0x38')]){_0x4651f4[_0xcf06('0x36')]=_[_0xcf06('0x39')](_0x4651f4[_0xcf06('0x36')],{'$or':_[_0xcf06('0x2a')](_0x2ec5b7,function(_0x45ddbf){if(_0x45ddbf[_0xcf06('0x27')]!==_0xcf06('0x3a')){var _0x3e0b3f={};_0x3e0b3f[_0x45ddbf[_0xcf06('0x22')]]={'$like':'%'+_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x38')]+'%'};return _0x3e0b3f;}})});}_0x4651f4=_[_0xcf06('0x39')]({},_0x4651f4,_0x474bfe[_0xcf06('0x3b')]);var _0x446972={'where':_0x4651f4[_0xcf06('0x36')]};return db[_0xcf06('0x25')]['count'](_0x446972)[_0xcf06('0x1f')](function(_0x59b8ed){_0x2b2508[_0xcf06('0x18')]=_0x59b8ed;if(_0x474bfe[_0xcf06('0x2b')][_0xcf06('0x3c')]){_0x4651f4['include']=[{'all':!![]}];}return db[_0xcf06('0x25')][_0xcf06('0x3d')](_0x4651f4);})[_0xcf06('0x1f')](function(_0x38c153){_0x2b2508[_0xcf06('0x3e')]=_0x38c153;return _0x2b2508;})['then'](respondWithFilteredResult(_0x120d0c,_0x4651f4))['catch'](handleError(_0x120d0c,null));};exports[_0xcf06('0x3f')]=function(_0x518c2f,_0x120dae){var _0x40735b={'raw':!![],'where':{'id':_0x518c2f[_0xcf06('0x40')]['id']}},_0x4342e0={};_0x4342e0['model']=_[_0xcf06('0x2c')](db[_0xcf06('0x25')][_0xcf06('0x41')]);_0x4342e0['query']=_[_0xcf06('0x2c')](_0x518c2f['query']);_0x4342e0[_0xcf06('0x2d')]=_['intersection'](_0x4342e0[_0xcf06('0x29')],_0x4342e0['query']);_0x40735b[_0xcf06('0x2f')]=_[_0xcf06('0x2e')](_0x4342e0[_0xcf06('0x29')],qs['fields'](_0x518c2f[_0xcf06('0x2b')][_0xcf06('0x30')]));_0x40735b[_0xcf06('0x2f')]=_0x40735b['attributes'][_0xcf06('0x31')]?_0x40735b['attributes']:_0x4342e0[_0xcf06('0x29')];if(_0x518c2f[_0xcf06('0x2b')][_0xcf06('0x3c')]){_0x40735b[_0xcf06('0x42')]=[{'all':!![]}];}_0x40735b=_['merge']({},_0x40735b,_0x518c2f[_0xcf06('0x3b')]);return db[_0xcf06('0x25')][_0xcf06('0x43')](_0x40735b)['then'](handleEntityNotFound(_0x120dae,null))[_0xcf06('0x1f')](respondWithResult(_0x120dae,null))[_0xcf06('0x44')](handleError(_0x120dae,null));};exports['create']=function(_0xc392e,_0x8a988f){return db[_0xcf06('0x25')][_0xcf06('0x45')](_0xc392e[_0xcf06('0x46')],{})['then'](respondWithResult(_0x8a988f,0xc9))[_0xcf06('0x44')](handleError(_0x8a988f,null));};exports[_0xcf06('0x1e')]=function(_0x453e6e,_0x319314){if(_0x453e6e[_0xcf06('0x46')]['id']){delete _0x453e6e['body']['id'];}return db[_0xcf06('0x25')]['find']({'where':{'id':_0x453e6e[_0xcf06('0x40')]['id']}})[_0xcf06('0x1f')](handleEntityNotFound(_0x319314,null))[_0xcf06('0x1f')](saveUpdates(_0x453e6e[_0xcf06('0x46')],null))[_0xcf06('0x1f')](respondWithResult(_0x319314,null))['catch'](handleError(_0x319314,null));};exports[_0xcf06('0x20')]=function(_0x4e45dd,_0xc32502){return db[_0xcf06('0x25')][_0xcf06('0x43')]({'where':{'id':_0x4e45dd[_0xcf06('0x40')]['id']}})[_0xcf06('0x1f')](handleEntityNotFound(_0xc32502,null))[_0xcf06('0x1f')](removeEntity(_0xc32502,null))['catch'](handleError(_0xc32502,null));}; \ No newline at end of file +var _0xd663=['apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','create','body','find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x36ff98,_0x1b8fc7){var _0x39d4c=function(_0x38ae23){while(--_0x38ae23){_0x36ff98['push'](_0x36ff98['shift']());}};_0x39d4c(++_0x1b8fc7);}(_0xd663,0x1ed));var _0x3d66=function(_0x3505f1,_0x1df74a){_0x3505f1=_0x3505f1-0x0;var _0x36cd16=_0xd663[_0x3505f1];return _0x36cd16;};'use strict';var emlformat=require(_0x3d66('0x0'));var rimraf=require(_0x3d66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d66('0x2'));var rp=require(_0x3d66('0x3'));var moment=require(_0x3d66('0x4'));var BPromise=require(_0x3d66('0x5'));var Mustache=require(_0x3d66('0x6'));var util=require('util');var path=require(_0x3d66('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d66('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3d66('0x9'));var deskjs=require(_0x3d66('0xa'));var toCsv=require(_0x3d66('0xb'));var querystring=require(_0x3d66('0xc'));var Papa=require(_0x3d66('0xd'));var Redis=require(_0x3d66('0xe'));var authService=require(_0x3d66('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d66('0x10'));var hardwareService=require(_0x3d66('0x11'));var logger=require(_0x3d66('0x12'))('api');var utils=require(_0x3d66('0x13'));var config=require(_0x3d66('0x14'));var licenseUtil=require(_0x3d66('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207712,_0x223de6){_0x223de6=_0x223de6||0xcc;return function(_0x288693){if(_0x288693){return _0x207712[_0x3d66('0x16')](_0x223de6);}return _0x207712['status'](_0x223de6)[_0x3d66('0x17')]();};}function respondWithResult(_0x5a940c,_0x15bba0){_0x15bba0=_0x15bba0||0xc8;return function(_0x290f29){if(_0x290f29){return _0x5a940c[_0x3d66('0x18')](_0x15bba0)[_0x3d66('0x19')](_0x290f29);}};}function respondWithFilteredResult(_0x30260d,_0x153b88){return function(_0x5628ae){if(_0x5628ae){var _0x5eba7e=typeof _0x153b88[_0x3d66('0x1a')]===_0x3d66('0x1b')&&typeof _0x153b88['limit']===_0x3d66('0x1b');var _0x24d137=_0x5628ae[_0x3d66('0x1c')];var _0x1dfd81=_0x5eba7e?0x0:_0x153b88[_0x3d66('0x1a')];var _0x239ffb=_0x5eba7e?_0x5628ae[_0x3d66('0x1c')]:_0x153b88[_0x3d66('0x1a')]+_0x153b88[_0x3d66('0x1d')];var _0x3902f1;if(_0x239ffb>=_0x24d137){_0x239ffb=_0x24d137;_0x3902f1=0xc8;}else{_0x3902f1=0xce;}_0x30260d[_0x3d66('0x18')](_0x3902f1);return _0x30260d[_0x3d66('0x1e')](_0x3d66('0x1f'),_0x1dfd81+'-'+_0x239ffb+'/'+_0x24d137)[_0x3d66('0x19')](_0x5628ae);}return null;};}function patchUpdates(_0x21cfd7){return function(_0x4c61ee){try{jsonpatch[_0x3d66('0x20')](_0x4c61ee,_0x21cfd7,!![]);}catch(_0x5e1516){return BPromise[_0x3d66('0x21')](_0x5e1516);}return _0x4c61ee[_0x3d66('0x22')]();};}function saveUpdates(_0x4486f5,_0x37ed73){return function(_0x11be7f){if(_0x11be7f){return _0x11be7f[_0x3d66('0x23')](_0x4486f5)[_0x3d66('0x24')](function(_0x1bfa81){return _0x1bfa81;});}return null;};}function removeEntity(_0x1eb922,_0x4e2c42){return function(_0x151364){if(_0x151364){return _0x151364[_0x3d66('0x25')]()[_0x3d66('0x24')](function(){_0x1eb922[_0x3d66('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fe0a,_0x45628b){return function(_0x4302ad){if(!_0x4302ad){_0x59fe0a[_0x3d66('0x16')](0x194);}return _0x4302ad;};}function handleError(_0x4f0d9e,_0x402c4c){_0x402c4c=_0x402c4c||0x1f4;return function(_0x3e6712){logger[_0x3d66('0x26')](_0x3e6712[_0x3d66('0x27')]);if(_0x3e6712[_0x3d66('0x28')]){delete _0x3e6712[_0x3d66('0x28')];}_0x4f0d9e[_0x3d66('0x18')](_0x402c4c)[_0x3d66('0x29')](_0x3e6712);};}exports[_0x3d66('0x2a')]=function(_0x1271bf,_0x54ba13){var _0x28466b={},_0x1dff3b={},_0x197c5e={'count':0x0,'rows':[]};var _0xc128a7=_[_0x3d66('0x2b')](db[_0x3d66('0x2c')][_0x3d66('0x2d')],function(_0xabe382){return{'name':_0xabe382[_0x3d66('0x2e')],'type':_0xabe382[_0x3d66('0x2f')][_0x3d66('0x30')]};});_0x1dff3b['model']=_['map'](_0xc128a7,_0x3d66('0x28'));_0x1dff3b[_0x3d66('0x31')]=_[_0x3d66('0x32')](_0x1271bf[_0x3d66('0x31')]);_0x1dff3b[_0x3d66('0x33')]=_[_0x3d66('0x34')](_0x1dff3b[_0x3d66('0x35')],_0x1dff3b[_0x3d66('0x31')]);_0x28466b[_0x3d66('0x36')]=_[_0x3d66('0x34')](_0x1dff3b[_0x3d66('0x35')],qs[_0x3d66('0x37')](_0x1271bf[_0x3d66('0x31')][_0x3d66('0x37')]));_0x28466b[_0x3d66('0x36')]=_0x28466b[_0x3d66('0x36')][_0x3d66('0x38')]?_0x28466b[_0x3d66('0x36')]:_0x1dff3b[_0x3d66('0x35')];if(!_0x1271bf[_0x3d66('0x31')][_0x3d66('0x39')](_0x3d66('0x3a'))){_0x28466b[_0x3d66('0x1d')]=qs['limit'](_0x1271bf[_0x3d66('0x31')][_0x3d66('0x1d')]);_0x28466b[_0x3d66('0x1a')]=qs['offset'](_0x1271bf[_0x3d66('0x31')]['offset']);}_0x28466b[_0x3d66('0x3b')]=qs[_0x3d66('0x3c')](_0x1271bf['query'][_0x3d66('0x3c')]);_0x28466b[_0x3d66('0x3d')]=qs['filters'](_[_0x3d66('0x3e')](_0x1271bf[_0x3d66('0x31')],_0x1dff3b['filters']),_0xc128a7);if(_0x1271bf[_0x3d66('0x31')][_0x3d66('0x3f')]){_0x28466b[_0x3d66('0x3d')]=_[_0x3d66('0x40')](_0x28466b['where'],{'$or':_[_0x3d66('0x2b')](_0xc128a7,function(_0x58851d){if(_0x58851d[_0x3d66('0x2f')]!=='VIRTUAL'){var _0xc77eb5={};_0xc77eb5[_0x58851d[_0x3d66('0x28')]]={'$like':'%'+_0x1271bf[_0x3d66('0x31')]['filter']+'%'};return _0xc77eb5;}})});}_0x28466b=_[_0x3d66('0x40')]({},_0x28466b,_0x1271bf[_0x3d66('0x41')]);var _0x105726={'where':_0x28466b[_0x3d66('0x3d')]};return db[_0x3d66('0x2c')][_0x3d66('0x1c')](_0x105726)[_0x3d66('0x24')](function(_0x38633f){_0x197c5e[_0x3d66('0x1c')]=_0x38633f;if(_0x1271bf[_0x3d66('0x31')][_0x3d66('0x42')]){_0x28466b[_0x3d66('0x43')]=[{'all':!![]}];}return db[_0x3d66('0x2c')]['findAll'](_0x28466b);})[_0x3d66('0x24')](function(_0x4482a3){_0x197c5e[_0x3d66('0x44')]=_0x4482a3;return _0x197c5e;})['then'](respondWithFilteredResult(_0x54ba13,_0x28466b))['catch'](handleError(_0x54ba13,null));};exports[_0x3d66('0x45')]=function(_0x263e9f,_0x3deb7d){var _0x26350b={'raw':!![],'where':{'id':_0x263e9f[_0x3d66('0x46')]['id']}},_0x283395={};_0x283395[_0x3d66('0x35')]=_[_0x3d66('0x32')](db['WhatsappApplication'][_0x3d66('0x2d')]);_0x283395[_0x3d66('0x31')]=_[_0x3d66('0x32')](_0x263e9f['query']);_0x283395['filters']=_[_0x3d66('0x34')](_0x283395[_0x3d66('0x35')],_0x283395[_0x3d66('0x31')]);_0x26350b[_0x3d66('0x36')]=_[_0x3d66('0x34')](_0x283395[_0x3d66('0x35')],qs[_0x3d66('0x37')](_0x263e9f[_0x3d66('0x31')]['fields']));_0x26350b[_0x3d66('0x36')]=_0x26350b['attributes'][_0x3d66('0x38')]?_0x26350b[_0x3d66('0x36')]:_0x283395[_0x3d66('0x35')];if(_0x263e9f['query'][_0x3d66('0x42')]){_0x26350b[_0x3d66('0x43')]=[{'all':!![]}];}_0x26350b=_[_0x3d66('0x40')]({},_0x26350b,_0x263e9f[_0x3d66('0x41')]);return db['WhatsappApplication']['find'](_0x26350b)[_0x3d66('0x24')](handleEntityNotFound(_0x3deb7d,null))['then'](respondWithResult(_0x3deb7d,null))['catch'](handleError(_0x3deb7d,null));};exports[_0x3d66('0x47')]=function(_0x3c5b6d,_0x32edc2){return db[_0x3d66('0x2c')][_0x3d66('0x47')](_0x3c5b6d[_0x3d66('0x48')],{})[_0x3d66('0x24')](respondWithResult(_0x32edc2,0xc9))['catch'](handleError(_0x32edc2,null));};exports[_0x3d66('0x23')]=function(_0x2e05ce,_0x22c447){if(_0x2e05ce[_0x3d66('0x48')]['id']){delete _0x2e05ce[_0x3d66('0x48')]['id'];}return db['WhatsappApplication'][_0x3d66('0x49')]({'where':{'id':_0x2e05ce[_0x3d66('0x46')]['id']}})[_0x3d66('0x24')](handleEntityNotFound(_0x22c447,null))[_0x3d66('0x24')](saveUpdates(_0x2e05ce[_0x3d66('0x48')],null))[_0x3d66('0x24')](respondWithResult(_0x22c447,null))[_0x3d66('0x4a')](handleError(_0x22c447,null));};exports['destroy']=function(_0x4a6c1c,_0x505abb){return db[_0x3d66('0x2c')][_0x3d66('0x49')]({'where':{'id':_0x4a6c1c['params']['id']}})[_0x3d66('0x24')](handleEntityNotFound(_0x505abb,null))[_0x3d66('0x24')](removeEntity(_0x505abb,null))[_0x3d66('0x4a')](handleError(_0x505abb,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index aef4ed0..2530a2c 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 _0xa8eb=['bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','lodash','../../config/logger','moment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa8eb,0x179));var _0xba8e=function(_0x4f49af,_0x47e992){_0x4f49af=_0x4f49af-0x0;var _0x28ef1a=_0xa8eb[_0x4f49af];return _0x28ef1a;};'use strict';var _=require(_0xba8e('0x0'));var util=require('util');var logger=require(_0xba8e('0x1'))('api');var moment=require(_0xba8e('0x2'));var BPromise=require(_0xba8e('0x3'));var rp=require(_0xba8e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0xba8e('0x7')]=function(_0x57e345,_0x14c3ac){return _0x57e345['define'](_0xba8e('0x8'),attributes,{'tableName':_0xba8e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x00b3=['../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf'];(function(_0x49be77,_0x1e62ab){var _0x1d531c=function(_0x561365){while(--_0x561365){_0x49be77['push'](_0x49be77['shift']());}};_0x1d531c(++_0x1e62ab);}(_0x00b3,0x97));var _0x300b=function(_0x2995bf,_0x4e094d){_0x2995bf=_0x2995bf-0x0;var _0x290529=_0x00b3[_0x2995bf];return _0x290529;};'use strict';var _=require(_0x300b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x300b('0x1'));var moment=require(_0x300b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x300b('0x3'));var rimraf=require(_0x300b('0x4'));var config=require(_0x300b('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0x300b('0x6')]=function(_0xbceeb8,_0x34a5cd){return _0xbceeb8[_0x300b('0x7')](_0x300b('0x8'),attributes,{'tableName':_0x300b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x300b('0xa'),'collate':_0x300b('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 9aed681..6de5c4b 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0xc8505b,_0x294fcd){var _0x2bac9b=function(_0xbcef17){while(--_0xbcef17){_0xc8505b['push'](_0xc8505b['shift']());}};_0x2bac9b(++_0x294fcd);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x24ca[_0x1a809b];return _0x5d90e6;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0xb903=['http','request','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x526d8e,_0x1199bb){var _0x57aeb0=function(_0x40d8c1){while(--_0x40d8c1){_0x526d8e['push'](_0x526d8e['shift']());}};_0x57aeb0(++_0x1199bb);}(_0xb903,0x185));var _0x3b90=function(_0x19f37e,_0x5534ee){_0x19f37e=_0x19f37e-0x0;var _0x2965b0=_0xb903[_0x19f37e];return _0x2965b0;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5adcb85..fbb50c4 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 _0x82c4=['create','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x406620,_0x16a1a0){var _0x1abbee=function(_0x33d6b9){while(--_0x33d6b9){_0x406620['push'](_0x406620['shift']());}};_0x1abbee(++_0x16a1a0);}(_0x82c4,0x1ca));var _0x482c=function(_0x174e66,_0x3ef28d){_0x174e66=_0x174e66-0x0;var _0x1d3a43=_0x82c4[_0x174e66];return _0x1d3a43;};'use strict';var multer=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var path=require(_0x482c('0x2'));var timeout=require(_0x482c('0x3'));var express=require(_0x482c('0x4'));var router=express[_0x482c('0x5')]();var fs_extra=require(_0x482c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x482c('0x7'));var config=require('../../config/environment');var controller=require(_0x482c('0x8'));router['get']('/',auth[_0x482c('0x9')](),controller['index']);router[_0x482c('0xa')](_0x482c('0xb'),auth[_0x482c('0x9')](),controller[_0x482c('0xc')]);router[_0x482c('0xa')]('/:id',auth[_0x482c('0x9')](),controller[_0x482c('0xd')]);router[_0x482c('0xa')](_0x482c('0xe'),auth[_0x482c('0x9')](),controller[_0x482c('0xf')]);router['get'](_0x482c('0x10'),auth[_0x482c('0x9')](),controller[_0x482c('0x11')]);router['post']('/',auth[_0x482c('0x9')](),controller[_0x482c('0x12')]);router[_0x482c('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x482c('0x14')]);router[_0x482c('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x482c('0x15')](_0x482c('0x16'),_0x482c('0x17')),controller[_0x482c('0x18')]);router[_0x482c('0x19')](_0x482c('0x1a'),auth[_0x482c('0x9')](),interaction[_0x482c('0x15')](_0x482c('0x16'),_0x482c('0x1b')),controller[_0x482c('0x1c')]);router[_0x482c('0x1d')]('/:id',auth[_0x482c('0x9')](),interaction['tracked'](_0x482c('0x16'),_0x482c('0x1e')),controller['destroy']);router['delete'](_0x482c('0x1f'),auth['isAuthenticated'](),controller[_0x482c('0x20')]);module[_0x482c('0x21')]=router; \ No newline at end of file +var _0xb934=['addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x253611,_0x4af864){var _0x2c7119=function(_0x344ed4){while(--_0x344ed4){_0x253611['push'](_0x253611['shift']());}};_0x2c7119(++_0x4af864);}(_0xb934,0x92));var _0x4b93=function(_0x332a0c,_0x4688a8){_0x332a0c=_0x332a0c-0x0;var _0x99141e=_0xb934[_0x332a0c];return _0x99141e;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var fs_extra=require(_0x4b93('0x5'));var auth=require(_0x4b93('0x6'));var interaction=require(_0x4b93('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x4b93('0x8')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0xa')]);router[_0x4b93('0x8')]('/describe',auth[_0x4b93('0x9')](),controller[_0x4b93('0xb')]);router[_0x4b93('0x8')](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0xd')]);router[_0x4b93('0x8')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller['getMessages']);router[_0x4b93('0x8')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x11')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0x12')]);router[_0x4b93('0x11')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x13')]);router[_0x4b93('0x11')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')]('whatsapp',_0x4b93('0x16')),controller[_0x4b93('0x17')]);router[_0x4b93('0x18')]('/:id',auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')](_0x4b93('0x19'),_0x4b93('0x1a')),controller[_0x4b93('0x1b')]);router['delete'](_0x4b93('0xc'),auth[_0x4b93('0x9')](),interaction['tracked']('whatsapp',_0x4b93('0x1c')),controller[_0x4b93('0x1d')]);router[_0x4b93('0x1e')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x1f')]);module[_0x4b93('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index bafaadb..3e94f82 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 _0xc949=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3bb987,_0xa33875){var _0x48011a=function(_0x541ada){while(--_0x541ada){_0x3bb987['push'](_0x3bb987['shift']());}};_0x48011a(++_0xa33875);}(_0xc949,0x181));var _0x9c94=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc949[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x9c94('0x0'));var moment=require('moment');module[_0x9c94('0x1')]={'closed':{'type':Sequelize[_0x9c94('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9c94('0x3')]},'disposition':{'type':Sequelize[_0x9c94('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9c94('0x4')]},'note':{'type':Sequelize[_0x9c94('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9c94('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9c94('0x5')]('in',_0x9c94('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9c94('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9c94('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9c94('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fa4=['sequelize','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x1f9019,_0x346b3){var _0x53474c=function(_0x4d1771){while(--_0x4d1771){_0x1f9019['push'](_0x1f9019['shift']());}};_0x53474c(++_0x346b3);}(_0x3fa4,0xf0));var _0x43fa=function(_0x234015,_0x57c990){_0x234015=_0x234015-0x0;var _0x12ea3e=_0x3fa4[_0x234015];return _0x12ea3e;};'use strict';var Sequelize=require(_0x43fa('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43fa('0x1')]},'disposition':{'type':Sequelize[_0x43fa('0x2')]},'secondDisposition':{'type':Sequelize[_0x43fa('0x2')]},'thirdDisposition':{'type':Sequelize[_0x43fa('0x2')]},'note':{'type':Sequelize[_0x43fa('0x2')]},'phone':{'type':Sequelize[_0x43fa('0x2')]},'read1stAt':{'type':Sequelize[_0x43fa('0x1')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x43fa('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43fa('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x43fa('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x43fa('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ecf9b0e..a0c3e76 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 _0xcf4a=['set','Content-Range','update','then','destroy','error','stack','name','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','whatsapp','query','user','show','params','keys','filters','intersection','attributes','model','fields','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','WhatsappMessage','ids','omit','where','pick','WhatsappInteractionId','filter','$gte','split','format','findAll','rows','setTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','unix','join','root','server','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','basename','System','lastName','out','read','value','transcript-','.pdf','createPdfFromHTML','download','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x433159,_0x1db06c){var _0x70e196=function(_0x4d8b07){while(--_0x4d8b07){_0x433159['push'](_0x433159['shift']());}};_0x70e196(++_0x1db06c);}(_0xcf4a,0x14c));var _0xacf4=function(_0x55ade1,_0x687676){_0x55ade1=_0x55ade1-0x0;var _0x36a697=_0xcf4a[_0x55ade1];return _0x36a697;};'use strict';var rimraf=require(_0xacf4('0x0'));var zipdir=require(_0xacf4('0x1'));var moment=require(_0xacf4('0x2'));var BPromise=require(_0xacf4('0x3'));var util=require(_0xacf4('0x4'));var path=require(_0xacf4('0x5'));var ejs=require(_0xacf4('0x6'));var fs=require('fs');var _=require(_0xacf4('0x7'));var Redis=require('ioredis');var interaction=require(_0xacf4('0x8'));var qs=require(_0xacf4('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xacf4('0xa'))('api');var config=require(_0xacf4('0xb'));var db=require(_0xacf4('0xc'))['db'];config['redis']=_['defaults'](config[_0xacf4('0xd')],{'host':_0xacf4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacf4('0xd')]));require(_0xacf4('0xf'))[_0xacf4('0x10')](socket);function respondWithStatusCode(_0x5d5991,_0x3515ee){_0x3515ee=_0x3515ee||0xcc;return function(_0x5e5319){if(_0x5e5319){return _0x5d5991[_0xacf4('0x11')](_0x3515ee);}return _0x5d5991[_0xacf4('0x12')](_0x3515ee)[_0xacf4('0x13')]();};}function respondWithResult(_0x522597,_0x3bab31){_0x3bab31=_0x3bab31||0xc8;return function(_0x148090){if(_0x148090){return _0x522597['status'](_0x3bab31)[_0xacf4('0x14')](_0x148090);}};}function respondWithFilteredResult(_0x4fb680,_0x2dbf10){return function(_0x44690e){if(_0x44690e){var _0x57def1=typeof _0x2dbf10[_0xacf4('0x15')]===_0xacf4('0x16')&&typeof _0x2dbf10[_0xacf4('0x17')]===_0xacf4('0x16');var _0x8e466c=_0x44690e['count'];var _0x5b9cd6=_0x57def1?0x0:_0x2dbf10[_0xacf4('0x15')];var _0x44610f=_0x57def1?_0x44690e[_0xacf4('0x18')]:_0x2dbf10[_0xacf4('0x15')]+_0x2dbf10[_0xacf4('0x17')];var _0x54c2d8;if(_0x44610f>=_0x8e466c){_0x44610f=_0x8e466c;_0x54c2d8=0xc8;}else{_0x54c2d8=0xce;}_0x4fb680['status'](_0x54c2d8);return _0x4fb680[_0xacf4('0x19')](_0xacf4('0x1a'),_0x5b9cd6+'-'+_0x44610f+'/'+_0x8e466c)[_0xacf4('0x14')](_0x44690e);}return null;};}function saveUpdates(_0x466f0f){return function(_0x3bfbe0){if(_0x3bfbe0){return _0x3bfbe0[_0xacf4('0x1b')](_0x466f0f)[_0xacf4('0x1c')](function(_0x13576){return _0x13576;});}return null;};}function removeEntity(_0x13b797){return function(_0x55cad3){if(_0x55cad3){return _0x55cad3[_0xacf4('0x1d')]()[_0xacf4('0x1c')](function(){_0x13b797[_0xacf4('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f5fd7){return function(_0xaaa6ba){if(!_0xaaa6ba){_0x2f5fd7[_0xacf4('0x11')](0x194);}return _0xaaa6ba;};}function handleError(_0x5b451b,_0x4a0d37){_0x4a0d37=_0x4a0d37||0x1f4;return function(_0x47d284){logger[_0xacf4('0x1e')](_0x47d284[_0xacf4('0x1f')]);if(_0x47d284[_0xacf4('0x20')]){delete _0x47d284[_0xacf4('0x20')];}_0x5b451b[_0xacf4('0x12')](_0x4a0d37)['send'](_0x47d284);};}exports[_0xacf4('0x21')]=function(_0x15164f,_0x300765){var _0x51438d={};var _0x2baf52=_[_0xacf4('0x22')](db[_0xacf4('0x23')][_0xacf4('0x24')],function(_0x8bad9){return{'name':_0x8bad9['fieldName'],'type':_0x8bad9[_0xacf4('0x25')][_0xacf4('0x26')]};});_0x51438d=qs[_0xacf4('0x27')](_0x2baf52,_0x15164f);return interaction['findAll'](_0xacf4('0x28'),_0x15164f[_0xacf4('0x29')],_0x15164f[_0xacf4('0x2a')],_0x51438d,_0x2baf52)[_0xacf4('0x1c')](respondWithFilteredResult(_0x300765,_0x51438d))['catch'](handleError(_0x300765,null));};exports[_0xacf4('0x2b')]=function(_0x1fa5b8,_0x5ec53c){var _0x251ea7={'raw':![],'where':{'id':_0x1fa5b8[_0xacf4('0x2c')]['id']}},_0x3ff74c={};_0x3ff74c['model']=_[_0xacf4('0x2d')](db[_0xacf4('0x23')]['rawAttributes']);_0x3ff74c[_0xacf4('0x29')]=_['keys'](_0x1fa5b8[_0xacf4('0x29')]);_0x3ff74c[_0xacf4('0x2e')]=_[_0xacf4('0x2f')](_0x3ff74c['model'],_0x3ff74c[_0xacf4('0x29')]);_0x251ea7[_0xacf4('0x30')]=_[_0xacf4('0x2f')](_0x3ff74c[_0xacf4('0x31')],qs[_0xacf4('0x32')](_0x1fa5b8[_0xacf4('0x29')]['fields']));_0x251ea7[_0xacf4('0x30')]=_0x251ea7[_0xacf4('0x30')][_0xacf4('0x33')]?_0x251ea7['attributes']:_0x3ff74c['model'];if(_0x1fa5b8[_0xacf4('0x29')][_0xacf4('0x34')]){_0x251ea7[_0xacf4('0x35')]=[{'all':!![]}];}_0x251ea7=_[_0xacf4('0x36')]({},_0x251ea7,_0x1fa5b8[_0xacf4('0x37')]);return db[_0xacf4('0x23')][_0xacf4('0x38')](_0x251ea7)[_0xacf4('0x1c')](handleEntityNotFound(_0x5ec53c,null))['then'](respondWithResult(_0x5ec53c,null))[_0xacf4('0x39')](handleError(_0x5ec53c,null));};exports[_0xacf4('0x3a')]=function(_0x1d44b9,_0x404152){return db['WhatsappInteraction'][_0xacf4('0x3a')](_0x1d44b9['body'],{})[_0xacf4('0x1c')](respondWithResult(_0x404152,0xc9))[_0xacf4('0x39')](handleError(_0x404152,null));};exports['update']=function(_0x552d0a,_0x43accf){if(_0x552d0a[_0xacf4('0x3b')]['id']){delete _0x552d0a[_0xacf4('0x3b')]['id'];}return db[_0xacf4('0x23')]['find']({'where':{'id':_0x552d0a['params']['id']}})[_0xacf4('0x1c')](handleEntityNotFound(_0x43accf,null))['then'](saveUpdates(_0x552d0a['body'],null))[_0xacf4('0x1c')](respondWithResult(_0x43accf,null))[_0xacf4('0x39')](handleError(_0x43accf,null));};exports[_0xacf4('0x1d')]=function(_0x22b880,_0x3f2723){return db[_0xacf4('0x23')][_0xacf4('0x38')]({'where':{'id':_0x22b880[_0xacf4('0x2c')]['id']}})[_0xacf4('0x1c')](handleEntityNotFound(_0x3f2723,null))[_0xacf4('0x1c')](removeEntity(_0x3f2723,null))[_0xacf4('0x39')](handleError(_0x3f2723,null));};exports['describe']=function(_0x35eb63,_0x4ac6ee){return db['WhatsappInteraction'][_0xacf4('0x3c')]()[_0xacf4('0x1c')](respondWithResult(_0x4ac6ee,null))[_0xacf4('0x39')](handleError(_0x4ac6ee,null));};exports[_0xacf4('0x3d')]=function(_0x544819,_0x30c277){return db[_0xacf4('0x3e')][_0xacf4('0x38')]({'where':{'id':_0x544819[_0xacf4('0x2c')]['id']}})[_0xacf4('0x1c')](handleEntityNotFound(_0x30c277,null))['then'](function(_0x2a9e87){if(_0x2a9e87){return _0x2a9e87['addMessage'](_0x544819[_0xacf4('0x3b')][_0xacf4('0x3f')],_[_0xacf4('0x40')](_0x544819[_0xacf4('0x3b')],[_0xacf4('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x30c277,null))[_0xacf4('0x39')](handleError(_0x30c277,null));};exports['getMessages']=function(_0x1c57c1,_0x28207e){var _0x2b7835={'raw':![],'where':{}};var _0x79e799={};var _0x2bfcdf={'count':0x0,'rows':[]};return db[_0xacf4('0x23')]['findOne']({'where':{'id':_0x1c57c1[_0xacf4('0x2c')]['id']}})[_0xacf4('0x1c')](handleEntityNotFound(_0x28207e,null))[_0xacf4('0x1c')](function(_0x6a12af){if(_0x6a12af){_0x79e799[_0xacf4('0x31')]=_[_0xacf4('0x2d')](db[_0xacf4('0x3e')][_0xacf4('0x24')]);_0x79e799[_0xacf4('0x29')]=_[_0xacf4('0x2d')](_0x1c57c1['query']);_0x79e799[_0xacf4('0x2e')]=_['intersection'](_0x79e799[_0xacf4('0x31')],_0x79e799[_0xacf4('0x29')]);_0x2b7835[_0xacf4('0x30')]=_['intersection'](_0x79e799[_0xacf4('0x31')],qs['fields'](_0x1c57c1[_0xacf4('0x29')][_0xacf4('0x32')]));_0x2b7835[_0xacf4('0x30')]=_0x2b7835[_0xacf4('0x30')][_0xacf4('0x33')]?_0x2b7835[_0xacf4('0x30')]:_0x79e799[_0xacf4('0x31')];if(!_0x1c57c1['query']['hasOwnProperty']('nolimit')){_0x2b7835[_0xacf4('0x17')]=qs[_0xacf4('0x17')](_0x1c57c1['query']['limit']);_0x2b7835[_0xacf4('0x15')]=qs[_0xacf4('0x15')](_0x1c57c1[_0xacf4('0x29')][_0xacf4('0x15')]);}_0x2b7835['order']=qs['sort'](_0x1c57c1[_0xacf4('0x29')]['sort']);_0x2b7835[_0xacf4('0x41')]=qs[_0xacf4('0x2e')](_[_0xacf4('0x42')](_0x1c57c1[_0xacf4('0x29')],_0x79e799['filters']));_0x2b7835[_0xacf4('0x41')][_0xacf4('0x43')]=_0x6a12af['id'];if(_0x1c57c1[_0xacf4('0x29')][_0xacf4('0x44')]){_0x2b7835[_0xacf4('0x41')]=_['merge'](_0x2b7835[_0xacf4('0x41')],{'$or':_[_0xacf4('0x22')](_0x2b7835[_0xacf4('0x30')],function(_0xdd1529){var _0x5e929d={};_0x5e929d[_0xdd1529]={'$like':'%'+_0x1c57c1[_0xacf4('0x29')]['filter']+'%'};return _0x5e929d;})});}if(_0x1c57c1['query'][_0xacf4('0x45')]){var _0xa57595=_0x1c57c1[_0xacf4('0x29')][_0xacf4('0x45')][_0xacf4('0x46')](',');var _0x4906d9={};_0x4906d9[_0xa57595[0x0]]={'$gte':moment(_0xa57595[0x1])[_0xacf4('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2b7835['where']=_[_0xacf4('0x36')](_0x2b7835[_0xacf4('0x41')],_0x4906d9);}_0x2b7835=_[_0xacf4('0x36')]({},_0x2b7835,_0x1c57c1[_0xacf4('0x37')]);return db[_0xacf4('0x3e')][_0xacf4('0x18')]({'where':_0x2b7835[_0xacf4('0x41')]})[_0xacf4('0x1c')](function(_0x55a59d){_0x2bfcdf[_0xacf4('0x18')]=_0x55a59d;if(_0x1c57c1[_0xacf4('0x29')][_0xacf4('0x34')]){_0x2b7835[_0xacf4('0x35')]=[{'all':!![]}];}return db[_0xacf4('0x3e')][_0xacf4('0x48')](_0x2b7835);})[_0xacf4('0x1c')](function(_0x4d73d5){_0x2bfcdf[_0xacf4('0x49')]=_0x4d73d5;return _0x2bfcdf;});}})[_0xacf4('0x1c')](respondWithFilteredResult(_0x28207e,_0x2b7835))[_0xacf4('0x39')](handleError(_0x28207e,null));};exports['addTags']=function(_0x25b098,_0x1cea2a){return db[_0xacf4('0x23')][_0xacf4('0x38')]({'where':{'id':_0x25b098[_0xacf4('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1cea2a,null))[_0xacf4('0x1c')](function(_0x370084){if(_0x370084){return _0x370084[_0xacf4('0x4a')](_0x25b098['body']['ids'],_[_0xacf4('0x40')](_0x25b098[_0xacf4('0x3b')],[_0xacf4('0x3f'),'id'])||{})[_0xacf4('0x4b')](function(){return db[_0xacf4('0x4c')][_0xacf4('0x48')]({'attributes':['id',_0xacf4('0x20'),_0xacf4('0x4d')],'where':{'id':_0x25b098[_0xacf4('0x3b')][_0xacf4('0x3f')]}});})['then'](function(_0x2afe55){socket['emit'](_0xacf4('0x4e'),{'id':Number(_0x25b098[_0xacf4('0x2c')]['id']),'tags':_0x2afe55||[]});return{'id':Number(_0x25b098[_0xacf4('0x2c')]['id']),'tags':_0x2afe55||[]};});}})[_0xacf4('0x1c')](respondWithResult(_0x1cea2a,null))[_0xacf4('0x39')](handleError(_0x1cea2a,null));};exports[_0xacf4('0x4f')]=function(_0x428735,_0x478629){return db[_0xacf4('0x23')][_0xacf4('0x38')]({'where':{'id':_0x428735[_0xacf4('0x2c')]['id']}})[_0xacf4('0x1c')](handleEntityNotFound(_0x478629,null))['then'](function(_0x3c7f00){if(_0x3c7f00){return _0x3c7f00[_0xacf4('0x4f')](_0x428735['query']['ids']);}})['then'](respondWithStatusCode(_0x478629,null))[_0xacf4('0x39')](handleError(_0x478629,null));};exports['download']=function(_0x3ef322,_0x124f07){var _0x643b12=moment()[_0xacf4('0x50')]()['toString']();var _0x4d7e73=path[_0xacf4('0x51')](config[_0xacf4('0x52')],_0xacf4('0x53'),'files','tmp');var _0x2c2017=path[_0xacf4('0x51')](config[_0xacf4('0x52')],_0xacf4('0x53'),'files','attachments');var _0x39a606=path[_0xacf4('0x51')](_0x4d7e73,_0x643b12);var _0x404a7b=util[_0xacf4('0x47')]('transcript-%d-%s.zip',_0x3ef322[_0xacf4('0x2c')]['id'],_0x643b12);var _0x9fe254=path[_0xacf4('0x51')](_0x4d7e73,_0x404a7b);var _0x5962a6=[];_0x5962a6[_0xacf4('0x54')]({'model':db['User'],'as':_0xacf4('0x55'),'attributes':['id',_0xacf4('0x56')],'raw':!![]});_0x5962a6[_0xacf4('0x54')]({'model':db[_0xacf4('0x57')],'as':_0xacf4('0x58'),'attributes':['id',_0xacf4('0x59'),'lastName'],'raw':!![]});if(_0x3ef322['query'][_0xacf4('0x5a')]){_0x5962a6[_0xacf4('0x54')]({'model':db['Attachment'],'as':_0xacf4('0x5b'),'raw':!![]});}var _0x523056=[{'model':db['WhatsappMessage'],'as':_0xacf4('0x5c'),'attributes':['id',_0xacf4('0x3b'),'createdAt',_0xacf4('0x5d'),_0xacf4('0x5e'),'read'],'include':_0x5962a6}];_0x523056[_0xacf4('0x54')]({'model':db[_0xacf4('0x5f')],'as':_0xacf4('0x60'),'attributes':['id',_0xacf4('0x20')]});_0x523056['push']({'model':db[_0xacf4('0x55')],'as':_0xacf4('0x61'),'attributes':['id',_0xacf4('0x56')]});return db[_0xacf4('0x23')]['find']({'where':{'id':_0x3ef322['params']['id']},'include':_0x523056})[_0xacf4('0x1c')](handleEntityNotFound(_0x124f07,null))['then'](function(_0xdb5668){if(_0xdb5668){var _0x4bbe06=_0xdb5668[_0xacf4('0x62')]({'plain':!![]});fs[_0xacf4('0x63')](_0x39a606);var _0x2d93d4={'channel':_0xacf4('0x64'),'account':_0x4bbe06[_0xacf4('0x60')][_0xacf4('0x20')],'agent':_0x4bbe06[_0xacf4('0x61')]?_0x4bbe06[_0xacf4('0x61')][_0xacf4('0x56')]:_0xacf4('0x65'),'createdAt':moment(_0x4bbe06[_0xacf4('0x66')])[_0xacf4('0x47')](_0xacf4('0x67'))['toString'](),'closedAt':_0x4bbe06[_0xacf4('0x68')]?moment(_0x4bbe06[_0xacf4('0x69')])[_0xacf4('0x47')](_0xacf4('0x67'))['toString']():'','disposition':_0x4bbe06[_0xacf4('0x6a')],'messages':_(_0x4bbe06['Messages'])[_0xacf4('0x44')]({'secret':![]})[_0xacf4('0x22')](function(_0x34f0bf){if(_0x34f0bf[_0xacf4('0x5b')]){var _0x29fae2=path[_0xacf4('0x51')](_0x2c2017,_0x34f0bf[_0xacf4('0x5b')]['basename']);if(fs[_0xacf4('0x6b')](_0x29fae2)){fs['createReadStream'](_0x29fae2)['pipe'](fs['createWriteStream'](path[_0xacf4('0x51')](_0x39a606,_0x34f0bf[_0xacf4('0x5b')][_0xacf4('0x6c')])));}}return{'date':moment(_0x34f0bf[_0xacf4('0x66')])[_0xacf4('0x47')](_0xacf4('0x67'))['toString'](),'sender':_0x34f0bf[_0xacf4('0x5d')]==='out'?_0x34f0bf[_0xacf4('0x55')]?_0x34f0bf[_0xacf4('0x55')][_0xacf4('0x56')]:_0xacf4('0x6d'):_0x34f0bf[_0xacf4('0x58')][_0xacf4('0x59')]+(_0x34f0bf[_0xacf4('0x58')][_0xacf4('0x6e')]?'\x20'+_0x34f0bf[_0xacf4('0x58')]['lastName']:''),'body':_0x34f0bf[_0xacf4('0x5b')]?_0x34f0bf[_0xacf4('0x5b')][_0xacf4('0x6c')]:_0x34f0bf[_0xacf4('0x3b')],'direction':_0x34f0bf[_0xacf4('0x5d')]===_0xacf4('0x6f')?'A':'C','secret':_0x34f0bf[_0xacf4('0x5e')],'read':_0x34f0bf[_0xacf4('0x70')],'attachment':_0x34f0bf[_0xacf4('0x5b')]};})[_0xacf4('0x71')]()};return ejs['renderFile'](path[_0xacf4('0x51')](config['root'],'server','views','downloadInteraction.ejs'),{'interaction':_0x2d93d4})[_0xacf4('0x1c')](function(_0x501ad1){var _0x3b26c5=path[_0xacf4('0x51')](_0x39a606,_0xacf4('0x72')+_0x4bbe06['id']+'-'+_0x643b12+_0xacf4('0x73'));var _0x5b6b03={'path':_0x3b26c5,'channel':_0xacf4('0x64'),'interactionId':_0x4bbe06['id']};return pdf[_0xacf4('0x74')](_0x501ad1,_0x5b6b03);})['then'](function(){return new BPromise(function(_0xf5c9e1,_0x25c666){zipdir(_0x39a606,{'saveTo':_0x9fe254},function(_0x63eac,_0x6c9feb){if(_0x63eac)return _0x25c666(_0x63eac);return _0xf5c9e1(_0x6c9feb);});})['then'](function(){return new BPromise(function(_0x36ba22,_0x2b4082){rimraf(_0x39a606,function(_0x8cd06c){if(_0x8cd06c)_0x2b4082(_0x8cd06c);return _0x36ba22();});});})['then'](function(){return _0x124f07[_0xacf4('0x75')](_0x9fe254,_0x404a7b,function(_0x593992){if(_0x593992){console['log'](_0xacf4('0x76'),_0x593992);}else{fs['unlinkSync'](_0x9fe254);}});});});}else{return _0x124f07['sendStatus'](0xc8);}})[_0xacf4('0x39')](handleError(_0x124f07,null));}; \ No newline at end of file +var _0x88ab=['basename','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','out','System','value','renderFile','transcript-','createPdfFromHTML','unlinkSync','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','undefined','limit','count','set','then','sendStatus','error','stack','name','send','map','WhatsappInteraction','rawAttributes','type','findAll','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','update','body','destroy','describe','WhatsappMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','rows','omit','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','closed','closedAt','disposition'];(function(_0xf48244,_0x115cad){var _0x37d890=function(_0x19a886){while(--_0x19a886){_0xf48244['push'](_0xf48244['shift']());}};_0x37d890(++_0x115cad);}(_0x88ab,0x82));var _0xb88a=function(_0x5d221c,_0x38f901){_0x5d221c=_0x5d221c-0x0;var _0x30c51f=_0x88ab[_0x5d221c];return _0x30c51f;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb88a('0x0'));var moment=require(_0xb88a('0x1'));var BPromise=require('bluebird');var util=require(_0xb88a('0x2'));var path=require(_0xb88a('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb88a('0x4'));var Redis=require(_0xb88a('0x5'));var interaction=require(_0xb88a('0x6'));var qs=require(_0xb88a('0x7'));var pdf=require(_0xb88a('0x8'));var logger=require(_0xb88a('0x9'))('api');var config=require(_0xb88a('0xa'));var db=require(_0xb88a('0xb'))['db'];config[_0xb88a('0xc')]=_[_0xb88a('0xd')](config[_0xb88a('0xc')],{'host':_0xb88a('0xe'),'port':0x18eb});var socket=require(_0xb88a('0xf'))(new Redis(config[_0xb88a('0xc')]));require(_0xb88a('0x10'))[_0xb88a('0x11')](socket);function respondWithStatusCode(_0x3cd182,_0x42cf0b){_0x42cf0b=_0x42cf0b||0xcc;return function(_0x181340){if(_0x181340){return _0x3cd182['sendStatus'](_0x42cf0b);}return _0x3cd182[_0xb88a('0x12')](_0x42cf0b)['end']();};}function respondWithResult(_0x2c03e6,_0x1ad25c){_0x1ad25c=_0x1ad25c||0xc8;return function(_0x4ff25d){if(_0x4ff25d){return _0x2c03e6['status'](_0x1ad25c)[_0xb88a('0x13')](_0x4ff25d);}};}function respondWithFilteredResult(_0x580b44,_0x3fdc0e){return function(_0x27a7e1){if(_0x27a7e1){var _0x1eb345=typeof _0x3fdc0e[_0xb88a('0x14')]===_0xb88a('0x15')&&typeof _0x3fdc0e[_0xb88a('0x16')]===_0xb88a('0x15');var _0x573ddd=_0x27a7e1[_0xb88a('0x17')];var _0x338b65=_0x1eb345?0x0:_0x3fdc0e[_0xb88a('0x14')];var _0x56d513=_0x1eb345?_0x27a7e1['count']:_0x3fdc0e[_0xb88a('0x14')]+_0x3fdc0e[_0xb88a('0x16')];var _0x456948;if(_0x56d513>=_0x573ddd){_0x56d513=_0x573ddd;_0x456948=0xc8;}else{_0x456948=0xce;}_0x580b44['status'](_0x456948);return _0x580b44[_0xb88a('0x18')]('Content-Range',_0x338b65+'-'+_0x56d513+'/'+_0x573ddd)[_0xb88a('0x13')](_0x27a7e1);}return null;};}function saveUpdates(_0x17729e){return function(_0x12583f){if(_0x12583f){return _0x12583f['update'](_0x17729e)['then'](function(_0x130b5d){return _0x130b5d;});}return null;};}function removeEntity(_0x1333d5){return function(_0x5bd73c){if(_0x5bd73c){return _0x5bd73c['destroy']()[_0xb88a('0x19')](function(){_0x1333d5[_0xb88a('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37be44){return function(_0x106c13){if(!_0x106c13){_0x37be44[_0xb88a('0x1a')](0x194);}return _0x106c13;};}function handleError(_0xca44d0,_0x3222d0){_0x3222d0=_0x3222d0||0x1f4;return function(_0x656cab){logger[_0xb88a('0x1b')](_0x656cab[_0xb88a('0x1c')]);if(_0x656cab[_0xb88a('0x1d')]){delete _0x656cab[_0xb88a('0x1d')];}_0xca44d0[_0xb88a('0x12')](_0x3222d0)[_0xb88a('0x1e')](_0x656cab);};}exports['index']=function(_0x31b3f3,_0x4e7deb){var _0x35766d={};var _0x51305d=_[_0xb88a('0x1f')](db[_0xb88a('0x20')][_0xb88a('0x21')],function(_0x519211){return{'name':_0x519211['fieldName'],'type':_0x519211[_0xb88a('0x22')]['key']};});_0x35766d=qs['getOptions'](_0x51305d,_0x31b3f3);return interaction[_0xb88a('0x23')](_0xb88a('0x24'),_0x31b3f3[_0xb88a('0x25')],_0x31b3f3[_0xb88a('0x26')],_0x35766d,_0x51305d)[_0xb88a('0x19')](respondWithFilteredResult(_0x4e7deb,_0x35766d))[_0xb88a('0x27')](handleError(_0x4e7deb,null));};exports[_0xb88a('0x28')]=function(_0x512bba,_0x1747b2){var _0x2099ad={'raw':![],'where':{'id':_0x512bba[_0xb88a('0x29')]['id']}},_0x9c3d72={};_0x9c3d72[_0xb88a('0x2a')]=_[_0xb88a('0x2b')](db[_0xb88a('0x20')]['rawAttributes']);_0x9c3d72['query']=_[_0xb88a('0x2b')](_0x512bba[_0xb88a('0x25')]);_0x9c3d72[_0xb88a('0x2c')]=_[_0xb88a('0x2d')](_0x9c3d72[_0xb88a('0x2a')],_0x9c3d72[_0xb88a('0x25')]);_0x2099ad[_0xb88a('0x2e')]=_[_0xb88a('0x2d')](_0x9c3d72['model'],qs[_0xb88a('0x2f')](_0x512bba[_0xb88a('0x25')]['fields']));_0x2099ad['attributes']=_0x2099ad[_0xb88a('0x2e')][_0xb88a('0x30')]?_0x2099ad[_0xb88a('0x2e')]:_0x9c3d72[_0xb88a('0x2a')];if(_0x512bba[_0xb88a('0x25')][_0xb88a('0x31')]){_0x2099ad[_0xb88a('0x32')]=[{'all':!![]}];}_0x2099ad=_[_0xb88a('0x33')]({},_0x2099ad,_0x512bba[_0xb88a('0x34')]);return db[_0xb88a('0x20')][_0xb88a('0x35')](_0x2099ad)[_0xb88a('0x19')](handleEntityNotFound(_0x1747b2,null))[_0xb88a('0x19')](respondWithResult(_0x1747b2,null))[_0xb88a('0x27')](handleError(_0x1747b2,null));};exports[_0xb88a('0x36')]=function(_0x2c987f,_0x5a7603){return db[_0xb88a('0x20')][_0xb88a('0x36')](_0x2c987f['body'],{})['then'](respondWithResult(_0x5a7603,0xc9))[_0xb88a('0x27')](handleError(_0x5a7603,null));};exports[_0xb88a('0x37')]=function(_0x1c22ce,_0x4215ca){if(_0x1c22ce[_0xb88a('0x38')]['id']){delete _0x1c22ce[_0xb88a('0x38')]['id'];}return db[_0xb88a('0x20')]['find']({'where':{'id':_0x1c22ce[_0xb88a('0x29')]['id']}})[_0xb88a('0x19')](handleEntityNotFound(_0x4215ca,null))['then'](saveUpdates(_0x1c22ce[_0xb88a('0x38')],null))['then'](respondWithResult(_0x4215ca,null))['catch'](handleError(_0x4215ca,null));};exports[_0xb88a('0x39')]=function(_0x157cbe,_0x52f673){return db['WhatsappInteraction'][_0xb88a('0x35')]({'where':{'id':_0x157cbe[_0xb88a('0x29')]['id']}})['then'](handleEntityNotFound(_0x52f673,null))[_0xb88a('0x19')](removeEntity(_0x52f673,null))[_0xb88a('0x27')](handleError(_0x52f673,null));};exports[_0xb88a('0x3a')]=function(_0x4729d8,_0x4fef49){return db[_0xb88a('0x20')][_0xb88a('0x3a')]()['then'](respondWithResult(_0x4fef49,null))[_0xb88a('0x27')](handleError(_0x4fef49,null));};exports['addMessage']=function(_0x3af880,_0x51f182){return db[_0xb88a('0x3b')][_0xb88a('0x35')]({'where':{'id':_0x3af880['params']['id']}})[_0xb88a('0x19')](handleEntityNotFound(_0x51f182,null))[_0xb88a('0x19')](function(_0x4f8a6e){if(_0x4f8a6e){return _0x4f8a6e['addMessage'](_0x3af880[_0xb88a('0x38')]['ids'],_['omit'](_0x3af880[_0xb88a('0x38')],[_0xb88a('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x51f182,null))[_0xb88a('0x27')](handleError(_0x51f182,null));};exports['getMessages']=function(_0x49c59f,_0x3e0490){var _0x513a04={'raw':![],'where':{}};var _0x54a49f={};var _0x1a0c3d={'count':0x0,'rows':[]};return db[_0xb88a('0x20')][_0xb88a('0x3d')]({'where':{'id':_0x49c59f[_0xb88a('0x29')]['id']}})[_0xb88a('0x19')](handleEntityNotFound(_0x3e0490,null))['then'](function(_0x11164a){if(_0x11164a){_0x54a49f[_0xb88a('0x2a')]=_[_0xb88a('0x2b')](db[_0xb88a('0x3b')]['rawAttributes']);_0x54a49f[_0xb88a('0x25')]=_[_0xb88a('0x2b')](_0x49c59f[_0xb88a('0x25')]);_0x54a49f['filters']=_[_0xb88a('0x2d')](_0x54a49f[_0xb88a('0x2a')],_0x54a49f[_0xb88a('0x25')]);_0x513a04['attributes']=_[_0xb88a('0x2d')](_0x54a49f[_0xb88a('0x2a')],qs[_0xb88a('0x2f')](_0x49c59f['query'][_0xb88a('0x2f')]));_0x513a04[_0xb88a('0x2e')]=_0x513a04['attributes']['length']?_0x513a04[_0xb88a('0x2e')]:_0x54a49f[_0xb88a('0x2a')];if(!_0x49c59f['query'][_0xb88a('0x3e')](_0xb88a('0x3f'))){_0x513a04[_0xb88a('0x16')]=qs[_0xb88a('0x16')](_0x49c59f[_0xb88a('0x25')][_0xb88a('0x16')]);_0x513a04['offset']=qs[_0xb88a('0x14')](_0x49c59f[_0xb88a('0x25')][_0xb88a('0x14')]);}_0x513a04[_0xb88a('0x40')]=qs['sort'](_0x49c59f['query'][_0xb88a('0x41')]);_0x513a04[_0xb88a('0x42')]=qs[_0xb88a('0x2c')](_[_0xb88a('0x43')](_0x49c59f[_0xb88a('0x25')],_0x54a49f[_0xb88a('0x2c')]));_0x513a04['where']['WhatsappInteractionId']=_0x11164a['id'];if(_0x49c59f[_0xb88a('0x25')]['filter']){_0x513a04[_0xb88a('0x42')]=_['merge'](_0x513a04['where'],{'$or':_[_0xb88a('0x1f')](_0x513a04[_0xb88a('0x2e')],function(_0x3784a2){var _0x224a7a={};_0x224a7a[_0x3784a2]={'$like':'%'+_0x49c59f[_0xb88a('0x25')][_0xb88a('0x44')]+'%'};return _0x224a7a;})});}if(_0x49c59f['query'][_0xb88a('0x45')]){var _0x41f11c=_0x49c59f['query'][_0xb88a('0x45')]['split'](',');var _0x548d4f={};_0x548d4f[_0x41f11c[0x0]]={'$gte':moment(_0x41f11c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x513a04[_0xb88a('0x42')]=_['merge'](_0x513a04[_0xb88a('0x42')],_0x548d4f);}_0x513a04=_[_0xb88a('0x33')]({},_0x513a04,_0x49c59f[_0xb88a('0x34')]);return db[_0xb88a('0x3b')][_0xb88a('0x17')]({'where':_0x513a04[_0xb88a('0x42')]})[_0xb88a('0x19')](function(_0x38e8d7){_0x1a0c3d[_0xb88a('0x17')]=_0x38e8d7;if(_0x49c59f[_0xb88a('0x25')][_0xb88a('0x31')]){_0x513a04['include']=[{'all':!![]}];}return db[_0xb88a('0x3b')]['findAll'](_0x513a04);})[_0xb88a('0x19')](function(_0x147095){_0x1a0c3d[_0xb88a('0x46')]=_0x147095;return _0x1a0c3d;});}})[_0xb88a('0x19')](respondWithFilteredResult(_0x3e0490,_0x513a04))['catch'](handleError(_0x3e0490,null));};exports['addTags']=function(_0x3eddb0,_0x323588){return db[_0xb88a('0x20')][_0xb88a('0x35')]({'where':{'id':_0x3eddb0[_0xb88a('0x29')]['id']}})[_0xb88a('0x19')](handleEntityNotFound(_0x323588,null))[_0xb88a('0x19')](function(_0xeec87){if(_0xeec87){return _0xeec87['setTags'](_0x3eddb0[_0xb88a('0x38')]['ids'],_[_0xb88a('0x47')](_0x3eddb0[_0xb88a('0x38')],[_0xb88a('0x3c'),'id'])||{})['spread'](function(){return db[_0xb88a('0x48')][_0xb88a('0x23')]({'attributes':['id',_0xb88a('0x1d'),_0xb88a('0x49')],'where':{'id':_0x3eddb0[_0xb88a('0x38')]['ids']}});})[_0xb88a('0x19')](function(_0x2a915a){socket[_0xb88a('0x4a')]('whatsappInteractionTags:save',{'id':Number(_0x3eddb0[_0xb88a('0x29')]['id']),'tags':_0x2a915a||[]});return{'id':Number(_0x3eddb0['params']['id']),'tags':_0x2a915a||[]};});}})['then'](respondWithResult(_0x323588,null))[_0xb88a('0x27')](handleError(_0x323588,null));};exports[_0xb88a('0x4b')]=function(_0x2924bb,_0x2fc45e){return db[_0xb88a('0x20')][_0xb88a('0x35')]({'where':{'id':_0x2924bb['params']['id']}})[_0xb88a('0x19')](handleEntityNotFound(_0x2fc45e,null))[_0xb88a('0x19')](function(_0x23fcc7){if(_0x23fcc7){return _0x23fcc7[_0xb88a('0x4b')](_0x2924bb[_0xb88a('0x25')][_0xb88a('0x3c')]);}})['then'](respondWithStatusCode(_0x2fc45e,null))[_0xb88a('0x27')](handleError(_0x2fc45e,null));};exports[_0xb88a('0x4c')]=function(_0xbe3668,_0x388377){var _0xa41ccd=moment()[_0xb88a('0x4d')]()[_0xb88a('0x4e')]();var _0x1fb61d=path[_0xb88a('0x4f')](config[_0xb88a('0x50')],_0xb88a('0x51'),_0xb88a('0x52'),_0xb88a('0x53'));var _0x581543=path[_0xb88a('0x4f')](config[_0xb88a('0x50')],_0xb88a('0x51'),_0xb88a('0x52'),_0xb88a('0x54'));var _0x1c7735=path[_0xb88a('0x4f')](_0x1fb61d,_0xa41ccd);var _0x5b7151=util[_0xb88a('0x55')]('transcript-%d-%s.zip',_0xbe3668[_0xb88a('0x29')]['id'],_0xa41ccd);var _0x50b20e=path[_0xb88a('0x4f')](_0x1fb61d,_0x5b7151);var _0x3f448c=[];_0x3f448c[_0xb88a('0x56')]({'model':db[_0xb88a('0x57')],'as':'User','attributes':['id',_0xb88a('0x58')],'raw':!![]});_0x3f448c[_0xb88a('0x56')]({'model':db['CmContact'],'as':_0xb88a('0x59'),'attributes':['id',_0xb88a('0x5a'),_0xb88a('0x5b')],'raw':!![]});if(_0xbe3668[_0xb88a('0x25')][_0xb88a('0x54')]){_0x3f448c[_0xb88a('0x56')]({'model':db[_0xb88a('0x5c')],'as':_0xb88a('0x5c'),'raw':!![]});}var _0x4b1530=[{'model':db[_0xb88a('0x3b')],'as':_0xb88a('0x5d'),'attributes':['id',_0xb88a('0x38'),_0xb88a('0x5e'),_0xb88a('0x5f'),_0xb88a('0x60'),_0xb88a('0x61')],'include':_0x3f448c}];_0x4b1530['push']({'model':db[_0xb88a('0x62')],'as':_0xb88a('0x63'),'attributes':['id',_0xb88a('0x1d')]});_0x4b1530[_0xb88a('0x56')]({'model':db[_0xb88a('0x57')],'as':_0xb88a('0x64'),'attributes':['id',_0xb88a('0x58')]});return db['WhatsappInteraction'][_0xb88a('0x35')]({'where':{'id':_0xbe3668['params']['id']},'include':_0x4b1530})[_0xb88a('0x19')](handleEntityNotFound(_0x388377,null))[_0xb88a('0x19')](function(_0x42555c){if(_0x42555c){var _0x4c9b6a=_0x42555c[_0xb88a('0x65')]({'plain':!![]});fs[_0xb88a('0x66')](_0x1c7735);var _0x4c3617={'channel':'Whatsapp','account':_0x4c9b6a[_0xb88a('0x63')]['name'],'agent':_0x4c9b6a[_0xb88a('0x64')]?_0x4c9b6a[_0xb88a('0x64')][_0xb88a('0x58')]:'N.A.','createdAt':moment(_0x4c9b6a[_0xb88a('0x5e')])[_0xb88a('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb88a('0x4e')](),'closedAt':_0x4c9b6a[_0xb88a('0x67')]?moment(_0x4c9b6a[_0xb88a('0x68')])[_0xb88a('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb88a('0x4e')]():'','disposition':_0x4c9b6a[_0xb88a('0x69')],'messages':_(_0x4c9b6a[_0xb88a('0x5d')])[_0xb88a('0x44')]({'secret':![]})[_0xb88a('0x1f')](function(_0x184e95){if(_0x184e95[_0xb88a('0x5c')]){var _0x29cf21=path['join'](_0x581543,_0x184e95[_0xb88a('0x5c')][_0xb88a('0x6a')]);if(fs[_0xb88a('0x6b')](_0x29cf21)){fs[_0xb88a('0x6c')](_0x29cf21)[_0xb88a('0x6d')](fs['createWriteStream'](path[_0xb88a('0x4f')](_0x1c7735,_0x184e95[_0xb88a('0x5c')][_0xb88a('0x6a')])));}}return{'date':moment(_0x184e95['createdAt'])[_0xb88a('0x55')](_0xb88a('0x6e'))[_0xb88a('0x4e')](),'sender':_0x184e95[_0xb88a('0x5f')]===_0xb88a('0x6f')?_0x184e95[_0xb88a('0x57')]?_0x184e95['User'][_0xb88a('0x58')]:_0xb88a('0x70'):_0x184e95['Contact'][_0xb88a('0x5a')]+(_0x184e95[_0xb88a('0x59')][_0xb88a('0x5b')]?'\x20'+_0x184e95[_0xb88a('0x59')]['lastName']:''),'body':_0x184e95['Attachment']?_0x184e95[_0xb88a('0x5c')][_0xb88a('0x6a')]:_0x184e95['body'],'direction':_0x184e95[_0xb88a('0x5f')]===_0xb88a('0x6f')?'A':'C','secret':_0x184e95['secret'],'read':_0x184e95['read'],'attachment':_0x184e95[_0xb88a('0x5c')]};})[_0xb88a('0x71')]()};return ejs[_0xb88a('0x72')](path[_0xb88a('0x4f')](config[_0xb88a('0x50')],'server','views','downloadInteraction.ejs'),{'interaction':_0x4c3617})[_0xb88a('0x19')](function(_0x105702){var _0x2aa1d7=path[_0xb88a('0x4f')](_0x1c7735,_0xb88a('0x73')+_0x4c9b6a['id']+'-'+_0xa41ccd+'.pdf');var _0x1b49dc={'path':_0x2aa1d7,'channel':'Whatsapp','interactionId':_0x4c9b6a['id']};return pdf[_0xb88a('0x74')](_0x105702,_0x1b49dc);})[_0xb88a('0x19')](function(){return new BPromise(function(_0x59c3a4,_0x3b3dd2){zipdir(_0x1c7735,{'saveTo':_0x50b20e},function(_0xc7ddfa,_0x1ff716){if(_0xc7ddfa)return _0x3b3dd2(_0xc7ddfa);return _0x59c3a4(_0x1ff716);});})[_0xb88a('0x19')](function(){return new BPromise(function(_0x5707a8,_0x97b610){rimraf(_0x1c7735,function(_0x34a4ce){if(_0x34a4ce)_0x97b610(_0x34a4ce);return _0x5707a8();});});})[_0xb88a('0x19')](function(){return _0x388377[_0xb88a('0x4c')](_0x50b20e,_0x5b7151,function(_0x214501){if(_0x214501){console['log']('err',_0x214501);}else{fs[_0xb88a('0x75')](_0x50b20e);}});});});}else{return _0x388377[_0xb88a('0x1a')](0xc8);}})['catch'](handleError(_0x388377,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index e7269e9..f280aad 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 _0x60d7=['setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x441ff3,_0x3a410f){var _0x380dca=function(_0x1411d8){while(--_0x1411d8){_0x441ff3['push'](_0x441ff3['shift']());}};_0x380dca(++_0x3a410f);}(_0x60d7,0x139));var _0x760d=function(_0x3cb0fe,_0x48f725){_0x3cb0fe=_0x3cb0fe-0x0;var _0x3ed506=_0x60d7[_0x3cb0fe];return _0x3ed506;};'use strict';var EventEmitter=require(_0x760d('0x0'));var WhatsappInteraction=require(_0x760d('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x760d('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x760d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x760d('0x3'),'afterDestroy':_0x760d('0x4')};function emitEvent(_0x2eebb3){return function(_0x2d963b,_0x47affe,_0x34ebba){_0x2d963b[_0x760d('0x5')]({'attributes':['id'],'raw':!![]})[_0x760d('0x6')](function(_0x463b41){_0x2d963b[_0x760d('0x7')]('Users',_0x463b41[_0x760d('0x8')](function(_0x3ffaa4){return{'id':_0x3ffaa4['id']};}));return WhatsappMessage[_0x760d('0x9')]({'where':{'WhatsappInteractionId':_0x2d963b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x465102){_0x2d963b[_0x760d('0x7')](_0x760d('0xa'),_0x465102['length']);WhatsappInteractionEvents[_0x760d('0xb')](_0x2eebb3+':'+_0x2d963b['id'],_0x2d963b);WhatsappInteractionEvents[_0x760d('0xb')](_0x2eebb3,_0x2d963b);_0x34ebba(null);})['catch'](_0x34ebba(null));};}for(var e in events){if(events[_0x760d('0xc')](e)){var event=events[e];WhatsappInteraction[_0x760d('0xd')](e,emitEvent(event));}}module[_0x760d('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xd624=['update','remove','setDataValue','Users','map','then','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c81fa,_0xad0bd9){var _0x4b8bf9=function(_0x2fc9b5){while(--_0x2fc9b5){_0x1c81fa['push'](_0x1c81fa['shift']());}};_0x4b8bf9(++_0xad0bd9);}(_0xd624,0x124));var _0x4d62=function(_0x245b87,_0x1e56b6){_0x245b87=_0x245b87-0x0;var _0x28ed52=_0xd624[_0x245b87];return _0x28ed52;};'use strict';var EventEmitter=require(_0x4d62('0x0'));var WhatsappInteraction=require(_0x4d62('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x4d62('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d62('0x2'),'afterDestroy':_0x4d62('0x3')};function emitEvent(_0x231932){return function(_0x1a7587,_0x311462,_0x2582df){_0x1a7587['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x133d24){_0x1a7587[_0x4d62('0x4')](_0x4d62('0x5'),_0x133d24[_0x4d62('0x6')](function(_0xa80583){return{'id':_0xa80583['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x1a7587['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4d62('0x7')](function(_0x62e82e){_0x1a7587[_0x4d62('0x4')](_0x4d62('0x8'),_0x62e82e['length']);WhatsappInteractionEvents[_0x4d62('0x9')](_0x231932+':'+_0x1a7587['id'],_0x1a7587);WhatsappInteractionEvents[_0x4d62('0x9')](_0x231932,_0x1a7587);_0x2582df(null);})[_0x4d62('0xa')](_0x2582df(null));};}for(var e in events){if(events[_0x4d62('0xb')](e)){var event=events[e];WhatsappInteraction[_0x4d62('0xc')](e,emitEvent(event));}}module[_0x4d62('0xd')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 6437f77..103be24 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 _0xad9f=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad9f,0x1be));var _0xfad9=function(_0x117ae5,_0x5ea5b0){_0x117ae5=_0x117ae5-0x0;var _0xcd6156=_0xad9f[_0x117ae5];return _0xcd6156;};'use strict';var _=require(_0xfad9('0x0'));var util=require(_0xfad9('0x1'));var logger=require(_0xfad9('0x2'))('api');var moment=require(_0xfad9('0x3'));var BPromise=require(_0xfad9('0x4'));var rp=require(_0xfad9('0x5'));var fs=require('fs');var path=require(_0xfad9('0x6'));var rimraf=require('rimraf');var config=require(_0xfad9('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xfad9('0x8')]=function(_0x24d3fb,_0x19230a){return _0x24d3fb[_0xfad9('0x9')](_0xfad9('0xa'),attributes,{'tableName':_0xfad9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d46a7,_0x5580be,_0x121cd4){if(_0x4d46a7[_0xfad9('0xc')](_0xfad9('0xd'))){_0x4d46a7[_0xfad9('0xe')]=moment()[_0xfad9('0xf')](_0xfad9('0x10'));}_0x121cd4(null,_0x4d46a7);}}});}; \ No newline at end of file +var _0x81d4=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt'];(function(_0x2699fc,_0x45f889){var _0x264208=function(_0x425fc6){while(--_0x425fc6){_0x2699fc['push'](_0x2699fc['shift']());}};_0x264208(++_0x45f889);}(_0x81d4,0xa7));var _0x481d=function(_0x93cad8,_0x1f4bf6){_0x93cad8=_0x93cad8-0x0;var _0xb088df=_0x81d4[_0x93cad8];return _0xb088df;};'use strict';var _=require(_0x481d('0x0'));var util=require(_0x481d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x481d('0x2'));var BPromise=require(_0x481d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x481d('0x4'));var config=require(_0x481d('0x5'));var attributes=require(_0x481d('0x6'));module[_0x481d('0x7')]=function(_0x376a12,_0x4b3a98){return _0x376a12['define'](_0x481d('0x8'),attributes,{'tableName':_0x481d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15a9d2,_0x21980b,_0xb356e7){if(_0x15a9d2[_0x481d('0xa')](_0x481d('0xb'))){_0x15a9d2[_0x481d('0xc')]=moment()[_0x481d('0xd')](_0x481d('0xe'));}_0xb356e7(null,_0x15a9d2);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 9a9dc93..4f22c84 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 _0x6e6f=['request\x20sent','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','addTags','ids','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x6e6f,0x1ca));var _0xf6e6=function(_0x49279c,_0x56da65){_0x49279c=_0x49279c-0x0;var _0x472c04=_0x6e6f[_0x49279c];return _0x472c04;};'use strict';var _=require('lodash');var util=require(_0xf6e6('0x0'));var moment=require(_0xf6e6('0x1'));var BPromise=require(_0xf6e6('0x2'));var rs=require(_0xf6e6('0x3'));var fs=require('fs');var Redis=require(_0xf6e6('0x4'));var db=require(_0xf6e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6e6('0x6'))('rpc');var config=require(_0xf6e6('0x7'));var jayson=require(_0xf6e6('0x8'));var client=jayson[_0xf6e6('0x9')][_0xf6e6('0xa')]({'port':0x232a});config[_0xf6e6('0xb')]=_[_0xf6e6('0xc')](config[_0xf6e6('0xb')],{'host':_0xf6e6('0xd'),'port':0x18eb});var socket=require(_0xf6e6('0xe'))(new Redis(config[_0xf6e6('0xb')]));require('./whatsappInteraction.socket')[_0xf6e6('0xf')](socket);function respondWithRpcPromise(_0xdad741,_0x5a22af,_0x1de9cb){return new BPromise(function(_0x637401,_0x1efaea){return client[_0xf6e6('0x10')](_0xdad741,_0x1de9cb)[_0xf6e6('0x11')](function(_0x364d51){logger[_0xf6e6('0x12')](_0xf6e6('0x13'),_0x5a22af,'request\x20sent');logger[_0xf6e6('0x14')](_0xf6e6('0x15'),_0x5a22af,_0xf6e6('0x16'),JSON['stringify'](_0x364d51));if(_0x364d51[_0xf6e6('0x17')]){if(_0x364d51[_0xf6e6('0x17')]['code']===0x1f4){logger['error'](_0xf6e6('0x13'),_0x5a22af,_0x364d51[_0xf6e6('0x17')][_0xf6e6('0x18')]);return _0x1efaea(_0x364d51[_0xf6e6('0x17')]['message']);}logger[_0xf6e6('0x17')](_0xf6e6('0x13'),_0x5a22af,_0x364d51[_0xf6e6('0x17')][_0xf6e6('0x18')]);return _0x637401(_0x364d51['error']['message']);}else{logger[_0xf6e6('0x12')](_0xf6e6('0x13'),_0x5a22af,_0xf6e6('0x16'));_0x637401(_0x364d51[_0xf6e6('0x19')][_0xf6e6('0x18')]);}})['catch'](function(_0x5b42ea){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x5a22af,_0x5b42ea);_0x1efaea(_0x5b42ea);});});}exports[_0xf6e6('0x1a')]=function(_0x45762a){var _0x1e1760=this;return new Promise(function(_0x3a1cc3,_0x2e025d){return db[_0xf6e6('0x1b')][_0xf6e6('0x1c')](_0x45762a[_0xf6e6('0x1d')],{'raw':_0x45762a[_0xf6e6('0x1e')]?_0x45762a[_0xf6e6('0x1e')][_0xf6e6('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45762a[_0xf6e6('0x1e')]?_0x45762a['options'][_0xf6e6('0x20')]||null:null,'attributes':_0x45762a[_0xf6e6('0x1e')]?_0x45762a[_0xf6e6('0x1e')][_0xf6e6('0x21')]||null:null,'limit':_0x45762a[_0xf6e6('0x1e')]?_0x45762a[_0xf6e6('0x1e')][_0xf6e6('0x22')]||null:null})[_0xf6e6('0x11')](function(_0x3c6d46){logger[_0xf6e6('0x12')]('UpdateWhatsappInteraction',_0x45762a);logger[_0xf6e6('0x14')]('UpdateWhatsappInteraction',_0x45762a,JSON[_0xf6e6('0x23')](_0x3c6d46));_0x3a1cc3(_0x3c6d46);})[_0xf6e6('0x24')](function(_0x15b1ca){logger[_0xf6e6('0x17')]('UpdateWhatsappInteraction',_0x15b1ca[_0xf6e6('0x18')],_0x45762a);_0x2e025d(_0x1e1760['error'](0x1f4,_0x15b1ca[_0xf6e6('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1f5387){return new Promise(function(_0x129944,_0x56446d){return db['WhatsappInteraction']['find']({'where':_0x1f5387[_0xf6e6('0x1e')]?_0x1f5387[_0xf6e6('0x1e')]['where']||null:null})[_0xf6e6('0x11')](function(_0xbb99d0){if(_0xbb99d0){return _0xbb99d0[_0xf6e6('0x25')](_0x1f5387['body'][_0xf6e6('0x26')],_['omit'](_0x1f5387[_0xf6e6('0x1d')],[_0xf6e6('0x26'),'id'])||{});}})['spread'](function(_0x3fad2e){logger['info'](_0xf6e6('0x27'),_0x1f5387);logger[_0xf6e6('0x14')](_0xf6e6('0x27'),_0x1f5387,JSON['stringify'](_0x3fad2e));_0x129944(_0x3fad2e);})[_0xf6e6('0x24')](function(_0xaa9dcb){logger['error']('AddTags',_0xaa9dcb['message'],_0x1f5387);_0x56446d(_this[_0xf6e6('0x17')](0x1f4,_0xaa9dcb['message']));});});}; \ No newline at end of file +var _0xa1f8=['message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa1f8,0x131));var _0x8a1f=function(_0x222f3c,_0x1b327c){_0x222f3c=_0x222f3c-0x0;var _0x28e555=_0xa1f8[_0x222f3c];return _0x28e555;};'use strict';var _=require(_0x8a1f('0x0'));var util=require(_0x8a1f('0x1'));var moment=require(_0x8a1f('0x2'));var BPromise=require(_0x8a1f('0x3'));var rs=require(_0x8a1f('0x4'));var fs=require('fs');var Redis=require(_0x8a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a1f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a1f('0x7'));var jayson=require(_0x8a1f('0x8'));var client=jayson[_0x8a1f('0x9')]['http']({'port':0x232a});config[_0x8a1f('0xa')]=_[_0x8a1f('0xb')](config[_0x8a1f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a1f('0xc'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x8a1f('0xd')](socket);function respondWithRpcPromise(_0x111018,_0x3a2abe,_0x4b7407){return new BPromise(function(_0x166a4e,_0x5cad7a){return client[_0x8a1f('0xe')](_0x111018,_0x4b7407)[_0x8a1f('0xf')](function(_0x50cd5e){logger[_0x8a1f('0x10')](_0x8a1f('0x11'),_0x3a2abe,'request\x20sent');logger[_0x8a1f('0x12')](_0x8a1f('0x13'),_0x3a2abe,_0x8a1f('0x14'),JSON['stringify'](_0x50cd5e));if(_0x50cd5e[_0x8a1f('0x15')]){if(_0x50cd5e['error'][_0x8a1f('0x16')]===0x1f4){logger[_0x8a1f('0x15')](_0x8a1f('0x11'),_0x3a2abe,_0x50cd5e['error']['message']);return _0x5cad7a(_0x50cd5e[_0x8a1f('0x15')][_0x8a1f('0x17')]);}logger[_0x8a1f('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x3a2abe,_0x50cd5e[_0x8a1f('0x15')]['message']);return _0x166a4e(_0x50cd5e['error'][_0x8a1f('0x17')]);}else{logger[_0x8a1f('0x10')](_0x8a1f('0x11'),_0x3a2abe,_0x8a1f('0x14'));_0x166a4e(_0x50cd5e[_0x8a1f('0x18')][_0x8a1f('0x17')]);}})[_0x8a1f('0x19')](function(_0x23f1b4){logger[_0x8a1f('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x3a2abe,_0x23f1b4);_0x5cad7a(_0x23f1b4);});});}exports[_0x8a1f('0x1a')]=function(_0x3815c5){var _0x3e91bb=this;return new Promise(function(_0x31c347,_0x4e0821){return db[_0x8a1f('0x1b')][_0x8a1f('0x1c')](_0x3815c5[_0x8a1f('0x1d')],{'raw':_0x3815c5['options']?_0x3815c5[_0x8a1f('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3815c5[_0x8a1f('0x1e')]?_0x3815c5[_0x8a1f('0x1e')][_0x8a1f('0x1f')]||null:null,'attributes':_0x3815c5[_0x8a1f('0x1e')]?_0x3815c5[_0x8a1f('0x1e')][_0x8a1f('0x20')]||null:null,'limit':_0x3815c5[_0x8a1f('0x1e')]?_0x3815c5[_0x8a1f('0x1e')]['limit']||null:null})[_0x8a1f('0xf')](function(_0x290dbc){logger['info'](_0x8a1f('0x1a'),_0x3815c5);logger[_0x8a1f('0x12')]('UpdateWhatsappInteraction',_0x3815c5,JSON[_0x8a1f('0x21')](_0x290dbc));_0x31c347(_0x290dbc);})[_0x8a1f('0x19')](function(_0xe6de19){logger['error'](_0x8a1f('0x1a'),_0xe6de19[_0x8a1f('0x17')],_0x3815c5);_0x4e0821(_0x3e91bb['error'](0x1f4,_0xe6de19[_0x8a1f('0x17')]));});});};exports[_0x8a1f('0x22')]=function(_0x52e695){return new Promise(function(_0x1e4124,_0x494dab){return db['WhatsappInteraction'][_0x8a1f('0x23')]({'where':_0x52e695[_0x8a1f('0x1e')]?_0x52e695['options'][_0x8a1f('0x1f')]||null:null})[_0x8a1f('0xf')](function(_0x4f13f0){if(_0x4f13f0){return _0x4f13f0[_0x8a1f('0x24')](_0x52e695['body'][_0x8a1f('0x25')],_[_0x8a1f('0x26')](_0x52e695[_0x8a1f('0x1d')],[_0x8a1f('0x25'),'id'])||{});}})[_0x8a1f('0x27')](function(_0x20db89){logger[_0x8a1f('0x10')](_0x8a1f('0x28'),_0x52e695);logger[_0x8a1f('0x12')]('AddTags',_0x52e695,JSON[_0x8a1f('0x21')](_0x20db89));_0x1e4124(_0x20db89);})['catch'](function(_0x1a5134){logger['error'](_0x8a1f('0x28'),_0x1a5134[_0x8a1f('0x17')],_0x52e695);_0x494dab(_this['error'](0x1f4,_0x1a5134[_0x8a1f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 55f48e4..8a9b17e 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 _0xc0c4=['save','remove','update','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x5b601a,_0x52e161){var _0x183b9b=function(_0x344e60){while(--_0x344e60){_0x5b601a['push'](_0x5b601a['shift']());}};_0x183b9b(++_0x52e161);}(_0xc0c4,0x18f));var _0x4c0c=function(_0x155737,_0x552b34){_0x155737=_0x155737-0x0;var _0x48a879=_0xc0c4[_0x155737];return _0x48a879;};'use strict';var WhatsappInteractionEvents=require(_0x4c0c('0x0'));var events=[_0x4c0c('0x1'),_0x4c0c('0x2'),_0x4c0c('0x3')];function createListener(_0x792d4a,_0x27bc75){return function(_0x5f515a){_0x27bc75[_0x4c0c('0x4')](_0x792d4a,_0x5f515a);};}function removeListener(_0x430ed3,_0x3eba5e){return function(){WhatsappInteractionEvents[_0x4c0c('0x5')](_0x430ed3,_0x3eba5e);};}exports['register']=function(_0x1a63d3){for(var _0x4df043=0x0,_0x5503bd=events[_0x4c0c('0x6')];_0x4df043<_0x5503bd;_0x4df043++){var _0x428e3c=events[_0x4df043];var _0x31d670=createListener(_0x4c0c('0x7')+_0x428e3c,_0x1a63d3);WhatsappInteractionEvents['on'](_0x428e3c,_0x31d670);}}; \ No newline at end of file +var _0xc8e3=['update','emit','removeListener','register','length','whatsappInteraction:','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc8e3,0x15d));var _0x3c8e=function(_0x1ce317,_0x90c618){_0x1ce317=_0x1ce317-0x0;var _0x185f56=_0xc8e3[_0x1ce317];return _0x185f56;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x3c8e('0x0'),_0x3c8e('0x1')];function createListener(_0x168509,_0x3aab82){return function(_0x3ab29b){_0x3aab82[_0x3c8e('0x2')](_0x168509,_0x3ab29b);};}function removeListener(_0x65335a,_0xc6354e){return function(){WhatsappInteractionEvents[_0x3c8e('0x3')](_0x65335a,_0xc6354e);};}exports[_0x3c8e('0x4')]=function(_0x6b8c2e){for(var _0x23555a=0x0,_0x2c2ab7=events[_0x3c8e('0x5')];_0x23555a<_0x2c2ab7;_0x23555a++){var _0x1aa114=events[_0x23555a];var _0x54f2ce=createListener(_0x3c8e('0x6')+_0x1aa114,_0x6b8c2e);WhatsappInteractionEvents['on'](_0x1aa114,_0x54f2ce);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index fe44b48..3f3d65d 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 _0x28fc=['status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp'];(function(_0x532437,_0x404706){var _0x29a9e8=function(_0x5b7465){while(--_0x5b7465){_0x532437['push'](_0x532437['shift']());}};_0x29a9e8(++_0x404706);}(_0x28fc,0x19e));var _0xc28f=function(_0x3aeae6,_0x201d94){_0x3aeae6=_0x3aeae6-0x0;var _0xc3594=_0x28fc[_0x3aeae6];return _0xc3594;};'use strict';var multer=require(_0xc28f('0x0'));var util=require(_0xc28f('0x1'));var path=require(_0xc28f('0x2'));var timeout=require('connect-timeout');var express=require(_0xc28f('0x3'));var router=express[_0xc28f('0x4')]();var fs_extra=require(_0xc28f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc28f('0x6'));var config=require(_0xc28f('0x7'));var controller=require(_0xc28f('0x8'));router[_0xc28f('0x9')]('/',auth[_0xc28f('0xa')](),controller[_0xc28f('0xb')]);router[_0xc28f('0x9')](_0xc28f('0xc'),auth[_0xc28f('0xa')](),controller['describe']);router['get'](_0xc28f('0xd'),auth[_0xc28f('0xa')](),controller[_0xc28f('0xe')]);router[_0xc28f('0xf')]('/',auth[_0xc28f('0xa')](),interaction[_0xc28f('0x10')](_0xc28f('0x11'),'whatsappmessage:create'),controller['create']);router[_0xc28f('0xf')]('/:id/status',controller[_0xc28f('0x12')]);router['put'](_0xc28f('0xd'),auth[_0xc28f('0xa')](),controller['update']);router[_0xc28f('0x13')](_0xc28f('0x14'),auth[_0xc28f('0xa')](),controller[_0xc28f('0x15')]);router[_0xc28f('0x13')](_0xc28f('0x16'),auth['isAuthenticated'](),controller[_0xc28f('0x17')]);router[_0xc28f('0x18')](_0xc28f('0xd'),auth[_0xc28f('0xa')](),controller[_0xc28f('0x19')]);module[_0xc28f('0x1a')]=router; \ No newline at end of file +var _0x58eb=['/:id/status','/:id/accept','accept','put','/:id/reject','destroy','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create'];(function(_0x390c9e,_0x25087b){var _0x184d9d=function(_0x7e4aa5){while(--_0x7e4aa5){_0x390c9e['push'](_0x390c9e['shift']());}};_0x184d9d(++_0x25087b);}(_0x58eb,0x119));var _0xb58e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x58eb[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0xb58e('0x0'));var util=require(_0xb58e('0x1'));var path=require(_0xb58e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb58e('0x3')]();var fs_extra=require(_0xb58e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb58e('0x5'));var config=require(_0xb58e('0x6'));var controller=require(_0xb58e('0x7'));router[_0xb58e('0x8')]('/',auth[_0xb58e('0x9')](),controller[_0xb58e('0xa')]);router['get'](_0xb58e('0xb'),auth[_0xb58e('0x9')](),controller['describe']);router[_0xb58e('0x8')](_0xb58e('0xc'),auth[_0xb58e('0x9')](),controller[_0xb58e('0xd')]);router[_0xb58e('0xe')]('/',auth[_0xb58e('0x9')](),interaction[_0xb58e('0xf')](_0xb58e('0x10'),_0xb58e('0x11')),controller[_0xb58e('0x12')]);router[_0xb58e('0xe')](_0xb58e('0x13'),controller['status']);router['put'](_0xb58e('0xc'),auth[_0xb58e('0x9')](),controller['update']);router['put'](_0xb58e('0x14'),auth[_0xb58e('0x9')](),controller[_0xb58e('0x15')]);router[_0xb58e('0x16')](_0xb58e('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xb58e('0xc'),auth[_0xb58e('0x9')](),controller[_0xb58e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 8364062..f9f0935 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 _0xc7a1=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5cf763,_0x43d0f5){var _0x11c50c=function(_0x2adb6b){while(--_0x2adb6b){_0x5cf763['push'](_0x5cf763['shift']());}};_0x11c50c(++_0x43d0f5);}(_0xc7a1,0xa9));var _0x1c7a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7a1[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1c7a('0x0'));module[_0x1c7a('0x1')]={'body':{'type':Sequelize[_0x1c7a('0x2')](_0x1c7a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1c7a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c7a('0x5')]('in',_0x1c7a('0x6')),'defaultValue':_0x1c7a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1c7a('0x7')](0xbe)},'phone':{'type':Sequelize[_0x1c7a('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c7a('0x7')]},'providerResponse':{'type':Sequelize[_0x1c7a('0x2')]}}; \ No newline at end of file +var _0xcc0d=['DATE','sequelize','exports','TEXT','ENUM','out','STRING'];(function(_0xd9c3ff,_0x81f198){var _0x18e42f=function(_0x41117d){while(--_0x41117d){_0xd9c3ff['push'](_0xd9c3ff['shift']());}};_0x18e42f(++_0x81f198);}(_0xcc0d,0x174));var _0xdcc0=function(_0x211e8f,_0x54b63a){_0x211e8f=_0x211e8f-0x0;var _0x45e6c8=_0xcc0d[_0x211e8f];return _0x45e6c8;};'use strict';var Sequelize=require(_0xdcc0('0x0'));module[_0xdcc0('0x1')]={'body':{'type':Sequelize[_0xdcc0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdcc0('0x3')]('in',_0xdcc0('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdcc0('0x5')](0xbe)},'phone':{'type':Sequelize[_0xdcc0('0x5')]},'readAt':{'type':Sequelize[_0xdcc0('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdcc0('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index b98efb9..a113514 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 _0x0630=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','../../config/logger','whatsapp-interactions','accept','read','readAt','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','update','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','sequelize','Sequelize','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','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','end','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','query'];(function(_0x2a2cf6,_0x1f1e78){var _0x4fb178=function(_0x50f1d8){while(--_0x50f1d8){_0x2a2cf6['push'](_0x2a2cf6['shift']());}};_0x4fb178(++_0x1f1e78);}(_0x0630,0xdc));var _0x0063=function(_0x7c629b,_0xfd95c1){_0x7c629b=_0x7c629b-0x0;var _0x50ecd5=_0x0630[_0x7c629b];return _0x50ecd5;};'use strict';var emlformat=require(_0x0063('0x0'));var rimraf=require(_0x0063('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0063('0x2'));var rp=require('request-promise');var moment=require(_0x0063('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0063('0x4'));var util=require(_0x0063('0x5'));var path=require('path');var sox=require(_0x0063('0x6'));var csv=require(_0x0063('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0063('0x8'));var _=require(_0x0063('0x9'));var squel=require(_0x0063('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0063('0x7'));var querystring=require(_0x0063('0xb'));var Papa=require(_0x0063('0xc'));var Redis=require(_0x0063('0xd'));var authService=require(_0x0063('0xe'));var qs=require(_0x0063('0xf'));var as=require(_0x0063('0x10'));var hardwareService=require(_0x0063('0x11'));var logger=require('../../config/logger')(_0x0063('0x12'));var utils=require(_0x0063('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0063('0x14')]=_[_0x0063('0x15')](config[_0x0063('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x0063('0x16'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x0063('0x17')](socket);var jayson=require(_0x0063('0x18'));var client=jayson[_0x0063('0x19')][_0x0063('0x1a')]({'port':0x232c});var client9002=jayson[_0x0063('0x19')][_0x0063('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4df0ff,_0xc62fec,_0x2180c8,_0x4a10a5){return new BPromise(function(_0x1bf5dc,_0x18d9e1){var _0x5d27a8=_0x4a10a5||client;return _0x5d27a8[_0x0063('0x1b')](_0x4df0ff,_0x2180c8)['then'](function(_0xc975ed){logger[_0x0063('0x1c')](_0x0063('0x1d'),_0xc62fec,_0x0063('0x1e'));logger[_0x0063('0x1f')](_0x0063('0x20'),_0xc62fec,_0x0063('0x1e'),JSON['stringify'](_0xc975ed));if(_0xc975ed['error']){if(_0xc975ed[_0x0063('0x21')][_0x0063('0x22')]===0x1f4){logger[_0x0063('0x21')](_0x0063('0x1d'),_0xc62fec,_0xc975ed[_0x0063('0x21')][_0x0063('0x23')]);return _0x18d9e1(_0xc975ed[_0x0063('0x21')][_0x0063('0x23')]);}logger[_0x0063('0x21')](_0x0063('0x1d'),_0xc62fec,_0xc975ed[_0x0063('0x21')][_0x0063('0x23')]);return _0x1bf5dc(_0xc975ed['error']['message']);}else{logger[_0x0063('0x1c')]('WhatsappMessage,\x20%s,\x20%s',_0xc62fec,_0x0063('0x1e'));_0x1bf5dc(_0xc975ed['result'][_0x0063('0x23')]);}})[_0x0063('0x24')](function(_0x352686){logger['error'](_0x0063('0x1d'),_0xc62fec,_0x352686);_0x18d9e1(_0x352686);});});}function respondWithStatusCode(_0x2a2fd4,_0x5d9474){_0x5d9474=_0x5d9474||0xcc;return function(_0x17e7ca){if(_0x17e7ca){return _0x2a2fd4[_0x0063('0x25')](_0x5d9474);}return _0x2a2fd4[_0x0063('0x26')](_0x5d9474)['end']();};}function respondWithResult(_0x45305e,_0x206539){_0x206539=_0x206539||0xc8;return function(_0x430046){if(_0x430046){return _0x45305e[_0x0063('0x26')](_0x206539)['json'](_0x430046);}};}function respondWithFilteredResult(_0x3df7af,_0x2997cb){return function(_0x58d680){if(_0x58d680){var _0x2bc745=typeof _0x2997cb[_0x0063('0x27')]===_0x0063('0x28')&&typeof _0x2997cb['limit']===_0x0063('0x28');var _0x5d2cec=_0x58d680[_0x0063('0x29')];var _0x2d0659=_0x2bc745?0x0:_0x2997cb[_0x0063('0x27')];var _0x36516f=_0x2bc745?_0x58d680[_0x0063('0x29')]:_0x2997cb['offset']+_0x2997cb[_0x0063('0x2a')];var _0x5c1c1e;if(_0x36516f>=_0x5d2cec){_0x36516f=_0x5d2cec;_0x5c1c1e=0xc8;}else{_0x5c1c1e=0xce;}_0x3df7af['status'](_0x5c1c1e);return _0x3df7af['set'](_0x0063('0x2b'),_0x2d0659+'-'+_0x36516f+'/'+_0x5d2cec)[_0x0063('0x2c')](_0x58d680);}return null;};}function patchUpdates(_0x33c1d4){return function(_0x262f16){try{jsonpatch[_0x0063('0x2d')](_0x262f16,_0x33c1d4,!![]);}catch(_0x2d5abf){return BPromise[_0x0063('0x2e')](_0x2d5abf);}return _0x262f16[_0x0063('0x2f')]();};}function saveUpdates(_0x23c7c7,_0x2c9303){return function(_0x3397ee){if(_0x3397ee){return _0x3397ee['update'](_0x23c7c7)[_0x0063('0x30')](function(_0x408775){return _0x408775;});}return null;};}function removeEntity(_0x16b134,_0x3313ec){return function(_0x38c65d){if(_0x38c65d){return _0x38c65d['destroy']()[_0x0063('0x30')](function(){_0x16b134[_0x0063('0x26')](0xcc)[_0x0063('0x31')]();});}};}function handleEntityNotFound(_0x48d906,_0x131bc6){return function(_0x114988){if(!_0x114988){_0x48d906[_0x0063('0x25')](0x194);}return _0x114988;};}function handleError(_0x3b5a54,_0x2b87ff){_0x2b87ff=_0x2b87ff||0x1f4;return function(_0x2ca85f){logger['error'](_0x2ca85f[_0x0063('0x32')]);if(_0x2ca85f[_0x0063('0x33')]){delete _0x2ca85f[_0x0063('0x33')];}_0x3b5a54['status'](_0x2b87ff)[_0x0063('0x34')](_0x2ca85f);};}exports['index']=function(_0x5e1efe,_0x1ba980){var _0x230514={},_0x3a9985={},_0x26e961={'count':0x0,'rows':[]};var _0x52328a=_[_0x0063('0x35')](db[_0x0063('0x36')][_0x0063('0x37')],function(_0x3093ec){return{'name':_0x3093ec[_0x0063('0x38')],'type':_0x3093ec[_0x0063('0x39')][_0x0063('0x3a')]};});_0x3a9985['model']=_[_0x0063('0x35')](_0x52328a,_0x0063('0x33'));_0x3a9985[_0x0063('0x3b')]=_[_0x0063('0x3c')](_0x5e1efe[_0x0063('0x3b')]);_0x3a9985[_0x0063('0x3d')]=_[_0x0063('0x3e')](_0x3a9985[_0x0063('0x3f')],_0x3a9985[_0x0063('0x3b')]);_0x230514[_0x0063('0x40')]=_[_0x0063('0x3e')](_0x3a9985['model'],qs[_0x0063('0x41')](_0x5e1efe[_0x0063('0x3b')][_0x0063('0x41')]));_0x230514[_0x0063('0x40')]=_0x230514[_0x0063('0x40')][_0x0063('0x42')]?_0x230514['attributes']:_0x3a9985['model'];if(!_0x5e1efe[_0x0063('0x3b')][_0x0063('0x43')]('nolimit')){_0x230514[_0x0063('0x2a')]=qs[_0x0063('0x2a')](_0x5e1efe[_0x0063('0x3b')][_0x0063('0x2a')]);_0x230514[_0x0063('0x27')]=qs[_0x0063('0x27')](_0x5e1efe[_0x0063('0x3b')][_0x0063('0x27')]);}_0x230514[_0x0063('0x44')]=qs[_0x0063('0x45')](_0x5e1efe['query'][_0x0063('0x45')]);_0x230514[_0x0063('0x46')]=qs[_0x0063('0x3d')](_[_0x0063('0x47')](_0x5e1efe['query'],_0x3a9985[_0x0063('0x3d')]),_0x52328a);if(_0x5e1efe['query'][_0x0063('0x48')]){_0x230514[_0x0063('0x46')]=_[_0x0063('0x49')](_0x230514[_0x0063('0x46')],{'$or':_['map'](_0x52328a,function(_0x544ae2){if(_0x544ae2[_0x0063('0x39')]!==_0x0063('0x4a')){var _0x564517={};_0x564517[_0x544ae2[_0x0063('0x33')]]={'$like':'%'+_0x5e1efe[_0x0063('0x3b')][_0x0063('0x48')]+'%'};return _0x564517;}})});}_0x230514=_[_0x0063('0x49')]({},_0x230514,_0x5e1efe[_0x0063('0x4b')]);var _0x803243={'where':_0x230514[_0x0063('0x46')]};return db[_0x0063('0x36')][_0x0063('0x29')](_0x803243)['then'](function(_0x56ff68){_0x26e961[_0x0063('0x29')]=_0x56ff68;if(_0x5e1efe[_0x0063('0x3b')][_0x0063('0x4c')]){_0x230514[_0x0063('0x4d')]=[{'all':!![]}];}return db[_0x0063('0x36')][_0x0063('0x4e')](_0x230514);})[_0x0063('0x30')](function(_0x2cc38d){_0x26e961[_0x0063('0x4f')]=_0x2cc38d;return _0x26e961;})[_0x0063('0x30')](respondWithFilteredResult(_0x1ba980,_0x230514))[_0x0063('0x24')](handleError(_0x1ba980,null));};exports[_0x0063('0x50')]=function(_0x2f7173,_0x427b74){var _0x1c258d={'raw':!![],'where':{'id':_0x2f7173[_0x0063('0x51')]['id']}},_0xf8dc52={};_0xf8dc52[_0x0063('0x3f')]=_[_0x0063('0x3c')](db['WhatsappMessage'][_0x0063('0x37')]);_0xf8dc52['query']=_[_0x0063('0x3c')](_0x2f7173[_0x0063('0x3b')]);_0xf8dc52[_0x0063('0x3d')]=_[_0x0063('0x3e')](_0xf8dc52[_0x0063('0x3f')],_0xf8dc52[_0x0063('0x3b')]);_0x1c258d[_0x0063('0x40')]=_['intersection'](_0xf8dc52[_0x0063('0x3f')],qs[_0x0063('0x41')](_0x2f7173[_0x0063('0x3b')][_0x0063('0x41')]));_0x1c258d[_0x0063('0x40')]=_0x1c258d[_0x0063('0x40')][_0x0063('0x42')]?_0x1c258d[_0x0063('0x40')]:_0xf8dc52[_0x0063('0x3f')];if(_0x2f7173[_0x0063('0x3b')][_0x0063('0x4c')]){_0x1c258d[_0x0063('0x4d')]=[{'all':!![]}];}_0x1c258d=_[_0x0063('0x49')]({},_0x1c258d,_0x2f7173[_0x0063('0x4b')]);return db[_0x0063('0x36')][_0x0063('0x52')](_0x1c258d)[_0x0063('0x30')](handleEntityNotFound(_0x427b74,null))[_0x0063('0x30')](respondWithResult(_0x427b74,null))['catch'](handleError(_0x427b74,null));};exports[_0x0063('0x53')]=function(_0x447dda,_0x44b255){return db[_0x0063('0x36')]['create'](_0x447dda[_0x0063('0x54')],{})[_0x0063('0x30')](respondWithResult(_0x44b255,0xc9))[_0x0063('0x24')](handleError(_0x44b255,null));};exports['update']=function(_0x3fdea1,_0x1eeda2){if(_0x3fdea1['body']['id']){delete _0x3fdea1[_0x0063('0x54')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x3fdea1[_0x0063('0x51')]['id']}})[_0x0063('0x30')](handleEntityNotFound(_0x1eeda2,null))[_0x0063('0x30')](saveUpdates(_0x3fdea1[_0x0063('0x54')],null))[_0x0063('0x30')](respondWithResult(_0x1eeda2,null))['catch'](handleError(_0x1eeda2,null));};exports[_0x0063('0x55')]=function(_0x4961d6,_0xb4babe){return db[_0x0063('0x36')][_0x0063('0x52')]({'where':{'id':_0x4961d6[_0x0063('0x51')]['id']}})[_0x0063('0x30')](handleEntityNotFound(_0xb4babe,null))[_0x0063('0x30')](removeEntity(_0xb4babe,null))['catch'](handleError(_0xb4babe,null));};exports[_0x0063('0x56')]=function(_0x1f29d9,_0x562f21){return db[_0x0063('0x36')][_0x0063('0x56')]()[_0x0063('0x30')](respondWithResult(_0x562f21,null))[_0x0063('0x24')](handleError(_0x562f21,null));};var interaction_log=require(_0x0063('0x57'))(_0x0063('0x58'));exports[_0x0063('0x59')]=function(_0x253612,_0x4f5702,_0x184f6c){var _0x15c2b2={'agent':{},'channel':'whatsapp'};if(_0x253612['body']['id']){delete _0x253612[_0x0063('0x54')]['id'];}_0x253612['body'][_0x0063('0x5a')]=!![];_0x253612[_0x0063('0x54')][_0x0063('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x253612[_0x0063('0x54')][_0x0063('0x5c')]=_0x253612[_0x0063('0x54')][_0x0063('0x5c')]||_0x253612[_0x0063('0x5d')]['id'];_0x15c2b2[_0x0063('0x5e')]['id']=_0x253612[_0x0063('0x54')]['UserId'];return db['WhatsappMessage'][_0x0063('0x52')]({'where':{'id':_0x253612[_0x0063('0x51')]['id'],'UserId':null}})[_0x0063('0x30')](handleEntityNotFound(_0x4f5702,null))[_0x0063('0x30')](saveUpdates(_0x253612['body'],null))['then'](function(_0x3fdcc8){if(_0x3fdcc8){_0x15c2b2['message']=_0x3fdcc8[_0x0063('0x5f')]({'plain':!![]});return db[_0x0063('0x60')][_0x0063('0x52')]({'where':{'id':_0x3fdcc8[_0x0063('0x61')]}});}return null;})[_0x0063('0x30')](handleEntityNotFound(_0x4f5702,null))[_0x0063('0x30')](function(_0x31942f){if(_0x31942f){return _0x31942f[_0x0063('0x62')]({'UserId':_0x253612[_0x0063('0x54')][_0x0063('0x5c')],'read1stAt':_['isNil'](_0x31942f[_0x0063('0x63')])?moment()[_0x0063('0x64')](_0x0063('0x65')):undefined});}return null;})[_0x0063('0x30')](function(_0x57e062){if(_0x57e062){_0x15c2b2[_0x0063('0x66')]=_0x57e062['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x253612[_0x0063('0x5d')]['id'],_0x253612['user'][_0x0063('0x33')],_0x253612[_0x0063('0x5d')][_0x0063('0x67')],_0x15c2b2[_0x0063('0x66')]['id'],_0x253612[_0x0063('0x54')]?JSON['stringify'](_0x253612[_0x0063('0x54')]):_0x0063('0x68'));return respondWithRpcPromise(_0x0063('0x69'),_0x0063('0x6a'),_0x15c2b2);}return null;})[_0x0063('0x30')](function(_0x608b33){var _0x19a399=_0x0063('0x6b')+_0x608b33[_0x0063('0x23')][_0x0063('0x6c')];return db['sequelize']['query'](_0x19a399,{'type':db['Sequelize'][_0x0063('0x6d')][_0x0063('0x6e')],'raw':!![]})[_0x0063('0x30')](function(_0x27f8fb){return _0x27f8fb;});})['then'](function(_0xc03844){if(_0xc03844){_0x15c2b2['message'][_0x0063('0x6f')]=_0xc03844[0x0];if(!_0x253612['body']['UserId'])return;return db['User'][_0x0063('0x52')]({'where':{'id':_0x253612[_0x0063('0x54')]['UserId'],'role':_0x0063('0x5e')},'attributes':['id',_0x0063('0x33'),_0x0063('0x70'),_0x0063('0x71'),_0x0063('0x72')],'raw':!![]});}return null;})[_0x0063('0x30')](function(_0x3e0fda){if(!_0x3e0fda)return null;_0x15c2b2[_0x0063('0x23')][_0x0063('0x5e')]=_0x3e0fda;return _0x15c2b2;})['then'](function(_0x1e781c){if(_0x1e781c){if(_0x253612['body'][_0x0063('0x73')]){_0x15c2b2[_0x0063('0x23')]['interface']=util['format'](_0x0063('0x74'),_0x253612['user']['name']);_0x15c2b2[_0x0063('0x23')][_0x0063('0x75')]=_0x15c2b2[_0x0063('0x75')];_0x15c2b2[_0x0063('0x23')][_0x0063('0x76')]=_0x15c2b2[_0x0063('0x75')];_0x15c2b2[_0x0063('0x23')][_0x0063('0x77')]=_0x0063('0x59');return respondWithRpcPromise('EventManager',_0x0063('0x78'),{'event':'acceptmessage','message':_0x15c2b2[_0x0063('0x23')]},client9002)['then'](function(){return _0x15c2b2;});}return _0x15c2b2;}return null;})[_0x0063('0x30')](respondWithResult(_0x4f5702,null))[_0x0063('0x24')](handleError(_0x4f5702,null));};var interaction_log=require(_0x0063('0x57'))(_0x0063('0x58'));exports[_0x0063('0x2e')]=function(_0x4874d0,_0x8f22a4,_0x513baa){var _0x24690f={'agent':{},'channel':_0x0063('0x79')};if(_0x4874d0['body']['id']){delete _0x4874d0[_0x0063('0x54')]['id'];}_0x4874d0[_0x0063('0x54')]['UserId']=_0x4874d0['body'][_0x0063('0x5c')]||_0x4874d0[_0x0063('0x5d')]['id'];_0x24690f[_0x0063('0x5e')]['id']=_0x4874d0[_0x0063('0x54')][_0x0063('0x5c')];return db['WhatsappMessage'][_0x0063('0x52')]({'where':{'id':_0x4874d0[_0x0063('0x51')]['id'],'UserId':null}})[_0x0063('0x30')](handleEntityNotFound(_0x8f22a4,null))[_0x0063('0x30')](function(_0x5cc3f){if(_0x5cc3f){_0x24690f[_0x0063('0x23')]=_0x5cc3f['get']({'plain':!![]});return db[_0x0063('0x60')][_0x0063('0x52')]({'where':{'id':_0x5cc3f[_0x0063('0x61')]}});}return null;})[_0x0063('0x30')](handleEntityNotFound(_0x8f22a4,null))[_0x0063('0x30')](function(_0x491fb9){if(_0x491fb9){_0x24690f[_0x0063('0x66')]=_0x491fb9[_0x0063('0x5f')]({'plain':!![]});interaction_log[_0x0063('0x1c')](_0x0063('0x7a'),_0x4874d0[_0x0063('0x5d')]['id'],_0x4874d0[_0x0063('0x5d')][_0x0063('0x33')],_0x4874d0[_0x0063('0x5d')][_0x0063('0x67')],_0x24690f['interaction']['id'],_0x4874d0[_0x0063('0x54')]?JSON[_0x0063('0x7b')](_0x4874d0[_0x0063('0x54')]):_0x0063('0x68'));return respondWithRpcPromise(_0x0063('0x7c'),_0x0063('0x7d'),_0x24690f);}return null;})[_0x0063('0x30')](function(_0x4cc5ba){var _0x367b02=_0x0063('0x6b')+_0x4cc5ba[_0x0063('0x23')][_0x0063('0x6c')];return db[_0x0063('0x7e')][_0x0063('0x3b')](_0x367b02,{'type':db[_0x0063('0x7f')][_0x0063('0x6d')][_0x0063('0x6e')],'raw':!![]})[_0x0063('0x30')](function(_0x3b6258){return _0x3b6258;});})[_0x0063('0x30')](function(_0x24afb4){if(_0x24afb4){_0x24690f[_0x0063('0x23')][_0x0063('0x6f')]=_0x24afb4[0x0];if(!_0x4874d0[_0x0063('0x54')][_0x0063('0x5c')])return;return db[_0x0063('0x80')]['find']({'where':{'id':_0x4874d0[_0x0063('0x54')]['UserId'],'role':_0x0063('0x5e')},'attributes':['id',_0x0063('0x33'),_0x0063('0x70'),_0x0063('0x71'),_0x0063('0x72')],'raw':!![]});}return null;})[_0x0063('0x30')](function(_0x3dd448){if(!_0x3dd448)return null;_0x24690f[_0x0063('0x23')][_0x0063('0x5e')]=_0x3dd448;return _0x24690f;})['then'](function(_0x138ebf){if(_0x138ebf){_0x138ebf[_0x0063('0x23')]['interface']=util[_0x0063('0x64')](_0x0063('0x74'),_0x4874d0['user'][_0x0063('0x33')]);_0x138ebf[_0x0063('0x23')][_0x0063('0x75')]=_0x24690f[_0x0063('0x75')];_0x138ebf[_0x0063('0x23')]['motionChannel']=_0x24690f[_0x0063('0x75')];_0x138ebf[_0x0063('0x23')][_0x0063('0x77')]=_0x0063('0x2e');respondWithRpcPromise('EventManager',_0x0063('0x78'),{'event':_0x0063('0x81'),'message':_0x138ebf['message']},client9002);return _0x24690f;}return null;})[_0x0063('0x30')](respondWithResult(_0x8f22a4,null))['catch'](handleError(_0x8f22a4,null));};exports[_0x0063('0x26')]=function(_0x4f284a,_0x30c3d7,_0x3139d6){if(_0x4f284a[_0x0063('0x54')]['id']){delete _0x4f284a[_0x0063('0x54')]['id'];}var _0x237da5;return db[_0x0063('0x36')]['find']({'where':{'id':_0x4f284a['params']['id']}})['then'](handleEntityNotFound(_0x30c3d7,null))[_0x0063('0x30')](function(_0x2c604e){if(_0x2c604e){_0x237da5=_0x2c604e;return db[_0x0063('0x82')]['find']({'where':{'id':_0x2c604e[_0x0063('0x83')]}});}})[_0x0063('0x30')](handleEntityNotFound(_0x30c3d7,null))[_0x0063('0x30')](function(_0x32fd7c){if(_0x32fd7c){logger[_0x0063('0x1f')](_0x0063('0x84'),_0x0063('0x26'),_0x0063('0x85'),_0x32fd7c[_0x0063('0x39')],util[_0x0063('0x86')](_0x4f284a[_0x0063('0x54')],{'showHidden':![],'depth':null}));switch(_0x32fd7c[_0x0063('0x39')]){case _0x0063('0x87'):if(_0x4f284a[_0x0063('0x54')][_0x0063('0x88')]&&_0x4f284a[_0x0063('0x54')][_0x0063('0x88')]===_0x237da5[_0x0063('0x89')]&&_0x4f284a[_0x0063('0x54')]['MessageStatus']&&_0x4f284a[_0x0063('0x54')][_0x0063('0x8a')]==='read'){return _0x237da5[_0x0063('0x62')]({'read':!![]});}else{logger['error'](_0x0063('0x8b'),'status','twilio',util['inspect'](_0x4f284a[_0x0063('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x237da5;}})['then'](respondWithResult(_0x30c3d7,null))['catch'](handleError(_0x30c3d7,null));}; \ No newline at end of file +var _0xfbd8=['include','findAll','rows','show','length','find','create','body','params','describe','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','sequelize','QueryTypes','SELECT','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','contact','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x4bf559,_0x3fb379){var _0x208dc9=function(_0x2f9b7a){while(--_0x2f9b7a){_0x4bf559['push'](_0x4bf559['shift']());}};_0x208dc9(++_0x3fb379);}(_0xfbd8,0xcb));var _0x8fbd=function(_0x54fd80,_0x430280){_0x54fd80=_0x54fd80-0x0;var _0x415018=_0xfbd8[_0x54fd80];return _0x415018;};'use strict';var emlformat=require(_0x8fbd('0x0'));var rimraf=require(_0x8fbd('0x1'));var zipdir=require(_0x8fbd('0x2'));var jsonpatch=require(_0x8fbd('0x3'));var rp=require(_0x8fbd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8fbd('0x5'));var util=require(_0x8fbd('0x6'));var path=require(_0x8fbd('0x7'));var sox=require(_0x8fbd('0x8'));var csv=require(_0x8fbd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fbd('0xa'));var _=require(_0x8fbd('0xb'));var squel=require('squel');var crypto=require(_0x8fbd('0xc'));var jsforce=require(_0x8fbd('0xd'));var deskjs=require(_0x8fbd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8fbd('0xf'));var Papa=require(_0x8fbd('0x10'));var Redis=require(_0x8fbd('0x11'));var authService=require(_0x8fbd('0x12'));var qs=require(_0x8fbd('0x13'));var as=require(_0x8fbd('0x14'));var hardwareService=require(_0x8fbd('0x15'));var logger=require(_0x8fbd('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8fbd('0x17'));var licenseUtil=require(_0x8fbd('0x18'));var db=require(_0x8fbd('0x19'))['db'];config['redis']=_[_0x8fbd('0x1a')](config[_0x8fbd('0x1b')],{'host':_0x8fbd('0x1c'),'port':0x18eb});var socket=require(_0x8fbd('0x1d'))(new Redis(config[_0x8fbd('0x1b')]));require(_0x8fbd('0x1e'))[_0x8fbd('0x1f')](socket);var jayson=require(_0x8fbd('0x20'));var client=jayson['client'][_0x8fbd('0x21')]({'port':0x232c});var client9002=jayson[_0x8fbd('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dcfc5,_0x24649e,_0x4d9523,_0x5816cf){return new BPromise(function(_0x2a1232,_0x48752f){var _0x1eda91=_0x5816cf||client;return _0x1eda91[_0x8fbd('0x23')](_0x3dcfc5,_0x4d9523)[_0x8fbd('0x24')](function(_0x4c9edc){logger[_0x8fbd('0x25')](_0x8fbd('0x26'),_0x24649e,'request\x20sent');logger[_0x8fbd('0x27')](_0x8fbd('0x28'),_0x24649e,'request\x20sent',JSON[_0x8fbd('0x29')](_0x4c9edc));if(_0x4c9edc[_0x8fbd('0x2a')]){if(_0x4c9edc['error']['code']===0x1f4){logger[_0x8fbd('0x2a')](_0x8fbd('0x26'),_0x24649e,_0x4c9edc[_0x8fbd('0x2a')]['message']);return _0x48752f(_0x4c9edc[_0x8fbd('0x2a')][_0x8fbd('0x2b')]);}logger[_0x8fbd('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x24649e,_0x4c9edc['error'][_0x8fbd('0x2b')]);return _0x2a1232(_0x4c9edc[_0x8fbd('0x2a')]['message']);}else{logger[_0x8fbd('0x25')](_0x8fbd('0x26'),_0x24649e,'request\x20sent');_0x2a1232(_0x4c9edc['result'][_0x8fbd('0x2b')]);}})[_0x8fbd('0x2c')](function(_0x2ac376){logger[_0x8fbd('0x2a')](_0x8fbd('0x26'),_0x24649e,_0x2ac376);_0x48752f(_0x2ac376);});});}function respondWithStatusCode(_0x47deba,_0x1b6877){_0x1b6877=_0x1b6877||0xcc;return function(_0x2d4004){if(_0x2d4004){return _0x47deba['sendStatus'](_0x1b6877);}return _0x47deba['status'](_0x1b6877)[_0x8fbd('0x2d')]();};}function respondWithResult(_0x329853,_0x3a94a3){_0x3a94a3=_0x3a94a3||0xc8;return function(_0x5e518e){if(_0x5e518e){return _0x329853[_0x8fbd('0x2e')](_0x3a94a3)[_0x8fbd('0x2f')](_0x5e518e);}};}function respondWithFilteredResult(_0x10e6f0,_0x2cc853){return function(_0xc89347){if(_0xc89347){var _0xb30a44=typeof _0x2cc853[_0x8fbd('0x30')]===_0x8fbd('0x31')&&typeof _0x2cc853[_0x8fbd('0x32')]===_0x8fbd('0x31');var _0x420940=_0xc89347[_0x8fbd('0x33')];var _0x4238a4=_0xb30a44?0x0:_0x2cc853[_0x8fbd('0x30')];var _0x2d4cc5=_0xb30a44?_0xc89347[_0x8fbd('0x33')]:_0x2cc853['offset']+_0x2cc853[_0x8fbd('0x32')];var _0xc84925;if(_0x2d4cc5>=_0x420940){_0x2d4cc5=_0x420940;_0xc84925=0xc8;}else{_0xc84925=0xce;}_0x10e6f0[_0x8fbd('0x2e')](_0xc84925);return _0x10e6f0['set'](_0x8fbd('0x34'),_0x4238a4+'-'+_0x2d4cc5+'/'+_0x420940)[_0x8fbd('0x2f')](_0xc89347);}return null;};}function patchUpdates(_0x7f5137){return function(_0x18b0b7){try{jsonpatch[_0x8fbd('0x35')](_0x18b0b7,_0x7f5137,!![]);}catch(_0x991856){return BPromise[_0x8fbd('0x36')](_0x991856);}return _0x18b0b7[_0x8fbd('0x37')]();};}function saveUpdates(_0xd3bb4f,_0x1b1529){return function(_0x367a10){if(_0x367a10){return _0x367a10[_0x8fbd('0x38')](_0xd3bb4f)[_0x8fbd('0x24')](function(_0x9b7dd4){return _0x9b7dd4;});}return null;};}function removeEntity(_0x29dcee,_0x1a292e){return function(_0x229190){if(_0x229190){return _0x229190[_0x8fbd('0x39')]()['then'](function(){_0x29dcee[_0x8fbd('0x2e')](0xcc)[_0x8fbd('0x2d')]();});}};}function handleEntityNotFound(_0x204a1b,_0x456cba){return function(_0x3bd2b1){if(!_0x3bd2b1){_0x204a1b[_0x8fbd('0x3a')](0x194);}return _0x3bd2b1;};}function handleError(_0x3bf78b,_0x4cf3d5){_0x4cf3d5=_0x4cf3d5||0x1f4;return function(_0x44cf37){logger[_0x8fbd('0x2a')](_0x44cf37[_0x8fbd('0x3b')]);if(_0x44cf37[_0x8fbd('0x3c')]){delete _0x44cf37['name'];}_0x3bf78b[_0x8fbd('0x2e')](_0x4cf3d5)[_0x8fbd('0x3d')](_0x44cf37);};}exports[_0x8fbd('0x3e')]=function(_0xb437d,_0x425a3d){var _0x2b611b={},_0x5e95f2={},_0x46ae38={'count':0x0,'rows':[]};var _0x2e11e1=_[_0x8fbd('0x3f')](db[_0x8fbd('0x40')][_0x8fbd('0x41')],function(_0x522aa7){return{'name':_0x522aa7['fieldName'],'type':_0x522aa7[_0x8fbd('0x42')][_0x8fbd('0x43')]};});_0x5e95f2[_0x8fbd('0x44')]=_['map'](_0x2e11e1,_0x8fbd('0x3c'));_0x5e95f2[_0x8fbd('0x45')]=_[_0x8fbd('0x46')](_0xb437d[_0x8fbd('0x45')]);_0x5e95f2[_0x8fbd('0x47')]=_[_0x8fbd('0x48')](_0x5e95f2[_0x8fbd('0x44')],_0x5e95f2[_0x8fbd('0x45')]);_0x2b611b[_0x8fbd('0x49')]=_[_0x8fbd('0x48')](_0x5e95f2[_0x8fbd('0x44')],qs[_0x8fbd('0x4a')](_0xb437d[_0x8fbd('0x45')][_0x8fbd('0x4a')]));_0x2b611b['attributes']=_0x2b611b[_0x8fbd('0x49')]['length']?_0x2b611b[_0x8fbd('0x49')]:_0x5e95f2['model'];if(!_0xb437d['query'][_0x8fbd('0x4b')]('nolimit')){_0x2b611b[_0x8fbd('0x32')]=qs[_0x8fbd('0x32')](_0xb437d[_0x8fbd('0x45')][_0x8fbd('0x32')]);_0x2b611b['offset']=qs[_0x8fbd('0x30')](_0xb437d[_0x8fbd('0x45')]['offset']);}_0x2b611b[_0x8fbd('0x4c')]=qs[_0x8fbd('0x4d')](_0xb437d[_0x8fbd('0x45')]['sort']);_0x2b611b[_0x8fbd('0x4e')]=qs[_0x8fbd('0x47')](_[_0x8fbd('0x4f')](_0xb437d[_0x8fbd('0x45')],_0x5e95f2[_0x8fbd('0x47')]),_0x2e11e1);if(_0xb437d[_0x8fbd('0x45')][_0x8fbd('0x50')]){_0x2b611b[_0x8fbd('0x4e')]=_[_0x8fbd('0x51')](_0x2b611b['where'],{'$or':_[_0x8fbd('0x3f')](_0x2e11e1,function(_0x3cc18a){if(_0x3cc18a[_0x8fbd('0x42')]!==_0x8fbd('0x52')){var _0xcd89eb={};_0xcd89eb[_0x3cc18a[_0x8fbd('0x3c')]]={'$like':'%'+_0xb437d[_0x8fbd('0x45')][_0x8fbd('0x50')]+'%'};return _0xcd89eb;}})});}_0x2b611b=_['merge']({},_0x2b611b,_0xb437d[_0x8fbd('0x53')]);var _0x3ce67c={'where':_0x2b611b[_0x8fbd('0x4e')]};return db[_0x8fbd('0x40')][_0x8fbd('0x33')](_0x3ce67c)['then'](function(_0xf752d9){_0x46ae38[_0x8fbd('0x33')]=_0xf752d9;if(_0xb437d[_0x8fbd('0x45')][_0x8fbd('0x54')]){_0x2b611b[_0x8fbd('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x8fbd('0x56')](_0x2b611b);})[_0x8fbd('0x24')](function(_0x490e7b){_0x46ae38[_0x8fbd('0x57')]=_0x490e7b;return _0x46ae38;})[_0x8fbd('0x24')](respondWithFilteredResult(_0x425a3d,_0x2b611b))[_0x8fbd('0x2c')](handleError(_0x425a3d,null));};exports[_0x8fbd('0x58')]=function(_0x5c5eb6,_0x46b62b){var _0x6bed53={'raw':!![],'where':{'id':_0x5c5eb6['params']['id']}},_0x2162ca={};_0x2162ca[_0x8fbd('0x44')]=_[_0x8fbd('0x46')](db['WhatsappMessage'][_0x8fbd('0x41')]);_0x2162ca[_0x8fbd('0x45')]=_[_0x8fbd('0x46')](_0x5c5eb6[_0x8fbd('0x45')]);_0x2162ca[_0x8fbd('0x47')]=_[_0x8fbd('0x48')](_0x2162ca['model'],_0x2162ca[_0x8fbd('0x45')]);_0x6bed53[_0x8fbd('0x49')]=_['intersection'](_0x2162ca['model'],qs[_0x8fbd('0x4a')](_0x5c5eb6[_0x8fbd('0x45')][_0x8fbd('0x4a')]));_0x6bed53[_0x8fbd('0x49')]=_0x6bed53[_0x8fbd('0x49')][_0x8fbd('0x59')]?_0x6bed53[_0x8fbd('0x49')]:_0x2162ca[_0x8fbd('0x44')];if(_0x5c5eb6[_0x8fbd('0x45')][_0x8fbd('0x54')]){_0x6bed53[_0x8fbd('0x55')]=[{'all':!![]}];}_0x6bed53=_[_0x8fbd('0x51')]({},_0x6bed53,_0x5c5eb6[_0x8fbd('0x53')]);return db[_0x8fbd('0x40')][_0x8fbd('0x5a')](_0x6bed53)[_0x8fbd('0x24')](handleEntityNotFound(_0x46b62b,null))[_0x8fbd('0x24')](respondWithResult(_0x46b62b,null))[_0x8fbd('0x2c')](handleError(_0x46b62b,null));};exports[_0x8fbd('0x5b')]=function(_0x4137bf,_0x435092){return db['WhatsappMessage'][_0x8fbd('0x5b')](_0x4137bf[_0x8fbd('0x5c')],{})[_0x8fbd('0x24')](respondWithResult(_0x435092,0xc9))[_0x8fbd('0x2c')](handleError(_0x435092,null));};exports['update']=function(_0x124dd2,_0x11ed6e){if(_0x124dd2[_0x8fbd('0x5c')]['id']){delete _0x124dd2[_0x8fbd('0x5c')]['id'];}return db[_0x8fbd('0x40')][_0x8fbd('0x5a')]({'where':{'id':_0x124dd2[_0x8fbd('0x5d')]['id']}})[_0x8fbd('0x24')](handleEntityNotFound(_0x11ed6e,null))[_0x8fbd('0x24')](saveUpdates(_0x124dd2[_0x8fbd('0x5c')],null))[_0x8fbd('0x24')](respondWithResult(_0x11ed6e,null))['catch'](handleError(_0x11ed6e,null));};exports[_0x8fbd('0x39')]=function(_0x29578b,_0x2c61ba){return db[_0x8fbd('0x40')][_0x8fbd('0x5a')]({'where':{'id':_0x29578b[_0x8fbd('0x5d')]['id']}})[_0x8fbd('0x24')](handleEntityNotFound(_0x2c61ba,null))[_0x8fbd('0x24')](removeEntity(_0x2c61ba,null))[_0x8fbd('0x2c')](handleError(_0x2c61ba,null));};exports[_0x8fbd('0x5e')]=function(_0x1cff04,_0x1340cd){return db['WhatsappMessage'][_0x8fbd('0x5e')]()[_0x8fbd('0x24')](respondWithResult(_0x1340cd,null))[_0x8fbd('0x2c')](handleError(_0x1340cd,null));};var interaction_log=require(_0x8fbd('0x16'))(_0x8fbd('0x5f'));exports['accept']=function(_0x2681ac,_0x485d18,_0x1406e3){var _0x2d51f4={'agent':{},'channel':'whatsapp'};if(_0x2681ac[_0x8fbd('0x5c')]['id']){delete _0x2681ac[_0x8fbd('0x5c')]['id'];}_0x2681ac['body'][_0x8fbd('0x60')]=!![];_0x2681ac[_0x8fbd('0x5c')][_0x8fbd('0x61')]=moment()[_0x8fbd('0x62')](_0x8fbd('0x63'));_0x2681ac['body'][_0x8fbd('0x64')]=_0x2681ac['body'][_0x8fbd('0x64')]||_0x2681ac[_0x8fbd('0x65')]['id'];_0x2d51f4['agent']['id']=_0x2681ac[_0x8fbd('0x5c')][_0x8fbd('0x64')];return db['WhatsappMessage'][_0x8fbd('0x5a')]({'where':{'id':_0x2681ac[_0x8fbd('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x485d18,null))['then'](saveUpdates(_0x2681ac[_0x8fbd('0x5c')],null))['then'](function(_0x44ea3f){if(_0x44ea3f){_0x2d51f4[_0x8fbd('0x2b')]=_0x44ea3f[_0x8fbd('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0x8fbd('0x5a')]({'where':{'id':_0x44ea3f[_0x8fbd('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x485d18,null))[_0x8fbd('0x24')](function(_0x5a593a){if(_0x5a593a){return _0x5a593a[_0x8fbd('0x38')]({'UserId':_0x2681ac[_0x8fbd('0x5c')]['UserId'],'read1stAt':_[_0x8fbd('0x68')](_0x5a593a[_0x8fbd('0x69')])?moment()['format'](_0x8fbd('0x63')):undefined});}return null;})[_0x8fbd('0x24')](function(_0x14b31e){if(_0x14b31e){_0x2d51f4['interaction']=_0x14b31e[_0x8fbd('0x66')]({'plain':!![]});interaction_log['info'](_0x8fbd('0x6a'),_0x2681ac[_0x8fbd('0x65')]['id'],_0x2681ac[_0x8fbd('0x65')][_0x8fbd('0x3c')],_0x2681ac[_0x8fbd('0x65')][_0x8fbd('0x6b')],_0x2d51f4[_0x8fbd('0x6c')]['id'],_0x2681ac[_0x8fbd('0x5c')]?JSON[_0x8fbd('0x29')](_0x2681ac[_0x8fbd('0x5c')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8fbd('0x6d'),_0x2d51f4);}return null;})[_0x8fbd('0x24')](function(_0x218c7a){var _0xc9118d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x218c7a[_0x8fbd('0x2b')]['ContactId'];return db[_0x8fbd('0x6e')][_0x8fbd('0x45')](_0xc9118d,{'type':db['Sequelize'][_0x8fbd('0x6f')][_0x8fbd('0x70')],'raw':!![]})[_0x8fbd('0x24')](function(_0x105ed9){return _0x105ed9;});})[_0x8fbd('0x24')](function(_0x348111){if(_0x348111){_0x2d51f4[_0x8fbd('0x2b')]['contact']=_0x348111[0x0];if(!_0x2681ac[_0x8fbd('0x5c')][_0x8fbd('0x64')])return;return db[_0x8fbd('0x71')][_0x8fbd('0x5a')]({'where':{'id':_0x2681ac[_0x8fbd('0x5c')][_0x8fbd('0x64')],'role':'agent'},'attributes':['id',_0x8fbd('0x3c'),_0x8fbd('0x72'),_0x8fbd('0x73'),_0x8fbd('0x74')],'raw':!![]});}return null;})[_0x8fbd('0x24')](function(_0x158535){if(!_0x158535)return null;_0x2d51f4[_0x8fbd('0x2b')][_0x8fbd('0x75')]=_0x158535;return _0x2d51f4;})['then'](function(_0x2daee1){if(_0x2daee1){if(_0x2681ac['body'][_0x8fbd('0x76')]){_0x2d51f4['message'][_0x8fbd('0x77')]=util[_0x8fbd('0x62')](_0x8fbd('0x78'),_0x2681ac[_0x8fbd('0x65')]['name']);_0x2d51f4[_0x8fbd('0x2b')]['channel']=_0x2d51f4[_0x8fbd('0x79')];_0x2d51f4[_0x8fbd('0x2b')][_0x8fbd('0x7a')]=_0x2d51f4[_0x8fbd('0x79')];_0x2d51f4[_0x8fbd('0x2b')][_0x8fbd('0x7b')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x8fbd('0x7c'),'message':_0x2d51f4[_0x8fbd('0x2b')]},client9002)[_0x8fbd('0x24')](function(){return _0x2d51f4;});}return _0x2d51f4;}return null;})[_0x8fbd('0x24')](respondWithResult(_0x485d18,null))[_0x8fbd('0x2c')](handleError(_0x485d18,null));};var interaction_log=require(_0x8fbd('0x16'))(_0x8fbd('0x5f'));exports[_0x8fbd('0x36')]=function(_0x343de5,_0x3b3eda,_0x305996){var _0x3aa1de={'agent':{},'channel':'whatsapp'};if(_0x343de5['body']['id']){delete _0x343de5[_0x8fbd('0x5c')]['id'];}_0x343de5[_0x8fbd('0x5c')][_0x8fbd('0x64')]=_0x343de5[_0x8fbd('0x5c')]['UserId']||_0x343de5['user']['id'];_0x3aa1de[_0x8fbd('0x75')]['id']=_0x343de5[_0x8fbd('0x5c')]['UserId'];return db['WhatsappMessage'][_0x8fbd('0x5a')]({'where':{'id':_0x343de5[_0x8fbd('0x5d')]['id'],'UserId':null}})[_0x8fbd('0x24')](handleEntityNotFound(_0x3b3eda,null))[_0x8fbd('0x24')](function(_0x30c820){if(_0x30c820){_0x3aa1de[_0x8fbd('0x2b')]=_0x30c820[_0x8fbd('0x66')]({'plain':!![]});return db[_0x8fbd('0x7d')][_0x8fbd('0x5a')]({'where':{'id':_0x30c820[_0x8fbd('0x67')]}});}return null;})[_0x8fbd('0x24')](handleEntityNotFound(_0x3b3eda,null))[_0x8fbd('0x24')](function(_0x40709a){if(_0x40709a){_0x3aa1de[_0x8fbd('0x6c')]=_0x40709a[_0x8fbd('0x66')]({'plain':!![]});interaction_log[_0x8fbd('0x25')](_0x8fbd('0x7e'),_0x343de5[_0x8fbd('0x65')]['id'],_0x343de5[_0x8fbd('0x65')][_0x8fbd('0x3c')],_0x343de5[_0x8fbd('0x65')][_0x8fbd('0x6b')],_0x3aa1de['interaction']['id'],_0x343de5[_0x8fbd('0x5c')]?JSON['stringify'](_0x343de5[_0x8fbd('0x5c')]):_0x8fbd('0x7f'));return respondWithRpcPromise('RejectMessage',_0x8fbd('0x80'),_0x3aa1de);}return null;})['then'](function(_0x4fc52e){var _0x4cdabb=_0x8fbd('0x81')+_0x4fc52e['message'][_0x8fbd('0x82')];return db['sequelize'][_0x8fbd('0x45')](_0x4cdabb,{'type':db[_0x8fbd('0x83')][_0x8fbd('0x6f')][_0x8fbd('0x70')],'raw':!![]})[_0x8fbd('0x24')](function(_0x36db87){return _0x36db87;});})[_0x8fbd('0x24')](function(_0x381a01){if(_0x381a01){_0x3aa1de['message'][_0x8fbd('0x84')]=_0x381a01[0x0];if(!_0x343de5[_0x8fbd('0x5c')][_0x8fbd('0x64')])return;return db[_0x8fbd('0x71')][_0x8fbd('0x5a')]({'where':{'id':_0x343de5['body'][_0x8fbd('0x64')],'role':'agent'},'attributes':['id',_0x8fbd('0x3c'),'fullname',_0x8fbd('0x73'),'internal'],'raw':!![]});}return null;})[_0x8fbd('0x24')](function(_0xdd1830){if(!_0xdd1830)return null;_0x3aa1de[_0x8fbd('0x2b')]['agent']=_0xdd1830;return _0x3aa1de;})['then'](function(_0x16b3e3){if(_0x16b3e3){_0x16b3e3['message']['interface']=util[_0x8fbd('0x62')](_0x8fbd('0x78'),_0x343de5[_0x8fbd('0x65')]['name']);_0x16b3e3[_0x8fbd('0x2b')][_0x8fbd('0x79')]=_0x3aa1de['channel'];_0x16b3e3[_0x8fbd('0x2b')][_0x8fbd('0x7a')]=_0x3aa1de[_0x8fbd('0x79')];_0x16b3e3[_0x8fbd('0x2b')][_0x8fbd('0x7b')]=_0x8fbd('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x8fbd('0x85'),'message':_0x16b3e3[_0x8fbd('0x2b')]},client9002);return _0x3aa1de;}return null;})[_0x8fbd('0x24')](respondWithResult(_0x3b3eda,null))[_0x8fbd('0x2c')](handleError(_0x3b3eda,null));};exports[_0x8fbd('0x2e')]=function(_0x167528,_0x5dddb6,_0x5c0367){if(_0x167528[_0x8fbd('0x5c')]['id']){delete _0x167528['body']['id'];}var _0x3e57d5;return db[_0x8fbd('0x40')][_0x8fbd('0x5a')]({'where':{'id':_0x167528[_0x8fbd('0x5d')]['id']}})[_0x8fbd('0x24')](handleEntityNotFound(_0x5dddb6,null))[_0x8fbd('0x24')](function(_0x19ebf7){if(_0x19ebf7){_0x3e57d5=_0x19ebf7;return db[_0x8fbd('0x86')][_0x8fbd('0x5a')]({'where':{'id':_0x19ebf7[_0x8fbd('0x87')]}});}})[_0x8fbd('0x24')](handleEntityNotFound(_0x5dddb6,null))[_0x8fbd('0x24')](function(_0x15502d){if(_0x15502d){logger['debug'](_0x8fbd('0x88'),'status',_0x8fbd('0x89'),_0x15502d[_0x8fbd('0x42')],util[_0x8fbd('0x8a')](_0x167528[_0x8fbd('0x5c')],{'showHidden':![],'depth':null}));switch(_0x15502d['type']){case _0x8fbd('0x8b'):if(_0x167528['body'][_0x8fbd('0x8c')]&&_0x167528['body'][_0x8fbd('0x8c')]===_0x3e57d5[_0x8fbd('0x8d')]&&_0x167528[_0x8fbd('0x5c')][_0x8fbd('0x8e')]&&_0x167528['body']['MessageStatus']===_0x8fbd('0x60')){return _0x3e57d5[_0x8fbd('0x38')]({'read':!![]});}else{logger[_0x8fbd('0x2a')](_0x8fbd('0x8f'),'status',_0x8fbd('0x8b'),util[_0x8fbd('0x8a')](_0x167528['body'],{'showHidden':![],'depth':null}));}break;}return _0x3e57d5;}})['then'](respondWithResult(_0x5dddb6,null))[_0x8fbd('0x2c')](handleError(_0x5dddb6,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 1009f8c..868b2fa 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 _0xc2da=['emit','hasOwnProperty','hook','exports','events','WhatsappMessage','save','remove'];(function(_0x4eb517,_0x385479){var _0x30e9ed=function(_0x1825ef){while(--_0x1825ef){_0x4eb517['push'](_0x4eb517['shift']());}};_0x30e9ed(++_0x385479);}(_0xc2da,0x124));var _0xac2d=function(_0x7aeeb5,_0x37c8c2){_0x7aeeb5=_0x7aeeb5-0x0;var _0x581310=_0xc2da[_0x7aeeb5];return _0x581310;};'use strict';var EventEmitter=require(_0xac2d('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xac2d('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac2d('0x2'),'afterUpdate':'update','afterDestroy':_0xac2d('0x3')};function emitEvent(_0xb261fc){return function(_0xff0fff,_0x332f28,_0x120263){WhatsappMessageEvents[_0xac2d('0x4')](_0xb261fc+':'+_0xff0fff['id'],_0xff0fff);WhatsappMessageEvents[_0xac2d('0x4')](_0xb261fc,_0xff0fff);_0x120263(null);};}for(var e in events){if(events[_0xac2d('0x5')](e)){var event=events[e];WhatsappMessage[_0xac2d('0x6')](e,emitEvent(event));}}module[_0xac2d('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9d9b=['save','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage'];(function(_0x187943,_0x1f9f5c){var _0x475fd0=function(_0x291272){while(--_0x291272){_0x187943['push'](_0x187943['shift']());}};_0x475fd0(++_0x1f9f5c);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x164d35,_0x4c309e){_0x164d35=_0x164d35-0x0;var _0x3536a6=_0x9d9b[_0x164d35];return _0x3536a6;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xb9d9('0x0'))['db'][_0xb9d9('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb9d9('0x2'),'afterUpdate':'update','afterDestroy':_0xb9d9('0x3')};function emitEvent(_0x19d86d){return function(_0x2fd7d5,_0x55b2c3,_0x3bac8c){WhatsappMessageEvents['emit'](_0x19d86d+':'+_0x2fd7d5['id'],_0x2fd7d5);WhatsappMessageEvents[_0xb9d9('0x4')](_0x19d86d,_0x2fd7d5);_0x3bac8c(null);};}for(var e in events){if(events[_0xb9d9('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb9d9('0x6')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 4ff00ef..c62813c 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 _0x433a=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x433a,0x14c));var _0xa433=function(_0x26616c,_0x52b720){_0x26616c=_0x26616c-0x0;var _0x2b0766=_0x433a[_0x26616c];return _0x2b0766;};'use strict';var _=require(_0xa433('0x0'));var util=require(_0xa433('0x1'));var logger=require(_0xa433('0x2'))('api');var moment=require(_0xa433('0x3'));var BPromise=require(_0xa433('0x4'));var rp=require(_0xa433('0x5'));var fetch=require(_0xa433('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa433('0x7'));var config=require(_0xa433('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0xa433('0x9')]=function(_0x4117cb,_0x406fd6){return _0x4117cb[_0xa433('0xa')](_0xa433('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xa433('0xc'),'fields':[_0xa433('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0xa433('0xd')],'type':_0xa433('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21e1b3,_0x364115,_0x1715a4){var _0xfbf9c1=_0x4117cb[_0xa433('0xf')];var _0x3e57b7=_0x21e1b3[_0xa433('0x10')]({'plain':!![]});if(_0x3e57b7[_0xa433('0x11')]['toLowerCase']()==='in'||_0x3e57b7[_0xa433('0x11')][_0xa433('0x12')]()===_0xa433('0x13')&&!_0x3e57b7[_0xa433('0x14')]&&!_['isNil'](_0x3e57b7[_0xa433('0x15')])){_0xfbf9c1[_0xa433('0x16')][_0xa433('0x17')]({'where':{'id':_0x3e57b7[_0xa433('0x18')]}})[_0xa433('0x19')](function(_0x452f1e){if(_0x452f1e){_0x452f1e[_0xa433('0x1a')]({'lastMsgAt':_0x3e57b7[_0xa433('0x1b')],'lastMsgDirection':_0x3e57b7['direction'][_0xa433('0x12')]()});}})['catch'](function(_0x452aa4){console[_0xa433('0x1c')](_0x452aa4);});}if(_0x3e57b7[_0xa433('0x11')]===_0xa433('0x13')&&!_0x3e57b7[_0xa433('0x14')]){var _0x1bc01f;_0xfbf9c1[_0xa433('0x1d')][_0xa433('0x1e')]({'where':{'id':_0x3e57b7[_0xa433('0x1f')]},'raw':!![]})[_0xa433('0x19')](function(_0x304549){_0x1bc01f=_0x304549;if(_0x1bc01f&&_0x1bc01f[_0xa433('0x20')]){switch(_0x1bc01f[_0xa433('0x20')]){case _0xa433('0x21'):var _0x5f46a5=require('twilio');if(_0x1bc01f[_0xa433('0x22')]&&_0x1bc01f[_0xa433('0x23')]&&_0x1bc01f[_0xa433('0x24')]){var _0x378682=new _0x5f46a5(_0x1bc01f[_0xa433('0x22')],_0x1bc01f[_0xa433('0x23')]);_0x378682[_0xa433('0x25')][_0xa433('0x26')]({'body':_0x3e57b7[_0xa433('0xd')],'to':'whatsapp:'+_0x3e57b7[_0xa433('0x24')],'from':_0xa433('0x27')+_0x1bc01f[_0xa433('0x24')],'statusCallback':_0x1bc01f[_0xa433('0x28')]+_0xa433('0x29')+_0x3e57b7['id']+_0xa433('0x2a')+_0x1bc01f[_0xa433('0x2b')]})[_0xa433('0x19')](function(_0x55756c){if(_0x55756c['sid']){return _0x21e1b3[_0xa433('0x1a')]({'messageId':_0x55756c[_0xa433('0x2c')]});}})[_0xa433('0x2d')](function(_0x57994c){logger[_0xa433('0x1c')](_0xa433('0x2e'),_0xa433('0x2f'),_0xa433('0x21'),util[_0xa433('0x30')](_0x57994c,{'showHidden':![],'depth':null}));});}else{logger[_0xa433('0x1c')](_0xa433('0x2e'),_0xa433('0x2f'),_0xa433('0x21'),_0xa433('0x31'));}break;case _0xa433('0x32'):var _0x36ce46=_0x1bc01f[_0xa433('0x22')];var _0xea450a=_0x1bc01f[_0xa433('0x23')];var _0x3cc2c2=_0x1bc01f[_0xa433('0x33')]+_0xa433('0x34')+_0x36ce46+_0xa433('0x35');var _0x52b9c1={'to':[_0x3e57b7[_0xa433('0x24')]],'message':{'type':_0xa433('0x36'),'text':_0x3e57b7['body']}};var _0x16fe7c={'method':_0xa433('0x37'),'uri':_0x3cc2c2,'headers':{'Authorization':_0xa433('0x38')+_0xea450a,'Content-Type':'application/json'},'body':_0x52b9c1,'json':!![]};rp(_0x16fe7c)[_0xa433('0x19')](function(_0x29d427){if(_0x29d427[_0xa433('0x39')][0x0][_0xa433('0x3a')]){return _0x21e1b3[_0xa433('0x1a')]({'messageId':_0x29d427[_0xa433('0x39')][0x0][_0xa433('0x3a')]});}})[_0xa433('0x2d')](function(_0x51287e){logger[_0xa433('0x3b')]('WhatsappMessage,\x20%s',_0x51287e);});break;}}})[_0xa433('0x3c')](function(){_0x1715a4();});}else{_0x1715a4();}}},'charset':_0xa433('0x3d'),'collate':_0xa433('0x3e')});}; \ No newline at end of file +var _0x7140=['WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','WhatsappInteractionId','update','createdAt','WhatsappAccount','find','then','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','token','sid','catch','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','message_id','statuses','err'];(function(_0xf83277,_0x55487e){var _0x361e0e=function(_0xa2b602){while(--_0xa2b602){_0xf83277['push'](_0xf83277['shift']());}};_0x361e0e(++_0x55487e);}(_0x7140,0xbb));var _0x0714=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x7140[_0x545bed];return _0x16c79c;};'use strict';var _=require(_0x0714('0x0'));var util=require(_0x0714('0x1'));var logger=require(_0x0714('0x2'))(_0x0714('0x3'));var moment=require(_0x0714('0x4'));var BPromise=require(_0x0714('0x5'));var rp=require('request-promise');var fetch=require(_0x0714('0x6'));var fs=require('fs');var path=require(_0x0714('0x7'));var rimraf=require(_0x0714('0x8'));var config=require(_0x0714('0x9'));var attributes=require(_0x0714('0xa'));module[_0x0714('0xb')]=function(_0x4faa0c,_0x38c9f2){return _0x4faa0c['define'](_0x0714('0xc'),attributes,{'tableName':_0x0714('0xd'),'paranoid':![],'indexes':[{'name':_0x0714('0xe'),'fields':[_0x0714('0xe')]},{'name':_0x0714('0xf'),'fields':[_0x0714('0x10')],'type':_0x0714('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x144504,_0x5dca07,_0x47f1ac){var _0x3eb198=_0x4faa0c[_0x0714('0x12')];var _0x41fe90=_0x144504[_0x0714('0x13')]({'plain':!![]});if(_0x41fe90[_0x0714('0x14')][_0x0714('0x15')]()==='in'||_0x41fe90['direction']['toLowerCase']()===_0x0714('0x16')&&!_0x41fe90[_0x0714('0x17')]&&!_[_0x0714('0x18')](_0x41fe90['UserId'])){_0x3eb198['WhatsappInteraction'][_0x0714('0x19')]({'where':{'id':_0x41fe90[_0x0714('0x1a')]}})['then'](function(_0x47c124){if(_0x47c124){_0x47c124[_0x0714('0x1b')]({'lastMsgAt':_0x41fe90[_0x0714('0x1c')],'lastMsgDirection':_0x41fe90[_0x0714('0x14')][_0x0714('0x15')]()});}})['catch'](function(_0xac3e3a){console['error'](_0xac3e3a);});}if(_0x41fe90['direction']===_0x0714('0x16')&&!_0x41fe90[_0x0714('0x17')]){var _0x2569d4;_0x3eb198[_0x0714('0x1d')][_0x0714('0x1e')]({'where':{'id':_0x41fe90['WhatsappAccountId']},'raw':!![]})[_0x0714('0x1f')](function(_0x596ac7){_0x2569d4=_0x596ac7;if(_0x2569d4&&_0x2569d4[_0x0714('0x20')]){switch(_0x2569d4['type']){case'twilio':var _0x2140fa=require(_0x0714('0x21'));if(_0x2569d4[_0x0714('0x22')]&&_0x2569d4['authToken']&&_0x2569d4[_0x0714('0x23')]){var _0x41f22f=new _0x2140fa(_0x2569d4[_0x0714('0x22')],_0x2569d4[_0x0714('0x24')]);_0x41f22f[_0x0714('0x25')][_0x0714('0x26')]({'body':_0x41fe90[_0x0714('0x10')],'to':_0x0714('0x27')+_0x41fe90[_0x0714('0x23')],'from':_0x0714('0x27')+_0x2569d4['phone'],'statusCallback':_0x2569d4['remote']+'/api/whatsapp/messages/'+_0x41fe90['id']+'/status?token='+_0x2569d4[_0x0714('0x28')]})[_0x0714('0x1f')](function(_0x3230a5){if(_0x3230a5[_0x0714('0x29')]){return _0x144504[_0x0714('0x1b')]({'messageId':_0x3230a5[_0x0714('0x29')]});}})[_0x0714('0x2a')](function(_0x34d4be){logger[_0x0714('0x2b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x0714('0x2c'),'twilio',util[_0x0714('0x2d')](_0x34d4be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0714('0x2e'),_0x0714('0x2c'),'twilio',_0x0714('0x2f'));}break;case'sinch':var _0x325cf2=_0x2569d4[_0x0714('0x22')];var _0x34b8d0=_0x2569d4[_0x0714('0x24')];var _0x4e926a=_0x2569d4[_0x0714('0x30')]+_0x0714('0x31')+_0x325cf2+_0x0714('0x32');var _0x3111be={'to':[_0x41fe90['phone']],'message':{'type':_0x0714('0x33'),'text':_0x41fe90[_0x0714('0x10')]}};var _0x6b6f97={'method':'POST','uri':_0x4e926a,'headers':{'Authorization':_0x0714('0x34')+_0x34b8d0,'Content-Type':_0x0714('0x35')},'body':_0x3111be,'json':!![]};rp(_0x6b6f97)['then'](function(_0xcd5273){if(_0xcd5273['statuses'][0x0][_0x0714('0x36')]){return _0x144504['update']({'messageId':_0xcd5273[_0x0714('0x37')][0x0]['message_id']});}})[_0x0714('0x2a')](function(_0x3d63e0){logger[_0x0714('0x38')](_0x0714('0x39'),_0x3d63e0);});break;}}})[_0x0714('0x3a')](function(){_0x47f1ac();});}else{_0x47f1ac();}}},'charset':_0x0714('0x3b'),'collate':_0x0714('0x3c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 81e4527..66cb7c5 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 _0x860b=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','then','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','info'];(function(_0x1867fb,_0x763112){var _0x147564=function(_0xebc55b){while(--_0xebc55b){_0x1867fb['push'](_0x1867fb['shift']());}};_0x147564(++_0x763112);}(_0x860b,0x177));var _0xb860=function(_0x993971,_0x3f6e30){_0x993971=_0x993971-0x0;var _0x314aba=_0x860b[_0x993971];return _0x314aba;};'use strict';var _=require('lodash');var util=require(_0xb860('0x0'));var moment=require(_0xb860('0x1'));var BPromise=require(_0xb860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb860('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb860('0x4'))(_0xb860('0x5'));var config=require(_0xb860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb860('0x7')][_0xb860('0x8')]({'port':0x232a});config[_0xb860('0x9')]=_[_0xb860('0xa')](config[_0xb860('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb860('0xb'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xb860('0xc')](socket);function respondWithRpcPromise(_0xbe260,_0x4936c3,_0x3c1994){return new BPromise(function(_0x22ba0b,_0x120de2){return client[_0xb860('0xd')](_0xbe260,_0x3c1994)['then'](function(_0x58d955){logger[_0xb860('0xe')](_0xb860('0xf'),_0x4936c3,_0xb860('0x10'));logger[_0xb860('0x11')](_0xb860('0x12'),_0x4936c3,_0xb860('0x10'),JSON[_0xb860('0x13')](_0x58d955));if(_0x58d955[_0xb860('0x14')]){if(_0x58d955[_0xb860('0x14')]['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4936c3,_0x58d955[_0xb860('0x14')][_0xb860('0x15')]);return _0x120de2(_0x58d955[_0xb860('0x14')][_0xb860('0x15')]);}logger[_0xb860('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x4936c3,_0x58d955[_0xb860('0x14')][_0xb860('0x15')]);return _0x22ba0b(_0x58d955[_0xb860('0x14')]['message']);}else{logger[_0xb860('0xe')](_0xb860('0xf'),_0x4936c3,_0xb860('0x10'));_0x22ba0b(_0x58d955[_0xb860('0x16')][_0xb860('0x15')]);}})[_0xb860('0x17')](function(_0x5b996d){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4936c3,_0x5b996d);_0x120de2(_0x5b996d);});});}exports[_0xb860('0x18')]=function(_0x161506){var _0xca1040=this;return new Promise(function(_0x5c7b15,_0x151189){return db[_0xb860('0x19')][_0xb860('0x1a')](_0x161506[_0xb860('0x1b')],{'raw':_0x161506[_0xb860('0x1c')]?_0x161506[_0xb860('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb860('0x1d')](function(_0x1d6fa1){logger[_0xb860('0xe')](_0xb860('0x18'),_0x161506);logger[_0xb860('0x11')](_0xb860('0x18'),_0x161506,JSON[_0xb860('0x13')](_0x1d6fa1));_0x5c7b15(_0x1d6fa1);})[_0xb860('0x17')](function(_0x124037){logger['error'](_0xb860('0x18'),_0x124037['message'],_0x161506);_0x151189(_0xca1040[_0xb860('0x14')](0x1f4,_0x124037[_0xb860('0x15')]));});});}; \ No newline at end of file +var _0xe016=['then','info','debug','request\x20sent','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe016,0x17b));var _0x6e01=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xe016[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e01('0x0'));var BPromise=require(_0x6e01('0x1'));var rs=require(_0x6e01('0x2'));var fs=require('fs');var Redis=require(_0x6e01('0x3'));var db=require(_0x6e01('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e01('0x5'))(_0x6e01('0x6'));var config=require(_0x6e01('0x7'));var jayson=require(_0x6e01('0x8'));var client=jayson['client'][_0x6e01('0x9')]({'port':0x232a});config[_0x6e01('0xa')]=_[_0x6e01('0xb')](config[_0x6e01('0xa')],{'host':_0x6e01('0xc'),'port':0x18eb});var socket=require(_0x6e01('0xd'))(new Redis(config[_0x6e01('0xa')]));require(_0x6e01('0xe'))[_0x6e01('0xf')](socket);function respondWithRpcPromise(_0x16d2dc,_0x501d8f,_0x3ef08b){return new BPromise(function(_0x1c472a,_0x164110){return client[_0x6e01('0x10')](_0x16d2dc,_0x3ef08b)[_0x6e01('0x11')](function(_0x30fa67){logger[_0x6e01('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x501d8f,'request\x20sent');logger[_0x6e01('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x501d8f,_0x6e01('0x14'),JSON['stringify'](_0x30fa67));if(_0x30fa67['error']){if(_0x30fa67[_0x6e01('0x15')][_0x6e01('0x16')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x501d8f,_0x30fa67[_0x6e01('0x15')]['message']);return _0x164110(_0x30fa67[_0x6e01('0x15')][_0x6e01('0x17')]);}logger[_0x6e01('0x15')](_0x6e01('0x18'),_0x501d8f,_0x30fa67['error'][_0x6e01('0x17')]);return _0x1c472a(_0x30fa67[_0x6e01('0x15')][_0x6e01('0x17')]);}else{logger[_0x6e01('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x501d8f,_0x6e01('0x14'));_0x1c472a(_0x30fa67[_0x6e01('0x19')]['message']);}})[_0x6e01('0x1a')](function(_0x4d1b00){logger[_0x6e01('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x501d8f,_0x4d1b00);_0x164110(_0x4d1b00);});});}exports[_0x6e01('0x1b')]=function(_0x32aa32){var _0x125c08=this;return new Promise(function(_0xebdb91,_0x29a6e1){return db[_0x6e01('0x1c')]['create'](_0x32aa32[_0x6e01('0x1d')],{'raw':_0x32aa32[_0x6e01('0x1e')]?_0x32aa32[_0x6e01('0x1e')][_0x6e01('0x1f')]===undefined?!![]:![]:!![]})[_0x6e01('0x11')](function(_0x181862){logger[_0x6e01('0x12')](_0x6e01('0x1b'),_0x32aa32);logger[_0x6e01('0x13')](_0x6e01('0x1b'),_0x32aa32,JSON[_0x6e01('0x20')](_0x181862));_0xebdb91(_0x181862);})[_0x6e01('0x1a')](function(_0xf79fc7){logger[_0x6e01('0x15')]('CreateWhatsappMessage',_0xf79fc7[_0x6e01('0x17')],_0x32aa32);_0x29a6e1(_0x125c08[_0x6e01('0x15')](0x1f4,_0xf79fc7[_0x6e01('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 599f3a6..f48f4a7 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 _0xc7f6=['emit','removeListener','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x281522,_0x315f8c){var _0x18836c=function(_0x36da1e){while(--_0x36da1e){_0x281522['push'](_0x281522['shift']());}};_0x18836c(++_0x315f8c);}(_0xc7f6,0x148));var _0x6c7f=function(_0x12db95,_0x43c770){_0x12db95=_0x12db95-0x0;var _0x2c530b=_0xc7f6[_0x12db95];return _0x2c530b;};'use strict';var WhatsappMessageEvents=require(_0x6c7f('0x0'));var events=['save',_0x6c7f('0x1'),'update'];function createListener(_0x482fe8,_0x553f65){return function(_0x215ea2){_0x553f65[_0x6c7f('0x2')](_0x482fe8,_0x215ea2);};}function removeListener(_0x5bdeb1,_0x174220){return function(){WhatsappMessageEvents[_0x6c7f('0x3')](_0x5bdeb1,_0x174220);};}exports['register']=function(_0x313845){for(var _0x398772=0x0,_0x434b14=events[_0x6c7f('0x4')];_0x398772<_0x434b14;_0x398772++){var _0x348aae=events[_0x398772];var _0x5e3279=createListener(_0x6c7f('0x5')+_0x348aae,_0x313845);WhatsappMessageEvents['on'](_0x348aae,_0x5e3279);}}; \ No newline at end of file +var _0x22ef=['update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','remove'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x22ef,0x146));var _0xf22e=function(_0x9f5c4c,_0x56a089){_0x9f5c4c=_0x9f5c4c-0x0;var _0x37aa93=_0x22ef[_0x9f5c4c];return _0x37aa93;};'use strict';var WhatsappMessageEvents=require(_0xf22e('0x0'));var events=['save',_0xf22e('0x1'),_0xf22e('0x2')];function createListener(_0x23ab5e,_0x8a1891){return function(_0x563acf){_0x8a1891[_0xf22e('0x3')](_0x23ab5e,_0x563acf);};}function removeListener(_0x1a72a1,_0x18c66f){return function(){WhatsappMessageEvents[_0xf22e('0x4')](_0x1a72a1,_0x18c66f);};}exports[_0xf22e('0x5')]=function(_0x2b7a35){for(var _0x5220c5=0x0,_0x5eb83e=events[_0xf22e('0x6')];_0x5220c5<_0x5eb83e;_0x5220c5++){var _0xd80431=events[_0x5220c5];var _0x157a33=createListener(_0xf22e('0x7')+_0xd80431,_0x2b7a35);WhatsappMessageEvents['on'](_0xd80431,_0x157a33);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index fad0e53..221b369 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 _0x2a95=['put','destroy','removeTeams','delete','removeAgents','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','post','create','/:id/users','addAgents'];(function(_0x264fc2,_0x11a992){var _0x242093=function(_0x49c943){while(--_0x49c943){_0x264fc2['push'](_0x264fc2['shift']());}};_0x242093(++_0x11a992);}(_0x2a95,0x1f4));var _0x52a9=function(_0xf15167,_0x3d0c08){_0xf15167=_0xf15167-0x0;var _0x28899a=_0x2a95[_0xf15167];return _0x28899a;};'use strict';var multer=require('multer');var util=require(_0x52a9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x52a9('0x1'));var router=express['Router']();var fs_extra=require(_0x52a9('0x2'));var auth=require(_0x52a9('0x3'));var interaction=require(_0x52a9('0x4'));var config=require(_0x52a9('0x5'));var controller=require(_0x52a9('0x6'));router['get']('/',auth[_0x52a9('0x7')](),controller['index']);router[_0x52a9('0x8')](_0x52a9('0x9'),auth[_0x52a9('0x7')](),controller[_0x52a9('0xa')]);router[_0x52a9('0x8')](_0x52a9('0xb'),auth[_0x52a9('0x7')](),controller[_0x52a9('0xc')]);router[_0x52a9('0x8')](_0x52a9('0xd'),auth[_0x52a9('0x7')](),controller[_0x52a9('0xe')]);router[_0x52a9('0x8')](_0x52a9('0xf'),auth[_0x52a9('0x7')](),controller['getTeams']);router[_0x52a9('0x8')]('/:id/users',auth[_0x52a9('0x7')](),controller['getAgents']);router[_0x52a9('0x10')]('/',auth[_0x52a9('0x7')](),controller[_0x52a9('0x11')]);router[_0x52a9('0x10')](_0x52a9('0xf'),auth[_0x52a9('0x7')](),controller['addTeams']);router[_0x52a9('0x10')](_0x52a9('0x12'),auth[_0x52a9('0x7')](),controller[_0x52a9('0x13')]);router[_0x52a9('0x14')](_0x52a9('0xb'),auth[_0x52a9('0x7')](),controller['update']);router['delete'](_0x52a9('0xb'),auth['isAuthenticated'](),controller[_0x52a9('0x15')]);router['delete'](_0x52a9('0xf'),auth[_0x52a9('0x7')](),controller[_0x52a9('0x16')]);router[_0x52a9('0x17')](_0x52a9('0x12'),auth['isAuthenticated'](),controller[_0x52a9('0x18')]);module[_0x52a9('0x19')]=router; \ No newline at end of file +var _0x16bb=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','multer','util'];(function(_0x168180,_0x55594a){var _0x5067a7=function(_0x705445){while(--_0x705445){_0x168180['push'](_0x168180['shift']());}};_0x5067a7(++_0x55594a);}(_0x16bb,0x1eb));var _0xb16b=function(_0xb67da5,_0x16bf3f){_0xb67da5=_0xb67da5-0x0;var _0x38df4d=_0x16bb[_0xb67da5];return _0x38df4d;};'use strict';var multer=require(_0xb16b('0x0'));var util=require(_0xb16b('0x1'));var path=require(_0xb16b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb16b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb16b('0x4'));var interaction=require(_0xb16b('0x5'));var config=require(_0xb16b('0x6'));var controller=require(_0xb16b('0x7'));router['get']('/',auth[_0xb16b('0x8')](),controller[_0xb16b('0x9')]);router[_0xb16b('0xa')]('/describe',auth[_0xb16b('0x8')](),controller[_0xb16b('0xb')]);router[_0xb16b('0xa')]('/:id',auth[_0xb16b('0x8')](),controller[_0xb16b('0xc')]);router['get'](_0xb16b('0xd'),auth[_0xb16b('0x8')](),controller[_0xb16b('0xe')]);router['get'](_0xb16b('0xf'),auth[_0xb16b('0x8')](),controller[_0xb16b('0x10')]);router[_0xb16b('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xb16b('0x11')]);router[_0xb16b('0x12')]('/',auth[_0xb16b('0x8')](),controller['create']);router[_0xb16b('0x12')](_0xb16b('0xf'),auth[_0xb16b('0x8')](),controller[_0xb16b('0x13')]);router[_0xb16b('0x12')](_0xb16b('0x14'),auth[_0xb16b('0x8')](),controller[_0xb16b('0x15')]);router[_0xb16b('0x16')](_0xb16b('0x17'),auth[_0xb16b('0x8')](),controller[_0xb16b('0x18')]);router[_0xb16b('0x19')]('/:id',auth[_0xb16b('0x8')](),controller[_0xb16b('0x1a')]);router['delete'](_0xb16b('0xf'),auth[_0xb16b('0x8')](),controller[_0xb16b('0x1b')]);router['delete'](_0xb16b('0x14'),auth['isAuthenticated'](),controller[_0xb16b('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 36bcfce..07ff435 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 _0x1cf3=['STRING','name','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x41e96,_0x4c9b00){var _0x2f16cf=function(_0x3c6cb4){while(--_0x3c6cb4){_0x41e96['push'](_0x41e96['shift']());}};_0x2f16cf(++_0x4c9b00);}(_0x1cf3,0x1be));var _0x31cf=function(_0xe43115,_0x3c3b21){_0xe43115=_0xe43115-0x0;var _0x29a9d7=_0x1cf3[_0xe43115];return _0x29a9d7;};'use strict';var Sequelize=require(_0x31cf('0x0'));module[_0x31cf('0x1')]={'name':{'type':Sequelize[_0x31cf('0x2')],'unique':_0x31cf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x31cf('0x4')]('rrmemory',_0x31cf('0x5'),_0x31cf('0x6'))},'description':{'type':Sequelize[_0x31cf('0x2')]}}; \ No newline at end of file +var _0x76a3=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x5bb3b2,_0x512954){var _0xbd9087=function(_0x4da464){while(--_0x4da464){_0x5bb3b2['push'](_0x5bb3b2['shift']());}};_0xbd9087(++_0x512954);}(_0x76a3,0xf8));var _0x376a=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x76a3[_0x15942a];return _0x36a9fb;};'use strict';var Sequelize=require(_0x376a('0x0'));module[_0x376a('0x1')]={'name':{'type':Sequelize[_0x376a('0x2')],'unique':_0x376a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x376a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x376a('0x5')](_0x376a('0x6'),_0x376a('0x7'),_0x376a('0x8'))},'description':{'type':Sequelize[_0x376a('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 5869a78..c742979 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 _0xab4f=['each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','ids','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','WhatsappQueues','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','destroy','describe','findOne','UserWhatsappQueue','WhatsappQueueId','User','UserId','agent','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','sequelize','transaction'];(function(_0x218271,_0x2a7c51){var _0xfe3312=function(_0x176de1){while(--_0x176de1){_0x218271['push'](_0x218271['shift']());}};_0xfe3312(++_0x2a7c51);}(_0xab4f,0x1c9));var _0xfab4=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xab4f[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0xfab4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfab4('0x1'));var rp=require(_0xfab4('0x2'));var moment=require(_0xfab4('0x3'));var BPromise=require(_0xfab4('0x4'));var Mustache=require(_0xfab4('0x5'));var util=require(_0xfab4('0x6'));var path=require(_0xfab4('0x7'));var sox=require(_0xfab4('0x8'));var csv=require(_0xfab4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfab4('0xa'));var _=require(_0xfab4('0xb'));var squel=require(_0xfab4('0xc'));var crypto=require(_0xfab4('0xd'));var jsforce=require(_0xfab4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfab4('0xf'));var Papa=require('papaparse');var Redis=require(_0xfab4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfab4('0x11'));var logger=require(_0xfab4('0x12'))(_0xfab4('0x13'));var utils=require(_0xfab4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfab4('0x15'))['db'];config['redis']=_[_0xfab4('0x16')](config[_0xfab4('0x17')],{'host':_0xfab4('0x18'),'port':0x18eb});var socket=require(_0xfab4('0x19'))(new Redis(config[_0xfab4('0x17')]));require(_0xfab4('0x1a'))[_0xfab4('0x1b')](socket);function respondWithStatusCode(_0x26c92c,_0x20ad94){_0x20ad94=_0x20ad94||0xcc;return function(_0x4fd27f){if(_0x4fd27f){return _0x26c92c[_0xfab4('0x1c')](_0x20ad94);}return _0x26c92c[_0xfab4('0x1d')](_0x20ad94)[_0xfab4('0x1e')]();};}function respondWithResult(_0x4a1762,_0x389a03){_0x389a03=_0x389a03||0xc8;return function(_0x8fbba1){if(_0x8fbba1){return _0x4a1762[_0xfab4('0x1d')](_0x389a03)[_0xfab4('0x1f')](_0x8fbba1);}};}function respondWithFilteredResult(_0x4b8ea7,_0x52b6a0){return function(_0x53d224){if(_0x53d224){var _0x168693=typeof _0x52b6a0[_0xfab4('0x20')]==='undefined'&&typeof _0x52b6a0[_0xfab4('0x21')]===_0xfab4('0x22');var _0x15f25c=_0x53d224[_0xfab4('0x23')];var _0x213a64=_0x168693?0x0:_0x52b6a0[_0xfab4('0x20')];var _0xaa2c3=_0x168693?_0x53d224['count']:_0x52b6a0[_0xfab4('0x20')]+_0x52b6a0[_0xfab4('0x21')];var _0x39a9f7;if(_0xaa2c3>=_0x15f25c){_0xaa2c3=_0x15f25c;_0x39a9f7=0xc8;}else{_0x39a9f7=0xce;}_0x4b8ea7['status'](_0x39a9f7);return _0x4b8ea7[_0xfab4('0x24')]('Content-Range',_0x213a64+'-'+_0xaa2c3+'/'+_0x15f25c)[_0xfab4('0x1f')](_0x53d224);}return null;};}function patchUpdates(_0x207b90){return function(_0x100eaf){try{jsonpatch[_0xfab4('0x25')](_0x100eaf,_0x207b90,!![]);}catch(_0x39c2d1){return BPromise[_0xfab4('0x26')](_0x39c2d1);}return _0x100eaf[_0xfab4('0x27')]();};}function saveUpdates(_0x3cd7b3,_0x5d30e0){return function(_0x4b7c22){if(_0x4b7c22){return _0x4b7c22[_0xfab4('0x28')](_0x3cd7b3)[_0xfab4('0x29')](function(_0x593aa0){return _0x593aa0;});}return null;};}function removeEntity(_0x596be5,_0x42576e){return function(_0x5c8913){if(_0x5c8913){return _0x5c8913['destroy']()[_0xfab4('0x29')](function(){var _0x4c9039=_0x5c8913[_0xfab4('0x2a')]({'plain':!![]});var _0x23c050=_0xfab4('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x23c050,'resourceId':_0x4c9039['id']}})[_0xfab4('0x29')](function(){return _0x5c8913;});})[_0xfab4('0x29')](function(){_0x596be5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1893a,_0x5e684){return function(_0xa4308b){if(!_0xa4308b){_0xc1893a[_0xfab4('0x1c')](0x194);}return _0xa4308b;};}function handleError(_0x2106be,_0x37bc7a){_0x37bc7a=_0x37bc7a||0x1f4;return function(_0x3fde17){logger[_0xfab4('0x2c')](_0x3fde17[_0xfab4('0x2d')]);if(_0x3fde17[_0xfab4('0x2e')]){delete _0x3fde17[_0xfab4('0x2e')];}_0x2106be[_0xfab4('0x1d')](_0x37bc7a)[_0xfab4('0x2f')](_0x3fde17);};}exports[_0xfab4('0x30')]=function(_0x363cb9,_0x477ed1){var _0x21a393={},_0xd06d85={},_0x1248a6={'count':0x0,'rows':[]};var _0x5abb71=_[_0xfab4('0x31')](db[_0xfab4('0x32')][_0xfab4('0x33')],function(_0xe23d86){return{'name':_0xe23d86[_0xfab4('0x34')],'type':_0xe23d86['type'][_0xfab4('0x35')]};});_0xd06d85[_0xfab4('0x36')]=_[_0xfab4('0x31')](_0x5abb71,_0xfab4('0x2e'));_0xd06d85[_0xfab4('0x37')]=_[_0xfab4('0x38')](_0x363cb9[_0xfab4('0x37')]);_0xd06d85[_0xfab4('0x39')]=_[_0xfab4('0x3a')](_0xd06d85[_0xfab4('0x36')],_0xd06d85[_0xfab4('0x37')]);_0x21a393[_0xfab4('0x3b')]=_[_0xfab4('0x3a')](_0xd06d85[_0xfab4('0x36')],qs[_0xfab4('0x3c')](_0x363cb9[_0xfab4('0x37')][_0xfab4('0x3c')]));_0x21a393['attributes']=_0x21a393[_0xfab4('0x3b')][_0xfab4('0x3d')]?_0x21a393[_0xfab4('0x3b')]:_0xd06d85[_0xfab4('0x36')];if(!_0x363cb9[_0xfab4('0x37')][_0xfab4('0x3e')](_0xfab4('0x3f'))){_0x21a393[_0xfab4('0x21')]=qs[_0xfab4('0x21')](_0x363cb9[_0xfab4('0x37')]['limit']);_0x21a393[_0xfab4('0x20')]=qs[_0xfab4('0x20')](_0x363cb9[_0xfab4('0x37')][_0xfab4('0x20')]);}_0x21a393[_0xfab4('0x40')]=qs[_0xfab4('0x41')](_0x363cb9[_0xfab4('0x37')][_0xfab4('0x41')]);_0x21a393['where']=qs[_0xfab4('0x39')](_[_0xfab4('0x42')](_0x363cb9[_0xfab4('0x37')],_0xd06d85[_0xfab4('0x39')]),_0x5abb71);if(_0x363cb9[_0xfab4('0x37')]['filter']){_0x21a393['where']=_[_0xfab4('0x43')](_0x21a393[_0xfab4('0x44')],{'$or':_['map'](_0x5abb71,function(_0x225fa8){if(_0x225fa8[_0xfab4('0x45')]!==_0xfab4('0x46')){var _0x55c338={};_0x55c338[_0x225fa8[_0xfab4('0x2e')]]={'$like':'%'+_0x363cb9['query'][_0xfab4('0x47')]+'%'};return _0x55c338;}})});}_0x21a393=_[_0xfab4('0x43')]({},_0x21a393,_0x363cb9[_0xfab4('0x48')]);var _0x177db8={'where':_0x21a393[_0xfab4('0x44')]};return db['WhatsappQueue'][_0xfab4('0x23')](_0x177db8)['then'](function(_0x61404c){_0x1248a6[_0xfab4('0x23')]=_0x61404c;if(_0x363cb9[_0xfab4('0x37')][_0xfab4('0x49')]){_0x21a393[_0xfab4('0x4a')]=[{'all':!![]}];}return db[_0xfab4('0x32')][_0xfab4('0x4b')](_0x21a393);})[_0xfab4('0x29')](function(_0x56c5c2){_0x1248a6[_0xfab4('0x4c')]=_0x56c5c2;return _0x1248a6;})[_0xfab4('0x29')](respondWithFilteredResult(_0x477ed1,_0x21a393))[_0xfab4('0x4d')](handleError(_0x477ed1,null));};exports['show']=function(_0x4533fc,_0x5aa8c4){var _0xf6459e={'raw':!![],'where':{'id':_0x4533fc[_0xfab4('0x4e')]['id']}},_0x4ce1f4={};_0x4ce1f4[_0xfab4('0x36')]=_['keys'](db[_0xfab4('0x32')][_0xfab4('0x33')]);_0x4ce1f4[_0xfab4('0x37')]=_['keys'](_0x4533fc['query']);_0x4ce1f4['filters']=_[_0xfab4('0x3a')](_0x4ce1f4[_0xfab4('0x36')],_0x4ce1f4[_0xfab4('0x37')]);_0xf6459e[_0xfab4('0x3b')]=_['intersection'](_0x4ce1f4['model'],qs[_0xfab4('0x3c')](_0x4533fc[_0xfab4('0x37')]['fields']));_0xf6459e[_0xfab4('0x3b')]=_0xf6459e[_0xfab4('0x3b')][_0xfab4('0x3d')]?_0xf6459e[_0xfab4('0x3b')]:_0x4ce1f4['model'];if(_0x4533fc[_0xfab4('0x37')][_0xfab4('0x49')]){_0xf6459e[_0xfab4('0x4a')]=[{'all':!![]}];}_0xf6459e=_[_0xfab4('0x43')]({},_0xf6459e,_0x4533fc['options']);return db[_0xfab4('0x32')][_0xfab4('0x4f')](_0xf6459e)[_0xfab4('0x29')](handleEntityNotFound(_0x5aa8c4,null))[_0xfab4('0x29')](respondWithResult(_0x5aa8c4,null))[_0xfab4('0x4d')](handleError(_0x5aa8c4,null));};exports[_0xfab4('0x50')]=function(_0x54a2e7,_0x417f2f){return db['WhatsappQueue'][_0xfab4('0x50')](_0x54a2e7[_0xfab4('0x51')],{})[_0xfab4('0x29')](function(_0x11df65){var _0x2885c1=_0x54a2e7[_0xfab4('0x52')][_0xfab4('0x2a')]({'plain':!![]});if(!_0x2885c1)throw new Error(_0xfab4('0x53'));if(_0x2885c1[_0xfab4('0x54')]==='user'){var _0x33ae6f=_0x11df65[_0xfab4('0x2a')]({'plain':!![]});var _0x5b0503='WhatsappQueues';return db[_0xfab4('0x55')][_0xfab4('0x4f')]({'where':{'name':_0x5b0503,'userProfileId':_0x2885c1[_0xfab4('0x56')]},'raw':!![]})['then'](function(_0x11d0f1){if(_0x11d0f1&&_0x11d0f1[_0xfab4('0x57')]===0x0){return db['UserProfileResource'][_0xfab4('0x50')]({'name':_0x33ae6f[_0xfab4('0x2e')],'resourceId':_0x33ae6f['id'],'type':_0x11d0f1[_0xfab4('0x2e')],'sectionId':_0x11d0f1['id']},{})[_0xfab4('0x29')](function(){return _0x11df65;});}else{return _0x11df65;}})[_0xfab4('0x4d')](function(_0x4a8e33){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a8e33);throw _0x4a8e33;});}return _0x11df65;})['then'](respondWithResult(_0x417f2f,0xc9))['catch'](handleError(_0x417f2f,null));};exports[_0xfab4('0x28')]=function(_0x569592,_0x4ade2c){if(_0x569592[_0xfab4('0x51')]['id']){delete _0x569592['body']['id'];}return db[_0xfab4('0x32')][_0xfab4('0x4f')]({'where':{'id':_0x569592[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x4ade2c,null))[_0xfab4('0x29')](saveUpdates(_0x569592[_0xfab4('0x51')],null))[_0xfab4('0x29')](respondWithResult(_0x4ade2c,null))[_0xfab4('0x4d')](handleError(_0x4ade2c,null));};exports[_0xfab4('0x58')]=function(_0x5ab75c,_0x32f0da){return db[_0xfab4('0x32')][_0xfab4('0x4f')]({'where':{'id':_0x5ab75c['params']['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x32f0da,null))[_0xfab4('0x29')](removeEntity(_0x32f0da,null))[_0xfab4('0x4d')](handleError(_0x32f0da,null));};exports['describe']=function(_0x48f8bf,_0x20e65d){return db[_0xfab4('0x32')][_0xfab4('0x59')]()['then'](respondWithResult(_0x20e65d,null))[_0xfab4('0x4d')](handleError(_0x20e65d,null));};exports['getMembers']=function(_0x78ee36,_0x2c4f3a,_0x251f69){var _0x3dd702={'raw':!![],'where':{}},_0x4b3d1a={},_0x17abc0;return db['WhatsappQueue'][_0xfab4('0x5a')]({'where':{'id':_0x78ee36[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x2c4f3a,null))[_0xfab4('0x29')](function(_0xb40c15){if(_0xb40c15){_0x17abc0=_0xb40c15[_0xfab4('0x2a')]({'plain':!![]});_0x4b3d1a[_0xfab4('0x36')]=_[_0xfab4('0x38')](db[_0xfab4('0x5b')][_0xfab4('0x33')]);_0x4b3d1a[_0xfab4('0x37')]=_[_0xfab4('0x38')](_0x78ee36[_0xfab4('0x37')]);_0x4b3d1a[_0xfab4('0x39')]=_[_0xfab4('0x3a')](_0x4b3d1a[_0xfab4('0x36')],_0x4b3d1a['query']);_0x3dd702[_0xfab4('0x3b')]=_['intersection'](_0x4b3d1a['model'],qs[_0xfab4('0x3c')](_0x78ee36[_0xfab4('0x37')][_0xfab4('0x3c')]));_0x3dd702[_0xfab4('0x3b')]=_0x3dd702['attributes'][_0xfab4('0x3d')]?_0x3dd702[_0xfab4('0x3b')]:_0x4b3d1a['model'];if(!_0x78ee36['query'][_0xfab4('0x3e')](_0xfab4('0x3f'))){_0x3dd702[_0xfab4('0x21')]=qs[_0xfab4('0x21')](_0x78ee36[_0xfab4('0x37')][_0xfab4('0x21')]);_0x3dd702[_0xfab4('0x20')]=qs['offset'](_0x78ee36[_0xfab4('0x37')][_0xfab4('0x20')]);}_0x3dd702[_0xfab4('0x40')]=qs[_0xfab4('0x41')](_0x78ee36[_0xfab4('0x37')][_0xfab4('0x41')]);_0x3dd702['where']=qs[_0xfab4('0x39')](_['pick'](_0x78ee36[_0xfab4('0x37')],_0x4b3d1a['filters']));_0x3dd702[_0xfab4('0x44')][_0xfab4('0x5c')]=_0xb40c15['id'];if(_0x78ee36[_0xfab4('0x37')]['filter']){_0x3dd702['where']=_[_0xfab4('0x43')](_0x3dd702[_0xfab4('0x44')],{'$or':_[_0xfab4('0x31')](_0x3dd702[_0xfab4('0x3b')],function(_0x180afe){var _0x41a73b={};_0x41a73b[_0x180afe]={'$like':'%'+_0x78ee36[_0xfab4('0x37')][_0xfab4('0x47')]+'%'};return _0x41a73b;})});}_0x3dd702=_['merge']({},_0x3dd702,_0x78ee36[_0xfab4('0x48')]);return db[_0xfab4('0x5b')][_0xfab4('0x4b')](_0x3dd702);}})[_0xfab4('0x29')](function(_0x5aa40e){if(_0x5aa40e){return db[_0xfab4('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x5aa40e,_0xfab4('0x5e')),'role':_0xfab4('0x5f')},'attributes':['id',_0xfab4('0x2e'),'whatsappPause','updatedAt','createdAt']});}})[_0xfab4('0x29')](function(_0x2896eb){if(_0x2896eb){return{'count':_0x2896eb[_0xfab4('0x23')],'rows':_[_0xfab4('0x31')](_0x2896eb[_0xfab4('0x4c')],function(_0x278021){return{'membername':_0x278021['name'],'UserId':_0x278021['id'],'queue_name':_0x17abc0[_0xfab4('0x2e')],'WhatsappQueueId':_0x17abc0['id'],'interface':util[_0xfab4('0x60')](_0xfab4('0x61'),_0xfab4('0x62'),_0x278021[_0xfab4('0x2e')]),'penalty':0x0,'paused':_0x278021['whatsappPause'],'createdAt':_0x278021[_0xfab4('0x63')],'updatedAt':_0x278021[_0xfab4('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c4f3a,_0x3dd702))[_0xfab4('0x4d')](handleError(_0x2c4f3a,null));};exports[_0xfab4('0x65')]=function(_0x1d00f6,_0x401f38,_0x48b7a1){var _0x1cffa9={};var _0x3de26b={};var _0x39b9e7;var _0x23dab3;return db[_0xfab4('0x32')][_0xfab4('0x5a')]({'where':{'id':_0x1d00f6[_0xfab4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x401f38,null))['then'](function(_0x15340b){if(_0x15340b){_0x39b9e7=_0x15340b;_0x3de26b['model']=_[_0xfab4('0x38')](db[_0xfab4('0x66')][_0xfab4('0x33')]);_0x3de26b[_0xfab4('0x37')]=_['keys'](_0x1d00f6[_0xfab4('0x37')]);_0x3de26b[_0xfab4('0x39')]=_[_0xfab4('0x3a')](_0x3de26b[_0xfab4('0x36')],_0x3de26b[_0xfab4('0x37')]);_0x1cffa9[_0xfab4('0x3b')]=_['intersection'](_0x3de26b['model'],qs['fields'](_0x1d00f6[_0xfab4('0x37')][_0xfab4('0x3c')]));_0x1cffa9['attributes']=_0x1cffa9[_0xfab4('0x3b')][_0xfab4('0x3d')]?_0x1cffa9['attributes']:_0x3de26b['model'];_0x1cffa9[_0xfab4('0x40')]=qs[_0xfab4('0x41')](_0x1d00f6['query'][_0xfab4('0x41')]);_0x1cffa9[_0xfab4('0x44')]=qs[_0xfab4('0x39')](_[_0xfab4('0x42')](_0x1d00f6[_0xfab4('0x37')],_0x3de26b[_0xfab4('0x39')]));if(_0x1d00f6['query'][_0xfab4('0x47')]){_0x1cffa9[_0xfab4('0x44')]=_[_0xfab4('0x43')](_0x1cffa9[_0xfab4('0x44')],{'$or':_[_0xfab4('0x31')](_0x1cffa9[_0xfab4('0x3b')],function(_0x3e77a2){var _0x25aa64={};_0x25aa64[_0x3e77a2]={'$like':'%'+_0x1d00f6[_0xfab4('0x37')][_0xfab4('0x47')]+'%'};return _0x25aa64;})});}_0x1cffa9=_[_0xfab4('0x43')]({},_0x1cffa9,_0x1d00f6[_0xfab4('0x48')]);return _0x39b9e7[_0xfab4('0x65')](_0x1cffa9);}})['then'](function(_0x11d990){if(_0x11d990){_0x23dab3=_0x11d990[_0xfab4('0x3d')];if(!_0x1d00f6[_0xfab4('0x37')][_0xfab4('0x3e')](_0xfab4('0x3f'))){_0x1cffa9[_0xfab4('0x21')]=qs[_0xfab4('0x21')](_0x1d00f6[_0xfab4('0x37')][_0xfab4('0x21')]);_0x1cffa9['offset']=qs['offset'](_0x1d00f6['query'][_0xfab4('0x20')]);}return _0x39b9e7[_0xfab4('0x65')](_0x1cffa9);}})[_0xfab4('0x29')](function(_0x100b4f){if(_0x100b4f){return _0x100b4f?{'count':_0x23dab3,'rows':_0x100b4f}:null;}})[_0xfab4('0x29')](respondWithResult(_0x401f38,null))[_0xfab4('0x4d')](handleError(_0x401f38,null));};exports[_0xfab4('0x67')]=function(_0x5aef02,_0x2ba97d,_0x5429fc){var _0x4a8e1a=_0x5aef02[_0xfab4('0x51')]['ids'];return db[_0xfab4('0x66')][_0xfab4('0x4b')]({'where':{'id':_0x4a8e1a},'attributes':['id'],'include':[{'model':db[_0xfab4('0x5d')],'as':'Agents','attributes':['id',_0xfab4('0x2e'),_0xfab4('0x68'),_0xfab4('0x69'),_0xfab4('0x6a')],'raw':!![]}]})[_0xfab4('0x29')](function(_0x8351eb){if(_0x8351eb){var _0x1c89a6=_[_0xfab4('0x6b')](_0x8351eb,function(_0x4db486){var _0x53505e=_0x4db486[_0xfab4('0x2a')]({'plain':!![]});return _0x53505e[_0xfab4('0x6c')];});return db['WhatsappQueue'][_0xfab4('0x4f')]({'where':{'id':_0x5aef02[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](function(_0x50708a){return db[_0xfab4('0x6d')][_0xfab4('0x6e')](function(_0x329329){return _0x50708a[_0xfab4('0x67')](_0x4a8e1a,{'transaction':_0x329329})[_0xfab4('0x29')](function(){return BPromise[_0xfab4('0x6f')](_0x1c89a6,function(_0x30cf68){return db[_0xfab4('0x5b')][_0xfab4('0x70')]({'where':{'UserId':_0x30cf68['id'],'WhatsappQueueId':_0x5aef02['params']['id']},'transaction':_0x329329});});})[_0xfab4('0x29')](function(){_0x1c89a6['forEach'](function(_0x9e3b2c){socket[_0xfab4('0x71')](_0xfab4('0x72'),{'UserId':_0x9e3b2c['id'],'WhatsappQueueId':_0x50708a['id']});});});});});}})[_0xfab4('0x29')](respondWithStatusCode(_0x2ba97d,null))['catch'](handleError(_0x2ba97d,null));};exports[_0xfab4('0x73')]=function(_0xa205d,_0x213298,_0x19ba87){return db[_0xfab4('0x66')][_0xfab4('0x4b')]({'where':{'id':_0xa205d[_0xfab4('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfab4('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xfab4('0x29')](handleEntityNotFound(_0x213298,null))[_0xfab4('0x29')](function(_0x30636c){var _0x248fb4=_[_0xfab4('0x31')](_0x30636c,'id');var _0xa870cb=[];var _0x34cfcc=[];var _0x9828a6=squel[_0xfab4('0x74')]();_0x9828a6['field'](_0xfab4('0x75'))[_0xfab4('0x76')]('team_has_whatsapp_queues','tq')[_0xfab4('0x77')](_0xfab4('0x78'),'ut',_0xfab4('0x79'))[_0xfab4('0x44')]('WhatsappQueueId\x20=\x20?',_0xa205d[_0xfab4('0x4e')]['id']);for(var _0x589334=0x0;_0x589334<_0x30636c['length'];_0x589334+=0x1){let _0x5315ef=_0x30636c[_0x589334];for(var _0x4c6b76=0x0;_0x4c6b76<_0x5315ef['Agents']['length'];_0x4c6b76+=0x1){let _0x3e892e=_0x5315ef[_0xfab4('0x6c')][_0x4c6b76];var _0x24b2cb=_0x9828a6[_0xfab4('0x7a')]();_0x24b2cb[_0xfab4('0x44')]('ut.UserId\x20=\x20?',_0x3e892e['id']);_0x34cfcc[_0xfab4('0x7b')](db[_0xfab4('0x6d')]['query'](_0x24b2cb[_0xfab4('0x7c')](),{'type':db[_0xfab4('0x6d')][_0xfab4('0x7d')][_0xfab4('0x7e')]})[_0xfab4('0x29')](function(_0x3683a5){if(_0x3683a5['length']===0x1){return _0x3e892e['id'];}else{var _0x16a3ab=_[_0xfab4('0x7f')](_[_0xfab4('0x31')](_0x3683a5,_0xfab4('0x80')),function(_0x58e115){return _[_0xfab4('0x81')](_0x248fb4,_0x58e115);});if(_0x16a3ab){return _0x3e892e['id'];}}}));}}return BPromise[_0xfab4('0x82')](_0x34cfcc)[_0xfab4('0x29')](function(_0x268358){_0xa870cb=_(_0xa870cb)['union'](_0x268358)[_0xfab4('0x83')]()[_0xfab4('0x84')]();return db[_0xfab4('0x32')][_0xfab4('0x4f')]({'where':{'id':_0xa205d[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](function(_0x41746f){return db[_0xfab4('0x6d')][_0xfab4('0x6e')](function(_0x5d832b){return _0x41746f[_0xfab4('0x73')](_0xa205d[_0xfab4('0x37')][_0xfab4('0x85')],{'transaction':_0x5d832b})[_0xfab4('0x29')](function(){if(!_[_0xfab4('0x86')](_0xa870cb)){return _0x41746f[_0xfab4('0x87')](_0xa870cb,{'transaction':_0x5d832b});}})[_0xfab4('0x29')](function(){_0xa870cb['forEach'](function(_0x1c194c){socket[_0xfab4('0x71')](_0xfab4('0x88'),{'UserId':_0x1c194c,'WhatsappQueueId':_0x41746f['id']});});});});});});})['then'](respondWithStatusCode(_0x213298,null))[_0xfab4('0x4d')](handleError(_0x213298,null));};exports['addAgents']=function(_0x2aa664,_0x45f7a1,_0x4826ef){return db[_0xfab4('0x32')][_0xfab4('0x4f')]({'where':{'id':_0x2aa664[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x45f7a1,null))[_0xfab4('0x29')](function(_0x4b733d){if(_0x4b733d){return _0x4b733d[_0xfab4('0x89')](_0x2aa664[_0xfab4('0x51')][_0xfab4('0x85')],_[_0xfab4('0x8a')](_0x2aa664[_0xfab4('0x51')],[_0xfab4('0x85'),'id'])||{})[_0xfab4('0x8b')](function(_0x134469){for(var _0x506408=0x0;_0x506408<_0x2aa664[_0xfab4('0x51')][_0xfab4('0x85')]['length'];_0x506408+=0x1){socket[_0xfab4('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x2aa664[_0xfab4('0x51')][_0xfab4('0x85')][_0x506408]),'WhatsappQueueId':Number(_0x2aa664[_0xfab4('0x4e')]['id'])});}return _0x134469;});}})[_0xfab4('0x29')](respondWithResult(_0x45f7a1,null))['catch'](handleError(_0x45f7a1,null));};exports[_0xfab4('0x87')]=function(_0x935c05,_0x5b51d5,_0x1d2f49){return db[_0xfab4('0x32')]['find']({'where':{'id':_0x935c05[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x5b51d5,null))[_0xfab4('0x29')](function(_0xe9a375){if(_0xe9a375){return _0xe9a375[_0xfab4('0x87')](_0x935c05[_0xfab4('0x37')]['ids'])['then'](function(){if(_[_0xfab4('0x8c')](_0x935c05['query']['ids'])){for(var _0x16ffdd=0x0;_0x16ffdd<_0x935c05['query'][_0xfab4('0x85')][_0xfab4('0x3d')];_0x16ffdd+=0x1){socket['emit'](_0xfab4('0x88'),{'UserId':Number(_0x935c05['query']['ids'][_0x16ffdd]),'WhatsappQueueId':Number(_0x935c05[_0xfab4('0x4e')]['id'])});}}else{socket[_0xfab4('0x71')](_0xfab4('0x88'),{'UserId':Number(_0x935c05[_0xfab4('0x37')][_0xfab4('0x85')]),'WhatsappQueueId':Number(_0x935c05[_0xfab4('0x4e')]['id'])});}});}})[_0xfab4('0x29')](respondWithStatusCode(_0x5b51d5,null))[_0xfab4('0x4d')](handleError(_0x5b51d5,null));};exports[_0xfab4('0x8d')]=function(_0x11aa7f,_0x12cc45,_0x4fb2af){var _0x588f3a={};var _0x38e502={};var _0x1c184a;var _0x1c4e90;return db[_0xfab4('0x32')][_0xfab4('0x5a')]({'where':{'id':_0x11aa7f[_0xfab4('0x4e')]['id']}})[_0xfab4('0x29')](handleEntityNotFound(_0x12cc45,null))[_0xfab4('0x29')](function(_0x47e1dd){if(_0x47e1dd){_0x1c184a=_0x47e1dd;_0x38e502['model']=_[_0xfab4('0x38')](db[_0xfab4('0x5d')][_0xfab4('0x33')]);_0x38e502[_0xfab4('0x37')]=_[_0xfab4('0x38')](_0x11aa7f[_0xfab4('0x37')]);_0x38e502[_0xfab4('0x39')]=_['intersection'](_0x38e502['model'],_0x38e502[_0xfab4('0x37')]);_0x588f3a[_0xfab4('0x3b')]=_[_0xfab4('0x3a')](_0x38e502['model'],qs[_0xfab4('0x3c')](_0x11aa7f[_0xfab4('0x37')]['fields']));_0x588f3a['attributes']=_0x588f3a[_0xfab4('0x3b')]['length']?_0x588f3a[_0xfab4('0x3b')]:_0x38e502[_0xfab4('0x36')];_0x588f3a[_0xfab4('0x40')]=qs[_0xfab4('0x41')](_0x11aa7f[_0xfab4('0x37')][_0xfab4('0x41')]);_0x588f3a[_0xfab4('0x44')]=qs[_0xfab4('0x39')](_[_0xfab4('0x42')](_0x11aa7f[_0xfab4('0x37')],_0x38e502['filters']));if(_0x11aa7f[_0xfab4('0x37')][_0xfab4('0x47')]){_0x588f3a[_0xfab4('0x44')]=_[_0xfab4('0x43')](_0x588f3a[_0xfab4('0x44')],{'$or':_['map'](_0x588f3a['attributes'],function(_0x2d9f20){var _0x1d43eb={};_0x1d43eb[_0x2d9f20]={'$like':'%'+_0x11aa7f[_0xfab4('0x37')][_0xfab4('0x47')]+'%'};return _0x1d43eb;})});}_0x588f3a=_[_0xfab4('0x43')]({},_0x588f3a,_0x11aa7f[_0xfab4('0x48')]);return _0x1c184a[_0xfab4('0x8d')](_0x588f3a);}})[_0xfab4('0x29')](function(_0x2cbb9b){if(_0x2cbb9b){_0x1c4e90=_0x2cbb9b['length'];if(!_0x11aa7f[_0xfab4('0x37')]['hasOwnProperty'](_0xfab4('0x3f'))){_0x588f3a['limit']=qs[_0xfab4('0x21')](_0x11aa7f[_0xfab4('0x37')][_0xfab4('0x21')]);_0x588f3a[_0xfab4('0x20')]=qs[_0xfab4('0x20')](_0x11aa7f[_0xfab4('0x37')][_0xfab4('0x20')]);}return _0x1c184a[_0xfab4('0x8d')](_0x588f3a);}})[_0xfab4('0x29')](function(_0x19a810){if(_0x19a810){return _0x19a810?{'count':_0x1c4e90,'rows':_0x19a810}:null;}})[_0xfab4('0x29')](respondWithResult(_0x12cc45,null))['catch'](handleError(_0x12cc45,null));}; \ No newline at end of file +var _0xfcc3=['options','show','attributes','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','createdAt','rows','format','%s/%s','updatedAt','params','Team','getTeams','hasOwnProperty','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','userWhatsappQueue:save','getAgents','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','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','length','model','nolimit','order','sort','pick','filter','where','merge'];(function(_0x504fb5,_0x33620f){var _0x31fda5=function(_0x4bc889){while(--_0x4bc889){_0x504fb5['push'](_0x504fb5['shift']());}};_0x31fda5(++_0x33620f);}(_0xfcc3,0x159));var _0x3fcc=function(_0x528531,_0x200c73){_0x528531=_0x528531-0x0;var _0x2719fc=_0xfcc3[_0x528531];return _0x2719fc;};'use strict';var emlformat=require(_0x3fcc('0x0'));var rimraf=require(_0x3fcc('0x1'));var zipdir=require(_0x3fcc('0x2'));var jsonpatch=require(_0x3fcc('0x3'));var rp=require(_0x3fcc('0x4'));var moment=require(_0x3fcc('0x5'));var BPromise=require(_0x3fcc('0x6'));var Mustache=require(_0x3fcc('0x7'));var util=require(_0x3fcc('0x8'));var path=require(_0x3fcc('0x9'));var sox=require('sox');var csv=require(_0x3fcc('0xa'));var ejs=require(_0x3fcc('0xb'));var fs=require('fs');var fs_extra=require(_0x3fcc('0xc'));var _=require(_0x3fcc('0xd'));var squel=require(_0x3fcc('0xe'));var crypto=require('crypto');var jsforce=require(_0x3fcc('0xf'));var deskjs=require(_0x3fcc('0x10'));var toCsv=require(_0x3fcc('0xa'));var querystring=require(_0x3fcc('0x11'));var Papa=require('papaparse');var Redis=require(_0x3fcc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3fcc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3fcc('0x14'));var logger=require(_0x3fcc('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3fcc('0x16'));var db=require('../../mysqldb')['db'];config[_0x3fcc('0x17')]=_[_0x3fcc('0x18')](config['redis'],{'host':_0x3fcc('0x19'),'port':0x18eb});var socket=require(_0x3fcc('0x1a'))(new Redis(config[_0x3fcc('0x17')]));require(_0x3fcc('0x1b'))[_0x3fcc('0x1c')](socket);function respondWithStatusCode(_0x5e1107,_0x1b52fa){_0x1b52fa=_0x1b52fa||0xcc;return function(_0x3f8296){if(_0x3f8296){return _0x5e1107['sendStatus'](_0x1b52fa);}return _0x5e1107['status'](_0x1b52fa)['end']();};}function respondWithResult(_0x3ac6aa,_0x1457b9){_0x1457b9=_0x1457b9||0xc8;return function(_0x621fa3){if(_0x621fa3){return _0x3ac6aa[_0x3fcc('0x1d')](_0x1457b9)['json'](_0x621fa3);}};}function respondWithFilteredResult(_0x3d8898,_0x28887){return function(_0x214822){if(_0x214822){var _0x5764ba=typeof _0x28887[_0x3fcc('0x1e')]==='undefined'&&typeof _0x28887[_0x3fcc('0x1f')]===_0x3fcc('0x20');var _0x5bfa73=_0x214822[_0x3fcc('0x21')];var _0x4fa712=_0x5764ba?0x0:_0x28887[_0x3fcc('0x1e')];var _0x3644f2=_0x5764ba?_0x214822[_0x3fcc('0x21')]:_0x28887[_0x3fcc('0x1e')]+_0x28887[_0x3fcc('0x1f')];var _0x28a50b;if(_0x3644f2>=_0x5bfa73){_0x3644f2=_0x5bfa73;_0x28a50b=0xc8;}else{_0x28a50b=0xce;}_0x3d8898[_0x3fcc('0x1d')](_0x28a50b);return _0x3d8898[_0x3fcc('0x22')](_0x3fcc('0x23'),_0x4fa712+'-'+_0x3644f2+'/'+_0x5bfa73)[_0x3fcc('0x24')](_0x214822);}return null;};}function patchUpdates(_0x5a6357){return function(_0x244cf1){try{jsonpatch[_0x3fcc('0x25')](_0x244cf1,_0x5a6357,!![]);}catch(_0x1e8de7){return BPromise[_0x3fcc('0x26')](_0x1e8de7);}return _0x244cf1[_0x3fcc('0x27')]();};}function saveUpdates(_0x78495c,_0x14ede1){return function(_0x266535){if(_0x266535){return _0x266535[_0x3fcc('0x28')](_0x78495c)[_0x3fcc('0x29')](function(_0x43815b){return _0x43815b;});}return null;};}function removeEntity(_0x26bb3c,_0x32decb){return function(_0x95e24){if(_0x95e24){return _0x95e24[_0x3fcc('0x2a')]()['then'](function(){var _0x3a981b=_0x95e24[_0x3fcc('0x2b')]({'plain':!![]});var _0x480349=_0x3fcc('0x2c');return db[_0x3fcc('0x2d')][_0x3fcc('0x2a')]({'where':{'type':_0x480349,'resourceId':_0x3a981b['id']}})[_0x3fcc('0x29')](function(){return _0x95e24;});})[_0x3fcc('0x29')](function(){_0x26bb3c[_0x3fcc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ec343,_0x5e460b){return function(_0x176961){if(!_0x176961){_0x1ec343['sendStatus'](0x194);}return _0x176961;};}function handleError(_0x1a102c,_0x15e1a1){_0x15e1a1=_0x15e1a1||0x1f4;return function(_0x4304d6){logger['error'](_0x4304d6[_0x3fcc('0x2e')]);if(_0x4304d6[_0x3fcc('0x2f')]){delete _0x4304d6['name'];}_0x1a102c[_0x3fcc('0x1d')](_0x15e1a1)[_0x3fcc('0x30')](_0x4304d6);};}exports['index']=function(_0x573ff8,_0x244a70){var _0x3a07a2={},_0xe810b1={},_0x2b74e4={'count':0x0,'rows':[]};var _0x873499=_[_0x3fcc('0x31')](db[_0x3fcc('0x32')][_0x3fcc('0x33')],function(_0x45eb13){return{'name':_0x45eb13[_0x3fcc('0x34')],'type':_0x45eb13[_0x3fcc('0x35')][_0x3fcc('0x36')]};});_0xe810b1['model']=_['map'](_0x873499,'name');_0xe810b1[_0x3fcc('0x37')]=_[_0x3fcc('0x38')](_0x573ff8[_0x3fcc('0x37')]);_0xe810b1[_0x3fcc('0x39')]=_[_0x3fcc('0x3a')](_0xe810b1['model'],_0xe810b1[_0x3fcc('0x37')]);_0x3a07a2['attributes']=_[_0x3fcc('0x3a')](_0xe810b1['model'],qs['fields'](_0x573ff8[_0x3fcc('0x37')][_0x3fcc('0x3b')]));_0x3a07a2['attributes']=_0x3a07a2['attributes'][_0x3fcc('0x3c')]?_0x3a07a2['attributes']:_0xe810b1[_0x3fcc('0x3d')];if(!_0x573ff8[_0x3fcc('0x37')]['hasOwnProperty'](_0x3fcc('0x3e'))){_0x3a07a2[_0x3fcc('0x1f')]=qs[_0x3fcc('0x1f')](_0x573ff8[_0x3fcc('0x37')]['limit']);_0x3a07a2[_0x3fcc('0x1e')]=qs[_0x3fcc('0x1e')](_0x573ff8[_0x3fcc('0x37')]['offset']);}_0x3a07a2[_0x3fcc('0x3f')]=qs[_0x3fcc('0x40')](_0x573ff8['query'][_0x3fcc('0x40')]);_0x3a07a2['where']=qs[_0x3fcc('0x39')](_[_0x3fcc('0x41')](_0x573ff8[_0x3fcc('0x37')],_0xe810b1['filters']),_0x873499);if(_0x573ff8[_0x3fcc('0x37')][_0x3fcc('0x42')]){_0x3a07a2[_0x3fcc('0x43')]=_[_0x3fcc('0x44')](_0x3a07a2[_0x3fcc('0x43')],{'$or':_['map'](_0x873499,function(_0x9b0803){if(_0x9b0803[_0x3fcc('0x35')]!=='VIRTUAL'){var _0x370115={};_0x370115[_0x9b0803[_0x3fcc('0x2f')]]={'$like':'%'+_0x573ff8[_0x3fcc('0x37')][_0x3fcc('0x42')]+'%'};return _0x370115;}})});}_0x3a07a2=_['merge']({},_0x3a07a2,_0x573ff8[_0x3fcc('0x45')]);var _0x586e0b={'where':_0x3a07a2[_0x3fcc('0x43')]};return db[_0x3fcc('0x32')][_0x3fcc('0x21')](_0x586e0b)[_0x3fcc('0x29')](function(_0x43893f){_0x2b74e4[_0x3fcc('0x21')]=_0x43893f;if(_0x573ff8['query']['includeAll']){_0x3a07a2['include']=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x3a07a2);})[_0x3fcc('0x29')](function(_0x391a7f){_0x2b74e4['rows']=_0x391a7f;return _0x2b74e4;})['then'](respondWithFilteredResult(_0x244a70,_0x3a07a2))['catch'](handleError(_0x244a70,null));};exports[_0x3fcc('0x46')]=function(_0x52db2e,_0x2ea5a4){var _0xf3855b={'raw':!![],'where':{'id':_0x52db2e['params']['id']}},_0xccb036={};_0xccb036[_0x3fcc('0x3d')]=_[_0x3fcc('0x38')](db['WhatsappQueue'][_0x3fcc('0x33')]);_0xccb036[_0x3fcc('0x37')]=_[_0x3fcc('0x38')](_0x52db2e[_0x3fcc('0x37')]);_0xccb036[_0x3fcc('0x39')]=_[_0x3fcc('0x3a')](_0xccb036[_0x3fcc('0x3d')],_0xccb036[_0x3fcc('0x37')]);_0xf3855b[_0x3fcc('0x47')]=_[_0x3fcc('0x3a')](_0xccb036[_0x3fcc('0x3d')],qs['fields'](_0x52db2e[_0x3fcc('0x37')][_0x3fcc('0x3b')]));_0xf3855b['attributes']=_0xf3855b[_0x3fcc('0x47')][_0x3fcc('0x3c')]?_0xf3855b[_0x3fcc('0x47')]:_0xccb036[_0x3fcc('0x3d')];if(_0x52db2e['query'][_0x3fcc('0x48')]){_0xf3855b[_0x3fcc('0x49')]=[{'all':!![]}];}_0xf3855b=_['merge']({},_0xf3855b,_0x52db2e[_0x3fcc('0x45')]);return db[_0x3fcc('0x32')]['find'](_0xf3855b)['then'](handleEntityNotFound(_0x2ea5a4,null))[_0x3fcc('0x29')](respondWithResult(_0x2ea5a4,null))[_0x3fcc('0x4a')](handleError(_0x2ea5a4,null));};exports['create']=function(_0x29ec46,_0x519a59){return db[_0x3fcc('0x32')][_0x3fcc('0x4b')](_0x29ec46[_0x3fcc('0x4c')],{})[_0x3fcc('0x29')](function(_0x5004c5){var _0xbbc1f0=_0x29ec46[_0x3fcc('0x4d')][_0x3fcc('0x2b')]({'plain':!![]});if(!_0xbbc1f0)throw new Error(_0x3fcc('0x4e'));if(_0xbbc1f0['role']===_0x3fcc('0x4d')){var _0x1afaa2=_0x5004c5['get']({'plain':!![]});var _0x39c0af=_0x3fcc('0x2c');return db[_0x3fcc('0x4f')][_0x3fcc('0x50')]({'where':{'name':_0x39c0af,'userProfileId':_0xbbc1f0[_0x3fcc('0x51')]},'raw':!![]})[_0x3fcc('0x29')](function(_0xf118b2){if(_0xf118b2&&_0xf118b2['autoAssociation']===0x0){return db[_0x3fcc('0x2d')][_0x3fcc('0x4b')]({'name':_0x1afaa2[_0x3fcc('0x2f')],'resourceId':_0x1afaa2['id'],'type':_0xf118b2[_0x3fcc('0x2f')],'sectionId':_0xf118b2['id']},{})[_0x3fcc('0x29')](function(){return _0x5004c5;});}else{return _0x5004c5;}})['catch'](function(_0x565655){logger[_0x3fcc('0x52')](_0x3fcc('0x53'),_0x565655);throw _0x565655;});}return _0x5004c5;})[_0x3fcc('0x29')](respondWithResult(_0x519a59,0xc9))['catch'](handleError(_0x519a59,null));};exports['update']=function(_0x2447a9,_0x254f59){if(_0x2447a9[_0x3fcc('0x4c')]['id']){delete _0x2447a9[_0x3fcc('0x4c')]['id'];}return db[_0x3fcc('0x32')][_0x3fcc('0x50')]({'where':{'id':_0x2447a9['params']['id']}})[_0x3fcc('0x29')](handleEntityNotFound(_0x254f59,null))[_0x3fcc('0x29')](saveUpdates(_0x2447a9[_0x3fcc('0x4c')],null))[_0x3fcc('0x29')](respondWithResult(_0x254f59,null))[_0x3fcc('0x4a')](handleError(_0x254f59,null));};exports[_0x3fcc('0x2a')]=function(_0x1527e9,_0x20f05d){return db[_0x3fcc('0x32')][_0x3fcc('0x50')]({'where':{'id':_0x1527e9['params']['id']}})['then'](handleEntityNotFound(_0x20f05d,null))['then'](removeEntity(_0x20f05d,null))[_0x3fcc('0x4a')](handleError(_0x20f05d,null));};exports[_0x3fcc('0x54')]=function(_0x79185d,_0x422ead){return db[_0x3fcc('0x32')][_0x3fcc('0x54')]()[_0x3fcc('0x29')](respondWithResult(_0x422ead,null))['catch'](handleError(_0x422ead,null));};exports[_0x3fcc('0x55')]=function(_0x3b41ad,_0x35d52f,_0x39fe1b){var _0x52a6a7={'raw':!![],'where':{}},_0x37aa3c={},_0x119886;return db[_0x3fcc('0x32')][_0x3fcc('0x56')]({'where':{'id':_0x3b41ad['params']['id']}})[_0x3fcc('0x29')](handleEntityNotFound(_0x35d52f,null))[_0x3fcc('0x29')](function(_0x5c9598){if(_0x5c9598){_0x119886=_0x5c9598[_0x3fcc('0x2b')]({'plain':!![]});_0x37aa3c[_0x3fcc('0x3d')]=_[_0x3fcc('0x38')](db[_0x3fcc('0x57')]['rawAttributes']);_0x37aa3c['query']=_[_0x3fcc('0x38')](_0x3b41ad['query']);_0x37aa3c[_0x3fcc('0x39')]=_[_0x3fcc('0x3a')](_0x37aa3c['model'],_0x37aa3c[_0x3fcc('0x37')]);_0x52a6a7['attributes']=_[_0x3fcc('0x3a')](_0x37aa3c['model'],qs[_0x3fcc('0x3b')](_0x3b41ad[_0x3fcc('0x37')][_0x3fcc('0x3b')]));_0x52a6a7['attributes']=_0x52a6a7[_0x3fcc('0x47')][_0x3fcc('0x3c')]?_0x52a6a7['attributes']:_0x37aa3c[_0x3fcc('0x3d')];if(!_0x3b41ad[_0x3fcc('0x37')]['hasOwnProperty'](_0x3fcc('0x3e'))){_0x52a6a7['limit']=qs[_0x3fcc('0x1f')](_0x3b41ad[_0x3fcc('0x37')][_0x3fcc('0x1f')]);_0x52a6a7[_0x3fcc('0x1e')]=qs[_0x3fcc('0x1e')](_0x3b41ad[_0x3fcc('0x37')][_0x3fcc('0x1e')]);}_0x52a6a7[_0x3fcc('0x3f')]=qs[_0x3fcc('0x40')](_0x3b41ad[_0x3fcc('0x37')][_0x3fcc('0x40')]);_0x52a6a7[_0x3fcc('0x43')]=qs[_0x3fcc('0x39')](_[_0x3fcc('0x41')](_0x3b41ad[_0x3fcc('0x37')],_0x37aa3c[_0x3fcc('0x39')]));_0x52a6a7['where'][_0x3fcc('0x58')]=_0x5c9598['id'];if(_0x3b41ad[_0x3fcc('0x37')][_0x3fcc('0x42')]){_0x52a6a7[_0x3fcc('0x43')]=_['merge'](_0x52a6a7[_0x3fcc('0x43')],{'$or':_[_0x3fcc('0x31')](_0x52a6a7[_0x3fcc('0x47')],function(_0x2e3d78){var _0x37ec13={};_0x37ec13[_0x2e3d78]={'$like':'%'+_0x3b41ad[_0x3fcc('0x37')]['filter']+'%'};return _0x37ec13;})});}_0x52a6a7=_[_0x3fcc('0x44')]({},_0x52a6a7,_0x3b41ad[_0x3fcc('0x45')]);return db[_0x3fcc('0x57')][_0x3fcc('0x59')](_0x52a6a7);}})[_0x3fcc('0x29')](function(_0x18b39b){if(_0x18b39b){return db[_0x3fcc('0x5a')][_0x3fcc('0x5b')]({'where':{'id':_['map'](_0x18b39b,'UserId'),'role':_0x3fcc('0x5c')},'attributes':['id','name',_0x3fcc('0x5d'),'updatedAt',_0x3fcc('0x5e')]});}})[_0x3fcc('0x29')](function(_0x5a7192){if(_0x5a7192){return{'count':_0x5a7192[_0x3fcc('0x21')],'rows':_[_0x3fcc('0x31')](_0x5a7192[_0x3fcc('0x5f')],function(_0x322354){return{'membername':_0x322354[_0x3fcc('0x2f')],'UserId':_0x322354['id'],'queue_name':_0x119886[_0x3fcc('0x2f')],'WhatsappQueueId':_0x119886['id'],'interface':util[_0x3fcc('0x60')](_0x3fcc('0x61'),'SIP',_0x322354[_0x3fcc('0x2f')]),'penalty':0x0,'paused':_0x322354[_0x3fcc('0x5d')],'createdAt':_0x322354[_0x3fcc('0x5e')],'updatedAt':_0x322354[_0x3fcc('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3fcc('0x29')](respondWithFilteredResult(_0x35d52f,_0x52a6a7))[_0x3fcc('0x4a')](handleError(_0x35d52f,null));};exports['getTeams']=function(_0x18232c,_0xcc4b42,_0x5080c2){var _0x29fde9={};var _0x12f79d={};var _0x58bd8c;var _0x5c073b;return db[_0x3fcc('0x32')][_0x3fcc('0x56')]({'where':{'id':_0x18232c[_0x3fcc('0x63')]['id']}})['then'](handleEntityNotFound(_0xcc4b42,null))[_0x3fcc('0x29')](function(_0x2097a6){if(_0x2097a6){_0x58bd8c=_0x2097a6;_0x12f79d[_0x3fcc('0x3d')]=_[_0x3fcc('0x38')](db[_0x3fcc('0x64')][_0x3fcc('0x33')]);_0x12f79d[_0x3fcc('0x37')]=_[_0x3fcc('0x38')](_0x18232c[_0x3fcc('0x37')]);_0x12f79d['filters']=_[_0x3fcc('0x3a')](_0x12f79d['model'],_0x12f79d[_0x3fcc('0x37')]);_0x29fde9['attributes']=_['intersection'](_0x12f79d[_0x3fcc('0x3d')],qs[_0x3fcc('0x3b')](_0x18232c[_0x3fcc('0x37')][_0x3fcc('0x3b')]));_0x29fde9[_0x3fcc('0x47')]=_0x29fde9[_0x3fcc('0x47')]['length']?_0x29fde9[_0x3fcc('0x47')]:_0x12f79d[_0x3fcc('0x3d')];_0x29fde9[_0x3fcc('0x3f')]=qs[_0x3fcc('0x40')](_0x18232c['query'][_0x3fcc('0x40')]);_0x29fde9['where']=qs[_0x3fcc('0x39')](_[_0x3fcc('0x41')](_0x18232c[_0x3fcc('0x37')],_0x12f79d[_0x3fcc('0x39')]));if(_0x18232c['query'][_0x3fcc('0x42')]){_0x29fde9['where']=_[_0x3fcc('0x44')](_0x29fde9[_0x3fcc('0x43')],{'$or':_[_0x3fcc('0x31')](_0x29fde9[_0x3fcc('0x47')],function(_0x52f74e){var _0x5b52fb={};_0x5b52fb[_0x52f74e]={'$like':'%'+_0x18232c['query'][_0x3fcc('0x42')]+'%'};return _0x5b52fb;})});}_0x29fde9=_['merge']({},_0x29fde9,_0x18232c[_0x3fcc('0x45')]);return _0x58bd8c[_0x3fcc('0x65')](_0x29fde9);}})[_0x3fcc('0x29')](function(_0xac4729){if(_0xac4729){_0x5c073b=_0xac4729['length'];if(!_0x18232c['query'][_0x3fcc('0x66')](_0x3fcc('0x3e'))){_0x29fde9[_0x3fcc('0x1f')]=qs['limit'](_0x18232c[_0x3fcc('0x37')]['limit']);_0x29fde9['offset']=qs[_0x3fcc('0x1e')](_0x18232c[_0x3fcc('0x37')][_0x3fcc('0x1e')]);}return _0x58bd8c['getTeams'](_0x29fde9);}})[_0x3fcc('0x29')](function(_0x770b4f){if(_0x770b4f){return _0x770b4f?{'count':_0x5c073b,'rows':_0x770b4f}:null;}})[_0x3fcc('0x29')](respondWithResult(_0xcc4b42,null))[_0x3fcc('0x4a')](handleError(_0xcc4b42,null));};exports['addTeams']=function(_0x2f08ab,_0x2f57c6,_0x3efc06){var _0x1af03a=_0x2f08ab[_0x3fcc('0x4c')][_0x3fcc('0x67')];return db[_0x3fcc('0x64')][_0x3fcc('0x59')]({'where':{'id':_0x1af03a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3fcc('0x68'),'attributes':['id','name','online',_0x3fcc('0x69'),_0x3fcc('0x6a')],'raw':!![]}]})[_0x3fcc('0x29')](function(_0x44effd){if(_0x44effd){var _0x39a6f8=_[_0x3fcc('0x6b')](_0x44effd,function(_0xa12399){var _0x23f240=_0xa12399[_0x3fcc('0x2b')]({'plain':!![]});return _0x23f240[_0x3fcc('0x68')];});return db['WhatsappQueue']['find']({'where':{'id':_0x2f08ab[_0x3fcc('0x63')]['id']}})[_0x3fcc('0x29')](function(_0xdfce26){return db[_0x3fcc('0x6c')][_0x3fcc('0x6d')](function(_0x38478b){return _0xdfce26['addTeams'](_0x1af03a,{'transaction':_0x38478b})[_0x3fcc('0x29')](function(){return BPromise[_0x3fcc('0x6e')](_0x39a6f8,function(_0x265aa2){return db[_0x3fcc('0x57')][_0x3fcc('0x6f')]({'where':{'UserId':_0x265aa2['id'],'WhatsappQueueId':_0x2f08ab[_0x3fcc('0x63')]['id']},'transaction':_0x38478b});});})[_0x3fcc('0x29')](function(){_0x39a6f8[_0x3fcc('0x70')](function(_0x33aee8){socket[_0x3fcc('0x71')]('userWhatsappQueue:save',{'UserId':_0x33aee8['id'],'WhatsappQueueId':_0xdfce26['id']});});});});});}})[_0x3fcc('0x29')](respondWithStatusCode(_0x2f57c6,null))[_0x3fcc('0x4a')](handleError(_0x2f57c6,null));};exports['removeTeams']=function(_0x34a1d6,_0x370f07,_0x1f764b){return db[_0x3fcc('0x64')][_0x3fcc('0x59')]({'where':{'id':_0x34a1d6[_0x3fcc('0x37')][_0x3fcc('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3fcc('0x29')](handleEntityNotFound(_0x370f07,null))[_0x3fcc('0x29')](function(_0x291486){var _0x3a1068=_['map'](_0x291486,'id');var _0x153bed=[];var _0xaa71ac=[];var _0x3b3b7d=squel[_0x3fcc('0x72')]();_0x3b3b7d[_0x3fcc('0x73')](_0x3fcc('0x74'))[_0x3fcc('0x75')](_0x3fcc('0x76'),'tq')['join'](_0x3fcc('0x77'),'ut',_0x3fcc('0x78'))[_0x3fcc('0x43')](_0x3fcc('0x79'),_0x34a1d6[_0x3fcc('0x63')]['id']);for(var _0x527ee9=0x0;_0x527ee9<_0x291486['length'];_0x527ee9+=0x1){let _0x3418e2=_0x291486[_0x527ee9];for(var _0x5476fe=0x0;_0x5476fe<_0x3418e2[_0x3fcc('0x68')]['length'];_0x5476fe+=0x1){let _0x304990=_0x3418e2[_0x3fcc('0x68')][_0x5476fe];var _0x432298=_0x3b3b7d['clone']();_0x432298[_0x3fcc('0x43')](_0x3fcc('0x7a'),_0x304990['id']);_0xaa71ac[_0x3fcc('0x7b')](db['sequelize'][_0x3fcc('0x37')](_0x432298['toString'](),{'type':db['sequelize'][_0x3fcc('0x7c')]['SELECT']})[_0x3fcc('0x29')](function(_0x3cc49b){if(_0x3cc49b[_0x3fcc('0x3c')]===0x1){return _0x304990['id'];}else{var _0x21eb5c=_[_0x3fcc('0x7d')](_[_0x3fcc('0x31')](_0x3cc49b,'TeamId'),function(_0xcdd456){return _['includes'](_0x3a1068,_0xcdd456);});if(_0x21eb5c){return _0x304990['id'];}}}));}}return BPromise[_0x3fcc('0x7e')](_0xaa71ac)[_0x3fcc('0x29')](function(_0x5b580f){_0x153bed=_(_0x153bed)[_0x3fcc('0x7f')](_0x5b580f)[_0x3fcc('0x80')]()[_0x3fcc('0x81')]();return db[_0x3fcc('0x32')][_0x3fcc('0x50')]({'where':{'id':_0x34a1d6[_0x3fcc('0x63')]['id']}})[_0x3fcc('0x29')](function(_0x3260ce){return db['sequelize'][_0x3fcc('0x6d')](function(_0x2f2154){return _0x3260ce[_0x3fcc('0x82')](_0x34a1d6[_0x3fcc('0x37')][_0x3fcc('0x67')],{'transaction':_0x2f2154})[_0x3fcc('0x29')](function(){if(!_[_0x3fcc('0x83')](_0x153bed)){return _0x3260ce[_0x3fcc('0x84')](_0x153bed,{'transaction':_0x2f2154});}})['then'](function(){_0x153bed[_0x3fcc('0x70')](function(_0x597c50){socket['emit'](_0x3fcc('0x85'),{'UserId':_0x597c50,'WhatsappQueueId':_0x3260ce['id']});});});});});});})[_0x3fcc('0x29')](respondWithStatusCode(_0x370f07,null))[_0x3fcc('0x4a')](handleError(_0x370f07,null));};exports[_0x3fcc('0x86')]=function(_0x5b6ec1,_0x434c6c,_0x46500a){return db['WhatsappQueue'][_0x3fcc('0x50')]({'where':{'id':_0x5b6ec1[_0x3fcc('0x63')]['id']}})['then'](handleEntityNotFound(_0x434c6c,null))[_0x3fcc('0x29')](function(_0x10b585){if(_0x10b585){return _0x10b585['addAgents'](_0x5b6ec1[_0x3fcc('0x4c')]['ids'],_['omit'](_0x5b6ec1[_0x3fcc('0x4c')],['ids','id'])||{})[_0x3fcc('0x87')](function(_0x41c5cb){for(var _0x43c2ec=0x0;_0x43c2ec<_0x5b6ec1[_0x3fcc('0x4c')][_0x3fcc('0x67')][_0x3fcc('0x3c')];_0x43c2ec+=0x1){socket[_0x3fcc('0x71')](_0x3fcc('0x88'),{'UserId':Number(_0x5b6ec1[_0x3fcc('0x4c')][_0x3fcc('0x67')][_0x43c2ec]),'WhatsappQueueId':Number(_0x5b6ec1[_0x3fcc('0x63')]['id'])});}return _0x41c5cb;});}})[_0x3fcc('0x29')](respondWithResult(_0x434c6c,null))[_0x3fcc('0x4a')](handleError(_0x434c6c,null));};exports[_0x3fcc('0x84')]=function(_0x12cfe0,_0x3ea438,_0x433dc9){return db[_0x3fcc('0x32')][_0x3fcc('0x50')]({'where':{'id':_0x12cfe0[_0x3fcc('0x63')]['id']}})[_0x3fcc('0x29')](handleEntityNotFound(_0x3ea438,null))[_0x3fcc('0x29')](function(_0x4485b4){if(_0x4485b4){return _0x4485b4[_0x3fcc('0x84')](_0x12cfe0[_0x3fcc('0x37')][_0x3fcc('0x67')])[_0x3fcc('0x29')](function(){if(_['isArray'](_0x12cfe0[_0x3fcc('0x37')][_0x3fcc('0x67')])){for(var _0x1a1487=0x0;_0x1a1487<_0x12cfe0['query'][_0x3fcc('0x67')][_0x3fcc('0x3c')];_0x1a1487+=0x1){socket[_0x3fcc('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x12cfe0[_0x3fcc('0x37')]['ids'][_0x1a1487]),'WhatsappQueueId':Number(_0x12cfe0[_0x3fcc('0x63')]['id'])});}}else{socket[_0x3fcc('0x71')](_0x3fcc('0x85'),{'UserId':Number(_0x12cfe0[_0x3fcc('0x37')][_0x3fcc('0x67')]),'WhatsappQueueId':Number(_0x12cfe0[_0x3fcc('0x63')]['id'])});}});}})[_0x3fcc('0x29')](respondWithStatusCode(_0x3ea438,null))[_0x3fcc('0x4a')](handleError(_0x3ea438,null));};exports[_0x3fcc('0x89')]=function(_0x13864d,_0x2dbe5e,_0x51ca39){var _0x108166={};var _0x2daab6={};var _0x29114e;var _0x448e14;return db[_0x3fcc('0x32')][_0x3fcc('0x56')]({'where':{'id':_0x13864d['params']['id']}})['then'](handleEntityNotFound(_0x2dbe5e,null))[_0x3fcc('0x29')](function(_0x2dc59b){if(_0x2dc59b){_0x29114e=_0x2dc59b;_0x2daab6[_0x3fcc('0x3d')]=_[_0x3fcc('0x38')](db['User'][_0x3fcc('0x33')]);_0x2daab6[_0x3fcc('0x37')]=_[_0x3fcc('0x38')](_0x13864d[_0x3fcc('0x37')]);_0x2daab6[_0x3fcc('0x39')]=_['intersection'](_0x2daab6[_0x3fcc('0x3d')],_0x2daab6[_0x3fcc('0x37')]);_0x108166[_0x3fcc('0x47')]=_[_0x3fcc('0x3a')](_0x2daab6['model'],qs[_0x3fcc('0x3b')](_0x13864d[_0x3fcc('0x37')][_0x3fcc('0x3b')]));_0x108166[_0x3fcc('0x47')]=_0x108166['attributes'][_0x3fcc('0x3c')]?_0x108166[_0x3fcc('0x47')]:_0x2daab6[_0x3fcc('0x3d')];_0x108166['order']=qs[_0x3fcc('0x40')](_0x13864d[_0x3fcc('0x37')][_0x3fcc('0x40')]);_0x108166['where']=qs[_0x3fcc('0x39')](_['pick'](_0x13864d[_0x3fcc('0x37')],_0x2daab6['filters']));if(_0x13864d[_0x3fcc('0x37')][_0x3fcc('0x42')]){_0x108166['where']=_[_0x3fcc('0x44')](_0x108166[_0x3fcc('0x43')],{'$or':_['map'](_0x108166[_0x3fcc('0x47')],function(_0x40d514){var _0x3c5525={};_0x3c5525[_0x40d514]={'$like':'%'+_0x13864d[_0x3fcc('0x37')]['filter']+'%'};return _0x3c5525;})});}_0x108166=_['merge']({},_0x108166,_0x13864d[_0x3fcc('0x45')]);return _0x29114e['getAgents'](_0x108166);}})[_0x3fcc('0x29')](function(_0x4e0e53){if(_0x4e0e53){_0x448e14=_0x4e0e53[_0x3fcc('0x3c')];if(!_0x13864d[_0x3fcc('0x37')][_0x3fcc('0x66')](_0x3fcc('0x3e'))){_0x108166[_0x3fcc('0x1f')]=qs[_0x3fcc('0x1f')](_0x13864d[_0x3fcc('0x37')]['limit']);_0x108166[_0x3fcc('0x1e')]=qs[_0x3fcc('0x1e')](_0x13864d[_0x3fcc('0x37')]['offset']);}return _0x29114e[_0x3fcc('0x89')](_0x108166);}})[_0x3fcc('0x29')](function(_0x2f8617){if(_0x2f8617){return _0x2f8617?{'count':_0x448e14,'rows':_0x2f8617}:null;}})[_0x3fcc('0x29')](respondWithResult(_0x2dbe5e,null))[_0x3fcc('0x4a')](handleError(_0x2dbe5e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 250a724..57aa8a5 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 _0xb283=['WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb283,0x182));var _0x3b28=function(_0x31179a,_0x2b61e0){_0x31179a=_0x31179a-0x0;var _0x5ca88c=_0xb283[_0x31179a];return _0x5ca88c;};'use strict';var EventEmitter=require(_0x3b28('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x3b28('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b28('0x2'),'afterUpdate':_0x3b28('0x3'),'afterDestroy':_0x3b28('0x4')};function emitEvent(_0x384f1a){return function(_0x1e1a26,_0xed0daf,_0x3485fc){WhatsappQueueEvents[_0x3b28('0x5')](_0x384f1a+':'+_0x1e1a26['id'],_0x1e1a26);WhatsappQueueEvents[_0x3b28('0x5')](_0x384f1a,_0x1e1a26);_0x3485fc(null);};}for(var e in events){if(events[_0x3b28('0x6')](e)){var event=events[e];WhatsappQueue[_0x3b28('0x7')](e,emitEvent(event));}}module[_0x3b28('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x309a=['WhatsappQueue','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x566fb2,_0x4316b9){var _0x28ccb6=function(_0x140ac0){while(--_0x140ac0){_0x566fb2['push'](_0x566fb2['shift']());}};_0x28ccb6(++_0x4316b9);}(_0x309a,0x154));var _0xa309=function(_0x263a3d,_0x3616b2){_0x263a3d=_0x263a3d-0x0;var _0x22e7c0=_0x309a[_0x263a3d];return _0x22e7c0;};'use strict';var EventEmitter=require(_0xa309('0x0'));var WhatsappQueue=require(_0xa309('0x1'))['db'][_0xa309('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa309('0x3'),'afterDestroy':_0xa309('0x4')};function emitEvent(_0x5cdfd8){return function(_0x1ff71c,_0x209ccf,_0x4aa1c6){WhatsappQueueEvents['emit'](_0x5cdfd8+':'+_0x1ff71c['id'],_0x1ff71c);WhatsappQueueEvents[_0xa309('0x5')](_0x5cdfd8,_0x1ff71c);_0x4aa1c6(null);};}for(var e in events){if(events[_0xa309('0x6')](e)){var event=events[e];WhatsappQueue[_0xa309('0x7')](e,emitEvent(event));}}module[_0xa309('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 82fd7d4..584e393 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 _0x2852=['request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2852,0xc8));var _0x2285=function(_0x174996,_0x56edb4){_0x174996=_0x174996-0x0;var _0x2b63bf=_0x2852[_0x174996];return _0x2b63bf;};'use strict';var _=require('lodash');var util=require(_0x2285('0x0'));var logger=require(_0x2285('0x1'))(_0x2285('0x2'));var moment=require(_0x2285('0x3'));var BPromise=require('bluebird');var rp=require(_0x2285('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2285('0x5'));var config=require(_0x2285('0x6'));var attributes=require(_0x2285('0x7'));module[_0x2285('0x8')]=function(_0x84adb4,_0x4f33be){return _0x84adb4[_0x2285('0x9')](_0x2285('0xa'),attributes,{'tableName':_0x2285('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f40=['WhatsappQueue','util','api','moment','bluebird','request-promise','./whatsappQueue.attributes','exports','define'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x7f40,0x121));var _0x07f4=function(_0x1187ba,_0x5ab107){_0x1187ba=_0x1187ba-0x0;var _0x589b74=_0x7f40[_0x1187ba];return _0x589b74;};'use strict';var _=require('lodash');var util=require(_0x07f4('0x0'));var logger=require('../../config/logger')(_0x07f4('0x1'));var moment=require(_0x07f4('0x2'));var BPromise=require(_0x07f4('0x3'));var rp=require(_0x07f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x07f4('0x5'));module[_0x07f4('0x6')]=function(_0x5231df,_0x514d86){return _0x5231df[_0x07f4('0x7')](_0x07f4('0x8'),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 e260511..81cf1ed 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 _0x7707=['include','map','model','attributes','then','info','GetWhatsappQueue','debug','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','where','limit'];(function(_0x5e4c34,_0x387a28){var _0xfd8fb0=function(_0x1fed41){while(--_0x1fed41){_0x5e4c34['push'](_0x5e4c34['shift']());}};_0xfd8fb0(++_0x387a28);}(_0x7707,0x15a));var _0x7770=function(_0x2a796d,_0x36b7ea){_0x2a796d=_0x2a796d-0x0;var _0x2bff7c=_0x7707[_0x2a796d];return _0x2bff7c;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var moment=require(_0x7770('0x2'));var BPromise=require(_0x7770('0x3'));var rs=require(_0x7770('0x4'));var fs=require('fs');var Redis=require(_0x7770('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7770('0x6'))(_0x7770('0x7'));var config=require(_0x7770('0x8'));var jayson=require(_0x7770('0x9'));var client=jayson['client'][_0x7770('0xa')]({'port':0x232a});config[_0x7770('0xb')]=_[_0x7770('0xc')](config['redis'],{'host':_0x7770('0xd'),'port':0x18eb});var socket=require(_0x7770('0xe'))(new Redis(config[_0x7770('0xb')]));require(_0x7770('0xf'))[_0x7770('0x10')](socket);function respondWithRpcPromise(_0x25e749,_0x15e602,_0x28ed6d){return new BPromise(function(_0x4e4c21,_0x2f74fd){return client['request'](_0x25e749,_0x28ed6d)['then'](function(_0x5c6f84){logger['info'](_0x7770('0x11'),_0x15e602,'request\x20sent');logger['debug'](_0x7770('0x12'),_0x15e602,_0x7770('0x13'),JSON[_0x7770('0x14')](_0x5c6f84));if(_0x5c6f84[_0x7770('0x15')]){if(_0x5c6f84[_0x7770('0x15')][_0x7770('0x16')]===0x1f4){logger[_0x7770('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x15e602,_0x5c6f84[_0x7770('0x15')][_0x7770('0x17')]);return _0x2f74fd(_0x5c6f84[_0x7770('0x15')][_0x7770('0x17')]);}logger[_0x7770('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x15e602,_0x5c6f84['error']['message']);return _0x4e4c21(_0x5c6f84['error'][_0x7770('0x17')]);}else{logger['info'](_0x7770('0x11'),_0x15e602,_0x7770('0x13'));_0x4e4c21(_0x5c6f84[_0x7770('0x18')][_0x7770('0x17')]);}})[_0x7770('0x19')](function(_0x21f535){logger[_0x7770('0x15')](_0x7770('0x11'),_0x15e602,_0x21f535);_0x2f74fd(_0x21f535);});});}exports['GetWhatsappQueue']=function(_0x537d92){var _0x4161ad=this;return new Promise(function(_0x50e769,_0x569682){return db[_0x7770('0x1a')][_0x7770('0x1b')]({'raw':_0x537d92['options']?_0x537d92[_0x7770('0x1c')][_0x7770('0x1d')]===undefined?!![]:![]:!![],'where':_0x537d92['options']?_0x537d92[_0x7770('0x1c')][_0x7770('0x1e')]||null:null,'attributes':_0x537d92[_0x7770('0x1c')]?_0x537d92[_0x7770('0x1c')]['attributes']||null:null,'limit':_0x537d92[_0x7770('0x1c')]?_0x537d92['options'][_0x7770('0x1f')]||null:null,'include':_0x537d92[_0x7770('0x1c')]?_0x537d92['options'][_0x7770('0x20')]?_[_0x7770('0x21')](_0x537d92[_0x7770('0x1c')][_0x7770('0x20')],function(_0x2aea6a){return{'model':db[_0x2aea6a[_0x7770('0x22')]],'as':_0x2aea6a['as'],'attributes':_0x2aea6a['attributes'],'include':_0x2aea6a[_0x7770('0x20')]?_[_0x7770('0x21')](_0x2aea6a['include'],function(_0x58240f){return{'model':db[_0x58240f[_0x7770('0x22')]],'as':_0x58240f['as'],'attributes':_0x58240f[_0x7770('0x23')],'include':_0x58240f[_0x7770('0x20')]?_['map'](_0x58240f[_0x7770('0x20')],function(_0xe2be5d){return{'model':db[_0xe2be5d[_0x7770('0x22')]],'as':_0xe2be5d['as'],'attributes':_0xe2be5d[_0x7770('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7770('0x24')](function(_0x23f5d6){logger[_0x7770('0x25')](_0x7770('0x26'),_0x537d92);logger[_0x7770('0x27')](_0x7770('0x26'),_0x537d92,JSON[_0x7770('0x14')](_0x23f5d6));_0x50e769(_0x23f5d6);})[_0x7770('0x19')](function(_0xfbaf8b){logger[_0x7770('0x15')](_0x7770('0x26'),_0xfbaf8b['message'],_0x537d92);_0x569682(_0x4161ad[_0x7770('0x15')](0x1f4,_0xfbaf8b['message']));});});};exports[_0x7770('0x28')]=function(_0x7e770a){var _0x541fd0=this;return new Promise(function(_0x2853ef,_0x49e8ee){return db[_0x7770('0x1a')][_0x7770('0x29')]({'raw':_0x7e770a[_0x7770('0x1c')]?_0x7e770a[_0x7770('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x7e770a[_0x7770('0x1c')]?_0x7e770a['options'][_0x7770('0x1e')]||null:null,'attributes':_0x7e770a[_0x7770('0x1c')]?_0x7e770a[_0x7770('0x1c')][_0x7770('0x23')]||null:null,'include':_0x7e770a[_0x7770('0x1c')]?_0x7e770a[_0x7770('0x1c')]['include']?_[_0x7770('0x21')](_0x7e770a[_0x7770('0x1c')]['include'],function(_0x18a4c9){return{'model':db[_0x18a4c9[_0x7770('0x22')]],'as':_0x18a4c9['as'],'attributes':_0x18a4c9[_0x7770('0x23')],'include':_0x18a4c9['include']?_[_0x7770('0x21')](_0x18a4c9[_0x7770('0x20')],function(_0x54df88){return{'model':db[_0x54df88[_0x7770('0x22')]],'as':_0x54df88['as'],'attributes':_0x54df88[_0x7770('0x23')],'include':_0x54df88[_0x7770('0x20')]?_[_0x7770('0x21')](_0x54df88[_0x7770('0x20')],function(_0x3481ab){return{'model':db[_0x3481ab['model']],'as':_0x3481ab['as'],'attributes':_0x3481ab[_0x7770('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7770('0x24')](function(_0x5e2fb5){logger[_0x7770('0x25')](_0x7770('0x28'),_0x7e770a);logger['debug'](_0x7770('0x28'),_0x7e770a,JSON['stringify'](_0x5e2fb5));_0x2853ef(_0x5e2fb5);})['catch'](function(_0x839f13){logger[_0x7770('0x15')](_0x7770('0x28'),_0x839f13['message'],_0x7e770a);_0x49e8ee(_0x541fd0['error'](0x1f4,_0x839f13['message']));});});}; \ No newline at end of file +var _0xd9ba=['catch','find','debug','ShowWhatsappQueue','util','moment','bluebird','ioredis','rpc','../../config/environment','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetWhatsappQueue'];(function(_0x4ad977,_0x3adc7b){var _0x4474a8=function(_0x194494){while(--_0x194494){_0x4ad977['push'](_0x4ad977['shift']());}};_0x4474a8(++_0x3adc7b);}(_0xd9ba,0x8c));var _0xad9b=function(_0x4ee1af,_0xae2643){_0x4ee1af=_0x4ee1af-0x0;var _0x41d274=_0xd9ba[_0x4ee1af];return _0x41d274;};'use strict';var _=require('lodash');var util=require(_0xad9b('0x0'));var moment=require(_0xad9b('0x1'));var BPromise=require(_0xad9b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad9b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad9b('0x4'));var config=require(_0xad9b('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xad9b('0x6')]=_['defaults'](config[_0xad9b('0x6')],{'host':_0xad9b('0x7'),'port':0x18eb});var socket=require(_0xad9b('0x8'))(new Redis(config['redis']));require(_0xad9b('0x9'))[_0xad9b('0xa')](socket);function respondWithRpcPromise(_0x33ae97,_0x2af7be,_0x434cbb){return new BPromise(function(_0x162a68,_0x54a847){return client[_0xad9b('0xb')](_0x33ae97,_0x434cbb)['then'](function(_0x57f0d1){logger[_0xad9b('0xc')](_0xad9b('0xd'),_0x2af7be,_0xad9b('0xe'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2af7be,'request\x20sent',JSON[_0xad9b('0xf')](_0x57f0d1));if(_0x57f0d1[_0xad9b('0x10')]){if(_0x57f0d1['error']['code']===0x1f4){logger['error'](_0xad9b('0xd'),_0x2af7be,_0x57f0d1[_0xad9b('0x10')][_0xad9b('0x11')]);return _0x54a847(_0x57f0d1['error'][_0xad9b('0x11')]);}logger[_0xad9b('0x10')](_0xad9b('0xd'),_0x2af7be,_0x57f0d1['error'][_0xad9b('0x11')]);return _0x162a68(_0x57f0d1['error'][_0xad9b('0x11')]);}else{logger[_0xad9b('0xc')](_0xad9b('0xd'),_0x2af7be,_0xad9b('0xe'));_0x162a68(_0x57f0d1['result'][_0xad9b('0x11')]);}})['catch'](function(_0xc663bd){logger[_0xad9b('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x2af7be,_0xc663bd);_0x54a847(_0xc663bd);});});}exports['GetWhatsappQueue']=function(_0x2c9fe6){var _0x45a5cc=this;return new Promise(function(_0x530c50,_0x43ddc0){return db[_0xad9b('0x12')][_0xad9b('0x13')]({'raw':_0x2c9fe6[_0xad9b('0x14')]?_0x2c9fe6['options'][_0xad9b('0x15')]===undefined?!![]:![]:!![],'where':_0x2c9fe6[_0xad9b('0x14')]?_0x2c9fe6[_0xad9b('0x14')][_0xad9b('0x16')]||null:null,'attributes':_0x2c9fe6['options']?_0x2c9fe6[_0xad9b('0x14')][_0xad9b('0x17')]||null:null,'limit':_0x2c9fe6[_0xad9b('0x14')]?_0x2c9fe6[_0xad9b('0x14')][_0xad9b('0x18')]||null:null,'include':_0x2c9fe6[_0xad9b('0x14')]?_0x2c9fe6[_0xad9b('0x14')][_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x2c9fe6[_0xad9b('0x14')]['include'],function(_0x2dc427){return{'model':db[_0x2dc427[_0xad9b('0x1b')]],'as':_0x2dc427['as'],'attributes':_0x2dc427[_0xad9b('0x17')],'include':_0x2dc427[_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x2dc427['include'],function(_0x57a0d5){return{'model':db[_0x57a0d5[_0xad9b('0x1b')]],'as':_0x57a0d5['as'],'attributes':_0x57a0d5[_0xad9b('0x17')],'include':_0x57a0d5[_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x57a0d5['include'],function(_0x1441a6){return{'model':db[_0x1441a6[_0xad9b('0x1b')]],'as':_0x1441a6['as'],'attributes':_0x1441a6[_0xad9b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xad9b('0x1c')](function(_0x2b0549){logger[_0xad9b('0xc')](_0xad9b('0x1d'),_0x2c9fe6);logger['debug']('GetWhatsappQueue',_0x2c9fe6,JSON[_0xad9b('0xf')](_0x2b0549));_0x530c50(_0x2b0549);})[_0xad9b('0x1e')](function(_0xaea23c){logger['error'](_0xad9b('0x1d'),_0xaea23c[_0xad9b('0x11')],_0x2c9fe6);_0x43ddc0(_0x45a5cc[_0xad9b('0x10')](0x1f4,_0xaea23c['message']));});});};exports['ShowWhatsappQueue']=function(_0x479c02){var _0x2d94d2=this;return new Promise(function(_0x513ef0,_0x1a393d){return db[_0xad9b('0x12')][_0xad9b('0x1f')]({'raw':_0x479c02[_0xad9b('0x14')]?_0x479c02[_0xad9b('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x479c02[_0xad9b('0x14')]?_0x479c02[_0xad9b('0x14')][_0xad9b('0x16')]||null:null,'attributes':_0x479c02[_0xad9b('0x14')]?_0x479c02[_0xad9b('0x14')][_0xad9b('0x17')]||null:null,'include':_0x479c02[_0xad9b('0x14')]?_0x479c02[_0xad9b('0x14')][_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x479c02[_0xad9b('0x14')][_0xad9b('0x19')],function(_0x5c4446){return{'model':db[_0x5c4446['model']],'as':_0x5c4446['as'],'attributes':_0x5c4446[_0xad9b('0x17')],'include':_0x5c4446[_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x5c4446[_0xad9b('0x19')],function(_0x541833){return{'model':db[_0x541833[_0xad9b('0x1b')]],'as':_0x541833['as'],'attributes':_0x541833[_0xad9b('0x17')],'include':_0x541833[_0xad9b('0x19')]?_[_0xad9b('0x1a')](_0x541833[_0xad9b('0x19')],function(_0x231818){return{'model':db[_0x231818[_0xad9b('0x1b')]],'as':_0x231818['as'],'attributes':_0x231818[_0xad9b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xad9b('0x1c')](function(_0x4e3d52){logger[_0xad9b('0xc')]('ShowWhatsappQueue',_0x479c02);logger[_0xad9b('0x20')](_0xad9b('0x21'),_0x479c02,JSON[_0xad9b('0xf')](_0x4e3d52));_0x513ef0(_0x4e3d52);})[_0xad9b('0x1e')](function(_0x507987){logger[_0xad9b('0x10')](_0xad9b('0x21'),_0x507987[_0xad9b('0x11')],_0x479c02);_0x1a393d(_0x2d94d2[_0xad9b('0x10')](0x1f4,_0x507987[_0xad9b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 5b700c2..22390c8 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 _0x3cae=['update','emit','removeListener','whatsappQueue:','save','remove'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0x3cae,0x6a));var _0xe3ca=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x3cae[_0x37c22c];return _0x119d79;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xe3ca('0x0'),_0xe3ca('0x1'),_0xe3ca('0x2')];function createListener(_0x33bbef,_0x1ca8c5){return function(_0x5885da){_0x1ca8c5[_0xe3ca('0x3')](_0x33bbef,_0x5885da);};}function removeListener(_0x598c80,_0x250b18){return function(){WhatsappQueueEvents[_0xe3ca('0x4')](_0x598c80,_0x250b18);};}exports['register']=function(_0x5b8644){for(var _0xca112c=0x0,_0xf14f3b=events['length'];_0xca112c<_0xf14f3b;_0xca112c++){var _0x3d9709=events[_0xca112c];var _0x75c90b=createListener(_0xe3ca('0x5')+_0x3d9709,_0x5b8644);WhatsappQueueEvents['on'](_0x3d9709,_0x75c90b);}}; \ No newline at end of file +var _0xb76d=['whatsappQueue:','./whatsappQueue.events','save','remove','update','removeListener','length'];(function(_0x386343,_0xf11726){var _0x34c5b8=function(_0x1a92ab){while(--_0x1a92ab){_0x386343['push'](_0x386343['shift']());}};_0x34c5b8(++_0xf11726);}(_0xb76d,0x127));var _0xdb76=function(_0x392a7d,_0xb7d60b){_0x392a7d=_0x392a7d-0x0;var _0x398b29=_0xb76d[_0x392a7d];return _0x398b29;};'use strict';var WhatsappQueueEvents=require(_0xdb76('0x0'));var events=[_0xdb76('0x1'),_0xdb76('0x2'),_0xdb76('0x3')];function createListener(_0x8d08b5,_0x5325e7){return function(_0x1e8791){_0x5325e7['emit'](_0x8d08b5,_0x1e8791);};}function removeListener(_0x417c2c,_0xcaa43a){return function(){WhatsappQueueEvents[_0xdb76('0x4')](_0x417c2c,_0xcaa43a);};}exports['register']=function(_0x5ecc75){for(var _0x7e1e8e=0x0,_0x56f49a=events[_0xdb76('0x5')];_0x7e1e8e<_0x56f49a;_0x7e1e8e++){var _0x368015=events[_0x7e1e8e];var _0x411fe0=createListener(_0xdb76('0x6')+_0x368015,_0x5ecc75);WhatsappQueueEvents['on'](_0x368015,_0x411fe0);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 810248a..bd58c86 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 _0xe05b=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update'];(function(_0x586fa2,_0x1a45bc){var _0x515be9=function(_0x4e90d5){while(--_0x4e90d5){_0x586fa2['push'](_0x586fa2['shift']());}};_0x515be9(++_0x1a45bc);}(_0xe05b,0x112));var _0xbe05=function(_0x488b75,_0x278074){_0x488b75=_0x488b75-0x0;var _0x42b6da=_0xe05b[_0x488b75];return _0x42b6da;};'use strict';var multer=require(_0xbe05('0x0'));var util=require(_0xbe05('0x1'));var path=require(_0xbe05('0x2'));var timeout=require(_0xbe05('0x3'));var express=require(_0xbe05('0x4'));var router=express[_0xbe05('0x5')]();var fs_extra=require(_0xbe05('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbe05('0x7'));var config=require(_0xbe05('0x8'));var controller=require(_0xbe05('0x9'));router['get']('/',auth[_0xbe05('0xa')](),controller[_0xbe05('0xb')]);router[_0xbe05('0xc')](_0xbe05('0xd'),auth[_0xbe05('0xa')](),controller[_0xbe05('0xe')]);router[_0xbe05('0xc')](_0xbe05('0xf'),auth[_0xbe05('0xa')](),controller[_0xbe05('0x10')]);router[_0xbe05('0x11')]('/',auth['isAuthenticated'](),controller[_0xbe05('0x12')]);router['put'](_0xbe05('0xf'),auth[_0xbe05('0xa')](),controller[_0xbe05('0x13')]);router[_0xbe05('0x14')](_0xbe05('0xf'),auth[_0xbe05('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7d3a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1c12b8,_0x4933bb){var _0x26d1d8=function(_0x2602b4){while(--_0x2602b4){_0x1c12b8['push'](_0x1c12b8['shift']());}};_0x26d1d8(++_0x4933bb);}(_0x7d3a,0x85));var _0xa7d3=function(_0x3707f4,_0x3b32e0){_0x3707f4=_0x3707f4-0x0;var _0x4173d0=_0x7d3a[_0x3707f4];return _0x4173d0;};'use strict';var multer=require(_0xa7d3('0x0'));var util=require(_0xa7d3('0x1'));var path=require(_0xa7d3('0x2'));var timeout=require(_0xa7d3('0x3'));var express=require(_0xa7d3('0x4'));var router=express[_0xa7d3('0x5')]();var fs_extra=require(_0xa7d3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa7d3('0x7'));var config=require(_0xa7d3('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xa7d3('0x9')]('/',auth[_0xa7d3('0xa')](),controller[_0xa7d3('0xb')]);router[_0xa7d3('0x9')](_0xa7d3('0xc'),auth['isAuthenticated'](),controller[_0xa7d3('0xd')]);router['get']('/:id',auth[_0xa7d3('0xa')](),controller[_0xa7d3('0xe')]);router[_0xa7d3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa7d3('0x10')]('/:id',auth[_0xa7d3('0xa')](),controller[_0xa7d3('0x11')]);router[_0xa7d3('0x12')](_0xa7d3('0x13'),auth[_0xa7d3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d706e71..4ff3cbb 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(_0x188484,_0x56c35d){var _0x49daf9=function(_0x3e94c0){while(--_0x3e94c0){_0x188484['push'](_0x188484['shift']());}};_0x49daf9(++_0x56c35d);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x571e06,_0x501285){var _0x338652=function(_0x5a49d6){while(--_0x5a49d6){_0x571e06['push'](_0x571e06['shift']());}};_0x338652(++_0x501285);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index d6a3649..0ef796c 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 _0x7916=['VIRTUAL','options','includeAll','include','findAll','catch','params','length','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','reject','update','then','end','error','stack','name','send','map','WhatsappQueueReport','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type'];(function(_0x196de4,_0x320509){var _0x354ff2=function(_0x401f58){while(--_0x401f58){_0x196de4['push'](_0x196de4['shift']());}};_0x354ff2(++_0x320509);}(_0x7916,0x128));var _0x6791=function(_0xe8ffd,_0x2954b2){_0xe8ffd=_0xe8ffd-0x0;var _0x59d496=_0x7916[_0xe8ffd];return _0x59d496;};'use strict';var emlformat=require(_0x6791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6791('0x1'));var jsonpatch=require(_0x6791('0x2'));var rp=require('request-promise');var moment=require(_0x6791('0x3'));var BPromise=require(_0x6791('0x4'));var Mustache=require(_0x6791('0x5'));var util=require(_0x6791('0x6'));var path=require('path');var sox=require(_0x6791('0x7'));var csv=require('to-csv');var ejs=require(_0x6791('0x8'));var fs=require('fs');var fs_extra=require(_0x6791('0x9'));var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var licenseUtil=require(_0x6791('0x15'));var db=require(_0x6791('0x16'))['db'];function respondWithStatusCode(_0x61ac73,_0x16c62b){_0x16c62b=_0x16c62b||0xcc;return function(_0x423e22){if(_0x423e22){return _0x61ac73[_0x6791('0x17')](_0x16c62b);}return _0x61ac73[_0x6791('0x18')](_0x16c62b)['end']();};}function respondWithResult(_0x4b1719,_0x34b28d){_0x34b28d=_0x34b28d||0xc8;return function(_0x5122f9){if(_0x5122f9){return _0x4b1719[_0x6791('0x18')](_0x34b28d)['json'](_0x5122f9);}};}function respondWithFilteredResult(_0x3be9f0,_0x163898){return function(_0x517910){if(_0x517910){var _0x3e4792=typeof _0x163898['offset']===_0x6791('0x19')&&typeof _0x163898[_0x6791('0x1a')]==='undefined';var _0xbc35d=_0x517910[_0x6791('0x1b')];var _0x5bec14=_0x3e4792?0x0:_0x163898[_0x6791('0x1c')];var _0x4d8a79=_0x3e4792?_0x517910[_0x6791('0x1b')]:_0x163898[_0x6791('0x1c')]+_0x163898[_0x6791('0x1a')];var _0x3a72ce;if(_0x4d8a79>=_0xbc35d){_0x4d8a79=_0xbc35d;_0x3a72ce=0xc8;}else{_0x3a72ce=0xce;}_0x3be9f0[_0x6791('0x18')](_0x3a72ce);return _0x3be9f0[_0x6791('0x1d')](_0x6791('0x1e'),_0x5bec14+'-'+_0x4d8a79+'/'+_0xbc35d)['json'](_0x517910);}return null;};}function patchUpdates(_0x4a2922){return function(_0x306acb){try{jsonpatch['apply'](_0x306acb,_0x4a2922,!![]);}catch(_0x21ef16){return BPromise[_0x6791('0x1f')](_0x21ef16);}return _0x306acb['save']();};}function saveUpdates(_0x17f200,_0x309610){return function(_0x15b9ab){if(_0x15b9ab){return _0x15b9ab[_0x6791('0x20')](_0x17f200)['then'](function(_0x3e17b3){return _0x3e17b3;});}return null;};}function removeEntity(_0x1b516d,_0x4a8717){return function(_0x53bb44){if(_0x53bb44){return _0x53bb44['destroy']()[_0x6791('0x21')](function(){_0x1b516d['status'](0xcc)[_0x6791('0x22')]();});}};}function handleEntityNotFound(_0x5409f1,_0x54a092){return function(_0x496273){if(!_0x496273){_0x5409f1[_0x6791('0x17')](0x194);}return _0x496273;};}function handleError(_0x23442e,_0xd49b84){_0xd49b84=_0xd49b84||0x1f4;return function(_0x56a74e){logger[_0x6791('0x23')](_0x56a74e[_0x6791('0x24')]);if(_0x56a74e['name']){delete _0x56a74e[_0x6791('0x25')];}_0x23442e['status'](_0xd49b84)[_0x6791('0x26')](_0x56a74e);};}exports['index']=function(_0x4fc5d5,_0x270a1d){var _0x551718={},_0x2f56a2={},_0x34b006={'count':0x0,'rows':[]};var _0x483d6c=_[_0x6791('0x27')](db[_0x6791('0x28')][_0x6791('0x29')],function(_0xd36448){return{'name':_0xd36448['fieldName'],'type':_0xd36448['type'][_0x6791('0x2a')]};});_0x2f56a2['model']=_[_0x6791('0x27')](_0x483d6c,_0x6791('0x25'));_0x2f56a2[_0x6791('0x2b')]=_[_0x6791('0x2c')](_0x4fc5d5[_0x6791('0x2b')]);_0x2f56a2[_0x6791('0x2d')]=_[_0x6791('0x2e')](_0x2f56a2[_0x6791('0x2f')],_0x2f56a2[_0x6791('0x2b')]);_0x551718[_0x6791('0x30')]=_['intersection'](_0x2f56a2[_0x6791('0x2f')],qs[_0x6791('0x31')](_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x31')]));_0x551718[_0x6791('0x30')]=_0x551718[_0x6791('0x30')]['length']?_0x551718['attributes']:_0x2f56a2['model'];if(!_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x32')](_0x6791('0x33'))){_0x551718['limit']=qs['limit'](_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x1a')]);_0x551718[_0x6791('0x1c')]=qs[_0x6791('0x1c')](_0x4fc5d5['query'][_0x6791('0x1c')]);}_0x551718[_0x6791('0x34')]=qs[_0x6791('0x35')](_0x4fc5d5['query'][_0x6791('0x35')]);_0x551718['where']=qs['filters'](_[_0x6791('0x36')](_0x4fc5d5[_0x6791('0x2b')],_0x2f56a2['filters']),_0x483d6c);if(_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x37')]){_0x551718[_0x6791('0x38')]=_[_0x6791('0x39')](_0x551718[_0x6791('0x38')],{'$or':_['map'](_0x483d6c,function(_0x1798cf){if(_0x1798cf[_0x6791('0x3a')]!==_0x6791('0x3b')){var _0x53f48d={};_0x53f48d[_0x1798cf[_0x6791('0x25')]]={'$like':'%'+_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x37')]+'%'};return _0x53f48d;}})});}_0x551718=_['merge']({},_0x551718,_0x4fc5d5[_0x6791('0x3c')]);var _0x31f2bb={'where':_0x551718[_0x6791('0x38')]};return db[_0x6791('0x28')]['count'](_0x31f2bb)[_0x6791('0x21')](function(_0x1a4b64){_0x34b006[_0x6791('0x1b')]=_0x1a4b64;if(_0x4fc5d5[_0x6791('0x2b')][_0x6791('0x3d')]){_0x551718[_0x6791('0x3e')]=[{'all':!![]}];}return db[_0x6791('0x28')][_0x6791('0x3f')](_0x551718);})[_0x6791('0x21')](function(_0x4e4004){_0x34b006['rows']=_0x4e4004;return _0x34b006;})[_0x6791('0x21')](respondWithFilteredResult(_0x270a1d,_0x551718))[_0x6791('0x40')](handleError(_0x270a1d,null));};exports['show']=function(_0x39dcb7,_0x1c9913){var _0x1c6803={'raw':!![],'where':{'id':_0x39dcb7[_0x6791('0x41')]['id']}},_0x3edb86={};_0x3edb86[_0x6791('0x2f')]=_[_0x6791('0x2c')](db['WhatsappQueueReport'][_0x6791('0x29')]);_0x3edb86['query']=_[_0x6791('0x2c')](_0x39dcb7[_0x6791('0x2b')]);_0x3edb86[_0x6791('0x2d')]=_[_0x6791('0x2e')](_0x3edb86['model'],_0x3edb86[_0x6791('0x2b')]);_0x1c6803[_0x6791('0x30')]=_[_0x6791('0x2e')](_0x3edb86[_0x6791('0x2f')],qs[_0x6791('0x31')](_0x39dcb7[_0x6791('0x2b')][_0x6791('0x31')]));_0x1c6803[_0x6791('0x30')]=_0x1c6803['attributes'][_0x6791('0x42')]?_0x1c6803[_0x6791('0x30')]:_0x3edb86[_0x6791('0x2f')];if(_0x39dcb7[_0x6791('0x2b')]['includeAll']){_0x1c6803[_0x6791('0x3e')]=[{'all':!![]}];}_0x1c6803=_[_0x6791('0x39')]({},_0x1c6803,_0x39dcb7['options']);return db[_0x6791('0x28')]['find'](_0x1c6803)[_0x6791('0x21')](handleEntityNotFound(_0x1c9913,null))[_0x6791('0x21')](respondWithResult(_0x1c9913,null))[_0x6791('0x40')](handleError(_0x1c9913,null));};exports[_0x6791('0x43')]=function(_0x18d405,_0xb2a2){return db[_0x6791('0x28')][_0x6791('0x43')](_0x18d405[_0x6791('0x44')],{})['then'](respondWithResult(_0xb2a2,0xc9))[_0x6791('0x40')](handleError(_0xb2a2,null));};exports['update']=function(_0x10e806,_0x2bb86a){if(_0x10e806[_0x6791('0x44')]['id']){delete _0x10e806[_0x6791('0x44')]['id'];}return db[_0x6791('0x28')]['find']({'where':{'id':_0x10e806[_0x6791('0x41')]['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x2bb86a,null))[_0x6791('0x21')](saveUpdates(_0x10e806[_0x6791('0x44')],null))[_0x6791('0x21')](respondWithResult(_0x2bb86a,null))['catch'](handleError(_0x2bb86a,null));};exports[_0x6791('0x45')]=function(_0x42948b,_0x4ff9f4){return db[_0x6791('0x28')]['find']({'where':{'id':_0x42948b[_0x6791('0x41')]['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x4ff9f4,null))[_0x6791('0x21')](removeEntity(_0x4ff9f4,null))[_0x6791('0x40')](handleError(_0x4ff9f4,null));};exports['describe']=function(_0x1b838f,_0x243faf){return db['WhatsappQueueReport'][_0x6791('0x46')]()[_0x6791('0x21')](respondWithResult(_0x243faf,null))[_0x6791('0x40')](handleError(_0x243faf,null));}; \ No newline at end of file +var _0xd87e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs'];(function(_0x3afab1,_0x334e35){var _0x1dfdca=function(_0x18126f){while(--_0x18126f){_0x3afab1['push'](_0x3afab1['shift']());}};_0x1dfdca(++_0x334e35);}(_0xd87e,0x1bf));var _0xed87=function(_0x47ae44,_0x1ecf33){_0x47ae44=_0x47ae44-0x0;var _0x37c675=_0xd87e[_0x47ae44];return _0x37c675;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['index']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={},_0x3dff74={},_0x33c367={'count':0x0,'rows':[]};var _0x21c93b=_['map'](db['WhatsappQueueReport'][_0xed87('0x29')],function(_0x428b75){return{'name':_0x428b75[_0xed87('0x2a')],'type':_0x428b75['type'][_0xed87('0x2b')]};});_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0x21c93b,_0xed87('0x27'));_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0xb32b1c[_0xed87('0x2e')]);_0x3dff74[_0xed87('0x30')]=_[_0xed87('0x31')](_0x3dff74['model'],_0x3dff74[_0xed87('0x2e')]);_0x4eaa44[_0xed87('0x32')]=_['intersection'](_0x3dff74[_0xed87('0x2c')],qs['fields'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x4eaa44[_0xed87('0x32')]=_0x4eaa44[_0xed87('0x32')][_0xed87('0x34')]?_0x4eaa44[_0xed87('0x32')]:_0x3dff74[_0xed87('0x2c')];if(!_0xb32b1c[_0xed87('0x2e')][_0xed87('0x35')](_0xed87('0x36'))){_0x4eaa44[_0xed87('0x1e')]=qs['limit'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x1e')]);_0x4eaa44['offset']=qs[_0xed87('0x1c')](_0xb32b1c['query'][_0xed87('0x1c')]);}_0x4eaa44[_0xed87('0x37')]=qs['sort'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x38')]);_0x4eaa44[_0xed87('0x39')]=qs[_0xed87('0x30')](_[_0xed87('0x3a')](_0xb32b1c['query'],_0x3dff74[_0xed87('0x30')]),_0x21c93b);if(_0xb32b1c['query'][_0xed87('0x3b')]){_0x4eaa44['where']=_[_0xed87('0x3c')](_0x4eaa44[_0xed87('0x39')],{'$or':_[_0xed87('0x2d')](_0x21c93b,function(_0x217435){if(_0x217435[_0xed87('0x3d')]!==_0xed87('0x3e')){var _0x9e3356={};_0x9e3356[_0x217435[_0xed87('0x27')]]={'$like':'%'+_0xb32b1c[_0xed87('0x2e')]['filter']+'%'};return _0x9e3356;}})});}_0x4eaa44=_['merge']({},_0x4eaa44,_0xb32b1c[_0xed87('0x3f')]);var _0x206544={'where':_0x4eaa44[_0xed87('0x39')]};return db[_0xed87('0x40')][_0xed87('0x1f')](_0x206544)[_0xed87('0x23')](function(_0x5d1bd0){_0x33c367[_0xed87('0x1f')]=_0x5d1bd0;if(_0xb32b1c[_0xed87('0x2e')][_0xed87('0x41')]){_0x4eaa44['include']=[{'all':!![]}];}return db[_0xed87('0x40')][_0xed87('0x42')](_0x4eaa44);})[_0xed87('0x23')](function(_0x1b0092){_0x33c367[_0xed87('0x43')]=_0x1b0092;return _0x33c367;})[_0xed87('0x23')](respondWithFilteredResult(_0x1c4a65,_0x4eaa44))[_0xed87('0x44')](handleError(_0x1c4a65,null));};exports[_0xed87('0x45')]=function(_0x35bd1c,_0x406b73){var _0x5c6925={'raw':!![],'where':{'id':_0x35bd1c[_0xed87('0x46')]['id']}},_0x7e6cbb={};_0x7e6cbb[_0xed87('0x2c')]=_['keys'](db['WhatsappQueueReport'][_0xed87('0x29')]);_0x7e6cbb[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x35bd1c[_0xed87('0x2e')]);_0x7e6cbb['filters']=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],_0x7e6cbb['query']);_0x5c6925[_0xed87('0x32')]=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],qs[_0xed87('0x33')](_0x35bd1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x5c6925[_0xed87('0x32')]=_0x5c6925[_0xed87('0x32')][_0xed87('0x34')]?_0x5c6925[_0xed87('0x32')]:_0x7e6cbb[_0xed87('0x2c')];if(_0x35bd1c['query'][_0xed87('0x41')]){_0x5c6925[_0xed87('0x47')]=[{'all':!![]}];}_0x5c6925=_[_0xed87('0x3c')]({},_0x5c6925,_0x35bd1c[_0xed87('0x3f')]);return db[_0xed87('0x40')][_0xed87('0x48')](_0x5c6925)[_0xed87('0x23')](handleEntityNotFound(_0x406b73,null))[_0xed87('0x23')](respondWithResult(_0x406b73,null))[_0xed87('0x44')](handleError(_0x406b73,null));};exports[_0xed87('0x49')]=function(_0x8aa499,_0x26c8f4){return db[_0xed87('0x40')][_0xed87('0x49')](_0x8aa499[_0xed87('0x4a')],{})[_0xed87('0x23')](respondWithResult(_0x26c8f4,0xc9))[_0xed87('0x44')](handleError(_0x26c8f4,null));};exports['update']=function(_0x2c7bef,_0x1a68a7){if(_0x2c7bef[_0xed87('0x4a')]['id']){delete _0x2c7bef['body']['id'];}return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x2c7bef['params']['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x1a68a7,null))[_0xed87('0x23')](saveUpdates(_0x2c7bef[_0xed87('0x4a')],null))[_0xed87('0x23')](respondWithResult(_0x1a68a7,null))['catch'](handleError(_0x1a68a7,null));};exports[_0xed87('0x24')]=function(_0x436e15,_0x3ca34c){return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x436e15[_0xed87('0x46')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3ca34c,null))[_0xed87('0x23')](removeEntity(_0x3ca34c,null))[_0xed87('0x44')](handleError(_0x3ca34c,null));};exports[_0xed87('0x4b')]=function(_0x25a514,_0x18846f){return db[_0xed87('0x40')]['describe']()[_0xed87('0x23')](respondWithResult(_0x18846f,null))['catch'](handleError(_0x18846f,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3b99a75..b341af9 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 _0xa48a=['rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x590a00,_0x1863d9){var _0x1db99d=function(_0x17f1d4){while(--_0x17f1d4){_0x590a00['push'](_0x590a00['shift']());}};_0x1db99d(++_0x1863d9);}(_0xa48a,0x133));var _0xaa48=function(_0x41079a,_0x219a93){_0x41079a=_0x41079a-0x0;var _0x12d94f=_0xa48a[_0x41079a];return _0x12d94f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa48('0x0'))(_0xaa48('0x1'));var moment=require(_0xaa48('0x2'));var BPromise=require(_0xaa48('0x3'));var rp=require(_0xaa48('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa48('0x5'));var config=require(_0xaa48('0x6'));var attributes=require(_0xaa48('0x7'));module[_0xaa48('0x8')]=function(_0x327332,_0x2102b4){return _0x327332[_0xaa48('0x9')](_0xaa48('0xa'),attributes,{'tableName':_0xaa48('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaa48('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ad0=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x327922,_0x2dadab){var _0x31e3ab=function(_0x2345eb){while(--_0x2345eb){_0x327922['push'](_0x327922['shift']());}};_0x31e3ab(++_0x2dadab);}(_0x0ad0,0x1b5));var _0x00ad=function(_0xff17bc,_0x19adf5){_0xff17bc=_0xff17bc-0x0;var _0x32c249=_0x0ad0[_0xff17bc];return _0x32c249;};'use strict';var _=require('lodash');var util=require(_0x00ad('0x0'));var logger=require(_0x00ad('0x1'))(_0x00ad('0x2'));var moment=require(_0x00ad('0x3'));var BPromise=require(_0x00ad('0x4'));var rp=require(_0x00ad('0x5'));var fs=require('fs');var path=require(_0x00ad('0x6'));var rimraf=require(_0x00ad('0x7'));var config=require(_0x00ad('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x00ad('0x9')]=function(_0x428a59,_0xdbc329){return _0x428a59[_0x00ad('0xa')](_0x00ad('0xb'),attributes,{'tableName':_0x00ad('0xc'),'paranoid':![],'indexes':[{'name':_0x00ad('0xd'),'fields':[_0x00ad('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 7e90657..241b78d 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 _0xb3aa=['jayson/promise','client','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','then','update','where','attributes','limit','UpdateWhatsappQueueReport','stringify','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xb3aa,0x71));var _0xab3a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xab3a('0x0'));var util=require('util');var moment=require(_0xab3a('0x1'));var BPromise=require('bluebird');var rs=require(_0xab3a('0x2'));var fs=require('fs');var Redis=require(_0xab3a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xab3a('0x4'));var logger=require('../../config/logger')(_0xab3a('0x5'));var config=require(_0xab3a('0x6'));var jayson=require(_0xab3a('0x7'));var client=jayson[_0xab3a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x256634,_0x4e0052,_0x10fb07){return new BPromise(function(_0x17856e,_0x2d269c){return client[_0xab3a('0x9')](_0x256634,_0x10fb07)['then'](function(_0x3d6929){logger['info'](_0xab3a('0xa'),_0x4e0052,_0xab3a('0xb'));logger[_0xab3a('0xc')](_0xab3a('0xd'),_0x4e0052,_0xab3a('0xb'),JSON['stringify'](_0x3d6929));if(_0x3d6929[_0xab3a('0xe')]){if(_0x3d6929[_0xab3a('0xe')]['code']===0x1f4){logger[_0xab3a('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4e0052,_0x3d6929['error'][_0xab3a('0xf')]);return _0x2d269c(_0x3d6929[_0xab3a('0xe')][_0xab3a('0xf')]);}logger[_0xab3a('0xe')](_0xab3a('0xa'),_0x4e0052,_0x3d6929['error'][_0xab3a('0xf')]);return _0x17856e(_0x3d6929[_0xab3a('0xe')][_0xab3a('0xf')]);}else{logger[_0xab3a('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4e0052,_0xab3a('0xb'));_0x17856e(_0x3d6929[_0xab3a('0x11')][_0xab3a('0xf')]);}})[_0xab3a('0x12')](function(_0xb50754){logger[_0xab3a('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4e0052,_0xb50754);_0x2d269c(_0xb50754);});});}exports[_0xab3a('0x13')]=function(_0x52fec1){var _0x59630d=this;return new Promise(function(_0x159195,_0x56af62){return db[_0xab3a('0x14')]['create'](_0x52fec1['body'],{'raw':_0x52fec1[_0xab3a('0x15')]?_0x52fec1[_0xab3a('0x15')][_0xab3a('0x16')]===undefined?!![]:![]:!![]})[_0xab3a('0x17')](function(_0x54e003){logger[_0xab3a('0x10')]('CreateWhatsappQueueReport',_0x52fec1);logger[_0xab3a('0xc')](_0xab3a('0x13'),_0x52fec1,JSON['stringify'](_0x54e003));_0x159195(_0x54e003);})[_0xab3a('0x12')](function(_0x5a9c9f){logger['error'](_0xab3a('0x13'),_0x5a9c9f[_0xab3a('0xf')],_0x52fec1);_0x56af62(_0x59630d[_0xab3a('0xe')](0x1f4,_0x5a9c9f[_0xab3a('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x43aa0a){var _0x1442a7=this;return new Promise(function(_0x18d28d,_0x4ffb5c){return db[_0xab3a('0x14')][_0xab3a('0x18')](_0x43aa0a['body'],{'raw':_0x43aa0a[_0xab3a('0x15')]?_0x43aa0a['options'][_0xab3a('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43aa0a[_0xab3a('0x15')]?_0x43aa0a['options'][_0xab3a('0x19')]||null:null,'attributes':_0x43aa0a[_0xab3a('0x15')]?_0x43aa0a[_0xab3a('0x15')][_0xab3a('0x1a')]||null:null,'limit':_0x43aa0a['options']?_0x43aa0a[_0xab3a('0x15')][_0xab3a('0x1b')]||null:null})[_0xab3a('0x17')](function(_0x2f0e7a){logger[_0xab3a('0x10')](_0xab3a('0x1c'),_0x43aa0a);logger['debug']('UpdateWhatsappQueueReport',_0x43aa0a,JSON[_0xab3a('0x1d')](_0x2f0e7a));_0x18d28d(_0x2f0e7a);})[_0xab3a('0x12')](function(_0x395b61){logger['error'](_0xab3a('0x1c'),_0x395b61[_0xab3a('0xf')],_0x43aa0a);_0x4ffb5c(_0x1442a7[_0xab3a('0xe')](0x1f4,_0x395b61[_0xab3a('0xf')]));});});}; \ No newline at end of file +var _0x4103=['rpc','../../config/environment','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','update','body','where','info','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0x4103,0x144));var _0x3410=function(_0x123885,_0x36e9ab){_0x123885=_0x123885-0x0;var _0x4d3e75=_0x4103[_0x123885];return _0x4d3e75;};'use strict';var _=require(_0x3410('0x0'));var util=require('util');var moment=require(_0x3410('0x1'));var BPromise=require('bluebird');var rs=require(_0x3410('0x2'));var fs=require('fs');var Redis=require(_0x3410('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3410('0x4'));var logger=require(_0x3410('0x5'))(_0x3410('0x6'));var config=require(_0x3410('0x7'));var jayson=require(_0x3410('0x8'));var client=jayson[_0x3410('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1031d9,_0x8c605a,_0xacded7){return new BPromise(function(_0x15a41c,_0x4f2f99){return client[_0x3410('0xa')](_0x1031d9,_0xacded7)[_0x3410('0xb')](function(_0x4d3a77){logger['info'](_0x3410('0xc'),_0x8c605a,_0x3410('0xd'));logger[_0x3410('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x8c605a,_0x3410('0xd'),JSON[_0x3410('0xf')](_0x4d3a77));if(_0x4d3a77[_0x3410('0x10')]){if(_0x4d3a77[_0x3410('0x10')][_0x3410('0x11')]===0x1f4){logger[_0x3410('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x8c605a,_0x4d3a77['error'][_0x3410('0x12')]);return _0x4f2f99(_0x4d3a77[_0x3410('0x10')][_0x3410('0x12')]);}logger[_0x3410('0x10')](_0x3410('0xc'),_0x8c605a,_0x4d3a77[_0x3410('0x10')][_0x3410('0x12')]);return _0x15a41c(_0x4d3a77[_0x3410('0x10')][_0x3410('0x12')]);}else{logger['info'](_0x3410('0xc'),_0x8c605a,'request\x20sent');_0x15a41c(_0x4d3a77[_0x3410('0x13')][_0x3410('0x12')]);}})['catch'](function(_0x55a858){logger[_0x3410('0x10')](_0x3410('0xc'),_0x8c605a,_0x55a858);_0x4f2f99(_0x55a858);});});}exports[_0x3410('0x14')]=function(_0x311107){var _0x316a4a=this;return new Promise(function(_0x4c7ea2,_0x167583){return db[_0x3410('0x15')][_0x3410('0x16')](_0x311107['body'],{'raw':_0x311107['options']?_0x311107[_0x3410('0x17')][_0x3410('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x39ae4e){logger['info'](_0x3410('0x14'),_0x311107);logger[_0x3410('0xe')](_0x3410('0x14'),_0x311107,JSON[_0x3410('0xf')](_0x39ae4e));_0x4c7ea2(_0x39ae4e);})['catch'](function(_0x2ad278){logger[_0x3410('0x10')](_0x3410('0x14'),_0x2ad278[_0x3410('0x12')],_0x311107);_0x167583(_0x316a4a[_0x3410('0x10')](0x1f4,_0x2ad278[_0x3410('0x12')]));});});};exports[_0x3410('0x19')]=function(_0x13d91e){var _0x426120=this;return new Promise(function(_0x5e472e,_0x2c5825){return db[_0x3410('0x15')][_0x3410('0x1a')](_0x13d91e[_0x3410('0x1b')],{'raw':_0x13d91e[_0x3410('0x17')]?_0x13d91e[_0x3410('0x17')][_0x3410('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13d91e[_0x3410('0x17')]?_0x13d91e['options'][_0x3410('0x1c')]||null:null,'attributes':_0x13d91e['options']?_0x13d91e['options']['attributes']||null:null,'limit':_0x13d91e[_0x3410('0x17')]?_0x13d91e['options']['limit']||null:null})[_0x3410('0xb')](function(_0x4733dc){logger[_0x3410('0x1d')](_0x3410('0x19'),_0x13d91e);logger['debug'](_0x3410('0x19'),_0x13d91e,JSON[_0x3410('0xf')](_0x4733dc));_0x5e472e(_0x4733dc);})['catch'](function(_0x44d15a){logger['error'](_0x3410('0x19'),_0x44d15a[_0x3410('0x12')],_0x13d91e);_0x2c5825(_0x426120[_0x3410('0x10')](0x1f4,_0x44d15a['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4c1eeac..e591526 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 _0x8c3e=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','update','delete','destroy','exports','multer'];(function(_0x2ed44d,_0x3fd94b){var _0x27ff02=function(_0x322476){while(--_0x322476){_0x2ed44d['push'](_0x2ed44d['shift']());}};_0x27ff02(++_0x3fd94b);}(_0x8c3e,0x1b9));var _0xe8c3=function(_0x2f1ac4,_0x236a72){_0x2f1ac4=_0x2f1ac4-0x0;var _0x18e1a5=_0x8c3e[_0x2f1ac4];return _0x18e1a5;};'use strict';var multer=require(_0xe8c3('0x0'));var util=require(_0xe8c3('0x1'));var path=require(_0xe8c3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8c3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe8c3('0x4'));var interaction=require(_0xe8c3('0x5'));var config=require(_0xe8c3('0x6'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe8c3('0x7')](_0xe8c3('0x8'),auth['isAuthenticated'](),controller[_0xe8c3('0x9')]);router[_0xe8c3('0x7')](_0xe8c3('0xa'),auth[_0xe8c3('0xb')](),controller[_0xe8c3('0xc')]);router['post']('/',auth[_0xe8c3('0xb')](),controller['create']);router['put'](_0xe8c3('0xa'),auth[_0xe8c3('0xb')](),controller[_0xe8c3('0xd')]);router[_0xe8c3('0xe')](_0xe8c3('0xa'),auth[_0xe8c3('0xb')](),controller[_0xe8c3('0xf')]);module[_0xe8c3('0x10')]=router; \ No newline at end of file +var _0x6f71=['describe','/:id','show','post','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','/describe','isAuthenticated'];(function(_0x47a444,_0x480724){var _0x3139a4=function(_0x5a0b71){while(--_0x5a0b71){_0x47a444['push'](_0x47a444['shift']());}};_0x3139a4(++_0x480724);}(_0x6f71,0xf8));var _0x16f7=function(_0x3949fd,_0x52c61d){_0x3949fd=_0x3949fd-0x0;var _0x10e4d2=_0x6f71[_0x3949fd];return _0x10e4d2;};'use strict';var multer=require(_0x16f7('0x0'));var util=require('util');var path=require(_0x16f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x16f7('0x2'));var router=express[_0x16f7('0x3')]();var fs_extra=require(_0x16f7('0x4'));var auth=require(_0x16f7('0x5'));var interaction=require(_0x16f7('0x6'));var config=require(_0x16f7('0x7'));var controller=require(_0x16f7('0x8'));router[_0x16f7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x16f7('0x9')](_0x16f7('0xa'),auth[_0x16f7('0xb')](),controller[_0x16f7('0xc')]);router[_0x16f7('0x9')](_0x16f7('0xd'),auth[_0x16f7('0xb')](),controller[_0x16f7('0xe')]);router[_0x16f7('0xf')]('/',auth['isAuthenticated'](),controller[_0x16f7('0x10')]);router[_0x16f7('0x11')](_0x16f7('0xd'),auth[_0x16f7('0xb')](),controller['update']);router[_0x16f7('0x12')](_0x16f7('0xd'),auth['isAuthenticated'](),controller[_0x16f7('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 318a2d2..255a488 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 _0xb7aa=['queue','DATE','sequelize','exports','STRING','ENUM','account','agent'];(function(_0xfd74e9,_0x15ae2c){var _0x16d207=function(_0x4c278c){while(--_0x4c278c){_0xfd74e9['push'](_0xfd74e9['shift']());}};_0x16d207(++_0x15ae2c);}(_0xb7aa,0x11a));var _0xab7a=function(_0x18d5d9,_0x306625){_0x18d5d9=_0x18d5d9-0x0;var _0x4ea7c9=_0xb7aa[_0x18d5d9];return _0x4ea7c9;};'use strict';var Sequelize=require(_0xab7a('0x0'));module[_0xab7a('0x1')]={'uniqueid':{'type':Sequelize[_0xab7a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xab7a('0x3')](_0xab7a('0x4'),_0xab7a('0x5'),_0xab7a('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xab7a('0x7')]}}; \ No newline at end of file +var _0x723c=['STRING','account','queue','DATE','exports'];(function(_0x449967,_0x49266a){var _0x283c82=function(_0x48ed62){while(--_0x48ed62){_0x449967['push'](_0x449967['shift']());}};_0x283c82(++_0x49266a);}(_0x723c,0x1ad));var _0xc723=function(_0x5cb24f,_0x4dc4c2){_0x5cb24f=_0x5cb24f-0x0;var _0x3d72e0=_0x723c[_0x5cb24f];return _0x3d72e0;};'use strict';var Sequelize=require('sequelize');module[_0xc723('0x0')]={'uniqueid':{'type':Sequelize[_0xc723('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc723('0x2'),'agent',_0xc723('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc723('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ce8738e..0d75bf1 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 _0x08bd=['bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x08bd,0xd3));var _0xd08b=function(_0x121b52,_0x5802b4){_0x121b52=_0x121b52-0x0;var _0xd3d4a=_0x08bd[_0x121b52];return _0xd3d4a;};'use strict';var emlformat=require(_0xd08b('0x0'));var rimraf=require(_0xd08b('0x1'));var zipdir=require(_0xd08b('0x2'));var jsonpatch=require(_0xd08b('0x3'));var rp=require(_0xd08b('0x4'));var moment=require('moment');var BPromise=require(_0xd08b('0x5'));var Mustache=require(_0xd08b('0x6'));var util=require(_0xd08b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd08b('0x8'));var ejs=require(_0xd08b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd08b('0xa'));var squel=require(_0xd08b('0xb'));var crypto=require(_0xd08b('0xc'));var jsforce=require(_0xd08b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd08b('0xe'));var authService=require(_0xd08b('0xf'));var qs=require(_0xd08b('0x10'));var as=require(_0xd08b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd08b('0x12'))(_0xd08b('0x13'));var utils=require(_0xd08b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd08b('0x15'));var db=require(_0xd08b('0x16'))['db'];function respondWithStatusCode(_0x276cf8,_0xc4e282){_0xc4e282=_0xc4e282||0xcc;return function(_0x1dd417){if(_0x1dd417){return _0x276cf8[_0xd08b('0x17')](_0xc4e282);}return _0x276cf8['status'](_0xc4e282)[_0xd08b('0x18')]();};}function respondWithResult(_0x146290,_0x530ed4){_0x530ed4=_0x530ed4||0xc8;return function(_0x32f43b){if(_0x32f43b){return _0x146290[_0xd08b('0x19')](_0x530ed4)['json'](_0x32f43b);}};}function respondWithFilteredResult(_0x1d9b9c,_0x2b4eda){return function(_0x4539e6){if(_0x4539e6){var _0x4a310c=typeof _0x2b4eda[_0xd08b('0x1a')]==='undefined'&&typeof _0x2b4eda['limit']===_0xd08b('0x1b');var _0x49e625=_0x4539e6[_0xd08b('0x1c')];var _0x397e08=_0x4a310c?0x0:_0x2b4eda[_0xd08b('0x1a')];var _0xa9b195=_0x4a310c?_0x4539e6[_0xd08b('0x1c')]:_0x2b4eda[_0xd08b('0x1a')]+_0x2b4eda[_0xd08b('0x1d')];var _0x2379a4;if(_0xa9b195>=_0x49e625){_0xa9b195=_0x49e625;_0x2379a4=0xc8;}else{_0x2379a4=0xce;}_0x1d9b9c[_0xd08b('0x19')](_0x2379a4);return _0x1d9b9c[_0xd08b('0x1e')](_0xd08b('0x1f'),_0x397e08+'-'+_0xa9b195+'/'+_0x49e625)[_0xd08b('0x20')](_0x4539e6);}return null;};}function patchUpdates(_0x25c1aa){return function(_0x542406){try{jsonpatch[_0xd08b('0x21')](_0x542406,_0x25c1aa,!![]);}catch(_0x3d7d1a){return BPromise[_0xd08b('0x22')](_0x3d7d1a);}return _0x542406[_0xd08b('0x23')]();};}function saveUpdates(_0x5d0c15,_0x19832a){return function(_0x1ec580){if(_0x1ec580){return _0x1ec580['update'](_0x5d0c15)[_0xd08b('0x24')](function(_0x8b77b1){return _0x8b77b1;});}return null;};}function removeEntity(_0x3101dd,_0x49f4f9){return function(_0x5e36e0){if(_0x5e36e0){return _0x5e36e0[_0xd08b('0x25')]()['then'](function(){_0x3101dd[_0xd08b('0x19')](0xcc)[_0xd08b('0x18')]();});}};}function handleEntityNotFound(_0x586163,_0x29dd65){return function(_0x4ab0d9){if(!_0x4ab0d9){_0x586163[_0xd08b('0x17')](0x194);}return _0x4ab0d9;};}function handleError(_0x2785e7,_0x4a6a9b){_0x4a6a9b=_0x4a6a9b||0x1f4;return function(_0x29bba4){logger[_0xd08b('0x26')](_0x29bba4[_0xd08b('0x27')]);if(_0x29bba4['name']){delete _0x29bba4[_0xd08b('0x28')];}_0x2785e7['status'](_0x4a6a9b)['send'](_0x29bba4);};}exports[_0xd08b('0x29')]=function(_0x53efeb,_0x2f44ba){var _0x522d5c={},_0x27ca26={},_0x223418={'count':0x0,'rows':[]};var _0x488422=_[_0xd08b('0x2a')](db[_0xd08b('0x2b')][_0xd08b('0x2c')],function(_0xc16702){return{'name':_0xc16702['fieldName'],'type':_0xc16702[_0xd08b('0x2d')]['key']};});_0x27ca26[_0xd08b('0x2e')]=_[_0xd08b('0x2a')](_0x488422,'name');_0x27ca26[_0xd08b('0x2f')]=_[_0xd08b('0x30')](_0x53efeb[_0xd08b('0x2f')]);_0x27ca26['filters']=_[_0xd08b('0x31')](_0x27ca26['model'],_0x27ca26[_0xd08b('0x2f')]);_0x522d5c[_0xd08b('0x32')]=_[_0xd08b('0x31')](_0x27ca26['model'],qs[_0xd08b('0x33')](_0x53efeb['query'][_0xd08b('0x33')]));_0x522d5c[_0xd08b('0x32')]=_0x522d5c[_0xd08b('0x32')][_0xd08b('0x34')]?_0x522d5c[_0xd08b('0x32')]:_0x27ca26['model'];if(!_0x53efeb[_0xd08b('0x2f')][_0xd08b('0x35')]('nolimit')){_0x522d5c[_0xd08b('0x1d')]=qs[_0xd08b('0x1d')](_0x53efeb[_0xd08b('0x2f')][_0xd08b('0x1d')]);_0x522d5c[_0xd08b('0x1a')]=qs[_0xd08b('0x1a')](_0x53efeb[_0xd08b('0x2f')][_0xd08b('0x1a')]);}_0x522d5c['order']=qs[_0xd08b('0x36')](_0x53efeb[_0xd08b('0x2f')][_0xd08b('0x36')]);_0x522d5c[_0xd08b('0x37')]=qs['filters'](_[_0xd08b('0x38')](_0x53efeb[_0xd08b('0x2f')],_0x27ca26[_0xd08b('0x39')]),_0x488422);if(_0x53efeb[_0xd08b('0x2f')][_0xd08b('0x3a')]){_0x522d5c['where']=_[_0xd08b('0x3b')](_0x522d5c[_0xd08b('0x37')],{'$or':_[_0xd08b('0x2a')](_0x488422,function(_0x3539d2){if(_0x3539d2['type']!==_0xd08b('0x3c')){var _0x434391={};_0x434391[_0x3539d2['name']]={'$like':'%'+_0x53efeb[_0xd08b('0x2f')]['filter']+'%'};return _0x434391;}})});}_0x522d5c=_[_0xd08b('0x3b')]({},_0x522d5c,_0x53efeb[_0xd08b('0x3d')]);var _0x1faa5b={'where':_0x522d5c[_0xd08b('0x37')]};return db['WhatsappTransferReport'][_0xd08b('0x1c')](_0x1faa5b)[_0xd08b('0x24')](function(_0xa2b5){_0x223418['count']=_0xa2b5;if(_0x53efeb[_0xd08b('0x2f')]['includeAll']){_0x522d5c['include']=[{'all':!![]}];}return db[_0xd08b('0x2b')][_0xd08b('0x3e')](_0x522d5c);})[_0xd08b('0x24')](function(_0x37697f){_0x223418[_0xd08b('0x3f')]=_0x37697f;return _0x223418;})[_0xd08b('0x24')](respondWithFilteredResult(_0x2f44ba,_0x522d5c))[_0xd08b('0x40')](handleError(_0x2f44ba,null));};exports['show']=function(_0x2c72fa,_0x244e5d){var _0x35283e={'raw':!![],'where':{'id':_0x2c72fa[_0xd08b('0x41')]['id']}},_0x2ae260={};_0x2ae260[_0xd08b('0x2e')]=_[_0xd08b('0x30')](db['WhatsappTransferReport'][_0xd08b('0x2c')]);_0x2ae260['query']=_[_0xd08b('0x30')](_0x2c72fa[_0xd08b('0x2f')]);_0x2ae260['filters']=_[_0xd08b('0x31')](_0x2ae260[_0xd08b('0x2e')],_0x2ae260[_0xd08b('0x2f')]);_0x35283e['attributes']=_['intersection'](_0x2ae260[_0xd08b('0x2e')],qs[_0xd08b('0x33')](_0x2c72fa[_0xd08b('0x2f')][_0xd08b('0x33')]));_0x35283e['attributes']=_0x35283e['attributes'][_0xd08b('0x34')]?_0x35283e[_0xd08b('0x32')]:_0x2ae260['model'];if(_0x2c72fa[_0xd08b('0x2f')][_0xd08b('0x42')]){_0x35283e['include']=[{'all':!![]}];}_0x35283e=_[_0xd08b('0x3b')]({},_0x35283e,_0x2c72fa['options']);return db[_0xd08b('0x2b')][_0xd08b('0x43')](_0x35283e)[_0xd08b('0x24')](handleEntityNotFound(_0x244e5d,null))[_0xd08b('0x24')](respondWithResult(_0x244e5d,null))[_0xd08b('0x40')](handleError(_0x244e5d,null));};exports['create']=function(_0x48076b,_0x3e1a2c){return db['WhatsappTransferReport'][_0xd08b('0x44')](_0x48076b[_0xd08b('0x45')],{})[_0xd08b('0x24')](respondWithResult(_0x3e1a2c,0xc9))[_0xd08b('0x40')](handleError(_0x3e1a2c,null));};exports[_0xd08b('0x46')]=function(_0x3c6bf3,_0x2ca77c){if(_0x3c6bf3['body']['id']){delete _0x3c6bf3['body']['id'];}return db[_0xd08b('0x2b')][_0xd08b('0x43')]({'where':{'id':_0x3c6bf3['params']['id']}})[_0xd08b('0x24')](handleEntityNotFound(_0x2ca77c,null))[_0xd08b('0x24')](saveUpdates(_0x3c6bf3['body'],null))[_0xd08b('0x24')](respondWithResult(_0x2ca77c,null))[_0xd08b('0x40')](handleError(_0x2ca77c,null));};exports['destroy']=function(_0x4c3d49,_0xcec2cd){return db[_0xd08b('0x2b')][_0xd08b('0x43')]({'where':{'id':_0x4c3d49[_0xd08b('0x41')]['id']}})[_0xd08b('0x24')](handleEntityNotFound(_0xcec2cd,null))[_0xd08b('0x24')](removeEntity(_0xcec2cd,null))['catch'](handleError(_0xcec2cd,null));};exports['describe']=function(_0x13fe78,_0x585812){return db[_0xd08b('0x2b')][_0xd08b('0x47')]()[_0xd08b('0x24')](respondWithResult(_0x585812,null))['catch'](handleError(_0x585812,null));}; \ No newline at end of file +var _0x6aec=['to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x98a02d,_0x45cd5f){var _0x5d8ca2=function(_0x436893){while(--_0x436893){_0x98a02d['push'](_0x98a02d['shift']());}};_0x5d8ca2(++_0x45cd5f);}(_0x6aec,0x10e));var _0xc6ae=function(_0x27ace4,_0x414d60){_0x27ace4=_0x27ace4-0x0;var _0x52ba0f=_0x6aec[_0x27ace4];return _0x52ba0f;};'use strict';var emlformat=require(_0xc6ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6ae('0x1'));var jsonpatch=require(_0xc6ae('0x2'));var rp=require(_0xc6ae('0x3'));var moment=require(_0xc6ae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc6ae('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc6ae('0x6'));var ejs=require(_0xc6ae('0x7'));var fs=require('fs');var fs_extra=require(_0xc6ae('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc6ae('0x9'));var jsforce=require(_0xc6ae('0xa'));var deskjs=require(_0xc6ae('0xb'));var toCsv=require(_0xc6ae('0x6'));var querystring=require(_0xc6ae('0xc'));var Papa=require(_0xc6ae('0xd'));var Redis=require(_0xc6ae('0xe'));var authService=require(_0xc6ae('0xf'));var qs=require(_0xc6ae('0x10'));var as=require(_0xc6ae('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc6ae('0x12'));var utils=require(_0xc6ae('0x13'));var config=require(_0xc6ae('0x14'));var licenseUtil=require(_0xc6ae('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb8006d,_0x2fa5aa){_0x2fa5aa=_0x2fa5aa||0xcc;return function(_0x26c0c3){if(_0x26c0c3){return _0xb8006d[_0xc6ae('0x16')](_0x2fa5aa);}return _0xb8006d[_0xc6ae('0x17')](_0x2fa5aa)['end']();};}function respondWithResult(_0x3a280a,_0x35954d){_0x35954d=_0x35954d||0xc8;return function(_0x1000e3){if(_0x1000e3){return _0x3a280a[_0xc6ae('0x17')](_0x35954d)[_0xc6ae('0x18')](_0x1000e3);}};}function respondWithFilteredResult(_0x522485,_0x26153e){return function(_0x9ee663){if(_0x9ee663){var _0x4d23b8=typeof _0x26153e[_0xc6ae('0x19')]===_0xc6ae('0x1a')&&typeof _0x26153e[_0xc6ae('0x1b')]===_0xc6ae('0x1a');var _0x26e4f3=_0x9ee663[_0xc6ae('0x1c')];var _0x93a4f7=_0x4d23b8?0x0:_0x26153e[_0xc6ae('0x19')];var _0x3892af=_0x4d23b8?_0x9ee663[_0xc6ae('0x1c')]:_0x26153e[_0xc6ae('0x19')]+_0x26153e[_0xc6ae('0x1b')];var _0x5b6ed0;if(_0x3892af>=_0x26e4f3){_0x3892af=_0x26e4f3;_0x5b6ed0=0xc8;}else{_0x5b6ed0=0xce;}_0x522485[_0xc6ae('0x17')](_0x5b6ed0);return _0x522485[_0xc6ae('0x1d')](_0xc6ae('0x1e'),_0x93a4f7+'-'+_0x3892af+'/'+_0x26e4f3)['json'](_0x9ee663);}return null;};}function patchUpdates(_0x5d7417){return function(_0x3e39bf){try{jsonpatch[_0xc6ae('0x1f')](_0x3e39bf,_0x5d7417,!![]);}catch(_0x7fead1){return BPromise[_0xc6ae('0x20')](_0x7fead1);}return _0x3e39bf[_0xc6ae('0x21')]();};}function saveUpdates(_0x5c1368,_0x204b3d){return function(_0xd9b5fa){if(_0xd9b5fa){return _0xd9b5fa[_0xc6ae('0x22')](_0x5c1368)[_0xc6ae('0x23')](function(_0x473f0e){return _0x473f0e;});}return null;};}function removeEntity(_0x253c66,_0x2c6f70){return function(_0x40e4ef){if(_0x40e4ef){return _0x40e4ef[_0xc6ae('0x24')]()[_0xc6ae('0x23')](function(){_0x253c66['status'](0xcc)[_0xc6ae('0x25')]();});}};}function handleEntityNotFound(_0x107957,_0x5bb4ef){return function(_0xaff6ae){if(!_0xaff6ae){_0x107957[_0xc6ae('0x16')](0x194);}return _0xaff6ae;};}function handleError(_0x305a3c,_0x325092){_0x325092=_0x325092||0x1f4;return function(_0x435add){logger[_0xc6ae('0x26')](_0x435add['stack']);if(_0x435add['name']){delete _0x435add[_0xc6ae('0x27')];}_0x305a3c[_0xc6ae('0x17')](_0x325092)[_0xc6ae('0x28')](_0x435add);};}exports[_0xc6ae('0x29')]=function(_0x490ffd,_0x3a0cbc){var _0x323581={},_0x21c66e={},_0x524e8a={'count':0x0,'rows':[]};var _0x41a47=_[_0xc6ae('0x2a')](db[_0xc6ae('0x2b')][_0xc6ae('0x2c')],function(_0xa07ff0){return{'name':_0xa07ff0[_0xc6ae('0x2d')],'type':_0xa07ff0[_0xc6ae('0x2e')]['key']};});_0x21c66e[_0xc6ae('0x2f')]=_[_0xc6ae('0x2a')](_0x41a47,_0xc6ae('0x27'));_0x21c66e[_0xc6ae('0x30')]=_[_0xc6ae('0x31')](_0x490ffd[_0xc6ae('0x30')]);_0x21c66e[_0xc6ae('0x32')]=_['intersection'](_0x21c66e[_0xc6ae('0x2f')],_0x21c66e[_0xc6ae('0x30')]);_0x323581['attributes']=_[_0xc6ae('0x33')](_0x21c66e[_0xc6ae('0x2f')],qs[_0xc6ae('0x34')](_0x490ffd['query'][_0xc6ae('0x34')]));_0x323581['attributes']=_0x323581[_0xc6ae('0x35')]['length']?_0x323581['attributes']:_0x21c66e['model'];if(!_0x490ffd[_0xc6ae('0x30')]['hasOwnProperty']('nolimit')){_0x323581[_0xc6ae('0x1b')]=qs[_0xc6ae('0x1b')](_0x490ffd[_0xc6ae('0x30')][_0xc6ae('0x1b')]);_0x323581[_0xc6ae('0x19')]=qs[_0xc6ae('0x19')](_0x490ffd['query'][_0xc6ae('0x19')]);}_0x323581['order']=qs['sort'](_0x490ffd[_0xc6ae('0x30')]['sort']);_0x323581[_0xc6ae('0x36')]=qs['filters'](_['pick'](_0x490ffd[_0xc6ae('0x30')],_0x21c66e[_0xc6ae('0x32')]),_0x41a47);if(_0x490ffd[_0xc6ae('0x30')]['filter']){_0x323581[_0xc6ae('0x36')]=_[_0xc6ae('0x37')](_0x323581[_0xc6ae('0x36')],{'$or':_['map'](_0x41a47,function(_0x446a19){if(_0x446a19[_0xc6ae('0x2e')]!==_0xc6ae('0x38')){var _0x23edef={};_0x23edef[_0x446a19[_0xc6ae('0x27')]]={'$like':'%'+_0x490ffd[_0xc6ae('0x30')][_0xc6ae('0x39')]+'%'};return _0x23edef;}})});}_0x323581=_[_0xc6ae('0x37')]({},_0x323581,_0x490ffd['options']);var _0xfc7e92={'where':_0x323581[_0xc6ae('0x36')]};return db[_0xc6ae('0x2b')][_0xc6ae('0x1c')](_0xfc7e92)[_0xc6ae('0x23')](function(_0x1d92b6){_0x524e8a[_0xc6ae('0x1c')]=_0x1d92b6;if(_0x490ffd[_0xc6ae('0x30')][_0xc6ae('0x3a')]){_0x323581['include']=[{'all':!![]}];}return db[_0xc6ae('0x2b')][_0xc6ae('0x3b')](_0x323581);})['then'](function(_0x6dc23b){_0x524e8a[_0xc6ae('0x3c')]=_0x6dc23b;return _0x524e8a;})['then'](respondWithFilteredResult(_0x3a0cbc,_0x323581))[_0xc6ae('0x3d')](handleError(_0x3a0cbc,null));};exports[_0xc6ae('0x3e')]=function(_0x335dc1,_0x23a48a){var _0x330544={'raw':!![],'where':{'id':_0x335dc1[_0xc6ae('0x3f')]['id']}},_0x153b6a={};_0x153b6a[_0xc6ae('0x2f')]=_[_0xc6ae('0x31')](db[_0xc6ae('0x2b')][_0xc6ae('0x2c')]);_0x153b6a['query']=_[_0xc6ae('0x31')](_0x335dc1[_0xc6ae('0x30')]);_0x153b6a[_0xc6ae('0x32')]=_['intersection'](_0x153b6a[_0xc6ae('0x2f')],_0x153b6a['query']);_0x330544[_0xc6ae('0x35')]=_[_0xc6ae('0x33')](_0x153b6a[_0xc6ae('0x2f')],qs[_0xc6ae('0x34')](_0x335dc1['query']['fields']));_0x330544['attributes']=_0x330544['attributes'][_0xc6ae('0x40')]?_0x330544[_0xc6ae('0x35')]:_0x153b6a[_0xc6ae('0x2f')];if(_0x335dc1[_0xc6ae('0x30')][_0xc6ae('0x3a')]){_0x330544['include']=[{'all':!![]}];}_0x330544=_[_0xc6ae('0x37')]({},_0x330544,_0x335dc1['options']);return db['WhatsappTransferReport'][_0xc6ae('0x41')](_0x330544)['then'](handleEntityNotFound(_0x23a48a,null))[_0xc6ae('0x23')](respondWithResult(_0x23a48a,null))[_0xc6ae('0x3d')](handleError(_0x23a48a,null));};exports[_0xc6ae('0x42')]=function(_0x3be749,_0x4ed33e){return db[_0xc6ae('0x2b')]['create'](_0x3be749[_0xc6ae('0x43')],{})['then'](respondWithResult(_0x4ed33e,0xc9))[_0xc6ae('0x3d')](handleError(_0x4ed33e,null));};exports[_0xc6ae('0x22')]=function(_0x2ebe68,_0x19cd88){if(_0x2ebe68[_0xc6ae('0x43')]['id']){delete _0x2ebe68[_0xc6ae('0x43')]['id'];}return db[_0xc6ae('0x2b')][_0xc6ae('0x41')]({'where':{'id':_0x2ebe68['params']['id']}})[_0xc6ae('0x23')](handleEntityNotFound(_0x19cd88,null))[_0xc6ae('0x23')](saveUpdates(_0x2ebe68[_0xc6ae('0x43')],null))[_0xc6ae('0x23')](respondWithResult(_0x19cd88,null))[_0xc6ae('0x3d')](handleError(_0x19cd88,null));};exports['destroy']=function(_0x5c8ebf,_0xf066f2){return db[_0xc6ae('0x2b')][_0xc6ae('0x41')]({'where':{'id':_0x5c8ebf[_0xc6ae('0x3f')]['id']}})[_0xc6ae('0x23')](handleEntityNotFound(_0xf066f2,null))[_0xc6ae('0x23')](removeEntity(_0xf066f2,null))[_0xc6ae('0x3d')](handleError(_0xf066f2,null));};exports[_0xc6ae('0x44')]=function(_0x2df397,_0x296193){return db[_0xc6ae('0x2b')][_0xc6ae('0x44')]()[_0xc6ae('0x23')](respondWithResult(_0x296193,null))['catch'](handleError(_0x296193,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 5b784d6..f50f513 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 _0x83c0=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x83c0,0x72));var _0x083c=function(_0x54c11d,_0x963b10){_0x54c11d=_0x54c11d-0x0;var _0x5b1114=_0x83c0[_0x54c11d];return _0x5b1114;};'use strict';var _=require(_0x083c('0x0'));var util=require(_0x083c('0x1'));var logger=require(_0x083c('0x2'))(_0x083c('0x3'));var moment=require('moment');var BPromise=require(_0x083c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x083c('0x5'));var rimraf=require(_0x083c('0x6'));var config=require(_0x083c('0x7'));var attributes=require(_0x083c('0x8'));module[_0x083c('0x9')]=function(_0x2238e6,_0xd29c7e){return _0x2238e6['define'](_0x083c('0xa'),attributes,{'tableName':_0x083c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc473=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','lodash','util'];(function(_0x4e0090,_0x803be0){var _0x180148=function(_0xcc8682){while(--_0xcc8682){_0x4e0090['push'](_0x4e0090['shift']());}};_0x180148(++_0x803be0);}(_0xc473,0x1b8));var _0x3c47=function(_0x2b61c3,_0x4d941a){_0x2b61c3=_0x2b61c3-0x0;var _0x2690d2=_0xc473[_0x2b61c3];return _0x2690d2;};'use strict';var _=require(_0x3c47('0x0'));var util=require(_0x3c47('0x1'));var logger=require(_0x3c47('0x2'))('api');var moment=require(_0x3c47('0x3'));var BPromise=require(_0x3c47('0x4'));var rp=require(_0x3c47('0x5'));var fs=require('fs');var path=require(_0x3c47('0x6'));var rimraf=require(_0x3c47('0x7'));var config=require(_0x3c47('0x8'));var attributes=require(_0x3c47('0x9'));module[_0x3c47('0xa')]=function(_0x1b4b76,_0x44009f){return _0x1b4b76['define'](_0x3c47('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x3c47('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b8ff23c..48dd699 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 _0x8b4f=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x47aff3,_0x2f4828){var _0x33544a=function(_0x5525eb){while(--_0x5525eb){_0x47aff3['push'](_0x47aff3['shift']());}};_0x33544a(++_0x2f4828);}(_0x8b4f,0x85));var _0xf8b4=function(_0x3a607e,_0x54d530){_0x3a607e=_0x3a607e-0x0;var _0x37b106=_0x8b4f[_0x3a607e];return _0x37b106;};'use strict';var _=require(_0xf8b4('0x0'));var util=require(_0xf8b4('0x1'));var moment=require(_0xf8b4('0x2'));var BPromise=require(_0xf8b4('0x3'));var rs=require(_0xf8b4('0x4'));var fs=require('fs');var Redis=require(_0xf8b4('0x5'));var db=require(_0xf8b4('0x6'))['db'];var utils=require(_0xf8b4('0x7'));var logger=require(_0xf8b4('0x8'))('rpc');var config=require(_0xf8b4('0x9'));var jayson=require(_0xf8b4('0xa'));var client=jayson['client'][_0xf8b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13517a,_0x7447db,_0x5888ed){return new BPromise(function(_0x3c19ce,_0xc96e6a){return client[_0xf8b4('0xc')](_0x13517a,_0x5888ed)[_0xf8b4('0xd')](function(_0x1c49d9){logger[_0xf8b4('0xe')](_0xf8b4('0xf'),_0x7447db,_0xf8b4('0x10'));logger[_0xf8b4('0x11')](_0xf8b4('0x12'),_0x7447db,'request\x20sent',JSON[_0xf8b4('0x13')](_0x1c49d9));if(_0x1c49d9[_0xf8b4('0x14')]){if(_0x1c49d9[_0xf8b4('0x14')][_0xf8b4('0x15')]===0x1f4){logger[_0xf8b4('0x14')](_0xf8b4('0xf'),_0x7447db,_0x1c49d9[_0xf8b4('0x14')]['message']);return _0xc96e6a(_0x1c49d9[_0xf8b4('0x14')][_0xf8b4('0x16')]);}logger[_0xf8b4('0x14')](_0xf8b4('0xf'),_0x7447db,_0x1c49d9['error'][_0xf8b4('0x16')]);return _0x3c19ce(_0x1c49d9[_0xf8b4('0x14')][_0xf8b4('0x16')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x7447db,'request\x20sent');_0x3c19ce(_0x1c49d9[_0xf8b4('0x17')]['message']);}})[_0xf8b4('0x18')](function(_0x2b3b03){logger[_0xf8b4('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x7447db,_0x2b3b03);_0xc96e6a(_0x2b3b03);});});} \ No newline at end of file +var _0x361e=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3eae5b,_0x277ba9){var _0xfd82f6=function(_0xba8754){while(--_0xba8754){_0x3eae5b['push'](_0x3eae5b['shift']());}};_0xfd82f6(++_0x277ba9);}(_0x361e,0x1e9));var _0xe361=function(_0x2709ee,_0x4db185){_0x2709ee=_0x2709ee-0x0;var _0x35ba9a=_0x361e[_0x2709ee];return _0x35ba9a;};'use strict';var _=require(_0xe361('0x0'));var util=require(_0xe361('0x1'));var moment=require(_0xe361('0x2'));var BPromise=require(_0xe361('0x3'));var rs=require(_0xe361('0x4'));var fs=require('fs');var Redis=require(_0xe361('0x5'));var db=require(_0xe361('0x6'))['db'];var utils=require(_0xe361('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe361('0x8'));var jayson=require(_0xe361('0x9'));var client=jayson[_0xe361('0xa')][_0xe361('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x462ec9,_0xb13883,_0x904d2f){return new BPromise(function(_0x24265c,_0x1885be){return client[_0xe361('0xc')](_0x462ec9,_0x904d2f)[_0xe361('0xd')](function(_0x267a35){logger['info'](_0xe361('0xe'),_0xb13883,_0xe361('0xf'));logger[_0xe361('0x10')](_0xe361('0x11'),_0xb13883,_0xe361('0xf'),JSON[_0xe361('0x12')](_0x267a35));if(_0x267a35[_0xe361('0x13')]){if(_0x267a35[_0xe361('0x13')]['code']===0x1f4){logger['error'](_0xe361('0xe'),_0xb13883,_0x267a35[_0xe361('0x13')]['message']);return _0x1885be(_0x267a35[_0xe361('0x13')][_0xe361('0x14')]);}logger[_0xe361('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0xb13883,_0x267a35[_0xe361('0x13')][_0xe361('0x14')]);return _0x24265c(_0x267a35[_0xe361('0x13')][_0xe361('0x14')]);}else{logger[_0xe361('0x15')](_0xe361('0xe'),_0xb13883,'request\x20sent');_0x24265c(_0x267a35[_0xe361('0x16')][_0xe361('0x14')]);}})['catch'](function(_0x33de35){logger[_0xe361('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0xb13883,_0x33de35);_0x1885be(_0x33de35);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 7e88761..6e7741f 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd3c=['online','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','seedDB','default','then','info','start','filter','exitCode','length','map','pm2_env','name'];(function(_0x56de0b,_0x1c39c1){var _0x1c05f0=function(_0x5a6e7d){while(--_0x5a6e7d){_0x56de0b['push'](_0x56de0b['shift']());}};_0x1c05f0(++_0x1c39c1);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x3fa0df,_0x32c96b){_0x3fa0df=_0x3fa0df-0x0;var _0x31f29d=_0xbd3c[_0x3fa0df];return _0x31f29d;};'use strict';var _=require(_0xcbd3('0x0'));var db=require(_0xcbd3('0x1'))['db'];var seedDb=require(_0xcbd3('0x2'));var checkLicense=require('./config/license');var rpc=require(_0xcbd3('0x3'));var config=require(_0xcbd3('0x4'));var logger=require(_0xcbd3('0x5'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xcbd3('0x6'));var schedule=require('./config/schedule');var chat=require(_0xcbd3('0x7'));var whatsapp=require(_0xcbd3('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xcbd3('0x9'));function main(){return db[_0xcbd3('0xa')][_0xcbd3('0xb')]()['then'](function(){if(config[_0xcbd3('0xc')]){return seedDb[_0xcbd3('0xd')]();}})[_0xcbd3('0xe')](function(){return checkLicense[_0xcbd3('0xd')]();})[_0xcbd3('0xe')](function(){return rpc['listen']();})['then'](function(_0x41f67b){logger[_0xcbd3('0xf')](_0x41f67b);return chat['start']();})['then'](function(){return whatsapp['start']();})[_0xcbd3('0xe')](function(){return schedule[_0xcbd3('0x10')]();})[_0xcbd3('0xe')](function(){return transcribe['start']();})[_0xcbd3('0xe')](function(){return provider[_0xcbd3('0x10')]();})[_0xcbd3('0xe')](function(_0x1dfcfd){logger[_0xcbd3('0xf')](_0x1dfcfd);return pm2[_0xcbd3('0x10')](pm2Config);})['then'](function(_0x3cb72d){var _0x4f1dfd=_0x3cb72d[_0xcbd3('0x11')](function(_0x434ed6){return typeof _0x434ed6[_0xcbd3('0x12')]==='number'&&_0x434ed6[_0xcbd3('0x12')]>=0x0;});if(_0x4f1dfd['length']>0x0){throw new Error(_0x4f1dfd[_0xcbd3('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xcbd3('0x14')](_0x4f1dfd,function(_0x4dd582){return'\x22'+_0x4dd582[_0xcbd3('0x15')][_0xcbd3('0x16')]+'\x22';}));}logger[_0xcbd3('0xf')]('Online\x20apps:',_['map'](_[_0xcbd3('0x11')](_0x3cb72d,{'status':_0xcbd3('0x17')}),_0xcbd3('0x16'))['join']());logger[_0xcbd3('0xf')]('Offline\x20apps:',_[_0xcbd3('0x14')](_['filter'](_0x3cb72d,function(_0x281133){return _0x281133['status']!==_0xcbd3('0x17');}),'name')['join']()||_0xcbd3('0x18'));console[_0xcbd3('0x19')](_0xcbd3('0x1a'));})['catch'](function(_0x23cf8d){console[_0xcbd3('0x19')](_0xcbd3('0x1b'),_0x23cf8d);logger[_0xcbd3('0x1c')](_0xcbd3('0x1d'),_0x23cf8d);process[_0xcbd3('0x1e')](0x1);});}main(); \ No newline at end of file +var _0x308a=['filter','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','then','seedDB','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name'];(function(_0x373059,_0x17b09c){var _0x368f67=function(_0xccc46c){while(--_0xccc46c){_0x373059['push'](_0x373059['shift']());}};_0x368f67(++_0x17b09c);}(_0x308a,0x71));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa308('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xa308('0x1'));var checkLicense=require(_0xa308('0x2'));var rpc=require(_0xa308('0x3'));var config=require(_0xa308('0x4'));var logger=require('./config/logger')('app');var pm2=require(_0xa308('0x5'));var pm2Config=require(_0xa308('0x6'));var schedule=require(_0xa308('0x7'));var chat=require(_0xa308('0x8'));var whatsapp=require(_0xa308('0x9'));var transcribe=require(_0xa308('0xa'));var provider=require(_0xa308('0xb'));function main(){return db['sequelize']['sync']()[_0xa308('0xc')](function(){if(config[_0xa308('0xd')]){return seedDb['default']();}})[_0xa308('0xc')](function(){return checkLicense['default']();})[_0xa308('0xc')](function(){return rpc['listen']();})[_0xa308('0xc')](function(_0x19726b){logger['info'](_0x19726b);return chat[_0xa308('0xe')]();})['then'](function(){return whatsapp['start']();})[_0xa308('0xc')](function(){return schedule[_0xa308('0xe')]();})[_0xa308('0xc')](function(){return transcribe[_0xa308('0xe')]();})[_0xa308('0xc')](function(){return provider[_0xa308('0xe')]();})['then'](function(_0x361539){logger[_0xa308('0xf')](_0x361539);return pm2[_0xa308('0xe')](pm2Config);})[_0xa308('0xc')](function(_0x39b04c){var _0x5b0909=_0x39b04c['filter'](function(_0x558c31){return typeof _0x558c31[_0xa308('0x10')]===_0xa308('0x11')&&_0x558c31[_0xa308('0x10')]>=0x0;});if(_0x5b0909[_0xa308('0x12')]>0x0){throw new Error(_0x5b0909['length']+_0xa308('0x13')+_[_0xa308('0x14')](_0x5b0909,function(_0x1a94ba){return'\x22'+_0x1a94ba[_0xa308('0x15')][_0xa308('0x16')]+'\x22';}));}logger[_0xa308('0xf')]('Online\x20apps:',_[_0xa308('0x14')](_[_0xa308('0x17')](_0x39b04c,{'status':_0xa308('0x18')}),'name')[_0xa308('0x19')]());logger[_0xa308('0xf')](_0xa308('0x1a'),_[_0xa308('0x14')](_[_0xa308('0x17')](_0x39b04c,function(_0x2e1d96){return _0x2e1d96[_0xa308('0x1b')]!=='online';}),_0xa308('0x16'))[_0xa308('0x19')]()||_0xa308('0x1c'));console[_0xa308('0x1d')](_0xa308('0x1e'));})['catch'](function(_0x46f319){console[_0xa308('0x1d')](_0xa308('0x1f'),_0x46f319);logger[_0xa308('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x46f319);process[_0xa308('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 99bee58..c80a88b 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 _0xb43b=['headers','then','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','find','sub','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','moment','session','role','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarPrefixRequired','phoneBarRemoteControl','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','authorization','startsWith'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4147ac,_0xe0736e){_0x4147ac=_0x4147ac-0x0;var _0x1d622d=_0xb43b[_0x4147ac];return _0x1d622d;};'use strict';var db=require(_0xbb43('0x0'))['db'];var config=require(_0xbb43('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbb43('0x2'));var encryptor=require(_0xbb43('0x3'));var _=require(_0xbb43('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbb43('0x5'));var compose=require(_0xbb43('0x6'));var basicAuth=require(_0xbb43('0x7'));var crypto=require(_0xbb43('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xbb43('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xbb43('0xa')]});var userAttributes=['id',_0xbb43('0xb'),_0xbb43('0xc'),_0xbb43('0xd'),_0xbb43('0xe'),'email',_0xbb43('0xf'),_0xbb43('0x10'),'md5secret',_0xbb43('0x11'),_0xbb43('0x12'),_0xbb43('0x13'),_0xbb43('0x14'),_0xbb43('0x15'),_0xbb43('0x16'),'pauseType',_0xbb43('0x17'),_0xbb43('0x18'),'lastPauseAt','crudPermissions',_0xbb43('0x19'),'passwordResetAt','alias',_0xbb43('0x1a'),'phoneBarAutoAnswerDelay',_0xbb43('0x1b'),_0xbb43('0x1c'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0xbb43('0x1d'),_0xbb43('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xbb43('0x1f'),'userProfileId','privacyEnabled',_0xbb43('0x20'),_0xbb43('0x21'),_0xbb43('0x22'),'downloadOmnichannelInteractions',_0xbb43('0x23'),'ignorePauseForPreviewCalls',_0xbb43('0x24'),_0xbb43('0x25'),'chatAutoanswerDelay','emailAutoanswer',_0xbb43('0x26'),_0xbb43('0x27'),_0xbb43('0x28'),_0xbb43('0x29'),'openchannelAutoanswerDelay',_0xbb43('0x2a'),'faxAutoanswerDelay',_0xbb43('0x2b'),'whatsappAutoanswerDelay'];exports[_0xbb43('0x2c')]=function(){return this['isAuthenticated'](!![])[_0xbb43('0x2d')](function(_0x451cbd,_0x577ddd,_0x1d0768){if(_0x451cbd['user']){_0x1d0768();}else{return db[_0xbb43('0x2e')][_0xbb43('0x2f')]({'where':{'id':_0x451cbd[_0xbb43('0x30')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x269ca5){if(_0x269ca5&&_0x269ca5[_0xbb43('0x31')]){return _0x577ddd['status'](_0x269ca5[_0xbb43('0x32')]===_0xbb43('0x33')?0x195:0x193)[_0xbb43('0x34')]({'message':_0x269ca5[_0xbb43('0x32')]==='unmanaged'?'Unmanaged.':_0xbb43('0x35')});}else{_0x1d0768();}})[_0xbb43('0x36')](function(_0xa88db0){_0x1d0768(_0xa88db0);});}});};exports[_0xbb43('0x37')]=function isAuthenticated(_0x510b05){return compose()[_0xbb43('0x2d')](function(_0x21d386,_0x473828,_0x539730){var _0x2ad6da;if(_0x21d386['headers'][_0xbb43('0x38')]){if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],'Basic')){var _0x157d62=basicAuth(_0x21d386);db['User']['find']({'where':{'name':_0x157d62['name']}})[_0xbb43('0x3b')](function(_0x573a05){if(!_0x573a05||!_0x573a05[_0xbb43('0x3c')](_0x157d62[_0xbb43('0x3d')])){return _0x473828[_0xbb43('0x3e')](0x191)['json']({'message':_0xbb43('0x3f')});}_0x21d386[_0xbb43('0x40')]={'id':_0x573a05['id']};_0x539730();})[_0xbb43('0x36')](function(_0xd987fa){_0x539730(_0xd987fa);});}else if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],_0xbb43('0x41'))){validateJwt(_0x21d386,_0x473828,_0x539730);}else{if(_0x510b05){_0x539730();}else{return _0x473828['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}}}else if(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')]){try{var _0x4015ec={'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf[_0xbb43('0x45')]()};verifyJwt(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')],_0x4015ec)[_0xbb43('0x3b')](function(_0x21346a){return db[_0xbb43('0x46')][_0xbb43('0x47')]({'where':{'id':_0x21346a[_0xbb43('0x48')]}})[_0xbb43('0x3b')](function(_0x405f36){_0x2ad6da=_0x405f36;return db['Setting'][_0xbb43('0x2f')]({'where':{'id':0x1},'attributes':[_0xbb43('0x49'),'blockDuration'],'raw':!![]});})[_0xbb43('0x3b')](function(_0x2c9a7c){if(!_0x2ad6da||!_[_0xbb43('0x4a')](_0x2ad6da['apiKeyNonce'],_0x21346a['nonce'])){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4b')});}if(_0x2ad6da['disabled']){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}if(_0x2ad6da[_0xbb43('0x4d')]){if(_0x2c9a7c[_0xbb43('0x4e')]>0x0){if(moment(_0x2ad6da[_0xbb43('0x4f')])['add'](_0x2c9a7c[_0xbb43('0x4e')],_0xbb43('0x50'))>moment()){return _0x473828[_0xbb43('0x3e')](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}}else{return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x21d386[_0xbb43('0x40')]={'id':_0x2ad6da['id']};_0x539730();});})[_0xbb43('0x36')](function(){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1fcf64){_0x539730(_0x1fcf64);}}else if(_0x510b05){_0x539730();}else{return _0x473828[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}})['use'](function(_0x3e0871,_0x136bd4,_0x59750b){if(_0x3e0871[_0xbb43('0x40')]){db['User'][_0xbb43('0x47')]({'where':{'id':_0x3e0871[_0xbb43('0x40')]['id']},'attributes':userAttributes})[_0xbb43('0x3b')](function(_0x14e57e){if(!_0x14e57e){return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':'User\x20not\x20found.'});}_0x3e0871[_0xbb43('0x40')]=_0x14e57e;_0x59750b();})['catch'](function(_0x307f1e){_0x59750b(_0x307f1e);});}else if(_0x510b05){_0x59750b();}else{return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':_0xbb43('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xbb43('0x2d')](function(_0x39f75f,_0x4bc351,_0x24ba15){return licenseUtil[_0xbb43('0x52')]()[_0xbb43('0x3b')](function(_0x40f519){if(_0x40f519[_0xbb43('0x53')]){_0x24ba15();}else{return _0x4bc351['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x54')});}})['catch'](function(_0x1a66f0){_0x24ba15(_0x1a66f0);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x4d7034,_0x5e2e6d,_0x1c3482){return licenseUtil['getLicense']()[_0xbb43('0x3b')](function(_0x5e5c86){if(_0x5e5c86[_0xbb43('0x55')]){_0x1c3482();}else{return _0x5e2e6d[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':'Forbidden'});}})[_0xbb43('0x36')](function(_0x4d9f18){_0x1c3482(_0x4d9f18);});});};exports[_0xbb43('0x56')]=function(_0x2518bf,_0xd43d24,_0x29840e){_0x2518bf[_0xbb43('0x56')]=!![];return _0x29840e();};exports[_0xbb43('0x57')]=function signToken(_0x37d8d3){return signJwt(_0x37d8d3);};exports['setTokenCookie']=function(_0x93f6e7,_0x26ea59){if(!_0x93f6e7[_0xbb43('0x40')]){return _0x26ea59[_0xbb43('0x3e')](0x194)['json']({'message':_0xbb43('0x58')});}var _0x3233b7={'payload':{'id':_0x93f6e7[_0xbb43('0x40')]['id'],'role':_0x93f6e7[_0xbb43('0x40')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3233b7)[_0xbb43('0x3b')](function(_0x3fdb10){_0x26ea59[_0xbb43('0x59')]('motion.token',_0x3fdb10);_0x26ea59[_0xbb43('0x5a')](_0xbb43('0x5b'));})[_0xbb43('0x36')](function(_0x1dc40a){return _0x26ea59[_0xbb43('0x3e')](0x1f4)['send'](_0x1dc40a);});};exports['retrieveApiKey']=function(_0xb44557){if(_['isNil'](_0xb44557[_0xbb43('0x5c')])||_[_0xbb43('0x5d')](_0xb44557['apiKeyIat'])){return null;}else{return createJwt(_0xb44557);}};exports[_0xbb43('0x5e')]=function(_0x3719dc){_0x3719dc[_0xbb43('0x5c')]=generateNonce();_0x3719dc[_0xbb43('0x5f')]=generateIssuedAt();return createJwt(_0x3719dc);};exports[_0xbb43('0x60')]=function(_0x5cb3c6,_0x124f88){var _0x539ffc=_0x5cb3c6['query'][_0xbb43('0x44')];if(_0x539ffc){var _0x1b9307={'nonce':_0x124f88[_0xbb43('0x5c')],'iat':_0x124f88[_0xbb43('0x5f')],'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x539ffc,_0x1b9307)['then'](function(){return generateApiKey(_0x124f88);});}else{throw{'message':_0xbb43('0x61')};}};exports[_0xbb43('0x62')]=function(_0x3a84ad){var _0x308646=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x308646[_0xbb43('0x63')](_0x3a84ad))throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0xbb43('0x66'));return;};exports[_0xbb43('0x67')]=function(_0x578b85,_0x1b6f96,_0xb996d7){var _0x432bd8=encryptor[_0xbb43('0x68')](_0x1b6f96)[_0xbb43('0x69')](',');for(var _0x1fae27=0x0;_0x1fae27<_0xb996d7;_0x1fae27++){if(!_0x432bd8[_0x1fae27])break;if(_0x578b85[_0xbb43('0x6a')]()===_0x432bd8[_0x1fae27][_0xbb43('0x6a')]()){var _0x3e01e4=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xb996d7);if(_0xb996d7===0x1){_0x3e01e4=_0xbb43('0x6b');}throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0x3e01e4);}}return;};exports[_0xbb43('0x6c')]=function(_0x38814a,_0x19e27e){var _0x2e01fb=_0x19e27e?encryptor['decryptString'](_0x19e27e)[_0xbb43('0x69')](','):[];if(_0x2e01fb['length']===0x5){_0x2e01fb['splice'](-0x1,0x1);}_0x2e01fb[_0xbb43('0x6d')](_0x38814a);return encryptor[_0xbb43('0x6e')](_0x2e01fb[_0xbb43('0x6f')](','));};function signJwt(_0x22ce17){var _0x24393a=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x71')],{'context':jwt});var _0x341481=_0x22ce17['secret']||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0x2b96b8,_0x137e75){_0x24393a(_0x22ce17[_0xbb43('0x72')],_0x341481,_0x22ce17[_0xbb43('0x73')])[_0xbb43('0x3b')](function(_0x12717e){_0x2b96b8(_0x12717e);})[_0xbb43('0x36')](function(_0x3ca6ad){_0x137e75(_0x3ca6ad);});});}function verifyJwt(_0x555426,_0x165936,_0x392d1a){var _0x234bc7=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x74')],{'context':jwt});var _0x33a4db=_0x392d1a||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0xb48be2,_0x42e437){_0x234bc7(_0x555426,_0x33a4db,_0x165936)[_0xbb43('0x3b')](function(_0xc34a02){_0xb48be2(_0xc34a02);})['catch'](function(_0x3c260f){_0x42e437(_0x3c260f);});});}function generateNonce(){return crypto[_0xbb43('0x75')](0x10)[_0xbb43('0x76')](_0xbb43('0x77'));}function generateIssuedAt(){return Math[_0xbb43('0x78')](Date[_0xbb43('0x79')]()/0x3e8)[_0xbb43('0x76')]();}function createJwt(_0x2992ea){var _0x10fd8b={'payload':{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce']},'options':{'algorithm':_0xbb43('0x7a'),'subject':_0x2992ea['id']['toString'](),'issuer':hardwareConf[_0xbb43('0x45')](),'audience':hardwareConf[_0xbb43('0x45')]()}};return signJwt(_0x10fd8b)[_0xbb43('0x3b')](function(_0x3dbcd9){return{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce'],'token':_0x3dbcd9};});} \ No newline at end of file +var _0xf3cd=['role','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','authorization','startsWith','Basic','User','authenticate','catch','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockDuration','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','secrets','session'];(function(_0x2bd428,_0x93b4a6){var _0x58c122=function(_0x51ead8){while(--_0x51ead8){_0x2bd428['push'](_0x2bd428['shift']());}};_0x58c122(++_0x93b4a6);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32bbb1,_0xa0e27e){_0x32bbb1=_0x32bbb1-0x0;var _0x42b415=_0xf3cd[_0x32bbb1];return _0x42b415;};'use strict';var db=require(_0xdf3c('0x0'))['db'];var config=require(_0xdf3c('0x1'));var hardwareConf=require(_0xdf3c('0x2'));var licenseUtil=require(_0xdf3c('0x3'));var encryptor=require(_0xdf3c('0x4'));var _=require(_0xdf3c('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xdf3c('0x6'));var compose=require(_0xdf3c('0x7'));var basicAuth=require(_0xdf3c('0x8'));var crypto=require('crypto');var BPromise=require(_0xdf3c('0x9'));var util=require(_0xdf3c('0xa'));var moment=require(_0xdf3c('0xb'));var validateJwt=expressJwt({'secret':config[_0xdf3c('0xc')][_0xdf3c('0xd')]});var userAttributes=['id',_0xdf3c('0xe'),'fullname',_0xdf3c('0xf'),'internal','email',_0xdf3c('0x10'),_0xdf3c('0x11'),'md5secret',_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14'),_0xdf3c('0x15'),_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),_0xdf3c('0x19'),'lastLoginAt',_0xdf3c('0x1a'),_0xdf3c('0x1b'),_0xdf3c('0x1c'),_0xdf3c('0x1d'),'alias',_0xdf3c('0x1e'),_0xdf3c('0x1f'),_0xdf3c('0x20'),'phoneBarEnableRecording',_0xdf3c('0x21'),_0xdf3c('0x22'),_0xdf3c('0x23'),_0xdf3c('0x24'),_0xdf3c('0x25'),_0xdf3c('0x26'),_0xdf3c('0x27'),_0xdf3c('0x28'),_0xdf3c('0x29'),_0xdf3c('0x2a'),'settingsEnabled',_0xdf3c('0x2b'),_0xdf3c('0x2c'),_0xdf3c('0x2d'),_0xdf3c('0x2e'),_0xdf3c('0x2f'),_0xdf3c('0x30'),_0xdf3c('0x31'),_0xdf3c('0x32'),_0xdf3c('0x33'),_0xdf3c('0x34'),_0xdf3c('0x35'),_0xdf3c('0x36'),_0xdf3c('0x37'),'openchannelAutoanswerDelay','faxAutoanswer',_0xdf3c('0x38'),'whatsappAutoanswer',_0xdf3c('0x39')];exports[_0xdf3c('0x3a')]=function(){return this[_0xdf3c('0x3b')](!![])[_0xdf3c('0x3c')](function(_0x33652f,_0x36ba1c,_0x50d8ca){if(_0x33652f[_0xdf3c('0x3d')]){_0x50d8ca();}else{return db[_0xdf3c('0x3e')][_0xdf3c('0x3f')]({'where':{'id':_0x33652f[_0xdf3c('0x40')]['id']},'attributes':['id',_0xdf3c('0x41'),_0xdf3c('0x42')],'raw':!![]})[_0xdf3c('0x43')](function(_0x155f54){if(_0x155f54&&_0x155f54[_0xdf3c('0x41')]){return _0x36ba1c[_0xdf3c('0x44')](_0x155f54['disposition']===_0xdf3c('0x45')?0x195:0x193)[_0xdf3c('0x46')]({'message':_0x155f54['disposition']===_0xdf3c('0x45')?'Unmanaged.':'Forbidden.'});}else{_0x50d8ca();}})['catch'](function(_0x14aac9){_0x50d8ca(_0x14aac9);});}});};exports[_0xdf3c('0x3b')]=function isAuthenticated(_0x52b8f6){return compose()['use'](function(_0x37ecfd,_0x1f2ce4,_0xd3cfcb){var _0x1ccdd4;if(_0x37ecfd['headers'][_0xdf3c('0x47')]){if(_[_0xdf3c('0x48')](_0x37ecfd['headers']['authorization'],_0xdf3c('0x49'))){var _0x46f0e3=basicAuth(_0x37ecfd);db[_0xdf3c('0x4a')]['find']({'where':{'name':_0x46f0e3[_0xdf3c('0xf')]}})[_0xdf3c('0x43')](function(_0x21e7b8){if(!_0x21e7b8||!_0x21e7b8[_0xdf3c('0x4b')](_0x46f0e3['pass'])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':'Wrong\x20credentials.'});}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x21e7b8['id']};_0xd3cfcb();})[_0xdf3c('0x4c')](function(_0x217a65){_0xd3cfcb(_0x217a65);});}else if(_[_0xdf3c('0x48')](_0x37ecfd['headers'][_0xdf3c('0x47')],_0xdf3c('0x4d'))){validateJwt(_0x37ecfd,_0x1f2ce4,_0xd3cfcb);}else{if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4[_0xdf3c('0x44')](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x37ecfd[_0xdf3c('0x4e')][_0xdf3c('0x4f')]){try{var _0x5ddd21={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};verifyJwt(_0x37ecfd['query'][_0xdf3c('0x4f')],_0x5ddd21)['then'](function(_0x57faba){return db['User'][_0xdf3c('0x51')]({'where':{'id':_0x57faba[_0xdf3c('0x52')]}})[_0xdf3c('0x43')](function(_0x29b5b7){_0x1ccdd4=_0x29b5b7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xdf3c('0x53'),'blockDuration'],'raw':!![]});})[_0xdf3c('0x43')](function(_0x17b502){if(!_0x1ccdd4||!_[_0xdf3c('0x54')](_0x1ccdd4[_0xdf3c('0x55')],_0x57faba[_0xdf3c('0x56')])){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x57')});}if(_0x1ccdd4[_0xdf3c('0x58')]){return _0x1f2ce4['status'](0x191)[_0xdf3c('0x46')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1ccdd4['blocked']){if(_0x17b502[_0xdf3c('0x59')]>0x0){if(moment(_0x1ccdd4['blockedAt'])[_0xdf3c('0x5a')](_0x17b502['blockDuration'],_0xdf3c('0x5b'))>moment()){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}else{return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});}}_0x37ecfd[_0xdf3c('0x3d')]={'id':_0x1ccdd4['id']};_0xd3cfcb();});})[_0xdf3c('0x4c')](function(){return _0x1f2ce4[_0xdf3c('0x44')](0x191)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5c')});});}catch(_0x57e0ab){_0xd3cfcb(_0x57e0ab);}}else if(_0x52b8f6){_0xd3cfcb();}else{return _0x1f2ce4['status'](0x193)[_0xdf3c('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0xdf3c('0x3c')](function(_0x14d8e1,_0x46194d,_0x328b18){if(_0x14d8e1['user']){db['User'][_0xdf3c('0x51')]({'where':{'id':_0x14d8e1[_0xdf3c('0x3d')]['id']},'attributes':userAttributes})[_0xdf3c('0x43')](function(_0x4c59ef){if(!_0x4c59ef){return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5d')});}_0x14d8e1[_0xdf3c('0x3d')]=_0x4c59ef;_0x328b18();})['catch'](function(_0x127685){_0x328b18(_0x127685);});}else if(_0x52b8f6){_0x328b18();}else{return _0x46194d[_0xdf3c('0x44')](0x194)[_0xdf3c('0x46')]({'message':_0xdf3c('0x5e')});}});};exports[_0xdf3c('0x5f')]=function canUpdate(){return compose()['use'](function(_0x410aaf,_0x286b72,_0x437443){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x344f1e){if(_0x344f1e['update']){_0x437443();}else{return _0x286b72['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})['catch'](function(_0x5c9885){_0x437443(_0x5c9885);});});};exports[_0xdf3c('0x62')]=function isWebrtcLicence(){return compose()[_0xdf3c('0x3c')](function(_0x46b2bd,_0x2aeb29,_0xaae4bc){return licenseUtil[_0xdf3c('0x60')]()[_0xdf3c('0x43')](function(_0x84c5c2){if(_0x84c5c2[_0xdf3c('0x63')]){_0xaae4bc();}else{return _0x2aeb29['status'](0x193)[_0xdf3c('0x46')]({'message':_0xdf3c('0x61')});}})[_0xdf3c('0x4c')](function(_0xe760dd){_0xaae4bc(_0xe760dd);});});};exports[_0xdf3c('0x64')]=function(_0x385824,_0x28a468,_0x553f70){_0x385824[_0xdf3c('0x64')]=!![];return _0x553f70();};exports['signToken']=function signToken(_0xa4e137){return signJwt(_0xa4e137);};exports['setTokenCookie']=function(_0x41b78c,_0x28144f){if(!_0x41b78c[_0xdf3c('0x3d')]){return _0x28144f[_0xdf3c('0x44')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4a068a={'payload':{'id':_0x41b78c[_0xdf3c('0x3d')]['id'],'role':_0x41b78c['user'][_0xdf3c('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a068a)[_0xdf3c('0x43')](function(_0x446713){_0x28144f[_0xdf3c('0x65')](_0xdf3c('0x66'),_0x446713);_0x28144f['redirect']('/dashboards/general');})[_0xdf3c('0x4c')](function(_0x27a541){return _0x28144f['status'](0x1f4)[_0xdf3c('0x67')](_0x27a541);});};exports[_0xdf3c('0x68')]=function(_0x168eaf){if(_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x55')])||_[_0xdf3c('0x69')](_0x168eaf[_0xdf3c('0x6a')])){return null;}else{return createJwt(_0x168eaf);}};exports['generateApiKey']=function(_0x4c98dc){_0x4c98dc[_0xdf3c('0x55')]=generateNonce();_0x4c98dc[_0xdf3c('0x6a')]=generateIssuedAt();return createJwt(_0x4c98dc);};exports[_0xdf3c('0x6b')]=function(_0x1ad771,_0x22de6c){var _0x39f38f=_0x1ad771[_0xdf3c('0x4e')][_0xdf3c('0x4f')];if(_0x39f38f){var _0x143d01={'nonce':_0x22de6c[_0xdf3c('0x55')],'iat':_0x22de6c[_0xdf3c('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdf3c('0x50')]()};return verifyJwt(_0x39f38f,_0x143d01)['then'](function(){return generateApiKey(_0x22de6c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x58fcbf){var _0x541c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x541c57[_0xdf3c('0x6c')](_0x58fcbf))throw new db[(_0xdf3c('0x6d'))]['ValidationError'](_0xdf3c('0x6e'));return;};exports[_0xdf3c('0x6f')]=function(_0x51f8dd,_0xa8dddb,_0x28f935){var _0x10e9d5=encryptor[_0xdf3c('0x70')](_0xa8dddb)[_0xdf3c('0x71')](',');for(var _0x28f387=0x0;_0x28f387<_0x28f935;_0x28f387++){if(!_0x10e9d5[_0x28f387])break;if(_0x51f8dd[_0xdf3c('0x72')]()===_0x10e9d5[_0x28f387][_0xdf3c('0x72')]()){var _0x42efa2=util[_0xdf3c('0x73')](_0xdf3c('0x74'),_0x28f935);if(_0x28f935===0x1){_0x42efa2='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xdf3c('0x6d'))][(_0xdf3c('0x75'))](_0x42efa2);}}return;};exports[_0xdf3c('0x76')]=function(_0x5a3d63,_0x245c68){var _0x3e327e=_0x245c68?encryptor[_0xdf3c('0x70')](_0x245c68)['split'](','):[];if(_0x3e327e[_0xdf3c('0x77')]===0x5){_0x3e327e[_0xdf3c('0x78')](-0x1,0x1);}_0x3e327e['unshift'](_0x5a3d63);return encryptor[_0xdf3c('0x79')](_0x3e327e['join'](','));};function signJwt(_0x28c296){var _0x1b03e7=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7b')],{'context':jwt});var _0xed2a78=_0x28c296[_0xdf3c('0x7c')]||config[_0xdf3c('0xc')][_0xdf3c('0xd')];return new BPromise(function(_0x2922d8,_0x330730){_0x1b03e7(_0x28c296[_0xdf3c('0x7d')],_0xed2a78,_0x28c296[_0xdf3c('0x7e')])[_0xdf3c('0x43')](function(_0x206a18){_0x2922d8(_0x206a18);})[_0xdf3c('0x4c')](function(_0xe42432){_0x330730(_0xe42432);});});}function verifyJwt(_0xd7fb2d,_0x510538,_0x4dade5){var _0x2e8511=BPromise[_0xdf3c('0x7a')](jwt[_0xdf3c('0x7f')],{'context':jwt});var _0x596282=_0x4dade5||config[_0xdf3c('0xc')]['session'];return new BPromise(function(_0x574852,_0x184952){_0x2e8511(_0xd7fb2d,_0x596282,_0x510538)[_0xdf3c('0x43')](function(_0x1121b9){_0x574852(_0x1121b9);})[_0xdf3c('0x4c')](function(_0x68f487){_0x184952(_0x68f487);});});}function generateNonce(){return crypto[_0xdf3c('0x80')](0x10)[_0xdf3c('0x81')](_0xdf3c('0x82'));}function generateIssuedAt(){return Math[_0xdf3c('0x83')](Date[_0xdf3c('0x84')]()/0x3e8)[_0xdf3c('0x81')]();}function createJwt(_0x5a2dad){var _0x34000c={'payload':{'iat':_0x5a2dad['apiKeyIat'],'nonce':_0x5a2dad[_0xdf3c('0x55')]},'options':{'algorithm':_0xdf3c('0x85'),'subject':_0x5a2dad['id'][_0xdf3c('0x81')](),'issuer':hardwareConf[_0xdf3c('0x50')](),'audience':hardwareConf[_0xdf3c('0x50')]()}};return signJwt(_0x34000c)['then'](function(_0x18bf4f){return{'iat':_0x5a2dad[_0xdf3c('0x6a')],'nonce':_0x5a2dad[_0xdf3c('0x55')],'token':_0x18bf4f};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 2681db5..d25f496 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7eee=['buildContactsQuery','rows','catch','describe','CmContact','keys','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','./sql-utils','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','user','clause','tags','skip','checkListsRestrictions','ids','countFilteredContacts','count'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x7eee,0xe7));var _0xe7ee=function(_0x9ef465,_0x3ecc6a){_0x9ef465=_0x9ef465-0x0;var _0x4f3727=_0x7eee[_0x9ef465];return _0x4f3727;};'use strict';var _=require(_0xe7ee('0x0'));var sqlUtils=require(_0xe7ee('0x1'));var db=require(_0xe7ee('0x2'))['db'];exports['findAll']=function(_0x25043b,_0x50ebc3,_0x417196,_0x1826da){var _0x35deb2={'count':0x0,'rows':[]};var _0x3d444c=sqlUtils[_0xe7ee('0x3')](_0x50ebc3,_0x25043b);if(_0x3d444c){return Promise[_0xe7ee('0x4')](_0x35deb2);}var _0x38a3c2=sqlUtils[_0xe7ee('0x5')]();var _0x28205c={};var _0x149ccb=![];var _0x1111be=![];return Promise[_0xe7ee('0x4')]()[_0xe7ee('0x6')](function(){if(_0x25043b[_0xe7ee('0x7')]){return sqlUtils[_0xe7ee('0x8')](_0x25043b['search'],_0x1826da);}else{return sqlUtils[_0xe7ee('0x9')](_0x25043b,_0x1826da);}})['then'](function(_0x16821d){_0x38a3c2[_0xe7ee('0xa')](_0x16821d[_0xe7ee('0xb')]);_0x38a3c2[_0xe7ee('0xa')](_0x16821d[_0xe7ee('0xc')]);_0x38a3c2[_0xe7ee('0xa')](_0x16821d['filter']);_0x38a3c2['where'](_0x16821d[_0xe7ee('0xd')][_0xe7ee('0xe')]);_0x28205c=_0x16821d[_0xe7ee('0xf')];_0x1111be=_0x16821d['user'][_0xe7ee('0x10')];return sqlUtils[_0xe7ee('0x11')](_0x50ebc3,_0x25043b,_0x1111be);})['then'](function(_0x1204a5){_0x38a3c2[_0xe7ee('0xa')](_0x1204a5);var _0x3119a8=_0x25043b[_0xe7ee('0x7')]?_0x28205c[_0xe7ee('0x12')]:_0x25043b['tag'];_0x149ccb=_0x3119a8?!![]:![];return sqlUtils[_0xe7ee('0x13')](_0x38a3c2,_0x3119a8);})[_0xe7ee('0x6')](function(_0x57a591){_0x35deb2[_0xe7ee('0x14')]=_0x57a591;if(_0x35deb2['count']===0x0){return;}if(_0x25043b['User']){_0x1111be=!![];}return sqlUtils[_0xe7ee('0x15')](_0x38a3c2,_0x25043b[_0xe7ee('0xc')],_0x417196,_0x149ccb,_0x28205c[_0xe7ee('0xe')],_0x1111be);})[_0xe7ee('0x6')](function(_0x3f39f5){if(!_0x3f39f5){return[];}return sqlUtils['getFilteredContacts'](_0x3f39f5,_0x25043b,_0x417196);})[_0xe7ee('0x6')](function(_0x3262d8){_0x35deb2[_0xe7ee('0x16')]=_0x3262d8;return _0x35deb2;})[_0xe7ee('0x17')](function(_0x1a0d02){throw _0x1a0d02;});};exports[_0xe7ee('0x18')]=function(){var _0x124abf={};var _0x40e1c5=[];return db[_0xe7ee('0x19')][_0xe7ee('0x18')]()[_0xe7ee('0x6')](function(_0x2c116a){_0x124abf=_0x2c116a;var _0x566bad=Object[_0xe7ee('0x1a')](_0x124abf)['filter'](function(_0x5f37cf){return _['startsWith'](_0x5f37cf,_0xe7ee('0x1b'))?_0x5f37cf:undefined;});var _0x59f101=_0x566bad[_0xe7ee('0x1c')](function(_0x371080){return db[_0xe7ee('0x1d')][_0xe7ee('0x1e')]({'where':{'id':_0x371080[_0xe7ee('0x1f')](0x3)},'raw':!![]});});return Promise[_0xe7ee('0x20')](_0x59f101);})[_0xe7ee('0x6')](function(_0x3a5f56){for(var _0x1959d3=0x0;_0x1959d3<_0x3a5f56[_0xe7ee('0x21')];_0x1959d3++){if(_0x3a5f56[_0x1959d3]){var _0x3b7d7e=_0xe7ee('0x1b')+_0x3a5f56[_0x1959d3]['id'];_0x124abf[_0x3b7d7e][_0xe7ee('0x22')]=_0x3a5f56[_0x1959d3][_0xe7ee('0x23')];}}_0x40e1c5=_[_0xe7ee('0x1c')](Object['keys'](_0x124abf),function(_0x16d736){return{'name':_0x16d736,'type':_0x124abf[_0x16d736][_0xe7ee('0x23')]};});return _0x40e1c5;})[_0xe7ee('0x17')](function(_0x269271){throw _0x269271;});}; \ No newline at end of file +var _0xfefc=['buildContactsQuery','getFilteredContacts','rows','catch','keys','startsWith','cf_','map','CmCustomField','findOne','type','lodash','./sql-utils','../../mysqldb','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','User'];(function(_0x1687ea,_0x1d1b87){var _0x43943c=function(_0x37f797){while(--_0x37f797){_0x1687ea['push'](_0x1687ea['shift']());}};_0x43943c(++_0x1d1b87);}(_0xfefc,0xab));var _0xcfef=function(_0xb09707,_0x4ed0fe){_0xb09707=_0xb09707-0x0;var _0x561787=_0xfefc[_0xb09707];return _0x561787;};'use strict';var _=require(_0xcfef('0x0'));var sqlUtils=require(_0xcfef('0x1'));var db=require(_0xcfef('0x2'))['db'];exports['findAll']=function(_0x3c45c6,_0x7d47ae,_0x841df3,_0x4a16fe){var _0x5d1266={'count':0x0,'rows':[]};var _0x3b2b67=sqlUtils['skipContactsQuery'](_0x7d47ae,_0x3c45c6);if(_0x3b2b67){return Promise[_0xcfef('0x3')](_0x5d1266);}var _0x4eb439=sqlUtils[_0xcfef('0x4')]();var _0x323319={};var _0xa854a9=![];var _0x47869c=![];return Promise[_0xcfef('0x3')]()[_0xcfef('0x5')](function(){if(_0x3c45c6[_0xcfef('0x6')]){return sqlUtils[_0xcfef('0x7')](_0x3c45c6['search'],_0x4a16fe);}else{return sqlUtils[_0xcfef('0x8')](_0x3c45c6,_0x4a16fe);}})[_0xcfef('0x5')](function(_0xc4c45){_0x4eb439[_0xcfef('0x9')](_0xc4c45[_0xcfef('0xa')]);_0x4eb439[_0xcfef('0x9')](_0xc4c45[_0xcfef('0xb')]);_0x4eb439[_0xcfef('0x9')](_0xc4c45[_0xcfef('0xc')]);_0x4eb439[_0xcfef('0x9')](_0xc4c45[_0xcfef('0xd')][_0xcfef('0xe')]);_0x323319=_0xc4c45['tags'];_0x47869c=_0xc4c45[_0xcfef('0xd')][_0xcfef('0xf')];return sqlUtils['checkListsRestrictions'](_0x7d47ae,_0x3c45c6,_0x47869c);})[_0xcfef('0x5')](function(_0x209295){_0x4eb439[_0xcfef('0x9')](_0x209295);var _0x486b9c=_0x3c45c6[_0xcfef('0x6')]?_0x323319[_0xcfef('0x10')]:_0x3c45c6[_0xcfef('0x11')];_0xa854a9=_0x486b9c?!![]:![];return sqlUtils[_0xcfef('0x12')](_0x4eb439,_0x486b9c);})['then'](function(_0x180e67){_0x5d1266[_0xcfef('0x13')]=_0x180e67;if(_0x5d1266[_0xcfef('0x13')]===0x0){return;}if(_0x3c45c6[_0xcfef('0x14')]){_0x47869c=!![];}return sqlUtils[_0xcfef('0x15')](_0x4eb439,_0x3c45c6[_0xcfef('0xb')],_0x841df3,_0xa854a9,_0x323319['clause'],_0x47869c);})[_0xcfef('0x5')](function(_0x42ae4d){if(!_0x42ae4d){return[];}return sqlUtils[_0xcfef('0x16')](_0x42ae4d,_0x3c45c6,_0x841df3);})['then'](function(_0x4abec4){_0x5d1266[_0xcfef('0x17')]=_0x4abec4;return _0x5d1266;})[_0xcfef('0x18')](function(_0x339398){throw _0x339398;});};exports['describe']=function(){var _0x422d32={};var _0x189579=[];return db['CmContact']['describe']()[_0xcfef('0x5')](function(_0x5d726a){_0x422d32=_0x5d726a;var _0x209687=Object[_0xcfef('0x19')](_0x422d32)[_0xcfef('0xc')](function(_0x1592d4){return _[_0xcfef('0x1a')](_0x1592d4,_0xcfef('0x1b'))?_0x1592d4:undefined;});var _0xbe11ae=_0x209687[_0xcfef('0x1c')](function(_0x5e3d6b){return db[_0xcfef('0x1d')][_0xcfef('0x1e')]({'where':{'id':_0x5e3d6b['slice'](0x3)},'raw':!![]});});return Promise['all'](_0xbe11ae);})['then'](function(_0x5c2923){for(var _0x238d74=0x0;_0x238d74<_0x5c2923['length'];_0x238d74++){if(_0x5c2923[_0x238d74]){var _0x288c0a=_0xcfef('0x1b')+_0x5c2923[_0x238d74]['id'];_0x422d32[_0x288c0a]['fieldType']=_0x5c2923[_0x238d74]['type'];}}_0x189579=_[_0xcfef('0x1c')](Object[_0xcfef('0x19')](_0x422d32),function(_0x10dd01){return{'name':_0x10dd01,'type':_0x422d32[_0x10dd01][_0xcfef('0x1f')]};});return _0x189579;})[_0xcfef('0x18')](function(_0x4ad35a){throw _0x4ad35a;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index d301540..c3093a4 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7942=['search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','fax','email','deletedAt','TagIds','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','sqlOperator','length','conditions','name','dateOfBirth','fieldType','castTo','DATE','buildExpression','type','default','value','end','map','tags','clause','user','and','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','User','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','select','c.id','limit','offset','group','having','order','DESC','findAll','Sequelize','QueryTypes','sequelize','Tags','clone','COUNT(*)','isEmpty','SELECT','query','toString','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb'];(function(_0x15fc07,_0x41cc0c){var _0x3d2c0f=function(_0x2a9a17){while(--_0x2a9a17){_0x15fc07['push'](_0x15fc07['shift']());}};_0x3d2c0f(++_0x41cc0c);}(_0x7942,0xc8));var _0x2794=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x7942[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x2794('0x0'));var squel=require(_0x2794('0x1'));var as=require(_0x2794('0x2'));var qs=require(_0x2794('0x3'));var utils=require(_0x2794('0x4'));var db=require(_0x2794('0x5'))['db'];function skipContactsQuery(_0x55a04d,_0x4fe792){var _0x5903f2=![];if(_0x55a04d['role']==='agent'&&!_0x4fe792[_0x2794('0x6')]&&!_0x4fe792[_0x2794('0x7')]&&_0x4fe792[_0x2794('0x8')]!==_0x2794('0x9')){_0x5903f2=!![];}return _0x5903f2;}function getContactsSubquery(){return squel['select']()[_0x2794('0xa')]('cm_contacts','c')[_0x2794('0xb')](_0x2794('0xc'));}function applyJoinClauses(_0x4a0743,_0x57059a){var _0x24ee49=_0x57059a?'c':_0x2794('0xd');_0x4a0743['left_join'](_0x2794('0xe'),'uc',_0x2794('0xf')+_0x24ee49+_0x2794('0x10'))[_0x2794('0x11')](_0x2794('0x12'),'ct',_0x2794('0x13')+_0x24ee49+'.id')[_0x2794('0x11')](_0x2794('0x14'),'t',_0x2794('0x15'));return _0x4a0743;}function addFieldsToQuery(_0x1ffdfd,_0x2afeff,_0x175af6,_0x42eb74,_0x1136db){var _0x1005f7=_0x1136db?'c':_0x2794('0xd');if(!_0x2afeff){_0x2afeff=['id',_0x2794('0x16'),'lastName','phone','mobile',_0x2794('0x17'),_0x2794('0x18'),_0x2794('0x7'),'CompanyId','createdAt','updatedAt',_0x2794('0x19'),_0x2794('0x1a')];}else if(!_0x2afeff['includes']('id')){_0x2afeff[_0x2794('0x1b')]('id');}var _0x5a46c4=_0x175af6&&_0x1136db||!_0x175af6&&!_0x1136db;if(_0x42eb74){_0x5a46c4=_0x42eb74&&_0x1136db||!_0x42eb74&&!_0x1136db;}_0x2afeff[_0x2794('0x1c')](function(_0x3b47d7){if(_0x3b47d7===_0x2794('0x1a')){if(_0x5a46c4){_0x1ffdfd[_0x2794('0x1d')](_0x2794('0x1e'),_0x3b47d7);}else if(_0x175af6||_0x42eb74){_0x1ffdfd['field'](_0x1005f7+'.'+_0x3b47d7);}}else{_0x1ffdfd['field'](_0x1005f7+'.'+_0x3b47d7);}});return _0x1ffdfd;}function getSqlClauses(){var _0x1a2fc3={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x2794('0x1f')](),'tags':{'clause':squel[_0x2794('0x1f')](),'ids':null},'user':{'clause':squel[_0x2794('0x1f')](),'skip':![]}};return _0x1a2fc3;}function parseTagParameter(_0x29a402){var _0x4a11d0=squel['expr']();if(_0x29a402){var _0xc6f05c=utils[_0x2794('0x20')](_0x29a402);_0xc6f05c[_0x2794('0x1c')](function(_0x5693fc){_0x4a11d0['or'](_0x2794('0x21'),'%,'+_0x5693fc+',%');});}return _0x4a11d0;}function parseSearchFilter(_0x2499d5){var _0x4cd8bf=squel[_0x2794('0x1f')]();if(_0x2499d5){var _0x234fcf=_0x2499d5['replace']('\x5c','\x5c\x5c')[_0x2794('0x22')](/'/g,'\x27\x27');if(_0x234fcf[_0x2794('0x23')]('\x20')['length']>0x1){_0x4cd8bf['or'](_0x2794('0x24'),qs[_0x2794('0x25')](_0x234fcf,!![]),null);}else{if(qs[_0x2794('0x26')](_0x234fcf)){_0x4cd8bf['or'](_0x2794('0x27'),_0x234fcf+'%');_0x4cd8bf['or'](_0x2794('0x28'),_0x234fcf+'%');_0x4cd8bf['or'](_0x2794('0x29'),_0x234fcf+'%');_0x4cd8bf['or'](_0x2794('0x2a'),_0x234fcf+'%');}else if(qs[_0x2794('0x2b')](_0x234fcf)){_0x4cd8bf['or'](_0x2794('0x2c'),_0x234fcf+'%');}else{_0x4cd8bf['or']('c.firstName\x20LIKE\x20?','%'+_0x234fcf+'%');_0x4cd8bf['or']('c.lastName\x20LIKE\x20?','%'+_0x234fcf+'%');_0x4cd8bf['or'](_0x2794('0x2c'),'%'+_0x234fcf+'%');}}}return _0x4cd8bf;}function parseAdvancedSearchFilter(_0x16272d,_0xcca704){var _0x5c10f4=getSqlClauses();var _0x1349a6=as[_0x2794('0x2d')](_0x16272d);var _0x4933ec=_0x1349a6[_0x2794('0x2e')];for(var _0x46f85e=0x0;_0x46f85e<_0x1349a6['conditions'][_0x2794('0x2f')];_0x46f85e++){var _0x222a85=_0x1349a6[_0x2794('0x30')][_0x46f85e];var _0x5713fc='c';var _0x430c59=_['find'](_0xcca704,[_0x2794('0x31'),_0x222a85['field']]);if(_0x430c59){if(_0x222a85[_0x2794('0x1d')]===_0x2794('0x32')||_0x430c59[_0x2794('0x33')]==='datetime'){_0x222a85[_0x2794('0x34')]=_0x2794('0x35');}var _0x7dba68=as[_0x2794('0x36')](_0x5713fc,_0x430c59[_0x2794('0x37')],_0x222a85);_0x5c10f4[_0x2794('0x38')][_0x4933ec](_0x7dba68['text'],_0x7dba68[_0x2794('0x39')]['start'],_0x7dba68[_0x2794('0x39')][_0x2794('0x3a')]);}else{if(_0x222a85['field']==='Tag'){var _0x15b994=_0x222a85[_0x2794('0x39')]['split'](',')[_0x2794('0x3b')](function(_0x53e4a0){return Number(_0x53e4a0);});var _0x4f2ec2=parseTagParameter(_0x15b994);_0x5c10f4[_0x2794('0x3c')][_0x2794('0x3d')]['and'](_0x4f2ec2);_0x5c10f4[_0x2794('0x3c')]['ids']=_0x15b994;}else if(_0x222a85[_0x2794('0x1d')]==='User'){_0x5c10f4[_0x2794('0x3e')][_0x2794('0x3d')][_0x2794('0x3f')](_0x2794('0x40'),_0x222a85[_0x2794('0x39')]);_0x5c10f4[_0x2794('0x3e')][_0x2794('0x41')]=!![];}}}return _0x5c10f4;}function parseModelFields(_0x412be8,_0x504cf0){var _0x328329=squel[_0x2794('0x1f')]();var _0x552d78=_(_0x412be8)[_0x2794('0x42')]()[_0x2794('0x3b')](function(_0x21fe21){return _[_0x2794('0x43')](_0x504cf0,[_0x2794('0x31'),_0x21fe21])?_0x21fe21:undefined;})[_0x2794('0x44')]()[_0x2794('0x39')]();if(_0x412be8[_0x2794('0x45')]){_0x552d78['push']('Contact');}if(_0x412be8['User']){_0x552d78[_0x2794('0x1b')](_0x2794('0x46'));}if(_0x552d78[_0x2794('0x2f')]>0x0){_0x552d78[_0x2794('0x1c')](function(_0x2098c6){if(_0x2098c6===_0x2794('0x7')){_0x328329[_0x2794('0x3f')]('c.ListId\x20IN\x20?',[][_0x2794('0x47')](_0x412be8[_0x2098c6]));}else if(_0x2098c6===_0x2794('0x45')){var _0x141ded='%'+_0x412be8[_0x2098c6]+'%';_0x328329[_0x2794('0x3f')](_0x2794('0x48'),_0x141ded);}else if(_0x2098c6==='User'){_0x328329[_0x2794('0x3f')](_0x2794('0x40'),_0x412be8[_0x2098c6]);}else{_0x328329[_0x2794('0x3f')]('c.'+_0x2098c6+_0x2794('0x49'),_0x412be8[_0x2098c6]);}});}return _0x328329;}function parseQueryParameters(_0x4cb09c,_0x3eac04){var _0x3d3c34=getSqlClauses();return Promise[_0x2794('0x4a')]()[_0x2794('0x4b')](function(){return parseModelFields(_0x4cb09c,_0x3eac04);})[_0x2794('0x4b')](function(_0x417854){_0x3d3c34[_0x2794('0x4c')]['and'](_0x417854);return parseTagParameter(_0x4cb09c[_0x2794('0x4d')]);})['then'](function(_0x5113c4){_0x3d3c34['tags'][_0x2794('0x3d')][_0x2794('0x3f')](_0x5113c4);return parseSearchFilter(_0x4cb09c[_0x2794('0x4e')]);})[_0x2794('0x4b')](function(_0x5f0ce3){_0x3d3c34[_0x2794('0x4e')]=_0x5f0ce3;return _0x3d3c34;});}function checkListsRestrictions(_0x1b64de,_0x33f8dd,_0x47aee8){var _0xa4e7b0=squel[_0x2794('0x1f')]();return Promise[_0x2794('0x4a')]()[_0x2794('0x4b')](function(){if(_0x33f8dd[_0x2794('0x6')]&&_0x1b64de['role']==='agent'&&!_0x47aee8){return _0x1b64de[_0x2794('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0x2794('0x4b')](function(_0x18f399){if(_0x18f399){if(_0x18f399[_0x2794('0x2f')]===0x0){_0xa4e7b0[_0x2794('0x3f')](_0x2794('0x50'));}else{_0xa4e7b0[_0x2794('0x3f')](_0x2794('0x51'),_['map'](_0x18f399,'id'));}}})['then'](function(){return _0xa4e7b0;});}function buildContactsQuery(_0x35d3ce,_0x40bb1b,_0x1a383f,_0x1f5419,_0x2be286,_0x19b516){if(_0x40bb1b){_0x40bb1b=_0x1a383f[_0x2794('0x52')];}_0x35d3ce=addFieldsToQuery(_0x35d3ce,_0x40bb1b,_0x1f5419,_0x19b516,!![]);var _0x1441f1=squel[_0x2794('0x53')]();_0x1441f1=addFieldsToQuery(_0x1441f1,_0x40bb1b,_0x1f5419,_0x19b516,![]);if(_0x1f5419||_0x19b516){_0x35d3ce=applyJoinClauses(_0x35d3ce,!![]);_0x35d3ce['group'](_0x2794('0x54'));if(_0x1a383f[_0x2794('0x55')]){_0x1441f1[_0x2794('0x55')](_0x1a383f['limit']);}if(_0x1a383f[_0x2794('0x56')]){_0x1441f1[_0x2794('0x56')](_0x1a383f['offset']);}}else{_0x1441f1=applyJoinClauses(_0x1441f1,![]);_0x1441f1[_0x2794('0x57')]('subqry.id');if(_0x1a383f[_0x2794('0x55')]){_0x35d3ce[_0x2794('0x55')](_0x1a383f['limit']);}if(_0x1a383f[_0x2794('0x56')]){_0x35d3ce['offset'](_0x1a383f['offset']);}}_0x1441f1[_0x2794('0x58')](_0x2be286);if(_0x1a383f[_0x2794('0x59')]){_0x1a383f['order'][_0x2794('0x1c')](function(_0xdb0245){_0x35d3ce[_0x2794('0x59')]('c.'+_0xdb0245[0x0],_0xdb0245[0x1]===_0x2794('0x5a')?![]:!![]);_0x1441f1[_0x2794('0x59')]('subqry.'+_0xdb0245[0x0],_0xdb0245[0x1]===_0x2794('0x5a')?![]:!![]);});}_0x1441f1[_0x2794('0xa')](_0x35d3ce,_0x2794('0xd'));return _0x1441f1;}function getFilteredContacts(_0x926de6){var _0x5466fc=[];return db['Tag'][_0x2794('0x5b')]({'attributes':['id','name','color'],'raw':!![]})[_0x2794('0x4b')](function(_0xce8794){_0x5466fc=_['keyBy'](_0xce8794,'id');var _0x5f1001={'type':db[_0x2794('0x5c')][_0x2794('0x5d')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x2794('0x5e')]['query'](_0x926de6['toString'](),_0x5f1001);})[_0x2794('0x4b')](function(_0x2f2705){_0x2f2705[_0x2794('0x1c')](function(_0x586122){if(_0x586122[_0x2794('0x1a')]){_0x586122['Tags']=[];_0x586122['TagIds'][_0x2794('0x23')](',')[_0x2794('0x1c')](function(_0x4374aa){_0x586122[_0x2794('0x5f')]['push'](_0x5466fc[_0x4374aa]);});}delete _0x586122[_0x2794('0x1a')];});return _0x2f2705;});}function countFilteredContacts(_0x24b512,_0xacd67){var _0xb16521=_0x24b512[_0x2794('0x60')]();_0xb16521[_0x2794('0x1d')](_0x2794('0x61'));_0xb16521=applyJoinClauses(_0xb16521,!![]);_0x24b512['group'](_0x2794('0x54'));var _0x1a16d9=utils[_0x2794('0x20')](_0xacd67);if(!_[_0x2794('0x62')](_0x1a16d9)){_0xb16521[_0x2794('0xb')]('t.id\x20IN\x20?',_0x1a16d9);}var _0x216be8={'type':db['Sequelize'][_0x2794('0x5d')][_0x2794('0x63')],'raw':!![]};return db['sequelize'][_0x2794('0x64')](_0xb16521[_0x2794('0x65')](),_0x216be8)['then'](function(_0xb861fd){return _0xb861fd[0x0][_0x2794('0x61')];});}module[_0x2794('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x8b33=['length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','start','value','end','Tag','map','and','tags','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','forEach','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','clause','filter','role','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','Tags','clone','isEmpty','t.id\x20IN\x20?','query','COUNT(*)','lodash','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','updatedAt','TagIds','push','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split'];(function(_0x25b990,_0x3868d4){var _0x4baf62=function(_0x497de9){while(--_0x497de9){_0x25b990['push'](_0x25b990['shift']());}};_0x4baf62(++_0x3868d4);}(_0x8b33,0x12a));var _0x38b3=function(_0x12aa54,_0x4598a4){_0x12aa54=_0x12aa54-0x0;var _0x5ea365=_0x8b33[_0x12aa54];return _0x5ea365;};'use strict';var _=require(_0x38b3('0x0'));var squel=require('squel');var as=require(_0x38b3('0x1'));var qs=require(_0x38b3('0x2'));var utils=require(_0x38b3('0x3'));var db=require(_0x38b3('0x4'))['db'];function skipContactsQuery(_0x2f6489,_0x47392b){var _0x43c653=![];if(_0x2f6489['role']==='agent'&&!_0x47392b[_0x38b3('0x5')]&&!_0x47392b[_0x38b3('0x6')]&&_0x47392b[_0x38b3('0x7')]!==_0x38b3('0x8')){_0x43c653=!![];}return _0x43c653;}function getContactsSubquery(){return squel[_0x38b3('0x9')]()[_0x38b3('0xa')](_0x38b3('0xb'),'c')[_0x38b3('0xc')](_0x38b3('0xd'));}function applyJoinClauses(_0x383498,_0x408d80){var _0x24deba=_0x408d80?'c':_0x38b3('0xe');_0x383498[_0x38b3('0xf')](_0x38b3('0x10'),'uc',_0x38b3('0x11')+_0x24deba+_0x38b3('0x12'))[_0x38b3('0xf')]('cm_contact_has_tags','ct',_0x38b3('0x13')+_0x24deba+'.id')[_0x38b3('0xf')](_0x38b3('0x14'),'t',_0x38b3('0x15'));return _0x383498;}function addFieldsToQuery(_0x157706,_0x56e429,_0x3ccca6,_0x54135a,_0x201298){var _0x4777a0=_0x201298?'c':_0x38b3('0xe');if(!_0x56e429){_0x56e429=['id','firstName',_0x38b3('0x16'),_0x38b3('0x17'),_0x38b3('0x18'),_0x38b3('0x19'),_0x38b3('0x1a'),_0x38b3('0x6'),_0x38b3('0x1b'),'createdAt',_0x38b3('0x1c'),'deletedAt',_0x38b3('0x1d')];}else if(!_0x56e429['includes']('id')){_0x56e429[_0x38b3('0x1e')]('id');}var _0x115075=_0x3ccca6&&_0x201298||!_0x3ccca6&&!_0x201298;if(_0x54135a){_0x115075=_0x54135a&&_0x201298||!_0x54135a&&!_0x201298;}_0x56e429['forEach'](function(_0x3363db){if(_0x3363db===_0x38b3('0x1d')){if(_0x115075){_0x157706['field'](_0x38b3('0x1f'),_0x3363db);}else if(_0x3ccca6||_0x54135a){_0x157706[_0x38b3('0x20')](_0x4777a0+'.'+_0x3363db);}}else{_0x157706['field'](_0x4777a0+'.'+_0x3363db);}});return _0x157706;}function getSqlClauses(){var _0x2255b6={'default':squel[_0x38b3('0x21')](),'fields':squel[_0x38b3('0x21')](),'filter':squel[_0x38b3('0x21')](),'tags':{'clause':squel[_0x38b3('0x21')](),'ids':null},'user':{'clause':squel[_0x38b3('0x21')](),'skip':![]}};return _0x2255b6;}function parseTagParameter(_0x17cfb8){var _0x4af93e=squel[_0x38b3('0x21')]();if(_0x17cfb8){var _0x455a9d=utils[_0x38b3('0x22')](_0x17cfb8);_0x455a9d['forEach'](function(_0x3e1b11){_0x4af93e['or'](_0x38b3('0x23'),'%,'+_0x3e1b11+',%');});}return _0x4af93e;}function parseSearchFilter(_0x195de6){var _0x4e2475=squel[_0x38b3('0x21')]();if(_0x195de6){var _0x3c464f=_0x195de6['replace']('\x5c','\x5c\x5c')[_0x38b3('0x24')](/'/g,'\x27\x27');if(_0x3c464f[_0x38b3('0x25')]('\x20')[_0x38b3('0x26')]>0x1){_0x4e2475['or'](_0x38b3('0x27'),qs[_0x38b3('0x28')](_0x3c464f,!![]),null);}else{if(qs[_0x38b3('0x29')](_0x3c464f)){_0x4e2475['or'](_0x38b3('0x2a'),_0x3c464f+'%');_0x4e2475['or'](_0x38b3('0x2b'),_0x3c464f+'%');_0x4e2475['or']('c.mobile\x20LIKE\x20?',_0x3c464f+'%');_0x4e2475['or'](_0x38b3('0x2c'),_0x3c464f+'%');}else if(qs[_0x38b3('0x2d')](_0x3c464f)){_0x4e2475['or'](_0x38b3('0x2e'),_0x3c464f+'%');}else{_0x4e2475['or'](_0x38b3('0x2f'),'%'+_0x3c464f+'%');_0x4e2475['or'](_0x38b3('0x30'),'%'+_0x3c464f+'%');_0x4e2475['or'](_0x38b3('0x2e'),'%'+_0x3c464f+'%');}}}return _0x4e2475;}function parseAdvancedSearchFilter(_0x4db6d5,_0xe51a11){var _0x321a70=getSqlClauses();var _0x10afce=as['parseSearch'](_0x4db6d5);var _0x424a67=_0x10afce[_0x38b3('0x31')];for(var _0x552c4f=0x0;_0x552c4f<_0x10afce[_0x38b3('0x32')][_0x38b3('0x26')];_0x552c4f++){var _0x242abf=_0x10afce[_0x38b3('0x32')][_0x552c4f];var _0x4c54f7='c';var _0x55f0ca=_['find'](_0xe51a11,[_0x38b3('0x33'),_0x242abf[_0x38b3('0x20')]]);if(_0x55f0ca){if(_0x242abf[_0x38b3('0x20')]===_0x38b3('0x34')||_0x55f0ca[_0x38b3('0x35')]===_0x38b3('0x36')){_0x242abf[_0x38b3('0x37')]=_0x38b3('0x38');}var _0x25afc7=as[_0x38b3('0x39')](_0x4c54f7,_0x55f0ca[_0x38b3('0x3a')],_0x242abf);_0x321a70[_0x38b3('0x3b')][_0x424a67](_0x25afc7['text'],_0x25afc7['value'][_0x38b3('0x3c')],_0x25afc7[_0x38b3('0x3d')][_0x38b3('0x3e')]);}else{if(_0x242abf[_0x38b3('0x20')]===_0x38b3('0x3f')){var _0x53d8ea=_0x242abf[_0x38b3('0x3d')][_0x38b3('0x25')](',')[_0x38b3('0x40')](function(_0x560af9){return Number(_0x560af9);});var _0x1c75b3=parseTagParameter(_0x53d8ea);_0x321a70['tags']['clause'][_0x38b3('0x41')](_0x1c75b3);_0x321a70[_0x38b3('0x42')][_0x38b3('0x43')]=_0x53d8ea;}else if(_0x242abf['field']===_0x38b3('0x44')){_0x321a70[_0x38b3('0x45')]['clause'][_0x38b3('0x41')](_0x38b3('0x46'),_0x242abf[_0x38b3('0x3d')]);_0x321a70[_0x38b3('0x45')][_0x38b3('0x47')]=!![];}}}return _0x321a70;}function parseModelFields(_0x38405e,_0x2dc513){var _0x26879f=squel[_0x38b3('0x21')]();var _0x536fee=_(_0x38405e)[_0x38b3('0x48')]()[_0x38b3('0x40')](function(_0x20ef60){return _[_0x38b3('0x49')](_0x2dc513,[_0x38b3('0x33'),_0x20ef60])?_0x20ef60:undefined;})[_0x38b3('0x4a')]()[_0x38b3('0x3d')]();if(_0x38405e[_0x38b3('0x4b')]){_0x536fee[_0x38b3('0x1e')](_0x38b3('0x4b'));}if(_0x38405e[_0x38b3('0x44')]){_0x536fee[_0x38b3('0x1e')](_0x38b3('0x44'));}if(_0x536fee[_0x38b3('0x26')]>0x0){_0x536fee[_0x38b3('0x4c')](function(_0x3230cc){if(_0x3230cc==='ListId'){_0x26879f['and'](_0x38b3('0x4d'),[][_0x38b3('0x4e')](_0x38405e[_0x3230cc]));}else if(_0x3230cc===_0x38b3('0x4b')){var _0x48910b='%'+_0x38405e[_0x3230cc]+'%';_0x26879f[_0x38b3('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x48910b);}else if(_0x3230cc===_0x38b3('0x44')){_0x26879f[_0x38b3('0x41')](_0x38b3('0x46'),_0x38405e[_0x3230cc]);}else{_0x26879f['and']('c.'+_0x3230cc+_0x38b3('0x4f'),_0x38405e[_0x3230cc]);}});}return _0x26879f;}function parseQueryParameters(_0xca7a04,_0x59354c){var _0x42e003=getSqlClauses();return Promise[_0x38b3('0x50')]()[_0x38b3('0x51')](function(){return parseModelFields(_0xca7a04,_0x59354c);})['then'](function(_0x4b4ec6){_0x42e003[_0x38b3('0x52')]['and'](_0x4b4ec6);return parseTagParameter(_0xca7a04[_0x38b3('0x53')]);})[_0x38b3('0x51')](function(_0x563071){_0x42e003['tags'][_0x38b3('0x54')][_0x38b3('0x41')](_0x563071);return parseSearchFilter(_0xca7a04['filter']);})['then'](function(_0x215f26){_0x42e003[_0x38b3('0x55')]=_0x215f26;return _0x42e003;});}function checkListsRestrictions(_0x554bfa,_0x52a883,_0x17a8b9){var _0x115506=squel[_0x38b3('0x21')]();return Promise[_0x38b3('0x50')]()[_0x38b3('0x51')](function(){if(_0x52a883[_0x38b3('0x5')]&&_0x554bfa[_0x38b3('0x56')]==='agent'&&!_0x17a8b9){return _0x554bfa[_0x38b3('0x57')]({'attributes':['id'],'raw':!![]});}})[_0x38b3('0x51')](function(_0x5dc9d4){if(_0x5dc9d4){if(_0x5dc9d4[_0x38b3('0x26')]===0x0){_0x115506[_0x38b3('0x41')](_0x38b3('0x58'));}else{_0x115506[_0x38b3('0x41')](_0x38b3('0x4d'),_[_0x38b3('0x40')](_0x5dc9d4,'id'));}}})[_0x38b3('0x51')](function(){return _0x115506;});}function buildContactsQuery(_0x3f5c8c,_0x4900a0,_0x31b0c1,_0x410dbb,_0x1c58a4,_0xcf70dc){if(_0x4900a0){_0x4900a0=_0x31b0c1[_0x38b3('0x59')];}_0x3f5c8c=addFieldsToQuery(_0x3f5c8c,_0x4900a0,_0x410dbb,_0xcf70dc,!![]);var _0x26270a=squel[_0x38b3('0x9')]();_0x26270a=addFieldsToQuery(_0x26270a,_0x4900a0,_0x410dbb,_0xcf70dc,![]);if(_0x410dbb||_0xcf70dc){_0x3f5c8c=applyJoinClauses(_0x3f5c8c,!![]);_0x3f5c8c[_0x38b3('0x5a')](_0x38b3('0x5b'));if(_0x31b0c1[_0x38b3('0x5c')]){_0x26270a['limit'](_0x31b0c1[_0x38b3('0x5c')]);}if(_0x31b0c1[_0x38b3('0x5d')]){_0x26270a[_0x38b3('0x5d')](_0x31b0c1['offset']);}}else{_0x26270a=applyJoinClauses(_0x26270a,![]);_0x26270a[_0x38b3('0x5a')](_0x38b3('0x5e'));if(_0x31b0c1[_0x38b3('0x5c')]){_0x3f5c8c[_0x38b3('0x5c')](_0x31b0c1['limit']);}if(_0x31b0c1['offset']){_0x3f5c8c[_0x38b3('0x5d')](_0x31b0c1[_0x38b3('0x5d')]);}}_0x26270a[_0x38b3('0x5f')](_0x1c58a4);if(_0x31b0c1['order']){_0x31b0c1[_0x38b3('0x60')][_0x38b3('0x4c')](function(_0x11d8db){_0x3f5c8c[_0x38b3('0x60')]('c.'+_0x11d8db[0x0],_0x11d8db[0x1]===_0x38b3('0x61')?![]:!![]);_0x26270a[_0x38b3('0x60')](_0x38b3('0x62')+_0x11d8db[0x0],_0x11d8db[0x1]===_0x38b3('0x61')?![]:!![]);});}_0x26270a[_0x38b3('0xa')](_0x3f5c8c,_0x38b3('0xe'));return _0x26270a;}function getFilteredContacts(_0x58f48b){var _0x3e29fa=[];return db['Tag'][_0x38b3('0x63')]({'attributes':['id','name',_0x38b3('0x64')],'raw':!![]})[_0x38b3('0x51')](function(_0x1c902c){_0x3e29fa=_[_0x38b3('0x65')](_0x1c902c,'id');var _0x4d4452={'type':db[_0x38b3('0x66')][_0x38b3('0x67')]['SELECT'],'model':db[_0x38b3('0x68')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x38b3('0x69')]['query'](_0x58f48b['toString'](),_0x4d4452);})[_0x38b3('0x51')](function(_0x231c49){_0x231c49['forEach'](function(_0x2b5403){if(_0x2b5403[_0x38b3('0x1d')]){_0x2b5403[_0x38b3('0x6a')]=[];_0x2b5403[_0x38b3('0x1d')][_0x38b3('0x25')](',')[_0x38b3('0x4c')](function(_0x480e45){_0x2b5403[_0x38b3('0x6a')][_0x38b3('0x1e')](_0x3e29fa[_0x480e45]);});}delete _0x2b5403['TagIds'];});return _0x231c49;});}function countFilteredContacts(_0x9ebcd6,_0x3e54e4){var _0x304e4d=_0x9ebcd6[_0x38b3('0x6b')]();_0x304e4d[_0x38b3('0x20')]('COUNT(*)');_0x304e4d=applyJoinClauses(_0x304e4d,!![]);_0x9ebcd6['group']('c.id');var _0x1d23c7=utils['getSelectedTags'](_0x3e54e4);if(!_[_0x38b3('0x6c')](_0x1d23c7)){_0x304e4d[_0x38b3('0xc')](_0x38b3('0x6d'),_0x1d23c7);}var _0x3a961a={'type':db[_0x38b3('0x66')]['QueryTypes']['SELECT'],'raw':!![]};return db[_0x38b3('0x69')][_0x38b3('0x6e')](_0x304e4d['toString'](),_0x3a961a)[_0x38b3('0x51')](function(_0xf3993a){return _0xf3993a[0x0][_0x38b3('0x6f')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index ce7faa2..e0f077a 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 _0x784c=['decryptString','createDecipher','utf8','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:','test','getCiphers','filter','hasOwnProperty','createReadStream','createWriteStream','data','write','end','binary','close','unlink','decryptFile','update','final','encryptString','secret','createCipher','base64'];(function(_0x23d35d,_0x39c88e){var _0x15e742=function(_0x207d62){while(--_0x207d62){_0x23d35d['push'](_0x23d35d['shift']());}};_0x15e742(++_0x39c88e);}(_0x784c,0x113));var _0xc784=function(_0x3ef7f8,_0x26db34){_0x3ef7f8=_0x3ef7f8-0x0;var _0xd7ab16=_0x784c[_0x3ef7f8];return _0xd7ab16;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0xc784('0x0'));var _=require('lodash');var config=require(_0xc784('0x1'));var logger=require(_0xc784('0x2'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc784('0x3')][_0xc784('0x4')],'algorithm':_0xc784('0x5')};const fileOptions={'algorithm':_0xc784('0x6')};if(config[_0xc784('0x7')]&&config['encrypt'][_0xc784('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xc784('0x8')]);if(isSupported){fileOptions[_0xc784('0x8')]=config[_0xc784('0x7')][_0xc784('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc784('0x9')](',\x20');logger[_0xc784('0xa')](config[_0xc784('0x7')][_0xc784('0x8')],_0xc784('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x198fae){return AES_SUPPORTED_RX[_0xc784('0xc')](_0x198fae);}function getSupportedCiphers(){return crypto[_0xc784('0xd')]()[_0xc784('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2ea0c8){return getSupportedCiphers()['indexOf'](_0x2ea0c8)>-0x1;}function combineOptions(_0x28946d){var _0x224f26={};for(var _0x3afa1b in fileOptions){if(fileOptions[_0xc784('0xf')](_0x3afa1b)){_0x224f26[_0x3afa1b]=fileOptions[_0x3afa1b];}}if(_0x28946d){for(var _0x18e608 in _0x28946d){if(_0x28946d['hasOwnProperty'](_0x18e608)){_0x224f26[_0x18e608]=_0x28946d[_0x18e608];}}}return _0x224f26;}exports['encryptFile']=function(_0x40cb3e,_0xa7be03,_0x2833cd,_0x221e7a){return new BPromise(function(_0x2d9fef,_0x50924b){_0x221e7a=combineOptions(_0x221e7a);var _0x4de958=new Buffer(_0x2833cd);var _0x1130d1=fs[_0xc784('0x10')](_0x40cb3e);var _0x1ce936=fs[_0xc784('0x11')](_0xa7be03);var _0x170094=crypto['createCipher'](_0x221e7a['algorithm'],_0x4de958);_0x1130d1['on'](_0xc784('0x12'),function(_0xb35100){var _0x4b5a62=new Buffer(_0x170094['update'](_0xb35100),'binary');_0x1ce936[_0xc784('0x13')](_0x4b5a62);});_0x1130d1['on'](_0xc784('0x14'),function(){try{var _0x42565e=new Buffer(_0x170094['final'](_0xc784('0x15')),_0xc784('0x15'));_0x1ce936[_0xc784('0x13')](_0x42565e);_0x1ce936[_0xc784('0x14')]();_0x1ce936['on'](_0xc784('0x16'),function(){return _0x2d9fef(_0xa7be03);});}catch(_0x408a99){fs[_0xc784('0x17')](_0xa7be03);return _0x50924b(_0x408a99);}});});};exports[_0xc784('0x18')]=function(_0x71d80d,_0x5d7ae3,_0xbcb0b6,_0x130a75){return new BPromise(function(_0x5af081,_0x4f6c71){_0x130a75=combineOptions(_0x130a75);var _0xdb8f68=new Buffer(_0xbcb0b6);var _0x54c5a8=fs[_0xc784('0x10')](_0x71d80d);var _0x539359=fs['createWriteStream'](_0x5d7ae3);var _0x161019=crypto['createDecipher'](_0x130a75[_0xc784('0x8')],_0xdb8f68);_0x54c5a8['on'](_0xc784('0x12'),function(_0x12df03){var _0x935e77=new Buffer(_0x161019[_0xc784('0x19')](_0x12df03),_0xc784('0x15'));_0x539359[_0xc784('0x13')](_0x935e77);});_0x54c5a8['on'](_0xc784('0x14'),function(){try{var _0xbe6def=new Buffer(_0x161019[_0xc784('0x1a')](_0xc784('0x15')),_0xc784('0x15'));_0x539359[_0xc784('0x13')](_0xbe6def);_0x539359['end']();_0x539359['on'](_0xc784('0x16'),function(){return _0x5af081(_0x5d7ae3);});}catch(_0x1bde3c){fs[_0xc784('0x17')](_0x5d7ae3);return _0x4f6c71(_0x1bde3c);}});});};exports[_0xc784('0x1b')]=function(_0x5b9cbe,_0x1e38c2,_0x1aa875){var _0x418148=_0x1aa875||stringOptions[_0xc784('0x8')];var _0x475864=_0x1e38c2||stringOptions[_0xc784('0x1c')];var _0x55efef=crypto[_0xc784('0x1d')](_0x418148,_0x475864);var _0x56453a=_0x55efef[_0xc784('0x19')](_0x5b9cbe,'utf8',_0xc784('0x1e'));_0x56453a+=_0x55efef[_0xc784('0x1a')](_0xc784('0x1e'));return _0x56453a;};exports[_0xc784('0x1f')]=function(_0xa66d4e,_0x5cc79d,_0x42826b){var _0x48c0ff=_0x42826b||stringOptions[_0xc784('0x8')];var _0xdefb8a=_0x5cc79d||stringOptions[_0xc784('0x1c')];var _0x510b1a=crypto[_0xc784('0x20')](_0x48c0ff,_0xdefb8a);var _0x120045=_0x510b1a[_0xc784('0x19')](_0xa66d4e,_0xc784('0x1e'),_0xc784('0x21'));_0x120045+=_0x510b1a[_0xc784('0x1a')](_0xc784('0x21'));return _0x120045;}; \ No newline at end of file +var _0x28f8=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','binary','write','end','close','unlink','createDecipher','data','final','secret','utf8','base64','decryptString','update','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','encrypt','algorithm','error'];(function(_0x77ea11,_0x26dcbf){var _0x310750=function(_0x470a29){while(--_0x470a29){_0x77ea11['push'](_0x77ea11['shift']());}};_0x310750(++_0x26dcbf);}(_0x28f8,0x175));var _0x828f=function(_0x586c70,_0x4a8cb3){_0x586c70=_0x586c70-0x0;var _0x26db79=_0x28f8[_0x586c70];return _0x26db79;};'use strict';var crypto=require(_0x828f('0x0'));var fs=require('fs');var BPromise=require(_0x828f('0x1'));var _=require(_0x828f('0x2'));var config=require(_0x828f('0x3'));var logger=require(_0x828f('0x4'))(_0x828f('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x828f('0x6')][_0x828f('0x7')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x828f('0x8')]&&config[_0x828f('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x828f('0x9')]=config[_0x828f('0x8')][_0x828f('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x828f('0xa')](config[_0x828f('0x8')][_0x828f('0x9')],_0x828f('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x21f914){return AES_SUPPORTED_RX[_0x828f('0xc')](_0x21f914);}function getSupportedCiphers(){return crypto[_0x828f('0xd')]()[_0x828f('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x3fb7d8){return getSupportedCiphers()[_0x828f('0xf')](_0x3fb7d8)>-0x1;}function combineOptions(_0x307e54){var _0x89d7e1={};for(var _0x15315a in fileOptions){if(fileOptions['hasOwnProperty'](_0x15315a)){_0x89d7e1[_0x15315a]=fileOptions[_0x15315a];}}if(_0x307e54){for(var _0x12ee03 in _0x307e54){if(_0x307e54[_0x828f('0x10')](_0x12ee03)){_0x89d7e1[_0x12ee03]=_0x307e54[_0x12ee03];}}}return _0x89d7e1;}exports['encryptFile']=function(_0x125c95,_0x8c96c1,_0x4bcdca,_0x17bdd7){return new BPromise(function(_0x3c0465,_0x5f41b0){_0x17bdd7=combineOptions(_0x17bdd7);var _0x1e288b=new Buffer(_0x4bcdca);var _0x269eeb=fs[_0x828f('0x11')](_0x125c95);var _0x397ec0=fs[_0x828f('0x12')](_0x8c96c1);var _0x1272bc=crypto['createCipher'](_0x17bdd7[_0x828f('0x9')],_0x1e288b);_0x269eeb['on']('data',function(_0x451059){var _0x4bb279=new Buffer(_0x1272bc['update'](_0x451059),_0x828f('0x13'));_0x397ec0[_0x828f('0x14')](_0x4bb279);});_0x269eeb['on'](_0x828f('0x15'),function(){try{var _0x257df1=new Buffer(_0x1272bc['final']('binary'),_0x828f('0x13'));_0x397ec0['write'](_0x257df1);_0x397ec0[_0x828f('0x15')]();_0x397ec0['on'](_0x828f('0x16'),function(){return _0x3c0465(_0x8c96c1);});}catch(_0x1a358c){fs[_0x828f('0x17')](_0x8c96c1);return _0x5f41b0(_0x1a358c);}});});};exports['decryptFile']=function(_0x4a2d2a,_0x1978a5,_0x37b7d7,_0x1655fc){return new BPromise(function(_0x1254b3,_0x965ac4){_0x1655fc=combineOptions(_0x1655fc);var _0x37d846=new Buffer(_0x37b7d7);var _0x2d91ed=fs[_0x828f('0x11')](_0x4a2d2a);var _0x5be93b=fs[_0x828f('0x12')](_0x1978a5);var _0x261a75=crypto[_0x828f('0x18')](_0x1655fc[_0x828f('0x9')],_0x37d846);_0x2d91ed['on'](_0x828f('0x19'),function(_0xf5304c){var _0x192603=new Buffer(_0x261a75['update'](_0xf5304c),_0x828f('0x13'));_0x5be93b[_0x828f('0x14')](_0x192603);});_0x2d91ed['on'](_0x828f('0x15'),function(){try{var _0x3f7e2a=new Buffer(_0x261a75[_0x828f('0x1a')](_0x828f('0x13')),_0x828f('0x13'));_0x5be93b[_0x828f('0x14')](_0x3f7e2a);_0x5be93b[_0x828f('0x15')]();_0x5be93b['on']('close',function(){return _0x1254b3(_0x1978a5);});}catch(_0x9c32dd){fs[_0x828f('0x17')](_0x1978a5);return _0x965ac4(_0x9c32dd);}});});};exports['encryptString']=function(_0x225db1,_0x109464,_0x134ce6){var _0x24a3ff=_0x134ce6||stringOptions['algorithm'];var _0x52a356=_0x109464||stringOptions[_0x828f('0x1b')];var _0x5b0e70=crypto['createCipher'](_0x24a3ff,_0x52a356);var _0x36fab0=_0x5b0e70['update'](_0x225db1,_0x828f('0x1c'),_0x828f('0x1d'));_0x36fab0+=_0x5b0e70[_0x828f('0x1a')](_0x828f('0x1d'));return _0x36fab0;};exports[_0x828f('0x1e')]=function(_0x24784e,_0x3fb9d0,_0x19cb01){var _0x22002b=_0x19cb01||stringOptions['algorithm'];var _0x4dcfa2=_0x3fb9d0||stringOptions['secret'];var _0x2a817a=crypto[_0x828f('0x18')](_0x22002b,_0x4dcfa2);var _0x3100f1=_0x2a817a[_0x828f('0x1f')](_0x24784e,'base64',_0x828f('0x1c'));_0x3100f1+=_0x2a817a[_0x828f('0x1a')](_0x828f('0x1c'));return _0x3100f1;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 53bb825..4af4109 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 _0x4827=['CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','%s.%s','zip\x20finished','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format'];(function(_0x5c3f3e,_0x29697a){var _0x3b97c6=function(_0x180765){while(--_0x180765){_0x5c3f3e['push'](_0x5c3f3e['shift']());}};_0x3b97c6(++_0x29697a);}(_0x4827,0x1c1));var _0x7482=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4827[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x7482('0x0'));var path=require('path');var _=require(_0x7482('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x7482('0x2'))['db'];var dbH=require(_0x7482('0x2'))[_0x7482('0x3')];var logger=require(_0x7482('0x4'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x7482('0x5')][0x3];var PATH=process[_0x7482('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2537d1,_0x4aa8a8){var _0x366558={'status':_0x2537d1};var _0x14b234={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4aa8a8){_0x366558[_0x7482('0x6')]=_0x4aa8a8;}return db[_0x7482('0x7')][_0x7482('0x8')](_0x366558,_0x14b234);}function main(){var _0x55b5b5=0x1388;var _0x5753e8;logger[_0x7482('0x9')](util[_0x7482('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7482('0xb')));return db['Setting'][_0x7482('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7482('0xd'),_0x7482('0xe')]})[_0x7482('0xf')](function(_0x204cca){if(_0x204cca){_0x5753e8=_0x204cca;_0x55b5b5=_0x5753e8['splitSizeCsv']||0x1388;}})[_0x7482('0xf')](function(){return dbH[_0x7482('0x10')][_0x7482('0x11')](util[_0x7482('0xa')](_0x7482('0x12'),QUERY),{'type':dbH[_0x7482('0x10')][_0x7482('0x13')][_0x7482('0x14')]});})[_0x7482('0xf')](function(_0x26ebc9){if(!_0x26ebc9[0x0]['num']){return analyticExtractedReport('Empty');}var _0x450ee4=[];var _0x8dae80=0x0;if(_0x5753e8[_0x7482('0xd')]){if(_0x26ebc9&&_0x26ebc9[_0x7482('0x15')]){var _0x5a1d09=_[_0x7482('0x16')](_0x26ebc9[0x0][_0x7482('0x17')]/_0x55b5b5);var _0x1fb345=Number[_0x7482('0x18')](_0x26ebc9[0x0][_0x7482('0x17')]/_0x55b5b5)?_0x26ebc9[0x0][_0x7482('0x17')]%_0x55b5b5:0x0;_0x5a1d09['forEach'](function(_0x1f242b){if(_0x1f242b>0x0){_0x8dae80+=_0x55b5b5;}_0x450ee4[_0x7482('0x19')](dbH[_0x7482('0x10')]['query'](util[_0x7482('0xa')](_0x7482('0x1a'),QUERY,_0x55b5b5,_0x8dae80),{'type':dbH[_0x7482('0x10')][_0x7482('0x13')]['SELECT']}));});if(_0x1fb345>0x0){_0x8dae80+=_0x55b5b5;_0x450ee4[_0x7482('0x19')](dbH[_0x7482('0x10')][_0x7482('0x11')](util[_0x7482('0xa')](_0x7482('0x1a'),QUERY,_0x1fb345,_0x8dae80),{'type':dbH['sequelize'][_0x7482('0x13')][_0x7482('0x14')]}));}}}else{_0x450ee4['push'](dbH[_0x7482('0x10')][_0x7482('0x11')](QUERY,{'type':dbH['sequelize'][_0x7482('0x13')][_0x7482('0x14')]}));}var _0xf2cf3a=path[_0x7482('0x1b')](PATH);var _0x300a1c=path[_0x7482('0x1c')](PATH,_0x7482('0x1d'));var _0x2d9269=_0x5753e8[_0x7482('0xd')]&&_0x450ee4[_0x7482('0x15')]>0x1;var _0x19627c=[];if(!fs[_0x7482('0x1e')](path[_0x7482('0x1f')](_0xf2cf3a,_0x300a1c))&&_0x2d9269){fs[_0x7482('0x20')](path[_0x7482('0x1f')](_0xf2cf3a,_0x300a1c));}return BPromise[_0x7482('0x21')](_0x450ee4,function(_0x1f2fd7){_0x19627c[_0x7482('0x19')](_0x1f2fd7);})[_0x7482('0xf')](function(){for(var _0xb52e44=0x0;_0xb52e44<_0x19627c[_0x7482('0x15')];_0xb52e44+=0x1){var _0x36ea03;var _0x3cfa62=_0x19627c[_0xb52e44];if(_0x2d9269){_0x36ea03=path[_0x7482('0x1f')](_0xf2cf3a,_0x300a1c,util['format'](_0x7482('0x22'),_0x300a1c,_0xb52e44,'csv'));}else{_0x36ea03=path[_0x7482('0x1f')](_0xf2cf3a,util[_0x7482('0xa')]('%s.%s',_0x300a1c,_0x7482('0x23')));}fs[_0x7482('0x24')](_0x36ea03,csv(_0x3cfa62));}})[_0x7482('0xf')](function(){if(_0x2d9269){return new Promise(function(_0x461961){zipdir(path[_0x7482('0x1f')](_0xf2cf3a,_0x300a1c),{'saveTo':path[_0x7482('0x1f')](_0xf2cf3a,util['format'](_0x7482('0x25'),_0x300a1c,'zip'))},function(_0x10945b,_0x236580){rimraf(path['join'](_0xf2cf3a,_0x300a1c),function(){});_0x461961(_0x7482('0x26'));});});}})[_0x7482('0xf')](function(){logger[_0x7482('0x9')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7482('0xb')));return analyticExtractedReport('Completed',_0x2d9269?util[_0x7482('0xa')](_0x7482('0x25'),_0x300a1c,_0x2d9269?_0x7482('0x27'):'csv'):null);});})[_0x7482('0x28')](function(_0x55a645){logger[_0x7482('0x9')](util[_0x7482('0xa')](_0x7482('0x29'),EXTRACTED_REPORT_ID,_0x7482('0xb')),util[_0x7482('0x2a')](_0x55a645,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7482('0x2b'));})[_0x7482('0x2c')](function(){process[_0x7482('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb907=['existsSync','join','each','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','to-csv','bluebird','zip-dir','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','.csv','split','length'];(function(_0x3877dd,_0x1980d2){var _0x60dc10=function(_0x162f57){while(--_0x162f57){_0x3877dd['push'](_0x3877dd['shift']());}};_0x60dc10(++_0x1980d2);}(_0xb907,0x9f));var _0x7b90=function(_0x3a3dfe,_0x3ed1f5){_0x3a3dfe=_0x3a3dfe-0x0;var _0x5e9b63=_0xb907[_0x3a3dfe];return _0x5e9b63;};'use strict';var util=require(_0x7b90('0x0'));var path=require('path');var _=require(_0x7b90('0x1'));var csv=require(_0x7b90('0x2'));var fs=require('fs');var BPromise=require(_0x7b90('0x3'));var zipdir=require(_0x7b90('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7b90('0x5')];var logger=require(_0x7b90('0x6'))(_0x7b90('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x7b90('0x8')][0x2]);var QUERY=process[_0x7b90('0x8')][0x3];var PATH=process[_0x7b90('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x58880f,_0x209b2c){var _0x6b470f={'status':_0x58880f};var _0x20f3aa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x209b2c){_0x6b470f[_0x7b90('0x9')]=_0x209b2c;}return db[_0x7b90('0xa')][_0x7b90('0xb')](_0x6b470f,_0x20f3aa);}function main(){var _0x18933e=0x1388;var _0x2b0238;logger[_0x7b90('0xc')](util[_0x7b90('0xd')](_0x7b90('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x7b90('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x7b90('0x10')](function(_0x4cb1ab){if(_0x4cb1ab){_0x2b0238=_0x4cb1ab;_0x18933e=_0x2b0238[_0x7b90('0x11')]||0x1388;}})[_0x7b90('0x10')](function(){return dbH[_0x7b90('0x12')]['query'](util[_0x7b90('0xd')](_0x7b90('0x13'),QUERY),{'type':dbH['sequelize'][_0x7b90('0x14')]['SELECT']});})[_0x7b90('0x10')](function(_0x2c9142){if(!_0x2c9142[0x0][_0x7b90('0x15')]){return analyticExtractedReport('Empty');}var _0x5e3247=[];var _0x1fa21d=0x0;if(_0x2b0238['split']){if(_0x2c9142&&_0x2c9142['length']){var _0xed4569=_[_0x7b90('0x16')](_0x2c9142[0x0][_0x7b90('0x15')]/_0x18933e);var _0x335443=Number[_0x7b90('0x17')](_0x2c9142[0x0][_0x7b90('0x15')]/_0x18933e)?_0x2c9142[0x0]['num']%_0x18933e:0x0;_0xed4569[_0x7b90('0x18')](function(_0x596ac3){if(_0x596ac3>0x0){_0x1fa21d+=_0x18933e;}_0x5e3247[_0x7b90('0x19')](dbH[_0x7b90('0x12')][_0x7b90('0x1a')](util[_0x7b90('0xd')](_0x7b90('0x1b'),QUERY,_0x18933e,_0x1fa21d),{'type':dbH[_0x7b90('0x12')]['QueryTypes']['SELECT']}));});if(_0x335443>0x0){_0x1fa21d+=_0x18933e;_0x5e3247['push'](dbH[_0x7b90('0x12')][_0x7b90('0x1a')](util['format'](_0x7b90('0x1b'),QUERY,_0x335443,_0x1fa21d),{'type':dbH[_0x7b90('0x12')]['QueryTypes']['SELECT']}));}}}else{_0x5e3247[_0x7b90('0x19')](dbH[_0x7b90('0x12')][_0x7b90('0x1a')](QUERY,{'type':dbH['sequelize'][_0x7b90('0x14')][_0x7b90('0x1c')]}));}var _0x4168f4=path['dirname'](PATH);var _0x417414=path[_0x7b90('0x1d')](PATH,_0x7b90('0x1e'));var _0x3eec60=_0x2b0238[_0x7b90('0x1f')]&&_0x5e3247[_0x7b90('0x20')]>0x1;var _0x259294=[];if(!fs[_0x7b90('0x21')](path['join'](_0x4168f4,_0x417414))&&_0x3eec60){fs['mkdirSync'](path[_0x7b90('0x22')](_0x4168f4,_0x417414));}return BPromise[_0x7b90('0x23')](_0x5e3247,function(_0x58f80b){_0x259294[_0x7b90('0x19')](_0x58f80b);})['then'](function(){for(var _0x336a31=0x0;_0x336a31<_0x259294[_0x7b90('0x20')];_0x336a31+=0x1){var _0x299ae1;var _0x26af2e=_0x259294[_0x336a31];if(_0x3eec60){_0x299ae1=path[_0x7b90('0x22')](_0x4168f4,_0x417414,util[_0x7b90('0xd')]('%s%d.%s',_0x417414,_0x336a31,_0x7b90('0x24')));}else{_0x299ae1=path[_0x7b90('0x22')](_0x4168f4,util[_0x7b90('0xd')](_0x7b90('0x25'),_0x417414,_0x7b90('0x24')));}fs[_0x7b90('0x26')](_0x299ae1,csv(_0x26af2e));}})['then'](function(){if(_0x3eec60){return new Promise(function(_0x84a327){zipdir(path[_0x7b90('0x22')](_0x4168f4,_0x417414),{'saveTo':path['join'](_0x4168f4,util[_0x7b90('0xd')](_0x7b90('0x25'),_0x417414,'zip'))},function(_0x4ebcab,_0x8aa4a2){rimraf(path[_0x7b90('0x22')](_0x4168f4,_0x417414),function(){});_0x84a327(_0x7b90('0x27'));});});}})[_0x7b90('0x10')](function(){logger[_0x7b90('0xc')](util[_0x7b90('0xd')](_0x7b90('0x28'),EXTRACTED_REPORT_ID,_0x7b90('0x29')));return analyticExtractedReport(_0x7b90('0x2a'),_0x3eec60?util[_0x7b90('0xd')](_0x7b90('0x25'),_0x417414,_0x3eec60?'zip':'csv'):null);});})[_0x7b90('0x2b')](function(_0x3bae4e){logger[_0x7b90('0xc')](util[_0x7b90('0xd')](_0x7b90('0x2c'),EXTRACTED_REPORT_ID,_0x7b90('0x29')),util[_0x7b90('0x2d')](_0x3bae4e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7b90('0x2e'));})[_0x7b90('0x2f')](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 c2448d0..000cba9 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 _0x297e=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','analytics','argv','savename','update','map','tableHeader','pick','toString','length','auto','body','push','concat','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','format','endDate','pageBreak','margin','footer','Arial','black','right','Setting','find','split','splitSizePdf','then','range','num','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x297e,0x17d));var _0xe297=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x297e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xe297('0x0'));var path=require(_0xe297('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xe297('0x2'));var PdfPrinter=require(_0xe297('0x3'));var zipdir=require(_0xe297('0x4'));var rimraf=require(_0xe297('0x5'));var JSDOM=require(_0xe297('0x6'))[_0xe297('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0xe297('0x8'));var db=require(_0xe297('0x9'))['db'];var dbH=require(_0xe297('0x9'))[_0xe297('0xa')];var logger=require('../../config/logger')(_0xe297('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe297('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4bd885,_0x22eed1){var _0x2a78e7={'status':_0x4bd885};var _0x39d8d4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22eed1){_0x2a78e7[_0xe297('0xd')]=_0x22eed1;}return db['AnalyticExtractedReport'][_0xe297('0xe')](_0x2a78e7,_0x39d8d4);}function getHeaders(_0x4f4c4e){return _[_0xe297('0xf')](_0x4f4c4e,function(_0x24dbc2){return{'text':_0x24dbc2,'style':_0xe297('0x10')};});}function getRows(_0x28f2eb,_0x5555b3){return _[_0xe297('0xf')](_0x5555b3,function(_0x348f06){return _(_0x348f06)[_0xe297('0x11')](_0x28f2eb)[_0xe297('0xf')](function(_0x231293){return _0x231293?_[_0xe297('0x12')](_0x231293):'';})['value']();});}function createTable(_0x1c94fc,_0x5033a7){var _0x2f7013={'widths':_['fill'](Array(_0x1c94fc[_0xe297('0x13')]),0x91),'heights':function(_0x317d01){return _0x317d01===0x0?_0xe297('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x429c00=getHeaders(_0x1c94fc);_0x2f7013[_0xe297('0x15')][_0xe297('0x16')](_0x429c00);var _0x255c2f=getRows(_0x1c94fc,_0x5033a7);_0x2f7013[_0xe297('0x15')]=_0x2f7013[_0xe297('0x15')][_0xe297('0x17')](_0x255c2f);return _0x2f7013;}function createTables(_0x2a152a){var _0x2d92d4=[];var _0x103397=_['chunk'](Object['keys'](_0x2a152a[0x0]),0x5);_0x103397['forEach'](function(_0x48cf80){_0x2d92d4[_0xe297('0x16')](createTable(_0x48cf80,_0x2a152a));});return _0x2d92d4;}function getPDFDocDefinition(_0x51fb88){var _0x2b2326=util['format'](_0xe297('0x18'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0xe297('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xe297('0x1a')])[_0xe297('0x19')](FORMAT));var _0x422a47=[];for(var _0x46b8c9=0x0;_0x46b8c9<_0x51fb88[_0xe297('0x13')];_0x46b8c9++){var _0x2066bb=[];if(_0x46b8c9===0x0){_0x2066bb[_0xe297('0x16')]({'text':_0x2b2326,'style':'header'});}var _0x6dfb9a={'table':_0x51fb88[_0x46b8c9]};if(_0x46b8c9>0x0){_0x6dfb9a[_0xe297('0x1b')]='before';_0x6dfb9a[_0xe297('0x1c')]=[0x0,0x46,0x0,0x0];}_0x2066bb[_0xe297('0x16')](_0x6dfb9a);_0x422a47[_0xe297('0x16')](_0x2066bb);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x422a47,'footer':function(_0x409dad,_0x2a297f){return{'text':_0x409dad['toString']()+'\x20/\x20'+_0x2a297f,'style':_0xe297('0x1d')};},'defaultStyle':{'font':_0xe297('0x1e')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xe297('0x1f')},'footer':{'alignment':_0xe297('0x20'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x47823e){var _0x4cc944=0x1388;var _0x37a3cb;if(!_0x47823e[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0xe297('0x21')][_0xe297('0x22')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe297('0x23'),_0xe297('0x24')]})['then'](function(_0x29971b){if(_0x29971b){_0x37a3cb=_0x29971b;_0x4cc944=_0x37a3cb[_0xe297('0x24')]||0x3e8;}})[_0xe297('0x25')](function(){var _0xe4d16=[];var _0x562f68=0x0;if(_0x37a3cb[_0xe297('0x23')]){if(_0x47823e&&_0x47823e[_0xe297('0x13')]){var _0x468581=_[_0xe297('0x26')](_0x47823e[0x0][_0xe297('0x27')]/_0x4cc944);var _0x273b00=Number['isInteger'](_0x47823e[0x0][_0xe297('0x27')]/_0x4cc944)?_0x47823e[0x0]['num']%_0x4cc944:0x0;_0x468581[_0xe297('0x28')](function(_0x54c810){if(_0x54c810>0x0){_0x562f68+=_0x4cc944;}_0xe4d16[_0xe297('0x16')](dbH[_0xe297('0x29')][_0xe297('0x2a')](util[_0xe297('0x19')](_0xe297('0x2b'),QUERY,_0x4cc944,_0x562f68),{'type':dbH[_0xe297('0x29')][_0xe297('0x2c')][_0xe297('0x2d')]}));});if(_0x273b00>0x0){_0x562f68+=_0x4cc944;_0xe4d16[_0xe297('0x16')](dbH['sequelize'][_0xe297('0x2a')](util[_0xe297('0x19')](_0xe297('0x2b'),QUERY,_0x273b00,_0x562f68),{'type':dbH[_0xe297('0x29')][_0xe297('0x2c')][_0xe297('0x2d')]}));}}}else{_0xe4d16['push'](dbH[_0xe297('0x29')][_0xe297('0x2a')](QUERY,{'type':dbH[_0xe297('0x29')]['QueryTypes'][_0xe297('0x2d')]}));}var _0x947981=path[_0xe297('0x2e')](PATH);var _0x15c513=path[_0xe297('0x2f')](PATH,_0xe297('0x30'));var _0x2c6a7e=_0x37a3cb[_0xe297('0x23')]&&_0xe4d16[_0xe297('0x13')]>0x1;var _0x448274=[];if(!fs[_0xe297('0x31')](path[_0xe297('0x32')](_0x947981,_0x15c513))&&_0x2c6a7e){fs[_0xe297('0x33')](path['join'](_0x947981,_0x15c513));}return BPromise['each'](_0xe4d16,function(_0x178ad4){_0x448274['push'](_0x178ad4);})[_0xe297('0x25')](function(){var _0x58b691=[];for(var _0x5cf64=0x0;_0x5cf64<_0x448274[_0xe297('0x13')];_0x5cf64+=0x1){var _0x1cfa11=_0x448274[_0x5cf64];var _0xc3d646=createTables(_[_0xe297('0x34')](_0x1cfa11));var _0x1d66b6;var _0x59fc05=getPDFDocDefinition(_0xc3d646);var _0x58ee8f=getPDFPrinter();var _0x4234b3=_0x58ee8f['createPdfKitDocument'](_0x59fc05);if(_0x2c6a7e){_0x1d66b6=path[_0xe297('0x32')](_0x947981,_0x15c513,util[_0xe297('0x19')](_0xe297('0x35'),_0x15c513,_0x5cf64,_0xe297('0x36')));}else{_0x1d66b6=path[_0xe297('0x32')](_0x947981,util['format']('%s.%s',_0x15c513,_0xe297('0x36')));}_0x58b691[_0xe297('0x16')](writePDFDocument(_0x4234b3,_0x1d66b6));}return Promise[_0xe297('0x37')](_0x58b691);})[_0xe297('0x25')](function(){if(_0x2c6a7e){return new Promise(function(_0x2c3724){zipdir(path['join'](_0x947981,_0x15c513),{'saveTo':path[_0xe297('0x32')](_0x947981,util['format'](_0xe297('0x38'),_0x15c513,_0xe297('0x39')))},function(){rimraf(path[_0xe297('0x32')](_0x947981,_0x15c513),function(){});_0x2c3724('zip\x20finished');});});}})[_0xe297('0x25')](function(){if(!_0x2c6a7e)return;rimraf(path[_0xe297('0x32')](_0x947981,_0x15c513),function(){});})[_0xe297('0x25')](function(){logger[_0xe297('0x3a')](util[_0xe297('0x19')](_0xe297('0x3b'),EXTRACTED_REPORT_ID,_0xe297('0x3c')));return analyticExtractedReport('Completed',_0x2c6a7e?util['format']('%s.%s',_0x15c513,_0x2c6a7e?_0xe297('0x39'):_0xe297('0x36')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe297('0x3a')](util[_0xe297('0x19')](_0xe297('0x3d'),EXTRACTED_REPORT_ID,_0xe297('0x3c')));return db[_0xe297('0x3e')][_0xe297('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe297('0x25')](function(_0x281128){EXTRACTED_REPORT=_0x281128;return dbH[_0xe297('0x29')][_0xe297('0x2a')](util[_0xe297('0x19')](_0xe297('0x40'),QUERY),{'type':dbH[_0xe297('0x29')][_0xe297('0x2c')]['SELECT']});})[_0xe297('0x25')](extractReport)[_0xe297('0x41')](function(_0x1aae8a){logger[_0xe297('0x3a')](util['format'](_0xe297('0x42'),EXTRACTED_REPORT_ID,_0xe297('0x3c')),util[_0xe297('0x43')](_0x1aae8a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe297('0x44'));})[_0xe297('0x45')](function(){process[_0xe297('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x318306=new PdfPrinter({'Arial':{'normal':__dirname+_0xe297('0x47'),'bold':__dirname+_0xe297('0x48'),'italics':__dirname+_0xe297('0x49'),'bolditalics':__dirname+_0xe297('0x4a')}});return _0x318306;}function getPDFDocDefinitionFromHTML(_0x41eb3f,_0x35df5c){var _0x3be1f7=util['format']('%s\x20#%d',_0x35df5c[_0xe297('0x4b')],_0x35df5c[_0xe297('0x4c')]);var _0xebe54e=moment()[_0xe297('0x19')](_0xe297('0x4d'))[_0xe297('0x12')]();var _0x3ff75c=htmlToPdfmake(_0x41eb3f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3ff75c],'defaultStyle':{'font':_0xe297('0x1e')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xe297('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xe297('0x4e')}},'header':function(){return[{'text':_0xe297('0x4f'),'style':_0xe297('0x50')}];},'footer':function(_0x568963,_0x384c15){return[{'text':util['format'](_0xe297('0x51'),_0x3be1f7,_0x568963,_0x384c15,_0xebe54e),'style':_0xe297('0x1d')}];}};}function writePDFDocument(_0x1cfc72,_0x21eebe){return new Promise(function(_0x3840bd,_0x22080d){var _0x25360f=_0x1cfc72[_0xe297('0x52')](fs[_0xe297('0x53')](_0x21eebe));_0x25360f['on']('finish',function(){_0x3840bd(_0xe297('0x54'));});_0x25360f['on'](_0xe297('0x55'),function(_0x2b7373){_0x22080d(_0x2b7373);});_0x1cfc72[_0xe297('0x56')]();});}exports[_0xe297('0x57')]=function(_0x5dfdc7,_0x3ce25d){var _0x4f6fca=getPDFPrinter();var _0x4e2b0c=getPDFDocDefinitionFromHTML(_0x5dfdc7,_0x3ce25d);var _0x44f91c=_0x4f6fca[_0xe297('0x58')](_0x4e2b0c);return writePDFDocument(_0x44f91c,_0x3ce25d[_0xe297('0x1')])[_0xe297('0x41')](function(_0x291eaa){throw _0x291eaa;});}; \ No newline at end of file +var _0xbc02=['update','map','pick','fill','body','push','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','toString','footer','Arial','black','right','Empty','find','split','splitSizePdf','then','isInteger','num','sequelize','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','basename','.pdf','existsSync','join','length','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x2f5b07,_0x5e749f){var _0x8bb306=function(_0x3c591c){while(--_0x3c591c){_0x2f5b07['push'](_0x2f5b07['shift']());}};_0x8bb306(++_0x5e749f);}(_0xbc02,0x9b));var _0x2bc0=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xbc02[_0x4b26b5];return _0x4dec71;};'use strict';var _=require(_0x2bc0('0x0'));var fs=require('fs');var util=require(_0x2bc0('0x1'));var path=require(_0x2bc0('0x2'));var moment=require(_0x2bc0('0x3'));var htmlToPdfmake=require(_0x2bc0('0x4'));var PdfPrinter=require(_0x2bc0('0x5'));var zipdir=require(_0x2bc0('0x6'));var rimraf=require(_0x2bc0('0x7'));var JSDOM=require(_0x2bc0('0x8'))['JSDOM'];var window=new JSDOM('')[_0x2bc0('0x9')];var BPromise=require(_0x2bc0('0xa'));var db=require(_0x2bc0('0xb'))['db'];var dbH=require(_0x2bc0('0xb'))[_0x2bc0('0xc')];var logger=require(_0x2bc0('0xd'))(_0x2bc0('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x2bc0('0xf')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x2bc0('0xf')][0x4];var NAME=process[_0x2bc0('0xf')][0x5];var FORMAT=_0x2bc0('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x571c3d,_0x32e160){var _0x2cbc29={'status':_0x571c3d};var _0xda6202={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32e160){_0x2cbc29[_0x2bc0('0x11')]=_0x32e160;}return db[_0x2bc0('0x12')][_0x2bc0('0x13')](_0x2cbc29,_0xda6202);}function getHeaders(_0x6baf5b){return _[_0x2bc0('0x14')](_0x6baf5b,function(_0x149b0c){return{'text':_0x149b0c,'style':'tableHeader'};});}function getRows(_0x343807,_0x4f83af){return _[_0x2bc0('0x14')](_0x4f83af,function(_0x2d7867){return _(_0x2d7867)[_0x2bc0('0x15')](_0x343807)['map'](function(_0x250b7e){return _0x250b7e?_['toString'](_0x250b7e):'';})['value']();});}function createTable(_0x2bd88f,_0x5d5013){var _0x39be8a={'widths':_[_0x2bc0('0x16')](Array(_0x2bd88f['length']),0x91),'heights':function(_0x4e753a){return _0x4e753a===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x55b38e=getHeaders(_0x2bd88f);_0x39be8a[_0x2bc0('0x17')][_0x2bc0('0x18')](_0x55b38e);var _0x31a64e=getRows(_0x2bd88f,_0x5d5013);_0x39be8a[_0x2bc0('0x17')]=_0x39be8a[_0x2bc0('0x17')]['concat'](_0x31a64e);return _0x39be8a;}function createTables(_0x277135){var _0x38c0c2=[];var _0x4554b4=_[_0x2bc0('0x19')](Object[_0x2bc0('0x1a')](_0x277135[0x0]),0x5);_0x4554b4[_0x2bc0('0x1b')](function(_0x2aee94){_0x38c0c2[_0x2bc0('0x18')](createTable(_0x2aee94,_0x277135));});return _0x38c0c2;}function getPDFDocDefinition(_0x4de8e9){var _0x82ae2=util['format'](_0x2bc0('0x1c'),NAME,EXTRACTED_REPORT[_0x2bc0('0x1d')],moment(EXTRACTED_REPORT[_0x2bc0('0x1e')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x2bc0('0x1f')])['format'](FORMAT));var _0x16de59=[];for(var _0x45d0db=0x0;_0x45d0db<_0x4de8e9['length'];_0x45d0db++){var _0x482bc1=[];if(_0x45d0db===0x0){_0x482bc1['push']({'text':_0x82ae2,'style':_0x2bc0('0x20')});}var _0x1b2a6c={'table':_0x4de8e9[_0x45d0db]};if(_0x45d0db>0x0){_0x1b2a6c['pageBreak']=_0x2bc0('0x21');_0x1b2a6c[_0x2bc0('0x22')]=[0x0,0x46,0x0,0x0];}_0x482bc1[_0x2bc0('0x18')](_0x1b2a6c);_0x16de59[_0x2bc0('0x18')](_0x482bc1);}return{'pageSize':'A4','pageOrientation':_0x2bc0('0x23'),'content':_0x16de59,'footer':function(_0x3e35c9,_0x5f070a){return{'text':_0x3e35c9[_0x2bc0('0x24')]()+'\x20/\x20'+_0x5f070a,'style':_0x2bc0('0x25')};},'defaultStyle':{'font':_0x2bc0('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2bc0('0x27')},'footer':{'alignment':_0x2bc0('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3cb50a){var _0xbfab1a=0x1388;var _0x17ac6c;if(!_0x3cb50a[0x0]['num']){return analyticExtractedReport(_0x2bc0('0x29'));}return db['Setting'][_0x2bc0('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2bc0('0x2b'),_0x2bc0('0x2c')]})[_0x2bc0('0x2d')](function(_0x2807e8){if(_0x2807e8){_0x17ac6c=_0x2807e8;_0xbfab1a=_0x17ac6c[_0x2bc0('0x2c')]||0x3e8;}})[_0x2bc0('0x2d')](function(){var _0x98c6c8=[];var _0x38e99a=0x0;if(_0x17ac6c[_0x2bc0('0x2b')]){if(_0x3cb50a&&_0x3cb50a['length']){var _0x679851=_['range'](_0x3cb50a[0x0]['num']/_0xbfab1a);var _0x1975db=Number[_0x2bc0('0x2e')](_0x3cb50a[0x0][_0x2bc0('0x2f')]/_0xbfab1a)?_0x3cb50a[0x0][_0x2bc0('0x2f')]%_0xbfab1a:0x0;_0x679851['forEach'](function(_0x435d16){if(_0x435d16>0x0){_0x38e99a+=_0xbfab1a;}_0x98c6c8[_0x2bc0('0x18')](dbH[_0x2bc0('0x30')]['query'](util[_0x2bc0('0x31')](_0x2bc0('0x32'),QUERY,_0xbfab1a,_0x38e99a),{'type':dbH['sequelize'][_0x2bc0('0x33')][_0x2bc0('0x34')]}));});if(_0x1975db>0x0){_0x38e99a+=_0xbfab1a;_0x98c6c8['push'](dbH[_0x2bc0('0x30')][_0x2bc0('0x35')](util['format'](_0x2bc0('0x32'),QUERY,_0x1975db,_0x38e99a),{'type':dbH[_0x2bc0('0x30')]['QueryTypes'][_0x2bc0('0x34')]}));}}}else{_0x98c6c8[_0x2bc0('0x18')](dbH[_0x2bc0('0x30')][_0x2bc0('0x35')](QUERY,{'type':dbH['sequelize'][_0x2bc0('0x33')][_0x2bc0('0x34')]}));}var _0x4e3cb1=path['dirname'](PATH);var _0x90ac14=path[_0x2bc0('0x36')](PATH,_0x2bc0('0x37'));var _0x4f9374=_0x17ac6c[_0x2bc0('0x2b')]&&_0x98c6c8['length']>0x1;var _0x5618c8=[];if(!fs[_0x2bc0('0x38')](path[_0x2bc0('0x39')](_0x4e3cb1,_0x90ac14))&&_0x4f9374){fs['mkdirSync'](path[_0x2bc0('0x39')](_0x4e3cb1,_0x90ac14));}return BPromise['each'](_0x98c6c8,function(_0x1ba9f9){_0x5618c8[_0x2bc0('0x18')](_0x1ba9f9);})['then'](function(){var _0x42ca9a=[];for(var _0x2ea829=0x0;_0x2ea829<_0x5618c8[_0x2bc0('0x3a')];_0x2ea829+=0x1){var _0x379a66=_0x5618c8[_0x2ea829];var _0x28c6ee=createTables(_['flatten'](_0x379a66));var _0x3a7885;var _0x2667cb=getPDFDocDefinition(_0x28c6ee);var _0x1a5a41=getPDFPrinter();var _0x5dc76f=_0x1a5a41[_0x2bc0('0x3b')](_0x2667cb);if(_0x4f9374){_0x3a7885=path[_0x2bc0('0x39')](_0x4e3cb1,_0x90ac14,util[_0x2bc0('0x31')]('%s%d.%s',_0x90ac14,_0x2ea829,_0x2bc0('0x3c')));}else{_0x3a7885=path[_0x2bc0('0x39')](_0x4e3cb1,util[_0x2bc0('0x31')](_0x2bc0('0x3d'),_0x90ac14,_0x2bc0('0x3c')));}_0x42ca9a['push'](writePDFDocument(_0x5dc76f,_0x3a7885));}return Promise['all'](_0x42ca9a);})[_0x2bc0('0x2d')](function(){if(_0x4f9374){return new Promise(function(_0x1d9bad){zipdir(path['join'](_0x4e3cb1,_0x90ac14),{'saveTo':path['join'](_0x4e3cb1,util[_0x2bc0('0x31')](_0x2bc0('0x3d'),_0x90ac14,_0x2bc0('0x3e')))},function(){rimraf(path['join'](_0x4e3cb1,_0x90ac14),function(){});_0x1d9bad(_0x2bc0('0x3f'));});});}})['then'](function(){if(!_0x4f9374)return;rimraf(path[_0x2bc0('0x39')](_0x4e3cb1,_0x90ac14),function(){});})['then'](function(){logger[_0x2bc0('0x40')](util[_0x2bc0('0x31')](_0x2bc0('0x41'),EXTRACTED_REPORT_ID,_0x2bc0('0x42')));return analyticExtractedReport(_0x2bc0('0x43'),_0x4f9374?util['format'](_0x2bc0('0x3d'),_0x90ac14,_0x4f9374?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2bc0('0x40')](util[_0x2bc0('0x31')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2bc0('0x42')));return db[_0x2bc0('0x12')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x40eeb5){EXTRACTED_REPORT=_0x40eeb5;return dbH['sequelize']['query'](util[_0x2bc0('0x31')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2bc0('0x30')][_0x2bc0('0x33')][_0x2bc0('0x34')]});})[_0x2bc0('0x2d')](extractReport)[_0x2bc0('0x44')](function(_0x8f8689){logger['info'](util[_0x2bc0('0x31')](_0x2bc0('0x45'),EXTRACTED_REPORT_ID,_0x2bc0('0x42')),util[_0x2bc0('0x46')](_0x8f8689,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2bc0('0x47'));})[_0x2bc0('0x48')](function(){process[_0x2bc0('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2d5db4=new PdfPrinter({'Arial':{'normal':__dirname+_0x2bc0('0x4a'),'bold':__dirname+_0x2bc0('0x4b'),'italics':__dirname+_0x2bc0('0x4c'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x2d5db4;}function getPDFDocDefinitionFromHTML(_0x1e3d49,_0x33c418){var _0x906581=util['format'](_0x2bc0('0x4d'),_0x33c418[_0x2bc0('0x4e')],_0x33c418[_0x2bc0('0x4f')]);var _0x2b713f=moment()[_0x2bc0('0x31')](_0x2bc0('0x50'))[_0x2bc0('0x24')]();var _0x15c677=htmlToPdfmake(_0x1e3d49,{'window':window,'tableAutoSize':!![]});return{'content':[_0x15c677],'defaultStyle':{'font':_0x2bc0('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2bc0('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x2bc0('0x20')}];},'footer':function(_0x2a6f80,_0x374c33){return[{'text':util[_0x2bc0('0x31')](_0x2bc0('0x52'),_0x906581,_0x2a6f80,_0x374c33,_0x2b713f),'style':_0x2bc0('0x25')}];}};}function writePDFDocument(_0x263969,_0x315511){return new Promise(function(_0x142067,_0x46463c){var _0xc39ded=_0x263969[_0x2bc0('0x53')](fs[_0x2bc0('0x54')](_0x315511));_0xc39ded['on'](_0x2bc0('0x55'),function(){_0x142067('finish');});_0xc39ded['on']('error',function(_0x927b87){_0x46463c(_0x927b87);});_0x263969[_0x2bc0('0x56')]();});}exports['createPdfFromHTML']=function(_0x552fbf,_0x17ab31){var _0x5a33e8=getPDFPrinter();var _0x1a6ecd=getPDFDocDefinitionFromHTML(_0x552fbf,_0x17ab31);var _0x166e91=_0x5a33e8[_0x2bc0('0x3b')](_0x1a6ecd);return writePDFDocument(_0x166e91,_0x17ab31['path'])[_0x2bc0('0x44')](function(_0x1e6262){throw _0x1e6262;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 59445ec..bea9485 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 _0x55cf=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.xlsx','join','mkdirSync','each','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query'];(function(_0x5914a3,_0x22e240){var _0x25af13=function(_0x33c161){while(--_0x33c161){_0x5914a3['push'](_0x5914a3['shift']());}};_0x25af13(++_0x22e240);}(_0x55cf,0xab));var _0xf55c=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x55cf[_0x34325b];return _0x3da348;};'use strict';var util=require(_0xf55c('0x0'));var path=require(_0xf55c('0x1'));var _=require(_0xf55c('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xf55c('0x3'));var rimraf=require(_0xf55c('0x4'));var db=require(_0xf55c('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xf55c('0x6'))(_0xf55c('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf55c('0x8')][0x2]);var QUERY=process[_0xf55c('0x8')][0x3];var PATH=process[_0xf55c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c69a4,_0x6561b7){var _0x26ed34={'status':_0x1c69a4};var _0xc38705={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x6561b7){_0x26ed34['savename']=_0x6561b7;}return db[_0xf55c('0x9')][_0xf55c('0xa')](_0x26ed34,_0xc38705);}function main(){var _0x12717c=0x1388;var _0x581641;logger[_0xf55c('0xb')](util[_0xf55c('0xc')](_0xf55c('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf55c('0xe')][_0xf55c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf55c('0x10'),_0xf55c('0x11')]})[_0xf55c('0x12')](function(_0x5eeb54){if(_0x5eeb54){_0x581641=_0x5eeb54;_0x12717c=_0x581641['splitSizeXlsx']||0x1388;}})[_0xf55c('0x12')](function(){return dbH[_0xf55c('0x13')][_0xf55c('0x14')](util[_0xf55c('0xc')](_0xf55c('0x15'),QUERY),{'type':dbH[_0xf55c('0x13')]['QueryTypes']['SELECT']});})[_0xf55c('0x12')](function(_0x2adb0a){if(!_0x2adb0a[0x0][_0xf55c('0x16')]){return analyticExtractedReport('Empty');}var _0x3759cf=[];var _0xa09f6e=0x0;if(_0x581641[_0xf55c('0x10')]){if(_0x2adb0a&&_0x2adb0a[_0xf55c('0x17')]){var _0x43405b=_['range'](_0x2adb0a[0x0][_0xf55c('0x16')]/_0x12717c);var _0xb258f7=Number[_0xf55c('0x18')](_0x2adb0a[0x0]['num']/_0x12717c)?_0x2adb0a[0x0][_0xf55c('0x16')]%_0x12717c:0x0;_0x43405b['forEach'](function(_0x149de0){if(_0x149de0>0x0){_0xa09f6e+=_0x12717c;}_0x3759cf[_0xf55c('0x19')](dbH[_0xf55c('0x13')]['query'](util['format'](_0xf55c('0x1a'),QUERY,_0x12717c,_0xa09f6e),{'type':dbH[_0xf55c('0x13')][_0xf55c('0x1b')]['SELECT']}));});if(_0xb258f7>0x0){_0xa09f6e+=_0x12717c;_0x3759cf[_0xf55c('0x19')](dbH['sequelize']['query'](util[_0xf55c('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xb258f7,_0xa09f6e),{'type':dbH['sequelize'][_0xf55c('0x1b')]['SELECT']}));}}}else{_0x3759cf[_0xf55c('0x19')](dbH[_0xf55c('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0xf55c('0x1b')][_0xf55c('0x1c')]}));}var _0x3c1f95=path['dirname'](PATH);var _0x105499=path[_0xf55c('0x1d')](PATH,_0xf55c('0x1e'));var _0x666d34=_0x581641[_0xf55c('0x10')]&&_0x3759cf[_0xf55c('0x17')]>0x1;var _0x1b330e=[];if(!fs['existsSync'](path[_0xf55c('0x1f')](_0x3c1f95,_0x105499))&&_0x666d34){fs[_0xf55c('0x20')](path[_0xf55c('0x1f')](_0x3c1f95,_0x105499));}return BPromise[_0xf55c('0x21')](_0x3759cf,function(_0x429a99){_0x1b330e[_0xf55c('0x19')](_0x429a99);})[_0xf55c('0x12')](function(){for(var _0x2bc092=0x0;_0x2bc092<_0x1b330e[_0xf55c('0x17')];_0x2bc092+=0x1){var _0x14ea50;var _0x378081=_0x1b330e[_0x2bc092];if(_0x666d34){_0x14ea50=path[_0xf55c('0x1f')](_0x3c1f95,_0x105499,util[_0xf55c('0xc')]('%s%d.%s',_0x105499,_0x2bc092,'xlsx'));}else{_0x14ea50=path[_0xf55c('0x1f')](_0x3c1f95,util[_0xf55c('0xc')](_0xf55c('0x22'),_0x105499,_0xf55c('0x23')));}fs[_0xf55c('0x24')](_0x14ea50,json2xls(_0x378081),_0xf55c('0x25'));}})['then'](function(){if(_0x666d34){return new Promise(function(_0x446184){zipdir(path[_0xf55c('0x1f')](_0x3c1f95,_0x105499),{'saveTo':path[_0xf55c('0x1f')](_0x3c1f95,util[_0xf55c('0xc')](_0xf55c('0x22'),_0x105499,_0xf55c('0x26')))},function(_0x3e5451,_0x530c9d){rimraf(path[_0xf55c('0x1f')](_0x3c1f95,_0x105499),function(){});_0x446184(_0xf55c('0x27'));});});}})['then'](function(){logger['info'](util[_0xf55c('0xc')](_0xf55c('0x28'),EXTRACTED_REPORT_ID,_0xf55c('0x29')));return analyticExtractedReport('Completed',_0x666d34?util[_0xf55c('0xc')]('%s.%s',_0x105499,_0x666d34?_0xf55c('0x26'):_0xf55c('0x23')):null);});})[_0xf55c('0x2a')](function(_0x39e26b){logger[_0xf55c('0xb')](util[_0xf55c('0xc')](_0xf55c('0x2b'),EXTRACTED_REPORT_ID,_0xf55c('0x29')),util[_0xf55c('0x2c')](_0x39e26b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf55c('0x2d'));})[_0xf55c('0x2e')](function(){process[_0xf55c('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x590a=['zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','QueryTypes','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.xlsx','join','mkdirSync','each','xlsx','%s.%s','writeFileSync'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x590a,0x159));var _0xa590=function(_0x4d388e,_0x257dd4){_0x4d388e=_0x4d388e-0x0;var _0x5c7c93=_0x590a[_0x4d388e];return _0x5c7c93;};'use strict';var util=require('util');var path=require(_0xa590('0x0'));var _=require(_0xa590('0x1'));var fs=require('fs');var json2xls=require(_0xa590('0x2'));var BPromise=require(_0xa590('0x3'));var zipdir=require(_0xa590('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xa590('0x5'))[_0xa590('0x6')];var logger=require(_0xa590('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa590('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xa590('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x163d19,_0x2ad01a){var _0x27a5fa={'status':_0x163d19};var _0x5d9565={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ad01a){_0x27a5fa['savename']=_0x2ad01a;}return db[_0xa590('0x9')]['update'](_0x27a5fa,_0x5d9565);}function main(){var _0x397b6c=0x1388;var _0x3e59f3;logger[_0xa590('0xa')](util['format'](_0xa590('0xb'),EXTRACTED_REPORT_ID,_0xa590('0xc')));return db[_0xa590('0xd')][_0xa590('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa590('0xf'),_0xa590('0x10')]})[_0xa590('0x11')](function(_0x570b51){if(_0x570b51){_0x3e59f3=_0x570b51;_0x397b6c=_0x3e59f3['splitSizeXlsx']||0x1388;}})[_0xa590('0x11')](function(){return dbH[_0xa590('0x12')][_0xa590('0x13')](util[_0xa590('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa590('0x12')][_0xa590('0x15')]['SELECT']});})['then'](function(_0x2954af){if(!_0x2954af[0x0]['num']){return analyticExtractedReport(_0xa590('0x16'));}var _0x6ca5c8=[];var _0x1d218c=0x0;if(_0x3e59f3[_0xa590('0xf')]){if(_0x2954af&&_0x2954af[_0xa590('0x17')]){var _0x114654=_[_0xa590('0x18')](_0x2954af[0x0][_0xa590('0x19')]/_0x397b6c);var _0x4f4075=Number[_0xa590('0x1a')](_0x2954af[0x0][_0xa590('0x19')]/_0x397b6c)?_0x2954af[0x0][_0xa590('0x19')]%_0x397b6c:0x0;_0x114654[_0xa590('0x1b')](function(_0x5b4317){if(_0x5b4317>0x0){_0x1d218c+=_0x397b6c;}_0x6ca5c8[_0xa590('0x1c')](dbH[_0xa590('0x12')][_0xa590('0x13')](util[_0xa590('0x14')](_0xa590('0x1d'),QUERY,_0x397b6c,_0x1d218c),{'type':dbH[_0xa590('0x12')][_0xa590('0x15')][_0xa590('0x1e')]}));});if(_0x4f4075>0x0){_0x1d218c+=_0x397b6c;_0x6ca5c8['push'](dbH[_0xa590('0x12')][_0xa590('0x13')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f4075,_0x1d218c),{'type':dbH[_0xa590('0x12')][_0xa590('0x15')][_0xa590('0x1e')]}));}}}else{_0x6ca5c8[_0xa590('0x1c')](dbH[_0xa590('0x12')]['query'](QUERY,{'type':dbH[_0xa590('0x12')][_0xa590('0x15')][_0xa590('0x1e')]}));}var _0x257297=path[_0xa590('0x1f')](PATH);var _0x457a32=path['basename'](PATH,_0xa590('0x20'));var _0x4fdc6e=_0x3e59f3[_0xa590('0xf')]&&_0x6ca5c8[_0xa590('0x17')]>0x1;var _0x46f7dd=[];if(!fs['existsSync'](path[_0xa590('0x21')](_0x257297,_0x457a32))&&_0x4fdc6e){fs[_0xa590('0x22')](path[_0xa590('0x21')](_0x257297,_0x457a32));}return BPromise[_0xa590('0x23')](_0x6ca5c8,function(_0x51612e){_0x46f7dd['push'](_0x51612e);})[_0xa590('0x11')](function(){for(var _0x391f8c=0x0;_0x391f8c<_0x46f7dd[_0xa590('0x17')];_0x391f8c+=0x1){var _0x115e45;var _0x3b47f1=_0x46f7dd[_0x391f8c];if(_0x4fdc6e){_0x115e45=path[_0xa590('0x21')](_0x257297,_0x457a32,util[_0xa590('0x14')]('%s%d.%s',_0x457a32,_0x391f8c,_0xa590('0x24')));}else{_0x115e45=path[_0xa590('0x21')](_0x257297,util[_0xa590('0x14')](_0xa590('0x25'),_0x457a32,_0xa590('0x24')));}fs[_0xa590('0x26')](_0x115e45,json2xls(_0x3b47f1),'binary');}})['then'](function(){if(_0x4fdc6e){return new Promise(function(_0x5e86e2){zipdir(path[_0xa590('0x21')](_0x257297,_0x457a32),{'saveTo':path['join'](_0x257297,util['format'](_0xa590('0x25'),_0x457a32,_0xa590('0x27')))},function(_0x41782a,_0x2cbe1a){rimraf(path['join'](_0x257297,_0x457a32),function(){});_0x5e86e2(_0xa590('0x28'));});});}})[_0xa590('0x11')](function(){logger['info'](util[_0xa590('0x14')](_0xa590('0x29'),EXTRACTED_REPORT_ID,_0xa590('0xc')));return analyticExtractedReport(_0xa590('0x2a'),_0x4fdc6e?util[_0xa590('0x14')]('%s.%s',_0x457a32,_0x4fdc6e?_0xa590('0x27'):'xlsx'):null);});})[_0xa590('0x2b')](function(_0x15f2c5){logger[_0xa590('0xa')](util[_0xa590('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa590('0xc')),util[_0xa590('0x2c')](_0x15f2c5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa590('0x2d'));})[_0xa590('0x2e')](function(){process[_0xa590('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a209f90..8ba99ca 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 _0x0565=['createdAt','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','error','lodash','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','map','exten','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','push','type','format','context','VoiceExtensionId','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','XCALLY-MOTION-PROGRESS=0','length','toLowerCase'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x0565,0x1df));var _0x5056=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0565[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x5056('0x0'));var util=require('util');function rewrite(_0x1ed3c7,_0x2f8bd3){var _0x23d65e=this;return _0x1ed3c7[_0x5056('0x1')][_0x5056('0x2')]['findAll']({'raw':!![]})[_0x5056('0x3')](function(_0x43791f){_0x23d65e[_0x5056('0x4')]=_0x43791f;return _0x1ed3c7[_0x5056('0x1')][_0x5056('0x5')][_0x5056('0x6')]({'where':{'IntervalId':_0x2f8bd3[_0x5056('0x7')]},'raw':!![]});})[_0x5056('0x3')](function(_0x13417f){return _0x1ed3c7[_0x5056('0x1')]['VoiceExtension'][_0x5056('0x6')]({'where':{'exten':{'$in':_['uniq'](_[_0x5056('0x8')](_0x13417f,_0x5056('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x5056('0x3')](function(_0x4e22fc){var _0x442c63=_[_0x5056('0xa')](_0x4e22fc,{'priority':'1'});var _0xd841d8=_[_0x5056('0xa')](_0x4e22fc,{'isApp':0x1});var _0x502fa8=_[_0x5056('0xb')](_0xd841d8,'exten');var _0x25e94d=['queue',_0x5056('0xc')];var _0x2cc4d6=[];var _0x2333ab=[];for(var _0x592d8c in _0x502fa8){if(_0x502fa8[_0x5056('0xd')](_0x592d8c)){_0x23d65e[_0x5056('0xe')]=0x2;_0x23d65e[_0x5056('0xf')]=[];_0x23d65e[_0x5056('0x10')]=_['find'](_0x442c63,{'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')]});_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Set','appdata':util[_0x5056('0x13')]('CDR(type)=%s',_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')]),'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});if(_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')]==='inbound'){_0x23d65e[_0x5056('0xf')]['push']({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':_0x5056('0x17')+_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')],'context':_0x502fa8[_0x592d8c][0x0]['context'],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e['priority']++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});}else if(_0x502fa8[_0x592d8c][0x0]['type']===_0x5056('0x18')){if(_0x23d65e[_0x5056('0x10')]){_0x23d65e[_0x5056('0xf')]['push']({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':_0x5056('0x19')+(_0x23d65e['extension'][_0x5056('0x1a')]?'${EXTEN:'+_0x23d65e[_0x5056('0x10')][_0x5056('0x1a')]+'}':_0x5056('0x1b')),'context':_0x502fa8[_0x592d8c][0x0]['context'],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});}_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Set','appdata':_0x5056('0x17')+_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')],'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});var _0x546cb9=_0x23d65e['priority']++;_0x23d65e['extensions'][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0]['type'],'app':_0x5056('0x1c'),'appdata':_0x5056('0x1d')+(_0x546cb9+0x2)+_0x5056('0x1e')+(_0x546cb9+0x1)+')','context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0]['exten'],'priority':_0x546cb9,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});if(_0x23d65e[_0x5056('0x10')]){_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Set','appdata':_0x23d65e[_0x5056('0x10')][_0x5056('0x1a')]?_0x5056('0x1f')+_0x23d65e[_0x5056('0x10')][_0x5056('0x1a')]+'}':_0x5056('0x20'),'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0]['exten'],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});}_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':_0x5056('0x21')+_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')],'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});if(_0x23d65e[_0x5056('0x10')]&&_0x23d65e[_0x5056('0x10')][_0x5056('0xd')]('recordingFormat')&&_0x23d65e[_0x5056('0x10')]['recordingFormat']!==_0x5056('0x22')){_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Set','appdata':_0x5056('0x23'),'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0]['exten'],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0]['type'],'app':'Set','appdata':_0x5056('0x24')+_0x23d65e['extension'][_0x5056('0x25')]||'wav','context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});}}_0x23d65e[_0x5056('0xf')]['push']({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x502fa8[_0x592d8c][0x0]['context'],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Set','appdata':_0x5056('0x26'),'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});_0x23d65e[_0x5056('0xf')][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0]['type'],'app':_0x5056('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'priority':_0x23d65e[_0x5056('0xe')]++,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0]['VoiceExtensionId']});for(var _0x3f943c=0x0,_0x33add1=0x0;_0x3f943c<_0x502fa8[_0x592d8c][_0x5056('0x27')];_0x3f943c+=0x1,_0x33add1=0x0){var _0x4c9df6=_0x502fa8[_0x592d8c][_0x3f943c];if(_0x4c9df6[_0x5056('0x12')]){_0x4c9df6['type']=_0x4c9df6[_0x5056('0x12')][_0x5056('0x28')]();}var _0x7a7bdc=[];var _0x3f5b3c=[];delete _0x4c9df6['id'];delete _0x4c9df6[_0x5056('0x29')];delete _0x4c9df6[_0x5056('0x2a')];var _0x266148=_0x4c9df6[_0x5056('0x2b')]!=='*,*,*,*'?[_0x4c9df6[_0x5056('0x2b')]]:_0x4c9df6[_0x5056('0x7')]?_[_0x5056('0x8')](_[_0x5056('0xa')](_0x23d65e[_0x5056('0x4')],{'IntervalId':_0x4c9df6['IntervalId']}),_0x5056('0x2b')):[];if(_0x4c9df6['hasOwnProperty'](_0x5056('0x2c'))){if(_0x4c9df6[_0x5056('0x2c')]&&_0x4c9df6[_0x5056('0x2c')]!=='--'){_0x7a7bdc[_0x5056('0x11')]({'type':_0x4c9df6[_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':_0x5056('0x2d')+_0x4c9df6[_0x5056('0x2c')],'context':_0x4c9df6[_0x5056('0x14')],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148['length']+_0x23d65e[_0x5056('0xe')]+_0x33add1++,'VoiceExtensionId':_0x4c9df6[_0x5056('0x15')]});}}if(_0x4c9df6[_0x5056('0x12')]===_0x5056('0x18')&&_0x4c9df6[_0x5056('0xd')](_0x5056('0x2e'))){if(_0x4c9df6['callerID']){_0x7a7bdc[_0x5056('0x11')]({'type':_0x4c9df6[_0x5056('0x12')],'app':_0x5056('0x1c'),'appdata':_0x5056('0x2f')+_0x4c9df6['callerID']+')','context':_0x4c9df6[_0x5056('0x14')],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148[_0x5056('0x27')]+_0x23d65e[_0x5056('0xe')]+_0x33add1++,'VoiceExtensionId':_0x4c9df6[_0x5056('0x15')]});}else{_0x7a7bdc['push']({'type':_0x4c9df6[_0x5056('0x12')],'app':_0x5056('0x1c'),'appdata':_0x5056('0x30'),'context':_0x4c9df6['context'],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148[_0x5056('0x27')]+_0x23d65e['priority']+_0x33add1++,'VoiceExtensionId':_0x4c9df6[_0x5056('0x15')]});}}if(_0x4c9df6[_0x5056('0xd')]('answer')){if(_0x25e94d[_0x5056('0x31')](_0x4c9df6[_0x5056('0x32')][_0x5056('0x28')]())>=0x0&&_0x4c9df6['appType']!==_0x5056('0x33')){if(_0x4c9df6[_0x5056('0x34')]){_0x7a7bdc[_0x5056('0x11')]({'type':_0x4c9df6[_0x5056('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4c9df6[_0x5056('0x14')],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148[_0x5056('0x27')]+_0x23d65e['priority']+_0x33add1++,'VoiceExtensionId':_0x4c9df6['VoiceExtensionId']});_0x7a7bdc['push']({'type':_0x4c9df6[_0x5056('0x12')],'app':_0x5056('0x16'),'appdata':_0x5056('0x35'),'context':_0x4c9df6[_0x5056('0x14')],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148[_0x5056('0x27')]+_0x23d65e['priority']+_0x33add1++,'VoiceExtensionId':_0x4c9df6['VoiceExtensionId']});}else{_0x7a7bdc[_0x5056('0x11')]({'type':_0x4c9df6[_0x5056('0x12')],'app':_0x5056('0x1c'),'appdata':_0x5056('0x36'),'context':_0x4c9df6['context'],'exten':_0x4c9df6['exten'],'priority':_0x266148['length']+_0x23d65e[_0x5056('0xe')]+_0x33add1++,'VoiceExtensionId':_0x4c9df6['VoiceExtensionId']});_0x7a7bdc[_0x5056('0x11')]({'type':_0x4c9df6[_0x5056('0x12')],'app':'Set','appdata':_0x5056('0x37'),'context':_0x4c9df6['context'],'exten':_0x4c9df6[_0x5056('0x9')],'priority':_0x266148[_0x5056('0x27')]+_0x23d65e['priority']+_0x33add1++,'VoiceExtensionId':_0x4c9df6['VoiceExtensionId']});}}}for(var _0x2e70fb=0x0;_0x2e70fb<_0x266148[_0x5056('0x27')];_0x2e70fb+=0x1){var _0x26056d=_0x23d65e[_0x5056('0xe')]+_0x266148[_0x5056('0x27')];var _0x37c264=_0x2e70fb===_0x266148['length']-0x1?_0x23d65e[_0x5056('0xe')]+_0x7a7bdc[_0x5056('0x27')]+_0x3f5b3c[_0x5056('0x27')]+0x2:_0x23d65e[_0x5056('0xe')]+_0x2e70fb+0x1;_0x7a7bdc[_0x5056('0x38')](_0x2e70fb,0x0,{'type':_0x4c9df6[_0x5056('0x12')],'app':'GotoIfTime','appdata':_0x266148[_0x2e70fb]+'?'+_0x4c9df6[_0x5056('0x14')]+',${EXTEN},'+_0x26056d+':'+_0x4c9df6[_0x5056('0x14')]+_0x5056('0x39')+_0x37c264,'exten':_0x4c9df6[_0x5056('0x9')],'context':_0x4c9df6[_0x5056('0x14')],'priority':_0x23d65e[_0x5056('0xe')]+_0x2e70fb,'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});}_0x4c9df6[_0x5056('0xe')]=_0x7a7bdc[_0x5056('0x27')]?_[_0x5056('0x3a')](_0x7a7bdc)['priority']+0x1:_0x23d65e['priority'];_0x23d65e[_0x5056('0xe')]=(_0x3f5b3c['length']?_[_0x5056('0x3a')](_0x3f5b3c)[_0x5056('0xe')]:_0x4c9df6[_0x5056('0xe')])+0x1;_0x23d65e[_0x5056('0xf')]=_[_0x5056('0x3b')](_0x23d65e[_0x5056('0xf')],_0x7a7bdc,[_0x4c9df6],_0x3f5b3c);}_0x23d65e['extensions'][_0x5056('0x11')]({'type':_0x502fa8[_0x592d8c][0x0][_0x5056('0x12')],'app':'Hangup','exten':_0x502fa8[_0x592d8c][0x0][_0x5056('0x9')],'context':_0x502fa8[_0x592d8c][0x0][_0x5056('0x14')],'priority':_0x23d65e[_0x5056('0xe')],'VoiceExtensionId':_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]});_0x2cc4d6[_0x5056('0x11')](_0x502fa8[_0x592d8c][0x0][_0x5056('0x15')]);_0x2333ab=_[_0x5056('0x3b')](_0x2333ab,_0x23d65e[_0x5056('0xf')]);}}return _0x1ed3c7[_0x5056('0x3c')](function(_0x271baf){return _0x1ed3c7['models'][_0x5056('0x5')][_0x5056('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x2cc4d6}},'transaction':_0x271baf})[_0x5056('0x3')](function(_0x2bf12c){return _0x1ed3c7['models']['VoiceExtension'][_0x5056('0x3e')](_[_0x5056('0x3f')](_0x2333ab,_0x5056('0xe')),{'transaction':_0x271baf});});});})['catch'](function(_0x5de4dc){console[_0x5056('0x40')](_0x5de4dc);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xc6e1=['cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','toLowerCase','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','extension','push','Set','format','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xc6e1,0xf1));var _0x1c6e=function(_0x4feca4,_0x55a156){_0x4feca4=_0x4feca4-0x0;var _0x448c07=_0xc6e1[_0x4feca4];return _0x448c07;};'use strict';var _=require(_0x1c6e('0x0'));var util=require(_0x1c6e('0x1'));function rewrite(_0xec2539,_0x6a508e){var _0x331e3e=this;return _0xec2539[_0x1c6e('0x2')][_0x1c6e('0x3')][_0x1c6e('0x4')]({'raw':!![]})[_0x1c6e('0x5')](function(_0x3fa313){_0x331e3e[_0x1c6e('0x6')]=_0x3fa313;return _0xec2539[_0x1c6e('0x2')][_0x1c6e('0x7')][_0x1c6e('0x4')]({'where':{'IntervalId':_0x6a508e[_0x1c6e('0x8')]},'raw':!![]});})[_0x1c6e('0x5')](function(_0x3af26f){return _0xec2539[_0x1c6e('0x2')][_0x1c6e('0x7')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x1c6e('0x9')](_0x3af26f,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x1c6e('0x5')](function(_0x760a7f){var _0x1cbd62=_['filter'](_0x760a7f,{'priority':'1'});var _0x120017=_[_0x1c6e('0xa')](_0x760a7f,{'isApp':0x1});var _0x522e78=_[_0x1c6e('0xb')](_0x120017,_0x1c6e('0xc'));var _0x4136b3=[_0x1c6e('0xd'),'playback'];var _0x248073=[];var _0x2fa4e0=[];for(var _0x49f972 in _0x522e78){if(_0x522e78[_0x1c6e('0xe')](_0x49f972)){_0x331e3e[_0x1c6e('0xf')]=0x2;_0x331e3e[_0x1c6e('0x10')]=[];_0x331e3e[_0x1c6e('0x11')]=_['find'](_0x1cbd62,{'exten':_0x522e78[_0x49f972][0x0]['exten']});_0x331e3e['extensions'][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0]['type'],'app':_0x1c6e('0x13'),'appdata':util[_0x1c6e('0x14')]('CDR(type)=%s',_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')]),'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0]['exten'],'priority':_0x331e3e['priority']++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});if(_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')]===_0x1c6e('0x18')){_0x331e3e[_0x1c6e('0x10')]['push']({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':'Set','appdata':_0x1c6e('0x19')+_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')],'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e['priority']++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});}else if(_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')]===_0x1c6e('0x1a')){if(_0x331e3e[_0x1c6e('0x11')]){_0x331e3e['extensions'][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':'Set','appdata':'CDR(destination)='+(_0x331e3e[_0x1c6e('0x11')][_0x1c6e('0x1b')]?'${EXTEN:'+_0x331e3e[_0x1c6e('0x11')]['cutdigits']+'}':_0x1c6e('0x1c')),'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e['priority']++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});}_0x331e3e['extensions'][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x19')+_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')],'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});var _0xe58a1a=_0x331e3e[_0x1c6e('0xf')]++;_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':'ExecIf','appdata':_0x1c6e('0x1d')+(_0xe58a1a+0x2)+_0x1c6e('0x1e')+(_0xe58a1a+0x1)+')','context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0xe58a1a,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});if(_0x331e3e['extension']){_0x331e3e['extensions'][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x331e3e['extension'][_0x1c6e('0x1b')]?_0x1c6e('0x1f')+_0x331e3e['extension'][_0x1c6e('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});}_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x20')+_0x522e78[_0x49f972][0x0]['VoiceExtensionId'],'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0]['VoiceExtensionId']});if(_0x331e3e['extension']&&_0x331e3e['extension'][_0x1c6e('0xe')](_0x1c6e('0x21'))&&_0x331e3e[_0x1c6e('0x11')]['recordingFormat']!==_0x1c6e('0x22')){_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x23'),'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0]['exten'],'priority':_0x331e3e['priority']++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});_0x331e3e[_0x1c6e('0x10')]['push']({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x331e3e[_0x1c6e('0x11')]['recordingFormat']||_0x1c6e('0x24'),'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0]['VoiceExtensionId']});}}_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x25'),'context':_0x522e78[_0x49f972][0x0]['context'],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0]['VoiceExtensionId']});_0x331e3e['extensions']['push']({'type':_0x522e78[_0x49f972][0x0][_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0]['exten'],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0]['type'],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'exten':_0x522e78[_0x49f972][0x0][_0x1c6e('0xc')],'priority':_0x331e3e[_0x1c6e('0xf')]++,'VoiceExtensionId':_0x522e78[_0x49f972][0x0]['VoiceExtensionId']});for(var _0x522cb0=0x0,_0x105308=0x0;_0x522cb0<_0x522e78[_0x49f972][_0x1c6e('0x26')];_0x522cb0+=0x1,_0x105308=0x0){var _0x438522=_0x522e78[_0x49f972][_0x522cb0];if(_0x438522['type']){_0x438522['type']=_0x438522[_0x1c6e('0x15')]['toLowerCase']();}var _0x5bac41=[];var _0x20f485=[];delete _0x438522['id'];delete _0x438522[_0x1c6e('0x27')];delete _0x438522[_0x1c6e('0x28')];var _0x3d60a5=_0x438522[_0x1c6e('0x29')]!==_0x1c6e('0x2a')?[_0x438522[_0x1c6e('0x29')]]:_0x438522['IntervalId']?_['map'](_[_0x1c6e('0xa')](_0x331e3e[_0x1c6e('0x6')],{'IntervalId':_0x438522[_0x1c6e('0x8')]}),_0x1c6e('0x29')):[];if(_0x438522[_0x1c6e('0xe')](_0x1c6e('0x2b'))){if(_0x438522[_0x1c6e('0x2b')]&&_0x438522[_0x1c6e('0x2b')]!=='--'){_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522[_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x2c')+_0x438522[_0x1c6e('0x2b')],'context':_0x438522[_0x1c6e('0x16')],'exten':_0x438522['exten'],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e['priority']+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});}}if(_0x438522[_0x1c6e('0x15')]===_0x1c6e('0x1a')&&_0x438522[_0x1c6e('0xe')](_0x1c6e('0x2d'))){if(_0x438522[_0x1c6e('0x2d')]){_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522['type'],'app':_0x1c6e('0x2e'),'appdata':_0x1c6e('0x2f')+_0x438522['callerID']+')','context':_0x438522[_0x1c6e('0x16')],'exten':_0x438522[_0x1c6e('0xc')],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e['priority']+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});}else{_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522['type'],'app':_0x1c6e('0x2e'),'appdata':_0x1c6e('0x30'),'context':_0x438522['context'],'exten':_0x438522[_0x1c6e('0xc')],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e[_0x1c6e('0xf')]+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});}}if(_0x438522[_0x1c6e('0xe')]('answer')){if(_0x4136b3['indexOf'](_0x438522[_0x1c6e('0x31')][_0x1c6e('0x32')]())>=0x0&&_0x438522[_0x1c6e('0x33')]!=='custom'){if(_0x438522[_0x1c6e('0x34')]){_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522[_0x1c6e('0x15')],'app':_0x1c6e('0x2e'),'appdata':_0x1c6e('0x35'),'context':_0x438522[_0x1c6e('0x16')],'exten':_0x438522[_0x1c6e('0xc')],'priority':_0x3d60a5['length']+_0x331e3e[_0x1c6e('0xf')]+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522['type'],'app':_0x1c6e('0x13'),'appdata':_0x1c6e('0x36'),'context':_0x438522['context'],'exten':_0x438522['exten'],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e[_0x1c6e('0xf')]+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});}else{_0x5bac41['push']({'type':_0x438522[_0x1c6e('0x15')],'app':_0x1c6e('0x2e'),'appdata':_0x1c6e('0x37'),'context':_0x438522['context'],'exten':_0x438522[_0x1c6e('0xc')],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e[_0x1c6e('0xf')]+_0x105308++,'VoiceExtensionId':_0x438522[_0x1c6e('0x17')]});_0x5bac41[_0x1c6e('0x12')]({'type':_0x438522[_0x1c6e('0x15')],'app':_0x1c6e('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x438522[_0x1c6e('0x16')],'exten':_0x438522['exten'],'priority':_0x3d60a5[_0x1c6e('0x26')]+_0x331e3e[_0x1c6e('0xf')]+_0x105308++,'VoiceExtensionId':_0x438522['VoiceExtensionId']});}}}for(var _0x7aa62b=0x0;_0x7aa62b<_0x3d60a5[_0x1c6e('0x26')];_0x7aa62b+=0x1){var _0x2aa8ab=_0x331e3e[_0x1c6e('0xf')]+_0x3d60a5[_0x1c6e('0x26')];var _0x48564d=_0x7aa62b===_0x3d60a5[_0x1c6e('0x26')]-0x1?_0x331e3e[_0x1c6e('0xf')]+_0x5bac41[_0x1c6e('0x26')]+_0x20f485[_0x1c6e('0x26')]+0x2:_0x331e3e[_0x1c6e('0xf')]+_0x7aa62b+0x1;_0x5bac41[_0x1c6e('0x38')](_0x7aa62b,0x0,{'type':_0x438522[_0x1c6e('0x15')],'app':_0x1c6e('0x39'),'appdata':_0x3d60a5[_0x7aa62b]+'?'+_0x438522[_0x1c6e('0x16')]+_0x1c6e('0x3a')+_0x2aa8ab+':'+_0x438522['context']+_0x1c6e('0x3a')+_0x48564d,'exten':_0x438522[_0x1c6e('0xc')],'context':_0x438522[_0x1c6e('0x16')],'priority':_0x331e3e[_0x1c6e('0xf')]+_0x7aa62b,'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});}_0x438522[_0x1c6e('0xf')]=_0x5bac41['length']?_['last'](_0x5bac41)[_0x1c6e('0xf')]+0x1:_0x331e3e['priority'];_0x331e3e['priority']=(_0x20f485[_0x1c6e('0x26')]?_[_0x1c6e('0x3b')](_0x20f485)[_0x1c6e('0xf')]:_0x438522[_0x1c6e('0xf')])+0x1;_0x331e3e[_0x1c6e('0x10')]=_[_0x1c6e('0x3c')](_0x331e3e[_0x1c6e('0x10')],_0x5bac41,[_0x438522],_0x20f485);}_0x331e3e[_0x1c6e('0x10')][_0x1c6e('0x12')]({'type':_0x522e78[_0x49f972][0x0]['type'],'app':_0x1c6e('0x3d'),'exten':_0x522e78[_0x49f972][0x0]['exten'],'context':_0x522e78[_0x49f972][0x0][_0x1c6e('0x16')],'priority':_0x331e3e['priority'],'VoiceExtensionId':_0x522e78[_0x49f972][0x0][_0x1c6e('0x17')]});_0x248073['push'](_0x522e78[_0x49f972][0x0]['VoiceExtensionId']);_0x2fa4e0=_[_0x1c6e('0x3c')](_0x2fa4e0,_0x331e3e[_0x1c6e('0x10')]);}}return _0xec2539['transaction'](function(_0x245581){return _0xec2539[_0x1c6e('0x2')][_0x1c6e('0x7')][_0x1c6e('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x248073}},'transaction':_0x245581})[_0x1c6e('0x5')](function(_0x50f3ee){return _0xec2539[_0x1c6e('0x2')][_0x1c6e('0x7')][_0x1c6e('0x3f')](_[_0x1c6e('0x40')](_0x2fa4e0,_0x1c6e('0xf')),{'transaction':_0x245581});});});})['catch'](function(_0x1528fe){console[_0x1c6e('0x41')](_0x1528fe);});}exports[_0x1c6e('0x42')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 396d46b..9fdc931 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 _0x6c32=['BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','argv','undefined','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','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email\x20format\x20is\x20not\x20valid!','ListId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','createdAt','updatedAt','field','NOW()','ContactId','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','cm_hopper','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','push','query','catch','onlyIfOpen','sequelize','VoiceQueueId','all','VoiceQueue'];(function(_0x3512b2,_0x2cb54a){var _0x16c6e8=function(_0x1698d4){while(--_0x1698d4){_0x3512b2['push'](_0x3512b2['shift']());}};_0x16c6e8(++_0x2cb54a);}(_0x6c32,0x81));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var _=require(_0x26c3('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x26c3('0x3'));var Redis=require('ioredis');var db=require(_0x26c3('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x26c3('0x5'))(_0x26c3('0x6'));config[_0x26c3('0x7')]=_['defaults'](config[_0x26c3('0x7')],{'host':_0x26c3('0x8'),'port':0x18eb});var socket=require(_0x26c3('0x9'))(new Redis(config[_0x26c3('0x7')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x26c3('0xa')][0x2]||process['argv'][0x2]===_0x26c3('0xb')||process[_0x26c3('0xa')][0x2]===_0x26c3('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x26c3('0xa')][0x2];if(!process[_0x26c3('0xa')][0x3]||process['argv'][0x3]===_0x26c3('0xb')||process[_0x26c3('0xa')][0x3]===_0x26c3('0xc')||!process['argv'][0x4]||process[_0x26c3('0xa')][0x4]===_0x26c3('0xb')||process[_0x26c3('0xa')][0x4]===_0x26c3('0xc')){throw new Error(_0x26c3('0xd'));}var FIELDS=_[_0x26c3('0xe')](process[_0x26c3('0xa')][0x3]['split'](','),process['argv'][0x4][_0x26c3('0xf')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x26c3('0xb')||process['argv'][0x5]===_0x26c3('0xc')){throw new Error(_0x26c3('0x10'));}var LISTID=process[_0x26c3('0xa')][0x5];var COMPANYID=process[_0x26c3('0xa')][0x6]&&process[_0x26c3('0xa')][0x6]!=='undefined'&&process[_0x26c3('0xa')][0x6]!==_0x26c3('0xc')?process['argv'][0x6]:null;var DUPLICATES=process[_0x26c3('0xa')][0x7]&&process[_0x26c3('0xa')][0x7]!=='undefined'&&process[_0x26c3('0xa')][0x7]!==_0x26c3('0xc')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x26c3('0xa')][0x8]===_0x26c3('0xb')||process[_0x26c3('0xa')][0x8]==='null'){throw new Error(_0x26c3('0x11'));}var SOCKET_TIMESTAMP=process[_0x26c3('0xa')][0x8];}catch(_0x4d7fe3){logger[_0x26c3('0x12')](_0x4d7fe3);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(_0x3549da,_0x58cfc2,_0x37d8fa,_0x58e84c){var _0x24c39f={'message':_0x58cfc2};_0x24c39f[_0x3549da]=!![];if(_0x37d8fa){_0x24c39f[_0x26c3('0x13')]=_0x37d8fa;}if(_0x58e84c){_0x24c39f['index']=_0x58e84c;}return _0x24c39f;}function isEmail(_0x4acad8){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))*$/[_0x26c3('0x14')](_0x4acad8);}function checkRow(_0x14d40f,_0x2c5f57,_0x1fc571){return new BPromise(function(_0x3e531,_0x49ed09){if(_[_0x26c3('0x15')](_0x14d40f)){return _0x49ed09(handleCheckRowError(_0x26c3('0x12'),_0x26c3('0x16'),null,_0x1fc571));}if(_0x14d40f[_0x26c3('0x17')]&&_0x14d40f[_0x26c3('0x17')]['length']){var _0x4053af=_[_0x26c3('0x18')](_0x14d40f['errors'],_0x26c3('0x19'))[_0x26c3('0x1a')](';');return _0x49ed09(handleCheckRowError('error',_0x4053af,null,_0x1fc571));}var _0x1dc803={};for(var _0x5ab8ed in FIELDS){if(FIELDS[_0x26c3('0x1b')](_0x5ab8ed)&&FIELDS[_0x5ab8ed]){_0x1dc803[_0x5ab8ed]=_0x14d40f['data'][0x0][FIELDS[_0x5ab8ed]]||_0x14d40f[_0x26c3('0x1c')][0x0]['\ufeff'+FIELDS[_0x5ab8ed]];}}if(!_0x1dc803[_0x26c3('0x1d')]){return _0x49ed09(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1fc571));}if(!_0x1dc803[_0x26c3('0x1e')]){return _0x49ed09(handleCheckRowError(_0x26c3('0x12'),_0x26c3('0x1f'),null,_0x1fc571));}if(_0x1dc803[_0x26c3('0x20')]){var _0x1215e5=moment(_0x1dc803[_0x26c3('0x20')],_0x26c3('0x21'));if(!_0x1215e5[_0x26c3('0x22')]()){return _0x49ed09(handleCheckRowError(_0x26c3('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1fc571));}}if(_0x1dc803['email']){if(!isEmail(_0x1dc803['email'])){return _0x49ed09(handleCheckRowError(_0x26c3('0x12'),_0x26c3('0x23'),null,_0x1fc571));}}_0x1dc803[_0x26c3('0x24')]=LISTID;_0x1dc803['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x26c3('0x25')]&&_0x2c5f57){var _0x23dbc1={};for(var _0x39b9a3=0x0,_0x465f20=DUPLICATES[_0x26c3('0x25')];_0x39b9a3<_0x465f20;_0x39b9a3+=0x1){_0x23dbc1[DUPLICATES[_0x39b9a3]]=_0x1dc803[DUPLICATES[_0x39b9a3]];}var _0x948e31=_[_0x26c3('0x26')](_0x2c5f57,_0x23dbc1);if(_0x948e31){return _0x49ed09(handleCheckRowError(_0x26c3('0x27'),_0x26c3('0x28'),_0x948e31,_0x1fc571));}}return db[_0x26c3('0x29')][_0x26c3('0x2a')](_0x1dc803,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1dc803)})['then'](function(_0x3619d8){if(DUPLICATES&&DUPLICATES[_0x26c3('0x25')]&&_0x2c5f57){_0x2c5f57['push'](_['pick'](_0x1dc803,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3619d8['id'];return _0x3e531();})['catch'](function(_0x437c44){return _0x49ed09(handleCheckRowError('error',_0x26c3('0x2b')+(_0x437c44[_0x26c3('0x19')]||JSON[_0x26c3('0x2c')](_0x437c44)),null,_0x1fc571));});});}function checkHopper(){function _0x2a239f(){return function(_0x3d62ad){logger[_0x26c3('0x12')](_0x26c3('0x2d'),_0x26c3('0x2e'),util[_0x26c3('0x2f')](_0x3d62ad,{'showHidden':![],'depth':null}));};}var _0x59afa9=function(_0x386b5e,_0x58f5c2){var _0x1b2e4e=squel[_0x26c3('0x30')]()[_0x26c3('0x31')]('cm_hopper')[_0x26c3('0x32')]([_0x26c3('0x1e'),_0x26c3('0x33'),'ContactId',_0x26c3('0x24'),_0x58f5c2,_0x26c3('0x34'),_0x26c3('0x35')],squel['select']()[_0x26c3('0x36')](_0x26c3('0x1e'),_0x26c3('0x1e'))[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x33'))[_0x26c3('0x36')]('id',_0x26c3('0x38'))[_0x26c3('0x36')](LISTID[_0x26c3('0x39')](),_0x26c3('0x24'))[_0x26c3('0x36')](_0x386b5e['id'][_0x26c3('0x39')](),_0x58f5c2)[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x34'))['field']('NOW()',_0x26c3('0x35'))['from'](_0x26c3('0x3a'))[_0x26c3('0x3b')](_0x26c3('0x3c'))[_0x26c3('0x3b')](_0x26c3('0x3d'),LISTID[_0x26c3('0x39')]())[_0x26c3('0x3b')](_0x26c3('0x3e'))['where'](_0x26c3('0x3f'),squel[_0x26c3('0x40')]()[_0x26c3('0x36')]('phone')[_0x26c3('0x41')](_0x26c3('0x42'))[_0x26c3('0x3b')](_0x58f5c2+_0x26c3('0x43'),_0x386b5e['id'][_0x26c3('0x39')]())))[_0x26c3('0x39')]();return _0x1b2e4e;};var _0x3acae3=function(_0x55b7e0,_0x30f3a5){var _0x3ee0e2=squel['insert']()[_0x26c3('0x31')](_0x26c3('0x42'))[_0x26c3('0x32')](['phone',_0x26c3('0x33'),_0x26c3('0x38'),'ListId',_0x30f3a5,'createdAt',_0x26c3('0x35')],squel[_0x26c3('0x40')]()[_0x26c3('0x36')](_0x26c3('0x1e'),_0x26c3('0x1e'))['field']('NOW()',_0x26c3('0x33'))[_0x26c3('0x36')]('id',_0x26c3('0x38'))[_0x26c3('0x36')](LISTID[_0x26c3('0x39')](),_0x26c3('0x24'))[_0x26c3('0x36')](_0x55b7e0['id'][_0x26c3('0x39')](),_0x30f3a5)['field'](_0x26c3('0x37'),_0x26c3('0x34'))[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x35'))[_0x26c3('0x41')](_0x26c3('0x3a'))[_0x26c3('0x3b')](_0x26c3('0x3c'))['where'](_0x26c3('0x3d'),LISTID[_0x26c3('0x39')]())['where'](_0x26c3('0x44'),squel[_0x26c3('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x26c3('0x40')]()[_0x26c3('0x36')](_0x26c3('0x46'))[_0x26c3('0x41')](_0x26c3('0x47'))['where'](_0x30f3a5+'\x20=\x20?',_0x55b7e0['id'][_0x26c3('0x39')]()))[_0x26c3('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x26c3('0x40')]()[_0x26c3('0x36')]('phone')[_0x26c3('0x41')](_0x26c3('0x42'))['where'](_0x30f3a5+_0x26c3('0x43'),_0x55b7e0['id'][_0x26c3('0x39')]())))['toString']();return _0x3ee0e2;};function _0x3dc11c(_0x2efd66,_0x2587a1){var _0x4cd5bc=squel['insert']()['into'](_0x26c3('0x42'))[_0x26c3('0x32')]([_0x26c3('0x1e'),_0x26c3('0x33'),_0x26c3('0x38'),_0x26c3('0x24'),_0x2587a1,_0x26c3('0x34'),_0x26c3('0x35')],squel['select']()['field'](_0x26c3('0x1e'),_0x26c3('0x1e'))[_0x26c3('0x36')]('NOW()','scheduledAt')[_0x26c3('0x36')]('id',_0x26c3('0x38'))[_0x26c3('0x36')](LISTID['toString'](),_0x26c3('0x24'))['field'](_0x2efd66['id'][_0x26c3('0x39')](),_0x2587a1)['field'](_0x26c3('0x37'),_0x26c3('0x34'))[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x35'))[_0x26c3('0x41')]('cm_contacts')[_0x26c3('0x3b')](_0x26c3('0x3c'))[_0x26c3('0x3b')]('ListId\x20=\x20?',LISTID['toString']())[_0x26c3('0x3b')](_0x26c3('0x44'),squel[_0x26c3('0x45')](hopperContacts))['where'](_0x26c3('0x3e')))[_0x26c3('0x39')]();return _0x4cd5bc;}function _0x1b0fa1(_0xf6e0d5,_0x1cd2c1){var _0x421953=squel[_0x26c3('0x30')]()['into'](_0x26c3('0x48'))['fromQuery']([_0x26c3('0x1e'),_0x26c3('0x38'),_0x26c3('0x24'),_0x1cd2c1,_0x26c3('0x34'),_0x26c3('0x35')],squel['select']()[_0x26c3('0x36')]('phone',_0x26c3('0x1e'))[_0x26c3('0x36')]('id',_0x26c3('0x38'))[_0x26c3('0x36')](LISTID[_0x26c3('0x39')](),_0x26c3('0x24'))[_0x26c3('0x36')](_0xf6e0d5['id'][_0x26c3('0x39')](),_0x1cd2c1)[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x34'))[_0x26c3('0x36')](_0x26c3('0x37'),_0x26c3('0x35'))['from'](_0x26c3('0x3a'))[_0x26c3('0x3b')](_0x26c3('0x3c'))['where'](_0x26c3('0x3d'),LISTID['toString']())[_0x26c3('0x3b')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x26c3('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x26c3('0x39')]();return _0x421953;}return db['VoiceQueue'][_0x26c3('0x49')]({'where':{'type':_0x26c3('0x4a')},'attributes':['id',_0x26c3('0x4b')],'include':[{'model':db[_0x26c3('0x4c')],'as':_0x26c3('0x4d'),'where':{'id':LISTID}}]})[_0x26c3('0x4e')](function(_0x607cd3){var _0x247937=[];if(_0x607cd3){var _0x209b30;for(var _0x236ade=0x0,_0x51cbea;_0x236ade<_0x607cd3[_0x26c3('0x25')];_0x236ade+=0x1){_0x51cbea=_0x607cd3[_0x236ade][_0x26c3('0x4f')]({'plain':!![]});switch(_0x51cbea['dialCheckDuplicateType']){case _0x26c3('0x50'):_0x247937[_0x26c3('0x51')](db['sequelize'][_0x26c3('0x52')](_0x3acae3(_0x51cbea,'VoiceQueueId'))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));break;case _0x26c3('0x54'):_0x247937[_0x26c3('0x51')](db[_0x26c3('0x55')][_0x26c3('0x52')](_0x59afa9(_0x51cbea,_0x26c3('0x56')))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));break;default:_0x247937['push'](db['sequelize'][_0x26c3('0x52')](_0x3dc11c(_0x51cbea,_0x26c3('0x56')))['then'](function(){})[_0x26c3('0x53')](_0x2a239f()));}}}return _0x247937;})[_0x26c3('0x57')]()[_0x26c3('0x4e')](function(){return db[_0x26c3('0x58')][_0x26c3('0x49')]({'where':{'type':_0x26c3('0x4a')},'attributes':['id'],'include':[{'model':db[_0x26c3('0x4c')],'as':_0x26c3('0x59'),'where':{'id':LISTID}}]})[_0x26c3('0x4e')](function(_0x30b2bf){var _0x4d176f=[];if(_0x30b2bf){var _0xb397ac;for(var _0x4845da=0x0,_0x2893ac;_0x4845da<_0x30b2bf[_0x26c3('0x25')];_0x4845da+=0x1){_0x2893ac=_0x30b2bf[_0x4845da][_0x26c3('0x4f')]({'plain':!![]});_0x4d176f['push'](db[_0x26c3('0x55')][_0x26c3('0x52')](_0x1b0fa1(_0x2893ac,_0x26c3('0x56')))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));}}return _0x4d176f;})[_0x26c3('0x57')]();})['then'](function(){return db[_0x26c3('0x5a')]['findAll']({'attributes':['id',_0x26c3('0x4b')],'include':[{'model':db[_0x26c3('0x4c')],'as':_0x26c3('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0x1eafb1){var _0x2afe4c=[];if(_0x1eafb1){for(var _0x30ecf8=0x0,_0x34cca6;_0x30ecf8<_0x1eafb1[_0x26c3('0x25')];_0x30ecf8+=0x1){_0x34cca6=_0x1eafb1[_0x30ecf8][_0x26c3('0x4f')]({'plain':!![]});switch(_0x34cca6[_0x26c3('0x4b')]){case'always':_0x2afe4c[_0x26c3('0x51')](db[_0x26c3('0x55')]['query'](_0x3acae3(_0x34cca6,'CampaignId'))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));break;case _0x26c3('0x54'):_0x2afe4c['push'](db[_0x26c3('0x55')][_0x26c3('0x52')](_0x59afa9(_0x34cca6,'CampaignId'))['then'](function(){})[_0x26c3('0x53')](_0x2a239f()));break;default:_0x2afe4c['push'](db[_0x26c3('0x55')][_0x26c3('0x52')](_0x3dc11c(_0x34cca6,_0x26c3('0x5b')))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));}}}return _0x2afe4c;})[_0x26c3('0x57')]();})['then'](function(){return db[_0x26c3('0x5a')][_0x26c3('0x49')]({'attributes':['id'],'include':[{'model':db[_0x26c3('0x4c')],'as':_0x26c3('0x59'),'where':{'id':LISTID}}]})['then'](function(_0xe6a084){var _0x4fbc1d=[];if(_0xe6a084){for(var _0x550d5d=0x0,_0x39f4bf;_0x550d5d<_0xe6a084[_0x26c3('0x25')];_0x550d5d+=0x1){_0x39f4bf=_0xe6a084[_0x550d5d][_0x26c3('0x4f')]({'plain':!![]});_0x4fbc1d[_0x26c3('0x51')](db[_0x26c3('0x55')][_0x26c3('0x52')](_0x1b0fa1(_0x39f4bf,'CampaignId'))[_0x26c3('0x4e')](function(){})[_0x26c3('0x53')](_0x2a239f()));}}return _0x4fbc1d;})['all']();})['catch'](function(_0x3ca4d5){logger[_0x26c3('0x12')](_0x26c3('0x5c'),_0x26c3('0x5d'),_0x3ca4d5[_0x26c3('0x19')]);});}var processPromises=function(_0x4a7696){return BPromise[_0x26c3('0x57')](promises)['then'](function(_0x576525){})[_0x26c3('0x53')](function(_0x433d15){logger[_0x26c3('0x12')](_0x26c3('0x5e'),JSON[_0x26c3('0x2c')](_0x433d15));})[_0x26c3('0x5f')](function(){socket['emit'](_0x26c3('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4a7696){return _0x4a7696[_0x26c3('0x61')]();}});};var endCsv=function(){return BPromise[_0x26c3('0x62')]()[_0x26c3('0x4e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x26c3('0x63')](_0x26c3('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x26c3('0x64')](FILEPATH);}catch(_0x264ae3){logger['error'](_0x26c3('0x65'),JSON[_0x26c3('0x2c')](_0x264ae3));}finally{process[_0x26c3('0x66')](0x0);}});};process['on'](_0x26c3('0x67'),function(){logger[_0x26c3('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x26c3('0x62')]()[_0x26c3('0x4e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x26c3('0xf')](',');return db[_0x26c3('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x26c3('0x4e')](function(_0x31f759){var _0x35f1cd=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x26c3('0x69')](_0x35f1cd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x579716,_0x26dfd4){total+=0x1;var _0x141027=total;promises[_0x26c3('0x51')](checkRow(_0x579716,_0x31f759,_0x141027)[_0x26c3('0x4e')](function(){success+=0x1;})['catch'](function(_0x3acce2){if(_0x3acce2[_0x26c3('0x12')]){errors+=0x1;delete _0x3acce2[_0x26c3('0x12')];}else if(_0x3acce2[_0x26c3('0x27')]){duplicates+=0x1;delete _0x3acce2['duplicate'];}rows[_0x26c3('0x51')](_0x3acce2);}));if(total%0xc8===0x0){_0x26dfd4[_0x26c3('0x6a')]();return processPromises(_0x26dfd4);}},'complete':function(){return processPromises()[_0x26c3('0x4e')](function(){logger[_0x26c3('0x68')](_0x26c3('0x6b'));endCsv();});},'error':function(_0x28a79c,_0x21d5b3){logger[_0x26c3('0x68')]('CSV\x20parse\x20error',JSON[_0x26c3('0x2c')](_0x28a79c));endCsv();}});})[_0x26c3('0x53')](function(_0x2301b7){logger['error'](_0x26c3('0x6c'),JSON[_0x26c3('0x2c')](_0x2301b7));});}main(); \ No newline at end of file +var _0x21f2=['always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','CmList','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','bluebird','squel','papaparse','ioredis','../../../mysqldb','api','redis','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','join','hasOwnProperty','data','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','cm_contacts','toString','where','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','from','ListId\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get'];(function(_0x3d922b,_0x1d5979){var _0x44638b=function(_0x537248){while(--_0x537248){_0x3d922b['push'](_0x3d922b['shift']());}};_0x44638b(++_0x1d5979);}(_0x21f2,0x84));var _0x221f=function(_0x34889d,_0x2eada8){_0x34889d=_0x34889d-0x0;var _0x187e7c=_0x21f2[_0x34889d];return _0x187e7c;};'use strict';var BPromise=require(_0x221f('0x0'));var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x221f('0x1'));var Papa=require(_0x221f('0x2'));var Redis=require(_0x221f('0x3'));var db=require(_0x221f('0x4'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x221f('0x5'));config['redis']=_['defaults'](config[_0x221f('0x6')],{'host':_0x221f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x221f('0x8'))['register'](socket);try{if(!process[_0x221f('0x9')][0x2]||process[_0x221f('0x9')][0x2]===_0x221f('0xa')||process[_0x221f('0x9')][0x2]===_0x221f('0xb')){throw new Error(_0x221f('0xc'));}var FILEPATH=process[_0x221f('0x9')][0x2];if(!process[_0x221f('0x9')][0x3]||process[_0x221f('0x9')][0x3]==='undefined'||process['argv'][0x3]==='null'||!process[_0x221f('0x9')][0x4]||process['argv'][0x4]===_0x221f('0xa')||process[_0x221f('0x9')][0x4]===_0x221f('0xb')){throw new Error(_0x221f('0xd'));}var FIELDS=_[_0x221f('0xe')](process['argv'][0x3]['split'](','),process[_0x221f('0x9')][0x4][_0x221f('0xf')](','));if(!process[_0x221f('0x9')][0x5]||process['argv'][0x5]==='undefined'||process['argv'][0x5]===_0x221f('0xb')){throw new Error(_0x221f('0x10'));}var LISTID=process[_0x221f('0x9')][0x5];var COMPANYID=process[_0x221f('0x9')][0x6]&&process[_0x221f('0x9')][0x6]!==_0x221f('0xa')&&process[_0x221f('0x9')][0x6]!==_0x221f('0xb')?process[_0x221f('0x9')][0x6]:null;var DUPLICATES=process[_0x221f('0x9')][0x7]&&process['argv'][0x7]!==_0x221f('0xa')&&process[_0x221f('0x9')][0x7]!==_0x221f('0xb')?process[_0x221f('0x9')][0x7]:null;if(!process[_0x221f('0x9')][0x8]||process['argv'][0x8]===_0x221f('0xa')||process[_0x221f('0x9')][0x8]===_0x221f('0xb')){throw new Error(_0x221f('0x11'));}var SOCKET_TIMESTAMP=process[_0x221f('0x9')][0x8];}catch(_0xdac1c3){logger[_0x221f('0x12')](_0xdac1c3);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(_0x41e8d2,_0x53faba,_0x20ed0c,_0x3a50df){var _0x1c5c1c={'message':_0x53faba};_0x1c5c1c[_0x41e8d2]=!![];if(_0x20ed0c){_0x1c5c1c[_0x221f('0x13')]=_0x20ed0c;}if(_0x3a50df){_0x1c5c1c[_0x221f('0x14')]=_0x3a50df;}return _0x1c5c1c;}function isEmail(_0x40d014){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'](_0x40d014);}function checkRow(_0x2d4192,_0x3611a5,_0x2e57cb){return new BPromise(function(_0x2e1170,_0x4363c7){if(_[_0x221f('0x15')](_0x2d4192)){return _0x4363c7(handleCheckRowError(_0x221f('0x12'),_0x221f('0x16'),null,_0x2e57cb));}if(_0x2d4192['errors']&&_0x2d4192['errors'][_0x221f('0x17')]){var _0x5a54f0=_['map'](_0x2d4192['errors'],'message')[_0x221f('0x18')](';');return _0x4363c7(handleCheckRowError(_0x221f('0x12'),_0x5a54f0,null,_0x2e57cb));}var _0x37d296={};for(var _0x1190d7 in FIELDS){if(FIELDS[_0x221f('0x19')](_0x1190d7)&&FIELDS[_0x1190d7]){_0x37d296[_0x1190d7]=_0x2d4192[_0x221f('0x1a')][0x0][FIELDS[_0x1190d7]]||_0x2d4192[_0x221f('0x1a')][0x0]['\ufeff'+FIELDS[_0x1190d7]];}}if(!_0x37d296['firstName']){return _0x4363c7(handleCheckRowError(_0x221f('0x12'),'firstName\x20not\x20specified!',null,_0x2e57cb));}if(!_0x37d296[_0x221f('0x1b')]){return _0x4363c7(handleCheckRowError(_0x221f('0x12'),'phone\x20not\x20specified!',null,_0x2e57cb));}if(_0x37d296[_0x221f('0x1c')]){var _0x21ee87=moment(_0x37d296['birthDate'],_0x221f('0x1d'));if(!_0x21ee87[_0x221f('0x1e')]()){return _0x4363c7(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x2e57cb));}}if(_0x37d296[_0x221f('0x1f')]){if(!isEmail(_0x37d296[_0x221f('0x1f')])){return _0x4363c7(handleCheckRowError('error',_0x221f('0x20'),null,_0x2e57cb));}}_0x37d296[_0x221f('0x21')]=LISTID;_0x37d296[_0x221f('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x221f('0x17')]&&_0x3611a5){var _0x176668={};for(var _0x1a7b39=0x0,_0xd9d739=DUPLICATES[_0x221f('0x17')];_0x1a7b39<_0xd9d739;_0x1a7b39+=0x1){_0x176668[DUPLICATES[_0x1a7b39]]=_0x37d296[DUPLICATES[_0x1a7b39]];}var _0x17306f=_[_0x221f('0x23')](_0x3611a5,_0x176668);if(_0x17306f){return _0x4363c7(handleCheckRowError('duplicate',_0x221f('0x24'),_0x17306f,_0x2e57cb));}}return db[_0x221f('0x25')][_0x221f('0x26')](_0x37d296,{'raw':!![],'hooks':![],'fields':_['keys'](_0x37d296)})[_0x221f('0x27')](function(_0xb8e376){if(DUPLICATES&&DUPLICATES['length']&&_0x3611a5){_0x3611a5[_0x221f('0x28')](_[_0x221f('0x29')](_0x37d296,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xb8e376['id'];return _0x2e1170();})[_0x221f('0x2a')](function(_0x5ef03c){return _0x4363c7(handleCheckRowError(_0x221f('0x12'),_0x221f('0x2b')+(_0x5ef03c[_0x221f('0x2c')]||JSON['stringify'](_0x5ef03c)),null,_0x2e57cb));});});}function checkHopper(){function _0x3a3ce9(){return function(_0x376b65){logger[_0x221f('0x12')]('cmContact',_0x221f('0x2d'),util[_0x221f('0x2e')](_0x376b65,{'showHidden':![],'depth':null}));};}var _0x41a863=function(_0x1c8ebf,_0x31fe01){var _0xd0455b=squel[_0x221f('0x2f')]()[_0x221f('0x30')]('cm_hopper')[_0x221f('0x31')]([_0x221f('0x1b'),_0x221f('0x32'),_0x221f('0x33'),_0x221f('0x21'),_0x31fe01,_0x221f('0x34'),_0x221f('0x35')],squel[_0x221f('0x36')]()[_0x221f('0x37')](_0x221f('0x1b'),_0x221f('0x1b'))['field']('NOW()',_0x221f('0x32'))['field']('id',_0x221f('0x33'))[_0x221f('0x37')](LISTID['toString'](),'ListId')[_0x221f('0x37')](_0x1c8ebf['id']['toString'](),_0x31fe01)[_0x221f('0x37')](_0x221f('0x38'),'createdAt')['field'](_0x221f('0x38'),_0x221f('0x35'))['from'](_0x221f('0x39'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID[_0x221f('0x3a')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x221f('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x221f('0x36')]()['field'](_0x221f('0x1b'))['from'](_0x221f('0x3c'))[_0x221f('0x3b')](_0x31fe01+_0x221f('0x3d'),_0x1c8ebf['id'][_0x221f('0x3a')]())))['toString']();return _0xd0455b;};var _0x29847c=function(_0x17bfad,_0x5e7087){var _0x47efe9=squel[_0x221f('0x2f')]()['into'](_0x221f('0x3c'))[_0x221f('0x31')]([_0x221f('0x1b'),_0x221f('0x32'),_0x221f('0x33'),'ListId',_0x5e7087,'createdAt',_0x221f('0x35')],squel[_0x221f('0x36')]()[_0x221f('0x37')](_0x221f('0x1b'),_0x221f('0x1b'))['field']('NOW()',_0x221f('0x32'))[_0x221f('0x37')]('id','ContactId')[_0x221f('0x37')](LISTID[_0x221f('0x3a')](),_0x221f('0x21'))['field'](_0x17bfad['id'][_0x221f('0x3a')](),_0x5e7087)['field'](_0x221f('0x38'),_0x221f('0x34'))[_0x221f('0x37')](_0x221f('0x38'),'updatedAt')['from'](_0x221f('0x39'))[_0x221f('0x3b')](_0x221f('0x3e'))[_0x221f('0x3b')]('ListId\x20=\x20?',LISTID[_0x221f('0x3a')]())[_0x221f('0x3b')]('id\x20IN\x20?',squel[_0x221f('0x3f')](hopperContacts))[_0x221f('0x3b')](_0x221f('0x40'))[_0x221f('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x221f('0x36')]()[_0x221f('0x37')](_0x221f('0x41'))['from'](_0x221f('0x42'))[_0x221f('0x3b')](_0x5e7087+_0x221f('0x3d'),_0x17bfad['id']['toString']()))[_0x221f('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x221f('0x36')]()[_0x221f('0x37')](_0x221f('0x1b'))[_0x221f('0x43')]('cm_hopper')[_0x221f('0x3b')](_0x5e7087+_0x221f('0x3d'),_0x17bfad['id']['toString']())))[_0x221f('0x3a')]();return _0x47efe9;};function _0x1adda4(_0x1072fc,_0x83889e){var _0x34c7af=squel[_0x221f('0x2f')]()['into']('cm_hopper')[_0x221f('0x31')](['phone','scheduledAt','ContactId',_0x221f('0x21'),_0x83889e,_0x221f('0x34'),'updatedAt'],squel[_0x221f('0x36')]()['field'](_0x221f('0x1b'),'phone')[_0x221f('0x37')](_0x221f('0x38'),'scheduledAt')[_0x221f('0x37')]('id',_0x221f('0x33'))[_0x221f('0x37')](LISTID[_0x221f('0x3a')](),_0x221f('0x21'))[_0x221f('0x37')](_0x1072fc['id'][_0x221f('0x3a')](),_0x83889e)[_0x221f('0x37')](_0x221f('0x38'),_0x221f('0x34'))[_0x221f('0x37')](_0x221f('0x38'),_0x221f('0x35'))[_0x221f('0x43')](_0x221f('0x39'))[_0x221f('0x3b')](_0x221f('0x3e'))[_0x221f('0x3b')](_0x221f('0x44'),LISTID[_0x221f('0x3a')]())['where'](_0x221f('0x45'),squel[_0x221f('0x3f')](hopperContacts))[_0x221f('0x3b')](_0x221f('0x40')))['toString']();return _0x34c7af;}function _0xe7663b(_0x3d4713,_0x3b805d){var _0x2c9002=squel[_0x221f('0x2f')]()['into'](_0x221f('0x46'))[_0x221f('0x31')]([_0x221f('0x1b'),_0x221f('0x33'),_0x221f('0x21'),_0x3b805d,_0x221f('0x34'),_0x221f('0x35')],squel[_0x221f('0x36')]()[_0x221f('0x37')](_0x221f('0x1b'),_0x221f('0x1b'))['field']('id',_0x221f('0x33'))['field'](LISTID['toString'](),_0x221f('0x21'))['field'](_0x3d4713['id']['toString'](),_0x3b805d)[_0x221f('0x37')]('NOW()',_0x221f('0x34'))[_0x221f('0x37')](_0x221f('0x38'),_0x221f('0x35'))['from'](_0x221f('0x39'))[_0x221f('0x3b')](_0x221f('0x3e'))['where'](_0x221f('0x44'),LISTID[_0x221f('0x3a')]())[_0x221f('0x3b')](_0x221f('0x45'),squel[_0x221f('0x3f')](hopperContacts))[_0x221f('0x3b')](_0x221f('0x40')))['toString']();return _0x2c9002;}return db[_0x221f('0x47')]['findAll']({'where':{'type':_0x221f('0x48')},'attributes':['id',_0x221f('0x49')],'include':[{'model':db['CmList'],'as':_0x221f('0x4a'),'where':{'id':LISTID}}]})[_0x221f('0x27')](function(_0x140300){var _0x4c853f=[];if(_0x140300){var _0x183767;for(var _0x113ce2=0x0,_0x66c33;_0x113ce2<_0x140300[_0x221f('0x17')];_0x113ce2+=0x1){_0x66c33=_0x140300[_0x113ce2][_0x221f('0x4b')]({'plain':!![]});switch(_0x66c33[_0x221f('0x49')]){case _0x221f('0x4c'):_0x4c853f[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0x29847c(_0x66c33,_0x221f('0x4f')))['then'](function(){})['catch'](_0x3a3ce9()));break;case _0x221f('0x50'):_0x4c853f[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0x41a863(_0x66c33,_0x221f('0x4f')))[_0x221f('0x27')](function(){})[_0x221f('0x2a')](_0x3a3ce9()));break;default:_0x4c853f[_0x221f('0x28')](db['sequelize']['query'](_0x1adda4(_0x66c33,'VoiceQueueId'))['then'](function(){})[_0x221f('0x2a')](_0x3a3ce9()));}}}return _0x4c853f;})[_0x221f('0x51')]()[_0x221f('0x27')](function(){return db[_0x221f('0x47')][_0x221f('0x52')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x221f('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x30d6d6){var _0x51544a=[];if(_0x30d6d6){var _0x10f7b0;for(var _0x57740b=0x0,_0xbc8e8;_0x57740b<_0x30d6d6[_0x221f('0x17')];_0x57740b+=0x1){_0xbc8e8=_0x30d6d6[_0x57740b][_0x221f('0x4b')]({'plain':!![]});_0x51544a['push'](db[_0x221f('0x4d')][_0x221f('0x4e')](_0xe7663b(_0xbc8e8,_0x221f('0x4f')))['then'](function(){})[_0x221f('0x2a')](_0x3a3ce9()));}}return _0x51544a;})[_0x221f('0x51')]();})[_0x221f('0x27')](function(){return db[_0x221f('0x54')][_0x221f('0x52')]({'attributes':['id',_0x221f('0x49')],'include':[{'model':db[_0x221f('0x55')],'as':_0x221f('0x4a'),'where':{'id':LISTID}}]})[_0x221f('0x27')](function(_0x24a907){var _0x210ad9=[];if(_0x24a907){for(var _0x31a42a=0x0,_0x15465e;_0x31a42a<_0x24a907[_0x221f('0x17')];_0x31a42a+=0x1){_0x15465e=_0x24a907[_0x31a42a][_0x221f('0x4b')]({'plain':!![]});switch(_0x15465e[_0x221f('0x49')]){case _0x221f('0x4c'):_0x210ad9[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0x29847c(_0x15465e,'CampaignId'))[_0x221f('0x27')](function(){})[_0x221f('0x2a')](_0x3a3ce9()));break;case _0x221f('0x50'):_0x210ad9[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0x41a863(_0x15465e,'CampaignId'))[_0x221f('0x27')](function(){})[_0x221f('0x2a')](_0x3a3ce9()));break;default:_0x210ad9[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0x1adda4(_0x15465e,_0x221f('0x56')))[_0x221f('0x27')](function(){})[_0x221f('0x2a')](_0x3a3ce9()));}}}return _0x210ad9;})[_0x221f('0x51')]();})[_0x221f('0x27')](function(){return db[_0x221f('0x54')][_0x221f('0x52')]({'attributes':['id'],'include':[{'model':db[_0x221f('0x55')],'as':_0x221f('0x53'),'where':{'id':LISTID}}]})[_0x221f('0x27')](function(_0x2bba66){var _0x21208e=[];if(_0x2bba66){for(var _0x5166b3=0x0,_0x16b9d2;_0x5166b3<_0x2bba66[_0x221f('0x17')];_0x5166b3+=0x1){_0x16b9d2=_0x2bba66[_0x5166b3][_0x221f('0x4b')]({'plain':!![]});_0x21208e[_0x221f('0x28')](db[_0x221f('0x4d')][_0x221f('0x4e')](_0xe7663b(_0x16b9d2,_0x221f('0x56')))[_0x221f('0x27')](function(){})[_0x221f('0x2a')](_0x3a3ce9()));}}return _0x21208e;})['all']();})[_0x221f('0x2a')](function(_0x232ba0){logger[_0x221f('0x12')](_0x221f('0x57'),_0x221f('0x58'),_0x232ba0['message']);});}var processPromises=function(_0x3e3860){return BPromise['all'](promises)['then'](function(_0x238904){})[_0x221f('0x2a')](function(_0x5eda63){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x221f('0x59')](_0x5eda63));})[_0x221f('0x5a')](function(){socket['emit'](_0x221f('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3e3860){return _0x3e3860[_0x221f('0x5c')]();}});};var endCsv=function(){return BPromise[_0x221f('0x5d')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x221f('0x27')](function(){socket[_0x221f('0x5e')](_0x221f('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x256a52){logger['error'](_0x221f('0x5f'),JSON[_0x221f('0x59')](_0x256a52));}finally{process[_0x221f('0x60')](0x0);}});};process['on'](_0x221f('0x61'),function(){logger[_0x221f('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x221f('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x221f('0xf')](',');return db[_0x221f('0x25')][_0x221f('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x221f('0x27')](function(_0x5a48e){var _0x18fc3d=fs[_0x221f('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x221f('0x64')](_0x18fc3d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a3523,_0x52ce96){total+=0x1;var _0x1f49f1=total;promises['push'](checkRow(_0x2a3523,_0x5a48e,_0x1f49f1)['then'](function(){success+=0x1;})[_0x221f('0x2a')](function(_0x46f081){if(_0x46f081[_0x221f('0x12')]){errors+=0x1;delete _0x46f081['error'];}else if(_0x46f081[_0x221f('0x65')]){duplicates+=0x1;delete _0x46f081['duplicate'];}rows['push'](_0x46f081);}));if(total%0xc8===0x0){_0x52ce96[_0x221f('0x66')]();return processPromises(_0x52ce96);}},'complete':function(){return processPromises()['then'](function(){logger[_0x221f('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3c5cf7,_0x4e2433){logger[_0x221f('0x62')](_0x221f('0x67'),JSON[_0x221f('0x59')](_0x3c5cf7));endCsv();}});})[_0x221f('0x2a')](function(_0x2bf953){logger[_0x221f('0x12')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x221f('0x59')](_0x2bf953));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3fedf05..cc3cbc3 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 _0x0f6c=['existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','findOne','update','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','join','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','cm_contacts','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','cm_hopper.id','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','Received\x20SIGINT','error','message','exit','info','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','stringify','send','start','binding','socket_timestamp','server/files/tmp','includes','header','name','_description','parse','data','errors','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','\x20not\x20specified','description','rows','emit','Abort\x20parser','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','argv','root'];(function(_0x5d9efa,_0x5a0f17){var _0x11bb09=function(_0x495866){while(--_0x495866){_0x5d9efa['push'](_0x5d9efa['shift']());}};_0x11bb09(++_0x5a0f17);}(_0x0f6c,0x163));var _0xc0f6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0f6c[_0x501510];return _0x1e6ee5;};'use strict';var fs=require('fs');var path=require(_0xc0f6('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xc0f6('0x1'));var BPromise=require(_0xc0f6('0x2'));var moment=require(_0xc0f6('0x3'));var squel=require('squel');var Redis=require(_0xc0f6('0x4'));var db=require(_0xc0f6('0x5'))['db'];var config=require(_0xc0f6('0x6'));var shared=require(_0xc0f6('0x7'));var logger=require(_0xc0f6('0x8'))(_0xc0f6('0x9'));config[_0xc0f6('0xa')]=_[_0xc0f6('0xb')](config[_0xc0f6('0xa')],{'host':_0xc0f6('0xc'),'port':0x18eb});var socket=require(_0xc0f6('0xd'))(new Redis(config[_0xc0f6('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xc0f6('0xe')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xc0f6('0xf'));function isEmail(_0x18d3ee){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))*$/[_0xc0f6('0x10')](_0x18d3ee);}function selectNotIn(_0xeb553,_0x486c75,_0x5db78e,_0x4633e5,_0x6034a0){return squel[_0xc0f6('0x11')]()[_0xc0f6('0x12')]('phone')[_0xc0f6('0x13')](_0x4633e5)['join'](_0x486c75,null,_0x486c75+_0xc0f6('0x14')+_0x4633e5+'.'+_0x5db78e)['where'](_0x4633e5+'.'+_0x5db78e+'\x20=\x20'+_0xeb553+'.'+_0x5db78e)[_0xc0f6('0x15')](_0x486c75+_0xc0f6('0x16')+_0x6034a0['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5a5610,_0x115362){promisesAdditionalPhones=[];return db[_0xc0f6('0x17')][_0xc0f6('0x18')]({'raw':!![],'attributes':['id',_0xc0f6('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc0f6('0x1a')](function(_0x204859){if(_0x204859!==null){var _0x3fee30=[];for(var _0x390c0c=0x0;_0x390c0c<_0x204859[_0xc0f6('0x1b')];_0x390c0c++){var _0x7bd174=_0x204859[_0x390c0c];_0x3fee30[_0xc0f6('0x1c')](insertAdditionalPhones(_0x7bd174));}}Promise[_0xc0f6('0x1d')](_0x3fee30)[_0xc0f6('0x1a')](function(){_0x5a5610({'val':0x1});});});});}function insertAdditionalPhones(_0x1fc01a){return new Promise(function(_0x16b720,_0x307ae4){var _0x10df5d=_0x1fc01a['AdditionalPhones'];var _0x21f3c7=_0x10df5d['split'](';');var _0x31e6d4=[];orderBy=0x0;for(var _0x336a58=0x0;_0x336a58<_0x21f3c7[_0xc0f6('0x1b')];_0x336a58++){_0x31e6d4[_0xc0f6('0x1c')](splitAdditionalPhone(_0x1fc01a['id'],_0x21f3c7[_0x336a58]));}Promise[_0xc0f6('0x1d')](_0x31e6d4)[_0xc0f6('0x1a')](function(){_0x16b720({'val':_0x21f3c7[_0xc0f6('0x1b')]});});});}function splitAdditionalPhone(_0x17f724,_0x5f3c1b){return new Promise(function(_0x5e9d2a,_0x3e2065){var _0x9973f=_0x5f3c1b[_0xc0f6('0x1e')](':');var _0x20136c=_0x9973f[0x0];var _0x277389=_0x9973f[0x1];if(!_[_0xc0f6('0x1f')](_0x277389)){var _0x58bef0=_0x277389[_0xc0f6('0x1e')]('|');var _0x4d295d=[];for(var _0x4a9016=0x0;_0x4a9016<_0x58bef0[_0xc0f6('0x1b')];_0x4a9016++){if(_0x58bef0[_0x4a9016]!==''){var _0x5ea66f=_['filter'](promisesAdditionalPhones,{'contactId':_0x17f724,'phone':_0x58bef0[_0x4a9016]});if(_0x5ea66f[_0xc0f6('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xc0f6('0x1c')]({'contactId':_0x17f724,'contactTypeId':_0x20136c,'phone':_0x58bef0[_0x4a9016],'orderBy':orderBy});}}}_0x5e9d2a({'ok':0x1});}else _0x5e9d2a({'res':0x0});});}function createAdditionalPhone(_0x1e0984,_0x1f1c5c,_0x3faad4,_0x552775){var _0x45f553='';var _0x4ccca4='';var _0x169492=_0x3faad4[_0xc0f6('0x1e')]('§');_0x45f553=_0x169492[0x0];if(_0x169492[_0xc0f6('0x1b')]==0x2)_0x4ccca4=_0x169492[0x1];return new Promise(function(_0x3b9e9f,_0x56f23a){return db[_0xc0f6('0x20')][_0xc0f6('0x21')]({'where':{'CmContactId':_0x1e0984,'item':_0x45f553}})['then'](function(_0x3f2dcd){if(_0x3f2dcd){return db[_0xc0f6('0x20')][_0xc0f6('0x22')]({'ItemTypeId':_0x1f1c5c,'description':_0x4ccca4,'OrderBy':_0x552775},{'where':{'CmContactId':_0x1e0984,'item':_0x45f553}})[_0xc0f6('0x1a')](function(_0x6467dc){_0x3b9e9f({'res':'updated'});});}else{return db[_0xc0f6('0x20')][_0xc0f6('0x23')]({'CmContactId':_0x1e0984,'item':_0x45f553,'description':_0x4ccca4,'ItemTypeId':_0x1f1c5c,'OrderBy':_0x552775,'ItemClass':_0xc0f6('0x24')})[_0xc0f6('0x1a')](function(_0x2ae124){_0x3b9e9f({'res':'inserted'});});}});});}function insertCmHopper(_0x323226,_0x4bae32,_0x3f8f22,_0x48d6b2,_0x543940){var _0xfef7=[_0xc0f6('0x25'),_0xc0f6('0x26'),_0xc0f6('0x27'),_0xc0f6('0x28'),_0x4bae32+'.'+_0x48d6b2,'cm_contacts.createdAt',_0xc0f6('0x29'),_0xc0f6('0x2a'),_0xc0f6('0x2b'),'\x22'+_0x543940+'\x22'];return squel[_0xc0f6('0x2c')]()[_0xc0f6('0x2d')](_0xc0f6('0x2e'))[_0xc0f6('0x2f')]([_0xc0f6('0x30'),_0xc0f6('0x31'),_0xc0f6('0x32'),_0xc0f6('0x33'),_0x48d6b2,_0xc0f6('0x34'),_0xc0f6('0x35'),_0xc0f6('0x36'),_0xc0f6('0x37'),_0xc0f6('0x38')],squel['select']()[_0xc0f6('0x39')](_0xfef7)[_0xc0f6('0x13')](_0x4bae32)['join']('cm_contacts',null,_0xc0f6('0x3a')+_0x4bae32+_0xc0f6('0x3b'))[_0xc0f6('0x3c')](_0x3f8f22,null,_0x3f8f22+_0xc0f6('0x14')+_0x4bae32+'.'+_0x48d6b2)['where'](_0x4bae32+_0xc0f6('0x3d'),_0x323226)[_0xc0f6('0x15')](_0xc0f6('0x3e'),NOW)['where'](_0xc0f6('0x3f'),selectNotIn(_0x4bae32,_0x3f8f22,_0x48d6b2,_0xc0f6('0x2e'),[_0xc0f6('0x40'),_0xc0f6('0x41')]))[_0xc0f6('0x15')](_0xc0f6('0x3f'),selectNotIn(_0x4bae32,_0x3f8f22,_0x48d6b2,_0xc0f6('0x2e'),[_0xc0f6('0x40')])))[_0xc0f6('0x42')]();}function insertCmHopperBlack(_0x421f62,_0x57fbac,_0x539d2a,_0x5f243d){var _0x1e050d=[_0xc0f6('0x25'),_0xc0f6('0x27'),_0xc0f6('0x28'),_0x57fbac+'.'+_0x5f243d,_0xc0f6('0x43'),_0xc0f6('0x29')];return squel[_0xc0f6('0x2c')]()[_0xc0f6('0x2d')](_0xc0f6('0x44'))[_0xc0f6('0x2f')](['phone',_0xc0f6('0x32'),_0xc0f6('0x33'),_0x5f243d,'createdAt',_0xc0f6('0x35')],squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0x1e050d)['from'](_0x57fbac)[_0xc0f6('0x3c')](_0xc0f6('0x45'),null,_0xc0f6('0x3a')+_0x57fbac+_0xc0f6('0x3b'))[_0xc0f6('0x3c')](_0x539d2a,null,_0x539d2a+_0xc0f6('0x14')+_0x57fbac+'.'+_0x5f243d)[_0xc0f6('0x15')](_0x57fbac+'.CmListId\x20=\x20?',_0x421f62)[_0xc0f6('0x15')](_0xc0f6('0x3e'),NOW)[_0xc0f6('0x15')](_0xc0f6('0x3f'),squel['select']()[_0xc0f6('0x12')](_0xc0f6('0x30'))[_0xc0f6('0x13')]('cm_hopper_black')[_0xc0f6('0x15')](_0xc0f6('0x46'),_0x421f62)['where'](_0x5f243d+_0xc0f6('0x47')+_0x57fbac+'.'+_0x5f243d)))['toString']();}function insertTzCmHopper(_0xfdbdf4,_0x43c425,_0x2b7fb1,_0x858593,_0x33dcf1,_0x33c60c){var _0xa4efcb=[_0xc0f6('0x25'),_0xc0f6('0x48')+_0x33c60c+'.offset-cm_contacts.utcOffset\x20minute)',_0xc0f6('0x27'),_0xc0f6('0x28'),_0x43c425+'.'+_0x858593,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x33dcf1+'\x22'];var _0x31c328=squel['insert']()['into']('cm_hopper')[_0xc0f6('0x2f')]([_0xc0f6('0x30'),'scheduledat',_0xc0f6('0x32'),'ListId',_0x858593,_0xc0f6('0x34'),_0xc0f6('0x35'),_0xc0f6('0x36'),_0xc0f6('0x37'),'recallme'],squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0xa4efcb)[_0xc0f6('0x13')](_0x43c425)[_0xc0f6('0x3c')](_0xc0f6('0x45'),null,_0xc0f6('0x3a')+_0x43c425+_0xc0f6('0x3b'))[_0xc0f6('0x3c')](_0x2b7fb1,null,_0x2b7fb1+_0xc0f6('0x14')+_0x43c425+'.'+_0x858593)[_0xc0f6('0x3c')](_0x33c60c,null,_0x33c60c+_0xc0f6('0x14')+_0x43c425+'.'+_0x858593)['where'](_0x43c425+'.CmListId\x20=\x20?',_0xfdbdf4)[_0xc0f6('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xc0f6('0x3f'),selectNotIn(_0x43c425,_0x2b7fb1,_0x858593,'cm_hopper',[_0xc0f6('0x40'),_0xc0f6('0x41')]))[_0xc0f6('0x15')](_0xc0f6('0x3f'),selectNotIn(_0x43c425,_0x2b7fb1,_0x858593,_0xc0f6('0x2e'),['\x22always\x22'])))['toString']();return _0x31c328;}function insertTzCmHopperBlack(_0xe344fa,_0x3542da,_0x1c69f8,_0x40c14f){var _0x2e4129=[_0xc0f6('0x25'),_0xc0f6('0x27'),'cm_contacts.ListId',_0x3542da+'.'+_0x40c14f,_0xc0f6('0x43'),'cm_contacts.updatedAt'];return squel[_0xc0f6('0x2c')]()[_0xc0f6('0x2d')](_0xc0f6('0x44'))[_0xc0f6('0x2f')]([_0xc0f6('0x30'),_0xc0f6('0x32'),_0xc0f6('0x33'),_0x40c14f,_0xc0f6('0x34'),_0xc0f6('0x35')],squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0x2e4129)[_0xc0f6('0x13')](_0x3542da)[_0xc0f6('0x3c')](_0xc0f6('0x45'),null,'cm_contacts.ListId\x20=\x20'+_0x3542da+'.CmListId')[_0xc0f6('0x3c')](_0x1c69f8,null,_0x1c69f8+_0xc0f6('0x14')+_0x3542da+'.'+_0x40c14f)[_0xc0f6('0x15')](_0x3542da+_0xc0f6('0x3d'),_0xe344fa)[_0xc0f6('0x15')](_0xc0f6('0x3e'),NOW)[_0xc0f6('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xc0f6('0x11')]()[_0xc0f6('0x12')]('phone')[_0xc0f6('0x13')](_0xc0f6('0x44'))[_0xc0f6('0x15')](_0xc0f6('0x46'),_0xe344fa)[_0xc0f6('0x15')](_0x40c14f+'\x20=\x20'+_0x3542da+'.'+_0x40c14f)))[_0xc0f6('0x42')]();}function insertCmHopperAdditionalPhones(_0x5395e2){var _0x1f7f3e=[_0xc0f6('0x49'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xc0f6('0x4a'),_0xc0f6('0x4b')];return squel[_0xc0f6('0x2c')]()[_0xc0f6('0x2d')]('cm_hopper_additional_phones')[_0xc0f6('0x2f')]([_0xc0f6('0x4c'),_0xc0f6('0x30'),'OrderBy',_0xc0f6('0x34'),_0xc0f6('0x35')],squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0x1f7f3e)[_0xc0f6('0x13')]('cm_hopper')[_0xc0f6('0x3c')](_0xc0f6('0x45'),null,_0xc0f6('0x4d'))['join']('cm_contact_has_items',null,_0xc0f6('0x4e'))[_0xc0f6('0x15')]('cm_hopper.ListId\x20=\x20?',_0x5395e2)[_0xc0f6('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xc0f6('0x42')]();}function insertCmContact(_0x1df7db,_0x1ae0e6,_0x2f0c4e,_0x1281d9){var _0x1fd11b=_[_0xc0f6('0x4f')](_[_0xc0f6('0x50')](_0x1281d9),[_0xc0f6('0x33'),'CompanyId',_0xc0f6('0x34'),_0xc0f6('0x35'),_0xc0f6('0x51')]);return squel[_0xc0f6('0x2c')]()['into']('cm_contacts')[_0xc0f6('0x2f')](_0x1fd11b,squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0x1fd11b)[_0xc0f6('0x13')](_0x1ae0e6)[_0xc0f6('0x15')]('('+_0x2f0c4e[_0xc0f6('0x3c')](',')+_0xc0f6('0x52'),squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')](_0x2f0c4e)[_0xc0f6('0x13')](_0xc0f6('0x45'))['where'](_0xc0f6('0x46'),_0x1df7db)[_0xc0f6('0x15')]('deletedAt\x20IS\x20NULL'))[_0xc0f6('0x15')](_0xc0f6('0x53'),squel['select']()[_0xc0f6('0x12')]('MIN(id)','min_id')[_0xc0f6('0x13')](_0x1ae0e6)['group'](_0x2f0c4e['join'](','))))['toString']();}function handleStop(){logger['info'](_0xc0f6('0x54'));stopped=!![];}function handleUncaughtException(_0x49c782){logger[_0xc0f6('0x55')](_0x49c782[_0xc0f6('0x56')]);process[_0xc0f6('0x57')](0x1);}function handleError(_0x6b3847,_0x266708){stats['errors'][_0xc0f6('0x1c')]({'name':_0x266708['code'],'message':_0x266708[_0xc0f6('0x56')],'row':_0x6b3847});}function handleQuery(_0x4445cc){logger[_0xc0f6('0x58')](_0x4445cc);return db[_0xc0f6('0x59')][_0xc0f6('0x5a')](_0x4445cc)[_0xc0f6('0x5b')](function(_0x32b817){results[_0xc0f6('0x1c')](_0x32b817);})[_0xc0f6('0x5c')](function(_0x2c05a0){logger['error'](_0x2c05a0[_0xc0f6('0x56')]);});}function updateTzCampaigns(_0x9dd6e4){return new Promise(function(_0x597d11,_0x2a0995){var _0x1bfe7a=squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')]([_0xc0f6('0x5d'),_0xc0f6('0x5e')])['from'](_0xc0f6('0x5f'))[_0xc0f6('0x3c')]('campaigns_has_cm_lists',null,_0xc0f6('0x60'))[_0xc0f6('0x15')](_0xc0f6('0x61')+_0x9dd6e4);db[_0xc0f6('0x59')][_0xc0f6('0x5a')](_0x1bfe7a[_0xc0f6('0x42')]())[_0xc0f6('0x5b')](function(_0x1b5981){var _0x209c1d=[];for(var _0x2f6d2e=0x0;_0x2f6d2e<_0x1b5981[_0xc0f6('0x1b')];_0x2f6d2e++){_0x209c1d[_0xc0f6('0x1c')](getTimezoneData(_0x1b5981[_0x2f6d2e],tmp_campaigns));}BPromise['all'](_0x209c1d)['then'](function(){_0x597d11({'val':0x1});});})['catch'](function(_0x61c134){logger['error'](_0x61c134['message']);_0x597d11({'val':0x0});});});}function updateTzVoiceQueues(_0x22b17a){return new Promise(function(_0x3950f1,_0x4bfa7c){var _0x4fd470=squel[_0xc0f6('0x11')]()[_0xc0f6('0x39')]([_0xc0f6('0x62'),_0xc0f6('0x63')])['from'](_0xc0f6('0x64'))[_0xc0f6('0x3c')](_0xc0f6('0x65'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xc0f6('0x15')](_0xc0f6('0x66')+_0x22b17a);db[_0xc0f6('0x59')][_0xc0f6('0x5a')](_0x4fd470[_0xc0f6('0x42')]())[_0xc0f6('0x5b')](function(_0x355d55){var _0x5d3ef1=[];for(var _0x3c2cff=0x0;_0x3c2cff<_0x355d55[_0xc0f6('0x1b')];_0x3c2cff++){_0x5d3ef1['push'](getTimezoneData(_0x355d55[_0x3c2cff],tmp_voice_queues));}BPromise['all'](_0x5d3ef1)['then'](function(){_0x3950f1({'val':0x1});});})[_0xc0f6('0x5c')](function(_0x1b4a72){logger[_0xc0f6('0x55')](_0x1b4a72[_0xc0f6('0x56')]);_0x3950f1({'val':0x0});});});}function getTimezoneData(_0xf9846f,_0x1ff4a6){return new Promise(function(_0x3082e9,_0x50abd3){var _0x4b46f0=shared['timezones'];var _0x568330=_0x4b46f0[_0xf9846f[_0xc0f6('0x67')]];if(_[_0xc0f6('0x1f')](_0x568330)){_0x3082e9({'ret':0x1});}else{var _0x1556fd=_0x568330[_0xc0f6('0x68')];var _0x3c7f30=squel[_0xc0f6('0x2c')]()[_0xc0f6('0x2d')](_0x1ff4a6)[_0xc0f6('0x69')]('id',_0xf9846f['id'])[_0xc0f6('0x69')](_0xc0f6('0x6a'),_0x1556fd)['set'](_0xc0f6('0x67'),_0xf9846f['dialTimezone'])['toString']();return db[_0xc0f6('0x59')][_0xc0f6('0x5a')](_0x3c7f30)['spread'](function(_0x15ddaa){_0x3082e9({'ret':0x1});})[_0xc0f6('0x5c')](function(_0x247be9){logger[_0xc0f6('0x55')](_0x247be9[_0xc0f6('0x56')]);_0x50abd3({'ret':0x1});});}});}function handleTZQuery(_0x222f9b){logger[_0xc0f6('0x58')](_0x222f9b);return db['sequelize'][_0xc0f6('0x5a')](_0x222f9b)[_0xc0f6('0x5b')](function(_0x440cf4){})['catch'](function(_0x30a6a9){logger['error'](_0x30a6a9['message']);});}function main(_0x579e6a,_0x139fd7,_0x3f9524,_0x4f3c70){logger[_0xc0f6('0x58')]('main',_0x579e6a,JSON[_0xc0f6('0x6b')](_0x139fd7));process[_0xc0f6('0x6c')](_0xc0f6('0x6d'));var _0x10c4f4=_0x139fd7[_0xc0f6('0x6e')];var _0x1cd761=_['clone'](_0x10c4f4);var _0xf3d1d4=_0x139fd7[_0xc0f6('0x6f')];var _0x18e61f=path['join'](config['root'],_0xc0f6('0x70'),_0xf3d1d4+'.csv');hasTZ=_[_0xc0f6('0x50')](_0x10c4f4)[_0xc0f6('0x71')](_0xc0f6('0x67'));var _0x42a5ef=_[_0xc0f6('0x50')](_0x10c4f4)['join']();logger['info'](_0xc0f6('0x72'),_0x42a5ef);db['ContactItemType'][_0xc0f6('0x18')]({'raw':!![],'attributes':['id','name']})[_0xc0f6('0x1a')](function(_0x329918){for(var _0x6e37b1=0x0;_0x6e37b1<_0x329918[_0xc0f6('0x1b')];_0x6e37b1++){if(_0x329918[_0x6e37b1][_0xc0f6('0x73')]in _0x10c4f4){contactItemTypes['push'](_0x329918[_0x6e37b1]);delete _0x1cd761[_0x329918[_0x6e37b1][_0xc0f6('0x73')]];hasAdditionalPhones=!![];}for(var _0x76e0a6 in _0x10c4f4){if(_0x329918[_0x6e37b1][_0xc0f6('0x73')]+_0xc0f6('0x74')===_0x76e0a6){phoneDescriptions[_0xc0f6('0x1c')]({'itemTypeId':_0x329918[_0x6e37b1]['id'],'description':_0x76e0a6});delete _0x1cd761[_0x76e0a6];}}}if(hasAdditionalPhones)_0x1cd761['AdditionalPhones']='';var _0x391d9e=_[_0xc0f6('0x50')](_0x1cd761)[_0xc0f6('0x3c')]();logger[_0xc0f6('0x58')]('header',_0x391d9e);fs['writeFileSync'](_0x18e61f,_0x391d9e+'\x0a');Papa[_0xc0f6('0x75')](fs['createReadStream'](_0x579e6a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x563ff8,_0x1a18b4){try{for(var _0x5cb165=0x0,_0x3bfdc0=[];_0x5cb165<_0x563ff8[_0xc0f6('0x76')][_0xc0f6('0x1b')];_0x5cb165++){stats['rows']+=0x1;if(_0x563ff8['errors'][_0x5cb165]){handleError(_0x563ff8['data'][_0x5cb165],_0x563ff8[_0xc0f6('0x77')][_0x5cb165]);}else{var _0x45a2ee=[];var _0x39d7ce=[];var _0x404d7a={};for(var _0x3d7d49 in _0x10c4f4){let _0x1b99e6=contactItemTypes['find'](_0x2907e7=>_0x2907e7[_0xc0f6('0x73')]===_0x3d7d49);let _0x2d8735=contactItemTypes[_0xc0f6('0x78')](_0x2d6da2=>_0x2d6da2['name']+_0xc0f6('0x74')===_0x3d7d49);if(_[_0xc0f6('0x1f')](_0x1b99e6)&&_[_0xc0f6('0x1f')](_0x2d8735)){if(_0x10c4f4[_0xc0f6('0x79')](_0x3d7d49)){if(_0x563ff8[_0xc0f6('0x76')][_0x5cb165][_0x10c4f4[_0x3d7d49]]){var _0x2a47a2=_[_0xc0f6('0x7a')](_0x563ff8[_0xc0f6('0x76')][_0x5cb165][_0x10c4f4[_0x3d7d49]][_0xc0f6('0x7b')](/"/g,'\x27'));switch(_0x3d7d49){case'scheduledat':var _0x8d74a5=moment(_0x2a47a2,_0xc0f6('0xf'),!![]);if(_0x8d74a5[_0xc0f6('0x7c')]()){_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');}else{_0x45a2ee['push'](_0xc0f6('0x7d'));}break;case _0xc0f6('0x36'):var _0x2f4532=parseInt(_0x2a47a2);_0x2a47a2=_[_0xc0f6('0x7e')](_0x2f4532)||_0x2f4532<0x0||_0x2f4532>0x4?_0x4f3c70?0x3:0x2:_0x2f4532;_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');break;case _0xc0f6('0x37'):var _0x4eb28a=parseInt(_0x2a47a2);if(_[_0xc0f6('0x7f')](_0x4eb28a)&&_[_0xc0f6('0x71')](_0x3f9524,_0x4eb28a)){_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x4eb28a+'\x22');}else{_0x45a2ee['push'](_0xc0f6('0x80'));}break;case _0xc0f6('0x81'):if(isEmail(_0x2a47a2)){_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');}else{_0x45a2ee[_0xc0f6('0x1c')](_0xc0f6('0x82'));}break;case _0xc0f6('0x83'):var _0x328ff2=moment(_0x2a47a2,'YYYY-MM-DD',!![]);if(_0x328ff2['isValid']()){_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');}else{_0x45a2ee[_0xc0f6('0x1c')](_0xc0f6('0x84'));}break;case _0xc0f6('0x67'):var _0x59e093=shared[_0xc0f6('0x85')];var _0x4fe659=_0x59e093[_0x2a47a2];if(!_[_0xc0f6('0x1f')](_0x4fe659)){var _0x10a5fc=_0x4fe659[_0xc0f6('0x68')];_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x10a5fc+'\x22');}break;default:_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x2a47a2+'\x22');}}else{switch(_0x3d7d49){case'firstName':case _0xc0f6('0x30'):_0x45a2ee['push'](_0x3d7d49+_0xc0f6('0x86'));break;default:_0x3bfdc0[_0xc0f6('0x1c')]('\x22\x22');}}}}else{var _0x244539='';if(!_['isNil'](_0x1b99e6)){if(!_0x404d7a[_0xc0f6('0x79')](_0x1b99e6['id'])){if(!_['isNil'](_0x563ff8['data'][_0x5cb165][_0x10c4f4[_0x3d7d49]])){var _0x2a47a2=_[_0xc0f6('0x7a')](_0x563ff8[_0xc0f6('0x76')][_0x5cb165][_0x10c4f4[_0x3d7d49]][_0xc0f6('0x7b')](/"/g,'\x27'));var _0x21f325=phoneDescriptions['find'](_0x9e7d5f=>_0x9e7d5f['itemTypeId']===_0x1b99e6['id']);if(!_['isNil'](_0x21f325)){var _0x3a613a=_[_0xc0f6('0x7a')](_0x563ff8['data'][_0x5cb165][_0x10c4f4[_0x21f325[_0xc0f6('0x87')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x3a613a))_0x2a47a2=_0x2a47a2+'§'+_0x3a613a;}if(_0x244539=='')_0x244539=_0x2a47a2;else _0x244539+='|'+_0x2a47a2;}_0x39d7ce[_0xc0f6('0x1c')](_0x1b99e6['id']+':'+_0x244539);_0x404d7a[_0x1b99e6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3bfdc0[_0xc0f6('0x1c')]('\x22'+_0x39d7ce[_0xc0f6('0x3c')](';')+'\x22');}if(_0x45a2ee[_0xc0f6('0x1b')]){handleError(_0x563ff8[_0xc0f6('0x76')][_0x5cb165],{'code':'SystemRow','message':_0x45a2ee['join']()});}else{fs['appendFileSync'](_0x18e61f,_0x3bfdc0[_0xc0f6('0x3c')]()+'\x0a');}_0x3bfdc0=[];}if(!(stats[_0xc0f6('0x88')]%0xc8)){socket[_0xc0f6('0x89')]('contact:import:'+_0xf3d1d4,stats);stats[_0xc0f6('0x77')]=[];}}if(stopped){logger['info'](_0xc0f6('0x8a'));_0x1a18b4['abort']();}}catch(_0x4ca103){handleError(_0x563ff8[_0xc0f6('0x76')][_0x5cb165],{'code':_0xc0f6('0x8b'),'message':_0x4ca103['message']});logger['error'](_0xc0f6('0x8c'),_0x4ca103['message']);}},'complete':function(){try{var _0x494c8f=[];var _0x18dcd6=[];var _0x2ab069=_0xc0f6('0x45');if(_0x139fd7['duplicates']&&_0x139fd7['duplicates'][_0xc0f6('0x1b')]){_0x2ab069=_0xc0f6('0x8d')+_0xf3d1d4;_0x494c8f[_0xc0f6('0x1c')](_0xc0f6('0x8e')+_0x2ab069+_0xc0f6('0x8f'));}tmp_campaigns='campaigns_'+_0xf3d1d4;tmp_voice_queues=_0xc0f6('0x90')+_0xf3d1d4;_0x18dcd6[_0xc0f6('0x1c')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x18dcd6[_0xc0f6('0x1c')](_0xc0f6('0x8e')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xc0f6('0x91')](_0x18dcd6,handleTZQuery)['then'](function(_0x49daec){updateTzCampaigns(_0x139fd7[_0xc0f6('0x33')])[_0xc0f6('0x1a')](function(_0x4ce570){updateTzVoiceQueues(_0x139fd7[_0xc0f6('0x33')])[_0xc0f6('0x1a')](function(_0xfa9663){if(hasTZ)_0x391d9e=_0x391d9e['replace'](_0xc0f6('0x67'),_0xc0f6('0x92'));var _0x14ec7c=util['format'](_0xc0f6('0x93'),_0x18e61f,_0x2ab069,_0x391d9e,_0x139fd7[_0xc0f6('0x33')],_0x139fd7[_0xc0f6('0x94')]||null,NOW,NOW);if(_[_0xc0f6('0x1f')](_0x10c4f4['scheduledat'])){_0x14ec7c+=_0xc0f6('0x95');}_0x494c8f[_0xc0f6('0x1c')](_0x14ec7c);if(_0x139fd7['duplicates']&&_0x139fd7[_0xc0f6('0x96')][_0xc0f6('0x1b')]){_0x494c8f[_0xc0f6('0x1c')](insertCmContact(_0x139fd7['ListId'],_0x2ab069,_0x139fd7['duplicates'],_0x10c4f4));_0x494c8f[_0xc0f6('0x1c')](_0xc0f6('0x97')+_0x2ab069+';');}BPromise['each'](_0x494c8f,handleQuery)[_0xc0f6('0x1a')](function(_0x461722){BPromise['all']([handleAdditionalPhones()])[_0xc0f6('0x1a')](function(){_0x494c8f=[];for(var _0x42769f=0x0;_0x42769f\x20\x20');}var _0x3f1104=path['join'](config[_0xc0f6('0xa3')],_0xc0f6('0x70'),process[_0xc0f6('0xa2')][0x2]);if(!fs[_0xc0f6('0xa4')](_0x3f1104)){throw new Error(_0xc0f6('0xa5'));}var _0x23a1b6={};try{_0x23a1b6=JSON[_0xc0f6('0x75')](process[_0xc0f6('0xa2')][0x3]);if(!_0x23a1b6['binding']){throw new Error(_0xc0f6('0xa6'));}if(!_0x23a1b6[_0xc0f6('0x6e')]['phone']){throw new Error(_0xc0f6('0xa7'));}if(!_0x23a1b6[_0xc0f6('0x6e')][_0xc0f6('0xa8')]){throw new Error(_0xc0f6('0xa9'));}var _0x21bc4d=0x0;if(_0x23a1b6[_0xc0f6('0x6e')][_0xc0f6('0x37')]){_0x21bc4d=0x1;}if(!_0x23a1b6['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x298276){throw new Error(_0xc0f6('0xaa'));}var _0x4a8bad=[];try{_0x4a8bad=_[_0xc0f6('0xab')](JSON['parse'](process[_0xc0f6('0xa2')][0x4]),'id');}catch(_0x37d712){logger[_0xc0f6('0x58')](_0xc0f6('0xac'));}main(_0x3f1104,_0x23a1b6,_0x4a8bad,_0x21bc4d);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x5600=['cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','catch','main','stringify','send','start','clone','socket_timestamp','root','server/files/tmp','header','name','_description','writeFileSync','parse','createReadStream','data','rows','find','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','hasOwnProperty','itemTypeId','description','appendFileSync','emit','Abort\x20parser','abort','SystemError','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','replace','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','select','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','then','isNil','split','filter','findOne','CmContactHasItem','update','create','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','insert','cm_hopper_black','ListId','fields','.CmListId','field','cm_contacts.updatedAt','fromQuery','.CmListId\x20=\x20?','ListId\x20=\x20?','cm_hopper.id'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x5600,0x1e4));var _0x0560=function(_0x11f0e3,_0x5170bc){_0x11f0e3=_0x11f0e3-0x0;var _0x2892e8=_0x5600[_0x11f0e3];return _0x2892e8;};'use strict';var fs=require('fs');var path=require(_0x0560('0x0'));var _=require(_0x0560('0x1'));var Papa=require('papaparse');var util=require(_0x0560('0x2'));var BPromise=require(_0x0560('0x3'));var moment=require(_0x0560('0x4'));var squel=require(_0x0560('0x5'));var Redis=require(_0x0560('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x0560('0x7'));var shared=require(_0x0560('0x8'));var logger=require(_0x0560('0x9'))(_0x0560('0xa'));config[_0x0560('0xb')]=_[_0x0560('0xc')](config[_0x0560('0xb')],{'host':_0x0560('0xd'),'port':0x18eb});var socket=require(_0x0560('0xe'))(new Redis(config[_0x0560('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0560('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x476a5f){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))*$/[_0x0560('0x10')](_0x476a5f);}function selectNotIn(_0x196fe4,_0x1b34bd,_0x35099c,_0x3f8d1f,_0x27b406){return squel[_0x0560('0x11')]()['field'](_0x0560('0x12'))[_0x0560('0x13')](_0x3f8d1f)[_0x0560('0x14')](_0x1b34bd,null,_0x1b34bd+'.id\x20=\x20'+_0x3f8d1f+'.'+_0x35099c)[_0x0560('0x15')](_0x3f8d1f+'.'+_0x35099c+_0x0560('0x16')+_0x196fe4+'.'+_0x35099c)[_0x0560('0x15')](_0x1b34bd+_0x0560('0x17')+_0x27b406[_0x0560('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x43ac56,_0x334664){promisesAdditionalPhones=[];return db[_0x0560('0x18')][_0x0560('0x19')]({'raw':!![],'attributes':['id',_0x0560('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4f9d7b){if(_0x4f9d7b!==null){var _0x16e6ac=[];for(var _0x23eb5c=0x0;_0x23eb5c<_0x4f9d7b[_0x0560('0x1b')];_0x23eb5c++){var _0x1b9ef0=_0x4f9d7b[_0x23eb5c];_0x16e6ac[_0x0560('0x1c')](insertAdditionalPhones(_0x1b9ef0));}}Promise['all'](_0x16e6ac)[_0x0560('0x1d')](function(){_0x43ac56({'val':0x1});});});});}function insertAdditionalPhones(_0x1ce753){return new Promise(function(_0x2271b4,_0x2abd2f){var _0x376000=_0x1ce753['AdditionalPhones'];var _0x3fee35=_0x376000['split'](';');var _0x37f2e3=[];orderBy=0x0;for(var _0x523a79=0x0;_0x523a79<_0x3fee35[_0x0560('0x1b')];_0x523a79++){_0x37f2e3[_0x0560('0x1c')](splitAdditionalPhone(_0x1ce753['id'],_0x3fee35[_0x523a79]));}Promise['all'](_0x37f2e3)[_0x0560('0x1d')](function(){_0x2271b4({'val':_0x3fee35[_0x0560('0x1b')]});});});}function splitAdditionalPhone(_0x5b7911,_0x430be3){return new Promise(function(_0x24e6d0,_0x4721b3){var _0x2eadff=_0x430be3['split'](':');var _0x4a61e3=_0x2eadff[0x0];var _0x13d6d4=_0x2eadff[0x1];if(!_[_0x0560('0x1e')](_0x13d6d4)){var _0x17ca15=_0x13d6d4[_0x0560('0x1f')]('|');var _0x2209f9=[];for(var _0x1b85af=0x0;_0x1b85af<_0x17ca15['length'];_0x1b85af++){if(_0x17ca15[_0x1b85af]!==''){var _0x355801=_[_0x0560('0x20')](promisesAdditionalPhones,{'contactId':_0x5b7911,'phone':_0x17ca15[_0x1b85af]});if(_0x355801[_0x0560('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x0560('0x1c')]({'contactId':_0x5b7911,'contactTypeId':_0x4a61e3,'phone':_0x17ca15[_0x1b85af],'orderBy':orderBy});}}}_0x24e6d0({'ok':0x1});}else _0x24e6d0({'res':0x0});});}function createAdditionalPhone(_0x1df9f8,_0x551a13,_0x529e2b,_0x2bc4a3){var _0x1ea248='';var _0x318322='';var _0x47260a=_0x529e2b[_0x0560('0x1f')]('§');_0x1ea248=_0x47260a[0x0];if(_0x47260a[_0x0560('0x1b')]==0x2)_0x318322=_0x47260a[0x1];return new Promise(function(_0x17acde,_0x4fc279){return db['CmContactHasItem'][_0x0560('0x21')]({'where':{'CmContactId':_0x1df9f8,'item':_0x1ea248}})[_0x0560('0x1d')](function(_0x380780){if(_0x380780){return db[_0x0560('0x22')][_0x0560('0x23')]({'ItemTypeId':_0x551a13,'description':_0x318322,'OrderBy':_0x2bc4a3},{'where':{'CmContactId':_0x1df9f8,'item':_0x1ea248}})[_0x0560('0x1d')](function(_0x11c41a){_0x17acde({'res':'updated'});});}else{return db[_0x0560('0x22')][_0x0560('0x24')]({'CmContactId':_0x1df9f8,'item':_0x1ea248,'description':_0x318322,'ItemTypeId':_0x551a13,'OrderBy':_0x2bc4a3,'ItemClass':'PHONE'})['then'](function(_0x1a8b55){_0x17acde({'res':'inserted'});});}});});}function insertCmHopper(_0xef3059,_0x360ae3,_0x2d8e5a,_0x24da3f,_0x5437c3){var _0x5a9674=[_0x0560('0x25'),_0x0560('0x26'),'cm_contacts.id',_0x0560('0x27'),_0x360ae3+'.'+_0x24da3f,_0x0560('0x28'),'cm_contacts.updatedAt',_0x0560('0x29'),_0x0560('0x2a'),'\x22'+_0x5437c3+'\x22'];return squel['insert']()[_0x0560('0x2b')](_0x0560('0x2c'))['fromQuery']([_0x0560('0x12'),_0x0560('0x2d'),_0x0560('0x2e'),'ListId',_0x24da3f,_0x0560('0x2f'),_0x0560('0x30'),_0x0560('0x31'),_0x0560('0x32'),_0x0560('0x33')],squel['select']()['fields'](_0x5a9674)[_0x0560('0x13')](_0x360ae3)[_0x0560('0x14')](_0x0560('0x34'),null,_0x0560('0x35')+_0x360ae3+'.CmListId')[_0x0560('0x14')](_0x2d8e5a,null,_0x2d8e5a+_0x0560('0x36')+_0x360ae3+'.'+_0x24da3f)[_0x0560('0x15')](_0x360ae3+'.CmListId\x20=\x20?',_0xef3059)[_0x0560('0x15')](_0x0560('0x37'),NOW)['where'](_0x0560('0x38'),selectNotIn(_0x360ae3,_0x2d8e5a,_0x24da3f,_0x0560('0x2c'),[_0x0560('0x39'),'\x22onlyIfOpen\x22']))[_0x0560('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x360ae3,_0x2d8e5a,_0x24da3f,_0x0560('0x2c'),[_0x0560('0x39')])))[_0x0560('0x3a')]();}function insertCmHopperBlack(_0x587227,_0x1b2d36,_0x4f5641,_0x548a2b){var _0x5d3d14=['cm_contacts.phone',_0x0560('0x3b'),'cm_contacts.ListId',_0x1b2d36+'.'+_0x548a2b,_0x0560('0x28'),'cm_contacts.updatedAt'];return squel[_0x0560('0x3c')]()[_0x0560('0x2b')](_0x0560('0x3d'))['fromQuery']([_0x0560('0x12'),'ContactId',_0x0560('0x3e'),_0x548a2b,_0x0560('0x2f'),'updatedAt'],squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x5d3d14)[_0x0560('0x13')](_0x1b2d36)[_0x0560('0x14')](_0x0560('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x1b2d36+_0x0560('0x40'))[_0x0560('0x14')](_0x4f5641,null,_0x4f5641+_0x0560('0x36')+_0x1b2d36+'.'+_0x548a2b)[_0x0560('0x15')](_0x1b2d36+'.CmListId\x20=\x20?',_0x587227)[_0x0560('0x15')](_0x0560('0x37'),NOW)[_0x0560('0x15')](_0x0560('0x38'),squel[_0x0560('0x11')]()[_0x0560('0x41')](_0x0560('0x12'))[_0x0560('0x13')](_0x0560('0x3d'))[_0x0560('0x15')]('ListId\x20=\x20?',_0x587227)[_0x0560('0x15')](_0x548a2b+'\x20=\x20'+_0x1b2d36+'.'+_0x548a2b)))[_0x0560('0x3a')]();}function insertTzCmHopper(_0x14dc38,_0x4b57c3,_0x1ae360,_0x5466a6,_0x58278e,_0x555791){var _0x2d46ee=[_0x0560('0x25'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x555791+'.offset-cm_contacts.utcOffset\x20minute)',_0x0560('0x3b'),_0x0560('0x27'),_0x4b57c3+'.'+_0x5466a6,'cm_contacts.createdAt',_0x0560('0x42'),'cm_contacts.priority',_0x0560('0x2a'),'\x22'+_0x58278e+'\x22'];var _0x322e7b=squel[_0x0560('0x3c')]()['into'](_0x0560('0x2c'))[_0x0560('0x43')]([_0x0560('0x12'),_0x0560('0x2d'),_0x0560('0x2e'),'ListId',_0x5466a6,_0x0560('0x2f'),_0x0560('0x30'),_0x0560('0x31'),_0x0560('0x32'),'recallme'],squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x2d46ee)['from'](_0x4b57c3)[_0x0560('0x14')](_0x0560('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x4b57c3+_0x0560('0x40'))[_0x0560('0x14')](_0x1ae360,null,_0x1ae360+_0x0560('0x36')+_0x4b57c3+'.'+_0x5466a6)[_0x0560('0x14')](_0x555791,null,_0x555791+_0x0560('0x36')+_0x4b57c3+'.'+_0x5466a6)[_0x0560('0x15')](_0x4b57c3+_0x0560('0x44'),_0x14dc38)[_0x0560('0x15')](_0x0560('0x37'),NOW)['where'](_0x0560('0x38'),selectNotIn(_0x4b57c3,_0x1ae360,_0x5466a6,_0x0560('0x2c'),[_0x0560('0x39'),'\x22onlyIfOpen\x22']))[_0x0560('0x15')](_0x0560('0x38'),selectNotIn(_0x4b57c3,_0x1ae360,_0x5466a6,'cm_hopper',[_0x0560('0x39')])))[_0x0560('0x3a')]();return _0x322e7b;}function insertTzCmHopperBlack(_0x2bd47c,_0x549eec,_0x49a35d,_0x19aee7){var _0x44a338=[_0x0560('0x25'),'cm_contacts.id',_0x0560('0x27'),_0x549eec+'.'+_0x19aee7,_0x0560('0x28'),_0x0560('0x42')];return squel[_0x0560('0x3c')]()['into'](_0x0560('0x3d'))[_0x0560('0x43')](['phone',_0x0560('0x2e'),_0x0560('0x3e'),_0x19aee7,'createdAt',_0x0560('0x30')],squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x44a338)['from'](_0x549eec)[_0x0560('0x14')]('cm_contacts',null,_0x0560('0x35')+_0x549eec+_0x0560('0x40'))['join'](_0x49a35d,null,_0x49a35d+_0x0560('0x36')+_0x549eec+'.'+_0x19aee7)[_0x0560('0x15')](_0x549eec+_0x0560('0x44'),_0x2bd47c)[_0x0560('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x0560('0x15')](_0x0560('0x38'),squel[_0x0560('0x11')]()[_0x0560('0x41')](_0x0560('0x12'))['from'](_0x0560('0x3d'))[_0x0560('0x15')](_0x0560('0x45'),_0x2bd47c)['where'](_0x19aee7+'\x20=\x20'+_0x549eec+'.'+_0x19aee7)))['toString']();}function insertCmHopperAdditionalPhones(_0x1d980f){var _0x2a059a=[_0x0560('0x46'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x0560('0x47'),_0x0560('0x48')];return squel[_0x0560('0x3c')]()['into'](_0x0560('0x49'))[_0x0560('0x43')]([_0x0560('0x4a'),_0x0560('0x12'),_0x0560('0x4b'),_0x0560('0x2f'),_0x0560('0x30')],squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x2a059a)[_0x0560('0x13')](_0x0560('0x2c'))[_0x0560('0x14')](_0x0560('0x34'),null,_0x0560('0x4c'))['join'](_0x0560('0x4d'),null,_0x0560('0x4e'))[_0x0560('0x15')](_0x0560('0x4f'),_0x1d980f)[_0x0560('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x0560('0x3a')]();}function insertCmContact(_0x53005c,_0x53c747,_0x3214ae,_0x5e5634){var _0x4a2545=_[_0x0560('0x50')](_[_0x0560('0x51')](_0x5e5634),[_0x0560('0x3e'),'CompanyId',_0x0560('0x2f'),_0x0560('0x30'),_0x0560('0x52')]);return squel['insert']()[_0x0560('0x2b')](_0x0560('0x34'))[_0x0560('0x43')](_0x4a2545,squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x4a2545)['from'](_0x53c747)['where']('('+_0x3214ae[_0x0560('0x14')](',')+_0x0560('0x53'),squel[_0x0560('0x11')]()[_0x0560('0x3f')](_0x3214ae)['from'](_0x0560('0x34'))[_0x0560('0x15')](_0x0560('0x45'),_0x53005c)[_0x0560('0x15')](_0x0560('0x54')))['where'](_0x0560('0x55'),squel[_0x0560('0x11')]()[_0x0560('0x41')]('MIN(id)',_0x0560('0x56'))[_0x0560('0x13')](_0x53c747)[_0x0560('0x57')](_0x3214ae[_0x0560('0x14')](','))))['toString']();}function handleStop(){logger[_0x0560('0x58')](_0x0560('0x59'));stopped=!![];}function handleUncaughtException(_0x18ab66){logger[_0x0560('0x5a')](_0x18ab66[_0x0560('0x5b')]);process[_0x0560('0x5c')](0x1);}function handleError(_0x2f88b7,_0xc3d640){stats[_0x0560('0x5d')][_0x0560('0x1c')]({'name':_0xc3d640[_0x0560('0x5e')],'message':_0xc3d640[_0x0560('0x5b')],'row':_0x2f88b7});}function handleQuery(_0x7611b1){logger[_0x0560('0x58')](_0x7611b1);return db[_0x0560('0x5f')][_0x0560('0x60')](_0x7611b1)[_0x0560('0x61')](function(_0x38c88e){results[_0x0560('0x1c')](_0x38c88e);})['catch'](function(_0x7d340a){logger[_0x0560('0x5a')](_0x7d340a['message']);});}function updateTzCampaigns(_0xe02a2a){return new Promise(function(_0x40b3b5,_0xd6eb70){var _0x4af90c=squel['select']()[_0x0560('0x3f')]([_0x0560('0x62'),_0x0560('0x63')])[_0x0560('0x13')](_0x0560('0x64'))[_0x0560('0x14')](_0x0560('0x65'),null,_0x0560('0x66'))[_0x0560('0x15')](_0x0560('0x67')+_0xe02a2a);db[_0x0560('0x5f')][_0x0560('0x60')](_0x4af90c[_0x0560('0x3a')]())[_0x0560('0x61')](function(_0x515bf9){var _0x509269=[];for(var _0x5ccfc5=0x0;_0x5ccfc5<_0x515bf9[_0x0560('0x1b')];_0x5ccfc5++){_0x509269[_0x0560('0x1c')](getTimezoneData(_0x515bf9[_0x5ccfc5],tmp_campaigns));}BPromise[_0x0560('0x68')](_0x509269)['then'](function(){_0x40b3b5({'val':0x1});});})['catch'](function(_0x207df7){logger[_0x0560('0x5a')](_0x207df7['message']);_0x40b3b5({'val':0x0});});});}function updateTzVoiceQueues(_0x4fd866){return new Promise(function(_0x4d6a5d,_0x154347){var _0xbfc0c5=squel[_0x0560('0x11')]()[_0x0560('0x3f')]([_0x0560('0x69'),_0x0560('0x6a')])[_0x0560('0x13')](_0x0560('0x6b'))[_0x0560('0x14')](_0x0560('0x6c'),null,_0x0560('0x6d'))[_0x0560('0x15')](_0x0560('0x6e')+_0x4fd866);db[_0x0560('0x5f')][_0x0560('0x60')](_0xbfc0c5[_0x0560('0x3a')]())[_0x0560('0x61')](function(_0x4a5446){var _0x1d8ea2=[];for(var _0x454bcb=0x0;_0x454bcb<_0x4a5446[_0x0560('0x1b')];_0x454bcb++){_0x1d8ea2[_0x0560('0x1c')](getTimezoneData(_0x4a5446[_0x454bcb],tmp_voice_queues));}BPromise[_0x0560('0x68')](_0x1d8ea2)['then'](function(){_0x4d6a5d({'val':0x1});});})['catch'](function(_0x3fd044){logger[_0x0560('0x5a')](_0x3fd044[_0x0560('0x5b')]);_0x4d6a5d({'val':0x0});});});}function getTimezoneData(_0x16ce18,_0x3e99b9){return new Promise(function(_0x443889,_0xe8911a){var _0x5b8621=shared[_0x0560('0x6f')];var _0x5035e3=_0x5b8621[_0x16ce18[_0x0560('0x70')]];if(_['isNil'](_0x5035e3)){_0x443889({'ret':0x1});}else{var _0x58c585=_0x5035e3['utcOffset'];var _0x50aa0c=squel[_0x0560('0x3c')]()['into'](_0x3e99b9)[_0x0560('0x71')]('id',_0x16ce18['id'])[_0x0560('0x71')](_0x0560('0x72'),_0x58c585)[_0x0560('0x71')](_0x0560('0x70'),_0x16ce18['dialTimezone'])['toString']();return db[_0x0560('0x5f')]['query'](_0x50aa0c)[_0x0560('0x61')](function(_0x1145c7){_0x443889({'ret':0x1});})[_0x0560('0x73')](function(_0x35ce2e){logger['error'](_0x35ce2e[_0x0560('0x5b')]);_0xe8911a({'ret':0x1});});}});}function handleTZQuery(_0x90e888){logger[_0x0560('0x58')](_0x90e888);return db[_0x0560('0x5f')][_0x0560('0x60')](_0x90e888)[_0x0560('0x61')](function(_0x23e44d){})['catch'](function(_0x4b28c0){logger[_0x0560('0x5a')](_0x4b28c0[_0x0560('0x5b')]);});}function main(_0x2e90d8,_0x17f302,_0x4f78e3,_0x31f2a7){logger[_0x0560('0x58')](_0x0560('0x74'),_0x2e90d8,JSON[_0x0560('0x75')](_0x17f302));process[_0x0560('0x76')](_0x0560('0x77'));var _0x326c92=_0x17f302['binding'];var _0x3d8bd6=_[_0x0560('0x78')](_0x326c92);var _0x3b44d7=_0x17f302[_0x0560('0x79')];var _0x52638d=path['join'](config[_0x0560('0x7a')],_0x0560('0x7b'),_0x3b44d7+'.csv');hasTZ=_['keys'](_0x326c92)['includes'](_0x0560('0x70'));var _0x281e7d=_['keys'](_0x326c92)[_0x0560('0x14')]();logger['info'](_0x0560('0x7c'),_0x281e7d);db['ContactItemType'][_0x0560('0x19')]({'raw':!![],'attributes':['id','name']})[_0x0560('0x1d')](function(_0x53ce54){for(var _0x28a4a7=0x0;_0x28a4a7<_0x53ce54[_0x0560('0x1b')];_0x28a4a7++){if(_0x53ce54[_0x28a4a7][_0x0560('0x7d')]in _0x326c92){contactItemTypes['push'](_0x53ce54[_0x28a4a7]);delete _0x3d8bd6[_0x53ce54[_0x28a4a7][_0x0560('0x7d')]];hasAdditionalPhones=!![];}for(var _0x3ffc22 in _0x326c92){if(_0x53ce54[_0x28a4a7][_0x0560('0x7d')]+_0x0560('0x7e')===_0x3ffc22){phoneDescriptions[_0x0560('0x1c')]({'itemTypeId':_0x53ce54[_0x28a4a7]['id'],'description':_0x3ffc22});delete _0x3d8bd6[_0x3ffc22];}}}if(hasAdditionalPhones)_0x3d8bd6[_0x0560('0x1a')]='';var _0x2c91d7=_['keys'](_0x3d8bd6)[_0x0560('0x14')]();logger[_0x0560('0x58')](_0x0560('0x7c'),_0x2c91d7);fs[_0x0560('0x7f')](_0x52638d,_0x2c91d7+'\x0a');Papa[_0x0560('0x80')](fs[_0x0560('0x81')](_0x2e90d8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1bed7f,_0x320fb0){try{for(var _0x82b6fc=0x0,_0x300ea4=[];_0x82b6fc<_0x1bed7f[_0x0560('0x82')]['length'];_0x82b6fc++){stats[_0x0560('0x83')]+=0x1;if(_0x1bed7f['errors'][_0x82b6fc]){handleError(_0x1bed7f[_0x0560('0x82')][_0x82b6fc],_0x1bed7f['errors'][_0x82b6fc]);}else{var _0x1f49b7=[];var _0x2269f9=[];var _0x208242={};for(var _0x51f52e in _0x326c92){let _0xbe850c=contactItemTypes[_0x0560('0x84')](_0x23864a=>_0x23864a[_0x0560('0x7d')]===_0x51f52e);let _0x300aeb=contactItemTypes[_0x0560('0x84')](_0x8ea5ff=>_0x8ea5ff[_0x0560('0x7d')]+_0x0560('0x7e')===_0x51f52e);if(_[_0x0560('0x1e')](_0xbe850c)&&_[_0x0560('0x1e')](_0x300aeb)){if(_0x326c92['hasOwnProperty'](_0x51f52e)){if(_0x1bed7f[_0x0560('0x82')][_0x82b6fc][_0x326c92[_0x51f52e]]){var _0x2fca7b=_['trim'](_0x1bed7f['data'][_0x82b6fc][_0x326c92[_0x51f52e]]['replace'](/"/g,'\x27'));switch(_0x51f52e){case _0x0560('0x2d'):var _0x509348=moment(_0x2fca7b,_0x0560('0x85'),!![]);if(_0x509348[_0x0560('0x86')]()){_0x300ea4['push']('\x22'+_0x2fca7b+'\x22');}else{_0x1f49b7[_0x0560('0x1c')](_0x0560('0x87'));}break;case _0x0560('0x31'):var _0x19ac35=parseInt(_0x2fca7b);_0x2fca7b=_[_0x0560('0x88')](_0x19ac35)||_0x19ac35<0x0||_0x19ac35>0x4?_0x31f2a7?0x3:0x2:_0x19ac35;_0x300ea4['push']('\x22'+_0x2fca7b+'\x22');break;case'UserId':var _0x437a4c=parseInt(_0x2fca7b);if(_[_0x0560('0x89')](_0x437a4c)&&_['includes'](_0x4f78e3,_0x437a4c)){_0x300ea4[_0x0560('0x1c')]('\x22'+_0x437a4c+'\x22');}else{_0x1f49b7[_0x0560('0x1c')](_0x0560('0x8a'));}break;case'email':if(isEmail(_0x2fca7b)){_0x300ea4[_0x0560('0x1c')]('\x22'+_0x2fca7b+'\x22');}else{_0x1f49b7['push']('email\x20wrong\x20format');}break;case _0x0560('0x8b'):var _0x2394a5=moment(_0x2fca7b,_0x0560('0x8c'),!![]);if(_0x2394a5[_0x0560('0x86')]()){_0x300ea4['push']('\x22'+_0x2fca7b+'\x22');}else{_0x1f49b7[_0x0560('0x1c')](_0x0560('0x8d'));}break;case _0x0560('0x70'):var _0x2ba750=shared[_0x0560('0x6f')];var _0x25333e=_0x2ba750[_0x2fca7b];if(!_['isNil'](_0x25333e)){var _0x2cc3e1=_0x25333e[_0x0560('0x8e')];_0x300ea4['push']('\x22'+_0x2fca7b+'\x22');_0x300ea4['push']('\x22'+_0x2cc3e1+'\x22');}break;default:_0x300ea4['push']('\x22'+_0x2fca7b+'\x22');}}else{switch(_0x51f52e){case _0x0560('0x8f'):case _0x0560('0x12'):_0x1f49b7[_0x0560('0x1c')](_0x51f52e+'\x20not\x20specified');break;default:_0x300ea4['push']('\x22\x22');}}}}else{var _0x1e8900='';if(!_[_0x0560('0x1e')](_0xbe850c)){if(!_0x208242[_0x0560('0x90')](_0xbe850c['id'])){if(!_[_0x0560('0x1e')](_0x1bed7f['data'][_0x82b6fc][_0x326c92[_0x51f52e]])){var _0x2fca7b=_['trim'](_0x1bed7f[_0x0560('0x82')][_0x82b6fc][_0x326c92[_0x51f52e]]['replace'](/"/g,'\x27'));var _0x4becc2=phoneDescriptions[_0x0560('0x84')](_0x42c784=>_0x42c784[_0x0560('0x91')]===_0xbe850c['id']);if(!_[_0x0560('0x1e')](_0x4becc2)){var _0x2f9cbd=_['trim'](_0x1bed7f[_0x0560('0x82')][_0x82b6fc][_0x326c92[_0x4becc2[_0x0560('0x92')]]]['replace'](/"/g,'\x27'));if(!_[_0x0560('0x1e')](_0x2f9cbd))_0x2fca7b=_0x2fca7b+'§'+_0x2f9cbd;}if(_0x1e8900=='')_0x1e8900=_0x2fca7b;else _0x1e8900+='|'+_0x2fca7b;}_0x2269f9['push'](_0xbe850c['id']+':'+_0x1e8900);_0x208242[_0xbe850c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x300ea4[_0x0560('0x1c')]('\x22'+_0x2269f9[_0x0560('0x14')](';')+'\x22');}if(_0x1f49b7['length']){handleError(_0x1bed7f[_0x0560('0x82')][_0x82b6fc],{'code':'SystemRow','message':_0x1f49b7[_0x0560('0x14')]()});}else{fs[_0x0560('0x93')](_0x52638d,_0x300ea4[_0x0560('0x14')]()+'\x0a');}_0x300ea4=[];}if(!(stats[_0x0560('0x83')]%0xc8)){socket[_0x0560('0x94')]('contact:import:'+_0x3b44d7,stats);stats['errors']=[];}}if(stopped){logger[_0x0560('0x58')](_0x0560('0x95'));_0x320fb0[_0x0560('0x96')]();}}catch(_0x108d5c){handleError(_0x1bed7f[_0x0560('0x82')][_0x82b6fc],{'code':_0x0560('0x97'),'message':_0x108d5c[_0x0560('0x5b')]});logger[_0x0560('0x5a')]('step',_0x108d5c[_0x0560('0x5b')]);}},'complete':function(){try{var _0x263561=[];var _0x40b0ab=[];var _0x511c90='cm_contacts';if(_0x17f302[_0x0560('0x98')]&&_0x17f302[_0x0560('0x98')][_0x0560('0x1b')]){_0x511c90='cm_contacts_'+_0x3b44d7;_0x263561[_0x0560('0x1c')](_0x0560('0x99')+_0x511c90+_0x0560('0x9a'));}tmp_campaigns='campaigns_'+_0x3b44d7;tmp_voice_queues='voice_queues_'+_0x3b44d7;_0x40b0ab['push'](_0x0560('0x99')+tmp_campaigns+_0x0560('0x9b'));_0x40b0ab[_0x0560('0x1c')](_0x0560('0x99')+tmp_voice_queues+_0x0560('0x9b'));BPromise[_0x0560('0x9c')](_0x40b0ab,handleTZQuery)[_0x0560('0x1d')](function(_0x469896){updateTzCampaigns(_0x17f302[_0x0560('0x3e')])[_0x0560('0x1d')](function(_0x3897d6){updateTzVoiceQueues(_0x17f302[_0x0560('0x3e')])[_0x0560('0x1d')](function(_0x4d66e8){if(hasTZ)_0x2c91d7=_0x2c91d7[_0x0560('0x9d')](_0x0560('0x70'),_0x0560('0x9e'));var _0x3c719d=util[_0x0560('0xf')](_0x0560('0x9f'),_0x52638d,_0x511c90,_0x2c91d7,_0x17f302[_0x0560('0x3e')],_0x17f302[_0x0560('0xa0')]||null,NOW,NOW);if(_[_0x0560('0x1e')](_0x326c92[_0x0560('0x2d')])){_0x3c719d+=_0x0560('0xa1');}_0x263561['push'](_0x3c719d);if(_0x17f302[_0x0560('0x98')]&&_0x17f302[_0x0560('0x98')]['length']){_0x263561[_0x0560('0x1c')](insertCmContact(_0x17f302[_0x0560('0x3e')],_0x511c90,_0x17f302['duplicates'],_0x326c92));_0x263561[_0x0560('0x1c')](_0x0560('0xa2')+_0x511c90+';');}BPromise[_0x0560('0x9c')](_0x263561,handleQuery)[_0x0560('0x1d')](function(_0x1dc33c){BPromise['all']([handleAdditionalPhones()])[_0x0560('0x1d')](function(){_0x263561=[];for(var _0x4bf3cd=0x0;_0x4bf3cd\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','field','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','findOne','CmContactHasItem','updated','PHONE','CmContact'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x117c,0x71));var _0xc117=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0x117c[_0x4a9beb];return _0x2d4c58;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require('papaparse');var util=require(_0xc117('0x0'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0xc117('0x1'));var Redis=require(_0xc117('0x2'));var db=require(_0xc117('0x3'))['db'];var config=require(_0xc117('0x4'));var logger=require(_0xc117('0x5'))(_0xc117('0x6'));config['redis']=_[_0xc117('0x7')](config[_0xc117('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc117('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xc117('0xa')](_0xc117('0xb'));var tempTableName=_0xc117('0xc')+moment()[_0xc117('0xa')](_0xc117('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4a1e04){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))*$/[_0xc117('0xe')](_0x4a1e04);}function selectNotIn(_0x574c99,_0x44d812,_0x597df9,_0x41b20e,_0x25d4ff){return squel['select']()[_0xc117('0xf')]('phone')[_0xc117('0x10')](_0x41b20e)[_0xc117('0x11')](_0x44d812,null,_0x44d812+_0xc117('0x12')+_0x41b20e+'.'+_0x597df9)[_0xc117('0x13')](_0x41b20e+'.'+_0x597df9+'\x20=\x20'+_0x574c99+'.'+_0x597df9)[_0xc117('0x13')](_0x44d812+_0xc117('0x14')+_0x25d4ff[_0xc117('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x9dec18,_0x534955){promisesAdditionalPhones=[];promisesContact=[];return db[_0xc117('0x15')][_0xc117('0x16')](_0xc117('0x17')+tempTableName)[_0xc117('0x18')](function(_0x58bce8){if(_0x58bce8!==null){var _0x5350e9=[];for(var _0x1dfaa6=0x0;_0x1dfaa6<_0x58bce8[_0xc117('0x19')];_0x1dfaa6++){var _0x3eaf68=_0x58bce8[_0x1dfaa6];if(!_[_0xc117('0x1a')](_0x3eaf68[_0xc117('0x1b')])){if(!_[_0xc117('0x1a')](_0x3eaf68[_0xc117('0x1c')]))_0x5350e9[_0xc117('0x1d')](insertAdditionalPhones(_0x3eaf68));promisesContact[_0xc117('0x1d')]({'contact':_0x3eaf68});}}}Promise[_0xc117('0x1e')](_0x5350e9)[_0xc117('0x1f')](function(){_0x9dec18({'val':0x1});});})[_0xc117('0x20')](function(_0x547deb){logger[_0xc117('0x21')](_0x547deb[_0xc117('0x22')]);});});}function insertAdditionalPhones(_0xf5307f){return new Promise(function(_0x1a5ba0,_0x3946cb){var _0x37d9de=_0xf5307f[_0xc117('0x1c')];if(_['isNil'](_0x37d9de))_0x3946cb({'val':0x0});else{var _0x4f7594=_0x37d9de[_0xc117('0x23')](';');var _0x24bb40=[];orderBy=0x0;for(var _0x1492d0=0x0;_0x1492d0<_0x4f7594[_0xc117('0x19')];_0x1492d0++){_0x24bb40[_0xc117('0x1d')](splitAdditionalPhone(_0xf5307f['id'],_0x4f7594[_0x1492d0]));}Promise[_0xc117('0x1e')](_0x24bb40)['then'](function(){_0x1a5ba0({'val':_0x4f7594['length']});});}});}function splitAdditionalPhone(_0x3d670e,_0x481e10){return new Promise(function(_0xa0ee6b,_0x7545d){var _0x216370=_0x481e10['split'](':');var _0x3d71f8=_0x216370[0x0];var _0xfefce5=_0x216370[0x1];if(_0xfefce5!==''){var _0x41e376=_0xfefce5[_0xc117('0x23')]('|');var _0x2cc134=[];for(var _0x28575b=0x0;_0x28575b<_0x41e376['length'];_0x28575b++){if(_0x41e376[_0x28575b]!==''){var _0x334041=_['filter'](promisesAdditionalPhones,{'contactId':_0x3d670e,'phone':_0x41e376[_0x28575b]});if(_0x334041['length']==0x0){orderBy++;promisesAdditionalPhones[_0xc117('0x1d')]({'contactId':_0x3d670e,'contactTypeId':_0x3d71f8,'phone':_0x41e376[_0x28575b],'orderBy':orderBy});}}}_0xa0ee6b({'ok':0x1});}else _0xa0ee6b({'res':0x0});});}function createAdditionalPhone(_0x35efea,_0x280c72,_0x52c152,_0x211fb1){var _0x5db129='';var _0x4a2a10='';var _0x459b8a=_0x52c152[_0xc117('0x23')]('§');_0x5db129=_0x459b8a[0x0];if(_0x459b8a[_0xc117('0x19')]==0x2)_0x4a2a10=_0x459b8a[0x1];return new Promise(function(_0x4e8630,_0x416074){return db['CmContactHasItem'][_0xc117('0x24')]({'where':{'CmContactId':_0x35efea,'item':_0x5db129}})[_0xc117('0x1f')](function(_0x21eb0f){if(_0x21eb0f){return db[_0xc117('0x25')]['update']({'ItemTypeId':_0x280c72,'description':_0x4a2a10,'OrderBy':_0x211fb1},{'where':{'CmContactId':_0x35efea,'item':_0x5db129}})[_0xc117('0x1f')](function(_0x3aaf53){_0x4e8630({'res':_0xc117('0x26')});});}else{return db[_0xc117('0x25')]['create']({'CmContactId':_0x35efea,'item':_0x5db129,'ItemTypeId':_0x280c72,'description':_0x4a2a10,'OrderBy':_0x211fb1,'ItemClass':_0xc117('0x27')})['then'](function(_0x29ab11){_0x4e8630({'res':'inserted'});});}});});}function updateContact(_0x3e8ce7){return new Promise(function(_0x5a00ae,_0x450583){var _0x5ae0d6=_0x3e8ce7['id'];delete _0x3e8ce7['id'];return db[_0xc117('0x28')][_0xc117('0x29')](_0x3e8ce7,{'where':{'id':_0x5ae0d6}})[_0xc117('0x1f')](function(_0x4ede76){updatedRows+=0x1;return db[_0xc117('0x2a')][_0xc117('0x29')]({'phone':_0x3e8ce7[_0xc117('0x1b')]},{'where':{'ContactId':_0x5ae0d6}})[_0xc117('0x1f')](function(_0x44942a){_0x5a00ae({'ret':'OK'});});});});}function insertCmHopper(_0x31e654,_0x36cd65,_0x3302b9,_0x4c0135,_0x1222d6){var _0x15858e=[_0xc117('0x2b'),'cm_contacts.scheduledat',_0xc117('0x2c'),_0xc117('0x2d'),_0x36cd65+'.'+_0x4c0135,_0xc117('0x2e'),_0xc117('0x2f'),_0xc117('0x30'),_0xc117('0x31'),'\x22'+_0x1222d6+'\x22'];return squel[_0xc117('0x32')]()['into'](_0xc117('0x33'))[_0xc117('0x34')](['phone',_0xc117('0x35'),_0xc117('0x36'),_0xc117('0x37'),_0x4c0135,'createdAt','updatedAt','priority',_0xc117('0x38'),'recallme'],squel[_0xc117('0x39')]()[_0xc117('0x3a')](_0x15858e)[_0xc117('0x10')](_0x36cd65)[_0xc117('0x11')](_0xc117('0x3b'),null,_0xc117('0x3c')+_0x36cd65+'.CmListId')[_0xc117('0x11')](_0x3302b9,null,_0x3302b9+_0xc117('0x12')+_0x36cd65+'.'+_0x4c0135)['where'](_0x36cd65+_0xc117('0x3d'),_0x31e654)['where'](_0xc117('0x3e'),NOW)[_0xc117('0x13')](_0xc117('0x3f'),selectNotIn(_0x36cd65,_0x3302b9,_0x4c0135,'cm_hopper',[_0xc117('0x40'),_0xc117('0x41')]))[_0xc117('0x13')](_0xc117('0x3f'),selectNotIn(_0x36cd65,_0x3302b9,_0x4c0135,'cm_hopper',[_0xc117('0x40')])))[_0xc117('0x42')]();}function insertCmHopperBlack(_0x4e6c89,_0x2880b8,_0x2066cf,_0x5128ef){var _0x180af9=['cm_contacts.phone',_0xc117('0x2c'),_0xc117('0x2d'),_0x2880b8+'.'+_0x5128ef,_0xc117('0x2e'),_0xc117('0x2f')];return squel['insert']()['into']('cm_hopper_black')[_0xc117('0x34')]([_0xc117('0x1b'),'ContactId','ListId',_0x5128ef,'createdAt',_0xc117('0x43')],squel[_0xc117('0x39')]()[_0xc117('0x3a')](_0x180af9)[_0xc117('0x10')](_0x2880b8)[_0xc117('0x11')](_0xc117('0x3b'),null,'cm_contacts.ListId\x20=\x20'+_0x2880b8+'.CmListId')[_0xc117('0x11')](_0x2066cf,null,_0x2066cf+_0xc117('0x12')+_0x2880b8+'.'+_0x5128ef)['where'](_0x2880b8+'.CmListId\x20=\x20?',_0x4e6c89)[_0xc117('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc117('0x13')](_0xc117('0x3f'),squel[_0xc117('0x39')]()[_0xc117('0xf')]('phone')[_0xc117('0x10')](_0xc117('0x44'))['where'](_0xc117('0x45'),_0x4e6c89)[_0xc117('0x13')](_0x5128ef+'\x20=\x20?',_0x2880b8+'.'+_0x5128ef)))['toString']();}function insertCmHopperAdditionalPhones(_0x4bb482){var _0x21d80e=[_0xc117('0x46'),_0xc117('0x47'),_0xc117('0x48'),_0xc117('0x49'),_0xc117('0x4a')];return squel['insert']()['into'](_0xc117('0x4b'))[_0xc117('0x34')]([_0xc117('0x4c'),_0xc117('0x1b'),_0xc117('0x4d'),_0xc117('0x4e'),'updatedAt'],squel[_0xc117('0x39')]()[_0xc117('0x3a')](_0x21d80e)[_0xc117('0x10')](_0xc117('0x33'))[_0xc117('0x11')](_0xc117('0x3b'),null,_0xc117('0x4f'))[_0xc117('0x11')](_0xc117('0x50'),null,_0xc117('0x51'))['where'](_0xc117('0x52'),_0x4bb482)['where'](_0xc117('0x3e'),NOW))['toString']();}function insertCmContact(_0x3e6ae5,_0x42b55b,_0x932653,_0xdca56a){var _0x3374fe=_['concat'](_[_0xc117('0x53')](_0xdca56a),[_0xc117('0x37'),'CompanyId',_0xc117('0x4e'),_0xc117('0x43')]);return squel['insert']()[_0xc117('0x54')]('cm_contacts')[_0xc117('0x34')](_0x3374fe,squel['select']()[_0xc117('0x3a')](_0x3374fe)['from'](_0x42b55b)[_0xc117('0x13')]('('+_0x932653[_0xc117('0x11')](',')+_0xc117('0x55'),squel[_0xc117('0x39')]()[_0xc117('0x3a')](_0x932653)[_0xc117('0x10')]('cm_contacts')['where'](_0xc117('0x45'),_0x3e6ae5))['where'](_0xc117('0x56'),squel[_0xc117('0x39')]()[_0xc117('0xf')]('MIN(id)',_0xc117('0x57'))[_0xc117('0x10')](_0x42b55b)['group'](_0x932653[_0xc117('0x11')](','))))[_0xc117('0x42')]();}function handleStop(){logger[_0xc117('0x58')](_0xc117('0x59'));stopped=!![];}function handleUncaughtException(_0x14529d){logger[_0xc117('0x21')](_0x14529d[_0xc117('0x22')]);process[_0xc117('0x5a')](0x1);}function handleError(_0x23c4b0,_0x26a8f5){stats[_0xc117('0x5b')][_0xc117('0x1d')]({'name':_0x26a8f5[_0xc117('0x5c')],'message':_0x26a8f5['message'],'row':_0x23c4b0});}function handleQuery(_0x56706a){logger[_0xc117('0x58')](_0x56706a);return db[_0xc117('0x15')]['query'](_0x56706a)[_0xc117('0x18')](function(_0x45d86e){results[_0xc117('0x1d')](_0x45d86e);})[_0xc117('0x20')](function(_0x21d5ac){logger[_0xc117('0x21')](_0x21d5ac[_0xc117('0x22')]);});}function main(_0x33587a,_0xf040d1,_0x7f7504,_0x25ff8c){logger['info'](_0xc117('0x5d'),_0x33587a,JSON[_0xc117('0x5e')](_0xf040d1));process[_0xc117('0x5f')](_0xc117('0x60'));var _0x31f81e=_0xf040d1[_0xc117('0x61')];var _0x28901b=_[_0xc117('0x62')](_0x31f81e);var _0x1a010e=_0xf040d1[_0xc117('0x63')];var _0x59df9f=path[_0xc117('0x11')](config['root'],_0xc117('0x64'),_0x1a010e+_0xc117('0x65'));logger[_0xc117('0x58')](_0xc117('0x66'),_0xf040d1);db[_0xc117('0x67')][_0xc117('0x68')]({'raw':!![],'attributes':['id','name']})[_0xc117('0x1f')](function(_0x45ea48){for(var _0xea89d2=0x0;_0xea89d2<_0x45ea48[_0xc117('0x19')];_0xea89d2++){if(_0x45ea48[_0xea89d2][_0xc117('0x69')]in _0x31f81e){contactItemTypes[_0xc117('0x1d')](_0x45ea48[_0xea89d2]);delete _0x28901b[_0x45ea48[_0xea89d2][_0xc117('0x69')]];hasAdditionalPhones=!![];}for(var _0xcdc443 in _0x31f81e){if(_0x45ea48[_0xea89d2][_0xc117('0x69')]+_0xc117('0x6a')===_0xcdc443){phoneDescriptions[_0xc117('0x1d')]({'itemTypeId':_0x45ea48[_0xea89d2]['id'],'description':_0xcdc443});delete _0x28901b[_0xcdc443];}}}if(hasAdditionalPhones)_0x28901b['AdditionalPhones']='';var _0x2aebbd=_[_0xc117('0x53')](_0x28901b)['join']();logger[_0xc117('0x58')]('header',_0x2aebbd);fs['writeFileSync'](_0x59df9f,_0x2aebbd+'\x0a');Papa[_0xc117('0x6b')](fs[_0xc117('0x6c')](_0x33587a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b45ba,_0x5e92ec){try{for(var _0x5300a0=0x0,_0x2b5061=[];_0x5300a0<_0x3b45ba[_0xc117('0x6d')]['length'];_0x5300a0++){stats[_0xc117('0x6e')]+=0x1;if(_0x3b45ba[_0xc117('0x5b')][_0x5300a0]){handleError(_0x3b45ba[_0xc117('0x6d')][_0x5300a0],_0x3b45ba['errors'][_0x5300a0]);}else{var _0x1bfc80=[];var _0x54100c=[];var _0x3a6327={};for(var _0x549690 in _0x31f81e){let _0x488f16=contactItemTypes[_0xc117('0x6f')](_0x120df9=>_0x120df9[_0xc117('0x69')]===_0x549690);let _0x24f523=contactItemTypes[_0xc117('0x6f')](_0x29e084=>_0x29e084[_0xc117('0x69')]+_0xc117('0x6a')===_0x549690);if(_[_0xc117('0x1a')](_0x488f16)&&_[_0xc117('0x1a')](_0x24f523)){if(_0x31f81e[_0xc117('0x70')](_0x549690)){if(_0x3b45ba[_0xc117('0x6d')][_0x5300a0][_0x31f81e[_0x549690]]){var _0x1466b9=_[_0xc117('0x71')](_0x3b45ba[_0xc117('0x6d')][_0x5300a0][_0x31f81e[_0x549690]][_0xc117('0x72')](/"/g,'\x27'));switch(_0x549690){case _0xc117('0x35'):var _0x1514b2=moment(_0x1466b9,_0xc117('0xb'),!![]);if(_0x1514b2[_0xc117('0x73')]()){_0x2b5061['push']('\x22'+_0x1466b9+'\x22');}else{_0x1bfc80[_0xc117('0x1d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc117('0x74'):var _0x3aa02f=parseInt(_0x1466b9);_0x1466b9=_[_0xc117('0x75')](_0x3aa02f)||_0x3aa02f<0x0||_0x3aa02f>0x4?_0x25ff8c?0x3:0x2:_0x3aa02f;_0x2b5061[_0xc117('0x1d')]('\x22'+_0x1466b9+'\x22');break;case _0xc117('0x38'):var _0x2f7ac7=parseInt(_0x1466b9);if(_[_0xc117('0x76')](_0x2f7ac7)&&_[_0xc117('0x77')](_0x7f7504,_0x2f7ac7)){_0x2b5061['push']('\x22'+_0x2f7ac7+'\x22');}else{_0x1bfc80[_0xc117('0x1d')](_0xc117('0x78'));}break;case'email':if(isEmail(_0x1466b9)){_0x2b5061[_0xc117('0x1d')]('\x22'+_0x1466b9+'\x22');}else{_0x1bfc80['push'](_0xc117('0x79'));}break;case _0xc117('0x7a'):var _0x16f04e=moment(_0x1466b9,'YYYY-MM-DD',!![]);if(_0x16f04e['isValid']()){_0x2b5061[_0xc117('0x1d')]('\x22'+_0x1466b9+'\x22');}else{_0x1bfc80[_0xc117('0x1d')](_0xc117('0x7b'));}break;default:_0x2b5061['push']('\x22'+_0x1466b9+'\x22');}}else{switch(_0x549690){case _0xc117('0x7c'):case _0xc117('0x1b'):_0x1bfc80[_0xc117('0x1d')](_0x549690+'\x20not\x20specified');break;default:_0x2b5061['push']('\x22\x22');}}}}else{var _0x5edc3f='';if(!_[_0xc117('0x1a')](_0x488f16)){if(!_0x3a6327[_0xc117('0x70')](_0x488f16['id'])){for(var _0x278195=0x0;_0x278195<_0x31f81e[_0x549690][_0xc117('0x19')];_0x278195++){var _0x1466b9=_[_0xc117('0x71')](_0x3b45ba[_0xc117('0x6d')][_0x5300a0][_0x31f81e[_0x549690][_0x278195]][_0xc117('0x72')](/"/g,'\x27'));var _0x872ecb=phoneDescriptions['find'](_0x3b0d94=>_0x3b0d94[_0xc117('0x7d')]===_0x488f16['id']);if(!_[_0xc117('0x1a')](_0x872ecb)){var _0x406f9f=_[_0xc117('0x71')](_0x3b45ba['data'][_0x5300a0][_0x31f81e[_0x872ecb[_0xc117('0x7e')]][0x0]][_0xc117('0x72')](/"/g,'\x27'));if(!_[_0xc117('0x1a')](_0x406f9f))_0x1466b9=_0x1466b9+'§'+_0x406f9f;}if(_0x5edc3f=='')_0x5edc3f=_0x1466b9;else _0x5edc3f+='|'+_0x1466b9;}_0x54100c['push'](_0x488f16['id']+':'+_0x5edc3f);_0x3a6327[_0x488f16['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2b5061[_0xc117('0x1d')]('\x22'+_0x54100c[_0xc117('0x11')](';')+'\x22');}if(_0x1bfc80[_0xc117('0x19')]){handleError(_0x3b45ba['data'][_0x5300a0],{'code':'SystemRow','message':_0x1bfc80[_0xc117('0x11')]()});}else{fs[_0xc117('0x7f')](_0x59df9f,_0x2b5061['join']()+'\x0a');}_0x2b5061=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x1a010e,stats);stats[_0xc117('0x5b')]=[];}}if(stopped){logger[_0xc117('0x58')](_0xc117('0x80'));_0x5e92ec['abort']();}}catch(_0x39d014){handleError(_0x3b45ba['data'][_0x5300a0],{'code':'SystemError','message':_0x39d014['message']});logger['error'](_0xc117('0x81'),_0x39d014[_0xc117('0x22')]);}},'complete':function(){try{var _0x9f271a=[];var _0x504f5c=tempTableName;_0x9f271a[_0xc117('0x1d')]('CREATE\x20TABLE\x20'+_0x504f5c+_0xc117('0x82'));logger['info'](_0xc117('0x83'),contactItemTypes[_0xc117('0x19')]);var _0x4bd6fa=util[_0xc117('0xa')](_0xc117('0x84'),_0x59df9f,_0x504f5c,_0x2aebbd,_0xf040d1['ListId'],_0xf040d1[_0xc117('0x85')]||null,NOW,NOW);if(_[_0xc117('0x1a')](_0x31f81e[_0xc117('0x35')])){_0x4bd6fa+=_0xc117('0x86');}_0x9f271a[_0xc117('0x1d')](_0x4bd6fa);BPromise[_0xc117('0x87')](_0x9f271a,handleQuery)[_0xc117('0x1f')](function(_0x284a87){BPromise[_0xc117('0x1e')]([handleAdditionalPhones()])['then'](function(){_0x9f271a=[];for(var _0x4a7a81=0x0;_0x4a7a81\x20\x20','root','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','then','split','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat'];(function(_0x173abc,_0x298ee4){var _0x4f1afe=function(_0x498434){while(--_0x498434){_0x173abc['push'](_0x173abc['shift']());}};_0x4f1afe(++_0x298ee4);}(_0xb7aa,0x11a));var _0xab7a=function(_0x4c804b,_0x2194f6){_0x4c804b=_0x4c804b-0x0;var _0x13e04c=_0xb7aa[_0x4c804b];return _0x13e04c;};'use strict';var fs=require('fs');var path=require(_0xab7a('0x0'));var _=require(_0xab7a('0x1'));var Papa=require(_0xab7a('0x2'));var util=require(_0xab7a('0x3'));var BPromise=require(_0xab7a('0x4'));var moment=require(_0xab7a('0x5'));var squel=require(_0xab7a('0x6'));var Redis=require(_0xab7a('0x7'));var db=require(_0xab7a('0x8'))['db'];var config=require(_0xab7a('0x9'));var logger=require('../../../config/logger')(_0xab7a('0xa'));config[_0xab7a('0xb')]=_[_0xab7a('0xc')](config[_0xab7a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7a('0xd'))(new Redis(config[_0xab7a('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xab7a('0xe'));var tempTableName=_0xab7a('0xf')+moment()[_0xab7a('0x10')](_0xab7a('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x40cc81){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))*$/[_0xab7a('0x12')](_0x40cc81);}function selectNotIn(_0x2e2e53,_0x2ac769,_0x402384,_0x1d741e,_0x563b84){return squel[_0xab7a('0x13')]()[_0xab7a('0x14')](_0xab7a('0x15'))[_0xab7a('0x16')](_0x1d741e)['join'](_0x2ac769,null,_0x2ac769+_0xab7a('0x17')+_0x1d741e+'.'+_0x402384)[_0xab7a('0x18')](_0x1d741e+'.'+_0x402384+_0xab7a('0x19')+_0x2e2e53+'.'+_0x402384)[_0xab7a('0x18')](_0x2ac769+'.dialCheckDuplicateType\x20IN\x20('+_0x563b84[_0xab7a('0x1a')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1cc43f,_0x4a78b8){promisesAdditionalPhones=[];promisesContact=[];return db[_0xab7a('0x1b')][_0xab7a('0x1c')](_0xab7a('0x1d')+tempTableName)[_0xab7a('0x1e')](function(_0x30146c){if(_0x30146c!==null){var _0x522f10=[];for(var _0x198e78=0x0;_0x198e78<_0x30146c[_0xab7a('0x1f')];_0x198e78++){var _0x5038c9=_0x30146c[_0x198e78];if(!_[_0xab7a('0x20')](_0x5038c9[_0xab7a('0x15')])){if(!_[_0xab7a('0x20')](_0x5038c9[_0xab7a('0x21')]))_0x522f10[_0xab7a('0x22')](insertAdditionalPhones(_0x5038c9));promisesContact[_0xab7a('0x22')]({'contact':_0x5038c9});}}}Promise[_0xab7a('0x23')](_0x522f10)['then'](function(){_0x1cc43f({'val':0x1});});})[_0xab7a('0x24')](function(_0x2ea6c8){logger[_0xab7a('0x25')](_0x2ea6c8[_0xab7a('0x26')]);});});}function insertAdditionalPhones(_0x2fa287){return new Promise(function(_0x37e3bc,_0x2179b5){var _0x2c7e6e=_0x2fa287[_0xab7a('0x21')];if(_[_0xab7a('0x20')](_0x2c7e6e))_0x2179b5({'val':0x0});else{var _0x255c2e=_0x2c7e6e['split'](';');var _0x4b65f0=[];orderBy=0x0;for(var _0x5c4c3e=0x0;_0x5c4c3e<_0x255c2e[_0xab7a('0x1f')];_0x5c4c3e++){_0x4b65f0[_0xab7a('0x22')](splitAdditionalPhone(_0x2fa287['id'],_0x255c2e[_0x5c4c3e]));}Promise[_0xab7a('0x23')](_0x4b65f0)[_0xab7a('0x27')](function(){_0x37e3bc({'val':_0x255c2e[_0xab7a('0x1f')]});});}});}function splitAdditionalPhone(_0x8c1e1f,_0x3324f2){return new Promise(function(_0x533680,_0x4d2ad4){var _0x2c62dc=_0x3324f2['split'](':');var _0x4d8e6b=_0x2c62dc[0x0];var _0x249904=_0x2c62dc[0x1];if(_0x249904!==''){var _0x570a8b=_0x249904[_0xab7a('0x28')]('|');var _0x1f5399=[];for(var _0x81dc99=0x0;_0x81dc99<_0x570a8b[_0xab7a('0x1f')];_0x81dc99++){if(_0x570a8b[_0x81dc99]!==''){var _0x2b0885=_['filter'](promisesAdditionalPhones,{'contactId':_0x8c1e1f,'phone':_0x570a8b[_0x81dc99]});if(_0x2b0885[_0xab7a('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0xab7a('0x22')]({'contactId':_0x8c1e1f,'contactTypeId':_0x4d8e6b,'phone':_0x570a8b[_0x81dc99],'orderBy':orderBy});}}}_0x533680({'ok':0x1});}else _0x533680({'res':0x0});});}function createAdditionalPhone(_0x26c106,_0x4e4514,_0x42f40b,_0x311dfa){var _0x32945c='';var _0x599375='';var _0x5d16f4=_0x42f40b[_0xab7a('0x28')]('§');_0x32945c=_0x5d16f4[0x0];if(_0x5d16f4['length']==0x2)_0x599375=_0x5d16f4[0x1];return new Promise(function(_0x3f5219,_0x3dfbaf){return db['CmContactHasItem'][_0xab7a('0x29')]({'where':{'CmContactId':_0x26c106,'item':_0x32945c}})[_0xab7a('0x27')](function(_0x467dce){if(_0x467dce){return db[_0xab7a('0x2a')][_0xab7a('0x2b')]({'ItemTypeId':_0x4e4514,'description':_0x599375,'OrderBy':_0x311dfa},{'where':{'CmContactId':_0x26c106,'item':_0x32945c}})[_0xab7a('0x27')](function(_0x58a509){_0x3f5219({'res':_0xab7a('0x2c')});});}else{return db['CmContactHasItem'][_0xab7a('0x2d')]({'CmContactId':_0x26c106,'item':_0x32945c,'ItemTypeId':_0x4e4514,'description':_0x599375,'OrderBy':_0x311dfa,'ItemClass':_0xab7a('0x2e')})[_0xab7a('0x27')](function(_0x4ead7a){_0x3f5219({'res':_0xab7a('0x2f')});});}});});}function updateContact(_0x54877c){return new Promise(function(_0x59fb42,_0x3db987){var _0x11a3d9=_0x54877c['id'];delete _0x54877c['id'];return db[_0xab7a('0x30')][_0xab7a('0x2b')](_0x54877c,{'where':{'id':_0x11a3d9}})[_0xab7a('0x27')](function(_0x2ab316){updatedRows+=0x1;return db[_0xab7a('0x31')]['update']({'phone':_0x54877c[_0xab7a('0x15')]},{'where':{'ContactId':_0x11a3d9}})[_0xab7a('0x27')](function(_0x2ac036){_0x59fb42({'ret':'OK'});});});});}function insertCmHopper(_0x151928,_0x4ad5ff,_0x2df446,_0x36cb51,_0x2377d9){var _0x517407=[_0xab7a('0x32'),_0xab7a('0x33'),_0xab7a('0x34'),_0xab7a('0x35'),_0x4ad5ff+'.'+_0x36cb51,'cm_contacts.createdAt',_0xab7a('0x36'),_0xab7a('0x37'),_0xab7a('0x38'),'\x22'+_0x2377d9+'\x22'];return squel['insert']()['into'](_0xab7a('0x39'))['fromQuery']([_0xab7a('0x15'),_0xab7a('0x3a'),'ContactId','ListId',_0x36cb51,_0xab7a('0x3b'),_0xab7a('0x3c'),_0xab7a('0x3d'),_0xab7a('0x3e'),'recallme'],squel['select']()[_0xab7a('0x3f')](_0x517407)[_0xab7a('0x16')](_0x4ad5ff)[_0xab7a('0x1a')](_0xab7a('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0x4ad5ff+_0xab7a('0x41'))[_0xab7a('0x1a')](_0x2df446,null,_0x2df446+_0xab7a('0x17')+_0x4ad5ff+'.'+_0x36cb51)['where'](_0x4ad5ff+_0xab7a('0x42'),_0x151928)[_0xab7a('0x18')](_0xab7a('0x43'),NOW)[_0xab7a('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4ad5ff,_0x2df446,_0x36cb51,_0xab7a('0x39'),['\x22always\x22',_0xab7a('0x44')]))[_0xab7a('0x18')](_0xab7a('0x45'),selectNotIn(_0x4ad5ff,_0x2df446,_0x36cb51,'cm_hopper',[_0xab7a('0x46')])))[_0xab7a('0x47')]();}function insertCmHopperBlack(_0x294d16,_0x299a40,_0x5b0af5,_0x2ddf18){var _0x1a68a4=[_0xab7a('0x32'),_0xab7a('0x34'),'cm_contacts.ListId',_0x299a40+'.'+_0x2ddf18,_0xab7a('0x48'),'cm_contacts.updatedAt'];return squel[_0xab7a('0x49')]()['into'](_0xab7a('0x4a'))[_0xab7a('0x4b')](['phone',_0xab7a('0x4c'),_0xab7a('0x4d'),_0x2ddf18,_0xab7a('0x3b'),_0xab7a('0x3c')],squel[_0xab7a('0x13')]()[_0xab7a('0x3f')](_0x1a68a4)['from'](_0x299a40)['join'](_0xab7a('0x40'),null,_0xab7a('0x4e')+_0x299a40+_0xab7a('0x41'))[_0xab7a('0x1a')](_0x5b0af5,null,_0x5b0af5+_0xab7a('0x17')+_0x299a40+'.'+_0x2ddf18)[_0xab7a('0x18')](_0x299a40+_0xab7a('0x42'),_0x294d16)[_0xab7a('0x18')](_0xab7a('0x43'),NOW)[_0xab7a('0x18')](_0xab7a('0x45'),squel[_0xab7a('0x13')]()['field']('phone')[_0xab7a('0x16')](_0xab7a('0x4a'))[_0xab7a('0x18')]('ListId\x20=\x20?',_0x294d16)[_0xab7a('0x18')](_0x2ddf18+'\x20=\x20?',_0x299a40+'.'+_0x2ddf18)))[_0xab7a('0x47')]();}function insertCmHopperAdditionalPhones(_0x22beab){var _0x5c4478=['cm_hopper.id','cm_contact_has_items.item',_0xab7a('0x4f'),_0xab7a('0x50'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xab7a('0x51')](_0xab7a('0x52'))[_0xab7a('0x4b')]([_0xab7a('0x53'),_0xab7a('0x15'),'OrderBy','createdAt',_0xab7a('0x3c')],squel['select']()[_0xab7a('0x3f')](_0x5c4478)['from'](_0xab7a('0x39'))[_0xab7a('0x1a')](_0xab7a('0x40'),null,_0xab7a('0x54'))[_0xab7a('0x1a')](_0xab7a('0x55'),null,_0xab7a('0x56'))[_0xab7a('0x18')](_0xab7a('0x57'),_0x22beab)[_0xab7a('0x18')](_0xab7a('0x43'),NOW))['toString']();}function insertCmContact(_0x3bfdae,_0xafeb36,_0x14d6bd,_0x443c2a){var _0x58e0ec=_['concat'](_['keys'](_0x443c2a),[_0xab7a('0x4d'),_0xab7a('0x58'),'createdAt',_0xab7a('0x3c')]);return squel[_0xab7a('0x49')]()[_0xab7a('0x51')](_0xab7a('0x40'))[_0xab7a('0x4b')](_0x58e0ec,squel[_0xab7a('0x13')]()[_0xab7a('0x3f')](_0x58e0ec)[_0xab7a('0x16')](_0xafeb36)[_0xab7a('0x18')]('('+_0x14d6bd[_0xab7a('0x1a')](',')+_0xab7a('0x59'),squel[_0xab7a('0x13')]()['fields'](_0x14d6bd)['from'](_0xab7a('0x40'))[_0xab7a('0x18')](_0xab7a('0x5a'),_0x3bfdae))['where'](_0xab7a('0x5b'),squel['select']()[_0xab7a('0x14')]('MIN(id)',_0xab7a('0x5c'))['from'](_0xafeb36)[_0xab7a('0x5d')](_0x14d6bd[_0xab7a('0x1a')](','))))[_0xab7a('0x47')]();}function handleStop(){logger[_0xab7a('0x5e')](_0xab7a('0x5f'));stopped=!![];}function handleUncaughtException(_0x13762f){logger[_0xab7a('0x25')](_0x13762f[_0xab7a('0x26')]);process[_0xab7a('0x60')](0x1);}function handleError(_0x47ba3a,_0x52a943){stats['errors'][_0xab7a('0x22')]({'name':_0x52a943[_0xab7a('0x61')],'message':_0x52a943['message'],'row':_0x47ba3a});}function handleQuery(_0x8213bb){logger[_0xab7a('0x5e')](_0x8213bb);return db[_0xab7a('0x1b')][_0xab7a('0x1c')](_0x8213bb)[_0xab7a('0x1e')](function(_0x107677){results[_0xab7a('0x22')](_0x107677);})['catch'](function(_0x4c84ff){logger[_0xab7a('0x25')](_0x4c84ff[_0xab7a('0x26')]);});}function main(_0x2f6789,_0x33fe13,_0xcd280a,_0x5e9ab8){logger[_0xab7a('0x5e')](_0xab7a('0x62'),_0x2f6789,JSON[_0xab7a('0x63')](_0x33fe13));process[_0xab7a('0x64')](_0xab7a('0x65'));var _0x5a4976=_0x33fe13[_0xab7a('0x66')];var _0x582a0a=_[_0xab7a('0x67')](_0x5a4976);var _0x45010e=_0x33fe13[_0xab7a('0x68')];var _0x54307b=path['join'](config['root'],'server/files/tmp',_0x45010e+_0xab7a('0x69'));logger[_0xab7a('0x5e')]('body',_0x33fe13);db[_0xab7a('0x6a')][_0xab7a('0x6b')]({'raw':!![],'attributes':['id',_0xab7a('0x6c')]})[_0xab7a('0x27')](function(_0x24f63f){for(var _0x3c7421=0x0;_0x3c7421<_0x24f63f[_0xab7a('0x1f')];_0x3c7421++){if(_0x24f63f[_0x3c7421][_0xab7a('0x6c')]in _0x5a4976){contactItemTypes[_0xab7a('0x22')](_0x24f63f[_0x3c7421]);delete _0x582a0a[_0x24f63f[_0x3c7421][_0xab7a('0x6c')]];hasAdditionalPhones=!![];}for(var _0x4cf3fc in _0x5a4976){if(_0x24f63f[_0x3c7421][_0xab7a('0x6c')]+_0xab7a('0x6d')===_0x4cf3fc){phoneDescriptions[_0xab7a('0x22')]({'itemTypeId':_0x24f63f[_0x3c7421]['id'],'description':_0x4cf3fc});delete _0x582a0a[_0x4cf3fc];}}}if(hasAdditionalPhones)_0x582a0a[_0xab7a('0x21')]='';var _0x3c3fe5=_['keys'](_0x582a0a)[_0xab7a('0x1a')]();logger[_0xab7a('0x5e')](_0xab7a('0x6e'),_0x3c3fe5);fs['writeFileSync'](_0x54307b,_0x3c3fe5+'\x0a');Papa['parse'](fs[_0xab7a('0x6f')](_0x2f6789),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4cc81a,_0x26282e){try{for(var _0x5d2fb1=0x0,_0x143d9c=[];_0x5d2fb1<_0x4cc81a[_0xab7a('0x70')][_0xab7a('0x1f')];_0x5d2fb1++){stats[_0xab7a('0x71')]+=0x1;if(_0x4cc81a[_0xab7a('0x72')][_0x5d2fb1]){handleError(_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1],_0x4cc81a[_0xab7a('0x72')][_0x5d2fb1]);}else{var _0x4e3431=[];var _0x5267b7=[];var _0x4022e7={};for(var _0x258a04 in _0x5a4976){let _0x1e266d=contactItemTypes['find'](_0x2c54c3=>_0x2c54c3['name']===_0x258a04);let _0x443bff=contactItemTypes[_0xab7a('0x73')](_0x3dd4fc=>_0x3dd4fc[_0xab7a('0x6c')]+_0xab7a('0x6d')===_0x258a04);if(_[_0xab7a('0x20')](_0x1e266d)&&_[_0xab7a('0x20')](_0x443bff)){if(_0x5a4976[_0xab7a('0x74')](_0x258a04)){if(_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1][_0x5a4976[_0x258a04]]){var _0x4e186b=_[_0xab7a('0x75')](_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1][_0x5a4976[_0x258a04]][_0xab7a('0x76')](/"/g,'\x27'));switch(_0x258a04){case'scheduledat':var _0xfbebd7=moment(_0x4e186b,_0xab7a('0xe'),!![]);if(_0xfbebd7[_0xab7a('0x77')]()){_0x143d9c[_0xab7a('0x22')]('\x22'+_0x4e186b+'\x22');}else{_0x4e3431[_0xab7a('0x22')](_0xab7a('0x78'));}break;case _0xab7a('0x3d'):var _0x2925dc=parseInt(_0x4e186b);_0x4e186b=_[_0xab7a('0x79')](_0x2925dc)||_0x2925dc<0x0||_0x2925dc>0x4?_0x5e9ab8?0x3:0x2:_0x2925dc;_0x143d9c[_0xab7a('0x22')]('\x22'+_0x4e186b+'\x22');break;case _0xab7a('0x3e'):var _0x3667d2=parseInt(_0x4e186b);if(_[_0xab7a('0x7a')](_0x3667d2)&&_[_0xab7a('0x7b')](_0xcd280a,_0x3667d2)){_0x143d9c['push']('\x22'+_0x3667d2+'\x22');}else{_0x4e3431['push'](_0xab7a('0x7c'));}break;case _0xab7a('0x7d'):if(isEmail(_0x4e186b)){_0x143d9c['push']('\x22'+_0x4e186b+'\x22');}else{_0x4e3431[_0xab7a('0x22')]('email\x20wrong\x20format');}break;case _0xab7a('0x7e'):var _0x4bd04c=moment(_0x4e186b,_0xab7a('0x7f'),!![]);if(_0x4bd04c[_0xab7a('0x77')]()){_0x143d9c[_0xab7a('0x22')]('\x22'+_0x4e186b+'\x22');}else{_0x4e3431[_0xab7a('0x22')](_0xab7a('0x80'));}break;default:_0x143d9c[_0xab7a('0x22')]('\x22'+_0x4e186b+'\x22');}}else{switch(_0x258a04){case _0xab7a('0x81'):case _0xab7a('0x15'):_0x4e3431['push'](_0x258a04+_0xab7a('0x82'));break;default:_0x143d9c[_0xab7a('0x22')]('\x22\x22');}}}}else{var _0x4cf026='';if(!_[_0xab7a('0x20')](_0x1e266d)){if(!_0x4022e7[_0xab7a('0x74')](_0x1e266d['id'])){for(var _0x58c64d=0x0;_0x58c64d<_0x5a4976[_0x258a04][_0xab7a('0x1f')];_0x58c64d++){var _0x4e186b=_[_0xab7a('0x75')](_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1][_0x5a4976[_0x258a04][_0x58c64d]]['replace'](/"/g,'\x27'));var _0x51364b=phoneDescriptions['find'](_0x3e3b6e=>_0x3e3b6e[_0xab7a('0x83')]===_0x1e266d['id']);if(!_[_0xab7a('0x20')](_0x51364b)){var _0x536376=_['trim'](_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1][_0x5a4976[_0x51364b[_0xab7a('0x84')]][0x0]][_0xab7a('0x76')](/"/g,'\x27'));if(!_['isNil'](_0x536376))_0x4e186b=_0x4e186b+'§'+_0x536376;}if(_0x4cf026=='')_0x4cf026=_0x4e186b;else _0x4cf026+='|'+_0x4e186b;}_0x5267b7[_0xab7a('0x22')](_0x1e266d['id']+':'+_0x4cf026);_0x4022e7[_0x1e266d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x143d9c[_0xab7a('0x22')]('\x22'+_0x5267b7['join'](';')+'\x22');}if(_0x4e3431['length']){handleError(_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1],{'code':_0xab7a('0x85'),'message':_0x4e3431[_0xab7a('0x1a')]()});}else{fs[_0xab7a('0x86')](_0x54307b,_0x143d9c[_0xab7a('0x1a')]()+'\x0a');}_0x143d9c=[];}if(!(stats[_0xab7a('0x71')]%0xc8)){socket[_0xab7a('0x87')](_0xab7a('0x88')+_0x45010e,stats);stats[_0xab7a('0x72')]=[];}}if(stopped){logger[_0xab7a('0x5e')](_0xab7a('0x89'));_0x26282e[_0xab7a('0x8a')]();}}catch(_0x20f378){handleError(_0x4cc81a[_0xab7a('0x70')][_0x5d2fb1],{'code':_0xab7a('0x8b'),'message':_0x20f378[_0xab7a('0x26')]});logger[_0xab7a('0x25')](_0xab7a('0x8c'),_0x20f378[_0xab7a('0x26')]);}},'complete':function(){try{var _0xd485af=[];var _0x23976c=tempTableName;_0xd485af[_0xab7a('0x22')](_0xab7a('0x8d')+_0x23976c+_0xab7a('0x8e'));logger[_0xab7a('0x5e')](_0xab7a('0x8f'),contactItemTypes[_0xab7a('0x1f')]);var _0x2d496c=util[_0xab7a('0x10')](_0xab7a('0x90'),_0x54307b,_0x23976c,_0x3c3fe5,_0x33fe13['ListId'],_0x33fe13[_0xab7a('0x58')]||null,NOW,NOW);if(_['isNil'](_0x5a4976[_0xab7a('0x3a')])){_0x2d496c+=_0xab7a('0x91');}_0xd485af[_0xab7a('0x22')](_0x2d496c);BPromise[_0xab7a('0x92')](_0xd485af,handleQuery)[_0xab7a('0x27')](function(_0x41e4a7){BPromise[_0xab7a('0x23')]([handleAdditionalPhones()])['then'](function(){_0xd485af=[];for(var _0x50f918=0x0;_0x50f918\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','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','limit','offset','Setting','enableEmailPreview','all','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','field','name','color','from','tools_tags','user_has_','_interactions','u.id','ui.'];(function(_0x2926f0,_0x1d78f3){var _0x5cc712=function(_0x3f925b){while(--_0x3f925b){_0x2926f0['push'](_0x2926f0['shift']());}};_0x5cc712(++_0x1d78f3);}(_0x27c2,0x1c0));var _0x227c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27c2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x227c('0x0'));var squel=require(_0x227c('0x1'));var as=require(_0x227c('0x2'));var qs=require(_0x227c('0x3'));var updateInteraction=require(_0x227c('0x4'))[_0x227c('0x5')];var utils=require(_0x227c('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x656478,_0x1c0546,_0x82715f){var _0x4df048=![];var _0x41252a=utils[_0x227c('0x7')](_0x656478);if(_0x1c0546[_0x227c('0x8')]===_0x227c('0x9')&&!_0x82715f[_0x227c('0xa')]&&!_0x82715f[_0x41252a]){_0x4df048=!![];}return _0x4df048;}function getTagsQuery(){return squel['select']()['field']('id')[_0x227c('0xb')](_0x227c('0xc'))[_0x227c('0xb')](_0x227c('0xd'))[_0x227c('0xe')](_0x227c('0xf'));}function getUsersQuery(_0x46a0ea,_0x3741b6){var _0x49aa88=utils['getInteractionFK'](_0x46a0ea);var _0x1ad50c=_0x227c('0x10')+_0x46a0ea+_0x227c('0x11');var _0x49a146=squel['select']()[_0x227c('0xb')](_0x227c('0x12'))[_0x227c('0xb')]('u.fullname')[_0x227c('0xb')](_0x227c('0x13')+_0x49aa88)['from'](_0x1ad50c,'ui')[_0x227c('0x14')](_0x227c('0x15'),'u',_0x227c('0x16'));if(_0x3741b6[_0x227c('0x17')]>0x0){_0x49a146['where']('ui.'+_0x49aa88+_0x227c('0x18'),_[_0x227c('0x19')](_0x3741b6,'id'));}return _0x49a146;}function getInteractionsQuery(_0x3a369f){var _0x43f440=utils['getInteractionsTables'](_0x3a369f);var _0x5ac322=utils[_0x227c('0x7')](_0x3a369f);var _0x418e76=utils['getInteractionFK'](_0x3a369f);return squel['select']()[_0x227c('0xe')](_0x43f440[_0x227c('0x1a')],'i')[_0x227c('0x14')](_0x227c('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x227c('0x14')](_0x227c('0x15'),'o',_0x227c('0x1c'))['left_join'](_0x43f440['accounts'],'a',_0x227c('0x1d')+_0x5ac322)[_0x227c('0x14')](_0x43f440[_0x227c('0x1e')],'me',_0x227c('0x1f')+_0x418e76+'\x20=\x20i.id')['left_join'](_0x43f440[_0x227c('0x20')],'it','it.'+_0x418e76+_0x227c('0x21'))['left_join'](_0x227c('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x143865={'body':squel[_0x227c('0x22')](),'contact':squel[_0x227c('0x22')](),'default':squel[_0x227c('0x22')](),'fields':squel['expr'](),'filter':squel[_0x227c('0x22')](),'read':squel[_0x227c('0x22')](),'tags':{'clause':squel[_0x227c('0x22')](),'ids':null},'user':squel[_0x227c('0x22')]()};return _0x143865;}function parseTagParameter(_0x1cc4f2){var _0x81fd54=squel[_0x227c('0x22')]();if(_0x1cc4f2){var _0x24d8fe=utils[_0x227c('0x23')](_0x1cc4f2);_0x24d8fe[_0x227c('0x24')](function(_0x10f0cd){_0x81fd54['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10f0cd+',%');});}return _0x81fd54;}function parseReadParameter(_0x30aa7b){var _0xdb8fea='';if(_0x30aa7b){_0xdb8fea='unreadMessages\x20{OPERATOR}\x200';if(_0x30aa7b==='1'){_0xdb8fea=_0xdb8fea[_0x227c('0x25')](_0x227c('0x26'),'=');}else{_0xdb8fea=_0xdb8fea[_0x227c('0x25')](_0x227c('0x26'),'>');}}return _0xdb8fea;}function parseSearchFilter(_0x29b70b,_0x47157b){var _0x2d74de=squel[_0x227c('0x22')]();if(_0x47157b){var _0x4e0f20=_0x47157b[_0x227c('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4e0f20)){_0x2d74de['or'](_0x227c('0x27'),_0x4e0f20+'%');if([_0x227c('0x28'),'whatsapp'][_0x227c('0x29')](_0x29b70b)){_0x2d74de['or'](_0x227c('0x2a'),_0x4e0f20+'%');}else if(_0x29b70b===_0x227c('0x2b')){_0x2d74de['or'](_0x227c('0x2c'),_0x4e0f20+'%');}else if(_0x29b70b===_0x227c('0x2d')){_0x2d74de['or'](_0x227c('0x2e'),_0x4e0f20+'%');}}else if(_0x29b70b==='mail'&&qs[_0x227c('0x2f')](_0x4e0f20)){_0x2d74de['or'](_0x227c('0x30'),_0x4e0f20+'%');}else{if(_0x29b70b==='mail'){_0x2d74de['or'](_0x227c('0x31'),qs[_0x227c('0x32')](_0x4e0f20,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4e0f20));}else if(_0x29b70b!=='fax'){_0x2d74de['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4e0f20));}_0x2d74de['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x227c('0x32')](_0x4e0f20,!![]),null);}}return _0x2d74de;}function parseAdvancedSearchFilter(_0x1a4f0c,_0x5376f8){var _0xc559e3=getSqlClauses();var _0x391e8c=as[_0x227c('0x33')](_0x1a4f0c);var _0x4f9515=_0x391e8c['sqlOperator'];for(var _0x462fcc=0x0;_0x462fcc<_0x391e8c[_0x227c('0x34')][_0x227c('0x17')];_0x462fcc++){var _0x52973d=_0x391e8c[_0x227c('0x34')][_0x462fcc];var _0x51f365='i';var _0x53cbe7=_[_0x227c('0x35')](_0x5376f8,[_0x227c('0xc'),_0x52973d[_0x227c('0xb')]]);if(_0x53cbe7){var _0x5be2d4=as['buildExpression'](_0x51f365,_0x53cbe7[_0x227c('0x36')],_0x52973d);_0xc559e3[_0x227c('0x37')][_0x4f9515](_0x5be2d4['text'],_0x5be2d4['value'][_0x227c('0x38')],_0x5be2d4[_0x227c('0x39')][_0x227c('0x3a')]);}else{switch(_0x52973d[_0x227c('0xb')]){case _0x227c('0x3b'):var _0x5691a0=parseReadParameter(_0x52973d[_0x227c('0x39')]);_0xc559e3['read'][_0x227c('0x3c')](_0x5691a0);break;case _0x227c('0x3d'):if(_0x52973d[_0x227c('0x3e')]===_0x227c('0x3f')){if(_0x52973d[_0x227c('0x39')]['split']('\x20')['length']>0x1){_0xc559e3[_0x227c('0x40')][_0x4f9515](_0x227c('0x41'),qs[_0x227c('0x32')](_0x52973d[_0x227c('0x39')],!![]),null);}else{var _0x480e7f='%'+_0x52973d[_0x227c('0x39')]+'%';_0xc559e3[_0x227c('0x40')][_0x4f9515](_0x227c('0x42'),_0x480e7f,_0x480e7f,_0x480e7f);}}else{_0x53cbe7=_['find'](_0x5376f8,[_0x227c('0xc'),_0x227c('0x43')]);_0x52973d['field']=_0x227c('0x43');_0x5be2d4=as[_0x227c('0x44')](_0x51f365,_0x53cbe7['type'],_0x52973d);_0xc559e3[_0x227c('0x40')][_0x4f9515](_0x5be2d4[_0x227c('0x45')],_0x5be2d4[_0x227c('0x39')]['start'],_0x5be2d4[_0x227c('0x39')]['end']);}break;case'Tag':var _0x8a2cf5=_0x52973d[_0x227c('0x39')][_0x227c('0x46')](',')[_0x227c('0x19')](function(_0x1681cd){return Number(_0x1681cd);});var _0x2cfa5f=parseTagParameter(_0x8a2cf5);_0xc559e3[_0x227c('0x47')]['clause']['and'](_0x2cfa5f);_0xc559e3[_0x227c('0x47')][_0x227c('0x48')]=_0x8a2cf5;break;case _0x227c('0x49'):if(_0x52973d[_0x227c('0x3e')]===_0x227c('0x3f')){_0xc559e3['user'][_0x4f9515]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x52973d[_0x227c('0x39')]+'%',null);}else{_0x53cbe7=_[_0x227c('0x35')](_0x5376f8,[_0x227c('0xc'),_0x227c('0x4a')]);_0x52973d[_0x227c('0xb')]=_0x227c('0x4a');_0x5be2d4=as[_0x227c('0x44')](_0x51f365,_0x53cbe7['type'],_0x52973d);_0xc559e3[_0x227c('0x4b')][_0x4f9515](_0x5be2d4[_0x227c('0x45')],_0x5be2d4[_0x227c('0x39')][_0x227c('0x38')],_0x5be2d4['value'][_0x227c('0x3a')]);}break;case'body':case _0x227c('0x4c'):_0x5be2d4=as[_0x227c('0x44')]('me',null,_0x52973d);_0xc559e3[_0x227c('0x4d')][_0x4f9515](_0x5be2d4[_0x227c('0x45')],_0x5be2d4[_0x227c('0x39')][_0x227c('0x38')],_0x5be2d4[_0x227c('0x39')][_0x227c('0x3a')]);break;}}}return _0xc559e3;}function parseModelFields(_0x861f25,_0x58b3d3,_0xa38a5d){var _0xb92d6d=utils[_0x227c('0x7')](_0x861f25);var _0x5e4db3=squel[_0x227c('0x22')]();var _0x433f13=_(_0x58b3d3)[_0x227c('0x4e')]()[_0x227c('0x19')](function(_0x473a6b){return _[_0x227c('0x4f')](_0xa38a5d,[_0x227c('0xc'),_0x473a6b])?_0x473a6b:undefined;})[_0x227c('0x50')]()['value']();if(_0x433f13['length']>0x0){_0x433f13[_0x227c('0x24')](function(_0x5ecb06){if(_0x5ecb06===_0xb92d6d){_0x5e4db3[_0x227c('0x3c')]('i.'+_0xb92d6d+_0x227c('0x18'),[][_0x227c('0x51')](_0x58b3d3[_0x5ecb06]));}else if(_0x5ecb06==='createdAt'){var _0x2e725e=JSON['parse'](_0x58b3d3[_0x5ecb06])[_0x227c('0x52')];var _0x1e88c9=JSON[_0x227c('0x53')](_0x58b3d3[_0x5ecb06])[_0x227c('0x54')];_0x5e4db3[_0x227c('0x3c')](_0x227c('0x55'),_0x2e725e,_0x1e88c9);}else{if(_0x58b3d3[_0x5ecb06]===_0x227c('0x56')){_0x5e4db3[_0x227c('0x3c')]('i.'+_0x5ecb06+_0x227c('0x57'));}else{_0x5e4db3[_0x227c('0x3c')]('i.'+_0x5ecb06+_0x227c('0x58'),_0x58b3d3[_0x5ecb06]);}}});}return _0x5e4db3;}function parseQueryParameters(_0x5e6889,_0x1bf4da,_0x51eee0){var _0x353d4d=getSqlClauses();return Promise[_0x227c('0x59')]()[_0x227c('0x5a')](function(){return parseModelFields(_0x5e6889,_0x1bf4da,_0x51eee0);})[_0x227c('0x5a')](function(_0x20c0b9){_0x353d4d[_0x227c('0x5b')][_0x227c('0x3c')](_0x20c0b9);return parseReadParameter(_0x1bf4da['read']);})[_0x227c('0x5a')](function(_0x116102){_0x353d4d[_0x227c('0x5c')][_0x227c('0x3c')](_0x116102);return parseTagParameter(_0x1bf4da[_0x227c('0x5d')]);})[_0x227c('0x5a')](function(_0x104edf){_0x353d4d[_0x227c('0x47')][_0x227c('0x5e')]['and'](_0x104edf);return parseSearchFilter(_0x5e6889,_0x1bf4da[_0x227c('0x5f')]);})[_0x227c('0x5a')](function(_0x51bc85){_0x353d4d['filter']=_0x51bc85;return _0x353d4d;});}function checkAccountsRestrictions(_0x476acb,_0x37cd55,_0x5b0e35){var _0x467ec9=utils[_0x227c('0x7')](_0x476acb);var _0x3b1a5d=_0x227c('0x60')+_[_0x227c('0x61')](_0x476acb)+(_0x476acb===_0x227c('0x62')?_0x227c('0x63'):'Accounts');var _0x203e7c=squel[_0x227c('0x22')]();return Promise[_0x227c('0x59')]()[_0x227c('0x5a')](function(){if(_0x5b0e35[_0x227c('0xa')]&&_0x37cd55[_0x227c('0x8')]===_0x227c('0x9')){return _0x37cd55[_0x3b1a5d]({'attributes':['id'],'raw':!![]});}})[_0x227c('0x5a')](function(_0x558f01){if(_0x558f01){if(_0x558f01[_0x227c('0x17')]===0x0){_0x203e7c[_0x227c('0x3c')]('i.'+_0x467ec9+_0x227c('0x57'));}else{_0x203e7c[_0x227c('0x3c')]('i.'+_0x467ec9+_0x227c('0x18'),_[_0x227c('0x19')](_0x558f01,'id'));}}else if(!_0x5b0e35[_0x467ec9]){_0x203e7c[_0x227c('0x3c')]('i.'+_0x467ec9+_0x227c('0x64'));}})[_0x227c('0x5a')](function(){return _0x203e7c;});}function getClosedOrderClause(_0x14c18c,_0xfb4aae){var _0x395a18='';var _0x5912d9=[_0x227c('0x65'),_0x227c('0x66'),'i.disposition'];if(_0x14c18c===_0x227c('0x67')){_0x5912d9['unshift'](_0x227c('0x68'));}if(_0xfb4aae[_0x227c('0x69')]==='0'&&_0x14c18c===_0x227c('0x67')){_0x395a18=_0x227c('0x68');}else{if(_0xfb4aae[_0x227c('0x69')]==='1'){_0x5912d9[_0x227c('0x6a')]();}_0x395a18='CONCAT_WS(\x27\x27,\x20'+_0x5912d9[_0x227c('0x6b')](',\x20')+')';}return _0x395a18;}function getFilteredInteractions(_0x4d73dc,_0x149930,_0x57cafe,_0x2563ee){var _0x2c78da=utils[_0x227c('0x6c')](_0x4d73dc);var _0x5a187a=_[_0x227c('0x61')](_0x4d73dc)+_0x227c('0x6d');var _0x39f540=[];var _0xc40388=getTagsQuery();var _0x4bb86f={'type':db[_0x227c('0x6e')][_0x227c('0x6f')][_0x227c('0x70')],'raw':!![]};var _0x49d2b1=[];var _0x362401=[];return db[_0x227c('0x71')][_0x227c('0x72')](_0xc40388[_0x227c('0x73')](),_0x4bb86f)[_0x227c('0x5a')](function(_0x460e3e){_0x39f540=_[_0x227c('0x74')](_0x460e3e,'id');_0x4bb86f=_[_0x227c('0x75')](_0x4bb86f,{'model':db[_0x5a187a],'mapToModel':!![],'nest':!![]});if(_0x57cafe['fields']){_0x2563ee['attributes'][_0x227c('0x24')](function(_0x569289){_0x149930[_0x227c('0xb')]('i.'+_0x569289);});}else{_0x149930[_0x227c('0xb')](_0x227c('0x76'),_0x227c('0x3b'));_0x149930[_0x227c('0xb')]('a.key',_0x227c('0x77'));_0x149930['field'](_0x227c('0x78'),_0x227c('0x79'));if(_0x4d73dc===_0x227c('0x67')){_0x149930[_0x227c('0xb')](_0x227c('0x7a'),_0x227c('0x7b'));_0x149930[_0x227c('0xb')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x149930[_0x227c('0xb')](_0x227c('0x7c'));_0x149930[_0x227c('0xb')](_0x227c('0x7d'));_0x149930[_0x227c('0xb')]('i.updatedAt');_0x149930['field'](_0x227c('0x7e'));_0x149930[_0x227c('0xb')](_0x227c('0x7f'));_0x149930['field'](_0x227c('0x80'));_0x149930['field']('i.lastMsgAt');_0x149930['field']('i.lastMsgDirection');_0x149930[_0x227c('0xb')](_0x227c('0x81'));_0x149930[_0x227c('0xb')]('i.disposition');_0x149930[_0x227c('0xb')](_0x227c('0x66'));_0x149930[_0x227c('0xb')](_0x227c('0x65'));_0x149930[_0x227c('0xb')](_0x227c('0x68'));_0x149930['field'](_0x227c('0x82'));_0x149930[_0x227c('0xb')](_0x227c('0x83'));_0x149930[_0x227c('0xb')]('i.MailAccountId');_0x149930[_0x227c('0xb')]('i.UserId');}else if(_0x4d73dc===_0x227c('0x2d')){_0x149930[_0x227c('0xb')](_0x227c('0x84'),_0x227c('0x85'));}else{_0x149930[_0x227c('0xb')](_0x227c('0x86'),_0x227c('0x85'));}if(_0x4d73dc!==_0x227c('0x67')){_0x149930[_0x227c('0xb')](_0x227c('0x87'));}_0x149930[_0x227c('0xb')]('c.firstName',_0x227c('0x88'));_0x149930[_0x227c('0xb')]('c.lastName','Contact.lastName');_0x149930['field']('c.email','Contact.email');_0x149930[_0x227c('0xb')](_0x227c('0x89'),_0x227c('0x8a'));_0x149930['field']('c.mobile',_0x227c('0x8b'));_0x149930['field'](_0x227c('0x8c'),_0x227c('0x8d'));_0x149930[_0x227c('0xb')]('o.fullname',_0x227c('0x8e'));_0x149930['field'](_0x227c('0x8f'),_0x227c('0x90'));_0x149930['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x2563ee[_0x227c('0x91')]){_0x149930[_0x227c('0x91')](_0x2563ee[_0x227c('0x91')]);}if(_0x2563ee[_0x227c('0x92')]){_0x149930['offset'](_0x2563ee['offset']);}return db[_0x227c('0x71')][_0x227c('0x72')](_0x149930[_0x227c('0x73')](),_0x4bb86f);})['then'](function(_0x27ce67){_0x49d2b1=_0x27ce67;var _0x1b4274=getUsersQuery(_0x4d73dc,_0x49d2b1);return db['sequelize'][_0x227c('0x72')](_0x1b4274['toString'](),_0x4bb86f);})[_0x227c('0x5a')](function(_0x2338a5){_0x362401=_['groupBy'](_0x2338a5,_0x2c78da);if(_0x4d73dc===_0x227c('0x67')){return db[_0x227c('0x93')]['findOne']({'attributes':[_0x227c('0x94')],'raw':!![]});}})[_0x227c('0x5a')](function(_0x3a30a0){var _0x22bb81=_0x3a30a0?_0x3a30a0[_0x227c('0x94')]:undefined;var _0x2bb7fa=_0x49d2b1[_0x227c('0x19')](function(_0xe22c8b){return updateInteraction(_0xe22c8b,_0x39f540,_0x362401,_0x22bb81);});return Promise[_0x227c('0x95')](_0x2bb7fa);});}function countFilteredInteractions(_0x4717f1,_0x413102){var _0x463869=_0x4717f1[_0x227c('0x96')]();_0x463869[_0x227c('0xb')](_0x227c('0x97'));_0x463869['field'](_0x227c('0x76'),_0x227c('0x3b'));var _0x391162=utils[_0x227c('0x23')](_0x413102);if(!_[_0x227c('0x98')](_0x391162)){_0x463869[_0x227c('0x99')](_0x227c('0x9a'),_0x391162);}var _0x3044c4={'type':db[_0x227c('0x6e')][_0x227c('0x6f')][_0x227c('0x70')],'raw':!![]};return db[_0x227c('0x71')]['query'](_0x463869['toString'](),_0x3044c4);}module[_0x227c('0x9b')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x2f72=['limit','offset','Setting','enableEmailPreview','all','clone','COUNT(*)','t.id\x20IN\x20?','QueryTypes','exports','lodash','squel','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','color','from','tools_tags','getInteractionFK','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','where','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','type','default','value','start','end','unreadMessages','read','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','tags','clause','ids','User','UserId','user','body','plainBody','keys','some','compact','and','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','get','Accounts','search','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','capitalize','Interaction','Sequelize','SELECT','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.to','i.UserId','openchannel','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','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','Contact.email','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)'];(function(_0x587ff4,_0x551480){var _0xf123da=function(_0x52ef10){while(--_0x52ef10){_0x587ff4['push'](_0x587ff4['shift']());}};_0xf123da(++_0x551480);}(_0x2f72,0x14c));var _0x22f7=function(_0x16022c,_0x5508cb){_0x16022c=_0x16022c-0x0;var _0x2bbe54=_0x2f72[_0x16022c];return _0x2bbe54;};'use strict';var _=require(_0x22f7('0x0'));var squel=require(_0x22f7('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x22f7('0x2'));var updateInteraction=require('./update-interaction')[_0x22f7('0x3')];var utils=require(_0x22f7('0x4'));var db=require(_0x22f7('0x5'))['db'];function skipInteractionsQuery(_0xc4c9b7,_0x27ed4b,_0x4a4791){var _0x3435ed=![];var _0x644c8f=utils[_0x22f7('0x6')](_0xc4c9b7);if(_0x27ed4b[_0x22f7('0x7')]===_0x22f7('0x8')&&!_0x4a4791['search']&&!_0x4a4791[_0x644c8f]){_0x3435ed=!![];}return _0x3435ed;}function getTagsQuery(){return squel[_0x22f7('0x9')]()['field']('id')[_0x22f7('0xa')](_0x22f7('0xb'))[_0x22f7('0xa')](_0x22f7('0xc'))[_0x22f7('0xd')](_0x22f7('0xe'));}function getUsersQuery(_0x29c749,_0x14b1ab){var _0x4984d9=utils[_0x22f7('0xf')](_0x29c749);var _0x911325='user_has_'+_0x29c749+'_interactions';var _0x3f4646=squel['select']()['field'](_0x22f7('0x10'))['field'](_0x22f7('0x11'))[_0x22f7('0xa')](_0x22f7('0x12')+_0x4984d9)['from'](_0x911325,'ui')[_0x22f7('0x13')]('users','u',_0x22f7('0x14'));if(_0x14b1ab['length']>0x0){_0x3f4646[_0x22f7('0x15')](_0x22f7('0x12')+_0x4984d9+'\x20IN\x20?',_[_0x22f7('0x16')](_0x14b1ab,'id'));}return _0x3f4646;}function getInteractionsQuery(_0x4c4738){var _0x4e5e47=utils[_0x22f7('0x17')](_0x4c4738);var _0x4a3203=utils[_0x22f7('0x6')](_0x4c4738);var _0xc7700=utils['getInteractionFK'](_0x4c4738);return squel[_0x22f7('0x9')]()[_0x22f7('0xd')](_0x4e5e47[_0x22f7('0x18')],'i')[_0x22f7('0x13')](_0x22f7('0x19'),'c',_0x22f7('0x1a'))[_0x22f7('0x13')]('users','o','o.id\x20=\x20i.UserId')[_0x22f7('0x13')](_0x4e5e47[_0x22f7('0x1b')],'a',_0x22f7('0x1c')+_0x4a3203)[_0x22f7('0x13')](_0x4e5e47['messages'],'me',_0x22f7('0x1d')+_0xc7700+_0x22f7('0x1e'))[_0x22f7('0x13')](_0x4e5e47[_0x22f7('0x1f')],'it',_0x22f7('0x20')+_0xc7700+'\x20=\x20i.id')[_0x22f7('0x13')](_0x22f7('0xe'),'t',_0x22f7('0x21'));}function getSqlClauses(){var _0x411620={'body':squel[_0x22f7('0x22')](),'contact':squel[_0x22f7('0x22')](),'default':squel[_0x22f7('0x22')](),'fields':squel[_0x22f7('0x22')](),'filter':squel[_0x22f7('0x22')](),'read':squel[_0x22f7('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x22f7('0x22')]()};return _0x411620;}function parseTagParameter(_0x4c2488){var _0x84825b=squel['expr']();if(_0x4c2488){var _0x14aa11=utils[_0x22f7('0x23')](_0x4c2488);_0x14aa11[_0x22f7('0x24')](function(_0x1b6e70){_0x84825b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b6e70+',%');});}return _0x84825b;}function parseReadParameter(_0x3fe4f3){var _0x2b6b83='';if(_0x3fe4f3){_0x2b6b83=_0x22f7('0x25');if(_0x3fe4f3==='1'){_0x2b6b83=_0x2b6b83[_0x22f7('0x26')](_0x22f7('0x27'),'=');}else{_0x2b6b83=_0x2b6b83[_0x22f7('0x26')](_0x22f7('0x27'),'>');}}return _0x2b6b83;}function parseSearchFilter(_0x2ff150,_0x485c68){var _0x12ded7=squel['expr']();if(_0x485c68){var _0x3fcb4c=_0x485c68['replace']('\x5c','\x5c\x5c')[_0x22f7('0x26')](/'/g,'\x27\x27');if(qs[_0x22f7('0x28')](_0x3fcb4c)){_0x12ded7['or']('i.id\x20LIKE\x20?',_0x3fcb4c+'%');if([_0x22f7('0x29'),'whatsapp'][_0x22f7('0x2a')](_0x2ff150)){_0x12ded7['or'](_0x22f7('0x2b'),_0x3fcb4c+'%');}else if(_0x2ff150===_0x22f7('0x2c')){_0x12ded7['or'](_0x22f7('0x2d'),_0x3fcb4c+'%');}else if(_0x2ff150==='openchannel'){_0x12ded7['or'](_0x22f7('0x2e'),_0x3fcb4c+'%');}}else if(_0x2ff150===_0x22f7('0x2f')&&qs[_0x22f7('0x30')](_0x3fcb4c)){_0x12ded7['or']('c.email\x20LIKE\x20?',_0x3fcb4c+'%');}else{if(_0x2ff150===_0x22f7('0x2f')){_0x12ded7['or'](_0x22f7('0x31'),qs['getFullTextValue'](_0x3fcb4c,!![]))['or'](_0x22f7('0x32'),qs[_0x22f7('0x33')](_0x3fcb4c));}else if(_0x2ff150!==_0x22f7('0x2c')){_0x12ded7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x22f7('0x33')](_0x3fcb4c));}_0x12ded7['or'](_0x22f7('0x34'),qs[_0x22f7('0x33')](_0x3fcb4c,!![]),null);}}return _0x12ded7;}function parseAdvancedSearchFilter(_0x38808b,_0x372642){var _0x345d13=getSqlClauses();var _0x296eec=as[_0x22f7('0x35')](_0x38808b);var _0xee6ebb=_0x296eec[_0x22f7('0x36')];for(var _0x269008=0x0;_0x269008<_0x296eec[_0x22f7('0x37')][_0x22f7('0x38')];_0x269008++){var _0x12c29e=_0x296eec['conditions'][_0x269008];var _0x3ce39b='i';var _0x1bfe3f=_['find'](_0x372642,[_0x22f7('0xb'),_0x12c29e[_0x22f7('0xa')]]);if(_0x1bfe3f){var _0x18c66c=as['buildExpression'](_0x3ce39b,_0x1bfe3f[_0x22f7('0x39')],_0x12c29e);_0x345d13[_0x22f7('0x3a')][_0xee6ebb](_0x18c66c['text'],_0x18c66c[_0x22f7('0x3b')][_0x22f7('0x3c')],_0x18c66c[_0x22f7('0x3b')][_0x22f7('0x3d')]);}else{switch(_0x12c29e[_0x22f7('0xa')]){case _0x22f7('0x3e'):var _0x430a6a=parseReadParameter(_0x12c29e[_0x22f7('0x3b')]);_0x345d13[_0x22f7('0x3f')]['and'](_0x430a6a);break;case'Contact':if(_0x12c29e[_0x22f7('0x40')]===_0x22f7('0x41')){if(_0x12c29e[_0x22f7('0x3b')][_0x22f7('0x42')]('\x20')['length']>0x1){_0x345d13[_0x22f7('0x43')][_0xee6ebb](_0x22f7('0x34'),qs[_0x22f7('0x33')](_0x12c29e['value'],!![]),null);}else{var _0x48ded7='%'+_0x12c29e[_0x22f7('0x3b')]+'%';_0x345d13[_0x22f7('0x43')][_0xee6ebb](_0x22f7('0x44'),_0x48ded7,_0x48ded7,_0x48ded7);}}else{_0x1bfe3f=_['find'](_0x372642,[_0x22f7('0xb'),_0x22f7('0x45')]);_0x12c29e[_0x22f7('0xa')]=_0x22f7('0x45');_0x18c66c=as[_0x22f7('0x46')](_0x3ce39b,_0x1bfe3f['type'],_0x12c29e);_0x345d13[_0x22f7('0x43')][_0xee6ebb](_0x18c66c[_0x22f7('0x47')],_0x18c66c[_0x22f7('0x3b')][_0x22f7('0x3c')],_0x18c66c['value'][_0x22f7('0x3d')]);}break;case _0x22f7('0x48'):var _0x237abe=_0x12c29e[_0x22f7('0x3b')][_0x22f7('0x42')](',')[_0x22f7('0x16')](function(_0x4e5251){return Number(_0x4e5251);});var _0x2a642d=parseTagParameter(_0x237abe);_0x345d13[_0x22f7('0x49')][_0x22f7('0x4a')]['and'](_0x2a642d);_0x345d13[_0x22f7('0x49')][_0x22f7('0x4b')]=_0x237abe;break;case _0x22f7('0x4c'):if(_0x12c29e['operator']==='$substring'){_0x345d13['user'][_0xee6ebb]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x12c29e[_0x22f7('0x3b')]+'%',null);}else{_0x1bfe3f=_['find'](_0x372642,[_0x22f7('0xb'),_0x22f7('0x4d')]);_0x12c29e[_0x22f7('0xa')]=_0x22f7('0x4d');_0x18c66c=as['buildExpression'](_0x3ce39b,_0x1bfe3f['type'],_0x12c29e);_0x345d13[_0x22f7('0x4e')][_0xee6ebb](_0x18c66c[_0x22f7('0x47')],_0x18c66c[_0x22f7('0x3b')][_0x22f7('0x3c')],_0x18c66c[_0x22f7('0x3b')][_0x22f7('0x3d')]);}break;case _0x22f7('0x4f'):case _0x22f7('0x50'):_0x18c66c=as['buildExpression']('me',null,_0x12c29e);_0x345d13['body'][_0xee6ebb](_0x18c66c[_0x22f7('0x47')],_0x18c66c['value']['start'],_0x18c66c['value']['end']);break;}}}return _0x345d13;}function parseModelFields(_0x20a615,_0x2a345f,_0x3a267e){var _0x28db0c=utils[_0x22f7('0x6')](_0x20a615);var _0x773262=squel[_0x22f7('0x22')]();var _0x47ff09=_(_0x2a345f)[_0x22f7('0x51')]()[_0x22f7('0x16')](function(_0x3c88dd){return _[_0x22f7('0x52')](_0x3a267e,[_0x22f7('0xb'),_0x3c88dd])?_0x3c88dd:undefined;})[_0x22f7('0x53')]()[_0x22f7('0x3b')]();if(_0x47ff09[_0x22f7('0x38')]>0x0){_0x47ff09['forEach'](function(_0x337505){if(_0x337505===_0x28db0c){_0x773262[_0x22f7('0x54')]('i.'+_0x28db0c+_0x22f7('0x55'),[][_0x22f7('0x56')](_0x2a345f[_0x337505]));}else if(_0x337505===_0x22f7('0x57')){var _0x48c491=JSON[_0x22f7('0x58')](_0x2a345f[_0x337505])[_0x22f7('0x59')];var _0x165dbf=JSON[_0x22f7('0x58')](_0x2a345f[_0x337505])[_0x22f7('0x5a')];_0x773262['and'](_0x22f7('0x5b'),_0x48c491,_0x165dbf);}else{if(_0x2a345f[_0x337505]==='null'){_0x773262[_0x22f7('0x54')]('i.'+_0x337505+_0x22f7('0x5c'));}else{_0x773262['and']('i.'+_0x337505+_0x22f7('0x5d'),_0x2a345f[_0x337505]);}}});}return _0x773262;}function parseQueryParameters(_0x496297,_0x3f916e,_0x3ab5e4){var _0x229e03=getSqlClauses();return Promise[_0x22f7('0x5e')]()[_0x22f7('0x5f')](function(){return parseModelFields(_0x496297,_0x3f916e,_0x3ab5e4);})[_0x22f7('0x5f')](function(_0x273a12){_0x229e03[_0x22f7('0x60')][_0x22f7('0x54')](_0x273a12);return parseReadParameter(_0x3f916e[_0x22f7('0x3f')]);})[_0x22f7('0x5f')](function(_0x3f5828){_0x229e03[_0x22f7('0x3f')][_0x22f7('0x54')](_0x3f5828);return parseTagParameter(_0x3f916e['tag']);})[_0x22f7('0x5f')](function(_0x2eee1e){_0x229e03[_0x22f7('0x49')]['clause'][_0x22f7('0x54')](_0x2eee1e);return parseSearchFilter(_0x496297,_0x3f916e[_0x22f7('0x61')]);})[_0x22f7('0x5f')](function(_0x484677){_0x229e03['filter']=_0x484677;return _0x229e03;});}function checkAccountsRestrictions(_0x69203b,_0x46d5f0,_0xce6ca9){var _0x19cb05=utils[_0x22f7('0x6')](_0x69203b);var _0x32b04a=_0x22f7('0x62')+_['capitalize'](_0x69203b)+(_0x69203b==='chat'?'Websites':_0x22f7('0x63'));var _0x394024=squel[_0x22f7('0x22')]();return Promise[_0x22f7('0x5e')]()[_0x22f7('0x5f')](function(){if(_0xce6ca9[_0x22f7('0x64')]&&_0x46d5f0['role']===_0x22f7('0x8')){return _0x46d5f0[_0x32b04a]({'attributes':['id'],'raw':!![]});}})[_0x22f7('0x5f')](function(_0x293268){if(_0x293268){if(_0x293268[_0x22f7('0x38')]===0x0){_0x394024[_0x22f7('0x54')]('i.'+_0x19cb05+'\x20IS\x20NULL');}else{_0x394024['and']('i.'+_0x19cb05+_0x22f7('0x55'),_[_0x22f7('0x16')](_0x293268,'id'));}}else if(!_0xce6ca9[_0x19cb05]){_0x394024[_0x22f7('0x54')]('i.'+_0x19cb05+'\x20IS\x20NOT\x20NULL');}})[_0x22f7('0x5f')](function(){return _0x394024;});}function getClosedOrderClause(_0x14e58b,_0x1c1948){var _0x522d63='';var _0x219f42=[_0x22f7('0x65'),_0x22f7('0x66'),_0x22f7('0x67')];if(_0x14e58b==='mail'){_0x219f42[_0x22f7('0x68')](_0x22f7('0x69'));}if(_0x1c1948[_0x22f7('0x6a')]==='0'&&_0x14e58b===_0x22f7('0x2f')){_0x522d63='i.substatus';}else{if(_0x1c1948[_0x22f7('0x6a')]==='1'){_0x219f42[_0x22f7('0x6b')]();}_0x522d63='CONCAT_WS(\x27\x27,\x20'+_0x219f42[_0x22f7('0x6c')](',\x20')+')';}return _0x522d63;}function getFilteredInteractions(_0x194ce7,_0x3fe1c3,_0x48b013,_0x5647a6){var _0x443026=utils[_0x22f7('0xf')](_0x194ce7);var _0x4a801e=_[_0x22f7('0x6d')](_0x194ce7)+_0x22f7('0x6e');var _0x3964c1=[];var _0x4fbb42=getTagsQuery();var _0x2ea79f={'type':db[_0x22f7('0x6f')]['QueryTypes'][_0x22f7('0x70')],'raw':!![]};var _0xbb99bd=[];var _0x2b3817=[];return db[_0x22f7('0x71')][_0x22f7('0x72')](_0x4fbb42[_0x22f7('0x73')](),_0x2ea79f)[_0x22f7('0x5f')](function(_0x22111f){_0x3964c1=_[_0x22f7('0x74')](_0x22111f,'id');_0x2ea79f=_[_0x22f7('0x75')](_0x2ea79f,{'model':db[_0x4a801e],'mapToModel':!![],'nest':!![]});if(_0x48b013[_0x22f7('0x60')]){_0x5647a6[_0x22f7('0x76')][_0x22f7('0x24')](function(_0x32937f){_0x3fe1c3[_0x22f7('0xa')]('i.'+_0x32937f);});}else{_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x77'),_0x22f7('0x3e'));_0x3fe1c3['field'](_0x22f7('0x78'),'Account.key');_0x3fe1c3[_0x22f7('0xa')]('a.mandatoryDisposition',_0x22f7('0x79'));if(_0x194ce7==='mail'){_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x7a'),_0x22f7('0x7b'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x7c'),_0x22f7('0x7d'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x7e'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x7f'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x80'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x81'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x82'));_0x3fe1c3['field'](_0x22f7('0x83'));_0x3fe1c3['field']('i.lastMsgAt');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x84'));_0x3fe1c3['field'](_0x22f7('0x85'));_0x3fe1c3[_0x22f7('0xa')]('i.disposition');_0x3fe1c3[_0x22f7('0xa')]('i.secondDisposition');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x65'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x69'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x86'));_0x3fe1c3[_0x22f7('0xa')]('i.ContactId');_0x3fe1c3['field']('i.MailAccountId');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x87'));}else if(_0x194ce7===_0x22f7('0x88')){_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x89'),'contactName');}else{_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x8a'),_0x22f7('0x7d'));}if(_0x194ce7!==_0x22f7('0x2f')){_0x3fe1c3['field'](_0x22f7('0x8b'));}_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x8c'),_0x22f7('0x8d'));_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x8e'),_0x22f7('0x8f'));_0x3fe1c3[_0x22f7('0xa')]('c.email',_0x22f7('0x90'));_0x3fe1c3['field']('c.phone','Contact.phone');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x91'),'Contact.mobile');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x92'),_0x22f7('0x93'));_0x3fe1c3['field'](_0x22f7('0x94'),_0x22f7('0x95'));_0x3fe1c3[_0x22f7('0xa')]('o.internal','Owner.internal');_0x3fe1c3[_0x22f7('0xa')](_0x22f7('0x96'),'TagIds');}if(_0x5647a6[_0x22f7('0x97')]){_0x3fe1c3[_0x22f7('0x97')](_0x5647a6['limit']);}if(_0x5647a6[_0x22f7('0x98')]){_0x3fe1c3[_0x22f7('0x98')](_0x5647a6['offset']);}return db['sequelize'][_0x22f7('0x72')](_0x3fe1c3['toString'](),_0x2ea79f);})[_0x22f7('0x5f')](function(_0x44c183){_0xbb99bd=_0x44c183;var _0x139e09=getUsersQuery(_0x194ce7,_0xbb99bd);return db[_0x22f7('0x71')][_0x22f7('0x72')](_0x139e09['toString'](),_0x2ea79f);})[_0x22f7('0x5f')](function(_0x3582b4){_0x2b3817=_['groupBy'](_0x3582b4,_0x443026);if(_0x194ce7===_0x22f7('0x2f')){return db[_0x22f7('0x99')]['findOne']({'attributes':[_0x22f7('0x9a')],'raw':!![]});}})[_0x22f7('0x5f')](function(_0x176589){var _0x555a97=_0x176589?_0x176589[_0x22f7('0x9a')]:undefined;var _0x2216b1=_0xbb99bd[_0x22f7('0x16')](function(_0x268558){return updateInteraction(_0x268558,_0x3964c1,_0x2b3817,_0x555a97);});return Promise[_0x22f7('0x9b')](_0x2216b1);});}function countFilteredInteractions(_0x264e4f,_0x42df7f){var _0xe7ccf1=_0x264e4f[_0x22f7('0x9c')]();_0xe7ccf1[_0x22f7('0xa')](_0x22f7('0x9d'));_0xe7ccf1[_0x22f7('0xa')](_0x22f7('0x77'),'unreadMessages');var _0x5e232e=utils[_0x22f7('0x23')](_0x42df7f);if(!_['isEmpty'](_0x5e232e)){_0xe7ccf1[_0x22f7('0x15')](_0x22f7('0x9e'),_0x5e232e);}var _0x5ec319={'type':db[_0x22f7('0x6f')][_0x22f7('0x9f')][_0x22f7('0x70')],'raw':!![]};return db[_0x22f7('0x71')]['query'](_0xe7ccf1[_0x22f7('0x73')](),_0x5ec319);}module[_0x22f7('0xa0')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 176d683..e0a7178 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x394d=['split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','plainBody','-id','then','lastMsgText','trimStart','updateInteraction','TagIds','Tags','catch','../../mysqldb','map'];(function(_0x4c0165,_0x4e5fc7){var _0x10359d=function(_0x1bfc5f){while(--_0x1bfc5f){_0x4c0165['push'](_0x4c0165['shift']());}};_0x10359d(++_0x4e5fc7);}(_0x394d,0x1f2));var _0xd394=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x394d[_0x42bdad];return _0x122626;};'use strict';var _=require('lodash');var db=require(_0xd394('0x0'))['db'];function getInteractionUsers(_0x1777ca,_0x3d359b){return new Promise(function(_0x47a7b5,_0x1caa98){try{var _0xcf28c=[];if(_0x3d359b[_0x1777ca]){_0xcf28c=_0x3d359b[_0x1777ca][_0xd394('0x1')](function(_0x1f0b20){return{'id':_0x1f0b20['id'],'fullname':_0x1f0b20['fullname']};});}return _0x47a7b5(_0xcf28c);}catch(_0x117fa8){_0x1caa98(_0x117fa8);}});}function getInteractionTags(_0x22213e,_0x4285ed){var _0x4b81be=[];if(_0x22213e){_0x22213e[_0xd394('0x2')](',')[_0xd394('0x3')](function(_0x3eb256){_0x4b81be[_0xd394('0x4')](_0x4285ed[_0x3eb256]);});}return _0x4b81be;}function updateWaitingCounter(_0x33c6d3){if(_0x33c6d3[_0xd394('0x5')]){_0x33c6d3[_0xd394('0x5')]-=0x1;}}function updateInteractionCounters(_0xf1beca){_0xf1beca[_0xd394('0x5')]=0x0;_0xf1beca[_0xd394('0x6')]=0x0;_0xf1beca[_0xd394('0x7')]=0x0;_0xf1beca[_0xd394('0x8')]=0x0;_0xf1beca[_0xd394('0x9')]=0x0;_0xf1beca[_0xd394('0xa')]=0x0;if(_0xf1beca[_0xd394('0xb')]){if(_0xf1beca[_0xd394('0xc')]===_0xd394('0x9')){_0xf1beca[_0xd394('0x9')]+=0x1;updateWaitingCounter(_0xf1beca);}if(_0xf1beca[_0xd394('0xd')]){_0xf1beca['answered']+=0x1;if(_0xf1beca[_0xd394('0x6')]){_0xf1beca['talking']-=0x1;}}else{if(_0xf1beca[_0xd394('0xc')]){_0xf1beca[_0xd394('0x8')]+=0x1;updateWaitingCounter(_0xf1beca);}}}else{if(!_0xf1beca['UserId']){_0xf1beca[_0xd394('0x5')]+=0x1;}if(_0xf1beca[_0xd394('0xd')]){_0xf1beca[_0xd394('0x6')]+=0x1;updateWaitingCounter(_0xf1beca);}}_0xf1beca['total']+=0x1;return _0xf1beca;}function getLastMessageText(_0x3fe91b){return db[_0xd394('0xe')][_0xd394('0xf')]({'where':{'$and':[{'MailInteractionId':_0x3fe91b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd394('0x10')],'order':_0xd394('0x11'),'raw':!![]})[_0xd394('0x12')](function(_0x531917){if(_0x531917&&_0x531917['plainBody']){_0x3fe91b[_0xd394('0x13')]=_[_0xd394('0x14')](_0x531917[_0xd394('0x10')]);}return _0x3fe91b;})['catch'](function(_0x5abe17){throw _0x5abe17;});}exports[_0xd394('0x15')]=function(_0x4d1db8,_0x13faf3,_0x41e12f,_0x49a56e){return new Promise(function(_0x191f23,_0x369c82){return getInteractionUsers(_0x4d1db8['id'],_0x41e12f)[_0xd394('0x12')](function(_0x5db2d9){_0x4d1db8['Users']=_0x5db2d9;return getInteractionTags(_0x4d1db8[_0xd394('0x16')],_0x13faf3);})[_0xd394('0x12')](function(_0x1e195a){_0x4d1db8[_0xd394('0x17')]=_0x1e195a;delete _0x4d1db8[_0xd394('0x16')];return updateInteractionCounters(_0x4d1db8);})[_0xd394('0x12')](function(_0x545cb9){if(_0x49a56e){return getLastMessageText(_0x545cb9);}else{return _0x545cb9;}})['then'](function(_0x2bb3a5){_0x191f23(_0x2bb3a5);})[_0xd394('0x18')](function(_0x1ed0db){_0x369c82(_0x1ed0db);});});}; \ No newline at end of file +var _0x9c2f=['talking','unmanaged','abandoned','total','closed','UserId','answered','MailMessage','findOne','out','plainBody','-id','trimStart','then','Tags','TagIds','catch','lodash','../../mysqldb','fullname','split','forEach','push','waiting'];(function(_0x375ae5,_0x77fee2){var _0x19b70a=function(_0x23426d){while(--_0x23426d){_0x375ae5['push'](_0x375ae5['shift']());}};_0x19b70a(++_0x77fee2);}(_0x9c2f,0x1a9));var _0xf9c2=function(_0x5831fc,_0xab9a0a){_0x5831fc=_0x5831fc-0x0;var _0x47c212=_0x9c2f[_0x5831fc];return _0x47c212;};'use strict';var _=require(_0xf9c2('0x0'));var db=require(_0xf9c2('0x1'))['db'];function getInteractionUsers(_0x192206,_0x48982c){return new Promise(function(_0x187b2c,_0x3ebfb6){try{var _0x4405e1=[];if(_0x48982c[_0x192206]){_0x4405e1=_0x48982c[_0x192206]['map'](function(_0x46772a){return{'id':_0x46772a['id'],'fullname':_0x46772a[_0xf9c2('0x2')]};});}return _0x187b2c(_0x4405e1);}catch(_0x5786c1){_0x3ebfb6(_0x5786c1);}});}function getInteractionTags(_0x212ddf,_0x430404){var _0x4a446a=[];if(_0x212ddf){_0x212ddf[_0xf9c2('0x3')](',')[_0xf9c2('0x4')](function(_0x28875e){_0x4a446a[_0xf9c2('0x5')](_0x430404[_0x28875e]);});}return _0x4a446a;}function updateWaitingCounter(_0x2d6013){if(_0x2d6013['waiting']){_0x2d6013[_0xf9c2('0x6')]-=0x1;}}function updateInteractionCounters(_0x2932e5){_0x2932e5['waiting']=0x0;_0x2932e5[_0xf9c2('0x7')]=0x0;_0x2932e5['answered']=0x0;_0x2932e5[_0xf9c2('0x8')]=0x0;_0x2932e5[_0xf9c2('0x9')]=0x0;_0x2932e5[_0xf9c2('0xa')]=0x0;if(_0x2932e5[_0xf9c2('0xb')]){if(_0x2932e5['disposition']===_0xf9c2('0x9')){_0x2932e5['abandoned']+=0x1;updateWaitingCounter(_0x2932e5);}if(_0x2932e5[_0xf9c2('0xc')]){_0x2932e5[_0xf9c2('0xd')]+=0x1;if(_0x2932e5[_0xf9c2('0x7')]){_0x2932e5[_0xf9c2('0x7')]-=0x1;}}else{if(_0x2932e5['disposition']){_0x2932e5[_0xf9c2('0x8')]+=0x1;updateWaitingCounter(_0x2932e5);}}}else{if(!_0x2932e5[_0xf9c2('0xc')]){_0x2932e5[_0xf9c2('0x6')]+=0x1;}if(_0x2932e5[_0xf9c2('0xc')]){_0x2932e5[_0xf9c2('0x7')]+=0x1;updateWaitingCounter(_0x2932e5);}}_0x2932e5[_0xf9c2('0xa')]+=0x1;return _0x2932e5;}function getLastMessageText(_0x5e7bac){return db[_0xf9c2('0xe')][_0xf9c2('0xf')]({'where':{'$and':[{'MailInteractionId':_0x5e7bac['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xf9c2('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xf9c2('0x11')],'order':_0xf9c2('0x12'),'raw':!![]})['then'](function(_0x567816){if(_0x567816&&_0x567816['plainBody']){_0x5e7bac['lastMsgText']=_[_0xf9c2('0x13')](_0x567816[_0xf9c2('0x11')]);}return _0x5e7bac;})['catch'](function(_0x5be5cb){throw _0x5be5cb;});}exports['updateInteraction']=function(_0x483fef,_0x1a7049,_0xd21668,_0x4e3d71){return new Promise(function(_0x37b12c,_0x306493){return getInteractionUsers(_0x483fef['id'],_0xd21668)[_0xf9c2('0x14')](function(_0x449ed5){_0x483fef['Users']=_0x449ed5;return getInteractionTags(_0x483fef['TagIds'],_0x1a7049);})[_0xf9c2('0x14')](function(_0xfef35a){_0x483fef[_0xf9c2('0x15')]=_0xfef35a;delete _0x483fef[_0xf9c2('0x16')];return updateInteractionCounters(_0x483fef);})[_0xf9c2('0x14')](function(_0x12f926){if(_0x4e3d71){return getLastMessageText(_0x12f926);}else{return _0x12f926;}})[_0xf9c2('0x14')](function(_0x290890){_0x37b12c(_0x290890);})[_0xf9c2('0x17')](function(_0x534c9c){_0x306493(_0x534c9c);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1d342a8..84bb4ab 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5b8=['update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','Account','upperFirst','InteractionId','unknown','chat','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xa5b8,0xaf));var _0x8a5b=function(_0x258bde,_0x1d81c9){_0x258bde=_0x258bde-0x0;var _0xa17e86=_0xa5b8[_0x258bde];return _0xa17e86;};'use strict';var _=require(_0x8a5b('0x0'));var db=require(_0x8a5b('0x1'))['db'];var loggers={'openchannel':require(_0x8a5b('0x2'))(_0x8a5b('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x8a5b('0x2'))(_0x8a5b('0x4')),'sms':require(_0x8a5b('0x2'))(_0x8a5b('0x5')),'chat':require(_0x8a5b('0x2'))(_0x8a5b('0x6')),'whatsapp':require(_0x8a5b('0x2'))('whatsapp-interactions')};function getAccountFK(_0x1c0d9e){return _[_0x8a5b('0x7')](_0x1c0d9e)+(_0x1c0d9e==='chat'?'Website':_0x8a5b('0x8'))+'Id';}function getInteractionFK(_0x4c94c7){return _['capitalize'](_0x4c94c7)+'InteractionId';}function getInteractionId(_0x4ef1fc,_0x4e53f9,_0xa55c78){if(_0x4ef1fc&&_0x4ef1fc[_[_0x8a5b('0x9')](_0xa55c78)+_0x8a5b('0xa')]){return _0x4ef1fc[_[_0x8a5b('0x9')](_0xa55c78)+_0x8a5b('0xa')];}else if(_0x4ef1fc&&_0x4ef1fc['id']){return _0x4ef1fc['id'];}else if(_0x4e53f9&&_0x4e53f9['id']){return _0x4e53f9['id'];}else{return _0x8a5b('0xb');}}function getInteractionsTables(_0x4a2933){return{'accounts':_0x4a2933+'_'+(_0x4a2933===_0x8a5b('0xc')?_0x8a5b('0xd'):_0x8a5b('0xe')),'interactions':_0x4a2933+_0x8a5b('0xf'),'interactionsTags':_0x4a2933+'_interaction_has_tags','messages':_0x4a2933+_0x8a5b('0x10'),'userInteractions':_0x8a5b('0x11')+_0x4a2933+_0x8a5b('0xf')};}function getSelectedTags(_0x216d94){var _0x3a88cf=[];if(_0x216d94){_0x3a88cf=Array[_0x8a5b('0x12')](_0x216d94)?_0x216d94:[_0x216d94];}return _0x3a88cf;}function log(_0x56af3c,_0x5d19d4,_0x4208b9,_0xd56c2b,_0x183f47,_0x3efbfb){loggers[_0x183f47[_0x8a5b('0x13')]()][_0x56af3c](_0x8a5b('0x14'),_0x3efbfb[_0x8a5b('0x15')](),_0x5d19d4?_0x5d19d4['id']:null,_0x5d19d4?_0x5d19d4[_0x8a5b('0x16')]:null,_0x5d19d4?_0x5d19d4[_0x8a5b('0x17')]:null,getInteractionId(_0x4208b9,_0xd56c2b,_0x183f47),_0x4208b9?JSON[_0x8a5b('0x18')](_0x4208b9):_0x8a5b('0x19'));}function updateUser(_0x5979ce,_0x37148a,_0x207bc9,_0x4c7c3a,_0x423629){db[_['upperFirst'](_0x4c7c3a)+_0x8a5b('0x1a')][_0x8a5b('0x1b')]({'where':{'id':getInteractionId(_0x37148a,_0x207bc9,_0x4c7c3a)}})[_0x8a5b('0x1c')](function(_0x409f6e){if(_0x409f6e){return _0x409f6e[_0x8a5b('0x1d')]({'UserId':_0x5979ce?_0x5979ce['id']:null});}})[_0x8a5b('0x1c')](function(_0x466429){if(_0x466429){log(_0x8a5b('0x1e'),_0x5979ce,_0x37148a,_0x207bc9,_0x4c7c3a,_0x423629);}})[_0x8a5b('0x1f')](function(){log(_0x8a5b('0x20'),_0x5979ce,_0x37148a,_0x207bc9,_0x4c7c3a,_0x423629);});}module[_0x8a5b('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x95d2=['fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','InteractionId','upperFirst','unknown','chat','websites','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','Interaction','findOne','update','then','catch','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x95d2,0x18e));var _0x295d=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x95d2[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x295d('0x0'));var db=require(_0x295d('0x1'))['db'];var loggers={'openchannel':require(_0x295d('0x2'))(_0x295d('0x3')),'mail':require(_0x295d('0x2'))(_0x295d('0x4')),'fax':require(_0x295d('0x2'))(_0x295d('0x5')),'sms':require(_0x295d('0x2'))(_0x295d('0x6')),'chat':require(_0x295d('0x2'))(_0x295d('0x7')),'whatsapp':require(_0x295d('0x2'))(_0x295d('0x8'))};function getAccountFK(_0x35ff97){return _[_0x295d('0x9')](_0x35ff97)+(_0x35ff97==='chat'?_0x295d('0xa'):'Account')+'Id';}function getInteractionFK(_0x44ba0d){return _[_0x295d('0x9')](_0x44ba0d)+_0x295d('0xb');}function getInteractionId(_0x58339f,_0x2d1985,_0x6480c5){if(_0x58339f&&_0x58339f[_['upperFirst'](_0x6480c5)+_0x295d('0xb')]){return _0x58339f[_[_0x295d('0xc')](_0x6480c5)+_0x295d('0xb')];}else if(_0x58339f&&_0x58339f['id']){return _0x58339f['id'];}else if(_0x2d1985&&_0x2d1985['id']){return _0x2d1985['id'];}else{return _0x295d('0xd');}}function getInteractionsTables(_0x3a5817){return{'accounts':_0x3a5817+'_'+(_0x3a5817===_0x295d('0xe')?_0x295d('0xf'):'accounts'),'interactions':_0x3a5817+_0x295d('0x10'),'interactionsTags':_0x3a5817+_0x295d('0x11'),'messages':_0x3a5817+_0x295d('0x12'),'userInteractions':_0x295d('0x13')+_0x3a5817+_0x295d('0x10')};}function getSelectedTags(_0x281b48){var _0x494bae=[];if(_0x281b48){_0x494bae=Array[_0x295d('0x14')](_0x281b48)?_0x281b48:[_0x281b48];}return _0x494bae;}function log(_0x21dd51,_0x27756f,_0x51740c,_0x2ef997,_0x1b86d7,_0x3f48b1){loggers[_0x1b86d7[_0x295d('0x15')]()][_0x21dd51](_0x295d('0x16'),_0x3f48b1['toUpperCase'](),_0x27756f?_0x27756f['id']:null,_0x27756f?_0x27756f[_0x295d('0x17')]:null,_0x27756f?_0x27756f[_0x295d('0x18')]:null,getInteractionId(_0x51740c,_0x2ef997,_0x1b86d7),_0x51740c?JSON['stringify'](_0x51740c):'null');}function updateUser(_0x17ee00,_0x223912,_0x4305dc,_0x17c527,_0x3cfbe9){db[_[_0x295d('0xc')](_0x17c527)+_0x295d('0x19')][_0x295d('0x1a')]({'where':{'id':getInteractionId(_0x223912,_0x4305dc,_0x17c527)}})['then'](function(_0x2db8b7){if(_0x2db8b7){return _0x2db8b7[_0x295d('0x1b')]({'UserId':_0x17ee00?_0x17ee00['id']:null});}})[_0x295d('0x1c')](function(_0x2e66ba){if(_0x2e66ba){log('info',_0x17ee00,_0x223912,_0x4305dc,_0x17c527,_0x3cfbe9);}})[_0x295d('0x1d')](function(){log('error',_0x17ee00,_0x223912,_0x4305dc,_0x17c527,_0x3cfbe9);});}module[_0x295d('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index e613091..a66b9fd 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 _0x2f3e=['createDecipher','aes-256-ctr','format','update','base64','utf8','parse','use','License','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x304d27,_0xbc9864){var _0x47ee12=function(_0x4de8dd){while(--_0x4de8dd){_0x304d27['push'](_0x304d27['shift']());}};_0x47ee12(++_0xbc9864);}(_0x2f3e,0x157));var _0xe2f3=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x2f3e[_0x1e4150];return _0x1ce3ee;};'use strict';var crypto=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var compose=require('composable-middleware');var db=require(_0xe2f3('0x2'))['db'];var config=require(_0xe2f3('0x3'));function getValueFromLicense(_0xeb347c,_0x31a060){if(_0xeb347c&&_0x31a060){if(_0x31a060[_0xe2f3('0x4')]&&_0x31a060[_0xe2f3('0x5')]){var _0x2af0dd=_0x31a060['data1'];var _0x5e5bdf=_0x31a060['license'];var _0x15a34d=_0x2af0dd[_0xe2f3('0x6')]('-')[0x4];var _0x392621=_0x2af0dd['split']('-')[0x0];var _0x1c5316=crypto[_0xe2f3('0x7')](_0xe2f3('0x8'),util[_0xe2f3('0x9')]('%s:%s:%s',_0x15a34d,_0x2af0dd,_0x392621));var _0x5a9465=_0x1c5316[_0xe2f3('0xa')](_0x5e5bdf,_0xe2f3('0xb'),'utf8');_0x5a9465+=_0x1c5316['final'](_0xe2f3('0xc'));var _0x46eca7=JSON[_0xe2f3('0xd')](_0x5a9465);return _0x46eca7['hasOwnProperty'](_0xeb347c)?_0x46eca7[_0xeb347c]:null;}}return null;}function isLimit(_0x50232d,_0x47943e,_0x304f16,_0x48a8eb){var _0x4dbe54=_0x47943e;return compose()[_0xe2f3('0xe')](function(_0x8bf863,_0x3199fe,_0x5623d5){return db[_0xe2f3('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x488bbf){var _0x40b26d=getValueFromLicense(_0x50232d,_0x488bbf);return _0x40b26d?_0x40b26d:_0x4dbe54;})[_0xe2f3('0x10')](function(_0x65a82d){_0x4dbe54=_0x65a82d;return _0x304f16[_0xe2f3('0x11')](_0x48a8eb);})[_0xe2f3('0x10')](function(_0x47cba0){if(_0x47cba0>=_0x4dbe54){return _0x3199fe[_0xe2f3('0x12')](0x193)['json']({'message':util[_0xe2f3('0x9')](_0xe2f3('0x13'),_0x50232d)});}_0x5623d5();})[_0xe2f3('0x14')](function(_0x2fed10){_0x5623d5(_0x2fed10);});});}function isUserLimit(){return isLimit(_0xe2f3('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0xe2f3('0x16')},{'role':_0xe2f3('0x17')}]}});}exports[_0xe2f3('0x18')]=isUserLimit; \ No newline at end of file +var _0x27a9=['catch','User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8','parse','License','then','status'];(function(_0x3557bd,_0x7c92dd){var _0x591edc=function(_0x13bae6){while(--_0x13bae6){_0x3557bd['push'](_0x3557bd['shift']());}};_0x591edc(++_0x7c92dd);}(_0x27a9,0x73));var _0x927a=function(_0x3b234d,_0x249d15){_0x3b234d=_0x3b234d-0x0;var _0x47788c=_0x27a9[_0x3b234d];return _0x47788c;};'use strict';var crypto=require(_0x927a('0x0'));var util=require(_0x927a('0x1'));var compose=require('composable-middleware');var db=require(_0x927a('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4fcc5b,_0x51fffc){if(_0x4fcc5b&&_0x51fffc){if(_0x51fffc['data1']&&_0x51fffc['license']){var _0x910256=_0x51fffc[_0x927a('0x3')];var _0x2ec084=_0x51fffc[_0x927a('0x4')];var _0x371fa4=_0x910256['split']('-')[0x4];var _0x40e017=_0x910256[_0x927a('0x5')]('-')[0x0];var _0x10c203=crypto[_0x927a('0x6')]('aes-256-ctr',util[_0x927a('0x7')](_0x927a('0x8'),_0x371fa4,_0x910256,_0x40e017));var _0x40789b=_0x10c203[_0x927a('0x9')](_0x2ec084,_0x927a('0xa'),'utf8');_0x40789b+=_0x10c203[_0x927a('0xb')](_0x927a('0xc'));var _0x4c021c=JSON[_0x927a('0xd')](_0x40789b);return _0x4c021c['hasOwnProperty'](_0x4fcc5b)?_0x4c021c[_0x4fcc5b]:null;}}return null;}function isLimit(_0x32e2ce,_0x4821d4,_0x521b5f,_0x211541){var _0x5e97b3=_0x4821d4;return compose()['use'](function(_0x35d7c6,_0x4748f7,_0x21abce){return db[_0x927a('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x927a('0xf')](function(_0x424276){var _0x2ce20a=getValueFromLicense(_0x32e2ce,_0x424276);return _0x2ce20a?_0x2ce20a:_0x5e97b3;})[_0x927a('0xf')](function(_0x19b449){_0x5e97b3=_0x19b449;return _0x521b5f['count'](_0x211541);})[_0x927a('0xf')](function(_0x2c4f7b){if(_0x2c4f7b>=_0x5e97b3){return _0x4748f7[_0x927a('0x10')](0x193)['json']({'message':util[_0x927a('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x32e2ce)});}_0x21abce();})[_0x927a('0x11')](function(_0x5bf860){_0x21abce(_0x5bf860);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x927a('0x12')],{'where':{'$or':[{'role':_0x927a('0x13')},{'role':_0x927a('0x14')}]}});}exports[_0x927a('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 4b2c66e..719503f 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 _0x7553=['$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','shift','pop','utcOffset','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','$lte','add','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','includes'];(function(_0x45f22a,_0x8224ab){var _0x29cf5c=function(_0x31d80b){while(--_0x31d80b){_0x45f22a['push'](_0x45f22a['shift']());}};_0x29cf5c(++_0x8224ab);}(_0x7553,0x1bc));var _0x3755=function(_0x6b4e41,_0x3ed208){_0x6b4e41=_0x6b4e41-0x0;var _0x346877=_0x7553[_0x6b4e41];return _0x346877;};'use strict';var _=require(_0x3755('0x0'));var moment=require(_0x3755('0x1'));exports[_0x3755('0x2')]=function(_0x4a3743){var _0x27a176={'conditions':[]};_0x27a176[_0x3755('0x3')]=_[_0x3755('0x4')](_0x4a3743,_0x3755('0x5'))?'or':_0x3755('0x6');var _0x42e49b=_0x4a3743[_0x3755('0x7')]('[$and]','')['replace'](_0x3755('0x5'),'')[_0x3755('0x8')]('||');for(var _0x9cf69d=0x0;_0x9cf69d<_0x42e49b[_0x3755('0x9')];_0x9cf69d++){var _0x4e343d=_0x42e49b[_0x9cf69d][_0x3755('0x8')](':=');var _0x2fd4d1=_0x4e343d[0x0];var _0x4ace9b=_0x4e343d[_0x3755('0xa')](0x1);_0x4ace9b[_0x3755('0xb')](function(_0x491a35){var _0x3b9a4b=_0x491a35[_0x3755('0x8')]('[')['shift']();var _0x5c5fb1=_0x491a35[_0x3755('0xc')](/\[(.*?)\]/g);_0x5c5fb1[_0x3755('0xb')](function(_0x535b95){var _0x49cb8f=_0x535b95[_0x3755('0x8')]('[')[_0x3755('0xd')](function(_0x299180){return _0x299180[_0x3755('0xe')](']')>-0x1;})[_0x3755('0xf')](function(_0x4fae10){return _0x4fae10[_0x3755('0x8')](']')[0x0];})[0x0];_0x27a176[_0x3755('0x10')][_0x3755('0x11')]({'field':_0x2fd4d1,'operator':_0x3b9a4b,'value':_0x49cb8f});});});}return _0x27a176;};exports[_0x3755('0x12')]=function(_0x2d675c,_0x31b55d,_0x38bbbc){var _0x4e77c8={};if(_0x31b55d===_0x3755('0x13')){if(_0x38bbbc['operator']===_0x3755('0x14')){_0x38bbbc[_0x3755('0x15')]=_0x3755('0x16');_0x38bbbc[_0x3755('0x17')]+=','+_0x38bbbc[_0x3755('0x17')];}else if(_['includes'](['$gt',_0x3755('0x18')],_0x38bbbc[_0x3755('0x15')])){_0x38bbbc[_0x3755('0x17')]=moment(_0x38bbbc[_0x3755('0x17')])[_0x3755('0x19')](0x1,'days')[_0x3755('0x1a')](_0x3755('0x1b'));}}if(_0x38bbbc[_0x3755('0x1c')]){_0x31b55d=_0x38bbbc[_0x3755('0x1c')];_0x4e77c8[_0x3755('0x1d')]='CAST('+_0x2d675c+'.'+_0x38bbbc[_0x3755('0x1e')]+_0x3755('0x1f')+_0x38bbbc[_0x3755('0x1c')]+')\x20'+parseOperator(_0x38bbbc[_0x3755('0x15')]);}else{_0x4e77c8['text']=_0x2d675c+'.'+_0x38bbbc[_0x3755('0x1e')]+'\x20'+parseOperator(_0x38bbbc[_0x3755('0x15')]);}if(_[_0x3755('0x20')]([_0x3755('0x21'),_0x3755('0x22')],_0x38bbbc['operator']))_0x4e77c8['text']='('+_0x4e77c8[_0x3755('0x1d')]+'\x20OR\x20'+_0x2d675c+'.'+_0x38bbbc['field']+_0x3755('0x23');_0x4e77c8[_0x3755('0x17')]=parseValue(_0x31b55d,_0x38bbbc['operator'],_0x38bbbc[_0x3755('0x17')]);return _0x4e77c8;};function parseOperator(_0x33e5c5){var _0x4d0e36;switch(_0x33e5c5){case _0x3755('0x24'):_0x4d0e36=_0x3755('0x25');break;case _0x3755('0x22'):_0x4d0e36=_0x3755('0x26');break;case _0x3755('0x14'):_0x4d0e36='=\x20?';break;case _0x3755('0x21'):_0x4d0e36=_0x3755('0x27');break;case _0x3755('0x28'):case _0x3755('0x29'):case _0x3755('0x2a'):_0x4d0e36=_0x3755('0x2b');break;case'$lt':_0x4d0e36=_0x3755('0x2c');break;case _0x3755('0x2d'):_0x4d0e36='>\x20?';break;case'$lte':_0x4d0e36='<=\x20?';break;case _0x3755('0x2e'):_0x4d0e36=_0x3755('0x2f');break;case _0x3755('0x16'):_0x4d0e36=_0x3755('0x30');break;}return _0x4d0e36;}function parseValue(_0x3eb8fd,_0x2f7afc,_0x12f13d){var _0x197484={'start':undefined,'end':undefined};switch(_0x2f7afc){case'$in':case _0x3755('0x22'):_0x197484[_0x3755('0x31')]=_0x12f13d[_0x3755('0x8')](',');break;case _0x3755('0x28'):_0x197484['start']='%'+_0x12f13d+'%';break;case _0x3755('0x29'):_0x197484[_0x3755('0x31')]=_0x12f13d+'%';break;case _0x3755('0x2a'):_0x197484['start']='%'+_0x12f13d;break;case _0x3755('0x16'):var _0x3d06ea=_0x12f13d[_0x3755('0x8')](',');var _0x12f13d=_0x3d06ea[_0x3755('0x32')]();var _0xf419af=_0x3d06ea[_0x3755('0x33')]();if(_0x3eb8fd===_0x3755('0x13')){_0x12f13d=moment(_0x12f13d)['utcOffset'](0x0,!![])[_0x3755('0x1a')]();_0xf419af=moment(_0xf419af)[_0x3755('0x34')](0x0,!![])[_0x3755('0x19')](0x17,'hours')[_0x3755('0x19')](0x3b,'minutes')[_0x3755('0x19')](0x3b,'seconds')[_0x3755('0x1a')]();}_0x197484={'start':_0x12f13d,'end':_0xf419af};break;default:_0x197484[_0x3755('0x31')]=_0x12f13d;break;}return _0x197484;} \ No newline at end of file +var _0x9c1b=['hours','minutes','seconds','lodash','moment','startsWith','[$or]','and','replace','[$and]','slice','forEach','split','match','filter','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','add','days','YYYY-MM-DD','text','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','$ne','$startsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','$substring','$endsWith','shift','utcOffset','format'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9c1b,0x1d7));var _0xb9c1=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x9c1b[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0xb9c1('0x0'));var moment=require(_0xb9c1('0x1'));exports['parseSearch']=function(_0x38fe71){var _0x149cb9={'conditions':[]};_0x149cb9['sqlOperator']=_[_0xb9c1('0x2')](_0x38fe71,_0xb9c1('0x3'))?'or':_0xb9c1('0x4');var _0x59ba8e=_0x38fe71[_0xb9c1('0x5')](_0xb9c1('0x6'),'')[_0xb9c1('0x5')](_0xb9c1('0x3'),'')['split']('||');for(var _0x6799a0=0x0;_0x6799a0<_0x59ba8e['length'];_0x6799a0++){var _0x51340b=_0x59ba8e[_0x6799a0]['split'](':=');var _0x28daf1=_0x51340b[0x0];var _0x2d19be=_0x51340b[_0xb9c1('0x7')](0x1);_0x2d19be[_0xb9c1('0x8')](function(_0x15bbbd){var _0x44fd9f=_0x15bbbd[_0xb9c1('0x9')]('[')['shift']();var _0xb03a34=_0x15bbbd[_0xb9c1('0xa')](/\[(.*?)\]/g);_0xb03a34[_0xb9c1('0x8')](function(_0x2e55c0){var _0x2330d7=_0x2e55c0[_0xb9c1('0x9')]('[')[_0xb9c1('0xb')](function(_0x3dc73d){return _0x3dc73d['indexOf'](']')>-0x1;})[_0xb9c1('0xc')](function(_0x13072c){return _0x13072c[_0xb9c1('0x9')](']')[0x0];})[0x0];_0x149cb9[_0xb9c1('0xd')][_0xb9c1('0xe')]({'field':_0x28daf1,'operator':_0x44fd9f,'value':_0x2330d7});});});}return _0x149cb9;};exports[_0xb9c1('0xf')]=function(_0x2f13df,_0x39a5b1,_0x488865){var _0x342fae={};if(_0x39a5b1===_0xb9c1('0x10')){if(_0x488865[_0xb9c1('0x11')]===_0xb9c1('0x12')){_0x488865[_0xb9c1('0x11')]='$between';_0x488865[_0xb9c1('0x13')]+=','+_0x488865[_0xb9c1('0x13')];}else if(_[_0xb9c1('0x14')]([_0xb9c1('0x15'),'$lte'],_0x488865['operator'])){_0x488865[_0xb9c1('0x13')]=moment(_0x488865[_0xb9c1('0x13')])[_0xb9c1('0x16')](0x1,_0xb9c1('0x17'))['format'](_0xb9c1('0x18'));}}if(_0x488865['castTo']){_0x39a5b1=_0x488865['castTo'];_0x342fae[_0xb9c1('0x19')]='CAST('+_0x2f13df+'.'+_0x488865['field']+'\x20AS\x20'+_0x488865['castTo']+')\x20'+parseOperator(_0x488865[_0xb9c1('0x11')]);}else{_0x342fae['text']=_0x2f13df+'.'+_0x488865[_0xb9c1('0x1a')]+'\x20'+parseOperator(_0x488865['operator']);}if(_['includes'](['$ne',_0xb9c1('0x1b')],_0x488865['operator']))_0x342fae[_0xb9c1('0x19')]='('+_0x342fae['text']+_0xb9c1('0x1c')+_0x2f13df+'.'+_0x488865[_0xb9c1('0x1a')]+_0xb9c1('0x1d');_0x342fae[_0xb9c1('0x13')]=parseValue(_0x39a5b1,_0x488865[_0xb9c1('0x11')],_0x488865[_0xb9c1('0x13')]);return _0x342fae;};function parseOperator(_0x19559a){var _0x100825;switch(_0x19559a){case _0xb9c1('0x1e'):_0x100825=_0xb9c1('0x1f');break;case _0xb9c1('0x1b'):_0x100825='NOT\x20IN\x20?';break;case'$eq':_0x100825=_0xb9c1('0x20');break;case _0xb9c1('0x21'):_0x100825='<>\x20?';break;case'$substring':case _0xb9c1('0x22'):case'$endsWith':_0x100825='LIKE\x20?';break;case _0xb9c1('0x23'):_0x100825=_0xb9c1('0x24');break;case _0xb9c1('0x15'):_0x100825=_0xb9c1('0x25');break;case _0xb9c1('0x26'):_0x100825=_0xb9c1('0x27');break;case _0xb9c1('0x28'):_0x100825='>=\x20?';break;case _0xb9c1('0x29'):_0x100825=_0xb9c1('0x2a');break;}return _0x100825;}function parseValue(_0x28814f,_0x5ab9b2,_0x27a913){var _0x1feb8d={'start':undefined,'end':undefined};switch(_0x5ab9b2){case'$in':case'$notIn':_0x1feb8d[_0xb9c1('0x2b')]=_0x27a913[_0xb9c1('0x9')](',');break;case _0xb9c1('0x2c'):_0x1feb8d['start']='%'+_0x27a913+'%';break;case _0xb9c1('0x22'):_0x1feb8d[_0xb9c1('0x2b')]=_0x27a913+'%';break;case _0xb9c1('0x2d'):_0x1feb8d['start']='%'+_0x27a913;break;case'$between':var _0x2f7525=_0x27a913[_0xb9c1('0x9')](',');var _0x27a913=_0x2f7525[_0xb9c1('0x2e')]();var _0x1d746e=_0x2f7525['pop']();if(_0x28814f===_0xb9c1('0x10')){_0x27a913=moment(_0x27a913)[_0xb9c1('0x2f')](0x0,!![])[_0xb9c1('0x30')]();_0x1d746e=moment(_0x1d746e)[_0xb9c1('0x2f')](0x0,!![])[_0xb9c1('0x16')](0x17,_0xb9c1('0x31'))['add'](0x3b,_0xb9c1('0x32'))[_0xb9c1('0x16')](0x3b,_0xb9c1('0x33'))['format']();}_0x1feb8d={'start':_0x27a913,'end':_0x1d746e};break;default:_0x1feb8d['start']=_0x27a913;break;}return _0x1feb8d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 2cbb2c2..d2431d0 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 _0x4113=['filters','forOwn','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','name','isArray','split','limit','sort','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isEmpty','length','isObject','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','\x22{EXPR}\x22','{EXPR}','forEach','replace','join','getOptions','$id','query','map','intersection','model','attributes','hasOwnProperty','nolimit','offset','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields'];(function(_0x44bb3e,_0x458c33){var _0x253d53=function(_0x52a507){while(--_0x52a507){_0x44bb3e['push'](_0x44bb3e['shift']());}};_0x253d53(++_0x458c33);}(_0x4113,0x16e));var _0x3411=function(_0x5f16b9,_0x40721e){_0x5f16b9=_0x5f16b9-0x0;var _0x2abdf4=_0x4113[_0x5f16b9];return _0x2abdf4;};'use strict';var _=require('lodash');var sequelize=require(_0x3411('0x0'));var moment=require(_0x3411('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x29115e){var _0x45af5f=['ne'];try{var _0x12f787=JSON[_0x3411('0x2')](_0x29115e);var _0x5503cd=Object[_0x3411('0x3')](_0x12f787)[0x0];return _0x45af5f[_0x3411('0x4')](_0x5503cd);}catch(_0x589dfa){return![];}}function getOperatorValue(_0x57e27d){var _0x4c6fcc=JSON[_0x3411('0x2')](_0x57e27d);var _0x4d053c=Object['keys'](_0x4c6fcc)[0x0];var _0x52047d=_0x4c6fcc[_0x4d053c];return{['$'+_0x4d053c]:_0x52047d};}exports[_0x3411('0x5')]=function(_0x560cea){var _0x3177b0=null;if(_0x560cea){_0x3177b0=_0x560cea['split'](',');}return _0x3177b0;};exports[_0x3411('0x6')]=function(_0x15df9b,_0x51a007){var _0x35611d={};if(!_['isEmpty'](_0x15df9b)){_[_0x3411('0x7')](_0x15df9b,function(_0x44f96b,_0x30f8cd){try{if(_0x51a007){var _0x166011=_['find'](_0x51a007,{'name':_0x30f8cd})||{};if(hasSequelizeOperator(_0x44f96b)){_0x35611d[_0x30f8cd]=getOperatorValue(_0x44f96b);}else if(_0x166011[_0x3411('0x8')]===_0x3411('0x9')&&_[_0x3411('0xa')](_0x44f96b)){var _0x2ee6de=JSON[_0x3411('0x2')](_0x44f96b);var _0x4fd7f6={'$gte':moment(moment(_0x2ee6de['$gte'])[_0x3411('0xb')](_0x3411('0xc')))[_0x3411('0xd')]()[_0x3411('0xb')](),'$lte':moment(moment(_0x2ee6de[_0x3411('0xe')])[_0x3411('0xb')](_0x3411('0xc')))[_0x3411('0xd')]()['subtract'](0x1,'s')[_0x3411('0xb')]()};_0x35611d[_0x30f8cd]=_0x4fd7f6;}else if(_0x166011[_0x3411('0xf')]==='uniqueid'){_0x35611d[_0x30f8cd]=_0x44f96b;}else{_0x35611d[_0x30f8cd]=_[_0x3411('0x10')](_0x44f96b)?_0x44f96b:JSON[_0x3411('0x2')](_0x44f96b);}}else{_0x35611d[_0x30f8cd]=_['isArray'](_0x44f96b)?_0x44f96b:JSON[_0x3411('0x2')](_0x44f96b);}}catch(_0x201513){_0x35611d[_0x30f8cd]=_0x44f96b[_0x3411('0x11')](',');}});}return _0x35611d;};exports[_0x3411('0x12')]=function(_0x4032d9){_0x4032d9=parseInt(_0x4032d9,0xa);if(!_0x4032d9||_0x4032d9<0x0){_0x4032d9=LIMIT_VALUE;}return _0x4032d9;};exports['offset']=function(_0x21b6a8){_0x21b6a8=parseInt(_0x21b6a8,0xa);if(!_0x21b6a8||_0x21b6a8<0x0){_0x21b6a8=0x0;}return _0x21b6a8;};exports[_0x3411('0x13')]=function(_0x42ad24){var _0x26ea54,_0x21cfd5=null;if(_0x42ad24){_0x26ea54=_0x42ad24[_0x3411('0x11')](',');_0x21cfd5=_['map'](_0x26ea54,function(_0x19a997){if(_0x19a997[_0x3411('0x14')]('-')===0x0){return[_0x19a997===_0x3411('0x15')?sequelize[_0x3411('0x16')](sequelize[_0x3411('0x17')](_0x3411('0x15')),_0x3411('0x18')):_0x19a997[_0x3411('0x19')](0x1),'DESC'];}else{return[_0x19a997==='priority'?sequelize[_0x3411('0x16')](sequelize[_0x3411('0x17')]('priority'),_0x3411('0x18')):_0x19a997,_0x3411('0x1a')];}});}return _0x21cfd5;};exports[_0x3411('0x1b')]=function(_0x2413cb,_0x5dd74d){if(_[_0x3411('0x1c')](_0x2413cb)){return _0x2413cb;}if(_[_0x3411('0x10')](_0x2413cb)){for(var _0x122a7e=0x0;_0x122a7e<_0x2413cb[_0x3411('0x1d')];_0x122a7e+=0x1){_0x2413cb[_0x122a7e]=this[_0x3411('0x1b')](_0x2413cb[_0x122a7e],_0x5dd74d);}return _0x2413cb;}if(!_[_0x3411('0x1e')](_0x2413cb)){return _0x2413cb;}if(_['isString'](_0x5dd74d)){_0x5dd74d=[_0x5dd74d];}if(!_[_0x3411('0x10')](_0x5dd74d)){return _0x2413cb;}for(var _0x463875=0x0;_0x463875<_0x5dd74d[_0x3411('0x1d')];_0x463875+=0x1){_[_0x3411('0x1f')](_0x2413cb,_0x5dd74d[_0x463875]);}for(var _0x253a43 in _0x2413cb){if(_0x2413cb['hasOwnProperty'](_0x253a43)){_0x2413cb[_0x253a43]=this['omit'](_0x2413cb[_0x253a43],_0x5dd74d);}}return _0x2413cb;};exports[_0x3411('0x20')]=function(_0x2144b0){return _0x2144b0['match'](RegExp(_0x3411('0x21')))?!![]:![];};exports[_0x3411('0x22')]=function(_0x3bbb2f){return _0x3bbb2f[_0x3411('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x52743d,_0x21abee){var _0x47270b=[];var _0x3223ef=/[ `!@#$%^&*()_\-?~]/;var _0x14e668=_0x21abee?_0x3411('0x24'):_0x3411('0x25');_0x52743d[_0x3411('0x11')](/[ ,]+/)[_0x3411('0x26')](function(_0x3e0dba){_0x3e0dba=_0x3e0dba[_0x3411('0x27')](/([^:]")"+/g,'$1');_0x3e0dba='+'+_0x3e0dba+'*';var _0x2183e0=_0x3e0dba['match'](_0x3223ef);if(_0x2183e0){_0x3e0dba='\x22'+_0x3e0dba+'\x22';}_0x47270b['push'](_0x3e0dba);});_0x14e668=_0x14e668['replace'](_0x3411('0x25'),_0x47270b[_0x3411('0x28')]('\x20'));return _0x14e668;};exports[_0x3411('0x29')]=function(_0x448c7a,_0x3ed2b5,_0x269523){var _0x4bd8cf={},_0x488c5d={};if(_0x3ed2b5['query'][_0x3411('0x2a')]){_0x3ed2b5[_0x3411('0x2b')]['id']=_0x3ed2b5[_0x3411('0x2b')]['$id'];delete _0x3ed2b5['query'][_0x3411('0x2a')];}_0x4bd8cf['model']=_[_0x3411('0x2c')](_0x448c7a,_0x3411('0xf'));_0x4bd8cf[_0x3411('0x2b')]=_[_0x3411('0x3')](_0x3ed2b5[_0x3411('0x2b')]);_0x4bd8cf[_0x3411('0x6')]=_[_0x3411('0x2d')](_0x4bd8cf[_0x3411('0x2e')],_0x4bd8cf['query']);_0x488c5d[_0x3411('0x2f')]=_[_0x3411('0x2d')](_0x4bd8cf[_0x3411('0x2e')],this[_0x3411('0x5')](_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x5')]));_0x488c5d['attributes']=_0x488c5d[_0x3411('0x2f')][_0x3411('0x1d')]?_0x488c5d['attributes']:_0x4bd8cf[_0x3411('0x2e')];if(!_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x30')](_0x3411('0x31'))){_0x488c5d[_0x3411('0x12')]=this[_0x3411('0x12')](_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x12')]);_0x488c5d[_0x3411('0x32')]=this['offset'](_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x32')]);}_0x488c5d[_0x3411('0x33')]=this[_0x3411('0x13')](_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x13')]);_0x488c5d[_0x3411('0x34')]=this['filters'](_[_0x3411('0x35')](_0x3ed2b5[_0x3411('0x2b')],_0x4bd8cf[_0x3411('0x6')]),_0x448c7a);if(_0x3ed2b5['query'][_0x3411('0x36')]){var _0x4fdea0=_0x448c7a;var _0x162e84=_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x36')];if(typeof _0x162e84===_0x3411('0x37')){_0x4fdea0=_[_0x3411('0x36')](_0x448c7a,function(_0x2ceae8){return _['includes'](_0x162e84[_0x3411('0x38')],_0x2ceae8[_0x3411('0xf')]);});_0x162e84=_0x162e84[_0x3411('0x39')];}_0x488c5d[_0x3411('0x34')]=_[_0x3411('0x3a')](_0x488c5d[_0x3411('0x34')],{'$or':_[_0x3411('0x2c')](_0x4fdea0,function(_0x326240){if(_0x326240[_0x3411('0x8')]!==_0x3411('0x3b')){if(_0x269523){return sequelize['where'](sequelize['fn'](_0x3411('0x3c'),sequelize[_0x3411('0x17')](_0x326240[_0x3411('0xf')])),{'$like':sequelize['fn'](_0x3411('0x3c'),'%'+_0x3ed2b5[_0x3411('0x2b')][_0x3411('0x36')]+'%')});}else{var _0x3f4f2c={};_0x3f4f2c[_0x326240[_0x3411('0xf')]]={'$like':'%'+_0x3ed2b5[_0x3411('0x2b')]['filter']+'%'};return _0x3f4f2c;}}})});}_0x488c5d=_[_0x3411('0x3a')]({},_0x488c5d,_0x3ed2b5[_0x3411('0x3d')]);return _0x488c5d;}; \ No newline at end of file +var _0x6b39=['format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','DESC','unsigned','length','isObject','isString','hasOwnProperty','omit','isNumeric','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','$id','query','model','intersection','attributes','offset','order','where','filter','object','includes','columns','value','merge','type','VIRTUAL','lower','options','parse','keys','fields','split','filters','isEmpty','find','isPlainObject','$gte'];(function(_0xbfcb59,_0x34fb3b){var _0x4d999a=function(_0x4386b5){while(--_0x4386b5){_0xbfcb59['push'](_0xbfcb59['shift']());}};_0x4d999a(++_0x34fb3b);}(_0x6b39,0x1cf));var _0x96b3=function(_0xc89450,_0x2acbe6){_0xc89450=_0xc89450-0x0;var _0x5cd7f5=_0x6b39[_0xc89450];return _0x5cd7f5;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x2e1259){var _0x547b24=['ne'];try{var _0x45d47b=JSON[_0x96b3('0x0')](_0x2e1259);var _0x1855bd=Object[_0x96b3('0x1')](_0x45d47b)[0x0];return _0x547b24['includes'](_0x1855bd);}catch(_0x5da8a6){return![];}}function getOperatorValue(_0x5eb0ee){var _0x2a1843=JSON[_0x96b3('0x0')](_0x5eb0ee);var _0x4fcf04=Object['keys'](_0x2a1843)[0x0];var _0x48b7c8=_0x2a1843[_0x4fcf04];return{['$'+_0x4fcf04]:_0x48b7c8};}exports[_0x96b3('0x2')]=function(_0x566591){var _0x22e851=null;if(_0x566591){_0x22e851=_0x566591[_0x96b3('0x3')](',');}return _0x22e851;};exports[_0x96b3('0x4')]=function(_0x274e82,_0x27a4d8){var _0x4db808={};if(!_[_0x96b3('0x5')](_0x274e82)){_['forOwn'](_0x274e82,function(_0x299ced,_0x1a2edd){try{if(_0x27a4d8){var _0x30cfae=_[_0x96b3('0x6')](_0x27a4d8,{'name':_0x1a2edd})||{};if(hasSequelizeOperator(_0x299ced)){_0x4db808[_0x1a2edd]=getOperatorValue(_0x299ced);}else if(_0x30cfae['type']==='DATE'&&_[_0x96b3('0x7')](_0x299ced)){var _0x42e868=JSON[_0x96b3('0x0')](_0x299ced);var _0x9142b1={'$gte':moment(moment(_0x42e868[_0x96b3('0x8')])[_0x96b3('0x9')](_0x96b3('0xa')))[_0x96b3('0xb')]()[_0x96b3('0x9')](),'$lte':moment(moment(_0x42e868[_0x96b3('0xc')])['format'](_0x96b3('0xa')))[_0x96b3('0xb')]()[_0x96b3('0xd')](0x1,'s')[_0x96b3('0x9')]()};_0x4db808[_0x1a2edd]=_0x9142b1;}else if(_0x30cfae[_0x96b3('0xe')]===_0x96b3('0xf')){_0x4db808[_0x1a2edd]=_0x299ced;}else{_0x4db808[_0x1a2edd]=_[_0x96b3('0x10')](_0x299ced)?_0x299ced:JSON['parse'](_0x299ced);}}else{_0x4db808[_0x1a2edd]=_[_0x96b3('0x10')](_0x299ced)?_0x299ced:JSON[_0x96b3('0x0')](_0x299ced);}}catch(_0x4bb23c){_0x4db808[_0x1a2edd]=_0x299ced[_0x96b3('0x3')](',');}});}return _0x4db808;};exports[_0x96b3('0x11')]=function(_0x48f412){_0x48f412=parseInt(_0x48f412,0xa);if(!_0x48f412||_0x48f412<0x0){_0x48f412=LIMIT_VALUE;}return _0x48f412;};exports['offset']=function(_0xa12578){_0xa12578=parseInt(_0xa12578,0xa);if(!_0xa12578||_0xa12578<0x0){_0xa12578=0x0;}return _0xa12578;};exports[_0x96b3('0x12')]=function(_0x4c3da7){var _0x3234c6,_0x256b46=null;if(_0x4c3da7){_0x3234c6=_0x4c3da7[_0x96b3('0x3')](',');_0x256b46=_[_0x96b3('0x13')](_0x3234c6,function(_0x3a7427){if(_0x3a7427[_0x96b3('0x14')]('-')===0x0){return[_0x3a7427===_0x96b3('0x15')?sequelize[_0x96b3('0x16')](sequelize[_0x96b3('0x17')](_0x96b3('0x15')),'unsigned'):_0x3a7427['substr'](0x1),_0x96b3('0x18')];}else{return[_0x3a7427===_0x96b3('0x15')?sequelize['cast'](sequelize[_0x96b3('0x17')](_0x96b3('0x15')),_0x96b3('0x19')):_0x3a7427,'ASC'];}});}return _0x256b46;};exports['omit']=function(_0x54d8fb,_0x19aa18){if(_[_0x96b3('0x5')](_0x54d8fb)){return _0x54d8fb;}if(_[_0x96b3('0x10')](_0x54d8fb)){for(var _0x609c35=0x0;_0x609c35<_0x54d8fb[_0x96b3('0x1a')];_0x609c35+=0x1){_0x54d8fb[_0x609c35]=this['omit'](_0x54d8fb[_0x609c35],_0x19aa18);}return _0x54d8fb;}if(!_[_0x96b3('0x1b')](_0x54d8fb)){return _0x54d8fb;}if(_[_0x96b3('0x1c')](_0x19aa18)){_0x19aa18=[_0x19aa18];}if(!_[_0x96b3('0x10')](_0x19aa18)){return _0x54d8fb;}for(var _0x1e324b=0x0;_0x1e324b<_0x19aa18['length'];_0x1e324b+=0x1){_['unset'](_0x54d8fb,_0x19aa18[_0x1e324b]);}for(var _0x52ca28 in _0x54d8fb){if(_0x54d8fb[_0x96b3('0x1d')](_0x52ca28)){_0x54d8fb[_0x52ca28]=this[_0x96b3('0x1e')](_0x54d8fb[_0x52ca28],_0x19aa18);}}return _0x54d8fb;};exports[_0x96b3('0x1f')]=function(_0x52af64){return _0x52af64[_0x96b3('0x20')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x96b3('0x21')]=function(_0xd36f75){return _0xd36f75[_0x96b3('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x96b3('0x22')]=function(_0x752bfb,_0x2d5cb8){var _0x1d5101=[];var _0x3b43c6=/[ `!@#$%^&*()_\-?~]/;var _0x239a84=_0x2d5cb8?_0x96b3('0x23'):_0x96b3('0x24');_0x752bfb[_0x96b3('0x3')](/[ ,]+/)['forEach'](function(_0x1aa972){_0x1aa972=_0x1aa972[_0x96b3('0x25')](/([^:]")"+/g,'$1');_0x1aa972='+'+_0x1aa972+'*';var _0x4da34=_0x1aa972['match'](_0x3b43c6);if(_0x4da34){_0x1aa972='\x22'+_0x1aa972+'\x22';}_0x1d5101[_0x96b3('0x26')](_0x1aa972);});_0x239a84=_0x239a84[_0x96b3('0x25')](_0x96b3('0x24'),_0x1d5101[_0x96b3('0x27')]('\x20'));return _0x239a84;};exports[_0x96b3('0x28')]=function(_0x31b58d,_0x5873ee,_0x1a384c){var _0x31b29c={},_0x1f8f2c={};if(_0x5873ee['query'][_0x96b3('0x29')]){_0x5873ee['query']['id']=_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x29')];delete _0x5873ee[_0x96b3('0x2a')][_0x96b3('0x29')];}_0x31b29c[_0x96b3('0x2b')]=_[_0x96b3('0x13')](_0x31b58d,_0x96b3('0xe'));_0x31b29c[_0x96b3('0x2a')]=_[_0x96b3('0x1')](_0x5873ee[_0x96b3('0x2a')]);_0x31b29c[_0x96b3('0x4')]=_[_0x96b3('0x2c')](_0x31b29c[_0x96b3('0x2b')],_0x31b29c[_0x96b3('0x2a')]);_0x1f8f2c[_0x96b3('0x2d')]=_['intersection'](_0x31b29c[_0x96b3('0x2b')],this['fields'](_0x5873ee['query']['fields']));_0x1f8f2c[_0x96b3('0x2d')]=_0x1f8f2c[_0x96b3('0x2d')][_0x96b3('0x1a')]?_0x1f8f2c['attributes']:_0x31b29c[_0x96b3('0x2b')];if(!_0x5873ee[_0x96b3('0x2a')]['hasOwnProperty']('nolimit')){_0x1f8f2c[_0x96b3('0x11')]=this['limit'](_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x11')]);_0x1f8f2c[_0x96b3('0x2e')]=this[_0x96b3('0x2e')](_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x2e')]);}_0x1f8f2c[_0x96b3('0x2f')]=this['sort'](_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x12')]);_0x1f8f2c[_0x96b3('0x30')]=this[_0x96b3('0x4')](_['pick'](_0x5873ee['query'],_0x31b29c['filters']),_0x31b58d);if(_0x5873ee['query']['filter']){var _0x4825d2=_0x31b58d;var _0x225162=_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x31')];if(typeof _0x225162===_0x96b3('0x32')){_0x4825d2=_[_0x96b3('0x31')](_0x31b58d,function(_0x244020){return _[_0x96b3('0x33')](_0x225162[_0x96b3('0x34')],_0x244020[_0x96b3('0xe')]);});_0x225162=_0x225162[_0x96b3('0x35')];}_0x1f8f2c[_0x96b3('0x30')]=_[_0x96b3('0x36')](_0x1f8f2c[_0x96b3('0x30')],{'$or':_['map'](_0x4825d2,function(_0x32b3c9){if(_0x32b3c9[_0x96b3('0x37')]!==_0x96b3('0x38')){if(_0x1a384c){return sequelize['where'](sequelize['fn'](_0x96b3('0x39'),sequelize[_0x96b3('0x17')](_0x32b3c9[_0x96b3('0xe')])),{'$like':sequelize['fn'](_0x96b3('0x39'),'%'+_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x31')]+'%')});}else{var _0x3cd871={};_0x3cd871[_0x32b3c9[_0x96b3('0xe')]]={'$like':'%'+_0x5873ee[_0x96b3('0x2a')][_0x96b3('0x31')]+'%'};return _0x3cd871;}}})});}_0x1f8f2c=_['merge']({},_0x1f8f2c,_0x5873ee[_0x96b3('0x3a')]);return _0x1f8f2c;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index de53861..b4d549b 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4313=['openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','jayson/promise','http','client','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','pause','busy','getAgentStatus','startCase','Queue','map','findOne','then','getAgents','all','flatten','uniq','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','getUpdatedSortOptions','substring','indexOf','internal','validateSortParameter','sort','toLowerCase','pauseType','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus'];(function(_0x1e6c62,_0x65e0ee){var _0x497c62=function(_0x26f769){while(--_0x26f769){_0x1e6c62['push'](_0x1e6c62['shift']());}};_0x497c62(++_0x65e0ee);}(_0x4313,0x6a));var _0x3431=function(_0x3f2bbe,_0x2cd704){_0x3f2bbe=_0x3f2bbe-0x0;var _0x24b363=_0x4313[_0x3f2bbe];return _0x24b363;};'use strict';var _=require('lodash');var jayson=require(_0x3431('0x0'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x3431('0x1')]({'port':0x232a});var routingClient=jayson[_0x3431('0x2')][_0x3431('0x1')]({'port':0x232c});function isAgentPaused(_0x79892d,_0x34f49a){var _0x57bf39=[_0x79892d[_0x3431('0x3')],_0x79892d['faxPause'],_0x79892d[_0x3431('0x4')],_0x79892d[_0x3431('0x5')],_0x79892d[_0x3431('0x6')],_0x79892d[_0x3431('0x7')],_0x79892d[_0x3431('0x8')]];if(!_0x34f49a)return _[_0x3431('0x9')](_0x57bf39);var _0x355dba=_[_0x3431('0xa')](_0x57bf39);return _0x355dba[_0x3431('0xb')]>0x0&&_0x355dba['length']<_0x57bf39['length']?!![]:![];}function isIdle(_0x4aaac3){return _0x4aaac3===_0x3431('0xc')||_0x4aaac3===_0x3431('0xd')||_0x4aaac3===_0x3431('0xe')||_0x4aaac3==='ringing'||_[_0x3431('0xf')](_0x4aaac3);}function isAgentIdle(_0x32eab9){if(_0x32eab9[_0x3431('0x10')]!==_0x3431('0xc')&&_0x32eab9[_0x3431('0x7')]){_0x32eab9[_0x3431('0x10')]='pause';return![];}return _[_0x3431('0x9')]([_0x32eab9['chatStatus'],_0x32eab9[_0x3431('0x11')],_0x32eab9['mailStatus'],_0x32eab9[_0x3431('0x12')],_0x32eab9[_0x3431('0x13')],_0x32eab9['voiceStatus'],_0x32eab9[_0x3431('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x3431('0x15')](_0x3431('0x16'),{})['then'](function(_0x257086){if(_0x257086[_0x3431('0x17')]){throw new Error(_0x3431('0x18'));}var _0x80446e=_0x257086[_0x3431('0x19')];return routingClient[_0x3431('0x15')](_0x3431('0x16'),{})['then'](function(_0x590b1c){if(_0x590b1c[_0x3431('0x17')]){throw new Error(_0x3431('0x1a'));}var _0x3dc7ec=_0x590b1c[_0x3431('0x19')];return _['merge']({},_0x80446e,_0x3dc7ec);});})[_0x3431('0x1b')](function(_0x3d34c5){throw _0x3d34c5;});}exports[_0x3431('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x177014){var _0x21fa40=_0x3431('0xd');if(isAgentPaused(_0x177014))_0x21fa40=_0x3431('0x1d');else if(isAgentPaused(_0x177014,!![]))_0x21fa40='*pause';else if(isAgentIdle(_0x177014))_0x21fa40='idle';else _0x21fa40=_0x3431('0x1e');return _0x21fa40;}exports[_0x3431('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x23be4c,_0x20c26b){var _0x43f187=_['isArray'](_0x23be4c)?_0x23be4c:[_0x23be4c];var _0x83915a=_[_0x3431('0x20')](_0x20c26b)+_0x3431('0x21');var _0x3c3ec5=_[_0x3431('0x22')](_0x43f187,function(_0x1e7d18){return db[_0x83915a][_0x3431('0x23')]({'where':{'id':_0x1e7d18}})[_0x3431('0x24')](function(_0x26c5cf){if(!_0x26c5cf)return[];return _0x26c5cf[_0x3431('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x3431('0x26')](_0x3c3ec5)[_0x3431('0x24')](function(_0x5e03c6){var _0x46b650=_(_0x5e03c6)[_0x3431('0x27')]()[_0x3431('0x22')]('id')[_0x3431('0x28')]()['value']();return _0x46b650;});}exports[_0x3431('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x2e655d,_0x5507c5,_0xa86bd0){try{if(_0x5507c5[_0x3431('0xb')]>0x0){_0x2e655d=_0x2e655d[_0x3431('0xa')](function(_0x106fec){return _0x5507c5[_0x3431('0x2a')](_0x106fec['id']);});}var _0x1de19a=_0x2e655d[_0x3431('0xa')](function(_0x15ce48){var _0x1835a2=_0x3431('0x1e');if(isAgentIdle(_0x15ce48)){_0x1835a2=_0x3431('0xc');}return _0x1835a2===_0xa86bd0;});return _[_0x3431('0x22')](_0x1de19a,'id');}catch(_0x4a2c81){throw _0x4a2c81;}}exports[_0x3431('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x308db5,_0x158c7f,_0x4ecfcd){return Promise[_0x3431('0x2c')]()['then'](function(){if(_0x158c7f[_0x3431('0xb')]>0x0){_0x308db5=_0x308db5[_0x3431('0xa')](function(_0x34cbad){return _0x158c7f[_0x3431('0x2a')](_0x34cbad['id']);});}return _0x308db5;})[_0x3431('0x24')](function(){return db[_0x3431('0x2d')][_0x3431('0x2e')]({'attributes':['id',_0x3431('0x2f'),_0x3431('0x30'),_0x3431('0x3'),'faxPause',_0x3431('0x4'),_0x3431('0x5'),_0x3431('0x6'),'voicePause',_0x3431('0x8'),'pauseType'],'where':{'id':{'$in':_[_0x3431('0x22')](_0x308db5,'id')}},'raw':!![]});})[_0x3431('0x24')](function(_0x47e9c8){return _0x47e9c8[_0x3431('0x22')](function(_0x33bfb9){var _0x5aca4c=_[_0x3431('0x31')](_0x308db5,['id',_0x33bfb9['id']]);var _0x55377c=filterAgentAttributes(_0x5aca4c);_[_0x3431('0x32')](_0x33bfb9,_0x55377c);_0x33bfb9[_0x3431('0x33')]=getAgentStatus(_0x33bfb9);return _0x33bfb9;});})[_0x3431('0x24')](function(_0x58c21d){var _0xabfcf=sortAgentsByStatus(_0x58c21d,_0x4ecfcd);return _[_0x3431('0x22')](_0xabfcf,'id');})[_0x3431('0x1b')](function(_0x1885cf){throw _0x1885cf;});}exports[_0x3431('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x574795){var _0x48be73={'fields':[],'order':null};var _0x1c5982=_0x574795[_0x3431('0x35')](',');_0x48be73[_0x3431('0x36')]=_[_0x3431('0xa')](_0x1c5982,function(_0x3eb8c3){if(!_0x3eb8c3[_0x3431('0x2a')](_0x3431('0x33'))){return!![];}_0x48be73['order']=_[_0x3431('0x37')](_0x3eb8c3,'-')?_0x3431('0x38'):'ASC';return![];});return _0x48be73;}exports[_0x3431('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x42349c){if(_0x42349c[_0x3431('0x2a')](_0x3431('0x30'))&&!_0x42349c['includes']('internal')){var _0x43551f=_0x42349c[_0x3431('0x3a')](0x0,_0x42349c[_0x3431('0x3b')](_0x3431('0x30')));_0x42349c+=','+_0x43551f+_0x3431('0x3c');}return _0x42349c;}exports[_0x3431('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x9f2e99,_0x115737){var _0x19084e=_0x9f2e99[_0x3431('0x3e')](function(_0x4f9d7c,_0x58f9f3){if(_0x4f9d7c[_0x3431('0x33')]===_0x58f9f3[_0x3431('0x33')]){if(_0x4f9d7c['globalStatus']==='pause'){if(_0x115737===_0x3431('0x38')){return(_0x4f9d7c['pauseType']||'')<(_0x58f9f3['pauseType']||'')||_0x4f9d7c[_0x3431('0x30')][_0x3431('0x3f')]()>_0x58f9f3[_0x3431('0x30')][_0x3431('0x3f')]()?0x1:-0x1;}else{return(_0x4f9d7c[_0x3431('0x40')]||'')<(_0x58f9f3['pauseType']||'')||_0x4f9d7c[_0x3431('0x30')][_0x3431('0x3f')]()>_0x58f9f3[_0x3431('0x30')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x115737===_0x3431('0x38')){return _0x4f9d7c['fullname'][_0x3431('0x3f')]()<_0x58f9f3[_0x3431('0x30')][_0x3431('0x3f')]()?0x1:-0x1;}else{return _0x4f9d7c[_0x3431('0x30')][_0x3431('0x3f')]()<_0x58f9f3[_0x3431('0x30')][_0x3431('0x3f')]()?-0x1:0x1;}}}else{if(_0x115737===_0x3431('0x38')){return _0x4f9d7c['globalStatus']<_0x58f9f3[_0x3431('0x33')]?0x1:-0x1;}else{return _0x4f9d7c['globalStatus']<_0x58f9f3[_0x3431('0x33')]?-0x1:0x1;}}});return _0x19084e;}exports[_0x3431('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0xd175ae){var _0x42c392=[_0x3431('0x42'),_0x3431('0x43'),_0x3431('0x44'),_0x3431('0x45'),_0x3431('0x40'),'lastPauseAt',_0x3431('0x3c'),_0x3431('0x46'),_0x3431('0x3'),_0x3431('0x5'),_0x3431('0x4'),_0x3431('0x6'),_0x3431('0x8'),_0x3431('0x47'),_0x3431('0x7'),_0x3431('0x48'),_0x3431('0x49'),_0x3431('0x4a'),'smsCapacity','whatsappCapacity',_0x3431('0x4b'),_0x3431('0x4c'),_0x3431('0x4d'),_0x3431('0x4e'),_0x3431('0x4f'),'whatsappCurrentCapacity',_0x3431('0x50'),'chatStatus',_0x3431('0x12'),_0x3431('0x51'),_0x3431('0x13'),_0x3431('0x14'),'faxStatus',_0x3431('0x10'),'chatStatusTime',_0x3431('0x52'),_0x3431('0x53'),_0x3431('0x54'),'whatsappStatusTime',_0x3431('0x55'),_0x3431('0x56'),'queue',_0x3431('0x57'),'screenrecording',_0x3431('0x58'),_0x3431('0x59'),_0x3431('0x5a')];var _0x21b233=[_0x3431('0x3'),_0x3431('0x5'),_0x3431('0x4'),_0x3431('0x6'),'whatsappPause','faxPause',_0x3431('0x7'),_0x3431('0x43')];var _0x1dd9ab=_(_0xd175ae)[_0x3431('0x5b')](_0x21b233)[_0x3431('0x5c')](_0x42c392)['value']();return _0x1dd9ab;}exports[_0x3431('0x5d')]=filterAgentAttributes; \ No newline at end of file +var _0xc82d=['toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','voicePause','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','internal','substring','indexOf','sort','pauseType'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc82d,0x1ac));var _0xdc82=function(_0x402dfe,_0x143d24){_0x402dfe=_0x402dfe-0x0;var _0x521b9a=_0xc82d[_0x402dfe];return _0x521b9a;};'use strict';var _=require(_0xdc82('0x0'));var jayson=require(_0xdc82('0x1'));var db=require(_0xdc82('0x2'))['db'];var amiClient=jayson[_0xdc82('0x3')][_0xdc82('0x4')]({'port':0x232a});var routingClient=jayson[_0xdc82('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x2ad855,_0x4d6d11){var _0x3cc8f7=[_0x2ad855[_0xdc82('0x5')],_0x2ad855[_0xdc82('0x6')],_0x2ad855[_0xdc82('0x7')],_0x2ad855[_0xdc82('0x8')],_0x2ad855[_0xdc82('0x9')],_0x2ad855['voicePause'],_0x2ad855[_0xdc82('0xa')]];if(!_0x4d6d11)return _[_0xdc82('0xb')](_0x3cc8f7);var _0x55f9ae=_[_0xdc82('0xc')](_0x3cc8f7);return _0x55f9ae['length']>0x0&&_0x55f9ae[_0xdc82('0xd')]<_0x3cc8f7[_0xdc82('0xd')]?!![]:![];}function isIdle(_0x4e70e1){return _0x4e70e1===_0xdc82('0xe')||_0x4e70e1===_0xdc82('0xf')||_0x4e70e1===_0xdc82('0x10')||_0x4e70e1===_0xdc82('0x11')||_[_0xdc82('0x12')](_0x4e70e1);}function isAgentIdle(_0x3b88a6){if(_0x3b88a6[_0xdc82('0x13')]!=='idle'&&_0x3b88a6[_0xdc82('0x14')]){_0x3b88a6['voiceStatus']=_0xdc82('0x15');return![];}return _[_0xdc82('0xb')]([_0x3b88a6['chatStatus'],_0x3b88a6[_0xdc82('0x16')],_0x3b88a6['mailStatus'],_0x3b88a6[_0xdc82('0x17')],_0x3b88a6[_0xdc82('0x18')],_0x3b88a6[_0xdc82('0x13')],_0x3b88a6[_0xdc82('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xdc82('0x1a')](_0xdc82('0x1b'),{})[_0xdc82('0x1c')](function(_0x1efefc){if(_0x1efefc[_0xdc82('0x1d')]){throw new Error(_0xdc82('0x1e'));}var _0x5b28c7=_0x1efefc['result'];return routingClient[_0xdc82('0x1a')](_0xdc82('0x1b'),{})[_0xdc82('0x1c')](function(_0x10904b){if(_0x10904b[_0xdc82('0x1d')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3a816e=_0x10904b[_0xdc82('0x1f')];return _[_0xdc82('0x20')]({},_0x5b28c7,_0x3a816e);});})[_0xdc82('0x21')](function(_0x20caee){throw _0x20caee;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x47321e){var _0x2f92b1=_0xdc82('0xf');if(isAgentPaused(_0x47321e))_0x2f92b1=_0xdc82('0x15');else if(isAgentPaused(_0x47321e,!![]))_0x2f92b1=_0xdc82('0x22');else if(isAgentIdle(_0x47321e))_0x2f92b1=_0xdc82('0xe');else _0x2f92b1=_0xdc82('0x23');return _0x2f92b1;}exports[_0xdc82('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x30c730,_0x28a86b){var _0x1e3794=_[_0xdc82('0x25')](_0x30c730)?_0x30c730:[_0x30c730];var _0x36ed1b=_[_0xdc82('0x26')](_0x28a86b)+_0xdc82('0x27');var _0x44f84b=_[_0xdc82('0x28')](_0x1e3794,function(_0x10ad5f){return db[_0x36ed1b][_0xdc82('0x29')]({'where':{'id':_0x10ad5f}})[_0xdc82('0x1c')](function(_0x18bc5d){if(!_0x18bc5d)return[];return _0x18bc5d['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xdc82('0x2a')](_0x44f84b)[_0xdc82('0x1c')](function(_0x144e5e){var _0x50d0cf=_(_0x144e5e)[_0xdc82('0x2b')]()['map']('id')[_0xdc82('0x2c')]()[_0xdc82('0x2d')]();return _0x50d0cf;});}exports[_0xdc82('0x2e')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x485033,_0x2bbdea,_0x44c0f5){try{if(_0x2bbdea[_0xdc82('0xd')]>0x0){_0x485033=_0x485033[_0xdc82('0xc')](function(_0x593b39){return _0x2bbdea[_0xdc82('0x2f')](_0x593b39['id']);});}var _0x16529f=_0x485033[_0xdc82('0xc')](function(_0x2ad589){var _0x407deb=_0xdc82('0x23');if(isAgentIdle(_0x2ad589)){_0x407deb=_0xdc82('0xe');}return _0x407deb===_0x44c0f5;});return _['map'](_0x16529f,'id');}catch(_0x4ed843){throw _0x4ed843;}}exports[_0xdc82('0x30')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5e18c4,_0x34bae5,_0xa760a9){return Promise[_0xdc82('0x31')]()[_0xdc82('0x1c')](function(){if(_0x34bae5[_0xdc82('0xd')]>0x0){_0x5e18c4=_0x5e18c4[_0xdc82('0xc')](function(_0x5a84dc){return _0x34bae5[_0xdc82('0x2f')](_0x5a84dc['id']);});}return _0x5e18c4;})[_0xdc82('0x1c')](function(){return db[_0xdc82('0x32')][_0xdc82('0x33')]({'attributes':['id',_0xdc82('0x34'),_0xdc82('0x35'),'chatPause',_0xdc82('0x6'),_0xdc82('0x7'),_0xdc82('0x8'),_0xdc82('0x9'),_0xdc82('0x14'),_0xdc82('0xa'),'pauseType'],'where':{'id':{'$in':_[_0xdc82('0x28')](_0x5e18c4,'id')}},'raw':!![]});})[_0xdc82('0x1c')](function(_0x520ff7){return _0x520ff7[_0xdc82('0x28')](function(_0x56042a){var _0x46a592=_[_0xdc82('0x36')](_0x5e18c4,['id',_0x56042a['id']]);var _0xe0bdb=filterAgentAttributes(_0x46a592);_['merge'](_0x56042a,_0xe0bdb);_0x56042a[_0xdc82('0x37')]=getAgentStatus(_0x56042a);return _0x56042a;});})[_0xdc82('0x1c')](function(_0x1699fc){var _0x300aa5=sortAgentsByStatus(_0x1699fc,_0xa760a9);return _[_0xdc82('0x28')](_0x300aa5,'id');})[_0xdc82('0x21')](function(_0x4fefa9){throw _0x4fefa9;});}exports[_0xdc82('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x359d1c){var _0x57abe9={'fields':[],'order':null};var _0x1aa309=_0x359d1c[_0xdc82('0x39')](',');_0x57abe9[_0xdc82('0x3a')]=_[_0xdc82('0xc')](_0x1aa309,function(_0x5dd4fa){if(!_0x5dd4fa[_0xdc82('0x2f')]('globalStatus')){return!![];}_0x57abe9[_0xdc82('0x3b')]=_[_0xdc82('0x3c')](_0x5dd4fa,'-')?_0xdc82('0x3d'):'ASC';return![];});return _0x57abe9;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x31e93e){if(_0x31e93e[_0xdc82('0x2f')]('fullname')&&!_0x31e93e['includes'](_0xdc82('0x3e'))){var _0x4b4e49=_0x31e93e[_0xdc82('0x3f')](0x0,_0x31e93e[_0xdc82('0x40')](_0xdc82('0x35')));_0x31e93e+=','+_0x4b4e49+_0xdc82('0x3e');}return _0x31e93e;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x180d37,_0x4b1ced){var _0x2569dd=_0x180d37[_0xdc82('0x41')](function(_0x5e5cf7,_0x2981e6){if(_0x5e5cf7[_0xdc82('0x37')]===_0x2981e6[_0xdc82('0x37')]){if(_0x5e5cf7[_0xdc82('0x37')]===_0xdc82('0x15')){if(_0x4b1ced===_0xdc82('0x3d')){return(_0x5e5cf7[_0xdc82('0x42')]||'')<(_0x2981e6[_0xdc82('0x42')]||'')||_0x5e5cf7['fullname'][_0xdc82('0x43')]()>_0x2981e6[_0xdc82('0x35')]['toLowerCase']()?0x1:-0x1;}else{return(_0x5e5cf7[_0xdc82('0x42')]||'')<(_0x2981e6[_0xdc82('0x42')]||'')||_0x5e5cf7[_0xdc82('0x35')][_0xdc82('0x43')]()>_0x2981e6[_0xdc82('0x35')][_0xdc82('0x43')]()?-0x1:0x1;}}else{if(_0x4b1ced==='DESC'){return _0x5e5cf7[_0xdc82('0x35')][_0xdc82('0x43')]()<_0x2981e6[_0xdc82('0x35')][_0xdc82('0x43')]()?0x1:-0x1;}else{return _0x5e5cf7[_0xdc82('0x35')]['toLowerCase']()<_0x2981e6[_0xdc82('0x35')][_0xdc82('0x43')]()?-0x1:0x1;}}}else{if(_0x4b1ced===_0xdc82('0x3d')){return _0x5e5cf7['globalStatus']<_0x2981e6[_0xdc82('0x37')]?0x1:-0x1;}else{return _0x5e5cf7[_0xdc82('0x37')]<_0x2981e6[_0xdc82('0x37')]?-0x1:0x1;}}});return _0x2569dd;}exports[_0xdc82('0x44')]=sortAgentsByStatus;function filterAgentAttributes(_0x59f5ae){var _0x2274b4=[_0xdc82('0x45'),'online',_0xdc82('0x46'),_0xdc82('0x47'),_0xdc82('0x42'),_0xdc82('0x47'),'internal',_0xdc82('0x48'),_0xdc82('0x5'),_0xdc82('0x8'),'mailPause','smsPause',_0xdc82('0xa'),_0xdc82('0x6'),'voicePause','chatCapacity',_0xdc82('0x49'),_0xdc82('0x4a'),_0xdc82('0x4b'),_0xdc82('0x4c'),_0xdc82('0x4d'),_0xdc82('0x4e'),_0xdc82('0x4f'),_0xdc82('0x50'),_0xdc82('0x51'),_0xdc82('0x52'),_0xdc82('0x53'),'chatStatus',_0xdc82('0x17'),_0xdc82('0x54'),_0xdc82('0x18'),_0xdc82('0x19'),_0xdc82('0x16'),'voiceStatus',_0xdc82('0x55'),_0xdc82('0x56'),_0xdc82('0x57'),'smsStatusTime','whatsappStatusTime',_0xdc82('0x58'),_0xdc82('0x59'),_0xdc82('0x5a'),_0xdc82('0x5b'),'screenrecording',_0xdc82('0x5c'),_0xdc82('0x5d'),_0xdc82('0x5e')];var _0x45fe4b=[_0xdc82('0x5'),_0xdc82('0x8'),_0xdc82('0x7'),_0xdc82('0x9'),'whatsappPause',_0xdc82('0x6'),_0xdc82('0x14'),_0xdc82('0x5f')];var _0xe84731=_(_0x59f5ae)[_0xdc82('0x60')](_0x45fe4b)[_0xdc82('0x61')](_0x2274b4)['value']();return _0xe84731;}exports[_0xdc82('0x62')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index c0684fb..e719ad8 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae87=['predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','paused','loggedInDb','available','talking','find','merge','pick','initializeQueues','jayson/promise','client','http','loggedIn','waiting','busy','invalid','onHold','ringInUse','unavailable','unknown','pTalking','originated','statusMessage','dialMethod','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit'];(function(_0x2e9e35,_0x4a8b9c){var _0xe465af=function(_0x1303fb){while(--_0x1303fb){_0x2e9e35['push'](_0x2e9e35['shift']());}};_0xe465af(++_0x4a8b9c);}(_0xae87,0xd3));var _0x7ae8=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xae87[_0x3e8cae];return _0x45c4d6;};'use strict';var _=require('lodash');var jayson=require(_0x7ae8('0x0'));var util=require('util');var amiClient=jayson[_0x7ae8('0x1')][_0x7ae8('0x2')]({'port':0x232a});var routingClient=jayson[_0x7ae8('0x1')][_0x7ae8('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x7ae8('0x3'),'paused',_0x7ae8('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0x7ae8('0x5'),'inUse',_0x7ae8('0x6'),'loggedInDb','notInUse',_0x7ae8('0x7'),'ringing',_0x7ae8('0x8'),'talking',_0x7ae8('0x9'),_0x7ae8('0xa')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7ae8('0xb'),_0x7ae8('0xc'),'message',_0x7ae8('0xd'),'dialActive',_0x7ae8('0xe'),'Trunk','startPredictive','startProgressive',_0x7ae8('0xf'),_0x7ae8('0x10'),_0x7ae8('0x11'),_0x7ae8('0x12'),_0x7ae8('0x13'),_0x7ae8('0x14'),'dialPredictiveIntervalMinThreshold',_0x7ae8('0x15'),'predictiveIntervalTotalCalls',_0x7ae8('0x16'),'predictiveIntervalDroppedCallsTimeout',_0x7ae8('0x17'),_0x7ae8('0x18'),_0x7ae8('0x19')];function getRealtimeQueues(_0x5d4805,_0x1049b3){var _0x510818=_0x1049b3===_0x7ae8('0x1a')?amiClient:routingClient;return _0x510818[_0x7ae8('0x1b')](_['startCase'](_0x1049b3)+'Queues',_0x5d4805)[_0x7ae8('0x1c')](function(_0x348f50){if(_0x348f50[_0x7ae8('0x1d')])throw new Error(util[_0x7ae8('0x1e')](_0x7ae8('0x1f'),_0x1049b3));return _0x348f50[_0x7ae8('0x20')];})[_0x7ae8('0x21')](function(_0x199ac8){throw _0x199ac8;});}exports[_0x7ae8('0x22')]=getRealtimeQueues;function initializeQueues(_0x282414,_0xdbcecf,_0x5a9607,_0x55ea33){var _0x57cca2=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5a9607===_0x7ae8('0x1a')){if(_0x55ea33===_0x7ae8('0x23')){_0x57cca2=_0x57cca2[_0x7ae8('0x24')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x55ea33===_0x7ae8('0x25')){_0x57cca2=_0x57cca2[_0x7ae8('0x24')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x282414[_0x7ae8('0x26')](function(_0x42e547){var _0x3dde26=_0x42e547['get']({'plain':!![]});_0x3dde26[_0x7ae8('0x27')]=0x0;_0x3dde26[_0x7ae8('0x28')]=0x0;_0x3dde26[_0x7ae8('0x3')]=0x0;_0x3dde26[_0x7ae8('0x29')]=0x0;_0x3dde26[_0x7ae8('0x4')]=0x0;if(_0x5a9607===_0x7ae8('0x1a')){_0x3dde26[_0x7ae8('0x2a')]=0x0;_0x3dde26[_0x7ae8('0x5')]=0x0;if(_0x55ea33===_0x7ae8('0x25')){_0x3dde26[_0x7ae8('0xb')]=0x0;_0x3dde26['originated']=0x0;}}var _0x9ac817=_[_0x7ae8('0x2b')](_0xdbcecf,['id',_0x3dde26['id']]);if(_0x9ac817){_[_0x7ae8('0x2c')](_0x3dde26,_[_0x7ae8('0x2d')](_0x9ac817,_0x57cca2));}return _0x3dde26;});}exports[_0x7ae8('0x2e')]=initializeQueues; \ No newline at end of file +var _0x538d=['Trunk','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','inbound','concat','outbound','map','get','loggedIn','talking','find','merge','pick','jayson/promise','client','http','available','paused','waiting','busy','inUse','loggedInDb','onHold','ringing','pTalking','originated','message','statusMessage','dialMethod'];(function(_0x2d06bd,_0x1d90dc){var _0x4d466c=function(_0x4f9ea4){while(--_0x4f9ea4){_0x2d06bd['push'](_0x2d06bd['shift']());}};_0x4d466c(++_0x1d90dc);}(_0x538d,0x104));var _0xd538=function(_0x35227a,_0x2667f5){_0x35227a=_0x35227a-0x0;var _0x2a2812=_0x538d[_0x35227a];return _0x2a2812;};'use strict';var _=require('lodash');var jayson=require(_0xd538('0x0'));var util=require('util');var amiClient=jayson[_0xd538('0x1')][_0xd538('0x2')]({'port':0x232a});var routingClient=jayson[_0xd538('0x1')][_0xd538('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd538('0x3'),'loggedIn',_0xd538('0x4'),_0xd538('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0xd538('0x6'),_0xd538('0x7'),'invalid',_0xd538('0x8'),'notInUse',_0xd538('0x9'),_0xd538('0xa'),'ringInUse','talking','unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xd538('0xb'),_0xd538('0xc'),_0xd538('0xd'),_0xd538('0xe'),'dialActive',_0xd538('0xf'),_0xd538('0x10'),'startPredictive','startProgressive',_0xd538('0x11'),'erlangCallToSecond',_0xd538('0x12'),_0xd538('0x13'),'dialPredictiveInterval',_0xd538('0x14'),_0xd538('0x15'),'predictiveIntervalAvailable',_0xd538('0x16'),_0xd538('0x17'),'predictiveIntervalDroppedCallsTimeout',_0xd538('0x18'),_0xd538('0x19'),_0xd538('0x1a')];function getRealtimeQueues(_0x33511e,_0x4d5c5f){var _0x47f59c=_0x4d5c5f===_0xd538('0x1b')?amiClient:routingClient;return _0x47f59c[_0xd538('0x1c')](_[_0xd538('0x1d')](_0x4d5c5f)+_0xd538('0x1e'),_0x33511e)[_0xd538('0x1f')](function(_0x291fa1){if(_0x291fa1[_0xd538('0x20')])throw new Error(util[_0xd538('0x21')](_0xd538('0x22'),_0x4d5c5f));return _0x291fa1[_0xd538('0x23')];})['catch'](function(_0x1639e7){throw _0x1639e7;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x440c9a,_0x1230f0,_0x1dbe8c,_0x3f84c7){var _0x578d99=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1dbe8c==='voice'){if(_0x3f84c7===_0xd538('0x24')){_0x578d99=_0x578d99[_0xd538('0x25')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3f84c7===_0xd538('0x26')){_0x578d99=_0x578d99['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x440c9a[_0xd538('0x27')](function(_0x67039b){var _0x2e82ee=_0x67039b[_0xd538('0x28')]({'plain':!![]});_0x2e82ee[_0xd538('0x4')]=0x0;_0x2e82ee[_0xd538('0x8')]=0x0;_0x2e82ee[_0xd538('0x29')]=0x0;_0x2e82ee[_0xd538('0x3')]=0x0;_0x2e82ee[_0xd538('0x5')]=0x0;if(_0x1dbe8c===_0xd538('0x1b')){_0x2e82ee[_0xd538('0x2a')]=0x0;_0x2e82ee[_0xd538('0x6')]=0x0;if(_0x3f84c7===_0xd538('0x26')){_0x2e82ee[_0xd538('0xb')]=0x0;_0x2e82ee[_0xd538('0xc')]=0x0;}}var _0xb1230a=_[_0xd538('0x2b')](_0x1230f0,['id',_0x2e82ee['id']]);if(_0xb1230a){_[_0xd538('0x2c')](_0x2e82ee,_[_0xd538('0x2d')](_0xb1230a,_0x578d99));}return _0x2e82ee;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index dc6dcb1..4691454 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x51fd25,_0x2fcbb){var _0x4529ae=function(_0x17ed81){while(--_0x17ed81){_0x51fd25['push'](_0x51fd25['shift']());}};_0x4529ae(++_0x2fcbb);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 968c0ae..f3f7b23 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 _0x89c0=['internal','concat','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','hex','getUuid','licenseToken','test','win32','utf8','replace','ipAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','orderBy','keys','length','family','IPv4'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x89c0,0x164));var _0x089c=function(_0x4ea0f5,_0x112a50){_0x4ea0f5=_0x4ea0f5-0x0;var _0x1c7f4d=_0x89c0[_0x4ea0f5];return _0x1c7f4d;};'use strict';var _=require(_0x089c('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x089c('0x1'));var exec=require(_0x089c('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x42b080=[];var _0x3df623=os['networkInterfaces']();var _0x25c96c=_[_0x089c('0x3')](_[_0x089c('0x4')](_0x3df623));for(var _0x48c2b8=0x0;_0x48c2b8<_0x25c96c[_0x089c('0x5')];_0x48c2b8++){var _0x22f465=_0x3df623[_0x25c96c[_0x48c2b8]]['filter'](function(_0x37081c){return _0x37081c[_0x089c('0x6')]===_0x089c('0x7')&&_0x37081c[_0x089c('0x8')]===![];});_0x42b080=_0x42b080[_0x089c('0x9')](_0x22f465);}return _0x42b080;}function getFirstInterface(){var _0x26f88d=_['head'](getInterfaces());return{'macAddress':_0x26f88d&&_0x26f88d['mac']?_0x26f88d['mac']:'00:00:00:00:00:00','ipAddress':_0x26f88d&&_0x26f88d[_0x089c('0xa')]?_0x26f88d[_0x089c('0xa')]:_0x089c('0xb')};}exports[_0x089c('0xc')]=getFirstInterface;function getCPUhash(){var _0x3102e7=_['orderBy'](os[_0x089c('0xd')]()[_0x089c('0xe')](function(_0xb214e6){return _0xb214e6['model'];}))[_0x089c('0xf')](':');return crypto[_0x089c('0x10')](_0x089c('0x11'))['update'](_0x3102e7)['digest'](_0x089c('0x12'));}exports[_0x089c('0x13')]=function(){var _0x4d5019=os['platform']();var _0x154829=/[0-9a-f-]{36}/;if(config[_0x089c('0x14')]&&_0x154829[_0x089c('0x15')](config[_0x089c('0x14')])){return config[_0x089c('0x14')];}else if(_0x4d5019===_0x089c('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x089c('0x17')})[_0x089c('0x18')]('\x0d\x0a','');}else{var _0x591ec0=getFirstInterface();var _0x9639b6=getCPUhash();var _0x1c391d=_0x9639b6+'|'+os['hostname']()+'|'+_0x591ec0['macAddress']+'|'+_0x591ec0[_0x089c('0x19')];var _0x1f7d8c=crypto[_0x089c('0x10')](_0x089c('0x11'))['update'](_0x1c391d)[_0x089c('0x1a')](_0x089c('0x12'));return _0x1f7d8c[_0x089c('0x1b')](0x0,0x8)+'-'+_0x1f7d8c['substring'](0x8,0xc)+'-'+_0x1f7d8c[_0x089c('0x1b')](0xc,0x10)+'-'+_0x1f7d8c[_0x089c('0x1b')](0x10,0x14)+'-'+_0x1f7d8c[_0x089c('0x1b')](0x14);}}; \ No newline at end of file +var _0xf886=['join','createHash','md5','update','hex','getUuid','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','digest','substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','internal','concat','head','mac','address','127.0.0.1','map'];(function(_0x511b83,_0x2e3f20){var _0x35ed02=function(_0x1a2597){while(--_0x1a2597){_0x511b83['push'](_0x511b83['shift']());}};_0x35ed02(++_0x2e3f20);}(_0xf886,0xcf));var _0x6f88=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xf886[_0x2a0738];return _0x159679;};'use strict';var _=require(_0x6f88('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x6f88('0x1'));var exec=require(_0x6f88('0x2'))[_0x6f88('0x3')];var config=require(_0x6f88('0x4'));function getInterfaces(){var _0x54f988=[];var _0x421ca8=os[_0x6f88('0x5')]();var _0x29e73e=_[_0x6f88('0x6')](_[_0x6f88('0x7')](_0x421ca8));for(var _0x42c56c=0x0;_0x42c56c<_0x29e73e[_0x6f88('0x8')];_0x42c56c++){var _0x2a1791=_0x421ca8[_0x29e73e[_0x42c56c]]['filter'](function(_0x260281){return _0x260281['family']===_0x6f88('0x9')&&_0x260281[_0x6f88('0xa')]===![];});_0x54f988=_0x54f988[_0x6f88('0xb')](_0x2a1791);}return _0x54f988;}function getFirstInterface(){var _0x6668b3=_[_0x6f88('0xc')](getInterfaces());return{'macAddress':_0x6668b3&&_0x6668b3[_0x6f88('0xd')]?_0x6668b3[_0x6f88('0xd')]:'00:00:00:00:00:00','ipAddress':_0x6668b3&&_0x6668b3[_0x6f88('0xe')]?_0x6668b3['address']:_0x6f88('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x1e6276=_[_0x6f88('0x6')](os['cpus']()[_0x6f88('0x10')](function(_0x36f05c){return _0x36f05c['model'];}))[_0x6f88('0x11')](':');return crypto[_0x6f88('0x12')](_0x6f88('0x13'))[_0x6f88('0x14')](_0x1e6276)['digest'](_0x6f88('0x15'));}exports[_0x6f88('0x16')]=function(){var _0x4b6edc=os['platform']();var _0x45dbdc=/[0-9a-f-]{36}/;if(config[_0x6f88('0x17')]&&_0x45dbdc[_0x6f88('0x18')](config[_0x6f88('0x17')])){return config[_0x6f88('0x17')];}else if(_0x4b6edc===_0x6f88('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x6f88('0x1a')]('\x0d\x0a','');}else{var _0x274f1f=getFirstInterface();var _0x44279b=getCPUhash();var _0x5d624b=_0x44279b+'|'+os[_0x6f88('0x1b')]()+'|'+_0x274f1f[_0x6f88('0x1c')]+'|'+_0x274f1f[_0x6f88('0x1d')];var _0x1a7cb1=crypto[_0x6f88('0x12')](_0x6f88('0x13'))[_0x6f88('0x14')](_0x5d624b)[_0x6f88('0x1e')](_0x6f88('0x15'));return _0x1a7cb1[_0x6f88('0x1f')](0x0,0x8)+'-'+_0x1a7cb1[_0x6f88('0x1f')](0x8,0xc)+'-'+_0x1a7cb1[_0x6f88('0x1f')](0xc,0x10)+'-'+_0x1a7cb1[_0x6f88('0x1f')](0x10,0x14)+'-'+_0x1a7cb1[_0x6f88('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 9a69228..0dd3ea8 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 _0x44cb=['moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x44cb,0x155));var _0xb44c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x44cb[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xb44c('0x0'));var moment=require(_0xb44c('0x1'));var rp=require(_0xb44c('0x2'));var BPromise=require(_0xb44c('0x3'));var pkginfo=require('pkginfo')(module,_0xb44c('0x4'));var db=require(_0xb44c('0x5'))['db'];var encryptor=require(_0xb44c('0x6'));var hardware=require(_0xb44c('0x7'));var logger=require(_0xb44c('0x8'))(_0xb44c('0x9'));var HOST=_0xb44c('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5a4614){return new BPromise(function(_0xf4f353,_0x50ad44){var _0xa39e65=util[_0xb44c('0xb')](_0xb44c('0xc'),HOST,_0x5a4614,module[_0xb44c('0xd')][_0xb44c('0x4')]);if(oldToken){_0xa39e65=util[_0xb44c('0xb')](_0xb44c('0xe'),HOST,_0x5a4614,module[_0xb44c('0xd')]['version'],oldToken);}var _0x5f4674={'uri':_0xa39e65,'method':_0xb44c('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x5f4674)[_0xb44c('0x10')](function(_0x344026){_0xf4f353(_0x344026);})[_0xb44c('0x11')](function(_0x5bf5a8){_0x50ad44(_0x5bf5a8);});});}function manageLicense(_0x738660,_0x25d369){var _0x308dc1=_0x25d369[_0xb44c('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x308dc1[_0xb44c('0x13')]!==_0x738660&&!_0x308dc1[_0xb44c('0x14')]){oldToken=_0x308dc1['data1'];}httpRequest(_0x738660)['then'](function(_0x31fb20){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x31fb20[_0xb44c('0x15')]){isOldTokenSent=![];if(!_0x308dc1[_0xb44c('0x9')]&&_0x308dc1[_0xb44c('0x9')]!=_0x31fb20['license']||_0x308dc1[_0xb44c('0x9')]&&_0x308dc1[_0xb44c('0x14')]){logger[_0xb44c('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x308dc1[_0xb44c('0x9')]&&!_0x308dc1[_0xb44c('0x14')]&&_0x308dc1[_0xb44c('0x9')]!=_0x31fb20[_0xb44c('0x9')]){logger[_0xb44c('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x308dc1[_0xb44c('0x9')]&&!_0x308dc1['data2']&&_0x308dc1['license']==_0x31fb20['license']){return _0x25d369;}return _0x25d369[_0xb44c('0x17')]({'data1':_0x738660,'data2':null,'license':_0x31fb20[_0xb44c('0x9')]});}else{if(_0x31fb20['license']||_0x308dc1[_0xb44c('0x9')]){if(!_0x308dc1[_0xb44c('0x14')]){if(_0x308dc1['data1']==_0x738660){GRAY_PERIOD_REASON='Disabled';logger[_0xb44c('0x16')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xb44c('0x18');logger[_0xb44c('0x16')](_0xb44c('0x19'),_0x308dc1[_0xb44c('0x13')],_0x738660);}logger[_0xb44c('0x16')](_0xb44c('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xb44c('0x1b')));return _0x25d369[_0xb44c('0x17')]({'data2':encryptor[_0xb44c('0x1c')](moment()['format'](_0xb44c('0x1b')))});}else{if(moment()[_0xb44c('0x1d')](encryptor[_0xb44c('0x1e')](_0x308dc1['data2']),_0xb44c('0x1f'))>DAYS){logger['info'](_0xb44c('0x20'),moment()['format'](_0xb44c('0x1b')));isOldTokenSent=![];return _0x25d369['update']({'data1':_0x738660,'data2':null,'license':null});}}}else{if(_0x308dc1[_0xb44c('0x13')]!=_0x738660){logger[_0xb44c('0x16')](_0xb44c('0x19'),_0x308dc1[_0xb44c('0x13')],_0x738660);return _0x25d369[_0xb44c('0x17')]({'data1':_0x738660,'data2':null,'license':null});}}}return _0x25d369;})[_0xb44c('0x10')](function(_0x523c78){_0x25d369=_0x523c78;})['catch'](function(_0x59e2bf){logger[_0xb44c('0x21')](_0x59e2bf[_0xb44c('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb44c('0x23')](),_0x25d369);},TIME);});}function defaultLicense(){var _0x50954c=hardware[_0xb44c('0x23')]();if(_0x50954c){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x50954c}})['spread'](function(_0x96360e,_0x53c6ef){logger[_0xb44c('0x16')](_0xb44c('0x24'),_0x50954c);manageLicense(_0x50954c,_0x96360e);})[_0xb44c('0x11')](function(_0x37826c){logger[_0xb44c('0x21')](_0x37826c[_0xb44c('0x22')]);});}}exports[_0xb44c('0x25')]=defaultLicense; \ No newline at end of file +var _0x5168=['./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','util','moment','request-promise','bluebird','../../mysqldb'];(function(_0x42c2f7,_0x16bbdd){var _0x55c3ae=function(_0x24502f){while(--_0x24502f){_0x42c2f7['push'](_0x42c2f7['shift']());}};_0x55c3ae(++_0x16bbdd);}(_0x5168,0xbe));var _0x8516=function(_0x183dee,_0x38ad79){_0x183dee=_0x183dee-0x0;var _0x4f60d0=_0x5168[_0x183dee];return _0x4f60d0;};'use strict';var util=require(_0x8516('0x0'));var moment=require(_0x8516('0x1'));var rp=require(_0x8516('0x2'));var BPromise=require(_0x8516('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x8516('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x8516('0x5'));var logger=require(_0x8516('0x6'))(_0x8516('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3ea564){return new BPromise(function(_0x25441a,_0x16a275){var _0x4a0a2c=util[_0x8516('0x8')](_0x8516('0x9'),HOST,_0x3ea564,module[_0x8516('0xa')][_0x8516('0xb')]);if(oldToken){_0x4a0a2c=util[_0x8516('0x8')](_0x8516('0xc'),HOST,_0x3ea564,module[_0x8516('0xa')]['version'],oldToken);}var _0x58bd9b={'uri':_0x4a0a2c,'method':_0x8516('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x58bd9b)[_0x8516('0xe')](function(_0x3c00f2){_0x25441a(_0x3c00f2);})['catch'](function(_0x1b82c0){_0x16a275(_0x1b82c0);});});}function manageLicense(_0xef8fbd,_0x495677){var _0x364425=_0x495677[_0x8516('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x364425['data1']!==_0xef8fbd&&!_0x364425['data2']){oldToken=_0x364425['data1'];}httpRequest(_0xef8fbd)[_0x8516('0xe')](function(_0x4300d8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4300d8[_0x8516('0x10')]){isOldTokenSent=![];if(!_0x364425['license']&&_0x364425[_0x8516('0x7')]!=_0x4300d8[_0x8516('0x7')]||_0x364425[_0x8516('0x7')]&&_0x364425[_0x8516('0x11')]){logger[_0x8516('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x364425['license']&&!_0x364425[_0x8516('0x11')]&&_0x364425[_0x8516('0x7')]!=_0x4300d8['license']){logger[_0x8516('0x12')](_0x8516('0x13'));}if(_0x364425[_0x8516('0x7')]&&!_0x364425[_0x8516('0x11')]&&_0x364425[_0x8516('0x7')]==_0x4300d8['license']){return _0x495677;}return _0x495677[_0x8516('0x14')]({'data1':_0xef8fbd,'data2':null,'license':_0x4300d8[_0x8516('0x7')]});}else{if(_0x4300d8['license']||_0x364425[_0x8516('0x7')]){if(!_0x364425[_0x8516('0x11')]){if(_0x364425[_0x8516('0x15')]==_0xef8fbd){GRAY_PERIOD_REASON=_0x8516('0x16');logger[_0x8516('0x12')](_0x8516('0x17'));}else{GRAY_PERIOD_REASON=_0x8516('0x18');logger[_0x8516('0x12')](_0x8516('0x19'),_0x364425[_0x8516('0x15')],_0xef8fbd);}logger[_0x8516('0x12')](_0x8516('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x8516('0x8')](_0x8516('0x1b')));return _0x495677[_0x8516('0x14')]({'data2':encryptor['encryptString'](moment()[_0x8516('0x8')](_0x8516('0x1b')))});}else{if(moment()[_0x8516('0x1c')](encryptor['decryptString'](_0x364425[_0x8516('0x11')]),'days')>DAYS){logger[_0x8516('0x12')](_0x8516('0x1d'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x495677[_0x8516('0x14')]({'data1':_0xef8fbd,'data2':null,'license':null});}}}else{if(_0x364425['data1']!=_0xef8fbd){logger[_0x8516('0x12')](_0x8516('0x19'),_0x364425[_0x8516('0x15')],_0xef8fbd);return _0x495677['update']({'data1':_0xef8fbd,'data2':null,'license':null});}}}return _0x495677;})[_0x8516('0xe')](function(_0x21b145){_0x495677=_0x21b145;})[_0x8516('0x1e')](function(_0x436136){logger[_0x8516('0x1f')](_0x436136['message']);})[_0x8516('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x8516('0x21')](),_0x495677);},TIME);});}function defaultLicense(){var _0x61c1a0=hardware[_0x8516('0x21')]();if(_0x61c1a0){return db[_0x8516('0x22')][_0x8516('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x61c1a0}})[_0x8516('0x24')](function(_0x476991,_0x4851f0){logger[_0x8516('0x12')](_0x8516('0x25'),_0x61c1a0);manageLicense(_0x61c1a0,_0x476991);})['catch'](function(_0x4ba57d){logger[_0x8516('0x1f')](_0x4ba57d[_0x8516('0x26')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 9bbd78b..9c976e2 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 _0xa53f=['./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','defaults','then','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','days','grayReason','disabled','message','User','findAll','role','sequelize','count','admin','telephone','users','forEach','catch','pick','countBy','user','License\x20limit\x20reached\x20for\x20users','util','lodash','moment','bluebird'];(function(_0x5b08c2,_0x41410f){var _0x5df3f3=function(_0x2a9073){while(--_0x2a9073){_0x5b08c2['push'](_0x5b08c2['shift']());}};_0x5df3f3(++_0x41410f);}(_0xa53f,0x7a));var _0xfa53=function(_0x1c90bc,_0x3d6e2c){_0x1c90bc=_0x1c90bc-0x0;var _0xed5f9a=_0xa53f[_0x1c90bc];return _0xed5f9a;};'use strict';var util=require(_0xfa53('0x0'));var _=require(_0xfa53('0x1'));var moment=require(_0xfa53('0x2'));var BPromise=require(_0xfa53('0x3'));var hardware=require(_0xfa53('0x4'));var encryptor=require(_0xfa53('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfa53('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xfa53('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xfa53('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xfa53('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x44f115){return new BPromise(function(_0x5c3122,_0x161ed7){return db[_0xfa53('0x8')]['find'](_[_0xfa53('0x9')](_0x44f115,{'raw':!![],'where':{'id':0x1}}))[_0xfa53('0xa')](function(_0x1f4359){return checkLicense(_0x1f4359,null);})[_0xfa53('0xa')](function(_0x5c466f){_0x5c3122(_0x5c466f);return;})['catch'](function(_0x405a0d){_0x161ed7(_0x405a0d);});});}function checkLicense(_0x361c1f,_0x5b9aca){if(!_0x361c1f){demoLicense[_0xfa53('0xb')]=_0x361c1f[_0xfa53('0xc')];return demoLicense;}try{var _0x5daa06=_0x5b9aca||_0x361c1f[_0xfa53('0xd')];if(_['isEmpty'](_0x5daa06)){throw new Error(_0xfa53('0xe'));}var _0x45927e=_0x361c1f[_0xfa53('0xc')];var _0x2e8b4c=_0x361c1f[_0xfa53('0xf')];var _0x3f1079=_0x45927e[_0xfa53('0x10')]('-')[0x4];var _0x188c80=_0x45927e[_0xfa53('0x10')]('-')[0x0];var _0x3ebbd7=encryptor[_0xfa53('0x11')](_0x5daa06,util[_0xfa53('0x12')](_0xfa53('0x13'),_0x3f1079,_0x45927e,_0x188c80));var _0x3fc2a7=JSON[_0xfa53('0x14')](_0x3ebbd7);_0x3fc2a7[_0xfa53('0x15')]=![];_0x3fc2a7[_0xfa53('0xb')]=_0x45927e;_0x3fc2a7[_0xfa53('0x16')]=hardware[_0xfa53('0x7')]();if(_0x2e8b4c){var _0x5deb0c=encryptor['decryptString'](_0x2e8b4c);_0x3fc2a7[_0xfa53('0x17')]=_0x5deb0c;_0x3fc2a7['deadline']=moment(_0x5deb0c)['add'](0x7,_0xfa53('0x18'))['format']();_0x3fc2a7[_0xfa53('0x19')]=_0x3fc2a7[_0xfa53('0xb')]!=_0x3fc2a7[_0xfa53('0x16')]?'changed':_0xfa53('0x1a');}return _0x3fc2a7;}catch(_0xa70c19){breakingLicense['uuid']=_0x361c1f[_0xfa53('0xc')];breakingLicense['message']=_0xa70c19[_0xfa53('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3df11e,_0x50bd7c){getLicense()[_0xfa53('0xa')](function(_0xa65baf){return db[_0xfa53('0x1c')][_0xfa53('0x1d')]({'attributes':[_0xfa53('0x1e'),[db[_0xfa53('0x1f')]['fn']('COUNT',db[_0xfa53('0x1f')]['col'](_0xfa53('0x1e'))),_0xfa53('0x20')]],'group':'role','where':{'role':{'$or':[_0xfa53('0x21'),'user',_0xfa53('0x22')]}},'raw':!![]})[_0xfa53('0xa')](function(_0x477479){var _0x291e2a={'user':_0xa65baf[_0xfa53('0x23')]||0x0,'telephone':_0xa65baf['telephones']||0x0};_0x477479[_0xfa53('0x24')](function(_0x4b06b2){var _0x208a5e=_0x4b06b2[_0xfa53('0x1e')]==='admin'?'user':_0x4b06b2[_0xfa53('0x1e')];_0x291e2a[_0x208a5e]-=_0x4b06b2['count'];if(_0x291e2a[_0x208a5e]<0x0)_0x291e2a[_0x208a5e]=0x0;});_0x3df11e(_0x291e2a);return;});})[_0xfa53('0x25')](function(_0x59b8a2){_0x50bd7c(_0x59b8a2);});});}function checkUserLimits(_0x1e6970){return new BPromise(function(_0x4dc21f,_0x1d8c0a){getLimits()[_0xfa53('0xa')](function(_0x560c87){var _0x5ee025=_[_0xfa53('0x26')](_[_0xfa53('0x27')](_0x1e6970,_0xfa53('0x1e')),[_0xfa53('0x21'),_0xfa53('0x28'),_0xfa53('0x22')]);var _0x4678c7=(_0x5ee025[_0xfa53('0x21')]||0x0)+(_0x5ee025[_0xfa53('0x28')]||0x0);var _0x4d7f40=_0x5ee025[_0xfa53('0x22')]||0x0;if(_0x4678c7>_0x560c87[_0xfa53('0x28')])return _0x1d8c0a(_0xfa53('0x29'));if(_0x4d7f40>_0x560c87[_0xfa53('0x22')])return _0x1d8c0a('License\x20limit\x20reached\x20for\x20telephones');return _0x4dc21f();})[_0xfa53('0x25')](function(_0x67721){_0x1d8c0a(_0x67721);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x251f=['catch','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','demo','uuid','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','role','sequelize','col','count','admin','telephone','users','telephones','forEach','user','countBy','License\x20limit\x20reached\x20for\x20users','exports','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then'];(function(_0x3d927e,_0x225448){var _0x1285a9=function(_0x2b3e31){while(--_0x2b3e31){_0x3d927e['push'](_0x3d927e['shift']());}};_0x1285a9(++_0x225448);}(_0x251f,0x156));var _0xf251=function(_0x3eb450,_0x592b0a){_0x3eb450=_0x3eb450-0x0;var _0x2c4cfd=_0x251f[_0x3eb450];return _0x2c4cfd;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xf251('0x0'));var BPromise=require(_0xf251('0x1'));var hardware=require(_0xf251('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xf251('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf251('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xf251('0x5'),'machineUuid':hardware[_0xf251('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xf251('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xf251('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5c9be2){return new BPromise(function(_0x402c69,_0x28eebf){return db['License']['find'](_[_0xf251('0x8')](_0x5c9be2,{'raw':!![],'where':{'id':0x1}}))[_0xf251('0x9')](function(_0x117533){return checkLicense(_0x117533,null);})[_0xf251('0x9')](function(_0xcb5fcb){_0x402c69(_0xcb5fcb);return;})[_0xf251('0xa')](function(_0x27b576){_0x28eebf(_0x27b576);});});}function checkLicense(_0x3edc6f,_0x58bbe6){if(!_0x3edc6f){demoLicense['uuid']=_0x3edc6f[_0xf251('0xb')];return demoLicense;}try{var _0x2a74a4=_0x58bbe6||_0x3edc6f[_0xf251('0xc')];if(_[_0xf251('0xd')](_0x2a74a4)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x416eb2=_0x3edc6f[_0xf251('0xb')];var _0x426e51=_0x3edc6f[_0xf251('0xe')];var _0x290316=_0x416eb2[_0xf251('0xf')]('-')[0x4];var _0x50209c=_0x416eb2[_0xf251('0xf')]('-')[0x0];var _0x198f33=encryptor[_0xf251('0x10')](_0x2a74a4,util[_0xf251('0x11')](_0xf251('0x12'),_0x290316,_0x416eb2,_0x50209c));var _0xe46a56=JSON['parse'](_0x198f33);_0xe46a56[_0xf251('0x13')]=![];_0xe46a56[_0xf251('0x14')]=_0x416eb2;_0xe46a56['machineUuid']=hardware[_0xf251('0x6')]();if(_0x426e51){var _0x43908b=encryptor[_0xf251('0x10')](_0x426e51);_0xe46a56[_0xf251('0x15')]=_0x43908b;_0xe46a56[_0xf251('0x16')]=moment(_0x43908b)[_0xf251('0x17')](0x7,_0xf251('0x18'))[_0xf251('0x11')]();_0xe46a56[_0xf251('0x19')]=_0xe46a56['uuid']!=_0xe46a56[_0xf251('0x1a')]?_0xf251('0x1b'):_0xf251('0x1c');}return _0xe46a56;}catch(_0x24032b){breakingLicense[_0xf251('0x14')]=_0x3edc6f[_0xf251('0xb')];breakingLicense['message']=_0x24032b[_0xf251('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x47fa11,_0x2a553a){getLicense()[_0xf251('0x9')](function(_0x47f020){return db[_0xf251('0x1e')]['findAll']({'attributes':[_0xf251('0x1f'),[db[_0xf251('0x20')]['fn']('COUNT',db[_0xf251('0x20')][_0xf251('0x21')]('role')),_0xf251('0x22')]],'group':'role','where':{'role':{'$or':[_0xf251('0x23'),'user',_0xf251('0x24')]}},'raw':!![]})['then'](function(_0x368f65){var _0x1495e9={'user':_0x47f020[_0xf251('0x25')]||0x0,'telephone':_0x47f020[_0xf251('0x26')]||0x0};_0x368f65[_0xf251('0x27')](function(_0x4b0794){var _0x58a51c=_0x4b0794[_0xf251('0x1f')]==='admin'?_0xf251('0x28'):_0x4b0794['role'];_0x1495e9[_0x58a51c]-=_0x4b0794['count'];if(_0x1495e9[_0x58a51c]<0x0)_0x1495e9[_0x58a51c]=0x0;});_0x47fa11(_0x1495e9);return;});})[_0xf251('0xa')](function(_0xba38af){_0x2a553a(_0xba38af);});});}function checkUserLimits(_0x36254e){return new BPromise(function(_0x1ba315,_0xfda966){getLimits()['then'](function(_0x5aea90){var _0x3280f8=_['pick'](_[_0xf251('0x29')](_0x36254e,_0xf251('0x1f')),[_0xf251('0x23'),_0xf251('0x28'),_0xf251('0x24')]);var _0x10363c=(_0x3280f8['admin']||0x0)+(_0x3280f8[_0xf251('0x28')]||0x0);var _0x52f9a0=_0x3280f8[_0xf251('0x24')]||0x0;if(_0x10363c>_0x5aea90[_0xf251('0x28')])return _0xfda966(_0xf251('0x2a'));if(_0x52f9a0>_0x5aea90[_0xf251('0x24')])return _0xfda966('License\x20limit\x20reached\x20for\x20telephones');return _0x1ba315();})[_0xf251('0xa')](function(_0xddf1ae){_0xfda966(_0xddf1ae);});});}module[_0xf251('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index cf67311..2e418cc 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 _0x1eba=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x59b8f9,_0x4d00c8){var _0x3cb01d=function(_0x581b96){while(--_0x581b96){_0x59b8f9['push'](_0x59b8f9['shift']());}};_0x3cb01d(++_0x4d00c8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x1eba[_0x562362];return _0x3a18ce;};'use strict';module[_0xa1eb('0x0')]={'DOMAIN':_0xa1eb('0x1'),'SESSION_SECRET':_0xa1eb('0x2'),'GOOGLE_ID':_0xa1eb('0x3'),'GOOGLE_SECRET':_0xa1eb('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x1893=['myappanuglar-secret','app-id','secret'];(function(_0x483ba6,_0x70851b){var _0x45b9f3=function(_0x376404){while(--_0x376404){_0x483ba6['push'](_0x483ba6['shift']());}};_0x45b9f3(++_0x70851b);}(_0x1893,0xa2));var _0x3189=function(_0x2d0ef5,_0x5621a4){_0x2d0ef5=_0x2d0ef5-0x0;var _0x550979=_0x1893[_0x2d0ef5];return _0x550979;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x3189('0x0'),'GOOGLE_ID':_0x3189('0x1'),'GOOGLE_SECRET':_0x3189('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 0e4679c..7e4c546 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc43e=['../utils/loggers'];(function(_0x3ca072,_0x96b71b){var _0x5c865f=function(_0x3889e5){while(--_0x3889e5){_0x3ca072['push'](_0x3ca072['shift']());}};_0x5c865f(++_0x96b71b);}(_0xc43e,0x19e));var _0xec43=function(_0xb8ee06,_0x4327f4){_0xb8ee06=_0xb8ee06-0x0;var _0x3b0200=_0xc43e[_0xb8ee06];return _0x3b0200;};'use strict';var fileLogger=require(_0xec43('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file +var _0x3078=['../utils/loggers','fileLogger','exports'];(function(_0x618782,_0x3ea862){var _0x4e3612=function(_0x29fbc2){while(--_0x29fbc2){_0x618782['push'](_0x618782['shift']());}};_0x4e3612(++_0x3ea862);}(_0x3078,0x141));var _0x8307=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0x3078[_0x2c3a8f];return _0x189412;};'use strict';var fileLogger=require(_0x8307('0x0'))[_0x8307('0x1')];module[_0x8307('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2db5111..05a5533 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 _0x24cc=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','join','root','ami','agi','../../services/agi/index.js','email'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x24cc,0x86));var _0xc24c=function(_0x50b1ec,_0x33e277){_0x50b1ec=_0x50b1ec-0x0;var _0x2a5e8b=_0x24cc[_0x50b1ec];return _0x2a5e8b;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0xc24c('0x0')](cfg[_0xc24c('0x1')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0xc24c('0x0')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xc24c('0x2'),'script':path[_0xc24c('0x0')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xc24c('0x3'),'script':path[_0xc24c('0x0')](__dirname,_0xc24c('0x4')),'env':env},{'name':_0xc24c('0x5'),'script':path[_0xc24c('0x0')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xc24c('0x6'),'script':path['join'](__dirname,_0xc24c('0x7')),'env':env},{'name':_0xc24c('0x8'),'script':path[_0xc24c('0x0')](__dirname,_0xc24c('0x9')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x79d9=['../../services/routing/index.js','xdr','path','resolve','join','root','legacy-libs','../../services/express/index.js','ami','agi','../../services/email/index.js','routing'];(function(_0x4b9655,_0x19c1f1){var _0x1f412e=function(_0x59bfe3){while(--_0x59bfe3){_0x4b9655['push'](_0x4b9655['shift']());}};_0x1f412e(++_0x19c1f1);}(_0x79d9,0xe6));var _0x979d=function(_0x853ff,_0x7f072b){_0x853ff=_0x853ff-0x0;var _0x9e868=_0x79d9[_0x853ff];return _0x9e868;};'use strict';var path=require(_0x979d('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x979d('0x1')](path[_0x979d('0x2')](cfg[_0x979d('0x3')],_0x979d('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x979d('0x2')](__dirname,_0x979d('0x5')),'env':env},{'name':_0x979d('0x6'),'script':path[_0x979d('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0x979d('0x7'),'script':path[_0x979d('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':'email','script':path['join'](__dirname,_0x979d('0x8')),'env':env},{'name':_0x979d('0x9'),'script':path[_0x979d('0x2')](__dirname,_0x979d('0xa')),'env':env},{'name':_0x979d('0xb'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f14959b..e5de0c1 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 _0x58e0=['delete','dump','saved','./config','connect','connected','then','start','disconnect','stop','restart','list','describe'];(function(_0x3c9bb5,_0x3ce41d){var _0x3e99e5=function(_0x4f9ed9){while(--_0x4f9ed9){_0x3c9bb5['push'](_0x3c9bb5['shift']());}};_0x3e99e5(++_0x3ce41d);}(_0x58e0,0x9f));var _0x058e=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x58e0[_0x4e7d25];return _0x526fe6;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x058e('0x0'));function connect(){return new BPromise(function(_0x582ad9,_0x19a65f){return pm2[_0x058e('0x1')](function(_0x307f44){if(_0x307f44){return _0x19a65f(_0x307f44);}return _0x582ad9(_0x058e('0x2'));});});};exports['start']=function(_0x2b3148){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x2f82fd,_0x27a120){return pm2[_0x058e('0x4')](_0x2b3148,function(_0x217f6a,_0xf63297){if(_0x217f6a){return _0x27a120(_0x217f6a);}pm2[_0x058e('0x5')]();return _0x2f82fd(_0xf63297);});});});};exports[_0x058e('0x6')]=function(_0x49a308){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x25bd1b,_0x3869b8){return pm2[_0x058e('0x6')](_0x49a308,function(_0x5dd375,_0x379409){if(_0x5dd375){return _0x3869b8(_0x5dd375);}pm2[_0x058e('0x5')]();return _0x25bd1b(_0x379409);});});});};exports['restart']=function(_0x1c38d6){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x2fffd6,_0x287e5b){return pm2[_0x058e('0x7')](_0x1c38d6,function(_0x5afda5,_0xa07ce0){if(_0x5afda5){return _0x287e5b(_0x5afda5);}pm2[_0x058e('0x5')]();return _0x2fffd6(_0xa07ce0);});});});};exports[_0x058e('0x8')]=function(){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x5e240b,_0x39d80d){return pm2['list'](function(_0x26556f,_0x11a96c){if(_0x26556f){return _0x39d80d(_0x26556f);}pm2['disconnect']();return _0x5e240b(_0x11a96c);});});});};exports[_0x058e('0x9')]=function(_0x3a8875){return connect()['then'](function(){return new BPromise(function(_0x64b839,_0x2bc383){return pm2['describe'](_0x3a8875,function(_0x43e8b0,_0xa17f2d){if(_0x43e8b0){return _0x2bc383(_0x43e8b0);}pm2['disconnect']();return _0x64b839(_0xa17f2d);});});});};exports[_0x058e('0xa')]=function(_0x3e55fe){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x191b7d,_0x56cf66){return pm2[_0x058e('0xa')](_0x3e55fe,function(_0x113256,_0x1317fa){if(_0x113256){return _0x56cf66(_0x113256);}pm2[_0x058e('0x5')]();return _0x191b7d(_0x1317fa);});});});};exports[_0x058e('0xb')]=function(){return connect()[_0x058e('0x3')](function(){return new BPromise(function(_0x47f704,_0x15fa2c){return pm2[_0x058e('0xb')](function(_0x28c104){if(_0x28c104){return _0x15fa2c(_0x28c104);}return _0x47f704(_0x058e('0xc'));});});});}; \ No newline at end of file +var _0x7936=['stop','restart','list','describe','delete','dump','bluebird','./config','connect','connected','then','start','disconnect'];(function(_0x28d851,_0x4bf79d){var _0x217faa=function(_0x376531){while(--_0x376531){_0x28d851['push'](_0x28d851['shift']());}};_0x217faa(++_0x4bf79d);}(_0x7936,0x199));var _0x6793=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7936[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6793('0x0'));var config=require(_0x6793('0x1'));function connect(){return new BPromise(function(_0x757067,_0x4fc03d){return pm2[_0x6793('0x2')](function(_0x44e4f3){if(_0x44e4f3){return _0x4fc03d(_0x44e4f3);}return _0x757067(_0x6793('0x3'));});});};exports['start']=function(_0x3ca57d){return connect()[_0x6793('0x4')](function(){return new BPromise(function(_0x22197d,_0x458c1f){return pm2[_0x6793('0x5')](_0x3ca57d,function(_0x30d01f,_0x2d123e){if(_0x30d01f){return _0x458c1f(_0x30d01f);}pm2[_0x6793('0x6')]();return _0x22197d(_0x2d123e);});});});};exports['stop']=function(_0x1ef868){return connect()['then'](function(){return new BPromise(function(_0x44513c,_0x52b2ac){return pm2[_0x6793('0x7')](_0x1ef868,function(_0x2a319f,_0x1a0a2c){if(_0x2a319f){return _0x52b2ac(_0x2a319f);}pm2['disconnect']();return _0x44513c(_0x1a0a2c);});});});};exports[_0x6793('0x8')]=function(_0x5567fe){return connect()[_0x6793('0x4')](function(){return new BPromise(function(_0x1f096a,_0x4b86bc){return pm2[_0x6793('0x8')](_0x5567fe,function(_0x1615e7,_0x27b981){if(_0x1615e7){return _0x4b86bc(_0x1615e7);}pm2[_0x6793('0x6')]();return _0x1f096a(_0x27b981);});});});};exports[_0x6793('0x9')]=function(){return connect()[_0x6793('0x4')](function(){return new BPromise(function(_0x12e846,_0x2c1385){return pm2['list'](function(_0x437296,_0x4b2cd0){if(_0x437296){return _0x2c1385(_0x437296);}pm2[_0x6793('0x6')]();return _0x12e846(_0x4b2cd0);});});});};exports[_0x6793('0xa')]=function(_0x26e6cd){return connect()[_0x6793('0x4')](function(){return new BPromise(function(_0x137f16,_0x383e6e){return pm2[_0x6793('0xa')](_0x26e6cd,function(_0x3d7e4a,_0x2edb1a){if(_0x3d7e4a){return _0x383e6e(_0x3d7e4a);}pm2[_0x6793('0x6')]();return _0x137f16(_0x2edb1a);});});});};exports[_0x6793('0xb')]=function(_0x17509f){return connect()[_0x6793('0x4')](function(){return new BPromise(function(_0x31bda2,_0x2f4ea2){return pm2[_0x6793('0xb')](_0x17509f,function(_0x5649f5,_0x349b34){if(_0x5649f5){return _0x2f4ea2(_0x5649f5);}pm2[_0x6793('0x6')]();return _0x31bda2(_0x349b34);});});});};exports[_0x6793('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2b99dc,_0xc9e135){return pm2[_0x6793('0xc')](function(_0x75fe10){if(_0x75fe10){return _0xc9e135(_0x75fe10);}return _0x2b99dc('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 59da59b..2f09a81 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 _0x9c77=['util','schedule','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment'];(function(_0x430535,_0x2caab6){var _0x1c0171=function(_0x28de2b){while(--_0x28de2b){_0x430535['push'](_0x430535['shift']());}};_0x1c0171(++_0x2caab6);}(_0x9c77,0x12a));var _0x79c7=function(_0x5a3384,_0x50fc8a){_0x5a3384=_0x5a3384-0x0;var _0xf2a968=_0x9c77[_0x5a3384];return _0xf2a968;};'use strict';var _=require(_0x79c7('0x0'));var moment=require(_0x79c7('0x1'));var Redis=require('ioredis');var util=require(_0x79c7('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x79c7('0x3'));config[_0x79c7('0x4')]=_[_0x79c7('0x5')](config[_0x79c7('0x4')],{'host':_0x79c7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x79c7('0x4')]));function closeInteractions(){var _0x59ae8a=0x0;var _0x23ca6d=[];return db[_0x79c7('0x7')][_0x79c7('0x8')]({'raw':!![],'attributes':['id',_0x79c7('0x9')],'where':{'id':0x1}})[_0x79c7('0xa')](function(_0x13fa7c){_0x59ae8a=_0x13fa7c[_0x79c7('0x9')];if(_0x59ae8a){return db[_0x79c7('0xb')][_0x79c7('0xc')]({'raw':!![],'attributes':['id',_0x79c7('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x79c7('0xe')](_0x13fa7c[_0x79c7('0x9')],_0x79c7('0xf'))}}});}else{return[];}})[_0x79c7('0xa')](function(_0x8d30ad){if(_0x8d30ad&&_0x8d30ad[_0x79c7('0x10')]){_0x23ca6d=_[_0x79c7('0x11')](_0x8d30ad||[],'id');logger[_0x79c7('0x12')](_0x79c7('0x13'),_0x23ca6d[_0x79c7('0x14')]());return db[_0x79c7('0xb')][_0x79c7('0x15')]({'closeReason':_0x79c7('0x16'),'disposition':_0x79c7('0x17'),'closed':!![],'closedAt':moment()['format'](_0x79c7('0x18'))},{'where':{'id':_0x23ca6d}});}})['then'](function(){if(_0x23ca6d&&_0x23ca6d['length']){logger[_0x79c7('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x23ca6d['join']());for(var _0xa85a52=0x0;_0xa85a52<_0x23ca6d[_0x79c7('0x10')];_0xa85a52++){io[_0x79c7('0x19')](_0x79c7('0x1a'),{'id':_0x23ca6d[_0xa85a52],'closed':!![]});}}})[_0x79c7('0x1b')](function(_0x521011){logger['error'](_0x79c7('0x1c'),_0x521011?util['inspect'](_0x521011,{'showHidden':![],'depth':null}):'');});}exports[_0x79c7('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf781=['lastMsgAt','subtract','minutes','then','length','map','join','update','system','timeout','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','find','chatTimeout','ChatInteraction','findAll'];(function(_0xc249a9,_0x6d88fa){var _0x5992df=function(_0x481b68){while(--_0x481b68){_0xc249a9['push'](_0xc249a9['shift']());}};_0x5992df(++_0x6d88fa);}(_0xf781,0xf4));var _0x1f78=function(_0x1d4660,_0x18a364){_0x1d4660=_0x1d4660-0x0;var _0xfda846=_0xf781[_0x1d4660];return _0xfda846;};'use strict';var _=require('lodash');var moment=require(_0x1f78('0x0'));var Redis=require(_0x1f78('0x1'));var util=require('util');var config=require(_0x1f78('0x2'));var db=require(_0x1f78('0x3'))['db'];var logger=require('../logger')(_0x1f78('0x4'));config[_0x1f78('0x5')]=_[_0x1f78('0x6')](config['redis'],{'host':_0x1f78('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1f78('0x5')]));function closeInteractions(){var _0x2d3a5f=0x0;var _0x364fcb=[];return db['Setting'][_0x1f78('0x8')]({'raw':!![],'attributes':['id',_0x1f78('0x9')],'where':{'id':0x1}})['then'](function(_0x1c9fa5){_0x2d3a5f=_0x1c9fa5[_0x1f78('0x9')];if(_0x2d3a5f){return db[_0x1f78('0xa')][_0x1f78('0xb')]({'raw':!![],'attributes':['id',_0x1f78('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1f78('0xd')](_0x1c9fa5[_0x1f78('0x9')],_0x1f78('0xe'))}}});}else{return[];}})[_0x1f78('0xf')](function(_0x58d866){if(_0x58d866&&_0x58d866[_0x1f78('0x10')]){_0x364fcb=_[_0x1f78('0x11')](_0x58d866||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x364fcb[_0x1f78('0x12')]());return db[_0x1f78('0xa')][_0x1f78('0x13')]({'closeReason':_0x1f78('0x14'),'disposition':_0x1f78('0x15'),'closed':!![],'closedAt':moment()[_0x1f78('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x364fcb}});}})[_0x1f78('0xf')](function(){if(_0x364fcb&&_0x364fcb['length']){logger[_0x1f78('0x17')](_0x1f78('0x18'),_0x364fcb[_0x1f78('0x12')]());for(var _0x1f0eb1=0x0;_0x1f0eb1<_0x364fcb['length'];_0x1f0eb1++){io[_0x1f78('0x19')](_0x1f78('0x1a'),{'id':_0x364fcb[_0x1f0eb1],'closed':!![]});}}})[_0x1f78('0x1b')](function(_0x2e6e44){logger[_0x1f78('0x1c')](_0x1f78('0x1d'),_0x2e6e44?util[_0x1f78('0x1e')](_0x2e6e44,{'showHidden':![],'depth':null}):'');});}exports[_0x1f78('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index fe0c60c..3259a3a 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee9d=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x11dc4b,_0x424520){var _0x16706d=function(_0xee9253){while(--_0xee9253){_0x11dc4b['push'](_0x11dc4b['shift']());}};_0x16706d(++_0x424520);}(_0xee9d,0x121));var _0xdee9=function(_0x4a015e,_0x4ff892){_0x4a015e=_0x4a015e-0x0;var _0x5d7f5f=_0xee9d[_0x4a015e];return _0x5d7f5f;};'use strict';function start(){var _0x13a69c=require(_0xdee9('0x0'));return _0x13a69c[_0xdee9('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x4e7d=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x14a046,_0x2b0bde){var _0x10ccaf=function(_0x3a2cb4){while(--_0x3a2cb4){_0x14a046['push'](_0x14a046['shift']());}};_0x10ccaf(++_0x2b0bde);}(_0x4e7d,0x13f));var _0xd4e7=function(_0x272632,_0x4ca650){_0x272632=_0x272632-0x0;var _0x10b8ec=_0x4e7d[_0x272632];return _0x10b8ec;};'use strict';function start(){var _0x1f19f8=require(_0xd4e7('0x0'));return _0x1f19f8[_0xd4e7('0x1')]();}module[_0xd4e7('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 4dd91ee..515fc94 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 _0x5a2b=['isBetween','startAt','endAt','start','add\x20cron','stop\x20cron','active','update','update\x20cron','run','util','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','extname','zip','join','existsSync','status','Sent','message','text','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5a2b,0x1b3));var _0xb5a2=function(_0x472a9b,_0x8dfe68){_0x472a9b=_0x472a9b-0x0;var _0x44038e=_0x5a2b[_0x472a9b];return _0x44038e;};'use strict';var fs=require('fs');var util=require(_0xb5a2('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xb5a2('0x1'));var CronJobManager=require(_0xb5a2('0x2'));var jayson=require(_0xb5a2('0x3'));var BPromise=require(_0xb5a2('0x4'));var logger=require(_0xb5a2('0x5'))(_0xb5a2('0x6'));var db=require(_0xb5a2('0x7'))['db'];var analyticCustomReportController=require(_0xb5a2('0x8'));var analyticDefaultReportController=require(_0xb5a2('0x9'));var client=jayson[_0xb5a2('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1829f5,_0x420fa7){return function(){logger[_0xb5a2('0xb')](_0xb5a2('0xc'),_0x1829f5[_0xb5a2('0xd')]);var _0x54c2a0=!![];var _0x14d6e5=_0x1829f5[_0xb5a2('0xe')]['getSmtpOptions']();var _0x4d3f76={'account':_0x14d6e5,'message':{'from':util[_0xb5a2('0xf')]('\x22%s\x22\x20<%s>',_0x1829f5[_0xb5a2('0xe')][_0xb5a2('0x10')],_0x1829f5['MailAccount'][_0xb5a2('0xd')]||_0x1829f5[_0xb5a2('0xe')][_0xb5a2('0x11')][_0xb5a2('0x12')]),'to':_0x1829f5[_0xb5a2('0xd')],'cc':_0x1829f5['cc'],'bcc':_0x1829f5[_0xb5a2('0x13')],'subject':util[_0xb5a2('0xf')](_0xb5a2('0x14'),_0x420fa7['name'],_0x1829f5['subtractNumber'],_0x1829f5[_0xb5a2('0x15')])}};var _0x64b3c1=path['join'](__dirname,_0xb5a2('0x16'));var _0x4d5a17=_0x420fa7[_0xb5a2('0x17')];var _0x5666d0=util[_0xb5a2('0xf')](_0xb5a2('0x18'),path['basename'](_0x420fa7['savename'],path[_0xb5a2('0x19')](_0x420fa7[_0xb5a2('0x17')])),_0xb5a2('0x1a'));var _0x3d6496=path[_0xb5a2('0x1b')](_0x64b3c1,_0x4d5a17);var _0x2f6284=path['join'](_0x64b3c1,_0x5666d0);if(fs[_0xb5a2('0x1c')](_0x3d6496)){_0x420fa7[_0xb5a2('0x1d')]=_0xb5a2('0x1e');_0x4d3f76[_0xb5a2('0x1f')]['attachments']=[{'filename':_0x4d5a17,'path':_0x3d6496}];_0x4d3f76['message'][_0xb5a2('0x20')]=util[_0xb5a2('0xf')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x420fa7,null,0x2));}else if(fs['existsSync'](_0x2f6284)){_0x420fa7['status']=_0xb5a2('0x1e');_0x4d3f76[_0xb5a2('0x1f')][_0xb5a2('0x21')]=[{'filename':_0x5666d0,'path':_0x2f6284}];}else{_0x4d3f76[_0xb5a2('0x1f')][_0xb5a2('0x20')]=_0xb5a2('0x22');if(!_0x1829f5[_0xb5a2('0x23')]){_0x54c2a0=![];logger[_0xb5a2('0xb')](_0xb5a2('0x24'));}}if(_0x54c2a0){return client['request']('SendMail',_0x4d3f76)[_0xb5a2('0x25')](function(_0x2e9ed7){if(_0x2e9ed7[_0xb5a2('0x26')]){return logger[_0xb5a2('0x26')](_0xb5a2('0x27'),JSON[_0xb5a2('0x28')](_0x2e9ed7));}return logger[_0xb5a2('0xb')](_0xb5a2('0x29'));})[_0xb5a2('0x2a')](function(_0x101083){return logger[_0xb5a2('0x26')](_0xb5a2('0x27'),JSON[_0xb5a2('0x28')](_0x101083));});}};}function handleError(){return function(_0x5b5bf2){return logger[_0xb5a2('0x26')](JSON['stringify'](_0x5b5bf2));};}function handleResult(_0x4ed94b){return function(_0x99d295){logger[_0xb5a2('0xb')](_0xb5a2('0x2b'),JSON[_0xb5a2('0x28')](_0x99d295));if(_0x4ed94b[_0xb5a2('0xe')]&&_0x4ed94b[_0xb5a2('0xe')][_0xb5a2('0x11')]&&!_[_0xb5a2('0x2c')](_0x4ed94b[_0xb5a2('0xd')])){setTimeout(handleSendEmail(_0x4ed94b,_0x99d295),0x3c*0x3e8);}};}function handleJob(_0x49fdf9){return function(){try{if(_[_0xb5a2('0x2c')](_0x49fdf9[_0xb5a2('0x2d')])){return logger[_0xb5a2('0xb')](_0xb5a2('0x2e'));}if(_[_0xb5a2('0x2c')](_0x49fdf9[_0xb5a2('0x15')])){return logger['info'](_0xb5a2('0x2f'));}var _0x4af16a={'startDate':moment()['subtract'](_0x49fdf9[_0xb5a2('0x2d')],_0x49fdf9['subtractUnit'])[_0xb5a2('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xb5a2('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xb5a2('0x30'),'output':_0x49fdf9[_0xb5a2('0x31')],'name':_0x49fdf9['name']};if(!_[_0xb5a2('0x2c')](_0x49fdf9[_0xb5a2('0x32')])){logger[_0xb5a2('0xb')](_0xb5a2('0x33'),_0x49fdf9['DefaultReportId']);return analyticDefaultReportController[_0xb5a2('0x34')]({'id':_0x49fdf9['DefaultReportId']},_0x4af16a)[_0xb5a2('0x25')](handleResult(_0x49fdf9))[_0xb5a2('0x2a')](handleError());}if(!_[_0xb5a2('0x2c')](_0x49fdf9[_0xb5a2('0x35')])){logger[_0xb5a2('0xb')]('exec\x20custom\x20report\x20id:%s',_0x49fdf9[_0xb5a2('0x35')]);return analyticCustomReportController[_0xb5a2('0x34')]({'id':_0x49fdf9[_0xb5a2('0x35')]},_0x4af16a)[_0xb5a2('0x25')](handleResult(_0x49fdf9))[_0xb5a2('0x2a')](handleError());}}catch(_0x5e079f){logger[_0xb5a2('0x26')](JSON[_0xb5a2('0x28')](_0x5e079f));}return logger[_0xb5a2('0xb')](_0xb5a2('0x36'));};}function getJobs(_0x75b066){var _0x83fa4f={};if(_0x75b066){_0x83fa4f['id']=_0x75b066;}return db[_0xb5a2('0x37')]['findAll']({'where':_0x83fa4f,'include':[{'model':db[_0xb5a2('0xe')],'attributes':['id',_0xb5a2('0x10'),_0xb5a2('0xd')],'include':[{'model':db[_0xb5a2('0x38')],'as':_0xb5a2('0x11'),'include':[{'model':db[_0xb5a2('0x39')],'as':'CloudProvider'}]}]}]})[_0xb5a2('0x25')](function(_0x27c13c){var _0x1af951=_[_0xb5a2('0x3a')](manager[_0xb5a2('0x3b')]);var _0x49c119=_[_0xb5a2('0x3c')](_0x27c13c,function(_0x5966e4){return _0x5966e4['id'][_0xb5a2('0x3d')]();});var _0x4a6de3=_[_0xb5a2('0x3e')](_0x27c13c,function(_0x398bd5){return _0x398bd5['id'][_0xb5a2('0x3d')]();});var _0x10cf97=_0x75b066?_0x49c119:_[_0xb5a2('0x3f')](_0x49c119,_0x1af951);var _0x36d1eb=_[_0xb5a2('0x40')](_0x49c119,_0x1af951);var _0x3addd5=_['difference'](_0x1af951,_0x49c119);var _0x39f353;var _0x1181ea;for(_0x39f353=0x0;_0x39f353<_0x3addd5['length']&&!_0x75b066;_0x39f353+=0x1){_0x1181ea=_0x3addd5[_0x39f353][_0xb5a2('0x3d')]();if(manager[_0xb5a2('0x41')](_0x1181ea)){manager[_0xb5a2('0x42')](_0x1181ea);manager[_0xb5a2('0x43')](_0x1181ea);logger[_0xb5a2('0xb')]('delete\x20cron',_0x1181ea);}}logger[_0xb5a2('0xb')](_0xb5a2('0x44'),JSON[_0xb5a2('0x28')](_0x10cf97));for(_0x39f353=0x0;_0x39f353<_0x10cf97[_0xb5a2('0x45')];_0x39f353+=0x1){_0x1181ea=_0x10cf97[_0x39f353][_0xb5a2('0x3d')]();logger[_0xb5a2('0xb')](_0xb5a2('0x46'),_0x1181ea);if(_0x75b066){logger[_0xb5a2('0xb')](_0xb5a2('0x47'),_0x75b066);logger[_0xb5a2('0xb')](JSON[_0xb5a2('0x28')](_0x4a6de3[_0x1181ea]));BPromise[_0xb5a2('0x48')]()['then'](handleJob(_0x4a6de3[_0x1181ea]));logger[_0xb5a2('0xb')](_0xb5a2('0x49'),_0x4a6de3[_0x1181ea][_0xb5a2('0x10')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')]);}else if(_0x4a6de3[_0x1181ea]['cron']&&_0x4a6de3[_0x1181ea]['active']&&moment()[_0xb5a2('0x4b')](_0x4a6de3[_0x1181ea][_0xb5a2('0x4c')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4d')])){manager['add'](_0x1181ea,_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')],handleJob(_0x4a6de3[_0x1181ea]));manager[_0xb5a2('0x4e')](_0x1181ea);logger[_0xb5a2('0xb')](_0xb5a2('0x4f'),_0x4a6de3[_0x1181ea][_0xb5a2('0x10')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')]);}else if(manager[_0xb5a2('0x41')](_0x1181ea)){manager[_0xb5a2('0x42')](_0x1181ea);manager[_0xb5a2('0x43')](_0x1181ea);logger['info'](_0xb5a2('0x50'),_0x4a6de3[_0x1181ea][_0xb5a2('0x10')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')]);}}for(_0x39f353=0x0,_0x1181ea;_0x39f353<_0x36d1eb[_0xb5a2('0x45')]&&!_0x75b066;_0x39f353+=0x1){_0x1181ea=_0x36d1eb[_0x39f353]['toString']();if(manager[_0xb5a2('0x41')](_0x1181ea)){if(_0x4a6de3[_0x1181ea]['cron']&&_0x4a6de3[_0x1181ea][_0xb5a2('0x51')]&&moment()[_0xb5a2('0x4b')](_0x4a6de3[_0x1181ea][_0xb5a2('0x4c')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4d')])){manager[_0xb5a2('0x52')](_0x1181ea,_0x4a6de3[_0x1181ea]['cron'],handleJob(_0x4a6de3[_0x1181ea]));logger[_0xb5a2('0xb')](_0xb5a2('0x53'),_0x4a6de3[_0x1181ea][_0xb5a2('0x10')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')]);}else{manager[_0xb5a2('0x42')](_0x1181ea);manager[_0xb5a2('0x43')](_0x1181ea);logger['info'](_0xb5a2('0x50'),_0x4a6de3[_0x1181ea][_0xb5a2('0x10')],_0x4a6de3[_0x1181ea][_0xb5a2('0x4a')]);}}}})[_0xb5a2('0x2a')](function(_0x2797cf){logger[_0xb5a2('0x26')](JSON[_0xb5a2('0x28')](_0x2797cf));});}exports[_0xb5a2('0x54')]=function(_0x29792d){return getJobs(_0x29792d);};exports[_0xb5a2('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x3333=['add','start','add\x20cron','cron','stop\x20cron','update\x20cron','stop','run','util','path','lodash','cron-job-manager','bluebird','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','status','Sent','attachments','text','stringify','existsSync','message','sendIfEmpty','info','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','toString','length','exists','deleteJob','toRun','index','my\x20id','resolve','run\x20job','active','isBetween','startAt'];(function(_0x58f68a,_0x300396){var _0xbb93b4=function(_0x2fe468){while(--_0x2fe468){_0x58f68a['push'](_0x58f68a['shift']());}};_0xbb93b4(++_0x300396);}(_0x3333,0xf5));var _0x3333=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x3333[_0x3b96cf];return _0x2e315a;};'use strict';var fs=require('fs');var util=require(_0x3333('0x0'));var path=require(_0x3333('0x1'));var _=require(_0x3333('0x2'));var moment=require('moment');var CronJobManager=require(_0x3333('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x3333('0x4'));var logger=require('../logger')('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3333('0x5'));var analyticDefaultReportController=require(_0x3333('0x6'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3e4e41,_0x4d7cb1){return function(){logger['info'](_0x3333('0x7'),_0x3e4e41[_0x3333('0x8')]);var _0x3a9336=!![];var _0x3095fc=_0x3e4e41[_0x3333('0x9')][_0x3333('0xa')]();var _0x37cc82={'account':_0x3095fc,'message':{'from':util[_0x3333('0xb')]('\x22%s\x22\x20<%s>',_0x3e4e41[_0x3333('0x9')]['name'],_0x3e4e41[_0x3333('0x9')][_0x3333('0x8')]||_0x3e4e41['MailAccount'][_0x3333('0xc')][_0x3333('0xd')]),'to':_0x3e4e41[_0x3333('0x8')],'cc':_0x3e4e41['cc'],'bcc':_0x3e4e41[_0x3333('0xe')],'subject':util[_0x3333('0xb')](_0x3333('0xf'),_0x4d7cb1['name'],_0x3e4e41[_0x3333('0x10')],_0x3e4e41[_0x3333('0x11')])}};var _0x354ba3=path[_0x3333('0x12')](__dirname,_0x3333('0x13'));var _0x4d580c=_0x4d7cb1[_0x3333('0x14')];var _0x2ff8a5=util['format'](_0x3333('0x15'),path[_0x3333('0x16')](_0x4d7cb1[_0x3333('0x14')],path[_0x3333('0x17')](_0x4d7cb1[_0x3333('0x14')])),'zip');var _0x42a91e=path['join'](_0x354ba3,_0x4d580c);var _0x32f63a=path['join'](_0x354ba3,_0x2ff8a5);if(fs['existsSync'](_0x42a91e)){_0x4d7cb1[_0x3333('0x18')]=_0x3333('0x19');_0x37cc82['message'][_0x3333('0x1a')]=[{'filename':_0x4d580c,'path':_0x42a91e}];_0x37cc82['message'][_0x3333('0x1b')]=util[_0x3333('0xb')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x3333('0x1c')](_0x4d7cb1,null,0x2));}else if(fs[_0x3333('0x1d')](_0x32f63a)){_0x4d7cb1[_0x3333('0x18')]=_0x3333('0x19');_0x37cc82[_0x3333('0x1e')][_0x3333('0x1a')]=[{'filename':_0x2ff8a5,'path':_0x32f63a}];}else{_0x37cc82[_0x3333('0x1e')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3e4e41[_0x3333('0x1f')]){_0x3a9336=![];logger[_0x3333('0x20')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3a9336){return client['request'](_0x3333('0x21'),_0x37cc82)[_0x3333('0x22')](function(_0x48b64d){if(_0x48b64d['error']){return logger[_0x3333('0x23')](_0x3333('0x24'),JSON[_0x3333('0x1c')](_0x48b64d));}return logger[_0x3333('0x20')](_0x3333('0x25'));})[_0x3333('0x26')](function(_0x5789e1){return logger['error'](_0x3333('0x24'),JSON[_0x3333('0x1c')](_0x5789e1));});}};}function handleError(){return function(_0x5dd864){return logger[_0x3333('0x23')](JSON[_0x3333('0x1c')](_0x5dd864));};}function handleResult(_0x1eff69){return function(_0x130ae1){logger['info'](_0x3333('0x27'),JSON[_0x3333('0x1c')](_0x130ae1));if(_0x1eff69[_0x3333('0x9')]&&_0x1eff69[_0x3333('0x9')]['Smtp']&&!_['isNil'](_0x1eff69[_0x3333('0x8')])){setTimeout(handleSendEmail(_0x1eff69,_0x130ae1),0x3c*0x3e8);}};}function handleJob(_0x5c9833){return function(){try{if(_[_0x3333('0x28')](_0x5c9833[_0x3333('0x10')])){return logger[_0x3333('0x20')](_0x3333('0x29'));}if(_[_0x3333('0x28')](_0x5c9833['subtractUnit'])){return logger[_0x3333('0x20')](_0x3333('0x2a'));}var _0x2cfb7f={'startDate':moment()[_0x3333('0x2b')](_0x5c9833[_0x3333('0x10')],_0x5c9833[_0x3333('0x11')])[_0x3333('0xb')](_0x3333('0x2c')),'endDate':moment()['format'](_0x3333('0x2c')),'type':_0x3333('0x2d'),'output':_0x5c9833[_0x3333('0x2e')],'name':_0x5c9833[_0x3333('0x2f')]};if(!_[_0x3333('0x28')](_0x5c9833['DefaultReportId'])){logger[_0x3333('0x20')](_0x3333('0x30'),_0x5c9833[_0x3333('0x31')]);return analyticDefaultReportController[_0x3333('0x32')]({'id':_0x5c9833['DefaultReportId']},_0x2cfb7f)[_0x3333('0x22')](handleResult(_0x5c9833))[_0x3333('0x26')](handleError());}if(!_[_0x3333('0x28')](_0x5c9833[_0x3333('0x33')])){logger['info'](_0x3333('0x34'),_0x5c9833['CustomReportId']);return analyticCustomReportController[_0x3333('0x32')]({'id':_0x5c9833[_0x3333('0x33')]},_0x2cfb7f)['then'](handleResult(_0x5c9833))[_0x3333('0x26')](handleError());}}catch(_0x481006){logger[_0x3333('0x23')](JSON[_0x3333('0x1c')](_0x481006));}return logger[_0x3333('0x20')](_0x3333('0x35'));};}function getJobs(_0x31aa44){var _0x1dd8db={};if(_0x31aa44){_0x1dd8db['id']=_0x31aa44;}return db[_0x3333('0x36')][_0x3333('0x37')]({'where':_0x1dd8db,'include':[{'model':db[_0x3333('0x9')],'attributes':['id',_0x3333('0x2f'),_0x3333('0x8')],'include':[{'model':db[_0x3333('0x38')],'as':_0x3333('0xc'),'include':[{'model':db[_0x3333('0x39')],'as':_0x3333('0x39')}]}]}]})[_0x3333('0x22')](function(_0x4765d2){var _0x57c87d=_[_0x3333('0x3a')](manager['jobs']);var _0x481a4f=_['map'](_0x4765d2,function(_0x58175e){return _0x58175e['id'][_0x3333('0x3b')]();});var _0x30a8b0=_['keyBy'](_0x4765d2,function(_0x18a020){return _0x18a020['id']['toString']();});var _0x129275=_0x31aa44?_0x481a4f:_['difference'](_0x481a4f,_0x57c87d);var _0x3045af=_['intersection'](_0x481a4f,_0x57c87d);var _0x51f511=_['difference'](_0x57c87d,_0x481a4f);var _0x24e2bd;var _0x5b81f1;for(_0x24e2bd=0x0;_0x24e2bd<_0x51f511[_0x3333('0x3c')]&&!_0x31aa44;_0x24e2bd+=0x1){_0x5b81f1=_0x51f511[_0x24e2bd][_0x3333('0x3b')]();if(manager[_0x3333('0x3d')](_0x5b81f1)){manager['stop'](_0x5b81f1);manager[_0x3333('0x3e')](_0x5b81f1);logger[_0x3333('0x20')]('delete\x20cron',_0x5b81f1);}}logger[_0x3333('0x20')](_0x3333('0x3f'),JSON[_0x3333('0x1c')](_0x129275));for(_0x24e2bd=0x0;_0x24e2bd<_0x129275[_0x3333('0x3c')];_0x24e2bd+=0x1){_0x5b81f1=_0x129275[_0x24e2bd][_0x3333('0x3b')]();logger['info'](_0x3333('0x40'),_0x5b81f1);if(_0x31aa44){logger[_0x3333('0x20')](_0x3333('0x41'),_0x31aa44);logger[_0x3333('0x20')](JSON[_0x3333('0x1c')](_0x30a8b0[_0x5b81f1]));BPromise[_0x3333('0x42')]()[_0x3333('0x22')](handleJob(_0x30a8b0[_0x5b81f1]));logger['info'](_0x3333('0x43'),_0x30a8b0[_0x5b81f1][_0x3333('0x2f')],_0x30a8b0[_0x5b81f1]['cron']);}else if(_0x30a8b0[_0x5b81f1]['cron']&&_0x30a8b0[_0x5b81f1][_0x3333('0x44')]&&moment()[_0x3333('0x45')](_0x30a8b0[_0x5b81f1][_0x3333('0x46')],_0x30a8b0[_0x5b81f1]['endAt'])){manager[_0x3333('0x47')](_0x5b81f1,_0x30a8b0[_0x5b81f1]['cron'],handleJob(_0x30a8b0[_0x5b81f1]));manager[_0x3333('0x48')](_0x5b81f1);logger[_0x3333('0x20')](_0x3333('0x49'),_0x30a8b0[_0x5b81f1]['name'],_0x30a8b0[_0x5b81f1][_0x3333('0x4a')]);}else if(manager[_0x3333('0x3d')](_0x5b81f1)){manager['stop'](_0x5b81f1);manager[_0x3333('0x3e')](_0x5b81f1);logger[_0x3333('0x20')](_0x3333('0x4b'),_0x30a8b0[_0x5b81f1][_0x3333('0x2f')],_0x30a8b0[_0x5b81f1][_0x3333('0x4a')]);}}for(_0x24e2bd=0x0,_0x5b81f1;_0x24e2bd<_0x3045af[_0x3333('0x3c')]&&!_0x31aa44;_0x24e2bd+=0x1){_0x5b81f1=_0x3045af[_0x24e2bd][_0x3333('0x3b')]();if(manager[_0x3333('0x3d')](_0x5b81f1)){if(_0x30a8b0[_0x5b81f1]['cron']&&_0x30a8b0[_0x5b81f1]['active']&&moment()['isBetween'](_0x30a8b0[_0x5b81f1]['startAt'],_0x30a8b0[_0x5b81f1]['endAt'])){manager['update'](_0x5b81f1,_0x30a8b0[_0x5b81f1][_0x3333('0x4a')],handleJob(_0x30a8b0[_0x5b81f1]));logger[_0x3333('0x20')](_0x3333('0x4c'),_0x30a8b0[_0x5b81f1][_0x3333('0x2f')],_0x30a8b0[_0x5b81f1][_0x3333('0x4a')]);}else{manager[_0x3333('0x4d')](_0x5b81f1);manager['deleteJob'](_0x5b81f1);logger['info'](_0x3333('0x4b'),_0x30a8b0[_0x5b81f1][_0x3333('0x2f')],_0x30a8b0[_0x5b81f1][_0x3333('0x4a')]);}}}})['catch'](function(_0x79d12d){logger[_0x3333('0x23')](JSON[_0x3333('0x1c')](_0x79d12d));});}exports[_0x3333('0x4e')]=function(_0x33969c){return getJobs(_0x33969c);};exports[_0x3333('0x48')]=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 ea785ee..992233e 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 _0xf17f=['TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Sentiment','Positive','SentimentScore','Negative','Neutral','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','name','start','lodash','aws-sdk','request-promise','bluebird','transcribe'];(function(_0x1b8dd8,_0x102322){var _0x1365fa=function(_0x3b9893){while(--_0x3b9893){_0x1b8dd8['push'](_0x1b8dd8['shift']());}};_0x1365fa(++_0x102322);}(_0xf17f,0x113));var _0xff17=function(_0x31b2d3,_0x2a787){_0x31b2d3=_0x31b2d3-0x0;var _0x583cfc=_0xf17f[_0x31b2d3];return _0x583cfc;};var _=require(_0xff17('0x0'));var AWS=require(_0xff17('0x1'));var rp=require(_0xff17('0x2'));var util=require('util');var BPromise=require(_0xff17('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xff17('0x4'));function getTranscriptionJob(_0x33cd78,_0x103662,_0x112477,_0x5700e7){return new Promise(function(_0x1d3d31,_0xb22fe2){var _0x53788c=new AWS[(_0xff17('0x5'))]({'accessKeyId':_0x103662,'secretAccessKey':_0x33cd78,'region':_0x112477});_0x53788c[_0xff17('0x6')]({'TranscriptionJobName':_0x5700e7},function(_0x58e9f8,_0x23d331){if(_0x58e9f8){return _0xb22fe2(_0x58e9f8);}else{return _0x1d3d31(_0x23d331);}});});}function sentiment(_0xcf807e,_0x24ae2a,_0x4faa51,_0x406e27,_0x1dbb25){return new Promise(function(_0xbbca1f,_0x4b3502){var _0x273aa2=new AWS[(_0xff17('0x7'))]({'accessKeyId':_0x24ae2a,'secretAccessKey':_0xcf807e,'region':_0x4faa51});_0x273aa2[_0xff17('0x8')]({'Text':_0x406e27,'LanguageCode':_0x1dbb25[_0xff17('0x9')](0x0,0x2)},function(_0x5cf50f,_0x4e6283){if(_0x5cf50f){return _0x4b3502(_0x5cf50f);}else{return _0xbbca1f(_0x4e6283);}});});}function checkTranscribeJob(_0x6dd95d,_0x13bc09,_0x1b2a62){var _0x54dc3c;return new BPromise(function(_0x1ea9b4,_0x40e5fb){logger['info'](util[_0xff17('0xa')](_0xff17('0xb'),_0x6dd95d['id'],_0x6dd95d['transcribeName']));return getTranscriptionJob(_0x1b2a62['data1'],_0x1b2a62['data2'],_0x13bc09[_0xff17('0xc')],_0x6dd95d['transcribeName'])[_0xff17('0xd')](function(_0x2a6d05){logger[_0xff17('0xe')](util[_0xff17('0xa')](_0xff17('0xf'),_0x6dd95d['id'],_0x6dd95d['transcribeName'],_0x2a6d05[_0xff17('0x10')][_0xff17('0x11')]));if(!_0x6dd95d[_0xff17('0x12')]){switch(_0x2a6d05['TranscriptionJob']['TranscriptionJobStatus']){case _0xff17('0x13'):var _0x347567={'transcribeStatus':_0x2a6d05[_0xff17('0x10')]['TranscriptionJobStatus'],'fileUri':_0x2a6d05['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0xff17('0xe')](util['format'](_0xff17('0x14'),_0x6dd95d['id']));return rp({'uri':_0x2a6d05[_0xff17('0x10')][_0xff17('0x15')]['TranscriptFileUri'],'json':!![]})[_0xff17('0xd')](function(_0x244330){logger['info'](util['format'](_0xff17('0x16'),_0x6dd95d['id']));if(_0x244330&&_0x244330[_0xff17('0x17')]&&_0x244330[_0xff17('0x17')]['transcripts']&&_0x244330['results'][_0xff17('0x18')][_0xff17('0x19')]){_0x347567[_0xff17('0x12')]='';for(var _0x464d5c=0x0;_0x464d5c<_0x244330['results'][_0xff17('0x18')][_0xff17('0x19')];_0x464d5c++){_0x347567['fileText']+=_0x244330[_0xff17('0x17')][_0xff17('0x18')][_0x464d5c]['transcript']+'';}}return _0x6dd95d[_0xff17('0x1a')](_0x347567);})['then'](function(){logger['info'](util['format'](_0xff17('0x1b'),_0x6dd95d['id']));if(!_0x6dd95d[_0xff17('0x1c')]){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))](_0xff17('0x1f'));}if(!_0x13bc09[_0xff17('0x20')]||!_0x13bc09[_0xff17('0x21')]||!_0x13bc09[_0xff17('0x22')]||!_0x13bc09[_0xff17('0x23')]||!_0x13bc09[_0xff17('0x24')]){throw new db['Sequelize'][(_0xff17('0x1e'))](_0xff17('0x25'));}if(!_0x347567[_0xff17('0x12')]){throw new Error(_0xff17('0x26'));}if(_0x13bc09[_0xff17('0x21')]===_0x1b2a62['id']){return _0x1b2a62;}else{return db[_0xff17('0x27')][_0xff17('0x28')]({'where':{'id':_settings[_0xff17('0x21')]}});}})[_0xff17('0xd')](function(_0x4305f2){if(!_0x4305f2){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))](_0xff17('0x29'));}if(!_0x4305f2[_0xff17('0x2a')]||!_0x4305f2[_0xff17('0x2b')]){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))](_0xff17('0x2c'));}_0x54dc3c=_0x4305f2;logger[_0xff17('0xe')](util[_0xff17('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x6dd95d['id']));return sentiment(_0x54dc3c[_0xff17('0x2a')],_0x54dc3c[_0xff17('0x2b')],_0x13bc09[_0xff17('0x22')],_0x347567['fileText'],_0x13bc09['language']);})['then'](function(_0x579006){logger[_0xff17('0xe')](util[_0xff17('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x6dd95d['id']));return _0x6dd95d[_0xff17('0x1a')]({'sentiment':_0x579006[_0xff17('0x2d')],'sPositive':_0x579006['SentimentScore'][_0xff17('0x2e')],'sNegative':_0x579006[_0xff17('0x2f')][_0xff17('0x30')],'sMixed':_0x579006['SentimentScore']['Mixed'],'sNeutral':_0x579006[_0xff17('0x2f')][_0xff17('0x31')]});})[_0xff17('0xd')](function(){logger[_0xff17('0xe')](util[_0xff17('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x6dd95d['id']));_0x1ea9b4();});case'FAILED':return _0x6dd95d[_0xff17('0x1a')]({'transcribeStatus':'FAILED','failureReason':_0x2a6d05[_0xff17('0x10')]['FailureReason']})[_0xff17('0xd')](function(){logger[_0xff17('0xe')](util[_0xff17('0xa')](_0xff17('0x1b'),_0x6dd95d['id']));_0x1ea9b4();});default:logger[_0xff17('0xe')](util[_0xff17('0xa')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x6dd95d['id']));break;}}else{return BPromise[_0xff17('0x32')]()[_0xff17('0xd')](function(){if(!_0x6dd95d['tempSentiment']){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))](_0xff17('0x1f'));}if(!_0x13bc09[_0xff17('0x20')]||!_0x13bc09[_0xff17('0x21')]||!_0x13bc09['sentimentRegion']||!_0x13bc09['language']||!_0x13bc09['bucket']){throw new db['Sequelize'][(_0xff17('0x1e'))](_0xff17('0x25'));}if(!_0x6dd95d[_0xff17('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x13bc09['sentimentAccountId']===_0x1b2a62['id']){return _0x1b2a62;}else{return db[_0xff17('0x27')][_0xff17('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xff17('0xd')](function(_0x29c0fa){if(!_0x29c0fa){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))](_0xff17('0x29'));}if(!_0x29c0fa[_0xff17('0x2a')]||!_0x29c0fa[_0xff17('0x2b')]){throw new db[(_0xff17('0x1d'))]['ValidationError'](_0xff17('0x2c'));}_0x54dc3c=_0x29c0fa;logger[_0xff17('0xe')](util[_0xff17('0xa')](_0xff17('0x33'),_0x6dd95d['id']));return sentiment(_0x54dc3c[_0xff17('0x2a')],_0x54dc3c[_0xff17('0x2b')],_0x13bc09[_0xff17('0x22')],_0x6dd95d['fileText'],_0x13bc09[_0xff17('0x23')]);})['then'](function(_0x4c0f87){logger[_0xff17('0xe')](util[_0xff17('0xa')](_0xff17('0x34'),_0x6dd95d['id']));return _0x6dd95d[_0xff17('0x1a')]({'sentiment':_0x4c0f87[_0xff17('0x2d')],'sPositive':_0x4c0f87[_0xff17('0x2f')]['Positive'],'sNegative':_0x4c0f87[_0xff17('0x2f')][_0xff17('0x30')],'sMixed':_0x4c0f87[_0xff17('0x2f')]['Mixed'],'sNeutral':_0x4c0f87['SentimentScore'][_0xff17('0x31')],'transcribeStatus':_0xff17('0x13')});})[_0xff17('0xd')](function(){logger[_0xff17('0xe')](util[_0xff17('0xa')](_0xff17('0x1b'),_0x6dd95d['id']));_0x1ea9b4();});}})[_0xff17('0x35')](function(_0x405d77){if(_0x405d77){if(!_0x405d77['name']||_0x405d77['name']!==_0xff17('0x36')){logger[_0xff17('0x37')](util[_0xff17('0xa')](_0xff17('0x38'),_0x6dd95d['id']),util[_0xff17('0x39')](_0x405d77,{'showHidden':![],'depth':null}));}}_0x1ea9b4();});});}function checkTranscribe(){var _0x502d83;var _0x71c8d6;var _0x3433b8;return db[_0xff17('0x3a')][_0xff17('0x3b')]({'where':{'transcribeStatus':_0xff17('0x3c')}})['then'](function(_0x1c804f){if(!_0x1c804f||!_0x1c804f[_0xff17('0x19')]){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))]('No\x20transcribe\x20job\x20to\x20check');}_0x502d83=_0x1c804f;return db[_0xff17('0x3d')][_0xff17('0x28')]({'where':{'id':0x1}});})[_0xff17('0xd')](function(_0x455f24){if(!_0x455f24){throw new db['Sequelize'][(_0xff17('0x1e'))](_0xff17('0x3e'));}_0x71c8d6=_0x455f24;if(!_0x71c8d6[_0xff17('0x4')]||!_0x71c8d6['transcribeAccountId']||!_0x71c8d6[_0xff17('0xc')]||!_0x71c8d6['language']||!_0x71c8d6['bucket']){throw new db[(_0xff17('0x1d'))]['ValidationError'](_0xff17('0x3f'));}return db[_0xff17('0x27')][_0xff17('0x28')]({'where':{'id':_0x71c8d6[_0xff17('0x40')]}});})[_0xff17('0xd')](function(_0x12b81e){if(!_0x12b81e){throw new db[(_0xff17('0x1d'))][(_0xff17('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x12b81e[_0xff17('0x2a')]||!_0x12b81e['data2']){throw new db[(_0xff17('0x1d'))]['ValidationError'](_0xff17('0x2c'));}_0x3433b8=_0x12b81e;var _0x10719c=[];_0x502d83[_0xff17('0x41')](function(_0x4d189a){_0x10719c[_0xff17('0x42')](checkTranscribeJob(_0x4d189a,_0x71c8d6,_0x3433b8));});return BPromise[_0xff17('0x43')](_0x10719c);})[_0xff17('0x35')](function(_0x468439){if(_0x468439){if(!_0x468439[_0xff17('0x44')]||_0x468439['name']!=='SequelizeValidationError'){logger[_0xff17('0x37')](util[_0xff17('0x39')](_0x468439,{'showHidden':![],'depth':null}));}}});}exports[_0xff17('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xc06d=['length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','update','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','findOne','catch','name','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','push','all','SequelizeValidationError','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x2a0f44,_0x36e0b0){var _0x51d52c=function(_0x53aaa0){while(--_0x53aaa0){_0x2a0f44['push'](_0x2a0f44['shift']());}};_0x51d52c(++_0x36e0b0);}(_0xc06d,0x15a));var _0xdc06=function(_0x46a104,_0x2a47a2){_0x46a104=_0x46a104-0x0;var _0x3837ff=_0xc06d[_0x46a104];return _0x3837ff;};var _=require(_0xdc06('0x0'));var AWS=require(_0xdc06('0x1'));var rp=require(_0xdc06('0x2'));var util=require(_0xdc06('0x3'));var BPromise=require('bluebird');var db=require(_0xdc06('0x4'))['db'];var logger=require(_0xdc06('0x5'))('transcribe');function getTranscriptionJob(_0x50cf75,_0x374d2d,_0x47e159,_0x3d613b){return new Promise(function(_0x2f7692,_0x5ce60c){var _0x513a0f=new AWS[(_0xdc06('0x6'))]({'accessKeyId':_0x374d2d,'secretAccessKey':_0x50cf75,'region':_0x47e159});_0x513a0f[_0xdc06('0x7')]({'TranscriptionJobName':_0x3d613b},function(_0x52aa1f,_0x1216bf){if(_0x52aa1f){return _0x5ce60c(_0x52aa1f);}else{return _0x2f7692(_0x1216bf);}});});}function sentiment(_0x3d5ed3,_0x3ba5c4,_0x406ceb,_0x2ed1ff,_0x5d306b){return new Promise(function(_0x5e9082,_0x433450){var _0x5c508e=new AWS[(_0xdc06('0x8'))]({'accessKeyId':_0x3ba5c4,'secretAccessKey':_0x3d5ed3,'region':_0x406ceb});_0x5c508e[_0xdc06('0x9')]({'Text':_0x2ed1ff,'LanguageCode':_0x5d306b[_0xdc06('0xa')](0x0,0x2)},function(_0x233586,_0x14fa33){if(_0x233586){return _0x433450(_0x233586);}else{return _0x5e9082(_0x14fa33);}});});}function checkTranscribeJob(_0x3e4af2,_0x582ceb,_0x4b5f06){var _0xb9e716;return new BPromise(function(_0xb59b84,_0x13821f){logger['info'](util[_0xdc06('0xb')](_0xdc06('0xc'),_0x3e4af2['id'],_0x3e4af2[_0xdc06('0xd')]));return getTranscriptionJob(_0x4b5f06[_0xdc06('0xe')],_0x4b5f06[_0xdc06('0xf')],_0x582ceb['transcribeRegion'],_0x3e4af2[_0xdc06('0xd')])[_0xdc06('0x10')](function(_0x3aeca3){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x12'),_0x3e4af2['id'],_0x3e4af2[_0xdc06('0xd')],_0x3aeca3['TranscriptionJob'][_0xdc06('0x13')]));if(!_0x3e4af2[_0xdc06('0x14')]){switch(_0x3aeca3[_0xdc06('0x15')]['TranscriptionJobStatus']){case _0xdc06('0x16'):var _0x16508e={'transcribeStatus':_0x3aeca3[_0xdc06('0x15')][_0xdc06('0x13')],'fileUri':_0x3aeca3[_0xdc06('0x15')]['Transcript'][_0xdc06('0x17')]};logger['info'](util[_0xdc06('0xb')](_0xdc06('0x18'),_0x3e4af2['id']));return rp({'uri':_0x3aeca3[_0xdc06('0x15')][_0xdc06('0x19')][_0xdc06('0x17')],'json':!![]})['then'](function(_0x49444d){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x1a'),_0x3e4af2['id']));if(_0x49444d&&_0x49444d[_0xdc06('0x1b')]&&_0x49444d[_0xdc06('0x1b')][_0xdc06('0x1c')]&&_0x49444d['results']['transcripts']['length']){_0x16508e[_0xdc06('0x14')]='';for(var _0x4528ac=0x0;_0x4528ac<_0x49444d[_0xdc06('0x1b')][_0xdc06('0x1c')][_0xdc06('0x1d')];_0x4528ac++){_0x16508e[_0xdc06('0x14')]+=_0x49444d[_0xdc06('0x1b')]['transcripts'][_0x4528ac][_0xdc06('0x1e')]+'';}}return _0x3e4af2['update'](_0x16508e);})[_0xdc06('0x10')](function(){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x1f'),_0x3e4af2['id']));if(!_0x3e4af2[_0xdc06('0x20')]){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x23'));}if(!_0x582ceb[_0xdc06('0x24')]||!_0x582ceb[_0xdc06('0x25')]||!_0x582ceb[_0xdc06('0x26')]||!_0x582ceb[_0xdc06('0x27')]||!_0x582ceb[_0xdc06('0x28')]){throw new db[(_0xdc06('0x21'))]['ValidationError'](_0xdc06('0x29'));}if(!_0x16508e[_0xdc06('0x14')]){throw new Error(_0xdc06('0x2a'));}if(_0x582ceb[_0xdc06('0x25')]===_0x4b5f06['id']){return _0x4b5f06;}else{return db[_0xdc06('0x2b')]['findOne']({'where':{'id':_settings[_0xdc06('0x25')]}});}})[_0xdc06('0x10')](function(_0x2ca502){if(!_0x2ca502){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x2c'));}if(!_0x2ca502['data1']||!_0x2ca502[_0xdc06('0xf')]){throw new db['Sequelize'][(_0xdc06('0x22'))](_0xdc06('0x2d'));}_0xb9e716=_0x2ca502;logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x2e'),_0x3e4af2['id']));return sentiment(_0xb9e716[_0xdc06('0xe')],_0xb9e716[_0xdc06('0xf')],_0x582ceb[_0xdc06('0x26')],_0x16508e[_0xdc06('0x14')],_0x582ceb[_0xdc06('0x27')]);})['then'](function(_0x5c57e0){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x2f'),_0x3e4af2['id']));return _0x3e4af2['update']({'sentiment':_0x5c57e0['Sentiment'],'sPositive':_0x5c57e0[_0xdc06('0x30')][_0xdc06('0x31')],'sNegative':_0x5c57e0[_0xdc06('0x30')][_0xdc06('0x32')],'sMixed':_0x5c57e0[_0xdc06('0x30')][_0xdc06('0x33')],'sNeutral':_0x5c57e0[_0xdc06('0x30')][_0xdc06('0x34')]});})['then'](function(){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x1f'),_0x3e4af2['id']));_0xb59b84();});case _0xdc06('0x35'):return _0x3e4af2[_0xdc06('0x36')]({'transcribeStatus':'FAILED','failureReason':_0x3aeca3['TranscriptionJob'][_0xdc06('0x37')]})[_0xdc06('0x10')](function(){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x1f'),_0x3e4af2['id']));_0xb59b84();});default:logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x38'),_0x3e4af2['id']));break;}}else{return BPromise[_0xdc06('0x39')]()['then'](function(){if(!_0x3e4af2[_0xdc06('0x20')]){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x23'));}if(!_0x582ceb['sentiment']||!_0x582ceb[_0xdc06('0x25')]||!_0x582ceb[_0xdc06('0x26')]||!_0x582ceb[_0xdc06('0x27')]||!_0x582ceb[_0xdc06('0x28')]){throw new db[(_0xdc06('0x21'))]['ValidationError'](_0xdc06('0x29'));}if(!_0x3e4af2[_0xdc06('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x582ceb[_0xdc06('0x25')]===_0x4b5f06['id']){return _0x4b5f06;}else{return db[_0xdc06('0x2b')][_0xdc06('0x3a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xdc06('0x10')](function(_0xafb982){if(!_0xafb982){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x2c'));}if(!_0xafb982[_0xdc06('0xe')]||!_0xafb982[_0xdc06('0xf')]){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x2d'));}_0xb9e716=_0xafb982;logger['info'](util[_0xdc06('0xb')](_0xdc06('0x2e'),_0x3e4af2['id']));return sentiment(_0xb9e716[_0xdc06('0xe')],_0xb9e716[_0xdc06('0xf')],_0x582ceb[_0xdc06('0x26')],_0x3e4af2['fileText'],_0x582ceb[_0xdc06('0x27')]);})[_0xdc06('0x10')](function(_0x5b32b6){logger['info'](util[_0xdc06('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3e4af2['id']));return _0x3e4af2[_0xdc06('0x36')]({'sentiment':_0x5b32b6['Sentiment'],'sPositive':_0x5b32b6[_0xdc06('0x30')]['Positive'],'sNegative':_0x5b32b6[_0xdc06('0x30')][_0xdc06('0x32')],'sMixed':_0x5b32b6[_0xdc06('0x30')][_0xdc06('0x33')],'sNeutral':_0x5b32b6[_0xdc06('0x30')][_0xdc06('0x34')],'transcribeStatus':_0xdc06('0x16')});})[_0xdc06('0x10')](function(){logger[_0xdc06('0x11')](util[_0xdc06('0xb')](_0xdc06('0x1f'),_0x3e4af2['id']));_0xb59b84();});}})[_0xdc06('0x3b')](function(_0x55624f){if(_0x55624f){if(!_0x55624f[_0xdc06('0x3c')]||_0x55624f['name']!=='SequelizeValidationError'){logger[_0xdc06('0x3d')](util[_0xdc06('0xb')](_0xdc06('0x3e'),_0x3e4af2['id']),util[_0xdc06('0x3f')](_0x55624f,{'showHidden':![],'depth':null}));}}_0xb59b84();});});}function checkTranscribe(){var _0x26ad38;var _0xcaa53b;var _0xe4a6e7;return db[_0xdc06('0x40')][_0xdc06('0x41')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xdc06('0x10')](function(_0x18abee){if(!_0x18abee||!_0x18abee[_0xdc06('0x1d')]){throw new db['Sequelize'][(_0xdc06('0x22'))](_0xdc06('0x42'));}_0x26ad38=_0x18abee;return db[_0xdc06('0x43')][_0xdc06('0x3a')]({'where':{'id':0x1}});})[_0xdc06('0x10')](function(_0xd52529){if(!_0xd52529){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x44'));}_0xcaa53b=_0xd52529;if(!_0xcaa53b['transcribe']||!_0xcaa53b[_0xdc06('0x45')]||!_0xcaa53b[_0xdc06('0x46')]||!_0xcaa53b[_0xdc06('0x27')]||!_0xcaa53b['bucket']){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))](_0xdc06('0x47'));}return db['CloudProvider'][_0xdc06('0x3a')]({'where':{'id':_0xcaa53b[_0xdc06('0x45')]}});})[_0xdc06('0x10')](function(_0x710623){if(!_0x710623){throw new db[(_0xdc06('0x21'))]['ValidationError'](_0xdc06('0x2c'));}if(!_0x710623['data1']||!_0x710623[_0xdc06('0xf')]){throw new db[(_0xdc06('0x21'))][(_0xdc06('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0xe4a6e7=_0x710623;var _0x15347b=[];_0x26ad38['forEach'](function(_0x45c18b){_0x15347b[_0xdc06('0x48')](checkTranscribeJob(_0x45c18b,_0xcaa53b,_0xe4a6e7));});return BPromise[_0xdc06('0x49')](_0x15347b);})['catch'](function(_0x5021f9){if(_0x5021f9){if(!_0x5021f9['name']||_0x5021f9['name']!==_0xdc06('0x4a')){logger[_0xdc06('0x3d')](util['inspect'](_0x5021f9,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 44da8c9..0e33191 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 _0x2168=['[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error'];(function(_0x2829d1,_0x370040){var _0x52afec=function(_0x41e0b1){while(--_0x41e0b1){_0x2829d1['push'](_0x2829d1['shift']());}};_0x52afec(++_0x370040);}(_0x2168,0x112));var _0x8216=function(_0xcd2618,_0x4ce5a3){_0xcd2618=_0xcd2618-0x0;var _0x54848f=_0x2168[_0xcd2618];return _0x54848f;};'use strict';var _=require(_0x8216('0x0'));var moment=require(_0x8216('0x1'));var Redis=require('ioredis');var util=require(_0x8216('0x2'));var config=require(_0x8216('0x3'));var db=require(_0x8216('0x4'))['db'];var logger=require(_0x8216('0x5'))(_0x8216('0x6'));config[_0x8216('0x7')]=_[_0x8216('0x8')](config[_0x8216('0x7')],{'host':_0x8216('0x9'),'port':0x18eb});var io=require(_0x8216('0xa'))(new Redis(config[_0x8216('0x7')]));function closeInteractions(){var _0x4c87f1=[];return db[_0x8216('0xb')][_0x8216('0xc')]({'raw':!![],'attributes':['id',_0x8216('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8216('0xe')](0x18,_0x8216('0xf'))}}})[_0x8216('0x10')](function(_0x5267a6){if(_0x5267a6&&_0x5267a6[_0x8216('0x11')]){_0x4c87f1=_[_0x8216('0x12')](_0x5267a6||[],'id');logger['info'](_0x8216('0x13'),_0x4c87f1[_0x8216('0x14')]());return db['WhatsappInteraction'][_0x8216('0x15')]({'closeReason':_0x8216('0x16'),'disposition':_0x8216('0x17'),'closed':!![],'closedAt':moment()[_0x8216('0x18')](_0x8216('0x19'))},{'where':{'id':_0x4c87f1}});}})['then'](function(){if(_0x4c87f1&&_0x4c87f1['length']){logger[_0x8216('0x1a')](_0x8216('0x1b'),_0x4c87f1[_0x8216('0x14')]());for(var _0x59ccef=0x0;_0x59ccef<_0x4c87f1[_0x8216('0x11')];_0x59ccef++){io[_0x8216('0x1c')](_0x8216('0x1d'),{'id':_0x4c87f1[_0x59ccef],'closed':!![]});}}})[_0x8216('0x1e')](function(_0x373fa8){logger[_0x8216('0x1f')](_0x8216('0x20'),_0x373fa8?util[_0x8216('0x21')](_0x373fa8,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb02d=['subtract','hours','then','length','map','info','join','update','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../logger','redis','defaults','findAll','lastMsgAt'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb02d,0x188));var _0xdb02=function(_0x53f536,_0x370010){_0x53f536=_0x53f536-0x0;var _0x40a951=_0xb02d[_0x53f536];return _0x40a951;};'use strict';var _=require('lodash');var moment=require(_0xdb02('0x0'));var Redis=require(_0xdb02('0x1'));var util=require(_0xdb02('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xdb02('0x3'))('schedule');config[_0xdb02('0x4')]=_[_0xdb02('0x5')](config[_0xdb02('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x3e6fcb=[];return db['WhatsappInteraction'][_0xdb02('0x6')]({'raw':!![],'attributes':['id',_0xdb02('0x7')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xdb02('0x8')](0x18,_0xdb02('0x9'))}}})[_0xdb02('0xa')](function(_0x596157){if(_0x596157&&_0x596157[_0xdb02('0xb')]){_0x3e6fcb=_[_0xdb02('0xc')](_0x596157||[],'id');logger[_0xdb02('0xd')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x3e6fcb[_0xdb02('0xe')]());return db['WhatsappInteraction'][_0xdb02('0xf')]({'closeReason':_0xdb02('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xdb02('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3e6fcb}});}})[_0xdb02('0xa')](function(){if(_0x3e6fcb&&_0x3e6fcb[_0xdb02('0xb')]){logger['info'](_0xdb02('0x12'),_0x3e6fcb[_0xdb02('0xe')]());for(var _0x3f7c33=0x0;_0x3f7c33<_0x3e6fcb[_0xdb02('0xb')];_0x3f7c33++){io[_0xdb02('0x13')](_0xdb02('0x14'),{'id':_0x3e6fcb[_0x3f7c33],'closed':!![]});}}})[_0xdb02('0x15')](function(_0xced80d){logger['error'](_0xdb02('0x16'),_0xced80d?util[_0xdb02('0x17')](_0xced80d,{'showHidden':![],'depth':null}):'');});}exports[_0xdb02('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 2e0e952..a3310c6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x140e=['@xcally.com','CmContact','then','log','finished\x20populating','contacts1','destroy','CmHopper','bulkCreate','contacts2','hopper2','catch','util','push','Innocenzo','Biondo','now','innocenzo.biondo'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x140e,0x174));var _0xe140=function(_0x24b932,_0x4e4e96){_0x24b932=_0x24b932-0x0;var _0x39b930=_0x140e[_0x24b932];return _0x39b930;};'use strict';var util=require(_0xe140('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe140('0x1')]({'id':i,'firstName':_0xe140('0x2')+i,'lastName':_0xe140('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xe140('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe140('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe140('0x1')]({'id':i,'firstName':_0xe140('0x2')+i,'lastName':_0xe140('0x3')+i,'phone':0xf879fb460+i,'email':_0xe140('0x5')+i+_0xe140('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xe140('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe140('0x4')](),'updatedAt':Date[_0xe140('0x4')]()});}db[_0xe140('0x7')]['destroy']({'where':{}})[_0xe140('0x8')](function(){return db[_0xe140('0x7')]['bulkCreate'](contacts);})[_0xe140('0x8')](function(){console[_0xe140('0x9')](_0xe140('0xa'),_0xe140('0xb'));return db['CmHopper'][_0xe140('0xc')]({'where':{}});})[_0xe140('0x8')](function(){return db[_0xe140('0xd')][_0xe140('0xe')](hopper);})[_0xe140('0x8')](function(){console['log']('finished\x20populating','hopper1');return db[_0xe140('0x7')]['bulkCreate'](contacts2);})['then'](function(){console[_0xe140('0x9')]('finished\x20populating',_0xe140('0xf'));return db[_0xe140('0xd')][_0xe140('0xe')](hopper2);})[_0xe140('0x8')](function(){console['log'](_0xe140('0xa'),_0xe140('0x10'));})[_0xe140('0x11')](function(_0x1cbadc){console['log'](_0x1cbadc);}); \ No newline at end of file +var _0xe75d=['contacts2','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','CmContact','bulkCreate','log','finished\x20populating','CmHopper','hopper1'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe75d,0x111));var _0xde75=function(_0x27b0c5,_0x25915c){_0x27b0c5=_0x27b0c5-0x0;var _0x27cbe9=_0xe75d[_0x27b0c5];return _0x27cbe9;};'use strict';var util=require(_0xde75('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xde75('0x1')]({'id':i,'firstName':_0xde75('0x2')+i,'lastName':_0xde75('0x3')+i,'phone':0xf879fb460+i,'email':_0xde75('0x4')+i+_0xde75('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xde75('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xde75('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xde75('0x3')+i,'phone':0xf879fb460+i,'email':_0xde75('0x4')+i+_0xde75('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xde75('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xde75('0x6')](),'updatedAt':Date['now']()});}db['CmContact'][_0xde75('0x7')]({'where':{}})[_0xde75('0x8')](function(){return db[_0xde75('0x9')][_0xde75('0xa')](contacts);})['then'](function(){console[_0xde75('0xb')](_0xde75('0xc'),'contacts1');return db[_0xde75('0xd')][_0xde75('0x7')]({'where':{}});})[_0xde75('0x8')](function(){return db[_0xde75('0xd')][_0xde75('0xa')](hopper);})['then'](function(){console[_0xde75('0xb')]('finished\x20populating',_0xde75('0xe'));return db['CmContact']['bulkCreate'](contacts2);})[_0xde75('0x8')](function(){console[_0xde75('0xb')](_0xde75('0xc'),_0xde75('0xf'));return db[_0xde75('0xd')]['bulkCreate'](hopper2);})[_0xde75('0x8')](function(){console[_0xde75('0xb')](_0xde75('0xc'),_0xde75('0x10'));})[_0xde75('0x11')](function(_0x36593d){console[_0xde75('0xb')](_0x36593d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 9272e81..d4eea1f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f11=['wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp'];(function(_0x29d9d5,_0x5a1bd8){var _0x1be395=function(_0x54e84f){while(--_0x54e84f){_0x29d9d5['push'](_0x29d9d5['shift']());}};_0x1be395(++_0x5a1bd8);}(_0x3f11,0x1da));var _0x13f1=function(_0x43139b,_0x1d704c){_0x43139b=_0x43139b-0x0;var _0x2de4de=_0x3f11[_0x43139b];return _0x2de4de;};'use strict';var util=require(_0x13f1('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x13f1('0x1')]({'name':util['format']('%s%s','agent',i),'fullname':util['format'](_0x13f1('0x2'),_0x13f1('0x3'),i),'email':util[_0x13f1('0x4')](_0x13f1('0x5'),_0x13f1('0x3'),i),'role':_0x13f1('0x3'),'password':_0x13f1('0x6'),'internal':0xfa0+i,'type':_0x13f1('0x7'),'transport':[_0x13f1('0x8'),'ws',_0x13f1('0x9')],'disallow':[_0x13f1('0xa')],'allow':['ulaw'],'defaultuser':util[_0x13f1('0x4')](_0x13f1('0x2'),_0x13f1('0x3'),i),'encryption':_0x13f1('0xb'),'avpf':_0x13f1('0xb'),'force_avp':'yes','icesupport':_0x13f1('0xb'),'dtlsenable':_0x13f1('0xb'),'dtlsverify':'no','dtlscertfile':_0x13f1('0xc'),'dtlsprivatekey':_0x13f1('0xd'),'dtlssetup':'actpass','callerid':util[_0x13f1('0x4')](_0x13f1('0xe'),util['format'](_0x13f1('0x2'),_0x13f1('0x3'),i),0xfa0+i)});}db[_0x13f1('0xf')][_0x13f1('0x10')](users)[_0x13f1('0x11')](function(){console[_0x13f1('0x12')](_0x13f1('0x13'));})[_0x13f1('0x14')](function(_0x23f977){console[_0x13f1('0x12')](_0x23f977);}); \ No newline at end of file +var _0x37dd=['format','agent','%s%s','%s%s@xcally.com','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','log','../mysqldb'];(function(_0x2f15c5,_0x339a97){var _0x1fcff1=function(_0x49e389){while(--_0x49e389){_0x2f15c5['push'](_0x2f15c5['shift']());}};_0x1fcff1(++_0x339a97);}(_0x37dd,0x1e2));var _0xd37d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x37dd[_0x2dafbe];return _0x58a45a;};'use strict';var util=require('util');var db=require(_0xd37d('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xd37d('0x1')]('%s%s',_0xd37d('0x2'),i),'fullname':util['format'](_0xd37d('0x3'),_0xd37d('0x2'),i),'email':util['format'](_0xd37d('0x4'),_0xd37d('0x2'),i),'role':_0xd37d('0x2'),'password':'password','internal':0xfa0+i,'type':_0xd37d('0x5'),'transport':[_0xd37d('0x6'),'ws',_0xd37d('0x7')],'disallow':[_0xd37d('0x8')],'allow':[_0xd37d('0x9')],'defaultuser':util[_0xd37d('0x1')](_0xd37d('0x3'),_0xd37d('0x2'),i),'encryption':_0xd37d('0xa'),'avpf':_0xd37d('0xa'),'force_avp':_0xd37d('0xa'),'icesupport':_0xd37d('0xa'),'dtlsenable':_0xd37d('0xa'),'dtlsverify':'no','dtlscertfile':_0xd37d('0xb'),'dtlsprivatekey':_0xd37d('0xc'),'dtlssetup':_0xd37d('0xd'),'callerid':util[_0xd37d('0x1')](_0xd37d('0xe'),util[_0xd37d('0x1')]('%s%s','agent',i),0xfa0+i)});}db[_0xd37d('0xf')][_0xd37d('0x10')](users)[_0xd37d('0x11')](function(){console['log'](_0xd37d('0x12'));})[_0xd37d('0x13')](function(_0x298980){console[_0xd37d('0x14')](_0x298980);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index b77ec6c..e74ba82 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5732=['address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','CONNECTED','util','bluebird','../mysqldb','name','Agents','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','%s:queue:%s','format','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','userProfileId','ChatQueue','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','user_has_chat_interactions:remove','removeMailInteractions','emit','leave','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x5732,0xdc));var _0x2573=function(_0x20c8c7,_0x2a072b){_0x20c8c7=_0x20c8c7-0x0;var _0x2a5e51=_0x5732[_0x20c8c7];return _0x2a5e51;};'use strict';var _=require('lodash');var util=require(_0x2573('0x0'));var BPromise=require(_0x2573('0x1'));var db=require(_0x2573('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x2573('0x3')],'include':[{'as':_0x2573('0x4'),'model':db[_0x2573('0x5')],'attributes':['id',_0x2573('0x3'),_0x2573('0x6')],'raw':!![],'where':{'role':_0x2573('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2573('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x2573('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2573('0x3'),_0x2573('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x51d00c,_0x1d1728,_0x51609c){return db[_0x2573('0x9')][_0x2573('0xa')]({'where':{'name':_0x51d00c,'userProfileId':_0x1d1728},'raw':!![]})[_0x2573('0xb')](function(_0x302706){if(_0x302706){if(_0x302706[_0x2573('0xc')]){switch(_0x51d00c){case _0x2573('0xd'):case _0x2573('0xe'):case _0x2573('0xf'):case _0x2573('0x10'):case _0x2573('0x11'):case'OpenchannelQueues':case _0x2573('0x12'):return db[_0x51609c]['findAll'](queryQueues);case _0x2573('0x13'):return db[_0x51609c][_0x2573('0x14')](queryTelephones);case'Trunks':return db[_0x51609c][_0x2573('0x14')](queryTrunks);case _0x2573('0x15'):return db[_0x51609c]['findAll'](queryCampaigns);}}else{return db[_0x2573('0x16')][_0x2573('0x14')]({'attributes':[_0x2573('0x17')],'where':{'sectionId':_0x302706['id']},'raw':!![]})[_0x2573('0xb')](function(_0x5e3ee2){if(_0x5e3ee2){var _0x530f01={'where':{'id':_[_0x2573('0x18')](_0x5e3ee2,'resourceId')},'raw':!![]};switch(_0x51609c){case _0x2573('0x5'):_0x530f01[_0x2573('0x19')]['role']=_0x2573('0x1a');break;case _0x2573('0x1b'):_0x530f01[_0x2573('0x19')][_0x2573('0x8')]='ivr';break;}return db[_0x51609c][_0x2573('0x14')](_0x530f01);}else{return[];}});}}else{return[];}})[_0x2573('0xb')](function(_0x6d2bea){return _0x6d2bea;});}function joinOrLeaveQueues(_0x4089b8,_0x3d88d8,_0x36e8f6,_0x3f7887){_0x4089b8[_0x3d88d8](util['format'](_0x2573('0x1c'),_0x36e8f6,_0x3f7887[_0x2573('0x3')]));if(_0x3f7887[_0x2573('0x4')]){for(var _0x48a4bc=0x0;_0x48a4bc<_0x3f7887['Agents']['length'];_0x48a4bc+=0x1){_0x4089b8[_0x3d88d8](util[_0x2573('0x1d')](_0x2573('0x1e'),_0x3f7887[_0x2573('0x4')][_0x48a4bc][_0x2573('0x3')]));}}}function joinOrLeave(_0x54fbe3,_0x13f67d,_0x17adc1){var _0x360c1b;if(_0x54fbe3[_0x2573('0x1f')][_0x2573('0x20')]['id']){db['User'][_0x2573('0x21')]({'attributes':['id',_0x2573('0x3'),_0x2573('0x6'),'userProfileId'],'where':{'id':_0x54fbe3[_0x2573('0x1f')][_0x2573('0x20')]['id']},'include':[{'model':db[_0x2573('0x22')],'as':_0x2573('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x2573('0x24')],'as':_0x2573('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2573('0x26')],'as':_0x2573('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2573('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2573('0x29')],'as':_0x2573('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x2573('0x2b')],'as':_0x2573('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x2573('0xb')](function(_0x79215a){if(_0x79215a){_0x360c1b=_0x79215a;_0x54fbe3[_0x13f67d](util[_0x2573('0x1d')]('user:%s',_0x79215a[_0x2573('0x3')]));var _0x2410e6=[];switch(_0x79215a[_0x2573('0x6')]){case _0x2573('0x2d'):_0x54fbe3[_0x13f67d](_0x2573('0x2e'));_0x54fbe3[_0x13f67d]('voice:outbound');if(queryQueues[_0x2573('0x2f')](_0x2573('0x30'))){delete queryQueues[_0x2573('0x30')];}_0x2410e6[_0x2573('0x31')](db[_0x2573('0x32')][_0x2573('0x14')](queryQueues));_0x2410e6[_0x2573('0x31')](db['ChatQueue']['findAll'](queryQueues));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x33')][_0x2573('0x14')](queryQueues));_0x2410e6['push'](db[_0x2573('0x34')][_0x2573('0x14')](queryQueues));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x35')][_0x2573('0x14')](queryQueues));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x36')]['findAll'](queryQueues));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x37')]['findAll'](queryQueues));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x5')][_0x2573('0x14')](queryTelephones));_0x2410e6[_0x2573('0x31')](db[_0x2573('0x38')][_0x2573('0x14')](queryTrunks));_0x2410e6[_0x2573('0x31')](db['Campaign'][_0x2573('0x14')](queryCampaigns));_0x2410e6['push'](db['User'][_0x2573('0x14')](queryAgents));break;case _0x2573('0x39'):_0x54fbe3[_0x13f67d](_0x2573('0x2e'));_0x54fbe3[_0x13f67d](_0x2573('0x3a'));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0xd'),_0x79215a[_0x2573('0x3b')],'VoiceQueue'));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0xe'),_0x79215a['userProfileId'],_0x2573('0x3c')));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0xf'),_0x79215a[_0x2573('0x3b')],_0x2573('0x33')));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0x10'),_0x79215a['userProfileId'],_0x2573('0x34')));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0x11'),_0x79215a[_0x2573('0x3b')],'MailQueue'));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0x3d'),_0x79215a[_0x2573('0x3b')],_0x2573('0x36')));_0x2410e6['push'](getAssociatedResources('WhatsappQueues',_0x79215a[_0x2573('0x3b')],_0x2573('0x37')));_0x2410e6[_0x2573('0x31')](getAssociatedResources(_0x2573('0x13'),_0x79215a[_0x2573('0x3b')],'User'));_0x2410e6[_0x2573('0x31')](getAssociatedResources('Trunks',_0x79215a[_0x2573('0x3b')],_0x2573('0x38')));_0x2410e6[_0x2573('0x31')](getAssociatedResources('IvrCampaigns',_0x79215a[_0x2573('0x3b')],_0x2573('0x1b')));_0x2410e6['push'](db[_0x2573('0x5')][_0x2573('0x14')](queryAgents));break;case _0x2573('0x7'):_0x54fbe3[_0x13f67d](_0x2573('0x2e'));_0x54fbe3[_0x13f67d](_0x2573('0x3a'));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x3e')]({'attributes':['id',_0x2573('0x3')]}));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x3f')]({'attributes':['id',_0x2573('0x3')]}));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x40')]({'attributes':['id',_0x2573('0x3')]}));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x41')]({'attributes':['id','name']}));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x42')]({'attributes':['id',_0x2573('0x3')]}));_0x2410e6[_0x2573('0x31')](_0x79215a[_0x2573('0x43')]({'attributes':['id','name']}));_0x2410e6['push'](_0x79215a[_0x2573('0x44')]({'attributes':['id',_0x2573('0x3')]}));break;}return BPromise[_0x2573('0x45')](_0x2410e6);}})[_0x2573('0xb')](function(_0x11902e){if(_0x11902e&&_0x11902e['length']){for(var _0x1c8ec8=0x0;_0x1c8ec8<_0x11902e[_0x2573('0x46')];_0x1c8ec8+=0x1){for(var _0x4109cf=0x0;_0x4109cf<_0x11902e[_0x1c8ec8][_0x2573('0x46')];_0x4109cf+=0x1){switch(_0x1c8ec8){case 0x0:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x47'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x1:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,'chat',_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x2:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x48'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x3:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x49'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x4:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x4a'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x5:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x4b'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x6:joinOrLeaveQueues(_0x54fbe3,_0x13f67d,_0x2573('0x4c'),_0x11902e[_0x1c8ec8][_0x4109cf]);break;case 0x7:if(_0x360c1b[_0x2573('0x6')]!==_0x2573('0x7'))_0x54fbe3[_0x13f67d](util['format'](_0x2573('0x4d'),_0x11902e[_0x1c8ec8][_0x4109cf][_0x2573('0x3')]));break;case 0x8:if(_0x360c1b[_0x2573('0x6')]!==_0x2573('0x7'))_0x54fbe3[_0x13f67d](util[_0x2573('0x1d')]('trunk:%s',_0x11902e[_0x1c8ec8][_0x4109cf]['name']));break;case 0x9:if(_0x360c1b[_0x2573('0x6')]!==_0x2573('0x7'))_0x54fbe3[_0x13f67d](util['format'](_0x2573('0x4e'),_0x11902e[_0x1c8ec8][_0x4109cf][_0x2573('0x8')],_0x11902e[_0x1c8ec8][_0x4109cf][_0x2573('0x3')]));break;case 0xa:_0x54fbe3[_0x13f67d](util[_0x2573('0x1d')](_0x2573('0x1e'),_0x11902e[_0x1c8ec8][_0x4109cf][_0x2573('0x3')]));break;}}}}})['then'](function(){if(_0x13f67d==='leave'){var _0x1903e9=_[_0x2573('0x18')](_0x360c1b['ChatInteractions'],'id');return _0x360c1b['removeChatInteractions'](_0x1903e9)[_0x2573('0xb')](function(){for(var _0x3987b4=0x0;_0x3987b4<_0x1903e9[_0x2573('0x46')];_0x3987b4+=0x1){_0x17adc1['emit'](_0x2573('0x4f'),{'ChatInteractionId':Number(_0x1903e9[_0x3987b4]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0xb')](function(){if(_0x13f67d==='leave'){var _0x28f666=_[_0x2573('0x18')](_0x360c1b[_0x2573('0x25')],'id');return _0x360c1b[_0x2573('0x50')](_0x28f666)[_0x2573('0xb')](function(){for(var _0x14b1e3=0x0;_0x14b1e3<_0x28f666[_0x2573('0x46')];_0x14b1e3+=0x1){_0x17adc1[_0x2573('0x51')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x28f666[_0x14b1e3]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0xb')](function(){if(_0x13f67d===_0x2573('0x52')){var _0x5f16f7=_[_0x2573('0x18')](_0x360c1b[_0x2573('0x27')],'id');return _0x360c1b[_0x2573('0x53')](_0x5f16f7)[_0x2573('0xb')](function(){for(var _0x47d9b3=0x0;_0x47d9b3<_0x5f16f7[_0x2573('0x46')];_0x47d9b3+=0x1){_0x17adc1[_0x2573('0x51')](_0x2573('0x54'),{'FaxInteractionId':Number(_0x5f16f7[_0x47d9b3]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0xb')](function(){if(_0x13f67d===_0x2573('0x52')){var _0x22e8a4=_['map'](_0x360c1b[_0x2573('0x55')],'id');return _0x360c1b['removeSmsInteractions'](_0x22e8a4)[_0x2573('0xb')](function(){for(var _0x294c86=0x0;_0x294c86<_0x22e8a4[_0x2573('0x46')];_0x294c86+=0x1){_0x17adc1[_0x2573('0x51')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x22e8a4[_0x294c86]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0xb')](function(){if(_0x13f67d==='leave'){var _0x58394b=_[_0x2573('0x18')](_0x360c1b[_0x2573('0x2a')],'id');return _0x360c1b[_0x2573('0x56')](_0x58394b)[_0x2573('0xb')](function(){for(var _0x413ba2=0x0;_0x413ba2<_0x58394b['length'];_0x413ba2+=0x1){_0x17adc1[_0x2573('0x51')](_0x2573('0x57'),{'OpenchannelInteractionId':Number(_0x58394b[_0x413ba2]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0xb')](function(){if(_0x13f67d==='leave'){var _0x4e98f1=_['map'](_0x360c1b[_0x2573('0x2c')],'id');return _0x360c1b[_0x2573('0x58')](_0x4e98f1)[_0x2573('0xb')](function(){for(var _0x2d4eb9=0x0;_0x2d4eb9<_0x4e98f1[_0x2573('0x46')];_0x2d4eb9+=0x1){_0x17adc1[_0x2573('0x51')](_0x2573('0x59'),{'WhatsappInteractionId':Number(_0x4e98f1[_0x2d4eb9]),'UserId':Number(_0x360c1b['id'])});}});}})[_0x2573('0x5a')](function(_0x5f0f0b){_0x54fbe3['log'](_0x5f0f0b);});}}function onDisconnect(_0x36de0c,_0x4e4508){joinOrLeave(_0x36de0c,_0x2573('0x52'),_0x4e4508);}function onConnect(_0x3500f8){joinOrLeave(_0x3500f8,_0x2573('0x5b'));}exports[_0x2573('0x5c')]=function(_0x2cff8b){_0x2cff8b['on'](_0x2573('0x5d'),function(_0x33004d){_0x33004d[_0x2573('0x5e')](0x0);_0x33004d[_0x2573('0x5f')]=_0x33004d[_0x2573('0x60')][_0x2573('0x5d')][_0x2573('0x61')]+':'+_0x33004d['request'][_0x2573('0x5d')][_0x2573('0x62')];_0x33004d[_0x2573('0x63')]=new Date();_0x33004d[_0x2573('0x64')]=function(_0x286f10){console[_0x2573('0x64')](_0x2573('0x65')+_0x33004d[_0x2573('0x66')][_0x2573('0x3')]+'['+_0x33004d['address']+']',_0x286f10);};_0x33004d['on'](_0x2573('0x67'),function(){onDisconnect(_0x33004d,_0x2cff8b);_0x33004d['log']('DISCONNECTED');});onConnect(_0x33004d);_0x33004d[_0x2573('0x64')](_0x2573('0x68'));});}; \ No newline at end of file +var _0x4813=['campaign:%s:%s','emit','user_has_chat_interactions:remove','leave','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','Agents','role','agent','telephone','type','UserProfileSection','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','UserProfileResource','map','resourceId','User','where','Campaign','ivr','%s:queue:%s','format','user:%s','query','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','user','voice:inbound','VoiceQueues','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueues','WhatsappQueue','Trunk','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','openchannel','telephone:%s'];(function(_0x363d9c,_0x40fd02){var _0x1d1c0c=function(_0x5773c3){while(--_0x5773c3){_0x363d9c['push'](_0x363d9c['shift']());}};_0x1d1c0c(++_0x40fd02);}(_0x4813,0xdc));var _0x3481=function(_0x34e250,_0x513da5){_0x34e250=_0x34e250-0x0;var _0x229bfa=_0x4813[_0x34e250];return _0x229bfa;};'use strict';var _=require(_0x3481('0x0'));var util=require('util');var BPromise=require(_0x3481('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x3481('0x2')],'include':[{'as':_0x3481('0x3'),'model':db['User'],'attributes':['id',_0x3481('0x2'),_0x3481('0x4')],'raw':!![],'where':{'role':_0x3481('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x3481('0x2')],'where':{'role':_0x3481('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x3481('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x3481('0x2')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x3481('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x17e61e,_0x216ad0,_0x39b6c4){return db[_0x3481('0x8')][_0x3481('0x9')]({'where':{'name':_0x17e61e,'userProfileId':_0x216ad0},'raw':!![]})[_0x3481('0xa')](function(_0xf24905){if(_0xf24905){if(_0xf24905['autoAssociation']){switch(_0x17e61e){case'VoiceQueues':case _0x3481('0xb'):case _0x3481('0xc'):case _0x3481('0xd'):case _0x3481('0xe'):case _0x3481('0xf'):case'WhatsappQueues':return db[_0x39b6c4][_0x3481('0x10')](queryQueues);case _0x3481('0x11'):return db[_0x39b6c4][_0x3481('0x10')](queryTelephones);case _0x3481('0x12'):return db[_0x39b6c4][_0x3481('0x10')](queryTrunks);case'IvrCampaigns':return db[_0x39b6c4]['findAll'](queryCampaigns);}}else{return db[_0x3481('0x13')][_0x3481('0x10')]({'attributes':['resourceId'],'where':{'sectionId':_0xf24905['id']},'raw':!![]})[_0x3481('0xa')](function(_0x1204a1){if(_0x1204a1){var _0x17b17a={'where':{'id':_[_0x3481('0x14')](_0x1204a1,_0x3481('0x15'))},'raw':!![]};switch(_0x39b6c4){case _0x3481('0x16'):_0x17b17a[_0x3481('0x17')]['role']=_0x3481('0x6');break;case _0x3481('0x18'):_0x17b17a[_0x3481('0x17')][_0x3481('0x7')]=_0x3481('0x19');break;}return db[_0x39b6c4][_0x3481('0x10')](_0x17b17a);}else{return[];}});}}else{return[];}})[_0x3481('0xa')](function(_0x3101ba){return _0x3101ba;});}function joinOrLeaveQueues(_0x4fc770,_0x85609f,_0x525ed1,_0x1f882f){_0x4fc770[_0x85609f](util['format'](_0x3481('0x1a'),_0x525ed1,_0x1f882f[_0x3481('0x2')]));if(_0x1f882f[_0x3481('0x3')]){for(var _0x3ead0c=0x0;_0x3ead0c<_0x1f882f[_0x3481('0x3')]['length'];_0x3ead0c+=0x1){_0x4fc770[_0x85609f](util[_0x3481('0x1b')](_0x3481('0x1c'),_0x1f882f[_0x3481('0x3')][_0x3ead0c][_0x3481('0x2')]));}}}function joinOrLeave(_0x2c5777,_0x504a12,_0x2e620f){var _0x3ef2c2;if(_0x2c5777['handshake'][_0x3481('0x1d')]['id']){db[_0x3481('0x16')]['find']({'attributes':['id',_0x3481('0x2'),_0x3481('0x4'),_0x3481('0x1e')],'where':{'id':_0x2c5777[_0x3481('0x1f')][_0x3481('0x1d')]['id']},'include':[{'model':db[_0x3481('0x20')],'as':_0x3481('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x3481('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x3481('0x23')],'as':_0x3481('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x3481('0x25')],'as':_0x3481('0x26'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x3481('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x3481('0x28')],'as':_0x3481('0x29'),'attributes':['id'],'raw':!![]}]})[_0x3481('0xa')](function(_0x12e5d6){if(_0x12e5d6){_0x3ef2c2=_0x12e5d6;_0x2c5777[_0x504a12](util[_0x3481('0x1b')]('user:%s',_0x12e5d6[_0x3481('0x2')]));var _0x249760=[];switch(_0x12e5d6[_0x3481('0x4')]){case'admin':_0x2c5777[_0x504a12]('voice:inbound');_0x2c5777[_0x504a12](_0x3481('0x2a'));if(queryQueues[_0x3481('0x2b')](_0x3481('0x2c'))){delete queryQueues[_0x3481('0x2c')];}_0x249760[_0x3481('0x2d')](db['VoiceQueue'][_0x3481('0x10')](queryQueues));_0x249760[_0x3481('0x2d')](db['ChatQueue'][_0x3481('0x10')](queryQueues));_0x249760[_0x3481('0x2d')](db[_0x3481('0x2e')]['findAll'](queryQueues));_0x249760['push'](db['SmsQueue'][_0x3481('0x10')](queryQueues));_0x249760[_0x3481('0x2d')](db[_0x3481('0x2f')]['findAll'](queryQueues));_0x249760['push'](db['OpenchannelQueue'][_0x3481('0x10')](queryQueues));_0x249760['push'](db['WhatsappQueue'][_0x3481('0x10')](queryQueues));_0x249760[_0x3481('0x2d')](db[_0x3481('0x16')][_0x3481('0x10')](queryTelephones));_0x249760[_0x3481('0x2d')](db['Trunk']['findAll'](queryTrunks));_0x249760[_0x3481('0x2d')](db[_0x3481('0x18')][_0x3481('0x10')](queryCampaigns));_0x249760['push'](db['User']['findAll'](queryAgents));break;case _0x3481('0x30'):_0x2c5777[_0x504a12](_0x3481('0x31'));_0x2c5777[_0x504a12](_0x3481('0x2a'));_0x249760['push'](getAssociatedResources(_0x3481('0x32'),_0x12e5d6['userProfileId'],_0x3481('0x33')));_0x249760[_0x3481('0x2d')](getAssociatedResources(_0x3481('0xb'),_0x12e5d6['userProfileId'],_0x3481('0x34')));_0x249760['push'](getAssociatedResources(_0x3481('0xc'),_0x12e5d6[_0x3481('0x1e')],_0x3481('0x2e')));_0x249760[_0x3481('0x2d')](getAssociatedResources('SmsQueues',_0x12e5d6[_0x3481('0x1e')],_0x3481('0x35')));_0x249760['push'](getAssociatedResources('MailQueues',_0x12e5d6[_0x3481('0x1e')],_0x3481('0x2f')));_0x249760[_0x3481('0x2d')](getAssociatedResources(_0x3481('0xf'),_0x12e5d6[_0x3481('0x1e')],_0x3481('0x36')));_0x249760[_0x3481('0x2d')](getAssociatedResources(_0x3481('0x37'),_0x12e5d6[_0x3481('0x1e')],_0x3481('0x38')));_0x249760[_0x3481('0x2d')](getAssociatedResources('Telephones',_0x12e5d6[_0x3481('0x1e')],'User'));_0x249760[_0x3481('0x2d')](getAssociatedResources('Trunks',_0x12e5d6[_0x3481('0x1e')],_0x3481('0x39')));_0x249760[_0x3481('0x2d')](getAssociatedResources('IvrCampaigns',_0x12e5d6[_0x3481('0x1e')],_0x3481('0x18')));_0x249760[_0x3481('0x2d')](db[_0x3481('0x16')]['findAll'](queryAgents));break;case _0x3481('0x5'):_0x2c5777[_0x504a12](_0x3481('0x31'));_0x2c5777[_0x504a12]('voice:outbound');_0x249760['push'](_0x12e5d6[_0x3481('0x3a')]({'attributes':['id',_0x3481('0x2')]}));_0x249760[_0x3481('0x2d')](_0x12e5d6[_0x3481('0x3b')]({'attributes':['id','name']}));_0x249760[_0x3481('0x2d')](_0x12e5d6['getFaxQueues']({'attributes':['id',_0x3481('0x2')]}));_0x249760['push'](_0x12e5d6['getSmsQueues']({'attributes':['id',_0x3481('0x2')]}));_0x249760['push'](_0x12e5d6[_0x3481('0x3c')]({'attributes':['id',_0x3481('0x2')]}));_0x249760[_0x3481('0x2d')](_0x12e5d6[_0x3481('0x3d')]({'attributes':['id',_0x3481('0x2')]}));_0x249760['push'](_0x12e5d6[_0x3481('0x3e')]({'attributes':['id',_0x3481('0x2')]}));break;}return BPromise[_0x3481('0x3f')](_0x249760);}})[_0x3481('0xa')](function(_0x18e25b){if(_0x18e25b&&_0x18e25b['length']){for(var _0x8a5590=0x0;_0x8a5590<_0x18e25b['length'];_0x8a5590+=0x1){for(var _0x44485e=0x0;_0x44485e<_0x18e25b[_0x8a5590][_0x3481('0x40')];_0x44485e+=0x1){switch(_0x8a5590){case 0x0:joinOrLeaveQueues(_0x2c5777,_0x504a12,'voice',_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x1:joinOrLeaveQueues(_0x2c5777,_0x504a12,_0x3481('0x41'),_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x2:joinOrLeaveQueues(_0x2c5777,_0x504a12,_0x3481('0x42'),_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x3:joinOrLeaveQueues(_0x2c5777,_0x504a12,_0x3481('0x43'),_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x4:joinOrLeaveQueues(_0x2c5777,_0x504a12,_0x3481('0x44'),_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x5:joinOrLeaveQueues(_0x2c5777,_0x504a12,_0x3481('0x45'),_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x6:joinOrLeaveQueues(_0x2c5777,_0x504a12,'whatsapp',_0x18e25b[_0x8a5590][_0x44485e]);break;case 0x7:if(_0x3ef2c2[_0x3481('0x4')]!==_0x3481('0x5'))_0x2c5777[_0x504a12](util[_0x3481('0x1b')](_0x3481('0x46'),_0x18e25b[_0x8a5590][_0x44485e][_0x3481('0x2')]));break;case 0x8:if(_0x3ef2c2[_0x3481('0x4')]!=='agent')_0x2c5777[_0x504a12](util[_0x3481('0x1b')]('trunk:%s',_0x18e25b[_0x8a5590][_0x44485e]['name']));break;case 0x9:if(_0x3ef2c2['role']!=='agent')_0x2c5777[_0x504a12](util[_0x3481('0x1b')](_0x3481('0x47'),_0x18e25b[_0x8a5590][_0x44485e][_0x3481('0x7')],_0x18e25b[_0x8a5590][_0x44485e][_0x3481('0x2')]));break;case 0xa:_0x2c5777[_0x504a12](util[_0x3481('0x1b')]('user:%s',_0x18e25b[_0x8a5590][_0x44485e]['name']));break;}}}}})[_0x3481('0xa')](function(){if(_0x504a12==='leave'){var _0x3a5dd1=_['map'](_0x3ef2c2[_0x3481('0x21')],'id');return _0x3ef2c2['removeChatInteractions'](_0x3a5dd1)[_0x3481('0xa')](function(){for(var _0x207240=0x0;_0x207240<_0x3a5dd1[_0x3481('0x40')];_0x207240+=0x1){_0x2e620f[_0x3481('0x48')](_0x3481('0x49'),{'ChatInteractionId':Number(_0x3a5dd1[_0x207240]),'UserId':Number(_0x3ef2c2['id'])});}});}})['then'](function(){if(_0x504a12===_0x3481('0x4a')){var _0x1bad36=_[_0x3481('0x14')](_0x3ef2c2[_0x3481('0x22')],'id');return _0x3ef2c2['removeMailInteractions'](_0x1bad36)['then'](function(){for(var _0x114024=0x0;_0x114024<_0x1bad36[_0x3481('0x40')];_0x114024+=0x1){_0x2e620f[_0x3481('0x48')](_0x3481('0x4b'),{'MailInteractionId':Number(_0x1bad36[_0x114024]),'UserId':Number(_0x3ef2c2['id'])});}});}})[_0x3481('0xa')](function(){if(_0x504a12===_0x3481('0x4a')){var _0x20d9f7=_['map'](_0x3ef2c2[_0x3481('0x24')],'id');return _0x3ef2c2[_0x3481('0x4c')](_0x20d9f7)[_0x3481('0xa')](function(){for(var _0x32db7e=0x0;_0x32db7e<_0x20d9f7[_0x3481('0x40')];_0x32db7e+=0x1){_0x2e620f[_0x3481('0x48')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x20d9f7[_0x32db7e]),'UserId':Number(_0x3ef2c2['id'])});}});}})[_0x3481('0xa')](function(){if(_0x504a12==='leave'){var _0x4b105f=_['map'](_0x3ef2c2[_0x3481('0x26')],'id');return _0x3ef2c2['removeSmsInteractions'](_0x4b105f)[_0x3481('0xa')](function(){for(var _0x3f381d=0x0;_0x3f381d<_0x4b105f[_0x3481('0x40')];_0x3f381d+=0x1){_0x2e620f[_0x3481('0x48')](_0x3481('0x4d'),{'SmsInteractionId':Number(_0x4b105f[_0x3f381d]),'UserId':Number(_0x3ef2c2['id'])});}});}})[_0x3481('0xa')](function(){if(_0x504a12==='leave'){var _0x392101=_['map'](_0x3ef2c2[_0x3481('0x27')],'id');return _0x3ef2c2[_0x3481('0x4e')](_0x392101)[_0x3481('0xa')](function(){for(var _0x165866=0x0;_0x165866<_0x392101[_0x3481('0x40')];_0x165866+=0x1){_0x2e620f['emit'](_0x3481('0x4f'),{'OpenchannelInteractionId':Number(_0x392101[_0x165866]),'UserId':Number(_0x3ef2c2['id'])});}});}})[_0x3481('0xa')](function(){if(_0x504a12===_0x3481('0x4a')){var _0x2765a2=_[_0x3481('0x14')](_0x3ef2c2[_0x3481('0x29')],'id');return _0x3ef2c2[_0x3481('0x50')](_0x2765a2)['then'](function(){for(var _0x3bfaa9=0x0;_0x3bfaa9<_0x2765a2[_0x3481('0x40')];_0x3bfaa9+=0x1){_0x2e620f[_0x3481('0x48')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2765a2[_0x3bfaa9]),'UserId':Number(_0x3ef2c2['id'])});}});}})[_0x3481('0x51')](function(_0x2e5c42){_0x2c5777[_0x3481('0x52')](_0x2e5c42);});}}function onDisconnect(_0x459491,_0x202304){joinOrLeave(_0x459491,_0x3481('0x4a'),_0x202304);}function onConnect(_0x537fdb){joinOrLeave(_0x537fdb,_0x3481('0x53'));}exports[_0x3481('0x54')]=function(_0x28bdf4){_0x28bdf4['on'](_0x3481('0x55'),function(_0x211254){_0x211254[_0x3481('0x56')](0x0);_0x211254[_0x3481('0x57')]=_0x211254[_0x3481('0x58')][_0x3481('0x55')][_0x3481('0x59')]+':'+_0x211254[_0x3481('0x58')][_0x3481('0x55')][_0x3481('0x5a')];_0x211254[_0x3481('0x5b')]=new Date();_0x211254[_0x3481('0x52')]=function(_0x2b1d99){console['log'](_0x3481('0x5c')+_0x211254[_0x3481('0x5d')][_0x3481('0x2')]+'['+_0x211254[_0x3481('0x57')]+']',_0x2b1d99);};_0x211254['on'](_0x3481('0x5e'),function(){onDisconnect(_0x211254,_0x28bdf4);_0x211254[_0x3481('0x52')](_0x3481('0x5f'));});onConnect(_0x211254);_0x211254['log'](_0x3481('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 0a94712..66c9a65 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 _0x5aa6=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','SIP/%s','name','agent','AfterCreate','changed','closed','substatus','fullname','email','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','http','ChatInteraction','afterCreate','Chat','afterUpdate','closedinteraction','ChatMessage','Sms','SmsInteraction','newinteraction','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','motionChannel','direction','resolve','ContactId','undefined','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','channel','incomingmessage','AfterCreateMessage','event','offlineMessage','opened'];(function(_0x18568a,_0x196422){var _0x4c1da2=function(_0x555f3e){while(--_0x555f3e){_0x18568a['push'](_0x18568a['shift']());}};_0x4c1da2(++_0x196422);}(_0x5aa6,0xa3));var _0x65aa=function(_0x4e643e,_0x33c1a3){_0x4e643e=_0x4e643e-0x0;var _0xeea004=_0x5aa6[_0x4e643e];return _0xeea004;};'use strict';var util=require('util');var db=require(_0x65aa('0x0'))['db'];var jayson=require(_0x65aa('0x1'));var logger=require(_0x65aa('0x2'))('triggers');var client=jayson['client'][_0x65aa('0x3')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x65aa('0x4'),'event':_0x65aa('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x65aa('0x6'),'model':'ChatInteraction','event':_0x65aa('0x7'),'condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':_0x65aa('0x6'),'model':_0x65aa('0x9'),'event':_0x65aa('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x65aa('0x6'),'model':'ChatOfflineMessage','event':_0x65aa('0x5'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x65aa('0xa'),'model':_0x65aa('0xb'),'event':_0x65aa('0x5'),'condition':_0x65aa('0xc'),'callback':afterCreate},{'channel':_0x65aa('0xa'),'model':'SmsInteraction','event':'afterUpdate','condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0x65aa('0x5'),'condition':_0x65aa('0xd'),'callback':afterCreateMessage},{'channel':_0x65aa('0xe'),'model':_0x65aa('0xf'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterUpdate','condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':_0x65aa('0xe'),'model':_0x65aa('0x10'),'event':_0x65aa('0x5'),'condition':_0x65aa('0xd'),'callback':afterCreateMessage},{'channel':_0x65aa('0x11'),'model':_0x65aa('0x12'),'event':_0x65aa('0x5'),'condition':_0x65aa('0xc'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x65aa('0x7'),'condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':_0x65aa('0x11'),'model':_0x65aa('0x13'),'event':_0x65aa('0x5'),'condition':_0x65aa('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x65aa('0x14'),'event':'afterCreate','condition':_0x65aa('0xc'),'callback':afterCreate},{'channel':_0x65aa('0x15'),'model':_0x65aa('0x14'),'event':'afterUpdate','condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':_0x65aa('0x15'),'model':'MailMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x65aa('0x16'),'model':_0x65aa('0x17'),'event':'afterCreate','condition':_0x65aa('0xc'),'callback':afterCreate},{'channel':_0x65aa('0x16'),'model':_0x65aa('0x17'),'event':'afterUpdate','condition':_0x65aa('0x8'),'callback':afterUpdate},{'channel':_0x65aa('0x16'),'model':_0x65aa('0x18'),'event':_0x65aa('0x5'),'condition':_0x65aa('0xd'),'callback':afterCreateMessage}];function request(_0x585267){return client[_0x65aa('0x19')](_0x65aa('0x1a'),_0x585267)[_0x65aa('0x1b')](function(_0x406644){logger[_0x65aa('0x1c')](_0x65aa('0x1d'),_0x65aa('0x1a'),_0x406644);if(_0x406644['error']){if(_0x406644[_0x65aa('0x1e')][_0x65aa('0x1f')]===0x1f4){logger[_0x65aa('0x1e')](_0x65aa('0x1d'),_0x65aa('0x1a'),_0x406644[_0x65aa('0x1e')]);}}})[_0x65aa('0x20')](function(_0x4e6d32){logger[_0x65aa('0x1e')](_0x65aa('0x1d'),_0x65aa('0x1a'),_0x4e6d32);});}function afterCreateMessage(_0x4e78e5){return function(_0x1a6da4){_0x1a6da4=_0x1a6da4[_0x65aa('0x21')]({'plain':!![]});_0x1a6da4['channel']=_0x4e78e5;_0x1a6da4[_0x65aa('0x22')]=_0x4e78e5;_0x1a6da4['event']=_0x1a6da4[_0x65aa('0x23')];Promise[_0x65aa('0x24')]()[_0x65aa('0x1b')](function(){if(typeof _0x1a6da4[_0x65aa('0x25')]===_0x65aa('0x26'))return null;var _0x14f1ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a6da4['ContactId'];return db[_0x65aa('0x27')][_0x65aa('0x28')](_0x14f1ff,{'type':db[_0x65aa('0x29')][_0x65aa('0x2a')][_0x65aa('0x2b')],'raw':!![]});})[_0x65aa('0x1b')](function(_0x8c1f5){if(_0x8c1f5){_0x1a6da4['contact']=_0x8c1f5[0x0];}if(typeof _0x1a6da4[_0x65aa('0x2c')]===_0x65aa('0x26'))return;return getAgent(_0x1a6da4[_0x65aa('0x2c')]);})['then'](function(_0x4f8dd9){if(_0x4f8dd9){_0x1a6da4[_0x65aa('0x2d')]=util[_0x65aa('0x2e')]('SIP/%s',_0x4f8dd9['name']);_0x1a6da4['agent']=_0x4f8dd9;_0x1a6da4[_0x65aa('0x2f')]=_0x4e78e5;return request({'event':_0x65aa('0x30'),'message':_0x1a6da4});}else{return request({'event':'outgoingmessage','message':_0x1a6da4});}})[_0x65aa('0x20')](function(_0x2d1308){logger[_0x65aa('0x1e')]('Trigger,\x20%s',_0x65aa('0x31'),_0x2d1308);});};}function afterCreateOfflineMessage(_0x58d81f){return function(_0x55d377){_0x55d377=_0x55d377[_0x65aa('0x21')]({'plain':!![]});_0x55d377[_0x65aa('0x2f')]=_0x58d81f;_0x55d377[_0x65aa('0x22')]=_0x58d81f;_0x55d377[_0x65aa('0x32')]=_0x65aa('0x33');return request({'event':_0x55d377[_0x65aa('0x32')],'message':_0x55d377});};}function afterCreate(_0x5491c9,_0x4526e6){return function(_0x2a54ad){_0x2a54ad=_0x2a54ad[_0x65aa('0x21')]({'plain':!![]});_0x2a54ad[_0x65aa('0x2f')]=_0x5491c9;_0x2a54ad[_0x65aa('0x22')]=_0x5491c9;_0x2a54ad['event']=_0x65aa('0x34');Promise[_0x65aa('0x24')]()[_0x65aa('0x1b')](function(){var _0x28736c=_0x65aa('0x35')+_0x2a54ad['ContactId'];return db['sequelize'][_0x65aa('0x28')](_0x28736c,{'type':db[_0x65aa('0x29')][_0x65aa('0x2a')][_0x65aa('0x2b')],'raw':!![]});})[_0x65aa('0x1b')](function(_0x48355f){if(_0x48355f){_0x2a54ad[_0x65aa('0x36')]=_0x48355f[0x0];}if(typeof _0x2a54ad[_0x65aa('0x2c')]==='undefined')return;return getAgent(_0x2a54ad['UserId']);})[_0x65aa('0x1b')](function(_0x18be6c){if(_0x18be6c){_0x2a54ad['interface']=util['format'](_0x65aa('0x37'),_0x18be6c[_0x65aa('0x38')]);_0x2a54ad[_0x65aa('0x39')]=_0x18be6c;}return request({'event':_0x4526e6,'message':_0x2a54ad});})[_0x65aa('0x20')](function(_0x5c14e3){logger[_0x65aa('0x1e')](_0x65aa('0x1d'),_0x65aa('0x3a'),_0x5c14e3);});};}function afterUpdate(_0x1e5a80){return function(_0x3fc314){var _0x2ecc9c=_0x3fc314[_0x65aa('0x3b')](_0x65aa('0x3c'))&&_0x3fc314[_0x65aa('0x3c')];var _0x1e8fb8=_0x3fc314['changed'](_0x65aa('0x3d'));if(_0x2ecc9c||_0x1e8fb8){var _0x2b8de4=_0x2ecc9c?_0x65aa('0x8'):_0x65aa('0x3d');var _0x5e8bfa=_0x3fc314['get']({'plain':!![]});_0x5e8bfa['channel']=_0x1e5a80;_0x5e8bfa[_0x65aa('0x22')]=_0x1e5a80;_0x5e8bfa[_0x65aa('0x32')]=_0x2ecc9c?_0x65aa('0x3c'):_0x65aa('0x3d');var _0x1f7af7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e8bfa[_0x65aa('0x25')];return db[_0x65aa('0x27')][_0x65aa('0x28')](_0x1f7af7,{'type':db[_0x65aa('0x29')][_0x65aa('0x2a')][_0x65aa('0x2b')],'raw':!![]})['then'](function(_0x3e592d){if(_0x3e592d){_0x5e8bfa[_0x65aa('0x36')]=_0x3e592d[0x0];}if(typeof _0x5e8bfa[_0x65aa('0x2c')]===_0x65aa('0x26'))return;return getAgent(_0x5e8bfa[_0x65aa('0x2c')]);})[_0x65aa('0x1b')](function(_0x3878be){if(_0x3878be){_0x5e8bfa[_0x65aa('0x2d')]=util[_0x65aa('0x2e')](_0x65aa('0x37'),_0x3878be['name']);_0x5e8bfa['agent']=_0x3878be;}return request({'event':_0x2b8de4,'message':_0x5e8bfa});})[_0x65aa('0x20')](function(_0x404e48){logger[_0x65aa('0x1e')](_0x65aa('0x1d'),'AfterUpdate',_0x404e48);});}};}function getAgent(_0x3e0019){return db['User']['find']({'where':{'id':_0x3e0019},'attributes':['id',_0x65aa('0x38'),_0x65aa('0x3e'),_0x65aa('0x3f'),'internal'],'raw':!![]})[_0x65aa('0x1b')](function(_0x2b64b0){return _0x2b64b0;});}exports[_0x65aa('0x40')]=function(){for(var _0x231e67=0x0;_0x231e67=_0x1ca655[_0xe1bd('0x14')]){throw Error(_0xe1bd('0x15'));}_0x3d455e(_0x452cf3);})[_0xe1bd('0x16')](function(_0xf95ab8){_0x7831e1(_0xf95ab8);});});}; \ No newline at end of file +var _0x952e=['fax','sms','openchannel','getChannels','toLowerCase','includes','clearBlockUser','blockedAt','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','mail'];(function(_0x44020f,_0x28afd0){var _0x5b4f2c=function(_0x246c54){while(--_0x246c54){_0x44020f['push'](_0x44020f['shift']());}};_0x5b4f2c(++_0x28afd0);}(_0x952e,0x65));var _0xe952=function(_0x54bf5c,_0x3cedd6){_0x54bf5c=_0x54bf5c-0x0;var _0x1a3905=_0x952e[_0x54bf5c];return _0x1a3905;};'use strict';var _=require(_0xe952('0x0'));var BPromise=require(_0xe952('0x1'));var db=require('../mysqldb')['db'];var util=require(_0xe952('0x2'));var channels=['voice',_0xe952('0x3'),'chat',_0xe952('0x4'),_0xe952('0x5'),'whatsapp',_0xe952('0x6')];exports[_0xe952('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x2a3883){_0x2a3883=_0x2a3883[_0xe952('0x8')]();return _[_0xe952('0x9')](channels,_0x2a3883);};exports[_0xe952('0xa')]=function(_0x543b96,_0x128cbf,_0x3b02a9,_0x15adea){var _0x1d6e04={'loginAttempts':_0x128cbf,'blocked':_0x3b02a9};if(!_['isUndefined'](_0x15adea)){_0x1d6e04[_0xe952('0xb')]=_0x15adea;}return _0x543b96['updateAttributes'](_0x1d6e04);};exports[_0xe952('0xc')]=function(_0x48e1c4){return new BPromise(function(_0x3d2822,_0x53675e){var _0x47e0d2=0x0;if(_0x48e1c4[_0xe952('0xd')]!==_0xe952('0xe')){_0x3d2822(_0x48e1c4);}db[_0xe952('0xf')][_0xe952('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x48e1c4['id']}}})['then'](function(_0x1b46be){_0x47e0d2=_0x1b46be;return util[_0xe952('0xc')]();})[_0xe952('0x11')](function(_0x32629f){if(_0x32629f&&_0x32629f['agents']&&_0x47e0d2>=_0x32629f[_0xe952('0x12')]){throw Error(_0xe952('0x13'));}_0x3d2822(_0x48e1c4);})[_0xe952('0x14')](function(_0x5373bf){_0x53675e(_0x5373bf);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 419f742..f6694a6 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Bad\x20Request','Forbidden','OutOfInterval','error','stack'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xb688,0xcf));var _0x8b68=function(_0x47e31e,_0xdebb04){_0x47e31e=_0x47e31e-0x0;var _0x556f36=_0xb688[_0x47e31e];return _0x556f36;};'use strict';var util=require('util');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var APIError=function(_0x266285,_0x1080e8){this[_0x8b68('0x2')]=_0x266285||_0x8b68('0x3');this['name']=_0x1080e8||_0x8b68('0x4');util[_0x8b68('0x5')](APIError,Error);};var APIBadRequestError=function(_0x30f33d){this[_0x8b68('0x2')]=_0x30f33d||'Bad\x20Request';this[_0x8b68('0x6')]='Bad\x20Request';util[_0x8b68('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2bbffd){this[_0x8b68('0x2')]=_0x2bbffd||_0x8b68('0x7');this[_0x8b68('0x6')]=_0x8b68('0x8');util[_0x8b68('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x21d944){switch(_0x21d944){case _0x8b68('0x9'):return 0x190;case _0x8b68('0xa'),_0x8b68('0xb'):return 0x193;case _0x8b68('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2a852a){return function(_0x502727){logger[_0x8b68('0xc')](_0x502727[_0x8b68('0xd')]);var _0x5e76c=getStatusCode(_0x502727[_0x8b68('0x6')]);if(_0x502727[_0x8b68('0x6')])delete _0x502727[_0x8b68('0x6')];return _0x2a852a[_0x8b68('0xe')](_0x5e76c)[_0x8b68('0xf')](_0x502727);};}module[_0x8b68('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb4e6=['OutOfInterval','error','status','send','exports','util','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Not\x20Found','inherits','Forbidden'];(function(_0x53547b,_0x33b155){var _0x3bf8df=function(_0xbb793e){while(--_0xbb793e){_0x53547b['push'](_0x53547b['shift']());}};_0x3bf8df(++_0x33b155);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0xb4e6[_0x5e2152];return _0x5ddcf6;};'use strict';var util=require(_0x6b4e('0x0'));var logger=require('../config/logger')(_0x6b4e('0x1'));var APIError=function(_0x1afd20,_0x365912){this[_0x6b4e('0x2')]=_0x1afd20||_0x6b4e('0x3');this[_0x6b4e('0x4')]=_0x365912||_0x6b4e('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x40da90){this[_0x6b4e('0x2')]=_0x40da90||_0x6b4e('0x6');this['name']=_0x6b4e('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x4f00be){this[_0x6b4e('0x2')]=_0x4f00be||'Entity\x20not\x20found';this['name']=_0x6b4e('0x7');util[_0x6b4e('0x8')](APINotFoundError,APIError);};function getStatusCode(_0x1e3bf6){switch(_0x1e3bf6){case _0x6b4e('0x6'):return 0x190;case _0x6b4e('0x9'),_0x6b4e('0xa'):return 0x193;case _0x6b4e('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x49c734){return function(_0x39b4ec){logger[_0x6b4e('0xb')](_0x39b4ec['stack']);var _0x2a4d0f=getStatusCode(_0x39b4ec[_0x6b4e('0x4')]);if(_0x39b4ec[_0x6b4e('0x4')])delete _0x39b4ec[_0x6b4e('0x4')];return _0x49c734[_0x6b4e('0xc')](_0x2a4d0f)[_0x6b4e('0xd')](_0x39b4ec);};}module[_0x6b4e('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 99f97c4..7948acb 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d33=['404','status','json','send','exports'];(function(_0x175bfd,_0x4d47b5){var _0x2753f2=function(_0x4b0a71){while(--_0x4b0a71){_0x175bfd['push'](_0x175bfd['shift']());}};_0x2753f2(++_0x4d47b5);}(_0x8d33,0x144));var _0x38d3=function(_0xd06e94,_0x1c136d){_0xd06e94=_0xd06e94-0x0;var _0x1006dc=_0x8d33[_0xd06e94];return _0x1006dc;};'use strict';module[_0x38d3('0x0')][0x194]=function pageNotFound(_0x329cb0,_0x535c28){var _0x43d6a1=_0x38d3('0x1');var _0x43d7cb=0x194;var _0x4f2d11={'status':_0x43d7cb};_0x535c28[_0x38d3('0x2')](_0x4f2d11[_0x38d3('0x2')]);_0x535c28['render'](_0x43d6a1,{},function(_0x2d7643,_0x2c4538){if(_0x2d7643){return _0x535c28[_0x38d3('0x2')](_0x4f2d11[_0x38d3('0x2')])[_0x38d3('0x3')](_0x4f2d11);}_0x535c28[_0x38d3('0x4')](_0x2c4538);});}; \ No newline at end of file +var _0x976c=['status','json'];(function(_0x245ca7,_0x32a087){var _0x359328=function(_0x13ad21){while(--_0x13ad21){_0x245ca7['push'](_0x245ca7['shift']());}};_0x359328(++_0x32a087);}(_0x976c,0x72));var _0xc976=function(_0x478e7d,_0x41c1c0){_0x478e7d=_0x478e7d-0x0;var _0x39f3f7=_0x976c[_0x478e7d];return _0x39f3f7;};'use strict';module['exports'][0x194]=function pageNotFound(_0x41225a,_0x45d0dd){var _0x390207='404';var _0x20b46b=0x194;var _0x504c10={'status':_0x20b46b};_0x45d0dd[_0xc976('0x0')](_0x504c10['status']);_0x45d0dd['render'](_0x390207,{},function(_0x3a7ab4,_0x147fda){if(_0x3a7ab4){return _0x45d0dd[_0xc976('0x0')](_0x504c10[_0xc976('0x0')])[_0xc976('0x1')](_0x504c10);}_0x45d0dd['send'](_0x147fda);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 0d0cba2..e90f8e4 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 28ec181..332a18f 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf1d=['./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./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/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/messages','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/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/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./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/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','then','./api/user','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xbf1d,0xf9));var _0xdbf1=function(_0x222378,_0x27b379){_0x222378=_0x222378-0x0;var _0x45f2d4=_0xbf1d[_0x222378];return _0x45f2d4;};'use strict';var path=require(_0xdbf1('0x0'));var express=require(_0xdbf1('0x1'));var errors=require(_0xdbf1('0x2'));var config=require(_0xdbf1('0x3'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x1151eb){return setupLoggers(_0x1151eb)[_0xdbf1('0x4')](function(){_0x1151eb['use']('/api/users',require(_0xdbf1('0x5')));_0x1151eb[_0xdbf1('0x6')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x7'),require(_0xdbf1('0x8')));_0x1151eb['use'](_0xdbf1('0x9'),require(_0xdbf1('0xa')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xb'),require(_0xdbf1('0xc')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xd'),require(_0xdbf1('0xe')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xf'),require(_0xdbf1('0x10')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x11'),require('./api/screenRecording'));_0x1151eb['use'](_0xdbf1('0x12'),require(_0xdbf1('0x13')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x14'),require(_0xdbf1('0x15')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x16'),require(_0xdbf1('0x17')));_0x1151eb[_0xdbf1('0x6')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x18'),require(_0xdbf1('0x19')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x1a'),require(_0xdbf1('0x1b')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x1c'),require('./api/memberReport'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x1d'),require(_0xdbf1('0x1e')));_0x1151eb['use'](_0xdbf1('0x1f'),require('./api/voiceTransferReport'));_0x1151eb['use'](_0xdbf1('0x20'),require('./api/mailServerOut'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x21'),require('./api/mailAccount'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x22'),require(_0xdbf1('0x23')));_0x1151eb[_0xdbf1('0x6')]('/api/mail/substatuses',require(_0xdbf1('0x24')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x25'),require(_0xdbf1('0x26')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x27'),require('./api/mailMessage'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x28'),require(_0xdbf1('0x29')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x2a'),require(_0xdbf1('0x2b')));_0x1151eb[_0xdbf1('0x6')]('/api/dashboards',require(_0xdbf1('0x2c')));_0x1151eb[_0xdbf1('0x6')]('/api/dashboards/items',require(_0xdbf1('0x2d')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x2e'),require(_0xdbf1('0x2f')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x30'),require(_0xdbf1('0x31')));_0x1151eb[_0xdbf1('0x6')]('/api/fax/interactions',require(_0xdbf1('0x32')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x33'),require(_0xdbf1('0x34')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x35'),require(_0xdbf1('0x36')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x37'),require(_0xdbf1('0x38')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x39'),require(_0xdbf1('0x3a')));_0x1151eb['use'](_0xdbf1('0x3b'),require('./api/smsApplication'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x3c'),require('./api/smsInteraction'));_0x1151eb[_0xdbf1('0x6')]('/api/sms/messages',require(_0xdbf1('0x3d')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x3e'),require('./api/smsQueue'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x3f'),require(_0xdbf1('0x40')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x41'),require(_0xdbf1('0x42')));_0x1151eb['use']('/api/openchannel/interactions',require(_0xdbf1('0x43')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x44'),require(_0xdbf1('0x45')));_0x1151eb[_0xdbf1('0x6')]('/api/openchannel/queues',require(_0xdbf1('0x46')));_0x1151eb['use'](_0xdbf1('0x47'),require(_0xdbf1('0x48')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x49'),require(_0xdbf1('0x4a')));_0x1151eb['use'](_0xdbf1('0x4b'),require('./api/chatApplication'));_0x1151eb[_0xdbf1('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x4c'),require('./api/chatMessage'));_0x1151eb[_0xdbf1('0x6')]('/api/chat/offline_messages',require(_0xdbf1('0x4d')));_0x1151eb[_0xdbf1('0x6')]('/api/chat/queues',require('./api/chatQueue'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x4e'),require(_0xdbf1('0x4f')));_0x1151eb['use'](_0xdbf1('0x50'),require(_0xdbf1('0x51')));_0x1151eb['use'](_0xdbf1('0x52'),require('./api/cmCompany'));_0x1151eb['use'](_0xdbf1('0x53'),require('./api/cmContact'));_0x1151eb[_0xdbf1('0x6')]('/api/cm/hopper',require(_0xdbf1('0x54')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x55'),require('./api/cmHopperBlack'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x56'),require('./api/cmHopperFinal'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x57'),require(_0xdbf1('0x58')));_0x1151eb['use'](_0xdbf1('0x59'),require('./api/cmCustomField'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x5a'),require(_0xdbf1('0x5b')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x5c'),require(_0xdbf1('0x5d')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x5e'),require(_0xdbf1('0x5f')));_0x1151eb['use'](_0xdbf1('0x60'),require(_0xdbf1('0x61')));_0x1151eb[_0xdbf1('0x6')]('/api/conditions',require(_0xdbf1('0x62')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x63'),require(_0xdbf1('0x64')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x65'),require(_0xdbf1('0x66')));_0x1151eb[_0xdbf1('0x6')]('/api/cdr',require(_0xdbf1('0x67')));_0x1151eb[_0xdbf1('0x6')]('/api/voiceQueuesLog',require(_0xdbf1('0x68')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x69'),require(_0xdbf1('0x6a')));_0x1151eb[_0xdbf1('0x6')]('/api/sounds',require(_0xdbf1('0x6b')));_0x1151eb[_0xdbf1('0x6')]('/api/tags',require(_0xdbf1('0x6c')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x6d'),require(_0xdbf1('0x6e')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x6f'),require(_0xdbf1('0x70')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x71'),require(_0xdbf1('0x72')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x73'),require(_0xdbf1('0x74')));_0x1151eb[_0xdbf1('0x6')]('/api/triggers',require('./api/trigger'));_0x1151eb[_0xdbf1('0x6')]('/api/variables',require('./api/variable'));_0x1151eb['use'](_0xdbf1('0x75'),require(_0xdbf1('0x76')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x77'),require(_0xdbf1('0x78')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x79'),require('./api/analyticCustomReport'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x7a'),require(_0xdbf1('0x7b')));_0x1151eb['use'](_0xdbf1('0x7c'),require('./api/analyticExtractedReport'));_0x1151eb['use'](_0xdbf1('0x7d'),require('./api/analyticMetric'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x7e'),require(_0xdbf1('0x7f')));_0x1151eb['use'](_0xdbf1('0x80'),require(_0xdbf1('0x81')));_0x1151eb['use'](_0xdbf1('0x82'),require(_0xdbf1('0x83')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x84'),require('./api/intSalesforceConfiguration'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x85'),require('./api/intSalesforceField'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x86'),require(_0xdbf1('0x87')));_0x1151eb['use']('/api/integrations/sugarcrm/configurations',require(_0xdbf1('0x88')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x89'),require(_0xdbf1('0x8a')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x8b'),require(_0xdbf1('0x8c')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x8d'),require('./api/intDeskConfiguration'));_0x1151eb['use'](_0xdbf1('0x8e'),require(_0xdbf1('0x8f')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x90'),require(_0xdbf1('0x91')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x92'),require(_0xdbf1('0x93')));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/zoho/fields',require(_0xdbf1('0x94')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x95'),require(_0xdbf1('0x96')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x97'),require('./api/intZendeskConfiguration'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x98'),require('./api/intZendeskField'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x99'),require(_0xdbf1('0x9a')));_0x1151eb['use'](_0xdbf1('0x9b'),require(_0xdbf1('0x9c')));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/freshdesk/fields',require(_0xdbf1('0x9d')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x9e'),require('./api/intVtigerAccount'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0x9f'),require(_0xdbf1('0xa0')));_0x1151eb['use'](_0xdbf1('0xa1'),require(_0xdbf1('0xa2')));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xa3'),require(_0xdbf1('0xa4')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xa5'),require(_0xdbf1('0xa6')));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/dynamics365/accounts',require(_0xdbf1('0xa7')));_0x1151eb['use'](_0xdbf1('0xa8'),require('./api/intDynamics365Configuration'));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xa9'),require('./api/intFreshsalesAccount'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xaa'),require('./api/intFreshsalesConfiguration'));_0x1151eb[_0xdbf1('0x6')]('/api/integrations/freshsales/fields',require(_0xdbf1('0xab')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xac'),require(_0xdbf1('0xad')));_0x1151eb['use'](_0xdbf1('0xae'),require(_0xdbf1('0xaf')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xb0'),require(_0xdbf1('0xb1')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xb2'),require(_0xdbf1('0xb3')));_0x1151eb[_0xdbf1('0x6')]('/api/jscripty/questions/reports',require(_0xdbf1('0xb4')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xb5'),require('./api/jscriptySessionReport'));_0x1151eb['use'](_0xdbf1('0xb6'),require(_0xdbf1('0xb7')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xb8'),require(_0xdbf1('0xb9')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xba'),require('./api/squareReportDetail'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xbb'),require('./api/jscriptyProject'));_0x1151eb['use']('/api/settings',require('./api/setting'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xbc'),require('./api/squareOdbc'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xbd'),require('./api/squareProject'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xbe'),require(_0xdbf1('0xbf')));_0x1151eb['use'](_0xdbf1('0xc0'),require(_0xdbf1('0xc1')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xc2'),require('./api/team'));_0x1151eb[_0xdbf1('0x6')]('/api/license',require('./api/license'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xc3'),require(_0xdbf1('0xc4')));_0x1151eb['use'](_0xdbf1('0xc5'),require('./api/migration'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xc6'),require(_0xdbf1('0xc7')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xc8'),require(_0xdbf1('0xc9')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xca'),require('./api/mailTransferReport'));_0x1151eb['use'](_0xdbf1('0xcb'),require(_0xdbf1('0xcc')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xcd'),require(_0xdbf1('0xce')));_0x1151eb[_0xdbf1('0x6')]('/api/openchannel/reports/transfer',require(_0xdbf1('0xcf')));_0x1151eb['use'](_0xdbf1('0xd0'),require('./api/smsTransferReport'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xd1'),require(_0xdbf1('0xd2')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xd3'),require(_0xdbf1('0xd4')));_0x1151eb['use'](_0xdbf1('0xd5'),require('./api/userProfile'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xd6'),require(_0xdbf1('0xd7')));_0x1151eb['use'](_0xdbf1('0xd8'),require(_0xdbf1('0xd9')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xda'),require(_0xdbf1('0xdb')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xdc'),require(_0xdbf1('0xdd')));_0x1151eb[_0xdbf1('0x6')]('/api/whatsapp/applications',require(_0xdbf1('0xde')));_0x1151eb['use'](_0xdbf1('0xdf'),require(_0xdbf1('0xe0')));_0x1151eb['use'](_0xdbf1('0xe1'),require(_0xdbf1('0xe2')));_0x1151eb['use'](_0xdbf1('0xe3'),require(_0xdbf1('0xe4')));_0x1151eb['use'](_0xdbf1('0xe5'),require('./api/whatsappTransferReport'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xe6'),require(_0xdbf1('0xe7')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xe8'),require(_0xdbf1('0xe9')));_0x1151eb[_0xdbf1('0x6')]('/api/realtime',require(_0xdbf1('0xea')));_0x1151eb[_0xdbf1('0x6')]('/api/user-settings',require('./api/user-setting'));_0x1151eb['use']('/api/auth/local',require(_0xdbf1('0xeb')));_0x1151eb[_0xdbf1('0x6')]('/api/auth/google',require(_0xdbf1('0xec')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xed'),require('./api/authActiveDirectory'));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xee'),require(_0xdbf1('0xef')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xf0'),require('./api/rpc'));_0x1151eb['use']('/api/version',require(_0xdbf1('0xf1')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xf2'),require(_0xdbf1('0xf3')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xf4'),require('./api/pm2'));_0x1151eb[_0xdbf1('0x6')]('/api/webbar',require(_0xdbf1('0xf5')));_0x1151eb['use'](_0xdbf1('0xf6'),clientSideLogs);_0x1151eb['use'](_0xdbf1('0xf7'),express[_0xdbf1('0xf8')](path[_0xdbf1('0xf9')](config[_0xdbf1('0xfa')],_0xdbf1('0xf7'))));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xfb'),express[_0xdbf1('0xf8')](path[_0xdbf1('0xf9')](config[_0xdbf1('0xfa')],_0xdbf1('0xfb'))));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xfc'),express[_0xdbf1('0xf8')](path[_0xdbf1('0xf9')](config['root'],'/demo')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xfd'),express[_0xdbf1('0xf8')](path[_0xdbf1('0xf9')](config['root'],'snippet','3.1.0')));_0x1151eb[_0xdbf1('0x6')](_0xdbf1('0xfe'),express[_0xdbf1('0xf8')](path[_0xdbf1('0xf9')](config[_0xdbf1('0xfa')],'/server/files/plugins')));_0x1151eb[_0xdbf1('0xff')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xdbf1('0x100')](errors[0x194]);_0x1151eb[_0xdbf1('0xff')]('/*')[_0xdbf1('0x100')](function(_0x7b17df,_0x3b1f1d){_0x3b1f1d[_0xdbf1('0x101')](path[_0xdbf1('0x102')](_0x1151eb['get'](_0xdbf1('0x103'))+_0xdbf1('0x104')));});return _0x1151eb;});}; \ No newline at end of file +var _0x9f20=['./api/mailServerOut','/api/mail/accounts','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/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/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/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/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/system','./api/pm2','/api/logs','/apidoc','join','root','/demo','static','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','/index.html','path','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers'];(function(_0x46d1bb,_0x2f0ad9){var _0x4d83b6=function(_0x54f9c5){while(--_0x54f9c5){_0x46d1bb['push'](_0x46d1bb['shift']());}};_0x4d83b6(++_0x2f0ad9);}(_0x9f20,0x1f4));var _0x09f2=function(_0x55d543,_0x5ba056){_0x55d543=_0x55d543-0x0;var _0x51db03=_0x9f20[_0x55d543];return _0x51db03;};'use strict';var path=require(_0x09f2('0x0'));var express=require('express');var errors=require('./errors');var config=require('./config/environment');var setupLoggers=require('./utils/client-side-logger')[_0x09f2('0x1')];var clientSideLogs=require(_0x09f2('0x2'));exports['default']=function(_0x5c024e){return setupLoggers(_0x5c024e)[_0x09f2('0x3')](function(){_0x5c024e[_0x09f2('0x4')](_0x09f2('0x5'),require(_0x09f2('0x6')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x7'),require(_0x09f2('0x8')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x9'),require(_0x09f2('0xa')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xb'),require(_0x09f2('0xc')));_0x5c024e['use'](_0x09f2('0xd'),require(_0x09f2('0xe')));_0x5c024e['use'](_0x09f2('0xf'),require(_0x09f2('0x10')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x11'),require('./api/voiceRecording'));_0x5c024e['use'](_0x09f2('0x12'),require(_0x09f2('0x13')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x14'),require(_0x09f2('0x15')));_0x5c024e[_0x09f2('0x4')]('/api/voice/mails/messages',require(_0x09f2('0x16')));_0x5c024e[_0x09f2('0x4')]('/api/voice/calls/reports',require(_0x09f2('0x17')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x18'),require(_0x09f2('0x19')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x1a'),require('./api/voiceAgentReport'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x1b'),require('./api/voiceQueueReport'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x1c'),require(_0x09f2('0x1d')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x1e'),require('./api/trunk'));_0x5c024e['use'](_0x09f2('0x1f'),require(_0x09f2('0x20')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x21'),require(_0x09f2('0x22')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x23'),require('./api/mailAccount'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x24'),require(_0x09f2('0x25')));_0x5c024e[_0x09f2('0x4')]('/api/mail/substatuses',require(_0x09f2('0x26')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x27'),require(_0x09f2('0x28')));_0x5c024e['use']('/api/mail/messages',require('./api/mailMessage'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x29'),require(_0x09f2('0x2a')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x2b'),require(_0x09f2('0x2c')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x2d'),require(_0x09f2('0x2e')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x2f'),require(_0x09f2('0x30')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x31'),require(_0x09f2('0x32')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x33'),require(_0x09f2('0x34')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x35'),require(_0x09f2('0x36')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x37'),require(_0x09f2('0x38')));_0x5c024e['use'](_0x09f2('0x39'),require(_0x09f2('0x3a')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x3b'),require(_0x09f2('0x3c')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x3d'),require(_0x09f2('0x3e')));_0x5c024e[_0x09f2('0x4')]('/api/sms/applications',require('./api/smsApplication'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x3f'),require(_0x09f2('0x40')));_0x5c024e['use'](_0x09f2('0x41'),require('./api/smsMessage'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x42'),require(_0x09f2('0x43')));_0x5c024e['use'](_0x09f2('0x44'),require(_0x09f2('0x45')));_0x5c024e['use']('/api/openchannel/applications',require(_0x09f2('0x46')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x47'),require(_0x09f2('0x48')));_0x5c024e['use']('/api/openchannel/messages',require(_0x09f2('0x49')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x4a'),require(_0x09f2('0x4b')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x4c'),require(_0x09f2('0x4d')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x4e'),require(_0x09f2('0x4f')));_0x5c024e[_0x09f2('0x4')]('/api/chat/applications',require(_0x09f2('0x50')));_0x5c024e[_0x09f2('0x4')]('/api/chat/interactions',require('./api/chatInteraction'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x51'),require(_0x09f2('0x52')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x53'),require(_0x09f2('0x54')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x55'),require('./api/chatQueue'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x56'),require(_0x09f2('0x57')));_0x5c024e['use'](_0x09f2('0x58'),require(_0x09f2('0x59')));_0x5c024e[_0x09f2('0x4')]('/api/cm/companies',require(_0x09f2('0x5a')));_0x5c024e['use'](_0x09f2('0x5b'),require('./api/cmContact'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x5c'),require('./api/cmHopper'));_0x5c024e['use'](_0x09f2('0x5d'),require(_0x09f2('0x5e')));_0x5c024e[_0x09f2('0x4')]('/api/cm/hopper_final',require(_0x09f2('0x5f')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x60'),require(_0x09f2('0x61')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x62'),require(_0x09f2('0x63')));_0x5c024e[_0x09f2('0x4')]('/api/actions',require(_0x09f2('0x64')));_0x5c024e[_0x09f2('0x4')]('/api/automations',require(_0x09f2('0x65')));_0x5c024e['use']('/api/canned_answers',require(_0x09f2('0x66')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x67'),require(_0x09f2('0x68')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x69'),require(_0x09f2('0x6a')));_0x5c024e[_0x09f2('0x4')]('/api/intervals',require(_0x09f2('0x6b')));_0x5c024e[_0x09f2('0x4')]('/api/pauses',require(_0x09f2('0x6c')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x6d'),require('./api/cdr'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x6e'),require(_0x09f2('0x6f')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x70'),require('./api/schedule'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x71'),require(_0x09f2('0x72')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x73'),require(_0x09f2('0x74')));_0x5c024e['use']('/api/contact_item_types',require(_0x09f2('0x75')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x76'),require(_0x09f2('0x77')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x78'),require(_0x09f2('0x79')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x7a'),require(_0x09f2('0x7b')));_0x5c024e[_0x09f2('0x4')]('/api/triggers',require(_0x09f2('0x7c')));_0x5c024e[_0x09f2('0x4')]('/api/variables',require(_0x09f2('0x7d')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x7e'),require('./api/integration'));_0x5c024e[_0x09f2('0x4')]('/api/integrations/reports',require(_0x09f2('0x7f')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x80'),require(_0x09f2('0x81')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x82'),require(_0x09f2('0x83')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x84'),require(_0x09f2('0x85')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x86'),require(_0x09f2('0x87')));_0x5c024e[_0x09f2('0x4')]('/api/analytics/field_reports',require(_0x09f2('0x88')));_0x5c024e[_0x09f2('0x4')]('/api/analytics/tree_reports',require(_0x09f2('0x89')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x8a'),require(_0x09f2('0x8b')));_0x5c024e['use'](_0x09f2('0x8c'),require(_0x09f2('0x8d')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x8e'),require('./api/intSalesforceField'));_0x5c024e['use'](_0x09f2('0x8f'),require(_0x09f2('0x90')));_0x5c024e['use']('/api/integrations/sugarcrm/configurations',require(_0x09f2('0x91')));_0x5c024e['use'](_0x09f2('0x92'),require(_0x09f2('0x93')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x94'),require(_0x09f2('0x95')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/desk/configurations',require(_0x09f2('0x96')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/desk/fields',require(_0x09f2('0x97')));_0x5c024e['use'](_0x09f2('0x98'),require(_0x09f2('0x99')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x9a'),require(_0x09f2('0x9b')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x5c024e[_0x09f2('0x4')]('/api/integrations/zendesk/accounts',require(_0x09f2('0x9c')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x9d'),require('./api/intZendeskConfiguration'));_0x5c024e['use']('/api/integrations/zendesk/fields',require(_0x09f2('0x9e')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0x9f'),require(_0x09f2('0xa0')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/freshdesk/configurations',require(_0x09f2('0xa1')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xa2'),require('./api/intFreshdeskField'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xa3'),require(_0x09f2('0xa4')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xa5'),require(_0x09f2('0xa6')));_0x5c024e['use']('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xa7'),require(_0x09f2('0xa8')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xa9'),require('./api/intServicenowField'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xaa'),require(_0x09f2('0xab')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/dynamics365/configurations',require(_0x09f2('0xac')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xad'),require(_0x09f2('0xae')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xaf'),require(_0x09f2('0xb0')));_0x5c024e['use']('/api/integrations/freshsales/configurations',require(_0x09f2('0xb1')));_0x5c024e[_0x09f2('0x4')]('/api/integrations/freshsales/fields',require(_0x09f2('0xb2')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xb3'),require(_0x09f2('0xb4')));_0x5c024e[_0x09f2('0x4')]('/api/chat/reports/queue',require(_0x09f2('0xb5')));_0x5c024e[_0x09f2('0x4')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x5c024e[_0x09f2('0x4')]('/api/jscripty/answers/reports',require(_0x09f2('0xb6')));_0x5c024e['use']('/api/jscripty/questions/reports',require(_0x09f2('0xb7')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xb8'),require(_0x09f2('0xb9')));_0x5c024e['use'](_0x09f2('0xba'),require(_0x09f2('0xbb')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xbc'),require(_0x09f2('0xbd')));_0x5c024e['use'](_0x09f2('0xbe'),require(_0x09f2('0xbf')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xc0'),require(_0x09f2('0xc1')));_0x5c024e[_0x09f2('0x4')]('/api/settings',require(_0x09f2('0xc2')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xc3'),require(_0x09f2('0xc4')));_0x5c024e[_0x09f2('0x4')]('/api/square/projects',require(_0x09f2('0xc5')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xc6'),require(_0x09f2('0xc7')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xc8'),require(_0x09f2('0xc9')));_0x5c024e['use'](_0x09f2('0xca'),require('./api/team'));_0x5c024e['use'](_0x09f2('0xcb'),require(_0x09f2('0xcc')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xcd'),require('./api/campaign'));_0x5c024e['use'](_0x09f2('0xce'),require('./api/migration'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xcf'),require('./api/attachment'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xd0'),require('./api/plugin'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xd1'),require(_0x09f2('0xd2')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xd3'),require(_0x09f2('0xd4')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xd5'),require('./api/faxTransferReport'));_0x5c024e['use'](_0x09f2('0xd6'),require(_0x09f2('0xd7')));_0x5c024e[_0x09f2('0x4')]('/api/sms/reports/transfer',require(_0x09f2('0xd8')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xd9'),require(_0x09f2('0xda')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xdb'),require(_0x09f2('0xdc')));_0x5c024e['use'](_0x09f2('0xdd'),require('./api/userProfile'));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xde'),require(_0x09f2('0xdf')));_0x5c024e['use'](_0x09f2('0xe0'),require(_0x09f2('0xe1')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xe2'),require(_0x09f2('0xe3')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xe4'),require(_0x09f2('0xe5')));_0x5c024e[_0x09f2('0x4')]('/api/whatsapp/applications',require(_0x09f2('0xe6')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xe7'),require(_0x09f2('0xe8')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xe9'),require(_0x09f2('0xea')));_0x5c024e[_0x09f2('0x4')]('/api/whatsapp/reports/queue',require(_0x09f2('0xeb')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xec'),require(_0x09f2('0xed')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xee'),require(_0x09f2('0xef')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xf0'),require(_0x09f2('0xf1')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xf2'),require(_0x09f2('0xf3')));_0x5c024e['use'](_0x09f2('0xf4'),require(_0x09f2('0xf5')));_0x5c024e[_0x09f2('0x4')]('/api/auth/local',require(_0x09f2('0xf6')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xf7'),require('./api/authGoogle'));_0x5c024e['use'](_0x09f2('0xf8'),require(_0x09f2('0xf9')));_0x5c024e[_0x09f2('0x4')](_0x09f2('0xfa'),require(_0x09f2('0xfb')));_0x5c024e[_0x09f2('0x4')]('/api/rpc',require('./api/rpc'));_0x5c024e['use']('/api/version',require('./api/version'));_0x5c024e[_0x09f2('0x4')]('/api/system',require(_0x09f2('0xfc')));_0x5c024e[_0x09f2('0x4')]('/api/pm2',require(_0x09f2('0xfd')));_0x5c024e[_0x09f2('0x4')]('/api/webbar',require('./api/webbar'));_0x5c024e['use'](_0x09f2('0xfe'),clientSideLogs);_0x5c024e[_0x09f2('0x4')](_0x09f2('0xff'),express['static'](path[_0x09f2('0x100')](config[_0x09f2('0x101')],_0x09f2('0xff'))));_0x5c024e[_0x09f2('0x4')]('/www',express['static'](path[_0x09f2('0x100')](config[_0x09f2('0x101')],'/www')));_0x5c024e['use'](_0x09f2('0x102'),express[_0x09f2('0x103')](path[_0x09f2('0x100')](config[_0x09f2('0x101')],'/demo')));_0x5c024e['use']('/snippet',express[_0x09f2('0x103')](path[_0x09f2('0x100')](config['root'],'snippet',_0x09f2('0x104'))));_0x5c024e['use'](_0x09f2('0x105'),express['static'](path[_0x09f2('0x100')](config[_0x09f2('0x101')],_0x09f2('0x106'))));_0x5c024e[_0x09f2('0x107')](_0x09f2('0x108'))[_0x09f2('0x109')](errors[0x194]);_0x5c024e[_0x09f2('0x107')]('/*')[_0x09f2('0x109')](function(_0x5d49f9,_0x41151f){_0x41151f['sendFile'](path['resolve'](_0x5c024e[_0x09f2('0x109')]('appPath')+_0x09f2('0x10a')));});return _0x5c024e;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 16fd7ae..8be28b9 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8adb=['../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.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/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.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/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc'];(function(_0x5c93a0,_0x388f5a){var _0x5ddbea=function(_0x27ff0b){while(--_0x27ff0b){_0x5c93a0['push'](_0x5c93a0['shift']());}};_0x5ddbea(++_0x388f5a);}(_0x8adb,0x105));var _0xb8ad=function(_0x2ede3f,_0x3f46fe){_0x2ede3f=_0x2ede3f-0x0;var _0x37ef76=_0x8adb[_0x2ede3f];return _0x37ef76;};'use strict';var jayson=require(_0xb8ad('0x0'));var _=require(_0xb8ad('0x1'));var config=require('../config/environment');exports[_0xb8ad('0x2')]=function(){return new Promise(function(_0x2b6793,_0x605323){var _0x6fc409={};_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x3')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/voiceExtension/voiceExtension.rpc'));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x5')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x6')));_0x6fc409=_['merge'](_0x6fc409,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x7')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x8')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x9')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0xa')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0xb')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0xc')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0xd')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0xe')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0xf')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x10')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x11')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x12')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x13')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x14')));_0x6fc409=_['merge'](_0x6fc409,require('../api/faxQueue/faxQueue.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x15')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x16')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x17')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x18')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x19')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x1a')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x1b')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x1c')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x1d')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x1e')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/chatInteraction/chatInteraction.rpc'));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x1f')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x20')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x21')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/cmHopper/cmHopper.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x22')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x23')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x24')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x25')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x26')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x27')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x28')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x29')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x2a')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/variable/variable.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x2b')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x2c')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x2d')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x2e')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x2f')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x30')));_0x6fc409=_['merge'](_0x6fc409,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x31')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x32')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x33')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x34')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x35')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/setting/setting.rpc'));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x36')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/squareProject/squareProject.rpc'));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x37')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x38')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x39')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x3a')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/plugin/plugin.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x3b')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x3c')));_0x6fc409=_['merge'](_0x6fc409,require(_0xb8ad('0x3d')));_0x6fc409=_[_0xb8ad('0x4')](_0x6fc409,require(_0xb8ad('0x3e')));var _0x45739c=jayson[_0xb8ad('0x3f')](_0x6fc409)[_0xb8ad('0x40')]();var _0x5cce47=config['rpc']['port']||config[_0xb8ad('0x41')]+0x1;var _0x58ac59=config[_0xb8ad('0x42')]['ip']||'localhost';_0x45739c['on']('error',function(_0x353987){return _0x605323(_0x353987);});_0x45739c[_0xb8ad('0x2')](_0x5cce47,_0x58ac59,function(){console[_0xb8ad('0x43')](_0xb8ad('0x44'),_0x58ac59,_0x5cce47);require(_0xb8ad('0x45'))[_0xb8ad('0x46')]();return _0x2b6793('RPC\x20listening\x20on\x20'+_0x58ac59+':'+_0x5cce47);});});}; \ No newline at end of file +var _0xdc3c=['Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../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/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.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/squareRecording/squareRecording.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','server','http','rpc','port','error','log'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xdc3c,0x1b4));var _0xcdc3=function(_0x7b664f,_0x21097a){_0x7b664f=_0x7b664f-0x0;var _0x429513=_0xdc3c[_0x7b664f];return _0x429513;};'use strict';var jayson=require(_0xcdc3('0x0'));var _=require('lodash');var config=require(_0xcdc3('0x1'));exports[_0xcdc3('0x2')]=function(){return new Promise(function(_0x50cb14,_0x2f6dba){var _0x2c1b9b={};_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x4')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x5')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x6')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x7')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x8')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2c1b9b=_['merge'](_0x2c1b9b,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x9')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0xa')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0xb')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0xc')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0xd')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0xe')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0xf')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x10')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/mailMessage/mailMessage.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/mailApplication/mailApplication.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x11')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x12')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x13')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x14')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x15')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x16')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x17')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x18')));_0x2c1b9b=_['merge'](_0x2c1b9b,require('../api/smsQueue/smsQueue.rpc'));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x19')));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x1a')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x1b')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x1c')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x1d')));_0x2c1b9b=_['merge'](_0x2c1b9b,require('../api/chatInteraction/chatInteraction.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x1e')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x1f')));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x20')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/cmHopper/cmHopper.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x21')));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x22')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x23')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x24')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x25')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/pause/pause.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/sound/sound.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x26')));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x27')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/trigger/trigger.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x28')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x29')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2a')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2b')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2c')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2d')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2e')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x2f')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x30')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x31')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x32')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x33')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x34')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x35')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/squareProject/squareProject.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x36')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x37')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x38')));_0x2c1b9b=_['merge'](_0x2c1b9b,require(_0xcdc3('0x39')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/plugin/plugin.rpc'));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x3a')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x3b')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x3c')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require(_0xcdc3('0x3d')));_0x2c1b9b=_[_0xcdc3('0x3')](_0x2c1b9b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x51bd3d=jayson[_0xcdc3('0x3e')](_0x2c1b9b)[_0xcdc3('0x3f')]();var _0x568277=config[_0xcdc3('0x40')][_0xcdc3('0x41')]||config['port']+0x1;var _0x211ccf=config[_0xcdc3('0x40')]['ip']||'localhost';_0x51bd3d['on'](_0xcdc3('0x42'),function(_0x543bf6){return _0x2f6dba(_0x543bf6);});_0x51bd3d['listen'](_0x568277,_0x211ccf,function(){console[_0xcdc3('0x43')](_0xcdc3('0x44'),_0x211ccf,_0x568277);require(_0xcdc3('0x45'))[_0xcdc3('0x46')]();return _0x50cb14(_0xcdc3('0x47')+_0x211ccf+':'+_0x568277);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index d56a930..8f8ff8a 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 _0x3cb7=['hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','length','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','answer','ANSWER','prototype','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase'];(function(_0x202771,_0xcace9c){var _0x3612ef=function(_0x485c83){while(--_0x485c83){_0x202771['push'](_0x202771['shift']());}};_0x3612ef(++_0xcace9c);}(_0x3cb7,0x1ae));var _0x73cb=function(_0x2bae67,_0x1077b2){_0x2bae67=_0x2bae67-0x0;var _0x5f29ed=_0x3cb7[_0x2bae67];return _0x5f29ed;};'use strict';var util=require(_0x73cb('0x0'));var _=require(_0x73cb('0x1'));var EventEmitter=require('events')[_0x73cb('0x2')];var AGIReply=require(_0x73cb('0x3'));var AGIError=require(_0x73cb('0x4'));function AGIChannel(_0x181662){var _0x5b1c9d=this,_0x5f923d=new AGIReply(),_0x2b16b7=![],_0x1e72e0={};EventEmitter[_0x73cb('0x5')](_0x5b1c9d);_0x181662[_0x73cb('0x6')](_0x73cb('0x7'));_0x181662[_0x73cb('0x8')](0x8*0x3c*0x3c*0x3e8);_0x5f923d[_0x73cb('0x6')](_0x73cb('0x7'));_0x5f923d['on'](_0x73cb('0x9'),function(_0x2d0206){for(var _0x5a6f61 in _0x2d0206){_0x5b1c9d[_0x5a6f61]=_0x2d0206[_0x5a6f61];}_0x5b1c9d[_0x73cb('0xa')](_0x73cb('0xb'));});_0x5f923d['on'](_0x73cb('0xc'),function(_0x35ddb5){if(_0x35ddb5[_0x73cb('0xd')]()==_0x73cb('0xe')){_0x5b1c9d['emit'](_0x73cb('0xe'));return;}if(_0x35ddb5[_0x73cb('0xf')](0x0,0xb)==_0x73cb('0x10')){_0x2b16b7=!![];}if(_0x2b16b7){_0x1e72e0['rx']+=_0x35ddb5+'\x0a';if(_0x35ddb5[_0x73cb('0x11')](_0x73cb('0x12'))!=-0x1){_0x2b16b7=![];}}else{_0x1e72e0['rx']=_0x35ddb5;}if(_0x2b16b7){return;}if(typeof _0x1e72e0['cb']==_0x73cb('0x13')){var _0xc6baa8=_0x1e72e0['rx']['substring'](0x0,0x3),_0x115cfa=null,_0x28600e=null;_0xc6baa8=parseInt(_0xc6baa8);if(isNaN(_0xc6baa8)){_0x1e72e0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xc6baa8!=0xc8){_0x1e72e0['cb'](null,{'code':_0xc6baa8,'result':-0x1,'extra':'KO'});return;}_0x115cfa=_0x1e72e0['rx']['substring'](0x4)[_0x73cb('0x14')](_0x73cb('0x15'),'');if(_0x115cfa[_0x73cb('0x16')]('\x20')!=-0x1){_0x115cfa=_0x115cfa['substr'](0x0,_0x115cfa[_0x73cb('0x16')]('\x20'));}if(_['startsWith'](_0x115cfa,'-1')){_0x115cfa=parseInt(_0x115cfa);}_0x28600e=_0x1e72e0['rx']['split']('\x20');if(_0x28600e['length']==0x3){_0x28600e=_0x28600e[0x2][_0x73cb('0xf')](0x1,_0x28600e[0x2][_0x73cb('0x17')]-0x1);}else if(_0x28600e['length']>0x3){var _0x4554f2=/\((.+)\)/;var _0x5df3af=_0x1e72e0['rx']['match'](_0x4554f2);if(_0x5df3af){_0x28600e=_0x5df3af[0x1];}else{_0x28600e=null;}}else{_0x28600e=null;}_0x1e72e0['cb'](null,{'code':_0xc6baa8,'result':_0x115cfa,'extra':_0x28600e});}});_0x181662['on'](_0x73cb('0x18'),function(_0x4fda15){_0x5b1c9d[_0x73cb('0xa')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x4fda15['code']));});_0x181662['on']('close',function(){_0x5b1c9d[_0x73cb('0xa')](_0x73cb('0x19'),new AGIError(_0x73cb('0x1a')));});_0x181662['on'](_0x73cb('0x1b'),function(){_0x5b1c9d[_0x73cb('0xa')]('timeout',new AGIError(_0x73cb('0x1c')));_0x181662[_0x73cb('0x1d')]();});_0x181662[_0x73cb('0x1e')](_0x5f923d);this[_0x73cb('0x1f')]=function(_0x2e74fe,_0x3613f6){var _0x2e74fe=_0x2e74fe||'',_0x3613f6=typeof _0x3613f6==_0x73cb('0x13')?_0x3613f6:new Function();_0x1e72e0={'tx':_0x2e74fe,'rx':'','cb':_0x3613f6};_0x181662[_0x73cb('0x20')](_0x2e74fe+'\x0a');},this[_0x73cb('0x19')]=function(){_0x181662[_0x73cb('0x1d')]();};}util[_0x73cb('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5869cf){return this[_0x73cb('0x1f')]['sync'](this,_0x5869cf);};AGIChannel['prototype'][_0x73cb('0x22')]=function(){return this['sendRequest'](_0x73cb('0x23'));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x25')]=function(_0x53f172,_0x2e9d1f,_0xc713aa){_0x53f172=_0x53f172===undefined?_0x73cb('0x26'):_0x53f172;_0x2e9d1f=_0x2e9d1f===undefined?'5':_0x2e9d1f;_0xc713aa=_0xc713aa===undefined?'1':_0xc713aa;return this[_0x73cb('0x27')](util[_0x73cb('0x28')](_0x73cb('0x29'),_0x53f172,_0x2e9d1f*0x3e8,_0xc713aa));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x2a')]=function(_0x3e4903){_0x3e4903=_0x3e4903||_0x73cb('0x2b');return this[_0x73cb('0x27')](util[_0x73cb('0x28')](_0x73cb('0x2c'),_0x3e4903));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x2d')]=function(_0x34686e,_0xbde9fb){if(_[_0x73cb('0x2e')](_0xbde9fb)){return this[_0x73cb('0x27')](util[_0x73cb('0x28')](_0x73cb('0x2f'),_0x34686e,_0xbde9fb[_0x73cb('0x30')](',')));}return this['sendRequest'](util[_0x73cb('0x28')](_0x73cb('0x2f'),_0x34686e,_0xbde9fb));};AGIChannel['prototype'][_0x73cb('0x31')]=function(_0x3d557c){return this[_0x73cb('0x27')](util[_0x73cb('0x28')]('SET\x20CONTEXT\x20%s',_0x3d557c));};AGIChannel['prototype'][_0x73cb('0x32')]=function(_0xa30703){return this['sendRequest'](util[_0x73cb('0x28')](_0x73cb('0x33'),_0xa30703));};AGIChannel[_0x73cb('0x24')]['setPriority']=function(_0x47da90){return this[_0x73cb('0x27')](util['format'](_0x73cb('0x34'),_0x47da90));};AGIChannel[_0x73cb('0x24')][_0x73cb('0xe')]=function(){return this[_0x73cb('0x27')](_0x73cb('0x35'));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x36')]=function(_0x1d5671,_0x5861d6){var _0x56a758=_[_0x73cb('0x37')](_0x5861d6)||_['isNumber'](_0x5861d6)?_0x5861d6[_0x73cb('0x38')]():_0x5861d6;return this[_0x73cb('0x27')](util['format'](_0x73cb('0x39'),_0x1d5671,_0x56a758?_0x56a758[_0x73cb('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x3a')]=function(_0x4516cd,_0x467096){return this[_0x73cb('0x27')](util[_0x73cb('0x28')]('SAY\x20NUMBER\x20%s\x20%s',_0x4516cd,_0x467096));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x3b')]=function(_0xf24e,_0x5a3768){return this[_0x73cb('0x27')](util['format'](_0x73cb('0x3c'),_0xf24e,_0x5a3768));};AGIChannel[_0x73cb('0x24')][_0x73cb('0x3d')]=function(_0x8fbcdf,_0x309419){return this[_0x73cb('0x27')](util[_0x73cb('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x8fbcdf,_0x309419));};AGIChannel['prototype'][_0x73cb('0x3e')]=function(_0x5e98df,_0x3a6266,_0x4ef9aa){_0x3a6266=_0x3a6266||this['extension'];_0x4ef9aa=_0x4ef9aa||0x1;this[_0x73cb('0x31')](_0x5e98df);this[_0x73cb('0x32')](_0x3a6266);this[_0x73cb('0x3f')](_0x4ef9aa);return this[_0x73cb('0x2a')](util[_0x73cb('0x28')](_0x73cb('0x40'),_0x5e98df,_0x3a6266,_0x4ef9aa));};AGIChannel['prototype'][_0x73cb('0x41')]=function(_0x2d8352){return this[_0x73cb('0x27')](util['format'](_0x73cb('0x42'),_0x2d8352));};AGIChannel[_0x73cb('0x24')]['recordFile']=function(_0x14ecba,_0x2bbfd0,_0x3a3581,_0x9cca50,_0x42b6e8,_0x3f0052){_0x2bbfd0=_0x2bbfd0||_0x73cb('0x43');_0x3a3581=_0x3a3581||'';_0x9cca50=_0x9cca50===undefined?-0x1:_0x9cca50==='-1'?-0x1:_0x9cca50*0x3e8;_0x42b6e8=_0x42b6e8===undefined?'':'s='+_0x42b6e8;_0x3f0052=_0x3f0052?_0x73cb('0x44'):'';return this['sendRequest'](util[_0x73cb('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x14ecba,_0x2bbfd0,_0x3a3581,_0x9cca50,_0x3f0052,_0x42b6e8));};AGIChannel[_0x73cb('0x24')]['streamFile']=function(_0x40ae36,_0x1c1584){_0x1c1584=_0x1c1584||'';return this[_0x73cb('0x27')](util[_0x73cb('0x28')](_0x73cb('0x45'),_0x40ae36,_0x1c1584));};AGIChannel[_0x73cb('0x24')]['agi']=function(_0x994984){return this[_0x73cb('0x2d')](_0x73cb('0x46'),_0x994984);};AGIChannel['prototype'][_0x73cb('0x47')]=function(_0x329238){return this[_0x73cb('0x2d')](_0x73cb('0x48'),_0x329238);};AGIChannel['prototype'][_0x73cb('0x18')]=function(_0x17381e,_0x152c20){this[_0x73cb('0x2a')](util[_0x73cb('0x28')](_0x73cb('0x49'),_0x17381e['id'],_0x17381e['label'],_0x152c20));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x2c31=['ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','function','replace','result=','indexOf','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','answer','sendRequest'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x2c31,0xb6));var _0x12c3=function(_0x2d57f0,_0xefed66){_0x2d57f0=_0x2d57f0-0x0;var _0x3a7f84=_0x2c31[_0x2d57f0];return _0x3a7f84;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x12c3('0x0'))[_0x12c3('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x12c3('0x2'));function AGIChannel(_0x3f1699){var _0x1b21cc=this,_0x1163ca=new AGIReply(),_0x3735ba=![],_0x920b2c={};EventEmitter[_0x12c3('0x3')](_0x1b21cc);_0x3f1699[_0x12c3('0x4')](_0x12c3('0x5'));_0x3f1699['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1163ca[_0x12c3('0x4')]('utf8');_0x1163ca['on'](_0x12c3('0x6'),function(_0x187f03){for(var _0x557148 in _0x187f03){_0x1b21cc[_0x557148]=_0x187f03[_0x557148];}_0x1b21cc[_0x12c3('0x7')]('ready');});_0x1163ca['on'](_0x12c3('0x8'),function(_0xec6d20){if(_0xec6d20[_0x12c3('0x9')]()==_0x12c3('0xa')){_0x1b21cc['emit']('hangup');return;}if(_0xec6d20[_0x12c3('0xb')](0x0,0xb)==_0x12c3('0xc')){_0x3735ba=!![];}if(_0x3735ba){_0x920b2c['rx']+=_0xec6d20+'\x0a';if(_0xec6d20[_0x12c3('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x3735ba=![];}}else{_0x920b2c['rx']=_0xec6d20;}if(_0x3735ba){return;}if(typeof _0x920b2c['cb']==_0x12c3('0xe')){var _0x54e299=_0x920b2c['rx'][_0x12c3('0xb')](0x0,0x3),_0x2fd47f=null,_0x27b047=null;_0x54e299=parseInt(_0x54e299);if(isNaN(_0x54e299)){_0x920b2c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x54e299!=0xc8){_0x920b2c['cb'](null,{'code':_0x54e299,'result':-0x1,'extra':'KO'});return;}_0x2fd47f=_0x920b2c['rx'][_0x12c3('0xb')](0x4)[_0x12c3('0xf')](_0x12c3('0x10'),'');if(_0x2fd47f['indexOf']('\x20')!=-0x1){_0x2fd47f=_0x2fd47f['substr'](0x0,_0x2fd47f[_0x12c3('0x11')]('\x20'));}if(_['startsWith'](_0x2fd47f,'-1')){_0x2fd47f=parseInt(_0x2fd47f);}_0x27b047=_0x920b2c['rx'][_0x12c3('0x12')]('\x20');if(_0x27b047['length']==0x3){_0x27b047=_0x27b047[0x2][_0x12c3('0xb')](0x1,_0x27b047[0x2][_0x12c3('0x13')]-0x1);}else if(_0x27b047[_0x12c3('0x13')]>0x3){var _0x20d93b=/\((.+)\)/;var _0x4d359b=_0x920b2c['rx']['match'](_0x20d93b);if(_0x4d359b){_0x27b047=_0x4d359b[0x1];}else{_0x27b047=null;}}else{_0x27b047=null;}_0x920b2c['cb'](null,{'code':_0x54e299,'result':_0x2fd47f,'extra':_0x27b047});}});_0x3f1699['on'](_0x12c3('0x14'),function(_0x397ecc){_0x1b21cc[_0x12c3('0x7')](_0x12c3('0x14'),new AGIError(_0x12c3('0x15'),_0x397ecc[_0x12c3('0x16')]));});_0x3f1699['on'](_0x12c3('0x17'),function(){_0x1b21cc[_0x12c3('0x7')](_0x12c3('0x17'),new AGIError(_0x12c3('0x18')));});_0x3f1699['on'](_0x12c3('0x19'),function(){_0x1b21cc[_0x12c3('0x7')](_0x12c3('0x19'),new AGIError(_0x12c3('0x1a')));_0x3f1699[_0x12c3('0x1b')]();});_0x3f1699[_0x12c3('0x1c')](_0x1163ca);this[_0x12c3('0x1d')]=function(_0x39bd3d,_0x57109e){var _0x39bd3d=_0x39bd3d||'',_0x57109e=typeof _0x57109e==_0x12c3('0xe')?_0x57109e:new Function();_0x920b2c={'tx':_0x39bd3d,'rx':'','cb':_0x57109e};_0x3f1699[_0x12c3('0x1e')](_0x39bd3d+'\x0a');},this['close']=function(){_0x3f1699[_0x12c3('0x1b')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x12c3('0x1f')]['sendRequest']=function(_0x6c392a){return this['command']['sync'](this,_0x6c392a);};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x20')]=function(){return this[_0x12c3('0x21')](_0x12c3('0x22'));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x23')]=function(_0x20c43d,_0x5d5412,_0x1fbf54){_0x20c43d=_0x20c43d===undefined?_0x12c3('0x24'):_0x20c43d;_0x5d5412=_0x5d5412===undefined?'5':_0x5d5412;_0x1fbf54=_0x1fbf54===undefined?'1':_0x1fbf54;return this[_0x12c3('0x21')](util[_0x12c3('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20c43d,_0x5d5412*0x3e8,_0x1fbf54));};AGIChannel['prototype']['noop']=function(_0x4caa1c){_0x4caa1c=_0x4caa1c||_0x12c3('0x26');return this['sendRequest'](util[_0x12c3('0x25')](_0x12c3('0x27'),_0x4caa1c));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x28')]=function(_0x4af310,_0x3ffa66){if(_[_0x12c3('0x29')](_0x3ffa66)){return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x2a'),_0x4af310,_0x3ffa66[_0x12c3('0x2b')](',')));}return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x2a'),_0x4af310,_0x3ffa66));};AGIChannel['prototype']['setContext']=function(_0x1d3302){return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x2c'),_0x1d3302));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x2d')]=function(_0x66f75f){return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x2e'),_0x66f75f));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x2f')]=function(_0x4943cb){return this[_0x12c3('0x21')](util[_0x12c3('0x25')]('SET\x20PRIORITY\x20%s',_0x4943cb));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0xa')]=function(){return this[_0x12c3('0x21')](_0x12c3('0x30'));};AGIChannel['prototype']['setVariable']=function(_0x136daf,_0x26f0ef){var _0x583e8a=_[_0x12c3('0x31')](_0x26f0ef)||_[_0x12c3('0x32')](_0x26f0ef)?_0x26f0ef[_0x12c3('0x33')]():_0x26f0ef;return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x34'),_0x136daf,_0x583e8a?_0x583e8a[_0x12c3('0x33')]()[_0x12c3('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x12c3('0x1f')]['sayNumber']=function(_0x5d9954,_0x42b405){return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x35'),_0x5d9954,_0x42b405));};AGIChannel[_0x12c3('0x1f')]['sayDigits']=function(_0x6a7dc3,_0x3f9008){return this['sendRequest'](util[_0x12c3('0x25')](_0x12c3('0x36'),_0x6a7dc3,_0x3f9008));};AGIChannel['prototype'][_0x12c3('0x37')]=function(_0x52ea7d,_0x3bf235){return this['sendRequest'](util['format'](_0x12c3('0x38'),_0x52ea7d,_0x3bf235));};AGIChannel['prototype']['continueAt']=function(_0x543f96,_0x27f59b,_0x5c15e5){_0x27f59b=_0x27f59b||this[_0x12c3('0x39')];_0x5c15e5=_0x5c15e5||0x1;this[_0x12c3('0x3a')](_0x543f96);this[_0x12c3('0x2d')](_0x27f59b);this[_0x12c3('0x2f')](_0x5c15e5);return this['noop'](util['format'](_0x12c3('0x3b'),_0x543f96,_0x27f59b,_0x5c15e5));};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x3c')]=function(_0x29affc){return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x3d'),_0x29affc));};AGIChannel[_0x12c3('0x1f')]['recordFile']=function(_0x509e45,_0x45b755,_0x267db1,_0x25b650,_0x131597,_0x40b43d){_0x45b755=_0x45b755||_0x12c3('0x3e');_0x267db1=_0x267db1||'';_0x25b650=_0x25b650===undefined?-0x1:_0x25b650==='-1'?-0x1:_0x25b650*0x3e8;_0x131597=_0x131597===undefined?'':'s='+_0x131597;_0x40b43d=_0x40b43d?_0x12c3('0x3f'):'';return this[_0x12c3('0x21')](util[_0x12c3('0x25')](_0x12c3('0x40'),_0x509e45,_0x45b755,_0x267db1,_0x25b650,_0x40b43d,_0x131597));};AGIChannel['prototype'][_0x12c3('0x41')]=function(_0x1978c9,_0x157285){_0x157285=_0x157285||'';return this[_0x12c3('0x21')](util['format'](_0x12c3('0x42'),_0x1978c9,_0x157285));};AGIChannel[_0x12c3('0x1f')]['agi']=function(_0x384675){return this[_0x12c3('0x28')]('AGI',_0x384675);};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x43')]=function(_0x483abf){return this[_0x12c3('0x28')](_0x12c3('0x44'),_0x483abf);};AGIChannel[_0x12c3('0x1f')][_0x12c3('0x14')]=function(_0x59d7b7,_0x5e9868){this[_0x12c3('0x45')](util[_0x12c3('0x25')](_0x12c3('0x46'),_0x59d7b7['id'],_0x59d7b7[_0x12c3('0x47')],_0x5e9868));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d0e2c6c..457dbdc 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 _0x3b0f=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0xf60cd0,_0x34bf81){var _0x32ad56=function(_0x44cf0b){while(--_0x44cf0b){_0xf60cd0['push'](_0xf60cd0['shift']());}};_0x32ad56(++_0x34bf81);}(_0x3b0f,0x116));var _0xf3b0=function(_0x45bbca,_0x50ffb9){_0x45bbca=_0x45bbca-0x0;var _0x595847=_0x3b0f[_0x45bbca];return _0x595847;};'use strict';var util=require(_0xf3b0('0x0'));var error={'E_AGI_UNDEFINED':_0xf3b0('0x1'),'E_AGI_ARGUMENT_PORT':_0xf3b0('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xf3b0('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xf3b0('0x4'),'E_AGI_SOCKET_CLOSE':_0xf3b0('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xf3b0('0x6'),'E_AGI_COMMAND_EMPTY':_0xf3b0('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf3b0('0x8'),'E_AGI_IVR_ENTRY':_0xf3b0('0x9')};function AGIError(_0x2d2768){var _0x2d2768=_0x2d2768||null,_0x3d6285=_0x3d6285||[],_0x194257=0x1,_0x52ce28='';if(!error[_0x2d2768]){_0x2d2768=_0xf3b0('0xa');}_0x3d6285[_0xf3b0('0xb')](error[_0x2d2768]);while(arguments[_0x194257]){_0x3d6285[_0xf3b0('0xb')](arguments[_0x194257]);_0x194257++;}_0x52ce28=util[_0xf3b0('0xc')][_0xf3b0('0xd')](util,_0x3d6285);this['message']=_0x52ce28;this['name']=_0x2d2768;}module[_0xf3b0('0xe')]=AGIError; \ No newline at end of file +var _0xdd51=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x5edafc,_0x22002c){var _0x1fa600=function(_0x5dc143){while(--_0x5dc143){_0x5edafc['push'](_0x5edafc['shift']());}};_0x1fa600(++_0x22002c);}(_0xdd51,0xdf));var _0x1dd5=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xdd51[_0x411add];return _0x238242;};'use strict';var util=require(_0x1dd5('0x0'));var error={'E_AGI_UNDEFINED':_0x1dd5('0x1'),'E_AGI_ARGUMENT_PORT':_0x1dd5('0x2'),'E_AGI_SERVER_ERROR':_0x1dd5('0x3'),'E_AGI_SERVER_CLOSE':_0x1dd5('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x1dd5('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x1dd5('0x6'),'E_AGI_SOCKET_CLOSE':_0x1dd5('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1dd5('0x8'),'E_AGI_COMMAND_EMPTY':_0x1dd5('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1dd5('0xa'),'E_AGI_IVR_ENTRY':_0x1dd5('0xb')};function AGIError(_0x5baf3f){var _0x5baf3f=_0x5baf3f||null,_0x587be0=_0x587be0||[],_0x2c0861=0x1,_0x1258ff='';if(!error[_0x5baf3f]){_0x5baf3f=_0x1dd5('0xc');}_0x587be0[_0x1dd5('0xd')](error[_0x5baf3f]);while(arguments[_0x2c0861]){_0x587be0[_0x1dd5('0xd')](arguments[_0x2c0861]);_0x2c0861++;}_0x1258ff=util[_0x1dd5('0xe')][_0x1dd5('0xf')](util,_0x587be0);this[_0x1dd5('0x10')]=_0x1258ff;this[_0x1dd5('0x11')]=_0x5baf3f;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3bb82a4..bc58f6e 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5475=['emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','exports','ioredis','redis','defaults','localhost','agi'];(function(_0x35b03b,_0xf5673){var _0x335cbe=function(_0xaa7793){while(--_0xaa7793){_0x35b03b['push'](_0x35b03b['shift']());}};_0x335cbe(++_0xf5673);}(_0x5475,0x69));var _0x5547=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x5475[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0x5547('0x0'));var AGIError=require('./error');var config=require('../../config/environment');config[_0x5547('0x1')]=_[_0x5547('0x2')](config['redis'],{'host':_0x5547('0x3'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x5547('0x1')]);sub['subscribe'](_0x5547('0x4'),function(_0x1f953b){if(_0x1f953b)return eventEmitter[_0x5547('0x5')](_0x5547('0x6'),new AGIError(_0x5547('0x7'),_0x1f953b));});sub['on'](_0x5547('0x8'),function(_0x43a5d7,_0x442ddd){if(_0x43a5d7!==_0x5547('0x4'))return;try{var _0xfb7e3=JSON['parse'](_0x442ddd);eventEmitter[_0x5547('0x5')](_0x5547('0x9'),_0xfb7e3);}catch(_0x343834){eventEmitter[_0x5547('0x5')](_0x5547('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x343834));}});module[_0x5547('0xa')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xac17=['emit','error','E_AGI_SERVER_ERROR','message','parse','exports','lodash','events','EventEmitter','ioredis','./error','redis','localhost','subscribe','agi'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xac17,0x8d));var _0x7ac1=function(_0xa711b,_0x81a280){_0xa711b=_0xa711b-0x0;var _0x1f061d=_0xac17[_0xa711b];return _0x1f061d;};'use strict';var _=require(_0x7ac1('0x0'));var EventEmitter=require(_0x7ac1('0x1'))[_0x7ac1('0x2')];var Redis=require(_0x7ac1('0x3'));var AGIError=require(_0x7ac1('0x4'));var config=require('../../config/environment');config[_0x7ac1('0x5')]=_['defaults'](config[_0x7ac1('0x5')],{'host':_0x7ac1('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x7ac1('0x7')](_0x7ac1('0x8'),function(_0x3f68ac){if(_0x3f68ac)return eventEmitter[_0x7ac1('0x9')](_0x7ac1('0xa'),new AGIError(_0x7ac1('0xb'),_0x3f68ac));});sub['on'](_0x7ac1('0xc'),function(_0x3a704c,_0x1ba5cd){if(_0x3a704c!==_0x7ac1('0x8'))return;try{var _0x55b271=JSON[_0x7ac1('0xd')](_0x1ba5cd);eventEmitter[_0x7ac1('0x9')]('projectUpdate',_0x55b271);}catch(_0x467464){eventEmitter[_0x7ac1('0x9')](_0x7ac1('0xa'),new AGIError(_0x7ac1('0xb'),_0x467464));}});module[_0x7ac1('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 5c685e4..1ef4415 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 _0xa7bc=['addEdge','push','numberOfEdges','size','relations','getVertex','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','traverseBFS','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','agi','menu','getdigits','vertices','edges','prototype'];(function(_0x5458da,_0xbef6be){var _0x4a46b9=function(_0x5cb956){while(--_0x5cb956){_0x5458da['push'](_0x5458da['shift']());}};_0x4a46b9(++_0xbef6be);}(_0xa7bc,0x165));var _0xca7b=function(_0x41dc2a,_0x48d44d){_0x41dc2a=_0x41dc2a-0x0;var _0x2e93b3=_0xa7bc[_0x41dc2a];return _0x2e93b3;};'use strict';var _=require(_0xca7b('0x0'));var logger=require('../../../config/logger')(_0xca7b('0x1'));var verticesWithRetry=[_0xca7b('0x2'),_0xca7b('0x3'),'getsecretdigits'];var Graph=function(){this[_0xca7b('0x4')]={};this[_0xca7b('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0xca7b('0x6')]['addVertex']=function(_0x502c09){this[_0xca7b('0x4')][_0x502c09['id']]=_0x502c09;this['edges'][_0x502c09['id']]=[];};Graph[_0xca7b('0x6')][_0xca7b('0x7')]=function(_0x262a12,_0x5dd22a,_0x51438b){this[_0xca7b('0x5')][_0x262a12][_0xca7b('0x8')]({'target':_0x5dd22a,'condition':_0x51438b});this[_0xca7b('0x9')]+=0x1;};Graph[_0xca7b('0x6')]['size']=function(){return _[_0xca7b('0xa')](this['vertices']);};Graph[_0xca7b('0x6')][_0xca7b('0xb')]=function(){return this[_0xca7b('0x9')];};Graph[_0xca7b('0x6')][_0xca7b('0xc')]=function(_0x31bdcb){return this[_0xca7b('0x4')][_0x31bdcb];};Graph[_0xca7b('0x6')]['traverseBFS']=function(_0x2c3c26,_0x4f06fc){if(!this['vertices'][_0x2c3c26]){return logger['info']('no\x20vertex\x20found');}var _0x5038bf=_0x4f06fc(this['vertices'][_0x2c3c26]);if(!_0x5038bf){return logger[_0xca7b('0xd')](_0xca7b('0xe'));}if(this[_0xca7b('0x5')][_0x2c3c26][_0xca7b('0xf')]===0x0){return logger[_0xca7b('0xd')](_0xca7b('0x10'));}for(var _0x27c0d3=0x0,_0x40fc70=[],_0x27bde7=![];_0x27c0d3\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','hasOwnProperty','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','handleUnpublished','initialize','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1','projectUpdate','nextTick','deleted'];(function(_0x5b6bf3,_0x55f459){var _0x507293=function(_0xdae043){while(--_0xdae043){_0x5b6bf3['push'](_0x5b6bf3['shift']());}};_0x507293(++_0x55f459);}(_0x1a23,0xa0));var _0x31a2=function(_0x49afd9,_0x41f39d){_0x49afd9=_0x49afd9-0x0;var _0x19a830=_0x1a23[_0x49afd9];return _0x19a830;};'use strict';var _=require(_0x31a2('0x0'));var syncho=require('syncho');var util=require(_0x31a2('0x1'));var config=require(_0x31a2('0x2'));var logger=require(_0x31a2('0x3'))(_0x31a2('0x4'));var utilLicense=require(_0x31a2('0x5'));var rpc=require(_0x31a2('0x6'));var Project=require(_0x31a2('0x7'));var AGIEmitter=require(_0x31a2('0x8'))['EventEmitter'];var projects=[];config[_0x31a2('0x4')]=_[_0x31a2('0x9')](config[_0x31a2('0x4')],{'ip':_0x31a2('0xa'),'port':0x11dd});AGIEmitter['on'](_0x31a2('0xb'),projectUpdateHandler);function connectionHandler(_0x1c7de3){process[_0x31a2('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1c7de3);agiHandler(_0x1c7de3);}catch(_0x56aa17){logger['error'](_0x56aa17['stack']);}});});}function projectUpdateHandler(_0x5e1f63){try{var _0x1c72eb=_['findIndex'](projects,['id',_0x5e1f63['id']]);if(_0x1c72eb>-0x1){if(_0x5e1f63[_0x31a2('0xd')]===!![]){projects[_0x31a2('0xe')](_0x1c72eb,0x1);}else{projects[_0x1c72eb]=_0x5e1f63;}}else{projects[_0x31a2('0xf')](_0x5e1f63);}}catch(_0x7200a0){logger['error'](_0x7200a0[_0x31a2('0x10')]);}}function listeningHandler(){console[_0x31a2('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x31a2('0x4')][_0x31a2('0x12')]);logger[_0x31a2('0x13')](util[_0x31a2('0x14')](_0x31a2('0x15'),config[_0x31a2('0x4')]['ip'],config[_0x31a2('0x4')][_0x31a2('0x12')]));}function errorHandler(_0x26ed9f){if(_0x26ed9f&&_0x26ed9f[_0x31a2('0x16')]&&_0x26ed9f[_0x31a2('0x17')]){logger[_0x31a2('0x18')](util[_0x31a2('0x14')](_0x31a2('0x19'),_0x26ed9f[_0x31a2('0x16')],_0x26ed9f[_0x31a2('0x17')]));}else{logger[_0x31a2('0x18')](util[_0x31a2('0x14')](_0x31a2('0x1a'),_0x26ed9f[_0x31a2('0x10')]));}}function closeHandler(){logger[_0x31a2('0x13')](util[_0x31a2('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x31a2('0x1b')],this[_0x31a2('0x1c')],this['callerid'],this[_0x31a2('0x1d')],this[_0x31a2('0x1e')]));try{createSquareReport(this);}catch(_0x4ad070){logger[_0x31a2('0x18')](_0x4ad070[_0x31a2('0x10')]);}}function timeoutHandler(){logger['info'](util[_0x31a2('0x14')](_0x31a2('0x1f'),this['arg_1'],this[_0x31a2('0x1c')],this[_0x31a2('0x20')],this['dnid'],this[_0x31a2('0x1e')]));}function hangupHandler(){logger[_0x31a2('0x13')](util[_0x31a2('0x14')](_0x31a2('0x21'),this[_0x31a2('0x1b')],this[_0x31a2('0x1c')],this['callerid'],this['dnid'],this[_0x31a2('0x1e')]));this[_0x31a2('0x22')]=!![];}function createSquareReport(_0x2c7258,_0x1c8bdc){rpc[_0x31a2('0x23')](_0x2c7258)[_0x31a2('0x24')](function(_0x3eb02b){if(_0x1c8bdc){_0x1c8bdc(null,_0x3eb02b);}})['catch'](function(_0x4484ba){if(_0x1c8bdc){_0x1c8bdc(null,_0x4484ba);}});}function setChannelVariables(_0x10dbec){for(var _0x3a72b3 in _0x10dbec){if(_0x10dbec[_0x31a2('0x25')](_0x3a72b3)){if(_0x3a72b3['indexOf']('agi_')===0x0){_0x10dbec[_0x3a72b3['substring'](0x4)]=_0x10dbec[_0x3a72b3];delete _0x10dbec[_0x3a72b3];}}}}function agiHandler(_0x57ebf3){logger[_0x31a2('0x26')](_0x31a2('0x27'),JSON[_0x31a2('0x28')](_0x57ebf3,null,0x2));logger[_0x31a2('0x13')](util[_0x31a2('0x14')](_0x31a2('0x29'),_0x57ebf3[_0x31a2('0x1b')],_0x57ebf3[_0x31a2('0x1c')],_0x57ebf3[_0x31a2('0x20')],_0x57ebf3[_0x31a2('0x1d')],_0x57ebf3[_0x31a2('0x1e')]));_0x57ebf3['on'](_0x31a2('0x18'),errorHandler);_0x57ebf3['on'](_0x31a2('0x2a'),closeHandler);_0x57ebf3['on'](_0x31a2('0x2b'),timeoutHandler);_0x57ebf3[_0x31a2('0x22')]=![];_0x57ebf3['on']('hangup',hangupHandler);var _0x397f33=_[_0x31a2('0x2c')](projects,['name',_0x57ebf3[_0x31a2('0x1b')]]);if(!_0x397f33)return Project[_0x31a2('0x2d')](_0x57ebf3);if(!_0x397f33[_0x31a2('0x2e')])return Project[_0x31a2('0x2f')](_0x57ebf3);return Project[_0x31a2('0x30')](_0x397f33,_0x57ebf3);}function main(){var _0x293874;return utilLicense['getLicense']()[_0x31a2('0x24')](function(_0x2e00a2){if(!_0x2e00a2)return;if(_0x2e00a2['voice']){if(_0x2e00a2[_0x31a2('0x31')]&&_0x2e00a2[_0x31a2('0x31')]>0x0){logger[_0x31a2('0x13')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x2e00a2['callysquare']));_0x293874=_0x2e00a2['callysquare'];}else{logger[_0x31a2('0x13')](_0x31a2('0x32'));}}else{logger[_0x31a2('0x13')](_0x31a2('0x33'));_0x293874=-0x1;}})[_0x31a2('0x24')](function(){return Project[_0x31a2('0x34')]();})[_0x31a2('0x24')](function(_0xf9e289){projects=_0xf9e289;return;})['catch'](function(_0x76d600){logger[_0x31a2('0x18')](_0x31a2('0x35'),_0x76d600[_0x31a2('0x10')]);})[_0x31a2('0x36')](function(){var _0x4b7481=require(_0x31a2('0x37'))(config[_0x31a2('0x4')][_0x31a2('0x12')],config[_0x31a2('0x4')]['ip'],_0x293874);_0x4b7481['on'](_0x31a2('0x18'),errorHandler);_0x4b7481['on'](_0x31a2('0x38'),listeningHandler);_0x4b7481['on'](_0x31a2('0x39'),connectionHandler);_0x4b7481['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xb186=['EventEmitter','defaults','projectUpdate','nextTick','error','findIndex','deleted','splice','push','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','port','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','close','evtHangup','find','handleNotFound','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb186,0xe7));var _0x6b18=function(_0x2f9d83,_0xfbc7e7){_0x2f9d83=_0x2f9d83-0x0;var _0x112d5f=_0xb186[_0x2f9d83];return _0x112d5f;};'use strict';var _=require(_0x6b18('0x0'));var syncho=require(_0x6b18('0x1'));var util=require(_0x6b18('0x2'));var config=require(_0x6b18('0x3'));var logger=require(_0x6b18('0x4'))(_0x6b18('0x5'));var utilLicense=require(_0x6b18('0x6'));var rpc=require(_0x6b18('0x7'));var Project=require(_0x6b18('0x8'));var AGIEmitter=require('./events')[_0x6b18('0x9')];var projects=[];config[_0x6b18('0x5')]=_[_0x6b18('0xa')](config[_0x6b18('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x6b18('0xb'),projectUpdateHandler);function connectionHandler(_0x12811e){process[_0x6b18('0xc')](function(){syncho(function(){try{setChannelVariables(_0x12811e);agiHandler(_0x12811e);}catch(_0x407412){logger[_0x6b18('0xd')](_0x407412['stack']);}});});}function projectUpdateHandler(_0x368414){try{var _0x15c262=_[_0x6b18('0xe')](projects,['id',_0x368414['id']]);if(_0x15c262>-0x1){if(_0x368414[_0x6b18('0xf')]===!![]){projects[_0x6b18('0x10')](_0x15c262,0x1);}else{projects[_0x15c262]=_0x368414;}}else{projects[_0x6b18('0x11')](_0x368414);}}catch(_0x3abe1a){logger['error'](_0x3abe1a[_0x6b18('0x12')]);}}function listeningHandler(){console[_0x6b18('0x13')](_0x6b18('0x14'),config[_0x6b18('0x5')]['port']);logger[_0x6b18('0x15')](util[_0x6b18('0x16')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x6b18('0x5')]['ip'],config['agi'][_0x6b18('0x17')]));}function errorHandler(_0x2a396d){if(_0x2a396d&&_0x2a396d[_0x6b18('0x18')]&&_0x2a396d['message']){logger['error'](util[_0x6b18('0x16')](_0x6b18('0x19'),_0x2a396d[_0x6b18('0x18')],_0x2a396d[_0x6b18('0x1a')]));}else{logger[_0x6b18('0xd')](util[_0x6b18('0x16')](_0x6b18('0x1b'),_0x2a396d[_0x6b18('0x12')]));}}function closeHandler(){logger[_0x6b18('0x15')](util[_0x6b18('0x16')](_0x6b18('0x1c'),this[_0x6b18('0x1d')],this[_0x6b18('0x1e')],this[_0x6b18('0x1f')],this['dnid'],this[_0x6b18('0x20')]));try{createSquareReport(this);}catch(_0x4984af){logger[_0x6b18('0xd')](_0x4984af['stack']);}}function timeoutHandler(){logger[_0x6b18('0x15')](util['format'](_0x6b18('0x21'),this[_0x6b18('0x1d')],this['calleridname'],this['callerid'],this[_0x6b18('0x22')],this[_0x6b18('0x20')]));}function hangupHandler(){logger[_0x6b18('0x15')](util[_0x6b18('0x16')](_0x6b18('0x23'),this[_0x6b18('0x1d')],this[_0x6b18('0x1e')],this[_0x6b18('0x1f')],this['dnid'],this[_0x6b18('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x246253,_0xa4cdd){rpc['createSquareReport'](_0x246253)['then'](function(_0x25250a){if(_0xa4cdd){_0xa4cdd(null,_0x25250a);}})[_0x6b18('0x24')](function(_0x1869bb){if(_0xa4cdd){_0xa4cdd(null,_0x1869bb);}});}function setChannelVariables(_0x299564){for(var _0x39a114 in _0x299564){if(_0x299564[_0x6b18('0x25')](_0x39a114)){if(_0x39a114[_0x6b18('0x26')](_0x6b18('0x27'))===0x0){_0x299564[_0x39a114[_0x6b18('0x28')](0x4)]=_0x299564[_0x39a114];delete _0x299564[_0x39a114];}}}}function agiHandler(_0x49b712){logger[_0x6b18('0x29')](_0x6b18('0x2a'),JSON['stringify'](_0x49b712,null,0x2));logger[_0x6b18('0x15')](util[_0x6b18('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x49b712[_0x6b18('0x1d')],_0x49b712[_0x6b18('0x1e')],_0x49b712[_0x6b18('0x1f')],_0x49b712[_0x6b18('0x22')],_0x49b712['uniqueid']));_0x49b712['on'](_0x6b18('0xd'),errorHandler);_0x49b712['on'](_0x6b18('0x2b'),closeHandler);_0x49b712['on']('timeout',timeoutHandler);_0x49b712[_0x6b18('0x2c')]=![];_0x49b712['on']('hangup',hangupHandler);var _0x4e80db=_[_0x6b18('0x2d')](projects,[_0x6b18('0x18'),_0x49b712[_0x6b18('0x1d')]]);if(!_0x4e80db)return Project[_0x6b18('0x2e')](_0x49b712);if(!_0x4e80db['production'])return Project[_0x6b18('0x2f')](_0x49b712);return Project[_0x6b18('0x30')](_0x4e80db,_0x49b712);}function main(){var _0x3942df;return utilLicense[_0x6b18('0x31')]()[_0x6b18('0x32')](function(_0x5116a){if(!_0x5116a)return;if(_0x5116a[_0x6b18('0x33')]){if(_0x5116a[_0x6b18('0x34')]&&_0x5116a[_0x6b18('0x34')]>0x0){logger[_0x6b18('0x15')](util[_0x6b18('0x16')](_0x6b18('0x35'),_0x5116a[_0x6b18('0x34')]));_0x3942df=_0x5116a[_0x6b18('0x34')];}else{logger[_0x6b18('0x15')](_0x6b18('0x36'));}}else{logger[_0x6b18('0x15')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3942df=-0x1;}})['then'](function(){return Project['getAll']();})[_0x6b18('0x32')](function(_0x660041){projects=_0x660041;return;})[_0x6b18('0x24')](function(_0x38b26e){logger['error'](_0x6b18('0x37'),_0x38b26e['stack']);})[_0x6b18('0x38')](function(){var _0x39d05c=require(_0x6b18('0x39'))(config[_0x6b18('0x5')][_0x6b18('0x17')],config['agi']['ip'],_0x3942df);_0x39d05c['on'](_0x6b18('0xd'),errorHandler);_0x39d05c['on'](_0x6b18('0x3a'),listeningHandler);_0x39d05c['on'](_0x6b18('0x3b'),connectionHandler);_0x39d05c['on'](_0x6b18('0x2b'),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 393d2b9..f127c4c 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 _0xe5aa=['client','http','then','error','message','catch','sendMailMessage','SendMail','bluebird'];(function(_0x337e64,_0x20833c){var _0x505629=function(_0x258ac8){while(--_0x258ac8){_0x337e64['push'](_0x337e64['shift']());}};_0x505629(++_0x20833c);}(_0xe5aa,0x14c));var _0xae5a=function(_0x2e0602,_0x59eee5){_0x2e0602=_0x2e0602-0x0;var _0x2a3aa1=_0xe5aa[_0x2e0602];return _0x2a3aa1;};'use strict';var BPromise=require(_0xae5a('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xae5a('0x1')][_0xae5a('0x2')]({'port':0x232b});function request(_0x47dddd,_0x104a63){return new BPromise(function(_0x336c56,_0x368d1a){return client['request'](_0x47dddd,_0x104a63)[_0xae5a('0x3')](function(_0xf9be37){if(_0xf9be37[_0xae5a('0x4')]){return _0x368d1a(_0xf9be37[_0xae5a('0x4')][_0xae5a('0x5')]);}else{return _0x336c56(_0xf9be37['result']);}})[_0xae5a('0x6')](function(_0x44fa8a){return _0x368d1a(_0x44fa8a);});});}exports[_0xae5a('0x7')]=function(_0x44d98d,_0xbf396c){return request(_0xae5a('0x8'),{'account':_0x44d98d,'message':_0xbf396c});}; \ No newline at end of file +var _0x02f7=['jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x4d62bc,_0x393272){var _0x1dea32=function(_0x50cae8){while(--_0x50cae8){_0x4d62bc['push'](_0x4d62bc['shift']());}};_0x1dea32(++_0x393272);}(_0x02f7,0x107));var _0x702f=function(_0x52b169,_0x30b73c){_0x52b169=_0x52b169-0x0;var _0x23d3f1=_0x02f7[_0x52b169];return _0x23d3f1;};'use strict';var BPromise=require(_0x702f('0x0'));var jayson=require(_0x702f('0x1'));var client=jayson[_0x702f('0x2')][_0x702f('0x3')]({'port':0x232b});function request(_0x5cba74,_0x5848cf){return new BPromise(function(_0x3fc2ec,_0x31a153){return client[_0x702f('0x4')](_0x5cba74,_0x5848cf)[_0x702f('0x5')](function(_0x3c0a66){if(_0x3c0a66['error']){return _0x31a153(_0x3c0a66[_0x702f('0x6')]['message']);}else{return _0x3fc2ec(_0x3c0a66[_0x702f('0x7')]);}})[_0x702f('0x8')](function(_0x5ecde5){return _0x31a153(_0x5ecde5);});});}exports[_0x702f('0x9')]=function(_0x2c8022,_0x1bb070){return request(_0x702f('0xa'),{'account':_0x2c8022,'message':_0x1bb070});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e99b7c6..0bb3a0f 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4b7=['result','evtHangup','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','util','../../config/logger','./rpc','./mailRpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','length','source','target','addEdge','value','toJson','inspect','start','stringify','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','traverseBFS','debug','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xa4b7,0xb7));var _0x7a4b=function(_0x3f63b7,_0x36b7d2){_0x3f63b7=_0x3f63b7-0x0;var _0x201dd8=_0xa4b7[_0x3f63b7];return _0x201dd8;};'use strict';var _=require('lodash');var moment=require(_0x7a4b('0x0'));var parser=require('xml2json');var util=require(_0x7a4b('0x1'));var logger=require(_0x7a4b('0x2'))('agi');var rpc=require(_0x7a4b('0x3'));var mailRpc=require(_0x7a4b('0x4'));var Graph=require('./graph');var Vertices=require(_0x7a4b('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7a4b('0x6')]()[_0x7a4b('0x7')](function(_0x5c9da1){logger[_0x7a4b('0x8')](_0x7a4b('0x9'),_0x5c9da1[_0x7a4b('0xa')]);return[];});}function addVertex(_0x5e4291,_0x4675aa,_0x4e5f1d){_0x4675aa[_0x7a4b('0xb')]=_0x4e5f1d;if(_0x4675aa[_0x7a4b('0xc')]('retry')){_0x4675aa['maxRetry']=parseInt(_0x4675aa[_0x7a4b('0xd')],0xa);}_0x5e4291[_0x7a4b('0xe')](_[_0x7a4b('0xf')](_0x4675aa,_0x7a4b('0x10')));}function initGraph(_0x4c6bab,_0x49e163){var _0x31be1c=new Graph();for(var _0xcf78bb in _0x4c6bab){if(_0x4c6bab[_0x7a4b('0xc')](_0xcf78bb)){if(_['isArray'](_0x4c6bab[_0xcf78bb])){for(var _0x508900=0x0;_0x508900<_0x4c6bab[_0xcf78bb][_0x7a4b('0x11')];_0x508900+=0x1){addVertex(_0x31be1c,_0x4c6bab[_0xcf78bb][_0x508900],_0xcf78bb);}}else{addVertex(_0x31be1c,_0x4c6bab[_0xcf78bb],_0xcf78bb);}}}for(var _0x16cd18=0x0;_0x16cd18<_0x49e163[_0x7a4b('0x11')];_0x16cd18+=0x1){if(_0x49e163[_0x16cd18][_0x7a4b('0x12')]&&_0x49e163[_0x16cd18][_0x7a4b('0x13')]){_0x31be1c[_0x7a4b('0x14')](_0x49e163[_0x16cd18][_0x7a4b('0x12')],_0x49e163[_0x16cd18][_0x7a4b('0x13')],_0x49e163[_0x16cd18][_0x7a4b('0x15')]);}}return _0x31be1c;}function getRoot(_0x3513c5){return parser[_0x7a4b('0x16')](_0x3513c5,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x4397ff){return util[_0x7a4b('0x17')](_0x4397ff,{'showHidden':![],'depth':null});}function initialize(_0x1e0a74,_0x3eb7ad){var _0x5af167=getRoot(_0x1e0a74['production']);if(!_0x5af167||!_0x5af167[_0x7a4b('0x18')])return;var _0x53a418,_0x21867e,_0x1d4e3c;logger['debug']('root',JSON[_0x7a4b('0x19')](_0x5af167,null,0x2));_0x3eb7ad['joinAt']=moment()[_0x7a4b('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x53a418=initGraph(_['omit'](_0x5af167,_0x7a4b('0x10')),_0x5af167[_0x7a4b('0x10')]);_0x21867e=new Vertices(_0x3eb7ad,rpc,mailRpc);logger[_0x7a4b('0x1b')](util[_0x7a4b('0x1a')](_0x7a4b('0x1c'),_0x3eb7ad[_0x7a4b('0x1d')],_0x3eb7ad[_0x7a4b('0x1e')],_0x3eb7ad['callerid'],_0x3eb7ad[_0x7a4b('0x1f')],_0x3eb7ad[_0x7a4b('0x20')]));_0x53a418[_0x7a4b('0x21')](_0x5af167[_0x7a4b('0x18')]['id'],function(_0x1163f6){try{_0x1163f6=_0x21867e['clear'](_0x1163f6);logger[_0x7a4b('0x22')]('vertex',JSON[_0x7a4b('0x19')](_0x1163f6,null,0x2));if(_0x1163f6[_0x7a4b('0xb')]==='gotoc'){logger[_0x7a4b('0x1b')](_0x7a4b('0x23'));_0x3eb7ad['context']=_0x1163f6[_0x7a4b('0x24')]||_0x3eb7ad[_0x7a4b('0x24')];_0x3eb7ad[_0x7a4b('0x25')]=_0x1163f6[_0x7a4b('0x25')];_0x3eb7ad['priority']=_0x1163f6['priority']?_0x1163f6[_0x7a4b('0x26')]-0x1:0x1;return null;}else if(_0x1163f6&&_0x21867e[_0x1163f6[_0x7a4b('0xb')]]){_0x1d4e3c=_0x21867e[_0x1163f6[_0x7a4b('0xb')]](_0x1163f6);logger[_0x7a4b('0x1b')](_0x7a4b('0x27'),JSON[_0x7a4b('0x19')](_0x1d4e3c,null,0x2));if(_0x1d4e3c&&_0x1d4e3c[_0x7a4b('0x28')]===AGI_CODE_SUCCESS&&_0x1d4e3c[_0x7a4b('0x29')]!==AGI_RESULT_ERROR&&!_0x3eb7ad[_0x7a4b('0x2a')]){logger[_0x7a4b('0x22')]('response',inspect(_0x1d4e3c));return _['isUndefined'](_0x1d4e3c[_0x7a4b('0x29')])?null:_0x1d4e3c[_0x7a4b('0x29')][_0x7a4b('0x2b')]();}else{logger['error'](_0x7a4b('0x27'),inspect(_0x1d4e3c));return null;}}else{logger[_0x7a4b('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x194147){logger[_0x7a4b('0x8')](_0x194147[_0x7a4b('0xa')]);return null;}});if(_0x5af167[_0x7a4b('0x2c')]){logger[_0x7a4b('0x1b')](util['format'](_0x7a4b('0x2d'),_0x3eb7ad['arg_1'],_0x3eb7ad['calleridname'],_0x3eb7ad[_0x7a4b('0x2e')],_0x3eb7ad[_0x7a4b('0x1f')],_0x3eb7ad[_0x7a4b('0x20')]));_0x53a418['traverseBFS'](_0x5af167[_0x7a4b('0x2c')]['id'],function(_0x559ae3){try{_0x559ae3=_0x21867e[_0x7a4b('0x2f')](_0x559ae3);logger['debug']('vertex',JSON[_0x7a4b('0x19')](_0x559ae3,null,0x2));if(_0x559ae3&&_0x21867e[_0x559ae3[_0x7a4b('0xb')]]){_0x1d4e3c=_0x21867e[_0x559ae3['agicommand']](_0x559ae3);if(_0x1d4e3c){logger['debug'](_0x7a4b('0x27'),inspect(_0x1d4e3c));return _[_0x7a4b('0x30')](_0x1d4e3c[_0x7a4b('0x29')])?null:_0x1d4e3c[_0x7a4b('0x29')][_0x7a4b('0x2b')]();}else{logger[_0x7a4b('0x8')](_0x7a4b('0x27'),inspect(_0x1d4e3c));return null;}}else{logger[_0x7a4b('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x23faef){logger[_0x7a4b('0x8')](_0x23faef[_0x7a4b('0xa')]);return null;}});}logger[_0x7a4b('0x1b')](util[_0x7a4b('0x1a')](_0x7a4b('0x31'),_0x3eb7ad[_0x7a4b('0x1d')],_0x3eb7ad[_0x7a4b('0x1e')],_0x3eb7ad['callerid'],_0x3eb7ad[_0x7a4b('0x1f')],_0x3eb7ad['uniqueid']));logger[_0x7a4b('0x1b')](util[_0x7a4b('0x1a')](_0x7a4b('0x32'),_0x3eb7ad[_0x7a4b('0x24')],_0x3eb7ad['extension'],parseInt(_0x3eb7ad[_0x7a4b('0x26')],0xa)+0x1));_0x3eb7ad[_0x7a4b('0x33')](_0x3eb7ad[_0x7a4b('0x24')],_0x3eb7ad[_0x7a4b('0x25')],parseInt(_0x3eb7ad[_0x7a4b('0x26')],0xa)+0x1);_0x3eb7ad[_0x7a4b('0x34')]();}function handleNotFound(_0x5eb720){logger[_0x7a4b('0x8')](util['format'](_0x7a4b('0x35'),_0x5eb720['arg_1']));_0x5eb720[_0x7a4b('0x33')](_0x5eb720[_0x7a4b('0x24')],_0x5eb720[_0x7a4b('0x25')],parseInt(_0x5eb720[_0x7a4b('0x26')],0xa)+0x1);_0x5eb720['close']();}function handleUnpublished(_0x53504c){logger['error'](util[_0x7a4b('0x1a')](_0x7a4b('0x36'),_0x53504c[_0x7a4b('0x1d')]));_0x53504c[_0x7a4b('0x33')](_0x53504c[_0x7a4b('0x24')],_0x53504c[_0x7a4b('0x25')],parseInt(_0x53504c['priority'],0xa)+0x1);_0x53504c[_0x7a4b('0x34')]();}module[_0x7a4b('0x37')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x7993=['info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','stack','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','lodash','moment','util','../../config/logger','./graph','./vertices','getSquareProjects','error','agicommand','hasOwnProperty','retry','omit','length','source','target','value','toJson','root','start','debug','joinAt','mxCell'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7993,0x1b5));var _0x3799=function(_0x4f095b,_0x323b5d){_0x4f095b=_0x4f095b-0x0;var _0x44efa9=_0x7993[_0x4f095b];return _0x44efa9;};'use strict';var _=require(_0x3799('0x0'));var moment=require(_0x3799('0x1'));var parser=require('xml2json');var util=require(_0x3799('0x2'));var logger=require(_0x3799('0x3'))('agi');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x3799('0x4'));var Vertices=require(_0x3799('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3799('0x6')]()['catch'](function(_0x4152f4){logger[_0x3799('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x4152f4['stack']);return[];});}function addVertex(_0x384e78,_0x4df6be,_0x2aadbc){_0x4df6be[_0x3799('0x8')]=_0x2aadbc;if(_0x4df6be[_0x3799('0x9')](_0x3799('0xa'))){_0x4df6be['maxRetry']=parseInt(_0x4df6be[_0x3799('0xa')],0xa);}_0x384e78['addVertex'](_[_0x3799('0xb')](_0x4df6be,'mxCell'));}function initGraph(_0x363286,_0x106c8b){var _0x2f56bd=new Graph();for(var _0x509fea in _0x363286){if(_0x363286[_0x3799('0x9')](_0x509fea)){if(_['isArray'](_0x363286[_0x509fea])){for(var _0x5ce648=0x0;_0x5ce648<_0x363286[_0x509fea]['length'];_0x5ce648+=0x1){addVertex(_0x2f56bd,_0x363286[_0x509fea][_0x5ce648],_0x509fea);}}else{addVertex(_0x2f56bd,_0x363286[_0x509fea],_0x509fea);}}}for(var _0x49d2c6=0x0;_0x49d2c6<_0x106c8b[_0x3799('0xc')];_0x49d2c6+=0x1){if(_0x106c8b[_0x49d2c6][_0x3799('0xd')]&&_0x106c8b[_0x49d2c6][_0x3799('0xe')]){_0x2f56bd['addEdge'](_0x106c8b[_0x49d2c6][_0x3799('0xd')],_0x106c8b[_0x49d2c6]['target'],_0x106c8b[_0x49d2c6][_0x3799('0xf')]);}}return _0x2f56bd;}function getRoot(_0x2a2644){return parser[_0x3799('0x10')](_0x2a2644,{'object':!![]})['mxGraphModel'][_0x3799('0x11')];}function inspect(_0x10bf9c){return util['inspect'](_0x10bf9c,{'showHidden':![],'depth':null});}function initialize(_0x33ff37,_0x551e7c){var _0x2e4522=getRoot(_0x33ff37['production']);if(!_0x2e4522||!_0x2e4522[_0x3799('0x12')])return;var _0x343819,_0x4629fd,_0x7ac707;logger[_0x3799('0x13')](_0x3799('0x11'),JSON['stringify'](_0x2e4522,null,0x2));_0x551e7c[_0x3799('0x14')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x343819=initGraph(_[_0x3799('0xb')](_0x2e4522,_0x3799('0x15')),_0x2e4522[_0x3799('0x15')]);_0x4629fd=new Vertices(_0x551e7c,rpc,mailRpc);logger[_0x3799('0x16')](util[_0x3799('0x17')](_0x3799('0x18'),_0x551e7c[_0x3799('0x19')],_0x551e7c[_0x3799('0x1a')],_0x551e7c[_0x3799('0x1b')],_0x551e7c[_0x3799('0x1c')],_0x551e7c[_0x3799('0x1d')]));_0x343819[_0x3799('0x1e')](_0x2e4522[_0x3799('0x12')]['id'],function(_0x1b3b9a){try{_0x1b3b9a=_0x4629fd['clear'](_0x1b3b9a);logger['debug']('vertex',JSON[_0x3799('0x1f')](_0x1b3b9a,null,0x2));if(_0x1b3b9a[_0x3799('0x8')]===_0x3799('0x20')){logger['info'](_0x3799('0x21'));_0x551e7c[_0x3799('0x22')]=_0x1b3b9a[_0x3799('0x22')]||_0x551e7c[_0x3799('0x22')];_0x551e7c[_0x3799('0x23')]=_0x1b3b9a[_0x3799('0x23')];_0x551e7c['priority']=_0x1b3b9a['priority']?_0x1b3b9a[_0x3799('0x24')]-0x1:0x1;return null;}else if(_0x1b3b9a&&_0x4629fd[_0x1b3b9a[_0x3799('0x8')]]){_0x7ac707=_0x4629fd[_0x1b3b9a[_0x3799('0x8')]](_0x1b3b9a);logger['info'](_0x3799('0x25'),JSON[_0x3799('0x1f')](_0x7ac707,null,0x2));if(_0x7ac707&&_0x7ac707[_0x3799('0x26')]===AGI_CODE_SUCCESS&&_0x7ac707['result']!==AGI_RESULT_ERROR&&!_0x551e7c['evtHangup']){logger['debug'](_0x3799('0x25'),inspect(_0x7ac707));return _[_0x3799('0x27')](_0x7ac707[_0x3799('0x28')])?null:_0x7ac707[_0x3799('0x28')][_0x3799('0x29')]();}else{logger[_0x3799('0x7')](_0x3799('0x25'),inspect(_0x7ac707));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x53ec99){logger[_0x3799('0x7')](_0x53ec99['stack']);return null;}});if(_0x2e4522[_0x3799('0x2a')]){logger[_0x3799('0x16')](util[_0x3799('0x17')](_0x3799('0x2b'),_0x551e7c[_0x3799('0x19')],_0x551e7c[_0x3799('0x1a')],_0x551e7c['callerid'],_0x551e7c[_0x3799('0x1c')],_0x551e7c[_0x3799('0x1d')]));_0x343819[_0x3799('0x1e')](_0x2e4522[_0x3799('0x2a')]['id'],function(_0x27c441){try{_0x27c441=_0x4629fd['clear'](_0x27c441);logger[_0x3799('0x13')](_0x3799('0x2c'),JSON[_0x3799('0x1f')](_0x27c441,null,0x2));if(_0x27c441&&_0x4629fd[_0x27c441[_0x3799('0x8')]]){_0x7ac707=_0x4629fd[_0x27c441[_0x3799('0x8')]](_0x27c441);if(_0x7ac707){logger[_0x3799('0x13')](_0x3799('0x25'),inspect(_0x7ac707));return _[_0x3799('0x27')](_0x7ac707[_0x3799('0x28')])?null:_0x7ac707[_0x3799('0x28')][_0x3799('0x29')]();}else{logger['error'](_0x3799('0x25'),inspect(_0x7ac707));return null;}}else{logger[_0x3799('0x7')]('agicommand\x20not\x20found');return null;}}catch(_0x6f9b59){logger[_0x3799('0x7')](_0x6f9b59[_0x3799('0x2d')]);return null;}});}logger[_0x3799('0x16')](util[_0x3799('0x17')](_0x3799('0x2e'),_0x551e7c['arg_1'],_0x551e7c[_0x3799('0x1a')],_0x551e7c[_0x3799('0x1b')],_0x551e7c[_0x3799('0x1c')],_0x551e7c[_0x3799('0x1d')]));logger['info'](util[_0x3799('0x17')](_0x3799('0x2f'),_0x551e7c[_0x3799('0x22')],_0x551e7c[_0x3799('0x23')],parseInt(_0x551e7c[_0x3799('0x24')],0xa)+0x1));_0x551e7c[_0x3799('0x30')](_0x551e7c['context'],_0x551e7c['extension'],parseInt(_0x551e7c[_0x3799('0x24')],0xa)+0x1);_0x551e7c[_0x3799('0x31')]();}function handleNotFound(_0x4aca8a){logger[_0x3799('0x7')](util['format']('Project\x20%s\x20not\x20found',_0x4aca8a[_0x3799('0x19')]));_0x4aca8a[_0x3799('0x30')](_0x4aca8a['context'],_0x4aca8a[_0x3799('0x23')],parseInt(_0x4aca8a[_0x3799('0x24')],0xa)+0x1);_0x4aca8a['close']();}function handleUnpublished(_0x146768){logger[_0x3799('0x7')](util[_0x3799('0x17')](_0x3799('0x32'),_0x146768[_0x3799('0x19')]));_0x146768[_0x3799('0x30')](_0x146768[_0x3799('0x22')],_0x146768[_0x3799('0x23')],parseInt(_0x146768[_0x3799('0x24')],0xa)+0x1);_0x146768[_0x3799('0x31')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 812cc75..063d71c 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 _0x579c=['call','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','length','trim','emit','line','exports','util','stream','Transform'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x579c,0xda));var _0xc579=function(_0x3aaf5d,_0x2b5189){_0x3aaf5d=_0x3aaf5d-0x0;var _0x522b20=_0x579c[_0x3aaf5d];return _0x522b20;};'use strict';var util=require(_0xc579('0x0'));var Transform=require(_0xc579('0x1'))[_0xc579('0x2')];function AGIReply(_0x1db849){Transform[_0xc579('0x3')](this,_0x1db849);this['_localBuffer']='';this[_0xc579('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xc579('0x5')][_0xc579('0x6')]=function(_0x1ce62b,_0x14f261,_0x124ee5){var _0x1bd276='\x0a',_0x2e451b=['\x0a\x0a',_0xc579('0x7')],_0x585167=-0x1,_0x1c6d9c=-0x1,_0x293c4a='',_0x2ce949=0x0,_0x2361fc='',_0x224f84='';this[_0xc579('0x8')]+=_0x1ce62b[_0xc579('0x9')]();_0x2361fc=this['_localBuffer'];if(!this[_0xc579('0x4')]){_0x2ce949=0x0;while(_0x2e451b[_0x2ce949]){while((_0x1c6d9c=_0x2361fc[_0xc579('0xa')](_0x2e451b[_0x2ce949]))!=-0x1){_0x293c4a=_0x2e451b[_0x2ce949];_0x224f84=_0x2361fc[_0xc579('0xb')](0x0,_0x1c6d9c);_0x2361fc=_0x2361fc[_0xc579('0xb')](_0x1c6d9c+_0x293c4a[_0xc579('0xc')]);var _0x4577a2=_0x224f84['split'](_0x1bd276),_0x2a8e70=0x0,_0x1905b7={},_0x421812='',_0x441028='',_0x448d51=-0x1;while(_0x4577a2[_0x2a8e70]){_0x448d51=_0x4577a2[_0x2a8e70][_0xc579('0xa')](':');if(_0x448d51!=-0x1){_0x421812=_0x4577a2[_0x2a8e70]['slice'](0x0,_0x448d51)[_0xc579('0xd')]();_0x441028=_0x4577a2[_0x2a8e70]['slice'](_0x448d51+0x1)[_0xc579('0xd')]();if(_0x421812['length']>0x0){_0x1905b7[_0x421812]=_0x441028;}}else{}_0x2a8e70++;}this[_0xc579('0xe')]('headers',_0x1905b7);this[_0xc579('0x4')]=!![];}_0x2ce949++;}this[_0xc579('0x8')]=_0x2361fc;}else{while((_0x585167=_0x2361fc['indexOf'](_0x1bd276))!=-0x1){_0x224f84=_0x2361fc['substring'](0x0,_0x585167);this[_0xc579('0xe')](_0xc579('0xf'),_0x224f84);_0x2361fc=_0x2361fc[_0xc579('0xb')](_0x585167+_0x1bd276[_0xc579('0xc')]);}this[_0xc579('0x8')]=_0x2361fc;}_0x124ee5();};module[_0xc579('0x10')]=AGIReply; \ No newline at end of file +var _0x9db7=['_inBody','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','stream','Transform','call','_localBuffer'];(function(_0x42f23e,_0x221c5d){var _0x18ab15=function(_0x38a151){while(--_0x38a151){_0x42f23e['push'](_0x42f23e['shift']());}};_0x18ab15(++_0x221c5d);}(_0x9db7,0x176));var _0x79db=function(_0xc82544,_0x9776c3){_0xc82544=_0xc82544-0x0;var _0x579f2e=_0x9db7[_0xc82544];return _0x579f2e;};'use strict';var util=require('util');var Transform=require(_0x79db('0x0'))[_0x79db('0x1')];function AGIReply(_0x51d9a2){Transform[_0x79db('0x2')](this,_0x51d9a2);this[_0x79db('0x3')]='';this[_0x79db('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0x79db('0x5')]=function(_0x3f4c03,_0x1d3da3,_0x21c2e8){var _0x5ece38='\x0a',_0x863509=['\x0a\x0a',_0x79db('0x6')],_0x24e144=-0x1,_0x20a729=-0x1,_0x574ced='',_0x5e39fd=0x0,_0x175888='',_0x4ef727='';this[_0x79db('0x3')]+=_0x3f4c03[_0x79db('0x7')]();_0x175888=this['_localBuffer'];if(!this[_0x79db('0x4')]){_0x5e39fd=0x0;while(_0x863509[_0x5e39fd]){while((_0x20a729=_0x175888[_0x79db('0x8')](_0x863509[_0x5e39fd]))!=-0x1){_0x574ced=_0x863509[_0x5e39fd];_0x4ef727=_0x175888[_0x79db('0x9')](0x0,_0x20a729);_0x175888=_0x175888[_0x79db('0x9')](_0x20a729+_0x574ced[_0x79db('0xa')]);var _0x3b1952=_0x4ef727[_0x79db('0xb')](_0x5ece38),_0x3a3bd7=0x0,_0x36b763={},_0x4b8ccd='',_0x2bd673='',_0x5d6e52=-0x1;while(_0x3b1952[_0x3a3bd7]){_0x5d6e52=_0x3b1952[_0x3a3bd7][_0x79db('0x8')](':');if(_0x5d6e52!=-0x1){_0x4b8ccd=_0x3b1952[_0x3a3bd7][_0x79db('0xc')](0x0,_0x5d6e52)['trim']();_0x2bd673=_0x3b1952[_0x3a3bd7][_0x79db('0xc')](_0x5d6e52+0x1)[_0x79db('0xd')]();if(_0x4b8ccd[_0x79db('0xa')]>0x0){_0x36b763[_0x4b8ccd]=_0x2bd673;}}else{}_0x3a3bd7++;}this[_0x79db('0xe')](_0x79db('0xf'),_0x36b763);this[_0x79db('0x4')]=!![];}_0x5e39fd++;}this[_0x79db('0x3')]=_0x175888;}else{while((_0x24e144=_0x175888[_0x79db('0x8')](_0x5ece38))!=-0x1){_0x4ef727=_0x175888['substring'](0x0,_0x24e144);this['emit'](_0x79db('0x10'),_0x4ef727);_0x175888=_0x175888[_0x79db('0x9')](_0x24e144+_0x5ece38[_0x79db('0xa')]);}this[_0x79db('0x3')]=_0x175888;}_0x21c2e8();};module[_0x79db('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ef758d0..9f7a895 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 _0xea89=['getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0xea89,0x1e2));var _0x9ea8=function(_0x3cc1bf,_0x34455c){_0x3cc1bf=_0x3cc1bf-0x0;var _0x3e867d=_0xea89[_0x3cc1bf];return _0x3e867d;};'use strict';var _=require(_0x9ea8('0x0'));var moment=require(_0x9ea8('0x1'));var jayson=require(_0x9ea8('0x2'));var client=jayson[_0x9ea8('0x3')][_0x9ea8('0x4')]({'port':0x2329});function request(_0x58dc99,_0x41e322){return new Promise(function(_0x520915,_0x226d05){return client['request'](_0x58dc99,_0x41e322)[_0x9ea8('0x5')](function(_0x3ec628){if(_0x3ec628[_0x9ea8('0x6')]){return _0x226d05(_0x3ec628[_0x9ea8('0x6')][_0x9ea8('0x7')]);}else{return _0x520915(_0x3ec628[_0x9ea8('0x8')]);}})[_0x9ea8('0x9')](function(_0x4889de){return _0x226d05(_0x4889de);});});}exports[_0x9ea8('0xa')]=function(){return request(_0x9ea8('0xb'),{'options':{'raw':![],'attributes':['id','name',_0x9ea8('0xc')]}});};exports[_0x9ea8('0xd')]=function(_0x2de710){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2de710},'attributes':[_0x9ea8('0xc')]}});};exports[_0x9ea8('0xe')]=function(_0xe888c6){return request(_0x9ea8('0xf'),{'options':{'raw':![],'where':{'id':_0xe888c6},'include':[{'model':_0x9ea8('0x10'),'as':_0x9ea8('0x11'),'include':[{'model':_0x9ea8('0x12'),'as':'CloudProvider'}]}],'attributes':['id',_0x9ea8('0x13'),_0x9ea8('0x14')],'smtp':!![]}});};exports[_0x9ea8('0x15')]=function(_0x4c894d){return request(_0x9ea8('0x16'),{'options':{'where':{'id':_0x4c894d},'attributes':[_0x9ea8('0x13')]}});};exports[_0x9ea8('0x17')]=function(_0x1b8bd6){return request(_0x9ea8('0x18'),{'options':{'where':{'id':_0x1b8bd6},'attributes':[_0x9ea8('0x13')]}});};exports[_0x9ea8('0x19')]=function(_0x5866f3){return request(_0x9ea8('0x1a'),{'options':{'where':{'id':_0x5866f3},'attributes':[_0x9ea8('0x13')]}});};exports[_0x9ea8('0x1b')]=function(_0x5c17fe){return request(_0x9ea8('0x1c'),{'options':{'where':{'id':_0x5c17fe},'attributes':['dsn']}});};exports[_0x9ea8('0x1d')]=function(_0x26de62){return request(_0x9ea8('0x1e'),{'options':{'where':{'id':_0x26de62},'attributes':[_0x9ea8('0x13')]}});};exports[_0x9ea8('0x1f')]=function(_0xe844a5){return request(_0x9ea8('0x20'),{'options':{'where':{'phone':_0xe844a5['phone']},'attributes':['id']}});};exports[_0x9ea8('0x21')]=function(_0x400e8e){return request(_0x9ea8('0x22'),{'options':{'where':{'id':_0x400e8e},'attributes':[_0x9ea8('0x13')]}});};exports[_0x9ea8('0x23')]=function(_0xbafa7){return request(_0x9ea8('0x24'),{'options':{'where':{'id':_0xbafa7},'attributes':[_0x9ea8('0x25')]}});};exports[_0x9ea8('0x26')]=function(_0x14f411){return request(_0x9ea8('0x27'),{'options':{'raw':![],'where':{'id':_0x14f411},'include':[{'model':'Interval','as':_0x9ea8('0x28')}]}});};exports['getSmsAccountById']=function(_0x40451f){return request(_0x9ea8('0x29'),{'options':{'where':{'id':_0x40451f},'attributes':['id',_0x9ea8('0x13')]}});};exports[_0x9ea8('0x2a')]=function(_0x1bfd77){return request('CreateSmsMessage',{'body':_0x1bfd77});};exports[_0x9ea8('0x2b')]=function(_0x25b74d){return request(_0x9ea8('0x2c'),{'body':_0x25b74d});};exports[_0x9ea8('0x2d')]=function(_0x2e621e){return request(_0x9ea8('0x2e'),{'body':_[_0x9ea8('0x2f')](_0x2e621e,{'project_name':_0x2e621e['arg_1'],'prev_project_name':_0x2e621e['arg_2']||'','is_subproject':_0x2e621e[_0x9ea8('0x30')]?!![]:![],'leaveAt':moment()[_0x9ea8('0x31')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x9ea8('0x32')]=function(_0x30a032){return request(_0x9ea8('0x33'),{'body':_0x30a032});};exports['createSquareMessage']=function(_0x494211){return request(_0x9ea8('0x34'),{'body':_0x494211});};exports[_0x9ea8('0x35')]=function(_0x462f2){return request(_0x9ea8('0x36'),{'options':{'raw':![],'where':{'phone':_0x462f2['phone'],'ListId':_0x462f2['ListId']}}})[_0x9ea8('0x5')](function(_0x1f90bf){if(_0x1f90bf){return _0x1f90bf;}return request(_0x9ea8('0x37'),{'body':_0x462f2});});};exports[_0x9ea8('0x38')]=function(_0x3576c7){return request(_0x9ea8('0x39'),{'options':{'where':{'id':_0x3576c7},'attributes':['name']}});};exports[_0x9ea8('0x3a')]=function(_0x298944,_0x2fe23e){return request(_0x9ea8('0x3b'),{'body':{'interface':_0x2fe23e},'options':{'where':_0x298944}});};exports[_0x9ea8('0x3c')]=function(_0x199353,_0xb99172,_0x29e785){return request(_0x9ea8('0x3d'),{'body':{'type':_0xb99172,'uniqueid':_0x29e785},'options':{'where':_0x199353}});};exports[_0x9ea8('0x3e')]=function(_0x1816b9){return request(_0x9ea8('0x3f'),{'body':{},'options':{'where':_0x1816b9}});};exports['agentLogout']=function(_0x4e6ddd){return request(_0x9ea8('0x40'),{'body':{},'options':{'where':_0x4e6ddd}});}; \ No newline at end of file +var _0x5183=['createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','error','getSquareProjects','GetSquareProjects','production','ShowSquareProject','ShowMailAccount','Smtp','CloudProvider','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x5b1424,_0x20a88a){var _0x109911=function(_0x4185df){while(--_0x4185df){_0x5b1424['push'](_0x5b1424['shift']());}};_0x109911(++_0x20a88a);}(_0x5183,0x13e));var _0x3518=function(_0xd28200,_0xdf65ef){_0xd28200=_0xd28200-0x0;var _0x32447e=_0x5183[_0xd28200];return _0x32447e;};'use strict';var _=require(_0x3518('0x0'));var moment=require(_0x3518('0x1'));var jayson=require(_0x3518('0x2'));var client=jayson['client']['http']({'port':0x2329});function request(_0x2323f3,_0x3cc276){return new Promise(function(_0x178571,_0x421ab5){return client['request'](_0x2323f3,_0x3cc276)['then'](function(_0x242c22){if(_0x242c22[_0x3518('0x3')]){return _0x421ab5(_0x242c22[_0x3518('0x3')]['message']);}else{return _0x178571(_0x242c22['result']);}})['catch'](function(_0x147b59){return _0x421ab5(_0x147b59);});});}exports[_0x3518('0x4')]=function(){return request(_0x3518('0x5'),{'options':{'raw':![],'attributes':['id','name',_0x3518('0x6')]}});};exports['getSquareProject']=function(_0x16931f){return request(_0x3518('0x7'),{'options':{'raw':![],'where':{'name':_0x16931f},'attributes':[_0x3518('0x6')]}});};exports['getMailAccountById']=function(_0x3a60c7){return request(_0x3518('0x8'),{'options':{'raw':![],'where':{'id':_0x3a60c7},'include':[{'model':'MailServerOut','as':_0x3518('0x9'),'include':[{'model':_0x3518('0xa'),'as':_0x3518('0xa')}]}],'attributes':['id',_0x3518('0xb'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x7f5c5a){return request(_0x3518('0x7'),{'options':{'where':{'id':_0x7f5c5a},'attributes':[_0x3518('0xb')]}});};exports['getVoiceQueueById']=function(_0x563507){return request(_0x3518('0xc'),{'options':{'where':{'id':_0x563507},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0xd')]=function(_0x488364){return request(_0x3518('0xe'),{'options':{'where':{'id':_0x488364},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0xf')]=function(_0x30a74d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x30a74d},'attributes':[_0x3518('0x10')]}});};exports['getUserById']=function(_0xd24f36){return request('ShowUser',{'options':{'where':{'id':_0xd24f36},'attributes':[_0x3518('0xb')]}});};exports[_0x3518('0x11')]=function(_0x4b9a06){return request(_0x3518('0x12'),{'options':{'where':{'phone':_0x4b9a06[_0x3518('0x13')]},'attributes':['id']}});};exports[_0x3518('0x14')]=function(_0x8092d6){return request(_0x3518('0x15'),{'options':{'where':{'id':_0x8092d6},'attributes':['name']}});};exports[_0x3518('0x16')]=function(_0x568f26){return request(_0x3518('0x17'),{'options':{'where':{'id':_0x568f26},'attributes':[_0x3518('0x18')]}});};exports[_0x3518('0x19')]=function(_0x507047){return request(_0x3518('0x1a'),{'options':{'raw':![],'where':{'id':_0x507047},'include':[{'model':_0x3518('0x1b'),'as':_0x3518('0x1c')}]}});};exports[_0x3518('0x1d')]=function(_0x1d76fe){return request('ShowSmsAccount',{'options':{'where':{'id':_0x1d76fe},'attributes':['id',_0x3518('0xb')]}});};exports[_0x3518('0x1e')]=function(_0x421c2e){return request(_0x3518('0x1f'),{'body':_0x421c2e});};exports[_0x3518('0x20')]=function(_0x3aa4e0){return request(_0x3518('0x21'),{'body':_0x3aa4e0});};exports[_0x3518('0x22')]=function(_0x8baad6){return request(_0x3518('0x23'),{'body':_[_0x3518('0x24')](_0x8baad6,{'project_name':_0x8baad6[_0x3518('0x25')],'prev_project_name':_0x8baad6[_0x3518('0x26')]||'','is_subproject':_0x8baad6[_0x3518('0x26')]?!![]:![],'leaveAt':moment()[_0x3518('0x27')](_0x3518('0x28'))})});};exports[_0x3518('0x29')]=function(_0x30ebce){return request(_0x3518('0x2a'),{'body':_0x30ebce});};exports[_0x3518('0x2b')]=function(_0x34a6d6){return request(_0x3518('0x2c'),{'body':_0x34a6d6});};exports[_0x3518('0x2d')]=function(_0x369d58){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x369d58['phone'],'ListId':_0x369d58[_0x3518('0x2e')]}}})[_0x3518('0x2f')](function(_0x4c16d6){if(_0x4c16d6){return _0x4c16d6;}return request(_0x3518('0x30'),{'body':_0x369d58});});};exports[_0x3518('0x31')]=function(_0x5986e1){return request(_0x3518('0x32'),{'options':{'where':{'id':_0x5986e1},'attributes':['name']}});};exports[_0x3518('0x33')]=function(_0x550c64,_0x6f3e96){return request(_0x3518('0x34'),{'body':{'interface':_0x6f3e96},'options':{'where':_0x550c64}});};exports[_0x3518('0x35')]=function(_0x16f354,_0xf5ad75,_0x3e7d29){return request('PauseUser',{'body':{'type':_0xf5ad75,'uniqueid':_0x3e7d29},'options':{'where':_0x16f354}});};exports[_0x3518('0x36')]=function(_0x5bc9c3){return request(_0x3518('0x37'),{'body':{},'options':{'where':_0x5bc9c3}});};exports[_0x3518('0x38')]=function(_0x313be1){return request(_0x3518('0x39'),{'body':{},'options':{'where':_0x313be1}});}; \ 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 1d5d537..7d2f897 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 _0x2d95=['./polly','exports'];(function(_0x472c0b,_0x5a8dfd){var _0x22f403=function(_0x14d507){while(--_0x14d507){_0x472c0b['push'](_0x472c0b['shift']());}};_0x22f403(++_0x5a8dfd);}(_0x2d95,0xca));var _0x52d9=function(_0x2c9b1a,_0x1fcbb9){_0x2c9b1a=_0x2c9b1a-0x0;var _0x19c335=_0x2d95[_0x2c9b1a];return _0x19c335;};var polly=require(_0x52d9('0x0'));var lex=require('./lex');module[_0x52d9('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x0324=['./lex','exports'];(function(_0xd5917f,_0x4b08f8){var _0x141e3c=function(_0x54afcc){while(--_0x54afcc){_0xd5917f['push'](_0xd5917f['shift']());}};_0x141e3c(++_0x4b08f8);}(_0x0324,0x90));var _0x4032=function(_0x43a0c6,_0x28afea){_0x43a0c6=_0x43a0c6-0x0;var _0x4bc10b=_0x0324[_0x43a0c6];return _0x4bc10b;};var polly=require('./polly');var lex=require(_0x4032('0x0'));module[_0x4032('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c262e87..1a8a92f 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['exports'];(function(_0x224ebe,_0x1180af){var _0x198652=function(_0x1ad5e7){while(--_0x1ad5e7){_0x224ebe['push'](_0x224ebe['shift']());}};_0x198652(++_0x1180af);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1e6b82,_0x401404){_0x1e6b82=_0x1e6b82-0x0;var _0x500461=_0x6f0d[_0x1e6b82];return _0x500461;};'use strict';var lex=require('./lib/api');module[_0xd6f0('0x0')]=function(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93){return lex(_0x64ebf2,_0xd1480,_0x107a8c,_0x573473,_0x275230,_0x135a93);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b){return lex(_0x46400f,_0xa5f6b7,_0x4a08d4,_0x5080f5,_0x229028,_0x1fdf5b);}; \ 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 4b95102..b5fecfa 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(_0x5d5f36,_0x32fb55){var _0x1b77ce=function(_0x4e0edd){while(--_0x4e0edd){_0x5d5f36['push'](_0x5d5f36['shift']());}};_0x1b77ce(++_0x32fb55);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x46614d,_0x2585cd){var _0x2ac14a=function(_0x347118){while(--_0x347118){_0x46614d['push'](_0x46614d['shift']());}};_0x2ac14a(++_0x2585cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 f6ff91e..a98356f 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x54f01e,_0x577dec,_0x312d3f,_0x58ebcf,_0x19c230,_0x271f3d,_0x109c83){return polly(_0x54f01e,_0x577dec,_0x312d3f,_0x58ebcf,_0x19c230,_0x271f3d,_0x109c83);}; \ No newline at end of file +var _0x9afd=['./lib/api'];(function(_0x3a77ce,_0x486ee8){var _0xe885c7=function(_0x5a8ae0){while(--_0x5a8ae0){_0x3a77ce['push'](_0x3a77ce['shift']());}};_0xe885c7(++_0x486ee8);}(_0x9afd,0x1c5));var _0xd9af=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0x9afd[_0x237546];return _0x233e29;};'use strict';var polly=require(_0xd9af('0x0'));module['exports']=function(_0x270661,_0x232595,_0x558f7e,_0x5dd83a,_0x17072b,_0x1fe3b9,_0x3329f4){return polly(_0x270661,_0x232595,_0x558f7e,_0x5dd83a,_0x17072b,_0x1fe3b9,_0x3329f4);}; \ 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 c9369f8..54a83d3 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 _0x6295=['path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3'];(function(_0x24a711,_0x2c44e7){var _0x24dad5=function(_0x530840){while(--_0x530840){_0x24a711['push'](_0x24a711['shift']());}};_0x24dad5(++_0x2c44e7);}(_0x6295,0x129));var _0x5629=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x6295[_0x15bc81];return _0x59440e;};'use strict';var fs=require('fs');var path=require(_0x5629('0x0'));var BPromise=require(_0x5629('0x1'));var rs=require('randomstring');var AWS=require(_0x5629('0x2'));function pollyResult(_0xae45b4,_0x31f9c1,_0x523f7a){return new BPromise(function(_0x48fff5,_0xb50677){_0xae45b4[_0x5629('0x3')](_0x31f9c1,function(_0x51525f,_0x230809){if(_0x51525f){_0xb50677(_0x51525f);}else if(_0x230809){if(_0x230809[_0x5629('0x4')]instanceof Buffer){fs['writeFile'](_0x523f7a,_0x230809[_0x5629('0x4')],function(_0x261768){if(_0x261768){_0xb50677(_0x261768);}else{_0x48fff5();}});}else{_0xb50677(new Error(_0x5629('0x5')));}}else{_0xb50677(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x5629('0x6')]=function(_0x34de86,_0x215b42,_0x4433e2,_0xb9aed8,_0x4a05e7,_0x3a9cbf,_0x57cf59){var _0x12c3f5=new AWS['Polly']({'accessKeyId':_0x34de86,'secretAccessKey':_0x215b42,'region':_0x4433e2});var _0x36ae1b={'Text':_0x4a05e7,'TextType':_0x3a9cbf||_0x5629('0x7'),'OutputFormat':_0x5629('0x8'),'VoiceId':_0xb9aed8};return pollyResult(_0x12c3f5,_0x36ae1b,_0x57cf59);}; \ No newline at end of file +var _0x3535=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path'];(function(_0x8e4931,_0x3683f8){var _0x1fa36e=function(_0x3b6839){while(--_0x3b6839){_0x8e4931['push'](_0x8e4931['shift']());}};_0x1fa36e(++_0x3683f8);}(_0x3535,0x83));var _0x5353=function(_0x235ea5,_0x2014c8){_0x235ea5=_0x235ea5-0x0;var _0x2973fa=_0x3535[_0x235ea5];return _0x2973fa;};'use strict';var fs=require('fs');var path=require(_0x5353('0x0'));var BPromise=require(_0x5353('0x1'));var rs=require(_0x5353('0x2'));var AWS=require(_0x5353('0x3'));function pollyResult(_0x5dbf94,_0x5d4f45,_0x4a219d){return new BPromise(function(_0x6c4918,_0x5ccd28){_0x5dbf94[_0x5353('0x4')](_0x5d4f45,function(_0x393b90,_0x32bba0){if(_0x393b90){_0x5ccd28(_0x393b90);}else if(_0x32bba0){if(_0x32bba0[_0x5353('0x5')]instanceof Buffer){fs['writeFile'](_0x4a219d,_0x32bba0[_0x5353('0x5')],function(_0x4ec41b){if(_0x4ec41b){_0x5ccd28(_0x4ec41b);}else{_0x6c4918();}});}else{_0x5ccd28(new Error(_0x5353('0x6')));}}else{_0x5ccd28(new Error(_0x5353('0x7')));}});});}module[_0x5353('0x8')]=function(_0x15dab1,_0x50e1a5,_0x40b3f9,_0x336184,_0x2b3add,_0x154ed3,_0x409d51){var _0x5221d0=new AWS[(_0x5353('0x9'))]({'accessKeyId':_0x15dab1,'secretAccessKey':_0x50e1a5,'region':_0x40b3f9});var _0x11fb4a={'Text':_0x2b3add,'TextType':_0x154ed3||'text','OutputFormat':_0x5353('0xa'),'VoiceId':_0x336184};return pollyResult(_0x5221d0,_0x11fb4a,_0x409d51);}; \ 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 6e46bd1..5346d43 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 _0x23f3=['./lib/api','exports'];(function(_0x2967ac,_0x568836){var _0x37a954=function(_0x336243){while(--_0x336243){_0x2967ac['push'](_0x2967ac['shift']());}};_0x37a954(++_0x568836);}(_0x23f3,0x98));var _0x323f=function(_0x416d21,_0x55e886){_0x416d21=_0x416d21-0x0;var _0x308678=_0x23f3[_0x416d21];return _0x308678;};'use strict';var asr=require(_0x323f('0x0'));module[_0x323f('0x1')]=function(_0x1f178d,_0x483bd4,_0x2d5c97,_0x23ba49){return asr(_0x1f178d,_0x483bd4,_0x2d5c97);}; \ No newline at end of file +var _0xc11f=['exports'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0xc11f,0x15c));var _0xfc11=function(_0x76cc4b,_0x404f30){_0x76cc4b=_0x76cc4b-0x0;var _0x1293c7=_0xc11f[_0x76cc4b];return _0x1293c7;};'use strict';var asr=require('./lib/api');module[_0xfc11('0x0')]=function(_0x27722c,_0x248312,_0x38fe5b,_0x4b167f){return asr(_0x27722c,_0x248312,_0x38fe5b);}; \ 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 4011926..a5760b0 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 _0x5645=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x216f4a,_0x5206b3){var _0x429901=function(_0x281370){while(--_0x281370){_0x216f4a['push'](_0x216f4a['shift']());}};_0x429901(++_0x5206b3);}(_0x5645,0x19e));var _0x5564=function(_0x3f5d48,_0x1f64bd){_0x3f5d48=_0x3f5d48-0x0;var _0x4576e8=_0x5645[_0x3f5d48];return _0x4576e8;};'use strict';var url=require(_0x5564('0x0'));var BPromise=require(_0x5564('0x1'));var fs=require('fs');var host=_0x5564('0x2');module[_0x5564('0x3')]=function(_0x26c54d,_0x5ecd66,_0x241816){return new BPromise(function(_0x64ae4d,_0x1240cd){var _0x821a1a;if(typeof _0x26c54d!==_0x5564('0x4')||_0x26c54d[_0x5564('0x5')]===0x0){return _0x1240cd(_0x5564('0x6'));}if(typeof _0x5ecd66!==_0x5564('0x4')||_0x5ecd66[_0x5564('0x5')]===0x0){return _0x1240cd('key\x20should\x20be\x20a\x20string');}if(typeof _0x241816!=='undefined'&&(typeof _0x241816!==_0x5564('0x4')||_0x241816[_0x5564('0x5')]===0x0)){return _0x1240cd(_0x5564('0x7'));}try{_0x821a1a=fs[_0x5564('0x8')](_0x26c54d)[_0x5564('0x9')]('base64');}catch(_0x1ba45a){return _0x1240cd(_0x1ba45a);}return _0x64ae4d({'method':_0x5564('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5ecd66,'body':{'config':{'encoding':_0x5564('0xb'),'sampleRateHertz':_0x5564('0xc'),'languageCode':_0x241816},'audio':{'content':_0x821a1a}},'json':!![]});});}; \ No newline at end of file +var _0x3667=['8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x49f575,_0x4454df){var _0x1e57a9=function(_0xef8ee5){while(--_0xef8ee5){_0x49f575['push'](_0x49f575['shift']());}};_0x1e57a9(++_0x4454df);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0x7366('0x0'));var BPromise=require(_0x7366('0x1'));var fs=require('fs');var host=_0x7366('0x2');module[_0x7366('0x3')]=function(_0x3c601d,_0x5d1072,_0x27a90d){return new BPromise(function(_0x1cfcc9,_0x4b32a7){var _0x27726b;if(typeof _0x3c601d!==_0x7366('0x4')||_0x3c601d[_0x7366('0x5')]===0x0){return _0x4b32a7(_0x7366('0x6'));}if(typeof _0x5d1072!==_0x7366('0x4')||_0x5d1072['length']===0x0){return _0x4b32a7(_0x7366('0x7'));}if(typeof _0x27a90d!==_0x7366('0x8')&&(typeof _0x27a90d!==_0x7366('0x4')||_0x27a90d[_0x7366('0x5')]===0x0)){return _0x4b32a7(_0x7366('0x9'));}try{_0x27726b=fs[_0x7366('0xa')](_0x3c601d)[_0x7366('0xb')](_0x7366('0xc'));}catch(_0x18aee5){return _0x4b32a7(_0x18aee5);}return _0x1cfcc9({'method':_0x7366('0xd'),'uri':host+_0x7366('0xe')+_0x5d1072,'body':{'config':{'encoding':_0x7366('0xf'),'sampleRateHertz':_0x7366('0x10'),'languageCode':_0x27a90d},'audio':{'content':_0x27726b}},'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 be8af2d..d117f25 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 _0x551f=['./asr'];(function(_0x3f36c3,_0x2de571){var _0x18bbe3=function(_0xa344f4){while(--_0xa344f4){_0x3f36c3['push'](_0x3f36c3['shift']());}};_0x18bbe3(++_0x2de571);}(_0x551f,0x70));var _0xf551=function(_0x392ca2,_0x2ddc48){_0x392ca2=_0x392ca2-0x0;var _0x582879=_0x551f[_0x392ca2];return _0x582879;};var asr=require(_0xf551('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xc361=['exports'];(function(_0xad65d5,_0x57314c){var _0x3f7e4c=function(_0x49e2a6){while(--_0x49e2a6){_0xad65d5['push'](_0xad65d5['shift']());}};_0x3f7e4c(++_0x57314c);}(_0xc361,0x120));var _0x1c36=function(_0x52dc13,_0x5813c2){_0x52dc13=_0x52dc13-0x0;var _0x1143e7=_0xc361[_0x52dc13];return _0x1143e7;};var asr=require('./asr');module[_0x1c36('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 9f94a8b..9596531 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 _0x277d=['statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','audioConfig','MP3','text:synthesize','.mp3','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','utf8','POST','f.req=','stringify','jQ1olc','null','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','parse\x20response\x20failed:\x0a','googleASR','results','map','transcript','alternatives','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','resolvedQuery','action','fulfillment','score','code','metadata','endConversation','replace','sessionPath','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get'];(function(_0x169ec2,_0x47b763){var _0x59a4e1=function(_0x2a7ac4){while(--_0x2a7ac4){_0x169ec2['push'](_0x169ec2['shift']());}};_0x59a4e1(++_0x47b763);}(_0x277d,0x17a));var _0xd277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x277d[_0x59ee6f];return _0x4c0979;};'use strict';var apiai=require(_0xd277('0x0'));var BPromise=require(_0xd277('0x1'));var dialogflow=require(_0xd277('0x2'));var fs=require('fs');var http=require(_0xd277('0x3'));var https=require(_0xd277('0x4'));var md5=require(_0xd277('0x5'));var path=require(_0xd277('0x6'));var querystring=require(_0xd277('0x7'));var rp=require(_0xd277('0x8'));var rs=require('randomstring');var sox=require(_0xd277('0x9'));var tts=require(_0xd277('0xa'));var urlParse=require('url')[_0xd277('0xb')];var util=require(_0xd277('0xc'));var aws=require(_0xd277('0xd'));var google=require(_0xd277('0xe'));var sestek=require(_0xd277('0xf'));var tilde=require(_0xd277('0x10'));var logger=require(_0xd277('0x11'))('agi');var ISPEECH_API=_0xd277('0x12');function downloadFile(_0x229777,_0x169ba5){return new BPromise(function(_0xb78f17,_0x1fa225){var _0x3f1f99=urlParse(_0x229777);var _0xfe5a0b=_0x3f1f99[_0xd277('0x13')]===_0xd277('0x14')?https:http;var _0x52046a={'host':_0x3f1f99[_0xd277('0x15')],'path':_0x3f1f99['path'],'headers':{'user-agent':_0xd277('0x16')}};_0xfe5a0b[_0xd277('0x17')](_0x52046a,function(_0x38e568){if(_0x38e568[_0xd277('0x18')]!==0xc8){logger[_0xd277('0x19')](_0xd277('0x1a')+_0x229777+_0xd277('0x1b')+_0x38e568[_0xd277('0x18')]+'\x20('+_0x38e568[_0xd277('0x1c')]+')');_0x1fa225(new Error(_0xd277('0x1a')+_0x229777+_0xd277('0x1b')+_0x38e568[_0xd277('0x18')]+'\x20('+_0x38e568[_0xd277('0x1c')]+')'));return;}var _0x309223=fs[_0xd277('0x1d')](_0x169ba5);_0x309223['on'](_0xd277('0x1e'),function(){logger['info'](_0xd277('0x1f'));_0x309223[_0xd277('0x20')](_0xb78f17);});_0x309223['on'](_0xd277('0x19'),function(_0x40e20a){fs[_0xd277('0x21')](_0x169ba5);logger[_0xd277('0x19')](_0xd277('0x22'),_0x40e20a);_0x1fa225(_0x40e20a);});_0x38e568[_0xd277('0x23')](_0x309223);})['on'](_0xd277('0x19'),function(_0xe0ef45){logger[_0xd277('0x19')](_0xe0ef45);_0x1fa225(_0xe0ef45);})[_0xd277('0x24')]();});}function uploadFile(_0x11f93f){return new BPromise(function(_0x4a194b,_0x3bc174){var _0x14dfbb=urlParse(_0x11f93f);var _0x19d90d=_0x14dfbb[_0xd277('0x13')]==='https:'?https:http;var _0x45715a={'host':_0x14dfbb[_0xd277('0x15')],'path':_0x14dfbb['path'],'headers':{'user-agent':_0xd277('0x16')}};_0x19d90d[_0xd277('0x17')](_0x45715a,function(_0x5df7da){if(_0x5df7da[_0xd277('0x18')]!==0xc8){_0x3bc174(new Error(_0xd277('0x1a')+_0x11f93f+'\x20failed,\x20status\x20code\x20=\x20'+_0x5df7da[_0xd277('0x18')]+'\x20('+_0x5df7da[_0xd277('0x1c')]+')'));return;}var _0x21bf73='';_0x5df7da['on'](_0xd277('0x25'),function(_0x589471){_0x21bf73+=_0x589471;});_0x5df7da['on'](_0xd277('0x24'),function(){_0x4a194b(_0x21bf73);});})['on'](_0xd277('0x19'),function(_0x10bad6){_0x3bc174(_0x10bad6);})['end']();});}function convertFile(_0x300136,_0x49b4e2){return new BPromise(function(_0x2d8cd8,_0x8fdfe0){var _0x4a2488=sox[_0xd277('0x26')](_0x300136,_0x49b4e2,{'sampleRate':0x1f40,'format':_0xd277('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a2488['on']('error',function(_0x227a64){logger[_0xd277('0x19')](_0xd277('0x28'),_0x227a64);_0x8fdfe0(_0x227a64);});_0x4a2488['on'](_0xd277('0x24'),function(){logger[_0xd277('0x29')](_0xd277('0x2a'));_0x2d8cd8();});_0x4a2488['start']();});}function base64Decode(_0x516f08,_0x560fd0){var _0x181c4a=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs[_0xd277('0x2d')](0x4)+_0xd277('0x2e'));fs[_0xd277('0x2f')](_0x181c4a,_0x516f08,_0xd277('0x30'));return convertFile(_0x181c4a,_0x560fd0)[_0xd277('0x31')](function(){try{fs[_0xd277('0x21')](_0x181c4a);fs['chmodSync'](_0x560fd0,_0xd277('0x32'));}catch(_0x4888b6){logger[_0xd277('0x19')](_0x4888b6);}return _0x560fd0[_0xd277('0x33')]('.')[0x0];});}function base64Encode(_0x4e3e8c){var _0xc5ac38=fs[_0xd277('0x34')](_0x4e3e8c);return new Buffer(_0xc5ac38)[_0xd277('0x35')](_0xd277('0x30'));}exports[_0xd277('0x36')]=function(_0x59064d,_0x1a7d34,_0x5e4035,_0x1fbb79,_0x3d847e,_0x27c80f){var _0x24b058,_0x51d57d;var _0x16a598='https://texttospeech.googleapis.com/v1/';var _0x50b2b1=_0xd277('0x37')+_0x59064d;var _0x4bf28f={};if(_0x1a7d34===_0xd277('0x38')){_0x4bf28f[_0xd277('0x39')]={'ssml':_0x5e4035};}else{_0x4bf28f['input']={'text':_0x5e4035};};_0x4bf28f['voice']={'languageCode':_0x1fbb79,'ssmlGender':_0x3d847e};_0x4bf28f[_0xd277('0x3a')]={'audioEncoding':_0xd277('0x3b'),'sampleRateHertz':0x1f40};var _0x1469a8={'url':_0x16a598+_0xd277('0x3c')+_0x50b2b1,'method':'POST','json':!![],'body':_0x4bf28f};return rp(_0x1469a8)[_0xd277('0x31')](function(_0x341801){return new BPromise(function(_0xde3e3f,_0x59ce6c){_0x24b058=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs[_0xd277('0x2d')](0x4)+_0xd277('0x3d'));var _0x379d3f=Buffer['from'](_0x341801[_0xd277('0x3e')],_0xd277('0x30'));return fs[_0xd277('0x3f')](_0x24b058,_0x379d3f,function(_0x5e157d){_0x59ce6c(_0x5e157d);},function(_0x24066e){fs[_0xd277('0x40')](_0x24b058,_0xd277('0x32'));_0xde3e3f(_0x24066e);});});})[_0xd277('0x31')](function(_0x1e0778){_0x51d57d=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs['generate'](0x4)+_0xd277('0x2e'));return convertFile(_0x24b058,_0x51d57d);})[_0xd277('0x31')](function(){try{fs[_0xd277('0x21')](_0x24b058);fs[_0xd277('0x40')](_0x51d57d,_0xd277('0x32'));}catch(_0x363c38){logger[_0xd277('0x19')](_0x363c38);}logger[_0xd277('0x29')](_0xd277('0x41'),_0x51d57d[_0xd277('0x33')]('.')[0x0]);return _0x51d57d[_0xd277('0x33')]('.')[0x0];});};exports[_0xd277('0x42')]=function(_0x4ff865,_0x2f6305){var _0x3914fe='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x24f255,_0x5c3247;var _0x359e7e;var _0x2ac591={'encoding':_0xd277('0x43'),'method':_0xd277('0x44'),'timeout':0x2710,'url':_0x3914fe,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xd277('0x45')+encodeURIComponent(JSON[_0xd277('0x46')]([[[_0xd277('0x47'),JSON['stringify']([_0x4ff865,_0x2f6305||'en',![],_0xd277('0x48')]),null,'generic']]]))};return rp(_0x2ac591)[_0xd277('0x31')](function(_0x4bb8d9){try{_0x359e7e=eval(_0x4bb8d9[_0xd277('0x49')](0x5))[0x0][0x2];}catch(_0x518441){throw new Error('parse\x20response\x20failed:\x0a'+_0x4bb8d9[_0xd277('0x25')]);}if(!_0x359e7e){if(_0x4ff865[_0xd277('0x4a')]>0xc8){throw new Error(_0xd277('0x4b'));}else{throw new Error(_0xd277('0x4c')+_0x2f6305+'\x22\x20might\x20not\x20exist');}}try{_0x359e7e=eval(_0x359e7e)[0x0];}catch(_0xf3aaa3){throw new Error(_0xd277('0x4d')+res[_0xd277('0x25')]);}const _0x2c3026=_0x359e7e;_0x24f255=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs['generate'](0x4)+_0xd277('0x3d'));fs['writeFileSync'](_0x24f255,_0x359e7e,{'encoding':_0xd277('0x30')});_0x5c3247=path[_0xd277('0x2b')](__dirname,'tmp',rs[_0xd277('0x2d')](0x4)+'.wav');return convertFile(_0x24f255,_0x5c3247);})[_0xd277('0x31')](function(){try{fs[_0xd277('0x21')](_0x24f255);fs[_0xd277('0x40')](_0x5c3247,'777');}catch(_0x28c3c1){logger[_0xd277('0x19')](_0x28c3c1);}logger[_0xd277('0x29')]('goggleTTS\x20path',_0x5c3247[_0xd277('0x33')]('.')[0x0]);return _0x5c3247[_0xd277('0x33')]('.')[0x0];});};exports[_0xd277('0x4e')]=function(_0x3a0454,_0x307502,_0x50e23d){return google['asr'](_0x3a0454,_0x307502,_0x50e23d)['then'](function(_0x256ad5){logger[_0xd277('0x29')](_0x256ad5['uri']);return rp(_0x256ad5);})[_0xd277('0x31')](function(_0x12ca34){var _0x132bfa='';var _0x4e6fe0=0x0;try{fs['unlink'](_0x3a0454);}catch(_0x9c3174){logger[_0xd277('0x19')](_0x9c3174);}if(_0x12ca34&&_0x12ca34[_0xd277('0x4f')]){_0x132bfa=_0x12ca34[_0xd277('0x4f')][_0xd277('0x50')](function(_0x30bbc2){return _0x30bbc2&&_0x30bbc2['alternatives'][0x0]&&_0x30bbc2['alternatives'][0x0][_0xd277('0x51')]?_0x30bbc2[_0xd277('0x52')][0x0][_0xd277('0x51')]:'';})[_0xd277('0x53')]('\x0a');_0x4e6fe0=_0x12ca34[_0xd277('0x4f')]['map'](function(_0x29e949){return _0x29e949&&_0x29e949[_0xd277('0x52')][0x0]&&_0x29e949[_0xd277('0x52')][0x0][_0xd277('0x54')]?_0x29e949['alternatives'][0x0][_0xd277('0x54')]:0x0;})['join']('\x0a');}logger[_0xd277('0x29')](_0xd277('0x55'),_0x132bfa);logger[_0xd277('0x29')]('googleASR\x20confidence',_0x4e6fe0);return{'transcript':_0x132bfa,'confidence':_0x4e6fe0};})[_0xd277('0x56')](function(_0x303fb6){logger[_0xd277('0x19')](_0xd277('0x57'),_0x303fb6[_0xd277('0x18')],_0x303fb6[_0xd277('0x58')],_0x303fb6['message']);});};exports[_0xd277('0x59')]=function(_0x41dd7c,_0x1b935d,_0x49ef19,_0x11a670){var _0x4b535c=apiai(_0x1b935d,{'language':_0x11a670||'en'});return _0x4b535c[_0xd277('0x5a')](_0x49ef19,{'sessionId':md5(_0x41dd7c)})[_0xd277('0x31')](function(_0x2cdc28){logger['info'](JSON[_0xd277('0x46')](_0x2cdc28));return{'source':_0x2cdc28[_0xd277('0x5b')]['source'],'resolvedQuery':_0x2cdc28[_0xd277('0x5b')][_0xd277('0x5c')],'action':_0x2cdc28['result'][_0xd277('0x5d')],'actionIncomplete':_0x2cdc28[_0xd277('0x5b')]['actionIncomplete'],'speech':_0x2cdc28['result'][_0xd277('0x5e')]['speech'],'score':_0x2cdc28[_0xd277('0x5b')][_0xd277('0x5f')],'statusCode':_0x2cdc28['status'][_0xd277('0x60')],'endConversation':_0x2cdc28[_0xd277('0x5b')][_0xd277('0x61')][_0xd277('0x62')]||![],'isFallbackIntent':_0x2cdc28['result']['metadata']['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0xeb842d,_0xeeab28,_0x90353c,_0x4a6e67,_0x248d7d,_0x470948){var _0x406b58=_0x4a6e67[_0xd277('0x63')](/\\n/g,'\x0a');var _0x152035={'credentials':{'private_key':_0x406b58,'client_email':_0x90353c}};var _0x4e68ed=new dialogflow['SessionsClient'](_0x152035);var _0x17b470=_0x4e68ed[_0xd277('0x64')](_0xeeab28,md5(_0xeb842d));var _0x26b938={'session':_0x17b470,'queryInput':{'text':{'text':_0x248d7d,'languageCode':_0x470948}}};return _0x4e68ed[_0xd277('0x65')](_0x26b938)[_0xd277('0x31')](function(_0x2736b1){if(_0x2736b1&&_0x2736b1['length']){logger[_0xd277('0x29')]('Dialogflow\x20V2\x20response:',JSON[_0xd277('0x46')](_0x2736b1));var _0x7babe=_0x2736b1[0x0];if(_0x7babe){var _0x4aea7a={'action':_0x7babe['queryResult'][_0xd277('0x5d')],'allRequiredParamsPresent':_0x7babe[_0xd277('0x66')]['allRequiredParamsPresent'],'endConversation':_0x7babe[_0xd277('0x66')][_0xd277('0x67')]&&_0x7babe[_0xd277('0x66')][_0xd277('0x67')][_0xd277('0x68')]?_0x7babe[_0xd277('0x66')][_0xd277('0x67')][_0xd277('0x68')][_0xd277('0x69')][_0xd277('0x6a')]:![],'fulfillmentText':_0x7babe[_0xd277('0x66')][_0xd277('0x6b')],'intentName':_0x7babe[_0xd277('0x66')][_0xd277('0x6c')][_0xd277('0x58')],'intentDisplayName':_0x7babe[_0xd277('0x66')]['intent']['displayName'],'isFallbackIntent':_0x7babe[_0xd277('0x66')][_0xd277('0x6c')][_0xd277('0x6d')],'languageCode':_0x7babe[_0xd277('0x66')][_0xd277('0x6e')],'queryText':_0x7babe[_0xd277('0x66')][_0xd277('0x6f')],'responseId':_0x7babe[_0xd277('0x70')],'score':_0x7babe[_0xd277('0x66')][_0xd277('0x71')],'speech':_0x7babe['queryResult'][_0xd277('0x6b')],'providerResponse':JSON[_0xd277('0x46')](_0x2736b1)};return _0x4aea7a;}}});};exports[_0xd277('0x72')]=function(_0x7e4f65,_0x9e3596,_0x4d6566,_0xa9013a){return tilde['asr'](_0x7e4f65,_0x9e3596,_0x4d6566,_0xa9013a)[_0xd277('0x31')](function(_0xf7d5b5){try{fs['unlink'](_0x7e4f65);}catch(_0x42f307){logger[_0xd277('0x19')](_0x42f307);}logger[_0xd277('0x29')](_0xd277('0x73'),_0xf7d5b5['transcript']);logger['info'](_0xd277('0x74'),_0xf7d5b5['confidence']);return _0xf7d5b5;});};exports[_0xd277('0x75')]=function(_0x245ca0,_0xf139b5,_0x356035,_0x4a1037,_0x4878be,_0x260c88){var _0xefb0f3=path['resolve'](__dirname,_0xd277('0x2c'),rs[_0xd277('0x2d')](0x4)+_0xd277('0x3d'));var _0x27e572;return aws[_0xd277('0x76')](_0x245ca0,_0xf139b5,_0x356035,_0x4a1037,_0x4878be,_0x260c88,_0xefb0f3)[_0xd277('0x31')](function(){_0x27e572=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs[_0xd277('0x2d')](0x4)+'.wav');return convertFile(_0xefb0f3,_0x27e572);})[_0xd277('0x31')](function(){try{fs[_0xd277('0x21')](_0xefb0f3);fs[_0xd277('0x40')](_0x27e572,'777');}catch(_0x287ba3){logger[_0xd277('0x19')](_0x287ba3);}return _0x27e572[_0xd277('0x33')]('.')[0x0];});};exports[_0xd277('0x77')]=function(_0x32bbff,_0x1c2867,_0x1f4ed3,_0x5c68a9,_0x2e619e,_0x4813e0){return aws['lex'](_0x32bbff,_0x1c2867,_0x1f4ed3,_0x5c68a9,_0x2e619e,_0x4813e0)[_0xd277('0x31')](function(_0x14693d){logger['info'](JSON[_0xd277('0x46')](_0x14693d));return _0x14693d;});};exports['ispeechTTS']=function(_0x28296e,_0x78bce2,_0x2eb87d,_0x46204e){var _0x547403=util[_0xd277('0x78')](_0xd277('0x79'),ISPEECH_API,_0x28296e,encodeURIComponent(_0x78bce2),_0x2eb87d,_0x46204e);var _0x3eb5c0=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs[_0xd277('0x2d')](0x4)+_0xd277('0x3d'));var _0x45825b;return downloadFile(_0x547403,_0x3eb5c0)[_0xd277('0x31')](function(){_0x45825b=path[_0xd277('0x2b')](__dirname,_0xd277('0x2c'),rs['generate'](0x4)+_0xd277('0x2e'));return convertFile(_0x3eb5c0,_0x45825b);})[_0xd277('0x31')](function(){try{fs[_0xd277('0x21')](_0x3eb5c0);fs[_0xd277('0x40')](_0x45825b,_0xd277('0x32'));}catch(_0x4668b6){logger['error'](_0x4668b6);}return _0x45825b[_0xd277('0x33')]('.')[0x0];});};exports[_0xd277('0x7a')]=function(_0x1c0344,_0x346131,_0xe7be3e,_0x439ce9){var _0x2db40e=util[_0xd277('0x78')](_0xd277('0x7b'),ISPEECH_API,_0x346131,_0xe7be3e,base64Encode(_0x1c0344),_0x439ce9?util[_0xd277('0x78')](_0xd277('0x7c'),encodeURIComponent(_0x439ce9)):_0xd277('0x7d'));return uploadFile(_0x2db40e)['then'](function(_0x359868){return querystring[_0xd277('0xb')](_0x359868);});};exports['sestekNDA']=function(_0x123adb,_0x57ea29){return sestek['nda'](_0x123adb,_0x57ea29)[_0xd277('0x31')](function(_0x3d3d4f){logger['info'](JSON['stringify'](_0x3d3d4f));var _0x499d38={'speech':_0x3d3d4f[_0xd277('0x7e')],'action':_0x3d3d4f[_0xd277('0x7f')]?_0x3d3d4f[_0xd277('0x7f')][_0xd277('0x80')]:undefined,'actiondata':_0x3d3d4f[_0xd277('0x7f')]?_0x3d3d4f[_0xd277('0x7f')][_0xd277('0x81')]:undefined};if(_0x3d3d4f[_0xd277('0x7f')]&&_0x3d3d4f[_0xd277('0x7f')]['AudioFromTts']){return base64Decode(_0x3d3d4f['channelData'][_0xd277('0x82')][_0xd277('0x83')],path[_0xd277('0x2b')](__dirname,'tmp',rs['generate'](0x4)+_0xd277('0x2e')))[_0xd277('0x31')](function(_0x5a41e4){_0x499d38[_0xd277('0x84')]=_0x5a41e4;return _0x499d38;});}return _0x499d38;});};exports[_0xd277('0x85')]=function(){return __dirname;}; \ No newline at end of file +var _0x751f=['POST','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','displayName','intent','isFallback','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','ispeechASR','model=%s','freeform=3','parse','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','https','md5','path','querystring','randomstring','google-tts-api','url','util','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','get','data','transcode','wav','error\x20convert','start','.wav','base64','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','input','voice','audioConfig','MP3','text:synthesize','resolve','tmp','.mp3','from','audioContent','writeFile','generate','googleCloudTTS\x20path','googleTTS','utf8'];(function(_0x4156e9,_0x139ecf){var _0x5a77b7=function(_0x4d2caf){while(--_0x4d2caf){_0x4156e9['push'](_0x4156e9['shift']());}};_0x5a77b7(++_0x139ecf);}(_0x751f,0xd1));var _0xf751=function(_0x2ef41c,_0x4e9052){_0x2ef41c=_0x2ef41c-0x0;var _0x413f4e=_0x751f[_0x2ef41c];return _0x413f4e;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xf751('0x0'));var https=require(_0xf751('0x1'));var md5=require(_0xf751('0x2'));var path=require(_0xf751('0x3'));var querystring=require(_0xf751('0x4'));var rp=require('request-promise');var rs=require(_0xf751('0x5'));var sox=require('sox');var tts=require(_0xf751('0x6'));var urlParse=require(_0xf751('0x7'))['parse'];var util=require(_0xf751('0x8'));var aws=require(_0xf751('0x9'));var google=require('./google');var sestek=require(_0xf751('0xa'));var tilde=require('./tilde');var logger=require(_0xf751('0xb'))(_0xf751('0xc'));var ISPEECH_API=_0xf751('0xd');function downloadFile(_0x5ee48b,_0x48925e){return new BPromise(function(_0x5a33c4,_0x5c80c7){var _0x497263=urlParse(_0x5ee48b);var _0xee664d=_0x497263['protocol']===_0xf751('0xe')?https:http;var _0x26e7ae={'host':_0x497263[_0xf751('0xf')],'path':_0x497263['path'],'headers':{'user-agent':_0xf751('0x10')}};_0xee664d['get'](_0x26e7ae,function(_0x5977cc){if(_0x5977cc[_0xf751('0x11')]!==0xc8){logger[_0xf751('0x12')]('request\x20to\x20'+_0x5ee48b+_0xf751('0x13')+_0x5977cc['statusCode']+'\x20('+_0x5977cc[_0xf751('0x14')]+')');_0x5c80c7(new Error(_0xf751('0x15')+_0x5ee48b+_0xf751('0x13')+_0x5977cc[_0xf751('0x11')]+'\x20('+_0x5977cc['statusMessage']+')'));return;}var _0x587fec=fs[_0xf751('0x16')](_0x48925e);_0x587fec['on']('finish',function(){logger[_0xf751('0x17')](_0xf751('0x18'));_0x587fec[_0xf751('0x19')](_0x5a33c4);});_0x587fec['on'](_0xf751('0x12'),function(_0x51a959){fs[_0xf751('0x1a')](_0x48925e);logger[_0xf751('0x12')](_0xf751('0x1b'),_0x51a959);_0x5c80c7(_0x51a959);});_0x5977cc[_0xf751('0x1c')](_0x587fec);})['on'](_0xf751('0x12'),function(_0x5d1961){logger[_0xf751('0x12')](_0x5d1961);_0x5c80c7(_0x5d1961);})[_0xf751('0x1d')]();});}function uploadFile(_0x1865c4){return new BPromise(function(_0x59ffd1,_0xfc7362){var _0x367c73=urlParse(_0x1865c4);var _0x56ae0d=_0x367c73[_0xf751('0x1e')]===_0xf751('0xe')?https:http;var _0xf284f6={'host':_0x367c73[_0xf751('0xf')],'path':_0x367c73[_0xf751('0x3')],'headers':{'user-agent':_0xf751('0x10')}};_0x56ae0d[_0xf751('0x1f')](_0xf284f6,function(_0x5819da){if(_0x5819da[_0xf751('0x11')]!==0xc8){_0xfc7362(new Error(_0xf751('0x15')+_0x1865c4+'\x20failed,\x20status\x20code\x20=\x20'+_0x5819da['statusCode']+'\x20('+_0x5819da[_0xf751('0x14')]+')'));return;}var _0x24a10a='';_0x5819da['on'](_0xf751('0x20'),function(_0x15ea01){_0x24a10a+=_0x15ea01;});_0x5819da['on'](_0xf751('0x1d'),function(){_0x59ffd1(_0x24a10a);});})['on'](_0xf751('0x12'),function(_0x3e9a70){_0xfc7362(_0x3e9a70);})[_0xf751('0x1d')]();});}function convertFile(_0xdb66a9,_0x2a149f){return new BPromise(function(_0x46e8ca,_0x570e11){var _0x47b03a=sox[_0xf751('0x21')](_0xdb66a9,_0x2a149f,{'sampleRate':0x1f40,'format':_0xf751('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x47b03a['on']('error',function(_0x2e1e54){logger[_0xf751('0x12')](_0xf751('0x23'),_0x2e1e54);_0x570e11(_0x2e1e54);});_0x47b03a['on'](_0xf751('0x1d'),function(){logger[_0xf751('0x17')]('finish\x20to\x20convert');_0x46e8ca();});_0x47b03a[_0xf751('0x24')]();});}function base64Decode(_0xc42efc,_0x40fbda){var _0x562907=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xf751('0x25'));fs['writeFileSync'](_0x562907,_0xc42efc,_0xf751('0x26'));return convertFile(_0x562907,_0x40fbda)[_0xf751('0x27')](function(){try{fs['unlink'](_0x562907);fs[_0xf751('0x28')](_0x40fbda,_0xf751('0x29'));}catch(_0x5c4209){logger['error'](_0x5c4209);}return _0x40fbda[_0xf751('0x2a')]('.')[0x0];});}function base64Encode(_0x263308){var _0x2bdc4e=fs[_0xf751('0x2b')](_0x263308);return new Buffer(_0x2bdc4e)['toString'](_0xf751('0x26'));}exports[_0xf751('0x2c')]=function(_0x4f9f1f,_0x3cd6e7,_0x3ff88c,_0x5bdb11,_0x3fb5eb,_0x1a5c16){var _0x5d8488,_0xb81c1e;var _0x2f2622=_0xf751('0x2d');var _0x35b18e='?key='+_0x4f9f1f;var _0x383db3={};if(_0x3cd6e7==='ssml'){_0x383db3[_0xf751('0x2e')]={'ssml':_0x3ff88c};}else{_0x383db3[_0xf751('0x2e')]={'text':_0x3ff88c};};_0x383db3[_0xf751('0x2f')]={'languageCode':_0x5bdb11,'ssmlGender':_0x3fb5eb};_0x383db3[_0xf751('0x30')]={'audioEncoding':_0xf751('0x31'),'sampleRateHertz':0x1f40};var _0x166379={'url':_0x2f2622+_0xf751('0x32')+_0x35b18e,'method':'POST','json':!![],'body':_0x383db3};return rp(_0x166379)[_0xf751('0x27')](function(_0x2fa655){return new BPromise(function(_0x4ccab7,_0x1a533e){_0x5d8488=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs['generate'](0x4)+_0xf751('0x35'));var _0x2a5993=Buffer[_0xf751('0x36')](_0x2fa655[_0xf751('0x37')],_0xf751('0x26'));return fs[_0xf751('0x38')](_0x5d8488,_0x2a5993,function(_0x56adc6){_0x1a533e(_0x56adc6);},function(_0x24293c){fs[_0xf751('0x28')](_0x5d8488,_0xf751('0x29'));_0x4ccab7(_0x24293c);});});})[_0xf751('0x27')](function(_0x1c5454){_0xb81c1e=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+'.wav');return convertFile(_0x5d8488,_0xb81c1e);})[_0xf751('0x27')](function(){try{fs[_0xf751('0x1a')](_0x5d8488);fs[_0xf751('0x28')](_0xb81c1e,_0xf751('0x29'));}catch(_0x41fd35){logger['error'](_0x41fd35);}logger['info'](_0xf751('0x3a'),_0xb81c1e[_0xf751('0x2a')]('.')[0x0]);return _0xb81c1e[_0xf751('0x2a')]('.')[0x0];});};exports[_0xf751('0x3b')]=function(_0x54805a,_0x151c25){var _0x1c9cae='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x1015b4,_0x1ab273;var _0x5f1a55;var _0x324e5d={'encoding':_0xf751('0x3c'),'method':_0xf751('0x3d'),'timeout':0x2710,'url':_0x1c9cae,'headers':{'Content-Type':_0xf751('0x3e')},'body':_0xf751('0x3f')+encodeURIComponent(JSON[_0xf751('0x40')]([[['jQ1olc',JSON[_0xf751('0x40')]([_0x54805a,_0x151c25||'en',![],'null']),null,_0xf751('0x41')]]]))};return rp(_0x324e5d)[_0xf751('0x27')](function(_0x43544c){try{_0x5f1a55=eval(_0x43544c[_0xf751('0x42')](0x5))[0x0][0x2];}catch(_0x49dfaf){throw new Error(_0xf751('0x43')+_0x43544c[_0xf751('0x20')]);}if(!_0x5f1a55){if(_0x54805a[_0xf751('0x44')]>0xc8){throw new Error(_0xf751('0x45'));}else{throw new Error(_0xf751('0x46')+_0x151c25+_0xf751('0x47'));}}try{_0x5f1a55=eval(_0x5f1a55)[0x0];}catch(_0x539e04){throw new Error(_0xf751('0x43')+res[_0xf751('0x20')]);}const _0x378e53=_0x5f1a55;_0x1015b4=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+_0xf751('0x35'));fs[_0xf751('0x48')](_0x1015b4,_0x5f1a55,{'encoding':_0xf751('0x26')});_0x1ab273=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+_0xf751('0x25'));return convertFile(_0x1015b4,_0x1ab273);})['then'](function(){try{fs[_0xf751('0x1a')](_0x1015b4);fs['chmodSync'](_0x1ab273,_0xf751('0x29'));}catch(_0x139a75){logger['error'](_0x139a75);}logger[_0xf751('0x17')](_0xf751('0x49'),_0x1ab273[_0xf751('0x2a')]('.')[0x0]);return _0x1ab273['split']('.')[0x0];});};exports[_0xf751('0x4a')]=function(_0x28237a,_0xb386f1,_0x524e11){return google[_0xf751('0x4b')](_0x28237a,_0xb386f1,_0x524e11)[_0xf751('0x27')](function(_0x1ae3ba){logger[_0xf751('0x17')](_0x1ae3ba[_0xf751('0x4c')]);return rp(_0x1ae3ba);})['then'](function(_0x36b690){var _0x2ec9d4='';var _0x1b8be0=0x0;try{fs[_0xf751('0x1a')](_0x28237a);}catch(_0x27225c){logger[_0xf751('0x12')](_0x27225c);}if(_0x36b690&&_0x36b690[_0xf751('0x4d')]){_0x2ec9d4=_0x36b690[_0xf751('0x4d')][_0xf751('0x4e')](function(_0x49b985){return _0x49b985&&_0x49b985[_0xf751('0x4f')][0x0]&&_0x49b985[_0xf751('0x4f')][0x0][_0xf751('0x50')]?_0x49b985['alternatives'][0x0][_0xf751('0x50')]:'';})['join']('\x0a');_0x1b8be0=_0x36b690[_0xf751('0x4d')][_0xf751('0x4e')](function(_0x4641aa){return _0x4641aa&&_0x4641aa['alternatives'][0x0]&&_0x4641aa[_0xf751('0x4f')][0x0][_0xf751('0x51')]?_0x4641aa[_0xf751('0x4f')][0x0][_0xf751('0x51')]:0x0;})[_0xf751('0x52')]('\x0a');}logger[_0xf751('0x17')]('googleASR\x20transcription',_0x2ec9d4);logger[_0xf751('0x17')](_0xf751('0x53'),_0x1b8be0);return{'transcript':_0x2ec9d4,'confidence':_0x1b8be0};})[_0xf751('0x54')](function(_0x2f84e6){logger[_0xf751('0x12')](_0xf751('0x55'),_0x2f84e6['statusCode'],_0x2f84e6[_0xf751('0x56')],_0x2f84e6[_0xf751('0x57')]);});};exports[_0xf751('0x58')]=function(_0x52b5f4,_0x1303cf,_0xa1d20a,_0x2b13ab){var _0x1adca5=apiai(_0x1303cf,{'language':_0x2b13ab||'en'});return _0x1adca5[_0xf751('0x59')](_0xa1d20a,{'sessionId':md5(_0x52b5f4)})[_0xf751('0x27')](function(_0x29778e){logger[_0xf751('0x17')](JSON[_0xf751('0x40')](_0x29778e));return{'source':_0x29778e[_0xf751('0x5a')][_0xf751('0x5b')],'resolvedQuery':_0x29778e['result'][_0xf751('0x5c')],'action':_0x29778e['result'][_0xf751('0x5d')],'actionIncomplete':_0x29778e[_0xf751('0x5a')][_0xf751('0x5e')],'speech':_0x29778e['result'][_0xf751('0x5f')][_0xf751('0x60')],'score':_0x29778e[_0xf751('0x5a')]['score'],'statusCode':_0x29778e[_0xf751('0x61')]['code'],'endConversation':_0x29778e[_0xf751('0x5a')][_0xf751('0x62')][_0xf751('0x63')]||![],'isFallbackIntent':_0x29778e['result']['metadata']['isFallbackIntent']};});};exports[_0xf751('0x64')]=function(_0x9491be,_0xf65de7,_0x2b4ba5,_0x30be3b,_0xcb5b26,_0x2998ea){var _0x442018=_0x30be3b[_0xf751('0x65')](/\\n/g,'\x0a');var _0x142c89={'credentials':{'private_key':_0x442018,'client_email':_0x2b4ba5}};var _0x8613e5=new dialogflow[(_0xf751('0x66'))](_0x142c89);var _0x3d28d7=_0x8613e5[_0xf751('0x67')](_0xf65de7,md5(_0x9491be));var _0x422170={'session':_0x3d28d7,'queryInput':{'text':{'text':_0xcb5b26,'languageCode':_0x2998ea}}};return _0x8613e5['detectIntent'](_0x422170)[_0xf751('0x27')](function(_0x24d38d){if(_0x24d38d&&_0x24d38d['length']){logger[_0xf751('0x17')](_0xf751('0x68'),JSON[_0xf751('0x40')](_0x24d38d));var _0x56cb91=_0x24d38d[0x0];if(_0x56cb91){var _0x5a5113={'action':_0x56cb91[_0xf751('0x69')]['action'],'allRequiredParamsPresent':_0x56cb91[_0xf751('0x69')][_0xf751('0x6a')],'endConversation':_0x56cb91['queryResult'][_0xf751('0x6b')]&&_0x56cb91[_0xf751('0x69')][_0xf751('0x6b')][_0xf751('0x6c')]?_0x56cb91[_0xf751('0x69')][_0xf751('0x6b')][_0xf751('0x6c')][_0xf751('0x6d')]['boolValue']:![],'fulfillmentText':_0x56cb91[_0xf751('0x69')][_0xf751('0x6e')],'intentName':_0x56cb91[_0xf751('0x69')]['intent']['name'],'intentDisplayName':_0x56cb91[_0xf751('0x69')]['intent'][_0xf751('0x6f')],'isFallbackIntent':_0x56cb91[_0xf751('0x69')][_0xf751('0x70')][_0xf751('0x71')],'languageCode':_0x56cb91[_0xf751('0x69')]['languageCode'],'queryText':_0x56cb91[_0xf751('0x69')][_0xf751('0x72')],'responseId':_0x56cb91['responseId'],'score':_0x56cb91['queryResult'][_0xf751('0x73')],'speech':_0x56cb91[_0xf751('0x69')]['fulfillmentText'],'providerResponse':JSON[_0xf751('0x40')](_0x24d38d)};return _0x5a5113;}}});};exports[_0xf751('0x74')]=function(_0x434829,_0x51da01,_0x4c1478,_0xb6139){return tilde['asr'](_0x434829,_0x51da01,_0x4c1478,_0xb6139)['then'](function(_0x15e3ba){try{fs[_0xf751('0x1a')](_0x434829);}catch(_0x52237f){logger[_0xf751('0x12')](_0x52237f);}logger['info']('Tilde\x20ASR\x20transcription',_0x15e3ba[_0xf751('0x50')]);logger[_0xf751('0x17')](_0xf751('0x75'),_0x15e3ba[_0xf751('0x51')]);return _0x15e3ba;});};exports[_0xf751('0x76')]=function(_0xdffa3d,_0x3797e6,_0x3717b8,_0x23eeb5,_0x3d4131,_0x1d799f){var _0xa0a7fc=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+'.mp3');var _0x3c796e;return aws[_0xf751('0x77')](_0xdffa3d,_0x3797e6,_0x3717b8,_0x23eeb5,_0x3d4131,_0x1d799f,_0xa0a7fc)['then'](function(){_0x3c796e=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+_0xf751('0x25'));return convertFile(_0xa0a7fc,_0x3c796e);})[_0xf751('0x27')](function(){try{fs[_0xf751('0x1a')](_0xa0a7fc);fs[_0xf751('0x28')](_0x3c796e,_0xf751('0x29'));}catch(_0x557009){logger[_0xf751('0x12')](_0x557009);}return _0x3c796e['split']('.')[0x0];});};exports[_0xf751('0x78')]=function(_0x2e4f94,_0x133a23,_0x5a3b42,_0x5c0db4,_0x5079af,_0x5c204e){return aws['lex'](_0x2e4f94,_0x133a23,_0x5a3b42,_0x5c0db4,_0x5079af,_0x5c204e)[_0xf751('0x27')](function(_0x2fa7fa){logger['info'](JSON[_0xf751('0x40')](_0x2fa7fa));return _0x2fa7fa;});};exports[_0xf751('0x79')]=function(_0x304937,_0x5aea53,_0xdae189,_0x1e0fd8){var _0xcf22f1=util[_0xf751('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x304937,encodeURIComponent(_0x5aea53),_0xdae189,_0x1e0fd8);var _0x19eb7f=path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs['generate'](0x4)+_0xf751('0x35'));var _0x4d093f;return downloadFile(_0xcf22f1,_0x19eb7f)[_0xf751('0x27')](function(){_0x4d093f=path['resolve'](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+_0xf751('0x25'));return convertFile(_0x19eb7f,_0x4d093f);})[_0xf751('0x27')](function(){try{fs[_0xf751('0x1a')](_0x19eb7f);fs[_0xf751('0x28')](_0x4d093f,'777');}catch(_0x4ec93d){logger[_0xf751('0x12')](_0x4ec93d);}return _0x4d093f[_0xf751('0x2a')]('.')[0x0];});};exports[_0xf751('0x7b')]=function(_0x21a51b,_0x12b633,_0x303ec0,_0xc33b6f){var _0x13e1a2=util[_0xf751('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x12b633,_0x303ec0,base64Encode(_0x21a51b),_0xc33b6f?util[_0xf751('0x7a')](_0xf751('0x7c'),encodeURIComponent(_0xc33b6f)):_0xf751('0x7d'));return uploadFile(_0x13e1a2)[_0xf751('0x27')](function(_0x4fc0f3){return querystring[_0xf751('0x7e')](_0x4fc0f3);});};exports['sestekNDA']=function(_0x3d93b5,_0x2cc0b5){return sestek['nda'](_0x3d93b5,_0x2cc0b5)[_0xf751('0x27')](function(_0x50072b){logger[_0xf751('0x17')](JSON[_0xf751('0x40')](_0x50072b));var _0x5431ac={'speech':_0x50072b[_0xf751('0x7f')],'action':_0x50072b[_0xf751('0x80')]?_0x50072b['channelData'][_0xf751('0x81')]:undefined,'actiondata':_0x50072b['channelData']?_0x50072b[_0xf751('0x80')][_0xf751('0x82')]:undefined};if(_0x50072b[_0xf751('0x80')]&&_0x50072b[_0xf751('0x80')][_0xf751('0x83')]){return base64Decode(_0x50072b['channelData'][_0xf751('0x83')][_0xf751('0x84')],path[_0xf751('0x33')](__dirname,_0xf751('0x34'),rs[_0xf751('0x39')](0x4)+_0xf751('0x25')))[_0xf751('0x27')](function(_0x2cd671){_0x5431ac[_0xf751('0x85')]=_0x2cd671;return _0x5431ac;});}return _0x5431ac;});};exports[_0xf751('0x86')]=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 58cb98c..e37d93b 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 _0xd4ee=['exports','./nda'];(function(_0x108327,_0x38833c){var _0x3d5df9=function(_0x540e5b){while(--_0x540e5b){_0x108327['push'](_0x108327['shift']());}};_0x3d5df9(++_0x38833c);}(_0xd4ee,0xaf));var _0xed4e=function(_0x39fc40,_0x1319e8){_0x39fc40=_0x39fc40-0x0;var _0x329605=_0xd4ee[_0x39fc40];return _0x329605;};var nda=require(_0xed4e('0x0'));module[_0xed4e('0x1')]={'nda':nda}; \ No newline at end of file +var _0x4644=['./nda','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4644,0xde));var _0x4464=function(_0x56a37c,_0x749e8e){_0x56a37c=_0x56a37c-0x0;var _0x5afdee=_0x4644[_0x56a37c];return _0x5afdee;};var nda=require(_0x4464('0x0'));module[_0x4464('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 f37cbdf..f5c4d6f 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 _0x50c1=['message','Nda','uniqueid','callerid','dnid','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x5d5ff9,_0x5c4997){var _0x5dc6d6=function(_0x19aebd){while(--_0x19aebd){_0x5d5ff9['push'](_0x5d5ff9['shift']());}};_0x5dc6d6(++_0x5c4997);}(_0x50c1,0x1b6));var _0x150c=function(_0x27f5c7,_0x323649){_0x27f5c7=_0x27f5c7-0x0;var _0x5844de=_0x50c1[_0x27f5c7];return _0x5844de;};'use strict';var rp=require(_0x150c('0x0'));var url=require('url');var logger=require(_0x150c('0x1'))('agi');module[_0x150c('0x2')]=function(_0x786960,_0x4fdcdf){var _0x11216a={'method':_0x150c('0x3'),'uri':url[_0x150c('0x4')](_0x4fdcdf[_0x150c('0x5')],'/token'),'form':{'grant_type':_0x150c('0x6'),'username':_0x4fdcdf[_0x150c('0x7')],'password':_0x4fdcdf['password']},'json':!![]};return rp(_0x11216a)[_0x150c('0x8')](function(_0x19abd2){var _0x316817={'method':_0x150c('0x3'),'uri':url['resolve'](_0x4fdcdf[_0x150c('0x9')],_0x150c('0xa')),'body':{'type':_0x4fdcdf[_0x150c('0xb')]||_0x150c('0xc'),'channelId':_0x150c('0xd'),'conversation':{'id':_0x786960[_0x150c('0xe')]},'from':{'id':_0x786960[_0x150c('0xf')],'name':_0x786960['calleridname']},'recipient':{'id':_0x786960[_0x150c('0x10')],'name':_0x786960['extension']},'text':_0x4fdcdf['text'],'channelData':{}},'headers':{'Authorization':_0x150c('0x11')+_0x19abd2[_0x150c('0x12')]},'json':!![]};if(_0x4fdcdf[_0x150c('0x13')]){_0x316817[_0x150c('0x14')][_0x150c('0x15')][_0x150c('0x16')]=_0x4fdcdf[_0x150c('0x13')];}if(_0x4fdcdf[_0x150c('0x17')]=='1'){_0x316817[_0x150c('0x14')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x4fdcdf[_0x150c('0x18')]){_0x316817[_0x150c('0x14')][_0x150c('0x15')][_0x150c('0x19')]=_0x4fdcdf[_0x150c('0x18')];if(_0x4fdcdf[_0x150c('0x1a')]){_0x316817['body'][_0x150c('0x15')][_0x150c('0x1b')]=_0x4fdcdf['custom_action_data'];}}logger[_0x150c('0x1c')](JSON[_0x150c('0x1d')](_0x316817));return rp(_0x316817);});}; \ No newline at end of file +var _0x7846=['../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url'];(function(_0x1bd7e5,_0x24b050){var _0x2d0137=function(_0x509e8e){while(--_0x509e8e){_0x1bd7e5['push'](_0x1bd7e5['shift']());}};_0x2d0137(++_0x24b050);}(_0x7846,0xf4));var _0x6784=function(_0x4ccf7f,_0x161ffd){_0x4ccf7f=_0x4ccf7f-0x0;var _0x1953f0=_0x7846[_0x4ccf7f];return _0x1953f0;};'use strict';var rp=require('request-promise');var url=require(_0x6784('0x0'));var logger=require(_0x6784('0x1'))(_0x6784('0x2'));module[_0x6784('0x3')]=function(_0x3c868d,_0x7653ef){var _0x479b0a={'method':_0x6784('0x4'),'uri':url[_0x6784('0x5')](_0x7653ef[_0x6784('0x6')],_0x6784('0x7')),'form':{'grant_type':_0x6784('0x8'),'username':_0x7653ef[_0x6784('0x9')],'password':_0x7653ef[_0x6784('0x8')]},'json':!![]};return rp(_0x479b0a)['then'](function(_0x560e3f){var _0x289ae9={'method':_0x6784('0x4'),'uri':url[_0x6784('0x5')](_0x7653ef[_0x6784('0xa')],_0x6784('0xb')),'body':{'type':_0x7653ef[_0x6784('0xc')]||_0x6784('0xd'),'channelId':_0x6784('0xe'),'conversation':{'id':_0x3c868d[_0x6784('0xf')]},'from':{'id':_0x3c868d[_0x6784('0x10')],'name':_0x3c868d[_0x6784('0x11')]},'recipient':{'id':_0x3c868d[_0x6784('0x12')],'name':_0x3c868d[_0x6784('0x13')]},'text':_0x7653ef[_0x6784('0x14')],'channelData':{}},'headers':{'Authorization':_0x6784('0x15')+_0x560e3f[_0x6784('0x16')]},'json':!![]};if(_0x7653ef['project']){_0x289ae9[_0x6784('0x17')][_0x6784('0x18')][_0x6784('0x19')]=_0x7653ef[_0x6784('0x1a')];}if(_0x7653ef['ndagenerate_audio']=='1'){_0x289ae9[_0x6784('0x17')][_0x6784('0x18')][_0x6784('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6784('0x1c')};}if(_0x7653ef[_0x6784('0x1d')]){_0x289ae9[_0x6784('0x17')][_0x6784('0x18')][_0x6784('0x1e')]=_0x7653ef[_0x6784('0x1d')];if(_0x7653ef[_0x6784('0x1f')]){_0x289ae9[_0x6784('0x17')]['channelData'][_0x6784('0x20')]=_0x7653ef[_0x6784('0x1f')];}}logger[_0x6784('0x21')](JSON[_0x6784('0x22')](_0x289ae9));return rp(_0x289ae9);});}; \ 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 f8107f8..c21040d 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 _0x0b01=['./lib/api','exports'];(function(_0x19a81e,_0x47df69){var _0x1c5d4e=function(_0x1680a5){while(--_0x1680a5){_0x19a81e['push'](_0x19a81e['shift']());}};_0x1c5d4e(++_0x47df69);}(_0x0b01,0x158));var _0x10b0=function(_0x37736a,_0x272110){_0x37736a=_0x37736a-0x0;var _0x8add8c=_0x0b01[_0x37736a];return _0x8add8c;};'use strict';var asr=require(_0x10b0('0x0'));module[_0x10b0('0x1')]=function(_0x7cfe06,_0x503590,_0x40b980,_0x5d6109){return asr(_0x7cfe06,_0x503590,_0x40b980,_0x5d6109);}; \ No newline at end of file +var _0x262a=['./lib/api','exports'];(function(_0x57a782,_0x384f01){var _0x4b9534=function(_0x931e6c){while(--_0x931e6c){_0x57a782['push'](_0x57a782['shift']());}};_0x4b9534(++_0x384f01);}(_0x262a,0x178));var _0xa262=function(_0x41dfac,_0x278319){_0x41dfac=_0x41dfac-0x0;var _0x12900b=_0x262a[_0x41dfac];return _0x12900b;};'use strict';var asr=require(_0xa262('0x0'));module[_0xa262('0x1')]=function(_0x406de8,_0xb19d4b,_0x2cebe9,_0x35ec12){return asr(_0x406de8,_0xb19d4b,_0x2cebe9,_0x35ec12);}; \ 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 0f8d9bf..698b6a6 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 _0x309b=['close','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','lodash','moment','crypto','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','update','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data'];(function(_0x13e2b5,_0x17f086){var _0x470e5c=function(_0x296607){while(--_0x296607){_0x13e2b5['push'](_0x13e2b5['shift']());}};_0x470e5c(++_0x17f086);}(_0x309b,0x120));var _0xb309=function(_0x30fbbb,_0xcd31cf){_0x30fbbb=_0x30fbbb-0x0;var _0x41f1b7=_0x309b[_0x30fbbb];return _0x41f1b7;};'use strict';var BPromise=require('bluebird');var _=require(_0xb309('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb309('0x1'));var crypto=require(_0xb309('0x2'));var logger=require('../../../../../../config/logger')(_0xb309('0x3'));module[_0xb309('0x4')]=function(_0x10b217,_0x571c53,_0x6c7a88,_0x7963cf){return new BPromise(function(_0x2b6764,_0x5e23a8){logger[_0xb309('0x5')](_0xb309('0x6'),_0x7963cf||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x3440a7=new WebSocket(_0x7963cf||_0xb309('0x7'),{'perMessageDeflate':![]});var _0x16141f='';var _0xd87e0a='0';var _0x1ac670='1';var _0x1ebab4=_0xb309('0x8');function _0x4fb6d9(_0x264e6e){var _0x215d68=crypto[_0xb309('0x9')]('sha1');_0x215d68[_0xb309('0xa')](_0x264e6e);return _0x215d68['digest']('hex');}function _0x2c11a6(){try{logger['info'](_0xb309('0xb'));var _0x5caa9d=moment()[_0xb309('0xc')]();var _0x142bbd=_0x4fb6d9(_0x5caa9d+_0x571c53+_0x6c7a88);_0x3440a7[_0xb309('0xd')](JSON[_0xb309('0xe')]({'appID':_0x571c53,'timestamp':_0x5caa9d,'appKey':_0x142bbd}));var _0x13a16f=fs['createReadStream'](_0x10b217);_0x13a16f['on'](_0xb309('0xf'),function(_0x118da2){_0x3440a7[_0xb309('0xd')](_0x118da2);});_0x13a16f['on'](_0xb309('0x10'),function(){_0x3440a7[_0xb309('0xd')](_0xb309('0x11'));});}catch(_0x5d63cc){logger[_0xb309('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0xb309('0xe')](_0x5d63cc));_0x3440a7[_0xb309('0x13')]();}}function _0x399d70(_0x4f4c4e){try{if(_0x4f4c4e){var _0x482d3c=JSON[_0xb309('0x14')](_0x4f4c4e);switch(_0x482d3c[_0xb309('0x15')]){case 0x0:if(_0x482d3c[_0xb309('0x16')]){if(_0x482d3c[_0xb309('0x16')][_0xb309('0x17')]){logger[_0xb309('0x5')](_0xb309('0x18'),JSON['stringify'](_0x482d3c[_0xb309('0x16')][_0xb309('0x19')]));_0x16141f=_0x482d3c['result'][_0xb309('0x19')][0x0][_0xb309('0x1a')];_0xd87e0a=_0x482d3c[_0xb309('0x16')][_0xb309('0x19')][0x0][_0xb309('0x1b')];_0x1ac670='0';_0x1ebab4=_0xb309('0x1c');_0x3440a7[_0xb309('0x13')]();}}break;case 0x1:logger[_0xb309('0x5')](_0xb309('0x8'));_0x1ac670='1';_0x1ebab4=_0xb309('0x8');break;case 0x2:logger[_0xb309('0x5')](_0xb309('0x1d'));_0x1ac670='2';_0x1ebab4='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xb309('0x5')](_0xb309('0x1e'));_0x1ac670='9';_0x1ebab4=_0xb309('0x1e');break;case 0xa:logger[_0xb309('0x5')](_0xb309('0x1f'));_0x1ac670='10';_0x1ebab4=_0xb309('0x1f');break;case 0xb:logger[_0xb309('0x5')](_0xb309('0x20'));_0x1ac670='11';_0x1ebab4=_0xb309('0x20');}}}catch(_0x25e321){logger[_0xb309('0x12')](_0xb309('0x21'),JSON[_0xb309('0xe')](_0x25e321));_0x3440a7[_0xb309('0x13')]();}}function _0x46f347(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x2b6764({'transcript':_0x16141f,'confidence':_0xd87e0a,'status':_0x1ac670,'status_message':_0x1ebab4});}function _0x3352e0(_0x59655f){logger[_0xb309('0x12')](_0xb309('0x22'));if(!_[_0xb309('0x23')](_0x59655f)){logger['error'](_[_0xb309('0x24')](_0x59655f)?JSON[_0xb309('0xe')](_0x59655f):_0x59655f);}}_0x3440a7['on']('open',_0x2c11a6);_0x3440a7['on'](_0xb309('0x25'),_0x399d70);_0x3440a7['on'](_0xb309('0x10'),_0x46f347);_0x3440a7['on'](_0xb309('0x12'),_0x3352e0);});}; \ No newline at end of file +var _0x4d85=['unix','send','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket'];(function(_0x31fb49,_0x3102b1){var _0xb92c74=function(_0x29201d){while(--_0x29201d){_0x31fb49['push'](_0x31fb49['shift']());}};_0xb92c74(++_0x3102b1);}(_0x4d85,0x1dd));var _0x54d8=function(_0x3a17b5,_0x350d1e){_0x3a17b5=_0x3a17b5-0x0;var _0x2f5421=_0x4d85[_0x3a17b5];return _0x2f5421;};'use strict';var BPromise=require(_0x54d8('0x0'));var _=require(_0x54d8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x54d8('0x2'));var crypto=require(_0x54d8('0x3'));var logger=require(_0x54d8('0x4'))(_0x54d8('0x5'));module['exports']=function(_0xa2e1e3,_0x28e9f5,_0x536d8f,_0x4c3bbd){return new BPromise(function(_0x11eb2f,_0x258bda){logger['info']('Tilde\x20URI',_0x4c3bbd||_0x54d8('0x6'));var _0x588724=new WebSocket(_0x4c3bbd||_0x54d8('0x6'),{'perMessageDeflate':![]});var _0x102efb='';var _0x5e8502='0';var _0x3f94cf='1';var _0x2daf54=_0x54d8('0x7');function _0x367c93(_0x38ef8b){var _0x390c4e=crypto[_0x54d8('0x8')](_0x54d8('0x9'));_0x390c4e[_0x54d8('0xa')](_0x38ef8b);return _0x390c4e[_0x54d8('0xb')](_0x54d8('0xc'));}function _0x3756cd(){try{logger[_0x54d8('0xd')](_0x54d8('0xe'));var _0x3d2c56=moment()[_0x54d8('0xf')]();var _0x5cdd54=_0x367c93(_0x3d2c56+_0x28e9f5+_0x536d8f);_0x588724[_0x54d8('0x10')](JSON['stringify']({'appID':_0x28e9f5,'timestamp':_0x3d2c56,'appKey':_0x5cdd54}));var _0x46f9ee=fs[_0x54d8('0x11')](_0xa2e1e3);_0x46f9ee['on'](_0x54d8('0x12'),function(_0x55bfc9){_0x588724[_0x54d8('0x10')](_0x55bfc9);});_0x46f9ee['on'](_0x54d8('0x13'),function(){_0x588724[_0x54d8('0x10')]('EOS');});}catch(_0x64fa00){logger[_0x54d8('0x14')](_0x54d8('0x15'),JSON['stringify'](_0x64fa00));_0x588724[_0x54d8('0x16')]();}}function _0x121b79(_0x967343){try{if(_0x967343){var _0x4cfe4b=JSON['parse'](_0x967343);switch(_0x4cfe4b['status']){case 0x0:if(_0x4cfe4b[_0x54d8('0x17')]){if(_0x4cfe4b['result'][_0x54d8('0x18')]){logger['info'](_0x54d8('0x19'),JSON[_0x54d8('0x1a')](_0x4cfe4b[_0x54d8('0x17')][_0x54d8('0x1b')]));_0x102efb=_0x4cfe4b[_0x54d8('0x17')]['hypotheses'][0x0][_0x54d8('0x1c')];_0x5e8502=_0x4cfe4b[_0x54d8('0x17')][_0x54d8('0x1b')][0x0][_0x54d8('0x1d')];_0x3f94cf='0';_0x2daf54=_0x54d8('0x1e');_0x588724['terminate']();}}break;case 0x1:logger[_0x54d8('0xd')](_0x54d8('0x7'));_0x3f94cf='1';_0x2daf54=_0x54d8('0x7');break;case 0x2:logger[_0x54d8('0xd')](_0x54d8('0x1f'));_0x3f94cf='2';_0x2daf54='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x54d8('0xd')](_0x54d8('0x20'));_0x3f94cf='9';_0x2daf54=_0x54d8('0x20');break;case 0xa:logger['info'](_0x54d8('0x21'));_0x3f94cf='10';_0x2daf54='Authentication\x20failed.';break;case 0xb:logger['info'](_0x54d8('0x22'));_0x3f94cf='11';_0x2daf54='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1a0b0e){logger[_0x54d8('0x14')](_0x54d8('0x23'),JSON['stringify'](_0x1a0b0e));_0x588724['terminate']();}}function _0x4dc05f(){logger[_0x54d8('0xd')](_0x54d8('0x24'));_0x11eb2f({'transcript':_0x102efb,'confidence':_0x5e8502,'status':_0x3f94cf,'status_message':_0x2daf54});}function _0x20e44e(_0x500b26){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x54d8('0x25')](_0x500b26)){logger[_0x54d8('0x14')](_[_0x54d8('0x26')](_0x500b26)?JSON[_0x54d8('0x1a')](_0x500b26):_0x500b26);}}_0x588724['on'](_0x54d8('0x27'),_0x3756cd);_0x588724['on'](_0x54d8('0x28'),_0x121b79);_0x588724['on'](_0x54d8('0x13'),_0x4dc05f);_0x588724['on']('error',_0x20e44e);});}; \ 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 cbef06b..c138c58 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 _0x9721=['./asr','exports'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x9721,0x154));var _0x1972=function(_0x4ee263,_0x371ae6){_0x4ee263=_0x4ee263-0x0;var _0x2310a2=_0x9721[_0x4ee263];return _0x2310a2;};var asr=require(_0x1972('0x0'));module[_0x1972('0x1')]={'asr':asr}; \ No newline at end of file +var _0x106c=['./asr','exports'];(function(_0x24d282,_0x1a2b5a){var _0x1b70b1=function(_0x44cb5e){while(--_0x44cb5e){_0x24d282['push'](_0x24d282['shift']());}};_0x1b70b1(++_0x1a2b5a);}(_0x106c,0x17e));var _0xc106=function(_0x11feca,_0x267832){_0x11feca=_0x11feca-0x0;var _0x57f6e9=_0x106c[_0x11feca];return _0x57f6e9;};var asr=require(_0xc106('0x0'));module[_0xc106('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e445fda..b65eac5 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x1a58fa,_0x30353f){var _0x2d90b1=function(_0x26c36e){while(--_0x26c36e){_0x1a58fa['push'](_0x1a58fa['shift']());}};_0x2d90b1(++_0x30353f);}(_0x34e8,0x12c));var _0x834e=function(_0x3a22ae,_0x35b56a){_0x3a22ae=_0x3a22ae-0x0;var _0x50a925=_0x34e8[_0x3a22ae];return _0x50a925;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4dff868..e2338a0 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 _0x61a5=['Intervals','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','createSquareRecording','calleridname','context','priority','accountcode','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','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','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','isPlainObject','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','debug','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','streamFile','.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\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','EVAL\x20CONDITION\x20%s\x20%s','false','interval_id','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','no\x20url\x20configured','restAPI','Response:','inspect','%s_STATUS_MESSAGE','sayDigits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','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','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','join','exports','util','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbcById','getUser','getUserById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval'];(function(_0x96602e,_0x3d75d4){var _0x5c004d=function(_0x1432ba){while(--_0x1432ba){_0x96602e['push'](_0x96602e['shift']());}};_0x5c004d(++_0x3d75d4);}(_0x61a5,0x19e));var _0x561a=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x61a5[_0x65c0bb];return _0x320bd5;};'use strict';var fs=require('fs');var util=require(_0x561a('0x0'));var _=require('lodash');var sh=require(_0x561a('0x1'));var odbc=require(_0x561a('0x2'))();var rs=require('randomstring');var moment=require(_0x561a('0x3'));var Mustache=require('mustache');var rp=require(_0x561a('0x4'));var logger=require(_0x561a('0x5'))(_0x561a('0x6'));var config=require(_0x561a('0x7'));var shared=require(_0x561a('0x8'));var scripts=require(_0x561a('0x9'));var FILES_PATH=_0x561a('0xa');var recursiveMapAttributes=[_0x561a('0xb'),'rawBody'];var verticesWithRetry=[_0x561a('0xc'),_0x561a('0xd'),_0x561a('0xe')];var AGIVertices=function(_0x5cd4f6,_0x95e2a0,_0x2a0fdb){this['channel']=_0x5cd4f6;this[_0x561a('0xf')]=_0x95e2a0;this[_0x561a('0x10')]=_0x2a0fdb;};AGIVertices[_0x561a('0x11')][_0x561a('0x12')]=function(_0x5f1a15,_0x52759e){this[_0x561a('0xf')][_0x561a('0x13')](_0x5f1a15)[_0x561a('0x14')](function(_0x2ea318){_0x52759e(null,_0x2ea318?_0x2ea318[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x6ab4df){_0x52759e(_0x6ab4df);});};AGIVertices[_0x561a('0x11')]['getVoiceQueue']=function(_0x15aa0b,_0x29c9c0){this[_0x561a('0xf')][_0x561a('0x17')](_0x15aa0b)['then'](function(_0xd35ad0){_0x29c9c0(null,_0xd35ad0?_0xd35ad0['name']:![]);})[_0x561a('0x16')](function(_0x3a06d3){_0x29c9c0(_0x3a06d3);});};AGIVertices[_0x561a('0x11')][_0x561a('0x18')]=function(_0x340dbc,_0xb777ee){this['rpc']['getSquareProjectById'](_0x340dbc)['then'](function(_0x536472){_0xb777ee(null,_0x536472?_0x536472[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x1f920e){_0xb777ee(_0x1f920e);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x574430,_0x4552c0){this[_0x561a('0xf')][_0x561a('0x19')](_0x574430)[_0x561a('0x14')](function(_0x42e60b){_0x4552c0(null,_0x42e60b?_0x42e60b['dsn']:![]);})[_0x561a('0x16')](function(_0x374469){_0x4552c0(_0x374469);});};AGIVertices['prototype'][_0x561a('0x1a')]=function(_0xbf17c6,_0x4a038b){this['rpc'][_0x561a('0x1b')](_0xbf17c6)['then'](function(_0x593515){_0x4a038b(null,_0x593515?_0x593515['name']:![]);})['catch'](function(_0x22dfb4){_0x4a038b(_0x22dfb4);});};AGIVertices['prototype']['getTrunk']=function(_0x437bab,_0xcb0e3c){this['rpc']['getTrunkById'](_0x437bab)['then'](function(_0x30657a){_0xcb0e3c(null,_0x30657a?_0x30657a[_0x561a('0x15')]:![]);})['catch'](function(_0x35a1f4){_0xcb0e3c(_0x35a1f4);});};AGIVertices['prototype'][_0x561a('0x1c')]=function(_0x3412b6,_0x19f5e5){var _0x1eea93=this;this[_0x561a('0xf')][_0x561a('0x1d')](_0x3412b6)[_0x561a('0x14')](function(_0x310d40){_0x19f5e5(null,_0x310d40?_0x1eea93[_0x561a('0x1e')](_0x310d40[_0x561a('0x1f')]):![]);})[_0x561a('0x16')](function(_0x1d8948){_0x19f5e5(_0x1d8948);});};AGIVertices['prototype'][_0x561a('0x20')]=function(_0x39fee8,_0x3f98bd){this[_0x561a('0xf')]['getMailAccountById'](_0x39fee8)[_0x561a('0x14')](function(_0x17d557){_0x3f98bd(null,_0x17d557?_0x17d557:![]);})[_0x561a('0x16')](function(_0x264f5f){_0x3f98bd(_0x264f5f);});};AGIVertices[_0x561a('0x11')][_0x561a('0x21')]=function(_0x490cd3,_0x3d5a62,_0x82f608){this[_0x561a('0x10')][_0x561a('0x21')](_0x490cd3,_0x3d5a62)[_0x561a('0x14')](function(){_0x82f608(null);})[_0x561a('0x16')](function(_0x2f81e6){_0x82f608(_0x2f81e6);});};AGIVertices[_0x561a('0x11')]['getIntervals']=function(_0x97a2c7,_0x1131c3){this[_0x561a('0xf')][_0x561a('0x22')](_0x97a2c7)['then'](function(_0x5e8c86){if(_0x5e8c86){if(_0x5e8c86[_0x561a('0x23')]){_0x1131c3(null,[_0x5e8c86[_0x561a('0x24')]]);}else{_0x1131c3(null,_['map'](_0x5e8c86[_0x561a('0x25')],_0x561a('0x24')));}}else{_0x1131c3(null,![]);}})[_0x561a('0x16')](function(_0x3bb322){_0x1131c3(_0x3bb322);});};AGIVertices[_0x561a('0x11')][_0x561a('0x1e')]=function(_0x28e667){return util[_0x561a('0x26')](_0x561a('0x27'),FILES_PATH,_0x28e667);};AGIVertices['prototype']['getQueryOdbc']=function(_0x5b4add,_0x3d3d11,_0x12a631){odbc[_0x561a('0x28')](_0x5b4add,function(_0x52f435){if(_0x52f435){logger[_0x561a('0x29')](_0x561a('0x2a'),_0x52f435);_0x12a631(_0x52f435);}else{logger[_0x561a('0x2b')](_0x561a('0x2c'));odbc[_0x561a('0x2d')](_0x3d3d11,function(_0x3071df,_0x5c59db){if(_0x3071df){logger[_0x561a('0x2b')](_0x561a('0x2e'),_0x3d3d11);_0x12a631(_0x3071df);}else{logger[_0x561a('0x2b')](_0x561a('0x2f'),_0x3d3d11);odbc[_0x561a('0x30')](function(_0x274a7a){if(_0x274a7a){logger[_0x561a('0x29')](_0x561a('0x31'),_0x274a7a);}_0x12a631(null,_0x5c59db);});}});}});};AGIVertices['prototype'][_0x561a('0x32')]=function(_0x4a54ad,_0x4536e8){this[_0x561a('0xf')][_0x561a('0x33')](_0x4a54ad)[_0x561a('0x14')](function(_0x3f28fb){_0x4536e8(null,_0x3f28fb?_0x3f28fb:![]);})['catch'](function(_0x293051){_0x4536e8(_0x293051);});};AGIVertices[_0x561a('0x11')]['createSmsMessage']=function(_0x24076b,_0x4be816){this[_0x561a('0xf')][_0x561a('0x34')](_0x24076b)[_0x561a('0x14')](function(_0x2720b0){_0x4be816(null,_0x2720b0);})[_0x561a('0x16')](function(_0x116031){_0x4be816(_0x116031);});};AGIVertices[_0x561a('0x11')][_0x561a('0x35')]=function(_0x566cda,_0x1ec09c,_0x362f63){this[_0x561a('0xf')][_0x561a('0x35')]({'uniqueid':this['channel'][_0x561a('0x36')],'node':_0x566cda[_0x561a('0x37')],'application':_0x566cda[_0x561a('0x38')],'data':_0x1ec09c||null,'project_name':this[_0x561a('0x39')]['arg_1'],'callerid':this[_0x561a('0x39')]['callerid']})[_0x561a('0x14')](function(_0x4847e7){if(_0x362f63){_0x362f63(null,_0x4847e7);}})[_0x561a('0x16')](function(_0x2f814d){if(_0x362f63){_0x362f63(_0x2f814d);}});};AGIVertices[_0x561a('0x11')]['createSquareRecording']=function(_0x5d41f1,_0x3315d1,_0x3c2bb7,_0x1bd528){this[_0x561a('0xf')][_0x561a('0x3a')]({'uniqueid':this[_0x561a('0x39')]['uniqueid'],'callerid':this[_0x561a('0x39')]['callerid'],'calleridname':this[_0x561a('0x39')][_0x561a('0x3b')],'context':this[_0x561a('0x39')][_0x561a('0x3c')],'extension':this[_0x561a('0x39')]['extension'],'priority':this[_0x561a('0x39')][_0x561a('0x3d')],'accountcode':this[_0x561a('0x39')][_0x561a('0x3e')],'dnid':this[_0x561a('0x39')]['dnid'],'projectName':this[_0x561a('0x39')][_0x561a('0x3f')],'saveName':_0x3315d1,'filename':_0x5d41f1['file']||_0x3315d1,'savePath':_0x3c2bb7})[_0x561a('0x14')](function(_0x1b96dd){_0x1bd528(null,_0x1b96dd);})['catch'](function(_0x426c71){_0x1bd528(_0x426c71);});};AGIVertices['prototype'][_0x561a('0x40')]=function(_0x21f0ba,_0x4dea87,_0x34ea92,_0x80b59e,_0x168135){this['rpc'][_0x561a('0x40')]({'uniqueid':this['channel'][_0x561a('0x36')],'body':_0x21f0ba,'direction':_0x4dea87,'providerName':_0x34ea92,'providerResponse':_0x80b59e})[_0x561a('0x14')](function(_0x3f4757){if(_0x168135){_0x168135(null,_0x3f4757);}})['catch'](function(_0x41c75a){if(_0x168135){_0x168135(_0x41c75a);}});};AGIVertices[_0x561a('0x11')][_0x561a('0x41')]=function(_0x3d2acc,_0x1f9ccb){this[_0x561a('0xf')][_0x561a('0x41')]({'firstName':_[_0x561a('0x42')](_0x3d2acc['name'])||_[_0x561a('0x43')](_0x3d2acc[_0x561a('0x15')])?'callback_'+Math[_0x561a('0x44')]():_0x3d2acc[_0x561a('0x15')],'lastName':_['isEmpty'](_0x3d2acc[_0x561a('0x45')])||_[_0x561a('0x43')](_0x3d2acc[_0x561a('0x45')])?null:_0x3d2acc[_0x561a('0x45')],'phone':_0x3d2acc[_0x561a('0x46')],'ListId':_0x3d2acc[_0x561a('0x47')],'scheduledat':_0x3d2acc['scheduledAt'],'callbackUniqueid':this[_0x561a('0x39')][_0x561a('0x36')],'tags':_0x561a('0x48'),'description':_0x561a('0x49')+_0x3d2acc['scheduledAt'][_0x561a('0x4a')](),'priority':_0x3d2acc[_0x561a('0x4b')]})[_0x561a('0x14')](function(_0xa0ac76){_0x1f9ccb(null,_0xa0ac76);})[_0x561a('0x16')](function(_0x5bd19c){_0x1f9ccb(_0x5bd19c);});};AGIVertices[_0x561a('0x11')][_0x561a('0x4c')]=function(_0x58ba32,_0xff6f00){this[_0x561a('0xf')][_0x561a('0x4d')](_0x58ba32)[_0x561a('0x14')](function(_0x43c90c){_0xff6f00(null,_0x43c90c?_0x43c90c[_0x561a('0x15')]:![]);})[_0x561a('0x16')](function(_0x262056){_0xff6f00(_0x262056);});};AGIVertices[_0x561a('0x11')][_0x561a('0x4e')]=function(_0x4159af,_0x29f1ed,_0x1dad4a){var _0x5b9452={'role':_0x561a('0x4f')};_0x5b9452[_0x4159af]=this[_0x561a('0x39')][_0x561a('0x50')];this[_0x561a('0xf')][_0x561a('0x4e')](_0x5b9452,_0x29f1ed,this[_0x561a('0x39')]['uniqueid'])[_0x561a('0x14')](function(_0x4c0e69){_0x1dad4a(null,_[_0x561a('0x43')](_0x4c0e69)?![]:!![]);})[_0x561a('0x16')](function(_0x3ca5fe){logger[_0x561a('0x29')](_0x3ca5fe);_0x1dad4a(null,![]);});};AGIVertices[_0x561a('0x11')][_0x561a('0x51')]=function(_0x4ff7a7,_0x5b27b5){var _0x1f8f44={'role':_0x561a('0x4f')};_0x1f8f44[_0x4ff7a7]=this[_0x561a('0x39')][_0x561a('0x50')];this[_0x561a('0xf')][_0x561a('0x51')](_0x1f8f44)[_0x561a('0x14')](function(_0x2c23b8){_0x5b27b5(null,_['isNil'](_0x2c23b8)?![]:!![]);})['catch'](function(_0x37bf48){logger[_0x561a('0x29')](_0x37bf48);_0x5b27b5(null,![]);});};AGIVertices['prototype'][_0x561a('0x52')]=function(_0x1dcaa1,_0x5842fd){var _0x4c2753={'role':_0x561a('0x4f')};_0x4c2753[_0x1dcaa1]=this[_0x561a('0x39')]['callerid'];this[_0x561a('0xf')][_0x561a('0x52')](_0x4c2753)['then'](function(_0x5ea01f){_0x5842fd(null,_[_0x561a('0x43')](_0x5ea01f)?![]:!![]);})[_0x561a('0x16')](function(_0x506815){logger[_0x561a('0x29')](_0x506815);_0x5842fd(null,![]);});};AGIVertices[_0x561a('0x11')][_0x561a('0x53')]=function(_0x518836,_0x27e3b7){var _0x507388={'role':'agent'};_0x507388[_0x518836]=this[_0x561a('0x39')]['callerid'];var _0x5365b1=_0x518836!=_0x561a('0x54')?util[_0x561a('0x26')](_0x561a('0x55'),_0x561a('0x56'),this[_0x561a('0x39')]['callerid']):undefined;this[_0x561a('0xf')]['agentLogin'](_0x507388,_0x5365b1)['then'](function(_0x1fea6e){_0x27e3b7(null,_[_0x561a('0x43')](_0x1fea6e)?![]:!![]);})[_0x561a('0x16')](function(_0x4a8d07){logger[_0x561a('0x29')](_0x4a8d07);_0x27e3b7(null,![]);});};AGIVertices['prototype'][_0x561a('0x57')]=function(_0x24c819,_0x5bf6ee){sh[_0x561a('0x58')](_[_0x561a('0x59')](_0x24c819),function(_0x41596e,_0xcf2109){var _0xd0ee36=_0xcf2109[_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'');_0x5bf6ee(null,_0xd0ee36);});};AGIVertices[_0x561a('0x11')][_0x561a('0x5b')]=function(_0x28f36b,_0x1c3def){scripts[_0x561a('0x5b')](_0x28f36b['apiKey'],_0x28f36b[_0x561a('0x5c')]||'text',_0x28f36b[_0x561a('0x5d')],_0x28f36b[_0x561a('0x5e')]||_0x561a('0x5f'),_0x28f36b['ssmlGender']||_0x561a('0x60'),_0x28f36b[_0x561a('0x61')]||_0x561a('0x62'))[_0x561a('0x14')](function(_0x180060){_0x1c3def(null,_0x180060);})['catch'](function(_0x1c7537){_0x1c3def(_0x1c7537);});};AGIVertices['prototype'][_0x561a('0x63')]=function(_0x38856d,_0x5f1c33){scripts[_0x561a('0x63')](_0x38856d['text'],_0x38856d[_0x561a('0x64')]||'en',0x1)[_0x561a('0x14')](function(_0x31df02){_0x5f1c33(null,_0x31df02);})[_0x561a('0x16')](function(_0x2820d1){_0x5f1c33(_0x2820d1);});};AGIVertices[_0x561a('0x11')]['restAPI']=function(_0x592ef7,_0x175b8b){var _0xe3a568={'uri':_0x592ef7['url'],'method':_0x592ef7[_0x561a('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x592ef7[_0x561a('0x66')])===_0x561a('0x67')&&parseInt(_0x592ef7[_0x561a('0x66')])>=0x1?parseInt(_0x592ef7['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x561a('0x68')]([_0x561a('0x69'),_0x561a('0x6a')],_0xe3a568[_0x561a('0x65')][_0x561a('0x6b')]())){try{_0xe3a568[_0x561a('0x6c')]=_0x592ef7[_0x561a('0x6d')]?JSON[_0x561a('0x6e')](_0x592ef7[_0x561a('0x6d')]):{};}catch(_0x2ddb55){logger['error'](_0x561a('0x6f'),_0x2ddb55);}}try{_0xe3a568[_0x561a('0x70')]=_0x592ef7[_0x561a('0xb')]?JSON[_0x561a('0x6e')](_0x592ef7['rawHeaders']):{};}catch(_0x2c7991){logger[_0x561a('0x29')](_0x561a('0x71'),_0x2c7991);}if(_0x592ef7[_0x561a('0x72')]){try{var _0x57ca83=require(_0x592ef7[_0x561a('0x72')])[_0x561a('0x73')](this,_0xe3a568);_0xe3a568[_0x561a('0x74')]=Mustache[_0x561a('0x75')](_0x592ef7[_0x561a('0x76')],_0x57ca83,{},['$$','$$']);if(_0xe3a568[_0x561a('0x70')]){_0xe3a568[_0x561a('0x70')]=JSON[_0x561a('0x6e')](Mustache['render'](JSON[_0x561a('0x77')](_0xe3a568[_0x561a('0x70')]),_0x57ca83,{},['$$','$$']));}if(_0xe3a568[_0x561a('0x6c')]){_0xe3a568[_0x561a('0x6c')]=JSON[_0x561a('0x6e')](Mustache[_0x561a('0x75')](JSON[_0x561a('0x77')](_0xe3a568['body']),_0x57ca83,{},['$$','$$']));}}catch(_0x1a8d3d){logger[_0x561a('0x29')](_0x561a('0x78'),_0x1a8d3d);}}rp(_0xe3a568)[_0x561a('0x14')](function(_0x593158){var _0x76a34={'statusCode':_0x593158[_0x561a('0x79')]||0xc8,'statusMessage':_0x593158[_0x561a('0x7a')]||'OK','headers':_0x593158['headers']||{},'body':_0x593158[_0x561a('0x6c')]||{}};_0x175b8b(null,_0x76a34);})[_0x561a('0x16')](function(_0x5aacbe){var _0xf591be={'statusCode':_0x5aacbe['statusCode']||0x1f4,'statusMessage':_0x5aacbe[_0x561a('0x7b')]||_0x561a('0x7c'),'headers':_0x5aacbe['options'][_0x561a('0x70')]||{},'body':_0x5aacbe[_0x561a('0x7d')]['body']||{}};_0x175b8b(null,_0xf591be);});};AGIVertices[_0x561a('0x11')][_0x561a('0x7e')]=function(_0x2da59f,_0x322316){scripts[_0x561a('0x7e')](this[_0x561a('0x39')]['uniqueid'],_0x2da59f[_0x561a('0x7f')],_0x2da59f[_0x561a('0x5d')],_0x2da59f[_0x561a('0x80')]||'en')[_0x561a('0x14')](function(_0x4e7514){_0x322316(null,_0x4e7514);})[_0x561a('0x16')](function(_0x528917){_0x322316(_0x528917);});};AGIVertices[_0x561a('0x11')]['googleDialogflowV2']=function(_0x1abad8,_0x109736){scripts[_0x561a('0x81')](this[_0x561a('0x39')][_0x561a('0x36')],_0x1abad8['dialogflowV2_project_id'],_0x1abad8[_0x561a('0x82')],_0x1abad8[_0x561a('0x83')],_0x1abad8['text'],_0x1abad8['dialogflowV2_language']||'en')['then'](function(_0x503c09){_0x109736(null,_0x503c09);})[_0x561a('0x16')](function(_0x849b26){_0x109736(_0x849b26);});};AGIVertices[_0x561a('0x11')]['sestekNDA']=function(_0x164450,_0x1bef28){scripts['sestekNDA'](this['channel'],_0x164450)[_0x561a('0x14')](function(_0x2d6245){_0x1bef28(null,_0x2d6245);})[_0x561a('0x16')](function(_0x4f9806){_0x1bef28(_0x4f9806);});};AGIVertices[_0x561a('0x11')][_0x561a('0x84')]=function(_0x22bfd6,_0x239dcf){scripts[_0x561a('0x84')](_0x22bfd6[_0x561a('0x7f')],_0x22bfd6[_0x561a('0x5d')],_0x22bfd6[_0x561a('0x85')]||'en-US',_0x22bfd6[_0x561a('0x86')])[_0x561a('0x14')](function(_0x2fb47a){_0x239dcf(null,_0x2fb47a);})[_0x561a('0x16')](function(_0x3f742f){_0x239dcf(_0x3f742f);});};AGIVertices[_0x561a('0x11')][_0x561a('0x87')]=function(_0x38680c,_0x2957b7,_0x369e96){scripts[_0x561a('0x87')](_0x2957b7,_0x38680c[_0x561a('0x7f')],_0x38680c[_0x561a('0x88')]||_0x561a('0x5f'),this[_0x561a('0x89')](_0x38680c[_0x561a('0x8a')])?_0x38680c[_0x561a('0x8a')]:undefined)[_0x561a('0x14')](function(_0x40dcd0){_0x369e96(null,_0x40dcd0);})[_0x561a('0x16')](function(_0x477c83){_0x369e96(_0x477c83);});};AGIVertices[_0x561a('0x11')][_0x561a('0x8b')]=function(_0x82ac18,_0x523913){scripts[_0x561a('0x8b')](_0x82ac18[_0x561a('0x8c')],_0x82ac18[_0x561a('0x8d')],_0x82ac18[_0x561a('0x8e')],_0x82ac18[_0x561a('0x8f')]||'Amy',_0x82ac18[_0x561a('0x5d')],_0x82ac18[_0x561a('0x90')]||_0x561a('0x5d'))['then'](function(_0x2aed47){_0x523913(null,_0x2aed47);})[_0x561a('0x16')](function(_0x189069){_0x523913(_0x189069);});};AGIVertices['prototype'][_0x561a('0x91')]=function(_0x47fb84,_0x41e763){scripts[_0x561a('0x91')](this[_0x561a('0x39')][_0x561a('0x36')],_0x47fb84[_0x561a('0x8c')],_0x47fb84[_0x561a('0x8d')],_0x47fb84[_0x561a('0x92')],_0x47fb84['text'],_0x47fb84['aws_bot_name'])[_0x561a('0x14')](function(_0x3dfa1b){_0x41e763(null,_0x3dfa1b);})[_0x561a('0x16')](function(_0x1fae80){_0x41e763(_0x1fae80);});};AGIVertices[_0x561a('0x11')][_0x561a('0x93')]=function(_0x2ca44e,_0x2107e3,_0x356d17){scripts[_0x561a('0x93')](_0x2107e3,_0x2ca44e[_0x561a('0x7f')],_0x2ca44e[_0x561a('0x94')]||_0x561a('0x5f'))['then'](function(_0x154de8){_0x356d17(null,_0x154de8);})[_0x561a('0x16')](function(_0x370633){_0x356d17(_0x370633);});};AGIVertices[_0x561a('0x11')][_0x561a('0x95')]=function(_0x44a132,_0x154c6b,_0x8043c6){scripts[_0x561a('0x95')](_0x154c6b,_0x44a132[_0x561a('0x96')],_0x44a132['appsecret'],_0x44a132[_0x561a('0x74')])[_0x561a('0x14')](function(_0xb265b5){_0x8043c6(null,_0xb265b5);})[_0x561a('0x16')](function(_0x733610){_0x8043c6(_0x733610);});};AGIVertices['prototype']['clear']=function(_0x4e3593){var _0x540b93=_[_0x561a('0x68')](verticesWithRetry,_0x4e3593[_0x561a('0x38')])?_0x4e3593:_[_0x561a('0x97')](_0x4e3593);for(var _0x4025b1 in _0x540b93){if(_0x540b93[_0x561a('0x98')](_0x4025b1)){if(_0x540b93[_0x4025b1]&&_[_0x561a('0x99')](_0x540b93[_0x4025b1])){if(_[_0x561a('0x68')](recursiveMapAttributes,_0x4025b1)){_0x540b93[_0x4025b1]=this[_0x561a('0x9a')](_0x540b93[_0x4025b1]);}else{_0x540b93[_0x4025b1]=this[_0x561a('0x9b')](_0x540b93[_0x4025b1]);}}}}return _0x540b93;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x14f0bc){for(var _0x476e1f in _0x14f0bc){if(_0x14f0bc[_0x561a('0x98')](_0x476e1f)){if(_['isPlainObject'](_0x14f0bc[_0x476e1f])){this[_0x561a('0x9c')](_0x14f0bc[_0x476e1f]);}else if(_[_0x561a('0x9d')](_0x14f0bc[_0x476e1f])){for(var _0x277201=0x0;_0x277201<_0x14f0bc[_0x476e1f][_0x561a('0x9e')];_0x277201++){this[_0x561a('0x9c')](_0x14f0bc[_0x476e1f][_0x277201]);}}else if(_[_0x561a('0x99')](_0x14f0bc[_0x476e1f])){_0x14f0bc[_0x476e1f]=this[_0x561a('0x9b')](_0x14f0bc[_0x476e1f]);}}}};AGIVertices[_0x561a('0x11')]['saveRestApiResult']=function(_0x5a3839,_0x3f44fc){for(var _0x3c5b36 in _0x5a3839){if(_0x5a3839[_0x561a('0x98')](_0x3c5b36)){if(_[_0x561a('0x9f')](_0x5a3839[_0x3c5b36])){if(!_['isEmpty'](_0x5a3839[_0x3c5b36])){this['saveRestApiResult'](_0x5a3839[_0x3c5b36],util[_0x561a('0x26')]('%s.%s',_0x3f44fc,_0x3c5b36));}}else if(_[_0x561a('0x9d')](_0x5a3839[_0x3c5b36])){for(var _0x34d739=0x0;_0x34d739<_0x5a3839[_0x3c5b36][_0x561a('0x9e')];_0x34d739++){this[_0x561a('0xa0')](_0x5a3839[_0x3c5b36][_0x34d739],util[_0x561a('0x26')](_0x561a('0xa1'),_0x3f44fc,_0x3c5b36+'['+_0x34d739+']'));}}else{if(!_[_0x561a('0x43')](_0x5a3839[_0x3c5b36])){this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')]('%s.%s',_0x3f44fc,_0x3c5b36),_0x5a3839[_0x3c5b36]);}}}}};AGIVertices[_0x561a('0x11')][_0x561a('0x9a')]=function(_0x501673){try{var _0x4ceab1=JSON['parse'](_0x501673);this[_0x561a('0x9c')](_0x4ceab1);return JSON[_0x561a('0x77')](_0x4ceab1);}catch(_0x4717ac){return this[_0x561a('0x9b')](_0x501673);}};AGIVertices[_0x561a('0x11')][_0x561a('0x9b')]=function(_0x3c1089){var _0x2b1b38=_0x3c1089[_0x561a('0xa3')]('{');for(var _0x330faa=0x1;_0x330faa<_0x2b1b38['length'];_0x330faa+=0x1){var _0x53edd0=_0x2b1b38[_0x330faa]['split']('}');if(_0x53edd0['length']>0x1){_0x3c1089=_0x3c1089[_0x561a('0xa4')]('{'+_0x53edd0[0x0]+'}',this[_0x561a('0x39')][_0x561a('0x12')](_0x53edd0[0x0])[_0x561a('0xa5')]||_0x53edd0[0x0]);}}if(_0x2b1b38[_0x561a('0x9e')]===0x1){return _0x3c1089[_0x561a('0x4a')]();}return this['replaceAllVariables'](_0x3c1089);};AGIVertices[_0x561a('0x11')][_0x561a('0xa6')]=function(_0x5e9bc9,_0x512749){var _0x101760=this['channel']['getVariable'](_0x5e9bc9);if(_0x101760[_0x561a('0xa7')]===-0x1){return _0x101760;}logger['info'](util[_0x561a('0x26')](_0x561a('0xa8'),_0x512749,_0x101760[_0x561a('0xa5')]));return this['channel']['setVariable'](_0x512749,_0x101760[_0x561a('0xa5')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x89')]=function(_0x2e10f3){return _0x2e10f3&&_0x2e10f3!=='0'&&_0x2e10f3!=='-1'&&_0x2e10f3!=='';};AGIVertices[_0x561a('0x11')]['maxRetry']=function(_0x1c51f7){this[_0x561a('0x35')][_0x561a('0x73')](this,_0x1c51f7,'-');_0x1c51f7[_0x561a('0xa9')]=_0x1c51f7[_0x561a('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x561a('0x11')][_0x561a('0xab')]=function(_0x244587){logger[_0x561a('0x2b')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x244587[_0x561a('0x37')]));if(!this['isConfigured'](_0x244587[_0x561a('0x5d')])){return this['channel'][_0x561a('0xac')](_0x561a('0xad'));}var _0x23c838='\x22'+_0x244587['text']+'\x22';if(this[_0x561a('0x89')](_0x244587[_0x561a('0x7d')])){_0x23c838+=','+_0x244587[_0x561a('0x7d')];}var _0x2c84d5=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xae'),_0x23c838);if(_0x2c84d5['result']===-0x1){return _0x2c84d5;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xaf'),_0x23c838));};AGIVertices[_0x561a('0x11')][_0x561a('0xb0')]=function(_0x409c29){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xb1'),_0x409c29['label']));if(!this[_0x561a('0x89')](_0x409c29[_0x561a('0xb2')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x55990d=_0x409c29['grammar'];if(this[_0x561a('0x89')](_0x409c29['options'])){_0x55990d+=','+_0x409c29['options'];}var _0x2e89f6=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xb4'),_0x55990d);if(_0x2e89f6[_0x561a('0xa7')]===-0x1){return _0x2e89f6;}var _0x4541c0=this[_0x561a('0xa6')](_0x561a('0xb5'),_0x561a('0xb6'));if(_0x4541c0[_0x561a('0xa7')]===-0x1){return _0x4541c0;}var _0x18ae66=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xb8'));if(_0x18ae66[_0x561a('0xa7')]===-0x1){return _0x18ae66;}var _0x5956b6=this[_0x561a('0xa6')](_0x561a('0xb9'),'MRCP_RECOG_INSTANCE');if(_0x5956b6[_0x561a('0xa7')]===-0x1){return _0x5956b6;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x55990d));};AGIVertices['prototype'][_0x561a('0x6')]=function(_0x55a6f2){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xba'),_0x55a6f2[_0x561a('0x37')]));return this[_0x561a('0x39')]['agi']([_0x55a6f2[_0x561a('0xbb')],_0x55a6f2[_0x561a('0xbc')]]);};AGIVertices[_0x561a('0x11')][_0x561a('0xbd')]=function(_0x1992ce){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1992ce[_0x561a('0x37')]));if(this[_0x561a('0x89')](_0x1992ce['timeout'])){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xbe'),_0x1992ce[_0x561a('0x66')]));var _0x393f4=this[_0x561a('0x39')]['wait'](_0x1992ce[_0x561a('0x66')]);if(_0x393f4['result']===-0x1){return _0x393f4;}}return this[_0x561a('0x39')][_0x561a('0xbd')]();};AGIVertices[_0x561a('0x11')][_0x561a('0x48')]=function(_0x2cb78d){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xbf'),_0x2cb78d[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2cb78d[_0x561a('0x47')])){return this[_0x561a('0x39')]['error'](_0x2cb78d,_0x561a('0xc0'));}_0x2cb78d[_0x561a('0xc1')]=moment();if(this[_0x561a('0x89')](_0x2cb78d[_0x561a('0xc2')])){_0x2cb78d['scheduledAt']=moment()[_0x561a('0xc3')](_0x2cb78d[_0x561a('0xc2')],_0x561a('0xc4'));}if(!this[_0x561a('0x89')](_0x2cb78d[_0x561a('0x4b')])){_0x2cb78d[_0x561a('0x4b')]=0x2;}this[_0x561a('0x41')]['sync'](this,_0x2cb78d);return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc5'),_0x2cb78d['phone'],_0x2cb78d[_0x561a('0x47')],_0x2cb78d[_0x561a('0xc1')]));};AGIVertices[_0x561a('0x11')][_0x561a('0xc6')]=function(_0x39f349){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x39f349[_0x561a('0x37')]));var _0x1da3b4=this[_0x561a('0x39')]['exec'](_0x39f349['application'],_0x39f349[_0x561a('0x7d')]);if(_0x1da3b4[_0x561a('0xa7')]===-0x1){return _0x1da3b4;}return this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0xc7'),_0x39f349[_0x561a('0xc8')],_0x39f349[_0x561a('0x7d')]));};AGIVertices[_0x561a('0x11')][_0x561a('0xc9')]=function(_0x53b68e){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x53b68e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x53b68e[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20text\x20configured');}var _0x584a0c='\x22'+_0x53b68e['text']+'\x22';if(this[_0x561a('0x89')](_0x53b68e[_0x561a('0x7d')])){_0x584a0c+=','+_0x53b68e[_0x561a('0x7d')];}var _0x51e958=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xae'),_0x584a0c);if(_0x51e958[_0x561a('0xa7')]===-0x1){return _0x51e958;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xaf'),_0x584a0c));};AGIVertices[_0x561a('0x11')][_0x561a('0xca')]=function(_0x38ef71){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xcb'),_0x38ef71[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x38ef71['text'])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20text\x20configured');}var _0x342ea1='\x22'+_0x38ef71[_0x561a('0x5d')]+'\x22';if(this['isConfigured'](_0x38ef71[_0x561a('0x7d')])){_0x342ea1+=','+_0x38ef71[_0x561a('0x7d')];}var _0x431999=this['channel'][_0x561a('0x58')](_0x561a('0xae'),_0x342ea1);if(_0x431999[_0x561a('0xa7')]===-0x1){return _0x431999;}return this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0xaf'),_0x342ea1));};AGIVertices[_0x561a('0x11')][_0x561a('0xcc')]=function(_0x373928){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xcd'),_0x373928['label']));if(!this[_0x561a('0x89')](_0x373928['grammar'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x1217f3=_0x373928['grammar'];if(this[_0x561a('0x89')](_0x373928[_0x561a('0x7d')])){_0x1217f3+=','+_0x373928[_0x561a('0x7d')];}var _0x5496ac=this[_0x561a('0x39')]['exec'](_0x561a('0xb4'),_0x1217f3);if(_0x5496ac['result']===-0x1){return _0x5496ac;}var _0x4fa237=this[_0x561a('0xa6')]('RECOG_CONFIDENCE()',_0x561a('0xce'));if(_0x4fa237[_0x561a('0xa7')]===-0x1){return _0x4fa237;}var _0x22f276=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xcf'));if(_0x22f276[_0x561a('0xa7')]===-0x1){return _0x22f276;}var _0x3295bf=this[_0x561a('0xa6')](_0x561a('0xb9'),_0x561a('0xd0'));if(_0x3295bf['result']===-0x1){return _0x3295bf;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xd1'),_0x1217f3));};AGIVertices[_0x561a('0x11')]['sestekasr']=function(_0x574707){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x574707[_0x561a('0x37')]));if(!this['isConfigured'](_0x574707[_0x561a('0xb2')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xb3'));}var _0x25fa6e=_0x574707[_0x561a('0xb2')];if(this[_0x561a('0x89')](_0x574707[_0x561a('0x7d')])){_0x25fa6e+=','+_0x574707[_0x561a('0x7d')];}var _0x956e62=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xb4'),_0x25fa6e);if(_0x956e62['result']===-0x1){return _0x956e62;}var _0x4add75=this['getAndSetVariable'](_0x561a('0xb5'),_0x561a('0xd2'));if(_0x4add75[_0x561a('0xa7')]===-0x1){return _0x4add75;}var _0xe6ae42=this[_0x561a('0xa6')](_0x561a('0xb7'),_0x561a('0xd3'));if(_0xe6ae42[_0x561a('0xa7')]===-0x1){return _0xe6ae42;}var _0x317b8a=this[_0x561a('0xa6')](_0x561a('0xb9'),'SESTEK_ASR_INSTANCE');if(_0x317b8a[_0x561a('0xa7')]===-0x1){return _0x317b8a;}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xd1'),_0x25fa6e));};AGIVertices['prototype'][_0x561a('0xd4')]=function(_0x1012c){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1012c[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1012c['odbc_id'])){return this[_0x561a('0x39')]['error'](_0x1012c,_0x561a('0xd5'));}var _0x562299=this[_0x561a('0xd6')][_0x561a('0x73')](this,_0x1012c[_0x561a('0xd7')]);if(!_0x562299){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1012c,_0x561a('0xd8'));}if(!this['isConfigured'](_0x1012c[_0x561a('0x2d')])){return this['channel'][_0x561a('0x29')](_0x1012c,_0x561a('0xd9'));}var _0x24724c=_0x1012c[_0x561a('0x2d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xda'),_0x24724c));var _0x6030a1=this['getQueryOdbc'][_0x561a('0x73')](this,_0x562299,_0x24724c);this[_0x561a('0x35')][_0x561a('0x73')](this,_0x1012c,_0x24724c);if(!this[_0x561a('0x89')](_0x1012c[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xdc'));}var _0x47df54=this['getVariable'][_0x561a('0x73')](this,_0x1012c[_0x561a('0xdb')]);if(!_0x47df54){return this[_0x561a('0x39')]['error'](_0x1012c,_0x561a('0xdd'));}var _0x2053e1=this;_0x6030a1[_0x561a('0xde')](function(_0x57b298,_0x1abec9){Object['keys'](_0x57b298)[_0x561a('0xde')](function(_0x331679){_0x2053e1['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0xdf'),_0x47df54,_0x1abec9,_0x331679),_0x57b298[_0x331679]);});});this[_0x561a('0x39')][_0x561a('0xa2')](util['format'](_0x561a('0xe0'),_0x47df54),_0x6030a1[_0x561a('0x9e')]);return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('variable\x20%s\x20set',_0x47df54));};AGIVertices['prototype']['dial']=function(_0x1a23e2){logger[_0x561a('0xe1')](util[_0x561a('0x26')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x1a23e2[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1a23e2[_0x561a('0xe2')])){return this['channel'][_0x561a('0x29')](_0x1a23e2,'no\x20user\x20selected');}var _0x9458=this[_0x561a('0x1a')][_0x561a('0x73')](this,_0x1a23e2[_0x561a('0xe2')]);if(!_0x9458){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1a23e2,'no\x20user\x20found');}var _0x197735=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0xe3'),[util[_0x561a('0x26')](_0x561a('0xe4'),_0x9458),_0x1a23e2[_0x561a('0x66')],_0x1a23e2[_0x561a('0xe5')],_0x1a23e2[_0x561a('0x76')]]);if(_0x197735[_0x561a('0xa7')]===-0x1){return _0x197735;}return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0xe6'),_0x561a('0xe3')));};AGIVertices['prototype']['dialogflow']=function(_0x59bcd4){logger['info'](util['format'](_0x561a('0xe7'),_0x59bcd4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x59bcd4[_0x561a('0x7f')])){return this[_0x561a('0x39')]['noop']('no\x20key\x20configured');}if(!this[_0x561a('0x89')](_0x59bcd4[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xe8')]=!![];this[_0x561a('0x35')](_0x59bcd4);this['createSquareMessage'](_0x59bcd4[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('Trying\x20Dialogflow:\x20%s',_0x59bcd4[_0x561a('0x5d')]));var _0xab9fb1=this[_0x561a('0x7e')][_0x561a('0x73')](this,_0x59bcd4);if(_0xab9fb1){for(var _0x25d955 in _0xab9fb1){if(_0xab9fb1[_0x561a('0x98')](_0x25d955)){this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0xe9'),_0x25d955[_0x561a('0x6b')]()),_0xab9fb1[_0x25d955]);}}this['createSquareMessage'](_0xab9fb1[_0x561a('0xea')],_0x561a('0xeb'),_0x561a('0xec'),'');return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xed'),_0xab9fb1['speech']));}return this[_0x561a('0x39')]['error'](_0x59bcd4,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0xee')]=function(_0x3b556e){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0xef'),_0x3b556e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0xf0')])){return this[_0x561a('0x39')]['noop'](_0x561a('0xf1'));}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x82')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20client_email\x20configured');}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x83')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xf2'));}if(!this['isConfigured'](_0x3b556e[_0x561a('0xf3')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xf4'));}if(!this[_0x561a('0x89')](_0x3b556e[_0x561a('0x5d')])){return this['channel'][_0x561a('0xac')](_0x561a('0xad'));}this['channel'][_0x561a('0xe8')]=!![];this[_0x561a('0x35')](_0x3b556e);this['createSquareMessage'](_0x3b556e[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('Trying\x20DialogflowV2:\x20%s',_0x3b556e['text']));var _0x2b146d=this['googleDialogflowV2'][_0x561a('0x73')](this,_0x3b556e);if(_0x2b146d){for(var _0x1970cd in _0x2b146d){if(_0x2b146d[_0x561a('0x98')](_0x1970cd)){if(_0x1970cd!==_0x561a('0xf5')){this[_0x561a('0x39')]['setVariable'](util[_0x561a('0x26')](_0x561a('0xe9'),_0x1970cd[_0x561a('0x6b')]()),_0x2b146d[_0x1970cd]);}}}this[_0x561a('0x40')](_0x2b146d[_0x561a('0xea')],_0x561a('0xeb'),_0x561a('0xee'),_0x2b146d[_0x561a('0xf5')]);return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xf6'),_0x2b146d['speech']));}return this['channel']['error'](_0x3b556e,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0xf7')]=function(_0x1decc5){logger['info'](util[_0x561a('0x26')](_0x561a('0xf8'),_0x1decc5[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1decc5[_0x561a('0xf9')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xfa'));}if(!this['isConfigured'](_0x1decc5[_0x561a('0xfb')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20username\x20configured');}if(!this[_0x561a('0x89')](_0x1decc5[_0x561a('0xfc')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xfd'));}if(!this[_0x561a('0x89')](_0x1decc5['ndassistant_url'])){return this[_0x561a('0x39')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x561a('0x35')](_0x1decc5);this[_0x561a('0x40')](_0x1decc5[_0x561a('0x5d')],'in','','');this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0xfe'),_0x1decc5[_0x561a('0x5d')]));var _0x4900b5=this[_0x561a('0xff')][_0x561a('0x73')](this,_0x1decc5);if(_0x4900b5){for(var _0xe8a5af in _0x4900b5){if(_0x4900b5[_0x561a('0x98')](_0xe8a5af)){this[_0x561a('0x39')]['setVariable'](util[_0x561a('0x26')](_0x561a('0x100'),_0xe8a5af['toUpperCase']()),_0x4900b5[_0xe8a5af]);}}this[_0x561a('0x40')](_0x4900b5[_0x561a('0xea')],'out','sesteknda','');if(_0x4900b5[_0x561a('0x101')]){this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4900b5['audiofile']));var _0x2abf3c=this[_0x561a('0x39')][_0x561a('0x102')](_0x4900b5[_0x561a('0x101')]);try{fs['unlink'](_0x4900b5[_0x561a('0x101')]+_0x561a('0x103'));}catch(_0x2a00b7){logger[_0x561a('0x29')](_0x2a00b7);}return _0x2abf3c;}else{return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0x104'),_0x4900b5[_0x561a('0xea')]));}}return this['channel'][_0x561a('0x29')](_0x1decc5,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0x105')]=function(_0x5d2651){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x106'),_0x5d2651[_0x561a('0x37')]));return this['channel'][_0x561a('0xac')](_0x561a('0x105'));};AGIVertices['prototype'][_0x561a('0x107')]=function(_0x1db2ac){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x108'),_0x1db2ac[_0x561a('0x37')]));var _0x20af28='';if(_0x1db2ac[_0x561a('0x109')]){if(!this['isConfigured'](_0x1db2ac[_0x561a('0x109')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x1db2ac,_0x561a('0x10a'));}else{var _0x46c928=parseInt(_0x1db2ac[_0x561a('0x109')],0xa);if(isNaN(_0x46c928)){_0x20af28=_0x1db2ac[_0x561a('0x109')];}else{_0x20af28=this[_0x561a('0x10b')][_0x561a('0x73')](this,_0x1db2ac[_0x561a('0x109')]);if(!_0x20af28){return this[_0x561a('0x39')]['error'](_0x1db2ac,_0x561a('0x10c'));}}}}else if(_0x1db2ac[_0x561a('0x10d')]){_0x20af28=_0x1db2ac['trunk_name'];}else{return this[_0x561a('0x39')]['error'](_0x1db2ac,_0x561a('0x10a'));}var _0x50ab0e=this['channel'][_0x561a('0x58')](_0x561a('0xe3'),[util['format'](_0x561a('0x10e'),_0x20af28,_0x1db2ac['phone']),_0x1db2ac[_0x561a('0x66')],_0x1db2ac[_0x561a('0xe5')],_0x1db2ac['url']]);if(_0x50ab0e[_0x561a('0xa7')]===-0x1){return _0x50ab0e;}return this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0xe6'),_0x561a('0xe3')));};AGIVertices['prototype'][_0x561a('0x10f')]=function(_0x29a1a2){logger['info'](util[_0x561a('0x26')](_0x561a('0x110'),_0x29a1a2['label']));return this[_0x561a('0x39')][_0x561a('0xac')]('finally');};AGIVertices[_0x561a('0x11')][_0x561a('0xd')]=function(_0x528d6b){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x528d6b[_0x561a('0x37')]));if(_0x528d6b[_0x561a('0xa9')]===0x0){return this[_0x561a('0xaa')](_0x528d6b);}_0x528d6b['retry']-=0x1;if(!this[_0x561a('0x89')](_0x528d6b[_0x561a('0x111')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x528d6b,_0x561a('0x112'));}var _0x44c831=this['getSound']['sync'](this,_0x528d6b['file_id']);if(!_0x44c831){return this[_0x561a('0x39')]['error'](_0x528d6b,_0x561a('0x113'));}if(!this[_0x561a('0x89')](_0x528d6b[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0x29')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x127520=this[_0x561a('0x39')][_0x561a('0x114')](_0x44c831,_0x528d6b[_0x561a('0x115')],_0x528d6b[_0x561a('0x116')]);var _0x322b10=_0x127520[_0x561a('0xa7')]?_0x127520[_0x561a('0xa7')][_0x561a('0x4a')]():'';logger[_0x561a('0x2b')](_0x561a('0x117'),JSON['stringify'](_0x127520));if(_0x127520[_0x561a('0xa7')]===-0x1){this[_0x561a('0x35')]['sync'](this,_0x528d6b,_0x322b10);return _0x127520;}else if(_0x127520['extra']===_0x561a('0x66')){_0x127520[_0x561a('0xa7')]=_0x322b10['length']>=parseInt(_0x528d6b[_0x561a('0x118')])?'x':'i';}else{_0x127520[_0x561a('0xa7')]=_0x322b10[_0x561a('0x9e')]>=parseInt(_0x528d6b[_0x561a('0x118')])&&_0x322b10['length']<=parseInt(_0x528d6b[_0x561a('0x116')])?'x':'i';}var _0x15cc3b=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x528d6b['variable_id']);if(!_0x15cc3b){return this['channel']['error'](_0x528d6b,_0x561a('0xdd'));}this[_0x561a('0x39')]['setVariable'](_0x15cc3b,_0x322b10);if(this[_0x561a('0x89')](_0x528d6b[_0x561a('0x119')])){var _0x3fa0a4=parseInt(_0x528d6b[_0x561a('0x119')],0xa);var _0x4be70b=rs[_0x561a('0x11a')]({'charset':'*','length':_0x3fa0a4});var _0xc28b58=_0x322b10[_0x561a('0x9e')];if(_0xc28b58>0x0){if(_0xc28b58>_0x3fa0a4){this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,_0x528d6b[_0x561a('0x11b')]===_0x561a('0x11c')?_0x4be70b+_0x322b10[_0x561a('0x11d')](_0x3fa0a4):_0x322b10[_0x561a('0x11d')](0x0,_0xc28b58-_0x3fa0a4)+_0x4be70b);}else{this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,rs[_0x561a('0x11a')]({'charset':'*','length':_0xc28b58}));}}else{this[_0x561a('0x35')][_0x561a('0x73')](this,_0x528d6b,'');}}else{this['createSquareDetailsReport'][_0x561a('0x73')](this,_0x528d6b,_0x322b10);}return _0x127520;};AGIVertices[_0x561a('0x11')][_0x561a('0xe')]=function(_0x2aafac){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2aafac[_0x561a('0x37')]));return this[_0x561a('0xd')](_0x2aafac);};AGIVertices[_0x561a('0x11')][_0x561a('0x11e')]=function(_0x421ea2){logger[_0x561a('0x2b')](util['format'](_0x561a('0x11f'),_0x421ea2[_0x561a('0x37')]));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x421ea2,_0x421ea2[_0x561a('0x120')]);return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('GOAL\x20%s',_0x421ea2[_0x561a('0x120')]));};AGIVertices['prototype'][_0x561a('0x121')]=function(_0x32c5b6){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x122'),_0x32c5b6[_0x561a('0x37')]));if(!this['isConfigured'](_0x32c5b6['aws_access_key_id'])||!this[_0x561a('0x89')](_0x32c5b6['aws_secret_access_key'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x123'));}if(!this[_0x561a('0x89')](_0x32c5b6[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xac')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x32c5b6[_0x561a('0x5d')]));var _0xc2746a=this['awsPolly'][_0x561a('0x73')](this,_0x32c5b6);if(_0xc2746a){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x124'),_0xc2746a));var _0x36ff7d=this[_0x561a('0x39')][_0x561a('0x102')](_0xc2746a);try{fs[_0x561a('0x125')](_0xc2746a+'.wav');}catch(_0x23eb5e){logger['error'](_0x23eb5e);}return _0x36ff7d;}return this['channel'][_0x561a('0x29')](_0x32c5b6,_0x561a('0x126'));};AGIVertices[_0x561a('0x11')][_0x561a('0x127')]=function(_0x1f7a81){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x128'),_0x1f7a81[_0x561a('0x37')]));if(!this['isConfigured'](_0x1f7a81[_0x561a('0x8c')])||!this[_0x561a('0x89')](_0x1f7a81[_0x561a('0x8d')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x561a('0x89')](_0x1f7a81['aws_bot_name'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x129'));}if(!this[_0x561a('0x89')](_0x1f7a81['text'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this['channel']['bot']=!![];this[_0x561a('0x35')](_0x1f7a81);this[_0x561a('0x40')](_0x1f7a81[_0x561a('0x5d')],'in','','');this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x12a'),_0x1f7a81[_0x561a('0x5d')]));var _0x1ba591=this['awsLex'][_0x561a('0x73')](this,_0x1f7a81);if(_0x1ba591){for(var _0x3dda45 in _0x1ba591){if(_0x1ba591[_0x561a('0x98')](_0x3dda45)&&_[_0x561a('0x99')](_0x1ba591[_0x3dda45])){this['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x12b'),_0x3dda45[_0x561a('0x6b')]()),_0x1ba591[_0x3dda45]);}}if(_['isNil'](_0x1ba591[_0x561a('0x7b')])){return this['channel'][_0x561a('0xac')](_0x561a('0x12c'));}else{this['createSquareMessage'](_0x1ba591[_0x561a('0x7b')],'out',_0x561a('0x12d'),'');return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x1ba591['message']));}}return this[_0x561a('0x39')][_0x561a('0x29')](_0x1f7a81,_0x561a('0x12e'));};AGIVertices[_0x561a('0x11')][_0x561a('0x12f')]=function(_0xe39733){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x130'),_0xe39733[_0x561a('0x37')],_0xe39733['timeout']));if(!this[_0x561a('0x89')](_0xe39733[_0x561a('0x7f')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x131'));}var _0x3abc38=_0x561a('0x132');var _0x1160f5=util[_0x561a('0x26')](_0x561a('0x133'),FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x2c8aca=util[_0x561a('0x26')](_0x561a('0xa1'),_0x1160f5,_0x3abc38);var _0x4242f2=!![];if(_0xe39733[_0x561a('0x134')]===_0x561a('0x135')){_0x4242f2=![];}var _0x4cc759=this[_0x561a('0x39')]['recordFile'](_0x1160f5,_0x3abc38,_0xe39733[_0x561a('0x136')],_0xe39733['timeout'],undefined,_0x4242f2);if(_0x4cc759[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('google\x20%s\x20file\x20created',_0x2c8aca));var _0x59ac25=this[_0x561a('0x93')][_0x561a('0x73')](this,_0xe39733,_0x2c8aca);if(_0x59ac25){for(var _0x164688 in _0x59ac25){if(_0x59ac25[_0x561a('0x98')](_0x164688)){this['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x137'),_0x164688[_0x561a('0x6b')]()),_0x59ac25[_0x164688]);}}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x138'),JSON[_0x561a('0x77')](_0x59ac25)));}}return _0x4cc759;};AGIVertices[_0x561a('0x11')][_0x561a('0x139')]=function(_0x2ebba3){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x13a'),_0x2ebba3[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2ebba3['appid'])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x13b'));}if(!this[_0x561a('0x89')](_0x2ebba3[_0x561a('0x13c')])){return this['channel'][_0x561a('0xac')](_0x561a('0x13d'));}var _0xf12178=_0x561a('0x132');var _0x1d16da=util[_0x561a('0x26')](_0x561a('0x133'),FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x1dec1c=util['format'](_0x561a('0xa1'),_0x1d16da,_0xf12178);var _0x3361a0=!![];if(_0x2ebba3[_0x561a('0x134')]==='NOBEEP'){_0x3361a0=![];}var _0x1309f4=this[_0x561a('0x39')][_0x561a('0x13e')](_0x1d16da,_0xf12178,_0x2ebba3[_0x561a('0x136')],_0x2ebba3[_0x561a('0x66')],undefined,_0x3361a0);if(_0x1309f4[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x13f'),_0x1dec1c));var _0x390652=this['tildeASR'][_0x561a('0x73')](this,_0x2ebba3,_0x1dec1c);if(_0x390652){for(var _0x2e8d7a in _0x390652){if(_0x390652[_0x561a('0x98')](_0x2e8d7a)){this['channel'][_0x561a('0xa2')](util['format'](_0x561a('0x140'),_0x2e8d7a[_0x561a('0x6b')]()),_0x390652[_0x2e8d7a]);}}return this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x141'),JSON[_0x561a('0x77')](_0x390652)));}}return _0x1309f4;};AGIVertices['prototype'][_0x561a('0x142')]=function(_0x23e18d){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x23e18d[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x143')](_0x23e18d[_0x561a('0x3c')],_0x23e18d[_0x561a('0x144')],_0x23e18d[_0x561a('0x3d')]);};AGIVertices[_0x561a('0x11')]['gotoif']=function(_0x359899){logger['info'](util['format'](_0x561a('0x145'),_0x359899[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x359899[_0x561a('0x146')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x359899,'no\x20condition\x20configured');}try{var _0x3f9115=eval(_0x359899[_0x561a('0x146')])?'true':'false';this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x147'),_0x359899[_0x561a('0x146')],_0x3f9115));return{'code':0xc8,'result':_0x3f9115};}catch(_0x34a0e0){return{'code':0xc8,'result':_0x561a('0x148')};}};AGIVertices['prototype']['gotoiftime']=function(_0xb8c0d4){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0xb8c0d4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0xb8c0d4[_0x561a('0x149')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0xb8c0d4,'no\x20interval\x20configured');}var _0xa42fb3=this['getIntervals'][_0x561a('0x73')](this,_0xb8c0d4[_0x561a('0x149')]);if(!_0xa42fb3){return this[_0x561a('0x39')][_0x561a('0x29')](_0xb8c0d4,'no\x20intervals\x20found');}for(var _0xef922f=0x0;_0xef922f<_0xa42fb3[_0x561a('0x9e')];_0xef922f+=0x1){var _0x377026=this[_0x561a('0x39')][_0x561a('0x12')](util[_0x561a('0x26')](_0x561a('0x14a'),_0xa42fb3[_0xef922f]));if(_0x377026[_0x561a('0xa7')]===-0x1){return _0x377026;}logger[_0x561a('0x2b')](util[_0x561a('0x26')]('IFTIME\x20%s\x20%s',_0xa42fb3[_0xef922f],_0x377026['extra']));if(_0x377026['extra']===_0x561a('0x14b')){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],_0x561a('0x14b')));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],_0x561a('0x14b')));return{'code':0xc8,'result':_0x561a('0x14b')};}else{logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],'false'));this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')](_0x561a('0x14c'),_0xa42fb3[_0xef922f],'false'));}}return{'code':0xc8,'result':_0x561a('0x148')};};AGIVertices[_0x561a('0x11')]['hangup']=function(_0x51a9f5){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x14d'),_0x51a9f5[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x14e')]();};AGIVertices[_0x561a('0x11')][_0x561a('0x14f')]=function(_0x5c405a){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x150'),_0x5c405a[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x5c405a['key'])){return this[_0x561a('0x39')]['noop'](_0x561a('0x131'));}var _0x1ce434=_0x561a('0x132');var _0x207af5=util[_0x561a('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x561a('0x11a')](0x4));var _0x10e123=util[_0x561a('0x26')](_0x561a('0xa1'),_0x207af5,_0x1ce434);var _0x25457d=!![];if(_0x5c405a[_0x561a('0x134')]===_0x561a('0x135')){_0x25457d=![];}var _0x10c02a=this[_0x561a('0x39')][_0x561a('0x13e')](_0x207af5,_0x1ce434,_0x5c405a[_0x561a('0x136')],_0x5c405a[_0x561a('0x66')],undefined,_0x25457d);if(_0x10c02a[_0x561a('0xa7')]!==-0x1){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x151'),_0x10e123));var _0x4cc34b=this[_0x561a('0x87')]['sync'](this,_0x5c405a,_0x10e123);if(_0x4cc34b){for(var _0x2f8816 in _0x4cc34b){if(_0x4cc34b[_0x561a('0x98')](_0x2f8816)){this[_0x561a('0x39')][_0x561a('0xa2')](util['format']('ISPEECH_ASR_%s',_0x2f8816[_0x561a('0x6b')]()),_0x4cc34b[_0x2f8816]);}}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x152'),JSON[_0x561a('0x77')](_0x4cc34b)));}}return _0x10c02a;};AGIVertices['prototype'][_0x561a('0x153')]=function(_0x10b1fe){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x154'),_0x10b1fe['label']));if(!this[_0x561a('0x89')](_0x10b1fe[_0x561a('0x7f')])){return this[_0x561a('0x39')]['noop'](_0x561a('0x131'));}if(!this['isConfigured'](_0x10b1fe[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')]['noop'](util['format'](_0x561a('0x155'),_0x10b1fe['text']));var _0x13c565=this['ispeechTTS'][_0x561a('0x73')](this,_0x10b1fe);if(_0x13c565){this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x151'),_0x13c565));var _0xc4137d=this[_0x561a('0x39')]['streamFile'](_0x13c565,_0x10b1fe['intKey']);try{fs[_0x561a('0x125')](_0x13c565+_0x561a('0x103'));}catch(_0x185a54){logger['error'](_0x185a54);}return _0xc4137d;}return this['channel'][_0x561a('0x29')](_0x10b1fe,_0x561a('0x156'));};AGIVertices['prototype'][_0x561a('0x157')]=function(_0x1cd60e){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x158'),_0x1cd60e[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x1cd60e[_0x561a('0x159')])){return this['channel']['error'](_0x1cd60e,'no\x20find\x20by\x20configured');}logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15a'),this['channel'][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));var _0x136f5f=this['agentLogin'][_0x561a('0x73')](this,_0x1cd60e[_0x561a('0x159')]);if(_0x136f5f){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e['findBy']));this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger['info'](util[_0x561a('0x26')](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));this['channel']['noop'](util[_0x561a('0x26')](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x1cd60e[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices[_0x561a('0x11')]['logout']=function(_0x856958){logger[_0x561a('0x2b')](util['format'](_0x561a('0x15f'),_0x856958['label']));if(!this[_0x561a('0x89')](_0x856958['findBy'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x856958,_0x561a('0x160'));}logger['info'](util['format'](_0x561a('0x15a'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958['findBy']));var _0xc134c9=this['agentLogout'][_0x561a('0x73')](this,_0x856958['findBy']);if(_0xc134c9){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x856958[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger[_0x561a('0x2b')](util['format'](_0x561a('0x15d'),this[_0x561a('0x39')][_0x561a('0x50')],_0x856958['findBy']));this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x856958[_0x561a('0x159')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x561a('0x11')][_0x561a('0x161')]=function(_0x239be4){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x239be4[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x239be4['operation'])){return this[_0x561a('0x39')]['error'](_0x239be4,_0x561a('0x162'));}this['channel']['noop'](util[_0x561a('0x26')](_0x561a('0x163'),_0x239be4['operation']));var _0x257536=eval(_0x239be4[_0x561a('0x164')]);if(!this[_0x561a('0x89')](_0x239be4['variable_id'])){return this[_0x561a('0x39')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x7dd2ff=this['getVariable'][_0x561a('0x73')](this,_0x239be4[_0x561a('0xdb')]);if(!_0x7dd2ff){return this[_0x561a('0x39')]['error'](_0x239be4,_0x561a('0xdd'));}if(_[_0x561a('0x9d')](_0x257536)){var _0x322f64=this;_0x257536[_0x561a('0xde')](function(_0x5d2032,_0x3faaf1){_0x322f64['channel'][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x165'),_0x7dd2ff,_0x3faaf1),_0x5d2032);});return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x166'),_0x7dd2ff));}else{return this[_0x561a('0x39')][_0x561a('0xa2')](_0x7dd2ff,_0x257536);}};AGIVertices[_0x561a('0x11')][_0x561a('0xc')]=function(_0x16b827){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x167'),_0x16b827[_0x561a('0x37')]));if(_0x16b827['retry']===0x0){return this[_0x561a('0xaa')](_0x16b827);}_0x16b827[_0x561a('0xa9')]-=0x1;if(!this[_0x561a('0x89')](_0x16b827[_0x561a('0x111')])){return this[_0x561a('0x39')]['error'](_0x16b827,_0x561a('0x112'));}var _0x292595=this[_0x561a('0x1c')][_0x561a('0x73')](this,_0x16b827[_0x561a('0x111')]);if(!_0x292595){return this['channel']['error'](_0x16b827,_0x561a('0x113'));}var _0x21c04e=this['channel'][_0x561a('0x114')](_0x292595,_0x16b827[_0x561a('0x115')],_0x16b827[_0x561a('0x168')]);var _0x30e862=_0x21c04e[_0x561a('0xa7')];if(_0x21c04e[_0x561a('0xa7')]===-0x1){this[_0x561a('0x35')]['sync'](this,_0x16b827,'-1');return _0x21c04e;}else if(_0x21c04e[_0x561a('0xa5')]===_0x561a('0x66')){_0x21c04e[_0x561a('0xa7')]=_0x21c04e[_0x561a('0xa7')][_0x561a('0x9e')]>0x0?_0x21c04e['result']:'t';}else if(_['isEmpty'](_0x21c04e[_0x561a('0xa7')])){_0x21c04e[_0x561a('0xa7')]='#';_0x30e862='#';}if(!this[_0x561a('0x89')](_0x16b827[_0x561a('0xdb')])){this[_0x561a('0x39')][_0x561a('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3fa6d9=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x16b827[_0x561a('0xdb')]);if(!_0x3fa6d9){return this['channel'][_0x561a('0x29')](_0x16b827,_0x561a('0xdd'));}this[_0x561a('0x39')][_0x561a('0xa2')](_0x3fa6d9,_0x30e862);}this[_0x561a('0x35')][_0x561a('0x73')](this,_0x16b827,_0x30e862);return _0x21c04e;};AGIVertices[_0x561a('0x11')]['noop']=function(_0x45d9d2){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x169'),_0x45d9d2[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0xac')](_0x45d9d2[_0x561a('0x16a')]||_0x45d9d2['label']);};AGIVertices['prototype'][_0x561a('0x16b')]=function(_0x37ab0f){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x37ab0f[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x37ab0f['findBy'])){return this[_0x561a('0x39')]['error'](_0x37ab0f,_0x561a('0x160'));}logger[_0x561a('0x2b')](util[_0x561a('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x561a('0x39')][_0x561a('0x50')],_0x37ab0f[_0x561a('0x159')]));var _0x140457=this[_0x561a('0x4c')][_0x561a('0x73')](this,_0x37ab0f[_0x561a('0x16c')]);var _0x172335=this['agentPause']['sync'](this,_0x37ab0f['findBy'],_0x140457);if(_0x172335){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x37ab0f[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x37ab0f['findBy']));return{'code':0xc8,'result':_0x561a('0x15c')};}else{logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x15d'),this['channel'][_0x561a('0x50')],_0x37ab0f['findBy']));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x15b'),this[_0x561a('0x39')]['callerid'],_0x37ab0f[_0x561a('0x159')]));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices[_0x561a('0x11')]['playback']=function(_0x2670b6){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x16d'),_0x2670b6['label']));if(!this['isConfigured'](_0x2670b6[_0x561a('0x111')])){return this['channel'][_0x561a('0x29')](_0x2670b6,_0x561a('0x112'));}var _0x4b3e35=this[_0x561a('0x1c')][_0x561a('0x73')](this,_0x2670b6['file_id']);if(!_0x4b3e35){return this['channel'][_0x561a('0x29')](_0x2670b6,_0x561a('0x113'));}var _0xa72dba=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x16e'),[_0x4b3e35,_0x2670b6[_0x561a('0xe5')]]);if(_0xa72dba[_0x561a('0xa7')]===-0x1){return _0xa72dba;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),_0x561a('0x16e'),_0x4b3e35));};AGIVertices[_0x561a('0x11')][_0x561a('0x16f')]=function(_0x477664){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x477664[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x477664[_0x561a('0x170')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x477664,_0x561a('0x171'));}var _0xf915c3='';var _0x41c280=parseInt(_0x477664[_0x561a('0x170')],0xa);if(isNaN(_0x41c280)){_0xf915c3=_0x477664[_0x561a('0x170')];}else{_0xf915c3=this[_0x561a('0x172')]['sync'](this,_0x477664[_0x561a('0x170')]);if(!_0xf915c3){return this[_0x561a('0x39')]['error'](_0x477664,'no\x20queue\x20found');}}var _0x155c72='';if(this['isConfigured'](_0x477664['file_id'])){var _0x3cec7a=this[_0x561a('0x1c')]['sync'](this,_0x477664[_0x561a('0x111')]);if(_0x3cec7a){_0x155c72=_0x3cec7a;}}this[_0x561a('0x35')][_0x561a('0x73')](this,_0x477664,_0xf915c3);if(_0x477664[_0x561a('0xe5')][_0x561a('0x173')]('x')<0x0){_0x477664[_0x561a('0xe5')]+='x';}if(_0x477664['opts']['indexOf']('X')<0x0){_0x477664[_0x561a('0xe5')]+='X';}this[_0x561a('0x39')][_0x561a('0xa2')](_0x561a('0x174'),_0xf915c3?_0xf915c3[_0x561a('0x175')]():'');var _0x4226f4=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x176'),[_0xf915c3,_0x477664[_0x561a('0xe5')],_0x477664[_0x561a('0x76')],_0x155c72,_0x477664[_0x561a('0x66')],_0x477664['agi'],_0x477664[_0x561a('0x177')],_0x477664[_0x561a('0x178')],'',_0x477664[_0x561a('0x179')]]);if(_0x4226f4[_0x561a('0xa7')]===-0x1){return _0x4226f4;}return this['channel'][_0x561a('0xac')](util['format'](_0x561a('0xc7'),'QUEUE',_0xf915c3));};AGIVertices[_0x561a('0x11')][_0x561a('0x17a')]=function(_0x4aa9f3){logger[_0x561a('0x2b')](util['format'](_0x561a('0x17b'),_0x4aa9f3['label']));var _0x5323ff=_0x4aa9f3[_0x561a('0x17c')]||_0x561a('0x132');var _0x82e124=util[_0x561a('0x26')](_0x561a('0x17d'),this[_0x561a('0x39')][_0x561a('0x36')],rs[_0x561a('0x11a')](0x5));var _0x11999e=util['format'](_0x561a('0x17e'),FILES_PATH,_0x82e124,_0x5323ff);var _0x2904c2=util['format'](_0x561a('0x133'),FILES_PATH,_0x82e124);this[_0x561a('0x3a')][_0x561a('0x73')](this,_0x4aa9f3,_0x82e124,_0x11999e);this['channel']['setVariable']('RECORDING_SAVENAME',_0x82e124);logger[_0x561a('0x2b')](_0x561a('0x17f'),_0x2904c2,_0x5323ff,_0x4aa9f3['escape_digits'],_0x4aa9f3[_0x561a('0x66')]);return this[_0x561a('0x39')][_0x561a('0x13e')](_0x2904c2,_0x5323ff,_0x4aa9f3['escape_digits'],_0x4aa9f3[_0x561a('0x66')],undefined,!![]);};AGIVertices[_0x561a('0x11')][_0x561a('0x180')]=function(_0x50e3f5){logger['info'](util[_0x561a('0x26')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x50e3f5[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x50e3f5[_0x561a('0x76')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x181'));}var _0x425d96=this[_0x561a('0x182')][_0x561a('0x73')](this,_0x50e3f5);logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x183'),util[_0x561a('0x184')](_0x425d96,{'showHidden':![],'depth':null})));if(!this[_0x561a('0x89')](_0x50e3f5[_0x561a('0xdb')])){return this['channel'][_0x561a('0xac')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0xa88469=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x50e3f5[_0x561a('0xdb')]);if(!_0xa88469){return this[_0x561a('0x39')][_0x561a('0x29')](_0x50e3f5,_0x561a('0xdd'));}this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')]('%s_STATUS_CODE',_0xa88469),_0x425d96[_0x561a('0x79')]?_0x425d96[_0x561a('0x79')]:'200');this[_0x561a('0x39')][_0x561a('0xa2')](util[_0x561a('0x26')](_0x561a('0x185'),_0xa88469),_0x425d96[_0x561a('0x7a')]?_0x425d96[_0x561a('0x7a')]:'OK');if(_0x425d96[_0x561a('0x6c')]){try{this[_0x561a('0xa0')](_0x425d96[_0x561a('0x6c')],_0xa88469);}catch(_0x63f06f){logger[_0x561a('0x29')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xa88469));}}return this[_0x561a('0x39')]['noop'](util[_0x561a('0x26')]('variable\x20%s\x20set',_0xa88469));};AGIVertices[_0x561a('0x11')]['saydigits']=function(_0x1b91a6){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x1b91a6[_0x561a('0x37')]));return this['channel'][_0x561a('0x186')](_0x1b91a6['digits']['replace'](/\s+/g,''),_0x1b91a6[_0x561a('0x187')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x188')]=function(_0x191ef5){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x189'),_0x191ef5[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x18a')](_0x191ef5['number'][_0x561a('0x5a')](/\s+/g,''),_0x191ef5['escape_digits']);};AGIVertices[_0x561a('0x11')][_0x561a('0x18b')]=function(_0x2768bf){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x2768bf[_0x561a('0x37')]));return this[_0x561a('0x39')][_0x561a('0x18c')](_0x2768bf[_0x561a('0x5d')],_0x2768bf['escape_digits']);};AGIVertices['prototype'][_0x561a('0x18d')]=function(_0x131209){logger[_0x561a('0x2b')](util['format'](_0x561a('0x18e'),_0x131209['label']));if(!this[_0x561a('0x89')](_0x131209[_0x561a('0x18f')])){return this[_0x561a('0x39')][_0x561a('0xac')]('no\x20mail\x20account\x20configured');}var _0x3286ab=this[_0x561a('0x20')][_0x561a('0x73')](this,_0x131209['account_id']);if(!_0x3286ab||!_0x3286ab[_0x561a('0x190')]){return this[_0x561a('0x39')][_0x561a('0x29')](_0x131209,_0x561a('0x191'));}var _0x2eafda={'from':util['format'](_0x561a('0x192'),_0x3286ab[_0x561a('0x15')],_0x3286ab[_0x561a('0x193')]||_0x3286ab[_0x561a('0x190')][_0x561a('0x194')]),'to':_0x131209['to']||'','cc':_0x131209['cc']||'','bcc':_0x131209[_0x561a('0x195')]||'','subject':_0x131209[_0x561a('0x196')],'html':_0x131209[_0x561a('0x5d')],'text':_0x131209[_0x561a('0x5d')]};if(this[_0x561a('0x89')](_0x131209[_0x561a('0x197')])){}logger[_0x561a('0xe1')]('sendMail\x20message',JSON[_0x561a('0x77')](_0x2eafda));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x131209,_0x131209[_0x561a('0x18f')]);this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x198'),_0x3286ab[_0x561a('0x15')]));this['sendMailMessage'][_0x561a('0x73')](this,_0x3286ab['smtpOptions'],_0x2eafda);return this['channel'][_0x561a('0xac')](_0x561a('0x199'));};AGIVertices[_0x561a('0x11')][_0x561a('0x19a')]=function(_0x19b5ad){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x19b5ad[_0x561a('0x37')]));return this['channel'][_0x561a('0xac')](_0x561a('0x19b'));};AGIVertices[_0x561a('0x11')]['sendSMS']=function(_0x393674){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x393674[_0x561a('0x37')]));if(!this['isConfigured'](_0x393674[_0x561a('0x19c')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0x19d'));}var _0x2ea0db=this[_0x561a('0x32')][_0x561a('0x73')](this,_0x393674[_0x561a('0x19c')]);if(!_0x2ea0db){return this[_0x561a('0x39')]['error'](_0x393674,_0x561a('0x19e'));}var _0x2869d8={'body':_0x393674[_0x561a('0x19f')],'phone':_0x393674['to']||'','SmsAccountId':_0x2ea0db['id']};logger[_0x561a('0xe1')](_0x561a('0x1a0'),JSON[_0x561a('0x77')](_0x2869d8));this[_0x561a('0x35')][_0x561a('0x73')](this,_0x393674,_0x393674[_0x561a('0x19c')]);this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x1a1'),_0x2ea0db['name']));this['createSmsMessage'][_0x561a('0x73')](this,_0x2869d8);return this['channel'][_0x561a('0xac')](_0x561a('0x1a2'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1a3')]=function(_0x53a503){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x1a4'),_0x53a503[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x53a503[_0x561a('0xdb')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x53a503,_0x561a('0x1a5'));}var _0x15c6b1=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x53a503['variable_id']);if(!_0x15c6b1){return this[_0x561a('0x39')][_0x561a('0x29')](_0x53a503,_0x561a('0xdd'));}return this['channel'][_0x561a('0xa2')](_0x15c6b1,_0x53a503[_0x561a('0x1a6')]);};AGIVertices[_0x561a('0x11')][_0x561a('0x1a7')]=function(_0xdb8e3c){logger[_0x561a('0x2b')](util[_0x561a('0x26')](_0x561a('0x1a8'),_0xdb8e3c[_0x561a('0x37')]));this[_0x561a('0x39')][_0x561a('0xac')]('START\x20CALLY\x20SQUARE');if(_0xdb8e3c[_0x561a('0xbd')]===_0x561a('0x1a9')){this[_0x561a('0x39')]['noop'](_0x561a('0x1aa'));return this[_0x561a('0x39')]['answer']();}return this['channel'][_0x561a('0xac')](_0x561a('0x1ab'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1ac')]=function(_0x2653fb){logger[_0x561a('0x2b')](util['format'](_0x561a('0x1ad'),_0x2653fb[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x2653fb['project_id'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,'no\x20subproject\x20selected');}var _0x13e0d4=this[_0x561a('0x18')]['sync'](this,_0x2653fb[_0x561a('0x1ae')]);if(!this[_0x561a('0x89')](_0x13e0d4)){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,util[_0x561a('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2653fb[_0x561a('0x1ae')]));}if(_0x13e0d4===this['channel'][_0x561a('0x3f')]){return this[_0x561a('0x39')][_0x561a('0x29')](_0x2653fb,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x561a('0x35')]['sync'](this,_0x2653fb,_0x13e0d4);var _0x24e078=this[_0x561a('0x39')][_0x561a('0x58')]('AGI',util[_0x561a('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x561a('0x6')][_0x561a('0x1af')]||_0x561a('0x1b0'),_0x13e0d4,this[_0x561a('0x39')][_0x561a('0x3f')]));if(_0x24e078['result']===-0x1){return _0x24e078;}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),'AGI',_0x13e0d4));};AGIVertices[_0x561a('0x11')]['system']=function(_0xef83ad){logger['info'](util[_0x561a('0x26')](_0x561a('0x1b1'),_0xef83ad['label']));var _0x2486b0=this[_0x561a('0x57')][_0x561a('0x73')](this,_0xef83ad[_0x561a('0xbb')]);this['createSquareDetailsReport'][_0x561a('0x73')](this,_0xef83ad,_0xef83ad[_0x561a('0xbb')]);if(this[_0x561a('0x89')](_0xef83ad[_0x561a('0xdb')])){var _0x12dd49=this[_0x561a('0x12')]['sync'](this,_0xef83ad[_0x561a('0xdb')]);if(_0x12dd49){this[_0x561a('0x39')][_0x561a('0xa2')](_0x12dd49,_0x2486b0);return this['channel'][_0x561a('0xac')](util['format'](_0x561a('0x1b2'),_0xef83ad['command'],_0x12dd49));}}return this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0x1b3'),_0xef83ad[_0x561a('0xbb')]));};AGIVertices[_0x561a('0x11')][_0x561a('0x1b4')]=function(_0x2ec8f0){logger['info'](util['format'](_0x561a('0x1b5'),_0x2ec8f0[_0x561a('0x37')]));_0x2ec8f0[_0x561a('0x5d')]=_0x2ec8f0['text'][_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2ec8f0[_0x561a('0x1b6')])){return this['channel'][_0x561a('0xac')](_0x561a('0x1b7'));}if(!this[_0x561a('0x89')](_0x2ec8f0[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this[_0x561a('0x39')][_0x561a('0xac')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2ec8f0[_0x561a('0x5d')]));var _0xc1d490=this[_0x561a('0x5b')]['sync'](this,_0x2ec8f0);if(_0xc1d490){this[_0x561a('0x39')][_0x561a('0xac')](util['format'](_0x561a('0x1b8'),_0xc1d490));var _0x4c5c51=this[_0x561a('0x39')][_0x561a('0x102')](_0xc1d490);try{fs[_0x561a('0x125')](_0xc1d490+_0x561a('0x103'));}catch(_0x84d2e5){logger[_0x561a('0x29')](_0x84d2e5);}return _0x4c5c51;}return this[_0x561a('0x39')][_0x561a('0x29')](_0x2ec8f0,_0x561a('0x1b9'));};AGIVertices[_0x561a('0x11')][_0x561a('0x1ba')]=function(_0x1ebca8){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1ebca8[_0x561a('0x37')]));_0x1ebca8[_0x561a('0x5d')]=_0x1ebca8[_0x561a('0x5d')][_0x561a('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x561a('0x89')](_0x1ebca8[_0x561a('0x5d')])){return this[_0x561a('0x39')][_0x561a('0xac')](_0x561a('0xad'));}this['channel']['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1ebca8[_0x561a('0x5d')]));var _0x1d9f46=this[_0x561a('0x63')][_0x561a('0x73')](this,_0x1ebca8);if(_0x1d9f46){this['channel'][_0x561a('0xac')](util['format'](_0x561a('0x1bb'),_0x1d9f46));var _0x3e90b8=this[_0x561a('0x39')][_0x561a('0x102')](_0x1d9f46);try{fs[_0x561a('0x125')](_0x1d9f46+_0x561a('0x103'));}catch(_0x2ea3e8){logger[_0x561a('0x29')](_0x2ea3e8);}return _0x3e90b8;}return this[_0x561a('0x39')][_0x561a('0x29')](_0x1ebca8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x561a('0x11')][_0x561a('0x1bc')]=function(_0x32a242){logger['info'](util[_0x561a('0x26')](_0x561a('0x1bd'),_0x32a242[_0x561a('0x37')]));if(!this['isConfigured'](_0x32a242[_0x561a('0x159')])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x32a242,'no\x20find\x20by\x20configured');}logger['info'](util[_0x561a('0x26')](_0x561a('0x15a'),this['channel'][_0x561a('0x50')],_0x32a242['findBy']));var _0x402bc7=this[_0x561a('0x51')][_0x561a('0x73')](this,_0x32a242[_0x561a('0x159')]);if(_0x402bc7){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x561a('0x50')],_0x32a242[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x32a242[_0x561a('0x159')]));return{'code':0xc8,'result':'success'};}else{logger[_0x561a('0x2b')](util['format'](_0x561a('0x15d'),this['channel'][_0x561a('0x50')],_0x32a242[_0x561a('0x159')]));this[_0x561a('0x39')][_0x561a('0xac')](util[_0x561a('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x561a('0x39')][_0x561a('0x50')],_0x32a242['findBy']));return{'code':0xc8,'result':_0x561a('0x15e')};}};AGIVertices['prototype'][_0x561a('0x1be')]=function(_0x147096){logger[_0x561a('0x2b')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x147096['label']));var _0x3ebbb4=this[_0x561a('0x39')][_0x561a('0x58')](_0x561a('0x1bf'),[_0x147096['mailbox'],_0x147096['options']]);if(_0x3ebbb4[_0x561a('0xa7')]===-0x1){return _0x3ebbb4;}return this['channel'][_0x561a('0xac')](util[_0x561a('0x26')](_0x561a('0xc7'),_0x561a('0x1bf'),_0x147096[_0x561a('0x1c0')]));};AGIVertices['prototype']['vswitch']=function(_0x4d2b55){logger[_0x561a('0x2b')](util[_0x561a('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4d2b55[_0x561a('0x37')]));if(!this[_0x561a('0x89')](_0x4d2b55['variable_id'])){return this[_0x561a('0x39')][_0x561a('0x29')](_0x4d2b55,_0x561a('0x1a5'));}var _0x3f649c=this[_0x561a('0x12')][_0x561a('0x73')](this,_0x4d2b55['variable_id']);if(!_0x3f649c){return this[_0x561a('0x39')][_0x561a('0x29')](_0x4d2b55,'no\x20variable\x20found');}var _0x35c22a=this[_0x561a('0x39')][_0x561a('0x12')](_0x3f649c);return{'code':0xc8,'result':_0x35c22a[_0x561a('0xa5')]?_0x35c22a[_0x561a('0xa5')]:'-'};};String[_0x561a('0x11')]['replaceAll']=function(_0x1eca19,_0x442ac4){return this[_0x561a('0xa3')](_0x1eca19)[_0x561a('0x1c1')](_0x442ac4);};module[_0x561a('0x1c2')]=AGIVertices; \ No newline at end of file +var _0x2182=['keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','speech','dialogflow','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','setVariable','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','file_id','no\x20file\x20audio\x20selected','getSound','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','generate','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20intervals\x20found','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','ispeechASR','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','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','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','escape_digits','restapi','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','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','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','template_id','account_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','debug','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','host','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','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','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','split','join','exports','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','key','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','replaceAll','extra','getAndSetVariable','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach'];(function(_0x5e1a3e,_0xaf5f51){var _0x3a04b4=function(_0x5361a0){while(--_0x5361a0){_0x5e1a3e['push'](_0x5e1a3e['shift']());}};_0x3a04b4(++_0xaf5f51);}(_0x2182,0xea));var _0x2218=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2182[_0x3bf83f];return _0x22c4a9;};'use strict';var fs=require('fs');var util=require(_0x2218('0x0'));var _=require(_0x2218('0x1'));var sh=require(_0x2218('0x2'));var odbc=require(_0x2218('0x3'))();var rs=require('randomstring');var moment=require(_0x2218('0x4'));var Mustache=require('mustache');var rp=require(_0x2218('0x5'));var logger=require(_0x2218('0x6'))(_0x2218('0x7'));var config=require(_0x2218('0x8'));var shared=require(_0x2218('0x9'));var scripts=require(_0x2218('0xa'));var FILES_PATH=_0x2218('0xb');var recursiveMapAttributes=[_0x2218('0xc'),_0x2218('0xd')];var verticesWithRetry=[_0x2218('0xe'),'getdigits',_0x2218('0xf')];var AGIVertices=function(_0xed1f79,_0x15f490,_0x5bd041){this['channel']=_0xed1f79;this[_0x2218('0x10')]=_0x15f490;this[_0x2218('0x11')]=_0x5bd041;};AGIVertices[_0x2218('0x12')][_0x2218('0x13')]=function(_0x5a2a8d,_0x299c34){this[_0x2218('0x10')][_0x2218('0x14')](_0x5a2a8d)[_0x2218('0x15')](function(_0x2a0b55){_0x299c34(null,_0x2a0b55?_0x2a0b55['name']:![]);})[_0x2218('0x16')](function(_0x5d7d24){_0x299c34(_0x5d7d24);});};AGIVertices[_0x2218('0x12')][_0x2218('0x17')]=function(_0x383a56,_0x2b953a){this[_0x2218('0x10')][_0x2218('0x18')](_0x383a56)[_0x2218('0x15')](function(_0x2cbd55){_0x2b953a(null,_0x2cbd55?_0x2cbd55[_0x2218('0x19')]:![]);})[_0x2218('0x16')](function(_0x466d80){_0x2b953a(_0x466d80);});};AGIVertices[_0x2218('0x12')][_0x2218('0x1a')]=function(_0x3554fd,_0x21a612){this[_0x2218('0x10')][_0x2218('0x1b')](_0x3554fd)[_0x2218('0x15')](function(_0x1c83ea){_0x21a612(null,_0x1c83ea?_0x1c83ea[_0x2218('0x19')]:![]);})[_0x2218('0x16')](function(_0x58fe42){_0x21a612(_0x58fe42);});};AGIVertices[_0x2218('0x12')][_0x2218('0x1c')]=function(_0x2989f0,_0x40fc8d){this[_0x2218('0x10')][_0x2218('0x1d')](_0x2989f0)[_0x2218('0x15')](function(_0x4533c2){_0x40fc8d(null,_0x4533c2?_0x4533c2[_0x2218('0x1e')]:![]);})[_0x2218('0x16')](function(_0x2cee53){_0x40fc8d(_0x2cee53);});};AGIVertices[_0x2218('0x12')][_0x2218('0x1f')]=function(_0x439e5d,_0x11a2be){this[_0x2218('0x10')][_0x2218('0x20')](_0x439e5d)[_0x2218('0x15')](function(_0x4947a3){_0x11a2be(null,_0x4947a3?_0x4947a3[_0x2218('0x19')]:![]);})[_0x2218('0x16')](function(_0x980f15){_0x11a2be(_0x980f15);});};AGIVertices['prototype']['getTrunk']=function(_0x123996,_0x13246c){this['rpc'][_0x2218('0x21')](_0x123996)['then'](function(_0x44f352){_0x13246c(null,_0x44f352?_0x44f352[_0x2218('0x19')]:![]);})[_0x2218('0x16')](function(_0x65a513){_0x13246c(_0x65a513);});};AGIVertices['prototype']['getSound']=function(_0x10f1ff,_0x316651){var _0xcbe144=this;this[_0x2218('0x10')]['getSoundById'](_0x10f1ff)['then'](function(_0x4c211d){_0x316651(null,_0x4c211d?_0xcbe144['getSoundPath'](_0x4c211d[_0x2218('0x22')]):![]);})[_0x2218('0x16')](function(_0xac2931){_0x316651(_0xac2931);});};AGIVertices[_0x2218('0x12')][_0x2218('0x23')]=function(_0x45ba98,_0x2f3f1f){this[_0x2218('0x10')][_0x2218('0x24')](_0x45ba98)[_0x2218('0x15')](function(_0x2c1dfc){_0x2f3f1f(null,_0x2c1dfc?_0x2c1dfc:![]);})[_0x2218('0x16')](function(_0x31d347){_0x2f3f1f(_0x31d347);});};AGIVertices[_0x2218('0x12')][_0x2218('0x25')]=function(_0x2f92f0,_0x321a5e,_0x1004ff){this[_0x2218('0x11')]['sendMailMessage'](_0x2f92f0,_0x321a5e)[_0x2218('0x15')](function(){_0x1004ff(null);})[_0x2218('0x16')](function(_0x1e326f){_0x1004ff(_0x1e326f);});};AGIVertices['prototype'][_0x2218('0x26')]=function(_0x17d9cd,_0x14afeb){this[_0x2218('0x10')][_0x2218('0x27')](_0x17d9cd)[_0x2218('0x15')](function(_0x30164d){if(_0x30164d){if(_0x30164d[_0x2218('0x28')]){_0x14afeb(null,[_0x30164d[_0x2218('0x29')]]);}else{_0x14afeb(null,_['map'](_0x30164d[_0x2218('0x2a')],_0x2218('0x29')));}}else{_0x14afeb(null,![]);}})[_0x2218('0x16')](function(_0x54fb7a){_0x14afeb(_0x54fb7a);});};AGIVertices[_0x2218('0x12')][_0x2218('0x2b')]=function(_0x174256){return util[_0x2218('0x2c')](_0x2218('0x2d'),FILES_PATH,_0x174256);};AGIVertices[_0x2218('0x12')][_0x2218('0x2e')]=function(_0x1629f4,_0x100fee,_0x4f9a62){odbc[_0x2218('0x2f')](_0x1629f4,function(_0x2e45db){if(_0x2e45db){logger['error'](_0x2218('0x30'),_0x2e45db);_0x4f9a62(_0x2e45db);}else{logger[_0x2218('0x31')](_0x2218('0x32'));odbc['query'](_0x100fee,function(_0x4c89d0,_0x5230cb){if(_0x4c89d0){logger['info'](_0x2218('0x33'),_0x100fee);_0x4f9a62(_0x4c89d0);}else{logger[_0x2218('0x31')](_0x2218('0x34'),_0x100fee);odbc[_0x2218('0x35')](function(_0x353a97){if(_0x353a97){logger[_0x2218('0x36')](_0x2218('0x37'),_0x353a97);}_0x4f9a62(null,_0x5230cb);});}});}});};AGIVertices['prototype'][_0x2218('0x38')]=function(_0x2926bf,_0x12435b){this[_0x2218('0x10')]['getSmsAccountById'](_0x2926bf)[_0x2218('0x15')](function(_0x2a4350){_0x12435b(null,_0x2a4350?_0x2a4350:![]);})[_0x2218('0x16')](function(_0x2978e3){_0x12435b(_0x2978e3);});};AGIVertices['prototype']['createSmsMessage']=function(_0x5cb17a,_0x4bd948){this[_0x2218('0x10')][_0x2218('0x39')](_0x5cb17a)[_0x2218('0x15')](function(_0x1edab0){_0x4bd948(null,_0x1edab0);})[_0x2218('0x16')](function(_0x4d0e76){_0x4bd948(_0x4d0e76);});};AGIVertices['prototype'][_0x2218('0x3a')]=function(_0x3e44e9,_0x2b773a,_0x4646c0){this['rpc'][_0x2218('0x3a')]({'uniqueid':this[_0x2218('0x3b')][_0x2218('0x3c')],'node':_0x3e44e9[_0x2218('0x3d')],'application':_0x3e44e9[_0x2218('0x3e')],'data':_0x2b773a||null,'project_name':this[_0x2218('0x3b')][_0x2218('0x3f')],'callerid':this['channel'][_0x2218('0x40')]})['then'](function(_0x18025d){if(_0x4646c0){_0x4646c0(null,_0x18025d);}})[_0x2218('0x16')](function(_0x569175){if(_0x4646c0){_0x4646c0(_0x569175);}});};AGIVertices['prototype'][_0x2218('0x41')]=function(_0x152ced,_0x3a870d,_0x479072,_0x4e3bcb){this[_0x2218('0x10')][_0x2218('0x41')]({'uniqueid':this[_0x2218('0x3b')]['uniqueid'],'callerid':this[_0x2218('0x3b')][_0x2218('0x40')],'calleridname':this[_0x2218('0x3b')][_0x2218('0x42')],'context':this[_0x2218('0x3b')][_0x2218('0x43')],'extension':this[_0x2218('0x3b')]['extension'],'priority':this['channel'][_0x2218('0x44')],'accountcode':this[_0x2218('0x3b')][_0x2218('0x45')],'dnid':this[_0x2218('0x3b')][_0x2218('0x46')],'projectName':this[_0x2218('0x3b')]['arg_1'],'saveName':_0x3a870d,'filename':_0x152ced[_0x2218('0x47')]||_0x3a870d,'savePath':_0x479072})[_0x2218('0x15')](function(_0x2ac9d7){_0x4e3bcb(null,_0x2ac9d7);})['catch'](function(_0x4da7f4){_0x4e3bcb(_0x4da7f4);});};AGIVertices[_0x2218('0x12')][_0x2218('0x48')]=function(_0x19d255,_0x2ebddf,_0x3bcfd9,_0x3f2fc8,_0x5d90f7){this['rpc'][_0x2218('0x48')]({'uniqueid':this['channel'][_0x2218('0x3c')],'body':_0x19d255,'direction':_0x2ebddf,'providerName':_0x3bcfd9,'providerResponse':_0x3f2fc8})[_0x2218('0x15')](function(_0x53d8e4){if(_0x5d90f7){_0x5d90f7(null,_0x53d8e4);}})[_0x2218('0x16')](function(_0x4995a9){if(_0x5d90f7){_0x5d90f7(_0x4995a9);}});};AGIVertices['prototype'][_0x2218('0x49')]=function(_0xc0106e,_0x230a03){this[_0x2218('0x10')]['createCmContact']({'firstName':_[_0x2218('0x4a')](_0xc0106e[_0x2218('0x19')])||_['isNil'](_0xc0106e[_0x2218('0x19')])?_0x2218('0x4b')+Math[_0x2218('0x4c')]():_0xc0106e[_0x2218('0x19')],'lastName':_['isEmpty'](_0xc0106e[_0x2218('0x4d')])||_['isNil'](_0xc0106e[_0x2218('0x4d')])?null:_0xc0106e['lastName'],'phone':_0xc0106e[_0x2218('0x4e')],'ListId':_0xc0106e[_0x2218('0x4f')],'scheduledat':_0xc0106e[_0x2218('0x50')],'callbackUniqueid':this['channel'][_0x2218('0x3c')],'tags':'callback','description':_0x2218('0x51')+_0xc0106e['scheduledAt'][_0x2218('0x52')](),'priority':_0xc0106e[_0x2218('0x53')]})[_0x2218('0x15')](function(_0x803f21){_0x230a03(null,_0x803f21);})[_0x2218('0x16')](function(_0x273a43){_0x230a03(_0x273a43);});};AGIVertices[_0x2218('0x12')]['getPause']=function(_0x30066e,_0x5c53ff){this[_0x2218('0x10')][_0x2218('0x54')](_0x30066e)[_0x2218('0x15')](function(_0x3f2397){_0x5c53ff(null,_0x3f2397?_0x3f2397[_0x2218('0x19')]:![]);})[_0x2218('0x16')](function(_0x5a80c2){_0x5c53ff(_0x5a80c2);});};AGIVertices['prototype'][_0x2218('0x55')]=function(_0x2ac01f,_0x2bebe7,_0x317d90){var _0x2b05c5={'role':_0x2218('0x56')};_0x2b05c5[_0x2ac01f]=this[_0x2218('0x3b')][_0x2218('0x40')];this['rpc'][_0x2218('0x55')](_0x2b05c5,_0x2bebe7,this[_0x2218('0x3b')][_0x2218('0x3c')])[_0x2218('0x15')](function(_0x409c6b){_0x317d90(null,_[_0x2218('0x57')](_0x409c6b)?![]:!![]);})[_0x2218('0x16')](function(_0x1486c2){logger[_0x2218('0x36')](_0x1486c2);_0x317d90(null,![]);});};AGIVertices[_0x2218('0x12')][_0x2218('0x58')]=function(_0x2db29d,_0x56c5fb){var _0x423c8c={'role':_0x2218('0x56')};_0x423c8c[_0x2db29d]=this[_0x2218('0x3b')][_0x2218('0x40')];this['rpc']['agentUnpause'](_0x423c8c)['then'](function(_0x3613ce){_0x56c5fb(null,_[_0x2218('0x57')](_0x3613ce)?![]:!![]);})[_0x2218('0x16')](function(_0x185266){logger[_0x2218('0x36')](_0x185266);_0x56c5fb(null,![]);});};AGIVertices[_0x2218('0x12')][_0x2218('0x59')]=function(_0x343bc7,_0x58fc66){var _0x2266d1={'role':_0x2218('0x56')};_0x2266d1[_0x343bc7]=this[_0x2218('0x3b')][_0x2218('0x40')];this[_0x2218('0x10')][_0x2218('0x59')](_0x2266d1)[_0x2218('0x15')](function(_0x15f59b){_0x58fc66(null,_['isNil'](_0x15f59b)?![]:!![]);})[_0x2218('0x16')](function(_0x177420){logger['error'](_0x177420);_0x58fc66(null,![]);});};AGIVertices[_0x2218('0x12')][_0x2218('0x5a')]=function(_0x59545e,_0x4cf6fc){var _0x2beb12={'role':_0x2218('0x56')};_0x2beb12[_0x59545e]=this[_0x2218('0x3b')]['callerid'];var _0x206537=_0x59545e!=_0x2218('0x5b')?util[_0x2218('0x2c')](_0x2218('0x5c'),_0x2218('0x5d'),this['channel'][_0x2218('0x40')]):undefined;this[_0x2218('0x10')][_0x2218('0x5a')](_0x2beb12,_0x206537)['then'](function(_0xe2245f){_0x4cf6fc(null,_[_0x2218('0x57')](_0xe2245f)?![]:!![]);})[_0x2218('0x16')](function(_0x5e8c26){logger['error'](_0x5e8c26);_0x4cf6fc(null,![]);});};AGIVertices[_0x2218('0x12')][_0x2218('0x5e')]=function(_0x5e4a6c,_0x44aa53){sh[_0x2218('0x5f')](_[_0x2218('0x60')](_0x5e4a6c),function(_0x5a7f6d,_0x3116ad){var _0xac5205=_0x3116ad[_0x2218('0x61')](/(\r\n|\n|\r)/gm,'');_0x44aa53(null,_0xac5205);});};AGIVertices['prototype'][_0x2218('0x62')]=function(_0x240480,_0x531881){scripts[_0x2218('0x62')](_0x240480['apiKey'],_0x240480['google_cloud_tts_text_type']||'text',_0x240480[_0x2218('0x63')],_0x240480[_0x2218('0x64')]||_0x2218('0x65'),_0x240480[_0x2218('0x66')]||_0x2218('0x67'),_0x240480['audioEncoding']||_0x2218('0x68'))[_0x2218('0x15')](function(_0x3a5ebd){_0x531881(null,_0x3a5ebd);})[_0x2218('0x16')](function(_0x3bfb8e){_0x531881(_0x3bfb8e);});};AGIVertices[_0x2218('0x12')][_0x2218('0x69')]=function(_0x27183b,_0x266000){scripts[_0x2218('0x69')](_0x27183b[_0x2218('0x63')],_0x27183b[_0x2218('0x6a')]||'en',0x1)['then'](function(_0x285eb2){_0x266000(null,_0x285eb2);})[_0x2218('0x16')](function(_0x5c7e45){_0x266000(_0x5c7e45);});};AGIVertices[_0x2218('0x12')][_0x2218('0x6b')]=function(_0x5688e4,_0x5ee514){var _0xe16190={'uri':_0x5688e4[_0x2218('0x6c')],'method':_0x5688e4[_0x2218('0x6d')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5688e4[_0x2218('0x6e')])===_0x2218('0x6f')&&parseInt(_0x5688e4['timeout'])>=0x1?parseInt(_0x5688e4['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x2218('0x70')](['POST',_0x2218('0x71')],_0xe16190[_0x2218('0x6d')][_0x2218('0x72')]())){try{_0xe16190['body']=_0x5688e4[_0x2218('0xd')]?JSON[_0x2218('0x73')](_0x5688e4[_0x2218('0xd')]):{};}catch(_0x1be7dd){logger[_0x2218('0x36')](_0x2218('0x74'),_0x1be7dd);}}try{_0xe16190[_0x2218('0x75')]=_0x5688e4[_0x2218('0xc')]?JSON[_0x2218('0x73')](_0x5688e4[_0x2218('0xc')]):{};}catch(_0x396d66){logger[_0x2218('0x36')](_0x2218('0x76'),_0x396d66);}if(_0x5688e4[_0x2218('0x77')]){try{var _0xe01ca4=require(_0x5688e4['computedVariables'])[_0x2218('0x78')](this,_0xe16190);_0xe16190[_0x2218('0x79')]=Mustache[_0x2218('0x7a')](_0x5688e4[_0x2218('0x6c')],_0xe01ca4,{},['$$','$$']);if(_0xe16190[_0x2218('0x75')]){_0xe16190[_0x2218('0x75')]=JSON['parse'](Mustache[_0x2218('0x7a')](JSON[_0x2218('0x7b')](_0xe16190[_0x2218('0x75')]),_0xe01ca4,{},['$$','$$']));}if(_0xe16190[_0x2218('0x7c')]){_0xe16190[_0x2218('0x7c')]=JSON[_0x2218('0x73')](Mustache[_0x2218('0x7a')](JSON[_0x2218('0x7b')](_0xe16190[_0x2218('0x7c')]),_0xe01ca4,{},['$$','$$']));}}catch(_0x1eda49){logger['error'](_0x2218('0x7d'),_0x1eda49);}}rp(_0xe16190)['then'](function(_0x14685b){var _0x1756b6={'statusCode':_0x14685b[_0x2218('0x7e')]||0xc8,'statusMessage':_0x14685b['statusMessage']||'OK','headers':_0x14685b[_0x2218('0x75')]||{},'body':_0x14685b[_0x2218('0x7c')]||{}};_0x5ee514(null,_0x1756b6);})[_0x2218('0x16')](function(_0x344c08){var _0xfa304b={'statusCode':_0x344c08[_0x2218('0x7e')]||0x1f4,'statusMessage':_0x344c08[_0x2218('0x7f')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x344c08[_0x2218('0x80')][_0x2218('0x75')]||{},'body':_0x344c08[_0x2218('0x80')]['body']||{}};_0x5ee514(null,_0xfa304b);});};AGIVertices['prototype']['googleDialogflow']=function(_0x1c2156,_0x4ab610){scripts['googleDialogflow'](this[_0x2218('0x3b')][_0x2218('0x3c')],_0x1c2156[_0x2218('0x81')],_0x1c2156[_0x2218('0x63')],_0x1c2156['dialogflow_language']||'en')[_0x2218('0x15')](function(_0x431c54){_0x4ab610(null,_0x431c54);})[_0x2218('0x16')](function(_0x1a4ef6){_0x4ab610(_0x1a4ef6);});};AGIVertices[_0x2218('0x12')][_0x2218('0x82')]=function(_0x3e7cc5,_0x3dd439){scripts[_0x2218('0x82')](this[_0x2218('0x3b')]['uniqueid'],_0x3e7cc5['dialogflowV2_project_id'],_0x3e7cc5[_0x2218('0x83')],_0x3e7cc5[_0x2218('0x84')],_0x3e7cc5[_0x2218('0x63')],_0x3e7cc5[_0x2218('0x85')]||'en')[_0x2218('0x15')](function(_0x3b8fca){_0x3dd439(null,_0x3b8fca);})['catch'](function(_0x41d8c8){_0x3dd439(_0x41d8c8);});};AGIVertices['prototype'][_0x2218('0x86')]=function(_0x237d8d,_0x34161d){scripts[_0x2218('0x86')](this[_0x2218('0x3b')],_0x237d8d)[_0x2218('0x15')](function(_0x3a6ca1){_0x34161d(null,_0x3a6ca1);})[_0x2218('0x16')](function(_0x3f9e33){_0x34161d(_0x3f9e33);});};AGIVertices['prototype'][_0x2218('0x87')]=function(_0x3a20bc,_0x479237){scripts['ispeechTTS'](_0x3a20bc[_0x2218('0x81')],_0x3a20bc[_0x2218('0x63')],_0x3a20bc[_0x2218('0x88')]||_0x2218('0x65'),_0x3a20bc[_0x2218('0x89')])['then'](function(_0x56e0e6){_0x479237(null,_0x56e0e6);})[_0x2218('0x16')](function(_0x5b69c5){_0x479237(_0x5b69c5);});};AGIVertices[_0x2218('0x12')]['ispeechASR']=function(_0x32f3bb,_0x18fe39,_0x2396f5){scripts['ispeechASR'](_0x18fe39,_0x32f3bb['key'],_0x32f3bb[_0x2218('0x8a')]||_0x2218('0x65'),this[_0x2218('0x8b')](_0x32f3bb[_0x2218('0x8c')])?_0x32f3bb[_0x2218('0x8c')]:undefined)['then'](function(_0x3f6914){_0x2396f5(null,_0x3f6914);})[_0x2218('0x16')](function(_0x2f5221){_0x2396f5(_0x2f5221);});};AGIVertices[_0x2218('0x12')][_0x2218('0x8d')]=function(_0x11972c,_0x255ca3){scripts['awsPolly'](_0x11972c['aws_access_key_id'],_0x11972c[_0x2218('0x8e')],_0x11972c['aws_polly_region'],_0x11972c[_0x2218('0x8f')]||'Amy',_0x11972c[_0x2218('0x63')],_0x11972c[_0x2218('0x90')]||_0x2218('0x63'))[_0x2218('0x15')](function(_0x32238b){_0x255ca3(null,_0x32238b);})[_0x2218('0x16')](function(_0x3860a7){_0x255ca3(_0x3860a7);});};AGIVertices[_0x2218('0x12')]['awsLex']=function(_0x3e4dcd,_0x1ad4d4){scripts[_0x2218('0x91')](this[_0x2218('0x3b')][_0x2218('0x3c')],_0x3e4dcd['aws_access_key_id'],_0x3e4dcd[_0x2218('0x8e')],_0x3e4dcd[_0x2218('0x92')],_0x3e4dcd[_0x2218('0x63')],_0x3e4dcd[_0x2218('0x93')])[_0x2218('0x15')](function(_0x139382){_0x1ad4d4(null,_0x139382);})['catch'](function(_0x473ef0){_0x1ad4d4(_0x473ef0);});};AGIVertices['prototype'][_0x2218('0x94')]=function(_0xe33074,_0x5d36c1,_0x519b2b){scripts[_0x2218('0x94')](_0x5d36c1,_0xe33074[_0x2218('0x81')],_0xe33074[_0x2218('0x95')]||_0x2218('0x65'))['then'](function(_0x5eb471){_0x519b2b(null,_0x5eb471);})[_0x2218('0x16')](function(_0x4b0d6e){_0x519b2b(_0x4b0d6e);});};AGIVertices[_0x2218('0x12')]['tildeASR']=function(_0x1d05cc,_0x1ed0fb,_0x168790){scripts[_0x2218('0x96')](_0x1ed0fb,_0x1d05cc['appid'],_0x1d05cc[_0x2218('0x97')],_0x1d05cc[_0x2218('0x79')])[_0x2218('0x15')](function(_0x439781){_0x168790(null,_0x439781);})['catch'](function(_0x13e12a){_0x168790(_0x13e12a);});};AGIVertices['prototype'][_0x2218('0x98')]=function(_0x36a3ef){var _0x3522ea=_[_0x2218('0x70')](verticesWithRetry,_0x36a3ef['agicommand'])?_0x36a3ef:_[_0x2218('0x99')](_0x36a3ef);for(var _0x386552 in _0x3522ea){if(_0x3522ea[_0x2218('0x9a')](_0x386552)){if(_0x3522ea[_0x386552]&&_[_0x2218('0x9b')](_0x3522ea[_0x386552])){if(_[_0x2218('0x70')](recursiveMapAttributes,_0x386552)){_0x3522ea[_0x386552]=this[_0x2218('0x9c')](_0x3522ea[_0x386552]);}else{_0x3522ea[_0x386552]=this[_0x2218('0x9d')](_0x3522ea[_0x386552]);}}}}return _0x3522ea;};AGIVertices[_0x2218('0x12')][_0x2218('0x9e')]=function(_0x42fa9d){for(var _0x317c55 in _0x42fa9d){if(_0x42fa9d['hasOwnProperty'](_0x317c55)){if(_[_0x2218('0x9f')](_0x42fa9d[_0x317c55])){this[_0x2218('0x9e')](_0x42fa9d[_0x317c55]);}else if(_[_0x2218('0xa0')](_0x42fa9d[_0x317c55])){for(var _0x38c8d2=0x0;_0x38c8d2<_0x42fa9d[_0x317c55]['length'];_0x38c8d2++){this['recursiveNodeIndex'](_0x42fa9d[_0x317c55][_0x38c8d2]);}}else if(_[_0x2218('0x9b')](_0x42fa9d[_0x317c55])){_0x42fa9d[_0x317c55]=this[_0x2218('0x9d')](_0x42fa9d[_0x317c55]);}}}};AGIVertices['prototype'][_0x2218('0xa1')]=function(_0x334d0a,_0x3195f6){for(var _0x31ed26 in _0x334d0a){if(_0x334d0a[_0x2218('0x9a')](_0x31ed26)){if(_[_0x2218('0x9f')](_0x334d0a[_0x31ed26])){if(!_['isEmpty'](_0x334d0a[_0x31ed26])){this[_0x2218('0xa1')](_0x334d0a[_0x31ed26],util[_0x2218('0x2c')](_0x2218('0xa2'),_0x3195f6,_0x31ed26));}}else if(_[_0x2218('0xa0')](_0x334d0a[_0x31ed26])){for(var _0x50e547=0x0;_0x50e547<_0x334d0a[_0x31ed26][_0x2218('0xa3')];_0x50e547++){this[_0x2218('0xa1')](_0x334d0a[_0x31ed26][_0x50e547],util[_0x2218('0x2c')](_0x2218('0xa2'),_0x3195f6,_0x31ed26+'['+_0x50e547+']'));}}else{if(!_['isNil'](_0x334d0a[_0x31ed26])){this[_0x2218('0x3b')]['setVariable'](util[_0x2218('0x2c')](_0x2218('0xa2'),_0x3195f6,_0x31ed26),_0x334d0a[_0x31ed26]);}}}}};AGIVertices[_0x2218('0x12')][_0x2218('0x9c')]=function(_0x3eb4cd){try{var _0x4e0d91=JSON['parse'](_0x3eb4cd);this[_0x2218('0x9e')](_0x4e0d91);return JSON[_0x2218('0x7b')](_0x4e0d91);}catch(_0x3daca5){return this['replaceAllVariables'](_0x3eb4cd);}};AGIVertices['prototype'][_0x2218('0x9d')]=function(_0x109d4c){var _0x425955=_0x109d4c['split']('{');for(var _0x11a59a=0x1;_0x11a59a<_0x425955[_0x2218('0xa3')];_0x11a59a+=0x1){var _0x1c8648=_0x425955[_0x11a59a]['split']('}');if(_0x1c8648['length']>0x1){_0x109d4c=_0x109d4c[_0x2218('0xa4')]('{'+_0x1c8648[0x0]+'}',this['channel'][_0x2218('0x13')](_0x1c8648[0x0])[_0x2218('0xa5')]||_0x1c8648[0x0]);}}if(_0x425955['length']===0x1){return _0x109d4c[_0x2218('0x52')]();}return this[_0x2218('0x9d')](_0x109d4c);};AGIVertices[_0x2218('0x12')][_0x2218('0xa6')]=function(_0x46f004,_0x5b4f78){var _0x516a5a=this['channel'][_0x2218('0x13')](_0x46f004);if(_0x516a5a['result']===-0x1){return _0x516a5a;}logger[_0x2218('0x31')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5b4f78,_0x516a5a[_0x2218('0xa5')]));return this[_0x2218('0x3b')]['setVariable'](_0x5b4f78,_0x516a5a[_0x2218('0xa5')]);};AGIVertices[_0x2218('0x12')][_0x2218('0x8b')]=function(_0x44582f){return _0x44582f&&_0x44582f!=='0'&&_0x44582f!=='-1'&&_0x44582f!=='';};AGIVertices[_0x2218('0x12')][_0x2218('0xa7')]=function(_0xe38754){this['createSquareDetailsReport'][_0x2218('0x78')](this,_0xe38754,'-');_0xe38754[_0x2218('0xa8')]=_0xe38754[_0x2218('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2218('0x12')][_0x2218('0xa9')]=function(_0x1da556){logger['info'](util[_0x2218('0x2c')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x1da556[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x1da556['text'])){return this['channel'][_0x2218('0xaa')](_0x2218('0xab'));}var _0x324b8='\x22'+_0x1da556[_0x2218('0x63')]+'\x22';if(this[_0x2218('0x8b')](_0x1da556[_0x2218('0x80')])){_0x324b8+=','+_0x1da556[_0x2218('0x80')];}var _0x5bdea3=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x2218('0xac'),_0x324b8);if(_0x5bdea3['result']===-0x1){return _0x5bdea3;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x324b8));};AGIVertices[_0x2218('0x12')][_0x2218('0xad')]=function(_0x461987){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0xae'),_0x461987[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x461987['grammar'])){return this['channel'][_0x2218('0xaa')](_0x2218('0xaf'));}var _0x5a7507=_0x461987[_0x2218('0xb0')];if(this[_0x2218('0x8b')](_0x461987[_0x2218('0x80')])){_0x5a7507+=','+_0x461987[_0x2218('0x80')];}var _0x583a64=this['channel']['exec'](_0x2218('0xb1'),_0x5a7507);if(_0x583a64[_0x2218('0xb2')]===-0x1){return _0x583a64;}var _0x453920=this[_0x2218('0xa6')](_0x2218('0xb3'),_0x2218('0xb4'));if(_0x453920[_0x2218('0xb2')]===-0x1){return _0x453920;}var _0x1aac62=this[_0x2218('0xa6')](_0x2218('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x1aac62[_0x2218('0xb2')]===-0x1){return _0x1aac62;}var _0x37e2ee=this[_0x2218('0xa6')](_0x2218('0xb6'),_0x2218('0xb7'));if(_0x37e2ee[_0x2218('0xb2')]===-0x1){return _0x37e2ee;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xb8'),_0x5a7507));};AGIVertices[_0x2218('0x12')]['agi']=function(_0x47b7c0){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0xb9'),_0x47b7c0[_0x2218('0x3d')]));return this[_0x2218('0x3b')][_0x2218('0x7')]([_0x47b7c0[_0x2218('0xba')],_0x47b7c0[_0x2218('0xbb')]]);};AGIVertices['prototype'][_0x2218('0xbc')]=function(_0x49b69c){logger['info'](util[_0x2218('0x2c')](_0x2218('0xbd'),_0x49b69c[_0x2218('0x3d')]));if(this[_0x2218('0x8b')](_0x49b69c['timeout'])){logger[_0x2218('0x31')](util['format'](_0x2218('0xbe'),_0x49b69c['timeout']));var _0x555989=this[_0x2218('0x3b')][_0x2218('0xbf')](_0x49b69c[_0x2218('0x6e')]);if(_0x555989['result']===-0x1){return _0x555989;}}return this[_0x2218('0x3b')][_0x2218('0xbc')]();};AGIVertices['prototype'][_0x2218('0xc0')]=function(_0x3cc688){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0xc1'),_0x3cc688['label']));if(!this[_0x2218('0x8b')](_0x3cc688[_0x2218('0x4f')])){return this['channel']['error'](_0x3cc688,_0x2218('0xc2'));}_0x3cc688[_0x2218('0x50')]=moment();if(this[_0x2218('0x8b')](_0x3cc688[_0x2218('0xc3')])){_0x3cc688['scheduledAt']=moment()[_0x2218('0xc4')](_0x3cc688[_0x2218('0xc3')],_0x2218('0xc5'));}if(!this[_0x2218('0x8b')](_0x3cc688[_0x2218('0x53')])){_0x3cc688['callback_priority']=0x2;}this[_0x2218('0x49')][_0x2218('0x78')](this,_0x3cc688);return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xc6'),_0x3cc688[_0x2218('0x4e')],_0x3cc688[_0x2218('0x4f')],_0x3cc688['scheduledAt']));};AGIVertices[_0x2218('0x12')][_0x2218('0xc7')]=function(_0x452a08){logger[_0x2218('0x31')](util['format'](_0x2218('0xc8'),_0x452a08[_0x2218('0x3d')]));var _0xb0cfe1=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x452a08[_0x2218('0xc9')],_0x452a08[_0x2218('0x80')]);if(_0xb0cfe1[_0x2218('0xb2')]===-0x1){return _0xb0cfe1;}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xca'),_0x452a08[_0x2218('0xc9')],_0x452a08[_0x2218('0x80')]));};AGIVertices['prototype'][_0x2218('0xcb')]=function(_0x2eca90){logger[_0x2218('0x31')](util['format'](_0x2218('0xcc'),_0x2eca90['label']));if(!this[_0x2218('0x8b')](_0x2eca90['text'])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xab'));}var _0x1e766d='\x22'+_0x2eca90[_0x2218('0x63')]+'\x22';if(this['isConfigured'](_0x2eca90['options'])){_0x1e766d+=','+_0x2eca90[_0x2218('0x80')];}var _0xa843b5=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x2218('0xac'),_0x1e766d);if(_0xa843b5['result']===-0x1){return _0xa843b5;}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xcd'),_0x1e766d));};AGIVertices['prototype'][_0x2218('0xce')]=function(_0x341f8d){logger[_0x2218('0x31')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x341f8d['label']));if(!this['isConfigured'](_0x341f8d[_0x2218('0x63')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xab'));}var _0x597b0d='\x22'+_0x341f8d[_0x2218('0x63')]+'\x22';if(this[_0x2218('0x8b')](_0x341f8d[_0x2218('0x80')])){_0x597b0d+=','+_0x341f8d[_0x2218('0x80')];}var _0x1979f9=this[_0x2218('0x3b')]['exec'](_0x2218('0xac'),_0x597b0d);if(_0x1979f9['result']===-0x1){return _0x1979f9;}return this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xcd'),_0x597b0d));};AGIVertices[_0x2218('0x12')][_0x2218('0xcf')]=function(_0x512d53){logger['info'](util[_0x2218('0x2c')](_0x2218('0xd0'),_0x512d53[_0x2218('0x3d')]));if(!this['isConfigured'](_0x512d53[_0x2218('0xb0')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xaf'));}var _0x4d2b0d=_0x512d53[_0x2218('0xb0')];if(this['isConfigured'](_0x512d53['options'])){_0x4d2b0d+=','+_0x512d53[_0x2218('0x80')];}var _0x3735f3=this[_0x2218('0x3b')]['exec'](_0x2218('0xb1'),_0x4d2b0d);if(_0x3735f3[_0x2218('0xb2')]===-0x1){return _0x3735f3;}var _0x49161e=this[_0x2218('0xa6')](_0x2218('0xb3'),_0x2218('0xd1'));if(_0x49161e['result']===-0x1){return _0x49161e;}var _0x3cf969=this['getAndSetVariable']('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x3cf969[_0x2218('0xb2')]===-0x1){return _0x3cf969;}var _0x1bc052=this[_0x2218('0xa6')](_0x2218('0xb6'),_0x2218('0xd2'));if(_0x1bc052[_0x2218('0xb2')]===-0x1){return _0x1bc052;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xb8'),_0x4d2b0d));};AGIVertices[_0x2218('0x12')][_0x2218('0xd3')]=function(_0x2a445d){logger['info'](util[_0x2218('0x2c')](_0x2218('0xd4'),_0x2a445d[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x2a445d[_0x2218('0xb0')])){return this['channel'][_0x2218('0xaa')](_0x2218('0xaf'));}var _0x47cc6c=_0x2a445d[_0x2218('0xb0')];if(this[_0x2218('0x8b')](_0x2a445d[_0x2218('0x80')])){_0x47cc6c+=','+_0x2a445d[_0x2218('0x80')];}var _0x34c2ed=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x2218('0xb1'),_0x47cc6c);if(_0x34c2ed[_0x2218('0xb2')]===-0x1){return _0x34c2ed;}var _0x5764a8=this['getAndSetVariable'](_0x2218('0xb3'),_0x2218('0xd5'));if(_0x5764a8[_0x2218('0xb2')]===-0x1){return _0x5764a8;}var _0x41c581=this[_0x2218('0xa6')](_0x2218('0xb5'),_0x2218('0xd6'));if(_0x41c581[_0x2218('0xb2')]===-0x1){return _0x41c581;}var _0x23731b=this['getAndSetVariable'](_0x2218('0xb6'),_0x2218('0xd7'));if(_0x23731b[_0x2218('0xb2')]===-0x1){return _0x23731b;}return this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xb8'),_0x47cc6c));};AGIVertices['prototype'][_0x2218('0xd8')]=function(_0x19812f){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x19812f['label']));if(!this['isConfigured'](_0x19812f[_0x2218('0xd9')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x19812f,_0x2218('0xda'));}var _0x2344ba=this[_0x2218('0x1c')]['sync'](this,_0x19812f[_0x2218('0xd9')]);if(!_0x2344ba){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x19812f,_0x2218('0xdb'));}if(!this['isConfigured'](_0x19812f[_0x2218('0xdc')])){return this[_0x2218('0x3b')]['error'](_0x19812f,_0x2218('0xdd'));}var _0x15fd98=_0x19812f[_0x2218('0xdc')][_0x2218('0x61')](/(\r\n|\n|\r)/gm,'\x20');this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xde'),_0x15fd98));var _0x2b0da0=this[_0x2218('0x2e')][_0x2218('0x78')](this,_0x2344ba,_0x15fd98);this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x19812f,_0x15fd98);if(!this[_0x2218('0x8b')](_0x19812f[_0x2218('0xdf')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xe0'));}var _0x4c2d37=this[_0x2218('0x13')][_0x2218('0x78')](this,_0x19812f[_0x2218('0xdf')]);if(!_0x4c2d37){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x19812f,_0x2218('0xe1'));}var _0xf68ddd=this;_0x2b0da0[_0x2218('0xe2')](function(_0x2459cf,_0x34d271){Object[_0x2218('0xe3')](_0x2459cf)['forEach'](function(_0x287a15){_0xf68ddd['channel']['setVariable'](util[_0x2218('0x2c')](_0x2218('0xe4'),_0x4c2d37,_0x34d271,_0x287a15),_0x2459cf[_0x287a15]);});});this[_0x2218('0x3b')]['setVariable'](util[_0x2218('0x2c')](_0x2218('0xe5'),_0x4c2d37),_0x2b0da0[_0x2218('0xa3')]);return this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0xe6'),_0x4c2d37));};AGIVertices[_0x2218('0x12')][_0x2218('0xe7')]=function(_0x262b93){logger['debug'](util[_0x2218('0x2c')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x262b93[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x262b93[_0x2218('0xe8')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x262b93,_0x2218('0xe9'));}var _0x284155=this[_0x2218('0x1f')][_0x2218('0x78')](this,_0x262b93['sip_id']);if(!_0x284155){return this['channel'][_0x2218('0x36')](_0x262b93,_0x2218('0xea'));}var _0x44b686=this['channel'][_0x2218('0x5f')](_0x2218('0xeb'),[util['format'](_0x2218('0xec'),_0x284155),_0x262b93['timeout'],_0x262b93[_0x2218('0xed')],_0x262b93[_0x2218('0x6c')]]);if(_0x44b686[_0x2218('0xb2')]===-0x1){return _0x44b686;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xee'),_0x2218('0xeb')));};AGIVertices[_0x2218('0x12')]['dialogflow']=function(_0x4a2f76){logger[_0x2218('0x31')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4a2f76['label']));if(!this[_0x2218('0x8b')](_0x4a2f76[_0x2218('0x81')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xef'));}if(!this[_0x2218('0x8b')](_0x4a2f76[_0x2218('0x63')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xab'));}this[_0x2218('0x3b')][_0x2218('0xf0')]=!![];this[_0x2218('0x3a')](_0x4a2f76);this[_0x2218('0x48')](_0x4a2f76[_0x2218('0x63')],'in','','');this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xf1'),_0x4a2f76[_0x2218('0x63')]));var _0x13bdf7=this[_0x2218('0xf2')][_0x2218('0x78')](this,_0x4a2f76);if(_0x13bdf7){for(var _0x92075a in _0x13bdf7){if(_0x13bdf7[_0x2218('0x9a')](_0x92075a)){this['channel']['setVariable'](util[_0x2218('0x2c')](_0x2218('0xf3'),_0x92075a[_0x2218('0x72')]()),_0x13bdf7[_0x92075a]);}}this[_0x2218('0x48')](_0x13bdf7[_0x2218('0xf4')],'out',_0x2218('0xf5'),'');return this[_0x2218('0x3b')][_0x2218('0xaa')](util['format']('Dialogflow\x20Result\x20%s',_0x13bdf7[_0x2218('0xf4')]));}return this['channel'][_0x2218('0x36')](_0x4a2f76,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x2218('0xf6')]=function(_0x2c9268){logger[_0x2218('0x31')](util['format'](_0x2218('0xf7'),_0x2c9268[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x2c9268[_0x2218('0xf8')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xf9'));}if(!this[_0x2218('0x8b')](_0x2c9268[_0x2218('0x83')])){return this['channel']['noop']('no\x20client_email\x20configured');}if(!this[_0x2218('0x8b')](_0x2c9268[_0x2218('0x84')])){return this['channel']['noop'](_0x2218('0xfa'));}if(!this[_0x2218('0x8b')](_0x2c9268[_0x2218('0x85')])){return this['channel'][_0x2218('0xaa')](_0x2218('0xfb'));}if(!this[_0x2218('0x8b')](_0x2c9268[_0x2218('0x63')])){return this['channel'][_0x2218('0xaa')](_0x2218('0xab'));}this['channel']['bot']=!![];this[_0x2218('0x3a')](_0x2c9268);this[_0x2218('0x48')](_0x2c9268[_0x2218('0x63')],'in','','');this[_0x2218('0x3b')][_0x2218('0xaa')](util['format']('Trying\x20DialogflowV2:\x20%s',_0x2c9268[_0x2218('0x63')]));var _0x863225=this['googleDialogflowV2'][_0x2218('0x78')](this,_0x2c9268);if(_0x863225){for(var _0x15830a in _0x863225){if(_0x863225[_0x2218('0x9a')](_0x15830a)){if(_0x15830a!==_0x2218('0xfc')){this[_0x2218('0x3b')][_0x2218('0xfd')](util['format'](_0x2218('0xf3'),_0x15830a[_0x2218('0x72')]()),_0x863225[_0x15830a]);}}}this['createSquareMessage'](_0x863225['speech'],_0x2218('0xfe'),_0x2218('0xf6'),_0x863225[_0x2218('0xfc')]);return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xff'),_0x863225[_0x2218('0xf4')]));}return this[_0x2218('0x3b')]['error'](_0x2c9268,_0x2218('0x100'));};AGIVertices['prototype'][_0x2218('0x101')]=function(_0x27a0c2){logger['info'](util[_0x2218('0x2c')](_0x2218('0x102'),_0x27a0c2[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x27a0c2[_0x2218('0x103')])){return this[_0x2218('0x3b')]['noop'](_0x2218('0x104'));}if(!this[_0x2218('0x8b')](_0x27a0c2[_0x2218('0x105')])){return this['channel'][_0x2218('0xaa')](_0x2218('0x106'));}if(!this['isConfigured'](_0x27a0c2[_0x2218('0x107')])){return this[_0x2218('0x3b')][_0x2218('0xaa')]('no\x20password\x20configured');}if(!this[_0x2218('0x8b')](_0x27a0c2[_0x2218('0x108')])){return this[_0x2218('0x3b')]['noop'](_0x2218('0xab'));}this[_0x2218('0x3b')][_0x2218('0xf0')]=!![];this[_0x2218('0x3a')](_0x27a0c2);this['createSquareMessage'](_0x27a0c2[_0x2218('0x63')],'in','','');this['channel']['noop'](util['format'](_0x2218('0x109'),_0x27a0c2[_0x2218('0x63')]));var _0x53b28f=this[_0x2218('0x86')][_0x2218('0x78')](this,_0x27a0c2);if(_0x53b28f){for(var _0x6b8d50 in _0x53b28f){if(_0x53b28f['hasOwnProperty'](_0x6b8d50)){this[_0x2218('0x3b')]['setVariable'](util[_0x2218('0x2c')](_0x2218('0x10a'),_0x6b8d50[_0x2218('0x72')]()),_0x53b28f[_0x6b8d50]);}}this[_0x2218('0x48')](_0x53b28f['speech'],_0x2218('0xfe'),_0x2218('0x101'),'');if(_0x53b28f[_0x2218('0x10b')]){this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x53b28f[_0x2218('0x10b')]));var _0x3248a1=this[_0x2218('0x3b')][_0x2218('0x10c')](_0x53b28f[_0x2218('0x10b')]);try{fs['unlink'](_0x53b28f[_0x2218('0x10b')]+_0x2218('0x10d'));}catch(_0x1221c5){logger['error'](_0x1221c5);}return _0x3248a1;}else{return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')]('SestekNDA\x20Result\x20%s',_0x53b28f[_0x2218('0xf4')]));}}return this[_0x2218('0x3b')][_0x2218('0x36')](_0x27a0c2,_0x2218('0x10e'));};AGIVertices[_0x2218('0x12')]['end']=function(_0x3d9c87){logger[_0x2218('0x31')](util['format'](_0x2218('0x10f'),_0x3d9c87[_0x2218('0x3d')]));return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x110'));};AGIVertices[_0x2218('0x12')][_0x2218('0x111')]=function(_0x178fe8){logger[_0x2218('0x31')](util['format'](_0x2218('0x112'),_0x178fe8[_0x2218('0x3d')]));var _0x325fd9='';if(_0x178fe8[_0x2218('0x113')]){if(!this[_0x2218('0x8b')](_0x178fe8['trunk_id'])){return this[_0x2218('0x3b')]['error'](_0x178fe8,_0x2218('0x114'));}else{var _0x38cf1f=parseInt(_0x178fe8[_0x2218('0x113')],0xa);if(isNaN(_0x38cf1f)){_0x325fd9=_0x178fe8['trunk_id'];}else{_0x325fd9=this[_0x2218('0x115')][_0x2218('0x78')](this,_0x178fe8['trunk_id']);if(!_0x325fd9){return this['channel']['error'](_0x178fe8,'no\x20trunk\x20found');}}}}else if(_0x178fe8[_0x2218('0x116')]){_0x325fd9=_0x178fe8[_0x2218('0x116')];}else{return this[_0x2218('0x3b')][_0x2218('0x36')](_0x178fe8,_0x2218('0x114'));}var _0x25127c=this[_0x2218('0x3b')]['exec'](_0x2218('0xeb'),[util['format'](_0x2218('0x117'),_0x325fd9,_0x178fe8['phone']),_0x178fe8[_0x2218('0x6e')],_0x178fe8[_0x2218('0xed')],_0x178fe8[_0x2218('0x6c')]]);if(_0x25127c[_0x2218('0xb2')]===-0x1){return _0x25127c;}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xee'),_0x2218('0xeb')));};AGIVertices['prototype'][_0x2218('0x118')]=function(_0x5aa984){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x119'),_0x5aa984[_0x2218('0x3d')]));return this[_0x2218('0x3b')][_0x2218('0xaa')]('finally');};AGIVertices[_0x2218('0x12')][_0x2218('0x11a')]=function(_0x5164a8){logger['info'](util[_0x2218('0x2c')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5164a8[_0x2218('0x3d')]));if(_0x5164a8[_0x2218('0xa8')]===0x0){return this['maxRetry'](_0x5164a8);}_0x5164a8[_0x2218('0xa8')]-=0x1;if(!this[_0x2218('0x8b')](_0x5164a8[_0x2218('0x11b')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5164a8,_0x2218('0x11c'));}var _0x357e91=this[_0x2218('0x11d')][_0x2218('0x78')](this,_0x5164a8['file_id']);if(!_0x357e91){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5164a8,'no\x20file\x20audio\x20found');}if(!this[_0x2218('0x8b')](_0x5164a8[_0x2218('0xdf')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x2218('0xe0'));}var _0x3f6a0c=this[_0x2218('0x3b')]['getData'](_0x357e91,_0x5164a8['response'],_0x5164a8[_0x2218('0x11e')]);var _0x3b4e9d=_0x3f6a0c[_0x2218('0xb2')]?_0x3f6a0c[_0x2218('0xb2')]['toString']():'';logger[_0x2218('0x31')](_0x2218('0x11f'),JSON[_0x2218('0x7b')](_0x3f6a0c));if(_0x3f6a0c[_0x2218('0xb2')]===-0x1){this['createSquareDetailsReport'][_0x2218('0x78')](this,_0x5164a8,_0x3b4e9d);return _0x3f6a0c;}else if(_0x3f6a0c[_0x2218('0xa5')]===_0x2218('0x6e')){_0x3f6a0c[_0x2218('0xb2')]=_0x3b4e9d[_0x2218('0xa3')]>=parseInt(_0x5164a8[_0x2218('0x120')])?'x':'i';}else{_0x3f6a0c[_0x2218('0xb2')]=_0x3b4e9d['length']>=parseInt(_0x5164a8['mindigit'])&&_0x3b4e9d[_0x2218('0xa3')]<=parseInt(_0x5164a8[_0x2218('0x11e')])?'x':'i';}var _0x3a1c24=this[_0x2218('0x13')][_0x2218('0x78')](this,_0x5164a8[_0x2218('0xdf')]);if(!_0x3a1c24){return this[_0x2218('0x3b')]['error'](_0x5164a8,_0x2218('0xe1'));}this[_0x2218('0x3b')]['setVariable'](_0x3a1c24,_0x3b4e9d);if(this[_0x2218('0x8b')](_0x5164a8[_0x2218('0x121')])){var _0x174684=parseInt(_0x5164a8[_0x2218('0x121')],0xa);var _0x307ec4=rs['generate']({'charset':'*','length':_0x174684});var _0x1da537=_0x3b4e9d['length'];if(_0x1da537>0x0){if(_0x1da537>_0x174684){this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x5164a8,_0x5164a8[_0x2218('0x122')]===_0x2218('0x123')?_0x307ec4+_0x3b4e9d['substr'](_0x174684):_0x3b4e9d[_0x2218('0x124')](0x0,_0x1da537-_0x174684)+_0x307ec4);}else{this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x5164a8,rs['generate']({'charset':'*','length':_0x1da537}));}}else{this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x5164a8,'');}}else{this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x5164a8,_0x3b4e9d);}return _0x3f6a0c;};AGIVertices['prototype'][_0x2218('0xf')]=function(_0x212474){logger[_0x2218('0x31')](util['format'](_0x2218('0x125'),_0x212474[_0x2218('0x3d')]));return this['getdigits'](_0x212474);};AGIVertices[_0x2218('0x12')][_0x2218('0x126')]=function(_0x41ea79){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x127'),_0x41ea79[_0x2218('0x3d')]));this['createSquareDetailsReport']['sync'](this,_0x41ea79,_0x41ea79[_0x2218('0x128')]);return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('GOAL\x20%s',_0x41ea79[_0x2218('0x128')]));};AGIVertices[_0x2218('0x12')][_0x2218('0x129')]=function(_0x3b0e66){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x12a'),_0x3b0e66[_0x2218('0x3d')]));if(!this['isConfigured'](_0x3b0e66[_0x2218('0x12b')])||!this[_0x2218('0x8b')](_0x3b0e66[_0x2218('0x8e')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x12c'));}if(!this[_0x2218('0x8b')](_0x3b0e66[_0x2218('0x63')])){return this['channel'][_0x2218('0xaa')](_0x2218('0xab'));}this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')]('Trying\x20aws\x20Polly\x20%s',_0x3b0e66[_0x2218('0x63')]));var _0x15e4ed=this[_0x2218('0x8d')][_0x2218('0x78')](this,_0x3b0e66);if(_0x15e4ed){this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0x12d'),_0x15e4ed));var _0x45cbce=this[_0x2218('0x3b')][_0x2218('0x10c')](_0x15e4ed);try{fs[_0x2218('0x12e')](_0x15e4ed+_0x2218('0x10d'));}catch(_0x196231){logger[_0x2218('0x36')](_0x196231);}return _0x45cbce;}return this[_0x2218('0x3b')]['error'](_0x3b0e66,_0x2218('0x12f'));};AGIVertices[_0x2218('0x12')][_0x2218('0x130')]=function(_0x1d46de){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x1d46de[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x1d46de['aws_access_key_id'])||!this[_0x2218('0x8b')](_0x1d46de[_0x2218('0x8e')])){return this['channel'][_0x2218('0xaa')](_0x2218('0x12c'));}if(!this[_0x2218('0x8b')](_0x1d46de[_0x2218('0x93')])){return this[_0x2218('0x3b')][_0x2218('0xaa')]('no\x20bot\x20name\x20configured');}if(!this[_0x2218('0x8b')](_0x1d46de[_0x2218('0x63')])){return this[_0x2218('0x3b')]['noop']('no\x20text\x20configured');}this[_0x2218('0x3b')]['bot']=!![];this[_0x2218('0x3a')](_0x1d46de);this['createSquareMessage'](_0x1d46de[_0x2218('0x63')],'in','','');this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0x131'),_0x1d46de[_0x2218('0x63')]));var _0x4ab9c2=this[_0x2218('0x91')][_0x2218('0x78')](this,_0x1d46de);if(_0x4ab9c2){for(var _0x45a157 in _0x4ab9c2){if(_0x4ab9c2['hasOwnProperty'](_0x45a157)&&_[_0x2218('0x9b')](_0x4ab9c2[_0x45a157])){this['channel'][_0x2218('0xfd')](util[_0x2218('0x2c')]('AWS_LEX_%s',_0x45a157[_0x2218('0x72')]()),_0x4ab9c2[_0x45a157]);}}if(_[_0x2218('0x57')](_0x4ab9c2[_0x2218('0x7f')])){return this['channel'][_0x2218('0xaa')](_0x2218('0x132'));}else{this[_0x2218('0x48')](_0x4ab9c2[_0x2218('0x7f')],_0x2218('0xfe'),_0x2218('0x133'),'');return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('Amazon\x20Lex\x20Result\x20%s',_0x4ab9c2['message']));}}return this[_0x2218('0x3b')]['error'](_0x1d46de,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x2218('0x12')]['googleasr']=function(_0x10a315){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x134'),_0x10a315[_0x2218('0x3d')],_0x10a315[_0x2218('0x6e')]));if(!this[_0x2218('0x8b')](_0x10a315[_0x2218('0x81')])){return this[_0x2218('0x3b')]['noop'](_0x2218('0xef'));}var _0x386deb='wav';var _0x2f51fa=util[_0x2218('0x2c')](_0x2218('0x135'),FILES_PATH,rs[_0x2218('0x136')](0x4));var _0x558c0e=util[_0x2218('0x2c')](_0x2218('0xa2'),_0x2f51fa,_0x386deb);var _0x4f7f62=!![];if(_0x10a315[_0x2218('0x137')]==='NOBEEP'){_0x4f7f62=![];}var _0x3e41ec=this[_0x2218('0x3b')][_0x2218('0x138')](_0x2f51fa,_0x386deb,_0x10a315[_0x2218('0x139')],_0x10a315['timeout'],undefined,_0x4f7f62);if(_0x3e41ec[_0x2218('0xb2')]!==-0x1){this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x13a'),_0x558c0e));var _0x2747de=this[_0x2218('0x94')]['sync'](this,_0x10a315,_0x558c0e);if(_0x2747de){for(var _0x440cba in _0x2747de){if(_0x2747de[_0x2218('0x9a')](_0x440cba)){this['channel'][_0x2218('0xfd')](util[_0x2218('0x2c')](_0x2218('0x13b'),_0x440cba[_0x2218('0x72')]()),_0x2747de[_0x440cba]);}}return this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0x13c'),JSON[_0x2218('0x7b')](_0x2747de)));}}return _0x3e41ec;};AGIVertices[_0x2218('0x12')][_0x2218('0x13d')]=function(_0x39409e){logger['info'](util[_0x2218('0x2c')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x39409e[_0x2218('0x3d')]));if(!this['isConfigured'](_0x39409e['appid'])){return this[_0x2218('0x3b')]['noop'](_0x2218('0x13e'));}if(!this[_0x2218('0x8b')](_0x39409e[_0x2218('0x97')])){return this[_0x2218('0x3b')]['noop']('no\x20appsecret\x20configured');}var _0x22a94b=_0x2218('0x13f');var _0x363f14=util[_0x2218('0x2c')](_0x2218('0x135'),FILES_PATH,rs[_0x2218('0x136')](0x4));var _0xee2d77=util[_0x2218('0x2c')](_0x2218('0xa2'),_0x363f14,_0x22a94b);var _0xe3a2ce=!![];if(_0x39409e[_0x2218('0x137')]===_0x2218('0x140')){_0xe3a2ce=![];}var _0x3d76b7=this[_0x2218('0x3b')][_0x2218('0x138')](_0x363f14,_0x22a94b,_0x39409e[_0x2218('0x139')],_0x39409e[_0x2218('0x6e')],undefined,_0xe3a2ce);if(_0x3d76b7[_0x2218('0xb2')]!==-0x1){this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x141'),_0xee2d77));var _0x3843e4=this[_0x2218('0x96')][_0x2218('0x78')](this,_0x39409e,_0xee2d77);if(_0x3843e4){for(var _0x5ed544 in _0x3843e4){if(_0x3843e4[_0x2218('0x9a')](_0x5ed544)){this[_0x2218('0x3b')][_0x2218('0xfd')](util[_0x2218('0x2c')](_0x2218('0x142'),_0x5ed544[_0x2218('0x72')]()),_0x3843e4[_0x5ed544]);}}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x2218('0x7b')](_0x3843e4)));}}return _0x3d76b7;};AGIVertices['prototype']['gotoc']=function(_0x50fac3){logger[_0x2218('0x31')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x50fac3[_0x2218('0x3d')]));return this['channel'][_0x2218('0x143')](_0x50fac3['context'],_0x50fac3['extension'],_0x50fac3[_0x2218('0x44')]);};AGIVertices[_0x2218('0x12')]['gotoif']=function(_0x3cd75e){logger['info'](util[_0x2218('0x2c')](_0x2218('0x144'),_0x3cd75e['label']));if(!this[_0x2218('0x8b')](_0x3cd75e[_0x2218('0x145')])){return this[_0x2218('0x3b')]['error'](_0x3cd75e,_0x2218('0x146'));}try{var _0x2adeea=eval(_0x3cd75e[_0x2218('0x145')])?_0x2218('0x147'):_0x2218('0x148');this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x149'),_0x3cd75e['condition'],_0x2adeea));return{'code':0xc8,'result':_0x2adeea};}catch(_0x112d7c){return{'code':0xc8,'result':_0x2218('0x148')};}};AGIVertices[_0x2218('0x12')][_0x2218('0x14a')]=function(_0x331e4f){logger['info'](util[_0x2218('0x2c')](_0x2218('0x14b'),_0x331e4f[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x331e4f['interval_id'])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x331e4f,'no\x20interval\x20configured');}var _0x16c599=this[_0x2218('0x26')][_0x2218('0x78')](this,_0x331e4f['interval_id']);if(!_0x16c599){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x331e4f,_0x2218('0x14c'));}for(var _0x5ebaac=0x0;_0x5ebaac<_0x16c599[_0x2218('0xa3')];_0x5ebaac+=0x1){var _0x2204e9=this['channel'][_0x2218('0x13')](util[_0x2218('0x2c')](_0x2218('0x14d'),_0x16c599[_0x5ebaac]));if(_0x2204e9[_0x2218('0xb2')]===-0x1){return _0x2204e9;}logger[_0x2218('0x31')](util['format'](_0x2218('0x14e'),_0x16c599[_0x5ebaac],_0x2204e9[_0x2218('0xa5')]));if(_0x2204e9['extra']===_0x2218('0x147')){logger['info'](util['format'](_0x2218('0x14e'),_0x16c599[_0x5ebaac],_0x2218('0x147')));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('IFTIME\x20%s\x20%s',_0x16c599[_0x5ebaac],_0x2218('0x147')));return{'code':0xc8,'result':_0x2218('0x147')};}else{logger['info'](util[_0x2218('0x2c')](_0x2218('0x14e'),_0x16c599[_0x5ebaac],'false'));this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0x14e'),_0x16c599[_0x5ebaac],_0x2218('0x148')));}}return{'code':0xc8,'result':_0x2218('0x148')};};AGIVertices[_0x2218('0x12')][_0x2218('0x14f')]=function(_0x33fd30){logger['info'](util[_0x2218('0x2c')](_0x2218('0x150'),_0x33fd30[_0x2218('0x3d')]));return this[_0x2218('0x3b')][_0x2218('0x14f')]();};AGIVertices[_0x2218('0x12')][_0x2218('0x151')]=function(_0x106cff){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x152'),_0x106cff[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x106cff[_0x2218('0x81')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xef'));}var _0x3e6bad=_0x2218('0x13f');var _0x89b632=util[_0x2218('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x2218('0x136')](0x4));var _0x20d69f=util[_0x2218('0x2c')](_0x2218('0xa2'),_0x89b632,_0x3e6bad);var _0x2259eb=!![];if(_0x106cff[_0x2218('0x137')]===_0x2218('0x140')){_0x2259eb=![];}var _0x403bf9=this['channel'][_0x2218('0x138')](_0x89b632,_0x3e6bad,_0x106cff[_0x2218('0x139')],_0x106cff[_0x2218('0x6e')],undefined,_0x2259eb);if(_0x403bf9[_0x2218('0xb2')]!==-0x1){this['channel'][_0x2218('0xaa')](util['format'](_0x2218('0x153'),_0x20d69f));var _0x298b6a=this[_0x2218('0x154')][_0x2218('0x78')](this,_0x106cff,_0x20d69f);if(_0x298b6a){for(var _0x17f58b in _0x298b6a){if(_0x298b6a[_0x2218('0x9a')](_0x17f58b)){this['channel']['setVariable'](util[_0x2218('0x2c')](_0x2218('0x155'),_0x17f58b['toUpperCase']()),_0x298b6a[_0x17f58b]);}}return this['channel'][_0x2218('0xaa')](util[_0x2218('0x2c')]('IspeechASR\x20Result\x20%s',JSON[_0x2218('0x7b')](_0x298b6a)));}}return _0x403bf9;};AGIVertices[_0x2218('0x12')][_0x2218('0x156')]=function(_0xb0cc92){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xb0cc92[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0xb0cc92[_0x2218('0x81')])){return this[_0x2218('0x3b')][_0x2218('0xaa')]('no\x20key\x20configured');}if(!this['isConfigured'](_0xb0cc92['text'])){return this[_0x2218('0x3b')][_0x2218('0xaa')]('no\x20text\x20configured');}this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x157'),_0xb0cc92[_0x2218('0x63')]));var _0x29512b=this[_0x2218('0x87')][_0x2218('0x78')](this,_0xb0cc92);if(_0x29512b){this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x153'),_0x29512b));var _0xd7943a=this['channel']['streamFile'](_0x29512b,_0xb0cc92['intKey']);try{fs['unlink'](_0x29512b+_0x2218('0x10d'));}catch(_0x3a79b5){logger[_0x2218('0x36')](_0x3a79b5);}return _0xd7943a;}return this['channel'][_0x2218('0x36')](_0xb0cc92,_0x2218('0x158'));};AGIVertices[_0x2218('0x12')][_0x2218('0x159')]=function(_0x5e1f95){logger[_0x2218('0x31')](util['format'](_0x2218('0x15a'),_0x5e1f95['label']));if(!this[_0x2218('0x8b')](_0x5e1f95[_0x2218('0x15b')])){return this['channel'][_0x2218('0x36')](_0x5e1f95,_0x2218('0x15c'));}logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x15d'),this['channel'][_0x2218('0x40')],_0x5e1f95[_0x2218('0x15b')]));var _0x11911e=this[_0x2218('0x5a')]['sync'](this,_0x5e1f95[_0x2218('0x15b')]);if(_0x11911e){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x15e'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5e1f95[_0x2218('0x15b')]));this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2218('0x3b')]['callerid'],_0x5e1f95['findBy']));return{'code':0xc8,'result':_0x2218('0x15f')};}else{logger[_0x2218('0x31')](util['format'](_0x2218('0x160'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5e1f95[_0x2218('0x15b')]));this['channel'][_0x2218('0xaa')](util['format'](_0x2218('0x160'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5e1f95[_0x2218('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x5c6e1f){logger['info'](util[_0x2218('0x2c')](_0x2218('0x161'),_0x5c6e1f['label']));if(!this['isConfigured'](_0x5c6e1f['findBy'])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5c6e1f,'no\x20find\x20by\x20configured');}logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x15d'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5c6e1f['findBy']));var _0x2ece30=this['agentLogout'][_0x2218('0x78')](this,_0x5c6e1f[_0x2218('0x15b')]);if(_0x2ece30){logger['info'](util[_0x2218('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x2218('0x40')],_0x5c6e1f[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0x15e'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5c6e1f[_0x2218('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger[_0x2218('0x31')](util[_0x2218('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2218('0x3b')]['callerid'],_0x5c6e1f[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x160'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x5c6e1f[_0x2218('0x15b')]));return{'code':0xc8,'result':_0x2218('0x162')};}};AGIVertices[_0x2218('0x12')]['math']=function(_0x445517){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x163'),_0x445517[_0x2218('0x3d')]));if(!this['isConfigured'](_0x445517[_0x2218('0x164')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x445517,_0x2218('0x165'));}this['channel']['noop'](util[_0x2218('0x2c')](_0x2218('0x166'),_0x445517[_0x2218('0x164')]));var _0x5d2a39=eval(_0x445517[_0x2218('0x164')]);if(!this[_0x2218('0x8b')](_0x445517[_0x2218('0xdf')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xe0'));}var _0x321ab4=this['getVariable'][_0x2218('0x78')](this,_0x445517[_0x2218('0xdf')]);if(!_0x321ab4){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x445517,'no\x20variable\x20found');}if(_[_0x2218('0xa0')](_0x5d2a39)){var _0x390069=this;_0x5d2a39[_0x2218('0xe2')](function(_0x45c24f,_0x434c39){_0x390069[_0x2218('0x3b')][_0x2218('0xfd')](util['format'](_0x2218('0x167'),_0x321ab4,_0x434c39),_0x45c24f);});return this[_0x2218('0x3b')][_0x2218('0xaa')](util['format'](_0x2218('0x168'),_0x321ab4));}else{return this[_0x2218('0x3b')][_0x2218('0xfd')](_0x321ab4,_0x5d2a39);}};AGIVertices[_0x2218('0x12')]['menu']=function(_0x380f1b){logger[_0x2218('0x31')](util['format'](_0x2218('0x169'),_0x380f1b[_0x2218('0x3d')]));if(_0x380f1b[_0x2218('0xa8')]===0x0){return this[_0x2218('0xa7')](_0x380f1b);}_0x380f1b[_0x2218('0xa8')]-=0x1;if(!this[_0x2218('0x8b')](_0x380f1b[_0x2218('0x11b')])){return this[_0x2218('0x3b')]['error'](_0x380f1b,_0x2218('0x11c'));}var _0xedfca5=this[_0x2218('0x11d')][_0x2218('0x78')](this,_0x380f1b[_0x2218('0x11b')]);if(!_0xedfca5){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x380f1b,'no\x20file\x20audio\x20found');}var _0x5c0fb7=this['channel']['getData'](_0xedfca5,_0x380f1b[_0x2218('0x16a')],_0x380f1b['digit']);var _0x503cb0=_0x5c0fb7[_0x2218('0xb2')];if(_0x5c0fb7[_0x2218('0xb2')]===-0x1){this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x380f1b,'-1');return _0x5c0fb7;}else if(_0x5c0fb7['extra']===_0x2218('0x6e')){_0x5c0fb7[_0x2218('0xb2')]=_0x5c0fb7[_0x2218('0xb2')]['length']>0x0?_0x5c0fb7['result']:'t';}else if(_[_0x2218('0x4a')](_0x5c0fb7[_0x2218('0xb2')])){_0x5c0fb7['result']='#';_0x503cb0='#';}if(!this[_0x2218('0x8b')](_0x380f1b[_0x2218('0xdf')])){this[_0x2218('0x3b')]['noop'](_0x2218('0xe0'));}else{var _0x3113f7=this['getVariable'][_0x2218('0x78')](this,_0x380f1b[_0x2218('0xdf')]);if(!_0x3113f7){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x380f1b,_0x2218('0xe1'));}this[_0x2218('0x3b')][_0x2218('0xfd')](_0x3113f7,_0x503cb0);}this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x380f1b,_0x503cb0);return _0x5c0fb7;};AGIVertices[_0x2218('0x12')][_0x2218('0xaa')]=function(_0x3497de){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x16b'),_0x3497de['label']));return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x3497de[_0x2218('0x16c')]||_0x3497de['label']);};AGIVertices[_0x2218('0x12')]['pause']=function(_0x2a3603){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x16d'),_0x2a3603[_0x2218('0x3d')]));if(!this['isConfigured'](_0x2a3603[_0x2218('0x15b')])){return this['channel'][_0x2218('0x36')](_0x2a3603,_0x2218('0x15c'));}logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x15d'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x2a3603[_0x2218('0x15b')]));var _0x935ade=this[_0x2218('0x16e')]['sync'](this,_0x2a3603['pause_id']);var _0x5bf341=this[_0x2218('0x55')][_0x2218('0x78')](this,_0x2a3603['findBy'],_0x935ade);if(_0x5bf341){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x15e'),this['channel'][_0x2218('0x40')],_0x2a3603[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2218('0x3b')][_0x2218('0x40')],_0x2a3603[_0x2218('0x15b')]));return{'code':0xc8,'result':_0x2218('0x15f')};}else{logger[_0x2218('0x31')](util[_0x2218('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x2218('0x3b')]['callerid'],_0x2a3603[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x15e'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x2a3603[_0x2218('0x15b')]));return{'code':0xc8,'result':_0x2218('0x162')};}};AGIVertices[_0x2218('0x12')]['playback']=function(_0x9e4f80){logger[_0x2218('0x31')](util['format'](_0x2218('0x16f'),_0x9e4f80[_0x2218('0x3d')]));if(!this['isConfigured'](_0x9e4f80['file_id'])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x9e4f80,'no\x20file\x20audio\x20selected');}var _0x134234=this[_0x2218('0x11d')][_0x2218('0x78')](this,_0x9e4f80[_0x2218('0x11b')]);if(!_0x134234){return this['channel'][_0x2218('0x36')](_0x9e4f80,_0x2218('0x170'));}var _0x7dbf4c=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x2218('0x171'),[_0x134234,_0x9e4f80[_0x2218('0xed')]]);if(_0x7dbf4c['result']===-0x1){return _0x7dbf4c;}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xca'),_0x2218('0x171'),_0x134234));};AGIVertices[_0x2218('0x12')][_0x2218('0x172')]=function(_0x3b2ff3){logger[_0x2218('0x31')](util['format'](_0x2218('0x173'),_0x3b2ff3['label']));if(!this[_0x2218('0x8b')](_0x3b2ff3[_0x2218('0x174')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x3b2ff3,_0x2218('0x175'));}var _0x5cc2ac='';var _0x555059=parseInt(_0x3b2ff3[_0x2218('0x174')],0xa);if(isNaN(_0x555059)){_0x5cc2ac=_0x3b2ff3[_0x2218('0x174')];}else{_0x5cc2ac=this[_0x2218('0x17')]['sync'](this,_0x3b2ff3['queue_id']);if(!_0x5cc2ac){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x3b2ff3,_0x2218('0x176'));}}var _0x53245a='';if(this[_0x2218('0x8b')](_0x3b2ff3['file_id'])){var _0x16b1a0=this['getSound']['sync'](this,_0x3b2ff3[_0x2218('0x11b')]);if(_0x16b1a0){_0x53245a=_0x16b1a0;}}this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x3b2ff3,_0x5cc2ac);if(_0x3b2ff3[_0x2218('0xed')]['indexOf']('x')<0x0){_0x3b2ff3[_0x2218('0xed')]+='x';}if(_0x3b2ff3[_0x2218('0xed')][_0x2218('0x177')]('X')<0x0){_0x3b2ff3[_0x2218('0xed')]+='X';}this[_0x2218('0x3b')][_0x2218('0xfd')](_0x2218('0x178'),_0x5cc2ac?_0x5cc2ac[_0x2218('0x179')]():'');var _0xd36a76=this[_0x2218('0x3b')][_0x2218('0x5f')]('QUEUE',[_0x5cc2ac,_0x3b2ff3['opts'],_0x3b2ff3[_0x2218('0x6c')],_0x53245a,_0x3b2ff3[_0x2218('0x6e')],_0x3b2ff3[_0x2218('0x7')],_0x3b2ff3['macro'],_0x3b2ff3[_0x2218('0x17a')],'',_0x3b2ff3[_0x2218('0x17b')]]);if(_0xd36a76[_0x2218('0xb2')]===-0x1){return _0xd36a76;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xca'),_0x2218('0x17c'),_0x5cc2ac));};AGIVertices[_0x2218('0x12')]['record']=function(_0x2358f4){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x17d'),_0x2358f4[_0x2218('0x3d')]));var _0x3ce95e=_0x2358f4['recordingFormat']||'wav';var _0x568eb3=util['format'](_0x2218('0x17e'),this[_0x2218('0x3b')][_0x2218('0x3c')],rs[_0x2218('0x136')](0x5));var _0x59938b=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x568eb3,_0x3ce95e);var _0x539ef3=util['format'](_0x2218('0x135'),FILES_PATH,_0x568eb3);this[_0x2218('0x41')]['sync'](this,_0x2358f4,_0x568eb3,_0x59938b);this[_0x2218('0x3b')][_0x2218('0xfd')]('RECORDING_SAVENAME',_0x568eb3);logger[_0x2218('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x539ef3,_0x3ce95e,_0x2358f4[_0x2218('0x17f')],_0x2358f4[_0x2218('0x6e')]);return this[_0x2218('0x3b')][_0x2218('0x138')](_0x539ef3,_0x3ce95e,_0x2358f4['escape_digits'],_0x2358f4[_0x2218('0x6e')],undefined,!![]);};AGIVertices[_0x2218('0x12')][_0x2218('0x180')]=function(_0x207842){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x207842[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x207842[_0x2218('0x6c')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x181'));}var _0x24e86e=this[_0x2218('0x6b')]['sync'](this,_0x207842);logger['info'](util['format'](_0x2218('0x182'),util['inspect'](_0x24e86e,{'showHidden':![],'depth':null})));if(!this[_0x2218('0x8b')](_0x207842[_0x2218('0xdf')])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x183'));}var _0x39a523=this[_0x2218('0x13')]['sync'](this,_0x207842[_0x2218('0xdf')]);if(!_0x39a523){return this[_0x2218('0x3b')]['error'](_0x207842,'no\x20variable\x20found');}this['channel'][_0x2218('0xfd')](util[_0x2218('0x2c')](_0x2218('0x184'),_0x39a523),_0x24e86e[_0x2218('0x7e')]?_0x24e86e[_0x2218('0x7e')]:'200');this[_0x2218('0x3b')][_0x2218('0xfd')](util[_0x2218('0x2c')](_0x2218('0x185'),_0x39a523),_0x24e86e['statusMessage']?_0x24e86e[_0x2218('0x186')]:'OK');if(_0x24e86e[_0x2218('0x7c')]){try{this[_0x2218('0xa1')](_0x24e86e['body'],_0x39a523);}catch(_0x5cf798){logger[_0x2218('0x36')](util['format'](_0x2218('0x187'),_0x39a523));}}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0xe6'),_0x39a523));};AGIVertices[_0x2218('0x12')][_0x2218('0x188')]=function(_0x139fb8){logger[_0x2218('0x31')](util['format'](_0x2218('0x189'),_0x139fb8['label']));return this[_0x2218('0x3b')][_0x2218('0x18a')](_0x139fb8[_0x2218('0x18b')][_0x2218('0x61')](/\s+/g,''),_0x139fb8[_0x2218('0x17f')]);};AGIVertices[_0x2218('0x12')][_0x2218('0x18c')]=function(_0x3a8253){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x18d'),_0x3a8253[_0x2218('0x3d')]));return this[_0x2218('0x3b')][_0x2218('0x18e')](_0x3a8253[_0x2218('0x6f')][_0x2218('0x61')](/\s+/g,''),_0x3a8253[_0x2218('0x17f')]);};AGIVertices[_0x2218('0x12')]['sayphonetic']=function(_0x250e02){logger['info'](util[_0x2218('0x2c')](_0x2218('0x18f'),_0x250e02['label']));return this[_0x2218('0x3b')][_0x2218('0x190')](_0x250e02[_0x2218('0x63')],_0x250e02[_0x2218('0x17f')]);};AGIVertices[_0x2218('0x12')]['sendMail']=function(_0x349939){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x349939[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x349939['account_id'])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x191'));}var _0x37fcbe=this[_0x2218('0x23')][_0x2218('0x78')](this,_0x349939['account_id']);if(!_0x37fcbe||!_0x37fcbe[_0x2218('0x192')]){return this[_0x2218('0x3b')]['error'](_0x349939,_0x2218('0x193'));}var _0x3d8f75={'from':util[_0x2218('0x2c')](_0x2218('0x194'),_0x37fcbe[_0x2218('0x19')],_0x37fcbe[_0x2218('0x195')]||_0x37fcbe[_0x2218('0x192')][_0x2218('0x196')]),'to':_0x349939['to']||'','cc':_0x349939['cc']||'','bcc':_0x349939[_0x2218('0x197')]||'','subject':_0x349939['subject'],'html':_0x349939[_0x2218('0x63')],'text':_0x349939[_0x2218('0x63')]};if(this[_0x2218('0x8b')](_0x349939[_0x2218('0x198')])){}logger['debug']('sendMail\x20message',JSON[_0x2218('0x7b')](_0x3d8f75));this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x349939,_0x349939[_0x2218('0x199')]);this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x19a'),_0x37fcbe[_0x2218('0x19')]));this[_0x2218('0x25')][_0x2218('0x78')](this,_0x37fcbe[_0x2218('0x19b')],_0x3d8f75);return this['channel'][_0x2218('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x2218('0x12')][_0x2218('0x19c')]=function(_0x458fac){logger['info'](util[_0x2218('0x2c')](_0x2218('0x19d'),_0x458fac['label']));return this[_0x2218('0x3b')]['noop'](_0x2218('0x19e'));};AGIVertices['prototype'][_0x2218('0x19f')]=function(_0xf763cd){logger[_0x2218('0x31')](util['format'](_0x2218('0x1a0'),_0xf763cd[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0xf763cd[_0x2218('0x1a1')])){return this['channel'][_0x2218('0xaa')](_0x2218('0x1a2'));}var _0x2fb2cf=this[_0x2218('0x38')]['sync'](this,_0xf763cd[_0x2218('0x1a1')]);if(!_0x2fb2cf){return this[_0x2218('0x3b')]['error'](_0xf763cd,'no\x20sms\x20account\x20found');}var _0x14e108={'body':_0xf763cd['sms_text'],'phone':_0xf763cd['to']||'','SmsAccountId':_0x2fb2cf['id']};logger[_0x2218('0x1a3')](_0x2218('0x1a4'),JSON[_0x2218('0x7b')](_0x14e108));this[_0x2218('0x3a')]['sync'](this,_0xf763cd,_0xf763cd[_0x2218('0x1a1')]);this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x1a5'),_0x2fb2cf[_0x2218('0x19')]));this['createSmsMessage'][_0x2218('0x78')](this,_0x14e108);return this['channel'][_0x2218('0xaa')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x2218('0x12')][_0x2218('0x1a6')]=function(_0x5d9f3e){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1a7'),_0x5d9f3e[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x5d9f3e[_0x2218('0xdf')])){return this[_0x2218('0x3b')]['error'](_0x5d9f3e,_0x2218('0x1a8'));}var _0xeaa60e=this[_0x2218('0x13')][_0x2218('0x78')](this,_0x5d9f3e['variable_id']);if(!_0xeaa60e){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5d9f3e,'no\x20variable\x20found');}return this['channel']['setVariable'](_0xeaa60e,_0x5d9f3e['variable_value']);};AGIVertices[_0x2218('0x12')][_0x2218('0x1a9')]=function(_0x2c7987){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('Enter\x20in\x20START\x20(%s)\x20block',_0x2c7987[_0x2218('0x3d')]));this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x1aa'));if(_0x2c7987['answer']===_0x2218('0x1ab')){this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x1ac'));return this[_0x2218('0x3b')][_0x2218('0xbc')]();}return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0x1ad'));};AGIVertices[_0x2218('0x12')][_0x2218('0x1ae')]=function(_0x5e61ef){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1af'),_0x5e61ef[_0x2218('0x3d')]));if(!this['isConfigured'](_0x5e61ef[_0x2218('0x1b0')])){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5e61ef,_0x2218('0x1b1'));}var _0x19cdee=this[_0x2218('0x1a')]['sync'](this,_0x5e61ef[_0x2218('0x1b0')]);if(!this['isConfigured'](_0x19cdee)){return this[_0x2218('0x3b')]['error'](_0x5e61ef,util[_0x2218('0x2c')](_0x2218('0x1b2'),_0x5e61ef[_0x2218('0x1b0')]));}if(_0x19cdee===this[_0x2218('0x3b')][_0x2218('0x3f')]){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x5e61ef,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x2218('0x3a')][_0x2218('0x78')](this,_0x5e61ef,_0x19cdee);var _0x2e3f22=this[_0x2218('0x3b')][_0x2218('0x5f')]('AGI',util[_0x2218('0x2c')](_0x2218('0x1b3'),config[_0x2218('0x7')][_0x2218('0x1b4')]||'127.0.0.1',_0x19cdee,this[_0x2218('0x3b')][_0x2218('0x3f')]));if(_0x2e3f22[_0x2218('0xb2')]===-0x1){return _0x2e3f22;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xca'),_0x2218('0x1b5'),_0x19cdee));};AGIVertices['prototype'][_0x2218('0x1b6')]=function(_0xa83192){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1b7'),_0xa83192[_0x2218('0x3d')]));var _0x39bcf2=this['shellCommand'][_0x2218('0x78')](this,_0xa83192[_0x2218('0xba')]);this['createSquareDetailsReport'][_0x2218('0x78')](this,_0xa83192,_0xa83192[_0x2218('0xba')]);if(this[_0x2218('0x8b')](_0xa83192['variable_id'])){var _0x2a7b30=this[_0x2218('0x13')]['sync'](this,_0xa83192[_0x2218('0xdf')]);if(_0x2a7b30){this[_0x2218('0x3b')][_0x2218('0xfd')](_0x2a7b30,_0x39bcf2);return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0xa83192[_0x2218('0xba')],_0x2a7b30));}}return this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0xa83192[_0x2218('0xba')]));};AGIVertices[_0x2218('0x12')]['google_cloud_tts']=function(_0x44e1c0){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1b8'),_0x44e1c0[_0x2218('0x3d')]));_0x44e1c0['text']=_0x44e1c0[_0x2218('0x63')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2218('0x8b')](_0x44e1c0[_0x2218('0x1b9')])){return this['channel'][_0x2218('0xaa')](_0x2218('0x1ba'));}if(!this[_0x2218('0x8b')](_0x44e1c0['text'])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xab'));}this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0x1bb'),_0x44e1c0[_0x2218('0x63')]));var _0x179450=this[_0x2218('0x62')][_0x2218('0x78')](this,_0x44e1c0);if(_0x179450){this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x1bc'),_0x179450));var _0x42634c=this[_0x2218('0x3b')][_0x2218('0x10c')](_0x179450);try{fs[_0x2218('0x12e')](_0x179450+_0x2218('0x10d'));}catch(_0x450337){logger['error'](_0x450337);}return _0x42634c;}return this[_0x2218('0x3b')][_0x2218('0x36')](_0x44e1c0,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x2218('0x1bd')]=function(_0x1c5ccf){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1be'),_0x1c5ccf[_0x2218('0x3d')]));_0x1c5ccf[_0x2218('0x63')]=_0x1c5ccf[_0x2218('0x63')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2218('0x8b')](_0x1c5ccf['text'])){return this[_0x2218('0x3b')][_0x2218('0xaa')](_0x2218('0xab'));}this[_0x2218('0x3b')]['noop'](util['format'](_0x2218('0x1bf'),_0x1c5ccf[_0x2218('0x63')]));var _0x3a505e=this[_0x2218('0x69')][_0x2218('0x78')](this,_0x1c5ccf);if(_0x3a505e){this[_0x2218('0x3b')]['noop'](util[_0x2218('0x2c')](_0x2218('0x1c0'),_0x3a505e));var _0x1fa2f2=this[_0x2218('0x3b')]['streamFile'](_0x3a505e);try{fs[_0x2218('0x12e')](_0x3a505e+'.wav');}catch(_0x29fd2e){logger[_0x2218('0x36')](_0x29fd2e);}return _0x1fa2f2;}return this['channel'][_0x2218('0x36')](_0x1c5ccf,_0x2218('0x1c1'));};AGIVertices['prototype'][_0x2218('0x1c2')]=function(_0x220b1a){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1c3'),_0x220b1a[_0x2218('0x3d')]));if(!this[_0x2218('0x8b')](_0x220b1a['findBy'])){return this['channel']['error'](_0x220b1a,_0x2218('0x15c'));}logger['info'](util[_0x2218('0x2c')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x2218('0x3b')][_0x2218('0x40')],_0x220b1a[_0x2218('0x15b')]));var _0x341e16=this[_0x2218('0x58')][_0x2218('0x78')](this,_0x220b1a[_0x2218('0x15b')]);if(_0x341e16){logger[_0x2218('0x31')](util[_0x2218('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2218('0x3b')][_0x2218('0x40')],_0x220b1a[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2218('0x3b')][_0x2218('0x40')],_0x220b1a[_0x2218('0x15b')]));return{'code':0xc8,'result':_0x2218('0x15f')};}else{logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x160'),this[_0x2218('0x3b')][_0x2218('0x40')],_0x220b1a[_0x2218('0x15b')]));this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0x160'),this['channel'][_0x2218('0x40')],_0x220b1a[_0x2218('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2218('0x12')][_0x2218('0x1c4')]=function(_0x3bbbc6){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1c5'),_0x3bbbc6[_0x2218('0x3d')]));var _0x15a363=this[_0x2218('0x3b')][_0x2218('0x5f')](_0x2218('0x1c6'),[_0x3bbbc6[_0x2218('0x1c7')],_0x3bbbc6[_0x2218('0x80')]]);if(_0x15a363[_0x2218('0xb2')]===-0x1){return _0x15a363;}return this[_0x2218('0x3b')][_0x2218('0xaa')](util[_0x2218('0x2c')](_0x2218('0xca'),_0x2218('0x1c6'),_0x3bbbc6['mailbox']));};AGIVertices[_0x2218('0x12')][_0x2218('0x1c8')]=function(_0x3269cb){logger[_0x2218('0x31')](util[_0x2218('0x2c')](_0x2218('0x1c9'),_0x3269cb['label']));if(!this[_0x2218('0x8b')](_0x3269cb[_0x2218('0xdf')])){return this[_0x2218('0x3b')]['error'](_0x3269cb,_0x2218('0x1a8'));}var _0x375058=this[_0x2218('0x13')]['sync'](this,_0x3269cb[_0x2218('0xdf')]);if(!_0x375058){return this[_0x2218('0x3b')][_0x2218('0x36')](_0x3269cb,_0x2218('0xe1'));}var _0x4265a6=this[_0x2218('0x3b')]['getVariable'](_0x375058);return{'code':0xc8,'result':_0x4265a6[_0x2218('0xa5')]?_0x4265a6[_0x2218('0xa5')]:'-'};};String['prototype'][_0x2218('0xa4')]=function(_0x4c04a0,_0x37f9e9){return this[_0x2218('0x1ca')](_0x4c04a0)[_0x2218('0x1cb')](_0x37f9e9);};module[_0x2218('0x1cc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 9f38115..2b0fc86 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 _0x02a7=['ACW','mandatoryDisposition','name','mandatoryDispositionPause','resolve','getAgent','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','timer','update','uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','prototype','startAcw','interface','queue'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x02a7,0x7a));var _0x702a=function(_0x193cbe,_0x25a258){_0x193cbe=_0x193cbe-0x0;var _0x45697e=_0x02a7[_0x193cbe];return _0x45697e;};'use strict';var _=require('lodash');var moment=require(_0x702a('0x0'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x702a('0x1'));var RpcUser=require(_0x702a('0x2'));var RpcVoiceAgentReport=require(_0x702a('0x3'));function Acw(_0xd65b34){this[_0x702a('0x4')]=_0xd65b34[_0x702a('0x4')];this[_0x702a('0x5')]=_0xd65b34['agents'];this[_0x702a('0x6')]=_0xd65b34['timers'];this[_0x702a('0x7')]={};ami['on'](_0x702a('0x8'),this[_0x702a('0x9')][_0x702a('0xa')](this));ami['on'](_0x702a('0xb'),this[_0x702a('0xc')][_0x702a('0xa')](this));ami['on']('hangup',this[_0x702a('0xd')]['bind'](this));ami['on']('agentringnoanswer',this[_0x702a('0xe')][_0x702a('0xa')](this));ami['on'](_0x702a('0xf'),this[_0x702a('0x10')]['bind'](this));ami['on'](_0x702a('0x11'),this[_0x702a('0x12')][_0x702a('0xa')](this));ami['on'](_0x702a('0x13'),this[_0x702a('0x14')][_0x702a('0xa')](this));}function getDiff(_0x34b608){var _0x4b690c=moment()['milliseconds'](0x0);var _0x38139d=moment(_0x34b608)['milliseconds'](0x0);return _0x4b690c['diff'](_0x38139d,'seconds');}Acw['prototype']['updateAcw']=function(_0x44f7fd,_0x3c9770){var _0xa124dd=this;var _0x57c2ba=getDiff(_0xa124dd['timers'][_0x44f7fd]['lastPauseAt']);clearTimeout(_0xa124dd[_0x702a('0x6')][_0x44f7fd][_0x702a('0x15')]);_0xa124dd[_0x702a('0x6')][_0x44f7fd]['timer']=![];return RpcVoiceAgentReport[_0x702a('0x16')]({'acwtime':_0x57c2ba},_0xa124dd['timers'][_0x44f7fd][_0x702a('0x17')],_0x44f7fd)[_0x702a('0x18')](function(_0x4f55ca){logger['info'](_0x702a('0x19'),_0x3c9770,_0x57c2ba,_0x4f55ca);})[_0x702a('0x1a')](function(_0x1845a2){logger[_0x702a('0x1b')](_0x702a('0x1c'),_0x3c9770,_0x1845a2);})[_0x702a('0x1d')](function(){delete _0xa124dd[_0x702a('0x6')][_0x44f7fd];});};Acw[_0x702a('0x1e')][_0x702a('0x1f')]=function(_0xd5ac07){try{var _0x47d0f5=this;var _0x1ecd28=this[_0x702a('0x7')][_0xd5ac07][_0x702a('0x20')];var _0xd5b93a=this[_0x702a('0x7')][_0xd5ac07][_0x702a('0x21')];var _0x2aede0=this[_0x702a('0x4')][_0xd5b93a];var _0x2308ae=![];var _0x4e8511=_0x702a('0x22');if(_0x2aede0[_0x702a('0x23')]&&_0x2aede0['mandatoryDispositionPause'][_0x702a('0x24')]){_0x2308ae=!![];_0x4e8511=_0x2aede0[_0x702a('0x25')][_0x702a('0x24')];}if(!_0x47d0f5[_0x702a('0x5')][_0x1ecd28]){return Promise[_0x702a('0x26')]();}return RpcUser[_0x702a('0x27')](_0x47d0f5['agents'][_0x1ecd28]['id'])[_0x702a('0x18')](function(_0x1047c4){if(!_0x1047c4||_0x1047c4['voicePause']){logger[_0x702a('0x28')](_0x702a('0x29'),_0xd5ac07,_0x1ecd28,_0xd5b93a);return;}logger[_0x702a('0x28')](_0x702a('0x2a'),_0xd5ac07,_0x1ecd28,_0xd5b93a);var _0x1973c7=_0x47d0f5[_0x702a('0x7')][_0xd5ac07][_0x702a('0x2b')]&&_0x47d0f5['channels'][_0xd5ac07][_0x702a('0x2c')]?_0x47d0f5[_0x702a('0x7')][_0xd5ac07][_0x702a('0x2c')]:_0xd5ac07;return RpcUser[_0x702a('0x2d')](_0x47d0f5[_0x702a('0x5')][_0x1ecd28],_0x4e8511,_0x1973c7);})[_0x702a('0x18')](function(_0x5cc44b){if(_0x2308ae||!_0x5cc44b){return;}_0x47d0f5[_0x702a('0x6')][_0x1ecd28]={};logger[_0x702a('0x28')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0xd5ac07,_0x47d0f5['voiceQueues'][_0xd5b93a][_0x702a('0x2e')],_0x1ecd28,_0xd5b93a);_0x47d0f5[_0x702a('0x6')][_0x1ecd28]['timer']=setTimeout(_0x47d0f5[_0x702a('0x2f')]['bind'](_0x47d0f5,_0x1ecd28),_0x47d0f5['voiceQueues'][_0xd5b93a][_0x702a('0x2e')]*0x3e8);_0x47d0f5[_0x702a('0x6')][_0x1ecd28][_0x702a('0x30')]=moment()['format'](_0x702a('0x31'));_0x47d0f5[_0x702a('0x6')][_0x1ecd28][_0x702a('0x17')]=_0xd5ac07;_0x47d0f5[_0x702a('0x6')][_0x1ecd28][_0x702a('0x21')]=_0xd5b93a;_0x47d0f5[_0x702a('0x6')][_0x1ecd28][_0x702a('0x32')]=_0x47d0f5[_0x702a('0x32')][_0x702a('0xa')](_0x47d0f5,_0x1ecd28,_0xd5ac07);})[_0x702a('0x1a')](function(){logger[_0x702a('0x1b')](_0x702a('0x33'),_0xd5ac07,_0x47d0f5[_0x702a('0x4')][_0xd5b93a][_0x702a('0x2e')],_0x1ecd28,_0xd5b93a);})[_0x702a('0x1d')](function(){delete _0x47d0f5[_0x702a('0x7')][_0xd5ac07];});}catch(_0x48250f){logger[_0x702a('0x1b')]('[ACW][START]\x20%s',_0x48250f[_0x702a('0x34')]);}};Acw[_0x702a('0x1e')][_0x702a('0x2f')]=function(_0x2eb2dd){try{var _0x927fd7=this;if(_0x927fd7[_0x702a('0x6')][_0x2eb2dd]){_0x927fd7[_0x702a('0x6')][_0x2eb2dd][_0x702a('0x15')]=![];var _0x5e69d0=_0x927fd7[_0x702a('0x6')][_0x2eb2dd][_0x702a('0x17')];var _0xc199d6=_0x927fd7[_0x702a('0x6')][_0x2eb2dd][_0x702a('0x21')];var _0x1b65bf=_0x927fd7[_0x702a('0x4')][_0xc199d6][_0x702a('0x2e')];logger[_0x702a('0x28')](_0x702a('0x35'),_0x5e69d0,_0x2eb2dd);RpcUser[_0x702a('0x36')](this[_0x702a('0x5')][_0x2eb2dd]);RpcVoiceAgentReport[_0x702a('0x16')]({'acwtime':_0x1b65bf,'agentacw':!![]},_0x5e69d0,_0x2eb2dd)[_0x702a('0x18')](function(_0x55f71b){logger[_0x702a('0x28')](_0x702a('0x19'),_0x5e69d0,_0x1b65bf,_0x55f71b);})[_0x702a('0x1a')](function(_0x4c096f){logger[_0x702a('0x1b')](_0x702a('0x1c'),_0x5e69d0,_0x4c096f);});}else{logger[_0x702a('0x1b')](_0x702a('0x37'),_0x2eb2dd);if(_0x927fd7[_0x702a('0x6')]){logger[_0x702a('0x28')]('[ACW][TIMERS]',JSON[_0x702a('0x38')](_0x927fd7[_0x702a('0x6')]));}}}catch(_0x34a26f){logger[_0x702a('0x1b')](_0x702a('0x39'),_0x34a26f[_0x702a('0x34')]);}};Acw[_0x702a('0x1e')][_0x702a('0x9')]=function(_0x5a67df){try{if(this[_0x702a('0x4')][_0x5a67df['queue']]&&(this[_0x702a('0x4')][_0x5a67df[_0x702a('0x21')]][_0x702a('0x1')]||this['voiceQueues'][_0x5a67df[_0x702a('0x21')]][_0x702a('0x23')])){if(this[_0x702a('0x5')][_0x5a67df[_0x702a('0x20')]]){this[_0x702a('0x7')][_0x5a67df[_0x702a('0x17')]]={'queue':_0x5a67df[_0x702a('0x21')],'interface':_0x5a67df['interface'],'destlinkedid':_0x5a67df['destlinkedid']};}}}catch(_0x12f49f){logger[_0x702a('0x1b')]('[ACW][syncAgentConnect]\x20%s',_0x12f49f['message']);}};Acw['prototype'][_0x702a('0x14')]=function(_0x25e011){try{if(this[_0x702a('0x4')][_0x25e011[_0x702a('0x21')]]&&(this[_0x702a('0x4')][_0x25e011[_0x702a('0x21')]][_0x702a('0x1')]||this[_0x702a('0x4')][_0x25e011[_0x702a('0x21')]][_0x702a('0x23')])){if(this[_0x702a('0x5')][_0x25e011[_0x702a('0x20')]]){this[_0x702a('0x7')][_0x25e011['uniqueid']]={'queue':_0x25e011['queue'],'interface':_0x25e011[_0x702a('0x20')]};}}}catch(_0x919678){logger['error'](_0x702a('0x3a'),_0x919678[_0x702a('0x34')]);}};Acw['prototype'][_0x702a('0xc')]=function(_0x415960){try{if(this[_0x702a('0x7')][_0x415960['uniqueid']]&&_[_0x702a('0x3b')](this[_0x702a('0x7')][_0x415960['uniqueid']][_0x702a('0x2b')])){logger[_0x702a('0x28')]('[%s][HANGUP:UNIQUEID]',_0x415960[_0x702a('0x17')]);this[_0x702a('0x1f')](_0x415960[_0x702a('0x17')]);}else if(this[_0x702a('0x7')][_0x415960[_0x702a('0x3c')]]&&_[_0x702a('0x3b')](this[_0x702a('0x7')][_0x415960[_0x702a('0x3c')]][_0x702a('0x2b')])){logger['info'](_0x702a('0x3d'),_0x415960[_0x702a('0x3c')]);this[_0x702a('0x1f')](_0x415960[_0x702a('0x3c')]);}}catch(_0x538b92){logger[_0x702a('0x1b')](_0x702a('0x3e'),_0x538b92[_0x702a('0x34')]);}};Acw[_0x702a('0x1e')][_0x702a('0xd')]=function(_0x4d2387){try{if(this[_0x702a('0x7')][_0x4d2387[_0x702a('0x17')]]&&this[_0x702a('0x7')][_0x4d2387[_0x702a('0x17')]][_0x702a('0x2b')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4d2387[_0x702a('0x17')]);this[_0x702a('0x1f')](_0x4d2387[_0x702a('0x17')]);}else if(this[_0x702a('0x7')][_0x4d2387[_0x702a('0x3c')]]&&this[_0x702a('0x7')][_0x4d2387[_0x702a('0x3c')]][_0x702a('0x2b')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x4d2387[_0x702a('0x3c')]);this['startAcw'](_0x4d2387['linkedid']);}}catch(_0x22ae4a){logger['error'](_0x702a('0x3f'),_0x22ae4a[_0x702a('0x34')]);}};Acw[_0x702a('0x1e')][_0x702a('0x10')]=function(_0x467a6c){try{if(!_[_0x702a('0x40')](this[_0x702a('0x7')][_0x467a6c[_0x702a('0x41')]])){this[_0x702a('0x1f')](_0x467a6c['transfereeuniqueid']);if(this[_0x702a('0x7')][_0x467a6c[_0x702a('0x42')]]){this['channels'][_0x467a6c[_0x702a('0x42')]][_0x702a('0x2b')]=!![];this[_0x702a('0x7')][_0x467a6c[_0x702a('0x43')]]=this[_0x702a('0x7')][_0x467a6c[_0x702a('0x42')]];delete this[_0x702a('0x7')][_0x467a6c['secondtransfereruniqueid']];}}else if(!_[_0x702a('0x40')](this[_0x702a('0x7')][_0x467a6c['transfertargetuniqueid']])){this[_0x702a('0x1f')](_0x467a6c['transfertargetuniqueid']);if(this[_0x702a('0x7')][_0x467a6c['origtransfereruniqueid']]){this[_0x702a('0x7')][_0x467a6c[_0x702a('0x44')]]['attended']=!![];this[_0x702a('0x7')][_0x467a6c[_0x702a('0x41')]]=this[_0x702a('0x7')][_0x467a6c[_0x702a('0x44')]];delete this['channels'][_0x467a6c[_0x702a('0x44')]];}}}catch(_0x232591){logger[_0x702a('0x1b')](_0x702a('0x45'),_0x232591[_0x702a('0x34')]);}};Acw[_0x702a('0x1e')][_0x702a('0x12')]=function(_0xcd2fc4){try{if(this[_0x702a('0x7')][_0xcd2fc4[_0x702a('0x46')]]){logger['info'](_0x702a('0x47'),JSON[_0x702a('0x38')](_0xcd2fc4[_0x702a('0x46')]));this['startAcw'](_0xcd2fc4[_0x702a('0x46')]);}else if(this[_0x702a('0x7')][_0xcd2fc4[_0x702a('0x48')]]){logger[_0x702a('0x28')](_0x702a('0x49'),JSON[_0x702a('0x38')](_0xcd2fc4[_0x702a('0x48')]));this['startAcw'](_0xcd2fc4['transfererlinkedid']);}}catch(_0x530bca){logger[_0x702a('0x1b')](_0x702a('0x4a'),_0x530bca[_0x702a('0x34')]);}};Acw['prototype'][_0x702a('0xe')]=function(_0x227f2e){try{if(this[_0x702a('0x4')][_0x227f2e[_0x702a('0x21')]]&&this['voiceQueues'][_0x227f2e[_0x702a('0x21')]]['autopause']===_0x702a('0x4b')){if(this[_0x702a('0x5')][_0x227f2e['interface']]){logger[_0x702a('0x28')](_0x702a('0x4c'),_0x227f2e[_0x702a('0x17')],_0x227f2e[_0x702a('0x20')],_0x227f2e['queue']);return RpcUser[_0x702a('0x2d')](this[_0x702a('0x5')][_0x227f2e['interface']],'Auto-Pause',_0x227f2e[_0x702a('0x17')]);}}}catch(_0x47b7be){logger[_0x702a('0x1b')](_0x702a('0x4d'),_0x47b7be[_0x702a('0x34')]);}};module['exports']=Acw; \ No newline at end of file +var _0x5232=['[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[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','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','savePause','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','updateAcw','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','interface'];(function(_0x1b650a,_0x41a453){var _0x3ac6b1=function(_0x4eb6f5){while(--_0x4eb6f5){_0x1b650a['push'](_0x1b650a['shift']());}};_0x3ac6b1(++_0x41a453);}(_0x5232,0x1c9));var _0x2523=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x5232[_0x22431e];return _0xd978e9;};'use strict';var _=require(_0x2523('0x0'));var moment=require(_0x2523('0x1'));var ami=require(_0x2523('0x2'));var logger=require(_0x2523('0x3'))(_0x2523('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3ce9f5){this[_0x2523('0x5')]=_0x3ce9f5['voiceQueues'];this[_0x2523('0x6')]=_0x3ce9f5[_0x2523('0x6')];this[_0x2523('0x7')]=_0x3ce9f5[_0x2523('0x7')];this[_0x2523('0x8')]={};ami['on'](_0x2523('0x9'),this[_0x2523('0xa')][_0x2523('0xb')](this));ami['on'](_0x2523('0xc'),this[_0x2523('0xd')][_0x2523('0xb')](this));ami['on'](_0x2523('0xe'),this['syncHangup'][_0x2523('0xb')](this));ami['on'](_0x2523('0xf'),this[_0x2523('0x10')][_0x2523('0xb')](this));ami['on'](_0x2523('0x11'),this[_0x2523('0x12')]['bind'](this));ami['on'](_0x2523('0x13'),this[_0x2523('0x14')][_0x2523('0xb')](this));ami['on'](_0x2523('0x15'),this['syncAgentConnectPreview'][_0x2523('0xb')](this));}function getDiff(_0x9fa814){var _0x5e1e1d=moment()[_0x2523('0x16')](0x0);var _0x2cd6e1=moment(_0x9fa814)[_0x2523('0x16')](0x0);return _0x5e1e1d[_0x2523('0x17')](_0x2cd6e1,'seconds');}Acw[_0x2523('0x18')]['updateAcw']=function(_0x3f9b51,_0x1ac5d3){var _0x173218=this;var _0x73e57a=getDiff(_0x173218['timers'][_0x3f9b51][_0x2523('0x19')]);clearTimeout(_0x173218[_0x2523('0x7')][_0x3f9b51][_0x2523('0x1a')]);_0x173218[_0x2523('0x7')][_0x3f9b51][_0x2523('0x1a')]=![];return RpcVoiceAgentReport[_0x2523('0x1b')]({'acwtime':_0x73e57a},_0x173218['timers'][_0x3f9b51][_0x2523('0x1c')],_0x3f9b51)[_0x2523('0x1d')](function(_0x540ec8){logger[_0x2523('0x1e')](_0x2523('0x1f'),_0x1ac5d3,_0x73e57a,_0x540ec8);})[_0x2523('0x20')](function(_0xd2b9ab){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x1ac5d3,_0xd2b9ab);})['finally'](function(){delete _0x173218['timers'][_0x3f9b51];});};Acw[_0x2523('0x18')][_0x2523('0x21')]=function(_0x469eda){try{var _0x3baae5=this;var _0x1c39d8=this['channels'][_0x469eda]['interface'];var _0x5444bb=this[_0x2523('0x8')][_0x469eda][_0x2523('0x22')];var _0x4847c1=this['voiceQueues'][_0x5444bb];var _0x5b5043=![];var _0x1df86b=_0x2523('0x23');if(_0x4847c1[_0x2523('0x24')]&&_0x4847c1[_0x2523('0x25')][_0x2523('0x26')]){_0x5b5043=!![];_0x1df86b=_0x4847c1['mandatoryDispositionPause'][_0x2523('0x26')];}if(!_0x3baae5[_0x2523('0x6')][_0x1c39d8]){return Promise[_0x2523('0x27')]();}return RpcUser[_0x2523('0x28')](_0x3baae5[_0x2523('0x6')][_0x1c39d8]['id'])[_0x2523('0x1d')](function(_0x17b55c){if(!_0x17b55c||_0x17b55c[_0x2523('0x29')]){logger[_0x2523('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x469eda,_0x1c39d8,_0x5444bb);return;}logger[_0x2523('0x1e')](_0x2523('0x2a'),_0x469eda,_0x1c39d8,_0x5444bb);var _0x53b772=_0x3baae5[_0x2523('0x8')][_0x469eda]['attended']&&_0x3baae5['channels'][_0x469eda]['destlinkedid']?_0x3baae5[_0x2523('0x8')][_0x469eda]['destlinkedid']:_0x469eda;return RpcUser[_0x2523('0x2b')](_0x3baae5['agents'][_0x1c39d8],_0x1df86b,_0x53b772);})[_0x2523('0x1d')](function(_0xb9cba8){if(_0x5b5043||!_0xb9cba8){return;}_0x3baae5['timers'][_0x1c39d8]={};logger[_0x2523('0x1e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x469eda,_0x3baae5[_0x2523('0x5')][_0x5444bb][_0x2523('0x2c')],_0x1c39d8,_0x5444bb);_0x3baae5[_0x2523('0x7')][_0x1c39d8][_0x2523('0x1a')]=setTimeout(_0x3baae5[_0x2523('0x2d')][_0x2523('0xb')](_0x3baae5,_0x1c39d8),_0x3baae5['voiceQueues'][_0x5444bb][_0x2523('0x2c')]*0x3e8);_0x3baae5[_0x2523('0x7')][_0x1c39d8][_0x2523('0x19')]=moment()['format'](_0x2523('0x2e'));_0x3baae5['timers'][_0x1c39d8][_0x2523('0x1c')]=_0x469eda;_0x3baae5[_0x2523('0x7')][_0x1c39d8][_0x2523('0x22')]=_0x5444bb;_0x3baae5[_0x2523('0x7')][_0x1c39d8][_0x2523('0x2f')]=_0x3baae5[_0x2523('0x2f')][_0x2523('0xb')](_0x3baae5,_0x1c39d8,_0x469eda);})['catch'](function(){logger[_0x2523('0x30')](_0x2523('0x31'),_0x469eda,_0x3baae5[_0x2523('0x5')][_0x5444bb][_0x2523('0x2c')],_0x1c39d8,_0x5444bb);})[_0x2523('0x32')](function(){delete _0x3baae5['channels'][_0x469eda];});}catch(_0x44ab04){logger[_0x2523('0x30')](_0x2523('0x33'),_0x44ab04[_0x2523('0x34')]);}};Acw['prototype'][_0x2523('0x2d')]=function(_0x5b95e5){try{var _0x4da7c4=this;if(_0x4da7c4['timers'][_0x5b95e5]){_0x4da7c4[_0x2523('0x7')][_0x5b95e5][_0x2523('0x1a')]=![];var _0x10687a=_0x4da7c4[_0x2523('0x7')][_0x5b95e5][_0x2523('0x1c')];var _0x3a4b37=_0x4da7c4[_0x2523('0x7')][_0x5b95e5][_0x2523('0x22')];var _0x4b3b25=_0x4da7c4[_0x2523('0x5')][_0x3a4b37][_0x2523('0x2c')];logger[_0x2523('0x1e')](_0x2523('0x35'),_0x10687a,_0x5b95e5);RpcUser[_0x2523('0x36')](this['agents'][_0x5b95e5]);RpcVoiceAgentReport[_0x2523('0x1b')]({'acwtime':_0x4b3b25,'agentacw':!![]},_0x10687a,_0x5b95e5)[_0x2523('0x1d')](function(_0x5164c3){logger['info'](_0x2523('0x1f'),_0x10687a,_0x4b3b25,_0x5164c3);})['catch'](function(_0x1ff27a){logger[_0x2523('0x30')](_0x2523('0x37'),_0x10687a,_0x1ff27a);});}else{logger[_0x2523('0x30')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x5b95e5);if(_0x4da7c4['timers']){logger[_0x2523('0x1e')](_0x2523('0x38'),JSON[_0x2523('0x39')](_0x4da7c4[_0x2523('0x7')]));}}}catch(_0x14104c){logger['error']('[ACW][STOP]\x20%s',_0x14104c['message']);}};Acw[_0x2523('0x18')][_0x2523('0xa')]=function(_0xceff81){try{if(this['voiceQueues'][_0xceff81[_0x2523('0x22')]]&&(this[_0x2523('0x5')][_0xceff81['queue']][_0x2523('0x4')]||this[_0x2523('0x5')][_0xceff81[_0x2523('0x22')]][_0x2523('0x24')])){if(this[_0x2523('0x6')][_0xceff81['interface']]){this[_0x2523('0x8')][_0xceff81[_0x2523('0x1c')]]={'queue':_0xceff81[_0x2523('0x22')],'interface':_0xceff81[_0x2523('0x3a')],'destlinkedid':_0xceff81['destlinkedid']};}}}catch(_0x3000bf){logger[_0x2523('0x30')](_0x2523('0x3b'),_0x3000bf[_0x2523('0x34')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x20f1d6){try{if(this['voiceQueues'][_0x20f1d6[_0x2523('0x22')]]&&(this[_0x2523('0x5')][_0x20f1d6[_0x2523('0x22')]][_0x2523('0x4')]||this[_0x2523('0x5')][_0x20f1d6['queue']][_0x2523('0x24')])){if(this[_0x2523('0x6')][_0x20f1d6['interface']]){this[_0x2523('0x8')][_0x20f1d6[_0x2523('0x1c')]]={'queue':_0x20f1d6[_0x2523('0x22')],'interface':_0x20f1d6['interface']};}}}catch(_0x337993){logger[_0x2523('0x30')](_0x2523('0x3c'),_0x337993[_0x2523('0x34')]);}};Acw[_0x2523('0x18')]['syncHangupRequest']=function(_0x17109e){try{if(this[_0x2523('0x8')][_0x17109e['uniqueid']]&&_[_0x2523('0x3d')](this['channels'][_0x17109e['uniqueid']][_0x2523('0x3e')])){logger[_0x2523('0x1e')](_0x2523('0x3f'),_0x17109e[_0x2523('0x1c')]);this[_0x2523('0x21')](_0x17109e[_0x2523('0x1c')]);}else if(this[_0x2523('0x8')][_0x17109e['linkedid']]&&_['isUndefined'](this['channels'][_0x17109e[_0x2523('0x40')]][_0x2523('0x3e')])){logger['info'](_0x2523('0x41'),_0x17109e[_0x2523('0x40')]);this[_0x2523('0x21')](_0x17109e['linkedid']);}}catch(_0x447343){logger[_0x2523('0x30')](_0x2523('0x42'),_0x447343['message']);}};Acw['prototype'][_0x2523('0x43')]=function(_0xf9b58f){try{if(this['channels'][_0xf9b58f[_0x2523('0x1c')]]&&this[_0x2523('0x8')][_0xf9b58f[_0x2523('0x1c')]][_0x2523('0x3e')]){logger[_0x2523('0x1e')](_0x2523('0x44'),_0xf9b58f[_0x2523('0x1c')]);this[_0x2523('0x21')](_0xf9b58f[_0x2523('0x1c')]);}else if(this[_0x2523('0x8')][_0xf9b58f[_0x2523('0x40')]]&&this[_0x2523('0x8')][_0xf9b58f[_0x2523('0x40')]][_0x2523('0x3e')]){logger[_0x2523('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xf9b58f[_0x2523('0x40')]);this['startAcw'](_0xf9b58f[_0x2523('0x40')]);}}catch(_0x328d2a){logger['error']('[ACW][syncHangup]\x20%s',_0x328d2a[_0x2523('0x34')]);}};Acw[_0x2523('0x18')]['syncAttendedTransfer']=function(_0x23b11b){try{if(!_[_0x2523('0x45')](this['channels'][_0x23b11b['transfereeuniqueid']])){this[_0x2523('0x21')](_0x23b11b['transfereeuniqueid']);if(this[_0x2523('0x8')][_0x23b11b[_0x2523('0x46')]]){this[_0x2523('0x8')][_0x23b11b[_0x2523('0x46')]][_0x2523('0x3e')]=!![];this[_0x2523('0x8')][_0x23b11b['transfertargetuniqueid']]=this[_0x2523('0x8')][_0x23b11b[_0x2523('0x46')]];delete this['channels'][_0x23b11b[_0x2523('0x46')]];}}else if(!_['isNil'](this['channels'][_0x23b11b[_0x2523('0x47')]])){this['startAcw'](_0x23b11b['transfertargetuniqueid']);if(this[_0x2523('0x8')][_0x23b11b[_0x2523('0x48')]]){this[_0x2523('0x8')][_0x23b11b[_0x2523('0x48')]][_0x2523('0x3e')]=!![];this[_0x2523('0x8')][_0x23b11b[_0x2523('0x49')]]=this['channels'][_0x23b11b['origtransfereruniqueid']];delete this[_0x2523('0x8')][_0x23b11b[_0x2523('0x48')]];}}}catch(_0x3bcdf6){logger['error'](_0x2523('0x4a'),_0x3bcdf6[_0x2523('0x34')]);}};Acw['prototype'][_0x2523('0x14')]=function(_0x94e275){try{if(this[_0x2523('0x8')][_0x94e275[_0x2523('0x4b')]]){logger['info'](_0x2523('0x4c'),JSON[_0x2523('0x39')](_0x94e275[_0x2523('0x4b')]));this[_0x2523('0x21')](_0x94e275[_0x2523('0x4b')]);}else if(this[_0x2523('0x8')][_0x94e275[_0x2523('0x4d')]]){logger[_0x2523('0x1e')](_0x2523('0x4e'),JSON[_0x2523('0x39')](_0x94e275[_0x2523('0x4d')]));this[_0x2523('0x21')](_0x94e275[_0x2523('0x4d')]);}}catch(_0x1cb92d){logger['error'](_0x2523('0x4f'),_0x1cb92d[_0x2523('0x34')]);}};Acw[_0x2523('0x18')][_0x2523('0x10')]=function(_0x13fbbe){try{if(this[_0x2523('0x5')][_0x13fbbe['queue']]&&this[_0x2523('0x5')][_0x13fbbe['queue']][_0x2523('0x50')]===_0x2523('0x51')){if(this[_0x2523('0x6')][_0x13fbbe['interface']]){logger[_0x2523('0x1e')](_0x2523('0x52'),_0x13fbbe[_0x2523('0x1c')],_0x13fbbe[_0x2523('0x3a')],_0x13fbbe[_0x2523('0x22')]);return RpcUser[_0x2523('0x2b')](this[_0x2523('0x6')][_0x13fbbe[_0x2523('0x3a')]],_0x2523('0x53'),_0x13fbbe[_0x2523('0x1c')]);}}}catch(_0x3a54ac){logger['error'](_0x2523('0x54'),_0x3a54ac['message']);}};module[_0x2523('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index ab9ae26..d32f9db 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 _0x57fa=['actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','exports','bluebird','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x4f59bf,_0x2cb46e){var _0x375826=function(_0x701087){while(--_0x701087){_0x4f59bf['push'](_0x4f59bf['shift']());}};_0x375826(++_0x2cb46e);}(_0x57fa,0x9c));var _0xa57f=function(_0x1d0988,_0x5a24ba){_0x1d0988=_0x1d0988-0x0;var _0x3d5a09=_0x57fa[_0x1d0988];return _0x3d5a09;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa57f('0x0'));var util=require('util');var logger=require('../../config/logger')('ami');var config=require(_0xa57f('0x1'));var ami=new Manager(config[_0xa57f('0x2')][_0xa57f('0x3')],config[_0xa57f('0x2')]['ip'],config[_0xa57f('0x2')][_0xa57f('0x4')],config[_0xa57f('0x2')][_0xa57f('0x5')],!![]);ami[_0xa57f('0x6')]();ami[_0xa57f('0x7')]=BPromise[_0xa57f('0x8')](ami['action']);function error(_0x1f2bb9){logger[_0xa57f('0x9')](util[_0xa57f('0xa')](_0xa57f('0xb'),config['asterisk'][_0xa57f('0x4')],config[_0xa57f('0x2')]['ip'],config[_0xa57f('0x2')]['port'],util[_0xa57f('0xc')](_0x1f2bb9,![],null)));}function close(){logger[_0xa57f('0x9')](util[_0xa57f('0xa')](_0xa57f('0xd'),config[_0xa57f('0x2')]['username'],config['asterisk']['ip'],config[_0xa57f('0x2')][_0xa57f('0x3')]));}ami[_0xa57f('0xe')]=function(){return function(){return ami['Action']({'action':_0xa57f('0xf')});};};ami[_0xa57f('0x10')]=function(){return function(){return ami[_0xa57f('0x7')]({'action':_0xa57f('0x11')});};};ami[_0xa57f('0x12')]=function(){return function(){return ami[_0xa57f('0x7')]({'action':_0xa57f('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xa57f('0x7')]({'action':'queuesummary'});};};ami[_0xa57f('0x14')]=function(){return function(){return ami[_0xa57f('0x7')]({'action':_0xa57f('0x15')});};};function connect(){logger[_0xa57f('0x16')](util[_0xa57f('0xa')](_0xa57f('0x17'),config['asterisk'][_0xa57f('0x4')],config[_0xa57f('0x2')]['ip'],config['asterisk'][_0xa57f('0x3')]));ami[_0xa57f('0x18')](_0xa57f('0x9'),error);ami[_0xa57f('0x18')]('close',close);}ami['on'](_0xa57f('0x19'),connect);ami['on'](_0xa57f('0x1a'),function(_0x4b1dd6){logger['info'](util['format'](_0xa57f('0x1b'),config[_0xa57f('0x2')][_0xa57f('0x4')],config[_0xa57f('0x2')]['ip'],config[_0xa57f('0x2')][_0xa57f('0x3')],util[_0xa57f('0xc')](_0x4b1dd6,![],null)));});ami['on'](_0xa57f('0x1c'),function(){logger['info'](util[_0xa57f('0xa')](_0xa57f('0x1d'),config[_0xa57f('0x2')][_0xa57f('0x4')],config[_0xa57f('0x2')]['ip'],config[_0xa57f('0x2')][_0xa57f('0x3')]));return Promise[_0xa57f('0x1e')]()['then'](ami[_0xa57f('0xe')]())[_0xa57f('0x1f')](ami['actionDeviceStateList']())[_0xa57f('0x1f')](ami[_0xa57f('0x12')]())['then'](ami['actionQueueSummary']())[_0xa57f('0x1f')](ami[_0xa57f('0x14')]())[_0xa57f('0x20')](function(_0x3babe3){logger[_0xa57f('0x9')]('[ami.js][fullybooted]',util[_0xa57f('0xc')](_0x3babe3,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami['once']('close',close);module[_0xa57f('0x21')]=ami; \ No newline at end of file +var _0x8a27=['error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','username','password','Action','promisify'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0x8a27,0x15d));var _0x78a2=function(_0x4799ef,_0x3e6eaa){_0x4799ef=_0x4799ef-0x0;var _0xac82ac=_0x8a27[_0x4799ef];return _0xac82ac;};'use strict';var Manager=require(_0x78a2('0x0'));var BPromise=require(_0x78a2('0x1'));var util=require(_0x78a2('0x2'));var logger=require(_0x78a2('0x3'))(_0x78a2('0x4'));var config=require(_0x78a2('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x78a2('0x6')]['ip'],config[_0x78a2('0x6')][_0x78a2('0x7')],config['asterisk'][_0x78a2('0x8')],!![]);ami['keepConnected']();ami[_0x78a2('0x9')]=BPromise[_0x78a2('0xa')](ami['action']);function error(_0x578c0f){logger[_0x78a2('0xb')](util[_0x78a2('0xc')](_0x78a2('0xd'),config[_0x78a2('0x6')]['username'],config[_0x78a2('0x6')]['ip'],config[_0x78a2('0x6')][_0x78a2('0xe')],util[_0x78a2('0xf')](_0x578c0f,![],null)));}function close(){logger[_0x78a2('0xb')](util[_0x78a2('0xc')](_0x78a2('0x10'),config[_0x78a2('0x6')][_0x78a2('0x7')],config[_0x78a2('0x6')]['ip'],config['asterisk'][_0x78a2('0xe')]));}ami[_0x78a2('0x11')]=function(){return function(){return ami[_0x78a2('0x9')]({'action':_0x78a2('0x12')});};};ami[_0x78a2('0x13')]=function(){return function(){return ami[_0x78a2('0x9')]({'action':_0x78a2('0x14')});};};ami[_0x78a2('0x15')]=function(){return function(){return ami[_0x78a2('0x9')]({'action':_0x78a2('0x16')});};};ami[_0x78a2('0x17')]=function(){return function(){return ami['Action']({'action':_0x78a2('0x18')});};};ami[_0x78a2('0x19')]=function(){return function(){return ami[_0x78a2('0x9')]({'action':'coreshowchannels'});};};function connect(){logger[_0x78a2('0x1a')](util[_0x78a2('0xc')](_0x78a2('0x1b'),config[_0x78a2('0x6')][_0x78a2('0x7')],config[_0x78a2('0x6')]['ip'],config[_0x78a2('0x6')][_0x78a2('0xe')]));ami[_0x78a2('0x1c')](_0x78a2('0xb'),error);ami[_0x78a2('0x1c')](_0x78a2('0x1d'),close);}ami['on'](_0x78a2('0x1e'),connect);ami['on'](_0x78a2('0x1f'),function(_0x3b8770){logger['info'](util[_0x78a2('0xc')](_0x78a2('0x20'),config[_0x78a2('0x6')][_0x78a2('0x7')],config['asterisk']['ip'],config[_0x78a2('0x6')][_0x78a2('0xe')],util[_0x78a2('0xf')](_0x3b8770,![],null)));});ami['on']('fullybooted',function(){logger[_0x78a2('0x1a')](util[_0x78a2('0xc')](_0x78a2('0x21'),config[_0x78a2('0x6')][_0x78a2('0x7')],config['asterisk']['ip'],config[_0x78a2('0x6')]['port']));return Promise['resolve']()[_0x78a2('0x22')](ami[_0x78a2('0x11')]())['then'](ami[_0x78a2('0x13')]())[_0x78a2('0x22')](ami[_0x78a2('0x15')]())[_0x78a2('0x22')](ami[_0x78a2('0x17')]())[_0x78a2('0x22')](ami[_0x78a2('0x19')]())['catch'](function(_0x3aaab7){logger['error']('[ami.js][fullybooted]',util[_0x78a2('0xf')](_0x3aaab7,{'showHidden':![],'depth':null}));});});ami[_0x78a2('0x1c')]('error',error);ami[_0x78a2('0x1c')](_0x78a2('0x1d'),close);module[_0x78a2('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8cb1a84..9420e46 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x28d391,_0x1357b3){var _0x3c8bf0=function(_0x55bac9){while(--_0x55bac9){_0x28d391['push'](_0x28d391['shift']());}};_0x3c8bf0(++_0x1357b3);}(_0xac4a,0x13f));var _0xaac4=function(_0x42407b,_0x15e832){_0x42407b=_0x42407b-0x0;var _0x245e74=_0xac4a[_0x42407b];return _0x245e74;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xac4a,0x13f));var _0xaac4=function(_0x509d1f,_0x245ab8){_0x509d1f=_0x509d1f-0x0;var _0x4a5989=_0xac4a[_0x509d1f];return _0x4a5989;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 10a034a..5b5df1b 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 _0x5c5d=['available','inUse','talking','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','getCaller','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','Abandoned','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','agentBusyFactor','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','checkIsBlackList','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','syncAgentConnect','queuecallerabandon','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','name','startProgressive\x20value\x20cleared','handlePredictive','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','Interval','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','interval','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','isIVRCampaignActive','resolve','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','intervalIftime','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedRetryFrequency','verifyAdditionalPhones','countabandonedretry','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','roundrobin','locked','stateinterface','isNil','queueBooked','idHopper','paused','preview','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','countagentrejectretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','queuesSummary','running','statusMessage'];(function(_0x1872f7,_0x1e3e1b){var _0x2714ef=function(_0x4e67ed){while(--_0x4e67ed){_0x1872f7['push'](_0x1872f7['shift']());}};_0x2714ef(++_0x1e3e1b);}(_0x5c5d,0xe0));var _0xd5c5=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x5c5d[_0xa1e3e3];return _0xc980e9;};'use strict';var util=require(_0xd5c5('0x0'));var _=require(_0xd5c5('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0xd5c5('0x2'));var utils=require(_0xd5c5('0x3'));var hopperUtils=require(_0xd5c5('0x4'));var ut=require(_0xd5c5('0x5'));var config=require('../../../config/environment/');var logger=require(_0xd5c5('0x6'))(_0xd5c5('0x7'));var loggerBooked=require('../../../config/logger')(_0xd5c5('0x8'));var loggerPredictive=require(_0xd5c5('0x6'))(_0xd5c5('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xd5c5('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xd5c5('0xb'));var ami=require('../ami');config[_0xd5c5('0xc')]=_[_0xd5c5('0xd')](config[_0xd5c5('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xd5c5('0xe'))(new Redis(config[_0xd5c5('0xc')]));var cmHopper=require(_0xd5c5('0xf'));var voiceQueueRt=require(_0xd5c5('0x10'));var RpcSetting=require(_0xd5c5('0x11'));var Interval=require(_0xd5c5('0x12'));var Action=require(_0xd5c5('0x13'));var History=require(_0xd5c5('0x14'));var Final=require(_0xd5c5('0x15'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xd5c5('0x16'));var Hangup=require(_0xd5c5('0x17'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xd5c5('0x18')][_0xd5c5('0x19')]=function(_0x545573){this[_0xd5c5('0x1a')]=this[_0xd5c5('0x1a')]?this[_0xd5c5('0x1a')][_0xd5c5('0x1b')](_0x545573):_0x545573();};function Dialer(_0x5067ae,_0x225c71){this[_0xd5c5('0x1c')]=new Sequence();this['preview']=_0x225c71;this[_0xd5c5('0x1d')]=_0x5067ae[_0xd5c5('0x1d')];this[_0xd5c5('0x1e')]=_0x5067ae[_0xd5c5('0x1e')];this[_0xd5c5('0x1f')]=_0x5067ae[_0xd5c5('0x1f')];this['trunks']=_0x5067ae[_0xd5c5('0x20')];this[_0xd5c5('0x21')]=config[_0xd5c5('0x21')]||0x2;this[_0xd5c5('0x22')]={};this['actions']={};this[_0xd5c5('0x23')]={};this[_0xd5c5('0x24')]={};this[_0xd5c5('0x25')]={};this[_0xd5c5('0x26')]={};this[_0xd5c5('0x27')]={};this[_0xd5c5('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};this['queuesSummary']={};ami['on']('agentconnect',this[_0xd5c5('0x29')]['bind'](this));ami['on'](_0xd5c5('0x2a'),this['syncQueueCallerAbandon'][_0xd5c5('0x2b')](this));ami['on'](_0xd5c5('0x2c'),this['syncOriginateResponse']['bind'](this));ami['on'](_0xd5c5('0x2d'),this[_0xd5c5('0x2e')]['bind'](this));ami['on']('custom:queuesummary',this[_0xd5c5('0xb')][_0xd5c5('0x2b')](this));ami['on'](_0xd5c5('0x2f'),this[_0xd5c5('0x30')][_0xd5c5('0x2b')](this));ami['on'](_0xd5c5('0x31'),this[_0xd5c5('0x32')][_0xd5c5('0x2b')](this));ami['on']('newexten',this[_0xd5c5('0x33')][_0xd5c5('0x2b')](this));ami['on'](_0xd5c5('0x34'),this[_0xd5c5('0x35')][_0xd5c5('0x2b')](this));ami['on'](_0xd5c5('0x36'),this[_0xd5c5('0x37')]['bind'](this));ami['on'](_0xd5c5('0x38'),this[_0xd5c5('0x39')]['bind'](this));this[_0xd5c5('0x3a')]();this[_0xd5c5('0x3b')]();RpcSetting[_0xd5c5('0x3c')]()[_0xd5c5('0x3d')](function(_0x58b742){previewRecallmeReminderInterval=_0x58b742[_0xd5c5('0x3e')];});}function isNotNull(_0x1357fe){return _0x1357fe!==null&&!_[_0xd5c5('0x3f')](_0x1357fe);}function msgResponse(_0x4ba001,_0x3e4788,_0x2def99){return{'action':_0x4ba001,'response':_0x3e4788,'message':_0x2def99,'stack':_0x2def99};}function emit(_0x4e624e,_0x22b97e,_0x44660c){io['to'](_0x4e624e)[_0xd5c5('0x40')](_0x22b97e,_0x44660c);}function emitOutboundVoiceQueueSummary(_0x5d5c24){if(_0x5d5c24[_0xd5c5('0x41')]===_0xd5c5('0x42')){logger[_0xd5c5('0x43')](_0xd5c5('0x44'),util['inspect'](_0x5d5c24,{'showHidden':![],'depth':null}));emit(util[_0xd5c5('0x45')](_0xd5c5('0x46'),_0x5d5c24['name']),_0xd5c5('0x47'),_0x5d5c24);}}function checkGetDataPredictive(_0x35be6f){if(isNotNull(_0x35be6f)&&!_[_0xd5c5('0x48')](_0x35be6f)){loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x4a'));loggerPredictive['info'](_0xd5c5('0x4b'),_0x35be6f[_0xd5c5('0x4c')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x4d'),_0x35be6f['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x4e'),_0x35be6f[_0xd5c5('0x4f')]);loggerPredictive[_0xd5c5('0x49')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35be6f[_0xd5c5('0x50')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x51'),_0x35be6f['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x52'),_0x35be6f[_0xd5c5('0x53')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x54'));if(_0x35be6f[_0xd5c5('0x4c')]>0x0){if(!_[_0xd5c5('0x3f')](_0x35be6f[_0xd5c5('0x53')])&&_0x35be6f[_0xd5c5('0x53')]>0x0){return!![];}loggerPredictive[_0xd5c5('0x49')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x35be6f[_0xd5c5('0x55')])&&_0x35be6f[_0xd5c5('0x55')]>0x0){return!![];}loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x56'));}else{loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x57'));}}else{loggerPredictive['info'](_0xd5c5('0x58'));}return![];}function mergeDataErlangB(_0x448210){return function(_0x3a38ab){loggerPredictive['info'](_0xd5c5('0x59'));loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x5a'),_0x3a38ab[_0xd5c5('0x5b')]);loggerPredictive[_0xd5c5('0x49')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3a38ab[_0xd5c5('0x5c')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x5d'),_0x3a38ab[_0xd5c5('0x5e')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x5f'),_0x3a38ab[_0xd5c5('0x60')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x5d'),_0x3a38ab[_0xd5c5('0x5e')]);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x54'));_[_0xd5c5('0x61')](_0x448210,_0x3a38ab);};}function ifInterval(_0x1dc716,_0x1b7702){if(_[_0xd5c5('0x3f')](_0x1b7702)){return![];}return utils[_0xd5c5('0x62')](undefined,_0x1b7702)<_0x1dc716*0x3c;}function clearPredictiveAttributes(_0x4deb8e){if(_0x4deb8e[_0xd5c5('0x27')]){_0x4deb8e['startProgressive']=undefined;loggerPredictive[_0xd5c5('0x43')](_0x4deb8e[_0xd5c5('0x63')],_0xd5c5('0x64'));}if(_0x4deb8e[_0xd5c5('0x26')]){_0x4deb8e[_0xd5c5('0x26')]=undefined;loggerPredictive['debug'](_0x4deb8e[_0xd5c5('0x63')],'startPredictive\x20value\x20cleared');}if(_0x4deb8e[_0xd5c5('0x65')]){clearInterval(_0x4deb8e[_0xd5c5('0x65')]);_0x4deb8e[_0xd5c5('0x65')]=undefined;loggerPredictive[_0xd5c5('0x43')](_0x4deb8e[_0xd5c5('0x63')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x23462c,_0x272c60){return function(_0x21dbdd){loggerPredictive['error'](_0x272c60[_0xd5c5('0x63')],_0x23462c);loggerPredictive[_0xd5c5('0x66')](_0x21dbdd[_0xd5c5('0x67')]);clearPredictiveAttributes(_0x272c60);};}function loggerCatch(_0x41acd4){return function(_0xb8454b){logger[_0xd5c5('0x66')](_0x41acd4,util[_0xd5c5('0x68')](_0xb8454b,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x35100a,_0x54d540,_0x13b020){return function(_0x5bf67e){utils[_0xd5c5('0x69')](_0x54d540,_0x13b020,0x0);logger[_0xd5c5('0x66')](_0x35100a,util['inspect'](_0x5bf67e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x344032){return function(_0x1defb3){if(isNotNull(_0x1defb3)&&isNotNull(_0x1defb3[0x0])){if(_0x1defb3[0x0][_0xd5c5('0x6a')]>0x0){_0x344032[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')][_0xd5c5('0x6d')];logger[_0xd5c5('0x49')](_0xd5c5('0x6e')+_0x344032['name'],_0x1defb3[0x0]['contactsRescheduled'],_0xd5c5('0x6f'));}else{_0x344032['message']=utils[_0xd5c5('0x6c')][_0xd5c5('0x70')];logger[_0xd5c5('0x49')]('[getContactDialer2][Empty]'+_0x344032[_0xd5c5('0x63')]);}}};}function createObjHistory(_0x3c8baa,_0x25bf2b,_0x449ad4,_0x3e942b,_0x450904){_0x3c8baa[_0xd5c5('0x6b')]=_0x449ad4;var _0x4e6f3b=new Action(_0x3c8baa,_0x25bf2b);var _0x585dea=new History(_0x4e6f3b);_0x585dea[_0xd5c5('0x71')]=_0x3e942b;_0x585dea[_0xd5c5('0x72')]=_0x450904;_0x585dea['endtime']=_0x4e6f3b[_0xd5c5('0x73')];return _0x585dea;}function unlockQueueStatus(_0x56ecef,_0x5356f1){setTimeout(function(){if(_[_0xd5c5('0x3f')](_0x56ecef[_0xd5c5('0x74')])){loggerBooked[_0xd5c5('0x66')](_0xd5c5('0x75'),_0x5356f1);}_0x56ecef[_0xd5c5('0x74')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x5356f1,JSON[_0xd5c5('0x76')](_[_0xd5c5('0x77')](_0x56ecef,[_0xd5c5('0x63'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x5d5fef){return function(){if(!isNotNull(_0x5d5fef['Interval'])){_0x5d5fef[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')][_0xd5c5('0x78')];throw _0x5d5fef[_0xd5c5('0x63')]+_0xd5c5('0x79');}if(!isNotNull(_0x5d5fef['Interval'][_0xd5c5('0x7a')])){_0x5d5fef[_0xd5c5('0x6b')]=utils['CAMPAIGN_STATUS'][_0xd5c5('0x78')];throw _0x5d5fef[_0xd5c5('0x63')]+_0xd5c5('0x79');}if(!isNotNull(_[_0xd5c5('0x48')](_0x5d5fef[_0xd5c5('0x7b')][_0xd5c5('0x7a')]))){_0x5d5fef[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')][_0xd5c5('0x78')];throw _0x5d5fef[_0xd5c5('0x63')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x5a694c){return function(){if(!utils['isIVRCampaignActive'](_0x5a694c)){_0x5a694c[_0xd5c5('0x6b')]=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x5a694c['name']+_0xd5c5('0x7c');}};}function emitCampaignSummary(_0xfe011d){if(utils[_0xd5c5('0x7d')](_0xfe011d)){emit(util[_0xd5c5('0x45')](_0xd5c5('0x7e'),_0xfe011d['name']),_0xd5c5('0x7f'),_0xfe011d);}}function loggerCatchQueueSummary(_0x448524,_0x1f3537){return function(_0xde2b08){clearPredictiveAttributes(_0x1f3537);emitCampaignSummary(_0x1f3537);loggerSyncQueueSummary[_0xd5c5('0x43')](_0x448524,util['inspect'](_0xde2b08,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x252d56){if(_0x252d56[_0xd5c5('0x80')]){if(_0x252d56[_0xd5c5('0x81')]===0x0){_0x252d56['sendMessageOneNotActive']=![];_0x252d56[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')][_0xd5c5('0x82')];loggerSyncQueueSummary['debug'](_0xd5c5('0x83'),_0x252d56[_0xd5c5('0x63')],'is\x20not\x20active');}else{_0x252d56[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')]['DISACTIVED'];loggerSyncQueueSummary['debug'](_0xd5c5('0x83'),_0x252d56['name'],'is\x20disactive');}emitCampaignSummary(_0x252d56);}}function myreject(_0x3a5596){return function(_0x3cc7d5){return _0x3a5596(msgResponse(_0xd5c5('0x84'),_0xd5c5('0x85'),JSON[_0xd5c5('0x76')](_0x3cc7d5)));};}Dialer[_0xd5c5('0x18')]['isTrunkReachable']=function(_0x3fa6dd){return!_['isUndefined'](_0x3fa6dd)&&_0x3fa6dd&&!_[_0xd5c5('0x3f')](_0x3fa6dd[_0xd5c5('0x63')])&&!_[_0xd5c5('0x3f')](_0x3fa6dd['active'])&&_0x3fa6dd['active']&&(this[_0xd5c5('0x20')][util[_0xd5c5('0x45')](_0xd5c5('0x86'),_0x3fa6dd[_0xd5c5('0x63')])][_0xd5c5('0x87')]===_0xd5c5('0x88')||this['trunks'][util[_0xd5c5('0x45')]('SIP/%s',_0x3fa6dd[_0xd5c5('0x63')])][_0xd5c5('0x87')]===_0xd5c5('0x89'));};Dialer[_0xd5c5('0x18')][_0xd5c5('0x8a')]=function(_0x2a27d2){var _0x37a7ec=this;return function(){if(!_0x37a7ec['isTrunkReachable'](_0x2a27d2[_0xd5c5('0x8b')])){if(!_0x37a7ec[_0xd5c5('0x8c')](_0x2a27d2[_0xd5c5('0x8d')])){_0x2a27d2['message']=utils[_0xd5c5('0x6c')][_0xd5c5('0x8e')];throw _0x2a27d2['name']+_0xd5c5('0x8f');}}};};Dialer[_0xd5c5('0x18')][_0xd5c5('0x90')]=function(_0x298bed,_0x33c65a,_0x4fc7b0,_0x15519e){var _0x422e2d=this;return function(){var _0x3f0041=!![];return _0x422e2d[_0xd5c5('0x91')](_0x298bed,_0x33c65a,_0x4fc7b0,_0x15519e,_0x3f0041);};};Dialer[_0xd5c5('0x18')]['checkIfTimeIntervals']=function(_0x3cd2fb,_0x5a8a2d,_0x42ec78,_0x4a59ce){var _0x44bd35=this;return function(){var _0x345c85=![];return _0x44bd35['ifTimeIvr'](_0x3cd2fb[_0xd5c5('0x7a')],_0x5a8a2d,_0x42ec78,_0x4a59ce,_0x345c85);};};Dialer['prototype']['ifTimeIvr']=function(_0x50d3ae,_0x37cbf9,_0x11df79,_0x25e594,_0xeb47ae){var _0x377a9b=[];return new Promise(function(_0x5d69ea,_0x2b3c79){if(!isNotNull(_0x50d3ae)){_0x25e594[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')]['NULL_INTERVAL'];return _0x2b3c79(msgResponse(_0xd5c5('0x92'),_0xd5c5('0x93'),_0x11df79+_0xd5c5('0x94')));}if(_['isEmpty'](_0x50d3ae)){_0x25e594[_0xd5c5('0x6b')]=utils['CAMPAIGN_STATUS'][_0xd5c5('0x95')];return _0x2b3c79(msgResponse(_0xd5c5('0x92'),'Failure',_0x11df79+_0xd5c5('0x96')));}if(_0x37cbf9&&_[_0xd5c5('0x3f')](config[_0xd5c5('0x97')][_0x37cbf9])){_0x25e594['message']=utils[_0xd5c5('0x6c')][_0xd5c5('0x98')];return _0x2b3c79(msgResponse('ifTime','Failure',_0x11df79+_0xd5c5('0x99')+_0x37cbf9));}if(_[_0xd5c5('0x9a')](_0x50d3ae)){for(var _0xe9f20=0x0;_0xe9f20<_0x50d3ae['length'];_0xe9f20+=0x1){_0x377a9b[_0xd5c5('0x9b')](ami[_0xd5c5('0x9c')]({'action':_0xd5c5('0x9d'),'command':util[_0xd5c5('0x45')]('iftime\x20%s,%s',_0x50d3ae[_0xe9f20][_0xd5c5('0x9e')],!_['isUndefined'](config[_0xd5c5('0x97')][_0x37cbf9])?_0x37cbf9:'')})[_0xd5c5('0x3d')](function(_0xc421e3){return _0xc421e3[_0xd5c5('0x9f')][_0xd5c5('0xa0')](_0xd5c5('0xa1'))>=0x0;})[_0xd5c5('0xa2')](myreject(_0x2b3c79)));}}else{_0x377a9b[_0xd5c5('0x9b')](ami[_0xd5c5('0x9c')]({'action':_0xd5c5('0x9d'),'command':util[_0xd5c5('0x45')](_0xd5c5('0xa3'),_0x50d3ae,!_[_0xd5c5('0x3f')](config[_0xd5c5('0x97')][_0x37cbf9])?_0x37cbf9:'')})[_0xd5c5('0x3d')](function(_0xef2fed){return _0xef2fed[_0xd5c5('0x9f')][_0xd5c5('0xa0')](_0xd5c5('0xa1'))>=0x0;})['catch'](myreject(_0x2b3c79)));}Promise[_0xd5c5('0xa4')](_0x377a9b)[_0xd5c5('0x3d')](function(_0x245c36){var _0x2b3532=_[_0xd5c5('0xa5')](_0x245c36);if(_0x2b3532){return _0x5d69ea(_0x2b3532);}else{_0x25e594['message']=_0xeb47ae?utils[_0xd5c5('0x6c')][_0xd5c5('0xa6')]:utils[_0xd5c5('0x6c')][_0xd5c5('0xa7')];return _0x2b3c79(msgResponse(_0xd5c5('0xa8'),_0xd5c5('0x93'),_0xd5c5('0xa9')+_0xeb47ae+'\x20'+_0x11df79+_0xd5c5('0xaa')+util['inspect'](_0x50d3ae,{'showHidden':![],'depth':null})+_0xd5c5('0xab')+_0x37cbf9));}})[_0xd5c5('0xa2')](function(_0x14f6fd){return _0x2b3c79(msgResponse(_0xd5c5('0x92'),_0xd5c5('0x93'),JSON[_0xd5c5('0x76')](_0x14f6fd)));});});};Dialer['prototype'][_0xd5c5('0x3a')]=function(){var _0x5eb9be=this;return cmHopper[_0xd5c5('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xd5c5('0x3d')](function(){setInterval(function(){_0x5eb9be[_0xd5c5('0xad')]();},0x3e8);});};Dialer[_0xd5c5('0x18')]['syncCampaigns']=function(){var _0x59f128=this;var _0x2221a6;for(var _0x558267 in this[_0xd5c5('0x1e')]){if(typeof this[_0xd5c5('0x1e')][_0x558267]!=='undefined'){_0x2221a6=this[_0xd5c5('0x1e')][_0x558267];if(utils[_0xd5c5('0x7d')](_0x2221a6)&&utils[_0xd5c5('0xae')](_0x2221a6)){_0x2221a6[_0xd5c5('0x80')]=!![];Promise[_0xd5c5('0xaf')]()['then'](checkIsIVRCampaignActive(_0x2221a6))['then'](checkInterval(_0x2221a6))['then'](_0x59f128[_0xd5c5('0x8a')](_0x2221a6))[_0xd5c5('0x3d')](_0x59f128[_0xd5c5('0x90')](_0x2221a6['dialGlobalInterval'],_0x2221a6[_0xd5c5('0xb0')],_0x2221a6[_0xd5c5('0x63')],_0x2221a6))[_0xd5c5('0x3d')](_0x59f128[_0xd5c5('0xb1')](_0x2221a6[_0xd5c5('0x7b')],_0x2221a6[_0xd5c5('0xb0')],_0x2221a6[_0xd5c5('0x63')],_0x2221a6))['then'](_0x59f128[_0xd5c5('0xb2')](_0x2221a6))['catch'](loggerCatchQueueSummary(_0xd5c5('0xb3'),_0x2221a6));}else{notSendMessagesCampaign(_0x2221a6);}}}};Dialer[_0xd5c5('0x18')]['checkDialMethod']=function(_0x565762){if(_0x565762[_0xd5c5('0xb4')]!=='predictive'){clearPredictiveAttributes(_0x565762);}switch(_0x565762['dialMethod']){case _0xd5c5('0xb5'):this[_0xd5c5('0xb6')](_0x565762,0x1);break;case _0xd5c5('0xb7'):this[_0xd5c5('0xb6')](_0x565762,_0x565762['dialPowerLevel']);break;case'predictive':this[_0xd5c5('0x9')](_0x565762);break;case _0xd5c5('0x8'):this[_0xd5c5('0xb6')](_0x565762,0x1);break;default:logger['error'](_0xd5c5('0xb8'),_0x565762[_0xd5c5('0x63')],_0xd5c5('0xb9'));}};Dialer['prototype'][_0xd5c5('0x92')]=function(_0x35c62c,_0x454da9){var _0x250441=_0x35c62c[_0xd5c5('0xb0')];var _0x52d821=_0x454da9?_0x35c62c[_0xd5c5('0xba')]:_0x35c62c[_0xd5c5('0x7b')]['Intervals'];logger[_0xd5c5('0xbb')](_0xd5c5('0xbc'),_0x52d821,_0x250441,_0x35c62c[_0xd5c5('0x63')],util[_0xd5c5('0x45')]('Voice\x20Queue\x20%s\x20$s',_0x35c62c[_0xd5c5('0x63')],_0x35c62c['id']));var _0x1754b5=null;return Interval[_0xd5c5('0xbd')](_0x52d821,_0x250441)[_0xd5c5('0x3d')](function(_0xc1225f){if(_0xc1225f===!![]){return _0xc1225f;}else{_0x35c62c[_0xd5c5('0x6b')]=_0x454da9?utils[_0xd5c5('0x6c')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xd5c5('0x6c')][_0xd5c5('0xa7')];_0x1754b5=msgResponse('[ifTime][promiseAll]',_0xd5c5('0x93'),'Global:\x20'+_0x454da9+'\x20'+_0x35c62c[_0xd5c5('0x63')]+_0xd5c5('0xaa')+util[_0xd5c5('0x68')](_0x52d821,{'showHidden':![],'depth':null})+_0xd5c5('0xab')+_0x250441);}if(_0x1754b5!==null){logger[_0xd5c5('0xbb')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x1754b5);_0x1754b5[_0xd5c5('0xbe')]=_0x454da9;throw _0x1754b5;}})['catch'](function(_0x5c258e){logger[_0xd5c5('0x66')](_0xd5c5('0xbf'),_0x5c258e);throw msgResponse(_0xd5c5('0x84'),_0xd5c5('0x85'),util[_0xd5c5('0x68')](_0x5c258e,{'showHidden':![],'depth':null}));});};Dialer[_0xd5c5('0x18')][_0xd5c5('0x29')]=function(_0x236982){if(this['voiceQueues'][_0x236982[_0xd5c5('0xc0')]]){if(this[_0xd5c5('0x24')][_0x236982['uniqueid']]&&this[_0xd5c5('0x24')][_0x236982[_0xd5c5('0xc1')]][_0xd5c5('0x41')]!==_0xd5c5('0xc2')){this['updateOriginated'](this[_0xd5c5('0x1d')][_0x236982['queue']]);this[_0xd5c5('0x24')][_0x236982[_0xd5c5('0xc1')]]['answertime']=moment()[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xd5c5('0x2e')]=function(_0x1575a2){var _0x4a6f82=this[_0xd5c5('0x24')][_0x1575a2['uniqueid']];if(this[_0xd5c5('0x1d')][_0x1575a2[_0xd5c5('0xc0')]]){if(_0x4a6f82&&_0x4a6f82['type']!==_0xd5c5('0xc2')){delete this[_0xd5c5('0x24')][_0x1575a2['uniqueid']];this[_0xd5c5('0x1d')][_0x1575a2[_0xd5c5('0xc0')]][_0xd5c5('0xc3')]+=0x1;var _0x2e10ae=new AgentComplete(_0x4a6f82,_0x1575a2);if(_0x1575a2[_0xd5c5('0xc4')]===_0xd5c5('0xc5')){_0x2e10ae[_0xd5c5('0xc6')]=this[_0xd5c5('0x1d')][_0x1575a2['queue']][_0xd5c5('0xc7')]&&this[_0xd5c5('0x1d')][_0x1575a2[_0xd5c5('0xc0')]][_0xd5c5('0xc8')]?moment()['format'](_0xd5c5('0xc9')):undefined;}hopperUtils[_0xd5c5('0xca')](_0x2e10ae)['catch'](loggerCatch(_0xd5c5('0xcb')));hopperUtils[_0xd5c5('0xcc')](_0x2e10ae)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0xcd')));}}};Dialer[_0xd5c5('0x18')]['syncQueueCallerAbandon']=function(_0x43b473){var _0x124ca5=this[_0xd5c5('0x24')][_0x43b473[_0xd5c5('0xc1')]];var _0x58b375=this;var _0x4c8278=![];var _0x491a98;var _0xa3dcbc;if(this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]]){if(_0x124ca5&&_0x124ca5['type']!==_0xd5c5('0xc2')){delete this['uniqueId'][_0x43b473[_0xd5c5('0xc1')]];this[_0xd5c5('0xce')](this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]]);_0x124ca5['droptime']=moment()[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss');var _0x112bd0=new QueueCallerAbandon(_0x124ca5,_0x43b473);if(utils['getSeconds'](_0x124ca5[_0xd5c5('0xcf')],_0x124ca5['responsetime'])>=_0x124ca5[_0xd5c5('0xd0')]){this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0x4f')]+=0x1;this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xd1')]+=0x1;this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xd2')]+=0x1;_0x112bd0[_0xd5c5('0x71')]=0xa;_0x112bd0[_0xd5c5('0x72')]=_0xd5c5('0xd3');_0x112bd0[_0xd5c5('0xd4')]=_0xd5c5('0xd5');_0x112bd0[_0xd5c5('0xc6')]=this[_0xd5c5('0x1d')][_0x43b473['queue']][_0xd5c5('0xc7')]?moment()[_0xd5c5('0x45')](_0xd5c5('0xc9')):undefined;_0x112bd0['countdropretry']+=0x1;_0x112bd0[_0xd5c5('0xd6')]+=0x1;_0x491a98=this['voiceQueues'][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xd7')];_0xa3dcbc=this[_0xd5c5('0x1d')][_0x43b473['queue']][_0xd5c5('0xd8')];hopperUtils['verifyAdditionalPhones'](_0x112bd0,_0x112bd0['state'],_0x124ca5[_0xd5c5('0xd9')])['then'](function(_0x4b5b03){_0x4c8278=_0x4b5b03[_0xd5c5('0xda')]==0x1;if(_0x112bd0[_0xd5c5('0xdb')]>=_0x58b375['voiceQueues'][_0x43b473['queue']][_0xd5c5('0xdc')]){_0x58b375[_0xd5c5('0xdd')](_0x112bd0,_0x4b5b03[_0xd5c5('0xda')]);}else{hopperUtils[_0xd5c5('0xde')]({'active':![],'countdropretry':_0x112bd0[_0xd5c5('0xdb')],'scheduledat':moment()[_0xd5c5('0xdf')](_0x58b375[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]]['dialDropRetryFrequency'],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x124ca5[_0xd5c5('0xe1')],'ListId':_0x124ca5[_0xd5c5('0xe2')],'VoiceQueueId':_0x124ca5[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x124ca5[_0xd5c5('0xe4')]||undefined})['catch'](loggerCatch(_0xd5c5('0xe5')));var _0x4e49d2=new History(_0x112bd0);_0x4e49d2[_0xd5c5('0x71')]=0xa;_0x4e49d2['statedesc']=_0xd5c5('0xd3');_0x4e49d2[_0xd5c5('0x73')]=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));_0x4e49d2[_0xd5c5('0xe6')]=_0x4e49d2[_0xd5c5('0x73')];_0x4e49d2[_0xd5c5('0xe7')]=_0x112bd0[_0xd5c5('0xe7')];_0x4e49d2[_0xd5c5('0xe8')]=_0x112bd0[_0xd5c5('0xe8')];hopperUtils[_0xd5c5('0xca')](_0x4e49d2)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0xe9')));}})[_0xd5c5('0x3d')](function(){if(_0x4c8278)hopperUtils[_0xd5c5('0xea')](_0x112bd0,_0x491a98,_0xa3dcbc)[_0xd5c5('0x3d')](function(){return 0x1;});});}else{this[_0xd5c5('0x1d')][_0x43b473['queue']][_0xd5c5('0x50')]+=0x1;this['voiceQueues'][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xeb')]+=0x1;_0x112bd0['state']=0xb;_0x112bd0[_0xd5c5('0x72')]='Abandoned';_0x112bd0[_0xd5c5('0xd4')]=_0xd5c5('0xec');_0x112bd0['countabandonedretry']+=0x1;_0x112bd0['countglobal']+=0x1;_0x491a98=this[_0xd5c5('0x1d')][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xed')];_0xa3dcbc=this[_0xd5c5('0x1d')][_0x43b473['queue']][_0xd5c5('0xd8')];hopperUtils[_0xd5c5('0xee')](_0x112bd0,_0x112bd0[_0xd5c5('0x71')],_0x124ca5[_0xd5c5('0xd9')])[_0xd5c5('0x3d')](function(_0x111680){if(_0x112bd0[_0xd5c5('0xef')]>=_0x58b375['voiceQueues'][_0x43b473[_0xd5c5('0xc0')]][_0xd5c5('0xf0')]){_0x58b375[_0xd5c5('0xdd')](_0x112bd0,_0x111680[_0xd5c5('0xda')]);}else{hopperUtils[_0xd5c5('0xde')]({'active':![],'countabandonedretry':_0x112bd0[_0xd5c5('0xef')],'scheduledat':moment()['add'](_0x58b375[_0xd5c5('0x1d')][_0x43b473['queue']]['dialAbandonedRetryFrequency'],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x124ca5[_0xd5c5('0xe1')],'ListId':_0x124ca5[_0xd5c5('0xe2')],'VoiceQueueId':_0x124ca5[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x124ca5[_0xd5c5('0xe4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0xb981ee=new History(_0x112bd0);_0xb981ee[_0xd5c5('0x71')]=0xb;_0xb981ee[_0xd5c5('0x72')]='Abandoned';_0xb981ee[_0xd5c5('0x73')]=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));_0xb981ee[_0xd5c5('0xe6')]=_0xb981ee[_0xd5c5('0x73')];_0xb981ee[_0xd5c5('0xe7')]=_0x112bd0[_0xd5c5('0xe7')];_0xb981ee['calleridnum']=_0x112bd0[_0xd5c5('0xe8')];hopperUtils[_0xd5c5('0xca')](_0xb981ee)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0xf1')));}})[_0xd5c5('0x3d')](function(){if(_0x4c8278)hopperUtils['swapAdditionalPhones'](_0x112bd0,_0x491a98,_0xa3dcbc)[_0xd5c5('0x3d')](function(){return 0x1;});});}}}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x33')]=function(_0xc4afb4){if(this[_0xd5c5('0xf2')][_0xc4afb4['uniqueid']]){this[_0xd5c5('0xf2')][_0xc4afb4[_0xd5c5('0xc1')]][_0xd5c5('0xf3')]=_0xc4afb4['channel'];}if(this[_0xd5c5('0x24')][_0xc4afb4[_0xd5c5('0xc1')]]){this[_0xd5c5('0x24')][_0xc4afb4[_0xd5c5('0xc1')]][_0xd5c5('0xf3')]=_0xc4afb4['channel'];}};Dialer[_0xd5c5('0x18')]['syncQueueMember']=function(_0x5783f7){if(!this[_0xd5c5('0xf2')][_0x5783f7[_0xd5c5('0xf4')]]){return;}var _0x3221b6=this[_0xd5c5('0x1d')][this[_0xd5c5('0xf2')][_0x5783f7['actionid']][_0xd5c5('0xc0')]][_0xd5c5('0xf5')]||_0xd5c5('0xf6');if(_0x3221b6===_0xd5c5('0xf7')){if(this['actions'][_0x5783f7[_0xd5c5('0xf4')]]&&_['isNil'](this[_0xd5c5('0xf2')][_0x5783f7[_0xd5c5('0xf4')]][_0xd5c5('0xf8')])&&_0x5783f7[_0xd5c5('0x87')]==='1'&&_0x5783f7['paused']==='0'){if(this[_0xd5c5('0x1f')][_0x5783f7['stateinterface']]){if(!this[_0xd5c5('0x1f')][_0x5783f7[_0xd5c5('0xf9')]]['locked']){this['agents'][_0x5783f7[_0xd5c5('0xf9')]][_0xd5c5('0xf8')]=!![];this[_0xd5c5('0xf2')][_0x5783f7['actionid']][_0xd5c5('0xf8')]=!![];this[_0xd5c5('0xf2')][_0x5783f7[_0xd5c5('0xf4')]][_0xd5c5('0xf9')]=_0x5783f7[_0xd5c5('0xf9')];}}}}else if(_0x3221b6===_0xd5c5('0xf6')){if(this['actions'][_0x5783f7[_0xd5c5('0xf4')]]){if(this[_0xd5c5('0x1f')][_0x5783f7[_0xd5c5('0xf9')]]){this[_0xd5c5('0xf2')][_0x5783f7['actionid']][_0xd5c5('0xf9')]=_0x5783f7[_0xd5c5('0xf9')];if(_[_0xd5c5('0xfa')](this[_0xd5c5('0xfb')][this['actions'][_0x5783f7['actionid']][_0xd5c5('0xc0')]])){this[_0xd5c5('0xfb')][this[_0xd5c5('0xf2')][_0x5783f7[_0xd5c5('0xf4')]]['queue']]=[];}this[_0xd5c5('0xfb')][this[_0xd5c5('0xf2')][_0x5783f7['actionid']]['queue']]['push'](_[_0xd5c5('0x61')](_[_0xd5c5('0x77')](this[_0xd5c5('0xf2')][_0x5783f7[_0xd5c5('0xf4')]],[_0xd5c5('0xfc'),_0xd5c5('0xf9')]),{'status':_0x5783f7[_0xd5c5('0x87')],'paused':_0x5783f7[_0xd5c5('0xfd')]}));}}}};Dialer[_0xd5c5('0x18')]['syncQueueStatusComplete']=function(_0x4f1cfe){if(!this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]]){return;}var _0x15aec9=this;var _0x1b4bf3=this['voiceQueues'][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]];var _0x23b789=_0x1b4bf3[_0xd5c5('0xf5')]||_0xd5c5('0xf6');if(_0x23b789===_0xd5c5('0xf7')){if(this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']]&&this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']][_0xd5c5('0xf9')]){this[_0xd5c5('0xfe')][_0xd5c5('0xff')](this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']][_0xd5c5('0xfc')],this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]]['stateinterface'])['catch'](function(_0x100366){logger[_0xd5c5('0x66')](_0xd5c5('0x100'),util[_0xd5c5('0x68')](_0x100366,{'showHidden':![],'depth':null}));})[_0xd5c5('0x1b')](function(){_0x15aec9[_0xd5c5('0xce')](_0x15aec9[_0xd5c5('0x1d')][_0x15aec9['actions'][_0x4f1cfe['actionid']]['queue']]);_0x15aec9[_0xd5c5('0x1f')][_0x15aec9[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]]['stateinterface']]['locked']=![];delete _0x15aec9[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]];unlockQueueStatus(_0x1b4bf3);});}else{this[_0xd5c5('0xce')](this[_0xd5c5('0x1d')][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]);hopperUtils[_0xd5c5('0xde')]({'active':![],'ContactId':this['actions'][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xe1')],'ListId':this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xe2')],'VoiceQueueId':this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']][_0xd5c5('0xe3')]||undefined,'CampaignId':this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']][_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]];unlockQueueStatus(_0x1b4bf3);}}else if(_0x23b789===_0xd5c5('0xf6')){var _0x2c2139;if(this[_0xd5c5('0xf2')][_0x4f1cfe['actionid']]&&!_['isEmpty'](this[_0xd5c5('0xfb')][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]]['queue']])){if(this['queueBookedRR'][_0x15aec9[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]){this[_0xd5c5('0x101')][_0x15aec9[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]=this['queueBookedRR'][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]?this[_0xd5c5('0x101')][this['actions'][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]:this['queueBooked'][this['actions'][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]]?this[_0xd5c5('0xfb')][this['actions'][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]][_0xd5c5('0x102')]||0x0:0x0;}this[_0xd5c5('0xfb')][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]][_0xd5c5('0x102')]=this[_0xd5c5('0x101')][this[_0xd5c5('0xf2')][_0x4f1cfe[_0xd5c5('0xf4')]][_0xd5c5('0xc0')]];for(var _0x5bf46f=0x0;_0x5bf46f=_0x4fff1d[_0xd5c5('0x12c')]){_0x4e1e71[_0xd5c5('0x12d')](_0x300d2e,_0x1dfaf3,_0x5e4145,_0xd5c5('0x12e'));}else{if(_0x300d2e['countmachineretry']>=_0x4fff1d[_0xd5c5('0x12f')]){_0x4e1e71[_0xd5c5('0x130')](_0x300d2e,_0x1dfaf3,_0x5e4145,_0xd5c5('0x131'));}else{hopperUtils[_0xd5c5('0xde')]({'active':![],'countmachineretry':_0x300d2e['countmachineretry'],'scheduledat':moment()[_0xd5c5('0xdf')](_0x4fff1d[_0xd5c5('0x132')],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x300d2e['ContactId'],'ListId':_0x300d2e[_0xd5c5('0xe2')],'VoiceQueueId':_0x300d2e[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x300d2e[_0xd5c5('0xe4')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1dfaf3({'reschedule':0x1});}}});}if(_0x9f0eff['type']===_0xd5c5('0xc2')&&this[_0xd5c5('0x1e')][_0x9f0eff[_0xd5c5('0xc0')]][_0xd5c5('0x118')]&&_0x3d2f38[_0xd5c5('0x119')]===_0xd5c5('0x11a')){delete this[_0xd5c5('0x24')][_0x3d2f38[_0xd5c5('0xc1')]];this['updateOriginated'](this[_0xd5c5('0x1e')][_0x9f0eff[_0xd5c5('0xc0')]]);_0x3442ee=new Hangup(_0x9f0eff,_0x3d2f38);_0x3442ee[_0xd5c5('0x71')]=0x12;_0x3442ee[_0xd5c5('0x72')]=_0xd5c5('0x11c');_0x3442ee['membername']='AMD';ami['emit'](_0xd5c5('0x11f'),ut['buildObj'](_0x3442ee,'amd'));this['saveInDb'](_0x3442ee,_0xd5c5('0x133'),'[syncHangupInAMDIvr]');}if(_0x9f0eff['type']===_0xd5c5('0xc2')&&this[_0xd5c5('0x1e')][_0x9f0eff['queue']][_0xd5c5('0x118')]&&_0x3d2f38[_0xd5c5('0x119')]===_0xd5c5('0x124')){return new Promise(function(_0x5685ad,_0xfb3816){delete _0x4e1e71[_0xd5c5('0x24')][_0x3d2f38[_0xd5c5('0xc1')]];_0x4e1e71['updateOriginated'](_0x4e1e71[_0xd5c5('0x1e')][_0x9f0eff[_0xd5c5('0xc0')]]);_0x4e1e71[_0xd5c5('0x1e')][_0x9f0eff['queue']][_0xd5c5('0xc3')]+=0x1;_0x4e1e71[_0xd5c5('0x1e')][_0x9f0eff[_0xd5c5('0xc0')]][_0xd5c5('0x11b')]+=0x1;var _0x382b35=_0x4e1e71[_0xd5c5('0x1e')][_0x9f0eff['queue']];var _0x154c3b=new Hangup(_0x9f0eff,_0x3d2f38);_0x154c3b[_0xd5c5('0x71')]=0x13;_0x154c3b[_0xd5c5('0x72')]=_0xd5c5('0x125');_0x154c3b[_0xd5c5('0x11d')]=_0xd5c5('0x11e');_0x154c3b[_0xd5c5('0x126')]+=0x1;_0x154c3b[_0xd5c5('0xd6')]+=0x1;_0x154c3b['amd']=!![];ami[_0xd5c5('0x40')](_0xd5c5('0x11f'),ut[_0xd5c5('0x120')](_0x154c3b,_0xd5c5('0x121')));hopperUtils['createHistory'](_0x154c3b)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x127')));if(_0x154c3b['countbusyretry']+_0x154c3b[_0xd5c5('0x129')]+_0x154c3b[_0xd5c5('0x12a')]+_0x154c3b[_0xd5c5('0x12b')]+_0x154c3b[_0xd5c5('0xdb')]+_0x154c3b[_0xd5c5('0xef')]+_0x154c3b['countmachineretry']+_0x154c3b[_0xd5c5('0x134')]>=_0x382b35[_0xd5c5('0x12c')]){_0x4e1e71[_0xd5c5('0x12d')](_0x154c3b,_0x5685ad,_0xfb3816,_0xd5c5('0x12e'));}else{if(_0x154c3b[_0xd5c5('0x126')]>=_0x382b35[_0xd5c5('0x12f')]){_0x4e1e71[_0xd5c5('0x130')](_0x154c3b,_0x5685ad,_0xfb3816,_0xd5c5('0x131'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x154c3b[_0xd5c5('0x126')],'scheduledat':moment()[_0xd5c5('0xdf')](_0x382b35['dialMachineRetryFrequency'],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x154c3b[_0xd5c5('0xe1')],'ListId':_0x154c3b['ListId'],'VoiceQueueId':_0x154c3b[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x154c3b[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x135')));_0x5685ad({'reschedule':0x1});}}});}}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x32')]=function(_0x338c2c){var _0x27d7c6=this[_0xd5c5('0x24')][_0x338c2c['uniqueid']];var _0x49855d;if(_0x27d7c6&&_0x27d7c6['type']===_0xd5c5('0xc2')){delete this[_0xd5c5('0x24')][_0x338c2c['uniqueid']];this[_0xd5c5('0xce')](this['campaigns'][_0x27d7c6[_0xd5c5('0xc0')]]);this[_0xd5c5('0x1e')][_0x27d7c6['queue']][_0xd5c5('0x136')]+=0x1;_0x49855d=new Hangup(_0x27d7c6,_0x338c2c);hopperUtils[_0xd5c5('0xca')](_0x49855d)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x137')));hopperUtils['moveContactManagedDialer'](_0x49855d)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x138')));}if(_0x27d7c6&&_0x27d7c6[_0xd5c5('0x41')]!=='ivr'&&isNotNull(this[_0xd5c5('0x1d')][_0x27d7c6[_0xd5c5('0xc0')]][_0xd5c5('0x139')])){delete this[_0xd5c5('0x24')][_0x338c2c[_0xd5c5('0xc1')]];this['updateOriginated'](this[_0xd5c5('0x1d')][_0x27d7c6['queue']]);this[_0xd5c5('0x1d')][_0x27d7c6[_0xd5c5('0xc0')]][_0xd5c5('0xc3')]+=0x1;this[_0xd5c5('0x1d')][_0x27d7c6[_0xd5c5('0xc0')]][_0xd5c5('0x11b')]+=0x1;_0x49855d=new Hangup(_0x27d7c6,_0x338c2c);_0x49855d[_0xd5c5('0x71')]=0x10;_0x49855d[_0xd5c5('0x72')]=_0xd5c5('0x13a');_0x49855d[_0xd5c5('0x11d')]=_0xd5c5('0x13b');hopperUtils[_0xd5c5('0xca')](_0x49855d)[_0xd5c5('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xd5c5('0xcc')](_0x49855d)['catch'](loggerCatch(_0xd5c5('0x138')));}if(_0x27d7c6&&_0x27d7c6[_0xd5c5('0x41')]!==_0xd5c5('0xc2')&&!isNotNull(this[_0xd5c5('0x1d')][_0x27d7c6['queue']][_0xd5c5('0x139')])){delete this[_0xd5c5('0x24')][_0x338c2c[_0xd5c5('0xc1')]];this[_0xd5c5('0xce')](this['voiceQueues'][_0x27d7c6[_0xd5c5('0xc0')]]);this['voiceQueues'][_0x27d7c6[_0xd5c5('0xc0')]][_0xd5c5('0x13c')]+=0x1;_0x49855d=new Hangup(_0x27d7c6,_0x338c2c);_0x49855d[_0xd5c5('0x71')]=0xc;_0x49855d['statedesc']=_0x338c2c[_0xd5c5('0x13d')];_0x49855d[_0xd5c5('0x11d')]=_0xd5c5('0x13e');hopperUtils['createHistory'](_0x49855d)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x137')));hopperUtils[_0xd5c5('0xcc')](_0x49855d)[_0xd5c5('0xa2')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xd5c5('0x18')][_0xd5c5('0xb')]=function(_0x1f9f2d){var _0x435fac=this;if(!_0x435fac[_0xd5c5('0x13f')][_0x1f9f2d['name']]){_0x435fac['queuesSummary'][_0x1f9f2d[_0xd5c5('0x63')]]={'running':![]};}else if(_0x435fac[_0xd5c5('0x13f')][_0x1f9f2d['name']][_0xd5c5('0x140')]===!![]){return;}else if(_0x435fac[_0xd5c5('0x13f')][_0x1f9f2d['name']][_0xd5c5('0x140')]===![]){_0x435fac[_0xd5c5('0x13f')][_0x1f9f2d['name']]['running']=!![];}var _0x10b622=_0x435fac[_0xd5c5('0x1d')][_0x1f9f2d[_0xd5c5('0x63')]];var _0x3aa855=_0x10b622[_0xd5c5('0x6b')]!==utils['CAMPAIGN_STATUS'][_0xd5c5('0x82')];var _0x45fb89=utils['isPreviewCampaign'](_0x10b622);_0x10b622[_0xd5c5('0x141')]=utils['getQueueCampaignStatusMessage'](_0x10b622,_0x435fac[_0xd5c5('0x20')]);Promise[_0xd5c5('0xaf')]()['then'](function(){if(_0x10b622[_0xd5c5('0x141')]===utils[_0xd5c5('0x6c')][_0xd5c5('0x82')]){if(_0x3aa855){clearPredictiveAttributes(_0x10b622);_0x1f9f2d['startPredictive']=undefined;_0x1f9f2d[_0xd5c5('0x27')]=undefined;}if(_0x10b622[_0xd5c5('0x141')]===utils[_0xd5c5('0x6c')][_0xd5c5('0x82')]){_0x1f9f2d[_0xd5c5('0x142')]=0x0;_0x1f9f2d['paused']=0x0;_0x1f9f2d[_0xd5c5('0x143')]=0x0;_0x1f9f2d[_0xd5c5('0x144')]=0x0;_0x1f9f2d[_0xd5c5('0x145')]=0x0;}}else if(_0x10b622[_0xd5c5('0x141')]===utils[_0xd5c5('0x6c')][_0xd5c5('0x146')]&&!_0x45fb89){return _0x435fac[_0xd5c5('0x92')](_0x10b622,!![])[_0xd5c5('0x3d')](function(){return _0x435fac[_0xd5c5('0x92')](_0x10b622,![]);})[_0xd5c5('0x3d')](function(){return _0x435fac[_0xd5c5('0x147')](_0x10b622);})[_0xd5c5('0xa2')](function(_0x1b6abc){loggerSyncQueueSummary[_0xd5c5('0x43')](_0xd5c5('0x148'),util[_0xd5c5('0x68')](_0x1b6abc,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x10b622);});}else{clearPredictiveAttributes(_0x10b622);}})[_0xd5c5('0x3d')](function(){var _0x841f22=_0x1f9f2d[_0xd5c5('0x149')](_0x10b622);if(_0x841f22||_0x10b622[_0xd5c5('0x14a')]){_0x10b622[_0xd5c5('0x14a')]=![];_0x1f9f2d[_0xd5c5('0x14b')](_0x10b622);Object[_0xd5c5('0x14c')](_0x10b622,_0x1f9f2d);emitOutboundVoiceQueueSummary(_0x1f9f2d);}_0x435fac['queuesSummary'][_0x10b622[_0xd5c5('0x63')]][_0xd5c5('0x140')]=![];})['catch'](function(_0x340012){logger[_0xd5c5('0x66')]('[syncQueueSummary]',util[_0xd5c5('0x68')](_0x340012,{'showHidden':![],'depth':null}));_0x435fac[_0xd5c5('0x13f')][_0x10b622['name']][_0xd5c5('0x140')]=![];});};Dialer[_0xd5c5('0x18')][_0xd5c5('0x30')]=_[_0xd5c5('0x14d')](function(){var _0x5c6fce=_[_0xd5c5('0x14e')](this[_0xd5c5('0x1d')],function(_0x1b2c59){return _0x1b2c59['dialPreviewRecallmeReminder'];});var _0xa4326a=_['filter'](this[_0xd5c5('0x1f')],function(_0x3b1b8f){return _0x3b1b8f[_0xd5c5('0x14f')]&&_0x3b1b8f['status']===_0xd5c5('0x88');});if(_0x5c6fce['length']>0x0&&_0xa4326a[_0xd5c5('0x103')]>0x0){return Promise['resolve']()[_0xd5c5('0x3d')](cmHopper['handlePreviewRecallNotifications'](_[_0xd5c5('0x150')](_0x5c6fce,'id'),previewRecallmeReminderInterval,_[_0xd5c5('0x150')](_0xa4326a,'id')))[_0xd5c5('0x3d')](function(_0x14109e){for(var _0x4eeff3=0x0;_0x4eeff3<_0x14109e[_0xd5c5('0x103')];_0x4eeff3++){var _0x3caa34=_0x14109e[_0x4eeff3][_0xd5c5('0x151')][_0xd5c5('0x63')];if(_0x3caa34)io['to'](util[_0xd5c5('0x45')](_0xd5c5('0x152'),_0x3caa34))[_0xd5c5('0x40')](_0xd5c5('0x153'),{'hopper':_0x14109e[_0x4eeff3]});}})[_0xd5c5('0xa2')](function(_0x5abd15){logger[_0xd5c5('0x66')](_0xd5c5('0x154'),_0x5abd15);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xd5c5('0x18')]['loopClearZombieChannels']=function(){var _0x4c3c26=this;setInterval(function(){_0x4c3c26[_0xd5c5('0x155')](_0x4c3c26['uniqueId'],_0xd5c5('0x156'));_0x4c3c26['clearZombieChannels'](_0x4c3c26[_0xd5c5('0xf2')],_0xd5c5('0x157'));},0x32c8);};Dialer[_0xd5c5('0x18')][_0xd5c5('0x155')]=function(_0x404090,_0x1ef721){var _0x144685=this;for(var _0x2e1685 in _0x404090){if(typeof _0x404090[_0x2e1685]!=='undefined'){this['sequence'][_0xd5c5('0x19')](function(){if(!_[_0xd5c5('0xfa')](_0x404090[_0x2e1685])){return ami[_0xd5c5('0x9c')]({'action':_0xd5c5('0x87'),'channel':_0x404090[_0x2e1685][_0xd5c5('0xf3')]})[_0xd5c5('0xa2')](function(_0x1e945f){if(_0x1e945f['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x404090[_0x2e1685]&&_0x404090[_0x2e1685][_0xd5c5('0x41')]!==_0xd5c5('0xc2')){_0x144685[_0xd5c5('0xce')](_0x144685[_0xd5c5('0x1d')][_0x404090[_0x2e1685][_0xd5c5('0xc0')]]);logger[_0xd5c5('0x66')](_0xd5c5('0x158'),_0x1ef721,_0x2e1685,_0x404090[_0x2e1685][_0xd5c5('0xc0')]);delete _0x404090[_0x2e1685];}if(_0x404090[_0x2e1685]&&_0x404090[_0x2e1685][_0xd5c5('0x41')]===_0xd5c5('0xc2')){_0x144685['updateOriginated'](_0x144685[_0xd5c5('0x1e')][_0x404090[_0x2e1685][_0xd5c5('0xc0')]]);logger[_0xd5c5('0x66')](_0xd5c5('0x159'),_0x1ef721,_0x2e1685,_0x404090[_0x2e1685][_0xd5c5('0xc0')]);delete _0x404090[_0x2e1685];}},0x2328);}});}});}}};Dialer['prototype'][_0xd5c5('0x15a')]=function(_0x2eb711){return Promise[_0xd5c5('0xaf')]()[_0xd5c5('0x3d')](voiceQueueRt[_0xd5c5('0x15a')](_0x2eb711))[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x15b')));};Dialer[_0xd5c5('0x18')][_0xd5c5('0xce')]=function(_0x1164f7){if(!_[_0xd5c5('0x3f')](_0x1164f7)&&_0x1164f7!==null){if(typeof _0x1164f7[_0xd5c5('0x81')]!==_0xd5c5('0x15c')){if(_0x1164f7[_0xd5c5('0x81')]>0x0){_0x1164f7[_0xd5c5('0x81')]-=0x1;}else{logger['error'](_0xd5c5('0x15d'));}}}else{logger[_0xd5c5('0x66')](_0xd5c5('0x15e'));}};Dialer[_0xd5c5('0x18')]['loggerHandler']=function(_0x3ee506,_0xbb3f17){var _0x48f3ab=this;return function(_0xc66b20){_0x48f3ab[_0xd5c5('0xce')](_0xbb3f17);logger[_0xd5c5('0x66')](_0x3ee506,util[_0xd5c5('0x68')](_0xc66b20,{'showHidden':![],'depth':null}));};};Dialer[_0xd5c5('0x18')][_0xd5c5('0x15f')]=function(_0xefbc8e,_0x5868d0,_0x143317){var _0x4085df={'state':0x19,'statedesc':'notFound'};this[_0xd5c5('0xce')](_0x5868d0);this[_0xd5c5('0x122')](_['merge'](_0x4085df,_['pick'](_0x143317,[_0xd5c5('0xe1'),_0xd5c5('0xe2'),_0xd5c5('0x160'),'VoiceQueueId',_0xd5c5('0xe4')])),_0xd5c5('0x161'),_0xd5c5('0x162'));logger[_0xd5c5('0x66')](_0xefbc8e);};Dialer[_0xd5c5('0x18')][_0xd5c5('0x122')]=function(_0x427fdc,_0x37241e,_0x573698){hopperUtils[_0xd5c5('0xca')](_0x427fdc)['catch'](loggerCatch(_0x37241e));hopperUtils[_0xd5c5('0xcc')](_0x427fdc)[_0xd5c5('0xa2')](loggerCatch(_0x573698));};Dialer[_0xd5c5('0x18')][_0xd5c5('0xdd')]=function(_0x5adc59,_0x2af9e6){hopperUtils[_0xd5c5('0xca')](_0x5adc59)[_0xd5c5('0xa2')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2af9e6==0x0){hopperUtils['moveContactManagedDialer'](_0x5adc59)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x163')));}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x154')]=function(_0x1ea923){return Promise['resolve']()[_0xd5c5('0x3d')](cmHopper[_0xd5c5('0x164')](_0x1ea923['id'],previewRecallmeReminderInterval))[_0xd5c5('0x3d')](function(_0x41a33e){for(var _0x2a5dc1=0x0;_0x2a5dc1<_0x41a33e['length'];_0x2a5dc1++){var _0x1e772b=_0x41a33e[_0x2a5dc1]['Agent']['name'];if(_0x1e772b)io['to'](util[_0xd5c5('0x45')]('user:%s',_0x1e772b))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x41a33e[_0x2a5dc1]});}})['catch'](function(){});};Dialer[_0xd5c5('0x18')][_0xd5c5('0xb2')]=function(_0x42c80d){var _0x1eaad6=this;return function(){_0x1eaad6[_0xd5c5('0x165')](_0x42c80d);};};Dialer[_0xd5c5('0x18')][_0xd5c5('0x166')]=function(_0x5714d4,_0x2520bf){var _0x4cb102=this;var _0x5c7fcf=uuid['v4']();this['actions'][_0x5c7fcf]=new Action(_0x5714d4,_0x2520bf,_0x5c7fcf);return new Promise(function(_0x478e94,_0x314a38){if(_['isUndefined'](_0x5714d4)&&typeof _0x5714d4!==_0xd5c5('0x167')){return _0x314a38(msgResponse(_0xd5c5('0x168'),_0xd5c5('0x93'),_0xd5c5('0x169')));}if(_[_0xd5c5('0x3f')](_0x2520bf[_0xd5c5('0x16a')])||_0x2520bf[_0xd5c5('0x16a')]===null){return _0x314a38(msgResponse(_0xd5c5('0x168'),_0xd5c5('0x93'),'contact\x20is\x20undefine'));}var _0x23b96a={'XMD-CALLERID':_0x4cb102[_0xd5c5('0xf2')][_0x5c7fcf]['getCaller'](),'XMD-AGI':_0x5714d4[_0xd5c5('0x139')]?util[_0xd5c5('0x45')](_0xd5c5('0x16b'),ipAgi,_0x5714d4[_0xd5c5('0x139')]):_0xd5c5('0x16c'),'XMD-AGIAFTER':_0x5714d4[_0xd5c5('0xc7')]?util['format'](_0xd5c5('0x16b'),ipAgi,_0x5714d4[_0xd5c5('0xc7')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x5714d4)?util[_0xd5c5('0x45')]('\x22%s,%s%s,,,%s\x22',_0x5714d4[_0xd5c5('0x63')],_0x5714d4[_0xd5c5('0x16d')]||'',_0x5714d4['dialAgiAfterHangupAgent']?'c':'',_0x5714d4[_0xd5c5('0xd0')]||0x3):_0xd5c5('0x16c'),'XMD-CONTACTID':_0x2520bf['ContactId'],'XMD-CDRTYPE':_0xd5c5('0x7'),'CALLERID(all)':_0x4cb102[_0xd5c5('0xf2')][_0x5c7fcf][_0xd5c5('0x16e')](),'XMD-AMD':_0x5714d4[_0xd5c5('0x118')]?_0xd5c5('0x146'):'NONE','XMD-DESTINATION':_0xd5c5('0x117')};if(_0x5714d4[_0xd5c5('0x118')]){_0x23b96a['XMD-AMDINITIALSILENCE']=_0x5714d4[_0xd5c5('0x16f')]||0x9c4;_0x23b96a[_0xd5c5('0x170')]=_0x5714d4[_0xd5c5('0x171')]||0x5dc;_0x23b96a[_0xd5c5('0x172')]=_0x5714d4[_0xd5c5('0x173')]||0x320;_0x23b96a[_0xd5c5('0x174')]=_0x5714d4[_0xd5c5('0x175')]||0x1388;_0x23b96a[_0xd5c5('0x176')]=_0x5714d4['dialAMDMinWordLength']||0x64;_0x23b96a[_0xd5c5('0x177')]=_0x5714d4[_0xd5c5('0x178')]||0x32;_0x23b96a[_0xd5c5('0x179')]=_0x5714d4[_0xd5c5('0x17a')]||0x3;_0x23b96a['XMD-AMDSILENCETHRESHOLD']=_0x5714d4[_0xd5c5('0x17b')]||0x100;_0x23b96a[_0xd5c5('0x17c')]=_0x5714d4['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x5714d4)){_0x23b96a['XMD-VOICEQUEUEID']=_0x2520bf[_0xd5c5('0xe3')];}else{_0x23b96a[_0xd5c5('0x17d')]=_0x2520bf[_0xd5c5('0xe4')];}var _0x31627c=utils[_0xd5c5('0x17e')](_0x2520bf[_0xd5c5('0x17f')]);Object['assign'](_0x23b96a,_0x31627c);var _0x28b6ef=_0x4cb102['isTrunkReachable'](_0x5714d4['Trunk'])?utils[_0xd5c5('0x180')](_0x5714d4['Trunk'][_0xd5c5('0x181')],_0x5714d4[_0xd5c5('0x182')],_0x5714d4[_0xd5c5('0x183')]>0x0?utils['getCallerIdRandom'](_0x5714d4[_0xd5c5('0x184')],_0x5714d4['dialRandomLastDigitCallerIdNumber']):_0x5714d4[_0xd5c5('0x184')]):utils[_0xd5c5('0x180')](_[_0xd5c5('0xfa')](_0x5714d4[_0xd5c5('0x8d')])?_0x5714d4['Trunk']['callerid']:_0x5714d4[_0xd5c5('0x8d')][_0xd5c5('0x181')],_0x5714d4[_0xd5c5('0x182')],_0x5714d4[_0xd5c5('0x183')]>0x0?utils[_0xd5c5('0x185')](_0x5714d4['dialOriginateCallerIdNumber'],_0x5714d4['dialRandomLastDigitCallerIdNumber']):_0x5714d4[_0xd5c5('0x184')]);if(_0x28b6ef){_0x23b96a[_0xd5c5('0x186')]=_0x4cb102[_0xd5c5('0xf2')][_0x5c7fcf][_0xd5c5('0x187')]=utils[_0xd5c5('0x188')](_0x28b6ef);_0x23b96a[_0xd5c5('0x189')]=_0x2520bf['phone'];}_0x5714d4[_0xd5c5('0x18a')]=_0x23b96a;return ami[_0xd5c5('0x9c')]({'actionid':_0x5c7fcf,'action':_0xd5c5('0x168'),'channel':_0x4cb102[_0xd5c5('0x8c')](_0x5714d4['Trunk'])?util[_0xd5c5('0x45')]('SIP/%s/%s%s',_0x5714d4[_0xd5c5('0x8b')][_0xd5c5('0x63')],isNotNull(_0x5714d4[_0xd5c5('0x18b')])?_0x5714d4[_0xd5c5('0x18b')]['trim']()||'':'',_0x5714d4['dialCutDigit']>0x0?_0x2520bf[_0xd5c5('0x16a')][_0xd5c5('0x18c')](_0x5714d4['dialCutDigit']):_0x2520bf[_0xd5c5('0x16a')]):util[_0xd5c5('0x45')]('SIP/%s/%s%s',_[_0xd5c5('0xfa')](_0x5714d4['TrunkBackup'])?_0x5714d4[_0xd5c5('0x8b')][_0xd5c5('0x63')]:_0x5714d4[_0xd5c5('0x8d')][_0xd5c5('0x63')],isNotNull(_0x5714d4[_0xd5c5('0x18b')])?_0x5714d4[_0xd5c5('0x18b')]['trim']()||'':'',_0x5714d4[_0xd5c5('0x18d')]>0x0?_0x2520bf[_0xd5c5('0x16a')]['substring'](_0x5714d4['dialCutDigit']):_0x2520bf[_0xd5c5('0x16a')]),'callerid':_0x28b6ef,'Exten':_0xd5c5('0x117'),'Context':_0xd5c5('0x18e'),'Priority':'1','variable':_0x23b96a,'timeout':(_0x5714d4[_0xd5c5('0x18f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5c7fcf})[_0xd5c5('0x3d')](function(_0x5d478d){return _0x478e94(_0x5d478d);})['catch'](function(_0x59e25a){_0x5714d4[_0xd5c5('0x190')]+=0x1;var _0x32d6f4=new History(_0x4cb102[_0xd5c5('0xf2')][_0x5c7fcf]);logger[_0xd5c5('0x66')](util[_0xd5c5('0x45')]('[originateError]:\x20%s',JSON[_0xd5c5('0x76')](_0x59e25a)));_0x32d6f4[_0xd5c5('0x71')]=0xe;_0x32d6f4['statedesc']='OriginateError';_0x32d6f4['starttime']=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));_0x32d6f4[_0xd5c5('0xe6')]=_0x32d6f4['starttime'];hopperUtils[_0xd5c5('0xca')](_0x32d6f4)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x191')));_0x4cb102[_0xd5c5('0xcc')](_0x32d6f4)[_0xd5c5('0xa2')](loggerCatch('[originate][error]'))[_0xd5c5('0x1b')](function(){delete _0x4cb102[_0xd5c5('0xf2')][_0x5c7fcf];return _0x314a38(msgResponse(_0xd5c5('0x168'),_0xd5c5('0x85'),_0xd5c5('0x192')));});});});};Dialer[_0xd5c5('0x18')][_0xd5c5('0x193')]=function(_0x37d8f9,_0x1b98a6,_0xdc468a){var _0x1626e9=new History(_0x1b98a6);if(_0x1626e9[_0xd5c5('0x128')]+_0x1626e9[_0xd5c5('0x129')]+_0x1626e9[_0xd5c5('0x12a')]+_0x1626e9[_0xd5c5('0x12b')]+_0x1626e9['countdropretry']+_0x1626e9[_0xd5c5('0xef')]+_0x1626e9['countmachineretry']+_0x1626e9['countagentrejectretry']>=_0xdc468a[_0xd5c5('0x12c')]-0x1){return!![];}switch(_0x37d8f9){case 0x3:if(_0x1626e9[_0xd5c5('0x12a')]>=_0xdc468a[_0xd5c5('0x194')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1626e9[_0xd5c5('0x12a')]+=0x1,'scheduledat':moment()[_0xd5c5('0xdf')](_0xdc468a[_0xd5c5('0x195')],'minutes')[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9['VoiceQueueId']||undefined,'CampaignId':_0x1626e9['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x1626e9['countbusyretry']>=_0xdc468a[_0xd5c5('0x196')]-0x1){return!![];}hopperUtils[_0xd5c5('0xde')]({'active':![],'countbusyretry':_0x1626e9[_0xd5c5('0x128')]+=0x1,'scheduledat':moment()['add'](_0xdc468a[_0xd5c5('0x197')],'minutes')[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x198')));break;case 0x8:if(_0x1626e9['countcongestionretry']>=_0xdc468a['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x1626e9[_0xd5c5('0x129')]+=0x1,'scheduledat':moment()[_0xd5c5('0xdf')](_0xdc468a[_0xd5c5('0x199')],_0xd5c5('0xe0'))[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x19a')));break;case 0x0:if(_0x1626e9[_0xd5c5('0x12b')]>=_0xdc468a['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1626e9[_0xd5c5('0x12b')]+=0x1,'scheduledat':moment()[_0xd5c5('0xdf')](_0xdc468a[_0xd5c5('0x19b')],_0xd5c5('0xe0'))['format'](_0xd5c5('0xc9')),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x19c')));}break;case 0xa:if(_0x1626e9[_0xd5c5('0xdb')]>=_0xdc468a[_0xd5c5('0xdc')]-0x1){return!![];}hopperUtils[_0xd5c5('0xde')]({'active':![],'countdropretry':_0x1626e9['countdropretry']+=0x1,'scheduledat':moment()[_0xd5c5('0xdf')](_0xdc468a['dialDropRetryFrequency'],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0xe5')));break;case 0xb:if(_0x1626e9[_0xd5c5('0xef')]>=_0xdc468a[_0xd5c5('0xf0')]-0x1){return!![];}hopperUtils[_0xd5c5('0xde')]({'active':![],'countabandonedretry':_0x1626e9[_0xd5c5('0xef')]+=0x1,'scheduledat':moment()['add'](_0xdc468a[_0xd5c5('0xed')],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9['ListId'],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1626e9[_0xd5c5('0x126')]>=_0xdc468a[_0xd5c5('0x12f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1626e9[_0xd5c5('0x126')]+=0x1,'scheduledat':moment()['add'](_0xdc468a[_0xd5c5('0x132')],_0xd5c5('0xe0'))[_0xd5c5('0x45')](_0xd5c5('0xc9')),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9['ListId'],'VoiceQueueId':_0x1626e9['VoiceQueueId']||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x1626e9['countagentrejectretry']>=_0xdc468a[_0xd5c5('0x19d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x1626e9[_0xd5c5('0x134')]+=0x1,'scheduledat':moment()['add'](_0xdc468a['dialAgentRejectRetryFrequency'],_0xd5c5('0xe0'))[_0xd5c5('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1626e9[_0xd5c5('0xe1')],'ListId':_0x1626e9[_0xd5c5('0xe2')],'VoiceQueueId':_0x1626e9[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x1626e9[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x19e')));break;default:return!![];}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x112')]=function(_0x522d3a,_0x25c33a,_0x1fbcef){var _0x183d42=this;var _0x1382d0=new History(_0x522d3a);var _0x373491=![];var _0x39737c;var _0x1ba498;return new Promise(function(_0x3f3653,_0x414d1d){if(_[_0xd5c5('0x3f')](_0x25c33a)&&typeof _0x25c33a!==_0xd5c5('0x167')){return _0x414d1d(msgResponse(_0xd5c5('0x19f'),'Failure',_0xd5c5('0x1a0')));}if(_['isUndefined'](_0x1fbcef)&&typeof _0x1fbcef!==_0xd5c5('0x167')){return _0x414d1d(msgResponse('[callProgressDetecting]',_0xd5c5('0x93'),'evt\x20is\x20undefine'));}hopperUtils[_0xd5c5('0xee')](_0x1382d0,_0x1fbcef[_0xd5c5('0xc4')],_0x25c33a)[_0xd5c5('0x3d')](function(_0x4691cb){if(_0x4691cb[_0xd5c5('0xda')]==0x1)_0x373491=!![];switch(_0x1fbcef[_0xd5c5('0xc4')]){case'0':_0x25c33a[_0xd5c5('0x1a1')]+=0x1;_0x1382d0[_0xd5c5('0x71')]=0x0;_0x1382d0['statedesc']=_0xd5c5('0x1a2');_0x1382d0[_0xd5c5('0x12b')]+=0x1;_0x1382d0[_0xd5c5('0xd6')]+=0x1;ami[_0xd5c5('0x40')](_0xd5c5('0x1a3'),ut[_0xd5c5('0x120')](_0x522d3a,'nosuchnumber'));_0x39737c=_0x25c33a[_0xd5c5('0x19b')];_0x1ba498=_0x25c33a[_0xd5c5('0xd8')];hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x127')));if(_0x183d42[_0xd5c5('0x193')](0x0,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0[_0xd5c5('0x12b')]>=_0x25c33a[_0xd5c5('0x1a4')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1a5'));}else{_0x183d42[_0xd5c5('0x12d')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1a5'));}}break;case'3':_0x25c33a[_0xd5c5('0x1a6')]+=0x1;_0x1382d0[_0xd5c5('0x71')]=0x3;_0x1382d0[_0xd5c5('0x72')]='NoAnswer';_0x1382d0['countnoanswerretry']+=0x1;_0x1382d0[_0xd5c5('0xd6')]+=0x1;var _0x2b6910=ut['buildNoAnswerEventPayload'](_0x522d3a,_0x25c33a);ami['emit'](_0xd5c5('0x1a7'),_0x2b6910);_0x39737c=_0x25c33a[_0xd5c5('0x195')];_0x1ba498=_0x25c33a[_0xd5c5('0xd8')];hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x1a8')));if(_0x183d42[_0xd5c5('0x193')](0x3,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0[_0xd5c5('0x12a')]>=_0x25c33a[_0xd5c5('0x194')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1a9'));}else{_0x183d42[_0xd5c5('0x12d')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1a9'));}}break;case'5':_0x25c33a[_0xd5c5('0x1aa')]+=0x1;_0x1382d0[_0xd5c5('0x71')]=0x5;_0x1382d0[_0xd5c5('0x72')]=_0xd5c5('0x1ab');_0x1382d0['countbusyretry']+=0x1;_0x1382d0[_0xd5c5('0xd6')]+=0x1;ami[_0xd5c5('0x40')](_0xd5c5('0x1ac'),ut[_0xd5c5('0x120')](_0x522d3a,_0xd5c5('0x1ad')));_0x39737c=_0x25c33a[_0xd5c5('0x197')];_0x1ba498=_0x25c33a[_0xd5c5('0xd8')];hopperUtils['createHistory'](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x1ae')));if(_0x183d42[_0xd5c5('0x193')](0x5,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0[_0xd5c5('0x128')]>=_0x25c33a[_0xd5c5('0x196')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1af'));}else{_0x183d42[_0xd5c5('0x12d')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1af'));}}break;case'8':_0x25c33a[_0xd5c5('0x1b0')]+=0x1;_0x1382d0[_0xd5c5('0x71')]=0x8;_0x1382d0[_0xd5c5('0x72')]='Congestion';_0x1382d0[_0xd5c5('0x129')]+=0x1;_0x1382d0[_0xd5c5('0xd6')]+=0x1;_0x39737c=_0x25c33a[_0xd5c5('0x199')];_0x1ba498=_0x25c33a['callAdditionalPhoneAfterMin'];ami[_0xd5c5('0x40')]('custom:agentcongestion',ut[_0xd5c5('0x120')](_0x522d3a,_0xd5c5('0x1b1')));hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x1b2')));if(_0x183d42['checkRetriveMax'](0x8,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0[_0xd5c5('0x129')]>=_0x25c33a[_0xd5c5('0x1b3')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1b4'));}else{_0x183d42[_0xd5c5('0x12d')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1b4'));}}break;case'11':_0x25c33a['outboundAbandonedCallsDay']+=0x1;_0x1382d0[_0xd5c5('0x71')]=0xb;_0x1382d0[_0xd5c5('0x72')]=_0xd5c5('0x1b5');_0x1382d0[_0xd5c5('0xef')]+=0x1;_0x1382d0['countglobal']+=0x1;_0x39737c=_0x25c33a[_0xd5c5('0xed')];_0x1ba498=_0x25c33a['callAdditionalPhoneAfterMin'];hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0xf1')));if(_0x183d42[_0xd5c5('0x193')](0xb,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0['countabandonedretry']>=_0x25c33a[_0xd5c5('0xf0')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,'reason\x2011\x20abandoned');}else{_0x183d42['stateGlobal'](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1b6'));}}break;case'20':_0x25c33a[_0xd5c5('0x1b7')]+=0x1;_0x1382d0[_0xd5c5('0x71')]=0x14;_0x1382d0[_0xd5c5('0x72')]=_0xd5c5('0x1b8');_0x1382d0[_0xd5c5('0x134')]+=0x1;_0x1382d0['countglobal']+=0x1;_0x39737c=_0x25c33a[_0xd5c5('0x1b9')];_0x1ba498=_0x25c33a[_0xd5c5('0xd8')];ami[_0xd5c5('0x40')](_0xd5c5('0x1ba'),ut[_0xd5c5('0x120')](_0x522d3a,_0xd5c5('0x1bb')));hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x1bc')));if(_0x183d42[_0xd5c5('0x193')](0x14,_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0['countagentrejectretry']>=_0x25c33a[_0xd5c5('0x19d')]){_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1bd'));}else{_0x183d42[_0xd5c5('0x12d')](_0x1382d0,_0x3f3653,_0x414d1d,_0xd5c5('0x1bd'));}}break;default:_0x25c33a[_0xd5c5('0x13c')]+=0x1;_0x1382d0['state']=0xc;_0x1382d0['statedesc']=_0x1fbcef[_0xd5c5('0xc4')];_0x39737c=_0x25c33a[_0xd5c5('0x1b9')];_0x1ba498=_0x25c33a['callAdditionalPhoneAfterMin'];hopperUtils[_0xd5c5('0xca')](_0x1382d0)[_0xd5c5('0xa2')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x183d42[_0xd5c5('0x193')](_0x1fbcef[_0xd5c5('0xc4')],_0x522d3a,_0x25c33a)&&!_0x373491){if(_0x1382d0[_0xd5c5('0x128')]+_0x1382d0['countcongestionretry']+_0x1382d0[_0xd5c5('0x12a')]+_0x1382d0[_0xd5c5('0x12b')]+_0x1382d0['countdropretry']+_0x1382d0['countabandonedretry']+_0x1382d0[_0xd5c5('0x126')]+_0x1382d0[_0xd5c5('0x134')]>=_0x25c33a[_0xd5c5('0x12c')]){_0x183d42['stateGlobal'](_0x1382d0,_0x3f3653,_0x414d1d,_0x1fbcef[_0xd5c5('0xc4')]);}else{_0x183d42[_0xd5c5('0x130')](_0x1382d0,_0x3f3653,_0x414d1d,_0x1fbcef[_0xd5c5('0xc4')]);}}}})[_0xd5c5('0x3d')](function(){if(_0x373491){hopperUtils[_0xd5c5('0xea')](_0x1382d0,_0x39737c,_0x1ba498)[_0xd5c5('0x3d')](function(){return _0x3f3653(0x1);});}});});};Dialer['prototype'][_0xd5c5('0x12d')]=function(_0x3b9187,_0x26d635,_0x21c662,_0x1de301){var _0x4fea09=new Final(_0x3b9187);_0x4fea09['state']=0xf;_0x4fea09[_0xd5c5('0x72')]=_0xd5c5('0x1be');this[_0xd5c5('0x130')](_0x4fea09,_0x26d635,_0x21c662,_0x1de301);};Dialer[_0xd5c5('0x18')][_0xd5c5('0x130')]=function(_0x2d81d8,_0x48e847,_0x5aff03,_0x58ced3){hopperUtils[_0xd5c5('0xcc')](_0x2d81d8)['then'](function(){return _0x48e847(msgResponse('[callProgressDetecting]',_0xd5c5('0x111'),_0x58ced3));})[_0xd5c5('0xa2')](function(){return _0x5aff03(msgResponse(_0xd5c5('0x1bf'),_0xd5c5('0x93'),_0xd5c5('0x1c0')));});};Dialer[_0xd5c5('0x18')][_0xd5c5('0x9')]=function(_0x20fd46){var _0x45038b=_0x20fd46[_0xd5c5('0x1c1')]/0x64;var _0x586eea=_0x20fd46[_0xd5c5('0xd1')]/(_0x20fd46[_0xd5c5('0xd1')]+_0x20fd46[_0xd5c5('0xc3')]);var _0x3eff38=Math[_0xd5c5('0x1c2')](_0x20fd46[_0xd5c5('0x1c3')]*(_0x20fd46[_0xd5c5('0x1c4')]/0x64));var _0x597835=Math['round'](_0x20fd46[_0xd5c5('0x1c3')]*(_0x20fd46[_0xd5c5('0x1c5')]/0x64));var _0x2d9848=_0x20fd46[_0xd5c5('0x142')]+_0x20fd46[_0xd5c5('0x144')];var _0x3b5fd1=Math['floor'](_0x20fd46[_0xd5c5('0x5b')]*_0x20fd46['erlangAbandonmentRate']*_0x20fd46[_0xd5c5('0x1c6')]*_0x20fd46[_0xd5c5('0x1c7')]);if(_[_0xd5c5('0x3f')](_0x20fd46[_0xd5c5('0x27')])){if(!_['isUndefined'](_0x20fd46['startPredictive'])){_0x20fd46[_0xd5c5('0x26')]=undefined;loggerPredictive[_0xd5c5('0x66')](_0xd5c5('0x1c8'),_0xd5c5('0x1c9'));}if(!_['isUndefined'](_0x20fd46[_0xd5c5('0x65')])){loggerPredictive[_0xd5c5('0x66')](_0xd5c5('0x1c8'),_0xd5c5('0x1ca'));clearInterval(_0x20fd46[_0xd5c5('0x65')]);_0x20fd46[_0xd5c5('0x65')]=undefined;}_0x20fd46['startProgressive']=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));loggerPredictive[_0xd5c5('0x49')](_0x20fd46[_0xd5c5('0x63')],_0xd5c5('0x1cb'),_0x20fd46[_0xd5c5('0x27')]);this[_0xd5c5('0xb6')](_0x20fd46,0x1);}else if(ifInterval(_0x20fd46[_0xd5c5('0x1cc')],_0x20fd46[_0xd5c5('0x27')])){this[_0xd5c5('0xb6')](_0x20fd46,0x1);loggerPredictiveCalls[_0xd5c5('0x49')]('[startMethodPredictive][StartProgressive][Loop]',_0x20fd46['startProgressive'],_0x20fd46[_0xd5c5('0x63')]);_0x20fd46[_0xd5c5('0x5b')]=0x0;_0x20fd46[_0xd5c5('0xd2')]=0x0;}else if(_0x45038b<_0x586eea&&_0x20fd46[_0xd5c5('0x1cd')]==='dropRate'){clearPredictiveAttributes(_0x20fd46);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x1ce'),_0xd5c5('0x1cf'),_0x586eea,'startProgressive',_0x20fd46[_0xd5c5('0x63')]);}else if(_0x3b5fd1<_0x20fd46['predictiveIntervalErlangCallsDroppedCalls']&&_0x20fd46[_0xd5c5('0x1cd')]===_0xd5c5('0x1d0')){clearPredictiveAttributes(_0x20fd46);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x1d1'),'Max\x20Drop\x20',_0x3b5fd1,'Drop\x20in\x20this\x20interval',_0x20fd46['predictiveIntervalErlangCallsDroppedCalls'],_0xd5c5('0x27'),_0x20fd46[_0xd5c5('0x63')]);}else if(!ifInterval(_0x20fd46[_0xd5c5('0x1cc')],_0x20fd46[_0xd5c5('0x27')])&&_[_0xd5c5('0x3f')](_0x20fd46[_0xd5c5('0x26')])&&!_[_0xd5c5('0x3f')](_0x20fd46[_0xd5c5('0x27')])){_0x20fd46[_0xd5c5('0x26')]=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));loggerPredictive[_0xd5c5('0x49')](_0x20fd46[_0xd5c5('0x63')],_0xd5c5('0x1d2'),_0x20fd46['startPredictive']);hopperUtils[_0xd5c5('0x1d3')](_0x20fd46[_0xd5c5('0x1cc')])['then'](this[_0xd5c5('0x1d4')](_0x20fd46))['then'](mergeDataErlangB(_0x20fd46))[_0xd5c5('0x3d')](this[_0xd5c5('0x1d5')](_0x20fd46))[_0xd5c5('0xa2')](loggerCatchPredictive(_0xd5c5('0x1d6'),_0x20fd46));}else if(!ifInterval(_0x20fd46[_0xd5c5('0x1cc')],_0x20fd46[_0xd5c5('0x26')])){_0x20fd46[_0xd5c5('0xd2')]=0x0;_0x20fd46[_0xd5c5('0x26')]=moment()[_0xd5c5('0x45')](_0xd5c5('0xc9'));loggerPredictive['info'](_0x20fd46['name'],'recalculate\x20predictive\x20at',_0x20fd46[_0xd5c5('0x26')]);clearInterval(_0x20fd46['handlePredictive']);_0x20fd46['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x20fd46[_0xd5c5('0x1cc')])[_0xd5c5('0x3d')](this[_0xd5c5('0x1d4')](_0x20fd46))['then'](mergeDataErlangB(_0x20fd46))['then'](this[_0xd5c5('0x1d5')](_0x20fd46))[_0xd5c5('0xa2')](loggerCatchPredictive(_0xd5c5('0x1d7'),_0x20fd46));}else if(_0x20fd46[_0xd5c5('0x1c3')]&&_0x2d9848<_0x20fd46[_0xd5c5('0x1c3')]-_0x597835){clearPredictiveAttributes(_0x20fd46);loggerPredictive[_0xd5c5('0x49')](_0x20fd46[_0xd5c5('0x63')],_0xd5c5('0x1d8'),_0x2d9848,_0xd5c5('0x1d9'),_0x20fd46[_0xd5c5('0x1c3')],'-',_0x597835,'=',_0x20fd46[_0xd5c5('0x1c3')]-_0x597835,')');}else if(_0x20fd46[_0xd5c5('0x1c3')]&&_0x2d9848>_0x20fd46[_0xd5c5('0x1c3')]+_0x3eff38){clearPredictiveAttributes(_0x20fd46);loggerPredictive['info'](_0x20fd46[_0xd5c5('0x63')],_0xd5c5('0x1d8'),_0x2d9848,_0xd5c5('0x1da'),_0x20fd46['predictiveIntervalAvailable'],'+',_0x3eff38,'=',_0x20fd46[_0xd5c5('0x1c3')]+_0x3eff38,')');}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x1d4')]=function(_0x51a5e6){var _0x59b651=this;return function(_0x44b000){return new Promise(function(_0x43d37b,_0x12f33b){_['merge'](_0x51a5e6,_0x44b000[0x0]);if(checkGetDataPredictive(_0x44b000[0x0])){var _0x4e7abd=_0x51a5e6[_0xd5c5('0x1c3')]=_0x51a5e6['talking']+_0x51a5e6['available'];var _0x3d0948=_0x51a5e6['dialPredictiveInterval']*0x3c;var _0x4bb2c2=_0x44b000[0x0]['predictiveIntervalAvgTalktime']+_0x44b000[0x0][_0xd5c5('0x55')];var _0x320678=(_0x44b000[0x0][_0xd5c5('0x1db')]+_0x44b000[0x0][_0xd5c5('0x4f')]+_0x44b000[0x0][_0xd5c5('0x50')])/_0x44b000[0x0][_0xd5c5('0x4c')];_0x51a5e6[_0xd5c5('0x1c6')]=_0x320678>0x0?_0x320678:0x1;switch(_0x51a5e6['dialPredictiveOptimization']){case _0xd5c5('0x1d0'):var _0x5e25c6=_0x51a5e6[_0xd5c5('0x1c1')]/0x64;return _0x59b651[_0xd5c5('0x1dc')](_0x4e7abd,_0x3d0948,_0x4bb2c2,_0x320678,_0x5e25c6)[_0xd5c5('0x3d')](function(_0x1f366c){return _0x43d37b(_0x1f366c);});case'agentBusyFactor':var _0x30a77b=_0x51a5e6[_0xd5c5('0x1c1')]/0x64;return _0x59b651[_0xd5c5('0x1dd')](_0x4e7abd,_0x3d0948,_0x4bb2c2,_0x320678,_0x30a77b)['then'](function(_0x417dbd){return _0x43d37b(_0x417dbd);});default:return _0x12f33b(msgResponse(_0xd5c5('0x1de'),_0xd5c5('0x93'),_0xd5c5('0x1df')));}}else{return _0x12f33b(msgResponse(_0xd5c5('0x1de'),_0xd5c5('0x93'),_0xd5c5('0x1e0')));}});};};Dialer['prototype'][_0xd5c5('0x1e1')]=function(_0x1ec720){var _0x1fa3ff=this;return function(_0x39130a){return new Promise(function(_0x139961,_0x584daa){_[_0xd5c5('0x61')](_0x1ec720,_0x39130a[0x0]);if(checkGetDataPredictive(_0x39130a[0x0])){loggerPredictive[_0xd5c5('0x49')](JSON[_0xd5c5('0x76')](_0x39130a[0x0]));if(_0x1ec720[_0xd5c5('0x1cd')]===_0xd5c5('0x1d0')){return _0x1fa3ff[_0xd5c5('0x15a')](_0x1ec720['id'])[_0xd5c5('0x3d')](function(_0x4914bf){var _0x5ddaea=_0x1ec720[_0xd5c5('0x1e2')]-_0x4914bf[0x0][_0xd5c5('0x1e3')];var _0xe88626=_0x1ec720[_0xd5c5('0x1cc')]*0x3c;var _0x447787=_0x39130a[0x0]['predictiveIntervalAvgTalktime']+_0x39130a[0x0]['predictiveIntervalAvgHoldtime'];var _0x150771=(_0x39130a[0x0][_0xd5c5('0x1db')]+_0x39130a[0x0][_0xd5c5('0x4f')]+_0x39130a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x39130a[0x0][_0xd5c5('0x4c')];var _0x57bc98=_0x1ec720[_0xd5c5('0x1c1')]/0x64;_0x1ec720['predictiveIntervalPauses']=_0x4914bf[0x0][_0xd5c5('0x1e3')]||0x0;_0x1ec720[_0xd5c5('0x1c6')]=_0x150771>0x0?_0x150771:0x1;return _0x1fa3ff[_0xd5c5('0x1dc')](_0x5ddaea,_0xe88626,_0x447787,_0x150771,_0x57bc98);})['then'](function(_0x303b45){return _0x139961(_0x303b45);})[_0xd5c5('0xa2')](function(_0x227bf8){return _0x584daa(msgResponse('[CatchErlangB]',_0xd5c5('0x93'),JSON['stringify'](_0x227bf8)));});}if(_0x1ec720['dialPredictiveOptimization']===_0xd5c5('0x1e4')){return _0x1fa3ff[_0xd5c5('0x15a')](_0x1ec720['id'])['then'](function(_0x1be39d){var _0x5876b5=_0x1ec720[_0xd5c5('0x1e2')]-_0x1be39d[0x0][_0xd5c5('0x1e3')];var _0x44ccd6=_0x1ec720[_0xd5c5('0x1cc')]*0x3c;var _0x225fd0=_0x39130a[0x0][_0xd5c5('0x53')]+_0x39130a[0x0][_0xd5c5('0x55')];var _0x158faa=(_0x39130a[0x0][_0xd5c5('0x1db')]+_0x39130a[0x0][_0xd5c5('0x4f')]+_0x39130a[0x0][_0xd5c5('0x50')])/_0x39130a[0x0][_0xd5c5('0x4c')];var _0x42579a=_0x1ec720[_0xd5c5('0x1c1')]/0x64;_0x1ec720[_0xd5c5('0x1e5')]=_0x1be39d[0x0]['outboundQueuePauses']||0x0;_0x1ec720[_0xd5c5('0x1c6')]=_0x158faa>0x0?_0x158faa:0x1;return _0x1fa3ff['busyFactor'](_0x5876b5,_0x44ccd6,_0x225fd0,_0x158faa,_0x42579a);})[_0xd5c5('0x3d')](function(_0x47da0c){return _0x139961(_0x47da0c);})['catch'](function(_0x2b1965){return _0x584daa(msgResponse(_0xd5c5('0x1e6'),_0xd5c5('0x93'),JSON[_0xd5c5('0x76')](_0x2b1965)));});}}else{return _0x584daa(msgResponse(_0xd5c5('0x1de'),_0xd5c5('0x93'),_0xd5c5('0x1e0')));}});};};Dialer[_0xd5c5('0x18')][_0xd5c5('0x1d5')]=function(_0x5b691d){var _0xe3e8e7=this;return function(){var _0x1cb06c=0x0;var _0x472cd8=Math['floor'](_0x5b691d[_0xd5c5('0x5c')]*0x3e8);if(_0x472cd8>0x0){_0x472cd8=_0x472cd8<0x64?0x64:_0x472cd8;loggerPredictive[_0xd5c5('0x49')](_0x5b691d[_0xd5c5('0x63')],_0xd5c5('0x1e7'),_0x472cd8,_0xd5c5('0x1e8'));_0x5b691d[_0xd5c5('0x65')]=setInterval(function(){_0xe3e8e7[_0xd5c5('0x65')](_0x5b691d);loggerPredictiveCalls[_0xd5c5('0x49')]('[handlePredictive]',_0x1cb06c+=0x1);},_0x472cd8);}else{loggerPredictive[_0xd5c5('0x49')](_0x5b691d['name'],_0xd5c5('0x1e9'));}};};Dialer['prototype']['checkContactBlack']=function(_0x47d4c2,_0x28e5e5){var _0x12e987=this;return function(_0x3c5175){if(_[_0xd5c5('0x48')](_0x3c5175)){if(_[_0xd5c5('0xfa')](_0x28e5e5[_0xd5c5('0x160')])||!_0x28e5e5[_0xd5c5('0x1ea')]){if(_0x47d4c2[_0xd5c5('0xb4')]==='booked'){_0x47d4c2[_0xd5c5('0x74')]=_['isUndefined'](_0x47d4c2['queueStatusComplete'])?!![]:_0x47d4c2[_0xd5c5('0x74')];var _0x140a6c=uuid['v4']();_0x12e987[_0xd5c5('0xf2')][_0x140a6c]=new Action(_0x47d4c2,_0x28e5e5,_0x140a6c);loggerBooked[_0xd5c5('0x49')]('[booked][checkContactBlack]',_0x140a6c,_0xd5c5('0x1eb'),JSON[_0xd5c5('0x76')](_0x47d4c2[_0xd5c5('0x74')]),_0xd5c5('0x1ec'),_0x47d4c2[_0xd5c5('0x63')]);if(_0x47d4c2[_0xd5c5('0x74')]){_0x47d4c2[_0xd5c5('0x74')]=![];_0x12e987[_0xd5c5('0xfb')][_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xc0')]]=[];ami['Action']({'actionid':_0x140a6c,'action':_0xd5c5('0x1ed'),'queue':_0x47d4c2['name']})[_0xd5c5('0xa2')](function(){_0x12e987['updateOriginated'](_0x47d4c2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c]['ContactId'],'ListId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xe2')],'VoiceQueueId':_0x12e987['actions'][_0x140a6c][_0xd5c5('0xe3')]||undefined,'CampaignId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c]['CampaignId']||undefined})[_0xd5c5('0xa2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x12e987[_0xd5c5('0xf2')][_0x140a6c];});}else{loggerBooked[_0xd5c5('0x49')]('[booked][checkContactBlack][else]',JSON[_0xd5c5('0x76')](_0x47d4c2[_0xd5c5('0x74')]),_0xd5c5('0x1ec'),_0x47d4c2[_0xd5c5('0x63')]);_0x12e987[_0xd5c5('0xce')](_0x47d4c2);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xe1')],'ListId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xe2')],'VoiceQueueId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xe3')]||undefined,'CampaignId':_0x12e987[_0xd5c5('0xf2')][_0x140a6c][_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x12e987[_0xd5c5('0xf2')][_0x140a6c];}}else{return _0x12e987['actionOriginate'](_0x47d4c2,_0x28e5e5);}}else{if(utils['getSeconds'](undefined,_0x28e5e5['scheduledat'])<_0x47d4c2[_0xd5c5('0x1ee')]*0x3c){if(_0x28e5e5[_0xd5c5('0x151')]&&!_0x28e5e5['Agent'][_0xd5c5('0x1ef')]){_0x12e987[_0xd5c5('0xfe')][_0xd5c5('0xff')](_0x28e5e5['id'])[_0xd5c5('0x1b')](function(){_0x12e987[_0xd5c5('0xce')](_0x47d4c2);});}else{hopperUtils[_0xd5c5('0x1f0')]({'active':![]},_0x28e5e5['id'],0x1)['finally'](function(){_0x12e987['updateOriginated'](_0x47d4c2);});}}else{_0x47d4c2['outboundReCallsDay']+=0x1;_0x12e987[_0xd5c5('0xce')](_0x47d4c2);if(_0x47d4c2[_0xd5c5('0x1f1')]){hopperUtils[_0xd5c5('0xde')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28e5e5['ContactId'],'ListId':_0x28e5e5[_0xd5c5('0xe2')],'VoiceQueueId':_0x28e5e5[_0xd5c5('0xe3')]||undefined,'CampaignId':_0x28e5e5[_0xd5c5('0xe4')]||undefined})[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x1f2')));hopperUtils[_0xd5c5('0xca')](createObjHistory(_0x47d4c2,_0x28e5e5,utils['CAMPAIGN_STATUS'][_0xd5c5('0x1f3')],0x17,_0xd5c5('0x1f4')))['catch'](loggerCatch(_0xd5c5('0x1f5')));}else{_0x12e987[_0xd5c5('0x122')](createObjHistory(_0x47d4c2,_0x28e5e5,utils[_0xd5c5('0x6c')][_0xd5c5('0x1f6')],0x16,_0xd5c5('0x1f7')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x47d4c2[_0xd5c5('0x1f8')]+=0x1;_0x12e987[_0xd5c5('0x122')](createObjHistory(_0x47d4c2,_0x28e5e5,utils[_0xd5c5('0x6c')][_0xd5c5('0x1f9')],0xd,_0xd5c5('0x1fa')),'[Originate][historyBlacklist]',_0xd5c5('0x1fb'));throw _0xd5c5('0x1fc');}};};Dialer[_0xd5c5('0x18')][_0xd5c5('0x165')]=function(_0xcbab89){var _0x61f89=this;var _0x1b485d=_0xcbab89[_0xd5c5('0x1fd')]-_0xcbab89['originated'];emitCampaignSummary(_0xcbab89);if(_0x1b485d>0x0&&_0xcbab89[_0xd5c5('0x1fe')]==0x0){if(_0x1b485d>this[_0xd5c5('0x21')]){_0x1b485d=this['maxNumberOriginate'];}_0xcbab89[_0xd5c5('0x1fe')]=0x1;hopperUtils[_0xd5c5('0x1ff')](_0xcbab89,_0x1b485d)['then'](function(_0x55493e){_0xcbab89[_0xd5c5('0x1fe')]=0x0;if(_0x55493e){if(!utils[_0xd5c5('0x200')](_0x55493e)){_0xcbab89['message']=utils['CAMPAIGN_STATUS'][_0xd5c5('0x70')];logger['info']('[getContactCampaign2][Empty]'+_0xcbab89[_0xd5c5('0x63')]);}else{_0xcbab89[_0xd5c5('0x81')]+=_0x55493e[_0xd5c5('0x103')];_0xcbab89[_0xd5c5('0x6b')]=utils['CAMPAIGN_STATUS'][_0xd5c5('0x201')];for(var _0x4a7cbe=0x0;_0x4a7cbe<_0x55493e[_0xd5c5('0x103')];_0x4a7cbe+=0x1){_0xcbab89['ivrTotalCallsDays']+=0x1;if(_[_0xd5c5('0xfa')](_0x55493e[_0x4a7cbe])||_[_0xd5c5('0xfa')](_0x55493e[_0x4a7cbe][_0xd5c5('0x17f')])||_['isNil'](_0x55493e[_0x4a7cbe]['phone'])){_0x61f89['emptyContact'](_0xd5c5('0x202'),_0xcbab89,_0x55493e[_0x4a7cbe]);}else{hopperUtils[_0xd5c5('0x203')](_['pick'](_0x55493e[_0x4a7cbe],[_0xd5c5('0xe4'),_0xd5c5('0x16a')]))[_0xd5c5('0x3d')](_0x61f89[_0xd5c5('0x204')](_0xcbab89,_0x55493e[_0x4a7cbe]))[_0xd5c5('0xa2')](_0x61f89[_0xd5c5('0x205')](_0xd5c5('0x206'),_0xcbab89));}}}}})[_0xd5c5('0xa2')](loggerGetContactDialer(_0xd5c5('0x207'),_0xcbab89,_0x1b485d));}};Dialer[_0xd5c5('0x18')]['handlePower']=function(_0x313d82,_0x4fdd80){var _0xef3587=this;var _0x408aef=[];if(_0x4fdd80<0x1||_0x313d82[_0xd5c5('0xb4')]==='booked'){_0x4fdd80=0x1;}var _0x3b5d84=Math[_0xd5c5('0x208')](_0x313d82[_0xd5c5('0x142')]*_0x4fdd80)-_0x313d82[_0xd5c5('0x81')];if(_0x313d82[_0xd5c5('0x209')]>0x0){var _0x494d2d=_0x313d82['dialLimitQueue']-_0x313d82[_0xd5c5('0x81')]-_0x313d82[_0xd5c5('0x144')]-_0x313d82[_0xd5c5('0x145')];if(_0x3b5d84>_0x494d2d){_0x3b5d84=_0x494d2d;}}if(_0x3b5d84>0x0&&_0x313d82[_0xd5c5('0x1fe')]==0x0){if(_0x313d82[_0xd5c5('0xb4')]===_0xd5c5('0x8')){_0x3b5d84=0x1;}if(_0x3b5d84>this[_0xd5c5('0x21')]){_0x3b5d84=this[_0xd5c5('0x21')];}for(var _0x142b47 in this[_0xd5c5('0x1f')]){if(typeof this[_0xd5c5('0x1f')][_0x142b47]!=='undefined'){if(this['agents'][_0x142b47][_0xd5c5('0x71')]===_0xd5c5('0x20a')&&this['agents'][_0x142b47]['status']==='reachable'){_0x408aef[_0xd5c5('0x9b')](this[_0xd5c5('0x1f')][_0x142b47]['id']);}}}_0x313d82[_0xd5c5('0x1fe')]=0x1;hopperUtils[_0xd5c5('0x20b')](_0x313d82,_0x408aef,_0x3b5d84)[_0xd5c5('0x3d')](function(_0x1d3909){_0x313d82[_0xd5c5('0x1fe')]=0x0;if(_0x1d3909){if(!utils['checkContactEmpty'](_0x1d3909)){hopperUtils[_0xd5c5('0x20c')](_0x313d82)['then'](sendMessageReschedule(_0x313d82))['catch'](loggerCatch(_0xd5c5('0x20d')));}else{_0x313d82[_0xd5c5('0x81')]+=_0x1d3909[_0xd5c5('0x103')];_0x313d82[_0xd5c5('0x6b')]=_0x313d82[_0xd5c5('0xb4')]===_0xd5c5('0x8')?utils['CAMPAIGN_STATUS'][_0xd5c5('0x146')]:utils[_0xd5c5('0x6c')]['RUNNING'];for(var _0x136b20=0x0;_0x136b20<_0x1d3909['length'];_0x136b20+=0x1){if(_[_0xd5c5('0xfa')](_0x1d3909[_0x136b20])||_[_0xd5c5('0xfa')](_0x1d3909[_0x136b20][_0xd5c5('0x17f')])||_[_0xd5c5('0xfa')](_0x1d3909[_0x136b20][_0xd5c5('0x16a')])){_0xef3587['emptyContact'](_0xd5c5('0x202'),_0x313d82,_0x1d3909[_0x136b20]);}else{hopperUtils['checkIsBlackList'](_[_0xd5c5('0x77')](_0x1d3909[_0x136b20],[_0xd5c5('0xe3'),_0xd5c5('0x16a')]))[_0xd5c5('0x3d')](_0xef3587[_0xd5c5('0x204')](_0x313d82,_0x1d3909[_0x136b20]))['catch'](_0xef3587[_0xd5c5('0x205')](_0xd5c5('0x202'),_0x313d82));}}}}})['catch'](loggerGetContactDialer(_0xd5c5('0x20e'),_0x313d82,_0x3b5d84));}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x65')]=function(_0x2c439f){if(_0x2c439f[_0xd5c5('0x209')]>0x0){var _0x44ef72=_0x2c439f[_0xd5c5('0x209')]-_0x2c439f['originated']-_0x2c439f[_0xd5c5('0x144')];if(_0x44ef72>0x0&&_0x2c439f[_0xd5c5('0x1fe')]==0x0){this['tryOriginatePredictive'](_0x2c439f);}else{loggerPredictiveCalls['info'](_0xd5c5('0x20f'));}}else{this[_0xd5c5('0x210')](_0x2c439f);}};Dialer[_0xd5c5('0x18')][_0xd5c5('0x210')]=function(_0x3f514e){var _0x2088ad=this;var _0x5e5fac=[];_0x3f514e['originated']+=0x1;for(var _0xedd75e in this[_0xd5c5('0x1f')]){if(typeof this[_0xd5c5('0x1f')][_0xedd75e]!=='undefined'){if(this[_0xd5c5('0x1f')][_0xedd75e][_0xd5c5('0x71')]===_0xd5c5('0x20a')&&this[_0xd5c5('0x1f')][_0xedd75e]['status']===_0xd5c5('0x88')){_0x5e5fac[_0xd5c5('0x9b')](this[_0xd5c5('0x1f')][_0xedd75e]['id']);}}}_0x3f514e['temp']=0x1;return this['getContactDialer'](_0x3f514e['id'],_0x5e5fac,0x1,_0x3f514e[_0xd5c5('0x211')],_0x3f514e)[_0xd5c5('0x3d')](function(_0x3f34cd){_0x3f514e['temp']=0x1;if(_0x3f34cd){if(!utils[_0xd5c5('0x200')](_0x3f34cd)){utils[_0xd5c5('0x69')](_0x3f514e,0x1,0x0);return hopperUtils[_0xd5c5('0x20c')](_0x3f514e)[_0xd5c5('0x3d')](sendMessageReschedule(_0x3f514e))[_0xd5c5('0xa2')](loggerCatch(_0xd5c5('0x20d')));}else{_0x3f514e[_0xd5c5('0x6b')]=utils[_0xd5c5('0x6c')][_0xd5c5('0x201')];if(_[_0xd5c5('0xfa')](_0x3f34cd[0x0])||_['isNil'](_0x3f34cd[0x0][_0xd5c5('0x17f')])||_['isNil'](_0x3f34cd[0x0][_0xd5c5('0x16a')])){_0x2088ad[_0xd5c5('0x15f')]('[actionOriginate]\x20',_0x3f514e,_0x3f34cd[0x0]);}else{return hopperUtils[_0xd5c5('0x212')](_[_0xd5c5('0x77')](_0x3f34cd[0x0],[_0xd5c5('0xe3'),_0xd5c5('0x16a')]))[_0xd5c5('0x3d')](_0x2088ad[_0xd5c5('0x204')](_0x3f514e,_0x3f34cd[0x0]))['catch'](_0x2088ad['loggerHandler']('[actionOriginatePredictive]\x20',_0x3f514e));}}}})[_0xd5c5('0xa2')](loggerGetContactDialer(_0xd5c5('0x213'),_0x3f514e,0x1));};Dialer[_0xd5c5('0x18')][_0xd5c5('0x1dc')]=function(_0x180c1f,_0x27e18f,_0x54cbc7,_0x558b7c,_0x4c7d3a,_0x559951){loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x214'));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',_0x180c1f);loggerPredictive['info'](_0xd5c5('0x215'),_0x27e18f);loggerPredictive['info'](_0xd5c5('0x216'),_0x54cbc7);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x217'),_0x558b7c);loggerPredictive[_0xd5c5('0x49')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c7d3a);loggerPredictive['info'](_0xd5c5('0x54'));return new Promise(function(_0x42872c,_0xba0e91){if(_0x180c1f<=0x0||isNaN(_0x180c1f)){return _0xba0e91(msgResponse(_0xd5c5('0x218'),'Error','m\x20=\x20'+_0x180c1f));}if(_0x54cbc7<=0x0||isNaN(_0x54cbc7)){return _0xba0e91(msgResponse(_0xd5c5('0x218'),_0xd5c5('0x85'),_0xd5c5('0x219')+_0x54cbc7));}if(_0x558b7c<=0x0||isNaN(_0x558b7c)){return _0xba0e91(msgResponse(_0xd5c5('0x218'),_0xd5c5('0x85'),_0xd5c5('0x21a')+_0x558b7c));}if(_0x27e18f<=0x0||isNaN(_0x27e18f)){return _0xba0e91(msgResponse(_0xd5c5('0x218'),_0xd5c5('0x85'),_0xd5c5('0x21b')+_0x27e18f));}if(_0x4c7d3a<=0x0||isNaN(_0x4c7d3a)){return _0xba0e91(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x4c7d3a));}_0x559951=_0x559951||0x0;var _0x13f1fe=0x1/_0x54cbc7;var _0x4c4b75=0x0;var _0x40a343=0x0;var _0x57a701=0x0;var _0x576cb9=0x0;for(var _0x2d325d=0x0;_0x57a701<_0x4c7d3a;_0x2d325d+=0x1){_0x40a343=_0x2d325d/_0x27e18f;_0x4c4b75=(_0x558b7c*_0x40a343+_0x559951)/_0x13f1fe;_0x57a701=utils['erlangb'](_0x4c4b75,_0x180c1f);_0x576cb9=_0x4c4b75/_0x180c1f*(0x1-utils[_0xd5c5('0x21c')](_0x4c4b75,_0x180c1f));}return _0x42872c({'erlangCalls':_0x2d325d,'erlangCallToSecond':_0x27e18f/_0x2d325d,'erlangAbandonmentRate':_0x57a701,'erlangBusyFactor':_0x576cb9});});};Dialer[_0xd5c5('0x18')]['busyFactor']=function(_0x12f534,_0x158517,_0xf7d749,_0x29397d,_0x204431,_0x34fb83){loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x21d'));loggerPredictive[_0xd5c5('0x49')]('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',_0x12f534);loggerPredictive['info'](_0xd5c5('0x215'),_0x158517);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf7d749);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x217'),_0x29397d);loggerPredictive[_0xd5c5('0x49')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x204431);loggerPredictive[_0xd5c5('0x49')](_0xd5c5('0x54'));return new Promise(function(_0x5afd9b,_0x4556d1){if(_0x12f534<=0x0||isNaN(_0x12f534)){return _0x4556d1(msgResponse(_0xd5c5('0x21e'),_0xd5c5('0x85'),_0xd5c5('0x21f')+_0x12f534));}if(_0xf7d749<=0x0||isNaN(_0xf7d749)){return _0x4556d1(msgResponse('[busyFactor]',_0xd5c5('0x85'),'Ts\x20=\x20'+_0xf7d749));}if(_0x29397d<=0x0||isNaN(_0x29397d)){return _0x4556d1(msgResponse(_0xd5c5('0x21e'),_0xd5c5('0x85'),_0xd5c5('0x21a')+_0x29397d));}if(_0x158517<=0x0||isNaN(_0x158517)){return _0x4556d1(msgResponse(_0xd5c5('0x21e'),_0xd5c5('0x85'),_0xd5c5('0x21b')+_0x158517));}if(_0x204431<=0x0||isNaN(_0x204431)){return _0x4556d1(msgResponse(_0xd5c5('0x21e'),_0xd5c5('0x85'),_0xd5c5('0x220')+_0x204431));}_0x34fb83=_0x34fb83||0x0;var _0x3a7218=0x1/_0xf7d749;var _0x4d0203=0x0;var _0x3e71b4=0x0;var _0x1ec7b8=0x0;var _0x416bb4=0x0;for(var _0x229e84=0x0;_0x416bb4<_0x204431;_0x229e84+=0x1){_0x3e71b4=_0x229e84/_0x158517;_0x4d0203=(_0x29397d*_0x3e71b4+_0x34fb83)/_0x3a7218;_0x1ec7b8=utils['erlangb'](_0x4d0203,_0x12f534);_0x416bb4=_0x4d0203/_0x12f534*(0x1-utils[_0xd5c5('0x21c')](_0x4d0203,_0x12f534));}return _0x5afd9b({'erlangCalls':_0x229e84,'erlangCallToSecond':_0x158517/_0x229e84,'erlangAbandonmentRate':_0x1ec7b8,'erlangBusyFactor':_0x416bb4});});};module[_0xd5c5('0x221')]=Dialer; \ No newline at end of file +var _0x9f7c=['isNil','paused','locked','stateinterface','syncQueueStatusComplete','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','[rescheduleContact][Machine]','saveInDb','countcongestionretry','dialMachineRetryFrequency','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','talking','ACTIVE','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[syncQueueCallerAbandon]\x20[Drop]','Agent','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','xcally-motion-dialer','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','dialAgentRejectRetryFrequency','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','predictiveIntervalErlangCallsDroppedCalls','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','dialMethod','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','checkContactEmpty','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','dialOrderByScheduledAt','countReScheduled','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','Error','prototype','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','command','interval','content','indexOf','true','catch','Action','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','type','ivr','updateOriginated','outboundAnswerCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','state','Drop','dropreason','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','swapAdditionalPhones','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','minutes','ContactId','[rescheduleContact][Abandoned]','calleridnum','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy'];(function(_0x3e71bf,_0x39cc5f){var _0x3bde2c=function(_0x5295bd){while(--_0x5295bd){_0x3e71bf['push'](_0x3e71bf['shift']());}};_0x3bde2c(++_0x39cc5f);}(_0x9f7c,0x126));var _0xc9f7=function(_0x372a53,_0x1c72b9){_0x372a53=_0x372a53-0x0;var _0x13379f=_0x9f7c[_0x372a53];return _0x13379f;};'use strict';var util=require(_0xc9f7('0x0'));var _=require(_0xc9f7('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0xc9f7('0x2'));var utils=require('./utils');var hopperUtils=require(_0xc9f7('0x3'));var ut=require('../preview/util/util');var config=require(_0xc9f7('0x4'));var logger=require(_0xc9f7('0x5'))(_0xc9f7('0x6'));var loggerBooked=require(_0xc9f7('0x5'))(_0xc9f7('0x7'));var loggerPredictive=require('../../../config/logger')(_0xc9f7('0x8'));var loggerPredictiveCalls=require(_0xc9f7('0x5'))(_0xc9f7('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc9f7('0xa'));var ami=require(_0xc9f7('0xb'));config[_0xc9f7('0xc')]=_['defaults'](config[_0xc9f7('0xc')],{'host':_0xc9f7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xc9f7('0xe'));var RpcSetting=require(_0xc9f7('0xf'));var Interval=require(_0xc9f7('0x10'));var Action=require(_0xc9f7('0x11'));var History=require(_0xc9f7('0x12'));var Final=require(_0xc9f7('0x13'));var AgentComplete=require(_0xc9f7('0x14'));var QueueCallerAbandon=require(_0xc9f7('0x15'));var Hangup=require(_0xc9f7('0x16'));var ipAgi=process[_0xc9f7('0x17')][_0xc9f7('0x18')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0xf10a67){this['tail']=this[_0xc9f7('0x19')]?this[_0xc9f7('0x19')][_0xc9f7('0x1a')](_0xf10a67):_0xf10a67();};function Dialer(_0x49764c,_0x306b27){this[_0xc9f7('0x1b')]=new Sequence();this[_0xc9f7('0x1c')]=_0x306b27;this[_0xc9f7('0x1d')]=_0x49764c[_0xc9f7('0x1d')];this[_0xc9f7('0x1e')]=_0x49764c[_0xc9f7('0x1e')];this['agents']=_0x49764c[_0xc9f7('0x1f')];this[_0xc9f7('0x20')]=_0x49764c[_0xc9f7('0x20')];this['maxNumberOriginate']=config[_0xc9f7('0x21')]||0x2;this[_0xc9f7('0x22')]={};this[_0xc9f7('0x23')]={};this[_0xc9f7('0x24')]={};this[_0xc9f7('0x25')]={};this[_0xc9f7('0x26')]={};this[_0xc9f7('0x27')]={};this[_0xc9f7('0x28')]={};this[_0xc9f7('0x29')]={};this[_0xc9f7('0x2a')]={};this['queueBookedRR']={};this[_0xc9f7('0x2b')]={};ami['on'](_0xc9f7('0x2c'),this[_0xc9f7('0x2d')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x2f'),this[_0xc9f7('0x30')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x31'),this[_0xc9f7('0x32')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x33'),this[_0xc9f7('0x34')]['bind'](this));ami['on'](_0xc9f7('0x35'),this[_0xc9f7('0xa')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x36'),this[_0xc9f7('0x37')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xc9f7('0x38'),this['syncNewExten'][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x39'),this[_0xc9f7('0x3a')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x3b'),this[_0xc9f7('0x3c')][_0xc9f7('0x2e')](this));ami['on'](_0xc9f7('0x3d'),this['syncQueueStatusComplete'][_0xc9f7('0x2e')](this));this[_0xc9f7('0x3e')]();this[_0xc9f7('0x3f')]();RpcSetting['getSettings']()[_0xc9f7('0x40')](function(_0x45dc3a){previewRecallmeReminderInterval=_0x45dc3a[_0xc9f7('0x41')];});}function isNotNull(_0x5eea87){return _0x5eea87!==null&&!_[_0xc9f7('0x42')](_0x5eea87);}function msgResponse(_0x1388a7,_0x505414,_0x4d1f25){return{'action':_0x1388a7,'response':_0x505414,'message':_0x4d1f25,'stack':_0x4d1f25};}function emit(_0x3aca2f,_0x1f2f25,_0x422948){io['to'](_0x3aca2f)[_0xc9f7('0x43')](_0x1f2f25,_0x422948);}function emitOutboundVoiceQueueSummary(_0x53c398){if(_0x53c398['type']===_0xc9f7('0x44')){logger[_0xc9f7('0x45')](_0xc9f7('0x46'),util[_0xc9f7('0x47')](_0x53c398,{'showHidden':![],'depth':null}));emit(util[_0xc9f7('0x48')](_0xc9f7('0x49'),_0x53c398[_0xc9f7('0x4a')]),'voice_queue:save',_0x53c398);}}function checkGetDataPredictive(_0x2efbd2){if(isNotNull(_0x2efbd2)&&!_[_0xc9f7('0x4b')](_0x2efbd2)){loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x4d'));loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x4e'),_0x2efbd2[_0xc9f7('0x4f')]);loggerPredictive['info'](_0xc9f7('0x50'),_0x2efbd2['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x51'),_0x2efbd2[_0xc9f7('0x52')]);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x53'),_0x2efbd2[_0xc9f7('0x54')]);loggerPredictive[_0xc9f7('0x4c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2efbd2[_0xc9f7('0x55')]);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x56'),_0x2efbd2[_0xc9f7('0x57')]);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x58'));if(_0x2efbd2[_0xc9f7('0x4f')]>0x0){if(!_[_0xc9f7('0x42')](_0x2efbd2[_0xc9f7('0x57')])&&_0x2efbd2['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x59'));if(!_['isUndefined'](_0x2efbd2['predictiveIntervalAvgHoldtime'])&&_0x2efbd2[_0xc9f7('0x55')]>0x0){return!![];}loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x5a'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x5b'));}return![];}function mergeDataErlangB(_0x39aaff){return function(_0x24f736){loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x5c'));loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x5d'),_0x24f736[_0xc9f7('0x5e')]);loggerPredictive[_0xc9f7('0x4c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24f736[_0xc9f7('0x5f')]);loggerPredictive[_0xc9f7('0x4c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24f736[_0xc9f7('0x60')]);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x61'),_0x24f736[_0xc9f7('0x62')]);loggerPredictive['info'](_0xc9f7('0x63'),_0x24f736[_0xc9f7('0x60')]);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x58'));_[_0xc9f7('0x64')](_0x39aaff,_0x24f736);};}function ifInterval(_0x268684,_0x36e62b){if(_[_0xc9f7('0x42')](_0x36e62b)){return![];}return utils[_0xc9f7('0x65')](undefined,_0x36e62b)<_0x268684*0x3c;}function clearPredictiveAttributes(_0x4f8f07){if(_0x4f8f07[_0xc9f7('0x28')]){_0x4f8f07[_0xc9f7('0x28')]=undefined;loggerPredictive[_0xc9f7('0x45')](_0x4f8f07['name'],_0xc9f7('0x66'));}if(_0x4f8f07[_0xc9f7('0x27')]){_0x4f8f07[_0xc9f7('0x27')]=undefined;loggerPredictive['debug'](_0x4f8f07[_0xc9f7('0x4a')],_0xc9f7('0x67'));}if(_0x4f8f07[_0xc9f7('0x68')]){clearInterval(_0x4f8f07[_0xc9f7('0x68')]);_0x4f8f07[_0xc9f7('0x68')]=undefined;loggerPredictive[_0xc9f7('0x45')](_0x4f8f07[_0xc9f7('0x4a')],_0xc9f7('0x69'));}}function loggerCatchPredictive(_0x536f97,_0x583008){return function(_0x43cb75){loggerPredictive[_0xc9f7('0x6a')](_0x583008[_0xc9f7('0x4a')],_0x536f97);loggerPredictive[_0xc9f7('0x6a')](_0x43cb75[_0xc9f7('0x6b')]);clearPredictiveAttributes(_0x583008);};}function loggerCatch(_0x515cfb){return function(_0x1ae98a){logger[_0xc9f7('0x6a')](_0x515cfb,util[_0xc9f7('0x47')](_0x1ae98a,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x359186,_0x2ef57e,_0x2bca49){return function(_0x4bd05b){utils['checkContactLowerLimitOriginate'](_0x2ef57e,_0x2bca49,0x0);logger[_0xc9f7('0x6a')](_0x359186,util['inspect'](_0x4bd05b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xed47a8){return function(_0x2c0e6a){if(isNotNull(_0x2c0e6a)&&isNotNull(_0x2c0e6a[0x0])){if(_0x2c0e6a[0x0][_0xc9f7('0x6c')]>0x0){_0xed47a8[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x6f')];logger['info'](_0xc9f7('0x70')+_0xed47a8[_0xc9f7('0x4a')],_0x2c0e6a[0x0][_0xc9f7('0x6c')],_0xc9f7('0x71'));}else{_0xed47a8[_0xc9f7('0x6d')]=utils['CAMPAIGN_STATUS'][_0xc9f7('0x72')];logger[_0xc9f7('0x4c')](_0xc9f7('0x73')+_0xed47a8[_0xc9f7('0x4a')]);}}};}function createObjHistory(_0x5a319d,_0x1aab43,_0x5481aa,_0x5916b9,_0x5e7248){_0x5a319d[_0xc9f7('0x6d')]=_0x5481aa;var _0x2507b5=new Action(_0x5a319d,_0x1aab43);var _0x2977f4=new History(_0x2507b5);_0x2977f4['state']=_0x5916b9;_0x2977f4[_0xc9f7('0x74')]=_0x5e7248;_0x2977f4[_0xc9f7('0x75')]=_0x2507b5[_0xc9f7('0x76')];return _0x2977f4;}function unlockQueueStatus(_0x440171,_0x4ab08d){setTimeout(function(){if(_[_0xc9f7('0x42')](_0x440171[_0xc9f7('0x77')])){loggerBooked[_0xc9f7('0x6a')](_0xc9f7('0x78'),_0x4ab08d);}_0x440171[_0xc9f7('0x77')]=!![];loggerBooked[_0xc9f7('0x4c')](_0xc9f7('0x79'),_0x4ab08d,JSON[_0xc9f7('0x7a')](_[_0xc9f7('0x7b')](_0x440171,['name',_0xc9f7('0x77')])));},0x1f3);}function checkInterval(_0x298214){return function(){if(!isNotNull(_0x298214[_0xc9f7('0x7c')])){_0x298214[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x7d')];throw _0x298214[_0xc9f7('0x4a')]+_0xc9f7('0x7e');}if(!isNotNull(_0x298214[_0xc9f7('0x7c')][_0xc9f7('0x7f')])){_0x298214[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x7d')];throw _0x298214[_0xc9f7('0x4a')]+_0xc9f7('0x7e');}if(!isNotNull(_[_0xc9f7('0x4b')](_0x298214[_0xc9f7('0x7c')][_0xc9f7('0x7f')]))){_0x298214[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x7d')];throw _0x298214[_0xc9f7('0x4a')]+_0xc9f7('0x7e');}};}function checkIsIVRCampaignActive(_0x54b4df){return function(){if(!utils[_0xc9f7('0x80')](_0x54b4df)){_0x54b4df[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x81')];throw _0x54b4df[_0xc9f7('0x4a')]+_0xc9f7('0x82');}};}function emitCampaignSummary(_0x735e25){if(utils[_0xc9f7('0x83')](_0x735e25)){emit(util[_0xc9f7('0x48')](_0xc9f7('0x84'),_0x735e25[_0xc9f7('0x4a')]),'campaign:save',_0x735e25);}}function loggerCatchQueueSummary(_0x2cc23a,_0x3e7413){return function(_0x626e88){clearPredictiveAttributes(_0x3e7413);emitCampaignSummary(_0x3e7413);loggerSyncQueueSummary[_0xc9f7('0x45')](_0x2cc23a,util[_0xc9f7('0x47')](_0x626e88,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5aa212){if(_0x5aa212[_0xc9f7('0x85')]){if(_0x5aa212[_0xc9f7('0x86')]===0x0){_0x5aa212['sendMessageOneNotActive']=![];_0x5aa212[_0xc9f7('0x6d')]=utils['CAMPAIGN_STATUS'][_0xc9f7('0x81')];loggerSyncQueueSummary[_0xc9f7('0x45')](_0xc9f7('0x87'),_0x5aa212[_0xc9f7('0x4a')],'is\x20not\x20active');}else{_0x5aa212[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x88')];loggerSyncQueueSummary[_0xc9f7('0x45')](_0xc9f7('0x87'),_0x5aa212[_0xc9f7('0x4a')],_0xc9f7('0x89'));}emitCampaignSummary(_0x5aa212);}}function myreject(_0x3f056d){return function(_0x7f9fe1){return _0x3f056d(msgResponse('[ifTime][Action]',_0xc9f7('0x8a'),JSON[_0xc9f7('0x7a')](_0x7f9fe1)));};}Dialer[_0xc9f7('0x8b')][_0xc9f7('0x8c')]=function(_0x273459){return!_['isUndefined'](_0x273459)&&_0x273459&&!_[_0xc9f7('0x42')](_0x273459[_0xc9f7('0x4a')])&&!_[_0xc9f7('0x42')](_0x273459['active'])&&_0x273459[_0xc9f7('0x8d')]&&(this[_0xc9f7('0x20')][util['format']('SIP/%s',_0x273459[_0xc9f7('0x4a')])][_0xc9f7('0x8e')]===_0xc9f7('0x8f')||this[_0xc9f7('0x20')][util['format'](_0xc9f7('0x90'),_0x273459[_0xc9f7('0x4a')])][_0xc9f7('0x8e')]===_0xc9f7('0x91'));};Dialer[_0xc9f7('0x8b')]['checkIsTrunkReachable']=function(_0x27ded3){var _0x50296f=this;return function(){if(!_0x50296f[_0xc9f7('0x8c')](_0x27ded3[_0xc9f7('0x92')])){if(!_0x50296f[_0xc9f7('0x8c')](_0x27ded3['TrunkBackup'])){_0x27ded3[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x93')];throw _0x27ded3[_0xc9f7('0x4a')]+_0xc9f7('0x94');}}};};Dialer[_0xc9f7('0x8b')]['checkIfTime']=function(_0x4eb5fb,_0x37ef5e,_0xf67d70,_0x1517fd){var _0x31502e=this;return function(){var _0x481df3=!![];return _0x31502e[_0xc9f7('0x95')](_0x4eb5fb,_0x37ef5e,_0xf67d70,_0x1517fd,_0x481df3);};};Dialer['prototype'][_0xc9f7('0x96')]=function(_0x65ce24,_0x37a657,_0x4f5929,_0xbe097f){var _0x2f5a80=this;return function(){var _0x58e667=![];return _0x2f5a80[_0xc9f7('0x95')](_0x65ce24['Intervals'],_0x37a657,_0x4f5929,_0xbe097f,_0x58e667);};};Dialer['prototype']['ifTimeIvr']=function(_0xf4120e,_0x52b845,_0x47305b,_0x1c97b7,_0x2a62a9){var _0x3f3121=[];return new Promise(function(_0x5fa41d,_0x11b7fd){if(!isNotNull(_0xf4120e)){_0x1c97b7['message']=utils[_0xc9f7('0x6e')][_0xc9f7('0x7d')];return _0x11b7fd(msgResponse(_0xc9f7('0x97'),'Failure',_0x47305b+_0xc9f7('0x98')));}if(_['isEmpty'](_0xf4120e)){_0x1c97b7[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x99')];return _0x11b7fd(msgResponse(_0xc9f7('0x97'),_0xc9f7('0x9a'),_0x47305b+_0xc9f7('0x9b')));}if(_0x52b845&&_[_0xc9f7('0x42')](config[_0xc9f7('0x9c')][_0x52b845])){_0x1c97b7[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')][_0xc9f7('0x9d')];return _0x11b7fd(msgResponse(_0xc9f7('0x97'),_0xc9f7('0x9a'),_0x47305b+_0xc9f7('0x9e')+_0x52b845));}if(_[_0xc9f7('0x9f')](_0xf4120e)){for(var _0xe824aa=0x0;_0xe824aa<_0xf4120e[_0xc9f7('0xa0')];_0xe824aa+=0x1){_0x3f3121[_0xc9f7('0xa1')](ami['Action']({'action':_0xc9f7('0xa2'),'command':util[_0xc9f7('0x48')]('iftime\x20%s,%s',_0xf4120e[_0xe824aa][_0xc9f7('0xa3')],!_[_0xc9f7('0x42')](config['timezones'][_0x52b845])?_0x52b845:'')})[_0xc9f7('0x40')](function(_0x40ae35){return _0x40ae35[_0xc9f7('0xa4')][_0xc9f7('0xa5')](_0xc9f7('0xa6'))>=0x0;})[_0xc9f7('0xa7')](myreject(_0x11b7fd)));}}else{_0x3f3121['push'](ami[_0xc9f7('0xa8')]({'action':_0xc9f7('0xa2'),'command':util['format'](_0xc9f7('0xa9'),_0xf4120e,!_['isUndefined'](config[_0xc9f7('0x9c')][_0x52b845])?_0x52b845:'')})[_0xc9f7('0x40')](function(_0x275b0c){return _0x275b0c['content']['indexOf'](_0xc9f7('0xa6'))>=0x0;})[_0xc9f7('0xa7')](myreject(_0x11b7fd)));}Promise[_0xc9f7('0xaa')](_0x3f3121)[_0xc9f7('0x40')](function(_0x2fd284){var _0x5d9f19=_[_0xc9f7('0xab')](_0x2fd284);if(_0x5d9f19){return _0x5fa41d(_0x5d9f19);}else{_0x1c97b7[_0xc9f7('0x6d')]=_0x2a62a9?utils[_0xc9f7('0x6e')][_0xc9f7('0xac')]:utils[_0xc9f7('0x6e')]['OVERTIME_INTERVAL'];return _0x11b7fd(msgResponse(_0xc9f7('0xad'),_0xc9f7('0x9a'),_0xc9f7('0xae')+_0x2a62a9+'\x20'+_0x47305b+_0xc9f7('0xaf')+util[_0xc9f7('0x47')](_0xf4120e,{'showHidden':![],'depth':null})+_0xc9f7('0xb0')+_0x52b845));}})['catch'](function(_0x457797){return _0x11b7fd(msgResponse(_0xc9f7('0x97'),_0xc9f7('0x9a'),JSON[_0xc9f7('0x7a')](_0x457797)));});});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x3e')]=function(){var _0x29a07c=this;return cmHopper[_0xc9f7('0xb1')]({'active':![]},{'where':{'active':!![]}})[_0xc9f7('0x40')](function(){setInterval(function(){_0x29a07c[_0xc9f7('0xb2')]();},0x3e8);});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xb2')]=function(){var _0x420f64=this;var _0x307d7b;for(var _0x3e1455 in this[_0xc9f7('0x1e')]){if(typeof this[_0xc9f7('0x1e')][_0x3e1455]!==_0xc9f7('0xb3')){_0x307d7b=this[_0xc9f7('0x1e')][_0x3e1455];if(utils[_0xc9f7('0x83')](_0x307d7b)&&utils[_0xc9f7('0x80')](_0x307d7b)){_0x307d7b[_0xc9f7('0x85')]=!![];Promise[_0xc9f7('0xb4')]()[_0xc9f7('0x40')](checkIsIVRCampaignActive(_0x307d7b))[_0xc9f7('0x40')](checkInterval(_0x307d7b))[_0xc9f7('0x40')](_0x420f64[_0xc9f7('0xb5')](_0x307d7b))[_0xc9f7('0x40')](_0x420f64[_0xc9f7('0xb6')](_0x307d7b[_0xc9f7('0xb7')],_0x307d7b[_0xc9f7('0xb8')],_0x307d7b[_0xc9f7('0x4a')],_0x307d7b))[_0xc9f7('0x40')](_0x420f64[_0xc9f7('0x96')](_0x307d7b[_0xc9f7('0x7c')],_0x307d7b[_0xc9f7('0xb8')],_0x307d7b[_0xc9f7('0x4a')],_0x307d7b))[_0xc9f7('0x40')](_0x420f64[_0xc9f7('0xb9')](_0x307d7b))[_0xc9f7('0xa7')](loggerCatchQueueSummary('[syncCampaigns]',_0x307d7b));}else{notSendMessagesCampaign(_0x307d7b);}}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xba')]=function(_0x3af9f3){if(_0x3af9f3['dialMethod']!==_0xc9f7('0x8')){clearPredictiveAttributes(_0x3af9f3);}switch(_0x3af9f3['dialMethod']){case _0xc9f7('0xbb'):this[_0xc9f7('0xbc')](_0x3af9f3,0x1);break;case _0xc9f7('0xbd'):this['handlePower'](_0x3af9f3,_0x3af9f3[_0xc9f7('0xbe')]);break;case _0xc9f7('0x8'):this[_0xc9f7('0x8')](_0x3af9f3);break;case'booked':this['handlePower'](_0x3af9f3,0x1);break;default:logger['error']('Queue',_0x3af9f3[_0xc9f7('0x4a')],_0xc9f7('0xbf'));}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x97')]=function(_0x3b4e53,_0x4612e2){var _0x349175=_0x3b4e53[_0xc9f7('0xb8')];var _0x89d1a5=_0x4612e2?_0x3b4e53[_0xc9f7('0xb7')]:_0x3b4e53[_0xc9f7('0x7c')][_0xc9f7('0x7f')];logger[_0xc9f7('0xc0')](_0xc9f7('0xc1'),_0x89d1a5,_0x349175,_0x3b4e53['name'],util[_0xc9f7('0x48')](_0xc9f7('0xc2'),_0x3b4e53[_0xc9f7('0x4a')],_0x3b4e53['id']));var _0x58449b=null;return Interval[_0xc9f7('0xc3')](_0x89d1a5,_0x349175)['then'](function(_0x52cd99){if(_0x52cd99===!![]){return _0x52cd99;}else{_0x3b4e53[_0xc9f7('0x6d')]=_0x4612e2?utils[_0xc9f7('0x6e')][_0xc9f7('0xac')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0x58449b=msgResponse(_0xc9f7('0xad'),_0xc9f7('0x9a'),'Global:\x20'+_0x4612e2+'\x20'+_0x3b4e53[_0xc9f7('0x4a')]+_0xc9f7('0xaf')+util[_0xc9f7('0x47')](_0x89d1a5,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x349175);}if(_0x58449b!==null){logger['silly'](_0xc9f7('0xc4'),_0x58449b);_0x58449b[_0xc9f7('0xc5')]=_0x4612e2;throw _0x58449b;}})['catch'](function(_0x22e6d0){logger[_0xc9f7('0x6a')](_0xc9f7('0xc6'),_0x22e6d0);throw msgResponse(_0xc9f7('0xc7'),_0xc9f7('0x8a'),util[_0xc9f7('0x47')](_0x22e6d0,{'showHidden':![],'depth':null}));});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x2d')]=function(_0x45a80f){if(this['voiceQueues'][_0x45a80f[_0xc9f7('0xc8')]]){if(this['uniqueId'][_0x45a80f[_0xc9f7('0xc9')]]&&this[_0xc9f7('0x25')][_0x45a80f[_0xc9f7('0xc9')]][_0xc9f7('0xca')]!==_0xc9f7('0xcb')){this[_0xc9f7('0xcc')](this[_0xc9f7('0x1d')][_0x45a80f['queue']]);this[_0xc9f7('0x25')][_0x45a80f[_0xc9f7('0xc9')]]['answertime']=moment()[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x34')]=function(_0x2171b6){var _0x3a65ae=this[_0xc9f7('0x25')][_0x2171b6[_0xc9f7('0xc9')]];if(this[_0xc9f7('0x1d')][_0x2171b6[_0xc9f7('0xc8')]]){if(_0x3a65ae&&_0x3a65ae[_0xc9f7('0xca')]!==_0xc9f7('0xcb')){delete this['uniqueId'][_0x2171b6[_0xc9f7('0xc9')]];this[_0xc9f7('0x1d')][_0x2171b6[_0xc9f7('0xc8')]][_0xc9f7('0xcd')]+=0x1;var _0x3682a3=new AgentComplete(_0x3a65ae,_0x2171b6);if(_0x2171b6['reason']===_0xc9f7('0xce')){_0x3682a3['agiafterat']=this[_0xc9f7('0x1d')][_0x2171b6[_0xc9f7('0xc8')]][_0xc9f7('0xcf')]&&this[_0xc9f7('0x1d')][_0x2171b6['queue']][_0xc9f7('0xd0')]?moment()['format'](_0xc9f7('0xd1')):undefined;}hopperUtils[_0xc9f7('0xd2')](_0x3682a3)['catch'](loggerCatch(_0xc9f7('0xd3')));hopperUtils[_0xc9f7('0xd4')](_0x3682a3)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0xd5')));}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x30')]=function(_0x5ab89){var _0x2b3fb1=this[_0xc9f7('0x25')][_0x5ab89['uniqueid']];var _0x4e3616=this;var _0xf3cb57=![];var _0x3772ad;var _0x65b3df;if(this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]]){if(_0x2b3fb1&&_0x2b3fb1[_0xc9f7('0xca')]!==_0xc9f7('0xcb')){delete this[_0xc9f7('0x25')][_0x5ab89[_0xc9f7('0xc9')]];this[_0xc9f7('0xcc')](this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]]);_0x2b3fb1['droptime']=moment()[_0xc9f7('0x48')](_0xc9f7('0xd1'));var _0x5d79cb=new QueueCallerAbandon(_0x2b3fb1,_0x5ab89);if(utils[_0xc9f7('0x65')](_0x2b3fb1[_0xc9f7('0xd6')],_0x2b3fb1['responsetime'])>=_0x2b3fb1[_0xc9f7('0xd7')]){this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0x52')]+=0x1;this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xd8')]+=0x1;this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5d79cb[_0xc9f7('0xd9')]=0xa;_0x5d79cb[_0xc9f7('0x74')]=_0xc9f7('0xda');_0x5d79cb[_0xc9f7('0xdb')]='TIMEOUT';_0x5d79cb['agiafterat']=this['voiceQueues'][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xcf')]?moment()[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5d79cb['countdropretry']+=0x1;_0x5d79cb['countglobal']+=0x1;_0x3772ad=this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xdc')];_0x65b3df=this['voiceQueues'][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xdd')];hopperUtils[_0xc9f7('0xde')](_0x5d79cb,_0x5d79cb[_0xc9f7('0xd9')],_0x2b3fb1[_0xc9f7('0xdf')])[_0xc9f7('0x40')](function(_0x1ad354){_0xf3cb57=_0x1ad354[_0xc9f7('0xe0')]==0x1;if(_0x5d79cb[_0xc9f7('0xe1')]>=_0x4e3616[_0xc9f7('0x1d')][_0x5ab89['queue']][_0xc9f7('0xe2')]){_0x4e3616[_0xc9f7('0xe3')](_0x5d79cb,_0x1ad354[_0xc9f7('0xe0')]);}else{hopperUtils[_0xc9f7('0xe4')]({'active':![],'countdropretry':_0x5d79cb['countdropretry'],'scheduledat':moment()[_0xc9f7('0xe5')](_0x4e3616['voiceQueues'][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xdc')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2b3fb1['ContactId'],'ListId':_0x2b3fb1[_0xc9f7('0xe6')],'VoiceQueueId':_0x2b3fb1[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x2b3fb1[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0xe9')));var _0x2c69db=new History(_0x5d79cb);_0x2c69db[_0xc9f7('0xd9')]=0xa;_0x2c69db['statedesc']=_0xc9f7('0xda');_0x2c69db[_0xc9f7('0x76')]=moment()[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c69db['endtime']=_0x2c69db[_0xc9f7('0x76')];_0x2c69db[_0xc9f7('0xea')]=_0x5d79cb[_0xc9f7('0xea')];_0x2c69db['calleridnum']=_0x5d79cb['calleridnum'];hopperUtils['createHistory'](_0x2c69db)[_0xc9f7('0xa7')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xc9f7('0x40')](function(){if(_0xf3cb57)hopperUtils[_0xc9f7('0xeb')](_0x5d79cb,_0x3772ad,_0x65b3df)[_0xc9f7('0x40')](function(){return 0x1;});});}else{this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0x54')]+=0x1;this[_0xc9f7('0x1d')][_0x5ab89['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x5d79cb[_0xc9f7('0xd9')]=0xb;_0x5d79cb[_0xc9f7('0x74')]=_0xc9f7('0xec');_0x5d79cb[_0xc9f7('0xdb')]=_0xc9f7('0xed');_0x5d79cb[_0xc9f7('0xee')]+=0x1;_0x5d79cb['countglobal']+=0x1;_0x3772ad=this[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xef')];_0x65b3df=this[_0xc9f7('0x1d')][_0x5ab89['queue']][_0xc9f7('0xdd')];hopperUtils[_0xc9f7('0xde')](_0x5d79cb,_0x5d79cb[_0xc9f7('0xd9')],_0x2b3fb1[_0xc9f7('0xdf')])['then'](function(_0xd43309){if(_0x5d79cb[_0xc9f7('0xee')]>=_0x4e3616[_0xc9f7('0x1d')][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xf0')]){_0x4e3616[_0xc9f7('0xe3')](_0x5d79cb,_0xd43309['additional']);}else{hopperUtils[_0xc9f7('0xe4')]({'active':![],'countabandonedretry':_0x5d79cb[_0xc9f7('0xee')],'scheduledat':moment()['add'](_0x4e3616['voiceQueues'][_0x5ab89[_0xc9f7('0xc8')]][_0xc9f7('0xef')],_0xc9f7('0xf1'))[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2b3fb1[_0xc9f7('0xf2')],'ListId':_0x2b3fb1['ListId'],'VoiceQueueId':_0x2b3fb1['VoiceQueueId']||undefined,'CampaignId':_0x2b3fb1[_0xc9f7('0xe8')]||undefined})['catch'](loggerCatch(_0xc9f7('0xf3')));var _0x29b81a=new History(_0x5d79cb);_0x29b81a[_0xc9f7('0xd9')]=0xb;_0x29b81a[_0xc9f7('0x74')]='Abandoned';_0x29b81a[_0xc9f7('0x76')]=moment()[_0xc9f7('0x48')](_0xc9f7('0xd1'));_0x29b81a[_0xc9f7('0x75')]=_0x29b81a[_0xc9f7('0x76')];_0x29b81a['calleridname']=_0x5d79cb[_0xc9f7('0xea')];_0x29b81a['calleridnum']=_0x5d79cb[_0xc9f7('0xf4')];hopperUtils['createHistory'](_0x29b81a)['catch'](loggerCatch(_0xc9f7('0xf5')));}})[_0xc9f7('0x40')](function(){if(_0xf3cb57)hopperUtils[_0xc9f7('0xeb')](_0x5d79cb,_0x3772ad,_0x65b3df)[_0xc9f7('0x40')](function(){return 0x1;});});}}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xf6')]=function(_0x2420a1){if(this[_0xc9f7('0x23')][_0x2420a1['uniqueid']]){this[_0xc9f7('0x23')][_0x2420a1[_0xc9f7('0xc9')]][_0xc9f7('0xf7')]=_0x2420a1[_0xc9f7('0xf7')];}if(this[_0xc9f7('0x25')][_0x2420a1[_0xc9f7('0xc9')]]){this[_0xc9f7('0x25')][_0x2420a1[_0xc9f7('0xc9')]][_0xc9f7('0xf7')]=_0x2420a1[_0xc9f7('0xf7')];}};Dialer['prototype'][_0xc9f7('0x3c')]=function(_0x29f069){if(!this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]]){return;}var _0x1f2664=this['voiceQueues'][this['actions'][_0x29f069[_0xc9f7('0xf8')]]['queue']][_0xc9f7('0xf9')]||'rrmemory';if(_0x1f2664==='roundrobin'){if(this[_0xc9f7('0x23')][_0x29f069['actionid']]&&_[_0xc9f7('0xfa')](this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]]['locked'])&&_0x29f069[_0xc9f7('0x8e')]==='1'&&_0x29f069[_0xc9f7('0xfb')]==='0'){if(this['agents'][_0x29f069['stateinterface']]){if(!this['agents'][_0x29f069['stateinterface']][_0xc9f7('0xfc')]){this[_0xc9f7('0x1f')][_0x29f069[_0xc9f7('0xfd')]][_0xc9f7('0xfc')]=!![];this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]][_0xc9f7('0xfc')]=!![];this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]][_0xc9f7('0xfd')]=_0x29f069[_0xc9f7('0xfd')];}}}}else if(_0x1f2664==='rrmemory'){if(this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]]){if(this[_0xc9f7('0x1f')][_0x29f069['stateinterface']]){this['actions'][_0x29f069[_0xc9f7('0xf8')]][_0xc9f7('0xfd')]=_0x29f069[_0xc9f7('0xfd')];if(_[_0xc9f7('0xfa')](this[_0xc9f7('0x2a')][this['actions'][_0x29f069[_0xc9f7('0xf8')]]['queue']])){this[_0xc9f7('0x2a')][this['actions'][_0x29f069[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]=[];}this[_0xc9f7('0x2a')][this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]['push'](_['merge'](_[_0xc9f7('0x7b')](this[_0xc9f7('0x23')][_0x29f069[_0xc9f7('0xf8')]],['idHopper','stateinterface']),{'status':_0x29f069[_0xc9f7('0x8e')],'paused':_0x29f069[_0xc9f7('0xfb')]}));}}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xfe')]=function(_0x271b54){if(!this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]){return;}var _0x1dc718=this;var _0x14bb69=this[_0xc9f7('0x1d')][this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]['queue']];var _0x391884=_0x14bb69['strategy']||'rrmemory';if(_0x391884===_0xc9f7('0xff')){if(this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]&&this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xfd')]){this[_0xc9f7('0x1c')][_0xc9f7('0x100')](this['actions'][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0x101')],this['actions'][_0x271b54[_0xc9f7('0xf8')]]['stateinterface'])['catch'](function(_0x414bb3){logger['error'](_0xc9f7('0x102'),util[_0xc9f7('0x47')](_0x414bb3,{'showHidden':![],'depth':null}));})[_0xc9f7('0x1a')](function(){_0x1dc718['updateOriginated'](_0x1dc718[_0xc9f7('0x1d')][_0x1dc718[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]['queue']]);_0x1dc718[_0xc9f7('0x1f')][_0x1dc718[_0xc9f7('0x23')][_0x271b54['actionid']][_0xc9f7('0xfd')]]['locked']=![];delete _0x1dc718['actions'][_0x271b54[_0xc9f7('0xf8')]];unlockQueueStatus(_0x14bb69);});}else{this[_0xc9f7('0xcc')](this[_0xc9f7('0x1d')][this['actions'][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]);hopperUtils[_0xc9f7('0xe4')]({'active':![],'ContactId':this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xf2')],'ListId':this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]['ListId'],'VoiceQueueId':this[_0xc9f7('0x23')][_0x271b54['actionid']][_0xc9f7('0xe7')]||undefined,'CampaignId':this[_0xc9f7('0x23')][_0x271b54['actionid']][_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]];unlockQueueStatus(_0x14bb69);}}else if(_0x391884==='rrmemory'){var _0x259743;if(this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]]&&!_[_0xc9f7('0x4b')](this[_0xc9f7('0x2a')][this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]])){if(this[_0xc9f7('0x103')][_0x1dc718[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]){this['queueBookedRR'][_0x1dc718[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]=this[_0xc9f7('0x103')][this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]?this[_0xc9f7('0x103')][this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]:this[_0xc9f7('0x2a')][this['actions'][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]]?this[_0xc9f7('0x2a')][this['actions'][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]][_0xc9f7('0x104')]||0x0:0x0;}this[_0xc9f7('0x2a')][this[_0xc9f7('0x23')][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]][_0xc9f7('0x104')]=this['queueBookedRR'][this['actions'][_0x271b54[_0xc9f7('0xf8')]][_0xc9f7('0xc8')]];for(var _0x148a2c=0x0;_0x148a2c=_0x41bf22[_0xc9f7('0x12b')]){_0xb66705[_0xc9f7('0x12c')](_0x47bbb8,_0x178741,_0x2b090b,_0xc9f7('0x12d'));}else{if(_0x47bbb8[_0xc9f7('0x129')]>=_0x41bf22[_0xc9f7('0x12e')]){_0xb66705[_0xc9f7('0x12f')](_0x47bbb8,_0x178741,_0x2b090b,'reason\x2019\x20machine....');}else{hopperUtils[_0xc9f7('0xe4')]({'active':![],'countmachineretry':_0x47bbb8[_0xc9f7('0x129')],'scheduledat':moment()[_0xc9f7('0xe5')](_0x41bf22['dialMachineRetryFrequency'],_0xc9f7('0xf1'))[_0xc9f7('0x48')](_0xc9f7('0xd1')),'ContactId':_0x47bbb8['ContactId'],'ListId':_0x47bbb8[_0xc9f7('0xe6')],'VoiceQueueId':_0x47bbb8[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x47bbb8['CampaignId']||undefined})['catch'](loggerCatch(_0xc9f7('0x130')));_0x178741({'reschedule':0x1});}}});}if(_0xf60e82['type']==='ivr'&&this[_0xc9f7('0x1e')][_0xf60e82[_0xc9f7('0xc8')]][_0xc9f7('0x117')]&&_0x3171fd[_0xc9f7('0x118')]===_0xc9f7('0x119')){delete this[_0xc9f7('0x25')][_0x3171fd['uniqueid']];this[_0xc9f7('0xcc')](this[_0xc9f7('0x1e')][_0xf60e82['queue']]);_0x309c53=new Hangup(_0xf60e82,_0x3171fd);_0x309c53[_0xc9f7('0xd9')]=0x12;_0x309c53['statedesc']='HangupInAMD';_0x309c53[_0xc9f7('0x11a')]=_0xc9f7('0x11b');ami['emit']('custom:amd',ut[_0xc9f7('0x11d')](_0x309c53,_0xc9f7('0x11e')));this[_0xc9f7('0x131')](_0x309c53,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0xf60e82[_0xc9f7('0xca')]===_0xc9f7('0xcb')&&this['campaigns'][_0xf60e82[_0xc9f7('0xc8')]][_0xc9f7('0x117')]&&_0x3171fd[_0xc9f7('0x118')]===_0xc9f7('0x121')){return new Promise(function(_0x4744e9,_0x2e993c){delete _0xb66705[_0xc9f7('0x25')][_0x3171fd[_0xc9f7('0xc9')]];_0xb66705['updateOriginated'](_0xb66705[_0xc9f7('0x1e')][_0xf60e82[_0xc9f7('0xc8')]]);_0xb66705[_0xc9f7('0x1e')][_0xf60e82[_0xc9f7('0xc8')]][_0xc9f7('0xcd')]+=0x1;_0xb66705[_0xc9f7('0x1e')][_0xf60e82[_0xc9f7('0xc8')]][_0xc9f7('0x122')]+=0x1;var _0x3542c8=_0xb66705[_0xc9f7('0x1e')][_0xf60e82[_0xc9f7('0xc8')]];var _0x29c843=new Hangup(_0xf60e82,_0x3171fd);_0x29c843[_0xc9f7('0xd9')]=0x13;_0x29c843['statedesc']=_0xc9f7('0x123');_0x29c843[_0xc9f7('0x11a')]=_0xc9f7('0x11b');_0x29c843[_0xc9f7('0x129')]+=0x1;_0x29c843[_0xc9f7('0x124')]+=0x1;_0x29c843[_0xc9f7('0x11e')]=!![];ami[_0xc9f7('0x43')](_0xc9f7('0x11c'),ut['buildObj'](_0x29c843,_0xc9f7('0x11e')));hopperUtils[_0xc9f7('0xd2')](_0x29c843)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x125')));if(_0x29c843[_0xc9f7('0x126')]+_0x29c843[_0xc9f7('0x132')]+_0x29c843[_0xc9f7('0x127')]+_0x29c843[_0xc9f7('0x128')]+_0x29c843[_0xc9f7('0xe1')]+_0x29c843['countabandonedretry']+_0x29c843['countmachineretry']+_0x29c843[_0xc9f7('0x12a')]>=_0x3542c8[_0xc9f7('0x12b')]){_0xb66705[_0xc9f7('0x12c')](_0x29c843,_0x4744e9,_0x2e993c,_0xc9f7('0x12d'));}else{if(_0x29c843[_0xc9f7('0x129')]>=_0x3542c8[_0xc9f7('0x12e')]){_0xb66705[_0xc9f7('0x12f')](_0x29c843,_0x4744e9,_0x2e993c,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x29c843[_0xc9f7('0x129')],'scheduledat':moment()[_0xc9f7('0xe5')](_0x3542c8[_0xc9f7('0x133')],_0xc9f7('0xf1'))[_0xc9f7('0x48')](_0xc9f7('0xd1')),'ContactId':_0x29c843['ContactId'],'ListId':_0x29c843[_0xc9f7('0xe6')],'VoiceQueueId':_0x29c843['VoiceQueueId']||undefined,'CampaignId':_0x29c843[_0xc9f7('0xe8')]||undefined})['catch'](loggerCatch(_0xc9f7('0x130')));_0x4744e9({'reschedule':0x1});}}});}}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x134')]=function(_0x1bea5d){var _0x2c50d8=this[_0xc9f7('0x25')][_0x1bea5d[_0xc9f7('0xc9')]];var _0x434344;if(_0x2c50d8&&_0x2c50d8[_0xc9f7('0xca')]===_0xc9f7('0xcb')){delete this[_0xc9f7('0x25')][_0x1bea5d[_0xc9f7('0xc9')]];this[_0xc9f7('0xcc')](this[_0xc9f7('0x1e')][_0x2c50d8[_0xc9f7('0xc8')]]);this['campaigns'][_0x2c50d8[_0xc9f7('0xc8')]][_0xc9f7('0x135')]+=0x1;_0x434344=new Hangup(_0x2c50d8,_0x1bea5d);hopperUtils[_0xc9f7('0xd2')](_0x434344)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x136')));hopperUtils[_0xc9f7('0xd4')](_0x434344)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x137')));}if(_0x2c50d8&&_0x2c50d8[_0xc9f7('0xca')]!==_0xc9f7('0xcb')&&isNotNull(this[_0xc9f7('0x1d')][_0x2c50d8[_0xc9f7('0xc8')]][_0xc9f7('0x138')])){delete this[_0xc9f7('0x25')][_0x1bea5d[_0xc9f7('0xc9')]];this[_0xc9f7('0xcc')](this[_0xc9f7('0x1d')][_0x2c50d8[_0xc9f7('0xc8')]]);this['voiceQueues'][_0x2c50d8[_0xc9f7('0xc8')]][_0xc9f7('0xcd')]+=0x1;this[_0xc9f7('0x1d')][_0x2c50d8[_0xc9f7('0xc8')]]['outboundAnswerAgiCallsDay']+=0x1;_0x434344=new Hangup(_0x2c50d8,_0x1bea5d);_0x434344['state']=0x10;_0x434344[_0xc9f7('0x74')]=_0xc9f7('0x139');_0x434344['membername']=_0xc9f7('0x13a');hopperUtils[_0xc9f7('0xd2')](_0x434344)['catch'](loggerCatch(_0xc9f7('0x136')));hopperUtils['moveContactManagedDialer'](_0x434344)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x137')));}if(_0x2c50d8&&_0x2c50d8[_0xc9f7('0xca')]!==_0xc9f7('0xcb')&&!isNotNull(this[_0xc9f7('0x1d')][_0x2c50d8['queue']][_0xc9f7('0x138')])){delete this[_0xc9f7('0x25')][_0x1bea5d['uniqueid']];this['updateOriginated'](this[_0xc9f7('0x1d')][_0x2c50d8['queue']]);this[_0xc9f7('0x1d')][_0x2c50d8['queue']][_0xc9f7('0x13b')]+=0x1;_0x434344=new Hangup(_0x2c50d8,_0x1bea5d);_0x434344[_0xc9f7('0xd9')]=0xc;_0x434344[_0xc9f7('0x74')]=_0x1bea5d[_0xc9f7('0x13c')];_0x434344['membername']=_0xc9f7('0x13d');hopperUtils['createHistory'](_0x434344)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xc9f7('0xd4')](_0x434344)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x137')));}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xa')]=function(_0x5d0cb5){var _0x1727d6=this;if(!_0x1727d6[_0xc9f7('0x2b')][_0x5d0cb5[_0xc9f7('0x4a')]]){_0x1727d6[_0xc9f7('0x2b')][_0x5d0cb5[_0xc9f7('0x4a')]]={'running':![]};}else if(_0x1727d6[_0xc9f7('0x2b')][_0x5d0cb5[_0xc9f7('0x4a')]][_0xc9f7('0x13e')]===!![]){return;}else if(_0x1727d6['queuesSummary'][_0x5d0cb5[_0xc9f7('0x4a')]][_0xc9f7('0x13e')]===![]){_0x1727d6[_0xc9f7('0x2b')][_0x5d0cb5[_0xc9f7('0x4a')]][_0xc9f7('0x13e')]=!![];}var _0x36f67e=_0x1727d6[_0xc9f7('0x1d')][_0x5d0cb5[_0xc9f7('0x4a')]];var _0x30a486=_0x36f67e['message']!==utils[_0xc9f7('0x6e')]['INACTIVE'];var _0x5a6465=utils[_0xc9f7('0x13f')](_0x36f67e);_0x36f67e[_0xc9f7('0x140')]=utils[_0xc9f7('0x141')](_0x36f67e,_0x1727d6[_0xc9f7('0x20')]);Promise[_0xc9f7('0xb4')]()[_0xc9f7('0x40')](function(){if(_0x36f67e[_0xc9f7('0x140')]===utils['CAMPAIGN_STATUS']['INACTIVE']){if(_0x30a486){clearPredictiveAttributes(_0x36f67e);_0x5d0cb5[_0xc9f7('0x27')]=undefined;_0x5d0cb5[_0xc9f7('0x28')]=undefined;}if(_0x36f67e[_0xc9f7('0x140')]===utils['CAMPAIGN_STATUS']['INACTIVE']){_0x5d0cb5[_0xc9f7('0x142')]=0x0;_0x5d0cb5['paused']=0x0;_0x5d0cb5['inUse']=0x0;_0x5d0cb5[_0xc9f7('0x143')]=0x0;_0x5d0cb5['pTalking']=0x0;}}else if(_0x36f67e[_0xc9f7('0x140')]===utils[_0xc9f7('0x6e')][_0xc9f7('0x144')]&&!_0x5a6465){return _0x1727d6[_0xc9f7('0x97')](_0x36f67e,!![])[_0xc9f7('0x40')](function(){return _0x1727d6[_0xc9f7('0x97')](_0x36f67e,![]);})[_0xc9f7('0x40')](function(){return _0x1727d6[_0xc9f7('0xba')](_0x36f67e);})[_0xc9f7('0xa7')](function(_0x5c4ff4){loggerSyncQueueSummary[_0xc9f7('0x45')]('[syncQueueSummary]',util['inspect'](_0x5c4ff4,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x36f67e);});}else{clearPredictiveAttributes(_0x36f67e);}})['then'](function(){var _0x15e32d=_0x5d0cb5[_0xc9f7('0x145')](_0x36f67e);if(_0x15e32d||_0x36f67e[_0xc9f7('0x146')]){_0x36f67e[_0xc9f7('0x146')]=![];_0x5d0cb5[_0xc9f7('0x147')](_0x36f67e);Object[_0xc9f7('0x148')](_0x36f67e,_0x5d0cb5);emitOutboundVoiceQueueSummary(_0x5d0cb5);}_0x1727d6[_0xc9f7('0x2b')][_0x36f67e[_0xc9f7('0x4a')]]['running']=![];})['catch'](function(_0x361104){logger[_0xc9f7('0x6a')](_0xc9f7('0x149'),util['inspect'](_0x361104,{'showHidden':![],'depth':null}));_0x1727d6[_0xc9f7('0x2b')][_0x36f67e['name']][_0xc9f7('0x13e')]=![];});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x37')]=_[_0xc9f7('0x14a')](function(){var _0x336ffe=_[_0xc9f7('0x14b')](this['voiceQueues'],function(_0x2a9b7c){return _0x2a9b7c['dialPreviewRecallmeReminder'];});var _0xe9a41b=_[_0xc9f7('0x14b')](this[_0xc9f7('0x1f')],function(_0x585259){return _0x585259['online']&&_0x585259['status']===_0xc9f7('0x8f');});if(_0x336ffe['length']>0x0&&_0xe9a41b[_0xc9f7('0xa0')]>0x0){return Promise[_0xc9f7('0xb4')]()[_0xc9f7('0x40')](cmHopper[_0xc9f7('0x14c')](_[_0xc9f7('0x14d')](_0x336ffe,'id'),previewRecallmeReminderInterval,_[_0xc9f7('0x14d')](_0xe9a41b,'id')))[_0xc9f7('0x40')](function(_0x1ed136){for(var _0x4057d0=0x0;_0x4057d0<_0x1ed136[_0xc9f7('0xa0')];_0x4057d0++){var _0x55d5b4=_0x1ed136[_0x4057d0]['Agent'][_0xc9f7('0x4a')];if(_0x55d5b4)io['to'](util[_0xc9f7('0x48')](_0xc9f7('0x14e'),_0x55d5b4))[_0xc9f7('0x43')](_0xc9f7('0x14f'),{'hopper':_0x1ed136[_0x4057d0]});}})[_0xc9f7('0xa7')](function(_0x5c4015){logger[_0xc9f7('0x6a')](_0xc9f7('0x150'),_0x5c4015);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xc9f7('0x8b')][_0xc9f7('0x3f')]=function(){var _0x16f3a4=this;setInterval(function(){_0x16f3a4['clearZombieChannels'](_0x16f3a4[_0xc9f7('0x25')],_0xc9f7('0x151'));_0x16f3a4[_0xc9f7('0x152')](_0x16f3a4[_0xc9f7('0x23')],_0xc9f7('0x153'));},0x32c8);};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x152')]=function(_0x5de909,_0x2c5415){var _0x13eac5=this;for(var _0x4078ae in _0x5de909){if(typeof _0x5de909[_0x4078ae]!==_0xc9f7('0xb3')){this[_0xc9f7('0x1b')][_0xc9f7('0x154')](function(){if(!_[_0xc9f7('0xfa')](_0x5de909[_0x4078ae])){return ami[_0xc9f7('0xa8')]({'action':_0xc9f7('0x8e'),'channel':_0x5de909[_0x4078ae][_0xc9f7('0xf7')]})[_0xc9f7('0xa7')](function(_0x47c5fb){if(_0x47c5fb[_0xc9f7('0x6d')]===_0xc9f7('0x155')){setTimeout(function(){if(_0x5de909[_0x4078ae]&&_0x5de909[_0x4078ae][_0xc9f7('0xca')]!==_0xc9f7('0xcb')){_0x13eac5[_0xc9f7('0xcc')](_0x13eac5[_0xc9f7('0x1d')][_0x5de909[_0x4078ae][_0xc9f7('0xc8')]]);logger[_0xc9f7('0x6a')](_0xc9f7('0x156'),_0x2c5415,_0x4078ae,_0x5de909[_0x4078ae][_0xc9f7('0xc8')]);delete _0x5de909[_0x4078ae];}if(_0x5de909[_0x4078ae]&&_0x5de909[_0x4078ae][_0xc9f7('0xca')]==='ivr'){_0x13eac5[_0xc9f7('0xcc')](_0x13eac5[_0xc9f7('0x1e')][_0x5de909[_0x4078ae][_0xc9f7('0xc8')]]);logger[_0xc9f7('0x6a')](_0xc9f7('0x157'),_0x2c5415,_0x4078ae,_0x5de909[_0x4078ae]['queue']);delete _0x5de909[_0x4078ae];}},0x2328);}});}});}}};Dialer['prototype'][_0xc9f7('0x158')]=function(_0x2b065b){return Promise[_0xc9f7('0xb4')]()['then'](voiceQueueRt[_0xc9f7('0x158')](_0x2b065b))['catch'](loggerCatch(_0xc9f7('0x159')));};Dialer['prototype'][_0xc9f7('0xcc')]=function(_0x3adaf5){if(!_[_0xc9f7('0x42')](_0x3adaf5)&&_0x3adaf5!==null){if(typeof _0x3adaf5[_0xc9f7('0x86')]!==_0xc9f7('0xb3')){if(_0x3adaf5['originated']>0x0){_0x3adaf5[_0xc9f7('0x86')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xc9f7('0x6a')](_0xc9f7('0x15a'));}};Dialer['prototype'][_0xc9f7('0x15b')]=function(_0x3cc89e,_0x4725fb){var _0x15f529=this;return function(_0x2a4df3){_0x15f529['updateOriginated'](_0x4725fb);logger[_0xc9f7('0x6a')](_0x3cc89e,util[_0xc9f7('0x47')](_0x2a4df3,{'showHidden':![],'depth':null}));};};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x15c')]=function(_0x4b733d,_0x1b2818,_0x3a0e85){var _0x2fda69={'state':0x19,'statedesc':_0xc9f7('0x15d')};this[_0xc9f7('0xcc')](_0x1b2818);this[_0xc9f7('0x131')](_[_0xc9f7('0x64')](_0x2fda69,_['pick'](_0x3a0e85,[_0xc9f7('0xf2'),_0xc9f7('0xe6'),'UserId','VoiceQueueId',_0xc9f7('0xe8')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x4b733d);};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x131')]=function(_0x2bb40f,_0x41d956,_0xfa9968){hopperUtils['createHistory'](_0x2bb40f)['catch'](loggerCatch(_0x41d956));hopperUtils[_0xc9f7('0xd4')](_0x2bb40f)['catch'](loggerCatch(_0xfa9968));};Dialer[_0xc9f7('0x8b')][_0xc9f7('0xe3')]=function(_0x401e6e,_0x41c300){hopperUtils[_0xc9f7('0xd2')](_0x401e6e)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0xd3')));if(_0x41c300==0x0){hopperUtils[_0xc9f7('0xd4')](_0x401e6e)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x15e')));}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x150')]=function(_0x4ac816){return Promise['resolve']()[_0xc9f7('0x40')](cmHopper['handlePreviewRecallNotifications'](_0x4ac816['id'],previewRecallmeReminderInterval))['then'](function(_0x207e52){for(var _0x2911d7=0x0;_0x2911d7<_0x207e52[_0xc9f7('0xa0')];_0x2911d7++){var _0x276422=_0x207e52[_0x2911d7][_0xc9f7('0x15f')][_0xc9f7('0x4a')];if(_0x276422)io['to'](util[_0xc9f7('0x48')](_0xc9f7('0x14e'),_0x276422))[_0xc9f7('0x43')](_0xc9f7('0x14f'),{'hopper':_0x207e52[_0x2911d7]});}})[_0xc9f7('0xa7')](function(){});};Dialer['prototype'][_0xc9f7('0xb9')]=function(_0x48393e){var _0x2a329c=this;return function(){_0x2a329c['handleIvr'](_0x48393e);};};Dialer[_0xc9f7('0x8b')]['actionOriginate']=function(_0x1d41db,_0x28729e){var _0x45337d=this;var _0x42bbd1=uuid['v4']();this[_0xc9f7('0x23')][_0x42bbd1]=new Action(_0x1d41db,_0x28729e,_0x42bbd1);return new Promise(function(_0x4c4bf2,_0x1e156b){if(_[_0xc9f7('0x42')](_0x1d41db)&&typeof _0x1d41db!==_0xc9f7('0x160')){return _0x1e156b(msgResponse(_0xc9f7('0x161'),_0xc9f7('0x9a'),_0xc9f7('0x162')));}if(_[_0xc9f7('0x42')](_0x28729e[_0xc9f7('0x163')])||_0x28729e['phone']===null){return _0x1e156b(msgResponse(_0xc9f7('0x161'),_0xc9f7('0x9a'),'contact\x20is\x20undefine'));}var _0x470461={'XMD-CALLERID':_0x45337d[_0xc9f7('0x23')][_0x42bbd1][_0xc9f7('0x164')](),'XMD-AGI':_0x1d41db[_0xc9f7('0x138')]?util[_0xc9f7('0x48')](_0xc9f7('0x165'),ipAgi,_0x1d41db[_0xc9f7('0x138')]):_0xc9f7('0x166'),'XMD-AGIAFTER':_0x1d41db[_0xc9f7('0xcf')]?util[_0xc9f7('0x48')](_0xc9f7('0x165'),ipAgi,_0x1d41db[_0xc9f7('0xcf')]):_0xc9f7('0x166'),'XMD-QUEUE':utils['isOutboundQueue'](_0x1d41db)?util[_0xc9f7('0x48')]('\x22%s,%s%s,,,%s\x22',_0x1d41db['name'],_0x1d41db[_0xc9f7('0x167')]||'',_0x1d41db[_0xc9f7('0xd0')]?'c':'',_0x1d41db[_0xc9f7('0xd7')]||0x3):'NONE','XMD-CONTACTID':_0x28729e[_0xc9f7('0xf2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x45337d[_0xc9f7('0x23')][_0x42bbd1]['getCaller'](),'XMD-AMD':_0x1d41db[_0xc9f7('0x117')]?_0xc9f7('0x144'):_0xc9f7('0x166'),'XMD-DESTINATION':_0xc9f7('0x168')};if(_0x1d41db['dialAMDActive']){_0x470461['XMD-AMDINITIALSILENCE']=_0x1d41db['dialAMDInitialSilence']||0x9c4;_0x470461[_0xc9f7('0x169')]=_0x1d41db[_0xc9f7('0x16a')]||0x5dc;_0x470461[_0xc9f7('0x16b')]=_0x1d41db[_0xc9f7('0x16c')]||0x320;_0x470461[_0xc9f7('0x16d')]=_0x1d41db[_0xc9f7('0x16e')]||0x1388;_0x470461['XMD-AMDMINWORDLENGTH']=_0x1d41db[_0xc9f7('0x16f')]||0x64;_0x470461[_0xc9f7('0x170')]=_0x1d41db[_0xc9f7('0x171')]||0x32;_0x470461[_0xc9f7('0x172')]=_0x1d41db[_0xc9f7('0x173')]||0x3;_0x470461[_0xc9f7('0x174')]=_0x1d41db['dialAMDSilenceThreshold']||0x100;_0x470461['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d41db[_0xc9f7('0x175')]||0x1388;}if(utils[_0xc9f7('0x176')](_0x1d41db)){_0x470461[_0xc9f7('0x177')]=_0x28729e[_0xc9f7('0xe7')];}else{_0x470461[_0xc9f7('0x178')]=_0x28729e[_0xc9f7('0xe8')];}var _0x23fdd2=utils[_0xc9f7('0x179')](_0x28729e[_0xc9f7('0x17a')]);Object['assign'](_0x470461,_0x23fdd2);var _0xd697c6=_0x45337d[_0xc9f7('0x8c')](_0x1d41db['Trunk'])?utils[_0xc9f7('0x17b')](_0x1d41db[_0xc9f7('0x92')][_0xc9f7('0x17c')],_0x1d41db[_0xc9f7('0x17d')],_0x1d41db[_0xc9f7('0x17e')]>0x0?utils[_0xc9f7('0x17f')](_0x1d41db[_0xc9f7('0x180')],_0x1d41db[_0xc9f7('0x17e')]):_0x1d41db[_0xc9f7('0x180')]):utils[_0xc9f7('0x17b')](_[_0xc9f7('0xfa')](_0x1d41db[_0xc9f7('0x181')])?_0x1d41db[_0xc9f7('0x92')][_0xc9f7('0x17c')]:_0x1d41db[_0xc9f7('0x181')][_0xc9f7('0x17c')],_0x1d41db[_0xc9f7('0x17d')],_0x1d41db[_0xc9f7('0x17e')]>0x0?utils[_0xc9f7('0x17f')](_0x1d41db[_0xc9f7('0x180')],_0x1d41db[_0xc9f7('0x17e')]):_0x1d41db['dialOriginateCallerIdNumber']);if(_0xd697c6){_0x470461[_0xc9f7('0x182')]=_0x45337d['actions'][_0x42bbd1][_0xc9f7('0x183')]=utils[_0xc9f7('0x184')](_0xd697c6);_0x470461[_0xc9f7('0x185')]=_0x28729e['phone'];}_0x1d41db['variables']=_0x470461;return ami['Action']({'actionid':_0x42bbd1,'action':_0xc9f7('0x161'),'channel':_0x45337d[_0xc9f7('0x8c')](_0x1d41db[_0xc9f7('0x92')])?util[_0xc9f7('0x48')](_0xc9f7('0x186'),_0x1d41db['Trunk'][_0xc9f7('0x4a')],isNotNull(_0x1d41db['dialPrefix'])?_0x1d41db['dialPrefix'][_0xc9f7('0x187')]()||'':'',_0x1d41db[_0xc9f7('0x188')]>0x0?_0x28729e[_0xc9f7('0x163')]['substring'](_0x1d41db[_0xc9f7('0x188')]):_0x28729e[_0xc9f7('0x163')]):util[_0xc9f7('0x48')]('SIP/%s/%s%s',_[_0xc9f7('0xfa')](_0x1d41db[_0xc9f7('0x181')])?_0x1d41db['Trunk']['name']:_0x1d41db[_0xc9f7('0x181')][_0xc9f7('0x4a')],isNotNull(_0x1d41db[_0xc9f7('0x189')])?_0x1d41db[_0xc9f7('0x189')][_0xc9f7('0x187')]()||'':'',_0x1d41db[_0xc9f7('0x188')]>0x0?_0x28729e[_0xc9f7('0x163')][_0xc9f7('0x18a')](_0x1d41db[_0xc9f7('0x188')]):_0x28729e[_0xc9f7('0x163')]),'callerid':_0xd697c6,'Exten':_0xc9f7('0x168'),'Context':'from-sip','Priority':'1','variable':_0x470461,'timeout':(_0x1d41db[_0xc9f7('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x42bbd1})[_0xc9f7('0x40')](function(_0x439fc5){return _0x4c4bf2(_0x439fc5);})[_0xc9f7('0xa7')](function(_0x1adc09){_0x1d41db[_0xc9f7('0x18c')]+=0x1;var _0x4ea59b=new History(_0x45337d['actions'][_0x42bbd1]);logger[_0xc9f7('0x6a')](util[_0xc9f7('0x48')](_0xc9f7('0x18d'),JSON[_0xc9f7('0x7a')](_0x1adc09)));_0x4ea59b[_0xc9f7('0xd9')]=0xe;_0x4ea59b[_0xc9f7('0x74')]=_0xc9f7('0x18e');_0x4ea59b[_0xc9f7('0x76')]=moment()[_0xc9f7('0x48')](_0xc9f7('0xd1'));_0x4ea59b[_0xc9f7('0x75')]=_0x4ea59b[_0xc9f7('0x76')];hopperUtils['createHistory'](_0x4ea59b)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x18f')));_0x45337d[_0xc9f7('0xd4')](_0x4ea59b)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x18f')))['finally'](function(){delete _0x45337d[_0xc9f7('0x23')][_0x42bbd1];return _0x1e156b(msgResponse(_0xc9f7('0x161'),_0xc9f7('0x8a'),_0xc9f7('0x190')));});});});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x191')]=function(_0xe95004,_0x2a8cc4,_0x5ea7dd){var _0x1d30fd=new History(_0x2a8cc4);if(_0x1d30fd[_0xc9f7('0x126')]+_0x1d30fd[_0xc9f7('0x132')]+_0x1d30fd[_0xc9f7('0x127')]+_0x1d30fd[_0xc9f7('0x128')]+_0x1d30fd[_0xc9f7('0xe1')]+_0x1d30fd[_0xc9f7('0xee')]+_0x1d30fd['countmachineretry']+_0x1d30fd[_0xc9f7('0x12a')]>=_0x5ea7dd['dialGlobalMaxRetry']-0x1){return!![];}switch(_0xe95004){case 0x3:if(_0x1d30fd[_0xc9f7('0x127')]>=_0x5ea7dd[_0xc9f7('0x192')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1d30fd['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5ea7dd['dialNoAnswerRetryFrequency'],_0xc9f7('0xf1'))[_0xc9f7('0x48')](_0xc9f7('0xd1')),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd[_0xc9f7('0xe6')],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd['CampaignId']||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x193')));break;case 0x5:if(_0x1d30fd[_0xc9f7('0x126')]>=_0x5ea7dd[_0xc9f7('0x194')]-0x1){return!![];}hopperUtils[_0xc9f7('0xe4')]({'active':![],'countbusyretry':_0x1d30fd[_0xc9f7('0x126')]+=0x1,'scheduledat':moment()[_0xc9f7('0xe5')](_0x5ea7dd[_0xc9f7('0x195')],_0xc9f7('0xf1'))[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd[_0xc9f7('0xe6')],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x1d30fd[_0xc9f7('0x132')]>=_0x5ea7dd[_0xc9f7('0x196')]-0x1){return!![];}hopperUtils[_0xc9f7('0xe4')]({'active':![],'countcongestionretry':_0x1d30fd[_0xc9f7('0x132')]+=0x1,'scheduledat':moment()[_0xc9f7('0xe5')](_0x5ea7dd[_0xc9f7('0x197')],_0xc9f7('0xf1'))[_0xc9f7('0x48')](_0xc9f7('0xd1')),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd['ListId'],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x198')));break;case 0x0:if(_0x1d30fd[_0xc9f7('0x128')]>=_0x5ea7dd[_0xc9f7('0x199')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1d30fd[_0xc9f7('0x128')]+=0x1,'scheduledat':moment()['add'](_0x5ea7dd[_0xc9f7('0x19a')],_0xc9f7('0xf1'))[_0xc9f7('0x48')](_0xc9f7('0xd1')),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd['ListId'],'VoiceQueueId':_0x1d30fd['VoiceQueueId']||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})['catch'](loggerCatch(_0xc9f7('0x19b')));}break;case 0xa:if(_0x1d30fd[_0xc9f7('0xe1')]>=_0x5ea7dd[_0xc9f7('0xe2')]-0x1){return!![];}hopperUtils[_0xc9f7('0xe4')]({'active':![],'countdropretry':_0x1d30fd[_0xc9f7('0xe1')]+=0x1,'scheduledat':moment()[_0xc9f7('0xe5')](_0x5ea7dd[_0xc9f7('0xdc')],_0xc9f7('0xf1'))[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd[_0xc9f7('0xe6')],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1d30fd[_0xc9f7('0xee')]>=_0x5ea7dd[_0xc9f7('0xf0')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1d30fd[_0xc9f7('0xee')]+=0x1,'scheduledat':moment()['add'](_0x5ea7dd[_0xc9f7('0xef')],_0xc9f7('0xf1'))['format'](_0xc9f7('0xd1')),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd['ListId'],'VoiceQueueId':_0x1d30fd['VoiceQueueId']||undefined,'CampaignId':_0x1d30fd['CampaignId']||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0xf3')));break;case 0x13:if(_0x1d30fd[_0xc9f7('0x129')]>=_0x5ea7dd[_0xc9f7('0x12e')]-0x1){return!![];}hopperUtils[_0xc9f7('0xe4')]({'active':![],'countmachineretry':_0x1d30fd['countmachineretry']+=0x1,'scheduledat':moment()[_0xc9f7('0xe5')](_0x5ea7dd[_0xc9f7('0x133')],_0xc9f7('0xf1'))[_0xc9f7('0x48')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd[_0xc9f7('0xe6')],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x130')));break;case 0x14:if(_0x1d30fd[_0xc9f7('0x12a')]>=_0x5ea7dd['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xc9f7('0xe4')]({'active':![],'countagentrejectretry':_0x1d30fd[_0xc9f7('0x12a')]+=0x1,'scheduledat':moment()[_0xc9f7('0xe5')](_0x5ea7dd['dialAgentRejectRetryFrequency'],_0xc9f7('0xf1'))['format'](_0xc9f7('0xd1')),'ContactId':_0x1d30fd[_0xc9f7('0xf2')],'ListId':_0x1d30fd[_0xc9f7('0xe6')],'VoiceQueueId':_0x1d30fd[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1d30fd[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x19c')));break;default:return!![];}};Dialer[_0xc9f7('0x8b')]['callProgressDetecting']=function(_0x1b446f,_0xb51a44,_0x114ac1){var _0x58a775=this;var _0x3a2640=new History(_0x1b446f);var _0x59f093=![];var _0x11f588;var _0x4f3023;return new Promise(function(_0x4e78ba,_0x10f893){if(_[_0xc9f7('0x42')](_0xb51a44)&&typeof _0xb51a44!==_0xc9f7('0x160')){return _0x10f893(msgResponse(_0xc9f7('0x19d'),_0xc9f7('0x9a'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x114ac1)&&typeof _0x114ac1!==_0xc9f7('0x160')){return _0x10f893(msgResponse(_0xc9f7('0x19d'),_0xc9f7('0x9a'),_0xc9f7('0x19e')));}hopperUtils[_0xc9f7('0xde')](_0x3a2640,_0x114ac1[_0xc9f7('0x19f')],_0xb51a44)[_0xc9f7('0x40')](function(_0x3f4378){if(_0x3f4378['additional']==0x1)_0x59f093=!![];switch(_0x114ac1['reason']){case'0':_0xb51a44[_0xc9f7('0x1a0')]+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0x0;_0x3a2640['statedesc']='NoSuchNumber';_0x3a2640[_0xc9f7('0x128')]+=0x1;_0x3a2640[_0xc9f7('0x124')]+=0x1;ami['emit'](_0xc9f7('0x1a1'),ut[_0xc9f7('0x11d')](_0x1b446f,_0xc9f7('0x1a2')));_0x11f588=_0xb51a44[_0xc9f7('0x19a')];_0x4f3023=_0xb51a44[_0xc9f7('0xdd')];hopperUtils['createHistory'](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x125')));if(_0x58a775['checkRetriveMax'](0x0,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x128')]>=_0xb51a44[_0xc9f7('0x199')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,'reason\x200\x20no\x20such\x20number....');}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xb51a44['outboundNoAnswerCallsDay']+=0x1;_0x3a2640['state']=0x3;_0x3a2640[_0xc9f7('0x74')]=_0xc9f7('0x1a3');_0x3a2640[_0xc9f7('0x127')]+=0x1;_0x3a2640[_0xc9f7('0x124')]+=0x1;var _0x22242e=ut[_0xc9f7('0x1a4')](_0x1b446f,_0xb51a44);ami['emit']('custom:agentnoanswer',_0x22242e);_0x11f588=_0xb51a44['dialNoAnswerRetryFrequency'];_0x4f3023=_0xb51a44[_0xc9f7('0xdd')];hopperUtils[_0xc9f7('0xd2')](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1a5')));if(_0x58a775[_0xc9f7('0x191')](0x3,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x127')]>=_0xb51a44[_0xc9f7('0x192')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1a6'));}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1a6'));}}break;case'5':_0xb51a44[_0xc9f7('0x1a7')]+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0x5;_0x3a2640[_0xc9f7('0x74')]=_0xc9f7('0x1a8');_0x3a2640[_0xc9f7('0x126')]+=0x1;_0x3a2640[_0xc9f7('0x124')]+=0x1;ami[_0xc9f7('0x43')]('custom:agentbusy',ut['buildObj'](_0x1b446f,_0xc9f7('0x1a9')));_0x11f588=_0xb51a44[_0xc9f7('0x195')];_0x4f3023=_0xb51a44[_0xc9f7('0xdd')];hopperUtils[_0xc9f7('0xd2')](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x58a775[_0xc9f7('0x191')](0x5,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x126')]>=_0xb51a44[_0xc9f7('0x194')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1aa'));}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1aa'));}}break;case'8':_0xb51a44[_0xc9f7('0x1ab')]+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0x8;_0x3a2640[_0xc9f7('0x74')]=_0xc9f7('0x1ac');_0x3a2640[_0xc9f7('0x132')]+=0x1;_0x3a2640['countglobal']+=0x1;_0x11f588=_0xb51a44[_0xc9f7('0x197')];_0x4f3023=_0xb51a44['callAdditionalPhoneAfterMin'];ami[_0xc9f7('0x43')](_0xc9f7('0x1ad'),ut[_0xc9f7('0x11d')](_0x1b446f,_0xc9f7('0x1ae')));hopperUtils[_0xc9f7('0xd2')](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x58a775[_0xc9f7('0x191')](0x8,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x132')]>=_0xb51a44[_0xc9f7('0x196')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,'reason\x208\x20congestion');}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,'reason\x208\x20congestion');}}break;case'11':_0xb51a44['outboundAbandonedCallsDay']+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0xb;_0x3a2640[_0xc9f7('0x74')]=_0xc9f7('0xec');_0x3a2640[_0xc9f7('0xee')]+=0x1;_0x3a2640[_0xc9f7('0x124')]+=0x1;_0x11f588=_0xb51a44[_0xc9f7('0xef')];_0x4f3023=_0xb51a44[_0xc9f7('0xdd')];hopperUtils['createHistory'](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0xf5')));if(_0x58a775[_0xc9f7('0x191')](0xb,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0xee')]>=_0xb51a44[_0xc9f7('0xf0')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1af'));}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1af'));}}break;case'20':_0xb51a44[_0xc9f7('0x1b0')]+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0x14;_0x3a2640[_0xc9f7('0x74')]=_0xc9f7('0x1b1');_0x3a2640['countagentrejectretry']+=0x1;_0x3a2640[_0xc9f7('0x124')]+=0x1;_0x11f588=_0xb51a44['dialAgentRejectRetryFrequency'];_0x4f3023=_0xb51a44['callAdditionalPhoneAfterMin'];ami[_0xc9f7('0x43')](_0xc9f7('0x1b2'),ut[_0xc9f7('0x11d')](_0x1b446f,_0xc9f7('0x1b3')));hopperUtils['createHistory'](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1b4')));if(_0x58a775['checkRetriveMax'](0x14,_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x12a')]>=_0xb51a44[_0xc9f7('0x1b5')]){_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1b6'));}else{_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,_0xc9f7('0x1b6'));}}break;default:_0xb51a44[_0xc9f7('0x13b')]+=0x1;_0x3a2640[_0xc9f7('0xd9')]=0xc;_0x3a2640[_0xc9f7('0x74')]=_0x114ac1[_0xc9f7('0x19f')];_0x11f588=_0xb51a44[_0xc9f7('0x1b7')];_0x4f3023=_0xb51a44[_0xc9f7('0xdd')];hopperUtils[_0xc9f7('0xd2')](_0x3a2640)[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1b8')));if(_0x58a775[_0xc9f7('0x191')](_0x114ac1[_0xc9f7('0x19f')],_0x1b446f,_0xb51a44)&&!_0x59f093){if(_0x3a2640[_0xc9f7('0x126')]+_0x3a2640[_0xc9f7('0x132')]+_0x3a2640[_0xc9f7('0x127')]+_0x3a2640[_0xc9f7('0x128')]+_0x3a2640[_0xc9f7('0xe1')]+_0x3a2640[_0xc9f7('0xee')]+_0x3a2640[_0xc9f7('0x129')]+_0x3a2640[_0xc9f7('0x12a')]>=_0xb51a44[_0xc9f7('0x12b')]){_0x58a775[_0xc9f7('0x12c')](_0x3a2640,_0x4e78ba,_0x10f893,_0x114ac1[_0xc9f7('0x19f')]);}else{_0x58a775[_0xc9f7('0x12f')](_0x3a2640,_0x4e78ba,_0x10f893,_0x114ac1[_0xc9f7('0x19f')]);}}}})['then'](function(){if(_0x59f093){hopperUtils[_0xc9f7('0xeb')](_0x3a2640,_0x11f588,_0x4f3023)['then'](function(){return _0x4e78ba(0x1);});}});});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x12c')]=function(_0x1b8086,_0x42e09a,_0x9d9ab4,_0x1e084e){var _0xa4e34=new Final(_0x1b8086);_0xa4e34[_0xc9f7('0xd9')]=0xf;_0xa4e34[_0xc9f7('0x74')]='Global';this['createStateFinal'](_0xa4e34,_0x42e09a,_0x9d9ab4,_0x1e084e);};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x12f')]=function(_0x4c9006,_0x819a25,_0x5e3b90,_0x5243d4){hopperUtils[_0xc9f7('0xd4')](_0x4c9006)[_0xc9f7('0x40')](function(){return _0x819a25(msgResponse(_0xc9f7('0x19d'),_0xc9f7('0x112'),_0x5243d4));})['catch'](function(){return _0x5e3b90(msgResponse(_0xc9f7('0x1b9'),_0xc9f7('0x9a'),'contact\x20not\x20moved'));});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x8')]=function(_0x2ab997){var _0x14f9ce=_0x2ab997[_0xc9f7('0x1ba')]/0x64;var _0x2b4893=_0x2ab997['outboundDropCallsDayTimeout']/(_0x2ab997[_0xc9f7('0xd8')]+_0x2ab997[_0xc9f7('0xcd')]);var _0x4d73ff=Math[_0xc9f7('0x1bb')](_0x2ab997[_0xc9f7('0x1bc')]*(_0x2ab997['predictiveIntervalMaxThreshold']/0x64));var _0x2a2f37=Math[_0xc9f7('0x1bb')](_0x2ab997[_0xc9f7('0x1bc')]*(_0x2ab997[_0xc9f7('0x1bd')]/0x64));var _0x3af6dc=_0x2ab997['available']+_0x2ab997['talking'];var _0x146381=Math['floor'](_0x2ab997[_0xc9f7('0x5e')]*_0x2ab997[_0xc9f7('0x60')]*_0x2ab997[_0xc9f7('0x1be')]*_0x2ab997[_0xc9f7('0x1bf')]);if(_['isUndefined'](_0x2ab997['startProgressive'])){if(!_[_0xc9f7('0x42')](_0x2ab997[_0xc9f7('0x27')])){_0x2ab997[_0xc9f7('0x27')]=undefined;loggerPredictive[_0xc9f7('0x6a')](_0xc9f7('0x1c0'),_0xc9f7('0x1c1'));}if(!_[_0xc9f7('0x42')](_0x2ab997[_0xc9f7('0x68')])){loggerPredictive['error'](_0xc9f7('0x1c0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2ab997['handlePredictive']);_0x2ab997['handlePredictive']=undefined;}_0x2ab997[_0xc9f7('0x28')]=moment()[_0xc9f7('0x48')](_0xc9f7('0xd1'));loggerPredictive[_0xc9f7('0x4c')](_0x2ab997[_0xc9f7('0x4a')],_0xc9f7('0x1c2'),_0x2ab997[_0xc9f7('0x28')]);this['handlePower'](_0x2ab997,0x1);}else if(ifInterval(_0x2ab997[_0xc9f7('0x1c3')],_0x2ab997[_0xc9f7('0x28')])){this[_0xc9f7('0xbc')](_0x2ab997,0x1);loggerPredictiveCalls[_0xc9f7('0x4c')](_0xc9f7('0x1c4'),_0x2ab997[_0xc9f7('0x28')],_0x2ab997[_0xc9f7('0x4a')]);_0x2ab997['erlangCalls']=0x0;_0x2ab997['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x14f9ce<_0x2b4893&&_0x2ab997[_0xc9f7('0x1c5')]==='dropRate'){clearPredictiveAttributes(_0x2ab997);loggerPredictive['info'](_0xc9f7('0x1c6'),'Dropped\x20calls\x20day',_0x2b4893,_0xc9f7('0x28'),_0x2ab997[_0xc9f7('0x4a')]);}else if(_0x146381<_0x2ab997[_0xc9f7('0x1c7')]&&_0x2ab997[_0xc9f7('0x1c5')]===_0xc9f7('0x1c8')){clearPredictiveAttributes(_0x2ab997);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc9f7('0x1c9'),_0x146381,'Drop\x20in\x20this\x20interval',_0x2ab997['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x2ab997[_0xc9f7('0x4a')]);}else if(!ifInterval(_0x2ab997[_0xc9f7('0x1c3')],_0x2ab997[_0xc9f7('0x28')])&&_[_0xc9f7('0x42')](_0x2ab997[_0xc9f7('0x27')])&&!_['isUndefined'](_0x2ab997['startProgressive'])){_0x2ab997[_0xc9f7('0x27')]=moment()[_0xc9f7('0x48')](_0xc9f7('0xd1'));loggerPredictive[_0xc9f7('0x4c')](_0x2ab997[_0xc9f7('0x4a')],_0xc9f7('0x1ca'),_0x2ab997[_0xc9f7('0x27')]);hopperUtils[_0xc9f7('0x1cb')](_0x2ab997['dialPredictiveInterval'])[_0xc9f7('0x40')](this['getDataPredictive'](_0x2ab997))[_0xc9f7('0x40')](mergeDataErlangB(_0x2ab997))[_0xc9f7('0x40')](this['startMethodPredictive'](_0x2ab997))[_0xc9f7('0xa7')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2ab997));}else if(!ifInterval(_0x2ab997['dialPredictiveInterval'],_0x2ab997[_0xc9f7('0x27')])){_0x2ab997['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2ab997['startPredictive']=moment()['format'](_0xc9f7('0xd1'));loggerPredictive[_0xc9f7('0x4c')](_0x2ab997['name'],_0xc9f7('0x1cc'),_0x2ab997['startPredictive']);clearInterval(_0x2ab997[_0xc9f7('0x68')]);_0x2ab997[_0xc9f7('0x68')]=undefined;hopperUtils[_0xc9f7('0x1cb')](_0x2ab997[_0xc9f7('0x1c3')])[_0xc9f7('0x40')](this[_0xc9f7('0x1cd')](_0x2ab997))['then'](mergeDataErlangB(_0x2ab997))[_0xc9f7('0x40')](this['startMethodPredictive'](_0x2ab997))[_0xc9f7('0xa7')](loggerCatchPredictive(_0xc9f7('0x1ce'),_0x2ab997));}else if(_0x2ab997[_0xc9f7('0x1bc')]&&_0x3af6dc<_0x2ab997[_0xc9f7('0x1bc')]-_0x2a2f37){clearPredictiveAttributes(_0x2ab997);loggerPredictive[_0xc9f7('0x4c')](_0x2ab997['name'],_0xc9f7('0x1cf'),_0x3af6dc,_0xc9f7('0x1d0'),_0x2ab997['predictiveIntervalAvailable'],'-',_0x2a2f37,'=',_0x2ab997['predictiveIntervalAvailable']-_0x2a2f37,')');}else if(_0x2ab997['predictiveIntervalAvailable']&&_0x3af6dc>_0x2ab997[_0xc9f7('0x1bc')]+_0x4d73ff){clearPredictiveAttributes(_0x2ab997);loggerPredictive[_0xc9f7('0x4c')](_0x2ab997[_0xc9f7('0x4a')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x3af6dc,_0xc9f7('0x1d1'),_0x2ab997[_0xc9f7('0x1bc')],'+',_0x4d73ff,'=',_0x2ab997['predictiveIntervalAvailable']+_0x4d73ff,')');}};Dialer[_0xc9f7('0x8b')]['getDataPredictive']=function(_0x3f9048){var _0xf0b1f3=this;return function(_0x11ead9){return new Promise(function(_0x22370b,_0x3cde22){_[_0xc9f7('0x64')](_0x3f9048,_0x11ead9[0x0]);if(checkGetDataPredictive(_0x11ead9[0x0])){var _0x510168=_0x3f9048[_0xc9f7('0x1bc')]=_0x3f9048[_0xc9f7('0x143')]+_0x3f9048['available'];var _0x36d287=_0x3f9048[_0xc9f7('0x1c3')]*0x3c;var _0xc709df=_0x11ead9[0x0]['predictiveIntervalAvgTalktime']+_0x11ead9[0x0][_0xc9f7('0x55')];var _0x3e3e9b=(_0x11ead9[0x0][_0xc9f7('0x1d2')]+_0x11ead9[0x0][_0xc9f7('0x52')]+_0x11ead9[0x0][_0xc9f7('0x54')])/_0x11ead9[0x0]['predictiveIntervalTotalCalls'];_0x3f9048[_0xc9f7('0x1be')]=_0x3e3e9b>0x0?_0x3e3e9b:0x1;switch(_0x3f9048['dialPredictiveOptimization']){case _0xc9f7('0x1c8'):var _0x39b151=_0x3f9048[_0xc9f7('0x1ba')]/0x64;return _0xf0b1f3[_0xc9f7('0x1d3')](_0x510168,_0x36d287,_0xc709df,_0x3e3e9b,_0x39b151)['then'](function(_0x2c380d){return _0x22370b(_0x2c380d);});case _0xc9f7('0x1d4'):var _0x251e27=_0x3f9048['dialPredictiveOptimizationPercentage']/0x64;return _0xf0b1f3[_0xc9f7('0x1d5')](_0x510168,_0x36d287,_0xc709df,_0x3e3e9b,_0x251e27)[_0xc9f7('0x40')](function(_0x3a0a21){return _0x22370b(_0x3a0a21);});default:return _0x3cde22(msgResponse(_0xc9f7('0x1d6'),_0xc9f7('0x9a'),'Unknown\x20Predictive'));}}else{return _0x3cde22(msgResponse(_0xc9f7('0x1d6'),_0xc9f7('0x9a'),'check\x20failure'));}});};};Dialer['prototype'][_0xc9f7('0x1d7')]=function(_0x2722b0){var _0x2ef185=this;return function(_0x34abb3){return new Promise(function(_0x27c5d3,_0x1c08b8){_[_0xc9f7('0x64')](_0x2722b0,_0x34abb3[0x0]);if(checkGetDataPredictive(_0x34abb3[0x0])){loggerPredictive[_0xc9f7('0x4c')](JSON[_0xc9f7('0x7a')](_0x34abb3[0x0]));if(_0x2722b0[_0xc9f7('0x1c5')]===_0xc9f7('0x1c8')){return _0x2ef185[_0xc9f7('0x158')](_0x2722b0['id'])[_0xc9f7('0x40')](function(_0x45d11e){var _0x1a6c64=_0x2722b0['loggedIn']-_0x45d11e[0x0][_0xc9f7('0x1d8')];var _0x19588d=_0x2722b0[_0xc9f7('0x1c3')]*0x3c;var _0x5e5747=_0x34abb3[0x0]['predictiveIntervalAvgTalktime']+_0x34abb3[0x0][_0xc9f7('0x55')];var _0x5d64b0=(_0x34abb3[0x0][_0xc9f7('0x1d2')]+_0x34abb3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x34abb3[0x0][_0xc9f7('0x54')])/_0x34abb3[0x0][_0xc9f7('0x4f')];var _0x5ca530=_0x2722b0[_0xc9f7('0x1ba')]/0x64;_0x2722b0[_0xc9f7('0x1d9')]=_0x45d11e[0x0][_0xc9f7('0x1d8')]||0x0;_0x2722b0['predictiveIntervalHitRate']=_0x5d64b0>0x0?_0x5d64b0:0x1;return _0x2ef185[_0xc9f7('0x1d3')](_0x1a6c64,_0x19588d,_0x5e5747,_0x5d64b0,_0x5ca530);})[_0xc9f7('0x40')](function(_0x374387){return _0x27c5d3(_0x374387);})['catch'](function(_0x236384){return _0x1c08b8(msgResponse(_0xc9f7('0x1da'),_0xc9f7('0x9a'),JSON[_0xc9f7('0x7a')](_0x236384)));});}if(_0x2722b0[_0xc9f7('0x1c5')]===_0xc9f7('0x1d4')){return _0x2ef185[_0xc9f7('0x158')](_0x2722b0['id'])[_0xc9f7('0x40')](function(_0x1f47ea){var _0x3ddd48=_0x2722b0['loggedIn']-_0x1f47ea[0x0]['outboundQueuePauses'];var _0x165937=_0x2722b0['dialPredictiveInterval']*0x3c;var _0xee2ab2=_0x34abb3[0x0]['predictiveIntervalAvgTalktime']+_0x34abb3[0x0][_0xc9f7('0x55')];var _0x598379=(_0x34abb3[0x0][_0xc9f7('0x1d2')]+_0x34abb3[0x0][_0xc9f7('0x52')]+_0x34abb3[0x0][_0xc9f7('0x54')])/_0x34abb3[0x0][_0xc9f7('0x4f')];var _0x25b614=_0x2722b0[_0xc9f7('0x1ba')]/0x64;_0x2722b0['predictiveIntervalPauses']=_0x1f47ea[0x0][_0xc9f7('0x1d8')]||0x0;_0x2722b0[_0xc9f7('0x1be')]=_0x598379>0x0?_0x598379:0x1;return _0x2ef185[_0xc9f7('0x1d5')](_0x3ddd48,_0x165937,_0xee2ab2,_0x598379,_0x25b614);})['then'](function(_0x5a12aa){return _0x27c5d3(_0x5a12aa);})[_0xc9f7('0xa7')](function(_0x347ef2){return _0x1c08b8(msgResponse(_0xc9f7('0x1da'),_0xc9f7('0x9a'),JSON['stringify'](_0x347ef2)));});}}else{return _0x1c08b8(msgResponse(_0xc9f7('0x1d6'),_0xc9f7('0x9a'),_0xc9f7('0x1db')));}});};};Dialer[_0xc9f7('0x8b')]['startMethodPredictive']=function(_0x57203e){var _0x4d6154=this;return function(){var _0x29a537=0x0;var _0x10a2bd=Math[_0xc9f7('0x1dc')](_0x57203e['erlangCallToSecond']*0x3e8);if(_0x10a2bd>0x0){_0x10a2bd=_0x10a2bd<0x64?0x64:_0x10a2bd;loggerPredictive[_0xc9f7('0x4c')](_0x57203e[_0xc9f7('0x4a')],_0xc9f7('0x1dd'),_0x10a2bd,_0xc9f7('0x1de'));_0x57203e[_0xc9f7('0x68')]=setInterval(function(){_0x4d6154[_0xc9f7('0x68')](_0x57203e);loggerPredictiveCalls[_0xc9f7('0x4c')](_0xc9f7('0x1df'),_0x29a537+=0x1);},_0x10a2bd);}else{loggerPredictive['info'](_0x57203e[_0xc9f7('0x4a')],_0xc9f7('0x1e0'));}};};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x1e1')]=function(_0x39b826,_0x24bcda){var _0x1740de=this;return function(_0x2b35b0){if(_[_0xc9f7('0x4b')](_0x2b35b0)){if(_[_0xc9f7('0xfa')](_0x24bcda[_0xc9f7('0x1e2')])||!_0x24bcda[_0xc9f7('0x1e3')]){if(_0x39b826[_0xc9f7('0x1e4')]===_0xc9f7('0x7')){_0x39b826[_0xc9f7('0x77')]=_[_0xc9f7('0x42')](_0x39b826[_0xc9f7('0x77')])?!![]:_0x39b826[_0xc9f7('0x77')];var _0x1bf1bf=uuid['v4']();_0x1740de[_0xc9f7('0x23')][_0x1bf1bf]=new Action(_0x39b826,_0x24bcda,_0x1bf1bf);loggerBooked['info'](_0xc9f7('0x1e5'),_0x1bf1bf,_0xc9f7('0x1e6'),JSON[_0xc9f7('0x7a')](_0x39b826[_0xc9f7('0x77')]),_0xc9f7('0x1e7'),_0x39b826[_0xc9f7('0x4a')]);if(_0x39b826[_0xc9f7('0x77')]){_0x39b826[_0xc9f7('0x77')]=![];_0x1740de[_0xc9f7('0x2a')][_0x1740de[_0xc9f7('0x23')][_0x1bf1bf][_0xc9f7('0xc8')]]=[];ami[_0xc9f7('0xa8')]({'actionid':_0x1bf1bf,'action':_0xc9f7('0x1e8'),'queue':_0x39b826[_0xc9f7('0x4a')]})[_0xc9f7('0xa7')](function(){_0x1740de[_0xc9f7('0xcc')](_0x39b826);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1740de['actions'][_0x1bf1bf][_0xc9f7('0xf2')],'ListId':_0x1740de['actions'][_0x1bf1bf][_0xc9f7('0xe6')],'VoiceQueueId':_0x1740de[_0xc9f7('0x23')][_0x1bf1bf]['VoiceQueueId']||undefined,'CampaignId':_0x1740de[_0xc9f7('0x23')][_0x1bf1bf][_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1e9')));delete _0x1740de[_0xc9f7('0x23')][_0x1bf1bf];});}else{loggerBooked['info'](_0xc9f7('0x1ea'),JSON[_0xc9f7('0x7a')](_0x39b826['queueStatusComplete']),_0xc9f7('0x1e7'),_0x39b826[_0xc9f7('0x4a')]);_0x1740de['updateOriginated'](_0x39b826);hopperUtils[_0xc9f7('0xe4')]({'active':![],'ContactId':_0x1740de[_0xc9f7('0x23')][_0x1bf1bf]['ContactId'],'ListId':_0x1740de[_0xc9f7('0x23')][_0x1bf1bf][_0xc9f7('0xe6')],'VoiceQueueId':_0x1740de['actions'][_0x1bf1bf][_0xc9f7('0xe7')]||undefined,'CampaignId':_0x1740de[_0xc9f7('0x23')][_0x1bf1bf][_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1e9')));delete _0x1740de[_0xc9f7('0x23')][_0x1bf1bf];}}else{return _0x1740de['actionOriginate'](_0x39b826,_0x24bcda);}}else{if(utils[_0xc9f7('0x65')](undefined,_0x24bcda[_0xc9f7('0x1eb')])<_0x39b826[_0xc9f7('0x1ec')]*0x3c){if(_0x24bcda[_0xc9f7('0x15f')]&&!_0x24bcda[_0xc9f7('0x15f')][_0xc9f7('0x1ed')]){_0x1740de['preview'][_0xc9f7('0x100')](_0x24bcda['id'])[_0xc9f7('0x1a')](function(){_0x1740de['updateOriginated'](_0x39b826);});}else{hopperUtils[_0xc9f7('0x1ee')]({'active':![]},_0x24bcda['id'],0x1)[_0xc9f7('0x1a')](function(){_0x1740de[_0xc9f7('0xcc')](_0x39b826);});}}else{_0x39b826[_0xc9f7('0x1ef')]+=0x1;_0x1740de[_0xc9f7('0xcc')](_0x39b826);if(_0x39b826['dialRecallInQueue']){hopperUtils[_0xc9f7('0xe4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x24bcda[_0xc9f7('0xf2')],'ListId':_0x24bcda[_0xc9f7('0xe6')],'VoiceQueueId':_0x24bcda[_0xc9f7('0xe7')]||undefined,'CampaignId':_0x24bcda[_0xc9f7('0xe8')]||undefined})[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1f0')));hopperUtils[_0xc9f7('0xd2')](createObjHistory(_0x39b826,_0x24bcda,utils[_0xc9f7('0x6e')]['QUEUE_RECALL'],0x17,_0xc9f7('0x1f1')))[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x1f2')));}else{_0x1740de[_0xc9f7('0x131')](createObjHistory(_0x39b826,_0x24bcda,utils[_0xc9f7('0x6e')]['RECALL_TIMEOUT'],0x16,_0xc9f7('0x1f3')),_0xc9f7('0x1f4'),_0xc9f7('0x1f5'));}}}}else{_0x39b826[_0xc9f7('0x1f6')]+=0x1;_0x1740de[_0xc9f7('0x131')](createObjHistory(_0x39b826,_0x24bcda,utils[_0xc9f7('0x6e')][_0xc9f7('0x1f7')],0xd,_0xc9f7('0x1f8')),_0xc9f7('0x1f9'),_0xc9f7('0x1fa'));throw _0xc9f7('0x1fb');}};};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x1fc')]=function(_0x32cf15){var _0x1c73c2=this;var _0x1b9e9c=_0x32cf15[_0xc9f7('0x1fd')]-_0x32cf15['originated'];emitCampaignSummary(_0x32cf15);if(_0x1b9e9c>0x0&&_0x32cf15[_0xc9f7('0x1fe')]==0x0){if(_0x1b9e9c>this['maxNumberOriginate']){_0x1b9e9c=this['maxNumberOriginate'];}_0x32cf15['temp']=0x1;hopperUtils[_0xc9f7('0x1ff')](_0x32cf15,_0x1b9e9c)[_0xc9f7('0x40')](function(_0x2d5f1f){_0x32cf15['temp']=0x0;if(_0x2d5f1f){if(!utils['checkContactEmpty'](_0x2d5f1f)){_0x32cf15[_0xc9f7('0x6d')]=utils[_0xc9f7('0x6e')]['NO_AVAILABLE_CONTACTS'];logger[_0xc9f7('0x4c')](_0xc9f7('0x200')+_0x32cf15['name']);}else{_0x32cf15[_0xc9f7('0x86')]+=_0x2d5f1f[_0xc9f7('0xa0')];_0x32cf15['message']=utils[_0xc9f7('0x6e')][_0xc9f7('0x201')];for(var _0x78652b=0x0;_0x78652b<_0x2d5f1f[_0xc9f7('0xa0')];_0x78652b+=0x1){_0x32cf15[_0xc9f7('0x202')]+=0x1;if(_[_0xc9f7('0xfa')](_0x2d5f1f[_0x78652b])||_[_0xc9f7('0xfa')](_0x2d5f1f[_0x78652b]['Contact'])||_[_0xc9f7('0xfa')](_0x2d5f1f[_0x78652b][_0xc9f7('0x163')])){_0x1c73c2['emptyContact'](_0xc9f7('0x203'),_0x32cf15,_0x2d5f1f[_0x78652b]);}else{hopperUtils[_0xc9f7('0x204')](_[_0xc9f7('0x7b')](_0x2d5f1f[_0x78652b],[_0xc9f7('0xe8'),_0xc9f7('0x163')]))[_0xc9f7('0x40')](_0x1c73c2[_0xc9f7('0x1e1')](_0x32cf15,_0x2d5f1f[_0x78652b]))[_0xc9f7('0xa7')](_0x1c73c2['loggerHandler'](_0xc9f7('0x205'),_0x32cf15));}}}}})['catch'](loggerGetContactDialer(_0xc9f7('0x206'),_0x32cf15,_0x1b9e9c));}};Dialer['prototype']['handlePower']=function(_0x17b3e4,_0x50ee66){var _0x5f1e50=this;var _0x1de795=[];if(_0x50ee66<0x1||_0x17b3e4['dialMethod']===_0xc9f7('0x7')){_0x50ee66=0x1;}var _0x16272a=Math[_0xc9f7('0x1dc')](_0x17b3e4[_0xc9f7('0x142')]*_0x50ee66)-_0x17b3e4['originated'];if(_0x17b3e4[_0xc9f7('0x207')]>0x0){var _0xcd95b5=_0x17b3e4['dialLimitQueue']-_0x17b3e4[_0xc9f7('0x86')]-_0x17b3e4[_0xc9f7('0x143')]-_0x17b3e4[_0xc9f7('0x208')];if(_0x16272a>_0xcd95b5){_0x16272a=_0xcd95b5;}}if(_0x16272a>0x0&&_0x17b3e4['temp']==0x0){if(_0x17b3e4[_0xc9f7('0x1e4')]===_0xc9f7('0x7')){_0x16272a=0x1;}if(_0x16272a>this['maxNumberOriginate']){_0x16272a=this[_0xc9f7('0x21')];}for(var _0x462046 in this[_0xc9f7('0x1f')]){if(typeof this[_0xc9f7('0x1f')][_0x462046]!==_0xc9f7('0xb3')){if(this[_0xc9f7('0x1f')][_0x462046]['state']===_0xc9f7('0x209')&&this['agents'][_0x462046][_0xc9f7('0x8e')]===_0xc9f7('0x8f')){_0x1de795[_0xc9f7('0xa1')](this[_0xc9f7('0x1f')][_0x462046]['id']);}}}_0x17b3e4[_0xc9f7('0x1fe')]=0x1;hopperUtils['getContactDialer'](_0x17b3e4,_0x1de795,_0x16272a)['then'](function(_0x27f830){_0x17b3e4[_0xc9f7('0x1fe')]=0x0;if(_0x27f830){if(!utils[_0xc9f7('0x20a')](_0x27f830)){hopperUtils['countReScheduled'](_0x17b3e4)[_0xc9f7('0x40')](sendMessageReschedule(_0x17b3e4))[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x20b')));}else{_0x17b3e4[_0xc9f7('0x86')]+=_0x27f830[_0xc9f7('0xa0')];_0x17b3e4['message']=_0x17b3e4[_0xc9f7('0x1e4')]===_0xc9f7('0x7')?utils[_0xc9f7('0x6e')][_0xc9f7('0x144')]:utils[_0xc9f7('0x6e')][_0xc9f7('0x201')];for(var _0x2f1de6=0x0;_0x2f1de6<_0x27f830[_0xc9f7('0xa0')];_0x2f1de6+=0x1){if(_[_0xc9f7('0xfa')](_0x27f830[_0x2f1de6])||_[_0xc9f7('0xfa')](_0x27f830[_0x2f1de6][_0xc9f7('0x17a')])||_[_0xc9f7('0xfa')](_0x27f830[_0x2f1de6][_0xc9f7('0x163')])){_0x5f1e50[_0xc9f7('0x15c')](_0xc9f7('0x203'),_0x17b3e4,_0x27f830[_0x2f1de6]);}else{hopperUtils[_0xc9f7('0x20c')](_['pick'](_0x27f830[_0x2f1de6],['VoiceQueueId',_0xc9f7('0x163')]))[_0xc9f7('0x40')](_0x5f1e50[_0xc9f7('0x1e1')](_0x17b3e4,_0x27f830[_0x2f1de6]))[_0xc9f7('0xa7')](_0x5f1e50[_0xc9f7('0x15b')]('[actionOriginate]\x20',_0x17b3e4));}}}}})[_0xc9f7('0xa7')](loggerGetContactDialer('[getContactDialer2]',_0x17b3e4,_0x16272a));}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x68')]=function(_0x4a7d2e){if(_0x4a7d2e[_0xc9f7('0x207')]>0x0){var _0x15bb0d=_0x4a7d2e[_0xc9f7('0x207')]-_0x4a7d2e['originated']-_0x4a7d2e[_0xc9f7('0x143')];if(_0x15bb0d>0x0&&_0x4a7d2e[_0xc9f7('0x1fe')]==0x0){this[_0xc9f7('0x20d')](_0x4a7d2e);}else{loggerPredictiveCalls[_0xc9f7('0x4c')]('[handlePredictive][limitChannel]');}}else{this[_0xc9f7('0x20d')](_0x4a7d2e);}};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x20d')]=function(_0x2ec4ef){var _0x2e1b74=this;var _0x189b69=[];_0x2ec4ef[_0xc9f7('0x86')]+=0x1;for(var _0x272650 in this[_0xc9f7('0x1f')]){if(typeof this[_0xc9f7('0x1f')][_0x272650]!==_0xc9f7('0xb3')){if(this['agents'][_0x272650][_0xc9f7('0xd9')]===_0xc9f7('0x209')&&this[_0xc9f7('0x1f')][_0x272650]['status']==='reachable'){_0x189b69[_0xc9f7('0xa1')](this['agents'][_0x272650]['id']);}}}_0x2ec4ef[_0xc9f7('0x1fe')]=0x1;return this['getContactDialer'](_0x2ec4ef['id'],_0x189b69,0x1,_0x2ec4ef[_0xc9f7('0x20e')],_0x2ec4ef)[_0xc9f7('0x40')](function(_0x49e1e7){_0x2ec4ef[_0xc9f7('0x1fe')]=0x1;if(_0x49e1e7){if(!utils[_0xc9f7('0x20a')](_0x49e1e7)){utils['checkContactLowerLimitOriginate'](_0x2ec4ef,0x1,0x0);return hopperUtils[_0xc9f7('0x20f')](_0x2ec4ef)['then'](sendMessageReschedule(_0x2ec4ef))[_0xc9f7('0xa7')](loggerCatch(_0xc9f7('0x20b')));}else{_0x2ec4ef['message']=utils['CAMPAIGN_STATUS'][_0xc9f7('0x201')];if(_[_0xc9f7('0xfa')](_0x49e1e7[0x0])||_[_0xc9f7('0xfa')](_0x49e1e7[0x0][_0xc9f7('0x17a')])||_[_0xc9f7('0xfa')](_0x49e1e7[0x0]['phone'])){_0x2e1b74[_0xc9f7('0x15c')](_0xc9f7('0x203'),_0x2ec4ef,_0x49e1e7[0x0]);}else{return hopperUtils[_0xc9f7('0x20c')](_['pick'](_0x49e1e7[0x0],['VoiceQueueId',_0xc9f7('0x163')]))[_0xc9f7('0x40')](_0x2e1b74[_0xc9f7('0x1e1')](_0x2ec4ef,_0x49e1e7[0x0]))['catch'](_0x2e1b74[_0xc9f7('0x15b')]('[actionOriginatePredictive]\x20',_0x2ec4ef));}}}})[_0xc9f7('0xa7')](loggerGetContactDialer('[getContactDialerPredictive]',_0x2ec4ef,0x1));};Dialer[_0xc9f7('0x8b')]['abandonmentRate']=function(_0x38f439,_0x23e17d,_0x4f0106,_0x4be925,_0x32665d,_0x5828b4){loggerPredictive['info'](_0xc9f7('0x210'));loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x211'),_0x38f439);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x212'),_0x23e17d);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x213'),_0x4f0106);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x214'),_0x4be925);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x215'),_0x32665d);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x58'));return new Promise(function(_0x42f3e1,_0x28bb2a){if(_0x38f439<=0x0||isNaN(_0x38f439)){return _0x28bb2a(msgResponse('[abandonmentRate]','Error',_0xc9f7('0x216')+_0x38f439));}if(_0x4f0106<=0x0||isNaN(_0x4f0106)){return _0x28bb2a(msgResponse(_0xc9f7('0x217'),'Error','Ts\x20=\x20'+_0x4f0106));}if(_0x4be925<=0x0||isNaN(_0x4be925)){return _0x28bb2a(msgResponse(_0xc9f7('0x217'),_0xc9f7('0x8a'),_0xc9f7('0x218')+_0x4be925));}if(_0x23e17d<=0x0||isNaN(_0x23e17d)){return _0x28bb2a(msgResponse(_0xc9f7('0x217'),'Error',_0xc9f7('0x219')+_0x23e17d));}if(_0x32665d<=0x0||isNaN(_0x32665d)){return _0x28bb2a(msgResponse(_0xc9f7('0x217'),'Error',_0xc9f7('0x21a')+_0x32665d));}_0x5828b4=_0x5828b4||0x0;var _0xb3883d=0x1/_0x4f0106;var _0x2aeae2=0x0;var _0x24336c=0x0;var _0x3cab2f=0x0;var _0x6a4a0b=0x0;for(var _0x5c349e=0x0;_0x3cab2f<_0x32665d;_0x5c349e+=0x1){_0x24336c=_0x5c349e/_0x23e17d;_0x2aeae2=(_0x4be925*_0x24336c+_0x5828b4)/_0xb3883d;_0x3cab2f=utils[_0xc9f7('0x21b')](_0x2aeae2,_0x38f439);_0x6a4a0b=_0x2aeae2/_0x38f439*(0x1-utils[_0xc9f7('0x21b')](_0x2aeae2,_0x38f439));}return _0x42f3e1({'erlangCalls':_0x5c349e,'erlangCallToSecond':_0x23e17d/_0x5c349e,'erlangAbandonmentRate':_0x3cab2f,'erlangBusyFactor':_0x6a4a0b});});};Dialer[_0xc9f7('0x8b')][_0xc9f7('0x1d5')]=function(_0x45a0fd,_0x14cfcf,_0x13fa1c,_0x3a079c,_0x54bfda,_0xcc99dc){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xc9f7('0x211'),_0x45a0fd);loggerPredictive[_0xc9f7('0x4c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14cfcf);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x213'),_0x13fa1c);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x214'),_0x3a079c);loggerPredictive[_0xc9f7('0x4c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54bfda);loggerPredictive[_0xc9f7('0x4c')](_0xc9f7('0x58'));return new Promise(function(_0x42e7e9,_0x20a0eb){if(_0x45a0fd<=0x0||isNaN(_0x45a0fd)){return _0x20a0eb(msgResponse(_0xc9f7('0x21c'),_0xc9f7('0x8a'),_0xc9f7('0x216')+_0x45a0fd));}if(_0x13fa1c<=0x0||isNaN(_0x13fa1c)){return _0x20a0eb(msgResponse(_0xc9f7('0x21c'),_0xc9f7('0x8a'),_0xc9f7('0x21d')+_0x13fa1c));}if(_0x3a079c<=0x0||isNaN(_0x3a079c)){return _0x20a0eb(msgResponse(_0xc9f7('0x21c'),_0xc9f7('0x8a'),_0xc9f7('0x218')+_0x3a079c));}if(_0x14cfcf<=0x0||isNaN(_0x14cfcf)){return _0x20a0eb(msgResponse(_0xc9f7('0x21c'),_0xc9f7('0x8a'),_0xc9f7('0x219')+_0x14cfcf));}if(_0x54bfda<=0x0||isNaN(_0x54bfda)){return _0x20a0eb(msgResponse(_0xc9f7('0x21c'),_0xc9f7('0x8a'),_0xc9f7('0x21e')+_0x54bfda));}_0xcc99dc=_0xcc99dc||0x0;var _0x39f3a7=0x1/_0x13fa1c;var _0xc3d2e4=0x0;var _0x1f267c=0x0;var _0x13365e=0x0;var _0x44effd=0x0;for(var _0x41383b=0x0;_0x44effd<_0x54bfda;_0x41383b+=0x1){_0x1f267c=_0x41383b/_0x14cfcf;_0xc3d2e4=(_0x3a079c*_0x1f267c+_0xcc99dc)/_0x39f3a7;_0x13365e=utils[_0xc9f7('0x21b')](_0xc3d2e4,_0x45a0fd);_0x44effd=_0xc3d2e4/_0x45a0fd*(0x1-utils[_0xc9f7('0x21b')](_0xc3d2e4,_0x45a0fd));}return _0x42e7e9({'erlangCalls':_0x41383b,'erlangCallToSecond':_0x14cfcf/_0x41383b,'erlangAbandonmentRate':_0x13365e,'erlangBusyFactor':_0x44effd});});};module[_0xc9f7('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 22d93b5..ff01698 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe529=['countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','util','lodash','moment','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe529,0xb9));var _0x9e52=function(_0x1e55d9,_0x5ce14a){_0x1e55d9=_0x1e55d9-0x0;var _0x6dc799=_0xe529[_0x1e55d9];return _0x6dc799;};'use strict';var util=require(_0x9e52('0x0'));var _=require(_0x9e52('0x1'));var moment=require(_0x9e52('0x2'));function checkNameSurname(_0x1e5e1f,_0x35f747,_0x4b2c6b){var _0x430a12='';if(!_[_0x9e52('0x3')](_0x35f747)&&'string'===typeof _0x35f747){_0x430a12+=_0x35f747;}if(!_[_0x9e52('0x3')](_0x4b2c6b)&&'string'===typeof _0x4b2c6b){_0x430a12+='\x20'+_0x4b2c6b;}if(_0x430a12!==''){return _0x430a12;}return _0x1e5e1f;}function Action(_0x23dd2d,_0x13de9e,_0x41eb3d){this[_0x9e52('0x4')]=_0x23dd2d;this[_0x9e52('0x5')]=_0x41eb3d||undefined;this[_0x9e52('0x6')]=checkNameSurname(_0x13de9e[_0x9e52('0x7')][_0x9e52('0x8')],_0x13de9e[_0x9e52('0x7')][_0x9e52('0x9')],_0x13de9e['Contact'][_0x9e52('0xa')]);this[_0x9e52('0xb')]=_0x13de9e['phone'];this[_0x9e52('0xc')]=_0x23dd2d['name'];this['active']=_0x13de9e['active']||![];this[_0x9e52('0xd')]=_0x23dd2d['type'];this[_0x9e52('0xe')]=_0x23dd2d[_0x9e52('0xe')]||0x3;this[_0x9e52('0xf')]=_0x13de9e['scheduledat'];this[_0x9e52('0x10')]=_0x13de9e['countbusyretry'];this['countcongestionretry']=_0x13de9e['countcongestionretry'];this[_0x9e52('0x11')]=_0x13de9e['countnoanswerretry'];this[_0x9e52('0x12')]=_0x13de9e[_0x9e52('0x12')];this[_0x9e52('0x13')]=_0x13de9e['countdropretry'];this[_0x9e52('0x14')]=_0x13de9e[_0x9e52('0x14')];this[_0x9e52('0x15')]=_0x13de9e[_0x9e52('0x15')];this['countagentrejectretry']=_0x13de9e['countagentrejectretry'];this['ContactId']=_0x13de9e[_0x9e52('0x16')];this[_0x9e52('0x17')]=_0x13de9e[_0x9e52('0x17')];this[_0x9e52('0x18')]=_0x13de9e[_0x9e52('0x18')];this[_0x9e52('0x19')]=_0x13de9e[_0x9e52('0x19')];this[_0x9e52('0x1a')]=_0x13de9e[_0x9e52('0x1a')];this[_0x9e52('0x1b')]=_0x13de9e['id'];this[_0x9e52('0x1c')]=_0x13de9e[_0x9e52('0x7')][_0x9e52('0x9')]||'';this['starttime']=moment()[_0x9e52('0x1d')](_0x9e52('0x1e'));this[_0x9e52('0x1f')]=_0x13de9e[_0x9e52('0x1f')];this[_0x9e52('0x20')]=_0x13de9e[_0x9e52('0x20')];this[_0x9e52('0x21')]=_0x13de9e['callbackat'];this[_0x9e52('0x22')]=_0x13de9e[_0x9e52('0x22')];this[_0x9e52('0x23')]='';this['originatecalleridname']='';}Action[_0x9e52('0x24')][_0x9e52('0x25')]=function(){return util[_0x9e52('0x1d')](_0x9e52('0x26'),this[_0x9e52('0x6')],this[_0x9e52('0x4')]['dialCutDigit']>0x0?this[_0x9e52('0xb')][_0x9e52('0x27')](this['voiceQueue'][_0x9e52('0x28')]):this[_0x9e52('0xb')]);};Action[_0x9e52('0x24')]['getQueue']=function(){return this[_0x9e52('0xc')];};module['exports']=Action; \ No newline at end of file +var _0x4363=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x4a6936,_0x305c0d){var _0x1e1d3c=function(_0xb5dcf3){while(--_0xb5dcf3){_0x4a6936['push'](_0x4a6936['shift']());}};_0x1e1d3c(++_0x305c0d);}(_0x4363,0x19c));var _0x3436=function(_0x32cfed,_0x278ecd){_0x32cfed=_0x32cfed-0x0;var _0x5735e9=_0x4363[_0x32cfed];return _0x5735e9;};'use strict';var util=require(_0x3436('0x0'));var _=require(_0x3436('0x1'));var moment=require(_0x3436('0x2'));function checkNameSurname(_0x335481,_0x4b0314,_0x451781){var _0xc0371f='';if(!_[_0x3436('0x3')](_0x4b0314)&&_0x3436('0x4')===typeof _0x4b0314){_0xc0371f+=_0x4b0314;}if(!_[_0x3436('0x3')](_0x451781)&&'string'===typeof _0x451781){_0xc0371f+='\x20'+_0x451781;}if(_0xc0371f!==''){return _0xc0371f;}return _0x335481;}function Action(_0x19ef0f,_0x42ad8e,_0x1402b9){this[_0x3436('0x5')]=_0x19ef0f;this[_0x3436('0x6')]=_0x1402b9||undefined;this[_0x3436('0x7')]=checkNameSurname(_0x42ad8e[_0x3436('0x8')][_0x3436('0x9')],_0x42ad8e[_0x3436('0x8')][_0x3436('0xa')],_0x42ad8e[_0x3436('0x8')][_0x3436('0xb')]);this[_0x3436('0xc')]=_0x42ad8e[_0x3436('0x9')];this[_0x3436('0xd')]=_0x19ef0f[_0x3436('0x7')];this[_0x3436('0xe')]=_0x42ad8e[_0x3436('0xe')]||![];this[_0x3436('0xf')]=_0x19ef0f[_0x3436('0xf')];this[_0x3436('0x10')]=_0x19ef0f['dialQueueTimeout']||0x3;this[_0x3436('0x11')]=_0x42ad8e[_0x3436('0x11')];this[_0x3436('0x12')]=_0x42ad8e[_0x3436('0x12')];this[_0x3436('0x13')]=_0x42ad8e[_0x3436('0x13')];this['countnoanswerretry']=_0x42ad8e['countnoanswerretry'];this[_0x3436('0x14')]=_0x42ad8e[_0x3436('0x14')];this['countdropretry']=_0x42ad8e['countdropretry'];this[_0x3436('0x15')]=_0x42ad8e[_0x3436('0x15')];this[_0x3436('0x16')]=_0x42ad8e[_0x3436('0x16')];this['countagentrejectretry']=_0x42ad8e['countagentrejectretry'];this[_0x3436('0x17')]=_0x42ad8e[_0x3436('0x17')];this['ListId']=_0x42ad8e['ListId'];this[_0x3436('0x18')]=_0x42ad8e[_0x3436('0x18')];this[_0x3436('0x19')]=_0x42ad8e['VoiceQueueId'];this[_0x3436('0x1a')]=_0x42ad8e[_0x3436('0x1a')];this[_0x3436('0x1b')]=_0x42ad8e['id'];this['ContactFirstName']=_0x42ad8e[_0x3436('0x8')]['firstName']||'';this[_0x3436('0x1c')]=moment()[_0x3436('0x1d')](_0x3436('0x1e'));this[_0x3436('0x1f')]=_0x42ad8e['callback'];this[_0x3436('0x20')]=_0x42ad8e[_0x3436('0x20')];this[_0x3436('0x21')]=_0x42ad8e[_0x3436('0x21')];this[_0x3436('0x22')]=_0x42ad8e[_0x3436('0x22')];this[_0x3436('0x23')]='';this[_0x3436('0x24')]='';}Action['prototype'][_0x3436('0x25')]=function(){return util[_0x3436('0x1d')](_0x3436('0x26'),this[_0x3436('0x7')],this['voiceQueue'][_0x3436('0x27')]>0x0?this[_0x3436('0xc')][_0x3436('0x28')](this[_0x3436('0x5')]['dialCutDigit']):this['number']);};Action[_0x3436('0x29')][_0x3436('0x2a')]=function(){return this['queue'];};module[_0x3436('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index df42614..c729406 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ff8=['callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','../utils','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','queue','reason','callback'];(function(_0x1a538c,_0x17903d){var _0x340782=function(_0x4d2ff1){while(--_0x4d2ff1){_0x1a538c['push'](_0x1a538c['shift']());}};_0x340782(++_0x17903d);}(_0x5ff8,0x113));var _0x85ff=function(_0x4e8f91,_0x3df863){_0x4e8f91=_0x4e8f91-0x0;var _0x4ac8c2=_0x5ff8[_0x4e8f91];return _0x4ac8c2;};'use strict';var moment=require('moment');var utils=require(_0x85ff('0x0'));function AgentComplete(_0x171ed1,_0x45a176){this['state']=0x4;this[_0x85ff('0x1')]=_0x85ff('0x2');this[_0x85ff('0x3')]=_0x171ed1[_0x85ff('0x3')];this[_0x85ff('0x4')]=_0x171ed1[_0x85ff('0x4')];this['campaigntype']=_0x171ed1['type']===_0x85ff('0x5')?'queue':_0x171ed1[_0x85ff('0x4')];this[_0x85ff('0x6')]=_0x171ed1[_0x85ff('0x6')];this[_0x85ff('0x7')]=_0x171ed1['countcongestionretry'];this['countnoanswerretry']=_0x171ed1[_0x85ff('0x8')];this[_0x85ff('0x9')]=_0x171ed1[_0x85ff('0x6')]+_0x171ed1['countcongestionretry']+_0x171ed1['countnoanswerretry']+_0x171ed1['countnosuchnumberretry']+_0x171ed1['countdropretry']+_0x171ed1[_0x85ff('0xa')]+_0x171ed1[_0x85ff('0xb')]+_0x171ed1['countagentrejectretry'];this[_0x85ff('0xc')]=_0x171ed1[_0x85ff('0xc')];this[_0x85ff('0xd')]=_0x171ed1[_0x85ff('0xd')];this['countabandonedretry']=_0x171ed1[_0x85ff('0xa')];this[_0x85ff('0xb')]=_0x171ed1['countmachineretry'];this['countagentrejectretry']=_0x171ed1[_0x85ff('0xe')];this[_0x85ff('0xf')]=_0x45a176[_0x85ff('0xf')];this[_0x85ff('0x10')]=_0x171ed1['name'];this[_0x85ff('0x11')]=_0x171ed1[_0x85ff('0x12')];this[_0x85ff('0x13')]=_0x171ed1[_0x85ff('0x13')];this[_0x85ff('0x14')]=_0x171ed1['responsetime'];this['answertime']=_0x171ed1[_0x85ff('0x15')];this[_0x85ff('0x16')]=moment()[_0x85ff('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x85ff('0x18')]=utils[_0x85ff('0x19')](_0x171ed1[_0x85ff('0x14')],_0x171ed1[_0x85ff('0x13')]);this['holdtime']=utils[_0x85ff('0x19')](_0x171ed1[_0x85ff('0x15')],_0x171ed1['responsetime']);this['talktime']=utils['getSeconds'](this[_0x85ff('0x16')],_0x171ed1[_0x85ff('0x15')]);this[_0x85ff('0x1a')]=_0x45a176[_0x85ff('0x1a')];this['membername']=_0x45a176['membername'];this['reason']=_0x45a176[_0x85ff('0x1b')];this['callback']=_0x171ed1[_0x85ff('0x1c')];this['callbackuniqueid']=_0x171ed1[_0x85ff('0x1d')];this[_0x85ff('0x1e')]=_0x171ed1['callbackat'];this['recallme']=_0x171ed1[_0x85ff('0x1f')];this[_0x85ff('0x20')]=_0x171ed1[_0x85ff('0x20')];this['ListId']=_0x171ed1['ListId'];this[_0x85ff('0x21')]=_0x171ed1[_0x85ff('0x21')];this['VoiceQueueId']=_0x171ed1['VoiceQueueId'];this['CampaignId']=_0x171ed1[_0x85ff('0x22')];this[_0x85ff('0x23')]=_0x171ed1[_0x85ff('0x23')]||'';this['originatecalleridname']=_0x171ed1[_0x85ff('0x24')]||'';this[_0x85ff('0x25')]=_0x171ed1[_0x85ff('0x25')];}module['exports']=AgentComplete; \ No newline at end of file +var _0xea41=['moment','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports'];(function(_0x4dbc6a,_0x57a63e){var _0x1e3ae1=function(_0x402d07){while(--_0x402d07){_0x4dbc6a['push'](_0x4dbc6a['shift']());}};_0x1e3ae1(++_0x57a63e);}(_0xea41,0x1d9));var _0x1ea4=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xea41[_0x1e7b16];return _0x37fadc;};'use strict';var moment=require(_0x1ea4('0x0'));var utils=require(_0x1ea4('0x1'));function AgentComplete(_0x41295f,_0x3a272c){this[_0x1ea4('0x2')]=0x4;this[_0x1ea4('0x3')]='Answer';this[_0x1ea4('0x4')]=_0x41295f[_0x1ea4('0x4')];this[_0x1ea4('0x5')]=_0x41295f[_0x1ea4('0x5')];this[_0x1ea4('0x6')]=_0x41295f[_0x1ea4('0x5')]===_0x1ea4('0x7')?_0x1ea4('0x8'):_0x41295f[_0x1ea4('0x5')];this[_0x1ea4('0x9')]=_0x41295f[_0x1ea4('0x9')];this['countcongestionretry']=_0x41295f[_0x1ea4('0xa')];this[_0x1ea4('0xb')]=_0x41295f[_0x1ea4('0xb')];this[_0x1ea4('0xc')]=_0x41295f['countbusyretry']+_0x41295f[_0x1ea4('0xa')]+_0x41295f['countnoanswerretry']+_0x41295f[_0x1ea4('0xd')]+_0x41295f[_0x1ea4('0xe')]+_0x41295f[_0x1ea4('0xf')]+_0x41295f[_0x1ea4('0x10')]+_0x41295f[_0x1ea4('0x11')];this[_0x1ea4('0xd')]=_0x41295f[_0x1ea4('0xd')];this[_0x1ea4('0xe')]=_0x41295f[_0x1ea4('0xe')];this['countabandonedretry']=_0x41295f[_0x1ea4('0xf')];this['countmachineretry']=_0x41295f[_0x1ea4('0x10')];this[_0x1ea4('0x11')]=_0x41295f[_0x1ea4('0x11')];this[_0x1ea4('0x12')]=_0x3a272c[_0x1ea4('0x12')];this[_0x1ea4('0x13')]=_0x41295f['name'];this[_0x1ea4('0x14')]=_0x41295f['number'];this[_0x1ea4('0x15')]=_0x41295f[_0x1ea4('0x15')];this[_0x1ea4('0x16')]=_0x41295f[_0x1ea4('0x16')];this[_0x1ea4('0x17')]=_0x41295f['answertime'];this[_0x1ea4('0x18')]=moment()['format'](_0x1ea4('0x19'));this[_0x1ea4('0x1a')]=utils['getSeconds'](_0x41295f['responsetime'],_0x41295f['starttime']);this[_0x1ea4('0x1b')]=utils[_0x1ea4('0x1c')](_0x41295f[_0x1ea4('0x17')],_0x41295f[_0x1ea4('0x16')]);this['talktime']=utils[_0x1ea4('0x1c')](this[_0x1ea4('0x18')],_0x41295f[_0x1ea4('0x17')]);this[_0x1ea4('0x8')]=_0x3a272c[_0x1ea4('0x8')];this[_0x1ea4('0x1d')]=_0x3a272c[_0x1ea4('0x1d')];this[_0x1ea4('0x1e')]=_0x3a272c[_0x1ea4('0x1e')];this[_0x1ea4('0x1f')]=_0x41295f[_0x1ea4('0x1f')];this[_0x1ea4('0x20')]=_0x41295f[_0x1ea4('0x20')];this[_0x1ea4('0x21')]=_0x41295f[_0x1ea4('0x21')];this['recallme']=_0x41295f[_0x1ea4('0x22')];this['ContactId']=_0x41295f[_0x1ea4('0x23')];this[_0x1ea4('0x24')]=_0x41295f[_0x1ea4('0x24')];this['UserId']=_0x41295f['UserId'];this[_0x1ea4('0x25')]=_0x41295f[_0x1ea4('0x25')];this['CampaignId']=_0x41295f[_0x1ea4('0x26')];this[_0x1ea4('0x27')]=_0x41295f[_0x1ea4('0x27')]||'';this[_0x1ea4('0x28')]=_0x41295f[_0x1ea4('0x28')]||'';this[_0x1ea4('0x29')]=_0x41295f[_0x1ea4('0x29')];}module[_0x1ea4('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index c2488a9..58b05bb 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a93=['countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x556cd9,_0x2f12fb){var _0x393325=function(_0x510ddc){while(--_0x510ddc){_0x556cd9['push'](_0x556cd9['shift']());}};_0x393325(++_0x2f12fb);}(_0x3a93,0xe2));var _0x33a9=function(_0x1e87d2,_0x177a91){_0x1e87d2=_0x1e87d2-0x0;var _0x3f6de9=_0x3a93[_0x1e87d2];return _0x3f6de9;};'use strict';function Final(_0x744371){this[_0x33a9('0x0')]=_0x744371[_0x33a9('0x0')];this[_0x33a9('0x1')]=_0x744371[_0x33a9('0x1')];this[_0x33a9('0x2')]=_0x744371[_0x33a9('0x2')];this[_0x33a9('0x3')]=_0x744371[_0x33a9('0x2')]==='outbound'?'queue':_0x744371[_0x33a9('0x2')];this['countbusyretry']=_0x744371[_0x33a9('0x4')];this[_0x33a9('0x5')]=_0x744371['countcongestionretry'];this[_0x33a9('0x6')]=_0x744371[_0x33a9('0x6')];this[_0x33a9('0x7')]=_0x744371[_0x33a9('0x4')]+_0x744371[_0x33a9('0x5')]+_0x744371[_0x33a9('0x6')]+_0x744371[_0x33a9('0x8')]+_0x744371[_0x33a9('0x9')]+_0x744371[_0x33a9('0xa')]+_0x744371[_0x33a9('0xb')]+_0x744371['countagentrejectretry'];this[_0x33a9('0x8')]=_0x744371[_0x33a9('0x8')];this[_0x33a9('0x9')]=_0x744371['countdropretry'];this[_0x33a9('0xa')]=_0x744371[_0x33a9('0xa')];this[_0x33a9('0xb')]=_0x744371['countmachineretry'];this[_0x33a9('0xc')]=_0x744371['countagentrejectretry'];this[_0x33a9('0xd')]=_0x744371[_0x33a9('0xd')];this[_0x33a9('0xe')]=_0x744371[_0x33a9('0xe')];this['calleridnum']=_0x744371[_0x33a9('0xf')];this[_0x33a9('0x10')]=_0x744371[_0x33a9('0x10')];this[_0x33a9('0x11')]=_0x744371[_0x33a9('0x11')];this[_0x33a9('0x12')]=_0x744371[_0x33a9('0x11')];this[_0x33a9('0x13')]=_0x744371['ringtime']||0x0;this['holdtime']=_0x744371[_0x33a9('0x14')]||0x0;this[_0x33a9('0x15')]=_0x744371['talktime']||0x0;this['callback']=_0x744371[_0x33a9('0x16')];this[_0x33a9('0x17')]=_0x744371['callbackuniqueid'];this[_0x33a9('0x18')]=_0x744371[_0x33a9('0x18')];this['recallme']=_0x744371[_0x33a9('0x19')];this[_0x33a9('0x1a')]=_0x744371[_0x33a9('0x1a')];this[_0x33a9('0x1b')]=_0x744371[_0x33a9('0x1b')];this['UserId']=_0x744371[_0x33a9('0x1c')];this['VoiceQueueId']=_0x744371[_0x33a9('0x1d')];this[_0x33a9('0x1e')]=_0x744371[_0x33a9('0x1e')];this['originatecalleridnum']=_0x744371['originatecalleridnum']||'';this[_0x33a9('0x1f')]=_0x744371['originatecalleridname']||'';this[_0x33a9('0x20')]=_0x744371[_0x33a9('0x20')];this[_0x33a9('0x21')]=_0x744371[_0x33a9('0x21')];}module['exports']=Final; \ No newline at end of file +var _0x3b81=['uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0x179e0d,_0x592109){var _0x3f1bc5=function(_0x31a86a){while(--_0x31a86a){_0x179e0d['push'](_0x179e0d['shift']());}};_0x3f1bc5(++_0x592109);}(_0x3b81,0xee));var _0x13b8=function(_0x25c5bf,_0xb5e5de){_0x25c5bf=_0x25c5bf-0x0;var _0x53fe2e=_0x3b81[_0x25c5bf];return _0x53fe2e;};'use strict';function Final(_0x2910d7){this[_0x13b8('0x0')]=_0x2910d7['uniqueid'];this[_0x13b8('0x1')]=_0x2910d7[_0x13b8('0x1')];this[_0x13b8('0x2')]=_0x2910d7[_0x13b8('0x2')];this[_0x13b8('0x3')]=_0x2910d7[_0x13b8('0x2')]==='outbound'?_0x13b8('0x4'):_0x2910d7['type'];this[_0x13b8('0x5')]=_0x2910d7['countbusyretry'];this[_0x13b8('0x6')]=_0x2910d7[_0x13b8('0x6')];this['countnoanswerretry']=_0x2910d7[_0x13b8('0x7')];this[_0x13b8('0x8')]=_0x2910d7[_0x13b8('0x5')]+_0x2910d7[_0x13b8('0x6')]+_0x2910d7[_0x13b8('0x7')]+_0x2910d7[_0x13b8('0x9')]+_0x2910d7[_0x13b8('0xa')]+_0x2910d7['countabandonedretry']+_0x2910d7[_0x13b8('0xb')]+_0x2910d7[_0x13b8('0xc')];this[_0x13b8('0x9')]=_0x2910d7[_0x13b8('0x9')];this[_0x13b8('0xa')]=_0x2910d7[_0x13b8('0xa')];this[_0x13b8('0xd')]=_0x2910d7[_0x13b8('0xd')];this[_0x13b8('0xb')]=_0x2910d7['countmachineretry'];this[_0x13b8('0xc')]=_0x2910d7[_0x13b8('0xc')];this['queue']=_0x2910d7['queue'];this[_0x13b8('0xe')]=_0x2910d7[_0x13b8('0xe')];this['calleridnum']=_0x2910d7['calleridnum'];this[_0x13b8('0xf')]=_0x2910d7[_0x13b8('0xf')];this['responsetime']=_0x2910d7[_0x13b8('0x10')];this[_0x13b8('0x11')]=_0x2910d7[_0x13b8('0x10')];this['ringtime']=_0x2910d7[_0x13b8('0x12')]||0x0;this[_0x13b8('0x13')]=_0x2910d7[_0x13b8('0x13')]||0x0;this[_0x13b8('0x14')]=_0x2910d7[_0x13b8('0x14')]||0x0;this[_0x13b8('0x15')]=_0x2910d7[_0x13b8('0x15')];this[_0x13b8('0x16')]=_0x2910d7[_0x13b8('0x16')];this['callbackat']=_0x2910d7['callbackat'];this[_0x13b8('0x17')]=_0x2910d7['recallme'];this[_0x13b8('0x18')]=_0x2910d7[_0x13b8('0x18')];this[_0x13b8('0x19')]=_0x2910d7['ListId'];this['UserId']=_0x2910d7[_0x13b8('0x1a')];this[_0x13b8('0x1b')]=_0x2910d7['VoiceQueueId'];this[_0x13b8('0x1c')]=_0x2910d7[_0x13b8('0x1c')];this[_0x13b8('0x1d')]=_0x2910d7[_0x13b8('0x1d')]||'';this[_0x13b8('0x1e')]=_0x2910d7[_0x13b8('0x1e')]||'';this[_0x13b8('0x1f')]=_0x2910d7[_0x13b8('0x1f')];this[_0x13b8('0x20')]=_0x2910d7[_0x13b8('0x20')];}module[_0x13b8('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 3d14616..2072e68 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20f1=['countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','../utils','state','Answer','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x5ef81c,_0x3710b7){var _0xf3e42a=function(_0x1f9536){while(--_0x1f9536){_0x5ef81c['push'](_0x5ef81c['shift']());}};_0xf3e42a(++_0x3710b7);}(_0x20f1,0x120));var _0x120f=function(_0x520741,_0x4a7981){_0x520741=_0x520741-0x0;var _0x136761=_0x20f1[_0x520741];return _0x136761;};'use strict';var moment=require('moment');var utils=require(_0x120f('0x0'));function Hangup(_0x4abe87,_0x30a0bd){this[_0x120f('0x1')]=0x4;this['statedesc']=_0x120f('0x2');this[_0x120f('0x3')]=_0x4abe87[_0x120f('0x3')];this[_0x120f('0x4')]=_0x4abe87['type'];this[_0x120f('0x5')]=_0x4abe87[_0x120f('0x4')]===_0x120f('0x6')?'queue':_0x4abe87[_0x120f('0x4')];this[_0x120f('0x7')]=_0x4abe87['amd']||![];this[_0x120f('0x8')]=_0x4abe87['countbusyretry'];this[_0x120f('0x9')]=_0x4abe87[_0x120f('0x9')];this[_0x120f('0xa')]=_0x4abe87['countnoanswerretry'];this['countglobal']=_0x4abe87[_0x120f('0x8')]+_0x4abe87[_0x120f('0x9')]+_0x4abe87['countnoanswerretry']+_0x4abe87[_0x120f('0xb')]+_0x4abe87[_0x120f('0xc')]+_0x4abe87[_0x120f('0xd')]+_0x4abe87[_0x120f('0xe')]+_0x4abe87[_0x120f('0xf')];this['countnosuchnumberretry']=_0x4abe87[_0x120f('0xb')];this[_0x120f('0xc')]=_0x4abe87[_0x120f('0xc')];this[_0x120f('0xd')]=_0x4abe87[_0x120f('0xd')];this['countmachineretry']=_0x4abe87[_0x120f('0xe')];this[_0x120f('0xf')]=_0x4abe87[_0x120f('0xf')];this[_0x120f('0x10')]=_0x30a0bd[_0x120f('0x10')];this[_0x120f('0x11')]=_0x4abe87[_0x120f('0x12')];this['calleridnum']=_0x4abe87[_0x120f('0x13')];this[_0x120f('0x14')]=_0x4abe87[_0x120f('0x14')];this[_0x120f('0x15')]=_0x4abe87['responsetime'];this[_0x120f('0x16')]=moment()[_0x120f('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x120f('0x18')]=utils[_0x120f('0x19')](_0x4abe87[_0x120f('0x15')],_0x4abe87[_0x120f('0x14')]);this[_0x120f('0x1a')]=0x0;this[_0x120f('0x1b')]=utils['getSeconds'](this[_0x120f('0x16')],_0x4abe87[_0x120f('0x15')]);this[_0x120f('0x1c')]=_0x4abe87[_0x120f('0x1c')];this[_0x120f('0x1d')]=_0x120f('0x1e');this[_0x120f('0x1f')]=_0x30a0bd[_0x120f('0x20')];this[_0x120f('0x21')]=_0x4abe87['callback'];this[_0x120f('0x22')]=_0x4abe87[_0x120f('0x22')];this[_0x120f('0x23')]=_0x4abe87[_0x120f('0x23')];this[_0x120f('0x24')]=_0x4abe87[_0x120f('0x24')];this[_0x120f('0x25')]=_0x4abe87[_0x120f('0x25')];this[_0x120f('0x26')]=_0x4abe87[_0x120f('0x26')];this[_0x120f('0x27')]=_0x4abe87[_0x120f('0x27')];this['VoiceQueueId']=_0x4abe87[_0x120f('0x28')];this[_0x120f('0x29')]=_0x4abe87[_0x120f('0x29')];}module[_0x120f('0x2a')]=Hangup; \ No newline at end of file +var _0x6648=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','ringtime','getSeconds','responsetime','talktime','endtime','membername','IVR','reason','cause-txt'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6648,0xe1));var _0x8664=function(_0x24d747,_0x290acd){_0x24d747=_0x24d747-0x0;var _0x433804=_0x6648[_0x24d747];return _0x433804;};'use strict';var moment=require(_0x8664('0x0'));var utils=require(_0x8664('0x1'));function Hangup(_0xde7952,_0x29320e){this[_0x8664('0x2')]=0x4;this[_0x8664('0x3')]=_0x8664('0x4');this[_0x8664('0x5')]=_0xde7952['scheduledat'];this[_0x8664('0x6')]=_0xde7952[_0x8664('0x6')];this[_0x8664('0x7')]=_0xde7952[_0x8664('0x6')]===_0x8664('0x8')?_0x8664('0x9'):_0xde7952[_0x8664('0x6')];this[_0x8664('0xa')]=_0xde7952[_0x8664('0xa')]||![];this[_0x8664('0xb')]=_0xde7952[_0x8664('0xb')];this[_0x8664('0xc')]=_0xde7952[_0x8664('0xc')];this[_0x8664('0xd')]=_0xde7952[_0x8664('0xd')];this['countglobal']=_0xde7952['countbusyretry']+_0xde7952['countcongestionretry']+_0xde7952['countnoanswerretry']+_0xde7952[_0x8664('0xe')]+_0xde7952[_0x8664('0xf')]+_0xde7952[_0x8664('0x10')]+_0xde7952['countmachineretry']+_0xde7952[_0x8664('0x11')];this[_0x8664('0xe')]=_0xde7952[_0x8664('0xe')];this['countdropretry']=_0xde7952['countdropretry'];this['countabandonedretry']=_0xde7952[_0x8664('0x10')];this[_0x8664('0x12')]=_0xde7952[_0x8664('0x12')];this[_0x8664('0x11')]=_0xde7952[_0x8664('0x11')];this[_0x8664('0x13')]=_0x29320e['uniqueid'];this['calleridname']=_0xde7952[_0x8664('0x14')];this[_0x8664('0x15')]=_0xde7952[_0x8664('0x16')];this[_0x8664('0x17')]=_0xde7952[_0x8664('0x17')];this['responsetime']=_0xde7952['responsetime'];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8664('0x18')]=utils[_0x8664('0x19')](_0xde7952[_0x8664('0x1a')],_0xde7952[_0x8664('0x17')]);this['holdtime']=0x0;this[_0x8664('0x1b')]=utils[_0x8664('0x19')](this[_0x8664('0x1c')],_0xde7952[_0x8664('0x1a')]);this['queue']=_0xde7952[_0x8664('0x9')];this[_0x8664('0x1d')]=_0x8664('0x1e');this[_0x8664('0x1f')]=_0x29320e[_0x8664('0x20')];this[_0x8664('0x21')]=_0xde7952['callback'];this['callbackuniqueid']=_0xde7952[_0x8664('0x22')];this[_0x8664('0x23')]=_0xde7952[_0x8664('0x23')];this[_0x8664('0x24')]=_0xde7952[_0x8664('0x24')];this[_0x8664('0x25')]=_0xde7952[_0x8664('0x25')];this[_0x8664('0x26')]=_0xde7952['ListId'];this[_0x8664('0x27')]=_0xde7952[_0x8664('0x27')];this[_0x8664('0x28')]=_0xde7952[_0x8664('0x28')];this[_0x8664('0x29')]=_0xde7952[_0x8664('0x29')];}module[_0x8664('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 0db0203..a28f38a 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa0d=['scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid'];(function(_0x23de3c,_0x51aa07){var _0x2666f9=function(_0x459ead){while(--_0x459ead){_0x23de3c['push'](_0x23de3c['shift']());}};_0x2666f9(++_0x51aa07);}(_0xfa0d,0x64));var _0xdfa0=function(_0x40189f,_0x3c10da){_0x40189f=_0x40189f-0x0;var _0x40e4aa=_0xfa0d[_0x40189f];return _0x40e4aa;};'use strict';var utils=require(_0xdfa0('0x0'));function History(_0x543dd6){this[_0xdfa0('0x1')]=_0x543dd6[_0xdfa0('0x1')];this[_0xdfa0('0x2')]=_0x543dd6['scheduledat']||undefined;this['type']=_0x543dd6['type'];this[_0xdfa0('0x3')]=_0x543dd6[_0xdfa0('0x4')]===_0xdfa0('0x5')?'queue':_0x543dd6[_0xdfa0('0x4')];this[_0xdfa0('0x6')]=_0x543dd6['countbusyretry'];this[_0xdfa0('0x7')]=_0x543dd6[_0xdfa0('0x7')];this[_0xdfa0('0x8')]=_0x543dd6[_0xdfa0('0x8')];this['countglobal']=_0x543dd6[_0xdfa0('0x6')]+_0x543dd6[_0xdfa0('0x7')]+_0x543dd6['countnoanswerretry']+_0x543dd6['countnosuchnumberretry']+_0x543dd6[_0xdfa0('0x9')]+_0x543dd6['countabandonedretry']+_0x543dd6['countmachineretry']+_0x543dd6['countagentrejectretry'];this[_0xdfa0('0xa')]=_0x543dd6[_0xdfa0('0xa')];this[_0xdfa0('0x9')]=_0x543dd6[_0xdfa0('0x9')];this['countabandonedretry']=_0x543dd6[_0xdfa0('0xb')];this[_0xdfa0('0xc')]=_0x543dd6['countmachineretry'];this[_0xdfa0('0xd')]=_0x543dd6[_0xdfa0('0xd')];this[_0xdfa0('0xe')]=_0x543dd6[_0xdfa0('0xe')];this['calleridname']=_0x543dd6[_0xdfa0('0xf')];this[_0xdfa0('0x10')]=_0x543dd6[_0xdfa0('0x11')];this[_0xdfa0('0x12')]=_0x543dd6[_0xdfa0('0x12')];this['responsetime']=_0x543dd6[_0xdfa0('0x13')];this[_0xdfa0('0x14')]=_0x543dd6['responsetime'];this['ringtime']=utils['getSeconds'](_0x543dd6[_0xdfa0('0x13')],_0x543dd6['starttime']);this[_0xdfa0('0x15')]=0x0;this['talktime']=0x0;this[_0xdfa0('0x16')]=_0x543dd6[_0xdfa0('0x16')];this['callbackuniqueid']=_0x543dd6[_0xdfa0('0x17')];this['callbackat']=_0x543dd6['callbackat'];this[_0xdfa0('0x18')]=_0x543dd6[_0xdfa0('0x18')];this[_0xdfa0('0x19')]=_0x543dd6[_0xdfa0('0x19')];this['ListId']=_0x543dd6['ListId'];this['UserId']=_0x543dd6[_0xdfa0('0x1a')];this[_0xdfa0('0x1b')]=_0x543dd6[_0xdfa0('0x1b')];this[_0xdfa0('0x1c')]=_0x543dd6['CampaignId'];this[_0xdfa0('0x1d')]=_0x543dd6[_0xdfa0('0x1d')]||'';this[_0xdfa0('0x1e')]=_0x543dd6[_0xdfa0('0x1e')]||'';this[_0xdfa0('0x1f')]=_0x543dd6[_0xdfa0('0x1f')];this[_0xdfa0('0x20')]=_0x543dd6['statedesc'];}module[_0xdfa0('0x21')]=History; \ No newline at end of file +var _0xdd5a=['responsetime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','calleridname','name','calleridnum','number','starttime'];(function(_0x4b461d,_0x1afb32){var _0x281da5=function(_0x2d0002){while(--_0x2d0002){_0x4b461d['push'](_0x4b461d['shift']());}};_0x281da5(++_0x1afb32);}(_0xdd5a,0x9d));var _0xadd5=function(_0x176ec4,_0x3c5d01){_0x176ec4=_0x176ec4-0x0;var _0x2f8fa8=_0xdd5a[_0x176ec4];return _0x2f8fa8;};'use strict';var utils=require(_0xadd5('0x0'));function History(_0x3dff20){this[_0xadd5('0x1')]=_0x3dff20[_0xadd5('0x1')];this[_0xadd5('0x2')]=_0x3dff20[_0xadd5('0x2')]||undefined;this[_0xadd5('0x3')]=_0x3dff20[_0xadd5('0x3')];this[_0xadd5('0x4')]=_0x3dff20[_0xadd5('0x3')]==='outbound'?_0xadd5('0x5'):_0x3dff20['type'];this[_0xadd5('0x6')]=_0x3dff20[_0xadd5('0x6')];this[_0xadd5('0x7')]=_0x3dff20['countcongestionretry'];this['countnoanswerretry']=_0x3dff20[_0xadd5('0x8')];this['countglobal']=_0x3dff20['countbusyretry']+_0x3dff20[_0xadd5('0x7')]+_0x3dff20['countnoanswerretry']+_0x3dff20[_0xadd5('0x9')]+_0x3dff20[_0xadd5('0xa')]+_0x3dff20[_0xadd5('0xb')]+_0x3dff20[_0xadd5('0xc')]+_0x3dff20['countagentrejectretry'];this[_0xadd5('0x9')]=_0x3dff20[_0xadd5('0x9')];this['countdropretry']=_0x3dff20[_0xadd5('0xa')];this[_0xadd5('0xb')]=_0x3dff20[_0xadd5('0xb')];this[_0xadd5('0xc')]=_0x3dff20[_0xadd5('0xc')];this['countagentrejectretry']=_0x3dff20['countagentrejectretry'];this['queue']=_0x3dff20['queue'];this[_0xadd5('0xd')]=_0x3dff20[_0xadd5('0xe')];this[_0xadd5('0xf')]=_0x3dff20[_0xadd5('0x10')];this['starttime']=_0x3dff20[_0xadd5('0x11')];this[_0xadd5('0x12')]=_0x3dff20[_0xadd5('0x12')];this['endtime']=_0x3dff20[_0xadd5('0x12')];this[_0xadd5('0x13')]=utils[_0xadd5('0x14')](_0x3dff20[_0xadd5('0x12')],_0x3dff20[_0xadd5('0x11')]);this['holdtime']=0x0;this[_0xadd5('0x15')]=0x0;this[_0xadd5('0x16')]=_0x3dff20[_0xadd5('0x16')];this[_0xadd5('0x17')]=_0x3dff20[_0xadd5('0x17')];this['callbackat']=_0x3dff20[_0xadd5('0x18')];this[_0xadd5('0x19')]=_0x3dff20[_0xadd5('0x19')];this[_0xadd5('0x1a')]=_0x3dff20[_0xadd5('0x1a')];this[_0xadd5('0x1b')]=_0x3dff20[_0xadd5('0x1b')];this['UserId']=_0x3dff20[_0xadd5('0x1c')];this['VoiceQueueId']=_0x3dff20[_0xadd5('0x1d')];this[_0xadd5('0x1e')]=_0x3dff20[_0xadd5('0x1e')];this[_0xadd5('0x1f')]=_0x3dff20[_0xadd5('0x1f')]||'';this['originatecalleridname']=_0x3dff20[_0xadd5('0x20')]||'';this['state']=_0x3dff20[_0xadd5('0x21')];this[_0xadd5('0x22')]=_0x3dff20[_0xadd5('0x22')];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index fdd6efa..2e46823 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe1c3=['originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','responsetime','droptime','dropreason','ringtime','getSeconds','starttime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xe1c3,0x116));var _0x3e1c=function(_0x5ebc5c,_0x42da81){_0x5ebc5c=_0x5ebc5c-0x0;var _0x1a0d9f=_0xe1c3[_0x5ebc5c];return _0x1a0d9f;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x47cd3b,_0x1904c2){this[_0x3e1c('0x0')]=_0x47cd3b[_0x3e1c('0x0')];this['type']=_0x47cd3b[_0x3e1c('0x1')];this['campaigntype']=_0x47cd3b[_0x3e1c('0x1')]===_0x3e1c('0x2')?_0x3e1c('0x3'):_0x47cd3b[_0x3e1c('0x1')];this[_0x3e1c('0x4')]=_0x47cd3b[_0x3e1c('0x4')];this[_0x3e1c('0x5')]=_0x47cd3b[_0x3e1c('0x5')];this[_0x3e1c('0x6')]=_0x47cd3b[_0x3e1c('0x6')];this[_0x3e1c('0x7')]=_0x47cd3b[_0x3e1c('0x4')]+_0x47cd3b[_0x3e1c('0x5')]+_0x47cd3b['countnoanswerretry']+_0x47cd3b['countnosuchnumberretry']+_0x47cd3b[_0x3e1c('0x8')]+_0x47cd3b['countabandonedretry']+_0x47cd3b['countmachineretry']+_0x47cd3b[_0x3e1c('0x9')];this['countnosuchnumberretry']=_0x47cd3b['countnosuchnumberretry'];this['countdropretry']=_0x47cd3b['countdropretry'];this['countabandonedretry']=_0x47cd3b[_0x3e1c('0xa')];this[_0x3e1c('0xb')]=_0x47cd3b[_0x3e1c('0xb')];this['countagentrejectretry']=_0x47cd3b['countagentrejectretry'];this[_0x3e1c('0xc')]=_0x1904c2[_0x3e1c('0xc')];this[_0x3e1c('0xd')]=_0x47cd3b[_0x3e1c('0xe')];this[_0x3e1c('0xf')]=_0x47cd3b['number'];this['starttime']=_0x47cd3b['starttime'];this['responsetime']=_0x47cd3b[_0x3e1c('0x10')];this[_0x3e1c('0x11')]=_0x47cd3b[_0x3e1c('0x11')];this[_0x3e1c('0x12')]=_0x47cd3b['dropreason'];this['endtime']=this['droptime'];this[_0x3e1c('0x13')]=utils[_0x3e1c('0x14')](_0x47cd3b[_0x3e1c('0x10')],_0x47cd3b[_0x3e1c('0x15')]);this[_0x3e1c('0x16')]=utils[_0x3e1c('0x14')](this['droptime'],_0x47cd3b['responsetime']);this[_0x3e1c('0x17')]=0x0;this['queue']=_0x1904c2['queue'];this[_0x3e1c('0x18')]=_0x1904c2['connectedlinename'];this[_0x3e1c('0x19')]=_0x1904c2[_0x3e1c('0x19')];this[_0x3e1c('0x1a')]=_0x47cd3b['callback'];this['callbackuniqueid']=_0x47cd3b[_0x3e1c('0x1b')];this[_0x3e1c('0x1c')]=_0x47cd3b['callbackat'];this[_0x3e1c('0x1d')]=_0x47cd3b['recallme'];this[_0x3e1c('0x1e')]=_0x47cd3b[_0x3e1c('0x1e')];this[_0x3e1c('0x1f')]=_0x47cd3b['ListId'];this[_0x3e1c('0x20')]=_0x47cd3b[_0x3e1c('0x20')];this[_0x3e1c('0x21')]=_0x47cd3b[_0x3e1c('0x21')];this['CampaignId']=_0x47cd3b['CampaignId'];this[_0x3e1c('0x22')]=_0x47cd3b[_0x3e1c('0x22')]||'';this[_0x3e1c('0x23')]=_0x47cd3b[_0x3e1c('0x23')]||'';this[_0x3e1c('0x24')]=_0x47cd3b[_0x3e1c('0x24')];this[_0x3e1c('0x25')]=_0x47cd3b[_0x3e1c('0x25')];this[_0x3e1c('0x26')]=_0x47cd3b['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xaa5b=['exports','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xaa5b,0xfd));var _0xbaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5b[_0x14add3];return _0x4a174f;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x2add49,_0x4c4249){this[_0xbaa5('0x0')]=_0x2add49[_0xbaa5('0x0')];this['type']=_0x2add49['type'];this[_0xbaa5('0x1')]=_0x2add49[_0xbaa5('0x2')]===_0xbaa5('0x3')?_0xbaa5('0x4'):_0x2add49[_0xbaa5('0x2')];this['countbusyretry']=_0x2add49[_0xbaa5('0x5')];this['countcongestionretry']=_0x2add49['countcongestionretry'];this[_0xbaa5('0x6')]=_0x2add49[_0xbaa5('0x6')];this['countglobal']=_0x2add49[_0xbaa5('0x5')]+_0x2add49['countcongestionretry']+_0x2add49['countnoanswerretry']+_0x2add49[_0xbaa5('0x7')]+_0x2add49[_0xbaa5('0x8')]+_0x2add49['countabandonedretry']+_0x2add49[_0xbaa5('0x9')]+_0x2add49[_0xbaa5('0xa')];this[_0xbaa5('0x7')]=_0x2add49[_0xbaa5('0x7')];this['countdropretry']=_0x2add49['countdropretry'];this['countabandonedretry']=_0x2add49['countabandonedretry'];this['countmachineretry']=_0x2add49[_0xbaa5('0x9')];this[_0xbaa5('0xa')]=_0x2add49[_0xbaa5('0xa')];this[_0xbaa5('0xb')]=_0x4c4249[_0xbaa5('0xb')];this[_0xbaa5('0xc')]=_0x2add49[_0xbaa5('0xd')];this['calleridnum']=_0x2add49[_0xbaa5('0xe')];this[_0xbaa5('0xf')]=_0x2add49[_0xbaa5('0xf')];this[_0xbaa5('0x10')]=_0x2add49[_0xbaa5('0x10')];this[_0xbaa5('0x11')]=_0x2add49[_0xbaa5('0x11')];this[_0xbaa5('0x12')]=_0x2add49[_0xbaa5('0x12')];this[_0xbaa5('0x13')]=this[_0xbaa5('0x11')];this[_0xbaa5('0x14')]=utils[_0xbaa5('0x15')](_0x2add49['responsetime'],_0x2add49[_0xbaa5('0xf')]);this[_0xbaa5('0x16')]=utils[_0xbaa5('0x15')](this[_0xbaa5('0x11')],_0x2add49[_0xbaa5('0x10')]);this[_0xbaa5('0x17')]=0x0;this[_0xbaa5('0x4')]=_0x4c4249[_0xbaa5('0x4')];this[_0xbaa5('0x18')]=_0x4c4249[_0xbaa5('0x19')];this[_0xbaa5('0x1a')]=_0x4c4249['reason'];this[_0xbaa5('0x1b')]=_0x2add49['callback'];this[_0xbaa5('0x1c')]=_0x2add49[_0xbaa5('0x1c')];this[_0xbaa5('0x1d')]=_0x2add49[_0xbaa5('0x1d')];this[_0xbaa5('0x1e')]=_0x2add49[_0xbaa5('0x1e')];this[_0xbaa5('0x1f')]=_0x2add49['ContactId'];this[_0xbaa5('0x20')]=_0x2add49[_0xbaa5('0x20')];this[_0xbaa5('0x21')]=_0x2add49[_0xbaa5('0x21')];this[_0xbaa5('0x22')]=_0x2add49[_0xbaa5('0x22')];this[_0xbaa5('0x23')]=_0x2add49[_0xbaa5('0x23')];this[_0xbaa5('0x24')]=_0x2add49[_0xbaa5('0x24')]||'';this[_0xbaa5('0x25')]=_0x2add49[_0xbaa5('0x25')]||'';this['agiafterat']=_0x2add49[_0xbaa5('0x26')];this[_0xbaa5('0x27')]=_0x2add49['state'];this[_0xbaa5('0x28')]=_0x2add49[_0xbaa5('0x28')];}module[_0xbaa5('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 76c8ccf..49ea10b 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ca9=['../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper'];(function(_0x583d6b,_0x509fdf){var _0x14d631=function(_0x774c56){while(--_0x774c56){_0x583d6b['push'](_0x583d6b['shift']());}};_0x14d631(++_0x509fdf);}(_0x8ca9,0x9c));var _0x98ca=function(_0x5cfbb4,_0x527795){_0x5cfbb4=_0x5cfbb4-0x0;var _0x3f6c32=_0x8ca9[_0x5cfbb4];return _0x3f6c32;};'use strict';var util=require(_0x98ca('0x0'));var logger=require(_0x98ca('0x1'))(_0x98ca('0x2'));var cmHopper=require(_0x98ca('0x3'));var cmHopperAdditionalPhone=require(_0x98ca('0x4'));var cmHopperBlack=require(_0x98ca('0x5'));var cmHopperHistory=require(_0x98ca('0x6'));function inspectError(_0x4af83a){return util['inspect'](_0x4af83a,{'showHidden':![],'depth':null});}function getContactDialer(_0x142793,_0x5671b9,_0x442519){return cmHopper['getContactDialer'](_0x142793['id'],_0x5671b9,_0x442519,_0x142793[_0x98ca('0x7')])[_0x98ca('0x8')](function(_0x18c349){_0x142793[_0x98ca('0x9')]=0x0;logger[_0x98ca('0xa')](_0x98ca('0xb'),inspectError(_0x18c349));});}exports[_0x98ca('0xc')]=getContactDialer;function getContactDialerIvr(_0x210234,_0x277c29){return cmHopper[_0x98ca('0xd')](_0x210234['id'],_0x277c29,_0x210234[_0x98ca('0x7')])[_0x98ca('0x8')](function(_0x25b06a){_0x210234[_0x98ca('0x9')]=0x0;logger[_0x98ca('0xa')](_0x98ca('0xe'),inspectError(_0x25b06a));});}exports[_0x98ca('0xd')]=getContactDialerIvr;function countReScheduled(_0x17ee87){return cmHopper['countReScheduled'](_0x17ee87)[_0x98ca('0x8')](function(_0x44b65b){logger[_0x98ca('0xa')](_0x98ca('0xf'),inspectError(_0x44b65b));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xf78589){return cmHopper[_0x98ca('0x10')](_0xf78589)[_0x98ca('0x8')](function(_0xa2bab4){logger[_0x98ca('0xa')](_0x98ca('0x11'),inspectError(_0xa2bab4));});}exports[_0x98ca('0x10')]=rescheduleContact;function unlockContact(_0x4940ca,_0x330713,_0x29df1b){return cmHopper[_0x98ca('0x12')](_0x4940ca,_0x330713,_0x29df1b)[_0x98ca('0x8')](function(_0x52e9c8){logger[_0x98ca('0xa')](_0x98ca('0x13'),inspectError(_0x52e9c8));});}exports[_0x98ca('0x12')]=unlockContact;function moveContactManagedDialer(_0x1ce43a){return cmHopper[_0x98ca('0x14')](_0x1ce43a)[_0x98ca('0x8')](function(_0x28c8a6){logger[_0x98ca('0xa')](_0x98ca('0x15'),inspectError(_0x28c8a6));});}exports[_0x98ca('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x1b2c69){return cmHopperBlack['checkIsBlackList'](_0x1b2c69)[_0x98ca('0x8')](function(_0x49298d){logger[_0x98ca('0xa')](_0x98ca('0x16'),inspectError(_0x49298d));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x5ca905){return cmHopperBlack[_0x98ca('0x17')](_0x5ca905)[_0x98ca('0x8')](function(_0x130544){logger['error'](_0x98ca('0x18'),inspectError(_0x130544));});}exports[_0x98ca('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x56f799,_0x6651c8,_0x5dc400){return cmHopperAdditionalPhone[_0x98ca('0x19')](_0x56f799,_0x6651c8,_0x5dc400)[_0x98ca('0x8')](function(_0x430d16){logger[_0x98ca('0xa')](_0x98ca('0x1a'),inspectError(_0x430d16));});}exports[_0x98ca('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x2a59e3,_0x50b1a2,_0x2029cb){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2a59e3,_0x50b1a2,_0x2029cb)[_0x98ca('0x8')](function(_0x1bdb75){logger['error'](_0x98ca('0x1b'),inspectError(_0x1bdb75));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x214649){return cmHopperHistory['avgHandleTime'](_0x214649)['catch'](function(_0x14bfb4){logger['error'](_0x98ca('0x1c'),inspectError(_0x14bfb4));});}exports[_0x98ca('0x1d')]=avgHandleTime;function createHistory(_0x13f766){return cmHopperHistory[_0x98ca('0x1e')](_0x13f766)[_0x98ca('0x8')](function(_0x1e7fcf){logger[_0x98ca('0xa')](_0x98ca('0x1f'),inspectError(_0x1e7fcf));});}exports[_0x98ca('0x1e')]=createHistory; \ No newline at end of file +var _0xda19=['getContactDialerIvr','[countReScheduled]','countReScheduled','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialerIvr]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x26e529,_0x5dcae1){_0x26e529=_0x26e529-0x0;var _0x419f69=_0xda19[_0x26e529];return _0x419f69;};'use strict';var util=require('util');var logger=require(_0x9da1('0x0'))(_0x9da1('0x1'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x9da1('0x2'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x9da1('0x3'));function inspectError(_0x4c9c86){return util[_0x9da1('0x4')](_0x4c9c86,{'showHidden':![],'depth':null});}function getContactDialer(_0xef6f5a,_0x3c5f54,_0x470043){return cmHopper[_0x9da1('0x5')](_0xef6f5a['id'],_0x3c5f54,_0x470043,_0xef6f5a[_0x9da1('0x6')])[_0x9da1('0x7')](function(_0x2c3cdd){_0xef6f5a[_0x9da1('0x8')]=0x0;logger[_0x9da1('0x9')]('[getContactDialer]',inspectError(_0x2c3cdd));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x4cb9f7,_0x417312){return cmHopper['getContactDialerIvr'](_0x4cb9f7['id'],_0x417312,_0x4cb9f7[_0x9da1('0x6')])[_0x9da1('0x7')](function(_0x3ba3d3){_0x4cb9f7[_0x9da1('0x8')]=0x0;logger[_0x9da1('0x9')](_0x9da1('0xa'),inspectError(_0x3ba3d3));});}exports[_0x9da1('0xb')]=getContactDialerIvr;function countReScheduled(_0x5807ec){return cmHopper['countReScheduled'](_0x5807ec)[_0x9da1('0x7')](function(_0x596b6b){logger[_0x9da1('0x9')](_0x9da1('0xc'),inspectError(_0x596b6b));});}exports[_0x9da1('0xd')]=countReScheduled;function rescheduleContact(_0x1ffa2a){return cmHopper['rescheduleContact'](_0x1ffa2a)[_0x9da1('0x7')](function(_0x535a13){logger['error'](_0x9da1('0xe'),inspectError(_0x535a13));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x433ff4,_0x43c093,_0x37653d){return cmHopper[_0x9da1('0xf')](_0x433ff4,_0x43c093,_0x37653d)[_0x9da1('0x7')](function(_0x514d8e){logger[_0x9da1('0x9')](_0x9da1('0x10'),inspectError(_0x514d8e));});}exports[_0x9da1('0xf')]=unlockContact;function moveContactManagedDialer(_0x77347a){return cmHopper[_0x9da1('0x11')](_0x77347a)[_0x9da1('0x7')](function(_0x497676){logger['error'](_0x9da1('0x12'),inspectError(_0x497676));});}exports[_0x9da1('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1b0e7f){return cmHopperBlack[_0x9da1('0x13')](_0x1b0e7f)[_0x9da1('0x7')](function(_0x3b1645){logger[_0x9da1('0x9')]('[checkIsBlackList]',inspectError(_0x3b1645));});}exports[_0x9da1('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x554845){return cmHopperBlack[_0x9da1('0x14')](_0x554845)[_0x9da1('0x7')](function(_0x1fc065){logger['error']('[checkIsBlackListIvr]',inspectError(_0x1fc065));});}exports[_0x9da1('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x3e6f85,_0x16ee0c,_0x330219){return cmHopperAdditionalPhone[_0x9da1('0x15')](_0x3e6f85,_0x16ee0c,_0x330219)[_0x9da1('0x7')](function(_0x4c60aa){logger[_0x9da1('0x9')](_0x9da1('0x16'),inspectError(_0x4c60aa));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x45fcce,_0x3f5680,_0x534210){return cmHopperAdditionalPhone[_0x9da1('0x17')](_0x45fcce,_0x3f5680,_0x534210)[_0x9da1('0x7')](function(_0x4b1152){logger[_0x9da1('0x9')](_0x9da1('0x18'),inspectError(_0x4b1152));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x5c09ed){return cmHopperHistory[_0x9da1('0x19')](_0x5c09ed)[_0x9da1('0x7')](function(_0x5eca5b){logger[_0x9da1('0x9')]('[avgHandleTime]',inspectError(_0x5eca5b));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x5a59c2){return cmHopperHistory[_0x9da1('0x1a')](_0x5a59c2)[_0x9da1('0x7')](function(_0x24c6d5){logger[_0x9da1('0x9')](_0x9da1('0x1b'),inspectError(_0x24c6d5));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 7a25d78..7fdb376 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x99e2=['Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','toString','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','description','tags','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','lodash','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x99e2,0x180));var _0x299e=function(_0x525bfb,_0x28ab29){_0x525bfb=_0x525bfb-0x0;var _0x735ef9=_0x99e2[_0x525bfb];return _0x735ef9;};'use strict';var _=require(_0x299e('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0x299e('0x1'))(_0x299e('0x2'));var timezones=require('../../../../config/environment/shared')[_0x299e('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x299e('0x4'),'BLACKLIST':_0x299e('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x299e('0x6'),'DISACTIVED':_0x299e('0x7'),'EMPTY_INTERVAL':_0x299e('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0x299e('0x9'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x299e('0xa'),'OVERTIME_INTERVAL':_0x299e('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0x299e('0xc'),'QUEUE_RECALL':_0x299e('0xd'),'RECALL_TIMEOUT':_0x299e('0xe'),'RUNNING':_0x299e('0xf'),'UNKNOWN_TIMEZONE':_0x299e('0x10'),'UNREACHABLE_TRUNK':_0x299e('0x11')};exports[_0x299e('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1261fe){return _0x1261fe['dialMethod']===_0x299e('0x13');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x5ea926){return _0x5ea926[_0x299e('0x14')]===_0x299e('0x15');}exports[_0x299e('0x16')]=isIVRCampaign;function isOutboundQueue(_0x5270cb){return _0x5270cb[_0x299e('0x14')]===_0x299e('0x17');}exports[_0x299e('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0xe2b311){return _0xe2b311[_0x299e('0x19')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x5a2f98){return _0x5a2f98['active'];}exports[_0x299e('0x1a')]=isIVRCampaignActive;function getSeconds(_0x3e2561,_0x16be59){var _0x2b300d=moment(_0x3e2561)[_0x299e('0x1b')](0x0);var _0x26cb0e=moment(_0x16be59)[_0x299e('0x1b')](0x0);return _0x2b300d[_0x299e('0x1c')](_0x26cb0e,_0x299e('0x1d'));}exports[_0x299e('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x12d5ad,_0x9ed8d0){var _0x1fee2c=![];var _0x1763cf=_0x12d5ad['dialMethod']!==_0x9ed8d0[_0x299e('0x1f')]||_0x12d5ad[_0x299e('0x19')]!==_0x9ed8d0[_0x299e('0x19')]||_0x12d5ad[_0x299e('0x20')]!==_0x9ed8d0['message'];var _0x3a00fa=_0x12d5ad['available']!==_0x9ed8d0['available']||_0x12d5ad[_0x299e('0x21')]!==_0x9ed8d0[_0x299e('0x21')]||_0x12d5ad[_0x299e('0x22')]!==_0x9ed8d0[_0x299e('0x22')]||_0x12d5ad['paused']!==_0x9ed8d0[_0x299e('0x23')]||_0x12d5ad['talking']!==_0x9ed8d0[_0x299e('0x24')]||_0x12d5ad['pTalking']!==_0x9ed8d0[_0x299e('0x25')]||_0x12d5ad['waiting']!==_0x9ed8d0[_0x299e('0x26')]||_0x12d5ad[_0x299e('0x27')]!==_0x9ed8d0[_0x299e('0x27')]||_0x12d5ad[_0x299e('0x28')]!==_0x9ed8d0[_0x299e('0x28')];if(_0x12d5ad[_0x299e('0x29')]&&_0x9ed8d0[_0x299e('0x29')]){_0x1fee2c=_0x12d5ad[_0x299e('0x29')][_0x299e('0x2a')]!==_0x9ed8d0[_0x299e('0x29')][_0x299e('0x2a')]||_0x12d5ad[_0x299e('0x29')]['active']!==_0x9ed8d0[_0x299e('0x29')][_0x299e('0x2b')];}return _0x1763cf||_0x3a00fa||_0x1fee2c;}exports[_0x299e('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1528bd){var _0x48fc06=null;var _0x5bf1e3=_0x1528bd[_0x299e('0x2d')];if(_[_0x299e('0x2e')](_0x1528bd['dialGlobalInterval'])||_[_0x299e('0x2e')](_0x1528bd['Interval'])||_[_0x299e('0x2e')](_0x1528bd[_0x299e('0x2f')]['Intervals'])){_0x48fc06=CAMPAIGN_STATUS[_0x299e('0x30')];}else if(_[_0x299e('0x31')](_0x1528bd['dialGlobalInterval'])||_[_0x299e('0x31')](_0x1528bd['Interval']['Intervals'])){_0x48fc06=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x5bf1e3&&!timezones[_0x5bf1e3]){_0x48fc06=CAMPAIGN_STATUS[_0x299e('0x32')];}return _0x48fc06;}function checkAnyValidTrunk(_0x38036c,_0x59aa2b){var _0x4aac5d=null;var _0x552d2a=_0x299e('0x33');var _0x385745=['reachable',_0x299e('0x34')];var _0x3abbcf=!![];if(_0x38036c[_0x299e('0x29')]&&_0x38036c[_0x299e('0x29')][_0x299e('0x2b')]){_0x552d2a+=_0x38036c['Trunk']['name'];_0x4aac5d=_0x59aa2b[_0x552d2a];_0x3abbcf=_0x385745[_0x299e('0x35')](_0x4aac5d[_0x299e('0x36')]);}else if(_0x38036c[_0x299e('0x37')]&&_0x38036c[_0x299e('0x37')][_0x299e('0x2b')]){_0x552d2a+=_0x38036c[_0x299e('0x37')][_0x299e('0x2a')];_0x4aac5d=_0x59aa2b[_0x552d2a];_0x3abbcf=_0x385745['includes'](_0x4aac5d[_0x299e('0x36')]);}return _0x3abbcf;}function getQueueCampaignStatusMessage(_0x5b1825,_0x2933a7){var _0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x4')];var _0x5a1c71=isPreviewCampaign(_0x5b1825);if(!isQueueCampaignActive(_0x5b1825)){if(_0x5a1c71){_0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x38')];}else{if(_0x5b1825['originated']===0x0&&_0x5b1825[_0x299e('0x24')]===0x0&&_0x5b1825[_0x299e('0x26')]===0x0&&(_0x5b1825[_0x299e('0x25')]||0x0)===0x0){_0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x38')];}else{_0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x39')];}}}else if(_0x5b1825[_0x299e('0x21')]===0x0){_0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x3a')];}else if(!checkAnyValidTrunk(_0x5b1825,_0x2933a7)){_0x4bf5a9=CAMPAIGN_STATUS[_0x299e('0x3b')];}else if(!isPreviewCampaign(_0x5b1825)){var _0x1e5c73=checkAnyValidQueueCampaignInterval(_0x5b1825);if(_0x1e5c73){_0x4bf5a9=_0x1e5c73;}}return _0x4bf5a9;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x9bc06c){var _0x3aa6f4=CAMPAIGN_STATUS[_0x299e('0x39')];if(_0x9bc06c[_0x299e('0x28')]===0x0&&_0x9bc06c[_0x299e('0x24')]===0x0&&_0x9bc06c['waiting']===0x0&&(_0x9bc06c[_0x299e('0x25')]||0x0)===0x0){_0x3aa6f4=CAMPAIGN_STATUS[_0x299e('0x38')];}return _0x3aa6f4;}exports[_0x299e('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4b9528){var _0x55d1cc=_0x4b9528[_0x299e('0x3d')](/"(.*?)"/);return _0x55d1cc?_0x55d1cc[0x1]:_0x4b9528;}exports[_0x299e('0x3e')]=extractCalleridName;function getCallerId(_0x147795,_0x17b9bb,_0x50c95e){if(!_['isUndefined'](_0x50c95e)&&typeof _0x50c95e===_0x299e('0x3f')&&!_[_0x299e('0x31')](_0x50c95e)){if(!_[_0x299e('0x40')](_0x17b9bb)&&typeof _0x17b9bb===_0x299e('0x3f')&&!_[_0x299e('0x31')](_0x17b9bb)){return util[_0x299e('0x41')](_0x299e('0x42'),_0x17b9bb,_0x50c95e);}return util[_0x299e('0x41')](_0x299e('0x42'),_0x50c95e,_0x50c95e);}if(!_[_0x299e('0x40')](_0x147795)&&typeof _0x147795===_0x299e('0x3f')&&!_[_0x299e('0x31')](_0x147795)){return _0x147795;}return _0x299e('0x43');}exports[_0x299e('0x44')]=getCallerId;function getCallerIdRandom(_0x417005,_0x281df9){var _0x214337;var _0x5648e2;var _0x4b5e68;if(_0x281df9<=0x0){_0x281df9=0x1;}_0x214337=new RegExp(_0x299e('0x45')+_0x281df9+'}$');_0x5648e2=Math[_0x299e('0x46')](0xa,_0x281df9-0x1);_0x4b5e68=Math['pow'](0xa,_0x281df9)-0x1;return util['format']('%s',_[_0x299e('0x47')](_0x417005,_0x214337,_['random'](_0x5648e2,_0x4b5e68)[_0x299e('0x48')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x4aeb53){if(_0x4aeb53[_0x299e('0x28')]&&_0x4aeb53['originated']>0x0){_0x4aeb53[_0x299e('0x28')]-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x299e('0x49')]=decrementOriginate;function checkContactEmpty(_0x5bf5db){return _0x5bf5db&&_0x5bf5db[_0x299e('0x4a')]>0x0;}exports[_0x299e('0x4b')]=checkContactEmpty;function erlangb(_0x487d3d,_0x3c59bb){if(_0x3c59bb===0x0){return 0x0;}var _0xae3db7=0x1;for(var _0x8518d0=0x1;_0x8518d0<=_0x3c59bb;_0x8518d0+=0x1){_0xae3db7=0x1+_0xae3db7*_0x8518d0/_0x487d3d;}return 0x1/_0xae3db7;}exports[_0x299e('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x2449ee,_0x2ebcde,_0x3651f4){if(_0x2ebcde>_0x3651f4){for(var _0x46f087=0x0;_0x46f087<_0x2ebcde-_0x3651f4;_0x46f087+=0x1){decrementOriginate(_0x2449ee);}}}exports[_0x299e('0x4d')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xd9e557){var _0x14cd9c={};var _0x2f9fef=['id','createdAt',_0x299e('0x4e'),_0x299e('0x4f'),_0x299e('0x50')];if(_0xd9e557){for(var _0x7dbc39 in _0xd9e557){if(typeof _0xd9e557[_0x7dbc39]!==_0x299e('0x51')){if(!_['isNil'](_0xd9e557[_0x7dbc39])&&!_0x2f9fef[_0x299e('0x35')](_0x7dbc39)){_0x14cd9c[util[_0x299e('0x41')](_0x299e('0x52'),_0x299e('0x53'),_0x7dbc39['toUpperCase']())]=_0xd9e557[_0x7dbc39];}}}}return _0x14cd9c;}exports[_0x299e('0x54')]=setXMDContactVariables; \ No newline at end of file +var _0xfb3f=['isUndefined','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','format','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','createdAt','description','tags','undefined','%s%s','XMD-','toUpperCase','lodash','moment','util','../../../../config/environment/shared','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','name','Trunk','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','string'];(function(_0x41b792,_0x10480a){var _0x17894e=function(_0x548ab6){while(--_0x548ab6){_0x41b792['push'](_0x41b792['shift']());}};_0x17894e(++_0x10480a);}(_0xfb3f,0x1c9));var _0xffb3=function(_0x7dd8d3,_0x12e9d5){_0x7dd8d3=_0x7dd8d3-0x0;var _0x33c7e3=_0xfb3f[_0x7dd8d3];return _0x33c7e3;};'use strict';var _=require(_0xffb3('0x0'));var moment=require(_0xffb3('0x1'));var util=require(_0xffb3('0x2'));var logger=require('../../../../config/logger')('dialer');var timezones=require(_0xffb3('0x3'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0xffb3('0x4'),'BLACKLIST':_0xffb3('0x5'),'CONTACTS_RESCHEDULED':_0xffb3('0x6'),'DEACTIVATED':_0xffb3('0x7'),'DISACTIVED':_0xffb3('0x8'),'EMPTY_INTERVAL':_0xffb3('0x9'),'INACTIVE':_0xffb3('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xffb3('0xb'),'NULL_INTERVAL':_0xffb3('0xc'),'OVERTIME_INTERVAL':_0xffb3('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xffb3('0xe'),'QUEUE_RECALL':_0xffb3('0xf'),'RECALL_TIMEOUT':_0xffb3('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xffb3('0x11')};exports[_0xffb3('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x38a7fc){return _0x38a7fc[_0xffb3('0x13')]===_0xffb3('0x14');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x9b0032){return _0x9b0032[_0xffb3('0x15')]===_0xffb3('0x16');}exports[_0xffb3('0x17')]=isIVRCampaign;function isOutboundQueue(_0x42bfc5){return _0x42bfc5[_0xffb3('0x15')]==='outbound';}exports[_0xffb3('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x5122e3){return _0x5122e3[_0xffb3('0x19')];}exports[_0xffb3('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x43e4b4){return _0x43e4b4[_0xffb3('0x1b')];}exports[_0xffb3('0x1c')]=isIVRCampaignActive;function getSeconds(_0x259fb4,_0x2d2042){var _0x5005d9=moment(_0x259fb4)[_0xffb3('0x1d')](0x0);var _0x56fb08=moment(_0x2d2042)['milliseconds'](0x0);return _0x5005d9['diff'](_0x56fb08,_0xffb3('0x1e'));}exports[_0xffb3('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x2ca8db,_0x3d0a69){var _0x33eed1=![];var _0x296918=_0x2ca8db[_0xffb3('0x13')]!==_0x3d0a69['dialMethod']||_0x2ca8db['dialActive']!==_0x3d0a69[_0xffb3('0x19')]||_0x2ca8db[_0xffb3('0x20')]!==_0x3d0a69[_0xffb3('0x20')];var _0x2358c4=_0x2ca8db['available']!==_0x3d0a69[_0xffb3('0x21')]||_0x2ca8db[_0xffb3('0x22')]!==_0x3d0a69[_0xffb3('0x22')]||_0x2ca8db[_0xffb3('0x23')]!==_0x3d0a69[_0xffb3('0x23')]||_0x2ca8db[_0xffb3('0x24')]!==_0x3d0a69[_0xffb3('0x24')]||_0x2ca8db[_0xffb3('0x25')]!==_0x3d0a69[_0xffb3('0x25')]||_0x2ca8db[_0xffb3('0x26')]!==_0x3d0a69[_0xffb3('0x26')]||_0x2ca8db[_0xffb3('0x27')]!==_0x3d0a69['waiting']||_0x2ca8db[_0xffb3('0x28')]!==_0x3d0a69[_0xffb3('0x28')]||_0x2ca8db[_0xffb3('0x29')]!==_0x3d0a69['originated'];if(_0x2ca8db['Trunk']&&_0x3d0a69['Trunk']){_0x33eed1=_0x2ca8db['Trunk'][_0xffb3('0x2a')]!==_0x3d0a69['Trunk']['name']||_0x2ca8db[_0xffb3('0x2b')][_0xffb3('0x1b')]!==_0x3d0a69[_0xffb3('0x2b')][_0xffb3('0x1b')];}return _0x296918||_0x2358c4||_0x33eed1;}exports[_0xffb3('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x22d428){var _0x1a038d=null;var _0x334c0e=_0x22d428[_0xffb3('0x2d')];if(_[_0xffb3('0x2e')](_0x22d428[_0xffb3('0x2f')])||_[_0xffb3('0x2e')](_0x22d428[_0xffb3('0x30')])||_['isNil'](_0x22d428[_0xffb3('0x30')][_0xffb3('0x31')])){_0x1a038d=CAMPAIGN_STATUS[_0xffb3('0x32')];}else if(_['isEmpty'](_0x22d428[_0xffb3('0x2f')])||_[_0xffb3('0x33')](_0x22d428['Interval']['Intervals'])){_0x1a038d=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x334c0e&&!timezones[_0x334c0e]){_0x1a038d=CAMPAIGN_STATUS[_0xffb3('0x34')];}return _0x1a038d;}function checkAnyValidTrunk(_0x529581,_0x2875fe){var _0x3f6ca7=null;var _0x1eb649=_0xffb3('0x35');var _0x2c47d1=[_0xffb3('0x36'),_0xffb3('0x37')];var _0x5c8e21=!![];if(_0x529581['Trunk']&&_0x529581[_0xffb3('0x2b')][_0xffb3('0x1b')]){_0x1eb649+=_0x529581[_0xffb3('0x2b')][_0xffb3('0x2a')];_0x3f6ca7=_0x2875fe[_0x1eb649];_0x5c8e21=_0x2c47d1[_0xffb3('0x38')](_0x3f6ca7[_0xffb3('0x39')]);}else if(_0x529581[_0xffb3('0x3a')]&&_0x529581[_0xffb3('0x3a')][_0xffb3('0x1b')]){_0x1eb649+=_0x529581[_0xffb3('0x3a')][_0xffb3('0x2a')];_0x3f6ca7=_0x2875fe[_0x1eb649];_0x5c8e21=_0x2c47d1[_0xffb3('0x38')](_0x3f6ca7[_0xffb3('0x39')]);}return _0x5c8e21;}function getQueueCampaignStatusMessage(_0xfb6d99,_0xcdf90c){var _0x40483b=CAMPAIGN_STATUS['ACTIVE'];var _0x59b70f=isPreviewCampaign(_0xfb6d99);if(!isQueueCampaignActive(_0xfb6d99)){if(_0x59b70f){_0x40483b=CAMPAIGN_STATUS[_0xffb3('0x3b')];}else{if(_0xfb6d99['originated']===0x0&&_0xfb6d99[_0xffb3('0x25')]===0x0&&_0xfb6d99[_0xffb3('0x27')]===0x0&&(_0xfb6d99['pTalking']||0x0)===0x0){_0x40483b=CAMPAIGN_STATUS[_0xffb3('0x3b')];}else{_0x40483b=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0xfb6d99['loggedIn']===0x0){_0x40483b=CAMPAIGN_STATUS[_0xffb3('0x3c')];}else if(!checkAnyValidTrunk(_0xfb6d99,_0xcdf90c)){_0x40483b=CAMPAIGN_STATUS[_0xffb3('0x3d')];}else if(!isPreviewCampaign(_0xfb6d99)){var _0x4b2d55=checkAnyValidQueueCampaignInterval(_0xfb6d99);if(_0x4b2d55){_0x40483b=_0x4b2d55;}}return _0x40483b;}exports[_0xffb3('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x505f50){var _0x420418=CAMPAIGN_STATUS[_0xffb3('0x3f')];if(_0x505f50[_0xffb3('0x29')]===0x0&&_0x505f50[_0xffb3('0x25')]===0x0&&_0x505f50[_0xffb3('0x27')]===0x0&&(_0x505f50[_0xffb3('0x26')]||0x0)===0x0){_0x420418=CAMPAIGN_STATUS[_0xffb3('0x3b')];}return _0x420418;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x13681f){var _0x2cafca=_0x13681f['match'](/"(.*?)"/);return _0x2cafca?_0x2cafca[0x1]:_0x13681f;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x58b753,_0x4c9e8b,_0x3a2599){if(!_['isUndefined'](_0x3a2599)&&typeof _0x3a2599===_0xffb3('0x40')&&!_['isEmpty'](_0x3a2599)){if(!_[_0xffb3('0x41')](_0x4c9e8b)&&typeof _0x4c9e8b==='string'&&!_[_0xffb3('0x33')](_0x4c9e8b)){return util['format'](_0xffb3('0x42'),_0x4c9e8b,_0x3a2599);}return util['format'](_0xffb3('0x42'),_0x3a2599,_0x3a2599);}if(!_[_0xffb3('0x41')](_0x58b753)&&typeof _0x58b753===_0xffb3('0x40')&&!_[_0xffb3('0x33')](_0x58b753)){return _0x58b753;}return _0xffb3('0x43');}exports[_0xffb3('0x44')]=getCallerId;function getCallerIdRandom(_0x1d589f,_0x12504c){var _0xf438df;var _0x2fa62e;var _0x432fbe;if(_0x12504c<=0x0){_0x12504c=0x1;}_0xf438df=new RegExp(_0xffb3('0x45')+_0x12504c+'}$');_0x2fa62e=Math[_0xffb3('0x46')](0xa,_0x12504c-0x1);_0x432fbe=Math['pow'](0xa,_0x12504c)-0x1;return util[_0xffb3('0x47')]('%s',_[_0xffb3('0x48')](_0x1d589f,_0xf438df,_[_0xffb3('0x49')](_0x2fa62e,_0x432fbe)[_0xffb3('0x4a')]()));}exports[_0xffb3('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x473c65){if(_0x473c65[_0xffb3('0x29')]&&_0x473c65['originated']>0x0){_0x473c65['originated']-=0x1;}else{logger[_0xffb3('0x4c')](_0xffb3('0x4d'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x1de095){return _0x1de095&&_0x1de095[_0xffb3('0x4e')]>0x0;}exports[_0xffb3('0x4f')]=checkContactEmpty;function erlangb(_0x1a3335,_0x79693d){if(_0x79693d===0x0){return 0x0;}var _0x1bc502=0x1;for(var _0x2e51ec=0x1;_0x2e51ec<=_0x79693d;_0x2e51ec+=0x1){_0x1bc502=0x1+_0x1bc502*_0x2e51ec/_0x1a3335;}return 0x1/_0x1bc502;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x35093a,_0x4c78d3,_0x5520a8){if(_0x4c78d3>_0x5520a8){for(var _0x4b5515=0x0;_0x4b5515<_0x4c78d3-_0x5520a8;_0x4b5515+=0x1){decrementOriginate(_0x35093a);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x276a4b){var _0x2a197f={};var _0x4de572=['id',_0xffb3('0x50'),_0xffb3('0x51'),_0xffb3('0x52'),'updatedAt'];if(_0x276a4b){for(var _0x30dbae in _0x276a4b){if(typeof _0x276a4b[_0x30dbae]!==_0xffb3('0x53')){if(!_[_0xffb3('0x2e')](_0x276a4b[_0x30dbae])&&!_0x4de572['includes'](_0x30dbae)){_0x2a197f[util[_0xffb3('0x47')](_0xffb3('0x54'),_0xffb3('0x55'),_0x30dbae[_0xffb3('0x56')]())]=_0x276a4b[_0x30dbae];}}}}return _0x2a197f;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b52fb3b..6d49aef 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(_0x2f183e,_0x1f720e){var _0x5dd8a3=function(_0x53c6ba){while(--_0x53c6ba){_0x2f183e['push'](_0x2f183e['shift']());}};_0x5dd8a3(++_0x1f720e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x2f4e68,_0xe9bc3d){var _0xc70c7a=function(_0x14af32){while(--_0x14af32){_0x2f4e68['push'](_0x2f4e68['shift']());}};_0xc70c7a(++_0xe9bc3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 634cfee..dc999a1 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 _0x3e62=['ext','isTrunkReachable','isNil','active','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','localstationid','uniqueid','channels','channel','info','\x20syncNewchannel\x20','actions','variable','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','name','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables'];(function(_0x13e447,_0x182089){var _0x5aa6e4=function(_0x53304b){while(--_0x53304b){_0x13e447['push'](_0x13e447['shift']());}};_0x5aa6e4(++_0x182089);}(_0x3e62,0x17e));var _0x23e6=function(_0x2e50ab,_0x3929fb){_0x2e50ab=_0x2e50ab-0x0;var _0x5e09ac=_0x3e62[_0x2e50ab];return _0x5e09ac;};'use strict';var util=require(_0x23e6('0x0'));var _=require('lodash');var BPromise=require(_0x23e6('0x1'));var uuid=require(_0x23e6('0x2'));var moment=require(_0x23e6('0x3'));var path=require('path');var tiff2pdf=require(_0x23e6('0x4'));var gs=require(_0x23e6('0x5'));var logger=require(_0x23e6('0x6'))(_0x23e6('0x7'));var ami=require(_0x23e6('0x8'));var rpcDb=require(_0x23e6('0x9'));var Channel=require('./channel');var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x23e6('0xa'));var attachment=require(_0x23e6('0xb'));var faxMessage=require(_0x23e6('0xc'));function Fax(_0x585b17){this['channels']={};this[_0x23e6('0xd')]=_0x585b17[_0x23e6('0xd')];this[_0x23e6('0xe')]=_0x585b17['trunks'];this['actions']={};ami['on'](_0x23e6('0xf'),this[_0x23e6('0x10')][_0x23e6('0x11')](this));ami['on'](_0x23e6('0x12'),this[_0x23e6('0x13')][_0x23e6('0x11')](this));ami['on'](_0x23e6('0x14'),this[_0x23e6('0x15')][_0x23e6('0x11')](this));ami['on'](_0x23e6('0x16'),this[_0x23e6('0x17')]['bind'](this));ami['on'](_0x23e6('0x18'),this[_0x23e6('0x19')][_0x23e6('0x11')](this));ami['on'](_0x23e6('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0x23e6('0x1b'),this[_0x23e6('0x1c')][_0x23e6('0x11')](this));ami['on'](_0x23e6('0x1d'),this[_0x23e6('0x1e')][_0x23e6('0x11')](this));}Fax[_0x23e6('0x1f')]['syncNewchannel']=function(_0x4daeec){if(_0x4daeec[_0x23e6('0x20')]==='from-voip-provider'){for(var _0x263784 in this[_0x23e6('0xd')]){if(this[_0x23e6('0xd')][_0x23e6('0x21')](_0x263784)){if(_0x4daeec['exten']===this[_0x23e6('0xd')][_0x263784][_0x23e6('0x22')]){this['channels'][_0x4daeec[_0x23e6('0x23')]]={};this[_0x23e6('0x24')][_0x4daeec[_0x23e6('0x23')]][_0x23e6('0x25')]=_0x4daeec[_0x23e6('0x25')];this[_0x23e6('0x24')][_0x4daeec[_0x23e6('0x23')]]['id']=this[_0x23e6('0xd')][_0x263784]['id'];this[_0x23e6('0x24')][_0x4daeec[_0x23e6('0x23')]]['name']=this[_0x23e6('0xd')][_0x263784]['name'];logger[_0x23e6('0x26')](_0x4daeec['uniqueid'],_0x23e6('0x27'));}}}}if(this[_0x23e6('0x28')][_0x4daeec[_0x23e6('0x23')]]){this[_0x23e6('0x24')][_0x4daeec[_0x23e6('0x23')]]={};this[_0x23e6('0x24')][_0x4daeec[_0x23e6('0x23')]][_0x23e6('0x25')]=_0x4daeec[_0x23e6('0x25')];logger[_0x23e6('0x26')](_0x4daeec[_0x23e6('0x23')],_0x23e6('0x27'));}};Fax[_0x23e6('0x1f')][_0x23e6('0x13')]=function(_0x3f563c){if(this[_0x23e6('0x24')][_0x3f563c[_0x23e6('0x23')]]){for(var _0x28bfd7 in _0x3f563c[_0x23e6('0x29')]){if(_0x3f563c[_0x23e6('0x29')]['hasOwnProperty'](_0x28bfd7)){this['channels'][_0x3f563c[_0x23e6('0x23')]][_0x28bfd7]=_0x3f563c['value'];}}}};Fax['prototype'][_0x23e6('0x15')]=function(_0x10f6c5){if(this[_0x23e6('0x24')][_0x10f6c5['uniqueid']]){this['channels'][_0x10f6c5[_0x23e6('0x23')]]['channelstate']=_0x10f6c5['channelstate'];this[_0x23e6('0x24')][_0x10f6c5['uniqueid']][_0x23e6('0x2a')]=_0x10f6c5['channelstatedesc'];}};Fax[_0x23e6('0x1f')]['syncNewExten']=function(_0x571273){if(this[_0x23e6('0x24')][_0x571273[_0x23e6('0x23')]]){for(var _0x574b1e in _0x571273['variable']){if(_0x571273[_0x23e6('0x29')][_0x23e6('0x21')](_0x574b1e)){this[_0x23e6('0x24')][_0x571273[_0x23e6('0x23')]][_0x574b1e]=_0x571273[_0x23e6('0x2b')];}}}};Fax[_0x23e6('0x1f')][_0x23e6('0x19')]=function(_0x3ecf4f){if(this['channels'][_0x3ecf4f['uniqueid']]){this[_0x23e6('0x24')][_0x3ecf4f[_0x23e6('0x23')]][_0x23e6('0x2c')]=_0x3ecf4f[_0x23e6('0x2c')];this[_0x23e6('0x24')][_0x3ecf4f['uniqueid']][_0x23e6('0x2d')]=_0x3ecf4f[_0x23e6('0x2d')];this['channels'][_0x3ecf4f[_0x23e6('0x23')]][_0x23e6('0x22')]=_0x3ecf4f[_0x23e6('0x22')];this[_0x23e6('0x24')][_0x3ecf4f[_0x23e6('0x23')]]['filename']=_0x3ecf4f[_0x23e6('0x2e')];logger[_0x23e6('0x26')](_0x3ecf4f[_0x23e6('0x23')],_0x23e6('0x2f'));}};Fax[_0x23e6('0x1f')][_0x23e6('0x30')]=function(_0x5a1fb1){var _0x4e7645=this;if(this[_0x23e6('0x24')][_0x5a1fb1['uniqueid']]){var _0x3b1e66=this['channels'][_0x5a1fb1[_0x23e6('0x23')]]['id'];this[_0x23e6('0x24')][_0x5a1fb1[_0x23e6('0x23')]][_0x23e6('0x31')]=_0x5a1fb1[_0x23e6('0x31')];this['channels'][_0x5a1fb1[_0x23e6('0x23')]]['pagestransferred']=_0x5a1fb1[_0x23e6('0x32')];this[_0x23e6('0x24')][_0x5a1fb1[_0x23e6('0x23')]][_0x23e6('0x22')]=_0x5a1fb1[_0x23e6('0x22')];this[_0x23e6('0x24')][_0x5a1fb1['uniqueid']][_0x23e6('0x33')]=_0x5a1fb1[_0x23e6('0x33')];this[_0x23e6('0x24')][_0x5a1fb1[_0x23e6('0x23')]][_0x23e6('0x34')]=_0x5a1fb1[_0x23e6('0x34')];this['channels'][_0x5a1fb1[_0x23e6('0x23')]][_0x23e6('0x2e')]=_0x5a1fb1['filename'];this[_0x23e6('0x24')][_0x5a1fb1[_0x23e6('0x23')]]['calleridnum']=_0x5a1fb1[_0x23e6('0x35')];if(this['channels'][_0x5a1fb1[_0x23e6('0x23')]][_0x23e6('0x32')]>0x0){tiff2pdf(_0x5a1fb1[_0x23e6('0x2e')],_0x23e6('0x36'),function(_0x2f648a){logger['info'](_0x5a1fb1[_0x23e6('0x23')],'\x20result\x20conversion\x20file\x20',_0x2f648a[_0x23e6('0x37')]);attachment['create']({'name':path['parse'](_0x5a1fb1['filename'])[_0x23e6('0x38')],'basename':path[_0x23e6('0x39')](_0x5a1fb1[_0x23e6('0x2e')])[_0x23e6('0x38')]+_0x23e6('0x3a'),'type':_0x23e6('0x3b')})['then'](function(_0x39f50f){faxAccount[_0x23e6('0x3c')](_0x3b1e66,{'from':_0x5a1fb1[_0x23e6('0x35')],'mapKey':_0x23e6('0x7'),'body':path[_0x23e6('0x39')](_0x5a1fb1['filename'])[_0x23e6('0x38')]+_0x23e6('0x3a'),'AttachmentId':_0x39f50f['id']})[_0x23e6('0x3d')](function(_0x1c6c33){logger[_0x23e6('0x3e')](_0x5a1fb1[_0x23e6('0x23')],_0x23e6('0x3f'),JSON[_0x23e6('0x40')](_0x1c6c33));});})['catch'](function(_0x201ebd){logger['error'](_0x5a1fb1['uniqueid'],'\x20receiveFax\x20',JSON[_0x23e6('0x40')](_0x201ebd));});});}logger['info'](_0x5a1fb1[_0x23e6('0x23')],_0x23e6('0x41'));}};Fax[_0x23e6('0x1f')][_0x23e6('0x1e')]=function(_0x566e02){if(this['actions'][_0x566e02[_0x23e6('0x23')]]){_[_0x23e6('0x42')](this[_0x23e6('0x24')][_0x566e02[_0x23e6('0x23')]],_[_0x23e6('0x43')](_0x566e02,[_0x23e6('0x44'),_0x23e6('0x45')]));}};function updateStatus(_0x44b8df){if(_0x44b8df[_0x23e6('0x46')]){faxMessage[_0x23e6('0x47')](_0x44b8df['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x23e6('0x48')](function(_0x19d358){ut['logger'](_0x23e6('0x49'),_0x19d358);})[_0x23e6('0x3d')](function(_0x2676fa){ut[_0x23e6('0x4a')](_0x23e6('0x4b'),_0x2676fa);});}else{ut[_0x23e6('0x4a')](_0x23e6('0x4c'));}}Fax[_0x23e6('0x1f')][_0x23e6('0x4d')]=function(_0xed4403,_0x346fd1,_0x5032e9){var _0x5cb70f=this;var _0xdce225={};if(_0x346fd1){_0xdce225={'read':_0x346fd1};}else{_0xdce225={'failMessage':_0x5032e9};}if(this[_0x23e6('0x28')][_0xed4403][_0x23e6('0x46')]){faxMessage[_0x23e6('0x47')](this[_0x23e6('0x28')][_0xed4403]['AttachmentId'],_0xdce225)[_0x23e6('0x48')](function(_0xa206c){ut['logger'](_0x23e6('0x4e'),_0xa206c);})[_0x23e6('0x3d')](function(_0x1276c8){ut[_0x23e6('0x4a')](_0x23e6('0x4f'),_0x1276c8);})[_0x23e6('0x50')](function(){delete _0x5cb70f[_0x23e6('0x24')][_0xed4403];delete _0x5cb70f[_0x23e6('0x28')][_0xed4403];});}else{ut['logger'](_0x23e6('0x51'));delete this['channels'][_0xed4403];delete this[_0x23e6('0x28')][_0xed4403];}};Fax[_0x23e6('0x1f')][_0x23e6('0x1c')]=function(_0x26523e){var _0x50170f=this;if(this[_0x23e6('0x24')][_0x26523e['uniqueid']]){if(this['actions'][_0x26523e[_0x23e6('0x23')]]){this['channels'][_0x26523e['uniqueid']]['id']=this[_0x23e6('0x28')][_0x26523e[_0x23e6('0x23')]]['id'];this['channels'][_0x26523e['uniqueid']][_0x23e6('0x38')]=this['actions'][_0x26523e[_0x23e6('0x23')]]['name'];}logger[_0x23e6('0x26')](_0x26523e[_0x23e6('0x23')],this[_0x23e6('0x28')][_0x26523e[_0x23e6('0x23')]]?_0x23e6('0x52'):_0x23e6('0x53'),JSON[_0x23e6('0x40')](this['channels'][_0x26523e[_0x23e6('0x23')]]));if(this[_0x23e6('0x28')][_0x26523e[_0x23e6('0x23')]]){if(this[_0x23e6('0x24')][_0x26523e['uniqueid']][_0x23e6('0x54')]>0x0&&this[_0x23e6('0x24')][_0x26523e['uniqueid']][_0x23e6('0x18')]===_0x23e6('0x55')){this[_0x23e6('0x4d')](_0x26523e[_0x23e6('0x23')],!![]);}else{this['updateStatus'](_0x26523e[_0x23e6('0x23')],![],this[_0x23e6('0x24')][_0x26523e[_0x23e6('0x23')]][_0x23e6('0x56')]?_0x23e6('0x57')+this['channels'][_0x26523e[_0x23e6('0x23')]][_0x23e6('0x56')]:_0x23e6('0x58'));}}}};Fax[_0x23e6('0x1f')][_0x23e6('0x59')]=function(_0xb544b3){var _0x5355c6=this;return new BPromise(function(_0x5cd024,_0xf01eb6){_0x5355c6[_0x23e6('0x5a')](_0xb544b3,_0x5355c6[_0x23e6('0xd')][_0xb544b3[_0x23e6('0x5b')]])[_0x23e6('0x48')](function(_0x4eb56d){ut['logger']('[Fax][execOriginate][success]',_0x4eb56d);_0x5cd024(ut[_0x23e6('0x37')](_0x23e6('0x5c')));})[_0x23e6('0x3d')](function(_0x13f98d){ut['logger'](_0x23e6('0x5d'),_0x13f98d);updateStatus(_0xb544b3);_0xf01eb6(ut[_0x23e6('0x37')](_0x23e6('0x5e')));});});};Fax[_0x23e6('0x1f')][_0x23e6('0x5f')]=function(_0xc2a499){var _0x8f918=this;return new BPromise(function(_0x189390,_0x3d44a9){var _0x48594b=_0x8f918[_0x23e6('0x60')](_0x8f918[_0x23e6('0xd')][_0xc2a499[_0x23e6('0x5b')]][_0x23e6('0x61')],_0xc2a499);if(_0x48594b[_0x23e6('0x62')]){_0x189390(ut[_0x23e6('0x37')](_0x23e6('0x63')));}else{_0x3d44a9(ut[_0x23e6('0x37')](_0x48594b[_0x23e6('0x37')]));}});};function originate(_0x57bba5,_0x429de7,_0x527eab){return new BPromise(function(_0x511904,_0x277b43){if(_0x527eab){var _0x386a5c=util['format'](_0x23e6('0x64'),path['parse'](_0x57bba5[_0x23e6('0x65')])['name'],_0x57bba5[_0x23e6('0x65')]);gs[_0x23e6('0x66')](_0x386a5c)[_0x23e6('0x48')](function(){_0x57bba5[_0x23e6('0x65')]=util[_0x23e6('0x67')](_0x23e6('0x68'),path[_0x23e6('0x39')](_0x57bba5['path'])[_0x23e6('0x69')],path[_0x23e6('0x39')](_0x57bba5[_0x23e6('0x65')])[_0x23e6('0x38')]);_0x429de7['XMF-PATH']=_0x57bba5['path'];ut[_0x23e6('0x4a')](_0x23e6('0x6a'),'');ami[_0x23e6('0x6b')](ut[_0x23e6('0x6c')](_0x57bba5,_0x429de7))[_0x23e6('0x48')](function(_0x281c5f){_0x511904(_0x281c5f);})[_0x23e6('0x3d')](function(_0x86cc18){_0x277b43(_0x86cc18);});})[_0x23e6('0x3d')](function(_0x4d1f35){_0x277b43(_0x4d1f35);});}else{ami['Action'](ut['variablesAction'](_0x57bba5,_0x429de7))['then'](function(_0x272c95){_0x511904(_0x272c95);})[_0x23e6('0x3d')](function(_0x5cd6ca){_0x277b43(_0x5cd6ca);});}});}Fax['prototype'][_0x23e6('0x5a')]=function(_0x15d737,_0x4c5554){var _0x543926=this;return new BPromise(function(_0x4ec3a6,_0x298c2d){var _0x490b75=uuid['v4']();var _0x5e0934=ut[_0x23e6('0x6d')](_0x15d737,_0x4c5554);_0x543926[_0x23e6('0x28')][_0x490b75]=new Action(_0x490b75,_0x4c5554,_0x15d737);var _0x4dba80=_0x543926[_0x23e6('0x28')][_0x490b75];if(path['parse'](_0x15d737[_0x23e6('0x65')])[_0x23e6('0x6e')]===_0x23e6('0x3a')){originate(_0x4dba80,_0x5e0934,!![])[_0x23e6('0x48')](function(_0x2b697e){_0x4ec3a6(_0x2b697e);})[_0x23e6('0x3d')](function(_0x49c9da){_0x298c2d(_0x49c9da);});}else{originate(_0x4dba80,_0x5e0934,![])[_0x23e6('0x48')](function(_0x5b7f06){_0x4ec3a6(_0x5b7f06);})['catch'](function(_0x1f907f){_0x298c2d(_0x1f907f);});}});};Fax[_0x23e6('0x1f')][_0x23e6('0x6f')]=function(_0x4ae843){return!_['isNil'](_0x4ae843)&&!_[_0x23e6('0x70')](_0x4ae843['name'])&&!_['isNil'](_0x4ae843[_0x23e6('0x71')])&&_0x4ae843[_0x23e6('0x71')]&&!_[_0x23e6('0x70')](this['trunks'][util[_0x23e6('0x67')](_0x23e6('0x72'),_0x4ae843[_0x23e6('0x38')])])&&!_[_0x23e6('0x70')](this['trunks'][util[_0x23e6('0x67')]('SIP/%s',_0x4ae843[_0x23e6('0x38')])][_0x23e6('0x2d')])&&(this[_0x23e6('0xe')][util[_0x23e6('0x67')]('SIP/%s',_0x4ae843[_0x23e6('0x38')])]['status']===_0x23e6('0x73')||this[_0x23e6('0xe')][util[_0x23e6('0x67')](_0x23e6('0x72'),_0x4ae843[_0x23e6('0x38')])][_0x23e6('0x2d')]==='unmonitored');};Fax['prototype'][_0x23e6('0x60')]=function(_0x35124c,_0x52cb3c){if(!this[_0x23e6('0x6f')](_0x35124c)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x23e6('0x70')](_0x35124c)?'':_0x35124c[_0x23e6('0x38')]+_0x23e6('0x74'));return{'isValid':![],'message':_0x23e6('0x75')};}if(_[_0x23e6('0x70')](_0x52cb3c[_0x23e6('0x7')])){ut[_0x23e6('0x4a')](_0x23e6('0x76'),JSON['stringify'](_0x52cb3c));return{'isValid':![],'message':_0x23e6('0x77')};}if(_[_0x23e6('0x70')](_0x52cb3c[_0x23e6('0x65')])){ut[_0x23e6('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x23e6('0x40')](_0x52cb3c));return{'isValid':![],'message':_0x23e6('0x78')};}return{'isValid':!![],'message':_0x23e6('0x79')};};module[_0x23e6('0x7a')]=Fax; \ No newline at end of file +var _0x2a84=['status','filename','\x20syncFaxStatus\x20','syncReceiveFax','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','uuid','path','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a84,0x194));var _0x42a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2a84[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x42a8('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x42a8('0x1'));var moment=require('moment');var path=require(_0x42a8('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x42a8('0x3'))(_0x42a8('0x4'));var ami=require(_0x42a8('0x5'));var rpcDb=require(_0x42a8('0x6'));var Channel=require(_0x42a8('0x7'));var ut=require(_0x42a8('0x8'));var Action=require(_0x42a8('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x42a8('0xa'));var faxMessage=require(_0x42a8('0xb'));function Fax(_0x1b0dca){this[_0x42a8('0xc')]={};this[_0x42a8('0xd')]=_0x1b0dca[_0x42a8('0xd')];this['trunks']=_0x1b0dca[_0x42a8('0xe')];this[_0x42a8('0xf')]={};ami['on'](_0x42a8('0x10'),this[_0x42a8('0x11')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x13'),this['syncVarSet']['bind'](this));ami['on'](_0x42a8('0x14'),this['syncNewState'][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x15'),this[_0x42a8('0x16')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x17'),this[_0x42a8('0x18')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x19'),this['syncReceiveFax'][_0x42a8('0x12')](this));ami['on']('hangup',this[_0x42a8('0x1a')]['bind'](this));ami['on']('originateresponse',this[_0x42a8('0x1b')]['bind'](this));}Fax[_0x42a8('0x1c')][_0x42a8('0x11')]=function(_0x583738){if(_0x583738[_0x42a8('0x1d')]===_0x42a8('0x1e')){for(var _0xda70ab in this[_0x42a8('0xd')]){if(this[_0x42a8('0xd')][_0x42a8('0x1f')](_0xda70ab)){if(_0x583738['exten']===this[_0x42a8('0xd')][_0xda70ab][_0x42a8('0x20')]){this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]={};this[_0x42a8('0xc')][_0x583738['uniqueid']][_0x42a8('0x22')]=_0x583738[_0x42a8('0x22')];this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]['id']=this[_0x42a8('0xd')][_0xda70ab]['id'];this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]][_0x42a8('0x23')]=this[_0x42a8('0xd')][_0xda70ab][_0x42a8('0x23')];logger[_0x42a8('0x24')](_0x583738[_0x42a8('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x42a8('0xf')][_0x583738['uniqueid']]){this[_0x42a8('0xc')][_0x583738['uniqueid']]={};this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]['channel']=_0x583738[_0x42a8('0x22')];logger[_0x42a8('0x24')](_0x583738[_0x42a8('0x21')],_0x42a8('0x25'));}};Fax[_0x42a8('0x1c')]['syncVarSet']=function(_0x3f25df){if(this[_0x42a8('0xc')][_0x3f25df[_0x42a8('0x21')]]){for(var _0x33380b in _0x3f25df[_0x42a8('0x26')]){if(_0x3f25df['variable'][_0x42a8('0x1f')](_0x33380b)){this['channels'][_0x3f25df[_0x42a8('0x21')]][_0x33380b]=_0x3f25df[_0x42a8('0x27')];}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x28')]=function(_0xed09a5){if(this[_0x42a8('0xc')][_0xed09a5[_0x42a8('0x21')]]){this['channels'][_0xed09a5['uniqueid']]['channelstate']=_0xed09a5[_0x42a8('0x29')];this[_0x42a8('0xc')][_0xed09a5[_0x42a8('0x21')]][_0x42a8('0x2a')]=_0xed09a5[_0x42a8('0x2a')];}};Fax[_0x42a8('0x1c')][_0x42a8('0x16')]=function(_0x5c4fc3){if(this['channels'][_0x5c4fc3['uniqueid']]){for(var _0x206463 in _0x5c4fc3[_0x42a8('0x26')]){if(_0x5c4fc3['variable'][_0x42a8('0x1f')](_0x206463)){this[_0x42a8('0xc')][_0x5c4fc3['uniqueid']][_0x206463]=_0x5c4fc3[_0x42a8('0x27')];}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x18')]=function(_0x25c17e){if(this[_0x42a8('0xc')][_0x25c17e['uniqueid']]){this[_0x42a8('0xc')][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x2b')]=_0x25c17e[_0x42a8('0x2b')];this[_0x42a8('0xc')][_0x25c17e['uniqueid']][_0x42a8('0x2c')]=_0x25c17e[_0x42a8('0x2c')];this['channels'][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x20')]=_0x25c17e[_0x42a8('0x20')];this[_0x42a8('0xc')][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x2d')]=_0x25c17e[_0x42a8('0x2d')];logger[_0x42a8('0x24')](_0x25c17e['uniqueid'],_0x42a8('0x2e'));}};Fax[_0x42a8('0x1c')][_0x42a8('0x2f')]=function(_0x6c3c33){var _0x41e162=this;if(this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]){var _0x186fd7=this['channels'][_0x6c3c33['uniqueid']]['id'];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']]['remotestationid']=_0x6c3c33['remotestationid'];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x30')]=_0x6c3c33[_0x42a8('0x30')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]['localstationid']=_0x6c3c33[_0x42a8('0x20')];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']][_0x42a8('0x31')]=_0x6c3c33[_0x42a8('0x31')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]['transferrate']=_0x6c3c33['transferrate'];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']][_0x42a8('0x2d')]=_0x6c3c33[_0x42a8('0x2d')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x32')]=_0x6c3c33['calleridnum'];if(this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x30')]>0x0){tiff2pdf(_0x6c3c33[_0x42a8('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x24e101){logger[_0x42a8('0x24')](_0x6c3c33['uniqueid'],_0x42a8('0x33'),_0x24e101[_0x42a8('0x34')]);attachment[_0x42a8('0x35')]({'name':path['parse'](_0x6c3c33[_0x42a8('0x2d')])[_0x42a8('0x23')],'basename':path[_0x42a8('0x36')](_0x6c3c33[_0x42a8('0x2d')])['name']+_0x42a8('0x37'),'type':'application/pdf'})[_0x42a8('0x38')](function(_0x35c91b){faxAccount[_0x42a8('0x39')](_0x186fd7,{'from':_0x6c3c33['calleridnum'],'mapKey':_0x42a8('0x4'),'body':path[_0x42a8('0x36')](_0x6c3c33[_0x42a8('0x2d')])[_0x42a8('0x23')]+_0x42a8('0x37'),'AttachmentId':_0x35c91b['id']})[_0x42a8('0x3a')](function(_0x1d4da1){logger[_0x42a8('0x3b')](_0x6c3c33[_0x42a8('0x21')],_0x42a8('0x3c'),JSON[_0x42a8('0x3d')](_0x1d4da1));});})[_0x42a8('0x3a')](function(_0x2582b5){logger[_0x42a8('0x3b')](_0x6c3c33['uniqueid'],'\x20receiveFax\x20',JSON[_0x42a8('0x3d')](_0x2582b5));});});}logger[_0x42a8('0x24')](_0x6c3c33[_0x42a8('0x21')],_0x42a8('0x3e'));}};Fax[_0x42a8('0x1c')][_0x42a8('0x1b')]=function(_0x20904){if(this[_0x42a8('0xf')][_0x20904[_0x42a8('0x21')]]){_[_0x42a8('0x3f')](this[_0x42a8('0xc')][_0x20904[_0x42a8('0x21')]],_[_0x42a8('0x40')](_0x20904,[_0x42a8('0x41'),'reason']));}};function updateStatus(_0xe80246){if(_0xe80246[_0x42a8('0x42')]){faxMessage['update'](_0xe80246[_0x42a8('0x42')],{'failMessage':_0x42a8('0x43')})[_0x42a8('0x38')](function(_0x38e4e7){ut[_0x42a8('0x44')](_0x42a8('0x45'),_0x38e4e7);})[_0x42a8('0x3a')](function(_0x5b7a8d){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5b7a8d);});}else{ut[_0x42a8('0x44')](_0x42a8('0x46'));}}Fax[_0x42a8('0x1c')][_0x42a8('0x47')]=function(_0x28bd9f,_0xc99e87,_0x440eff){var _0x584db2=this;var _0x4c3499={};if(_0xc99e87){_0x4c3499={'read':_0xc99e87};}else{_0x4c3499={'failMessage':_0x440eff};}if(this['actions'][_0x28bd9f][_0x42a8('0x42')]){faxMessage[_0x42a8('0x48')](this[_0x42a8('0xf')][_0x28bd9f][_0x42a8('0x42')],_0x4c3499)[_0x42a8('0x38')](function(_0x12b22e){ut[_0x42a8('0x44')](_0x42a8('0x49'),_0x12b22e);})[_0x42a8('0x3a')](function(_0x2f3d5c){ut[_0x42a8('0x44')](_0x42a8('0x4a'),_0x2f3d5c);})['finally'](function(){delete _0x584db2[_0x42a8('0xc')][_0x28bd9f];delete _0x584db2[_0x42a8('0xf')][_0x28bd9f];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this['channels'][_0x28bd9f];delete this['actions'][_0x28bd9f];}};Fax[_0x42a8('0x1c')][_0x42a8('0x1a')]=function(_0x1d1268){var _0x574552=this;if(this['channels'][_0x1d1268[_0x42a8('0x21')]]){if(this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]){this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]]['id']=this[_0x42a8('0xf')][_0x1d1268['uniqueid']]['id'];this['channels'][_0x1d1268['uniqueid']]['name']=this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x23')];}logger[_0x42a8('0x24')](_0x1d1268[_0x42a8('0x21')],this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]?_0x42a8('0x4b'):_0x42a8('0x4c'),JSON[_0x42a8('0x3d')](this[_0x42a8('0xc')][_0x1d1268['uniqueid']]));if(this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]){if(this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x4d')]>0x0&&this['channels'][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x17')]==='SUCCESS'){this[_0x42a8('0x47')](_0x1d1268[_0x42a8('0x21')],!![]);}else{this['updateStatus'](_0x1d1268[_0x42a8('0x21')],![],this[_0x42a8('0xc')][_0x1d1268['uniqueid']][_0x42a8('0x4e')]?_0x42a8('0x4f')+this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x4e')]:_0x42a8('0x50'));}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x51')]=function(_0x1347e1){var _0x54e339=this;return new BPromise(function(_0x1f0008,_0x5e56b1){_0x54e339[_0x42a8('0x52')](_0x1347e1,_0x54e339['faxAccounts'][_0x1347e1[_0x42a8('0x53')]])[_0x42a8('0x38')](function(_0x4a2f70){ut[_0x42a8('0x44')](_0x42a8('0x54'),_0x4a2f70);_0x1f0008(ut[_0x42a8('0x34')](_0x42a8('0x55')));})[_0x42a8('0x3a')](function(_0x2cc767){ut[_0x42a8('0x44')]('[Fax][execOriginate][failure]',_0x2cc767);updateStatus(_0x1347e1);_0x5e56b1(ut['message'](_0x42a8('0x56')));});});};Fax[_0x42a8('0x1c')][_0x42a8('0x57')]=function(_0x1e51a5){var _0x4cf0a6=this;return new BPromise(function(_0x46d682,_0x3b04a2){var _0x19bcc0=_0x4cf0a6[_0x42a8('0x58')](_0x4cf0a6[_0x42a8('0xd')][_0x1e51a5[_0x42a8('0x53')]][_0x42a8('0x59')],_0x1e51a5);if(_0x19bcc0['isValid']){_0x46d682(ut[_0x42a8('0x34')]('Trunk\x20Reachable'));}else{_0x3b04a2(ut['message'](_0x19bcc0[_0x42a8('0x34')]));}});};function originate(_0xb85b98,_0x56b15b,_0x17a09d){return new BPromise(function(_0x44f5bd,_0x539763){if(_0x17a09d){var _0x66cbbe=util[_0x42a8('0x5a')](_0x42a8('0x5b'),path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x23')],_0xb85b98[_0x42a8('0x2')]);gs[_0x42a8('0x5c')](_0x66cbbe)[_0x42a8('0x38')](function(){_0xb85b98[_0x42a8('0x2')]=util[_0x42a8('0x5a')](_0x42a8('0x5d'),path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x5e')],path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x23')]);_0x56b15b[_0x42a8('0x5f')]=_0xb85b98['path'];ut['logger'](_0x42a8('0x60'),'');ami[_0x42a8('0x61')](ut[_0x42a8('0x62')](_0xb85b98,_0x56b15b))[_0x42a8('0x38')](function(_0x56b046){_0x44f5bd(_0x56b046);})[_0x42a8('0x3a')](function(_0x34e94f){_0x539763(_0x34e94f);});})[_0x42a8('0x3a')](function(_0x90da34){_0x539763(_0x90da34);});}else{ami[_0x42a8('0x61')](ut[_0x42a8('0x62')](_0xb85b98,_0x56b15b))['then'](function(_0x41c233){_0x44f5bd(_0x41c233);})[_0x42a8('0x3a')](function(_0x161244){_0x539763(_0x161244);});}});}Fax['prototype'][_0x42a8('0x52')]=function(_0x59d292,_0x2c99c6){var _0x1a5bbf=this;return new BPromise(function(_0x10575a,_0x1e71bb){var _0x3c62c7=uuid['v4']();var _0x1f7270=ut[_0x42a8('0x63')](_0x59d292,_0x2c99c6);_0x1a5bbf[_0x42a8('0xf')][_0x3c62c7]=new Action(_0x3c62c7,_0x2c99c6,_0x59d292);var _0x5d3a56=_0x1a5bbf['actions'][_0x3c62c7];if(path[_0x42a8('0x36')](_0x59d292[_0x42a8('0x2')])['ext']===_0x42a8('0x37')){originate(_0x5d3a56,_0x1f7270,!![])[_0x42a8('0x38')](function(_0x4a86b7){_0x10575a(_0x4a86b7);})[_0x42a8('0x3a')](function(_0x3c16af){_0x1e71bb(_0x3c16af);});}else{originate(_0x5d3a56,_0x1f7270,![])['then'](function(_0x472b27){_0x10575a(_0x472b27);})[_0x42a8('0x3a')](function(_0x547381){_0x1e71bb(_0x547381);});}});};Fax[_0x42a8('0x1c')]['isTrunkReachable']=function(_0x2f8c1c){return!_['isNil'](_0x2f8c1c)&&!_['isNil'](_0x2f8c1c['name'])&&!_[_0x42a8('0x64')](_0x2f8c1c['active'])&&_0x2f8c1c[_0x42a8('0x65')]&&!_[_0x42a8('0x64')](this[_0x42a8('0xe')][util[_0x42a8('0x5a')](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])])&&!_[_0x42a8('0x64')](this[_0x42a8('0xe')][util['format']('SIP/%s',_0x2f8c1c[_0x42a8('0x23')])][_0x42a8('0x2c')])&&(this[_0x42a8('0xe')][util['format'](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])][_0x42a8('0x2c')]==='reachable'||this[_0x42a8('0xe')][util[_0x42a8('0x5a')](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])]['status']===_0x42a8('0x67'));};Fax['prototype'][_0x42a8('0x58')]=function(_0xacf8db,_0x178f09){if(!this[_0x42a8('0x68')](_0xacf8db)){ut['logger'](_0x42a8('0x69'),_[_0x42a8('0x64')](_0xacf8db)?'':_0xacf8db[_0x42a8('0x23')]+_0x42a8('0x6a'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x178f09['fax'])){ut[_0x42a8('0x44')](_0x42a8('0x6b'),JSON[_0x42a8('0x3d')](_0x178f09));return{'isValid':![],'message':_0x42a8('0x6c')};}if(_[_0x42a8('0x64')](_0x178f09[_0x42a8('0x2')])){ut[_0x42a8('0x44')](_0x42a8('0x6d'),JSON[_0x42a8('0x3d')](_0x178f09));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x42a8('0x6e')};};module[_0x42a8('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 883caad..2406478 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 _0xa011=['preview','lodash','../rpc/faxAccount','error','inspect','notify','catch','bluebird','../../../config/logger'];(function(_0x459616,_0x360dc3){var _0x40558a=function(_0x41e84b){while(--_0x41e84b){_0x459616['push'](_0x459616['shift']());}};_0x40558a(++_0x360dc3);}(_0xa011,0xfa));var _0x1a01=function(_0x36956e,_0x518e4c){_0x36956e=_0x36956e-0x0;var _0xeb762f=_0xa011[_0x36956e];return _0xeb762f;};'use strict';var util=require('util');var BPromise=require(_0x1a01('0x0'));var logger=require(_0x1a01('0x1'))(_0x1a01('0x2'));var _=require(_0x1a01('0x3'));var faxAccount=require(_0x1a01('0x4'));function loggerCatch(_0x14b6dc){return function(_0x57e64b){logger[_0x1a01('0x5')](_0x14b6dc,util[_0x1a01('0x6')](_0x57e64b,{'showHidden':![],'depth':null}));};}exports[_0x1a01('0x7')]=function(_0x19e2a7,_0x860f44){return BPromise['resolve']()['then'](faxAccount[_0x1a01('0x7')](_0x19e2a7,_0x860f44))[_0x1a01('0x8')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xae11=['[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x485e26,_0x3caf9a){var _0x52f229=function(_0x310dc4){while(--_0x310dc4){_0x485e26['push'](_0x485e26['shift']());}};_0x52f229(++_0x3caf9a);}(_0xae11,0x1c9));var _0x1ae1=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xae11[_0xbc4659];return _0x5831f9;};'use strict';var util=require('util');var BPromise=require(_0x1ae1('0x0'));var logger=require(_0x1ae1('0x1'))(_0x1ae1('0x2'));var _=require(_0x1ae1('0x3'));var faxAccount=require(_0x1ae1('0x4'));function loggerCatch(_0x554313){return function(_0x133a7b){logger[_0x1ae1('0x5')](_0x554313,util[_0x1ae1('0x6')](_0x133a7b,{'showHidden':![],'depth':null}));};}exports[_0x1ae1('0x7')]=function(_0xf4da29,_0x5cf3ba){return BPromise[_0x1ae1('0x8')]()[_0x1ae1('0x9')](faxAccount[_0x1ae1('0x7')](_0xf4da29,_0x5cf3ba))[_0x1ae1('0xa')](loggerCatch(_0x1ae1('0xb')));}; \ 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 c235adf..9243d5e 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 _0x0015=['inspect','util','../../../../config/logger','fax','bluebird','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x58719b,_0x1cb622){var _0x13b76c=function(_0x31c0f1){while(--_0x31c0f1){_0x58719b['push'](_0x58719b['shift']());}};_0x13b76c(++_0x1cb622);}(_0x0015,0x7f));var _0x5001=function(_0x20efe0,_0x307808){_0x20efe0=_0x20efe0-0x0;var _0x2a93c3=_0x0015[_0x20efe0];return _0x2a93c3;};'use strict';var util=require(_0x5001('0x0'));var logger=require(_0x5001('0x1'))(_0x5001('0x2'));var BPromise=require(_0x5001('0x3'));var exec=require('child_process')[_0x5001('0x4')];exports['execute']=function(_0x3450ab){return new BPromise(function(_0x390c25,_0x3b8dbe){exec(_0x3450ab,function(_0x10b7ad,_0x5e9a36,_0x7435ac){logger[_0x5001('0x5')]('Exec\x20gs',_0x5e9a36);if(_0x10b7ad){logger['info'](_0x5001('0x6'),_0x5001('0x7'),util[_0x5001('0x8')](_0x10b7ad,{'showHidden':![],'depth':null}),_0x5e9a36,_0x7435ac);_0x3b8dbe(_0x10b7ad);}_0x390c25(_0x5e9a36);});});}; \ No newline at end of file +var _0x3234=['info','Exec\x20gs','\x20Error\x20:','../../../../config/logger','fax','child_process','execute'];(function(_0x449f6b,_0x226471){var _0x2df4e6=function(_0x187b71){while(--_0x187b71){_0x449f6b['push'](_0x449f6b['shift']());}};_0x2df4e6(++_0x226471);}(_0x3234,0x10d));var _0x4323=function(_0x23445d,_0x371efe){_0x23445d=_0x23445d-0x0;var _0x928037=_0x3234[_0x23445d];return _0x928037;};'use strict';var util=require('util');var logger=require(_0x4323('0x0'))(_0x4323('0x1'));var BPromise=require('bluebird');var exec=require(_0x4323('0x2'))['exec'];exports[_0x4323('0x3')]=function(_0x164953){return new BPromise(function(_0x39934b,_0x58acf3){exec(_0x164953,function(_0x9160f,_0x3e5ffe,_0x3c9ed0){logger['info']('Exec\x20gs',_0x3e5ffe);if(_0x9160f){logger[_0x4323('0x4')](_0x4323('0x5'),_0x4323('0x6'),util['inspect'](_0x9160f,{'showHidden':![],'depth':null}),_0x3e5ffe,_0x3c9ed0);_0x58acf3(_0x9160f);}_0x39934b(_0x3e5ffe);});});}; \ 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 3d0dfbe..367d0ba 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 _0xbdab=['t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','minrate','maxrate','format','modem'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbdab,0x1eb));var _0xbbda=function(_0x391bf8,_0x4bc842){_0x391bf8=_0x391bf8-0x0;var _0x2239b4=_0xbdab[_0x391bf8];return _0x2239b4;};'use strict';var util=require(_0xbbda('0x0'));var _=require(_0xbbda('0x1'));var moment=require(_0xbbda('0x2'));var logger=require(_0xbbda('0x3'))(_0xbbda('0x4'));exports[_0xbbda('0x5')]=function(_0x1cea7b){return{'message':_0x1cea7b};};exports[_0xbbda('0x6')]=function(_0x3c5934,_0x8a92f2){logger[_0xbbda('0x7')](_0x3c5934,util[_0xbbda('0x8')](_0x8a92f2,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x21ddb,_0x131f2d){var _0x2a0932={'XMF-ECM':_0x131f2d[_0xbbda('0x9')],'XMF-HEADERINFO':_0x131f2d[_0xbbda('0xa')],'XMF-MINRATE':_0x131f2d[_0xbbda('0xb')],'XMF-MAXRATE':_0x131f2d[_0xbbda('0xc')],'XMF-MODEM':util[_0xbbda('0xd')]('\x22%s\x22',_0x131f2d[_0xbbda('0xe')]),'XMF-GATEWAY':_0x131f2d['gateway'],'XMF-FAXDETECT':_0x131f2d['faxdetect'],'XMF-T38TIMEOUT':_0x131f2d[_0xbbda('0xf')],'XMF-LOCALSTATIONID':_0x131f2d[_0xbbda('0x10')],'XMF-PATH':_0x21ddb[_0xbbda('0x11')]};return _0x2a0932;};exports[_0xbbda('0x12')]=function(_0x30107e,_0x2af293){return{'actionid':_0x30107e['uniqueid'],'action':_0xbbda('0x13'),'channel':_0x30107e[_0xbbda('0x14')],'Exten':_0xbbda('0x15'),'Context':'from-sip','Priority':'1','callerid':util[_0xbbda('0xd')](_0xbbda('0x16'),_0x30107e[_0xbbda('0xa')]?_0x30107e[_0xbbda('0xa')]:'',_0x30107e[_0xbbda('0x10')]),'variable':_0x2af293,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x30107e['uniqueid']};}; \ No newline at end of file +var _0xc1f9=['gateway','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x1a188e,_0x1087e6){var _0x46f4e=function(_0x321081){while(--_0x321081){_0x1a188e['push'](_0x1a188e['shift']());}};_0x46f4e(++_0x1087e6);}(_0xc1f9,0xca));var _0x9c1f=function(_0x36f1dd,_0x262354){_0x36f1dd=_0x36f1dd-0x0;var _0x2c9bb3=_0xc1f9[_0x36f1dd];return _0x2c9bb3;};'use strict';var util=require(_0x9c1f('0x0'));var _=require(_0x9c1f('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x9c1f('0x2'));exports[_0x9c1f('0x3')]=function(_0x38a9c){return{'message':_0x38a9c};};exports[_0x9c1f('0x4')]=function(_0x4ac843,_0x43e874){logger['info'](_0x4ac843,util[_0x9c1f('0x5')](_0x43e874,{'showHidden':![],'depth':null}));};exports[_0x9c1f('0x6')]=function(_0xd8b293,_0x4e1adc){var _0x1d61b0={'XMF-ECM':_0x4e1adc[_0x9c1f('0x7')],'XMF-HEADERINFO':_0x4e1adc[_0x9c1f('0x8')],'XMF-MINRATE':_0x4e1adc[_0x9c1f('0x9')],'XMF-MAXRATE':_0x4e1adc[_0x9c1f('0xa')],'XMF-MODEM':util[_0x9c1f('0xb')](_0x9c1f('0xc'),_0x4e1adc[_0x9c1f('0xd')]),'XMF-GATEWAY':_0x4e1adc[_0x9c1f('0xe')],'XMF-FAXDETECT':_0x4e1adc['faxdetect'],'XMF-T38TIMEOUT':_0x4e1adc[_0x9c1f('0xf')],'XMF-LOCALSTATIONID':_0x4e1adc[_0x9c1f('0x10')],'XMF-PATH':_0xd8b293[_0x9c1f('0x11')]};return _0x1d61b0;};exports[_0x9c1f('0x12')]=function(_0x29d8c5,_0x150c71){return{'actionid':_0x29d8c5[_0x9c1f('0x13')],'action':'originate','channel':_0x29d8c5[_0x9c1f('0x14')],'Exten':_0x9c1f('0x15'),'Context':_0x9c1f('0x16'),'Priority':'1','callerid':util[_0x9c1f('0xb')](_0x9c1f('0x17'),_0x29d8c5['headerinfo']?_0x29d8c5[_0x9c1f('0x8')]:'',_0x29d8c5[_0x9c1f('0x10')]),'variable':_0x150c71,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x29d8c5[_0x9c1f('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 5940f46..f865eee 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 _0xa030=['ami','get','hour','resolve','getAgents','then','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0xa030,0x18c));var _0x0a03=function(_0x1eb0a2,_0x553c6d){_0x1eb0a2=_0x1eb0a2-0x0;var _0x18c57e=_0xa030[_0x1eb0a2];return _0x18c57e;};'use strict';var util=require(_0x0a03('0x0'));var moment=require(_0x0a03('0x1'));var server=require(_0x0a03('0x2'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x0a03('0x3'));var Trigger=require(_0x0a03('0x4'));var Dialer=require(_0x0a03('0x5'));var Preview=require('./preview');var Fax=require(_0x0a03('0x6'));var user=require('./rpc/user');var voiceQueue=require(_0x0a03('0x7'));var voiceQueueReport=require(_0x0a03('0x8'));var voiceCallReport=require(_0x0a03('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x0a03('0xa'));var template=require(_0x0a03('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x0a03('0xc'));var voiceExtension=require(_0x0a03('0xd'));var faxAccount=require(_0x0a03('0xe'));var zendesk=require(_0x0a03('0xf'));var salesforce=require(_0x0a03('0x10'));var sugarcrm=require(_0x0a03('0x11'));var freshdesk=require(_0x0a03('0x12'));var desk=require(_0x0a03('0x13'));var zoho=require(_0x0a03('0x14'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x0a03('0x15'));var servicenow=require(_0x0a03('0x16'));var dynamics365=require(_0x0a03('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x0a03('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0a03('0x19')](_0x0a03('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0a03('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x0a03('0x1b')]()['then'](user[_0x0a03('0x1c')]())['then'](realtime['initAgents']())[_0x0a03('0x1d')](user[_0x0a03('0x1e')]())[_0x0a03('0x1d')](realtime['initTelephones']())[_0x0a03('0x1d')](trunk[_0x0a03('0x1f')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x20')]())['then'](voiceQueue[_0x0a03('0x21')]())[_0x0a03('0x1d')](realtime['initVoiceQueues']())[_0x0a03('0x1d')](trigger[_0x0a03('0x22')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x23')]())[_0x0a03('0x1d')](template['getTemplates']())[_0x0a03('0x1d')](realtime['initTemplates']())[_0x0a03('0x1d')](zendesk[_0x0a03('0x24')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x25')]())[_0x0a03('0x1d')](salesforce[_0x0a03('0x26')]())[_0x0a03('0x1d')](realtime['initSalesforceAccounts']())[_0x0a03('0x1d')](sugarcrm['getSugarcrmAccounts']())[_0x0a03('0x1d')](realtime[_0x0a03('0x27')]())[_0x0a03('0x1d')](freshdesk[_0x0a03('0x28')]())['then'](realtime[_0x0a03('0x29')]())[_0x0a03('0x1d')](desk['getDeskAccounts']())[_0x0a03('0x1d')](realtime[_0x0a03('0x2a')]())[_0x0a03('0x1d')](zoho[_0x0a03('0x2b')]())['then'](realtime[_0x0a03('0x2c')]())[_0x0a03('0x1d')](vtiger[_0x0a03('0x2d')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x2e')]())['then'](freshsales[_0x0a03('0x2f')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x30')]())[_0x0a03('0x1d')](servicenow[_0x0a03('0x31')]())['then'](realtime[_0x0a03('0x32')]())[_0x0a03('0x1d')](dynamics365[_0x0a03('0x33')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x34')]())[_0x0a03('0x1d')](campaign[_0x0a03('0x35')]())[_0x0a03('0x1d')](realtime['initCampaigns']())[_0x0a03('0x1d')](voiceExtension[_0x0a03('0x36')]())[_0x0a03('0x1d')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x0a03('0x37')]())['then'](realtime[_0x0a03('0x38')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x0a03('0x1b')]()['then'](voiceQueueReport[_0x0a03('0x39')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x3a')]())['then'](cmHopperHistory[_0x0a03('0x3b')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x3c')]())[_0x0a03('0x1d')](cmHopperHistory[_0x0a03('0x3d')]())[_0x0a03('0x1d')](realtime[_0x0a03('0x3e')]())[_0x0a03('0x1d')](voiceCallReport[_0x0a03('0x3f')]())[_0x0a03('0x1d')](realtime['initVoiceCallReports']())[_0x0a03('0x40')](function(_0x55d142){logger['error'](_0x0a03('0x41'),util[_0x0a03('0x42')](_0x55d142,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0a03('0x43')](realtime,preview,fax)[_0x0a03('0x1d')](function(){return initRealtime();})[_0x0a03('0x1d')](function(){return initParams();})['then'](function(){report[_0x0a03('0x44')]();setInterval(initRealtime,0x1388);})[_0x0a03('0x40')](function(_0x4ad343){logger['error'](_0x0a03('0x45'),util[_0x0a03('0x42')](_0x4ad343,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x8cc9=['./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','util','moment','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory'];(function(_0x29c8db,_0x4bceec){var _0x378a4f=function(_0x37964f){while(--_0x37964f){_0x29c8db['push'](_0x29c8db['shift']());}};_0x378a4f(++_0x4bceec);}(_0x8cc9,0x76));var _0x98cc=function(_0x31603f,_0x5240f3){_0x31603f=_0x31603f-0x0;var _0x4d0d60=_0x8cc9[_0x31603f];return _0x4d0d60;};'use strict';var util=require(_0x98cc('0x0'));var moment=require(_0x98cc('0x1'));var server=require('./server');var Realtime=require(_0x98cc('0x2'));var Report=require('./report');var Acw=require(_0x98cc('0x3'));var Trigger=require(_0x98cc('0x4'));var Dialer=require('./dialer');var Preview=require(_0x98cc('0x5'));var Fax=require(_0x98cc('0x6'));var user=require(_0x98cc('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x98cc('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x98cc('0x9'));var trigger=require(_0x98cc('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x98cc('0xb'));var campaign=require(_0x98cc('0xc'));var voiceExtension=require(_0x98cc('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x98cc('0xe'));var sugarcrm=require(_0x98cc('0xf'));var freshdesk=require(_0x98cc('0x10'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x98cc('0x11'));var freshsales=require(_0x98cc('0x12'));var servicenow=require(_0x98cc('0x13'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x98cc('0x14'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x98cc('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x98cc('0x15')](_0x98cc('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x98cc('0x17')]()[_0x98cc('0x18')](user[_0x98cc('0x19')]())['then'](realtime[_0x98cc('0x1a')]())[_0x98cc('0x18')](user[_0x98cc('0x1b')]())[_0x98cc('0x18')](realtime['initTelephones']())[_0x98cc('0x18')](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0x98cc('0x18')](voiceQueue[_0x98cc('0x1c')]())['then'](realtime[_0x98cc('0x1d')]())['then'](trigger['getTriggers']())['then'](realtime[_0x98cc('0x1e')]())[_0x98cc('0x18')](template[_0x98cc('0x1f')]())[_0x98cc('0x18')](realtime[_0x98cc('0x20')]())[_0x98cc('0x18')](zendesk[_0x98cc('0x21')]())[_0x98cc('0x18')](realtime[_0x98cc('0x22')]())[_0x98cc('0x18')](salesforce[_0x98cc('0x23')]())[_0x98cc('0x18')](realtime[_0x98cc('0x24')]())[_0x98cc('0x18')](sugarcrm[_0x98cc('0x25')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x98cc('0x26')]())[_0x98cc('0x18')](realtime[_0x98cc('0x27')]())[_0x98cc('0x18')](desk['getDeskAccounts']())[_0x98cc('0x18')](realtime[_0x98cc('0x28')]())[_0x98cc('0x18')](zoho[_0x98cc('0x29')]())[_0x98cc('0x18')](realtime['initZohoAccounts']())[_0x98cc('0x18')](vtiger['getVtigerAccounts']())[_0x98cc('0x18')](realtime[_0x98cc('0x2a')]())['then'](freshsales[_0x98cc('0x2b')]())[_0x98cc('0x18')](realtime[_0x98cc('0x2c')]())[_0x98cc('0x18')](servicenow['getServicenowAccounts']())[_0x98cc('0x18')](realtime[_0x98cc('0x2d')]())[_0x98cc('0x18')](dynamics365[_0x98cc('0x2e')]())[_0x98cc('0x18')](realtime[_0x98cc('0x2f')]())['then'](campaign[_0x98cc('0x30')]())[_0x98cc('0x18')](realtime['initCampaigns']())[_0x98cc('0x18')](voiceExtension[_0x98cc('0x31')]())[_0x98cc('0x18')](realtime[_0x98cc('0x32')]())[_0x98cc('0x18')](faxAccount[_0x98cc('0x33')]())[_0x98cc('0x18')](realtime[_0x98cc('0x34')]())[_0x98cc('0x18')](function(){return realtime;});}function initParams(){return Promise[_0x98cc('0x17')]()[_0x98cc('0x18')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x98cc('0x35')]())[_0x98cc('0x18')](cmHopperHistory[_0x98cc('0x36')]())[_0x98cc('0x18')](realtime[_0x98cc('0x37')]())[_0x98cc('0x18')](cmHopperHistory['getCampaignHopperHistory']())[_0x98cc('0x18')](realtime[_0x98cc('0x38')]())[_0x98cc('0x18')](voiceCallReport[_0x98cc('0x39')]())[_0x98cc('0x18')](realtime[_0x98cc('0x3a')]())[_0x98cc('0x3b')](function(_0xfa5ed5){logger[_0x98cc('0x3c')](_0x98cc('0x3d'),util[_0x98cc('0x3e')](_0xfa5ed5,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x98cc('0x18')](function(){return initRealtime();})[_0x98cc('0x18')](function(){return initParams();})[_0x98cc('0x18')](function(){report[_0x98cc('0x3f')]();setInterval(initRealtime,0x1388);})[_0x98cc('0x3b')](function(_0x14aac0){logger[_0x98cc('0x3c')](_0x98cc('0x40'),util['inspect'](_0x14aac0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 0c02b26..d317e13 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 _0xd3c5=['name','email','accountcode','fullname','state','unknown','stateTime','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','idle','inuse','talking','toNumber','format','status','voiceStatusCallerIdNumber','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xd3c5,0x9a));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d3c('0x0'));var util=require(_0x5d3c('0x1'));var moment=require(_0x5d3c('0x2'));var md5=require(_0x5d3c('0x3'));var Redis=require(_0x5d3c('0x4'));var config=require(_0x5d3c('0x5'));config[_0x5d3c('0x6')]=_[_0x5d3c('0x7')](config['redis'],{'host':_0x5d3c('0x8'),'port':0x18eb});var io=require(_0x5d3c('0x9'))(new Redis(config['redis']));function Agent(_0x4c8e0d){this['id']=_0x4c8e0d['id']||0x0;this['name']=_0x4c8e0d[_0x5d3c('0xa')]||'';this[_0x5d3c('0xb')]=_0x4c8e0d[_0x5d3c('0xb')]||'';this['accountcode']=_0x4c8e0d[_0x5d3c('0xc')]||'';this['fullname']=_0x4c8e0d[_0x5d3c('0xd')]||'';this[_0x5d3c('0xe')]=_0x5d3c('0xf');this[_0x5d3c('0x10')]=0x0;this['status']=_0x5d3c('0xf');this[_0x5d3c('0x11')]='';this['phone']='';this[_0x5d3c('0x12')]='';this[_0x5d3c('0x13')]='';this[_0x5d3c('0x14')]=_0x4c8e0d['online']||![];this[_0x5d3c('0x15')]=_0x5d3c('0xf');this[_0x5d3c('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x5d3c('0x17')]='';this[_0x5d3c('0x18')]=![];this[_0x5d3c('0x19')]=![];this[_0x5d3c('0x3')]='';}Agent[_0x5d3c('0x1a')][_0x5d3c('0x1b')]=function(_0x11cb51){var _0x328309;if(_0x11cb51&&_0x11cb51[_0x5d3c('0xe')]){_0x328309=_0x11cb51['state'][_0x5d3c('0x1c')]();switch(_0x328309){case'not_inuse':_0x328309=_0x5d3c('0x1d');break;case _0x5d3c('0x1e'):_0x328309=_0x5d3c('0x1f');break;}}if(_0x328309&&this[_0x5d3c('0x15')]!==_0x328309||_0x11cb51['statePause']){this[_0x5d3c('0x16')]=_[_0x5d3c('0x20')](moment()[_0x5d3c('0x21')]('x'));}if(_0x328309){this[_0x5d3c('0x15')]=_0x328309;}var _0x59166a={'id':this['id'],'name':this['name'],'email':this[_0x5d3c('0xb')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x5d3c('0xe')],'stateTime':this[_0x5d3c('0x10')],'status':this[_0x5d3c('0x22')],'address':this[_0x5d3c('0x11')],'online':this['online'],'voiceStatus':this[_0x5d3c('0x15')],'voiceStatusTime':this[_0x5d3c('0x16')],'voiceStatusCallerIdNumber':this[_0x5d3c('0x23')],'voiceStatusQueue':this[_0x5d3c('0x17')],'interface':this[_0x5d3c('0x13')],'onhold':this['onhold']};var _0xcde6bf=md5(JSON['stringify'](_0x59166a));if(this[_0x5d3c('0x3')]!==_0xcde6bf){this['md5']=_0xcde6bf;io['to'](util[_0x5d3c('0x21')](_0x5d3c('0x24'),_0x59166a[_0x5d3c('0xa')]))[_0x5d3c('0x25')](_0x5d3c('0x26'),_0x59166a);io[_0x5d3c('0x25')](_0x5d3c('0x27'),_0x59166a);}};module[_0x5d3c('0x28')]=Agent; \ No newline at end of file +var _0xd93a=['idle','inuse','talking','voiceStatusQueue','format','emit','user:save','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','unknown','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime'];(function(_0x12fef5,_0x5a4506){var _0x55bc75=function(_0x13a85e){while(--_0x13a85e){_0x12fef5['push'](_0x12fef5['shift']());}};_0x55bc75(++_0x5a4506);}(_0xd93a,0x91));var _0xad93=function(_0x3e61cc,_0x325f70){_0x3e61cc=_0x3e61cc-0x0;var _0x1b05e6=_0xd93a[_0x3e61cc];return _0x1b05e6;};'use strict';var _=require(_0xad93('0x0'));var util=require(_0xad93('0x1'));var moment=require('moment');var md5=require(_0xad93('0x2'));var Redis=require(_0xad93('0x3'));var config=require(_0xad93('0x4'));config[_0xad93('0x5')]=_['defaults'](config[_0xad93('0x5')],{'host':_0xad93('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xad93('0x5')]));function Agent(_0x820a93){this['id']=_0x820a93['id']||0x0;this[_0xad93('0x7')]=_0x820a93[_0xad93('0x7')]||'';this[_0xad93('0x8')]=_0x820a93['email']||'';this[_0xad93('0x9')]=_0x820a93[_0xad93('0x9')]||'';this[_0xad93('0xa')]=_0x820a93[_0xad93('0xa')]||'';this[_0xad93('0xb')]=_0xad93('0xc');this['stateTime']=0x0;this[_0xad93('0xd')]='unknown';this[_0xad93('0xe')]='';this['phone']='';this[_0xad93('0xf')]='';this[_0xad93('0x10')]='';this['online']=_0x820a93[_0xad93('0x11')]||![];this[_0xad93('0x12')]='unknown';this[_0xad93('0x13')]=0x0;this[_0xad93('0x14')]='';this['voiceStatusQueue']='';this[_0xad93('0x15')]=![];this[_0xad93('0x16')]=![];this['md5']='';}Agent[_0xad93('0x17')][_0xad93('0x18')]=function(_0x5b1493){var _0x59c499;if(_0x5b1493&&_0x5b1493[_0xad93('0xb')]){_0x59c499=_0x5b1493[_0xad93('0xb')]['toLowerCase']();switch(_0x59c499){case'not_inuse':_0x59c499=_0xad93('0x19');break;case _0xad93('0x1a'):_0x59c499=_0xad93('0x1b');break;}}if(_0x59c499&&this['voiceStatus']!==_0x59c499||_0x5b1493['statePause']){this[_0xad93('0x13')]=_['toNumber'](moment()['format']('x'));}if(_0x59c499){this[_0xad93('0x12')]=_0x59c499;}var _0x32767b={'id':this['id'],'name':this['name'],'email':this[_0xad93('0x8')],'accountcode':this['accountcode'],'fullname':this[_0xad93('0xa')],'state':this['state'],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xad93('0xe')],'online':this[_0xad93('0x11')],'voiceStatus':this[_0xad93('0x12')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xad93('0x1c')],'interface':this['interface'],'onhold':this[_0xad93('0x15')]};var _0x1c0cf9=md5(JSON['stringify'](_0x32767b));if(this['md5']!==_0x1c0cf9){this[_0xad93('0x2')]=_0x1c0cf9;io['to'](util[_0xad93('0x1d')]('user:%s',_0x32767b[_0xad93('0x7')]))[_0xad93('0x1e')](_0xad93('0x1f'),_0x32767b);io[_0xad93('0x1e')](_0xad93('0x20'),_0x32767b);}};module[_0xad93('0x21')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index dc87424..d5096ca 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 _0x1c7d=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x596a34,_0x33452a){var _0xdde740=function(_0x1722da){while(--_0x1722da){_0x596a34['push'](_0x596a34['shift']());}};_0xdde740(++_0x33452a);}(_0x1c7d,0x13b));var _0xd1c7=function(_0x26fd3b,_0x2023c9){_0x26fd3b=_0x26fd3b-0x0;var _0x3c8c4e=_0x1c7d[_0x26fd3b];return _0x3c8c4e;};'use strict';function Campaign(_0x2f7b2a){this['id']=_0x2f7b2a['id']||0x0;this['name']=_0x2f7b2a['name']||'';this[_0xd1c7('0x0')]=_0x2f7b2a['type']||_0xd1c7('0x1');this[_0xd1c7('0x2')]=0x0;this[_0xd1c7('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xd1c7('0x4')]=0x0;this['message']='';this[_0xd1c7('0x5')]=!![];this[_0xd1c7('0x6')]=_0x2f7b2a[_0xd1c7('0x6')];this[_0xd1c7('0x7')]=_0x2f7b2a[_0xd1c7('0x7')];this[_0xd1c7('0x8')]=_0x2f7b2a['dialTimezone']||null;this[_0xd1c7('0x9')]=_0x2f7b2a[_0xd1c7('0x9')]?_0x2f7b2a['dialGlobalInterval']:null;this[_0xd1c7('0xa')]=_0x2f7b2a[_0xd1c7('0xa')];this['dialOriginateCallerIdNumber']=_0x2f7b2a['dialOriginateCallerIdNumber'];this[_0xd1c7('0xb')]=_0x2f7b2a[_0xd1c7('0xb')]||0x1e;this[_0xd1c7('0xc')]=_0x2f7b2a[_0xd1c7('0xc')];this[_0xd1c7('0xd')]=_0x2f7b2a['dialCongestionRetryFrequency'];this[_0xd1c7('0xe')]=_0x2f7b2a['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x2f7b2a[_0xd1c7('0xf')];this[_0xd1c7('0x10')]=_0x2f7b2a[_0xd1c7('0x10')];this[_0xd1c7('0x11')]=_0x2f7b2a[_0xd1c7('0x11')];this[_0xd1c7('0x12')]=_0x2f7b2a[_0xd1c7('0x12')];this['dialNoSuchNumberMaxRetry']=_0x2f7b2a[_0xd1c7('0x13')]||0x3;this[_0xd1c7('0x14')]=_0x2f7b2a[_0xd1c7('0x14')]||0x96;this[_0xd1c7('0x15')]=_0x2f7b2a['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x2f7b2a[_0xd1c7('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x2f7b2a[_0xd1c7('0x17')]||0x3;this[_0xd1c7('0x18')]=_0x2f7b2a[_0xd1c7('0x18')]||0x96;this[_0xd1c7('0x19')]=_0x2f7b2a[_0xd1c7('0x19')]||0x3;this[_0xd1c7('0x1a')]=_0x2f7b2a[_0xd1c7('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x2f7b2a[_0xd1c7('0x1b')]||0x3;this[_0xd1c7('0x1c')]=_0x2f7b2a[_0xd1c7('0x1c')]||0x96;this[_0xd1c7('0x1d')]=_0x2f7b2a['dialOrderByScheduledAt']||'DESC';this['dialPrefix']=_0x2f7b2a[_0xd1c7('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2f7b2a[_0xd1c7('0x1f')]||undefined;this[_0xd1c7('0x20')]=_0x2f7b2a[_0xd1c7('0x20')]||undefined;this[_0xd1c7('0x21')]=_0x2f7b2a['TrunkBackup']?_0x2f7b2a['TrunkBackup']:undefined;this[_0xd1c7('0x22')]=_0x2f7b2a['Trunk']?_0x2f7b2a[_0xd1c7('0x22')]:undefined;this[_0xd1c7('0x23')]=_0x2f7b2a['Interval']?_0x2f7b2a[_0xd1c7('0x23')]:undefined;this[_0xd1c7('0x24')]=_0x2f7b2a[_0xd1c7('0x24')]?_0x2f7b2a[_0xd1c7('0x24')]:undefined;this[_0xd1c7('0x25')]=_0x2f7b2a['SquareProject']?_0x2f7b2a['SquareProject'][_0xd1c7('0x26')]:undefined;this['dialAMDActive']=_0x2f7b2a[_0xd1c7('0x27')]||![];this['dialAMDInitialSilence']=_0x2f7b2a['dialAMDInitialSilence'];this[_0xd1c7('0x28')]=_0x2f7b2a[_0xd1c7('0x28')];this['dialAMDAfterGreetingSilence']=_0x2f7b2a['dialAMDAfterGreetingSilence'];this[_0xd1c7('0x29')]=_0x2f7b2a[_0xd1c7('0x29')];this['dialAMDMinWordLength']=_0x2f7b2a['dialAMDMinWordLength'];this[_0xd1c7('0x2a')]=_0x2f7b2a[_0xd1c7('0x2a')];this[_0xd1c7('0x2b')]=_0x2f7b2a['dialAMDMaximumNumberOfWords'];this[_0xd1c7('0x2c')]=_0x2f7b2a[_0xd1c7('0x2c')];this[_0xd1c7('0x2d')]=_0x2f7b2a[_0xd1c7('0x2d')];}module[_0xd1c7('0x2e')]=Campaign; \ No newline at end of file +var _0xae61=['temp','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type'];(function(_0x4dfec4,_0x49a6cb){var _0x1f7ba8=function(_0x40184b){while(--_0x40184b){_0x4dfec4['push'](_0x4dfec4['shift']());}};_0x1f7ba8(++_0x49a6cb);}(_0xae61,0x1a5));var _0x1ae6=function(_0x3a6cb4,_0x31ae70){_0x3a6cb4=_0x3a6cb4-0x0;var _0xb5a45e=_0xae61[_0x3a6cb4];return _0xb5a45e;};'use strict';function Campaign(_0x19918e){this['id']=_0x19918e['id']||0x0;this[_0x1ae6('0x0')]=_0x19918e['name']||'';this[_0x1ae6('0x1')]=_0x19918e['type']||'campaign';this['originated']=0x0;this[_0x1ae6('0x2')]=0x0;this[_0x1ae6('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x1ae6('0x4')]='';this['sendMessageOneNotActive']=!![];this[_0x1ae6('0x5')]=_0x19918e[_0x1ae6('0x5')];this[_0x1ae6('0x6')]=_0x19918e['limitCalls'];this[_0x1ae6('0x7')]=_0x19918e['dialTimezone']||null;this[_0x1ae6('0x8')]=_0x19918e[_0x1ae6('0x8')]?_0x19918e[_0x1ae6('0x8')]:null;this[_0x1ae6('0x9')]=_0x19918e[_0x1ae6('0x9')];this[_0x1ae6('0xa')]=_0x19918e[_0x1ae6('0xa')];this[_0x1ae6('0xb')]=_0x19918e[_0x1ae6('0xb')]||0x1e;this[_0x1ae6('0xc')]=_0x19918e[_0x1ae6('0xc')];this['dialCongestionRetryFrequency']=_0x19918e[_0x1ae6('0xd')];this['dialBusyMaxRetry']=_0x19918e[_0x1ae6('0xe')];this[_0x1ae6('0xf')]=_0x19918e[_0x1ae6('0xf')];this['dialNoAnswerMaxRetry']=_0x19918e['dialNoAnswerMaxRetry'];this[_0x1ae6('0x10')]=_0x19918e[_0x1ae6('0x10')];this[_0x1ae6('0x11')]=_0x19918e[_0x1ae6('0x11')];this[_0x1ae6('0x12')]=_0x19918e[_0x1ae6('0x12')]||0x3;this[_0x1ae6('0x13')]=_0x19918e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x1ae6('0x14')]=_0x19918e['dialDropMaxRetry']||0x3;this[_0x1ae6('0x15')]=_0x19918e[_0x1ae6('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x19918e[_0x1ae6('0x16')]||0x3;this[_0x1ae6('0x17')]=_0x19918e[_0x1ae6('0x17')]||0x96;this['dialMachineMaxRetry']=_0x19918e[_0x1ae6('0x18')]||0x3;this[_0x1ae6('0x19')]=_0x19918e['dialMachineRetryFrequency']||0x96;this[_0x1ae6('0x1a')]=_0x19918e[_0x1ae6('0x1a')]||0x3;this[_0x1ae6('0x1b')]=_0x19918e[_0x1ae6('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x19918e['dialOrderByScheduledAt']||_0x1ae6('0x1c');this[_0x1ae6('0x1d')]=_0x19918e[_0x1ae6('0x1d')]||undefined;this[_0x1ae6('0x1e')]=_0x19918e[_0x1ae6('0x1e')]||undefined;this['dialCutDigit']=_0x19918e[_0x1ae6('0x1f')]||undefined;this[_0x1ae6('0x20')]=_0x19918e['TrunkBackup']?_0x19918e[_0x1ae6('0x20')]:undefined;this['Trunk']=_0x19918e[_0x1ae6('0x21')]?_0x19918e[_0x1ae6('0x21')]:undefined;this[_0x1ae6('0x22')]=_0x19918e[_0x1ae6('0x22')]?_0x19918e[_0x1ae6('0x22')]:undefined;this[_0x1ae6('0x23')]=_0x19918e['SquareProject']?_0x19918e[_0x1ae6('0x23')]:undefined;this[_0x1ae6('0x24')]=_0x19918e[_0x1ae6('0x23')]?_0x19918e[_0x1ae6('0x23')][_0x1ae6('0x0')]:undefined;this[_0x1ae6('0x25')]=_0x19918e[_0x1ae6('0x25')]||![];this['dialAMDInitialSilence']=_0x19918e['dialAMDInitialSilence'];this[_0x1ae6('0x26')]=_0x19918e[_0x1ae6('0x26')];this[_0x1ae6('0x27')]=_0x19918e[_0x1ae6('0x27')];this[_0x1ae6('0x28')]=_0x19918e['dialAMDTotalAnalysisTime'];this[_0x1ae6('0x29')]=_0x19918e[_0x1ae6('0x29')];this[_0x1ae6('0x2a')]=_0x19918e[_0x1ae6('0x2a')];this[_0x1ae6('0x2b')]=_0x19918e[_0x1ae6('0x2b')];this[_0x1ae6('0x2c')]=_0x19918e[_0x1ae6('0x2c')];this[_0x1ae6('0x2d')]=_0x19918e['dialAMDMaximumWordLength'];}module[_0x1ae6('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 81f43b5..b2ecc35 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 _0xce2f=['transfercalleridnum','transferconnectedlinenum','mohtime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','type','disposition','monitorFilename','monitors'];(function(_0x1e2e21,_0x3b5030){var _0x4be6e3=function(_0x33b009){while(--_0x33b009){_0x1e2e21['push'](_0x1e2e21['shift']());}};_0x4be6e3(++_0x3b5030);}(_0xce2f,0x18a));var _0xfce2=function(_0x56ed9a,_0x1cbf69){_0x56ed9a=_0x56ed9a-0x0;var _0x50d7e8=_0xce2f[_0x56ed9a];return _0x50d7e8;};'use strict';function Channel(){this['starttime']=null;this[_0xfce2('0x0')]='';this[_0xfce2('0x1')]='';this[_0xfce2('0x2')]=0x0;this[_0xfce2('0x3')]='';this[_0xfce2('0x4')]=undefined;this[_0xfce2('0x5')]=undefined;this['accountcode']=0x0;this[_0xfce2('0x6')]='';this['uniqueid']=0x0;this[_0xfce2('0x7')]=0x0;this['exten']=0x0;this[_0xfce2('0x8')]=![];this[_0xfce2('0x9')]=null;this[_0xfce2('0xa')]=null;this[_0xfce2('0xb')]=![];this[_0xfce2('0xc')]=![];this[_0xfce2('0xd')]='';this[_0xfce2('0xe')]='';this[_0xfce2('0xf')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xfce2('0x10')]=null;this['tag']=null;this[_0xfce2('0x11')]=null;this['monitor']=![];this[_0xfce2('0x12')]=null;this['queue']=null;this[_0xfce2('0x13')]=[];this[_0xfce2('0x14')]=undefined;this[_0xfce2('0x15')]=undefined;this['transferType']=undefined;this[_0xfce2('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x14d8=['connectedlinenum','accountcode','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0x1d0499,_0x23e22f){var _0x153fb3=function(_0x40c19c){while(--_0x40c19c){_0x1d0499['push'](_0x1d0499['shift']());}};_0x153fb3(++_0x23e22f);}(_0x14d8,0x87));var _0x814d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x14d8[_0x465028];return _0xb783d4;};'use strict';function Channel(){this[_0x814d('0x0')]=null;this[_0x814d('0x1')]='';this[_0x814d('0x2')]='';this[_0x814d('0x3')]=0x0;this[_0x814d('0x4')]='';this[_0x814d('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x814d('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x814d('0x7')]=0x0;this[_0x814d('0x8')]=![];this[_0x814d('0x9')]=null;this['endtime']=null;this[_0x814d('0xa')]=![];this[_0x814d('0xb')]=![];this[_0x814d('0xc')]='';this[_0x814d('0xd')]='';this[_0x814d('0xe')]=0x0;this[_0x814d('0xf')]=0x0;this[_0x814d('0x10')]=0x0;this['type']=null;this[_0x814d('0x11')]=null;this[_0x814d('0x12')]=null;this[_0x814d('0x13')]=![];this[_0x814d('0x14')]=null;this[_0x814d('0x15')]=null;this[_0x814d('0x16')]=[];this[_0x814d('0x17')]=undefined;this[_0x814d('0x18')]=undefined;this[_0x814d('0x19')]=undefined;this[_0x814d('0x1a')]=0x0;}module[_0x814d('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e14a217..a1eccbc 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 _0x6a44=['serverUrl','Configurations','exports','name','username','remoteUri','authType','consumerKey','token','tokenSecret','type'];(function(_0x2b7c49,_0x3c27f4){var _0x42d9c4=function(_0x19a36a){while(--_0x19a36a){_0x2b7c49['push'](_0x2b7c49['shift']());}};_0x42d9c4(++_0x3c27f4);}(_0x6a44,0x66));var _0x46a4=function(_0x4344a2,_0x51e1c2){_0x4344a2=_0x4344a2-0x0;var _0xbc5ff4=_0x6a44[_0x4344a2];return _0xbc5ff4;};'use strict';function DeskAccount(_0x54fbd6){this['id']=_0x54fbd6['id']||0x0;this[_0x46a4('0x0')]=_0x54fbd6[_0x46a4('0x0')]||'';this[_0x46a4('0x1')]=_0x54fbd6[_0x46a4('0x1')]||'';this[_0x46a4('0x2')]=_0x54fbd6[_0x46a4('0x2')]||'';this[_0x46a4('0x3')]=_0x54fbd6[_0x46a4('0x3')]||'';this['password']=_0x54fbd6['password']||'';this[_0x46a4('0x4')]=_0x54fbd6[_0x46a4('0x4')]||'';this['consumerSecret']=_0x54fbd6['consumerSecret']||'';this[_0x46a4('0x5')]=_0x54fbd6[_0x46a4('0x5')]||'';this[_0x46a4('0x6')]=_0x54fbd6['tokenSecret']||'';this[_0x46a4('0x7')]=_0x54fbd6['type']||'';this[_0x46a4('0x8')]=_0x54fbd6[_0x46a4('0x8')]||'';this[_0x46a4('0x9')]=_0x54fbd6[_0x46a4('0x9')]||{};}module[_0x46a4('0xa')]=DeskAccount; \ No newline at end of file +var _0x61e1=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerSecret'];(function(_0x1dc4cb,_0x1c8fe5){var _0x20333c=function(_0x268961){while(--_0x268961){_0x1dc4cb['push'](_0x1dc4cb['shift']());}};_0x20333c(++_0x1c8fe5);}(_0x61e1,0x1b6));var _0x161e=function(_0x2605be,_0x335d88){_0x2605be=_0x2605be-0x0;var _0x593cf9=_0x61e1[_0x2605be];return _0x593cf9;};'use strict';function DeskAccount(_0x5d36ff){this['id']=_0x5d36ff['id']||0x0;this['name']=_0x5d36ff[_0x161e('0x0')]||'';this[_0x161e('0x1')]=_0x5d36ff['username']||'';this['remoteUri']=_0x5d36ff[_0x161e('0x2')]||'';this[_0x161e('0x3')]=_0x5d36ff[_0x161e('0x3')]||'';this['password']=_0x5d36ff[_0x161e('0x4')]||'';this['consumerKey']=_0x5d36ff['consumerKey']||'';this[_0x161e('0x5')]=_0x5d36ff[_0x161e('0x5')]||'';this[_0x161e('0x6')]=_0x5d36ff['token']||'';this['tokenSecret']=_0x5d36ff[_0x161e('0x7')]||'';this[_0x161e('0x8')]=_0x5d36ff[_0x161e('0x8')]||'';this['serverUrl']=_0x5d36ff[_0x161e('0x9')]||'';this[_0x161e('0xa')]=_0x5d36ff['Configurations']||{};}module[_0x161e('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 5ff6556..366ad38 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 _0x5a7d=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x35cd12,_0x562113){var _0x48bf30=function(_0x1251ea){while(--_0x1251ea){_0x35cd12['push'](_0x35cd12['shift']());}};_0x48bf30(++_0x562113);}(_0x5a7d,0xc5));var _0xd5a7=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0x5a7d[_0xdefbc3];return _0x367798;};'use strict';function Dynamics365Account(_0x36fcd2){this['id']=_0x36fcd2['id']||0x0;this['name']=_0x36fcd2[_0xd5a7('0x0')]||'';this['username']=_0x36fcd2['username']||'';this[_0xd5a7('0x1')]=_0x36fcd2[_0xd5a7('0x1')]||'';this[_0xd5a7('0x2')]=_0x36fcd2['remoteUri']||'';this[_0xd5a7('0x3')]=_0x36fcd2[_0xd5a7('0x3')]||'';this[_0xd5a7('0x4')]=_0x36fcd2[_0xd5a7('0x4')]||'';this['clientSecret']=_0x36fcd2[_0xd5a7('0x5')]||{};this[_0xd5a7('0x6')]=_0x36fcd2[_0xd5a7('0x6')]||'';this[_0xd5a7('0x7')]=_0x36fcd2['modernAuthentication']||![];this[_0xd5a7('0x8')]=_0x36fcd2['Configurations']||{};this['CloudProvider']=_0x36fcd2[_0xd5a7('0x9')]||{};}module[_0xd5a7('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x29a0=['modernAuthentication','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x46fae8,_0x4f5cd3){var _0x5c80b5=function(_0x160770){while(--_0x160770){_0x46fae8['push'](_0x46fae8['shift']());}};_0x5c80b5(++_0x4f5cd3);}(_0x29a0,0xb3));var _0x029a=function(_0x1165e3,_0x23e2ab){_0x1165e3=_0x1165e3-0x0;var _0xf19867=_0x29a0[_0x1165e3];return _0xf19867;};'use strict';function Dynamics365Account(_0x2cb4dc){this['id']=_0x2cb4dc['id']||0x0;this['name']=_0x2cb4dc[_0x029a('0x0')]||'';this['username']=_0x2cb4dc[_0x029a('0x1')]||'';this[_0x029a('0x2')]=_0x2cb4dc['password']||'';this[_0x029a('0x3')]=_0x2cb4dc[_0x029a('0x3')]||'';this[_0x029a('0x4')]=_0x2cb4dc['tenantId']||'';this[_0x029a('0x5')]=_0x2cb4dc[_0x029a('0x5')]||'';this['clientSecret']=_0x2cb4dc[_0x029a('0x6')]||{};this[_0x029a('0x7')]=_0x2cb4dc[_0x029a('0x7')]||'';this[_0x029a('0x8')]=_0x2cb4dc[_0x029a('0x8')]||![];this[_0x029a('0x9')]=_0x2cb4dc[_0x029a('0x9')]||{};this['CloudProvider']=_0x2cb4dc['CloudProvider']||{};}module[_0x029a('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index c60b056..a038726 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 _0x796b=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','ecm'];(function(_0x19d832,_0x277ecc){var _0x411df6=function(_0x1473df){while(--_0x1473df){_0x19d832['push'](_0x19d832['shift']());}};_0x411df6(++_0x277ecc);}(_0x796b,0xa8));var _0xb796=function(_0x4e4f0e,_0x1c3892){_0x4e4f0e=_0x4e4f0e-0x0;var _0x1a7219=_0x796b[_0x4e4f0e];return _0x1a7219;};'use strict';function FaxAccount(_0x31eabf){this['id']=_0x31eabf['id']||0x0;this[_0xb796('0x0')]=_0x31eabf['name']||'';this['description']=_0x31eabf['description'];this[_0xb796('0x1')]=_0x31eabf[_0xb796('0x1')];this[_0xb796('0x2')]=_0x31eabf[_0xb796('0x2')];this[_0xb796('0x3')]=_0x31eabf['localstationid'];this['minrate']=_0x31eabf[_0xb796('0x4')]||0x960;this[_0xb796('0x5')]=_0x31eabf[_0xb796('0x5')]||0x3840;this['modem']=_0x31eabf[_0xb796('0x6')]||_0xb796('0x7');this[_0xb796('0x8')]=_0x31eabf[_0xb796('0x8')]||'no';this[_0xb796('0x9')]=_0x31eabf[_0xb796('0x9')]||'no';this[_0xb796('0xa')]=_0x31eabf[_0xb796('0xa')]||0x1388;this[_0xb796('0xb')]=_0x31eabf[_0xb796('0xb')]||_0xb796('0xc');this[_0xb796('0xd')]=_0x31eabf[_0xb796('0xd')]?_0x31eabf['Trunk']:undefined;this[_0xb796('0xe')]=_0x31eabf['ListId'];this['key']=_0x31eabf[_0xb796('0xf')];}module[_0xb796('0x10')]=FaxAccount; \ No newline at end of file +var _0x596e=['key','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x5061b9,_0x331b0c){var _0x27cba4=function(_0x4f3606){while(--_0x4f3606){_0x5061b9['push'](_0x5061b9['shift']());}};_0x27cba4(++_0x331b0c);}(_0x596e,0x16d));var _0xe596=function(_0x3fec3b,_0x1ea9cc){_0x3fec3b=_0x3fec3b-0x0;var _0x260577=_0x596e[_0x3fec3b];return _0x260577;};'use strict';function FaxAccount(_0x56b779){this['id']=_0x56b779['id']||0x0;this['name']=_0x56b779['name']||'';this[_0xe596('0x0')]=_0x56b779[_0xe596('0x0')];this['ecm']=_0x56b779['ecm'];this[_0xe596('0x1')]=_0x56b779['headerinfo'];this[_0xe596('0x2')]=_0x56b779[_0xe596('0x2')];this[_0xe596('0x3')]=_0x56b779['minrate']||0x960;this[_0xe596('0x4')]=_0x56b779[_0xe596('0x4')]||0x3840;this[_0xe596('0x5')]=_0x56b779[_0xe596('0x5')]||_0xe596('0x6');this[_0xe596('0x7')]=_0x56b779[_0xe596('0x7')]||'no';this['faxdetect']=_0x56b779['faxdetect']||'no';this[_0xe596('0x8')]=_0x56b779['t38timeout']||0x1388;this[_0xe596('0x9')]=_0x56b779[_0xe596('0x9')]||_0xe596('0xa');this[_0xe596('0xb')]=_0x56b779['Trunk']?_0x56b779['Trunk']:undefined;this[_0xe596('0xc')]=_0x56b779[_0xe596('0xc')];this[_0xe596('0xd')]=_0x56b779[_0xe596('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index afb8fbc..cef92ad 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 _0xb209=['name','username','token','serverUrl','Configurations'];(function(_0x2ded58,_0x579620){var _0x414afe=function(_0x42b803){while(--_0x42b803){_0x2ded58['push'](_0x2ded58['shift']());}};_0x414afe(++_0x579620);}(_0xb209,0x1d1));var _0x9b20=function(_0x132da2,_0x77cab5){_0x132da2=_0x132da2-0x0;var _0x1ace76=_0xb209[_0x132da2];return _0x1ace76;};'use strict';function FreshdeskAccount(_0x55977b){this['id']=_0x55977b['id']||0x0;this[_0x9b20('0x0')]=_0x55977b['name']||'';this[_0x9b20('0x1')]=_0x55977b[_0x9b20('0x1')]||'';this['apiKey']=_0x55977b[_0x9b20('0x2')]||'';this['remoteUri']=_0x55977b['remoteUri']||'';this[_0x9b20('0x3')]=_0x55977b[_0x9b20('0x3')]||'';this[_0x9b20('0x4')]=_0x55977b[_0x9b20('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xb844=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x4e3da2,_0x2780b2){var _0x497df4=function(_0x32651e){while(--_0x32651e){_0x4e3da2['push'](_0x4e3da2['shift']());}};_0x497df4(++_0x2780b2);}(_0xb844,0x1bd));var _0x4b84=function(_0x55cff0,_0x465259){_0x55cff0=_0x55cff0-0x0;var _0x51c6c9=_0xb844[_0x55cff0];return _0x51c6c9;};'use strict';function FreshdeskAccount(_0x2cb42a){this['id']=_0x2cb42a['id']||0x0;this[_0x4b84('0x0')]=_0x2cb42a[_0x4b84('0x0')]||'';this[_0x4b84('0x1')]=_0x2cb42a[_0x4b84('0x1')]||'';this['apiKey']=_0x2cb42a[_0x4b84('0x2')]||'';this[_0x4b84('0x3')]=_0x2cb42a[_0x4b84('0x3')]||'';this[_0x4b84('0x4')]=_0x2cb42a[_0x4b84('0x4')]||'';this[_0x4b84('0x5')]=_0x2cb42a[_0x4b84('0x5')]||{};}module[_0x4b84('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 91308b6..359dc9e 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 _0x1928=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1928,0x138));var _0x8192=function(_0x129c46,_0x310abf){_0x129c46=_0x129c46-0x0;var _0x7ec3ee=_0x1928[_0x129c46];return _0x7ec3ee;};'use strict';function FreshsalesAccount(_0x4f1a64){this['id']=_0x4f1a64['id']||0x0;this[_0x8192('0x0')]=_0x4f1a64[_0x8192('0x0')]||'';this['username']=_0x4f1a64[_0x8192('0x1')]||'';this[_0x8192('0x2')]=_0x4f1a64[_0x8192('0x3')]||'';this[_0x8192('0x4')]=_0x4f1a64[_0x8192('0x4')]||'';this[_0x8192('0x5')]=_0x4f1a64[_0x8192('0x5')]||'';this[_0x8192('0x6')]=_0x4f1a64[_0x8192('0x6')]||{};}module[_0x8192('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x31af=['name','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x31af,0xde));var _0xf31a=function(_0xb5586,_0x4793c3){_0xb5586=_0xb5586-0x0;var _0x284ad0=_0x31af[_0xb5586];return _0x284ad0;};'use strict';function FreshsalesAccount(_0x3c3137){this['id']=_0x3c3137['id']||0x0;this[_0xf31a('0x0')]=_0x3c3137[_0xf31a('0x0')]||'';this['username']=_0x3c3137['username']||'';this[_0xf31a('0x1')]=_0x3c3137['token']||'';this[_0xf31a('0x2')]=_0x3c3137[_0xf31a('0x2')]||'';this[_0xf31a('0x3')]=_0x3c3137[_0xf31a('0x3')]||'';this['Configurations']=_0x3c3137[_0xf31a('0x4')]||{};}module[_0xf31a('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c01299b..067f97b 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 _0x8f06=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','type','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit'];(function(_0x257166,_0x2640ae){var _0x50cddc=function(_0x266557){while(--_0x266557){_0x257166['push'](_0x257166['shift']());}};_0x50cddc(++_0x2640ae);}(_0x8f06,0x10a));var _0x68f0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8f06[_0x2dafbe];return _0x58a45a;};'use strict';function QueueReport(){this[_0x68f0('0x0')]='inbound';this['uniqueid']='';this[_0x68f0('0x1')]='';this[_0x68f0('0x2')]='';this[_0x68f0('0x3')]='';this[_0x68f0('0x4')]=null;this['queuecallerleaveAt']=null;this[_0x68f0('0x5')]=0x1;this[_0x68f0('0x6')]=0x1;this['queuecallerabandon']=![];this[_0x68f0('0x7')]=null;this['queuecallercomplete']=![];this[_0x68f0('0x8')]=null;this[_0x68f0('0x9')]=![];this[_0x68f0('0xa')]=null;this[_0x68f0('0xb')]=0x1;this[_0x68f0('0xc')]='';this[_0x68f0('0xd')]='';this[_0x68f0('0xe')]='';this[_0x68f0('0xf')]='';this[_0x68f0('0x10')]='';this['exten']='';this['priority']='';this[_0x68f0('0x11')]=0x0;this[_0x68f0('0x12')]=![];this[_0x68f0('0x13')]='';this[_0x68f0('0x14')]=_0x68f0('0x15');this['routealias']=null;this['mohtime']=0x0;this[_0x68f0('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xa3a7=['routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x4cff4f,_0x14ba4f){var _0x5d9275=function(_0x402678){while(--_0x402678){_0x4cff4f['push'](_0x4cff4f['shift']());}};_0x5d9275(++_0x14ba4f);}(_0xa3a7,0x100));var _0x7a3a=function(_0x125016,_0x17a721){_0x125016=_0x125016-0x0;var _0x35f491=_0xa3a7[_0x125016];return _0x35f491;};'use strict';function QueueReport(){this[_0x7a3a('0x0')]=_0x7a3a('0x1');this[_0x7a3a('0x2')]='';this[_0x7a3a('0x3')]='';this[_0x7a3a('0x4')]='';this[_0x7a3a('0x5')]='';this[_0x7a3a('0x6')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x7a3a('0x7')]=0x1;this[_0x7a3a('0x8')]=![];this[_0x7a3a('0x9')]=null;this[_0x7a3a('0xa')]=![];this[_0x7a3a('0xb')]=null;this['queuecallerexit']=![];this[_0x7a3a('0xc')]=null;this[_0x7a3a('0xd')]=0x1;this['channel']='';this[_0x7a3a('0xe')]='';this[_0x7a3a('0xf')]='';this['accountcode']='';this[_0x7a3a('0x10')]='';this[_0x7a3a('0x11')]='';this[_0x7a3a('0x12')]='';this[_0x7a3a('0x13')]=0x0;this[_0x7a3a('0x14')]=![];this[_0x7a3a('0x15')]='';this[_0x7a3a('0x16')]=_0x7a3a('0x17');this[_0x7a3a('0x18')]=null;this[_0x7a3a('0x19')]=0x0;this[_0x7a3a('0x1a')]={};}module[_0x7a3a('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 7299c0b..7e56406 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 _0xf777=['securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xf777,0x1e9));var _0x7f77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf777[_0x20a584];return _0x4b41a8;};'use strict';function SalesforceAccount(_0x4113a4){this['id']=_0x4113a4['id']||0x0;this[_0x7f77('0x0')]=_0x4113a4[_0x7f77('0x0')]||'';this[_0x7f77('0x1')]=_0x4113a4[_0x7f77('0x1')]||'';this[_0x7f77('0x2')]=_0x4113a4[_0x7f77('0x2')]||'';this[_0x7f77('0x3')]=_0x4113a4[_0x7f77('0x3')]||'';this['clientId']=_0x4113a4[_0x7f77('0x4')]||'';this[_0x7f77('0x5')]=_0x4113a4['clientSecret']||'';this[_0x7f77('0x6')]=_0x4113a4['securityToken']||'';this[_0x7f77('0x7')]=_0x4113a4['type']||_0x7f77('0x8');this[_0x7f77('0x9')]=_0x4113a4[_0x7f77('0x9')]||'';this[_0x7f77('0xa')]=_0x4113a4[_0x7f77('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x01b5=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x1bd926,_0xd8d307){var _0x2f2cf7=function(_0x4ec05f){while(--_0x4ec05f){_0x1bd926['push'](_0x1bd926['shift']());}};_0x2f2cf7(++_0xd8d307);}(_0x01b5,0xca));var _0x501b=function(_0x4b0fa7,_0x216430){_0x4b0fa7=_0x4b0fa7-0x0;var _0x46cc6b=_0x01b5[_0x4b0fa7];return _0x46cc6b;};'use strict';function SalesforceAccount(_0x232f79){this['id']=_0x232f79['id']||0x0;this[_0x501b('0x0')]=_0x232f79[_0x501b('0x0')]||'';this[_0x501b('0x1')]=_0x232f79[_0x501b('0x1')]||'';this[_0x501b('0x2')]=_0x232f79['remoteUri']||'';this[_0x501b('0x3')]=_0x232f79[_0x501b('0x3')]||'';this[_0x501b('0x4')]=_0x232f79[_0x501b('0x4')]||'';this['clientSecret']=_0x232f79[_0x501b('0x5')]||'';this[_0x501b('0x6')]=_0x232f79[_0x501b('0x6')]||'';this['type']=_0x232f79[_0x501b('0x7')]||_0x501b('0x8');this[_0x501b('0x9')]=_0x232f79['serverUrl']||'';this[_0x501b('0xa')]=_0x232f79[_0x501b('0xa')]||{};}module[_0x501b('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9f4cdc3..bf220d9 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 _0xe6e0=['remoteUri','serverUrl','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6e0,0x139));var _0x0e6e=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xe6e0[_0x5f1391];return _0x50ebe3;};'use strict';function ServicenowAccount(_0x3e9108){this['id']=_0x3e9108['id']||0x0;this[_0x0e6e('0x0')]=_0x3e9108['name']||'';this[_0x0e6e('0x1')]=_0x3e9108[_0x0e6e('0x1')]||'';this['password']=_0x3e9108['password']||'';this[_0x0e6e('0x2')]=_0x3e9108[_0x0e6e('0x2')]||'';this[_0x0e6e('0x3')]=_0x3e9108[_0x0e6e('0x3')]||'';this['Configurations']=_0x3e9108['Configurations']||{};}module[_0x0e6e('0x4')]=ServicenowAccount; \ No newline at end of file +var _0x41f6=['serverUrl','Configurations','name','username','remoteUri'];(function(_0x5e4a4c,_0x1b8d7e){var _0x1afefb=function(_0x2f4eb0){while(--_0x2f4eb0){_0x5e4a4c['push'](_0x5e4a4c['shift']());}};_0x1afefb(++_0x1b8d7e);}(_0x41f6,0x174));var _0x641f=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x41f6[_0x26fc81];return _0x9feece;};'use strict';function ServicenowAccount(_0x34531f){this['id']=_0x34531f['id']||0x0;this[_0x641f('0x0')]=_0x34531f[_0x641f('0x0')]||'';this['username']=_0x34531f[_0x641f('0x1')]||'';this['password']=_0x34531f['password']||'';this[_0x641f('0x2')]=_0x34531f[_0x641f('0x2')]||'';this[_0x641f('0x3')]=_0x34531f[_0x641f('0x3')]||'';this['Configurations']=_0x34531f[_0x641f('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 3dbbaf6..67c6fb2 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 _0x22ce=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xb29bef,_0x45aff1){var _0x878163=function(_0xa270a1){while(--_0xa270a1){_0xb29bef['push'](_0xb29bef['shift']());}};_0x878163(++_0x45aff1);}(_0x22ce,0xd3));var _0xe22c=function(_0x1c3373,_0x28acd6){_0x1c3373=_0x1c3373-0x0;var _0x55614e=_0x22ce[_0x1c3373];return _0x55614e;};'use strict';function SugarcrmAccount(_0x3d556c){this['id']=_0x3d556c['id']||0x0;this[_0xe22c('0x0')]=_0x3d556c[_0xe22c('0x0')]||'';this[_0xe22c('0x1')]=_0x3d556c[_0xe22c('0x1')]||'';this[_0xe22c('0x2')]=_0x3d556c[_0xe22c('0x2')]||'';this[_0xe22c('0x3')]=_0x3d556c['remoteUri']||'';this[_0xe22c('0x4')]=_0x3d556c[_0xe22c('0x4')]||'';this['Configurations']=_0x3d556c[_0xe22c('0x5')]||{};}module[_0xe22c('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x65f9=['serverUrl','Configurations','exports','name','username','password'];(function(_0x38b67a,_0xd27c3c){var _0x1052f8=function(_0x2e55d3){while(--_0x2e55d3){_0x38b67a['push'](_0x38b67a['shift']());}};_0x1052f8(++_0xd27c3c);}(_0x65f9,0xa5));var _0x965f=function(_0x311204,_0x5b965d){_0x311204=_0x311204-0x0;var _0x411918=_0x65f9[_0x311204];return _0x411918;};'use strict';function SugarcrmAccount(_0x5e0e62){this['id']=_0x5e0e62['id']||0x0;this[_0x965f('0x0')]=_0x5e0e62[_0x965f('0x0')]||'';this[_0x965f('0x1')]=_0x5e0e62['username']||'';this[_0x965f('0x2')]=_0x5e0e62[_0x965f('0x2')]||'';this['remoteUri']=_0x5e0e62['remoteUri']||'';this['serverUrl']=_0x5e0e62[_0x965f('0x3')]||'';this['Configurations']=_0x5e0e62[_0x965f('0x4')]||{};}module[_0x965f('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 334cac7..007cad8 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 _0x3612=['exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x2d05dc,_0x328d03){var _0x2d9ebe=function(_0x578a7e){while(--_0x578a7e){_0x2d05dc['push'](_0x2d05dc['shift']());}};_0x2d9ebe(++_0x328d03);}(_0x3612,0x189));var _0x2361=function(_0x4f74a5,_0x1fd979){_0x4f74a5=_0x4f74a5-0x0;var _0x5be8b2=_0x3612[_0x4f74a5];return _0x5be8b2;};'use strict';function Telephone(_0x1601be){this['id']=_0x1601be['id']||0x0;this['name']=_0x1601be[_0x2361('0x0')]||'';this[_0x2361('0x1')]=_0x1601be[_0x2361('0x1')]||'';this[_0x2361('0x2')]=_0x2361('0x3');this[_0x2361('0x4')]=0x0;this[_0x2361('0x5')]=_0x2361('0x3');this['address']='';}module[_0x2361('0x6')]=Telephone; \ No newline at end of file +var _0x4641=['unknown','stateTime','status','address','name','accountcode','state'];(function(_0x4069fa,_0x3ef590){var _0x2e3ca4=function(_0x247ea5){while(--_0x247ea5){_0x4069fa['push'](_0x4069fa['shift']());}};_0x2e3ca4(++_0x3ef590);}(_0x4641,0x185));var _0x1464=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x4641[_0x413feb];return _0x40ee88;};'use strict';function Telephone(_0x2482bd){this['id']=_0x2482bd['id']||0x0;this[_0x1464('0x0')]=_0x2482bd[_0x1464('0x0')]||'';this[_0x1464('0x1')]=_0x2482bd[_0x1464('0x1')]||'';this[_0x1464('0x2')]=_0x1464('0x3');this[_0x1464('0x4')]=0x0;this[_0x1464('0x5')]='unknown';this[_0x1464('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 1206e60..d471d72 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x232bd5,_0x4d1bd5){var _0x9e4a57=function(_0x17d5d9){while(--_0x17d5d9){_0x232bd5['push'](_0x232bd5['shift']());}};_0x9e4a57(++_0x4d1bd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x70fdc5,_0x3628f2){var _0x81d1e5=function(_0x46bd4f){while(--_0x46bd4f){_0x70fdc5['push'](_0x70fdc5['shift']());}};_0x81d1e5(++_0x3628f2);}(_0xb10b,0x12a));var _0xbb10=function(_0x33875d,_0xf2f624){_0x33875d=_0x33875d-0x0;var _0x477086=_0xb10b[_0x33875d];return _0x477086;};'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 fc833da..7e5871d 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1a85,0x178));var _0x51a8=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x1a85[_0x119cd8];return _0x7072a3;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x108db1,_0x89896d){_0x108db1=_0x108db1-0x0;var _0x16848d=_0x0b0e[_0x108db1];return _0x16848d;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 483a848..180c69b 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 _0xd47c=['name','state','stateTime','status','unknown','registry','indexOf','port','domain','domainport','registrationtime','defaultuser','active'];(function(_0x5eab61,_0x20bdc7){var _0x39276a=function(_0x49ffcd){while(--_0x49ffcd){_0x5eab61['push'](_0x5eab61['shift']());}};_0x39276a(++_0x20bdc7);}(_0xd47c,0x1ac));var _0xcd47=function(_0xb02f94,_0x2cf97a){_0xb02f94=_0xb02f94-0x0;var _0x3b481e=_0xd47c[_0xb02f94];return _0x3b481e;};'use strict';function Trunk(_0x6f3477){this['id']=_0x6f3477['id']||0x0;this[_0xcd47('0x0')]=_0x6f3477[_0xcd47('0x0')]||![];this[_0xcd47('0x1')]=_0x6f3477[_0xcd47('0x1')]||'';this[_0xcd47('0x2')]='unknown';this[_0xcd47('0x3')]=0x0;this[_0xcd47('0x4')]=_0xcd47('0x5');this[_0xcd47('0x6')]=_0x6f3477[_0xcd47('0x6')]&&_0x6f3477[_0xcd47('0x6')][_0xcd47('0x7')](':')?_0x6f3477['registry']['split'](':')[0x0]:'';this['host']='';this[_0xcd47('0x8')]='';this[_0xcd47('0x9')]='';this[_0xcd47('0xa')]='';this['refresh']='';this['stateRegistry']=_0xcd47('0x5');this[_0xcd47('0xb')]='';this['address']='';this['defaultuser']=_0x6f3477[_0xcd47('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x1957=['domain','stateRegistry','defaultuser','exports','active','name','state','unknown','registry','split','host','port'];(function(_0x40b19e,_0x51f6ec){var _0x423c2f=function(_0x59ec4a){while(--_0x59ec4a){_0x40b19e['push'](_0x40b19e['shift']());}};_0x423c2f(++_0x51f6ec);}(_0x1957,0x184));var _0x7195=function(_0x17cdd6,_0x94ae6d){_0x17cdd6=_0x17cdd6-0x0;var _0x42970a=_0x1957[_0x17cdd6];return _0x42970a;};'use strict';function Trunk(_0x561b59){this['id']=_0x561b59['id']||0x0;this['active']=_0x561b59[_0x7195('0x0')]||![];this[_0x7195('0x1')]=_0x561b59[_0x7195('0x1')]||'';this[_0x7195('0x2')]=_0x7195('0x3');this['stateTime']=0x0;this['status']=_0x7195('0x3');this[_0x7195('0x4')]=_0x561b59[_0x7195('0x4')]&&_0x561b59['registry']['indexOf'](':')?_0x561b59['registry'][_0x7195('0x5')](':')[0x0]:'';this[_0x7195('0x6')]='';this[_0x7195('0x7')]='';this[_0x7195('0x8')]='';this['domainport']='';this['refresh']='';this[_0x7195('0x9')]='unknown';this['registrationtime']='';this['address']='';this[_0x7195('0xa')]=_0x561b59[_0x7195('0xa')]||'';}module[_0x7195('0xb')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 5c03878..af2ceca 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 _0x06ec=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x426677,_0x54e1ec){var _0xd3af03=function(_0x4afa6b){while(--_0x4afa6b){_0x426677['push'](_0x426677['shift']());}};_0xd3af03(++_0x54e1ec);}(_0x06ec,0x176));var _0xc06e=function(_0x1a43bf,_0xc4b431){_0x1a43bf=_0x1a43bf-0x0;var _0x5e733f=_0x06ec[_0x1a43bf];return _0x5e733f;};'use strict';function voiceExtension(_0x5bf2d4){this['id']=_0x5bf2d4['id']||0x0;this['exten']=_0x5bf2d4[_0xc06e('0x0')]||'';this[_0xc06e('0x1')]=_0x5bf2d4[_0xc06e('0x1')]||_0xc06e('0x2');this['mandatoryDisposition']=_0x5bf2d4[_0xc06e('0x3')]||![];}module[_0xc06e('0x4')]=voiceExtension; \ No newline at end of file +var _0xbf69=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x21f393,_0x4375ef){var _0x2e28e5=function(_0x373d66){while(--_0x373d66){_0x21f393['push'](_0x21f393['shift']());}};_0x2e28e5(++_0x4375ef);}(_0xbf69,0x70));var _0x9bf6=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xbf69[_0x1589dd];return _0x1bddd1;};'use strict';function voiceExtension(_0x55695b){this['id']=_0x55695b['id']||0x0;this[_0x9bf6('0x0')]=_0x55695b[_0x9bf6('0x0')]||'';this[_0x9bf6('0x1')]=_0x55695b['recordingFormat']||_0x9bf6('0x2');this[_0x9bf6('0x3')]=_0x55695b[_0x9bf6('0x3')]||![];}module[_0x9bf6('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b6894c2..1b1884c 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 _0x6851=['dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','leastrecent','linear','random','ringall','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumBillable','abandoned','available','busy','inUse','invalid','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','originated','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x1422d0,_0x57f03c){var _0x3d5850=function(_0x1d211c){while(--_0x1d211c){_0x1422d0['push'](_0x1422d0['shift']());}};_0x3d5850(++_0x57f03c);}(_0x6851,0x1df));var _0x1685=function(_0x1d3541,_0xc5a50a){_0x1d3541=_0x1d3541-0x0;var _0x2e047a=_0x6851[_0x1d3541];return _0x2e047a;};'use strict';var monitorFormat={'wav':_0x1685('0x0'),'wav49':'wav49','gsm':_0x1685('0x1')};var strategy={'fewestcalls':_0x1685('0x2'),'leastrecent':_0x1685('0x3'),'linear':_0x1685('0x4'),'random':_0x1685('0x5'),'ringall':_0x1685('0x6'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0x1685('0x7'),'wrandom':_0x1685('0x8')};function VoiceQueue(_0x590a99){this['id']=_0x590a99['id']||0x0;this[_0x1685('0x9')]=_0x590a99[_0x1685('0x9')]||'';this[_0x1685('0xa')]=_0x590a99['monitor_format']||'';this['type']=_0x590a99[_0x1685('0xb')]||_0x1685('0xc');this[_0x1685('0xd')]=0x0;this[_0x1685('0xe')]=0x0;this[_0x1685('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x1685('0x10')]=0x0;this['unmanaged']=0x0;this[_0x1685('0x11')]=0x0;this[_0x1685('0x12')]=0x0;this[_0x1685('0x13')]=0x0;this[_0x1685('0x14')]=0x0;this[_0x1685('0x15')]=0x0;this[_0x1685('0x16')]=0x0;this['notInUse']=0x0;this[_0x1685('0x17')]=0x0;this[_0x1685('0x18')]=0x0;this[_0x1685('0x19')]=0x0;this[_0x1685('0x1a')]=0x0;this[_0x1685('0x1b')]=0x0;this[_0x1685('0x1c')]=0x0;this[_0x1685('0x1d')]=0x0;this[_0x1685('0x1e')]=_0x590a99[_0x1685('0x1e')]||![];this[_0x1685('0x1f')]=_0x590a99[_0x1685('0x1f')]||0xa;this[_0x1685('0x20')]=_0x590a99[_0x1685('0x20')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x1685('0x21')]='';this[_0x1685('0x22')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x590a99['dialTimezone']||null;this[_0x1685('0x23')]=_0x590a99[_0x1685('0x23')]?_0x590a99[_0x1685('0x23')]:null;this['dialActive']=_0x590a99[_0x1685('0x24')];this['dialMethod']=_0x590a99[_0x1685('0x25')]||'progressive';this['dialLimitChannel']=_0x590a99[_0x1685('0x26')]||0x0;this[_0x1685('0x27')]=_0x590a99[_0x1685('0x27')]||0x0;this[_0x1685('0x28')]=_0x590a99[_0x1685('0x28')]||0x1;this[_0x1685('0x29')]=_0x590a99['dialPredictiveOptimization']||_0x1685('0x2a');this[_0x1685('0x2b')]=_0x590a99['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x590a99[_0x1685('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x590a99[_0x1685('0x2d')]||_0x1685('0x2e');this[_0x1685('0x2f')]=_0x590a99[_0x1685('0x2f')]||_0x1685('0x2e');this[_0x1685('0x30')]=_0x590a99[_0x1685('0x30')]||0x1e;this['dialQueueOptions']=_0x590a99[_0x1685('0x31')]||_0x1685('0x32');this['dialQueueTimeout']=_0x590a99[_0x1685('0x33')]||0x3;this[_0x1685('0x34')]=_0x590a99[_0x1685('0x34')]||undefined;this[_0x1685('0x35')]=_0x590a99['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x590a99[_0x1685('0x36')]||0x96;this[_0x1685('0x37')]=_0x590a99[_0x1685('0x37')]||0x3;this[_0x1685('0x38')]=_0x590a99[_0x1685('0x38')]||0x96;this[_0x1685('0x39')]=_0x590a99['dialNoAnswerMaxRetry']||0x3;this[_0x1685('0x3a')]=_0x590a99['dialNoAnswerRetryFrequency']||0x96;this[_0x1685('0x3b')]=_0x590a99[_0x1685('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x590a99[_0x1685('0x3c')]||0x96;this[_0x1685('0x3d')]=_0x590a99['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x590a99[_0x1685('0x3e')]||0x96;this[_0x1685('0x3f')]=_0x590a99[_0x1685('0x3f')]||0x3;this['dialAbandonedRetryFrequency']=_0x590a99[_0x1685('0x40')]||0x96;this[_0x1685('0x41')]=_0x590a99[_0x1685('0x41')]||0x3;this[_0x1685('0x42')]=_0x590a99[_0x1685('0x42')]||0x96;this[_0x1685('0x43')]=_0x590a99[_0x1685('0x43')]||0x3;this[_0x1685('0x44')]=_0x590a99[_0x1685('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x590a99[_0x1685('0x45')]||0x3;this[_0x1685('0x46')]=_0x590a99['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x590a99[_0x1685('0x47')]?_0x590a99[_0x1685('0x47')]:undefined;this[_0x1685('0x48')]=_0x590a99['TrunkBackup']?_0x590a99[_0x1685('0x48')]:undefined;this['dialPrefix']=_0x590a99[_0x1685('0x49')]||undefined;this['Interval']=_0x590a99['Interval']?_0x590a99[_0x1685('0x4a')]:undefined;this[_0x1685('0x4b')]=_0x590a99[_0x1685('0x4b')]||_0x1685('0x4c');this[_0x1685('0x4d')]=_0x590a99['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x1685('0x4e')]=_0x590a99[_0x1685('0x4e')]||undefined;this['strategy']=strategy[_0x590a99[_0x1685('0x4f')]];this[_0x1685('0x50')]=!![];this[_0x1685('0x51')]=_0x590a99[_0x1685('0x51')]||![];this[_0x1685('0x52')]=_0x590a99['dialAMDInitialSilence'];this[_0x1685('0x53')]=_0x590a99[_0x1685('0x53')];this['dialAMDAfterGreetingSilence']=_0x590a99['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x590a99[_0x1685('0x54')];this['dialAMDMinWordLength']=_0x590a99[_0x1685('0x55')];this[_0x1685('0x56')]=_0x590a99['dialAMDBetweenWordsSilence'];this[_0x1685('0x57')]=_0x590a99['dialAMDMaximumNumberOfWords'];this[_0x1685('0x58')]=_0x590a99[_0x1685('0x58')];this[_0x1685('0x59')]=_0x590a99[_0x1685('0x59')];this[_0x1685('0x5a')]=0x0;this[_0x1685('0x5b')]=0x0;this[_0x1685('0x5c')]=_0x590a99[_0x1685('0x5c')];this[_0x1685('0x5d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x1685('0x5e')]=0x0;this[_0x1685('0x5f')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x1685('0x60')]=0x0;this[_0x1685('0x61')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x1685('0x62')]=0x0;this[_0x1685('0x63')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x1685('0x64')]=0x0;this[_0x1685('0x65')]=0x0;this[_0x1685('0x66')]=undefined;this[_0x1685('0x67')]=undefined;this[_0x1685('0x68')]=undefined;this[_0x1685('0x69')]=1.05;this[_0x1685('0x6a')]=0x0;this[_0x1685('0x6b')]=0x0;this[_0x1685('0x6c')]=0x0;this[_0x1685('0x6d')]=0x0;this[_0x1685('0x6e')]=0x0;this[_0x1685('0x6f')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x1685('0x70')]=0x0;this[_0x1685('0x71')]=_0x590a99[_0x1685('0x72')]||0x14;this[_0x1685('0x73')]=_0x590a99[_0x1685('0x72')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x1685('0x74')]=0x0;this[_0x1685('0x75')]=0x1;this['erlangCalls']=0x0;this[_0x1685('0x76')]=0x0;this[_0x1685('0x77')]=0x0;this[_0x1685('0x78')]=0x0;this[_0x1685('0x79')]=_0x590a99[_0x1685('0x79')]||0x1e;this[_0x1685('0x7a')]=_0x590a99[_0x1685('0x7a')]||![];this[_0x1685('0x7b')]=!!_0x590a99['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x590a99[_0x1685('0x7c')]||![];this[_0x1685('0x7d')]=_0x590a99['dialQueueProject2']||undefined;this[_0x1685('0x7e')]=_0x590a99[_0x1685('0x7e')]||![];this[_0x1685('0x7f')]=_0x590a99[_0x1685('0x7f')]||![];this[_0x1685('0xa')]=monitorFormat[_0x590a99[_0x1685('0xa')]]?monitorFormat[_0x590a99[_0x1685('0xa')]]:undefined;this['mandatoryDisposition']=_0x590a99['mandatoryDisposition']||![];this[_0x1685('0x80')]=_0x590a99[_0x1685('0x80')]?_0x590a99[_0x1685('0x80')]:undefined;this[_0x1685('0x81')]=![];}module[_0x1685('0x82')]=VoiceQueue; \ No newline at end of file +var _0xc1fc=['predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav49','gsm','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','dialTimezone','dialGlobalInterval','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0xc1fc,0x93));var _0xcc1f=function(_0x101899,_0x3fb12a){_0x101899=_0x101899-0x0;var _0x1d67e2=_0xc1fc[_0x101899];return _0x1d67e2;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xcc1f('0x0'),'gsm':_0xcc1f('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xcc1f('0x2'),'linear':_0xcc1f('0x3'),'random':_0xcc1f('0x4'),'ringall':_0xcc1f('0x5'),'rr':_0xcc1f('0x6'),'rrmemory':_0xcc1f('0x7'),'rrordered':_0xcc1f('0x8'),'wrandom':_0xcc1f('0x9')};function VoiceQueue(_0x493a97){this['id']=_0x493a97['id']||0x0;this['name']=_0x493a97[_0xcc1f('0xa')]||'';this[_0xcc1f('0xb')]=_0x493a97[_0xcc1f('0xb')]||'';this[_0xcc1f('0xc')]=_0x493a97[_0xcc1f('0xc')]||'inbound';this['waiting']=0x0;this['total']=0x0;this[_0xcc1f('0xd')]=0x0;this[_0xcc1f('0xe')]=0x0;this[_0xcc1f('0xf')]=0x0;this[_0xcc1f('0x10')]=0x0;this[_0xcc1f('0x11')]=0x0;this[_0xcc1f('0x12')]=0x0;this[_0xcc1f('0x13')]=0x0;this[_0xcc1f('0x14')]=0x0;this[_0xcc1f('0x15')]=0x0;this['invalid']=0x0;this[_0xcc1f('0x16')]=0x0;this[_0xcc1f('0x17')]=0x0;this[_0xcc1f('0x18')]=0x0;this[_0xcc1f('0x19')]=0x0;this[_0xcc1f('0x1a')]=0x0;this[_0xcc1f('0x1b')]=0x0;this[_0xcc1f('0x1c')]=0x0;this['unavailable']=0x0;this[_0xcc1f('0x1d')]=0x0;this[_0xcc1f('0x1e')]=_0x493a97[_0xcc1f('0x1e')]||![];this[_0xcc1f('0x1f')]=_0x493a97[_0xcc1f('0x1f')]||0xa;this[_0xcc1f('0x20')]=_0x493a97[_0xcc1f('0x20')]||'no';this[_0xcc1f('0x21')]=!![];this[_0xcc1f('0x22')]='';this[_0xcc1f('0x23')]='';this['originated']=0x0;this['temp']=0x0;this[_0xcc1f('0x24')]=_0x493a97[_0xcc1f('0x24')]||null;this[_0xcc1f('0x25')]=_0x493a97['dialGlobalInterval']?_0x493a97[_0xcc1f('0x25')]:null;this['dialActive']=_0x493a97['dialActive'];this[_0xcc1f('0x26')]=_0x493a97[_0xcc1f('0x26')]||'progressive';this[_0xcc1f('0x27')]=_0x493a97[_0xcc1f('0x27')]||0x0;this[_0xcc1f('0x28')]=_0x493a97[_0xcc1f('0x28')]||0x0;this[_0xcc1f('0x29')]=_0x493a97[_0xcc1f('0x29')]||0x1;this['dialPredictiveOptimization']=_0x493a97[_0xcc1f('0x2a')]||'dropRate';this[_0xcc1f('0x2b')]=_0x493a97[_0xcc1f('0x2b')]||0.03;this[_0xcc1f('0x2c')]=_0x493a97[_0xcc1f('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x493a97[_0xcc1f('0x2d')]||_0xcc1f('0x2e');this[_0xcc1f('0x2f')]=_0x493a97[_0xcc1f('0x2f')]||_0xcc1f('0x2e');this[_0xcc1f('0x30')]=_0x493a97[_0xcc1f('0x30')]||0x1e;this['dialQueueOptions']=_0x493a97[_0xcc1f('0x31')]||_0xcc1f('0x32');this[_0xcc1f('0x33')]=_0x493a97[_0xcc1f('0x33')]||0x3;this[_0xcc1f('0x34')]=_0x493a97[_0xcc1f('0x34')]||undefined;this[_0xcc1f('0x35')]=_0x493a97[_0xcc1f('0x35')]||0x3;this['dialCongestionRetryFrequency']=_0x493a97[_0xcc1f('0x36')]||0x96;this[_0xcc1f('0x37')]=_0x493a97[_0xcc1f('0x37')]||0x3;this[_0xcc1f('0x38')]=_0x493a97[_0xcc1f('0x38')]||0x96;this[_0xcc1f('0x39')]=_0x493a97['dialNoAnswerMaxRetry']||0x3;this[_0xcc1f('0x3a')]=_0x493a97[_0xcc1f('0x3a')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x493a97[_0xcc1f('0x3b')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x493a97[_0xcc1f('0x3c')]||0x96;this[_0xcc1f('0x3d')]=_0x493a97[_0xcc1f('0x3d')]||0x3;this[_0xcc1f('0x3e')]=_0x493a97['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x493a97[_0xcc1f('0x3f')]||0x3;this[_0xcc1f('0x40')]=_0x493a97[_0xcc1f('0x40')]||0x96;this[_0xcc1f('0x41')]=_0x493a97[_0xcc1f('0x41')]||0x3;this[_0xcc1f('0x42')]=_0x493a97[_0xcc1f('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x493a97[_0xcc1f('0x43')]||0x3;this[_0xcc1f('0x44')]=_0x493a97[_0xcc1f('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x493a97[_0xcc1f('0x45')]||0x3;this[_0xcc1f('0x46')]=_0x493a97[_0xcc1f('0x46')]||0x4;this[_0xcc1f('0x47')]=_0x493a97[_0xcc1f('0x47')]?_0x493a97[_0xcc1f('0x47')]:undefined;this[_0xcc1f('0x48')]=_0x493a97[_0xcc1f('0x48')]?_0x493a97['TrunkBackup']:undefined;this[_0xcc1f('0x49')]=_0x493a97[_0xcc1f('0x49')]||undefined;this['Interval']=_0x493a97[_0xcc1f('0x4a')]?_0x493a97[_0xcc1f('0x4a')]:undefined;this[_0xcc1f('0x4b')]=_0x493a97['dialOrderByScheduledAt']||'DESC';this[_0xcc1f('0x4c')]=_0x493a97[_0xcc1f('0x4c')]||undefined;this[_0xcc1f('0x4d')]=_0x493a97['dialCutDigit']||undefined;this[_0xcc1f('0x4e')]=strategy[_0x493a97[_0xcc1f('0x4e')]];this[_0xcc1f('0x4f')]=!![];this[_0xcc1f('0x50')]=_0x493a97[_0xcc1f('0x50')]||![];this[_0xcc1f('0x51')]=_0x493a97[_0xcc1f('0x51')];this[_0xcc1f('0x52')]=_0x493a97[_0xcc1f('0x52')];this[_0xcc1f('0x53')]=_0x493a97[_0xcc1f('0x53')];this['dialAMDTotalAnalysisTime']=_0x493a97['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x493a97[_0xcc1f('0x54')];this[_0xcc1f('0x55')]=_0x493a97[_0xcc1f('0x55')];this[_0xcc1f('0x56')]=_0x493a97[_0xcc1f('0x56')];this[_0xcc1f('0x57')]=_0x493a97[_0xcc1f('0x57')];this[_0xcc1f('0x58')]=_0x493a97[_0xcc1f('0x58')];this[_0xcc1f('0x59')]=0x0;this[_0xcc1f('0x5a')]=0x0;this[_0xcc1f('0x5b')]=_0x493a97[_0xcc1f('0x5b')];this['outboundAnswerCallsDay']=0x0;this[_0xcc1f('0x5c')]=0x0;this[_0xcc1f('0x5d')]=0x0;this[_0xcc1f('0x5e')]=0x0;this[_0xcc1f('0x5f')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xcc1f('0x60')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xcc1f('0x61')]=0x0;this[_0xcc1f('0x62')]=0x0;this[_0xcc1f('0x63')]=0x0;this['outboundReCallsDay']=0x0;this[_0xcc1f('0x64')]=0x0;this[_0xcc1f('0x65')]=undefined;this['startPredictive']=undefined;this[_0xcc1f('0x66')]=undefined;this[_0xcc1f('0x67')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xcc1f('0x68')]=0x0;this[_0xcc1f('0x69')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xcc1f('0x6a')]=0x0;this[_0xcc1f('0x6b')]=0x0;this[_0xcc1f('0x6c')]=0x0;this[_0xcc1f('0x6d')]=_0x493a97[_0xcc1f('0x6e')]||0x14;this['predictiveIntervalMinThreshold']=_0x493a97['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xcc1f('0x6f')]=0x0;this[_0xcc1f('0x70')]=0x0;this[_0xcc1f('0x71')]=0x1;this[_0xcc1f('0x72')]=0x0;this[_0xcc1f('0x73')]=0x0;this[_0xcc1f('0x74')]=0x0;this['erlangBusyFactor']=0x0;this[_0xcc1f('0x75')]=_0x493a97[_0xcc1f('0x75')]||0x1e;this[_0xcc1f('0x76')]=_0x493a97[_0xcc1f('0x76')]||![];this['dialPreviewAutoRecallMe']=!!_0x493a97[_0xcc1f('0x77')]||![];this['dialPreviewRecallmeReminder']=!!_0x493a97[_0xcc1f('0x78')]||![];this[_0xcc1f('0x79')]=_0x493a97[_0xcc1f('0x79')]||undefined;this['dialAgiAfterHangupClient']=_0x493a97[_0xcc1f('0x7a')]||![];this[_0xcc1f('0x7b')]=_0x493a97[_0xcc1f('0x7b')]||![];this[_0xcc1f('0xb')]=monitorFormat[_0x493a97['monitor_format']]?monitorFormat[_0x493a97[_0xcc1f('0xb')]]:undefined;this[_0xcc1f('0x7c')]=_0x493a97['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x493a97[_0xcc1f('0x7d')]?_0x493a97[_0xcc1f('0x7d')]:undefined;this[_0xcc1f('0x7e')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index ec62d1d..257088c 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xab29=['outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','waiting','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','loggedin','callers','length','SIP/','name','incall','includes','status','keys','exten','xcally-motion-preview','prototype','compareToInboundQueue','some','preview','available','loggedIn','loggedInDb','paused','talking','answered','inUse'];(function(_0x2b7836,_0x277d03){var _0x5c0a66=function(_0x4b3a01){while(--_0x4b3a01){_0x2b7836['push'](_0x2b7836['shift']());}};_0x5c0a66(++_0x277d03);}(_0xab29,0x145));var _0x9ab2=function(_0x132e71,_0x373182){_0x132e71=_0x132e71-0x0;var _0x288901=_0xab29[_0x132e71];return _0x288901;};'use strict';var INBOUND_COUNTERS=[_0x9ab2('0x0'),_0x9ab2('0x1'),_0x9ab2('0x2'),_0x9ab2('0x3'),'ringing',_0x9ab2('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0x9ab2('0x0'),_0x9ab2('0x5'),_0x9ab2('0x6'),_0x9ab2('0x1'),_0x9ab2('0x2'),'originated',_0x9ab2('0x7'),_0x9ab2('0x8'),_0x9ab2('0x9'),_0x9ab2('0xa'),_0x9ab2('0xb'),'outboundNoAnswerCallsDay',_0x9ab2('0xc'),_0x9ab2('0xd'),_0x9ab2('0xe'),_0x9ab2('0xf'),_0x9ab2('0x3'),_0x9ab2('0x10'),_0x9ab2('0x4'),_0x9ab2('0x11'),_0x9ab2('0x12'),'total',_0x9ab2('0x13')];function VoiceQueueSummary(_0x40aa20){this['id']=_0x40aa20['id'];this['name']=_0x40aa20['name'];this[_0x9ab2('0x14')]=_0x40aa20[_0x9ab2('0x14')];this[_0x9ab2('0x15')]=_0x40aa20['abandoned']||0x0;this[_0x9ab2('0x5')]=_0x40aa20[_0x9ab2('0x5')]||0x0;this['available']=_0x40aa20[_0x9ab2('0x0')]||0x0;this[_0x9ab2('0x16')]=_0x40aa20[_0x9ab2('0x16')]||0x0;this[_0x9ab2('0x6')]=_0x40aa20[_0x9ab2('0x6')]||0x0;this[_0x9ab2('0x17')]=_0x40aa20[_0x9ab2('0x17')]||0x0;this[_0x9ab2('0x1')]=_0x40aa20['loggedIn']||0x0;this[_0x9ab2('0x2')]=_0x40aa20[_0x9ab2('0x2')]||0x0;this[_0x9ab2('0x18')]=_0x40aa20[_0x9ab2('0x18')]||0x0;this[_0x9ab2('0x19')]=_0x40aa20[_0x9ab2('0x19')]||0x0;this['paused']=_0x40aa20['paused']||0x0;this[_0x9ab2('0x1a')]=_0x40aa20['ringing']||0x0;this[_0x9ab2('0x1b')]=_0x40aa20[_0x9ab2('0x1b')];this['sumBillable']=_0x40aa20[_0x9ab2('0x11')];this[_0x9ab2('0x12')]=_0x40aa20['sumDuration'];this[_0x9ab2('0x1c')]=_0x40aa20[_0x9ab2('0x1c')]||0x0;this[_0x9ab2('0x4')]=_0x40aa20[_0x9ab2('0x4')]||0x0;this[_0x9ab2('0x1d')]=_0x40aa20[_0x9ab2('0x1d')]||0x0;this[_0x9ab2('0x1e')]=_0x40aa20[_0x9ab2('0x1e')];this[_0x9ab2('0x1f')]=_0x40aa20[_0x9ab2('0x1f')]||0x0;this[_0x9ab2('0x20')]=_0x40aa20[_0x9ab2('0x20')]||0x0;this[_0x9ab2('0x21')]=_0x40aa20['unmanaged']||0x0;this[_0x9ab2('0x13')]=_0x40aa20[_0x9ab2('0x13')]||0x0;if(_0x40aa20[_0x9ab2('0x1e')]==='outbound'){this[_0x9ab2('0x10')]=_0x40aa20[_0x9ab2('0x10')]||0x0;this[_0x9ab2('0x22')]=_0x40aa20[_0x9ab2('0x22')];this[_0x9ab2('0x23')]=_0x40aa20[_0x9ab2('0x23')];this[_0x9ab2('0x24')]=_0x40aa20[_0x9ab2('0x24')];this[_0x9ab2('0x25')]=_0x40aa20['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x40aa20['dialOriginateTimeout'];this[_0x9ab2('0x26')]=_0x40aa20[_0x9ab2('0x26')];this[_0x9ab2('0x27')]=_0x40aa20[_0x9ab2('0x27')];this[_0x9ab2('0x28')]=_0x40aa20[_0x9ab2('0x28')];this[_0x9ab2('0x8')]=_0x40aa20[_0x9ab2('0x8')];this[_0x9ab2('0x9')]=_0x40aa20[_0x9ab2('0x9')];this['outboundBusyCallsDay']=_0x40aa20[_0x9ab2('0xa')];this['outboundCongestionCallsDay']=_0x40aa20[_0x9ab2('0xb')];this[_0x9ab2('0x29')]=_0x40aa20['outboundDropCallsDayACS'];this[_0x9ab2('0x2a')]=_0x40aa20['outboundDropCallsDayCallersExit'];this[_0x9ab2('0x2b')]=_0x40aa20[_0x9ab2('0x2b')];this[_0x9ab2('0x2c')]=_0x40aa20[_0x9ab2('0x2c')];this[_0x9ab2('0xc')]=_0x40aa20[_0x9ab2('0xc')];this[_0x9ab2('0x2d')]=_0x40aa20[_0x9ab2('0x2d')];this[_0x9ab2('0xd')]=_0x40aa20['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x40aa20[_0x9ab2('0xe')];this[_0x9ab2('0xf')]=_0x40aa20[_0x9ab2('0xf')];this[_0x9ab2('0x2e')]=_0x40aa20[_0x9ab2('0x2e')];this['predictiveIntervalAvgHoldtime']=_0x40aa20['predictiveIntervalAvgHoldtime'];this[_0x9ab2('0x2f')]=_0x40aa20['predictiveIntervalAvgTalktime'];this[_0x9ab2('0x30')]=_0x40aa20[_0x9ab2('0x30')];this[_0x9ab2('0x31')]=_0x40aa20[_0x9ab2('0x31')];this[_0x9ab2('0x32')]=_0x40aa20[_0x9ab2('0x32')];this[_0x9ab2('0x33')]=_0x40aa20[_0x9ab2('0x33')];this[_0x9ab2('0x34')]=_0x40aa20[_0x9ab2('0x34')];this[_0x9ab2('0x35')]=_0x40aa20[_0x9ab2('0x35')];this[_0x9ab2('0x36')]=_0x40aa20[_0x9ab2('0x36')];this[_0x9ab2('0x37')]=_0x40aa20['predictiveIntervalAvailable'];this[_0x9ab2('0x38')]=_0x40aa20[_0x9ab2('0x38')];this[_0x9ab2('0x39')]=_0x40aa20[_0x9ab2('0x39')];this[_0x9ab2('0x3a')]=_0x40aa20[_0x9ab2('0x3a')];this[_0x9ab2('0x3b')]=_0x40aa20['erlangCallToSecond'];this[_0x9ab2('0x3c')]=_0x40aa20[_0x9ab2('0x3c')];this['erlangBusyFactor']=_0x40aa20[_0x9ab2('0x3d')];this[_0x9ab2('0x3e')]=_0x40aa20[_0x9ab2('0x3e')];this[_0x9ab2('0x3f')]=_0x40aa20[_0x9ab2('0x3f')];this[_0x9ab2('0x40')]=_0x40aa20[_0x9ab2('0x40')];this[_0x9ab2('0x41')]=_0x40aa20[_0x9ab2('0x41')];}if(_0x40aa20[_0x9ab2('0x42')]){this[_0x9ab2('0x42')]={'id':_0x40aa20[_0x9ab2('0x42')]['id'],'name':_0x40aa20[_0x9ab2('0x42')]['name'],'active':_0x40aa20[_0x9ab2('0x42')]['active'],'callerid':_0x40aa20[_0x9ab2('0x42')][_0x9ab2('0x43')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x40595c,_0xe0e9bb,_0x5020db,_0x2308a0){this['loggedInDb']=0x0;this[_0x9ab2('0x4')]=0x0;this[_0x9ab2('0x3')]=0x0;this[_0x9ab2('0x20')]=0x0;this['notInUse']=0x0;this[_0x9ab2('0x6')]=0x0;this['busy']=0x0;this[_0x9ab2('0x17')]=0x0;this[_0x9ab2('0x1f')]=0x0;this[_0x9ab2('0x1a')]=0x0;this[_0x9ab2('0x1b')]=0x0;this[_0x9ab2('0x18')]=0x0;if(_0x5020db){if(_0x5020db['available']){this['available']=Number(_0x5020db['available']);}if(_0x5020db['loggedin']){this[_0x9ab2('0x1')]=Number(_0x5020db[_0x9ab2('0x44')]);}if(_0x5020db['callers']){this[_0x9ab2('0x13')]=Number(_0x5020db[_0x9ab2('0x45')]);}}for(var _0x1e21f2=0x0;_0x1e21f2<_0x40595c[_0x9ab2('0x46')];_0x1e21f2++){var _0x54f816=_0xe0e9bb[_0x9ab2('0x47')+_0x40595c[_0x1e21f2][_0x9ab2('0x48')]];if(_0x54f816&&_0x54f816['online']){this[_0x9ab2('0x2')]+=0x1;}if(_0x40595c[_0x1e21f2][_0x9ab2('0x49')]==='1'){this[_0x9ab2('0x4')]+=0x1;}if(_0x40595c[_0x1e21f2][_0x9ab2('0x3')]==='1'&&!['2','7','8'][_0x9ab2('0x4a')](_0x40595c[_0x1e21f2][_0x9ab2('0x4b')])){this['paused']+=0x1;}switch(_0x40595c[_0x1e21f2][_0x9ab2('0x4b')]){case'0':this[_0x9ab2('0x20')]+=0x1;break;case'1':this[_0x9ab2('0x19')]+=0x1;break;case'2':this[_0x9ab2('0x6')]+=0x1;break;case'3':this[_0x9ab2('0x16')]+=0x1;break;case'4':this[_0x9ab2('0x17')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x9ab2('0x1a')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x9ab2('0x18')]+=0x1;break;}}if(this[_0x9ab2('0x23')]==='booked'){var _0x4833bd=Object[_0x9ab2('0x4c')](_0x2308a0);for(var _0x4e867c=0x0;_0x4e867c<_0x4833bd[_0x9ab2('0x46')];_0x4e867c++){var _0x12472a=_0x4833bd[_0x4e867c];var _0x59f923=_0x2308a0[_0x12472a];if(_0x59f923['queue']===this['name']&&_0x59f923[_0x9ab2('0x1e')]==='dialer'&&_0x59f923[_0x9ab2('0x4d')]===_0x9ab2('0x4e')){this[_0x9ab2('0x4')]+=0x1;}}if(this[_0x9ab2('0x4')]>this['inUse']){this[_0x9ab2('0x4')]=this[_0x9ab2('0x6')];}this[_0x9ab2('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x9ab2('0x4f')][_0x9ab2('0x50')]=function(_0x5ebe13){var _0x6e7986=![];if(_0x5ebe13){_0x6e7986=INBOUND_COUNTERS[_0x9ab2('0x51')](function(_0x13f97b){return this[_0x13f97b]!==_0x5ebe13[_0x13f97b];},this);}return _0x6e7986;};VoiceQueueSummary[_0x9ab2('0x4f')]['compareToOutboundQueue']=function(_0x1363c7){var _0x26ae98=![];var _0x5a2f64=![];var _0x47db6f=![];if(_0x1363c7){_0x26ae98=this[_0x9ab2('0x23')]!==_0x1363c7[_0x9ab2('0x23')]||this[_0x9ab2('0x22')]!==_0x1363c7[_0x9ab2('0x22')]||this['message']!==_0x1363c7[_0x9ab2('0x40')]||this[_0x9ab2('0x41')]!==_0x1363c7['statusMessage'];_0x5a2f64=OUTBOUND_COUNTERS['some'](function(_0x41c33a){return this[_0x41c33a]!==_0x1363c7[_0x41c33a];},this);if(this['Trunk']&&_0x1363c7[_0x9ab2('0x42')]){_0x47db6f=this[_0x9ab2('0x42')][_0x9ab2('0x48')]!==_0x1363c7['Trunk'][_0x9ab2('0x48')]||this[_0x9ab2('0x42')]['active']!==_0x1363c7[_0x9ab2('0x42')]['active'];}}return _0x26ae98||_0x5a2f64||_0x47db6f;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x524f14){this[_0x9ab2('0x5')]=_0x524f14[_0x9ab2('0x5')];this[_0x9ab2('0x40')]=_0x524f14[_0x9ab2('0x40')];this['statusMessage']=_0x524f14['statusMessage'];this[_0x9ab2('0x39')]=_0x524f14[_0x9ab2('0x39')];this[_0x9ab2('0x7')]=_0x524f14[_0x9ab2('0x7')];this[_0x9ab2('0x8')]=_0x524f14[_0x9ab2('0x8')];this[_0x9ab2('0x9')]=_0x524f14[_0x9ab2('0x9')];this['outboundBusyCallsDay']=_0x524f14['outboundBusyCallsDay'];this[_0x9ab2('0xb')]=_0x524f14[_0x9ab2('0xb')];this[_0x9ab2('0x2c')]=_0x524f14[_0x9ab2('0x2c')];this['outboundNoSuchCallsDay']=_0x524f14[_0x9ab2('0xc')];this['outboundReCallsDay']=_0x524f14[_0x9ab2('0xd')];this[_0x9ab2('0xe')]=_0x524f14['outboundRejectCallsDay'];this[_0x9ab2('0xf')]=_0x524f14['outboundUnknownCallsDay'];this[_0x9ab2('0x11')]=_0x524f14[_0x9ab2('0x11')];this['sumDuration']=_0x524f14[_0x9ab2('0x12')];this['total']=_0x524f14[_0x9ab2('0x1d')];if(this['dialMethod']===_0x9ab2('0x52')){this[_0x9ab2('0x10')]=_0x524f14[_0x9ab2('0x10')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0x078c=['onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','message','statusMessage','Trunk','callerid','createReport','loggedin','callers','length','SIP/','online','incall','status','booked','keys','queue','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','some','active','prototype','updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','talking','waiting','answered','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid'];(function(_0x5e2d89,_0x8a19c4){var _0x546fdf=function(_0xc447f8){while(--_0xc447f8){_0x5e2d89['push'](_0x5e2d89['shift']());}};_0x546fdf(++_0x8a19c4);}(_0x078c,0x19f));var _0xc078=function(_0x14e9f0,_0x287f90){_0x14e9f0=_0x14e9f0-0x0;var _0xa63f7e=_0x078c[_0x14e9f0];return _0xa63f7e;};'use strict';var INBOUND_COUNTERS=[_0xc078('0x0'),'loggedIn',_0xc078('0x1'),_0xc078('0x2'),'ringing',_0xc078('0x3'),_0xc078('0x4')];var OUTBOUND_COUNTERS=[_0xc078('0x0'),_0xc078('0x5'),'inUse',_0xc078('0x6'),_0xc078('0x1'),_0xc078('0x7'),_0xc078('0x8'),_0xc078('0x9'),_0xc078('0xa'),_0xc078('0xb'),_0xc078('0xc'),'outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay',_0xc078('0xd'),_0xc078('0xe'),'paused',_0xc078('0xf'),_0xc078('0x3'),_0xc078('0x10'),_0xc078('0x11'),_0xc078('0x12'),'waiting'];function VoiceQueueSummary(_0x524b55){this['id']=_0x524b55['id'];this[_0xc078('0x13')]=_0x524b55[_0xc078('0x13')];this[_0xc078('0x14')]=_0x524b55[_0xc078('0x14')];this[_0xc078('0x15')]=_0x524b55[_0xc078('0x15')]||0x0;this[_0xc078('0x5')]=_0x524b55[_0xc078('0x5')]||0x0;this[_0xc078('0x0')]=_0x524b55[_0xc078('0x0')]||0x0;this[_0xc078('0x16')]=_0x524b55[_0xc078('0x16')]||0x0;this[_0xc078('0x17')]=_0x524b55[_0xc078('0x17')]||0x0;this[_0xc078('0x18')]=_0x524b55['invalid']||0x0;this[_0xc078('0x6')]=_0x524b55[_0xc078('0x6')]||0x0;this[_0xc078('0x1')]=_0x524b55['loggedInDb']||0x0;this[_0xc078('0x19')]=_0x524b55['onHold']||0x0;this['notInUse']=_0x524b55[_0xc078('0x1a')]||0x0;this['paused']=_0x524b55[_0xc078('0x2')]||0x0;this['ringing']=_0x524b55[_0xc078('0x1b')]||0x0;this[_0xc078('0x1c')]=_0x524b55[_0xc078('0x1c')];this['sumBillable']=_0x524b55[_0xc078('0x10')];this['sumDuration']=_0x524b55[_0xc078('0x11')];this[_0xc078('0x1d')]=_0x524b55[_0xc078('0x1d')]||0x0;this[_0xc078('0x3')]=_0x524b55[_0xc078('0x3')]||0x0;this['total']=_0x524b55[_0xc078('0x12')]||0x0;this[_0xc078('0x1e')]=_0x524b55[_0xc078('0x1e')];this[_0xc078('0x1f')]=_0x524b55['unavailable']||0x0;this[_0xc078('0x20')]=_0x524b55[_0xc078('0x20')]||0x0;this[_0xc078('0x21')]=_0x524b55[_0xc078('0x21')]||0x0;this[_0xc078('0x4')]=_0x524b55[_0xc078('0x4')]||0x0;if(_0x524b55[_0xc078('0x1e')]===_0xc078('0x22')){this[_0xc078('0xf')]=_0x524b55[_0xc078('0xf')]||0x0;this[_0xc078('0x23')]=_0x524b55['dialActive'];this['dialMethod']=_0x524b55[_0xc078('0x24')];this['dialOriginateCallerIdName']=_0x524b55['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x524b55[_0xc078('0x25')];this['dialOriginateTimeout']=_0x524b55[_0xc078('0x26')];this[_0xc078('0x27')]=_0x524b55[_0xc078('0x27')];this[_0xc078('0x28')]=_0x524b55[_0xc078('0x28')];this[_0xc078('0x29')]=_0x524b55[_0xc078('0x29')];this[_0xc078('0x9')]=_0x524b55[_0xc078('0x9')];this[_0xc078('0xa')]=_0x524b55[_0xc078('0xa')];this['outboundBusyCallsDay']=_0x524b55[_0xc078('0xb')];this['outboundCongestionCallsDay']=_0x524b55[_0xc078('0xc')];this[_0xc078('0x2a')]=_0x524b55[_0xc078('0x2a')];this[_0xc078('0x2b')]=_0x524b55['outboundDropCallsDayCallersExit'];this[_0xc078('0x2c')]=_0x524b55['outboundDropCallsDayTimeout'];this['outboundNoAnswerCallsDay']=_0x524b55[_0xc078('0x2d')];this[_0xc078('0x2e')]=_0x524b55['outboundNoSuchCallsDay'];this[_0xc078('0x2f')]=_0x524b55[_0xc078('0x2f')];this[_0xc078('0x30')]=_0x524b55['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x524b55[_0xc078('0xd')];this['outboundUnknownCallsDay']=_0x524b55[_0xc078('0xe')];this[_0xc078('0x31')]=_0x524b55['predictiveIntervalAnsweredCalls'];this[_0xc078('0x32')]=_0x524b55[_0xc078('0x32')];this[_0xc078('0x33')]=_0x524b55['predictiveIntervalAvgTalktime'];this[_0xc078('0x34')]=_0x524b55[_0xc078('0x34')];this[_0xc078('0x35')]=_0x524b55['predictiveIntervalDroppedCallsTimeout'];this['predictiveIntervalErlangCalls']=_0x524b55[_0xc078('0x36')];this[_0xc078('0x37')]=_0x524b55['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0x524b55['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x524b55['predictiveIntervalMultiplicativeFactor'];this[_0xc078('0x38')]=_0x524b55[_0xc078('0x38')];this[_0xc078('0x39')]=_0x524b55[_0xc078('0x39')];this['predictiveIntervalTotalCalls']=_0x524b55[_0xc078('0x3a')];this['originated']=_0x524b55['originated'];this[_0xc078('0x3b')]=_0x524b55[_0xc078('0x3b')];this[_0xc078('0x3c')]=_0x524b55[_0xc078('0x3c')];this[_0xc078('0x3d')]=_0x524b55[_0xc078('0x3d')];this[_0xc078('0x3e')]=_0x524b55[_0xc078('0x3e')];this['startPredictive']=_0x524b55['startPredictive'];this['startProgressive']=_0x524b55['startProgressive'];this[_0xc078('0x3f')]=_0x524b55['message'];this[_0xc078('0x40')]=_0x524b55['statusMessage'];}if(_0x524b55[_0xc078('0x41')]){this['Trunk']={'id':_0x524b55['Trunk']['id'],'name':_0x524b55[_0xc078('0x41')][_0xc078('0x13')],'active':_0x524b55[_0xc078('0x41')]['active'],'callerid':_0x524b55[_0xc078('0x41')][_0xc078('0x42')]};}}VoiceQueueSummary['prototype'][_0xc078('0x43')]=function(_0x3c2bc9,_0x459fed,_0x3e44ea,_0x432fc1){this['loggedInDb']=0x0;this[_0xc078('0x3')]=0x0;this[_0xc078('0x2')]=0x0;this[_0xc078('0x20')]=0x0;this['notInUse']=0x0;this['inUse']=0x0;this[_0xc078('0x16')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this[_0xc078('0x1b')]=0x0;this[_0xc078('0x1c')]=0x0;this['onHold']=0x0;if(_0x3e44ea){if(_0x3e44ea[_0xc078('0x0')]){this['available']=Number(_0x3e44ea[_0xc078('0x0')]);}if(_0x3e44ea['loggedin']){this[_0xc078('0x6')]=Number(_0x3e44ea[_0xc078('0x44')]);}if(_0x3e44ea[_0xc078('0x45')]){this[_0xc078('0x4')]=Number(_0x3e44ea['callers']);}}for(var _0x43762a=0x0;_0x43762a<_0x3c2bc9[_0xc078('0x46')];_0x43762a++){var _0x1635d6=_0x459fed[_0xc078('0x47')+_0x3c2bc9[_0x43762a]['name']];if(_0x1635d6&&_0x1635d6[_0xc078('0x48')]){this[_0xc078('0x1')]+=0x1;}if(_0x3c2bc9[_0x43762a][_0xc078('0x49')]==='1'){this[_0xc078('0x3')]+=0x1;}if(_0x3c2bc9[_0x43762a][_0xc078('0x2')]==='1'&&!['2','7','8']['includes'](_0x3c2bc9[_0x43762a][_0xc078('0x4a')])){this['paused']+=0x1;}switch(_0x3c2bc9[_0x43762a]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0xc078('0x1a')]+=0x1;break;case'2':this[_0xc078('0x17')]+=0x1;break;case'3':this[_0xc078('0x16')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xc078('0x1b')]+=0x1;break;case'7':this[_0xc078('0x1c')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xc078('0x24')]===_0xc078('0x4b')){var _0x4855de=Object[_0xc078('0x4c')](_0x432fc1);for(var _0x57889b=0x0;_0x57889b<_0x4855de[_0xc078('0x46')];_0x57889b++){var _0x21b506=_0x4855de[_0x57889b];var _0x2dc9e8=_0x432fc1[_0x21b506];if(_0x2dc9e8[_0xc078('0x4d')]===this[_0xc078('0x13')]&&_0x2dc9e8[_0xc078('0x1e')]==='dialer'&&_0x2dc9e8[_0xc078('0x4e')]===_0xc078('0x4f')){this[_0xc078('0x3')]+=0x1;}}if(this[_0xc078('0x3')]>this[_0xc078('0x17')]){this['talking']=this[_0xc078('0x17')];}this[_0xc078('0xf')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0xc078('0x50')]=function(_0x1bfef8){var _0x1cc086=![];if(_0x1bfef8){_0x1cc086=INBOUND_COUNTERS['some'](function(_0x36456e){return this[_0x36456e]!==_0x1bfef8[_0x36456e];},this);}return _0x1cc086;};VoiceQueueSummary['prototype'][_0xc078('0x51')]=function(_0x519124){var _0x273b65=![];var _0x1e62ac=![];var _0x5bf30c=![];if(_0x519124){_0x273b65=this[_0xc078('0x24')]!==_0x519124[_0xc078('0x24')]||this[_0xc078('0x23')]!==_0x519124[_0xc078('0x23')]||this[_0xc078('0x3f')]!==_0x519124[_0xc078('0x3f')]||this[_0xc078('0x40')]!==_0x519124[_0xc078('0x40')];_0x1e62ac=OUTBOUND_COUNTERS[_0xc078('0x52')](function(_0x1c04ef){return this[_0x1c04ef]!==_0x519124[_0x1c04ef];},this);if(this[_0xc078('0x41')]&&_0x519124['Trunk']){_0x5bf30c=this[_0xc078('0x41')][_0xc078('0x13')]!==_0x519124[_0xc078('0x41')][_0xc078('0x13')]||this['Trunk']['active']!==_0x519124['Trunk'][_0xc078('0x53')];}}return _0x273b65||_0x1e62ac||_0x5bf30c;};VoiceQueueSummary[_0xc078('0x54')][_0xc078('0x55')]=function(_0xdb27db){this[_0xc078('0x5')]=_0xdb27db[_0xc078('0x5')];this[_0xc078('0x3f')]=_0xdb27db[_0xc078('0x3f')];this[_0xc078('0x40')]=_0xdb27db[_0xc078('0x40')];this['originated']=_0xdb27db['originated'];this[_0xc078('0x8')]=_0xdb27db[_0xc078('0x8')];this[_0xc078('0x9')]=_0xdb27db[_0xc078('0x9')];this[_0xc078('0xa')]=_0xdb27db[_0xc078('0xa')];this[_0xc078('0xb')]=_0xdb27db[_0xc078('0xb')];this[_0xc078('0xc')]=_0xdb27db[_0xc078('0xc')];this['outboundNoAnswerCallsDay']=_0xdb27db[_0xc078('0x2d')];this['outboundNoSuchCallsDay']=_0xdb27db[_0xc078('0x2e')];this[_0xc078('0x30')]=_0xdb27db[_0xc078('0x30')];this[_0xc078('0xd')]=_0xdb27db[_0xc078('0xd')];this['outboundUnknownCallsDay']=_0xdb27db[_0xc078('0xe')];this['sumBillable']=_0xdb27db[_0xc078('0x10')];this['sumDuration']=_0xdb27db[_0xc078('0x11')];this['total']=_0xdb27db['total'];if(this[_0xc078('0x24')]===_0xc078('0x56')){this[_0xc078('0xf')]=_0xdb27db['pTalking'];}};module[_0xc078('0x57')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 70e20e6..d90fce6 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 _0xae0e=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x4d4682,_0x1e8d8e){var _0x58d25b=function(_0x1be006){while(--_0x1be006){_0x4d4682['push'](_0x4d4682['shift']());}};_0x58d25b(++_0x1e8d8e);}(_0xae0e,0x149));var _0xeae0=function(_0x36c0f8,_0x1b5961){_0x36c0f8=_0x36c0f8-0x0;var _0x4b0698=_0xae0e[_0x36c0f8];return _0x4b0698;};'use strict';function VtigerAccount(_0x383c8f){this['id']=_0x383c8f['id']||0x0;this['name']=_0x383c8f[_0xeae0('0x0')]||'';this[_0xeae0('0x1')]=_0x383c8f[_0xeae0('0x1')]||'';this['accessKey']=_0x383c8f[_0xeae0('0x2')]||'';this[_0xeae0('0x3')]=_0x383c8f[_0xeae0('0x3')]||'';this[_0xeae0('0x4')]=_0x383c8f[_0xeae0('0x4')]||'';this[_0xeae0('0x5')]=_0x383c8f[_0xeae0('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x20de=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x333755,_0x47aadf){var _0x1335ce=function(_0x370044){while(--_0x370044){_0x333755['push'](_0x333755['shift']());}};_0x1335ce(++_0x47aadf);}(_0x20de,0x1ad));var _0xe20d=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x20de[_0x2b9b7f];return _0x4ed19a;};'use strict';function VtigerAccount(_0x2fb432){this['id']=_0x2fb432['id']||0x0;this[_0xe20d('0x0')]=_0x2fb432[_0xe20d('0x0')]||'';this[_0xe20d('0x1')]=_0x2fb432[_0xe20d('0x1')]||'';this[_0xe20d('0x2')]=_0x2fb432[_0xe20d('0x2')]||'';this['remoteUri']=_0x2fb432[_0xe20d('0x3')]||'';this['serverUrl']=_0x2fb432[_0xe20d('0x4')]||'';this[_0xe20d('0x5')]=_0x2fb432[_0xe20d('0x5')]||{};}module[_0xe20d('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7b7955f..ed6bdeb 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 _0x6d9d=['Configurations','exports','name','username','password','token','remoteUri','authType','type','serverUrl'];(function(_0x59390f,_0x4c609c){var _0x3a962d=function(_0x2c0381){while(--_0x2c0381){_0x59390f['push'](_0x59390f['shift']());}};_0x3a962d(++_0x4c609c);}(_0x6d9d,0x106));var _0xd6d9=function(_0x15d6ad,_0x38e307){_0x15d6ad=_0x15d6ad-0x0;var _0x49d78a=_0x6d9d[_0x15d6ad];return _0x49d78a;};'use strict';function ZendeskAccount(_0xedfdf4){this['id']=_0xedfdf4['id']||0x0;this[_0xd6d9('0x0')]=_0xedfdf4['name']||'';this[_0xd6d9('0x1')]=_0xedfdf4[_0xd6d9('0x1')]||'';this[_0xd6d9('0x2')]=_0xedfdf4[_0xd6d9('0x2')]||'';this[_0xd6d9('0x3')]=_0xedfdf4['token']||'';this[_0xd6d9('0x4')]=_0xedfdf4[_0xd6d9('0x4')]||'';this[_0xd6d9('0x5')]=_0xedfdf4['authType']||'';this['type']=_0xedfdf4[_0xd6d9('0x6')]||'integrationTab';this[_0xd6d9('0x7')]=_0xedfdf4[_0xd6d9('0x7')]||'';this[_0xd6d9('0x8')]=_0xedfdf4['Configurations']||{};}module[_0xd6d9('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x4eef=['name','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0xd75a66,_0x156900){var _0x35ae80=function(_0x362286){while(--_0x362286){_0xd75a66['push'](_0xd75a66['shift']());}};_0x35ae80(++_0x156900);}(_0x4eef,0x148));var _0xf4ee=function(_0x37f4d4,_0x65ae4f){_0x37f4d4=_0x37f4d4-0x0;var _0x150752=_0x4eef[_0x37f4d4];return _0x150752;};'use strict';function ZendeskAccount(_0x3ad5c5){this['id']=_0x3ad5c5['id']||0x0;this[_0xf4ee('0x0')]=_0x3ad5c5[_0xf4ee('0x0')]||'';this['username']=_0x3ad5c5['username']||'';this['password']=_0x3ad5c5['password']||'';this[_0xf4ee('0x1')]=_0x3ad5c5[_0xf4ee('0x1')]||'';this[_0xf4ee('0x2')]=_0x3ad5c5[_0xf4ee('0x2')]||'';this[_0xf4ee('0x3')]=_0x3ad5c5[_0xf4ee('0x3')]||'';this['type']=_0x3ad5c5[_0xf4ee('0x4')]||_0xf4ee('0x5');this['serverUrl']=_0x3ad5c5[_0xf4ee('0x6')]||'';this[_0xf4ee('0x7')]=_0x3ad5c5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 19114da..aef9308 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 _0xece3=['exports','name','description','host','zone','clientId','clientSecret','code','refreshToken'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0xece3,0x1c3));var _0x3ece=function(_0x2ae8b5,_0x2a2cb6){_0x2ae8b5=_0x2ae8b5-0x0;var _0x29def1=_0xece3[_0x2ae8b5];return _0x29def1;};'use strict';function ZohoAccount(_0xc49c37){this['id']=_0xc49c37['id']||0x0;this[_0x3ece('0x0')]=_0xc49c37[_0x3ece('0x0')]||'';this['description']=_0xc49c37[_0x3ece('0x1')]||'';this[_0x3ece('0x2')]=_0xc49c37[_0x3ece('0x2')]||'';this[_0x3ece('0x3')]=_0xc49c37['zone']||'';this['clientId']=_0xc49c37[_0x3ece('0x4')]||'';this[_0x3ece('0x5')]=_0xc49c37[_0x3ece('0x5')]||'';this['serverUrl']=_0xc49c37['serverUrl']||'';this[_0x3ece('0x6')]=_0xc49c37[_0x3ece('0x6')]||'';this[_0x3ece('0x7')]=_0xc49c37[_0x3ece('0x7')]||'';this['Configurations']=_0xc49c37['Configurations']||{};}module[_0x3ece('0x8')]=ZohoAccount; \ No newline at end of file +var _0x04dd=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x27d3f0,_0x5ac562){var _0x3edd25=function(_0xdbf130){while(--_0xdbf130){_0x27d3f0['push'](_0x27d3f0['shift']());}};_0x3edd25(++_0x5ac562);}(_0x04dd,0x191));var _0xd04d=function(_0x5ae93d,_0x48a929){_0x5ae93d=_0x5ae93d-0x0;var _0x3bc344=_0x04dd[_0x5ae93d];return _0x3bc344;};'use strict';function ZohoAccount(_0x2b2bf4){this['id']=_0x2b2bf4['id']||0x0;this[_0xd04d('0x0')]=_0x2b2bf4[_0xd04d('0x0')]||'';this[_0xd04d('0x1')]=_0x2b2bf4[_0xd04d('0x1')]||'';this[_0xd04d('0x2')]=_0x2b2bf4['host']||'';this[_0xd04d('0x3')]=_0x2b2bf4[_0xd04d('0x3')]||'';this[_0xd04d('0x4')]=_0x2b2bf4['clientId']||'';this[_0xd04d('0x5')]=_0x2b2bf4['clientSecret']||'';this[_0xd04d('0x6')]=_0x2b2bf4[_0xd04d('0x6')]||'';this[_0xd04d('0x7')]=_0x2b2bf4[_0xd04d('0x7')]||'';this[_0xd04d('0x8')]=_0x2b2bf4[_0xd04d('0x8')]||'';this[_0xd04d('0x9')]=_0x2b2bf4[_0xd04d('0x9')]||{};}module[_0xd04d('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 9da7ebd..f35e9a3 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 _0xa456=['originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','name','channelAgent','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countbusyretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent','VoiceQueueId'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa456,0x142));var _0x6a45=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xa456[_0x341e0f];return _0x59555a;};'use strict';var util=require(_0x6a45('0x0'));var _=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));function checkNameSurname(_0xd5464e,_0x587626,_0x3bfbe6){var _0x206f6b='';if(!_[_0x6a45('0x3')](_0x587626)&&'string'===typeof _0x587626){_0x206f6b+=_0x587626;}if(!_[_0x6a45('0x3')](_0x3bfbe6)&&_0x6a45('0x4')===typeof _0x3bfbe6){_0x206f6b+='\x20'+_0x3bfbe6;}if(_0x206f6b!==''){return _0x206f6b;}return _0xd5464e;}function Action(_0x1e5882,_0x14da6b,_0x4dfbfa,_0x25cf8d,_0x26bfc0){this[_0x6a45('0x5')]=_0x4dfbfa||undefined;this[_0x6a45('0x6')]=_0x1e5882['id'];this[_0x6a45('0x7')]=_0x14da6b['name'];this[_0x6a45('0x8')]=_0x14da6b['type'];this[_0x6a45('0x9')]=_0x6a45('0x7');this[_0x6a45('0xa')]=![];this[_0x6a45('0xb')]=_[_0x6a45('0x3')](_0x1e5882['Agent'])?undefined:_0x1e5882['Agent'][_0x6a45('0xc')];this[_0x6a45('0xd')]=this['membername']?util['format']('SIP/%s',this[_0x6a45('0xb')]):_0x25cf8d||undefined;this[_0x6a45('0xe')]=checkNameSurname(_0x1e5882[_0x6a45('0xf')][_0x6a45('0x10')],_0x1e5882[_0x6a45('0xf')]['firstName'],_0x1e5882['Contact'][_0x6a45('0x11')]);this[_0x6a45('0x12')]=_0x1e5882['active']||![];this[_0x6a45('0x13')]=_0x1e5882[_0x6a45('0x10')];this[_0x6a45('0x14')]=_0x1e5882[_0x6a45('0x14')];this['countbusyretry']=_0x1e5882['countbusyretry']||0x0;this['countcongestionretry']=_0x1e5882[_0x6a45('0x15')]||0x0;this[_0x6a45('0x16')]=_0x1e5882[_0x6a45('0x16')]||0x0;this['countglobal']=(_0x1e5882[_0x6a45('0x17')]||0x0)+(_0x1e5882[_0x6a45('0x15')]||0x0)+(_0x1e5882[_0x6a45('0x16')]||0x0)+(_0x1e5882['countnosuchnumberretry']||0x0)+(_0x1e5882['countdropretry']||0x0)+(_0x1e5882['countabandonedretry']||0x0)+(_0x1e5882[_0x6a45('0x18')]||0x0)+(_0x1e5882[_0x6a45('0x19')]||0x0);this['countnosuchnumberretry']=_0x1e5882[_0x6a45('0x1a')]||0x0;this[_0x6a45('0x1b')]=_0x1e5882['countdropretry']||0x0;this[_0x6a45('0x1c')]=_0x1e5882[_0x6a45('0x1c')]||0x0;this[_0x6a45('0x18')]=_0x1e5882[_0x6a45('0x18')]||0x0;this[_0x6a45('0x19')]=_0x1e5882['countagentrejectretry']||0x0;this['callback']=_0x1e5882[_0x6a45('0x1d')];this[_0x6a45('0x1e')]=_0x1e5882[_0x6a45('0x1e')];this[_0x6a45('0x1f')]=_0x1e5882[_0x6a45('0x1f')];this[_0x6a45('0x20')]=_0x1e5882[_0x6a45('0x20')];this[_0x6a45('0x21')]=_0x1e5882[_0x6a45('0x21')];this[_0x6a45('0x22')]=_0x1e5882[_0x6a45('0x22')];this[_0x6a45('0x23')]=_['isNil'](_0x1e5882[_0x6a45('0x24')])?_0x1e5882['UserId']:_0x1e5882[_0x6a45('0x24')]['id'];this[_0x6a45('0x25')]=_0x1e5882[_0x6a45('0x25')];this[_0x6a45('0x26')]='';this[_0x6a45('0x27')]='';}Action['prototype'][_0x6a45('0x28')]=function(){return util[_0x6a45('0x29')](_0x6a45('0x2a'),this[_0x6a45('0xe')],this[_0x6a45('0x2b')]);};module[_0x6a45('0x2c')]=Action; \ No newline at end of file +var _0x3266=['callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback'];(function(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0x3266,0x6a));var _0x6326=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x3266[_0x3b5049];return _0x12454e;};'use strict';var util=require(_0x6326('0x0'));var _=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));function checkNameSurname(_0x2bed83,_0x545df7,_0x6b67c0){var _0x29aef3='';if(!_[_0x6326('0x3')](_0x545df7)&&_0x6326('0x4')===typeof _0x545df7){_0x29aef3+=_0x545df7;}if(!_['isNil'](_0x6b67c0)&&_0x6326('0x4')===typeof _0x6b67c0){_0x29aef3+='\x20'+_0x6b67c0;}if(_0x29aef3!==''){return _0x29aef3;}return _0x2bed83;}function Action(_0x5f38a3,_0x25ecd8,_0x44460c,_0x14208e,_0x5402e5){this[_0x6326('0x5')]=_0x44460c||undefined;this['idContact']=_0x5f38a3['id'];this[_0x6326('0x6')]=_0x25ecd8[_0x6326('0x7')];this[_0x6326('0x8')]=_0x25ecd8[_0x6326('0x8')];this[_0x6326('0x9')]='queue';this[_0x6326('0xa')]=![];this[_0x6326('0xb')]=_[_0x6326('0x3')](_0x5f38a3[_0x6326('0xc')])?undefined:_0x5f38a3[_0x6326('0xc')][_0x6326('0x7')];this[_0x6326('0xd')]=this[_0x6326('0xb')]?util[_0x6326('0xe')](_0x6326('0xf'),this['membername']):_0x14208e||undefined;this['calleridname']=checkNameSurname(_0x5f38a3[_0x6326('0x10')][_0x6326('0x11')],_0x5f38a3['Contact'][_0x6326('0x12')],_0x5f38a3['Contact'][_0x6326('0x13')]);this[_0x6326('0x14')]=_0x5f38a3[_0x6326('0x14')]||![];this[_0x6326('0x15')]=_0x5f38a3[_0x6326('0x11')];this[_0x6326('0x16')]=_0x5f38a3['scheduledat'];this[_0x6326('0x17')]=_0x5f38a3['countbusyretry']||0x0;this['countcongestionretry']=_0x5f38a3['countcongestionretry']||0x0;this['countnoanswerretry']=_0x5f38a3['countnoanswerretry']||0x0;this['countglobal']=(_0x5f38a3[_0x6326('0x17')]||0x0)+(_0x5f38a3[_0x6326('0x18')]||0x0)+(_0x5f38a3[_0x6326('0x19')]||0x0)+(_0x5f38a3['countnosuchnumberretry']||0x0)+(_0x5f38a3['countdropretry']||0x0)+(_0x5f38a3[_0x6326('0x1a')]||0x0)+(_0x5f38a3[_0x6326('0x1b')]||0x0)+(_0x5f38a3[_0x6326('0x1c')]||0x0);this[_0x6326('0x1d')]=_0x5f38a3[_0x6326('0x1d')]||0x0;this[_0x6326('0x1e')]=_0x5f38a3[_0x6326('0x1e')]||0x0;this['countabandonedretry']=_0x5f38a3[_0x6326('0x1a')]||0x0;this['countmachineretry']=_0x5f38a3[_0x6326('0x1b')]||0x0;this[_0x6326('0x1c')]=_0x5f38a3[_0x6326('0x1c')]||0x0;this[_0x6326('0x1f')]=_0x5f38a3[_0x6326('0x1f')];this[_0x6326('0x20')]=_0x5f38a3[_0x6326('0x20')];this[_0x6326('0x21')]=_0x5f38a3[_0x6326('0x21')];this[_0x6326('0x22')]=_0x5f38a3[_0x6326('0x22')];this['ContactId']=_0x5f38a3[_0x6326('0x23')];this[_0x6326('0x24')]=_0x5f38a3['ListId'];this['UserId']=_['isNil'](_0x5f38a3[_0x6326('0xc')])?_0x5f38a3['UserId']:_0x5f38a3[_0x6326('0xc')]['id'];this[_0x6326('0x25')]=_0x5f38a3['VoiceQueueId'];this[_0x6326('0x26')]='';this[_0x6326('0x27')]='';}Action[_0x6326('0x28')][_0x6326('0x29')]=function(){return util[_0x6326('0xe')](_0x6326('0x2a'),this[_0x6326('0x2b')],this[_0x6326('0x2c')]);};module[_0x6326('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 747e199..8916a73 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 _0x95fe=['toLowerVariables','variables','variablesAction','OriginateError','logLookAgent','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','callProgressDetectingAgent','destlinkedid','destuniqueid','addVariable','filterKey','keys','variable','value','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','uuid','ioredis','../../../config/environment','../../../config/logger','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','blindtransfer','syncBlindTransfer','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','\x20is\x20not\x20active','DEACTIVATED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','prototype','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','preview','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','sequence','enqueue','isNil','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','activeContact','NOANSWER','outboundNoAnswerCallsDay','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','loggerError','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','queueSummaryCountersUpdated','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','merge'];(function(_0x5f4e93,_0x5ce1fc){var _0x10cae5=function(_0x1defdf){while(--_0x1defdf){_0x5f4e93['push'](_0x5f4e93['shift']());}};_0x10cae5(++_0x5ce1fc);}(_0x95fe,0x154));var _0xe95f=function(_0x287c21,_0x1b7be5){_0x287c21=_0x287c21-0x0;var _0x145e31=_0x95fe[_0x287c21];return _0x145e31;};'use strict';var util=require('util');var _=require(_0xe95f('0x0'));var uuid=require(_0xe95f('0x1'));var moment=require('moment');var Redis=require(_0xe95f('0x2'));var config=require(_0xe95f('0x3'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xe95f('0x4'))('actionPreview');var ami=require(_0xe95f('0x5'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xe95f('0x6'));var Action=require(_0xe95f('0x7'));var ut=require(_0xe95f('0x8'));var utils=require('../dialer/utils');config[_0xe95f('0x9')]=_[_0xe95f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe95f('0x9')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2f3f40){this[_0xe95f('0xb')]=this[_0xe95f('0xb')]?this[_0xe95f('0xb')][_0xe95f('0xc')](_0x2f3f40):_0x2f3f40();};function Preview(_0x1d6b74){this['sequence']=new Sequence();this[_0xe95f('0xd')]=_0x1d6b74[_0xe95f('0xe')];this[_0xe95f('0xf')]=_0x1d6b74[_0xe95f('0xf')];this[_0xe95f('0x10')]={};this[_0xe95f('0x11')]=_0x1d6b74[_0xe95f('0x11')];this['clockClearZombieChannels']=0x0;ami['on'](_0xe95f('0x12'),this[_0xe95f('0x13')][_0xe95f('0x14')](this));ami['on'](_0xe95f('0x15'),this[_0xe95f('0x16')][_0xe95f('0x14')](this));ami['on'](_0xe95f('0x17'),this['syncHangupRequest'][_0xe95f('0x14')](this));ami['on'](_0xe95f('0x18'),this[_0xe95f('0x19')][_0xe95f('0x14')](this));ami['on'](_0xe95f('0x1a'),this[_0xe95f('0x1b')]['bind'](this));ami['on']('varset',this[_0xe95f('0x1c')][_0xe95f('0x14')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xe95f('0x1d'),this[_0xe95f('0x1e')]['bind'](this));this['loopCampaigns'](this[_0xe95f('0xd')]);}function emit(_0x58cff2,_0x21c372,_0x180de2){io['to'](_0x58cff2)[_0xe95f('0x1f')](_0x21c372,_0x180de2);}function emitVoiceQueueChannelRemove(_0x16e060){logger[_0xe95f('0x20')](_0xe95f('0x21'),JSON[_0xe95f('0x22')](_0x16e060));emit(util[_0xe95f('0x23')](_0xe95f('0x24'),_0x16e060[_0xe95f('0x25')]),_0xe95f('0x26'),_0x16e060);io[_0xe95f('0x1f')]('voice_queue_presence:remove',_0x16e060);}function notSendMessagesQueue(_0x495e5e){if(_0x495e5e[_0xe95f('0x27')]){if(_0x495e5e[_0xe95f('0x28')]===0x0&&_0x495e5e[_0xe95f('0x29')]===0x0){_0x495e5e['sendMessageOneNotActive']=![];_0x495e5e[_0xe95f('0x2a')]=0x0;_0x495e5e[_0xe95f('0x2b')]=0x0;_0x495e5e[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')][_0xe95f('0x2e')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x495e5e[_0xe95f('0x25')]+_0xe95f('0x2f'));}else{_0x495e5e[_0xe95f('0x2c')]=utils['CAMPAIGN_STATUS'][_0xe95f('0x30')];ut[_0xe95f('0x31')](_0xe95f('0x32'),_0x495e5e['name']+_0xe95f('0x33'));}}}Preview[_0xe95f('0x34')]['loopCampaigns']=function(){var _0x57ff39=this;setInterval(function(){_0x57ff39[_0xe95f('0x35')]();},0x7cf);};Preview[_0xe95f('0x34')][_0xe95f('0x35')]=function(){var _0x502c57=this[_0xe95f('0xd')];this[_0xe95f('0x36')]+=0x1;for(var _0x1ef0df in _0x502c57){if(_0x502c57[_0xe95f('0x37')](_0x1ef0df)&&(_0x502c57[_0x1ef0df][_0xe95f('0x38')]===_0xe95f('0x39')||_0x502c57[_0x1ef0df]['dialMethod']===_0xe95f('0x3a'))&&_0x502c57[_0x1ef0df][_0xe95f('0x3b')]===_0xe95f('0x3c')){if(this[_0xe95f('0x36')]>0x7){this[_0xe95f('0x36')]=0x0;this[_0xe95f('0x3d')]();}}if(_0x502c57[_0xe95f('0x37')](_0x1ef0df)&&_0x502c57[_0x1ef0df][_0xe95f('0x38')]===_0xe95f('0x39')&&_0x502c57[_0x1ef0df][_0xe95f('0x3b')]==='outbound'){if(_0x502c57[_0x1ef0df][_0xe95f('0x3e')]){this[_0xe95f('0x3f')](_0x502c57[_0x1ef0df]);if(_0x502c57[_0x1ef0df][_0xe95f('0x40')])this[_0xe95f('0x41')](_0x502c57[_0x1ef0df]);}else{notSendMessagesQueue(_0x502c57[_0x1ef0df]);}}}};Preview[_0xe95f('0x34')]['clearZombieChannel']=function(_0x3d41aa){var _0x256e4a=this;this[_0xe95f('0x42')][_0xe95f('0x43')](function(){if(!_[_0xe95f('0x44')](_0x256e4a[_0xe95f('0x10')][_0x3d41aa])){loggerAction[_0xe95f('0x20')](_0xe95f('0x45'),_0x3d41aa,'Queue',_0x256e4a[_0xe95f('0x10')][_0x3d41aa]['queue'],_0xe95f('0x46'),JSON[_0xe95f('0x22')](_0x256e4a['campaignsPreview'][_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x47')]][_0xe95f('0x28')]),_0xe95f('0x48'),JSON['stringify'](_0x256e4a[_0xe95f('0xd')][_0x256e4a['actions'][_0x3d41aa]['queue']][_0xe95f('0x29')]),JSON[_0xe95f('0x22')](_0x256e4a[_0xe95f('0x10')][_0x3d41aa]['dialAnswer']),JSON[_0xe95f('0x22')](_[_0xe95f('0x49')](_0x256e4a[_0xe95f('0x10')][_0x3d41aa],[_0xe95f('0x4a'),_0xe95f('0x4b'),_0xe95f('0x4c'),_0xe95f('0x4d')])));return ami[_0xe95f('0x4e')]({'action':_0xe95f('0x4f'),'channel':_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x50')]})[_0xe95f('0x51')](function(_0x1cea1c){if(_0x1cea1c[_0xe95f('0x2c')]===_0xe95f('0x52')){setTimeout(function(){if(_0x256e4a['actions'][_0x3d41aa]){ut[_0xe95f('0x53')](_0x256e4a[_0xe95f('0xd')][_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x47')]],_0xe95f('0x54'));if(_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x55')]===!![]){ut['decrementTalkink'](_0x256e4a[_0xe95f('0xd')][_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x47')]],_0xe95f('0x54'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x3d41aa,_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x47')]);}ut['loggerError'](_0xe95f('0x56')+_0x3d41aa,_0x256e4a[_0xe95f('0x10')][_0x3d41aa][_0xe95f('0x47')]);delete _0x256e4a['actions'][_0x3d41aa];}},0x2328);}});}});};Preview[_0xe95f('0x34')][_0xe95f('0x3d')]=function(){var _0x238697=this;loggerAction[_0xe95f('0x20')](_0xe95f('0x57'),_[_0xe95f('0x58')](this[_0xe95f('0x10')]));for(var _0x49e969 in this[_0xe95f('0x10')]){if(_0x238697[_0xe95f('0x10')]['hasOwnProperty'](_0x49e969)){_0x238697['clearZombieChannel'](_0x49e969);}}};Preview['prototype']['recallMe']=function(_0x459e70){var _0x2e1708=this;rpcDb[_0xe95f('0x59')](_0x459e70['id'],ut['agentReadyId'](this[_0xe95f('0x11')]))[_0xe95f('0x5a')](function(_0x3c9d5d){if(!_[_0xe95f('0x44')](_0x3c9d5d)){for(var _0x2030ad=0x0;_0x2030ad<_0x3c9d5d[_0xe95f('0x5b')];_0x2030ad+=0x1){if(ut[_0xe95f('0x5c')](_0x3c9d5d[_0x2030ad][_0xe95f('0x5d')])<_0x459e70[_0xe95f('0x5e')]*0x3c){if(_0x3c9d5d[_0x2030ad]['Agent']&&!_0x3c9d5d[_0x2030ad]['Agent'][_0xe95f('0x5f')]){_0x2e1708[_0xe95f('0x60')](_0x3c9d5d[_0x2030ad]['id'])[_0xe95f('0x5a')](ut[_0xe95f('0x61')](_0xe95f('0x62')))[_0xe95f('0x51')](ut[_0xe95f('0x61')]('[RecallMe]'));}else{rpcDb[_0xe95f('0x63')](_0x3c9d5d[_0x2030ad]['id']);}}else{var _0x56acb4=new Action(_0x3c9d5d[_0x2030ad],_0x459e70);_0x56acb4[_0xe95f('0x64')]=moment()[_0xe95f('0x23')](_0xe95f('0x65'));_0x459e70[_0xe95f('0x66')]+=0x1;ut[_0xe95f('0x67')](_0x56acb4,0x17,_0xe95f('0x68'));if(_0x459e70[_0xe95f('0x69')]){rpcDb[_0xe95f('0x6a')](ut[_0xe95f('0x6b')](_0x3c9d5d[_0x2030ad]));rpcDb[_0xe95f('0x6c')](_0x56acb4,_0xe95f('0x6d'));}else{ut['logCustomer'](_0x56acb4,0x16,_0xe95f('0x6e'));rpcDb[_0xe95f('0x6c')](_0x56acb4,_0xe95f('0x6f'));rpcDb[_0xe95f('0x70')](_0x56acb4,_0xe95f('0x6f'));}}}}})[_0xe95f('0x51')](ut[_0xe95f('0x61')]('[getContactRecallMe]'));};Preview[_0xe95f('0x34')][_0xe95f('0x3f')]=function(_0x517ef5){_0x517ef5[_0xe95f('0x27')]=!![];if(ut[_0xe95f('0x71')](_0x517ef5[_0xe95f('0x72')])){_0x517ef5[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')][_0xe95f('0x73')];}else if(!ut[_0xe95f('0x74')](_0x517ef5[_0xe95f('0x3e')])){_0x517ef5[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')]['INACTIVE'];}else if(!this[_0xe95f('0x75')](_0x517ef5[_0xe95f('0x76')])){if(!this[_0xe95f('0x75')](_0x517ef5[_0xe95f('0x77')])){_0x517ef5[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')][_0xe95f('0x78')];}else{_0x517ef5[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')]['ACTIVE'];}}else{_0x517ef5[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')][_0xe95f('0x79')];}};Preview[_0xe95f('0x34')][_0xe95f('0x7a')]=function(_0x2d6e60,_0x1c56f2,_0x2ccba8){var _0x45e3da=this;var _0x1829e6=this[_0xe95f('0x10')][_0x1c56f2];var _0x5cb215=this[_0xe95f('0xd')][_0x1829e6[_0xe95f('0x47')]];var _0x47a65d;var _0xc7195=![];var _0x58cece=0x2;var _0x3a2026=0x3;if(_0x5cb215){switch(_0x2ccba8){case'1':_0x5cb215[_0xe95f('0x7b')]+=0x1;_0x1829e6[_0xe95f('0x7c')]+=0x1;_0x1829e6[_0xe95f('0x7d')]=ut[_0xe95f('0x7e')](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0x0,'NoSuchNumber');ami[_0xe95f('0x1f')](_0xe95f('0x7f'),ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0x81')));rpcDb[_0xe95f('0x6c')](_0x1829e6,_0xe95f('0x82'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'0',_0x5cb215)[_0xe95f('0x5a')](function(_0x2a43f8){_0xc7195=_0x2a43f8[_0xe95f('0x84')]==0x1;_0x58cece=_0x5cb215[_0xe95f('0x85')];_0x3a2026=_0x5cb215[_0xe95f('0x86')];if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215['dialGlobalMaxRetry']){_0x47a65d=ut['cloneAction'](_0x1829e6,0xf,'Global');rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0x87'));}else{if(_0x1829e6[_0xe95f('0x7c')]>=_0x5cb215[_0xe95f('0x88')]){rpcDb[_0xe95f('0x70')](_0x1829e6,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xe95f('0x89')](ut[_0xe95f('0x8a')](_0x1829e6,_0xe95f('0x7c'),_0x5cb215[_0xe95f('0x85')]),_0x1829e6['unlockAgent'],_0x1829e6['activeContact']);}}delete this[_0xe95f('0x10')][_0x2d6e60['linkedid']];}else{_0x1829e6['countnosuchnumberretry']++;logger[_0xe95f('0x20')]('actioncountonusuch',_0x1829e6[_0xe95f('0x7c')]);logger['info']('id',_0x1829e6[_0xe95f('0x8b')]);_0x45e3da[_0xe95f('0x8c')]({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countnosuchnumberretry':_0x1829e6['countnosuchnumberretry']}})[_0xe95f('0x5a')](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});break;case _0xe95f('0x8e'):var _0x236fea=moment()['format'](_0xe95f('0x65'));_0x1829e6[_0xe95f('0x8f')]=_0x236fea;_0x1829e6[_0xe95f('0x90')]=_0x236fea;_0x1829e6['dialAnswer']=!![];_0x5cb215[_0xe95f('0x29')]+=0x1;logger[_0xe95f('0x20')](_0xe95f('0x91'),_0x1829e6[_0xe95f('0x92')],_0xe95f('0x93'),_0x5cb215[_0xe95f('0x25')],_0xe95f('0x48'),_0x5cb215['pTalking']);ami[_0xe95f('0x1f')]('custom:agentconnect',ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0x94'),this[_0xe95f('0xd')][_0x1829e6[_0xe95f('0x47')]]));if(_0x5cb215[_0xe95f('0x95')]){ami['emit'](_0xe95f('0x96'),ut['buildAcw'](_0x1829e6));}break;case'16':ami[_0xe95f('0x1f')](_0xe95f('0x97'),ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0x98'),this[_0xe95f('0xd')][_0x1829e6[_0xe95f('0x47')]]));emitVoiceQueueChannelRemove(ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0x98')));_0x5cb215[_0xe95f('0x99')]+=0x1;_0x5cb215[_0xe95f('0x9a')]+=0x1;_0x5cb215[_0xe95f('0x9b')]+=0x1;ut['decrementTalkink'](_0x5cb215,_0xe95f('0x9c'));_0x1829e6['countglobal']=ut[_0xe95f('0x7e')](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0x4,_0xe95f('0x9d'));rpcDb[_0xe95f('0x6c')](_0x1829e6,_0xe95f('0x9e'));rpcDb[_0xe95f('0x70')](_0x1829e6,_0xe95f('0x9f'));rpcDb['crateCustomerReportQueue'](_0x1829e6);_0x5cb215[_0xe95f('0xa0')]+=_0x1829e6['talktime'];_0x5cb215[_0xe95f('0xa1')]+=_0x1829e6[_0xe95f('0xa2')];logger[_0xe95f('0x20')](_0xe95f('0xa3'),_0x1829e6[_0xe95f('0x92')],_0xe95f('0x93'),_0x5cb215[_0xe95f('0x25')],'pTalking:\x20',_0x5cb215[_0xe95f('0x29')]);delete this[_0xe95f('0x10')][_0x2d6e60[_0xe95f('0xa4')]];break;case'BUSY':_0x5cb215['outboundBusyCallsDay']+=0x1;_0x1829e6[_0xe95f('0xa5')]+=0x1;_0x1829e6[_0xe95f('0x7d')]=ut[_0xe95f('0x7e')](_0x1829e6);ut['logCustomer'](_0x1829e6,0x5,_0xe95f('0xa6'));_0x58cece=_0x5cb215[_0xe95f('0xa7')];_0x3a2026=_0x5cb215[_0xe95f('0x86')];ami[_0xe95f('0x1f')]('custom:agentbusy',ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0xa8')));rpcDb['createCustomerHistory'](_0x1829e6,_0xe95f('0xa9'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'5',_0x5cb215)['then'](function(_0x5c9186){_0xc7195=_0x5c9186['additional']==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215['dialGlobalMaxRetry']){_0x47a65d=ut['cloneAction'](_0x1829e6,0xf,_0xe95f('0xaa'));rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xab'));}else{if(_0x1829e6[_0xe95f('0xa5')]>=_0x5cb215[_0xe95f('0xac')]){rpcDb[_0xe95f('0x70')](_0x1829e6,_0xe95f('0xa9'));}else{rpcDb['rescheduleContact'](ut[_0xe95f('0x8a')](_0x1829e6,_0xe95f('0xa5'),_0x5cb215[_0xe95f('0xa7')]),_0x1829e6[_0xe95f('0xad')],_0x1829e6[_0xe95f('0xae')]);}}}else{_0x1829e6[_0xe95f('0xa5')]++;_0x45e3da[_0xe95f('0x8c')]({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countbusyretry':_0x1829e6[_0xe95f('0xa5')]}})[_0xe95f('0x5a')](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});break;case _0xe95f('0xaf'):_0x5cb215[_0xe95f('0xb0')]+=0x1;_0x1829e6['countnoanswerretry']+=0x1;_0x1829e6[_0xe95f('0x7d')]=ut['totalGlobal'](_0x1829e6);ut['logCustomer'](_0x1829e6,0x3,'NoAnswer');_0x58cece=_0x5cb215[_0xe95f('0xb1')];_0x3a2026=_0x5cb215[_0xe95f('0x86')];var _0x43d569=ut[_0xe95f('0xb2')](_0x1829e6,_0x5cb215);ami[_0xe95f('0x1f')](_0xe95f('0xb3'),_0x43d569);rpcDb[_0xe95f('0x6c')](_0x1829e6,'[callProgressDetectingCustomer][logNoAnswer]');_0x45e3da['verifyAdditionalPhones'](_0x1829e6,'3',_0x5cb215)[_0xe95f('0x5a')](function(_0x36a311){_0xc7195=_0x36a311['additional']==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut[_0xe95f('0xb5')](_0x1829e6,0xf,'Global');rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xb6'));}else{if(_0x1829e6[_0xe95f('0xb7')]>=_0x5cb215['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x1829e6,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0xe95f('0x8a')](_0x1829e6,'countnoanswerretry',_0x5cb215['dialNoAnswerRetryFrequency']),_0x1829e6[_0xe95f('0xad')],_0x1829e6[_0xe95f('0xae')]);}}}else{_0x1829e6[_0xe95f('0xb7')]++;_0x45e3da[_0xe95f('0x8c')]({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countnoanswerretry':_0x1829e6[_0xe95f('0xb7')]}})[_0xe95f('0x5a')](function(){_0x45e3da['swapAdditionalPhones'](_0x1829e6,_0x58cece,_0x3a2026)['then'](function(){});});}});break;case _0xe95f('0xb8'):_0x5cb215['outboundCongestionCallsDay']+=0x1;_0x1829e6[_0xe95f('0xb9')]+=0x1;_0x1829e6['countglobal']=ut[_0xe95f('0x7e')](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0x8,_0xe95f('0xba'));_0x58cece=_0x5cb215[_0xe95f('0xbb')];_0x3a2026=_0x5cb215[_0xe95f('0x86')];ami[_0xe95f('0x1f')](_0xe95f('0xbc'),ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0xbd')));rpcDb['createCustomerHistory'](_0x1829e6,'[callProgressDetectingCustomer][logCongestion]');_0x45e3da[_0xe95f('0x83')](_0x1829e6,'8',_0x5cb215)[_0xe95f('0x5a')](function(_0x427932){_0xc7195=_0x427932[_0xe95f('0x84')]==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut[_0xe95f('0xb5')](_0x1829e6,0xf,'Global');rpcDb['createCustomerFinal'](_0x47a65d,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x1829e6[_0xe95f('0xb9')]>=_0x5cb215['dialCongestionMaxRetry']){rpcDb[_0xe95f('0x70')](_0x1829e6,_0xe95f('0xbe'));}else{rpcDb[_0xe95f('0x89')](ut[_0xe95f('0x8a')](_0x1829e6,_0xe95f('0xb9'),_0x5cb215[_0xe95f('0xa7')]),_0x1829e6[_0xe95f('0xad')],_0x1829e6[_0xe95f('0xae')]);}}}else{_0x1829e6['countcongestionretry']++;_0x45e3da['incrementPreviewCounters']({'id':_0x1829e6['idContact'],'field':{'countcongestionretry':_0x1829e6['countcongestionretry']}})['then'](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)['then'](function(){});});}});break;case _0xe95f('0xbf'):_0x5cb215['outboundRejectCallsDay']+=0x1;_0x1829e6['countagentrejectretry']+=0x1;_0x1829e6['countglobal']=ut['totalGlobal'](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0x14,'AgentReject');_0x58cece=_0x5cb215[_0xe95f('0xc0')];_0x3a2026=_0x5cb215[_0xe95f('0x86')];ami[_0xe95f('0x1f')](_0xe95f('0xc1'),ut[_0xe95f('0x80')](_0x1829e6,'agentreject'));rpcDb['createCustomerHistory'](_0x1829e6,_0xe95f('0xc2'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'20',_0x5cb215)[_0xe95f('0x5a')](function(_0x5cc848){_0xc7195=_0x5cc848['additional']==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut[_0xe95f('0xb5')](_0x1829e6,0x14,'AgentReject');rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xc3'));}else{if(_0x1829e6[_0xe95f('0xc4')]>=_0x5cb215['dialAgentRejectMaxRetry']){rpcDb[_0xe95f('0x70')](_0x1829e6,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xe95f('0x89')](ut[_0xe95f('0x8a')](_0x1829e6,_0xe95f('0xc4'),_0x5cb215[_0xe95f('0xc0')]),_0x1829e6[_0xe95f('0xad')],_0x1829e6[_0xe95f('0xae')]);}}}else{_0x1829e6[_0xe95f('0xb7')]++;_0x45e3da[_0xe95f('0x8c')]({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countnoanswerretry':_0x1829e6['countnoanswerretry']}})[_0xe95f('0x5a')](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});break;case _0xe95f('0xc5'):_0x5cb215['outboundAbandonedCallsDay']+=0x1;_0x1829e6['countabandonedretry']+=0x1;_0x1829e6['countglobal']=ut[_0xe95f('0x7e')](_0x1829e6);ut['logCustomer'](_0x1829e6,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x1829e6,_0xe95f('0xc6'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'11',_0x5cb215)['then'](function(_0x298e5e){_0xc7195=_0x298e5e[_0xe95f('0x84')]==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut['cloneAction'](_0x1829e6,0xf,_0xe95f('0xaa'));rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xc6'));}else{if(_0x1829e6['countabandonedetry']>=_0x5cb215[_0xe95f('0xc7')]){rpcDb[_0xe95f('0x70')](_0x1829e6,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0xe95f('0x8a')](_0x1829e6,_0xe95f('0xc8'),_0x5cb215[_0xe95f('0xc9')]),_0x1829e6[_0xe95f('0xad')],_0x1829e6[_0xe95f('0xae')]);}}}else{_0x1829e6[_0xe95f('0xb7')]++;_0x45e3da['incrementPreviewCounters']({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countnoanswerretry':_0x1829e6[_0xe95f('0xb7')]}})['then'](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});break;case'18':_0x5cb215[_0xe95f('0xca')]+=0x1;_0x1829e6[_0xe95f('0xcb')]+=0x1;_0x1829e6['countglobal']=ut[_0xe95f('0x7e')](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0x12,_0x2d6e60[_0xe95f('0xcc')]||_0x2d6e60[_0xe95f('0xcd')]);ami[_0xe95f('0x1f')]('custom:amd',ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0xce')));rpcDb[_0xe95f('0x6c')](_0x1829e6,_0xe95f('0xcf'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'18',_0x5cb215)[_0xe95f('0x5a')](function(_0x1b3dcf){_0xc7195=_0x1b3dcf['additional']==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut['cloneAction'](_0x1829e6,0x12,'Global');rpcDb['createCustomerFinal'](_0x47a65d,_0xe95f('0xcf'));}else{rpcDb[_0xe95f('0x70')](_0x1829e6,_0xe95f('0xcf'));}}else{_0x1829e6['countnoanswerretry']++;_0x45e3da[_0xe95f('0x8c')]({'id':_0x1829e6[_0xe95f('0x8b')],'field':{'countnoanswerretry':_0x1829e6[_0xe95f('0xb7')]}})['then'](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});delete this[_0xe95f('0x10')][_0x2d6e60[_0xe95f('0xa4')]];break;case'19':_0x5cb215[_0xe95f('0xca')]+=0x1;_0x1829e6[_0xe95f('0x7d')]=ut[_0xe95f('0x7e')](_0x1829e6);ut['logCustomer'](_0x1829e6,0x13,_0x2d6e60[_0xe95f('0xcc')]||_0x2d6e60[_0xe95f('0xcd')]);ami[_0xe95f('0x1f')](_0xe95f('0xd0'),ut[_0xe95f('0x80')](_0x1829e6,_0xe95f('0xce')));rpcDb[_0xe95f('0x6c')](_0x1829e6,_0xe95f('0xd1'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'18',_0x5cb215)[_0xe95f('0x5a')](function(_0x8c17fe){_0xc7195=_0x8c17fe[_0xe95f('0x84')]==0x1;if(!_0xc7195){if(ut[_0xe95f('0x7e')](_0x1829e6)>=_0x5cb215['dialGlobalMaxRetry']){_0x47a65d=ut['cloneAction'](_0x1829e6,0xf,_0xe95f('0xaa'));rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xd1'));}else{rpcDb['createCustomerFinal'](_0x1829e6,_0xe95f('0xd1'));}}else{_0x1829e6['countnoanswerretry']++;_0x45e3da['incrementPreviewCounters']({'id':_0x1829e6['idContact'],'field':{'countnoanswerretry':_0x1829e6[_0xe95f('0xb7')]}})['then'](function(){_0x45e3da[_0xe95f('0x8d')](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});});}});delete this[_0xe95f('0x10')][_0x2d6e60[_0xe95f('0xa4')]];break;default:if(_0x1829e6['dialAnswer']){ut['decrementTalkink'](_0x5cb215,'[default]');ut[_0xe95f('0xd2')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5cb215[_0xe95f('0x25')],_0x2d6e60);}_0x5cb215[_0xe95f('0xca')]+=0x1;_0x1829e6[_0xe95f('0x7d')]=ut[_0xe95f('0x7e')](_0x1829e6);ut[_0xe95f('0x67')](_0x1829e6,0xc,_0x2d6e60[_0xe95f('0xcc')]||_0x2d6e60[_0xe95f('0xcd')]);_0x58cece=_0x5cb215['dialAgentRejectRetryFrequency'];_0x3a2026=_0x5cb215[_0xe95f('0x86')];rpcDb[_0xe95f('0x6c')](_0x1829e6,_0xe95f('0xd3'));_0x45e3da[_0xe95f('0x83')](_0x1829e6,'20',_0x5cb215)[_0xe95f('0x5a')](function(_0x1b8562){_0xc7195=_0x1b8562[_0xe95f('0x84')]==0x1;if(!_0xc7195){if(ut['totalGlobal'](_0x1829e6)>=_0x5cb215[_0xe95f('0xb4')]){_0x47a65d=ut[_0xe95f('0xb5')](_0x1829e6,0xf,_0xe95f('0xaa'));rpcDb[_0xe95f('0x70')](_0x47a65d,_0xe95f('0xd4'));}else{rpcDb[_0xe95f('0x70')](_0x1829e6,_0xe95f('0xd4'));}delete this[_0xe95f('0x10')][_0x2d6e60[_0xe95f('0xa4')]];}else{_0x45e3da['swapAdditionalPhones'](_0x1829e6,_0x58cece,_0x3a2026)[_0xe95f('0x5a')](function(){});}});}if(!(_0x1829e6['dialAnswer']&&_0x2ccba8==='16')){ut[_0xe95f('0x53')](_0x5cb215,_0xe95f('0xd5'));logger[_0xe95f('0x20')]('[originated][decrement][callProgressDetectingCustomer]',_0x1829e6[_0xe95f('0x92')],_0xe95f('0x93'),_0x5cb215[_0xe95f('0x25')],_0xe95f('0x46'),_0x5cb215[_0xe95f('0x28')]);}if(_0x2ccba8!==_0xe95f('0x8e')){delete this[_0xe95f('0x10')][_0x2d6e60[_0xe95f('0xa4')]];delete this[_0xe95f('0x10')][_0x2d6e60['destlinkedid']];}_0x5cb215[_0xe95f('0xd6')]=!![];}};Preview[_0xe95f('0x34')]['callProgressDetectingAgent']=function(_0x24b393,_0x92e538,_0x590576){if(_[_0xe95f('0xd7')](_0x92e538)&&'object'!==typeof _0x92e538){return;}if(_[_0xe95f('0xd7')](_0x590576)&&'object'!==typeof _0x590576){return;}switch(_0x590576[_0xe95f('0xd8')]){case'0':ut[_0xe95f('0xd9')](_0x24b393,0x0,_0xe95f('0xda'));rpcDb[_0xe95f('0xdb')](_0x24b393,_0xe95f('0xdc'));break;case'3':ut[_0xe95f('0xd9')](_0x24b393,0x3,_0xe95f('0xdd'));rpcDb[_0xe95f('0xdb')](_0x24b393,_0xe95f('0xde'));break;case'5':ut[_0xe95f('0xd9')](_0x24b393,0x5,_0xe95f('0xa6'));rpcDb[_0xe95f('0xdb')](_0x24b393,_0xe95f('0xdf'));break;case'8':ut['logAgent'](_0x24b393,0x8,_0xe95f('0xba'));rpcDb['createAgentHistory'](_0x24b393,_0xe95f('0xe0'));break;case'22':ut['logAgent'](_0x24b393,0x16,_0xe95f('0xe1'));rpcDb[_0xe95f('0xdb')](_0x24b393,_0xe95f('0xe2'));break;default:ut[_0xe95f('0xd9')](_0x24b393,0xc,_0x590576[_0xe95f('0xd8')]);rpcDb[_0xe95f('0xdb')](_0x24b393,_0xe95f('0xe0'));}ut[_0xe95f('0x53')](_0x92e538,'[callProgressDetectingAgent]');logger[_0xe95f('0x20')](_0xe95f('0xe3'),_0x24b393[_0xe95f('0x92')],_0xe95f('0x93'),_0x92e538[_0xe95f('0x25')],_0xe95f('0x46'),_0x92e538['originated']);delete this['actions'][_0x24b393[_0xe95f('0x92')]];};Preview[_0xe95f('0x34')][_0xe95f('0x83')]=function(_0x116be5,_0x2dae42,_0x32e71d){return cmHopperAdditionalPhone[_0xe95f('0x83')](_0x116be5,_0x2dae42,_0x32e71d)[_0xe95f('0x51')](logger['info'](_0xe95f('0xe4')));};Preview[_0xe95f('0x34')][_0xe95f('0x8d')]=function(_0x44eb30,_0xd1bf26,_0x4a6aa){return cmHopperAdditionalPhone[_0xe95f('0x8d')](_0x44eb30,_0xd1bf26,_0x4a6aa)['catch'](logger['info'](_0xe95f('0xe5')));};Preview['prototype']['incrementPreviewCounters']=function(_0x547db8){return Promise['resolve']()[_0xe95f('0x5a')](cmHopperAdditionalPhone[_0xe95f('0x8c')](_0x547db8))['catch'](logger[_0xe95f('0x20')](_0xe95f('0xe6')));};Preview[_0xe95f('0x34')][_0xe95f('0xe7')]=function(_0x5dd159,_0x339133,_0xba5930,_0x5cb18b,_0x2f7b84){var _0x9bcb52=this;return new Promise(function(_0xef1016,_0x26da19){if(_[_0xe95f('0x44')](_0x339133)||_['isNil'](_0x339133[_0xe95f('0xe8')])||_[_0xe95f('0x44')](_0x339133[_0xe95f('0xe9')])||_[_0xe95f('0x44')](_0x339133[_0xe95f('0x4c')])){_0x26da19(ut['message'](_0xe95f('0xea'),_0x5cb18b,_0x2f7b84));return;}var _0xd84e8b=uuid['v4']();var _0x1f93af=_0x9bcb52[_0xe95f('0xd')][_0x339133['Queue'][_0xe95f('0x25')]];var _0x22f150=_0xba5930?_0x9bcb52[_0xe95f('0x11')][_0xba5930]['id']:undefined;_0x9bcb52[_0xe95f('0x10')][_0xd84e8b]=new Action(_0x339133,_0x1f93af,_0xd84e8b,_0xba5930,_0x22f150);var _0x382ebb=_0x9bcb52[_0xe95f('0x10')][_0xd84e8b];_0x382ebb[_0xe95f('0xad')]=_0x5cb18b;_0x382ebb[_0xe95f('0xae')]=_0x2f7b84;_0x382ebb[_0xe95f('0xeb')]=_0xba5930;if(_['isEmpty'](_0x5dd159)){_0x9bcb52[_0xe95f('0xec')](_0x382ebb,_0x1f93af,_0x339133,_0xba5930)[_0xe95f('0x5a')](function(_0x48b830){logger['info'](_0xe95f('0xed'),'Queue:\x20'+_0x382ebb[_0xe95f('0x47')]+_0xe95f('0xee')+_0x382ebb[_0xe95f('0x8b')],JSON[_0xe95f('0x22')](_0x48b830));ami[_0xe95f('0x1f')](_0xe95f('0xef'),ut[_0xe95f('0x80')](_0x382ebb,_0xe95f('0xf0'),_0x9bcb52[_0xe95f('0xd')][_0x382ebb[_0xe95f('0x47')]]));_0xef1016(ut[_0xe95f('0x2c')](_0xe95f('0xf1')));})[_0xe95f('0x51')](function(_0x1682e5){ut['logger']('[Preview][execCall][failure]',_0x1682e5);_0x26da19(ut[_0xe95f('0x2c')](_0xe95f('0xf2'),_0x5cb18b,_0x2f7b84));});}else{_0x1f93af[_0xe95f('0xf3')]+=0x1;ut[_0xe95f('0xf4')](_0x382ebb);rpcDb[_0xe95f('0xf5')](_0x382ebb,_0xe95f('0xf6'));delete _0x9bcb52[_0xe95f('0x10')][_0xd84e8b];_0x26da19(ut[_0xe95f('0x2c')](_0xe95f('0xf7'),_0x5cb18b,_0x2f7b84));}});};Preview['prototype'][_0xe95f('0x75')]=function(_0x1ec36c){return!_[_0xe95f('0x44')](_0x1ec36c)&&!_[_0xe95f('0x44')](_0x1ec36c['name'])&&!_['isNil'](_0x1ec36c[_0xe95f('0xf8')])&&_0x1ec36c['active']&&!_[_0xe95f('0x44')](this[_0xe95f('0xf')][util[_0xe95f('0x23')](_0xe95f('0xf9'),_0x1ec36c['name'])])&&!_[_0xe95f('0x44')](this[_0xe95f('0xf')][util[_0xe95f('0x23')](_0xe95f('0xf9'),_0x1ec36c[_0xe95f('0x25')])][_0xe95f('0x4f')])&&(this['trunks'][util['format'](_0xe95f('0xf9'),_0x1ec36c[_0xe95f('0x25')])]['status']==='reachable'||this[_0xe95f('0xf')][util[_0xe95f('0x23')](_0xe95f('0xf9'),_0x1ec36c['name'])]['status']==='unmonitored');};Preview[_0xe95f('0x34')][_0xe95f('0x60')]=function(_0x3e8f6a,_0x35bc77){return this[_0xe95f('0xfa')](_0x3e8f6a,_0x35bc77)[_0xe95f('0x5a')](function(_0x2ba7f8){return _[_0xe95f('0x49')](_0x2ba7f8,[_0xe95f('0x2c')]);})['catch'](function(_0x5c586b){if(_0x5c586b['unlock']){rpcDb[_0xe95f('0xfb')](_0x3e8f6a);}if(_0x5c586b[_0xe95f('0xf8')]){rpcDb['disableContact'](_0x3e8f6a);}throw _[_0xe95f('0x49')](_0x5c586b,[_0xe95f('0x2c')]);});};Preview[_0xe95f('0x34')][_0xe95f('0xfa')]=function(_0x36a26e,_0x27db69){var _0x3637db=this;var _0x5d2328,_0x2f41ae;return rpcDb[_0xe95f('0xfc')](_0x36a26e)['then'](function(_0x257638){if(!_[_0xe95f('0x44')](_0x257638[0x0])){_0x2f41ae=_0x257638[0x0]['recallme']?![]:!![];_0x5d2328=_0x257638[0x0][_0xe95f('0xfd')]?!![]:![];_0x5d2328=_0x27db69?!![]:_0x5d2328;}var _0x52dbf3=_0x3637db[_0xe95f('0xfe')](_0x257638);if(_0x52dbf3[_0xe95f('0xff')]){rpcDb[_0xe95f('0x100')](_[_0xe95f('0x49')](_0x257638[0x0],[_0xe95f('0x4c'),_0xe95f('0xe9')]))[_0xe95f('0x5a')](function(_0x53cada){_0x3637db['checkInBlack'](_0x53cada,_0x257638[0x0],_0x27db69,_0x2f41ae,_0x5d2328)[_0xe95f('0x5a')](function(_0xd1fe69){return _0xd1fe69;})[_0xe95f('0x51')](function(_0x5c0c60){throw _0x5c0c60;});})[_0xe95f('0x51')](function(_0x1ec230){ut[_0xe95f('0x31')](_0xe95f('0x101'),_0x1ec230);throw ut['message'](_0xe95f('0x102'),_0x2f41ae,_0x5d2328);});}else{throw ut['message'](_0x52dbf3[_0xe95f('0x2c')],_0x2f41ae,_0x5d2328);}})[_0xe95f('0x51')](function(_0xd396ab){ut['logger'](_0xe95f('0x103'),_0xd396ab);throw ut[_0xe95f('0x2c')](_0xe95f('0x102'),![],!![]);});};Preview['prototype']['validateContact']=function(_0x13139b){if(_[_0xe95f('0x44')](_0x13139b)||_['isEmpty'](_0x13139b)||!_[_0xe95f('0x44')](_0x13139b[0x0]['Agent'])&&_[_0xe95f('0x44')](_0x13139b[0x0][_0xe95f('0x104')][_0xe95f('0x25')])){ut[_0xe95f('0x31')](_0xe95f('0x105'),_0x13139b);return{'isValid':![],'message':_0xe95f('0x106')};}var _0x226cba=this[_0xe95f('0xd')][_0x13139b[0x0]['Queue'][_0xe95f('0x25')]];_0x226cba[_0xe95f('0x2c')]=utils[_0xe95f('0x2d')]['ACTIVE'];if(_[_0xe95f('0x44')](_0x226cba)){ut[_0xe95f('0x31')]('[Preview][validateContact][Empty\x20Campaign]',_0x226cba);return{'isValid':![],'message':_0xe95f('0x107')};}if(!this[_0xe95f('0x75')](_0x226cba['Trunk'])){ut[_0xe95f('0x31')](_0xe95f('0x108'),_0xe95f('0x109')+_0x226cba[_0xe95f('0x25')]+_0xe95f('0x10a'));if(!this[_0xe95f('0x75')](_0x226cba[_0xe95f('0x77')])){ut[_0xe95f('0x31')](_0xe95f('0x108'),_0x226cba['name']+_0xe95f('0x10b'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xe95f('0x74')](_0x226cba[_0xe95f('0x3e')])){ut[_0xe95f('0x31')](_0xe95f('0x10c'),_0x226cba[_0xe95f('0x25')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x226cba[_0xe95f('0x25')]+_0xe95f('0x10d')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0xe95f('0xec')]=function(_0x1c7a24,_0x23f657,_0x2265cb,_0x338432){var _0x341c86=this;return new Promise(function(_0x8261fa,_0x362ca3){var _0x320fa5=_0x1c7a24['uniqueid'];var _0x26372a=_0x341c86[_0xe95f('0x75')](_0x23f657[_0xe95f('0x76')])?util['format'](_0xe95f('0x10e'),_0x23f657[_0xe95f('0x76')][_0xe95f('0x25')],_[_0xe95f('0x44')](_0x23f657[_0xe95f('0x10f')])?'':_0x23f657[_0xe95f('0x10f')][_0xe95f('0x110')]()||'',_0x23f657['dialCutDigit']>0x0?_0x2265cb[_0xe95f('0xe9')]['substring'](_0x23f657['dialCutDigit']):_0x2265cb['phone']):util[_0xe95f('0x23')]('SIP/%s/%s%s',_[_0xe95f('0x44')](_0x23f657[_0xe95f('0x77')])?_0x23f657['Trunk'][_0xe95f('0x25')]:_0x23f657[_0xe95f('0x77')]['name'],_['isNil'](_0x23f657[_0xe95f('0x10f')])?'':_0x23f657['dialPrefix'][_0xe95f('0x110')]()||'',_0x23f657[_0xe95f('0x111')]>0x0?_0x2265cb[_0xe95f('0xe9')][_0xe95f('0x112')](_0x23f657['dialCutDigit']):_0x2265cb['phone']);var _0x5cdc70=_0x341c86[_0xe95f('0x75')](_0x23f657[_0xe95f('0x76')])?ut[_0xe95f('0x113')](_0x23f657[_0xe95f('0x76')][_0xe95f('0x114')],_0x23f657[_0xe95f('0x115')],_0x23f657[_0xe95f('0x116')]>0x0?ut[_0xe95f('0x117')](_0x23f657['dialOriginateCallerIdNumber'],_0x23f657['dialRandomLastDigitCallerIdNumber']):_0x23f657[_0xe95f('0x118')]):ut['getCallerId'](_[_0xe95f('0x44')](_0x23f657[_0xe95f('0x77')])?_0x23f657['Trunk']['callerid']:_0x23f657[_0xe95f('0x77')]['callerid'],_0x23f657[_0xe95f('0x115')],_0x23f657[_0xe95f('0x116')]>0x0?ut[_0xe95f('0x117')](_0x23f657[_0xe95f('0x118')],_0x23f657[_0xe95f('0x116')]):_0x23f657[_0xe95f('0x118')]);if(_0x5cdc70){_0x1c7a24[_0xe95f('0x119')]=ut['extractCalleridName'](_0x5cdc70);_0x1c7a24[_0xe95f('0x11a')]=ut[_0xe95f('0x11b')](_0x5cdc70);}var _0x570d10=ut[_0xe95f('0x11c')](_0x23f657,_0x2265cb,_0x26372a,_0x5cdc70,_0x320fa5,_0x1c7a24);var _0x23182=utils[_0xe95f('0x11d')](_0x2265cb[_0xe95f('0xe8')]);Object[_0xe95f('0x11e')](_0x570d10,_0x23182);_[_0xe95f('0x11f')](_0x1c7a24,ut[_0xe95f('0x120')](_0x570d10));_0x1c7a24['starttime']=moment()[_0xe95f('0x23')](_0xe95f('0x65'));_0x23f657[_0xe95f('0x121')]=_0x570d10;var _0x2ce90b=ut[_0xe95f('0x122')](_0x1c7a24,_0x23f657,_0x570d10,_0x1c7a24[_0xe95f('0xae')],_0x338432);return ami[_0xe95f('0x4e')](_0x2ce90b)[_0xe95f('0x5a')](function(_0x71b2ce){_0x23f657[_0xe95f('0x28')]+=0x1;logger['info']('[originated][increment]',_0x320fa5,_0xe95f('0x93'),_0x23f657[_0xe95f('0x25')],_0xe95f('0x46'),_0x23f657[_0xe95f('0x28')]);_0x8261fa(_0x71b2ce);})['catch'](function(_0x31b57a){ut[_0xe95f('0xd9')](_0x1c7a24,0xe,_0xe95f('0x123'));rpcDb[_0xe95f('0xdb')](_0x1c7a24,'[originateFailure][logOriginateFailure]');_0x362ca3(_0x31b57a);});});};Preview['prototype'][_0xe95f('0x1b')]=function(_0x5bfa21){if(this['actions'][_0x5bfa21[_0xe95f('0xa4')]]){this[_0xe95f('0x10')][_0x5bfa21[_0xe95f('0xa4')]][_0xe95f('0x50')]=_0x5bfa21[_0xe95f('0x50')];}};Preview[_0xe95f('0x34')][_0xe95f('0x13')]=function(_0x36dfef){var _0x2e334d=this;var _0x17c8ad=this['actions'][_0x36dfef['actionid']];if(_0x17c8ad){if(_0x17c8ad[_0xe95f('0xeb')]&&this['agents'][_0x17c8ad['lookAgent']]){ut[_0xe95f('0x124')](_0x17c8ad,this[_0xe95f('0x11')][_0x17c8ad[_0xe95f('0xeb')]][_0xe95f('0x25')],this[_0xe95f('0x11')][_0x17c8ad[_0xe95f('0xeb')]]['id']);}var _0x1b9b6c=_['clone'](_0x17c8ad);_0x1b9b6c[_0xe95f('0x8f')]=moment()[_0xe95f('0x23')](_0xe95f('0x65'));var _0x11167b=_0x2e334d[_0xe95f('0xd')][_0x17c8ad[_0xe95f('0x47')]];if(ut[_0xe95f('0x125')](_0x36dfef['response'])){if(_0x17c8ad['unlockAgent']){rpcDb[_0xe95f('0xfb')](_0x17c8ad[_0xe95f('0x8b')]);}if(_0x17c8ad['activeContact']){rpcDb[_0xe95f('0x63')](_0x17c8ad[_0xe95f('0x8b')]);}ami['emit']('custom:agentringnoanswer',ut[_0xe95f('0x80')](_0x17c8ad,_0xe95f('0x126'),this['campaignsPreview'][_0x17c8ad[_0xe95f('0x47')]]));this['callProgressDetectingAgent'](_0x1b9b6c,_0x11167b,_0x36dfef);}else{_0x17c8ad[_0xe95f('0x64')]=moment()[_0xe95f('0x23')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x1b9b6c,0x4,_0xe95f('0x9d'));rpcDb[_0xe95f('0xdb')](_0x1b9b6c,_0xe95f('0x127'));}}};Preview[_0xe95f('0x34')][_0xe95f('0x16')]=function(_0x45b35d){var _0x6770a2=this[_0xe95f('0x10')][_0x45b35d[_0xe95f('0xa4')]];var _0x14452e;if(_0x6770a2){_0x14452e=this[_0xe95f('0xd')][_0x6770a2[_0xe95f('0x47')]];logger[_0xe95f('0x20')](_0xe95f('0x128'),_0x45b35d[_0xe95f('0xa4')],_0xe95f('0x93'),_0x14452e[_0xe95f('0x25')],_0xe95f('0x48'),_0x14452e[_0xe95f('0x29')]);}if(this[_0xe95f('0x10')][_0x45b35d['linkedid']]&&_0x45b35d[_0xe95f('0xa4')]!==_0x45b35d[_0xe95f('0x92')]){if(_0x45b35d[_0xe95f('0x129')]==='16'&&this[_0xe95f('0x10')][_0x45b35d[_0xe95f('0xa4')]][_0xe95f('0x55')]){this[_0xe95f('0x7a')](_0x45b35d,_0x45b35d[_0xe95f('0xa4')],_0x45b35d['cause']);}else if(this[_0xe95f('0x10')][_0x45b35d[_0xe95f('0xa4')]]['dialAnswer']){logger[_0xe95f('0x20')](_0xe95f('0x12a'),_0x45b35d[_0xe95f('0xa4')],_0x45b35d[_0xe95f('0x129')],'\x20Queue',_0x14452e[_0xe95f('0x25')],_0xe95f('0x48'),_0x14452e[_0xe95f('0x29')]);this['callProgressDetectingCustomer'](_0x45b35d,_0x45b35d[_0xe95f('0xa4')],_0x45b35d[_0xe95f('0x129')]);}}else if(_0x6770a2&&_[_0xe95f('0x44')](_0x6770a2['statedesc'])&&_0x14452e[_0xe95f('0x12b')]&&_0x45b35d[_0xe95f('0xa4')]===_0x45b35d[_0xe95f('0x92')]&&_['isNil'](_0x45b35d['reason'])&&_0x45b35d[_0xe95f('0x129')]==='16'&&_0x45b35d[_0xe95f('0x12c')]==='6'&&_['isUndefined'](_0x6770a2[_0xe95f('0x12d')])){if(_0x6770a2[_0xe95f('0xad')]){rpcDb[_0xe95f('0xfb')](_0x6770a2['idContact']);}if(_0x6770a2[_0xe95f('0xae')]){rpcDb['disableContact'](_0x6770a2[_0xe95f('0x8b')]);}_0x45b35d[_0xe95f('0xd8')]='22';this[_0xe95f('0x12e')](_0x6770a2,_0x14452e,_0x45b35d);}else if(_0x6770a2&&_0x6770a2[_0xe95f('0x12d')]){if(_0x45b35d[_0xe95f('0x129')]==='16'&&this['actions'][_0x45b35d['linkedid']][_0xe95f('0x55')]){logger[_0xe95f('0x20')]('[syncHangup][talking][transfer]',_0x45b35d['linkedid'],_0x45b35d[_0xe95f('0x129')],_0xe95f('0x93'),_0x14452e[_0xe95f('0x25')],'pTalking:\x20',_0x14452e[_0xe95f('0x29')]);this['callProgressDetectingCustomer'](_0x45b35d,_0x45b35d['linkedid'],_0x45b35d[_0xe95f('0x129')]);}else if(this[_0xe95f('0x10')][_0x45b35d[_0xe95f('0xa4')]]['dialAnswer']){logger[_0xe95f('0x20')](_0xe95f('0x12a'),_0x45b35d[_0xe95f('0xa4')],_0x45b35d['cause'],_0xe95f('0x93'),_0x14452e[_0xe95f('0x25')],'pTalking:\x20',_0x14452e[_0xe95f('0x29')]);this[_0xe95f('0x7a')](_0x45b35d,_0x45b35d['linkedid'],_0x45b35d[_0xe95f('0x129')]);}}};Preview[_0xe95f('0x34')][_0xe95f('0x19')]=function(_0x308453){if(this[_0xe95f('0x10')][_0x308453[_0xe95f('0x12f')]]&&_0x308453[_0xe95f('0x12f')]!==_0x308453[_0xe95f('0x130')]){this[_0xe95f('0x7a')](_0x308453,_0x308453[_0xe95f('0x12f')],_0x308453[_0xe95f('0xcd')]);}};Preview['prototype']['syncHangupRequest']=function(_0x1b9974){if(this[_0xe95f('0x10')][_0x1b9974[_0xe95f('0xa4')]]&&_0x1b9974['linkedid']!==_0x1b9974[_0xe95f('0x92')]&&!this['actions'][_0x1b9974[_0xe95f('0xa4')]][_0xe95f('0x55')]){if(_0x1b9974['cause']==='1'){this[_0xe95f('0x7a')](_0x1b9974,_0x1b9974[_0xe95f('0xa4')],_0x1b9974[_0xe95f('0x129')]);}}};Preview[_0xe95f('0x34')][_0xe95f('0x131')]=function(_0x2aee2a,_0x5dc0c4,_0x43d4d1){if(this[_0xe95f('0x10')][_0x2aee2a]){if(_['isNil'](this['actions'][_0x2aee2a]['variables'])){this[_0xe95f('0x10')][_0x2aee2a]['variables']={};}this['actions'][_0x2aee2a]['variables'][_0x5dc0c4]=_0x43d4d1;}};Preview[_0xe95f('0x34')][_0xe95f('0x1c')]=function(_0x10d529){try{if(!_[_0xe95f('0x44')](_0x10d529)){if(ut[_0xe95f('0x132')](_[_0xe95f('0x133')](_0x10d529[_0xe95f('0x134')])[0x0])){this[_0xe95f('0x131')](_0x10d529['uniqueid'],_[_0xe95f('0x133')](_0x10d529[_0xe95f('0x134')])[0x0],_0x10d529[_0xe95f('0x135')]);}}}catch(_0x151089){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x151089,{'showHidden':![],'depth':null}));}};Preview[_0xe95f('0x34')][_0xe95f('0x136')]=function(_0x4d0b25){if(_0x4d0b25){if(this[_0xe95f('0x10')][_0x4d0b25[_0xe95f('0x137')]]){this['actions'][_0x4d0b25['transfertargetlinkedid']][_0xe95f('0x12d')]=!![];}}};Preview[_0xe95f('0x34')][_0xe95f('0x1e')]=function(_0xc13c24){if(_0xc13c24){if(this[_0xe95f('0x10')][_0xc13c24[_0xe95f('0x138')]]){this[_0xe95f('0x10')][_0xc13c24[_0xe95f('0x138')]][_0xe95f('0x12d')]=!![];}}};module[_0xe95f('0x139')]=Preview; \ No newline at end of file +var _0xb156=['[callProgressDetectingCustomer][logBusy]','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','dialNoAnswerRetryFrequency','incrementPreviewCounters','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[originated][decrement][callProgressDetectingAgent]','[swapAdditionalPhone]\x20','resolve','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','addVariables','setXMDContactVariables','Contact','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','syncVarSet','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','name','voice_queue_channel:remove','emit','originated','pTalking','sendMessageOneNotActive','available','message','CAMPAIGN_STATUS','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','DEACTIVATED','logger','syncCampaigns','hasOwnProperty','dialMethod','type','outbound','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','catch','disableContact','starttime','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','setMessage','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','Trunk','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','custom:agentbusy','busy'];(function(_0x59bd74,_0x51e23a){var _0x310574=function(_0xa102d6){while(--_0xa102d6){_0x59bd74['push'](_0x59bd74['shift']());}};_0x310574(++_0x51e23a);}(_0xb156,0x1da));var _0x6b15=function(_0x593683,_0x2b3213){_0x593683=_0x593683-0x0;var _0x44cc39=_0xb156[_0x593683];return _0x44cc39;};'use strict';var util=require(_0x6b15('0x0'));var _=require(_0x6b15('0x1'));var uuid=require(_0x6b15('0x2'));var moment=require(_0x6b15('0x3'));var Redis=require(_0x6b15('0x4'));var config=require(_0x6b15('0x5'));var logger=require(_0x6b15('0x6'))(_0x6b15('0x7'));var loggerAction=require(_0x6b15('0x6'))('actionPreview');var ami=require(_0x6b15('0x8'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x6b15('0x9'));var Action=require(_0x6b15('0xa'));var ut=require(_0x6b15('0xb'));var utils=require(_0x6b15('0xc'));config['redis']=_[_0x6b15('0xd')](config['redis'],{'host':_0x6b15('0xe'),'port':0x18eb});var io=require(_0x6b15('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x6b15('0x10')][_0x6b15('0x11')]=function(_0x320b8d){this[_0x6b15('0x12')]=this['tail']?this[_0x6b15('0x12')][_0x6b15('0x13')](_0x320b8d):_0x320b8d();};function Preview(_0x190af5){this['sequence']=new Sequence();this[_0x6b15('0x14')]=_0x190af5[_0x6b15('0x15')];this[_0x6b15('0x16')]=_0x190af5[_0x6b15('0x16')];this[_0x6b15('0x17')]={};this[_0x6b15('0x18')]=_0x190af5[_0x6b15('0x18')];this[_0x6b15('0x19')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0x6b15('0x1a')](this));ami['on']('hangup',this[_0x6b15('0x1b')][_0x6b15('0x1a')](this));ami['on'](_0x6b15('0x1c'),this[_0x6b15('0x1d')]['bind'](this));ami['on'](_0x6b15('0x1e'),this['syncDialEnd'][_0x6b15('0x1a')](this));ami['on']('newexten',this[_0x6b15('0x1f')][_0x6b15('0x1a')](this));ami['on'](_0x6b15('0x20'),this['syncVarSet'][_0x6b15('0x1a')](this));ami['on'](_0x6b15('0x21'),this[_0x6b15('0x22')][_0x6b15('0x1a')](this));ami['on'](_0x6b15('0x23'),this['syncBlindTransfer'][_0x6b15('0x1a')](this));this[_0x6b15('0x24')](this[_0x6b15('0x14')]);}function emit(_0x146ab2,_0x40957e,_0x15a1bd){io['to'](_0x146ab2)['emit'](_0x40957e,_0x15a1bd);}function emitVoiceQueueChannelRemove(_0x47293b){logger[_0x6b15('0x25')](_0x6b15('0x26'),JSON['stringify'](_0x47293b));emit(util[_0x6b15('0x27')]('voice:queue:%s',_0x47293b[_0x6b15('0x28')]),_0x6b15('0x29'),_0x47293b);io[_0x6b15('0x2a')]('voice_queue_presence:remove',_0x47293b);}function notSendMessagesQueue(_0x5c8e71){if(_0x5c8e71['sendMessageOneNotActive']){if(_0x5c8e71[_0x6b15('0x2b')]===0x0&&_0x5c8e71[_0x6b15('0x2c')]===0x0){_0x5c8e71[_0x6b15('0x2d')]=![];_0x5c8e71[_0x6b15('0x2e')]=0x0;_0x5c8e71['paused']=0x0;_0x5c8e71[_0x6b15('0x2f')]=utils[_0x6b15('0x30')][_0x6b15('0x31')];ut['logger'](_0x6b15('0x32'),_0x5c8e71[_0x6b15('0x28')]+'\x20is\x20not\x20active');}else{_0x5c8e71[_0x6b15('0x2f')]=utils[_0x6b15('0x30')][_0x6b15('0x33')];ut[_0x6b15('0x34')](_0x6b15('0x32'),_0x5c8e71[_0x6b15('0x28')]+'\x20is\x20deactivated');}}}Preview['prototype'][_0x6b15('0x24')]=function(){var _0xf26ede=this;setInterval(function(){_0xf26ede[_0x6b15('0x35')]();},0x7cf);};Preview[_0x6b15('0x10')][_0x6b15('0x35')]=function(){var _0x2c8a6a=this[_0x6b15('0x14')];this[_0x6b15('0x19')]+=0x1;for(var _0x59c9e1 in _0x2c8a6a){if(_0x2c8a6a[_0x6b15('0x36')](_0x59c9e1)&&(_0x2c8a6a[_0x59c9e1][_0x6b15('0x37')]===_0x6b15('0x7')||_0x2c8a6a[_0x59c9e1][_0x6b15('0x37')]==='booked')&&_0x2c8a6a[_0x59c9e1]['type']==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x6b15('0x19')]=0x0;this['clearZombieChannels']();}}if(_0x2c8a6a[_0x6b15('0x36')](_0x59c9e1)&&_0x2c8a6a[_0x59c9e1]['dialMethod']===_0x6b15('0x7')&&_0x2c8a6a[_0x59c9e1][_0x6b15('0x38')]===_0x6b15('0x39')){if(_0x2c8a6a[_0x59c9e1][_0x6b15('0x3a')]){this['setMessage'](_0x2c8a6a[_0x59c9e1]);if(_0x2c8a6a[_0x59c9e1][_0x6b15('0x3b')])this[_0x6b15('0x3c')](_0x2c8a6a[_0x59c9e1]);}else{notSendMessagesQueue(_0x2c8a6a[_0x59c9e1]);}}}};Preview[_0x6b15('0x10')][_0x6b15('0x3d')]=function(_0xa1f70e){var _0x494a10=this;this[_0x6b15('0x3e')][_0x6b15('0x11')](function(){if(!_[_0x6b15('0x3f')](_0x494a10[_0x6b15('0x17')][_0xa1f70e])){loggerAction[_0x6b15('0x25')]('[clearZombieChannels][talking]',_0xa1f70e,_0x6b15('0x40'),_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x41')],_0x6b15('0x42'),JSON[_0x6b15('0x43')](_0x494a10[_0x6b15('0x14')][_0x494a10['actions'][_0xa1f70e]['queue']][_0x6b15('0x2b')]),_0x6b15('0x44'),JSON[_0x6b15('0x43')](_0x494a10[_0x6b15('0x14')][_0x494a10['actions'][_0xa1f70e][_0x6b15('0x41')]][_0x6b15('0x2c')]),JSON[_0x6b15('0x43')](_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x45')]),JSON[_0x6b15('0x43')](_[_0x6b15('0x46')](_0x494a10[_0x6b15('0x17')][_0xa1f70e],[_0x6b15('0x47'),_0x6b15('0x48'),_0x6b15('0x49'),'ListId'])));return ami['Action']({'action':_0x6b15('0x4a'),'channel':_0x494a10['actions'][_0xa1f70e][_0x6b15('0x4b')]})['catch'](function(_0x5f5410){if(_0x5f5410[_0x6b15('0x2f')]===_0x6b15('0x4c')){setTimeout(function(){if(_0x494a10[_0x6b15('0x17')][_0xa1f70e]){ut[_0x6b15('0x4d')](_0x494a10[_0x6b15('0x14')][_0x494a10[_0x6b15('0x17')][_0xa1f70e]['queue']],_0x6b15('0x4e'));if(_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x45')]===!![]){ut[_0x6b15('0x4f')](_0x494a10[_0x6b15('0x14')][_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x41')]],_0x6b15('0x4e'));ut[_0x6b15('0x50')](_0x6b15('0x51')+_0xa1f70e,_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x41')]);}ut[_0x6b15('0x50')](_0x6b15('0x52')+_0xa1f70e,_0x494a10[_0x6b15('0x17')][_0xa1f70e][_0x6b15('0x41')]);delete _0x494a10['actions'][_0xa1f70e];}},0x2328);}});}});};Preview['prototype'][_0x6b15('0x53')]=function(){var _0x312410=this;loggerAction[_0x6b15('0x25')](_0x6b15('0x54'),_['size'](this[_0x6b15('0x17')]));for(var _0x582947 in this['actions']){if(_0x312410[_0x6b15('0x17')][_0x6b15('0x36')](_0x582947)){_0x312410[_0x6b15('0x3d')](_0x582947);}}};Preview['prototype'][_0x6b15('0x3c')]=function(_0x28cddd){var _0x180525=this;rpcDb[_0x6b15('0x55')](_0x28cddd['id'],ut[_0x6b15('0x56')](this['agents']))[_0x6b15('0x57')](function(_0x58a80e){if(!_[_0x6b15('0x3f')](_0x58a80e)){for(var _0x5491e3=0x0;_0x5491e3<_0x58a80e['length'];_0x5491e3+=0x1){if(ut[_0x6b15('0x58')](_0x58a80e[_0x5491e3][_0x6b15('0x59')])<_0x28cddd[_0x6b15('0x5a')]*0x3c){if(_0x58a80e[_0x5491e3][_0x6b15('0x5b')]&&!_0x58a80e[_0x5491e3][_0x6b15('0x5b')]['voicePause']){_0x180525[_0x6b15('0x5c')](_0x58a80e[_0x5491e3]['id'])[_0x6b15('0x57')](ut[_0x6b15('0x5d')](_0x6b15('0x5e')))[_0x6b15('0x5f')](ut[_0x6b15('0x5d')](_0x6b15('0x5e')));}else{rpcDb[_0x6b15('0x60')](_0x58a80e[_0x5491e3]['id']);}}else{var _0x415078=new Action(_0x58a80e[_0x5491e3],_0x28cddd);_0x415078[_0x6b15('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x28cddd[_0x6b15('0x62')]+=0x1;ut[_0x6b15('0x63')](_0x415078,0x17,_0x6b15('0x64'));if(_0x28cddd[_0x6b15('0x65')]){rpcDb['rescheduleContactInQueue'](ut[_0x6b15('0x66')](_0x58a80e[_0x5491e3]));rpcDb[_0x6b15('0x67')](_0x415078,_0x6b15('0x68'));}else{ut['logCustomer'](_0x415078,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x415078,_0x6b15('0x69'));rpcDb['createCustomerFinal'](_0x415078,_0x6b15('0x69'));}}}}})[_0x6b15('0x5f')](ut[_0x6b15('0x5d')]('[getContactRecallMe]'));};Preview[_0x6b15('0x10')][_0x6b15('0x6a')]=function(_0x26dc5){_0x26dc5[_0x6b15('0x2d')]=!![];if(ut[_0x6b15('0x6b')](_0x26dc5['loggedIn'])){_0x26dc5[_0x6b15('0x2f')]=utils[_0x6b15('0x30')][_0x6b15('0x6c')];}else if(!ut[_0x6b15('0x6d')](_0x26dc5[_0x6b15('0x3a')])){_0x26dc5[_0x6b15('0x2f')]=utils[_0x6b15('0x30')]['INACTIVE'];}else if(!this['isTrunkReachable'](_0x26dc5[_0x6b15('0x6e')])){if(!this[_0x6b15('0x6f')](_0x26dc5[_0x6b15('0x70')])){_0x26dc5['message']=utils[_0x6b15('0x30')]['UNREACHABLE_TRUNK'];}else{_0x26dc5[_0x6b15('0x2f')]=utils[_0x6b15('0x30')][_0x6b15('0x71')];}}else{_0x26dc5[_0x6b15('0x2f')]=utils[_0x6b15('0x30')][_0x6b15('0x71')];}};Preview[_0x6b15('0x10')]['callProgressDetectingCustomer']=function(_0xda5c40,_0x28d3f9,_0x1381dc){var _0x2145f5=this;var _0x4cb357=this['actions'][_0x28d3f9];var _0x1ab60c=this[_0x6b15('0x14')][_0x4cb357[_0x6b15('0x41')]];var _0x306de1;var _0x3fcd47=![];var _0x4d8443=0x2;var _0x2be5b0=0x3;if(_0x1ab60c){switch(_0x1381dc){case'1':_0x1ab60c[_0x6b15('0x72')]+=0x1;_0x4cb357[_0x6b15('0x73')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x0,_0x6b15('0x76'));ami['emit'](_0x6b15('0x77'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0x79')));rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0x7a'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'0',_0x1ab60c)[_0x6b15('0x57')](function(_0x463597){_0x3fcd47=_0x463597[_0x6b15('0x7c')]==0x1;_0x4d8443=_0x1ab60c[_0x6b15('0x7d')];_0x2be5b0=_0x1ab60c[_0x6b15('0x7e')];if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0xf,_0x6b15('0x81'));rpcDb[_0x6b15('0x82')](_0x306de1,_0x6b15('0x83'));}else{if(_0x4cb357[_0x6b15('0x73')]>=_0x1ab60c['dialNoSuchNumberMaxRetry']){rpcDb[_0x6b15('0x82')](_0x4cb357,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x4cb357,_0x6b15('0x73'),_0x1ab60c[_0x6b15('0x7d')]),_0x4cb357[_0x6b15('0x84')],_0x4cb357[_0x6b15('0x85')]);}}delete this['actions'][_0xda5c40[_0x6b15('0x86')]];}else{_0x4cb357[_0x6b15('0x73')]++;logger[_0x6b15('0x25')](_0x6b15('0x87'),_0x4cb357[_0x6b15('0x73')]);logger[_0x6b15('0x25')]('id',_0x4cb357[_0x6b15('0x88')]);_0x2145f5['incrementPreviewCounters']({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countnosuchnumberretry':_0x4cb357[_0x6b15('0x73')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});break;case _0x6b15('0x8a'):var _0x121e54=moment()[_0x6b15('0x27')](_0x6b15('0x8b'));_0x4cb357[_0x6b15('0x8c')]=_0x121e54;_0x4cb357[_0x6b15('0x8d')]=_0x121e54;_0x4cb357[_0x6b15('0x45')]=!![];_0x1ab60c[_0x6b15('0x2c')]+=0x1;logger[_0x6b15('0x25')](_0x6b15('0x8e'),_0x4cb357[_0x6b15('0x8f')],_0x6b15('0x90'),_0x1ab60c[_0x6b15('0x28')],'pTalking:\x20',_0x1ab60c[_0x6b15('0x2c')]);ami['emit'](_0x6b15('0x91'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0x92'),this['campaignsPreview'][_0x4cb357[_0x6b15('0x41')]]));if(_0x1ab60c[_0x6b15('0x93')]){ami[_0x6b15('0x2a')](_0x6b15('0x94'),ut['buildAcw'](_0x4cb357));}break;case'16':ami[_0x6b15('0x2a')](_0x6b15('0x95'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0x96'),this['campaignsPreview'][_0x4cb357[_0x6b15('0x41')]]));emitVoiceQueueChannelRemove(ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0x96')));_0x1ab60c[_0x6b15('0x97')]+=0x1;_0x1ab60c[_0x6b15('0x98')]+=0x1;_0x1ab60c['answered']+=0x1;ut[_0x6b15('0x4f')](_0x1ab60c,_0x6b15('0x99'));_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x4,_0x6b15('0x9a'));rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0x9b'));rpcDb[_0x6b15('0x82')](_0x4cb357,_0x6b15('0x9c'));rpcDb[_0x6b15('0x9d')](_0x4cb357);_0x1ab60c['sumDuration']+=_0x4cb357[_0x6b15('0x9e')];_0x1ab60c[_0x6b15('0x9f')]+=_0x4cb357[_0x6b15('0x9e')];logger[_0x6b15('0x25')](_0x6b15('0xa0'),_0x4cb357[_0x6b15('0x8f')],'\x20Queue',_0x1ab60c[_0x6b15('0x28')],_0x6b15('0x44'),_0x1ab60c[_0x6b15('0x2c')]);delete this[_0x6b15('0x17')][_0xda5c40[_0x6b15('0x86')]];break;case _0x6b15('0xa1'):_0x1ab60c['outboundBusyCallsDay']+=0x1;_0x4cb357['countbusyretry']+=0x1;_0x4cb357[_0x6b15('0x74')]=ut['totalGlobal'](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x5,'Busy');_0x4d8443=_0x1ab60c['dialBusyRetryFrequency'];_0x2be5b0=_0x1ab60c[_0x6b15('0x7e')];ami[_0x6b15('0x2a')](_0x6b15('0xa2'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0xa3')));rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0xa4'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'5',_0x1ab60c)[_0x6b15('0x57')](function(_0x5e4296){_0x3fcd47=_0x5e4296['additional']==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0xf,_0x6b15('0x81'));rpcDb['createCustomerFinal'](_0x306de1,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4cb357[_0x6b15('0xa5')]>=_0x1ab60c[_0x6b15('0xa6')]){rpcDb[_0x6b15('0x82')](_0x4cb357,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0x6b15('0xa7')](_0x4cb357,_0x6b15('0xa5'),_0x1ab60c['dialBusyRetryFrequency']),_0x4cb357[_0x6b15('0x84')],_0x4cb357['activeContact']);}}}else{_0x4cb357[_0x6b15('0xa5')]++;_0x2145f5['incrementPreviewCounters']({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countbusyretry':_0x4cb357[_0x6b15('0xa5')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});break;case _0x6b15('0xa8'):_0x1ab60c['outboundNoAnswerCallsDay']+=0x1;_0x4cb357[_0x6b15('0xa9')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut['logCustomer'](_0x4cb357,0x3,_0x6b15('0xaa'));_0x4d8443=_0x1ab60c['dialNoAnswerRetryFrequency'];_0x2be5b0=_0x1ab60c[_0x6b15('0x7e')];var _0x158f61=ut[_0x6b15('0xab')](_0x4cb357,_0x1ab60c);ami[_0x6b15('0x2a')](_0x6b15('0xac'),_0x158f61);rpcDb['createCustomerHistory'](_0x4cb357,_0x6b15('0xad'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'3',_0x1ab60c)[_0x6b15('0x57')](function(_0x26247b){_0x3fcd47=_0x26247b[_0x6b15('0x7c')]==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c['dialGlobalMaxRetry']){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0xf,'Global');rpcDb[_0x6b15('0x82')](_0x306de1,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x4cb357['countnoanswerretry']>=_0x1ab60c['dialNoAnswerMaxRetry']){rpcDb[_0x6b15('0x82')](_0x4cb357,_0x6b15('0xad'));}else{rpcDb[_0x6b15('0xae')](ut[_0x6b15('0xa7')](_0x4cb357,_0x6b15('0xa9'),_0x1ab60c[_0x6b15('0xaf')]),_0x4cb357[_0x6b15('0x84')],_0x4cb357[_0x6b15('0x85')]);}}}else{_0x4cb357[_0x6b15('0xa9')]++;_0x2145f5[_0x6b15('0xb0')]({'id':_0x4cb357['idContact'],'field':{'countnoanswerretry':_0x4cb357[_0x6b15('0xa9')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});break;case'CONGESTION':_0x1ab60c['outboundCongestionCallsDay']+=0x1;_0x4cb357[_0x6b15('0xb1')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x8,'Congestion');_0x4d8443=_0x1ab60c[_0x6b15('0xb2')];_0x2be5b0=_0x1ab60c[_0x6b15('0x7e')];ami['emit'](_0x6b15('0xb3'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0xb4')));rpcDb[_0x6b15('0x67')](_0x4cb357,'[callProgressDetectingCustomer][logCongestion]');_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'8',_0x1ab60c)[_0x6b15('0x57')](function(_0x114ed7){_0x3fcd47=_0x114ed7[_0x6b15('0x7c')]==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0xf,_0x6b15('0x81'));rpcDb['createCustomerFinal'](_0x306de1,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4cb357[_0x6b15('0xb1')]>=_0x1ab60c['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x4cb357,_0x6b15('0xb5'));}else{rpcDb[_0x6b15('0xae')](ut[_0x6b15('0xa7')](_0x4cb357,_0x6b15('0xb1'),_0x1ab60c[_0x6b15('0xb6')]),_0x4cb357[_0x6b15('0x84')],_0x4cb357[_0x6b15('0x85')]);}}}else{_0x4cb357[_0x6b15('0xb1')]++;_0x2145f5['incrementPreviewCounters']({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countcongestionretry':_0x4cb357[_0x6b15('0xb1')]}})['then'](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)['then'](function(){});});}});break;case _0x6b15('0xb7'):_0x1ab60c[_0x6b15('0xb8')]+=0x1;_0x4cb357[_0x6b15('0xb9')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut['totalGlobal'](_0x4cb357);ut['logCustomer'](_0x4cb357,0x14,_0x6b15('0xba'));_0x4d8443=_0x1ab60c['dialAgentRejectRetryFrequency'];_0x2be5b0=_0x1ab60c['callAdditionalPhoneAfterMin'];ami[_0x6b15('0x2a')](_0x6b15('0xbb'),ut[_0x6b15('0x78')](_0x4cb357,_0x6b15('0xbc')));rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0xbd'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'20',_0x1ab60c)[_0x6b15('0x57')](function(_0x36ae9e){_0x3fcd47=_0x36ae9e[_0x6b15('0x7c')]==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0x14,_0x6b15('0xba'));rpcDb[_0x6b15('0x82')](_0x306de1,_0x6b15('0xbe'));}else{if(_0x4cb357['countagentrejectretry']>=_0x1ab60c[_0x6b15('0xbf')]){rpcDb['createCustomerFinal'](_0x4cb357,_0x6b15('0xbe'));}else{rpcDb[_0x6b15('0xae')](ut[_0x6b15('0xa7')](_0x4cb357,_0x6b15('0xb9'),_0x1ab60c[_0x6b15('0xc0')]),_0x4cb357[_0x6b15('0x84')],_0x4cb357[_0x6b15('0x85')]);}}}else{_0x4cb357[_0x6b15('0xa9')]++;_0x2145f5[_0x6b15('0xb0')]({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countnoanswerretry':_0x4cb357['countnoanswerretry']}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});break;case'ABANDONED':_0x1ab60c[_0x6b15('0xc1')]+=0x1;_0x4cb357[_0x6b15('0xc2')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut['totalGlobal'](_0x4cb357);ut['logCustomer'](_0x4cb357,0xb,_0x6b15('0xc3'));rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0xc4'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'11',_0x1ab60c)[_0x6b15('0x57')](function(_0x2a9d06){_0x3fcd47=_0x2a9d06[_0x6b15('0x7c')]==0x1;if(!_0x3fcd47){if(ut['totalGlobal'](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut['cloneAction'](_0x4cb357,0xf,_0x6b15('0x81'));rpcDb['createCustomerFinal'](_0x306de1,_0x6b15('0xc4'));}else{if(_0x4cb357['countabandonedetry']>=_0x1ab60c[_0x6b15('0xc5')]){rpcDb[_0x6b15('0x82')](_0x4cb357,_0x6b15('0xc4'));}else{rpcDb[_0x6b15('0xae')](ut[_0x6b15('0xa7')](_0x4cb357,_0x6b15('0xc2'),_0x1ab60c[_0x6b15('0xc6')]),_0x4cb357[_0x6b15('0x84')],_0x4cb357[_0x6b15('0x85')]);}}}else{_0x4cb357[_0x6b15('0xa9')]++;_0x2145f5[_0x6b15('0xb0')]({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countnoanswerretry':_0x4cb357[_0x6b15('0xa9')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});break;case'18':_0x1ab60c[_0x6b15('0xc7')]+=0x1;_0x4cb357[_0x6b15('0xc8')]+=0x1;_0x4cb357['countglobal']=ut['totalGlobal'](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x12,_0xda5c40[_0x6b15('0xc9')]||_0xda5c40[_0x6b15('0xca')]);ami[_0x6b15('0x2a')](_0x6b15('0xcb'),ut[_0x6b15('0x78')](_0x4cb357,'amd'));rpcDb[_0x6b15('0x67')](_0x4cb357,'[callProgressDetectingCustomer][hangupInAMD]');_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'18',_0x1ab60c)[_0x6b15('0x57')](function(_0x5c94cc){_0x3fcd47=_0x5c94cc['additional']==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0x12,'Global');rpcDb[_0x6b15('0x82')](_0x306de1,_0x6b15('0xcc'));}else{rpcDb[_0x6b15('0x82')](_0x4cb357,_0x6b15('0xcc'));}}else{_0x4cb357[_0x6b15('0xa9')]++;_0x2145f5[_0x6b15('0xb0')]({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countnoanswerretry':_0x4cb357[_0x6b15('0xa9')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)[_0x6b15('0x57')](function(){});});}});delete this[_0x6b15('0x17')][_0xda5c40[_0x6b15('0x86')]];break;case'19':_0x1ab60c[_0x6b15('0xc7')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut[_0x6b15('0x63')](_0x4cb357,0x13,_0xda5c40[_0x6b15('0xc9')]||_0xda5c40[_0x6b15('0xca')]);ami[_0x6b15('0x2a')](_0x6b15('0xcb'),ut[_0x6b15('0x78')](_0x4cb357,'amd'));rpcDb['createCustomerHistory'](_0x4cb357,'[callProgressDetectingCustomer][machine]');_0x2145f5['verifyAdditionalPhones'](_0x4cb357,'18',_0x1ab60c)['then'](function(_0xd228e8){_0x3fcd47=_0xd228e8['additional']==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut[_0x6b15('0x80')](_0x4cb357,0xf,'Global');rpcDb[_0x6b15('0x82')](_0x306de1,_0x6b15('0xcd'));}else{rpcDb['createCustomerFinal'](_0x4cb357,_0x6b15('0xcd'));}}else{_0x4cb357[_0x6b15('0xa9')]++;_0x2145f5[_0x6b15('0xb0')]({'id':_0x4cb357[_0x6b15('0x88')],'field':{'countnoanswerretry':_0x4cb357[_0x6b15('0xa9')]}})[_0x6b15('0x57')](function(){_0x2145f5[_0x6b15('0x89')](_0x4cb357,_0x4d8443,_0x2be5b0)['then'](function(){});});}});delete this[_0x6b15('0x17')][_0xda5c40['linkedid']];break;default:if(_0x4cb357[_0x6b15('0x45')]){ut[_0x6b15('0x4f')](_0x1ab60c,_0x6b15('0xce'));ut[_0x6b15('0x50')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x1ab60c['name'],_0xda5c40);}_0x1ab60c[_0x6b15('0xc7')]+=0x1;_0x4cb357[_0x6b15('0x74')]=ut[_0x6b15('0x75')](_0x4cb357);ut['logCustomer'](_0x4cb357,0xc,_0xda5c40['cause-txt']||_0xda5c40[_0x6b15('0xca')]);_0x4d8443=_0x1ab60c[_0x6b15('0xc0')];_0x2be5b0=_0x1ab60c[_0x6b15('0x7e')];rpcDb[_0x6b15('0x67')](_0x4cb357,_0x6b15('0xcf'));_0x2145f5[_0x6b15('0x7b')](_0x4cb357,'20',_0x1ab60c)['then'](function(_0x1581d5){_0x3fcd47=_0x1581d5[_0x6b15('0x7c')]==0x1;if(!_0x3fcd47){if(ut[_0x6b15('0x75')](_0x4cb357)>=_0x1ab60c[_0x6b15('0x7f')]){_0x306de1=ut['cloneAction'](_0x4cb357,0xf,_0x6b15('0x81'));rpcDb['createCustomerFinal'](_0x306de1,_0x6b15('0xd0'));}else{rpcDb[_0x6b15('0x82')](_0x4cb357,_0x6b15('0xd0'));}delete this[_0x6b15('0x17')][_0xda5c40[_0x6b15('0x86')]];}else{_0x2145f5['swapAdditionalPhones'](_0x4cb357,_0x4d8443,_0x2be5b0)['then'](function(){});}});}if(!(_0x4cb357[_0x6b15('0x45')]&&_0x1381dc==='16')){ut[_0x6b15('0x4d')](_0x1ab60c,_0x6b15('0xd1'));logger['info'](_0x6b15('0xd2'),_0x4cb357[_0x6b15('0x8f')],_0x6b15('0x90'),_0x1ab60c[_0x6b15('0x28')],'originated:\x20',_0x1ab60c['originated']);}if(_0x1381dc!=='ANSWER'){delete this['actions'][_0xda5c40[_0x6b15('0x86')]];delete this[_0x6b15('0x17')][_0xda5c40[_0x6b15('0xd3')]];}_0x1ab60c['queueSummaryCountersUpdated']=!![];}};Preview['prototype'][_0x6b15('0xd4')]=function(_0x59c531,_0x543b6f,_0x508bfe){if(_[_0x6b15('0xd5')](_0x543b6f)&&_0x6b15('0xd6')!==typeof _0x543b6f){return;}if(_[_0x6b15('0xd5')](_0x508bfe)&&_0x6b15('0xd6')!==typeof _0x508bfe){return;}switch(_0x508bfe['reason']){case'0':ut[_0x6b15('0xd7')](_0x59c531,0x0,'NoSuchNumber');rpcDb[_0x6b15('0xd8')](_0x59c531,_0x6b15('0xd9'));break;case'3':ut[_0x6b15('0xd7')](_0x59c531,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x59c531,_0x6b15('0xda'));break;case'5':ut[_0x6b15('0xd7')](_0x59c531,0x5,_0x6b15('0xdb'));rpcDb[_0x6b15('0xd8')](_0x59c531,_0x6b15('0xdc'));break;case'8':ut[_0x6b15('0xd7')](_0x59c531,0x8,_0x6b15('0xdd'));rpcDb[_0x6b15('0xd8')](_0x59c531,_0x6b15('0xde'));break;case'22':ut[_0x6b15('0xd7')](_0x59c531,0x16,_0x6b15('0xdf'));rpcDb[_0x6b15('0xd8')](_0x59c531,_0x6b15('0xe0'));break;default:ut[_0x6b15('0xd7')](_0x59c531,0xc,_0x508bfe[_0x6b15('0xe1')]);rpcDb[_0x6b15('0xd8')](_0x59c531,_0x6b15('0xde'));}ut[_0x6b15('0x4d')](_0x543b6f,'[callProgressDetectingAgent]');logger[_0x6b15('0x25')](_0x6b15('0xe2'),_0x59c531[_0x6b15('0x8f')],_0x6b15('0x90'),_0x543b6f[_0x6b15('0x28')],_0x6b15('0x42'),_0x543b6f[_0x6b15('0x2b')]);delete this[_0x6b15('0x17')][_0x59c531['uniqueid']];};Preview[_0x6b15('0x10')][_0x6b15('0x7b')]=function(_0x5ac7fc,_0x467a91,_0x3a120c){return cmHopperAdditionalPhone[_0x6b15('0x7b')](_0x5ac7fc,_0x467a91,_0x3a120c)[_0x6b15('0x5f')](logger[_0x6b15('0x25')]('[verifyAdditionalPhone]\x20'));};Preview['prototype']['swapAdditionalPhones']=function(_0x5a821b,_0x28a6a4,_0x10438c){return cmHopperAdditionalPhone[_0x6b15('0x89')](_0x5a821b,_0x28a6a4,_0x10438c)[_0x6b15('0x5f')](logger[_0x6b15('0x25')](_0x6b15('0xe3')));};Preview[_0x6b15('0x10')]['incrementPreviewCounters']=function(_0xefa3e1){return Promise[_0x6b15('0xe4')]()[_0x6b15('0x57')](cmHopperAdditionalPhone[_0x6b15('0xb0')](_0xefa3e1))[_0x6b15('0x5f')](logger[_0x6b15('0x25')]('[incrementPreviewCounters]\x20'));};Preview['prototype']['checkInBlack']=function(_0xf3acae,_0x549113,_0x205faa,_0x3703c3,_0x1899cf){var _0x39cbbe=this;return new Promise(function(_0x4339f1,_0x202959){if(_['isNil'](_0x549113)||_['isNil'](_0x549113['Contact'])||_[_0x6b15('0x3f')](_0x549113[_0x6b15('0xe5')])||_[_0x6b15('0x3f')](_0x549113[_0x6b15('0x49')])){_0x202959(ut[_0x6b15('0x2f')](_0x6b15('0xe6'),_0x3703c3,_0x1899cf));return;}var _0xbacf11=uuid['v4']();var _0x3d7845=_0x39cbbe[_0x6b15('0x14')][_0x549113[_0x6b15('0x40')][_0x6b15('0x28')]];var _0x21e468=_0x205faa?_0x39cbbe[_0x6b15('0x18')][_0x205faa]['id']:undefined;_0x39cbbe[_0x6b15('0x17')][_0xbacf11]=new Action(_0x549113,_0x3d7845,_0xbacf11,_0x205faa,_0x21e468);var _0x9fdbef=_0x39cbbe[_0x6b15('0x17')][_0xbacf11];_0x9fdbef[_0x6b15('0x84')]=_0x3703c3;_0x9fdbef['activeContact']=_0x1899cf;_0x9fdbef[_0x6b15('0xe7')]=_0x205faa;if(_[_0x6b15('0xe8')](_0xf3acae)){_0x39cbbe[_0x6b15('0xe9')](_0x9fdbef,_0x3d7845,_0x549113,_0x205faa)[_0x6b15('0x57')](function(_0x5baf99){logger[_0x6b15('0x25')](_0x6b15('0xea'),_0x6b15('0xeb')+_0x9fdbef[_0x6b15('0x41')]+'\x20IdHopper:\x20'+_0x9fdbef[_0x6b15('0x88')],JSON['stringify'](_0x5baf99));ami['emit']('custom:agentcalled',ut[_0x6b15('0x78')](_0x9fdbef,_0x6b15('0xec'),_0x39cbbe['campaignsPreview'][_0x9fdbef[_0x6b15('0x41')]]));_0x4339f1(ut[_0x6b15('0x2f')](_0x6b15('0xed')));})[_0x6b15('0x5f')](function(_0x48e468){ut[_0x6b15('0x34')](_0x6b15('0xee'),_0x48e468);_0x202959(ut[_0x6b15('0x2f')](_0x6b15('0xef'),_0x3703c3,_0x1899cf));});}else{_0x3d7845[_0x6b15('0xf0')]+=0x1;ut['logBlacklist'](_0x9fdbef);rpcDb[_0x6b15('0xf1')](_0x9fdbef,_0x6b15('0xf2'));delete _0x39cbbe[_0x6b15('0x17')][_0xbacf11];_0x202959(ut['message'](_0x6b15('0xf3'),_0x3703c3,_0x1899cf));}});};Preview[_0x6b15('0x10')][_0x6b15('0x6f')]=function(_0x59ce82){return!_[_0x6b15('0x3f')](_0x59ce82)&&!_['isNil'](_0x59ce82['name'])&&!_[_0x6b15('0x3f')](_0x59ce82[_0x6b15('0xf4')])&&_0x59ce82[_0x6b15('0xf4')]&&!_['isNil'](this['trunks'][util[_0x6b15('0x27')](_0x6b15('0xf5'),_0x59ce82[_0x6b15('0x28')])])&&!_[_0x6b15('0x3f')](this[_0x6b15('0x16')][util[_0x6b15('0x27')]('SIP/%s',_0x59ce82[_0x6b15('0x28')])][_0x6b15('0x4a')])&&(this[_0x6b15('0x16')][util[_0x6b15('0x27')](_0x6b15('0xf5'),_0x59ce82[_0x6b15('0x28')])][_0x6b15('0x4a')]==='reachable'||this[_0x6b15('0x16')][util['format'](_0x6b15('0xf5'),_0x59ce82[_0x6b15('0x28')])]['status']===_0x6b15('0xf6'));};Preview[_0x6b15('0x10')][_0x6b15('0x5c')]=function(_0x3ab49e,_0x4c74ba){return this[_0x6b15('0xf7')](_0x3ab49e,_0x4c74ba)[_0x6b15('0x57')](function(_0x47663a){return _[_0x6b15('0x46')](_0x47663a,[_0x6b15('0x2f')]);})[_0x6b15('0x5f')](function(_0x2fad2c){if(_0x2fad2c[_0x6b15('0xf8')]){rpcDb[_0x6b15('0xf9')](_0x3ab49e);}if(_0x2fad2c[_0x6b15('0xf4')]){rpcDb[_0x6b15('0x60')](_0x3ab49e);}throw _[_0x6b15('0x46')](_0x2fad2c,['message']);});};Preview[_0x6b15('0x10')][_0x6b15('0xf7')]=function(_0x22b8f5,_0x432df8){var _0x3390e3=this;var _0x27c536,_0x9c8405;return rpcDb['getContactPreview'](_0x22b8f5)[_0x6b15('0x57')](function(_0x3a2496){if(!_[_0x6b15('0x3f')](_0x3a2496[0x0])){_0x9c8405=_0x3a2496[0x0][_0x6b15('0xfa')]?![]:!![];_0x27c536=_0x3a2496[0x0][_0x6b15('0xfa')]?!![]:![];_0x27c536=_0x432df8?!![]:_0x27c536;}var _0x4abade=_0x3390e3['validateContact'](_0x3a2496);if(_0x4abade[_0x6b15('0xfb')]){rpcDb[_0x6b15('0xfc')](_['pick'](_0x3a2496[0x0],[_0x6b15('0x49'),_0x6b15('0xe5')]))[_0x6b15('0x57')](function(_0x2f04f3){_0x3390e3['checkInBlack'](_0x2f04f3,_0x3a2496[0x0],_0x432df8,_0x9c8405,_0x27c536)['then'](function(_0x5f1107){return _0x5f1107;})['catch'](function(_0x45b55b){throw _0x45b55b;});})[_0x6b15('0x5f')](function(_0x13d8ec){ut['logger'](_0x6b15('0xfd'),_0x13d8ec);throw ut[_0x6b15('0x2f')]('Call\x20unsuccessful',_0x9c8405,_0x27c536);});}else{throw ut[_0x6b15('0x2f')](_0x4abade['message'],_0x9c8405,_0x27c536);}})[_0x6b15('0x5f')](function(_0xa88c00){ut['logger']('[Preview][getContactPreview]',_0xa88c00);throw ut[_0x6b15('0x2f')](_0x6b15('0xfe'),![],!![]);});};Preview[_0x6b15('0x10')]['validateContact']=function(_0x55791c){if(_[_0x6b15('0x3f')](_0x55791c)||_[_0x6b15('0xe8')](_0x55791c)||!_['isNil'](_0x55791c[0x0][_0x6b15('0x5b')])&&_['isNil'](_0x55791c[0x0][_0x6b15('0x5b')][_0x6b15('0x28')])){ut['logger'](_0x6b15('0xff'),_0x55791c);return{'isValid':![],'message':_0x6b15('0x100')};}var _0x2b7aa0=this[_0x6b15('0x14')][_0x55791c[0x0][_0x6b15('0x40')][_0x6b15('0x28')]];_0x2b7aa0['message']=utils['CAMPAIGN_STATUS'][_0x6b15('0x71')];if(_[_0x6b15('0x3f')](_0x2b7aa0)){ut[_0x6b15('0x34')](_0x6b15('0x101'),_0x2b7aa0);return{'isValid':![],'message':_0x6b15('0x102')};}if(!this['isTrunkReachable'](_0x2b7aa0[_0x6b15('0x6e')])){ut[_0x6b15('0x34')](_0x6b15('0x103'),_0x6b15('0x104')+_0x2b7aa0['name']+_0x6b15('0x105'));if(!this[_0x6b15('0x6f')](_0x2b7aa0[_0x6b15('0x70')])){ut[_0x6b15('0x34')](_0x6b15('0x103'),_0x2b7aa0[_0x6b15('0x28')]+_0x6b15('0x106'));return{'isValid':![],'message':_0x6b15('0x107')};}}if(!ut[_0x6b15('0x6d')](_0x2b7aa0[_0x6b15('0x3a')])){ut[_0x6b15('0x34')](_0x6b15('0x108'),_0x2b7aa0[_0x6b15('0x28')]+_0x6b15('0x109'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2b7aa0[_0x6b15('0x28')]+_0x6b15('0x109')};}return{'isValid':!![],'message':_0x6b15('0x10a')};};Preview[_0x6b15('0x10')][_0x6b15('0xe9')]=function(_0x577669,_0x1a35fc,_0x2a8947,_0x5b5a76){var _0x1b7e14=this;return new Promise(function(_0x3298f0,_0x3d0e34){var _0x300058=_0x577669['uniqueid'];var _0x797ad=_0x1b7e14[_0x6b15('0x6f')](_0x1a35fc[_0x6b15('0x6e')])?util[_0x6b15('0x27')](_0x6b15('0x10b'),_0x1a35fc[_0x6b15('0x6e')][_0x6b15('0x28')],_['isNil'](_0x1a35fc[_0x6b15('0x10c')])?'':_0x1a35fc[_0x6b15('0x10c')]['trim']()||'',_0x1a35fc['dialCutDigit']>0x0?_0x2a8947[_0x6b15('0xe5')]['substring'](_0x1a35fc[_0x6b15('0x10d')]):_0x2a8947[_0x6b15('0xe5')]):util[_0x6b15('0x27')]('SIP/%s/%s%s',_['isNil'](_0x1a35fc[_0x6b15('0x70')])?_0x1a35fc['Trunk'][_0x6b15('0x28')]:_0x1a35fc[_0x6b15('0x70')][_0x6b15('0x28')],_['isNil'](_0x1a35fc[_0x6b15('0x10c')])?'':_0x1a35fc[_0x6b15('0x10c')][_0x6b15('0x10e')]()||'',_0x1a35fc[_0x6b15('0x10d')]>0x0?_0x2a8947['phone']['substring'](_0x1a35fc[_0x6b15('0x10d')]):_0x2a8947[_0x6b15('0xe5')]);var _0x16d332=_0x1b7e14[_0x6b15('0x6f')](_0x1a35fc[_0x6b15('0x6e')])?ut[_0x6b15('0x10f')](_0x1a35fc[_0x6b15('0x6e')][_0x6b15('0x110')],_0x1a35fc[_0x6b15('0x111')],_0x1a35fc[_0x6b15('0x112')]>0x0?ut[_0x6b15('0x113')](_0x1a35fc[_0x6b15('0x114')],_0x1a35fc[_0x6b15('0x112')]):_0x1a35fc[_0x6b15('0x114')]):ut['getCallerId'](_[_0x6b15('0x3f')](_0x1a35fc[_0x6b15('0x70')])?_0x1a35fc[_0x6b15('0x6e')]['callerid']:_0x1a35fc[_0x6b15('0x70')][_0x6b15('0x110')],_0x1a35fc[_0x6b15('0x111')],_0x1a35fc['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1a35fc[_0x6b15('0x114')],_0x1a35fc[_0x6b15('0x112')]):_0x1a35fc[_0x6b15('0x114')]);if(_0x16d332){_0x577669['originatecalleridname']=ut[_0x6b15('0x115')](_0x16d332);_0x577669[_0x6b15('0x116')]=ut['extractCalleridNumber'](_0x16d332);}var _0x3b2a49=ut[_0x6b15('0x117')](_0x1a35fc,_0x2a8947,_0x797ad,_0x16d332,_0x300058,_0x577669);var _0xec87fa=utils[_0x6b15('0x118')](_0x2a8947[_0x6b15('0x119')]);Object['assign'](_0x3b2a49,_0xec87fa);_[_0x6b15('0x11a')](_0x577669,ut[_0x6b15('0x11b')](_0x3b2a49));_0x577669['starttime']=moment()[_0x6b15('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a35fc[_0x6b15('0x11c')]=_0x3b2a49;var _0x330034=ut[_0x6b15('0x11d')](_0x577669,_0x1a35fc,_0x3b2a49,_0x577669['activeContact'],_0x5b5a76);return ami[_0x6b15('0x11e')](_0x330034)['then'](function(_0xdf29a){_0x1a35fc['originated']+=0x1;logger[_0x6b15('0x25')](_0x6b15('0x11f'),_0x300058,_0x6b15('0x90'),_0x1a35fc[_0x6b15('0x28')],'originated:\x20',_0x1a35fc[_0x6b15('0x2b')]);_0x3298f0(_0xdf29a);})[_0x6b15('0x5f')](function(_0x1c5111){ut['logAgent'](_0x577669,0xe,_0x6b15('0x120'));rpcDb[_0x6b15('0xd8')](_0x577669,_0x6b15('0x121'));_0x3d0e34(_0x1c5111);});});};Preview[_0x6b15('0x10')][_0x6b15('0x1f')]=function(_0x4f79a9){if(this['actions'][_0x4f79a9['linkedid']]){this[_0x6b15('0x17')][_0x4f79a9[_0x6b15('0x86')]][_0x6b15('0x4b')]=_0x4f79a9[_0x6b15('0x4b')];}};Preview['prototype'][_0x6b15('0x122')]=function(_0x50a806){var _0x4f8e12=this;var _0x1affd4=this['actions'][_0x50a806['actionid']];if(_0x1affd4){if(_0x1affd4[_0x6b15('0xe7')]&&this[_0x6b15('0x18')][_0x1affd4[_0x6b15('0xe7')]]){ut[_0x6b15('0x123')](_0x1affd4,this[_0x6b15('0x18')][_0x1affd4[_0x6b15('0xe7')]][_0x6b15('0x28')],this[_0x6b15('0x18')][_0x1affd4[_0x6b15('0xe7')]]['id']);}var _0x21a021=_['clone'](_0x1affd4);_0x21a021['responsetime']=moment()[_0x6b15('0x27')](_0x6b15('0x8b'));var _0x3681ff=_0x4f8e12[_0x6b15('0x14')][_0x1affd4['queue']];if(ut[_0x6b15('0x124')](_0x50a806[_0x6b15('0x125')])){if(_0x1affd4['unlockAgent']){rpcDb['unlockContact'](_0x1affd4[_0x6b15('0x88')]);}if(_0x1affd4[_0x6b15('0x85')]){rpcDb[_0x6b15('0x60')](_0x1affd4['idContact']);}ami[_0x6b15('0x2a')](_0x6b15('0x126'),ut[_0x6b15('0x78')](_0x1affd4,_0x6b15('0x127'),this[_0x6b15('0x14')][_0x1affd4['queue']]));this[_0x6b15('0xd4')](_0x21a021,_0x3681ff,_0x50a806);}else{_0x1affd4[_0x6b15('0x61')]=moment()['format'](_0x6b15('0x8b'));ut[_0x6b15('0xd7')](_0x21a021,0x4,_0x6b15('0x9a'));rpcDb[_0x6b15('0xd8')](_0x21a021,_0x6b15('0x128'));}}};Preview['prototype'][_0x6b15('0x1b')]=function(_0x70de9){var _0x472ace=this[_0x6b15('0x17')][_0x70de9['linkedid']];var _0x1c23bd;if(_0x472ace){_0x1c23bd=this[_0x6b15('0x14')][_0x472ace[_0x6b15('0x41')]];logger[_0x6b15('0x25')](_0x6b15('0x129'),_0x70de9[_0x6b15('0x86')],_0x6b15('0x90'),_0x1c23bd[_0x6b15('0x28')],_0x6b15('0x44'),_0x1c23bd[_0x6b15('0x2c')]);}if(this['actions'][_0x70de9[_0x6b15('0x86')]]&&_0x70de9[_0x6b15('0x86')]!==_0x70de9['uniqueid']){if(_0x70de9[_0x6b15('0x12a')]==='16'&&this[_0x6b15('0x17')][_0x70de9[_0x6b15('0x86')]][_0x6b15('0x45')]){this[_0x6b15('0x12b')](_0x70de9,_0x70de9[_0x6b15('0x86')],_0x70de9[_0x6b15('0x12a')]);}else if(this[_0x6b15('0x17')][_0x70de9[_0x6b15('0x86')]][_0x6b15('0x45')]){logger[_0x6b15('0x25')](_0x6b15('0x12c'),_0x70de9['linkedid'],_0x70de9[_0x6b15('0x12a')],'\x20Queue',_0x1c23bd[_0x6b15('0x28')],_0x6b15('0x44'),_0x1c23bd[_0x6b15('0x2c')]);this[_0x6b15('0x12b')](_0x70de9,_0x70de9[_0x6b15('0x86')],_0x70de9[_0x6b15('0x12a')]);}}else if(_0x472ace&&_['isNil'](_0x472ace[_0x6b15('0x12d')])&&_0x1c23bd[_0x6b15('0x12e')]&&_0x70de9[_0x6b15('0x86')]===_0x70de9[_0x6b15('0x8f')]&&_[_0x6b15('0x3f')](_0x70de9[_0x6b15('0xe1')])&&_0x70de9[_0x6b15('0x12a')]==='16'&&_0x70de9[_0x6b15('0x12f')]==='6'&&_[_0x6b15('0xd5')](_0x472ace[_0x6b15('0x130')])){if(_0x472ace['unlockAgent']){rpcDb[_0x6b15('0xf9')](_0x472ace[_0x6b15('0x88')]);}if(_0x472ace[_0x6b15('0x85')]){rpcDb[_0x6b15('0x60')](_0x472ace['idContact']);}_0x70de9[_0x6b15('0xe1')]='22';this['callProgressDetectingAgent'](_0x472ace,_0x1c23bd,_0x70de9);}else if(_0x472ace&&_0x472ace['transfer']){if(_0x70de9[_0x6b15('0x12a')]==='16'&&this[_0x6b15('0x17')][_0x70de9[_0x6b15('0x86')]][_0x6b15('0x45')]){logger[_0x6b15('0x25')]('[syncHangup][talking][transfer]',_0x70de9[_0x6b15('0x86')],_0x70de9[_0x6b15('0x12a')],'\x20Queue',_0x1c23bd[_0x6b15('0x28')],_0x6b15('0x44'),_0x1c23bd[_0x6b15('0x2c')]);this[_0x6b15('0x12b')](_0x70de9,_0x70de9[_0x6b15('0x86')],_0x70de9[_0x6b15('0x12a')]);}else if(this[_0x6b15('0x17')][_0x70de9[_0x6b15('0x86')]][_0x6b15('0x45')]){logger['info']('[syncHangup][talking][cause]',_0x70de9[_0x6b15('0x86')],_0x70de9[_0x6b15('0x12a')],_0x6b15('0x90'),_0x1c23bd[_0x6b15('0x28')],'pTalking:\x20',_0x1c23bd['pTalking']);this[_0x6b15('0x12b')](_0x70de9,_0x70de9['linkedid'],_0x70de9[_0x6b15('0x12a')]);}}};Preview[_0x6b15('0x10')]['syncDialEnd']=function(_0x14f17c){if(this['actions'][_0x14f17c[_0x6b15('0xd3')]]&&_0x14f17c[_0x6b15('0xd3')]!==_0x14f17c[_0x6b15('0x131')]){this[_0x6b15('0x12b')](_0x14f17c,_0x14f17c['destlinkedid'],_0x14f17c[_0x6b15('0xca')]);}};Preview['prototype'][_0x6b15('0x1d')]=function(_0x329899){if(this[_0x6b15('0x17')][_0x329899[_0x6b15('0x86')]]&&_0x329899[_0x6b15('0x86')]!==_0x329899['uniqueid']&&!this[_0x6b15('0x17')][_0x329899[_0x6b15('0x86')]][_0x6b15('0x45')]){if(_0x329899[_0x6b15('0x12a')]==='1'){this[_0x6b15('0x12b')](_0x329899,_0x329899['linkedid'],_0x329899[_0x6b15('0x12a')]);}}};Preview[_0x6b15('0x10')][_0x6b15('0x132')]=function(_0x2a8991,_0x3af79c,_0x355181){if(this[_0x6b15('0x17')][_0x2a8991]){if(_[_0x6b15('0x3f')](this[_0x6b15('0x17')][_0x2a8991][_0x6b15('0x11c')])){this[_0x6b15('0x17')][_0x2a8991]['variables']={};}this['actions'][_0x2a8991][_0x6b15('0x11c')][_0x3af79c]=_0x355181;}};Preview[_0x6b15('0x10')][_0x6b15('0x133')]=function(_0x2229da){try{if(!_[_0x6b15('0x3f')](_0x2229da)){if(ut[_0x6b15('0x134')](_['keys'](_0x2229da[_0x6b15('0x135')])[0x0])){this[_0x6b15('0x132')](_0x2229da[_0x6b15('0x8f')],_[_0x6b15('0x136')](_0x2229da[_0x6b15('0x135')])[0x0],_0x2229da[_0x6b15('0x137')]);}}}catch(_0x5a3b23){logger[_0x6b15('0x138')](_0x6b15('0x139'),util[_0x6b15('0x13a')](_0x5a3b23,{'showHidden':![],'depth':null}));}};Preview[_0x6b15('0x10')][_0x6b15('0x22')]=function(_0x2ee3e5){if(_0x2ee3e5){if(this[_0x6b15('0x17')][_0x2ee3e5[_0x6b15('0x13b')]]){this[_0x6b15('0x17')][_0x2ee3e5[_0x6b15('0x13b')]][_0x6b15('0x130')]=!![];}}};Preview[_0x6b15('0x10')][_0x6b15('0x13c')]=function(_0xed13a9){if(_0xed13a9){if(this[_0x6b15('0x17')][_0xed13a9[_0x6b15('0x13d')]]){this['actions'][_0xed13a9[_0x6b15('0x13d')]][_0x6b15('0x130')]=!![];}}};module[_0x6b15('0x13e')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 0f20f2a..2cb8ebe 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 _0xda63=['inspect','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../rpc/cmHopperBlack','error'];(function(_0x3f2de8,_0x53ea99){var _0x6a1c58=function(_0x205db2){while(--_0x205db2){_0x3f2de8['push'](_0x3f2de8['shift']());}};_0x6a1c58(++_0x53ea99);}(_0xda63,0x12f));var _0x3da6=function(_0x52991d,_0x429d72){_0x52991d=_0x52991d-0x0;var _0x5b9004=_0xda63[_0x52991d];return _0x5b9004;};'use strict';var util=require(_0x3da6('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x3da6('0x1'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xaa10aa){return function(_0x1be5e6){logger[_0x3da6('0x2')](_0xaa10aa,util[_0x3da6('0x3')](_0x1be5e6,{'showHidden':![],'depth':null}));};}function create(_0x568470){return cmHopperHistory[_0x3da6('0x4')](_0x568470)[_0x3da6('0x5')](loggerCatch(_0x3da6('0x6')));}function createAgent(_0x4183b5){return BPromise[_0x3da6('0x7')]()[_0x3da6('0x8')](agentReportPreview[_0x3da6('0x4')](_0x4183b5))[_0x3da6('0x5')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x120a66){return cmHopper[_0x3da6('0x9')](_0x120a66,!![])[_0x3da6('0x5')](loggerCatch(_0x3da6('0xa')));}exports['checkIsBlackList']=function(_0x3a824d){return cmHopperBlack[_0x3da6('0xb')](_0x3a824d)['catch'](loggerCatch(_0x3da6('0xc')));};exports['getContactPreview']=function(_0x33e7de){return BPromise[_0x3da6('0x7')]()['then'](cmHopper[_0x3da6('0xd')](_0x33e7de))[_0x3da6('0x5')](loggerCatch(_0x3da6('0xe')));};exports[_0x3da6('0x4')]=function(_0x318851,_0x367c4f){create(_0x318851)['catch'](loggerCatch(_0x367c4f));moveContact(_0x318851)['catch'](loggerCatch(_0x367c4f));};exports[_0x3da6('0xf')]=function(_0x1749bc,_0x4f1f37){createAgent(_0x1749bc)[_0x3da6('0x5')](loggerCatch(_0x4f1f37));};exports[_0x3da6('0x10')]=function(_0x72c609,_0x2f9c12){create(_0x72c609)[_0x3da6('0x5')](loggerCatch(_0x2f9c12));};exports[_0x3da6('0x11')]=function(_0x2097e1,_0xc6d56d){moveContact(_0x2097e1)['catch'](loggerCatch(_0xc6d56d));};exports[_0x3da6('0x12')]=function(_0x17329e,_0x498978,_0x51794a){if(_0x498978){_0x17329e[_0x3da6('0x13')]=null;}if(_0x51794a){_0x17329e[_0x3da6('0x14')]=![];}return cmHopper['rescheduleContact'](_0x17329e)[_0x3da6('0x5')](loggerCatch(_0x3da6('0x15')));};exports[_0x3da6('0x16')]=function(_0x196b4a){return cmHopper[_0x3da6('0x16')](_0x196b4a)[_0x3da6('0x5')](loggerCatch(_0x3da6('0x17')));};exports[_0x3da6('0x18')]=function(_0x700cbf){return cmHopper[_0x3da6('0x18')]({'UserId':null},_0x700cbf,0x1)[_0x3da6('0x5')](loggerCatch(_0x3da6('0x19')));};exports[_0x3da6('0x1a')]=function(_0x46b34d){return cmHopper[_0x3da6('0x18')]({'active':![]},_0x46b34d,0x1)[_0x3da6('0x5')](loggerCatch(_0x3da6('0x1b')));};exports['crateCustomerReportQueue']=function(_0x1d3d73){var _0x3dccca={};_0x3dccca[_0x3da6('0x1c')]=_0x1d3d73[_0x3da6('0x1c')];_0x3dccca[_0x3da6('0x1d')]=_0x1d3d73[_0x3da6('0x1d')];_0x3dccca[_0x3da6('0x1e')]=_0x1d3d73[_0x3da6('0x1e')];_0x3dccca[_0x3da6('0x1f')]=_0x1d3d73[_0x3da6('0x1f')];_0x3dccca[_0x3da6('0x20')]=_0x1d3d73[_0x3da6('0x20')];_0x3dccca['queuecallerjoinAt']=_0x1d3d73[_0x3da6('0x21')];_0x3dccca[_0x3da6('0x22')]=_0x1d3d73[_0x3da6('0x21')];_0x3dccca[_0x3da6('0x23')]=0x1;_0x3dccca[_0x3da6('0x24')]=_0x1d3d73[_0x3da6('0x25')];_0x3dccca['connectedlinename']=_0x1d3d73[_0x3da6('0x26')];_0x3dccca['context']=_0x3da6('0x27');_0x3dccca[_0x3da6('0x28')]=_0x3da6('0x29');_0x3dccca[_0x3da6('0x2a')]=0x0;_0x3dccca[_0x3da6('0x2b')]=0x1;_0x3dccca['lastAssignedTo']=_0x1d3d73[_0x3da6('0x26')];_0x3dccca[_0x3da6('0x2c')]=_0x3da6('0x2d');return BPromise[_0x3da6('0x7')]()[_0x3da6('0x8')](voiceQueueReport[_0x3da6('0x2e')](_0x3dccca))[_0x3da6('0x5')](loggerCatch(_0x3da6('0x2f')));};exports[_0x3da6('0x30')]=function(_0x48dccf,_0x5cb76c){return BPromise[_0x3da6('0x7')]()[_0x3da6('0x8')](cmHopper['getContactRecallMe'](_0x48dccf,_0x5cb76c))[_0x3da6('0x5')](loggerCatch(_0x3da6('0x31')));};exports[_0x3da6('0x32')]=function(_0x254825){return cmHopper[_0x3da6('0x12')](_0x254825,!![],!![])[_0x3da6('0x5')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x1606=['assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1606,0x77));var _0x6160=function(_0x29c275,_0x580b32){_0x29c275=_0x29c275-0x0;var _0x27c8fb=_0x1606[_0x29c275];return _0x27c8fb;};'use strict';var util=require(_0x6160('0x0'));var BPromise=require(_0x6160('0x1'));var logger=require(_0x6160('0x2'))(_0x6160('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x6160('0x4'));var cmHopperBlack=require(_0x6160('0x5'));var agentReportPreview=require(_0x6160('0x6'));var voiceQueueReport=require(_0x6160('0x7'));function loggerCatch(_0x884245){return function(_0x3f3c18){logger[_0x6160('0x8')](_0x884245,util['inspect'](_0x3f3c18,{'showHidden':![],'depth':null}));};}function create(_0x4c06a9){return cmHopperHistory[_0x6160('0x9')](_0x4c06a9)[_0x6160('0xa')](loggerCatch(_0x6160('0xb')));}function createAgent(_0x4bf010){return BPromise[_0x6160('0xc')]()[_0x6160('0xd')](agentReportPreview[_0x6160('0x9')](_0x4bf010))[_0x6160('0xa')](loggerCatch(_0x6160('0xb')));}function moveContact(_0x58461b){return cmHopper[_0x6160('0xe')](_0x58461b,!![])[_0x6160('0xa')](loggerCatch(_0x6160('0xf')));}exports[_0x6160('0x10')]=function(_0x2e42e2){return cmHopperBlack[_0x6160('0x10')](_0x2e42e2)[_0x6160('0xa')](loggerCatch(_0x6160('0x11')));};exports[_0x6160('0x12')]=function(_0x4923b6){return BPromise[_0x6160('0xc')]()['then'](cmHopper[_0x6160('0x12')](_0x4923b6))[_0x6160('0xa')](loggerCatch('[getContactPreview]\x20'));};exports[_0x6160('0x9')]=function(_0x1d7ae6,_0x25eb17){create(_0x1d7ae6)[_0x6160('0xa')](loggerCatch(_0x25eb17));moveContact(_0x1d7ae6)[_0x6160('0xa')](loggerCatch(_0x25eb17));};exports[_0x6160('0x13')]=function(_0x53d6d3,_0x1c3d6c){createAgent(_0x53d6d3)['catch'](loggerCatch(_0x1c3d6c));};exports[_0x6160('0x14')]=function(_0x4c8622,_0x63a35a){create(_0x4c8622)['catch'](loggerCatch(_0x63a35a));};exports[_0x6160('0x15')]=function(_0x284f6a,_0xcc3107){moveContact(_0x284f6a)[_0x6160('0xa')](loggerCatch(_0xcc3107));};exports[_0x6160('0x16')]=function(_0x9a3779,_0x89324b,_0x300db1){if(_0x89324b){_0x9a3779[_0x6160('0x17')]=null;}if(_0x300db1){_0x9a3779[_0x6160('0x18')]=![];}return cmHopper[_0x6160('0x16')](_0x9a3779)[_0x6160('0xa')](loggerCatch(_0x6160('0x19')));};exports[_0x6160('0x1a')]=function(_0x46a279){return cmHopper[_0x6160('0x1a')](_0x46a279)[_0x6160('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x6160('0x1b')]=function(_0x207904){return cmHopper['unlockContact']({'UserId':null},_0x207904,0x1)[_0x6160('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0x6160('0x1c')]=function(_0x128289){return cmHopper[_0x6160('0x1b')]({'active':![]},_0x128289,0x1)[_0x6160('0xa')](loggerCatch(_0x6160('0x1d')));};exports[_0x6160('0x1e')]=function(_0x35dda3){var _0x56a5bc={};_0x56a5bc['type']=_0x35dda3[_0x6160('0x1f')];_0x56a5bc[_0x6160('0x20')]=_0x35dda3['uniqueid'];_0x56a5bc[_0x6160('0x21')]=_0x35dda3['calleridnum'];_0x56a5bc[_0x6160('0x22')]=_0x35dda3[_0x6160('0x22')];_0x56a5bc[_0x6160('0x23')]=_0x35dda3[_0x6160('0x23')];_0x56a5bc[_0x6160('0x24')]=_0x35dda3[_0x6160('0x25')];_0x56a5bc[_0x6160('0x26')]=_0x35dda3['answertime'];_0x56a5bc['queuecallercomplete']=0x1;_0x56a5bc[_0x6160('0x27')]=_0x35dda3[_0x6160('0x28')];_0x56a5bc[_0x6160('0x29')]=_0x35dda3[_0x6160('0x2a')];_0x56a5bc[_0x6160('0x2b')]='from-sip';_0x56a5bc[_0x6160('0x2c')]=_0x6160('0x2d');_0x56a5bc['holdtime']=0x0;_0x56a5bc[_0x6160('0x2e')]=0x1;_0x56a5bc['lastAssignedTo']=_0x35dda3[_0x6160('0x2a')];_0x56a5bc[_0x6160('0x2f')]=_0x6160('0x30');return BPromise[_0x6160('0xc')]()[_0x6160('0xd')](voiceQueueReport[_0x6160('0x31')](_0x56a5bc))[_0x6160('0xa')](loggerCatch(_0x6160('0x32')));};exports[_0x6160('0x33')]=function(_0x352377,_0x43f4e7){return BPromise['resolve']()[_0x6160('0xd')](cmHopper['getContactRecallMe'](_0x352377,_0x43f4e7))[_0x6160('0xa')](loggerCatch(_0x6160('0x34')));};exports[_0x6160('0x35')]=function(_0x27b831){return cmHopper[_0x6160('0x16')](_0x27b831,!![],!![])[_0x6160('0xa')](loggerCatch(_0x6160('0x36')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 008ecf5..38d02d2 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 _0x55f2=['xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','noanswer','variables','keys','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','error','logger','info','loggerError','inspect','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','getSeconds','logLookAgent','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','active','add','minutes','ContactId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','interface','mandatoryDisposition','buildObj','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','ListId','filterKey','type','campaigntype','dialAnswer','membername','countnoanswerretry','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-listid'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x55f2,0x13a));var _0x255f=function(_0xe50408,_0x1a1142){_0xe50408=_0xe50408-0x0;var _0x193a45=_0x55f2[_0xe50408];return _0x193a45;};'use strict';var util=require(_0x255f('0x0'));var _=require(_0x255f('0x1'));var moment=require(_0x255f('0x2'));var logger=require(_0x255f('0x3'))(_0x255f('0x4'));var ipAgi=process[_0x255f('0x5')][_0x255f('0x6')]||'127.0.0.1';var utils=require(_0x255f('0x7'));exports['loggerCatch']=function(_0x2b0ab5){return function(_0x173130){logger[_0x255f('0x8')](_0x2b0ab5,util['inspect'](_0x173130,{'showHidden':![],'depth':null}));};};exports[_0x255f('0x9')]=function(_0x324e50,_0x43214b){logger[_0x255f('0xa')](_0x324e50,util['inspect'](_0x43214b,{'showHidden':![],'depth':null}));};exports[_0x255f('0xb')]=function(_0x41f609,_0xc4d01){logger[_0x255f('0x8')](_0x41f609,util[_0x255f('0xc')](_0xc4d01,{'showHidden':![],'depth':null}));};exports[_0x255f('0xd')]=function(_0x2758bd){return function(_0xb4a6e3){logger[_0x255f('0xa')](_0x2758bd,util[_0x255f('0xc')](_0xb4a6e3,{'showHidden':![],'depth':null}));};};exports[_0x255f('0xe')]=function(_0x591f23,_0x2c9bf2,_0x32f2ce){return{'message':_0x591f23,'unlock':_0x2c9bf2,'active':_0x32f2ce};};exports[_0x255f('0xf')]=function(_0x214640,_0x578078,_0x1ceea4){if(!_['isUndefined'](_0x1ceea4)&&_0x255f('0x10')===typeof _0x1ceea4&&!_['isEmpty'](_0x1ceea4)){if(!_['isUndefined'](_0x578078)&&_0x255f('0x10')===typeof _0x578078&&!_[_0x255f('0x11')](_0x578078)){return util[_0x255f('0x12')]('\x22%s\x22\x20<%s>',_0x578078,_0x1ceea4);}return util[_0x255f('0x12')](_0x255f('0x13'),_0x1ceea4,_0x1ceea4);}if(!_[_0x255f('0x14')](_0x214640)&&_0x255f('0x10')===typeof _0x214640&&!_[_0x255f('0x11')](_0x214640)){return _0x214640;}return _0x255f('0x15');};exports[_0x255f('0x16')]=function(_0x5ebc9d){if(_[_0x255f('0x17')](_0x5ebc9d)){return![];}return _0x5ebc9d;};exports['addVariables']=function(_0x44fc3f,_0x425a4c,_0x2b3790,_0xe3707a,_0x48ca5a,_0x4f9b47){var _0x8f60b={'XMD-QUEUE':_0x425a4c[_0x255f('0x18')]?_0x425a4c[_0x255f('0x18')][_0x255f('0x19')]:'','XMD-CALLERID':_0xe3707a,'XMD-CALLERID-PREVIEW':_0x4f9b47?util['format'](_0x255f('0x13'),_0x4f9b47[_0x255f('0x1a')],_0x4f9b47[_0x255f('0x1b')]):_0xe3707a,'XMD-DIALID':_0x48ca5a,'XMD-CONTACTID':_0x425a4c['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xe3707a,'XMD-VOICEQUEUEID':_0x425a4c[_0x255f('0x1c')],'XMD-DIALCHANNEL':_0x2b3790,'XMD-DIALTIMEOUT':_0x44fc3f[_0x255f('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x255f('0x12')](_0x255f('0x1e'),_0x44fc3f[_0x255f('0x1f')]?'g':'',_[_0x255f('0x11')](_0x44fc3f[_0x255f('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x44fc3f[_0x255f('0x21')]||'','XMD-AGI':_0x44fc3f[_0x255f('0x22')]?util[_0x255f('0x12')](_0x255f('0x23'),ipAgi,_0x44fc3f[_0x255f('0x22')]):_0x255f('0x24'),'XMD-AGIAFTER':_0x44fc3f[_0x255f('0x1f')]?util[_0x255f('0x12')](_0x255f('0x23'),ipAgi,_0x44fc3f['dialQueueProject2']):_0x255f('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x4f9b47?_0x4f9b47[_0x255f('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x4f9b47?_0x4f9b47['originatecalleridname']:'','XMD-DESTINATION':_0x255f('0x26'),'SIPADDHEADER':_0x255f('0x27')};if(!_[_0x255f('0x11')](_0x44fc3f[_0x255f('0x20')])){_0x8f60b[util[_0x255f('0x12')]('%s',_0x255f('0x28'))]=_0x44fc3f[_0x255f('0x20')];_0x8f60b[util[_0x255f('0x12')]('%s',_0x255f('0x29'))]=_0x48ca5a;}return _0x8f60b;};exports[_0x255f('0x2a')]=function(_0x58bde8){var _0x4ec01c={};for(var _0x1886d3 in _0x58bde8){if(_0x58bde8[_0x255f('0x2b')](_0x1886d3)){_0x4ec01c[util[_0x255f('0x12')]('%s',_[_0x255f('0x2c')](_0x1886d3))]=_0x58bde8[_0x1886d3];}}return{'variables':_0x4ec01c};};exports[_0x255f('0x2d')]=function(_0x25461a,_0xb5b58e){if(!_[_0x255f('0x17')](_0x25461a)){if(_0x25461a['hasOwnProperty']('originated')){if(_0x25461a['originated']>0x0){_0x25461a[_0x255f('0x2e')]-=0x1;}else{logger[_0x255f('0x8')](_0x255f('0x2f'),_0xb5b58e);}}}else{logger[_0x255f('0x8')](_0x255f('0x30'),_0xb5b58e);}};exports[_0x255f('0x31')]=function(_0x6d47b7){var _0x87fe38=moment()[_0x255f('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x6d47b7[_0x255f('0x32')]=0xd;_0x6d47b7[_0x255f('0x33')]=_0x255f('0x34');_0x6d47b7[_0x255f('0x35')]=_0x87fe38;_0x6d47b7['responsetime']=_0x87fe38;_0x6d47b7[_0x255f('0x36')]=_0x87fe38;};exports[_0x255f('0x37')]=function(_0x39e71b,_0x4a1048,_0x3430eb){var _0x42eb47=moment()[_0x255f('0x12')](_0x255f('0x38'));_0x39e71b['state']=_0x4a1048;_0x39e71b['statedesc']=_0x3430eb;_0x39e71b[_0x255f('0x39')]=_0x42eb47;_0x39e71b['ringtime']=utils[_0x255f('0x3a')](_0x39e71b[_0x255f('0x39')],_0x39e71b[_0x255f('0x35')]);};exports[_0x255f('0x3b')]=function(_0x3bb9bd,_0x27d3fd,_0x21bf04){_0x3bb9bd['membername']=_0x27d3fd;_0x3bb9bd[_0x255f('0x3c')]=_0x21bf04;};exports['logCustomer']=function(_0x22f59e,_0xe96672,_0x202cbc){var _0x3caaad=moment()['format'](_0x255f('0x38'));_0x22f59e[_0x255f('0x32')]=_0xe96672;_0x22f59e[_0x255f('0x33')]=_0x202cbc;_0x22f59e[_0x255f('0x39')]=_0x22f59e['responsetime']?_0x22f59e[_0x255f('0x39')]:_0x3caaad;_0x22f59e[_0x255f('0x36')]=_0x22f59e[_0x255f('0x36')]?_0x22f59e[_0x255f('0x36')]:_0x3caaad;_0x22f59e['ringtime']=utils[_0x255f('0x3a')](_0x22f59e[_0x255f('0x39')]||0x0,_0x22f59e[_0x255f('0x35')]||0x0);_0x22f59e[_0x255f('0x3d')]=_0x22f59e[_0x255f('0x3e')]?utils[_0x255f('0x3a')](_0x22f59e[_0x255f('0x36')],_0x22f59e[_0x255f('0x3e')]):0x0;};exports[_0x255f('0x3f')]=function(_0x249a9f){return _0x249a9f===_0x255f('0x40');};exports[_0x255f('0x41')]=function(_0x50707d,_0x14ec9b,_0x42846b,_0x23aca0,_0x74ab39){var _0x35ed22=_0x23aca0?_0x255f('0x42'):_0x50707d[_0x255f('0x1a')];_0x35ed22=_0x74ab39?'BOOKED':_0x35ed22;return{'actionid':_0x50707d[_0x255f('0x43')],'action':_0x255f('0x44'),'channel':_0x50707d[_0x255f('0x45')],'callerid':util[_0x255f('0x12')](_0x255f('0x13'),_0x35ed22,_0x50707d['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x255f('0x46'),'Priority':'1','variable':_0x42846b,'timeout':(_0x14ec9b[_0x255f('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x50707d[_0x255f('0x43')]};};exports[_0x255f('0x48')]=function(_0x447485){return _0x447485[_0x255f('0x49')]+_0x447485[_0x255f('0x4a')]+_0x447485['countnoanswerretry']+_0x447485[_0x255f('0x4b')]+_0x447485['countnosuchnumberretry'];};exports[_0x255f('0x4c')]=function(_0x48329a){var _0x4984c7=_[_0x255f('0x4d')](_0x48329a);_0x4984c7[_0x255f('0x32')]=0xf;_0x4984c7[_0x255f('0x33')]='Global';return _0x4984c7;};exports['scheduledAt']=function(_0x1e1a02,_0x5813fa,_0x22b663){var _0x3532e0={};_0x3532e0[_0x5813fa]=_0x1e1a02[_0x5813fa];_0x3532e0[_0x255f('0x4e')]=![];_0x3532e0['scheduledat']=moment()[_0x255f('0x4f')](_0x22b663,_0x255f('0x50'))['format'](_0x255f('0x38'));_0x3532e0[_0x255f('0x51')]=_0x1e1a02['ContactId'];_0x3532e0['ListId']=_0x1e1a02['ListId'];_0x3532e0[_0x255f('0x1c')]=_0x1e1a02[_0x255f('0x1c')]||undefined;return _0x3532e0;};exports[_0x255f('0x52')]=function(_0x12d11c,_0x226e7c){if(!_[_0x255f('0x17')](_0x12d11c)){if(_0x12d11c['pTalking']>0x0){_0x12d11c[_0x255f('0x53')]-=0x1;}else{logger[_0x255f('0x8')](_0x226e7c,_0x255f('0x54'));}}else{logger['error'](_0x226e7c,_0x255f('0x55'));}};exports['IsNotLoggedIn']=function(_0x5d2a51){if(_0x5d2a51<=0x0){return!![];}return![];};function buildObj(_0x1e8d74,_0x12ecbd,_0x1c87d4){_0x1e8d74[_0x255f('0x56')]=_0x12ecbd;_0x1e8d74[_0x255f('0x19')]=_0x1e8d74['queue'];_0x1e8d74[_0x255f('0x57')]=_0x1e8d74[_0x255f('0x45')];_0x1e8d74['motionChannel']='voice';if(_0x1c87d4){_0x1e8d74[_0x255f('0x58')]=_0x1c87d4[_0x255f('0x58')];}return _0x1e8d74;}exports[_0x255f('0x59')]=buildObj;exports[_0x255f('0x5a')]=function(_0x1e8923){var _0x49987c={};_0x49987c[_0x255f('0x5b')]=_0x1e8923['queue'];_0x49987c['interface']=_0x1e8923[_0x255f('0x45')];_0x49987c[_0x255f('0x43')]=_0x1e8923[_0x255f('0x43')];return _0x49987c;};exports[_0x255f('0x5c')]=function(_0x53e4fc){var _0x432bfe=[];for(var _0x541169 in _0x53e4fc){if(_0x53e4fc[_0x255f('0x2b')](_0x541169)){if(!_[_0x255f('0x17')](_0x53e4fc[_0x541169])&&_0x53e4fc[_0x541169][_0x255f('0x32')]===_0x255f('0x5d')&&_0x53e4fc[_0x541169][_0x255f('0x5e')]===_0x255f('0x5f')){_0x432bfe[_0x255f('0x60')](_0x53e4fc[_0x541169]['id']);}}}return _0x432bfe;};exports[_0x255f('0x61')]=function(_0x1d6861){var _0xac1c31=moment()[_0x255f('0x62')](0x0);var _0x101835=moment(_0x1d6861)[_0x255f('0x62')](0x0);return _0xac1c31[_0x255f('0x63')](_0x101835,_0x255f('0x64'));};exports[_0x255f('0x65')]=function(_0x2de2e2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2de2e2[_0x255f('0x51')],'ListId':_0x2de2e2[_0x255f('0x66')],'VoiceQueueId':_0x2de2e2['VoiceQueueId']||undefined,'CampaignId':_0x2de2e2['CampaignId']||undefined};};exports[_0x255f('0x67')]=function(_0x46f5ab){if(_0x46f5ab===_0x255f('0x43')||_0x46f5ab==='idContact'||_0x46f5ab===_0x255f('0x5b')||_0x46f5ab===_0x255f('0x68')||_0x46f5ab===_0x255f('0x69')||_0x46f5ab===_0x255f('0x6a')||_0x46f5ab===_0x255f('0x6b')||_0x46f5ab===_0x255f('0x45')||_0x46f5ab==='calleridname'||_0x46f5ab===_0x255f('0x4e')||_0x46f5ab==='calleridnum'||_0x46f5ab==='scheduledat'||_0x46f5ab===_0x255f('0x49')||_0x46f5ab===_0x255f('0x4a')||_0x46f5ab===_0x255f('0x6c')||_0x46f5ab==='countglobal'||_0x46f5ab==='callback'||_0x46f5ab===_0x255f('0x6d')||_0x46f5ab===_0x255f('0x6e')||_0x46f5ab===_0x255f('0x6f')||_0x46f5ab===_0x255f('0x51')||_0x46f5ab===_0x255f('0x66')||_0x46f5ab===_0x255f('0x3c')||_0x46f5ab===_0x255f('0x1c')||_0x46f5ab===_0x255f('0x70')||_0x46f5ab==='xmd-voicequeueid'||_0x46f5ab===_0x255f('0x71')||_0x46f5ab==='xmd-phone'||_0x46f5ab===_0x255f('0x72')||_0x46f5ab==='xmd-dialurl'||_0x46f5ab===_0x255f('0x73')||_0x46f5ab===_0x255f('0x74')||_0x46f5ab===_0x255f('0x75')||_0x46f5ab===_0x255f('0x76')||_0x46f5ab===_0x255f('0x77')||_0x46f5ab===_0x255f('0x78')||_0x46f5ab===_0x255f('0x79')||_0x46f5ab===_0x255f('0x7a')||_0x46f5ab===_0x255f('0x7b')||_0x46f5ab===_0x255f('0x7c')||_0x46f5ab==='rtpaudioqosbridged'||_0x46f5ab===_0x255f('0x7d')||_0x46f5ab===_0x255f('0x7e')||_0x46f5ab==='rtpaudioqosloss'||_0x46f5ab===_0x255f('0x7f')||_0x46f5ab===_0x255f('0x80')||_0x46f5ab===_0x255f('0x81')||_0x46f5ab===_0x255f('0x7c')||_0x46f5ab===_0x255f('0x82')||_0x46f5ab===_0x255f('0x7d')||_0x46f5ab===_0x255f('0x7e')||_0x46f5ab===_0x255f('0x83')||_0x46f5ab===_0x255f('0x7f')||_0x46f5ab===_0x255f('0x80')||_0x46f5ab==='rtpaudioqosrttbridged'||_0x46f5ab===_0x255f('0x84')||_0x46f5ab===_0x255f('0x85')||_0x46f5ab===_0x255f('0x32')||_0x46f5ab===_0x255f('0x33')){return![];}return!![];};exports[_0x255f('0x86')]=function(_0x22465b,_0x1d23ae){var _0x119242,_0x4adf6e,_0x1a456b;if(_0x1d23ae<=0x0){_0x1d23ae=0x1;}_0x119242=new RegExp(_0x255f('0x87')+_0x1d23ae+'}$');_0x4adf6e=Math[_0x255f('0x88')](0xa,_0x1d23ae-0x1);_0x1a456b=Math['pow'](0xa,_0x1d23ae)-0x1;return util[_0x255f('0x12')]('%s',_['replace'](_0x22465b,_0x119242,_['random'](_0x4adf6e,_0x1a456b)));};exports[_0x255f('0x89')]=function(_0x38e44a){var _0xd36eb7=_0x38e44a['match'](/"(.*?)"/);return _0xd36eb7?_0xd36eb7[0x1]:_0x38e44a;};exports['extractCalleridNumber']=function(_0x45b4e6){var _0x1138fa=_0x45b4e6[_0x255f('0x8a')](/<(.*?)>/);return _0x1138fa?_0x1138fa[0x1]:_0x45b4e6;};function buildNoAnswerEventPayload(_0x2073c2,_0x52975f){var _0x5d65ad=buildObj(_0x2073c2,_0x255f('0x8b'));if(!_[_0x255f('0x11')](_0x52975f[_0x255f('0x8c')])){Object[_0x255f('0x8d')](_0x52975f['variables'])['forEach'](function(_0x1a1917){_0x5d65ad[_0x1a1917['toLowerCase']()]=_0x52975f[_0x255f('0x8c')][_0x1a1917];});}return _0x5d65ad;}exports[_0x255f('0x8e')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0xe229=['scheduledat','ContactId','ListId','decrementTalkink','pTalking','IsNotLoggedIn','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','active','countglobal','callback','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','match','noanswer','variables','keys','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','logLookAgent','UserId','logCustomer','talktime','getSeconds','answertime','isFailure','variablesAction','originate','channelAgent','timeout','uniqueid','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','scheduledAt'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0xe229,0x1ba));var _0x9e22=function(_0xc0cdd2,_0x4809e1){_0xc0cdd2=_0xc0cdd2-0x0;var _0x2c82af=_0xe229[_0xc0cdd2];return _0x2c82af;};'use strict';var util=require(_0x9e22('0x0'));var _=require(_0x9e22('0x1'));var moment=require(_0x9e22('0x2'));var logger=require(_0x9e22('0x3'))('preview');var ipAgi=process[_0x9e22('0x4')][_0x9e22('0x5')]||_0x9e22('0x6');var utils=require(_0x9e22('0x7'));exports['loggerCatch']=function(_0x1b973c){return function(_0x3d6e67){logger[_0x9e22('0x8')](_0x1b973c,util[_0x9e22('0x9')](_0x3d6e67,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1b74c7,_0x587e5e){logger['info'](_0x1b74c7,util[_0x9e22('0x9')](_0x587e5e,{'showHidden':![],'depth':null}));};exports[_0x9e22('0xa')]=function(_0x811866,_0x414ef8){logger['error'](_0x811866,util[_0x9e22('0x9')](_0x414ef8,{'showHidden':![],'depth':null}));};exports[_0x9e22('0xb')]=function(_0x3c4b90){return function(_0x5a7943){logger['info'](_0x3c4b90,util[_0x9e22('0x9')](_0x5a7943,{'showHidden':![],'depth':null}));};};exports[_0x9e22('0xc')]=function(_0x399dbb,_0x50b247,_0x3b16c2){return{'message':_0x399dbb,'unlock':_0x50b247,'active':_0x3b16c2};};exports['getCallerId']=function(_0x149927,_0x492db4,_0x587e1c){if(!_[_0x9e22('0xd')](_0x587e1c)&&_0x9e22('0xe')===typeof _0x587e1c&&!_[_0x9e22('0xf')](_0x587e1c)){if(!_[_0x9e22('0xd')](_0x492db4)&&'string'===typeof _0x492db4&&!_[_0x9e22('0xf')](_0x492db4)){return util[_0x9e22('0x10')](_0x9e22('0x11'),_0x492db4,_0x587e1c);}return util[_0x9e22('0x10')](_0x9e22('0x11'),_0x587e1c,_0x587e1c);}if(!_[_0x9e22('0xd')](_0x149927)&&_0x9e22('0xe')===typeof _0x149927&&!_[_0x9e22('0xf')](_0x149927)){return _0x149927;}return _0x9e22('0x12');};exports[_0x9e22('0x13')]=function(_0x5ffa34){if(_[_0x9e22('0x14')](_0x5ffa34)){return![];}return _0x5ffa34;};exports[_0x9e22('0x15')]=function(_0x2e837b,_0x1b0d59,_0x588603,_0x542369,_0x96b742,_0x4a577d){var _0x2f63d0={'XMD-QUEUE':_0x1b0d59[_0x9e22('0x16')]?_0x1b0d59[_0x9e22('0x16')][_0x9e22('0x17')]:'','XMD-CALLERID':_0x542369,'XMD-CALLERID-PREVIEW':_0x4a577d?util[_0x9e22('0x10')](_0x9e22('0x11'),_0x4a577d[_0x9e22('0x18')],_0x4a577d[_0x9e22('0x19')]):_0x542369,'XMD-DIALID':_0x96b742,'XMD-CONTACTID':_0x1b0d59['ContactId'],'XMD-CDRTYPE':_0x9e22('0x1a'),'CALLERID(all)':_0x542369,'XMD-VOICEQUEUEID':_0x1b0d59[_0x9e22('0x1b')],'XMD-DIALCHANNEL':_0x588603,'XMD-DIALTIMEOUT':_0x2e837b['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x9e22('0x1c'),_0x2e837b[_0x9e22('0x1d')]?'g':'',_[_0x9e22('0xf')](_0x2e837b[_0x9e22('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x2e837b[_0x9e22('0x1f')]||'','XMD-AGI':_0x2e837b[_0x9e22('0x20')]?util[_0x9e22('0x10')](_0x9e22('0x21'),ipAgi,_0x2e837b[_0x9e22('0x20')]):_0x9e22('0x22'),'XMD-AGIAFTER':_0x2e837b['dialQueueProject2']?util[_0x9e22('0x10')](_0x9e22('0x21'),ipAgi,_0x2e837b['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4a577d?_0x4a577d['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x4a577d?_0x4a577d[_0x9e22('0x23')]:'','XMD-DESTINATION':_0x9e22('0x24'),'SIPADDHEADER':_0x9e22('0x25')};if(!_[_0x9e22('0xf')](_0x2e837b['monitor_format'])){_0x2f63d0[util[_0x9e22('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x2e837b[_0x9e22('0x1e')];_0x2f63d0[util[_0x9e22('0x10')]('%s',_0x9e22('0x26'))]=_0x96b742;}return _0x2f63d0;};exports['toLowerVariables']=function(_0x377ee8){var _0x5b1acc={};for(var _0x3d16cd in _0x377ee8){if(_0x377ee8['hasOwnProperty'](_0x3d16cd)){_0x5b1acc[util[_0x9e22('0x10')]('%s',_[_0x9e22('0x27')](_0x3d16cd))]=_0x377ee8[_0x3d16cd];}}return{'variables':_0x5b1acc};};exports[_0x9e22('0x28')]=function(_0x1c1ea4,_0x3745e8){if(!_[_0x9e22('0x14')](_0x1c1ea4)){if(_0x1c1ea4['hasOwnProperty'](_0x9e22('0x29'))){if(_0x1c1ea4[_0x9e22('0x29')]>0x0){_0x1c1ea4[_0x9e22('0x29')]-=0x1;}else{logger[_0x9e22('0x8')](_0x9e22('0x2a'),_0x3745e8);}}}else{logger[_0x9e22('0x8')](_0x9e22('0x2b'),_0x3745e8);}};exports[_0x9e22('0x2c')]=function(_0x8f46d3){var _0x1ce6a1=moment()[_0x9e22('0x10')](_0x9e22('0x2d'));_0x8f46d3[_0x9e22('0x2e')]=0xd;_0x8f46d3[_0x9e22('0x2f')]=_0x9e22('0x30');_0x8f46d3[_0x9e22('0x31')]=_0x1ce6a1;_0x8f46d3[_0x9e22('0x32')]=_0x1ce6a1;_0x8f46d3[_0x9e22('0x33')]=_0x1ce6a1;};exports['logAgent']=function(_0x59eb83,_0x3e741b,_0x14cab1){var _0x25646b=moment()['format'](_0x9e22('0x2d'));_0x59eb83[_0x9e22('0x2e')]=_0x3e741b;_0x59eb83[_0x9e22('0x2f')]=_0x14cab1;_0x59eb83[_0x9e22('0x32')]=_0x25646b;_0x59eb83[_0x9e22('0x34')]=utils['getSeconds'](_0x59eb83[_0x9e22('0x32')],_0x59eb83[_0x9e22('0x31')]);};exports[_0x9e22('0x35')]=function(_0x71bcc0,_0x3f4856,_0x41eb2d){_0x71bcc0['membername']=_0x3f4856;_0x71bcc0[_0x9e22('0x36')]=_0x41eb2d;};exports[_0x9e22('0x37')]=function(_0x5bcac4,_0x3e0e6d,_0x483d7c){var _0x2108ef=moment()['format'](_0x9e22('0x2d'));_0x5bcac4[_0x9e22('0x2e')]=_0x3e0e6d;_0x5bcac4[_0x9e22('0x2f')]=_0x483d7c;_0x5bcac4['responsetime']=_0x5bcac4[_0x9e22('0x32')]?_0x5bcac4[_0x9e22('0x32')]:_0x2108ef;_0x5bcac4[_0x9e22('0x33')]=_0x5bcac4[_0x9e22('0x33')]?_0x5bcac4['endtime']:_0x2108ef;_0x5bcac4[_0x9e22('0x34')]=utils['getSeconds'](_0x5bcac4['responsetime']||0x0,_0x5bcac4[_0x9e22('0x31')]||0x0);_0x5bcac4[_0x9e22('0x38')]=_0x5bcac4['answertime']?utils[_0x9e22('0x39')](_0x5bcac4[_0x9e22('0x33')],_0x5bcac4[_0x9e22('0x3a')]):0x0;};exports[_0x9e22('0x3b')]=function(_0x463323){return _0x463323==='Failure';};exports[_0x9e22('0x3c')]=function(_0xc3bcc6,_0x65d89a,_0x5286da,_0x21a9ab,_0x54adee){var _0x57a1e7=_0x21a9ab?'RECALL':_0xc3bcc6[_0x9e22('0x18')];_0x57a1e7=_0x54adee?'BOOKED':_0x57a1e7;return{'actionid':_0xc3bcc6['uniqueid'],'action':_0x9e22('0x3d'),'channel':_0xc3bcc6[_0x9e22('0x3e')],'callerid':util[_0x9e22('0x10')]('\x22%s\x22\x20<%s>',_0x57a1e7,_0xc3bcc6[_0x9e22('0x19')]),'Exten':_0x9e22('0x24'),'Context':'from-sip','Priority':'1','variable':_0x5286da,'timeout':(_0x65d89a[_0x9e22('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc3bcc6[_0x9e22('0x40')]};};exports['totalGlobal']=function(_0x507c12){return _0x507c12[_0x9e22('0x41')]+_0x507c12['countcongestionretry']+_0x507c12[_0x9e22('0x42')]+_0x507c12[_0x9e22('0x43')]+_0x507c12['countnosuchnumberretry'];};exports[_0x9e22('0x44')]=function(_0x40b984){var _0x3cbfb8=_['clone'](_0x40b984);_0x3cbfb8['state']=0xf;_0x3cbfb8[_0x9e22('0x2f')]='Global';return _0x3cbfb8;};exports[_0x9e22('0x45')]=function(_0x233b0f,_0x57f46f,_0x1532e9){var _0x43d38c={};_0x43d38c[_0x57f46f]=_0x233b0f[_0x57f46f];_0x43d38c['active']=![];_0x43d38c[_0x9e22('0x46')]=moment()['add'](_0x1532e9,'minutes')[_0x9e22('0x10')](_0x9e22('0x2d'));_0x43d38c[_0x9e22('0x47')]=_0x233b0f[_0x9e22('0x47')];_0x43d38c[_0x9e22('0x48')]=_0x233b0f[_0x9e22('0x48')];_0x43d38c[_0x9e22('0x1b')]=_0x233b0f[_0x9e22('0x1b')]||undefined;return _0x43d38c;};exports[_0x9e22('0x49')]=function(_0x197b05,_0x22beed){if(!_[_0x9e22('0x14')](_0x197b05)){if(_0x197b05[_0x9e22('0x4a')]>0x0){_0x197b05[_0x9e22('0x4a')]-=0x1;}else{logger[_0x9e22('0x8')](_0x22beed,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x9e22('0x8')](_0x22beed,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x9e22('0x4b')]=function(_0x1d0641){if(_0x1d0641<=0x0){return!![];}return![];};function buildObj(_0x1dff4f,_0x442236,_0x61643d){_0x1dff4f[_0x9e22('0x4c')]=_0x442236;_0x1dff4f['name']=_0x1dff4f[_0x9e22('0x4d')];_0x1dff4f[_0x9e22('0x4e')]=_0x1dff4f['channelAgent'];_0x1dff4f[_0x9e22('0x4f')]='voice';if(_0x61643d){_0x1dff4f['mandatoryDisposition']=_0x61643d[_0x9e22('0x50')];}return _0x1dff4f;}exports[_0x9e22('0x51')]=buildObj;exports[_0x9e22('0x52')]=function(_0x3c5fad){var _0x1b73a1={};_0x1b73a1[_0x9e22('0x4d')]=_0x3c5fad['queue'];_0x1b73a1['interface']=_0x3c5fad[_0x9e22('0x3e')];_0x1b73a1[_0x9e22('0x40')]=_0x3c5fad[_0x9e22('0x40')];return _0x1b73a1;};exports[_0x9e22('0x53')]=function(_0xe83845){var _0x1ab952=[];for(var _0xffa4f8 in _0xe83845){if(_0xe83845['hasOwnProperty'](_0xffa4f8)){if(!_['isNil'](_0xe83845[_0xffa4f8])&&_0xe83845[_0xffa4f8][_0x9e22('0x2e')]===_0x9e22('0x54')&&_0xe83845[_0xffa4f8][_0x9e22('0x55')]==='reachable'){_0x1ab952['push'](_0xe83845[_0xffa4f8]['id']);}}}return _0x1ab952;};exports[_0x9e22('0x56')]=function(_0x42a29e){var _0x10daf5=moment()['milliseconds'](0x0);var _0x18b25b=moment(_0x42a29e)[_0x9e22('0x57')](0x0);return _0x10daf5[_0x9e22('0x58')](_0x18b25b,_0x9e22('0x59'));};exports['createBody']=function(_0xd7c072){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd7c072[_0x9e22('0x47')],'ListId':_0xd7c072[_0x9e22('0x48')],'VoiceQueueId':_0xd7c072[_0x9e22('0x1b')]||undefined,'CampaignId':_0xd7c072[_0x9e22('0x5a')]||undefined};};exports[_0x9e22('0x5b')]=function(_0x444f87){if(_0x444f87===_0x9e22('0x40')||_0x444f87===_0x9e22('0x5c')||_0x444f87===_0x9e22('0x4d')||_0x444f87==='type'||_0x444f87===_0x9e22('0x5d')||_0x444f87===_0x9e22('0x5e')||_0x444f87===_0x9e22('0x5f')||_0x444f87==='channelAgent'||_0x444f87==='calleridname'||_0x444f87===_0x9e22('0x60')||_0x444f87===_0x9e22('0x19')||_0x444f87==='scheduledat'||_0x444f87===_0x9e22('0x41')||_0x444f87==='countcongestionretry'||_0x444f87===_0x9e22('0x42')||_0x444f87===_0x9e22('0x61')||_0x444f87===_0x9e22('0x62')||_0x444f87==='callbackuniqueid'||_0x444f87===_0x9e22('0x63')||_0x444f87===_0x9e22('0x64')||_0x444f87===_0x9e22('0x47')||_0x444f87===_0x9e22('0x48')||_0x444f87===_0x9e22('0x36')||_0x444f87===_0x9e22('0x1b')||_0x444f87==='sipcallid'||_0x444f87===_0x9e22('0x65')||_0x444f87==='xmd-queue'||_0x444f87===_0x9e22('0x66')||_0x444f87===_0x9e22('0x67')||_0x444f87==='xmd-dialurl'||_0x444f87==='xmd-dialtimeout'||_0x444f87===_0x9e22('0x68')||_0x444f87===_0x9e22('0x69')||_0x444f87===_0x9e22('0x6a')||_0x444f87===_0x9e22('0x6b')||_0x444f87==='xmd-cdrtype'||_0x444f87==='xmd-callerid'||_0x444f87===_0x9e22('0x6c')||_0x444f87===_0x9e22('0x6d')||_0x444f87==='rtpaudioqos'||_0x444f87==='rtpaudioqosbridged'||_0x444f87===_0x9e22('0x6e')||_0x444f87===_0x9e22('0x6f')||_0x444f87===_0x9e22('0x70')||_0x444f87==='rtpaudioqoslossbridged'||_0x444f87===_0x9e22('0x71')||_0x444f87===_0x9e22('0x72')||_0x444f87==='rtpaudioqos'||_0x444f87===_0x9e22('0x73')||_0x444f87==='rtpaudioqosjitter'||_0x444f87==='rtpaudioqosjitterbridged'||_0x444f87===_0x9e22('0x70')||_0x444f87===_0x9e22('0x74')||_0x444f87==='rtpaudioqosrtt'||_0x444f87==='rtpaudioqosrttbridged'||_0x444f87===_0x9e22('0x75')||_0x444f87===_0x9e22('0x76')||_0x444f87===_0x9e22('0x2e')||_0x444f87===_0x9e22('0x2f')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x531e52,_0x5d1e95){var _0x2efd7e,_0x108537,_0x568d8e;if(_0x5d1e95<=0x0){_0x5d1e95=0x1;}_0x2efd7e=new RegExp(_0x9e22('0x77')+_0x5d1e95+'}$');_0x108537=Math[_0x9e22('0x78')](0xa,_0x5d1e95-0x1);_0x568d8e=Math[_0x9e22('0x78')](0xa,_0x5d1e95)-0x1;return util[_0x9e22('0x10')]('%s',_['replace'](_0x531e52,_0x2efd7e,_[_0x9e22('0x79')](_0x108537,_0x568d8e)));};exports[_0x9e22('0x7a')]=function(_0x1f1e73){var _0x102881=_0x1f1e73['match'](/"(.*?)"/);return _0x102881?_0x102881[0x1]:_0x1f1e73;};exports['extractCalleridNumber']=function(_0x3c62ae){var _0x36e31e=_0x3c62ae[_0x9e22('0x7b')](/<(.*?)>/);return _0x36e31e?_0x36e31e[0x1]:_0x3c62ae;};function buildNoAnswerEventPayload(_0x42090d,_0x51d890){var _0x293d3d=buildObj(_0x42090d,_0x9e22('0x7c'));if(!_['isEmpty'](_0x51d890[_0x9e22('0x7d')])){Object[_0x9e22('0x7e')](_0x51d890[_0x9e22('0x7d')])['forEach'](function(_0x525b25){_0x293d3d[_0x525b25['toLowerCase']()]=_0x51d890['variables'][_0x525b25];});}return _0x293d3d;}exports[_0x9e22('0x7f')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f2889ee..2bb4f84 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 _0x2498=['voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean','reload'];(function(_0x34a86f,_0x4d5b26){var _0x9453e7=function(_0x22d2ce){while(--_0x22d2ce){_0x34a86f['push'](_0x34a86f['shift']());}};_0x9453e7(++_0x4d5b26);}(_0x2498,0x1eb));var _0x8249=function(_0x3119af,_0xf0676c){_0x3119af=_0x3119af-0x0;var _0x1c587f=_0x2498[_0x3119af];return _0x1c587f;};'use strict';exports[_0x8249('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8249('0x1'),'required':!![]},'membername':{'type':_0x8249('0x1'),'required':!![]},'penalty':{'type':_0x8249('0x2'),'required':![]},'paused':{'type':_0x8249('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x8249('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x8249('0x1'),'required':![]}};exports[_0x8249('0x4')]={'module':{'type':_0x8249('0x1'),'required':![]}};exports[_0x8249('0x5')]={'uniqueid':{'type':_0x8249('0x1'),'required':!![]}};exports[_0x8249('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x8249('0x1')},'mixmonitorid':{'type':_0x8249('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x8249('0x7')]={'uniqueid':{'type':_0x8249('0x1'),'required':!![]},'exten':{'type':_0x8249('0x1'),'required':!![]},'context':{'type':_0x8249('0x1')}}; \ No newline at end of file +var _0x9dff=['queueremove','queuepause','reload','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x5ecff9,_0x473070){var _0x5e1415=function(_0x3c34a1){while(--_0x3c34a1){_0x5ecff9['push'](_0x5ecff9['shift']());}};_0x5e1415(++_0x473070);}(_0x9dff,0x1d4));var _0xf9df=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x9dff[_0x51020b];return _0x371e47;};'use strict';exports[_0xf9df('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xf9df('0x1'),'required':!![]},'penalty':{'type':_0xf9df('0x2'),'required':![]},'paused':{'type':_0xf9df('0x3'),'required':![]}};exports[_0xf9df('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xf9df('0x5')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xf9df('0x3')},'reason':{'type':_0xf9df('0x1'),'required':![]}};exports[_0xf9df('0x6')]={'module':{'type':_0xf9df('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xf9df('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xf9df('0x1'),'required':!![]},'filename':{'type':_0xf9df('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf9df('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xf9df('0x1'),'required':!![]}};exports[_0xf9df('0x7')]={'uniqueid':{'type':_0xf9df('0x1'),'required':!![]},'exten':{'type':_0xf9df('0x1'),'required':!![]},'context':{'type':_0xf9df('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 205e404..37d3c9b 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 _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x35d939,_0x1cc31f){var _0x519031=function(_0x4c9876){while(--_0x4c9876){_0x35d939['push'](_0x35d939['shift']());}};_0x519031(++_0x1cc31f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x7dd239,_0x21726f){var _0x445a7c=function(_0x28c884){while(--_0x28c884){_0x7dd239['push'](_0x7dd239['shift']());}};_0x445a7c(++_0x21726f);}(_0xadb5,0xad));var _0x5adb=function(_0x4bc40,_0x483bc8){_0x4bc40=_0x4bc40-0x0;var _0x4cb6d1=_0xadb5[_0x4bc40];return _0x4cb6d1;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index f65e139..158676d 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d7d=['mergeDBDataToRealtime'];(function(_0x13b442,_0x448c33){var _0x49d09c=function(_0x477277){while(--_0x477277){_0x13b442['push'](_0x13b442['shift']());}};_0x49d09c(++_0x448c33);}(_0x1d7d,0x18f));var _0xd1d7=function(_0x33b8fd,_0x5bb9e6){_0x33b8fd=_0x33b8fd-0x0;var _0x46bd51=_0x1d7d[_0x33b8fd];return _0x46bd51;};'use strict';function mergeDBDataToRealtime(_0x5d5fce,_0x464ef9){var _0x16c085=Object['assign']({},_0x5d5fce);for(var _0x1fedfd in _0x464ef9){if(_0x16c085['hasOwnProperty'](_0x1fedfd)){_0x16c085[_0x1fedfd]=_0x464ef9[_0x1fedfd];}}return _0x16c085;}exports[_0xd1d7('0x0')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x8ff8=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x49a54d,_0x3ebc95){var _0x1cce16=function(_0x31a82c){while(--_0x31a82c){_0x49a54d['push'](_0x49a54d['shift']());}};_0x1cce16(++_0x3ebc95);}(_0x8ff8,0xd5));var _0x88ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8ff8[_0x321bb2];return _0x9c12ed;};'use strict';function mergeDBDataToRealtime(_0x378f38,_0x38d48a){var _0x1139b1=Object[_0x88ff('0x0')]({},_0x378f38);for(var _0x41c5cb in _0x38d48a){if(_0x1139b1[_0x88ff('0x1')](_0x41c5cb)){_0x1139b1[_0x41c5cb]=_0x38d48a[_0x41c5cb];}}return _0x1139b1;}exports[_0x88ff('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ae01336..1e0e196 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 _0xbaa1=['voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','outbound','destination','exten','type','dialer','lastdata','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','calleridpreview','disposition','ANSWERED','linkedid','transfers','transfereelinkedid','uniqueid','UserId','monitor','monitorFilename','filename','monitors','connectedlinename','membername','create','isArray','forEach','startsWith','substring','indexOf','phone','lastIndexOf','transfererlinkedid','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0xbaa1,0xf1));var _0x1baa=function(_0x463e01,_0x3201ee){_0x463e01=_0x463e01-0x0;var _0x16c384=_0xbaa1[_0x463e01];return _0x16c384;};'use strict';var _=require(_0x1baa('0x0'));var moment=require(_0x1baa('0x1'));var util=require(_0x1baa('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x1baa('0x3'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x1baa('0x4'));var RpcMemberReport=require(_0x1baa('0x5'));var RpcVoiceQueueReport=require(_0x1baa('0x6'));var RpcVoiceRecording=require(_0x1baa('0x7'));var RpcVoiceTransferReport=require(_0x1baa('0x8'));var VoiceQueueReport=require(_0x1baa('0x9'));var VoiceCallReport=require(_0x1baa('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x1baa('0xb'));function Report(_0x5d25cd){this[_0x1baa('0xc')]=_0x5d25cd;this[_0x1baa('0xd')]=_0x5d25cd['agents'];this[_0x1baa('0xe')]=_0x5d25cd['telephones'];}Report[_0x1baa('0xf')][_0x1baa('0x10')]=function(_0x557d87){var _0xdb4605=new VoiceQueueReport(this['realtime']);var _0x57d69e=new VoiceAgentReport(this[_0x1baa('0xc')]);var _0x2c1588=new VoiceDialReport(this[_0x1baa('0xc')]);var _0x191eee=new VoiceCallReport(this[_0x1baa('0xc')]);var _0x42bdd9=new UserReport(this['realtime']);if(config[_0x1baa('0x11')]&&config[_0x1baa('0x11')]['disabled']){ami['on'](_0x1baa('0x12'),this[_0x1baa('0x13')][_0x1baa('0x14')](this));ami['on'](_0x1baa('0x15'),this['voiceCallReport'][_0x1baa('0x14')](this));ami['on'](_0x1baa('0x16'),this[_0x1baa('0x17')][_0x1baa('0x14')](this));ami['on'](_0x1baa('0x18'),this[_0x1baa('0x19')][_0x1baa('0x14')](this));ami['on'](_0x1baa('0x1a'),this[_0x1baa('0x1b')][_0x1baa('0x14')](this));ami['on'](_0x1baa('0x1c'),this[_0x1baa('0x1d')][_0x1baa('0x14')](this));}};Report[_0x1baa('0xf')][_0x1baa('0x1e')]=function(_0x55c084){var _0x3960ae;_0x3960ae=_['find'](this['agents'],function(_0x102c64){return _0x102c64[_0x1baa('0x1f')]==_0x55c084||_0x102c64[_0x1baa('0x20')]==_0x55c084;});if(_[_0x1baa('0x21')](_0x3960ae)){var _0xa48720=_[_0x1baa('0x22')](this[_0x1baa('0xe')],function(_0x3c48b0){return _0x3c48b0[_0x1baa('0x1f')]==_0x55c084||_0x3c48b0['name']==_0x55c084;});if(_0xa48720){_0x3960ae=_[_0x1baa('0x22')](this['agents'],function(_0xc91e26){return _0xc91e26[_0x1baa('0x23')]==util[_0x1baa('0x24')](_0x1baa('0x25'),_0xa48720[_0x1baa('0x20')]);});}}return _0x3960ae;};Report[_0x1baa('0xf')][_0x1baa('0x13')]=function(_0x186c9a){for(var _0x4b662c=0x0;_0x4b662c<_0x186c9a[_0x1baa('0x26')];_0x4b662c+=0x1){var _0x5e3625=this[_0x1baa('0x1e')](_0x186c9a[_0x4b662c][_0x1baa('0x27')]);if(_0x5e3625){_0x186c9a[_0x4b662c][_0x1baa('0x1f')]=_0x5e3625[_0x1baa('0x1f')];_0x186c9a[_0x4b662c][_0x1baa('0x28')]=!![];_0x186c9a[_0x4b662c][_0x1baa('0x29')]=_0x5e3625[_0x1baa('0x20')];_0x186c9a[_0x4b662c]['interface']=_['isNil'](_0x5e3625[_0x1baa('0x23')])?util[_0x1baa('0x24')](_0x1baa('0x25'),_0x5e3625['name']):_0x5e3625[_0x1baa('0x23')];if(_0x186c9a[_0x4b662c]['queuecallercomplete']){_0x186c9a[_0x4b662c][_0x1baa('0x2a')]=moment()['format'](_0x1baa('0x2b'));}if(_0x186c9a[_0x4b662c][_0x1baa('0x2c')]){_0x186c9a[_0x4b662c]['queuecallerexitAt']=moment()[_0x1baa('0x24')](_0x1baa('0x2b'));}RpcMemberReport[_0x1baa('0x13')](_0x186c9a[_0x4b662c]);}RpcVoiceQueueReport['create'](_0x186c9a[_0x4b662c]);}};function extractCalleridNumber(_0x324434){var _0x2cb91e=_0x324434[_0x1baa('0x2d')](/<(.*?)>/);return _0x2cb91e?_0x2cb91e[0x1]:_0x324434;}Report[_0x1baa('0xf')][_0x1baa('0x2e')]=function(_0x36a531){for(var _0x3eb0ce=0x0;_0x3eb0ce',_0x2ee574['calleridname'],_0x2ee574[_0x1baa('0x3e')]);}if(RpcVoiceTransferReport['transfers'][_0x2ee574[_0x1baa('0x44')]]){var _0x578058=RpcVoiceTransferReport[_0x1baa('0x45')][_0x2ee574[_0x1baa('0x44')]];_0x578058[_0x1baa('0x46')]=_0x2ee574[_0x1baa('0x47')];RpcVoiceTransferReport[_0x1baa('0x1b')](_0x578058);delete RpcVoiceTransferReport[_0x1baa('0x45')][_0x2ee574[_0x1baa('0x44')]];}if(_[_0x1baa('0x21')](_0x2ee574[_0x1baa('0x35')])){_0x2ee574[_0x1baa('0x35')]=this['getCallType'](_0x2ee574);}if(_[_0x1baa('0x21')](_0x2ee574[_0x1baa('0x48')])){var _0x46653b=_0x2ee574[_0x1baa('0x31')]['split']('-')[0x0];var _0xc2c0ba=this[_0x1baa('0xd')][_0x46653b];if(!_0xc2c0ba)_0xc2c0ba=this['getAgentByInternal'](_0x2ee574[_0x1baa('0x1f')]);if(_0xc2c0ba){_0x2ee574[_0x1baa('0x48')]=_0xc2c0ba['id'];_0x2ee574['membername']=_0xc2c0ba[_0x1baa('0x20')];}}RpcVoiceCallReport['create'](_0x2ee574);if(_0x2ee574[_0x1baa('0x49')]){for(var _0x197419=0x0;_0x197419<_0x2ee574['monitors'][_0x1baa('0x26')];_0x197419+=0x1){_0x2ee574[_0x1baa('0x4a')]=_0x2ee574['monitors'][_0x197419][_0x1baa('0x4b')];_0x2ee574['createdAt']=_0x2ee574[_0x1baa('0x4c')][_0x197419]['createdAt'];if(_0x2ee574[_0x1baa('0x34')]=='xcally-motion-preview'){_0x2ee574[_0x1baa('0x3e')]=_0x2ee574['connectedlinenum'];_0x2ee574['calleridname']=_0x2ee574[_0x1baa('0x4d')];_0x2ee574['connectedlinenum']=_0x2ee574[_0x1baa('0x1f')];_0x2ee574['connectedlinename']=_0x2ee574[_0x1baa('0x4e')];_0x2ee574[_0x1baa('0x34')]=_0x2ee574['originatecalleridnum'];}else if(_0x2ee574[_0x1baa('0x34')]=='xcally-motion-dialer'){_0x2ee574[_0x1baa('0x3e')]=_0x2ee574[_0x1baa('0x33')];_0x2ee574[_0x1baa('0x34')]=_0x2ee574[_0x1baa('0x3f')];}RpcVoiceRecording[_0x1baa('0x4f')](_0x2ee574);}}};Report[_0x1baa('0xf')]['voiceAgentReport']=function(_0x43786f){if(_[_0x1baa('0x50')](_0x43786f)){_0x43786f[_0x1baa('0x51')](function(_0xc0384b){RpcVoiceAgentReport[_0x1baa('0x4f')](_0xc0384b);});}else{RpcVoiceAgentReport[_0x1baa('0x4f')](_0x43786f);}};Report[_0x1baa('0xf')][_0x1baa('0x19')]=function(_0xac3f9d){RpcVoiceDialReport['create'](_0xac3f9d);var _0x523174;var _0x161268;var _0x13fd71=_0xac3f9d[_0x1baa('0x31')];if(_[_0x1baa('0x52')](_0x13fd71,'Local')){_0x161268=_0x13fd71[_0x1baa('0x53')](_0x13fd71[_0x1baa('0x54')]('/')+0x1,_0x13fd71[_0x1baa('0x54')]('@'));_0x523174=_[_0x1baa('0x22')](this[_0x1baa('0xd')],function(_0x29f0c8){return _0x29f0c8['mobile']==_0x161268||_0x29f0c8[_0x1baa('0x55')]==_0x161268||_0x29f0c8[_0x1baa('0x1f')]==_0x161268;});}else{_0x161268=_0x13fd71[_0x1baa('0x53')](_0x13fd71[_0x1baa('0x54')]('/')+0x1,_0x13fd71[_0x1baa('0x56')]('-'));_0x523174=this['findAgent'](_0x161268);}if(_0x523174){_0xac3f9d[_0x1baa('0x23')]=_[_0x1baa('0x21')](_0x523174[_0x1baa('0x23')])?util['format'](_0x1baa('0x25'),_0x523174['name']):_0x523174[_0x1baa('0x23')];_0xac3f9d[_0x1baa('0x4e')]=_0x523174[_0x1baa('0x20')];_0xac3f9d['accountcode']=_0x523174['accountcode'];RpcMemberReport['voiceDialReport'](_0xac3f9d);}};Report[_0x1baa('0xf')]['blindTransfer']=function(_0x49cc22){RpcVoiceTransferReport[_0x1baa('0x45')][_0x49cc22[_0x1baa('0x57')]]=_0x49cc22;};Report['prototype'][_0x1baa('0x1d')]=function(_0x50bddc){RpcVoiceTransferReport[_0x1baa('0x1d')](_0x50bddc);};module['exports']=Report; \ No newline at end of file +var _0x92bf=['findAgent','find','name','isNil','interface','format','SIP/%s','length','connectedlinenum','accountcode','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','calleridnum','outbound','internal','destination','exten','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','channel','destinationchannel','originatecalleridnum','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','isArray','create','startsWith','Local','indexOf','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x92bf,0x100));var _0xf92b=function(_0x46ff05,_0x2152b8){_0x46ff05=_0x46ff05-0x0;var _0x5843f7=_0x92bf[_0x46ff05];return _0x5843f7;};'use strict';var _=require(_0xf92b('0x0'));var moment=require(_0xf92b('0x1'));var util=require(_0xf92b('0x2'));var config=require(_0xf92b('0x3'));var ami=require(_0xf92b('0x4'));var RpcVoiceAgentReport=require(_0xf92b('0x5'));var RpcVoiceCallReport=require(_0xf92b('0x6'));var RpcVoiceDialReport=require(_0xf92b('0x7'));var RpcMemberReport=require(_0xf92b('0x8'));var RpcVoiceQueueReport=require(_0xf92b('0x9'));var RpcVoiceRecording=require(_0xf92b('0xa'));var RpcVoiceTransferReport=require(_0xf92b('0xb'));var VoiceQueueReport=require(_0xf92b('0xc'));var VoiceCallReport=require(_0xf92b('0xd'));var VoiceAgentReport=require(_0xf92b('0xe'));var VoiceDialReport=require(_0xf92b('0xf'));var UserReport=require('./userReport');function Report(_0x4b06b6){this[_0xf92b('0x10')]=_0x4b06b6;this['agents']=_0x4b06b6[_0xf92b('0x11')];this['telephones']=_0x4b06b6[_0xf92b('0x12')];}Report[_0xf92b('0x13')][_0xf92b('0x14')]=function(_0x1a4228){var _0x11c5f1=new VoiceQueueReport(this[_0xf92b('0x10')]);var _0x4bc978=new VoiceAgentReport(this[_0xf92b('0x10')]);var _0x3fb8b0=new VoiceDialReport(this['realtime']);var _0xa99cea=new VoiceCallReport(this[_0xf92b('0x10')]);var _0x2809ae=new UserReport(this[_0xf92b('0x10')]);if(config[_0xf92b('0x15')]&&config['xdr'][_0xf92b('0x16')]){ami['on'](_0xf92b('0x17'),this[_0xf92b('0x18')][_0xf92b('0x19')](this));ami['on'](_0xf92b('0x1a'),this[_0xf92b('0x1b')][_0xf92b('0x19')](this));ami['on'](_0xf92b('0x1c'),this[_0xf92b('0x1d')][_0xf92b('0x19')](this));ami['on'](_0xf92b('0x1e'),this[_0xf92b('0x1f')][_0xf92b('0x19')](this));ami['on']('blindtransfer',this[_0xf92b('0x20')][_0xf92b('0x19')](this));ami['on'](_0xf92b('0x21'),this[_0xf92b('0x22')][_0xf92b('0x19')](this));}};Report[_0xf92b('0x13')][_0xf92b('0x23')]=function(_0x27881e){var _0x631b2c;_0x631b2c=_[_0xf92b('0x24')](this[_0xf92b('0x11')],function(_0x330af3){return _0x330af3['accountcode']==_0x27881e||_0x330af3[_0xf92b('0x25')]==_0x27881e;});if(_[_0xf92b('0x26')](_0x631b2c)){var _0xffd1be=_['find'](this[_0xf92b('0x12')],function(_0x39d9f8){return _0x39d9f8['accountcode']==_0x27881e||_0x39d9f8[_0xf92b('0x25')]==_0x27881e;});if(_0xffd1be){_0x631b2c=_[_0xf92b('0x24')](this['agents'],function(_0xb6c49e){return _0xb6c49e[_0xf92b('0x27')]==util[_0xf92b('0x28')](_0xf92b('0x29'),_0xffd1be[_0xf92b('0x25')]);});}}return _0x631b2c;};Report['prototype'][_0xf92b('0x18')]=function(_0x2e7f46){for(var _0x57b310=0x0;_0x57b310<_0x2e7f46[_0xf92b('0x2a')];_0x57b310+=0x1){var _0x3dc633=this['findAgent'](_0x2e7f46[_0x57b310][_0xf92b('0x2b')]);if(_0x3dc633){_0x2e7f46[_0x57b310][_0xf92b('0x2c')]=_0x3dc633[_0xf92b('0x2c')];_0x2e7f46[_0x57b310][_0xf92b('0x2d')]=!![];_0x2e7f46[_0x57b310][_0xf92b('0x2e')]=_0x3dc633['name'];_0x2e7f46[_0x57b310][_0xf92b('0x27')]=_[_0xf92b('0x26')](_0x3dc633[_0xf92b('0x27')])?util[_0xf92b('0x28')]('SIP/%s',_0x3dc633[_0xf92b('0x25')]):_0x3dc633[_0xf92b('0x27')];if(_0x2e7f46[_0x57b310][_0xf92b('0x2f')]){_0x2e7f46[_0x57b310]['queuecallercompleteAt']=moment()['format'](_0xf92b('0x30'));}if(_0x2e7f46[_0x57b310][_0xf92b('0x31')]){_0x2e7f46[_0x57b310][_0xf92b('0x32')]=moment()['format'](_0xf92b('0x30'));}RpcMemberReport[_0xf92b('0x18')](_0x2e7f46[_0x57b310]);}RpcVoiceQueueReport['create'](_0x2e7f46[_0x57b310]);}};function extractCalleridNumber(_0x2f8b90){var _0x3519c1=_0x2f8b90[_0xf92b('0x33')](/<(.*?)>/);return _0x3519c1?_0x3519c1[0x1]:_0x2f8b90;}Report[_0xf92b('0x13')][_0xf92b('0x34')]=function(_0x275fc9){for(var _0x3a4447=0x0;_0x3a4447',_0x39dfbb[_0xf92b('0x49')],_0x39dfbb['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0x39dfbb['linkedid']]){var _0x57487d=RpcVoiceTransferReport[_0xf92b('0x4a')][_0x39dfbb[_0xf92b('0x4b')]];_0x57487d[_0xf92b('0x4c')]=_0x39dfbb[_0xf92b('0x4d')];RpcVoiceTransferReport[_0xf92b('0x20')](_0x57487d);delete RpcVoiceTransferReport[_0xf92b('0x4a')][_0x39dfbb[_0xf92b('0x4b')]];}if(_['isNil'](_0x39dfbb[_0xf92b('0x4e')])){_0x39dfbb[_0xf92b('0x4e')]=this[_0xf92b('0x36')](_0x39dfbb);}if(_[_0xf92b('0x26')](_0x39dfbb[_0xf92b('0x4f')])){var _0x285688=_0x39dfbb[_0xf92b('0x44')]['split']('-')[0x0];var _0x4c4dfc=this[_0xf92b('0x11')][_0x285688];if(!_0x4c4dfc)_0x4c4dfc=this[_0xf92b('0x34')](_0x39dfbb['accountcode']);if(_0x4c4dfc){_0x39dfbb['UserId']=_0x4c4dfc['id'];_0x39dfbb[_0xf92b('0x50')]=_0x4c4dfc['name'];}}RpcVoiceCallReport['create'](_0x39dfbb);if(_0x39dfbb[_0xf92b('0x51')]){for(var _0x56f612=0x0;_0x56f612<_0x39dfbb[_0xf92b('0x52')]['length'];_0x56f612+=0x1){_0x39dfbb[_0xf92b('0x53')]=_0x39dfbb[_0xf92b('0x52')][_0x56f612]['filename'];_0x39dfbb[_0xf92b('0x54')]=_0x39dfbb['monitors'][_0x56f612][_0xf92b('0x54')];if(_0x39dfbb[_0xf92b('0x3b')]=='xcally-motion-preview'){_0x39dfbb[_0xf92b('0x37')]=_0x39dfbb[_0xf92b('0x2b')];_0x39dfbb['calleridname']=_0x39dfbb[_0xf92b('0x55')];_0x39dfbb[_0xf92b('0x2b')]=_0x39dfbb[_0xf92b('0x2c')];_0x39dfbb[_0xf92b('0x55')]=_0x39dfbb[_0xf92b('0x50')];_0x39dfbb['exten']=_0x39dfbb[_0xf92b('0x46')];}else if(_0x39dfbb[_0xf92b('0x3b')]==_0xf92b('0x56')){_0x39dfbb[_0xf92b('0x37')]=_0x39dfbb['destination'];_0x39dfbb[_0xf92b('0x3b')]=_0x39dfbb['originatecalleridnum'];}RpcVoiceRecording['create'](_0x39dfbb);}}};Report[_0xf92b('0x13')][_0xf92b('0x1d')]=function(_0x1434f8){if(_[_0xf92b('0x57')](_0x1434f8)){_0x1434f8['forEach'](function(_0x33de2d){RpcVoiceAgentReport[_0xf92b('0x58')](_0x33de2d);});}else{RpcVoiceAgentReport['create'](_0x1434f8);}};Report[_0xf92b('0x13')]['voiceDialReport']=function(_0x58d0ba){RpcVoiceDialReport[_0xf92b('0x58')](_0x58d0ba);var _0x408a73;var _0x493dd2;var _0x22a5f3=_0x58d0ba[_0xf92b('0x44')];if(_[_0xf92b('0x59')](_0x22a5f3,_0xf92b('0x5a'))){_0x493dd2=_0x22a5f3['substring'](_0x22a5f3[_0xf92b('0x5b')]('/')+0x1,_0x22a5f3['indexOf']('@'));_0x408a73=_[_0xf92b('0x24')](this[_0xf92b('0x11')],function(_0x588c9c){return _0x588c9c['mobile']==_0x493dd2||_0x588c9c[_0xf92b('0x5c')]==_0x493dd2||_0x588c9c['accountcode']==_0x493dd2;});}else{_0x493dd2=_0x22a5f3[_0xf92b('0x5d')](_0x22a5f3[_0xf92b('0x5b')]('/')+0x1,_0x22a5f3[_0xf92b('0x5e')]('-'));_0x408a73=this[_0xf92b('0x23')](_0x493dd2);}if(_0x408a73){_0x58d0ba['interface']=_['isNil'](_0x408a73[_0xf92b('0x27')])?util[_0xf92b('0x28')](_0xf92b('0x29'),_0x408a73['name']):_0x408a73[_0xf92b('0x27')];_0x58d0ba[_0xf92b('0x50')]=_0x408a73['name'];_0x58d0ba[_0xf92b('0x2c')]=_0x408a73[_0xf92b('0x2c')];RpcMemberReport['voiceDialReport'](_0x58d0ba);}};Report['prototype']['blindTransfer']=function(_0x3212c2){RpcVoiceTransferReport[_0xf92b('0x4a')][_0x3212c2[_0xf92b('0x5f')]]=_0x3212c2;};Report[_0xf92b('0x13')][_0xf92b('0x22')]=function(_0x845090){RpcVoiceTransferReport[_0xf92b('0x22')](_0x845090);};module[_0xf92b('0x60')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index bae1358..ad38307 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 _0xd330=['debug','[userReport][registry]','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','toNumber','updateStatusRealtime','stateTime','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','find','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','resolve','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state'];(function(_0x3c4f01,_0x1102ed){var _0x3b1752=function(_0x3fd967){while(--_0x3fd967){_0x3c4f01['push'](_0x3c4f01['shift']());}};_0x3b1752(++_0x1102ed);}(_0xd330,0x1ad));var _0x0d33=function(_0x5149c9,_0x5e7788){_0x5149c9=_0x5149c9-0x0;var _0x4d50e9=_0xd330[_0x5149c9];return _0x4d50e9;};'use strict';var _=require(_0x0d33('0x0'));var moment=require(_0x0d33('0x1'));var util=require('util');var Redis=require(_0x0d33('0x2'));var BPromise=require('bluebird');var config=require(_0x0d33('0x3'));var logger=require('../../../config/logger')(_0x0d33('0x4'));var ami=require(_0x0d33('0x5'));config[_0x0d33('0x6')]=_[_0x0d33('0x7')](config['redis'],{'host':_0x0d33('0x8'),'port':0x18eb});var io=require(_0x0d33('0x9'))(new Redis(config['redis']));function UserReport(_0x3826ff){this['trunks']=_0x3826ff[_0x0d33('0xa')];this[_0x0d33('0xb')]=_0x3826ff[_0x0d33('0xb')];this[_0x0d33('0xc')]=_0x3826ff[_0x0d33('0xc')];ami['on'](_0x0d33('0xd'),this[_0x0d33('0xe')][_0x0d33('0xf')](this));ami['on']('registry',this[_0x0d33('0xe')][_0x0d33('0xf')](this));ami['on'](_0x0d33('0x10'),this[_0x0d33('0x11')]['bind'](this));ami['on'](_0x0d33('0x12'),this['syncPeerStatus']['bind'](this));return this[_0x0d33('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0x0d33('0x14')](ami[_0x0d33('0x15')]())[_0x0d33('0x16')](function(_0x2f0c8a){logger['error'](_0x0d33('0x17'),util[_0x0d33('0x18')](_0x2f0c8a,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x0d33('0x14')](ami[_0x0d33('0x19')]())['catch'](function(_0x4c5469){logger[_0x0d33('0x1a')](_0x0d33('0x1b'),util[_0x0d33('0x18')](_0x4c5469,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x0d33('0x14')](ami[_0x0d33('0x1c')]())['catch'](function(_0x1adb55){logger[_0x0d33('0x1a')](_0x0d33('0x1d'),util['inspect'](_0x1adb55,{'showHidden':![],'depth':null}));});}UserReport[_0x0d33('0x1e')][_0x0d33('0x13')]=function(){setInterval(function(){BPromise[_0x0d33('0x1f')]()[_0x0d33('0x14')](showSipRegistrations())[_0x0d33('0x14')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x0d33('0x1e')][_0x0d33('0x20')]=function(_0x47a555){return _0x47a555!==null&&!_[_0x0d33('0x21')](_0x47a555);};UserReport[_0x0d33('0x1e')][_0x0d33('0x22')]=function(_0x25577c,_0x56f47c,_0x4c05d4){io['to'](_0x25577c)[_0x0d33('0x22')](_0x56f47c,_0x4c05d4);};UserReport['prototype']['syncRegistry']=function(_0x4cf076){try{if(this[_0x0d33('0x20')](_0x4cf076)){logger[_0x0d33('0x23')](_0x0d33('0x24'),_0x4cf076[_0x0d33('0x25')],_0x4cf076[_0x0d33('0x26')]);logger[_0x0d33('0x27')](_0x0d33('0x28'),util[_0x0d33('0x18')](_0x4cf076,{'showHidden':![],'depth':null}));var _0x260341=_['find'](this[_0x0d33('0xa')],{'defaultuser':_0x4cf076['username']});if(_0x260341){_0x4cf076[_0x0d33('0x29')]=_0x4cf076[_0x0d33('0x26')];_[_0x0d33('0x2a')](_0x260341,_[_0x0d33('0x2b')](_0x4cf076,[_0x0d33('0x2c'),_0x0d33('0x2d'),_0x0d33('0x25'),_0x0d33('0x26')]));logger['debug'](_0x0d33('0x2e'),util['inspect'](_0x260341,{'showHidden':![],'depth':null}));this[_0x0d33('0x22')](util[_0x0d33('0x2f')]('trunk:%s',_0x260341[_0x0d33('0x30')]),_0x0d33('0x31'),_0x260341);}}}catch(_0x348a94){logger['error'](_0x0d33('0x28'),util[_0x0d33('0x18')](_0x348a94,{'showHidden':![],'depth':null}));}};UserReport[_0x0d33('0x1e')][_0x0d33('0x11')]=function(_0x86ac13){try{if(this['isNotNull'](_0x86ac13)){logger['info'](_0x0d33('0x32'),_0x86ac13[_0x0d33('0x33')],_0x86ac13[_0x0d33('0x26')]);logger[_0x0d33('0x27')](_0x0d33('0x34'),util[_0x0d33('0x18')](_0x86ac13,{'showHidden':![],'depth':null}));if(this[_0x0d33('0xb')][_0x86ac13['device']]){if(!this[_0x0d33('0xb')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x35')]||_0x86ac13['state'][_0x0d33('0x36')]()=='inuse'){this[_0x0d33('0xb')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x35')]=![];if(this[_0x0d33('0xb')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x26')]!==_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]()){this['agents'][_0x86ac13['device']]['stateTime']=_[_0x0d33('0x37')](moment()[_0x0d33('0x2f')]('x'));}this[_0x0d33('0xb')][_0x86ac13['device']][_0x0d33('0x26')]=_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]();this[_0x0d33('0xb')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x38')](_0x86ac13);}}else if(this[_0x0d33('0xc')][_0x86ac13['device']]){if(this[_0x0d33('0xc')][_0x86ac13['device']]['state']!==_0x86ac13[_0x0d33('0x26')]['toLowerCase']()){this[_0x0d33('0xc')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x39')]=_[_0x0d33('0x37')](moment()[_0x0d33('0x2f')]('x'));}this['telephones'][_0x86ac13['device']][_0x0d33('0x26')]=_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x0d33('0x18')](this[_0x0d33('0xc')][_0x86ac13[_0x0d33('0x33')]],{'showHidden':![],'depth':null}));this[_0x0d33('0x22')](util[_0x0d33('0x2f')](_0x0d33('0x3a'),this[_0x0d33('0xc')][_0x86ac13[_0x0d33('0x33')]]['name']),'telephone:save',this[_0x0d33('0xc')][_0x86ac13['device']]);}else if(this['trunks'][_0x86ac13[_0x0d33('0x33')]]){if(this[_0x0d33('0xa')][_0x86ac13['device']][_0x0d33('0x26')]!==_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]()){this[_0x0d33('0xa')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x39')]=_[_0x0d33('0x37')](moment()['format']('x'));}this[_0x0d33('0xa')][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x26')]=_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]();logger[_0x0d33('0x27')](_0x0d33('0x3b'),util[_0x0d33('0x18')](this[_0x0d33('0xa')][_0x86ac13[_0x0d33('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0d33('0x2f')](_0x0d33('0x3c'),this['trunks'][_0x86ac13[_0x0d33('0x33')]][_0x0d33('0x30')]),_0x0d33('0x31'),this[_0x0d33('0xa')][_0x86ac13['device']]);}else if(_['startsWith'](_0x86ac13[_0x0d33('0x33')],_0x0d33('0x3d'))){var _0x1adb60=_0x86ac13[_0x0d33('0x33')];var _0x55503c=_0x1adb60[_0x0d33('0x3e')](_0x1adb60[_0x0d33('0x3f')]('/')+0x1,_0x1adb60[_0x0d33('0x3f')]('@'));var _0x2c5846=_[_0x0d33('0x40')](this[_0x0d33('0xb')],function(_0x2a0078){return _0x2a0078[_0x0d33('0x41')]==_0x55503c||_0x2a0078[_0x0d33('0x42')]==_0x55503c||_0x2a0078[_0x0d33('0x43')]==_0x55503c;});if(_0x2c5846){if(_0x2c5846[_0x0d33('0x26')]!==_0x86ac13['state'][_0x0d33('0x36')]()){_0x2c5846['stateTime']=_[_0x0d33('0x37')](moment()[_0x0d33('0x2f')]('x'));}_0x2c5846[_0x0d33('0x26')]=_0x86ac13[_0x0d33('0x26')][_0x0d33('0x36')]();_0x2c5846['local']=!![];_0x2c5846['updateStatusRealtime'](_0x86ac13);}}}}catch(_0x16b87d){logger[_0x0d33('0x1a')](_0x0d33('0x34'),util[_0x0d33('0x18')](_0x16b87d,{'showHidden':![],'depth':null}));}};UserReport[_0x0d33('0x1e')][_0x0d33('0x44')]=function(_0xfb9f5b){try{if(this['isNotNull'](_0xfb9f5b)&&this[_0x0d33('0x20')](_0xfb9f5b[_0x0d33('0x12')])){logger[_0x0d33('0x23')](_0x0d33('0x45'),_0xfb9f5b[_0x0d33('0x46')],_0xfb9f5b[_0x0d33('0x47')],_0xfb9f5b[_0x0d33('0x12')]);logger['debug'](_0x0d33('0x48'),util[_0x0d33('0x18')](_0xfb9f5b,{'showHidden':![],'depth':null}));if(this[_0x0d33('0xb')][_0xfb9f5b[_0x0d33('0x46')]]){if(!this[_0x0d33('0xb')][_0xfb9f5b[_0x0d33('0x46')]]['local']||_0xfb9f5b[_0x0d33('0x12')]['toLowerCase']()=='registered'){this[_0x0d33('0xb')][_0xfb9f5b[_0x0d33('0x46')]][_0x0d33('0x35')]=![];this[_0x0d33('0xb')][_0xfb9f5b['peer']][_0x0d33('0x49')]=_0xfb9f5b[_0x0d33('0x12')]['toLowerCase']();this[_0x0d33('0xb')][_0xfb9f5b[_0x0d33('0x46')]][_0x0d33('0x47')]=_0xfb9f5b[_0x0d33('0x47')];this['agents'][_0xfb9f5b[_0x0d33('0x46')]][_0x0d33('0x38')](_0xfb9f5b);}}else if(this['telephones'][_0xfb9f5b['peer']]){this[_0x0d33('0xc')][_0xfb9f5b[_0x0d33('0x46')]][_0x0d33('0x49')]=_0xfb9f5b['peerstatus'][_0x0d33('0x36')]();this['telephones'][_0xfb9f5b[_0x0d33('0x46')]][_0x0d33('0x47')]=_0xfb9f5b['address'];logger[_0x0d33('0x27')](_0x0d33('0x4a'),util['inspect'](this[_0x0d33('0xc')][_0xfb9f5b[_0x0d33('0x46')]],{'showHidden':![],'depth':null}));this[_0x0d33('0x22')](util[_0x0d33('0x2f')](_0x0d33('0x3a'),this[_0x0d33('0xc')][_0xfb9f5b[_0x0d33('0x46')]]['name']),_0x0d33('0x4b'),this[_0x0d33('0xc')][_0xfb9f5b[_0x0d33('0x46')]]);}else if(this[_0x0d33('0xa')][_0xfb9f5b[_0x0d33('0x46')]]){this[_0x0d33('0xa')][_0xfb9f5b['peer']][_0x0d33('0x49')]=_0xfb9f5b['peerstatus'][_0x0d33('0x36')]();this[_0x0d33('0xa')][_0xfb9f5b['peer']][_0x0d33('0x47')]=_0xfb9f5b[_0x0d33('0x47')];logger[_0x0d33('0x27')](_0x0d33('0x4c'),util[_0x0d33('0x18')](this[_0x0d33('0xa')][_0xfb9f5b['peer']],{'showHidden':![],'depth':null}));this[_0x0d33('0x22')](util[_0x0d33('0x2f')]('trunk:%s',this['trunks'][_0xfb9f5b['peer']][_0x0d33('0x30')]),'trunk:save',this[_0x0d33('0xa')][_0xfb9f5b['peer']]);}}}catch(_0x2c64a6){logger[_0x0d33('0x1a')](_0x0d33('0x48'),util['inspect'](_0x2c64a6,{'showHidden':![],'depth':null}));}};module[_0x0d33('0x4d')]=UserReport; \ No newline at end of file +var _0x363f=['actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','find','stateRegistry','merge','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','startsWith','Local','indexOf','mobile','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList'];(function(_0x20ad0a,_0x30e85c){var _0xc9529a=function(_0x5b4157){while(--_0x5b4157){_0x20ad0a['push'](_0x20ad0a['shift']());}};_0xc9529a(++_0x30e85c);}(_0x363f,0x79));var _0xf363=function(_0x16a10f,_0x27bb19){_0x16a10f=_0x16a10f-0x0;var _0x43d785=_0x363f[_0x16a10f];return _0x43d785;};'use strict';var _=require(_0xf363('0x0'));var moment=require(_0xf363('0x1'));var util=require('util');var Redis=require(_0xf363('0x2'));var BPromise=require('bluebird');var config=require(_0xf363('0x3'));var logger=require(_0xf363('0x4'))('ami');var ami=require(_0xf363('0x5'));config[_0xf363('0x6')]=_['defaults'](config[_0xf363('0x6')],{'host':_0xf363('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf363('0x6')]));function UserReport(_0x36dd64){this[_0xf363('0x8')]=_0x36dd64[_0xf363('0x8')];this['agents']=_0x36dd64[_0xf363('0x9')];this[_0xf363('0xa')]=_0x36dd64[_0xf363('0xa')];ami['on']('registryentry',this[_0xf363('0xb')][_0xf363('0xc')](this));ami['on'](_0xf363('0xd'),this[_0xf363('0xb')][_0xf363('0xc')](this));ami['on'](_0xf363('0xe'),this[_0xf363('0xf')][_0xf363('0xc')](this));ami['on'](_0xf363('0x10'),this[_0xf363('0x11')][_0xf363('0xc')](this));return this[_0xf363('0x12')]();}function showSipRegistrations(){Promise[_0xf363('0x13')]()['then'](ami[_0xf363('0x14')]())[_0xf363('0x15')](function(_0x2297b3){logger[_0xf363('0x16')](_0xf363('0x17'),util[_0xf363('0x18')](_0x2297b3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf363('0x13')]()[_0xf363('0x19')](ami[_0xf363('0x1a')]())[_0xf363('0x15')](function(_0x447e06){logger[_0xf363('0x16')]('[userReport][devicestatelist]',util['inspect'](_0x447e06,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf363('0x13')]()[_0xf363('0x19')](ami[_0xf363('0x1b')]())['catch'](function(_0x8b3ffe){logger[_0xf363('0x16')](_0xf363('0x1c'),util[_0xf363('0x18')](_0x8b3ffe,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xf363('0x13')]()[_0xf363('0x19')](showSipRegistrations())[_0xf363('0x19')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xf363('0x1d')][_0xf363('0x1e')]=function(_0x541dcb){return _0x541dcb!==null&&!_[_0xf363('0x1f')](_0x541dcb);};UserReport['prototype']['emit']=function(_0x3ced00,_0x42b564,_0x400409){io['to'](_0x3ced00)[_0xf363('0x20')](_0x42b564,_0x400409);};UserReport['prototype'][_0xf363('0xb')]=function(_0x21060c){try{if(this[_0xf363('0x1e')](_0x21060c)){logger[_0xf363('0x21')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x21060c[_0xf363('0x22')],_0x21060c[_0xf363('0x23')]);logger[_0xf363('0x24')](_0xf363('0x25'),util[_0xf363('0x18')](_0x21060c,{'showHidden':![],'depth':null}));var _0x4c3a30=_[_0xf363('0x26')](this[_0xf363('0x8')],{'defaultuser':_0x21060c[_0xf363('0x22')]});if(_0x4c3a30){_0x21060c[_0xf363('0x27')]=_0x21060c[_0xf363('0x23')];_[_0xf363('0x28')](_0x4c3a30,_['omit'](_0x21060c,[_0xf363('0x29'),_0xf363('0x2a'),_0xf363('0x22'),_0xf363('0x23')]));logger['debug'](_0xf363('0x2b'),util[_0xf363('0x18')](_0x4c3a30,{'showHidden':![],'depth':null}));this[_0xf363('0x20')](util[_0xf363('0x2c')](_0xf363('0x2d'),_0x4c3a30[_0xf363('0x2e')]),_0xf363('0x2f'),_0x4c3a30);}}}catch(_0x386353){logger[_0xf363('0x16')](_0xf363('0x25'),util[_0xf363('0x18')](_0x386353,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x44fd32){try{if(this[_0xf363('0x1e')](_0x44fd32)){logger[_0xf363('0x21')](_0xf363('0x30'),_0x44fd32[_0xf363('0x31')],_0x44fd32[_0xf363('0x23')]);logger[_0xf363('0x24')](_0xf363('0x32'),util[_0xf363('0x18')](_0x44fd32,{'showHidden':![],'depth':null}));if(this[_0xf363('0x9')][_0x44fd32['device']]){if(!this[_0xf363('0x9')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x33')]||_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]()==_0xf363('0x35')){this['agents'][_0x44fd32['device']][_0xf363('0x33')]=![];if(this['agents'][_0x44fd32[_0xf363('0x31')]][_0xf363('0x23')]!==_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]()){this[_0xf363('0x9')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x36')]=_['toNumber'](moment()['format']('x'));}this['agents'][_0x44fd32[_0xf363('0x31')]][_0xf363('0x23')]=_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]();this[_0xf363('0x9')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x37')](_0x44fd32);}}else if(this['telephones'][_0x44fd32[_0xf363('0x31')]]){if(this[_0xf363('0xa')][_0x44fd32[_0xf363('0x31')]]['state']!==_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]()){this[_0xf363('0xa')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x36')]=_[_0xf363('0x38')](moment()[_0xf363('0x2c')]('x'));}this[_0xf363('0xa')][_0x44fd32['device']][_0xf363('0x23')]=_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]();logger['debug'](_0xf363('0x39'),util[_0xf363('0x18')](this['telephones'][_0x44fd32['device']],{'showHidden':![],'depth':null}));this[_0xf363('0x20')](util[_0xf363('0x2c')](_0xf363('0x3a'),this[_0xf363('0xa')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x2e')]),_0xf363('0x3b'),this[_0xf363('0xa')][_0x44fd32[_0xf363('0x31')]]);}else if(this[_0xf363('0x8')][_0x44fd32[_0xf363('0x31')]]){if(this[_0xf363('0x8')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x23')]!==_0x44fd32['state']['toLowerCase']()){this[_0xf363('0x8')][_0x44fd32[_0xf363('0x31')]][_0xf363('0x36')]=_[_0xf363('0x38')](moment()[_0xf363('0x2c')]('x'));}this[_0xf363('0x8')][_0x44fd32['device']][_0xf363('0x23')]=_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]();logger[_0xf363('0x24')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0xf363('0x8')][_0x44fd32[_0xf363('0x31')]],{'showHidden':![],'depth':null}));this[_0xf363('0x20')](util[_0xf363('0x2c')](_0xf363('0x2d'),this[_0xf363('0x8')][_0x44fd32['device']][_0xf363('0x2e')]),_0xf363('0x2f'),this['trunks'][_0x44fd32[_0xf363('0x31')]]);}else if(_[_0xf363('0x3c')](_0x44fd32[_0xf363('0x31')],_0xf363('0x3d'))){var _0xf2a611=_0x44fd32['device'];var _0x31dfe8=_0xf2a611['substring'](_0xf2a611[_0xf363('0x3e')]('/')+0x1,_0xf2a611[_0xf363('0x3e')]('@'));var _0x155989=_[_0xf363('0x26')](this[_0xf363('0x9')],function(_0x3f63c0){return _0x3f63c0[_0xf363('0x3f')]==_0x31dfe8||_0x3f63c0[_0xf363('0x40')]==_0x31dfe8||_0x3f63c0['accountcode']==_0x31dfe8;});if(_0x155989){if(_0x155989[_0xf363('0x23')]!==_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]()){_0x155989[_0xf363('0x36')]=_['toNumber'](moment()[_0xf363('0x2c')]('x'));}_0x155989[_0xf363('0x23')]=_0x44fd32[_0xf363('0x23')][_0xf363('0x34')]();_0x155989[_0xf363('0x33')]=!![];_0x155989[_0xf363('0x37')](_0x44fd32);}}}}catch(_0x4de5eb){logger[_0xf363('0x16')](_0xf363('0x32'),util[_0xf363('0x18')](_0x4de5eb,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xf363('0x11')]=function(_0x1eacb7){try{if(this[_0xf363('0x1e')](_0x1eacb7)&&this['isNotNull'](_0x1eacb7[_0xf363('0x10')])){logger[_0xf363('0x21')](_0xf363('0x41'),_0x1eacb7[_0xf363('0x42')],_0x1eacb7[_0xf363('0x43')],_0x1eacb7[_0xf363('0x10')]);logger[_0xf363('0x24')]('[userReport][peerstatus]',util['inspect'](_0x1eacb7,{'showHidden':![],'depth':null}));if(this[_0xf363('0x9')][_0x1eacb7[_0xf363('0x42')]]){if(!this['agents'][_0x1eacb7[_0xf363('0x42')]]['local']||_0x1eacb7['peerstatus'][_0xf363('0x34')]()==_0xf363('0x44')){this['agents'][_0x1eacb7[_0xf363('0x42')]][_0xf363('0x33')]=![];this[_0xf363('0x9')][_0x1eacb7['peer']]['status']=_0x1eacb7[_0xf363('0x10')][_0xf363('0x34')]();this[_0xf363('0x9')][_0x1eacb7[_0xf363('0x42')]][_0xf363('0x43')]=_0x1eacb7['address'];this[_0xf363('0x9')][_0x1eacb7[_0xf363('0x42')]][_0xf363('0x37')](_0x1eacb7);}}else if(this['telephones'][_0x1eacb7['peer']]){this[_0xf363('0xa')][_0x1eacb7[_0xf363('0x42')]]['status']=_0x1eacb7['peerstatus'][_0xf363('0x34')]();this['telephones'][_0x1eacb7[_0xf363('0x42')]][_0xf363('0x43')]=_0x1eacb7[_0xf363('0x43')];logger[_0xf363('0x24')](_0xf363('0x45'),util['inspect'](this[_0xf363('0xa')][_0x1eacb7['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0xf363('0x2c')](_0xf363('0x3a'),this['telephones'][_0x1eacb7[_0xf363('0x42')]]['name']),_0xf363('0x3b'),this[_0xf363('0xa')][_0x1eacb7[_0xf363('0x42')]]);}else if(this[_0xf363('0x8')][_0x1eacb7['peer']]){this[_0xf363('0x8')][_0x1eacb7[_0xf363('0x42')]][_0xf363('0x46')]=_0x1eacb7['peerstatus'][_0xf363('0x34')]();this[_0xf363('0x8')][_0x1eacb7['peer']][_0xf363('0x43')]=_0x1eacb7[_0xf363('0x43')];logger[_0xf363('0x24')](_0xf363('0x47'),util['inspect'](this['trunks'][_0x1eacb7[_0xf363('0x42')]],{'showHidden':![],'depth':null}));this[_0xf363('0x20')](util[_0xf363('0x2c')](_0xf363('0x2d'),this[_0xf363('0x8')][_0x1eacb7['peer']]['name']),'trunk:save',this[_0xf363('0x8')][_0x1eacb7[_0xf363('0x42')]]);}}}catch(_0x5ed6df){logger[_0xf363('0x16')](_0xf363('0x48'),util[_0xf363('0x18')](_0x5ed6df,{'showHidden':![],'depth':null}));}};module[_0xf363('0x49')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 216d5a1..a42434b 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 _0xf8c4=['[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','bind','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','assign','omit','event','privilege','destuniqueid','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','info','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','interface','destconnectedlinenum','name','accountcode','exten','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','agentconnectAt','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','seconds','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]'];(function(_0x49ff11,_0xfadf3e){var _0x34eb5f=function(_0x118422){while(--_0x118422){_0x49ff11['push'](_0x49ff11['shift']());}};_0x34eb5f(++_0xfadf3e);}(_0xf8c4,0xa0));var _0x4f8c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf8c4[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x4f8c('0x0'));var Redis=require(_0x4f8c('0x1'));var config=require(_0x4f8c('0x2'));var logger=require(_0x4f8c('0x3'))(_0x4f8c('0x4'));var ami=require('../ami');config[_0x4f8c('0x5')]=_[_0x4f8c('0x6')](config['redis'],{'host':_0x4f8c('0x7'),'port':0x18eb});var io=require(_0x4f8c('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0x3ba3dd){this[_0x4f8c('0x9')]={};this['voiceChannels']=_0x3ba3dd[_0x4f8c('0x9')];this[_0x4f8c('0xa')]=_0x3ba3dd['voiceQueues'];this[_0x4f8c('0xb')]=_0x3ba3dd[_0x4f8c('0xb')];this[_0x4f8c('0xc')]={};ami['on'](_0x4f8c('0xd'),this[_0x4f8c('0xe')]['bind'](this));ami['on'](_0x4f8c('0xf'),this[_0x4f8c('0x10')]['bind'](this));ami['on'](_0x4f8c('0x11'),this[_0x4f8c('0x12')][_0x4f8c('0x13')](this));ami['on'](_0x4f8c('0x14'),this[_0x4f8c('0x15')][_0x4f8c('0x13')](this));ami['on'](_0x4f8c('0x16'),this[_0x4f8c('0x17')][_0x4f8c('0x13')](this));ami['on']('varset',this[_0x4f8c('0x18')][_0x4f8c('0x13')](this));ami['on'](_0x4f8c('0x19'),this['syncHangup']['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x4f8c('0x13')](this));ami['on'](_0x4f8c('0x1a'),this[_0x4f8c('0x1b')]['bind'](this));ami['on'](_0x4f8c('0x1c'),this[_0x4f8c('0x1d')][_0x4f8c('0x13')](this));ami['on'](_0x4f8c('0x1e'),this[_0x4f8c('0x1f')][_0x4f8c('0x13')](this));}VoiceAgentReport['prototype']['emit']=function(_0x1e3c63,_0x1fbdb8,_0x4d087b){io['to'](_0x1e3c63)[_0x4f8c('0x20')](_0x1fbdb8,_0x4d087b);};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x22')]=function(_0x2e351a){return _0x2e351a!==null&&!_[_0x4f8c('0x23')](_0x2e351a);};VoiceAgentReport['prototype'][_0x4f8c('0xe')]=function(_0x8cf66c){try{if(this[_0x4f8c('0x22')](_0x8cf66c)){logger['info'](_0x4f8c('0x24'),_0x8cf66c[_0x4f8c('0x25')],_0x8cf66c[_0x4f8c('0x26')],_0x8cf66c['destuniqueid']);logger[_0x4f8c('0x27')](_0x4f8c('0x28'),_0x8cf66c[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x8cf66c,{'showHidden':![],'depth':null}));if(_[_0x4f8c('0x23')](this['channels'][_0x8cf66c[_0x4f8c('0x25')]])){this[_0x4f8c('0x9')][_0x8cf66c[_0x4f8c('0x25')]]={};}var _0x31f7a1=this[_0x4f8c('0xb')][_0x8cf66c['interface']];var _0x5a7f80=this[_0x4f8c('0x9')][_0x8cf66c['uniqueid']][_0x8cf66c['destuniqueid']];var _0xb8f8d7=this[_0x4f8c('0xa')][_0x8cf66c[_0x4f8c('0x2a')]];var _0xc195cf=this[_0x4f8c('0xc')][_0x8cf66c['uniqueid']];if(_[_0x4f8c('0x23')](_0x5a7f80)){_0x5a7f80={'agentcalledAt':moment()[_0x4f8c('0x2b')](_0x4f8c('0x2c')),'lastevent':_0x4f8c('0x2d'),'mandatoryDisposition':_0xb8f8d7&&_0xb8f8d7[_0x4f8c('0x2e')]?_0xb8f8d7[_0x4f8c('0x2e')]:![],'type':_0xb8f8d7&&_0xb8f8d7[_0x4f8c('0x2f')]?_0xb8f8d7[_0x4f8c('0x2f')]:'inbound','variables':_0xc195cf,'motionChannel':'voice'};}Object[_0x4f8c('0x30')](_0x5a7f80,_[_0x4f8c('0x31')](_0x8cf66c,[_0x4f8c('0x32'),_0x4f8c('0x33')]));this[_0x4f8c('0x9')][_0x8cf66c[_0x4f8c('0x25')]][_0x8cf66c[_0x4f8c('0x34')]]=_0x5a7f80;logger[_0x4f8c('0x27')](_0x4f8c('0x35'),_0x8cf66c[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x5a7f80,{'showHidden':![],'depth':null}));ami[_0x4f8c('0x20')](_0x4f8c('0x36'),_0x5a7f80);var _0x293971={'id':_0x31f7a1['id'],'calleridnum':_0x5a7f80['calleridnum'],'queue':_0x5a7f80['queue'],'variables':_0x5a7f80[_0x4f8c('0xc')],'uniqueid':_0x8cf66c[_0x4f8c('0x25')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x8cf66c[_0x4f8c('0x25')],util['inspect'](_0x293971,{'showHidden':![],'depth':null}));this[_0x4f8c('0x20')](util['format'](_0x4f8c('0x37'),_0x8cf66c[_0x4f8c('0x26')]),_0x4f8c('0x38'),_0x293971);}}catch(_0x56c62f){logger[_0x4f8c('0x39')](_0x4f8c('0x3a'),_0x8cf66c[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x56c62f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x10')]=function(_0x409089){try{if(this[_0x4f8c('0x22')](_0x409089)){if(this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]]){for(var _0x516841 in this['channels'][_0x409089[_0x4f8c('0x25')]]){if(this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]]['hasOwnProperty'](_0x516841)){if(_0x409089[_0x4f8c('0x34')]===_0x516841){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x409089[_0x4f8c('0x25')],_0x409089[_0x4f8c('0x26')],_0x409089[_0x4f8c('0x34')]);this['channels'][_0x409089['uniqueid']][_0x516841]['agentconnectAt']=moment()[_0x4f8c('0x2b')](_0x4f8c('0x2c'));this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841]['connectedlinename']=_0x409089['connectedlinename'];this[_0x4f8c('0x9')][_0x409089['uniqueid']][_0x516841][_0x4f8c('0x3c')]=_0x409089[_0x4f8c('0x3c')];this['channels'][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x3d')]=_0x409089['destchannelstate'];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x3e')]=_0x409089[_0x4f8c('0x3e')];this[_0x4f8c('0x9')][_0x409089['uniqueid']][_0x516841][_0x4f8c('0x3f')]=_0x409089[_0x4f8c('0x3f')];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841]['lastevent']=_0x4f8c('0x40');if(this[_0x4f8c('0x41')][this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841]['uniqueid']]){var _0x21d3a3=this[_0x4f8c('0x41')][this['channels'][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x25')]][_0x4f8c('0x42')];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x42')]=_0x21d3a3;_0x409089[_0x4f8c('0x42')]=_0x21d3a3;}_[_0x4f8c('0x43')](this[_0x4f8c('0xb')][_0x409089[_0x4f8c('0x44')]],_['pick'](_0x409089,[_0x4f8c('0x2a'),_0x4f8c('0x45'),_0x4f8c('0x42')]));var _0xc88372=this[_0x4f8c('0xb')][_0x409089['interface']];var _0xf64710={'id':_0xc88372['id'],'name':_0xc88372[_0x4f8c('0x46')],'agentconnected':!![],'destaccountcode':_0xc88372[_0x4f8c('0x47')],'destconnectedlinenum':this['channels'][_0x409089[_0x4f8c('0x25')]][_0x409089[_0x4f8c('0x34')]][_0x4f8c('0x48')],'queue':this['channels'][_0x409089[_0x4f8c('0x25')]][_0x409089[_0x4f8c('0x34')]]['queue'],'routealias':this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x409089[_0x4f8c('0x34')]][_0x4f8c('0x42')],'uniqueid':this['channels'][_0x409089[_0x4f8c('0x25')]][_0x409089[_0x4f8c('0x34')]]['uniqueid']};ami['emit']('custom:agentconnect',this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x409089[_0x4f8c('0x34')]]);this[_0x4f8c('0x20')](util[_0x4f8c('0x2b')]('user:%s',_0x409089[_0x4f8c('0x26')]),_0x4f8c('0x49'),_0xf64710);}else if(!this['channels'][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x11')]&&!this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x16')]){logger['info'](_0x4f8c('0x4a'),_0x409089[_0x4f8c('0x25')],this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x26')],_0x516841);this['channels'][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x11')]=!![];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x4b')]=moment()['format'](_0x4f8c('0x2c'));this[_0x4f8c('0x9')][_0x409089['uniqueid']][_0x516841][_0x4f8c('0x4c')]=_0x409089[_0x4f8c('0x34')];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841]['answeredelsewheremembername']=_0x409089[_0x4f8c('0x26')];this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841][_0x4f8c('0x4d')]=_0x4f8c('0x4e');this['channels'][_0x409089['uniqueid']][_0x516841]['reason']='answered_elsewhere';logger[_0x4f8c('0x27')](_0x4f8c('0x4f'),_0x409089[_0x4f8c('0x25')],util[_0x4f8c('0x29')](this['channels'][_0x409089[_0x4f8c('0x25')]][_0x516841],{'showHidden':![],'depth':null}));ami[_0x4f8c('0x20')](_0x4f8c('0x50'),this[_0x4f8c('0x9')][_0x409089[_0x4f8c('0x25')]][_0x516841]);}else{logger['debug']('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0x409089[_0x4f8c('0x25')]);}}}}}}catch(_0x374c14){logger[_0x4f8c('0x39')](_0x4f8c('0x51'),_0x409089['uniqueid'],util[_0x4f8c('0x29')](_0x374c14,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4f8c('0x12')]=function(_0x8138cd){try{if(this['isNotNull'](_0x8138cd)){logger[_0x4f8c('0x27')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x8138cd[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x8138cd,{'showHidden':![],'depth':null}));if(this[_0x4f8c('0x9')][_0x8138cd[_0x4f8c('0x25')]]&&this['channels'][_0x8138cd[_0x4f8c('0x25')]][_0x8138cd[_0x4f8c('0x34')]]){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x8138cd[_0x4f8c('0x25')],_0x8138cd[_0x4f8c('0x26')],_0x8138cd[_0x4f8c('0x34')]);var _0x546eb6=this[_0x4f8c('0xb')][_0x8138cd[_0x4f8c('0x44')]];var _0x2d800b=this['channels'][_0x8138cd[_0x4f8c('0x25')]][_0x8138cd[_0x4f8c('0x34')]];_0x2d800b[_0x4f8c('0x11')]=!![];_0x2d800b[_0x4f8c('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d800b['lastevent']=_0x4f8c('0x52');_0x2d800b[_0x4f8c('0x53')]=_0x4f8c('0x52');var _0x2322e7={'id':_0x546eb6['id'],'name':_0x546eb6['name'],'queue':_0x2d800b[_0x4f8c('0x2a')],'uniqueid':_0x2d800b['uniqueid']};logger[_0x4f8c('0x27')](_0x4f8c('0x54'),_0x8138cd[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x2322e7,{'showHidden':![],'depth':null}));this[_0x4f8c('0x20')](util[_0x4f8c('0x2b')](_0x4f8c('0x37'),_0x546eb6['name']),'user:agentringnoanswer',_0x2322e7);ami[_0x4f8c('0x20')](_0x4f8c('0x55'),_0x2d800b);this[_0x4f8c('0x9')][_0x8138cd[_0x4f8c('0x25')]][_0x8138cd[_0x4f8c('0x34')]]=Object[_0x4f8c('0x30')]({},_0x2d800b);}}}catch(_0x3822b3){logger[_0x4f8c('0x39')](_0x4f8c('0x56'),_0x8138cd[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x3822b3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x15')]=function(_0x2a8a00){try{if(this[_0x4f8c('0x22')](_0x2a8a00)){logger[_0x4f8c('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x2a8a00[_0x4f8c('0x25')],util['inspect'](_0x2a8a00,{'showHidden':![],'depth':null}));if(this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]]){for(var _0xa6d688 in this[_0x4f8c('0x9')][_0x2a8a00['uniqueid']]){if(this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]][_0x4f8c('0x57')](_0xa6d688)&&!this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688][_0x4f8c('0x11')]&&!this['channels'][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688][_0x4f8c('0x16')]){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2a8a00[_0x4f8c('0x25')],this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688]['membername'],_0xa6d688);this['channels'][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688][_0x4f8c('0x11')]=!![];this['channels'][_0x2a8a00['uniqueid']][_0xa6d688][_0x4f8c('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688][_0x4f8c('0x4d')]='abandoned';this[_0x4f8c('0x9')][_0x2a8a00['uniqueid']][_0xa6d688][_0x4f8c('0x53')]=_0x4f8c('0x58');logger[_0x4f8c('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x2a8a00['uniqueid'],util[_0x4f8c('0x29')](this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688],{'showHidden':![],'depth':null}));ami[_0x4f8c('0x20')](_0x4f8c('0x59'),this[_0x4f8c('0x9')][_0x2a8a00[_0x4f8c('0x25')]][_0xa6d688]);}}}}}catch(_0x353a51){logger[_0x4f8c('0x39')]('[%s][voiceAgentReport][queuecallerabandon]',_0x2a8a00[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x353a51,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x17')]=function(_0x32c418){try{if(this[_0x4f8c('0x22')](_0x32c418)){logger[_0x4f8c('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x32c418[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x32c418,{'showHidden':![],'depth':null}));if(this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]]){for(var _0x35957a in this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]]){if(this[_0x4f8c('0x9')][_0x32c418['uniqueid']][_0x4f8c('0x57')](_0x35957a)){if(this['channels'][_0x32c418[_0x4f8c('0x25')]][_0x35957a]['agentconnectAt']&&!this['channels'][_0x32c418[_0x4f8c('0x25')]][_0x35957a][_0x4f8c('0x16')]){logger[_0x4f8c('0x3b')](_0x4f8c('0x5a'),_0x32c418[_0x4f8c('0x25')],this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]][_0x35957a][_0x4f8c('0x26')],_0x35957a);this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]][_0x35957a]['agentcomplete']=!![];this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]][_0x35957a]['agentcompleteAt']=moment()[_0x4f8c('0x2b')](_0x4f8c('0x2c'));this[_0x4f8c('0x9')][_0x32c418['uniqueid']][_0x35957a][_0x4f8c('0x4d')]=_0x4f8c('0x5b');this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]][_0x35957a][_0x4f8c('0x53')]=_0x32c418[_0x4f8c('0x53')]==_0x4f8c('0x5c')?_0x4f8c('0x5d'):_0x32c418[_0x4f8c('0x53')];this[_0x4f8c('0x9')][_0x32c418['uniqueid']][_0x35957a][_0x4f8c('0x5e')]=_0x32c418['talktime'];if(this[_0x4f8c('0xa')][_0x32c418[_0x4f8c('0x2a')]]&&this[_0x4f8c('0xa')][_0x32c418['queue']][_0x4f8c('0x5f')]){this['channels'][_0x32c418[_0x4f8c('0x25')]][_0x35957a][_0x4f8c('0x60')]=this[_0x4f8c('0xa')][_0x32c418[_0x4f8c('0x2a')]][_0x4f8c('0x61')];this[_0x4f8c('0x9')][_0x32c418[_0x4f8c('0x25')]][_0x35957a][_0x4f8c('0x62')]=!![];}this[_0x4f8c('0xb')][_0x32c418[_0x4f8c('0x44')]]=_[_0x4f8c('0x31')](this['agents'][_0x32c418[_0x4f8c('0x44')]],['queue',_0x4f8c('0x45')]);logger[_0x4f8c('0x27')](_0x4f8c('0x63'),_0x32c418[_0x4f8c('0x25')],util[_0x4f8c('0x29')](this[_0x4f8c('0x9')][_0x32c418['uniqueid']][_0x35957a],{'showHidden':![],'depth':null}));ami[_0x4f8c('0x20')](_0x4f8c('0x64'),this[_0x4f8c('0x9')][_0x32c418['uniqueid']][_0x35957a]);logger[_0x4f8c('0x27')](_0x4f8c('0x65'),_0x32c418[_0x4f8c('0x25')],util['inspect']({'id':this[_0x4f8c('0xb')][_0x32c418['interface']]['id'],'destaccountcode':_0x32c418[_0x4f8c('0x66')]},{'showHidden':![],'depth':null}));this[_0x4f8c('0x20')](util[_0x4f8c('0x2b')](_0x4f8c('0x37'),_0x32c418['membername']),_0x4f8c('0x67'),{'id':this['agents'][_0x32c418[_0x4f8c('0x44')]]['id'],'destaccountcode':Number(_0x32c418[_0x4f8c('0x66')])});}}}}}}catch(_0xc9e5a6){logger[_0x4f8c('0x39')](_0x4f8c('0x68'),_0x32c418[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0xc9e5a6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x18')]=function(_0x131a6d){try{if(this[_0x4f8c('0x22')](_0x131a6d)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0x131a6d['uniqueid'],util['inspect'](_0x131a6d,{'showHidden':![],'depth':null}));this[_0x4f8c('0x69')](_0x131a6d[_0x4f8c('0x25')],_[_0x4f8c('0x6a')](_0x131a6d[_0x4f8c('0x6b')])[0x0],_0x131a6d[_0x4f8c('0x6c')]);if(this[_0x4f8c('0x9')][_0x131a6d[_0x4f8c('0x25')]]){for(var _0xc6f508 in this[_0x4f8c('0x9')][_0x131a6d[_0x4f8c('0x25')]]){if(this[_0x4f8c('0x9')][_0x131a6d[_0x4f8c('0x25')]][_0x4f8c('0x57')](_0xc6f508)){logger[_0x4f8c('0x3b')](_0x4f8c('0x6d'),_0x131a6d[_0x4f8c('0x25')],_0xc6f508,_['keys'](_0x131a6d[_0x4f8c('0x6b')])[0x0],_0x131a6d['value']);if(_[_0x4f8c('0x23')](this['channels'][_0x131a6d['uniqueid']][_0xc6f508][_0x4f8c('0xc')])){this['channels'][_0x131a6d[_0x4f8c('0x25')]][_0xc6f508][_0x4f8c('0xc')]={};}this[_0x4f8c('0x9')][_0x131a6d[_0x4f8c('0x25')]][_0xc6f508][_0x4f8c('0xc')]=this['variables'][_0x131a6d[_0x4f8c('0x25')]];}}}}}catch(_0x698cf2){logger['error']('[%s][voiceAgentReport][varset]',_0x131a6d[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x698cf2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')]['addVariable']=function(_0x2315ff,_0x33eed2,_0x2b6edd){var _0x424bdf=['rtpaudioqos',_0x4f8c('0x6e'),_0x4f8c('0x6f'),'rtpaudioqosjitterbridged',_0x4f8c('0x70'),_0x4f8c('0x71'),_0x4f8c('0x72'),_0x4f8c('0x73'),_0x4f8c('0x74'),_0x4f8c('0x75'),_0x4f8c('0x76'),_0x4f8c('0x77'),_0x4f8c('0x78'),_0x4f8c('0x79'),_0x4f8c('0x7a'),_0x4f8c('0x7b'),_0x4f8c('0x26'),_0x4f8c('0x7c'),_0x4f8c('0x7d')];if(!_[_0x4f8c('0x7e')](_0x33eed2)&&!_['includes'](_0x424bdf,_0x33eed2)){if(_[_0x4f8c('0x23')](this[_0x4f8c('0xc')][_0x2315ff])){this['variables'][_0x2315ff]={};}this[_0x4f8c('0xc')][_0x2315ff][_0x33eed2]=_0x2b6edd;}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x7f')]=function(_0x50a277){try{if(this[_0x4f8c('0x22')](_0x50a277)){logger[_0x4f8c('0x27')](_0x4f8c('0x80'),_0x50a277[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x50a277,{'showHidden':![],'depth':null}));if(this[_0x4f8c('0x9')][_0x50a277['uniqueid']]){for(var _0x5c17f1 in this[_0x4f8c('0x9')][_0x50a277[_0x4f8c('0x25')]]){if(this[_0x4f8c('0x9')][_0x50a277[_0x4f8c('0x25')]]['hasOwnProperty'](_0x5c17f1)){if(this[_0x4f8c('0x9')][_0x50a277[_0x4f8c('0x25')]][_0x5c17f1][_0x4f8c('0x53')]==_0x4f8c('0x5c')&&this['channels'][_0x50a277['uniqueid']][_0x5c17f1][_0x4f8c('0x16')]){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x50a277[_0x4f8c('0x25')],_0x5c17f1);this['channels'][_0x50a277[_0x4f8c('0x25')]][_0x5c17f1][_0x4f8c('0x81')]=moment()['format'](_0x4f8c('0x2c'));}}}logger[_0x4f8c('0x27')](_0x4f8c('0x82'),_0x50a277[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_[_0x4f8c('0x83')](this[_0x4f8c('0x9')][_0x50a277['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x4f8c('0x20')](_0x4f8c('0x84'),_['values'](this[_0x4f8c('0x9')][_0x50a277['uniqueid']]));delete this[_0x4f8c('0x9')][_0x50a277[_0x4f8c('0x25')]];}if(this[_0x4f8c('0xc')][_0x50a277['uniqueid']]){delete this[_0x4f8c('0xc')][_0x50a277[_0x4f8c('0x25')]];}}}catch(_0x4d2e89){logger[_0x4f8c('0x39')](_0x4f8c('0x85'),_0x50a277['uniqueid'],util[_0x4f8c('0x29')](_0x4d2e89,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x1d')]=function(_0x5d8bb0){try{if(this[_0x4f8c('0x22')](_0x5d8bb0)){logger[_0x4f8c('0x27')](_0x4f8c('0x86'),_0x5d8bb0[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x5d8bb0,{'showHidden':![],'depth':null}));if(this['channels'][_0x5d8bb0[_0x4f8c('0x87')]]){for(var _0x307095 in this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]]){if(this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x4f8c('0x57')](_0x307095)){if(_0x5d8bb0[_0x4f8c('0x88')]===_0x307095){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5d8bb0['uniqueid'],this[_0x4f8c('0x9')][_0x5d8bb0['transfereeuniqueid']][_0x307095][_0x4f8c('0x26')],_0x307095);var _0x3662c0=moment();this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x16')]=!![];this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x81')]=moment()[_0x4f8c('0x2b')](_0x4f8c('0x2c'));this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x4d')]=_0x4f8c('0x5b');this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x53')]=_0x4f8c('0x5c');this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x5e')]=_0x3662c0[_0x4f8c('0x89')](this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]][_0x307095][_0x4f8c('0x8a')],'seconds');}}}}if(this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x8b')]]){var _0x1e1952=this[_0x4f8c('0x9')][_0x5d8bb0['secondtransfereruniqueid']];this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x8b')]]=this[_0x4f8c('0x9')][_0x5d8bb0['transfereeuniqueid']];this[_0x4f8c('0x9')][_0x5d8bb0[_0x4f8c('0x87')]]=_0x1e1952;}}}catch(_0x597fb7){logger[_0x4f8c('0x39')](_0x4f8c('0x8c'),_0x5d8bb0[_0x4f8c('0x25')],util['inspect'](_0x597fb7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x1f')]=function(_0x4fad7c){try{if(this[_0x4f8c('0x22')](_0x4fad7c)){logger[_0x4f8c('0x27')](_0x4f8c('0x8d'),_0x4fad7c[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x4fad7c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4fad7c[_0x4f8c('0x87')]]){for(var _0x532aaf in this['channels'][_0x4fad7c[_0x4f8c('0x87')]]){if(this[_0x4f8c('0x9')][_0x4fad7c[_0x4f8c('0x87')]][_0x4f8c('0x57')](_0x532aaf)){if(_0x4fad7c[_0x4f8c('0x8e')]===_0x532aaf){logger[_0x4f8c('0x3b')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4fad7c[_0x4f8c('0x25')],this[_0x4f8c('0x9')][_0x4fad7c[_0x4f8c('0x87')]][_0x532aaf][_0x4f8c('0x26')],_0x532aaf);var _0x58cdf1=moment();this[_0x4f8c('0x9')][_0x4fad7c[_0x4f8c('0x87')]][_0x532aaf]['agentcomplete']=!![];this[_0x4f8c('0x9')][_0x4fad7c[_0x4f8c('0x87')]][_0x532aaf][_0x4f8c('0x81')]=_0x58cdf1;this['channels'][_0x4fad7c[_0x4f8c('0x87')]][_0x532aaf][_0x4f8c('0x4d')]=_0x4f8c('0x5b');this[_0x4f8c('0x9')][_0x4fad7c['transfereeuniqueid']][_0x532aaf]['reason']=_0x4f8c('0x5c');this['channels'][_0x4fad7c[_0x4f8c('0x87')]][_0x532aaf][_0x4f8c('0x5e')]=_0x58cdf1[_0x4f8c('0x89')](this[_0x4f8c('0x9')][_0x4fad7c['transfereeuniqueid']][_0x532aaf][_0x4f8c('0x8a')],_0x4f8c('0x8f'));}}}}}}catch(_0x3dabfb){logger[_0x4f8c('0x39')]('[%s][voiceAgentReport][blindtransfer]',_0x4fad7c[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x3dabfb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')][_0x4f8c('0x90')]=function(_0x2690fa){var _0x2747dc='';try{if(this[_0x4f8c('0x22')](_0x2690fa)){logger[_0x4f8c('0x27')](_0x4f8c('0x91'),_0x2690fa[_0x4f8c('0x25')],util['inspect'](_0x2690fa,{'showHidden':![],'depth':null}));if(_0x2690fa[_0x4f8c('0x92')]){_0x2747dc=_0x2690fa[_0x4f8c('0x92')]['substring'](0x0,_0x2690fa[_0x4f8c('0x92')][_0x4f8c('0x93')]('-'));if(this['agents'][_0x2747dc]){logger[_0x4f8c('0x3b')](_0x4f8c('0x94'),_0x2690fa[_0x4f8c('0x25')],_0x2747dc);this[_0x4f8c('0xb')][_0x2747dc]['onhold']=!![];}}}}catch(_0x3847c6){logger[_0x4f8c('0x39')](_0x4f8c('0x95'),_0x2690fa[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x3847c6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4f8c('0x21')]['syncMusicOnHoldStop']=function(_0x4ebeb4){var _0x534acf='';try{if(this[_0x4f8c('0x22')](_0x4ebeb4)){logger[_0x4f8c('0x27')](_0x4f8c('0x96'),_0x4ebeb4[_0x4f8c('0x25')],util['inspect'](_0x4ebeb4,{'showHidden':![],'depth':null}));if(_0x4ebeb4[_0x4f8c('0x92')]){_0x534acf=_0x4ebeb4['channel'][_0x4f8c('0x97')](0x0,_0x4ebeb4[_0x4f8c('0x92')][_0x4f8c('0x93')]('-'));if(this[_0x4f8c('0xb')][_0x534acf]){logger[_0x4f8c('0x3b')](_0x4f8c('0x98'),_0x4ebeb4[_0x4f8c('0x25')],_0x534acf);this[_0x4f8c('0xb')][_0x534acf]['onhold']=![];}}}}catch(_0x475acf){logger['error'](_0x4f8c('0x99'),_0x4ebeb4[_0x4f8c('0x25')],util[_0x4f8c('0x29')](_0x475acf,{'showHidden':![],'depth':null}));}};module[_0x4f8c('0x9a')]=VoiceAgentReport; \ No newline at end of file +var _0x8c18=['agentringnoanswer','syncAgentRingNoAnswer','bind','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','syncAgentCalled','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','queue','YYYY-MM-DD\x20HH:mm:ss','mandatoryDisposition','type','inbound','voice','assign','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','holdtime','lastevent','voiceChannels','routealias','merge','pick','destconnectedlinenum','name','accountcode','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','seconds','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','lodash','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentconnect'];(function(_0x4eb24c,_0x315ace){var _0x23573c=function(_0x3fc08e){while(--_0x3fc08e){_0x4eb24c['push'](_0x4eb24c['shift']());}};_0x23573c(++_0x315ace);}(_0x8c18,0x8f));var _0x88c1=function(_0x39141c,_0x104942){_0x39141c=_0x39141c-0x0;var _0x95b832=_0x8c18[_0x39141c];return _0x95b832;};'use strict';var _=require(_0x88c1('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x88c1('0x1'))(_0x88c1('0x2'));var ami=require(_0x88c1('0x3'));config[_0x88c1('0x4')]=_[_0x88c1('0x5')](config[_0x88c1('0x4')],{'host':_0x88c1('0x6'),'port':0x18eb});var io=require(_0x88c1('0x7'))(new Redis(config[_0x88c1('0x4')]));function VoiceAgentReport(_0x449af7){this[_0x88c1('0x8')]={};this['voiceChannels']=_0x449af7[_0x88c1('0x8')];this[_0x88c1('0x9')]=_0x449af7['voiceQueues'];this[_0x88c1('0xa')]=_0x449af7[_0x88c1('0xa')];this[_0x88c1('0xb')]={};ami['on']('agentcalled',this['syncAgentCalled']['bind'](this));ami['on'](_0x88c1('0xc'),this['syncAgentConnect']['bind'](this));ami['on'](_0x88c1('0xd'),this[_0x88c1('0xe')][_0x88c1('0xf')](this));ami['on']('queuecallerabandon',this[_0x88c1('0x10')][_0x88c1('0xf')](this));ami['on'](_0x88c1('0x11'),this['syncAgentComplete'][_0x88c1('0xf')](this));ami['on'](_0x88c1('0x12'),this[_0x88c1('0x13')]['bind'](this));ami['on'](_0x88c1('0x14'),this[_0x88c1('0x15')][_0x88c1('0xf')](this));ami['on'](_0x88c1('0x16'),this[_0x88c1('0x17')][_0x88c1('0xf')](this));ami['on']('musiconholdstop',this[_0x88c1('0x18')][_0x88c1('0xf')](this));ami['on'](_0x88c1('0x19'),this[_0x88c1('0x1a')]['bind'](this));ami['on'](_0x88c1('0x1b'),this['syncBlindTransfer'][_0x88c1('0xf')](this));}VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x1d')]=function(_0x554557,_0xd0628c,_0x3ca3bb){io['to'](_0x554557)[_0x88c1('0x1d')](_0xd0628c,_0x3ca3bb);};VoiceAgentReport['prototype'][_0x88c1('0x1e')]=function(_0x2e2053){return _0x2e2053!==null&&!_['isUndefined'](_0x2e2053);};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x1f')]=function(_0x3c4728){try{if(this[_0x88c1('0x1e')](_0x3c4728)){logger['info'](_0x88c1('0x20'),_0x3c4728[_0x88c1('0x21')],_0x3c4728[_0x88c1('0x22')],_0x3c4728[_0x88c1('0x23')]);logger[_0x88c1('0x24')](_0x88c1('0x25'),_0x3c4728[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x3c4728,{'showHidden':![],'depth':null}));if(_[_0x88c1('0x27')](this['channels'][_0x3c4728[_0x88c1('0x21')]])){this[_0x88c1('0x8')][_0x3c4728[_0x88c1('0x21')]]={};}var _0x42497a=this['agents'][_0x3c4728['interface']];var _0x5ee4e5=this[_0x88c1('0x8')][_0x3c4728['uniqueid']][_0x3c4728[_0x88c1('0x23')]];var _0x4e7d56=this[_0x88c1('0x9')][_0x3c4728[_0x88c1('0x28')]];var _0xf3c48c=this[_0x88c1('0xb')][_0x3c4728['uniqueid']];if(_['isUndefined'](_0x5ee4e5)){_0x5ee4e5={'agentcalledAt':moment()['format'](_0x88c1('0x29')),'lastevent':'called','mandatoryDisposition':_0x4e7d56&&_0x4e7d56['mandatoryDisposition']?_0x4e7d56[_0x88c1('0x2a')]:![],'type':_0x4e7d56&&_0x4e7d56[_0x88c1('0x2b')]?_0x4e7d56['type']:_0x88c1('0x2c'),'variables':_0xf3c48c,'motionChannel':_0x88c1('0x2d')};}Object[_0x88c1('0x2e')](_0x5ee4e5,_[_0x88c1('0x2f')](_0x3c4728,[_0x88c1('0x30'),'privilege']));this['channels'][_0x3c4728[_0x88c1('0x21')]][_0x3c4728['destuniqueid']]=_0x5ee4e5;logger[_0x88c1('0x24')](_0x88c1('0x31'),_0x3c4728['uniqueid'],util[_0x88c1('0x26')](_0x5ee4e5,{'showHidden':![],'depth':null}));ami[_0x88c1('0x1d')](_0x88c1('0x32'),_0x5ee4e5);var _0x3574a7={'id':_0x42497a['id'],'calleridnum':_0x5ee4e5[_0x88c1('0x33')],'queue':_0x5ee4e5[_0x88c1('0x28')],'variables':_0x5ee4e5['variables'],'uniqueid':_0x3c4728['uniqueid']};logger[_0x88c1('0x24')](_0x88c1('0x34'),_0x3c4728[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x3574a7,{'showHidden':![],'depth':null}));this[_0x88c1('0x1d')](util[_0x88c1('0x35')](_0x88c1('0x36'),_0x3c4728[_0x88c1('0x22')]),_0x88c1('0x37'),_0x3574a7);}}catch(_0x490c8d){logger[_0x88c1('0x38')](_0x88c1('0x39'),_0x3c4728[_0x88c1('0x21')],util['inspect'](_0x490c8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x88c1('0x3a')]=function(_0x3ec78c){try{if(this['isNotNull'](_0x3ec78c)){if(this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]]){for(var _0x48ae4f in this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]]){if(this['channels'][_0x3ec78c[_0x88c1('0x21')]][_0x88c1('0x3b')](_0x48ae4f)){if(_0x3ec78c['destuniqueid']===_0x48ae4f){logger[_0x88c1('0x3c')](_0x88c1('0x3d'),_0x3ec78c['uniqueid'],_0x3ec78c[_0x88c1('0x22')],_0x3ec78c[_0x88c1('0x23')]);this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x3e')]=moment()[_0x88c1('0x35')](_0x88c1('0x29'));this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['connectedlinename']=_0x3ec78c[_0x88c1('0x3f')];this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x40')]=_0x3ec78c[_0x88c1('0x40')];this[_0x88c1('0x8')][_0x3ec78c['uniqueid']][_0x48ae4f][_0x88c1('0x41')]=_0x3ec78c['destchannelstate'];this['channels'][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['destchannelstatedesc']=_0x3ec78c['destchannelstatedesc'];this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['holdtime']=_0x3ec78c[_0x88c1('0x42')];this['channels'][_0x3ec78c['uniqueid']][_0x48ae4f][_0x88c1('0x43')]='connect';if(this[_0x88c1('0x44')][this['channels'][_0x3ec78c['uniqueid']][_0x48ae4f]['uniqueid']]){var _0x3ba3bb=this['voiceChannels'][this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['uniqueid']][_0x88c1('0x45')];this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x45')]=_0x3ba3bb;_0x3ec78c['routealias']=_0x3ba3bb;}_[_0x88c1('0x46')](this['agents'][_0x3ec78c['interface']],_[_0x88c1('0x47')](_0x3ec78c,['queue',_0x88c1('0x48'),_0x88c1('0x45')]));var _0x92340=this[_0x88c1('0xa')][_0x3ec78c['interface']];var _0x5b6e93={'id':_0x92340['id'],'name':_0x92340[_0x88c1('0x49')],'agentconnected':!![],'destaccountcode':_0x92340[_0x88c1('0x4a')],'destconnectedlinenum':this['channels'][_0x3ec78c[_0x88c1('0x21')]][_0x3ec78c[_0x88c1('0x23')]]['exten'],'queue':this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x3ec78c[_0x88c1('0x23')]]['queue'],'routealias':this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x3ec78c[_0x88c1('0x23')]]['routealias'],'uniqueid':this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x3ec78c[_0x88c1('0x23')]][_0x88c1('0x21')]};ami[_0x88c1('0x1d')](_0x88c1('0x4b'),this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x3ec78c['destuniqueid']]);this['emit'](util[_0x88c1('0x35')](_0x88c1('0x36'),_0x3ec78c['membername']),'user:agentconnect',_0x5b6e93);}else if(!this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0xd')]&&!this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x11')]){logger[_0x88c1('0x3c')](_0x88c1('0x4c'),_0x3ec78c[_0x88c1('0x21')],this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['membername'],_0x48ae4f);this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0xd')]=!![];this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x4d')]=moment()[_0x88c1('0x35')](_0x88c1('0x29'));this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f][_0x88c1('0x4e')]=_0x3ec78c[_0x88c1('0x23')];this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['answeredelsewheremembername']=_0x3ec78c[_0x88c1('0x22')];this['channels'][_0x3ec78c['uniqueid']][_0x48ae4f][_0x88c1('0x43')]='answered_elsewhere';this['channels'][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f]['reason']='answered_elsewhere';logger['debug'](_0x88c1('0x4f'),_0x3ec78c[_0x88c1('0x21')],util[_0x88c1('0x26')](this[_0x88c1('0x8')][_0x3ec78c[_0x88c1('0x21')]][_0x48ae4f],{'showHidden':![],'depth':null}));ami[_0x88c1('0x1d')](_0x88c1('0x50'),this[_0x88c1('0x8')][_0x3ec78c['uniqueid']][_0x48ae4f]);}else{logger['debug'](_0x88c1('0x51'),_0x3ec78c[_0x88c1('0x21')]);}}}}}}catch(_0x3a02e0){logger[_0x88c1('0x38')](_0x88c1('0x52'),_0x3ec78c[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x3a02e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0xe')]=function(_0x4fc720){try{if(this[_0x88c1('0x1e')](_0x4fc720)){logger[_0x88c1('0x24')](_0x88c1('0x53'),_0x4fc720[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x4fc720,{'showHidden':![],'depth':null}));if(this['channels'][_0x4fc720[_0x88c1('0x21')]]&&this[_0x88c1('0x8')][_0x4fc720[_0x88c1('0x21')]][_0x4fc720[_0x88c1('0x23')]]){logger[_0x88c1('0x3c')](_0x88c1('0x54'),_0x4fc720['uniqueid'],_0x4fc720[_0x88c1('0x22')],_0x4fc720[_0x88c1('0x23')]);var _0x57706f=this[_0x88c1('0xa')][_0x4fc720['interface']];var _0x5749b9=this[_0x88c1('0x8')][_0x4fc720[_0x88c1('0x21')]][_0x4fc720[_0x88c1('0x23')]];_0x5749b9[_0x88c1('0xd')]=!![];_0x5749b9[_0x88c1('0x4d')]=moment()[_0x88c1('0x35')](_0x88c1('0x29'));_0x5749b9[_0x88c1('0x43')]='rejected';_0x5749b9['reason']='rejected';var _0x3736fe={'id':_0x57706f['id'],'name':_0x57706f[_0x88c1('0x49')],'queue':_0x5749b9[_0x88c1('0x28')],'uniqueid':_0x5749b9[_0x88c1('0x21')]};logger[_0x88c1('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4fc720['uniqueid'],util[_0x88c1('0x26')](_0x3736fe,{'showHidden':![],'depth':null}));this['emit'](util[_0x88c1('0x35')](_0x88c1('0x36'),_0x57706f['name']),_0x88c1('0x55'),_0x3736fe);ami['emit'](_0x88c1('0x56'),_0x5749b9);this['channels'][_0x4fc720[_0x88c1('0x21')]][_0x4fc720[_0x88c1('0x23')]]=Object[_0x88c1('0x2e')]({},_0x5749b9);}}}catch(_0x1310d5){logger['error'](_0x88c1('0x57'),_0x4fc720['uniqueid'],util[_0x88c1('0x26')](_0x1310d5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')]['syncQueueCallerAbandon']=function(_0x48c354){try{if(this[_0x88c1('0x1e')](_0x48c354)){logger[_0x88c1('0x24')](_0x88c1('0x58'),_0x48c354['uniqueid'],util[_0x88c1('0x26')](_0x48c354,{'showHidden':![],'depth':null}));if(this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]]){for(var _0x4da1b0 in this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]]){if(this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x88c1('0x3b')](_0x4da1b0)&&!this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0xd')]&&!this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0x11')]){logger[_0x88c1('0x3c')](_0x88c1('0x59'),_0x48c354[_0x88c1('0x21')],this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0]['membername'],_0x4da1b0);this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0xd')]=!![];this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0x4d')]=moment()['format'](_0x88c1('0x29'));this['channels'][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0x43')]='abandoned';this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0][_0x88c1('0x5a')]=_0x88c1('0x5b');logger[_0x88c1('0x24')](_0x88c1('0x5c'),_0x48c354['uniqueid'],util[_0x88c1('0x26')](this['channels'][_0x48c354[_0x88c1('0x21')]][_0x4da1b0],{'showHidden':![],'depth':null}));ami[_0x88c1('0x1d')](_0x88c1('0x5d'),this[_0x88c1('0x8')][_0x48c354[_0x88c1('0x21')]][_0x4da1b0]);}}}}}catch(_0x417a4e){logger['error'](_0x88c1('0x5e'),_0x48c354[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x417a4e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')]['syncAgentComplete']=function(_0x562c29){try{if(this[_0x88c1('0x1e')](_0x562c29)){logger[_0x88c1('0x24')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x562c29['uniqueid'],util['inspect'](_0x562c29,{'showHidden':![],'depth':null}));if(this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]]){for(var _0x4edf95 in this[_0x88c1('0x8')][_0x562c29['uniqueid']]){if(this['channels'][_0x562c29['uniqueid']][_0x88c1('0x3b')](_0x4edf95)){if(this[_0x88c1('0x8')][_0x562c29['uniqueid']][_0x4edf95][_0x88c1('0x3e')]&&!this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95][_0x88c1('0x11')]){logger[_0x88c1('0x3c')](_0x88c1('0x5f'),_0x562c29[_0x88c1('0x21')],this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95][_0x88c1('0x22')],_0x4edf95);this['channels'][_0x562c29['uniqueid']][_0x4edf95]['agentcomplete']=!![];this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95][_0x88c1('0x60')]=moment()['format'](_0x88c1('0x29'));this[_0x88c1('0x8')][_0x562c29['uniqueid']][_0x4edf95][_0x88c1('0x43')]=_0x88c1('0x61');this[_0x88c1('0x8')][_0x562c29['uniqueid']][_0x4edf95][_0x88c1('0x5a')]=_0x562c29[_0x88c1('0x5a')]=='transfer'?_0x88c1('0x62'):_0x562c29[_0x88c1('0x5a')];this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95][_0x88c1('0x63')]=_0x562c29[_0x88c1('0x63')];if(this[_0x88c1('0x9')][_0x562c29[_0x88c1('0x28')]]&&this[_0x88c1('0x9')][_0x562c29['queue']][_0x88c1('0x64')]){this[_0x88c1('0x8')][_0x562c29['uniqueid']][_0x4edf95]['acwtime']=this[_0x88c1('0x9')][_0x562c29[_0x88c1('0x28')]][_0x88c1('0x65')];this['channels'][_0x562c29[_0x88c1('0x21')]][_0x4edf95]['agentacw']=!![];}this[_0x88c1('0xa')][_0x562c29[_0x88c1('0x66')]]=_[_0x88c1('0x2f')](this[_0x88c1('0xa')][_0x562c29[_0x88c1('0x66')]],[_0x88c1('0x28'),'destconnectedlinenum']);logger['debug'](_0x88c1('0x67'),_0x562c29['uniqueid'],util['inspect'](this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95],{'showHidden':![],'depth':null}));ami[_0x88c1('0x1d')]('custom:agentcomplete',this[_0x88c1('0x8')][_0x562c29[_0x88c1('0x21')]][_0x4edf95]);logger[_0x88c1('0x24')](_0x88c1('0x68'),_0x562c29['uniqueid'],util['inspect']({'id':this[_0x88c1('0xa')][_0x562c29[_0x88c1('0x66')]]['id'],'destaccountcode':_0x562c29[_0x88c1('0x69')]},{'showHidden':![],'depth':null}));this[_0x88c1('0x1d')](util[_0x88c1('0x35')](_0x88c1('0x36'),_0x562c29[_0x88c1('0x22')]),'user:agentcomplete',{'id':this['agents'][_0x562c29['interface']]['id'],'destaccountcode':Number(_0x562c29[_0x88c1('0x69')])});}}}}}}catch(_0x3d49ac){logger[_0x88c1('0x38')](_0x88c1('0x6a'),_0x562c29['uniqueid'],util[_0x88c1('0x26')](_0x3d49ac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x13')]=function(_0x469d4a){try{if(this[_0x88c1('0x1e')](_0x469d4a)){logger['debug'](_0x88c1('0x6b'),_0x469d4a[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x469d4a,{'showHidden':![],'depth':null}));this['addVariable'](_0x469d4a[_0x88c1('0x21')],_[_0x88c1('0x6c')](_0x469d4a[_0x88c1('0x6d')])[0x0],_0x469d4a[_0x88c1('0x6e')]);if(this[_0x88c1('0x8')][_0x469d4a[_0x88c1('0x21')]]){for(var _0x5c214e in this[_0x88c1('0x8')][_0x469d4a[_0x88c1('0x21')]]){if(this[_0x88c1('0x8')][_0x469d4a[_0x88c1('0x21')]][_0x88c1('0x3b')](_0x5c214e)){logger[_0x88c1('0x3c')](_0x88c1('0x6f'),_0x469d4a[_0x88c1('0x21')],_0x5c214e,_[_0x88c1('0x6c')](_0x469d4a[_0x88c1('0x6d')])[0x0],_0x469d4a[_0x88c1('0x6e')]);if(_[_0x88c1('0x27')](this[_0x88c1('0x8')][_0x469d4a[_0x88c1('0x21')]][_0x5c214e][_0x88c1('0xb')])){this['channels'][_0x469d4a['uniqueid']][_0x5c214e][_0x88c1('0xb')]={};}this[_0x88c1('0x8')][_0x469d4a['uniqueid']][_0x5c214e]['variables']=this[_0x88c1('0xb')][_0x469d4a['uniqueid']];}}}}}catch(_0x25bf4c){logger[_0x88c1('0x38')]('[%s][voiceAgentReport][varset]',_0x469d4a[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x25bf4c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x88c1('0x70')]=function(_0x408e6f,_0xa0b7d3,_0x3415c4){var _0x2bc28a=['rtpaudioqos',_0x88c1('0x71'),_0x88c1('0x72'),_0x88c1('0x73'),_0x88c1('0x74'),_0x88c1('0x75'),_0x88c1('0x76'),'rtpaudioqosrttbridged',_0x88c1('0x77'),_0x88c1('0x78'),_0x88c1('0x79'),'bridgepvtcallid',_0x88c1('0x7a'),_0x88c1('0x7b'),_0x88c1('0x7c'),_0x88c1('0x7d'),_0x88c1('0x22'),_0x88c1('0x7e'),_0x88c1('0x7f')];if(!_[_0x88c1('0x80')](_0xa0b7d3)&&!_[_0x88c1('0x81')](_0x2bc28a,_0xa0b7d3)){if(_['isUndefined'](this[_0x88c1('0xb')][_0x408e6f])){this[_0x88c1('0xb')][_0x408e6f]={};}this[_0x88c1('0xb')][_0x408e6f][_0xa0b7d3]=_0x3415c4;}};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x15')]=function(_0x5040c5){try{if(this[_0x88c1('0x1e')](_0x5040c5)){logger['debug'](_0x88c1('0x82'),_0x5040c5[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x5040c5,{'showHidden':![],'depth':null}));if(this[_0x88c1('0x8')][_0x5040c5[_0x88c1('0x21')]]){for(var _0x2aff56 in this[_0x88c1('0x8')][_0x5040c5['uniqueid']]){if(this[_0x88c1('0x8')][_0x5040c5[_0x88c1('0x21')]]['hasOwnProperty'](_0x2aff56)){if(this[_0x88c1('0x8')][_0x5040c5[_0x88c1('0x21')]][_0x2aff56][_0x88c1('0x5a')]==_0x88c1('0x83')&&this[_0x88c1('0x8')][_0x5040c5[_0x88c1('0x21')]][_0x2aff56][_0x88c1('0x11')]){logger[_0x88c1('0x3c')](_0x88c1('0x84'),_0x5040c5[_0x88c1('0x21')],_0x2aff56);this['channels'][_0x5040c5['uniqueid']][_0x2aff56][_0x88c1('0x60')]=moment()[_0x88c1('0x35')](_0x88c1('0x29'));}}}logger[_0x88c1('0x24')](_0x88c1('0x85'),_0x5040c5[_0x88c1('0x21')],util['inspect'](_[_0x88c1('0x86')](this[_0x88c1('0x8')][_0x5040c5['uniqueid']]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x88c1('0x86')](this[_0x88c1('0x8')][_0x5040c5['uniqueid']]));delete this[_0x88c1('0x8')][_0x5040c5[_0x88c1('0x21')]];}if(this[_0x88c1('0xb')][_0x5040c5[_0x88c1('0x21')]]){delete this[_0x88c1('0xb')][_0x5040c5['uniqueid']];}}}catch(_0x273184){logger['error'](_0x88c1('0x87'),_0x5040c5['uniqueid'],util[_0x88c1('0x26')](_0x273184,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x1a')]=function(_0x37cfb2){try{if(this['isNotNull'](_0x37cfb2)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x37cfb2[_0x88c1('0x21')],util['inspect'](_0x37cfb2,{'showHidden':![],'depth':null}));if(this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]]){for(var _0x15965d in this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]]){if(this[_0x88c1('0x8')][_0x37cfb2['transfereeuniqueid']][_0x88c1('0x3b')](_0x15965d)){if(_0x37cfb2[_0x88c1('0x89')]===_0x15965d){logger[_0x88c1('0x3c')](_0x88c1('0x8a'),_0x37cfb2['uniqueid'],this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]][_0x15965d][_0x88c1('0x22')],_0x15965d);var _0x1975f3=moment();this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]][_0x15965d][_0x88c1('0x11')]=!![];this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]][_0x15965d][_0x88c1('0x60')]=moment()[_0x88c1('0x35')](_0x88c1('0x29'));this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]][_0x15965d]['lastevent']='complete';this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]][_0x15965d][_0x88c1('0x5a')]=_0x88c1('0x83');this['channels'][_0x37cfb2[_0x88c1('0x88')]][_0x15965d][_0x88c1('0x63')]=_0x1975f3[_0x88c1('0x8b')](this[_0x88c1('0x8')][_0x37cfb2['transfereeuniqueid']][_0x15965d][_0x88c1('0x3e')],'seconds');}}}}if(this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x8c')]]){var _0x25c153=this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x8c')]];this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x8c')]]=this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]];this[_0x88c1('0x8')][_0x37cfb2[_0x88c1('0x88')]]=_0x25c153;}}}catch(_0x4aaca6){logger['error'](_0x88c1('0x8d'),_0x37cfb2[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x4aaca6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')][_0x88c1('0x8e')]=function(_0x13a47a){try{if(this[_0x88c1('0x1e')](_0x13a47a)){logger[_0x88c1('0x24')](_0x88c1('0x8f'),_0x13a47a['uniqueid'],util[_0x88c1('0x26')](_0x13a47a,{'showHidden':![],'depth':null}));if(this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]]){for(var _0x3b67ba in this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]]){if(this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]][_0x88c1('0x3b')](_0x3b67ba)){if(_0x13a47a[_0x88c1('0x90')]===_0x3b67ba){logger[_0x88c1('0x3c')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x13a47a[_0x88c1('0x21')],this['channels'][_0x13a47a[_0x88c1('0x88')]][_0x3b67ba][_0x88c1('0x22')],_0x3b67ba);var _0x1141ea=moment();this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]][_0x3b67ba][_0x88c1('0x11')]=!![];this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]][_0x3b67ba][_0x88c1('0x60')]=_0x1141ea;this[_0x88c1('0x8')][_0x13a47a[_0x88c1('0x88')]][_0x3b67ba]['lastevent']=_0x88c1('0x61');this['channels'][_0x13a47a[_0x88c1('0x88')]][_0x3b67ba][_0x88c1('0x5a')]=_0x88c1('0x83');this[_0x88c1('0x8')][_0x13a47a['transfereeuniqueid']][_0x3b67ba][_0x88c1('0x63')]=_0x1141ea['diff'](this[_0x88c1('0x8')][_0x13a47a['transfereeuniqueid']][_0x3b67ba][_0x88c1('0x3e')],_0x88c1('0x91'));}}}}}}catch(_0x300b1b){logger[_0x88c1('0x38')](_0x88c1('0x92'),_0x13a47a[_0x88c1('0x21')],util['inspect'](_0x300b1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x88c1('0x1c')]['syncMusicOnHoldStart']=function(_0x183909){var _0x767110='';try{if(this[_0x88c1('0x1e')](_0x183909)){logger[_0x88c1('0x24')](_0x88c1('0x93'),_0x183909['uniqueid'],util[_0x88c1('0x26')](_0x183909,{'showHidden':![],'depth':null}));if(_0x183909[_0x88c1('0x94')]){_0x767110=_0x183909[_0x88c1('0x94')][_0x88c1('0x95')](0x0,_0x183909[_0x88c1('0x94')]['lastIndexOf']('-'));if(this['agents'][_0x767110]){logger[_0x88c1('0x3c')](_0x88c1('0x96'),_0x183909['uniqueid'],_0x767110);this['agents'][_0x767110][_0x88c1('0x97')]=!![];}}}}catch(_0x3d283b){logger[_0x88c1('0x38')](_0x88c1('0x98'),_0x183909[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x3d283b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x5e966c){var _0x20c289='';try{if(this[_0x88c1('0x1e')](_0x5e966c)){logger['debug'](_0x88c1('0x99'),_0x5e966c[_0x88c1('0x21')],util['inspect'](_0x5e966c,{'showHidden':![],'depth':null}));if(_0x5e966c[_0x88c1('0x94')]){_0x20c289=_0x5e966c[_0x88c1('0x94')]['substring'](0x0,_0x5e966c[_0x88c1('0x94')][_0x88c1('0x9a')]('-'));if(this[_0x88c1('0xa')][_0x20c289]){logger['info'](_0x88c1('0x9b'),_0x5e966c['uniqueid'],_0x20c289);this['agents'][_0x20c289][_0x88c1('0x97')]=![];}}}}catch(_0x3ab6f5){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x5e966c[_0x88c1('0x21')],util[_0x88c1('0x26')](_0x3ab6f5,{'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 1278988..4b9a0fa 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 _0xcfc6=['queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','info','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','debug','inspect','merge','pick','keys','context','from-sip','exten','xcally-motion-preview','channel','split','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','linkedid','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','application','applicationdata','appdata','startsWith','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','calleridnum','connectedlinename','disposition','UserId','membername','diff','destinationchannel','routealias','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitors','push','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','value','syncMixMonitorFilename','variable','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','transferType','then','isEmpty','getSettings','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfercalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xcfc6,0x17e));var _0x6cfc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfc6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6cfc('0x0'));var moment=require(_0x6cfc('0x1'));var util=require(_0x6cfc('0x2'));var path=require(_0x6cfc('0x3'));var Redis=require('ioredis');var config=require(_0x6cfc('0x4'));var logger=require('../../../config/logger')(_0x6cfc('0x5'));var ami=require(_0x6cfc('0x6'));var Channel=require(_0x6cfc('0x7'));var RpcSetting=require(_0x6cfc('0x8'));var applications=[_0x6cfc('0x9'),_0x6cfc('0xa'),_0x6cfc('0xb'),_0x6cfc('0xc'),_0x6cfc('0xd'),_0x6cfc('0xe')];var dispositions=['NO\x20ANSWER',_0x6cfc('0xf'),_0x6cfc('0xf'),'NO\x20ANSWER',_0x6cfc('0x10'),_0x6cfc('0x10'),_0x6cfc('0x11'),_0x6cfc('0x12'),_0x6cfc('0xf'),_0x6cfc('0xf'),_0x6cfc('0xf')];config[_0x6cfc('0x13')]=_[_0x6cfc('0x14')](config['redis'],{'host':_0x6cfc('0x15'),'port':0x18eb});var io=require(_0x6cfc('0x16'))(new Redis(config['redis']));function VoiceCallReport(_0x2ac5bc){this[_0x6cfc('0x17')]=_0x2ac5bc[_0x6cfc('0x17')];this[_0x6cfc('0x18')]=_0x2ac5bc[_0x6cfc('0x18')];this[_0x6cfc('0x19')]={};ami['on'](_0x6cfc('0x1a'),this[_0x6cfc('0x1b')][_0x6cfc('0x1c')](this));ami['on']('newexten',this[_0x6cfc('0x1b')][_0x6cfc('0x1c')](this));ami['on']('newchannel',this['syncNewChannel'][_0x6cfc('0x1c')](this));ami['on'](_0x6cfc('0x1d'),this[_0x6cfc('0x1e')][_0x6cfc('0x1c')](this));ami['on'](_0x6cfc('0x1f'),this[_0x6cfc('0x20')][_0x6cfc('0x1c')](this));ami['on'](_0x6cfc('0x21'),this[_0x6cfc('0x22')][_0x6cfc('0x1c')](this));ami['on']('newcallerid',this[_0x6cfc('0x23')]['bind'](this));ami['on'](_0x6cfc('0x24'),this[_0x6cfc('0x25')][_0x6cfc('0x1c')](this));ami['on'](_0x6cfc('0x26'),this[_0x6cfc('0x27')][_0x6cfc('0x1c')](this));ami['on']('musiconholdstart',this[_0x6cfc('0x28')][_0x6cfc('0x1c')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x6cfc('0x1c')](this));try{logger[_0x6cfc('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x9f76c9){logger[_0x6cfc('0x2a')](_0x6cfc('0x2b'),util['inspect'](_0x9f76c9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x6cfc('0x2c')][_0x6cfc('0x2d')]=function(_0x4c176d){return _0x4c176d!==null&&!_[_0x6cfc('0x2e')](_0x4c176d);};VoiceCallReport['prototype'][_0x6cfc('0x2f')]=function(_0x3cff8a,_0x3e0835,_0x3f3030){io['to'](_0x3cff8a)[_0x6cfc('0x2f')](_0x3e0835,_0x3f3030);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x16e02f){try{if(this['isNotNull'](_0x16e02f)){logger[_0x6cfc('0x29')](_0x6cfc('0x30'),_0x16e02f[_0x6cfc('0x31')],_0x16e02f['calleridname'],_0x16e02f['calleridnum']);logger[_0x6cfc('0x32')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x16e02f[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x16e02f,{'showHidden':![],'depth':null}));if(_0x16e02f[_0x6cfc('0x31')]===_0x16e02f['linkedid']){if(!_[_0x6cfc('0x2e')](this[_0x6cfc('0x17')][_0x16e02f[_0x6cfc('0x31')]])){_[_0x6cfc('0x34')](this['channels'][_0x16e02f[_0x6cfc('0x31')]],_[_0x6cfc('0x35')](_0x16e02f,_[_0x6cfc('0x36')](this[_0x6cfc('0x17')][_0x16e02f[_0x6cfc('0x31')]])));}}if(_0x16e02f[_0x6cfc('0x37')]===_0x6cfc('0x38')){if(this[_0x6cfc('0x18')][_0x16e02f['channel']['split']('-')[0x0]]){if(_0x16e02f[_0x6cfc('0x39')]==_0x6cfc('0x3a')){this[_0x6cfc('0x18')][_0x16e02f[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]][_0x6cfc('0x3d')]=_0x16e02f[_0x6cfc('0x3e')];this['emit'](util[_0x6cfc('0x3f')](_0x6cfc('0x40'),this[_0x6cfc('0x18')][_0x16e02f[_0x6cfc('0x3b')]['split']('-')[0x0]][_0x6cfc('0x41')]),_0x6cfc('0x42'),{'destaccountcode':this['agents'][_0x16e02f[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]][_0x6cfc('0x43')],'destconnectedlinenum':_0x16e02f[_0x6cfc('0x3e')]});}}}}}catch(_0x392f28){logger['error'](_0x6cfc('0x44'),_0x16e02f[_0x6cfc('0x31')],util['inspect'](_0x392f28,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')]['syncNewChannel']=function(_0x5c0014){try{if(this[_0x6cfc('0x2d')](_0x5c0014)){logger[_0x6cfc('0x32')](_0x6cfc('0x45'),_0x5c0014[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x5c0014,{'showHidden':![],'depth':null}));if(this[_0x6cfc('0x17')][_0x5c0014['uniqueid']]){return;}if(_0x5c0014[_0x6cfc('0x3b')]===_0x6cfc('0x46')){return;}if(_0x5c0014[_0x6cfc('0x31')]!==_0x5c0014[_0x6cfc('0x47')]&&!this[_0x6cfc('0x19')][_0x5c0014[_0x6cfc('0x47')]]){return;}logger[_0x6cfc('0x29')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x5c0014[_0x6cfc('0x31')],_0x5c0014[_0x6cfc('0x37')],_0x5c0014[_0x6cfc('0x39')]);this[_0x6cfc('0x17')][_0x5c0014['uniqueid']]=new Channel();this['channels'][_0x5c0014[_0x6cfc('0x31')]][_0x6cfc('0x48')]=moment()[_0x6cfc('0x3f')](_0x6cfc('0x49'));this[_0x6cfc('0x17')][_0x5c0014['uniqueid']]['disposition']=dispositions[_[_0x6cfc('0x4a')](_0x5c0014['channelstate'])];_[_0x6cfc('0x34')](this['channels'][_0x5c0014['uniqueid']],_['pick'](_0x5c0014,_[_0x6cfc('0x36')](this[_0x6cfc('0x17')][_0x5c0014[_0x6cfc('0x31')]])));if(_0x5c0014[_0x6cfc('0x37')]===_0x6cfc('0x38')){var _0x503a07=this[_0x6cfc('0x18')][_0x5c0014[_0x6cfc('0x3b')]['split']('-')[0x0]];if(_0x503a07&&typeof _0x503a07[_0x6cfc('0x3d')]===_0x6cfc('0x4b')){_0x503a07[_0x6cfc('0x3d')]=_0x5c0014[_0x6cfc('0x39')];logger[_0x6cfc('0x32')](_0x6cfc('0x4c'),_0x5c0014[_0x6cfc('0x31')],util[_0x6cfc('0x33')]({'id':_0x503a07['id'],'destaccountcode':_0x503a07[_0x6cfc('0x43')],'destconnectedlinenum':_0x5c0014[_0x6cfc('0x39')]},{'showHidden':![],'depth':null}));this[_0x6cfc('0x2f')](util[_0x6cfc('0x3f')](_0x6cfc('0x40'),_0x503a07[_0x6cfc('0x41')]),_0x6cfc('0x42'),{'id':_0x503a07['id'],'destaccountcode':_0x503a07[_0x6cfc('0x43')],'destconnectedlinenum':_0x5c0014[_0x6cfc('0x39')]});}}}}catch(_0x56d563){logger['error'](_0x6cfc('0x4d'),_0x5c0014[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x56d563,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')][_0x6cfc('0x1b')]=function(_0xe42058){try{if(this[_0x6cfc('0x2d')](_0xe42058)){logger[_0x6cfc('0x32')]('[%s][voiceCallReport][newexten]\x20event:',_0xe42058['uniqueid'],util[_0x6cfc('0x33')](_0xe42058,{'showHidden':![],'depth':null}));if(_0xe42058['channel']===_0x6cfc('0x46')||_0xe42058[_0x6cfc('0x39')]==='h')return;if(_0xe42058[_0x6cfc('0x31')]===_0xe42058[_0x6cfc('0x47')]||this[_0x6cfc('0x19')][_0xe42058[_0x6cfc('0x47')]]){_0xe42058['application']=_0xe42058[_0x6cfc('0x4e')]?_0xe42058[_0x6cfc('0x4e')]['toLowerCase']():undefined;_0xe42058[_0x6cfc('0x4f')]=_0xe42058['appdata']||_0xe42058[_0x6cfc('0x4f')];if(_0xe42058['appdata']&&!_0xe42058[_0x6cfc('0x50')][_0x6cfc('0x51')]('CDR(routeAlias)')&&_0xe42058['application']!==_0x6cfc('0xa')){_0xe42058[_0x6cfc('0x4f')]=_0xe42058[_0x6cfc('0x4f')][_0x6cfc('0x52')]();}logger[_0x6cfc('0x29')](_0x6cfc('0x53'),_0xe42058[_0x6cfc('0x31')],_0xe42058[_0x6cfc('0x4e')],_0xe42058[_0x6cfc('0x4f')]);if(_['isUndefined'](this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]])){this[_0x6cfc('0x17')][_0xe42058['uniqueid']]=new Channel();this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]][_0x6cfc('0x48')]=_0xe42058[_0x6cfc('0x54')]?moment()[_0x6cfc('0x55')](moment[_0x6cfc('0x54')](_0xe42058[_0x6cfc('0x54')])[_0x6cfc('0x56')](),_0x6cfc('0x56'))[_0x6cfc('0x3f')](_0x6cfc('0x49')):moment()[_0x6cfc('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6cfc('0x17')][_0xe42058['uniqueid']]['disposition']=_0x6cfc('0x10');}_[_0x6cfc('0x34')](this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]],_[_0x6cfc('0x35')](_0xe42058,_['keys'](this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]])));if(_['includes'](applications,_0xe42058[_0x6cfc('0x4e')])){this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]][_0x6cfc('0x57')]=_0xe42058[_0x6cfc('0x4e')];this['channels'][_0xe42058[_0x6cfc('0x31')]][_0x6cfc('0x58')]=_0xe42058[_0x6cfc('0x4f')];if(_0xe42058[_0x6cfc('0x4e')]==='set'&&_[_0x6cfc('0x51')](_0xe42058[_0x6cfc('0x4f')][_0x6cfc('0x52')](),_0x6cfc('0x59'))){var _0x35e040=_0xe42058[_0x6cfc('0x4f')][_0x6cfc('0x3c')]('=');var _0x4a929c=_0x35e040[0x0][_0x6cfc('0x52')]()[_0x6cfc('0x5a')](/cdr\((.*)\)/);if(_0x4a929c){if(_0x4a929c[0x1]===_0x6cfc('0x5b')&&!_[_0x6cfc('0x5c')](this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]][_0x4a929c[0x1]]))return;this[_0x6cfc('0x17')][_0xe42058[_0x6cfc('0x31')]][_0x4a929c[0x1]]=_0x35e040[0x1];}}else if(_0xe42058[_0x6cfc('0x4e')]===_0x6cfc('0xa')){this['channels'][_0xe42058['uniqueid']][_0x6cfc('0xa')]=_0xe42058[_0x6cfc('0x4f')][_0x6cfc('0x3c')](',')[0x0];}}}}}catch(_0x1c6dad){logger[_0x6cfc('0x2a')](_0x6cfc('0x5d'),_0xe42058[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x1c6dad,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')][_0x6cfc('0x1e')]=function(_0x1e4817){try{if(this['isNotNull'](_0x1e4817)){logger['info'](_0x6cfc('0x5e'),_0x1e4817[_0x6cfc('0x31')],_0x1e4817[_0x6cfc('0x47')],_0x1e4817[_0x6cfc('0x5f')],_0x1e4817['calleridnum']);logger[_0x6cfc('0x32')](_0x6cfc('0x60'),_0x1e4817[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x1e4817,{'showHidden':![],'depth':null}));if(_0x1e4817[_0x6cfc('0x61')]!=='6')return;var _0x31fd56=this[_0x6cfc('0x18')][_0x1e4817[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]];if(_0x1e4817[_0x6cfc('0x31')]!==_0x1e4817[_0x6cfc('0x47')]){var _0x5e8628=moment();if(this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]]){if(!this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x62')]){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]]['answered']=!![];this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x63')]=_0x5e8628[_0x6cfc('0x3f')](_0x6cfc('0x49'));if(this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x48')]){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x64')]=_0x5e8628['diff'](this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x48')],_0x6cfc('0x56'));}}this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x47')]=_0x1e4817['uniqueid'];if(_0x1e4817['calleridnum']!=='xcally-motion-preview'){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x3e')]=_0x1e4817[_0x6cfc('0x65')];}this['channels'][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x66')]=_0x1e4817['calleridname'];this[_0x6cfc('0x17')][_0x1e4817['linkedid']]['destinationchannel']=_0x1e4817['channel'];this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x67')]=dispositions[_[_0x6cfc('0x4a')](_0x1e4817[_0x6cfc('0x61')])];if(_0x31fd56){this[_0x6cfc('0x17')][_0x1e4817['linkedid']][_0x6cfc('0x68')]=_0x31fd56['id'];this[_0x6cfc('0x17')][_0x1e4817['linkedid']][_0x6cfc('0x69')]=_0x31fd56['name'];}}if(this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]]){if(!this[_0x6cfc('0x17')][_0x1e4817['uniqueid']][_0x6cfc('0x62')]){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x62')]=!![];this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x63')]=_0x5e8628[_0x6cfc('0x3f')](_0x6cfc('0x49'));if(this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]]['starttime']){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x64')]=_0x5e8628[_0x6cfc('0x6a')](this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]]['starttime'],'seconds');}}if(_0x1e4817[_0x6cfc('0x65')]!==_0x6cfc('0x3a')){this[_0x6cfc('0x17')][_0x1e4817['uniqueid']]['connectedlinenum']=_0x1e4817[_0x6cfc('0x65')];}this['channels'][_0x1e4817[_0x6cfc('0x31')]]['connectedlinename']=_0x1e4817[_0x6cfc('0x5f')];this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x6b')]=_0x1e4817['channel'];this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x67')]=dispositions[_[_0x6cfc('0x4a')](_0x1e4817[_0x6cfc('0x61')])];}}else{if(this[_0x6cfc('0x17')][_0x1e4817['uniqueid']]){if(_0x31fd56){this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x68')]=_0x31fd56['id'];this['channels'][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0x69')]=_0x31fd56['name'];}}}if(_0x1e4817['context']==='from-sip'){if(_0x31fd56){_0x31fd56[_0x6cfc('0x3d')]=_0x1e4817[_0x6cfc('0x39')];var _0x3800e4,_0x5c02a9;if(this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]]){_0x3800e4=this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]]['routealias'];_0x5c02a9=this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x31')]][_0x6cfc('0xa')];}else if(this['channels'][_0x1e4817[_0x6cfc('0x47')]]){_0x3800e4=this[_0x6cfc('0x17')][_0x1e4817[_0x6cfc('0x47')]][_0x6cfc('0x6c')];_0x5c02a9=this['channels'][_0x1e4817[_0x6cfc('0x47')]]['queue'];}_0x31fd56[_0x6cfc('0xa')]=_0x5c02a9;_0x31fd56[_0x6cfc('0x6c')]=_0x3800e4;var _0x2b7ecf={'id':_0x31fd56['id'],'name':_0x31fd56[_0x6cfc('0x41')],'agentconnected':!![],'destaccountcode':_0x31fd56[_0x6cfc('0x43')],'destconnectedlinenum':_0x1e4817[_0x6cfc('0x39')],'queue':_0x5c02a9||undefined,'routealias':_0x3800e4,'uniqueid':_0x1e4817['linkedid']};logger[_0x6cfc('0x32')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x1e4817[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x2b7ecf,{'showHidden':![],'depth':null}));this[_0x6cfc('0x2f')](util['format'](_0x6cfc('0x40'),_0x31fd56[_0x6cfc('0x41')]),_0x6cfc('0x42'),_0x2b7ecf);}}}}catch(_0x31b85f){logger[_0x6cfc('0x2a')]('[%s][voiceCallReport][newstate]',_0x1e4817[_0x6cfc('0x31')],util[_0x6cfc('0x33')](_0x31b85f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')]['syncMixMonitorFilename']=function(_0x4a815a,_0x560afa){try{if(this['channels'][_0x4a815a]){logger[_0x6cfc('0x29')](_0x6cfc('0x6d'),_0x4a815a,_0x560afa);this[_0x6cfc('0x17')][_0x4a815a][_0x6cfc('0x6e')]=!![];if(_[_0x6cfc('0x6f')](_0x560afa,_0x6cfc('0x70'))){_0x560afa=_0x560afa[_0x6cfc('0x71')](_0x6cfc('0x70'),'.WAV');}this[_0x6cfc('0x17')][_0x4a815a]['monitorFilename']=_0x560afa;var _0x499a6b=_['find'](this[_0x6cfc('0x17')][_0x4a815a][_0x6cfc('0x72')],{'filename':_0x560afa});if(_[_0x6cfc('0x5c')](_0x499a6b)){this[_0x6cfc('0x17')][_0x4a815a][_0x6cfc('0x72')][_0x6cfc('0x73')]({'filename':_0x560afa,'createdAt':moment()[_0x6cfc('0x3f')](_0x6cfc('0x49')),'mixmonitorid':'','status':'rec'});}}}catch(_0x4b37bd){logger[_0x6cfc('0x2a')]('[%s][voiceCallReport][mixMonitorFilename]',_0x4a815a,util[_0x6cfc('0x33')](_0x4b37bd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')]['syncVarSet']=function(_0x31dd32){try{if(this['isNotNull'](_0x31dd32)){logger['debug'](_0x6cfc('0x74'),_0x31dd32[_0x6cfc('0x31')],util['inspect'](_0x31dd32,{'showHidden':![],'depth':null}));if(this[_0x6cfc('0x17')][_0x31dd32[_0x6cfc('0x31')]]&&_0x31dd32[_0x6cfc('0x3b')]!=_0x6cfc('0x46')){if(this['isNotNull'](_0x31dd32['variable'])){if(this[_0x6cfc('0x2d')](_0x31dd32['variable'][_0x6cfc('0x75')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this[_0x6cfc('0x77')](_0x31dd32['uniqueid'],_0x31dd32[_0x6cfc('0x76')]);}else if(this['isNotNull'](_0x31dd32[_0x6cfc('0x78')][_0x6cfc('0x79')])){logger['info'](_0x6cfc('0x7a'),_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this['channels'][_0x31dd32['uniqueid']][_0x6cfc('0x65')]=_0x31dd32[_0x6cfc('0x76')];}else if(this[_0x6cfc('0x2d')](_0x31dd32['variable'][_0x6cfc('0x7b')])){logger[_0x6cfc('0x29')](_0x6cfc('0x7c'),_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this['channels'][_0x31dd32['uniqueid']]['callerid']=_0x31dd32[_0x6cfc('0x76')];}else if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')][_0x6cfc('0x7d')])){logger[_0x6cfc('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x31dd32[_0x6cfc('0x31')],_0x31dd32['value']);this['channels'][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0x5b')]=_0x31dd32[_0x6cfc('0x76')];}else if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')][_0x6cfc('0x7e')])){logger[_0x6cfc('0x29')](_0x6cfc('0x7f'),_0x31dd32['uniqueid'],_0x31dd32['value'][_0x6cfc('0x3c')](',')[0x0]);this[_0x6cfc('0x17')][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0xa')]=_0x31dd32[_0x6cfc('0x76')][_0x6cfc('0x3c')](',')[0x0];}else if(this[_0x6cfc('0x2d')](_0x31dd32['variable'][_0x6cfc('0x80')])){logger[_0x6cfc('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x31dd32[_0x6cfc('0x31')],_0x31dd32['value']);this[_0x6cfc('0x17')][_0x31dd32['uniqueid']][_0x6cfc('0x81')]=_0x31dd32[_0x6cfc('0x76')];}else if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')][_0x6cfc('0x82')])){logger[_0x6cfc('0x29')](_0x6cfc('0x83'),_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this[_0x6cfc('0x17')][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0x84')]=_0x31dd32[_0x6cfc('0x76')];}else if(this[_0x6cfc('0x2d')](_0x31dd32['variable'][_0x6cfc('0x85')])){logger[_0x6cfc('0x29')](_0x6cfc('0x86'),_0x31dd32['uniqueid'],_0x31dd32['value']);this['channels'][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0x87')]=_0x31dd32['value'];}else if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')]['xmcs-queue'])){logger[_0x6cfc('0x29')](_0x6cfc('0x88'),_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this[_0x6cfc('0x17')][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0xa')]=_0x31dd32['value'];}else if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')][_0x6cfc('0x89')])){logger[_0x6cfc('0x29')](_0x6cfc('0x8a'),_0x31dd32[_0x6cfc('0x31')],_0x31dd32[_0x6cfc('0x76')]);this[_0x6cfc('0x17')][_0x31dd32[_0x6cfc('0x31')]][_0x6cfc('0x8b')]=_0x31dd32[_0x6cfc('0x76')];}}}else if(this['isNotNull'](_0x31dd32['variable'][_0x6cfc('0x75')])){if(_0x31dd32[_0x6cfc('0x76')]){var _0x309be2=path[_0x6cfc('0x8c')](_0x31dd32[_0x6cfc('0x76')])[_0x6cfc('0x41')];logger['info'](_0x6cfc('0x8d'),_0x309be2,_0x31dd32[_0x6cfc('0x76')]);this[_0x6cfc('0x77')](_0x309be2,_0x31dd32[_0x6cfc('0x76')]);}}else if(this['channels'][_0x31dd32[_0x6cfc('0x47')]]){if(this[_0x6cfc('0x2d')](_0x31dd32[_0x6cfc('0x78')])){if(this[_0x6cfc('0x2d')](_0x31dd32['variable']['sipcallid'])){logger[_0x6cfc('0x29')](_0x6cfc('0x8a'),_0x31dd32['linkedid'],_0x31dd32[_0x6cfc('0x76')]);this['channels'][_0x31dd32[_0x6cfc('0x47')]][_0x6cfc('0x8e')]=_0x31dd32[_0x6cfc('0x76')];}}}}}catch(_0x4b994f){logger['error'](_0x6cfc('0x8f'),_0x31dd32[_0x6cfc('0x31')],util['inspect'](_0x4b994f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6cfc('0x2c')][_0x6cfc('0x22')]=function(_0x3d611b){try{if(this['isNotNull'](_0x3d611b)){logger[_0x6cfc('0x32')](_0x6cfc('0x90'),_0x3d611b[_0x6cfc('0x31')],util['inspect'](_0x3d611b,{'showHidden':![],'depth':null}));if(this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]]){if(this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]]){this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]][_0x6cfc('0x31')]=_0x3d611b[_0x6cfc('0x31')];this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b['linkedid']][_0x6cfc('0x47')]][_0x6cfc('0x62')]=this['channels'][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x62')];this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]][_0x6cfc('0x63')]=this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x63')];this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b['linkedid']][_0x6cfc('0x47')]][_0x6cfc('0x6b')]=this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]]['channel'];this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]][_0x6cfc('0x67')]=this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x67')];this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]]=this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]];delete this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x47')]];}else if(this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]]){this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]]['uniqueid']][_0x6cfc('0x31')]=[this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]][_0x6cfc('0x47')],this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]]['uniqueid']][_0x6cfc('0x47')]=this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]]['uniqueid']][_0x6cfc('0x31')]][0x0];this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]][_0x6cfc('0x62')]=this[_0x6cfc('0x17')][_0x3d611b['uniqueid']][_0x6cfc('0x62')];this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]][_0x6cfc('0x63')]=this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]]['answertime'];this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]]['uniqueid']]['destinationchannel']=this['channels'][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]][_0x6cfc('0x3b')];this[_0x6cfc('0x17')][this['blindTransfers'][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]][_0x6cfc('0x67')]=this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x67')];this['channels'][_0x3d611b[_0x6cfc('0x31')]]=this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b['linkedid']][_0x6cfc('0x31')]];delete this[_0x6cfc('0x17')][this[_0x6cfc('0x19')][_0x3d611b[_0x6cfc('0x47')]][_0x6cfc('0x31')]];}}if(this[_0x6cfc('0x17')][_0x3d611b['uniqueid']]){logger[_0x6cfc('0x29')](_0x6cfc('0x91'),_0x3d611b['uniqueid'],_0x3d611b[_0x6cfc('0x92')]);var _0x3548f1=moment();this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x93')]=_0x3548f1['format'](_0x6cfc('0x49'));this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x54')]=_0x3548f1[_0x6cfc('0x6a')](this[_0x6cfc('0x17')][_0x3d611b['uniqueid']][_0x6cfc('0x48')],_0x6cfc('0x56'));if(this['channels'][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x62')]){this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]][_0x6cfc('0x94')]=_0x3548f1[_0x6cfc('0x6a')](this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]]['answertime'],_0x6cfc('0x56'));this[_0x6cfc('0x17')][_0x3d611b[_0x6cfc('0x31')]]['holdtime']=this['channels'][_0x3d611b[_0x6cfc('0x31')]]['duration']-this['channels'][_0x3d611b[_0x6cfc('0x31')]]['billableseconds'];}if(_0x3d611b[_0x6cfc('0x37')]===_0x6cfc('0x38')){if(this[_0x6cfc('0x18')][_0x3d611b['channel'][_0x6cfc('0x3c')]('-')[0x0]]){this[_0x6cfc('0x18')][_0x3d611b[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]]=_[_0x6cfc('0x95')](this[_0x6cfc('0x18')][_0x3d611b['channel'][_0x6cfc('0x3c')]('-')[0x0]],[_0x6cfc('0x3d')]);logger['debug'](_0x6cfc('0x96'),_0x3d611b[_0x6cfc('0x31')],util[_0x6cfc('0x33')]({'id':this[_0x6cfc('0x18')][_0x3d611b[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0x6cfc('0x18')][_0x3d611b['channel']['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x6cfc('0x3f')](_0x6cfc('0x40'),this[_0x6cfc('0x18')][_0x3d611b[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]][_0x6cfc('0x41')]),'user:agentcomplete',{'id':this[_0x6cfc('0x18')][_0x3d611b[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]]['id'],'destaccountcode':this[_0x6cfc('0x18')][_0x3d611b[_0x6cfc('0x3b')][_0x6cfc('0x3c')]('-')[0x0]]['accountcode']});for(var _0x177670=0x0;_0x1776700x0?!![]:![];if(!_0x4a4ad7){return this[_0x3e28('0x1b')](this[_0x3e28('0x16')]['completeEvent']);}};VoiceQueueReport[_0x3e28('0xb')]['syncQueueMember']=function(_0x24eea9){var _0x176c13=this[_0x3e28('0x16')]['id'];if(this[_0x3e28('0x16')][_0x3e28('0x65')][_0x176c13]&&this['summary'][_0x3e28('0x65')][_0x176c13][_0x24eea9[_0x3e28('0x64')]]){this[_0x3e28('0x16')][_0x3e28('0x65')][_0x176c13][_0x24eea9[_0x3e28('0x64')]][_0x3e28('0x12')][_0x3e28('0x71')](_0x24eea9);}};VoiceQueueReport[_0x3e28('0xb')][_0x3e28('0x72')]=function(_0x5154a9){var _0x56f177=this;try{if(this['isNotNull'](_0x5154a9)&&this[_0x3e28('0x5c')](_0x5154a9[_0x3e28('0x50')])){logger[_0x3e28('0x4b')](_0x3e28('0x73'),util['inspect'](_0x5154a9,{'showHidden':![],'depth':null}));var _0x330cc4=this[_0x3e28('0x14')][_0x5154a9[_0x3e28('0x50')]];if(_0x330cc4){logger[_0x3e28('0x4b')](_0x3e28('0x74'),_0x330cc4[_0x3e28('0x5a')]);this[_0x3e28('0x16')]['queues'][_0x330cc4['name']]={'summaryEvent':_0x5154a9};this['summary']['statusRequests']+=0x1;return ami[_0x3e28('0x62')]({'action':_0x3e28('0x65'),'queue':_0x330cc4[_0x3e28('0x5a')]})[_0x3e28('0x63')](function(_0x1b2cb7){if(!_0x56f177['summary']['queuestatus'][_0x5154a9[_0x3e28('0x64')]]){_0x56f177['summary'][_0x3e28('0x65')][_0x5154a9[_0x3e28('0x64')]]={};}_0x56f177[_0x3e28('0x16')][_0x3e28('0x65')][_0x5154a9['actionid']][_0x1b2cb7['actionid']]={'queue':_0x330cc4['name'],'agents':[]};})[_0x3e28('0x3e')](function(_0x62589e){throw _0x62589e;});}}}catch(_0x1aa276){logger[_0x3e28('0x41')](_0x3e28('0x66'),util[_0x3e28('0x43')](_0x1aa276,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e28('0xb')][_0x3e28('0x1b')]=function(_0x473dbd){if(this[_0x3e28('0x16')][_0x3e28('0x70')]>0x0){this['summary'][_0x3e28('0x75')]=_0x473dbd;return;}logger[_0x3e28('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x473dbd,{'showHidden':![],'depth':null}));this[_0x3e28('0x16')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x3e28('0xb')][_0x3e28('0x20')]=function(_0x490332){try{if(this[_0x3e28('0x5c')](_0x490332)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x490332['uniqueid'],util[_0x3e28('0x43')](_0x490332,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x490332[_0x3e28('0x4d')]])){this[_0x3e28('0x10')][_0x490332[_0x3e28('0x4d')]]=[];}if(_[_0x3e28('0x76')](this[_0x3e28('0x13')][_0x490332[_0x3e28('0x4d')]])){this[_0x3e28('0x13')][_0x490332[_0x3e28('0x4d')]]={};}var _0x164b9d=new QueueReport();_0x164b9d[_0x3e28('0x50')]=_0x490332[_0x3e28('0x50')];_0x164b9d[_0x3e28('0x57')]=this[_0x3e28('0x14')][_0x164b9d['queue']]&&this[_0x3e28('0x14')][_0x164b9d[_0x3e28('0x50')]][_0x3e28('0x57')]?this[_0x3e28('0x14')][_0x164b9d[_0x3e28('0x50')]][_0x3e28('0x57')]||'inbound':'inbound';_0x164b9d[_0x3e28('0x77')]=moment()['format'](_0x3e28('0x78'));_0x164b9d[_0x3e28('0x79')]=_0x490332[_0x3e28('0x79')];_0x164b9d['count']=_0x490332['count'];_0x164b9d['uniqueid']=_0x490332[_0x3e28('0x4d')];_0x164b9d[_0x3e28('0x7a')]=this['channels'][_0x490332[_0x3e28('0x4d')]][_0x3e28('0x7a')];logger[_0x3e28('0x7b')](_0x3e28('0x7c'),_0x164b9d[_0x3e28('0x50')],_0x164b9d[_0x3e28('0x57')]);Object[_0x3e28('0x6c')](_0x164b9d,_[_0x3e28('0x7d')](_0x490332,_['keys'](_0x164b9d)));this[_0x3e28('0x10')][_0x490332[_0x3e28('0x4d')]][_0x3e28('0x71')](_0x164b9d);this[_0x3e28('0x13')][_0x490332[_0x3e28('0x4d')]]=_0x164b9d;this['emitVoiceQueueChannelSave'](_0x164b9d,_0x3e28('0x7e'));}}catch(_0x55d965){logger[_0x3e28('0x41')](_0x3e28('0x7f'),_0x490332[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x55d965,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e28('0xb')]['syncQueueCallerAbandon']=function(_0x32f604){try{if(this[_0x3e28('0x5c')](_0x32f604)){logger[_0x3e28('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x32f604['uniqueid'],util[_0x3e28('0x43')](_0x32f604,{'showHidden':![],'depth':null}));if(this[_0x3e28('0x10')][_0x32f604['uniqueid']]){var _0x386309=_['last'](this[_0x3e28('0x10')][_0x32f604[_0x3e28('0x4d')]]);_0x386309[_0x3e28('0x3a')]=![];_0x386309[_0x3e28('0x80')]=null;_0x386309[_0x3e28('0x81')]=_0x32f604['holdtime'];_0x386309['originalposition']=_0x32f604[_0x3e28('0x82')];_0x386309[_0x3e28('0x21')]=!![];_0x386309[_0x3e28('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x386309[_0x3e28('0x84')]=_0x3e28('0x85');_0x386309[_0x3e28('0x86')]=null;logger[_0x3e28('0x7b')](_0x3e28('0x87'),_0x386309[_0x3e28('0x50')],_0x386309[_0x3e28('0x57')]);this['channels'][_0x32f604[_0x3e28('0x4d')]]=_0x386309;this[_0x3e28('0x88')](_0x386309,_0x3e28('0x21'));}}}catch(_0x418f49){logger[_0x3e28('0x41')](_0x3e28('0x89'),_0x32f604[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x418f49,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e28('0xb')][_0x3e28('0x23')]=function(_0x4042c8){try{if(this[_0x3e28('0x5c')](_0x4042c8)){logger[_0x3e28('0x4b')](_0x3e28('0x8a'),_0x4042c8['uniqueid'],util[_0x3e28('0x43')](_0x4042c8,{'showHidden':![],'depth':null}));if(this[_0x3e28('0x10')][_0x4042c8[_0x3e28('0x4d')]]){var _0x38dcb8=_[_0x3e28('0x8b')](this[_0x3e28('0x10')][_0x4042c8[_0x3e28('0x4d')]]);_0x38dcb8[_0x3e28('0x8c')]=moment()[_0x3e28('0x4e')](_0x3e28('0x78'));_0x38dcb8['connectedlinenum']=_0x4042c8[_0x3e28('0x8d')];_0x38dcb8[_0x3e28('0x8e')]=_0x4042c8['connectedlinename'];logger[_0x3e28('0x7b')](_0x3e28('0x8f'),_0x38dcb8[_0x3e28('0x50')],_0x38dcb8[_0x3e28('0x57')],_0x4042c8[_0x3e28('0x8d')],_0x4042c8[_0x3e28('0x8e')]);this[_0x3e28('0x13')][_0x4042c8[_0x3e28('0x4d')]]=_0x38dcb8;this[_0x3e28('0x4a')](_0x38dcb8,'queuecallerleave');}}}catch(_0x371b2){logger[_0x3e28('0x41')](_0x3e28('0x8a'),_0x4042c8[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x371b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x247b45){try{if(this[_0x3e28('0x5c')](_0x247b45)){logger[_0x3e28('0x4b')](_0x3e28('0x90'),_0x247b45['uniqueid'],util[_0x3e28('0x43')](_0x247b45,{'showHidden':![],'depth':null}));if(this[_0x3e28('0x10')][_0x247b45['uniqueid']]){var _0x2a8136=_[_0x3e28('0x8b')](this[_0x3e28('0x10')][_0x247b45[_0x3e28('0x4d')]]);_0x2a8136[_0x3e28('0x3a')]=!![];_0x2a8136[_0x3e28('0x84')]=_0x3e28('0x91');logger[_0x3e28('0x7b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2a8136[_0x3e28('0x50')],_0x2a8136[_0x3e28('0x57')]);}}}catch(_0x20edb1){logger[_0x3e28('0x41')](_0x3e28('0x90'),_0x247b45['uniqueid'],util[_0x3e28('0x43')](_0x20edb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3e28('0x24')]=function(_0x2b9d05){try{if(this[_0x3e28('0x5c')](_0x2b9d05)){logger[_0x3e28('0x4b')](_0x3e28('0x92'),_0x2b9d05[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x2b9d05,{'showHidden':![],'depth':null}));if(this[_0x3e28('0x10')][_0x2b9d05[_0x3e28('0x4d')]]){var _0x69339c=_['last'](this[_0x3e28('0x10')][_0x2b9d05[_0x3e28('0x4d')]]);_0x69339c[_0x3e28('0x21')]=![];_0x69339c['queuecallerabandonAt']=null;_0x69339c[_0x3e28('0x93')]=!![];_0x69339c[_0x3e28('0x86')]=_0x2b9d05[_0x3e28('0x94')];_0x69339c[_0x3e28('0x81')]=_0x2b9d05[_0x3e28('0x81')];_0x69339c[_0x3e28('0x3a')]=!![];_0x69339c['queuecallerexit']=![];_0x69339c[_0x3e28('0x95')]=null;if(!_0x69339c[_0x3e28('0x96')]){if(_0x2b9d05['reason']==_0x3e28('0x96')){_0x69339c[_0x3e28('0x84')]=_0x3e28('0x97');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x69339c['queue'],_0x69339c[_0x3e28('0x57')]);}else{if(_[_0x3e28('0x98')](_0x2b9d05[_0x3e28('0x3d')]['toLowerCase'](),_0x3e28('0x99'))){if(this['queueReports'][_0x2b9d05[_0x3e28('0x9a')]]){var _0x2e1693=_['last'](this[_0x3e28('0x10')][_0x2b9d05[_0x3e28('0x9a')]]);_0x2e1693[_0x3e28('0x3a')]=![];_0x2e1693[_0x3e28('0x9b')]=!![];_0x2e1693[_0x3e28('0x95')]=moment(_0x69339c[_0x3e28('0x77')])[_0x3e28('0x9c')](_0x2b9d05[_0x3e28('0x81')],_0x3e28('0x9d'))[_0x3e28('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e1693[_0x3e28('0x84')]=_0x3e28('0x9e');_0x2e1693[_0x3e28('0x96')]=!![];_0x2e1693[_0x3e28('0x9f')]='FORWARD';_0x2e1693['transferexten']=_0x2b9d05['destexten'];_0x2e1693[_0x3e28('0xa0')]=_0x2b9d05['uniqueid'];logger[_0x3e28('0x7b')](_0x3e28('0xa1'),_0x2e1693[_0x3e28('0x50')],_0x2e1693[_0x3e28('0x57')]);var _0x3dd4ae=this['queueReports'][_0x2b9d05['linkedid']];this['queueReports'][_0x2b9d05['linkedid']]=this[_0x3e28('0x10')][_0x2b9d05[_0x3e28('0x4d')]];this[_0x3e28('0x10')][_0x2b9d05[_0x3e28('0x4d')]]=_0x3dd4ae;}}else{_0x69339c[_0x3e28('0x84')]=_0x3e28('0xa2')+_0x2b9d05[_0x3e28('0xa3')]['toUpperCase']();logger[_0x3e28('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x69339c[_0x3e28('0x50')],_0x69339c['type'],_0x69339c[_0x3e28('0x84')]);}}}this[_0x3e28('0x13')][_0x2b9d05[_0x3e28('0x4d')]]=_0x69339c;}}}catch(_0x380744){logger[_0x3e28('0x41')](_0x3e28('0x92'),_0x2b9d05['uniqueid'],util[_0x3e28('0x43')](_0x380744,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e28('0xb')]['syncVarSet']=function(_0x44d8db){try{if(this['isNotNull'](_0x44d8db)){logger[_0x3e28('0x4b')](_0x3e28('0xa4'),_0x44d8db[_0x3e28('0x4d')],util['inspect'](_0x44d8db,{'showHidden':![],'depth':null}));this[_0x3e28('0xa5')](_0x44d8db[_0x3e28('0x4d')],_['keys'](_0x44d8db['variable'])[0x0],_0x44d8db[_0x3e28('0xa6')]);if(this[_0x3e28('0x10')][_0x44d8db[_0x3e28('0x4d')]]){var _0x2b4402=_[_0x3e28('0x8b')](this[_0x3e28('0x10')][_0x44d8db['uniqueid']]);if(_0x2b4402){if(this[_0x3e28('0x5c')](_0x44d8db['variable'])&&this[_0x3e28('0x5c')](_0x44d8db[_0x3e28('0xa7')][_0x3e28('0x65')])){switch(_0x44d8db['value']){case _0x3e28('0xa8'):_0x2b4402[_0x3e28('0x9b')]=![];_0x2b4402[_0x3e28('0x95')]=null;break;case _0x3e28('0xa9'):_0x2b4402[_0x3e28('0xaa')]=_0x3e28('0xab');_0x2b4402['queuecallerexit']=!![];_0x2b4402['queuecallerexitAt']=moment()[_0x3e28('0x4e')](_0x3e28('0x78'));_0x2b4402[_0x3e28('0x8c')]=moment()['format'](_0x3e28('0x78'));logger[_0x3e28('0x4b')](_0x3e28('0xac'),_0x44d8db[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x2b4402,{'showHidden':![],'depth':null}));ami[_0x3e28('0x49')](_0x3e28('0xad'),_0x2b4402);break;default:_0x2b4402['queuecallerexit']=!![];_0x2b4402[_0x3e28('0x95')]=moment()[_0x3e28('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b4402['queuecallerleaveAt']=moment()['format'](_0x3e28('0x78'));}_0x2b4402[_0x3e28('0x21')]=![];_0x2b4402[_0x3e28('0x83')]=null;_0x2b4402[_0x3e28('0x84')]=_0x44d8db[_0x3e28('0xa6')];this[_0x3e28('0x13')][_0x44d8db[_0x3e28('0x4d')]]=_0x2b4402;this['emitVoiceQueueChannelRemove'](_0x2b4402,'varset');}else if(this[_0x3e28('0x5c')](_0x44d8db[_0x3e28('0xa7')])&&this[_0x3e28('0x5c')](_0x44d8db['variable'][_0x3e28('0xae')])){if(!_0x2b4402[_0x3e28('0x21')]){_0x2b4402[_0x3e28('0x9b')]=!![];_0x2b4402[_0x3e28('0x95')]=moment()[_0x3e28('0x4e')](_0x3e28('0x78'));_0x2b4402[_0x3e28('0x84')]=_0x3e28('0xaf');_0x2b4402['queuecallerleaveAt']=moment()[_0x3e28('0x4e')](_0x3e28('0x78'));this[_0x3e28('0x13')][_0x44d8db[_0x3e28('0x4d')]]=_0x2b4402;}}logger[_0x3e28('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x44d8db[_0x3e28('0x4d')],_0x2b4402[_0x3e28('0x50')],_0x2b4402[_0x3e28('0x57')],_[_0x3e28('0xb0')](_0x44d8db['variable'])[0x0],_0x44d8db[_0x3e28('0xa6')]);_0x2b4402[_0x3e28('0x17')]=this[_0x3e28('0x17')][_0x44d8db[_0x3e28('0x4d')]];}}}}catch(_0x46ef32){logger[_0x3e28('0x41')](_0x3e28('0xa4'),_0x44d8db[_0x3e28('0x4d')],util[_0x3e28('0x43')](_0x46ef32,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x2eda50,_0x2914a5,_0x405bb6){var _0x167429=[_0x3e28('0xb1'),_0x3e28('0xb2'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x3e28('0xb3'),_0x3e28('0xb4'),_0x3e28('0xb5'),_0x3e28('0xb6'),_0x3e28('0xb7'),_0x3e28('0xb8'),_0x3e28('0xb9'),_0x3e28('0xba'),'memberdynamic','memberinterface',_0x3e28('0xbb'),_0x3e28('0x94'),_0x3e28('0xbc'),_0x3e28('0xbd')];if(!_[_0x3e28('0xbe')](_0x2914a5)&&!_['includes'](_0x167429,_0x2914a5)){if(_['isUndefined'](this[_0x3e28('0x17')][_0x2eda50])){this[_0x3e28('0x17')][_0x2eda50]={};}this[_0x3e28('0x17')][_0x2eda50][_0x2914a5]=_0x405bb6;}};VoiceQueueReport[_0x3e28('0xb')][_0x3e28('0xbf')]=function(_0x11447d,_0x80bdf9,_0x125fed){var _0x1930b4={};for(var _0x36654d=0x0;_0x36654d0x0?!![]:![];if(!_0x516433){return this['syncQueueSummaryComplete'](this[_0x0ba7('0x15')][_0x0ba7('0x6d')]);}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0x1b')]=function(_0x97b509){var _0x2e4108=this[_0x0ba7('0x15')]['id'];if(this[_0x0ba7('0x15')][_0x0ba7('0x62')][_0x2e4108]&&this[_0x0ba7('0x15')]['queuestatus'][_0x2e4108][_0x97b509[_0x0ba7('0x61')]]){this['summary'][_0x0ba7('0x62')][_0x2e4108][_0x97b509[_0x0ba7('0x61')]]['agents'][_0x0ba7('0x6e')](_0x97b509);}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0x6f')]=function(_0x510092){var _0x476638=this;try{if(this[_0x0ba7('0x5b')](_0x510092)&&this['isNotNull'](_0x510092['queue'])){logger[_0x0ba7('0x50')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x0ba7('0x42')](_0x510092,{'showHidden':![],'depth':null}));var _0x1e0d3b=this[_0x0ba7('0x13')][_0x510092[_0x0ba7('0x53')]];if(_0x1e0d3b){logger[_0x0ba7('0x50')](_0x0ba7('0x70'),_0x1e0d3b[_0x0ba7('0x59')]);this[_0x0ba7('0x15')][_0x0ba7('0x5d')][_0x1e0d3b[_0x0ba7('0x59')]]={'summaryEvent':_0x510092};this[_0x0ba7('0x15')][_0x0ba7('0x6c')]+=0x1;return ami[_0x0ba7('0x3c')]({'action':_0x0ba7('0x62'),'queue':_0x1e0d3b['name']})[_0x0ba7('0x60')](function(_0x3cef13){if(!_0x476638[_0x0ba7('0x15')][_0x0ba7('0x62')][_0x510092[_0x0ba7('0x61')]]){_0x476638[_0x0ba7('0x15')][_0x0ba7('0x62')][_0x510092[_0x0ba7('0x61')]]={};}_0x476638[_0x0ba7('0x15')]['queuestatus'][_0x510092['actionid']][_0x3cef13['actionid']]={'queue':_0x1e0d3b['name'],'agents':[]};})[_0x0ba7('0x3d')](function(_0xbcbd53){throw _0xbcbd53;});}}}catch(_0x4ecccb){logger[_0x0ba7('0x40')](_0x0ba7('0x63'),util[_0x0ba7('0x42')](_0x4ecccb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0ba7('0x71')]=function(_0x475b83){if(this[_0x0ba7('0x15')][_0x0ba7('0x6c')]>0x0){this[_0x0ba7('0x15')][_0x0ba7('0x6d')]=_0x475b83;return;}logger[_0x0ba7('0x50')](_0x0ba7('0x72'),util[_0x0ba7('0x42')](_0x475b83,{'showHidden':![],'depth':null}));this[_0x0ba7('0x15')]=initializeSummary();ami[_0x0ba7('0x47')](_0x0ba7('0x73'),{});};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0x1e')]=function(_0x502e1f){try{if(this[_0x0ba7('0x5b')](_0x502e1f)){logger[_0x0ba7('0x50')](_0x0ba7('0x74'),_0x502e1f['uniqueid'],util[_0x0ba7('0x42')](_0x502e1f,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0ba7('0x75')][_0x502e1f['uniqueid']])){this[_0x0ba7('0x75')][_0x502e1f[_0x0ba7('0x4b')]]=[];}if(_['isUndefined'](this[_0x0ba7('0x11')][_0x502e1f[_0x0ba7('0x4b')]])){this[_0x0ba7('0x11')][_0x502e1f['uniqueid']]={};}var _0x18cb20=new QueueReport();_0x18cb20['queue']=_0x502e1f['queue'];_0x18cb20[_0x0ba7('0x57')]=this[_0x0ba7('0x13')][_0x18cb20[_0x0ba7('0x53')]]&&this[_0x0ba7('0x13')][_0x18cb20[_0x0ba7('0x53')]][_0x0ba7('0x57')]?this[_0x0ba7('0x13')][_0x18cb20[_0x0ba7('0x53')]]['type']||_0x0ba7('0x6a'):'inbound';_0x18cb20['queuecallerjoinAt']=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));_0x18cb20[_0x0ba7('0x77')]=_0x502e1f[_0x0ba7('0x77')];_0x18cb20[_0x0ba7('0x78')]=_0x502e1f[_0x0ba7('0x78')];_0x18cb20['uniqueid']=_0x502e1f['uniqueid'];_0x18cb20[_0x0ba7('0x79')]=this[_0x0ba7('0x11')][_0x502e1f[_0x0ba7('0x4b')]][_0x0ba7('0x79')];logger[_0x0ba7('0x7a')](_0x0ba7('0x7b'),_0x18cb20[_0x0ba7('0x53')],_0x18cb20[_0x0ba7('0x57')]);Object[_0x0ba7('0x69')](_0x18cb20,_[_0x0ba7('0x7c')](_0x502e1f,_[_0x0ba7('0x7d')](_0x18cb20)));this[_0x0ba7('0x75')][_0x502e1f[_0x0ba7('0x4b')]]['push'](_0x18cb20);this[_0x0ba7('0x11')][_0x502e1f['uniqueid']]=_0x18cb20;this[_0x0ba7('0x48')](_0x18cb20,_0x0ba7('0x7e'));}}catch(_0x2dda6c){logger[_0x0ba7('0x40')]('[%s][voiceQueueReport][queuecallerjoin]',_0x502e1f[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x2dda6c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0x20')]=function(_0x43cb7d){try{if(this[_0x0ba7('0x5b')](_0x43cb7d)){logger[_0x0ba7('0x50')]('[%s][voiceQueueReport][queuecallerabandon]',_0x43cb7d[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x43cb7d,{'showHidden':![],'depth':null}));if(this[_0x0ba7('0x75')][_0x43cb7d[_0x0ba7('0x4b')]]){var _0x53b5ee=_['last'](this[_0x0ba7('0x75')][_0x43cb7d[_0x0ba7('0x4b')]]);_0x53b5ee['queuecallercomplete']=![];_0x53b5ee[_0x0ba7('0x7f')]=null;_0x53b5ee[_0x0ba7('0x80')]=_0x43cb7d[_0x0ba7('0x80')];_0x53b5ee[_0x0ba7('0x81')]=_0x43cb7d['originalposition'];_0x53b5ee[_0x0ba7('0x1f')]=!![];_0x53b5ee[_0x0ba7('0x82')]=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));_0x53b5ee[_0x0ba7('0x83')]=_0x0ba7('0x84');_0x53b5ee[_0x0ba7('0x85')]=null;logger[_0x0ba7('0x7a')](_0x0ba7('0x86'),_0x53b5ee['queue'],_0x53b5ee[_0x0ba7('0x57')]);this[_0x0ba7('0x11')][_0x43cb7d[_0x0ba7('0x4b')]]=_0x53b5ee;this[_0x0ba7('0x4f')](_0x53b5ee,_0x0ba7('0x1f'));}}}catch(_0xf77e76){logger[_0x0ba7('0x40')](_0x0ba7('0x87'),_0x43cb7d[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0xf77e76,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x3bcf4a){try{if(this[_0x0ba7('0x5b')](_0x3bcf4a)){logger[_0x0ba7('0x50')]('[%s][voiceQueueReport][queuecallerleave]',_0x3bcf4a[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x3bcf4a,{'showHidden':![],'depth':null}));if(this[_0x0ba7('0x75')][_0x3bcf4a[_0x0ba7('0x4b')]]){var _0xd329ed=_['last'](this['queueReports'][_0x3bcf4a[_0x0ba7('0x4b')]]);_0xd329ed[_0x0ba7('0x88')]=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));_0xd329ed[_0x0ba7('0x89')]=_0x3bcf4a[_0x0ba7('0x89')];_0xd329ed[_0x0ba7('0x8a')]=_0x3bcf4a[_0x0ba7('0x8a')];logger['info'](_0x0ba7('0x8b'),_0xd329ed[_0x0ba7('0x53')],_0xd329ed[_0x0ba7('0x57')],_0x3bcf4a['connectedlinenum'],_0x3bcf4a[_0x0ba7('0x8a')]);this['channels'][_0x3bcf4a[_0x0ba7('0x4b')]]=_0xd329ed;this[_0x0ba7('0x48')](_0xd329ed,_0x0ba7('0x8c'));}}}catch(_0x3645c7){logger[_0x0ba7('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x3bcf4a['uniqueid'],util['inspect'](_0x3645c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0ba7('0x24')]=function(_0x3309ef){try{if(this[_0x0ba7('0x5b')](_0x3309ef)){logger[_0x0ba7('0x50')](_0x0ba7('0x8d'),_0x3309ef[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x3309ef,{'showHidden':![],'depth':null}));if(this[_0x0ba7('0x75')][_0x3309ef[_0x0ba7('0x4b')]]){var _0x1bc0fb=_[_0x0ba7('0x8e')](this[_0x0ba7('0x75')][_0x3309ef[_0x0ba7('0x4b')]]);_0x1bc0fb[_0x0ba7('0x38')]=!![];_0x1bc0fb[_0x0ba7('0x83')]=_0x0ba7('0x8f');logger['info'](_0x0ba7('0x90'),_0x1bc0fb[_0x0ba7('0x53')],_0x1bc0fb[_0x0ba7('0x57')]);}}}catch(_0x3660dd){logger[_0x0ba7('0x40')](_0x0ba7('0x8d'),_0x3309ef[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x3660dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0ba7('0x22')]=function(_0x9c1f9d){try{if(this[_0x0ba7('0x5b')](_0x9c1f9d)){logger[_0x0ba7('0x50')](_0x0ba7('0x91'),_0x9c1f9d[_0x0ba7('0x4b')],util['inspect'](_0x9c1f9d,{'showHidden':![],'depth':null}));if(this[_0x0ba7('0x75')][_0x9c1f9d[_0x0ba7('0x4b')]]){var _0x1d4ff2=_[_0x0ba7('0x8e')](this[_0x0ba7('0x75')][_0x9c1f9d[_0x0ba7('0x4b')]]);_0x1d4ff2['queuecallerabandon']=![];_0x1d4ff2[_0x0ba7('0x82')]=null;_0x1d4ff2['assigned']=!![];_0x1d4ff2[_0x0ba7('0x85')]=_0x9c1f9d[_0x0ba7('0x92')];_0x1d4ff2['holdtime']=_0x9c1f9d[_0x0ba7('0x80')];_0x1d4ff2['queuecallercomplete']=!![];_0x1d4ff2[_0x0ba7('0x37')]=![];_0x1d4ff2[_0x0ba7('0x93')]=null;if(!_0x1d4ff2['transfer']){if(_0x9c1f9d[_0x0ba7('0x94')]=='transfer'){_0x1d4ff2[_0x0ba7('0x83')]=_0x0ba7('0x95');logger[_0x0ba7('0x7a')](_0x0ba7('0x96'),_0x1d4ff2[_0x0ba7('0x53')],_0x1d4ff2['type']);}else{if(_[_0x0ba7('0x97')](_0x9c1f9d[_0x0ba7('0x98')][_0x0ba7('0x99')](),_0x0ba7('0x9a'))){if(this['queueReports'][_0x9c1f9d[_0x0ba7('0x9b')]]){var _0x4d7eb1=_[_0x0ba7('0x8e')](this[_0x0ba7('0x75')][_0x9c1f9d[_0x0ba7('0x9b')]]);_0x4d7eb1[_0x0ba7('0x38')]=![];_0x4d7eb1[_0x0ba7('0x37')]=!![];_0x4d7eb1['queuecallerexitAt']=moment(_0x1d4ff2[_0x0ba7('0x9c')])['add'](_0x9c1f9d[_0x0ba7('0x80')],_0x0ba7('0x9d'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4d7eb1[_0x0ba7('0x83')]=_0x0ba7('0x9e');_0x4d7eb1['transfer']=!![];_0x4d7eb1[_0x0ba7('0x9f')]=_0x0ba7('0xa0');_0x4d7eb1[_0x0ba7('0xa1')]=_0x9c1f9d[_0x0ba7('0xa2')];_0x4d7eb1[_0x0ba7('0xa3')]=_0x9c1f9d[_0x0ba7('0x4b')];logger[_0x0ba7('0x7a')](_0x0ba7('0xa4'),_0x4d7eb1['queue'],_0x4d7eb1[_0x0ba7('0x57')]);var _0x2a554b=this[_0x0ba7('0x75')][_0x9c1f9d[_0x0ba7('0x9b')]];this['queueReports'][_0x9c1f9d[_0x0ba7('0x9b')]]=this[_0x0ba7('0x75')][_0x9c1f9d['uniqueid']];this['queueReports'][_0x9c1f9d['uniqueid']]=_0x2a554b;}}else{_0x1d4ff2[_0x0ba7('0x83')]=_0x0ba7('0xa5')+_0x9c1f9d['reason']['toUpperCase']();logger[_0x0ba7('0x7a')](_0x0ba7('0xa6'),_0x1d4ff2[_0x0ba7('0x53')],_0x1d4ff2[_0x0ba7('0x57')],_0x1d4ff2['queuecallerexitreason']);}}}this['channels'][_0x9c1f9d[_0x0ba7('0x4b')]]=_0x1d4ff2;}}}catch(_0x43c24c){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x9c1f9d[_0x0ba7('0x4b')],util['inspect'](_0x43c24c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0x25')]=function(_0x21b932){try{if(this['isNotNull'](_0x21b932)){logger['debug'](_0x0ba7('0xa7'),_0x21b932[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x21b932,{'showHidden':![],'depth':null}));this[_0x0ba7('0xa8')](_0x21b932[_0x0ba7('0x4b')],_[_0x0ba7('0x7d')](_0x21b932[_0x0ba7('0xa9')])[0x0],_0x21b932[_0x0ba7('0xaa')]);if(this[_0x0ba7('0x75')][_0x21b932[_0x0ba7('0x4b')]]){var _0x11fa54=_['last'](this[_0x0ba7('0x75')][_0x21b932[_0x0ba7('0x4b')]]);if(_0x11fa54){if(this[_0x0ba7('0x5b')](_0x21b932[_0x0ba7('0xa9')])&&this[_0x0ba7('0x5b')](_0x21b932['variable'][_0x0ba7('0x62')])){switch(_0x21b932[_0x0ba7('0xaa')]){case _0x0ba7('0xab'):_0x11fa54[_0x0ba7('0x37')]=![];_0x11fa54[_0x0ba7('0x93')]=null;break;case'TIMEOUT':_0x11fa54[_0x0ba7('0xac')]=_0x0ba7('0xad');_0x11fa54['queuecallerexit']=!![];_0x11fa54[_0x0ba7('0x93')]=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));_0x11fa54[_0x0ba7('0x88')]=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));logger['debug'](_0x0ba7('0xae'),_0x21b932[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x11fa54,{'showHidden':![],'depth':null}));ami[_0x0ba7('0x47')](_0x0ba7('0xaf'),_0x11fa54);break;default:_0x11fa54[_0x0ba7('0x37')]=!![];_0x11fa54[_0x0ba7('0x93')]=moment()[_0x0ba7('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x11fa54['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x11fa54[_0x0ba7('0x1f')]=![];_0x11fa54[_0x0ba7('0x82')]=null;_0x11fa54['queuecallerexitreason']=_0x21b932['value'];this[_0x0ba7('0x11')][_0x21b932[_0x0ba7('0x4b')]]=_0x11fa54;this[_0x0ba7('0x4f')](_0x11fa54,_0x0ba7('0xb0'));}else if(this[_0x0ba7('0x5b')](_0x21b932[_0x0ba7('0xa9')])&&this['isNotNull'](_0x21b932[_0x0ba7('0xa9')][_0x0ba7('0xb1')])){if(!_0x11fa54[_0x0ba7('0x1f')]){_0x11fa54[_0x0ba7('0x37')]=!![];_0x11fa54['queuecallerexitAt']=moment()[_0x0ba7('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x11fa54[_0x0ba7('0x83')]='EXITWITHKEY';_0x11fa54[_0x0ba7('0x88')]=moment()[_0x0ba7('0x4c')](_0x0ba7('0x76'));this[_0x0ba7('0x11')][_0x21b932[_0x0ba7('0x4b')]]=_0x11fa54;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x21b932[_0x0ba7('0x4b')],_0x11fa54[_0x0ba7('0x53')],_0x11fa54['type'],_[_0x0ba7('0x7d')](_0x21b932[_0x0ba7('0xa9')])[0x0],_0x21b932[_0x0ba7('0xaa')]);_0x11fa54[_0x0ba7('0x16')]=this[_0x0ba7('0x16')][_0x21b932[_0x0ba7('0x4b')]];}}}}catch(_0x22dc5a){logger[_0x0ba7('0x40')](_0x0ba7('0xa7'),_0x21b932[_0x0ba7('0x4b')],util[_0x0ba7('0x42')](_0x22dc5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0xa8')]=function(_0x18dee0,_0x1b44de,_0x112a33){var _0x44e75d=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x0ba7('0xb2'),_0x0ba7('0xb3'),_0x0ba7('0xb4'),_0x0ba7('0xb5'),'sipcallid',_0x0ba7('0xb6'),_0x0ba7('0xb7'),_0x0ba7('0xb8'),_0x0ba7('0xb9'),_0x0ba7('0xba'),_0x0ba7('0xbb'),_0x0ba7('0xbc'),_0x0ba7('0x92'),_0x0ba7('0xbd'),_0x0ba7('0xbe')];if(!_[_0x0ba7('0x3b')](_0x1b44de)&&!_['includes'](_0x44e75d,_0x1b44de)){if(_[_0x0ba7('0x5c')](this[_0x0ba7('0x16')][_0x18dee0])){this['variables'][_0x18dee0]={};}this['variables'][_0x18dee0][_0x1b44de]=_0x112a33;}};VoiceQueueReport[_0x0ba7('0xb')][_0x0ba7('0xbf')]=function(_0x2b2619,_0x5aef41,_0x397d17){try{var _0x1a5f47={};if(this[_0x0ba7('0x75')][_0x2b2619]){for(var _0x49f525=0x0;_0x49f525=0x0?moment(_0x1dd270[_0x2ef4('0x18')])['diff'](_0x1dd270['starttime'],_0x2ef4('0xd')):null,'data1':_0x2ef4('0x1a'),'data2':_0x1dd270['accountcode'],'data3':_0x1dd270[_0x2ef4('0x10')],'data4':_0x1dd270[_0x2ef4('0x1b')]||null,'role':_0x2ef4('0x12'),'internal':_0x1dd270['accountcode']?_[_0x2ef4('0x1c')](_0x1dd270[_0x2ef4('0x13')]):undefined,'uniqueid':_0x1dd270[_0x2ef4('0x14')]},'log':_0x2ef4('0x15')});}; \ No newline at end of file +var _0x3193=['dialstring','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','interface','format','SIP/%s','lastAssignedTo','queuecallerleaveAt','seconds','calleridnum','queue','agent','accountcode','uniqueid','voiceDialReport','membername','endtime','diff','starttime','outbound','exten'];(function(_0x203e4d,_0x3eb287){var _0x3a886c=function(_0x4bf28c){while(--_0x4bf28c){_0x203e4d['push'](_0x203e4d['shift']());}};_0x3a886c(++_0x3eb287);}(_0x3193,0x1b1));var _0x3319=function(_0x3c9404,_0x577488){_0x3c9404=_0x3c9404-0x0;var _0x3bc3c0=_0x3193[_0x3c9404];return _0x3bc3c0;};'use strict';var moment=require(_0x3319('0x0'));var _=require(_0x3319('0x1'));var util=require(_0x3319('0x2'));var client=require('../client');exports[_0x3319('0x3')]=function(_0x2d0806){var _0x5b234a=_0x2d0806[_0x3319('0x4')]||_0x2d0806[_0x3319('0x5')];return client['Request'](_0x3319('0x6'),{'body':{'channel':_0x3319('0x7'),'membername':_0x2d0806['lastAssignedTo'],'interface':_['isNil'](_0x2d0806[_0x3319('0x8')])?util[_0x3319('0x9')](_0x3319('0xa'),_0x2d0806[_0x3319('0xb')]):_0x2d0806[_0x3319('0x8')],'type':'TALKING','enterAt':_0x2d0806[_0x3319('0xc')],'exitAt':_0x5b234a,'duration':moment(_0x5b234a)['diff'](_0x2d0806[_0x3319('0xc')],_0x3319('0xd')),'data1':'inbound','data2':_0x2d0806[_0x3319('0xe')],'data3':_0x2d0806['exten'],'data4':null,'data5':_0x2d0806[_0x3319('0xf')],'role':_0x3319('0x10'),'internal':_0x2d0806[_0x3319('0x11')]?_['toNumber'](_0x2d0806[_0x3319('0x11')]):undefined,'uniqueid':_0x2d0806[_0x3319('0x12')]},'log':_0x3319('0x6')});};exports[_0x3319('0x13')]=function(_0x180ef5){return client['Request'](_0x3319('0x6'),{'body':{'channel':_0x3319('0x7'),'membername':_0x180ef5[_0x3319('0x14')],'interface':_0x180ef5['interface'],'type':'TALKING','enterAt':_0x180ef5['starttime'],'exitAt':_0x180ef5[_0x3319('0x15')],'duration':moment(_0x180ef5['endtime'])[_0x3319('0x16')](_0x180ef5[_0x3319('0x17')],'seconds')>=0x0?moment(_0x180ef5[_0x3319('0x15')])[_0x3319('0x16')](_0x180ef5[_0x3319('0x17')],_0x3319('0xd')):null,'data1':_0x3319('0x18'),'data2':_0x180ef5[_0x3319('0x11')],'data3':_0x180ef5[_0x3319('0x19')],'data4':_0x180ef5[_0x3319('0x1a')]||null,'role':_0x3319('0x10'),'internal':_0x180ef5[_0x3319('0x11')]?_['toNumber'](_0x180ef5[_0x3319('0x11')]):undefined,'uniqueid':_0x180ef5[_0x3319('0x12')]},'log':_0x3319('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 14384f8..eed7e47 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 _0x0901=['stopRecordingOnTransfer','previewRecallmeReminderInterval','../client','getSettings','Request','ShowSetting'];(function(_0x191f8d,_0x326010){var _0x3d16d3=function(_0x2aca6a){while(--_0x2aca6a){_0x191f8d['push'](_0x191f8d['shift']());}};_0x3d16d3(++_0x326010);}(_0x0901,0x134));var _0x1090=function(_0x2d979c,_0x471653){_0x2d979c=_0x2d979c-0x0;var _0x3cf0ed=_0x0901[_0x2d979c];return _0x3cf0ed;};'use strict';var client=require(_0x1090('0x0'));exports[_0x1090('0x1')]=function(){return client[_0x1090('0x2')](_0x1090('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1090('0x4'),_0x1090('0x5')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x3080=['../client','getSettings','Request','ShowSetting','previewRecallmeReminderInterval','GetSettings'];(function(_0x16eb73,_0x11c17c){var _0x4c0bcf=function(_0x1bf45f){while(--_0x1bf45f){_0x16eb73['push'](_0x16eb73['shift']());}};_0x4c0bcf(++_0x11c17c);}(_0x3080,0x1e6));var _0x0308=function(_0x9fce09,_0x5adccb){_0x9fce09=_0x9fce09-0x0;var _0x19ac2b=_0x3080[_0x9fce09];return _0x19ac2b;};'use strict';var client=require(_0x0308('0x0'));exports[_0x0308('0x1')]=function(){return client[_0x0308('0x2')](_0x0308('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x0308('0x4')]},'log':_0x0308('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d7774a7..0425768 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 _0x98e5=['html','../client','Request','GetTemplate','name'];(function(_0x3a92e3,_0x417686){var _0x439cd9=function(_0x198621){while(--_0x198621){_0x3a92e3['push'](_0x3a92e3['shift']());}};_0x439cd9(++_0x417686);}(_0x98e5,0xa1));var _0x598e=function(_0x1aaa86,_0x306fbe){_0x1aaa86=_0x1aaa86-0x0;var _0xd0d2bc=_0x98e5[_0x1aaa86];return _0xd0d2bc;};'use strict';var client=require(_0x598e('0x0'));exports['getTemplates']=function(_0x8a3a42){return function(_0x3de04a){return client[_0x598e('0x1')](_0x598e('0x2'),{'options':{'raw':!![],'attributes':['id',_0x598e('0x3'),_0x598e('0x4')]},'log':_0x598e('0x2')});};}; \ No newline at end of file +var _0x1f65=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x4c68bd,_0x187912){var _0x2af91c=function(_0x53f13c){while(--_0x53f13c){_0x4c68bd['push'](_0x4c68bd['shift']());}};_0x2af91c(++_0x187912);}(_0x1f65,0x185));var _0x51f6=function(_0x33ac28,_0xbcde95){_0x33ac28=_0x33ac28-0x0;var _0x263076=_0x1f65[_0x33ac28];return _0x263076;};'use strict';var client=require(_0x51f6('0x0'));exports[_0x51f6('0x1')]=function(_0xdd6894){return function(_0x565034){return client[_0x51f6('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x51f6('0x3'),_0x51f6('0x4')]},'log':_0x51f6('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a077e83..fa61859 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 _0x0853=['operator','Actions','action','data1','data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','field','value'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x0853,0x1ee));var _0x3085=function(_0xaad8f5,_0x39bb11){_0xaad8f5=_0xaad8f5-0x0;var _0x4ab425=_0x0853[_0xaad8f5];return _0x4ab425;};'use strict';var client=require(_0x3085('0x0'));exports[_0x3085('0x1')]=function(_0x3506a2){return function(_0x1b1ade){return client[_0x3085('0x2')](_0x3085('0x3'),{'options':{'raw':![],'attributes':['id',_0x3085('0x4'),_0x3085('0x5'),_0x3085('0x6')],'include':[{'model':_0x3085('0x7'),'as':'AllConditions','attributes':['id',_0x3085('0x8'),'operator',_0x3085('0x9')]},{'model':_0x3085('0x7'),'as':'AnyConditions','attributes':['id',_0x3085('0x8'),_0x3085('0xa'),_0x3085('0x9')]},{'model':'Action','as':_0x3085('0xb'),'attributes':['id',_0x3085('0xc'),_0x3085('0xd'),'data2',_0x3085('0xe'),_0x3085('0xf'),'data5',_0x3085('0x10'),_0x3085('0x11')]}]},'log':_0x3085('0x3')});};}; \ No newline at end of file +var _0xc5ad=['field','operator','value','Actions','action','data1','data2','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition'];(function(_0x1a9390,_0x3339e6){var _0x2b4514=function(_0x1c07d5){while(--_0x1c07d5){_0x1a9390['push'](_0x1a9390['shift']());}};_0x2b4514(++_0x3339e6);}(_0xc5ad,0x1d4));var _0xdc5a=function(_0x34bf78,_0x52cffc){_0x34bf78=_0x34bf78-0x0;var _0x38cf0c=_0xc5ad[_0x34bf78];return _0x38cf0c;};'use strict';var client=require(_0xdc5a('0x0'));exports[_0xdc5a('0x1')]=function(_0x3f419e){return function(_0x3a2b24){return client[_0xdc5a('0x2')](_0xdc5a('0x3'),{'options':{'raw':![],'attributes':['id',_0xdc5a('0x4'),_0xdc5a('0x5'),_0xdc5a('0x6')],'include':[{'model':_0xdc5a('0x7'),'as':'AllConditions','attributes':['id',_0xdc5a('0x8'),_0xdc5a('0x9'),_0xdc5a('0xa')]},{'model':_0xdc5a('0x7'),'as':'AnyConditions','attributes':['id',_0xdc5a('0x8'),_0xdc5a('0x9'),_0xdc5a('0xa')]},{'model':'Action','as':_0xdc5a('0xb'),'attributes':['id',_0xdc5a('0xc'),_0xdc5a('0xd'),_0xdc5a('0xe'),'data3','data4','data5',_0xdc5a('0xf'),_0xdc5a('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d99a45d..1668e10 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 _0x5482=['Request','name','registry','../client','getTrunks'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x5482,0xf8));var _0x2548=function(_0x2370e3,_0x351059){_0x2370e3=_0x2370e3-0x0;var _0x5dd7c1=_0x5482[_0x2370e3];return _0x5dd7c1;};'use strict';var client=require(_0x2548('0x0'));exports[_0x2548('0x1')]=function(_0x30b2c6){return function(_0xb4bfcf){return client[_0x2548('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2548('0x3'),_0x2548('0x4'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x6a88=['defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x1c0781,_0x4a19f1){var _0x1f577e=function(_0x396577){while(--_0x396577){_0x1c0781['push'](_0x1c0781['shift']());}};_0x1f577e(++_0x4a19f1);}(_0x6a88,0xa9));var _0x86a8=function(_0x580e99,_0x32049e){_0x580e99=_0x580e99-0x0;var _0x217605=_0x6a88[_0x580e99];return _0x217605;};'use strict';var client=require(_0x86a8('0x0'));exports[_0x86a8('0x1')]=function(_0x4346ff){return function(_0x3c2a38){return client[_0x86a8('0x2')](_0x86a8('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x86a8('0x4'),'registry',_0x86a8('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index be58aa2..b0f57b2 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe706,0xa3));var _0x6e70=function(_0x58788d,_0x88b74f){_0x58788d=_0x58788d-0x0;var _0x58ceba=_0xe706[_0x58788d];return _0x58ceba;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x41725a,_0x2fc8b3){var _0x913b2d=function(_0x5c7e9e){while(--_0x5c7e9e){_0x41725a['push'](_0x41725a['shift']());}};_0x913b2d(++_0x2fc8b3);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 00f5e6d..c89b3bf 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 _0x1743=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1743,0x10d));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3174('0x0'));exports[_0x3174('0x1')]=function(_0x3e0954){return client[_0x3174('0x2')]('CreateVoiceAgentReport',{'body':_0x3e0954,'log':_0x3174('0x3')});};exports[_0x3174('0x4')]=function(_0x516f62,_0x1653c2,_0x44c3fb){return client[_0x3174('0x2')](_0x3174('0x5'),{'body':_0x516f62,'options':{'where':{'uniqueid':_0x1653c2,'interface':_0x44c3fb,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xe7c0=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xe7c0,0x141));var _0x0e7c=function(_0x15bf58,_0x170ea4){_0x15bf58=_0x15bf58-0x0;var _0x5d6c96=_0xe7c0[_0x15bf58];return _0x5d6c96;};'use strict';var client=require('../client');exports[_0x0e7c('0x0')]=function(_0x17823b){return client[_0x0e7c('0x1')](_0x0e7c('0x2'),{'body':_0x17823b,'log':_0x0e7c('0x2')});};exports['update']=function(_0x436b4d,_0x1c3746,_0x1d0a1f){return client[_0x0e7c('0x1')](_0x0e7c('0x3'),{'body':_0x436b4d,'options':{'where':{'uniqueid':_0x1c3746,'interface':_0x1d0a1f,'agentcomplete':!![]}},'log':_0x0e7c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8d591ea..3d504a0 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 _0x39c2=['GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration'];(function(_0x5aaeb4,_0xebdb28){var _0x592680=function(_0x28bb4c){while(--_0x28bb4c){_0x5aaeb4['push'](_0x5aaeb4['shift']());}};_0x592680(++_0xebdb28);}(_0x39c2,0x1a3));var _0x239c=function(_0x3fd4bc,_0x202472){_0x3fd4bc=_0x3fd4bc-0x0;var _0x4cd041=_0x39c2[_0x3fd4bc];return _0x4cd041;};'use strict';var moment=require(_0x239c('0x0'));var util=require(_0x239c('0x1'));var _=require(_0x239c('0x2'));var client=require('../client');exports[_0x239c('0x3')]=function(_0x56a59d){return client[_0x239c('0x4')](_0x239c('0x5'),{'body':_[_0x239c('0x6')](_0x56a59d,{'source':_0x56a59d['calleridnum'],'destinationcontext':_0x56a59d['context'],'callerid':_0x56a59d['callerid'],'amaflags':_0x239c('0x7')}),'log':_0x239c('0x5')});};exports[_0x239c('0x8')]=function(){return function(){return client[_0x239c('0x4')](_0x239c('0x9'),{'options':{'where':{'type':[_0x239c('0xa')],'createdAt':{'$between':[moment()[_0x239c('0xb')]('day')[_0x239c('0xc')](_0x239c('0xd')),moment()[_0x239c('0xe')]('day')[_0x239c('0xc')](_0x239c('0xd'))]}},'attributes':[_0x239c('0xf'),_0x239c('0x10'),_0x239c('0x11'),'billableseconds']},'log':_0x239c('0x12')});};}; \ No newline at end of file +var _0x1205=['type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format'];(function(_0x20aaf4,_0x472881){var _0x1bc34c=function(_0x3bd8ca){while(--_0x3bd8ca){_0x20aaf4['push'](_0x20aaf4['shift']());}};_0x1bc34c(++_0x472881);}(_0x1205,0x195));var _0x5120=function(_0x3c3149,_0x107a9f){_0x3c3149=_0x3c3149-0x0;var _0x584e62=_0x1205[_0x3c3149];return _0x584e62;};'use strict';var moment=require(_0x5120('0x0'));var util=require(_0x5120('0x1'));var _=require(_0x5120('0x2'));var client=require(_0x5120('0x3'));exports['create']=function(_0x13a183){return client[_0x5120('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x13a183,{'source':_0x13a183[_0x5120('0x5')],'destinationcontext':_0x13a183[_0x5120('0x6')],'callerid':_0x13a183['callerid'],'amaflags':_0x5120('0x7')}),'log':_0x5120('0x8')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x5120('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x5120('0x9')],'createdAt':{'$between':[moment()[_0x5120('0xa')](_0x5120('0xb'))['format'](_0x5120('0xc')),moment()[_0x5120('0xd')]('day')[_0x5120('0xe')](_0x5120('0xc'))]}},'attributes':[_0x5120('0xf'),_0x5120('0x10'),_0x5120('0x11'),_0x5120('0x12')]},'log':_0x5120('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 0f1312e..8b83f2e 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 _0xa8a4=['Request','CreateVoiceDialReport','create'];(function(_0x43225e,_0xba1210){var _0x5e6c0d=function(_0x19e910){while(--_0x19e910){_0x43225e['push'](_0x43225e['shift']());}};_0x5e6c0d(++_0xba1210);}(_0xa8a4,0x15e));var _0x4a8a=function(_0x18b5b3,_0x50cf3f){_0x18b5b3=_0x18b5b3-0x0;var _0x3c1040=_0xa8a4[_0x18b5b3];return _0x3c1040;};'use strict';var client=require('../client');exports[_0x4a8a('0x0')]=function(_0x113ab6){return client[_0x4a8a('0x1')](_0x4a8a('0x2'),{'body':_0x113ab6,'log':_0x4a8a('0x2')});}; \ No newline at end of file +var _0x51b2=['CreateVoiceDialReport','../client','create','Request'];(function(_0x4f88e5,_0x5f546d){var _0xe57f0d=function(_0x10691e){while(--_0x10691e){_0x4f88e5['push'](_0x4f88e5['shift']());}};_0xe57f0d(++_0x5f546d);}(_0x51b2,0x1ad));var _0x251b=function(_0x4b0008,_0x41218b){_0x4b0008=_0x4b0008-0x0;var _0x401c96=_0x51b2[_0x4b0008];return _0x401c96;};'use strict';var client=require(_0x251b('0x0'));exports[_0x251b('0x1')]=function(_0x1fd05c){return client[_0x251b('0x2')](_0x251b('0x3'),{'body':_0x1fd05c,'log':_0x251b('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index d0c2a13..3ba166e 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 _0xaa1b=['getVoiceExtensions','Request','exten','../client'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xbaa1('0x0'));exports[_0xbaa1('0x1')]=function(){return function(){return client[_0xbaa1('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xbaa1('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xbaa1('0x1')});};}; \ No newline at end of file +var _0x2917=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2917,0x142));var _0x7291=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x2917[_0xf4666e];return _0x1853f1;};'use strict';var client=require(_0x7291('0x0'));exports[_0x7291('0x1')]=function(){return function(){return client[_0x7291('0x2')](_0x7291('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7291('0x4'),_0x7291('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x7291('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b23af37..55faf47 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 _0x143b=['acwTimeout','autopause','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request','name','acw'];(function(_0x330562,_0x19a716){var _0xb12441=function(_0x3df07c){while(--_0x3df07c){_0x330562['push'](_0x330562['shift']());}};_0xb12441(++_0x19a716);}(_0x143b,0xef));var _0xb143=function(_0x267765,_0x4281a9){_0x267765=_0x267765-0x0;var _0x3dbe0b=_0x143b[_0x267765];return _0x3dbe0b;};'use strict';var client=require(_0xb143('0x0'));exports[_0xb143('0x1')]=function(){return function(){return client[_0xb143('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb143('0x3'),_0xb143('0x4'),_0xb143('0x5'),_0xb143('0x6'),'monitor_format',_0xb143('0x7'),'dialActive','dialMethod',_0xb143('0x8'),_0xb143('0x9'),_0xb143('0xa'),_0xb143('0xb'),_0xb143('0xc'),'dialPredictiveInterval',_0xb143('0xd'),_0xb143('0xe'),'dialOriginateTimeout',_0xb143('0xf'),_0xb143('0x10'),_0xb143('0x11'),'dialCongestionMaxRetry',_0xb143('0x12'),_0xb143('0x13'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xb143('0x14'),'dialGlobalMaxRetry',_0xb143('0x15'),_0xb143('0x16'),_0xb143('0x17'),_0xb143('0x18'),_0xb143('0x19'),_0xb143('0x1a'),_0xb143('0x1b'),_0xb143('0x1c'),_0xb143('0x1d'),_0xb143('0x1e'),_0xb143('0x1f'),_0xb143('0x20'),'dialAMDSilenceThreshold',_0xb143('0x21'),_0xb143('0x22'),_0xb143('0x23'),_0xb143('0x24'),'dialOrderByScheduledAt',_0xb143('0x25'),_0xb143('0x26'),_0xb143('0x27'),'monitor_format',_0xb143('0x28'),_0xb143('0x29'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xb143('0x2a'),_0xb143('0x2b'),_0xb143('0x2c'),_0xb143('0x2d'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0xb143('0x2e'),_0xb143('0x2f'),_0xb143('0x30'),_0xb143('0x31'),_0xb143('0x32'),_0xb143('0x33'),'dialPreviewAutoRecallMe',_0xb143('0x34')],'include':[{'model':_0xb143('0x35'),'as':_0xb143('0x35'),'attributes':['id',_0xb143('0x3'),'callerid',_0xb143('0x36')]},{'model':_0xb143('0x37'),'as':_0xb143('0x38'),'attributes':['id','name']},{'model':_0xb143('0x35'),'as':_0xb143('0x39'),'attributes':['id','name',_0xb143('0x3a'),_0xb143('0x36')]},{'model':_0xb143('0x3b'),'as':_0xb143('0x3b'),'attributes':['id',_0xb143('0x3')],'include':[{'model':_0xb143('0x3b'),'as':_0xb143('0x3c'),'attributes':['id',_0xb143('0x3'),'interval']}]}]},'log':_0xb143('0x1')});};}; \ No newline at end of file +var _0xb371=['name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Interval','Intervals','interval','getVoiceQueues','Request'];(function(_0x2fa27b,_0x38f64c){var _0x5c5fd6=function(_0xf628a1){while(--_0xf628a1){_0x2fa27b['push'](_0x2fa27b['shift']());}};_0x5c5fd6(++_0x38f64c);}(_0xb371,0x1a9));var _0x1b37=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xb371[_0x1e4360];return _0x31e6b4;};'use strict';var client=require('../client');exports[_0x1b37('0x0')]=function(){return function(){return client[_0x1b37('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x1b37('0x2'),_0x1b37('0x3'),_0x1b37('0x4'),_0x1b37('0x5'),_0x1b37('0x6'),_0x1b37('0x7'),_0x1b37('0x8'),_0x1b37('0x9'),'dialLimitChannel',_0x1b37('0xa'),_0x1b37('0xb'),_0x1b37('0xc'),_0x1b37('0xd'),_0x1b37('0xe'),_0x1b37('0xf'),_0x1b37('0x10'),_0x1b37('0x11'),_0x1b37('0x12'),_0x1b37('0x13'),_0x1b37('0x14'),_0x1b37('0x15'),_0x1b37('0x16'),_0x1b37('0x17'),_0x1b37('0x18'),_0x1b37('0x19'),_0x1b37('0x1a'),_0x1b37('0x1b'),'dialTimezone',_0x1b37('0x1c'),_0x1b37('0x1d'),'dialCheckDuplicateType',_0x1b37('0x1e'),'dialAMDInitialSilence',_0x1b37('0x1f'),'dialAMDAfterGreetingSilence',_0x1b37('0x20'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x1b37('0x21'),_0x1b37('0x22'),'dialAMDMaximumWordLength',_0x1b37('0x23'),_0x1b37('0x24'),'dialRecallInQueue',_0x1b37('0x25'),_0x1b37('0x26'),_0x1b37('0x27'),_0x1b37('0x28'),'monitor_format',_0x1b37('0x29'),_0x1b37('0x2a'),_0x1b37('0x2b'),_0x1b37('0x2c'),_0x1b37('0x2d'),'dialDropMaxRetry',_0x1b37('0x2e'),'dialAbandonedMaxRetry',_0x1b37('0x2f'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x1b37('0x30'),_0x1b37('0x31'),_0x1b37('0x32'),_0x1b37('0x33'),_0x1b37('0x34'),_0x1b37('0x35'),_0x1b37('0x36')],'include':[{'model':_0x1b37('0x37'),'as':_0x1b37('0x37'),'attributes':['id',_0x1b37('0x2'),_0x1b37('0x38'),_0x1b37('0x39')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x1b37('0x2')]},{'model':_0x1b37('0x37'),'as':'TrunkBackup','attributes':['id',_0x1b37('0x2'),_0x1b37('0x38'),_0x1b37('0x39')]},{'model':_0x1b37('0x3a'),'as':'Interval','attributes':['id',_0x1b37('0x2')],'include':[{'model':_0x1b37('0x3a'),'as':_0x1b37('0x3b'),'attributes':['id',_0x1b37('0x2'),_0x1b37('0x3c')]}]}]},'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 fe37550..d91a4b0 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(_0x593a99,_0x236c1d){var _0x3ebee8=function(_0x1eda93){while(--_0x1eda93){_0x593a99['push'](_0x593a99['shift']());}};_0x3ebee8(++_0x236c1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x308450,_0x47d83c){var _0x62fc54=function(_0x133e36){while(--_0x133e36){_0x308450['push'](_0x308450['shift']());}};_0x62fc54(++_0x47d83c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 c8d7238..0a82c7f 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 _0x6b7d=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b7d,0x1c8));var _0xd6b7=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6b7d[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0xd6b7('0x0'));exports['getVoiceQueueRtPauses']=function(_0x90f40f){return function(){return client[_0xd6b7('0x1')](_0xd6b7('0x2'),{'options':{'where':{'VoiceQueueId':_0x90f40f,'paused':!![]},'raw':!![]},'log':_0xd6b7('0x3')});};}; \ No newline at end of file +var _0xcc8f=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xcc8f,0x1e5));var _0xfcc8=function(_0x41e172,_0x4b0cf9){_0x41e172=_0x41e172-0x0;var _0x3cbda2=_0xcc8f[_0x41e172];return _0x3cbda2;};'use strict';var client=require(_0xfcc8('0x0'));exports[_0xfcc8('0x1')]=function(_0x478212){return function(){return client['Request'](_0xfcc8('0x2'),{'options':{'where':{'VoiceQueueId':_0x478212,'paused':!![]},'raw':!![]},'log':_0xfcc8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8e62778..47ad116 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(_0x21c71e,_0x26aac9){var _0x5b4f7b=function(_0x100901){while(--_0x100901){_0x21c71e['push'](_0x21c71e['shift']());}};_0x5b4f7b(++_0x26aac9);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x30b557,_0x57041b){var _0x286fe6=function(_0x2548f6){while(--_0x2548f6){_0x30b557['push'](_0x30b557['shift']());}};_0x286fe6(++_0x57041b);}(_0x7a54,0x106));var _0x47a5=function(_0x39a746,_0x4d6ff2){_0x39a746=_0x39a746-0x0;var _0x1588bc=_0x7a54[_0x39a746];return _0x1588bc;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 4cd5d7a..6a2ff21 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 _0xb018=['origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0xb018,0x1ee));var _0x8b01=function(_0x5e8dac,_0x561af5){_0x5e8dac=_0x5e8dac-0x0;var _0x1b0744=_0xb018[_0x5e8dac];return _0x1b0744;};'use strict';var client=require(_0x8b01('0x0'));exports[_0x8b01('0x1')]={};exports[_0x8b01('0x2')]=function(_0xf63100){return client[_0x8b01('0x3')](_0x8b01('0x4'),{'body':{'result':_0xf63100[_0x8b01('0x5')],'transfererchannel':_0xf63100['transfererchannel'],'transferercalleridnum':_0xf63100[_0x8b01('0x6')],'transferercalleridname':_0xf63100[_0x8b01('0x7')],'transfererconnectedlinenum':_0xf63100[_0x8b01('0x8')],'transfererconnectedlinename':_0xf63100[_0x8b01('0x9')],'transfereraccountcode':_0xf63100[_0x8b01('0xa')],'transferercontext':_0xf63100[_0x8b01('0xb')],'transfererexten':_0xf63100[_0x8b01('0xc')],'transfererlinkedid':_0xf63100[_0x8b01('0xd')],'transfereechannel':_0xf63100[_0x8b01('0xe')],'transfereecalleridnum':_0xf63100['transfereecalleridnum'],'transfereecalleridname':_0xf63100[_0x8b01('0xf')],'transfereeconnectedlinenum':_0xf63100[_0x8b01('0x10')],'transfereeconnectedlinename':_0xf63100['transfereeconnectedlinename'],'transfereeaccountcode':_0xf63100[_0x8b01('0x11')],'transfereecontext':_0xf63100[_0x8b01('0x12')],'transfereeexten':_0xf63100[_0x8b01('0x13')],'transfereelinkedid':_0xf63100[_0x8b01('0x14')],'isexternal':_0xf63100[_0x8b01('0x15')],'context':_0xf63100[_0x8b01('0x16')],'extension':_0xf63100['extension'],'type':_0x8b01('0x17')},'log':'CreateVoiceTransferReport'});};exports[_0x8b01('0x18')]=function(_0x14540f){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x14540f[_0x8b01('0x5')],'transfererchannel':_0x14540f[_0x8b01('0x19')],'transferercalleridnum':_0x14540f[_0x8b01('0x1a')],'transferercalleridname':_0x14540f[_0x8b01('0x1b')],'transfererconnectedlinenum':_0x14540f[_0x8b01('0x1c')],'transfererconnectedlinename':_0x14540f[_0x8b01('0x1d')],'transfereraccountcode':_0x14540f[_0x8b01('0x1e')],'transferercontext':_0x14540f['secondtransferercontext'],'transfererexten':_0x14540f['secondtransfererexten'],'transfererlinkedid':_0x14540f['origtransfererlinkedid'],'transfereechannel':_0x14540f[_0x8b01('0x1f')],'transfereecalleridnum':_0x14540f[_0x8b01('0x20')],'transfereecalleridname':_0x14540f[_0x8b01('0x21')],'transfereeconnectedlinenum':_0x14540f[_0x8b01('0x22')],'transfereeconnectedlinename':_0x14540f[_0x8b01('0x23')],'transfereeaccountcode':_0x14540f[_0x8b01('0x24')],'transfereecontext':_0x14540f[_0x8b01('0x25')],'transfereeexten':_0x14540f['transfertargetexten'],'transfereelinkedid':_0x14540f[_0x8b01('0x26')],'isexternal':_0x14540f[_0x8b01('0x15')],'context':_0x14540f[_0x8b01('0x27')],'extension':_0x14540f['origtransfererexten'],'type':_0x8b01('0x28')},'log':_0x8b01('0x4')});}; \ No newline at end of file +var _0xfd9c=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','Request','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x4702d5,_0x407c8a){var _0x30fd67=function(_0x2964ed){while(--_0x2964ed){_0x4702d5['push'](_0x4702d5['shift']());}};_0x30fd67(++_0x407c8a);}(_0xfd9c,0x102));var _0xcfd9=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0xfd9c[_0x334599];return _0x4cdff2;};'use strict';var client=require(_0xcfd9('0x0'));exports['transfers']={};exports['blindTransfer']=function(_0x2031f7){return client[_0xcfd9('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x2031f7[_0xcfd9('0x2')],'transfererchannel':_0x2031f7['transfererchannel'],'transferercalleridnum':_0x2031f7[_0xcfd9('0x3')],'transferercalleridname':_0x2031f7[_0xcfd9('0x4')],'transfererconnectedlinenum':_0x2031f7[_0xcfd9('0x5')],'transfererconnectedlinename':_0x2031f7[_0xcfd9('0x6')],'transfereraccountcode':_0x2031f7[_0xcfd9('0x7')],'transferercontext':_0x2031f7[_0xcfd9('0x8')],'transfererexten':_0x2031f7[_0xcfd9('0x9')],'transfererlinkedid':_0x2031f7[_0xcfd9('0xa')],'transfereechannel':_0x2031f7[_0xcfd9('0xb')],'transfereecalleridnum':_0x2031f7[_0xcfd9('0xc')],'transfereecalleridname':_0x2031f7[_0xcfd9('0xd')],'transfereeconnectedlinenum':_0x2031f7[_0xcfd9('0xe')],'transfereeconnectedlinename':_0x2031f7[_0xcfd9('0xf')],'transfereeaccountcode':_0x2031f7['transfereeaccountcode'],'transfereecontext':_0x2031f7['transfereecontext'],'transfereeexten':_0x2031f7[_0xcfd9('0x10')],'transfereelinkedid':_0x2031f7[_0xcfd9('0x11')],'isexternal':_0x2031f7[_0xcfd9('0x12')],'context':_0x2031f7[_0xcfd9('0x13')],'extension':_0x2031f7[_0xcfd9('0x14')],'type':_0xcfd9('0x15')},'log':_0xcfd9('0x16')});};exports[_0xcfd9('0x17')]=function(_0x2a4035){return client[_0xcfd9('0x1')](_0xcfd9('0x16'),{'body':{'result':_0x2a4035['result'],'transfererchannel':_0x2a4035[_0xcfd9('0x18')],'transferercalleridnum':_0x2a4035['origtransferercalleridnum'],'transferercalleridname':_0x2a4035[_0xcfd9('0x19')],'transfererconnectedlinenum':_0x2a4035[_0xcfd9('0x1a')],'transfererconnectedlinename':_0x2a4035[_0xcfd9('0x1b')],'transfereraccountcode':_0x2a4035[_0xcfd9('0x1c')],'transferercontext':_0x2a4035[_0xcfd9('0x1d')],'transfererexten':_0x2a4035[_0xcfd9('0x1e')],'transfererlinkedid':_0x2a4035[_0xcfd9('0x1f')],'transfereechannel':_0x2a4035[_0xcfd9('0x20')],'transfereecalleridnum':_0x2a4035[_0xcfd9('0x21')],'transfereecalleridname':_0x2a4035['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x2a4035[_0xcfd9('0x22')],'transfereeconnectedlinename':_0x2a4035['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2a4035[_0xcfd9('0x23')],'transfereecontext':_0x2a4035[_0xcfd9('0x24')],'transfereeexten':_0x2a4035[_0xcfd9('0x25')],'transfereelinkedid':_0x2a4035[_0xcfd9('0x26')],'isexternal':_0x2a4035[_0xcfd9('0x12')],'context':_0x2a4035['origtransferercontext'],'extension':_0x2a4035[_0xcfd9('0x27')],'type':_0xcfd9('0x28')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index ca0da7c..b88e19b 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 _0xcd59=['length','voicechannel','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','then','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','inbound','outbound','includes','type','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','QueuePause','isConnected','asterisk','username','keys','reload','action','Reload','Action','message','catch','error','ami\x20disconnected','join','pick','command','Command','content','voiceQueues','hasOwnProperty','push','find','undefined','values','channels'];(function(_0xa4c22,_0x249b91){var _0x3fba65=function(_0x2bd2f3){while(--_0x2bd2f3){_0xa4c22['push'](_0xa4c22['shift']());}};_0x3fba65(++_0x249b91);}(_0xcd59,0x14b));var _0x9cd5=function(_0x3ac946,_0x52a63a){_0x3ac946=_0x3ac946-0x0;var _0x10826c=_0xcd59[_0x3ac946];return _0x10826c;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var jayson=require(_0x9cd5('0x2'));var schema=require(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var config=require(_0x9cd5('0x5'));var properties=require('../properties');var ami=require(_0x9cd5('0x6'));var VoiceQueueSummary=require(_0x9cd5('0x7'));exports[_0x9cd5('0x8')]=function(_0x717731,_0x6acbef,_0x2db192){return new Promise(function(_0x46277c,_0x2cd19a){var _0x214256={'QueuePause':function(_0x3f888f){return new Promise(function(_0x545407){var _0x10162d=util[_0x9cd5('0x9')](_0x9cd5('0xa'),_0x9cd5('0xb'),_0x3f888f[_0x9cd5('0xc')]);if(_0x717731[_0x9cd5('0xd')]&&_0x717731[_0x9cd5('0xd')][_0x10162d]&&_0x717731[_0x9cd5('0xd')][_0x10162d]['timer']){_0x717731[_0x9cd5('0xd')][_0x10162d][_0x9cd5('0xe')]();}if(_0x717731[_0x9cd5('0xf')][_0x10162d]){_0x717731[_0x9cd5('0xf')][_0x10162d]['updateStatusRealtime']({'statePause':_0x3f888f['pause']?!![]:![]});}_0x545407({'code':0xc8,'message':_0x9cd5('0x10')});});},'Reload':function(_0x172e29){var _0x44518d=this;return new Promise(function(_0x407079,_0x2ccc05){if(ami[_0x9cd5('0x11')]()==![]){return _0x2ccc05(_0x44518d['error'](0x1f4,[config[_0x9cd5('0x12')]['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],'ami\x20disconnected']['join']('\x20')));}_0x172e29=_['pick'](_0x172e29,_[_0x9cd5('0x14')](properties[_0x9cd5('0x15')]['module']));_0x172e29[_0x9cd5('0x16')]=_0x9cd5('0x17');return ami[_0x9cd5('0x18')](_0x172e29)['then'](function(_0x1e921c){_0x407079({'code':0xc8,'message':_0x1e921c[_0x9cd5('0x19')]});})[_0x9cd5('0x1a')](function(_0x3a6f01){_0x2ccc05(_0x44518d[_0x9cd5('0x1b')](0x1f5,_0x3a6f01[_0x9cd5('0x19')]));});});},'Command':function(_0x5c1622){var _0x37ea13=this;return new Promise(function(_0x18346f,_0x3661b0){if(ami[_0x9cd5('0x11')]()==![]){return _0x3661b0(_0x37ea13[_0x9cd5('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],_0x9cd5('0x1c')][_0x9cd5('0x1d')]('\x20')));}_0x5c1622=_[_0x9cd5('0x1e')](_0x5c1622,_0x9cd5('0x1f'));_0x5c1622[_0x9cd5('0x16')]=_0x9cd5('0x20');return ami[_0x9cd5('0x18')](_0x5c1622)['then'](function(_0x297f0e){_0x18346f({'code':0xc8,'message':_0x297f0e[_0x9cd5('0x21')]});})[_0x9cd5('0x1a')](function(_0x43f47d){_0x3661b0(_0x37ea13['error'](0x1f5,_0x43f47d[_0x9cd5('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x990c25){var _0x211576=[];for(var _0xe36f86 in _0x717731[_0x9cd5('0x22')]){if(_0x717731[_0x9cd5('0x22')][_0x9cd5('0x23')](_0xe36f86)){var _0x4a245f=_0x717731[_0x9cd5('0x22')][_0xe36f86];var _0x64a1c4=new VoiceQueueSummary(_0x4a245f);_0x211576[_0x9cd5('0x24')](_0x64a1c4);}}_0x990c25({'count':_0x211576['length'],'rows':_0x211576});});},'UpdateVoiceQueue':function(_0x5c33e9){return new Promise(function(_0x2e45a3,_0x502257){var _0x52ef5d=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x22')],{'id':parseInt(_0x5c33e9['id'])});var _0x13e0d3=_['omit'](_0x5c33e9,['id']);if(_0x52ef5d){for(var _0x40461a in _0x13e0d3){if(typeof _0x13e0d3[_0x40461a]!==_0x9cd5('0x26')&&typeof _0x52ef5d[_0x40461a]!==_0x9cd5('0x26')){_0x52ef5d[_0x40461a]=_0x13e0d3[_0x40461a];}}_0x2e45a3(_0x52ef5d);}else{_0x502257();}});},'VoiceChannels':function(){return new Promise(function(_0x2689c7){var _0x8e3826=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x28')]);_0x2689c7({'count':_0x8e3826[_0x9cd5('0x29')],'rows':_0x8e3826});});},'VoiceChannelMixMonitor':function(_0x36b0ad){var _0x1c81fd=this;return new Promise(function(_0x3dc2c0,_0x4287bd){if(ami[_0x9cd5('0x11')]()==![]){return _0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f4,[config['asterisk']['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x101d99=schema(properties[_0x9cd5('0x2a')])['validate'](_0x36b0ad);if(_0x101d99[_0x9cd5('0x29')]>0x0){return _0x4287bd(_0x1c81fd['error'](0x1f4,_['map'](_0x101d99,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x3a071d=_[_0x9cd5('0x25')](_0x717731['channels'],{'uniqueid':_0x36b0ad[_0x9cd5('0x2b')]});if(_0x3a071d&&_0x3a071d[_0x9cd5('0x2c')]){var _0x403779=util['format'](_0x9cd5('0x2d'),_0x36b0ad[_0x9cd5('0x2e')]||_0x36b0ad[_0x9cd5('0x2b')],_0x36b0ad[_0x9cd5('0x9')]||_0x9cd5('0x2f'));return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x30'),'channel':_0x3a071d[_0x9cd5('0x2c')],'file':_0x403779,'options':_0x9cd5('0x31')})[_0x9cd5('0x32')](function(_0x3cbdba){var _0x5cb5b3=_[_0x9cd5('0x25')](_0x3a071d['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x403779[_0x9cd5('0x33')]()});if(_[_0x9cd5('0x34')](_0x5cb5b3)){_0x3a071d[_0x9cd5('0x35')][_0x9cd5('0x24')]({'filename':'/var/spool/asterisk/monitor/'+_0x403779[_0x9cd5('0x33')](),'createdAt':moment()[_0x9cd5('0x9')](_0x9cd5('0x36')),'mixmonitorid':_0x3cbdba[_0x9cd5('0x37')],'status':'rec'});}else{_0x5cb5b3[_0x9cd5('0x37')]=_0x3cbdba[_0x9cd5('0x37')];_0x5cb5b3[_0x9cd5('0x38')]=_0x9cd5('0x39');}_0x3dc2c0({'code':0xc8,'message':[_0x36b0ad[_0x9cd5('0x2b')],_0x9cd5('0x3a'),_0x3cbdba['mixmonitorid']][_0x9cd5('0x1d')]('\x20'),'mixmonitorid':_0x3cbdba[_0x9cd5('0x37')]});})[_0x9cd5('0x1a')](function(_0x4153b2){_0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f5,[_0x36b0ad[_0x9cd5('0x2b')],_0x4153b2[_0x9cd5('0x19')][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x4287bd(_0x1c81fd[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x3ed405){var _0x7ad8ec=this;return new Promise(function(_0xa12319,_0x3b316b){if(ami[_0x9cd5('0x11')]()==![]){return _0x3b316b(_0x7ad8ec[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config['asterisk'][_0x9cd5('0x13')],'ami\x20disconnected'][_0x9cd5('0x1d')]('\x20')));}var _0x2af5a5=schema(properties[_0x9cd5('0x2a')])[_0x9cd5('0x3')](_0x3ed405);if(_0x2af5a5[_0x9cd5('0x29')]>0x0){return _0x3b316b(_0x7ad8ec['error'](0x1f4,_[_0x9cd5('0x3c')](_0x2af5a5,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x54ffdf=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x28')],{'uniqueid':_0x3ed405[_0x9cd5('0x2b')]});if(_0x54ffdf){return Promise[_0x9cd5('0x3d')]()['then'](function(){if(_0x54ffdf[_0x9cd5('0x2c')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x3e'),'channel':_0x54ffdf[_0x9cd5('0x2c')],'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]})[_0x9cd5('0x1a')](function(){});}})[_0x9cd5('0x32')](function(){if(_0x54ffdf[_0x9cd5('0x3f')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x3e'),'channel':_0x54ffdf[_0x9cd5('0x3f')],'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]})[_0x9cd5('0x1a')](function(){});}})[_0x9cd5('0x32')](function(){var _0x245f9e=_[_0x9cd5('0x25')](_0x54ffdf[_0x9cd5('0x35')],{'mixmonitorid':_0x3ed405[_0x9cd5('0x37')]});if(_0x245f9e){_0x245f9e['status']=_0x9cd5('0x40');}})[_0x9cd5('0x32')](function(){var _0x3fead7=util[_0x9cd5('0x9')]('%s.%s',_0x3ed405[_0x9cd5('0x2e')]||_0x3ed405[_0x9cd5('0x2b')],_0x3ed405['format']||_0x9cd5('0x2f'));var _0x155652=_[_0x9cd5('0x25')](_0x54ffdf[_0x9cd5('0x35')],{'filename':_0x9cd5('0x41')+_0x3fead7[_0x9cd5('0x33')]()});if(_0x155652){_0x155652[_0x9cd5('0x38')]=_0x9cd5('0x40');}})['then'](function(){_0xa12319({'code':0xc8,'message':[_0x3ed405['uniqueid'],_0x9cd5('0x42')][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x22d74c){_0x3b316b(_0x7ad8ec['error'](0x1f5,[_0x3ed405[_0x9cd5('0x2b')],_0x22d74c['message']['toLowerCase']()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x3b316b(_0x7ad8ec[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannels':function(_0x5842cf){var _0x4453ab=this;return new Promise(function(_0x30c80f){var _0x310e4a=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x43')]);var _0x191099={'count':_0x310e4a['length'],'rows':_0x310e4a};if(_0x5842cf&&_0x5842cf['type']){if(![_0x9cd5('0x44'),_0x9cd5('0x45')][_0x9cd5('0x46')](_0x5842cf[_0x9cd5('0x47')])){return _0x2cd19a(_0x4453ab[_0x9cd5('0x1b')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x557076=_['filter'](_0x310e4a,function(_0x4cb835){return _0x4cb835[_0x9cd5('0x47')]===_0x5842cf[_0x9cd5('0x47')];});_0x191099[_0x9cd5('0x48')]=_0x557076[_0x9cd5('0x29')];_0x191099[_0x9cd5('0x49')]=_0x557076;}_0x30c80f(_0x191099);});},'VoiceQueuesChannel':function(_0x3d712f){var _0x27e27c=this;return new Promise(function(_0x32b294,_0x1249a7){var _0x426016=schema(properties[_0x9cd5('0x4a')])[_0x9cd5('0x3')](_0x3d712f);if(_0x426016[_0x9cd5('0x29')]>0x0){return _0x1249a7(_0x27e27c[_0x9cd5('0x1b')](0x1f4,_['map'](_0x426016,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x5cc62f=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x3d712f[_0x9cd5('0x2b')]});if(_0x5cc62f){_0x32b294(_0x5cc62f);}else{return _0x1249a7(_0x27e27c[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x2355e2){var _0x453edb=this;return new Promise(function(_0x54339d,_0x538ffa){if(ami[_0x9cd5('0x11')]()==![]){return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config[_0x9cd5('0x12')][_0x9cd5('0x13')],_0x9cd5('0x1c')][_0x9cd5('0x1d')]('\x20')));}var _0x30ac80=schema(properties[_0x9cd5('0x4b')])[_0x9cd5('0x3')](_0x2355e2);if(_0x30ac80[_0x9cd5('0x29')]>0x0){return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f4,_[_0x9cd5('0x3c')](_0x30ac80,_0x9cd5('0x19'))['join'](',\x20')));}var _0x5de02d=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x2355e2[_0x9cd5('0x2b')]});if(_0x5de02d&&_0x5de02d['channel']){return ami[_0x9cd5('0x18')]({'action':'Hangup','channel':_0x5de02d[_0x9cd5('0x2c')]})[_0x9cd5('0x32')](function(_0x1c58be){_0x54339d({'code':0xc8,'message':[_0x2355e2['uniqueid'],_0x1c58be[_0x9cd5('0x19')][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x42cbc6){_0x538ffa(_0x453edb['error'](0x1f5,[_0x2355e2[_0x9cd5('0x2b')],_0x42cbc6['message'][_0x9cd5('0x33')]()]['join']('\x20')));});}else{return _0x538ffa(_0x453edb[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'VoiceQueuesChannelRedirect':function(_0x263dbc){var _0x286ed4=this;return new Promise(function(_0x50c6fb,_0x19ea60){if(ami[_0x9cd5('0x11')]()==![]){return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f4,[config[_0x9cd5('0x12')]['ip'],config['asterisk'][_0x9cd5('0x13')],_0x9cd5('0x1c')]['join']('\x20')));}var _0x2feaf2=schema(properties[_0x9cd5('0x4c')])[_0x9cd5('0x3')](_0x263dbc);if(_0x2feaf2[_0x9cd5('0x29')]>0x0){return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f4,_['map'](_0x2feaf2,_0x9cd5('0x19'))[_0x9cd5('0x1d')](',\x20')));}var _0x3c7580=_[_0x9cd5('0x25')](_0x717731[_0x9cd5('0x43')],{'uniqueid':_0x263dbc[_0x9cd5('0x2b')]});if(_0x3c7580&&_0x3c7580[_0x9cd5('0x2c')]){return ami[_0x9cd5('0x18')]({'action':_0x9cd5('0x4d'),'channel':_0x3c7580['channel'],'exten':_0x263dbc[_0x9cd5('0x4e')],'context':_0x263dbc[_0x9cd5('0x4f')]||_0x3c7580['context'],'priority':0x1})['then'](function(_0xfb7889){_0x50c6fb({'code':0xc8,'message':[_0x263dbc[_0x9cd5('0x2b')],_0xfb7889['message']['toLowerCase']()][_0x9cd5('0x1d')]('\x20')});})[_0x9cd5('0x1a')](function(_0x71471c){_0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f5,[_0x263dbc['uniqueid'],_0x71471c['message'][_0x9cd5('0x33')]()][_0x9cd5('0x1d')]('\x20')));});}else{return _0x19ea60(_0x286ed4[_0x9cd5('0x1b')](0x1f5,_0x9cd5('0x3b')));}});},'Agents':function(_0x2a6f7f){return new Promise(function(_0xc67fc4){var _0x3a6ce6=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0xf')]);if(_0x2a6f7f&&_0x2a6f7f['id']){var _0x4deea5=_[_0x9cd5('0x25')](_0x3a6ce6,function(_0x4cff45){return _0x4cff45['id']===_0x2a6f7f['id'];});_0xc67fc4(_0x4deea5);}else{_0xc67fc4({'count':_0x3a6ce6[_0x9cd5('0x29')],'rows':_0x3a6ce6});}});},'Telephones':function(){return new Promise(function(_0x16c448){var _0x3dff12=_[_0x9cd5('0x27')](_0x717731['telephones']);_0x16c448({'count':_0x3dff12[_0x9cd5('0x29')],'rows':_0x3dff12});});},'Trunks':function(){return new Promise(function(_0x529cce){var _0x17b0ba=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x50')]);_0x529cce({'count':_0x17b0ba[_0x9cd5('0x29')],'rows':_0x17b0ba});});},'OutboundChannels':function(){return new Promise(function(_0x5ece56){var _0x3c7cc4=_[_0x9cd5('0x27')](_0x717731['outboundChannels']);_0x5ece56({'count':_0x3c7cc4[_0x9cd5('0x29')],'rows':_0x3c7cc4});});},'Outbound':function(){return new Promise(function(_0x59b3bd){_0x59b3bd(_0x717731[_0x9cd5('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x4ae570){var _0x4c4b07=_[_0x9cd5('0x27')](_0x717731[_0x9cd5('0x51')]);_0x4ae570({'count':_0x4c4b07[_0x9cd5('0x29')],'rows':_0x4c4b07});});},'VoiceQueuesPreview':function(_0x1a9cf3){var _0x2c7758=this;return new Promise(function(_0x35299b,_0x48362b){_0x6acbef[_0x9cd5('0x52')](_0x1a9cf3['id'])[_0x9cd5('0x32')](function(_0x441ceb){_0x35299b({'code':0xc8,'message':_0x441ceb['message']});})['catch'](function(_0x30023c){_0x48362b(_0x2c7758[_0x9cd5('0x1b')](0x1f4,_0x30023c[_0x9cd5('0x19')]));});});},'EventManager':function(_0x323ff3){var _0x806e1c=this;return new Promise(function(_0x42b6d0,_0x179b0c){if(!_0x323ff3[_0x9cd5('0x53')]){return _0x179b0c(_0x806e1c[_0x9cd5('0x1b')](0x1f4,_0x9cd5('0x54')));}ami['emit'](_0x9cd5('0x55')+_0x323ff3['event'],_0x323ff3[_0x9cd5('0x19')]);_0x42b6d0({'code':0xc8,'message':_0x323ff3});});},'FaxAccounts':function(){return new Promise(function(_0x19e545){var _0x3999ce=_['values'](_0x717731[_0x9cd5('0x56')]);_0x19e545({'count':_0x3999ce['length'],'rows':_0x3999ce});});},'SendFax':function(_0x4cb8d4){var _0x23ca99=this;return new Promise(function(_0xad48b,_0x1b38fa){_0x2db192[_0x9cd5('0x57')](_0x4cb8d4)[_0x9cd5('0x32')](function(_0x1c8e81){_0xad48b({'code':0xc8,'message':_0x1c8e81['message']});})[_0x9cd5('0x1a')](function(_0x2bf104){_0x1b38fa(_0x23ca99[_0x9cd5('0x1b')](0x1f4,_0x2bf104[_0x9cd5('0x19')]));});});},'CheckAfterSend':function(_0x48bfca){var _0x439640=this;return new Promise(function(_0x1f5dc4,_0x26aa91){_0x2db192[_0x9cd5('0x58')](_0x48bfca)[_0x9cd5('0x32')](function(_0x5a370c){_0x1f5dc4({'code':0xc8,'message':_0x5a370c[_0x9cd5('0x19')]});})[_0x9cd5('0x1a')](function(_0x23c68b){_0x26aa91(_0x439640[_0x9cd5('0x1b')](0x1f4,_0x23c68b['message']));});});}};var _0x12fb5b=jayson[_0x9cd5('0x59')](_0x214256)[_0x9cd5('0x5a')]();_0x12fb5b['on'](_0x9cd5('0x1b'),function(_0x367c7c){return _0x2cd19a(_0x367c7c);});_0x12fb5b[_0x9cd5('0x8')](0x232a,'127.0.0.1',function(){console[_0x9cd5('0x5b')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x46277c(_0x9cd5('0x5c')+0x232a);});});}; \ No newline at end of file +var _0xf2ca=['module','action','Reload','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','voicechannel','validate','map','uniqueid','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','Action','StopMixMonitor','stop','filename','StopMixMonitor\x20Success','queueChannels','type','inbound','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','lodash','util','jayson/promise','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','SIP','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','reload'];(function(_0x3ad06e,_0x2cc9af){var _0xa97338=function(_0x387190){while(--_0x387190){_0x3ad06e['push'](_0x3ad06e['shift']());}};_0xa97338(++_0x2cc9af);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0xf2ca[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var jayson=require(_0xaf2c('0x2'));var schema=require('validate');var moment=require(_0xaf2c('0x3'));var config=require(_0xaf2c('0x4'));var properties=require(_0xaf2c('0x5'));var ami=require(_0xaf2c('0x6'));var VoiceQueueSummary=require(_0xaf2c('0x7'));exports[_0xaf2c('0x8')]=function(_0x5b8c81,_0x1fd101,_0x100d17){return new Promise(function(_0x297740,_0x1f9531){var _0x58351f={'QueuePause':function(_0x37fedd){return new Promise(function(_0x3c0421){var _0x4a7397=util[_0xaf2c('0x9')]('%s/%s',_0xaf2c('0xa'),_0x37fedd['name']);if(_0x5b8c81[_0xaf2c('0xb')]&&_0x5b8c81[_0xaf2c('0xb')][_0x4a7397]&&_0x5b8c81[_0xaf2c('0xb')][_0x4a7397][_0xaf2c('0xc')]){_0x5b8c81['timers'][_0x4a7397]['updateAcw']();}if(_0x5b8c81[_0xaf2c('0xd')][_0x4a7397]){_0x5b8c81[_0xaf2c('0xd')][_0x4a7397][_0xaf2c('0xe')]({'statePause':_0x37fedd[_0xaf2c('0xf')]?!![]:![]});}_0x3c0421({'code':0xc8,'message':_0xaf2c('0x10')});});},'Reload':function(_0x59a59b){var _0x590126=this;return new Promise(function(_0x15ccb4,_0x8eaf9b){if(ami[_0xaf2c('0x11')]()==![]){return _0x8eaf9b(_0x590126[_0xaf2c('0x12')](0x1f4,[config[_0xaf2c('0x13')]['ip'],config[_0xaf2c('0x13')][_0xaf2c('0x14')],_0xaf2c('0x15')][_0xaf2c('0x16')]('\x20')));}_0x59a59b=_[_0xaf2c('0x17')](_0x59a59b,_[_0xaf2c('0x18')](properties[_0xaf2c('0x19')][_0xaf2c('0x1a')]));_0x59a59b[_0xaf2c('0x1b')]=_0xaf2c('0x1c');return ami['Action'](_0x59a59b)[_0xaf2c('0x1d')](function(_0x553163){_0x15ccb4({'code':0xc8,'message':_0x553163[_0xaf2c('0x1e')]});})[_0xaf2c('0x1f')](function(_0x1d544a){_0x8eaf9b(_0x590126['error'](0x1f5,_0x1d544a[_0xaf2c('0x1e')]));});});},'Command':function(_0x297bcd){var _0x1fec4c=this;return new Promise(function(_0x20000b,_0x3f977c){if(ami[_0xaf2c('0x11')]()==![]){return _0x3f977c(_0x1fec4c['error'](0x1f4,[config[_0xaf2c('0x13')]['ip'],config[_0xaf2c('0x13')][_0xaf2c('0x14')],_0xaf2c('0x15')][_0xaf2c('0x16')]('\x20')));}_0x297bcd=_['pick'](_0x297bcd,_0xaf2c('0x20'));_0x297bcd[_0xaf2c('0x1b')]=_0xaf2c('0x21');return ami['Action'](_0x297bcd)['then'](function(_0x29cbdf){_0x20000b({'code':0xc8,'message':_0x29cbdf[_0xaf2c('0x22')]});})[_0xaf2c('0x1f')](function(_0x99f78d){_0x3f977c(_0x1fec4c['error'](0x1f5,_0x99f78d[_0xaf2c('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0xf1a7cf){var _0x3a0145=[];for(var _0x3c1ae6 in _0x5b8c81[_0xaf2c('0x23')]){if(_0x5b8c81[_0xaf2c('0x23')][_0xaf2c('0x24')](_0x3c1ae6)){var _0x4a8dd8=_0x5b8c81[_0xaf2c('0x23')][_0x3c1ae6];var _0x2051be=new VoiceQueueSummary(_0x4a8dd8);_0x3a0145[_0xaf2c('0x25')](_0x2051be);}}_0xf1a7cf({'count':_0x3a0145[_0xaf2c('0x26')],'rows':_0x3a0145});});},'UpdateVoiceQueue':function(_0x4b7cf2){return new Promise(function(_0x3fb190,_0x589d47){var _0x38db1b=_[_0xaf2c('0x27')](_0x5b8c81[_0xaf2c('0x23')],{'id':parseInt(_0x4b7cf2['id'])});var _0x5d685a=_[_0xaf2c('0x28')](_0x4b7cf2,['id']);if(_0x38db1b){for(var _0x2ea490 in _0x5d685a){if(typeof _0x5d685a[_0x2ea490]!==_0xaf2c('0x29')&&typeof _0x38db1b[_0x2ea490]!=='undefined'){_0x38db1b[_0x2ea490]=_0x5d685a[_0x2ea490];}}_0x3fb190(_0x38db1b);}else{_0x589d47();}});},'VoiceChannels':function(){return new Promise(function(_0xe18ba7){var _0x32d95c=_[_0xaf2c('0x2a')](_0x5b8c81[_0xaf2c('0x2b')]);_0xe18ba7({'count':_0x32d95c['length'],'rows':_0x32d95c});});},'VoiceChannelMixMonitor':function(_0x3da072){var _0x4072ff=this;return new Promise(function(_0x1be1ef,_0x51a49c){if(ami['isConnected']()==![]){return _0x51a49c(_0x4072ff[_0xaf2c('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xaf2c('0x13')]['username'],_0xaf2c('0x15')][_0xaf2c('0x16')]('\x20')));}var _0x4ffbb9=schema(properties[_0xaf2c('0x2c')])[_0xaf2c('0x2d')](_0x3da072);if(_0x4ffbb9['length']>0x0){return _0x51a49c(_0x4072ff[_0xaf2c('0x12')](0x1f4,_[_0xaf2c('0x2e')](_0x4ffbb9,_0xaf2c('0x1e'))[_0xaf2c('0x16')](',\x20')));}var _0x2d6ed7=_[_0xaf2c('0x27')](_0x5b8c81['channels'],{'uniqueid':_0x3da072[_0xaf2c('0x2f')]});if(_0x2d6ed7&&_0x2d6ed7['channel']){var _0x321f7c=util['format'](_0xaf2c('0x30'),_0x3da072['filename']||_0x3da072[_0xaf2c('0x2f')],_0x3da072['format']||_0xaf2c('0x31'));return ami['Action']({'action':_0xaf2c('0x32'),'channel':_0x2d6ed7[_0xaf2c('0x33')],'file':_0x321f7c,'options':_0xaf2c('0x34')})[_0xaf2c('0x1d')](function(_0x470aff){var _0x598adb=_['find'](_0x2d6ed7[_0xaf2c('0x35')],{'filename':_0xaf2c('0x36')+_0x321f7c[_0xaf2c('0x37')]()});if(_[_0xaf2c('0x38')](_0x598adb)){_0x2d6ed7[_0xaf2c('0x35')][_0xaf2c('0x25')]({'filename':'/var/spool/asterisk/monitor/'+_0x321f7c[_0xaf2c('0x37')](),'createdAt':moment()[_0xaf2c('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x470aff[_0xaf2c('0x39')],'status':_0xaf2c('0x3a')});}else{_0x598adb[_0xaf2c('0x39')]=_0x470aff[_0xaf2c('0x39')];_0x598adb[_0xaf2c('0x3b')]=_0xaf2c('0x3a');}_0x1be1ef({'code':0xc8,'message':[_0x3da072[_0xaf2c('0x2f')],_0xaf2c('0x3c'),_0x470aff[_0xaf2c('0x39')]][_0xaf2c('0x16')]('\x20'),'mixmonitorid':_0x470aff[_0xaf2c('0x39')]});})[_0xaf2c('0x1f')](function(_0xaba85d){_0x51a49c(_0x4072ff['error'](0x1f5,[_0x3da072['uniqueid'],_0xaba85d['message'][_0xaf2c('0x37')]()][_0xaf2c('0x16')]('\x20')));});}else{return _0x51a49c(_0x4072ff[_0xaf2c('0x12')](0x1f5,_0xaf2c('0x3d')));}});},'VoiceChannelStopMixMonitor':function(_0x715f39){var _0x29460c=this;return new Promise(function(_0x51c441,_0x1d58bd){if(ami[_0xaf2c('0x11')]()==![]){return _0x1d58bd(_0x29460c[_0xaf2c('0x12')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xaf2c('0x14')],'ami\x20disconnected'][_0xaf2c('0x16')]('\x20')));}var _0x25ba26=schema(properties[_0xaf2c('0x2c')])[_0xaf2c('0x2d')](_0x715f39);if(_0x25ba26['length']>0x0){return _0x1d58bd(_0x29460c[_0xaf2c('0x12')](0x1f4,_['map'](_0x25ba26,_0xaf2c('0x1e'))[_0xaf2c('0x16')](',\x20')));}var _0x58bd9b=_[_0xaf2c('0x27')](_0x5b8c81['channels'],{'uniqueid':_0x715f39[_0xaf2c('0x2f')]});if(_0x58bd9b){return Promise[_0xaf2c('0x3e')]()[_0xaf2c('0x1d')](function(){if(_0x58bd9b[_0xaf2c('0x33')]){return ami[_0xaf2c('0x3f')]({'action':_0xaf2c('0x40'),'channel':_0x58bd9b[_0xaf2c('0x33')],'mixmonitorid':_0x715f39[_0xaf2c('0x39')]})[_0xaf2c('0x1f')](function(){});}})['then'](function(){if(_0x58bd9b['destinationchannel']){return ami[_0xaf2c('0x3f')]({'action':'StopMixMonitor','channel':_0x58bd9b['destinationchannel'],'mixmonitorid':_0x715f39['mixmonitorid']})[_0xaf2c('0x1f')](function(){});}})[_0xaf2c('0x1d')](function(){var _0x3cabd4=_[_0xaf2c('0x27')](_0x58bd9b['monitors'],{'mixmonitorid':_0x715f39[_0xaf2c('0x39')]});if(_0x3cabd4){_0x3cabd4['status']=_0xaf2c('0x41');}})['then'](function(){var _0x166c26=util[_0xaf2c('0x9')](_0xaf2c('0x30'),_0x715f39[_0xaf2c('0x42')]||_0x715f39[_0xaf2c('0x2f')],_0x715f39['format']||_0xaf2c('0x31'));var _0x26afee=_['find'](_0x58bd9b['monitors'],{'filename':_0xaf2c('0x36')+_0x166c26['toLowerCase']()});if(_0x26afee){_0x26afee[_0xaf2c('0x3b')]=_0xaf2c('0x41');}})[_0xaf2c('0x1d')](function(){_0x51c441({'code':0xc8,'message':[_0x715f39[_0xaf2c('0x2f')],_0xaf2c('0x43')][_0xaf2c('0x16')]('\x20')});})[_0xaf2c('0x1f')](function(_0x4473c9){_0x1d58bd(_0x29460c[_0xaf2c('0x12')](0x1f5,[_0x715f39[_0xaf2c('0x2f')],_0x4473c9[_0xaf2c('0x1e')]['toLowerCase']()][_0xaf2c('0x16')]('\x20')));});}else{return _0x1d58bd(_0x29460c[_0xaf2c('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x5175f8){var _0x56d7ce=this;return new Promise(function(_0x7ddca0){var _0x1f6907=_['values'](_0x5b8c81[_0xaf2c('0x44')]);var _0x2893c4={'count':_0x1f6907[_0xaf2c('0x26')],'rows':_0x1f6907};if(_0x5175f8&&_0x5175f8[_0xaf2c('0x45')]){if(![_0xaf2c('0x46'),_0xaf2c('0x47')][_0xaf2c('0x48')](_0x5175f8['type'])){return _0x1f9531(_0x56d7ce[_0xaf2c('0x12')](0x190,_0xaf2c('0x49')));}var _0x5771e5=_[_0xaf2c('0x4a')](_0x1f6907,function(_0x61442d){return _0x61442d[_0xaf2c('0x45')]===_0x5175f8[_0xaf2c('0x45')];});_0x2893c4[_0xaf2c('0x4b')]=_0x5771e5[_0xaf2c('0x26')];_0x2893c4[_0xaf2c('0x4c')]=_0x5771e5;}_0x7ddca0(_0x2893c4);});},'VoiceQueuesChannel':function(_0x15a335){var _0x19b82d=this;return new Promise(function(_0x300254,_0x133678){var _0x10a270=schema(properties[_0xaf2c('0x4d')])[_0xaf2c('0x2d')](_0x15a335);if(_0x10a270[_0xaf2c('0x26')]>0x0){return _0x133678(_0x19b82d[_0xaf2c('0x12')](0x1f4,_[_0xaf2c('0x2e')](_0x10a270,_0xaf2c('0x1e'))[_0xaf2c('0x16')](',\x20')));}var _0x23bf95=_['find'](_0x5b8c81[_0xaf2c('0x44')],{'uniqueid':_0x15a335[_0xaf2c('0x2f')]});if(_0x23bf95){_0x300254(_0x23bf95);}else{return _0x133678(_0x19b82d[_0xaf2c('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x22af48){var _0x5ed624=this;return new Promise(function(_0xc46f29,_0x2bce19){if(ami[_0xaf2c('0x11')]()==![]){return _0x2bce19(_0x5ed624[_0xaf2c('0x12')](0x1f4,[config[_0xaf2c('0x13')]['ip'],config[_0xaf2c('0x13')][_0xaf2c('0x14')],_0xaf2c('0x15')][_0xaf2c('0x16')]('\x20')));}var _0x580c2d=schema(properties[_0xaf2c('0x4e')])[_0xaf2c('0x2d')](_0x22af48);if(_0x580c2d[_0xaf2c('0x26')]>0x0){return _0x2bce19(_0x5ed624[_0xaf2c('0x12')](0x1f4,_[_0xaf2c('0x2e')](_0x580c2d,'message')[_0xaf2c('0x16')](',\x20')));}var _0x30dfeb=_['find'](_0x5b8c81[_0xaf2c('0x44')],{'uniqueid':_0x22af48[_0xaf2c('0x2f')]});if(_0x30dfeb&&_0x30dfeb['channel']){return ami['Action']({'action':_0xaf2c('0x4f'),'channel':_0x30dfeb[_0xaf2c('0x33')]})[_0xaf2c('0x1d')](function(_0x39c5d2){_0xc46f29({'code':0xc8,'message':[_0x22af48['uniqueid'],_0x39c5d2[_0xaf2c('0x1e')][_0xaf2c('0x37')]()]['join']('\x20')});})[_0xaf2c('0x1f')](function(_0x486b5a){_0x2bce19(_0x5ed624[_0xaf2c('0x12')](0x1f5,[_0x22af48[_0xaf2c('0x2f')],_0x486b5a[_0xaf2c('0x1e')][_0xaf2c('0x37')]()][_0xaf2c('0x16')]('\x20')));});}else{return _0x2bce19(_0x5ed624[_0xaf2c('0x12')](0x1f5,_0xaf2c('0x3d')));}});},'VoiceQueuesChannelRedirect':function(_0x25bdaa){var _0x1520ec=this;return new Promise(function(_0xc27601,_0x53ba41){if(ami[_0xaf2c('0x11')]()==![]){return _0x53ba41(_0x1520ec[_0xaf2c('0x12')](0x1f4,[config[_0xaf2c('0x13')]['ip'],config[_0xaf2c('0x13')][_0xaf2c('0x14')],'ami\x20disconnected'][_0xaf2c('0x16')]('\x20')));}var _0x28b09f=schema(properties[_0xaf2c('0x50')])[_0xaf2c('0x2d')](_0x25bdaa);if(_0x28b09f[_0xaf2c('0x26')]>0x0){return _0x53ba41(_0x1520ec['error'](0x1f4,_['map'](_0x28b09f,_0xaf2c('0x1e'))[_0xaf2c('0x16')](',\x20')));}var _0x5849f8=_[_0xaf2c('0x27')](_0x5b8c81[_0xaf2c('0x44')],{'uniqueid':_0x25bdaa[_0xaf2c('0x2f')]});if(_0x5849f8&&_0x5849f8['channel']){return ami[_0xaf2c('0x3f')]({'action':_0xaf2c('0x51'),'channel':_0x5849f8[_0xaf2c('0x33')],'exten':_0x25bdaa[_0xaf2c('0x52')],'context':_0x25bdaa['context']||_0x5849f8[_0xaf2c('0x53')],'priority':0x1})[_0xaf2c('0x1d')](function(_0x296c6b){_0xc27601({'code':0xc8,'message':[_0x25bdaa[_0xaf2c('0x2f')],_0x296c6b[_0xaf2c('0x1e')][_0xaf2c('0x37')]()][_0xaf2c('0x16')]('\x20')});})[_0xaf2c('0x1f')](function(_0x349dbb){_0x53ba41(_0x1520ec[_0xaf2c('0x12')](0x1f5,[_0x25bdaa[_0xaf2c('0x2f')],_0x349dbb['message'][_0xaf2c('0x37')]()]['join']('\x20')));});}else{return _0x53ba41(_0x1520ec[_0xaf2c('0x12')](0x1f5,_0xaf2c('0x3d')));}});},'Agents':function(_0x4e227a){return new Promise(function(_0x1b377c){var _0x5a95ac=_['values'](_0x5b8c81[_0xaf2c('0xd')]);if(_0x4e227a&&_0x4e227a['id']){var _0x1d73ef=_[_0xaf2c('0x27')](_0x5a95ac,function(_0x47c464){return _0x47c464['id']===_0x4e227a['id'];});_0x1b377c(_0x1d73ef);}else{_0x1b377c({'count':_0x5a95ac['length'],'rows':_0x5a95ac});}});},'Telephones':function(){return new Promise(function(_0x5a4716){var _0x103393=_[_0xaf2c('0x2a')](_0x5b8c81['telephones']);_0x5a4716({'count':_0x103393[_0xaf2c('0x26')],'rows':_0x103393});});},'Trunks':function(){return new Promise(function(_0x14931a){var _0x3700b8=_[_0xaf2c('0x2a')](_0x5b8c81[_0xaf2c('0x54')]);_0x14931a({'count':_0x3700b8[_0xaf2c('0x26')],'rows':_0x3700b8});});},'OutboundChannels':function(){return new Promise(function(_0x4be47b){var _0x4779a2=_[_0xaf2c('0x2a')](_0x5b8c81[_0xaf2c('0x55')]);_0x4be47b({'count':_0x4779a2['length'],'rows':_0x4779a2});});},'Outbound':function(){return new Promise(function(_0xc9dd21){_0xc9dd21(_0x5b8c81[_0xaf2c('0x47')]);});},'Campaigns':function(){return new Promise(function(_0x37ee02){var _0x577eaa=_[_0xaf2c('0x2a')](_0x5b8c81[_0xaf2c('0x56')]);_0x37ee02({'count':_0x577eaa[_0xaf2c('0x26')],'rows':_0x577eaa});});},'VoiceQueuesPreview':function(_0x5f705){var _0x491160=this;return new Promise(function(_0x286a40,_0x309532){_0x1fd101[_0xaf2c('0x57')](_0x5f705['id'])['then'](function(_0x5d0de0){_0x286a40({'code':0xc8,'message':_0x5d0de0[_0xaf2c('0x1e')]});})[_0xaf2c('0x1f')](function(_0x5571eb){_0x309532(_0x491160[_0xaf2c('0x12')](0x1f4,_0x5571eb[_0xaf2c('0x1e')]));});});},'EventManager':function(_0x5365fa){var _0x41e739=this;return new Promise(function(_0x31cf3e,_0x36e6a2){if(!_0x5365fa[_0xaf2c('0x58')]){return _0x36e6a2(_0x41e739[_0xaf2c('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xaf2c('0x59')+_0x5365fa[_0xaf2c('0x58')],_0x5365fa[_0xaf2c('0x1e')]);_0x31cf3e({'code':0xc8,'message':_0x5365fa});});},'FaxAccounts':function(){return new Promise(function(_0x4f378e){var _0xca027d=_[_0xaf2c('0x2a')](_0x5b8c81[_0xaf2c('0x5a')]);_0x4f378e({'count':_0xca027d[_0xaf2c('0x26')],'rows':_0xca027d});});},'SendFax':function(_0x39ddec){var _0x4b9fdc=this;return new Promise(function(_0x2da0ce,_0x21e494){_0x100d17[_0xaf2c('0x5b')](_0x39ddec)[_0xaf2c('0x1d')](function(_0x346060){_0x2da0ce({'code':0xc8,'message':_0x346060[_0xaf2c('0x1e')]});})['catch'](function(_0xd26d9a){_0x21e494(_0x4b9fdc[_0xaf2c('0x12')](0x1f4,_0xd26d9a['message']));});});},'CheckAfterSend':function(_0x5beb89){var _0x493e84=this;return new Promise(function(_0x2c4a8f,_0x1044ca){_0x100d17[_0xaf2c('0x5c')](_0x5beb89)[_0xaf2c('0x1d')](function(_0x499bbe){_0x2c4a8f({'code':0xc8,'message':_0x499bbe[_0xaf2c('0x1e')]});})[_0xaf2c('0x1f')](function(_0x2b57d2){_0x1044ca(_0x493e84[_0xaf2c('0x12')](0x1f4,_0x2b57d2['message']));});});}};var _0x1e8fc0=jayson[_0xaf2c('0x5d')](_0x58351f)[_0xaf2c('0x5e')]();_0x1e8fc0['on'](_0xaf2c('0x12'),function(_0x1c7e15){return _0x1f9531(_0x1c7e15);});_0x1e8fc0['listen'](0x232a,_0xaf2c('0x5f'),function(){console[_0xaf2c('0x60')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x297740('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 778995f..39c8c40 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 _0x2c8c=['info','[CM][%s][%s]','stringify','emit','data2','isNil','data5','xmd-contactid','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','ListId','scheduledAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x2c8c,0x1cb));var _0xc2c8=function(_0x3e2a96,_0x551263){_0x3e2a96=_0x3e2a96-0x0;var _0x3c139a=_0x2c8c[_0x3e2a96];return _0x3c139a;};'use strict';var _=require('lodash');var BPromise=require(_0xc2c8('0x0'));var Redis=require(_0xc2c8('0x1'));var util=require(_0xc2c8('0x2'));var config=require(_0xc2c8('0x3'));var logger=require(_0xc2c8('0x4'))(_0xc2c8('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xc2c8('0x6')]=_[_0xc2c8('0x7')](config[_0xc2c8('0x6')],{'host':_0xc2c8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc2c8('0x6')]));function emit(_0x3c9c1d,_0x24372c,_0x15d49c,_0x499471,_0x360d4f){logger[_0xc2c8('0x9')](_0xc2c8('0xa'),_0x3c9c1d,_0x24372c['id'],_0x15d49c,_0x499471,JSON[_0xc2c8('0xb')](_0x360d4f));io['to'](_0x15d49c)[_0xc2c8('0xc')](_0x499471,_0x360d4f);}exports['exec']=function(_0xf6318d,_0x36ab4,_0x419910,_0x2f97b4){var _0x238b68,_0x5e0843;var _0x2a9555={};var _0x483193;var _0x448341=Number(_0x419910['data1']);var _0x44605b=_0x419910[_0xc2c8('0xd')]?Boolean(Number(_0x419910['data2'])):![];var _0x4f5109;var _0x29a6dc=![];if(!_[_0xc2c8('0xe')](_0x419910[_0xc2c8('0xf')])){if(_0x419910[_0xc2c8('0xf')]=='1')_0x29a6dc=!![];}if(!_0x29a6dc){if(_0x2f97b4['xmd-contactid']){_0x2a9555['id']=_0x2f97b4[_0xc2c8('0x10')];}}if(!_0x2a9555['id']){_0x2a9555['ListId']=_0x448341;_0x4f5109=_0x419910[_0xc2c8('0x11')]&&_0x419910[_0xc2c8('0x11')]!=='0'?_0x419910[_0xc2c8('0x11')][_0xc2c8('0x12')](','):[_0xc2c8('0x13')];_0x2a9555['$or']=_[_0xc2c8('0x14')](_0x4f5109,function(_0x1abc11){var _0x29be2f={};_0x29be2f[_0x1abc11]=_0x2f97b4[_0xc2c8('0x15')]?_0x2f97b4[_0xc2c8('0x16')]:_0x2f97b4[_0xc2c8('0x17')];return _0x29be2f;});_0x483193=_0x2f97b4['routeId']?_0x2f97b4[_0xc2c8('0x16')]:_0x2f97b4[_0xc2c8('0x17')];}var _0x2540e4=['id',_0xc2c8('0x18'),'lastName',_0xc2c8('0x13'),_0xc2c8('0x19'),_0xc2c8('0x1a'),_0xc2c8('0x1b'),'createdAt',_0xc2c8('0x1c'),'updatedAt'];var _0xdc6e71=_[_0xc2c8('0x1d')](_0x2540e4,_0x4f5109);BPromise[_0xc2c8('0x1e')]()[_0xc2c8('0x1f')](cmContactRpc['getContacts']({'attributes':_0xdc6e71,'where':_0x2a9555,'phone':_0x483193}))['then'](function(_0x1eb994){_0x5e0843=_0x1eb994;if(!_[_0xc2c8('0x20')](_0x5e0843)){if(_0x5e0843[_0xc2c8('0x21')]===0x1){_0x238b68=_0x5e0843[0x0];logger[_0xc2c8('0x9')](_0xc2c8('0x22'),_0x2f97b4[_0xc2c8('0x23')],_0x36ab4['id'],_0x238b68['id']);}else{logger[_0xc2c8('0x9')](_0xc2c8('0x24'),_0x2f97b4[_0xc2c8('0x23')],_0x36ab4['id'],_[_0xc2c8('0x14')](_0x5e0843,'id')['join'](','));}return;}else{logger['info'](_0xc2c8('0x25'),_0x2f97b4[_0xc2c8('0x23')],_0x36ab4['id']);var _0x7ca480={'ListId':_0x448341};var _0x37c8c6=_0x419910[_0xc2c8('0x26')]&&_0x419910[_0xc2c8('0x26')]!=='0'?_0x419910[_0xc2c8('0x26')]:_0xc2c8('0x13');if(_0x44605b){logger[_0xc2c8('0x9')](_0xc2c8('0x27'),_0x2f97b4[_0xc2c8('0x23')],_0x36ab4['id']);_0x7ca480[_0x37c8c6]=_[_0xc2c8('0xe')](_0x2f97b4[_0xc2c8('0x15')])?_0x2f97b4[_0xc2c8('0x17')]:_0x2f97b4[_0xc2c8('0x16')];if(_[_0xc2c8('0xe')](_0x2f97b4[_0xc2c8('0x15')])){_0x7ca480[_0xc2c8('0x18')]=_0x2f97b4[_0xc2c8('0x28')]&&_0x2f97b4[_0xc2c8('0x28')]!==_0xc2c8('0x29')?_0x2f97b4[_0xc2c8('0x28')]:_0xc2c8('0x2a');}else{_0x7ca480['firstName']=_0x2f97b4['destcalleridname']&&_0x2f97b4['destcalleridname']!==_0xc2c8('0x29')?_0x2f97b4[_0xc2c8('0x2b')]:_0xc2c8('0x2a');}return BPromise[_0xc2c8('0x1e')]()[_0xc2c8('0x1f')](cmContactRpc['createContact'](_0x7ca480))[_0xc2c8('0x1f')](function(_0x37fad4){_0x238b68=_0x37fad4;_0x5e0843[_0xc2c8('0x2c')](_0x37fad4);if(_0x238b68){logger['info'](_0xc2c8('0x2d'),_0x2f97b4[_0xc2c8('0x23')],_0x36ab4['id'],_0x238b68['id']);}return;});}else{logger[_0xc2c8('0x9')](_0xc2c8('0x2e'),_0x2f97b4['uniqueid'],_0x36ab4['id']);_0x7ca480[_0x37c8c6]=_[_0xc2c8('0xe')](_0x2f97b4[_0xc2c8('0x15')])?_0x2f97b4[_0xc2c8('0x17')]:_0x2f97b4[_0xc2c8('0x16')];if(_['isNil'](_0x2f97b4['routeId'])){_0x7ca480[_0xc2c8('0x18')]=_0x2f97b4[_0xc2c8('0x28')]&&_0x2f97b4[_0xc2c8('0x28')]!==_0xc2c8('0x29')?_0x2f97b4[_0xc2c8('0x28')]:_0xc2c8('0x2a');}else{_0x7ca480[_0xc2c8('0x18')]=_0x2f97b4[_0xc2c8('0x2b')]&&_0x2f97b4[_0xc2c8('0x2b')]!==_0xc2c8('0x29')?_0x2f97b4['destcalleridname']:'Unknown';}_0x238b68=_0x7ca480;_0x5e0843[_0xc2c8('0x2c')](_0x7ca480);return;}}})[_0xc2c8('0x1f')](function(){if(_0xf6318d){emit(_0x2f97b4[_0xc2c8('0x23')],_0x36ab4,util[_0xc2c8('0x2f')](_0xc2c8('0x30'),_0xf6318d['name']),util[_0xc2c8('0x2f')](_0xc2c8('0x31'),_0x419910[_0xc2c8('0x32')]['toLowerCase']()),{'evt':_[_0xc2c8('0x33')](_0x2f97b4,{'autoCreate':_0x44605b}),'contact':_0x238b68===undefined?{}:_0x238b68,'contacts':_0x5e0843['length']===0x0?undefined:_0x5e0843});}});}; \ No newline at end of file +var _0x56d6=['getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','info','[CM][%s][%s]','emit','data1','data2','isNil','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then'];(function(_0xe3c682,_0x5eb40c){var _0x2d0c5f=function(_0xa08e10){while(--_0xa08e10){_0xe3c682['push'](_0xe3c682['shift']());}};_0x2d0c5f(++_0x5eb40c);}(_0x56d6,0x18e));var _0x656d=function(_0x8a55fc,_0x14eb6f){_0x8a55fc=_0x8a55fc-0x0;var _0x1f3a8c=_0x56d6[_0x8a55fc];return _0x1f3a8c;};'use strict';var _=require(_0x656d('0x0'));var BPromise=require(_0x656d('0x1'));var Redis=require(_0x656d('0x2'));var util=require(_0x656d('0x3'));var config=require(_0x656d('0x4'));var logger=require(_0x656d('0x5'))('trigger');var cmContactRpc=require(_0x656d('0x6'));config[_0x656d('0x7')]=_[_0x656d('0x8')](config[_0x656d('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x656d('0x7')]));function emit(_0x18c51d,_0xff9129,_0x5f55ed,_0xdb80dc,_0x2e3148){logger[_0x656d('0x9')](_0x656d('0xa'),_0x18c51d,_0xff9129['id'],_0x5f55ed,_0xdb80dc,JSON['stringify'](_0x2e3148));io['to'](_0x5f55ed)[_0x656d('0xb')](_0xdb80dc,_0x2e3148);}exports['exec']=function(_0x13a826,_0x5adaa5,_0x2323c1,_0x2afa6d){var _0x5af363,_0x20f5c9;var _0xa5b816={};var _0x244e87;var _0x528738=Number(_0x2323c1[_0x656d('0xc')]);var _0x86ed8c=_0x2323c1['data2']?Boolean(Number(_0x2323c1[_0x656d('0xd')])):![];var _0x3aeae9;var _0x3e7e27=![];if(!_[_0x656d('0xe')](_0x2323c1['data5'])){if(_0x2323c1['data5']=='1')_0x3e7e27=!![];}if(!_0x3e7e27){if(_0x2afa6d[_0x656d('0xf')]){_0xa5b816['id']=_0x2afa6d[_0x656d('0xf')];}}if(!_0xa5b816['id']){_0xa5b816[_0x656d('0x10')]=_0x528738;_0x3aeae9=_0x2323c1[_0x656d('0x11')]&&_0x2323c1['data3']!=='0'?_0x2323c1[_0x656d('0x11')][_0x656d('0x12')](','):['phone'];_0xa5b816['$or']=_[_0x656d('0x13')](_0x3aeae9,function(_0x3cdbe5){var _0x168452={};_0x168452[_0x3cdbe5]=_0x2afa6d[_0x656d('0x14')]?_0x2afa6d[_0x656d('0x15')]:_0x2afa6d[_0x656d('0x16')];return _0x168452;});_0x244e87=_0x2afa6d['routeId']?_0x2afa6d[_0x656d('0x15')]:_0x2afa6d[_0x656d('0x16')];}var _0x57bfaf=['id',_0x656d('0x17'),_0x656d('0x18'),_0x656d('0x19'),_0x656d('0x1a'),_0x656d('0x1b'),_0x656d('0x10'),_0x656d('0x1c'),_0x656d('0x1d'),_0x656d('0x1e')];var _0x1f8d79=_[_0x656d('0x1f')](_0x57bfaf,_0x3aeae9);BPromise[_0x656d('0x20')]()[_0x656d('0x21')](cmContactRpc[_0x656d('0x22')]({'attributes':_0x1f8d79,'where':_0xa5b816,'phone':_0x244e87}))['then'](function(_0x586ace){_0x20f5c9=_0x586ace;if(!_[_0x656d('0x23')](_0x20f5c9)){if(_0x20f5c9[_0x656d('0x24')]===0x1){_0x5af363=_0x20f5c9[0x0];logger['info'](_0x656d('0x25'),_0x2afa6d['uniqueid'],_0x5adaa5['id'],_0x5af363['id']);}else{logger[_0x656d('0x9')](_0x656d('0x26'),_0x2afa6d['uniqueid'],_0x5adaa5['id'],_[_0x656d('0x13')](_0x20f5c9,'id')[_0x656d('0x27')](','));}return;}else{logger[_0x656d('0x9')](_0x656d('0x28'),_0x2afa6d[_0x656d('0x29')],_0x5adaa5['id']);var _0x156950={'ListId':_0x528738};var _0x48b33d=_0x2323c1[_0x656d('0x2a')]&&_0x2323c1[_0x656d('0x2a')]!=='0'?_0x2323c1[_0x656d('0x2a')]:'phone';if(_0x86ed8c){logger['info'](_0x656d('0x2b'),_0x2afa6d[_0x656d('0x29')],_0x5adaa5['id']);_0x156950[_0x48b33d]=_['isNil'](_0x2afa6d[_0x656d('0x14')])?_0x2afa6d[_0x656d('0x16')]:_0x2afa6d[_0x656d('0x15')];if(_[_0x656d('0xe')](_0x2afa6d[_0x656d('0x14')])){_0x156950[_0x656d('0x17')]=_0x2afa6d[_0x656d('0x2c')]&&_0x2afa6d[_0x656d('0x2c')]!==_0x656d('0x2d')?_0x2afa6d[_0x656d('0x2c')]:'Unknown';}else{_0x156950[_0x656d('0x17')]=_0x2afa6d[_0x656d('0x2e')]&&_0x2afa6d['destcalleridname']!==_0x656d('0x2d')?_0x2afa6d['destcalleridname']:_0x656d('0x2f');}return BPromise[_0x656d('0x20')]()[_0x656d('0x21')](cmContactRpc[_0x656d('0x30')](_0x156950))[_0x656d('0x21')](function(_0x5347c4){_0x5af363=_0x5347c4;_0x20f5c9[_0x656d('0x31')](_0x5347c4);if(_0x5af363){logger[_0x656d('0x9')](_0x656d('0x32'),_0x2afa6d[_0x656d('0x29')],_0x5adaa5['id'],_0x5af363['id']);}return;});}else{logger['info'](_0x656d('0x33'),_0x2afa6d[_0x656d('0x29')],_0x5adaa5['id']);_0x156950[_0x48b33d]=_['isNil'](_0x2afa6d[_0x656d('0x14')])?_0x2afa6d[_0x656d('0x16')]:_0x2afa6d[_0x656d('0x15')];if(_[_0x656d('0xe')](_0x2afa6d[_0x656d('0x14')])){_0x156950[_0x656d('0x17')]=_0x2afa6d['calleridname']&&_0x2afa6d[_0x656d('0x2c')]!==_0x656d('0x2d')?_0x2afa6d['calleridname']:_0x656d('0x2f');}else{_0x156950['firstName']=_0x2afa6d[_0x656d('0x2e')]&&_0x2afa6d[_0x656d('0x2e')]!==_0x656d('0x2d')?_0x2afa6d[_0x656d('0x2e')]:_0x656d('0x2f');}_0x5af363=_0x156950;_0x20f5c9[_0x656d('0x31')](_0x156950);return;}}})[_0x656d('0x21')](function(){if(_0x13a826){emit(_0x2afa6d[_0x656d('0x29')],_0x5adaa5,util[_0x656d('0x34')](_0x656d('0x35'),_0x13a826['name']),util[_0x656d('0x34')]('trigger:%s',_0x2323c1['action']['toLowerCase']()),{'evt':_['merge'](_0x2afa6d,{'autoCreate':_0x86ed8c}),'contact':_0x5af363===undefined?{}:_0x5af363,'contacts':_0x20f5c9[_0x656d('0x24')]===0x0?undefined:_0x20f5c9});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4b2e9d1..69b6c11 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 _0xea4e=['ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','agent','membername','lastevent','mailSubstatus','null','substatus','created','equals','exports','util','ioredis','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','status','merge','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','trigger:%s','integration','queue','routeId','urlforward','exec','script','parse','query','search','replace','checkTrigger','channel','AllConditions','checkConditions','AnyConditions','some','evt','chat'];(function(_0x26ab12,_0x20b016){var _0x52ae8a=function(_0x459dc9){while(--_0x459dc9){_0x26ab12['push'](_0x26ab12['shift']());}};_0x52ae8a(++_0x20b016);}(_0xea4e,0x10c));var _0xeea4=function(_0x97d4b6,_0x1b8eab){_0x97d4b6=_0x97d4b6-0x0;var _0x364238=_0xea4e[_0x97d4b6];return _0x364238;};'use strict';var util=require(_0xeea4('0x0'));var _=require('lodash');var url=require('url');var Mustache=require('mustache');var Redis=require(_0xeea4('0x1'));var urlforward=require('./urlforward');var integration=require(_0xeea4('0x2'));var cmContact=require(_0xeea4('0x3'));var script=require('./script');var config=require(_0xeea4('0x4'));var logger=require(_0xeea4('0x5'))(_0xeea4('0x6'));var ami=require(_0xeea4('0x7'));config[_0xeea4('0x8')]=_[_0xeea4('0x9')](config[_0xeea4('0x8')],{'host':_0xeea4('0xa'),'port':0x18eb});var io=require(_0xeea4('0xb'))(new Redis(config['redis']));var operators={'equals':function(_0xc649e,_0x5b95b9){return _0xc649e==_0x5b95b9;},'not_equals':function(_0x3a4953,_0x114d6e){return _0x3a4953!=_0x114d6e;}};var barAndWebActions=[_0xeea4('0xc'),_0xeea4('0xd'),_0xeea4('0xe')];function Trigger(_0x3f9846){this[_0xeea4('0xf')]=_0x3f9846[_0xeea4('0xf')];this['agents']=_0x3f9846[_0xeea4('0x10')];this['voiceQueues']=_0x3f9846[_0xeea4('0x11')];this[_0xeea4('0x12')]=_0x3f9846[_0xeea4('0x12')];this[_0xeea4('0x13')]=_0x3f9846[_0xeea4('0x13')];this[_0xeea4('0x14')]=_0x3f9846[_0xeea4('0x14')];this[_0xeea4('0x15')]=_0x3f9846['freshdeskAccounts'];this[_0xeea4('0x16')]=_0x3f9846[_0xeea4('0x16')];this['sugarcrmAccounts']=_0x3f9846[_0xeea4('0x17')];this['zohoAccounts']=_0x3f9846[_0xeea4('0x18')];this[_0xeea4('0x19')]=_0x3f9846[_0xeea4('0x19')];this[_0xeea4('0x1a')]=_0x3f9846[_0xeea4('0x1a')];this[_0xeea4('0x1b')]=_0x3f9846[_0xeea4('0x1b')];this[_0xeea4('0x1c')]=_0x3f9846[_0xeea4('0x1c')];this[_0xeea4('0x1d')]=_0x3f9846['freshsalesAccounts'];this[_0xeea4('0x1e')]={'zendesk':this[_0xeea4('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xeea4('0x15')],'sugarcrm':this[_0xeea4('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0xeea4('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xeea4('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0xeea4('0x1f'),this['syncCustomEvent'][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x21'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x23'),this['syncCustomEvent'][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x24'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on']('custom:agentnosuchnumber',this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x25'),this[_0xeea4('0x22')]['bind'](this));ami['on']('custom:agentbusy',this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x26'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on']('custom:agentreject',this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on']('custom:amd',this[_0xeea4('0x22')]['bind'](this));ami['on'](_0xeea4('0x27'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x28'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x29'),this['syncAgentDial'][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x2a'),this['syncAgentDial']['bind'](this));ami['on']('custom:dialend',this[_0xeea4('0x2b')]['bind'](this));ami['on'](_0xeea4('0x2c'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x2d'),this[_0xeea4('0x22')]['bind'](this));ami['on'](_0xeea4('0x2e'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on']('custom:incomingmessage',this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x2f'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x30'),this[_0xeea4('0x22')][_0xeea4('0x20')](this));ami['on'](_0xeea4('0x31'),this[_0xeea4('0x22')]['bind'](this));ami['on']('custom:offlineMessage',this[_0xeea4('0x22')][_0xeea4('0x20')](this));}Trigger[_0xeea4('0x32')][_0xeea4('0x33')]=function(_0x15be79,_0x407357,_0x32d357){logger['info'](_0x15be79,_0x407357,JSON[_0xeea4('0x34')](_0x32d357));io['to'](_0x15be79)[_0xeea4('0x33')](_0x407357,_0x32d357);};Trigger[_0xeea4('0x32')]['syncCustomEvent']=function(_0xe42454){var _0x43bf75=_['clone'](_0xe42454);if(typeof _0x43bf75[_0xeea4('0x35')]===_0xeea4('0x36')){_0x43bf75[_0xeea4('0x35')]=_0xeea4('0x37');}logger[_0xeea4('0x38')](_0xeea4('0x22'),util[_0xeea4('0x39')](_0x43bf75,{'showHidden':!![],'depth':null}));this[_0xeea4('0x3a')](_0x43bf75);};Trigger['prototype'][_0xeea4('0x2b')]=function(_0x1091a2){if(this['agents'][_0x1091a2[_0xeea4('0x3b')]]){this[_0xeea4('0x22')](_0x1091a2);}};Trigger[_0xeea4('0x32')][_0xeea4('0x3a')]=function(_0x3a0cff){var _0x3981fd;for(var _0x129ba4 in this['triggers']){if(this[_0xeea4('0xf')][_0xeea4('0x3c')](_0x129ba4)){if(this['triggers'][_0x129ba4][_0xeea4('0x3d')]){_0x3981fd=this['checkTrigger'](this[_0xeea4('0xf')][_0x129ba4],_0x3a0cff);if(_0x3981fd){_[_0xeea4('0x3e')](_0x3a0cff,_0x3a0cff['variables']);for(var _0x5d16bd=0x0,_0x141f2f,_0x4d1512,_0xae9f6c;_0x5d16bd0x0){_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 +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x1b43c2,_0x4f227c){var _0x39bd3a=function(_0xf7cc2){while(--_0xf7cc2){_0x1b43c2['push'](_0x1b43c2['shift']());}};_0x39bd3a(++_0x4f227c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 6bbd095..3af9c18 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 _0x6517=[']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name','request-promise','./util','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','clientId','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','then','value','isNil','validateEmail','email','userEmail','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','internalemailaddress','username','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','message','outbound','&$filter=','\x20eq\x20\x27','replace','%2b','contactid',']\x20Enduser\x20created!','enduserId','forEach','includes','string','picklist','nameField','customField','idField','toLowerCase','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Descriptions','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','modernAuthentication','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x6517,0x6f));var _0x7651=function(_0x39e251,_0xbe6299){_0x39e251=_0x39e251-0x0;var _0x4f76cc=_0x6517[_0x39e251];return _0x4f76cc;};'use strict';var _=require('lodash');var rp=require(_0x7651('0x0'));var util=require('util');var intUtil=require(_0x7651('0x1'));var md5=require('md5');var Redis=require(_0x7651('0x2'));var logger=require(_0x7651('0x3'))(_0x7651('0x4'));var config=require('../../../../config/environment');config[_0x7651('0x5')]=_['defaults'](config['redis'],{'host':_0x7651('0x6'),'port':0x18eb});var io=require(_0x7651('0x7'))(new Redis(config['redis']));function getAuthToken(_0x5f2ba3,_0x445e9d,_0x406b40){if(_0x5f2ba3['modernAuthentication']){_0x5f2ba3[_0x7651('0x8')]=_0x5f2ba3[_0x7651('0x9')][_0x7651('0xa')];_0x5f2ba3[_0x7651('0xb')]=_0x5f2ba3['CloudProvider'][_0x7651('0xc')];return Promise[_0x7651('0xd')](_0x5f2ba3[_0x7651('0x9')]['data5']);}var _0x435074={'method':_0x7651('0xe'),'uri':_0x445e9d,'form':{'client_id':_0x5f2ba3[_0x7651('0xf')],'resource':_0x5f2ba3[_0x7651('0x8')],'username':_0x5f2ba3['username'],'password':_0x5f2ba3[_0x7651('0x10')],'grant_type':'password','client_secret':_0x5f2ba3[_0x7651('0x11')]},'json':!![]};return rp(_0x435074)['then'](function(_0x312dfd){return _0x312dfd[_0x7651('0x12')];})[_0x7651('0x13')](function(_0xf9349){logger[_0x7651('0x14')]('['+[_0x406b40[_0x7651('0x15')]()]+_0x7651('0x16'));return _0xf9349['message'];});}function getUser(_0x313c0e,_0x3d6843,_0x50ee0d,_0xa5b105,_0x49a667,_0x17d352){return new Promise(function(_0x7272bb,_0xbe26ca){return getAuthToken(_0x3d6843,_0xa5b105,_0x17d352)['then'](function(_0x5de688){var _0x5c1534={'method':'GET','uri':_0x49a667+_0x7651('0x17'),'headers':{'Authorization':_0x7651('0x18')+_0x5de688,'OData-Version':_0x7651('0x19')},'json':!![]};return rp(_0x5c1534);})[_0x7651('0x1a')](function(_0x5d03a2){var _0x3cdcd8=_0x5d03a2[_0x7651('0x1b')];var _0x1770b1=![];var _0x4c8824=null;if(!_[_0x7651('0x1c')](_0x50ee0d)){if(intUtil[_0x7651('0x1d')](_0x50ee0d[_0x7651('0x1e')])){_0x313c0e[_0x7651('0x1f')]=_0x50ee0d[_0x7651('0x1e')];for(_0x4c8824=0x0;_0x4c8824<_0x3cdcd8['length'];_0x4c8824++){if(_0x3cdcd8[_0x4c8824]['internalemailaddress']===_0x50ee0d['email']&&!_0x3cdcd8[_0x4c8824][_0x7651('0x20')]){_0x1770b1=!![];logger[_0x7651('0x21')]('['+[_0x17d352[_0x7651('0x15')]()]+']\x20Agent\x20found\x20'+_0x3cdcd8[_0x4c8824][_0x7651('0x22')]+'!');_0x313c0e[_0x7651('0x23')]=_0x3cdcd8[_0x4c8824][_0x7651('0x22')];}}}}if(!_0x1770b1){logger[_0x7651('0x21')]('['+[_0x17d352['toUpperCase']()]+_0x7651('0x24'));_0x313c0e['userEmail']=_0x3d6843['username'];for(_0x4c8824=0x0;_0x4c8824<_0x3cdcd8[_0x7651('0x25')];_0x4c8824++){if(_0x3cdcd8[_0x4c8824][_0x7651('0x26')]===_0x3d6843[_0x7651('0x27')]){_0x313c0e[_0x7651('0x23')]=_0x3cdcd8[_0x4c8824][_0x7651('0x22')];}}}_0x7272bb(_0x313c0e);})['catch'](function(_0x453715){_0xbe26ca(_0x453715['message']);});});}function createEndUser(_0xd44d1c,_0x3bccaa,_0x1e5ac8,_0x57a280,_0x3a4b50,_0x23d3c7,_0x4e0b1d){return new Promise(function(_0x4fe035,_0x55a324){return getAuthToken(_0x3bccaa,_0x1e5ac8,_0x23d3c7)[_0x7651('0x1a')](function(_0x142b5f){var _0x5eb7d5=_0x23d3c7['toLowerCase']()==='outbound'?_0x3a4b50['destcalleridnum']:_0x3a4b50[_0x7651('0x28')];var _0x4cd133={'method':_0x7651('0xe'),'uri':_0x57a280+'contacts','body':{'fullname':_0x5eb7d5,'firstname':_0x5eb7d5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7651('0x29')+_0xd44d1c['userId']+')'},'headers':{'Authorization':'Bearer\x20'+_0x142b5f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x4cd133[_0x7651('0x2a')][_0x4e0b1d]=_0x5eb7d5;return rp(_0x4cd133);})[_0x7651('0x1a')](function(_0x3cb6d5){var _0x473e55=_0x3cb6d5[_0x7651('0x2b')][_0x7651('0x2c')];var _0x557498=_0x473e55[_0x7651('0x2d')](_0x473e55[_0x7651('0x2e')]('(')+0x1,_0x473e55[_0x7651('0x2e')](')'));_0xd44d1c['enduserId']=_0x557498;_0x4fe035(_0xd44d1c);})[_0x7651('0x13')](function(_0x503d55){_0x55a324(_0x503d55[_0x7651('0x2f')]);});});}function getEndUser(_0x36c981,_0x1a46b9,_0x4b8702,_0x3256a5,_0x5dee4f,_0x5c488a,_0x3b5328,_0x143634){var _0x5c722f=_0x5c488a['toLowerCase']()===_0x7651('0x30')?_0x5dee4f['destcalleridnum']:_0x5dee4f['calleridnum'];return getAuthToken(_0x1a46b9,_0x4b8702,_0x5c488a)[_0x7651('0x1a')](function(_0x179a6c){_0x143634=_0x143634?_0x143634:'telephone1';var _0x9645ba={'method':'GET','uri':_0x3256a5+'contacts?$select='+_0x143634+_0x7651('0x31')+_0x143634+_0x7651('0x32')+_0x5c722f[_0x7651('0x33')]('+',_0x7651('0x34'))+'\x27','headers':{'Authorization':_0x7651('0x18')+_0x179a6c,'If-None-Match':null,'OData-Version':_0x7651('0x19')},'json':!![]};return rp(_0x9645ba);})['then'](function(_0x4bf83e){var _0x36040a=![];if(!_0x4bf83e)return _0x36040a;var _0x4a8af3=_0x4bf83e[_0x7651('0x1b')];for(var _0x2c1ef0=0x0;_0x2c1ef0<_0x4a8af3[_0x7651('0x25')];_0x2c1ef0++){if(_0x4a8af3[_0x2c1ef0][_0x143634]===_0x5c722f){_0x36040a=!![];_0x36c981['enduserId']=_0x4a8af3[_0x2c1ef0][_0x7651('0x35')];}}return _0x36040a;})[_0x7651('0x1a')](function(_0x36e796){if(_0x36e796)return _0x36c981;if(_0x3b5328==='nothing'){logger[_0x7651('0x21')]('['+[_0x5c488a[_0x7651('0x15')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x36c981;}return createEndUser(_0x36c981,_0x1a46b9,_0x4b8702,_0x3256a5,_0x5dee4f,_0x5c488a,_0x143634)[_0x7651('0x1a')](function(_0x4b8807){logger['info']('['+[_0x5c488a[_0x7651('0x15')]()]+_0x7651('0x36'),_0x4b8807[_0x7651('0x37')]);return _0x4b8807;});});}function getCustomFields(_0x351fcd,_0x42213a,_0x479b1f){var _0x24f06e={};if(_0x351fcd[_0x7651('0x25')]>0x0){_[_0x7651('0x38')](_0x351fcd,function(_0x5b2213){if(_[_0x7651('0x39')]([_0x7651('0x3a'),_0x7651('0x3b')],_0x5b2213['type'])&&_0x5b2213[_0x7651('0x3c')]&&!_0x5b2213[_0x7651('0x3d')]){var _0x5c1504=_0x5b2213[_0x7651('0x3e')][_0x7651('0x3f')]();var _0x5bca54=_0x5c1504[_0x7651('0x2d')](0x0,_0x5c1504[_0x7651('0x40')]('_'));var _0xb7597e=_0x5c1504[_0x7651('0x2d')](_0x5c1504[_0x7651('0x40')]('_')+0x1);if(_0x5bca54===_0x479b1f){_0x24f06e[_0xb7597e]=_0x5b2213[_0x7651('0x41')];}}});}return _0x24f06e;}function getTicket(_0x47ae62,_0x204f1b,_0x2383e0,_0x5f134a,_0x4c2f8d,_0x42f93d,_0x40c449){return new Promise(function(_0x2c7e38,_0x2097a9){var _0x316aa7;return getAuthToken(_0x204f1b,_0x2383e0,_0x40c449)[_0x7651('0x1a')](function(_0x13a396){if(_0x42f93d[_0x7651('0x42')]===_0x7651('0x43')){_0x316aa7={'method':'POST','uri':_0x5f134a+_0x7651('0x44'),'body':Object[_0x7651('0x45')]({},{'title':intUtil[_0x7651('0x46')](_0x42f93d[_0x7651('0x47')],_0x4c2f8d,'\x20'),'description':intUtil['getString'](_0x42f93d['Descriptions'],_0x4c2f8d,'\x0a'),'customerid_contact@odata.bind':_0x47ae62[_0x7651('0x37')]?_0x7651('0x48')+_0x47ae62[_0x7651('0x37')]+')':undefined,'ownerid@odata.bind':_0x7651('0x29')+_0x47ae62['userId']+')','caseorigincode':'1'},getCustomFields(_0x42f93d[_0x7651('0x49')],_0x4c2f8d,_0x42f93d['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x13a396,'OData-Version':_0x7651('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x42f93d[_0x7651('0x42')]===_0x7651('0x4a')){var _0x45aac6=_0x47ae62['enduserId']?[{'partyid_systemuser@odata.bind':_0x7651('0x29')+_0x47ae62['userId']+')','participationtypemask':_0x47ae62[_0x7651('0x4b')]===_0x7651('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x7651('0x48')+_0x47ae62['enduserId']+')','participationtypemask':_0x47ae62['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x47ae62[_0x7651('0x23')]+')','participationtypemask':_0x47ae62['callDirection']===_0x7651('0x4c')?0x2:0x1}];_0x316aa7={'method':_0x7651('0xe'),'uri':_0x5f134a+_0x7651('0x4d'),'body':Object[_0x7651('0x45')]({},{'subject':intUtil['getString'](_0x42f93d['Subjects'],_0x4c2f8d,'\x20'),'phonenumber':String(_0x4c2f8d['calleridnum']),'description':intUtil[_0x7651('0x46')](_0x42f93d[_0x7651('0x4e')],_0x4c2f8d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x47ae62[_0x7651('0x37')]?_0x7651('0x48')+_0x47ae62['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x47ae62[_0x7651('0x23')]+')','directioncode':_0x47ae62[_0x7651('0x4b')]===_0x7651('0x4c')?![]:!![],'phonecall_activity_parties':_0x45aac6},getCustomFields(_0x42f93d[_0x7651('0x49')],_0x4c2f8d,_0x42f93d[_0x7651('0x42')])),'headers':{'Authorization':_0x7651('0x18')+_0x13a396,'OData-Version':_0x7651('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x316aa7);})[_0x7651('0x1a')](function(_0x181867){var _0x21844c=_0x181867[_0x7651('0x2b')][_0x7651('0x2c')];var _0x47e8c7=_0x21844c[_0x7651('0x2d')](_0x21844c[_0x7651('0x2e')]('(')+0x1,_0x21844c[_0x7651('0x2e')](')'));_0x47ae62[_0x7651('0x4f')]=_0x47e8c7;_0x2c7e38(_0x47ae62);})[_0x7651('0x13')](function(_0x768b24){_0x2097a9(_0x768b24[_0x7651('0x2f')]);});});}function emit(_0x271215,_0xf5eb3c,_0x2de08d,_0x3030a1){var _0x36bacd={'uri':util[_0x7651('0x50')](_0x7651('0x51'),_0x271215,_0x2de08d,_0x3030a1)};io['to'](util[_0x7651('0x50')](_0x7651('0x52'),_0xf5eb3c))['emit'](_0x7651('0x53'),_0x36bacd);}exports['cs']=function(_0x3c24dd,_0x262e07,_0x2cd2e2,_0x69d49a,_0x549e25,_0x52ba73,_0x118948,_0x6731e2){var _0x13e099={};_0x52ba73['remoteUri']=_0x52ba73['modernAuthentication']?intUtil['stripTrailingSlash'](_0x52ba73[_0x7651('0x9')][_0x7651('0xa')]):intUtil[_0x7651('0x54')](_0x52ba73['remoteUri']);_0x52ba73[_0x7651('0x55')]=intUtil[_0x7651('0x54')](_0x52ba73['serverUrl']);_0x13e099[_0x7651('0x4b')]=_0x6731e2===_0x7651('0x4c')||_0x6731e2==='unmanaged'?_0x7651('0x4c'):_0x7651('0x30');var _0x245511=_0x52ba73[_0x7651('0x56')]?util['format'](_0x7651('0x57'),_0x52ba73[_0x7651('0x9')][_0x7651('0xa')]):util[_0x7651('0x50')](_0x7651('0x57'),_0x52ba73[_0x7651('0x8')]);var _0x11bf92=util[_0x7651('0x50')](_0x7651('0x58'),_0x52ba73['tenantId']);var _0x245758=util[_0x7651('0x50')](_0x7651('0x59'),_0x52ba73[_0x7651('0x55')],_0x262e07['uniqueid'],md5(_0x262e07[_0x7651('0x5a')]));if(_0x549e25&&_0x549e25[_0x7651('0x5b')]){logger[_0x7651('0x21')]('[QUEUE]',_0x7651('0x5c'));_0x262e07[_0x7651('0x5d')]=_0x245758;}else if(_0x118948&&_0x118948[_0x7651('0x5e')]&&_0x118948['recordingFormat']!=='none'){logger[_0x7651('0x21')](_0x7651('0x5f'),'Recording\x20is\x20enabled!');_0x262e07['recordingURL']=_0x245758;}else{_0x262e07[_0x7651('0x5d')]='';}return getUser(_0x13e099,_0x52ba73,_0x69d49a,_0x11bf92,_0x245511,_0x6731e2)[_0x7651('0x1a')](function(_0x5f384c){logger['info']('['+_0x6731e2['toUpperCase']()+_0x7651('0x60'),_0x5f384c[_0x7651('0x23')]);logger[_0x7651('0x21')]('['+_0x6731e2[_0x7651('0x15')]()+_0x7651('0x61'),_0x5f384c[_0x7651('0x1f')]);return getEndUser(_0x5f384c,_0x52ba73,_0x11bf92,_0x245511,_0x262e07,_0x6731e2,_0x2cd2e2[_0x7651('0x62')],_0x2cd2e2['additionalSearchContact']);})[_0x7651('0x1a')](function(_0x4e6666){logger[_0x7651('0x21')]('['+_0x6731e2[_0x7651('0x15')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x4e6666[_0x7651('0x37')]);logger[_0x7651('0x21')]('['+_0x6731e2[_0x7651('0x15')]()+_0x7651('0x63'),_0x262e07[_0x7651('0x28')]);return getTicket(_0x4e6666,_0x52ba73,_0x11bf92,_0x245511,_0x262e07,_0x2cd2e2,_0x6731e2);})['then'](function(_0x1e1ed0){logger['info'](util['format']('['+_0x6731e2[_0x7651('0x15')]()+_0x7651('0x64'),_0x2cd2e2[_0x7651('0x42')],_0x1e1ed0[_0x7651('0x4f')]));logger['info'](util['format']('['+_0x6731e2[_0x7651('0x15')]()+_0x7651('0x65'),_0x6731e2));if(_0x6731e2!==_0x7651('0x66')&&_0x2cd2e2[_0x7651('0x67')]){logger['info']('['+_0x6731e2[_0x7651('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x52ba73[_0x7651('0x8')],_0x69d49a[_0x7651('0x68')],_0x2cd2e2[_0x7651('0x42')],_0x1e1ed0['ticketId']);}})[_0x7651('0x13')](function(_0x24df2a){logger[_0x7651('0x14')]('['+_0x6731e2[_0x7651('0x15')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x24df2a['message']);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x24df2a);});}; \ No newline at end of file +var _0x5925=['body','headers','substring','lastIndexOf','enduserId','outbound','destcalleridnum','&$filter=','\x20eq\x20\x27','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist','nameField','idField','indexOf','content','ticketType','incident','assign','getString','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','Subjects','odata-entityid','ticketId','catch','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','resolve','POST','password','then','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','GET','value','isNil','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','internalemailaddress','toLowerCase','calleridnum','/systemusers(','Bearer\x20','4.0'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5925,0x187));var _0x5592=function(_0x11f4b5,_0x279f0d){_0x11f4b5=_0x11f4b5-0x0;var _0x59d5e0=_0x5925[_0x11f4b5];return _0x59d5e0;};'use strict';var _=require(_0x5592('0x0'));var rp=require('request-promise');var util=require(_0x5592('0x1'));var intUtil=require(_0x5592('0x2'));var md5=require(_0x5592('0x3'));var Redis=require(_0x5592('0x4'));var logger=require(_0x5592('0x5'))(_0x5592('0x6'));var config=require(_0x5592('0x7'));config['redis']=_[_0x5592('0x8')](config[_0x5592('0x9')],{'host':_0x5592('0xa'),'port':0x18eb});var io=require(_0x5592('0xb'))(new Redis(config['redis']));function getAuthToken(_0x2ef609,_0x5dff50,_0x2352c1){if(_0x2ef609[_0x5592('0xc')]){_0x2ef609[_0x5592('0xd')]=_0x2ef609['CloudProvider'][_0x5592('0xe')];_0x2ef609[_0x5592('0xf')]=_0x2ef609[_0x5592('0x10')]['data2'];return Promise[_0x5592('0x11')](_0x2ef609[_0x5592('0x10')]['data5']);}var _0x2856c8={'method':_0x5592('0x12'),'uri':_0x5dff50,'form':{'client_id':_0x2ef609['clientId'],'resource':_0x2ef609['remoteUri'],'username':_0x2ef609['username'],'password':_0x2ef609[_0x5592('0x13')],'grant_type':_0x5592('0x13'),'client_secret':_0x2ef609['clientSecret']},'json':!![]};return rp(_0x2856c8)[_0x5592('0x14')](function(_0x55af78){return _0x55af78[_0x5592('0x15')];})['catch'](function(_0x2b7daa){logger['error']('['+[_0x2352c1[_0x5592('0x16')]()]+_0x5592('0x17'));return _0x2b7daa[_0x5592('0x18')];});}function getUser(_0x1e3b7a,_0x37baf2,_0xfd3f28,_0x55f949,_0x4331c8,_0x4a360b){return new Promise(function(_0x18ffff,_0x219d49){return getAuthToken(_0x37baf2,_0x55f949,_0x4a360b)[_0x5592('0x14')](function(_0x3d5561){var _0x2398d8={'method':_0x5592('0x19'),'uri':_0x4331c8+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x3d5561,'OData-Version':'4.0'},'json':!![]};return rp(_0x2398d8);})[_0x5592('0x14')](function(_0xb0ebc8){var _0x9d33a1=_0xb0ebc8[_0x5592('0x1a')];var _0x164c25=![];var _0x112dff=null;if(!_[_0x5592('0x1b')](_0xfd3f28)){if(intUtil[_0x5592('0x1c')](_0xfd3f28[_0x5592('0x1d')])){_0x1e3b7a[_0x5592('0x1e')]=_0xfd3f28[_0x5592('0x1d')];for(_0x112dff=0x0;_0x112dff<_0x9d33a1[_0x5592('0x1f')];_0x112dff++){if(_0x9d33a1[_0x112dff]['internalemailaddress']===_0xfd3f28[_0x5592('0x1d')]&&!_0x9d33a1[_0x112dff][_0x5592('0x20')]){_0x164c25=!![];logger[_0x5592('0x21')]('['+[_0x4a360b['toUpperCase']()]+_0x5592('0x22')+_0x9d33a1[_0x112dff][_0x5592('0x23')]+'!');_0x1e3b7a[_0x5592('0x24')]=_0x9d33a1[_0x112dff][_0x5592('0x23')];}}}}if(!_0x164c25){logger[_0x5592('0x21')]('['+[_0x4a360b['toUpperCase']()]+_0x5592('0x25'));_0x1e3b7a[_0x5592('0x1e')]=_0x37baf2[_0x5592('0x26')];for(_0x112dff=0x0;_0x112dff<_0x9d33a1[_0x5592('0x1f')];_0x112dff++){if(_0x9d33a1[_0x112dff][_0x5592('0x27')]===_0x37baf2[_0x5592('0x26')]){_0x1e3b7a['userId']=_0x9d33a1[_0x112dff][_0x5592('0x23')];}}}_0x18ffff(_0x1e3b7a);})['catch'](function(_0x22c52f){_0x219d49(_0x22c52f['message']);});});}function createEndUser(_0xaf118a,_0x1e559e,_0x48a07f,_0x560246,_0x21e147,_0x1450e4,_0x51315d){return new Promise(function(_0x48fe5d,_0x408cc7){return getAuthToken(_0x1e559e,_0x48a07f,_0x1450e4)[_0x5592('0x14')](function(_0x27d34c){var _0x4ea671=_0x1450e4[_0x5592('0x28')]()==='outbound'?_0x21e147['destcalleridnum']:_0x21e147[_0x5592('0x29')];var _0x19b9a6={'method':_0x5592('0x12'),'uri':_0x560246+'contacts','body':{'fullname':_0x4ea671,'firstname':_0x4ea671,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5592('0x2a')+_0xaf118a[_0x5592('0x24')]+')'},'headers':{'Authorization':_0x5592('0x2b')+_0x27d34c,'OData-Version':_0x5592('0x2c')},'json':!![],'resolveWithFullResponse':!![]};_0x19b9a6[_0x5592('0x2d')][_0x51315d]=_0x4ea671;return rp(_0x19b9a6);})[_0x5592('0x14')](function(_0x531581){var _0x10f141=_0x531581[_0x5592('0x2e')]['odata-entityid'];var _0x180f44=_0x10f141[_0x5592('0x2f')](_0x10f141['lastIndexOf']('(')+0x1,_0x10f141[_0x5592('0x30')](')'));_0xaf118a[_0x5592('0x31')]=_0x180f44;_0x48fe5d(_0xaf118a);})['catch'](function(_0x24eea8){_0x408cc7(_0x24eea8[_0x5592('0x18')]);});});}function getEndUser(_0x311cec,_0x379f6a,_0x307013,_0x24ae8f,_0x5f3f51,_0x57fc31,_0x1ee353,_0x1d6d5a){var _0x1d4b4c=_0x57fc31[_0x5592('0x28')]()===_0x5592('0x32')?_0x5f3f51[_0x5592('0x33')]:_0x5f3f51[_0x5592('0x29')];return getAuthToken(_0x379f6a,_0x307013,_0x57fc31)[_0x5592('0x14')](function(_0x2f3771){_0x1d6d5a=_0x1d6d5a?_0x1d6d5a:'telephone1';var _0x36ee7b={'method':_0x5592('0x19'),'uri':_0x24ae8f+'contacts?$select='+_0x1d6d5a+_0x5592('0x34')+_0x1d6d5a+_0x5592('0x35')+_0x1d4b4c['replace']('+',_0x5592('0x36'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x2f3771,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x36ee7b);})[_0x5592('0x14')](function(_0x19b045){var _0x56b0c8=![];if(!_0x19b045)return _0x56b0c8;var _0x516ac6=_0x19b045['value'];for(var _0xde8b9d=0x0;_0xde8b9d<_0x516ac6[_0x5592('0x1f')];_0xde8b9d++){if(_0x516ac6[_0xde8b9d][_0x1d6d5a]===_0x1d4b4c){_0x56b0c8=!![];_0x311cec['enduserId']=_0x516ac6[_0xde8b9d]['contactid'];}}return _0x56b0c8;})[_0x5592('0x14')](function(_0x275356){if(_0x275356)return _0x311cec;if(_0x1ee353===_0x5592('0x37')){logger['info']('['+[_0x57fc31[_0x5592('0x16')]()]+_0x5592('0x38'));return _0x311cec;}return createEndUser(_0x311cec,_0x379f6a,_0x307013,_0x24ae8f,_0x5f3f51,_0x57fc31,_0x1d6d5a)[_0x5592('0x14')](function(_0x47720d){logger[_0x5592('0x21')]('['+[_0x57fc31[_0x5592('0x16')]()]+_0x5592('0x39'),_0x47720d[_0x5592('0x31')]);return _0x47720d;});});}function getCustomFields(_0x4a1408,_0x32dbba,_0x1f5a86){var _0x36b595={};if(_0x4a1408['length']>0x0){_[_0x5592('0x3a')](_0x4a1408,function(_0x529e60){if(_['includes']([_0x5592('0x3b'),_0x5592('0x3c')],_0x529e60['type'])&&_0x529e60[_0x5592('0x3d')]&&!_0x529e60['customField']){var _0xcdd599=_0x529e60[_0x5592('0x3e')][_0x5592('0x28')]();var _0x4d7198=_0xcdd599[_0x5592('0x2f')](0x0,_0xcdd599[_0x5592('0x3f')]('_'));var _0xc8f0b=_0xcdd599[_0x5592('0x2f')](_0xcdd599[_0x5592('0x3f')]('_')+0x1);if(_0x4d7198===_0x1f5a86){_0x36b595[_0xc8f0b]=_0x529e60[_0x5592('0x40')];}}});}return _0x36b595;}function getTicket(_0x46e0a7,_0x52a9fe,_0x4e9a2a,_0x4e578f,_0x55546c,_0x273547,_0x90785d){return new Promise(function(_0x132e60,_0x3be388){var _0x4b789f;return getAuthToken(_0x52a9fe,_0x4e9a2a,_0x90785d)[_0x5592('0x14')](function(_0x2d2076){if(_0x273547[_0x5592('0x41')]===_0x5592('0x42')){_0x4b789f={'method':'POST','uri':_0x4e578f+'incidents','body':Object[_0x5592('0x43')]({},{'title':intUtil[_0x5592('0x44')](_0x273547['Subjects'],_0x55546c,'\x20'),'description':intUtil['getString'](_0x273547[_0x5592('0x45')],_0x55546c,'\x0a'),'customerid_contact@odata.bind':_0x46e0a7[_0x5592('0x31')]?_0x5592('0x46')+_0x46e0a7[_0x5592('0x31')]+')':undefined,'ownerid@odata.bind':_0x5592('0x2a')+_0x46e0a7['userId']+')','caseorigincode':'1'},getCustomFields(_0x273547[_0x5592('0x47')],_0x55546c,_0x273547['ticketType'])),'headers':{'Authorization':_0x5592('0x2b')+_0x2d2076,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x273547['ticketType']===_0x5592('0x48')){var _0x1b6417=_0x46e0a7['enduserId']?[{'partyid_systemuser@odata.bind':_0x5592('0x2a')+_0x46e0a7['userId']+')','participationtypemask':_0x46e0a7['callDirection']===_0x5592('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x5592('0x46')+_0x46e0a7[_0x5592('0x31')]+')','participationtypemask':_0x46e0a7[_0x5592('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5592('0x2a')+_0x46e0a7[_0x5592('0x24')]+')','participationtypemask':_0x46e0a7[_0x5592('0x4a')]===_0x5592('0x49')?0x2:0x1}];_0x4b789f={'method':'POST','uri':_0x4e578f+_0x5592('0x4b'),'body':Object[_0x5592('0x43')]({},{'subject':intUtil['getString'](_0x273547[_0x5592('0x4c')],_0x55546c,'\x20'),'phonenumber':String(_0x55546c[_0x5592('0x29')]),'description':intUtil[_0x5592('0x44')](_0x273547['Descriptions'],_0x55546c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x46e0a7[_0x5592('0x31')]?_0x5592('0x46')+_0x46e0a7[_0x5592('0x31')]+')':undefined,'ownerid@odata.bind':_0x5592('0x2a')+_0x46e0a7[_0x5592('0x24')]+')','directioncode':_0x46e0a7[_0x5592('0x4a')]===_0x5592('0x49')?![]:!![],'phonecall_activity_parties':_0x1b6417},getCustomFields(_0x273547[_0x5592('0x47')],_0x55546c,_0x273547['ticketType'])),'headers':{'Authorization':_0x5592('0x2b')+_0x2d2076,'OData-Version':_0x5592('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4b789f);})[_0x5592('0x14')](function(_0xb7082c){var _0x58d59e=_0xb7082c['headers'][_0x5592('0x4d')];var _0xfb0771=_0x58d59e['substring'](_0x58d59e[_0x5592('0x30')]('(')+0x1,_0x58d59e[_0x5592('0x30')](')'));_0x46e0a7[_0x5592('0x4e')]=_0xfb0771;_0x132e60(_0x46e0a7);})[_0x5592('0x4f')](function(_0x4889ff){_0x3be388(_0x4889ff['message']);});});}function emit(_0x171ed3,_0x52612a,_0x5400d3,_0x2b7b1b){var _0x3d3571={'uri':util['format'](_0x5592('0x50'),_0x171ed3,_0x5400d3,_0x2b7b1b)};io['to'](util[_0x5592('0x51')](_0x5592('0x52'),_0x52612a))[_0x5592('0x53')](_0x5592('0x54'),_0x3d3571);}exports['cs']=function(_0x570557,_0x174025,_0x2a8247,_0x34bf01,_0x3782bf,_0x4be794,_0x2b94a8,_0x348a81){var _0x15dbd0={};_0x4be794[_0x5592('0xd')]=_0x4be794[_0x5592('0xc')]?intUtil[_0x5592('0x55')](_0x4be794[_0x5592('0x10')][_0x5592('0xe')]):intUtil[_0x5592('0x55')](_0x4be794[_0x5592('0xd')]);_0x4be794[_0x5592('0x56')]=intUtil[_0x5592('0x55')](_0x4be794['serverUrl']);_0x15dbd0['callDirection']=_0x348a81===_0x5592('0x49')||_0x348a81===_0x5592('0x57')?_0x5592('0x49'):_0x5592('0x32');var _0x31c025=_0x4be794[_0x5592('0xc')]?util[_0x5592('0x51')](_0x5592('0x58'),_0x4be794[_0x5592('0x10')][_0x5592('0xe')]):util[_0x5592('0x51')](_0x5592('0x58'),_0x4be794[_0x5592('0xd')]);var _0x2bcc9a=util[_0x5592('0x51')](_0x5592('0x59'),_0x4be794['tenantId']);var _0x9b4415=util[_0x5592('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be794[_0x5592('0x56')],_0x174025[_0x5592('0x5a')],md5(_0x174025[_0x5592('0x5a')]));if(_0x3782bf&&_0x3782bf[_0x5592('0x5b')]){logger['info']('[QUEUE]',_0x5592('0x5c'));_0x174025[_0x5592('0x5d')]=_0x9b4415;}else if(_0x2b94a8&&_0x2b94a8[_0x5592('0x5e')]&&_0x2b94a8[_0x5592('0x5e')]!=='none'){logger['info'](_0x5592('0x5f'),_0x5592('0x5c'));_0x174025['recordingURL']=_0x9b4415;}else{_0x174025['recordingURL']='';}return getUser(_0x15dbd0,_0x4be794,_0x34bf01,_0x2bcc9a,_0x31c025,_0x348a81)[_0x5592('0x14')](function(_0x4de22b){logger[_0x5592('0x21')]('['+_0x348a81[_0x5592('0x16')]()+_0x5592('0x60'),_0x4de22b[_0x5592('0x24')]);logger[_0x5592('0x21')]('['+_0x348a81[_0x5592('0x16')]()+_0x5592('0x61'),_0x4de22b['userEmail']);return getEndUser(_0x4de22b,_0x4be794,_0x2bcc9a,_0x31c025,_0x174025,_0x348a81,_0x2a8247[_0x5592('0x62')],_0x2a8247[_0x5592('0x63')]);})['then'](function(_0x29fd3b){logger['info']('['+_0x348a81[_0x5592('0x16')]()+_0x5592('0x64'),_0x29fd3b[_0x5592('0x31')]);logger[_0x5592('0x21')]('['+_0x348a81['toUpperCase']()+_0x5592('0x65'),_0x174025['calleridnum']);return getTicket(_0x29fd3b,_0x4be794,_0x2bcc9a,_0x31c025,_0x174025,_0x2a8247,_0x348a81);})['then'](function(_0xc030e3){logger['info'](util['format']('['+_0x348a81[_0x5592('0x16')]()+_0x5592('0x66'),_0x2a8247[_0x5592('0x41')],_0xc030e3[_0x5592('0x4e')]));logger['info'](util[_0x5592('0x51')]('['+_0x348a81['toUpperCase']()+_0x5592('0x67'),_0x348a81));if(_0x348a81!==_0x5592('0x57')&&_0x2a8247[_0x5592('0x68')]){logger['info']('['+_0x348a81['toUpperCase']()+']',_0x5592('0x69'));emit(_0x4be794['remoteUri'],_0x34bf01[_0x5592('0x6a')],_0x2a8247['ticketType'],_0xc030e3[_0x5592('0x4e')]);}})[_0x5592('0x4f')](function(_0x385a5d){logger[_0x5592('0x6b')]('['+_0x348a81[_0x5592('0x16')]()+_0x5592('0x6c'),_0x385a5d['message']);console[_0x5592('0x6b')]('Error\x20running\x20Dynamics365\x20integration',_0x385a5d);});}; \ 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 2074829..181431b 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 _0xb2fe=['../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','GET','map','includes','picklist','type','customField','nameField','toLowerCase','content','string','push','variable','variableName','idField','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','lastevent','toUpperCase','lodash','md5','util','ioredis'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xb2fe,0x178));var _0xeb2f=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0xb2fe[_0x4f8d61];return _0x3bc078;};'use strict';var _=require(_0xeb2f('0x0'));var rp=require('request-promise');var md5=require(_0xeb2f('0x1'));var util=require(_0xeb2f('0x2'));var Redis=require(_0xeb2f('0x3'));var intUtil=require('./util');var config=require(_0xeb2f('0x4'));var logger=require(_0xeb2f('0x5'))(_0xeb2f('0x6'));config[_0xeb2f('0x7')]=_[_0xeb2f('0x8')](config[_0xeb2f('0x7')],{'host':_0xeb2f('0x9'),'port':0x18eb});var io=require(_0xeb2f('0xa'))(new Redis(config['redis']));var headers={'Content-Type':_0xeb2f('0xb'),'Accept':'application/json'};function emit(_0x53b727,_0x272d09,_0x3ac421){io['to'](_0x53b727)[_0xeb2f('0xc')](_0x272d09,_0x3ac421);}function getTicket(_0x258e91,_0xf5d30b,_0x4fa930,_0x29c55d,_0x1aefe9){logger['info'](_0xeb2f('0xd'));var _0xd6ab8c=_['merge']({'responder_id':_0xf5d30b['id'],'requester_id':_0x4fa930['id'],'name':util[_0xeb2f('0xe')](_0xeb2f('0xf'),_0x1aefe9[_0xeb2f('0x10')]),'phone':_0x1aefe9[_0xeb2f('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xeb2f('0x12')](_0x29c55d[_0xeb2f('0x13')],_0x1aefe9,'\x20'),'description':intUtil[_0xeb2f('0x12')](_0x29c55d[_0xeb2f('0x14')],_0x1aefe9,_0xeb2f('0x15')),'tags':getTags(_0x29c55d['Tags'],_0xeb2f('0x16'))},getCustomFields(_0x29c55d['Fields'],_0x1aefe9));_0xd6ab8c[_0xeb2f('0x17')]=_[_0xeb2f('0x18')](_[_0xeb2f('0x19')](_0xd6ab8c[_0xeb2f('0x17')],'id'),_0xeb2f('0x1a'));return request({'uri':util[_0xeb2f('0xe')]('%s/api/v2/tickets',_0x258e91[_0xeb2f('0x1b')]),'method':_0xeb2f('0x1c'),'body':_0xd6ab8c})[_0xeb2f('0x1d')](function(_0x33e205){logger[_0xeb2f('0x1e')](_0xeb2f('0x1f'));return _0x33e205;});}function getUser(_0x2609c8,_0x5e9a8e){if(intUtil[_0xeb2f('0x20')](_0x5e9a8e)){return request({'uri':util[_0xeb2f('0xe')](_0xeb2f('0x21'),_0x2609c8[_0xeb2f('0x1b')]),'qs':{'email':_0x5e9a8e}})[_0xeb2f('0x1d')](function(_0x334315){if(_0x334315[_0xeb2f('0x22')]){logger[_0xeb2f('0x1e')](_0xeb2f('0x23'));return _[_0xeb2f('0x24')](_0x334315,function(_0x496f92){return _0x496f92[_0xeb2f('0x25')][_0xeb2f('0x26')]===_0x5e9a8e;});}else{logger[_0xeb2f('0x1e')](_0xeb2f('0x27'));return request({'uri':util[_0xeb2f('0xe')](_0xeb2f('0x28'),_0x2609c8[_0xeb2f('0x1b')])})[_0xeb2f('0x1d')](function(_0x2dab07){logger['info'](_0xeb2f('0x29'));return _0x2dab07;});}});}else{logger[_0xeb2f('0x1e')](_0xeb2f('0x2a'));return request({'uri':util[_0xeb2f('0xe')](_0xeb2f('0x28'),_0x2609c8[_0xeb2f('0x1b')])})[_0xeb2f('0x1d')](function(_0x3404ea){logger[_0xeb2f('0x1e')](_0xeb2f('0x29'));return _0x3404ea;});}}function getEndUser(_0x106663,_0x5a0ab9,_0x12ed07){logger[_0xeb2f('0x1e')]('Searching\x20enduser\x20with\x20phone',_0x12ed07);return request({'uri':util[_0xeb2f('0xe')](_0xeb2f('0x2b'),_0x106663[_0xeb2f('0x1b')]),'qs':{'phone':_0x12ed07}})[_0xeb2f('0x1d')](function(_0x1e8459){if(_0x1e8459[_0xeb2f('0x22')]){logger[_0xeb2f('0x1e')](_0xeb2f('0x2c'));return _[_0xeb2f('0x24')](_0x1e8459,{'phone':_0x12ed07});}else{logger[_0xeb2f('0x1e')](_0xeb2f('0x2d'));return request({'uri':util[_0xeb2f('0xe')]('%s/api/v2/contacts',_0x106663[_0xeb2f('0x1b')]),'method':_0xeb2f('0x1c'),'body':{'name':_0x5a0ab9,'phone':_0x12ed07}})[_0xeb2f('0x1d')](function(_0x22cbda){logger['info'](_0xeb2f('0x2e'));return _0x22cbda;});}});}function getAuth(_0x278cc3){return util['format'](_0xeb2f('0x2f'),new Buffer(_0x278cc3[_0xeb2f('0x30')]+':X')[_0xeb2f('0x31')](_0xeb2f('0x32')));}function request(_0x1806f7){logger['debug'](_0xeb2f('0x33'),JSON['stringify'](_0x1806f7));return rp(_[_0xeb2f('0x8')](_0x1806f7,{'method':_0xeb2f('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x2f4110,_0x1f4470){var _0x137b88=[];if(_0x2f4110&&_0x2f4110[_0xeb2f('0x22')]>0x0){_0x137b88=_[_0xeb2f('0x35')](_0x2f4110,_0x1f4470);}return _0x137b88;}function getCustomFields(_0x2198a1,_0x5e9ca9){var _0x2288f8=[];var _0x2942b1={'custom_fields':[]};if(_0x2198a1[_0xeb2f('0x22')]>0x0){_['forEach'](_0x2198a1,function(_0x11be51){if(_[_0xeb2f('0x36')](['string',_0xeb2f('0x37')],_0x11be51[_0xeb2f('0x38')])&&_0x11be51['nameField']&&!_0x11be51[_0xeb2f('0x39')]){_0x2942b1[_0x11be51[_0xeb2f('0x3a')][_0xeb2f('0x3b')]()]=_0x11be51[_0xeb2f('0x3c')][_0xeb2f('0x31')]();}else if(_[_0xeb2f('0x36')]([_0xeb2f('0x3d'),_0xeb2f('0x37')],_0x11be51[_0xeb2f('0x38')])&&_0x11be51['idField']&&_0x11be51['customField']){_0x2942b1[_0xeb2f('0x17')][_0xeb2f('0x3e')]({'id':_0x11be51['idField'],'value':_0x11be51['content'][_0xeb2f('0x31')]()});}else if(_0x11be51[_0xeb2f('0x38')]===_0xeb2f('0x3f')&&_0x11be51[_0xeb2f('0x40')]&&_0x11be51[_0xeb2f('0x41')]&&_0x11be51['customField']){_0x5e9ca9[_0x11be51['variableName']]&&_0x2942b1[_0xeb2f('0x17')][_0xeb2f('0x3e')]({'id':_0x11be51['idField'],'value':_0x5e9ca9[_0x11be51[_0xeb2f('0x40')]]['toString']()});}else if(_0x11be51['type']===_0xeb2f('0x42')&&_0x11be51['Variable']&&_0x11be51[_0xeb2f('0x43')][_0xeb2f('0x16')]&&_0x11be51[_0xeb2f('0x41')]&&_0x11be51['customField']){_0x5e9ca9[_0x11be51[_0xeb2f('0x43')][_0xeb2f('0x16')][_0xeb2f('0x3b')]()]&&_0x2942b1[_0xeb2f('0x17')]['push']({'id':_0x11be51[_0xeb2f('0x41')],'value':_0x5e9ca9[_0x11be51['Variable'][_0xeb2f('0x16')][_0xeb2f('0x3b')]()][_0xeb2f('0x31')]()});}});}return _0x2942b1;}exports[_0xeb2f('0x44')]=function(_0x3e41a3,_0x332254,_0x28f4c5,_0x6da5dc,_0x1009a7,_0x141056){var _0x3240ec,_0x56fe40;_0x141056[_0xeb2f('0x1b')]=intUtil['stripTrailingSlash'](_0x141056[_0xeb2f('0x1b')]);_0x141056[_0xeb2f('0x45')]=intUtil[_0xeb2f('0x46')](_0x141056['serverUrl']);if(_0x1009a7&&_0x1009a7[_0xeb2f('0x47')]){logger['info']('[QUEUE]',_0xeb2f('0x48'));_0x332254[_0xeb2f('0x49')]=util['format'](_0xeb2f('0x4a'),_0x141056[_0xeb2f('0x45')],_0x332254[_0xeb2f('0x4b')],md5(_0x332254[_0xeb2f('0x4b')]));}else{_0x332254['recordingURL']='';}headers['Authorization']=getAuth(_0x141056);return getUser(_0x141056,_0x6da5dc[_0xeb2f('0x26')])['then'](function(_0x34b387){_0x3240ec=_0x34b387;logger[_0xeb2f('0x1e')](_0xeb2f('0x4c'),_0x3240ec['id']);return getEndUser(_0x141056,_0x332254[_0xeb2f('0x10')],_0x332254[_0xeb2f('0x11')]);})['then'](function(_0x1b8d9b){_0x56fe40=_0x1b8d9b;logger['info'](_0xeb2f('0x4d'),_0x56fe40['id']);return getTicket(_0x141056,_0x3240ec,_0x56fe40,_0x28f4c5,_0x332254);})[_0xeb2f('0x1d')](function(_0x5946fc){if(_0x5946fc&&_0x5946fc['id']){logger[_0xeb2f('0x1e')]('Ticket\x20created!');logger[_0xeb2f('0x1e')](_0xeb2f('0x4e'),_0x5946fc['id']);logger[_0xeb2f('0x1e')](_0xeb2f('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeb2f('0xe')](_0xeb2f('0x50'),_0x6da5dc[_0xeb2f('0x16')]),_0xeb2f('0x51'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x141056['remoteUri'],_0x5946fc['id'])});}})[_0xeb2f('0x52')](function(_0x1cf8ec){logger['error'](_0xeb2f('0x4f'),JSON[_0xeb2f('0x53')](_0x1cf8ec));});};exports[_0xeb2f('0x54')]=function(_0x34b6f9,_0x4977ac,_0x17318b,_0x10af3b,_0x235e1f,_0x284cdd,_0x589e69){var _0x269a2a,_0x1632df;_0x284cdd[_0xeb2f('0x1b')]=intUtil[_0xeb2f('0x46')](_0x284cdd[_0xeb2f('0x1b')]);_0x284cdd['serverUrl']=intUtil[_0xeb2f('0x46')](_0x284cdd[_0xeb2f('0x45')]);if(_0x589e69&&_0x589e69['recordingFormat']&&_0x589e69[_0xeb2f('0x55')]!==_0xeb2f('0x56')){logger[_0xeb2f('0x1e')](_0xeb2f('0x57'),_0xeb2f('0x48'));_0x4977ac[_0xeb2f('0x49')]=util['format'](_0xeb2f('0x4a'),_0x284cdd[_0xeb2f('0x45')],_0x4977ac['uniqueid'],md5(_0x4977ac[_0xeb2f('0x4b')]));}headers['Authorization']=getAuth(_0x284cdd);return getUser(_0x284cdd,_0x10af3b['email'])['then'](function(_0x5365eb){_0x269a2a=_0x5365eb;logger[_0xeb2f('0x1e')](_0xeb2f('0x4c'),_0x269a2a['id']);return getEndUser(_0x284cdd,_0x4977ac[_0xeb2f('0x58')],_0x4977ac[_0xeb2f('0x59')]);})[_0xeb2f('0x1d')](function(_0x401fd2){_0x1632df=_0x401fd2;logger[_0xeb2f('0x1e')]('The\x20Enduser\x20ID\x20is:',_0x1632df['id']);return getTicket(_0x284cdd,_0x269a2a,_0x1632df,_0x17318b,_0x4977ac);})['then'](function(_0x3247d1){if(_0x3247d1&&_0x3247d1['id']){logger['info'](_0xeb2f('0x1f'));logger[_0xeb2f('0x1e')](_0xeb2f('0x4e'),_0x3247d1['id']);logger[_0xeb2f('0x1e')](_0xeb2f('0x57'),_0xeb2f('0x5a'));emit(util[_0xeb2f('0xe')](_0xeb2f('0x50'),_0x10af3b[_0xeb2f('0x16')]),'trigger:browser:url',{'uri':util[_0xeb2f('0xe')]('%s/helpdesk/tickets/%d',_0x284cdd[_0xeb2f('0x1b')],_0x3247d1['id'])});}})[_0xeb2f('0x52')](function(_0xa63be7){logger[_0xeb2f('0x5b')](_0xeb2f('0x57'),JSON[_0xeb2f('0x53')](_0xa63be7));});};exports[_0xeb2f('0x5c')]=function(_0x599169,_0x5e9717,_0x148553,_0x4c7741,_0x52d1a7,_0x30bb41){var _0x42940e,_0x4478f3;_0x30bb41['remoteUri']=intUtil[_0xeb2f('0x46')](_0x30bb41[_0xeb2f('0x1b')]);_0x30bb41['serverUrl']=intUtil[_0xeb2f('0x46')](_0x30bb41[_0xeb2f('0x45')]);if(_0x52d1a7&&_0x52d1a7['monitor_format']){logger[_0xeb2f('0x1e')]('['+_0x5e9717[_0xeb2f('0x5d')][_0xeb2f('0x5e')]()+']',_0xeb2f('0x48'));_0x5e9717[_0xeb2f('0x49')]=util[_0xeb2f('0xe')](_0xeb2f('0x4a'),_0x30bb41[_0xeb2f('0x45')],_0x5e9717[_0xeb2f('0x4b')],md5(_0x5e9717[_0xeb2f('0x4b')]));}else{_0x5e9717[_0xeb2f('0x49')]='';}headers['Authorization']=getAuth(_0x30bb41);return getUser(_0x30bb41,'')['then'](function(_0x189a53){_0x42940e=_0x189a53;logger[_0xeb2f('0x1e')](_0xeb2f('0x4c'),_0x42940e['id']);return getEndUser(_0x30bb41,_0x5e9717[_0xeb2f('0x10')],_0x5e9717[_0xeb2f('0x11')]);})[_0xeb2f('0x1d')](function(_0x3c3618){_0x4478f3=_0x3c3618;logger[_0xeb2f('0x1e')](_0xeb2f('0x4d'),_0x4478f3['id']);return getTicket(_0x30bb41,_0x42940e,_0x4478f3,_0x148553,_0x5e9717);})[_0xeb2f('0x1d')](function(_0x5bac11){if(_0x5bac11){logger[_0xeb2f('0x1e')]('Ticket\x20created!');logger[_0xeb2f('0x1e')](_0xeb2f('0x4e'),_0x5bac11['id']);}})[_0xeb2f('0x52')](function(_0x509f0b){logger[_0xeb2f('0x5b')]('['+_0x5e9717[_0xeb2f('0x5d')]['toUpperCase']()+']',JSON[_0xeb2f('0x53')](_0x509f0b));});}; \ No newline at end of file +var _0xae42=['value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','toString','idField','push','content','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridnum','[OUTBOUND]','stringify','monitor_format','lastevent','catch','toUpperCase','request-promise','md5','ioredis','../../../../config/environment','redis','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','Subjects','getString','
','Tags','name','Fields','custom_fields','mapValues','keyBy'];(function(_0x40c0ff,_0x32ef02){var _0x59f4d1=function(_0x5876c0){while(--_0x5876c0){_0x40c0ff['push'](_0x40c0ff['shift']());}};_0x59f4d1(++_0x32ef02);}(_0xae42,0x98));var _0x2ae4=function(_0x1b0e59,_0x596faf){_0x1b0e59=_0x1b0e59-0x0;var _0x383761=_0xae42[_0x1b0e59];return _0x383761;};'use strict';var _=require('lodash');var rp=require(_0x2ae4('0x0'));var md5=require(_0x2ae4('0x1'));var util=require('util');var Redis=require(_0x2ae4('0x2'));var intUtil=require('./util');var config=require(_0x2ae4('0x3'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_['defaults'](config[_0x2ae4('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2ae4('0x4')]));var headers={'Content-Type':_0x2ae4('0x5'),'Accept':_0x2ae4('0x5')};function emit(_0x311d8e,_0x46f4de,_0x532a10){io['to'](_0x311d8e)[_0x2ae4('0x6')](_0x46f4de,_0x532a10);}function getTicket(_0x2bf235,_0x205df0,_0x47f3cf,_0x2da8c9,_0x5beaad){logger['info'](_0x2ae4('0x7'));var _0x5b1c17=_[_0x2ae4('0x8')]({'responder_id':_0x205df0['id'],'requester_id':_0x47f3cf['id'],'name':util[_0x2ae4('0x9')]('Caller\x20-\x20%s',_0x5beaad[_0x2ae4('0xa')]),'phone':_0x5beaad['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2da8c9[_0x2ae4('0xb')],_0x5beaad,'\x20'),'description':intUtil[_0x2ae4('0xc')](_0x2da8c9['Descriptions'],_0x5beaad,_0x2ae4('0xd')),'tags':getTags(_0x2da8c9[_0x2ae4('0xe')],_0x2ae4('0xf'))},getCustomFields(_0x2da8c9[_0x2ae4('0x10')],_0x5beaad));_0x5b1c17[_0x2ae4('0x11')]=_[_0x2ae4('0x12')](_[_0x2ae4('0x13')](_0x5b1c17[_0x2ae4('0x11')],'id'),_0x2ae4('0x14'));return request({'uri':util['format'](_0x2ae4('0x15'),_0x2bf235[_0x2ae4('0x16')]),'method':_0x2ae4('0x17'),'body':_0x5b1c17})[_0x2ae4('0x18')](function(_0x5773d9){logger[_0x2ae4('0x19')](_0x2ae4('0x1a'));return _0x5773d9;});}function getUser(_0x411d50,_0x181653){if(intUtil[_0x2ae4('0x1b')](_0x181653)){return request({'uri':util[_0x2ae4('0x9')](_0x2ae4('0x1c'),_0x411d50[_0x2ae4('0x16')]),'qs':{'email':_0x181653}})[_0x2ae4('0x18')](function(_0x41fd0e){if(_0x41fd0e[_0x2ae4('0x1d')]){logger['info'](_0x2ae4('0x1e'));return _[_0x2ae4('0x1f')](_0x41fd0e,function(_0x7e38f9){return _0x7e38f9[_0x2ae4('0x20')][_0x2ae4('0x21')]===_0x181653;});}else{logger[_0x2ae4('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2ae4('0x9')]('%s/api/v2/agents/me',_0x411d50[_0x2ae4('0x16')])})['then'](function(_0x427274){logger['info']('Admin\x20account\x20selected.');return _0x427274;});}});}else{logger[_0x2ae4('0x19')](_0x2ae4('0x22'));return request({'uri':util[_0x2ae4('0x9')]('%s/api/v2/agents/me',_0x411d50[_0x2ae4('0x16')])})[_0x2ae4('0x18')](function(_0x3ef9e2){logger[_0x2ae4('0x19')](_0x2ae4('0x23'));return _0x3ef9e2;});}}function getEndUser(_0x527c9c,_0x2ab237,_0x346bee){logger[_0x2ae4('0x19')](_0x2ae4('0x24'),_0x346bee);return request({'uri':util[_0x2ae4('0x9')](_0x2ae4('0x25'),_0x527c9c[_0x2ae4('0x16')]),'qs':{'phone':_0x346bee}})[_0x2ae4('0x18')](function(_0x373ba9){if(_0x373ba9[_0x2ae4('0x1d')]){logger['info']('Enduser\x20found!');return _[_0x2ae4('0x1f')](_0x373ba9,{'phone':_0x346bee});}else{logger[_0x2ae4('0x19')](_0x2ae4('0x26'));return request({'uri':util[_0x2ae4('0x9')](_0x2ae4('0x25'),_0x527c9c[_0x2ae4('0x16')]),'method':_0x2ae4('0x17'),'body':{'name':_0x2ab237,'phone':_0x346bee}})[_0x2ae4('0x18')](function(_0x1705ac){logger[_0x2ae4('0x19')](_0x2ae4('0x27'));return _0x1705ac;});}});}function getAuth(_0x6364c7){return util[_0x2ae4('0x9')](_0x2ae4('0x28'),new Buffer(_0x6364c7[_0x2ae4('0x29')]+':X')['toString']('base64'));}function request(_0x4dc233){logger[_0x2ae4('0x2a')](_0x2ae4('0x2b'),JSON['stringify'](_0x4dc233));return rp(_['defaults'](_0x4dc233,{'method':_0x2ae4('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0x17fea7,_0x5a9080){var _0xb81cdb=[];if(_0x17fea7&&_0x17fea7[_0x2ae4('0x1d')]>0x0){_0xb81cdb=_[_0x2ae4('0x2d')](_0x17fea7,_0x5a9080);}return _0xb81cdb;}function getCustomFields(_0x48472c,_0x285a55){var _0x511f7a=[];var _0x18ff79={'custom_fields':[]};if(_0x48472c[_0x2ae4('0x1d')]>0x0){_['forEach'](_0x48472c,function(_0x458329){if(_[_0x2ae4('0x2e')]([_0x2ae4('0x2f'),_0x2ae4('0x30')],_0x458329[_0x2ae4('0x31')])&&_0x458329[_0x2ae4('0x32')]&&!_0x458329[_0x2ae4('0x33')]){_0x18ff79[_0x458329['nameField'][_0x2ae4('0x34')]()]=_0x458329['content'][_0x2ae4('0x35')]();}else if(_[_0x2ae4('0x2e')]([_0x2ae4('0x2f'),_0x2ae4('0x30')],_0x458329[_0x2ae4('0x31')])&&_0x458329[_0x2ae4('0x36')]&&_0x458329[_0x2ae4('0x33')]){_0x18ff79[_0x2ae4('0x11')][_0x2ae4('0x37')]({'id':_0x458329[_0x2ae4('0x36')],'value':_0x458329[_0x2ae4('0x38')][_0x2ae4('0x35')]()});}else if(_0x458329['type']===_0x2ae4('0x39')&&_0x458329[_0x2ae4('0x3a')]&&_0x458329[_0x2ae4('0x36')]&&_0x458329[_0x2ae4('0x33')]){_0x285a55[_0x458329[_0x2ae4('0x3a')]]&&_0x18ff79[_0x2ae4('0x11')][_0x2ae4('0x37')]({'id':_0x458329['idField'],'value':_0x285a55[_0x458329[_0x2ae4('0x3a')]][_0x2ae4('0x35')]()});}else if(_0x458329[_0x2ae4('0x31')]===_0x2ae4('0x3b')&&_0x458329[_0x2ae4('0x3c')]&&_0x458329[_0x2ae4('0x3c')][_0x2ae4('0xf')]&&_0x458329[_0x2ae4('0x36')]&&_0x458329[_0x2ae4('0x33')]){_0x285a55[_0x458329['Variable']['name'][_0x2ae4('0x34')]()]&&_0x18ff79['custom_fields'][_0x2ae4('0x37')]({'id':_0x458329[_0x2ae4('0x36')],'value':_0x285a55[_0x458329['Variable'][_0x2ae4('0xf')][_0x2ae4('0x34')]()][_0x2ae4('0x35')]()});}});}return _0x18ff79;}exports['queue']=function(_0x549623,_0x426592,_0x4feea8,_0x55403c,_0x4268d2,_0x5243a9){var _0x568d88,_0x1f8e14;_0x5243a9['remoteUri']=intUtil[_0x2ae4('0x3d')](_0x5243a9[_0x2ae4('0x16')]);_0x5243a9[_0x2ae4('0x3e')]=intUtil[_0x2ae4('0x3d')](_0x5243a9[_0x2ae4('0x3e')]);if(_0x4268d2&&_0x4268d2['monitor_format']){logger[_0x2ae4('0x19')]('[QUEUE]',_0x2ae4('0x3f'));_0x426592[_0x2ae4('0x40')]=util[_0x2ae4('0x9')](_0x2ae4('0x41'),_0x5243a9[_0x2ae4('0x3e')],_0x426592[_0x2ae4('0x42')],md5(_0x426592['uniqueid']));}else{_0x426592['recordingURL']='';}headers[_0x2ae4('0x43')]=getAuth(_0x5243a9);return getUser(_0x5243a9,_0x55403c['email'])[_0x2ae4('0x18')](function(_0x21c845){_0x568d88=_0x21c845;logger[_0x2ae4('0x19')]('The\x20User\x20ID\x20is:',_0x568d88['id']);return getEndUser(_0x5243a9,_0x426592[_0x2ae4('0xa')],_0x426592['calleridnum']);})[_0x2ae4('0x18')](function(_0x2f61df){_0x1f8e14=_0x2f61df;logger[_0x2ae4('0x19')](_0x2ae4('0x44'),_0x1f8e14['id']);return getTicket(_0x5243a9,_0x568d88,_0x1f8e14,_0x4feea8,_0x426592);})[_0x2ae4('0x18')](function(_0x544ccf){if(_0x544ccf&&_0x544ccf['id']){logger[_0x2ae4('0x19')](_0x2ae4('0x1a'));logger[_0x2ae4('0x19')](_0x2ae4('0x45'),_0x544ccf['id']);logger[_0x2ae4('0x19')](_0x2ae4('0x46'),_0x2ae4('0x47'));emit(util[_0x2ae4('0x9')](_0x2ae4('0x48'),_0x55403c['name']),_0x2ae4('0x49'),{'uri':util['format'](_0x2ae4('0x4a'),_0x5243a9[_0x2ae4('0x16')],_0x544ccf['id'])});}})['catch'](function(_0x3f2944){logger[_0x2ae4('0x4b')]('[QUEUE]',JSON['stringify'](_0x3f2944));});};exports['outbound']=function(_0x804669,_0x29a3fe,_0x173f75,_0x4c45b3,_0x4b505e,_0x28734b,_0x27d497){var _0x12fff1,_0x8a5fb0;_0x28734b[_0x2ae4('0x16')]=intUtil[_0x2ae4('0x3d')](_0x28734b[_0x2ae4('0x16')]);_0x28734b[_0x2ae4('0x3e')]=intUtil['stripTrailingSlash'](_0x28734b[_0x2ae4('0x3e')]);if(_0x27d497&&_0x27d497['recordingFormat']&&_0x27d497[_0x2ae4('0x4c')]!==_0x2ae4('0x4d')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x29a3fe[_0x2ae4('0x40')]=util['format'](_0x2ae4('0x41'),_0x28734b['serverUrl'],_0x29a3fe['uniqueid'],md5(_0x29a3fe[_0x2ae4('0x42')]));}headers[_0x2ae4('0x43')]=getAuth(_0x28734b);return getUser(_0x28734b,_0x4c45b3['email'])[_0x2ae4('0x18')](function(_0x26d457){_0x12fff1=_0x26d457;logger[_0x2ae4('0x19')](_0x2ae4('0x4e'),_0x12fff1['id']);return getEndUser(_0x28734b,_0x29a3fe['destcalleridname'],_0x29a3fe[_0x2ae4('0x4f')]);})[_0x2ae4('0x18')](function(_0x384b66){_0x8a5fb0=_0x384b66;logger[_0x2ae4('0x19')](_0x2ae4('0x44'),_0x8a5fb0['id']);return getTicket(_0x28734b,_0x12fff1,_0x8a5fb0,_0x173f75,_0x29a3fe);})['then'](function(_0x29d2c0){if(_0x29d2c0&&_0x29d2c0['id']){logger[_0x2ae4('0x19')](_0x2ae4('0x1a'));logger[_0x2ae4('0x19')](_0x2ae4('0x45'),_0x29d2c0['id']);logger['info'](_0x2ae4('0x50'),_0x2ae4('0x47'));emit(util[_0x2ae4('0x9')](_0x2ae4('0x48'),_0x4c45b3[_0x2ae4('0xf')]),_0x2ae4('0x49'),{'uri':util[_0x2ae4('0x9')](_0x2ae4('0x4a'),_0x28734b[_0x2ae4('0x16')],_0x29d2c0['id'])});}})['catch'](function(_0x4f094a){logger['error'](_0x2ae4('0x50'),JSON[_0x2ae4('0x51')](_0x4f094a));});};exports['unmanaged']=function(_0x304eea,_0x9c1b44,_0x1b748a,_0x4382b8,_0x193f93,_0x32f04b){var _0x4ee59a,_0x104052;_0x32f04b['remoteUri']=intUtil[_0x2ae4('0x3d')](_0x32f04b['remoteUri']);_0x32f04b['serverUrl']=intUtil['stripTrailingSlash'](_0x32f04b[_0x2ae4('0x3e')]);if(_0x193f93&&_0x193f93[_0x2ae4('0x52')]){logger['info']('['+_0x9c1b44[_0x2ae4('0x53')]['toUpperCase']()+']',_0x2ae4('0x3f'));_0x9c1b44['recordingURL']=util[_0x2ae4('0x9')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x32f04b[_0x2ae4('0x3e')],_0x9c1b44[_0x2ae4('0x42')],md5(_0x9c1b44[_0x2ae4('0x42')]));}else{_0x9c1b44[_0x2ae4('0x40')]='';}headers[_0x2ae4('0x43')]=getAuth(_0x32f04b);return getUser(_0x32f04b,'')[_0x2ae4('0x18')](function(_0xfffe50){_0x4ee59a=_0xfffe50;logger['info']('The\x20User\x20ID\x20is:',_0x4ee59a['id']);return getEndUser(_0x32f04b,_0x9c1b44[_0x2ae4('0xa')],_0x9c1b44['calleridnum']);})[_0x2ae4('0x18')](function(_0x5c98c3){_0x104052=_0x5c98c3;logger['info']('The\x20Enduser\x20ID\x20is:',_0x104052['id']);return getTicket(_0x32f04b,_0x4ee59a,_0x104052,_0x1b748a,_0x9c1b44);})[_0x2ae4('0x18')](function(_0x552309){if(_0x552309){logger[_0x2ae4('0x19')](_0x2ae4('0x1a'));logger[_0x2ae4('0x19')](_0x2ae4('0x45'),_0x552309['id']);}})[_0x2ae4('0x54')](function(_0x1f63d2){logger[_0x2ae4('0x4b')]('['+_0x9c1b44[_0x2ae4('0x53')][_0x2ae4('0x55')]()+']',JSON[_0x2ae4('0x51')](_0x1f63d2));});}; \ 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 0e7d644..0a2eab6 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 _0xd43b=['contactNumber','YYYY-MM-DDTHH:mm:ss','contact','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','queue','unmanaged','%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',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0xd43b,0x76));var _0xbd43=function(_0x428355,_0x26c4d5){_0x428355=_0x428355-0x0;var _0x4e0aa7=_0xd43b[_0x428355];return _0x4e0aa7;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xbd43('0x0'));var util=require(_0xbd43('0x1'));var moment=require(_0xbd43('0x2'));var Promise=require(_0xbd43('0x3'));var Redis=require(_0xbd43('0x4'));var intUtil=require(_0xbd43('0x5'));var config=require(_0xbd43('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0xbd43('0x7')]=_['defaults'](config[_0xbd43('0x7')],{'host':_0xbd43('0x8'),'port':0x18eb});var io=require(_0xbd43('0x9'))(new Redis(config[_0xbd43('0x7')]));function getAdminId(_0x5965a0,_0x520eba,_0x313b74,_0x3b2039){return new Promise(function(_0xe5c66a,_0x27f15f){var _0x4b5e99=![];var _0x1ecb8a={'method':_0xbd43('0xa'),'uri':_0x3b2039+'/api/selector/owners','json':!![]};_0x1ecb8a[_0xbd43('0xb')]=_0x313b74;logger[_0xbd43('0xc')](_0xbd43('0xd'));return rp(_0x1ecb8a)[_0xbd43('0xe')](function(_0x4898c7){if(_0x4898c7){var _0x522631=_0x4898c7[_0xbd43('0xf')];var _0x4073f6=null;for(_0x4073f6=0x0;_0x4073f6<_0x522631['length'];_0x4073f6++){if(_0x522631[_0x4073f6]['email']===_0x5965a0['adminEmail']){_0x5965a0[_0xbd43('0x10')]=_0x522631[_0x4073f6]['id'];_0x4b5e99=!![];}}if(_0x4b5e99){logger[_0xbd43('0xc')](_0xbd43('0x11'),_0x5965a0[_0xbd43('0x10')]);_0xe5c66a(_0x5965a0);}else{_0x27f15f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x27f15f({'statusCode':0x194,'message':_0xbd43('0x12')});}})[_0xbd43('0x13')](function(_0x1ef4a0){logger[_0xbd43('0x14')]('['+[_0x520eba[_0xbd43('0x15')]()]+']',_0x1ef4a0[_0xbd43('0x16')]);_0x27f15f(_0x1ef4a0);});});}function getUser(_0x47b1e6,_0x462a84,_0x5a008c){return function(_0x5a79cf){return new Promise(function(_0x58a051,_0x18bb9f){var _0x4dfc5d={'method':_0xbd43('0xa'),'uri':_0x5a008c+_0xbd43('0x17'),'json':!![]};_0x4dfc5d[_0xbd43('0xb')]=_0x462a84;logger[_0xbd43('0xc')](_0xbd43('0x18'));return rp(_0x4dfc5d)[_0xbd43('0xe')](function(_0x3b4801){if(_0x3b4801){var _0x4270f7=_0x3b4801[_0xbd43('0xf')];var _0x3b5c60=![];var _0xdde2ec=null;if(_0x5a79cf[_0xbd43('0x19')]!==null){logger[_0xbd43('0xc')](_0xbd43('0x1a'),_0x5a79cf[_0xbd43('0x19')]);_0x5a79cf[_0xbd43('0x1b')]=_0x5a79cf[_0xbd43('0x19')];for(_0xdde2ec=0x0;_0xdde2ec<_0x4270f7[_0xbd43('0x1c')];_0xdde2ec++){if(_0x4270f7[_0xdde2ec][_0xbd43('0x1d')]===_0x5a79cf['agentEmail']){_0x3b5c60=!![];_0x5a79cf[_0xbd43('0x1e')]=_0x4270f7[_0xdde2ec]['id'];logger[_0xbd43('0xc')](_0xbd43('0x1f'),_0x5a79cf[_0xbd43('0x1e')]);}}}if(!_0x3b5c60){logger['info'](_0xbd43('0x20'));_0x5a79cf['userEmail']=_0x5a79cf['adminEmail'];_0x5a79cf[_0xbd43('0x1e')]=_0x5a79cf[_0xbd43('0x10')];_0x3b5c60=!![];}if(_0x3b5c60){_0x58a051(_0x5a79cf);}else{_0x18bb9f({'statusCode':0x194,'message':_0xbd43('0x12')});}}else{_0x18bb9f({'statusCode':0x194,'message':_0xbd43('0x12')});}})['catch'](function(_0x565066){logger[_0xbd43('0x14')]('['+[_0x47b1e6[_0xbd43('0x15')]()]+']',_0x565066[_0xbd43('0x16')]);_0x18bb9f(_0x565066);});});};}function searchContact(_0x4606e1,_0x498786,_0xd9ba9d,_0x2e1624){return new Promise(function(_0x1d5f75,_0x183e0c){var _0x57af9a={'method':_0xbd43('0xa'),'headers':_0x498786,'uri':_0x4606e1+_0xbd43('0x21')+_0x2e1624+'&f='+_0xd9ba9d+'&entities=contact','json':!![]};rp(_0x57af9a)[_0xbd43('0xe')](function(_0x42d3de){var _0x2ec369=_[_0xbd43('0x22')](_0x42d3de['contacts'][_0xbd43('0x23')],[_0xd9ba9d,_0x2e1624]);_0x1d5f75(_0x2ec369);})[_0xbd43('0x13')](function(_0x2f823d){_0x183e0c(_0x2f823d);});});}function getEndUser(_0x52e771,_0xc8b2a3,_0x15dd31){return function(_0x3452d0){return new Promise(function(_0xdf74b5,_0x48cb71){logger['info'](util[_0xbd43('0x24')](_0xbd43('0x25'),_0x3452d0['contactNumber']));searchContact(_0x15dd31,_0xc8b2a3,_0xbd43('0x26'),_0x3452d0['contactNumber'])['then'](function(_0x3a952e){if(_0x3a952e){_0x3452d0['endUserId']=_0x3a952e['id'];logger[_0xbd43('0xc')](_0xbd43('0x27'),_0x3452d0[_0xbd43('0x28')]);return _0xdf74b5(_0x3452d0);}searchContact(_0x15dd31,_0xc8b2a3,_0xbd43('0x29'),_0x3452d0['contactNumber'])[_0xbd43('0xe')](function(_0x3d6800){if(_0x3d6800){_0x3452d0[_0xbd43('0x28')]=_0x3d6800['id'];logger['info'](_0xbd43('0x2a'),_0x3452d0[_0xbd43('0x28')]);return _0xdf74b5(_0x3452d0);}createEndUser(_0x3452d0,_0x52e771,_0xc8b2a3,_0x15dd31)[_0xbd43('0xe')](function(_0x484218){logger[_0xbd43('0xc')](_0xbd43('0x2b'),_0x484218[_0xbd43('0x28')]);return _0xdf74b5(_0x484218);});});})[_0xbd43('0x13')](function(_0x38fc57){_0x48cb71(_0x38fc57);});});};}function createEndUser(_0x1b90d0,_0x3a02dc,_0xd36434,_0x28578d){return new Promise(function(_0x40b2ee,_0xef0c8b){var _0x13ee77=moment();var _0x3a3b95={'method':_0xbd43('0x2c'),'uri':_0x28578d+_0xbd43('0x2d'),'body':{'contact':{'last_name':_0x1b90d0['contactNumber'],'work_number':_0x1b90d0[_0xbd43('0x2e')],'mobile_number':_0x1b90d0['contactNumber'],'owner_id':_0x1b90d0['userId'],'created_at':_0x13ee77[_0xbd43('0x24')](_0xbd43('0x2f'))}},'json':!![]};_0x3a3b95['headers']=_0xd36434;logger[_0xbd43('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3a3b95)[_0xbd43('0xe')](function(_0x4564b1){_0x1b90d0[_0xbd43('0x28')]=_0x4564b1[_0xbd43('0x30')]['id'];_0x40b2ee(_0x1b90d0);})['catch'](function(_0x2d26a1){logger[_0xbd43('0x14')]('['+[_0x3a02dc[_0xbd43('0x15')]()]+']',_0x2d26a1[_0xbd43('0x16')]);_0xef0c8b(_0x2d26a1['message']);});});}function getTicket(_0x68a659,_0xc30763,_0x382e81,_0x136fd8,_0x558bba){return function(_0xc82a4c){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x461436,_0x2b16b4){var _0x349686=moment();var _0x3757d6={'method':'POST','uri':_0x382e81+'/api/tasks','body':{'title':intUtil[_0xbd43('0x31')](_0x136fd8['Subjects'],_0x558bba,'\x20'),'description':intUtil[_0xbd43('0x31')](_0x136fd8[_0xbd43('0x32')],_0x558bba,'\x0a'),'owner_id':_0xc82a4c[_0xbd43('0x1e')],'creater_id':_0xc82a4c[_0xbd43('0x10')],'targetable_id':_0xc82a4c[_0xbd43('0x28')],'targetable_type':_0xbd43('0x33'),'created_at':_0x349686[_0xbd43('0x24')](_0xbd43('0x2f')),'due_date':_0x349686[_0xbd43('0x34')](0x1e,'m')['format'](_0xbd43('0x2f'))},'json':!![]};_0x3757d6[_0xbd43('0xb')]=_0xc30763;return rp(_0x3757d6)[_0xbd43('0xe')](function(_0x41a3d8){_0xc82a4c[_0xbd43('0x35')]=_0x41a3d8[_0xbd43('0x36')]['id'];logger[_0xbd43('0xc')](_0xbd43('0x37'),_0xc82a4c['ticketId']);_0x461436(_0xc82a4c);})['catch'](function(_0x4f2526){logger[_0xbd43('0x14')]('['+[_0x68a659[_0xbd43('0x15')]()]+']',_0x4f2526[_0xbd43('0x16')]);_0x2b16b4(_0x4f2526[_0xbd43('0x16')]);});});};}function emit(_0x251aa9,_0x565aaf,_0x45c77c){var _0x94bb4d={'uri':_0x251aa9+_0xbd43('0x38')+_0x45c77c};io['to'](util[_0xbd43('0x24')](_0xbd43('0x39'),_0x565aaf))[_0xbd43('0x3a')](_0xbd43('0x3b'),_0x94bb4d);}exports['cs']=function(_0x442e85,_0x2dce48,_0x594862,_0x442ea9,_0x52c2eb,_0x2dbc39,_0x491062,_0x1f3807){var _0x236c3e={};var _0x20bad3={'Authorization':_0xbd43('0x3c')+_0x2dbc39[_0xbd43('0x3d')]};_0x2dbc39[_0xbd43('0x3e')]=intUtil[_0xbd43('0x3f')](_0x2dbc39[_0xbd43('0x3e')]);_0x2dbc39[_0xbd43('0x40')]=intUtil[_0xbd43('0x3f')](_0x2dbc39[_0xbd43('0x40')]);var _0x11ccfc=_0x2dbc39[_0xbd43('0x3e')];_0x236c3e['adminEmail']=_0x2dbc39[_0xbd43('0x41')];_0x236c3e[_0xbd43('0x2e')]=_0x1f3807[_0xbd43('0x42')]()===_0xbd43('0x43')?_0x2dce48['destcalleridnum']:_0x2dce48[_0xbd43('0x44')];_0x236c3e['callDirection']=_0x1f3807===_0xbd43('0x45')||_0x1f3807===_0xbd43('0x46')?'queue':_0xbd43('0x43');if(_0x442ea9){_0x236c3e[_0xbd43('0x19')]=_0x442ea9[_0xbd43('0x1d')];}var _0x1c28ec=util[_0xbd43('0x24')](_0xbd43('0x47'),_0x2dbc39[_0xbd43('0x40')],_0x2dce48[_0xbd43('0x48')],md5(_0x2dce48['uniqueid']));if(_0x52c2eb&&_0x52c2eb[_0xbd43('0x49')]){logger['info'](_0xbd43('0x4a'),_0xbd43('0x4b'));_0x2dce48[_0xbd43('0x4c')]=_0x1c28ec;}else if(_0x491062&&_0x491062['recordingFormat']&&_0x491062[_0xbd43('0x4d')]!==_0xbd43('0x4e')){logger[_0xbd43('0xc')]('[OUTBOUND]',_0xbd43('0x4b'));_0x2dce48[_0xbd43('0x4c')]=_0x1c28ec;}else{_0x2dce48[_0xbd43('0x4c')]='';}return getAdminId(_0x236c3e,_0x1f3807,_0x20bad3,_0x11ccfc)[_0xbd43('0xe')](getUser(_0x1f3807,_0x20bad3,_0x11ccfc))[_0xbd43('0xe')](getEndUser(_0x1f3807,_0x20bad3,_0x11ccfc))[_0xbd43('0xe')](getTicket(_0x1f3807,_0x20bad3,_0x11ccfc,_0x594862,_0x2dce48))['then'](function(_0x4093fb){logger[_0xbd43('0xc')](util['format'](_0xbd43('0x4f'),_0x4093fb['ticketId']));if(_0x1f3807!==_0xbd43('0x46')){logger[_0xbd43('0xc')]('['+[_0x1f3807['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x11ccfc,_0x442ea9['name'],_0x4093fb[_0xbd43('0x28')]);}})[_0xbd43('0x13')](function(_0xc5cdcc){logger[_0xbd43('0x14')]('['+[_0x1f3807[_0xbd43('0x15')]()]+_0xbd43('0x50'),util[_0xbd43('0x51')](_0xc5cdcc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x221f=['ioredis','./util','../../../../config/logger','freshsales','redis','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','users','email','adminEmail','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','then','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','toUpperCase','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','contactNumber','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x221f,0xeb));var _0xf221=function(_0x43b5a7,_0xf5e3d6){_0x43b5a7=_0x43b5a7-0x0;var _0x5461fe=_0x221f[_0x43b5a7];return _0x5461fe;};'use strict';var _=require(_0xf221('0x0'));var rp=require(_0xf221('0x1'));var md5=require(_0xf221('0x2'));var util=require(_0xf221('0x3'));var moment=require(_0xf221('0x4'));var Promise=require('bluebird');var Redis=require(_0xf221('0x5'));var intUtil=require(_0xf221('0x6'));var config=require('../../../../config/environment');var logger=require(_0xf221('0x7'))(_0xf221('0x8'));config[_0xf221('0x9')]=_['defaults'](config[_0xf221('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf221('0xa'))(new Redis(config[_0xf221('0x9')]));function getAdminId(_0x234fb5,_0x260a3d,_0x22d119,_0x5940cf){return new Promise(function(_0x12a0be,_0x51788d){var _0x1eaa7d=![];var _0x357779={'method':'GET','uri':_0x5940cf+_0xf221('0xb'),'json':!![]};_0x357779[_0xf221('0xc')]=_0x22d119;logger['info'](_0xf221('0xd'));return rp(_0x357779)['then'](function(_0x2c2878){if(_0x2c2878){var _0x308dd8=_0x2c2878[_0xf221('0xe')];var _0x151749=null;for(_0x151749=0x0;_0x151749<_0x308dd8['length'];_0x151749++){if(_0x308dd8[_0x151749][_0xf221('0xf')]===_0x234fb5[_0xf221('0x10')]){_0x234fb5['adminId']=_0x308dd8[_0x151749]['id'];_0x1eaa7d=!![];}}if(_0x1eaa7d){logger[_0xf221('0x11')]('Admin\x20found:',_0x234fb5[_0xf221('0x12')]);_0x12a0be(_0x234fb5);}else{_0x51788d({'statusCode':0x194,'message':_0xf221('0x13')});}}else{_0x51788d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf221('0x14')](function(_0x558a32){logger[_0xf221('0x15')]('['+[_0x260a3d['toUpperCase']()]+']',_0x558a32[_0xf221('0x16')]);_0x51788d(_0x558a32);});});}function getUser(_0x3fbb45,_0x3b2ca4,_0xc4f60b){return function(_0x25deee){return new Promise(function(_0xd017a4,_0x5d5697){var _0x1e0f4d={'method':_0xf221('0x17'),'uri':_0xc4f60b+'/api/selector/owners','json':!![]};_0x1e0f4d[_0xf221('0xc')]=_0x3b2ca4;logger[_0xf221('0x11')]('Getting\x20user\x20list');return rp(_0x1e0f4d)[_0xf221('0x18')](function(_0x29daf0){if(_0x29daf0){var _0x373d49=_0x29daf0[_0xf221('0xe')];var _0x5910cb=![];var _0x529340=null;if(_0x25deee[_0xf221('0x19')]!==null){logger[_0xf221('0x11')](_0xf221('0x1a'),_0x25deee[_0xf221('0x19')]);_0x25deee['userEmail']=_0x25deee['agentEmail'];for(_0x529340=0x0;_0x529340<_0x373d49[_0xf221('0x1b')];_0x529340++){if(_0x373d49[_0x529340][_0xf221('0xf')]===_0x25deee[_0xf221('0x19')]){_0x5910cb=!![];_0x25deee[_0xf221('0x1c')]=_0x373d49[_0x529340]['id'];logger['info'](_0xf221('0x1d'),_0x25deee[_0xf221('0x1c')]);}}}if(!_0x5910cb){logger['info'](_0xf221('0x1e'));_0x25deee['userEmail']=_0x25deee[_0xf221('0x10')];_0x25deee[_0xf221('0x1c')]=_0x25deee[_0xf221('0x12')];_0x5910cb=!![];}if(_0x5910cb){_0xd017a4(_0x25deee);}else{_0x5d5697({'statusCode':0x194,'message':_0xf221('0x13')});}}else{_0x5d5697({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf221('0x14')](function(_0x494dec){logger['error']('['+[_0x3fbb45[_0xf221('0x1f')]()]+']',_0x494dec[_0xf221('0x16')]);_0x5d5697(_0x494dec);});});};}function searchContact(_0x13b893,_0x2b4768,_0x387f25,_0x33588b){return new Promise(function(_0x39e4b5,_0x556de4){var _0x57a114={'method':_0xf221('0x17'),'headers':_0x2b4768,'uri':_0x13b893+'/api/lookup?q='+_0x33588b+_0xf221('0x20')+_0x387f25+_0xf221('0x21'),'json':!![]};rp(_0x57a114)['then'](function(_0x4389ed){var _0x3904e6=_[_0xf221('0x22')](_0x4389ed[_0xf221('0x23')]['contacts'],[_0x387f25,_0x33588b]);_0x39e4b5(_0x3904e6);})[_0xf221('0x14')](function(_0x20c5b4){_0x556de4(_0x20c5b4);});});}function getEndUser(_0x4bb2bc,_0x5608fa,_0x5f286c){return function(_0x5b19e4){return new Promise(function(_0x18c38c,_0x2fe2e8){logger[_0xf221('0x11')](util[_0xf221('0x24')](_0xf221('0x25'),_0x5b19e4['contactNumber']));searchContact(_0x5f286c,_0x5608fa,_0xf221('0x26'),_0x5b19e4['contactNumber'])[_0xf221('0x18')](function(_0xe98111){if(_0xe98111){_0x5b19e4[_0xf221('0x27')]=_0xe98111['id'];logger[_0xf221('0x11')](_0xf221('0x28'),_0x5b19e4[_0xf221('0x27')]);return _0x18c38c(_0x5b19e4);}searchContact(_0x5f286c,_0x5608fa,'work_number',_0x5b19e4['contactNumber'])[_0xf221('0x18')](function(_0x20d054){if(_0x20d054){_0x5b19e4[_0xf221('0x27')]=_0x20d054['id'];logger[_0xf221('0x11')](_0xf221('0x29'),_0x5b19e4[_0xf221('0x27')]);return _0x18c38c(_0x5b19e4);}createEndUser(_0x5b19e4,_0x4bb2bc,_0x5608fa,_0x5f286c)[_0xf221('0x18')](function(_0x578a85){logger[_0xf221('0x11')]('Contact\x20created:',_0x578a85[_0xf221('0x27')]);return _0x18c38c(_0x578a85);});});})[_0xf221('0x14')](function(_0x287622){_0x2fe2e8(_0x287622);});});};}function createEndUser(_0x1b746d,_0x3238c1,_0x279662,_0xef82e3){return new Promise(function(_0x16f0ff,_0x224cdf){var _0x443ac4=moment();var _0x1e3f8c={'method':_0xf221('0x2a'),'uri':_0xef82e3+_0xf221('0x2b'),'body':{'contact':{'last_name':_0x1b746d[_0xf221('0x2c')],'work_number':_0x1b746d[_0xf221('0x2c')],'mobile_number':_0x1b746d[_0xf221('0x2c')],'owner_id':_0x1b746d[_0xf221('0x1c')],'created_at':_0x443ac4[_0xf221('0x24')](_0xf221('0x2d'))}},'json':!![]};_0x1e3f8c[_0xf221('0xc')]=_0x279662;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1e3f8c)[_0xf221('0x18')](function(_0x568080){_0x1b746d[_0xf221('0x27')]=_0x568080[_0xf221('0x2e')]['id'];_0x16f0ff(_0x1b746d);})[_0xf221('0x14')](function(_0x55e151){logger[_0xf221('0x15')]('['+[_0x3238c1[_0xf221('0x1f')]()]+']',_0x55e151['message']);_0x224cdf(_0x55e151[_0xf221('0x16')]);});});}function getTicket(_0x13958f,_0x9fe33e,_0x38201e,_0x13a94d,_0x297f55){return function(_0x1881fe){logger[_0xf221('0x11')](_0xf221('0x2f'));return new Promise(function(_0x1acc76,_0x47f3b8){var _0x536549=moment();var _0x275d9f={'method':_0xf221('0x2a'),'uri':_0x38201e+_0xf221('0x30'),'body':{'title':intUtil['getString'](_0x13a94d[_0xf221('0x31')],_0x297f55,'\x20'),'description':intUtil['getString'](_0x13a94d['Descriptions'],_0x297f55,'\x0a'),'owner_id':_0x1881fe[_0xf221('0x1c')],'creater_id':_0x1881fe[_0xf221('0x12')],'targetable_id':_0x1881fe[_0xf221('0x27')],'targetable_type':_0xf221('0x32'),'created_at':_0x536549[_0xf221('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x536549[_0xf221('0x33')](0x1e,'m')[_0xf221('0x24')](_0xf221('0x2d'))},'json':!![]};_0x275d9f[_0xf221('0xc')]=_0x9fe33e;return rp(_0x275d9f)[_0xf221('0x18')](function(_0x4994a8){_0x1881fe[_0xf221('0x34')]=_0x4994a8[_0xf221('0x35')]['id'];logger[_0xf221('0x11')](_0xf221('0x36'),_0x1881fe[_0xf221('0x34')]);_0x1acc76(_0x1881fe);})[_0xf221('0x14')](function(_0x217dae){logger[_0xf221('0x15')]('['+[_0x13958f['toUpperCase']()]+']',_0x217dae[_0xf221('0x16')]);_0x47f3b8(_0x217dae[_0xf221('0x16')]);});});};}function emit(_0x1835bc,_0x31462b,_0x589b39){var _0x5af648={'uri':_0x1835bc+_0xf221('0x37')+_0x589b39};io['to'](util[_0xf221('0x24')]('user:%s',_0x31462b))[_0xf221('0x38')](_0xf221('0x39'),_0x5af648);}exports['cs']=function(_0x423e8c,_0x5c97cb,_0xa5dcf5,_0x4a3ddf,_0x30918c,_0x5693d2,_0x33f081,_0x4f7950){var _0x3cc985={};var _0x55e701={'Authorization':_0xf221('0x3a')+_0x5693d2[_0xf221('0x3b')]};_0x5693d2['remoteUri']=intUtil[_0xf221('0x3c')](_0x5693d2[_0xf221('0x3d')]);_0x5693d2['serverUrl']=intUtil[_0xf221('0x3c')](_0x5693d2[_0xf221('0x3e')]);var _0x292f37=_0x5693d2[_0xf221('0x3d')];_0x3cc985[_0xf221('0x10')]=_0x5693d2[_0xf221('0x3f')];_0x3cc985[_0xf221('0x2c')]=_0x4f7950[_0xf221('0x40')]()==='outbound'?_0x5c97cb[_0xf221('0x41')]:_0x5c97cb['calleridnum'];_0x3cc985[_0xf221('0x42')]=_0x4f7950===_0xf221('0x43')||_0x4f7950===_0xf221('0x44')?_0xf221('0x43'):_0xf221('0x45');if(_0x4a3ddf){_0x3cc985[_0xf221('0x19')]=_0x4a3ddf[_0xf221('0xf')];}var _0x7a6153=util[_0xf221('0x24')](_0xf221('0x46'),_0x5693d2[_0xf221('0x3e')],_0x5c97cb[_0xf221('0x47')],md5(_0x5c97cb['uniqueid']));if(_0x30918c&&_0x30918c[_0xf221('0x48')]){logger[_0xf221('0x11')](_0xf221('0x49'),_0xf221('0x4a'));_0x5c97cb[_0xf221('0x4b')]=_0x7a6153;}else if(_0x33f081&&_0x33f081['recordingFormat']&&_0x33f081[_0xf221('0x4c')]!=='none'){logger[_0xf221('0x11')]('[OUTBOUND]',_0xf221('0x4a'));_0x5c97cb[_0xf221('0x4b')]=_0x7a6153;}else{_0x5c97cb[_0xf221('0x4b')]='';}return getAdminId(_0x3cc985,_0x4f7950,_0x55e701,_0x292f37)[_0xf221('0x18')](getUser(_0x4f7950,_0x55e701,_0x292f37))[_0xf221('0x18')](getEndUser(_0x4f7950,_0x55e701,_0x292f37))['then'](getTicket(_0x4f7950,_0x55e701,_0x292f37,_0xa5dcf5,_0x5c97cb))[_0xf221('0x18')](function(_0x294ee8){logger[_0xf221('0x11')](util[_0xf221('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x294ee8['ticketId']));if(_0x4f7950!==_0xf221('0x44')){logger[_0xf221('0x11')]('['+[_0x4f7950[_0xf221('0x1f')]()]+']',_0xf221('0x4d'));emit(_0x292f37,_0x4a3ddf[_0xf221('0x4e')],_0x294ee8['endUserId']);}})[_0xf221('0x14')](function(_0x1818c3){logger['error']('['+[_0x4f7950['toUpperCase']()]+_0xf221('0x4f'),util['inspect'](_0x1818c3,{'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 09a82bd..d27c074 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 _0xe336=['routeId','outbound','log','unmanaged','zendesk','freshdesk','zoho','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','salesforce','sugarcrm','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xe336,0x153));var _0x6e33=function(_0x2ae8fa,_0x976ed5){_0x2ae8fa=_0x2ae8fa-0x0;var _0x2b6095=_0xe336[_0x2ae8fa];return _0x2b6095;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x6e33('0x0'));var salesforce=require('./salesforce');var sugarcrm=require(_0x6e33('0x1'));var freshdesk=require(_0x6e33('0x2'));var zoho=require(_0x6e33('0x3'));var desk=require(_0x6e33('0x4'));var vtiger=require(_0x6e33('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x6e33('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x6e33('0x7'),_0x6e33('0x8'),'freshdesk','zoho','desk',_0x6e33('0x9'),'dynamics365',_0x6e33('0xa'),_0x6e33('0xb')];exports[_0x6e33('0xc')]=function(_0x499874,_0x4fd809,_0x33030e,_0x3eedcb,_0x4c8ad3,_0x51bf37){if(_0x33030e){if(_[_0x6e33('0xd')](integrations,_0x499874[_0x6e33('0xe')][_0x6e33('0xf')]())){try{var _0x49cd72=null;var _0x34702d='';var _0x37a5e8=_0x33030e[_0x499874[_0x6e33('0xe')][_0x6e33('0xf')]()];if(_0x37a5e8){var _0xcec5cd=_0x37a5e8[_0x499874[_0x6e33('0x10')]];if(_0xcec5cd){var _0x153ac4=_[_0x6e33('0x11')](_0xcec5cd[_0x6e33('0x12')],{'id':parseInt(_0x499874[_0x6e33('0x13')],0xa)});if(_0x153ac4){if(_0x3eedcb){if(_0x4c8ad3&&_0x4fd809[_0x6e33('0x14')]){_0x34702d=_0x6e33('0x14');}else if(_0x4fd809[_0x6e33('0x15')]){_0x34702d=_0x6e33('0x16');}else{console[_0x6e33('0x17')]('EVENT\x20UNKNOWN',_0x4fd809);}}else{_0x34702d=_0x6e33('0x18');}switch(_0x499874[_0x6e33('0xe')][_0x6e33('0xf')]()){case _0x6e33('0x19'):zendesk[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0x7'):salesforce[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case'sugarcrm':sugarcrm[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0x1a'):freshdesk[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0x1b'):zoho[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0x1c'):desk[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0x9'):vtiger[_0x34702d](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37);break;case _0x6e33('0xa'):freshsales['cs'](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37,_0x34702d);break;case _0x6e33('0xb'):servicenow['cs'](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37,_0x34702d);break;case'dynamics365':dynamics365['cs'](_0x499874,_0x4fd809,_0x153ac4,_0x3eedcb,_0x4c8ad3,_0xcec5cd,_0x51bf37,_0x34702d);break;default:console[_0x6e33('0x17')](_0x6e33('0x1d'));}}else{_0x49cd72=require(_0x6e33('0x1e'))(_0x499874['data1']['toLowerCase']());_0x49cd72[_0x6e33('0x1f')](_0x6e33('0x20'),util['format'](_0x6e33('0x21'),_0x499874[_0x6e33('0xe')][_0x6e33('0xf')](),_0x499874[_0x6e33('0x13')]));}}else{_0x49cd72=require(_0x6e33('0x1e'))(_0x499874[_0x6e33('0xe')][_0x6e33('0xf')]());_0x49cd72['error'](_0x6e33('0x20'),util[_0x6e33('0x22')](_0x6e33('0x23'),_0x499874[_0x6e33('0xe')][_0x6e33('0xf')](),_0x499874[_0x6e33('0x10')]));}}else{}}catch(_0x59c69f){console['error'](_0x59c69f);}}}}; \ No newline at end of file +var _0x7dee=['./zoho','./desk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','includes','toLowerCase','data1','data2','find','Configurations','data3','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','error','lodash','./zendesk','./sugarcrm','./freshdesk'];(function(_0x1da407,_0xe685a8){var _0xb3605e=function(_0x20e0f6){while(--_0x20e0f6){_0x1da407['push'](_0x1da407['shift']());}};_0xb3605e(++_0xe685a8);}(_0x7dee,0xb0));var _0xe7de=function(_0x3bf181,_0x126273){_0x3bf181=_0x3bf181-0x0;var _0x5c33b9=_0x7dee[_0x3bf181];return _0x5c33b9;};'use strict';var _=require(_0xe7de('0x0'));var util=require('util');var zendesk=require(_0xe7de('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xe7de('0x2'));var freshdesk=require(_0xe7de('0x3'));var zoho=require(_0xe7de('0x4'));var desk=require(_0xe7de('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xe7de('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xe7de('0x7'));var integrations=[_0xe7de('0x8'),_0xe7de('0x9'),_0xe7de('0xa'),_0xe7de('0xb'),_0xe7de('0xc'),'desk',_0xe7de('0xd'),_0xe7de('0xe'),_0xe7de('0xf'),_0xe7de('0x10')];exports['exec']=function(_0x130ac8,_0x42ddbc,_0x2a2042,_0x35718e,_0x18d907,_0x93a234){if(_0x2a2042){if(_[_0xe7de('0x11')](integrations,_0x130ac8['data1'][_0xe7de('0x12')]())){try{var _0x2d0a90=null;var _0x38c0a1='';var _0x2c535c=_0x2a2042[_0x130ac8[_0xe7de('0x13')]['toLowerCase']()];if(_0x2c535c){var _0x1cb4cf=_0x2c535c[_0x130ac8[_0xe7de('0x14')]];if(_0x1cb4cf){var _0x280473=_[_0xe7de('0x15')](_0x1cb4cf[_0xe7de('0x16')],{'id':parseInt(_0x130ac8[_0xe7de('0x17')],0xa)});if(_0x280473){if(_0x35718e){if(_0x18d907&&_0x42ddbc['queue']){_0x38c0a1='queue';}else if(_0x42ddbc[_0xe7de('0x18')]){_0x38c0a1=_0xe7de('0x19');}else{console[_0xe7de('0x1a')](_0xe7de('0x1b'),_0x42ddbc);}}else{_0x38c0a1=_0xe7de('0x1c');}switch(_0x130ac8['data1'][_0xe7de('0x12')]()){case'zendesk':zendesk[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case'salesforce':salesforce[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case'sugarcrm':sugarcrm[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case _0xe7de('0xb'):freshdesk[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case _0xe7de('0xc'):zoho[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case'desk':desk[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case _0xe7de('0xd'):vtiger[_0x38c0a1](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234);break;case _0xe7de('0xf'):freshsales['cs'](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234,_0x38c0a1);break;case _0xe7de('0x10'):servicenow['cs'](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234,_0x38c0a1);break;case _0xe7de('0xe'):dynamics365['cs'](_0x130ac8,_0x42ddbc,_0x280473,_0x35718e,_0x18d907,_0x1cb4cf,_0x93a234,_0x38c0a1);break;default:console[_0xe7de('0x1a')](_0xe7de('0x1d'));}}else{_0x2d0a90=require(_0xe7de('0x1e'))(_0x130ac8[_0xe7de('0x13')][_0xe7de('0x12')]());_0x2d0a90['error'](_0xe7de('0x1f'),util[_0xe7de('0x20')](_0xe7de('0x21'),_0x130ac8['data1'][_0xe7de('0x12')](),_0x130ac8['data3']));}}else{_0x2d0a90=require(_0xe7de('0x1e'))(_0x130ac8[_0xe7de('0x13')][_0xe7de('0x12')]());_0x2d0a90['error'](_0xe7de('0x1f'),util[_0xe7de('0x20')](_0xe7de('0x22'),_0x130ac8[_0xe7de('0x13')][_0xe7de('0x12')](),_0x130ac8[_0xe7de('0x14')]));}}else{}}catch(_0xd7f3ca){console[_0xe7de('0x23')](_0xd7f3ca);}}}}; \ 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 de121ec..d75f42a 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 _0x7f5a=['ActivityDate','IsRecurrence','endUserType','lead','WhoId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','then','length','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','Contact','find','execute','cloneDeep','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','contact','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','LastName','format','Company','No\x20Company','Name','upperFirst','includes','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','catch','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task'];(function(_0x1cd823,_0x5cd14b){var _0x44ba48=function(_0x10f161){while(--_0x10f161){_0x1cd823['push'](_0x1cd823['shift']());}};_0x44ba48(++_0x5cd14b);}(_0x7f5a,0x167));var _0xa7f5=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x7f5a[_0x277107];return _0x1da046;};'use strict';var _=require(_0xa7f5('0x0'));var rp=require(_0xa7f5('0x1'));var moment=require(_0xa7f5('0x2'));var BPromise=require('bluebird');var md5=require(_0xa7f5('0x3'));var jsforce=require(_0xa7f5('0x4'));var util=require(_0xa7f5('0x5'));var Redis=require(_0xa7f5('0x6'));var intUtil=require(_0xa7f5('0x7'));var config=require(_0xa7f5('0x8'));var logger=require('../../../../config/logger')(_0xa7f5('0x9'));config[_0xa7f5('0xa')]=_['defaults'](config[_0xa7f5('0xa')],{'host':_0xa7f5('0xb'),'port':0x18eb});var io=require(_0xa7f5('0xc'))(new Redis(config[_0xa7f5('0xa')]));function emit(_0xf20662,_0x20d4c7,_0x1aed63){io['to'](_0xf20662)[_0xa7f5('0xd')](_0x20d4c7,_0x1aed63);}function getTicket(_0x81dd78,_0x308ab3,_0xbc1c17,_0x51c5c1,_0x410a22,_0x2e81cf,_0x4403e0,_0x26230b){var _0x12e8f0=Object[_0xa7f5('0xe')]({},{'OwnerId':_0x308ab3['id'],'Subject':intUtil[_0xa7f5('0xf')](_0x51c5c1['Subjects'],_0x410a22,'\x20'),'Description':intUtil[_0xa7f5('0xf')](_0x51c5c1[_0xa7f5('0x10')],_0x410a22,'\x0a')},getCustomFields(_0x2e81cf,_0x410a22));if(_0xbc1c17){if(_0x51c5c1[_0xa7f5('0x11')]===_0xa7f5('0x12')){_0x12e8f0[_0xa7f5('0x13')]=moment['utc']();_0x12e8f0['IsReminderSet']=![];_0x12e8f0[_0xa7f5('0x14')]=![];if(_0xbc1c17[_0xa7f5('0x15')]==='contact'||_0xbc1c17[_0xa7f5('0x15')]===_0xa7f5('0x16')){_0x12e8f0[_0xa7f5('0x17')]=_0xbc1c17['id'];}else if(_0xbc1c17[_0xa7f5('0x15')]===_0xa7f5('0x18')){_0x12e8f0['WhatId']=_0xbc1c17['id'];}}else if(_0x51c5c1[_0xa7f5('0x11')]==='Case'){if(_0xbc1c17[_0xa7f5('0x15')]==='contact'){_0x12e8f0['ContactId']=_0xbc1c17['id'];}else if(_0xbc1c17[_0xa7f5('0x15')]===_0xa7f5('0x18')){_0x12e8f0[_0xa7f5('0x19')]=_0xbc1c17['id'];}else if(_0xbc1c17[_0xa7f5('0x15')]===_0xa7f5('0x16')&&_0x51c5c1[_0xa7f5('0x1a')]){_0x12e8f0[_0x51c5c1['leadId']]=_0xbc1c17['id'];}else{logger[_0xa7f5('0x1b')](_0xa7f5('0x1c'));}}}return _0x4403e0[_0xa7f5('0x1d')](_0x51c5c1[_0xa7f5('0x11')])[_0xa7f5('0x1e')](_0x12e8f0);}function getUser(_0x127337,_0x341d3c,_0x25a788){if(!_[_0xa7f5('0x1f')](_0x341d3c)&&intUtil[_0xa7f5('0x20')](_0x341d3c)){var _0x453493={'Email':_0x341d3c};var _0x497df9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x25a788[_0xa7f5('0x1d')](_0xa7f5('0x21'))['find'](_0x453493,_0x497df9)['execute']()[_0xa7f5('0x22')](function(_0x3a9dda){if(_0x3a9dda[_0xa7f5('0x23')]){var _0x54313d=_['find'](_0x3a9dda,function(_0x3c333a){return _0x3c333a[_0xa7f5('0x24')]===_0x341d3c;});if(_0x54313d){logger[_0xa7f5('0x1b')](_0xa7f5('0x25'),_0x341d3c);return BPromise['resolve']({'id':_0x54313d['Id'],'name':_0x54313d['Name']});}}else{logger[_0xa7f5('0x1b')](_0xa7f5('0x26'),_0x341d3c);return _0x25a788[_0xa7f5('0x27')]()[_0xa7f5('0x22')](function(_0x2314a1){return BPromise[_0xa7f5('0x28')]({'id':_0x2314a1[_0xa7f5('0x29')],'name':_0x2314a1[_0xa7f5('0x2a')]});});}});}else{logger[_0xa7f5('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x341d3c);return _0x25a788[_0xa7f5('0x27')]()['then'](function(_0x79f116){return BPromise[_0xa7f5('0x28')]({'id':_0x79f116['user_id'],'name':_0x79f116['display_name']});});}}function getEndUser(_0x18bc7b,_0x57b83b,_0x2675fe,_0x160c17,_0x5e2390){var _0x5e7060={'$or':{'Phone':_0x160c17}};var _0x3e6dd1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa7f5('0x28')]()[_0xa7f5('0x22')](function(){logger[_0xa7f5('0x1b')](_0xa7f5('0x2b'),_0x160c17,_0x57b83b[_0xa7f5('0x2c')]);switch(_0x57b83b['moduleSearch']){case'contact_lead':var _0x2ee81f=_['cloneDeep'](_0x5e7060);if(_0x57b83b[_0xa7f5('0x2d')]){var _0x4f3405={};_0x4f3405[_0x57b83b[_0xa7f5('0x2d')]]=_0x160c17;_[_0xa7f5('0x2e')](_0x2ee81f['$or'],_0x4f3405);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x2f'))[_0xa7f5('0x30')](_0x2ee81f,_0x3e6dd1)[_0xa7f5('0x31')]()[_0xa7f5('0x22')](function(_0x4036c4){if(_0x4036c4&&_0x4036c4[_0xa7f5('0x23')]){return _0x4036c4;}else{var _0x3437db=_[_0xa7f5('0x32')](_0x5e7060);if(_0x57b83b[_0xa7f5('0x33')]){var _0x52bf31={};_0x52bf31[_0x57b83b[_0xa7f5('0x33')]]=_0x160c17;_[_0xa7f5('0x2e')](_0x3437db[_0xa7f5('0x34')],_0x52bf31);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x35'))[_0xa7f5('0x30')](_0x3437db,_0x3e6dd1);}});case _0xa7f5('0x36'):var _0x4b9cb4=_[_0xa7f5('0x32')](_0x5e7060);if(_0x57b83b[_0xa7f5('0x37')]){var _0x4f3405={};_0x4f3405[_0x57b83b[_0xa7f5('0x37')]]=_0x160c17;_[_0xa7f5('0x2e')](_0x4b9cb4['$or'],_0x4f3405);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x38'))[_0xa7f5('0x30')](_0x4b9cb4,_0x3e6dd1)['execute']()[_0xa7f5('0x22')](function(_0x4eacf8){if(_0x4eacf8&&_0x4eacf8[_0xa7f5('0x23')]){return _0x4eacf8;}else{var _0x2d38da=_['cloneDeep'](_0x5e7060);if(_0x57b83b[_0xa7f5('0x2d')]){var _0x58d2d7={};_0x58d2d7[_0x57b83b['additionalSearchContact']]=_0x160c17;_[_0xa7f5('0x2e')](_0x2d38da[_0xa7f5('0x34')],_0x58d2d7);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x2f'))['find'](_0x2d38da,_0x3e6dd1)[_0xa7f5('0x22')](function(_0x54ec44){if(_0x54ec44&&_0x54ec44[_0xa7f5('0x23')]){return _0x54ec44;}else{var _0x53f6c5=_[_0xa7f5('0x32')](_0x5e7060);if(_0x57b83b['additionalSearchLead']){var _0x1b181d={};_0x1b181d[_0x57b83b[_0xa7f5('0x33')]]=_0x160c17;_['merge'](_0x53f6c5[_0xa7f5('0x34')],_0x1b181d);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x35'))['find'](_0x53f6c5,_0x3e6dd1);}});}});case _0xa7f5('0x39'):var _0x2ee81f=_['cloneDeep'](_0x5e7060);if(_0x57b83b['additionalSearchContact']){var _0x4f3405={};_0x4f3405[_0x57b83b[_0xa7f5('0x2d')]]=_0x160c17;_[_0xa7f5('0x2e')](_0x2ee81f[_0xa7f5('0x34')],_0x4f3405);}return _0x5e2390[_0xa7f5('0x1d')]('Contact')[_0xa7f5('0x30')](_0x2ee81f,_0x3e6dd1)['execute']();case'lead':var _0x293780=_[_0xa7f5('0x32')](_0x5e7060);if(_0x57b83b[_0xa7f5('0x33')]){var _0x4f3405={};_0x4f3405[_0x57b83b['additionalSearchLead']]=_0x160c17;_[_0xa7f5('0x2e')](_0x293780[_0xa7f5('0x34')],_0x4f3405);}return _0x5e2390[_0xa7f5('0x1d')](_0xa7f5('0x35'))[_0xa7f5('0x30')](_0x293780,_0x3e6dd1);case _0xa7f5('0x18'):var _0x4b9cb4=_[_0xa7f5('0x32')](_0x5e7060);if(_0x57b83b[_0xa7f5('0x37')]){var _0x4f3405={};_0x4f3405[_0x57b83b[_0xa7f5('0x37')]]=_0x160c17;_['merge'](_0x4b9cb4[_0xa7f5('0x34')],_0x4f3405);}return _0x5e2390[_0xa7f5('0x1d')]('Account')[_0xa7f5('0x30')](_0x4b9cb4,_0x3e6dd1);default:return null;}})[_0xa7f5('0x22')](function(_0x29a6c4){if(_0x29a6c4&&_0x29a6c4['length']){var _0x379f7a=_[_0xa7f5('0x3a')](_0x29a6c4);if(_0x379f7a){return BPromise[_0xa7f5('0x28')]({'id':_0x379f7a['Id'],'name':_0x379f7a['Name'],'phone':_0x379f7a[_0xa7f5('0x3b')],'endUserType':_0x379f7a[_0xa7f5('0x3c')][_0xa7f5('0x3d')]['toLowerCase']()});}}})[_0xa7f5('0x22')](function(_0x2d3adc){if(_0x2d3adc){logger['info'](_0xa7f5('0x3e'),_0x2d3adc[_0xa7f5('0x15')],_0x160c17);return BPromise[_0xa7f5('0x28')](_0x2d3adc);}else{logger[_0xa7f5('0x1b')](_0xa7f5('0x3f'),_0x160c17);var _0x333bb3={'Phone':_0x160c17};if(_0x57b83b[_0xa7f5('0x40')]){if(_0x57b83b[_0xa7f5('0x40')]===_0xa7f5('0x39')){logger[_0xa7f5('0x1b')](_0xa7f5('0x41'),_0x160c17,_0x57b83b[_0xa7f5('0x40')]);_0x333bb3['LastName']=_0x2675fe!==_0xa7f5('0x42')?_0x2675fe:util['format'](_0xa7f5('0x43'),_0x160c17);}else if(_0x57b83b[_0xa7f5('0x40')]===_0xa7f5('0x16')){logger[_0xa7f5('0x1b')](_0xa7f5('0x41'),_0x160c17,_0x57b83b['moduleCreate']);_0x333bb3[_0xa7f5('0x44')]=_0x2675fe!==''?_0x2675fe:util[_0xa7f5('0x45')]('Caller\x20-\x20%s',_0x160c17);_0x333bb3[_0xa7f5('0x46')]=_0xa7f5('0x47');}else if(_0x57b83b['moduleCreate']===_0xa7f5('0x18')){logger[_0xa7f5('0x1b')](_0xa7f5('0x41'),_0x160c17,_0x57b83b[_0xa7f5('0x40')]);_0x333bb3[_0xa7f5('0x48')]=_0x2675fe!==_0xa7f5('0x42')?_0x2675fe:util[_0xa7f5('0x45')]('Caller\x20-\x20%s',_0x160c17);}else{return null;}}return _0x5e2390[_0xa7f5('0x1d')](_[_0xa7f5('0x49')](_0x57b83b['moduleCreate']))[_0xa7f5('0x1e')](_0x333bb3)[_0xa7f5('0x22')](function(_0x3e3953){return BPromise[_0xa7f5('0x28')]({'id':_0x3e3953['id'],'endUserType':_0x57b83b[_0xa7f5('0x40')]});});}});}function getCustomFields(_0x5e6a0a,_0x244b76){var _0x40c39e={};if(_0x5e6a0a[_0xa7f5('0x23')]>0x0){_['forEach'](_0x5e6a0a,function(_0x156877){if(_[_0xa7f5('0x4a')]([_0xa7f5('0x4b'),'picklist'],_0x156877[_0xa7f5('0x3d')])&&_0x156877[_0xa7f5('0x4c')]){_0x40c39e[_0x156877['idField']]=_0x156877[_0xa7f5('0x4d')][_0xa7f5('0x4e')]();}else if(_0x156877[_0xa7f5('0x3d')]===_0xa7f5('0x4f')&&_0x156877[_0xa7f5('0x50')]&&_0x156877['idField']){_0x244b76[_0x156877[_0xa7f5('0x50')]]&&(_0x40c39e[_0x156877['idField']]=_0x244b76[_0x156877[_0xa7f5('0x50')]][_0xa7f5('0x4e')]());}else if(_0x156877['type']==='customVariable'&&_0x156877[_0xa7f5('0x51')]&&_0x156877[_0xa7f5('0x51')][_0xa7f5('0x52')]&&_0x156877[_0xa7f5('0x4c')]){_0x244b76[_0x156877[_0xa7f5('0x51')][_0xa7f5('0x52')][_0xa7f5('0x53')]()]&&(_0x40c39e[_0x156877[_0xa7f5('0x4c')]]=_0x244b76[_0x156877['Variable']['name'][_0xa7f5('0x53')]()][_0xa7f5('0x4e')]());}});}return _0x40c39e;}function getConnection(_0x4c1df0){var _0x1c724c=_0x4c1df0[_0xa7f5('0x54')][_0xa7f5('0x55')](_0x4c1df0['securityToken']);var _0xd89d7a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4c1df0['remoteUri']||_0xa7f5('0x56'),'clientId':_0x4c1df0[_0xa7f5('0x57')],'clientSecret':_0x4c1df0[_0xa7f5('0x58')]}});return _0xd89d7a['login'](_0x4c1df0[_0xa7f5('0x59')],_0x1c724c)[_0xa7f5('0x22')](function(){logger[_0xa7f5('0x1b')](_0xa7f5('0x5a'));return _0xd89d7a;});}exports['queue']=function(_0x249477,_0x38e025,_0x54ea06,_0xcd06f,_0x3e64bf,_0x55d4a1){var _0x45b3da,_0x2a53fb,_0x2a8b64,_0x451370;_0x55d4a1[_0xa7f5('0x5b')]=intUtil['stripTrailingSlash'](_0x55d4a1[_0xa7f5('0x5b')]);_0x55d4a1[_0xa7f5('0x5c')]=intUtil[_0xa7f5('0x5d')](_0x55d4a1[_0xa7f5('0x5c')]);if(_0x3e64bf&&_0x3e64bf['monitor_format']){logger[_0xa7f5('0x1b')](_0xa7f5('0x5e'),_0xa7f5('0x5f'));_0x38e025[_0xa7f5('0x60')]=util[_0xa7f5('0x45')](_0xa7f5('0x61'),_0x55d4a1[_0xa7f5('0x5b')],_0x38e025['uniqueid'],md5(_0x38e025['uniqueid']));}else{_0x38e025[_0xa7f5('0x60')]='';}return getConnection(_0x55d4a1)[_0xa7f5('0x22')](function(_0x94a157){_0x451370=_0x94a157;return getUser(_0x55d4a1,_0xcd06f[_0xa7f5('0x62')],_0x451370);})['then'](function(_0x1751d5){_0x45b3da=_0x1751d5;return getEndUser(_0x55d4a1,_0x54ea06,_0x38e025['calleridname'],_0x38e025[_0xa7f5('0x63')],_0x451370);})[_0xa7f5('0x22')](function(_0xe4bf7d){_0x2a53fb=_0xe4bf7d;return getTicket(_0x55d4a1,_0x45b3da,_0x2a53fb,_0x54ea06,_0x38e025,_0x54ea06['Fields'],_0x451370,_0xa7f5('0x64'));})[_0xa7f5('0x22')](function(_0x212d82){_0x2a8b64=_0x212d82;logger['info'](_0xa7f5('0x65'),_0x2a8b64['id']);logger[_0xa7f5('0x1b')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2a8b64['id'],_0xcd06f[_0xa7f5('0x52')],_0x55d4a1[_0xa7f5('0x3d')]);switch(_0x55d4a1[_0xa7f5('0x3d')]){case _0xa7f5('0x66'):emit(util[_0xa7f5('0x45')](_0xa7f5('0x67'),_0xcd06f['name']),_0xa7f5('0x68'),{'recordId':_0x2a8b64['id']});break;case _0xa7f5('0x69'):emit(util['format']('user:%s',_0xcd06f[_0xa7f5('0x52')]),_0xa7f5('0x6a'),{'uri':util['format']('%s/%s/e',_0x451370['instanceUrl'],_0x2a8b64['id'])});break;default:logger[_0xa7f5('0x6b')](_0xa7f5('0x6c'));}})['catch'](function(_0x5183a1){logger[_0xa7f5('0x6b')]('[QUEUE]',_0x5183a1);});};exports[_0xa7f5('0x6d')]=function(_0x57499c,_0x164566,_0x276273,_0x3ee2c1,_0x3a63a7,_0x20a448,_0x295951){var _0x499b57,_0x631200,_0x2ada51,_0x2b5f7f;_0x20a448[_0xa7f5('0x5b')]=intUtil['stripTrailingSlash'](_0x20a448[_0xa7f5('0x5b')]);_0x20a448[_0xa7f5('0x5c')]=intUtil[_0xa7f5('0x5d')](_0x20a448[_0xa7f5('0x5c')]);if(_0x295951&&_0x295951[_0xa7f5('0x6e')]&&_0x295951[_0xa7f5('0x6e')]!==_0xa7f5('0x6f')){logger['info'](_0xa7f5('0x70'),'Recording\x20is\x20enabled!');_0x164566['recordingURL']=util[_0xa7f5('0x45')](_0xa7f5('0x61'),_0x20a448['serverUrl'],_0x164566[_0xa7f5('0x71')],md5(_0x164566[_0xa7f5('0x71')]));}return getConnection(_0x20a448)[_0xa7f5('0x22')](function(_0x5044dc){_0x2b5f7f=_0x5044dc;return getUser(_0x20a448,_0x3ee2c1[_0xa7f5('0x62')],_0x2b5f7f);})[_0xa7f5('0x22')](function(_0x5d78cc){_0x499b57=_0x5d78cc;return getEndUser(_0x20a448,_0x276273,_0x164566['destcalleridname'],_0x164566[_0xa7f5('0x72')],_0x2b5f7f);})[_0xa7f5('0x22')](function(_0x5a00c8){_0x631200=_0x5a00c8;return getTicket(_0x20a448,_0x499b57,_0x631200,_0x276273,_0x164566,_0x276273[_0xa7f5('0x73')],_0x2b5f7f,_0xa7f5('0x6d'));})['then'](function(_0x336dcd){_0x2ada51=_0x336dcd;logger[_0xa7f5('0x1b')](_0xa7f5('0x74'),_0x2ada51['id']);logger[_0xa7f5('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2ada51['id'],_0x3ee2c1[_0xa7f5('0x52')],_0x20a448[_0xa7f5('0x3d')]);switch(_0x20a448[_0xa7f5('0x3d')]){case _0xa7f5('0x66'):emit(util[_0xa7f5('0x45')](_0xa7f5('0x67'),_0x3ee2c1[_0xa7f5('0x52')]),_0xa7f5('0x68'),{'recordId':_0x2ada51['id']});break;case _0xa7f5('0x69'):emit(util[_0xa7f5('0x45')](_0xa7f5('0x67'),_0x3ee2c1['name']),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x2b5f7f[_0xa7f5('0x75')],_0x2ada51['id'])});break;default:logger[_0xa7f5('0x6b')](_0xa7f5('0x70'),_0xa7f5('0x76'));}})['catch'](function(_0x5d6ae8){logger[_0xa7f5('0x6b')](_0xa7f5('0x70'),_0x5d6ae8);});};exports[_0xa7f5('0x77')]=function(_0x175211,_0x1b8812,_0x9c15ce,_0x185f3b,_0x173e1e,_0x3167da){var _0x4ec6f6,_0x10cf52,_0x3eaf43,_0x5b8b54;_0x3167da[_0xa7f5('0x5b')]=intUtil['stripTrailingSlash'](_0x3167da[_0xa7f5('0x5b')]);_0x3167da[_0xa7f5('0x5c')]=intUtil[_0xa7f5('0x5d')](_0x3167da[_0xa7f5('0x5c')]);if(_0x173e1e&&_0x173e1e[_0xa7f5('0x78')]){logger[_0xa7f5('0x1b')]('['+_0x1b8812[_0xa7f5('0x79')][_0xa7f5('0x7a')]()+']',_0xa7f5('0x5f'));_0x1b8812[_0xa7f5('0x60')]=util[_0xa7f5('0x45')](_0xa7f5('0x61'),_0x3167da[_0xa7f5('0x5b')],_0x1b8812['uniqueid'],md5(_0x1b8812[_0xa7f5('0x71')]));}else{_0x1b8812[_0xa7f5('0x60')]='';}return getConnection(_0x3167da)[_0xa7f5('0x22')](function(_0x3a9eb1){_0x5b8b54=_0x3a9eb1;if(!_['isNil'](_0x185f3b)){return getUser(_0x3167da,_0x185f3b['name'],_0x5b8b54);}else{return getUser(_0x3167da,null,_0x5b8b54);}})['then'](function(_0x217583){_0x4ec6f6=_0x217583;return getEndUser(_0x3167da,_0x9c15ce,_0x1b8812[_0xa7f5('0x7b')],_0x1b8812[_0xa7f5('0x63')],_0x5b8b54);})['then'](function(_0x586a32){_0x10cf52=_0x586a32;return getTicket(_0x3167da,_0x4ec6f6,_0x10cf52,_0x9c15ce,_0x1b8812,_0x9c15ce[_0xa7f5('0x73')],_0x5b8b54);})[_0xa7f5('0x22')](function(_0x2aced3){_0x3eaf43=_0x2aced3;logger[_0xa7f5('0x1b')]('['+_0x1b8812[_0xa7f5('0x79')][_0xa7f5('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0x3eaf43['id']);logger['info']('['+_0x1b8812[_0xa7f5('0x79')][_0xa7f5('0x7a')]()+_0xa7f5('0x7c'),_0x3167da['type']);})[_0xa7f5('0x7d')](function(_0x557da6){logger['error']('['+_0x1b8812['lastevent'][_0xa7f5('0x7a')]()+']',_0x557da6);});}; \ No newline at end of file +var _0xafdb=['bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','assign','getString','Descriptions','ActivityDate','utc','IsReminderSet','endUserType','WhatId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','ticketType','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','display_name','identity','user_id','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','contact','lead','account','first','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','string','picklist','content','variable','variableName','idField','toString','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent',']\x20Integration\x20account\x20type\x20%s.','moment'];(function(_0xfb001,_0x291fa9){var _0xd68352=function(_0x39f0d2){while(--_0x39f0d2){_0xfb001['push'](_0xfb001['shift']());}};_0xd68352(++_0x291fa9);}(_0xafdb,0x1f3));var _0xbafd=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xafdb[_0x10d34b];return _0x92b0bf;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0xbafd('0x0'));var BPromise=require(_0xbafd('0x1'));var md5=require(_0xbafd('0x2'));var jsforce=require(_0xbafd('0x3'));var util=require(_0xbafd('0x4'));var Redis=require(_0xbafd('0x5'));var intUtil=require(_0xbafd('0x6'));var config=require(_0xbafd('0x7'));var logger=require(_0xbafd('0x8'))(_0xbafd('0x9'));config[_0xbafd('0xa')]=_[_0xbafd('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbafd('0xa')]));function emit(_0x510b80,_0x50cf66,_0x436858){io['to'](_0x510b80)['emit'](_0x50cf66,_0x436858);}function getTicket(_0x451596,_0x327d6d,_0x12147a,_0xfdb92b,_0x492f97,_0x2a7fb5,_0x5887b8,_0x448ec4){var _0x42d2af=Object[_0xbafd('0xc')]({},{'OwnerId':_0x327d6d['id'],'Subject':intUtil[_0xbafd('0xd')](_0xfdb92b['Subjects'],_0x492f97,'\x20'),'Description':intUtil[_0xbafd('0xd')](_0xfdb92b[_0xbafd('0xe')],_0x492f97,'\x0a')},getCustomFields(_0x2a7fb5,_0x492f97));if(_0x12147a){if(_0xfdb92b['ticketType']==='Task'){_0x42d2af[_0xbafd('0xf')]=moment[_0xbafd('0x10')]();_0x42d2af[_0xbafd('0x11')]=![];_0x42d2af['IsRecurrence']=![];if(_0x12147a[_0xbafd('0x12')]==='contact'||_0x12147a[_0xbafd('0x12')]==='lead'){_0x42d2af['WhoId']=_0x12147a['id'];}else if(_0x12147a[_0xbafd('0x12')]==='account'){_0x42d2af[_0xbafd('0x13')]=_0x12147a['id'];}}else if(_0xfdb92b['ticketType']==='Case'){if(_0x12147a[_0xbafd('0x12')]==='contact'){_0x42d2af['ContactId']=_0x12147a['id'];}else if(_0x12147a[_0xbafd('0x12')]==='account'){_0x42d2af[_0xbafd('0x14')]=_0x12147a['id'];}else if(_0x12147a[_0xbafd('0x12')]==='lead'&&_0xfdb92b[_0xbafd('0x15')]){_0x42d2af[_0xfdb92b[_0xbafd('0x15')]]=_0x12147a['id'];}else{logger[_0xbafd('0x16')](_0xbafd('0x17'));}}}return _0x5887b8[_0xbafd('0x18')](_0xfdb92b[_0xbafd('0x19')])[_0xbafd('0x1a')](_0x42d2af);}function getUser(_0x4f2b20,_0x475285,_0x49fdf0){if(!_['isNil'](_0x475285)&&intUtil[_0xbafd('0x1b')](_0x475285)){var _0x4cbf22={'Email':_0x475285};var _0x59ccb8={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x49fdf0[_0xbafd('0x18')](_0xbafd('0x1c'))[_0xbafd('0x1d')](_0x4cbf22,_0x59ccb8)[_0xbafd('0x1e')]()[_0xbafd('0x1f')](function(_0x1c8327){if(_0x1c8327[_0xbafd('0x20')]){var _0x4a7eca=_[_0xbafd('0x1d')](_0x1c8327,function(_0x58b668){return _0x58b668[_0xbafd('0x21')]===_0x475285;});if(_0x4a7eca){logger[_0xbafd('0x16')](_0xbafd('0x22'),_0x475285);return BPromise[_0xbafd('0x23')]({'id':_0x4a7eca['Id'],'name':_0x4a7eca[_0xbafd('0x24')]});}}else{logger[_0xbafd('0x16')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x475285);return _0x49fdf0['identity']()[_0xbafd('0x1f')](function(_0x537e2e){return BPromise[_0xbafd('0x23')]({'id':_0x537e2e['user_id'],'name':_0x537e2e[_0xbafd('0x25')]});});}});}else{logger[_0xbafd('0x16')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x475285);return _0x49fdf0[_0xbafd('0x26')]()[_0xbafd('0x1f')](function(_0x3e20bd){return BPromise[_0xbafd('0x23')]({'id':_0x3e20bd[_0xbafd('0x27')],'name':_0x3e20bd[_0xbafd('0x25')]});});}}function getEndUser(_0x3a718d,_0x23fd23,_0x36caea,_0x29d216,_0x57b979){var _0x5f1659={'$or':{'Phone':_0x29d216}};var _0x4c7c92={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbafd('0x23')]()[_0xbafd('0x1f')](function(){logger[_0xbafd('0x16')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x29d216,_0x23fd23['moduleSearch']);switch(_0x23fd23['moduleSearch']){case _0xbafd('0x28'):var _0x12331e=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23['additionalSearchContact']){var _0x4d1652={};_0x4d1652[_0x23fd23[_0xbafd('0x2a')]]=_0x29d216;_[_0xbafd('0x2b')](_0x12331e[_0xbafd('0x2c')],_0x4d1652);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x2d'))['find'](_0x12331e,_0x4c7c92)[_0xbafd('0x1e')]()[_0xbafd('0x1f')](function(_0x1a91e4){if(_0x1a91e4&&_0x1a91e4[_0xbafd('0x20')]){return _0x1a91e4;}else{var _0x355eab=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23[_0xbafd('0x2e')]){var _0x4468fa={};_0x4468fa[_0x23fd23[_0xbafd('0x2e')]]=_0x29d216;_[_0xbafd('0x2b')](_0x355eab['$or'],_0x4468fa);}return _0x57b979['sobject'](_0xbafd('0x2f'))[_0xbafd('0x1d')](_0x355eab,_0x4c7c92);}});case _0xbafd('0x30'):var _0x450408=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23[_0xbafd('0x31')]){var _0x4d1652={};_0x4d1652[_0x23fd23[_0xbafd('0x31')]]=_0x29d216;_[_0xbafd('0x2b')](_0x450408['$or'],_0x4d1652);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x32'))['find'](_0x450408,_0x4c7c92)[_0xbafd('0x1e')]()[_0xbafd('0x1f')](function(_0x392ebb){if(_0x392ebb&&_0x392ebb[_0xbafd('0x20')]){return _0x392ebb;}else{var _0x47a168=_['cloneDeep'](_0x5f1659);if(_0x23fd23[_0xbafd('0x2a')]){var _0x3e1d51={};_0x3e1d51[_0x23fd23[_0xbafd('0x2a')]]=_0x29d216;_['merge'](_0x47a168[_0xbafd('0x2c')],_0x3e1d51);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x2d'))['find'](_0x47a168,_0x4c7c92)[_0xbafd('0x1f')](function(_0x3e6b7a){if(_0x3e6b7a&&_0x3e6b7a[_0xbafd('0x20')]){return _0x3e6b7a;}else{var _0x2bd367=_['cloneDeep'](_0x5f1659);if(_0x23fd23[_0xbafd('0x2e')]){var _0x10b0f2={};_0x10b0f2[_0x23fd23[_0xbafd('0x2e')]]=_0x29d216;_[_0xbafd('0x2b')](_0x2bd367['$or'],_0x10b0f2);}return _0x57b979['sobject'](_0xbafd('0x2f'))[_0xbafd('0x1d')](_0x2bd367,_0x4c7c92);}});}});case _0xbafd('0x33'):var _0x12331e=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23[_0xbafd('0x2a')]){var _0x4d1652={};_0x4d1652[_0x23fd23[_0xbafd('0x2a')]]=_0x29d216;_[_0xbafd('0x2b')](_0x12331e[_0xbafd('0x2c')],_0x4d1652);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x2d'))[_0xbafd('0x1d')](_0x12331e,_0x4c7c92)[_0xbafd('0x1e')]();case _0xbafd('0x34'):var _0x54b081=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23[_0xbafd('0x2e')]){var _0x4d1652={};_0x4d1652[_0x23fd23[_0xbafd('0x2e')]]=_0x29d216;_[_0xbafd('0x2b')](_0x54b081['$or'],_0x4d1652);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x2f'))['find'](_0x54b081,_0x4c7c92);case _0xbafd('0x35'):var _0x450408=_[_0xbafd('0x29')](_0x5f1659);if(_0x23fd23[_0xbafd('0x31')]){var _0x4d1652={};_0x4d1652[_0x23fd23[_0xbafd('0x31')]]=_0x29d216;_[_0xbafd('0x2b')](_0x450408[_0xbafd('0x2c')],_0x4d1652);}return _0x57b979[_0xbafd('0x18')](_0xbafd('0x32'))[_0xbafd('0x1d')](_0x450408,_0x4c7c92);default:return null;}})[_0xbafd('0x1f')](function(_0xc94d81){if(_0xc94d81&&_0xc94d81[_0xbafd('0x20')]){var _0x296ef5=_[_0xbafd('0x36')](_0xc94d81);if(_0x296ef5){return BPromise['resolve']({'id':_0x296ef5['Id'],'name':_0x296ef5[_0xbafd('0x24')],'phone':_0x296ef5[_0xbafd('0x37')],'endUserType':_0x296ef5[_0xbafd('0x38')][_0xbafd('0x39')]['toLowerCase']()});}}})['then'](function(_0x553e30){if(_0x553e30){logger[_0xbafd('0x16')](_0xbafd('0x3a'),_0x553e30[_0xbafd('0x12')],_0x29d216);return BPromise[_0xbafd('0x23')](_0x553e30);}else{logger[_0xbafd('0x16')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x29d216);var _0xc408b7={'Phone':_0x29d216};if(_0x23fd23[_0xbafd('0x3b')]){if(_0x23fd23['moduleCreate']===_0xbafd('0x33')){logger[_0xbafd('0x16')](_0xbafd('0x3c'),_0x29d216,_0x23fd23['moduleCreate']);_0xc408b7['LastName']=_0x36caea!==_0xbafd('0x3d')?_0x36caea:util[_0xbafd('0x3e')](_0xbafd('0x3f'),_0x29d216);}else if(_0x23fd23[_0xbafd('0x3b')]===_0xbafd('0x34')){logger[_0xbafd('0x16')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29d216,_0x23fd23[_0xbafd('0x3b')]);_0xc408b7['LastName']=_0x36caea!==_0xbafd('0x3d')?_0x36caea:util['format'](_0xbafd('0x3f'),_0x29d216);_0xc408b7[_0xbafd('0x40')]='No\x20Company';}else if(_0x23fd23[_0xbafd('0x3b')]==='account'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29d216,_0x23fd23[_0xbafd('0x3b')]);_0xc408b7[_0xbafd('0x24')]=_0x36caea!==_0xbafd('0x3d')?_0x36caea:util['format']('Caller\x20-\x20%s',_0x29d216);}else{return null;}}return _0x57b979[_0xbafd('0x18')](_[_0xbafd('0x41')](_0x23fd23[_0xbafd('0x3b')]))[_0xbafd('0x1a')](_0xc408b7)[_0xbafd('0x1f')](function(_0x5b2dff){return BPromise[_0xbafd('0x23')]({'id':_0x5b2dff['id'],'endUserType':_0x23fd23['moduleCreate']});});}});}function getCustomFields(_0x58baf3,_0x461ab3){var _0x5a4076={};if(_0x58baf3[_0xbafd('0x20')]>0x0){_[_0xbafd('0x42')](_0x58baf3,function(_0x593f1c){if(_[_0xbafd('0x43')]([_0xbafd('0x44'),_0xbafd('0x45')],_0x593f1c['type'])&&_0x593f1c['idField']){_0x5a4076[_0x593f1c['idField']]=_0x593f1c[_0xbafd('0x46')]['toString']();}else if(_0x593f1c[_0xbafd('0x39')]===_0xbafd('0x47')&&_0x593f1c[_0xbafd('0x48')]&&_0x593f1c[_0xbafd('0x49')]){_0x461ab3[_0x593f1c[_0xbafd('0x48')]]&&(_0x5a4076[_0x593f1c['idField']]=_0x461ab3[_0x593f1c[_0xbafd('0x48')]][_0xbafd('0x4a')]());}else if(_0x593f1c[_0xbafd('0x39')]==='customVariable'&&_0x593f1c[_0xbafd('0x4b')]&&_0x593f1c['Variable'][_0xbafd('0x4c')]&&_0x593f1c[_0xbafd('0x49')]){_0x461ab3[_0x593f1c['Variable'][_0xbafd('0x4c')][_0xbafd('0x4d')]()]&&(_0x5a4076[_0x593f1c['idField']]=_0x461ab3[_0x593f1c[_0xbafd('0x4b')][_0xbafd('0x4c')][_0xbafd('0x4d')]()][_0xbafd('0x4a')]());}});}return _0x5a4076;}function getConnection(_0xe4336a){var _0x20c104=_0xe4336a[_0xbafd('0x4e')][_0xbafd('0x4f')](_0xe4336a['securityToken']);var _0x57e441=new jsforce[(_0xbafd('0x50'))]({'oauth2':{'loginUrl':_0xe4336a[_0xbafd('0x51')]||_0xbafd('0x52'),'clientId':_0xe4336a['clientId'],'clientSecret':_0xe4336a[_0xbafd('0x53')]}});return _0x57e441[_0xbafd('0x54')](_0xe4336a[_0xbafd('0x55')],_0x20c104)[_0xbafd('0x1f')](function(){logger[_0xbafd('0x16')](_0xbafd('0x56'));return _0x57e441;});}exports['queue']=function(_0x55d9ef,_0x1d8339,_0x5f2801,_0x4f4640,_0x3d8d12,_0x375d92){var _0x3b7439,_0x5a27e8,_0x1a26f3,_0x20315a;_0x375d92[_0xbafd('0x57')]=intUtil[_0xbafd('0x58')](_0x375d92[_0xbafd('0x57')]);_0x375d92[_0xbafd('0x51')]=intUtil[_0xbafd('0x58')](_0x375d92['remoteUri']);if(_0x3d8d12&&_0x3d8d12[_0xbafd('0x59')]){logger[_0xbafd('0x16')](_0xbafd('0x5a'),'Recording\x20is\x20enabled!');_0x1d8339['recordingURL']=util[_0xbafd('0x3e')](_0xbafd('0x5b'),_0x375d92[_0xbafd('0x57')],_0x1d8339[_0xbafd('0x5c')],md5(_0x1d8339['uniqueid']));}else{_0x1d8339[_0xbafd('0x5d')]='';}return getConnection(_0x375d92)[_0xbafd('0x1f')](function(_0x2976cc){_0x20315a=_0x2976cc;return getUser(_0x375d92,_0x4f4640[_0xbafd('0x5e')],_0x20315a);})[_0xbafd('0x1f')](function(_0x3bab87){_0x3b7439=_0x3bab87;return getEndUser(_0x375d92,_0x5f2801,_0x1d8339[_0xbafd('0x5f')],_0x1d8339[_0xbafd('0x60')],_0x20315a);})[_0xbafd('0x1f')](function(_0x1a49f5){_0x5a27e8=_0x1a49f5;return getTicket(_0x375d92,_0x3b7439,_0x5a27e8,_0x5f2801,_0x1d8339,_0x5f2801[_0xbafd('0x61')],_0x20315a,_0xbafd('0x62'));})[_0xbafd('0x1f')](function(_0x39dc35){_0x1a26f3=_0x39dc35;logger[_0xbafd('0x16')](_0xbafd('0x63'),_0x1a26f3['id']);logger[_0xbafd('0x16')](_0xbafd('0x64'),_0x1a26f3['id'],_0x4f4640['name'],_0x375d92[_0xbafd('0x39')]);switch(_0x375d92[_0xbafd('0x39')]){case _0xbafd('0x65'):emit(util[_0xbafd('0x3e')](_0xbafd('0x66'),_0x4f4640[_0xbafd('0x4c')]),_0xbafd('0x67'),{'recordId':_0x1a26f3['id']});break;case'newTab':emit(util[_0xbafd('0x3e')](_0xbafd('0x66'),_0x4f4640[_0xbafd('0x4c')]),_0xbafd('0x68'),{'uri':util[_0xbafd('0x3e')]('%s/%s/e',_0x20315a[_0xbafd('0x69')],_0x1a26f3['id'])});break;default:logger[_0xbafd('0x6a')](_0xbafd('0x6b'));}})[_0xbafd('0x6c')](function(_0xc91ca9){logger[_0xbafd('0x6a')]('[QUEUE]',_0xc91ca9);});};exports[_0xbafd('0x6d')]=function(_0x405c13,_0x184c61,_0x57eb24,_0x237707,_0x9f1065,_0x23b664,_0x3e5f8d){var _0x13f414,_0x10e802,_0x4ea1ea,_0x59736c;_0x23b664[_0xbafd('0x57')]=intUtil[_0xbafd('0x58')](_0x23b664[_0xbafd('0x57')]);_0x23b664['remoteUri']=intUtil[_0xbafd('0x58')](_0x23b664['remoteUri']);if(_0x3e5f8d&&_0x3e5f8d[_0xbafd('0x6e')]&&_0x3e5f8d[_0xbafd('0x6e')]!==_0xbafd('0x6f')){logger[_0xbafd('0x16')](_0xbafd('0x70'),_0xbafd('0x71'));_0x184c61[_0xbafd('0x5d')]=util[_0xbafd('0x3e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23b664[_0xbafd('0x57')],_0x184c61[_0xbafd('0x5c')],md5(_0x184c61['uniqueid']));}return getConnection(_0x23b664)[_0xbafd('0x1f')](function(_0x1d68c9){_0x59736c=_0x1d68c9;return getUser(_0x23b664,_0x237707[_0xbafd('0x5e')],_0x59736c);})['then'](function(_0x3d3a03){_0x13f414=_0x3d3a03;return getEndUser(_0x23b664,_0x57eb24,_0x184c61[_0xbafd('0x72')],_0x184c61[_0xbafd('0x73')],_0x59736c);})['then'](function(_0xd0d76c){_0x10e802=_0xd0d76c;return getTicket(_0x23b664,_0x13f414,_0x10e802,_0x57eb24,_0x184c61,_0x57eb24[_0xbafd('0x61')],_0x59736c,_0xbafd('0x6d'));})[_0xbafd('0x1f')](function(_0xceb414){_0x4ea1ea=_0xceb414;logger[_0xbafd('0x16')](_0xbafd('0x74'),_0x4ea1ea['id']);logger['info'](_0xbafd('0x75'),_0x4ea1ea['id'],_0x237707[_0xbafd('0x4c')],_0x23b664[_0xbafd('0x39')]);switch(_0x23b664[_0xbafd('0x39')]){case _0xbafd('0x65'):emit(util[_0xbafd('0x3e')](_0xbafd('0x66'),_0x237707['name']),_0xbafd('0x67'),{'recordId':_0x4ea1ea['id']});break;case _0xbafd('0x76'):emit(util['format'](_0xbafd('0x66'),_0x237707[_0xbafd('0x4c')]),_0xbafd('0x68'),{'uri':util[_0xbafd('0x3e')](_0xbafd('0x77'),_0x59736c['instanceUrl'],_0x4ea1ea['id'])});break;default:logger[_0xbafd('0x6a')](_0xbafd('0x70'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbafd('0x6c')](function(_0x3a858a){logger['error'](_0xbafd('0x70'),_0x3a858a);});};exports[_0xbafd('0x78')]=function(_0x1f53bc,_0x2502e2,_0x459e95,_0x361b22,_0x493758,_0x5d69e0){var _0x12bf5a,_0x1bb162,_0x32017e,_0x44428e;_0x5d69e0[_0xbafd('0x57')]=intUtil[_0xbafd('0x58')](_0x5d69e0['serverUrl']);_0x5d69e0[_0xbafd('0x51')]=intUtil['stripTrailingSlash'](_0x5d69e0['remoteUri']);if(_0x493758&&_0x493758[_0xbafd('0x59')]){logger[_0xbafd('0x16')]('['+_0x2502e2['lastevent'][_0xbafd('0x79')]()+']',_0xbafd('0x71'));_0x2502e2[_0xbafd('0x5d')]=util['format'](_0xbafd('0x5b'),_0x5d69e0[_0xbafd('0x57')],_0x2502e2[_0xbafd('0x5c')],md5(_0x2502e2[_0xbafd('0x5c')]));}else{_0x2502e2['recordingURL']='';}return getConnection(_0x5d69e0)['then'](function(_0x5be39a){_0x44428e=_0x5be39a;if(!_['isNil'](_0x361b22)){return getUser(_0x5d69e0,_0x361b22[_0xbafd('0x4c')],_0x44428e);}else{return getUser(_0x5d69e0,null,_0x44428e);}})[_0xbafd('0x1f')](function(_0x2fd20b){_0x12bf5a=_0x2fd20b;return getEndUser(_0x5d69e0,_0x459e95,_0x2502e2[_0xbafd('0x5f')],_0x2502e2[_0xbafd('0x60')],_0x44428e);})[_0xbafd('0x1f')](function(_0x1273aa){_0x1bb162=_0x1273aa;return getTicket(_0x5d69e0,_0x12bf5a,_0x1bb162,_0x459e95,_0x2502e2,_0x459e95[_0xbafd('0x61')],_0x44428e);})[_0xbafd('0x1f')](function(_0x501dd3){_0x32017e=_0x501dd3;logger['info']('['+_0x2502e2['lastevent']['toUpperCase']()+_0xbafd('0x7a'),_0x32017e['id']);logger[_0xbafd('0x16')]('['+_0x2502e2[_0xbafd('0x7b')]['toUpperCase']()+_0xbafd('0x7c'),_0x5d69e0[_0xbafd('0x39')]);})[_0xbafd('0x6c')](function(_0x4cf0c9){logger[_0xbafd('0x6a')]('['+_0x2502e2[_0xbafd('0x7b')][_0xbafd('0x79')]()+']',_0x4cf0c9);});}; \ 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 eb1c2d9..363b0ee 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 _0x1f11=['%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','util','ioredis','./util','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toString','idField','content','variable','toLowerCase','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','true','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'];(function(_0x9f2f3f,_0x55b2d1){var _0x26998b=function(_0x13895f){while(--_0x13895f){_0x9f2f3f['push'](_0x9f2f3f['shift']());}};_0x26998b(++_0x55b2d1);}(_0x1f11,0x1d3));var _0x11f1=function(_0x5a2162,_0x5a90a3){_0x5a2162=_0x5a2162-0x0;var _0x4561a7=_0x1f11[_0x5a2162];return _0x4561a7;};'use strict';var _=require(_0x11f1('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x11f1('0x1'));var md5=require('md5');var Redis=require(_0x11f1('0x2'));var intUtil=require(_0x11f1('0x3'));var config=require('../../../../config/environment');var logger=require(_0x11f1('0x4'))(_0x11f1('0x5'));config[_0x11f1('0x6')]=_['defaults'](config[_0x11f1('0x6')],{'host':_0x11f1('0x7'),'port':0x18eb});var io=require(_0x11f1('0x8'))(new Redis(config[_0x11f1('0x6')]));function getAdminUser(_0x4e6d9f,_0x1a8ee7,_0x48e549,_0x2643ef,_0x3d34b7,_0x6a1c2){return new Promise(function(_0x39b79b,_0x378ba0){var _0x554f67={'method':_0x11f1('0x9'),'uri':_0x2643ef+_0x11f1('0xa')+'&'+_0x3d34b7+'&'+_0x6a1c2,'auth':_0x1a8ee7,'json':!![]};return rp(_0x554f67)[_0x11f1('0xb')](function(_0x96c16e){if(_0x96c16e[_0x11f1('0xc')][_0x11f1('0xd')]>0x0){_0x48e549['adminId']=_0x96c16e[_0x11f1('0xc')][0x0][_0x11f1('0xe')];}logger[_0x11f1('0xf')]('['+[_0x4e6d9f[_0x11f1('0x10')]()]+'],\x20getAdminUser\x20crm',_0x48e549);_0x39b79b(_0x48e549);})[_0x11f1('0x11')](function(_0x30aaba){logger[_0x11f1('0x12')]('['+[_0x4e6d9f['toUpperCase']()]+']',_0x30aaba[_0x11f1('0x13')]);_0x378ba0(_0x30aaba['message']);});});}function getUser(_0x496bd1,_0x10eb27,_0x20bb68,_0xfed7b1,_0x269362){return function(_0xad5ac0){logger['info']('['+[_0x496bd1[_0x11f1('0x10')]()]+'],\x20getUser\x20input\x20crm',_0xad5ac0);return new Promise(function(_0xea15b6,_0x476f64){if(intUtil[_0x11f1('0x14')](_0xad5ac0[_0x11f1('0x15')])){var _0x3b25cd={'method':_0x11f1('0x9'),'uri':_0x20bb68+_0x11f1('0x16')+_0xad5ac0[_0x11f1('0x15')]+'&'+_0xfed7b1+'&'+_0x269362,'auth':_0x10eb27,'json':!![]};logger[_0x11f1('0xf')]('['+[_0x496bd1[_0x11f1('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x3b25cd);return rp(_0x3b25cd)[_0x11f1('0xb')](function(_0x53f5e5){logger[_0x11f1('0xf')]('['+[_0x496bd1['toUpperCase']()]+_0x11f1('0x17'),_0x53f5e5);if(_0x53f5e5[_0x11f1('0xc')]['length']>0x0&&String(_0x53f5e5[_0x11f1('0xc')][0x0][_0x11f1('0x18')])==='true'){_0xad5ac0['userId']=_0x53f5e5[_0x11f1('0xc')][0x0][_0x11f1('0xe')];}else{_0xad5ac0[_0x11f1('0x19')]=_0xad5ac0[_0x11f1('0x1a')];_0xad5ac0['userEmail']=_0xad5ac0[_0x11f1('0x1b')];}logger[_0x11f1('0xf')]('['+[_0x496bd1['toUpperCase']()]+'],\x20getUser\x20crm',_0xad5ac0);_0xea15b6(_0xad5ac0);})['catch'](function(_0x3f8d89){logger[_0x11f1('0x12')]('['+[_0x496bd1[_0x11f1('0x10')]()]+']',_0x3f8d89[_0x11f1('0x13')]);_0x476f64(_0x3f8d89[_0x11f1('0x13')]);});}else{logger[_0x11f1('0xf')]('['+[_0x496bd1['toUpperCase']()]+_0x11f1('0x1c'));_0xad5ac0[_0x11f1('0x19')]=_0xad5ac0[_0x11f1('0x1a')];_0xad5ac0[_0x11f1('0x15')]=_0xad5ac0[_0x11f1('0x1b')];_0xea15b6(_0xad5ac0);}});};}function createEndUser(_0x78ed11,_0x1eb621,_0x3fe265,_0x332388,_0x2e28d8){logger[_0x11f1('0xf')]('['+[_0x78ed11[_0x11f1('0x10')]()]+_0x11f1('0x1d'),_0x3fe265);return new Promise(function(_0xabe934,_0x125c52){var _0x43dcfe={'method':_0x11f1('0x1e'),'uri':_0x332388+_0x11f1('0x1f')+_0x2e28d8,'body':{'user_name':_0x3fe265[_0x11f1('0x20')],'roles':_0x11f1('0x21'),'first_name':_0x3fe265['endUserNumber'],'active':'true','date_format':_0x11f1('0x22'),'phone':_0x3fe265[_0x11f1('0x20')]},'auth':_0x1eb621,'json':!![]};return rp(_0x43dcfe)[_0x11f1('0xb')](function(_0x565117){logger[_0x11f1('0xf')]('['+[_0x78ed11[_0x11f1('0x10')]()]+_0x11f1('0x23'),_0x565117[_0x11f1('0xc')]);_0x3fe265['endUserId']=_0x565117[_0x11f1('0xc')][_0x11f1('0xe')];_0xabe934(_0x3fe265);})[_0x11f1('0x11')](function(_0x2c2c4b){logger[_0x11f1('0x12')]('['+[_0x78ed11[_0x11f1('0x10')]()]+']',_0x2c2c4b[_0x11f1('0x13')]);_0x125c52(_0x2c2c4b[_0x11f1('0x13')]);});});}function getEndUser(_0x4513f5,_0x4abd8b,_0x5e16df,_0xae8182,_0x330aff){return function(_0xe8a4ac){logger[_0x11f1('0xf')]('['+[_0x4513f5['toUpperCase']()]+_0x11f1('0x24'),_0xe8a4ac);return new Promise(function(_0x2567a0,_0x4fb119){var _0x5e4c15={'method':_0x11f1('0x9'),'uri':_0x5e16df+_0x11f1('0x25')+_0xe8a4ac[_0x11f1('0x20')]+'&'+_0xae8182+'&'+_0x330aff,'auth':_0x4abd8b,'json':!![]};return rp(_0x5e4c15)[_0x11f1('0xb')](function(_0x486aad){if(_0x486aad['result']['length']>0x0){_0xe8a4ac[_0x11f1('0x26')]=_0x486aad[_0x11f1('0xc')][0x0][_0x11f1('0xe')];logger['info']('['+[_0x4513f5['toUpperCase']()]+_0x11f1('0x27'),_0xe8a4ac);_0x2567a0(_0xe8a4ac);}else{return createEndUser(_0x4513f5,_0x4abd8b,_0xe8a4ac,_0x5e16df,_0xae8182)[_0x11f1('0xb')](function(_0x2cbf62){logger[_0x11f1('0xf')]('['+[_0x4513f5[_0x11f1('0x10')]()]+_0x11f1('0x28'),_0x2cbf62);_0x2567a0(_0x2cbf62);});}})[_0x11f1('0x11')](function(_0x8daed4){logger[_0x11f1('0x12')]('['+[_0x4513f5[_0x11f1('0x10')]()]+']',_0x8daed4[_0x11f1('0x13')]);_0x4fb119(_0x8daed4['message']);});});};}function getCustomFields(_0x33c65c,_0x34888e){var _0x32e453={};if(_0x33c65c['length']>0x0){_[_0x11f1('0x29')](_0x33c65c,function(_0x5d47fb){if(_[_0x11f1('0x2a')]([_0x11f1('0x2b'),_0x11f1('0x2c')],_0x5d47fb[_0x11f1('0x2d')])&&_0x5d47fb[_0x11f1('0x2e')]&&!_0x5d47fb[_0x11f1('0x2f')]){_0x32e453[_0x5d47fb[_0x11f1('0x2e')]['toLowerCase']()]=_0x5d47fb['content'][_0x11f1('0x30')]();}else if(_[_0x11f1('0x2a')]([_0x11f1('0x2b'),_0x11f1('0x2c')],_0x5d47fb[_0x11f1('0x2d')])&&_0x5d47fb['idField']&&_0x5d47fb[_0x11f1('0x2f')]){_0x32e453[_0x5d47fb[_0x11f1('0x31')]['toLowerCase']()]=_0x5d47fb[_0x11f1('0x32')][_0x11f1('0x30')]();}else if(_0x5d47fb[_0x11f1('0x2d')]===_0x11f1('0x33')&&_0x5d47fb['variableName']&&_0x5d47fb[_0x11f1('0x31')]&&_0x5d47fb[_0x11f1('0x2f')]){_0x32e453[_0x5d47fb['idField'][_0x11f1('0x34')]()]=_0x34888e[_0x5d47fb[_0x11f1('0x35')]]['toString']();}else if(_0x5d47fb[_0x11f1('0x2d')]==='customVariable'&&_0x5d47fb[_0x11f1('0x36')]&&_0x5d47fb[_0x11f1('0x36')][_0x11f1('0x37')]&&_0x5d47fb[_0x11f1('0x31')]&&_0x5d47fb['customField']){_0x32e453[_0x5d47fb[_0x11f1('0x31')][_0x11f1('0x34')]()]=_0x34888e[_0x5d47fb['Variable'][_0x11f1('0x37')][_0x11f1('0x34')]()]['toString']();}});}return _0x32e453;}function getTicket(_0x5764a9,_0x47e9cf,_0x6c3cd,_0x47df23,_0x404cd6,_0x559682){return function(_0x4d06f7){logger[_0x11f1('0xf')]('['+[_0x5764a9[_0x11f1('0x10')]()]+_0x11f1('0x38'),_0x4d06f7);return new Promise(function(_0x7d34db,_0x2f2bd8){var _0x34a10b=_0x5764a9[_0x11f1('0x34')]()===_0x11f1('0x39')?_0x4d06f7[_0x11f1('0x19')]:_0x4d06f7['endUserId'];var _0x4f5696={'method':'POST','uri':_0x6c3cd+'incident'+'?'+_0x559682,'body':Object[_0x11f1('0x3a')]({},{'active':_0x11f1('0x3b'),'caller_id':_0x34a10b,'assigned_to':_0x4d06f7['userId'],'short_description':intUtil['getString'](_0x47df23['Subjects'],_0x404cd6,'\x20'),'description':intUtil[_0x11f1('0x3c')](_0x47df23[_0x11f1('0x3d')],_0x404cd6,'\x0a')},getCustomFields(_0x47df23['Fields'],_0x404cd6)),'auth':_0x47e9cf,'json':!![]};return rp(_0x4f5696)[_0x11f1('0xb')](function(_0x5bae95){logger[_0x11f1('0xf')]('['+[_0x5764a9[_0x11f1('0x10')]()]+_0x11f1('0x3e'),_0x5bae95['result']);_0x4d06f7[_0x11f1('0x3f')]=_0x5bae95[_0x11f1('0xc')][_0x11f1('0xe')];_0x4d06f7['ticketNumber']=_0x5bae95[_0x11f1('0xc')][_0x11f1('0x40')];logger['info']('['+[_0x5764a9[_0x11f1('0x10')]()]+']\x20getTicket\x20crm',_0x4d06f7);_0x7d34db(_0x4d06f7);})[_0x11f1('0x11')](function(_0x8415a5){logger[_0x11f1('0x12')]('['+[_0x5764a9[_0x11f1('0x10')]()]+']',_0x8415a5['message']);_0x2f2bd8(_0x8415a5[_0x11f1('0x13')]);});});};}function createRemoteTag(_0x279fab,_0x14f1b4,_0x5cee6e,_0x53b143){return new Promise(function(_0x97776c,_0x425dff){var _0x1b7bf8={'method':_0x11f1('0x1e'),'uri':_0x5cee6e+_0x11f1('0x41')+'?'+_0x53b143,'body':{'short_description':_0x279fab,'global':!![],'active':!![],'name':_0x279fab},'auth':_0x14f1b4,'json':!![]};return rp(_0x1b7bf8)[_0x11f1('0xb')](function(_0x30232e){var _0x34bfbb=_0x30232e['result'][_0x11f1('0xe')];_0x97776c(_0x34bfbb);});});}function getRemoteTag(_0x49c811,_0x437155,_0xb8b996,_0x3e827e,_0x557d1b){return new Promise(function(_0x5007fb,_0x3cc8a5){var _0x215493={'method':'GET','uri':_0xb8b996+_0x11f1('0x41')+_0x11f1('0x42')+_0x49c811+'&'+_0x3e827e,'auth':_0x437155,'json':!![]};return rp(_0x215493)[_0x11f1('0xb')](function(_0x24a6ee){if(_0x24a6ee['result'][_0x11f1('0xd')]>0x0){var _0x569b82=_0x24a6ee[_0x11f1('0xc')][0x0][_0x11f1('0xe')];_0x5007fb(_0x569b82);}else{return createRemoteTag(_0x49c811,_0x437155,_0xb8b996,_0x3e827e)[_0x11f1('0xb')](function(_0xda8f5d){_0x5007fb(_0xda8f5d);});}});});}function assignTagToIncident(_0x10667f,_0x178b55,_0xa7f286,_0x22e85b,_0x35c755){return new Promise(function(_0x465cb9,_0x441ae9){var _0x2ce174={'method':_0x11f1('0x1e'),'uri':_0xa7f286+_0x11f1('0x43')+'?'+_0x35c755,'body':{'label':_0x10667f,'table':_0x11f1('0x44'),'id_type':_0x11f1('0x45'),'table_key':_0x22e85b[_0x11f1('0x3f')],'title':_0x11f1('0x46')+_0x22e85b[_0x11f1('0x47')],'id_display':_0x22e85b['ticketNumber']},'auth':_0x178b55,'json':!![]};return rp(_0x2ce174)[_0x11f1('0xb')](function(_0x20abdf){_0x465cb9();})[_0x11f1('0x11')](function(){_0x465cb9();});});}function manageTags(_0x1c390c,_0x2b1ba5,_0x45eaa0,_0x49b5a0,_0xe5796a,_0x43910b,_0x37fe7b){return new Promise(function(_0x399fa0,_0xf23bab){var _0xaafdeb=[];_0x2b1ba5[_0x11f1('0x29')](function(_0x18fe9a){_0xaafdeb[_0x11f1('0x48')](getRemoteTag(_0x18fe9a,_0x45eaa0,_0x49b5a0,_0x43910b,_0x37fe7b));});return Promise[_0x11f1('0x49')](_0xaafdeb)[_0x11f1('0xb')](function(_0x5bafe8){if(_0x5bafe8[_0x11f1('0xd')]){logger['info']('['+[_0x1c390c[_0x11f1('0x10')]()]+_0x11f1('0x4a'),_0x5bafe8);var _0x399019=[];_0x5bafe8[_0x11f1('0x29')](function(_0x51c775){_0x399019[_0x11f1('0x48')](assignTagToIncident(_0x51c775,_0x45eaa0,_0x49b5a0,_0xe5796a,_0x43910b));});return Promise[_0x11f1('0x49')](_0x399019)[_0x11f1('0xb')](function(){_0x399fa0();})[_0x11f1('0x11')](function(){_0x399fa0();});}else{_0x399fa0();}});});}function getTags(_0x119ddd,_0x351ed7,_0x5191a2,_0xad333,_0xffbbe5,_0x1b5066){return function(_0x419c8e){return new Promise(function(_0xfe79cc,_0x43b8c6){var _0x324840=[];var _0x2bb760=_0xad333['Tags'];if(_0x2bb760&&_0x2bb760[_0x11f1('0xd')]>0x0){_0x324840=_[_0x11f1('0x4b')](_0x2bb760,_0x11f1('0x37'));}if(_0x324840[_0x11f1('0xd')]>0x0){return manageTags(_0x119ddd,_0x324840,_0x351ed7,_0x5191a2,_0x419c8e,_0xffbbe5,_0x1b5066)['then'](function(){_0xfe79cc(_0x419c8e);});}else{_0xfe79cc(_0x419c8e);}});};}function emit(_0x6c683d,_0x493bd1,_0x5bbe0c){var _0x56a2b4=_0x11f1('0x4c')+_0x11f1('0x4d')+_0x11f1('0x4e')+_0x11f1('0x4f');var _0x2f42f2={'uri':_0x6c683d+_0x11f1('0x50')+_0x5bbe0c+_0x56a2b4};io['to'](util['format'](_0x11f1('0x51'),_0x493bd1))[_0x11f1('0x52')](_0x11f1('0x53'),_0x2f42f2);}exports['cs']=function(_0x4414d9,_0x3f8db4,_0x19f584,_0x2b79c6,_0x36fb4f,_0x4ddbdb,_0x2d8c5d,_0x584665){var _0x2f8edf={};var _0xf2617c={'user':_0x4ddbdb[_0x11f1('0x54')],'pass':_0x4ddbdb[_0x11f1('0x55')]};var _0xa1fbd6=_0x11f1('0x56');var _0x5abdf2='sysparm_display_value=true';_0x4ddbdb[_0x11f1('0x57')]=intUtil[_0x11f1('0x58')](_0x4ddbdb[_0x11f1('0x57')]);_0x4ddbdb[_0x11f1('0x59')]=intUtil[_0x11f1('0x58')](_0x4ddbdb[_0x11f1('0x59')]);var _0x28de86=util[_0x11f1('0x5a')](_0x11f1('0x5b'),_0x4ddbdb[_0x11f1('0x57')]);_0x2f8edf[_0x11f1('0x15')]=!_['isNil'](_0x2b79c6)?_0x2b79c6[_0x11f1('0x5c')]:null;_0x2f8edf[_0x11f1('0x1b')]=_0x4ddbdb[_0x11f1('0x5c')];_0x2f8edf[_0x11f1('0x20')]=_0x584665['toLowerCase']()==='outbound'?_0x3f8db4[_0x11f1('0x5d')]:_0x3f8db4[_0x11f1('0x5e')];_0x2f8edf[_0x11f1('0x5f')]=_0x584665==='queue'||_0x584665===_0x11f1('0x60')?'queue':_0x11f1('0x39');var _0x356ceb=util[_0x11f1('0x5a')](_0x11f1('0x61'),_0x4ddbdb[_0x11f1('0x59')],_0x3f8db4['uniqueid'],md5(_0x3f8db4[_0x11f1('0x62')]));if(_0x36fb4f&&_0x36fb4f['monitor_format']){logger['info']('[QUEUE]',_0x11f1('0x63'));_0x3f8db4[_0x11f1('0x64')]=_0x356ceb;}else if(_0x2d8c5d&&_0x2d8c5d[_0x11f1('0x65')]&&_0x2d8c5d[_0x11f1('0x65')]!==_0x11f1('0x66')){logger['info'](_0x11f1('0x67'),_0x11f1('0x63'));_0x3f8db4['recordingURL']=_0x356ceb;}else{_0x3f8db4['recordingURL']='';}return getAdminUser(_0x584665,_0xf2617c,_0x2f8edf,_0x28de86,_0x5abdf2,_0xa1fbd6)[_0x11f1('0xb')](getUser(_0x584665,_0xf2617c,_0x28de86,_0x5abdf2,_0xa1fbd6))[_0x11f1('0xb')](getEndUser(_0x584665,_0xf2617c,_0x28de86,_0x5abdf2,_0xa1fbd6))[_0x11f1('0xb')](getTicket(_0x584665,_0xf2617c,_0x28de86,_0x19f584,_0x3f8db4,_0x5abdf2))[_0x11f1('0xb')](function(_0x1f7b6e){logger[_0x11f1('0xf')](util[_0x11f1('0x5a')](_0x11f1('0x68'),_0x1f7b6e[_0x11f1('0x3f')]));logger[_0x11f1('0xf')](util[_0x11f1('0x5a')](_0x11f1('0x69'),_0x584665));if(_0x584665!=='unmanaged'){logger[_0x11f1('0xf')]('['+[_0x584665['toUpperCase']()]+']',_0x11f1('0x6a'));emit(_0x4ddbdb['remoteUri'],_0x2b79c6['name'],_0x1f7b6e[_0x11f1('0x3f')]);}})[_0x11f1('0x11')](function(_0x37d750){logger[_0x11f1('0x12')]('['+[_0x584665[_0x11f1('0x10')]()]+_0x11f1('0x6b'),util[_0x11f1('0x6c')](_0x37d750,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xda32=['inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','sys_id','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','nameField','toLowerCase','toString','type','customField','idField','content','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all','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_limit=1','remoteUri','stripTrailingSlash','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x13b01d,_0x269d5d){var _0x529a63=function(_0x1ccc3b){while(--_0x1ccc3b){_0x13b01d['push'](_0x13b01d['shift']());}};_0x529a63(++_0x269d5d);}(_0xda32,0x151));var _0x2da3=function(_0x20f35a,_0x2ba3bf){_0x20f35a=_0x20f35a-0x0;var _0x452b78=_0xda32[_0x20f35a];return _0x452b78;};'use strict';var _=require(_0x2da3('0x0'));var Promise=require(_0x2da3('0x1'));var rp=require(_0x2da3('0x2'));var util=require(_0x2da3('0x3'));var md5=require(_0x2da3('0x4'));var Redis=require(_0x2da3('0x5'));var intUtil=require('./util');var config=require(_0x2da3('0x6'));var logger=require(_0x2da3('0x7'))('servicenow');config['redis']=_[_0x2da3('0x8')](config[_0x2da3('0x9')],{'host':_0x2da3('0xa'),'port':0x18eb});var io=require(_0x2da3('0xb'))(new Redis(config[_0x2da3('0x9')]));function getAdminUser(_0x242546,_0x25999e,_0x69f83f,_0x319614,_0x119cef,_0x244b28){return new Promise(function(_0x22201a,_0x14e0ff){var _0x53afbb={'method':'GET','uri':_0x319614+_0x2da3('0xc')+'&'+_0x119cef+'&'+_0x244b28,'auth':_0x25999e,'json':!![]};return rp(_0x53afbb)['then'](function(_0x1fcf49){if(_0x1fcf49[_0x2da3('0xd')][_0x2da3('0xe')]>0x0){_0x69f83f[_0x2da3('0xf')]=_0x1fcf49[_0x2da3('0xd')][0x0]['sys_id'];}logger[_0x2da3('0x10')]('['+[_0x242546[_0x2da3('0x11')]()]+_0x2da3('0x12'),_0x69f83f);_0x22201a(_0x69f83f);})[_0x2da3('0x13')](function(_0x506dce){logger[_0x2da3('0x14')]('['+[_0x242546['toUpperCase']()]+']',_0x506dce[_0x2da3('0x15')]);_0x14e0ff(_0x506dce[_0x2da3('0x15')]);});});}function getUser(_0x3ef243,_0x56d36a,_0x45a70a,_0x10ab01,_0x771d18){return function(_0x2c13b9){logger[_0x2da3('0x10')]('['+[_0x3ef243[_0x2da3('0x11')]()]+_0x2da3('0x16'),_0x2c13b9);return new Promise(function(_0xad6edf,_0x24be56){if(intUtil[_0x2da3('0x17')](_0x2c13b9[_0x2da3('0x18')])){var _0x38633d={'method':_0x2da3('0x19'),'uri':_0x45a70a+_0x2da3('0x1a')+_0x2c13b9['userEmail']+'&'+_0x10ab01+'&'+_0x771d18,'auth':_0x56d36a,'json':!![]};logger[_0x2da3('0x10')]('['+[_0x3ef243[_0x2da3('0x11')]()]+_0x2da3('0x1b'),_0x38633d);return rp(_0x38633d)[_0x2da3('0x1c')](function(_0x19f90b){logger[_0x2da3('0x10')]('['+[_0x3ef243['toUpperCase']()]+'],\x20getUser\x20entity',_0x19f90b);if(_0x19f90b['result'][_0x2da3('0xe')]>0x0&&String(_0x19f90b['result'][0x0]['active'])===_0x2da3('0x1d')){_0x2c13b9[_0x2da3('0x1e')]=_0x19f90b['result'][0x0][_0x2da3('0x1f')];}else{_0x2c13b9['userId']=_0x2c13b9['adminId'];_0x2c13b9[_0x2da3('0x18')]=_0x2c13b9[_0x2da3('0x20')];}logger['info']('['+[_0x3ef243[_0x2da3('0x11')]()]+'],\x20getUser\x20crm',_0x2c13b9);_0xad6edf(_0x2c13b9);})['catch'](function(_0x451f19){logger['error']('['+[_0x3ef243[_0x2da3('0x11')]()]+']',_0x451f19[_0x2da3('0x15')]);_0x24be56(_0x451f19[_0x2da3('0x15')]);});}else{logger['info']('['+[_0x3ef243[_0x2da3('0x11')]()]+_0x2da3('0x21'));_0x2c13b9['userId']=_0x2c13b9[_0x2da3('0xf')];_0x2c13b9[_0x2da3('0x18')]=_0x2c13b9[_0x2da3('0x20')];_0xad6edf(_0x2c13b9);}});};}function createEndUser(_0x3162a3,_0x1f8a7e,_0x14a128,_0x15b4ef,_0x415cb8){logger[_0x2da3('0x10')]('['+[_0x3162a3[_0x2da3('0x11')]()]+_0x2da3('0x22'),_0x14a128);return new Promise(function(_0x2182cd,_0x188d75){var _0x495e0e={'method':_0x2da3('0x23'),'uri':_0x15b4ef+_0x2da3('0x24')+_0x415cb8,'body':{'user_name':_0x14a128[_0x2da3('0x25')],'roles':_0x2da3('0x26'),'first_name':_0x14a128['endUserNumber'],'active':_0x2da3('0x1d'),'date_format':_0x2da3('0x27'),'phone':_0x14a128[_0x2da3('0x25')]},'auth':_0x1f8a7e,'json':!![]};return rp(_0x495e0e)[_0x2da3('0x1c')](function(_0x288890){logger['info']('['+[_0x3162a3[_0x2da3('0x11')]()]+_0x2da3('0x28'),_0x288890['result']);_0x14a128['endUserId']=_0x288890[_0x2da3('0xd')][_0x2da3('0x1f')];_0x2182cd(_0x14a128);})[_0x2da3('0x13')](function(_0x127688){logger[_0x2da3('0x14')]('['+[_0x3162a3[_0x2da3('0x11')]()]+']',_0x127688['message']);_0x188d75(_0x127688['message']);});});}function getEndUser(_0xb47c03,_0x3572df,_0x4637d2,_0x4e8493,_0x37be44){return function(_0x20cf07){logger[_0x2da3('0x10')]('['+[_0xb47c03[_0x2da3('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x20cf07);return new Promise(function(_0x58e94c,_0x3f61ab){var _0x1bf78f={'method':_0x2da3('0x19'),'uri':_0x4637d2+_0x2da3('0x29')+_0x20cf07['endUserNumber']+'&'+_0x4e8493+'&'+_0x37be44,'auth':_0x3572df,'json':!![]};return rp(_0x1bf78f)['then'](function(_0x55a7df){if(_0x55a7df['result'][_0x2da3('0xe')]>0x0){_0x20cf07[_0x2da3('0x2a')]=_0x55a7df[_0x2da3('0xd')][0x0][_0x2da3('0x1f')];logger[_0x2da3('0x10')]('['+[_0xb47c03[_0x2da3('0x11')]()]+_0x2da3('0x2b'),_0x20cf07);_0x58e94c(_0x20cf07);}else{return createEndUser(_0xb47c03,_0x3572df,_0x20cf07,_0x4637d2,_0x4e8493)[_0x2da3('0x1c')](function(_0x1c9093){logger[_0x2da3('0x10')]('['+[_0xb47c03[_0x2da3('0x11')]()]+_0x2da3('0x2c'),_0x1c9093);_0x58e94c(_0x1c9093);});}})['catch'](function(_0x50f506){logger[_0x2da3('0x14')]('['+[_0xb47c03[_0x2da3('0x11')]()]+']',_0x50f506[_0x2da3('0x15')]);_0x3f61ab(_0x50f506['message']);});});};}function getCustomFields(_0x440517,_0x50c689){var _0x22f3ff={};if(_0x440517[_0x2da3('0xe')]>0x0){_['forEach'](_0x440517,function(_0x171d3a){if(_[_0x2da3('0x2d')]([_0x2da3('0x2e'),_0x2da3('0x2f')],_0x171d3a['type'])&&_0x171d3a[_0x2da3('0x30')]&&!_0x171d3a['customField']){_0x22f3ff[_0x171d3a[_0x2da3('0x30')][_0x2da3('0x31')]()]=_0x171d3a['content'][_0x2da3('0x32')]();}else if(_['includes'](['string',_0x2da3('0x2f')],_0x171d3a[_0x2da3('0x33')])&&_0x171d3a['idField']&&_0x171d3a[_0x2da3('0x34')]){_0x22f3ff[_0x171d3a[_0x2da3('0x35')][_0x2da3('0x31')]()]=_0x171d3a[_0x2da3('0x36')][_0x2da3('0x32')]();}else if(_0x171d3a[_0x2da3('0x33')]==='variable'&&_0x171d3a[_0x2da3('0x37')]&&_0x171d3a['idField']&&_0x171d3a[_0x2da3('0x34')]){_0x22f3ff[_0x171d3a[_0x2da3('0x35')]['toLowerCase']()]=_0x50c689[_0x171d3a[_0x2da3('0x37')]][_0x2da3('0x32')]();}else if(_0x171d3a[_0x2da3('0x33')]===_0x2da3('0x38')&&_0x171d3a[_0x2da3('0x39')]&&_0x171d3a[_0x2da3('0x39')][_0x2da3('0x3a')]&&_0x171d3a[_0x2da3('0x35')]&&_0x171d3a[_0x2da3('0x34')]){_0x22f3ff[_0x171d3a[_0x2da3('0x35')][_0x2da3('0x31')]()]=_0x50c689[_0x171d3a[_0x2da3('0x39')][_0x2da3('0x3a')][_0x2da3('0x31')]()][_0x2da3('0x32')]();}});}return _0x22f3ff;}function getTicket(_0x1f82ae,_0x231ddd,_0x4300eb,_0x8278b1,_0x1447cd,_0x5ab53b){return function(_0x43832f){logger[_0x2da3('0x10')]('['+[_0x1f82ae[_0x2da3('0x11')]()]+_0x2da3('0x3b'),_0x43832f);return new Promise(function(_0x2534be,_0xc97873){var _0x2ec58d=_0x1f82ae[_0x2da3('0x31')]()===_0x2da3('0x3c')?_0x43832f[_0x2da3('0x1e')]:_0x43832f[_0x2da3('0x2a')];var _0x565f65={'method':_0x2da3('0x23'),'uri':_0x4300eb+_0x2da3('0x3d')+'?'+_0x5ab53b,'body':Object[_0x2da3('0x3e')]({},{'active':_0x2da3('0x1d'),'caller_id':_0x2ec58d,'assigned_to':_0x43832f[_0x2da3('0x1e')],'short_description':intUtil[_0x2da3('0x3f')](_0x8278b1[_0x2da3('0x40')],_0x1447cd,'\x20'),'description':intUtil[_0x2da3('0x3f')](_0x8278b1[_0x2da3('0x41')],_0x1447cd,'\x0a')},getCustomFields(_0x8278b1[_0x2da3('0x42')],_0x1447cd)),'auth':_0x231ddd,'json':!![]};return rp(_0x565f65)[_0x2da3('0x1c')](function(_0x3f08cc){logger[_0x2da3('0x10')]('['+[_0x1f82ae[_0x2da3('0x11')]()]+_0x2da3('0x43'),_0x3f08cc[_0x2da3('0xd')]);_0x43832f[_0x2da3('0x44')]=_0x3f08cc[_0x2da3('0xd')]['sys_id'];_0x43832f['ticketNumber']=_0x3f08cc['result'][_0x2da3('0x45')];logger[_0x2da3('0x10')]('['+[_0x1f82ae['toUpperCase']()]+_0x2da3('0x46'),_0x43832f);_0x2534be(_0x43832f);})['catch'](function(_0x3d63b1){logger[_0x2da3('0x14')]('['+[_0x1f82ae[_0x2da3('0x11')]()]+']',_0x3d63b1[_0x2da3('0x15')]);_0xc97873(_0x3d63b1[_0x2da3('0x15')]);});});};}function createRemoteTag(_0x4adea3,_0x57e130,_0x22e4f7,_0x56b030){return new Promise(function(_0x31977b,_0xe804f){var _0x165f6f={'method':_0x2da3('0x23'),'uri':_0x22e4f7+_0x2da3('0x47')+'?'+_0x56b030,'body':{'short_description':_0x4adea3,'global':!![],'active':!![],'name':_0x4adea3},'auth':_0x57e130,'json':!![]};return rp(_0x165f6f)[_0x2da3('0x1c')](function(_0xbe1906){var _0x1dc521=_0xbe1906[_0x2da3('0xd')][_0x2da3('0x1f')];_0x31977b(_0x1dc521);});});}function getRemoteTag(_0x25bb02,_0xb8ead8,_0x250f16,_0xb03050,_0x55b280){return new Promise(function(_0x4f0e99,_0x5f154d){var _0x3391be={'method':_0x2da3('0x19'),'uri':_0x250f16+_0x2da3('0x47')+_0x2da3('0x48')+_0x25bb02+'&'+_0xb03050,'auth':_0xb8ead8,'json':!![]};return rp(_0x3391be)['then'](function(_0x2fbd24){if(_0x2fbd24[_0x2da3('0xd')][_0x2da3('0xe')]>0x0){var _0x1d50ad=_0x2fbd24['result'][0x0]['sys_id'];_0x4f0e99(_0x1d50ad);}else{return createRemoteTag(_0x25bb02,_0xb8ead8,_0x250f16,_0xb03050)['then'](function(_0x22a4ca){_0x4f0e99(_0x22a4ca);});}});});}function assignTagToIncident(_0x2707b9,_0x2a44d2,_0x23deee,_0xc11170,_0x350f05){return new Promise(function(_0x12f4f7,_0x1599fb){var _0x356164={'method':'POST','uri':_0x23deee+_0x2da3('0x49')+'?'+_0x350f05,'body':{'label':_0x2707b9,'table':'incident','id_type':_0x2da3('0x4a'),'table_key':_0xc11170['ticketId'],'title':_0x2da3('0x4b')+_0xc11170['ticketNumber'],'id_display':_0xc11170['ticketNumber']},'auth':_0x2a44d2,'json':!![]};return rp(_0x356164)[_0x2da3('0x1c')](function(_0x5546cf){_0x12f4f7();})['catch'](function(){_0x12f4f7();});});}function manageTags(_0x7e2513,_0x625197,_0x2139d2,_0xf2cc07,_0x190979,_0x344ae9,_0x1ad133){return new Promise(function(_0xf7958d,_0x2cf489){var _0x2ae7cd=[];_0x625197[_0x2da3('0x4c')](function(_0x280ede){_0x2ae7cd[_0x2da3('0x4d')](getRemoteTag(_0x280ede,_0x2139d2,_0xf2cc07,_0x344ae9,_0x1ad133));});return Promise[_0x2da3('0x4e')](_0x2ae7cd)[_0x2da3('0x1c')](function(_0x2a7459){if(_0x2a7459[_0x2da3('0xe')]){logger[_0x2da3('0x10')]('['+[_0x7e2513['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x2a7459);var _0x44ec43=[];_0x2a7459[_0x2da3('0x4c')](function(_0xcfe19){_0x44ec43[_0x2da3('0x4d')](assignTagToIncident(_0xcfe19,_0x2139d2,_0xf2cc07,_0x190979,_0x344ae9));});return Promise[_0x2da3('0x4e')](_0x44ec43)['then'](function(){_0xf7958d();})['catch'](function(){_0xf7958d();});}else{_0xf7958d();}});});}function getTags(_0x2e72ed,_0x5c9318,_0x5b1059,_0xe775fe,_0xf62147,_0x3f77ef){return function(_0x57fc21){return new Promise(function(_0xa07c3,_0xa7bbd1){var _0x8ff72a=[];var _0x5a597a=_0xe775fe[_0x2da3('0x4f')];if(_0x5a597a&&_0x5a597a[_0x2da3('0xe')]>0x0){_0x8ff72a=_[_0x2da3('0x50')](_0x5a597a,_0x2da3('0x3a'));}if(_0x8ff72a[_0x2da3('0xe')]>0x0){return manageTags(_0x2e72ed,_0x8ff72a,_0x5c9318,_0x5b1059,_0x57fc21,_0xf62147,_0x3f77ef)[_0x2da3('0x1c')](function(){_0xa07c3(_0x57fc21);});}else{_0xa07c3(_0x57fc21);}});};}function emit(_0x2b6132,_0x2402bb,_0x4f3923){var _0x4d5925=_0x2da3('0x51')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x2da3('0x52')+_0x2da3('0x53');var _0x32db11={'uri':_0x2b6132+_0x2da3('0x54')+_0x4f3923+_0x4d5925};io['to'](util[_0x2da3('0x55')](_0x2da3('0x56'),_0x2402bb))[_0x2da3('0x57')](_0x2da3('0x58'),_0x32db11);}exports['cs']=function(_0x4438ff,_0x57da01,_0xc46704,_0x10c2aa,_0x396918,_0x44552,_0x2dee57,_0x407a9b){var _0x814d7a={};var _0x49d673={'user':_0x44552[_0x2da3('0x59')],'pass':_0x44552[_0x2da3('0x5a')]};var _0x22a287=_0x2da3('0x5b');var _0x577b5f='sysparm_display_value=true';_0x44552[_0x2da3('0x5c')]=intUtil[_0x2da3('0x5d')](_0x44552[_0x2da3('0x5c')]);_0x44552['serverUrl']=intUtil[_0x2da3('0x5d')](_0x44552['serverUrl']);var _0x14c35e=util['format'](_0x2da3('0x5e'),_0x44552[_0x2da3('0x5c')]);_0x814d7a[_0x2da3('0x18')]=!_[_0x2da3('0x5f')](_0x10c2aa)?_0x10c2aa[_0x2da3('0x60')]:null;_0x814d7a[_0x2da3('0x20')]=_0x44552['email'];_0x814d7a[_0x2da3('0x25')]=_0x407a9b[_0x2da3('0x31')]()===_0x2da3('0x3c')?_0x57da01['destcalleridnum']:_0x57da01[_0x2da3('0x61')];_0x814d7a[_0x2da3('0x62')]=_0x407a9b===_0x2da3('0x63')||_0x407a9b==='unmanaged'?_0x2da3('0x63'):_0x2da3('0x3c');var _0x24789c=util[_0x2da3('0x55')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44552['serverUrl'],_0x57da01[_0x2da3('0x64')],md5(_0x57da01[_0x2da3('0x64')]));if(_0x396918&&_0x396918['monitor_format']){logger[_0x2da3('0x10')](_0x2da3('0x65'),_0x2da3('0x66'));_0x57da01[_0x2da3('0x67')]=_0x24789c;}else if(_0x2dee57&&_0x2dee57[_0x2da3('0x68')]&&_0x2dee57[_0x2da3('0x68')]!==_0x2da3('0x69')){logger['info'](_0x2da3('0x6a'),_0x2da3('0x66'));_0x57da01[_0x2da3('0x67')]=_0x24789c;}else{_0x57da01[_0x2da3('0x67')]='';}return getAdminUser(_0x407a9b,_0x49d673,_0x814d7a,_0x14c35e,_0x577b5f,_0x22a287)['then'](getUser(_0x407a9b,_0x49d673,_0x14c35e,_0x577b5f,_0x22a287))[_0x2da3('0x1c')](getEndUser(_0x407a9b,_0x49d673,_0x14c35e,_0x577b5f,_0x22a287))[_0x2da3('0x1c')](getTicket(_0x407a9b,_0x49d673,_0x14c35e,_0xc46704,_0x57da01,_0x577b5f))[_0x2da3('0x1c')](function(_0x13f908){logger['info'](util[_0x2da3('0x55')](_0x2da3('0x6b'),_0x13f908['ticketId']));logger[_0x2da3('0x10')](util['format'](_0x2da3('0x6c'),_0x407a9b));if(_0x407a9b!==_0x2da3('0x6d')){logger[_0x2da3('0x10')]('['+[_0x407a9b[_0x2da3('0x11')]()]+']',_0x2da3('0x6e'));emit(_0x44552[_0x2da3('0x5c')],_0x10c2aa[_0x2da3('0x3a')],_0x13f908[_0x2da3('0x44')]);}})[_0x2da3('0x13')](function(_0x54cecb){logger['error']('['+[_0x407a9b[_0x2da3('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x2da3('0x6f')](_0x54cecb,{'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 36f6f3b..b482273 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 _0xf929=['socket.io-emitter','POST','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','getString','Descriptions','date_start','toISOString','duration_hours','parent_id','Contacts','parent_name','direction','length','forEach','variableName','push','JSON','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','info','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','type','nameField','customField','toLowerCase','toString','string','idField','content','variable','custom_fields','customVariable','Variable','login','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','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...','user:%s','catch','error','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','trigger:browser:url','unmanaged','lastevent','toUpperCase','isNil','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost'];(function(_0x1da281,_0x2f0276){var _0x281637=function(_0x120088){while(--_0x120088){_0x1da281['push'](_0x1da281['shift']());}};_0x281637(++_0x2f0276);}(_0xf929,0x6d));var _0x9f92=function(_0x406554,_0x2d721b){_0x406554=_0x406554-0x0;var _0x17037c=_0xf929[_0x406554];return _0x17037c;};'use strict';var _=require(_0x9f92('0x0'));var rp=require(_0x9f92('0x1'));var BPromise=require('bluebird');var md5=require(_0x9f92('0x2'));var util=require(_0x9f92('0x3'));var Redis=require(_0x9f92('0x4'));var intUtil=require(_0x9f92('0x5'));var config=require(_0x9f92('0x6'));var logger=require('../../../../config/logger')(_0x9f92('0x7'));config[_0x9f92('0x8')]=_[_0x9f92('0x9')](config['redis'],{'host':_0x9f92('0xa'),'port':0x18eb});var io=require(_0x9f92('0xb'))(new Redis(config['redis']));var def={'method':_0x9f92('0xc'),'json':!![]};function emit(_0x49d8b8,_0x1f5921,_0x21c5e4){io['to'](_0x49d8b8)['emit'](_0x1f5921,_0x21c5e4);}function getTicket(_0x55cf0a,_0x5efa96,_0x5215ad,_0x5cca19,_0x2fafd7,_0x1f4630,_0x35cf3f,_0x956584){logger['info'](_0x9f92('0xd'));var _0x5cf2e8=new Date();var _0x187b41=[{'name':_0x9f92('0xe'),'value':intUtil['getString'](_0x5cca19[_0x9f92('0xf')],_0x2fafd7,'\x20')},{'name':_0x9f92('0x10'),'value':_0x5efa96['id']},{'name':'created_by','value':_0x5efa96['id']},{'name':'description','value':intUtil[_0x9f92('0x11')](_0x5cca19[_0x9f92('0x12')],_0x2fafd7,'\x0a')},{'name':_0x9f92('0x13'),'value':_0x5cf2e8[_0x9f92('0x14')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x9f92('0x15'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x9f92('0x16'),'value':_0x5215ad['id']},{'name':'parent_type','value':_0x9f92('0x17')},{'name':_0x9f92('0x18'),'value':_0x5215ad[_0x9f92('0xe')]},{'name':_0x9f92('0x19'),'value':_0x956584}];if(_0x1f4630[_0x9f92('0x1a')]){_[_0x9f92('0x1b')](_0x1f4630,function(_0xe0c40d){if(_0x2fafd7[_0xe0c40d[_0x9f92('0x1c')]]){_0x187b41[_0x9f92('0x1d')]({'name':_0xe0c40d['idField'],'value':_0x2fafd7[_0xe0c40d[_0x9f92('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x9f92('0x1e'),'response_type':_0x9f92('0x1e'),'rest_data':JSON[_0x9f92('0x1f')]({'session':_0x35cf3f['id'],'module_name':_0x9f92('0x20'),'name_value_list':_0x187b41})}});}function getAuth(_0x3a94df){return util['format'](_0x9f92('0x21'),new Buffer(_0x3a94df[_0x9f92('0x22')]+':X')['toString'](_0x9f92('0x23')));}function getServerInfo(_0x1c9983){return request({'form':{'method':_0x9f92('0x24'),'input_type':_0x9f92('0x1e'),'response_type':_0x9f92('0x1e'),'rest_data':JSON['stringify']({'session':_0x1c9983['id']})}});}function getUser(_0x525576,_0x512fa5,_0x1e766f){if(!_['isNil'](_0x512fa5)){logger[_0x9f92('0x25')]('Getting\x20agent\x20with\x20name',_0x512fa5);return request({'form':{'method':_0x9f92('0x26'),'input_type':_0x9f92('0x1e'),'response_type':_0x9f92('0x1e'),'rest_data':JSON[_0x9f92('0x1f')]({'session':_0x1e766f['id'],'module_name':'Employees','query':util[_0x9f92('0x27')](_0x9f92('0x28'),_0x512fa5),'order_by':'','offset':'0','select_fields':['id',_0x9f92('0xe'),_0x9f92('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9f92('0x2a')](function(_0x442d62){if(_0x442d62['entry_list'][_0x9f92('0x1a')]){var _0x425034=_[_0x9f92('0x2b')](_0x442d62[_0x9f92('0x2c')],function(_0xb4a180){return _0xb4a180[_0x9f92('0x2d')][_0x9f92('0x29')][_0x9f92('0x2e')]===_0x512fa5;});if(_0x425034){logger[_0x9f92('0x25')](_0x9f92('0x2f'));return BPromise[_0x9f92('0x30')]({'id':_0x425034[_0x9f92('0x2d')]['id']['value'],'name':_0x425034[_0x9f92('0x2d')][_0x9f92('0xe')][_0x9f92('0x2e')]});}}logger[_0x9f92('0x25')](_0x9f92('0x31'));return BPromise[_0x9f92('0x30')]({'id':_0x1e766f[_0x9f92('0x2d')][_0x9f92('0x32')][_0x9f92('0x2e')],'name':_0x1e766f['name_value_list'][_0x9f92('0x29')][_0x9f92('0x2e')]});});}else{logger['info'](_0x9f92('0x33'));return BPromise['resolve']({'id':_0x1e766f[_0x9f92('0x2d')][_0x9f92('0x32')]['value'],'name':_0x1e766f[_0x9f92('0x2d')][_0x9f92('0x29')][_0x9f92('0x2e')]});}}function getEndUser(_0x5354f6,_0x41b2e8,_0x31f0e7,_0xf29b34){logger['info'](_0x9f92('0x34'),_0x31f0e7);return request({'form':{'method':_0x9f92('0x26'),'input_type':_0x9f92('0x1e'),'response_type':_0x9f92('0x1e'),'rest_data':JSON[_0x9f92('0x1f')]({'session':_0xf29b34['id'],'module_name':'Contacts','query':util[_0x9f92('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x31f0e7),'order_by':'','offset':'0','select_fields':['id',_0x9f92('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x559952){if(_0x559952[_0x9f92('0x2c')][_0x9f92('0x1a')]){var _0x222994=_[_0x9f92('0x2b')](_0x559952[_0x9f92('0x2c')],function(_0x591a0e){return _0x591a0e[_0x9f92('0x2d')]['phone_home'][_0x9f92('0x2e')]===_0x31f0e7;});if(_0x222994){logger[_0x9f92('0x25')]('Enduser\x20found!');return BPromise[_0x9f92('0x30')]({'id':_0x222994[_0x9f92('0x2d')]['id'][_0x9f92('0x2e')],'name':_0x222994[_0x9f92('0x2d')][_0x9f92('0xe')][_0x9f92('0x2e')],'phone':_0x222994[_0x9f92('0x2d')][_0x9f92('0x35')][_0x9f92('0x2e')]});}}else{logger['info'](_0x9f92('0x36'));return request({'form':{'method':_0x9f92('0x37'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9f92('0x1f')]({'session':_0xf29b34['id'],'module_name':_0x9f92('0x17'),'name_value_list':[{'name':_0x9f92('0x38'),'value':_0x41b2e8!==_0x9f92('0x39')?_0x41b2e8:util['format'](_0x9f92('0x3a'),_0x31f0e7)},{'name':_0x9f92('0x35'),'value':_0x31f0e7}]})}})[_0x9f92('0x2a')](function(_0x240873){logger['info']('Enduser\x20created.');return BPromise[_0x9f92('0x30')]({'id':_0x240873['id'],'name':_0x240873[_0x9f92('0x2c')]['first_name']['value'],'phone':_0x240873[_0x9f92('0x2c')][_0x9f92('0x35')][_0x9f92('0x2e')]});});}});}function request(_0x579bc6){logger[_0x9f92('0x3b')](_0x9f92('0x3c'),JSON[_0x9f92('0x1f')](_0x579bc6));return rp(_[_0x9f92('0x3d')](def,_0x579bc6));}function getTags(_0x3c1af1,_0x2fc0f8){var _0x2e4b61=[];if(_0x3c1af1&&_0x3c1af1[_0x9f92('0x1a')]>0x0){_0x2e4b61=_['map'](_0x3c1af1,_0x2fc0f8);}return _0x2e4b61;}function getCustomFields(_0x27d85a,_0x388aa6){var _0x25b22a=[];var _0x208933={'custom_fields':[]};if(_0x27d85a['length']>0x0){_[_0x9f92('0x1b')](_0x27d85a,function(_0x22ec0d){if(_0x22ec0d[_0x9f92('0x3e')]==='string'&&_0x22ec0d[_0x9f92('0x3f')]&&!_0x22ec0d[_0x9f92('0x40')]){_0x208933[_0x22ec0d[_0x9f92('0x3f')][_0x9f92('0x41')]()]=_0x22ec0d['content'][_0x9f92('0x42')]();}else if(_0x22ec0d[_0x9f92('0x3e')]===_0x9f92('0x43')&&_0x22ec0d['idField']&&_0x22ec0d[_0x9f92('0x40')]){_0x208933['custom_fields']['push']({'id':_0x22ec0d[_0x9f92('0x44')],'value':_0x22ec0d[_0x9f92('0x45')][_0x9f92('0x42')]()});}else if(_0x22ec0d[_0x9f92('0x3e')]===_0x9f92('0x46')&&_0x22ec0d[_0x9f92('0x1c')]&&_0x22ec0d[_0x9f92('0x44')]&&_0x22ec0d[_0x9f92('0x40')]){_0x388aa6[_0x22ec0d[_0x9f92('0x1c')]]&&_0x208933[_0x9f92('0x47')]['push']({'id':_0x22ec0d[_0x9f92('0x44')],'value':_0x388aa6[_0x22ec0d['variableName']][_0x9f92('0x42')]()});}else if(_0x22ec0d[_0x9f92('0x3e')]===_0x9f92('0x48')&&_0x22ec0d[_0x9f92('0x49')]&&_0x22ec0d[_0x9f92('0x49')][_0x9f92('0xe')]&&_0x22ec0d['idField']&&_0x22ec0d[_0x9f92('0x40')]){_0x388aa6[_0x22ec0d[_0x9f92('0x49')][_0x9f92('0xe')][_0x9f92('0x41')]()]&&_0x208933['custom_fields'][_0x9f92('0x1d')]({'id':_0x22ec0d[_0x9f92('0x44')],'value':_0x388aa6[_0x22ec0d['Variable']['name']['toLowerCase']()][_0x9f92('0x42')]()});}});}return _0x208933;}function getConnection(_0x42feef){return request({'method':_0x9f92('0xc'),'form':{'method':_0x9f92('0x4a'),'input_type':'JSON','response_type':_0x9f92('0x1e'),'rest_data':JSON[_0x9f92('0x1f')]({'user_auth':{'user_name':_0x42feef['username'],'password':_0x42feef['password'],'encryption':_0x9f92('0x4b')},'application':_0x9f92('0x4c')})}})[_0x9f92('0x2a')](function(_0x429669){var _0x1a94cd=_0x429669;if(_0x1a94cd['id']){def[_0x9f92('0x4d')]=_0x1a94cd['id'];return BPromise['resolve'](_0x1a94cd);}else{throw new Error(util[_0x9f92('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x42feef['id']));}});}function setRelationship(_0x1e8ec4,_0x56ba7d,_0x24a954,_0x56f899){return request({'form':{'method':_0x9f92('0x4e'),'input_type':_0x9f92('0x1e'),'response_type':_0x9f92('0x1e'),'rest_data':JSON[_0x9f92('0x1f')]({'session':_0x1e8ec4['id'],'module_name':_0x9f92('0x20'),'module_id':_0x24a954['id'],'link_field_name':_0x56f899,'related_ids':[_0x56ba7d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9f92('0x4f')]=function(_0x5b1b3c,_0x306968,_0x4c38fc,_0x486b3a,_0x31007a,_0x90f8a5){var _0x4f111f,_0x35736f,_0x224aa2,_0x2f0589;_0x90f8a5['remoteUri']=intUtil[_0x9f92('0x50')](_0x90f8a5[_0x9f92('0x51')]);_0x90f8a5[_0x9f92('0x52')]=intUtil[_0x9f92('0x50')](_0x90f8a5['serverUrl']);def['uri']=util[_0x9f92('0x27')](_0x9f92('0x53'),_0x90f8a5['remoteUri']);if(_0x31007a&&_0x31007a[_0x9f92('0x54')]){logger['info'](_0x9f92('0x55'),'Recording\x20is\x20enabled!');_0x306968['recordingURL']=util[_0x9f92('0x27')](_0x9f92('0x56'),_0x90f8a5['serverUrl'],_0x306968[_0x9f92('0x57')],md5(_0x306968[_0x9f92('0x57')]));}else{_0x306968[_0x9f92('0x58')]='';}return getConnection(_0x90f8a5)[_0x9f92('0x2a')](function(_0x3a37ce){_0x2f0589=_0x3a37ce;return getUser(_0x90f8a5,_0x486b3a[_0x9f92('0xe')],_0x2f0589);})[_0x9f92('0x2a')](function(_0x289866){_0x4f111f=_0x289866;logger[_0x9f92('0x25')](_0x9f92('0x59'),_0x4f111f['id']);return getEndUser(_0x90f8a5,_0x306968[_0x9f92('0x5a')],_0x306968['calleridnum'],_0x2f0589);})['then'](function(_0x2d9b58){_0x35736f=_0x2d9b58;logger[_0x9f92('0x25')](_0x9f92('0x5b'),_0x35736f['id']);return getTicket(_0x90f8a5,_0x4f111f,_0x35736f,_0x4c38fc,_0x306968,_0x4c38fc['Fields'],_0x2f0589,_0x9f92('0x5c'));})[_0x9f92('0x2a')](function(_0x5a5d4f){_0x224aa2=_0x5a5d4f;logger[_0x9f92('0x25')](_0x9f92('0x5d'));logger[_0x9f92('0x25')](_0x9f92('0x5e'),_0x224aa2['id']);return setRelationship(_0x2f0589,_0x4f111f,_0x224aa2,_0x9f92('0x5f'));})[_0x9f92('0x2a')](function(){return setRelationship(_0x2f0589,_0x35736f,_0x224aa2,_0x9f92('0x60'));})[_0x9f92('0x2a')](function(){return getServerInfo(_0x2f0589);})['then'](function(_0x5152f2){var _0x1138a4=parseInt(_0x5152f2[_0x9f92('0x61')][_0x9f92('0x62')](0x0));var _0x528ff7=util[_0x9f92('0x27')](_0x9f92('0x63'),_0x90f8a5[_0x9f92('0x51')],_0x224aa2['id']);if(_0x1138a4>0x6){_0x528ff7=util[_0x9f92('0x27')](_0x9f92('0x64'),_0x90f8a5[_0x9f92('0x51')],_0x224aa2['id']);}logger['info']('[QUEUE]',_0x9f92('0x65'));emit(util['format'](_0x9f92('0x66'),_0x486b3a[_0x9f92('0xe')]),'trigger:browser:url',{'uri':_0x528ff7});})[_0x9f92('0x67')](function(_0x5f47df){logger[_0x9f92('0x68')]('[QUEUE]',JSON[_0x9f92('0x1f')](_0x5f47df));});};exports['outbound']=function(_0x18134e,_0x3c47f1,_0x1ff1a4,_0x8296e,_0x1b34f3,_0x59726a,_0xb9716a){var _0x4ef1da,_0x1dbb5e,_0x250bd7,_0x45893c;_0x59726a[_0x9f92('0x51')]=intUtil['stripTrailingSlash'](_0x59726a[_0x9f92('0x51')]);_0x59726a['serverUrl']=intUtil[_0x9f92('0x50')](_0x59726a[_0x9f92('0x52')]);def[_0x9f92('0x69')]=util[_0x9f92('0x27')](_0x9f92('0x53'),_0x59726a['remoteUri']);if(_0xb9716a&&_0xb9716a['recordingFormat']&&_0xb9716a[_0x9f92('0x6a')]!==_0x9f92('0x6b')){logger[_0x9f92('0x25')](_0x9f92('0x6c'),_0x9f92('0x6d'));_0x3c47f1[_0x9f92('0x58')]=util[_0x9f92('0x27')](_0x9f92('0x56'),_0x59726a['serverUrl'],_0x3c47f1['uniqueid'],md5(_0x3c47f1[_0x9f92('0x57')]));}return getConnection(_0x59726a)[_0x9f92('0x2a')](function(_0x1eb9d3){_0x45893c=_0x1eb9d3;return getUser(_0x59726a,_0x8296e['name'],_0x45893c);})[_0x9f92('0x2a')](function(_0x276890){_0x4ef1da=_0x276890;logger[_0x9f92('0x25')](_0x9f92('0x59'),_0x4ef1da['id']);return getEndUser(_0x59726a,_0x3c47f1[_0x9f92('0x6e')],_0x3c47f1[_0x9f92('0x6f')],_0x45893c);})[_0x9f92('0x2a')](function(_0x2a3f4d){_0x1dbb5e=_0x2a3f4d;logger[_0x9f92('0x25')](_0x9f92('0x5b'),_0x1dbb5e['id']);return getTicket(_0x59726a,_0x4ef1da,_0x1dbb5e,_0x1ff1a4,_0x3c47f1,_0x1ff1a4[_0x9f92('0x70')],_0x45893c,_0x9f92('0x71'));})[_0x9f92('0x2a')](function(_0x847577){_0x250bd7=_0x847577;logger[_0x9f92('0x25')]('Ticket\x20created!');logger[_0x9f92('0x25')](_0x9f92('0x5e'),_0x250bd7['id']);return setRelationship(_0x45893c,_0x4ef1da,_0x250bd7,'users');})[_0x9f92('0x2a')](function(){return setRelationship(_0x45893c,_0x1dbb5e,_0x250bd7,'contacts');})[_0x9f92('0x2a')](function(){return getServerInfo(_0x45893c);})[_0x9f92('0x2a')](function(_0x47855c){var _0x4beeb6=parseInt(_0x47855c['version']['charAt'](0x0));var _0x74f543=util[_0x9f92('0x27')](_0x9f92('0x63'),_0x59726a[_0x9f92('0x51')],_0x250bd7['id']);if(_0x4beeb6>0x6){_0x74f543=util['format'](_0x9f92('0x64'),_0x59726a['remoteUri'],_0x250bd7['id']);}logger[_0x9f92('0x25')](_0x9f92('0x6c'),_0x9f92('0x65'));emit(util[_0x9f92('0x27')](_0x9f92('0x66'),_0x8296e['name']),_0x9f92('0x72'),{'uri':_0x74f543});})[_0x9f92('0x67')](function(_0x1b1499){logger[_0x9f92('0x68')](_0x9f92('0x6c'),JSON['stringify'](_0x1b1499));});};exports[_0x9f92('0x73')]=function(_0xd51d2,_0x4934db,_0x10c612,_0x5795db,_0x39c6dd,_0x4a1887){var _0x38634c,_0x8122ed,_0x2346de,_0xf18bf9;_0x4a1887[_0x9f92('0x51')]=intUtil[_0x9f92('0x50')](_0x4a1887[_0x9f92('0x51')]);_0x4a1887['serverUrl']=intUtil[_0x9f92('0x50')](_0x4a1887[_0x9f92('0x52')]);def['uri']=util[_0x9f92('0x27')](_0x9f92('0x53'),_0x4a1887['remoteUri']);if(_0x39c6dd&&_0x39c6dd['monitor_format']){logger[_0x9f92('0x25')]('['+_0x4934db[_0x9f92('0x74')][_0x9f92('0x75')]()+']',_0x9f92('0x6d'));_0x4934db[_0x9f92('0x58')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a1887[_0x9f92('0x52')],_0x4934db['uniqueid'],md5(_0x4934db['uniqueid']));}else{_0x4934db[_0x9f92('0x58')]='';}return getConnection(_0x4a1887)[_0x9f92('0x2a')](function(_0x572574){_0xf18bf9=_0x572574;if(!_[_0x9f92('0x76')](_0x5795db)){return getUser(_0x4a1887,_0x5795db[_0x9f92('0xe')],_0xf18bf9);}else{return getUser(_0x4a1887,null,_0xf18bf9);}})['then'](function(_0x44aceb){_0x38634c=_0x44aceb;logger[_0x9f92('0x25')](_0x9f92('0x59'),_0x38634c['id']);return getEndUser(_0x4a1887,_0x4934db[_0x9f92('0x5a')],_0x4934db[_0x9f92('0x77')],_0xf18bf9);})[_0x9f92('0x2a')](function(_0x4cd96b){_0x8122ed=_0x4cd96b;logger['info'](_0x9f92('0x5b'),_0x8122ed['id']);return getTicket(_0x4a1887,_0x38634c,_0x8122ed,_0x10c612,_0x4934db,_0x10c612['Fields'],_0xf18bf9,_0x9f92('0x5c'));})['then'](function(_0x104027){_0x2346de=_0x104027;logger[_0x9f92('0x25')](_0x9f92('0x5d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2346de['id']);return setRelationship(_0xf18bf9,_0x38634c,_0x2346de,_0x9f92('0x5f'));})['then'](function(){return setRelationship(_0xf18bf9,_0x8122ed,_0x2346de,_0x9f92('0x60'));})[_0x9f92('0x2a')](function(){return getServerInfo(_0xf18bf9);})[_0x9f92('0x67')](function(_0x12950e){logger['error']('['+_0x4934db[_0x9f92('0x74')][_0x9f92('0x75')]()+']',JSON['stringify'](_0x12950e));});}; \ No newline at end of file +var _0xcb68=['info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','content','toString','customField','custom_fields','customVariable','Variable','toLowerCase','login','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','stripTrailingSlash','uri','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','charAt','user:%s','lastevent','Ticket\x20created!','toUpperCase','lodash','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit'];(function(_0x4f87b6,_0x2f0953){var _0x52ba7c=function(_0x5da29e){while(--_0x5da29e){_0x4f87b6['push'](_0x4f87b6['shift']());}};_0x52ba7c(++_0x2f0953);}(_0xcb68,0x165));var _0x8cb6=function(_0xbc3f48,_0x58e0ba){_0xbc3f48=_0xbc3f48-0x0;var _0x51a17b=_0xcb68[_0xbc3f48];return _0x51a17b;};'use strict';var _=require(_0x8cb6('0x0'));var rp=require('request-promise');var BPromise=require(_0x8cb6('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x8cb6('0x2'));var intUtil=require(_0x8cb6('0x3'));var config=require(_0x8cb6('0x4'));var logger=require(_0x8cb6('0x5'))(_0x8cb6('0x6'));config[_0x8cb6('0x7')]=_[_0x8cb6('0x8')](config[_0x8cb6('0x7')],{'host':_0x8cb6('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8cb6('0x7')]));var def={'method':_0x8cb6('0xa'),'json':!![]};function emit(_0x553641,_0x53915e,_0x31be94){io['to'](_0x553641)[_0x8cb6('0xb')](_0x53915e,_0x31be94);}function getTicket(_0x52c41e,_0x4ac1d3,_0x4a5f61,_0x53b694,_0x25cf2e,_0x134979,_0xeee307,_0x20988f){logger[_0x8cb6('0xc')](_0x8cb6('0xd'));var _0x166ce7=new Date();var _0x404db5=[{'name':_0x8cb6('0xe'),'value':intUtil[_0x8cb6('0xf')](_0x53b694[_0x8cb6('0x10')],_0x25cf2e,'\x20')},{'name':_0x8cb6('0x11'),'value':_0x4ac1d3['id']},{'name':_0x8cb6('0x12'),'value':_0x4ac1d3['id']},{'name':'description','value':intUtil['getString'](_0x53b694[_0x8cb6('0x13')],_0x25cf2e,'\x0a')},{'name':'date_start','value':_0x166ce7[_0x8cb6('0x14')]()['slice'](0x0,0x13)[_0x8cb6('0x15')]('T','\x20')},{'name':_0x8cb6('0x16'),'value':'0'},{'name':_0x8cb6('0x17'),'value':'15'},{'name':_0x8cb6('0x18'),'value':_0x4a5f61['id']},{'name':_0x8cb6('0x19'),'value':'Contacts'},{'name':'parent_name','value':_0x4a5f61[_0x8cb6('0xe')]},{'name':'direction','value':_0x20988f}];if(_0x134979[_0x8cb6('0x1a')]){_[_0x8cb6('0x1b')](_0x134979,function(_0x513788){if(_0x25cf2e[_0x513788[_0x8cb6('0x1c')]]){_0x404db5[_0x8cb6('0x1d')]({'name':_0x513788[_0x8cb6('0x1e')],'value':_0x25cf2e[_0x513788['variableName']]});}});}return request({'form':{'method':_0x8cb6('0x1f'),'input_type':_0x8cb6('0x20'),'response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'session':_0xeee307['id'],'module_name':_0x8cb6('0x22'),'name_value_list':_0x404db5})}});}function getAuth(_0x456a64){return util[_0x8cb6('0x23')](_0x8cb6('0x24'),new Buffer(_0x456a64['apiKey']+':X')['toString'](_0x8cb6('0x25')));}function getServerInfo(_0x59510c){return request({'form':{'method':_0x8cb6('0x26'),'input_type':'JSON','response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'session':_0x59510c['id']})}});}function getUser(_0x6a788f,_0x2149d3,_0x9b17ab){if(!_[_0x8cb6('0x27')](_0x2149d3)){logger[_0x8cb6('0xc')](_0x8cb6('0x28'),_0x2149d3);return request({'form':{'method':'get_entry_list','input_type':_0x8cb6('0x20'),'response_type':'JSON','rest_data':JSON[_0x8cb6('0x21')]({'session':_0x9b17ab['id'],'module_name':_0x8cb6('0x29'),'query':util[_0x8cb6('0x23')](_0x8cb6('0x2a'),_0x2149d3),'order_by':'','offset':'0','select_fields':['id',_0x8cb6('0xe'),_0x8cb6('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8cb6('0x2c')](function(_0x309eab){if(_0x309eab['entry_list'][_0x8cb6('0x1a')]){var _0xd0d191=_[_0x8cb6('0x2d')](_0x309eab[_0x8cb6('0x2e')],function(_0x11eb53){return _0x11eb53[_0x8cb6('0x2f')][_0x8cb6('0x2b')][_0x8cb6('0x30')]===_0x2149d3;});if(_0xd0d191){logger['info'](_0x8cb6('0x31'));return BPromise[_0x8cb6('0x32')]({'id':_0xd0d191['name_value_list']['id']['value'],'name':_0xd0d191[_0x8cb6('0x2f')]['name'][_0x8cb6('0x30')]});}}logger[_0x8cb6('0xc')](_0x8cb6('0x33'));return BPromise[_0x8cb6('0x32')]({'id':_0x9b17ab[_0x8cb6('0x2f')]['user_id'][_0x8cb6('0x30')],'name':_0x9b17ab[_0x8cb6('0x2f')][_0x8cb6('0x2b')]['value']});});}else{logger[_0x8cb6('0xc')](_0x8cb6('0x34'));return BPromise[_0x8cb6('0x32')]({'id':_0x9b17ab[_0x8cb6('0x2f')][_0x8cb6('0x35')]['value'],'name':_0x9b17ab[_0x8cb6('0x2f')][_0x8cb6('0x2b')][_0x8cb6('0x30')]});}}function getEndUser(_0x191ab7,_0x109961,_0x32b693,_0x2225b8){logger[_0x8cb6('0xc')](_0x8cb6('0x36'),_0x32b693);return request({'form':{'method':_0x8cb6('0x37'),'input_type':'JSON','response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'session':_0x2225b8['id'],'module_name':_0x8cb6('0x38'),'query':util[_0x8cb6('0x23')](_0x8cb6('0x39'),_0x32b693),'order_by':'','offset':'0','select_fields':['id',_0x8cb6('0xe'),_0x8cb6('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8cb6('0x2c')](function(_0x527f08){if(_0x527f08[_0x8cb6('0x2e')]['length']){var _0x6a86c5=_[_0x8cb6('0x2d')](_0x527f08['entry_list'],function(_0x2ac31f){return _0x2ac31f['name_value_list'][_0x8cb6('0x3a')][_0x8cb6('0x30')]===_0x32b693;});if(_0x6a86c5){logger[_0x8cb6('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x6a86c5['name_value_list']['id'][_0x8cb6('0x30')],'name':_0x6a86c5[_0x8cb6('0x2f')]['name'][_0x8cb6('0x30')],'phone':_0x6a86c5[_0x8cb6('0x2f')][_0x8cb6('0x3a')]['value']});}}else{logger[_0x8cb6('0xc')](_0x8cb6('0x3b'));return request({'form':{'method':_0x8cb6('0x1f'),'input_type':_0x8cb6('0x20'),'response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'session':_0x2225b8['id'],'module_name':_0x8cb6('0x38'),'name_value_list':[{'name':_0x8cb6('0x3c'),'value':_0x109961!==_0x8cb6('0x3d')?_0x109961:util[_0x8cb6('0x23')](_0x8cb6('0x3e'),_0x32b693)},{'name':'phone_home','value':_0x32b693}]})}})[_0x8cb6('0x2c')](function(_0x374d46){logger['info'](_0x8cb6('0x3f'));return BPromise[_0x8cb6('0x32')]({'id':_0x374d46['id'],'name':_0x374d46[_0x8cb6('0x2e')][_0x8cb6('0x3c')][_0x8cb6('0x30')],'phone':_0x374d46[_0x8cb6('0x2e')][_0x8cb6('0x3a')][_0x8cb6('0x30')]});});}});}function request(_0x3a5a68){logger[_0x8cb6('0x40')]('[HTTP]',JSON[_0x8cb6('0x21')](_0x3a5a68));return rp(_[_0x8cb6('0x41')](def,_0x3a5a68));}function getTags(_0x5d8ed3,_0x1e032f){var _0x530488=[];if(_0x5d8ed3&&_0x5d8ed3[_0x8cb6('0x1a')]>0x0){_0x530488=_[_0x8cb6('0x42')](_0x5d8ed3,_0x1e032f);}return _0x530488;}function getCustomFields(_0x306b2e,_0xb7b257){var _0xe12312=[];var _0x3b571e={'custom_fields':[]};if(_0x306b2e[_0x8cb6('0x1a')]>0x0){_[_0x8cb6('0x1b')](_0x306b2e,function(_0x4b02d1){if(_0x4b02d1[_0x8cb6('0x43')]===_0x8cb6('0x44')&&_0x4b02d1[_0x8cb6('0x45')]&&!_0x4b02d1['customField']){_0x3b571e[_0x4b02d1[_0x8cb6('0x45')]['toLowerCase']()]=_0x4b02d1[_0x8cb6('0x46')][_0x8cb6('0x47')]();}else if(_0x4b02d1[_0x8cb6('0x43')]===_0x8cb6('0x44')&&_0x4b02d1['idField']&&_0x4b02d1[_0x8cb6('0x48')]){_0x3b571e[_0x8cb6('0x49')][_0x8cb6('0x1d')]({'id':_0x4b02d1[_0x8cb6('0x1e')],'value':_0x4b02d1[_0x8cb6('0x46')]['toString']()});}else if(_0x4b02d1[_0x8cb6('0x43')]==='variable'&&_0x4b02d1[_0x8cb6('0x1c')]&&_0x4b02d1[_0x8cb6('0x1e')]&&_0x4b02d1[_0x8cb6('0x48')]){_0xb7b257[_0x4b02d1[_0x8cb6('0x1c')]]&&_0x3b571e[_0x8cb6('0x49')]['push']({'id':_0x4b02d1['idField'],'value':_0xb7b257[_0x4b02d1['variableName']][_0x8cb6('0x47')]()});}else if(_0x4b02d1[_0x8cb6('0x43')]===_0x8cb6('0x4a')&&_0x4b02d1[_0x8cb6('0x4b')]&&_0x4b02d1['Variable'][_0x8cb6('0xe')]&&_0x4b02d1[_0x8cb6('0x1e')]&&_0x4b02d1[_0x8cb6('0x48')]){_0xb7b257[_0x4b02d1['Variable'][_0x8cb6('0xe')][_0x8cb6('0x4c')]()]&&_0x3b571e[_0x8cb6('0x49')]['push']({'id':_0x4b02d1['idField'],'value':_0xb7b257[_0x4b02d1[_0x8cb6('0x4b')][_0x8cb6('0xe')][_0x8cb6('0x4c')]()][_0x8cb6('0x47')]()});}});}return _0x3b571e;}function getConnection(_0x444c89){return request({'method':_0x8cb6('0xa'),'form':{'method':_0x8cb6('0x4d'),'input_type':_0x8cb6('0x20'),'response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'user_auth':{'user_name':_0x444c89['username'],'password':_0x444c89[_0x8cb6('0x4e')],'encryption':_0x8cb6('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8cb6('0x2c')](function(_0x386420){var _0x2a6438=_0x386420;if(_0x2a6438['id']){def[_0x8cb6('0x50')]=_0x2a6438['id'];return BPromise[_0x8cb6('0x32')](_0x2a6438);}else{throw new Error(util[_0x8cb6('0x23')](_0x8cb6('0x51'),_0x444c89['id']));}});}function setRelationship(_0xa13ef,_0x13b2ac,_0xc5e0fc,_0x33ccc0){return request({'form':{'method':_0x8cb6('0x52'),'input_type':'JSON','response_type':_0x8cb6('0x20'),'rest_data':JSON[_0x8cb6('0x21')]({'session':_0xa13ef['id'],'module_name':_0x8cb6('0x22'),'module_id':_0xc5e0fc['id'],'link_field_name':_0x33ccc0,'related_ids':[_0x13b2ac['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8cb6('0x53')]=function(_0x2c5311,_0x5a373e,_0x2abf37,_0x3cee65,_0x93bd55,_0x345e7a){var _0x30196c,_0x5ef129,_0xd66130,_0x49eec5;_0x345e7a[_0x8cb6('0x54')]=intUtil['stripTrailingSlash'](_0x345e7a[_0x8cb6('0x54')]);_0x345e7a[_0x8cb6('0x55')]=intUtil['stripTrailingSlash'](_0x345e7a['serverUrl']);def['uri']=util[_0x8cb6('0x23')](_0x8cb6('0x56'),_0x345e7a[_0x8cb6('0x54')]);if(_0x93bd55&&_0x93bd55[_0x8cb6('0x57')]){logger[_0x8cb6('0xc')](_0x8cb6('0x58'),_0x8cb6('0x59'));_0x5a373e[_0x8cb6('0x5a')]=util['format'](_0x8cb6('0x5b'),_0x345e7a[_0x8cb6('0x55')],_0x5a373e[_0x8cb6('0x5c')],md5(_0x5a373e[_0x8cb6('0x5c')]));}else{_0x5a373e['recordingURL']='';}return getConnection(_0x345e7a)[_0x8cb6('0x2c')](function(_0x12f1a4){_0x49eec5=_0x12f1a4;return getUser(_0x345e7a,_0x3cee65['name'],_0x49eec5);})[_0x8cb6('0x2c')](function(_0x2c0004){_0x30196c=_0x2c0004;logger[_0x8cb6('0xc')]('The\x20User\x20ID\x20is:',_0x30196c['id']);return getEndUser(_0x345e7a,_0x5a373e[_0x8cb6('0x5d')],_0x5a373e[_0x8cb6('0x5e')],_0x49eec5);})[_0x8cb6('0x2c')](function(_0x49b836){_0x5ef129=_0x49b836;logger[_0x8cb6('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5ef129['id']);return getTicket(_0x345e7a,_0x30196c,_0x5ef129,_0x2abf37,_0x5a373e,_0x2abf37[_0x8cb6('0x5f')],_0x49eec5,_0x8cb6('0x60'));})['then'](function(_0x2d3043){_0xd66130=_0x2d3043;logger[_0x8cb6('0xc')]('Ticket\x20created!');logger[_0x8cb6('0xc')](_0x8cb6('0x61'),_0xd66130['id']);return setRelationship(_0x49eec5,_0x30196c,_0xd66130,_0x8cb6('0x62'));})[_0x8cb6('0x2c')](function(){return setRelationship(_0x49eec5,_0x5ef129,_0xd66130,_0x8cb6('0x63'));})[_0x8cb6('0x2c')](function(){return getServerInfo(_0x49eec5);})['then'](function(_0x2abe10){var _0x498138=parseInt(_0x2abe10[_0x8cb6('0x64')]['charAt'](0x0));var _0x47c1f7=util['format'](_0x8cb6('0x65'),_0x345e7a[_0x8cb6('0x54')],_0xd66130['id']);if(_0x498138>0x6){_0x47c1f7=util['format'](_0x8cb6('0x66'),_0x345e7a[_0x8cb6('0x54')],_0xd66130['id']);}logger[_0x8cb6('0xc')](_0x8cb6('0x58'),_0x8cb6('0x67'));emit(util[_0x8cb6('0x23')]('user:%s',_0x3cee65[_0x8cb6('0xe')]),_0x8cb6('0x68'),{'uri':_0x47c1f7});})[_0x8cb6('0x69')](function(_0x5e67e9){logger[_0x8cb6('0x6a')](_0x8cb6('0x58'),JSON[_0x8cb6('0x21')](_0x5e67e9));});};exports[_0x8cb6('0x6b')]=function(_0x3ecdb9,_0x2fa3c9,_0x35cfa7,_0x510dc3,_0x1f460c,_0x4c8202,_0x74a2ed){var _0x48642b,_0x11b27b,_0x13ca39,_0x13e6a3;_0x4c8202[_0x8cb6('0x54')]=intUtil[_0x8cb6('0x6c')](_0x4c8202[_0x8cb6('0x54')]);_0x4c8202[_0x8cb6('0x55')]=intUtil[_0x8cb6('0x6c')](_0x4c8202[_0x8cb6('0x55')]);def[_0x8cb6('0x6d')]=util[_0x8cb6('0x23')](_0x8cb6('0x56'),_0x4c8202['remoteUri']);if(_0x74a2ed&&_0x74a2ed[_0x8cb6('0x6e')]&&_0x74a2ed[_0x8cb6('0x6e')]!==_0x8cb6('0x6f')){logger['info'](_0x8cb6('0x70'),_0x8cb6('0x59'));_0x2fa3c9[_0x8cb6('0x5a')]=util[_0x8cb6('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c8202[_0x8cb6('0x55')],_0x2fa3c9[_0x8cb6('0x5c')],md5(_0x2fa3c9[_0x8cb6('0x5c')]));}return getConnection(_0x4c8202)['then'](function(_0x59d5de){_0x13e6a3=_0x59d5de;return getUser(_0x4c8202,_0x510dc3[_0x8cb6('0xe')],_0x13e6a3);})['then'](function(_0x605ec3){_0x48642b=_0x605ec3;logger['info'](_0x8cb6('0x71'),_0x48642b['id']);return getEndUser(_0x4c8202,_0x2fa3c9[_0x8cb6('0x72')],_0x2fa3c9[_0x8cb6('0x73')],_0x13e6a3);})['then'](function(_0x449e70){_0x11b27b=_0x449e70;logger[_0x8cb6('0xc')](_0x8cb6('0x74'),_0x11b27b['id']);return getTicket(_0x4c8202,_0x48642b,_0x11b27b,_0x35cfa7,_0x2fa3c9,_0x35cfa7[_0x8cb6('0x5f')],_0x13e6a3,_0x8cb6('0x75'));})['then'](function(_0x13c98c){_0x13ca39=_0x13c98c;logger[_0x8cb6('0xc')]('Ticket\x20created!');logger['info'](_0x8cb6('0x61'),_0x13ca39['id']);return setRelationship(_0x13e6a3,_0x48642b,_0x13ca39,'users');})['then'](function(){return setRelationship(_0x13e6a3,_0x11b27b,_0x13ca39,_0x8cb6('0x63'));})['then'](function(){return getServerInfo(_0x13e6a3);})[_0x8cb6('0x2c')](function(_0x48a608){var _0x20ccde=parseInt(_0x48a608[_0x8cb6('0x64')][_0x8cb6('0x76')](0x0));var _0x49d338=util[_0x8cb6('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4c8202[_0x8cb6('0x54')],_0x13ca39['id']);if(_0x20ccde>0x6){_0x49d338=util['format'](_0x8cb6('0x66'),_0x4c8202['remoteUri'],_0x13ca39['id']);}logger['info'](_0x8cb6('0x70'),_0x8cb6('0x67'));emit(util['format'](_0x8cb6('0x77'),_0x510dc3[_0x8cb6('0xe')]),'trigger:browser:url',{'uri':_0x49d338});})[_0x8cb6('0x69')](function(_0x3c874b){logger[_0x8cb6('0x6a')]('[OUTBOUND]',JSON[_0x8cb6('0x21')](_0x3c874b));});};exports['unmanaged']=function(_0x49847d,_0x133e9e,_0x5dcd37,_0xc35c20,_0x36c332,_0x143ea6){var _0x17405e,_0x4912ca,_0x40c53a,_0x5f395c;_0x143ea6[_0x8cb6('0x54')]=intUtil['stripTrailingSlash'](_0x143ea6[_0x8cb6('0x54')]);_0x143ea6[_0x8cb6('0x55')]=intUtil[_0x8cb6('0x6c')](_0x143ea6[_0x8cb6('0x55')]);def[_0x8cb6('0x6d')]=util[_0x8cb6('0x23')]('%s/service/v4_1/rest.php',_0x143ea6[_0x8cb6('0x54')]);if(_0x36c332&&_0x36c332['monitor_format']){logger[_0x8cb6('0xc')]('['+_0x133e9e[_0x8cb6('0x78')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x133e9e[_0x8cb6('0x5a')]=util[_0x8cb6('0x23')](_0x8cb6('0x5b'),_0x143ea6[_0x8cb6('0x55')],_0x133e9e[_0x8cb6('0x5c')],md5(_0x133e9e[_0x8cb6('0x5c')]));}else{_0x133e9e['recordingURL']='';}return getConnection(_0x143ea6)['then'](function(_0x4cbe5b){_0x5f395c=_0x4cbe5b;if(!_[_0x8cb6('0x27')](_0xc35c20)){return getUser(_0x143ea6,_0xc35c20['name'],_0x5f395c);}else{return getUser(_0x143ea6,null,_0x5f395c);}})[_0x8cb6('0x2c')](function(_0x3ea3b9){_0x17405e=_0x3ea3b9;logger[_0x8cb6('0xc')](_0x8cb6('0x71'),_0x17405e['id']);return getEndUser(_0x143ea6,_0x133e9e[_0x8cb6('0x5d')],_0x133e9e[_0x8cb6('0x5e')],_0x5f395c);})[_0x8cb6('0x2c')](function(_0x3c2095){_0x4912ca=_0x3c2095;logger[_0x8cb6('0xc')](_0x8cb6('0x74'),_0x4912ca['id']);return getTicket(_0x143ea6,_0x17405e,_0x4912ca,_0x5dcd37,_0x133e9e,_0x5dcd37[_0x8cb6('0x5f')],_0x5f395c,_0x8cb6('0x60'));})[_0x8cb6('0x2c')](function(_0x1f6fd6){_0x40c53a=_0x1f6fd6;logger[_0x8cb6('0xc')](_0x8cb6('0x79'));logger[_0x8cb6('0xc')](_0x8cb6('0x61'),_0x40c53a['id']);return setRelationship(_0x5f395c,_0x17405e,_0x40c53a,_0x8cb6('0x62'));})[_0x8cb6('0x2c')](function(){return setRelationship(_0x5f395c,_0x4912ca,_0x40c53a,_0x8cb6('0x63'));})[_0x8cb6('0x2c')](function(){return getServerInfo(_0x5f395c);})[_0x8cb6('0x69')](function(_0x5f31f9){logger[_0x8cb6('0x6a')]('['+_0x133e9e[_0x8cb6('0x78')][_0x8cb6('0x7a')]()+']',JSON[_0x8cb6('0x21')](_0x5f31f9));});}; \ 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 d20d9f1..8512760 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 _0xa93f=['type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','format','key','keyContent','keyType','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length'];(function(_0x2e4d53,_0x3dbbea){var _0x583512=function(_0x192c51){while(--_0x192c51){_0x2e4d53['push'](_0x2e4d53['shift']());}};_0x583512(++_0x3dbbea);}(_0xa93f,0xa4));var _0xfa93=function(_0x45d808,_0x23f546){_0x45d808=_0x45d808-0x0;var _0x3ff5e4=_0xa93f[_0x45d808];return _0x3ff5e4;};'use strict';var _=require(_0xfa93('0x0'));var util=require(_0xfa93('0x1'));exports[_0xfa93('0x2')]=function(_0x318958,_0x53df53,_0x484708){var _0xeea132=[];if(_0x318958[_0xfa93('0x3')]>0x0){var _0x421403=_['sortBy'](_0x318958,['id']);for(var _0x26aa01=0x0;_0x26aa01<_0x421403[_0xfa93('0x3')];_0x26aa01++){var _0x2d23ef=_0x421403[_0x26aa01];if(_0x2d23ef[_0xfa93('0x4')]===_0xfa93('0x5')){_0xeea132['push'](_0x2d23ef[_0xfa93('0x6')]);}else if(_0x2d23ef[_0xfa93('0x4')]===_0xfa93('0x7')&&_0x2d23ef[_0xfa93('0x8')]){_0x53df53[_0x2d23ef[_0xfa93('0x8')]]&&_0xeea132[_0xfa93('0x9')](_0x53df53[_0x2d23ef[_0xfa93('0x8')]][_0xfa93('0xa')]());}else if(_0x2d23ef[_0xfa93('0x4')]===_0xfa93('0xb')&&_0x2d23ef[_0xfa93('0xc')]&&_0x2d23ef['Variable'][_0xfa93('0xd')]){_0x53df53[_0x2d23ef[_0xfa93('0xc')][_0xfa93('0xd')]['toLowerCase']()]&&_0xeea132[_0xfa93('0x9')](_0x53df53[_0x2d23ef[_0xfa93('0xc')][_0xfa93('0xd')][_0xfa93('0xe')]()][_0xfa93('0xa')]());}else if(_0x2d23ef[_0xfa93('0x4')]===_0xfa93('0xf')){if(_0x2d23ef['keyType']===_0xfa93('0x5')&&_0x2d23ef['key']){_0xeea132['push'](util[_0xfa93('0x10')]('%s:\x20%s',_0x2d23ef[_0xfa93('0x11')],_0x2d23ef[_0xfa93('0x12')]));}else if(_0x2d23ef['keyType']===_0xfa93('0x7')&&_0x2d23ef[_0xfa93('0x8')]&&_0x2d23ef[_0xfa93('0x11')]){_0x53df53[_0x2d23ef['variableName']]&&_0xeea132[_0xfa93('0x9')](util['format']('%s:\x20%s',_0x2d23ef[_0xfa93('0x11')],_0x53df53[_0x2d23ef['variableName']]));}else if(_0x2d23ef[_0xfa93('0x13')]===_0xfa93('0xb')&&_0x2d23ef[_0xfa93('0xc')]&&_0x2d23ef[_0xfa93('0xc')]['name']&&_0x2d23ef[_0xfa93('0x11')]){_0x53df53[_0x2d23ef[_0xfa93('0xc')]['name']['toLowerCase']()]&&_0xeea132[_0xfa93('0x9')](util[_0xfa93('0x10')](_0xfa93('0x14'),_0x2d23ef[_0xfa93('0x11')],_0x53df53[_0x2d23ef[_0xfa93('0xc')][_0xfa93('0xd')][_0xfa93('0xe')]()]));}}}}return _0xeea132['join'](_0x484708);};exports[_0xfa93('0x15')]=function(_0xd26b16){var _0x378748=_0xd26b16[_0xfa93('0x16')](-0x1);if(_0x378748==='/'){_0xd26b16=_0xd26b16[_0xfa93('0x17')](0x0,_0xd26b16[_0xfa93('0x18')](_0x378748));}return _0xd26b16;};exports[_0xfa93('0x19')]=function(_0x3b327b){if(!_[_0xfa93('0x1a')](_0x3b327b)&&_0x3b327b!==''){var _0x2acac8=/^(([^<>()\[\]\\.,;:\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 _0x2acac8[_0xfa93('0x1b')](String(_0x3b327b)[_0xfa93('0xe')]());}else{return![];}}; \ No newline at end of file +var _0x4bb4=['length','type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','string','%s:\x20%s','key','keyType','format','join','slice','substring','lastIndexOf','validateEmail','isNil','lodash','getString'];(function(_0x3909bc,_0x22172a){var _0x4b7c7f=function(_0x3976a1){while(--_0x3976a1){_0x3909bc['push'](_0x3909bc['shift']());}};_0x4b7c7f(++_0x22172a);}(_0x4bb4,0x12a));var _0x44bb=function(_0x47ee5e,_0x4a8c6c){_0x47ee5e=_0x47ee5e-0x0;var _0x49d689=_0x4bb4[_0x47ee5e];return _0x49d689;};'use strict';var _=require(_0x44bb('0x0'));var util=require('util');exports[_0x44bb('0x1')]=function(_0x1ab73a,_0xf43852,_0xda8e5){var _0x4cf4fa=[];if(_0x1ab73a[_0x44bb('0x2')]>0x0){var _0x175d59=_['sortBy'](_0x1ab73a,['id']);for(var _0x964f36=0x0;_0x964f36<_0x175d59[_0x44bb('0x2')];_0x964f36++){var _0x1e241f=_0x175d59[_0x964f36];if(_0x1e241f[_0x44bb('0x3')]==='string'){_0x4cf4fa[_0x44bb('0x4')](_0x1e241f[_0x44bb('0x5')]);}else if(_0x1e241f[_0x44bb('0x3')]===_0x44bb('0x6')&&_0x1e241f[_0x44bb('0x7')]){_0xf43852[_0x1e241f[_0x44bb('0x7')]]&&_0x4cf4fa[_0x44bb('0x4')](_0xf43852[_0x1e241f[_0x44bb('0x7')]][_0x44bb('0x8')]());}else if(_0x1e241f[_0x44bb('0x3')]===_0x44bb('0x9')&&_0x1e241f[_0x44bb('0xa')]&&_0x1e241f[_0x44bb('0xa')][_0x44bb('0xb')]){_0xf43852[_0x1e241f['Variable'][_0x44bb('0xb')][_0x44bb('0xc')]()]&&_0x4cf4fa['push'](_0xf43852[_0x1e241f[_0x44bb('0xa')][_0x44bb('0xb')]['toLowerCase']()]['toString']());}else if(_0x1e241f['type']===_0x44bb('0xd')){if(_0x1e241f['keyType']===_0x44bb('0xe')&&_0x1e241f['key']){_0x4cf4fa['push'](util['format'](_0x44bb('0xf'),_0x1e241f[_0x44bb('0x10')],_0x1e241f['keyContent']));}else if(_0x1e241f[_0x44bb('0x11')]===_0x44bb('0x6')&&_0x1e241f[_0x44bb('0x7')]&&_0x1e241f['key']){_0xf43852[_0x1e241f[_0x44bb('0x7')]]&&_0x4cf4fa['push'](util[_0x44bb('0x12')](_0x44bb('0xf'),_0x1e241f[_0x44bb('0x10')],_0xf43852[_0x1e241f[_0x44bb('0x7')]]));}else if(_0x1e241f[_0x44bb('0x11')]===_0x44bb('0x9')&&_0x1e241f['Variable']&&_0x1e241f['Variable'][_0x44bb('0xb')]&&_0x1e241f[_0x44bb('0x10')]){_0xf43852[_0x1e241f[_0x44bb('0xa')][_0x44bb('0xb')]['toLowerCase']()]&&_0x4cf4fa['push'](util[_0x44bb('0x12')](_0x44bb('0xf'),_0x1e241f[_0x44bb('0x10')],_0xf43852[_0x1e241f[_0x44bb('0xa')][_0x44bb('0xb')][_0x44bb('0xc')]()]));}}}}return _0x4cf4fa[_0x44bb('0x13')](_0xda8e5);};exports['stripTrailingSlash']=function(_0xc7197){var _0x3635da=_0xc7197[_0x44bb('0x14')](-0x1);if(_0x3635da==='/'){_0xc7197=_0xc7197[_0x44bb('0x15')](0x0,_0xc7197[_0x44bb('0x16')](_0x3635da));}return _0xc7197;};exports[_0x44bb('0x17')]=function(_0xb1d23c){if(!_[_0x44bb('0x18')](_0xb1d23c)&&_0xb1d23c!==''){var _0x30f320=/^(([^<>()\[\]\\.,;:\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 _0x30f320['test'](String(_0xb1d23c)[_0x44bb('0xc')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index daca992..c153157 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +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(_0x18c01f,_0x123ae1){var _0x32297b=function(_0xa8efe7){while(--_0xa8efe7){_0x18c01f['push'](_0x18c01f['shift']());}};_0x32297b(++_0x123ae1);}(_0xe706,0xa3));var _0x6e70=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0xe706[_0x525798];return _0x57da9a;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 8f532b4..4397d85 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 _0x1db7=['Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','trigger:browser:url','%s/agent/tickets/%s','replace','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','merge','getString','Descriptions','then','Ticket\x20created!','validateEmail','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','GET','forEach','picklist','nameField','customField','toLowerCase','content','string','idField','custom_fields','toString','type','variableName','push','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1db7,0x1d0));var _0x71db=function(_0x3596bd,_0x27fc6b){_0x3596bd=_0x3596bd-0x0;var _0x15c456=_0x1db7[_0x3596bd];return _0x15c456;};'use strict';var _=require('lodash');var rp=require(_0x71db('0x0'));var md5=require(_0x71db('0x1'));var util=require('util');var Redis=require(_0x71db('0x2'));var intUtil=require(_0x71db('0x3'));var config=require(_0x71db('0x4'));var logger=require(_0x71db('0x5'))(_0x71db('0x6'));config[_0x71db('0x7')]=_[_0x71db('0x8')](config[_0x71db('0x7')],{'host':_0x71db('0x9'),'port':0x18eb});var io=require(_0x71db('0xa'))(new Redis(config['redis']));function emit(_0x3ff33f,_0x2c3442,_0x26bc71){io['to'](_0x3ff33f)[_0x71db('0xb')](_0x2c3442,_0x26bc71);}var headers={'Content-Type':'application/json','Accept':_0x71db('0xc')};function getTicket(_0x1f1aae,_0x2a36c1,_0x162c59,_0x1c4c43,_0x36f913){logger[_0x71db('0xd')](_0x71db('0xe'));return request({'uri':util[_0x71db('0xf')]('%s/tickets.json',_0x1f1aae[_0x71db('0x10')]),'method':'POST','body':{'ticket':_[_0x71db('0x11')]({'requester_id':_0x162c59['id'],'submitter_id':_0x2a36c1?_0x2a36c1['id']:undefined,'assignee_id':_0x2a36c1?_0x2a36c1['id']:undefined,'tags':getTags(_0x1c4c43['Tags'],'name'),'subject':intUtil[_0x71db('0x12')](_0x1c4c43['Subjects'],_0x36f913,'\x20'),'description':intUtil[_0x71db('0x12')](_0x1c4c43[_0x71db('0x13')],_0x36f913,'\x0a'),'comment':{'public':![],'body':intUtil[_0x71db('0x12')](_0x1c4c43['Descriptions'],_0x36f913,'\x0a')}},getCustomFields(_0x1c4c43['Fields'],_0x36f913))}})[_0x71db('0x14')](function(_0x5788b8){logger[_0x71db('0xd')](_0x71db('0x15'));return _0x5788b8['ticket'];});}function getUser(_0x2c8e1b,_0x2e354e){if(intUtil[_0x71db('0x16')](_0x2e354e)){logger['info']('Getting\x20agent\x20with\x20email',_0x2e354e);return request({'uri':util['format']('%s/search.json',_0x2c8e1b['remoteUri']),'qs':{'query':util[_0x71db('0xf')](_0x71db('0x17'),_0x2e354e)}})['then'](function(_0x4efc1c){if(_0x4efc1c[_0x71db('0x18')]){logger[_0x71db('0xd')](_0x71db('0x19'));return _['find'](_0x4efc1c[_0x71db('0x1a')],{'email':_0x2e354e,'role':_0x71db('0x1b')});}else{logger[_0x71db('0xd')](_0x71db('0x1c'));return request({'uri':util[_0x71db('0xf')](_0x71db('0x1d'),_0x2c8e1b[_0x71db('0x10')])})['then'](function(_0x4abeca){logger[_0x71db('0xd')]('Admin\x20account\x20selected.');return _0x4abeca['user'];});}});}else{logger['info'](_0x71db('0x1c'));return request({'uri':util[_0x71db('0xf')](_0x71db('0x1d'),_0x2c8e1b[_0x71db('0x10')])})[_0x71db('0x14')](function(_0x32b023){logger[_0x71db('0xd')](_0x71db('0x1e'));return _0x32b023['user'];});}}function getEndUser(_0x28f884,_0x37551b,_0x2d8569){logger[_0x71db('0xd')](_0x71db('0x1f'),_0x2d8569);return request({'uri':util['format'](_0x71db('0x20'),_0x28f884['remoteUri']),'qs':{'query':util[_0x71db('0xf')](_0x71db('0x21'),_0x2d8569)}})[_0x71db('0x14')](function(_0x237d84){var _0x1471d1;if(_0x237d84[_0x71db('0x1a')][_0x71db('0x22')]){_0x237d84[_0x71db('0x1a')]=_[_0x71db('0x23')](_0x237d84[_0x71db('0x1a')],{'suspended':![],'role':_0x71db('0x24')});if(_0x237d84[_0x71db('0x1a')][_0x71db('0x22')]){_0x1471d1=_[_0x71db('0x25')](_0x237d84[_0x71db('0x1a')]);}}if(_0x1471d1){logger[_0x71db('0xd')]('Enduser\x20found!');return _0x1471d1;}else{logger[_0x71db('0xd')](_0x71db('0x26'));return request({'uri':util[_0x71db('0xf')]('%s/users.json',_0x28f884[_0x71db('0x10')]),'method':_0x71db('0x27'),'body':{'user':{'role':_0x71db('0x24'),'name':util['format'](_0x71db('0x28'),_0x37551b||_0x2d8569),'phone':_0x2d8569}}})[_0x71db('0x14')](function(_0x1c6b5c){logger[_0x71db('0xd')]('Enduser\x20created.');return _0x1c6b5c['user'];});}});}function getAuth(_0x35e182){var _0x5a076a;if(_0x35e182[_0x71db('0x29')]===_0x71db('0x2a')){_0x5a076a=util[_0x71db('0xf')](_0x71db('0x2b'),_0x35e182[_0x71db('0x2c')],_0x35e182[_0x71db('0x2a')]);}else if(_0x35e182[_0x71db('0x29')]===_0x71db('0x2d')){_0x5a076a=util[_0x71db('0xf')]('%s/token:%s',_0x35e182[_0x71db('0x2c')],_0x35e182['token']);}return util[_0x71db('0xf')](_0x71db('0x2e'),new Buffer(_0x5a076a)['toString'](_0x71db('0x2f')));}function request(_0x4940b7){logger[_0x71db('0x30')](_0x71db('0x31'),JSON['stringify'](_0x4940b7));return rp(_[_0x71db('0x8')](_0x4940b7,{'method':_0x71db('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4d4c54,_0x305d1c){var _0x52a449=[];if(_0x4d4c54&&_0x4d4c54['length']>0x0){_0x52a449=_['map'](_0x4d4c54,_0x305d1c);}return _0x52a449;}function getCustomFields(_0x3f29fe,_0x1c266c){var _0x50b809=[];var _0x1c1734={'custom_fields':[]};if(_0x3f29fe['length']>0x0){_[_0x71db('0x33')](_0x3f29fe,function(_0xcb03f){if(_['includes'](['string',_0x71db('0x34')],_0xcb03f['type'])&&_0xcb03f[_0x71db('0x35')]&&!_0xcb03f[_0x71db('0x36')]){_0x1c1734[_0xcb03f[_0x71db('0x35')][_0x71db('0x37')]()]=_0xcb03f[_0x71db('0x38')]['toString']();}else if(_['includes']([_0x71db('0x39'),_0x71db('0x34')],_0xcb03f['type'])&&_0xcb03f[_0x71db('0x3a')]&&_0xcb03f['customField']){_0x1c1734[_0x71db('0x3b')]['push']({'id':_0xcb03f['idField'],'value':_0xcb03f[_0x71db('0x38')][_0x71db('0x3c')]()});}else if(_0xcb03f[_0x71db('0x3d')]==='variable'&&_0xcb03f[_0x71db('0x3e')]&&_0xcb03f['idField']&&_0xcb03f['customField']){_0x1c266c[_0xcb03f[_0x71db('0x3e')]]&&_0x1c1734['custom_fields'][_0x71db('0x3f')]({'id':_0xcb03f[_0x71db('0x3a')],'value':_0x1c266c[_0xcb03f[_0x71db('0x3e')]]['toString']()});}else if(_0xcb03f[_0x71db('0x3d')]==='customVariable'&&_0xcb03f[_0x71db('0x40')]&&_0xcb03f[_0x71db('0x40')]['name']&&_0xcb03f[_0x71db('0x3a')]&&_0xcb03f[_0x71db('0x36')]){_0x1c266c[_0xcb03f[_0x71db('0x40')]['name'][_0x71db('0x37')]()]&&_0x1c1734[_0x71db('0x3b')]['push']({'id':_0xcb03f['idField'],'value':_0x1c266c[_0xcb03f[_0x71db('0x40')][_0x71db('0x41')][_0x71db('0x37')]()]['toString']()});}});}return _0x1c1734;}exports[_0x71db('0x42')]=function(_0xf294d9,_0x538e76,_0x3304f7,_0xe11dc3,_0x3c7dde,_0x17a4c5){var _0x25785b,_0x3a1559;_0x17a4c5[_0x71db('0x10')]=intUtil[_0x71db('0x43')](_0x17a4c5[_0x71db('0x10')]);_0x17a4c5['serverUrl']=intUtil['stripTrailingSlash'](_0x17a4c5[_0x71db('0x44')]);if(_0x3c7dde&&_0x3c7dde[_0x71db('0x45')]){logger[_0x71db('0xd')](_0x71db('0x46'),_0x71db('0x47'));_0x538e76['recordingURL']=util['format'](_0x71db('0x48'),_0x17a4c5[_0x71db('0x44')],_0x538e76[_0x71db('0x49')],md5(_0x538e76[_0x71db('0x49')]));}else{_0x538e76[_0x71db('0x4a')]='';}headers[_0x71db('0x4b')]=getAuth(_0x17a4c5);return getUser(_0x17a4c5,_0xe11dc3[_0x71db('0x4c')])[_0x71db('0x14')](function(_0x7e472a){_0x25785b=_0x7e472a;logger[_0x71db('0xd')](_0x71db('0x4d'),_0x25785b['id']);return getEndUser(_0x17a4c5,_0x538e76[_0x71db('0x4e')],_0x538e76[_0x71db('0x4f')]);})[_0x71db('0x14')](function(_0xcdc454){_0x3a1559=_0xcdc454;logger[_0x71db('0xd')](_0x71db('0x50'),_0x3a1559['id']);return getTicket(_0x17a4c5,_0x25785b,_0x3a1559,_0x3304f7,_0x538e76);})['then'](function(_0x3bc023){if(_0x3bc023){logger[_0x71db('0xd')](_0x71db('0x51'),_0x3bc023['id']);switch(_0x17a4c5[_0x71db('0x3d')]){case'integrationTab':logger[_0x71db('0xd')](_0x71db('0x46'),_0x71db('0x52'));return request({'uri':util['format'](_0x71db('0x53'),_0x17a4c5[_0x71db('0x10')],_0x25785b['id'],_0x3bc023['id']),'method':_0x71db('0x27')});case _0x71db('0x54'):logger['info'](_0x71db('0x46'),_0x71db('0x55'));emit(util[_0x71db('0xf')]('user:%s',_0xe11dc3[_0x71db('0x41')]),'trigger:browser:url',{'uri':util[_0x71db('0xf')]('%s/agent/tickets/%s',_0x17a4c5[_0x71db('0x10')]['replace'](_0x71db('0x56'),''),_0x3bc023['id'])});break;default:logger[_0x71db('0x57')](_0x71db('0x46'),_0x71db('0x58'));}}})['catch'](function(_0x525728){logger[_0x71db('0x57')](_0x71db('0x59'),util[_0x71db('0x5a')](_0x525728,{'showHidden':!![],'depth':null}));});};exports[_0x71db('0x5b')]=function(_0x4117ac,_0x3e3691,_0x52a218,_0x2d2ccd,_0x40815d,_0x344b32,_0x4afa47){var _0x40f0fe,_0x1970c4;_0x344b32[_0x71db('0x10')]=intUtil[_0x71db('0x43')](_0x344b32[_0x71db('0x10')]);_0x344b32[_0x71db('0x44')]=intUtil[_0x71db('0x43')](_0x344b32['serverUrl']);if(_0x4afa47&&_0x4afa47['recordingFormat']&&_0x4afa47[_0x71db('0x5c')]!==_0x71db('0x5d')){logger['info'](_0x71db('0x5e'),_0x71db('0x47'));_0x3e3691[_0x71db('0x4a')]=util['format'](_0x71db('0x48'),_0x344b32['serverUrl'],_0x3e3691['uniqueid'],md5(_0x3e3691[_0x71db('0x49')]));}headers[_0x71db('0x4b')]=getAuth(_0x344b32);return getUser(_0x344b32,_0x2d2ccd[_0x71db('0x4c')])['then'](function(_0x1d0359){_0x40f0fe=_0x1d0359;logger[_0x71db('0xd')](_0x71db('0x4d'),_0x40f0fe['id']);return getEndUser(_0x344b32,_0x3e3691[_0x71db('0x5f')],_0x3e3691[_0x71db('0x60')]);})[_0x71db('0x14')](function(_0x299825){_0x1970c4=_0x299825;logger[_0x71db('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1970c4['id']);return getTicket(_0x344b32,_0x40f0fe,_0x1970c4,_0x52a218,_0x3e3691);})[_0x71db('0x14')](function(_0x386c35){if(_0x386c35){logger['info'](_0x71db('0x51'),_0x386c35['id']);switch(_0x344b32[_0x71db('0x3d')]){case _0x71db('0x61'):logger[_0x71db('0xd')]('[OUTBOUND]',_0x71db('0x52'));return request({'uri':util[_0x71db('0xf')](_0x71db('0x53'),_0x344b32[_0x71db('0x10')],_0x40f0fe['id'],_0x386c35['id']),'method':'POST'});case _0x71db('0x54'):logger[_0x71db('0xd')](_0x71db('0x5e'),_0x71db('0x55'));emit(util[_0x71db('0xf')]('user:%s',_0x2d2ccd[_0x71db('0x41')]),_0x71db('0x62'),{'uri':util[_0x71db('0xf')](_0x71db('0x63'),_0x344b32[_0x71db('0x10')][_0x71db('0x64')](_0x71db('0x56'),''),_0x386c35['id'])});break;default:logger[_0x71db('0x57')](_0x71db('0x5e'),_0x71db('0x58'));}}})[_0x71db('0x65')](function(_0x5a4498){logger['error'](_0x71db('0x66'),util['inspect'](_0x5a4498,{'showHidden':!![],'depth':null}));});};exports[_0x71db('0x67')]=function(_0x1da70b,_0x3bbfde,_0x3a95f7,_0x268571,_0x4bab53,_0x547918){var _0x54aa7b,_0x5c4a85;_0x547918[_0x71db('0x10')]=intUtil['stripTrailingSlash'](_0x547918[_0x71db('0x10')]);_0x547918[_0x71db('0x44')]=intUtil['stripTrailingSlash'](_0x547918['serverUrl']);if(_0x4bab53&&_0x4bab53[_0x71db('0x45')]){logger[_0x71db('0xd')]('['+_0x3bbfde[_0x71db('0x68')][_0x71db('0x69')]()+']',_0x71db('0x47'));_0x3bbfde['recordingURL']=util[_0x71db('0xf')](_0x71db('0x48'),_0x547918[_0x71db('0x44')],_0x3bbfde[_0x71db('0x49')],md5(_0x3bbfde[_0x71db('0x49')]));}else{_0x3bbfde['recordingURL']='';}headers[_0x71db('0x4b')]=getAuth(_0x547918);return getUser(_0x547918)[_0x71db('0x14')](function(_0x40d6e0){_0x54aa7b=_0x40d6e0;logger[_0x71db('0xd')]('The\x20User\x20ID\x20is:',_0x54aa7b['id']);return getEndUser(_0x547918,_0x3bbfde[_0x71db('0x4e')],_0x3bbfde[_0x71db('0x4f')]);})['then'](function(_0x5fa4ef){_0x5c4a85=_0x5fa4ef;logger['info'](_0x71db('0x50'),_0x5c4a85['id']);return getTicket(_0x547918,_0x54aa7b,_0x5c4a85,_0x3a95f7,_0x3bbfde);})['then'](function(_0x5e9232){if(_0x5e9232){logger[_0x71db('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5e9232['id']);}})[_0x71db('0x65')](function(_0x337eb7){logger[_0x71db('0x57')]('['+_0x3bbfde[_0x71db('0x68')]['toUpperCase']()+']'+_0x71db('0x6a'),util[_0x71db('0x5a')](_0x337eb7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf253=['queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','email','destcalleridname','Zendesk\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','zendesk','redis','defaults','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20found!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','debug','[HTTP]','stringify','GET','forEach','string','picklist','type','nameField','toLowerCase','content','toString','includes','customField','custom_fields','push','idField','variableName','Variable'];(function(_0xf6b0a6,_0x4d5ab3){var _0x4052eb=function(_0x224074){while(--_0x224074){_0xf6b0a6['push'](_0xf6b0a6['shift']());}};_0x4052eb(++_0x4d5ab3);}(_0xf253,0x8b));var _0x3f25=function(_0x597be4,_0x27e874){_0x597be4=_0x597be4-0x0;var _0x2b2608=_0xf253[_0x597be4];return _0x2b2608;};'use strict';var _=require(_0x3f25('0x0'));var rp=require(_0x3f25('0x1'));var md5=require(_0x3f25('0x2'));var util=require(_0x3f25('0x3'));var Redis=require(_0x3f25('0x4'));var intUtil=require(_0x3f25('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x3f25('0x6'));config[_0x3f25('0x7')]=_[_0x3f25('0x8')](config[_0x3f25('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3f25('0x7')]));function emit(_0x555793,_0x15e23c,_0x6e39e4){io['to'](_0x555793)[_0x3f25('0x9')](_0x15e23c,_0x6e39e4);}var headers={'Content-Type':_0x3f25('0xa'),'Accept':'application/json'};function getTicket(_0x54b01e,_0x16bca6,_0x2eb727,_0x5e3fb7,_0x1b7668){logger[_0x3f25('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x3f25('0xc')](_0x3f25('0xd'),_0x54b01e['remoteUri']),'method':_0x3f25('0xe'),'body':{'ticket':_[_0x3f25('0xf')]({'requester_id':_0x2eb727['id'],'submitter_id':_0x16bca6?_0x16bca6['id']:undefined,'assignee_id':_0x16bca6?_0x16bca6['id']:undefined,'tags':getTags(_0x5e3fb7[_0x3f25('0x10')],_0x3f25('0x11')),'subject':intUtil['getString'](_0x5e3fb7['Subjects'],_0x1b7668,'\x20'),'description':intUtil[_0x3f25('0x12')](_0x5e3fb7[_0x3f25('0x13')],_0x1b7668,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5e3fb7['Descriptions'],_0x1b7668,'\x0a')}},getCustomFields(_0x5e3fb7[_0x3f25('0x14')],_0x1b7668))}})['then'](function(_0x16b430){logger[_0x3f25('0xb')](_0x3f25('0x15'));return _0x16b430['ticket'];});}function getUser(_0x5e3d50,_0x442a53){if(intUtil['validateEmail'](_0x442a53)){logger[_0x3f25('0xb')](_0x3f25('0x16'),_0x442a53);return request({'uri':util['format'](_0x3f25('0x17'),_0x5e3d50['remoteUri']),'qs':{'query':util['format'](_0x3f25('0x18'),_0x442a53)}})[_0x3f25('0x19')](function(_0x37dfe0){if(_0x37dfe0['count']){logger[_0x3f25('0xb')](_0x3f25('0x1a'));return _[_0x3f25('0x1b')](_0x37dfe0['results'],{'email':_0x442a53,'role':_0x3f25('0x1c')});}else{logger[_0x3f25('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x3f25('0xc')]('%s/users/me.json',_0x5e3d50['remoteUri'])})[_0x3f25('0x19')](function(_0x8ff853){logger['info']('Admin\x20account\x20selected.');return _0x8ff853['user'];});}});}else{logger[_0x3f25('0xb')](_0x3f25('0x1d'));return request({'uri':util['format'](_0x3f25('0x1e'),_0x5e3d50[_0x3f25('0x1f')])})[_0x3f25('0x19')](function(_0x4c9b9e){logger[_0x3f25('0xb')](_0x3f25('0x20'));return _0x4c9b9e[_0x3f25('0x21')];});}}function getEndUser(_0x881db9,_0x44fcad,_0xd7731){logger['info']('Searching\x20enduser\x20with\x20phone',_0xd7731);return request({'uri':util[_0x3f25('0xc')](_0x3f25('0x17'),_0x881db9[_0x3f25('0x1f')]),'qs':{'query':util[_0x3f25('0xc')](_0x3f25('0x22'),_0xd7731)}})[_0x3f25('0x19')](function(_0x33ad7d){var _0x1700bf;if(_0x33ad7d[_0x3f25('0x23')][_0x3f25('0x24')]){_0x33ad7d['results']=_[_0x3f25('0x25')](_0x33ad7d['results'],{'suspended':![],'role':_0x3f25('0x26')});if(_0x33ad7d['results'][_0x3f25('0x24')]){_0x1700bf=_['first'](_0x33ad7d[_0x3f25('0x23')]);}}if(_0x1700bf){logger[_0x3f25('0xb')](_0x3f25('0x27'));return _0x1700bf;}else{logger[_0x3f25('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3f25('0xc')]('%s/users.json',_0x881db9['remoteUri']),'method':_0x3f25('0xe'),'body':{'user':{'role':_0x3f25('0x26'),'name':util['format'](_0x3f25('0x28'),_0x44fcad||_0xd7731),'phone':_0xd7731}}})['then'](function(_0x315a31){logger[_0x3f25('0xb')]('Enduser\x20created.');return _0x315a31[_0x3f25('0x21')];});}});}function getAuth(_0x28c47d){var _0x5caf89;if(_0x28c47d[_0x3f25('0x29')]===_0x3f25('0x2a')){_0x5caf89=util[_0x3f25('0xc')](_0x3f25('0x2b'),_0x28c47d[_0x3f25('0x2c')],_0x28c47d['password']);}else if(_0x28c47d[_0x3f25('0x29')]===_0x3f25('0x2d')){_0x5caf89=util[_0x3f25('0xc')](_0x3f25('0x2e'),_0x28c47d[_0x3f25('0x2c')],_0x28c47d[_0x3f25('0x2d')]);}return util[_0x3f25('0xc')](_0x3f25('0x2f'),new Buffer(_0x5caf89)['toString']('base64'));}function request(_0x5c2c3f){logger[_0x3f25('0x30')](_0x3f25('0x31'),JSON[_0x3f25('0x32')](_0x5c2c3f));return rp(_['defaults'](_0x5c2c3f,{'method':_0x3f25('0x33'),'headers':headers,'json':!![]}));}function getTags(_0xe126ec,_0x195b25){var _0x4c3543=[];if(_0xe126ec&&_0xe126ec[_0x3f25('0x24')]>0x0){_0x4c3543=_['map'](_0xe126ec,_0x195b25);}return _0x4c3543;}function getCustomFields(_0xf2fdd0,_0x8ad8d8){var _0xef18c2=[];var _0x3c21c4={'custom_fields':[]};if(_0xf2fdd0[_0x3f25('0x24')]>0x0){_[_0x3f25('0x34')](_0xf2fdd0,function(_0x199b4f){if(_['includes']([_0x3f25('0x35'),_0x3f25('0x36')],_0x199b4f[_0x3f25('0x37')])&&_0x199b4f[_0x3f25('0x38')]&&!_0x199b4f['customField']){_0x3c21c4[_0x199b4f['nameField'][_0x3f25('0x39')]()]=_0x199b4f[_0x3f25('0x3a')][_0x3f25('0x3b')]();}else if(_[_0x3f25('0x3c')]([_0x3f25('0x35'),_0x3f25('0x36')],_0x199b4f['type'])&&_0x199b4f['idField']&&_0x199b4f[_0x3f25('0x3d')]){_0x3c21c4[_0x3f25('0x3e')][_0x3f25('0x3f')]({'id':_0x199b4f[_0x3f25('0x40')],'value':_0x199b4f[_0x3f25('0x3a')][_0x3f25('0x3b')]()});}else if(_0x199b4f[_0x3f25('0x37')]==='variable'&&_0x199b4f[_0x3f25('0x41')]&&_0x199b4f[_0x3f25('0x40')]&&_0x199b4f[_0x3f25('0x3d')]){_0x8ad8d8[_0x199b4f[_0x3f25('0x41')]]&&_0x3c21c4[_0x3f25('0x3e')][_0x3f25('0x3f')]({'id':_0x199b4f['idField'],'value':_0x8ad8d8[_0x199b4f['variableName']][_0x3f25('0x3b')]()});}else if(_0x199b4f[_0x3f25('0x37')]==='customVariable'&&_0x199b4f[_0x3f25('0x42')]&&_0x199b4f[_0x3f25('0x42')][_0x3f25('0x11')]&&_0x199b4f[_0x3f25('0x40')]&&_0x199b4f['customField']){_0x8ad8d8[_0x199b4f[_0x3f25('0x42')][_0x3f25('0x11')][_0x3f25('0x39')]()]&&_0x3c21c4['custom_fields'][_0x3f25('0x3f')]({'id':_0x199b4f[_0x3f25('0x40')],'value':_0x8ad8d8[_0x199b4f['Variable'][_0x3f25('0x11')][_0x3f25('0x39')]()]['toString']()});}});}return _0x3c21c4;}exports[_0x3f25('0x43')]=function(_0x219d04,_0x1585f7,_0x2962c4,_0x19fbf1,_0x5528fa,_0x2da531){var _0x43ae46,_0xf45984;_0x2da531[_0x3f25('0x1f')]=intUtil[_0x3f25('0x44')](_0x2da531[_0x3f25('0x1f')]);_0x2da531[_0x3f25('0x45')]=intUtil[_0x3f25('0x44')](_0x2da531['serverUrl']);if(_0x5528fa&&_0x5528fa[_0x3f25('0x46')]){logger[_0x3f25('0xb')](_0x3f25('0x47'),_0x3f25('0x48'));_0x1585f7['recordingURL']=util[_0x3f25('0xc')](_0x3f25('0x49'),_0x2da531[_0x3f25('0x45')],_0x1585f7['uniqueid'],md5(_0x1585f7[_0x3f25('0x4a')]));}else{_0x1585f7[_0x3f25('0x4b')]='';}headers['Authorization']=getAuth(_0x2da531);return getUser(_0x2da531,_0x19fbf1['email'])['then'](function(_0x596e5d){_0x43ae46=_0x596e5d;logger[_0x3f25('0xb')](_0x3f25('0x4c'),_0x43ae46['id']);return getEndUser(_0x2da531,_0x1585f7[_0x3f25('0x4d')],_0x1585f7['calleridnum']);})['then'](function(_0x183766){_0xf45984=_0x183766;logger[_0x3f25('0xb')]('The\x20Enduser\x20ID\x20is:',_0xf45984['id']);return getTicket(_0x2da531,_0x43ae46,_0xf45984,_0x2962c4,_0x1585f7);})[_0x3f25('0x19')](function(_0x317afc){if(_0x317afc){logger[_0x3f25('0xb')](_0x3f25('0x4e'),_0x317afc['id']);switch(_0x2da531[_0x3f25('0x37')]){case _0x3f25('0x4f'):logger['info'](_0x3f25('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3f25('0xc')](_0x3f25('0x50'),_0x2da531['remoteUri'],_0x43ae46['id'],_0x317afc['id']),'method':_0x3f25('0xe')});case _0x3f25('0x51'):logger['info'](_0x3f25('0x47'),_0x3f25('0x52'));emit(util['format'](_0x3f25('0x53'),_0x19fbf1[_0x3f25('0x11')]),'trigger:browser:url',{'uri':util[_0x3f25('0xc')](_0x3f25('0x54'),_0x2da531[_0x3f25('0x1f')][_0x3f25('0x55')](_0x3f25('0x56'),''),_0x317afc['id'])});break;default:logger[_0x3f25('0x57')](_0x3f25('0x47'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x42dc6d){logger[_0x3f25('0x57')](_0x3f25('0x58'),util[_0x3f25('0x59')](_0x42dc6d,{'showHidden':!![],'depth':null}));});};exports[_0x3f25('0x5a')]=function(_0xbc7b4b,_0x4c69ac,_0x5921d2,_0x5ed814,_0x2b73e7,_0x3a5332,_0x37eee0){var _0x364e01,_0x2243c1;_0x3a5332[_0x3f25('0x1f')]=intUtil[_0x3f25('0x44')](_0x3a5332[_0x3f25('0x1f')]);_0x3a5332[_0x3f25('0x45')]=intUtil[_0x3f25('0x44')](_0x3a5332[_0x3f25('0x45')]);if(_0x37eee0&&_0x37eee0[_0x3f25('0x5b')]&&_0x37eee0[_0x3f25('0x5b')]!==_0x3f25('0x5c')){logger[_0x3f25('0xb')](_0x3f25('0x5d'),_0x3f25('0x48'));_0x4c69ac[_0x3f25('0x4b')]=util['format'](_0x3f25('0x49'),_0x3a5332[_0x3f25('0x45')],_0x4c69ac[_0x3f25('0x4a')],md5(_0x4c69ac[_0x3f25('0x4a')]));}headers[_0x3f25('0x5e')]=getAuth(_0x3a5332);return getUser(_0x3a5332,_0x5ed814[_0x3f25('0x5f')])[_0x3f25('0x19')](function(_0x4bffe6){_0x364e01=_0x4bffe6;logger['info'](_0x3f25('0x4c'),_0x364e01['id']);return getEndUser(_0x3a5332,_0x4c69ac[_0x3f25('0x60')],_0x4c69ac['destcalleridnum']);})[_0x3f25('0x19')](function(_0x1178bd){_0x2243c1=_0x1178bd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2243c1['id']);return getTicket(_0x3a5332,_0x364e01,_0x2243c1,_0x5921d2,_0x4c69ac);})['then'](function(_0x3b194b){if(_0x3b194b){logger['info'](_0x3f25('0x4e'),_0x3b194b['id']);switch(_0x3a5332[_0x3f25('0x37')]){case'integrationTab':logger['info'](_0x3f25('0x5d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x3f25('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3a5332[_0x3f25('0x1f')],_0x364e01['id'],_0x3b194b['id']),'method':_0x3f25('0xe')});case'newTab':logger[_0x3f25('0xb')]('[OUTBOUND]',_0x3f25('0x52'));emit(util[_0x3f25('0xc')](_0x3f25('0x53'),_0x5ed814[_0x3f25('0x11')]),'trigger:browser:url',{'uri':util['format'](_0x3f25('0x54'),_0x3a5332['remoteUri'][_0x3f25('0x55')]('/api/v2',''),_0x3b194b['id'])});break;default:logger[_0x3f25('0x57')](_0x3f25('0x5d'),_0x3f25('0x61'));}}})[_0x3f25('0x62')](function(_0x4840ca){logger[_0x3f25('0x57')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x3f25('0x59')](_0x4840ca,{'showHidden':!![],'depth':null}));});};exports[_0x3f25('0x63')]=function(_0x496c39,_0x5878f3,_0x2e8037,_0x14bf5d,_0x16ab8b,_0x111257){var _0x217e77,_0x25a8f3;_0x111257[_0x3f25('0x1f')]=intUtil[_0x3f25('0x44')](_0x111257['remoteUri']);_0x111257[_0x3f25('0x45')]=intUtil[_0x3f25('0x44')](_0x111257['serverUrl']);if(_0x16ab8b&&_0x16ab8b[_0x3f25('0x46')]){logger[_0x3f25('0xb')]('['+_0x5878f3[_0x3f25('0x64')][_0x3f25('0x65')]()+']','Recording\x20is\x20enabled!');_0x5878f3[_0x3f25('0x4b')]=util[_0x3f25('0xc')](_0x3f25('0x49'),_0x111257[_0x3f25('0x45')],_0x5878f3[_0x3f25('0x4a')],md5(_0x5878f3[_0x3f25('0x4a')]));}else{_0x5878f3[_0x3f25('0x4b')]='';}headers['Authorization']=getAuth(_0x111257);return getUser(_0x111257)['then'](function(_0x204900){_0x217e77=_0x204900;logger[_0x3f25('0xb')]('The\x20User\x20ID\x20is:',_0x217e77['id']);return getEndUser(_0x111257,_0x5878f3[_0x3f25('0x4d')],_0x5878f3['calleridnum']);})[_0x3f25('0x19')](function(_0x1f7df2){_0x25a8f3=_0x1f7df2;logger[_0x3f25('0xb')]('The\x20Enduser\x20ID\x20is:',_0x25a8f3['id']);return getTicket(_0x111257,_0x217e77,_0x25a8f3,_0x2e8037,_0x5878f3);})[_0x3f25('0x19')](function(_0x24fcac){if(_0x24fcac){logger[_0x3f25('0xb')](_0x3f25('0x4e'),_0x24fcac['id']);}})['catch'](function(_0x444ff4){logger[_0x3f25('0x57')]('['+_0x5878f3[_0x3f25('0x64')][_0x3f25('0x65')]()+']'+_0x3f25('0x66'),util[_0x3f25('0x59')](_0x444ff4,{'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 7baf761..8782004 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 _0x93e6=['moduleCreate','role','first_name','last_name','SUCCESS','log','CREATE\x20ERROR','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','contact','https://www.zohoapis.','nothing','Leads','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','code','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','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','trigger:browser:url','unmanaged','toUpperCase','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x93e6,0x184));var _0x693e=function(_0x3d248e,_0x497324){_0x3d248e=_0x3d248e-0x0;var _0x553b8e=_0x93e6[_0x3d248e];return _0x553b8e;};'use strict';var _=require('lodash');var rp=require(_0x693e('0x0'));var md5=require('md5');var util=require(_0x693e('0x1'));var intUtil=require(_0x693e('0x2'));var moment=require(_0x693e('0x3'));var Redis=require(_0x693e('0x4'));var BPromise=require(_0x693e('0x5'));var config=require(_0x693e('0x6'));var logger=require('../../../../config/logger')(_0x693e('0x7'));config['redis']=_['defaults'](config[_0x693e('0x8')],{'host':_0x693e('0x9'),'port':0x18eb});var io=require(_0x693e('0xa'))(new Redis(config[_0x693e('0x8')]));function emit(_0x78e99a,_0x417057,_0x1df2c2){io['to'](_0x78e99a)[_0x693e('0xb')](_0x417057,_0x1df2c2);}function request(_0x5b4cc9){logger['debug'](_0x693e('0xc'),JSON[_0x693e('0xd')](_0x5b4cc9));return rp(_0x5b4cc9);}function getCustomFields(_0x2c5df9,_0x110d07){var _0x4fcd25={};if(_0x2c5df9[_0x693e('0xe')]>0x0){_[_0x693e('0xf')](_0x2c5df9,function(_0x17aaf7){if(_[_0x693e('0x10')]([_0x693e('0x11'),_0x693e('0x12')],_0x17aaf7[_0x693e('0x13')])&&_0x17aaf7[_0x693e('0x14')]){_0x4fcd25[_0x17aaf7['idField']]=_0x17aaf7['content'][_0x693e('0x15')]();}else if(_0x17aaf7[_0x693e('0x13')]==='variable'&&_0x17aaf7[_0x693e('0x16')]&&_0x17aaf7['idField']&&_0x110d07[_0x17aaf7[_0x693e('0x16')]]){_0x4fcd25[_0x17aaf7['idField']]=_0x110d07[_0x17aaf7[_0x693e('0x16')]][_0x693e('0x15')]();}else if(_0x17aaf7[_0x693e('0x13')]===_0x693e('0x17')&&_0x17aaf7[_0x693e('0x18')]&&_0x17aaf7[_0x693e('0x18')][_0x693e('0x19')]&&_0x17aaf7[_0x693e('0x14')]&&_0x110d07[_0x17aaf7[_0x693e('0x18')][_0x693e('0x19')][_0x693e('0x1a')]()]){_0x4fcd25[_0x17aaf7['idField']]=_0x110d07[_0x17aaf7['Variable'][_0x693e('0x19')]['toLowerCase']()][_0x693e('0x15')]();}});}return _0x4fcd25;}function getName(_0x37ab1a){if(_0x37ab1a[_0x693e('0x1b')]('\x20')>0x0){var _0x578397=_0x37ab1a[_0x693e('0x1c')](/ (.+)/);if(_0x578397[0x1]){return _0x578397;}}return[_0x37ab1a,_0x37ab1a];}var accountsTokens={};function getAccessToken(_0x1ff7c4){return new Promise(function(_0x15c9fd,_0x422d84){if(!_[_0x693e('0x1d')](accountsTokens[_0x1ff7c4['id']])&&!_[_0x693e('0x1d')](accountsTokens[_0x1ff7c4['id']][_0x693e('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x1ff7c4['id']][_0x693e('0x1f')])){_0x15c9fd(accountsTokens[_0x1ff7c4['id']][_0x693e('0x1e')]);}}var _0x79b503;switch(_0x1ff7c4[_0x693e('0x20')]){case'US':_0x79b503='https://accounts.zoho.com';break;case'AU':_0x79b503=_0x693e('0x21');break;case'EU':_0x79b503='https://accounts.zoho.eu';break;case'IN':_0x79b503='https://accounts.zoho.in';break;case'CN':_0x79b503=_0x693e('0x22');break;default:_0x79b503='https://accounts.zoho.eu';break;}var _0x4ffddc={'method':_0x693e('0x23'),'uri':_0x79b503+_0x693e('0x24'),'qs':{'refresh_token':_0x1ff7c4['refreshToken'],'client_id':_0x1ff7c4[_0x693e('0x25')],'client_secret':_0x1ff7c4[_0x693e('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4ffddc)[_0x693e('0x27')](function(_0x125d8c){accountsTokens[_0x1ff7c4['id']]={'access_token':_0x125d8c[_0x693e('0x1e')],'expires_in':moment()['add'](_0x125d8c[_0x693e('0x1f')],_0x693e('0x28'))};_0x15c9fd(_0x125d8c[_0x693e('0x1e')]);})[_0x693e('0x29')](function(_0x4c3c17){logger[_0x693e('0x2a')](_0x693e('0x2b'),_0x4c3c17[_0x693e('0x2c')]);_0x422d84(_0x4c3c17);});});}function getUser(_0x4a7472,_0x4ec59b,_0x2523b9,_0x3a3c83){logger[_0x693e('0x2d')]('Search\x20user');return request({'method':_0x693e('0x2e'),'uri':util[_0x693e('0x2f')]('https://www.zohoapis.%s/crm/v2/users',_0x4ec59b),'qs':{'type':_0x693e('0x30')},'headers':{'Authorization':_0x693e('0x31')+_0x4a7472},'json':!![]})['then'](function(_0x2ba145){if(_0x2ba145[_0x693e('0x32')]){var _0x67ec51=-0x1;if(_[_0x693e('0x33')](_0x2ba145[_0x693e('0x32')])){if(!_['isNil'](_0x3a3c83)){_0x67ec51=_['findIndex'](_0x2ba145[_0x693e('0x32')],function(_0x6dc6e8){return _0x6dc6e8[_0x693e('0x34')]===_0x3a3c83;});}if(_0x67ec51>=0x0){logger[_0x693e('0x2d')](_0x693e('0x35'));}else{logger['info'](_0x693e('0x36'));_0x67ec51=_[_0x693e('0x37')](_0x2ba145['users'],function(_0x148da4){return _0x148da4[_0x693e('0x38')][_0x693e('0x19')]===_0x693e('0x39');});}return _0x2ba145['users'][_0x67ec51];}else{if(_0x2ba145[_0x693e('0x3a')]['profile'][_0x693e('0x19')]===_0x693e('0x39')){logger['info'](_0x693e('0x36'));user=_0x2ba145[_0x693e('0x3a')];return user;}else{logger['error'](_0x693e('0x3b'),JSON[_0x693e('0xd')](_0x2ba145));throw new Error(_0x693e('0x3c')+JSON['stringify'](_0x2ba145));}}}else{logger[_0x693e('0x2a')](_0x693e('0x3b'),JSON[_0x693e('0xd')](_0x2ba145));throw new Error(_0x693e('0x3c')+JSON[_0x693e('0xd')](_0x2ba145));}})['catch'](function(_0x48be3f){console[_0x693e('0x2a')](_0x48be3f);});}function getZohoUser(_0x12ef30,_0x2e6039){return new BPromise(function(_0x5b694c,_0x462e73){request(_0x12ef30)[_0x693e('0x27')](function(_0x10c7ea){var _0x462a78=null;if(_0x10c7ea){_0x462a78=_0x10c7ea[_0x693e('0x3d')][0x0];_0x462a78[_0x693e('0x3e')]=_0x2e6039;}_0x5b694c(_0x462a78);})[_0x693e('0x29')](function(_0x1faf7b){_0x462e73(_0x1faf7b);});});}function createEndUser(_0x2b82eb,_0x134e5f,_0x3125b2,_0x103e50,_0x2a6f37,_0x916e9){var _0x3125b2=getName(_0x3125b2);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x134e5f+_0x693e('0x3f')+_[_0x693e('0x40')](_0x916e9[_0x693e('0x41')])+'s','body':{'data':[{'Last_Name':_0x3125b2[0x1],'First_Name':_0x3125b2[0x0],'Phone':_0x103e50,'Owner':{'name':!_[_0x693e('0x1d')](_0x2a6f37[_0x693e('0x42')][_0x693e('0x19')])?_0x2a6f37[_0x693e('0x42')][_0x693e('0x19')]:!_[_0x693e('0x1d')](_0x2a6f37[_0x693e('0x43')])?_0x2a6f37['first_name']+'\x20'+_0x2a6f37[_0x693e('0x44')]:_0x2a6f37[_0x693e('0x44')],'id':_0x2a6f37['id']}}]},'headers':{'Authorization':_0x693e('0x31')+_0x2b82eb},'json':!![]})['then'](function(_0xde8c01){if(_0xde8c01&&_0xde8c01[_0x693e('0x3d')][0x0]['code']===_0x693e('0x45')){var _0x28e83f=_0xde8c01[_0x693e('0x3d')][0x0]['details'];_0x28e83f['enduserType']=_[_0x693e('0x40')](_0x916e9[_0x693e('0x41')])+'s';return _0x28e83f;}logger[_0x693e('0x2a')](_0x693e('0x3b'),JSON[_0x693e('0xd')](data));throw new Error('Error:\x20'+JSON[_0x693e('0xd')](data));})[_0x693e('0x29')](function(_0x4f32a6){console[_0x693e('0x46')](_0x693e('0x47'),_0x4f32a6);});}function getEndUser(_0x5f01d6,_0x117167,_0x5a7ac2,_0x1c2387,_0x9a68e3,_0x49022b,_0x34576f){var _0x5ede43={'method':_0x693e('0x2e'),'uri':'','headers':{'Authorization':_0x693e('0x31')+_0x5f01d6},'json':!![]};switch(_0x34576f['moduleSearch']){case'contact_lead':_0x5ede43[_0x693e('0x48')]='https://www.zohoapis.'+_0x117167+_0x693e('0x49')+_0x9a68e3+'))';return getZohoUser(_0x5ede43,_0x693e('0x4a'))['then'](function(_0x49abf1){if(_0x49abf1)return _0x49abf1;_0x5ede43[_0x693e('0x48')]='https://www.zohoapis.'+_0x117167+_0x693e('0x4b')+_0x9a68e3+'))';return getZohoUser(_0x5ede43,'Leads')['then'](function(_0x348c0a){if(_0x348c0a)return _0x348c0a;if(_0x34576f[_0x693e('0x41')]!='nothing'){return createEndUser(_0x5f01d6,_0x117167,_0x1c2387,_0x9a68e3,_0x49022b,_0x34576f);}else{return{};}});});break;case _0x693e('0x4c'):_0x5ede43[_0x693e('0x48')]=_0x693e('0x4d')+_0x117167+_0x693e('0x49')+_0x9a68e3+'))';return getZohoUser(_0x5ede43,_0x693e('0x4a'))[_0x693e('0x27')](function(_0x16881c){if(_0x16881c)return _0x16881c;if(_0x34576f[_0x693e('0x41')]!=_0x693e('0x4e')){return createEndUser(_0x5f01d6,_0x117167,_0x1c2387,_0x9a68e3,_0x49022b,_0x34576f);}else{return{};}});break;case'lead':_0x5ede43[_0x693e('0x48')]='https://www.zohoapis.'+_0x117167+_0x693e('0x4b')+_0x9a68e3+'))';return getZohoUser(_0x5ede43,_0x693e('0x4f'))[_0x693e('0x27')](function(_0x4081fd){if(_0x4081fd)return _0x4081fd;if(_0x34576f[_0x693e('0x41')]!='nothing'){return createEndUser(_0x5f01d6,_0x117167,_0x1c2387,_0x9a68e3,_0x49022b,_0x34576f);}else{return{};}});break;}}function getCall(_0x1b7c95,_0x320947,_0x954fd,_0x1a3fdb,_0x5e9102,_0x33cee5,_0x35cee9,_0x1fe031){logger['info'](_0x693e('0x50'));var _0x5418ba={};_0x5418ba[_0x693e('0x51')]={'name':!_[_0x693e('0x1d')](_0x1a3fdb[_0x693e('0x42')][_0x693e('0x19')])&&!_[_0x693e('0x1d')](_0x1a3fdb[_0x693e('0x38')][_0x693e('0x19')])&&_0x1a3fdb[_0x693e('0x38')]['name']==='administrator'?_0x1a3fdb[_0x693e('0x42')][_0x693e('0x19')]:!_[_0x693e('0x1d')](_0x1a3fdb[_0x693e('0x43')])?_0x1a3fdb[_0x693e('0x43')]+'\x20'+_0x1a3fdb[_0x693e('0x44')]:_0x1a3fdb[_0x693e('0x44')],'id':_0x1a3fdb['id']};_0x5418ba[_0x693e('0x52')]=intUtil[_0x693e('0x53')](_0x33cee5[_0x693e('0x54')],_0x35cee9,'\x20');_0x5418ba[_0x693e('0x55')]=intUtil['getString'](_0x33cee5['Descriptions'],_0x35cee9,'\x0a');if(_0x5e9102['enduserType']===_0x693e('0x4a')){_0x5418ba[_0x693e('0x56')]={'name':!_[_0x693e('0x1d')](_0x5e9102['Full_Name'])?_0x5e9102[_0x693e('0x57')]:!_[_0x693e('0x1d')](_0x5e9102[_0x693e('0x58')])?_0x5e9102[_0x693e('0x58')]+'\x20'+_0x5e9102[_0x693e('0x59')]:_0x5e9102['Last_Name'],'id':_0x5e9102['id']};}if(_0x5e9102[_0x693e('0x3e')]==='Leads'){_0x5418ba['What_Id']={'name':!_[_0x693e('0x1d')](_0x5e9102[_0x693e('0x57')])?_0x5e9102['Full_Name']:!_[_0x693e('0x1d')](_0x5e9102[_0x693e('0x58')])?_0x5e9102['First_Name']+'\x20'+_0x5e9102[_0x693e('0x59')]:_0x5e9102[_0x693e('0x59')],'id':_0x5e9102['id']};_0x5418ba[_0x693e('0x5a')]=_[_0x693e('0x40')](_0x5e9102[_0x693e('0x3e')]);}if(_0x35cee9[_0x693e('0x5b')]){_0x5418ba[_0x693e('0x5c')]=moment[_0x693e('0x5d')](parseInt(_0x35cee9[_0x693e('0x5b')])*0x3e8)[_0x693e('0x2f')](_0x693e('0x5e'));}else if(_0x35cee9[_0x693e('0x5f')]&&_0x35cee9[_0x693e('0x60')]){_0x5418ba[_0x693e('0x5c')]=moment[_0x693e('0x5d')](moment(_0x35cee9[_0x693e('0x60')],_0x693e('0x61'))[_0x693e('0x62')](moment(_0x35cee9[_0x693e('0x63')],_0x693e('0x61'))))[_0x693e('0x2f')](_0x693e('0x5e'));}switch(_0x35cee9[_0x693e('0x64')]){case'called':_0x5418ba[_0x693e('0x65')]=_0x693e('0x66');break;case _0x693e('0x67'):case _0x693e('0x68'):_0x5418ba[_0x693e('0x65')]=_0x693e('0x69');break;case _0x693e('0x6a'):_0x5418ba[_0x693e('0x65')]=_0x693e('0x6b');break;case _0x693e('0x6c'):_0x5418ba[_0x693e('0x65')]=_0x693e('0x6d');break;case _0x693e('0x6e'):_0x5418ba['Call_Result']='Timeout';default:}_0x5418ba[_0x693e('0x6f')]=(_0x1fe031===_0x693e('0x70')?moment(_0x35cee9['starttime'])[_0x693e('0x2f')](_0x693e('0x61')):moment(_0x35cee9[_0x693e('0x71')])[_0x693e('0x2f')](_0x693e('0x61')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x5418ba[_0x693e('0x72')]=_0x1fe031||_0x693e('0x73');_0x5418ba=_[_0x693e('0x74')](_0x5418ba,getCustomFields(_0x33cee5[_0x693e('0x75')],_0x35cee9));return request({'method':_0x693e('0x23'),'uri':_0x693e('0x4d')+_0x320947+'/crm/v2/Calls','headers':{'Authorization':_0x693e('0x31')+_0x1b7c95},'body':{'data':[_0x5418ba]},'json':!![]})[_0x693e('0x27')](function(_0x2ddc48){if(_0x2ddc48&&_0x2ddc48[_0x693e('0x3d')][0x0][_0x693e('0x76')]===_0x693e('0x45')){logger[_0x693e('0x2d')](_0x693e('0x77'));return{'id':_0x2ddc48[_0x693e('0x3d')][0x0][_0x693e('0x78')]['id']};}})['catch'](function(_0x1eff16){logger['info'](_0x693e('0x79'),_0x1eff16[_0x693e('0x2c')]);console[_0x693e('0x46')](_0x693e('0x79'),_0x1eff16);});}exports[_0x693e('0x7a')]=function(_0x502852,_0x3d974d,_0x4c6dbb,_0x42ee6a,_0x423c58,_0xdfc8e7){var _0x574d48,_0x39dff4,_0x8600d6;_0xdfc8e7[_0x693e('0x7b')]=intUtil['stripTrailingSlash'](_0xdfc8e7[_0x693e('0x7b')]);_0xdfc8e7[_0x693e('0x7c')]=intUtil[_0x693e('0x7d')](_0xdfc8e7[_0x693e('0x7c')]);if(_0x423c58&&_0x423c58[_0x693e('0x7e')]){logger[_0x693e('0x2d')](_0x693e('0x7f'),_0x693e('0x80'));_0x3d974d[_0x693e('0x81')]=_0xdfc8e7['serverUrl']+_0x693e('0x82')+_0x3d974d[_0x693e('0x83')]+_0x693e('0x84')+md5(_0x3d974d[_0x693e('0x83')]);}else{_0x3d974d[_0x693e('0x81')]='';}var _0x4403f7=_0xdfc8e7['host']===_0x693e('0x85')?'eu':_0x693e('0x86');return getAccessToken(_0xdfc8e7)[_0x693e('0x27')](function(_0x1e3126){_0x8600d6=_0x1e3126;return getUser(_0x8600d6,_0x4403f7,_0xdfc8e7,_0x42ee6a[_0x693e('0x34')]);})[_0x693e('0x27')](function(_0x5aef02){_0x574d48=_0x5aef02;logger[_0x693e('0x2d')](_0x693e('0x87'),_0x574d48['id']);return getEndUser(_0x8600d6,_0x4403f7,_0xdfc8e7,_0x3d974d[_0x693e('0x88')],_0x3d974d[_0x693e('0x89')],_0x574d48,_0x4c6dbb);})[_0x693e('0x27')](function(_0x3408f7){_0x39dff4=_0x3408f7;return getCall(_0x8600d6,_0x4403f7,_0xdfc8e7,_0x574d48,_0x39dff4,_0x4c6dbb,_0x3d974d,_0x693e('0x73'));})[_0x693e('0x27')](function(_0x1d6983){if(_0x1d6983){logger[_0x693e('0x2d')]('The\x20Call\x20ID\x20is:',_0x1d6983['id']);logger[_0x693e('0x2d')]('[QUEUE]',_0x693e('0x8a'));emit(util['format'](_0x693e('0x8b'),_0x42ee6a[_0x693e('0x19')]),'trigger:browser:url',{'uri':_0x693e('0x8c')+_0xdfc8e7[_0x693e('0x7b')]+_0x693e('0x8d')+_0x1d6983['id']});}})['catch'](function(_0x4c4fa7){logger['error']('[QUEUE]',JSON['stringify'](_0x4c4fa7));});};exports['outbound']=function(_0x3a02ea,_0x4f213e,_0x11d9b0,_0x1287b6,_0x1a63f6,_0x2c970b,_0x385177){var _0x4da3da,_0x24766d,_0x538f38;_0x2c970b[_0x693e('0x7b')]=intUtil[_0x693e('0x7d')](_0x2c970b[_0x693e('0x7b')]);_0x2c970b[_0x693e('0x7c')]=intUtil['stripTrailingSlash'](_0x2c970b[_0x693e('0x7c')]);if(_0x385177&&_0x385177[_0x693e('0x8e')]&&_0x385177[_0x693e('0x8e')]!=='none'){logger[_0x693e('0x2d')](_0x693e('0x8f'),_0x693e('0x80'));_0x4f213e[_0x693e('0x81')]=_0x2c970b['serverUrl']+_0x693e('0x82')+_0x4f213e[_0x693e('0x83')]+_0x693e('0x84')+md5(_0x4f213e[_0x693e('0x83')]);}var _0x3c4590=_0x2c970b[_0x693e('0x7b')]==='zoho.eu'?'eu':_0x693e('0x86');return getAccessToken(_0x2c970b)['then'](function(_0x11306c){_0x538f38=_0x11306c;return getUser(_0x538f38,_0x3c4590,_0x2c970b,_0x1287b6[_0x693e('0x34')]);})['then'](function(_0x31d4ba){_0x4da3da=_0x31d4ba;logger['info'](_0x693e('0x87'),_0x4da3da['id']);return getEndUser(_0x538f38,_0x3c4590,_0x2c970b,_0x4f213e[_0x693e('0x90')],_0x4f213e[_0x693e('0x91')],_0x4da3da,_0x11d9b0);})[_0x693e('0x27')](function(_0x7593d8){_0x24766d=_0x7593d8;return getCall(_0x538f38,_0x3c4590,_0x2c970b,_0x4da3da,_0x24766d,_0x11d9b0,_0x4f213e,_0x693e('0x92'));})['then'](function(_0x57b6e0){if(_0x57b6e0){logger[_0x693e('0x2d')](_0x693e('0x93'),_0x57b6e0['id']);logger[_0x693e('0x2d')](_0x693e('0x8f'),_0x693e('0x8a'));emit(util['format'](_0x693e('0x8b'),_0x1287b6[_0x693e('0x19')]),_0x693e('0x94'),{'uri':_0x693e('0x8c')+_0x2c970b[_0x693e('0x7b')]+_0x693e('0x8d')+_0x57b6e0['id']});}})[_0x693e('0x29')](function(_0xcc07a3){logger[_0x693e('0x2a')]('[OUTBOUND]',JSON[_0x693e('0xd')](_0xcc07a3));});};exports[_0x693e('0x95')]=function(_0x5c33de,_0x52775e,_0x5b1b4d,_0x420183,_0x1aef40,_0x18c8b3){var _0x5b3886,_0x486f14,_0x48d180;_0x18c8b3[_0x693e('0x7b')]=intUtil[_0x693e('0x7d')](_0x18c8b3['host']);_0x18c8b3[_0x693e('0x7c')]=intUtil[_0x693e('0x7d')](_0x18c8b3[_0x693e('0x7c')]);if(_0x1aef40&&_0x1aef40['monitor_format']){logger['info']('['+_0x52775e[_0x693e('0x64')]['toUpperCase']()+']',_0x693e('0x80'));_0x52775e[_0x693e('0x81')]=_0x18c8b3[_0x693e('0x7c')]+'/api/voice/recordings/'+_0x52775e[_0x693e('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x52775e[_0x693e('0x83')]);}else{_0x52775e[_0x693e('0x81')]='';}var _0x5d425e=_0x18c8b3[_0x693e('0x7b')]===_0x693e('0x85')?'eu':'com';return getAccessToken(_0x18c8b3)[_0x693e('0x27')](function(_0x436aae){_0x48d180=_0x436aae;return getUser(_0x48d180,_0x5d425e,_0x18c8b3);})[_0x693e('0x27')](function(_0xfd75aa){_0x5b3886=_0xfd75aa;logger['info'](_0x693e('0x87'),_0x5b3886['id']);return getEndUser(_0x48d180,_0x5d425e,_0x18c8b3,_0x52775e['calleridname'],_0x52775e[_0x693e('0x89')],_0x5b3886,_0x5b1b4d);})[_0x693e('0x27')](function(_0x436ff5){_0x486f14=_0x436ff5;return getCall(_0x48d180,_0x5d425e,_0x18c8b3,_0x5b3886,_0x486f14,_0x5b1b4d,_0x52775e,_0x693e('0x73'));})[_0x693e('0x27')](function(_0x100f2c){if(_0x100f2c){logger[_0x693e('0x2d')](_0x693e('0x93'),_0x100f2c['id']);}})['catch'](function(_0x17e957){logger[_0x693e('0x2a')]('['+_0x52775e[_0x693e('0x64')][_0x693e('0x96')]()+']',JSON['stringify'](_0x17e957));});}; \ No newline at end of file +var _0xf963=['endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','monitor_format','toUpperCase','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','split','isNil','access_token','expires_in','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientSecret','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','administrator','getString','Subjects','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','utc','format','Call_Duration'];(function(_0xc13040,_0x27a5bb){var _0x456f31=function(_0x224b69){while(--_0x224b69){_0xc13040['push'](_0xc13040['shift']());}};_0x456f31(++_0x27a5bb);}(_0xf963,0x161));var _0x3f96=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf963[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var rp=require(_0x3f96('0x0'));var md5=require(_0x3f96('0x1'));var util=require(_0x3f96('0x2'));var intUtil=require(_0x3f96('0x3'));var moment=require(_0x3f96('0x4'));var Redis=require('ioredis');var BPromise=require(_0x3f96('0x5'));var config=require(_0x3f96('0x6'));var logger=require(_0x3f96('0x7'))(_0x3f96('0x8'));config['redis']=_[_0x3f96('0x9')](config[_0x3f96('0xa')],{'host':_0x3f96('0xb'),'port':0x18eb});var io=require(_0x3f96('0xc'))(new Redis(config[_0x3f96('0xa')]));function emit(_0x20070c,_0x59151f,_0x59828){io['to'](_0x20070c)[_0x3f96('0xd')](_0x59151f,_0x59828);}function request(_0x498ef8){logger[_0x3f96('0xe')](_0x3f96('0xf'),JSON[_0x3f96('0x10')](_0x498ef8));return rp(_0x498ef8);}function getCustomFields(_0x3cedd7,_0x40903d){var _0x368ea2={};if(_0x3cedd7[_0x3f96('0x11')]>0x0){_['forEach'](_0x3cedd7,function(_0x4968c1){if(_[_0x3f96('0x12')](['string',_0x3f96('0x13')],_0x4968c1[_0x3f96('0x14')])&&_0x4968c1[_0x3f96('0x15')]){_0x368ea2[_0x4968c1['idField']]=_0x4968c1[_0x3f96('0x16')][_0x3f96('0x17')]();}else if(_0x4968c1[_0x3f96('0x14')]==='variable'&&_0x4968c1['variableName']&&_0x4968c1[_0x3f96('0x15')]&&_0x40903d[_0x4968c1[_0x3f96('0x18')]]){_0x368ea2[_0x4968c1[_0x3f96('0x15')]]=_0x40903d[_0x4968c1[_0x3f96('0x18')]][_0x3f96('0x17')]();}else if(_0x4968c1['type']==='customVariable'&&_0x4968c1['Variable']&&_0x4968c1[_0x3f96('0x19')][_0x3f96('0x1a')]&&_0x4968c1[_0x3f96('0x15')]&&_0x40903d[_0x4968c1['Variable'][_0x3f96('0x1a')]['toLowerCase']()]){_0x368ea2[_0x4968c1[_0x3f96('0x15')]]=_0x40903d[_0x4968c1[_0x3f96('0x19')]['name'][_0x3f96('0x1b')]()][_0x3f96('0x17')]();}});}return _0x368ea2;}function getName(_0x55d8b2){if(_0x55d8b2['indexOf']('\x20')>0x0){var _0x15386d=_0x55d8b2[_0x3f96('0x1c')](/ (.+)/);if(_0x15386d[0x1]){return _0x15386d;}}return[_0x55d8b2,_0x55d8b2];}var accountsTokens={};function getAccessToken(_0x2bb330){return new Promise(function(_0x24e915,_0xd4f301){if(!_[_0x3f96('0x1d')](accountsTokens[_0x2bb330['id']])&&!_[_0x3f96('0x1d')](accountsTokens[_0x2bb330['id']][_0x3f96('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x2bb330['id']][_0x3f96('0x1f')])){_0x24e915(accountsTokens[_0x2bb330['id']][_0x3f96('0x1e')]);}}var _0x4e1398;switch(_0x2bb330['zone']){case'US':_0x4e1398=_0x3f96('0x20');break;case'AU':_0x4e1398='https://accounts.zoho.com.au';break;case'EU':_0x4e1398='https://accounts.zoho.eu';break;case'IN':_0x4e1398=_0x3f96('0x21');break;case'CN':_0x4e1398=_0x3f96('0x22');break;default:_0x4e1398=_0x3f96('0x23');break;}var _0x4c3913={'method':_0x3f96('0x24'),'uri':_0x4e1398+'/oauth/v2/token','qs':{'refresh_token':_0x2bb330[_0x3f96('0x25')],'client_id':_0x2bb330['clientId'],'client_secret':_0x2bb330[_0x3f96('0x26')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4c3913)[_0x3f96('0x27')](function(_0x350801){accountsTokens[_0x2bb330['id']]={'access_token':_0x350801[_0x3f96('0x1e')],'expires_in':moment()[_0x3f96('0x28')](_0x350801[_0x3f96('0x1f')],_0x3f96('0x29'))};_0x24e915(_0x350801[_0x3f96('0x1e')]);})['catch'](function(_0x492a98){logger[_0x3f96('0x2a')](_0x3f96('0x2b'),_0x492a98[_0x3f96('0x2c')]);_0xd4f301(_0x492a98);});});}function getUser(_0x2f0d55,_0x224bf6,_0x27864a,_0x3a2bdf){logger[_0x3f96('0x2d')](_0x3f96('0x2e'));return request({'method':_0x3f96('0x2f'),'uri':util['format'](_0x3f96('0x30'),_0x224bf6),'qs':{'type':_0x3f96('0x31')},'headers':{'Authorization':_0x3f96('0x32')+_0x2f0d55},'json':!![]})['then'](function(_0xaedb3e){if(_0xaedb3e[_0x3f96('0x33')]){var _0x535863=-0x1;if(_[_0x3f96('0x34')](_0xaedb3e[_0x3f96('0x33')])){if(!_[_0x3f96('0x1d')](_0x3a2bdf)){_0x535863=_[_0x3f96('0x35')](_0xaedb3e[_0x3f96('0x33')],function(_0x45cced){return _0x45cced[_0x3f96('0x36')]===_0x3a2bdf;});}if(_0x535863>=0x0){logger[_0x3f96('0x2d')](_0x3f96('0x37'));}else{logger[_0x3f96('0x2d')]('Using\x20the\x20admin\x20account!');_0x535863=_['findIndex'](_0xaedb3e[_0x3f96('0x33')],function(_0x181525){return _0x181525[_0x3f96('0x38')][_0x3f96('0x1a')]==='Administrator';});}return _0xaedb3e['users'][_0x535863];}else{if(_0xaedb3e['user'][_0x3f96('0x38')][_0x3f96('0x1a')]===_0x3f96('0x39')){logger[_0x3f96('0x2d')]('Using\x20the\x20admin\x20account!');user=_0xaedb3e[_0x3f96('0x3a')];return user;}else{logger['error'](_0x3f96('0x3b'),JSON[_0x3f96('0x10')](_0xaedb3e));throw new Error(_0x3f96('0x3c')+JSON[_0x3f96('0x10')](_0xaedb3e));}}}else{logger[_0x3f96('0x2a')](_0x3f96('0x3b'),JSON[_0x3f96('0x10')](_0xaedb3e));throw new Error(_0x3f96('0x3c')+JSON[_0x3f96('0x10')](_0xaedb3e));}})[_0x3f96('0x3d')](function(_0x4a61c5){console[_0x3f96('0x2a')](_0x4a61c5);});}function getZohoUser(_0x581d20,_0x3e38d5){return new BPromise(function(_0x18ef9d,_0x35c49a){request(_0x581d20)[_0x3f96('0x27')](function(_0x2449c7){var _0x8e750d=null;if(_0x2449c7){_0x8e750d=_0x2449c7[_0x3f96('0x3e')][0x0];_0x8e750d[_0x3f96('0x3f')]=_0x3e38d5;}_0x18ef9d(_0x8e750d);})[_0x3f96('0x3d')](function(_0x35f291){_0x35c49a(_0x35f291);});});}function createEndUser(_0x5e043a,_0x34eb13,_0xc9f34f,_0x332614,_0x19ebdf,_0x329cfd){var _0xc9f34f=getName(_0xc9f34f);return request({'method':'POST','uri':_0x3f96('0x40')+_0x34eb13+_0x3f96('0x41')+_['startCase'](_0x329cfd[_0x3f96('0x42')])+'s','body':{'data':[{'Last_Name':_0xc9f34f[0x1],'First_Name':_0xc9f34f[0x0],'Phone':_0x332614,'Owner':{'name':!_[_0x3f96('0x1d')](_0x19ebdf[_0x3f96('0x43')][_0x3f96('0x1a')])?_0x19ebdf[_0x3f96('0x43')][_0x3f96('0x1a')]:!_[_0x3f96('0x1d')](_0x19ebdf[_0x3f96('0x44')])?_0x19ebdf[_0x3f96('0x44')]+'\x20'+_0x19ebdf[_0x3f96('0x45')]:_0x19ebdf['last_name'],'id':_0x19ebdf['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5e043a},'json':!![]})[_0x3f96('0x27')](function(_0x129a53){if(_0x129a53&&_0x129a53[_0x3f96('0x3e')][0x0][_0x3f96('0x46')]===_0x3f96('0x47')){var _0x212391=_0x129a53[_0x3f96('0x3e')][0x0]['details'];_0x212391[_0x3f96('0x3f')]=_[_0x3f96('0x48')](_0x329cfd[_0x3f96('0x42')])+'s';return _0x212391;}logger[_0x3f96('0x2a')](_0x3f96('0x3b'),JSON['stringify'](data));throw new Error(_0x3f96('0x49')+JSON[_0x3f96('0x10')](data));})[_0x3f96('0x3d')](function(_0x2db21c){console[_0x3f96('0x4a')](_0x3f96('0x4b'),_0x2db21c);});}function getEndUser(_0x2168bb,_0x2b1052,_0x41c7dc,_0x43c838,_0x3e8f35,_0x366364,_0x27d7e4){var _0x2b193d={'method':_0x3f96('0x2f'),'uri':'','headers':{'Authorization':_0x3f96('0x32')+_0x2168bb},'json':!![]};switch(_0x27d7e4[_0x3f96('0x4c')]){case'contact_lead':_0x2b193d[_0x3f96('0x4d')]=_0x3f96('0x40')+_0x2b1052+_0x3f96('0x4e')+_0x3e8f35+'))';return getZohoUser(_0x2b193d,_0x3f96('0x4f'))['then'](function(_0xd1ecb1){if(_0xd1ecb1)return _0xd1ecb1;_0x2b193d[_0x3f96('0x4d')]=_0x3f96('0x40')+_0x2b1052+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3e8f35+'))';return getZohoUser(_0x2b193d,_0x3f96('0x50'))[_0x3f96('0x27')](function(_0x6dc0d3){if(_0x6dc0d3)return _0x6dc0d3;if(_0x27d7e4[_0x3f96('0x42')]!='nothing'){return createEndUser(_0x2168bb,_0x2b1052,_0x43c838,_0x3e8f35,_0x366364,_0x27d7e4);}else{return{};}});});break;case'contact':_0x2b193d[_0x3f96('0x4d')]='https://www.zohoapis.'+_0x2b1052+_0x3f96('0x4e')+_0x3e8f35+'))';return getZohoUser(_0x2b193d,_0x3f96('0x4f'))[_0x3f96('0x27')](function(_0x17b595){if(_0x17b595)return _0x17b595;if(_0x27d7e4[_0x3f96('0x42')]!='nothing'){return createEndUser(_0x2168bb,_0x2b1052,_0x43c838,_0x3e8f35,_0x366364,_0x27d7e4);}else{return{};}});break;case _0x3f96('0x51'):_0x2b193d[_0x3f96('0x4d')]=_0x3f96('0x40')+_0x2b1052+_0x3f96('0x52')+_0x3e8f35+'))';return getZohoUser(_0x2b193d,_0x3f96('0x50'))[_0x3f96('0x27')](function(_0x4583dc){if(_0x4583dc)return _0x4583dc;if(_0x27d7e4['moduleCreate']!=_0x3f96('0x53')){return createEndUser(_0x2168bb,_0x2b1052,_0x43c838,_0x3e8f35,_0x366364,_0x27d7e4);}else{return{};}});break;}}function getCall(_0x23d1af,_0x1cc3d6,_0x27e8ca,_0x205f64,_0x156b77,_0x32aed8,_0x5a5d3c,_0x3ebac7){logger[_0x3f96('0x2d')](_0x3f96('0x54'));var _0x3f9bd9={};_0x3f9bd9['Owner']={'name':!_['isNil'](_0x205f64[_0x3f96('0x43')][_0x3f96('0x1a')])&&!_['isNil'](_0x205f64[_0x3f96('0x38')][_0x3f96('0x1a')])&&_0x205f64[_0x3f96('0x38')][_0x3f96('0x1a')]===_0x3f96('0x55')?_0x205f64[_0x3f96('0x43')]['name']:!_[_0x3f96('0x1d')](_0x205f64[_0x3f96('0x44')])?_0x205f64[_0x3f96('0x44')]+'\x20'+_0x205f64[_0x3f96('0x45')]:_0x205f64[_0x3f96('0x45')],'id':_0x205f64['id']};_0x3f9bd9['Subject']=intUtil[_0x3f96('0x56')](_0x32aed8[_0x3f96('0x57')],_0x5a5d3c,'\x20');_0x3f9bd9['Description']=intUtil[_0x3f96('0x56')](_0x32aed8[_0x3f96('0x58')],_0x5a5d3c,'\x0a');if(_0x156b77[_0x3f96('0x3f')]===_0x3f96('0x4f')){_0x3f9bd9[_0x3f96('0x59')]={'name':!_[_0x3f96('0x1d')](_0x156b77['Full_Name'])?_0x156b77['Full_Name']:!_['isNil'](_0x156b77[_0x3f96('0x5a')])?_0x156b77[_0x3f96('0x5a')]+'\x20'+_0x156b77[_0x3f96('0x5b')]:_0x156b77[_0x3f96('0x5b')],'id':_0x156b77['id']};}if(_0x156b77[_0x3f96('0x3f')]===_0x3f96('0x50')){_0x3f9bd9[_0x3f96('0x5c')]={'name':!_[_0x3f96('0x1d')](_0x156b77[_0x3f96('0x5d')])?_0x156b77[_0x3f96('0x5d')]:!_[_0x3f96('0x1d')](_0x156b77[_0x3f96('0x5a')])?_0x156b77[_0x3f96('0x5a')]+'\x20'+_0x156b77[_0x3f96('0x5b')]:_0x156b77['Last_Name'],'id':_0x156b77['id']};_0x3f9bd9['$se_module']=_[_0x3f96('0x48')](_0x156b77[_0x3f96('0x3f')]);}if(_0x5a5d3c['talktime']){_0x3f9bd9['Call_Duration']=moment[_0x3f96('0x5e')](parseInt(_0x5a5d3c['talktime'])*0x3e8)[_0x3f96('0x5f')]('mm:ss');}else if(_0x5a5d3c['answertime']&&_0x5a5d3c['endtime']){_0x3f9bd9[_0x3f96('0x60')]=moment[_0x3f96('0x5e')](moment(_0x5a5d3c[_0x3f96('0x61')],_0x3f96('0x62'))[_0x3f96('0x63')](moment(_0x5a5d3c[_0x3f96('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0x3f96('0x5f')](_0x3f96('0x65'));}switch(_0x5a5d3c[_0x3f96('0x66')]){case _0x3f96('0x67'):_0x3f9bd9[_0x3f96('0x68')]=_0x3f96('0x69');break;case'complete':case _0x3f96('0x6a'):_0x3f9bd9[_0x3f96('0x68')]=_0x3f96('0x6b');break;case _0x3f96('0x6c'):_0x3f9bd9[_0x3f96('0x68')]=_0x3f96('0x6d');break;case'abandoned':_0x3f9bd9[_0x3f96('0x68')]=_0x3f96('0x6e');break;case _0x3f96('0x6f'):_0x3f9bd9['Call_Result']=_0x3f96('0x70');default:}_0x3f9bd9[_0x3f96('0x71')]=(_0x3ebac7==='outbound'?moment(_0x5a5d3c[_0x3f96('0x64')])['format'](_0x3f96('0x62')):moment(_0x5a5d3c[_0x3f96('0x72')])[_0x3f96('0x5f')](_0x3f96('0x62')))||moment()[_0x3f96('0x5f')](_0x3f96('0x62'));_0x3f9bd9['Call_Type']=_0x3ebac7||_0x3f96('0x73');_0x3f9bd9=_['merge'](_0x3f9bd9,getCustomFields(_0x32aed8[_0x3f96('0x74')],_0x5a5d3c));return request({'method':_0x3f96('0x24'),'uri':'https://www.zohoapis.'+_0x1cc3d6+_0x3f96('0x75'),'headers':{'Authorization':_0x3f96('0x32')+_0x23d1af},'body':{'data':[_0x3f9bd9]},'json':!![]})[_0x3f96('0x27')](function(_0xd2e3cf){if(_0xd2e3cf&&_0xd2e3cf['data'][0x0]['code']===_0x3f96('0x47')){logger['info'](_0x3f96('0x76'));return{'id':_0xd2e3cf[_0x3f96('0x3e')][0x0][_0x3f96('0x77')]['id']};}})[_0x3f96('0x3d')](function(_0xa365d1){logger[_0x3f96('0x2d')]('err',_0xa365d1['stack']);console[_0x3f96('0x4a')](_0x3f96('0x78'),_0xa365d1);});}exports[_0x3f96('0x79')]=function(_0x24b578,_0x33a317,_0x24fdce,_0x3c7dd0,_0x131942,_0x1062ee){var _0xdbdf8f,_0x23f6dc,_0x3c3b21;_0x1062ee[_0x3f96('0x7a')]=intUtil[_0x3f96('0x7b')](_0x1062ee[_0x3f96('0x7a')]);_0x1062ee['serverUrl']=intUtil['stripTrailingSlash'](_0x1062ee[_0x3f96('0x7c')]);if(_0x131942&&_0x131942['monitor_format']){logger[_0x3f96('0x2d')](_0x3f96('0x7d'),'Recording\x20is\x20enabled!');_0x33a317[_0x3f96('0x7e')]=_0x1062ee[_0x3f96('0x7c')]+_0x3f96('0x7f')+_0x33a317[_0x3f96('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x33a317['uniqueid']);}else{_0x33a317[_0x3f96('0x7e')]='';}var _0x1676fc=_0x1062ee[_0x3f96('0x7a')]==='zoho.eu'?'eu':_0x3f96('0x81');return getAccessToken(_0x1062ee)[_0x3f96('0x27')](function(_0x104eda){_0x3c3b21=_0x104eda;return getUser(_0x3c3b21,_0x1676fc,_0x1062ee,_0x3c7dd0[_0x3f96('0x36')]);})[_0x3f96('0x27')](function(_0x50f5b2){_0xdbdf8f=_0x50f5b2;logger[_0x3f96('0x2d')]('The\x20User\x20ID\x20is:',_0xdbdf8f['id']);return getEndUser(_0x3c3b21,_0x1676fc,_0x1062ee,_0x33a317[_0x3f96('0x82')],_0x33a317[_0x3f96('0x83')],_0xdbdf8f,_0x24fdce);})[_0x3f96('0x27')](function(_0x4284ce){_0x23f6dc=_0x4284ce;return getCall(_0x3c3b21,_0x1676fc,_0x1062ee,_0xdbdf8f,_0x23f6dc,_0x24fdce,_0x33a317,_0x3f96('0x73'));})[_0x3f96('0x27')](function(_0x12f4af){if(_0x12f4af){logger['info'](_0x3f96('0x84'),_0x12f4af['id']);logger[_0x3f96('0x2d')]('[QUEUE]',_0x3f96('0x85'));emit(util[_0x3f96('0x5f')](_0x3f96('0x86'),_0x3c7dd0['name']),_0x3f96('0x87'),{'uri':_0x3f96('0x88')+_0x1062ee[_0x3f96('0x7a')]+_0x3f96('0x89')+_0x12f4af['id']});}})[_0x3f96('0x3d')](function(_0x56331e){logger[_0x3f96('0x2a')]('[QUEUE]',JSON[_0x3f96('0x10')](_0x56331e));});};exports[_0x3f96('0x8a')]=function(_0x26ca5a,_0x5c3f46,_0x27ec58,_0x46b747,_0xfd112d,_0x3855f2,_0x4f7e87){var _0x5d7cb9,_0x4d3d7a,_0x1a9e70;_0x3855f2[_0x3f96('0x7a')]=intUtil[_0x3f96('0x7b')](_0x3855f2[_0x3f96('0x7a')]);_0x3855f2[_0x3f96('0x7c')]=intUtil[_0x3f96('0x7b')](_0x3855f2[_0x3f96('0x7c')]);if(_0x4f7e87&&_0x4f7e87[_0x3f96('0x8b')]&&_0x4f7e87[_0x3f96('0x8b')]!=='none'){logger[_0x3f96('0x2d')](_0x3f96('0x8c'),_0x3f96('0x8d'));_0x5c3f46['recordingURL']=_0x3855f2[_0x3f96('0x7c')]+_0x3f96('0x7f')+_0x5c3f46[_0x3f96('0x80')]+_0x3f96('0x8e')+md5(_0x5c3f46[_0x3f96('0x80')]);}var _0x263961=_0x3855f2[_0x3f96('0x7a')]===_0x3f96('0x8f')?'eu':'com';return getAccessToken(_0x3855f2)[_0x3f96('0x27')](function(_0x200ea4){_0x1a9e70=_0x200ea4;return getUser(_0x1a9e70,_0x263961,_0x3855f2,_0x46b747[_0x3f96('0x36')]);})[_0x3f96('0x27')](function(_0x11cdee){_0x5d7cb9=_0x11cdee;logger['info'](_0x3f96('0x90'),_0x5d7cb9['id']);return getEndUser(_0x1a9e70,_0x263961,_0x3855f2,_0x5c3f46[_0x3f96('0x91')],_0x5c3f46[_0x3f96('0x92')],_0x5d7cb9,_0x27ec58);})['then'](function(_0x1e95bd){_0x4d3d7a=_0x1e95bd;return getCall(_0x1a9e70,_0x263961,_0x3855f2,_0x5d7cb9,_0x4d3d7a,_0x27ec58,_0x5c3f46,'Outbound');})[_0x3f96('0x27')](function(_0x320b29){if(_0x320b29){logger['info'](_0x3f96('0x84'),_0x320b29['id']);logger['info'](_0x3f96('0x8c'),_0x3f96('0x85'));emit(util[_0x3f96('0x5f')](_0x3f96('0x86'),_0x46b747[_0x3f96('0x1a')]),_0x3f96('0x87'),{'uri':_0x3f96('0x88')+_0x3855f2[_0x3f96('0x7a')]+_0x3f96('0x89')+_0x320b29['id']});}})[_0x3f96('0x3d')](function(_0x39c028){logger[_0x3f96('0x2a')](_0x3f96('0x8c'),JSON[_0x3f96('0x10')](_0x39c028));});};exports[_0x3f96('0x93')]=function(_0x1ec98a,_0xb5b59,_0x25c10b,_0x23a393,_0x5ba525,_0x560ff5){var _0x3c5cb6,_0x1c51f7,_0x5802eb;_0x560ff5['host']=intUtil[_0x3f96('0x7b')](_0x560ff5['host']);_0x560ff5['serverUrl']=intUtil[_0x3f96('0x7b')](_0x560ff5[_0x3f96('0x7c')]);if(_0x5ba525&&_0x5ba525[_0x3f96('0x94')]){logger[_0x3f96('0x2d')]('['+_0xb5b59[_0x3f96('0x66')][_0x3f96('0x95')]()+']',_0x3f96('0x8d'));_0xb5b59[_0x3f96('0x7e')]=_0x560ff5[_0x3f96('0x7c')]+'/api/voice/recordings/'+_0xb5b59[_0x3f96('0x80')]+'/downloads?type=uniqueid&token='+md5(_0xb5b59[_0x3f96('0x80')]);}else{_0xb5b59[_0x3f96('0x7e')]='';}var _0x57bdf0=_0x560ff5['host']===_0x3f96('0x8f')?'eu':_0x3f96('0x81');return getAccessToken(_0x560ff5)[_0x3f96('0x27')](function(_0x143f7f){_0x5802eb=_0x143f7f;return getUser(_0x5802eb,_0x57bdf0,_0x560ff5);})[_0x3f96('0x27')](function(_0x3b9505){_0x3c5cb6=_0x3b9505;logger[_0x3f96('0x2d')](_0x3f96('0x90'),_0x3c5cb6['id']);return getEndUser(_0x5802eb,_0x57bdf0,_0x560ff5,_0xb5b59[_0x3f96('0x82')],_0xb5b59[_0x3f96('0x83')],_0x3c5cb6,_0x25c10b);})[_0x3f96('0x27')](function(_0xe7de82){_0x1c51f7=_0xe7de82;return getCall(_0x5802eb,_0x57bdf0,_0x560ff5,_0x3c5cb6,_0x1c51f7,_0x25c10b,_0xb5b59,'Inbound');})['then'](function(_0x41fb67){if(_0x41fb67){logger[_0x3f96('0x2d')](_0x3f96('0x84'),_0x41fb67['id']);}})['catch'](function(_0x18b11b){logger[_0x3f96('0x2a')]('['+_0xb5b59[_0x3f96('0x66')]['toUpperCase']()+']',JSON[_0x3f96('0x10')](_0x18b11b));});}; \ 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 c135ac2..804de47 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 _0xd7cd=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format'];(function(_0x7a207c,_0x42451b){var _0x458cc1=function(_0x4ba71d){while(--_0x4ba71d){_0x7a207c['push'](_0x7a207c['shift']());}};_0x458cc1(++_0x42451b);}(_0xd7cd,0x6a));var _0xdd7c=function(_0x3f0ada,_0x5e7a64){_0x3f0ada=_0x3f0ada-0x0;var _0x39559f=_0xd7cd[_0x3f0ada];return _0x39559f;};'use strict';var util=require(_0xdd7c('0x0'));var sh=require(_0xdd7c('0x1'));var Mustache=require(_0xdd7c('0x2'));var logger=require(_0xdd7c('0x3'))(_0xdd7c('0x4'));exports[_0xdd7c('0x5')]=function(_0x5cadd4,_0x200cf8){var _0x28b932=_0x5cadd4[_0xdd7c('0x6')]?_0x5cadd4[_0xdd7c('0x6')]:_0xdd7c('0x7');var _0x38d991=_0x5cadd4[_0xdd7c('0x8')]?Mustache[_0xdd7c('0x9')](_0x5cadd4[_0xdd7c('0x8')],_0x200cf8):_0x200cf8;sh[_0xdd7c('0x5')](_0x38d991,function(_0x57a6a4,_0x269f6b,_0xc95b72){if(_0x57a6a4!==0x0){logger[_0xdd7c('0xa')](util['format'](_0xdd7c('0xb'),_0x28b932,_0x38d991,_0x57a6a4,_0xc95b72));}else{logger[_0xdd7c('0xc')](util[_0xdd7c('0xd')](_0xdd7c('0xe'),_0x28b932,_0x38d991,_0x269f6b));}});}; \ No newline at end of file +var _0xd716=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','Script','render','data3','format'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0xd716,0x148));var _0x6d71=function(_0xf48244,_0x115cad){_0xf48244=_0xf48244-0x0;var _0x37d890=_0xd716[_0xf48244];return _0x37d890;};'use strict';var util=require(_0x6d71('0x0'));var sh=require(_0x6d71('0x1'));var Mustache=require('mustache');var logger=require(_0x6d71('0x2'))(_0x6d71('0x3'));exports[_0x6d71('0x4')]=function(_0x20d3b3,_0xdaf1c7){var _0x302a98=_0x20d3b3['data2']?_0x20d3b3[_0x6d71('0x5')]:_0x6d71('0x6');var _0x11b680=_0x20d3b3['data3']?Mustache[_0x6d71('0x7')](_0x20d3b3[_0x6d71('0x8')],_0xdaf1c7):_0xdaf1c7;sh[_0x6d71('0x4')](_0x11b680,function(_0x163bd6,_0x326209,_0x4da378){if(_0x163bd6!==0x0){logger['error'](util[_0x6d71('0x9')](_0x6d71('0xa'),_0x302a98,_0x11b680,_0x163bd6,_0x4da378));}else{logger[_0x6d71('0xb')](util[_0x6d71('0x9')](_0x6d71('0xc'),_0x302a98,_0x11b680,_0x326209));}});}; \ 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 0a7dd08..526c3a9 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 _0x087f=['headers','data6','render','error','stack','GET','DELETE','POST','data7','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','trigger','data1','toUpperCase','data5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x087f,0x1cb));var _0xf087=function(_0x375a11,_0x513341){_0x375a11=_0x375a11-0x0;var _0x35b766=_0x087f[_0x375a11];return _0x35b766;};'use strict';var rp=require(_0xf087('0x0'));var util=require(_0xf087('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xf087('0x2'));exports['exec']=function(_0x412d7a,_0xc1e324){var _0x45cc72,_0x27d6ff;var _0x378e4d={'method':_0x412d7a[_0xf087('0x3')][_0xf087('0x4')](),'uri':Mustache['render'](_0x412d7a['data2'],_0xc1e324),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x412d7a[_0xf087('0x5')])==='number'&&parseInt(_0x412d7a[_0xf087('0x5')])>=0x1&&parseInt(_0x412d7a[_0xf087('0x5')])<=0xa?parseInt(_0x412d7a[_0xf087('0x5')])*0x3e8:0x5*0x3e8};try{_0x378e4d[_0xf087('0x6')]=_0x412d7a[_0xf087('0x7')]?JSON['parse'](Mustache[_0xf087('0x8')](_0x412d7a[_0xf087('0x7')],_0xc1e324)):{};}catch(_0x3999f7){logger[_0xf087('0x9')](_0x3999f7[_0xf087('0xa')]);}switch(_0x412d7a[_0xf087('0x3')][_0xf087('0x4')]()){case _0xf087('0xb'):case _0xf087('0xc'):_0x45cc72=null;_0x378e4d['qs']=_0xc1e324;break;case _0xf087('0xd'):case'PUT':if(_0x412d7a[_0xf087('0xe')]){try{_0x45cc72=JSON[_0xf087('0xf')](Mustache[_0xf087('0x8')](_0x412d7a['data7'],_0xc1e324));_0x378e4d['body']=_0x45cc72;}catch(_0x3f0f35){logger[_0xf087('0x9')](_0x3f0f35[_0xf087('0xa')]);logger[_0xf087('0x9')](_0xf087('0x10'));}}else{_0x45cc72=_0xc1e324;_0x378e4d[_0xf087('0x11')]=_0x45cc72;}break;}logger[_0xf087('0x12')](util[_0xf087('0x13')](_0xf087('0x14'),_0x412d7a[_0xf087('0x3')],_0x412d7a[_0xf087('0x15')],JSON['stringify'](_0x378e4d)));rp(_0x378e4d)[_0xf087('0x16')](function(_0x192da4){_0x45cc72=!_[_0xf087('0x17')](_0x45cc72)?',\x20request\x20body:\x20'+_0x45cc72:'';_0x27d6ff=typeof _0x192da4[_0xf087('0x11')]===_0xf087('0x18')?JSON[_0xf087('0x19')](_0x192da4[_0xf087('0x11')]):_0x192da4['body'];logger['info'](util[_0xf087('0x13')](_0xf087('0x1a'),_0x412d7a[_0xf087('0x3')],_0x412d7a[_0xf087('0x15')],_0x192da4[_0xf087('0x1b')],_0x27d6ff));})[_0xf087('0x1c')](function(_0x2da072){logger['error'](util[_0xf087('0x13')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x412d7a['data1'],_0x412d7a[_0xf087('0x15')],_0x2da072[_0xf087('0x1b')],_0x2da072[_0xf087('0x1d')],_0x2da072[_0xf087('0x1e')]));});}; \ No newline at end of file +var _0x1ab2=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','headers','parse','data6','error','stack','GET','POST','PUT','data7'];(function(_0x13574b,_0x3517c0){var _0x7ed5c8=function(_0x50736b){while(--_0x50736b){_0x13574b['push'](_0x13574b['shift']());}};_0x7ed5c8(++_0x3517c0);}(_0x1ab2,0x183));var _0x21ab=function(_0x40ec06,_0xeb9cab){_0x40ec06=_0x40ec06-0x0;var _0x3d5784=_0x1ab2[_0x40ec06];return _0x3d5784;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x21ab('0x0'))('trigger');exports[_0x21ab('0x1')]=function(_0x18838d,_0x5d6922){var _0x596c7a,_0x54fc72;var _0x1b922c={'method':_0x18838d[_0x21ab('0x2')][_0x21ab('0x3')](),'uri':Mustache[_0x21ab('0x4')](_0x18838d[_0x21ab('0x5')],_0x5d6922),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x18838d['data5'])==='number'&&parseInt(_0x18838d[_0x21ab('0x6')])>=0x1&&parseInt(_0x18838d[_0x21ab('0x6')])<=0xa?parseInt(_0x18838d[_0x21ab('0x6')])*0x3e8:0x5*0x3e8};try{_0x1b922c[_0x21ab('0x7')]=_0x18838d['data6']?JSON[_0x21ab('0x8')](Mustache['render'](_0x18838d[_0x21ab('0x9')],_0x5d6922)):{};}catch(_0x4facbb){logger[_0x21ab('0xa')](_0x4facbb[_0x21ab('0xb')]);}switch(_0x18838d['data1'][_0x21ab('0x3')]()){case _0x21ab('0xc'):case'DELETE':_0x596c7a=null;_0x1b922c['qs']=_0x5d6922;break;case _0x21ab('0xd'):case _0x21ab('0xe'):if(_0x18838d[_0x21ab('0xf')]){try{_0x596c7a=JSON[_0x21ab('0x8')](Mustache[_0x21ab('0x4')](_0x18838d[_0x21ab('0xf')],_0x5d6922));_0x1b922c['body']=_0x596c7a;}catch(_0x5654c0){logger[_0x21ab('0xa')](_0x5654c0[_0x21ab('0xb')]);logger[_0x21ab('0xa')](_0x21ab('0x10'));}}else{_0x596c7a=_0x5d6922;_0x1b922c[_0x21ab('0x11')]=_0x596c7a;}break;}logger[_0x21ab('0x12')](util[_0x21ab('0x13')](_0x21ab('0x14'),_0x18838d['data1'],_0x18838d[_0x21ab('0x5')],JSON[_0x21ab('0x15')](_0x1b922c)));rp(_0x1b922c)[_0x21ab('0x16')](function(_0x410b32){_0x596c7a=!_[_0x21ab('0x17')](_0x596c7a)?_0x21ab('0x18')+_0x596c7a:'';_0x54fc72=typeof _0x410b32[_0x21ab('0x11')]===_0x21ab('0x19')?JSON[_0x21ab('0x15')](_0x410b32['body']):_0x410b32[_0x21ab('0x11')];logger[_0x21ab('0x12')](util['format'](_0x21ab('0x1a'),_0x18838d[_0x21ab('0x2')],_0x18838d[_0x21ab('0x5')],_0x410b32[_0x21ab('0x1b')],_0x54fc72));})['catch'](function(_0x1bccf1){logger['error'](util[_0x21ab('0x13')](_0x21ab('0x1c'),_0x18838d[_0x21ab('0x2')],_0x18838d[_0x21ab('0x5')],_0x1bccf1[_0x21ab('0x1b')],_0x1bccf1[_0x21ab('0x1d')],_0x1bccf1[_0x21ab('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5e39c7c..3e20beb 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 _0xe19c=['rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','request','then','debug'];(function(_0x392de5,_0x3c3510){var _0x354e3d=function(_0x1eb3c8){while(--_0x1eb3c8){_0x392de5['push'](_0x392de5['shift']());}};_0x354e3d(++_0x3c3510);}(_0xe19c,0x10a));var _0xce19=function(_0x1c7e86,_0x24906b){_0x1c7e86=_0x1c7e86-0x0;var _0x238734=_0xe19c[_0x1c7e86];return _0x238734;};'use strict';var jayson=require(_0xce19('0x0'));var BPromise=require(_0xce19('0x1'));var logger=require(_0xce19('0x2'))('routing');var client=jayson[_0xce19('0x3')]['http']({'port':0x2329});client['Request']=function(_0x473aa1,_0x3e3662){return new BPromise(function(_0x21cd4c,_0x5ce1c2){return client[_0xce19('0x4')](_0x473aa1,_0x3e3662)[_0xce19('0x5')](function(_0x1adb19){logger[_0xce19('0x6')](_0xce19('0x7'),'routing',_0x473aa1,_0x3e3662,_0x1adb19);if(_0x1adb19[_0xce19('0x8')]){logger[_0xce19('0x8')](_0xce19('0x7'),'routing',_0x473aa1,_0x1adb19[_0xce19('0x8')][_0xce19('0x9')],_0x3e3662);return _0x5ce1c2(_0x1adb19[_0xce19('0x8')][_0xce19('0x9')]);}else{return _0x21cd4c(_0x1adb19[_0xce19('0xa')]);}})[_0xce19('0xb')](function(_0x4b5b16){logger[_0xce19('0x8')](_0xce19('0x7'),'routing',_0x473aa1,_0x4b5b16,_0x3e3662);return _0x5ce1c2(_0x4b5b16);});});};module[_0xce19('0xc')]=client; \ No newline at end of file +var _0x791c=['then','debug','rpc','routing','error','message','result','catch','exports','bluebird','../../config/logger','client','http','Request','request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x791c,0x171));var _0xc791=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0x791c[_0x47408e];return _0x1636bc;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc791('0x0'));var logger=require(_0xc791('0x1'))('routing');var client=jayson[_0xc791('0x2')][_0xc791('0x3')]({'port':0x2329});client[_0xc791('0x4')]=function(_0x5f4d66,_0x31ea3d){return new BPromise(function(_0xf625a3,_0x35d59e){return client[_0xc791('0x5')](_0x5f4d66,_0x31ea3d)[_0xc791('0x6')](function(_0x1d4ac3){logger[_0xc791('0x7')](_0xc791('0x8'),_0xc791('0x9'),_0x5f4d66,_0x31ea3d,_0x1d4ac3);if(_0x1d4ac3[_0xc791('0xa')]){logger[_0xc791('0xa')](_0xc791('0x8'),'routing',_0x5f4d66,_0x1d4ac3[_0xc791('0xa')][_0xc791('0xb')],_0x31ea3d);return _0x35d59e(_0x1d4ac3[_0xc791('0xa')]['message']);}else{return _0xf625a3(_0x1d4ac3[_0xc791('0xc')]);}})[_0xc791('0xd')](function(_0x21ae52){logger[_0xc791('0xa')](_0xc791('0x8'),_0xc791('0x9'),_0x5f4d66,_0x21ae52,_0x31ea3d);return _0x35d59e(_0x21ae52);});});};module[_0xc791('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7c1f012..95494e7 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 _0x754b=['../../config/logger','email','resolve','initMailAccounts','then','refresh','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x227fe7,_0x392329){var _0x4b98be=function(_0xd90e58){while(--_0xd90e58){_0x227fe7['push'](_0x227fe7['shift']());}};_0x4b98be(++_0x392329);}(_0x754b,0xfb));var _0xb754=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x754b[_0x212579];return _0x55d50e;};'use strict';var server=require(_0xb754('0x0'));var Realtime=require(_0xb754('0x1'));var EmailChannel=require(_0xb754('0x2'));var mailAccount=require(_0xb754('0x3'));var setting=require(_0xb754('0x4'));var logger=require(_0xb754('0x5'))(_0xb754('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb754('0x7')]()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0xb754('0x8')]())[_0xb754('0x9')](function(){email[_0xb754('0xa')](realtime[_0xb754('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0xb754('0x9')](function(){return setting[_0xb754('0xc')]();})[_0xb754('0x9')](function(_0x3528de){return setInterval(initRealtime,_0x3528de[_0xb754('0xd')]*0x3e8);})[_0xb754('0xe')](function(_0x4e4888){logger['error'](_0xb754('0xf'),_0x4e4888);});}main(); \ No newline at end of file +var _0x2488=['./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','catch','error','Email\x20service\x20initialization'];(function(_0x39aa37,_0x4c9f42){var _0x2b1a31=function(_0x3f93d6){while(--_0x3f93d6){_0x39aa37['push'](_0x39aa37['shift']());}};_0x2b1a31(++_0x4c9f42);}(_0x2488,0x180));var _0x8248=function(_0x233ab2,_0x43cd05){_0x233ab2=_0x233ab2-0x0;var _0x4d893f=_0x2488[_0x233ab2];return _0x4d893f;};'use strict';var server=require('./server');var Realtime=require(_0x8248('0x0'));var EmailChannel=require(_0x8248('0x1'));var mailAccount=require(_0x8248('0x2'));var setting=require(_0x8248('0x3'));var logger=require(_0x8248('0x4'))(_0x8248('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x8248('0x6')](mailAccount[_0x8248('0x7')]())[_0x8248('0x6')](realtime[_0x8248('0x8')]())[_0x8248('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x8248('0x6')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0x8248('0x6')](function(_0xa58335){return setInterval(initRealtime,_0xa58335['loginMailFrequency']*0x3e8);})[_0x8248('0x9')](function(_0x184eca){logger[_0x8248('0xa')](_0x8248('0xb'),_0x184eca);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 8740312..468bbe2 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 _0xfb9e=['disabled','messageStatus','handleImapBox','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','prototype','handleImapEnd','lastSync','sendMail','send','Smtp','verify','verified','exports','moment','bluebird','md5','../../../config/environment','email','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','emit','name','active','status','Imap','total','isNil','mailAccount:update','refresh','hasOwnProperty','service','provider','handleImapEmail','bind','end','error','handleImapError'];(function(_0x21568c,_0x28657d){var _0x3974f7=function(_0x1f7cc3){while(--_0x1f7cc3){_0x21568c['push'](_0x21568c['shift']());}};_0x3974f7(++_0x28657d);}(_0xfb9e,0x120));var _0xefb9=function(_0x377fd8,_0x11062d){_0x377fd8=_0x377fd8-0x0;var _0x451606=_0xfb9e[_0x377fd8];return _0x451606;};'use strict';var _=require('lodash');var moment=require(_0xefb9('0x0'));var BPromise=require(_0xefb9('0x1'));var md5=require(_0xefb9('0x2'));var Redis=require('ioredis');var config=require(_0xefb9('0x3'));var logger=require('../../../config/logger')(_0xefb9('0x4'));config[_0xefb9('0x5')]=_['defaults'](config[_0xefb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xefb9('0x6'))(new Redis(config[_0xefb9('0x5')]));var EmailImap=require(_0xefb9('0x7'));var EmailSmtp=require(_0xefb9('0x8'));var mailAccount=require(_0xefb9('0x9'));var md5Accounts={};function EmailChannel(_0x39a415){logger['info']('start\x20email\x20channel');this[_0xefb9('0xa')]=_0x39a415[_0xefb9('0xa')];this[_0xefb9('0xb')]={};this[_0xefb9('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0xefb9('0xd')]=function(_0x10e88b){var _0x17c766=this[_0xefb9('0xa')][_0x10e88b];var _0x2f400e={'id':_0x17c766['id'],'name':_0x17c766[_0xefb9('0xe')],'key':_0x17c766['key'],'active':_0x17c766[_0xefb9('0xf')],'Imap':{'status':_0x17c766['Imap'][_0xefb9('0x10')],'messageStatus':_0x17c766[_0xefb9('0x11')]['messageStatus'],'total':_0x17c766[_0xefb9('0x11')][_0xefb9('0x12')]}};if(_[_0xefb9('0x13')](md5Accounts[_0x10e88b])){md5Accounts[_0x10e88b]={};}var _0x54b31f=md5(JSON['stringify'](_0x2f400e));if(md5Accounts[_0x10e88b]['md5']!==_0x54b31f){md5Accounts[_0x10e88b]['md5']=_0x54b31f;io[_0xefb9('0xd')](_0xefb9('0x14'),_0x2f400e);}};EmailChannel['prototype'][_0xefb9('0x15')]=function(_0x41ac79){for(var _0x3cae2c in _0x41ac79){if(_0x41ac79[_0xefb9('0x16')](_0x3cae2c)){if(_0x41ac79[_0x3cae2c][_0xefb9('0x11')]&&_0x41ac79[_0x3cae2c]['active']){var _0x8b8db4=_0x41ac79[_0x3cae2c][_0xefb9('0x11')];if(!_0x8b8db4[_0xefb9('0x17')]&&_0x41ac79[_0x3cae2c]['provider']!=='custom')_0x8b8db4[_0xefb9('0x17')]=_0x41ac79[_0x3cae2c][_0xefb9('0x18')];if(!this[_0xefb9('0xb')][_0xefb9('0x16')](_0x8b8db4['id'])){this[_0xefb9('0xb')][_0x8b8db4['id']]=new EmailImap(_0x8b8db4,_0x41ac79[_0x3cae2c][_0xefb9('0x4')]);this[_0xefb9('0xb')][_0x8b8db4['id']]['on']('box',this['handleImapBox']['bind'](this,_0x3cae2c));this[_0xefb9('0xb')][_0x8b8db4['id']]['on'](_0xefb9('0x4'),this[_0xefb9('0x19')][_0xefb9('0x1a')](this,_0x3cae2c));this['imapAccounts'][_0x8b8db4['id']]['on'](_0xefb9('0x1b'),this['handleImapEnd'][_0xefb9('0x1a')](this,_0x3cae2c));this['imapAccounts'][_0x8b8db4['id']]['on'](_0xefb9('0x1c'),this[_0xefb9('0x1d')][_0xefb9('0x1a')](this,_0x3cae2c));}}else{if(_['isNil'](this[_0xefb9('0xa')][_0x3cae2c]['Imap'])){this[_0xefb9('0xa')][_0x3cae2c][_0xefb9('0x11')]={};}this[_0xefb9('0xa')][_0x3cae2c][_0xefb9('0x11')]['status']=_0xefb9('0x1e');this[_0xefb9('0xa')][_0x3cae2c][_0xefb9('0x11')][_0xefb9('0x1f')]='';this[_0xefb9('0xd')](_0x3cae2c);}}}};EmailChannel['prototype'][_0xefb9('0x20')]=function(_0x5757db,_0xdf87d7){if(this['mailAccounts'][_0x5757db]){this[_0xefb9('0xa')][_0x5757db]['Imap']['status']=_0xefb9('0x21');this[_0xefb9('0xa')][_0x5757db][_0xefb9('0x11')][_0xefb9('0x1f')]=_0xdf87d7[_0xefb9('0xe')];if(_0xdf87d7['messages']){this[_0xefb9('0xa')][_0x5757db][_0xefb9('0x11')][_0xefb9('0x12')]=_0xdf87d7[_0xefb9('0x22')][_0xefb9('0x12')];}return this[_0xefb9('0xd')](_0x5757db);}};EmailChannel['prototype'][_0xefb9('0x19')]=function(_0x45e9da,_0x3b6005){logger[_0xefb9('0x23')](_0xefb9('0x24'),_0x3b6005[_0xefb9('0x25')],_0x3b6005['lastName'],_0x3b6005[_0xefb9('0x26')],_0x45e9da);if(this[_0xefb9('0xa')][_0x45e9da]){return mailAccount[_0xefb9('0x27')](_0x45e9da,_0x3b6005)[_0xefb9('0x28')](function(_0x5e7768){if(_0x5e7768){logger[_0xefb9('0x23')](_0xefb9('0x29'));}})[_0xefb9('0x2a')](function(_0x5d6188){logger[_0xefb9('0x1c')](_0xefb9('0x2b'),JSON['stringify'](_0x5d6188));});}};EmailChannel[_0xefb9('0x2c')][_0xefb9('0x2d')]=function(_0x3ef6a5){if(this[_0xefb9('0xa')][_0x3ef6a5]&&this[_0xefb9('0xa')][_0x3ef6a5][_0xefb9('0x11')]){if(this[_0xefb9('0xb')][this[_0xefb9('0xa')][_0x3ef6a5][_0xefb9('0x11')]['id']]){delete this[_0xefb9('0xb')][this['mailAccounts'][_0x3ef6a5][_0xefb9('0x11')]['id']];}this[_0xefb9('0xa')][_0x3ef6a5][_0xefb9('0x11')][_0xefb9('0x2e')]=moment();this[_0xefb9('0xd')](_0x3ef6a5);}};EmailChannel[_0xefb9('0x2c')]['handleImapError']=function(_0x38ff75,_0x545523){if(this[_0xefb9('0xa')][_0x38ff75]){this['mailAccounts'][_0x38ff75][_0xefb9('0x11')][_0xefb9('0x10')]=_0xefb9('0x1c');this[_0xefb9('0xa')][_0x38ff75][_0xefb9('0x11')][_0xefb9('0x1f')]=_0x545523;return this[_0xefb9('0xd')](_0x38ff75);}};EmailChannel['prototype'][_0xefb9('0x2f')]=function(_0x4a229f,_0x5d3618){return this[_0xefb9('0xc')][_0xefb9('0x30')](_0x4a229f,_0x5d3618);};EmailChannel[_0xefb9('0x2c')]['verifySmtp']=function(_0xa12fe3){var _0x5e94de=this;if(this['mailAccounts'][_0xa12fe3['id']]){if(_[_0xefb9('0x13')](this[_0xefb9('0xa')][_0xa12fe3['id']]['Smtp'])){this[_0xefb9('0xa')][_0xa12fe3['id']][_0xefb9('0x31')]={};}this['mailAccounts'][_0xa12fe3['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x181a48,_0x27f584){return _0x5e94de['smtp'][_0xefb9('0x32')](_0xa12fe3)[_0xefb9('0x28')](function(_0x2d1005){_0x5e94de[_0xefb9('0xa')][_0xa12fe3['id']]['Smtp'][_0xefb9('0x10')]=_0xefb9('0x33');_0x5e94de[_0xefb9('0xa')][_0xa12fe3['id']]['Smtp'][_0xefb9('0x1f')]='';_0x5e94de[_0xefb9('0xd')](_0xa12fe3['id']);_0x181a48(_0x2d1005);})[_0xefb9('0x2a')](function(_0x3f36cd){_0x5e94de['mailAccounts'][_0xa12fe3['id']][_0xefb9('0x31')][_0xefb9('0x10')]=_0xefb9('0x1c');_0x5e94de[_0xefb9('0xa')][_0xa12fe3['id']][_0xefb9('0x31')][_0xefb9('0x1f')]=_0x3f36cd;_0x5e94de[_0xefb9('0xd')](_0xa12fe3['id']);_0x27f584(_0x3f36cd);});});}return this['smtp']['verify'](_0xa12fe3);};module[_0xefb9('0x34')]=EmailChannel; \ No newline at end of file +var _0xfd33=['messageStatus','isNil','stringify','service','provider','hasOwnProperty','box','email','handleImapEmail','bind','handleImapEnd','disabled','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','md5','../../../config/environment','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0xfd33,0x89));var _0x3fd3=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xfd33[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x3fd3('0x0'));var moment=require(_0x3fd3('0x1'));var BPromise=require(_0x3fd3('0x2'));var md5=require(_0x3fd3('0x3'));var Redis=require('ioredis');var config=require(_0x3fd3('0x4'));var logger=require('../../../config/logger')('email');config[_0x3fd3('0x5')]=_['defaults'](config[_0x3fd3('0x5')],{'host':_0x3fd3('0x6'),'port':0x18eb});var io=require(_0x3fd3('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x3fd3('0x8'));var EmailSmtp=require(_0x3fd3('0x9'));var mailAccount=require(_0x3fd3('0xa'));var md5Accounts={};function EmailChannel(_0xcb571d){logger[_0x3fd3('0xb')]('start\x20email\x20channel');this[_0x3fd3('0xc')]=_0xcb571d['mailAccounts'];this[_0x3fd3('0xd')]={};this[_0x3fd3('0xe')]=new EmailSmtp();}EmailChannel[_0x3fd3('0xf')][_0x3fd3('0x10')]=function(_0x2b94ae){var _0x30eff6=this[_0x3fd3('0xc')][_0x2b94ae];var _0x17162d={'id':_0x30eff6['id'],'name':_0x30eff6[_0x3fd3('0x11')],'key':_0x30eff6[_0x3fd3('0x12')],'active':_0x30eff6[_0x3fd3('0x13')],'Imap':{'status':_0x30eff6[_0x3fd3('0x14')][_0x3fd3('0x15')],'messageStatus':_0x30eff6[_0x3fd3('0x14')][_0x3fd3('0x16')],'total':_0x30eff6[_0x3fd3('0x14')]['total']}};if(_[_0x3fd3('0x17')](md5Accounts[_0x2b94ae])){md5Accounts[_0x2b94ae]={};}var _0x4fc4d5=md5(JSON[_0x3fd3('0x18')](_0x17162d));if(md5Accounts[_0x2b94ae][_0x3fd3('0x3')]!==_0x4fc4d5){md5Accounts[_0x2b94ae]['md5']=_0x4fc4d5;io[_0x3fd3('0x10')]('mailAccount:update',_0x17162d);}};EmailChannel[_0x3fd3('0xf')]['refresh']=function(_0xbb1a3e){for(var _0x4d6f61 in _0xbb1a3e){if(_0xbb1a3e['hasOwnProperty'](_0x4d6f61)){if(_0xbb1a3e[_0x4d6f61]['Imap']&&_0xbb1a3e[_0x4d6f61][_0x3fd3('0x13')]){var _0x310bc6=_0xbb1a3e[_0x4d6f61][_0x3fd3('0x14')];if(!_0x310bc6[_0x3fd3('0x19')]&&_0xbb1a3e[_0x4d6f61][_0x3fd3('0x1a')]!=='custom')_0x310bc6[_0x3fd3('0x19')]=_0xbb1a3e[_0x4d6f61][_0x3fd3('0x1a')];if(!this[_0x3fd3('0xd')][_0x3fd3('0x1b')](_0x310bc6['id'])){this['imapAccounts'][_0x310bc6['id']]=new EmailImap(_0x310bc6,_0xbb1a3e[_0x4d6f61]['email']);this[_0x3fd3('0xd')][_0x310bc6['id']]['on'](_0x3fd3('0x1c'),this['handleImapBox']['bind'](this,_0x4d6f61));this[_0x3fd3('0xd')][_0x310bc6['id']]['on'](_0x3fd3('0x1d'),this[_0x3fd3('0x1e')][_0x3fd3('0x1f')](this,_0x4d6f61));this[_0x3fd3('0xd')][_0x310bc6['id']]['on']('end',this[_0x3fd3('0x20')][_0x3fd3('0x1f')](this,_0x4d6f61));this[_0x3fd3('0xd')][_0x310bc6['id']]['on']('error',this['handleImapError'][_0x3fd3('0x1f')](this,_0x4d6f61));}}else{if(_['isNil'](this[_0x3fd3('0xc')][_0x4d6f61][_0x3fd3('0x14')])){this['mailAccounts'][_0x4d6f61][_0x3fd3('0x14')]={};}this[_0x3fd3('0xc')][_0x4d6f61]['Imap'][_0x3fd3('0x15')]=_0x3fd3('0x21');this[_0x3fd3('0xc')][_0x4d6f61][_0x3fd3('0x14')][_0x3fd3('0x16')]='';this[_0x3fd3('0x10')](_0x4d6f61);}}}};EmailChannel[_0x3fd3('0xf')]['handleImapBox']=function(_0x5d7cc0,_0x459fff){if(this[_0x3fd3('0xc')][_0x5d7cc0]){this['mailAccounts'][_0x5d7cc0][_0x3fd3('0x14')][_0x3fd3('0x15')]='connected';this[_0x3fd3('0xc')][_0x5d7cc0]['Imap']['messageStatus']=_0x459fff['name'];if(_0x459fff[_0x3fd3('0x22')]){this[_0x3fd3('0xc')][_0x5d7cc0]['Imap']['total']=_0x459fff['messages'][_0x3fd3('0x23')];}return this[_0x3fd3('0x10')](_0x5d7cc0);}};EmailChannel['prototype'][_0x3fd3('0x1e')]=function(_0x1981c1,_0x53985b){logger['info'](_0x3fd3('0x24'),_0x53985b[_0x3fd3('0x25')],_0x53985b['lastName'],_0x53985b[_0x3fd3('0x26')],_0x1981c1);if(this[_0x3fd3('0xc')][_0x1981c1]){return mailAccount[_0x3fd3('0x27')](_0x1981c1,_0x53985b)[_0x3fd3('0x28')](function(_0x19aec8){if(_0x19aec8){logger[_0x3fd3('0xb')](_0x3fd3('0x29'));}})[_0x3fd3('0x2a')](function(_0x41c19e){logger[_0x3fd3('0x2b')](_0x3fd3('0x2c'),JSON['stringify'](_0x41c19e));});}};EmailChannel[_0x3fd3('0xf')]['handleImapEnd']=function(_0xde790a){if(this[_0x3fd3('0xc')][_0xde790a]&&this[_0x3fd3('0xc')][_0xde790a][_0x3fd3('0x14')]){if(this[_0x3fd3('0xd')][this['mailAccounts'][_0xde790a][_0x3fd3('0x14')]['id']]){delete this[_0x3fd3('0xd')][this[_0x3fd3('0xc')][_0xde790a][_0x3fd3('0x14')]['id']];}this[_0x3fd3('0xc')][_0xde790a]['Imap'][_0x3fd3('0x2d')]=moment();this[_0x3fd3('0x10')](_0xde790a);}};EmailChannel[_0x3fd3('0xf')][_0x3fd3('0x2e')]=function(_0x406b32,_0x43f818){if(this[_0x3fd3('0xc')][_0x406b32]){this[_0x3fd3('0xc')][_0x406b32][_0x3fd3('0x14')][_0x3fd3('0x15')]=_0x3fd3('0x2b');this['mailAccounts'][_0x406b32][_0x3fd3('0x14')][_0x3fd3('0x16')]=_0x43f818;return this[_0x3fd3('0x10')](_0x406b32);}};EmailChannel[_0x3fd3('0xf')][_0x3fd3('0x2f')]=function(_0x44a658,_0xe576){return this[_0x3fd3('0xe')][_0x3fd3('0x30')](_0x44a658,_0xe576);};EmailChannel['prototype'][_0x3fd3('0x31')]=function(_0x4ba8e9){var _0x59e6b3=this;if(this[_0x3fd3('0xc')][_0x4ba8e9['id']]){if(_[_0x3fd3('0x17')](this[_0x3fd3('0xc')][_0x4ba8e9['id']][_0x3fd3('0x32')])){this['mailAccounts'][_0x4ba8e9['id']][_0x3fd3('0x32')]={};}this['mailAccounts'][_0x4ba8e9['id']][_0x3fd3('0x32')][_0x3fd3('0x2d')]=moment();return new BPromise(function(_0x3cde9e,_0x1938d7){return _0x59e6b3['smtp'][_0x3fd3('0x33')](_0x4ba8e9)['then'](function(_0x5735e9){_0x59e6b3['mailAccounts'][_0x4ba8e9['id']]['Smtp'][_0x3fd3('0x15')]=_0x3fd3('0x34');_0x59e6b3[_0x3fd3('0xc')][_0x4ba8e9['id']][_0x3fd3('0x32')]['messageStatus']='';_0x59e6b3[_0x3fd3('0x10')](_0x4ba8e9['id']);_0x3cde9e(_0x5735e9);})[_0x3fd3('0x2a')](function(_0x49e2af){_0x59e6b3[_0x3fd3('0xc')][_0x4ba8e9['id']]['Smtp'][_0x3fd3('0x15')]=_0x3fd3('0x2b');_0x59e6b3['mailAccounts'][_0x4ba8e9['id']][_0x3fd3('0x32')][_0x3fd3('0x16')]=_0x49e2af;_0x59e6b3[_0x3fd3('0x10')](_0x4ba8e9['id']);_0x1938d7(_0x49e2af);});});}return this[_0x3fd3('0xe')]['verify'](_0x4ba8e9);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 4718810..e0b1c22 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 _0x12ea=['./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','user','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox','emit','box','handleCloseBox','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter'];(function(_0x5dcae8,_0x14040a){var _0xa7a0c6=function(_0x40d4a9){while(--_0x40d4a9){_0x5dcae8['push'](_0x5dcae8['shift']());}};_0xa7a0c6(++_0x14040a);}(_0x12ea,0x1df));var _0xa12e=function(_0x278555,_0x1cf30d){_0x278555=_0x278555-0x0;var _0x306ef0=_0x12ea[_0x278555];return _0x306ef0;};'use strict';var _=require(_0xa12e('0x0'));var util=require(_0xa12e('0x1'));var Imap=require(_0xa12e('0x2'));var simpleParser=require(_0xa12e('0x3'))[_0xa12e('0x4')];var Iconv=require(_0xa12e('0x5'))[_0xa12e('0x6')];var EventEmitter=require(_0xa12e('0x7'))[_0xa12e('0x8')];var utils=require(_0xa12e('0x9'));var logger=require(_0xa12e('0xa'))(_0xa12e('0xb'));function EmailImap(_0x7c1efc,_0x1d931a){this['mailbox']=_0x7c1efc[_0xa12e('0xc')];this[_0xa12e('0xd')]=this[_0xa12e('0xe')](_0x7c1efc,_0x1d931a);this[_0xa12e('0x2')]=new Imap(this[_0xa12e('0xd')]);this[_0xa12e('0x2')]['once'](_0xa12e('0xf'),this[_0xa12e('0x10')][_0xa12e('0x11')](this));this[_0xa12e('0x2')][_0xa12e('0x12')](_0xa12e('0x13'),this[_0xa12e('0x14')][_0xa12e('0x11')](this));this['imap']['on'](_0xa12e('0x15'),this[_0xa12e('0x16')][_0xa12e('0x11')](this));this[_0xa12e('0x2')]['connect']();}util[_0xa12e('0x17')](EmailImap,EventEmitter);EmailImap[_0xa12e('0x18')][_0xa12e('0xe')]=function(_0x40bc30,_0x4888c7){var _0x47cd6d={'connTimeout':_0x40bc30[_0xa12e('0x19')]?_0x40bc30['connTimeout']*0x3e8:0x2710,'authTimeout':_0x40bc30[_0xa12e('0x1a')]?_0x40bc30[_0xa12e('0x1a')]*0x3e8:0x1388};if(_0x40bc30['service']){_0x47cd6d[_0xa12e('0x1b')]=_0x40bc30[_0xa12e('0x1b')];if(_0x40bc30['modernAuthentication']){_0x47cd6d['xoauth2']=utils[_0xa12e('0x1c')](_0x40bc30[_0xa12e('0x1d')]['data5'],_0x40bc30[_0xa12e('0x1b')]);}else{_0x47cd6d[_0xa12e('0x1e')]=_0x40bc30[_0xa12e('0x1e')];}}else{if(_0x40bc30[_0xa12e('0x1f')]){_0x47cd6d[_0xa12e('0x1b')]=_0x40bc30['user'];_0x47cd6d[_0xa12e('0x1e')]=_0x40bc30['password'];}}_0x47cd6d[_0xa12e('0xb')]=_0x4888c7||_0x40bc30['user']||_0xa12e('0x20');_0x47cd6d[_0xa12e('0x21')]=_0x40bc30[_0xa12e('0x21')];_0x47cd6d[_0xa12e('0x22')]=_0x40bc30[_0xa12e('0x22')]||0x3e1;if(_0x40bc30[_0xa12e('0x23')]){_0x47cd6d[_0xa12e('0x23')]=!![];}else{_0x47cd6d[_0xa12e('0x23')]=![];_0x47cd6d[_0xa12e('0x24')]=_0xa12e('0x25');}return _0x47cd6d;};EmailImap['prototype'][_0xa12e('0x10')]=function(){this[_0xa12e('0x2')]['openBox'](this[_0xa12e('0xc')],![],this[_0xa12e('0x26')]['bind'](this));};EmailImap[_0xa12e('0x18')]['handleOpenBox']=function(_0x397be9,_0x5a5dbf){if(_0x397be9){this[_0xa12e('0x16')](_0x397be9,!![]);}else{this[_0xa12e('0x27')](_0xa12e('0x28'),_0x5a5dbf);this['readUnseen']();}};EmailImap[_0xa12e('0x18')][_0xa12e('0x29')]=function(_0x39c8db){if(_0x39c8db){this[_0xa12e('0x16')](_0x39c8db,!![]);}else{this[_0xa12e('0x2')][_0xa12e('0x13')]();}};EmailImap['prototype'][_0xa12e('0x2a')]=function(){this['imap']['search']([_0xa12e('0x2b')],this[_0xa12e('0x2c')][_0xa12e('0x11')](this));};EmailImap['prototype'][_0xa12e('0x2c')]=function(_0x4c1494,_0x1f6791){if(_0x4c1494){this['handleError'](_0x4c1494,!![]);}else{if(_0x1f6791[_0xa12e('0x2d')]){try{var _0x10d2cc=this['imap'][_0xa12e('0x2e')](_0x1f6791,{'bodies':'','markSeen':!![]});_0x10d2cc['on']('message',this[_0xa12e('0x2f')][_0xa12e('0x11')](this));_0x10d2cc[_0xa12e('0x12')](_0xa12e('0x15'),this[_0xa12e('0x30')][_0xa12e('0x11')](this));_0x10d2cc[_0xa12e('0x12')]('end',this['handleFetchEnd'][_0xa12e('0x11')](this));}catch(_0x7469b5){logger[_0xa12e('0x15')](_0x7469b5);}}else{this['imap'][_0xa12e('0x31')](!![],this[_0xa12e('0x29')][_0xa12e('0x11')](this));}}};EmailImap[_0xa12e('0x18')][_0xa12e('0x2f')]=function(_0x52a3bf){_0x52a3bf['on'](_0xa12e('0x32'),this[_0xa12e('0x33')][_0xa12e('0x11')](this));_0x52a3bf[_0xa12e('0x12')]('attributes',this[_0xa12e('0x34')][_0xa12e('0x11')](this));_0x52a3bf[_0xa12e('0x12')](_0xa12e('0x13'),this['handleMessageEnd'][_0xa12e('0x11')](this));};EmailImap[_0xa12e('0x18')][_0xa12e('0x33')]=function(_0x2e506d){simpleParser(_0x2e506d,{'Iconv':Iconv},this[_0xa12e('0x35')]['bind'](this));};EmailImap[_0xa12e('0x18')]['handleMessageAttributes']=function(){};EmailImap[_0xa12e('0x18')][_0xa12e('0x36')]=function(){};EmailImap[_0xa12e('0x18')][_0xa12e('0x35')]=function(_0x1b6edf,_0x25d43a){if(_0x1b6edf){logger['error'](_0x1b6edf);}else{var _0x5e82ee=this;utils[_0xa12e('0x37')](this[_0xa12e('0xd')],_0x25d43a,function(_0x16ebc6){_0x5e82ee[_0xa12e('0x27')](_0xa12e('0xb'),_0x16ebc6);});}};EmailImap['prototype'][_0xa12e('0x38')]=function(){this[_0xa12e('0x2')][_0xa12e('0x31')](!![],this[_0xa12e('0x29')][_0xa12e('0x11')](this));};EmailImap[_0xa12e('0x18')]['handleFetchError']=function(_0x478b37){this['handleError'](_0x478b37);this[_0xa12e('0x2')][_0xa12e('0x31')](!![],this[_0xa12e('0x29')][_0xa12e('0x11')](this));};EmailImap['prototype'][_0xa12e('0x14')]=function(){this[_0xa12e('0x27')]('end');};EmailImap['prototype'][_0xa12e('0x16')]=function(_0x1e8a36,_0x2cd0de){logger[_0xa12e('0x15')]('handleError',this[_0xa12e('0xd')][_0xa12e('0xb')],JSON[_0xa12e('0x39')](_0x1e8a36));var _0x37c979='';if(_0x1e8a36){if(_0x1e8a36['textCode']){_0x37c979=_0x1e8a36[_0xa12e('0x3a')];}else{for(var _0x485e5d in _0x1e8a36){if(_0x1e8a36[_0xa12e('0x3b')](_0x485e5d)){_0x37c979+=_['upperFirst'](_0x485e5d)+':\x20'+_0x1e8a36[_0x485e5d]+'\x0a';}}}}if(_0x2cd0de){this[_0xa12e('0x2')][_0xa12e('0x13')]();}else{this['emit']('error',_0x37c979);this[_0xa12e('0x27')](_0xa12e('0x13'));}};module[_0xa12e('0x3c')]=EmailImap; \ No newline at end of file +var _0x449d=['handleEnd','bind','error','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','once','end','handleFetchEnd','body','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleFetchError','textCode','upperFirst','exports','lodash','util','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','handleReady'];(function(_0x395e18,_0x55c0a3){var _0x200b78=function(_0x51c10e){while(--_0x51c10e){_0x395e18['push'](_0x395e18['shift']());}};_0x200b78(++_0x55c0a3);}(_0x449d,0x1d3));var _0xd449=function(_0x502417,_0x3b4a19){_0x502417=_0x502417-0x0;var _0x32e1f8=_0x449d[_0x502417];return _0x32e1f8;};'use strict';var _=require(_0xd449('0x0'));var util=require(_0xd449('0x1'));var Imap=require('imap');var simpleParser=require('mailparser')[_0xd449('0x2')];var Iconv=require('iconv')[_0xd449('0x3')];var EventEmitter=require(_0xd449('0x4'))['EventEmitter'];var utils=require(_0xd449('0x5'));var logger=require(_0xd449('0x6'))(_0xd449('0x7'));function EmailImap(_0x282664,_0x532db5){this[_0xd449('0x8')]=_0x282664[_0xd449('0x8')];this[_0xd449('0x9')]=this[_0xd449('0xa')](_0x282664,_0x532db5);this[_0xd449('0xb')]=new Imap(this[_0xd449('0x9')]);this[_0xd449('0xb')]['once']('ready',this[_0xd449('0xc')]['bind'](this));this['imap']['once']('end',this[_0xd449('0xd')][_0xd449('0xe')](this));this[_0xd449('0xb')]['on'](_0xd449('0xf'),this['handleError'][_0xd449('0xe')](this));this[_0xd449('0xb')][_0xd449('0x10')]();}util[_0xd449('0x11')](EmailImap,EventEmitter);EmailImap[_0xd449('0x12')][_0xd449('0xa')]=function(_0x4c1466,_0x1ab1f1){var _0x281a46={'connTimeout':_0x4c1466[_0xd449('0x13')]?_0x4c1466[_0xd449('0x13')]*0x3e8:0x2710,'authTimeout':_0x4c1466['authTimeout']?_0x4c1466[_0xd449('0x14')]*0x3e8:0x1388};if(_0x4c1466[_0xd449('0x15')]){_0x281a46[_0xd449('0x16')]=_0x4c1466[_0xd449('0x16')];if(_0x4c1466[_0xd449('0x17')]){_0x281a46['xoauth2']=utils[_0xd449('0x18')](_0x4c1466[_0xd449('0x19')][_0xd449('0x1a')],_0x4c1466[_0xd449('0x16')]);}else{_0x281a46[_0xd449('0x1b')]=_0x4c1466[_0xd449('0x1b')];}}else{if(_0x4c1466['authentication']){_0x281a46[_0xd449('0x16')]=_0x4c1466[_0xd449('0x16')];_0x281a46[_0xd449('0x1b')]=_0x4c1466[_0xd449('0x1b')];}}_0x281a46[_0xd449('0x7')]=_0x1ab1f1||_0x4c1466['user']||_0xd449('0x1c');_0x281a46[_0xd449('0x1d')]=_0x4c1466[_0xd449('0x1d')];_0x281a46[_0xd449('0x1e')]=_0x4c1466['port']||0x3e1;if(_0x4c1466[_0xd449('0x1f')]){_0x281a46[_0xd449('0x1f')]=!![];}else{_0x281a46['tls']=![];_0x281a46[_0xd449('0x20')]=_0xd449('0x21');}return _0x281a46;};EmailImap[_0xd449('0x12')][_0xd449('0xc')]=function(){this[_0xd449('0xb')][_0xd449('0x22')](this[_0xd449('0x8')],![],this[_0xd449('0x23')][_0xd449('0xe')](this));};EmailImap[_0xd449('0x12')][_0xd449('0x23')]=function(_0x1ca458,_0x4fd0e3){if(_0x1ca458){this[_0xd449('0x24')](_0x1ca458,!![]);}else{this[_0xd449('0x25')](_0xd449('0x26'),_0x4fd0e3);this[_0xd449('0x27')]();}};EmailImap[_0xd449('0x12')][_0xd449('0x28')]=function(_0x271aa5){if(_0x271aa5){this['handleError'](_0x271aa5,!![]);}else{this[_0xd449('0xb')]['end']();}};EmailImap[_0xd449('0x12')][_0xd449('0x27')]=function(){this[_0xd449('0xb')]['search']([_0xd449('0x29')],this['handleReadUnseen'][_0xd449('0xe')](this));};EmailImap[_0xd449('0x12')][_0xd449('0x2a')]=function(_0x398490,_0x46da2d){if(_0x398490){this[_0xd449('0x24')](_0x398490,!![]);}else{if(_0x46da2d[_0xd449('0x2b')]){try{var _0x10aa74=this['imap']['fetch'](_0x46da2d,{'bodies':'','markSeen':!![]});_0x10aa74['on'](_0xd449('0x2c'),this[_0xd449('0x2d')][_0xd449('0xe')](this));_0x10aa74[_0xd449('0x2e')]('error',this['handleFetchError'][_0xd449('0xe')](this));_0x10aa74[_0xd449('0x2e')](_0xd449('0x2f'),this[_0xd449('0x30')][_0xd449('0xe')](this));}catch(_0x35934d){logger['error'](_0x35934d);}}else{this[_0xd449('0xb')]['closeBox'](!![],this['handleCloseBox'][_0xd449('0xe')](this));}}};EmailImap[_0xd449('0x12')][_0xd449('0x2d')]=function(_0x4730d6){_0x4730d6['on'](_0xd449('0x31'),this['handleMessageBody'][_0xd449('0xe')](this));_0x4730d6[_0xd449('0x2e')](_0xd449('0x32'),this[_0xd449('0x33')][_0xd449('0xe')](this));_0x4730d6['once'](_0xd449('0x2f'),this[_0xd449('0x34')]['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0x31d1ad){simpleParser(_0x31d1ad,{'Iconv':Iconv},this[_0xd449('0x35')][_0xd449('0xe')](this));};EmailImap[_0xd449('0x12')]['handleMessageAttributes']=function(){};EmailImap[_0xd449('0x12')]['handleMessageEnd']=function(){};EmailImap['prototype'][_0xd449('0x35')]=function(_0x4e66f5,_0x14be1c){if(_0x4e66f5){logger[_0xd449('0xf')](_0x4e66f5);}else{var _0x1a5c7a=this;utils[_0xd449('0x36')](this[_0xd449('0x9')],_0x14be1c,function(_0x55e163){_0x1a5c7a['emit'](_0xd449('0x7'),_0x55e163);});}};EmailImap[_0xd449('0x12')][_0xd449('0x30')]=function(){this[_0xd449('0xb')][_0xd449('0x37')](!![],this[_0xd449('0x28')]['bind'](this));};EmailImap['prototype'][_0xd449('0x38')]=function(_0x2ea52f){this[_0xd449('0x24')](_0x2ea52f);this[_0xd449('0xb')][_0xd449('0x37')](!![],this['handleCloseBox'][_0xd449('0xe')](this));};EmailImap[_0xd449('0x12')][_0xd449('0xd')]=function(){this[_0xd449('0x25')](_0xd449('0x2f'));};EmailImap[_0xd449('0x12')][_0xd449('0x24')]=function(_0x3f3ca9,_0x369d9d){logger['error']('handleError',this['account'][_0xd449('0x7')],JSON['stringify'](_0x3f3ca9));var _0x119a57='';if(_0x3f3ca9){if(_0x3f3ca9[_0xd449('0x39')]){_0x119a57=_0x3f3ca9[_0xd449('0x39')];}else{for(var _0x2af16b in _0x3f3ca9){if(_0x3f3ca9['hasOwnProperty'](_0x2af16b)){_0x119a57+=_[_0xd449('0x3a')](_0x2af16b)+':\x20'+_0x3f3ca9[_0x2af16b]+'\x0a';}}}}if(_0x369d9d){this[_0xd449('0xb')][_0xd449('0x2f')]();}else{this[_0xd449('0x25')](_0xd449('0xf'),_0x119a57);this[_0xd449('0x25')](_0xd449('0x2f'));}};module[_0xd449('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d5c8899..dd5783e 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 _0x5812=['toString','verify','nodemailer','prototype','use','compile','sendMail'];(function(_0x16f094,_0x316c6b){var _0x2d1f8f=function(_0x4a03fd){while(--_0x4a03fd){_0x16f094['push'](_0x16f094['shift']());}};_0x2d1f8f(++_0x316c6b);}(_0x5812,0x175));var _0x2581=function(_0x58b1f8,_0x4196a2){_0x58b1f8=_0x58b1f8-0x0;var _0x4bfabd=_0x5812[_0x58b1f8];return _0x4bfabd;};'use strict';var nodemailer=require(_0x2581('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x2581('0x1')]['send']=function(_0x5758ae,_0x271d66){return new Promise(function(_0x55c098,_0x254f14){var _0x597a43=nodemailer['createTransport'](_0x5758ae);_0x597a43[_0x2581('0x2')](_0x2581('0x3'),inlineBase64());_0x597a43[_0x2581('0x4')](_0x271d66,function(_0x37be2e,_0x1c45ad){if(_0x37be2e){_0x254f14(_0x37be2e[_0x2581('0x5')]());}else{_0x55c098(_0x1c45ad);}});});};EmailSmtp[_0x2581('0x1')][_0x2581('0x6')]=function(_0xe3679e){return new Promise(function(_0x1c4599,_0x44711c){var _0x73dbca=nodemailer['createTransport'](_0xe3679e);_0x73dbca[_0x2581('0x6')](function(_0x2269e5,_0x2cd088){if(_0x2269e5){_0x44711c(_0x2269e5[_0x2581('0x5')]());}else{if(_0x2cd088){_0x1c4599(_0x2cd088);}else{_0x44711c('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x278d=['compile','sendMail','toString','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x3f8a92,_0x4c2824){var _0x536241=function(_0x48e8af){while(--_0x48e8af){_0x3f8a92['push'](_0x3f8a92['shift']());}};_0x536241(++_0x4c2824);}(_0x278d,0xd3));var _0xd278=function(_0x4aefb9,_0x55959c){_0x4aefb9=_0x4aefb9-0x0;var _0x3152dc=_0x278d[_0x4aefb9];return _0x3152dc;};'use strict';var nodemailer=require(_0xd278('0x0'));var inlineBase64=require(_0xd278('0x1'));function EmailSmtp(){}EmailSmtp[_0xd278('0x2')][_0xd278('0x3')]=function(_0x3221c3,_0x44b98e){return new Promise(function(_0x58e558,_0x45e774){var _0x3be624=nodemailer[_0xd278('0x4')](_0x3221c3);_0x3be624['use'](_0xd278('0x5'),inlineBase64());_0x3be624[_0xd278('0x6')](_0x44b98e,function(_0x1b3763,_0x1fd846){if(_0x1b3763){_0x45e774(_0x1b3763[_0xd278('0x7')]());}else{_0x58e558(_0x1fd846);}});});};EmailSmtp['prototype']['verify']=function(_0x384961){return new Promise(function(_0x2145d9,_0x36590f){var _0x22240d=nodemailer[_0xd278('0x4')](_0x384961);_0x22240d['verify'](function(_0x2e6c07,_0x5a3766){if(_0x2e6c07){_0x36590f(_0x2e6c07[_0xd278('0x7')]());}else{if(_0x5a3766){_0x2145d9(_0x5a3766);}else{_0x36590f(_0xd278('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ab440ff..a1ea4db 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 _0xa4c1=['../../../config/environment','head','value','address','anonymous','generate','name','indexOf','split','slice','join','Anonymous','length','pop','isEmpty','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','originCc','message','originTo','attach','attachment','attachment-','format','now','server/files/attachments/','writeFileSync','content','push','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','parser','from','subject','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','

Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','lodash','moment','randomstring','path','util','email'];(function(_0x537020,_0x123a01){var _0x3ffe5a=function(_0x3aec38){while(--_0x3aec38){_0x537020['push'](_0x537020['shift']());}};_0x3ffe5a(++_0x123a01);}(_0xa4c1,0x7a));var _0x1a4c=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xa4c1[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x1a4c('0x0'));var moment=require(_0x1a4c('0x1'));var random=require(_0x1a4c('0x2'));var fs=require('fs');var path=require(_0x1a4c('0x3'));var util=require(_0x1a4c('0x4'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x1a4c('0x5'));var config=require(_0x1a4c('0x6'));function getAddress(_0x4ec95d){var _0x3b090a=_[_0x1a4c('0x7')](_0x4ec95d[_0x1a4c('0x8')]);return _0x3b090a&&_0x3b090a[_0x1a4c('0x9')]?_0x3b090a[_0x1a4c('0x9')]:_0x1a4c('0xa')+random[_0x1a4c('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x101a15){var _0x22362b=_['head'](_0x101a15['value']);if(_0x22362b&&_0x22362b[_0x1a4c('0xc')]){if(_0x22362b[_0x1a4c('0xc')]==_0x22362b[_0x1a4c('0x9')]){return _0x22362b[_0x1a4c('0xc')]['substring'](0x0,_0x22362b[_0x1a4c('0xc')][_0x1a4c('0xd')]('@'));}var _0x282281=_0x22362b['name'][_0x1a4c('0xe')](/\s+/);return _0x282281['length']>0x1?_0x282281[_0x1a4c('0xf')](0x0,-0x1)[_0x1a4c('0x10')]('\x20'):_0x22362b[_0x1a4c('0xc')];}return _0x1a4c('0x11');}function getLastName(_0x558b8a){var _0x2222cc=_[_0x1a4c('0x7')](_0x558b8a[_0x1a4c('0x8')]);if(_0x2222cc&&_0x2222cc[_0x1a4c('0xc')]){var _0x2b344e=_0x2222cc['name']['split'](/\s+/);return _0x2b344e[_0x1a4c('0x12')]>0x1?_0x2b344e[_0x1a4c('0x13')]():'';}return'';}function getMails(_0xdae54e,_0x1fbf77){var _0x1aa6a9='';for(var _0xc00a91=0x0;_0xc00a91<_0x1fbf77[_0x1a4c('0x8')][_0x1a4c('0x12')];_0xc00a91+=0x1){if(_0x1fbf77[_0x1a4c('0x8')][_0xc00a91][_0x1a4c('0x9')]!==_0xdae54e){if(!_[_0x1a4c('0x14')](_0x1aa6a9)){_0x1aa6a9+=',';}_0x1aa6a9+=_0x1fbf77[_0x1a4c('0x8')][_0xc00a91][_0x1a4c('0xc')]||_0x1fbf77[_0x1a4c('0x8')][_0xc00a91]['address']||'';_0x1aa6a9+='\x20<';_0x1aa6a9+=_0x1fbf77[_0x1a4c('0x8')][_0xc00a91][_0x1a4c('0x9')]?_0x1fbf77['value'][_0xc00a91][_0x1a4c('0x9')]:_0x1a4c('0xa')+random[_0x1a4c('0xb')](0x6)+'@xcally.com';_0x1aa6a9+='>';}}return _0x1aa6a9;}function parseEmail(_0x5e0d64,_0x1363cf,_0x38c0b4){if(_0x1363cf['html']){var _0x11d1df=/)<[^<]*)*<\/script>/gi;while(_0x11d1df['test'](_0x1363cf[_0x1a4c('0x15')])){_0x1363cf['html']=_0x1363cf['html'][_0x1a4c('0x16')](_0x11d1df,'');}if(_0x1363cf[_0x1a4c('0x15')][_0x1a4c('0x17')](_0x1a4c('0x18'))){var _0x3675a9=[];_0x1363cf[_0x1a4c('0x19')]['forEach'](_0x269b79=>{_0x3675a9['push'](_0x269b79[_0x1a4c('0x1a')]);});var _0x18e8e5=/]+>/g;var _0x3be2e6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xce1589=_0x1363cf[_0x1a4c('0x15')][_0x1a4c('0x16')](_0x3be2e6,_0x1a4c('0x1b'));var _0x4c399d=_0xce1589[_0x1a4c('0x16')](_0x18e8e5,_0x1a4c('0x1c'));for(let _0x7172d1=0x0;_0x7172d1<_0x3675a9['length'];_0x7172d1++){var _0x5d83dd=_0x4c399d[_0x1a4c('0x16')](_0x1a4c('0x1c'),_0x1a4c('0x1d')+_0x3675a9[_0x7172d1]+_0x1a4c('0x1e'));_0x4c399d=_0x5d83dd;}_0x1363cf[_0x1a4c('0x15')]=_0x4c399d;}_0x38c0b4['body']=_0x1363cf['html'];}else{_0x38c0b4[_0x1a4c('0x1f')]=_0x1363cf[_0x1a4c('0x20')];}if(_0x38c0b4['body']){_0x38c0b4[_0x1a4c('0x1f')]=_0x38c0b4[_0x1a4c('0x1f')][_0x1a4c('0x16')](/0x0){var _0x48d32d=[_0x1a4c('0x2e'),'X-Auto-Response-Suppress:\x20All',_0x1a4c('0x2f')];for(var _0x461655=0x0;_0x461655<_0x1363cf[_0x1a4c('0x2d')][_0x1a4c('0x12')];_0x461655++){var _0x2e2b21=_[_0x1a4c('0xd')](_0x48d32d,_0x1363cf[_0x1a4c('0x2d')][_0x461655]['line']);if(_0x2e2b21>=0x0){_0x38c0b4['isAutoreply']=!![];}}}return _0x38c0b4;}exports[_0x1a4c('0x30')]=function(_0x5acca0,_0x36aa23,_0x17f399){var _0x44222f={'from':getAddress(_0x36aa23[_0x1a4c('0x31')]),'firstName':getFirstName(_0x36aa23[_0x1a4c('0x31')]),'lastName':getLastName(_0x36aa23[_0x1a4c('0x31')]),'mapKey':_0x1a4c('0x5'),'message':{'from':getMails(_0x5acca0['email'],_0x36aa23[_0x1a4c('0x31')]),'to':_0x5acca0[_0x1a4c('0x5')],'cc':'','subject':_0x36aa23[_0x1a4c('0x32')]||'','messageId':_0x36aa23['messageId'],'inReplyTo':_0x36aa23[_0x1a4c('0x33')],'sentAt':moment(_0x36aa23['date'])[_0x1a4c('0x27')](_0x1a4c('0x34')),'attach':![],'attachments':[]}};if(!_0x36aa23['html']&&!_0x36aa23[_0x1a4c('0x20')]){var _0x1b13af=_['filter'](_0x36aa23[_0x1a4c('0x19')],{'contentType':'application/ms-tnef'});if(_0x1b13af['length']){logger[_0x1a4c('0x35')](util[_0x1a4c('0x27')](_0x1a4c('0x36'),_0x36aa23[_0x1a4c('0x37')]));tnef['parseBuffer'](_[_0x1a4c('0x38')](_0x1b13af)[_0x1a4c('0x2b')],function(_0x1bffce,_0x1c1bcd){if(_0x1c1bcd){_0x36aa23[_0x1a4c('0x15')]=_0x1c1bcd['BodyHTML']||_0x1a4c('0x39');if(_0x1c1bcd['Attachments']){for(var _0x326054=0x0;_0x326054<_0x1c1bcd[_0x1a4c('0x3a')][_0x1a4c('0x12')];_0x326054++){var _0x50f0a4=_0x1c1bcd[_0x1a4c('0x3a')][_0x326054];_0x44222f[_0x1a4c('0x22')]['attachments'][_0x1a4c('0x2c')]({'filename':_0x50f0a4['Title'],'content':Buffer[_0x1a4c('0x31')](_0x50f0a4[_0x1a4c('0x3b')])});}}}_0x17f399(parseEmail(_0x5acca0,_0x36aa23,_0x44222f));});}else{_0x36aa23[_0x1a4c('0x15')]='

Empty\x20message

';_0x17f399(parseEmail(_0x5acca0,_0x36aa23,_0x44222f));}}else{_0x17f399(parseEmail(_0x5acca0,_0x36aa23,_0x44222f));}};exports[_0x1a4c('0x3c')]=function(_0x2e3954,_0x9b8232){var _0xfdae78=[_0x1a4c('0x3d')+(_0x9b8232||''),_0x1a4c('0x3e')+_0x2e3954,'',''];return Buffer[_0x1a4c('0x31')](_0xfdae78['join'](''),'utf-8')[_0x1a4c('0x3f')]('base64');}; \ No newline at end of file +var _0xfdc0=['bcc','attachments','attach','type','attachment-','now','root','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','inReplyTo','date','format','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','

Empty\x20message

','Attachments','push','Title','generateXOAuth2Token','user=','utf-8','toString','moment','randomstring','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','isEmpty','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x564f33[_0x0fdc('0x11')](0x0,-0x1)[_0x0fdc('0x12')]('\x20'):_0x3f9d27[_0x0fdc('0xc')];}return'Anonymous';}function getLastName(_0x2b5f15){var _0x456d46=_[_0x0fdc('0x6')](_0x2b5f15[_0x0fdc('0x7')]);if(_0x456d46&&_0x456d46[_0x0fdc('0xc')]){var _0x37a445=_0x456d46[_0x0fdc('0xc')]['split'](/\s+/);return _0x37a445[_0x0fdc('0x10')]>0x1?_0x37a445[_0x0fdc('0x13')]():'';}return'';}function getMails(_0x428829,_0x3aed40){var _0x427ec9='';for(var _0x36b3f2=0x0;_0x36b3f2<_0x3aed40[_0x0fdc('0x7')][_0x0fdc('0x10')];_0x36b3f2+=0x1){if(_0x3aed40[_0x0fdc('0x7')][_0x36b3f2]['address']!==_0x428829){if(!_[_0x0fdc('0x14')](_0x427ec9)){_0x427ec9+=',';}_0x427ec9+=_0x3aed40['value'][_0x36b3f2][_0x0fdc('0xc')]||_0x3aed40[_0x0fdc('0x7')][_0x36b3f2]['address']||'';_0x427ec9+='\x20<';_0x427ec9+=_0x3aed40['value'][_0x36b3f2][_0x0fdc('0x8')]?_0x3aed40[_0x0fdc('0x7')][_0x36b3f2][_0x0fdc('0x8')]:_0x0fdc('0x9')+random['generate'](0x6)+_0x0fdc('0xb');_0x427ec9+='>';}}return _0x427ec9;}function parseEmail(_0x5dc6c2,_0x3fb99d,_0x18cd27){if(_0x3fb99d['html']){var _0x267c8f=/)<[^<]*)*<\/script>/gi;while(_0x267c8f[_0x0fdc('0x15')](_0x3fb99d[_0x0fdc('0x16')])){_0x3fb99d[_0x0fdc('0x16')]=_0x3fb99d[_0x0fdc('0x16')][_0x0fdc('0x17')](_0x267c8f,'');}if(_0x3fb99d[_0x0fdc('0x16')][_0x0fdc('0x18')](_0x0fdc('0x19'))){var _0xfe1eea=[];_0x3fb99d['attachments'][_0x0fdc('0x1a')](_0x3ed939=>{_0xfe1eea['push'](_0x3ed939[_0x0fdc('0x1b')]);});var _0x8b088e=/]+>/g;var _0x494760=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4c3bd8=_0x3fb99d[_0x0fdc('0x16')][_0x0fdc('0x17')](_0x494760,_0x0fdc('0x1c'));var _0x27b9d6=_0x4c3bd8[_0x0fdc('0x17')](_0x8b088e,_0x0fdc('0x1d'));for(let _0x1d4e6c=0x0;_0x1d4e6c<_0xfe1eea[_0x0fdc('0x10')];_0x1d4e6c++){var _0xd87f1e=_0x27b9d6[_0x0fdc('0x17')](_0x0fdc('0x1d'),_0x0fdc('0x1e')+_0xfe1eea[_0x1d4e6c]+_0x0fdc('0x1f'));_0x27b9d6=_0xd87f1e;}_0x3fb99d['html']=_0x27b9d6;}_0x18cd27[_0x0fdc('0x20')]=_0x3fb99d[_0x0fdc('0x16')];}else{_0x18cd27['body']=_0x3fb99d[_0x0fdc('0x21')];}if(_0x18cd27['body']){_0x18cd27[_0x0fdc('0x20')]=_0x18cd27[_0x0fdc('0x20')]['replace'](/0x0){var _0x100b5d=[_0x0fdc('0x30'),_0x0fdc('0x31'),_0x0fdc('0x32')];for(var _0x5a109f=0x0;_0x5a109f<_0x3fb99d[_0x0fdc('0x2f')][_0x0fdc('0x10')];_0x5a109f++){var _0xca3c95=_[_0x0fdc('0xe')](_0x100b5d,_0x3fb99d[_0x0fdc('0x2f')][_0x5a109f][_0x0fdc('0x33')]);if(_0xca3c95>=0x0){_0x18cd27[_0x0fdc('0x34')]=!![];}}}return _0x18cd27;}exports[_0x0fdc('0x35')]=function(_0x1a77b2,_0x2084ef,_0x197c78){var _0x1c1dc5={'from':getAddress(_0x2084ef[_0x0fdc('0x36')]),'firstName':getFirstName(_0x2084ef[_0x0fdc('0x36')]),'lastName':getLastName(_0x2084ef[_0x0fdc('0x36')]),'mapKey':_0x0fdc('0x5'),'message':{'from':getMails(_0x1a77b2[_0x0fdc('0x5')],_0x2084ef['from']),'to':_0x1a77b2[_0x0fdc('0x5')],'cc':'','subject':_0x2084ef[_0x0fdc('0x37')]||'','messageId':_0x2084ef['messageId'],'inReplyTo':_0x2084ef[_0x0fdc('0x38')],'sentAt':moment(_0x2084ef[_0x0fdc('0x39')])[_0x0fdc('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2084ef['html']&&!_0x2084ef['textAsHtml']){var _0x55eb45=_[_0x0fdc('0x3b')](_0x2084ef[_0x0fdc('0x27')],{'contentType':_0x0fdc('0x3c')});if(_0x55eb45[_0x0fdc('0x10')]){logger['info'](util[_0x0fdc('0x3a')](_0x0fdc('0x3d'),_0x2084ef[_0x0fdc('0x3e')]));tnef[_0x0fdc('0x3f')](_['first'](_0x55eb45)['content'],function(_0x39864b,_0x55186c){if(_0x55186c){_0x2084ef[_0x0fdc('0x16')]=_0x55186c['BodyHTML']||_0x0fdc('0x40');if(_0x55186c[_0x0fdc('0x41')]){for(var _0xd37481=0x0;_0xd37481<_0x55186c[_0x0fdc('0x41')]['length'];_0xd37481++){var _0x13c875=_0x55186c['Attachments'][_0xd37481];_0x1c1dc5['message'][_0x0fdc('0x27')][_0x0fdc('0x42')]({'filename':_0x13c875[_0x0fdc('0x43')],'content':Buffer['from'](_0x13c875['Data'])});}}}_0x197c78(parseEmail(_0x1a77b2,_0x2084ef,_0x1c1dc5));});}else{_0x2084ef[_0x0fdc('0x16')]=_0x0fdc('0x40');_0x197c78(parseEmail(_0x1a77b2,_0x2084ef,_0x1c1dc5));}}else{_0x197c78(parseEmail(_0x1a77b2,_0x2084ef,_0x1c1dc5));}};exports[_0x0fdc('0x44')]=function(_0x4c2bcb,_0x43713a){var _0x34c032=[_0x0fdc('0x45')+(_0x43713a||''),'auth=Bearer\x20'+_0x4c2bcb,'',''];return Buffer[_0x0fdc('0x36')](_0x34c032['join'](''),_0x0fdc('0x46'))[_0x0fdc('0x47')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 45db4f1..1c9e38a 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 _0xa480=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x195792,_0x4d6602){var _0x27ecea=function(_0x321d55){while(--_0x321d55){_0x195792['push'](_0x195792['shift']());}};_0x27ecea(++_0x4d6602);}(_0xa480,0x198));var _0x0a48=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa480[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');function MailAccount(_0x16747a){this['id']=_0x16747a['id']||0x0;this['name']=_0x16747a[_0x0a48('0x0')]||_0x0a48('0x1');this['key']=_0x16747a[_0x0a48('0x2')]||_0x0a48('0x3');this['active']=_0x16747a[_0x0a48('0x4')]||![];this[_0x0a48('0x5')]=_0x16747a['Imap']||[];this[_0x0a48('0x6')]=_0x16747a[_0x0a48('0x6')]||[];}module[_0x0a48('0x7')]=MailAccount; \ No newline at end of file +var _0x2a9b=['Service','key','SERV','active','Imap','Smtp','lodash','name'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x2a9b,0xfe));var _0xb2a9=function(_0x21e1e4,_0x2dbba2){_0x21e1e4=_0x21e1e4-0x0;var _0x57fc6b=_0x2a9b[_0x21e1e4];return _0x57fc6b;};'use strict';var _=require(_0xb2a9('0x0'));function MailAccount(_0x4106b1){this['id']=_0x4106b1['id']||0x0;this['name']=_0x4106b1[_0xb2a9('0x1')]||_0xb2a9('0x2');this[_0xb2a9('0x3')]=_0x4106b1['key']||_0xb2a9('0x4');this[_0xb2a9('0x5')]=_0x4106b1['active']||![];this[_0xb2a9('0x6')]=_0x4106b1[_0xb2a9('0x6')]||[];this[_0xb2a9('0x7')]=_0x4106b1[_0xb2a9('0x7')]||[];}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 b195c77..9068d30 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 _0x1bc2=['exports','lodash','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x1bc2,0xa6));var _0x21bc=function(_0x27ccde,_0x487264){_0x27ccde=_0x27ccde-0x0;var _0xb03fcb=_0x1bc2[_0x27ccde];return _0xb03fcb;};'use strict';var _=require(_0x21bc('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x452192,_0xd7f455,_0x230c93){var _0x40a2d5=_[_0x21bc('0x1')](_0x452192,function(_0x1f5a5b,_0x33aadc){return _0x1f5a5b[_0x230c93];});for(var _0x3a566e in _0xd7f455){if(_0xd7f455[_0x21bc('0x2')](_0x3a566e)){if(!_0x40a2d5[_0x3a566e]){delete _0xd7f455[_0x3a566e];}}}}Realtime[_0x21bc('0x3')][_0x21bc('0x4')]=function(_0x30dcd3,_0x5736a8){for(var _0xaade29 in _0x5736a8){if(_0x30dcd3[_0x21bc('0x2')](_0xaade29)){_0x30dcd3[_0xaade29]=_0x5736a8[_0xaade29];}}};Realtime[_0x21bc('0x3')][_0x21bc('0x5')]=function(){var _0x5b762e=this;return function(_0xd69938){if(_0xd69938){freeIsNotKey(_0xd69938,_0x5b762e[_0x21bc('0x6')],'id');for(var _0x198e3d=0x0,_0x17baa4={},_0x179169={};_0x198e3d<_0xd69938[_0x21bc('0x7')];_0x198e3d+=0x1){_0x17baa4=_0xd69938[_0x198e3d];if(_[_0x21bc('0x8')](_0x5b762e[_0x21bc('0x6')][_0x17baa4['id']])){_0x5b762e[_0x21bc('0x6')][_0x17baa4['id']]=new MailAccount(_0x17baa4);}else{_[_0x21bc('0x9')](_0x5b762e[_0x21bc('0x6')][_0x17baa4['id']],_0x17baa4);}}}return _0x5b762e[_0x21bc('0x6')];};};module[_0x21bc('0xa')]=Realtime; \ No newline at end of file +var _0xd828=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0xa61bb,_0x1981ce){var _0x3253a3=function(_0x492e9d){while(--_0x492e9d){_0xa61bb['push'](_0xa61bb['shift']());}};_0x3253a3(++_0x1981ce);}(_0xd828,0xda));var _0x8d82=function(_0xf87462,_0x1021f8){_0xf87462=_0xf87462-0x0;var _0x536548=_0xd828[_0xf87462];return _0x536548;};'use strict';var _=require(_0x8d82('0x0'));var MailAccount=require(_0x8d82('0x1'));var Realtime=function(){this[_0x8d82('0x2')]={};};function freeIsNotKey(_0x5c6f82,_0x140027,_0xde2bd4){var _0x1f5f59=_[_0x8d82('0x3')](_0x5c6f82,function(_0x23d3f7,_0x2d9d80){return _0x23d3f7[_0xde2bd4];});for(var _0x1b149a in _0x140027){if(_0x140027[_0x8d82('0x4')](_0x1b149a)){if(!_0x1f5f59[_0x1b149a]){delete _0x140027[_0x1b149a];}}}}Realtime[_0x8d82('0x5')][_0x8d82('0x6')]=function(_0x3484e5,_0x264a85){for(var _0x87962 in _0x264a85){if(_0x3484e5[_0x8d82('0x4')](_0x87962)){_0x3484e5[_0x87962]=_0x264a85[_0x87962];}}};Realtime['prototype'][_0x8d82('0x7')]=function(){var _0x1ed608=this;return function(_0x3c9d24){if(_0x3c9d24){freeIsNotKey(_0x3c9d24,_0x1ed608[_0x8d82('0x2')],'id');for(var _0x370890=0x0,_0x2da1c4={},_0x50d280={};_0x370890<_0x3c9d24['length'];_0x370890+=0x1){_0x2da1c4=_0x3c9d24[_0x370890];if(_[_0x8d82('0x8')](_0x1ed608[_0x8d82('0x2')][_0x2da1c4['id']])){_0x1ed608['mailAccounts'][_0x2da1c4['id']]=new MailAccount(_0x2da1c4);}else{_[_0x8d82('0x9')](_0x1ed608[_0x8d82('0x2')][_0x2da1c4['id']],_0x2da1c4);}}}return _0x1ed608[_0x8d82('0x2')];};};module[_0x8d82('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1fe3902..42f744b 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 _0x282a=['getMailAccounts','Request','GetMailAccount','name','provider','email','active','ListId','MailServerIn','CloudProvider','service','data5','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x282a,0xa2));var _0xa282=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x282a[_0x173441];return _0x2423a8;};'use strict';var client=require('../client');exports[_0xa282('0x0')]=function(){return function(){return client[_0xa282('0x1')](_0xa282('0x2'),{'options':{'attributes':['id',_0xa282('0x3'),_0xa282('0x4'),'service',_0xa282('0x5'),_0xa282('0x6'),'key',_0xa282('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xa282('0x8'),'as':'Imap','include':[{'model':_0xa282('0x9'),'attributes':['id',_0xa282('0x3'),_0xa282('0xa'),'type',_0xa282('0xb')],'as':'CloudProvider'}]},{'model':_0xa282('0xc'),'as':_0xa282('0xd'),'include':[{'model':_0xa282('0x9'),'attributes':['id',_0xa282('0x3'),_0xa282('0xa'),_0xa282('0xe'),_0xa282('0xb')],'as':_0xa282('0x9')}]}]},'log':_0xa282('0xf')});};};exports[_0xa282('0x10')]=function(_0x2e1e55,_0x168fed){return client[_0xa282('0x1')](_0xa282('0x11'),{'account':{'id':_0x2e1e55},'body':_0x168fed,'log':_0xa282('0x11')});}; \ No newline at end of file +var _0x3457=['email','active','key','TemplateId','type','data5','CloudProvider','MailServerOut','getMailAccount','notify','Request','NotifyMailAccount','name','provider','service'];(function(_0x518d3e,_0x2f6816){var _0x3954b2=function(_0x5b83a1){while(--_0x5b83a1){_0x518d3e['push'](_0x518d3e['shift']());}};_0x3954b2(++_0x2f6816);}(_0x3457,0x93));var _0x7345=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3457[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x7345('0x0'),_0x7345('0x1'),_0x7345('0x2'),_0x7345('0x3'),_0x7345('0x4'),_0x7345('0x5'),'ListId',_0x7345('0x6')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0x7345('0x0'),_0x7345('0x2'),_0x7345('0x7'),_0x7345('0x8')],'as':_0x7345('0x9')}]},{'model':_0x7345('0xa'),'as':'Smtp','include':[{'model':_0x7345('0x9'),'attributes':['id',_0x7345('0x0'),_0x7345('0x2'),_0x7345('0x7'),'data5'],'as':_0x7345('0x9')}]}]},'log':_0x7345('0xb')});};};exports[_0x7345('0xc')]=function(_0x39a092,_0x5101c1){return client[_0x7345('0xd')]('NotifyMailAccount',{'account':{'id':_0x39a092},'body':_0x5101c1,'log':_0x7345('0xe')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index d182ae9..1775870 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 _0xb911=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0xe01c25,_0x544a11){var _0x4ae4db=function(_0x18267a){while(--_0x18267a){_0xe01c25['push'](_0xe01c25['shift']());}};_0x4ae4db(++_0x544a11);}(_0xb911,0x13b));var _0x1b91=function(_0x459dc6,_0x38026f){_0x459dc6=_0x459dc6-0x0;var _0xf3f2a0=_0xb911[_0x459dc6];return _0xf3f2a0;};'use strict';var client=require(_0x1b91('0x0'));exports[_0x1b91('0x1')]=function(){return client[_0x1b91('0x2')](_0x1b91('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1b91('0x4')]},'log':_0x1b91('0x5')});}; \ No newline at end of file +var _0x8619=['../client','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x3c793c,_0x1e17b5){var _0x1e91f2=function(_0x980ea2){while(--_0x980ea2){_0x3c793c['push'](_0x3c793c['shift']());}};_0x1e91f2(++_0x1e17b5);}(_0x8619,0x7d));var _0x9861=function(_0x5d3267,_0xe106a8){_0x5d3267=_0x5d3267-0x0;var _0x57dba1=_0x8619[_0x5d3267];return _0x57dba1;};'use strict';var client=require(_0x9861('0x0'));exports['getSettings']=function(){return client[_0x9861('0x1')](_0x9861('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9861('0x3')]},'log':_0x9861('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index ac74718..edcf8b8 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 61aed19..e799a10 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 _0x6094=['ioredis','../../config/environment','createServer','timeout','listen','port','redis','defaults','localhost','adapter','../../config/triggers','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0xb41943,_0x3e36bd){var _0x367e50=function(_0x21de12){while(--_0x21de12){_0xb41943['push'](_0xb41943['shift']());}};_0x367e50(++_0x3e36bd);}(_0x6094,0x1b6));var _0x4609=function(_0x29d44d,_0x3528b8){_0x29d44d=_0x29d44d-0x0;var _0x28480d=_0x6094[_0x29d44d];return _0x28480d;};'use strict';var _=require(_0x4609('0x0'));var http=require(_0x4609('0x1'));var express=require(_0x4609('0x2'));var sticky=require('sticky-session');var Redis=require(_0x4609('0x3'));var config=require(_0x4609('0x4'));var app=express();var server=http[_0x4609('0x5')](app);server[_0x4609('0x6')]=0xdbba0;if(sticky[_0x4609('0x7')](server,config[_0x4609('0x8')])){var socketio=require('socket.io')(server,{'transports':['websocket','polling']});config[_0x4609('0x9')]=_[_0x4609('0xa')](config[_0x4609('0x9')],{'host':_0x4609('0xb'),'port':0x18eb});socketio[_0x4609('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x4609('0x9')]),'subClient':new Redis(config[_0x4609('0x9')])}));require(_0x4609('0xd'))[_0x4609('0xe')]();require('../../config/socketio')[_0x4609('0xe')](socketio);require('../../config/express')[_0x4609('0xe')](app);require(_0x4609('0xf'))[_0x4609('0xe')](app);}else{server[_0x4609('0x10')](_0x4609('0x11'),function(){console[_0x4609('0x12')](_0x4609('0x13'),config['port']);});}exports=module[_0x4609('0x14')]=app; \ No newline at end of file +var _0x694e=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','listen','port','websocket','polling','redis','defaults','localhost','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening'];(function(_0x528967,_0xcccffa){var _0x4b3fa8=function(_0x1a3834){while(--_0x1a3834){_0x528967['push'](_0x528967['shift']());}};_0x4b3fa8(++_0xcccffa);}(_0x694e,0x75));var _0xe694=function(_0x487738,_0x506e26){_0x487738=_0x487738-0x0;var _0x139165=_0x694e[_0x487738];return _0x139165;};'use strict';var _=require(_0xe694('0x0'));var http=require(_0xe694('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky[_0xe694('0x2')](server,config[_0xe694('0x3')])){var socketio=require('socket.io')(server,{'transports':[_0xe694('0x4'),_0xe694('0x5')]});config[_0xe694('0x6')]=_[_0xe694('0x7')](config['redis'],{'host':_0xe694('0x8'),'port':0x18eb});socketio['adapter'](require(_0xe694('0x9'))({'pubClient':new Redis(config[_0xe694('0x6')]),'subClient':new Redis(config[_0xe694('0x6')])}));require('../../config/triggers')[_0xe694('0xa')]();require(_0xe694('0xb'))[_0xe694('0xa')](socketio);require(_0xe694('0xc'))[_0xe694('0xa')](app);require(_0xe694('0xd'))[_0xe694('0xa')](app);}else{server[_0xe694('0xe')](_0xe694('0xf'),function(){console[_0xe694('0x10')](_0xe694('0x11'),config['port']);});}exports=module[_0xe694('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 043f4e4..daccea5 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 _0x3d86=['error','message','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x2b2033,_0x3e00c5){var _0x3e50e3=function(_0xe577bf){while(--_0xe577bf){_0x2b2033['push'](_0x2b2033['shift']());}};_0x3e50e3(++_0x3e00c5);}(_0x3d86,0x161));var _0x63d8=function(_0x28b5d1,_0x19b1d2){_0x28b5d1=_0x28b5d1-0x0;var _0x3e1a41=_0x3d86[_0x28b5d1];return _0x3e1a41;};'use strict';var jayson=require(_0x63d8('0x0'));var BPromise=require(_0x63d8('0x1'));var logger=require(_0x63d8('0x2'))(_0x63d8('0x3'));var client=jayson[_0x63d8('0x4')][_0x63d8('0x5')]({'port':0x2329});client[_0x63d8('0x6')]=function(_0x2b561c,_0x56c175){return new BPromise(function(_0x1ed084,_0x38f48e){return client[_0x63d8('0x7')](_0x2b561c,_0x56c175)[_0x63d8('0x8')](function(_0x443a94){logger[_0x63d8('0x9')](_0x63d8('0xa'),_0x63d8('0x3'),_0x2b561c,_0x56c175,_0x443a94);if(_0x443a94['error']){logger[_0x63d8('0xb')]('rpc',_0x63d8('0x3'),_0x2b561c,_0x443a94[_0x63d8('0xb')][_0x63d8('0xc')],_0x56c175);return _0x38f48e(_0x443a94['error'][_0x63d8('0xc')]);}else{return _0x1ed084(_0x443a94['result']);}})['catch'](function(_0x1c712e){logger[_0x63d8('0xb')](_0x63d8('0xa'),'routing',_0x2b561c,_0x1c712e,_0x56c175);return _0x38f48e(_0x1c712e);});});};module[_0x63d8('0xd')]=client; \ No newline at end of file +var _0x2baa=['message','result','catch','exports','bluebird','../../config/logger','routing','client','http','Request','request','then','rpc','error'];(function(_0x537c02,_0x4fcbad){var _0x496498=function(_0x50156d){while(--_0x50156d){_0x537c02['push'](_0x537c02['shift']());}};_0x496498(++_0x4fcbad);}(_0x2baa,0x1a8));var _0xa2ba=function(_0x388d08,_0x260717){_0x388d08=_0x388d08-0x0;var _0x3fbe10=_0x2baa[_0x388d08];return _0x3fbe10;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa2ba('0x0'));var logger=require(_0xa2ba('0x1'))(_0xa2ba('0x2'));var client=jayson[_0xa2ba('0x3')][_0xa2ba('0x4')]({'port':0x2329});client[_0xa2ba('0x5')]=function(_0x202706,_0x5b675e){return new BPromise(function(_0xf90c98,_0x35bb81){return client[_0xa2ba('0x6')](_0x202706,_0x5b675e)[_0xa2ba('0x7')](function(_0x38710b){logger['debug'](_0xa2ba('0x8'),_0xa2ba('0x2'),_0x202706,_0x5b675e,_0x38710b);if(_0x38710b['error']){logger[_0xa2ba('0x9')](_0xa2ba('0x8'),_0xa2ba('0x2'),_0x202706,_0x38710b[_0xa2ba('0x9')][_0xa2ba('0xa')],_0x5b675e);return _0x35bb81(_0x38710b[_0xa2ba('0x9')]['message']);}else{return _0xf90c98(_0x38710b[_0xa2ba('0xb')]);}})[_0xa2ba('0xc')](function(_0x5c2a17){logger[_0xa2ba('0x9')](_0xa2ba('0x8'),_0xa2ba('0x2'),_0x202706,_0x5c2a17,_0x5b675e);return _0x35bb81(_0x5c2a17);});});};module[_0xa2ba('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 91aa340..b113227 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 _0xe18e=['initWhatsappQueues','listen','catch','log','./server','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x5780fa,_0x4c07ff){var _0x5db1a3=function(_0x2a62ef){while(--_0x2a62ef){_0x5780fa['push'](_0x5780fa['shift']());}};_0x5db1a3(++_0x4c07ff);}(_0xe18e,0x1c6));var _0xee18=function(_0x3571c0,_0x3c61cb){_0x3571c0=_0x3571c0-0x0;var _0x2adddb=_0xe18e[_0x3571c0];return _0x2adddb;};'use strict';var BPromise=require('bluebird');var server=require(_0xee18('0x0'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xee18('0x1'));var openchannelQueue=require(_0xee18('0x2'));var chatQueue=require(_0xee18('0x3'));var smsQueue=require(_0xee18('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xee18('0x5'));var whatsappQueue=require(_0xee18('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xee18('0x7')]()[_0xee18('0x8')](user['getAgents']())[_0xee18('0x8')](realtime[_0xee18('0x9')]())['then'](interval[_0xee18('0xa')]())['then'](realtime['initIntervals']())[_0xee18('0x8')](openchannelQueue[_0xee18('0xb')]())[_0xee18('0x8')](realtime[_0xee18('0xc')]())['then'](chatQueue[_0xee18('0xd')]())[_0xee18('0x8')](realtime[_0xee18('0xe')]())['then'](smsQueue[_0xee18('0xf')]())[_0xee18('0x8')](realtime[_0xee18('0x10')]())['then'](mailQueue[_0xee18('0x11')]())[_0xee18('0x8')](realtime[_0xee18('0x12')]())[_0xee18('0x8')](faxQueue[_0xee18('0x13')]())[_0xee18('0x8')](realtime[_0xee18('0x14')]())[_0xee18('0x8')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xee18('0x15')]())[_0xee18('0x8')](function(){return realtime;});}function main(){return server[_0xee18('0x16')](realtime)[_0xee18('0x8')](function(_0x49aba9){return initRealtime();})[_0xee18('0x8')](function(_0x307f3d){return setInterval(initRealtime,0x1388);})[_0xee18('0x17')](function(_0x41c609){console[_0xee18('0x18')](_0x41c609);});}main(); \ No newline at end of file +var _0xa84d=['initOpenchannelQueues','initWhatsappQueues','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues'];(function(_0x831181,_0x291cd9){var _0x37a37a=function(_0x3d47f7){while(--_0x3d47f7){_0x831181['push'](_0x831181['shift']());}};_0x37a37a(++_0x291cd9);}(_0xa84d,0x122));var _0xda84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa84d[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xda84('0x0'));var server=require(_0xda84('0x1'));var Realtime=require(_0xda84('0x2'));var user=require(_0xda84('0x3'));var interval=require(_0xda84('0x4'));var openchannelQueue=require(_0xda84('0x5'));var chatQueue=require(_0xda84('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xda84('0x7'));var faxQueue=require(_0xda84('0x8'));var whatsappQueue=require(_0xda84('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xda84('0xa')]()[_0xda84('0xb')](user[_0xda84('0xc')]())[_0xda84('0xb')](realtime[_0xda84('0xd')]())['then'](interval[_0xda84('0xe')]())[_0xda84('0xb')](realtime['initIntervals']())['then'](openchannelQueue[_0xda84('0xf')]())[_0xda84('0xb')](realtime[_0xda84('0x10')]())[_0xda84('0xb')](chatQueue['getChatQueues']())[_0xda84('0xb')](realtime['initChatQueues']())[_0xda84('0xb')](smsQueue['getSmsQueues']())[_0xda84('0xb')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())[_0xda84('0xb')](faxQueue['getFaxQueues']())[_0xda84('0xb')](realtime['initFaxQueues']())[_0xda84('0xb')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xda84('0x11')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0xda84('0xb')](function(_0x2ad988){return initRealtime();})[_0xda84('0xb')](function(_0xb36d95){return setInterval(initRealtime,0x1388);})['catch'](function(_0x4fe54a){console['log'](_0x4fe54a);});}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 8e92267..6627157 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x3622df,_0x40338a){var _0x1e34e5=function(_0xe3f3a8){while(--_0xe3f3a8){_0x3622df['push'](_0x3622df['shift']());}};_0x1e34e5(++_0x40338a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x5fc3[_0x1ee62e];return _0x27c6c8;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0x814b,0x1a2));var _0xb814=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0x814b[_0x2f037f];return _0x2d1573;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 985cb93..ae2707d 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 _0x0e06=['client','http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x1d1d3c,_0x69ec46){var _0x409280=function(_0x5529c0){while(--_0x5529c0){_0x1d1d3c['push'](_0x1d1d3c['shift']());}};_0x409280(++_0x69ec46);}(_0x0e06,0x199));var _0x60e0=function(_0x49b1b2,_0x418932){_0x49b1b2=_0x49b1b2-0x0;var _0x141579=_0x0e06[_0x49b1b2];return _0x141579;};'use strict';var BPromise=require(_0x60e0('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x60e0('0x1')][_0x60e0('0x2')]({'port':0x232b});function request(_0x53f6b7,_0x4fb693){return new BPromise(function(_0x58a4ba,_0x24b05f){return client[_0x60e0('0x3')](_0x53f6b7,_0x4fb693)['then'](function(_0x22d06b){if(_0x22d06b[_0x60e0('0x4')]){return _0x24b05f(_0x22d06b[_0x60e0('0x4')][_0x60e0('0x5')]);}else{return _0x58a4ba(_0x22d06b[_0x60e0('0x6')]);}})[_0x60e0('0x7')](function(_0x4e1635){return _0x24b05f(_0x4e1635);});});}exports[_0x60e0('0x8')]=function(_0x6d1712,_0x420b51){return request(_0x60e0('0x9'),{'account':_0x6d1712,'message':_0x420b51});}; \ No newline at end of file +var _0x4a25=['client','http','request','then','error','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x3d178f,_0x529f68){var _0x40c9d6=function(_0x4b204f){while(--_0x4b204f){_0x3d178f['push'](_0x3d178f['shift']());}};_0x40c9d6(++_0x529f68);}(_0x4a25,0x1b6));var _0x54a2=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x4a25[_0x2179f1];return _0x176ec9;};'use strict';var BPromise=require(_0x54a2('0x0'));var jayson=require(_0x54a2('0x1'));var client=jayson[_0x54a2('0x2')][_0x54a2('0x3')]({'port':0x232b});function request(_0x46d5f0,_0x8ac885){return new BPromise(function(_0x4d58bc,_0x3469b1){return client[_0x54a2('0x4')](_0x46d5f0,_0x8ac885)[_0x54a2('0x5')](function(_0x428fc2){if(_0x428fc2[_0x54a2('0x6')]){return _0x3469b1(_0x428fc2[_0x54a2('0x6')]['message']);}else{return _0x4d58bc(_0x428fc2[_0x54a2('0x7')]);}})[_0x54a2('0x8')](function(_0x10c229){return _0x3469b1(_0x10c229);});});}exports[_0x54a2('0x9')]=function(_0x8dc909,_0x4b5115){return request('SendMail',{'account':_0x8dc909,'message':_0x4b5115});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 8b46ea0..0ae792e 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 _0x3825=['mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','prototype','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','openchannel','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','chatStatus','chatCurrentCapacity','faxStatusTime','smsStatus','smsStatusTime','smsCurrentCapacity','whatsappStatus','smsWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3825,0x139));var _0x5382=function(_0x16765f,_0x3dd736){_0x16765f=_0x16765f-0x0;var _0x1326d4=_0x3825[_0x16765f];return _0x1326d4;};'use strict';var _=require(_0x5382('0x0'));var moment=require(_0x5382('0x1'));var md5=require(_0x5382('0x2'));var Redis=require(_0x5382('0x3'));var config=require(_0x5382('0x4'));config[_0x5382('0x5')]=_[_0x5382('0x6')](config[_0x5382('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5382('0x7'))(new Redis(config[_0x5382('0x5')]));function Agent(_0x4fe3f4){this['id']=_0x4fe3f4['id']||0x0;this[_0x5382('0x8')]=_0x4fe3f4[_0x5382('0x8')]||'';this[_0x5382('0x9')]=_0x4fe3f4[_0x5382('0x9')]||!![];this['voicePause']=_0x4fe3f4[_0x5382('0xa')]||![];this[_0x5382('0xb')]=_0x4fe3f4['chatPause']||![];this[_0x5382('0xc')]=_0x4fe3f4['mailPause']||![];this[_0x5382('0xd')]=_0x4fe3f4[_0x5382('0xd')]||![];this[_0x5382('0xe')]=_0x4fe3f4[_0x5382('0xe')]||![];this[_0x5382('0xf')]=_0x4fe3f4[_0x5382('0xf')]||![];this['chatStatus']=_0x5382('0x10');this[_0x5382('0x11')]=0x0;this[_0x5382('0x12')]=_0x4fe3f4['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x5382('0x13')]='unknown';this[_0x5382('0x14')]=0x0;this[_0x5382('0x15')]=_0x4fe3f4['mailCapacity']||0x0;this[_0x5382('0x16')]=0x0;this[_0x5382('0x17')]='unknown';this['faxStatusTime']=0x0;this[_0x5382('0x18')]=_0x4fe3f4['faxCapacity']||0x0;this[_0x5382('0x19')]=0x0;this['smsStatus']='unknown';this['smsStatusTime']=0x0;this[_0x5382('0x1a')]=_0x4fe3f4[_0x5382('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x5382('0x1b')]=0x0;this[_0x5382('0x1c')]=_0x4fe3f4[_0x5382('0x1c')]||0x0;this[_0x5382('0x1d')]=0x0;this[_0x5382('0x1e')]='unknown';this[_0x5382('0x1f')]=0x0;this[_0x5382('0x20')]=_0x4fe3f4['openchannelCapacity']||0x0;this[_0x5382('0x21')]=0x0;this[_0x5382('0x22')]=![];this['busyQueue']=undefined;this[_0x5382('0x2')]='';this[_0x5382('0x23')]={};this[_0x5382('0x24')]={};this[_0x5382('0x25')]={};this[_0x5382('0x26')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this['updateRealtime']();}Agent[_0x5382('0x27')]['getChannelStatus']=function(_0x5005a4){if(this[_0x5005a4+_0x5382('0x28')]>0x0){if(this[_0x5005a4+_0x5382('0x29')]>0x0&&this[_0x5005a4+'CurrentCapacity']>=this[_0x5005a4+_0x5382('0x29')]){return _0x5382('0x2a');}else{return _0x5382('0x2b');}}else{return'idle';}};Agent[_0x5382('0x27')][_0x5382('0x2c')]=function(){var _0x61dd53=[_0x5382('0x2d'),'chat',_0x5382('0x2e'),'fax','sms',_0x5382('0x2f')];for(var _0x6f0a58=0x0;_0x6f0a58<_0x61dd53[_0x5382('0x30')];_0x6f0a58+=0x1){var _0x55a6b2=this[_0x5382('0x31')](_0x61dd53[_0x6f0a58]);if(this[_0x61dd53[_0x6f0a58]+_0x5382('0x32')]!==_0x55a6b2){this[_0x61dd53[_0x6f0a58]+_0x5382('0x33')]=_[_0x5382('0x34')](moment()['format']('x'));}this[_0x61dd53[_0x6f0a58]+_0x5382('0x32')]=_0x55a6b2;}var _0x371dbf={'id':this['id'],'name':this[_0x5382('0x8')],'online':this[_0x5382('0x9')],'voicePause':this[_0x5382('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0x5382('0xc')],'smsPause':this[_0x5382('0xe')],'faxPause':this[_0x5382('0xd')],'openchannelPause':this[_0x5382('0xf')],'chatStatus':this[_0x5382('0x35')],'chatStatusTime':this[_0x5382('0x11')],'chatCapacity':this[_0x5382('0x12')],'chatCurrentCapacity':this[_0x5382('0x36')],'mailStatus':this[_0x5382('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x5382('0x15')],'mailCurrentCapacity':this[_0x5382('0x16')],'faxStatus':this[_0x5382('0x17')],'faxStatusTime':this[_0x5382('0x37')],'faxCapacity':this[_0x5382('0x18')],'faxCurrentCapacity':this[_0x5382('0x19')],'smsStatus':this[_0x5382('0x38')],'smsStatusTime':this[_0x5382('0x39')],'smsCapacity':this[_0x5382('0x1a')],'smsCurrentCapacity':this[_0x5382('0x3a')],'whatsappStatus':this[_0x5382('0x3b')],'whatsappStatusTime':this[_0x5382('0x1b')],'whatsappCapacity':this[_0x5382('0x1c')],'whatsappCurrentCapacity':this[_0x5382('0x1d')],'openchannelStatus':this[_0x5382('0x1e')],'openchannelStatusTime':this[_0x5382('0x1f')],'openchannelCapacity':this[_0x5382('0x20')],'openchannelCurrentCapacity':this[_0x5382('0x21')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x5382('0x24')],'mailWaitingInteractions':this[_0x5382('0x25')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x5382('0x3c')],'whatsappWaitingInteractions':this[_0x5382('0x3d')]};var _0x259050=md5(JSON[_0x5382('0x3e')](_0x371dbf));if(this['md5']!==_0x259050){this[_0x5382('0x2')]=_0x259050;io[_0x5382('0x3f')](_0x5382('0x40'),_0x371dbf);}};module['exports']=Agent; \ No newline at end of file +var _0xa5cb=['moment','md5','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','format','openchannelPause','chatCapacity','faxStatusTime','openchannelStatusTime','openchannelCurrentCapacity','busyQueue','emit','user:save','exports','lodash'];(function(_0x514833,_0x4f691e){var _0x1879fb=function(_0x1d382a){while(--_0x1d382a){_0x514833['push'](_0x514833['shift']());}};_0x1879fb(++_0x4f691e);}(_0xa5cb,0x7f));var _0xba5c=function(_0x1337c9,_0x5e2f5d){_0x1337c9=_0x1337c9-0x0;var _0x22bb89=_0xa5cb[_0x1337c9];return _0x22bb89;};'use strict';var _=require(_0xba5c('0x0'));var moment=require(_0xba5c('0x1'));var md5=require(_0xba5c('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xba5c('0x3')](config[_0xba5c('0x4')],{'host':_0xba5c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xba5c('0x4')]));function Agent(_0x1bb37f){this['id']=_0x1bb37f['id']||0x0;this[_0xba5c('0x6')]=_0x1bb37f[_0xba5c('0x6')]||'';this[_0xba5c('0x7')]=_0x1bb37f[_0xba5c('0x7')]||!![];this[_0xba5c('0x8')]=_0x1bb37f[_0xba5c('0x8')]||![];this['chatPause']=_0x1bb37f[_0xba5c('0x9')]||![];this[_0xba5c('0xa')]=_0x1bb37f[_0xba5c('0xa')]||![];this['faxPause']=_0x1bb37f[_0xba5c('0xb')]||![];this['smsPause']=_0x1bb37f[_0xba5c('0xc')]||![];this['openchannelPause']=_0x1bb37f['openchannelPause']||![];this[_0xba5c('0xd')]=_0xba5c('0xe');this[_0xba5c('0xf')]=0x0;this['chatCapacity']=_0x1bb37f['chatCapacity']||0x0;this[_0xba5c('0x10')]=0x0;this[_0xba5c('0x11')]=_0xba5c('0xe');this[_0xba5c('0x12')]=0x0;this[_0xba5c('0x13')]=_0x1bb37f['mailCapacity']||0x0;this[_0xba5c('0x14')]=0x0;this[_0xba5c('0x15')]=_0xba5c('0xe');this['faxStatusTime']=0x0;this['faxCapacity']=_0x1bb37f[_0xba5c('0x16')]||0x0;this[_0xba5c('0x17')]=0x0;this[_0xba5c('0x18')]=_0xba5c('0xe');this[_0xba5c('0x19')]=0x0;this[_0xba5c('0x1a')]=_0x1bb37f[_0xba5c('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xba5c('0x1b')]=_0xba5c('0xe');this['whatsappStatusTime']=0x0;this[_0xba5c('0x1c')]=_0x1bb37f[_0xba5c('0x1c')]||0x0;this[_0xba5c('0x1d')]=0x0;this[_0xba5c('0x1e')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1bb37f[_0xba5c('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xba5c('0x20')]=![];this['busyQueue']=undefined;this[_0xba5c('0x2')]='';this[_0xba5c('0x21')]={};this[_0xba5c('0x22')]={};this[_0xba5c('0x23')]={};this[_0xba5c('0x24')]={};this[_0xba5c('0x25')]={};this[_0xba5c('0x26')]={};this['updateRealtime']();}Agent[_0xba5c('0x27')][_0xba5c('0x28')]=function(_0x160181){if(this[_0x160181+_0xba5c('0x29')]>0x0){if(this[_0x160181+_0xba5c('0x2a')]>0x0&&this[_0x160181+_0xba5c('0x29')]>=this[_0x160181+_0xba5c('0x2a')]){return'maxcapacity';}else{return _0xba5c('0x2b');}}else{return _0xba5c('0x2c');}};Agent[_0xba5c('0x27')]['updateRealtime']=function(){var _0x3e55e7=[_0xba5c('0x2d'),_0xba5c('0x2e'),_0xba5c('0x2f'),_0xba5c('0x30'),_0xba5c('0x31'),_0xba5c('0x32')];for(var _0x527b66=0x0;_0x527b66<_0x3e55e7[_0xba5c('0x33')];_0x527b66+=0x1){var _0x49adaa=this['getChannelStatus'](_0x3e55e7[_0x527b66]);if(this[_0x3e55e7[_0x527b66]+_0xba5c('0x34')]!==_0x49adaa){this[_0x3e55e7[_0x527b66]+_0xba5c('0x35')]=_['toNumber'](moment()[_0xba5c('0x36')]('x'));}this[_0x3e55e7[_0x527b66]+_0xba5c('0x34')]=_0x49adaa;}var _0x102edc={'id':this['id'],'name':this[_0xba5c('0x6')],'online':this['online'],'voicePause':this[_0xba5c('0x8')],'chatPause':this[_0xba5c('0x9')],'mailPause':this[_0xba5c('0xa')],'smsPause':this[_0xba5c('0xc')],'faxPause':this[_0xba5c('0xb')],'openchannelPause':this[_0xba5c('0x37')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xba5c('0xf')],'chatCapacity':this[_0xba5c('0x38')],'chatCurrentCapacity':this[_0xba5c('0x10')],'mailStatus':this[_0xba5c('0x11')],'mailStatusTime':this[_0xba5c('0x12')],'mailCapacity':this[_0xba5c('0x13')],'mailCurrentCapacity':this[_0xba5c('0x14')],'faxStatus':this[_0xba5c('0x15')],'faxStatusTime':this[_0xba5c('0x39')],'faxCapacity':this[_0xba5c('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xba5c('0x18')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xba5c('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xba5c('0x1b')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xba5c('0x1c')],'whatsappCurrentCapacity':this[_0xba5c('0x1d')],'openchannelStatus':this[_0xba5c('0x1e')],'openchannelStatusTime':this[_0xba5c('0x3a')],'openchannelCapacity':this[_0xba5c('0x1f')],'openchannelCurrentCapacity':this[_0xba5c('0x3b')],'busy':this['busy'],'busyQueue':this[_0xba5c('0x3c')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0xba5c('0x22')],'mailWaitingInteractions':this[_0xba5c('0x23')],'openchannelWaitingInteractions':this[_0xba5c('0x24')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xba5c('0x26')]};var _0x509a64=md5(JSON['stringify'](_0x102edc));if(this[_0xba5c('0x2')]!==_0x509a64){this[_0xba5c('0x2')]=_0x509a64;io[_0xba5c('0x3d')](_0xba5c('0x3e'),_0x102edc);}};module[_0xba5c('0x3f')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index c53d48b..dbee36a 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 _0x46bb=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','length','online','chatPause','paused','available','stringify','emit','chat_queue:save','exports'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x46bb,0xcb));var _0xb46b=function(_0x433e29,_0x14b418){_0x433e29=_0x433e29-0x0;var _0x84abd4=_0x46bb[_0x433e29];return _0x84abd4;};'use strict';var _=require(_0xb46b('0x0'));var md5=require(_0xb46b('0x1'));var util=require(_0xb46b('0x2'));var Redis=require(_0xb46b('0x3'));var config=require(_0xb46b('0x4'));config[_0xb46b('0x5')]=_['defaults'](config[_0xb46b('0x5')],{'host':_0xb46b('0x6'),'port':0x18eb});var io=require(_0xb46b('0x7'))(new Redis(config['redis']));function ChatQueue(_0x1baf94){this['id']=_0x1baf94['id']||0x0;this[_0xb46b('0x8')]=_0x1baf94[_0xb46b('0x8')]||'';this[_0xb46b('0x9')]=_0x1baf94[_0xb46b('0x9')]||0xa;this[_0xb46b('0xa')]=_0x1baf94[_0xb46b('0xa')]||_0xb46b('0xb');this[_0xb46b('0xc')]=_0x1baf94['Agents'];this['mapAgentsId']={};this[_0xb46b('0xd')]=0x0;this[_0xb46b('0x1')]='';this['updateRouting']();this[_0xb46b('0xe')]();}ChatQueue[_0xb46b('0xf')][_0xb46b('0x10')]=function(){var _0x272b9b=this[_0xb46b('0x11')][_0xb46b('0x12')];this['mapAgentsId']=_['map'](this[_0xb46b('0xc')],'id');this[_0xb46b('0x11')][_0xb46b('0x12')]=_0x272b9b;};ChatQueue[_0xb46b('0xf')][_0xb46b('0xe')]=function(){this[_0xb46b('0x13')]=0x0;this['paused']=0x0;for(var _0x4390a0=0x0;_0x4390a0=0x0?this[_0xb46b('0x18')]:0x0;var _0x466016={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb46b('0x13')],'name':this[_0xb46b('0x8')],'paused':this[_0xb46b('0x17')],'waiting':this[_0xb46b('0xd')]};var _0x337eb2=md5(JSON[_0xb46b('0x19')](_0x466016));if(this[_0xb46b('0x1')]!==_0x337eb2){this[_0xb46b('0x1')]=_0x337eb2;io['to'](util['format']('chat:queue:%s',_0x466016[_0xb46b('0x8')]))[_0xb46b('0x1a')](_0xb46b('0x1b'),_0x466016);}};module[_0xb46b('0x1c')]=ChatQueue; \ No newline at end of file +var _0x3af0=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3af0,0xc3));var _0x03af=function(_0x3af373,_0x595e02){_0x3af373=_0x3af373-0x0;var _0x26da35=_0x3af0[_0x3af373];return _0x26da35;};'use strict';var _=require(_0x03af('0x0'));var md5=require(_0x03af('0x1'));var util=require(_0x03af('0x2'));var Redis=require(_0x03af('0x3'));var config=require(_0x03af('0x4'));config[_0x03af('0x5')]=_['defaults'](config[_0x03af('0x5')],{'host':_0x03af('0x6'),'port':0x18eb});var io=require(_0x03af('0x7'))(new Redis(config[_0x03af('0x5')]));function ChatQueue(_0x166abf){this['id']=_0x166abf['id']||0x0;this[_0x03af('0x8')]=_0x166abf['name']||'';this[_0x03af('0x9')]=_0x166abf[_0x03af('0x9')]||0xa;this[_0x03af('0xa')]=_0x166abf[_0x03af('0xa')]||_0x03af('0xb');this[_0x03af('0xc')]=_0x166abf['Agents'];this[_0x03af('0xd')]={};this[_0x03af('0xe')]=0x0;this[_0x03af('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x03af('0xf')][_0x03af('0x10')]=function(){var _0x4039c2=this[_0x03af('0xd')][_0x03af('0x11')];this[_0x03af('0xd')]=_['map'](this[_0x03af('0xc')],'id');this['mapAgentsId'][_0x03af('0x11')]=_0x4039c2;};ChatQueue[_0x03af('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x03af('0x12')]=0x0;for(var _0x9652b4=0x0;_0x9652b4=0x0?this[_0x03af('0x17')]:0x0;var _0x5dc8cb={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x03af('0x12')],'waiting':this['waiting']};var _0x1c6533=md5(JSON[_0x03af('0x18')](_0x5dc8cb));if(this[_0x03af('0x1')]!==_0x1c6533){this[_0x03af('0x1')]=_0x1c6533;io['to'](util[_0x03af('0x19')](_0x03af('0x1a'),_0x5dc8cb[_0x03af('0x8')]))[_0x03af('0x1b')]('chat_queue:save',_0x5dc8cb);}};module[_0x03af('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 90425ec..b01fe7d 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 _0x7f30=['defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','emit','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis'];(function(_0x528374,_0x4d144a){var _0x32ac51=function(_0x5870b2){while(--_0x5870b2){_0x528374['push'](_0x528374['shift']());}};_0x32ac51(++_0x4d144a);}(_0x7f30,0x1c6));var _0x07f3=function(_0x2045bb,_0x179e9f){_0x2045bb=_0x2045bb-0x0;var _0x538df8=_0x7f30[_0x2045bb];return _0x538df8;};'use strict';var _=require(_0x07f3('0x0'));var md5=require(_0x07f3('0x1'));var util=require('util');var Redis=require(_0x07f3('0x2'));var config=require(_0x07f3('0x3'));config[_0x07f3('0x4')]=_[_0x07f3('0x5')](config['redis'],{'host':_0x07f3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x2d33bb){this['id']=_0x2d33bb['id']||0x0;this[_0x07f3('0x7')]=_0x2d33bb[_0x07f3('0x7')]||'';this[_0x07f3('0x8')]=_0x2d33bb[_0x07f3('0x8')]||0xa;this['strategy']=_0x2d33bb[_0x07f3('0x9')]||'beepall';this['Agents']=_0x2d33bb[_0x07f3('0xa')];this[_0x07f3('0xb')]={};this[_0x07f3('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x07f3('0xd')][_0x07f3('0xe')]=function(){var _0x254583=this[_0x07f3('0xb')][_0x07f3('0xf')];this[_0x07f3('0xb')]=_[_0x07f3('0x10')](this[_0x07f3('0xa')],'id');this[_0x07f3('0xb')]['_rr']=_0x254583;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x07f3('0x11')]=0x0;this[_0x07f3('0x12')]=0x0;for(var _0xbff3e3=0x0;_0xbff3e3=0x0?this[_0x07f3('0x16')]:0x0;var _0x3801b3={'id':this['id'],'available':this['available'],'loggedIn':this[_0x07f3('0x11')],'name':this[_0x07f3('0x7')],'paused':this[_0x07f3('0x12')],'waiting':this['waiting']};var _0xac79c3=md5(JSON[_0x07f3('0x17')](_0x3801b3));if(this[_0x07f3('0x1')]!==_0xac79c3){this[_0x07f3('0x1')]=_0xac79c3;io['to'](util[_0x07f3('0x18')]('fax:queue:%s',_0x3801b3[_0x07f3('0x7')]))[_0x07f3('0x19')](_0x07f3('0x1a'),_0x3801b3);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x8e00=['_rr','map','updateRealtime','loggedIn','paused','length','faxPause','available','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype'];(function(_0x344c31,_0x60d141){var _0x3da7b5=function(_0x3a1265){while(--_0x3a1265){_0x344c31['push'](_0x344c31['shift']());}};_0x3da7b5(++_0x60d141);}(_0x8e00,0x111));var _0x08e0=function(_0x3836f6,_0x2849ef){_0x3836f6=_0x3836f6-0x0;var _0x34658b=_0x8e00[_0x3836f6];return _0x34658b;};'use strict';var _=require(_0x08e0('0x0'));var md5=require(_0x08e0('0x1'));var util=require(_0x08e0('0x2'));var Redis=require('ioredis');var config=require(_0x08e0('0x3'));config[_0x08e0('0x4')]=_[_0x08e0('0x5')](config[_0x08e0('0x4')],{'host':_0x08e0('0x6'),'port':0x18eb});var io=require(_0x08e0('0x7'))(new Redis(config[_0x08e0('0x4')]));function FaxQueue(_0x4adb9e){this['id']=_0x4adb9e['id']||0x0;this[_0x08e0('0x8')]=_0x4adb9e[_0x08e0('0x8')]||'';this[_0x08e0('0x9')]=_0x4adb9e['timeout']||0xa;this[_0x08e0('0xa')]=_0x4adb9e[_0x08e0('0xa')]||_0x08e0('0xb');this[_0x08e0('0xc')]=_0x4adb9e[_0x08e0('0xc')];this[_0x08e0('0xd')]={};this[_0x08e0('0xe')]=0x0;this[_0x08e0('0x1')]='';this[_0x08e0('0xf')]();this['updateRealtime']();}FaxQueue[_0x08e0('0x10')]['updateRouting']=function(){var _0x4280ae=this[_0x08e0('0xd')][_0x08e0('0x11')];this['mapAgentsId']=_[_0x08e0('0x12')](this[_0x08e0('0xc')],'id');this[_0x08e0('0xd')][_0x08e0('0x11')]=_0x4280ae;};FaxQueue[_0x08e0('0x10')][_0x08e0('0x13')]=function(){this[_0x08e0('0x14')]=0x0;this[_0x08e0('0x15')]=0x0;for(var _0x12624e=0x0;_0x12624e=0x0?this[_0x08e0('0x18')]:0x0;var _0xada6a3={'id':this['id'],'available':this[_0x08e0('0x18')],'loggedIn':this[_0x08e0('0x14')],'name':this[_0x08e0('0x8')],'paused':this[_0x08e0('0x15')],'waiting':this[_0x08e0('0xe')]};var _0x3f7f53=md5(JSON['stringify'](_0xada6a3));if(this[_0x08e0('0x1')]!==_0x3f7f53){this[_0x08e0('0x1')]=_0x3f7f53;io['to'](util[_0x08e0('0x19')](_0x08e0('0x1a'),_0xada6a3[_0x08e0('0x8')]))['emit'](_0x08e0('0x1b'),_0xada6a3);}};module[_0x08e0('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 41de484..08409a8 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 _0xeb52=['exports','name','Intervals'];(function(_0x392efb,_0x1d4eae){var _0x352f78=function(_0x2d9bd3){while(--_0x2d9bd3){_0x392efb['push'](_0x392efb['shift']());}};_0x352f78(++_0x1d4eae);}(_0xeb52,0x94));var _0x2eb5=function(_0x1b8271,_0x2aa365){_0x1b8271=_0x1b8271-0x0;var _0x88a92b=_0xeb52[_0x1b8271];return _0x88a92b;};'use strict';function Interval(_0x4f6ba0){this['id']=_0x4f6ba0['id']||0x0;this[_0x2eb5('0x0')]=_0x4f6ba0[_0x2eb5('0x0')]||'';this[_0x2eb5('0x1')]=_0x4f6ba0[_0x2eb5('0x1')]||{};}module[_0x2eb5('0x2')]=Interval; \ No newline at end of file +var _0x8250=['name','Intervals','exports'];(function(_0x482ae9,_0x343272){var _0x2e5db9=function(_0x1e832d){while(--_0x1e832d){_0x482ae9['push'](_0x482ae9['shift']());}};_0x2e5db9(++_0x343272);}(_0x8250,0x18c));var _0x0825=function(_0x4ea00a,_0xf189bb){_0x4ea00a=_0x4ea00a-0x0;var _0x2255fb=_0x8250[_0x4ea00a];return _0x2255fb;};'use strict';function Interval(_0x229a86){this['id']=_0x229a86['id']||0x0;this[_0x0825('0x0')]=_0x229a86['name']||'';this['Intervals']=_0x229a86[_0x0825('0x1')]||{};}module[_0x0825('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 9527b9e..4bc3aeb 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 _0x96ed=['updateRouting','map','loggedIn','length','online','mailPause','paused','available','stringify','emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRealtime','prototype'];(function(_0x510843,_0x183d15){var _0x5b8574=function(_0x2bf088){while(--_0x2bf088){_0x510843['push'](_0x510843['shift']());}};_0x5b8574(++_0x183d15);}(_0x96ed,0xc1));var _0xd96e=function(_0xf56cb,_0x4a1d46){_0xf56cb=_0xf56cb-0x0;var _0x29708a=_0x96ed[_0xf56cb];return _0x29708a;};'use strict';var _=require(_0xd96e('0x0'));var md5=require(_0xd96e('0x1'));var util=require(_0xd96e('0x2'));var Redis=require(_0xd96e('0x3'));var config=require('../../../config/environment');config[_0xd96e('0x4')]=_[_0xd96e('0x5')](config['redis'],{'host':_0xd96e('0x6'),'port':0x18eb});var io=require(_0xd96e('0x7'))(new Redis(config['redis']));function MailQueue(_0x5298af){this['id']=_0x5298af['id']||0x0;this[_0xd96e('0x8')]=_0x5298af[_0xd96e('0x8')]||'';this[_0xd96e('0x9')]=_0x5298af[_0xd96e('0x9')]||0xa;this[_0xd96e('0xa')]=_0x5298af['strategy']||'beepall';this[_0xd96e('0xb')]=_0x5298af[_0xd96e('0xb')];this[_0xd96e('0xc')]={};this['waiting']=0x0;this[_0xd96e('0x1')]='';this['updateRouting']();this[_0xd96e('0xd')]();}MailQueue[_0xd96e('0xe')][_0xd96e('0xf')]=function(){var _0x1031ae=this[_0xd96e('0xc')]['_rr'];this[_0xd96e('0xc')]=_[_0xd96e('0x10')](this[_0xd96e('0xb')],'id');this['mapAgentsId']['_rr']=_0x1031ae;};MailQueue[_0xd96e('0xe')][_0xd96e('0xd')]=function(){this[_0xd96e('0x11')]=0x0;this['paused']=0x0;for(var _0x333856=0x0;_0x333856=0x0?this[_0xd96e('0x16')]:0x0;var _0x16a88d={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd96e('0x11')],'name':this['name'],'paused':this[_0xd96e('0x15')],'waiting':this['waiting']};var _0x4d2fa6=md5(JSON[_0xd96e('0x17')](_0x16a88d));if(this[_0xd96e('0x1')]!==_0x4d2fa6){this[_0xd96e('0x1')]=_0x4d2fa6;io['to'](util['format']('mail:queue:%s',_0x16a88d[_0xd96e('0x8')]))[_0xd96e('0x18')]('mail_queue:save',_0x16a88d);}};module[_0xd96e('0x19')]=MailQueue; \ No newline at end of file +var _0x0784=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x53c4a9,_0x24c134){var _0x4272d4=function(_0x43a242){while(--_0x43a242){_0x53c4a9['push'](_0x53c4a9['shift']());}};_0x4272d4(++_0x24c134);}(_0x0784,0x191));var _0x4078=function(_0x35e461,_0x5de72d){_0x35e461=_0x35e461-0x0;var _0x4ef9cc=_0x0784[_0x35e461];return _0x4ef9cc;};'use strict';var _=require(_0x4078('0x0'));var md5=require(_0x4078('0x1'));var util=require(_0x4078('0x2'));var Redis=require(_0x4078('0x3'));var config=require(_0x4078('0x4'));config[_0x4078('0x5')]=_[_0x4078('0x6')](config['redis'],{'host':_0x4078('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4078('0x5')]));function MailQueue(_0x290cbe){this['id']=_0x290cbe['id']||0x0;this['name']=_0x290cbe[_0x4078('0x8')]||'';this[_0x4078('0x9')]=_0x290cbe[_0x4078('0x9')]||0xa;this['strategy']=_0x290cbe[_0x4078('0xa')]||_0x4078('0xb');this[_0x4078('0xc')]=_0x290cbe['Agents'];this[_0x4078('0xd')]={};this[_0x4078('0xe')]=0x0;this[_0x4078('0x1')]='';this['updateRouting']();this[_0x4078('0xf')]();}MailQueue[_0x4078('0x10')][_0x4078('0x11')]=function(){var _0x2aafda=this[_0x4078('0xd')][_0x4078('0x12')];this[_0x4078('0xd')]=_['map'](this[_0x4078('0xc')],'id');this[_0x4078('0xd')][_0x4078('0x12')]=_0x2aafda;};MailQueue[_0x4078('0x10')]['updateRealtime']=function(){this[_0x4078('0x13')]=0x0;this[_0x4078('0x14')]=0x0;for(var _0x50b81a=0x0;_0x50b81a=0x0?this[_0x4078('0x17')]:0x0;var _0x5003f7={'id':this['id'],'available':this[_0x4078('0x17')],'loggedIn':this[_0x4078('0x13')],'name':this[_0x4078('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x1507d2=md5(JSON[_0x4078('0x18')](_0x5003f7));if(this['md5']!==_0x1507d2){this[_0x4078('0x1')]=_0x1507d2;io['to'](util[_0x4078('0x19')](_0x4078('0x1a'),_0x5003f7['name']))[_0x4078('0x1b')](_0x4078('0x1c'),_0x5003f7);}};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 d41b9db..e5b3f16 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x2815f7,_0x3ae3a4){var _0x55ed85=function(_0x3d4503){while(--_0x3d4503){_0x2815f7['push'](_0x2815f7['shift']());}};_0x55ed85(++_0x3ae3a4);}(_0x814b,0x1a2));var _0xb814=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x814b[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x326f,0xd1));var _0xf326=function(_0x24a03c,_0xb05842){_0x24a03c=_0x24a03c-0x0;var _0x58365b=_0x326f[_0x24a03c];return _0x58365b;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 02d583e..fd07b06 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 _0x2121=['format','sms:queue:%s','sms_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify'];(function(_0x2d60d3,_0x344066){var _0x333608=function(_0x2e3385){while(--_0x2e3385){_0x2d60d3['push'](_0x2d60d3['shift']());}};_0x333608(++_0x344066);}(_0x2121,0x1b4));var _0x1212=function(_0x5b86c8,_0xc9eeba){_0x5b86c8=_0x5b86c8-0x0;var _0x16c10a=_0x2121[_0x5b86c8];return _0x16c10a;};'use strict';var _=require(_0x1212('0x0'));var md5=require(_0x1212('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x1212('0x2'));config[_0x1212('0x3')]=_[_0x1212('0x4')](config[_0x1212('0x3')],{'host':_0x1212('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1212('0x3')]));function SmsQueue(_0x4c8877){this['id']=_0x4c8877['id']||0x0;this[_0x1212('0x6')]=_0x4c8877[_0x1212('0x6')]||'';this[_0x1212('0x7')]=_0x4c8877[_0x1212('0x7')]||0xa;this[_0x1212('0x8')]=_0x4c8877[_0x1212('0x8')]||'beepall';this[_0x1212('0x9')]=_0x4c8877[_0x1212('0x9')];this[_0x1212('0xa')]={};this[_0x1212('0xb')]=0x0;this[_0x1212('0x1')]='';this[_0x1212('0xc')]();this['updateRealtime']();}SmsQueue['prototype'][_0x1212('0xc')]=function(){var _0x2109ee=this[_0x1212('0xa')][_0x1212('0xd')];this['mapAgentsId']=_[_0x1212('0xe')](this[_0x1212('0x9')],'id');this[_0x1212('0xa')][_0x1212('0xd')]=_0x2109ee;};SmsQueue[_0x1212('0xf')][_0x1212('0x10')]=function(){this[_0x1212('0x11')]=0x0;this[_0x1212('0x12')]=0x0;for(var _0x469cf6=0x0;_0x469cf6=0x0?this[_0x1212('0x15')]:0x0;var _0x3face0={'id':this['id'],'available':this[_0x1212('0x15')],'loggedIn':this[_0x1212('0x11')],'name':this[_0x1212('0x6')],'paused':this['paused'],'waiting':this[_0x1212('0xb')]};var _0x1333ec=md5(JSON[_0x1212('0x16')](_0x3face0));if(this[_0x1212('0x1')]!==_0x1333ec){this[_0x1212('0x1')]=_0x1333ec;io['to'](util[_0x1212('0x17')](_0x1212('0x18'),_0x3face0[_0x1212('0x6')]))['emit'](_0x1212('0x19'),_0x3face0);}};module[_0x1212('0x1a')]=SmsQueue; \ No newline at end of file +var _0x1cc7=['online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','updateRealtime','loggedIn','paused'];(function(_0x2ed868,_0x4ff127){var _0x53012c=function(_0x1fe3a9){while(--_0x1fe3a9){_0x2ed868['push'](_0x2ed868['shift']());}};_0x53012c(++_0x4ff127);}(_0x1cc7,0x15a));var _0x71cc=function(_0x4ad4ee,_0x4e1ab7){_0x4ad4ee=_0x4ad4ee-0x0;var _0x10a6f=_0x1cc7[_0x4ad4ee];return _0x10a6f;};'use strict';var _=require(_0x71cc('0x0'));var md5=require(_0x71cc('0x1'));var util=require(_0x71cc('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x71cc('0x3')](config[_0x71cc('0x4')],{'host':_0x71cc('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x47ec3b){this['id']=_0x47ec3b['id']||0x0;this[_0x71cc('0x6')]=_0x47ec3b['name']||'';this[_0x71cc('0x7')]=_0x47ec3b[_0x71cc('0x7')]||0xa;this[_0x71cc('0x8')]=_0x47ec3b[_0x71cc('0x8')]||_0x71cc('0x9');this['Agents']=_0x47ec3b[_0x71cc('0xa')];this[_0x71cc('0xb')]={};this[_0x71cc('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}SmsQueue['prototype'][_0x71cc('0xd')]=function(){var _0x2db190=this[_0x71cc('0xb')]['_rr'];this[_0x71cc('0xb')]=_['map'](this[_0x71cc('0xa')],'id');this['mapAgentsId'][_0x71cc('0xe')]=_0x2db190;};SmsQueue['prototype'][_0x71cc('0xf')]=function(){this[_0x71cc('0x10')]=0x0;this[_0x71cc('0x11')]=0x0;for(var _0xd16032=0x0;_0xd16032=0x0?this[_0x71cc('0x14')]:0x0;var _0x1067be={'id':this['id'],'available':this[_0x71cc('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x71cc('0x6')],'paused':this[_0x71cc('0x11')],'waiting':this['waiting']};var _0x550ce7=md5(JSON[_0x71cc('0x15')](_0x1067be));if(this[_0x71cc('0x1')]!==_0x550ce7){this[_0x71cc('0x1')]=_0x550ce7;io['to'](util[_0x71cc('0x16')](_0x71cc('0x17'),_0x1067be[_0x71cc('0x6')]))[_0x71cc('0x18')](_0x71cc('0x19'),_0x1067be);}};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 cd9c7e1..a8e422b 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 _0x4586=['md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','whatsappPause','available','name','stringify','format','emit','exports','lodash','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x3fd49d,_0x239770){var _0x1e0148=function(_0x540f8e){while(--_0x540f8e){_0x3fd49d['push'](_0x3fd49d['shift']());}};_0x1e0148(++_0x239770);}(_0x4586,0x199));var _0x6458=function(_0x2bbe8d,_0x5156c2){_0x2bbe8d=_0x2bbe8d-0x0;var _0x539e7a=_0x4586[_0x2bbe8d];return _0x539e7a;};'use strict';var _=require(_0x6458('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x6458('0x1'));var config=require(_0x6458('0x2'));config['redis']=_[_0x6458('0x3')](config[_0x6458('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6458('0x5'))(new Redis(config[_0x6458('0x4')]));function WhatsappQueue(_0x385c7c){this['id']=_0x385c7c['id']||0x0;this['name']=_0x385c7c['name']||'';this[_0x6458('0x6')]=_0x385c7c[_0x6458('0x6')]||0xa;this[_0x6458('0x7')]=_0x385c7c[_0x6458('0x7')]||'beepall';this[_0x6458('0x8')]=_0x385c7c['Agents'];this[_0x6458('0x9')]={};this[_0x6458('0xa')]=0x0;this[_0x6458('0xb')]='';this[_0x6458('0xc')]();this[_0x6458('0xd')]();}WhatsappQueue[_0x6458('0xe')][_0x6458('0xc')]=function(){var _0x3538a1=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x6458('0xf')](this['Agents'],'id');this[_0x6458('0x9')][_0x6458('0x10')]=_0x3538a1;};WhatsappQueue[_0x6458('0xe')]['updateRealtime']=function(){this[_0x6458('0x11')]=0x0;this[_0x6458('0x12')]=0x0;for(var _0x2be06b=0x0;_0x2be06b=0x0?this[_0x6458('0x16')]:0x0;var _0x2ece50={'id':this['id'],'available':this[_0x6458('0x16')],'loggedIn':this[_0x6458('0x11')],'name':this[_0x6458('0x17')],'paused':this[_0x6458('0x12')],'waiting':this[_0x6458('0xa')]};var _0x2b8d43=md5(JSON[_0x6458('0x18')](_0x2ece50));if(this[_0x6458('0xb')]!==_0x2b8d43){this['md5']=_0x2b8d43;io['to'](util[_0x6458('0x19')]('whatsapp:queue:%s',_0x2ece50[_0x6458('0x17')]))[_0x6458('0x1a')]('whatsapp_queue:save',_0x2ece50);}};module[_0x6458('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xadcb=['online','whatsappPause','available','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','name','timeout','strategy','Agents','md5','updateRealtime','prototype','mapAgentsId','loggedIn','paused','length'];(function(_0x16e06f,_0x583996){var _0x268731=function(_0x38a2f8){while(--_0x38a2f8){_0x16e06f['push'](_0x16e06f['shift']());}};_0x268731(++_0x583996);}(_0xadcb,0xdf));var _0xbadc=function(_0x11ee79,_0x2dd80f){_0x11ee79=_0x11ee79-0x0;var _0x1daf36=_0xadcb[_0x11ee79];return _0x1daf36;};'use strict';var _=require(_0xbadc('0x0'));var md5=require('md5');var util=require(_0xbadc('0x1'));var Redis=require(_0xbadc('0x2'));var config=require('../../../config/environment');config[_0xbadc('0x3')]=_[_0xbadc('0x4')](config[_0xbadc('0x3')],{'host':_0xbadc('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbadc('0x3')]));function WhatsappQueue(_0x4b14d8){this['id']=_0x4b14d8['id']||0x0;this[_0xbadc('0x6')]=_0x4b14d8[_0xbadc('0x6')]||'';this['timeout']=_0x4b14d8[_0xbadc('0x7')]||0xa;this[_0xbadc('0x8')]=_0x4b14d8[_0xbadc('0x8')]||'beepall';this[_0xbadc('0x9')]=_0x4b14d8['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xbadc('0xa')]='';this['updateRouting']();this[_0xbadc('0xb')]();}WhatsappQueue[_0xbadc('0xc')]['updateRouting']=function(){var _0x3f21c6=this[_0xbadc('0xd')]['_rr'];this[_0xbadc('0xd')]=_['map'](this[_0xbadc('0x9')],'id');this['mapAgentsId']['_rr']=_0x3f21c6;};WhatsappQueue[_0xbadc('0xc')][_0xbadc('0xb')]=function(){this[_0xbadc('0xe')]=0x0;this[_0xbadc('0xf')]=0x0;for(var _0x40c636=0x0;_0x40c636=0x0?this[_0xbadc('0x13')]:0x0;var _0x193fee={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbadc('0xe')],'name':this[_0xbadc('0x6')],'paused':this[_0xbadc('0xf')],'waiting':this['waiting']};var _0x2912fa=md5(JSON['stringify'](_0x193fee));if(this[_0xbadc('0xa')]!==_0x2912fa){this[_0xbadc('0xa')]=_0x2912fa;io['to'](util[_0xbadc('0x14')](_0xbadc('0x15'),_0x193fee[_0xbadc('0x6')]))['emit'](_0xbadc('0x16'),_0x193fee);}};module[_0xbadc('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 c0ea76e..da5a011 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(_0x3dff25,_0x56ad87){var _0x14529c=function(_0x301afe){while(--_0x301afe){_0x3dff25['push'](_0x3dff25['shift']());}};_0x14529c(++_0x56ad87);}(_0xb10b,0x12a));var _0xbb10=function(_0xd9caad,_0x5856b7){_0xd9caad=_0xd9caad-0x0;var _0x3127e6=_0xb10b[_0xd9caad];return _0x3127e6;};'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(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 f7dec17..26438d6 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 _0xc900=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x377751,_0x36ece3){var _0x562a61=function(_0x22df56){while(--_0x22df56){_0x377751['push'](_0x377751['shift']());}};_0x562a61(++_0x36ece3);}(_0xc900,0x115));var _0x0c90=function(_0x48e073,_0x1d0102){_0x48e073=_0x48e073-0x0;var _0x10d905=_0xc900[_0x48e073];return _0x10d905;};'use strict';var client=require(_0x0c90('0x0'));exports[_0x0c90('0x1')]=function(_0x27212c,_0x59ef49){return client[_0x0c90('0x2')]('UpdateChatInteraction',{'body':_0x59ef49,'options':{'where':{'id':_0x27212c}},'log':_0x0c90('0x3')});};exports[_0x0c90('0x4')]=function(_0x3f4825,_0x3e5415){return client[_0x0c90('0x2')](_0x0c90('0x5'),{'body':_0x3e5415,'options':{'where':{'id':_0x3f4825}},'log':_0x0c90('0x6')});}; \ No newline at end of file +var _0x1de9=['../client','UpdateChatInteraction','updateChatInteraction','Request','addTagsToChatInteraction'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x1de9,0x15e));var _0x91de=function(_0x4fd5b4,_0x1a06b7){_0x4fd5b4=_0x4fd5b4-0x0;var _0x48b09e=_0x1de9[_0x4fd5b4];return _0x48b09e;};'use strict';var client=require(_0x91de('0x0'));exports['update']=function(_0x14af7b,_0x4b9370){return client['Request'](_0x91de('0x1'),{'body':_0x4b9370,'options':{'where':{'id':_0x14af7b}},'log':_0x91de('0x2')});};exports['addTags']=function(_0x212121,_0x32c02b){return client[_0x91de('0x3')]('AddTagsToChatInteraction',{'body':_0x32c02b,'options':{'where':{'id':_0x212121}},'log':_0x91de('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d1fa0b6..eae82d0 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 _0x9b9b=['../client','create','Request','createChatMessage'];(function(_0x2ec43,_0x232f4a){var _0x46ae0e=function(_0x17a427){while(--_0x17a427){_0x2ec43['push'](_0x2ec43['shift']());}};_0x46ae0e(++_0x232f4a);}(_0x9b9b,0x1f0));var _0xb9b9=function(_0x3dfb56,_0xfe844d){_0x3dfb56=_0x3dfb56-0x0;var _0x5e6e1b=_0x9b9b[_0x3dfb56];return _0x5e6e1b;};'use strict';var client=require(_0xb9b9('0x0'));exports[_0xb9b9('0x1')]=function(_0x4a0cac){return client[_0xb9b9('0x2')]('CreateChatMessage',{'body':_0x4a0cac,'log':_0xb9b9('0x3')});}; \ No newline at end of file +var _0x1c60=['../client','create','Request'];(function(_0x4819b3,_0xdcbd21){var _0x31859b=function(_0x452d25){while(--_0x452d25){_0x4819b3['push'](_0x4819b3['shift']());}};_0x31859b(++_0xdcbd21);}(_0x1c60,0x189));var _0x01c6=function(_0x4e9f1a,_0x35e3f3){_0x4e9f1a=_0x4e9f1a-0x0;var _0x441f20=_0x1c60[_0x4e9f1a];return _0x441f20;};'use strict';var client=require(_0x01c6('0x0'));exports[_0x01c6('0x1')]=function(_0x37759d){return client[_0x01c6('0x2')]('CreateChatMessage',{'body':_0x37759d,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9887113..0188fe8 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 _0x383d=['name','strategy','User','Agents','online','chatPause','Request','GetChatQueue'];(function(_0x19fda5,_0x5e8790){var _0xa5851f=function(_0x331439){while(--_0x331439){_0x19fda5['push'](_0x19fda5['shift']());}};_0xa5851f(++_0x5e8790);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xd383('0x0')](_0xd383('0x1'),{'options':{'raw':![],'attributes':['id',_0xd383('0x2'),'timeout',_0xd383('0x3')],'include':[{'model':_0xd383('0x4'),'as':_0xd383('0x5'),'attributes':['id',_0xd383('0x2'),_0xd383('0x6'),_0xd383('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x5db2=['Agents','online','chatPause','../client','getChatQueues','Request','name','timeout','strategy','User'];(function(_0x4f3b4a,_0x339c3d){var _0x246569=function(_0x3e0dc9){while(--_0x3e0dc9){_0x4f3b4a['push'](_0x4f3b4a['shift']());}};_0x246569(++_0x339c3d);}(_0x5db2,0xf3));var _0x25db=function(_0x10c7e0,_0x484507){_0x10c7e0=_0x10c7e0-0x0;var _0x330990=_0x5db2[_0x10c7e0];return _0x330990;};'use strict';var client=require(_0x25db('0x0'));exports[_0x25db('0x1')]=function(){return function(){return client[_0x25db('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x25db('0x3'),_0x25db('0x4'),_0x25db('0x5')],'include':[{'model':_0x25db('0x6'),'as':_0x25db('0x7'),'attributes':['id',_0x25db('0x3'),_0x25db('0x8'),_0x25db('0x9')]}]},'log':_0x25db('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d280547..25d1888 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 _0x03bc=['Request','CreateChatQueueReport','UpdateChatQueueReport','DESC','../client'];(function(_0x17522f,_0x5a5780){var _0x3dd415=function(_0x178400){while(--_0x178400){_0x17522f['push'](_0x17522f['shift']());}};_0x3dd415(++_0x5a5780);}(_0x03bc,0xb8));var _0xc03b=function(_0x8f69fe,_0x4d3cd1){_0x8f69fe=_0x8f69fe-0x0;var _0x332075=_0x03bc[_0x8f69fe];return _0x332075;};'use strict';var client=require(_0xc03b('0x0'));exports['create']=function(_0x76b3a5){return client[_0xc03b('0x1')]('CreateChatQueueReport',{'body':_0x76b3a5,'log':_0xc03b('0x2')});};exports['update']=function(_0x175b18,_0x3b4181){return client[_0xc03b('0x1')](_0xc03b('0x3'),{'body':_0x3b4181,'options':{'where':{'uniqueid':_0x175b18},'order':[['id',_0xc03b('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x5d70=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x5d70,0x8d));var _0x05d7=function(_0x1edd5f,_0x343427){_0x1edd5f=_0x1edd5f-0x0;var _0x376f30=_0x5d70[_0x1edd5f];return _0x376f30;};'use strict';var client=require(_0x05d7('0x0'));exports[_0x05d7('0x1')]=function(_0x54771b){return client[_0x05d7('0x2')](_0x05d7('0x3'),{'body':_0x54771b,'log':_0x05d7('0x3')});};exports[_0x05d7('0x4')]=function(_0x43c0a7,_0x2a2455){return client['Request'](_0x05d7('0x5'),{'body':_0x2a2455,'options':{'where':{'uniqueid':_0x43c0a7},'order':[['id',_0x05d7('0x6')]],'limit':0x1},'log':_0x05d7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 4bc2fa3..a3be877 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x7a54,0x106));var _0x47a5=function(_0x44ccc5,_0xe05ba4){_0x44ccc5=_0x44ccc5-0x0;var _0x40b304=_0x7a54[_0x44ccc5];return _0x40b304;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5e8fc,_0x1ccc06){var _0x41c58c=function(_0x495f2c){while(--_0x495f2c){_0x5e8fc['push'](_0x5e8fc['shift']());}};_0x41c58c(++_0x1ccc06);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 78eb9f9..4a5580b 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 _0x51eb=['CreateFaxMessage','../client','Request'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x51eb,0xdc));var _0xb51e=function(_0x75a03,_0x3afd8b){_0x75a03=_0x75a03-0x0;var _0x49a877=_0x51eb[_0x75a03];return _0x49a877;};'use strict';var client=require(_0xb51e('0x0'));exports['create']=function(_0x2067c8){return client[_0xb51e('0x1')](_0xb51e('0x2'),{'body':_0x2067c8,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xa787=['Request','../client','create'];(function(_0xef5c49,_0x34ca7f){var _0x4bf091=function(_0x177c9d){while(--_0x177c9d){_0xef5c49['push'](_0xef5c49['shift']());}};_0x4bf091(++_0x34ca7f);}(_0xa787,0xf4));var _0x7a78=function(_0x11ffdd,_0x1e811d){_0x11ffdd=_0x11ffdd-0x0;var _0xdda87d=_0xa787[_0x11ffdd];return _0xdda87d;};'use strict';var client=require(_0x7a78('0x0'));exports[_0x7a78('0x1')]=function(_0x6529f3){return client[_0x7a78('0x2')]('CreateFaxMessage',{'body':_0x6529f3,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 0f1f597..960534e 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 _0xb60d=['strategy','User','Agents','online','faxPause','getFaxQueues','../client','Request','name','timeout'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xb60d,0xc4));var _0xdb60=function(_0x413bf1,_0x18c5e8){_0x413bf1=_0x413bf1-0x0;var _0x156cf3=_0xb60d[_0x413bf1];return _0x156cf3;};'use strict';var client=require(_0xdb60('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xdb60('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xdb60('0x2'),_0xdb60('0x3'),_0xdb60('0x4')],'include':[{'model':_0xdb60('0x5'),'as':_0xdb60('0x6'),'attributes':['id',_0xdb60('0x2'),_0xdb60('0x7'),_0xdb60('0x8')]}]},'log':_0xdb60('0x9')});};}; \ No newline at end of file +var _0xc77c=['GetFaxQueue','User','Agents','../client','getFaxQueues','Request'];(function(_0x406aa1,_0x3e15aa){var _0x3e90a0=function(_0x38f7a9){while(--_0x38f7a9){_0x406aa1['push'](_0x406aa1['shift']());}};_0x3e90a0(++_0x3e15aa);}(_0xc77c,0xc3));var _0xcc77=function(_0x3597d2,_0x4046df){_0x3597d2=_0x3597d2-0x0;var _0x87f797=_0xc77c[_0x3597d2];return _0x87f797;};'use strict';var client=require(_0xcc77('0x0'));exports[_0xcc77('0x1')]=function(){return function(){return client[_0xcc77('0x2')](_0xcc77('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xcc77('0x4'),'as':_0xcc77('0x5'),'attributes':['id','name','online','faxPause']}]},'log':_0xcc77('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index ddae9ed..74e74d8 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 _0x4511=['UpdateFaxQueueReport','DESC','../client','create','CreateFaxQueueReport','update'];(function(_0x7755f6,_0x34731a){var _0x208253=function(_0x54bd90){while(--_0x54bd90){_0x7755f6['push'](_0x7755f6['shift']());}};_0x208253(++_0x34731a);}(_0x4511,0x68));var _0x1451=function(_0x589b0c,_0x4a4225){_0x589b0c=_0x589b0c-0x0;var _0x2c4491=_0x4511[_0x589b0c];return _0x2c4491;};'use strict';var client=require(_0x1451('0x0'));exports[_0x1451('0x1')]=function(_0x27bc77){return client['Request'](_0x1451('0x2'),{'body':_0x27bc77,'log':_0x1451('0x2')});};exports[_0x1451('0x3')]=function(_0x281566,_0x53ed6b){return client['Request'](_0x1451('0x4'),{'body':_0x53ed6b,'options':{'where':{'uniqueid':_0x281566},'order':[['id',_0x1451('0x5')]],'limit':0x1},'log':_0x1451('0x4')});}; \ No newline at end of file +var _0xf2f5=['DESC','../client','Request','update','UpdateFaxQueueReport'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xf2f5,0xb0));var _0x5f2f=function(_0x2d67a5,_0x35bd1d){_0x2d67a5=_0x2d67a5-0x0;var _0x444b59=_0xf2f5[_0x2d67a5];return _0x444b59;};'use strict';var client=require(_0x5f2f('0x0'));exports['create']=function(_0x5886c1){return client[_0x5f2f('0x1')]('CreateFaxQueueReport',{'body':_0x5886c1,'log':'CreateFaxQueueReport'});};exports[_0x5f2f('0x2')]=function(_0x56f2b9,_0x25b421){return client['Request'](_0x5f2f('0x3'),{'body':_0x25b421,'options':{'where':{'uniqueid':_0x56f2b9},'order':[['id',_0x5f2f('0x4')]],'limit':0x1},'log':_0x5f2f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a1e6019..c90053d 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 _0x2e0f=['name','Intervals','interval','getIntervals','Request','GetInterval'];(function(_0x1256ca,_0x29a6c2){var _0x55fa8c=function(_0x5a173e){while(--_0x5a173e){_0x1256ca['push'](_0x1256ca['shift']());}};_0x55fa8c(++_0x29a6c2);}(_0x2e0f,0xa5));var _0xf2e0=function(_0x3b9722,_0xf95a84){_0x3b9722=_0x3b9722-0x0;var _0x16a2d5=_0x2e0f[_0x3b9722];return _0x16a2d5;};'use strict';var client=require('../client');exports[_0xf2e0('0x0')]=function(){return function(){return client[_0xf2e0('0x1')](_0xf2e0('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf2e0('0x3')],'include':[{'model':'Interval','as':_0xf2e0('0x4'),'attributes':['id',_0xf2e0('0x3'),_0xf2e0('0x5')]}]},'log':_0xf2e0('0x0')});};}; \ No newline at end of file +var _0x9cf5=['interval','../client','Request','GetInterval','name'];(function(_0x2b36c5,_0x1bc9c9){var _0x4108c3=function(_0x4422fa){while(--_0x4422fa){_0x2b36c5['push'](_0x2b36c5['shift']());}};_0x4108c3(++_0x1bc9c9);}(_0x9cf5,0xce));var _0x59cf=function(_0x2382a5,_0x40b318){_0x2382a5=_0x2382a5-0x0;var _0x26f7b7=_0x9cf5[_0x2382a5];return _0x26f7b7;};'use strict';var client=require(_0x59cf('0x0'));exports['getIntervals']=function(){return function(){return client[_0x59cf('0x1')](_0x59cf('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x59cf('0x3'),_0x59cf('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 962d374..f066f12 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 _0x3de3=['../client','UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction'];(function(_0x3c6afc,_0x48dc8d){var _0x48ae3b=function(_0x5bb0e4){while(--_0x5bb0e4){_0x3c6afc['push'](_0x3c6afc['shift']());}};_0x48ae3b(++_0x48dc8d);}(_0x3de3,0x1ce));var _0x33de=function(_0x256a10,_0x1ae83e){_0x256a10=_0x256a10-0x0;var _0x531a5f=_0x3de3[_0x256a10];return _0x531a5f;};'use strict';var client=require(_0x33de('0x0'));exports['update']=function(_0x19d1ba,_0x100783){return client['Request'](_0x33de('0x1'),{'body':_0x100783,'options':{'where':{'id':_0x19d1ba}},'log':_0x33de('0x2')});};exports[_0x33de('0x3')]=function(_0xbdd404,_0x56b413){return client[_0x33de('0x4')](_0x33de('0x5'),{'body':_0x56b413,'options':{'where':{'id':_0xbdd404}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd4a2=['UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x14d98f,_0x2ed9ed){var _0x5a8c93=function(_0x21482f){while(--_0x21482f){_0x14d98f['push'](_0x14d98f['shift']());}};_0x5a8c93(++_0x2ed9ed);}(_0xd4a2,0x173));var _0x2d4a=function(_0x4e5461,_0x50e065){_0x4e5461=_0x4e5461-0x0;var _0x9d9712=_0xd4a2[_0x4e5461];return _0x9d9712;};'use strict';var client=require(_0x2d4a('0x0'));exports['update']=function(_0x4e88a9,_0xfba415){return client['Request'](_0x2d4a('0x1'),{'body':_0xfba415,'options':{'where':{'id':_0x4e88a9}},'log':'updateMailInteraction'});};exports[_0x2d4a('0x2')]=function(_0x5d435a,_0x32af9e){return client[_0x2d4a('0x3')](_0x2d4a('0x4'),{'body':_0x32af9e,'options':{'where':{'id':_0x5d435a}},'log':_0x2d4a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 80be769..95ae95a 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 _0xf05f=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf05f,0x1e9));var _0xff05=function(_0x23d292,_0x5b148f){_0x23d292=_0x23d292-0x0;var _0x5ed2cd=_0xf05f[_0x23d292];return _0x5ed2cd;};'use strict';var client=require(_0xff05('0x0'));exports[_0xff05('0x1')]=function(_0x1bd994){return client[_0xff05('0x2')](_0xff05('0x3'),{'body':_0x1bd994,'log':_0xff05('0x4')});}; \ No newline at end of file +var _0x72d8=['../client','Request','CreateMailMessage'];(function(_0x269094,_0x4701b3){var _0x10344f=function(_0x180a69){while(--_0x180a69){_0x269094['push'](_0x269094['shift']());}};_0x10344f(++_0x4701b3);}(_0x72d8,0x1c8));var _0x872d=function(_0x1de8cc,_0x3e3f90){_0x1de8cc=_0x1de8cc-0x0;var _0x6f59fa=_0x72d8[_0x1de8cc];return _0x6f59fa;};'use strict';var client=require(_0x872d('0x0'));exports['create']=function(_0x3c8849){return client[_0x872d('0x1')](_0x872d('0x2'),{'body':_0x3c8849,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e256dba..077b6a6 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 _0x57d2=['Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','User'];(function(_0x1d2cf2,_0x4f6aad){var _0xe5f313=function(_0xd42d92){while(--_0xd42d92){_0x1d2cf2['push'](_0x1d2cf2['shift']());}};_0xe5f313(++_0x4f6aad);}(_0x57d2,0x185));var _0x257d=function(_0x41db5c,_0x3f2f67){_0x41db5c=_0x41db5c-0x0;var _0x32d7ce=_0x57d2[_0x41db5c];return _0x32d7ce;};'use strict';var client=require(_0x257d('0x0'));exports[_0x257d('0x1')]=function(){return function(){return client[_0x257d('0x2')](_0x257d('0x3'),{'options':{'raw':![],'attributes':['id',_0x257d('0x4'),_0x257d('0x5'),'strategy'],'include':[{'model':_0x257d('0x6'),'as':_0x257d('0x7'),'attributes':['id',_0x257d('0x4'),'online',_0x257d('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xc0bf=['GetMailQueue','timeout','strategy','User','Agents','online','mailPause','getMailQueues','Request'];(function(_0x2ebcbc,_0x40ff02){var _0x31d821=function(_0x337540){while(--_0x337540){_0x2ebcbc['push'](_0x2ebcbc['shift']());}};_0x31d821(++_0x40ff02);}(_0xc0bf,0xc4));var _0xfc0b=function(_0x28b13b,_0x105009){_0x28b13b=_0x28b13b-0x0;var _0x778a18=_0xc0bf[_0x28b13b];return _0x778a18;};'use strict';var client=require('../client');exports[_0xfc0b('0x0')]=function(){return function(){return client[_0xfc0b('0x1')](_0xfc0b('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xfc0b('0x3'),_0xfc0b('0x4')],'include':[{'model':_0xfc0b('0x5'),'as':_0xfc0b('0x6'),'attributes':['id','name',_0xfc0b('0x7'),_0xfc0b('0x8')]}]},'log':_0xfc0b('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 811050f..7891451 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 _0x95e9=['create','Request','CreateMailQueueReport','DESC','UpdateMailQueueReport','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95e9,0x15b));var _0x995e=function(_0x7929d8,_0x8be119){_0x7929d8=_0x7929d8-0x0;var _0x40ff94=_0x95e9[_0x7929d8];return _0x40ff94;};'use strict';var client=require(_0x995e('0x0'));exports[_0x995e('0x1')]=function(_0x2da3d3){return client[_0x995e('0x2')](_0x995e('0x3'),{'body':_0x2da3d3,'log':'CreateMailQueueReport'});};exports['update']=function(_0x4ee7f8,_0x4a344c){return client['Request']('UpdateMailQueueReport',{'body':_0x4a344c,'options':{'where':{'uniqueid':_0x4ee7f8},'order':[['id',_0x995e('0x4')]],'limit':0x1},'log':_0x995e('0x5')});}; \ No newline at end of file +var _0x570b=['update','UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x570b,0x6c));var _0xb570=function(_0x127250,_0x59b5da){_0x127250=_0x127250-0x0;var _0x6a1541=_0x570b[_0x127250];return _0x6a1541;};'use strict';var client=require(_0xb570('0x0'));exports[_0xb570('0x1')]=function(_0x1ce07c){return client[_0xb570('0x2')](_0xb570('0x3'),{'body':_0x1ce07c,'log':_0xb570('0x3')});};exports[_0xb570('0x4')]=function(_0x3806ee,_0x5ad8b8){return client[_0xb570('0x2')](_0xb570('0x5'),{'body':_0x5ad8b8,'options':{'where':{'uniqueid':_0x3806ee},'order':[['id',_0xb570('0x6')]],'limit':0x1},'log':_0xb570('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ddc72bb..0137831 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 _0xe25a=['update','Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x3df1a1,_0x51984e){var _0xbf54f5=function(_0x358eb3){while(--_0x358eb3){_0x3df1a1['push'](_0x3df1a1['shift']());}};_0xbf54f5(++_0x51984e);}(_0xe25a,0xf5));var _0xae25=function(_0xdf5a03,_0x3635db){_0xdf5a03=_0xdf5a03-0x0;var _0x538a95=_0xe25a[_0xdf5a03];return _0x538a95;};'use strict';var client=require(_0xae25('0x0'));exports[_0xae25('0x1')]=function(_0x53cbaa,_0x498152){return client[_0xae25('0x2')]('UpdateOpenchannelInteraction',{'body':_0x498152,'options':{'where':{'id':_0x53cbaa}},'log':_0xae25('0x3')});};exports['addTags']=function(_0x171107,_0x257fad){return client[_0xae25('0x2')](_0xae25('0x4'),{'body':_0x257fad,'options':{'where':{'id':_0x171107}},'log':_0xae25('0x5')});}; \ No newline at end of file +var _0xed84=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction'];(function(_0x2e6ef9,_0x4236ea){var _0x3adde0=function(_0x48ba29){while(--_0x48ba29){_0x2e6ef9['push'](_0x2e6ef9['shift']());}};_0x3adde0(++_0x4236ea);}(_0xed84,0xc4));var _0x4ed8=function(_0x21d2de,_0x16c66b){_0x21d2de=_0x21d2de-0x0;var _0x5f1067=_0xed84[_0x21d2de];return _0x5f1067;};'use strict';var client=require('../client');exports['update']=function(_0x5c6f10,_0x2ba149){return client[_0x4ed8('0x0')](_0x4ed8('0x1'),{'body':_0x2ba149,'options':{'where':{'id':_0x5c6f10}},'log':_0x4ed8('0x2')});};exports[_0x4ed8('0x3')]=function(_0x540ba3,_0x49b19b){return client[_0x4ed8('0x0')](_0x4ed8('0x4'),{'body':_0x49b19b,'options':{'where':{'id':_0x540ba3}},'log':_0x4ed8('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ebe44f8..c436413 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 _0xf577=['../client'];(function(_0x4bc90b,_0x3f7413){var _0x1b6b87=function(_0x189e05){while(--_0x189e05){_0x4bc90b['push'](_0x4bc90b['shift']());}};_0x1b6b87(++_0x3f7413);}(_0xf577,0x11e));var _0x7f57=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xf577[_0x4fbfd9];return _0x31dc94;};'use strict';var client=require(_0x7f57('0x0'));exports['create']=function(_0x286aaf){return client['Request']('CreateOpenchannelMessage',{'body':_0x286aaf,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x48d0=['create','Request','CreateOpenchannelMessage'];(function(_0x468dc6,_0xc12a04){var _0x7e4157=function(_0x5de21d){while(--_0x5de21d){_0x468dc6['push'](_0x468dc6['shift']());}};_0x7e4157(++_0xc12a04);}(_0x48d0,0xe7));var _0x048d=function(_0x5d0842,_0x3eea57){_0x5d0842=_0x5d0842-0x0;var _0x4783b5=_0x48d0[_0x5d0842];return _0x4783b5;};'use strict';var client=require('../client');exports[_0x048d('0x0')]=function(_0x6c0352){return client[_0x048d('0x1')](_0x048d('0x2'),{'body':_0x6c0352,'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 8743778..83639a4 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 _0x61e4=['User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','timeout','strategy'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x61e4,0x1ab));var _0x461e=function(_0x37dd7b,_0x29619d){_0x37dd7b=_0x37dd7b-0x0;var _0x548856=_0x61e4[_0x37dd7b];return _0x548856;};'use strict';var client=require(_0x461e('0x0'));exports[_0x461e('0x1')]=function(){return function(){return client['Request'](_0x461e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x461e('0x3'),_0x461e('0x4')],'include':[{'model':_0x461e('0x5'),'as':_0x461e('0x6'),'attributes':['id','name','online',_0x461e('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x4d07=['../client','getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause'];(function(_0x257276,_0x3efab4){var _0x309b51=function(_0x31f041){while(--_0x31f041){_0x257276['push'](_0x257276['shift']());}};_0x309b51(++_0x3efab4);}(_0x4d07,0x168));var _0x74d0=function(_0x324798,_0x32187b){_0x324798=_0x324798-0x0;var _0x4c8cc2=_0x4d07[_0x324798];return _0x4c8cc2;};'use strict';var client=require(_0x74d0('0x0'));exports[_0x74d0('0x1')]=function(){return function(){return client['Request'](_0x74d0('0x2'),{'options':{'raw':![],'attributes':['id',_0x74d0('0x3'),_0x74d0('0x4'),_0x74d0('0x5')],'include':[{'model':'User','as':_0x74d0('0x6'),'attributes':['id','name',_0x74d0('0x7'),_0x74d0('0x8')]}]},'log':_0x74d0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 12229ca..3fee5f4 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 _0xf29f=['UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update','DESC'];(function(_0x3b687d,_0x235878){var _0x47b66e=function(_0x1eabe4){while(--_0x1eabe4){_0x3b687d['push'](_0x3b687d['shift']());}};_0x47b66e(++_0x235878);}(_0xf29f,0x18d));var _0xff29=function(_0x4955be,_0x5d3110){_0x4955be=_0x4955be-0x0;var _0x4ba0a7=_0xf29f[_0x4955be];return _0x4ba0a7;};'use strict';var client=require('../client');exports[_0xff29('0x0')]=function(_0x3ba012){return client[_0xff29('0x1')]('CreateOpenchannelQueueReport',{'body':_0x3ba012,'log':_0xff29('0x2')});};exports[_0xff29('0x3')]=function(_0x4948c5,_0xeb0c24){return client[_0xff29('0x1')]('UpdateOpenchannelQueueReport',{'body':_0xeb0c24,'options':{'where':{'uniqueid':_0x4948c5},'order':[['id',_0xff29('0x4')]],'limit':0x1},'log':_0xff29('0x5')});}; \ No newline at end of file +var _0x72d1=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client'];(function(_0x511647,_0x30d69d){var _0x369bdc=function(_0x2fe161){while(--_0x2fe161){_0x511647['push'](_0x511647['shift']());}};_0x369bdc(++_0x30d69d);}(_0x72d1,0x18b));var _0x172d=function(_0x237c45,_0x55cf99){_0x237c45=_0x237c45-0x0;var _0x2942f6=_0x72d1[_0x237c45];return _0x2942f6;};'use strict';var client=require(_0x172d('0x0'));exports[_0x172d('0x1')]=function(_0x48100c){return client[_0x172d('0x2')](_0x172d('0x3'),{'body':_0x48100c,'log':_0x172d('0x3')});};exports[_0x172d('0x4')]=function(_0x318a34,_0x4532e0){return client['Request'](_0x172d('0x5'),{'body':_0x4532e0,'options':{'where':{'uniqueid':_0x318a34},'order':[['id','DESC']],'limit':0x1},'log':_0x172d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 8d86bb6..c37314f 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 _0x9879=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0x9879,0x98));var _0x9987=function(_0x422f90,_0x24e61){_0x422f90=_0x422f90-0x0;var _0x6088ec=_0x9879[_0x422f90];return _0x6088ec;};'use strict';var client=require(_0x9987('0x0'));exports[_0x9987('0x1')]=function(_0x44026e,_0x5681f5){return client[_0x9987('0x2')]('UpdateSmsInteraction',{'body':_0x5681f5,'options':{'where':{'id':_0x44026e}},'log':_0x9987('0x3')});};exports[_0x9987('0x4')]=function(_0x1fd45d,_0xcc5722){return client[_0x9987('0x2')](_0x9987('0x5'),{'body':_0xcc5722,'options':{'where':{'id':_0x1fd45d}},'log':_0x9987('0x6')});}; \ No newline at end of file +var _0x8832=['updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x1ef547,_0x31bfdb){var _0x1d697b=function(_0x57fbdc){while(--_0x57fbdc){_0x1ef547['push'](_0x1ef547['shift']());}};_0x1d697b(++_0x31bfdb);}(_0x8832,0x1f4));var _0x2883=function(_0x3255a3,_0x492c71){_0x3255a3=_0x3255a3-0x0;var _0x50e954=_0x8832[_0x3255a3];return _0x50e954;};'use strict';var client=require(_0x2883('0x0'));exports[_0x2883('0x1')]=function(_0x56a649,_0x598e48){return client[_0x2883('0x2')](_0x2883('0x3'),{'body':_0x598e48,'options':{'where':{'id':_0x56a649}},'log':_0x2883('0x4')});};exports['addTags']=function(_0x21be37,_0x5f5738){return client[_0x2883('0x2')](_0x2883('0x5'),{'body':_0x5f5738,'options':{'where':{'id':_0x21be37}},'log':_0x2883('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 6cf9420..e2ab068 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 _0x9f34=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x4bc53b,_0x39fc31){var _0x5743f5=function(_0x3db0ea){while(--_0x3db0ea){_0x4bc53b['push'](_0x4bc53b['shift']());}};_0x5743f5(++_0x39fc31);}(_0x9f34,0xf8));var _0x49f3=function(_0x2d2d3c,_0x3f0007){_0x2d2d3c=_0x2d2d3c-0x0;var _0x44a67e=_0x9f34[_0x2d2d3c];return _0x44a67e;};'use strict';var client=require(_0x49f3('0x0'));exports[_0x49f3('0x1')]=function(_0x2a89b7){return client['Request'](_0x49f3('0x2'),{'body':_0x2a89b7,'log':_0x49f3('0x3')});}; \ No newline at end of file +var _0x41e3=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x2cd25c,_0x2ab214){var _0x323d7e=function(_0x181509){while(--_0x181509){_0x2cd25c['push'](_0x2cd25c['shift']());}};_0x323d7e(++_0x2ab214);}(_0x41e3,0x81));var _0x341e=function(_0x30e4c0,_0x58fed1){_0x30e4c0=_0x30e4c0-0x0;var _0x30b6d0=_0x41e3[_0x30e4c0];return _0x30b6d0;};'use strict';var client=require(_0x341e('0x0'));exports['create']=function(_0x2112cd){return client[_0x341e('0x1')](_0x341e('0x2'),{'body':_0x2112cd,'log':_0x341e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 71e7176..7d6ec66 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x4b7fe4,_0x551030){var _0x198a1e=function(_0x32b188){while(--_0x32b188){_0x4b7fe4['push'](_0x4b7fe4['shift']());}};_0x198a1e(++_0x551030);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x3960b6,_0x415484){var _0x27db0c=function(_0x1b6a18){while(--_0x1b6a18){_0x3960b6['push'](_0x3960b6['shift']());}};_0x27db0c(++_0x415484);}(_0x70e0,0x17b));var _0x070e=function(_0x35132b,_0x4a59ae){_0x35132b=_0x35132b-0x0;var _0x18169e=_0x70e0[_0x35132b];return _0x18169e;};'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 0e01d68..e1fdfa5 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 _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x410571,_0x255a69){var _0x3c5547=function(_0x453501){while(--_0x453501){_0x410571['push'](_0x410571['shift']());}};_0x3c5547(++_0x255a69);}(_0x70e0,0x17b));var _0x070e=function(_0x403f3f,_0x2cf7b7){_0x403f3f=_0x403f3f-0x0;var _0x2f1607=_0x70e0[_0x403f3f];return _0x2f1607;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5afa2b,_0x4b9e09){var _0x3c7d16=function(_0x1f1823){while(--_0x1f1823){_0x5afa2b['push'](_0x5afa2b['shift']());}};_0x3c7d16(++_0x4b9e09);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4f8ac31..043d8d6 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(_0xb045d8,_0x4edd9d){var _0x562f3e=function(_0x122b21){while(--_0x122b21){_0xb045d8['push'](_0xb045d8['shift']());}};_0x562f3e(++_0x4edd9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0xd03c9d,_0x2b4216){var _0x11b92b=function(_0x5e000c){while(--_0x5e000c){_0xd03c9d['push'](_0xd03c9d['shift']());}};_0x11b92b(++_0x2b4216);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 e443081..92d3d3b 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 _0x4f0d=['addTags','addTagsToWhatsappInteraction','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x896854,_0x14927e){var _0x3e8009=function(_0x163738){while(--_0x163738){_0x896854['push'](_0x896854['shift']());}};_0x3e8009(++_0x14927e);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x171fb6,_0x1116d6){_0x171fb6=_0x171fb6-0x0;var _0x2dda01=_0x4f0d[_0x171fb6];return _0x2dda01;};'use strict';var client=require('../client');exports['update']=function(_0x4c1091,_0x5290b6){return client['Request'](_0xd4f0('0x0'),{'body':_0x5290b6,'options':{'where':{'id':_0x4c1091}},'log':_0xd4f0('0x1')});};exports[_0xd4f0('0x2')]=function(_0x577c8f,_0xb1db5){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0xb1db5,'options':{'where':{'id':_0x577c8f}},'log':_0xd4f0('0x3')});}; \ No newline at end of file +var _0x2aa3=['update','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','../client'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2aa3,0x83));var _0x32aa=function(_0xdaaaa3,_0x388836){_0xdaaaa3=_0xdaaaa3-0x0;var _0x15cbe7=_0x2aa3[_0xdaaaa3];return _0x15cbe7;};'use strict';var client=require(_0x32aa('0x0'));exports[_0x32aa('0x1')]=function(_0x107517,_0x2ef91b){return client['Request']('UpdateWhatsappInteraction',{'body':_0x2ef91b,'options':{'where':{'id':_0x107517}},'log':_0x32aa('0x2')});};exports[_0x32aa('0x3')]=function(_0x13843c,_0x33612d){return client[_0x32aa('0x4')](_0x32aa('0x5'),{'body':_0x33612d,'options':{'where':{'id':_0x13843c}},'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 62bc0df..af321f9 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 _0x09bc=['createWhatsappMessage','create','Request'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x09bc,0x112));var _0xc09b=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x09bc[_0x3a0c4f];return _0x247049;};'use strict';var client=require('../client');exports[_0xc09b('0x0')]=function(_0x143d2f){return client[_0xc09b('0x1')]('CreateWhatsappMessage',{'body':_0x143d2f,'log':_0xc09b('0x2')});}; \ No newline at end of file +var _0x8354=['CreateWhatsappMessage','../client','create','Request'];(function(_0x4ffb97,_0x168f01){var _0x355e73=function(_0x215f80){while(--_0x215f80){_0x4ffb97['push'](_0x4ffb97['shift']());}};_0x355e73(++_0x168f01);}(_0x8354,0x121));var _0x4835=function(_0x5de6a9,_0x11e69f){_0x5de6a9=_0x5de6a9-0x0;var _0x71ea62=_0x8354[_0x5de6a9];return _0x71ea62;};'use strict';var client=require(_0x4835('0x0'));exports[_0x4835('0x1')]=function(_0x182e40){return client[_0x4835('0x2')](_0x4835('0x3'),{'body':_0x182e40,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index dfe76d1..fc46d8e 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 _0xc9ae=['whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x5f4ee5,_0x1153eb){var _0x5d903d=function(_0xe8c003){while(--_0xe8c003){_0x5f4ee5['push'](_0x5f4ee5['shift']());}};_0x5d903d(++_0x1153eb);}(_0xc9ae,0x156));var _0xec9a=function(_0x1146b0,_0x5ff33){_0x1146b0=_0x1146b0-0x0;var _0x5f5a21=_0xc9ae[_0x1146b0];return _0x5f5a21;};'use strict';var client=require(_0xec9a('0x0'));exports[_0xec9a('0x1')]=function(){return function(){return client[_0xec9a('0x2')](_0xec9a('0x3'),{'options':{'raw':![],'attributes':['id',_0xec9a('0x4'),_0xec9a('0x5'),_0xec9a('0x6')],'include':[{'model':_0xec9a('0x7'),'as':_0xec9a('0x8'),'attributes':['id',_0xec9a('0x4'),_0xec9a('0x9'),_0xec9a('0xa')]}]},'log':_0xec9a('0x1')});};}; \ No newline at end of file +var _0x6a99=['name','online','whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','User','Agents'];(function(_0xffd14,_0x3cb980){var _0x36cc38=function(_0x57482b){while(--_0x57482b){_0xffd14['push'](_0xffd14['shift']());}};_0x36cc38(++_0x3cb980);}(_0x6a99,0x107));var _0x96a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6a99[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x96a9('0x0'));exports[_0x96a9('0x1')]=function(){return function(){return client[_0x96a9('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x96a9('0x3'),_0x96a9('0x4')],'include':[{'model':_0x96a9('0x5'),'as':_0x96a9('0x6'),'attributes':['id',_0x96a9('0x7'),_0x96a9('0x8'),_0x96a9('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index d455204..0b9e0a0 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 _0x107f=['UpdateWhatsappQueueReport','DESC','../client','Request','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x107f,0x1e2));var _0xf107=function(_0x51e092,_0x36626a){_0x51e092=_0x51e092-0x0;var _0x38d965=_0x107f[_0x51e092];return _0x38d965;};'use strict';var client=require(_0xf107('0x0'));exports['create']=function(_0x18d50c){return client[_0xf107('0x1')]('CreateWhatsappQueueReport',{'body':_0x18d50c,'log':'CreateWhatsappQueueReport'});};exports[_0xf107('0x2')]=function(_0x3c06e1,_0x1e6cdc){return client[_0xf107('0x1')](_0xf107('0x3'),{'body':_0x1e6cdc,'options':{'where':{'uniqueid':_0x3c06e1},'order':[['id',_0xf107('0x4')]],'limit':0x1},'log':_0xf107('0x3')});}; \ No newline at end of file +var _0xb628=['../client','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb628,0x16d));var _0x8b62=function(_0x35cb8d,_0x1c75c0){_0x35cb8d=_0x35cb8d-0x0;var _0x1e84a6=_0xb628[_0x35cb8d];return _0x1e84a6;};'use strict';var client=require(_0x8b62('0x0'));exports['create']=function(_0x2b9b38){return client[_0x8b62('0x1')]('CreateWhatsappQueueReport',{'body':_0x2b9b38,'log':_0x8b62('0x2')});};exports[_0x8b62('0x3')]=function(_0x2eae8d,_0x2d80e3){return client[_0x8b62('0x1')]('UpdateWhatsappQueueReport',{'body':_0x2d80e3,'options':{'where':{'uniqueid':_0x2eae8d},'order':[['id',_0x8b62('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index bceec18..e3f4951 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 _0x4eb0=['find','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','error','[%s][QUEUE]\x20%s','stack','validate','seq-queue','routing','./strategy','string','number','info','name','consequence','length','[%s][AGENT]\x20%s','map','message','join','stop'];(function(_0x3496f3,_0xd090ac){var _0x39178e=function(_0xe6535e){while(--_0xe6535e){_0x3496f3['push'](_0x3496f3['shift']());}};_0x39178e(++_0xd090ac);}(_0x4eb0,0x13b));var _0x04eb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4eb0[_0x167cc1];return _0x10bc4b;};'use strict';var schema=require(_0x04eb('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x04eb('0x1'));var logger=require('../../../../config/logger')(_0x04eb('0x2'));var strategy=require(_0x04eb('0x3'));var queue=schema({'name':{'type':_0x04eb('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x04eb('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x19e8d4,_0x14f777,_0x323870){return logger[_0x04eb('0x6')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x19e8d4,_0x14f777[_0x04eb('0x7')],_0x323870));}function handleFindAgent(_0x3f35bb){return function(_0x102d66){return _0x102d66[_0x04eb('0x7')]['toLowerCase']()===_0x3f35bb['toLowerCase']();};}exports[_0x04eb('0x8')]=function(_0x24f910,_0x35a2ef,_0x5f54f2,_0x343700){return function(_0xa87418){try{var _0x4e78a1={'name':_0x35a2ef[0x0],'timeout':_0x35a2ef[0x1]};var _0x1da460=queue[_0x04eb('0x0')](_0x4e78a1,{'typecast':!![]});if(_0x1da460[_0x04eb('0x9')]){logger['error'](_0x04eb('0xa'),_0x24f910,_[_0x04eb('0xb')](_0x1da460,_0x04eb('0xc'))[_0x04eb('0xd')](',\x20'));_0xa87418[_0x04eb('0xe')]();}else{var _0x57d42a=_[_0x04eb('0xf')](_0x5f54f2['agents'],handleFindAgent(_0x4e78a1[_0x04eb('0x7')]));if(_0x57d42a){var _0x54b637=(_0x4e78a1[_0x04eb('0x10')]||0xa)*0x3e8;var _0x458abf,_0x3a1e7e;var _0xeaccd4=seqqueue[_0x04eb('0x11')](_0x54b637);_0xeaccd4['id']=_0x24f910;_0xeaccd4[_0x04eb('0x12')]=_0x54b637;_0xeaccd4[_0x04eb('0x13')]=_0x343700[_0x04eb('0x13')];writeLog(_0x24f910,_0x57d42a,util['format'](_0x04eb('0x14'),_0x54b637));_0x5f54f2[_0x04eb('0x15')][_0x24f910]['on'](_0x04eb('0x16'),function(){logger['info'](_0x04eb('0x17'),_0x24f910);clearTimeout(_0x3a1e7e);_0x3a1e7e=undefined;_0xeaccd4[_0x04eb('0x18')]();if(_0x5f54f2[_0x04eb('0x15')][_0x24f910]){delete _0x5f54f2[_0x04eb('0x15')][_0x24f910];}_0xa87418[_0x04eb('0xe')]();});_0x5f54f2[_0x04eb('0x15')][_0x24f910]['on'](_0x04eb('0x19'),function(){if(_0x5f54f2[_0x04eb('0x15')][_0x24f910]){delete _0x5f54f2[_0x04eb('0x15')][_0x24f910];}});_0x3a1e7e=setTimeout(function(){logger['info'](_0x04eb('0x1a'),_0x24f910);clearTimeout(_0x3a1e7e);_0xeaccd4[_0x04eb('0x18')]();_0xa87418[_0x04eb('0x1b')]();},_0x54b637);strategy[_0x04eb('0x1c')](_0xeaccd4,_0x57d42a,_0x5f54f2,_0x343700);}else{logger['error'](_0x04eb('0x1d'),_0x24f910,_0x4e78a1[_0x04eb('0x7')]);_0xa87418[_0x04eb('0xe')]();}}}catch(_0x1cb88d){console['log'](_0x1cb88d);logger[_0x04eb('0x1e')](_0x04eb('0x1f'),_0x24f910,_0x1cb88d[_0x04eb('0x20')]);_0xa87418[_0x04eb('0xe')]();}};}; \ No newline at end of file +var _0x6bc6=['[%s][QUEUE]\x20%s','validate','lodash','seq-queue','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x26ebb3,_0x3a0527){var _0x34a113=function(_0x5f1d1d){while(--_0x5f1d1d){_0x26ebb3['push'](_0x26ebb3['shift']());}};_0x34a113(++_0x3a0527);}(_0x6bc6,0xab));var _0x66bc=function(_0x2ab3c5,_0x35a3ef){_0x2ab3c5=_0x2ab3c5-0x0;var _0x2733aa=_0x6bc6[_0x2ab3c5];return _0x2733aa;};'use strict';var schema=require(_0x66bc('0x0'));var _=require(_0x66bc('0x1'));var util=require('util');var seqqueue=require(_0x66bc('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x66bc('0x3'));var queue=schema({'name':{'type':_0x66bc('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x66bc('0x5'),'message':_0x66bc('0x6')}});function writeLog(_0x3c1ae0,_0x2dc06a,_0x27663d){return logger[_0x66bc('0x7')](util[_0x66bc('0x8')](_0x66bc('0x9'),_0x3c1ae0,_0x2dc06a[_0x66bc('0xa')],_0x27663d));}function handleFindAgent(_0x168094){return function(_0x3c60dd){return _0x3c60dd[_0x66bc('0xa')]['toLowerCase']()===_0x168094[_0x66bc('0xb')]();};}exports[_0x66bc('0xc')]=function(_0x3a8b52,_0x4708ce,_0x8e5bea,_0x1f317b){return function(_0x1e10c0){try{var _0x38802a={'name':_0x4708ce[0x0],'timeout':_0x4708ce[0x1]};var _0xa13c33=queue['validate'](_0x38802a,{'typecast':!![]});if(_0xa13c33[_0x66bc('0xd')]){logger[_0x66bc('0xe')]('[%s][AGENT]\x20%s',_0x3a8b52,_[_0x66bc('0xf')](_0xa13c33,_0x66bc('0x10'))[_0x66bc('0x11')](',\x20'));_0x1e10c0['stop']();}else{var _0x4dfb5b=_[_0x66bc('0x12')](_0x8e5bea[_0x66bc('0x13')],handleFindAgent(_0x38802a[_0x66bc('0xa')]));if(_0x4dfb5b){var _0x5b6b09=(_0x38802a[_0x66bc('0x14')]||0xa)*0x3e8;var _0x58765d,_0x4a0248;var _0x4cf8e5=seqqueue[_0x66bc('0x15')](_0x5b6b09);_0x4cf8e5['id']=_0x3a8b52;_0x4cf8e5[_0x66bc('0x16')]=_0x5b6b09;_0x4cf8e5[_0x66bc('0x17')]=_0x1f317b[_0x66bc('0x17')];writeLog(_0x3a8b52,_0x4dfb5b,util[_0x66bc('0x8')](_0x66bc('0x18'),_0x5b6b09));_0x8e5bea[_0x66bc('0x19')][_0x3a8b52]['on']('end',function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3a8b52);clearTimeout(_0x4a0248);_0x4a0248=undefined;_0x4cf8e5[_0x66bc('0x1a')]();if(_0x8e5bea[_0x66bc('0x19')][_0x3a8b52]){delete _0x8e5bea['rules'][_0x3a8b52];}_0x1e10c0[_0x66bc('0x1b')]();});_0x8e5bea[_0x66bc('0x19')][_0x3a8b52]['on'](_0x66bc('0x1c'),function(){if(_0x8e5bea[_0x66bc('0x19')][_0x3a8b52]){delete _0x8e5bea[_0x66bc('0x19')][_0x3a8b52];}});_0x4a0248=setTimeout(function(){logger['info'](_0x66bc('0x1d'),_0x3a8b52);clearTimeout(_0x4a0248);_0x4cf8e5[_0x66bc('0x1a')]();_0x1e10c0[_0x66bc('0x1e')]();},_0x5b6b09);strategy['agent'](_0x4cf8e5,_0x4dfb5b,_0x8e5bea,_0x1f317b);}else{logger[_0x66bc('0xe')](_0x66bc('0x1f'),_0x3a8b52,_0x38802a[_0x66bc('0xa')]);_0x1e10c0[_0x66bc('0x1b')]();}}}catch(_0x36709b){console[_0x66bc('0x20')](_0x36709b);logger[_0x66bc('0xe')](_0x66bc('0x21'),_0x3a8b52,_0x36709b['stack']);_0x1e10c0['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4134c9e..8a26dab 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 _0x4ad2=['stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','toString','postText','providerName','amazonlex','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][AMAZONLEX]\x20%s','next','contact','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','Message','create','body','catch','error','stringify','finally','info'];(function(_0x5d642f,_0x5b3724){var _0x42be03=function(_0x29ffa5){while(--_0x29ffa5){_0x5d642f['push'](_0x5d642f['shift']());}};_0x42be03(++_0x5b3724);}(_0x4ad2,0x91));var _0x24ad=function(_0x2819b9,_0x310cfe){_0x2819b9=_0x2819b9-0x0;var _0x2dc84d=_0x4ad2[_0x2819b9];return _0x2dc84d;};'use strict';var _=require(_0x24ad('0x0'));var moment=require(_0x24ad('0x1'));var AWS=require(_0x24ad('0x2'));var utils=require(_0x24ad('0x3'));var logger=require(_0x24ad('0x4'))('routing');var rpc={'chatMessage':require(_0x24ad('0x5')),'openchannelMessage':require(_0x24ad('0x6')),'mailMessage':require(_0x24ad('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x24ad('0x8')),'whatsappMessage':require(_0x24ad('0x9'))};exports[_0x24ad('0xa')]=function(_0x324a97,_0x287db6){return function(_0x33ea53){try{if(!_[_0x24ad('0xb')](this['interaction']['UserId'])){logger['info'](_0x24ad('0xc'),_0x324a97,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x33ea53[_0x24ad('0xd')]();}var _0x5f0531={'ContactId':this[_0x24ad('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x24ad('0xf')};if(this[_0x24ad('0x10')]===_0x24ad('0x11')||this['channel']===_0x24ad('0x12')){_0x5f0531[_0x24ad('0x13')]=this['interaction'][_0x24ad('0x13')];}var _0x4c73ee=this[_0x24ad('0x10')];if(_0x4c73ee==='chat'){_0x5f0531[_0x24ad('0x14')]=this[_0x24ad('0x15')]['id'];}else{_0x5f0531[_[_0x24ad('0x16')](_0x4c73ee)+_0x24ad('0x17')]=this['account']['id'];}_0x5f0531[_[_0x24ad('0x16')](_0x4c73ee)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x24ad('0x18')]){var _0x274bf1=_0x287db6[0x4];if(!_[_0x24ad('0x19')](_0x274bf1)){_0x5f0531['body']=utils[_0x24ad('0x1a')](_0x274bf1,this);return rpc[_0x4c73ee+_0x24ad('0x1b')][_0x24ad('0x1c')](_0x5f0531)['then'](function(_0x20fe01){logger['info'](_0x24ad('0xc'),_0x324a97,_0x5f0531[_0x24ad('0x1d')]);})[_0x24ad('0x1e')](function(_0x35be51){logger[_0x24ad('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x324a97,JSON[_0x24ad('0x20')](_0x35be51));})[_0x24ad('0x21')](function(){logger[_0x24ad('0x22')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x324a97);_0x33ea53[_0x24ad('0x23')]();});}else{logger[_0x24ad('0x22')](_0x24ad('0x24'),_0x324a97);_0x33ea53[_0x24ad('0x23')]();}}else{var _0x324a8f=this;var _0x12f5fc=new AWS['LexRuntime']({'accessKeyId':_0x287db6[0x0],'secretAccessKey':_0x287db6[0x1],'region':_0x287db6[0x2]});var _0x121fb2={'botAlias':'$LATEST','botName':_0x287db6[0x3],'inputText':this[_0x24ad('0x25')][_0x24ad('0x1d')],'userId':this[_0x24ad('0x10')]+':'+this['interaction']['id'][_0x24ad('0x26')]()};_0x12f5fc[_0x24ad('0x27')](_0x121fb2,function(_0x3c9267,_0x4667cb){if(_0x3c9267){logger[_0x24ad('0x1f')](_0x24ad('0xc'),_0x324a97,_0x3c9267[_0x24ad('0x25')]);_0x33ea53[_0x24ad('0xd')]();}else if(_0x4667cb&&_0x4667cb[_0x24ad('0x25')]){_0x324a8f['body']['amazonlex']=_0x4667cb;_0x5f0531[_0x24ad('0x1d')]=_0x4667cb[_0x24ad('0x25')];_0x5f0531[_0x24ad('0x28')]=_0x24ad('0x29');_0x5f0531[_0x24ad('0x2a')]=JSON[_0x24ad('0x20')](_0x4667cb);return rpc[_0x4c73ee+_0x24ad('0x1b')]['create'](_0x5f0531)['then'](function(_0xcec2aa){logger[_0x24ad('0x22')](_0x24ad('0xc'),_0x324a97,_0x5f0531['body']);if(_0x4667cb[_0x24ad('0x2b')]==_0x24ad('0x2c')){_0x33ea53['next']();}else{_0x33ea53[_0x24ad('0x23')]();}})[_0x24ad('0x1e')](function(_0x317fa4){logger[_0x24ad('0x1f')](_0x24ad('0xc'),_0x324a97,JSON['stringify'](_0x317fa4));_0x33ea53['next']();});}else{_0x33ea53[_0x24ad('0xd')]();}});}}catch(_0x586307){logger['error'](_0x24ad('0xc'),_0x324a97,JSON[_0x24ad('0x20')](_0x586307));_0x33ea53[_0x24ad('0x23')]();}};}; \ No newline at end of file +var _0x022b=['message','providerName','amazonlex','Message','dialogState','lodash','aws-sdk','./utils','routing','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString'];(function(_0x291e0e,_0x792683){var _0x3f85f3=function(_0x4a4049){while(--_0x4a4049){_0x291e0e['push'](_0x291e0e['shift']());}};_0x3f85f3(++_0x792683);}(_0x022b,0xad));var _0xb022=function(_0x5abbde,_0x1d7624){_0x5abbde=_0x5abbde-0x0;var _0x4c84d0=_0x022b[_0x5abbde];return _0x4c84d0;};'use strict';var _=require(_0xb022('0x0'));var moment=require('moment');var AWS=require(_0xb022('0x1'));var utils=require(_0xb022('0x2'));var logger=require('../../../../config/logger')(_0xb022('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb022('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xb022('0x5')),'whatsappMessage':require(_0xb022('0x6'))};exports[_0xb022('0x7')]=function(_0x19b404,_0x212c2f){return function(_0x12090f){try{if(!_['isNil'](this[_0xb022('0x8')][_0xb022('0x9')])){logger[_0xb022('0xa')](_0xb022('0xb'),_0x19b404,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x12090f[_0xb022('0xc')]();}var _0x1af2da={'ContactId':this[_0xb022('0xd')]['id'],'sentAt':moment()[_0xb022('0xe')](_0xb022('0xf')),'direction':_0xb022('0x10')};if(this[_0xb022('0x11')]==='sms'||this['channel']==='whatsapp'){_0x1af2da['phone']=this[_0xb022('0x8')][_0xb022('0x12')];}var _0x352101=this[_0xb022('0x11')];if(_0x352101===_0xb022('0x13')){_0x1af2da['ChatWebsiteId']=this[_0xb022('0x14')]['id'];}else{_0x1af2da[_['upperFirst'](_0x352101)+'AccountId']=this[_0xb022('0x14')]['id'];}_0x1af2da[_[_0xb022('0x15')](_0x352101)+_0xb022('0x16')]=this[_0xb022('0x8')]['id'];if(this[_0xb022('0x8')][_0xb022('0x17')]){var _0x114606=_0x212c2f[0x4];if(!_[_0xb022('0x18')](_0x114606)){_0x1af2da[_0xb022('0x19')]=utils[_0xb022('0x1a')](_0x114606,this);return rpc[_0x352101+'Message'][_0xb022('0x1b')](_0x1af2da)[_0xb022('0x1c')](function(_0xaddb4e){logger[_0xb022('0xa')](_0xb022('0xb'),_0x19b404,_0x1af2da[_0xb022('0x19')]);})[_0xb022('0x1d')](function(_0x2aa26b){logger[_0xb022('0x1e')](_0xb022('0xb'),_0x19b404,JSON[_0xb022('0x1f')](_0x2aa26b));})[_0xb022('0x20')](function(){logger[_0xb022('0xa')](_0xb022('0x21'),_0x19b404);_0x12090f[_0xb022('0x22')]();});}else{logger[_0xb022('0xa')](_0xb022('0x23'),_0x19b404);_0x12090f[_0xb022('0x22')]();}}else{var _0x2e2ae2=this;var _0x40eafc=new AWS['LexRuntime']({'accessKeyId':_0x212c2f[0x0],'secretAccessKey':_0x212c2f[0x1],'region':_0x212c2f[0x2]});var _0x1e20b9={'botAlias':'$LATEST','botName':_0x212c2f[0x3],'inputText':this['message'][_0xb022('0x19')],'userId':this['channel']+':'+this[_0xb022('0x8')]['id'][_0xb022('0x24')]()};_0x40eafc['postText'](_0x1e20b9,function(_0x309259,_0x4baf72){if(_0x309259){logger[_0xb022('0x1e')](_0xb022('0xb'),_0x19b404,_0x309259['message']);_0x12090f['next']();}else if(_0x4baf72&&_0x4baf72[_0xb022('0x25')]){_0x2e2ae2['body']['amazonlex']=_0x4baf72;_0x1af2da[_0xb022('0x19')]=_0x4baf72[_0xb022('0x25')];_0x1af2da[_0xb022('0x26')]=_0xb022('0x27');_0x1af2da['providerResponse']=JSON[_0xb022('0x1f')](_0x4baf72);return rpc[_0x352101+_0xb022('0x28')][_0xb022('0x1b')](_0x1af2da)[_0xb022('0x1c')](function(_0x72e59c){logger['info'](_0xb022('0xb'),_0x19b404,_0x1af2da[_0xb022('0x19')]);if(_0x4baf72[_0xb022('0x29')]=='Failed'){_0x12090f[_0xb022('0xc')]();}else{_0x12090f[_0xb022('0x22')]();}})[_0xb022('0x1d')](function(_0x4b2ce6){logger[_0xb022('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x19b404,JSON[_0xb022('0x1f')](_0x4b2ce6));_0x12090f[_0xb022('0xc')]();});}else{_0x12090f[_0xb022('0xc')]();}});}}catch(_0x2b970f){logger['error'](_0xb022('0xb'),_0x19b404,JSON['stringify'](_0x2b970f));_0x12090f[_0xb022('0x22')]();}};}; \ 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 5f06097..9fef22b 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 _0x67be=['Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','AccountId','upperFirst','inReplyTo','messageId','html','replace',''+_[_0xe67b('0x31')](_0x215203[_0xe67b('0x13')],'';_0x215203[_0xe67b('0x33')]={'Auto-Submitted':_0xe67b('0x34'),'X-Auto-Response-Suppress':_0xe67b('0x35'),'Precedence':_0xe67b('0x36')};return mailRpc[_0xe67b('0x37')](this['account'][_0xe67b('0x38')],_0x215203)['then'](function(_0x4d548c){logger[_0xe67b('0x14')](_0xe67b('0x39'),_0x10f3f6);_0x215203['messageId']=_0x4d548c[_0xe67b('0x22')][_0xe67b('0x2f')];return rpc[_0x18bd8f+_0xe67b('0x3a')][_0xe67b('0x3b')](_0x215203);})[_0xe67b('0x3c')](function(_0x558c3e){logger[_0xe67b('0x14')](_0xe67b('0x15'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x558c3e));})[_0xe67b('0x3e')](function(_0x47a0b6){logger[_0xe67b('0x3f')](_0xe67b('0x40'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x47a0b6));})['finally'](function(){Promise[_0xe67b('0x41')]()[_0xe67b('0x3c')](function(){if(_0xbe01b1[0x0]!=='2'||_0xa835ae[_0xe67b('0x42')])return;return rpc[_0x18bd8f+_0xe67b('0x43')][_0xe67b('0x44')](_0xa835ae['id'],{'autoreplyExecuted':!![]})[_0xe67b('0x3c')](function(_0x4229b5){logger[_0xe67b('0x14')](_0xe67b('0x45'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x4229b5));})[_0xe67b('0x3e')](function(_0x2344b4){logger[_0xe67b('0x3f')](_0xe67b('0x46'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x2344b4));});})['then'](function(){_0x10f9c0[_0xe67b('0x17')]();});});}else{return rpc[this[_0xe67b('0x11')]+_0xe67b('0x3a')]['create'](_0x215203)['then'](function(){logger['info'](_0xe67b('0x15'),_0x10f3f6,_0x215203[_0xe67b('0x13')]);})['catch'](function(_0x51458e){logger['error'](_0xe67b('0x15'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x51458e));})[_0xe67b('0x47')](function(){Promise['resolve']()[_0xe67b('0x3c')](function(){if(_0xbe01b1[0x0]!=='2'||_0xa835ae[_0xe67b('0x42')])return;return rpc[_0x18bd8f+_0xe67b('0x43')][_0xe67b('0x44')](_0xa835ae['id'],{'autoreplyExecuted':!![]})[_0xe67b('0x3c')](function(_0x3d2d70){logger[_0xe67b('0x14')](_0xe67b('0x45'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x3d2d70));})['catch'](function(_0x51058a){logger[_0xe67b('0x3f')](_0xe67b('0x46'),_0x10f3f6,JSON[_0xe67b('0x3d')](_0x51058a));});})['then'](function(){_0x10f9c0[_0xe67b('0x17')]();});});}}}catch(_0x1bc04c){logger[_0xe67b('0x3f')](_0xe67b('0x15'),_0x10f3f6,JSON['stringify'](_0x1bc04c));_0x10f9c0['stop']();}};}; \ No newline at end of file +var _0x749c=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','body','info','[%s][AUTOREPLY]\x20%s','isNil','created','interaction','Autoreply\x20already\x20sent','next','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','replace','','headers','auto-replied','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','stringify','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x749c,0x191));var _0xc749=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x749c[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0xc749('0x0'));var moment=require(_0xc749('0x1'));var utils=require(_0xc749('0x2'));var logger=require(_0xc749('0x3'))(_0xc749('0x4'));var rpc={'chatMessage':require(_0xc749('0x5')),'openchannelMessage':require(_0xc749('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xc749('0x7')),'faxMessage':require(_0xc749('0x8')),'whatsappMessage':require(_0xc749('0x9')),'chatInteraction':require(_0xc749('0xa')),'openchannelInteraction':require(_0xc749('0xb')),'mailInteraction':require(_0xc749('0xc')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xc749('0xd')),'whatsappInteraction':require(_0xc749('0xe'))};var mailRpc=require(_0xc749('0xf'));exports['consequence']=function(_0x179782,_0x493482,_0x2e8a4f,_0x19af10){return function(_0x2475e5){try{var _0x1844df=this[_0xc749('0x10')];if(_0x1844df==='mail'&&_0x19af10[_0xc749('0x11')]['isAutoreply']){logger[_0xc749('0x12')](_0xc749('0x13'),_0x179782,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x2475e5['next']();}if(_0x493482[0x0]==='1'&&(_[_0xc749('0x14')](this['interaction'][_0xc749('0x15')])||!this[_0xc749('0x16')]['created'])){logger[_0xc749('0x12')]('[%s][AUTOREPLY]\x20%s',_0x179782,_0xc749('0x17'));return _0x2475e5[_0xc749('0x18')]();}if(_0x493482[0x0]==='2'&&this[_0xc749('0x16')]['autoreplyExecuted']){logger[_0xc749('0x12')](_0xc749('0x19'),_0x179782,'One\x20Time\x20already\x20sent');return _0x2475e5[_0xc749('0x18')]();}var _0x2c5e18={'ContactId':this[_0xc749('0x1a')]['id'],'sentAt':moment()['format'](_0xc749('0x1b')),'direction':_0xc749('0x1c')};if(this[_0xc749('0x10')]===_0xc749('0x1d')){_0x2c5e18[_0xc749('0x11')]=utils[_0xc749('0x1e')](_0x493482[0x2],this);}else{_0x2c5e18[_0xc749('0x11')]=utils[_0xc749('0x1e')](_0x493482[0x1],this);}if(this[_0xc749('0x1f')]){_0x2c5e18['to']=this[_0xc749('0x1f')]['from']||'';if(this[_0xc749('0x10')]==='mail'&&_0x493482[0x1]==='1'){_0x2c5e18['cc']=this[_0xc749('0x1f')]['cc']||'';}_0x2c5e18[_0xc749('0x20')]=this[_0xc749('0x1f')]['to']||'';_0x2c5e18[_0xc749('0x21')]=this['message']['phone']||'';_0x2c5e18[_0xc749('0x22')]=!![];if(this['message']['subject']){_0x2c5e18[_0xc749('0x23')]='';_0x2c5e18[_0xc749('0x23')]+=_['startsWith'](this[_0xc749('0x1f')]['subject'],_0xc749('0x24'))?'':_0xc749('0x25');_0x2c5e18[_0xc749('0x23')]+=this[_0xc749('0x1f')][_0xc749('0x23')];}}if(this[_0xc749('0x10')]===_0xc749('0x26')){_0x2c5e18[_0xc749('0x27')]=this[_0xc749('0x28')]['id'];}else{_0x2c5e18[_[_0xc749('0x29')](this[_0xc749('0x10')])+_0xc749('0x2a')]=this['account']['id'];}_0x2c5e18[_['upperFirst'](this[_0xc749('0x10')])+_0xc749('0x2b')]=this[_0xc749('0x16')]['id'];var _0x4dcc51=this[_0xc749('0x16')];if(rpc[this['channel']+_0xc749('0x2c')]){if(this['channel']===_0xc749('0x1d')){_0x2c5e18[_0xc749('0x2d')]=this['message'][_0xc749('0x2e')];_0x2c5e18['html']=''+_[_0xc749('0x2f')](_0x2c5e18[_0xc749('0x11')],_0xc749('0x30'),']+(>|$)/g,''),'priorityTrue':_0x145837[0x1],'priorityFalse':_0x145837[0x2]};var _0x7f68c6=gotoif[_0x3c44('0x0')](_0x4dcf1b,{'typecast':!![]});if(_0x7f68c6['length']){logger[_0x3c44('0xc')]('[%s][GOTOIF]\x20%s',_0x5431cc,_[_0x3c44('0xd')](_0x7f68c6,_0x3c44('0xe'))['join'](',\x20'));_0x419a17[_0x3c44('0xf')]();}else{try{var _0x194da9=eval('('+_0x4dcf1b[_0x3c44('0x10')]+')');var _0x215298=_0x194da9?_0x4dcf1b[_0x3c44('0x11')]:_0x4dcf1b['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5431cc,_0x4dcf1b['condition'],_0x194da9,_0x215298||_0x3c44('0x12'));if(_0x215298){var _0xedeac9=_[_0x3c44('0x13')](_0x419a17[_0x3c44('0x14')](),{'p':_0x215298});if(_0xedeac9>=0x0){logger[_0x3c44('0x15')](_0x3c44('0x16'),_0x5431cc,_0x215298||_0x3c44('0x12'),_0xedeac9);_0x419a17[_0x3c44('0x12')](_0xedeac9);}else{logger[_0x3c44('0x15')](_0x3c44('0x17'),_0x5431cc,_0x215298||_0x3c44('0x12'));_0x419a17[_0x3c44('0xf')]();}}else{_0x419a17[_0x3c44('0x12')]();}}catch(_0x54deaa){logger[_0x3c44('0xc')](_0x3c44('0x18'),_0x5431cc,_0x54deaa[_0x3c44('0xe')]);_0x419a17[_0x3c44('0xf')]();}}}catch(_0x1febb0){logger[_0x3c44('0xc')]('[%s][GOTOIF]\x20%s',_0x5431cc,JSON[_0x3c44('0x19')](_0x1febb0));_0x419a17['stop']();}};}; \ No newline at end of file +var _0x6d85=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules'];(function(_0x12793a,_0x4f77d3){var _0x25beb9=function(_0x2d6c4a){while(--_0x2d6c4a){_0x12793a['push'](_0x12793a['shift']());}};_0x25beb9(++_0x4f77d3);}(_0x6d85,0x7d));var _0x56d8=function(_0x2a292b,_0x32b513){_0x2a292b=_0x2a292b-0x0;var _0x588eb4=_0x6d85[_0x2a292b];return _0x588eb4;};'use strict';var schema=require(_0x56d8('0x0'));var _=require(_0x56d8('0x1'));var htmlToText=require(_0x56d8('0x2'));var utils=require(_0x56d8('0x3'));var logger=require(_0x56d8('0x4'))(_0x56d8('0x5'));var gotoif=schema({'condition':{'type':_0x56d8('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x56d8('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x56d8('0x7'),'message':_0x56d8('0x8')}});exports[_0x56d8('0x9')]=function(_0x59f58c,_0x3f1de1){return function(_0x5e5775){try{var _0x3c1842={'condition':htmlToText[_0x56d8('0xa')](utils[_0x56d8('0xb')](_0x3f1de1[0x0],this),{'wordwrap':![]})[_0x56d8('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3f1de1[0x1],'priorityFalse':_0x3f1de1[0x2]};var _0x2150d5=gotoif[_0x56d8('0x0')](_0x3c1842,{'typecast':!![]});if(_0x2150d5[_0x56d8('0xd')]){logger[_0x56d8('0xe')](_0x56d8('0xf'),_0x59f58c,_['map'](_0x2150d5,'message')['join'](',\x20'));_0x5e5775[_0x56d8('0x10')]();}else{try{var _0x2ae891=eval('('+_0x3c1842[_0x56d8('0x11')]+')');var _0x222de7=_0x2ae891?_0x3c1842[_0x56d8('0x12')]:_0x3c1842[_0x56d8('0x13')];logger[_0x56d8('0x14')](_0x56d8('0x15'),_0x59f58c,_0x3c1842[_0x56d8('0x11')],_0x2ae891,_0x222de7||_0x56d8('0x16'));if(_0x222de7){var _0x58d4d3=_[_0x56d8('0x17')](_0x5e5775[_0x56d8('0x18')](),{'p':_0x222de7});if(_0x58d4d3>=0x0){logger[_0x56d8('0x14')](_0x56d8('0x19'),_0x59f58c,_0x222de7||_0x56d8('0x16'),_0x58d4d3);_0x5e5775['next'](_0x58d4d3);}else{logger[_0x56d8('0x14')](_0x56d8('0x1a'),_0x59f58c,_0x222de7||'next');_0x5e5775[_0x56d8('0x10')]();}}else{_0x5e5775['next']();}}catch(_0x43dbef){logger[_0x56d8('0xe')](_0x56d8('0x1b'),_0x59f58c,_0x43dbef[_0x56d8('0x1c')]);_0x5e5775[_0x56d8('0x10')]();}}}catch(_0x5d637c){logger[_0x56d8('0xe')]('[%s][GOTOIF]\x20%s',_0x59f58c,JSON[_0x56d8('0x1d')](_0x5d637c));_0x5e5775[_0x56d8('0x10')]();}};}; \ 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 1ce0e90..a3ce303 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 _0x4506=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x367825,_0xba445e){var _0x17e0c2=function(_0x2a16cc){while(--_0x2a16cc){_0x367825['push'](_0x367825['shift']());}};_0x17e0c2(++_0xba445e);}(_0x4506,0x191));var _0x6450=function(_0x111742,_0x4c1df3){_0x111742=_0x111742-0x0;var _0x4115e6=_0x4506[_0x111742];return _0x4115e6;};'use strict';var schema=require('validate');var _=require(_0x6450('0x0'));var logger=require(_0x6450('0x1'))(_0x6450('0x2'));var gotop=schema({'priority':{'type':_0x6450('0x3'),'required':!![],'message':_0x6450('0x4')}});exports[_0x6450('0x5')]=function(_0x614f4b,_0x5bbfb1){return function(_0x9a0e13){try{var _0xd70555={'priority':_0x5bbfb1[0x0]};var _0x1fb86a=gotop[_0x6450('0x6')](_0xd70555,{'typecast':!![]});if(_0x1fb86a[_0x6450('0x7')]){logger[_0x6450('0x8')](_0x6450('0x9'),_0x614f4b,_['map'](_0x1fb86a,_0x6450('0xa'))[_0x6450('0xb')](',\x20'));_0x9a0e13[_0x6450('0xc')]();}else{logger[_0x6450('0xd')](_0x6450('0xe'),_0x614f4b,_0xd70555[_0x6450('0xf')]);if(_0xd70555['priority']){var _0x5de1c1=_[_0x6450('0x10')](_0x9a0e13[_0x6450('0x11')](),{'p':_0xd70555['priority']});if(_0x5de1c1>=0x0){logger[_0x6450('0xd')](_0x6450('0x12'),_0x614f4b,_0xd70555[_0x6450('0xf')]||_0x6450('0x13'),_0x5de1c1);_0x9a0e13[_0x6450('0x13')](_0x5de1c1);}else{logger[_0x6450('0xd')](_0x6450('0x14'),_0x614f4b,_0xd70555[_0x6450('0xf')]||_0x6450('0x13'));_0x9a0e13[_0x6450('0xc')]();}}else{_0x9a0e13[_0x6450('0x13')]();}}}catch(_0x2f14e8){logger[_0x6450('0x8')](_0x6450('0x9'),_0x614f4b,JSON[_0x6450('0x15')](_0x2f14e8));_0x9a0e13['stop']();}};}; \ No newline at end of file +var _0xfd2a=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','../../../../config/logger','routing','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x1e06f1,_0x59d7e1){var _0x34f77e=function(_0x4f9f26){while(--_0x4f9f26){_0x1e06f1['push'](_0x1e06f1['shift']());}};_0x34f77e(++_0x59d7e1);}(_0xfd2a,0xc4));var _0xafd2=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xfd2a[_0xfae23b];return _0x200640;};'use strict';var schema=require(_0xafd2('0x0'));var _=require(_0xafd2('0x1'));var logger=require(_0xafd2('0x2'))(_0xafd2('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x36db72,_0x30a2ae){return function(_0x5d6853){try{var _0x439688={'priority':_0x30a2ae[0x0]};var _0xdd77d6=gotop[_0xafd2('0x0')](_0x439688,{'typecast':!![]});if(_0xdd77d6['length']){logger[_0xafd2('0x4')](_0xafd2('0x5'),_0x36db72,_[_0xafd2('0x6')](_0xdd77d6,_0xafd2('0x7'))[_0xafd2('0x8')](',\x20'));_0x5d6853['stop']();}else{logger[_0xafd2('0x9')](_0xafd2('0xa'),_0x36db72,_0x439688[_0xafd2('0xb')]);if(_0x439688[_0xafd2('0xb')]){var _0x34e0b6=_[_0xafd2('0xc')](_0x5d6853[_0xafd2('0xd')](),{'p':_0x439688[_0xafd2('0xb')]});if(_0x34e0b6>=0x0){logger[_0xafd2('0x9')](_0xafd2('0xe'),_0x36db72,_0x439688[_0xafd2('0xb')]||'next',_0x34e0b6);_0x5d6853[_0xafd2('0xf')](_0x34e0b6);}else{logger['info'](_0xafd2('0x10'),_0x36db72,_0x439688[_0xafd2('0xb')]||_0xafd2('0xf'));_0x5d6853[_0xafd2('0x11')]();}}else{_0x5d6853[_0xafd2('0xf')]();}}}catch(_0x1b34ac){logger[_0xafd2('0x4')](_0xafd2('0x5'),_0x36db72,JSON[_0xafd2('0x12')](_0x1b34ac));_0x5d6853[_0xafd2('0x11')]();}};}; \ 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 9a99135..bacdb6d 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 _0xb4c3=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','routing'];(function(_0x3f5335,_0x4b967f){var _0xe13381=function(_0x4aa2d2){while(--_0x4aa2d2){_0x3f5335['push'](_0x3f5335['shift']());}};_0xe13381(++_0x4b967f);}(_0xb4c3,0x115));var _0x3b4c=function(_0x467cac,_0x509a47){_0x467cac=_0x467cac-0x0;var _0x4f5257=_0xb4c3[_0x467cac];return _0x4f5257;};'use strict';var _=require(_0x3b4c('0x0'));var utils=require('./utils');var logger=require(_0x3b4c('0x1'))(_0x3b4c('0x2'));var rpc={'chatMessage':require(_0x3b4c('0x3')),'openchannelMessage':require(_0x3b4c('0x4')),'mailMessage':require(_0x3b4c('0x5')),'smsMessage':require(_0x3b4c('0x6')),'faxMessage':require(_0x3b4c('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3b4c('0x8')]=function(_0x599dfb,_0x27922e){return function(_0x714b84){try{var _0x56cc0b={'body':utils[_0x3b4c('0x9')](_0x27922e[0x0],this),'ContactId':this[_0x3b4c('0xa')]['id']};if(this[_0x3b4c('0xb')]===_0x3b4c('0xc')){_0x56cc0b[_0x3b4c('0xd')]=this[_0x3b4c('0xe')]['id'];}else{_0x56cc0b[_[_0x3b4c('0xf')](this[_0x3b4c('0xb')])+'AccountId']=this['account']['id'];}_0x56cc0b[_[_0x3b4c('0xf')](this[_0x3b4c('0xb')])+_0x3b4c('0x10')]=this[_0x3b4c('0x11')]['id'];if(rpc[this[_0x3b4c('0xb')]+'Message']){return rpc[this[_0x3b4c('0xb')]+_0x3b4c('0x12')][_0x3b4c('0x13')](_0x56cc0b)[_0x3b4c('0x14')](function(_0x1b9c85){logger[_0x3b4c('0x15')]('[%s][MESSAGE]\x20%s',_0x599dfb,_0x56cc0b['body']);_0x714b84[_0x3b4c('0x16')]();})[_0x3b4c('0x17')](function(_0x35bbf5){logger[_0x3b4c('0x18')](_0x3b4c('0x19'),_0x599dfb,JSON[_0x3b4c('0x1a')](_0x35bbf5));_0x714b84[_0x3b4c('0x1b')]();});}}catch(_0x68fed1){logger[_0x3b4c('0x18')](_0x3b4c('0x19'),_0x599dfb,JSON[_0x3b4c('0x1a')](_0x68fed1));_0x714b84['stop']();}};}; \ No newline at end of file +var _0xeff4=['AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','chat','ChatWebsiteId','account','upperFirst','channel'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xeff4,0xe5));var _0x4eff=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0xeff4[_0x1d128e];return _0x3d5236;};'use strict';var _=require(_0x4eff('0x0'));var utils=require(_0x4eff('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x4eff('0x2')),'openchannelMessage':require(_0x4eff('0x3')),'mailMessage':require(_0x4eff('0x4')),'smsMessage':require(_0x4eff('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4eff('0x6'))};exports[_0x4eff('0x7')]=function(_0x3305fc,_0x28d29f){return function(_0x566f95){try{var _0x3b5657={'body':utils[_0x4eff('0x8')](_0x28d29f[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x4eff('0x9')){_0x3b5657[_0x4eff('0xa')]=this[_0x4eff('0xb')]['id'];}else{_0x3b5657[_[_0x4eff('0xc')](this[_0x4eff('0xd')])+_0x4eff('0xe')]=this['account']['id'];}_0x3b5657[_[_0x4eff('0xc')](this[_0x4eff('0xd')])+_0x4eff('0xf')]=this[_0x4eff('0x10')]['id'];if(rpc[this[_0x4eff('0xd')]+_0x4eff('0x11')]){return rpc[this[_0x4eff('0xd')]+_0x4eff('0x11')][_0x4eff('0x12')](_0x3b5657)['then'](function(_0x5d4d17){logger[_0x4eff('0x13')](_0x4eff('0x14'),_0x3305fc,_0x3b5657[_0x4eff('0x15')]);_0x566f95[_0x4eff('0x16')]();})[_0x4eff('0x17')](function(_0x5edbc7){logger[_0x4eff('0x18')](_0x4eff('0x14'),_0x3305fc,JSON['stringify'](_0x5edbc7));_0x566f95[_0x4eff('0x19')]();});}}catch(_0xdd9201){logger[_0x4eff('0x18')](_0x4eff('0x14'),_0x3305fc,JSON[_0x4eff('0x1a')](_0xdd9201));_0x566f95['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 0e97d49..55a2738 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 _0xca4b=['./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','next','error','stop'];(function(_0x3561ac,_0x33f3a2){var _0x31e552=function(_0x4fcde6){while(--_0x4fcde6){_0x3561ac['push'](_0x3561ac['shift']());}};_0x31e552(++_0x33f3a2);}(_0xca4b,0xc0));var _0xbca4=function(_0x4c81c5,_0x2b14fc){_0x4c81c5=_0x4c81c5-0x0;var _0x420cc9=_0xca4b[_0x4c81c5];return _0x420cc9;};'use strict';var utils=require(_0xbca4('0x0'));var logger=require(_0xbca4('0x1'))(_0xbca4('0x2'));exports[_0xbca4('0x3')]=function(_0x2e221f,_0x4f43b2){return function(_0x28ea4a){try{logger['info'](_0xbca4('0x4'),_0x2e221f,utils['getMustacheRender'](_0x4f43b2[0x0],this));_0x28ea4a[_0xbca4('0x5')]();}catch(_0x24b53d){logger[_0xbca4('0x6')](_0xbca4('0x4'),_0x2e221f,JSON['stringify'](_0x24b53d));_0x28ea4a[_0xbca4('0x7')]();}};}; \ No newline at end of file +var _0xf7b0=['info','getMustacheRender','next','[%s][NOOP]\x20%s','stringify','stop','./utils','routing'];(function(_0x583b3a,_0x3cb8c0){var _0x2bc663=function(_0x242fcd){while(--_0x242fcd){_0x583b3a['push'](_0x583b3a['shift']());}};_0x2bc663(++_0x3cb8c0);}(_0xf7b0,0xee));var _0x0f7b=function(_0x4589b3,_0x4273d3){_0x4589b3=_0x4589b3-0x0;var _0x5dfbd6=_0xf7b0[_0x4589b3];return _0x5dfbd6;};'use strict';var utils=require(_0x0f7b('0x0'));var logger=require('../../../../config/logger')(_0x0f7b('0x1'));exports['consequence']=function(_0x5c6b59,_0x2cc1f5){return function(_0x9f35e8){try{logger[_0x0f7b('0x2')]('[%s][NOOP]\x20%s',_0x5c6b59,utils[_0x0f7b('0x3')](_0x2cc1f5[0x0],this));_0x9f35e8[_0x0f7b('0x4')]();}catch(_0x5f3bd5){logger['error'](_0x0f7b('0x5'),_0x5c6b59,JSON[_0x0f7b('0x6')](_0x5f3bd5));_0x9f35e8[_0x0f7b('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7701f85..4100f86 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 _0x336e=['complete','[%s][QUEUE]\x20APPLICATION\x20END','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','from','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x336e,0xf5));var _0xe336=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x336e[_0x45b034];return _0x509cb0;};'use strict';var schema=require(_0xe336('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xe336('0x1'));var Redis=require(_0xe336('0x2'));var config=require('../../../../config/environment');var logger=require(_0xe336('0x3'))(_0xe336('0x4'));var strategy=require(_0xe336('0x5'));config['redis']=_['defaults'](config[_0xe336('0x6')],{'host':_0xe336('0x7'),'port':0x18eb});var io=require(_0xe336('0x8'))(new Redis(config[_0xe336('0x6')]));var attributes=['id',_0xe336('0x9'),_0xe336('0xa'),_0xe336('0xb'),'from',_0xe336('0xc')];function emit(_0x537f96,_0x4bd0e9,_0x3a803f){io['to'](_0x537f96)['emit'](_0x4bd0e9,_0x3a803f);}function emitChannelQueueInteraction(_0x2b930f,_0x4af997,_0x23fe4e,_0x1a477f,_0x5b522a,_0x1eb3bc,_0x4734e3,_0x37115b){var _0x37b53c=_[_0xe336('0xd')](_0x23fe4e);_0x37b53c[_0xe336('0x9')]=_0x37115b;_0x37b53c[_0xe336('0xb')]=_0x4af997;_0x37b53c[_0xe336('0xa')]=_0x1a477f;_0x37b53c['id']=_0x5b522a;if(_0x1eb3bc){attributes[_0xe336('0xe')](_[_0xe336('0xf')](_0x2b930f)+_0xe336('0x10'));_0x4734e3[util[_0xe336('0x11')](_0xe336('0x12'),_0x2b930f)][_0x5b522a]=_[_0xe336('0x13')](_0x37b53c,attributes);}else{delete _0x4734e3[util[_0xe336('0x11')](_0xe336('0x12'),_0x2b930f)][_0x5b522a];}emit(util[_0xe336('0x11')]('%s:queue:%s',_0x2b930f,_0x4af997),util[_0xe336('0x11')](_0xe336('0x14'),_0x2b930f,_0x1eb3bc?_0xe336('0x15'):'remove'),_[_0xe336('0x13')](_0x37b53c,attributes));}var rpc={'openchannelQueueReport':require(_0xe336('0x16')),'mailQueueReport':require(_0xe336('0x17')),'chatQueueReport':require(_0xe336('0x18')),'smsQueueReport':require(_0xe336('0x19')),'faxQueueReport':require(_0xe336('0x1a')),'whatsappQueueReport':require(_0xe336('0x1b'))};var queue=schema({'name':{'type':_0xe336('0x1c'),'required':!![],'message':_0xe336('0x1d')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xa8bd84,_0x499f2d,_0x57a2a9,_0x1a7992){if(_0xa8bd84&&_0x499f2d&&_0x57a2a9){_0x499f2d[_0xe336('0x1e')]+=0x1;var _0xe6ca08={'uniqueid':_0xa8bd84,'from':_0x57a2a9[_0xe336('0x1f')]?_0x57a2a9[_0xe336('0x1f')][_0xe336('0x20')]:'','joinAt':moment()[_0xe336('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57a2a9[_0xe336('0x21')]?_0x57a2a9[_0xe336('0x21')]['id']:null,'ListId':_0x57a2a9[_0xe336('0x22')]?_0x57a2a9[_0xe336('0x22')]['id']:null};_0xe6ca08[_['upperFirst'](_0x57a2a9[_0xe336('0x23')])+_0xe336('0x24')]=_0x499f2d['id']||null;_0xe6ca08[_[_0xe336('0x25')](_0x57a2a9['channel'])+_0xe336('0x10')]=_0x57a2a9[_0xe336('0x26')]?_0x57a2a9[_0xe336('0x26')]['id']:null;_0xe6ca08[_[_0xe336('0x25')](_0x57a2a9[_0xe336('0x23')])+_0xe336('0x27')]=_0x57a2a9[_0xe336('0x28')]?_0x57a2a9[_0xe336('0x28')]['id']:null;_0xe6ca08[_[_0xe336('0x25')](_0x57a2a9[_0xe336('0x23')])+(_0x57a2a9['channel']!==_0xe336('0x29')?_0xe336('0x2a'):'WebsiteId')]=_0x57a2a9[_0xe336('0xa')]?_0x57a2a9[_0xe336('0xa')]['id']:null;logger[_0xe336('0x2b')](util[_0xe336('0x11')](_0xe336('0x2c'),_0xa8bd84,_0x499f2d[_0xe336('0x2d')]));emitChannelQueueInteraction(_0x57a2a9[_0xe336('0x23')],_0x499f2d[_0xe336('0x2d')],_0xe6ca08,_0x57a2a9[_0xe336('0xa')][_0xe336('0x2d')],_0x57a2a9[_0xe336('0x28')]['id'],!![],_0x1a7992,_0x499f2d['id']);if(rpc[_0x57a2a9[_0xe336('0x23')]+_0xe336('0x2e')]){return rpc[_0x57a2a9[_0xe336('0x23')]+_0xe336('0x2e')][_0xe336('0x2f')](_0xe6ca08)[_0xe336('0x30')](function(_0xd650da){logger[_0xe336('0x31')](_0xe336('0x32'));});}}}function stopRouting(_0x4b143b,_0x1acc22,_0x52fd08,_0xad8701){if(_0x4b143b&&_0x1acc22){_0x1acc22[_0xe336('0x1e')]-=0x1;var _0x3d5862={'leaveAt':moment()[_0xe336('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xe336('0x11')](_0xe336('0x33')),'reason':_0xe336('0x34')};logger[_0xe336('0x2b')](util[_0xe336('0x11')](_0xe336('0x35'),_0x4b143b,_0x1acc22['name']));emitChannelQueueInteraction(_0x52fd08[_0xe336('0x23')],_0x1acc22[_0xe336('0x2d')],_0x52fd08[_0xe336('0x1f')],_0x52fd08[_0xe336('0xa')][_0xe336('0x2d')],_0x52fd08[_0xe336('0x28')]['id'],![],_0xad8701,_0x1acc22['id']);if(rpc[_0x52fd08[_0xe336('0x23')]+'QueueReport']){return rpc[_0x52fd08['channel']+_0xe336('0x2e')][_0xe336('0x36')](_0x4b143b,_0x3d5862)['catch'](function(_0x2cb176){logger[_0xe336('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x1fcc02,_0x1b0ff4,_0x5894ae,_0x4f26e2){if(_0x1fcc02&&_0x1b0ff4){_0x1b0ff4['waiting']-=0x1;var _0x33168d={'leaveAt':moment()[_0xe336('0x11')](_0xe336('0x33')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0xe336('0x2b')](util[_0xe336('0x11')](_0xe336('0x37'),_0x1fcc02,_0x1b0ff4[_0xe336('0x2d')]));emitChannelQueueInteraction(_0x5894ae[_0xe336('0x23')],_0x1b0ff4[_0xe336('0x2d')],_0x5894ae[_0xe336('0x1f')],_0x5894ae['account'][_0xe336('0x2d')],_0x5894ae[_0xe336('0x28')]['id'],![],_0x4f26e2);if(rpc[_0x5894ae[_0xe336('0x23')]+'QueueReport']){return rpc[_0x5894ae[_0xe336('0x23')]+'QueueReport']['update'](_0x1fcc02,_0x33168d)[_0xe336('0x30')](function(_0x393f22){logger['error'](_0xe336('0x38'));});}}}function handleFindQueue(_0x4467ae){return function(_0x11be62){return _0x11be62[_0xe336('0x2d')][_0xe336('0x39')]()===_0x4467ae[_0xe336('0x39')]();};}exports[_0xe336('0x3a')]=function(_0x3a1ec0,_0x535205,_0x1ed8b5,_0x2ec02b){return function(_0x2892d8){try{var _0x527e10={'name':_0x535205[0x0],'timeout':_0x535205[0x1]};var _0x474946=queue[_0xe336('0x0')](_0x527e10,{'typecast':!![]});if(_0x474946['length']){logger[_0xe336('0x31')]('[%s][QUEUE]\x20%s',_0x3a1ec0,_[_0xe336('0x3b')](_0x474946,_0xe336('0x28'))[_0xe336('0x3c')](',\x20'));_0x2892d8[_0xe336('0x3d')]();}else{var _0x36fa6c=_[_0xe336('0x3e')](_0x1ed8b5[_0x2ec02b['channel']+_0xe336('0x3f')],handleFindQueue(_0x527e10[_0xe336('0x2d')]));if(_0x36fa6c){startRouting(_0x3a1ec0,_0x36fa6c,_0x2ec02b,_0x1ed8b5);var _0x30e9a0=(_0x36fa6c['timeout']||0xa)*0x3e8;var _0x31a357=(_0x527e10['timeout']||0x14)*0x3e8;var _0x13699d;if(_0x30e9a0>_0x31a357){_0x31a357=_0x30e9a0;}var _0x498d53=seqqueue[_0xe336('0x40')](_0x30e9a0);_0x498d53['id']=_0x3a1ec0;_0x498d53[_0xe336('0x41')]=_0x30e9a0;_0x498d53[_0xe336('0x42')]=_0x31a357;_0x498d53[_0xe336('0x23')]=_0x2ec02b[_0xe336('0x23')];_0x1ed8b5[_0xe336('0x43')][_0x3a1ec0]['on'](_0xe336('0x44'),function(){logger[_0xe336('0x2b')](_0xe336('0x45'),_0x3a1ec0);stopRouting(_0x3a1ec0,_0x36fa6c,_0x2ec02b,_0x1ed8b5);clearTimeout(_0x13699d);_0x13699d=undefined;_0x498d53[_0xe336('0x46')](!![]);if(_0x1ed8b5[_0xe336('0x43')][_0x3a1ec0]){delete _0x1ed8b5[_0xe336('0x43')][_0x3a1ec0];}_0x2892d8[_0xe336('0x3d')]();});_0x1ed8b5[_0xe336('0x43')][_0x3a1ec0]['on'](_0xe336('0x47'),function(){if(_0x1ed8b5['rules'][_0x3a1ec0]){delete _0x1ed8b5[_0xe336('0x43')][_0x3a1ec0];}});_0x13699d=setTimeout(function(){logger[_0xe336('0x2b')](_0xe336('0x48'),_0x3a1ec0);endRouting(_0x3a1ec0,_0x36fa6c,_0x2ec02b,_0x1ed8b5);clearTimeout(_0x13699d);_0x498d53[_0xe336('0x46')](!![]);_0x2892d8['next']();},_0x31a357);switch(_0x36fa6c['strategy']){case _0xe336('0x49'):strategy['rrmemory'](_0x498d53,_0x36fa6c,_0x1ed8b5,_0x2ec02b);break;default:strategy[_0xe336('0x4a')](_0x498d53,_0x36fa6c,_0x1ed8b5,_0x2ec02b);}}else{logger['error'](_0xe336('0x4b'),_0x3a1ec0,_0x527e10['name']);_0x2892d8['stop']();}}}catch(_0x2634d0){console[_0xe336('0x4c')](_0x2634d0);logger['error'](_0xe336('0x4d'),_0x3a1ec0,_0x2634d0[_0xe336('0x4e')]);_0x2892d8[_0xe336('0x3d')]();}};}; \ No newline at end of file +var _0xd206=['consequence','length','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','end','close','rules','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','joinAt','emit','clone','push','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','account','update','catch','timeout','info','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase'];(function(_0x56144e,_0x56b763){var _0x2a2ae7=function(_0x1820ec){while(--_0x1820ec){_0x56144e['push'](_0x56144e['shift']());}};_0x2a2ae7(++_0x56b763);}(_0xd206,0x101));var _0x6d20=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xd206[_0x42bdad];return _0x122626;};'use strict';var schema=require(_0x6d20('0x0'));var _=require(_0x6d20('0x1'));var util=require(_0x6d20('0x2'));var seqqueue=require(_0x6d20('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x6d20('0x4'));var logger=require(_0x6d20('0x5'))(_0x6d20('0x6'));var strategy=require(_0x6d20('0x7'));config[_0x6d20('0x8')]=_[_0x6d20('0x9')](config[_0x6d20('0x8')],{'host':_0x6d20('0xa'),'port':0x18eb});var io=require(_0x6d20('0xb'))(new Redis(config[_0x6d20('0x8')]));var attributes=['id',_0x6d20('0xc'),'account',_0x6d20('0xd'),'from',_0x6d20('0xe')];function emit(_0x1d3323,_0x2c9180,_0x392c2a){io['to'](_0x1d3323)[_0x6d20('0xf')](_0x2c9180,_0x392c2a);}function emitChannelQueueInteraction(_0x3a15e3,_0x13f1bc,_0x53cda2,_0x5a8be2,_0x1e51d9,_0x148d1c,_0xb9ee03,_0x2e0717){var _0xdd6560=_[_0x6d20('0x10')](_0x53cda2);_0xdd6560[_0x6d20('0xc')]=_0x2e0717;_0xdd6560[_0x6d20('0xd')]=_0x13f1bc;_0xdd6560['account']=_0x5a8be2;_0xdd6560['id']=_0x1e51d9;if(_0x148d1c){attributes[_0x6d20('0x11')](_[_0x6d20('0x12')](_0x3a15e3)+_0x6d20('0x13'));_0xb9ee03[util['format'](_0x6d20('0x14'),_0x3a15e3)][_0x1e51d9]=_[_0x6d20('0x15')](_0xdd6560,attributes);}else{delete _0xb9ee03[util[_0x6d20('0x16')]('%sQueuesWaitingInteractions',_0x3a15e3)][_0x1e51d9];}emit(util[_0x6d20('0x16')](_0x6d20('0x17'),_0x3a15e3,_0x13f1bc),util[_0x6d20('0x16')](_0x6d20('0x18'),_0x3a15e3,_0x148d1c?'save':_0x6d20('0x19')),_['pick'](_0xdd6560,attributes));}var rpc={'openchannelQueueReport':require(_0x6d20('0x1a')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x6d20('0x1b')),'faxQueueReport':require(_0x6d20('0x1c')),'whatsappQueueReport':require(_0x6d20('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x6d20('0x1e')},'timeout':{'type':'number','message':_0x6d20('0x1f')}});function startRouting(_0x9dcb4d,_0x27b2cd,_0x3e2bd8,_0x52d0c6){if(_0x9dcb4d&&_0x27b2cd&&_0x3e2bd8){_0x27b2cd[_0x6d20('0x20')]+=0x1;var _0x4fc8f2={'uniqueid':_0x9dcb4d,'from':_0x3e2bd8[_0x6d20('0x21')]?_0x3e2bd8['body'][_0x6d20('0x22')]:'','joinAt':moment()['format'](_0x6d20('0x23')),'ContactId':_0x3e2bd8[_0x6d20('0x24')]?_0x3e2bd8[_0x6d20('0x24')]['id']:null,'ListId':_0x3e2bd8[_0x6d20('0x25')]?_0x3e2bd8[_0x6d20('0x25')]['id']:null};_0x4fc8f2[_[_0x6d20('0x26')](_0x3e2bd8[_0x6d20('0x27')])+'QueueId']=_0x27b2cd['id']||null;_0x4fc8f2[_[_0x6d20('0x26')](_0x3e2bd8[_0x6d20('0x27')])+_0x6d20('0x13')]=_0x3e2bd8[_0x6d20('0x28')]?_0x3e2bd8[_0x6d20('0x28')]['id']:null;_0x4fc8f2[_[_0x6d20('0x26')](_0x3e2bd8[_0x6d20('0x27')])+_0x6d20('0x29')]=_0x3e2bd8[_0x6d20('0x2a')]?_0x3e2bd8[_0x6d20('0x2a')]['id']:null;_0x4fc8f2[_['upperFirst'](_0x3e2bd8[_0x6d20('0x27')])+(_0x3e2bd8[_0x6d20('0x27')]!==_0x6d20('0x2b')?_0x6d20('0x2c'):_0x6d20('0x2d'))]=_0x3e2bd8['account']?_0x3e2bd8['account']['id']:null;logger['info'](util['format'](_0x6d20('0x2e'),_0x9dcb4d,_0x27b2cd[_0x6d20('0x2f')]));emitChannelQueueInteraction(_0x3e2bd8[_0x6d20('0x27')],_0x27b2cd['name'],_0x4fc8f2,_0x3e2bd8['account'][_0x6d20('0x2f')],_0x3e2bd8[_0x6d20('0x2a')]['id'],!![],_0x52d0c6,_0x27b2cd['id']);if(rpc[_0x3e2bd8[_0x6d20('0x27')]+_0x6d20('0x30')]){return rpc[_0x3e2bd8[_0x6d20('0x27')]+_0x6d20('0x30')][_0x6d20('0x31')](_0x4fc8f2)['catch'](function(_0xad67cd){logger[_0x6d20('0x32')]('create\x20queue\x20report');});}}}function stopRouting(_0x30da3f,_0x3c2656,_0x2bcd48,_0x231870){if(_0x30da3f&&_0x3c2656){_0x3c2656[_0x6d20('0x20')]-=0x1;var _0x5435ee={'leaveAt':moment()[_0x6d20('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x6d20('0x16')](_0x6d20('0x23')),'reason':'accepted'};logger['info'](util[_0x6d20('0x16')]('[%s][STOP:QUEUE][NAME:%s]',_0x30da3f,_0x3c2656[_0x6d20('0x2f')]));emitChannelQueueInteraction(_0x2bcd48['channel'],_0x3c2656[_0x6d20('0x2f')],_0x2bcd48['body'],_0x2bcd48[_0x6d20('0x33')]['name'],_0x2bcd48[_0x6d20('0x2a')]['id'],![],_0x231870,_0x3c2656['id']);if(rpc[_0x2bcd48[_0x6d20('0x27')]+_0x6d20('0x30')]){return rpc[_0x2bcd48[_0x6d20('0x27')]+_0x6d20('0x30')][_0x6d20('0x34')](_0x30da3f,_0x5435ee)[_0x6d20('0x35')](function(_0x5dd840){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x4e34c7,_0x16e006,_0xad7f72,_0x3765c3){if(_0x4e34c7&&_0x16e006){_0x16e006[_0x6d20('0x20')]-=0x1;var _0x517346={'leaveAt':moment()[_0x6d20('0x16')](_0x6d20('0x23')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6d20('0x36')};logger[_0x6d20('0x37')](util['format'](_0x6d20('0x38'),_0x4e34c7,_0x16e006[_0x6d20('0x2f')]));emitChannelQueueInteraction(_0xad7f72[_0x6d20('0x27')],_0x16e006[_0x6d20('0x2f')],_0xad7f72['body'],_0xad7f72['account'][_0x6d20('0x2f')],_0xad7f72[_0x6d20('0x2a')]['id'],![],_0x3765c3);if(rpc[_0xad7f72[_0x6d20('0x27')]+_0x6d20('0x30')]){return rpc[_0xad7f72[_0x6d20('0x27')]+_0x6d20('0x30')][_0x6d20('0x34')](_0x4e34c7,_0x517346)[_0x6d20('0x35')](function(_0x384117){logger[_0x6d20('0x32')](_0x6d20('0x39'));});}}}function handleFindQueue(_0x3b0fae){return function(_0x359b9a){return _0x359b9a[_0x6d20('0x2f')][_0x6d20('0x3a')]()===_0x3b0fae['toLowerCase']();};}exports[_0x6d20('0x3b')]=function(_0x4c1f22,_0x52979f,_0x5716cb,_0x10556e){return function(_0x4f595f){try{var _0x563846={'name':_0x52979f[0x0],'timeout':_0x52979f[0x1]};var _0x3edaaf=queue[_0x6d20('0x0')](_0x563846,{'typecast':!![]});if(_0x3edaaf[_0x6d20('0x3c')]){logger[_0x6d20('0x32')](_0x6d20('0x3d'),_0x4c1f22,_[_0x6d20('0x3e')](_0x3edaaf,_0x6d20('0x2a'))['join'](',\x20'));_0x4f595f['stop']();}else{var _0x51826e=_[_0x6d20('0x3f')](_0x5716cb[_0x10556e[_0x6d20('0x27')]+_0x6d20('0x40')],handleFindQueue(_0x563846[_0x6d20('0x2f')]));if(_0x51826e){startRouting(_0x4c1f22,_0x51826e,_0x10556e,_0x5716cb);var _0x223ad1=(_0x51826e[_0x6d20('0x36')]||0xa)*0x3e8;var _0xaa5e4f=(_0x563846[_0x6d20('0x36')]||0x14)*0x3e8;var _0x31a63b;if(_0x223ad1>_0xaa5e4f){_0xaa5e4f=_0x223ad1;}var _0x35a655=seqqueue[_0x6d20('0x41')](_0x223ad1);_0x35a655['id']=_0x4c1f22;_0x35a655[_0x6d20('0x42')]=_0x223ad1;_0x35a655['qtimeout']=_0xaa5e4f;_0x35a655[_0x6d20('0x27')]=_0x10556e[_0x6d20('0x27')];_0x5716cb['rules'][_0x4c1f22]['on'](_0x6d20('0x43'),function(){logger[_0x6d20('0x37')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4c1f22);stopRouting(_0x4c1f22,_0x51826e,_0x10556e,_0x5716cb);clearTimeout(_0x31a63b);_0x31a63b=undefined;_0x35a655[_0x6d20('0x44')](!![]);if(_0x5716cb[_0x6d20('0x45')][_0x4c1f22]){delete _0x5716cb[_0x6d20('0x45')][_0x4c1f22];}_0x4f595f[_0x6d20('0x46')]();});_0x5716cb[_0x6d20('0x45')][_0x4c1f22]['on']('complete',function(){if(_0x5716cb['rules'][_0x4c1f22]){delete _0x5716cb['rules'][_0x4c1f22];}});_0x31a63b=setTimeout(function(){logger['info'](_0x6d20('0x47'),_0x4c1f22);endRouting(_0x4c1f22,_0x51826e,_0x10556e,_0x5716cb);clearTimeout(_0x31a63b);_0x35a655[_0x6d20('0x44')](!![]);_0x4f595f[_0x6d20('0x48')]();},_0xaa5e4f);switch(_0x51826e[_0x6d20('0x49')]){case _0x6d20('0x4a'):strategy[_0x6d20('0x4a')](_0x35a655,_0x51826e,_0x5716cb,_0x10556e);break;default:strategy[_0x6d20('0x4b')](_0x35a655,_0x51826e,_0x5716cb,_0x10556e);}}else{logger[_0x6d20('0x32')](_0x6d20('0x4c'),_0x4c1f22,_0x563846[_0x6d20('0x2f')]);_0x4f595f[_0x6d20('0x46')]();}}}catch(_0x335d93){console[_0x6d20('0x4d')](_0x335d93);logger[_0x6d20('0x32')](_0x6d20('0x3d'),_0x4c1f22,_0x335d93[_0x6d20('0x4e')]);_0x4f595f[_0x6d20('0x46')]();}};}; \ 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 d39c3be..b095172 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 _0x0e85=['lodash','uuid','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','channel','writeLog',':FORCED','isNil','hideNotification','notificationId','removeWaitingNotification','STOP','TIMEOUT'];(function(_0x41dcc,_0x1c08e0){var _0x5ea0b5=function(_0x12ead5){while(--_0x12ead5){_0x41dcc['push'](_0x41dcc['shift']());}};_0x5ea0b5(++_0x1c08e0);}(_0x0e85,0x7c));var _0x50e8=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x0e85[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x50e8('0x0'));var uuid=require(_0x50e8('0x1'));var util=require('./util');var logger=require(_0x50e8('0x2'))(_0x50e8('0x3'));var Agent=function(_0x55e515,_0x55cba3,_0x4ce6cd,_0x236cf3){this['notificationId']=uuid['v4']();this[_0x50e8('0x4')]=_0x55e515;this[_0x50e8('0x5')]=_0x55cba3;this[_0x50e8('0x6')]=_0x4ce6cd;this[_0x50e8('0x3')]=_0x236cf3;this['squeue'][_0x50e8('0x7')](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on']('timeout',this[_0x50e8('0xa')][_0x50e8('0x9')](this));this[_0x50e8('0x4')]['on'](_0x50e8('0xb'),this[_0x50e8('0xc')][_0x50e8('0x9')](this));};Agent[_0x50e8('0xd')][_0x50e8('0x7')]=function(){this['squeue']['push'](this[_0x50e8('0x8')][_0x50e8('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0x50e8('0xd')][_0x50e8('0xc')]=function(){this[_0x50e8('0xa')](!![]);};Agent[_0x50e8('0xd')]['handleRun']=function(){logger[_0x50e8('0xe')](_0x50e8('0xf'),this[_0x50e8('0x4')]['id'],this['agent']['id']);if(_['isNil'](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){logger[_0x50e8('0xe')](_0x50e8('0x11'),this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x50e8('0x9')](this),0x3e8);}else{if(this[_0x50e8('0x3')][_0x50e8('0x12')]||util[_0x50e8('0x13')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],this[_0x50e8('0x4')]['channel'],![])){this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=!![];this[_0x50e8('0x6')]['agents'][this[_0x50e8('0x5')]['id']][_0x50e8('0x15')]=undefined;util['saveWaitingNotification'](this[_0x50e8('0x6')],this[_0x50e8('0x3')],this['agent'],this[_0x50e8('0x4')][_0x50e8('0x16')]);util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this[_0x50e8('0x3')]);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],'RINGING'+(this[_0x50e8('0x3')][_0x50e8('0x12')]?_0x50e8('0x18'):''));}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x50e8('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}}};Agent[_0x50e8('0xd')]['handleTimeout']=function(_0x1041b9){if(_[_0x50e8('0x19')](this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']])){return logger[_0x50e8('0xe')](_0x50e8('0x11'),this['squeue']['id'],this[_0x50e8('0x5')]['id']);}else{logger[_0x50e8('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x50e8('0x5')]['id']);util[_0x50e8('0x1a')](this[_0x50e8('0x1b')],this['squeue']['id'],this['realtime'][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']],null,this['routing']);this[_0x50e8('0x6')][_0x50e8('0x10')][this[_0x50e8('0x5')]['id']][_0x50e8('0x14')]=![];this['realtime'][_0x50e8('0x10')][this['agent']['id']][_0x50e8('0x15')]=undefined;util[_0x50e8('0x1c')](this[_0x50e8('0x6')],this['routing'],this[_0x50e8('0x5')],this[_0x50e8('0x4')]['channel']);util[_0x50e8('0x17')](this[_0x50e8('0x4')]['id'],this[_0x50e8('0x6')][_0x50e8('0x10')][this['agent']['id']],_0x1041b9?_0x50e8('0x1d'):_0x50e8('0x1e'));}if(!_0x1041b9){setTimeout(this[_0x50e8('0x7')][_0x50e8('0x9')](this),0x3e8);}};function agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee){return new Agent(_0x5e556c,_0x3c7778,_0x2d0ccf,_0x3f01ee);}module['exports']=agent; \ No newline at end of file +var _0x29d4=['routing','notificationId','squeue','agent','realtime','push','bind','timeout','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger'];(function(_0x14f53e,_0x442d7f){var _0x42a047=function(_0x372fbf){while(--_0x372fbf){_0x14f53e['push'](_0x14f53e['shift']());}};_0x42a047(++_0x442d7f);}(_0x29d4,0x1a1));var _0x429d=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x29d4[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0x429d('0x0'));var uuid=require('uuid');var util=require(_0x429d('0x1'));var logger=require(_0x429d('0x2'))(_0x429d('0x3'));var Agent=function(_0x472fc9,_0x45df1c,_0x4e287b,_0xc3989d){this[_0x429d('0x4')]=uuid['v4']();this[_0x429d('0x5')]=_0x472fc9;this[_0x429d('0x6')]=_0x45df1c;this[_0x429d('0x7')]=_0x4e287b;this[_0x429d('0x3')]=_0xc3989d;this[_0x429d('0x5')][_0x429d('0x8')](this['handleRun'][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on'](_0x429d('0xa'),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on']('drained',this[_0x429d('0xb')][_0x429d('0x9')](this));};Agent[_0x429d('0xc')]['push']=function(){this[_0x429d('0x5')][_0x429d('0x8')](this[_0x429d('0xd')][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));};Agent[_0x429d('0xc')][_0x429d('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x429d('0xc')][_0x429d('0xd')]=function(){logger['debug'](_0x429d('0xe'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);if(_[_0x429d('0xf')](this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']])){logger[_0x429d('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}else{if(this['routing'][_0x429d('0x12')]||util[_0x429d('0x13')](this[_0x429d('0x5')]['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],this[_0x429d('0x5')][_0x429d('0x14')],![])){this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=!![];this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x16')]=undefined;util[_0x429d('0x17')](this[_0x429d('0x7')],this[_0x429d('0x3')],this[_0x429d('0x6')],this[_0x429d('0x5')]['channel']);util[_0x429d('0x18')](this[_0x429d('0x4')],this['squeue']['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this[_0x429d('0x3')]);util['writeLog'](this[_0x429d('0x5')]['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],_0x429d('0x19')+(this['routing'][_0x429d('0x12')]?_0x429d('0x1a'):''));}else{logger[_0x429d('0x11')](_0x429d('0x1b'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}}};Agent[_0x429d('0xc')]['handleTimeout']=function(_0x31cae6){if(_[_0x429d('0xf')](this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']])){return logger[_0x429d('0x11')](_0x429d('0x1c'),this[_0x429d('0x5')]['id'],this['agent']['id']);}else{logger[_0x429d('0x11')](_0x429d('0x1d'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);util[_0x429d('0x1e')](this[_0x429d('0x4')],this['squeue']['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this['routing']);this['realtime'][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=![];this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']]['busyQueue']=undefined;util[_0x429d('0x1f')](this[_0x429d('0x7')],this['routing'],this['agent'],this['squeue']['channel']);util['writeLog'](this[_0x429d('0x5')]['id'],this['realtime']['agents'][this[_0x429d('0x6')]['id']],_0x31cae6?_0x429d('0x20'):_0x429d('0x21'));}if(!_0x31cae6){setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}};function agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5){return new Agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5);}module[_0x429d('0x22')]=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 d6ed00c..1fed636 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 _0x70c8=['name','channel','showNotification','notificationId','routing','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','queue','realtime','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue'];(function(_0x58140e,_0x236d3c){var _0x363acd=function(_0x257b77){while(--_0x257b77){_0x58140e['push'](_0x58140e['shift']());}};_0x363acd(++_0x236d3c);}(_0x70c8,0x75));var _0x870c=function(_0x49a632,_0x8df822){_0x49a632=_0x49a632-0x0;var _0xc39e11=_0x70c8[_0x49a632];return _0xc39e11;};'use strict';var _=require(_0x870c('0x0'));var uuid=require(_0x870c('0x1'));var util=require(_0x870c('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x25680e,_0x25604a,_0x233b98,_0x351fc1){this['notificationId']=uuid['v4']();this['squeue']=_0x25680e;this[_0x870c('0x3')]=_0x25604a;this[_0x870c('0x4')]=_0x233b98;this['routing']=_0x351fc1;this[_0x870c('0x5')][_0x870c('0x6')](this[_0x870c('0x7')][_0x870c('0x8')](this),this['handleTimeout']['bind'](this));this[_0x870c('0x5')]['on'](_0x870c('0x9'),this[_0x870c('0xa')][_0x870c('0x8')](this));this['squeue']['on'](_0x870c('0xb'),this[_0x870c('0xc')][_0x870c('0x8')](this));};Beepall[_0x870c('0xd')][_0x870c('0x6')]=function(){this[_0x870c('0x5')][_0x870c('0x6')](this['handleRun'][_0x870c('0x8')](this),this[_0x870c('0xa')]['bind'](this));};Beepall[_0x870c('0xd')][_0x870c('0xc')]=function(){this['handleTimeout'](!![]);};Beepall[_0x870c('0xd')]['handleRun']=function(){var _0x5dfb41=!![];if(!_[_0x870c('0xe')](this['queue'])&&!_[_0x870c('0xe')](this['queue'][_0x870c('0xf')])&&this[_0x870c('0x3')]['Agents']['length']>0x0){for(var _0x588706=0x0,_0x1e47b4;_0x5887060x0){for(var _0x1df33c=0x0,_0x4e63db;_0x1df33c0x0&&_0x4e0306[_0x28002d+'CurrentCapacity']>=_0x4e0306[_0x28002d+_0x13b5('0x23')]){writeLog(_0x574a34,_0x4e0306,_0x28002d[_0x13b5('0x26')]()+_0x13b5('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x2ce950,_0x5e5ccd,_0x1232f3,_0x125f7a,_0x9136f9){return sendNotification(!![],_0x2ce950,_0x5e5ccd,_0x1232f3,_0x125f7a,_0x9136f9);};exports['hideNotification']=function(_0x4f856f,_0x3955ad,_0x18da42,_0x52d1ec,_0x5668a5){return sendNotification(![],_0x4f856f,_0x3955ad,_0x18da42,_0x52d1ec,_0x5668a5);};exports[_0x13b5('0x28')]=function(_0x4cbb81,_0x1bde95,_0x3866df){var _0x41f130=_0x1bde95[_0x13b5('0x29')][_0x13b5('0x2a')];if(!_0x41f130&&_0x3866df){_0x41f130=_0x3866df['id'];}var _0x4c4697=_[_0x13b5('0x2b')](_0x4cbb81[_0x1bde95[_0x13b5('0x2c')]+_0x13b5('0x2d')],function(_0x1f03fb){var _0x5f6a=_[_0x13b5('0x2e')](_0x1bde95[_0x13b5('0x2c')])+_0x13b5('0x2f');return _0x1f03fb[_0x5f6a]===_0x1bde95[_0x13b5('0x29')]['id'];});if(!_0x4c4697&&_0x41f130){_0x4c4697=_[_0x13b5('0x2b')](_0x4cbb81[_0x13b5('0x30')][_0x41f130][_0x1bde95[_0x13b5('0x2c')]+_0x13b5('0x31')],function(_0x24553d){return _0x24553d['id']===_0x1bde95[_0x13b5('0x29')]['id'];});}return _0x4c4697;};exports[_0x13b5('0x32')]=function(_0x406ded,_0x4fb236,_0x484f6a,_0x3246ff){_0x406ded[_0x13b5('0x30')][_0x484f6a['id']][_0x3246ff+_0x13b5('0x31')][_0x4fb236[_0x13b5('0x33')]['id']]={'id':_0x4fb236[_0x13b5('0x29')]['id']};};exports[_0x13b5('0x34')]=function(_0x283681,_0x5448bc,_0x8b9d76,_0x174e47){delete _0x283681[_0x13b5('0x30')][_0x8b9d76['id']][_0x174e47+_0x13b5('0x31')][_0x5448bc[_0x13b5('0x33')]['id']];};exports[_0x13b5('0x35')]=writeLog; \ No newline at end of file +var _0x2862=['localhost','socket.io-emitter','format','user:%s','name','emit','split','\x20interaction','notificationSound','account','notificationShake','body','queue','getMustacheRender','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','WaitingInteractions','saveWaitingNotification','agents','message','util','routing','redis','defaults'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x2862,0x1be));var _0x2286=function(_0x48844c,_0x3dafb3){_0x48844c=_0x48844c-0x0;var _0x103fb9=_0x2862[_0x48844c];return _0x103fb9;};'use strict';var _=require('lodash');var util=require(_0x2286('0x0'));var utils=require('../utils');var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x2286('0x1'));config[_0x2286('0x2')]=_[_0x2286('0x3')](config[_0x2286('0x2')],{'host':_0x2286('0x4'),'port':0x18eb});var io=require(_0x2286('0x5'))(new Redis(config[_0x2286('0x2')]));function sendNotification(_0x17ba32,_0x5d6a88,_0x10e36b,_0x88cf22,_0x57ee61,_0x192422){io['to'](util[_0x2286('0x6')](_0x2286('0x7'),_0x88cf22[_0x2286('0x8')]))[_0x2286('0x9')]('user:save',_0x88cf22);var _0x10a684=_0x192422||{};var _0x1ca60b=_0x10e36b[_0x2286('0xa')]('.');var _0x190176={'uniqueid':_0x5d6a88,'channel':_0x1ca60b[0x0],'id':_0x1ca60b[0x1],'title':_0x1ca60b[0x0]+_0x2286('0xb'),'interactionId':_0x1ca60b[0x2],'queue':_0x57ee61?_0x57ee61[_0x2286('0x8')]:null,'sound':_0x10a684['account'][_0x2286('0xc')],'shake':_0x10a684[_0x2286('0xd')][_0x2286('0xe')]};try{if(!_0x10a684[_0x2286('0xf')]){_0x10a684[_0x2286('0xf')]={};}if(_0x57ee61){_0x10a684['body'][_0x2286('0x10')]=_0x57ee61;}else if(_0x10a684[_0x2286('0xf')][_0x2286('0x10')]){delete _0x10a684[_0x2286('0xf')]['queue'];}_0x190176['msg']=utils[_0x2286('0x11')](_0x10a684[_0x2286('0xd')]['notificationTemplate'],_0x10a684);}catch(_0x461aff){_0x190176[_0x2286('0x12')]=_0x2286('0x13');logger[_0x2286('0x14')](util[_0x2286('0x6')](_0x2286('0x15'),_0x5d6a88,_0x461aff['message']));}io['to'](util[_0x2286('0x6')]('user:%s',_0x88cf22[_0x2286('0x8')]))[_0x2286('0x9')](util['format'](_0x2286('0x16'),_0x17ba32?_0x2286('0x17'):'remove'),_0x190176);}function writeLog(_0x50af83,_0x2fe857,_0xb0bcd8){return logger[_0x2286('0x18')](util['format'](_0x2286('0x19'),_0x50af83,_0x2fe857[_0x2286('0x8')],_0xb0bcd8));}exports['isAgentAvailable']=function(_0x34c732,_0x309327,_0x48e4ef,_0x34988e){if(_0x309327[_0x2286('0x1a')]){writeLog(_0x34c732,_0x309327,_0x2286('0x1b'));return![];}if(!_0x309327['online']){writeLog(_0x34c732,_0x309327,_0x2286('0x1c'));return![];}if(_0x309327[_0x48e4ef+_0x2286('0x1d')]){writeLog(_0x34c732,_0x309327,_0x2286('0x1e'));return![];}if(_0x34988e&&_0x309327[_0x2286('0x1f')](_0x48e4ef+_0x2286('0x20'))&&_0x309327[_0x2286('0x1f')](_0x48e4ef+_0x2286('0x21'))){if(_0x309327[_0x48e4ef+_0x2286('0x20')]>0x0&&_0x309327[_0x48e4ef+_0x2286('0x21')]>=_0x309327[_0x48e4ef+_0x2286('0x20')]){writeLog(_0x34c732,_0x309327,_0x48e4ef[_0x2286('0x22')]()+_0x2286('0x23'));return![];}}return!![];};exports[_0x2286('0x24')]=function(_0x2f07ed,_0x3286fa,_0x11f6c5,_0xf5469e,_0x9de2fd){return sendNotification(!![],_0x2f07ed,_0x3286fa,_0x11f6c5,_0xf5469e,_0x9de2fd);};exports[_0x2286('0x25')]=function(_0x1d0648,_0x299de6,_0xe40092,_0x3b04b5,_0x4441a6){return sendNotification(![],_0x1d0648,_0x299de6,_0xe40092,_0x3b04b5,_0x4441a6);};exports[_0x2286('0x26')]=function(_0x30f7e8,_0x2efa57,_0x40876d){var _0x584bf6=_0x2efa57[_0x2286('0x27')][_0x2286('0x28')];if(!_0x584bf6&&_0x40876d){_0x584bf6=_0x40876d['id'];}var _0x3583f5=_[_0x2286('0x29')](_0x30f7e8[_0x2efa57[_0x2286('0x2a')]+_0x2286('0x2b')],function(_0xea7f46){var _0x1e22ea=_[_0x2286('0x2c')](_0x2efa57['channel'])+_0x2286('0x2d');return _0xea7f46[_0x1e22ea]===_0x2efa57['interaction']['id'];});if(!_0x3583f5&&_0x584bf6){_0x3583f5=_['some'](_0x30f7e8['agents'][_0x584bf6][_0x2efa57['channel']+_0x2286('0x2e')],function(_0x367b06){return _0x367b06['id']===_0x2efa57[_0x2286('0x27')]['id'];});}return _0x3583f5;};exports[_0x2286('0x2f')]=function(_0x4f3a47,_0x11bb77,_0x59ff15,_0x54749c){_0x4f3a47[_0x2286('0x30')][_0x59ff15['id']][_0x54749c+_0x2286('0x2e')][_0x11bb77[_0x2286('0x31')]['id']]={'id':_0x11bb77['interaction']['id']};};exports['removeWaitingNotification']=function(_0x2d644f,_0x1c40c1,_0x3fc723,_0x910278){delete _0x2d644f[_0x2286('0x30')][_0x3fc723['id']][_0x910278+_0x2286('0x2e')][_0x1c40c1[_0x2286('0x31')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 23f0848..f8d8975 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 _0x98ea=['validate','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','exec','trim','replace','isNil','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','next'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x98ea,0x1ce));var _0xa98e=function(_0x13df25,_0x41fce8){_0x13df25=_0x13df25-0x0;var _0x57176e=_0x98ea[_0x13df25];return _0x57176e;};'use strict';var schema=require(_0xa98e('0x0'));var sh=require('shelljs');var _=require(_0xa98e('0x1'));var utils=require('./utils');var logger=require(_0xa98e('0x2'))(_0xa98e('0x3'));var system=schema({'command':{'type':_0xa98e('0x4'),'required':!![],'message':_0xa98e('0x5')}});exports[_0xa98e('0x6')]=function(_0x4fb7b0,_0x45727a){return function(_0x4c4eaf){try{var _0x4517b4={'command':_0x45727a[0x0]};var _0x3c7612=system[_0xa98e('0x0')](_0x4517b4,{'typecast':!![]});if(_0x3c7612['length']){logger[_0xa98e('0x7')](_0xa98e('0x8'),_0x4fb7b0,_['map'](_0x3c7612,_0xa98e('0x9'))[_0xa98e('0xa')](',\x20'));logger['info'](_0xa98e('0xb'),_0x4fb7b0);_0x4c4eaf['next']();}else{var _0x2faf52=this;var _0x563d54=utils['getMustacheRender'](_0x45727a[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x4fb7b0,_0x563d54);sh[_0xa98e('0xc')](_[_0xa98e('0xd')](_0x563d54),function(_0x5bd8e8,_0x51698b){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4fb7b0,_0x5bd8e8);if(_0x5bd8e8==0x0){var _0x270b28=_0x51698b[_0xa98e('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0xa98e('0xf')](_0x45727a[0x1])||_['isEmpty'](_0x45727a[0x1])){logger[_0xa98e('0x10')](_0xa98e('0x11'),_0x4fb7b0);_0x2faf52[_0xa98e('0x12')][_0x45727a[0x1]]=_0x270b28;}else{logger['info'](_0xa98e('0x13'),_0x4fb7b0,_0x45727a[0x1],_0x270b28);_0x2faf52[_0xa98e('0x12')][_0x45727a[0x1]]=_0x270b28;}}_0x4c4eaf['next']();});}}catch(_0x4f0e4){logger[_0xa98e('0x7')](_0xa98e('0x8'),_0x4fb7b0,_[_0xa98e('0x14')](_0x4f0e4)?JSON['stringify'](_0x4f0e4):_0x4f0e4);logger[_0xa98e('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4fb7b0);_0x4c4eaf[_0xa98e('0x15')]();}};}; \ No newline at end of file +var _0x4f20=['error','isObject','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','[%s][SYSTEM]\x20%s','join','info','next','getMustacheRender','exec','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4f20,0x86));var _0x04f2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4f20[_0x618414];return _0x21c19a;};'use strict';var schema=require('validate');var sh=require(_0x04f2('0x0'));var _=require(_0x04f2('0x1'));var utils=require(_0x04f2('0x2'));var logger=require(_0x04f2('0x3'))('routing');var system=schema({'command':{'type':_0x04f2('0x4'),'required':!![],'message':_0x04f2('0x5')}});exports[_0x04f2('0x6')]=function(_0x6605bd,_0x20de45){return function(_0x194568){try{var _0x4ea8e0={'command':_0x20de45[0x0]};var _0x2436b4=system[_0x04f2('0x7')](_0x4ea8e0,{'typecast':!![]});if(_0x2436b4[_0x04f2('0x8')]){logger['error'](_0x04f2('0x9'),_0x6605bd,_['map'](_0x2436b4,'message')[_0x04f2('0xa')](',\x20'));logger[_0x04f2('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x6605bd);_0x194568[_0x04f2('0xc')]();}else{var _0x141f28=this;var _0x2ac330=utils[_0x04f2('0xd')](_0x20de45[0x0],this);logger[_0x04f2('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x6605bd,_0x2ac330);sh[_0x04f2('0xe')](_['trim'](_0x2ac330),function(_0x484db0,_0x461bc2){logger[_0x04f2('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x6605bd,_0x484db0);if(_0x484db0==0x0){var _0x560a34=_0x461bc2['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x04f2('0xf')](_0x20de45[0x1])||_[_0x04f2('0x10')](_0x20de45[0x1])){logger['info'](_0x04f2('0x11'),_0x6605bd);_0x141f28[_0x04f2('0x12')][_0x20de45[0x1]]=_0x560a34;}else{logger['info'](_0x04f2('0x13'),_0x6605bd,_0x20de45[0x1],_0x560a34);_0x141f28[_0x04f2('0x12')][_0x20de45[0x1]]=_0x560a34;}}_0x194568[_0x04f2('0xc')]();});}}catch(_0x59f0ee){logger[_0x04f2('0x14')]('[%s][SYSTEM]\x20%s',_0x6605bd,_[_0x04f2('0x15')](_0x59f0ee)?JSON['stringify'](_0x59f0ee):_0x59f0ee);logger[_0x04f2('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x6605bd);_0x194568[_0x04f2('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 62a9313..95a201f 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 _0x64c1=['message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','next','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map'];(function(_0x1f24d6,_0x13d6d7){var _0x561cfa=function(_0x3f171c){while(--_0x3f171c){_0x1f24d6['push'](_0x1f24d6['shift']());}};_0x561cfa(++_0x13d6d7);}(_0x64c1,0x1ea));var _0x164c=function(_0x1e395e,_0x23bf1f){_0x1e395e=_0x1e395e-0x0;var _0x3881ee=_0x64c1[_0x1e395e];return _0x3881ee;};'use strict';var schema=require(_0x164c('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x164c('0x1')),'openchannelInteraction':require(_0x164c('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x164c('0x3')),'faxInteraction':require(_0x164c('0x4')),'whatsappInteraction':require(_0x164c('0x5'))};var logger=require(_0x164c('0x6'))('routing');var tag=schema({'tag':{'type':_0x164c('0x7'),'required':!![],'message':_0x164c('0x8')}});exports[_0x164c('0x9')]=function(_0x2d6867,_0x47f601,_0x519624,_0x46dcca){return function(_0xb857a9){try{var _0x2ddc39={'tag':_0x47f601[0x0]};var _0x163949=tag[_0x164c('0x0')](_0x2ddc39,{'typecast':!![]});if(_0x163949[_0x164c('0xa')]){logger[_0x164c('0xb')](_0x164c('0xc'),_0x2d6867,_[_0x164c('0xd')](_0x163949,_0x164c('0xe'))[_0x164c('0xf')](',\x20'));logger[_0x164c('0x10')](_0x164c('0x11'),_0x2d6867);_0xb857a9['next']();}else{var _0x596d90={'ids':[_0x47f601[0x0]]};if(rpc[_0x46dcca[_0x164c('0x12')]+'Interaction']){rpc[_0x46dcca[_0x164c('0x12')]+_0x164c('0x13')][_0x164c('0x14')](_0x46dcca[_0x164c('0x15')]['id'],_0x596d90)[_0x164c('0x16')](function(_0x233cc2){logger[_0x164c('0x10')](_0x164c('0x17'),_0x2d6867,_0x47f601[0x1],_0x46dcca[_0x164c('0x12')],_0x46dcca['interaction']['id']);})['catch'](function(_0x901a76){logger['error'](_0x164c('0xc'),_0x2d6867,JSON[_0x164c('0x18')](_0x901a76));logger[_0x164c('0x10')](_0x164c('0x11'),_0x2d6867);})[_0x164c('0x19')](function(){_0xb857a9[_0x164c('0x1a')]();});}}}catch(_0x3578ff){logger[_0x164c('0xb')](_0x164c('0xc'),_0x2d6867,_[_0x164c('0x1b')](_0x3578ff)?JSON[_0x164c('0x18')](_0x3578ff):_0x3578ff);logger[_0x164c('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2d6867);_0xb857a9[_0x164c('0x1a')]();}};}; \ No newline at end of file +var _0xa14b=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','[%s][TAG]\x20%s','stringify','finally','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing'];(function(_0x5e1fb3,_0x454df2){var _0x298c8a=function(_0x107af1){while(--_0x107af1){_0x5e1fb3['push'](_0x5e1fb3['shift']());}};_0x298c8a(++_0x454df2);}(_0xa14b,0x179));var _0xba14=function(_0x3ed3e5,_0x1a2c44){_0x3ed3e5=_0x3ed3e5-0x0;var _0x26a76d=_0xa14b[_0x3ed3e5];return _0x26a76d;};'use strict';var schema=require('validate');var _=require(_0xba14('0x0'));var rpc={'chatInteraction':require(_0xba14('0x1')),'openchannelInteraction':require(_0xba14('0x2')),'smsInteraction':require(_0xba14('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xba14('0x4')),'whatsappInteraction':require(_0xba14('0x5'))};var logger=require('../../../../config/logger')(_0xba14('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xba14('0x7')}});exports[_0xba14('0x8')]=function(_0x547da3,_0x322c82,_0x4fce80,_0x7b6dec){return function(_0x1f2abc){try{var _0x587986={'tag':_0x322c82[0x0]};var _0x30bfdf=tag[_0xba14('0x9')](_0x587986,{'typecast':!![]});if(_0x30bfdf['length']){logger[_0xba14('0xa')]('[%s][TAG]\x20%s',_0x547da3,_[_0xba14('0xb')](_0x30bfdf,_0xba14('0xc'))['join'](',\x20'));logger[_0xba14('0xd')](_0xba14('0xe'),_0x547da3);_0x1f2abc[_0xba14('0xf')]();}else{var _0xa19025={'ids':[_0x322c82[0x0]]};if(rpc[_0x7b6dec[_0xba14('0x10')]+_0xba14('0x11')]){rpc[_0x7b6dec[_0xba14('0x10')]+_0xba14('0x11')][_0xba14('0x12')](_0x7b6dec[_0xba14('0x13')]['id'],_0xa19025)['then'](function(_0x243fee){logger[_0xba14('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x547da3,_0x322c82[0x1],_0x7b6dec[_0xba14('0x10')],_0x7b6dec[_0xba14('0x13')]['id']);})[_0xba14('0x14')](function(_0x1bd0ef){logger[_0xba14('0xa')](_0xba14('0x15'),_0x547da3,JSON[_0xba14('0x16')](_0x1bd0ef));logger[_0xba14('0xd')](_0xba14('0xe'),_0x547da3);})[_0xba14('0x17')](function(){_0x1f2abc['next']();});}}}catch(_0x1d2835){logger[_0xba14('0xa')](_0xba14('0x15'),_0x547da3,_['isObject'](_0x1d2835)?JSON[_0xba14('0x16')](_0x1d2835):_0x1d2835);logger[_0xba14('0xd')](_0xba14('0xe'),_0x547da3);_0x1f2abc[_0xba14('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 134069d..452fc06 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x834e=['jsonrpc','2.0','method','login','params','stringify','utf8','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','includes','push','urlOnAnswer','?params=','title'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x834e,0x12d));var _0xe834=function(_0x476e52,_0x2b382a){_0x476e52=_0x476e52-0x0;var _0x1929e9=_0x834e[_0x476e52];return _0x1929e9;};'use strict';var rp=require(_0xe834('0x0'));var logger=require('../../../../config/logger')(_0xe834('0x1'));var _=require(_0xe834('0x2'));var arr=[];exports[_0xe834('0x3')]=function(_0xff430a,_0x1f593e){return function(_0x1605c5){var _0x33cc03=_0x1f593e[0xa];var _0x1e2ea3=_0x1f593e[0xb];var _0x26a00b=_0x1f593e[0xc];var _0x4de361=_0x1f593e[0xd];var _0x5e6ccd=_0x1f593e[0xe];var _0x3a813f=_0x1f593e[0xf]['replace'](/\n/g,'\x20-\x20');var _0x29fec3=_0x1f593e[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xe834('0x4')](_0x1e2ea3)){arr[_0xe834('0x5')](_0x1e2ea3);var _0x1beac7=_0x1f593e[0x3];var _0x112b3f=_0x1f593e[0x4];var _0x3f87de=_0x1f593e[0x1];var _0x55c75c=_0x1f593e[0x0];var _0x409611={};_0x409611[_0xe834('0x6')]=_0x1f593e[0x8]+'?params='+_0x26a00b+'|'+_0x33cc03+'|'+_0x4de361+'|'+_0x1e2ea3+'|'+_0x5e6ccd;_0x409611['urlOnRing']=_0x1f593e[0x7]+_0xe834('0x7')+_0x26a00b+'|'+_0x33cc03+'|'+_0x4de361+'|'+_0x1e2ea3+'|'+_0x5e6ccd+'|'+_0x3a813f+'|'+_0x29fec3;_0x409611[_0xe834('0x8')]=_0x1f593e[0x9];var _0x521ba5={};_0x521ba5[_0xe834('0x9')]=_0xe834('0xa');_0x521ba5[_0xe834('0xb')]=_0xe834('0xc');var _0x58d7e0=[];_0x58d7e0[_0xe834('0x5')](_0x1f593e[0x2]);_0x58d7e0['push'](_0x1f593e[0x5]);_0x58d7e0[_0xe834('0x5')](_0x1f593e[0x6]);_0x521ba5[_0xe834('0xd')]=_0x58d7e0;_0x521ba5['id']=0x1;var _0x3f2ca2=JSON[_0xe834('0xe')](_0x521ba5);var _0xbb6ea1={'encoding':_0xe834('0xf'),'method':'POST','timeout':0x2710,'url':_0x1beac7,'headers':{'Content-Type':'application/json-rpc'},'body':_0x3f2ca2};return rp(_0xbb6ea1)['then'](function(_0x1e6e99){const _0x50f4a5=JSON[_0xe834('0x10')](_0x1e6e99);if(!_0x50f4a5[_0xe834('0x11')]['logged']){throw new Error(_0xe834('0x12'));}var _0x45b7a2=_0x1e2ea3;var _0x51c99c=_0xe834('0x13')+_0x3f87de+_0xe834('0x14')+_0x55c75c+_0xe834('0x15')+_0x45b7a2+'&data='+JSON[_0xe834('0xe')](_0x409611);var _0x8a324b=_0x112b3f+'?'+_0x51c99c;return rp(_0x8a324b);})[_0xe834('0x16')](function(_0x35ddf4){logger[_0xe834('0x17')](_0xe834('0x18'),_0xff430a,_0x35ddf4);_0x1605c5[_0xe834('0x19')]();})[_0xe834('0x1a')](function(_0x4fc9a6){logger['error'](_0xe834('0x1b'),_0xff430a,_[_0xe834('0x1c')](_0x4fc9a6)?JSON[_0xe834('0xe')](_0x4fc9a6):_0x4fc9a6);_0x1605c5[_0xe834('0x19')]();});}else{logger[_0xe834('0x17')](_0xe834('0x1d'),_0xff430a);_0x1605c5[_0xe834('0x1e')]();}};}; \ No newline at end of file +var _0x6f2e=['stringify','POST','application/json-rpc','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','replace','push','?params=','urlOnRing','title','jsonrpc','2.0','login','params'];(function(_0x47cb02,_0x5d3010){var _0x301d07=function(_0x6eca2e){while(--_0x6eca2e){_0x47cb02['push'](_0x47cb02['shift']());}};_0x301d07(++_0x5d3010);}(_0x6f2e,0xcc));var _0xe6f2=function(_0x5655ce,_0x5eb231){_0x5655ce=_0x5655ce-0x0;var _0x3b2c9f=_0x6f2e[_0x5655ce];return _0x3b2c9f;};'use strict';var rp=require(_0xe6f2('0x0'));var logger=require(_0xe6f2('0x1'))(_0xe6f2('0x2'));var _=require(_0xe6f2('0x3'));var arr=[];exports['consequence']=function(_0x1cc3dc,_0x590a62){return function(_0x1dc541){var _0x226883=_0x590a62[0xa];var _0x676409=_0x590a62[0xb];var _0x11baac=_0x590a62[0xc];var _0x44a198=_0x590a62[0xd];var _0x4d16be=_0x590a62[0xe];var _0x490663=_0x590a62[0xf]['replace'](/\n/g,'\x20-\x20');var _0x31de6e=_0x590a62[0x10][_0xe6f2('0x4')](/\n/g,'\x20');if(!arr['includes'](_0x676409)){arr[_0xe6f2('0x5')](_0x676409);var _0x304596=_0x590a62[0x3];var _0xd53ecc=_0x590a62[0x4];var _0x2e5ae7=_0x590a62[0x1];var _0xe84e13=_0x590a62[0x0];var _0x1dbc49={};_0x1dbc49['urlOnAnswer']=_0x590a62[0x8]+_0xe6f2('0x6')+_0x11baac+'|'+_0x226883+'|'+_0x44a198+'|'+_0x676409+'|'+_0x4d16be;_0x1dbc49[_0xe6f2('0x7')]=_0x590a62[0x7]+'?params='+_0x11baac+'|'+_0x226883+'|'+_0x44a198+'|'+_0x676409+'|'+_0x4d16be+'|'+_0x490663+'|'+_0x31de6e;_0x1dbc49[_0xe6f2('0x8')]=_0x590a62[0x9];var _0x2263b5={};_0x2263b5[_0xe6f2('0x9')]=_0xe6f2('0xa');_0x2263b5['method']=_0xe6f2('0xb');var _0x199c44=[];_0x199c44[_0xe6f2('0x5')](_0x590a62[0x2]);_0x199c44[_0xe6f2('0x5')](_0x590a62[0x5]);_0x199c44[_0xe6f2('0x5')](_0x590a62[0x6]);_0x2263b5[_0xe6f2('0xc')]=_0x199c44;_0x2263b5['id']=0x1;var _0x356225=JSON[_0xe6f2('0xd')](_0x2263b5);var _0x3e1f48={'encoding':'utf8','method':_0xe6f2('0xe'),'timeout':0x2710,'url':_0x304596,'headers':{'Content-Type':_0xe6f2('0xf')},'body':_0x356225};return rp(_0x3e1f48)[_0xe6f2('0x10')](function(_0x4a5378){const _0xce2b2d=JSON[_0xe6f2('0x11')](_0x4a5378);if(!_0xce2b2d['result'][_0xe6f2('0x12')]){throw new Error(_0xe6f2('0x13'));}var _0x3ae580=_0x676409;var _0xdf1878=_0xe6f2('0x14')+_0x2e5ae7+_0xe6f2('0x15')+_0xe84e13+'&sessionId='+_0x3ae580+_0xe6f2('0x16')+JSON['stringify'](_0x1dbc49);var _0x4a73e6=_0xd53ecc+'?'+_0xdf1878;return rp(_0x4a73e6);})[_0xe6f2('0x10')](function(_0x3e2e2f){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x1cc3dc,_0x3e2e2f);_0x1dc541[_0xe6f2('0x17')]();})[_0xe6f2('0x18')](function(_0x29b191){logger[_0xe6f2('0x19')](_0xe6f2('0x1a'),_0x1cc3dc,_[_0xe6f2('0x1b')](_0x29b191)?JSON[_0xe6f2('0xd')](_0x29b191):_0x29b191);_0x1dc541[_0xe6f2('0x17')]();});}else{logger[_0xe6f2('0x1c')](_0xe6f2('0x1d'),_0x1cc3dc);_0x1dc541[_0xe6f2('0x1e')]();}};}; \ 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 ea7839d..fb92e2c 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x275036,_0x1e8a6a){var _0x16fd2e=function(_0x22a70c){while(--_0x22a70c){_0x275036['push'](_0x275036['shift']());}};_0x16fd2e(++_0x1e8a6a);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x59d737,_0x4da255){var _0x3d3622=function(_0x48b9da){while(--_0x48b9da){_0x59d737['push'](_0x59d737['shift']());}};_0x3d3622(++_0x4da255);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 4e43bbd..eb20b3b 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 _0xb400=['mail','push','slice','dialogflowv2','split','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','updateRealtime','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xb400,0x1dd));var _0x0b40=function(_0xc0fc7c,_0x23edd3){_0xc0fc7c=_0xc0fc7c-0x0;var _0x2657fe=_0xb400[_0xc0fc7c];return _0x2657fe;};'use strict';var _=require('lodash');var util=require(_0x0b40('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x0b40('0x1'));var BPromise=require(_0x0b40('0x2'));var utils=require(_0x0b40('0x3'));var sUtils=require(_0x0b40('0x4'));var logger=require(_0x0b40('0x5'))(_0x0b40('0x6'));var rpc={'openchannelQueueReport':require(_0x0b40('0x7')),'mailQueueReport':require(_0x0b40('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x0b40('0x9')),'faxQueueReport':require(_0x0b40('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x0b40('0xb'));function getId(_0x1a4d9f,_0x3d0608,_0x4773c5){return util[_0x0b40('0xc')](_0x0b40('0xd'),_0x1a4d9f,_0x3d0608||0x0,_0x4773c5||0x0);}function getIntervals(_0x3a0f13,_0x49e800){var _0x5fa1aa=[];if(!_[_0x0b40('0xe')](_0x49e800[_0x0b40('0xf')])&&!_[_0x0b40('0xe')](_0x3a0f13[_0x49e800[_0x0b40('0xf')]])&&!_[_0x0b40('0xe')](_0x3a0f13[_0x49e800[_0x0b40('0xf')]][_0x0b40('0x10')])){_0x5fa1aa=_['map'](_0x3a0f13[_0x49e800[_0x0b40('0xf')]][_0x0b40('0x10')],_0x0b40('0x11'));}else if(!_[_0x0b40('0xe')](_0x49e800[_0x0b40('0x11')])){_0x5fa1aa=[_0x49e800[_0x0b40('0x11')]];}return _0x5fa1aa;}exports[_0x0b40('0x12')]=function(_0x18180e){_0x18180e[_0x0b40('0x13')]={};return new BPromise(function(_0x21717c,_0xbd784e){var _0x150a5f={'Start':function(_0x507dd0){var _0x5052a6=this;return new Promise(function(_0x367cd9,_0x45f4a5){if(_0x507dd0){try{var _0x2b8466=[];var _0xe82744=getId(_0x507dd0[_0x0b40('0x14')],_0x507dd0[_0x0b40('0x15')]?_0x507dd0['message']['id']:0x0,_0x507dd0[_0x0b40('0x16')]?_0x507dd0[_0x0b40('0x16')]['id']:0x0);var _0x470417=sUtils[_0x0b40('0x17')](_0x18180e,_0x507dd0);if(!_0x470417&&_0x507dd0[_0x0b40('0x18')]&&_['isArray'](_0x507dd0[_0x0b40('0x18')])&&_0x507dd0[_0x0b40('0x18')][_0x0b40('0x19')]){for(var _0x400f31=0x0;_0x400f31<_0x507dd0[_0x0b40('0x18')][_0x0b40('0x19')];_0x400f31+=0x1){var _0x2638ba=_0x507dd0['applications'][_0x400f31];if(fs[_0x0b40('0x1a')](path[_0x0b40('0x1b')](__dirname,'applications',_0x2638ba[_0x0b40('0x1c')]+_0x0b40('0x1d')))){var _0x14b122=[];switch(_0x2638ba[_0x0b40('0x1c')][_0x0b40('0x1e')]()){case _0x0b40('0x1f'):var _0x1d2eec=_0x2638ba[_0x0b40('0x20')]['split'](',');if(_0x507dd0[_0x0b40('0x14')]===_0x0b40('0x21')){_0x14b122[_0x0b40('0x22')](_0x1d2eec[0x0]);_0x14b122[_0x0b40('0x22')](_0x1d2eec[0x1]);_0x14b122['push'](_0x1d2eec[_0x0b40('0x23')](0x2,_0x1d2eec[_0x0b40('0x19')])[_0x0b40('0x1b')](','));}else{_0x14b122['push'](_0x1d2eec[0x0]);_0x14b122['push'](_0x1d2eec['slice'](0x1,_0x1d2eec[_0x0b40('0x19')])[_0x0b40('0x1b')](','));}break;case'dialogflow':var _0x5a1b77=_0x2638ba[_0x0b40('0x20')]['split'](',');_0x14b122[_0x0b40('0x22')](_0x5a1b77[0x0]);_0x14b122[_0x0b40('0x22')](_0x5a1b77[0x1]);_0x14b122[_0x0b40('0x22')](_0x5a1b77[_0x0b40('0x23')](0x2,_0x5a1b77['length'])[_0x0b40('0x1b')](','));break;case _0x0b40('0x24'):var _0x5b26b9=_0x2638ba[_0x0b40('0x20')][_0x0b40('0x25')](',');_0x14b122[_0x0b40('0x22')](_0x5b26b9[0x0]);_0x14b122[_0x0b40('0x22')](_0x5b26b9[0x1]);_0x14b122[_0x0b40('0x22')](_0x5b26b9[0x2]);_0x14b122['push'](_0x5b26b9[0x3]);_0x14b122[_0x0b40('0x22')](_0x5b26b9[_0x0b40('0x23')](0x4,_0x5b26b9[_0x0b40('0x19')])[_0x0b40('0x1b')](','));break;case _0x0b40('0x26'):var _0x3dc3b0=_0x2638ba[_0x0b40('0x20')][_0x0b40('0x25')](',');_0x14b122[_0x0b40('0x22')](_0x3dc3b0[0x0]);_0x14b122[_0x0b40('0x22')](_0x3dc3b0[0x1]);_0x14b122[_0x0b40('0x22')](_0x3dc3b0[0x2]);_0x14b122[_0x0b40('0x22')](_0x3dc3b0[0x3]);_0x14b122[_0x0b40('0x22')](_0x3dc3b0[_0x0b40('0x23')](0x4,_0x3dc3b0['length'])[_0x0b40('0x1b')](','));break;case'message':_0x14b122[_0x0b40('0x22')](_0x2638ba[_0x0b40('0x20')]);break;case _0x0b40('0x27'):_0x14b122['push'](_0x2638ba[_0x0b40('0x28')]);_0x14b122[_0x0b40('0x22')](_0x2638ba[_0x0b40('0x20')]);break;case _0x0b40('0x29'):var _0x2614fe=utils[_0x0b40('0x2a')](_0x507dd0[_0x0b40('0x2b')]['notificationTemplate'],_0x507dd0);var _0x226c39=_0x2638ba[_0x0b40('0x20')]['split'](',');_0x14b122['push'](_0x226c39[0x0]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x1]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x2]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x3]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x4]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x5]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x6]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x7]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x8]);_0x14b122[_0x0b40('0x22')](_0x226c39[0x9]);_0x14b122['push'](_0x226c39[0xa]);_0x14b122['push'](_0x507dd0[_0x0b40('0x16')]['id']);_0x14b122[_0x0b40('0x22')](_0x507dd0[_0x0b40('0x15')]['id']);_0x14b122['push'](_0x2638ba[_0x0b40('0x2c')]);_0x14b122[_0x0b40('0x22')](_0x507dd0[_0x0b40('0x16')][_0x0b40('0x2d')]);_0x14b122[_0x0b40('0x22')](_0x507dd0[_0x0b40('0x2e')][_0x0b40('0x2e')]);_0x14b122[_0x0b40('0x22')](_0x2614fe);break;default:_0x14b122=_[_0x0b40('0xe')](_0x2638ba['appdata'])?[]:_0x2638ba[_0x0b40('0x20')][_0x0b40('0x25')](',');}var _0x2e64b7={'id':util[_0x0b40('0xc')](_0x0b40('0x2f'),_0xe82744,_0x2638ba['id'],_0x2638ba[_0x0b40('0x1c')]),'condition':require(_0x0b40('0x30'))['condition'](_0xe82744,getIntervals(_0x18180e[_0x0b40('0x31')],_0x2638ba),_0x18180e),'consequence':require(_0x0b40('0x32')+_0x2638ba['app'])[_0x0b40('0x33')](_0xe82744,_0x14b122,_0x18180e,_0x507dd0),'p':_0x2638ba['priority']||0x0};logger[_0x0b40('0x34')]('Push\x20new\x20rule',_0x2e64b7['id'],_0x0b40('0x35'),getIntervals(_0x18180e[_0x0b40('0x31')],_0x2638ba)[_0x0b40('0x1b')](_0x0b40('0x36')));_0x2b8466[_0x0b40('0x22')](_0x2e64b7);}else{logger[_0x0b40('0x37')](_0x0b40('0x38'),path[_0x0b40('0x1b')](__dirname,'applications',_0x2638ba[_0x0b40('0x1c')]+_0x0b40('0x1d')));}}_0x18180e['rules'][_0xe82744]=new RuleEngine(_0x2b8466);_0x18180e['rules'][_0xe82744][_0x0b40('0x39')](_0x507dd0,function(_0x18ffaf){logger[_0x0b40('0x34')](_0x0b40('0x3a'),JSON[_0x0b40('0x3b')](_0x18ffaf[_0x0b40('0x3c')]));if(_0x18180e[_0x0b40('0x13')][_0xe82744]){_0x18180e['rules'][_0xe82744][_0x0b40('0x3d')](_0x0b40('0x3e'));}});return _0x367cd9({'code':0xc8,'message':_0x507dd0});}else{if(_0x470417){logger[_0x0b40('0x34')](util[_0x0b40('0xc')](_0x0b40('0x3f'),_0xe82744));}else{logger['info'](_0x0b40('0x40'));}return _0x367cd9({'code':0xc8,'message':_0x507dd0});}}catch(_0x187497){logger[_0x0b40('0x37')](_0x187497[_0x0b40('0x41')]);return _0x45f4a5(_0x5052a6['error'](0x1f4,_0x187497));}}return _0x45f4a5(_0x0b40('0x42'));});},'AcceptMessage':function(_0x33eb20){var _0x291026=this;return new Promise(function(_0x32bff1,_0x5eb7ec){if(_0x33eb20[_0x0b40('0x43')]&&_0x33eb20[_0x0b40('0x43')]['id']){if(_0x18180e[_0x0b40('0x44')][_0x33eb20[_0x0b40('0x43')]['id']]){_0x18180e['agents'][_0x33eb20[_0x0b40('0x43')]['id']][_0x0b40('0x45')]=![];_0x18180e[_0x0b40('0x44')][_0x33eb20[_0x0b40('0x43')]['id']]['busyQueue']=undefined;}}if(_0x33eb20[_0x0b40('0x15')]&&_0x33eb20['message']['id']){try{var _0x4ce19a=getId(_0x33eb20[_0x0b40('0x14')],_0x33eb20[_0x0b40('0x15')]?_0x33eb20[_0x0b40('0x15')]['id']:0x0,_0x33eb20['interaction']?_0x33eb20['interaction']['id']:0x0);if(_0x18180e['rules'][_0x4ce19a]){_0x18180e[_0x0b40('0x13')][_0x4ce19a][_0x0b40('0x3d')](_0x0b40('0x46'));if(rpc[_0x33eb20[_0x0b40('0x14')]+_0x0b40('0x47')]){rpc[_0x33eb20['channel']+_0x0b40('0x47')][_0x0b40('0x48')](_0x4ce19a,{'UserId':_0x33eb20[_0x0b40('0x15')][_0x0b40('0x49')]})[_0x0b40('0x4a')](function(){logger[_0x0b40('0x37')]('error\x20update\x20queue\x20report');});}}return _0x32bff1({'code':0xc8,'message':_0x33eb20});}catch(_0x40f6ea){logger['error'](_0x40f6ea[_0x0b40('0x41')]);return _0x5eb7ec(_0x291026['error'](0x1f4,_0x40f6ea));}}logger[_0x0b40('0x37')](_0x0b40('0x4b'));return _0x5eb7ec(_0x291026[_0x0b40('0x37')](0x1f4,_0x0b40('0x4b')));});},'RejectMessage':function(_0x21ed4f){var _0x2c2b01=this;return new Promise(function(_0x13d77a,_0x460535){if(_0x21ed4f['agent']&&_0x21ed4f[_0x0b40('0x43')]['id']){try{if(_0x18180e['agents'][_0x21ed4f['agent']['id']]){_0x18180e[_0x0b40('0x44')][_0x21ed4f['agent']['id']][_0x0b40('0x45')]=![];_0x18180e[_0x0b40('0x44')][_0x21ed4f[_0x0b40('0x43')]['id']][_0x0b40('0x4c')]=undefined;}return _0x13d77a({'code':0xc8,'message':_0x21ed4f});}catch(_0x28c021){logger['error'](_0x28c021['stack']);return _0x460535(_0x2c2b01['error'](0x1f4,_0x28c021));}}logger['error'](_0x0b40('0x4b'));return _0x460535(_0x2c2b01[_0x0b40('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x12527a){var _0x4727d1=this;return new Promise(function(_0x52bf0b,_0x28e429){if(_0x12527a[_0x0b40('0x14')]&&_0x12527a[_0x0b40('0x16')]&&_0x12527a[_0x0b40('0x16')]['id']){try{var _0xee329b=getId(_0x12527a[_0x0b40('0x14')],_0x12527a[_0x0b40('0x15')]?_0x12527a[_0x0b40('0x15')]['id']:0x0,_0x12527a['interaction']?_0x12527a[_0x0b40('0x16')]['id']:0x0);if(_0x18180e[_0x0b40('0x13')][_0xee329b]){_0x18180e[_0x0b40('0x13')][_0xee329b][_0x0b40('0x3d')](_0x0b40('0x46'));}return _0x52bf0b({'code':0xc8,'message':_0x12527a});}catch(_0x4d8632){logger[_0x0b40('0x37')](_0x4d8632['stack']);return _0x28e429(_0x4727d1['error'](0x1f4,_0x4d8632));}}logger['error'](_0x0b40('0x4b'));return _0x28e429(_0x4727d1[_0x0b40('0x37')](0x1f4,_0x0b40('0x4b')));});},'AgentCapacity':function(_0x398736){var _0x55da8c=this;return new Promise(function(_0x5bce50,_0x1d17ed){if(_0x18180e[_0x0b40('0x44')][_0x0b40('0x4d')](_0x398736['id'])){for(var _0x5acdcd in _0x398736[_0x0b40('0x4e')]){if(_0x398736[_0x0b40('0x4e')][_0x0b40('0x4d')](_0x5acdcd)){if(_0x18180e[_0x0b40('0x44')][_0x398736['id']][_0x0b40('0x4d')](_0x5acdcd+'CurrentCapacity')){_0x18180e[_0x0b40('0x44')][_0x398736['id']][_0x5acdcd+'CurrentCapacity']=parseInt(_0x398736[_0x0b40('0x4e')][_0x5acdcd],0xa);}}}_0x18180e[_0x0b40('0x44')][_0x398736['id']][_0x0b40('0x4f')]();return _0x5bce50({'code':0xc8,'message':_0x18180e[_0x0b40('0x44')][_0x398736['id']]});}else{return _0x1d17ed(_0x55da8c[_0x0b40('0x37')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x572116){return new Promise(function(_0x184075){var _0x417a27=_[_0x0b40('0x50')](_0x18180e[_0x0b40('0x44')]);if(_0x572116&&_0x572116['id']){var _0x1b3952=_[_0x0b40('0x51')](_0x417a27,function(_0x58820c){return _0x58820c['id']===_0x572116['id'];});_0x184075(_0x1b3952);}else{_0x184075({'count':_0x417a27[_0x0b40('0x19')],'rows':_0x417a27});}});},'ChatQueues':function(){return new Promise(function(_0xc76fb3){var _0x527714=[];for(var _0x3bc462 in _0x18180e[_0x0b40('0x52')]){if(_0x18180e[_0x0b40('0x52')][_0x0b40('0x4d')](_0x3bc462)){var _0x59b327=_0x18180e[_0x0b40('0x52')][_0x3bc462];var _0x331fe={'id':_0x59b327['id'],'available':_0x59b327['available'],'loggedIn':_0x59b327[_0x0b40('0x53')],'name':_0x59b327[_0x0b40('0x54')],'paused':_0x59b327[_0x0b40('0x55')],'waiting':_0x59b327[_0x0b40('0x56')]};_0x527714[_0x0b40('0x22')](_0x331fe);}}_0xc76fb3({'count':_0x527714['length'],'rows':_0x527714});});},'MailQueues':function(){return new Promise(function(_0x441992){var _0x3f452b=[];for(var _0x5518e3 in _0x18180e[_0x0b40('0x57')]){if(_0x18180e['mailQueues']['hasOwnProperty'](_0x5518e3)){var _0x42ebd4=_0x18180e[_0x0b40('0x57')][_0x5518e3];var _0x2f245e={'id':_0x42ebd4['id'],'available':_0x42ebd4[_0x0b40('0x58')],'loggedIn':_0x42ebd4[_0x0b40('0x53')],'name':_0x42ebd4[_0x0b40('0x54')],'paused':_0x42ebd4['paused'],'waiting':_0x42ebd4['waiting']};_0x3f452b[_0x0b40('0x22')](_0x2f245e);}}_0x441992({'count':_0x3f452b[_0x0b40('0x19')],'rows':_0x3f452b});});},'OpenchannelQueues':function(){return new Promise(function(_0xad11dc){var _0x36c3bf=[];for(var _0x39721d in _0x18180e[_0x0b40('0x59')]){if(_0x18180e['openchannelQueues'][_0x0b40('0x4d')](_0x39721d)){var _0xbc6252=_0x18180e[_0x0b40('0x59')][_0x39721d];var _0x2b9147={'id':_0xbc6252['id'],'available':_0xbc6252[_0x0b40('0x58')],'loggedIn':_0xbc6252[_0x0b40('0x53')],'name':_0xbc6252[_0x0b40('0x54')],'paused':_0xbc6252['paused'],'waiting':_0xbc6252['waiting']};_0x36c3bf[_0x0b40('0x22')](_0x2b9147);}}_0xad11dc({'count':_0x36c3bf['length'],'rows':_0x36c3bf});});},'SmsQueues':function(){return new Promise(function(_0x19165c){var _0x4e6bd6=[];for(var _0x37cb02 in _0x18180e[_0x0b40('0x5a')]){if(_0x18180e[_0x0b40('0x5a')][_0x0b40('0x4d')](_0x37cb02)){var _0x2743c4=_0x18180e[_0x0b40('0x5a')][_0x37cb02];var _0x5632c8={'id':_0x2743c4['id'],'available':_0x2743c4[_0x0b40('0x58')],'loggedIn':_0x2743c4['loggedIn'],'name':_0x2743c4['name'],'paused':_0x2743c4[_0x0b40('0x55')],'waiting':_0x2743c4[_0x0b40('0x56')]};_0x4e6bd6[_0x0b40('0x22')](_0x5632c8);}}_0x19165c({'count':_0x4e6bd6[_0x0b40('0x19')],'rows':_0x4e6bd6});});},'FaxQueues':function(){return new Promise(function(_0x4a88ee){var _0xae232e=[];for(var _0x5ccc29 in _0x18180e[_0x0b40('0x5b')]){if(_0x18180e[_0x0b40('0x5b')][_0x0b40('0x4d')](_0x5ccc29)){var _0x589427=_0x18180e[_0x0b40('0x5b')][_0x5ccc29];var _0x2bcc7e={'id':_0x589427['id'],'available':_0x589427[_0x0b40('0x58')],'loggedIn':_0x589427['loggedIn'],'name':_0x589427[_0x0b40('0x54')],'paused':_0x589427[_0x0b40('0x55')],'waiting':_0x589427['waiting']};_0xae232e[_0x0b40('0x22')](_0x2bcc7e);}}_0x4a88ee({'count':_0xae232e[_0x0b40('0x19')],'rows':_0xae232e});});},'WhatsappQueues':function(){return new Promise(function(_0x5c2318){var _0x13bcb7=[];for(var _0x40698d in _0x18180e[_0x0b40('0x5c')]){if(_0x18180e[_0x0b40('0x5c')]['hasOwnProperty'](_0x40698d)){var _0xb5b37d=_0x18180e[_0x0b40('0x5c')][_0x40698d];var _0x39a15d={'id':_0xb5b37d['id'],'available':_0xb5b37d['available'],'loggedIn':_0xb5b37d[_0x0b40('0x53')],'name':_0xb5b37d['name'],'paused':_0xb5b37d[_0x0b40('0x55')],'waiting':_0xb5b37d['waiting']};_0x13bcb7[_0x0b40('0x22')](_0x39a15d);}}_0x5c2318({'count':_0x13bcb7[_0x0b40('0x19')],'rows':_0x13bcb7});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x33305a){var _0x49fbc8=_[_0x0b40('0x50')](_0x18180e[_0x0b40('0x5d')]);_0x33305a({'count':_0x49fbc8[_0x0b40('0x19')],'rows':_0x49fbc8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4d7603){var _0x43d231=_[_0x0b40('0x50')](_0x18180e[_0x0b40('0x5e')]);_0x4d7603({'count':_0x43d231[_0x0b40('0x19')],'rows':_0x43d231});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x11fadd){var _0x1b73b2=_['values'](_0x18180e[_0x0b40('0x5f')]);_0x11fadd({'count':_0x1b73b2[_0x0b40('0x19')],'rows':_0x1b73b2});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x14ae7e){var _0x17ff70=_['values'](_0x18180e[_0x0b40('0x60')]);_0x14ae7e({'count':_0x17ff70[_0x0b40('0x19')],'rows':_0x17ff70});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5dabc2){var _0x11f997=_['values'](_0x18180e['faxQueuesWaitingInteractions']);_0x5dabc2({'count':_0x11f997[_0x0b40('0x19')],'rows':_0x11f997});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x43f512){var _0x313d57=_[_0x0b40('0x50')](_0x18180e[_0x0b40('0x61')]);_0x43f512({'count':_0x313d57['length'],'rows':_0x313d57});});}};var _0x261a56=jayson['server'](_0x150a5f)[_0x0b40('0x62')]();_0x261a56['on']('error',function(_0x26a264){logger[_0x0b40('0x37')](JSON[_0x0b40('0x3b')](_0x26a264));return _0xbd784e(_0x26a264);});_0x261a56[_0x0b40('0x12')](0x232c,_0x0b40('0x63'),function(){console[_0x0b40('0x64')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x21717c(_0x0b40('0x65')+0x232c);});});}; \ No newline at end of file +var _0x8795=['../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','applications','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','length','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','interaction','emit','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0x8795,0xc2));var _0x5879=function(_0x46ecfe,_0x50722d){_0x46ecfe=_0x46ecfe-0x0;var _0x17c820=_0x8795[_0x46ecfe];return _0x17c820;};'use strict';var _=require(_0x5879('0x0'));var util=require(_0x5879('0x1'));var path=require(_0x5879('0x2'));var fs=require('fs');var jayson=require(_0x5879('0x3'));var BPromise=require(_0x5879('0x4'));var utils=require(_0x5879('0x5'));var sUtils=require(_0x5879('0x6'));var logger=require(_0x5879('0x7'))(_0x5879('0x8'));var rpc={'openchannelQueueReport':require(_0x5879('0x9')),'mailQueueReport':require(_0x5879('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5879('0xb')),'faxQueueReport':require(_0x5879('0xc')),'whatsappQueueReport':require(_0x5879('0xd'))};var RuleEngine=require(_0x5879('0xe'));function getId(_0x56069e,_0x20e309,_0x58836a){return util[_0x5879('0xf')](_0x5879('0x10'),_0x56069e,_0x20e309||0x0,_0x58836a||0x0);}function getIntervals(_0x197c67,_0x12804b){var _0x5b953f=[];if(!_['isNil'](_0x12804b[_0x5879('0x11')])&&!_[_0x5879('0x12')](_0x197c67[_0x12804b[_0x5879('0x11')]])&&!_[_0x5879('0x12')](_0x197c67[_0x12804b[_0x5879('0x11')]][_0x5879('0x13')])){_0x5b953f=_[_0x5879('0x14')](_0x197c67[_0x12804b['IntervalId']]['Intervals'],'interval');}else if(!_[_0x5879('0x12')](_0x12804b[_0x5879('0x15')])){_0x5b953f=[_0x12804b[_0x5879('0x15')]];}return _0x5b953f;}exports['listen']=function(_0x4d8f69){_0x4d8f69[_0x5879('0x16')]={};return new BPromise(function(_0xf4a646,_0x398af0){var _0x2ca683={'Start':function(_0x560b7c){var _0x5309e2=this;return new Promise(function(_0x18cd49,_0x3110a1){if(_0x560b7c){try{var _0x3738d3=[];var _0x36b224=getId(_0x560b7c[_0x5879('0x17')],_0x560b7c[_0x5879('0x18')]?_0x560b7c[_0x5879('0x18')]['id']:0x0,_0x560b7c['interaction']?_0x560b7c['interaction']['id']:0x0);var _0x107a25=sUtils['checkWaitingNotifications'](_0x4d8f69,_0x560b7c);if(!_0x107a25&&_0x560b7c[_0x5879('0x19')]&&_['isArray'](_0x560b7c[_0x5879('0x19')])&&_0x560b7c[_0x5879('0x19')]['length']){for(var _0x2a8a53=0x0;_0x2a8a53<_0x560b7c[_0x5879('0x19')]['length'];_0x2a8a53+=0x1){var _0x5df5ff=_0x560b7c['applications'][_0x2a8a53];if(fs[_0x5879('0x1a')](path[_0x5879('0x1b')](__dirname,'applications',_0x5df5ff[_0x5879('0x1c')]+_0x5879('0x1d')))){var _0x4d35a1=[];switch(_0x5df5ff['app'][_0x5879('0x1e')]()){case'autoreply':var _0x5cfe74=_0x5df5ff[_0x5879('0x1f')][_0x5879('0x20')](',');if(_0x560b7c[_0x5879('0x17')]===_0x5879('0x21')){_0x4d35a1['push'](_0x5cfe74[0x0]);_0x4d35a1[_0x5879('0x22')](_0x5cfe74[0x1]);_0x4d35a1[_0x5879('0x22')](_0x5cfe74[_0x5879('0x23')](0x2,_0x5cfe74['length'])[_0x5879('0x1b')](','));}else{_0x4d35a1[_0x5879('0x22')](_0x5cfe74[0x0]);_0x4d35a1['push'](_0x5cfe74[_0x5879('0x23')](0x1,_0x5cfe74[_0x5879('0x24')])[_0x5879('0x1b')](','));}break;case _0x5879('0x25'):var _0x27b63d=_0x5df5ff[_0x5879('0x1f')][_0x5879('0x20')](',');_0x4d35a1[_0x5879('0x22')](_0x27b63d[0x0]);_0x4d35a1[_0x5879('0x22')](_0x27b63d[0x1]);_0x4d35a1[_0x5879('0x22')](_0x27b63d[_0x5879('0x23')](0x2,_0x27b63d['length'])[_0x5879('0x1b')](','));break;case _0x5879('0x26'):var _0xe9b078=_0x5df5ff['appdata'][_0x5879('0x20')](',');_0x4d35a1[_0x5879('0x22')](_0xe9b078[0x0]);_0x4d35a1[_0x5879('0x22')](_0xe9b078[0x1]);_0x4d35a1[_0x5879('0x22')](_0xe9b078[0x2]);_0x4d35a1[_0x5879('0x22')](_0xe9b078[0x3]);_0x4d35a1[_0x5879('0x22')](_0xe9b078[_0x5879('0x23')](0x4,_0xe9b078[_0x5879('0x24')])[_0x5879('0x1b')](','));break;case _0x5879('0x27'):var _0x55a7e8=_0x5df5ff[_0x5879('0x1f')][_0x5879('0x20')](',');_0x4d35a1[_0x5879('0x22')](_0x55a7e8[0x0]);_0x4d35a1[_0x5879('0x22')](_0x55a7e8[0x1]);_0x4d35a1[_0x5879('0x22')](_0x55a7e8[0x2]);_0x4d35a1[_0x5879('0x22')](_0x55a7e8[0x3]);_0x4d35a1['push'](_0x55a7e8['slice'](0x4,_0x55a7e8['length'])[_0x5879('0x1b')](','));break;case _0x5879('0x18'):_0x4d35a1[_0x5879('0x22')](_0x5df5ff['appdata']);break;case _0x5879('0x28'):_0x4d35a1['push'](_0x5df5ff[_0x5879('0x29')]);_0x4d35a1[_0x5879('0x22')](_0x5df5ff[_0x5879('0x1f')]);break;case _0x5879('0x2a'):var _0x47bb1c=utils[_0x5879('0x2b')](_0x560b7c['account'][_0x5879('0x2c')],_0x560b7c);var _0x214aad=_0x5df5ff[_0x5879('0x1f')][_0x5879('0x20')](',');_0x4d35a1['push'](_0x214aad[0x0]);_0x4d35a1['push'](_0x214aad[0x1]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x2]);_0x4d35a1['push'](_0x214aad[0x3]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x4]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x5]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x6]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x7]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x8]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0x9]);_0x4d35a1[_0x5879('0x22')](_0x214aad[0xa]);_0x4d35a1[_0x5879('0x22')](_0x560b7c['interaction']['id']);_0x4d35a1[_0x5879('0x22')](_0x560b7c[_0x5879('0x18')]['id']);_0x4d35a1['push'](_0x5df5ff[_0x5879('0x2d')]);_0x4d35a1['push'](_0x560b7c['interaction'][_0x5879('0x2e')]);_0x4d35a1['push'](_0x560b7c[_0x5879('0x2f')][_0x5879('0x2f')]);_0x4d35a1[_0x5879('0x22')](_0x47bb1c);break;default:_0x4d35a1=_[_0x5879('0x12')](_0x5df5ff['appdata'])?[]:_0x5df5ff['appdata'][_0x5879('0x20')](',');}var _0x4b5388={'id':util[_0x5879('0xf')]('%s:%s:%s',_0x36b224,_0x5df5ff['id'],_0x5df5ff[_0x5879('0x1c')]),'condition':require('./interval')['condition'](_0x36b224,getIntervals(_0x4d8f69[_0x5879('0x30')],_0x5df5ff),_0x4d8f69),'consequence':require(_0x5879('0x31')+_0x5df5ff[_0x5879('0x1c')])['consequence'](_0x36b224,_0x4d35a1,_0x4d8f69,_0x560b7c),'p':_0x5df5ff[_0x5879('0x32')]||0x0};logger[_0x5879('0x33')](_0x5879('0x34'),_0x4b5388['id'],_0x5879('0x35'),getIntervals(_0x4d8f69[_0x5879('0x30')],_0x5df5ff)[_0x5879('0x1b')](_0x5879('0x36')));_0x3738d3['push'](_0x4b5388);}else{logger['error'](_0x5879('0x37'),path[_0x5879('0x1b')](__dirname,_0x5879('0x19'),_0x5df5ff['app']+_0x5879('0x1d')));}}_0x4d8f69[_0x5879('0x16')][_0x36b224]=new RuleEngine(_0x3738d3);_0x4d8f69['rules'][_0x36b224]['execute'](_0x560b7c,function(_0x4bb3df){logger[_0x5879('0x33')](_0x5879('0x38'),JSON['stringify'](_0x4bb3df[_0x5879('0x39')]));if(_0x4d8f69[_0x5879('0x16')][_0x36b224]){_0x4d8f69[_0x5879('0x16')][_0x36b224]['emit'](_0x5879('0x3a'));}});return _0x18cd49({'code':0xc8,'message':_0x560b7c});}else{if(_0x107a25){logger[_0x5879('0x33')](util[_0x5879('0xf')](_0x5879('0x3b'),_0x36b224));}else{logger[_0x5879('0x33')](_0x5879('0x3c'));}return _0x18cd49({'code':0xc8,'message':_0x560b7c});}}catch(_0x44a707){logger[_0x5879('0x3d')](_0x44a707['stack']);return _0x3110a1(_0x5309e2[_0x5879('0x3d')](0x1f4,_0x44a707));}}return _0x3110a1(_0x5879('0x3e'));});},'AcceptMessage':function(_0x10458f){var _0x4f9bdc=this;return new Promise(function(_0x529928,_0x1d1523){if(_0x10458f[_0x5879('0x3f')]&&_0x10458f['agent']['id']){if(_0x4d8f69[_0x5879('0x40')][_0x10458f['agent']['id']]){_0x4d8f69[_0x5879('0x40')][_0x10458f['agent']['id']][_0x5879('0x41')]=![];_0x4d8f69['agents'][_0x10458f[_0x5879('0x3f')]['id']][_0x5879('0x42')]=undefined;}}if(_0x10458f['message']&&_0x10458f[_0x5879('0x18')]['id']){try{var _0x153c19=getId(_0x10458f['channel'],_0x10458f[_0x5879('0x18')]?_0x10458f[_0x5879('0x18')]['id']:0x0,_0x10458f[_0x5879('0x43')]?_0x10458f[_0x5879('0x43')]['id']:0x0);if(_0x4d8f69[_0x5879('0x16')][_0x153c19]){_0x4d8f69[_0x5879('0x16')][_0x153c19][_0x5879('0x44')]('end');if(rpc[_0x10458f[_0x5879('0x17')]+'QueueReport']){rpc[_0x10458f[_0x5879('0x17')]+_0x5879('0x45')][_0x5879('0x46')](_0x153c19,{'UserId':_0x10458f[_0x5879('0x18')]['UserId']})[_0x5879('0x47')](function(){logger[_0x5879('0x3d')](_0x5879('0x48'));});}}return _0x529928({'code':0xc8,'message':_0x10458f});}catch(_0x288091){logger[_0x5879('0x3d')](_0x288091[_0x5879('0x49')]);return _0x1d1523(_0x4f9bdc['error'](0x1f4,_0x288091));}}logger[_0x5879('0x3d')](_0x5879('0x4a'));return _0x1d1523(_0x4f9bdc[_0x5879('0x3d')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5cd30a){var _0x4665f7=this;return new Promise(function(_0x54dd7d,_0x5145cb){if(_0x5cd30a[_0x5879('0x3f')]&&_0x5cd30a['agent']['id']){try{if(_0x4d8f69['agents'][_0x5cd30a[_0x5879('0x3f')]['id']]){_0x4d8f69['agents'][_0x5cd30a[_0x5879('0x3f')]['id']][_0x5879('0x41')]=![];_0x4d8f69['agents'][_0x5cd30a[_0x5879('0x3f')]['id']][_0x5879('0x42')]=undefined;}return _0x54dd7d({'code':0xc8,'message':_0x5cd30a});}catch(_0x25e755){logger[_0x5879('0x3d')](_0x25e755[_0x5879('0x49')]);return _0x5145cb(_0x4665f7[_0x5879('0x3d')](0x1f4,_0x25e755));}}logger['error']('message\x20is\x20empty');return _0x5145cb(_0x4665f7[_0x5879('0x3d')](0x1f4,_0x5879('0x4a')));});},'AbandonInteraction':function(_0x428a77){var _0x58ab9a=this;return new Promise(function(_0x3774fc,_0x2e4408){if(_0x428a77[_0x5879('0x17')]&&_0x428a77[_0x5879('0x43')]&&_0x428a77[_0x5879('0x43')]['id']){try{var _0x22a755=getId(_0x428a77[_0x5879('0x17')],_0x428a77[_0x5879('0x18')]?_0x428a77['message']['id']:0x0,_0x428a77[_0x5879('0x43')]?_0x428a77['interaction']['id']:0x0);if(_0x4d8f69[_0x5879('0x16')][_0x22a755]){_0x4d8f69['rules'][_0x22a755][_0x5879('0x44')](_0x5879('0x4b'));}return _0x3774fc({'code':0xc8,'message':_0x428a77});}catch(_0x14c898){logger[_0x5879('0x3d')](_0x14c898[_0x5879('0x49')]);return _0x2e4408(_0x58ab9a[_0x5879('0x3d')](0x1f4,_0x14c898));}}logger[_0x5879('0x3d')](_0x5879('0x4a'));return _0x2e4408(_0x58ab9a[_0x5879('0x3d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2972a0){var _0x261e37=this;return new Promise(function(_0x146785,_0x5146b0){if(_0x4d8f69['agents'][_0x5879('0x4c')](_0x2972a0['id'])){for(var _0x29516b in _0x2972a0['capacity']){if(_0x2972a0[_0x5879('0x4d')]['hasOwnProperty'](_0x29516b)){if(_0x4d8f69[_0x5879('0x40')][_0x2972a0['id']]['hasOwnProperty'](_0x29516b+_0x5879('0x4e'))){_0x4d8f69['agents'][_0x2972a0['id']][_0x29516b+_0x5879('0x4e')]=parseInt(_0x2972a0[_0x5879('0x4d')][_0x29516b],0xa);}}}_0x4d8f69[_0x5879('0x40')][_0x2972a0['id']][_0x5879('0x4f')]();return _0x146785({'code':0xc8,'message':_0x4d8f69[_0x5879('0x40')][_0x2972a0['id']]});}else{return _0x5146b0(_0x261e37['error'](0x1f4,_0x5879('0x50')));}});},'Agents':function(_0x454221){return new Promise(function(_0xff958){var _0x40d1c9=_[_0x5879('0x51')](_0x4d8f69[_0x5879('0x40')]);if(_0x454221&&_0x454221['id']){var _0x55f7eb=_[_0x5879('0x52')](_0x40d1c9,function(_0x506a75){return _0x506a75['id']===_0x454221['id'];});_0xff958(_0x55f7eb);}else{_0xff958({'count':_0x40d1c9[_0x5879('0x24')],'rows':_0x40d1c9});}});},'ChatQueues':function(){return new Promise(function(_0x2f63b7){var _0x3ed815=[];for(var _0x4b1235 in _0x4d8f69['chatQueues']){if(_0x4d8f69[_0x5879('0x53')]['hasOwnProperty'](_0x4b1235)){var _0x468bfb=_0x4d8f69[_0x5879('0x53')][_0x4b1235];var _0x245983={'id':_0x468bfb['id'],'available':_0x468bfb[_0x5879('0x54')],'loggedIn':_0x468bfb[_0x5879('0x55')],'name':_0x468bfb[_0x5879('0x56')],'paused':_0x468bfb['paused'],'waiting':_0x468bfb[_0x5879('0x57')]};_0x3ed815[_0x5879('0x22')](_0x245983);}}_0x2f63b7({'count':_0x3ed815['length'],'rows':_0x3ed815});});},'MailQueues':function(){return new Promise(function(_0x17dd18){var _0x4fc85b=[];for(var _0x10f653 in _0x4d8f69[_0x5879('0x58')]){if(_0x4d8f69[_0x5879('0x58')][_0x5879('0x4c')](_0x10f653)){var _0x1a7d2a=_0x4d8f69[_0x5879('0x58')][_0x10f653];var _0x69c8c8={'id':_0x1a7d2a['id'],'available':_0x1a7d2a['available'],'loggedIn':_0x1a7d2a[_0x5879('0x55')],'name':_0x1a7d2a[_0x5879('0x56')],'paused':_0x1a7d2a[_0x5879('0x59')],'waiting':_0x1a7d2a['waiting']};_0x4fc85b[_0x5879('0x22')](_0x69c8c8);}}_0x17dd18({'count':_0x4fc85b[_0x5879('0x24')],'rows':_0x4fc85b});});},'OpenchannelQueues':function(){return new Promise(function(_0x52bbd1){var _0x5b5a04=[];for(var _0x1e4c5f in _0x4d8f69['openchannelQueues']){if(_0x4d8f69[_0x5879('0x5a')][_0x5879('0x4c')](_0x1e4c5f)){var _0x459122=_0x4d8f69['openchannelQueues'][_0x1e4c5f];var _0x4adc77={'id':_0x459122['id'],'available':_0x459122['available'],'loggedIn':_0x459122[_0x5879('0x55')],'name':_0x459122['name'],'paused':_0x459122[_0x5879('0x59')],'waiting':_0x459122[_0x5879('0x57')]};_0x5b5a04['push'](_0x4adc77);}}_0x52bbd1({'count':_0x5b5a04[_0x5879('0x24')],'rows':_0x5b5a04});});},'SmsQueues':function(){return new Promise(function(_0x390df2){var _0x165b0b=[];for(var _0x1e8628 in _0x4d8f69[_0x5879('0x5b')]){if(_0x4d8f69[_0x5879('0x5b')][_0x5879('0x4c')](_0x1e8628)){var _0x3e7ca7=_0x4d8f69[_0x5879('0x5b')][_0x1e8628];var _0xe8c94c={'id':_0x3e7ca7['id'],'available':_0x3e7ca7['available'],'loggedIn':_0x3e7ca7[_0x5879('0x55')],'name':_0x3e7ca7[_0x5879('0x56')],'paused':_0x3e7ca7['paused'],'waiting':_0x3e7ca7[_0x5879('0x57')]};_0x165b0b[_0x5879('0x22')](_0xe8c94c);}}_0x390df2({'count':_0x165b0b['length'],'rows':_0x165b0b});});},'FaxQueues':function(){return new Promise(function(_0x32a64c){var _0x995265=[];for(var _0x2969f1 in _0x4d8f69[_0x5879('0x5c')]){if(_0x4d8f69['faxQueues'][_0x5879('0x4c')](_0x2969f1)){var _0x33ab2f=_0x4d8f69[_0x5879('0x5c')][_0x2969f1];var _0x230bf1={'id':_0x33ab2f['id'],'available':_0x33ab2f[_0x5879('0x54')],'loggedIn':_0x33ab2f[_0x5879('0x55')],'name':_0x33ab2f[_0x5879('0x56')],'paused':_0x33ab2f[_0x5879('0x59')],'waiting':_0x33ab2f['waiting']};_0x995265[_0x5879('0x22')](_0x230bf1);}}_0x32a64c({'count':_0x995265['length'],'rows':_0x995265});});},'WhatsappQueues':function(){return new Promise(function(_0x415143){var _0x1b94c8=[];for(var _0x4a48ee in _0x4d8f69[_0x5879('0x5d')]){if(_0x4d8f69[_0x5879('0x5d')][_0x5879('0x4c')](_0x4a48ee)){var _0x3e7839=_0x4d8f69['whatsappQueues'][_0x4a48ee];var _0xcfe44e={'id':_0x3e7839['id'],'available':_0x3e7839['available'],'loggedIn':_0x3e7839[_0x5879('0x55')],'name':_0x3e7839[_0x5879('0x56')],'paused':_0x3e7839[_0x5879('0x59')],'waiting':_0x3e7839[_0x5879('0x57')]};_0x1b94c8[_0x5879('0x22')](_0xcfe44e);}}_0x415143({'count':_0x1b94c8[_0x5879('0x24')],'rows':_0x1b94c8});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4c4d53){var _0x5cd44b=_[_0x5879('0x51')](_0x4d8f69[_0x5879('0x5e')]);_0x4c4d53({'count':_0x5cd44b['length'],'rows':_0x5cd44b});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0xd13068){var _0x2376fe=_[_0x5879('0x51')](_0x4d8f69['mailQueuesWaitingInteractions']);_0xd13068({'count':_0x2376fe[_0x5879('0x24')],'rows':_0x2376fe});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x155317){var _0x60cfe5=_[_0x5879('0x51')](_0x4d8f69['openchannelQueuesWaitingInteractions']);_0x155317({'count':_0x60cfe5[_0x5879('0x24')],'rows':_0x60cfe5});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x44b95f){var _0x28667c=_[_0x5879('0x51')](_0x4d8f69[_0x5879('0x5f')]);_0x44b95f({'count':_0x28667c[_0x5879('0x24')],'rows':_0x28667c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3f8246){var _0x38c8f6=_[_0x5879('0x51')](_0x4d8f69[_0x5879('0x60')]);_0x3f8246({'count':_0x38c8f6['length'],'rows':_0x38c8f6});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x337525){var _0x40aa36=_['values'](_0x4d8f69[_0x5879('0x61')]);_0x337525({'count':_0x40aa36[_0x5879('0x24')],'rows':_0x40aa36});});}};var _0x488a80=jayson[_0x5879('0x62')](_0x2ca683)[_0x5879('0x63')]();_0x488a80['on'](_0x5879('0x3d'),function(_0x3320ab){logger[_0x5879('0x3d')](JSON[_0x5879('0x64')](_0x3320ab));return _0x398af0(_0x3320ab);});_0x488a80['listen'](0x232c,'127.0.0.1',function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xf4a646(_0x5879('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 8580691..38a1889 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 _0xb094=['stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','condition','rules','stop','length','push','Command','format','iftime\x20%s','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xb094,0x14b));var _0x4b09=function(_0x159a52,_0x366dc4){_0x159a52=_0x159a52-0x0;var _0x4e1f3f=_0xb094[_0x159a52];return _0x4e1f3f;};'use strict';var util=require('util');var BPromise=require(_0x4b09('0x0'));var jayson=require(_0x4b09('0x1'));var _=require(_0x4b09('0x2'));var logger=require(_0x4b09('0x3'))(_0x4b09('0x4'));var client=jayson['client'][_0x4b09('0x5')]({'port':0x232a});function request(_0x5128c4,_0xb5149c){return new BPromise(function(_0x5d09f0,_0x5e8c0c){return client[_0x4b09('0x6')](_0x5128c4,_0xb5149c)[_0x4b09('0x7')](function(_0x3d3867){if(_0x3d3867[_0x4b09('0x8')]){return _0x5e8c0c(_0x3d3867[_0x4b09('0x8')][_0x4b09('0x9')]);}else{return _0x5d09f0(_0x3d3867[_0x4b09('0xa')]);}})[_0x4b09('0xb')](function(_0x3a7fc9){return _0x5e8c0c(_0x3a7fc9);});});}exports[_0x4b09('0xc')]=function(_0x34152c,_0x3cffd4,_0x4dca41){return function(_0x4f61ab){if(_0x4dca41[_0x4b09('0xd')]&&!_0x4dca41[_0x4b09('0xd')][_0x34152c]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x34152c);return _0x4f61ab[_0x4b09('0xe')]();}var _0x558758=[];for(var _0x560f29=0x0;_0x560f29<_0x3cffd4[_0x4b09('0xf')];_0x560f29+=0x1){_0x558758[_0x4b09('0x10')](request(_0x4b09('0x11'),{'command':util[_0x4b09('0x12')](_0x4b09('0x13'),_0x3cffd4[_0x560f29])})[_0x4b09('0x7')](function(_0x39715b){return _0x39715b&&_0x39715b['message']&&_0x39715b[_0x4b09('0x9')]['indexOf']('true')>=0x0?!![]:![];})[_0x4b09('0xb')](function(_0x4d5530){logger[_0x4b09('0x8')](_0x4b09('0x14'),_0x34152c,_0x3cffd4[_0x560f29]);}));}BPromise[_0x4b09('0x15')](_0x558758)[_0x4b09('0x7')](function(_0x5ed7e3){var _0x4723e3=_[_0x4b09('0x16')](_0x5ed7e3);logger[_0x4b09('0x17')](_0x4b09('0x18'),_0x34152c,_0x3cffd4[_0x4b09('0x19')](_0x4b09('0x1a')),_0x4723e3);_0x4f61ab[_0x4b09('0x1b')](_0x4723e3);})[_0x4b09('0xb')](function(_0x553ba3){console[_0x4b09('0x1c')](_0x553ba3);logger['error'](_0x4b09('0x18'),_0x34152c,_0x3cffd4[_0x4b09('0x19')]('\x20|\x20'),_0x553ba3[_0x4b09('0x1d')]);_0x4f61ab['stop']();});};}; \ No newline at end of file +var _0x667c=['jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','catch','condition','rules','info','stop','length','Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x667c,0xfa));var _0xc667=function(_0x572152,_0x3f60ad){_0x572152=_0x572152-0x0;var _0x59445a=_0x667c[_0x572152];return _0x59445a;};'use strict';var util=require(_0xc667('0x0'));var BPromise=require(_0xc667('0x1'));var jayson=require(_0xc667('0x2'));var _=require(_0xc667('0x3'));var logger=require(_0xc667('0x4'))('routing');var client=jayson[_0xc667('0x5')][_0xc667('0x6')]({'port':0x232a});function request(_0x39cb74,_0x3bf373){return new BPromise(function(_0x18ac6f,_0x38c5cf){return client[_0xc667('0x7')](_0x39cb74,_0x3bf373)[_0xc667('0x8')](function(_0xc5d798){if(_0xc5d798[_0xc667('0x9')]){return _0x38c5cf(_0xc5d798[_0xc667('0x9')][_0xc667('0xa')]);}else{return _0x18ac6f(_0xc5d798['result']);}})[_0xc667('0xb')](function(_0x56dfea){return _0x38c5cf(_0x56dfea);});});}exports[_0xc667('0xc')]=function(_0x21cdfa,_0x287dfe,_0x586916){return function(_0x215f86){if(_0x586916['rules']&&!_0x586916[_0xc667('0xd')][_0x21cdfa]){logger[_0xc667('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x21cdfa);return _0x215f86[_0xc667('0xf')]();}var _0x5758ac=[];for(var _0x3b9f7a=0x0;_0x3b9f7a<_0x287dfe[_0xc667('0x10')];_0x3b9f7a+=0x1){_0x5758ac['push'](request(_0xc667('0x11'),{'command':util[_0xc667('0x12')](_0xc667('0x13'),_0x287dfe[_0x3b9f7a])})[_0xc667('0x8')](function(_0x58fd90){return _0x58fd90&&_0x58fd90[_0xc667('0xa')]&&_0x58fd90[_0xc667('0xa')][_0xc667('0x14')]('true')>=0x0?!![]:![];})[_0xc667('0xb')](function(_0x1ec793){logger[_0xc667('0x9')](_0xc667('0x15'),_0x21cdfa,_0x287dfe[_0x3b9f7a]);}));}BPromise[_0xc667('0x16')](_0x5758ac)['then'](function(_0xa55792){var _0x2f99af=_['some'](_0xa55792);logger['info'](_0xc667('0x17'),_0x21cdfa,_0x287dfe[_0xc667('0x18')](_0xc667('0x19')),_0x2f99af);_0x215f86[_0xc667('0x1a')](_0x2f99af);})[_0xc667('0xb')](function(_0x196f7c){console[_0xc667('0x1b')](_0x196f7c);logger[_0xc667('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x21cdfa,_0x287dfe[_0xc667('0x18')](_0xc667('0x19')),_0x196f7c['stack']);_0x215f86['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 4410af4..ec70c69 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 _0xa9e0=['complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5dd881,_0x550fbc){utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x4'),_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['interface'],_0x5dd881[_0x0a9e('0x9')],_0x5dd881[_0x0a9e('0xa')],_0x5dd881[_0x0a9e('0xb')]));if(_0x5dd881['queue']){utils['getVoiceQueueByName'](_0x5dd881[_0x0a9e('0x7')])['then'](function(_0x52cace){if(_0x52cace){_0x5dd881[_0x0a9e('0xc')]=_0x52cace[_0x0a9e('0xc')];_0x5dd881[_0x0a9e('0xd')]=_0x5dd881[_0x0a9e('0xe')]?_0x52cace[_0x0a9e('0xf')]:![];_0x5dd881[_0x0a9e('0x10')]=_0x5dd881['agentacw']?_0x52cace['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x5dd881);});}else{utils[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x5dd881);}if(_0x550fbc){delete transfers[_0x5dd881[_0x0a9e('0x5')]];}else{delete agents[_0x5dd881[_0x0a9e('0x13')]];}}exports[_0x0a9e('0x14')]=function(_0x69aeb7){try{utils['debug'](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x69aeb7);agents[_0x69aeb7[_0x0a9e('0x13')]]=_0x69aeb7;agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x17')]=utils['now']();agents[_0x69aeb7[_0x0a9e('0x13')]]['lastevent']=_0x0a9e('0x18');agents[_0x69aeb7['destuniqueid']][_0x0a9e('0xa')]=null;agents[_0x69aeb7[_0x0a9e('0x13')]]['connectedlinename']=null;utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x19'),_0x69aeb7[_0x0a9e('0x5')],agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x69aeb7[_0x0a9e('0x13')]));}catch(_0x2eb11f){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x2eb11f);}};exports[_0x0a9e('0x1b')]=function(_0x105080){try{if(!_['isNil'](agents[_0x105080[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format'](_0x0a9e('0x1d'),_0x105080['uniqueid']),_0x105080);utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x1e'),_0x105080[_0x0a9e('0x5')],agents[_0x105080[_0x0a9e('0x13')]]['membername'],_0x105080[_0x0a9e('0x13')]));agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1b')]=!![];agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();agents[_0x105080[_0x0a9e('0x13')]]['lastevent']='timeout';agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x21')]=_0x0a9e('0x22');agents[_0x105080[_0x0a9e('0x13')]]['holdtime']=_0x105080[_0x0a9e('0x23')]?parseInt(_0x105080['ringtime'])/0x3e8:0x0;agents[_0x105080[_0x0a9e('0x13')]]['talktime']=0x0;unanswered[_0x0a9e('0x24')](_0x105080[_0x0a9e('0x13')]);}}catch(_0x25fba9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x1d'),_0x105080[_0x0a9e('0x5')]),_0x25fba9);}};exports[_0x0a9e('0x25')]=function(_0x5a101a){try{_[_0x0a9e('0x26')](agents,function(_0x468813,_0x2b1f27){if(_0x468813[_0x0a9e('0x5')]==_0x5a101a['uniqueid']&&!_[_0x0a9e('0x27')](unanswered,_0x468813[_0x0a9e('0x13')])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a[_0x0a9e('0x5')]),_0x5a101a);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x29'),_0x5a101a['uniqueid'],_0x468813[_0x0a9e('0x8')],_0x468813['destuniqueid']));_0x468813[_0x0a9e('0x1b')]=!![];_0x468813[_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();_0x468813[_0x0a9e('0xb')]=_0x0a9e('0x2a');_0x468813['reason']=_0x0a9e('0x2a');_0x468813[_0x0a9e('0x2b')]=_0x5a101a[_0x0a9e('0x2b')];_0x468813[_0x0a9e('0x2c')]=0x0;writeDB(_0x468813);}});}catch(_0x2b45ea){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a['uniqueid']),_0x2b45ea);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(agents[_0x5e7238[_0x0a9e('0x13')]]){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238['uniqueid']),_0x5e7238);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x2f'),_0x5e7238[_0x0a9e('0x5')],agents[_0x5e7238['destuniqueid']]['membername'],_0x5e7238[_0x0a9e('0x13')]));agents[_0x5e7238['destuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0xa')]=_0x5e7238['connectedlinenum'];agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0x31')]=_0x5e7238[_0x0a9e('0x31')];agents[_0x5e7238['destuniqueid']][_0x0a9e('0x2b')]=_0x5e7238[_0x0a9e('0x23')];agents[_0x5e7238[_0x0a9e('0x13')]]['lastevent']='connect';_[_0x0a9e('0x26')](agents,function(_0x40d766,_0x5adda1){if(_0x40d766[_0x0a9e('0x13')]!=_0x5e7238[_0x0a9e('0x13')]&&_0x40d766[_0x0a9e('0x5')]==_0x5e7238[_0x0a9e('0x5')]){_0x40d766['talktime']=0x0;_0x40d766['holdtime']=_0x5e7238[_0x0a9e('0x23')];_0x40d766[_0x0a9e('0x1b')]=!![];_0x40d766['agentringnoanswerAt']=utils[_0x0a9e('0x20')]();_0x40d766[_0x0a9e('0xb')]=_0x0a9e('0x32');_0x40d766['reason']=_0x0a9e('0x32');_0x40d766[_0x0a9e('0x33')]=_0x5e7238[_0x0a9e('0x13')];_0x40d766[_0x0a9e('0x34')]=_0x5e7238[_0x0a9e('0x8')];writeDB(_0x40d766);}});}}catch(_0xeaa5e5){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238[_0x0a9e('0x5')]),_0xeaa5e5);}};exports[_0x0a9e('0xe')]=function(_0x148007){try{if(!_[_0x0a9e('0x35')](agents[_0x148007[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x148007[_0x0a9e('0x5')]),_0x148007);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x36'),_0x148007[_0x0a9e('0x5')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x148007[_0x0a9e('0x13')]));agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0xe')]=!![];agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')]=utils['now']();agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x30')]);agents[_0x148007[_0x0a9e('0x13')]]['reason']=_0x148007[_0x0a9e('0x21')];agents[_0x148007['destuniqueid']][_0x0a9e('0xb')]=_0x0a9e('0x39');writeDB(agents[_0x148007[_0x0a9e('0x13')]]);}}catch(_0x562fb4){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x3a'),_0x148007[_0x0a9e('0x5')]),_0x562fb4);}};exports[_0x0a9e('0x3b')]=function(_0x37be73){try{if(!_[_0x0a9e('0x35')](agents[_0x37be73['transfereruniqueid']])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x37be73);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x3d'),_0x37be73[_0x0a9e('0x5')],agents[_0x37be73[_0x0a9e('0x3e')]]['membername'],agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x5')]));agents[_0x37be73['transfereruniqueid']]['transfer']=!![];agents[_0x37be73['transfereruniqueid']][_0x0a9e('0x3f')]=_0x0a9e('0x40');agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x41')]=_0x37be73[_0x0a9e('0x42')];agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x43')]=agents[_0x37be73[_0x0a9e('0x3e')]]['uniqueid'];}}catch(_0x4b1b9f){utils['error'](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x4b1b9f);}};exports['attendedtransfer']=function(_0x2b69d9){try{utils[_0x0a9e('0x1c')](util['format']('[%s][agents][attendedtransfer]',_0x2b69d9[_0x0a9e('0x44')]),_0x2b69d9);if(_0x2b69d9['origtransfereruniqueid']==_0x2b69d9[_0x0a9e('0x45')]){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x46')]])){utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x46')]]['membername']));agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x47')]=!![];agents[_0x2b69d9[_0x0a9e('0x46')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x41')]=_0x2b69d9['origtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x46')]]['transferuniqueid']=_0x2b69d9['origtransfereruniqueid'];}if(_0x2b69d9['transfereeuniqueid']&&agents[_0x2b69d9[_0x0a9e('0x49')]]){agents[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9[_0x0a9e('0x49')]]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x49')]]);transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x9')];transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x4c')];transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x17')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x2;}}else if(_0x2b69d9['secondtransfereruniqueid']==_0x2b69d9['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x44')]])){utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x4d'),_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x8')]));agents[_0x2b69d9[_0x0a9e('0x44')]]['transfer']=!![];agents[_0x2b69d9[_0x0a9e('0x44')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x41')]=_0x2b69d9['secondtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x43')]=_0x2b69d9[_0x0a9e('0x46')];}if(_0x2b69d9[_0x0a9e('0x4e')]&&agents[_0x2b69d9['transfertargetuniqueid']]){agents[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9['transfertargetuniqueid']]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x4e')]]);transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridnum'];transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridname'];transfers[_0x2b69d9[_0x0a9e('0x4e')]]['agentcalledAt']=utils['now']();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x2;}}}catch(_0x54a37d){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x4f'),_0x2b69d9[_0x0a9e('0x44')]),_0x54a37d);}};exports[_0x0a9e('0x50')]=function(_0x2b8192){try{utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x51'),_0x2b8192[_0x0a9e('0x5')]),_0x2b8192);if(agents[_0x2b8192['uniqueid']]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]===_0x0a9e('0x22')){if(_0x2b8192['cause']==='21'){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]='rejected';agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]=_0x0a9e('0x52');}utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b8192['uniqueid'],agents[_0x2b8192['uniqueid']][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);var _0xeef20=unanswered[_0x0a9e('0x53')](_0x2b8192['uniqueid']);if(_0xeef20>-0x1){unanswered[_0x0a9e('0x54')](_0xeef20,0x1);}}if(transfers[_0x2b8192[_0x0a9e('0x5')]]){transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcomplete']=!![];transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcompleteAt']=utils[_0x0a9e('0x20')]();transfers[_0x2b8192[_0x0a9e('0x5')]]['talktime']=utils[_0x0a9e('0x38')](transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')],transfers[_0x2b8192[_0x0a9e('0x5')]]['agentconnectAt']);transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]=_0x0a9e('0x55');transfers[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x56'),_0x2b8192['uniqueid'],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(transfers[_0x2b8192[_0x0a9e('0x5')]],!![]);}if(agents[_0x2b8192[_0x0a9e('0x5')]]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xe')]=!![];agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')]=utils['now']();agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x2b8192['uniqueid']][_0x0a9e('0x37')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]);agents[_0x2b8192[_0x0a9e('0x5')]]['reason']=agents[_0x2b8192['uniqueid']][_0x0a9e('0x47')]?_0x0a9e('0x47'):'agent';agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x56'),_0x2b8192[_0x0a9e('0x5')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);}}catch(_0x3ca9b9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')]('[%s][agents][hangup]',_0x2b8192[_0x0a9e('0x5')]),_0x3ca9b9);}}; \ No newline at end of file +var _0xa478=['push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentcomplete','acw','agentacw','request','CreateVoiceAgentReport','agentcalled','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime'];(function(_0x2112e2,_0x5b9535){var _0x27dbe7=function(_0x100e2f){while(--_0x100e2f){_0x2112e2['push'](_0x2112e2['shift']());}};_0x27dbe7(++_0x5b9535);}(_0xa478,0x136));var _0x8a47=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0xa478[_0x41d432];return _0x1650f9;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var utils=require(_0x8a47('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44be2c,_0x2c3f60){utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x5'),_0x44be2c[_0x8a47('0x6')],_0x44be2c[_0x8a47('0x7')],_0x44be2c[_0x8a47('0x8')],_0x44be2c[_0x8a47('0x9')],_0x44be2c['interface'],_0x44be2c[_0x8a47('0xa')],_0x44be2c[_0x8a47('0xb')],_0x44be2c[_0x8a47('0xc')]));if(_0x44be2c[_0x8a47('0x8')]){utils['getVoiceQueueByName'](_0x44be2c[_0x8a47('0x8')])['then'](function(_0x7b6e61){if(_0x7b6e61){_0x44be2c[_0x8a47('0xd')]=_0x7b6e61[_0x8a47('0xd')];_0x44be2c['agentacw']=_0x44be2c[_0x8a47('0xe')]?_0x7b6e61[_0x8a47('0xf')]:![];_0x44be2c['acwtime']=_0x44be2c[_0x8a47('0x10')]?_0x7b6e61['acwTimeout']:0x0;}utils[_0x8a47('0x11')](_0x8a47('0x12'),_0x44be2c);});}else{utils[_0x8a47('0x11')]('CreateVoiceAgentReport',_0x44be2c);}if(_0x2c3f60){delete transfers[_0x44be2c['uniqueid']];}else{delete agents[_0x44be2c['destuniqueid']];}}exports[_0x8a47('0x13')]=function(_0x12539c){try{utils['debug'](util[_0x8a47('0x4')](_0x8a47('0x14'),_0x12539c[_0x8a47('0x6')]),_0x12539c);agents[_0x12539c[_0x8a47('0x15')]]=_0x12539c;agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0x16')]=utils[_0x8a47('0x17')]();agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0xc')]=_0x8a47('0x18');agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0xb')]=null;agents[_0x12539c[_0x8a47('0x15')]]['connectedlinename']=null;utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x19'),_0x12539c['uniqueid'],agents[_0x12539c[_0x8a47('0x15')]]['membername'],_0x12539c['destuniqueid']));}catch(_0x1cf650){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x14'),_0x12539c[_0x8a47('0x6')]),_0x1cf650);}};exports[_0x8a47('0x1b')]=function(_0x44e119){try{if(!_[_0x8a47('0x1c')](agents[_0x44e119[_0x8a47('0x15')]])){utils[_0x8a47('0x1d')](util['format'](_0x8a47('0x1e'),_0x44e119['uniqueid']),_0x44e119);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x1f'),_0x44e119[_0x8a47('0x6')],agents[_0x44e119['destuniqueid']][_0x8a47('0x9')],_0x44e119['destuniqueid']));agents[_0x44e119['destuniqueid']]['agentringnoanswer']=!![];agents[_0x44e119['destuniqueid']][_0x8a47('0x20')]=utils[_0x8a47('0x17')]();agents[_0x44e119['destuniqueid']][_0x8a47('0xc')]=_0x8a47('0x21');agents[_0x44e119[_0x8a47('0x15')]][_0x8a47('0x22')]=_0x8a47('0x21');agents[_0x44e119[_0x8a47('0x15')]][_0x8a47('0x23')]=_0x44e119['ringtime']?parseInt(_0x44e119[_0x8a47('0x24')])/0x3e8:0x0;agents[_0x44e119['destuniqueid']][_0x8a47('0x25')]=0x0;unanswered[_0x8a47('0x26')](_0x44e119['destuniqueid']);}}catch(_0x1e89b1){utils['error'](util['format'](_0x8a47('0x1e'),_0x44e119[_0x8a47('0x6')]),_0x1e89b1);}};exports[_0x8a47('0x27')]=function(_0x12f0b7){try{_[_0x8a47('0x28')](agents,function(_0x18bfd3,_0x58aa06){if(_0x18bfd3[_0x8a47('0x6')]==_0x12f0b7['uniqueid']&&!_['includes'](unanswered,_0x18bfd3[_0x8a47('0x15')])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x29'),_0x12f0b7[_0x8a47('0x6')]),_0x12f0b7);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x2a'),_0x12f0b7[_0x8a47('0x6')],_0x18bfd3[_0x8a47('0x9')],_0x18bfd3['destuniqueid']));_0x18bfd3[_0x8a47('0x1b')]=!![];_0x18bfd3[_0x8a47('0x20')]=utils[_0x8a47('0x17')]();_0x18bfd3['lastevent']=_0x8a47('0x2b');_0x18bfd3[_0x8a47('0x22')]='abandoned';_0x18bfd3[_0x8a47('0x23')]=_0x12f0b7[_0x8a47('0x23')];_0x18bfd3[_0x8a47('0x25')]=0x0;writeDB(_0x18bfd3);}});}catch(_0x20551b){utils['error'](util['format'](_0x8a47('0x29'),_0x12f0b7[_0x8a47('0x6')]),_0x20551b);}};exports[_0x8a47('0x2c')]=function(_0x42c5d7){try{if(agents[_0x42c5d7[_0x8a47('0x15')]]){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')]('[%s][agents][agentconnect]',_0x42c5d7['uniqueid']),_0x42c5d7);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x2d'),_0x42c5d7[_0x8a47('0x6')],agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0x9')],_0x42c5d7[_0x8a47('0x15')]));agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0x2e')]=utils[_0x8a47('0x17')]();agents[_0x42c5d7[_0x8a47('0x15')]]['connectedlinenum']=_0x42c5d7[_0x8a47('0xb')];agents[_0x42c5d7['destuniqueid']]['connectedlinename']=_0x42c5d7['connectedlinename'];agents[_0x42c5d7['destuniqueid']]['holdtime']=_0x42c5d7[_0x8a47('0x24')];agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0xc')]=_0x8a47('0x2f');_[_0x8a47('0x28')](agents,function(_0x20ba1c,_0x25c45b){if(_0x20ba1c[_0x8a47('0x15')]!=_0x42c5d7['destuniqueid']&&_0x20ba1c['uniqueid']==_0x42c5d7[_0x8a47('0x6')]){_0x20ba1c[_0x8a47('0x25')]=0x0;_0x20ba1c[_0x8a47('0x23')]=_0x42c5d7[_0x8a47('0x24')];_0x20ba1c['agentringnoanswer']=!![];_0x20ba1c[_0x8a47('0x20')]=utils[_0x8a47('0x17')]();_0x20ba1c[_0x8a47('0xc')]=_0x8a47('0x30');_0x20ba1c[_0x8a47('0x22')]='answered_elsewhere';_0x20ba1c[_0x8a47('0x31')]=_0x42c5d7[_0x8a47('0x15')];_0x20ba1c[_0x8a47('0x32')]=_0x42c5d7['membername'];writeDB(_0x20ba1c);}});}}catch(_0x2b3874){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x33'),_0x42c5d7['uniqueid']),_0x2b3874);}};exports[_0x8a47('0xe')]=function(_0x2f523f){try{if(!_[_0x8a47('0x1c')](agents[_0x2f523f[_0x8a47('0x15')]])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')]('[%s][agents][agentcomplete]',_0x2f523f['uniqueid']),_0x2f523f);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x34'),_0x2f523f['uniqueid'],agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x9')],_0x2f523f['destuniqueid']));agents[_0x2f523f['destuniqueid']][_0x8a47('0xe')]=!![];agents[_0x2f523f['destuniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x25')]=utils[_0x8a47('0x36')](agents[_0x2f523f[_0x8a47('0x15')]]['agentcompleteAt'],agents[_0x2f523f['destuniqueid']][_0x8a47('0x2e')]);agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x22')]=_0x2f523f[_0x8a47('0x22')];agents[_0x2f523f[_0x8a47('0x15')]]['lastevent']='complete';writeDB(agents[_0x2f523f[_0x8a47('0x15')]]);}}catch(_0x531faa){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')]('[%s][agents][agentcomplete]',_0x2f523f[_0x8a47('0x6')]),_0x531faa);}};exports[_0x8a47('0x37')]=function(_0x14e22c){try{if(!_[_0x8a47('0x1c')](agents[_0x14e22c[_0x8a47('0x38')]])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x39'),_0x14e22c['uniqueid']),_0x14e22c);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x3a'),_0x14e22c[_0x8a47('0x6')],agents[_0x14e22c['transfereruniqueid']][_0x8a47('0x9')],agents[_0x14e22c[_0x8a47('0x38')]][_0x8a47('0x6')]));agents[_0x14e22c[_0x8a47('0x38')]][_0x8a47('0x3b')]=!![];agents[_0x14e22c[_0x8a47('0x38')]]['transfertype']='blind';agents[_0x14e22c[_0x8a47('0x38')]]['transferexten']=_0x14e22c[_0x8a47('0x3c')];agents[_0x14e22c[_0x8a47('0x38')]]['transferuniqueid']=agents[_0x14e22c[_0x8a47('0x38')]]['uniqueid'];}}catch(_0x315111){utils['error'](util[_0x8a47('0x4')]('[%s][agents][blindtransfer]',_0x14e22c[_0x8a47('0x6')]),_0x315111);}};exports[_0x8a47('0x3d')]=function(_0xdaa896){try{utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x3e'),_0xdaa896[_0x8a47('0x3f')]),_0xdaa896);if(_0xdaa896[_0x8a47('0x3f')]==_0xdaa896[_0x8a47('0x40')]){if(!_[_0x8a47('0x1c')](agents[_0xdaa896[_0x8a47('0x41')]])){utils['info'](util[_0x8a47('0x4')](_0x8a47('0x42'),_0xdaa896['origtransfereruniqueid'],agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x9')]));agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x3b')]=!![];agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x43')]=_0x8a47('0x44');agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x45')]=_0xdaa896[_0x8a47('0x46')];agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x47')]=_0xdaa896['origtransfereruniqueid'];}if(_0xdaa896[_0x8a47('0x48')]&&agents[_0xdaa896[_0x8a47('0x48')]]){agents[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x49')]=0x1;transfers[_0xdaa896[_0x8a47('0x48')]]=_[_0x8a47('0x4a')](agents[_0xdaa896[_0x8a47('0x48')]]);transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0xa')]=agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0xa')];transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x4b')]=agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x4b')];transfers[_0xdaa896[_0x8a47('0x48')]]['agentcalledAt']=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfereeuniqueid']][_0x8a47('0x2e')]=utils[_0x8a47('0x17')]();transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x23')]=0x0;transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x49')]=0x2;}}else if(_0xdaa896['secondtransfereruniqueid']==_0xdaa896[_0x8a47('0x4c')]){if(!_[_0x8a47('0x1c')](agents[_0xdaa896[_0x8a47('0x3f')]])){utils['info'](util['format'](_0x8a47('0x42'),_0xdaa896[_0x8a47('0x3f')],agents[_0xdaa896['origtransfereruniqueid']][_0x8a47('0x9')]));agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x3b')]=!![];agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x43')]=_0x8a47('0x44');agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x45')]=_0xdaa896[_0x8a47('0x4d')];agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x47')]=_0xdaa896[_0x8a47('0x41')];}if(_0xdaa896[_0x8a47('0x4e')]&&agents[_0xdaa896['transfertargetuniqueid']]){agents[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x49')]=0x1;transfers[_0xdaa896[_0x8a47('0x4e')]]=_[_0x8a47('0x4a')](agents[_0xdaa896[_0x8a47('0x4e')]]);transfers[_0xdaa896[_0x8a47('0x4e')]]['calleridnum']=agents[_0xdaa896[_0x8a47('0x3f')]]['calleridnum'];transfers[_0xdaa896['transfertargetuniqueid']][_0x8a47('0x4b')]=agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x4b')];transfers[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x16')]=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfertargetuniqueid']]['agentconnectAt']=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfertargetuniqueid']][_0x8a47('0x23')]=0x0;transfers[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x49')]=0x2;}}}catch(_0x39d8f4){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x3e'),_0xdaa896[_0x8a47('0x3f')]),_0x39d8f4);}};exports['hangup']=function(_0x5c1e7e){try{utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x4f'),_0x5c1e7e['uniqueid']),_0x5c1e7e);if(agents[_0x5c1e7e['uniqueid']]&&agents[_0x5c1e7e['uniqueid']][_0x8a47('0x22')]==='timeout'){if(_0x5c1e7e[_0x8a47('0x50')]==='21'){agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')]=_0x8a47('0x51');agents[_0x5c1e7e['uniqueid']][_0x8a47('0xc')]='rejected';}utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x52'),_0x5c1e7e['uniqueid'],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],agents[_0x5c1e7e['uniqueid']][_0x8a47('0x22')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(agents[_0x5c1e7e[_0x8a47('0x6')]]);var _0x4c6dbe=unanswered[_0x8a47('0x53')](_0x5c1e7e[_0x8a47('0x6')]);if(_0x4c6dbe>-0x1){unanswered[_0x8a47('0x54')](_0x4c6dbe,0x1);}}if(transfers[_0x5c1e7e['uniqueid']]){transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xe')]=!![];transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x25')]=utils[_0x8a47('0x36')](transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x35')],transfers[_0x5c1e7e[_0x8a47('0x6')]]['agentconnectAt']);transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x22')]=_0x8a47('0x55');transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]=_0x8a47('0x56');utils[_0x8a47('0x3')](util[_0x8a47('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5c1e7e[_0x8a47('0x6')],transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x22')],transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(transfers[_0x5c1e7e[_0x8a47('0x6')]],!![]);}if(agents[_0x5c1e7e[_0x8a47('0x6')]]&&agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x2e')]){agents[_0x5c1e7e[_0x8a47('0x6')]]['agentcomplete']=!![];agents[_0x5c1e7e['uniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();agents[_0x5c1e7e[_0x8a47('0x6')]]['talktime']=utils[_0x8a47('0x36')](agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x35')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x2e')]);agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')]=agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x3b')]?_0x8a47('0x3b'):_0x8a47('0x55');agents[_0x5c1e7e[_0x8a47('0x6')]]['lastevent']=_0x8a47('0x56');utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x52'),_0x5c1e7e[_0x8a47('0x6')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(agents[_0x5c1e7e['uniqueid']]);}}catch(_0x98d7ae){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x4f'),_0x5c1e7e[_0x8a47('0x6')]),_0x98d7ae);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index fc3a906..b074c54 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 _0xff4c=['routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','linkedid','transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x4ee64f,_0x43a8de){var _0x15d35a=function(_0x51c2a9){while(--_0x51c2a9){_0x4ee64f['push'](_0x4ee64f['shift']());}};_0x15d35a(++_0x43a8de);}(_0xff4c,0x167));var _0xcff4=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xff4c[_0x10d34b];return _0x92b0bf;};'use strict';var _=require(_0xcff4('0x0'));var util=require(_0xcff4('0x1'));var utils=require('./utils');var transfers=require(_0xcff4('0x2'));var dispositions=['NO\x20ANSWER',_0xcff4('0x3'),_0xcff4('0x3'),'NO\x20ANSWER',_0xcff4('0x4'),_0xcff4('0x4'),_0xcff4('0x5'),_0xcff4('0x6'),_0xcff4('0x3'),'FAILED',_0xcff4('0x3')];var channels={};function writeDB(_0x37f75c){var _0x44c9fa;if(transfers[_0xcff4('0x7')][_0x37f75c[_0xcff4('0x8')]]){_0x44c9fa=_0x37f75c['uniqueid'];_0x37f75c[_0xcff4('0x8')]=transfers[_0xcff4('0x7')][_0x37f75c[_0xcff4('0x8')]][_0xcff4('0x9')];}utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0xc'),_0x37f75c['uniqueid'],_0x37f75c[_0xcff4('0xd')],_0x37f75c[_0xcff4('0xe')],_0x37f75c[_0xcff4('0xf')],_0x37f75c['interface'],_0x37f75c[_0xcff4('0x10')],_0x37f75c[_0xcff4('0x11')],_0x37f75c[_0xcff4('0x12')]));if(_0x37f75c[_0xcff4('0x13')]){utils[_0xcff4('0x14')](_0x37f75c['accountcode'])['then'](function(_0x12ee37){if(_0x12ee37){_0x37f75c[_0xcff4('0x15')]=_0x12ee37['id'];}utils['request']('CreateVoiceCallReport',_0x37f75c);});}else{utils[_0xcff4('0x16')](_0xcff4('0x17'),_0x37f75c);}if(channels[_0x37f75c[_0xcff4('0x8')]]){delete channels[_0x37f75c[_0xcff4('0x8')]];}else if(_0x44c9fa&&channels[_0x44c9fa]){if(!transfers[_0xcff4('0x7')][_0x44c9fa]['recording'])delete transfers['blinds'][_0x44c9fa];delete channels[_0x44c9fa];}}exports[_0xcff4('0x18')]=function(_0x628d54){try{utils[_0xcff4('0x19')](util[_0xcff4('0xb')](_0xcff4('0x1a'),_0x628d54[_0xcff4('0x8')]),_0x628d54);if(_0x628d54['uniqueid']==_0x628d54['linkedid']&&_0x628d54[_0xcff4('0xd')]!='OutgoingSpoolFailed'){utils['info'](util[_0xcff4('0xb')](_0xcff4('0x1b'),_0x628d54['uniqueid'],_0x628d54[_0xcff4('0x1c')],_0x628d54[_0xcff4('0x1d')]));channels[_0x628d54[_0xcff4('0x8')]]={'uniqueid':_0x628d54['uniqueid'],'accountcode':_0x628d54[_0xcff4('0x13')],'source':_0x628d54[_0xcff4('0x10')],'destination':_0x628d54[_0xcff4('0x1d')],'destinationcontext':_0x628d54[_0xcff4('0x1c')],'channel':_0x628d54['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xcff4('0x4'),'amaflags':_0xcff4('0x1e')};}}catch(_0x3c6835){utils[_0xcff4('0x1f')](util[_0xcff4('0xb')](_0xcff4('0x1a'),_0x628d54[_0xcff4('0x8')]),_0x3c6835);}};exports['newstate']=function(_0x5acc7a){try{utils[_0xcff4('0x19')](util['format'](_0xcff4('0x20'),_0x5acc7a[_0xcff4('0x8')]),_0x5acc7a);if(!_[_0xcff4('0x21')](channels[_0x5acc7a[_0xcff4('0x8')]])&&_0x5acc7a[_0xcff4('0x22')]==0x6){utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x23'),_0x5acc7a['uniqueid'],_0x5acc7a['context'],_0x5acc7a['channel']));if(_[_0xcff4('0x21')](channels[_0x5acc7a[_0xcff4('0x8')]][_0xcff4('0x24')])){channels[_0x5acc7a[_0xcff4('0x8')]][_0xcff4('0x24')]=utils[_0xcff4('0x25')]();}}else if(!_['isNil'](channels[_0x5acc7a[_0xcff4('0x26')]])&&_0x5acc7a[_0xcff4('0x22')]==0x6&&_0x5acc7a['context']!=_0xcff4('0x27')){utils[_0xcff4('0xa')](util[_0xcff4('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5acc7a['uniqueid'],_0x5acc7a[_0xcff4('0x26')],_0x5acc7a[_0xcff4('0x1c')],_0x5acc7a[_0xcff4('0xd')]));channels[_0x5acc7a[_0xcff4('0x26')]]['accountcode']=_0x5acc7a[_0xcff4('0x13')];channels[_0x5acc7a[_0xcff4('0x26')]][_0xcff4('0x28')]=_0x5acc7a[_0xcff4('0xd')];if(_['isNil'](channels[_0x5acc7a['linkedid']][_0xcff4('0x29')])){channels[_0x5acc7a[_0xcff4('0x26')]]['answertime']=utils[_0xcff4('0x25')]();}channels[_0x5acc7a['linkedid']][_0xcff4('0x2a')]=dispositions[_[_0xcff4('0x2b')](_0x5acc7a[_0xcff4('0x22')])]||_0xcff4('0x5');}}catch(_0x495a86){utils[_0xcff4('0x1f')](util[_0xcff4('0xb')](_0xcff4('0x20'),_0x5acc7a[_0xcff4('0x8')]),_0x495a86);}};exports[_0xcff4('0x2c')]=function(_0x58d2e3){try{if(!_[_0xcff4('0x21')](channels[_0x58d2e3[_0xcff4('0x8')]])){utils['debug'](util['format'](_0xcff4('0x2d'),_0x58d2e3['uniqueid']),_0x58d2e3);if(_[_0xcff4('0x21')](channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x2e')])){channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x2e')]=_0x58d2e3['calleridname']+'\x20<'+_0x58d2e3['calleridnum']+'>';}utils[_0xcff4('0xa')](util['format'](_0xcff4('0x2f'),_0x58d2e3[_0xcff4('0x8')],channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x2e')],_0x58d2e3[_0xcff4('0x30')]));channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x31')]=utils[_0xcff4('0x25')]();channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x32')]=utils['diffTime'](channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x31')],channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x33')]);channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x34')]=channels[_0x58d2e3['uniqueid']][_0xcff4('0x29')]?utils[_0xcff4('0x35')](channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x31')],channels[_0x58d2e3[_0xcff4('0x8')]][_0xcff4('0x29')]):0x0;writeDB(channels[_0x58d2e3['uniqueid']]);}}catch(_0x30d9ae){utils['error'](util['format']('[%s][calls][hangup]',_0x58d2e3[_0xcff4('0x8')]),_0x30d9ae);}};exports[_0xcff4('0x36')]=function(_0x593564){try{if(!_[_0xcff4('0x21')](channels[_0x593564[_0xcff4('0x37')]])){utils[_0xcff4('0x19')](util['format'](_0xcff4('0x38'),_0x593564[_0xcff4('0x39')]),_0x593564);if(channels[_0x593564[_0xcff4('0x37')]][_0xcff4('0xd')]==_0x593564[_0xcff4('0x3a')]){utils['info'](util[_0xcff4('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x593564[_0xcff4('0x39')],_0x593564[_0xcff4('0x37')],_0x593564['secondtransfererchannel']));channels[_0x593564['localtwolinkedid']][_0xcff4('0x28')]=_0x593564[_0xcff4('0x3b')];channels[_0x593564[_0xcff4('0x37')]][_0xcff4('0x3c')]=_0xcff4('0x3d');}else if(channels[_0x593564['localtwolinkedid']][_0xcff4('0xd')]=_0x593564[_0xcff4('0x3e')]){utils[_0xcff4('0xa')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x593564[_0xcff4('0x39')],_0x593564[_0xcff4('0x37')],_0x593564[_0xcff4('0x3f')]));channels[_0x593564['localtwolinkedid']][_0xcff4('0x28')]=_0x593564[_0xcff4('0x3f')];channels[_0x593564[_0xcff4('0x37')]][_0xcff4('0x3c')]=_0xcff4('0x3d');}}}catch(_0x8ad6fc){utils[_0xcff4('0x1f')](util['format'](_0xcff4('0x38'),_0x593564[_0xcff4('0x39')]),_0x8ad6fc);}};exports[_0xcff4('0x40')]=function(_0x3f4e24){try{if(!_['isNil'](channels[_0x3f4e24['uniqueid']])){utils[_0xcff4('0x19')](util['format'](_0xcff4('0x41'),_0x3f4e24['uniqueid']),_0x3f4e24);channels[_0x3f4e24[_0xcff4('0x8')]][_0xcff4('0x42')]=utils[_0xcff4('0x25')]();utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x43'),_0x3f4e24[_0xcff4('0x8')],channels[_0x3f4e24[_0xcff4('0x8')]][_0xcff4('0x42')]));}}catch(_0x390257){utils[_0xcff4('0x1f')](util['format'](_0xcff4('0x41'),_0x3f4e24[_0xcff4('0x8')]),_0x390257);}};exports[_0xcff4('0x44')]=function(_0x369aae){try{if(!_[_0xcff4('0x21')](channels[_0x369aae[_0xcff4('0x8')]])){utils['debug'](util[_0xcff4('0xb')](_0xcff4('0x45'),_0x369aae[_0xcff4('0x8')]),_0x369aae);if(!_['isNil'](channels[_0x369aae['uniqueid']][_0xcff4('0x42')])){channels[_0x369aae[_0xcff4('0x8')]][_0xcff4('0x46')]+=utils[_0xcff4('0x35')](utils['now'](),channels[_0x369aae[_0xcff4('0x8')]][_0xcff4('0x42')]);utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x47'),_0x369aae[_0xcff4('0x8')],channels[_0x369aae['uniqueid']][_0xcff4('0x46')]));delete channels[_0x369aae[_0xcff4('0x8')]][_0xcff4('0x42')];}}}catch(_0xabdfc){utils[_0xcff4('0x1f')](util[_0xcff4('0xb')](_0xcff4('0x45'),_0x369aae[_0xcff4('0x8')]),_0xabdfc);}};exports[_0xcff4('0x48')]=function(_0x1e82fa){try{if(!_[_0xcff4('0x21')](channels[_0x1e82fa['uniqueid']])){utils[_0xcff4('0x19')](util[_0xcff4('0xb')](_0xcff4('0x49'),_0x1e82fa['uniqueid']),_0x1e82fa);if(!_[_0xcff4('0x21')](_0x1e82fa['variable'][_0xcff4('0x4a')])){utils[_0xcff4('0xa')](util['format'](_0xcff4('0x4b'),_0x1e82fa[_0xcff4('0x8')],_0x1e82fa[_0xcff4('0x4c')]));channels[_0x1e82fa[_0xcff4('0x8')]][_0xcff4('0x4d')]=_0x1e82fa[_0xcff4('0x4c')];}if(!_[_0xcff4('0x21')](_0x1e82fa['variable'][_0xcff4('0x4e')])){utils['info'](util[_0xcff4('0xb')](_0xcff4('0x4f'),_0x1e82fa['uniqueid'],_0x1e82fa['value']));channels[_0x1e82fa[_0xcff4('0x8')]][_0xcff4('0x50')]=_0x1e82fa[_0xcff4('0x4c')];channels[_0x1e82fa[_0xcff4('0x8')]][_0xcff4('0x2e')]='\x22'+_0x1e82fa['value']+_0xcff4('0x51')+_0x1e82fa[_0xcff4('0x4c')]+'>';}if(!_['isNil'](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x53')])||!_['isNil'](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x54')])){utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x55'),_0x1e82fa[_0xcff4('0x8')],!_[_0xcff4('0x21')](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x53')])?'xmd-callerid-preview':_0xcff4('0x54'),_0x1e82fa[_0xcff4('0x4c')]));channels[_0x1e82fa[_0xcff4('0x8')]]['callerid']=_0x1e82fa[_0xcff4('0x4c')];}if(!_[_0xcff4('0x21')](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x56')])||!_['isNil'](_0x1e82fa[_0xcff4('0x52')]['xmcs-queue'])){utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x55'),_0x1e82fa['uniqueid'],!_['isNil'](_0x1e82fa['variable'][_0xcff4('0x56')])?_0xcff4('0x56'):_0xcff4('0x57'),_0x1e82fa['value']));channels[_0x1e82fa['uniqueid']][_0xcff4('0x58')]=_0xcff4('0x59');channels[_0x1e82fa[_0xcff4('0x8')]][_0xcff4('0x5a')]=_0x1e82fa[_0xcff4('0x4c')];channels[_0x1e82fa['uniqueid']][_0xcff4('0xe')]=!![];}if(!_[_0xcff4('0x21')](_0x1e82fa[_0xcff4('0x52')]['xmd-contactid'])){utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x5b'),_0x1e82fa[_0xcff4('0x8')],_0x1e82fa[_0xcff4('0x4c')]));channels[_0x1e82fa[_0xcff4('0x8')]]['ContactId']=_0x1e82fa['value'];}if(!_[_0xcff4('0x21')](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x5c')])){utils[_0xcff4('0xa')](util['format'](_0xcff4('0x5d'),_0x1e82fa[_0xcff4('0x8')],_0x1e82fa[_0xcff4('0x4c')]));channels[_0x1e82fa['uniqueid']][_0xcff4('0x5e')]=_0x1e82fa[_0xcff4('0x4c')];}if(!_['isNil'](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x5f')])){utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x60'),_0x1e82fa[_0xcff4('0x8')],_0x1e82fa[_0xcff4('0x4c')]));channels[_0x1e82fa['uniqueid']][_0xcff4('0x61')]=_0x1e82fa[_0xcff4('0x4c')];}if(!_[_0xcff4('0x21')](_0x1e82fa[_0xcff4('0x52')][_0xcff4('0x62')])){utils['info'](util[_0xcff4('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1e82fa['uniqueid'],_0x1e82fa['value']));channels[_0x1e82fa[_0xcff4('0x8')]][_0xcff4('0x62')]=_0x1e82fa['value'];}}}catch(_0xaf64b){utils[_0xcff4('0x1f')](util[_0xcff4('0xb')](_0xcff4('0x49'),_0x1e82fa[_0xcff4('0x8')]),_0xaf64b);}};exports[_0xcff4('0x63')]=function(_0x2e5986){try{if(!_[_0xcff4('0x21')](channels[_0x2e5986['uniqueid']])){utils[_0xcff4('0x19')](util[_0xcff4('0xb')](_0xcff4('0x64'),_0x2e5986[_0xcff4('0x8')]),_0x2e5986);utils[_0xcff4('0xa')](util[_0xcff4('0xb')](_0xcff4('0x65'),_0x2e5986[_0xcff4('0x8')],_0x2e5986[_0xcff4('0x66')],_0x2e5986[_0xcff4('0x67')]));if(_0x2e5986['application'][_0xcff4('0x68')]()==_0xcff4('0x69')&&_[_0xcff4('0x6a')](_0x2e5986[_0xcff4('0x67')][_0xcff4('0x68')](),_0xcff4('0x6b'))){var _0x5da65f=_0x2e5986['appdata'][_0xcff4('0x6c')]('=');var _0x140427=_0x5da65f[0x0][_0xcff4('0x6d')](_0x5da65f[0x0][_0xcff4('0x6e')]('(')+0x1,_0x5da65f[0x0][_0xcff4('0x6e')](')'));var _0x8bd25e=_0x5da65f[0x1];channels[_0x2e5986[_0xcff4('0x8')]][_0x140427]=_0x8bd25e;}if(!_[_0xcff4('0x6f')]([_0xcff4('0x2c'),_0xcff4('0x70'),'execif',_0xcff4('0x69'),_0xcff4('0x71')],_0x2e5986[_0xcff4('0x66')][_0xcff4('0x68')]())){channels[_0x2e5986[_0xcff4('0x8')]][_0xcff4('0x58')]=_0x2e5986[_0xcff4('0x66')];channels[_0x2e5986['uniqueid']][_0xcff4('0x5a')]=_0x2e5986[_0xcff4('0x67')];}}}catch(_0x20ca89){utils[_0xcff4('0x1f')](util[_0xcff4('0xb')]('[%s][calls][newexten]',_0x2e5986[_0xcff4('0x8')]),_0x20ca89);}}; \ No newline at end of file +var _0xbc48=['[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','origtransfereruniqueid','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','hangup','noop','execif','set','gotoif','lastdata','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','channelstate'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbc48,0x111));var _0x8bc4=function(_0x31dbbb,_0x148a95){_0x31dbbb=_0x31dbbb-0x0;var _0xc25e6e=_0xbc48[_0x31dbbb];return _0xc25e6e;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var utils=require(_0x8bc4('0x2'));var transfers=require(_0x8bc4('0x3'));var dispositions=['NO\x20ANSWER',_0x8bc4('0x4'),_0x8bc4('0x4'),_0x8bc4('0x5'),_0x8bc4('0x5'),'NO\x20ANSWER',_0x8bc4('0x6'),'BUSY','FAILED','FAILED',_0x8bc4('0x4')];var channels={};function writeDB(_0x5708fe){var _0x58df27;if(transfers[_0x8bc4('0x7')][_0x5708fe['uniqueid']]){_0x58df27=_0x5708fe[_0x8bc4('0x8')];_0x5708fe[_0x8bc4('0x8')]=transfers[_0x8bc4('0x7')][_0x5708fe[_0x8bc4('0x8')]]['transfereeuniqueid'];}utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0xb'),_0x5708fe[_0x8bc4('0x8')],_0x5708fe[_0x8bc4('0xc')],_0x5708fe[_0x8bc4('0xd')],_0x5708fe[_0x8bc4('0xe')],_0x5708fe[_0x8bc4('0xf')],_0x5708fe[_0x8bc4('0x10')],_0x5708fe[_0x8bc4('0x11')],_0x5708fe[_0x8bc4('0x12')]));if(_0x5708fe[_0x8bc4('0x13')]){utils[_0x8bc4('0x14')](_0x5708fe[_0x8bc4('0x13')])[_0x8bc4('0x15')](function(_0x55e23a){if(_0x55e23a){_0x5708fe[_0x8bc4('0x16')]=_0x55e23a['id'];}utils[_0x8bc4('0x17')](_0x8bc4('0x18'),_0x5708fe);});}else{utils[_0x8bc4('0x17')](_0x8bc4('0x18'),_0x5708fe);}if(channels[_0x5708fe[_0x8bc4('0x8')]]){delete channels[_0x5708fe['uniqueid']];}else if(_0x58df27&&channels[_0x58df27]){if(!transfers['blinds'][_0x58df27]['recording'])delete transfers[_0x8bc4('0x7')][_0x58df27];delete channels[_0x58df27];}}exports['newchannel']=function(_0x2033df){try{utils[_0x8bc4('0x19')](util[_0x8bc4('0xa')]('[%s][calls][newchannel]',_0x2033df[_0x8bc4('0x8')]),_0x2033df);if(_0x2033df[_0x8bc4('0x8')]==_0x2033df['linkedid']&&_0x2033df[_0x8bc4('0xc')]!='OutgoingSpoolFailed'){utils[_0x8bc4('0x9')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2033df[_0x8bc4('0x8')],_0x2033df[_0x8bc4('0x1a')],_0x2033df[_0x8bc4('0x1b')]));channels[_0x2033df[_0x8bc4('0x8')]]={'uniqueid':_0x2033df[_0x8bc4('0x8')],'accountcode':_0x2033df[_0x8bc4('0x13')],'source':_0x2033df[_0x8bc4('0x10')],'destination':_0x2033df[_0x8bc4('0x1b')],'destinationcontext':_0x2033df[_0x8bc4('0x1a')],'channel':_0x2033df[_0x8bc4('0xc')],'starttime':utils[_0x8bc4('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x8bc4('0x1d')};}}catch(_0x33f5b1){utils[_0x8bc4('0x1e')](util['format'](_0x8bc4('0x1f'),_0x2033df[_0x8bc4('0x8')]),_0x33f5b1);}};exports['newstate']=function(_0x3eac08){try{utils[_0x8bc4('0x19')](util[_0x8bc4('0xa')]('[%s][calls][newstate]',_0x3eac08[_0x8bc4('0x8')]),_0x3eac08);if(!_['isNil'](channels[_0x3eac08['uniqueid']])&&_0x3eac08[_0x8bc4('0x20')]==0x6){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x21'),_0x3eac08[_0x8bc4('0x8')],_0x3eac08[_0x8bc4('0x1a')],_0x3eac08[_0x8bc4('0xc')]));if(_[_0x8bc4('0x22')](channels[_0x3eac08['uniqueid']]['systemanswertime'])){channels[_0x3eac08[_0x8bc4('0x8')]][_0x8bc4('0x23')]=utils[_0x8bc4('0x1c')]();}}else if(!_[_0x8bc4('0x22')](channels[_0x3eac08[_0x8bc4('0x24')]])&&_0x3eac08[_0x8bc4('0x20')]==0x6&&_0x3eac08['context']!=_0x8bc4('0x25')){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x26'),_0x3eac08['uniqueid'],_0x3eac08[_0x8bc4('0x24')],_0x3eac08[_0x8bc4('0x1a')],_0x3eac08[_0x8bc4('0xc')]));channels[_0x3eac08[_0x8bc4('0x24')]][_0x8bc4('0x13')]=_0x3eac08['accountcode'];channels[_0x3eac08[_0x8bc4('0x24')]]['destinationchannel']=_0x3eac08[_0x8bc4('0xc')];if(_[_0x8bc4('0x22')](channels[_0x3eac08[_0x8bc4('0x24')]][_0x8bc4('0x27')])){channels[_0x3eac08['linkedid']]['answertime']=utils[_0x8bc4('0x1c')]();}channels[_0x3eac08[_0x8bc4('0x24')]][_0x8bc4('0x28')]=dispositions[_[_0x8bc4('0x29')](_0x3eac08['channelstate'])]||'ANSWERED';}}catch(_0x592820){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')](_0x8bc4('0x2a'),_0x3eac08['uniqueid']),_0x592820);}};exports['hangup']=function(_0x52f358){try{if(!_['isNil'](channels[_0x52f358['uniqueid']])){utils[_0x8bc4('0x19')](util[_0x8bc4('0xa')](_0x8bc4('0x2b'),_0x52f358['uniqueid']),_0x52f358);if(_[_0x8bc4('0x22')](channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x2c')])){channels[_0x52f358['uniqueid']][_0x8bc4('0x2c')]=_0x52f358[_0x8bc4('0x2d')]+'\x20<'+_0x52f358[_0x8bc4('0x10')]+'>';}utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x52f358[_0x8bc4('0x8')],channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x2c')],_0x52f358['cause-txt']));channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x2e')]=utils[_0x8bc4('0x1c')]();channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x2f')]=utils[_0x8bc4('0x30')](channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x2e')],channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x31')]);channels[_0x52f358[_0x8bc4('0x8')]]['billableseconds']=channels[_0x52f358['uniqueid']][_0x8bc4('0x27')]?utils[_0x8bc4('0x30')](channels[_0x52f358['uniqueid']][_0x8bc4('0x2e')],channels[_0x52f358[_0x8bc4('0x8')]][_0x8bc4('0x27')]):0x0;writeDB(channels[_0x52f358['uniqueid']]);}}catch(_0x513aa5){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')](_0x8bc4('0x2b'),_0x52f358[_0x8bc4('0x8')]),_0x513aa5);}};exports[_0x8bc4('0x32')]=function(_0x38789a){try{if(!_[_0x8bc4('0x22')](channels[_0x38789a['localtwolinkedid']])){utils['debug'](util[_0x8bc4('0xa')]('[%s][calls][attendedtransfer]',_0x38789a['origtransfereruniqueid']),_0x38789a);if(channels[_0x38789a[_0x8bc4('0x33')]][_0x8bc4('0xc')]==_0x38789a[_0x8bc4('0x34')]){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x35'),_0x38789a['origtransfereruniqueid'],_0x38789a[_0x8bc4('0x33')],_0x38789a[_0x8bc4('0x36')]));channels[_0x38789a['localtwolinkedid']][_0x8bc4('0x37')]=_0x38789a['secondtransfererchannel'];channels[_0x38789a[_0x8bc4('0x33')]]['userfield']=_0x8bc4('0x38');}else if(channels[_0x38789a[_0x8bc4('0x33')]][_0x8bc4('0xc')]=_0x38789a['transfertargetchannel']){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x35'),_0x38789a[_0x8bc4('0x39')],_0x38789a['localtwolinkedid'],_0x38789a['origtransfererchannel']));channels[_0x38789a[_0x8bc4('0x33')]][_0x8bc4('0x37')]=_0x38789a[_0x8bc4('0x3a')];channels[_0x38789a['localtwolinkedid']]['userfield']=_0x8bc4('0x38');}}}catch(_0x546553){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')](_0x8bc4('0x3b'),_0x38789a[_0x8bc4('0x39')]),_0x546553);}};exports[_0x8bc4('0x3c')]=function(_0x122540){try{if(!_[_0x8bc4('0x22')](channels[_0x122540[_0x8bc4('0x8')]])){utils[_0x8bc4('0x19')](util[_0x8bc4('0xa')](_0x8bc4('0x3d'),_0x122540[_0x8bc4('0x8')]),_0x122540);channels[_0x122540[_0x8bc4('0x8')]][_0x8bc4('0x3e')]=utils[_0x8bc4('0x1c')]();utils[_0x8bc4('0x9')](util['format'](_0x8bc4('0x3f'),_0x122540[_0x8bc4('0x8')],channels[_0x122540[_0x8bc4('0x8')]][_0x8bc4('0x3e')]));}}catch(_0x6e4f07){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')](_0x8bc4('0x3d'),_0x122540['uniqueid']),_0x6e4f07);}};exports[_0x8bc4('0x40')]=function(_0x42bc1f){try{if(!_[_0x8bc4('0x22')](channels[_0x42bc1f[_0x8bc4('0x8')]])){utils['debug'](util[_0x8bc4('0xa')]('[%s][calls][musiconholdstop]',_0x42bc1f[_0x8bc4('0x8')]),_0x42bc1f);if(!_['isNil'](channels[_0x42bc1f[_0x8bc4('0x8')]][_0x8bc4('0x3e')])){channels[_0x42bc1f[_0x8bc4('0x8')]]['mohtime']+=utils[_0x8bc4('0x30')](utils[_0x8bc4('0x1c')](),channels[_0x42bc1f['uniqueid']]['musiconholdstartAt']);utils[_0x8bc4('0x9')](util['format'](_0x8bc4('0x41'),_0x42bc1f[_0x8bc4('0x8')],channels[_0x42bc1f[_0x8bc4('0x8')]]['mohtime']));delete channels[_0x42bc1f[_0x8bc4('0x8')]]['musiconholdstartAt'];}}}catch(_0x2a2ab1){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')]('[%s][calls][musiconholdstop]',_0x42bc1f[_0x8bc4('0x8')]),_0x2a2ab1);}};exports[_0x8bc4('0x42')]=function(_0x5b3799){try{if(!_[_0x8bc4('0x22')](channels[_0x5b3799['uniqueid']])){utils[_0x8bc4('0x19')](util[_0x8bc4('0xa')](_0x8bc4('0x43'),_0x5b3799[_0x8bc4('0x8')]),_0x5b3799);if(!_[_0x8bc4('0x22')](_0x5b3799['variable'][_0x8bc4('0x44')])){utils['info'](util[_0x8bc4('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5b3799[_0x8bc4('0x8')],_0x5b3799['value']));channels[_0x5b3799[_0x8bc4('0x8')]]['source']=_0x5b3799[_0x8bc4('0x45')];}if(!_['isNil'](_0x5b3799['variable'][_0x8bc4('0x46')])){utils[_0x8bc4('0x9')](util['format'](_0x8bc4('0x47'),_0x5b3799[_0x8bc4('0x8')],_0x5b3799[_0x8bc4('0x45')]));channels[_0x5b3799['uniqueid']][_0x8bc4('0x48')]=_0x5b3799[_0x8bc4('0x45')];channels[_0x5b3799[_0x8bc4('0x8')]][_0x8bc4('0x2c')]='\x22'+_0x5b3799[_0x8bc4('0x45')]+_0x8bc4('0x49')+_0x5b3799[_0x8bc4('0x45')]+'>';}if(!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x4b')])||!_['isNil'](_0x5b3799[_0x8bc4('0x4a')]['xmd-callerid'])){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x4c'),_0x5b3799[_0x8bc4('0x8')],!_[_0x8bc4('0x22')](_0x5b3799['variable']['xmd-callerid-preview'])?_0x8bc4('0x4b'):'xmd-callerid',_0x5b3799[_0x8bc4('0x45')]));channels[_0x5b3799[_0x8bc4('0x8')]][_0x8bc4('0x2c')]=_0x5b3799['value'];}if(!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x4d')])||!_[_0x8bc4('0x22')](_0x5b3799['variable'][_0x8bc4('0x4e')])){utils[_0x8bc4('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5b3799[_0x8bc4('0x8')],!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')]['xmd-queue'])?_0x8bc4('0x4d'):'xmcs-queue',_0x5b3799['value']));channels[_0x5b3799[_0x8bc4('0x8')]][_0x8bc4('0x4f')]=_0x8bc4('0x50');channels[_0x5b3799[_0x8bc4('0x8')]]['lastdata']=_0x5b3799[_0x8bc4('0x45')];channels[_0x5b3799['uniqueid']][_0x8bc4('0xd')]=!![];}if(!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x51')])){utils[_0x8bc4('0x9')](util['format'](_0x8bc4('0x52'),_0x5b3799['uniqueid'],_0x5b3799['value']));channels[_0x5b3799[_0x8bc4('0x8')]]['ContactId']=_0x5b3799['value'];}if(!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x53')])){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x54'),_0x5b3799[_0x8bc4('0x8')],_0x5b3799[_0x8bc4('0x45')]));channels[_0x5b3799[_0x8bc4('0x8')]]['type']=_0x5b3799[_0x8bc4('0x45')];}if(!_[_0x8bc4('0x22')](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x55')])){utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5b3799[_0x8bc4('0x8')],_0x5b3799[_0x8bc4('0x45')]));channels[_0x5b3799['uniqueid']]['routeid']=_0x5b3799['value'];}if(!_['isNil'](_0x5b3799[_0x8bc4('0x4a')][_0x8bc4('0x56')])){utils[_0x8bc4('0x9')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5b3799[_0x8bc4('0x8')],_0x5b3799[_0x8bc4('0x45')]));channels[_0x5b3799[_0x8bc4('0x8')]][_0x8bc4('0x56')]=_0x5b3799[_0x8bc4('0x45')];}}}catch(_0x3b2788){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')](_0x8bc4('0x43'),_0x5b3799[_0x8bc4('0x8')]),_0x3b2788);}};exports['newexten']=function(_0x22f949){try{if(!_[_0x8bc4('0x22')](channels[_0x22f949[_0x8bc4('0x8')]])){utils[_0x8bc4('0x19')](util['format']('[%s][calls][newexten]',_0x22f949[_0x8bc4('0x8')]),_0x22f949);utils[_0x8bc4('0x9')](util[_0x8bc4('0xa')](_0x8bc4('0x57'),_0x22f949[_0x8bc4('0x8')],_0x22f949[_0x8bc4('0x58')],_0x22f949[_0x8bc4('0x59')]));if(_0x22f949[_0x8bc4('0x58')][_0x8bc4('0x5a')]()=='set'&&_[_0x8bc4('0x5b')](_0x22f949[_0x8bc4('0x59')][_0x8bc4('0x5a')](),_0x8bc4('0x5c'))){var _0x4a47fe=_0x22f949[_0x8bc4('0x59')][_0x8bc4('0x5d')]('=');var _0x35bda3=_0x4a47fe[0x0]['substring'](_0x4a47fe[0x0][_0x8bc4('0x5e')]('(')+0x1,_0x4a47fe[0x0][_0x8bc4('0x5e')](')'));var _0x4e4f44=_0x4a47fe[0x1];channels[_0x22f949[_0x8bc4('0x8')]][_0x35bda3]=_0x4e4f44;}if(!_[_0x8bc4('0x5f')]([_0x8bc4('0x60'),_0x8bc4('0x61'),_0x8bc4('0x62'),_0x8bc4('0x63'),_0x8bc4('0x64')],_0x22f949['application'][_0x8bc4('0x5a')]())){channels[_0x22f949['uniqueid']][_0x8bc4('0x4f')]=_0x22f949[_0x8bc4('0x58')];channels[_0x22f949[_0x8bc4('0x8')]][_0x8bc4('0x65')]=_0x22f949[_0x8bc4('0x59')];}}}catch(_0x53a01c){utils[_0x8bc4('0x1e')](util[_0x8bc4('0xa')]('[%s][calls][newexten]',_0x22f949['uniqueid']),_0x53a01c);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b6d9a43..430e6c0 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 _0x60ba=['[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x447ef1,_0x374cd2){var _0x3d72ec=function(_0x3e10b){while(--_0x3e10b){_0x447ef1['push'](_0x447ef1['shift']());}};_0x3d72ec(++_0x374cd2);}(_0x60ba,0x12d));var _0xa60b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x60ba[_0x3947c9];return _0x2e7871;};'use strict';var utils=require('./utils');exports[_0xa60b('0x0')]=function(){utils[_0xa60b('0x1')](_0xa60b('0x2'));};exports['shutdown']=function(){utils[_0xa60b('0x1')](_0xa60b('0x3'));};exports[_0xa60b('0x4')]=function(){utils[_0xa60b('0x1')](_0xa60b('0x5'));};exports[_0xa60b('0x6')]=function(_0x41acca){utils[_0xa60b('0x6')](_0xa60b('0x7'),_0x41acca);};exports[_0xa60b('0x8')]=function(){utils[_0xa60b('0x1')](_0xa60b('0x9'));};exports[_0xa60b('0xa')]=function(_0x21cbcd){}; \ No newline at end of file +var _0x7799=['info','[core]\x20connected','[core]\x20shutdown','fullybooted','error','[core]\x20error','[core]\x20close','./utils'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7799,0x12f));var _0x9779=function(_0x19ae7a,_0x5d3b51){_0x19ae7a=_0x19ae7a-0x0;var _0x30d82e=_0x7799[_0x19ae7a];return _0x30d82e;};'use strict';var utils=require(_0x9779('0x0'));exports['connect']=function(){utils[_0x9779('0x1')](_0x9779('0x2'));};exports['shutdown']=function(){utils[_0x9779('0x1')](_0x9779('0x3'));};exports[_0x9779('0x4')]=function(){utils[_0x9779('0x1')]('[core]\x20fullybooted');};exports['error']=function(_0x19814e){utils[_0x9779('0x5')](_0x9779('0x6'),_0x19814e);};exports['close']=function(){utils[_0x9779('0x1')](_0x9779('0x7'));};exports['managerevent']=function(_0x1b8bdf){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4826388..73f94e2 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 _0xf601=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0xf601,0xf0));var _0x1f60=function(_0x1bf90c,_0x4b9dff){_0x1bf90c=_0x1bf90c-0x0;var _0x1c0e24=_0xf601[_0x1bf90c];return _0x1c0e24;};'use strict';var _=require(_0x1f60('0x0'));var util=require(_0x1f60('0x1'));var utils=require(_0x1f60('0x2'));var dials={};function writeDB(_0x563503){utils[_0x1f60('0x3')](util[_0x1f60('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x563503[_0x1f60('0x5')],_0x563503[_0x1f60('0x6')],_0x563503[_0x1f60('0x7')],_0x563503[_0x1f60('0x8')],_0x563503[_0x1f60('0x9')],_0x563503[_0x1f60('0xa')]));utils[_0x1f60('0xb')](_0x1f60('0xc'),_0x563503);delete dials[_0x563503['uniqueid']];}exports[_0x1f60('0xd')]=function(_0x144fe4){try{utils[_0x1f60('0xe')](util[_0x1f60('0x4')]('[%s][dials][newexten]',_0x144fe4[_0x1f60('0x5')]),_0x144fe4);utils[_0x1f60('0x3')](util[_0x1f60('0x4')](_0x1f60('0xf'),_0x144fe4[_0x1f60('0x5')],_0x144fe4[_0x1f60('0x10')],_0x144fe4[_0x1f60('0x11')]));if(_0x144fe4[_0x1f60('0x10')]['toLowerCase']()==_0x1f60('0x12')&&_['startsWith'](_0x144fe4[_0x1f60('0x11')][_0x1f60('0x13')](),'cdr(routeid)')){var _0x19547c=_0x144fe4[_0x1f60('0x11')][_0x1f60('0x14')]('=');dials[_0x144fe4['uniqueid']]={'routeId':_0x19547c[0x1]};}}catch(_0x4382b2){utils['error'](util[_0x1f60('0x4')](_0x1f60('0x15'),_0x144fe4['uniqueid']),_0x4382b2);}};exports['varset']=function(_0x2232be){try{utils[_0x1f60('0xe')](util[_0x1f60('0x4')](_0x1f60('0x16'),_0x2232be[_0x1f60('0x5')]),_0x2232be);if(!_[_0x1f60('0x17')](_0x2232be[_0x1f60('0x18')][_0x1f60('0x19')])){utils['info'](util[_0x1f60('0x4')](_0x1f60('0x1a'),_0x2232be[_0x1f60('0x5')],_0x2232be[_0x1f60('0x1b')]));dials[_0x2232be[_0x1f60('0x5')]]={'routeId':_0x2232be[_0x1f60('0x1b')]};}}catch(_0x200d98){utils[_0x1f60('0x1c')](util['format'](_0x1f60('0x16'),_0x2232be['uniqueid']),_0x200d98);}};exports[_0x1f60('0x1d')]=function(_0x4f0a16){try{if(!_[_0x1f60('0x17')](dials[_0x4f0a16[_0x1f60('0x5')]])){utils[_0x1f60('0xe')](util[_0x1f60('0x4')](_0x1f60('0x1e'),_0x4f0a16[_0x1f60('0x5')]),_0x4f0a16);dials[_0x4f0a16[_0x1f60('0x5')]]=_['assign'](dials[_0x4f0a16['uniqueid']],_0x4f0a16);dials[_0x4f0a16['uniqueid']][_0x1f60('0x1f')]=utils[_0x1f60('0x20')]();dials[_0x4f0a16['uniqueid']][_0x1f60('0x21')]='called';utils[_0x1f60('0x3')](util[_0x1f60('0x4')](_0x1f60('0x22'),_0x4f0a16[_0x1f60('0x5')],dials[_0x4f0a16[_0x1f60('0x5')]]['starttime']));}}catch(_0x1b5e53){utils[_0x1f60('0x1c')](util[_0x1f60('0x4')](_0x1f60('0x1e'),_0x4f0a16['uniqueid']),_0x1b5e53);}};exports[_0x1f60('0x23')]=function(_0x4c7238){try{if(!_[_0x1f60('0x17')](dials[_0x4c7238[_0x1f60('0x5')]])){utils[_0x1f60('0xe')](util[_0x1f60('0x4')](_0x1f60('0x24'),_0x4c7238[_0x1f60('0x5')]),_0x4c7238);dials[_0x4c7238[_0x1f60('0x5')]][_0x1f60('0xa')]=_0x4c7238['dialstatus'];if(_0x4c7238[_0x1f60('0xa')]==_0x1f60('0x25')){dials[_0x4c7238['uniqueid']]=_['assign'](dials[_0x4c7238[_0x1f60('0x5')]],_0x4c7238);dials[_0x4c7238[_0x1f60('0x5')]][_0x1f60('0x26')]=utils[_0x1f60('0x20')]();dials[_0x4c7238[_0x1f60('0x5')]][_0x1f60('0x21')]='connect';utils[_0x1f60('0x3')](util[_0x1f60('0x4')](_0x1f60('0x27'),_0x4c7238['uniqueid'],_0x4c7238[_0x1f60('0xa')],dials[_0x4c7238['uniqueid']][_0x1f60('0x26')]));}else{utils[_0x1f60('0x3')](util[_0x1f60('0x4')](_0x1f60('0x28'),_0x4c7238[_0x1f60('0x5')],_0x4c7238[_0x1f60('0xa')]));}}}catch(_0x3c960d){utils[_0x1f60('0x1c')](util[_0x1f60('0x4')]('[%s][dials][dialend]',_0x4c7238[_0x1f60('0x5')]),_0x3c960d);}};exports[_0x1f60('0x29')]=function(_0x38edf9){try{if(!_[_0x1f60('0x17')](dials[_0x38edf9['uniqueid']])){utils['debug'](util[_0x1f60('0x4')](_0x1f60('0x2a'),_0x38edf9[_0x1f60('0x5')]),_0x38edf9);utils[_0x1f60('0x3')](util[_0x1f60('0x4')](_0x1f60('0x2b'),_0x38edf9['uniqueid'],_0x38edf9[_0x1f60('0x8')],_0x38edf9['calleridname'],_0x38edf9[_0x1f60('0x2c')]));dials[_0x38edf9[_0x1f60('0x5')]]=_['assign'](dials[_0x38edf9[_0x1f60('0x5')]],{'endtime':utils[_0x1f60('0x20')](),'lastevent':_0x1f60('0x2d')});dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x2e')]=utils[_0x1f60('0x2f')](dials[_0x38edf9[_0x1f60('0x5')]]['endtime'],dials[_0x38edf9['uniqueid']][_0x1f60('0x1f')]);dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x30')]=utils[_0x1f60('0x2f')](dials[_0x38edf9['uniqueid']][_0x1f60('0x26')]||dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x31')],dials[_0x38edf9['uniqueid']][_0x1f60('0x1f')]);dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x32')]=dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x26')]?utils[_0x1f60('0x2f')](dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x31')],dials[_0x38edf9[_0x1f60('0x5')]][_0x1f60('0x26')]):0x0;writeDB(dials[_0x38edf9[_0x1f60('0x5')]]);}}catch(_0x1fdb4b){utils['error'](util[_0x1f60('0x4')]('[%s][dials][hangup]',_0x38edf9[_0x1f60('0x5')]),_0x1fdb4b);}}; \ No newline at end of file +var _0xfbd9=['[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','endtime','diffTime','billableseconds','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0xfbd9,0x1de));var _0x9fbd=function(_0x542dcd,_0x1d12ed){_0x542dcd=_0x542dcd-0x0;var _0x2b49e7=_0xfbd9[_0x542dcd];return _0x2b49e7;};'use strict';var _=require('lodash');var util=require(_0x9fbd('0x0'));var utils=require(_0x9fbd('0x1'));var dials={};function writeDB(_0x59cac2){utils['info'](util['format'](_0x9fbd('0x2'),_0x59cac2['uniqueid'],_0x59cac2[_0x9fbd('0x3')],_0x59cac2[_0x9fbd('0x4')],_0x59cac2[_0x9fbd('0x5')],_0x59cac2[_0x9fbd('0x6')],_0x59cac2[_0x9fbd('0x7')]));utils['request'](_0x9fbd('0x8'),_0x59cac2);delete dials[_0x59cac2[_0x9fbd('0x9')]];}exports['newexten']=function(_0x5bfd17){try{utils[_0x9fbd('0xa')](util[_0x9fbd('0xb')](_0x9fbd('0xc'),_0x5bfd17[_0x9fbd('0x9')]),_0x5bfd17);utils[_0x9fbd('0xd')](util['format'](_0x9fbd('0xe'),_0x5bfd17[_0x9fbd('0x9')],_0x5bfd17[_0x9fbd('0xf')],_0x5bfd17[_0x9fbd('0x10')]));if(_0x5bfd17[_0x9fbd('0xf')][_0x9fbd('0x11')]()==_0x9fbd('0x12')&&_[_0x9fbd('0x13')](_0x5bfd17[_0x9fbd('0x10')][_0x9fbd('0x11')](),_0x9fbd('0x14'))){var _0x587a35=_0x5bfd17[_0x9fbd('0x10')][_0x9fbd('0x15')]('=');dials[_0x5bfd17['uniqueid']]={'routeId':_0x587a35[0x1]};}}catch(_0x3d3df0){utils['error'](util[_0x9fbd('0xb')](_0x9fbd('0xc'),_0x5bfd17[_0x9fbd('0x9')]),_0x3d3df0);}};exports['varset']=function(_0x2d7e6d){try{utils[_0x9fbd('0xa')](util[_0x9fbd('0xb')](_0x9fbd('0x16'),_0x2d7e6d['uniqueid']),_0x2d7e6d);if(!_[_0x9fbd('0x17')](_0x2d7e6d[_0x9fbd('0x18')][_0x9fbd('0x19')])){utils[_0x9fbd('0xd')](util['format'](_0x9fbd('0x1a'),_0x2d7e6d[_0x9fbd('0x9')],_0x2d7e6d[_0x9fbd('0x1b')]));dials[_0x2d7e6d[_0x9fbd('0x9')]]={'routeId':_0x2d7e6d[_0x9fbd('0x1b')]};}}catch(_0x2ecef4){utils['error'](util['format']('[%s][dials][varset]',_0x2d7e6d['uniqueid']),_0x2ecef4);}};exports[_0x9fbd('0x1c')]=function(_0x4962d7){try{if(!_[_0x9fbd('0x17')](dials[_0x4962d7[_0x9fbd('0x9')]])){utils[_0x9fbd('0xa')](util[_0x9fbd('0xb')](_0x9fbd('0x1d'),_0x4962d7['uniqueid']),_0x4962d7);dials[_0x4962d7[_0x9fbd('0x9')]]=_[_0x9fbd('0x1e')](dials[_0x4962d7['uniqueid']],_0x4962d7);dials[_0x4962d7['uniqueid']][_0x9fbd('0x1f')]=utils[_0x9fbd('0x20')]();dials[_0x4962d7[_0x9fbd('0x9')]]['lastevent']=_0x9fbd('0x21');utils[_0x9fbd('0xd')](util[_0x9fbd('0xb')](_0x9fbd('0x22'),_0x4962d7[_0x9fbd('0x9')],dials[_0x4962d7[_0x9fbd('0x9')]][_0x9fbd('0x1f')]));}}catch(_0x3f9dd1){utils[_0x9fbd('0x23')](util['format'](_0x9fbd('0x1d'),_0x4962d7[_0x9fbd('0x9')]),_0x3f9dd1);}};exports[_0x9fbd('0x24')]=function(_0x5bf96a){try{if(!_[_0x9fbd('0x17')](dials[_0x5bf96a[_0x9fbd('0x9')]])){utils[_0x9fbd('0xa')](util['format'](_0x9fbd('0x25'),_0x5bf96a['uniqueid']),_0x5bf96a);dials[_0x5bf96a[_0x9fbd('0x9')]]['dialstatus']=_0x5bf96a['dialstatus'];if(_0x5bf96a['dialstatus']==_0x9fbd('0x26')){dials[_0x5bf96a[_0x9fbd('0x9')]]=_[_0x9fbd('0x1e')](dials[_0x5bf96a[_0x9fbd('0x9')]],_0x5bf96a);dials[_0x5bf96a[_0x9fbd('0x9')]][_0x9fbd('0x27')]=utils[_0x9fbd('0x20')]();dials[_0x5bf96a[_0x9fbd('0x9')]][_0x9fbd('0x28')]=_0x9fbd('0x29');utils['info'](util[_0x9fbd('0xb')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x5bf96a[_0x9fbd('0x9')],_0x5bf96a[_0x9fbd('0x7')],dials[_0x5bf96a[_0x9fbd('0x9')]][_0x9fbd('0x27')]));}else{utils[_0x9fbd('0xd')](util[_0x9fbd('0xb')](_0x9fbd('0x2a'),_0x5bf96a['uniqueid'],_0x5bf96a[_0x9fbd('0x7')]));}}}catch(_0xdc5d32){utils[_0x9fbd('0x23')](util[_0x9fbd('0xb')]('[%s][dials][dialend]',_0x5bf96a['uniqueid']),_0xdc5d32);}};exports[_0x9fbd('0x2b')]=function(_0x5150fd){try{if(!_[_0x9fbd('0x17')](dials[_0x5150fd['uniqueid']])){utils[_0x9fbd('0xa')](util[_0x9fbd('0xb')](_0x9fbd('0x2c'),_0x5150fd[_0x9fbd('0x9')]),_0x5150fd);utils[_0x9fbd('0xd')](util[_0x9fbd('0xb')](_0x9fbd('0x2d'),_0x5150fd['uniqueid'],_0x5150fd['calleridnum'],_0x5150fd['calleridname'],_0x5150fd[_0x9fbd('0x2e')]));dials[_0x5150fd[_0x9fbd('0x9')]]=_['assign'](dials[_0x5150fd['uniqueid']],{'endtime':utils[_0x9fbd('0x20')](),'lastevent':_0x9fbd('0x2f')});dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x30')]=utils['diffTime'](dials[_0x5150fd['uniqueid']][_0x9fbd('0x31')],dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x1f')]);dials[_0x5150fd['uniqueid']]['holdtime']=utils[_0x9fbd('0x32')](dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x27')]||dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x31')],dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x1f')]);dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x33')]=dials[_0x5150fd['uniqueid']][_0x9fbd('0x27')]?utils[_0x9fbd('0x32')](dials[_0x5150fd[_0x9fbd('0x9')]]['endtime'],dials[_0x5150fd[_0x9fbd('0x9')]][_0x9fbd('0x27')]):0x0;writeDB(dials[_0x5150fd[_0x9fbd('0x9')]]);}}catch(_0x245caa){utils[_0x9fbd('0x23')](util['format'](_0x9fbd('0x2c'),_0x5150fd['uniqueid']),_0x245caa);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index fe54497..e7ddd50 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 _0x294d=['./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%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','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','env','asterisk','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x294d,0x14b));var _0xd294=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x294d[_0x1a8f86];return _0x20d876;};var AsteriskManager=require(_0xd294('0x0'));var config=require(_0xd294('0x1'));var utils=require('./utils');var util=require(_0xd294('0x2'));var isXDREnabled=config[_0xd294('0x3')]&&config[_0xd294('0x3')][_0xd294('0x4')]?!config['xdr'][_0xd294('0x4')]:!![];var isProduction=config[_0xd294('0x5')]==='production'||![];var isLocalAsterisk=config[_0xd294('0x3')]&&config[_0xd294('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0xd294('0x6')]['ip'],config[_0xd294('0x6')]['username'],config[_0xd294('0x6')][_0xd294('0x7')],!![]);ami[_0xd294('0x8')]();if(!isXDREnabled){utils[_0xd294('0x9')](_0xd294('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd294('0x9')](_0xd294('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0xd294('0xc'));var queues=require(_0xd294('0xd'));var recordings=require(_0xd294('0xe'));var members=require(_0xd294('0xf'));var dials=require(_0xd294('0x10'));var transfers=require(_0xd294('0x11'));var core=require(_0xd294('0x12'));ami['on'](_0xd294('0x13'),core[_0xd294('0x13')]);ami['on'](_0xd294('0x14'),core[_0xd294('0x14')]);ami['on'](_0xd294('0x15'),core[_0xd294('0x15')]);ami['on'](_0xd294('0x16'),core[_0xd294('0x16')]);ami['on'](_0xd294('0x17'),core[_0xd294('0x17')]);ami['on'](_0xd294('0x18'),core['managerevent']);ami['on'](_0xd294('0x19'),function(_0x233c73){try{utils['debug'](util[_0xd294('0x1a')](_0xd294('0x1b'),_0x233c73[_0xd294('0x1c')]),_0x233c73);members[_0xd294('0x19')](_0x233c73);}catch(_0x3f6e85){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x1b'),_0x233c73[_0xd294('0x1c')]),_0x3f6e85);}});ami['on'](_0xd294('0x1d'),function(_0x32b592){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')]('[%s][index][agentcalled]',_0x32b592[_0xd294('0x1f')]),_0x32b592);agents[_0xd294('0x1d')](_0x32b592);}catch(_0x43259f){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x20'),_0x32b592[_0xd294('0x1f')]),_0x43259f);}});ami['on'](_0xd294('0x21'),function(_0x3c6bd8){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x22'),_0x3c6bd8['uniqueid']),_0x3c6bd8);agents[_0xd294('0x21')](_0x3c6bd8);}catch(_0x498826){utils[_0xd294('0x16')](util['format']('[%s][index][agentringnoanswer]',_0x3c6bd8[_0xd294('0x1f')]),_0x498826);}});ami['on'](_0xd294('0x23'),function(_0x24f42b){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')]('[%s][index][agentconnect]',_0x24f42b[_0xd294('0x1f')]),_0x24f42b);agents[_0xd294('0x23')](_0x24f42b);queues['agentconnect'](_0x24f42b);}catch(_0x244cc2){utils['error'](util[_0xd294('0x1a')](_0xd294('0x24'),_0x24f42b[_0xd294('0x1f')]),_0x244cc2);}});ami['on'](_0xd294('0x25'),function(_0x4761c4){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x26'),_0x4761c4[_0xd294('0x1f')]),_0x4761c4);agents[_0xd294('0x25')](_0x4761c4);queues[_0xd294('0x25')](_0x4761c4);members[_0xd294('0x25')](_0x4761c4);}catch(_0x31b47e){utils[_0xd294('0x16')](util[_0xd294('0x1a')]('[%s][index][agentcomplete]',_0x4761c4[_0xd294('0x1f')]),_0x31b47e);}});ami['on'](_0xd294('0x27'),function(_0x12a576){try{utils[_0xd294('0x1e')](util['format'](_0xd294('0x28'),_0x12a576['uniqueid']),_0x12a576);agents[_0xd294('0x27')](_0x12a576);queues[_0xd294('0x27')](_0x12a576);}catch(_0x169745){utils[_0xd294('0x16')](util['format'](_0xd294('0x28'),_0x12a576['uniqueid']),_0x169745);}});ami['on'](_0xd294('0x29'),function(_0x2e988a){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x2a'),_0x2e988a['uniqueid']),_0x2e988a);queues['queuecallerjoin'](_0x2e988a);recordings[_0xd294('0x29')](_0x2e988a);}catch(_0x3111a0){utils['error'](util[_0xd294('0x1a')](_0xd294('0x2a'),_0x2e988a[_0xd294('0x1f')]),_0x3111a0);}});ami['on'](_0xd294('0x2b'),function(_0x1ed6b3){try{utils[_0xd294('0x1e')](util['format']('[%s][index][queuecallerleave]',_0x1ed6b3[_0xd294('0x1f')]),_0x1ed6b3);queues[_0xd294('0x2b')](_0x1ed6b3);}catch(_0x414f89){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x2c'),_0x1ed6b3[_0xd294('0x1f')]),_0x414f89);}});ami['on'](_0xd294('0x2d'),function(_0x4a6313){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')]('[%s][index][musiconholdstart]',_0x4a6313[_0xd294('0x1f')]),_0x4a6313);queues[_0xd294('0x2d')](_0x4a6313);calls[_0xd294('0x2d')](_0x4a6313);}catch(_0x488cb0){utils['error'](util[_0xd294('0x1a')](_0xd294('0x2e'),_0x4a6313['uniqueid']),_0x488cb0);}});ami['on']('musiconholdstop',function(_0x4d7c68){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x2f'),_0x4d7c68['uniqueid']),_0x4d7c68);queues[_0xd294('0x30')](_0x4d7c68);calls['musiconholdstop'](_0x4d7c68);}catch(_0x330308){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x2f'),_0x4d7c68[_0xd294('0x1f')]),_0x330308);}});ami['on']('newstate',function(_0x31d6f3){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x31'),_0x31d6f3[_0xd294('0x1f')]),_0x31d6f3);calls['newstate'](_0x31d6f3);recordings[_0xd294('0x32')](_0x31d6f3);}catch(_0x5416c0){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x31'),_0x31d6f3[_0xd294('0x1f')]),_0x5416c0);}});ami['on']('hangup',function(_0x1658b8){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x33'),_0x1658b8['uniqueid']),_0x1658b8);calls[_0xd294('0x34')](_0x1658b8);recordings[_0xd294('0x34')](_0x1658b8);dials[_0xd294('0x34')](_0x1658b8);agents[_0xd294('0x34')](_0x1658b8);queues[_0xd294('0x34')](_0x1658b8);}catch(_0x57ece2){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x33'),_0x1658b8[_0xd294('0x1f')]),_0x57ece2);}});ami['on']('cdr',function(_0x5a2547){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x35'),_0x5a2547[_0xd294('0x1f')]),_0x5a2547);members[_0xd294('0x36')](_0x5a2547);}catch(_0x1eaed9){utils['error'](util[_0xd294('0x1a')]('[%s][index][cdr]',_0x5a2547[_0xd294('0x1f')]),_0x1eaed9);}});ami['on']('blindtransfer',function(_0x5d4b04){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0x5d4b04[_0xd294('0x1f')]),_0x5d4b04);queues['blindtransfer'](_0x5d4b04);agents[_0xd294('0x37')](_0x5d4b04);transfers[_0xd294('0x37')](_0x5d4b04);recordings[_0xd294('0x37')](_0x5d4b04);}catch(_0x5519e4){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x38'),_0x5d4b04[_0xd294('0x1f')]),_0x5519e4);}});ami['on'](_0xd294('0x39'),function(_0x326b02){try{utils['debug'](util[_0xd294('0x1a')](_0xd294('0x3a'),_0x326b02['origtransfereruniqueid']),_0x326b02);queues['attendedtransfer'](_0x326b02);transfers[_0xd294('0x39')](_0x326b02);agents['attendedtransfer'](_0x326b02);calls[_0xd294('0x39')](_0x326b02);}catch(_0x399064){utils[_0xd294('0x16')](util[_0xd294('0x1a')]('[%s][index][attendedtransfer]',_0x326b02[_0xd294('0x3b')]),_0x399064);}});ami['on'](_0xd294('0x3c'),function(_0x645250){try{utils['debug'](util[_0xd294('0x1a')](_0xd294('0x3d'),_0x645250['uniqueid']),_0x645250);queues[_0xd294('0x3c')](_0x645250);recordings['varset'](_0x645250);calls[_0xd294('0x3c')](_0x645250);dials['varset'](_0x645250);}catch(_0x4fc027){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x3d'),_0x645250[_0xd294('0x1f')]),_0x4fc027);}});ami['on'](_0xd294('0x3e'),function(_0x1a3278){try{utils[_0xd294('0x1e')](util['format'](_0xd294('0x3f'),_0x1a3278[_0xd294('0x1f')]),_0x1a3278);calls[_0xd294('0x3e')](_0x1a3278);recordings[_0xd294('0x3e')](_0x1a3278);dials['newexten'](_0x1a3278);}catch(_0xd0765e){utils[_0xd294('0x16')](util['format'](_0xd294('0x3f'),_0x1a3278[_0xd294('0x1f')]),_0xd0765e);}});ami['on']('newchannel',function(_0x2165f2){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')]('[%s][index][newchannel]',_0x2165f2[_0xd294('0x1f')]),_0x2165f2);calls[_0xd294('0x40')](_0x2165f2);recordings['newchannel'](_0x2165f2);}catch(_0x3893f5){utils[_0xd294('0x16')](util[_0xd294('0x1a')]('[%s][index][newchannel]',_0x2165f2[_0xd294('0x1f')]),_0x3893f5);}});ami['on']('dialbegin',function(_0x1dc1f2){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')]('[%s][index][dialbegin]',_0x1dc1f2[_0xd294('0x1f')]),_0x1dc1f2);dials[_0xd294('0x41')](_0x1dc1f2);}catch(_0x256250){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x42'),_0x1dc1f2[_0xd294('0x1f')]),_0x256250);}});ami['on'](_0xd294('0x43'),function(_0x3520f1){try{utils[_0xd294('0x1e')](util[_0xd294('0x1a')](_0xd294('0x44'),_0x3520f1[_0xd294('0x1f')]),_0x3520f1);dials[_0xd294('0x43')](_0x3520f1);}catch(_0x24301e){utils[_0xd294('0x16')](util[_0xd294('0x1a')](_0xd294('0x44'),_0x3520f1[_0xd294('0x1f')]),_0x24301e);}});} \ No newline at end of file +var _0x9a68=['./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s][index][dialend]','dialend','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','keepConnected','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9a68,0x1d4));var _0x89a6=function(_0x5f12f8,_0x4e8c06){_0x5f12f8=_0x5f12f8-0x0;var _0xd71edc=_0x9a68[_0x5f12f8];return _0xd71edc;};var AsteriskManager=require('asterisk-manager');var config=require(_0x89a6('0x0'));var utils=require(_0x89a6('0x1'));var util=require(_0x89a6('0x2'));var isXDREnabled=config['xdr']&&config[_0x89a6('0x3')][_0x89a6('0x4')]?!config[_0x89a6('0x3')]['disabled']:!![];var isProduction=config['env']===_0x89a6('0x5')||![];var isLocalAsterisk=config[_0x89a6('0x3')]&&config[_0x89a6('0x3')][_0x89a6('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x89a6('0x7')][_0x89a6('0x8')],config['asterisk']['ip'],config[_0x89a6('0x7')][_0x89a6('0x9')],config['asterisk']['password'],!![]);ami[_0x89a6('0xa')]();if(!isXDREnabled){utils['info'](_0x89a6('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0x89a6('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0x89a6('0xd'));var queues=require(_0x89a6('0xe'));var recordings=require(_0x89a6('0xf'));var members=require(_0x89a6('0x10'));var dials=require(_0x89a6('0x11'));var transfers=require(_0x89a6('0x12'));var core=require(_0x89a6('0x13'));ami['on']('connect',core[_0x89a6('0x14')]);ami['on'](_0x89a6('0x15'),core[_0x89a6('0x15')]);ami['on']('fullybooted',core[_0x89a6('0x16')]);ami['on'](_0x89a6('0x17'),core[_0x89a6('0x17')]);ami['on']('close',core[_0x89a6('0x18')]);ami['on'](_0x89a6('0x19'),core[_0x89a6('0x19')]);ami['on'](_0x89a6('0x1a'),function(_0x4ee611){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x1d'),_0x4ee611[_0x89a6('0x1e')]),_0x4ee611);members[_0x89a6('0x1a')](_0x4ee611);}catch(_0x1eff00){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x1d'),_0x4ee611[_0x89a6('0x1e')]),_0x1eff00);}});ami['on']('agentcalled',function(_0x3374c5){try{utils[_0x89a6('0x1b')](util['format'](_0x89a6('0x1f'),_0x3374c5[_0x89a6('0x20')]),_0x3374c5);agents[_0x89a6('0x21')](_0x3374c5);}catch(_0x1c4b7c){utils['error'](util['format'](_0x89a6('0x1f'),_0x3374c5[_0x89a6('0x20')]),_0x1c4b7c);}});ami['on']('agentringnoanswer',function(_0x5a271a){try{utils['debug'](util[_0x89a6('0x1c')]('[%s][index][agentringnoanswer]',_0x5a271a[_0x89a6('0x20')]),_0x5a271a);agents[_0x89a6('0x22')](_0x5a271a);}catch(_0x20f095){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x23'),_0x5a271a['uniqueid']),_0x20f095);}});ami['on'](_0x89a6('0x24'),function(_0x1170f2){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')]('[%s][index][agentconnect]',_0x1170f2[_0x89a6('0x20')]),_0x1170f2);agents['agentconnect'](_0x1170f2);queues[_0x89a6('0x24')](_0x1170f2);}catch(_0x4ccce6){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x25'),_0x1170f2[_0x89a6('0x20')]),_0x4ccce6);}});ami['on'](_0x89a6('0x26'),function(_0x1c0d0f){try{utils[_0x89a6('0x1b')](util['format']('[%s][index][agentcomplete]',_0x1c0d0f['uniqueid']),_0x1c0d0f);agents[_0x89a6('0x26')](_0x1c0d0f);queues[_0x89a6('0x26')](_0x1c0d0f);members[_0x89a6('0x26')](_0x1c0d0f);}catch(_0x2862f1){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x27'),_0x1c0d0f[_0x89a6('0x20')]),_0x2862f1);}});ami['on'](_0x89a6('0x28'),function(_0x4bef3c){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x29'),_0x4bef3c[_0x89a6('0x20')]),_0x4bef3c);agents[_0x89a6('0x28')](_0x4bef3c);queues['queuecallerabandon'](_0x4bef3c);}catch(_0x54d28c){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x29'),_0x4bef3c[_0x89a6('0x20')]),_0x54d28c);}});ami['on']('queuecallerjoin',function(_0x107eb3){try{utils['debug'](util[_0x89a6('0x1c')](_0x89a6('0x2a'),_0x107eb3[_0x89a6('0x20')]),_0x107eb3);queues[_0x89a6('0x2b')](_0x107eb3);recordings[_0x89a6('0x2b')](_0x107eb3);}catch(_0x4b676b){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x2a'),_0x107eb3[_0x89a6('0x20')]),_0x4b676b);}});ami['on'](_0x89a6('0x2c'),function(_0x539650){try{utils['debug'](util[_0x89a6('0x1c')](_0x89a6('0x2d'),_0x539650[_0x89a6('0x20')]),_0x539650);queues[_0x89a6('0x2c')](_0x539650);}catch(_0x3cc02e){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x2d'),_0x539650[_0x89a6('0x20')]),_0x3cc02e);}});ami['on'](_0x89a6('0x2e'),function(_0x19ecf0){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x2f'),_0x19ecf0[_0x89a6('0x20')]),_0x19ecf0);queues[_0x89a6('0x2e')](_0x19ecf0);calls[_0x89a6('0x2e')](_0x19ecf0);}catch(_0x1c9cad){utils[_0x89a6('0x17')](util['format'](_0x89a6('0x2f'),_0x19ecf0[_0x89a6('0x20')]),_0x1c9cad);}});ami['on']('musiconholdstop',function(_0x8e59ce){try{utils['debug'](util[_0x89a6('0x1c')](_0x89a6('0x30'),_0x8e59ce['uniqueid']),_0x8e59ce);queues['musiconholdstop'](_0x8e59ce);calls['musiconholdstop'](_0x8e59ce);}catch(_0x4aa1fd){utils[_0x89a6('0x17')](util['format'](_0x89a6('0x30'),_0x8e59ce[_0x89a6('0x20')]),_0x4aa1fd);}});ami['on'](_0x89a6('0x31'),function(_0x33d7f7){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x32'),_0x33d7f7[_0x89a6('0x20')]),_0x33d7f7);calls[_0x89a6('0x31')](_0x33d7f7);recordings[_0x89a6('0x31')](_0x33d7f7);}catch(_0x49bd8a){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x32'),_0x33d7f7[_0x89a6('0x20')]),_0x49bd8a);}});ami['on'](_0x89a6('0x33'),function(_0x338033){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x34'),_0x338033[_0x89a6('0x20')]),_0x338033);calls[_0x89a6('0x33')](_0x338033);recordings[_0x89a6('0x33')](_0x338033);dials['hangup'](_0x338033);agents[_0x89a6('0x33')](_0x338033);queues[_0x89a6('0x33')](_0x338033);}catch(_0x253c72){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x34'),_0x338033['uniqueid']),_0x253c72);}});ami['on']('cdr',function(_0x1ff992){try{utils['debug'](util[_0x89a6('0x1c')]('[%s][index][cdr]',_0x1ff992[_0x89a6('0x20')]),_0x1ff992);members[_0x89a6('0x35')](_0x1ff992);}catch(_0x211209){utils[_0x89a6('0x17')](util['format'](_0x89a6('0x36'),_0x1ff992[_0x89a6('0x20')]),_0x211209);}});ami['on'](_0x89a6('0x37'),function(_0x1bc7f3){try{utils['debug'](util[_0x89a6('0x1c')](_0x89a6('0x38'),_0x1bc7f3[_0x89a6('0x20')]),_0x1bc7f3);queues[_0x89a6('0x37')](_0x1bc7f3);agents['blindtransfer'](_0x1bc7f3);transfers['blindtransfer'](_0x1bc7f3);recordings[_0x89a6('0x37')](_0x1bc7f3);}catch(_0x3882f7){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x38'),_0x1bc7f3[_0x89a6('0x20')]),_0x3882f7);}});ami['on'](_0x89a6('0x39'),function(_0x1e032e){try{utils[_0x89a6('0x1b')](util['format'](_0x89a6('0x3a'),_0x1e032e[_0x89a6('0x3b')]),_0x1e032e);queues[_0x89a6('0x39')](_0x1e032e);transfers['attendedtransfer'](_0x1e032e);agents[_0x89a6('0x39')](_0x1e032e);calls[_0x89a6('0x39')](_0x1e032e);}catch(_0x49e53f){utils['error'](util[_0x89a6('0x1c')](_0x89a6('0x3a'),_0x1e032e[_0x89a6('0x3b')]),_0x49e53f);}});ami['on']('varset',function(_0xdfaff4){try{utils['debug'](util[_0x89a6('0x1c')]('[%s][index][varset]',_0xdfaff4[_0x89a6('0x20')]),_0xdfaff4);queues[_0x89a6('0x3c')](_0xdfaff4);recordings['varset'](_0xdfaff4);calls['varset'](_0xdfaff4);dials[_0x89a6('0x3c')](_0xdfaff4);}catch(_0x433b8f){utils[_0x89a6('0x17')](util['format']('[%s][index][varset]',_0xdfaff4['uniqueid']),_0x433b8f);}});ami['on'](_0x89a6('0x3d'),function(_0x49df56){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x3e'),_0x49df56[_0x89a6('0x20')]),_0x49df56);calls['newexten'](_0x49df56);recordings[_0x89a6('0x3d')](_0x49df56);dials[_0x89a6('0x3d')](_0x49df56);}catch(_0x2ac2dc){utils[_0x89a6('0x17')](util['format']('[%s][index][newexten]',_0x49df56[_0x89a6('0x20')]),_0x2ac2dc);}});ami['on'](_0x89a6('0x3f'),function(_0x3ba8ef){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x40'),_0x3ba8ef[_0x89a6('0x20')]),_0x3ba8ef);calls['newchannel'](_0x3ba8ef);recordings[_0x89a6('0x3f')](_0x3ba8ef);}catch(_0x23420e){utils['error'](util[_0x89a6('0x1c')]('[%s][index][newchannel]',_0x3ba8ef[_0x89a6('0x20')]),_0x23420e);}});ami['on'](_0x89a6('0x41'),function(_0x235ee2){try{utils[_0x89a6('0x1b')](util[_0x89a6('0x1c')](_0x89a6('0x42'),_0x235ee2['uniqueid']),_0x235ee2);dials[_0x89a6('0x41')](_0x235ee2);}catch(_0x3a468f){utils[_0x89a6('0x17')](util['format']('[%s]dialbegin',_0x235ee2[_0x89a6('0x20')]),_0x3a468f);}});ami['on']('dialend',function(_0x26c90b){try{utils[_0x89a6('0x1b')](util['format'](_0x89a6('0x43'),_0x26c90b[_0x89a6('0x20')]),_0x26c90b);dials[_0x89a6('0x44')](_0x26c90b);}catch(_0x4a6937){utils[_0x89a6('0x17')](util[_0x89a6('0x1c')](_0x89a6('0x43'),_0x26c90b[_0x89a6('0x20')]),_0x4a6937);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 4819a39..ada022a 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 _0x12fd=['getUserByName','name','request','catch','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','error','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','type','data2','source','data1','split','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','getUserByInterface','then','internal'];(function(_0x3c2373,_0x80dedb){var _0x220f00=function(_0x1412e8){while(--_0x1412e8){_0x3c2373['push'](_0x3c2373['shift']());}};_0x220f00(++_0x80dedb);}(_0x12fd,0x199));var _0xd12f=function(_0x52cc06,_0x8be37b){_0x52cc06=_0x52cc06-0x0;var _0x4a4c93=_0x12fd[_0x52cc06];return _0x4a4c93;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var utils=require(_0xd12f('0x2'));var members={};var exclude=[_0xd12f('0x3'),_0xd12f('0x4')];function writeDB(_0x48fb45){utils[_0xd12f('0x5')](util[_0xd12f('0x6')](_0xd12f('0x7'),_0x48fb45[_0xd12f('0x8')],_0x48fb45[_0xd12f('0x9')],_0x48fb45[_0xd12f('0xa')],_0x48fb45['data2'],_0x48fb45[_0xd12f('0xb')],_0x48fb45['type']));if(_0x48fb45[_0xd12f('0x9')]){utils[_0xd12f('0xc')](_0x48fb45[_0xd12f('0x9')])[_0xd12f('0xd')](function(_0x504504){if(_0x504504){_0x48fb45[_0xd12f('0xb')]=_0x504504['name'];_0x48fb45[_0xd12f('0xe')]=_0x504504['internal'];utils['request']('CreateMemberReport',_0x48fb45);}else{utils[_0xd12f('0xf')](_0x48fb45[_0xd12f('0x9')]['split']('/')[0x1])['then'](function(_0x5d1ed8){if(_0x5d1ed8){_0x48fb45['membername']=_0x5d1ed8[_0xd12f('0x10')];_0x48fb45['internal']=_0x5d1ed8[_0xd12f('0xe')];utils[_0xd12f('0x11')]('CreateMemberReport',_0x48fb45);}});}})[_0xd12f('0x12')](function(_0x2cea73){utils['error'](util['format']('[%s][members][writeDB]',_0x48fb45[_0xd12f('0x8')]),_0x2cea73);});}delete members[_0x48fb45[_0xd12f('0x9')]];}function startsWith(_0x98947b,_0xb6233a){return _[_0xd12f('0x13')](_0x98947b,function(_0x60b06a){return _[_0xd12f('0x14')](_0xb6233a,_0x60b06a);});}exports[_0xd12f('0x15')]=function(_0x4769a2){try{utils['debug'](util['format'](_0xd12f('0x16'),members[_0x4769a2[_0xd12f('0x17')]]?members[_0x4769a2['device']][_0xd12f('0x8')]:_0x4769a2[_0xd12f('0x17')]),_0x4769a2);utils[_0xd12f('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x4769a2[_0xd12f('0x17')]]?members[_0x4769a2[_0xd12f('0x17')]][_0xd12f('0x8')]:_0x4769a2[_0xd12f('0x17')],_0x4769a2[_0xd12f('0x18')],_0x4769a2[_0xd12f('0x17')]));switch(_0x4769a2['state']){case _0xd12f('0x19'):case _0xd12f('0x1a'):if(!startsWith(exclude,_0x4769a2[_0xd12f('0x17')])){members[_0x4769a2[_0xd12f('0x17')]]={'channel':_0xd12f('0x1b'),'interface':_0x4769a2[_0xd12f('0x17')],'type':_0xd12f('0x1c'),'enterAt':utils[_0xd12f('0x1d')](),'role':_0xd12f('0x1e')};}break;case _0xd12f('0x1f'):if(!_[_0xd12f('0x20')](members[_0x4769a2[_0xd12f('0x17')]])){members[_0x4769a2[_0xd12f('0x17')]][_0xd12f('0x21')]=utils[_0xd12f('0x1d')]();members[_0x4769a2[_0xd12f('0x17')]][_0xd12f('0x22')]=utils[_0xd12f('0x23')](members[_0x4769a2[_0xd12f('0x17')]][_0xd12f('0x21')],members[_0x4769a2[_0xd12f('0x17')]][_0xd12f('0x24')]);if(members[_0x4769a2[_0xd12f('0x17')]]['uniqueid']){writeDB(members[_0x4769a2[_0xd12f('0x17')]]);}}break;default:break;}}catch(_0x4cc034){utils[_0xd12f('0x25')](util[_0xd12f('0x6')]('[%s][members][devicestatechange]',members[_0x4769a2[_0xd12f('0x17')]]?members[_0x4769a2['device']][_0xd12f('0x8')]:_0x4769a2[_0xd12f('0x17')]),_0x4cc034);}};exports[_0xd12f('0x26')]=function(_0x141621){try{if(!_['isNil'](members[_0x141621['interface']])){utils[_0xd12f('0x27')](util['format'](_0xd12f('0x28'),_0x141621['uniqueid']),_0x141621);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x141621[_0xd12f('0x8')],_0x141621['interface'],_0x141621[_0xd12f('0x29')]));members[_0x141621[_0xd12f('0x9')]]=_[_0xd12f('0x2a')](members[_0x141621['interface']],{'data4':_0x141621[_0xd12f('0x29')],'uniqueid':_0x141621['uniqueid']});}}catch(_0x3fd8f){utils['error'](util['format'](_0xd12f('0x28'),_0x141621[_0xd12f('0x8')]),_0x3fd8f);}};exports[_0xd12f('0x2b')]=function(_0x1dcc20){try{utils[_0xd12f('0x27')](util[_0xd12f('0x6')](_0xd12f('0x2c'),_0x1dcc20[_0xd12f('0x8')]),_0x1dcc20);if(_0x1dcc20['channel']){var _0x586a50=_0x1dcc20[_0xd12f('0xa')]['split']('-')[0x0];if(!_[_0xd12f('0x20')](members[_0x586a50])){members[_0x586a50]=_[_0xd12f('0x2a')](members[_0x586a50],{'data1':members[_0x586a50]['data1']||_0x1dcc20[_0xd12f('0x2d')],'data2':members[_0x586a50][_0xd12f('0x2e')]||_0x1dcc20[_0xd12f('0x2f')],'data3':members[_0x586a50]['data3']||_0x1dcc20['destination'],'uniqueid':members[_0x586a50]['uniqueid']||_0x1dcc20['uniqueid']});utils[_0xd12f('0x5')](util[_0xd12f('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1dcc20[_0xd12f('0x8')],members[_0x586a50][_0xd12f('0x30')],members[_0x586a50][_0xd12f('0x2e')],members[_0x586a50]['data3']));if(members[_0x586a50][_0xd12f('0x21')]){writeDB(members[_0x586a50]);}}}if(_0x1dcc20['destinationchannel']){var _0x5e9d36=_0x1dcc20['destinationchannel'][_0xd12f('0x31')]('-')[0x0];if(!_[_0xd12f('0x20')](members[_0x5e9d36])){members[_0x5e9d36]=_[_0xd12f('0x2a')](members[_0x5e9d36],{'data1':members[_0x5e9d36][_0xd12f('0x30')]||_0x1dcc20[_0xd12f('0x2d')],'data2':members[_0x5e9d36][_0xd12f('0x2e')]||_0x1dcc20['source'],'data3':members[_0x5e9d36][_0xd12f('0x32')]||_0x1dcc20[_0xd12f('0x33')],'uniqueid':members[_0x5e9d36][_0xd12f('0x8')]||_0x1dcc20[_0xd12f('0x8')]});utils['info'](util[_0xd12f('0x6')](_0xd12f('0x34'),_0x1dcc20[_0xd12f('0x8')],members[_0x5e9d36][_0xd12f('0x30')],members[_0x5e9d36][_0xd12f('0x2e')],members[_0x5e9d36][_0xd12f('0x32')]));if(members[_0x5e9d36][_0xd12f('0x21')]){writeDB(members[_0x5e9d36]);}}}}catch(_0x25820d){utils[_0xd12f('0x25')](util[_0xd12f('0x6')](_0xd12f('0x2c'),_0x1dcc20[_0xd12f('0x8')]),_0x25820d);}}; \ No newline at end of file +var _0xce25=['NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','channel','split','assign','data1','data2','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','destination','./utils','info','format','uniqueid','interface','membername','type','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','name','catch','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xce25,0x196));var _0x5ce2=function(_0x9b163,_0x5d8c8f){_0x9b163=_0x9b163-0x0;var _0x824910=_0xce25[_0x9b163];return _0x824910;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5ce2('0x0'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x4dc355){utils[_0x5ce2('0x1')](util[_0x5ce2('0x2')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x4dc355[_0x5ce2('0x3')],_0x4dc355[_0x5ce2('0x4')],_0x4dc355['channel'],_0x4dc355['data2'],_0x4dc355[_0x5ce2('0x5')],_0x4dc355[_0x5ce2('0x6')]));if(_0x4dc355[_0x5ce2('0x4')]){utils[_0x5ce2('0x7')](_0x4dc355['interface'])[_0x5ce2('0x8')](function(_0x412b62){if(_0x412b62){_0x4dc355[_0x5ce2('0x5')]=_0x412b62['name'];_0x4dc355[_0x5ce2('0x9')]=_0x412b62[_0x5ce2('0x9')];utils[_0x5ce2('0xa')](_0x5ce2('0xb'),_0x4dc355);}else{utils[_0x5ce2('0xc')](_0x4dc355[_0x5ce2('0x4')]['split']('/')[0x1])[_0x5ce2('0x8')](function(_0x4f7a36){if(_0x4f7a36){_0x4dc355[_0x5ce2('0x5')]=_0x4f7a36[_0x5ce2('0xd')];_0x4dc355['internal']=_0x4f7a36['internal'];utils['request']('CreateMemberReport',_0x4dc355);}});}})[_0x5ce2('0xe')](function(_0x4ed2f3){utils['error'](util[_0x5ce2('0x2')]('[%s][members][writeDB]',_0x4dc355[_0x5ce2('0x3')]),_0x4ed2f3);});}delete members[_0x4dc355[_0x5ce2('0x4')]];}function startsWith(_0x24522c,_0x53e047){return _[_0x5ce2('0xf')](_0x24522c,function(_0x2727c7){return _[_0x5ce2('0x10')](_0x53e047,_0x2727c7);});}exports['devicestatechange']=function(_0x4b89d3){try{utils[_0x5ce2('0x11')](util[_0x5ce2('0x2')](_0x5ce2('0x12'),members[_0x4b89d3['device']]?members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x3')]:_0x4b89d3[_0x5ce2('0x13')]),_0x4b89d3);utils[_0x5ce2('0x1')](util[_0x5ce2('0x2')](_0x5ce2('0x14'),members[_0x4b89d3[_0x5ce2('0x13')]]?members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x3')]:_0x4b89d3[_0x5ce2('0x13')],_0x4b89d3[_0x5ce2('0x15')],_0x4b89d3[_0x5ce2('0x13')]));switch(_0x4b89d3[_0x5ce2('0x15')]){case _0x5ce2('0x16'):case _0x5ce2('0x17'):if(!startsWith(exclude,_0x4b89d3[_0x5ce2('0x13')])){members[_0x4b89d3[_0x5ce2('0x13')]]={'channel':_0x5ce2('0x18'),'interface':_0x4b89d3[_0x5ce2('0x13')],'type':'TALKING','enterAt':utils['now'](),'role':_0x5ce2('0x19')};}break;case _0x5ce2('0x1a'):if(!_[_0x5ce2('0x1b')](members[_0x4b89d3['device']])){members[_0x4b89d3['device']][_0x5ce2('0x1c')]=utils[_0x5ce2('0x1d')]();members[_0x4b89d3['device']][_0x5ce2('0x1e')]=utils[_0x5ce2('0x1f')](members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x1c')],members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x20')]);if(members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x3')]){writeDB(members[_0x4b89d3[_0x5ce2('0x13')]]);}}break;default:break;}}catch(_0x642b21){utils[_0x5ce2('0x21')](util[_0x5ce2('0x2')](_0x5ce2('0x12'),members[_0x4b89d3[_0x5ce2('0x13')]]?members[_0x4b89d3[_0x5ce2('0x13')]][_0x5ce2('0x3')]:_0x4b89d3[_0x5ce2('0x13')]),_0x642b21);}};exports[_0x5ce2('0x22')]=function(_0x444d56){try{if(!_[_0x5ce2('0x1b')](members[_0x444d56[_0x5ce2('0x4')]])){utils[_0x5ce2('0x11')](util[_0x5ce2('0x2')](_0x5ce2('0x23'),_0x444d56[_0x5ce2('0x3')]),_0x444d56);utils[_0x5ce2('0x1')](util[_0x5ce2('0x2')](_0x5ce2('0x24'),_0x444d56[_0x5ce2('0x3')],_0x444d56[_0x5ce2('0x4')],_0x444d56[_0x5ce2('0x25')]));members[_0x444d56[_0x5ce2('0x4')]]=_['assign'](members[_0x444d56[_0x5ce2('0x4')]],{'data4':_0x444d56[_0x5ce2('0x25')],'uniqueid':_0x444d56[_0x5ce2('0x3')]});}}catch(_0x55fe14){utils['error'](util[_0x5ce2('0x2')](_0x5ce2('0x23'),_0x444d56[_0x5ce2('0x3')]),_0x55fe14);}};exports['cdr']=function(_0x562604){try{utils[_0x5ce2('0x11')](util[_0x5ce2('0x2')]('[%s][members][cdr]',_0x562604[_0x5ce2('0x3')]),_0x562604);if(_0x562604[_0x5ce2('0x26')]){var _0x106ecc=_0x562604[_0x5ce2('0x26')][_0x5ce2('0x27')]('-')[0x0];if(!_[_0x5ce2('0x1b')](members[_0x106ecc])){members[_0x106ecc]=_[_0x5ce2('0x28')](members[_0x106ecc],{'data1':members[_0x106ecc][_0x5ce2('0x29')]||_0x562604[_0x5ce2('0x6')],'data2':members[_0x106ecc][_0x5ce2('0x2a')]||_0x562604[_0x5ce2('0x2b')],'data3':members[_0x106ecc]['data3']||_0x562604['destination'],'uniqueid':members[_0x106ecc]['uniqueid']||_0x562604['uniqueid']});utils[_0x5ce2('0x1')](util[_0x5ce2('0x2')](_0x5ce2('0x2c'),_0x562604[_0x5ce2('0x3')],members[_0x106ecc][_0x5ce2('0x29')],members[_0x106ecc][_0x5ce2('0x2a')],members[_0x106ecc][_0x5ce2('0x2d')]));if(members[_0x106ecc][_0x5ce2('0x1c')]){writeDB(members[_0x106ecc]);}}}if(_0x562604[_0x5ce2('0x2e')]){var _0x3ea38e=_0x562604[_0x5ce2('0x2e')][_0x5ce2('0x27')]('-')[0x0];if(!_['isNil'](members[_0x3ea38e])){members[_0x3ea38e]=_[_0x5ce2('0x28')](members[_0x3ea38e],{'data1':members[_0x3ea38e][_0x5ce2('0x29')]||_0x562604['type'],'data2':members[_0x3ea38e][_0x5ce2('0x2a')]||_0x562604[_0x5ce2('0x2b')],'data3':members[_0x3ea38e][_0x5ce2('0x2d')]||_0x562604[_0x5ce2('0x2f')],'uniqueid':members[_0x3ea38e]['uniqueid']||_0x562604[_0x5ce2('0x3')]});utils[_0x5ce2('0x1')](util[_0x5ce2('0x2')](_0x5ce2('0x2c'),_0x562604[_0x5ce2('0x3')],members[_0x3ea38e][_0x5ce2('0x29')],members[_0x3ea38e]['data2'],members[_0x3ea38e][_0x5ce2('0x2d')]));if(members[_0x3ea38e][_0x5ce2('0x1c')]){writeDB(members[_0x3ea38e]);}}}}catch(_0x5c290a){utils[_0x5ce2('0x21')](util[_0x5ce2('0x2')]('[%s][members][cdr]',_0x562604[_0x5ce2('0x3')]),_0x5c290a);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 87d3475..f318175 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 _0x6572=['assign','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','error','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%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','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]','position'];(function(_0x2a06a4,_0x4ec756){var _0x31bbc6=function(_0x259296){while(--_0x259296){_0x2a06a4['push'](_0x2a06a4['shift']());}};_0x31bbc6(++_0x4ec756);}(_0x6572,0xbd));var _0x2657=function(_0x4070c2,_0x5ec75f){_0x4070c2=_0x4070c2-0x0;var _0x58082a=_0x6572[_0x4070c2];return _0x58082a;};'use strict';var _=require(_0x2657('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x571dff){utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x3'),_0x571dff['uniqueid'],_0x571dff[_0x2657('0x4')],_0x571dff['queue'],_0x571dff[_0x2657('0x5')],_0x571dff[_0x2657('0x6')],_0x571dff['accountcode'],_0x571dff[_0x2657('0x7')]));if(_0x571dff[_0x2657('0x8')]){utils['getVoiceQueueByName'](_0x571dff[_0x2657('0x8')])['then'](function(_0x3dbc0e){if(_0x3dbc0e){_0x571dff[_0x2657('0x9')]=_0x3dbc0e[_0x2657('0x9')];}utils[_0x2657('0xa')](_0x2657('0xb'),_0x571dff);});}else{utils['request'](_0x2657('0xb'),_0x571dff);}if(_0x571dff['transfereduniqueid']){delete queues[_0x571dff[_0x2657('0xc')]];}else{delete queues[_0x571dff[_0x2657('0xd')]];}}exports['queuecallerjoin']=function(_0x2b9a5c){try{utils[_0x2657('0xe')](util['format'](_0x2657('0xf'),_0x2b9a5c[_0x2657('0xd')]),_0x2b9a5c);utils['info'](util[_0x2657('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2b9a5c[_0x2657('0xd')],_0x2b9a5c[_0x2657('0x8')],_0x2b9a5c[_0x2657('0x10')]));queues[_0x2b9a5c['uniqueid']]=_[_0x2657('0x11')](_0x2b9a5c,{'originalposition':_0x2b9a5c['position'],'queuecallerjoinAt':utils[_0x2657('0x12')](),'mohtime':0x0});}catch(_0x5a4a5e){utils['error'](util[_0x2657('0x2')](_0x2657('0xf'),_0x2b9a5c[_0x2657('0xd')]),_0x5a4a5e);}};exports[_0x2657('0x13')]=function(_0x22a887){try{if(!_[_0x2657('0x14')](queues[_0x22a887[_0x2657('0xd')]])){utils[_0x2657('0xe')](util['format'](_0x2657('0x15'),_0x22a887[_0x2657('0xd')]),_0x22a887);if(queues[_0x22a887[_0x2657('0xd')]][_0x2657('0x16')]){if(!queues[_0x22a887[_0x2657('0xd')]][_0x2657('0x17')]&&!queues[_0x22a887[_0x2657('0xd')]][_0x2657('0x18')]){queues[_0x22a887[_0x2657('0xd')]][_0x2657('0x19')]=!![];queues[_0x22a887[_0x2657('0xd')]]['queuecallercompleteAt']=utils[_0x2657('0x12')]();queues[_0x22a887[_0x2657('0xd')]]['queuecallerexitreason']=_0x2657('0x1a');}utils['info'](util['format'](_0x2657('0x1b'),_0x22a887[_0x2657('0xd')],queues[_0x22a887[_0x2657('0xd')]]['name'],queues[_0x22a887[_0x2657('0xd')]]['queuecallerexitreason']));writeDB(queues[_0x22a887[_0x2657('0xd')]]);}else if(queues[_0x22a887[_0x2657('0xd')]]['transfereduniqueid']){utils[_0x2657('0x1')](util['format'](_0x2657('0x1c'),_0x22a887[_0x2657('0xd')],queues[_0x22a887['uniqueid']][_0x2657('0x1d')],queues[_0x22a887[_0x2657('0xd')]]['transfereduniqueid']));queues[queues[_0x22a887[_0x2657('0xd')]]['transfereduniqueid']]=queues[_0x22a887[_0x2657('0xd')]];queues[queues[_0x22a887[_0x2657('0xd')]]['transfereduniqueid']][_0x2657('0x1e')]=0x2;delete queues[_0x22a887[_0x2657('0xd')]];}}}catch(_0x3b98e3){utils[_0x2657('0x1f')](util[_0x2657('0x2')](_0x2657('0x15'),_0x22a887['uniqueid']),_0x3b98e3);}};exports[_0x2657('0x20')]=function(_0xdcae75){try{utils['debug'](util[_0x2657('0x2')](_0x2657('0x21'),_0xdcae75[_0x2657('0xd')]),_0xdcae75);if(!_[_0x2657('0x14')](_0xdcae75[_0x2657('0x22')][_0x2657('0x23')])&&_0xdcae75['value'][_0x2657('0x24')]()!==_0x2657('0x25')){if(!_['isNil'](queues[_0xdcae75[_0x2657('0xd')]])){queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x17')]=![];queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x26')]=null;queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x18')]=!![];queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x27')]=utils[_0x2657('0x12')]();queues[_0xdcae75[_0x2657('0xd')]]['queuecallerexitreason']=_0xdcae75[_0x2657('0x28')]['toUpperCase']();utils['info'](util['format'](_0x2657('0x29'),_0xdcae75[_0x2657('0xd')],queues[_0xdcae75['uniqueid']][_0x2657('0x1d')],_0xdcae75['value'],queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x7')]));writeDB(queues[_0xdcae75['uniqueid']]);}}else if(!_[_0x2657('0x14')](_0xdcae75[_0x2657('0x22')][_0x2657('0x2a')])){if(!_['isNil'](queues[_0xdcae75[_0x2657('0xd')]])&&!queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x17')]){queues[_0xdcae75['uniqueid']][_0x2657('0x17')]=![];queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x26')]=null;queues[_0xdcae75['uniqueid']]['queuecallerexit']=!![];queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x27')]=utils[_0x2657('0x12')]();queues[_0xdcae75[_0x2657('0xd')]][_0x2657('0x7')]=_0x2657('0x2b');utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x2c'),_0xdcae75[_0x2657('0xd')],queues[_0xdcae75['uniqueid']][_0x2657('0x1d')],_0xdcae75['value'],queues[_0xdcae75['uniqueid']][_0x2657('0x7')]));}}}catch(_0x4e9499){utils[_0x2657('0x1f')](util['format'](_0x2657('0x21'),_0xdcae75[_0x2657('0xd')]),_0x4e9499);}};exports[_0x2657('0x17')]=function(_0x61101f){try{if(!_[_0x2657('0x14')](queues[_0x61101f[_0x2657('0xd')]])){utils['debug'](util[_0x2657('0x2')](_0x2657('0x2d'),_0x61101f['uniqueid']),_0x61101f);queues[_0x61101f['uniqueid']]['queuecallerexit']=![];queues[_0x61101f[_0x2657('0xd')]]['queuecallerexitAt']=null;queues[_0x61101f[_0x2657('0xd')]][_0x2657('0x17')]=!![];queues[_0x61101f[_0x2657('0xd')]][_0x2657('0x26')]=utils[_0x2657('0x12')]();queues[_0x61101f[_0x2657('0xd')]][_0x2657('0x7')]=_0x2657('0x2e');utils['info'](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x61101f[_0x2657('0xd')],queues[_0x61101f[_0x2657('0xd')]][_0x2657('0x1d')],queues[_0x61101f[_0x2657('0xd')]][_0x2657('0x7')]));}}catch(_0x327d21){utils['error'](util[_0x2657('0x2')](_0x2657('0x2d'),_0x61101f[_0x2657('0xd')]),_0x327d21);}};exports[_0x2657('0x2f')]=function(_0x2ccca5){try{if(!_[_0x2657('0x14')](queues[_0x2ccca5[_0x2657('0xd')]])){utils[_0x2657('0xe')](util[_0x2657('0x2')](_0x2657('0x30'),_0x2ccca5[_0x2657('0xd')]),_0x2ccca5);utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x31'),_0x2ccca5[_0x2657('0xd')],queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x1d')],_0x2ccca5[_0x2657('0x32')],_0x2ccca5['connectedlinename']));queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x2f')]=!![];queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x16')]=utils[_0x2657('0x12')]();queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x33')]=utils[_0x2657('0x34')](queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x16')],queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x35')]);queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x10')]=_0x2ccca5[_0x2657('0x10')];queues[_0x2ccca5[_0x2657('0xd')]][_0x2657('0x36')]=_0x2ccca5['count'];queues[_0x2ccca5[_0x2657('0xd')]]['connectedlinenum']=_0x2ccca5[_0x2657('0x32')];queues[_0x2ccca5['uniqueid']]['connectedlinename']=_0x2ccca5[_0x2657('0x37')];}}catch(_0x5aec09){utils[_0x2657('0x1f')](util['format']('[%s][queues][queuecallerleave]',_0x2ccca5[_0x2657('0xd')]),_0x5aec09);}};exports['agentconnect']=function(_0x96ca39){try{if(!_[_0x2657('0x14')](queues[_0x96ca39[_0x2657('0xd')]])){utils[_0x2657('0xe')](util[_0x2657('0x2')](_0x2657('0x38'),_0x96ca39[_0x2657('0xd')]),_0x96ca39);utils['info'](util[_0x2657('0x2')](_0x2657('0x39'),_0x96ca39[_0x2657('0xd')],queues[_0x96ca39[_0x2657('0xd')]]['name'],_0x96ca39[_0x2657('0x3a')],_0x96ca39[_0x2657('0x3b')]));queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x17')]=![];queues[_0x96ca39[_0x2657('0xd')]]['queuecallerabandon']=![];queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x26')]=null;queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x18')]=![];queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x7')]=null;queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x27')]=null;queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x3c')]=!![];queues[_0x96ca39[_0x2657('0xd')]]['accountcode']=_0x96ca39[_0x2657('0x3b')];queues[_0x96ca39[_0x2657('0xd')]][_0x2657('0x5')]=_0x96ca39[_0x2657('0x3a')];}}catch(_0x385231){utils[_0x2657('0x1f')](util[_0x2657('0x2')](_0x2657('0x38'),_0x96ca39['uniqueid']),_0x385231);}};exports[_0x2657('0x3d')]=function(_0x39606d){try{if(!_[_0x2657('0x14')](queues[_0x39606d[_0x2657('0xd')]])){if(queues[_0x39606d[_0x2657('0xd')]]['queuecallerleaveAt']){utils[_0x2657('0xe')](util[_0x2657('0x2')](_0x2657('0x3e'),_0x39606d[_0x2657('0xd')]),_0x39606d);queues[_0x39606d[_0x2657('0xd')]]['queuecallerabandon']=![];queues[_0x39606d[_0x2657('0xd')]]['queuecallerabandon']=![];queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x26')]=null;queues[_0x39606d[_0x2657('0xd')]]['queuecallerexit']=![];queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x27')]=null;queues[_0x39606d[_0x2657('0xd')]]['assigned']=!![];queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x5')]=_0x39606d[_0x2657('0x3a')];queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x19')]=!![];queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x3f')]=utils[_0x2657('0x12')]();if(_0x39606d[_0x2657('0x40')]==_0x2657('0x41')){if(!queues[_0x39606d[_0x2657('0xd')]]['transfer']){queues[_0x39606d['uniqueid']][_0x2657('0x7')]=_0x2657('0x42');}}else{queues[_0x39606d['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x39606d[_0x2657('0x40')][_0x2657('0x24')]();}utils[_0x2657('0x1')](util[_0x2657('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x39606d['uniqueid'],queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x1d')],_0x39606d[_0x2657('0x3a')],queues[_0x39606d[_0x2657('0xd')]][_0x2657('0x7')]));writeDB(queues[_0x39606d[_0x2657('0xd')]]);}}}catch(_0x4a0784){utils['error'](util[_0x2657('0x2')]('[%s][queues][agentcomplete]',_0x39606d['uniqueid']),_0x4a0784);}};exports[_0x2657('0x43')]=function(_0x53abd1){try{if(!_[_0x2657('0x14')](queues[_0x53abd1['transfereeuniqueid']])){utils[_0x2657('0xe')](util['format'](_0x2657('0x44'),_0x53abd1[_0x2657('0xd')]),_0x53abd1);queues[_0x53abd1[_0x2657('0x45')]][_0x2657('0x41')]=!![];queues[_0x53abd1[_0x2657('0x45')]][_0x2657('0x46')]=_0x2657('0x47');queues[_0x53abd1[_0x2657('0x45')]]['transferexten']=_0x53abd1[_0x2657('0x48')];queues[_0x53abd1[_0x2657('0x45')]][_0x2657('0x49')]=_0x53abd1[_0x2657('0x45')];queues[_0x53abd1[_0x2657('0x45')]][_0x2657('0x7')]=_0x2657('0x4a');utils[_0x2657('0x1')](util['format'](_0x2657('0x4b'),_0x53abd1[_0x2657('0xd')],queues[_0x53abd1[_0x2657('0x45')]][_0x2657('0x1d')],_0x53abd1[_0x2657('0x45')],_0x53abd1[_0x2657('0x48')]));}}catch(_0xc933c4){utils['error'](util[_0x2657('0x2')](_0x2657('0x44'),_0x53abd1[_0x2657('0xd')]),_0xc933c4);}};exports[_0x2657('0x4c')]=function(_0x4cd9b7){try{utils['debug'](util['format'](_0x2657('0x4d'),_0x4cd9b7[_0x2657('0x4e')]),_0x4cd9b7);if(_0x4cd9b7[_0x2657('0x4e')]==_0x4cd9b7['origtransfererlinkedid']){if(!_[_0x2657('0x14')](queues[_0x4cd9b7['secondtransfererlinkedid']])){utils['info'](util[_0x2657('0x2')](_0x2657('0x4f'),_0x4cd9b7[_0x2657('0x4e')],queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0x1d')],_0x4cd9b7['origtransfererexten']));queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0x41')]=!![];queues[_0x4cd9b7['secondtransfererlinkedid']]['transfertype']=_0x2657('0x51');queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0x52')]=_0x4cd9b7[_0x2657('0x53')];queues[_0x4cd9b7['secondtransfererlinkedid']][_0x2657('0x49')]=_0x4cd9b7[_0x2657('0x4e')];queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0x7')]=_0x2657('0x54');}if(!_[_0x2657('0x14')](queues[_0x4cd9b7[_0x2657('0x55')]])){if(_0x4cd9b7['transfereelinkedid']&&queues[_0x4cd9b7[_0x2657('0x56')]]){queues[_0x4cd9b7['transfereelinkedid']][_0x2657('0x1e')]=0x1;queues[_0x4cd9b7['transfereeuniqueid']]=_[_0x2657('0x57')](queues[_0x4cd9b7[_0x2657('0x56')]]);queues[_0x4cd9b7[_0x2657('0x45')]][_0x2657('0xc')]=_0x4cd9b7[_0x2657('0x58')];queues[_0x4cd9b7['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x6')]=queues[_0x4cd9b7['secondtransfererlinkedid']]['calleridnum'];queues[_0x4cd9b7[_0x2657('0x45')]][_0x2657('0x59')]=queues[_0x4cd9b7['secondtransfererlinkedid']][_0x2657('0x59')];queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x35')]=utils['now']();queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x16')]=utils[_0x2657('0x12')]();queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x33')]=0x0;queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x5a')]=0x0;utils['info'](util[_0x2657('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x4cd9b7[_0x2657('0x4e')],queues[_0x4cd9b7[_0x2657('0x45')]][_0x2657('0x1d')],queues[_0x4cd9b7['transfereeuniqueid']][_0x2657('0x6')],queues[_0x4cd9b7[_0x2657('0x45')]]['calleridname']));}else{utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x5b'),_0x4cd9b7['origtransfereruniqueid'],queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x1d')],_0x4cd9b7[_0x2657('0x50')]));queues[_0x4cd9b7['origtransfererlinkedid']][_0x2657('0xc')]=_0x4cd9b7[_0x2657('0x50')];}}}else if(_0x4cd9b7[_0x2657('0x5c')]==_0x4cd9b7[_0x2657('0x50')]){if(!_[_0x2657('0x14')](queues[_0x4cd9b7[_0x2657('0x55')]])){utils['info'](util[_0x2657('0x2')](_0x2657('0x5d'),_0x4cd9b7[_0x2657('0x4e')],queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x1d')],_0x4cd9b7['secondtransfereruniqueid'],_0x4cd9b7[_0x2657('0x5e')]));queues[_0x4cd9b7['origtransfererlinkedid']]['transfer']=!![];queues[_0x4cd9b7[_0x2657('0x55')]]['transfertype']=_0x2657('0x51');queues[_0x4cd9b7['origtransfererlinkedid']][_0x2657('0x52')]=_0x4cd9b7[_0x2657('0x5e')];queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x49')]=_0x4cd9b7[_0x2657('0x5c')];queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x2657('0x14')](queues[_0x4cd9b7[_0x2657('0x50')]])){if(_0x4cd9b7['transfertargetlinkedid']&&queues[_0x4cd9b7['transfertargetlinkedid']]){queues[_0x4cd9b7[_0x2657('0x5f')]][_0x2657('0x1e')]=0x1;queues[_0x4cd9b7[_0x2657('0x58')]]=_[_0x2657('0x57')](queues[_0x4cd9b7[_0x2657('0x5f')]]);queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0xc')]=_0x4cd9b7['transfertargetuniqueid'];queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x1e')]=0x2;queues[_0x4cd9b7['transfertargetuniqueid']][_0x2657('0x6')]=queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x6')];queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x59')]=queues[_0x4cd9b7[_0x2657('0x55')]][_0x2657('0x59')];queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x35')]=utils[_0x2657('0x12')]();queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x16')]=utils[_0x2657('0x12')]();queues[_0x4cd9b7['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x5a')]=0x0;utils[_0x2657('0x1')](util['format'](_0x2657('0x60'),_0x4cd9b7[_0x2657('0x4e')],queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x1d')],queues[_0x4cd9b7[_0x2657('0x58')]]['transfereduniqueid'],queues[_0x4cd9b7[_0x2657('0x58')]]['calleridnum'],queues[_0x4cd9b7[_0x2657('0x58')]][_0x2657('0x59')]));}else{utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x5b'),_0x4cd9b7[_0x2657('0x4e')],queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0x1d')],_0x4cd9b7[_0x2657('0x55')]));queues[_0x4cd9b7[_0x2657('0x50')]][_0x2657('0xc')]=_0x4cd9b7[_0x2657('0x55')];}}}}catch(_0x59b1fc){utils[_0x2657('0x1f')](util[_0x2657('0x2')]('[%s][queues][attendedtransfer]',_0x4cd9b7[_0x2657('0x4e')]),_0x59b1fc);}};exports[_0x2657('0x61')]=function(_0xd94541){try{if(!_[_0x2657('0x14')](queues[_0xd94541[_0x2657('0xd')]])){utils[_0x2657('0xe')](util[_0x2657('0x2')](_0x2657('0x62'),_0xd94541[_0x2657('0xd')]),_0xd94541);queues[_0xd94541[_0x2657('0xd')]][_0x2657('0x63')]=utils[_0x2657('0x12')]();utils[_0x2657('0x1')](util[_0x2657('0x2')](_0x2657('0x64'),_0xd94541[_0x2657('0xd')],queues[_0xd94541['uniqueid']][_0x2657('0x1d')],queues[_0xd94541[_0x2657('0xd')]]['musiconholdstartAt']));}}catch(_0x5d6cff){utils['error'](util[_0x2657('0x2')](_0x2657('0x62'),_0xd94541[_0x2657('0xd')]),_0x5d6cff);}};exports[_0x2657('0x65')]=function(_0x1b879d){try{if(!_[_0x2657('0x14')](queues[_0x1b879d[_0x2657('0xd')]])){if(!_[_0x2657('0x14')](queues[_0x1b879d[_0x2657('0xd')]]['musiconholdstartAt'])){utils[_0x2657('0xe')](util[_0x2657('0x2')](_0x2657('0x66'),_0x1b879d['uniqueid']),_0x1b879d);queues[_0x1b879d[_0x2657('0xd')]][_0x2657('0x5a')]+=utils['diffTime'](utils['now'](),queues[_0x1b879d[_0x2657('0xd')]][_0x2657('0x63')]);utils[_0x2657('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x1b879d[_0x2657('0xd')],queues[_0x1b879d['uniqueid']]['name'],queues[_0x1b879d['uniqueid']][_0x2657('0x5a')]));delete queues[_0x1b879d[_0x2657('0xd')]]['musiconholdstartAt'];}}}catch(_0xffe48f){utils[_0x2657('0x1f')](util[_0x2657('0x2')](_0x2657('0x66'),_0x1b879d[_0x2657('0xd')]),_0xffe48f);}}; \ No newline at end of file +var _0x72c2=['queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%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][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferuniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum'];(function(_0x13992d,_0x3029ea){var _0x3d15bf=function(_0x3444f7){while(--_0x3444f7){_0x13992d['push'](_0x13992d['shift']());}};_0x3d15bf(++_0x3029ea);}(_0x72c2,0x19a));var _0x272c=function(_0x4b9015,_0xac9fa0){_0x4b9015=_0x4b9015-0x0;var _0x498321=_0x72c2[_0x4b9015];return _0x498321;};'use strict';var _=require(_0x272c('0x0'));var util=require(_0x272c('0x1'));var utils=require(_0x272c('0x2'));var queues={};function writeDB(_0x2f8baf){utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x5'),_0x2f8baf[_0x272c('0x6')],_0x2f8baf['channel'],_0x2f8baf[_0x272c('0x7')],_0x2f8baf[_0x272c('0x8')],_0x2f8baf[_0x272c('0x9')],_0x2f8baf['accountcode'],_0x2f8baf[_0x272c('0xa')]));if(_0x2f8baf[_0x272c('0x7')]){utils[_0x272c('0xb')](_0x2f8baf[_0x272c('0x7')])['then'](function(_0x155dd5){if(_0x155dd5){_0x2f8baf[_0x272c('0xc')]=_0x155dd5[_0x272c('0xc')];}utils[_0x272c('0xd')](_0x272c('0xe'),_0x2f8baf);});}else{utils[_0x272c('0xd')](_0x272c('0xe'),_0x2f8baf);}if(_0x2f8baf[_0x272c('0xf')]){delete queues[_0x2f8baf[_0x272c('0xf')]];}else{delete queues[_0x2f8baf[_0x272c('0x6')]];}}exports[_0x272c('0x10')]=function(_0x4ebfd8){try{utils[_0x272c('0x11')](util[_0x272c('0x4')](_0x272c('0x12'),_0x4ebfd8[_0x272c('0x6')]),_0x4ebfd8);utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x13'),_0x4ebfd8[_0x272c('0x6')],_0x4ebfd8[_0x272c('0x7')],_0x4ebfd8[_0x272c('0x14')]));queues[_0x4ebfd8[_0x272c('0x6')]]=_[_0x272c('0x15')](_0x4ebfd8,{'originalposition':_0x4ebfd8['position'],'queuecallerjoinAt':utils[_0x272c('0x16')](),'mohtime':0x0});}catch(_0x528d83){utils[_0x272c('0x17')](util[_0x272c('0x4')](_0x272c('0x12'),_0x4ebfd8['uniqueid']),_0x528d83);}};exports[_0x272c('0x18')]=function(_0x315bf7){try{if(!_[_0x272c('0x19')](queues[_0x315bf7[_0x272c('0x6')]])){utils[_0x272c('0x11')](util['format']('[%s][queues][hangup]',_0x315bf7[_0x272c('0x6')]),_0x315bf7);if(queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x1a')]){if(!queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x1b')]&&!queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x1c')]){queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x1d')]=!![];queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x1e')]=utils[_0x272c('0x16')]();queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0xa')]=_0x272c('0x1f');}utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x20'),_0x315bf7[_0x272c('0x6')],queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x21')],queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0xa')]));writeDB(queues[_0x315bf7['uniqueid']]);}else if(queues[_0x315bf7['uniqueid']][_0x272c('0xf')]){utils[_0x272c('0x3')](util['format'](_0x272c('0x22'),_0x315bf7[_0x272c('0x6')],queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0x21')],queues[_0x315bf7[_0x272c('0x6')]]['transfereduniqueid']));queues[queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0xf')]]=queues[_0x315bf7[_0x272c('0x6')]];queues[queues[_0x315bf7[_0x272c('0x6')]][_0x272c('0xf')]][_0x272c('0x23')]=0x2;delete queues[_0x315bf7[_0x272c('0x6')]];}}}catch(_0x3218da){utils[_0x272c('0x17')](util['format'](_0x272c('0x24'),_0x315bf7[_0x272c('0x6')]),_0x3218da);}};exports[_0x272c('0x25')]=function(_0xe2d525){try{utils['debug'](util[_0x272c('0x4')]('[%s][queues][varset]',_0xe2d525['uniqueid']),_0xe2d525);if(!_[_0x272c('0x19')](_0xe2d525[_0x272c('0x26')][_0x272c('0x27')])&&_0xe2d525['value'][_0x272c('0x28')]()!==_0x272c('0x29')){if(!_[_0x272c('0x19')](queues[_0xe2d525[_0x272c('0x6')]])){queues[_0xe2d525['uniqueid']][_0x272c('0x1b')]=![];queues[_0xe2d525[_0x272c('0x6')]][_0x272c('0x2a')]=null;queues[_0xe2d525[_0x272c('0x6')]][_0x272c('0x1c')]=!![];queues[_0xe2d525['uniqueid']][_0x272c('0x2b')]=utils[_0x272c('0x16')]();queues[_0xe2d525[_0x272c('0x6')]]['queuecallerexitreason']=_0xe2d525[_0x272c('0x2c')][_0x272c('0x28')]();utils[_0x272c('0x3')](util['format'](_0x272c('0x2d'),_0xe2d525['uniqueid'],queues[_0xe2d525['uniqueid']][_0x272c('0x21')],_0xe2d525[_0x272c('0x2c')],queues[_0xe2d525[_0x272c('0x6')]]['queuecallerexitreason']));writeDB(queues[_0xe2d525[_0x272c('0x6')]]);}}else if(!_['isNil'](_0xe2d525[_0x272c('0x26')][_0x272c('0x2e')])){if(!_[_0x272c('0x19')](queues[_0xe2d525['uniqueid']])&&!queues[_0xe2d525[_0x272c('0x6')]][_0x272c('0x1b')]){queues[_0xe2d525[_0x272c('0x6')]]['queuecallerabandon']=![];queues[_0xe2d525[_0x272c('0x6')]][_0x272c('0x2a')]=null;queues[_0xe2d525[_0x272c('0x6')]][_0x272c('0x1c')]=!![];queues[_0xe2d525[_0x272c('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0xe2d525['uniqueid']][_0x272c('0xa')]=_0x272c('0x2f');utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x30'),_0xe2d525['uniqueid'],queues[_0xe2d525['uniqueid']][_0x272c('0x21')],_0xe2d525[_0x272c('0x2c')],queues[_0xe2d525['uniqueid']][_0x272c('0xa')]));}}}catch(_0x410712){utils[_0x272c('0x17')](util[_0x272c('0x4')](_0x272c('0x31'),_0xe2d525[_0x272c('0x6')]),_0x410712);}};exports[_0x272c('0x1b')]=function(_0x381bb5){try{if(!_[_0x272c('0x19')](queues[_0x381bb5['uniqueid']])){utils['debug'](util[_0x272c('0x4')]('[%s][queues][queuecallerabandon]',_0x381bb5[_0x272c('0x6')]),_0x381bb5);queues[_0x381bb5['uniqueid']][_0x272c('0x1c')]=![];queues[_0x381bb5['uniqueid']][_0x272c('0x2b')]=null;queues[_0x381bb5[_0x272c('0x6')]][_0x272c('0x1b')]=!![];queues[_0x381bb5['uniqueid']][_0x272c('0x2a')]=utils['now']();queues[_0x381bb5['uniqueid']]['queuecallerexitreason']=_0x272c('0x32');utils[_0x272c('0x3')](util['format'](_0x272c('0x33'),_0x381bb5['uniqueid'],queues[_0x381bb5[_0x272c('0x6')]][_0x272c('0x21')],queues[_0x381bb5[_0x272c('0x6')]][_0x272c('0xa')]));}}catch(_0x241954){utils[_0x272c('0x17')](util['format'](_0x272c('0x34'),_0x381bb5['uniqueid']),_0x241954);}};exports[_0x272c('0x35')]=function(_0x47db0e){try{if(!_[_0x272c('0x19')](queues[_0x47db0e[_0x272c('0x6')]])){utils[_0x272c('0x11')](util[_0x272c('0x4')](_0x272c('0x36'),_0x47db0e['uniqueid']),_0x47db0e);utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x37'),_0x47db0e[_0x272c('0x6')],queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x21')],_0x47db0e[_0x272c('0x38')],_0x47db0e[_0x272c('0x39')]));queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x35')]=!![];queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x1a')]=utils[_0x272c('0x16')]();queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x3a')]=utils[_0x272c('0x3b')](queues[_0x47db0e['uniqueid']][_0x272c('0x1a')],queues[_0x47db0e[_0x272c('0x6')]]['queuecallerjoinAt']);queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x14')]=_0x47db0e[_0x272c('0x14')];queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x3c')]=_0x47db0e[_0x272c('0x3c')];queues[_0x47db0e[_0x272c('0x6')]][_0x272c('0x38')]=_0x47db0e[_0x272c('0x38')];queues[_0x47db0e['uniqueid']][_0x272c('0x39')]=_0x47db0e[_0x272c('0x39')];}}catch(_0x339d07){utils['error'](util[_0x272c('0x4')](_0x272c('0x36'),_0x47db0e[_0x272c('0x6')]),_0x339d07);}};exports[_0x272c('0x3d')]=function(_0x4b594d){try{if(!_[_0x272c('0x19')](queues[_0x4b594d[_0x272c('0x6')]])){utils['debug'](util[_0x272c('0x4')](_0x272c('0x3e'),_0x4b594d[_0x272c('0x6')]),_0x4b594d);utils[_0x272c('0x3')](util[_0x272c('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4b594d['uniqueid'],queues[_0x4b594d['uniqueid']][_0x272c('0x21')],_0x4b594d['membername'],_0x4b594d[_0x272c('0x3f')]));queues[_0x4b594d[_0x272c('0x6')]]['queuecallerabandon']=![];queues[_0x4b594d['uniqueid']][_0x272c('0x1b')]=![];queues[_0x4b594d['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4b594d[_0x272c('0x6')]]['queuecallerexit']=![];queues[_0x4b594d['uniqueid']]['queuecallerexitreason']=null;queues[_0x4b594d['uniqueid']][_0x272c('0x2b')]=null;queues[_0x4b594d[_0x272c('0x6')]]['assigned']=!![];queues[_0x4b594d[_0x272c('0x6')]]['accountcode']=_0x4b594d[_0x272c('0x3f')];queues[_0x4b594d[_0x272c('0x6')]]['lastAssignedTo']=_0x4b594d[_0x272c('0x40')];}}catch(_0x108499){utils[_0x272c('0x17')](util[_0x272c('0x4')](_0x272c('0x3e'),_0x4b594d['uniqueid']),_0x108499);}};exports[_0x272c('0x41')]=function(_0xf9c9e8){try{if(!_[_0x272c('0x19')](queues[_0xf9c9e8[_0x272c('0x6')]])){if(queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerleaveAt']){utils[_0x272c('0x11')](util[_0x272c('0x4')](_0x272c('0x42'),_0xf9c9e8[_0x272c('0x6')]),_0xf9c9e8);queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerabandon']=![];queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerabandon']=![];queues[_0xf9c9e8[_0x272c('0x6')]][_0x272c('0x2a')]=null;queues[_0xf9c9e8[_0x272c('0x6')]][_0x272c('0x1c')]=![];queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerexitAt']=null;queues[_0xf9c9e8['uniqueid']][_0x272c('0x43')]=!![];queues[_0xf9c9e8[_0x272c('0x6')]]['lastAssignedTo']=_0xf9c9e8[_0x272c('0x40')];queues[_0xf9c9e8[_0x272c('0x6')]][_0x272c('0x1d')]=!![];queues[_0xf9c9e8['uniqueid']][_0x272c('0x1e')]=utils[_0x272c('0x16')]();if(_0xf9c9e8[_0x272c('0x44')]==_0x272c('0x45')){if(!queues[_0xf9c9e8[_0x272c('0x6')]][_0x272c('0x45')]){queues[_0xf9c9e8[_0x272c('0x6')]][_0x272c('0xa')]=_0x272c('0x46');}}else{queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerexitreason']=_0x272c('0x47')+_0xf9c9e8[_0x272c('0x44')]['toUpperCase']();}utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x48'),_0xf9c9e8[_0x272c('0x6')],queues[_0xf9c9e8[_0x272c('0x6')]]['name'],_0xf9c9e8[_0x272c('0x40')],queues[_0xf9c9e8[_0x272c('0x6')]]['queuecallerexitreason']));writeDB(queues[_0xf9c9e8[_0x272c('0x6')]]);}}}catch(_0x2b9cdf){utils[_0x272c('0x17')](util['format'](_0x272c('0x42'),_0xf9c9e8[_0x272c('0x6')]),_0x2b9cdf);}};exports['blindtransfer']=function(_0x3863d3){try{if(!_['isNil'](queues[_0x3863d3[_0x272c('0x49')]])){utils[_0x272c('0x11')](util[_0x272c('0x4')](_0x272c('0x4a'),_0x3863d3[_0x272c('0x6')]),_0x3863d3);queues[_0x3863d3[_0x272c('0x49')]][_0x272c('0x45')]=!![];queues[_0x3863d3[_0x272c('0x49')]][_0x272c('0x4b')]=_0x272c('0x4c');queues[_0x3863d3[_0x272c('0x49')]][_0x272c('0x4d')]=_0x3863d3[_0x272c('0x4e')];queues[_0x3863d3[_0x272c('0x49')]]['transferuniqueid']=_0x3863d3[_0x272c('0x49')];queues[_0x3863d3[_0x272c('0x49')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x4f'),_0x3863d3['uniqueid'],queues[_0x3863d3[_0x272c('0x49')]][_0x272c('0x21')],_0x3863d3['transfereeuniqueid'],_0x3863d3[_0x272c('0x4e')]));}}catch(_0x408231){utils[_0x272c('0x17')](util[_0x272c('0x4')](_0x272c('0x4a'),_0x3863d3[_0x272c('0x6')]),_0x408231);}};exports[_0x272c('0x50')]=function(_0x4dd8fe){try{utils[_0x272c('0x11')](util[_0x272c('0x4')]('[%s][queues][attendedtransfer]',_0x4dd8fe[_0x272c('0x51')]),_0x4dd8fe);if(_0x4dd8fe[_0x272c('0x51')]==_0x4dd8fe[_0x272c('0x52')]){if(!_[_0x272c('0x19')](queues[_0x4dd8fe[_0x272c('0x53')]])){utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x54'),_0x4dd8fe[_0x272c('0x51')],queues[_0x4dd8fe['secondtransfererlinkedid']][_0x272c('0x21')],_0x4dd8fe['origtransfererexten']));queues[_0x4dd8fe['secondtransfererlinkedid']][_0x272c('0x45')]=!![];queues[_0x4dd8fe[_0x272c('0x53')]]['transfertype']=_0x272c('0x55');queues[_0x4dd8fe[_0x272c('0x53')]][_0x272c('0x4d')]=_0x4dd8fe[_0x272c('0x56')];queues[_0x4dd8fe[_0x272c('0x53')]]['transferuniqueid']=_0x4dd8fe['origtransfereruniqueid'];queues[_0x4dd8fe[_0x272c('0x53')]]['queuecallerexitreason']=_0x272c('0x57');}if(!_[_0x272c('0x19')](queues[_0x4dd8fe[_0x272c('0x52')]])){if(_0x4dd8fe[_0x272c('0x58')]&&queues[_0x4dd8fe['transfereelinkedid']]){queues[_0x4dd8fe[_0x272c('0x58')]][_0x272c('0x23')]=0x1;queues[_0x4dd8fe[_0x272c('0x49')]]=_[_0x272c('0x59')](queues[_0x4dd8fe[_0x272c('0x58')]]);queues[_0x4dd8fe['transfereeuniqueid']][_0x272c('0xf')]=_0x4dd8fe[_0x272c('0x5a')];queues[_0x4dd8fe[_0x272c('0x49')]][_0x272c('0x23')]=0x2;queues[_0x4dd8fe[_0x272c('0x49')]][_0x272c('0x9')]=queues[_0x4dd8fe[_0x272c('0x53')]][_0x272c('0x9')];queues[_0x4dd8fe[_0x272c('0x49')]]['calleridname']=queues[_0x4dd8fe[_0x272c('0x53')]]['calleridname'];queues[_0x4dd8fe['transfereeuniqueid']][_0x272c('0x5b')]=utils[_0x272c('0x16')]();queues[_0x4dd8fe['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x272c('0x16')]();queues[_0x4dd8fe['transfereeuniqueid']][_0x272c('0x3a')]=0x0;queues[_0x4dd8fe['transfereeuniqueid']][_0x272c('0x5c')]=0x0;utils[_0x272c('0x3')](util['format'](_0x272c('0x5d'),_0x4dd8fe[_0x272c('0x51')],queues[_0x4dd8fe[_0x272c('0x49')]]['name'],queues[_0x4dd8fe[_0x272c('0x49')]][_0x272c('0x9')],queues[_0x4dd8fe[_0x272c('0x49')]][_0x272c('0x5e')]));}else{utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x5f'),_0x4dd8fe[_0x272c('0x51')],queues[_0x4dd8fe[_0x272c('0x52')]][_0x272c('0x21')],_0x4dd8fe[_0x272c('0x53')]));queues[_0x4dd8fe[_0x272c('0x52')]][_0x272c('0xf')]=_0x4dd8fe[_0x272c('0x53')];}}}else if(_0x4dd8fe[_0x272c('0x60')]==_0x4dd8fe[_0x272c('0x53')]){if(!_[_0x272c('0x19')](queues[_0x4dd8fe['origtransfererlinkedid']])){utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x61'),_0x4dd8fe['origtransfereruniqueid'],queues[_0x4dd8fe[_0x272c('0x52')]][_0x272c('0x21')],_0x4dd8fe[_0x272c('0x60')],_0x4dd8fe[_0x272c('0x62')]));queues[_0x4dd8fe['origtransfererlinkedid']][_0x272c('0x45')]=!![];queues[_0x4dd8fe[_0x272c('0x52')]][_0x272c('0x4b')]='ATTENDED';queues[_0x4dd8fe[_0x272c('0x52')]][_0x272c('0x4d')]=_0x4dd8fe[_0x272c('0x62')];queues[_0x4dd8fe['origtransfererlinkedid']][_0x272c('0x63')]=_0x4dd8fe[_0x272c('0x60')];queues[_0x4dd8fe['origtransfererlinkedid']]['queuecallerexitreason']=_0x272c('0x57');}if(!_['isNil'](queues[_0x4dd8fe[_0x272c('0x53')]])){if(_0x4dd8fe[_0x272c('0x64')]&&queues[_0x4dd8fe[_0x272c('0x64')]]){queues[_0x4dd8fe['transfertargetlinkedid']][_0x272c('0x23')]=0x1;queues[_0x4dd8fe['transfertargetuniqueid']]=_[_0x272c('0x59')](queues[_0x4dd8fe[_0x272c('0x64')]]);queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0xf')]=_0x4dd8fe[_0x272c('0x5a')];queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x23')]=0x2;queues[_0x4dd8fe['transfertargetuniqueid']][_0x272c('0x9')]=queues[_0x4dd8fe['origtransfererlinkedid']]['calleridnum'];queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x5e')]=queues[_0x4dd8fe['origtransfererlinkedid']][_0x272c('0x5e')];queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x5b')]=utils[_0x272c('0x16')]();queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x1a')]=utils['now']();queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x3a')]=0x0;queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x5c')]=0x0;utils['info'](util[_0x272c('0x4')](_0x272c('0x65'),_0x4dd8fe[_0x272c('0x51')],queues[_0x4dd8fe['transfertargetuniqueid']][_0x272c('0x21')],queues[_0x4dd8fe['transfertargetuniqueid']][_0x272c('0xf')],queues[_0x4dd8fe[_0x272c('0x5a')]][_0x272c('0x9')],queues[_0x4dd8fe[_0x272c('0x5a')]]['calleridname']));}else{utils[_0x272c('0x3')](util[_0x272c('0x4')](_0x272c('0x5f'),_0x4dd8fe[_0x272c('0x51')],queues[_0x4dd8fe[_0x272c('0x53')]]['name'],_0x4dd8fe[_0x272c('0x52')]));queues[_0x4dd8fe['secondtransfererlinkedid']][_0x272c('0xf')]=_0x4dd8fe['origtransfererlinkedid'];}}}}catch(_0x13d79d){utils[_0x272c('0x17')](util[_0x272c('0x4')]('[%s][queues][attendedtransfer]',_0x4dd8fe['origtransfereruniqueid']),_0x13d79d);}};exports[_0x272c('0x66')]=function(_0x22f15c){try{if(!_[_0x272c('0x19')](queues[_0x22f15c[_0x272c('0x6')]])){utils[_0x272c('0x11')](util['format']('[%s][queues][musiconholdstart]',_0x22f15c[_0x272c('0x6')]),_0x22f15c);queues[_0x22f15c[_0x272c('0x6')]]['musiconholdstartAt']=utils[_0x272c('0x16')]();utils[_0x272c('0x3')](util[_0x272c('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x22f15c[_0x272c('0x6')],queues[_0x22f15c[_0x272c('0x6')]][_0x272c('0x21')],queues[_0x22f15c[_0x272c('0x6')]][_0x272c('0x67')]));}}catch(_0x349445){utils[_0x272c('0x17')](util[_0x272c('0x4')]('[%s][queues][musiconholdstart]',_0x22f15c[_0x272c('0x6')]),_0x349445);}};exports['musiconholdstop']=function(_0x3c3308){try{if(!_[_0x272c('0x19')](queues[_0x3c3308[_0x272c('0x6')]])){if(!_[_0x272c('0x19')](queues[_0x3c3308['uniqueid']][_0x272c('0x67')])){utils[_0x272c('0x11')](util[_0x272c('0x4')]('[%s][queues][musiconholdstop]',_0x3c3308[_0x272c('0x6')]),_0x3c3308);queues[_0x3c3308['uniqueid']][_0x272c('0x5c')]+=utils[_0x272c('0x3b')](utils[_0x272c('0x16')](),queues[_0x3c3308['uniqueid']][_0x272c('0x67')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3c3308[_0x272c('0x6')],queues[_0x3c3308[_0x272c('0x6')]][_0x272c('0x21')],queues[_0x3c3308['uniqueid']][_0x272c('0x5c')]));delete queues[_0x3c3308[_0x272c('0x6')]]['musiconholdstartAt'];}}}catch(_0xcd79f0){utils[_0x272c('0x17')](util[_0x272c('0x4')](_0x272c('0x68'),_0x3c3308[_0x272c('0x6')]),_0xcd79f0);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 61ebb4f..74820e1 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 _0xf740=['[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','newstate','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','.wav49','value','replace','.WAV','find','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin'];(function(_0x3526a5,_0x56825d){var _0x44f869=function(_0x5dd195){while(--_0x5dd195){_0x3526a5['push'](_0x3526a5['shift']());}};_0x44f869(++_0x56825d);}(_0xf740,0x1a7));var _0x0f74=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xf740[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x0f74('0x0'));var util=require(_0x0f74('0x1'));var utils=require(_0x0f74('0x2'));var transfers=require(_0x0f74('0x3'));var recordings={};function writeDB(_0x4c29f9){var _0x292ba3;utils[_0x0f74('0x4')](util[_0x0f74('0x5')](_0x0f74('0x6'),_0x4c29f9[_0x0f74('0x7')]));if(transfers['blinds'][_0x4c29f9['uniqueid']]){_0x292ba3=_0x4c29f9[_0x0f74('0x7')];_0x4c29f9[_0x0f74('0x7')]=transfers[_0x0f74('0x8')][_0x4c29f9[_0x0f74('0x7')]][_0x0f74('0x9')];}if(_0x4c29f9[_0x0f74('0xa')]){utils[_0x0f74('0xb')](_0x4c29f9[_0x0f74('0xa')])['then'](function(_0x1f3e0c){if(_0x1f3e0c){_0x4c29f9['membername']=_0x1f3e0c[_0x0f74('0xc')];_0x4c29f9[_0x0f74('0xd')]=_0x1f3e0c['id'];}utils[_0x0f74('0xe')](_0x0f74('0xf'),_0x4c29f9);});}else{utils[_0x0f74('0xe')](_0x0f74('0xf'),_0x4c29f9);}if(_0x292ba3)delete transfers[_0x0f74('0x8')][_0x292ba3];}exports[_0x0f74('0x10')]=function(_0x242397){try{utils[_0x0f74('0x11')](util['format'](_0x0f74('0x12'),_0x242397['uniqueid']),_0x242397);if(_0x242397[_0x0f74('0x7')]==_0x242397[_0x0f74('0x13')]){utils[_0x0f74('0x4')](util[_0x0f74('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x242397[_0x0f74('0x7')],_0x242397[_0x0f74('0x14')],_0x242397[_0x0f74('0x15')]));recordings[_0x242397['uniqueid']]={'uniqueid':_0x242397[_0x0f74('0x7')],'accountcode':_0x242397['accountcode'],'exten':_0x242397[_0x0f74('0x15')],'context':_0x242397[_0x0f74('0x14')],'channel':_0x242397[_0x0f74('0x16')],'monitors':[]};}}catch(_0x574d70){utils[_0x0f74('0x17')](util[_0x0f74('0x5')](_0x0f74('0x12'),_0x242397[_0x0f74('0x7')]),_0x574d70);}};exports[_0x0f74('0x18')]=function(_0x408e22){try{utils[_0x0f74('0x11')](util[_0x0f74('0x5')]('[%s][recordings][newstate]',_0x408e22[_0x0f74('0x7')]),_0x408e22);if(!_['isNil'](recordings[_0x408e22[_0x0f74('0x7')]])&&_0x408e22[_0x0f74('0x19')]==0x6){utils[_0x0f74('0x4')](util[_0x0f74('0x5')](_0x0f74('0x1a'),_0x408e22['uniqueid'],_0x408e22[_0x0f74('0x14')],_0x408e22['channel']));}else if(!_[_0x0f74('0x1b')](recordings[_0x408e22[_0x0f74('0x13')]])&&_0x408e22[_0x0f74('0x19')]==0x6&&_0x408e22[_0x0f74('0x14')]!='transfer'){utils['info'](util[_0x0f74('0x5')](_0x0f74('0x1c'),_0x408e22[_0x0f74('0x7')],_0x408e22[_0x0f74('0x13')],_0x408e22['context'],_0x408e22['channel']));recordings[_0x408e22[_0x0f74('0x13')]]['accountcode']=_0x408e22[_0x0f74('0xa')];}}catch(_0x43c2da){utils[_0x0f74('0x17')](util[_0x0f74('0x5')]('[%s][recordings][newstate]',_0x408e22[_0x0f74('0x7')]),_0x43c2da);}};exports['varset']=function(_0x4893e1){try{if(!_[_0x0f74('0x1b')](_0x4893e1[_0x0f74('0x1d')])&&!_['isNil'](_0x4893e1[_0x0f74('0x1d')]['mixmonitor_filename'])){utils[_0x0f74('0x11')](util[_0x0f74('0x5')]('[%s][recordings][varset]',_0x4893e1[_0x0f74('0x7')]),_0x4893e1);utils[_0x0f74('0x4')](util['format'](_0x0f74('0x1e'),_0x4893e1[_0x0f74('0x7')],_0x4893e1[_0x0f74('0x1d')],_0x4893e1['value']));if(_[_0x0f74('0x1f')](_0x4893e1['value'],_0x0f74('0x20'))){_0x4893e1[_0x0f74('0x21')]=_0x4893e1[_0x0f74('0x21')][_0x0f74('0x22')](_0x0f74('0x20'),_0x0f74('0x23'));}if(recordings[_0x4893e1[_0x0f74('0x13')]]){var _0x324e51=_[_0x0f74('0x24')](recordings[_0x4893e1['linkedid']]['monitors'],{'value':_0x4893e1['value']});if(_['isNil'](_0x324e51)){recordings[_0x4893e1[_0x0f74('0x13')]][_0x0f74('0x25')][_0x0f74('0x26')]({'value':_0x4893e1[_0x0f74('0x21')]});}}}}catch(_0x599276){utils[_0x0f74('0x17')](util[_0x0f74('0x5')]('[%s][recordings][varset]',_0x4893e1['uniqueid']),_0x599276);}};exports['hangup']=function(_0x2f9af2){try{if(!_[_0x0f74('0x1b')](recordings[_0x2f9af2[_0x0f74('0x7')]])){utils[_0x0f74('0x11')](util[_0x0f74('0x5')]('[%s][recordings][hangup]',_0x2f9af2[_0x0f74('0x7')]),_0x2f9af2);utils[_0x0f74('0x4')](util[_0x0f74('0x5')](_0x0f74('0x27'),_0x2f9af2[_0x0f74('0x7')],_0x2f9af2['calleridnum'],_0x2f9af2[_0x0f74('0x28')],_0x2f9af2[_0x0f74('0x29')]));recordings[_0x2f9af2[_0x0f74('0x7')]]['calleridnum']=_0x2f9af2[_0x0f74('0x2a')];recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0x28')]=_0x2f9af2[_0x0f74('0x28')];recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0x2b')]=_0x2f9af2[_0x0f74('0x2b')];recordings[_0x2f9af2['uniqueid']][_0x0f74('0x2c')]=_0x2f9af2[_0x0f74('0x2c')];if(recordings[_0x2f9af2['uniqueid']][_0x0f74('0x2d')]==_0x0f74('0x2e')&&recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0xa')]){recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0x2b')]=recordings[_0x2f9af2[_0x0f74('0x7')]]['accountcode'];recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0x2c')]='';}recordings[_0x2f9af2[_0x0f74('0x7')]][_0x0f74('0x25')][_0x0f74('0x2f')](function(_0x13b43d){var _0xd4bb01=_[_0x0f74('0x30')](recordings[_0x2f9af2['uniqueid']]);_0xd4bb01[_0x0f74('0x21')]=_0x13b43d[_0x0f74('0x21')];writeDB(_0xd4bb01);});delete recordings[_0x2f9af2['uniqueid']];}}catch(_0x13c19f){utils[_0x0f74('0x17')](util[_0x0f74('0x5')](_0x0f74('0x31'),_0x2f9af2[_0x0f74('0x7')]),_0x13c19f);}};exports['newexten']=function(_0x272d80){try{if(!_[_0x0f74('0x1b')](recordings[_0x272d80[_0x0f74('0x7')]])){utils[_0x0f74('0x11')](util[_0x0f74('0x5')]('[%s][recordings][newexten]',_0x272d80[_0x0f74('0x7')]),_0x272d80);utils[_0x0f74('0x4')](util[_0x0f74('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x272d80[_0x0f74('0x7')],_0x272d80[_0x0f74('0x32')],_0x272d80[_0x0f74('0x33')]));if(_0x272d80['application'][_0x0f74('0x34')]()==_0x0f74('0x35')&&_[_0x0f74('0x36')](_0x272d80['appdata'][_0x0f74('0x34')](),_0x0f74('0x37'))){var _0x9a94f6=_0x272d80[_0x0f74('0x33')]['split']('=');var _0x3bb4e2=_0x9a94f6[0x0][_0x0f74('0x38')](_0x9a94f6[0x0][_0x0f74('0x39')]('(')+0x1,_0x9a94f6[0x0][_0x0f74('0x39')](')'));var _0x436c56=_0x9a94f6[0x1];recordings[_0x272d80[_0x0f74('0x7')]][_0x3bb4e2]=_0x436c56;}}}catch(_0x17070f){utils[_0x0f74('0x17')](util['format'](_0x0f74('0x3a'),_0x272d80[_0x0f74('0x7')]),_0x17070f);}};exports[_0x0f74('0x3b')]=function(_0x28097d){try{if(!_[_0x0f74('0x1b')](recordings[_0x28097d['uniqueid']])){utils[_0x0f74('0x11')](util[_0x0f74('0x5')](_0x0f74('0x3c'),_0x28097d[_0x0f74('0x7')]),_0x28097d);utils[_0x0f74('0x4')](util[_0x0f74('0x5')](_0x0f74('0x3d'),_0x28097d[_0x0f74('0x7')],_0x28097d[_0x0f74('0x3e')]));recordings[_0x28097d[_0x0f74('0x7')]][_0x0f74('0x3e')]=_0x28097d[_0x0f74('0x3e')];}}catch(_0x4a69c4){utils['error'](util[_0x0f74('0x5')](_0x0f74('0x3c'),_0x28097d['uniqueid']),_0x4a69c4);}};exports['blindtransfer']=function(_0x377bd4){try{utils[_0x0f74('0x11')](util[_0x0f74('0x5')](_0x0f74('0x3f'),_0x377bd4['uniqueid']),_0x377bd4);utils[_0x0f74('0x4')](util[_0x0f74('0x5')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x377bd4['uniqueid'],_0x377bd4[_0x0f74('0x40')],_0x377bd4[_0x0f74('0x41')],_0x377bd4[_0x0f74('0x42')],_0x377bd4[_0x0f74('0x43')]));if(recordings[_0x377bd4[_0x0f74('0x44')]]&&transfers['blinds'][_0x377bd4[_0x0f74('0x44')]]){transfers[_0x0f74('0x8')][_0x377bd4[_0x0f74('0x44')]]['recording']=!![];}}catch(_0x4c8a1f){utils['error'](util[_0x0f74('0x5')](_0x0f74('0x3f'),_0x377bd4[_0x0f74('0x7')]),_0x4c8a1f);}}; \ No newline at end of file +var _0x0bab=['getUserByInternal','accountcode','then','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','isNil','channelstate','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x0bab,0x1d3));var _0xb0ba=function(_0x5328e4,_0x1869e4){_0x5328e4=_0x5328e4-0x0;var _0x44137c=_0x0bab[_0x5328e4];return _0x44137c;};'use strict';var _=require(_0xb0ba('0x0'));var util=require(_0xb0ba('0x1'));var utils=require(_0xb0ba('0x2'));var transfers=require(_0xb0ba('0x3'));var recordings={};function writeDB(_0x5e6591){var _0x118893;utils['info'](util[_0xb0ba('0x4')](_0xb0ba('0x5'),_0x5e6591[_0xb0ba('0x6')]));if(transfers[_0xb0ba('0x7')][_0x5e6591[_0xb0ba('0x6')]]){_0x118893=_0x5e6591[_0xb0ba('0x6')];_0x5e6591[_0xb0ba('0x6')]=transfers['blinds'][_0x5e6591[_0xb0ba('0x6')]][_0xb0ba('0x8')];}if(_0x5e6591['accountcode']){utils[_0xb0ba('0x9')](_0x5e6591[_0xb0ba('0xa')])[_0xb0ba('0xb')](function(_0x5760cc){if(_0x5760cc){_0x5e6591[_0xb0ba('0xc')]=_0x5760cc[_0xb0ba('0xd')];_0x5e6591['UserId']=_0x5760cc['id'];}utils[_0xb0ba('0xe')](_0xb0ba('0xf'),_0x5e6591);});}else{utils[_0xb0ba('0xe')]('CreateVoiceRecording',_0x5e6591);}if(_0x118893)delete transfers['blinds'][_0x118893];}exports[_0xb0ba('0x10')]=function(_0x16fa10){try{utils[_0xb0ba('0x11')](util[_0xb0ba('0x4')](_0xb0ba('0x12'),_0x16fa10[_0xb0ba('0x6')]),_0x16fa10);if(_0x16fa10['uniqueid']==_0x16fa10['linkedid']){utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')](_0xb0ba('0x14'),_0x16fa10[_0xb0ba('0x6')],_0x16fa10['context'],_0x16fa10[_0xb0ba('0x15')]));recordings[_0x16fa10[_0xb0ba('0x6')]]={'uniqueid':_0x16fa10[_0xb0ba('0x6')],'accountcode':_0x16fa10[_0xb0ba('0xa')],'exten':_0x16fa10[_0xb0ba('0x15')],'context':_0x16fa10[_0xb0ba('0x16')],'channel':_0x16fa10[_0xb0ba('0x17')],'monitors':[]};}}catch(_0x5d4a0d){utils[_0xb0ba('0x18')](util[_0xb0ba('0x4')](_0xb0ba('0x12'),_0x16fa10[_0xb0ba('0x6')]),_0x5d4a0d);}};exports[_0xb0ba('0x19')]=function(_0x3c9cf8){try{utils['debug'](util[_0xb0ba('0x4')]('[%s][recordings][newstate]',_0x3c9cf8[_0xb0ba('0x6')]),_0x3c9cf8);if(!_[_0xb0ba('0x1a')](recordings[_0x3c9cf8[_0xb0ba('0x6')]])&&_0x3c9cf8[_0xb0ba('0x1b')]==0x6){utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3c9cf8[_0xb0ba('0x6')],_0x3c9cf8[_0xb0ba('0x16')],_0x3c9cf8['channel']));}else if(!_[_0xb0ba('0x1a')](recordings[_0x3c9cf8[_0xb0ba('0x1c')]])&&_0x3c9cf8[_0xb0ba('0x1b')]==0x6&&_0x3c9cf8[_0xb0ba('0x16')]!='transfer'){utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')](_0xb0ba('0x1d'),_0x3c9cf8['uniqueid'],_0x3c9cf8[_0xb0ba('0x1c')],_0x3c9cf8[_0xb0ba('0x16')],_0x3c9cf8[_0xb0ba('0x17')]));recordings[_0x3c9cf8[_0xb0ba('0x1c')]][_0xb0ba('0xa')]=_0x3c9cf8[_0xb0ba('0xa')];}}catch(_0xf345be){utils[_0xb0ba('0x18')](util[_0xb0ba('0x4')](_0xb0ba('0x1e'),_0x3c9cf8['uniqueid']),_0xf345be);}};exports[_0xb0ba('0x1f')]=function(_0x2663ce){try{if(!_[_0xb0ba('0x1a')](_0x2663ce['variable'])&&!_['isNil'](_0x2663ce['variable'][_0xb0ba('0x20')])){utils[_0xb0ba('0x11')](util[_0xb0ba('0x4')](_0xb0ba('0x21'),_0x2663ce[_0xb0ba('0x6')]),_0x2663ce);utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2663ce[_0xb0ba('0x6')],_0x2663ce['variable'],_0x2663ce[_0xb0ba('0x22')]));if(_[_0xb0ba('0x23')](_0x2663ce['value'],_0xb0ba('0x24'))){_0x2663ce[_0xb0ba('0x22')]=_0x2663ce['value']['replace'](_0xb0ba('0x24'),_0xb0ba('0x25'));}if(recordings[_0x2663ce[_0xb0ba('0x1c')]]){var _0x5e9887=_[_0xb0ba('0x26')](recordings[_0x2663ce[_0xb0ba('0x1c')]]['monitors'],{'value':_0x2663ce['value']});if(_[_0xb0ba('0x1a')](_0x5e9887)){recordings[_0x2663ce[_0xb0ba('0x1c')]][_0xb0ba('0x27')]['push']({'value':_0x2663ce[_0xb0ba('0x22')]});}}}}catch(_0x21d948){utils[_0xb0ba('0x18')](util[_0xb0ba('0x4')](_0xb0ba('0x21'),_0x2663ce[_0xb0ba('0x6')]),_0x21d948);}};exports[_0xb0ba('0x28')]=function(_0x1df75a){try{if(!_[_0xb0ba('0x1a')](recordings[_0x1df75a[_0xb0ba('0x6')]])){utils[_0xb0ba('0x11')](util[_0xb0ba('0x4')](_0xb0ba('0x29'),_0x1df75a['uniqueid']),_0x1df75a);utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1df75a[_0xb0ba('0x6')],_0x1df75a[_0xb0ba('0x2a')],_0x1df75a[_0xb0ba('0x2b')],_0x1df75a[_0xb0ba('0x2c')]));recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0x2a')]=_0x1df75a[_0xb0ba('0x2a')];recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0x2b')]=_0x1df75a[_0xb0ba('0x2b')];recordings[_0x1df75a['uniqueid']][_0xb0ba('0x2d')]=_0x1df75a[_0xb0ba('0x2d')];recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0x2e')]=_0x1df75a[_0xb0ba('0x2e')];if(recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0x2f')]==_0xb0ba('0x30')&&recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0xa')]){recordings[_0x1df75a[_0xb0ba('0x6')]]['connectedlinenum']=recordings[_0x1df75a[_0xb0ba('0x6')]][_0xb0ba('0xa')];recordings[_0x1df75a['uniqueid']][_0xb0ba('0x2e')]='';}recordings[_0x1df75a[_0xb0ba('0x6')]]['monitors'][_0xb0ba('0x31')](function(_0x3ce639){var _0x246bf4=_['clone'](recordings[_0x1df75a[_0xb0ba('0x6')]]);_0x246bf4[_0xb0ba('0x22')]=_0x3ce639[_0xb0ba('0x22')];writeDB(_0x246bf4);});delete recordings[_0x1df75a[_0xb0ba('0x6')]];}}catch(_0x54430b){utils[_0xb0ba('0x18')](util[_0xb0ba('0x4')](_0xb0ba('0x29'),_0x1df75a[_0xb0ba('0x6')]),_0x54430b);}};exports[_0xb0ba('0x32')]=function(_0x19ca45){try{if(!_['isNil'](recordings[_0x19ca45[_0xb0ba('0x6')]])){utils[_0xb0ba('0x11')](util['format'](_0xb0ba('0x33'),_0x19ca45[_0xb0ba('0x6')]),_0x19ca45);utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')](_0xb0ba('0x34'),_0x19ca45['uniqueid'],_0x19ca45[_0xb0ba('0x35')],_0x19ca45[_0xb0ba('0x36')]));if(_0x19ca45[_0xb0ba('0x35')][_0xb0ba('0x37')]()=='set'&&_[_0xb0ba('0x38')](_0x19ca45[_0xb0ba('0x36')][_0xb0ba('0x37')](),_0xb0ba('0x39'))){var _0x5cfddd=_0x19ca45[_0xb0ba('0x36')][_0xb0ba('0x3a')]('=');var _0x469811=_0x5cfddd[0x0]['substring'](_0x5cfddd[0x0][_0xb0ba('0x3b')]('(')+0x1,_0x5cfddd[0x0]['lastIndexOf'](')'));var _0x58d64a=_0x5cfddd[0x1];recordings[_0x19ca45[_0xb0ba('0x6')]][_0x469811]=_0x58d64a;}}}catch(_0x150efc){utils[_0xb0ba('0x18')](util[_0xb0ba('0x4')](_0xb0ba('0x33'),_0x19ca45[_0xb0ba('0x6')]),_0x150efc);}};exports['queuecallerjoin']=function(_0x2d915e){try{if(!_[_0xb0ba('0x1a')](recordings[_0x2d915e[_0xb0ba('0x6')]])){utils['debug'](util[_0xb0ba('0x4')](_0xb0ba('0x3c'),_0x2d915e[_0xb0ba('0x6')]),_0x2d915e);utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')](_0xb0ba('0x3d'),_0x2d915e[_0xb0ba('0x6')],_0x2d915e[_0xb0ba('0x3e')]));recordings[_0x2d915e[_0xb0ba('0x6')]]['queue']=_0x2d915e[_0xb0ba('0x3e')];}}catch(_0x595c55){utils[_0xb0ba('0x18')](util['format'](_0xb0ba('0x3c'),_0x2d915e[_0xb0ba('0x6')]),_0x595c55);}};exports[_0xb0ba('0x3f')]=function(_0x47532c){try{utils[_0xb0ba('0x11')](util[_0xb0ba('0x4')]('[%s][recordings][blindtransfer]',_0x47532c[_0xb0ba('0x6')]),_0x47532c);utils[_0xb0ba('0x13')](util[_0xb0ba('0x4')](_0xb0ba('0x40'),_0x47532c[_0xb0ba('0x6')],_0x47532c['transferercalleridnum'],_0x47532c[_0xb0ba('0x41')],_0x47532c[_0xb0ba('0x42')],_0x47532c['transfereecalleridname']));if(recordings[_0x47532c[_0xb0ba('0x43')]]&&transfers[_0xb0ba('0x7')][_0x47532c[_0xb0ba('0x43')]]){transfers[_0xb0ba('0x7')][_0x47532c[_0xb0ba('0x43')]]['recording']=!![];}}catch(_0x583b81){utils[_0xb0ba('0x18')](util['format']('[%s][recordings][blindtransfer]',_0x47532c[_0xb0ba('0x6')]),_0x583b81);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 241b848..e888344 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 _0xfeaf=['transfertargetaccountcode','transfertargetcontext','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfertargetchannel','transfertargetconnectedlinename'];(function(_0x336af2,_0x2287c1){var _0x3f52e9=function(_0x35596b){while(--_0x35596b){_0x336af2['push'](_0x336af2['shift']());}};_0x3f52e9(++_0x2287c1);}(_0xfeaf,0xc0));var _0xffea=function(_0xd636e6,_0x3460c2){_0xd636e6=_0xd636e6-0x0;var _0xf6474d=_0xfeaf[_0xd636e6];return _0xf6474d;};'use strict';var _=require(_0xffea('0x0'));var util=require('util');var utils=require(_0xffea('0x1'));function writeDB(_0x36bb0b){utils[_0xffea('0x2')](util[_0xffea('0x3')](_0xffea('0x4'),_0x36bb0b[_0xffea('0x5')]===_0xffea('0x6')?_0x36bb0b['origtransfereruniqueid']:_0x36bb0b[_0xffea('0x7')],_0x36bb0b[_0xffea('0x5')]));utils[_0xffea('0x8')]('CreateVoiceTransferReport',_0x36bb0b);}exports[_0xffea('0x9')]={};exports[_0xffea('0xa')]=function(_0x247759){try{utils['debug'](util[_0xffea('0x3')](_0xffea('0xb'),_0x247759[_0xffea('0x7')]),_0x247759);utils[_0xffea('0x2')](util[_0xffea('0x3')](_0xffea('0xc'),_0x247759[_0xffea('0x7')],_0x247759[_0xffea('0xd')],_0x247759['transferercalleridname'],_0x247759[_0xffea('0xe')],_0x247759[_0xffea('0xf')]));_0x247759[_0xffea('0x5')]=_0xffea('0x10');exports[_0xffea('0x9')][_0x247759[_0xffea('0x11')]]=_0x247759;writeDB(_0x247759);}catch(_0x1adfee){utils[_0xffea('0x12')](util[_0xffea('0x3')]('[%s][transfers][blindtransfer]',_0x247759[_0xffea('0x7')]),_0x1adfee);}};exports[_0xffea('0x13')]=function(_0x595b3b){try{utils[_0xffea('0x14')](util['format'](_0xffea('0x15'),_0x595b3b['origtransfereruniqueid']),_0x595b3b);utils[_0xffea('0x2')](util[_0xffea('0x3')](_0xffea('0x16'),_0x595b3b[_0xffea('0x17')],_0x595b3b[_0xffea('0x18')],_0x595b3b['origtransferercalleridname'],_0x595b3b[_0xffea('0x19')],_0x595b3b['transfertargetcalleridname']));_0x595b3b=_[_0xffea('0x1a')](_0x595b3b,{'transfererchannel':_0x595b3b[_0xffea('0x1b')],'transferercalleridnum':_0x595b3b[_0xffea('0x18')],'transferercalleridname':_0x595b3b['origtransferercalleridname'],'transfererconnectedlinenum':_0x595b3b[_0xffea('0x1c')],'transfererconnectedlinename':_0x595b3b[_0xffea('0x1d')],'transfereraccountcode':_0x595b3b[_0xffea('0x1e')],'transferercontext':_0x595b3b['secondtransferercontext'],'transfererexten':_0x595b3b[_0xffea('0x1f')],'transfererlinkedid':_0x595b3b[_0xffea('0x20')],'context':_0x595b3b[_0xffea('0x21')],'extension':_0x595b3b['origtransfererexten'],'type':'attended'});if(_['isNil'](_0x595b3b['transfereechannel'])){_0x595b3b=_[_0xffea('0x1a')](_0x595b3b,{'transfereechannel':_0x595b3b[_0xffea('0x22')],'transfereecalleridnum':_0x595b3b[_0xffea('0x19')],'transfereecalleridname':_0x595b3b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x595b3b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x595b3b[_0xffea('0x23')],'transfereeaccountcode':_0x595b3b[_0xffea('0x24')],'transfereecontext':_0x595b3b[_0xffea('0x25')],'transfereeexten':_0x595b3b['transfertargetexten'],'transfereelinkedid':_0x595b3b['transfertargetlinkedid']});}writeDB(_0x595b3b);}catch(_0x1f5751){utils[_0xffea('0x12')](util['format'](_0xffea('0x15'),_0x595b3b['origtransfereruniqueid']),_0x1f5751);}}; \ No newline at end of file +var _0xa592=['type','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname'];(function(_0x522cc7,_0x149ffd){var _0x5f012b=function(_0x4f7ee1){while(--_0x4f7ee1){_0x522cc7['push'](_0x522cc7['shift']());}};_0x5f012b(++_0x149ffd);}(_0xa592,0x19f));var _0x2a59=function(_0x3b4a00,_0x3d9a32){_0x3b4a00=_0x3b4a00-0x0;var _0x5bff71=_0xa592[_0x3b4a00];return _0x5bff71;};'use strict';var _=require(_0x2a59('0x0'));var util=require(_0x2a59('0x1'));var utils=require(_0x2a59('0x2'));function writeDB(_0x22af9b){utils[_0x2a59('0x3')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x22af9b['type']===_0x2a59('0x4')?_0x22af9b[_0x2a59('0x5')]:_0x22af9b[_0x2a59('0x6')],_0x22af9b['type']));utils['request'](_0x2a59('0x7'),_0x22af9b);}exports['blinds']={};exports['blindtransfer']=function(_0x142d51){try{utils[_0x2a59('0x8')](util['format'](_0x2a59('0x9'),_0x142d51[_0x2a59('0x6')]),_0x142d51);utils[_0x2a59('0x3')](util[_0x2a59('0xa')](_0x2a59('0xb'),_0x142d51[_0x2a59('0x6')],_0x142d51[_0x2a59('0xc')],_0x142d51['transferercalleridname'],_0x142d51['transfereecalleridnum'],_0x142d51[_0x2a59('0xd')]));_0x142d51[_0x2a59('0xe')]=_0x2a59('0xf');exports[_0x2a59('0x10')][_0x142d51[_0x2a59('0x11')]]=_0x142d51;writeDB(_0x142d51);}catch(_0x33bbc9){utils[_0x2a59('0x12')](util[_0x2a59('0xa')](_0x2a59('0x9'),_0x142d51[_0x2a59('0x6')]),_0x33bbc9);}};exports[_0x2a59('0x13')]=function(_0x4a3240){try{utils['debug'](util['format'](_0x2a59('0x14'),_0x4a3240[_0x2a59('0x5')]),_0x4a3240);utils[_0x2a59('0x3')](util[_0x2a59('0xa')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4a3240['origtransfereruniqueid'],_0x4a3240[_0x2a59('0x15')],_0x4a3240[_0x2a59('0x16')],_0x4a3240[_0x2a59('0x17')],_0x4a3240[_0x2a59('0x18')]));_0x4a3240=_[_0x2a59('0x19')](_0x4a3240,{'transfererchannel':_0x4a3240[_0x2a59('0x1a')],'transferercalleridnum':_0x4a3240[_0x2a59('0x15')],'transferercalleridname':_0x4a3240[_0x2a59('0x16')],'transfererconnectedlinenum':_0x4a3240[_0x2a59('0x1b')],'transfererconnectedlinename':_0x4a3240[_0x2a59('0x1c')],'transfereraccountcode':_0x4a3240[_0x2a59('0x1d')],'transferercontext':_0x4a3240[_0x2a59('0x1e')],'transfererexten':_0x4a3240[_0x2a59('0x1f')],'transfererlinkedid':_0x4a3240[_0x2a59('0x20')],'context':_0x4a3240[_0x2a59('0x21')],'extension':_0x4a3240['origtransfererexten'],'type':_0x2a59('0x4')});if(_['isNil'](_0x4a3240['transfereechannel'])){_0x4a3240=_[_0x2a59('0x19')](_0x4a3240,{'transfereechannel':_0x4a3240[_0x2a59('0x22')],'transfereecalleridnum':_0x4a3240[_0x2a59('0x17')],'transfereecalleridname':_0x4a3240[_0x2a59('0x18')],'transfereeconnectedlinenum':_0x4a3240[_0x2a59('0x23')],'transfereeconnectedlinename':_0x4a3240[_0x2a59('0x24')],'transfereeaccountcode':_0x4a3240['transfertargetaccountcode'],'transfereecontext':_0x4a3240[_0x2a59('0x25')],'transfereeexten':_0x4a3240[_0x2a59('0x26')],'transfereelinkedid':_0x4a3240['transfertargetlinkedid']});}writeDB(_0x4a3240);}catch(_0x2097e3){utils[_0x2a59('0x12')](util[_0x2a59('0xa')](_0x2a59('0x14'),_0x4a3240[_0x2a59('0x5')]),_0x2097e3);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3740df7..fa40029 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 _0xb1be=['internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser'];(function(_0x4d41a4,_0x153a39){var _0x3df187=function(_0xfbc98f){while(--_0xfbc98f){_0x4d41a4['push'](_0x4d41a4['shift']());}};_0x3df187(++_0x153a39);}(_0xb1be,0x118));var _0xeb1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb1be[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xeb1b('0x0'));var util=require('util');var client=jayson[_0xeb1b('0x1')][_0xeb1b('0x2')]({'port':0x2329});var logger=require(_0xeb1b('0x3'))(_0xeb1b('0x4'));exports[_0xeb1b('0x5')]=function(_0x27ca08,_0x2d9c8){logger[_0xeb1b('0x5')](_0x27ca08,_0x2d9c8?util[_0xeb1b('0x6')](_0x2d9c8,{'showHidden':![],'depth':null}):'');};exports[_0xeb1b('0x7')]=function(_0x3343fe,_0x1e96f3){logger['debug'](_0x3343fe,_0x1e96f3?util['inspect'](_0x1e96f3,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1e2127,_0x4d67da){logger[_0xeb1b('0x8')](_0x1e2127,_0x4d67da?util['inspect'](_0x4d67da,{'showHidden':![],'depth':null}):'');};exports[_0xeb1b('0x9')]=function(_0x3893e4,_0x3ea89d){return client[_0xeb1b('0x9')](_0x3893e4,{'body':_0x3ea89d})[_0xeb1b('0xa')](function(_0x20a307){logger[_0xeb1b('0x7')](_0xeb1b('0xb'),_0x3893e4,_0x20a307?util[_0xeb1b('0x6')](_0x20a307,{'showHidden':![],'depth':null}):'');})[_0xeb1b('0xc')](function(_0x1eec48){logger[_0xeb1b('0x8')](_0xeb1b('0xb'),_0x3893e4,_0x1eec48?util[_0xeb1b('0x6')](_0x1eec48,{'showHidden':![],'depth':null}):'');});};function getUser(_0x18ccdd){return client[_0xeb1b('0x9')](_0xeb1b('0xd'),{'options':{'raw':!![],'attributes':['id',_0xeb1b('0xe'),_0xeb1b('0xf'),'interface'],'where':_0x18ccdd,'limit':0x1}})[_0xeb1b('0xa')](function(_0x1bceeb){logger[_0xeb1b('0x7')](_0xeb1b('0x10'),JSON[_0xeb1b('0x11')](_0x18ccdd),_0x1bceeb?util[_0xeb1b('0x6')](_0x1bceeb,{'showHidden':![],'depth':null}):'');return _0x1bceeb[_0xeb1b('0x12')][_0xeb1b('0x13')]?_0x1bceeb[_0xeb1b('0x12')][0x0]:null;});}exports[_0xeb1b('0x14')]=function(_0x4fe94d){return new BPromise(function(_0x41a405,_0x172435){if(_0x4fe94d){return getUser({'internal':_0x4fe94d})[_0xeb1b('0xa')](function(_0x2d10ab){logger[_0xeb1b('0x5')](_0xeb1b('0x15'),_0x4fe94d,_0x2d10ab?_0xeb1b('0x16'):_0xeb1b('0x17'));return _0x41a405(_0x2d10ab);})[_0xeb1b('0xc')](function(_0x53bd36){logger['error'](_0xeb1b('0x18'),_0x53bd36?util[_0xeb1b('0x6')](_0x53bd36,{'showHidden':![],'depth':null}):'');return _0x41a405(null);});}return _0x41a405(null);});};exports[_0xeb1b('0x19')]=function(_0xc628a9){return new BPromise(function(_0x1c5409,_0x2b4b3b){if(_0xc628a9){return getUser({'interface':_0xc628a9})[_0xeb1b('0xa')](function(_0x325df1){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0xc628a9,_0x325df1?_0xeb1b('0x16'):_0xeb1b('0x17'));return _0x1c5409(_0x325df1);})[_0xeb1b('0xc')](function(_0x21f715){logger[_0xeb1b('0x8')](_0xeb1b('0x1a'),_0x21f715?util['inspect'](_0x21f715,{'showHidden':![],'depth':null}):'');return _0x1c5409(null);});}return _0x1c5409(null);});};exports[_0xeb1b('0x1b')]=function(_0x2912a0){return new BPromise(function(_0x5d1c56,_0x2555ae){if(_0x2912a0){return getUser({'name':_0x2912a0})[_0xeb1b('0xa')](function(_0x400fab){logger['info'](_0xeb1b('0x1c'),_0x2912a0,_0x400fab?_0xeb1b('0x16'):_0xeb1b('0x17'));return _0x5d1c56(_0x400fab);})[_0xeb1b('0xc')](function(_0x59d9af){logger[_0xeb1b('0x8')](_0xeb1b('0x1d'),_0x59d9af?util[_0xeb1b('0x6')](_0x59d9af,{'showHidden':![],'depth':null}):'');return _0x5d1c56(null);});}return _0x5d1c56(null);});};exports[_0xeb1b('0x1e')]=function(_0x25d6e6){return new BPromise(function(_0x574b47,_0x42b9b5){if(_0x25d6e6){return client[_0xeb1b('0x9')](_0xeb1b('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xeb1b('0x20'),'acw','acwTimeout'],'where':{'name':_0x25d6e6},'limit':0x1}})[_0xeb1b('0xa')](function(_0x46b4e4){logger[_0xeb1b('0x7')](_0xeb1b('0x21'),_0x25d6e6,_0x46b4e4?util[_0xeb1b('0x6')](_0x46b4e4,{'showHidden':![],'depth':null}):'');logger['info'](_0xeb1b('0x22'),_0x25d6e6,_0x46b4e4?_0xeb1b('0x16'):_0xeb1b('0x17'));return _0x574b47(_0x46b4e4['result'][_0xeb1b('0x13')]?_0x46b4e4[_0xeb1b('0x12')][0x0]:null);})['catch'](function(_0x33dbc7){logger[_0xeb1b('0x8')](_0xeb1b('0x23'),_0x33dbc7?util['inspect'](_0x33dbc7,{'showHidden':![],'depth':null}):'');return _0x574b47(null);});}return _0x574b47(null);});};exports[_0xeb1b('0x24')]=function(_0xe8607b,_0x320509){return moment(_0xe8607b)[_0xeb1b('0x25')](_0x320509,'seconds')[_0xeb1b('0x26')](_0xeb1b('0x27'));};exports[_0xeb1b('0x28')]=function(_0x75a72c,_0x1c28ee){return moment(_0x75a72c)[_0xeb1b('0x29')](_0x1c28ee,_0xeb1b('0x2a'))[_0xeb1b('0x26')](_0xeb1b('0x27'));};exports[_0xeb1b('0x2b')]=function(_0x54b80c,_0x326f4c){return moment(_0x54b80c)[_0xeb1b('0x2c')](moment(_0x326f4c),_0xeb1b('0x2a'));};exports[_0xeb1b('0x2d')]=function(_0x4fac54,_0x720a9c){return parseInt(_0x4fac54,0xa)+parseInt(_0x720a9c,0xa);};exports[_0xeb1b('0x2e')]=function(){return moment()[_0xeb1b('0x26')](_0xeb1b('0x27'));};exports[_0xeb1b('0x2f')]=function(_0x43e6e9,_0x4a6dba){if(_0x4a6dba){return moment(_0x43e6e9)['isAfter'](_0x4a6dba);}return!![];};exports[_0xeb1b('0x30')]=function(_0x4138fa,_0x41e812){if(_0x41e812){return moment(_0x4138fa)[_0xeb1b('0x30')](_0x41e812);}else if(_0x4138fa){return!![];}return![];}; \ No newline at end of file +var _0xe1b7=['seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','../../config/logger','xdr','info','inspect','debug','request','then','[utils][request]\x20name:%s','GetUser','internal','interface','stringify','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','error','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add'];(function(_0x495fe2,_0x1bc9e4){var _0x1e6bed=function(_0x17023d){while(--_0x17023d){_0x495fe2['push'](_0x495fe2['shift']());}};_0x1e6bed(++_0x1bc9e4);}(_0xe1b7,0x1bb));var _0x7e1b=function(_0xb8a63a,_0x3f90ac){_0xb8a63a=_0xb8a63a-0x0;var _0x3e8367=_0xe1b7[_0xb8a63a];return _0x3e8367;};'use strict';var BPromise=require(_0x7e1b('0x0'));var jayson=require('jayson/promise');var moment=require(_0x7e1b('0x1'));var util=require(_0x7e1b('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x7e1b('0x3'))(_0x7e1b('0x4'));exports[_0x7e1b('0x5')]=function(_0x53322e,_0x1d7c28){logger[_0x7e1b('0x5')](_0x53322e,_0x1d7c28?util[_0x7e1b('0x6')](_0x1d7c28,{'showHidden':![],'depth':null}):'');};exports[_0x7e1b('0x7')]=function(_0x46a4e7,_0x3abe2b){logger[_0x7e1b('0x7')](_0x46a4e7,_0x3abe2b?util[_0x7e1b('0x6')](_0x3abe2b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x1a173e,_0x2b6ec6){logger['error'](_0x1a173e,_0x2b6ec6?util[_0x7e1b('0x6')](_0x2b6ec6,{'showHidden':![],'depth':null}):'');};exports[_0x7e1b('0x8')]=function(_0x27f97,_0x4ff852){return client[_0x7e1b('0x8')](_0x27f97,{'body':_0x4ff852})[_0x7e1b('0x9')](function(_0x735311){logger['debug'](_0x7e1b('0xa'),_0x27f97,_0x735311?util[_0x7e1b('0x6')](_0x735311,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5f5dc1){logger['error'](_0x7e1b('0xa'),_0x27f97,_0x5f5dc1?util[_0x7e1b('0x6')](_0x5f5dc1,{'showHidden':![],'depth':null}):'');});};function getUser(_0x22291f){return client[_0x7e1b('0x8')](_0x7e1b('0xb'),{'options':{'raw':!![],'attributes':['id',_0x7e1b('0xc'),'name',_0x7e1b('0xd')],'where':_0x22291f,'limit':0x1}})[_0x7e1b('0x9')](function(_0x5c9a0b){logger[_0x7e1b('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x7e1b('0xe')](_0x22291f),_0x5c9a0b?util[_0x7e1b('0x6')](_0x5c9a0b,{'showHidden':![],'depth':null}):'');return _0x5c9a0b['result'][_0x7e1b('0xf')]?_0x5c9a0b[_0x7e1b('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0x4d17e4){return new BPromise(function(_0x587a7a,_0x1fb132){if(_0x4d17e4){return getUser({'internal':_0x4d17e4})[_0x7e1b('0x9')](function(_0x12c005){logger[_0x7e1b('0x5')](_0x7e1b('0x11'),_0x4d17e4,_0x12c005?_0x7e1b('0x12'):'notfound');return _0x587a7a(_0x12c005);})[_0x7e1b('0x13')](function(_0x3f5e01){logger[_0x7e1b('0x14')](_0x7e1b('0x15'),_0x3f5e01?util[_0x7e1b('0x6')](_0x3f5e01,{'showHidden':![],'depth':null}):'');return _0x587a7a(null);});}return _0x587a7a(null);});};exports[_0x7e1b('0x16')]=function(_0x513e97){return new BPromise(function(_0x496727,_0x325328){if(_0x513e97){return getUser({'interface':_0x513e97})['then'](function(_0x6c7f3c){logger[_0x7e1b('0x5')](_0x7e1b('0x17'),_0x513e97,_0x6c7f3c?'found':_0x7e1b('0x18'));return _0x496727(_0x6c7f3c);})[_0x7e1b('0x13')](function(_0x1740cc){logger[_0x7e1b('0x14')](_0x7e1b('0x19'),_0x1740cc?util[_0x7e1b('0x6')](_0x1740cc,{'showHidden':![],'depth':null}):'');return _0x496727(null);});}return _0x496727(null);});};exports[_0x7e1b('0x1a')]=function(_0x47901d){return new BPromise(function(_0x190416,_0x6bd621){if(_0x47901d){return getUser({'name':_0x47901d})['then'](function(_0x12cc87){logger['info'](_0x7e1b('0x1b'),_0x47901d,_0x12cc87?'found':_0x7e1b('0x18'));return _0x190416(_0x12cc87);})[_0x7e1b('0x13')](function(_0x3efd52){logger['error'](_0x7e1b('0x1c'),_0x3efd52?util[_0x7e1b('0x6')](_0x3efd52,{'showHidden':![],'depth':null}):'');return _0x190416(null);});}return _0x190416(null);});};exports[_0x7e1b('0x1d')]=function(_0x31b4bd){return new BPromise(function(_0x2ad18c,_0x3cc850){if(_0x31b4bd){return client[_0x7e1b('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x7e1b('0x1e'),_0x7e1b('0x1f'),_0x7e1b('0x20'),'acwTimeout'],'where':{'name':_0x31b4bd},'limit':0x1}})['then'](function(_0x4acede){logger['debug'](_0x7e1b('0x21'),_0x31b4bd,_0x4acede?util[_0x7e1b('0x6')](_0x4acede,{'showHidden':![],'depth':null}):'');logger[_0x7e1b('0x5')](_0x7e1b('0x22'),_0x31b4bd,_0x4acede?_0x7e1b('0x12'):_0x7e1b('0x18'));return _0x2ad18c(_0x4acede[_0x7e1b('0x10')][_0x7e1b('0xf')]?_0x4acede[_0x7e1b('0x10')][0x0]:null);})['catch'](function(_0x418629){logger[_0x7e1b('0x14')]('[utils][getVoiceQueueByName]',_0x418629?util[_0x7e1b('0x6')](_0x418629,{'showHidden':![],'depth':null}):'');return _0x2ad18c(null);});}return _0x2ad18c(null);});};exports[_0x7e1b('0x23')]=function(_0x2f2281,_0x5de73c){return moment(_0x2f2281)[_0x7e1b('0x24')](_0x5de73c,_0x7e1b('0x25'))['format'](_0x7e1b('0x26'));};exports[_0x7e1b('0x27')]=function(_0x44edab,_0x38a001){return moment(_0x44edab)[_0x7e1b('0x28')](_0x38a001,_0x7e1b('0x25'))[_0x7e1b('0x29')](_0x7e1b('0x26'));};exports[_0x7e1b('0x2a')]=function(_0x99583b,_0x350951){return moment(_0x99583b)[_0x7e1b('0x2b')](moment(_0x350951),_0x7e1b('0x25'));};exports[_0x7e1b('0x2c')]=function(_0x5bbaeb,_0x460e91){return parseInt(_0x5bbaeb,0xa)+parseInt(_0x460e91,0xa);};exports[_0x7e1b('0x2d')]=function(){return moment()[_0x7e1b('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7e1b('0x2e')]=function(_0x1239d7,_0x121763){if(_0x121763){return moment(_0x1239d7)[_0x7e1b('0x2e')](_0x121763);}return!![];};exports[_0x7e1b('0x2f')]=function(_0x12f7f1,_0x5a8ca7){if(_0x5a8ca7){return moment(_0x12f7f1)['isBefore'](_0x5a8ca7);}else if(_0x12f7f1){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 2c8e839..d38e8be 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x71ae=['maskSensitiveData','join','/var','xcally','client','role','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','client-side-logger','logger','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','url','statusCode','name','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','./loggers','fileLogger','./safe-template','safeTemplate'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0x71ae,0x83));var _0xe71a=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0x71ae[_0x456b57];return _0x18f49f;};var fs=require(_0xe71a('0x0'));var _=require(_0xe71a('0x1'));var ewinston=require(_0xe71a('0x2'));var path=require('path');var util=require('util');var fileLogger=require(_0xe71a('0x3'))[_0xe71a('0x4')];var safeTemplate=require(_0xe71a('0x5'))[_0xe71a('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0xe71a('0x7')];function ClientSideLogger(){function _0x23ce19(_0x1ed31c){var _0x100dd0=path[_0xe71a('0x8')](_0xe71a('0x9'),'log',_0xe71a('0xa'));var _0x434cc4=path['join'](_0xe71a('0xb'),_0x1ed31c[_0xe71a('0xc')]+'-'+_0x1ed31c['name']);return fs[_0xe71a('0xd')](path['join'](_0x100dd0,_0x434cc4))[_0xe71a('0xe')](function(){var _0x5263d8=fileLogger(_0xe71a('0xb'),path[_0xe71a('0x8')](_0x100dd0,_0x434cc4));return _0x5263d8;})[_0xe71a('0xf')](function(_0x2270bf){throw _0x2270bf;});}this['log']=function(_0x4a500f,_0x5c35a3,_0x401867,_0x5bf63c){return _0x23ce19(_0x4a500f[_0xe71a('0x10')])[_0xe71a('0xe')](function(_0x1550e){var _0x5c3220=_0x1550e[_0x5c35a3];return _0x5c3220;})[_0xe71a('0xe')](function(_0x5cffbe){var _0x4fda07=_0x4a500f[_0xe71a('0x10')]?_0x4a500f[_0xe71a('0x10')]['id']:_0xe71a('0x11');var _0x1d7a35=_0x5bf63c[_0xe71a('0x12')];var _0x4b0d19=_0x5bf63c[_0xe71a('0x13')];var _0x385d80=new Date(Number(_0x4b0d19));return _0x5cffbe(_0x4fda07,_0x385d80,_0x401867,_0x1d7a35);})['catch'](function(_0xcc9566){fileLogger('client')[_0xe71a('0x14')](_0xcc9566);});};}function setupLoggers(_0x19b5e5){return new Promise(function(_0x5429c4){var _0x5aa795=new ClientSideLogger();var _0x2bd452=fileLogger(_0xe71a('0x15'));var _0x40ba8d=fileLogger(_0xe71a('0x16'));_0x19b5e5['set'](_0xe71a('0x17'),_0x5aa795);_0x19b5e5['use'](ewinston[_0xe71a('0x18')]({'winstonInstance':_0x2bd452,'meta':![],'statusLevels':!![],'msg':function(_0x5c02e4,_0x1da86c){var _0x453c26='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x5c02e4[_0xe71a('0x19')])){_0x453c26+=_0xe71a('0x1a');var _0x153e03=_0x5c02e4[_0xe71a('0x19')];maskSensitiveData(_0x153e03);}return safeTemplate(util[_0xe71a('0x1b')](_0x453c26,_0x5c02e4[_0xe71a('0x1c')],_0x5c02e4[_0xe71a('0x1d')][_0xe71a('0x1e')]?_0x5c02e4[_0xe71a('0x1d')][_0xe71a('0x1e')]:_0x5c02e4[_0xe71a('0x1f')][_0xe71a('0x20')]||_0x5c02e4['ip'],_0x5c02e4['url'],_0x1da86c['statusCode'],_0x1da86c[_0xe71a('0x21')],_0x5c02e4['user']?_0x5c02e4['user']['id']:null,_0x5c02e4[_0xe71a('0x10')]?_0x5c02e4['user']['name']:null,_0x5c02e4[_0xe71a('0x10')]?_0x5c02e4['user']['role']:null,_0x153e03?util['inspect'](_0x153e03,![],null):''));}}));_0x19b5e5[_0xe71a('0x22')](ewinston['logger']({'winstonInstance':_0x40ba8d,'meta':![],'statusLevels':!![],'msg':function(_0x49fc19,_0x4dfeaa){var _0x318f42=_0xe71a('0x23');if(_0x49fc19[_0xe71a('0x19')]&&_0x49fc19[_0xe71a('0x19')]['device']&&_0x49fc19[_0xe71a('0x19')][_0xe71a('0x24')]){_0x318f42=_0xe71a('0x25');}return util[_0xe71a('0x1b')](_0x318f42,_0x49fc19[_0xe71a('0x1c')],_0x49fc19[_0xe71a('0x1d')][_0xe71a('0x1e')]?_0x49fc19[_0xe71a('0x1d')][_0xe71a('0x1e')]:_0x49fc19[_0xe71a('0x1f')][_0xe71a('0x20')]||_0x49fc19['ip'],_0x49fc19[_0xe71a('0x26')],_0x4dfeaa[_0xe71a('0x27')],_0x4dfeaa[_0xe71a('0x21')],_0x49fc19[_0xe71a('0x10')]?_0x49fc19['user']['id']:null,_0x49fc19[_0xe71a('0x10')]?_0x49fc19[_0xe71a('0x10')][_0xe71a('0x28')]:null,_0x49fc19[_0xe71a('0x10')]?_0x49fc19[_0xe71a('0x10')][_0xe71a('0xc')]:null,_0x49fc19[_0xe71a('0x19')]&&_0x49fc19[_0xe71a('0x19')]['device']?_0x49fc19[_0xe71a('0x19')][_0xe71a('0x29')]:_0xe71a('0x2a'),_0x49fc19[_0xe71a('0x19')]&&_0x49fc19['body']['agent_id']?_0x49fc19[_0xe71a('0x19')]['agent_id']:'',_0x49fc19[_0xe71a('0x19')]&&_0x49fc19[_0xe71a('0x19')]['agent_name']?_0x49fc19['body'][_0xe71a('0x2b')]:'');},'ignoreRoute':function(_0x1b9ff1){var _0xed3250=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xed3250[_0xe71a('0x2c')](_0x1b9ff1['url']);}}));return _0x5429c4();});}exports[_0xe71a('0x2d')]=setupLoggers; \ No newline at end of file +var _0xd237=['%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','agent_name','test','fs-extra','lodash','express-winston','util','./loggers','fileLogger','safeTemplate','maskSensitiveData','join','/var','log','xcally','client','name','then','catch','user','no-user','data','timestamp','error','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','role','inspect'];(function(_0x3e3be2,_0x3a506a){var _0x43ada0=function(_0x249cb3){while(--_0x249cb3){_0x3e3be2['push'](_0x3e3be2['shift']());}};_0x43ada0(++_0x3a506a);}(_0xd237,0x19b));var _0x7d23=function(_0x4a1fa5,_0x251f61){_0x4a1fa5=_0x4a1fa5-0x0;var _0x27fd7c=_0xd237[_0x4a1fa5];return _0x27fd7c;};var fs=require(_0x7d23('0x0'));var _=require(_0x7d23('0x1'));var ewinston=require(_0x7d23('0x2'));var path=require('path');var util=require(_0x7d23('0x3'));var fileLogger=require(_0x7d23('0x4'))[_0x7d23('0x5')];var safeTemplate=require('./safe-template')[_0x7d23('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0x7d23('0x7')];function ClientSideLogger(){function _0x2cfb80(_0x564326){var _0x3e7852=path[_0x7d23('0x8')](_0x7d23('0x9'),_0x7d23('0xa'),_0x7d23('0xb'));var _0x3e0af8=path[_0x7d23('0x8')](_0x7d23('0xc'),_0x564326['role']+'-'+_0x564326[_0x7d23('0xd')]);return fs['ensureDir'](path[_0x7d23('0x8')](_0x3e7852,_0x3e0af8))[_0x7d23('0xe')](function(){var _0x316dbd=fileLogger(_0x7d23('0xc'),path[_0x7d23('0x8')](_0x3e7852,_0x3e0af8));return _0x316dbd;})[_0x7d23('0xf')](function(_0xb410e){throw _0xb410e;});}this[_0x7d23('0xa')]=function(_0x28c7d6,_0x1d6470,_0x1b3fcf,_0x438ed5){return _0x2cfb80(_0x28c7d6['user'])[_0x7d23('0xe')](function(_0xf40508){var _0x55c003=_0xf40508[_0x1d6470];return _0x55c003;})[_0x7d23('0xe')](function(_0x480126){var _0x1190bf=_0x28c7d6[_0x7d23('0x10')]?_0x28c7d6[_0x7d23('0x10')]['id']:_0x7d23('0x11');var _0x932b8c=_0x438ed5[_0x7d23('0x12')];var _0x12ee9e=_0x438ed5[_0x7d23('0x13')];var _0x3bb48c=new Date(Number(_0x12ee9e));return _0x480126(_0x1190bf,_0x3bb48c,_0x1b3fcf,_0x932b8c);})[_0x7d23('0xf')](function(_0x106b59){fileLogger(_0x7d23('0xc'))[_0x7d23('0x14')](_0x106b59);});};}function setupLoggers(_0x32be5c){return new Promise(function(_0xb06b2a){var _0x3443d6=new ClientSideLogger();var _0x36703c=fileLogger('api');var _0x1160bf=fileLogger(_0x7d23('0x15'));_0x32be5c[_0x7d23('0x16')](_0x7d23('0x17'),_0x3443d6);_0x32be5c[_0x7d23('0x18')](ewinston[_0x7d23('0x19')]({'winstonInstance':_0x36703c,'meta':![],'statusLevels':!![],'msg':function(_0x3d842c,_0x3b6832){var _0x479a30=_0x7d23('0x1a');if(!_[_0x7d23('0x1b')](_0x3d842c[_0x7d23('0x1c')])){_0x479a30+=_0x7d23('0x1d');var _0x19eea2=_0x3d842c[_0x7d23('0x1c')];maskSensitiveData(_0x19eea2);}return safeTemplate(util['format'](_0x479a30,_0x3d842c[_0x7d23('0x1e')],_0x3d842c[_0x7d23('0x1f')][_0x7d23('0x20')]?_0x3d842c['headers'][_0x7d23('0x20')]:_0x3d842c[_0x7d23('0x21')][_0x7d23('0x22')]||_0x3d842c['ip'],_0x3d842c[_0x7d23('0x23')],_0x3b6832[_0x7d23('0x24')],_0x3b6832['responseTime'],_0x3d842c['user']?_0x3d842c[_0x7d23('0x10')]['id']:null,_0x3d842c['user']?_0x3d842c['user']['name']:null,_0x3d842c[_0x7d23('0x10')]?_0x3d842c['user'][_0x7d23('0x25')]:null,_0x19eea2?util[_0x7d23('0x26')](_0x19eea2,![],null):''));}}));_0x32be5c['use'](ewinston[_0x7d23('0x19')]({'winstonInstance':_0x1160bf,'meta':![],'statusLevels':!![],'msg':function(_0x1a16d2,_0x5ee9d8){var _0x3e40c9=_0x7d23('0x27');if(_0x1a16d2[_0x7d23('0x1c')]&&_0x1a16d2['body']['device']&&_0x1a16d2['body'][_0x7d23('0x28')]){_0x3e40c9=_0x7d23('0x29');}return util['format'](_0x3e40c9,_0x1a16d2[_0x7d23('0x1e')],_0x1a16d2[_0x7d23('0x1f')]['x-forwarded-for']?_0x1a16d2[_0x7d23('0x1f')]['x-forwarded-for']:_0x1a16d2[_0x7d23('0x21')]['remoteAddress']||_0x1a16d2['ip'],_0x1a16d2[_0x7d23('0x23')],_0x5ee9d8['statusCode'],_0x5ee9d8['responseTime'],_0x1a16d2['user']?_0x1a16d2[_0x7d23('0x10')]['id']:null,_0x1a16d2['user']?_0x1a16d2[_0x7d23('0x10')][_0x7d23('0xd')]:null,_0x1a16d2[_0x7d23('0x10')]?_0x1a16d2[_0x7d23('0x10')][_0x7d23('0x25')]:null,_0x1a16d2[_0x7d23('0x1c')]&&_0x1a16d2[_0x7d23('0x1c')][_0x7d23('0x2a')]?_0x1a16d2[_0x7d23('0x1c')][_0x7d23('0x2a')]:'other',_0x1a16d2[_0x7d23('0x1c')]&&_0x1a16d2[_0x7d23('0x1c')]['agent_id']?_0x1a16d2[_0x7d23('0x1c')]['agent_id']:'',_0x1a16d2[_0x7d23('0x1c')]&&_0x1a16d2['body'][_0x7d23('0x2b')]?_0x1a16d2[_0x7d23('0x1c')][_0x7d23('0x2b')]:'');},'ignoreRoute':function(_0x48a2b0){var _0x420eb5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x420eb5[_0x7d23('0x2c')](_0x48a2b0[_0x7d23('0x23')]);}}));return _0xb06b2a();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index c58f2e2..03a17c8 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cab=['slice','concat','circularDoWInterval','toLowerCase','exports','circularMonthInterval','clone','hours','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','max','min','domCompare','MMM','monthCompare','guess','test','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','split','locale','weekdaysShort','indexOf'];(function(_0x3b880d,_0x3afd8f){var _0x3f902c=function(_0x321ca9){while(--_0x321ca9){_0x3b880d['push'](_0x3b880d['shift']());}};_0x3f902c(++_0x3afd8f);}(_0x7cab,0x107));var _0xb7ca=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x7cab[_0xe45118];return _0x15e15d;};var _=require(_0xb7ca('0x0'));var moment=require(_0xb7ca('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xb7ca('0x2')](function(_0x103498){return _0x103498[_0xb7ca('0x3')];})[_0xb7ca('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb7ca('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x4d483c){if(!_0x4d483c['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x417a97){var _0xb8281=_0x417a97[_0xb7ca('0x6')](':')[_0xb7ca('0x2')](function(_0x1b1ebc){return parseInt(_0x1b1ebc,0xa);});var _0x2b96f4=_0xb8281[0x0];var _0x32f839=_0xb8281[0x1];if(_0x2b96f4<0x0||_0x2b96f4>0x17||_0x32f839<0x0||_0x32f839>0x3b){throw new Error(EINVALID_DATE);}return[_0x2b96f4,_0x32f839];}function circularDoWInterval(_0x8de28a,_0x4b766a){if(_0x8de28a===_0x4b766a){return[_0x8de28a];}else{var _0x297947=moment[_0xb7ca('0x7')]();moment[_0xb7ca('0x7')]('en');var _0x5cd34c=moment[_0xb7ca('0x8')]()['map'](function(_0x42dc95){return _0x42dc95['toLowerCase']();});moment[_0xb7ca('0x7')](_0x297947);var _0x80503f=_0x5cd34c[_0xb7ca('0x9')](_0x8de28a);var _0x4a1d2a=_0x5cd34c['indexOf'](_0x4b766a);if(_0x4a1d2a>_0x80503f){return _0x5cd34c[_0xb7ca('0xa')](_0x80503f,_0x4a1d2a+0x1);}else{var _0x47ec3d=_0x5cd34c[_0xb7ca('0xa')](0x0,_0x4a1d2a+0x1);var _0x213af9=_0x5cd34c[_0xb7ca('0xa')](_0x80503f);return _0x213af9[_0xb7ca('0xb')](_0x47ec3d);}}}module['exports'][_0xb7ca('0xc')]=circularDoWInterval;function circularMonthInterval(_0xda50c7,_0x3919c4){if(_0xda50c7===_0x3919c4){return[_0xda50c7];}else{var _0x1d3956=moment[_0xb7ca('0x7')]();moment['locale']('en');var _0x4e9bd6=moment['monthsShort']()[_0xb7ca('0x2')](function(_0x571da9){return _0x571da9[_0xb7ca('0xd')]();});moment[_0xb7ca('0x7')](_0x1d3956);var _0xdf8ce=_0x4e9bd6[_0xb7ca('0x9')](_0xda50c7);var _0x373fd0=_0x4e9bd6[_0xb7ca('0x9')](_0x3919c4);if(_0x373fd0>_0xdf8ce){return _0x4e9bd6[_0xb7ca('0xa')](_0xdf8ce,_0x373fd0+0x1);}else{var _0x13623b=_0x4e9bd6[_0xb7ca('0xa')](0x0,_0x373fd0+0x1);var _0x312ce8=_0x4e9bd6['slice'](_0xdf8ce);return _0x312ce8[_0xb7ca('0xb')](_0x13623b);}}}module[_0xb7ca('0xe')][_0xb7ca('0xf')]=circularMonthInterval;function parseDom(_0x39b943){var _0x46370e=parseInt(_0x39b943,0xa);if(_0x46370e<0x1||_0x46370e>0x1f){throw new Error(EINVALID_DATE);}return _0x46370e;}function timeCompare(_0x3bee1a,_0x37be77,_0x535499){var _0x4f88fc=_0x3bee1a[_0xb7ca('0x10')]();var _0x537003=extractTime(_0x37be77);var _0x2570bd=_0x537003[0x0];var _0x7160c7=_0x537003[0x1];var _0x1ad7d8=_0x3bee1a['clone']()[_0xb7ca('0x11')](_0x2570bd)['minutes'](_0x7160c7);throwIfDateNotValid(_0x1ad7d8);var _0x5b0271=extractTime(_0x535499);var _0x84a277=_0x5b0271[0x0];var _0x360e58=_0x5b0271[0x1];var _0x4cc4f2=_0x3bee1a['clone']()[_0xb7ca('0x11')](_0x84a277)['minutes'](_0x360e58);throwIfDateNotValid(_0x4cc4f2);if(_0x4cc4f2[_0xb7ca('0x12')](_0x1ad7d8)){var _0xc020b4=_0x4f88fc[_0xb7ca('0x10')]()[_0xb7ca('0x13')](_0xb7ca('0x14'));var _0xa24331=_0x4f88fc[_0xb7ca('0x10')]()[_0xb7ca('0x15')]('day');return _0x4f88fc['isBetween'](_0x1ad7d8,_0xa24331,undefined,'[]')||_0x4f88fc[_0xb7ca('0x16')](_0xc020b4,_0x4cc4f2,undefined,'[]');}else{return _0x4f88fc[_0xb7ca('0x16')](_0x1ad7d8,_0x4cc4f2,undefined,'[]');}}module[_0xb7ca('0xe')][_0xb7ca('0x17')]=timeCompare;function dowCompare(_0x4d9b44,_0x9b4613,_0x421b81){var _0x11f48a=_0x4d9b44[_0xb7ca('0x7')]('en')[_0xb7ca('0x18')](_0xb7ca('0x19'))[_0xb7ca('0xd')]();return circularDoWInterval(_0x9b4613,_0x421b81)[_0xb7ca('0x1a')](_0x11f48a);}module[_0xb7ca('0xe')][_0xb7ca('0x1b')]=dowCompare;function domCompare(_0x59a441,_0x4a0d47,_0x491dcb){var _0x48c5bb=_0x59a441[_0xb7ca('0x1c')]();if(_0x4a0d47===_0x491dcb){return _0x48c5bb===_0x4a0d47;}else{var _0x22bf1a=_0x59a441['daysInMonth']();var _0x116a2b=_0x4a0d47<_0x491dcb;let _0x4220a9=![];var _0x53f5b4=0x0;var _0x556e44=0x0;if(_0x116a2b){_0x53f5b4=Math[_0xb7ca('0x1d')](0x1,_0x4a0d47);_0x556e44=Math['min'](_0x491dcb,_0x22bf1a);_0x4220a9=_0x48c5bb>=_0x53f5b4&&_0x48c5bb<=_0x556e44;}else{_0x53f5b4=Math[_0xb7ca('0x1e')](_0x4a0d47,_0x22bf1a);_0x556e44=Math[_0xb7ca('0x1d')](0x1,_0x491dcb);_0x4220a9=_0x48c5bb>=_0x53f5b4||_0x48c5bb<=_0x556e44;}return _0x4220a9;}}module[_0xb7ca('0xe')][_0xb7ca('0x1f')]=domCompare;function monthCompare(_0x37da4f,_0x129a4b,_0x5445ec){var _0x1e58d1=_0x37da4f[_0xb7ca('0x7')]('en')[_0xb7ca('0x18')](_0xb7ca('0x20'))[_0xb7ca('0xd')]();return circularMonthInterval(_0x129a4b,_0x5445ec)[_0xb7ca('0x1a')](_0x1e58d1);}module[_0xb7ca('0xe')][_0xb7ca('0x21')]=monthCompare;function iftime(_0x173ce2,_0x1f43e7=moment['tz'][_0xb7ca('0x22')](),_0x9332b6=moment()){if(!validateRx[_0xb7ca('0x23')](_0x173ce2)){throw new Error(EINVALID_STRING);}else{var _0x18e191=(moment['isMoment'](_0x9332b6)?_0x9332b6[_0xb7ca('0x10')]():moment(_0x9332b6))['tz'](_0x1f43e7)[_0xb7ca('0x7')]('en');throwIfDateNotValid(_0x18e191);var _0x353eb4=_0x173ce2[_0xb7ca('0x6')](',');var _0x528ac4=_0x353eb4[0x0];var _0x2b6394=_0x353eb4[0x1];var _0x482d84=_0x353eb4[0x2];var _0x5e291c=_0x353eb4[0x3];let _0x3bc2e2=!![];if(_0x528ac4!=='*'){var _0x2b701a=_0x528ac4[_0xb7ca('0x6')]('-');var _0x3a0b58=_['padStart'](_0x2b701a[0x0],0x5,'0');var _0x46eee3=_0x2b701a['length']===0x2?_[_0xb7ca('0x24')](_0x2b701a[0x1],0x5,'0'):_0x3a0b58;_0x3bc2e2=timeCompare(_0x18e191,_0x3a0b58,_0x46eee3);}let _0x1b2524=!![];if(_0x2b6394!=='*'){var _0x358d2c=_0x2b6394['split']('-');var _0x53c52c=_0x358d2c[0x0];var _0x123723=_0x358d2c[_0xb7ca('0x25')]===0x2?_0x358d2c[0x1]:_0x53c52c;_0x1b2524=dowCompare(_0x18e191,_0x53c52c,_0x123723);}let _0x441d14=!![];if(_0x482d84!=='*'){var _0x5104fa=_0x482d84[_0xb7ca('0x6')]('-');var _0x29b957=parseDom(_0x5104fa[0x0]);var _0x3cde08=_0x5104fa['length']===0x2?parseDom(_0x5104fa[0x1]):_0x29b957;_0x441d14=domCompare(_0x18e191,_0x29b957,_0x3cde08);}let _0x666997=!![];if(_0x5e291c!=='*'){var _0x42c174=_0x5e291c[_0xb7ca('0x6')]('-');var _0x3153cb=_0x42c174[0x0];var _0x299ceb=_0x42c174[_0xb7ca('0x25')]===0x2?_0x42c174[0x1]:_0x42c174[0x0];_0x666997=monthCompare(_0x18e191,_0x3153cb,_0x299ceb);}return _0x3bc2e2&&_0x1b2524&&_0x441d14&&_0x666997;}}module[_0xb7ca('0xe')][_0xb7ca('0x26')]=iftime; \ No newline at end of file +var _0x0184=['startOf','endOf','day','isBetween','timeCompare','format','ddd','includes','dowCompare','daysInMonth','min','max','domCompare','MMM','monthCompare','guess','test','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','monthsShort','concat','clone','hours','minutes','isBefore'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x0184,0xb8));var _0x4018=function(_0xcd9ec8,_0x27699f){_0xcd9ec8=_0xcd9ec8-0x0;var _0x5aa31b=_0x0184[_0xcd9ec8];return _0x5aa31b;};var _=require(_0x4018('0x0'));var moment=require(_0x4018('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x51844a){return _0x51844a[_0x4018('0x2')];})[_0x4018('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x4018('0x4');var EINVALID_DATE=_0x4018('0x5');function throwIfDateNotValid(_0x1e8770){if(!_0x1e8770['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x2dd7d9){var _0xe582de=_0x2dd7d9[_0x4018('0x6')](':')[_0x4018('0x7')](function(_0x3d5295){return parseInt(_0x3d5295,0xa);});var _0x4d1a54=_0xe582de[0x0];var _0x4577e3=_0xe582de[0x1];if(_0x4d1a54<0x0||_0x4d1a54>0x17||_0x4577e3<0x0||_0x4577e3>0x3b){throw new Error(EINVALID_DATE);}return[_0x4d1a54,_0x4577e3];}function circularDoWInterval(_0x509d17,_0x476700){if(_0x509d17===_0x476700){return[_0x509d17];}else{var _0x4bc549=moment['locale']();moment[_0x4018('0x8')]('en');var _0x595d25=moment[_0x4018('0x9')]()[_0x4018('0x7')](function(_0x3fc004){return _0x3fc004[_0x4018('0xa')]();});moment[_0x4018('0x8')](_0x4bc549);var _0xac4879=_0x595d25[_0x4018('0xb')](_0x509d17);var _0x346440=_0x595d25['indexOf'](_0x476700);if(_0x346440>_0xac4879){return _0x595d25[_0x4018('0xc')](_0xac4879,_0x346440+0x1);}else{var _0x131d34=_0x595d25['slice'](0x0,_0x346440+0x1);var _0x3bf19a=_0x595d25['slice'](_0xac4879);return _0x3bf19a['concat'](_0x131d34);}}}module[_0x4018('0xd')][_0x4018('0xe')]=circularDoWInterval;function circularMonthInterval(_0x15fa20,_0x38c2fe){if(_0x15fa20===_0x38c2fe){return[_0x15fa20];}else{var _0x211ae3=moment[_0x4018('0x8')]();moment['locale']('en');var _0x4f7ca2=moment[_0x4018('0xf')]()[_0x4018('0x7')](function(_0x440443){return _0x440443[_0x4018('0xa')]();});moment[_0x4018('0x8')](_0x211ae3);var _0x73b5d5=_0x4f7ca2['indexOf'](_0x15fa20);var _0x149d0e=_0x4f7ca2[_0x4018('0xb')](_0x38c2fe);if(_0x149d0e>_0x73b5d5){return _0x4f7ca2['slice'](_0x73b5d5,_0x149d0e+0x1);}else{var _0x4ee1cc=_0x4f7ca2[_0x4018('0xc')](0x0,_0x149d0e+0x1);var _0x32905e=_0x4f7ca2[_0x4018('0xc')](_0x73b5d5);return _0x32905e[_0x4018('0x10')](_0x4ee1cc);}}}module[_0x4018('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0xb6d9fc){var _0x24e50e=parseInt(_0xb6d9fc,0xa);if(_0x24e50e<0x1||_0x24e50e>0x1f){throw new Error(EINVALID_DATE);}return _0x24e50e;}function timeCompare(_0xc3266,_0x1df959,_0x272c06){var _0x2e7636=_0xc3266[_0x4018('0x11')]();var _0x56170b=extractTime(_0x1df959);var _0xc6dfca=_0x56170b[0x0];var _0x2aaf63=_0x56170b[0x1];var _0x33a85a=_0xc3266[_0x4018('0x11')]()[_0x4018('0x12')](_0xc6dfca)[_0x4018('0x13')](_0x2aaf63);throwIfDateNotValid(_0x33a85a);var _0x33a25d=extractTime(_0x272c06);var _0x4fbf90=_0x33a25d[0x0];var _0x1e4daf=_0x33a25d[0x1];var _0x480302=_0xc3266[_0x4018('0x11')]()['hours'](_0x4fbf90)[_0x4018('0x13')](_0x1e4daf);throwIfDateNotValid(_0x480302);if(_0x480302[_0x4018('0x14')](_0x33a85a)){var _0x158913=_0x2e7636['clone']()[_0x4018('0x15')]('day');var _0x771fa4=_0x2e7636[_0x4018('0x11')]()[_0x4018('0x16')](_0x4018('0x17'));return _0x2e7636[_0x4018('0x18')](_0x33a85a,_0x771fa4,undefined,'[]')||_0x2e7636['isBetween'](_0x158913,_0x480302,undefined,'[]');}else{return _0x2e7636[_0x4018('0x18')](_0x33a85a,_0x480302,undefined,'[]');}}module[_0x4018('0xd')][_0x4018('0x19')]=timeCompare;function dowCompare(_0x44588e,_0x157425,_0x15fad9){var _0xe33430=_0x44588e['locale']('en')[_0x4018('0x1a')](_0x4018('0x1b'))[_0x4018('0xa')]();return circularDoWInterval(_0x157425,_0x15fad9)[_0x4018('0x1c')](_0xe33430);}module[_0x4018('0xd')][_0x4018('0x1d')]=dowCompare;function domCompare(_0x23796a,_0x481fe9,_0x116775){var _0x3f7d23=_0x23796a['date']();if(_0x481fe9===_0x116775){return _0x3f7d23===_0x481fe9;}else{var _0x20a1a0=_0x23796a[_0x4018('0x1e')]();var _0x507019=_0x481fe9<_0x116775;let _0x546009=![];var _0x334eb5=0x0;var _0x2846c6=0x0;if(_0x507019){_0x334eb5=Math['max'](0x1,_0x481fe9);_0x2846c6=Math[_0x4018('0x1f')](_0x116775,_0x20a1a0);_0x546009=_0x3f7d23>=_0x334eb5&&_0x3f7d23<=_0x2846c6;}else{_0x334eb5=Math[_0x4018('0x1f')](_0x481fe9,_0x20a1a0);_0x2846c6=Math[_0x4018('0x20')](0x1,_0x116775);_0x546009=_0x3f7d23>=_0x334eb5||_0x3f7d23<=_0x2846c6;}return _0x546009;}}module[_0x4018('0xd')][_0x4018('0x21')]=domCompare;function monthCompare(_0x4173c1,_0x4ea8ab,_0x2ee2b7){var _0x4aedad=_0x4173c1[_0x4018('0x8')]('en')[_0x4018('0x1a')](_0x4018('0x22'))['toLowerCase']();return circularMonthInterval(_0x4ea8ab,_0x2ee2b7)[_0x4018('0x1c')](_0x4aedad);}module['exports'][_0x4018('0x23')]=monthCompare;function iftime(_0x44a72f,_0x2c0e96=moment['tz'][_0x4018('0x24')](),_0x13c57c=moment()){if(!validateRx[_0x4018('0x25')](_0x44a72f)){throw new Error(EINVALID_STRING);}else{var _0x5469c8=(moment['isMoment'](_0x13c57c)?_0x13c57c[_0x4018('0x11')]():moment(_0x13c57c))['tz'](_0x2c0e96)[_0x4018('0x8')]('en');throwIfDateNotValid(_0x5469c8);var _0x3caa5a=_0x44a72f['split'](',');var _0x41ede0=_0x3caa5a[0x0];var _0x33d530=_0x3caa5a[0x1];var _0x21e8a6=_0x3caa5a[0x2];var _0x28b9ab=_0x3caa5a[0x3];let _0x3b5f26=!![];if(_0x41ede0!=='*'){var _0x125642=_0x41ede0['split']('-');var _0x5de5a6=_['padStart'](_0x125642[0x0],0x5,'0');var _0x5c76ed=_0x125642['length']===0x2?_[_0x4018('0x26')](_0x125642[0x1],0x5,'0'):_0x5de5a6;_0x3b5f26=timeCompare(_0x5469c8,_0x5de5a6,_0x5c76ed);}let _0x41e285=!![];if(_0x33d530!=='*'){var _0x1c8fb5=_0x33d530[_0x4018('0x6')]('-');var _0x46558a=_0x1c8fb5[0x0];var _0x2194b8=_0x1c8fb5[_0x4018('0x27')]===0x2?_0x1c8fb5[0x1]:_0x46558a;_0x41e285=dowCompare(_0x5469c8,_0x46558a,_0x2194b8);}let _0xe6e87f=!![];if(_0x21e8a6!=='*'){var _0x59349c=_0x21e8a6[_0x4018('0x6')]('-');var _0x30a76a=parseDom(_0x59349c[0x0]);var _0x4302b2=_0x59349c[_0x4018('0x27')]===0x2?parseDom(_0x59349c[0x1]):_0x30a76a;_0xe6e87f=domCompare(_0x5469c8,_0x30a76a,_0x4302b2);}let _0x5d7103=!![];if(_0x28b9ab!=='*'){var _0x15c935=_0x28b9ab[_0x4018('0x6')]('-');var _0x37fc0b=_0x15c935[0x0];var _0x206b56=_0x15c935['length']===0x2?_0x15c935[0x1]:_0x15c935[0x0];_0x5d7103=monthCompare(_0x5469c8,_0x37fc0b,_0x206b56);}return _0x3b5f26&&_0x41e285&&_0xe6e87f&&_0x5d7103;}}module[_0x4018('0xd')][_0x4018('0x28')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index f4ce6f2..769cb10 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc8e3=['message','{{{','}}}','replace','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','transports','warn','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','debugLevel','redBG\x20white','red','bold\x20yellow','bold\x20white','gray','bold\x20magenta','bold\x20blue','/var/log/xcally','format','%s-%s.log'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xc8e3,0xc3));var _0x3c8e=function(_0x4e7889,_0x1f6faa){_0x4e7889=_0x4e7889-0x0;var _0x2bb6f5=_0xc8e3[_0x4e7889];return _0x2bb6f5;};'use strict';var path=require(_0x3c8e('0x0'));var util=require(_0x3c8e('0x1'));var moment=require(_0x3c8e('0x2'));var winston=require(_0x3c8e('0x3'));var config=require('../config/environment');var debugLevel=config[_0x3c8e('0x4')]?config[_0x3c8e('0x4')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x3c8e('0x5'),'error':_0x3c8e('0x6'),'warn':_0x3c8e('0x7'),'info':'white','print':_0x3c8e('0x8'),'success':'bold\x20green','http':_0x3c8e('0x9'),'verbose':_0x3c8e('0xa'),'debug':_0x3c8e('0xb'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x431216,_0x21dd0a,_0xe875b9){var _0x4f1078=_0x431216||_0x3c8e('0xc');return path['join'](_0x4f1078,util[_0x3c8e('0xd')](_0x3c8e('0xe'),_0x21dd0a,_0xe875b9));}function formatter(_0x3d97cf,_0x2db7b9){_0x2db7b9[_0x3c8e('0xf')]=_0x2db7b9[_0x3c8e('0xf')]['replace'](/@@{/g,_0x3c8e('0x10'))['replace'](/}@@/g,_0x3c8e('0x11'))[_0x3c8e('0x12')](/@{/g,'{{')[_0x3c8e('0x12')](/}@/g,'}}');return util[_0x3c8e('0xd')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x3c8e('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),_0x2db7b9[_0x3c8e('0x13')][_0x3c8e('0x14')](),_0x3d97cf,_0x2db7b9[_0x3c8e('0xf')]);}function fileFormat(_0x538883,_0x4b1ee6){_0x4b1ee6[_0x3c8e('0xf')]=_0x4b1ee6[_0x3c8e('0xf')][_0x3c8e('0x12')](/@@{/g,_0x3c8e('0x10'))[_0x3c8e('0x12')](/}@@/g,_0x3c8e('0x11'))[_0x3c8e('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x12123a=_0x4b1ee6[_0x3c8e('0x15')]&&Object[_0x3c8e('0x16')](_0x4b1ee6[_0x3c8e('0x15')])[_0x3c8e('0x17')]?'\x0a\x09'+JSON['stringify'](_0x4b1ee6[_0x3c8e('0x15')]):'';return util['format'](_0x3c8e('0x18'),moment()[_0x3c8e('0xd')](_0x3c8e('0x19')),_0x4b1ee6[_0x3c8e('0x13')]['toUpperCase'](),_0x538883,_0x4b1ee6['message'],_0x12123a);}function consoleLogger(){var _0x4f5f3a=new winston[(_0x3c8e('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3c8e('0x1b'))]['Console']({'level':_0x3c8e('0x1c'),'json':![],'formatter':function(_0x57fd26){return formatter('',_0x57fd26);}})]});return _0x4f5f3a;}function fileLogger(_0x4f81a6,_0x210f61){var _0x49e021=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3c8e('0x1b'))][(_0x3c8e('0x1d'))]({'name':util[_0x3c8e('0xd')](_0x3c8e('0x1e'),_0x4f81a6,_0x3c8e('0x1f')),'filename':getLogFileName(_0x210f61,_0x4f81a6,_0x3c8e('0x1f')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3d062d){return fileFormat(_0x4f81a6,_0x3d062d);}}),new winston[(_0x3c8e('0x1b'))][(_0x3c8e('0x1d'))]({'name':util['format'](_0x3c8e('0x1e'),_0x4f81a6,debugLevel),'filename':getLogFileName(_0x210f61,_0x4f81a6,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5846c5){return fileFormat(_0x4f81a6,_0x5846c5);}}),new winston[(_0x3c8e('0x1b'))][(_0x3c8e('0x20'))]({'level':_0x3c8e('0x1c'),'json':![],'formatter':function(_0x144c90){return fileFormat(_0x4f81a6,_0x144c90);}})]});return _0x49e021;}exports[_0x3c8e('0x21')]=consoleLogger;exports[_0x3c8e('0x22')]=fileLogger; \ No newline at end of file +var _0xf16a=['format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','path','util','moment','winston','debugLevel','info','redBG\x20white','red','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join'];(function(_0x1e1b5a,_0x13b534){var _0x3206db=function(_0x5d6c2f){while(--_0x5d6c2f){_0x1e1b5a['push'](_0x1e1b5a['shift']());}};_0x3206db(++_0x13b534);}(_0xf16a,0x1a6));var _0xaf16=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xf16a[_0x305c31];return _0x17f39f;};'use strict';var path=require(_0xaf16('0x0'));var util=require(_0xaf16('0x1'));var moment=require(_0xaf16('0x2'));var winston=require(_0xaf16('0x3'));var config=require('../config/environment');var debugLevel=config['debugLevel']?config[_0xaf16('0x4')]['toLowerCase']():_0xaf16('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xaf16('0x6'),'error':_0xaf16('0x7'),'warn':'bold\x20yellow','info':_0xaf16('0x8'),'print':_0xaf16('0x9'),'success':_0xaf16('0xa'),'http':_0xaf16('0xb'),'verbose':_0xaf16('0xc'),'debug':_0xaf16('0xd'),'silly':_0xaf16('0xe')};winston[_0xaf16('0xf')](XC_LOG_COLORS);function getLogFileName(_0x28a140,_0x4ecbd8,_0x38e2c0){var _0x21bbe4=_0x28a140||_0xaf16('0x10');return path[_0xaf16('0x11')](_0x21bbe4,util[_0xaf16('0x12')](_0xaf16('0x13'),_0x4ecbd8,_0x38e2c0));}function formatter(_0x442e4b,_0x1bbff9){_0x1bbff9[_0xaf16('0x14')]=_0x1bbff9[_0xaf16('0x14')]['replace'](/@@{/g,_0xaf16('0x15'))['replace'](/}@@/g,'}}}')[_0xaf16('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0xaf16('0x17'),moment()[_0xaf16('0x12')](_0xaf16('0x18')),_0x1bbff9[_0xaf16('0x19')][_0xaf16('0x1a')](),_0x442e4b,_0x1bbff9[_0xaf16('0x14')]);}function fileFormat(_0x3c84dc,_0x409357){_0x409357[_0xaf16('0x14')]=_0x409357[_0xaf16('0x14')][_0xaf16('0x16')](/@@{/g,_0xaf16('0x15'))[_0xaf16('0x16')](/}@@/g,'}}}')[_0xaf16('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0xbff232=_0x409357[_0xaf16('0x1b')]&&Object[_0xaf16('0x1c')](_0x409357[_0xaf16('0x1b')])[_0xaf16('0x1d')]?'\x0a\x09'+JSON[_0xaf16('0x1e')](_0x409357[_0xaf16('0x1b')]):'';return util[_0xaf16('0x12')](_0xaf16('0x1f'),moment()[_0xaf16('0x12')](_0xaf16('0x18')),_0x409357[_0xaf16('0x19')][_0xaf16('0x1a')](),_0x3c84dc,_0x409357[_0xaf16('0x14')],_0xbff232);}function consoleLogger(){var _0x5dd045=new winston[(_0xaf16('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xaf16('0x21'))][(_0xaf16('0x22'))]({'level':_0xaf16('0x23'),'json':![],'formatter':function(_0x1784f6){return formatter('',_0x1784f6);}})]});return _0x5dd045;}function fileLogger(_0x58933b,_0x1a2f08){var _0x2027c3=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xaf16('0x21'))][(_0xaf16('0x24'))]({'name':util[_0xaf16('0x12')]('%s-%s',_0x58933b,_0xaf16('0x25')),'filename':getLogFileName(_0x1a2f08,_0x58933b,_0xaf16('0x25')),'level':_0xaf16('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xda3110){return fileFormat(_0x58933b,_0xda3110);}}),new winston[(_0xaf16('0x21'))][(_0xaf16('0x24'))]({'name':util[_0xaf16('0x12')](_0xaf16('0x26'),_0x58933b,debugLevel),'filename':getLogFileName(_0x1a2f08,_0x58933b,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x82f5d5){return fileFormat(_0x58933b,_0x82f5d5);}}),new winston['transports']['Console']({'level':_0xaf16('0x23'),'json':![],'formatter':function(_0x40d38f){return fileFormat(_0x58933b,_0x40d38f);}})]});return _0x2027c3;}exports[_0xaf16('0x27')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 3c910f6..a0f737d 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x26253d,_0x5dfc80){var _0x318a82=function(_0x22ae6a){while(--_0x22ae6a){_0x26253d['push'](_0x26253d['shift']());}};_0x318a82(++_0x5dfc80);}(_0x2ef3,0xba));var _0x32ef=function(_0x28d38c,_0xd9c0fa){_0x28d38c=_0x28d38c-0x0;var _0x52980d=_0x2ef3[_0x28d38c];return _0x52980d;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x4613e1,_0x425216){var _0x333607=function(_0x446694){while(--_0x446694){_0x4613e1['push'](_0x4613e1['shift']());}};_0x333607(++_0x425216);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index c7348cf..5135396 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','{\x20{\x20'];(function(_0x4341d8,_0x20cc3c){var _0xf70f0b=function(_0xbf14e3){while(--_0xbf14e3){_0x4341d8['push'](_0x4341d8['shift']());}};_0xf70f0b(++_0x20cc3c);}(_0x5c3c,0x132));var _0xc5c3=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x5c3c[_0x38ced4];return _0x547c07;};var _=require(_0xc5c3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x40ad71){return _0x40ad71==='{{'?_0xc5c3('0x1'):_0xc5c3('0x2');}function safeTemplate(_0x4b9233){var _0x400726=_0x4b9233;if(typeof _0x4b9233===_0xc5c3('0x3')){_0x400726=_0x4b9233[_0xc5c3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc5c3('0x5')](_0x4b9233)){_0x400726=_0x4b9233[_0xc5c3('0x6')](function(_0x36525d){return safeTemplate(_0x36525d);});}else if(_[_0xc5c3('0x7')](_0x4b9233)){_0x400726=Object[_0xc5c3('0x8')](_0x4b9233)[_0xc5c3('0x9')](function(_0x5a392b,_0x4b8404){_0x5a392b[_0x4b8404]=safeTemplate(_0x4b9233[_0x4b8404]);return _0x5a392b;},{});}return _0x400726;}module['exports'][_0xc5c3('0xa')]=safeTemplate; \ No newline at end of file +var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x45db61,_0x19e3d9){var _0x3c875c=function(_0x3c472d){while(--_0x3c472d){_0x45db61['push'](_0x45db61['shift']());}};_0x3c875c(++_0x19e3d9);}(_0xef0f,0x168));var _0xfef0=function(_0x38e5ac,_0xbffa11){_0x38e5ac=_0x38e5ac-0x0;var _0xb886c8=_0xef0f[_0x38e5ac];return _0xb886c8;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 1e24917..3c1e671 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x632d=['writeJSON','exports','fs-extra','path','../config/environment','root','server/app.json','resolve','legacy-libs','isArray','apps','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','info'];(function(_0x448111,_0x58e259){var _0x97f145=function(_0x3fbcc3){while(--_0x3fbcc3){_0x448111['push'](_0x448111['shift']());}};_0x97f145(++_0x58e259);}(_0x632d,0x1a6));var _0xd632=function(_0x32be62,_0x22e6fd){_0x32be62=_0x32be62-0x0;var _0x1a37e9=_0x632d[_0x32be62];return _0x1a37e9;};var fs=require(_0xd632('0x0'));var path=require(_0xd632('0x1'));var config=require(_0xd632('0x2'));var root=config[_0xd632('0x3')];var APP_JSON_PATH=path['resolve'](root,_0xd632('0x4'));var NODEPATH=path[_0xd632('0x5')](root,_0xd632('0x6'));function setLegacyLibsNodeEnvPath(_0x1232e1){let _0x5d1327=![];if(Array[_0xd632('0x7')](_0x1232e1['apps'])){var _0x2c873b=_0x1232e1[_0xd632('0x8')]['findIndex'](function(_0x17defd){return _0x17defd[_0xd632('0x9')]===_0xd632('0xa');});if(_0x2c873b>-0x1){var _0x121ffa=_0x1232e1[_0xd632('0x8')][_0x2c873b];if(typeof _0x121ffa[_0xd632('0xb')][_0xd632('0xc')]!==_0xd632('0xd')){_0x121ffa[_0xd632('0xb')][_0xd632('0xc')]=NODEPATH;_0x5d1327=!![];}}return{'appConfig':_0x1232e1,'updated':_0x5d1327};}}function updateAppConfig(_0x3a84cc){return fs[_0xd632('0xe')](APP_JSON_PATH)[_0xd632('0xf')](function(_0x4c6d6d){if(_0x4c6d6d){return fs[_0xd632('0x10')](APP_JSON_PATH)['then'](function(_0xbc6bef){var _0x200690=setLegacyLibsNodeEnvPath(_0xbc6bef);if(_0x200690['updated']){_0x3a84cc[_0xd632('0x11')]('Updating\x20app.json');return fs[_0xd632('0x12')](APP_JSON_PATH,_0xbc6bef,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise['resolve']();}});}module[_0xd632('0x13')]=updateAppConfig; \ No newline at end of file +var _0x571f=['isArray','apps','findIndex','name','env','string','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','../config/environment','root','resolve','server/app.json'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x571f,0x19f));var _0xf571=function(_0x2ecc65,_0xd75c48){_0x2ecc65=_0x2ecc65-0x0;var _0x103cc3=_0x571f[_0x2ecc65];return _0x103cc3;};var fs=require(_0xf571('0x0'));var path=require('path');var config=require(_0xf571('0x1'));var root=config[_0xf571('0x2')];var APP_JSON_PATH=path[_0xf571('0x3')](root,_0xf571('0x4'));var NODEPATH=path['resolve'](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x418524){let _0x293af7=![];if(Array[_0xf571('0x5')](_0x418524[_0xf571('0x6')])){var _0x25610b=_0x418524[_0xf571('0x6')][_0xf571('0x7')](function(_0x26afbb){return _0x26afbb[_0xf571('0x8')]==='motion2';});if(_0x25610b>-0x1){var _0x1c81cc=_0x418524[_0xf571('0x6')][_0x25610b];if(typeof _0x1c81cc[_0xf571('0x9')]['NODE_PATH']!==_0xf571('0xa')){_0x1c81cc['env'][_0xf571('0xb')]=NODEPATH;_0x293af7=!![];}}return{'appConfig':_0x418524,'updated':_0x293af7};}}function updateAppConfig(_0x11adaa){return fs[_0xf571('0xc')](APP_JSON_PATH)[_0xf571('0xd')](function(_0x3560ef){if(_0x3560ef){return fs[_0xf571('0xe')](APP_JSON_PATH)[_0xf571('0xd')](function(_0x202847){var _0x2d37c2=setLegacyLibsNodeEnvPath(_0x202847);if(_0x2d37c2[_0xf571('0xf')]){_0x11adaa[_0xf571('0x10')](_0xf571('0x11'));return fs[_0xf571('0x12')](APP_JSON_PATH,_0x202847,{'spaces':0x2});}else{return Promise[_0xf571('0x3')]();}});}else{return Promise[_0xf571('0x3')]();}});}module[_0xf571('0x13')]=updateAppConfig; \ No newline at end of file